diff --git a/.gitignore b/.gitignore index 9df1358..001a4cf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules dist build out +.history .DS_Store .eslintcache *.log* diff --git a/src/renderer/components.d.ts b/src/renderer/components.d.ts index d8deeea..31faf23 100644 --- a/src/renderer/components.d.ts +++ b/src/renderer/components.d.ts @@ -8,6 +8,8 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default'] + Dialog: typeof import('./src/components/dialog/index.vue')['default'] Directory: typeof import('./src/components/dialog/directory.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] diff --git a/src/renderer/public/sdk/3rdparty/ewPlugins.min.js b/src/renderer/public/sdk/3rdparty/ewPlugins.min.js index ffd594b..2b89a81 100644 --- a/src/renderer/public/sdk/3rdparty/ewPlugins.min.js +++ b/src/renderer/public/sdk/3rdparty/ewPlugins.min.js @@ -810,6 +810,7 @@ else this.init(o, this.config) } + this.changeColor = g this.close = () => { this.pickerFlag = !this.pickerFlag, this.picker.style.opacity = 0 diff --git a/src/renderer/public/sdk/Cesium/Cesium2.js b/src/renderer/public/sdk/Cesium/Cesium2.js deleted file mode 100644 index 1bee2ab..0000000 --- a/src/renderer/public/sdk/Cesium/Cesium2.js +++ /dev/null @@ -1,11500 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.119 - * - * 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 Cesium2=(()=>{var lZe=Object.create;var IN=Object.defineProperty;var uZe=Object.getOwnPropertyDescriptor;var dZe=Object.getOwnPropertyNames;var mZe=Object.getPrototypeOf,fZe=Object.prototype.hasOwnProperty;var XN=(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 jc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hZe=(e,t)=>{for(var n in t)IN(e,n,{get:t[n],enumerable:!0})},hee=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dZe(t))!fZe.call(e,o)&&o!==n&&IN(e,o,{get:()=>t[o],enumerable:!(i=uZe(t,o))||i.enumerable});return e};var S=(e,t,n)=>(n=e!=null?lZe(mZe(e)):{},hee(t||!e||!e.__esModule?IN(n,"default",{value:e,enumerable:!0}):n,e)),pZe=e=>hee(IN({},"__esModule",{value:!0}),e);var T=jc(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFlTPU9iamVjdC5jcmVhdGU7dmFyIEZsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgJFM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgWlM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIFFTPU9iamVjdC5nZXRQcm90b3R5cGVPZixKUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBkcj0oZT0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkoZSx7Z2V0Oih0LG4pPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dClbbl19KTplKShmdW5jdGlvbihl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KXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJjYXJ0ZXNpYW4iLGUpLE1hdGgubWluKGUueCxlLnksZS56LGUudyl9O0xlLm1pbmltdW1CeUNvbXBvbmVudD1mdW5jdGlvbihlLHQsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLGUpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIix0KSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWluKGUueCx0LngpLG4ueT1NYXRoLm1pbihlLnksdC55KSxuLno9TWF0aC5taW4oZS56LHQueiksbi53PU1hdGgubWluKGUudyx0LncpLG59O0xlLm1heGltdW1CeUNvbXBvbmVudD1mdW5jdGlvbihlLHQsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLGUpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIix0KSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWF4KGUueCx0LngpLG4ueT1NYXRoLm1heChlLnksdC55KSxuLno9TWF0aC5tYXgoZS56LHQueiksbi53PU1hdGgubWF4KGUudyx0LncpLG59O0xlLmNsYW1wPWZ1bmN0aW9uKGUsdCxuLG8pe3kudHlwZU9mLm9iamVjdCgidmFsdWUiLGUpLHkudHlwZU9mLm9iamVjdCgibWluIix0KSx5LnR5cGVPZi5vYmplY3QoIm1heCIsbikseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG8pO2xldCByPU0uY2xhbXAoZS54LHQueCxuLngpLGk9TS5jbGFtcChlLnksdC55LG4ueSkscz1NLmNsYW1wKGUueix0Lnosbi56KSxmPU0uY2xhbXAoZS53LHQudyxuLncpO3JldHVybiBvLng9cixvLnk9aSxvLno9cyxvLnc9ZixvfTtMZS5tYWduaXR1ZGVTcXVhcmVkPWZ1bmN0aW9uKGUpe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsZSksZS54KmUueCtlLnk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2l0aW9uLnZhbHVlcy5wdXNoKHJbYiozKzNdLHJbYiozKzRdLHJbYiozKzVdKSxULnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChPLngsTy55LE8ueixPLngsTy55LE8ueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLFQubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxULm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLGEubmVnYXRlKHYsdiksYS5hZGQoRCx2LEwpLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRS54LEUueSxFLnosRS54LEUueSxFLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChFLngsRS55LEUueixFLngsRS55LEUueiksTi5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goaVt3KjNdLGlbdyozKzFdLGlbdyozKzJdKSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChpW3cqMyszXSxpW3cqMys0XSxpW3cqMys1XSk7bGV0IFU9ZWUuZnJvbUFycmF5KHMsYioyLFliKSxBPU1hdGguYWJzKFUueSk7VC5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSxBLDEsQSksVC5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSwtQSwxLC1BKSxOL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YXkoMTIqKGUqKGUrMSkpLTYpLG49MCxvLHIsaSxzLGY7Zm9yKG89MCxpPTEscz0wO3M8MztzKyspdFtuKytdPWkrKyx0W24rK109byx0W24rK109aTtmb3Iocz0yO3M8ZSsxOysrcyl7Zm9yKGk9cyoocysxKS0xLG89KHMtMSkqcy0xLHRbbisrXT1pKyssdFtuKytdPW8sdFtuKytdPWkscj0yKnMsZj0wO2Y8ci0xOysrZil0W24rK109aSx0W24rK109bysrLHRbbisrXT1vLHRbbisrXT1pKyssdFtuKytdPW8sdFtuKytdPWk7dFtuKytdPWkrKyx0W24rK109byx0W24rK109aX1mb3Iocj1lKjIsKytpLCsrbyxzPTA7czxyLTE7KytzKXRbbisrXT1pLHRbbisrXT1vKyssdFtuKytdPW8sdFtuKytdPWkrKyx0W24rK109byx0W24rK109aTtmb3IodFtuKytdPWksdFtuKytdPW8rKyx0W24rK109byx0W24rK109aSsrLHRbbisrXT1vKyssdFtuKytdPW8sKytvLHM9ZS0xO3M+MTstLXMpe2Zvcih0W24rK109bysrLHRbbisrXT1vLHRbbisrXT1pLHI9MipzLGY9MDtmPHItMTsrK2YpdFtuKytdPWksdFtuKytdPW8rKyx0W24rK109byx0W24rK109aSsrLHRbbisrXT1vLHRbbisrXT1pO3RbbisrXT1vKyssdFtuKytdPW8rKyx0W24rK109aSsrfWZvcihzPTA7czwzO3MrKyl0W24rK109bysrLHRbbisrXT1vLHRbbisrXT1pO3JldHVybiB0fWZ1bmN0aW9uIFVNKGUpe2xldCB0PWUuY2VudGVyO2NjPWEubXVsdGlwbHlCeVNjYWxhcihlLmVsbGlwc29pZC5nZW9kZXRpY1N1cmZhY2VOb3JtYWwodCxjYyksZS5oZWlnaHQsY2MpLGNjPWEuYWRkKHQsY2MsY2MpO2xldCBuPW5ldyBBZShjYyxlLnNlbWlNYWpvckF4aXMpLG89a3IuY29tcHV0ZUVsbGlwc2VQb3NpdGlvbnMoZSwhMCwhMSkscj1vLnBvc2l0aW9ucyxpPW8ubnVtU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U1hdGguc2luKFUpO2xldCBTPU1hdGguY29zKFUpLFA9c0wsQj1pTDtmb3IoXz0wO188aTtfKyspe2xldCBqPV8vaSpNLlRXT19QSSxIPVMqTWF0aC5jb3Moaiksaz1TKk1hdGguc2luKGopO2cmJihBLng9SCxBLnk9ayxJJiYoUD1hLm5vcm1hbGl6ZShhLmNyb3NzKGEuVU5JVF9aLEEsUCksUCkpLHIubm9ybWFsJiYocFtEKytdPUEueCxwW0QrK109QS55LHBbRCsrXT1BLnoscFtEKytdPUEueCxwW0QrK109QS55LHBbRCsrXT1BLnopLHIudGFuZ2VudCYmKGRbdisrXT1QLngsZFt2KytdPVAueSxkW3YrK109UC56LGRbdisrXT1QLngsZFt2KytdPVAueSxkW3YrK109UC56KSxyLmJpdGFuZ2VudCYmKEI9YS5ub3JtYWxpemUoYS5jcm9zcyhBLFAsQiksQiksbVtMKytdPUIueCxtW0wrK109Qi55LG1bTCsrXT1CLnosbVtMKytdPUIueCxtW0wrK109Qi55LG1bTCsrXT1CLnopKX1mb3IoXz0wO188aTtfKyspci5ub3JtYWwmJihwW0QrK109MCxwW0QrK109MCxwW0QrK109LTEpLHIudGFuZ2VudCYmKGRbdisrXT0xLGRbdisrXT0wLGRbdisrXT0wKSxyLmJpdGFuZ2VudCYmKG1bTCsrXT0wLG1bTCsrXT0tMSxtW0wrK109MCk7Zm9yKF89MDtfPGk7XysrKXIubm9ybWFsJiYocFtEKytdPTAscFtEKytdPTAscFtEKytdPTEpLHIudGFuZ2VudCYmKGRbdisrXT0xLGRbdisrXT0wLGRbdisrXT0wKSxyLmJpdGFuZ2VudCYmKG1bTCsrXT0wLG1bTCsrXT0xLG1bTCsrXT0wKX1sZXQgYj0xMippLTEyLHc9RGUuY3JlYXRlVHlwZWRBcnJheSh1LGIpLE89MCxFPTA7Zm9yKF89MDtfPGktMTtfKyspd1tPKytdPUUsd1tPKytdPUUrMix3W08rK109RSszLHdbTysrXT1FLHdbTysrXT1FKzMsd1tPKytdPUUrMSxFK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VuKCgpPT5zbygpKX0sX1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5XeSgpKX0seVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5ZeSgpKX0sZ1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5ReSgpKX0sQVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5lZygpKX0sYlY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5vZygpKX0sd1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5hZygpKX0sVFY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5sZygpKX0sT1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5tZygpKX0sRVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5BZygpKX0sUlY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5UZygpKX0sU1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT54ZygpKX0sQ1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5xZygpKX0seFY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT4kZygpKX0sUFY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5uMSgpKX0sTVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5vMSgpKX0sTlY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5pMSgpKX07cmV0dXJuIGVDKElWKTt9KSgpOwo=")});var PN=jc((SIt,bee)=>{var TIt=S(T()),Rp=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)};Rp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Rp.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};Rp.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>>1^t[e&1];for(;n>>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};Rp.prototype.random_int31=function(){return this.random_int()>>>1};Rp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Rp.prototype.random=function(){return this.random_int()*(1/4294967296)};Rp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Rp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};bee.exports=Rp});var Eee=jc((SC,TC)=>{var YXt=S(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof SC=="object"&&SC&&!SC.nodeType&&SC,n=typeof TC=="object"&&TC&&!TC.nodeType&&TC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,d=700,m=72,p=128,b="-",h=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,R=String.fromCharCode,G;function W(k){throw new RangeError(C[k])}function w(k,O){for(var U=k.length,j=[];U--;)j[U]=O(k[U]);return j}function P(k,O){var U=k.split("@"),j="";U.length>1&&(j=U[0]+"@",k=U[1]),k=k.replace(_,".");var K=k.split("."),te=w(K,O).join(".");return j+te}function F(k){for(var O=[],U=0,j=k.length,K,te;U=55296&&K<=56319&&U65535&&(O-=65536,U+=R(O>>>10&1023|55296),O=56320|O&1023),U+=R(O),U}).join("")}function g(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function Z(k,O){return k+22+75*(k<26)-((O!=0)<<5)}function E(k,O,U){var j=0;for(k=U?L(k/d):k>>1,k+=L(k/O);k>V*c>>1;j+=s)k=L(k/V);return L(j+(V+1)*k/(k+u))}function I(k){var O=[],U=k.length,j,K=0,te=p,z=m,q,ee,pe,xe,ce,ye,Te,Le,Xe;for(q=k.lastIndexOf(b),q<0&&(q=0),ee=0;ee=128&&W("not-basic"),O.push(k.charCodeAt(ee));for(pe=q>0?q+1:0;pe=U&&W("invalid-input"),Te=g(k.charCodeAt(pe++)),(Te>=s||Te>L((r-K)/ce))&&W("overflow"),K+=Te*ce,Le=ye<=z?a:ye>=z+c?c:ye-z,!(TeL(r/Xe)&&W("overflow"),ce*=Xe;j=O.length+1,z=E(K-xe,j,xe==0),L(K/j)>r-te&&W("overflow"),te+=L(K/j),K%=j,O.splice(K++,0,te)}return M(O)}function A(k){var O,U,j,K,te,z,q,ee,pe,xe,ce,ye=[],Te,Le,Xe,Re;for(k=F(k),Te=k.length,O=p,U=0,te=m,z=0;z=O&&ceL((r-U)/Le)&&W("overflow"),U+=(q-O)*Le,O=q,z=0;zr&&W("overflow"),ce==O){for(ee=U,pe=s;xe=pe<=te?a:pe>=te+c?c:pe-te,!(ee{var KXt=S(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 DN=="object"&&DN.exports?DN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Wee,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u1);p++)d.splice(0,1);s[m]=d.join("")}var b=-1,h=0,x=0,_=-1,C=!1;for(m=0;mh&&(b=_,h=x)):s[m]==="0"&&(C=!0,_=m,x=1);x>h&&(b=_,h=x),h>1&&s.splice(b,h,""),a=s.length;var V="";for(s[0]===""&&(V=":"),m=0;m{var zXt=S(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 BN=="object"&&BN.exports?BN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Xee,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 _u=jc((vee,ON)=>{var HXt=S(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 ON=="object"&&ON.exports?ON.exports=t(Eee(),Iee(),Pee()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(vee,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(Z,E){var I=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return I?A?new r(Z,E):new r(Z):new r;if(Z===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?Z=location.href+"":Z=""}if(Z===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(Z),E!==void 0?this.absoluteTo(E):this}function s(Z){return/^[0-9]+$/.test(Z)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(Z){return Z.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function d(Z){return Z===void 0?"Undefined":String(Object.prototype.toString.call(Z)).slice(8,-1)}function m(Z){return d(Z)==="Array"}function p(Z,E){var I={},A,N;if(d(E)==="RegExp")I=null;else if(m(E))for(A=0,N=E.length;A]+|\(([^\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(Z){if(!(!Z||!Z.nodeName)){var E=Z.nodeName.toLowerCase();if(!(E==="input"&&Z.type!=="image"))return r.domAttributes[E]}};function _(Z){return escape(Z)}function C(Z){return encodeURIComponent(Z).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(Z,E){var I=r.encode(Z+"");return E===void 0&&(E=r.escapeQuerySpace),E?I.replace(/%20/g,"+"):I},r.decodeQuery=function(Z,E){Z+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?Z.replace(/\+/g,"%20"):Z)}catch{return Z}};var V={encode:"encode",decode:"decode"},L,R=function(Z,E){return function(I){try{return r[E](I+"").replace(r.characters[Z][E].expression,function(A){return r.characters[Z][E].map[A]})}catch{return I}}};for(L in V)r[L+"PathSegment"]=R("pathname",V[L]),r[L+"UrnPathSegment"]=R("urnpath",V[L]);var G=function(Z,E,I){return function(A){var N;I?N=function(U){return r[E](r[I](U))}:N=r[E];for(var D=(A+"").split(Z),k=0,O=D.length;k-1&&(E.fragment=Z.substring(I+1)||null,Z=Z.substring(0,I)),I=Z.indexOf("?"),I>-1&&(E.query=Z.substring(I+1)||null,Z=Z.substring(0,I)),Z=Z.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),Z=Z.replace(/^[/\\]{2,}/i,"//"),Z.substring(0,2)==="//"?(E.protocol=null,Z=Z.substring(2),Z=r.parseAuthority(Z,E)):(I=Z.indexOf(":"),I>-1&&(E.protocol=Z.substring(0,I)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:Z.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(Z=Z.substring(I+3),Z=r.parseAuthority(Z,E)):(Z=Z.substring(I+1),E.urn=!0))),E.path=Z,E},r.parseHost=function(Z,E){Z||(Z=""),Z=Z.replace(/\\/g,"/");var I=Z.indexOf("/"),A,N;if(I===-1&&(I=Z.length),Z.charAt(0)==="[")A=Z.indexOf("]"),E.hostname=Z.substring(1,A)||null,E.port=Z.substring(A+2,I)||null,E.port==="/"&&(E.port=null);else{var D=Z.indexOf(":"),k=Z.indexOf("/"),O=Z.indexOf(":",D+1);O!==-1&&(k===-1||O-1?N:Z.length-1),k;return D>-1&&(N===-1||D-1?z=z.slice(0,q)+z.slice(q).replace(D,""):z=z.replace(D,""),!(z.length<=U[0].length)&&!(I.ignore&&I.ignore.test(z))){te=j+z.length;var xe=E(z,j,te,Z);if(xe===void 0){A.lastIndex=te;continue}xe=String(xe),Z=Z.slice(0,j)+xe+Z.slice(te),A.lastIndex=j+xe.length}}return A.lastIndex=0,Z},r.ensureValidHostname=function(Z,E){var I=!!Z,A=!!E,N=!1;if(A&&(N=b(r.hostProtocols,E)),N&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(Z&&Z.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(Z).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(Z){if(Z){var E=Number(Z);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+Z+'" is not a valid port')}},r.noConflict=function(Z){if(Z){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(Z){return Z===!0?this._deferred_build=!0:(Z===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function W(Z){return function(E,I){return E===void 0?this._parts[Z]||"":(this._parts[Z]=E||null,this.build(!I),this)}}function w(Z,E){return function(I,A){return I===void 0?this._parts[Z]||"":(I!==null&&(I=I+"",I.charAt(0)===E&&(I=I.substring(1))),this._parts[Z]=I,this.build(!A),this)}}a.protocol=W("protocol"),a.username=W("username"),a.password=W("password"),a.hostname=W("hostname"),a.port=W("port"),a.query=w("query","?"),a.fragment=w("fragment","#"),a.search=function(Z,E){var I=this.query(Z,E);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(Z,E){var I=this.fragment(Z,E);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(Z,E){if(Z===void 0||Z===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return Z?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=Z?r.recodeUrnPath(Z):"":this._parts.path=Z?r.recodePath(Z):"/",this.build(!E),this},a.path=a.pathname,a.href=function(Z,E){var I;if(Z===void 0)return this.toString();this._string="",this._parts=r._parts();var A=Z instanceof r,N=typeof Z=="object"&&(Z.hostname||Z.path||Z.pathname);if(Z.nodeName){var D=r.getDomAttribute(Z);Z=Z[D]||"",N=!1}if(!A&&N&&Z.pathname!==void 0&&(Z=Z.toString()),typeof Z=="string"||Z instanceof String)this._parts=r.parse(String(Z),this._parts);else if(A||N){var k=A?Z._parts:Z;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(!E),this},a.is=function(Z){var E=!1,I=!1,A=!1,N=!1,D=!1,k=!1,O=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),E=I||A,N=!E,D=N&&n&&n.has(this._parts.hostname),k=N&&r.idn_expression.test(this._parts.hostname),O=N&&r.punycode_expression.test(this._parts.hostname)),Z.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return N;case"sld":return D;case"ip":return E;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return A;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var P=a.protocol,F=a.port,M=a.hostname;a.protocol=function(Z,E){if(Z&&(Z=Z.replace(/:(\/\/)?$/,""),!Z.match(r.protocol_expression)))throw new TypeError('Protocol "'+Z+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,Z,E)},a.scheme=a.protocol,a.port=function(Z,E){return this._parts.urn?Z===void 0?"":this:(Z!==void 0&&(Z===0&&(Z=null),Z&&(Z+="",Z.charAt(0)===":"&&(Z=Z.substring(1)),r.ensureValidPort(Z))),F.call(this,Z,E))},a.hostname=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(Z,I);if(A!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');Z=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(Z,this._parts.protocol)}return M.call(this,Z,E)},a.origin=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0){var I=this.protocol(),A=this.authority();return A?(I?I+"://":"")+this.authority():""}else{var N=r(Z);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(Z,this._parts);if(I!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(Z,this._parts);if(I!=="/")throw new TypeError('Hostname "'+Z+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return Z[Z.length-1]!=="@"&&(Z+="@"),r.parseUserinfo(Z,this._parts),this.build(!E),this},a.resource=function(Z,E){var I;return Z===void 0?this.path()+this.search()+this.hash():(I=r.parse(Z),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!E),this)},a.subdomain=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===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 A=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,A),D=new RegExp("^"+u(N));if(Z&&Z.charAt(Z.length-1)!=="."&&(Z+="."),Z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return Z&&r.ensureValidHostname(Z,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,Z),this.build(!E),this}},a.domain=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z=="boolean"&&(E=Z,Z=void 0),Z===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 A=this._parts.hostname.length-this.tld(E).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!Z)throw new TypeError("cannot set domain empty");if(Z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(Z,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=Z;else{var N=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,Z)}return this.build(!E),this}},a.tld=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z=="boolean"&&(E=Z,Z=void 0),Z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(I+1);return E!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var N;if(Z)if(Z.match(/[^a-zA-Z0-9-]/))if(n&&n.is(Z))N=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,Z);else throw new TypeError('TLD "'+Z+'" 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");N=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,Z)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0||Z===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return Z?r.decodePath(A):A}else{var N=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,N),k=new RegExp("^"+u(D));return this.is("relative")||(Z||(Z="/"),Z.charAt(0)!=="/"&&(Z="/"+Z)),Z&&Z.charAt(Z.length-1)!=="/"&&(Z+="/"),Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(k,Z),this.build(!E),this}},a.filename=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(typeof Z!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(I+1);return Z?r.decodePathSegment(A):A}else{var N=!1;Z.charAt(0)==="/"&&(Z=Z.substring(1)),Z.match(/\.?\//)&&(N=!0);var D=new RegExp(u(this.filename())+"$");return Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(D,Z),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(Z,E){if(this._parts.urn)return Z===void 0?"":this;if(Z===void 0||Z===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),A=I.lastIndexOf("."),N,D;return A===-1?"":(N=I.substring(A+1),D=/^[a-z0-9%]+$/i.test(N)?N:"",Z?r.decodePathSegment(D):D)}else{Z.charAt(0)==="."&&(Z=Z.substring(1));var k=this.suffix(),O;if(k)Z?O=new RegExp(u(k)+"$"):O=new RegExp(u("."+k)+"$");else{if(!Z)return this;this._parts.path+="."+r.recodePath(Z)}return O&&(Z=r.recodePath(Z),this._parts.path=this._parts.path.replace(O,Z)),this.build(!E),this}},a.segment=function(Z,E,I){var A=this._parts.urn?":":"/",N=this.path(),D=N.substring(0,1)==="/",k=N.split(A);if(Z!==void 0&&typeof Z!="number"&&(I=E,E=Z,Z=void 0),Z!==void 0&&typeof Z!="number")throw new Error('Bad segment "'+Z+'", must be 0-based integer');if(D&&k.shift(),Z<0&&(Z=Math.max(k.length+Z,0)),E===void 0)return Z===void 0?k:k[Z];if(Z===null||k[Z]===void 0)if(m(E)){k=[];for(var O=0,U=E.length;O{var ern=S(T());/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */(function(e,t){typeof sz=="object"&&typeof az<"u"?az.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(sz,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:u}=typeof Reflect<"u"&&Reflect;r||(r=function(et){return et}),s||(s=function(et){return et}),c||(c=function(et,qe,$e){return et.apply(qe,$e)}),u||(u=function(et,qe){return new et(...qe)});let d=W(Array.prototype.forEach),m=W(Array.prototype.pop),p=W(Array.prototype.push),b=W(String.prototype.toLowerCase),h=W(String.prototype.toString),x=W(String.prototype.match),_=W(String.prototype.replace),C=W(String.prototype.indexOf),V=W(String.prototype.trim),L=W(Object.prototype.hasOwnProperty),R=W(RegExp.prototype.test),G=w(TypeError);function W(Be){return function(et){for(var qe=arguments.length,$e=new Array(qe>1?qe-1:0),Kt=1;Kt2&&arguments[2]!==void 0?arguments[2]:b;t&&t(Be,null);let $e=et.length;for(;$e--;){let Kt=et[$e];if(typeof Kt=="string"){let ge=qe(Kt);ge!==Kt&&(n(et)||(et[$e]=ge),Kt=ge)}Be[Kt]=!0}return Be}function F(Be){for(let et=0;et/gm),q=s(/\${[\w\W]*}/gm),ee=s(/^data-[\-\w.\u00B7-\uFFFF]/),pe=s(/^aria-[\-\w]+$/),xe=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ce=s(/^(?:\w+script|data):/i),ye=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Te=s(/^html$/i),Le=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Xe=Object.freeze({__proto__:null,MUSTACHE_EXPR:te,ERB_EXPR:z,TMPLIT_EXPR:q,DATA_ATTR:ee,ARIA_ATTR:pe,IS_ALLOWED_URI:xe,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:ye,DOCTYPE_NAME:Te,CUSTOM_ELEMENT:Le});let Re={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ne=function(){return typeof window>"u"?null:window},yt=function(et,qe){if(typeof et!="object"||typeof et.createPolicy!="function")return null;let $e=null,Kt="data-tt-policy-suffix";qe&&qe.hasAttribute(Kt)&&($e=qe.getAttribute(Kt));let ge="dompurify"+($e?"#"+$e:"");try{return et.createPolicy(ge,{createHTML(Ve){return Ve},createScriptURL(Ve){return Ve}})}catch{return console.warn("TrustedTypes policy "+ge+" could not be created."),null}};function Nt(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ne(),et=Gn=>Nt(Gn);if(et.version="3.1.6",et.removed=[],!Be||!Be.document||Be.document.nodeType!==Re.document)return et.isSupported=!1,et;let{document:qe}=Be,$e=qe,Kt=$e.currentScript,{DocumentFragment:ge,HTMLTemplateElement:Ve,Node:Ht,Element:xt,NodeFilter:fi,NamedNodeMap:vo=Be.NamedNodeMap||Be.MozNamedAttrMap,HTMLFormElement:Ms,DOMParser:sa,trustedTypes:Jr}=Be,Qr=xt.prototype,Ye=g(Qr,"cloneNode"),st=g(Qr,"remove"),ot=g(Qr,"nextSibling"),tt=g(Qr,"childNodes"),St=g(Qr,"parentNode");if(typeof Ve=="function"){let Gn=qe.createElement("template");Gn.content&&Gn.content.ownerDocument&&(qe=Gn.content.ownerDocument)}let Et,Sn="",{implementation:Co,createNodeIterator:mr,createDocumentFragment:oc,getElementsByTagName:rc}=qe,{importNode:Rr}=$e,ui={};et.isSupported=typeof e=="function"&&typeof St=="function"&&Co&&Co.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Cs,ERB_EXPR:Gr,TMPLIT_EXPR:sc,DATA_ATTR:jo,ARIA_ATTR:Er,IS_SCRIPT_OR_DATA:xx,ATTR_WHITESPACE:ac,CUSTOM_ELEMENT:Hc}=Xe,{IS_ALLOWED_URI:K0}=Xe,to=null,cc=P({},[...Z,...E,...I,...N,...k]),ms=null,Wr=P({},[...O,...U,...j,...K]),ho=Object.seal(a(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}})),Jc=null,z0=null,jr=!0,qr=!0,H0=!1,LN=!0,_x=!1,H3=!0,Sx=!1,J3=!1,Q3=!1,fC=!1,ZN=!1,RN=!1,z$=!0,H$=!1,tZe="user-content-",j3=!0,XZ=!1,hC={},pC=null,J$=P({},["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"]),Q$=null,j$=P({},["audio","video","img","source","image","track"]),q3=null,q$=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),GN="http://www.w3.org/1998/Math/MathML",EN="http://www.w3.org/2000/svg",Lp="http://www.w3.org/1999/xhtml",bC=Lp,$3=!1,eY=null,nZe=P({},[GN,EN,Lp],h),PZ=null,iZe=["application/xhtml+xml","text/html"],oZe="text/html",aa=null,gC=null,rZe=qe.createElement("form"),$$=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},tY=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(gC&&gC===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=M(Ee),PZ=iZe.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?oZe:Ee.PARSER_MEDIA_TYPE,aa=PZ==="application/xhtml+xml"?h:b,to=L(Ee,"ALLOWED_TAGS")?P({},Ee.ALLOWED_TAGS,aa):cc,ms=L(Ee,"ALLOWED_ATTR")?P({},Ee.ALLOWED_ATTR,aa):Wr,eY=L(Ee,"ALLOWED_NAMESPACES")?P({},Ee.ALLOWED_NAMESPACES,h):nZe,q3=L(Ee,"ADD_URI_SAFE_ATTR")?P(M(q$),Ee.ADD_URI_SAFE_ATTR,aa):q$,Q$=L(Ee,"ADD_DATA_URI_TAGS")?P(M(j$),Ee.ADD_DATA_URI_TAGS,aa):j$,pC=L(Ee,"FORBID_CONTENTS")?P({},Ee.FORBID_CONTENTS,aa):J$,Jc=L(Ee,"FORBID_TAGS")?P({},Ee.FORBID_TAGS,aa):{},z0=L(Ee,"FORBID_ATTR")?P({},Ee.FORBID_ATTR,aa):{},hC=L(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,jr=Ee.ALLOW_ARIA_ATTR!==!1,qr=Ee.ALLOW_DATA_ATTR!==!1,H0=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,LN=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_x=Ee.SAFE_FOR_TEMPLATES||!1,H3=Ee.SAFE_FOR_XML!==!1,Sx=Ee.WHOLE_DOCUMENT||!1,fC=Ee.RETURN_DOM||!1,ZN=Ee.RETURN_DOM_FRAGMENT||!1,RN=Ee.RETURN_TRUSTED_TYPE||!1,Q3=Ee.FORCE_BODY||!1,z$=Ee.SANITIZE_DOM!==!1,H$=Ee.SANITIZE_NAMED_PROPS||!1,j3=Ee.KEEP_CONTENT!==!1,XZ=Ee.IN_PLACE||!1,K0=Ee.ALLOWED_URI_REGEXP||xe,bC=Ee.NAMESPACE||Lp,ho=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&$$(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ho.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&$$(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ho.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ho.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_x&&(qr=!1),ZN&&(fC=!0),hC&&(to=P({},k),ms=[],hC.html===!0&&(P(to,Z),P(ms,O)),hC.svg===!0&&(P(to,E),P(ms,U),P(ms,K)),hC.svgFilters===!0&&(P(to,I),P(ms,U),P(ms,K)),hC.mathMl===!0&&(P(to,N),P(ms,j),P(ms,K))),Ee.ADD_TAGS&&(to===cc&&(to=M(to)),P(to,Ee.ADD_TAGS,aa)),Ee.ADD_ATTR&&(ms===Wr&&(ms=M(ms)),P(ms,Ee.ADD_ATTR,aa)),Ee.ADD_URI_SAFE_ATTR&&P(q3,Ee.ADD_URI_SAFE_ATTR,aa),Ee.FORBID_CONTENTS&&(pC===J$&&(pC=M(pC)),P(pC,Ee.FORBID_CONTENTS,aa)),j3&&(to["#text"]=!0),Sx&&P(to,["html","head","body"]),to.table&&(P(to,["tbody"]),delete Jc.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Et=Ee.TRUSTED_TYPES_POLICY,Sn=Et.createHTML("")}else Et===void 0&&(Et=yt(Jr,Kt)),Et!==null&&typeof Sn=="string"&&(Sn=Et.createHTML(""));r&&r(Ee),gC=Ee}},eee=P({},["mi","mo","mn","ms","mtext"]),tee=P({},["foreignobject","annotation-xml"]),sZe=P({},["title","style","font","a","script"]),nee=P({},[...E,...I,...A]),iee=P({},[...N,...D]),aZe=function(Ee){let wt=St(Ee);(!wt||!wt.tagName)&&(wt={namespaceURI:bC,tagName:"template"});let xn=b(Ee.tagName),qo=b(wt.tagName);return eY[Ee.namespaceURI]?Ee.namespaceURI===EN?wt.namespaceURI===Lp?xn==="svg":wt.namespaceURI===GN?xn==="svg"&&(qo==="annotation-xml"||eee[qo]):!!nee[xn]:Ee.namespaceURI===GN?wt.namespaceURI===Lp?xn==="math":wt.namespaceURI===EN?xn==="math"&&tee[qo]:!!iee[xn]:Ee.namespaceURI===Lp?wt.namespaceURI===EN&&!tee[qo]||wt.namespaceURI===GN&&!eee[qo]?!1:!iee[xn]&&(sZe[xn]||!nee[xn]):!!(PZ==="application/xhtml+xml"&&eY[Ee.namespaceURI]):!1},nh=function(Ee){p(et.removed,{element:Ee});try{St(Ee).removeChild(Ee)}catch{st(Ee)}},WN=function(Ee,wt){try{p(et.removed,{attribute:wt.getAttributeNode(Ee),from:wt})}catch{p(et.removed,{attribute:null,from:wt})}if(wt.removeAttribute(Ee),Ee==="is"&&!ms[Ee])if(fC||ZN)try{nh(wt)}catch{}else try{wt.setAttribute(Ee,"")}catch{}},oee=function(Ee){let wt=null,xn=null;if(Q3)Ee=""+Ee;else{let wa=x(Ee,/^[\r\n\t ]+/);xn=wa&&wa[0]}PZ==="application/xhtml+xml"&&bC===Lp&&(Ee=''+Ee+"");let qo=Et?Et.createHTML(Ee):Ee;if(bC===Lp)try{wt=new sa().parseFromString(qo,PZ)}catch{}if(!wt||!wt.documentElement){wt=Co.createDocument(bC,"template",null);try{wt.documentElement.innerHTML=$3?Sn:qo}catch{}}let lc=wt.body||wt.documentElement;return Ee&&xn&&lc.insertBefore(qe.createTextNode(xn),lc.childNodes[0]||null),bC===Lp?rc.call(wt,Sx?"html":"body")[0]:Sx?wt.documentElement:lc},ree=function(Ee){return mr.call(Ee.ownerDocument||Ee,Ee,fi.SHOW_ELEMENT|fi.SHOW_COMMENT|fi.SHOW_TEXT|fi.SHOW_PROCESSING_INSTRUCTION|fi.SHOW_CDATA_SECTION,null)},see=function(Ee){return Ee instanceof Ms&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof vo)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},aee=function(Ee){return typeof Ht=="function"&&Ee instanceof Ht},Zp=function(Ee,wt,xn){ui[Ee]&&d(ui[Ee],qo=>{qo.call(et,wt,xn,gC)})},cee=function(Ee){let wt=null;if(Zp("beforeSanitizeElements",Ee,null),see(Ee))return nh(Ee),!0;let xn=aa(Ee.nodeName);if(Zp("uponSanitizeElement",Ee,{tagName:xn,allowedTags:to}),Ee.hasChildNodes()&&!aee(Ee.firstElementChild)&&R(/<[/\w]/g,Ee.innerHTML)&&R(/<[/\w]/g,Ee.textContent)||Ee.nodeType===Re.progressingInstruction||H3&&Ee.nodeType===Re.comment&&R(/<[/\w]/g,Ee.data))return nh(Ee),!0;if(!to[xn]||Jc[xn]){if(!Jc[xn]&&uee(xn)&&(ho.tagNameCheck instanceof RegExp&&R(ho.tagNameCheck,xn)||ho.tagNameCheck instanceof Function&&ho.tagNameCheck(xn)))return!1;if(j3&&!pC[xn]){let qo=St(Ee)||Ee.parentNode,lc=tt(Ee)||Ee.childNodes;if(lc&&qo){let wa=lc.length;for(let vl=wa-1;vl>=0;--vl){let ih=Ye(lc[vl],!0);ih.__removalCount=(Ee.__removalCount||0)+1,qo.insertBefore(ih,ot(Ee))}}}return nh(Ee),!0}return Ee instanceof xt&&!aZe(Ee)||(xn==="noscript"||xn==="noembed"||xn==="noframes")&&R(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(nh(Ee),!0):(_x&&Ee.nodeType===Re.text&&(wt=Ee.textContent,d([Cs,Gr,sc],qo=>{wt=_(wt,qo," ")}),Ee.textContent!==wt&&(p(et.removed,{element:Ee.cloneNode()}),Ee.textContent=wt)),Zp("afterSanitizeElements",Ee,null),!1)},lee=function(Ee,wt,xn){if(z$&&(wt==="id"||wt==="name")&&(xn in qe||xn in rZe))return!1;if(!(qr&&!z0[wt]&&R(jo,wt))){if(!(jr&&R(Er,wt))){if(!ms[wt]||z0[wt]){if(!(uee(Ee)&&(ho.tagNameCheck instanceof RegExp&&R(ho.tagNameCheck,Ee)||ho.tagNameCheck instanceof Function&&ho.tagNameCheck(Ee))&&(ho.attributeNameCheck instanceof RegExp&&R(ho.attributeNameCheck,wt)||ho.attributeNameCheck instanceof Function&&ho.attributeNameCheck(wt))||wt==="is"&&ho.allowCustomizedBuiltInElements&&(ho.tagNameCheck instanceof RegExp&&R(ho.tagNameCheck,xn)||ho.tagNameCheck instanceof Function&&ho.tagNameCheck(xn))))return!1}else if(!q3[wt]){if(!R(K0,_(xn,ac,""))){if(!((wt==="src"||wt==="xlink:href"||wt==="href")&&Ee!=="script"&&C(xn,"data:")===0&&Q$[Ee])){if(!(H0&&!R(xx,_(xn,ac,"")))){if(xn)return!1}}}}}}return!0},uee=function(Ee){return Ee!=="annotation-xml"&&x(Ee,Hc)},dee=function(Ee){Zp("beforeSanitizeAttributes",Ee,null);let{attributes:wt}=Ee;if(!wt)return;let xn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ms},qo=wt.length;for(;qo--;){let lc=wt[qo],{name:wa,namespaceURI:vl,value:ih}=lc,vZ=aa(wa),Qc=wa==="value"?ih:V(ih);if(xn.attrName=vZ,xn.attrValue=Qc,xn.keepAttr=!0,xn.forceKeepAttr=void 0,Zp("uponSanitizeAttribute",Ee,xn),Qc=xn.attrValue,H3&&R(/((--!?|])>)|<\/(style|title)/i,Qc)){WN(wa,Ee);continue}if(xn.forceKeepAttr||(WN(wa,Ee),!xn.keepAttr))continue;if(!LN&&R(/\/>/i,Qc)){WN(wa,Ee);continue}_x&&d([Cs,Gr,sc],fee=>{Qc=_(Qc,fee," ")});let mee=aa(Ee.nodeName);if(lee(mee,vZ,Qc)){if(H$&&(vZ==="id"||vZ==="name")&&(WN(wa,Ee),Qc=tZe+Qc),Et&&typeof Jr=="object"&&typeof Jr.getAttributeType=="function"&&!vl)switch(Jr.getAttributeType(mee,vZ)){case"TrustedHTML":{Qc=Et.createHTML(Qc);break}case"TrustedScriptURL":{Qc=Et.createScriptURL(Qc);break}}try{vl?Ee.setAttributeNS(vl,wa,Qc):Ee.setAttribute(wa,Qc),see(Ee)?nh(Ee):m(et.removed)}catch{}}}Zp("afterSanitizeAttributes",Ee,null)},cZe=function Gn(Ee){let wt=null,xn=ree(Ee);for(Zp("beforeSanitizeShadowDOM",Ee,null);wt=xn.nextNode();)Zp("uponSanitizeShadowNode",wt,null),!cee(wt)&&(wt.content instanceof ge&&Gn(wt.content),dee(wt));Zp("afterSanitizeShadowDOM",Ee,null)};return et.sanitize=function(Gn){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt=null,xn=null,qo=null,lc=null;if($3=!Gn,$3&&(Gn=""),typeof Gn!="string"&&!aee(Gn))if(typeof Gn.toString=="function"){if(Gn=Gn.toString(),typeof Gn!="string")throw G("dirty is not a string, aborting")}else throw G("toString is not a function");if(!et.isSupported)return Gn;if(J3||tY(Ee),et.removed=[],typeof Gn=="string"&&(XZ=!1),XZ){if(Gn.nodeName){let ih=aa(Gn.nodeName);if(!to[ih]||Jc[ih])throw G("root node is forbidden and cannot be sanitized in-place")}}else if(Gn instanceof Ht)wt=oee(""),xn=wt.ownerDocument.importNode(Gn,!0),xn.nodeType===Re.element&&xn.nodeName==="BODY"||xn.nodeName==="HTML"?wt=xn:wt.appendChild(xn);else{if(!fC&&!_x&&!Sx&&Gn.indexOf("<")===-1)return Et&&RN?Et.createHTML(Gn):Gn;if(wt=oee(Gn),!wt)return fC?null:RN?Sn:""}wt&&Q3&&nh(wt.firstChild);let wa=ree(XZ?Gn:wt);for(;qo=wa.nextNode();)cee(qo)||(qo.content instanceof ge&&cZe(qo.content),dee(qo));if(XZ)return Gn;if(fC){if(ZN)for(lc=oc.call(wt.ownerDocument);wt.firstChild;)lc.appendChild(wt.firstChild);else lc=wt;return(ms.shadowroot||ms.shadowrootmode)&&(lc=Rr.call($e,lc,!0)),lc}let vl=Sx?wt.outerHTML:wt.innerHTML;return Sx&&to["!doctype"]&&wt.ownerDocument&&wt.ownerDocument.doctype&&wt.ownerDocument.doctype.name&&R(Te,wt.ownerDocument.doctype.name)&&(vl=" -`+vl),_x&&d([Cs,Gr,sc],ih=>{vl=_(vl,ih," ")}),Et&&RN?Et.createHTML(vl):vl},et.setConfig=function(){let Gn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tY(Gn),J3=!0},et.clearConfig=function(){gC=null,J3=!1},et.isValidAttribute=function(Gn,Ee,wt){gC||tY({});let xn=aa(Gn),qo=aa(Ee);return lee(xn,qo,wt)},et.addHook=function(Gn,Ee){typeof Ee=="function"&&(ui[Gn]=ui[Gn]||[],p(ui[Gn],Ee))},et.removeHook=function(Gn){if(ui[Gn])return m(ui[Gn])},et.removeHooks=function(Gn){ui[Gn]&&(ui[Gn]=[])},et.removeAllHooks=function(){ui={}},et}var pt=Nt();return pt})});var Bse=jc((Ogn,zz)=>{"use strict";var Ygn=S(T());zz.exports=hU;zz.exports.default=hU;function hU(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=Use(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,u,d,m,p,b;if(i&&(r=b5e(e,t,r,n)),e.length>80*n){a=u=e[0],c=d=e[1];for(var h=n;hu&&(u=m),p>d&&(d=p);b=Math.max(u-a,d-c),b=b!==0?32767/b:0}return EI(r,s,n,a,c,b,0),s}function Use(e,t,n,i,o){var r,s;if(o===Kz(e,t,n,i)>0)for(r=t;r=t;r-=i)s=Nse(r,e[r],e[r+1],s);return s&&pU(s,s.next)&&(II(s),s=s.next),s}function F_(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(pU(n,n.next)||wr(n.prev,n,n.next)===0)){if(II(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function EI(e,t,n,i,o,r,s){if(e){!s&&r&&S5e(e,i,o,r);for(var a=e,c,u;e.prev!==e.next;){if(c=e.prev,u=e.next,r?f5e(e,i,o,r):m5e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),II(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=h5e(F_(e),t,n),EI(e,t,n,i,o,r,2)):s===2&&p5e(e,t,n,i,o,r):EI(F_(e),t,n,i,o,r,1);break}}}}function m5e(e){var t=e.prev,n=e,i=e.next;if(wr(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,d=or?o>s?o:s:r>s?r:s,b=a>c?a>u?a:u:c>u?c:u,h=i.next;h!==t;){if(h.x>=d&&h.x<=p&&h.y>=m&&h.y<=b&&p1(o,a,r,c,s,u,h.x,h.y)&&wr(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function f5e(e,t,n,i){var o=e.prev,r=e,s=e.next;if(wr(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,u=s.x,d=o.y,m=r.y,p=s.y,b=ac?a>u?a:u:c>u?c:u,_=d>m?d>p?d:p:m>p?m:p,C=Oz(b,h,t,n,i),V=Oz(x,_,t,n,i),L=e.prevZ,R=e.nextZ;L&&L.z>=C&&R&&R.z<=V;){if(L.x>=b&&L.x<=x&&L.y>=h&&L.y<=_&&L!==o&&L!==s&&p1(a,d,c,m,u,p,L.x,L.y)&&wr(L.prev,L,L.next)>=0||(L=L.prevZ,R.x>=b&&R.x<=x&&R.y>=h&&R.y<=_&&R!==o&&R!==s&&p1(a,d,c,m,u,p,R.x,R.y)&&wr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;L&&L.z>=C;){if(L.x>=b&&L.x<=x&&L.y>=h&&L.y<=_&&L!==o&&L!==s&&p1(a,d,c,m,u,p,L.x,L.y)&&wr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;R&&R.z<=V;){if(R.x>=b&&R.x<=x&&R.y>=h&&R.y<=_&&R!==o&&R!==s&&p1(a,d,c,m,u,p,R.x,R.y)&&wr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function h5e(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!pU(o,r)&&kse(o,i,i.next,r)&&WI(o,r)&&WI(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),II(i),II(i.next),i=e=r),i=i.next}while(i!==e);return F_(i)}function p5e(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&V5e(s,a)){var c=Dse(s,a);s=F_(s,s.next),c=F_(c,c.next),EI(s,t,n,i,o,r,0),EI(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function b5e(e,t,n,i){var o=[],r,s,a,c,u;for(r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x=n.x&&n.x>=u&&i!==n.x&&p1(os.x||n.x===s.x&&_5e(s,n)))&&(s=n,m=p)),n=n.next;while(n!==c);return s}function _5e(e,t){return wr(e.prev,e,t.prev)<0&&wr(t.next,e,e.next)<0}function S5e(e,t,n,i){var o=e;do o.z===0&&(o.z=Oz(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,T5e(o)}function T5e(e){var t,n,i,o,r,s,a,c,u=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(s>1);return e}function Oz(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 C5e(e){var t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function V5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!L5e(e,t)&&(WI(e,t)&&WI(t,e)&&Z5e(e,t)&&(wr(e.prev,e,t.prev)||wr(e,t.prev,t))||pU(e,t)&&wr(e.prev,e,e.next)>0&&wr(t.prev,t,t.next)>0)}function wr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function pU(e,t){return e.x===t.x&&e.y===t.y}function kse(e,t,n,i){var o=fU(wr(e,t,n)),r=fU(wr(e,t,i)),s=fU(wr(n,i,e)),a=fU(wr(n,i,t));return!!(o!==r&&s!==a||o===0&&mU(e,n,t)||r===0&&mU(e,i,t)||s===0&&mU(n,e,i)||a===0&&mU(n,t,i))}function mU(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 fU(e){return e>0?1:e<0?-1:0}function L5e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&kse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function WI(e,t){return wr(e.prev,e,e.next)<0?wr(e,t,e.next)>=0&&wr(e,e.prev,t)>=0:wr(e,t,e.prev)<0||wr(e,e.next,t)<0}function Z5e(e,t){var 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 Dse(e,t){var n=new Yz(e.i,e.x,e.y),i=new Yz(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 Nse(e,t,n,i){var o=new Yz(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 II(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 Yz(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}hU.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(Kz(e,0,r,n));if(o)for(var a=0,c=t.length;a0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var jle=jc((X9n,Qle)=>{"use strict";var P9n=S(T());Qle.exports=lHe;var O2=1e20;function lHe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,d,m,p,b,h,x;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?d=t.stride:d=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,d=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,d=4):window.ImageData&&e instanceof window.ImageData&&(b=e,r=e.width,s=e.height,c=b.data,d=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),h=0,x=Math.floor(u.length/d);h{var $9n=S(T());function _He(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,d=10,m=11,p=12,b=13,h=14,x=15,_=16,C=17,V=0,L=1,R=2,G=3,W=4;function w(g,Z){return 55296<=g.charCodeAt(Z)&&g.charCodeAt(Z)<=56319&&56320<=g.charCodeAt(Z+1)&&g.charCodeAt(Z+1)<=57343}function P(g,Z){Z===void 0&&(Z=0);var E=g.charCodeAt(Z);if(55296<=E&&E<=56319&&Z=1){var I=g.charCodeAt(Z-1),A=E;return 55296<=I&&I<=56319?(I-55296)*1024+(A-56320)+65536:A}return E}function F(g,Z,E){var I=[g].concat(Z).concat([E]),A=I[I.length-2],N=E,D=I.lastIndexOf(h);if(D>1&&I.slice(1,D).every(function(U){return U==i})&&[i,b,C].indexOf(g)==-1)return R;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(U){return U==o})&&[p,o].indexOf(A)==-1)return I.filter(function(U){return U==o}).length%2==1?G:W;if(A==e&&N==t)return V;if(A==n||A==e||A==t)return N==h&&Z.every(function(U){return U==i})?R:L;if(N==n||N==e||N==t)return L;if(A==s&&(N==s||N==a||N==u||N==d))return V;if((A==u||A==a)&&(N==a||N==c))return V;if((A==d||A==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(A==p)return V;var O=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[b,C].indexOf(I[O])!=-1&&I.slice(O+1,-1).every(function(U){return U==i})&&N==h||A==x&&[_,C].indexOf(N)!=-1?V:Z.indexOf(o)!=-1?R:A==o&&N==o?V:L}this.nextBreak=function(g,Z){if(Z===void 0&&(Z=0),Z<0)return 0;if(Z>=g.length-1)return g.length;for(var E=M(P(g,Z)),I=[],A=Z+1;A{var zli=S(T());(function(e,t){typeof PQ=="object"&&typeof vQ<"u"?vQ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(PQ,function(){"use strict";function e(_,C,V,L,R){(function G(W,w,P,F,M){for(;F>P;){if(F-P>600){var g=F-P+1,Z=w-P+1,E=Math.log(g),I=.5*Math.exp(2*E/3),A=.5*Math.sqrt(E*I*(g-I)/g)*(Z-g/2<0?-1:1),N=Math.max(P,Math.floor(w-Z*I/g+A)),D=Math.min(F,Math.floor(w+(g-Z)*I/g+A));G(W,w,N,D,M)}var k=W[w],O=P,U=F;for(t(W,P,w),M(W[F],k)>0&&t(W,P,F);O0;)U--}M(W[P],k)===0?t(W,P,U):t(W,++U,F),U<=w&&(P=U+1),w<=U&&(F=U-1)}})(_,C,V||0,L||_.length-1,R||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L=_.minX&&C.maxY>=_.minY}function h(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,R){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var W=C+Math.ceil((V-C)/L/2)*L;e(_,W,C,V,R),G.push(C,W,W,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!b(_,C))return V;for(var L=this.toBBox,R=[];C;){for(var G=0;G=0&&R[C].children.length>this._maxEntries;)this._split(R,C),C--;this._adjustParentBBoxes(L,R,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,R=this._minEntries;this._chooseSplitAxis(V,R,L);var G=this._chooseSplitIndex(V,R,L),W=h(V.children.splice(G,V.children.length-G));W.height=V.height,W.leaf=V.leaf,r(V,this.toBBox),r(W,this.toBBox),C?_[C-1].children.push(W):this._splitRoot(V,W)},i.prototype._splitRoot=function(_,C){this.data=h([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,R,G,W,w,P,F,M=1/0,g=1/0,Z=C;Z<=V-C;Z++){var E=s(_,0,Z,this.toBBox),I=s(_,Z,V,this.toBBox),A=(R=E,G=I,W=void 0,w=void 0,P=void 0,F=void 0,W=Math.max(R.minX,G.minX),w=Math.max(R.minY,G.minY),P=Math.min(R.maxX,G.maxX),F=Math.min(R.maxY,G.maxY),Math.max(0,P-W)*Math.max(0,F-w)),N=d(E)+d(I);A=C;M--){var g=_.children[M];a(W,_.leaf?R(g):g),w+=m(W)}return w},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var d8=jc((exports,module)=>{var EGi=S(T());/*! - * protobuf.js v7.3.2 (c) 2016, daniel wirtz - * compiled wed, 12 jun 2024 08:24:21 utc - * licensed under the bsd-3-clause license - * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c1&&u.charAt(d)==="=";)++m;return Math.ceil(u.length*3)/4-m};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,d,m){for(var p=null,b=[],h=0,x=0,_;d>2],_=(C&3)<<4,x=1;break;case 1:b[h++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:b[h++]=o[_|C>>6],b[h++]=o[C&63],x=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,b)),h=0)}return x&&(b[h++]=o[_],b[h++]=61,x===1&&(b[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,b.slice(0,h))),p.join("")):String.fromCharCode.apply(String,b.slice(0,h))};var a="invalid encoding";i.decode=function(u,d,m){for(var p=m,b=0,h,x=0;x1)break;if((_=r[_])===undefined)throw Error(a);switch(b){case 0:h=_,b=1;break;case 1:d[m++]=h<<2|(_&48)>>4,h=_,b=2;break;case 2:d[m++]=(h&15)<<4|(_&60)>>2,h=_,b=3;break;case 3:d[m++]=(h&3)<<6|_,b=0;break}}if(b===1)throw Error(a);return m-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,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;c0?0:2147483648,b,h);else if(isNaN(p))m(2143289344,b,h);else if(p>34028234663852886e22)m((x<<31|2139095040)>>>0,b,h);else if(p<11754943508222875e-54)m((x<<31|Math.round(p/1401298464324817e-60))>>>0,b,h);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;m((x<<31|_+127<<23|C)>>>0,b,h)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function d(m,p,b){var h=m(p,b),x=(h>>31)*2+1,_=h>>>23&255,C=h&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=d.bind(null,s),c.readFloatBE=d.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),d=new Uint8Array(u.buffer),m=d[7]===128;function p(_,C,V){u[0]=_,C[V]=d[0],C[V+1]=d[1],C[V+2]=d[2],C[V+3]=d[3],C[V+4]=d[4],C[V+5]=d[5],C[V+6]=d[6],C[V+7]=d[7]}function b(_,C,V){u[0]=_,C[V]=d[7],C[V+1]=d[6],C[V+2]=d[5],C[V+3]=d[4],C[V+4]=d[3],C[V+5]=d[2],C[V+6]=d[1],C[V+7]=d[0]}c.writeDoubleLE=m?p:b,c.writeDoubleBE=m?b:p;function h(_,C){return d[0]=_[C],d[1]=_[C+1],d[2]=_[C+2],d[3]=_[C+3],d[4]=_[C+4],d[5]=_[C+5],d[6]=_[C+6],d[7]=_[C+7],u[0]}function x(_,C){return d[7]=_[C],d[6]=_[C+1],d[5]=_[C+2],d[4]=_[C+3],d[3]=_[C+4],d[2]=_[C+5],d[1]=_[C+6],d[0]=_[C+7],u[0]}c.readDoubleLE=m?h:x,c.readDoubleBE=m?x:h}():function(){function u(m,p,b,h,x,_){var C=h<0?1:0;if(C&&(h=-h),h===0)m(0,x,_+p),m(1/h>0?0:2147483648,x,_+b);else if(isNaN(h))m(0,x,_+p),m(2146959360,x,_+b);else if(h>17976931348623157e292)m(0,x,_+p),m((C<<31|2146435072)>>>0,x,_+b);else{var V;if(h<22250738585072014e-324)V=h/5e-324,m(V>>>0,x,_+p),m((C<<31|V/4294967296)>>>0,x,_+b);else{var L=Math.floor(Math.log(h)/Math.LN2);L===1024&&(L=1023),V=h*Math.pow(2,-L),m(V*4503599627370496>>>0,x,_+p),m((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+b)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function d(m,p,b,h,x){var _=m(h,x+p),C=m(h,x+b),V=(C>>31)*2+1,L=C>>>20&2047,R=4294967296*(C&1048575)+_;return L===2047?R?NaN:V*(1/0):L===0?V*5e-324*R:V*Math.pow(2,L-1075)*(R+4503599627370496)}c.readDoubleLE=d.bind(null,s,0,4),c.readDoubleBE=d.bind(null,a,4,0)}(),c}function o(c,u,d){u[d]=c&255,u[d+1]=c>>>8&255,u[d+2]=c>>>16&255,u[d+3]=c>>>24}function r(c,u,d){u[d]=c>>>24,u[d+1]=c>>>16&255,u[d+2]=c>>>8&255,u[d+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,d=a;return function(p){if(p<1||p>c)return o(p);d+p>a&&(u=o(a),d=0);var b=r.call(u,d,d+=p);return d&7&&(d=(d|7)+1),b}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c191&&p<224?d[m++]=(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,d[m++]=55296+(p>>10),d[m++]=56320+(p&1023)):d[m++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,m>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,d)),m=0);return u?(m&&u.push(String.fromCharCode.apply(String,d.slice(0,m))),u.join("")):String.fromCharCode.apply(String,d.slice(0,m))},i.write=function(r,s,a){for(var c=a,u,d,m=0;m>6|192,s[a++]=u&63|128):(u&64512)===55296&&((d=r.charCodeAt(m+1))&64512)===56320?(u=65536+((u&1023)<<10)+(d&1023),++m,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,x){return RangeError("index out of range: "+h.pos+" + "+(x||1)+" > "+h.len)}function c(h){this.buf=h,this.pos=0,this.len=h.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},d=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):u(V)})(_)}:u};c.create=d(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function m(){var h=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<>>0,h}if(this.len-this.pos>4){for(;x<5;++x)if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(h,x){return(h[x-4]|h[x-3]<<8|h[x-2]<<16|h[x-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 b(){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 x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},c._configure=function(h){o=h,c.create=d(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return m.call(this)[x](!1)},uint64:function(){return m.call(this)[x](!0)},sint64:function(){return m.call(this).zzDecode()[x](!1)},fixed64:function(){return b.call(this)[x](!0)},sfixed64:function(){return b.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,d){if(!u)throw TypeError("request must be specified");var m=this;if(!d)return i.asPromise(r,m,s,a,c,u);if(!m.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),undefined;try{return m.rpcImpl(s,a[m.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(b,h){if(b)return m.emit("error",b,s),d(b);if(h===null)return m.end(!0),undefined;if(!(h instanceof c))try{h=c[m.responseDelimited?"decodeDelimited":"decode"](h)}catch(x){return m.emit("error",x,s),d(x)}return m.emit("data",h,s),d(null,h)})}catch(p){return m.emit("error",p,s),setTimeout(function(){d(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,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var d=u<0;d&&(u=-u);var m=u>>>0,p=(u-m)/4294967296>>>0;return d&&(p=~p>>>0,m=~m>>>0,++m>4294967295&&(m=0,++p>4294967295&&(p=0))),new o(m,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var d=~this.lo+1>>>0,m=~this.hi>>>0;return d||(m=m+1>>>0),-(d+m*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,m=this.hi>>>24;return m===0?d===0?u<16384?u<128?1:2:u<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:m<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),d=0;d-1;--m)if(c[d[m]]===1&&this[d[m]]!==undefined&&this[d[m]]!==null)return d[m]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u127;)R[G++]=L&127|128,L>>>=7;R[G]=L}function x(L,R){this.len=L,this.next=undefined,this.val=R}x.prototype=Object.create(c.prototype),x.prototype.fn=h,m.prototype.uint32=function(R){return this.len+=(this.tail=this.tail.next=new x((R=R>>>0)<128?1:R<16384?2:R<2097152?3:R<268435456?4:5,R)).len,this},m.prototype.int32=function(R){return R<0?this._push(_,10,r.fromNumber(R)):this.uint32(R)},m.prototype.sint32=function(R){return this.uint32((R<<1^R>>31)>>>0)};function _(L,R,G){for(;L.hi;)R[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)R[G++]=L.lo&127|128,L.lo=L.lo>>>7;R[G++]=L.lo}m.prototype.uint64=function(R){var G=r.from(R);return this._push(_,G.length(),G)},m.prototype.int64=m.prototype.uint64,m.prototype.sint64=function(R){var G=r.from(R).zzEncode();return this._push(_,G.length(),G)},m.prototype.bool=function(R){return this._push(b,1,R?1:0)};function C(L,R,G){R[G]=L&255,R[G+1]=L>>>8&255,R[G+2]=L>>>16&255,R[G+3]=L>>>24}m.prototype.fixed32=function(R){return this._push(C,4,R>>>0)},m.prototype.sfixed32=m.prototype.fixed32,m.prototype.fixed64=function(R){var G=r.from(R);return this._push(C,4,G.lo)._push(C,4,G.hi)},m.prototype.sfixed64=m.prototype.fixed64,m.prototype.float=function(R){return this._push(i.float.writeFloatLE,4,R)},m.prototype.double=function(R){return this._push(i.float.writeDoubleLE,8,R)};var V=i.Array.prototype.set?function(R,G,W){G.set(R,W)}:function(R,G,W){for(var w=0;w>>0;if(!G)return this._push(b,1,0);if(i.isString(R)){var W=m.alloc(G=s.length(R));s.decode(R,W,0),R=W}return this.uint32(G)._push(V,G,R)},m.prototype.string=function(R){var G=a.length(R);return G?this.uint32(G)._push(a.write,G,R):this._push(b,1,0)},m.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},m.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},m.prototype.ldelim=function(){var R=this.head,G=this.tail,W=this.len;return this.reset().uint32(W),W&&(this.tail.next=R.next,this.tail=G,this.len+=W),this},m.prototype.finish=function(){for(var R=this.head.next,G=this.constructor.alloc(this.len),W=0;R;)R.fn(R.val,G,W),W+=R.len,R=R.next;return G},m._configure=function(L){o=L,m.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,d){u.set(c,d)}:function(c,u,d){if(c.copy)c.copy(u,d,0,c.length);else for(var m=0;m>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var s1e=jc((Boo,JO)=>{var Ooo=S(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(d,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,b=c(d,m.inputOffset||0,p),h=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,x=r(b,m.pixelType||Float32Array,m.encodedMaskData,h,m.returnMask),_={width:b.width,height:b.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:b.pixels.maxValue,noDataValue:h};return x.resultMask&&(_.maskData=x.resultMask),m.returnEncodedMask&&b.mask&&(_.encodedMaskData=b.mask.bitset?b.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(b),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(b))),_};var r=function(d,m,p,b,h){var x=0,_=d.pixels.numBlocksX,C=d.pixels.numBlocksY,V=Math.floor(d.width/_),L=Math.floor(d.height/C),R=2*d.maxZError,G=Number.MAX_VALUE,W;p=p||(d.mask?d.mask.bitset:null);var w,P;w=new m(d.width*d.height),h&&p&&(P=new Uint8Array(d.width*d.height));for(var F=new Float32Array(V*L),M,g,Z=0;Z<=C;Z++){var E=Z!==C?L:d.height%C;if(E!==0)for(var I=0;I<=_;I++){var A=I!==_?V:d.width%_;if(A!==0){var N=Z*d.width*L+I*V,D=d.width-A,k=d.pixels.blocks[x],O,U,j;k.encoding<2?(k.encoding===0?O=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,R,F,d.pixels.maxValue),O=F),U=0):k.encoding===2?j=0:j=k.offset;var K;if(p)for(g=0;g>3],K<<=N&7),M=0;M>3]),K&128?(P&&(P[N]=1),W=k.encoding<2?O[U++]:j,G=G>W?W:G,w[N++]=W):(P&&(P[N]=0),w[N++]=b),K<<=1;N+=D}else if(k.encoding<2)for(g=0;gW?W:G,w[N++]=W;N+=D}else for(G=G>j?j:G,g=0;g0){var _=new Uint8Array(Math.ceil(b.width*b.height/8));x=new DataView(d,m,b.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var R=x.getUint8(V++);for(C=-C;C--;)_[L++]=R}C=x.getInt16(V,!0),V+=2}while(V0?1:0),P=W+(b.height%W>0?1:0);b.pixels.blocks=new Array(w*P);for(var F=0,M=0;M3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){m++;continue}if(A!==0&&A!==2){if(A>>=6,I.offsetType=A,A===2)I.offset=x.getInt8(1),Z++;else if(A===1)I.offset=x.getInt16(1,!0),Z+=2;else if(A===0)I.offset=x.getFloat32(1,!0),Z+=4;else throw"Invalid block offset type";if(I.encoding===1)if(A=x.getUint8(Z),Z++,I.bitsPerPixel=A&63,A>>=6,I.numValidPixelsType=A,A===2)I.numValidPixels=x.getUint8(Z),Z++;else if(A===1)I.numValidPixels=x.getUint16(Z,!0),Z+=2;else if(A===0)I.numValidPixels=x.getUint32(Z,!0),Z+=4;else throw"Invalid valid pixel count type"}if(m+=Z,I.encoding!==3){var N,D;if(I.encoding===0){var k=(b.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";N=new ArrayBuffer(k*4),D=new Uint8Array(N),D.set(new Uint8Array(d,m,k*4));var O=new Float32Array(N);I.rawData=O,m+=k*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),j=Math.ceil(U/4);N=new ArrayBuffer(j*4),D=new Uint8Array(N),D.set(new Uint8Array(d,m,U)),I.stuffedData=new Uint32Array(N),m+=U}}}return b.eofOffset=m,b},u=function(d,m,p,b,h,x,_){var C=(1<=m)G=W>>>R-m&C,R-=m;else{var F=m-R;G=(W&C)<>>R}x[L]=G=d?(R=G>>>L-d&_,L-=d):(W=d-L,R=(G&_)<>>L),u[V]=p[R];else for(w=Math.ceil((x-b)/h),V=0;V=d?(R=G>>>L-d&_,L-=d):(W=d-L,R=(G&_)<>>L),u[V]=R=u?(L=R>>>V-u&h,V-=u):(C=u-V,L=(R&h)<>>V),G[_]=L=d?(G=W>>>R&_,L-=d,R+=d):(w=d-L,G=W>>>R&_,W=c[C++],L=32-w,G|=(W&(1<=d?(G=W>>>R&_,L-=d,R+=d):(w=d-L,G=W>>>R&_,W=c[C++],L=32-w,G|=(W&(1<=u?(L=G>>>R&h,V-=u,R+=u):(C=u-V,L=G>>>R&h,G=c[x++],V=32-C,L|=(G&(1<=d?(_=C>>>x-d&p,x-=d):(V=d-x,_=(C&p)<>>x),u[h]=_;return u},originalUnstuff2:function(c,u,d,m){var p=(1<=d?(C=V>>>_&p,x-=d,_+=d):(L=d-x,C=V>>>_&p,V=c[b++],x=32-L,C|=(V&(1<=359?359:p;p-=h;do u+=c[b++]<<8,d+=u+=c[b++];while(--h);u=(u&65535)+(u>>>16),d=(d&65535)+(d>>>16)}return m&1&&(d+=u+=c[b]<<8),u=(u&65535)+(u>>>16),d=(d&65535)+(d>>>16),(d<<16|u)>>>0},readHeaderInfo:function(c,u){var d=u.ptr,m=new Uint8Array(c,d,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;d+=6;var b=new DataView(c,d,8),h=b.getInt32(0,!0);p.fileVersion=h,d+=4,h>=3&&(p.checksum=b.getUint32(4,!0),d+=4),b=new DataView(c,d,12),p.height=b.getUint32(0,!0),p.width=b.getUint32(4,!0),d+=8,h>=4?(p.numDims=b.getUint32(8,!0),d+=4):p.numDims=1,b=new DataView(c,d,40),p.numValidPixel=b.getUint32(0,!0),p.microBlockSize=b.getInt32(4,!0),p.blobSize=b.getInt32(8,!0),p.imageType=b.getInt32(12,!0),p.maxZError=b.getFloat64(16,!0),p.zMin=b.getFloat64(24,!0),p.zMax=b.getFloat64(32,!0),d+=40,u.headerInfo=p,u.ptr=d;var x,_;if(h>=3&&(_=h>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,d-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var d=u.headerInfo,m=this.getDataTypeArray(d.imageType),p=d.numDims*this.getDataTypeSize(d.imageType),b=this.readSubArray(c,u.ptr,m,p),h=this.readSubArray(c,u.ptr+p,m,p);u.ptr+=2*p;var x,_=!0;for(x=0;x0){_=new Uint8Array(Math.ceil(p/8)),h=new DataView(c,d,x.numBytes);var V=h.getInt16(0,!0),L=2,R=0,G=0;do{if(V>0)for(;V--;)_[R++]=h.getUint8(L++);else for(G=h.getUint8(L++),V=-V;V--;)_[R++]=G;V=h.getInt16(L,!0),L+=2}while(L>3],W<<=w&7):W=_[w>>3],W&128&&(C[w]=1);u.pixels.resultMask=C,x.bitset=_,d+=x.numBytes}return u.ptr=d,u.mask=x,!0},readDataOneSweep:function(c,u,d){var m=u.ptr,p=u.headerInfo,b=p.numDims,h=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*b,C,V=u.pixels.resultMask;if(d===Uint8Array)C=new Uint8Array(c,m,_);else{var L=new ArrayBuffer(_),R=new Uint8Array(L);R.set(new Uint8Array(c,m,_)),C=new d(L)}if(C.length===h*b)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new d(h*b);var G=0,W=0,w=0,P=0;if(b>1)for(w=0;w=x)return!1;var _=new Uint32Array(x-h);r.decodeBits(c,u,_);var C=[],V,L,R,G;for(V=h;V0&&(C[L].second=Z<>>32-G,32-g>=G?(g+=G,g===32&&(g=0,E++,Z=M[E])):(g+=G-32,E++,Z=M[E],C[L].second|=Z>>>32-g));var I=0,A=0,N=new s;for(V=0;V=d?A=d:A=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var D=[],k,O,U,j,K,te;for(V=h;V0)if(k=[G,L],G<=A)for(O=C[L].second<=0;j--)K=O>>>j&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),j===0&&!te.val&&(te.val=k[1]);return{decodeLut:D,numBitsLUTQick:A,numBitsLUT:I,tree:N,stuffedData:M,srcPtr:E,bitPos:g}},readHuffman:function(c,u,d){var m=u.headerInfo,p=m.numDims,b=u.headerInfo.height,h=u.headerInfo.width,x=h*b,_=this.readHuffmanTree(c,u),C=_.decodeLut,V=_.tree,L=_.stuffedData,R=_.srcPtr,G=_.bitPos,W=_.numBitsLUTQick,w=_.numBitsLUT,P=u.headerInfo.imageType===0?128:0,F,M,g,Z=u.pixels.resultMask,E,I,A,N,D,k,O,U=0;G>0&&(R++,G=0);var j=L[R],K=u.encodeMode===1,te=new d(x*p),z=te,q;for(q=0;q1&&(z=new d(te.buffer,x*q,x),U=0),u.headerInfo.numValidPixel===h*b)for(k=0,N=0;N>>32-W,I=E,32-G>>64-G-W,I=E),C[I])M=C[I][1],G+=C[I][0];else for(E=j<>>32-w,I=E,32-G>>64-G-w,I=E),F=V,O=0;O>>w-O-1&1,F=A?F.right:F.left,!(F.left||F.right)){M=F.val,G=G+O+1;break}G>=32&&(G-=32,R++,j=L[R]),g=M-P,K?(D>0?g+=U:N>0?g+=z[k-h]:g+=U,g&=255,z[k]=g,U=g):z[k]=g}else for(k=0,N=0;N>>32-W,I=E,32-G>>64-G-W,I=E),C[I])M=C[I][1],G+=C[I][0];else for(E=j<>>32-w,I=E,32-G>>64-G-w,I=E),F=V,O=0;O>>w-O-1&1,F=A?F.right:F.left,!(F.left||F.right)){M=F.val,G=G+O+1;break}G>=32&&(G-=32,R++,j=L[R]),g=M-P,K?(D>0&&Z[k-1]?g+=U:N>0&&Z[k-h]?g+=z[k-h]:g+=U,g&=255,z[k]=g,U=g):z[k]=g}u.ptr=u.ptr+(R+1)*4+(G>0?4:0)}u.pixels.resultPixels=te},decodeBits:function(c,u,d,m,p){{var b=u.headerInfo,h=b.fileVersion,x=0,_=new DataView(c,u.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,R=(C&32)>0,G=C&31,W=0;if(L===1)W=_.getUint8(x),x++;else if(L===2)W=_.getUint16(x,!0),x+=2;else if(L===4)W=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var w=2*b.maxZError,P,F,M,g,Z,E,I,A,N,D,k=b.numDims>1?b.maxValues[p]:b.zMax;if(R){for(u.counter.lut++,A=_.getUint8(x),N=G,x++,g=Math.ceil((A-1)*G/8),Z=Math.ceil(g/4),F=new ArrayBuffer(Z*4),M=new Uint8Array(F),u.ptr+=x,M.set(new Uint8Array(c,u.ptr,g)),I=new Uint32Array(F),u.ptr+=g,D=0;A-1>>>D;)D++;g=Math.ceil(W*D/8),Z=Math.ceil(g/4),F=new ArrayBuffer(Z*4),M=new Uint8Array(F),M.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(F),u.ptr+=g,h>=3?E=o.unstuffLUT2(I,G,A-1,m,w,k):E=o.unstuffLUT(I,G,A-1,m,w,k),h>=3?o.unstuff2(P,d,D,W,E):o.unstuff(P,d,D,W,E)}else u.counter.bitstuffer++,D=G,u.ptr+=x,D>0&&(g=Math.ceil(W*D/8),Z=Math.ceil(g/4),F=new ArrayBuffer(Z*4),M=new Uint8Array(F),M.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(F),u.ptr+=g,h>=3?m==null?o.originalUnstuff2(P,d,D,W):o.unstuff2(P,d,D,W,!1,m,w,k):m==null?o.originalUnstuff(P,d,D,W):o.unstuff(P,d,D,W,!1,m,w,k))}},readTiles:function(c,u,d){var m=u.headerInfo,p=m.width,b=m.height,h=m.microBlockSize,x=m.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/h),V=Math.ceil(b/h);u.pixels.numBlocksY=V,u.pixels.numBlocksX=C,u.pixels.ptr=0;var L=0,R=0,G=0,W=0,w=0,P=0,F=0,M=0,g=0,Z=0,E=0,I=0,A=0,N=0,D=0,k=0,O,U,j,K,te,z,q=new d(h*h),ee=b%h||h,pe=p%h||h,xe,ce,ye=m.numDims,Te,Le=u.pixels.resultMask,Xe=u.pixels.resultPixels;for(G=0;G1&&(Xe=new d(u.pixels.resultPixels.buffer,p*b*Te*_,p*b)),F=c.byteLength-u.ptr,O=new DataView(c,u.ptr,Math.min(10,F)),U={},k=0,M=O.getUint8(0),k++,g=M>>6&255,Z=M>>2&15,Z!==(W*h>>3&15))throw"integrity issue";if(z=M&3,z>3)throw u.ptr+=k,"Invalid block encoding ("+z+")";if(z===2){u.counter.constant++,u.ptr+=k;continue}else if(z===0){if(u.counter.uncompressed++,u.ptr+=k,A=w*P*_,N=c.byteLength-u.ptr,A=A1)for(b=0;b=-128&&u<=127;break;case 1:d=u>=0&&u<=255;break;case 2:d=u>=-32768&&u<=32767;break;case 3:d=u>=0&&u<=65536;break;case 4:d=u>=-2147483648&&u<=2147483647;break;case 5:d=u>=0&&u<=4294967296;break;case 6:d=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:d=u>=5e-324&&u<=17976931348623157e292;break;default:d=!1}return d},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var d=c;switch(c){case 2:case 4:d=c-u;break;case 3:case 5:d=c-2*u;break;case 6:u===0?d=c:u===1?d=2:d=1;break;case 7:u===0?d=c:d=c-2*u+1;break;default:d=c;break}return d},getOnePixel:function(c,u,d,m){var p=0;switch(d){case 0:p=m.getInt8(u);break;case 1:p=m.getUint8(u);break;case 2:p=m.getInt16(u,!0);break;case 3:p=m.getUint16(u,!0);break;case 4:p=m.getInt32(u,!0);break;case 5:p=m.getUInt32(u,!0);break;case 6:p=m.getFloat32(u,!0);break;case 7:p=m.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,d){this.val=c,this.left=u,this.right=d},a={decode:function(c,u){u=u||{};var d=u.noDataValue,m=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var b=p.headerInfo,h=b.fileVersion,x=r.getDataTypeArray(b.imageType);r.readMask(c,p),b.numValidPixel!==b.width*b.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var _=b.width*b.height;if(p.pixels.resultPixels=new x(_*b.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},b.numValidPixel!==0)if(b.zMax===b.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(h>1&&b.imageType<=1&&Math.abs(b.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||h<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var R;u.inputOffset?(R=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(R)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(R=p.headerInfo.blobSize-p.ptr,Math.abs(R)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:b.width,height:b.height,pixelData:p.pixels.resultPixels,minValue:b.zMin,maxValue:b.zMax,validPixelCount:b.numValidPixel,dimCount:b.numDims,dimStats:{minValues:b.minValues,maxValues:b.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(b.imageType,d)){var W=p.pixels.resultMask;for(m=0;m<_;m++)W[m]||(G.pixelData[m]=d);G.noDataValue=d}return p.noDataValue=d,u.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var u=0,d=0,m={};for(m.ptr=0,m.pixels={};d1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&h.push(V.maskData),m++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,R,G;if(d>1&&h.length>1){for(G=C.width*C.height,C.bandMasks=h,_=new Uint8Array(G),_.set(h[0]),L=1;L{var ZNo=S(T());DLe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQ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AABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var YLe=jc((RNo,OLe)=>{var GNo=S(T()),{webm:fWt,mp4:hWt}=BLe(),F$=()=>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,A$=()=>"wakeLock"in navigator,M$=class{constructor(){if(this.enabled=!1,A$()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else F$()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",fWt),this._addSourceToVideo(this.noSleepVideo,"mp4",hWt),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 A$()?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}):F$()?(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(){A$()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):F$()?this.noSleepTimer&&(console.warn(` - NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};OLe.exports=M$});var NWt={};hZe(NWt,{AlphaMode:()=>Vh,AlphaPipelineStage:()=>wX,Animation:()=>M9,AnimationViewModel:()=>N9,Appearance:()=>oo,ApproximateTerrainHeights:()=>mi,ArcGISTiledElevationTerrainProvider:()=>Oj,ArcGisBaseMapType:()=>Yf,ArcGisMapServerImageryProvider:()=>C0,ArcGisMapService:()=>ld,ArcType:()=>rn,ArticulationStageType:()=>Zc,AssociativeArray:()=>Gt,Atmosphere:()=>sA,AtmospherePipelineStage:()=>pX,AttributeCompression:()=>Fn,AttributeType:()=>cn,AutoExposure:()=>qA,AutomaticUniforms:()=>Fp,Axis:()=>Ao,AxisAlignedBoundingBox:()=>sg,B3dmLoader:()=>QI,B3dmParser:()=>zI,BaseLayerPicker:()=>O9,BaseLayerPickerViewModel:()=>B9,BatchTable:()=>Dx,BatchTableHierarchy:()=>y_,BatchTexture:()=>ll,BatchTexturePipelineStage:()=>FX,Billboard:()=>yo,BillboardCollection:()=>Fu,BillboardGraphics:()=>uc,BillboardVisualizer:()=>jZ,BingMapsGeocoderService:()=>Kj,BingMapsImageryProvider:()=>vF,BingMapsStyle:()=>vL,BlendEquation:()=>Ma,BlendFunction:()=>Go,BlendOption:()=>Wo,BlendingState:()=>hn,BoundingRectangle:()=>Je,BoundingSphere:()=>ae,BoundingSphereState:()=>ht,BoundingVolumeSemantics:()=>v_,BoxEmitter:()=>E6,BoxGeometry:()=>Al,BoxGeometryUpdater:()=>jW,BoxGraphics:()=>t_,BoxOutlineGeometry:()=>Mm,BrdfLutGenerator:()=>cA,Buffer:()=>ut,BufferLoader:()=>V_,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>UX,CallbackProperty:()=>zm,Camera:()=>lo,CameraEventAggregator:()=>rM,CameraEventType:()=>wi,CameraFlightPath:()=>uA,Cartesian2:()=>B,Cartesian3:()=>f,Cartesian4:()=>re,Cartographic:()=>fe,CartographicGeocoderService:()=>Hj,CatmullRomSpline:()=>Jj,Cesium3DContentGroup:()=>g_,Cesium3DTile:()=>tm,Cesium3DTileBatchTable:()=>eb,Cesium3DTileColorBlendMode:()=>Bl,Cesium3DTileContent:()=>W6,Cesium3DTileContentFactory:()=>nS,Cesium3DTileContentState:()=>zo,Cesium3DTileContentType:()=>Es,Cesium3DTileFeature:()=>Ys,Cesium3DTileFeatureTable:()=>sf,Cesium3DTileOptimizationHint:()=>Jd,Cesium3DTileOptimizations:()=>xP,Cesium3DTilePass:()=>No,Cesium3DTilePassState:()=>Cm,Cesium3DTilePointFeature:()=>Gb,Cesium3DTileRefine:()=>Oo,Cesium3DTileStyle:()=>kT,Cesium3DTileStyleEngine:()=>LP,Cesium3DTilesInspector:()=>Q9,Cesium3DTilesInspectorViewModel:()=>J9,Cesium3DTilesVoxelProvider:()=>I6,Cesium3DTileset:()=>xa,Cesium3DTilesetBaseTraversal:()=>IP,Cesium3DTilesetCache:()=>TP,Cesium3DTilesetGraphics:()=>c_,Cesium3DTilesetHeatmap:()=>CP,Cesium3DTilesetMetadata:()=>mS,Cesium3DTilesetMostDetailedTraversal:()=>GP,Cesium3DTilesetSkipTraversal:()=>vP,Cesium3DTilesetStatistics:()=>Db,Cesium3DTilesetTraversal:()=>js,Cesium3DTilesetVisualizer:()=>wP,CesiumInspector:()=>D9,CesiumInspectorViewModel:()=>k9,CesiumTerrainProvider:()=>tT,CesiumWidget:()=>BM,Check:()=>no,CheckerboardMaterialProperty:()=>iV,CircleEmitter:()=>HM,CircleGeometry:()=>t8,CircleOutlineGeometry:()=>n8,ClassificationModelDrawCommand:()=>lX,ClassificationPipelineStage:()=>AX,ClassificationPrimitive:()=>OC,ClassificationType:()=>Bn,ClearCommand:()=>ri,ClippingPlane:()=>w_,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>x1,ClippingPolygonCollection:()=>nf,Clock:()=>_f,ClockRange:()=>Or,ClockStep:()=>xo,ClockViewModel:()=>v9,CloudCollection:()=>A6,CloudType:()=>lZ,Color:()=>Y,ColorBlendMode:()=>Lc,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>zt,Command:()=>T$,ComponentDatatype:()=>Q,Composite3DTileContent:()=>nI,CompositeEntityCollection:()=>IJ,CompositeMaterialProperty:()=>rV,CompositePositionProperty:()=>_a,CompositeProperty:()=>Xc,CompressedTextureBuffer:()=>sR,ComputeCommand:()=>ka,ComputeEngine:()=>Pw,ConditionsExpression:()=>OM,ConeEmitter:()=>U6,ConstantPositionProperty:()=>ol,ConstantProperty:()=>qn,ConstantSpline:()=>Sb,ContentMetadata:()=>uP,Context:()=>Nw,ContextLimits:()=>Mt,CoplanarPolygonGeometry:()=>xv,CoplanarPolygonGeometryLibrary:()=>Fb,CoplanarPolygonOutlineGeometry:()=>em,CornerType:()=>Xi,CorridorGeometry:()=>yS,CorridorGeometryLibrary:()=>ki,CorridorGeometryUpdater:()=>OP,CorridorGraphics:()=>i_,CorridorOutlineGeometry:()=>BP,Credit:()=>Ct,CreditDisplay:()=>hA,CubeMap:()=>da,CubeMapFace:()=>lh,CubicRealPolynomial:()=>Mx,CullFace:()=>xi,CullingVolume:()=>bs,CumulusCloud:()=>bd,CustomDataSource:()=>QP,CustomHeightmapTerrainProvider:()=>i8,CustomShader:()=>AT,CustomShaderMode:()=>Lb,CustomShaderPipelineStage:()=>zX,CustomShaderTranslucencyMode:()=>Bg,CylinderGeometry:()=>jP,CylinderGeometryLibrary:()=>xS,CylinderGeometryUpdater:()=>$P,CylinderGraphics:()=>o_,CylinderOutlineGeometry:()=>qP,CzmlDataSource:()=>lv,DataSource:()=>Dr,DataSourceClock:()=>Sf,DataSourceCollection:()=>uv,DataSourceDisplay:()=>Hv,DebugAppearance:()=>Y6,DebugCameraPrimitive:()=>lp,DebugInspector:()=>fM,DebugModelMatrixPrimitive:()=>jM,DefaultProxy:()=>r8,DepthFunction:()=>yc,DepthPlane:()=>gA,DequantizationPipelineStage:()=>JX,DerivedCommand:()=>G0,DeveloperError:()=>he,DeviceOrientationCameraController:()=>xA,DirectionalLight:()=>K6,DiscardEmptyTileImagePolicy:()=>wL,DiscardMissingTileImagePolicy:()=>XF,DistanceDisplayCondition:()=>It,DistanceDisplayConditionGeometryInstanceAttribute:()=>Dn,DoubleEndedPriorityQueue:()=>iT,DoublyLinkedList:()=>SP,DracoLoader:()=>ab,DrawCommand:()=>He,DynamicAtmosphereLightingType:()=>bT,DynamicGeometryBatch:()=>RS,DynamicGeometryUpdater:()=>ii,EarthOrientationParameters:()=>YZ,EarthOrientationParametersSample:()=>Q0,EasingFunction:()=>Kr,EllipseGeometry:()=>Tl,EllipseGeometryLibrary:()=>iu,EllipseGeometryUpdater:()=>mv,EllipseGraphics:()=>r_,EllipseOutlineGeometry:()=>Ku,Ellipsoid:()=>ie,EllipsoidGeodesic:()=>Dp,EllipsoidGeometry:()=>ea,EllipsoidGeometryUpdater:()=>hv,EllipsoidGraphics:()=>s_,EllipsoidOutlineGeometry:()=>Mu,EllipsoidPrimitive:()=>nA,EllipsoidRhumbLine:()=>Na,EllipsoidSurfaceAppearance:()=>z6,EllipsoidTangentPlane:()=>es,EllipsoidTerrainProvider:()=>op,EllipsoidalOccluder:()=>Hb,Empty3DTileContent:()=>O1,EncodedCartesian3:()=>Kn,Entity:()=>ir,EntityCluster:()=>Uu,EntityCollection:()=>qs,EntityView:()=>Qv,Event:()=>be,EventHelper:()=>Nr,Expression:()=>wd,ExpressionNodeType:()=>_t,ExtrapolationType:()=>Du,FeatureDetection:()=>At,FeatureIdPipelineStage:()=>Dg,Fog:()=>_A,ForEach:()=>ve,FrameRateMonitor:()=>e9,FrameState:()=>SA,Framebuffer:()=>ba,FramebufferManager:()=>hi,FrustumCommands:()=>LA,FrustumGeometry:()=>rT,FrustumOutlineGeometry:()=>Hw,Fullscreen:()=>_r,FullscreenButton:()=>nN,FullscreenButtonViewModel:()=>tN,GeoJsonDataSource:()=>gw,GeoJsonLoader:()=>jI,GeocodeType:()=>Oy,Geocoder:()=>q9,GeocoderService:()=>CL,GeocoderViewModel:()=>j9,GeographicProjection:()=>Gi,GeographicTilingScheme:()=>_i,Geometry:()=>mt,Geometry3DTileContent:()=>oI,GeometryAttribute:()=>Ie,GeometryAttributes:()=>pn,GeometryFactory:()=>u8,GeometryInstance:()=>Rt,GeometryInstanceAttribute:()=>xc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Un,GeometryPipelineStage:()=>$X,GeometryType:()=>Zd,GeometryUpdater:()=>oi,GeometryUpdaterSet:()=>MS,GeometryVisualizer:()=>Fv,GetFeatureInfoFormat:()=>fT,Globe:()=>tA,GlobeDepth:()=>ZA,GlobeSurfaceShaderSet:()=>IF,GlobeSurfaceTile:()=>_m,GlobeSurfaceTileProvider:()=>YF,GlobeTranslucency:()=>KF,GlobeTranslucencyFramebuffer:()=>RA,GlobeTranslucencyState:()=>TA,GltfBufferViewLoader:()=>i1,GltfDracoLoader:()=>o1,GltfImageLoader:()=>r1,GltfIndexBufferLoader:()=>s1,GltfJsonLoader:()=>c1,GltfLoader:()=>hb,GltfLoaderUtil:()=>zl,GltfStructuralMetadataLoader:()=>kI,GltfTextureLoader:()=>l1,GltfVertexBufferLoader:()=>u1,GoogleEarthEnterpriseImageryProvider:()=>J6,GoogleEarthEnterpriseMapsProvider:()=>AF,GoogleEarthEnterpriseMetadata:()=>y0,GoogleEarthEnterpriseTerrainData:()=>VL,GoogleEarthEnterpriseTerrainProvider:()=>y8,GoogleEarthEnterpriseTileInformation:()=>Qw,GoogleMaps:()=>aT,GpxDataSource:()=>Sw,GregorianDate:()=>Gp,GridImageryProvider:()=>Q6,GridMaterialProperty:()=>pV,GroundGeometryUpdater:()=>zn,GroundPolylineGeometry:()=>jx,GroundPolylinePrimitive:()=>Bm,GroundPrimitive:()=>nl,GroupMetadata:()=>eV,HeadingPitchRange:()=>mm,HeadingPitchRoll:()=>pc,Heap:()=>UZ,HeightReference:()=>je,HeightmapEncoding:()=>bm,HeightmapTerrainData:()=>Qa,HeightmapTessellator:()=>hL,HermitePolynomialApproximation:()=>ev,HermiteSpline:()=>Rh,HilbertOrder:()=>$C,HomeButton:()=>eN,HomeButtonViewModel:()=>$9,HorizontalOrigin:()=>gi,I3SBuildingSceneLayerExplorer:()=>I$,I3SBuildingSceneLayerExplorerViewModel:()=>iN,I3SDataProvider:()=>eh,I3SDecoder:()=>n9,I3SFeature:()=>i9,I3SField:()=>o9,I3SGeometry:()=>uZ,I3SLayer:()=>zT,I3SNode:()=>dZ,I3SStatistics:()=>a9,I3SSublayer:()=>l9,I3SSymbology:()=>s9,I3dmLoader:()=>$I,I3dmParser:()=>qI,Iau2000Orientation:()=>qw,Iau2006XysData:()=>KZ,Iau2006XysSample:()=>Px,IauOrientationAxes:()=>$w,IauOrientationParameters:()=>jw,ImageBasedLighting:()=>b_,ImageBasedLightingPipelineStage:()=>gX,ImageMaterialProperty:()=>mg,Imagery:()=>kL,ImageryLayer:()=>Ra,ImageryLayerCollection:()=>zF,ImageryLayerFeatureInfo:()=>Of,ImageryProvider:()=>Rl,ImageryState:()=>li,Implicit3DTileContent:()=>f1,ImplicitAvailabilityBitstream:()=>t1,ImplicitMetadataView:()=>n1,ImplicitSubdivisionScheme:()=>is,ImplicitSubtree:()=>X_,ImplicitSubtreeCache:()=>KM,ImplicitSubtreeMetadata:()=>rI,ImplicitTileCoordinates:()=>pS,ImplicitTileset:()=>hS,IndexDatatype:()=>ke,InfoBox:()=>rN,InfoBoxViewModel:()=>oN,InspectorShared:()=>ic,InstanceAttributeSemantic:()=>rs,InstancingPipelineStage:()=>IX,InterpolationAlgorithm:()=>_8,InterpolationType:()=>Rc,Intersect:()=>Ot,IntersectionTests:()=>ei,Intersections2D:()=>b0,Interval:()=>Fa,InvertClassification:()=>JL,Ion:()=>Jm,IonGeocoderService:()=>nF,IonImageryProvider:()=>V0,IonResource:()=>Eu,IonWorldImageryStyle:()=>L0,Iso8601:()=>Ke,JobScheduler:()=>CA,JobType:()=>Ba,JsonMetadataTable:()=>fb,JulianDate:()=>ne,KTX2Transcoder:()=>aR,KeyboardEventModifier:()=>Za,KeyframeNode:()=>eo,KmlCamera:()=>Tw,KmlDataSource:()=>Ww,KmlLookAt:()=>Cw,KmlTour:()=>Vw,KmlTourFlyTo:()=>Zw,KmlTourWait:()=>Rw,Label:()=>Jg,LabelCollection:()=>Xh,LabelGraphics:()=>Om,LabelStyle:()=>Ko,LabelVisualizer:()=>Av,LagrangePolynomialApproximation:()=>tv,LeapSecond:()=>Oi,Light:()=>eq,LightingModel:()=>Gh,LightingPipelineStage:()=>t2,LinearApproximation:()=>SS,LinearSpline:()=>Nd,ManagedArray:()=>al,MapMode2D:()=>fu,MapProjection:()=>C8,MapboxImageryProvider:()=>MF,MapboxStyleImageryProvider:()=>tq,Material:()=>Yi,MaterialAppearance:()=>mo,MaterialPipelineStage:()=>i2,MaterialProperty:()=>nr,Math:()=>X,Matrix2:()=>yi,Matrix3:()=>$,Matrix4:()=>v,Megatexture:()=>tZ,MetadataClass:()=>qm,MetadataClassProperty:()=>Cg,MetadataComponentType:()=>dn,MetadataEntity:()=>kn,MetadataEnum:()=>LI,MetadataEnumValue:()=>VI,MetadataPipelineStage:()=>Ud,MetadataSchema:()=>$m,MetadataSchemaLoader:()=>d1,MetadataSemantic:()=>P_,MetadataTable:()=>Yl,MetadataTableProperty:()=>aI,MetadataType:()=>jt,MipmapHint:()=>uh,Model:()=>lf,Model3DTileContent:()=>Eh,ModelAlphaOptions:()=>S2,ModelAnimation:()=>tX,ModelAnimationChannel:()=>eX,ModelAnimationCollection:()=>nX,ModelAnimationLoop:()=>Jl,ModelAnimationState:()=>af,ModelArticulation:()=>xX,ModelArticulationStage:()=>yX,ModelClippingPlanesPipelineStage:()=>TX,ModelClippingPolygonsPipelineStage:()=>LX,ModelColorPipelineStage:()=>kg,ModelComponents:()=>Vn,ModelDrawCommand:()=>uX,ModelFeature:()=>iX,ModelFeatureTable:()=>rX,ModelGraphics:()=>Hp,ModelInstanceCollection:()=>x$,ModelLightingOptions:()=>I2,ModelMatrixUpdateStage:()=>XX,ModelNode:()=>ZX,ModelRenderResources:()=>V2,ModelRuntimeNode:()=>vX,ModelRuntimePrimitive:()=>x2,ModelSceneGraph:()=>P2,ModelSilhouettePipelineStage:()=>R2,ModelSkin:()=>_2,ModelSplitterPipelineStage:()=>E2,ModelStatistics:()=>v2,ModelType:()=>hr,ModelUtility:()=>nn,ModelVisualizer:()=>Mv,Moon:()=>oA,MorphTargetsPipelineStage:()=>r2,MorphWeightSpline:()=>iF,MortonOrder:()=>ty,Multiple3DTileContent:()=>fP,MultisampleFramebuffer:()=>BI,NavigationHelpButton:()=>aN,NavigationHelpButtonViewModel:()=>sN,NearFarScalar:()=>Dt,NeverTileDiscardPolicy:()=>iq,NodeRenderResources:()=>W2,NodeStatisticsPipelineStage:()=>PX,NodeTransformationProperty:()=>a_,OIT:()=>GA,Occluder:()=>oF,OctahedralProjectedCubeMap:()=>Hm,OffsetGeometryInstanceAttribute:()=>qi,OpenCageGeocoderService:()=>E8,OpenStreetMapImageryProvider:()=>U0,OrderedGroundPrimitiveCollection:()=>dv,OrientedBoundingBox:()=>Wn,OrthographicFrustum:()=>un,OrthographicOffCenterFrustum:()=>Pr,Packable:()=>W8,PackableForInterpolation:()=>I8,Particle:()=>hZ,ParticleBurst:()=>rq,ParticleEmitter:()=>sq,ParticleSystem:()=>aq,Pass:()=>Ze,PassState:()=>Fc,PathGraphics:()=>Jp,PathVisualizer:()=>Uv,PeliasGeocoderService:()=>tF,PerInstanceColorAppearance:()=>fn,PerformanceDisplay:()=>E0,PerformanceWatchdog:()=>lN,PerformanceWatchdogViewModel:()=>cN,PerspectiveFrustum:()=>Ri,PerspectiveOffCenterFrustum:()=>Zl,PickDepth:()=>VA,PickDepthFramebuffer:()=>WA,PickFramebuffer:()=>XA,Picking:()=>vA,PickingPipelineStage:()=>s2,PinBuilder:()=>m0,PixelDatatype:()=>ze,PixelFormat:()=>nt,Plane:()=>on,PlaneGeometry:()=>pv,PlaneGeometryUpdater:()=>gv,PlaneGraphics:()=>OW,PlaneOutlineGeometry:()=>bv,PntsLoader:()=>F2,PntsParser:()=>Q_,PointCloud:()=>m9,PointCloudEyeDomeLighting:()=>pb,PointCloudShading:()=>Zh,PointCloudStylingPipelineStage:()=>c2,PointGraphics:()=>l_,PointPrimitive:()=>$s,PointPrimitiveCollection:()=>uV,PointVisualizer:()=>Dv,PolygonGeometry:()=>mb,PolygonGeometryLibrary:()=>Yn,PolygonGeometryUpdater:()=>Sv,PolygonGraphics:()=>Ym,PolygonHierarchy:()=>Ua,PolygonOutlineGeometry:()=>_v,PolygonPipeline:()=>ci,Polyline:()=>Kd,PolylineArrowMaterialProperty:()=>gV,PolylineCollection:()=>df,PolylineColorAppearance:()=>ts,PolylineDashMaterialProperty:()=>xV,PolylineGeometry:()=>a0,PolylineGeometryUpdater:()=>Yv,PolylineGlowMaterialProperty:()=>SV,PolylineGraphics:()=>_c,PolylineMaterialAppearance:()=>fa,PolylineOutlineMaterialProperty:()=>ly,PolylinePipeline:()=>Ii,PolylineVisualizer:()=>zv,PolylineVolumeGeometry:()=>Vv,PolylineVolumeGeometryLibrary:()=>bf,PolylineVolumeGeometryUpdater:()=>Gv,PolylineVolumeGraphics:()=>u_,PolylineVolumeOutlineGeometry:()=>Rv,PositionProperty:()=>Kp,PositionPropertyArray:()=>qb,PostProcessStage:()=>So,PostProcessStageCollection:()=>nM,PostProcessStageComposite:()=>El,PostProcessStageLibrary:()=>Lm,PostProcessStageSampleMode:()=>md,PostProcessStageTextureCache:()=>GT,Primitive:()=>In,PrimitiveCollection:()=>nu,PrimitiveLoadPlan:()=>D_,PrimitiveOutlineGenerator:()=>k_,PrimitiveOutlinePipelineStage:()=>d2,PrimitivePipeline:()=>Hx,PrimitiveRenderResources:()=>X2,PrimitiveState:()=>Vr,PrimitiveStatisticsPipelineStage:()=>m2,PrimitiveType:()=>Ae,ProjectionPicker:()=>dN,ProjectionPickerViewModel:()=>uN,Property:()=>J,PropertyArray:()=>CV,PropertyAttribute:()=>U_,PropertyAttributeProperty:()=>AI,PropertyBag:()=>kl,PropertyTable:()=>ml,PropertyTexture:()=>N_,PropertyTextureProperty:()=>FI,ProviderViewModel:()=>ds,Proxy:()=>P8,QuadraticRealPolynomial:()=>el,QuadtreeOccluders:()=>HF,QuadtreePrimitive:()=>eA,QuadtreeTile:()=>JF,QuadtreeTileLoadState:()=>oa,QuadtreeTileProvider:()=>fq,QuantizedMeshTerrainData:()=>eT,QuarticRealPolynomial:()=>wR,Quaternion:()=>Pe,QuaternionSpline:()=>Tb,Queue:()=>dl,Ray:()=>yn,Rectangle:()=>le,RectangleCollisionChecker:()=>US,RectangleGeometry:()=>XS,RectangleGeometryLibrary:()=>Ws,RectangleGeometryUpdater:()=>Ev,RectangleGraphics:()=>Km,RectangleOutlineGeometry:()=>rS,ReferenceFrame:()=>so,ReferenceProperty:()=>$b,RenderState:()=>Oe,Renderbuffer:()=>vu,RenderbufferFormat:()=>hl,Request:()=>$o,RequestErrorEvent:()=>rh,RequestScheduler:()=>fc,RequestState:()=>$n,RequestType:()=>fs,Resource:()=>We,ResourceCache:()=>Ki,ResourceCacheKey:()=>Hl,ResourceCacheStatistics:()=>GI,ResourceLoader:()=>ao,ResourceLoaderState:()=>vt,Rotation:()=>sm,RuntimeError:()=>ue,S2Cell:()=>ib,SDFSettings:()=>Js,SampledPositionProperty:()=>Ta,SampledProperty:()=>Ou,Sampler:()=>Qt,ScaledPositionProperty:()=>Bh,Scene:()=>AM,SceneFramebuffer:()=>ST,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>f2,SceneModePicker:()=>fN,SceneModePickerViewModel:()=>mN,SceneTransforms:()=>zi,SceneTransitioner:()=>oM,ScreenSpaceCameraController:()=>cM,ScreenSpaceEventHandler:()=>cd,ScreenSpaceEventType:()=>Ln,SelectedFeatureIdPipelineStage:()=>Og,SelectionIndicator:()=>bN,SelectionIndicatorViewModel:()=>pN,SensorVolumePortionToDisplay:()=>RV,ShaderBuilder:()=>H_,ShaderCache:()=>vw,ShaderDestination:()=>_e,ShaderFunction:()=>C2,ShaderProgram:()=>qt,ShaderSource:()=>De,ShaderStruct:()=>T2,ShadowMap:()=>X0,ShadowMapShader:()=>fp,ShadowMode:()=>Cn,ShadowVolumeAppearance:()=>Zu,ShowGeometryInstanceAttribute:()=>Tn,Simon1994PlanetaryPositions:()=>Ay,SimplePolylineGeometry:()=>O8,SingleTileImageryProvider:()=>NF,SkinningPipelineStage:()=>p2,SkyAtmosphere:()=>MM,SkyBox:()=>NM,SpatialNode:()=>PM,SphereEmitter:()=>pq,SphereGeometry:()=>Y8,SphereOutlineGeometry:()=>Mb,Spherical:()=>nv,Spline:()=>Hi,SplitDirection:()=>pl,Splitter:()=>pZ,StaticGeometryColorBatch:()=>lm,StaticGeometryPerMaterialBatch:()=>um,StaticGroundGeometryColorBatch:()=>YV,StaticGroundGeometryPerMaterialBatch:()=>wv,StaticGroundPolylinePerMaterialBatch:()=>Kv,StaticOutlineGeometryBatch:()=>HV,StencilConstants:()=>Yt,StencilFunction:()=>On,StencilOperation:()=>gt,SteppedSpline:()=>O_,Stereographic:()=>Vc,StripeMaterialProperty:()=>LV,StripeOrientation:()=>Cf,StructuralMetadata:()=>Oa,StyleCommandsNeeded:()=>cf,StyleExpression:()=>bq,Sun:()=>DM,SunLight:()=>h0,SunPostProcess:()=>dM,SupportedImageFormats:()=>DI,SvgPathBindingHandler:()=>X9,TaskProcessor:()=>di,Terrain:()=>h9,TerrainData:()=>Mf,TerrainEncoding:()=>Mc,TerrainFillMesh:()=>YL,TerrainMesh:()=>ym,TerrainOffsetProperty:()=>d_,TerrainProvider:()=>as,TerrainQuantization:()=>ia,TerrainState:()=>fo,Texture:()=>bt,TextureAtlas:()=>Hg,TextureCache:()=>ww,TextureMagnificationFilter:()=>ni,TextureManager:()=>vM,TextureMinificationFilter:()=>Ft,TextureUniform:()=>Wq,TextureWrap:()=>ln,TileAvailability:()=>Nf,TileBoundingRegion:()=>$d,TileBoundingS2Cell:()=>gP,TileBoundingSphere:()=>Nb,TileBoundingVolume:()=>gq,TileCoordinatesImageryProvider:()=>b9,TileCoordinatesImageryProviderFlw:()=>yq,TileCoordinatesImageryProviderJww:()=>xq,TileDiscardPolicy:()=>Sq,TileEdge:()=>_n,TileImagery:()=>DL,TileMapServiceImageryProvider:()=>Qy,TileMetadata:()=>dP,TileOrientedBoundingBox:()=>Nu,TileProviderError:()=>Xo,TileReplacementQueue:()=>QF,TileSelectionResult:()=>jn,TileState:()=>Tq,Tileset3DTileContent:()=>N2,TilesetMetadata:()=>yP,TilesetPipelineStage:()=>mX,TilingScheme:()=>K8,TimeConstants:()=>Qn,TimeDynamicImagery:()=>hT,TimeDynamicPointCloud:()=>xZ,TimeInterval:()=>Zn,TimeIntervalCollection:()=>kr,TimeIntervalCollectionPositionProperty:()=>e0,TimeIntervalCollectionProperty:()=>t0,TimeStandard:()=>Hn,Timeline:()=>xN,TimelineHighlightRange:()=>gN,TimelineTrack:()=>yN,Tipsify:()=>yW,ToggleButtonViewModel:()=>hx,Tonemapper:()=>ox,Transforms:()=>Vt,TranslationRotationScale:()=>fg,TranslucentTileClassification:()=>PA,TridiagonalSystemSolver:()=>R1,TrustedServers:()=>LC,TweenCollection:()=>IT,UniformState:()=>Mw,UniformType:()=>iZ,UrlTemplateImageryProvider:()=>qa,VERSION:()=>MWt,VRButton:()=>SN,VRButtonViewModel:()=>_N,VRTheWorldTerrainProvider:()=>H8,VaryingType:()=>Iq,Vector3DTileBatch:()=>_h,Vector3DTileClampedPolylines:()=>aP,Vector3DTileContent:()=>lP,Vector3DTileGeometry:()=>nb,Vector3DTilePoints:()=>eP,Vector3DTilePolygons:()=>tP,Vector3DTilePolylines:()=>tS,Vector3DTilePrimitive:()=>S_,VelocityOrientationProperty:()=>ov,VelocityVectorProperty:()=>LS,VertexArray:()=>Jn,VertexArrayFacade:()=>Zb,VertexAttributeSemantic:()=>Zt,VertexFormat:()=>we,VerticalExaggeration:()=>Tr,VerticalExaggerationPipelineStage:()=>g2,VerticalOrigin:()=>wn,VideoSynchronizer:()=>z8,View:()=>VT,Viewer:()=>U$,ViewportQuad:()=>Lq,Visibility:()=>yr,Visualizer:()=>vj,VoxelBoxShape:()=>gp,VoxelCell:()=>hM,VoxelContent:()=>zM,VoxelCylinderShape:()=>yp,VoxelEllipsoidShape:()=>wT,VoxelInspector:()=>VN,VoxelInspectorViewModel:()=>CN,VoxelPrimitive:()=>sx,VoxelProvider:()=>Rq,VoxelRenderResources:()=>EM,VoxelShape:()=>Gq,VoxelShapeType:()=>Fi,VoxelTraversal:()=>nZ,VulkanConstants:()=>J8,WallGeometry:()=>Iv,WallGeometryLibrary:()=>PS,WallGeometryUpdater:()=>vv,WallGraphics:()=>Qp,WallOutlineGeometry:()=>Pv,WebGLConstants:()=>H,WebMapServiceImageryProvider:()=>kF,WebMapTileServiceImageryProvider:()=>BF,WebMercatorProjection:()=>Wi,WebMercatorTilingScheme:()=>cs,WindingOrder:()=>ps,WireframeIndexGenerator:()=>A1,WireframePipelineStage:()=>y2,_shadersAcesTonemappingStage:()=>wA,_shadersAdditiveBlend:()=>lM,_shadersAdjustTranslucentFS:()=>RL,_shadersAllMaterialAppearanceFS:()=>eR,_shadersAllMaterialAppearanceVS:()=>tR,_shadersAmbientOcclusionGenerate:()=>FA,_shadersAmbientOcclusionModulate:()=>AA,_shadersAspectRampMaterial:()=>uR,_shadersAtmosphereCommon:()=>S0,_shadersAtmosphereStageFS:()=>fX,_shadersAtmosphereStageVS:()=>hX,_shadersBasicMaterialAppearanceFS:()=>nR,_shadersBasicMaterialAppearanceVS:()=>iR,_shadersBillboardCollectionFS:()=>U2,_shadersBillboardCollectionVS:()=>k2,_shadersBlackAndWhite:()=>MA,_shadersBloomComposite:()=>NA,_shadersBrdfLutGeneratorFS:()=>lF,_shadersBrightPass:()=>uM,_shadersBrightness:()=>UA,_shadersBumpMapMaterial:()=>dR,_shadersCPUStylingStageFS:()=>NX,_shadersCPUStylingStageVS:()=>MX,_shadersCheckerboardMaterial:()=>mR,_shadersCloudCollectionFS:()=>uF,_shadersCloudCollectionVS:()=>dF,_shadersCloudNoiseFS:()=>mF,_shadersCloudNoiseVS:()=>fF,_shadersCompareAndPackTranslucentDepth:()=>hF,_shadersCompositeOITFS:()=>pF,_shadersCompositeTranslucentClassification:()=>CT,_shadersContrastBias:()=>kA,_shadersCustomShaderStageFS:()=>DX,_shadersCustomShaderStageVS:()=>kX,_shadersCzmBuiltins:()=>kx,_shadersDepthOfField:()=>DA,_shadersDepthPlaneFS:()=>bF,_shadersDepthPlaneVS:()=>gF,_shadersDepthView:()=>BA,_shadersDepthViewPacked:()=>Eq,_shadersDotMaterial:()=>fR,_shadersEdgeDetection:()=>OA,_shadersElevationBandMaterial:()=>hR,_shadersElevationContourMaterial:()=>pR,_shadersElevationRampMaterial:()=>bR,_shadersEllipsoidFS:()=>GL,_shadersEllipsoidSurfaceAppearanceFS:()=>qM,_shadersEllipsoidSurfaceAppearanceVS:()=>$M,_shadersEllipsoidVS:()=>EL,_shadersFXAA:()=>KA,_shadersFXAA3_11:()=>yF,_shadersFadeMaterial:()=>gR,_shadersFeatureIdStageFS:()=>BX,_shadersFeatureIdStageVS:()=>OX,_shadersFilmicTonemapping:()=>YA,_shadersGaussianBlur1D:()=>ix,_shadersGeometryStageFS:()=>QX,_shadersGeometryStageVS:()=>jX,_shadersGlobeFS:()=>xF,_shadersGlobeVS:()=>_F,_shadersGridMaterial:()=>yR,_shadersGroundAtmosphere:()=>WL,_shadersHSBToRGB:()=>fE,_shadersHSLToRGB:()=>hE,_shadersImageBasedLightingStageFS:()=>bX,_shadersInstancingStageCommon:()=>RX,_shadersInstancingStageVS:()=>GX,_shadersIntersectBox:()=>SM,_shadersIntersectClippingPlanes:()=>_M,_shadersIntersectCylinder:()=>TM,_shadersIntersectDepth:()=>xM,_shadersIntersectEllipsoid:()=>CM,_shadersIntersectLongitude:()=>eZ,_shadersIntersection:()=>vT,_shadersIntersectionUtils:()=>yM,_shadersLegacyInstancingStageVS:()=>EX,_shadersLensFlare:()=>zA,_shadersLightingStageFS:()=>e2,_shadersMaterialStageFS:()=>n2,_shadersMegatexture:()=>GM,_shadersMetadataStageFS:()=>YX,_shadersMetadataStageVS:()=>KX,_shadersModelClippingPlanesStageFS:()=>SX,_shadersModelClippingPolygonsStageFS:()=>VX,_shadersModelClippingPolygonsStageVS:()=>CX,_shadersModelColorStageFS:()=>_X,_shadersModelFS:()=>sX,_shadersModelSilhouetteStageFS:()=>L2,_shadersModelSilhouetteStageVS:()=>Z2,_shadersModelSplitterStageFS:()=>G2,_shadersModelVS:()=>aX,_shadersModifiedReinhardTonemapping:()=>HA,_shadersMorphTargetsStageVS:()=>o2,_shadersNightVision:()=>JA,_shadersNormalMapMaterial:()=>xR,_shadersOctahedralProjectionAtlasFS:()=>m_,_shadersOctahedralProjectionFS:()=>f_,_shadersOctahedralProjectionVS:()=>h_,_shadersOctree:()=>RM,_shadersPassThrough:()=>hu,_shadersPassThroughDepth:()=>ex,_shadersPerInstanceColorAppearanceFS:()=>ER,_shadersPerInstanceColorAppearanceVS:()=>WR,_shadersPerInstanceFlatColorAppearanceFS:()=>Ax,_shadersPerInstanceFlatColorAppearanceVS:()=>IR,_shadersPointCloudEyeDomeLighting:()=>YI,_shadersPointCloudStylingStageVS:()=>a2,_shadersPointPrimitiveCollectionFS:()=>cy,_shadersPointPrimitiveCollectionVS:()=>YP,_shadersPolygonSignedDistanceFS:()=>XI,_shadersPolylineArrowMaterial:()=>_R,_shadersPolylineColorAppearanceVS:()=>IW,_shadersPolylineCommon:()=>Ru,_shadersPolylineDashMaterial:()=>SR,_shadersPolylineFS:()=>$x,_shadersPolylineGlowMaterial:()=>TR,_shadersPolylineMaterialAppearanceVS:()=>XW,_shadersPolylineOutlineMaterial:()=>CR,_shadersPolylineShadowVolumeFS:()=>RW,_shadersPolylineShadowVolumeMorphFS:()=>GW,_shadersPolylineShadowVolumeMorphVS:()=>EW,_shadersPolylineShadowVolumeVS:()=>WW,_shadersPolylineVS:()=>H2,_shadersPrimitiveOutlineStageFS:()=>u2,_shadersPrimitiveOutlineStageVS:()=>l2,_shadersRGBToHSB:()=>NE,_shadersRGBToHSL:()=>UE,_shadersRGBToXYZ:()=>kE,_shadersReinhardTonemapping:()=>QA,_shadersReprojectWebMercatorFS:()=>SF,_shadersReprojectWebMercatorVS:()=>TF,_shadersRimLightingMaterial:()=>VR,_shadersSelectedFeatureIdStageCommon:()=>F1,_shadersShadowVolumeAppearanceFS:()=>DC,_shadersShadowVolumeAppearanceVS:()=>hW,_shadersShadowVolumeFS:()=>cg,_shadersSilhouette:()=>jA,_shadersSkinningStageVS:()=>h2,_shadersSkyAtmosphereCommon:()=>IL,_shadersSkyAtmosphereFS:()=>CF,_shadersSkyAtmosphereVS:()=>VF,_shadersSkyBoxFS:()=>LF,_shadersSkyBoxVS:()=>ZF,_shadersSlopeRampMaterial:()=>LR,_shadersStripeMaterial:()=>ZR,_shadersSunFS:()=>RF,_shadersSunTextureFS:()=>GF,_shadersSunVS:()=>EF,_shadersTexturedMaterialAppearanceFS:()=>oR,_shadersTexturedMaterialAppearanceVS:()=>rR,_shadersVector3DTileClampedPolylinesFS:()=>rP,_shadersVector3DTileClampedPolylinesVS:()=>oP,_shadersVector3DTilePolylinesVS:()=>nP,_shadersVectorTileVS:()=>qC,_shadersVerticalExaggerationStageVS:()=>b2,_shadersViewportQuadFS:()=>WF,_shadersViewportQuadVS:()=>QS,_shadersVoxelFS:()=>bM,_shadersVoxelUtils:()=>pM,_shadersVoxelVS:()=>gM,_shadersWater:()=>RR,_shadersXYZToRGB:()=>mW,_shadersacesTonemapping:()=>IG,_shadersalphaWeight:()=>XG,_shadersantialias:()=>PG,_shadersapplyHSBShift:()=>vG,_shadersapproximateSphericalCoordinates:()=>wG,_shadersapproximateTanh:()=>FG,_shadersbackFacing:()=>AG,_shadersbranchFreeTernary:()=>MG,_shaderscascadeColor:()=>NG,_shaderscascadeDistance:()=>UG,_shaderscascadeMatrix:()=>kG,_shaderscascadeWeights:()=>DG,_shadersclipPolygons:()=>BG,_shaderscolumbusViewMorph:()=>OG,_shaderscomputeAtmosphereColor:()=>YG,_shaderscomputeGroundAtmosphereScattering:()=>KG,_shaderscomputePosition:()=>zG,_shaderscomputeScattering:()=>HG,_shadersconvertUvToBox:()=>VM,_shadersconvertUvToCylinder:()=>LM,_shadersconvertUvToEllipsoid:()=>ZM,_shaderscosineAndSine:()=>JG,_shadersdecompressTextureCoordinates:()=>QG,_shadersdegreesPerRadian:()=>NR,_shadersdepthClamp:()=>jG,_shadersdepthRange:()=>UR,_shadersdepthRangeStruct:()=>CG,_shaderseastNorthUpToEyeCoordinates:()=>qG,_shadersellipsoidContainsPoint:()=>$G,_shadersellipsoidTextureCoordinates:()=>eE,_shadersepsilon1:()=>kR,_shadersepsilon2:()=>DR,_shadersepsilon3:()=>BR,_shadersepsilon4:()=>OR,_shadersepsilon5:()=>YR,_shadersepsilon6:()=>KR,_shadersepsilon7:()=>zR,_shadersequalsEpsilon:()=>tE,_shaderseyeOffset:()=>nE,_shaderseyeToWindowCoordinates:()=>iE,_shadersfastApproximateAtan:()=>oE,_shadersfog:()=>rE,_shadersgammaCorrect:()=>sE,_shadersgeodeticSurfaceNormal:()=>aE,_shadersgetDefaultMaterial:()=>cE,_shadersgetDynamicAtmosphereLightDirection:()=>lE,_shadersgetLambertDiffuse:()=>uE,_shadersgetSpecular:()=>dE,_shadersgetWaterNoise:()=>mE,_shadershue:()=>pE,_shadersinfinity:()=>HR,_shadersinverseGamma:()=>bE,_shadersisEmpty:()=>gE,_shadersisFull:()=>yE,_shaderslatitudeToWebMercatorFraction:()=>xE,_shaderslineDistance:()=>SE,_shaderslinearToSrgb:()=>_E,_shadersluminance:()=>TE,_shadersmaterial:()=>VG,_shadersmaterialInput:()=>LG,_shadersmaximumComponent:()=>CE,_shadersmetersPerPixel:()=>VE,_shadersmodelMaterial:()=>ZG,_shadersmodelToWindowCoordinates:()=>LE,_shadersmodelVertexOutput:()=>RG,_shadersmultiplyWithColorBalance:()=>ZE,_shadersnearFarScalar:()=>RE,_shadersoctDecode:()=>GE,_shadersoneOverPi:()=>JR,_shadersoneOverTwoPi:()=>QR,_shaderspackDepth:()=>EE,_shaderspassCesium3DTile:()=>jR,_shaderspassCesium3DTileClassification:()=>qR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>$R,_shaderspassClassification:()=>eG,_shaderspassCompute:()=>tG,_shaderspassEnvironment:()=>nG,_shaderspassGlobe:()=>iG,_shaderspassOpaque:()=>oG,_shaderspassOverlay:()=>rG,_shaderspassTerrainClassification:()=>sG,_shaderspassTranslucent:()=>aG,_shaderspassVoxels:()=>cG,_shaderspbrLighting:()=>WE,_shadersphong:()=>IE,_shaderspi:()=>lG,_shaderspiOverFour:()=>uG,_shaderspiOverSix:()=>dG,_shaderspiOverThree:()=>mG,_shaderspiOverTwo:()=>fG,_shadersplaneDistance:()=>XE,_shaderspointAlongRay:()=>PE,_shadersradiansPerDegree:()=>hG,_shadersray:()=>GG,_shadersrayEllipsoidIntersectionInterval:()=>vE,_shadersraySegment:()=>EG,_shadersraySphereIntersectionInterval:()=>wE,_shadersreadDepth:()=>FE,_shadersreadNonPerspective:()=>AE,_shadersreverseLogDepth:()=>ME,_shadersround:()=>DE,_shaderssampleOctahedralProjection:()=>BE,_shaderssaturation:()=>OE,_shaderssceneMode2D:()=>pG,_shaderssceneMode3D:()=>bG,_shaderssceneModeColumbusView:()=>gG,_shaderssceneModeMorphing:()=>yG,_shadersshadowDepthCompare:()=>YE,_shadersshadowParameters:()=>WG,_shadersshadowVisibility:()=>KE,_shaderssignNotZero:()=>zE,_shaderssolarRadius:()=>xG,_shaderssphericalHarmonics:()=>HE,_shaderssrgbToLinear:()=>JE,_shaderstangentToEyeSpaceMatrix:()=>QE,_shaderstextureCube:()=>jE,_shadersthreePiOver2:()=>_G,_shaderstransformPlane:()=>qE,_shaderstranslateRelativeToEye:()=>$E,_shaderstranslucentPhong:()=>eW,_shaderstranspose:()=>tW,_shaderstwoPi:()=>SG,_shadersunpackClippingExtents:()=>nW,_shadersunpackDepth:()=>iW,_shadersunpackFloat:()=>oW,_shadersunpackUint:()=>rW,_shadersvalueTransform:()=>sW,_shadersvertexLogDepth:()=>aW,_shaderswebMercatorMaxLatitude:()=>TG,_shaderswindowToEyeCoordinates:()=>cW,_shaderswriteDepthClamp:()=>lW,_shaderswriteLogDepth:()=>uW,_shaderswriteNonPerspective:()=>dW,addBuffer:()=>bI,addDefaults:()=>cI,addExtensionsRequired:()=>fI,addExtensionsUsed:()=>Fd,addPipelineExtras:()=>Rg,addToArray:()=>Ls,appendForwardSlash:()=>AZ,arrayRemoveDuplicates:()=>Lo,barycentricCoordinates:()=>Bx,binarySearch:()=>wo,buildDrawCommand:()=>dX,buildModuleUrl:()=>an,buildVoxelDrawCommands:()=>IM,clone:()=>Ue,combine:()=>ft,computeFlyToLocationForRectangle:()=>BT,createBillboardPointCallback:()=>j_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>Y9,createDefaultTerrainProviderViewModels:()=>K9,createElevationBandMaterial:()=>k6,createGooglePhotorealistic3DTileset:()=>D6,createGuid:()=>Nn,createMaterialPropertyDescriptor:()=>Fo,createOsmBuildingsAsync:()=>B6,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>Ul,createTangentSpaceDebugPrimitive:()=>O6,createTaskProcessorWorker:()=>Xq,createUniform:()=>AR,createUniformArray:()=>MR,createWorldBathymetryAsync:()=>Bw,createWorldImageryAsync:()=>Z0,createWorldTerrainAsync:()=>nT,decodeGoogleEarthEnterpriseData:()=>Ow,decodeVectorPolylinePositions:()=>cP,defaultValue:()=>y,defer:()=>ca,defined:()=>l,demodernizeShader:()=>fW,deprecationWarning:()=>po,destroyObject:()=>de,exportKml:()=>D4,findAccessorMinMax:()=>G_,findContentMetadata:()=>iS,findGroupMetadata:()=>oS,findTileMetadata:()=>mP,forEachTextureInMaterial:()=>a1,formatError:()=>ip,freezeRenderState:()=>gK,getAbsoluteUri:()=>Su,getAccessorByteStride:()=>Kl,getBaseUri:()=>MZ,getBinaryAccessor:()=>Wu,getClipAndStyleCode:()=>t9,getClippingFunction:()=>T0,getComponentReader:()=>ub,getElement:()=>Pn,getExtensionFromUri:()=>Lx,getFilenameFromUri:()=>Qb,getImageFromTypedArray:()=>Jw,getImagePixels:()=>wm,getJsonFromTypedArray:()=>Zo,getMagic:()=>cl,getStringFromTypedArray:()=>Os,getTimestamp:()=>Si,hasExtension:()=>si,heightReferenceOnEntityPropertyChanged:()=>jp,isBitSet:()=>Nc,isBlobUri:()=>Zx,isCrossOriginUrl:()=>q0,isDataUri:()=>Ep,isLeapYear:()=>vm,knockout:()=>Ce,knockout_3_5_1:()=>lC,knockout_es5:()=>I9,loadAndExecuteScript:()=>Rx,loadCubeMap:()=>Uw,loadImageFromTypedArray:()=>cb,loadKTX2:()=>Ns,mergeSort:()=>x0,moveTechniqueRenderStates:()=>mI,moveTechniquesToExtension:()=>hI,numberOfComponentsForType:()=>Xu,objectToQuery:()=>Gx,oneTimeWarning:()=>Bt,parseBatchTable:()=>yb,parseFeatureMetadataLegacy:()=>UI,parseGlb:()=>uI,parseResponseHeaders:()=>NZ,parseStructuralMetadata:()=>NI,pickModel:()=>N1,pointInsideTriangle:()=>X8,preprocess3DTileContent:()=>wh,processVoxelProperties:()=>WM,queryToObject:()=>Tu,readAccessorPacked:()=>gI,removeExtension:()=>E_,removeExtensionsRequired:()=>lI,removeExtensionsUsed:()=>R_,removePipelineExtras:()=>dI,removeUnusedElements:()=>pI,resizeImageToNextPowerOfTwo:()=>Wg,sampleTerrain:()=>rF,sampleTerrainMostDetailed:()=>cT,scaleToGeodeticSurface:()=>Vx,srgbToLinear:()=>uT,subdivideArray:()=>pW,subscribeAndEvaluate:()=>Pa,updateAccessorComponentTypes:()=>yI,updateVersion:()=>xI,usesExtension:()=>fr,viewerCesium3DTilesInspectorMixin:()=>k$,viewerCesiumInspectorMixin:()=>D$,viewerDragDropMixin:()=>O$,viewerPerformanceWatchdogMixin:()=>Y$,viewerVoxelInspectorMixin:()=>K$,webGLConstantToGlslType:()=>_0,wrapFunction:()=>cF,writeTextToCanvas:()=>$_});var BUo=S(T(),1);var v0o=S(T(),1);var gIt=S(T(),1);var OWt=S(T(),1);function pee(e,t){return e??t}pee.EMPTY_OBJECT=Object.freeze({});var y=pee;var KWt=S(T(),1);function bZe(e){return e!=null}var l=bZe;var JWt=S(T(),1);function Tx(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Tx.prototype=Object.create(Error.prototype),Tx.prototype.constructor=Tx);Tx.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};Tx.throwInstantiationError=function(){throw new Tx("This function defines an interface and should not be called directly.")};var he=Tx;var nIt=S(T(),1);var $Wt=S(T(),1);var Vs={};Vs.typeOf={};function gZe(e){return`${e} is required, actual value was undefined`}function yC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Vs.defined=function(e,t){if(!l(t))throw new he(gZe(e))};Vs.typeOf.func=function(e,t){if(typeof t!="function")throw new he(yC(typeof t,"function",e))};Vs.typeOf.string=function(e,t){if(typeof t!="string")throw new he(yC(typeof t,"string",e))};Vs.typeOf.number=function(e,t){if(typeof t!="number")throw new he(yC(typeof t,"number",e))};Vs.typeOf.number.lessThan=function(e,t,n){if(Vs.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Vs.typeOf.number.lessThanOrEquals=function(e,t,n){if(Vs.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Vs.typeOf.number.greaterThan=function(e,t,n){if(Vs.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Vs.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Vs.typeOf.number(e,t),t0){for(o.sort(yZe),e=0;e0&&(this._hash={},e.length=0)};var Gt=Cx;var Fwt=S(T(),1);var WIt=S(T(),1);var LIt=S(T(),1),nY=S(PN(),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=y(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=y(t,255),Math.round((dt.clamp(e,-1,1)*.5+.5)*t)};dt.fromSNorm=function(e,t){return t=y(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=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});dt.cosh=y(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?dt.TWO_PI:t};dt.mod=function(e,t){return dt.sign(e)===dt.sign(t)&&Math.abs(e)n};dt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var vN=[1];dt.factorial=function(e){let t=vN.length;if(e>=t){let n=vN[t-1];for(let i=t;i<=e;i++){let o=n*i;vN.push(o),n=o}}return vN[e]};dt.incrementWrap=function(e,t,n){return n=y(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 en?n:e};var gee=new nY.default;dt.setRandomNumberSeed=function(e){gee=new nY.default(e)};dt.nextRandomNumber=function(){return gee.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=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});dt.log2=y(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 kt(e,t){this.x=y(e,0),this.y=y(t,0)}kt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new kt(e,t)};kt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new kt(e.x,e.y)};kt.fromCartesian3=kt.clone;kt.fromCartesian4=kt.clone;kt.packedLength=2;kt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};kt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new kt),n.x=e[t++],n.y=e[t],n};kt.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;oX.EPSILON12);return l(o)?(o.x=r*F,o.y=s*M,o.z=a*g,o):new f(r*F,s*M,a*g)}var Vx=ZZe;function Uo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Uo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Uo(e,t,n)};Uo.fromDegrees=function(e,t,n,i){return e=X.toRadians(e),t=X.toRadians(t),Uo.fromRadians(e,t,n,i)};var RZe=new f,GZe=new f,EZe=new f;Uo._ellipsoidOneOverRadii=new f(1/6378137,1/6378137,1/6356752314245179e-9);Uo._ellipsoidOneOverRadiiSquared=new f(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Uo._ellipsoidCenterToleranceSquared=X.EPSILON1;Uo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Uo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Uo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Uo._ellipsoidCenterToleranceSquared,s=Vx(e,i,o,r,GZe);if(!l(s))return;let a=f.multiplyComponents(s,o,RZe);a=f.normalize(a,a);let c=f.subtract(e,s,EZe),u=Math.atan2(a.y,a.x),d=Math.asin(a.z),m=X.sign(f.dot(c,e))*f.magnitude(c);return l(n)?(n.longitude=u,n.latitude=d,n.height=m,n):new Uo(u,d,m)};Uo.toCartesian=function(e,t,n){return f.fromRadians(e.longitude,e.latitude,e.height,t,n)};Uo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Uo(e.longitude,e.latitude,e.height)};Uo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Uo.equalsEpsilon=function(e,t,n){return n=y(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};Uo.ZERO=Object.freeze(new Uo(0,0,0));Uo.prototype.clone=function(e){return Uo.clone(this,e)};Uo.prototype.equals=function(e){return Uo.equals(this,e)};Uo.prototype.equalsEpsilon=function(e,t){return Uo.equalsEpsilon(this,e,t)};Uo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=Uo;var nXt=S(T(),1);function Cee(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new f(t,n,i),e._radiiSquared=new f(t*t,n*n,i*i),e._radiiToTheFourth=new f(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new f(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new f(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 bi(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,Cee(this,e,t,n)}Object.defineProperties(bi.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}}});bi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(f.clone(n,t._radii),f.clone(e._radiiSquared,t._radiiSquared),f.clone(e._radiiToTheFourth,t._radiiToTheFourth),f.clone(e._oneOverRadii,t._oneOverRadii),f.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new bi(n.x,n.y,n.z)};bi.fromCartesian3=function(e,t){return l(t)||(t=new bi),l(e)&&Cee(t,e.x,e.y,e.z),t};bi.WGS84=Object.freeze(new bi(6378137,6378137,6356752314245179e-9));bi.UNIT_SPHERE=Object.freeze(new bi(1,1,1));bi.MOON=Object.freeze(new bi(X.LUNAR_RADIUS,X.LUNAR_RADIUS,X.LUNAR_RADIUS));bi._default=bi.WGS84;Object.defineProperties(bi,{default:{get:function(){return bi._default},set:function(e){bi._default=e,f._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});bi.prototype.clone=function(e){return bi.clone(this,e)};bi.packedLength=f.packedLength;bi.pack=function(e,t,n){return n=y(n,0),f.pack(e._radii,t,n),t};bi.unpack=function(e,t,n){t=y(t,0);let i=f.unpack(e,t);return bi.fromCartesian3(i,n)};bi.prototype.geocentricSurfaceNormal=f.normalize;bi.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 f),t.x=r,t.y=s,t.z=a,f.normalize(t,t)};bi.prototype.geodeticSurfaceNormal=function(e,t){if(!f.equalsEpsilon(e,f.ZERO,X.EPSILON14))return l(t)||(t=new f),t=f.multiplyComponents(e,this._oneOverRadiiSquared,t),f.normalize(t,t)};var WZe=new f,IZe=new f;bi.prototype.cartographicToCartesian=function(e,t){let n=WZe,i=IZe;this.geodeticSurfaceNormalCartographic(e,n),f.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(f.dot(n,i));return f.divideByScalar(i,o,i),f.multiplyByScalar(n,e.height,n),l(t)||(t=new f),f.add(i,n,t)};bi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var wZe=new f;bi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new B);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,wZe),i=f.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return B.fromElements(1/i,1/r,t)};var FZe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],AZe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Tee(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*FZe[s];r+=AZe[s]*(n(i+a)+n(i-a))}return r*=o,r}bi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n0){o=r-1;continue}return r}return~(o+1)}var wo=DZe;var _Xt=S(T(),1);function BZe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Q0=BZe;var OXt=S(T(),1);var GXt=S(T(),1);var TXt=S(T(),1);function OZe(e){return e%4===0&&e%100!==0||e%400===0}var vm=OZe;var Zee=[31,28,31,30,31,30,31,31,30,31,30,31];function YZe(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(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 x(){no.typeOf.number.greaterThanOrEquals("Year",e,1),no.typeOf.number.lessThanOrEquals("Year",e,9999),no.typeOf.number.greaterThanOrEquals("Month",t,1),no.typeOf.number.lessThanOrEquals("Month",t,12),no.typeOf.number.greaterThanOrEquals("Day",n,1),no.typeOf.number.lessThanOrEquals("Day",n,31),no.typeOf.number.greaterThanOrEquals("Hour",i,0),no.typeOf.number.lessThanOrEquals("Hour",i,23),no.typeOf.number.greaterThanOrEquals("Minute",o,0),no.typeOf.number.lessThanOrEquals("Minute",o,59),no.typeOf.bool("IsLeapSecond",a),no.typeOf.number.greaterThanOrEquals("Second",r,0),no.typeOf.number.lessThanOrEquals("Second",r,a?60:59),no.typeOf.number.greaterThanOrEquals("Millisecond",s,0),no.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&vm(e)?Zee[t-1]+1:Zee[t-1];if(n>C)throw new he("Month and Day represents invalid date")}}var Gp=YZe;var WXt=S(T(),1);function KZe(e,t){this.julianDate=e,this.offset=t}var Oi=KZe;var XXt=S(T(),1),zZe={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},Qn=Object.freeze(zZe);var vXt=S(T(),1),HZe={UTC:0,TAI:1},Hn=Object.freeze(HZe);var Gee=new Gp,rY=[31,28,31,30,31,30,31,31,30,31,30,31],sY=29;function aY(e,t){return Pt.compare(e.julianDate,t.julianDate)}var _C=new Oi;function kN(e){_C.julianDate=e;let t=Pt.leapSeconds,n=wo(t,_C,aY);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Pt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Pt.addSeconds(e,i,e)}function Ree(e,t){_C.julianDate=e;let n=Pt.leapSeconds,i=wo(n,_C,aY);if(i<0&&(i=~i),i===0)return Pt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Pt.addSeconds(e,-n[i-1].offset,t);let o=Pt.secondsDifference(n[i].julianDate,e);if(o===0)return Pt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Pt.addSeconds(e,-n[--i].offset,t)}function j0(e,t,n){let i=t/Qn.SECONDS_PER_DAY|0;return e+=i,t-=Qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function cY(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let d=r+(i*Qn.SECONDS_PER_HOUR+o*Qn.SECONDS_PER_MINUTE+s*Qn.SECONDS_PER_MILLISECOND);return d>=43200&&(u-=1),[u,d]}var JZe=/^(\d{4})$/,QZe=/^(\d{4})-(\d{2})$/,jZe=/^(\d{4})-?(\d{3})$/,qZe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,$Ze=/^(\d{4})-?(\d{2})-?(\d{2})$/,lY=/([Z+\-])?(\d{2})?:?(\d{2})?$/,eRe=/^(\d{2})(\.\d+)?/.source+lY.source,tRe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+lY.source,nRe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+lY.source;function Pt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Hn.UTC);let i=e|0;t=t+(e-i)*Qn.SECONDS_PER_DAY,j0(i,t,this),n===Hn.UTC&&kN(this)}Pt.fromGregorianDate=function(e,t){let n=cY(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(j0(n[0],n[1],t),kN(t),t):new Pt(n[0],n[1],Hn.UTC)};Pt.fromDate=function(e,t){let n=cY(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(j0(n[0],n[1],t),kN(t),t):new Pt(n[0],n[1],Hn.UTC)};Pt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,d=n[0],m=n[1],p,b;if(n=d.match($Ze),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=d.match(QZe),n!==null)i=+n[1],o=+n[2];else if(n=d.match(JZe),n!==null)i=+n[1];else{let C;if(n=d.match(jZe),n!==null)i=+n[1],C=+n[2],b=vm(i);else if(n=d.match(qZe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,R=new Date(Date.UTC(i,0,4));C=V*7+L-R.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}b=vm(i);let h;if(l(m)){n=m.match(nRe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,h=5):(n=m.match(tRe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,h=4):(n=m.match(eRe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,h=3)));let C=n[h],V=+n[h+1],L=+(n[h+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=b&&o===2?sY:rY[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=b&&o===2?sY:rY[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=b&&o===2?sY:rY[o-1],r+=p;let _=cY(i,o,r,s,a,c,u);return l(t)?(j0(_[0],_[1],t),kN(t)):t=new Pt(_[0],_[1],Hn.UTC),x&&Pt.addSeconds(t,1,t),t};Pt.now=function(e){return Pt.fromDate(new Date,e)};var UN=new Pt(0,0,Hn.TAI);Pt.toGregorianDate=function(e,t){let n=!1,i=Ree(e,UN);l(i)||(Pt.addSeconds(e,-1,UN),i=Ree(UN,UN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,d=s-(2447*u/80|0)|0;s=u/11|0;let m=u+2-12*s|0,p=100*(a-49)+c+s|0,b=r/Qn.SECONDS_PER_HOUR|0,h=r-b*Qn.SECONDS_PER_HOUR,x=h/Qn.SECONDS_PER_MINUTE|0;h=h-x*Qn.SECONDS_PER_MINUTE;let _=h|0,C=(h-_)/Qn.SECONDS_PER_MILLISECOND;return b+=12,b>23&&(b-=24),n&&(_+=1),l(t)?(t.year=p,t.month=m,t.day=d,t.hour=b,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new Gp(p,m,d,b,x,_,C,n)};Pt.toDate=function(e){let t=Pt.toGregorianDate(e,Gee),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Pt.toIso8601=function(e,t){let n=Pt.toGregorianDate(e,Gee),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let d;return!l(t)&&u!==0?(d=(u*.01).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")}.${d}Z`):!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`:(d=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)};Pt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Pt(e.dayNumber,e.secondsOfDay,Hn.TAI)};Pt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Pt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Pt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Pt.secondsDifference(e,t))<=n};Pt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Qn.SECONDS_PER_DAY};Pt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Pt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Qn.SECONDS_PER_DAY;return n+i};Pt.computeTaiMinusUtc=function(e){_C.julianDate=e;let t=Pt.leapSeconds,n=wo(t,_C,aY);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Pt.addSeconds=function(e,t,n){return j0(e.dayNumber,e.secondsOfDay+t,n)};Pt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_MINUTE;return j0(e.dayNumber,i,n)};Pt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Qn.SECONDS_PER_HOUR;return j0(e.dayNumber,i,n)};Pt.addDays=function(e,t,n){let i=e.dayNumber+t;return j0(i,e.secondsOfDay,n)};Pt.lessThan=function(e,t){return Pt.compare(e,t)<0};Pt.lessThanOrEquals=function(e,t){return Pt.compare(e,t)<=0};Pt.greaterThan=function(e,t){return Pt.compare(e,t)>0};Pt.greaterThanOrEquals=function(e,t){return Pt.compare(e,t)>=0};Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t){return Pt.equalsEpsilon(this,e,t)};Pt.prototype.toString=function(){return Pt.toIso8601(this)};Pt.leapSeconds=[new Oi(new Pt(2441317,43210,Hn.TAI),10),new Oi(new Pt(2441499,43211,Hn.TAI),11),new Oi(new Pt(2441683,43212,Hn.TAI),12),new Oi(new Pt(2442048,43213,Hn.TAI),13),new Oi(new Pt(2442413,43214,Hn.TAI),14),new Oi(new Pt(2442778,43215,Hn.TAI),15),new Oi(new Pt(2443144,43216,Hn.TAI),16),new Oi(new Pt(2443509,43217,Hn.TAI),17),new Oi(new Pt(2443874,43218,Hn.TAI),18),new Oi(new Pt(2444239,43219,Hn.TAI),19),new Oi(new Pt(2444786,43220,Hn.TAI),20),new Oi(new Pt(2445151,43221,Hn.TAI),21),new Oi(new Pt(2445516,43222,Hn.TAI),22),new Oi(new Pt(2446247,43223,Hn.TAI),23),new Oi(new Pt(2447161,43224,Hn.TAI),24),new Oi(new Pt(2447892,43225,Hn.TAI),25),new Oi(new Pt(2448257,43226,Hn.TAI),26),new Oi(new Pt(2448804,43227,Hn.TAI),27),new Oi(new Pt(2449169,43228,Hn.TAI),28),new Oi(new Pt(2449534,43229,Hn.TAI),29),new Oi(new Pt(2450083,43230,Hn.TAI),30),new Oi(new Pt(2450630,43231,Hn.TAI),31),new Oi(new Pt(2451179,43232,Hn.TAI),32),new Oi(new Pt(2453736,43233,Hn.TAI),33),new Oi(new Pt(2454832,43234,Hn.TAI),34),new Oi(new Pt(2456109,43235,Hn.TAI),35),new Oi(new Pt(2457204,43236,Hn.TAI),36),new Oi(new Pt(2457754,43237,Hn.TAI),37)];var ne=Pt;var MPt=S(T(),1),zee=S(_u(),1);var QXt=S(T(),1);function iRe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var AZ=iRe;var $Xt=S(T(),1);function wee(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=wee(o,t)),n[i]=o}return n}var Ue=wee;var i2t=S(T(),1);function Fee(e,t,n){n=y(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]=Fee(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 ft=Fee;var r2t=S(T(),1);function oRe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var ca=oRe;var l2t=S(T(),1),Aee=S(_u(),1);function uY(e,t){let n;return typeof document<"u"&&(n=document),uY._implementation(e,t,n)}uY._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new Aee.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Su=uY;var d2t=S(T(),1),Mee=S(_u(),1);function rRe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Mee.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var MZ=rRe;var f2t=S(T(),1),Nee=S(_u(),1);function sRe(e){let t=new Nee.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 Lx=sRe;var b2t=S(T(),1);var Uee={};function aRe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Uee[t];l(i)||(i={},Uee[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 wm=aRe;var y2t=S(T(),1);var cRe=/^blob:/i;function lRe(e){return cRe.test(e)}var Zx=lRe;var S2t=S(T(),1);var oh;function uRe(e){l(oh)||(oh=document.createElement("a")),oh.href=window.location.href;let t=oh.host,n=oh.protocol;return oh.href=e,oh.href=oh.href,n!==oh.protocol||t!==oh.host}var q0=uRe;var C2t=S(T(),1);var dRe=/^data:/i;function mRe(e){return dRe.test(e)}var Ep=mRe;var L2t=S(T(),1);function fRe(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 Rx=fRe;var R2t=S(T(),1);function hRe(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;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var NZ=yRe;function kee(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=NZ(this.responseHeaders))}kee.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var rh=kee;var sPt=S(T(),1),KN=S(_u(),1);var Q2t=S(T(),1);function Ex(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Ex.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=0;--t)this.heapify(t)};Ex.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};Ex.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return dY(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var UZ=Ex;function xRe(e,t){return e.priority-t.priority}var io={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},CC=20,mc=new UZ({comparator:xRe});mc.maximumLength=CC;mc.reserve(CC);var sh=[],Wp={},_Re=typeof document<"u"?new KN.default(document.location.href):new KN.default,zN=new be;function er(){}er.maximumRequests=50;er.maximumRequestsPerServer=18;er.requestsByServer={};er.throttleRequests=!0;er.debugShowStatistics=!1;er.requestCompletedEvent=zN;Object.defineProperties(er,{statistics:{get:function(){return io}},priorityHeapLength:{get:function(){return CC},set:function(e){if(ee;){let t=mc.pop();Wx(t)}CC=e,mc.maximumLength=e,mc.reserve(e)}}});function Dee(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}er.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(er.requestsByServer[e],er.maximumRequestsPerServer);return Wp[e]+t<=n};er.heapHasOpenSlots=function(e){return mc.length+e<=CC};function Bee(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=ca()),e.deferred.promise}function SRe(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--io.numberOfActiveRequests,--Wp[e.serverKey],zN.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function TRe(e){return function(t){e.state!==$n.CANCELLED&&(++io.numberOfFailedRequests,--io.numberOfActiveRequests,--Wp[e.serverKey],zN.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function Oee(e){let t=Bee(e);return e.state=$n.ACTIVE,sh.push(e),++io.numberOfActiveRequests,++io.numberOfActiveRequestsEver,++Wp[e.serverKey],e.requestFunction().then(SRe(e)).catch(TRe(e)),t}function Wx(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++io.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--io.numberOfActiveRequests,--Wp[e.serverKey],++io.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}er.update=function(){let e,t,n=0,i=sh.length;for(e=0;e0&&(sh[e-n]=t)}sh.length-=n;let o=mc.internalArray,r=mc.length;for(e=0;e0;){if(t=mc.pop(),t.cancelled){Wx(t);continue}if(t.throttleByServer&&!er.serverHasOpenSlots(t.serverKey)){Wx(t);continue}Oee(t),++a}CRe()};er.getServerKey=function(e){let t=new KN.default(e);t.scheme()===""&&(t=t.absoluteTo(_Re),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Wp[n];return l(i)||(Wp[n]=0),n};er.request=function(e){if(Ep(e.url)||Zx(e.url))return zN.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++io.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=er.getServerKey(e.url)),er.throttleRequests&&e.throttleByServer&&!er.serverHasOpenSlots(e.serverKey))return;if(!er.throttleRequests||!e.throttle)return Oee(e);if(sh.length>=er.maximumRequests)return;Dee(e);let t=mc.insert(e);if(l(t)){if(t===e)return;Wx(t)}return Bee(e)};function CRe(){er.debugShowStatistics&&(io.numberOfActiveRequests===0&&io.lastNumberOfActiveRequests>0&&(io.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${io.numberOfAttemptedRequests}`),io.numberOfAttemptedRequests=0),io.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${io.numberOfCancelledRequests}`),io.numberOfCancelledRequests=0),io.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${io.numberOfCancelledActiveRequests}`),io.numberOfCancelledActiveRequests=0),io.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${io.numberOfFailedRequests}`),io.numberOfFailedRequests=0)),io.lastNumberOfActiveRequests=io.numberOfActiveRequests)}er.clearForSpecs=function(){for(;mc.length>0;){let t=mc.pop();Wx(t)}let e=sh.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Wt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Wt.prototype.parseUrl=function(e,t,n,i){let o=new zee.default(e),r=LRe(o.query());this._queryParameters=t?JN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Su(i))),this._url=o.toString()};function LRe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Tu(e)}function JN(e,t,n){if(!n)return ft(e,t);let i=Ue(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Wt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${ZRe(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 ZRe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Gx(e)}`}Wt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=JN(this._queryParameters,e,!1):this._queryParameters=JN(e,this._queryParameters,!1)};Wt.prototype.appendQueryParameters=function(e){this._queryParameters=JN(e,this._queryParameters,!0)};Wt.prototype.setTemplateValues=function(e,t){t?this._templateValues=ft(this._templateValues,e):this._templateValues=ft(e,this._templateValues)};Wt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=ft(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=ft(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=ft(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Wt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Wt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ue(this._queryParameters),e._templateValues=Ue(this._templateValues),e.headers=Ue(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Wt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Wt.prototype.getBaseUri=function(e){return MZ(this.getUrlComponent(e),e)};Wt.prototype.appendForwardSlash=function(){this._url=AZ(this._url)};Wt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Wt.fetchArrayBuffer=function(e){return new Wt(e).fetchArrayBuffer()};Wt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Wt.fetchBlob=function(e){return new Wt(e).fetchBlob()};Wt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(fY(this.request),!Hee||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return mY({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return Wt.supportsImageBitmapOptions().then(function(d){return s=d,a=s&&t,r}).then(function(d){if(!l(d))return;if(u=d,a)return Wt.createImageBitmapFromBlob(d,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(d);return c=new Wt({url:m}),mY({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(l(d))return d.blob=u,a||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return l(c)&&window.URL.revokeObjectURL(c.url),d.blob=u,Promise.reject(d)})};function mY(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=ca();return Wt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=fc.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,mY({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Wt.fetchImage=function(e){return new Wt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Wt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Wt.fetchText=function(e){return new Wt(e).fetchText()};Wt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Wt.fetchJson=function(e){return new Wt(e).fetchJson()};Wt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Wt.fetchXML=function(e){return new Wt(e).fetchXML()};Wt.prototype.fetchJsonp=function(e){e=y(e,"callback"),fY(this.request);let t;do t=`loadJsonp${X.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Jee(this,e,t)};function Jee(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=ca();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Wt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=fc.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,Jee(e,t,n)):Promise.reject(a)})})}Wt.fetchJsonp=function(e){return new Wt(e).fetchJsonp(e.callbackParameterName)};Wt.prototype._makeRequest=function(e){let t=this;fY(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=ft(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,d=ca(),m=Wt._Implementations.loadWithXhr(i,r,c,u,s,d,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),d.promise};let o=fc.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 fY(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new ue("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var RRe=/^data:(.*?)(;base64)?,(.*)$/;function HN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Kee(e,t){let n=HN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((u,d)=>{c[d]=u}),r.reject(new rh(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 rh)})}var WRe=typeof XMLHttpRequest>"u";Wt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=RRe.exec(e);if(a!==null){r.resolve(GRe(a,t));return}if(WRe){ERe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(LC.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new rh(c.status,c.response,c.getAllResponseHeaders()));return}let d=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let b=c.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};b.forEach(function(x){let _=x.split(": "),C=_.shift();h[C]=_.join(": ")}),r.resolve(h);return}if(c.status===204)r.resolve(void 0);else if(l(d)&&(!l(t)||m===t))r.resolve(d);else if(t==="json"&&typeof d=="string")try{r.resolve(JSON.parse(d))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ue("Invalid XMLHttpRequest response type."))},c.onerror=function(d){r.reject(new rh)},c.send(i),c};Wt._Implementations.loadAndExecuteScript=function(e,t,n){return Rx(e,t).catch(function(i){n.reject(i)})};Wt._DefaultImplementations={};Wt._DefaultImplementations.createImage=Wt._Implementations.createImage;Wt._DefaultImplementations.loadWithXhr=Wt._Implementations.loadWithXhr;Wt._DefaultImplementations.loadAndExecuteScript=Wt._Implementations.loadAndExecuteScript;Wt.DEFAULT=Object.freeze(new Wt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var We=Wt;function OZ(e){e=y(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=y(e.addNewLeapSeconds,!0),l(e.data)?Qee(this,e.data):Qee(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}OZ.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=We.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ue(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new OZ({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};OZ.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 Q0(0,0,0,0,0),t}});OZ.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Q0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=ne.lessThanOrEquals(a,e),d=!l(c),m=d||ne.greaterThanOrEquals(c,e);if(u&&m)return o=i,!d&&c.equals(e)&&++o,r=o+1,qee(this,n,this._samples,e,o,r,t),t}let s=wo(n,e,ne.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return jee(e,n,o,a,s),s;if(i.equals(u))return jee(e,n,r,a,s),s;let d=ne.secondsDifference(i,c)/ne.secondsDifference(u,c),m=o*a,p=r*a,b=n[m+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],x=h-b;if(x>.5||x<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(u.equals(i)?b=h:h-=C-_)}return s.xPoleWander=BZ(d,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=BZ(d,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=BZ(d,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=BZ(d,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=BZ(d,b,h),s}var YZ=OZ;var tvt=S(T(),1);function hc(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}hc.fromQuaternion=function(e,t){l(t)||(t=new hc);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};hc.fromDegrees=function(e,t,n,i){return l(i)||(i=new hc),i.heading=e*X.RADIANS_PER_DEGREE,i.pitch=t*X.RADIANS_PER_DEGREE,i.roll=n*X.RADIANS_PER_DEGREE,i};hc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new hc(e.heading,e.pitch,e.roll)};hc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};hc.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)};hc.prototype.clone=function(e){return hc.clone(this,e)};hc.prototype.equals=function(e){return hc.equals(this,e)};hc.prototype.equalsEpsilon=function(e,t,n){return hc.equalsEpsilon(this,e,t,n)};hc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var pc=hc;var yvt=S(T(),1);var svt=S(T(),1);var $ee={};var ete=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function XRe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(QN)||(QN=document.createElement("a")),QN.href=e,QN.href)}var Ix;function nte(){if(l(Ix))return Ix;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l($ee?.url)?e=Su(".",$ee.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(XN.toUrl)?e=Su("..",Xx("Core/buildModuleUrl.js")):e=XRe(),Ix=new We({url:tte(e)}),Ix.appendForwardSlash(),Ix}function PRe(e){return tte(XN.toUrl(`../${e}`))}function ite(e){return nte().getDerivedResource({url:e}).url}var jN;function Xx(e){return l(jN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(XN.toUrl)?jN=PRe:jN=ite),jN(e)}Xx._cesiumScriptRegex=ete;Xx._buildModuleUrlFromBaseUrl=ite;Xx._clearBaseResource=function(){Ix=void 0};Xx.setBaseUrl=function(e){Ix=We.DEFAULT.getDerivedResource({url:e})};Xx.getCesiumBaseUrl=nte;var an=Xx;var lvt=S(T(),1);function vRe(e,t,n){this.x=e,this.y=t,this.s=n}var Px=vRe;function bY(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=We.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ne(this._sampleZeroJulianEphemerisDate,0,Hn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(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 wRe=new ne(0,0,Hn.TAI);function hY(e,t,n){let i=wRe;return i.dayNumber=t,i.secondsOfDay=n,ne.daysDifference(i,e._sampleZeroDateTT)}bY.prototype.preload=function(e,t,n,i){let o=hY(this,e,t),r=hY(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,d=[];for(let m=c;m<=u;++m)d.push(pY(this,m));return Promise.all(d)};bY.prototype.computeXysRadians=function(e,t,n){let i=hY(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(pY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(pY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new Px(0,0,0);let d=i-s*this._stepSizeDays,m=this._work,p=this._denominators,b=this._coef,h=this._xTable,x,_;for(x=0;x<=r;++x)m[x]=d-h[x];for(x=0;x<=r;++x){for(b[x]=1,_=0;_<=r;++_)_!==x&&(b[x]*=m[_]);b[x]*=p[x];let C=(s+x)*3;n.x+=b[x]*u[C++],n.y+=b[x]*u[C++],n.s+=b[x]*u[C]}return n};function pY(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 We({url:an(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,d=a.length;ui&&(o=u,i=d)}let r=1,s=0,a=yY[o],c=xY[o];if(Math.abs(e[at.getElementIndex(c,a)])>n){let u=e[at.getElementIndex(c,c)],d=e[at.getElementIndex(a,a)],m=e[at.getElementIndex(c,a)],p=(u-d)/2/m,b;p<0?b=-1/(-p+Math.sqrt(1+p*p)):b=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+b*b),s=b*r}return t=at.clone(at.IDENTITY,t),t[at.getElementIndex(a,a)]=t[at.getElementIndex(c,c)]=r,t[at.getElementIndex(c,a)]=s,t[at.getElementIndex(a,c)]=-s,t}var qN=new at,rte=new at;at.computeEigenDecomposition=function(e,t){let n=X.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=at.clone(at.IDENTITY,t.unitary),a=t.diagonal=at.clone(e,t.diagonal),c=n*URe(a);for(;rc;)DRe(a,qN),at.transpose(qN,rte),at.multiply(a,qN,a),at.multiply(rte,a,a),at.multiply(s,qN,s),++o>2&&(++r,o=0);return t};at.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};at.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};at.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],d=e[8],m=at.determinant(e);t[0]=s*d-u*a,t[1]=u*o-i*d,t[2]=i*a-s*o,t[3]=c*a-r*d,t[4]=n*d-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/m;return at.multiplyByScalar(t,p,t)};var BRe=new at;at.inverseTranspose=function(e,t){return at.inverse(at.transpose(e,BRe),t)};at.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]};at.equalsEpsilon=function(e,t,n){return n=y(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};at.IDENTITY=Object.freeze(new at(1,0,0,0,1,0,0,0,1));at.ZERO=Object.freeze(new at(0,0,0,0,0,0,0,0,0));at.COLUMN0ROW0=0;at.COLUMN0ROW1=1;at.COLUMN0ROW2=2;at.COLUMN1ROW0=3;at.COLUMN1ROW1=4;at.COLUMN1ROW2=5;at.COLUMN2ROW0=6;at.COLUMN2ROW1=7;at.COLUMN2ROW2=8;Object.defineProperties(at.prototype,{length:{get:function(){return at.packedLength}}});at.prototype.clone=function(e){return at.clone(this,e)};at.prototype.equals=function(e){return at.equals(this,e)};at.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]};at.prototype.equalsEpsilon=function(e,t){return at.equalsEpsilon(this,e,t)};at.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) -(${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var $=at;var Pvt=S(T(),1);function rt(e,t,n,i,o,r,s,a,c,u,d,m,p,b,h,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(b,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(d,0),this[11]=y(h,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(m,0),this[15]=y(x,0)}rt.packedLength=16;rt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};rt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new rt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};rt.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o{let t=new Image;t.onload=function(){qc._result=t.width>0&&t.height>0,e(qc._result)},t.onerror=function(){qc._result=!1,e(qc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),qc._promise};Object.defineProperties(qc,{initialized:{get:function(){return l(qc._result)}}});var EC=[];typeof ArrayBuffer<"u"&&(EC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&EC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&EC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&EC.push(BigInt64Array),typeof BigUint64Array<"u"&&EC.push(BigUint64Array));var Cd={isChrome:ZY,chromeVersion:$Re,isSafari:lte,safariVersion:eGe,isWebkit:ute,webkitVersion:tGe,isInternetExplorer:dte,internetExplorerVersion:nGe,isEdge:r5,edgeVersion:iGe,isFirefox:s5,firefoxVersion:sGe,isWindows:oGe,isIPadOrIOS:rGe,hardwareConcurrency:y(bc.hardwareConcurrency,3),supportsPointerEvents:aGe,supportsImageRenderingPixelated:hte,supportsWebP:qc,imageRenderingValue:cGe,typedArrayTypes:EC};Cd.supportsBasis=function(e){return Cd.supportsWebAssembly()&&e.context.supportsBasis};Cd.supportsFullscreen=function(){return _r.supportsFullscreen()};Cd.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Cd.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Cd.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Cd.supportsBigInt=function(){return typeof BigInt<"u"};Cd.supportsWebWorkers=function(){return typeof Worker<"u"};Cd.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Cd.supportsWebgl2=function(e){return e.context.webgl2};Cd.supportsEsmWebWorkers=function(){return!s5()||parseInt(RY)>=114};var At=Cd;function ct(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var JZ=new f;ct.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);JZ=f.normalize(e,JZ);let r=JZ.x*o,s=JZ.y*o,a=JZ.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new ct(r,s,a,c)};var lGe=[1,2,0],uGe=new Array(3);ct.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],d=a+c+u;if(d>0)n=Math.sqrt(d+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 m=lGe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let b=m[p],h=m[b];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(b,b)]-e[$.getElementIndex(h,h)]+1);let x=uGe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(h,b)]-e[$.getElementIndex(b,h)])*n,x[b]=(e[$.getElementIndex(b,p)]+e[$.getElementIndex(p,b)])*n,x[h]=(e[$.getElementIndex(h,p)]+e[$.getElementIndex(p,h)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ct(i,o,r,s)};var pte=new ct,bte=new ct,GY=new ct,gte=new ct;ct.fromHeadingPitchRoll=function(e,t){return gte=ct.fromAxisAngle(f.UNIT_X,e.roll,pte),GY=ct.fromAxisAngle(f.UNIT_Y,-e.pitch,t),t=ct.multiply(GY,gte,GY),bte=ct.fromAxisAngle(f.UNIT_Z,-e.heading,pte),ct.multiply(bte,t,t)};var a5=new f,EY=new f,Fm=new ct,yte=new ct,c5=new ct;ct.packedLength=4;ct.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ct.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ct),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ct.packedInterpolationLength=3;ct.convertPackedArrayForInterpolation=function(e,t,n,i){ct.unpack(e,n*4,c5),ct.conjugate(c5,c5);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let b=7;b>=0;--b)Ip[b]=(l5[b]*c-u5[b])*s,Xp[b]=(l5[b]*u-u5[b])*s;let d=r*n*(1+Ip[0]*(1+Ip[1]*(1+Ip[2]*(1+Ip[3]*(1+Ip[4]*(1+Ip[5]*(1+Ip[6]*(1+Ip[7])))))))),m=a*(1+Xp[0]*(1+Xp[1]*(1+Xp[2]*(1+Xp[3]*(1+Xp[4]*(1+Xp[5]*(1+Xp[6]*(1+Xp[7])))))))),p=ct.multiplyByScalar(e,m,fGe);return ct.multiplyByScalar(t,d,i),ct.add(p,i,i)};ct.fastSquad=function(e,t,n,i,o,r){let s=ct.fastSlerp(e,t,o,QZ),a=ct.fastSlerp(n,i,o,WC);return ct.fastSlerp(s,a,2*o*(1-o),r)};ct.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ct.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ct.ZERO=Object.freeze(new ct(0,0,0,0));ct.IDENTITY=Object.freeze(new ct(0,0,0,1));ct.prototype.clone=function(e){return ct.clone(this,e)};ct.prototype.equals=function(e){return ct.equals(this,e)};ct.prototype.equalsEpsilon=function(e,t){return ct.equalsEpsilon(this,e,t)};ct.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Pe=ct;var ji={},PY={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"}},IC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},vY={},Fl={east:new f,north:new f,up:new f,west:new f,south:new f,down:new f},eg=new f,tg=new f,ng=new f;ji.localFrameToFixedFrameGenerator=function(e,t){if(!PY.hasOwnProperty(e)||!PY[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=PY[e][t],i,o=e+t;return l(vY[o])?i=vY[o]:(i=function(r,s,a){if(l(a)||(a=new v),f.equalsEpsilon(r,f.ZERO,X.EPSILON14))f.unpack(IC[e],0,eg),f.unpack(IC[t],0,tg),f.unpack(IC[n],0,ng);else if(X.equalsEpsilon(r.x,0,X.EPSILON14)&&X.equalsEpsilon(r.y,0,X.EPSILON14)){let c=X.sign(r.z);f.unpack(IC[e],0,eg),e!=="east"&&e!=="west"&&f.multiplyByScalar(eg,c,eg),f.unpack(IC[t],0,tg),t!=="east"&&t!=="west"&&f.multiplyByScalar(tg,c,tg),f.unpack(IC[n],0,ng),n!=="east"&&n!=="west"&&f.multiplyByScalar(ng,c,ng)}else{s=y(s,ie.default),s.geodeticSurfaceNormal(r,Fl.up);let c=Fl.up,u=Fl.east;u.x=-r.y,u.y=r.x,u.z=0,f.normalize(u,Fl.east),f.cross(c,u,Fl.north),f.multiplyByScalar(Fl.up,-1,Fl.down),f.multiplyByScalar(Fl.east,-1,Fl.west),f.multiplyByScalar(Fl.north,-1,Fl.south),eg=Fl[e],tg=Fl[t],ng=Fl[n]}return a[0]=eg.x,a[1]=eg.y,a[2]=eg.z,a[3]=0,a[4]=tg.x,a[5]=tg.y,a[6]=tg.z,a[7]=0,a[8]=ng.x,a[9]=ng.y,a[10]=ng.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},vY[o]=i),i};ji.eastNorthUpToFixedFrame=ji.localFrameToFixedFrameGenerator("east","north");ji.northEastDownToFixedFrame=ji.localFrameToFixedFrameGenerator("north","east");ji.northUpEastToFixedFrame=ji.localFrameToFixedFrameGenerator("north","up");ji.northWestUpToFixedFrame=ji.localFrameToFixedFrameGenerator("north","west");var hGe=new Pe,pGe=new f(1,1,1),bGe=new v;ji.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ji.eastNorthUpToFixedFrame);let r=Pe.fromHeadingPitchRoll(t,hGe),s=v.fromTranslationQuaternionRotationScale(f.ZERO,r,pGe,bGe);return o=i(e,n,o),v.multiply(o,s,o)};var gGe=new v,yGe=new $;ji.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ji.headingPitchRollToFixedFrame(e,t,n,i,gGe),s=v.getMatrix3(r,yGe);return Pe.fromRotationMatrix(s,o)};var xGe=new f(1,1,1),_Ge=new f,Ste=new v,SGe=new v,TGe=new $,CGe=new Pe;ji.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ie.default),n=y(n,ji.eastNorthUpToFixedFrame),l(i)||(i=new pc);let o=v.getTranslation(e,_Ge);if(f.equals(o,f.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=v.inverseTransformation(n(o,t,Ste),Ste),s=v.setScale(e,xGe,SGe);s=v.setTranslation(s,f.ZERO,s),r=v.multiply(r,s,r);let a=Pe.fromRotationMatrix(v.getMatrix3(r,TGe),CGe);return a=Pe.normalize(a,a),pc.fromQuaternion(a,i)};var VGe=6*3600+41*60+50.54841,LGe=8640184812866e-6,ZGe=.093104,RGe=-62e-7,GGe=11772758384668e-32,EGe=72921158553e-15,WGe=X.TWO_PI/86400,d5=new ne;ji.computeTemeToPseudoFixedMatrix=function(e,t){d5=ne.addSeconds(e,-ne.computeTaiMinusUtc(e),d5);let n=d5.dayNumber,i=d5.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Qn.DAYS_PER_JULIAN_CENTURY;let a=(VGe+o*(LGe+o*(ZGe+o*RGe)))*WGe%X.TWO_PI,c=EGe+GGe*(n-24515455e-1),u=(i+Qn.SECONDS_PER_DAY*.5)%Qn.SECONDS_PER_DAY,d=a+c*u,m=Math.cos(d),p=Math.sin(d);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(m,p,0,-p,m,0,0,0,1)};ji.iau2006XysData=new KZ;ji.earthOrientationParameters=YZ.NONE;var AY=32.184,IGe=2451545;ji.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+AY,i=e.stop.dayNumber,o=e.stop.secondsOfDay+AY;return ji.iau2006XysData.preload(t,n,i,o)};ji.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ji.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var XGe=new Px(0,0,0),PGe=new Q0(0,0,0,0,0,0),wY=new $,FY=new $;ji.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ji.earthOrientationParameters.compute(e,PGe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+AY,r=ji.iau2006XysData.computeXysRadians(i,o,XGe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=wY;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let d=$.fromRotationZ(-r.s,FY),m=$.multiply(u,d,wY),p=e.dayNumber,b=e.secondsOfDay-ne.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,x=b/Qn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(h+x);_=_%1*X.TWO_PI;let C=$.fromRotationZ(_,FY),V=$.multiply(m,C,wY),L=Math.cos(n.xPoleWander),R=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),w=i-IGe+o/Qn.SECONDS_PER_DAY;w/=36525;let P=-47e-6*w*X.RADIANS_PER_DEGREE/3600,F=Math.cos(P),M=Math.sin(P),g=FY;return g[0]=L*F,g[1]=L*M,g[2]=G,g[3]=-R*M+W*G*F,g[4]=R*F+W*G*M,g[5]=-W*L,g[6]=-W*M-R*G*F,g[7]=W*F-R*G*M,g[8]=R*L,$.multiply(V,g,t)};var vGe=new re;ji.pointToWindowCoordinates=function(e,t,n,i){return i=ji.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ji.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new B);let o=vGe;return v.multiplyByVector(e,re.fromElements(n.x,n.y,n.z,1,o),o),re.multiplyByScalar(o,1/o.w,o),v.multiplyByVector(t,o,o),B.fromCartesian4(o,i)};var wGe=new f,FGe=new f,AGe=new f;ji.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ie.default).geodeticSurfaceNormal(e,wGe),r=f.cross(t,o,FGe);f.equalsEpsilon(r,f.ZERO,X.EPSILON6)&&(r=f.clone(f.UNIT_X,r));let s=f.cross(r,t,AGe);return f.normalize(s,s),f.cross(t,s,r),f.negate(r,r),f.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 Tte=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Cte=new fe,MY=new f,MGe=new f,NGe=new $,NY=new v,Vte=new v;ji.basisTo2D=function(e,t,n){let i=v.getTranslation(t,MGe),o=e.ellipsoid,r;if(f.equals(i,f.ZERO))r=f.clone(f.ZERO,MY);else{let d=o.cartesianToCartographic(i,Cte);r=e.project(d,MY),f.fromElements(r.z,r.x,r.y,r)}let s=ji.eastNorthUpToFixedFrame(i,o,NY),a=v.inverseTransformation(s,Vte),c=v.getMatrix3(t,NGe),u=v.multiplyByMatrix3(a,c,n);return v.multiply(Tte,u,n),v.setTranslation(n,r,n),n};ji.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ji.eastNorthUpToFixedFrame(t,i,NY),r=v.inverseTransformation(o,Vte),s=i.cartesianToCartographic(t,Cte),a=e.project(s,MY);f.fromElements(a.z,a.x,a.y,a);let c=v.fromTranslation(a,NY);return v.multiply(Tte,r,n),v.multiply(c,n,n),n};var Vt=ji;function Xn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Xn.prototype,{width:{get:function(){return Xn.computeWidth(this)}},height:{get:function(){return Xn.computeHeight(this)}}});Xn.packedLength=4;Xn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Xn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Xn.computeWidth=function(e){let t=e.east,n=e.west;return t=0?d.longitude:d.longitude+X.TWO_PI;o=Math.min(o,m),r=Math.max(r,m)}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 Xn(n,s,i,a)};Xn.fromCartesianArray=function(e,t,n){t=y(t,ie.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,d=e.length;u=0?m.longitude:m.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 Xn(i,a,o,c)};var UGe=new f,kGe=new f,DGe=new f,BGe=new f,OGe=new f,UY=new Array(5);for(let e=0;e0?i+=X.TWO_PI:r0&&(r+=X.TWO_PI),i=d))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=d,n):new Xn(a,u,c,d)};Xn.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 Xn(i,o,r,s)};Xn.union=function(e,t,n){l(n)||(n=new Xn);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=X.TWO_PI:r0&&(r+=X.TWO_PI),io||X.equalsEpsilon(n,o,X.EPSILON14))&&(n=e.south&&i<=e.north};var YGe=new fe;Xn.subsample=function(e,t,n,i){t=y(t,ie.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=YGe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*X.PI_OVER_TWO,Xn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Xn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Xn),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};Xn.MAX_VALUE=Object.freeze(new Xn(-Math.PI,-X.PI_OVER_TWO,Math.PI,X.PI_OVER_TWO));var le=Xn;function Xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Xr.packedLength=4;Xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Xr.fromPoints=function(e,t){if(l(t)||(t=new Xr),!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;an.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};Xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?Ot.OUTSIDE:Ot.INTERSECTING};Xr.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};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.intersect=function(e){return Xr.intersect(this,e)};Xr.prototype.equals=function(e){return Xr.equals(this,e)};var Je=Xr;var Dwt=S(T(),1);function kY(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=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(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(y(e,255)),t=se.byteToFloat(y(t,255)),n=se.byteToFloat(y(n,255)),i=se.byteToFloat(y(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 DY,BY,Pp;At.supportsTypedArrays()&&(DY=new ArrayBuffer(4),BY=new Uint32Array(DY),Pp=new Uint8Array(DY));se.fromRgba=function(e,t){return BY[0]=e,se.fromBytes(Pp[0],Pp[1],Pp[2],Pp[3],t)};se.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=kY(u,c,e+1/3),s=kY(u,c,e),a=kY(u,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=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+X.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+X.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+X.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(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 HGe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,JGe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,QGe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,jGe=/^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=HGe.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(y(i[4],"f"),16)/15,t):(i=JGe.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(y(i[4],"ff"),16)/255,t):(i=QGe.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(y(i[4],"1.0")),t):(i=jGe.exec(e),i!==null?se.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};se.packedLength=4;se.pack=function(e,t,n){return n=y(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=y(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 Pp[0]=se.floatToByte(this.red),Pp[1]=se.floatToByte(this.green),Pp[2]=se.floatToByte(this.blue),Pp[3]=se.floatToByte(this.alpha),BY[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 Y=se;var Ywt=S(T(),1);function qGe(){return!0}function $Ge(e,t){t=y(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=qGe}var de=$Ge;var Jwt=S(T(),1);function Cu(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Cu.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}}});Cu.packedLength=2;Cu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Cu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Cu),n.near=e[t++],n.far=e[t],n};Cu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Cu.clone=function(e,t){if(l(e))return l(t)||(t=new Cu),t.near=e.near,t.far=e.far,t};Cu.prototype.clone=function(e){return Cu.clone(this,e)};Cu.prototype.equals=function(e){return Cu.equals(this,e)};var It=Cu;var $wt=S(T(),1);function Vd(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Vd.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 Vd(e.near,e.nearValue,e.far,e.farValue)};Vd.packedLength=4;Vd.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Vd.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Vd),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Vd.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};Vd.prototype.clone=function(e){return Vd.clone(this,e)};Vd.prototype.equals=function(e){return Vd.equals(this,e)};var Dt=Vd;var tFt=S(T(),1),wx={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},je=Object.freeze(wx);function Ld(e){return e===wx.CLAMP_TO_GROUND||e===wx.CLAMP_TO_3D_TILE||e===wx.CLAMP_TO_TERRAIN}function XC(e){return e===wx.RELATIVE_TO_GROUND||e===wx.RELATIVE_TO_3D_TILE||e===wx.RELATIVE_TO_TERRAIN}var iFt=S(T(),1),eEe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(eEe);var rFt=S(T(),1),tEe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},wn=Object.freeze(tEe);var aFt=S(T(),1),nEe={DONE:0,PENDING:1,FAILED:2},ht=Object.freeze(nEe);var mFt=S(T(),1);function Am(){he.throwInstantiationError()}Object.defineProperties(Am.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});Am.prototype.getValue=he.throwInstantiationError;Am.prototype.equals=he.throwInstantiationError;Am.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Am.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-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Zte(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 Zte(r)):(OY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],OY(s.get(r.id),r,a),s.remove(r.id)};function OY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var jZ=ig;var $on=S(T(),1);var HAt=S(T(),1);var YFt=S(T(),1);var IFt=S(T(),1);function TEe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Fa=TEe;function gn(e,t){this.center=f.clone(y(e,f.ZERO)),this.radius=y(t,0)}var zY=new f,HY=new f,JY=new f,QY=new f,jY=new f,qY=new f,$Y=new f,la=new f,eK=new f,tK=new f,nK=new f,iK=new f,CEe=4/3*X.PI;gn.fromPoints=function(e,t){if(l(t)||(t=new gn),!l(e)||e.length===0)return t.center=f.clone(f.ZERO,t.center),t.radius=0,t;let n=f.clone(e[0],$Y),i=f.clone(n,zY),o=f.clone(n,HY),r=f.clone(n,JY),s=f.clone(n,QY),a=f.clone(n,jY),c=f.clone(n,qY),u=e.length,d;for(d=1;ds.x&&f.clone(n,s),Fa.y&&f.clone(n,a),Mc.z&&f.clone(n,c)}let m=f.magnitudeSquared(f.subtract(s,i,la)),p=f.magnitudeSquared(f.subtract(a,o,la)),b=f.magnitudeSquared(f.subtract(c,r,la)),h=i,x=s,_=m;p>_&&(_=p,h=o,x=a),b>_&&(_=b,h=r,x=c);let C=eK;C.x=(h.x+x.x)*.5,C.y=(h.y+x.y)*.5,C.z=(h.z+x.z)*.5;let V=f.magnitudeSquared(f.subtract(x,C,la)),L=Math.sqrt(V),R=tK;R.x=i.x,R.y=o.y,R.z=r.z;let G=nK;G.x=s.x,G.y=a.y,G.z=c.z;let W=f.midpoint(R,G,iK),w=0;for(d=0;dw&&(w=P);let F=f.magnitudeSquared(f.subtract(n,C,la));if(F>V){let M=Math.sqrt(F);L=(L+M)*.5,V=L*L;let g=M-L;C.x=(L*C.x+g*n.x)/M,C.y=(L*C.y+g*n.y)/M,C.z=(L*C.z+g*n.z)/M}}return Lc.x&&f.clone(o,c),gu.y&&f.clone(o,u),Zd.z&&f.clone(o,d)}let b=f.magnitudeSquared(f.subtract(c,r,la)),h=f.magnitudeSquared(f.subtract(u,s,la)),x=f.magnitudeSquared(f.subtract(d,a,la)),_=r,C=c,V=b;h>V&&(V=h,_=s,C=u),x>V&&(V=x,_=a,C=d);let L=eK;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let R=f.magnitudeSquared(f.subtract(C,L,la)),G=Math.sqrt(R),W=tK;W.x=r.x,W.y=s.y,W.z=a.z;let w=nK;w.x=c.x,w.y=u.y,w.z=d.z;let P=f.midpoint(W,w,iK),F=0;for(p=0;pF&&(F=M);let g=f.magnitudeSquared(f.subtract(o,L,la));if(g>R){let Z=Math.sqrt(g);G=(G+Z)*.5,R=G*G;let E=Z-G;L.x=(G*L.x+E*o.x)/Z,L.y=(G*L.y+E*o.y)/Z,L.z=(G*L.z+E*o.z)/Z}}return Ga.x&&f.clone(i,a),Mc.y&&f.clone(i,c),gu.z&&f.clone(i,u)}let p=f.magnitudeSquared(f.subtract(a,o,la)),b=f.magnitudeSquared(f.subtract(c,r,la)),h=f.magnitudeSquared(f.subtract(u,s,la)),x=o,_=a,C=p;b>C&&(C=b,x=r,_=c),h>C&&(C=h,x=s,_=u);let V=eK;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=f.magnitudeSquared(f.subtract(_,V,la)),R=Math.sqrt(L),G=tK;G.x=o.x,G.y=r.y,G.z=s.z;let W=nK;W.x=a.x,W.y=c.y,W.z=u.z;let w=f.midpoint(G,W,iK),P=0;for(m=0;mP&&(P=F);let M=f.magnitudeSquared(f.subtract(i,V,la));if(M>L){let g=Math.sqrt(M);R=(R+g)*.5,L=R*R;let Z=g-R;V.x=(R*V.x+Z*i.x)/g,V.y=(R*V.y+Z*i.y)/g,V.z=(R*V.z+Z*i.z)/g}}return R=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,d=f.multiplyByScalar(a,(-o+u)/c,vEe);return f.add(d,i,d),f.clone(d,n.center),n.radius=u,n};var wEe=new f;gn.expand=function(e,t,n){n=gn.clone(e,n);let i=f.magnitude(f.subtract(t,n.center,wEe));return i>n.radius&&(n.radius=i),n};gn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=f.dot(o,n)+t.distance;return r<-i?Ot.OUTSIDE:r{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),ua._canTransferArrayBuffer=s}})}return ua._canTransferArrayBuffer}var aK=new be;function sK(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 cK(e){let t=new Bte.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(q0(e))s=e;else if(!n){let a=an(`${ua._workerModulePrefix}/${i}.js`);q0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=sK(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${sK(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return r=sK(a),new Worker(r,o)}if(r=e,n||(r=an(`${ua._workerModulePrefix+i}.js`)),!At.supportsEsmWebWorkers())throw new ue("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function gWe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!At.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ue(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=an(t.fallbackModulePath),n}n.wasmBinaryFile=an(t.wasmBinaryFile);let i=await We.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function ua(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var yWe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ue(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),aK.raiseEvent(s),i(s)}else aK.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},xWe=[];async function _We(e,t,n){let i=await Promise.resolve(Ote());l(n)?i||(n.length=0):n=xWe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",yWe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:an.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function SWe(e,t,n){++e._activeTasks;try{let i=await _We(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ua.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=cK(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return SWe(this,e,t)};ua.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=cK(this._workerPath),i=await gWe(this,e),o=await Promise.resolve(Ote()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:d}){l(d)?c(d.result):u(new ue("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};ua.prototype.isDestroyed=function(){return!1};ua.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),de(this)};ua.taskCompletedEvent=aK;ua._defaultWorkerModulePrefix="Workers/";ua._workerModulePrefix=ua._defaultWorkerModulePrefix;ua._canTransferArrayBuffer=void 0;var di=ua;function vp(){}vp._transcodeTaskProcessor=new di("transcodeKTX2",Number.POSITIVE_INFINITY);vp._readyPromise=void 0;function TWe(){let e=vp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return vp._transcodeTaskProcessor;throw new ue("KTX2 transcoder could not be initialized.")});vp._readyPromise=e}vp.transcode=function(e,t){return l(vp._readyPromise)||TWe(),vp._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;s maxHeight) { -material.diffuse = vec3(0.0); -material.alpha = 0.0; -return material; -} -int idxBelow = 0; -int idxAbove = heightsDimensions.x; -float heightBelow = minHeight; -float heightAbove = maxHeight; -const int maxIterations = 16; -for (int i = 0; i < maxIterations; i++) { -if (idxBelow >= idxAbove - 1) { -break; -} -int idxMid = (idxBelow + idxAbove) / 2; -float heightTex = getHeight(idxMid, invTexSize); -if (height > heightTex) { -idxBelow = idxMid; -heightBelow = heightTex; -} else { -idxAbove = idxMid; -heightAbove = heightTex; -} -} -float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); -vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); -vec4 color = texture(colors, colorUv); -if (color.a > 0.0) -{ -color.rgb /= color.a; -} -color.rgb = czm_gammaCorrect(color.rgb); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; -} -`;var u5t=S(T(),1),pR=`uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float distanceToContour = mod(materialInput.height, spacing); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float dxc = abs(dFdx(materialInput.height)); -float dyc = abs(dFdy(materialInput.height)); -float dF = max(dxc, dyc) * czm_pixelRatio * width; -float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else -float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif -vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; -} -`;var m5t=S(T(),1),bR=`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 h5t=S(T(),1),gR=`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 b5t=S(T(),1),yR=`uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 st = materialInput.st; -float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); -scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); -float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); -scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); -float value; -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -const float fuzz = 1.2; -vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; -vec2 dx = abs(dFdx(st)); -vec2 dy = abs(dFdy(st)); -vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; -value = min( -smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), -smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else -const float fuzz = 0.05; -vec2 range = 0.5 - (lineThickness * 0.05); -value = min( -1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), -1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif -float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); -float sRim = smoothstep(0.8, 1.0, dRim); -value *= (1.0 - sRim); -vec4 halfColor; -halfColor.rgb = color.rgb * 0.5; -halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); -halfColor = czm_gammaCorrect(halfColor); -material.diffuse = halfColor.rgb; -material.emission = halfColor.rgb; -material.alpha = halfColor.a; -return material; -} -`;var y5t=S(T(),1),xR=`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 _5t=S(T(),1),_R=`uniform vec4 color; -float getPointOnLine(vec2 p0, vec2 p1, float x) -{ -float slope = (p0.y - p1.y) / (p0.x - p1.x); -return slope * (x - p0.x) + p0.y; -} -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 st = materialInput.st; -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else -float base = 0.975; -#endif -vec2 center = vec2(1.0, 0.5); -float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); -float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); -float halfWidth = 0.15; -float s = step(0.5 - halfWidth, st.t); -s *= 1.0 - step(0.5 + halfWidth, st.t); -s *= 1.0 - step(base, st.s); -float t = step(base, materialInput.st.s); -t *= 1.0 - step(ptOnUpperLine, st.t); -t *= step(ptOnLowerLine, st.t); -float dist; -if (st.s < base) -{ -float d1 = abs(st.t - (0.5 - halfWidth)); -float d2 = abs(st.t - (0.5 + halfWidth)); -dist = min(d1, d2); -} -else -{ -float d1 = czm_infinity; -if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) -{ -d1 = abs(st.s - base); -} -float d2 = abs(st.t - ptOnUpperLine); -float d3 = abs(st.t - ptOnLowerLine); -dist = min(min(d1, d2), d3); -} -vec4 outsideColor = vec4(0.0); -vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); -vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); -outColor = czm_gammaCorrect(outColor); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; -} -`;var T5t=S(T(),1),SR=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; -const float maskLength = 16.0; -mat2 rotate(float rad) { -float c = cos(rad); -float s = sin(rad); -return mat2( -c, s, --s, c -); -} -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; -float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); -float maskIndex = floor(dashPosition * maskLength); -float maskTest = floor(dashPattern / pow(2.0, maskIndex)); -vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; -if (fragColor.a < 0.005) { -discard; -} -fragColor = czm_gammaCorrect(fragColor); -material.emission = fragColor.rgb; -material.alpha = fragColor.a; -return material; -} -`;var V5t=S(T(),1),TR=`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 Z5t=S(T(),1),CR=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 st = materialInput.st; -float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; -float b = step(0.5 - halfInteriorWidth, st.t); -b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); -float d1 = abs(st.t - (0.5 - halfInteriorWidth)); -float d2 = abs(st.t - (0.5 + halfInteriorWidth)); -float dist = min(d1, d2); -vec4 currentColor = mix(outlineColor, color, b); -vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); -outColor = czm_gammaCorrect(outColor); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; -} -`;var G5t=S(T(),1),VR=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); -float s = smoothstep(1.0 - width, 1.0, d); -vec4 outColor = czm_gammaCorrect(color); -vec4 outRimColor = czm_gammaCorrect(rimColor); -material.diffuse = outColor.rgb; -material.emission = outRimColor.rgb * s; -material.alpha = mix(outColor.a, outRimColor.a, s); -return material; -} -`;var W5t=S(T(),1),LR=`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 X5t=S(T(),1),ZR=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); -float value = fract((coord - offset) * (repeat * 0.5)); -float dist = min(value, min(abs(value - 0.5), 1.0 - value)); -vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); -vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); -color = czm_gammaCorrect(color); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; -} -`;var v5t=S(T(),1),RR=`uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float time = czm_frameNumber * animationSpeed; -float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); -float specularMapValue = texture(specularMap, materialInput.st).r; -vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); -vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); -normalTangentSpace.xy /= fade; -normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); -normalTangentSpace = normalize(normalTangentSpace); -float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); -material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; -material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); -material.diffuse += (0.1 * tsPerturbationRatio); -material.diffuse = material.diffuse; -material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); -material.specular = specularIntensity; -material.shininess = 10.0; -return material; -} -`;function Qe(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,Ft.LINEAR),this._magnificationFilter=y(e.magnificationFilter,ni.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,CWe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Qe._uniformList[this.type])||(Qe._uniformList[this.type]=Object.keys(this._uniforms))}Qe._uniformList={};Qe.fromType=function(e,t){let n=new Qe({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Qe.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-1)return!0;return!1}function EWe(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&&GWe(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 Hte={mat2:yi,mat3:$,mat4:v},WWe=/\.ktx2$/i;function IWe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Qe.DefaultImageId;t=r;let c=n._textures[e],u,d;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 Qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new bt({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 bt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=r._width,d.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,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=c._width,d.y=c._height)),a)return;let m=r instanceof We;if(!l(n._texturePaths[e])||m&&r.url!==n._texturePaths[e].url||!m&&r!==n._texturePaths[e]){if(typeof r=="string"||m){let p=m?r:We.createIfNeeded(r),b;WWe.test(p.url)?b=Ns(p.url):b=p.fetchImage(),Promise.resolve(b).then(function(h){n._loadedImages.push({id:e,image:h})}).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 XWe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof da){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===Qe.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[We.createIfNeeded(i.positiveX).fetchImage(),We.createIfNeeded(i.negativeX).fetchImage(),We.createIfNeeded(i.positiveY).fetchImage(),We.createIfNeeded(i.negativeY).fetchImage(),We.createIfNeeded(i.positiveZ).fetchImage(),We.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function PWe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Jte(e,n)}function Jte(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=vWe(o),s;if(r==="channels")s=GR(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;FWe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Jte(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=GR(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(IWe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(XWe(t));else if(r.indexOf("mat")!==-1){let u=new Hte[r];e._uniforms[c]=function(){return Hte[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function vWe(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 We||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Qe.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function wWe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Qe({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=ft(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;GR(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=GR(e,i,a)}}function GR(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,d){return u||d?c:(o+=1,n)}),o}function FWe(e,t,n){return GR(e,t,t,n)}Qe._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Qe.DefaultImageId="czm_defaultImage";Qe.DefaultCubeMapId="czm_defaultCubeMap";Qe.ColorType="Color";Qe._materialCache.addMaterial(Qe.ColorType,{fabric:{type:Qe.ColorType,uniforms:{color:new Y(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Qe.ImageType="Image";Qe._materialCache.addMaterial(Qe.ImageType,{fabric:{type:Qe.ImageType,uniforms:{image:Qe.DefaultImageId,repeat:new B(1,1),color:new Y(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Qe.DiffuseMapType="DiffuseMap";Qe._materialCache.addMaterial(Qe.DiffuseMapType,{fabric:{type:Qe.DiffuseMapType,uniforms:{image:Qe.DefaultImageId,channels:"rgb",repeat:new B(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Qe.AlphaMapType="AlphaMap";Qe._materialCache.addMaterial(Qe.AlphaMapType,{fabric:{type:Qe.AlphaMapType,uniforms:{image:Qe.DefaultImageId,channel:"a",repeat:new B(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Qe.SpecularMapType="SpecularMap";Qe._materialCache.addMaterial(Qe.SpecularMapType,{fabric:{type:Qe.SpecularMapType,uniforms:{image:Qe.DefaultImageId,channel:"r",repeat:new B(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Qe.EmissionMapType="EmissionMap";Qe._materialCache.addMaterial(Qe.EmissionMapType,{fabric:{type:Qe.EmissionMapType,uniforms:{image:Qe.DefaultImageId,channels:"rgb",repeat:new B(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Qe.BumpMapType="BumpMap";Qe._materialCache.addMaterial(Qe.BumpMapType,{fabric:{type:Qe.BumpMapType,uniforms:{image:Qe.DefaultImageId,channel:"r",strength:.8,repeat:new B(1,1)},source:dR},translucent:!1});Qe.NormalMapType="NormalMap";Qe._materialCache.addMaterial(Qe.NormalMapType,{fabric:{type:Qe.NormalMapType,uniforms:{image:Qe.DefaultImageId,channels:"rgb",strength:.8,repeat:new B(1,1)},source:xR},translucent:!1});Qe.GridType="Grid";Qe._materialCache.addMaterial(Qe.GridType,{fabric:{type:Qe.GridType,uniforms:{color:new Y(0,1,0,1),cellAlpha:.1,lineCount:new B(8,8),lineThickness:new B(1,1),lineOffset:new B(0,0)},source:yR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Qe.StripeType="Stripe";Qe._materialCache.addMaterial(Qe.StripeType,{fabric:{type:Qe.StripeType,uniforms:{horizontal:!0,evenColor:new Y(1,1,1,.5),oddColor:new Y(0,0,1,.5),offset:0,repeat:5},source:ZR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Qe.CheckerboardType="Checkerboard";Qe._materialCache.addMaterial(Qe.CheckerboardType,{fabric:{type:Qe.CheckerboardType,uniforms:{lightColor:new Y(1,1,1,.5),darkColor:new Y(0,0,0,.5),repeat:new B(5,5)},source:mR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Qe.DotType="Dot";Qe._materialCache.addMaterial(Qe.DotType,{fabric:{type:Qe.DotType,uniforms:{lightColor:new Y(1,1,0,.75),darkColor:new Y(0,1,1,.75),repeat:new B(5,5)},source:fR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Qe.WaterType="Water";Qe._materialCache.addMaterial(Qe.WaterType,{fabric:{type:Qe.WaterType,uniforms:{baseWaterColor:new Y(.2,.3,.6,1),blendColor:new Y(0,1,.699,1),specularMap:Qe.DefaultImageId,normalMap:Qe.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:RR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Qe.RimLightingType="RimLighting";Qe._materialCache.addMaterial(Qe.RimLightingType,{fabric:{type:Qe.RimLightingType,uniforms:{color:new Y(1,0,0,.7),rimColor:new Y(1,1,1,.4),width:.3},source:VR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Qe.FadeType="Fade";Qe._materialCache.addMaterial(Qe.FadeType,{fabric:{type:Qe.FadeType,uniforms:{fadeInColor:new Y(1,0,0,1),fadeOutColor:new Y(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new B(.5,.5)},source:gR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Qe.PolylineArrowType="PolylineArrow";Qe._materialCache.addMaterial(Qe.PolylineArrowType,{fabric:{type:Qe.PolylineArrowType,uniforms:{color:new Y(1,1,1,1)},source:_R},translucent:!0});Qe.PolylineDashType="PolylineDash";Qe._materialCache.addMaterial(Qe.PolylineDashType,{fabric:{type:Qe.PolylineDashType,uniforms:{color:new Y(1,0,1,1),gapColor:new Y(0,0,0,0),dashLength:16,dashPattern:255},source:SR},translucent:!0});Qe.PolylineGlowType="PolylineGlow";Qe._materialCache.addMaterial(Qe.PolylineGlowType,{fabric:{type:Qe.PolylineGlowType,uniforms:{color:new Y(0,.5,1,1),glowPower:.25,taperPower:1},source:TR},translucent:!0});Qe.PolylineOutlineType="PolylineOutline";Qe._materialCache.addMaterial(Qe.PolylineOutlineType,{fabric:{type:Qe.PolylineOutlineType,uniforms:{color:new Y(1,1,1,1),outlineColor:new Y(1,0,0,1),outlineWidth:1},source:CR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Qe.ElevationContourType="ElevationContour";Qe._materialCache.addMaterial(Qe.ElevationContourType,{fabric:{type:Qe.ElevationContourType,uniforms:{spacing:100,color:new Y(1,0,0,1),width:1},source:pR},translucent:!1});Qe.ElevationRampType="ElevationRamp";Qe._materialCache.addMaterial(Qe.ElevationRampType,{fabric:{type:Qe.ElevationRampType,uniforms:{image:Qe.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:bR},translucent:!1});Qe.SlopeRampMaterialType="SlopeRamp";Qe._materialCache.addMaterial(Qe.SlopeRampMaterialType,{fabric:{type:Qe.SlopeRampMaterialType,uniforms:{image:Qe.DefaultImageId},source:LR},translucent:!1});Qe.AspectRampMaterialType="AspectRamp";Qe._materialCache.addMaterial(Qe.AspectRampMaterialType,{fabric:{type:Qe.AspectRampMaterialType,uniforms:{image:Qe.DefaultImageId},source:uR},translucent:!1});Qe.ElevationBandType="ElevationBand";Qe._materialCache.addMaterial(Qe.ElevationBandType,{fabric:{type:Qe.ElevationBandType,uniforms:{heights:Qe.DefaultImageId,colors:Qe.DefaultImageId},source:hR},translucent:!0});var Yi=Qe;function Fx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Fx.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=oo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Fx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Fx.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;Fx.prototype.isTranslucent=oo.prototype.isTranslucent;Fx.prototype.getRenderState=oo.prototype.getRenderState;Fx.MaterialSupport={BASIC:Object.freeze({vertexFormat:we.POSITION_AND_NORMAL,vertexShaderSource:iR,fragmentShaderSource:nR}),TEXTURED:Object.freeze({vertexFormat:we.POSITION_NORMAL_AND_ST,vertexShaderSource:rR,fragmentShaderSource:oR}),ALL:Object.freeze({vertexFormat:we.ALL,vertexShaderSource:tR,fragmentShaderSource:eR})};var mo=Fx;var HUt=S(T(),1);var PUt=S(T(),1),ER=`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 wUt=S(T(),1),WR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var AUt=S(T(),1),Ax=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); -} -`;var NUt=S(T(),1),IR=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function wp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?IR:WR,r=i?Ax:ER,s=i?wp.FLAT_VERTEX_FORMAT:wp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=oo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(wp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});wp.VERTEX_FORMAT=we.POSITION_AND_NORMAL;wp.FLAT_VERTEX_FORMAT=we.POSITION_ONLY;wp.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;wp.prototype.isTranslucent=oo.prototype.isTranslucent;wp.prototype.getRenderState=oo.prototype.getRenderState;var fn=wp;var tkt=S(T(),1);function AC(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(AC.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});AC.prototype.getType=function(e){return"Color"};AC.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};AC.prototype.equals=function(e){return this===e||e instanceof AC&&J.equals(this._color,e._color)};var zt=AC;var D6t=S(T(),1);var T6t=S(T(),1);var Ckt=S(T(),1);var ukt=S(T(),1);function rg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ie.default),this._rectangle=y(e.rectangle,le.MAX_VALUE),this._projection=new Gi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(rg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});rg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(u=o-1);let d=(i.north-e.latitude)/a|0;return d>=r&&(d=r-1),l(n)?(n.x=u,n.y=d,n):new B(u,d)};var _i=rg;var Qte=new f,jte=new f,qte=new fe,uK=new f,AWe=new f,$te=new ae,MWe=new _i,XR=[new fe,new fe,new fe,new fe],PR=new B,$r={};$r.initialize=function(){let e=$r._initPromise;return l(e)||(e=We.fetchJson(an("Assets/approximateTerrainHeights.json")).then(function(t){$r._terrainHeights=t}),$r._initPromise=e),e};$r.getMinimumMaximumHeights=function(e,t){t=y(t,ie.default);let n=ene(e),i=$r._defaultMinTerrainHeight,o=$r._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=$r._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(le.northeast(e,qte),Qte),t.cartographicToCartesian(le.southwest(e,qte),jte),f.midpoint(jte,Qte,uK);let a=t.scaleToGeodeticSurface(uK,AWe);if(l(a)){let c=f.distance(uK,a);i=Math.min(i,-c)}else i=$r._defaultMinTerrainHeight}return i=Math.max($r._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};$r.getBoundingSphere=function(e,t){t=y(t,ie.default);let n=ene(e),i=$r._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=$r._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,$te),ae.union(o,$te,o)};function ene(e){fe.fromRadians(e.east,e.north,0,XR[0]),fe.fromRadians(e.west,e.north,0,XR[1]),fe.fromRadians(e.east,e.south,0,XR[2]),fe.fromRadians(e.west,e.south,0,XR[3]);let t=0,n=0,i=0,o=0,r=$r._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=XR[c];if(MWe.positionToTileXY(u,s,PR),c===0)i=PR.x,o=PR.y;else if(i!==PR.x||o!==PR.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}}$r._terrainHeightsMaxLevel=6;$r._defaultMaxTerrainHeight=9e3;$r._defaultMinTerrainHeight=-1e5;$r._terrainHeights=void 0;$r._initPromise=void 0;Object.defineProperties($r,{initialized:{get:function(){return l($r._terrainHeights)}}});var mi=$r;var UDt=S(T(),1);var CDt=S(T(),1);var Ekt=S(T(),1);function $c(e,t,n){this.minimum=f.clone(y(e,f.ZERO)),this.maximum=f.clone(y(t,f.ZERO)),l(n)?n=f.clone(n):n=f.midpoint(this.minimum,this.maximum,new f),this.center=n}$c.fromCorners=function(e,t,n){return l(n)||(n=new $c),n.minimum=f.clone(e,n.minimum),n.maximum=f.clone(t,n.maximum),n.center=f.midpoint(e,t,n.center),n};$c.fromPoints=function(e,t){if(l(t)||(t=new $c),!l(e)||e.length===0)return t.minimum=f.clone(f.ZERO,t.minimum),t.maximum=f.clone(f.ZERO,t.maximum),t.center=f.clone(f.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 m=1;m0?Ot.INSIDE:r+o<0?Ot.OUTSIDE:Ot.INTERSECTING};$c.prototype.clone=function(e){return $c.clone(this,e)};$c.prototype.intersectPlane=function(e){return $c.intersectPlane(this,e)};$c.prototype.equals=function(e){return $c.equals(this,e)};var sg=$c;var iDt=S(T(),1);var Xkt=S(T(),1);var dK={};dK.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function tne(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)))u&&u/c0?[a/e,n/a]:[n/a,a/e]};var el=dK;var Ukt=S(T(),1);var wkt=S(T(),1);var fK={};fK.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 mK(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,d=r*r,m=s*s,p=o*s-d,b=o*a-r*s,h=r*a-m,x=4*p*h-b*b,_,C;if(x<0){let j,K,te;d*u>=c*m?(j=o,K=p,te=-2*r*p+o*b):(j=a,K=h,te=-a*b+2*s*h);let q=-(te<0?-1:1)*Math.abs(j)*Math.sqrt(-x);C=-te+q;let ee=C/2,pe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),xe=C===q?-pe:-K/pe;return _=K<=0?pe+xe:-te/(pe*pe+xe*xe+K),d*u>=c*m?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*b,R=h,G=-a*b+2*s*h,W=Math.sqrt(x),w=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*W,-L)/3);_=2*Math.sqrt(-V);let F=Math.cos(P);C=_*F;let M=_*(-F/2-w*Math.sin(P)),g=C+M>2*r?C-r:M-r,Z=o,E=g/Z;P=Math.abs(Math.atan2(a*W,-G)/3),_=2*Math.sqrt(-R),F=Math.cos(P),C=_*F,M=_*(-F/2-w*Math.sin(P));let I=-a,A=C+M<2*s?C+s:M+s,N=I/A,D=Z*A,k=-g*A-Z*I,O=g*I,U=(s*k-r*O)/(-r*k+s*D);return E<=U?E<=N?U<=N?[E,U,N]:[E,N,U]:[N,E,U]:E<=N?[U,E,N]:U<=N?[U,N,E]:[N,U,E]}fK.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return el.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=el.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return mK(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):mK(e,t,0,i);if(i===0)return o=el.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 mK(e,t,n,i)};var Mx=fK;var hK={};hK.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,d=u*n,m=i*i,p=m*i,b=o*o,h=b*o;return a*u*m-4*c*p-4*e*d*m+18*e*t*n*p-27*r*m*m+256*s*h+o*(18*c*n*i-4*a*d+16*e*u*u-80*e*t*u*i-6*e*a*m+144*r*n*m)+b*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Um(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=Mx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,d=c[c.length-1];if(Math.abs(d)=0&&b>=0){let x=Math.sqrt(p),_=Math.sqrt(b);return[u-_,u-x,u+x,u+_]}else{if(p>=0&&b<0)return h=Math.sqrt(p),[u-h,u+h];if(p<0&&b>=0)return h=Math.sqrt(b),[u-h,u+h]}}return[]}else if(d>0){let m=Math.sqrt(d),p=(r+d-s/m)/2,b=(r+d+s/m)/2,h=el.computeRealRoots(1,m,p),x=el.computeRealRoots(1,-m,b);return h.length!==0?(h[0]+=u,h[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,h[1]<=x[0]?[h[0],h[1],x[0],x[1]]:x[1]<=h[0]?[x[0],x[1],h[0],h[1]]:h[0]>=x[0]&&h[1]<=x[1]?[x[0],h[0],h[1],x[1]]:x[0]>=h[0]&&x[1]<=h[1]?[h[0],x[0],x[1],h[1]]:h[0]>x[0]&&h[0]0){let m=d[0],p=t-m,b=p*p,h=e/2,x=p/2,_=b-4*i,C=b+4*Math.abs(i),V=s-4*m,L=s+4*Math.abs(m),R,G;if(m<0||_*L=g[0]&&M[1]<=g[1]?[g[0],M[0],M[1],g[1]]:g[0]>=M[0]&&g[1]<=M[1]?[M[0],g[0],g[1],M[1]]:M[0]>g[0]&&M[0]d)||(p=f.cross(m,a,ine),h=f.dot(s,p),h<0||b+h>d))return;x=f.dot(c,p)/d}else{if(Math.abs(d)1||(p=f.cross(m,a,ine),h=f.dot(s,p)*_,h<0||b+h>1))return;x=f.dot(c,p)*_}return x};Do.rayTriangle=function(e,t,n,i,o,r){let s=Do.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new f),f.multiplyByScalar(e.direction,s,r),f.add(e.origin,r,r)};var kWe=new yn;Do.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=kWe;f.clone(e,a.origin),f.subtract(t,e,a.direction),f.normalize(a.direction,a.direction);let c=Do.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>f.distance(e,t)))return l(s)||(s=new f),f.multiplyByScalar(a.direction,c,s),f.add(a.origin,s,s)};function DWe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var YWe=new f,KWe=new f;Do.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=f.multiplyComponents(n,e.origin,YWe),o=f.multiplyComponents(n,e.direction,KWe),r=f.magnitudeSquared(i),s=f.dot(i,o),a,c,u,d,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=f.magnitudeSquared(o),u=c*a,pu){d=s*s-u,m=-s+Math.sqrt(d);let h=m/c,x=a/m;return h0?b.push(new f(i,o*F,o*-Z)):Z!==0?(b.push(new f(i,o*F,o*-Z)),b.push(new f(i,o*F,o*Z)),++P):b.push(new f(i,o*F,o*Z))}return b};var pK=new f,one=new f,rne=new f,x5=new f,zWe=new f,HWe=new $,JWe=new $,QWe=new $,jWe=new $,qWe=new $,sne=new $,ane=new $,cne=new f,$We=new f,eIe=new fe;Do.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!f.equals(n,f.ZERO)){let W=t.geodeticSurfaceNormal(n,pK);if(f.dot(i,W)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,pK),s=f.normalize(r,r),a=f.mostOrthogonalAxis(r,x5),c=f.normalize(f.cross(a,s,one),one),u=f.normalize(f.cross(s,c,rne),rne),d=HWe;d[0]=s.x,d[1]=s.y,d[2]=s.z,d[3]=c.x,d[4]=c.y,d[5]=c.z,d[6]=u.x,d[7]=u.y,d[8]=u.z;let m=$.transpose(d,JWe),p=$.fromScale(t.radii,QWe),b=$.fromScale(t.oneOverRadii,jWe),h=qWe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let x=$.multiply($.multiply(m,b,sne),h,sne),_=$.multiply($.multiply(x,p,ane),d,ane),C=$.multiplyByVector(x,n,zWe),V=Do.quadraticVectorExpression(_,f.negate(C,pK),0,0,1),L,R,G=V.length;if(G>0){let W=f.clone(f.ZERO,$We),w=Number.NEGATIVE_INFINITY;for(let F=0;Fw&&(w=g,W=f.clone(L,W))}let P=t.cartesianToCartographic(W,eIe);return w=X.clamp(w,0,1),R=f.magnitude(f.subtract(W,n,x5))*Math.sqrt(1-w*w),R=o?-R:R,P.height=R,t.cartographicToCartesian(P,new f)}};var tIe=new f;Do.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new f);let o=f.subtract(t,e,tIe),r=n.normal,s=f.dot(r,o);if(Math.abs(s)1))return f.multiplyByScalar(o,c,i),f.add(e,i,i),i};Do.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=f.dot(o,e)+r<0,a=f.dot(o,t)+r<0,c=f.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let d,m;if((u===1||u===2)&&(d=new f,m=new f),u===1){if(s)return Do.lineSegmentPlane(e,t,i,d),Do.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,d,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Do.lineSegmentPlane(t,n,i,d),Do.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,d,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Do.lineSegmentPlane(n,e,i,d),Do.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,d,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Do.lineSegmentPlane(e,n,i,d),Do.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,d,m],indices:[0,1,4,0,4,3,2,3,4]}}else return Do.lineSegmentPlane(n,t,i,d),Do.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,d,m],indices:[2,0,4,2,4,3,1,3,4]};else return Do.lineSegmentPlane(t,e,i,d),Do.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,d,m],indices:[1,2,4,1,4,3,0,3,4]}};var ei=Do;var lDt=S(T(),1);function Us(e,t){this.normal=f.clone(e),this.distance=t}Us.fromPointNormal=function(e,t,n){let i=-f.dot(t,e);return l(n)?(f.clone(t,n.normal),n.distance=i,n):new Us(t,i)};var nIe=new f;Us.fromCartesian4=function(e,t){let n=f.fromCartesian4(e,nIe),i=e.w;return l(t)?(f.clone(n,t.normal),t.distance=i,t):new Us(n,i)};Us.getPointDistance=function(e,t){return f.dot(e.normal,t)+e.distance};var iIe=new f;Us.projectPointOntoPlane=function(e,t,n){l(n)||(n=new f);let i=Us.getPointDistance(e,t),o=f.multiplyByScalar(e.normal,i,iIe);return f.subtract(t,o,n)};var oIe=new v,rIe=new re,sIe=new f;Us.transform=function(e,t,n){let i=e.normal,o=e.distance,r=v.inverseTranspose(t,oIe),s=re.fromElements(i.x,i.y,i.z,o,rIe);s=v.multiplyByVector(r,s,s);let a=f.fromCartesian4(s,sIe);return s=re.divideByScalar(s,f.magnitude(a),s),Us.fromCartesian4(s,n)};Us.clone=function(e,t){return l(t)?(f.clone(e.normal,t.normal),t.distance=e.distance,t):new Us(e.normal,e.distance)};Us.equals=function(e,t){return e.distance===t.distance&&f.equals(e.normal,t.normal)};Us.ORIGIN_XY_PLANE=Object.freeze(new Us(f.UNIT_Z,0));Us.ORIGIN_YZ_PLANE=Object.freeze(new Us(f.UNIT_X,0));Us.ORIGIN_ZX_PLANE=Object.freeze(new Us(f.UNIT_Y,0));var on=Us;var bK=new re;function dh(e,t){t=y(t,ie.default),e=t.scaleToGeodeticSurface(e);let n=Vt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=f.fromCartesian4(v.getColumn(n,0,bK)),this._yAxis=f.fromCartesian4(v.getColumn(n,1,bK));let i=f.fromCartesian4(v.getColumn(n,2,bK));this._plane=on.fromPointNormal(e,i)}Object.defineProperties(dh.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 aIe=new sg;dh.fromPoints=function(e,t){let n=sg.fromPoints(e,aIe);return new dh(n.center,t)};var dne=new yn,_5=new f;dh.prototype.projectPointOntoPlane=function(e,t){let n=dne;n.origin=e,f.normalize(e,n.direction);let i=ei.rayPlane(n,this._plane,_5);if(l(i)||(f.negate(n.direction,n.direction),i=ei.rayPlane(n,this._plane,_5)),l(i)){let o=f.subtract(i,this._origin,i),r=f.dot(this._xAxis,o),s=f.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new B(r,s)}};dh.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:w.latitude,Z=fe.fromRadians(M,e.north,n,xIe),E=fe.fromRadians(e.west,e.north,n,_Ie),I=fe.fromRadians(e.west,g,n,SIe),A=fe.fromRadians(e.west,e.south,n,TIe),N=fe.fromRadians(M,e.south,n,CIe),D=i.cartographicToCartesian(Z,VIe),k=i.cartographicToCartesian(E,hne),O=i.cartographicToCartesian(I,LIe),U=i.cartographicToCartesian(A,pne),j=i.cartographicToCartesian(N,ZIe),K=F.projectPointToNearestOnPlane(D,RIe),te=F.projectPointToNearestOnPlane(k,GIe),z=F.projectPointToNearestOnPlane(O,EIe),q=F.projectPointToNearestOnPlane(U,WIe),ee=F.projectPointToNearestOnPlane(j,IIe);return r=Math.min(te.x,z.x,q.x),s=-r,c=Math.max(te.y,K.y),a=Math.min(q.y,ee.y),E.height=A.height=t,k=i.cartographicToCartesian(E,hne),U=i.cartographicToCartesian(A,pne),u=Math.min(on.getPointDistance(m,k),on.getPointDistance(m,U)),d=n,mne(F.origin,F.xAxis,F.yAxis,F.zAxis,r,s,a,c,u,d,o)}let p=e.south>0,b=e.north<0,h=p?e.south:b?e.north:0,x=le.center(e,fne).longitude,_=f.fromRadians(x,h,n,i,XIe);_.z=0;let V=Math.abs(_.x)=c?Ot.INSIDE:Ot.INTERSECTING};var yne=new f,xne=new f,_ne=new f,kIe=new f,bne=new f,DIe=new f;Ni.distanceSquaredTo=function(e,t){let n=f.subtract(t,e.center,gne),i=e.halfAxes,o=$.getColumn(i,0,yne),r=$.getColumn(i,1,xne),s=$.getColumn(i,2,_ne),a=f.magnitude(o),c=f.magnitude(r),u=f.magnitude(s),d=!0,m=!0,p=!0;a>0?f.divideByScalar(o,a,o):d=!1,c>0?f.divideByScalar(r,c,r):m=!1,u>0?f.divideByScalar(s,u,s):p=!1;let b=!d+!m+!p,h,x,_;if(b===1){let R=o;h=r,x=s,m?p||(R=s,x=o):(R=r,h=o),_=f.cross(h,x,bne),R===o?o=_:R===r?r=_:R===s&&(s=_)}else if(b===2){h=o,m?h=r:p&&(h=s);let R=f.UNIT_Y;R.equalsEpsilon(h,X.EPSILON3)&&(R=f.UNIT_X),x=f.cross(h,R,kIe),f.normalize(x,x),_=f.cross(h,x,bne),f.normalize(_,_),h===o?(r=x,s=_):h===r?(s=x,o=_):h===s&&(o=x,r=_)}else b===3&&(o=f.UNIT_X,r=f.UNIT_Y,s=f.UNIT_Z);let C=DIe;C.x=f.dot(n,o),C.y=f.dot(n,r),C.z=f.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-u?(L=C.z+u,V+=L*L):C.z>u&&(L=C.z-u,V+=L*L),V};var BIe=new f,OIe=new f;Ni.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Fa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,yne),u=$.getColumn(a,1,xne),d=$.getColumn(a,2,_ne),m=f.add(c,u,BIe);f.add(m,d,m),f.add(m,s,m);let p=f.subtract(m,t,OIe),b=f.dot(n,p);return o=Math.min(b,o),r=Math.max(b,r),f.add(s,c,m),f.add(m,u,m),f.subtract(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.add(s,c,m),f.subtract(m,u,m),f.add(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.add(s,c,m),f.subtract(m,u,m),f.subtract(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.subtract(s,c,m),f.add(m,u,m),f.add(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.subtract(s,c,m),f.add(m,u,m),f.subtract(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.subtract(s,c,m),f.subtract(m,u,m),f.add(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),f.subtract(s,c,m),f.subtract(m,u,m),f.subtract(m,d,m),f.subtract(m,t,p),b=f.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),i.start=o,i.stop=r,i};var YIe=new f,KIe=new f,zIe=new f;Ni.computeCorners=function(e,t){l(t)||(t=[new f,new f,new f,new f,new f,new f,new f,new f]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,YIe),r=$.getColumn(i,1,KIe),s=$.getColumn(i,2,zIe);return f.clone(n,t[0]),f.subtract(t[0],o,t[0]),f.subtract(t[0],r,t[0]),f.subtract(t[0],s,t[0]),f.clone(n,t[1]),f.subtract(t[1],o,t[1]),f.subtract(t[1],r,t[1]),f.add(t[1],s,t[1]),f.clone(n,t[2]),f.subtract(t[2],o,t[2]),f.add(t[2],r,t[2]),f.subtract(t[2],s,t[2]),f.clone(n,t[3]),f.subtract(t[3],o,t[3]),f.add(t[3],r,t[3]),f.add(t[3],s,t[3]),f.clone(n,t[4]),f.add(t[4],o,t[4]),f.subtract(t[4],r,t[4]),f.subtract(t[4],s,t[4]),f.clone(n,t[5]),f.add(t[5],o,t[5]),f.subtract(t[5],r,t[5]),f.add(t[5],s,t[5]),f.clone(n,t[6]),f.add(t[6],o,t[6]),f.add(t[6],r,t[6]),f.subtract(t[6],s,t[6]),f.clone(n,t[7]),f.add(t[7],o,t[7]),f.add(t[7],r,t[7]),f.add(t[7],s,t[7]),t};var HIe=new $;Ni.computeTransformation=function(e,t){l(t)||(t=new v);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,HIe);return v.fromRotationTranslation(i,n,t)};var JIe=new ae;Ni.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,JIe);return!t.isBoundingSphereVisible(n)};Ni.prototype.intersectPlane=function(e){return Ni.intersectPlane(this,e)};Ni.prototype.distanceSquaredTo=function(e){return Ni.distanceSquaredTo(this,e)};Ni.prototype.computePlaneDistances=function(e,t,n){return Ni.computePlaneDistances(this,e,t,n)};Ni.prototype.computeCorners=function(e){return Ni.computeCorners(this,e)};Ni.prototype.computeTransformation=function(e){return Ni.computeTransformation(this,e)};Ni.prototype.isOccluded=function(e){return Ni.isOccluded(this,e)};Ni.equals=function(e,t){return e===t||l(e)&&l(t)&&f.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ni.prototype.clone=function(e){return Ni.clone(this,e)};Ni.prototype.equals=function(e){return Ni.equals(this,e)};var Wn=Ni;var YDt=S(T(),1);var S5={};S5.getHeight=function(e,t,n){return(e-n)*t+n};var QIe=new fe;S5.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,QIe);if(!l(r))return f.clone(e,o);let s=S5.getHeight(r.height,n,i);return f.fromRadians(r.longitude,r.latitude,s,t,o)};var Tr=S5;var o6t=S(T(),1);var QDt=S(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 FR(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Ae.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(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._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function gc(e,t){return(e._flags&t)===t}function ag(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(FR.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 gc(this,Cr.CULL)},set:function(e){gc(this,Cr.CULL)!==e&&(ag(this,Cr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return gc(this,Cr.OCCLUDE)},set:function(e){gc(this,Cr.OCCLUDE)!==e&&(ag(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 gc(this,Cr.CAST_SHADOWS)},set:function(e){gc(this,Cr.CAST_SHADOWS)!==e&&(ag(this,Cr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return gc(this,Cr.RECEIVE_SHADOWS)},set:function(e){gc(this,Cr.RECEIVE_SHADOWS)!==e&&(ag(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 gc(this,Cr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){gc(this,Cr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(ag(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 gc(this,Cr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){gc(this,Cr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(ag(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)}},pickOnly:{get:function(){return gc(this,Cr.PICK_ONLY)},set:function(e){gc(this,Cr.PICK_ONLY)!==e&&(ag(this,Cr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return gc(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){gc(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(ag(this,Cr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});FR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new FR),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._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};FR.prototype.execute=function(e,t){e.draw(this,t)};var He=FR;var qDt=S(T(),1),jIe={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},Ze=Object.freeze(jIe);var dBt=S(T(),1);var tBt=S(T(),1);var T5={CLOCKWISE:H.CW,COUNTER_CLOCKWISE:H.CCW};T5.validate=function(e){return e===T5.CLOCKWISE||e===T5.COUNTER_CLOCKWISE};var ps=Object.freeze(T5);var iBt=S(T(),1);function Sne(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i0&&console.log(`${hh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${hh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${hh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,d=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${hh}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${hh}Vertex shader compile log: ${c}`),console.error(`${hh} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${hh}Fragment shader compile log: ${c}`),console.error(`${hh} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ue(u);function m(p,b){if(!l(d))return;let h=d.getTranslatedShaderSource(p);if(h===""){console.error(`${hh}${b} shader translation failed.`);return}console.error(`${hh}Translated ${b} shaderSource: -${h}`)}}function mXe(e,t,n){let i={};for(let o=0;o=0){if(d=n[u.slice(0,h)],!l(d))continue;m=d._locations,m.length<=1&&(p=d.value,b=e.getUniformLocation(t,u),b!==null&&(m.push(b),p.push(e.getUniform(t,b))))}else{m=[];for(let x=0;x0;){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=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function lie(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i planes2D_high.w && position3DLow.y > 0.0; -planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); -planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); -idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; -idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); -planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); -planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; -vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; -vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; -vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; -vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D -vec3 eastWard = southEastCorner - southWestCorner; -float eastExtent = length(eastWard); -eastWard /= eastExtent; -vec3 northWard = northWestCorner - southWestCorner; -float northExtent = length(northWard); -northWard /= northExtent; -v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); -v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); -v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL -vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); -vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); -v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); -v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); -v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif -gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var NQt=S(T(),1),cg=`#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 kQt=S(T(),1),mie={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};mie.NUMBER_OF_CLASSIFICATION_TYPES=3;var Bn=Object.freeze(mie);var OQt=S(T(),1);var TXe={NEVER:H.NEVER,LESS:H.LESS,EQUAL:H.EQUAL,LESS_OR_EQUAL:H.LEQUAL,GREATER:H.GREATER,NOT_EQUAL:H.NOTEQUAL,GREATER_OR_EQUAL:H.GEQUAL,ALWAYS:H.ALWAYS},yc=Object.freeze(TXe);var e7t=S(T(),1);var HQt=S(T(),1);function ph(){this.high=f.clone(f.ZERO),this.low=f.clone(f.ZERO)}ph.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 Mp={high:0,low:0};ph.fromCartesian=function(e,t){l(t)||(t=new ph);let n=t.high,i=t.low;return ph.encode(e.x,Mp),n.x=Mp.high,i.x=Mp.low,ph.encode(e.y,Mp),n.y=Mp.high,i.y=Mp.low,ph.encode(e.z,Mp),n.z=Mp.high,i.z=Mp.low,t};var _K=new ph;ph.writeElements=function(e,t,n){ph.fromCartesian(e,_K);let i=_K.high,o=_K.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 Kn=ph;var QQt=S(T(),1);function CXe(e,t){let n=[],i=e.length,o=0;for(;o=X.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ds.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=X.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ds.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ds.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ds.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ds.UNSIGNED_INT};var ke=Object.freeze(Ds);var m4t=S(T(),1);function Rd(e){e=y(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=Nn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Rd.createVertexBuffer=function(e){return new Rd({context:e.context,bufferTarget:H.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Rd.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=ke.getSizeInBytes(n),o=new Rd({context:t,bufferTarget:H.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(Rd.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Rd.prototype._getBuffer=function(){return this._buffer};Rd.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Rd.prototype.copyFromBuffer=function(e,t,n,i){let o=H.COPY_READ_BUFFER,r=H.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)};Rd.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=H.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var ut=Rd;function VXe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function hie(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(u=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),hie(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function fie(e){return e.values.length/e.componentsPerAttribute}function LXe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function ZXe(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=fie(e[o[0]]),t=1;t0){let u=Q.getSizeInBytes(e[o[0]].componentDatatype),d=a%u;d!==0&&(a+=u-d);let m=r*a,p=new ArrayBuffer(m),b={};for(t=0;t=X.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ut.createIndexBuffer({context:t,typedArray:new Uint32Array(b),usage:i,indexDatatype:ke.UNSIGNED_INT}):p=ut.createIndexBuffer({context:t,typedArray:new Uint16Array(b),usage:i,indexDatatype:ke.UNSIGNED_SHORT})),new Np({context:t,attributes:d,indexBuffer:p})};Object.defineProperties(Np.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Np.prototype.getAttribute=function(e){return this._attributes[e]};function RXe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Mt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function GXe(e,t){let n=e._attributes,i=n.length;for(let o=0;o>1^-(e&1)}Vo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,d=c>>5&o,m=c&i,p=3*a;t[p]=u*r,t[p+1]=d*s,t[p+2]=m*r}return t};var Fn=Vo;var ajt=S(T(),1);var _ie=new f,Sie=new f,Tie=new f;function DXe(e,t,n,i,o){l(o)||(o=new f);let r,s,a,c,u,d,m,p;if(l(t.z)){if(f.equalsEpsilon(e,t,X.EPSILON14))return f.clone(f.UNIT_X,o);if(f.equalsEpsilon(e,n,X.EPSILON14))return f.clone(f.UNIT_Y,o);if(f.equalsEpsilon(e,i,X.EPSILON14))return f.clone(f.UNIT_Z,o);r=f.subtract(n,t,_ie),s=f.subtract(i,t,Sie),a=f.subtract(e,t,Tie),c=f.dot(r,r),u=f.dot(r,s),d=f.dot(r,a),m=f.dot(s,s),p=f.dot(s,a)}else{if(B.equalsEpsilon(e,t,X.EPSILON14))return f.clone(f.UNIT_X,o);if(B.equalsEpsilon(e,n,X.EPSILON14))return f.clone(f.UNIT_Y,o);if(B.equalsEpsilon(e,i,X.EPSILON14))return f.clone(f.UNIT_Z,o);r=B.subtract(n,t,_ie),s=B.subtract(i,t,Sie),a=B.subtract(e,t,Tie),c=B.dot(r,r),u=B.dot(r,s),d=B.dot(r,a),m=B.dot(s,s),p=B.dot(s,a)}o.y=m*d-u*p,o.z=c*p-u*d;let b=c*m-u*u;if(b!==0)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}var Bx=DXe;var djt=S(T(),1);var CK={};CK.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};CK.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(g,Z,E,I){for(;Z.length>=1;){let A=Z[Z.length-1];if(Z.splice(Z.length-1,1),g[A].numLiveTriangles>0)return A}for(;o0)return++o,o-1;++o}return-1}function s(g,Z,E,I,A,N,D){let k=-1,O,U=-1,j=0;for(;jU||U===-1)&&(U=O,k=K)),++j}return k===-1?r(I,N,g,D):k}let a=t.length,c=0,u=0,d=t[u],m=a;if(l(n))c=n+1;else{for(;uc&&(c=d),++u,d=t[u];if(c===-1)return 0;++c}let p=[],b;for(b=0;bi&&(L.timeStamp=_,++_),++u}x=s(t,i,C,p,_,V,c)}return W};var yW=CK;var tl={};function X5(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function BXe(e){let t=e.length,n=t/3*6,i=ke.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=ke.createTypedArray(t,n);X5(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=ke.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=yW.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cie(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 Ie({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function KXe(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=X.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Cie(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Ae.TRIANGLES?u=3:e.primitiveType===Ae.LINES?u=2:e.primitiveType===Ae.POINTS&&(u=1);for(let d=0;d=X.SIXTY_FOUR_KILOBYTES&&(t.push(new mt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Cie(e.attributes))}o.length!==0&&t.push(new mt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Vie=new f,zXe=new fe;tl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Gi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let d=0;d_&&(_=V)}return new mt({attributes:d,indices:h,primitiveType:u,boundingSphere:l(x)?new ae(x,_):void 0})}tl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(RK(t,"geometry")),n.length>0&&(o.push(RK(n,"westHemisphereGeometry")),o.push(RK(n,"eastHemisphereGeometry"))),o};var Gd=new f,xW=new f,MC=new f,NC=new f;tl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u0){for(d=0;d3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?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;lg(e,a),lg(t,a),lg(n,a)}var Gie=new f;function Ed(e,t,n,i){f.add(e,f.multiplyByScalar(f.subtract(t,e,Gie),e.y/(e.y-t.y),Gie),n),f.clone(n,i),lg(n,!0),lg(i,!1)}var Ox=new f,Yx=new f,Kx=new f,zx=new f,GK={positions:new Array(7),indices:new Array(3*3)};function s2e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;r2e(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=GK.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ed(e,t,Ox,Kx),Ed(e,n,Yx,zx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Ed(t,n,Ox,Kx),Ed(t,e,Yx,zx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Ed(n,e,Ox,Kx),Ed(n,t,Yx,zx),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||(Ed(n,e,Ox,Kx),Ed(n,t,Yx,zx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ed(t,n,Ox,Kx),Ed(t,e,Yx,zx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ed(e,t,Ox,Kx),Ed(e,n,Yx,zx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=GK.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Ox,c[4]=Yx,c[5]=Kx,c[6]=zx,c.length=7),GK}function Eie(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=mt.computeNumberOfVertices(e);return e.indices=ke.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function kC(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 Ie({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new mt({attributes:n,indices:[],primitiveType:e.primitiveType})}function XK(e,t,n){let i=l(e.geometry.boundingSphere);t=Eie(t,i),n=Eie(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 PK(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,d,m,p){let b=e.fromArray(u,r*t,n),h=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(b,c.x,b),e.multiplyByScalar(h,c.y,h),e.multiplyByScalar(x,c.z,x);let _=e.add(b,h,b);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,d,m*t)}}var a2e=PK(re,4),I5=PK(f,3),wie=PK(B,2),c2e=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>X.EPSILON6?1:0},SW=new f,EK=new f,WK=new f,l2e=new f;function E5(e,t,n,i,o,r,s,a,c,u,d,m,p,b,h,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&b===0)return;let _=f.fromArray(o,e*3,SW),C=f.fromArray(o,t*3,EK),V=f.fromArray(o,n*3,WK),L=Bx(i,_,C,V,l2e);if(l(L)){if(l(r)&&I5(e,t,n,L,r,m.normal.values,x,!0),l(u)){let R=f.fromArray(u,e*3,SW),G=f.fromArray(u,t*3,EK),W=f.fromArray(u,n*3,WK);f.multiplyByScalar(R,L.x,R),f.multiplyByScalar(G,L.y,G),f.multiplyByScalar(W,L.z,W);let w;!f.equals(R,f.ZERO)||!f.equals(G,f.ZERO)||!f.equals(W,f.ZERO)?(w=f.add(R,G,R),f.add(w,W,w),f.normalize(w,w)):(w=SW,w.x=0,w.y=0,w.z=0),f.pack(w,m.extrudeDirection.values,x*3)}if(l(d)&&c2e(e,t,n,L,d,m.applyOffset.values,x),l(s)&&I5(e,t,n,L,s,m.tangent.values,x,!0),l(a)&&I5(e,t,n,L,a,m.bitangent.values,x,!0),l(c)&&wie(e,t,n,L,c,m.st.values,x),b>0)for(let R=0;R3){let I=E.positions,A=E.indices,N=A.length;for(let D=0;D0)continue;let c=f.unpack(i,s,Mie);(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]):f.pack(a,i,s));let u=f.unpack(o,s,IK);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+30||ae.intersectPlane(n,on.ORIGIN_ZX_PLANE)!==Ot.INTERSECTING))return e;if(t.geometryType!==Zd.NONE)switch(t.geometryType){case Zd.POLYLINES:x2e(e);break;case Zd.TRIANGLES:Wie(e);break;case Zd.LINES:Iie(e);break}else o2e(t),t.primitiveType===Ae.TRIANGLES?Wie(e):t.primitiveType===Ae.LINES&&Iie(e);return e};var Un=tl;var Yjt=S(T(),1);function Ml(e){this._ellipsoid=y(e,ie.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Ml.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Ml.mercatorAngleToGeodeticLatitude=function(e){return X.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Ml.geodeticLatitudeToMercatorAngle=function(e){e>Ml.MaximumLatitude?e=Ml.MaximumLatitude:e<-Ml.MaximumLatitude&&(e=-Ml.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Ml.MaximumLatitude=Ml.mercatorAngleToGeodeticLatitude(Math.PI);Ml.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Ml.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new f(i,o,r)};Ml.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Ml.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Wi=Ml;function _2e(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;ur&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function C2e(e,t){let n=[];return wK(e,"geometry",t,n),wK(e,"westHemisphereGeometry",t,n),wK(e,"eastHemisphereGeometry",t,n),n}var kp={};kp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=T2e(e),t.length>0&&(n=Un.createAttributeLocations(t[0]),e.createPickOffsets&&(r=C2e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let d=0;d0&&(n.set(c.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};kp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let G=_.length/C;for(R=ke.createTypedArray(G,x),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function Bie(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,d="",m="";if(i){d+=`vec2 st; -`;let h=s>1?`${c}.x`:c;m+=` st = czm_decompressTextureCoordinates(${h}); -`}n&&o&&r?(d+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(d+=`vec3 normal; -`,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(d+=`vec3 tangent; -`,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(d+=`vec3 bitangent; -`,m+=` 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 b=`void main() -{ -${m} czm_non_compressed_main(); -}`;return[u,d,p,b].join(` -`)}function M2e(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 N2e(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 Oie(e,t){let n=e.vertexAttributes}function U2e(e,t){return function(){return e[t]}}var FK=Math.max(At.hardwareConcurrency-1,1),v5,k2e=new di("combineGeometry");function D2e(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Vr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o0){let x=new Float64Array(m);for(h=[x.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=Vr.COMBINED):CW(e,t,Vr.FAILED,void 0)}).catch(function(m){CW(e,t,Vr.FAILED,m)})}}function B2e(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;a0?(e._recomputeBoundingSpheres=!0,e._state=Vr.COMBINED):CW(e,t,Vr.FAILED,void 0)}function O2e(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;i0||ae.intersectPlane(x,on.ORIGIN_ZX_PLANE)!==Ot.INTERSECTING?c.push(x):(u.push(x),d.push(x))}let m=c[0],p=d[0],b=u[0];for(i=1;i0){if(Mt.maximumVertexTextureImageUnits===0)throw new ue("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Vr.COMPLETE&&this._state!==Vr.COMBINED&&(this.asynchronous?D2e(this,e):B2e(this,e)),this._state===Vr.COMBINED&&(Y2e(this,e),Kie(this,e),z2e(this,e)),!this.show||this._state!==Vr.COMPLETE)return;this._batchTableOffsetsUpdated||Kie(this,e),this._recomputeBoundingSpheres&&O2e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,H2e)(this,t,n,u),r&&y(this._createShaderProgramFunction,J2e)(this,e,n),(o||r)&&y(this._createCommandsFunction,Q2e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,j2e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var q2e=new ae,$2e=new ae;function eoe(e,t,n){if(n===mn.TOP){let i=ae.clone(e,q2e),o=ae.clone(e,$2e);o.center=f.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===mn.ALL&&(e.center=f.add(e.center,t,e.center));return e}function ePe(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 tPe(e,t,n,i,o){return function(r){let s=Qie(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var nPe=new f;function iPe(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)&&eoe(i,f.fromArray(r.get(),0,nPe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function oPe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Lr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); -float useDownOrLeft = float(useUpOrRight == 0.0); -vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); -vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); -return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC -void main(void) -{ -#ifdef REQUIRES_EC -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif -#ifdef REQUIRES_WC -vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; -vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; -#endif -#ifdef TEXTURE_COORDINATES -vec2 uv; -#ifdef SPHERICAL -vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); -sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; -sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); -uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; -uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL -uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; -uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES -#ifdef PICK -#ifdef CULL_FRAGMENTS -if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { -out_FragColor.a = 1.0; -czm_writeDepthClamp(); -} -#else // CULL_FRAGMENTS -out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK -#ifdef CULL_FRAGMENTS -if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { -discard; -} -#endif -#ifdef NORMAL_EC -vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); -vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); -vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif -#ifdef PER_INSTANCE_COLOR -vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT -out_FragColor = color; -#else // FLAT -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = -eyeCoordinate.xyz; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#else // PER_INSTANCE_COLOR -czm_materialInput materialInput; -#ifdef USES_NORMAL_EC -materialInput.normalEC = normalEC; -#endif -#ifdef USES_POSITION_TO_EYE_EC -materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif -#ifdef USES_TANGENT_TO_EYE -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif -#ifdef USES_ST -materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; -materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#endif // PER_INSTANCE_COLOR -czm_writeDepthClamp(); -#endif // PICK -} -`;function Wd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new MK;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new MK;if(o.requiresTextureCoordinates=e,n instanceof fn)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}Wd.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 fn&&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 fn||(o=t.material.shaderSource),new De({defines:i,sources:[o,DC]})};Wd.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:[DC],pickColorQualifier:"in"})};Wd.prototype.createVertexShader=function(e,t,n,i){return coe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Wd.prototype.createPickVertexShader=function(e,t,n,i){return coe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var toe=new f,noe=new fe,ioe={high:0,low:0};function coe(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=noe;u.longitude=X.PI,u.latitude=0,u.height=0;let d=s.project(u,toe),m=Kn.encode(d.x,ioe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=noe;p.longitude=-X.PI,p.latitude=0,p.height=0;let b=s.project(p,toe);m=Kn.encode(b.x,ioe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.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 fn&&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 MK(){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(MK.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 ooe(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)/B.distance(t,e)}var sPe=[new B,new B,new B,new B];function loe(e,t){let n=sPe,i=B.unpack(t,0,n[0]),o=B.unpack(t,2,n[1]),r=B.unpack(t,4,n[2]);e.uMaxVmax=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/ooe(i,o,r),a=1/ooe(i,r,o);e.uvMinAndExtents=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var uoe=new fe,doe=new f,aPe=new f,cPe=new f,w5={high:0,low:0};function moe(e,t,n){let i=uoe;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,doe);i.latitude=e.north;let r=t.project(i,aPe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,cPe),a=[0,0,0,0],c=[0,0,0,0],u=Kn.encode(o.x,w5);a[0]=u.high,c[0]=u.low,u=Kn.encode(o.y,w5),a[1]=u.high,c[1]=u.low,u=Kn.encode(r.y,w5),a[2]=u.high,c[2]=u.low,u=Kn.encode(s.x,w5),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var lPe=new v,uPe=new v,roe=new f,dPe=new fe,mPe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function fPe(e,t,n,i,o,r){let s=le.center(e,dPe);s.height=n;let a=fe.toCartesian(s,t,roe),c=Vt.eastNorthUpToFixedFrame(a,t,lPe),u=v.inverse(c,uPe),d=e.west,m=e.east,p=e.north,b=e.south,h=mPe;h[0].latitude=b,h[0].longitude=d,h[1].latitude=p,h[1].longitude=d,h[2].latitude=p,h[2].longitude=m,h[3].latitude=b,h[3].longitude=m;let x=(d+m)*.5,_=(p+b)*.5;h[4].latitude=b,h[4].longitude=x,h[5].latitude=p,h[5].longitude=x,h[6].latitude=_,h[6].longitude=d,h[7].latitude=_,h[7].longitude=m;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){h[P].height=n;let F=fe.toCartesian(h[P],t,roe);v.multiplyByPoint(u,F,F),F.z=0,C=Math.min(C,F.x),V=Math.max(V,F.x),L=Math.min(L,F.y),R=Math.max(R,F.y)}let G=i;G.x=C,G.y=L,G.z=0,v.multiplyByPoint(c,G,G);let W=o;W.x=V,W.y=L,W.z=0,v.multiplyByPoint(c,W,W),f.subtract(W,G,o);let w=r;w.x=C,w.y=R,w.z=0,v.multiplyByPoint(c,w,w),f.subtract(w,G,r)}var hPe=new f,pPe=new f,bPe=new Kn;Wd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=doe,s=hPe,a=pPe;fPe(e,n,y(o,0),r,s,a);let c={};loe(c,t);let u=Kn.fromCartesian(r,bPe);return c.southWest_HIGH=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.high,[0,0,0])}),c.southWest_LOW=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.low,[0,0,0])}),c.eastward=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(s,[0,0,0])}),c.northward=new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(a,[0,0,0])}),moe(e,i,c),c};var gPe=new f;function soe(e,t,n,i){let o=uoe;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,gPe),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 aoe=new B;Wd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=soe(e.south,e.west,n,aoe),r=o.x,s=o.y,a=soe(e.north,e.east,n,aoe),c=a.x,u=a.y,d=0;s>u&&(d=X.PI-s,s=-X.PI,u+=d),r-=X.EPSILON5,s-=X.EPSILON5,c+=X.EPSILON5,u+=X.EPSILON5;let m=1/(u-s),p=1/(c-r),b={sphericalExtents:new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new xc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return loe(b,t),moe(e,i,b),b};Wd.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)};Wd.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 yPe(e){return Math.max(e.width,e.height)>Wd.MAX_WIDTH_FOR_PLANAR_EXTENTS}Wd.shouldUseSphericalCoordinates=function(e){return yPe(e)};Wd.MAX_WIDTH_FOR_PLANAR_EXTENTS=X.toRadians(1);var Zu=Wd;var X7t=S(T(),1);var L7t=S(T(),1);var xPe={NEVER:H.NEVER,LESS:H.LESS,EQUAL:H.EQUAL,LESS_OR_EQUAL:H.LEQUAL,GREATER:H.GREATER,NOT_EQUAL:H.NOTEQUAL,GREATER_OR_EQUAL:H.GEQUAL,ALWAYS:H.ALWAYS},On=Object.freeze(xPe);var G7t=S(T(),1);var _Pe={ZERO:H.ZERO,KEEP:H.KEEP,REPLACE:H.REPLACE,INCREMENT:H.INCR,DECREMENT:H.DECR,INVERT:H.INVERT,INCREMENT_WRAP:H.INCR_WRAP,DECREMENT_WRAP:H.DECR_WRAP},gt=Object.freeze(_Pe);var F5={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};F5.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:On.ALWAYS,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.REPLACE},backFunction:On.ALWAYS,backOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.REPLACE},reference:F5.CESIUM_3D_TILE_MASK,mask:F5.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(F5);function Jx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Bn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(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:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Jx.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}}});Jx.isSupported=function(e){return e.context.stencilBuffer};function BC(e,t){let n=t?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:gt.KEEP,zFail:gt.DECREMENT_WRAP,zPass:gt.KEEP},backFunction:n,backOperation:{fail:gt.KEEP,zFail:gt.INCREMENT_WRAP,zPass:gt.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 UK(e){return{stencilTest:{enabled:e,frontFunction:On.NOT_EQUAL,frontOperation:{fail:gt.ZERO,zFail:gt.ZERO,zPass:gt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:gt.ZERO,zFail:gt.ZERO,zPass:gt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND}}var SPe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:gt.ZERO,zFail:gt.ZERO,zPass:gt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:gt.ZERO,zFail:gt.ZERO,zPass:gt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function TPe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Oe.fromCache(BC(o,!1)),e._rsStencilDepthPass3DTiles=Oe.fromCache(BC(o,!0)),e._rsColorPass=Oe.fromCache(UK(o,!1)),e._rsPickPass=Oe.fromCache(SPe)}function CPe(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 VPe(e,t){let n=t.context,i=e._primitive,o=hW;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=CPe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),u=new De({sources:[cg]}),d=e._primitive._attributeLocations,m=new Zu(s,r,e.appearance);if(e._spStencil=qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:d}),e._primitive.allowPicking){let h=De.createPickVertexShaderSource(o);h=In._appendShowToShader(i,h),h=In._updatePickColorAttribute(h);let x=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:d}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=m.createPickFragmentShader(!0),L=m.createPickVertexShader([a],h,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:d})}e._spPick2D=C}}else e._spPick=qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:d});o=In._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:d});let p=m.createFragmentShader(!1),b=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:b,fragmentShaderSource:p,attributeLocations:d}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(h)){let x=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:d})}e._spColor2D=h}}function LPe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=Zu.hasAttributesForSphericalExtents(c),b=Zu.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Jx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Jx.prototype.isDestroyed=function(){return!1};Jx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,de(this)};var OC=Jx;var EPe={u_globeMinimumAltitude:function(){return 55e3}};function Nl(e){e=y(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{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Nl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Nl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};Nl._supportsMaterials=function(e){return e.depthTexture};Nl.supportsMaterials=function(e){return Nl._supportsMaterials(e.frameState.context)};var nl=Nl;var G6t=S(T(),1);function YC(){he.throwInstantiationError()}Object.defineProperties(YC.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});YC.prototype.getType=he.throwInstantiationError;YC.prototype.getValue=he.throwInstantiationError;YC.prototype.equals=he.throwInstantiationError;YC.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),Y.clone(Y.WHITE,n.uniforms.color),n)};var nr=YC;function Qx(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}Qx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!J.getValueOrDefault(t.show,n,!0)};Qx.prototype._setOptions=he.throwInstantiationError;Qx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,d=u instanceof zt,m,p=t._getIsClosed(c);if(d)m=new fn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let b=nr.getValue(e,u,this._material);this._material=b,m=new mo({material:b,translucent:b.isTranslucent(),closed:p})}if(n)c.vertexFormat=fn.VERTEX_FORMAT,this._primitive=o.add(new nl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),J.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let b=this._geometryUpdater.createFillGeometryInstance(e);d&&(m.translucent=b.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:b,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),d=J.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new fn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(d)}}),asynchronous:!1,shadows:a}))}};Qx.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))?(ae.clone(o.boundingSphere,e),ht.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ht.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ht.PENDING:ht.FAILED};Qx.prototype.isDestroyed=function(){return!1};Qx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),de(this)};var ii=Qx;var don=S(T(),1);var K6t=S(T(),1);var yoe={};function VW(e,t){l(yoe[e])||(yoe[e]=!0,console.warn(y(t,e)))}VW.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.";VW.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";VW.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";VW.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Bt=VW;var Hin=S(T(),1);var q$t=S(T(),1);var Uqt=S(T(),1);var H6t=S(T(),1),MPe={NONE:0,GEODESIC:1,RHUMB:2},rn=Object.freeze(MPe);var $6t=S(T(),1);var xoe=X.EPSILON10;function NPe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,d=0,m=-1;for(s=1;sX.EPSILON12);let Z=M*(t*t-n*n)/(n*n),E=1+Z*(4096+Z*(Z*(320-175*Z)-768))/16384,I=Z*(256+Z*(Z*(74-47*Z)-128))/1024,A=g*g,N=I*F*(g+I*(P*(2*A-1)-I*g*(4*F*F-3)*(4*A-3)/6)/4),D=n*E*(w-N),k=Math.atan2(b*W,_-V*G),O=Math.atan2(m*W,_*G-V);e._distance=D,e._startHeading=k,e._endHeading=O,e._uSquared=Z}var BPe=new f,BK=new f;function Soe(e,t,n,i){let o=f.normalize(i.cartographicToCartesian(t,BK),BPe),r=f.normalize(i.cartographicToCartesian(n,BK),BK);DPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,UPe(e)}function LW(e,t,n){let i=y(n,ie.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Soe(this,e,t,i)}Object.defineProperties(LW.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}}});LW.prototype.setEndPoints=function(e,t){Soe(this,e,t,this._ellipsoid)};LW.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};LW.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),d=Math.sin(8*i),m=i*i,p=i*m,b=n.u8Over256,h=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*b*o/3+i*(1-h+7*_/4-15*x/4+579*b/64-(_-15*x/4+187*b/16)*o-(5*x/4-115*b/16)*r-29*b*s/16)+(h/2-_+71*x/32-85*b/16)*a+(5*_/16-5*x/4+383*b/96)*c-m*((x-11*b/2)*a+5*b*c/2)+(29*x/96-29*b/16)*u+539*b*d/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let R=Math.cos(2*n.sigma+C),G=Math.sin(C),W=Math.cos(C),w=n.cosineU*W,P=n.sineU*G,M=Math.atan2(G*n.sineHeading,w-P*n.cosineHeading)-_oe(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,W,R);return l(t)?(t.longitude=this._start.longitude+M,t.latitude=L,t.height=0,t):new fe(this._start.longitude+M,L,0)};var Dp=LW;var pqt=S(T(),1);function YK(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,d=Math.sin(2*u),m=Math.sin(4*u),p=Math.sin(6*u),b=Math.sin(8*u),h=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*d+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*b-(693*a/1310720+6237*c/5242880)*h+1001*c/8388608*x)}function OPe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,d=u*c,m=d*c,p=m*c,b=p*c,h=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),R=Math.sin(8*i),G=Math.cos(8*i),W=Math.sin(10*i),w=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*d/256+579*i*m/16384+1515*i*p/65536+16837*i*b/1048576+(3*i*u/16+45*i*d/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*b/5242880)*x+(21*i*d/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*b/1048576)*C+(151*i*m/4096+4681*i*p/65536+1479*i*b/16384-453*r*b/32768)*L+(1097*i*p/65536+42783*i*b/1048576)*G+8011*i*b/1048576*w+(3*c/8+3*u/16+213*d/2048-3*o*d/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*b/1048576-471*o*b/8192+9*s*b/4096)*h+(21*u/256+21*d/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*b/16777216-12517*o*b/131072+7*s*b/2048)*_+(151*d/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*b/786432-8607*o*b/131072)*V+(1097*m/131072+1097*p/65536+225797*b/10485760-1097*o*b/65536)*R+(8011*p/2621440+8011*b/1048576)*W+293393*b/251658240*P}function KC(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 YPe(e,t,n,i,o){let r=KC(e._ellipticity,n),s=KC(e._ellipticity,o);return Math.atan2(X.negativePiToPi(i-t),s-r)}function KPe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(X.equalsEpsilon(Math.abs(a),X.PI_OVER_TWO,X.EPSILON8))if(t===n)u=t*Math.cos(o)*X.negativePiToPi(c);else{let d=Math.sin(o);u=t*Math.cos(o)*X.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*d*d)}else{let d=YK(e._ellipticity,t,o);u=(YK(e._ellipticity,t,s)-d)/Math.cos(a)}return Math.abs(u)}var zPe=new f,OK=new f;function Toe(e,t,n,i){let o=f.normalize(i.cartographicToCartesian(t,OK),zPe),r=f.normalize(i.cartographicToCartesian(n,OK),OK),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=YPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=KPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Coe(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(X.PI_OVER_TWO-Math.abs(t))>X.EPSILON8){let d=YK(o,i,e.latitude),m=n*Math.cos(t),p=d+m;if(c=OPe(p,o,i),Math.abs(t)0?a=X.negativePiToPi(e.longitude+u):a=X.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function Bp(e,t,n){let i=y(n,ie.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Toe(this,e,t,i)}Object.defineProperties(Bp.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}}});Bp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ie.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,d=Math.sqrt((c-u)/c);t=X.negativePiToPi(t);let m=Coe(e,t,n,r.maximumRadius,d);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Bp(e,m,r):(o.setEndPoints(e,m),o)};Bp.prototype.setEndPoints=function(e,t){Toe(this,e,t,this._ellipsoid)};Bp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Bp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Coe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Bp.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 fe),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)),u=(1+a)/(1-a),d=r.latitude,m;do{m=d;let p=n*Math.sin(m),b=(1+p)/(1-p);d=2*Math.atan(c*Math.pow(b/u,n/2))-X.PI_OVER_TWO}while(!X.equalsEpsilon(d,m,X.EPSILON12));return t.longitude=e,t.latitude=d,t.height=0,t};Bp.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=KC(n,o.latitude),s=KC(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 fe(c,e,0)};var Na=Bp;var $K=[Gi,Wi],HPe=$K.length,Boe=Math.cos(X.toRadians(30)),Voe=Math.cos(X.toRadians(150)),Ooe=0,Yoe=1e3;function dg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,rn.GEODESIC),this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(dg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});dg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iBoe||rX.PI_OVER_TWO&&(a=!0,s=f.subtract(r,n,Xoe),u=c.cartesianToCartographic(s,Ioe)),u.height=0;let d=e.project(u,o);return o=f.subtract(d,i,o),o.z=0,o=f.normalize(o,o),a&&f.negate(o,o),o}var hve=new f,Poe=new f;function voe(e,t,n,i,o,r){let s=f.subtract(t,e,hve);f.normalize(s,s);let a=n-Ooe,c=f.multiplyByScalar(s,a,Poe);f.add(e,c,o);let u=i-Yoe;c=f.multiplyByScalar(s,u,Poe),f.add(t,c,r)}var pve=new f;function U5(e,t){let n=on.getPointDistance(k5,e),i=on.getPointDistance(k5,t),o=pve;X.equalsEpsilon(n,0,X.EPSILON2)?(o=Op(t,e,o),f.multiplyByScalar(o,X.EPSILON2,o),f.add(e,o,e)):X.equalsEpsilon(i,0,X.EPSILON2)&&(o=Op(e,t,o),f.multiplyByScalar(o,X.EPSILON2,o),f.add(t,o,t))}function bve(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 zoe=new fe,Hoe=new fe,woe=new f,JK=new f,Foe=new f,Aoe=new f,gve=new f,Moe=new f,yve=[zoe,Hoe],xve=new le,_ve=new f,Sve=new f,Tve=new f,Cve=new f,Vve=new f,Lve=new f,QK=new f,jK=new f,Zve=new f,Rve=new f,Gve=new f,Noe=new f,Eve=new f,Wve=new f,Ive=new Kn,Xve=new Kn,Uoe=new f,Pve=new f,koe=new f,vve=[new ae,new ae],Joe=[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],Doe=Joe.length;function wve(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,d=n.length/3-1,m=d*8,p=m*4,b=d*36,h=m>65535?new Uint32Array(b):new Uint16Array(b),x=new Float64Array(m*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),R=new Float32Array(p),G,W,w,P;s&&(G=new Float32Array(p),W=new Float32Array(p),w=new Float32Array(p),P=new Float32Array(m*2));let F=r.length/2,M=0,g=zoe;g.height=0;let Z=Hoe;Z.height=0;let E=woe,I=JK;if(s)for(c=0,a=1;aBoe?(pt=ZW(t,g,Ne,yt,QK),Be=ZW(t,Z,q,Nt,jK)):ui===1?(Be=ZW(t,Z,q,Nt,jK),pt.x=0,pt.y=X.sign(g.longitude-Math.abs(Z.longitude)),pt.z=0):(pt=ZW(t,g,Ne,yt,QK),Be.x=0,Be.y=X.sign(g.longitude-Z.longitude),Be.z=0)}let et=f.distance(Re,z),qe=Kn.fromCartesian(Xe,Ive),$e=f.subtract(te,Xe,Zve),Kt=f.normalize($e,Noe),ge=f.subtract(Re,Xe,Rve);ge=f.normalize(ge,ge);let Ve=f.cross(Kt,ge,Noe);Ve=f.normalize(Ve,Ve);let Ht=f.cross(ge,Ne,Eve);Ht=f.normalize(Ht,Ht);let xt=f.subtract(z,te,Gve);xt=f.normalize(xt,xt);let fi=f.cross(q,xt,Wve);fi=f.normalize(fi,fi);let vo=et/N,Ms=ee/N,sa=0,Jr,Qr,Ye,st=0,ot=0;if(s){sa=f.distance(yt,Nt),Jr=Kn.fromCartesian(yt,Xve),Qr=f.subtract(Nt,yt,Uoe),Ye=f.normalize(Qr,Pve);let ui=Ye.x;Ye.x=Ye.y,Ye.y=-ui,st=sa/M,ot=pe/M}for(D=0;D<8;D++){let ui=j+D*4,Cs=O+D*2,Gr=ui+3,sc=D<4?1:-1,jo=D===2||D===3||D===6||D===7?1:-1;f.pack(qe.high,_,ui),_[Gr]=$e.x,f.pack(qe.low,C,ui),C[Gr]=$e.y,f.pack(Ht,V,ui),V[Gr]=$e.z,f.pack(fi,L,ui),L[Gr]=vo*sc,f.pack(Ve,R,ui);let Er=Ms*jo;Er===0&&jo<0&&(Er=9),R[Gr]=Er,s&&(G[ui]=Jr.high.x,G[ui+1]=Jr.high.y,G[ui+2]=Jr.low.x,G[ui+3]=Jr.low.y,w[ui]=-pt.y,w[ui+1]=pt.x,w[ui+2]=Be.y,w[ui+3]=-Be.x,W[ui]=Qr.x,W[ui+1]=Qr.y,W[ui+2]=Ye.x,W[ui+3]=Ye.y,P[Cs]=st*sc,Er=ot*jo,Er===0&&jo<0&&(Er=9),P[Cs+1]=Er)}let tt=Tve,St=Cve,Et=_ve,Sn=Sve,Co=le.fromCartographicArray(yve,xve),mr=mi.getMinimumMaximumHeights(Co,u),oc=mr.minimumTerrainHeight,rc=mr.maximumTerrainHeight;xe+=Math.abs(oc),xe+=Math.abs(rc),voe(Xe,Re,oc,rc,tt,Et),voe(te,z,oc,rc,St,Sn);let Rr=f.multiplyByScalar(Ve,X.EPSILON5,koe);f.add(tt,Rr,tt),f.add(St,Rr,St),f.add(Et,Rr,Et),f.add(Sn,Rr,Sn),U5(tt,St),U5(Et,Sn),f.pack(tt,x,U),f.pack(St,x,U+3),f.pack(Sn,x,U+6),f.pack(Et,x,U+9),Rr=f.multiplyByScalar(Ve,-2*X.EPSILON5,koe),f.add(tt,Rr,tt),f.add(St,Rr,St),f.add(Et,Rr,Et),f.add(Sn,Rr,Sn),U5(tt,St),U5(Et,Sn),f.pack(tt,x,U+12),f.pack(St,x,U+15),f.pack(Sn,x,U+18),f.pack(Et,x,U+21),k+=2,c+=3,O+=16,U+=24,j+=32,ee+=et,pe+=sa}c=0;let ce=0;for(a=0;a halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec3 alignedPlaneNormal; -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); -s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; -float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, t); -materialInput.str = vec3(s, t, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -out_FragColor.rgb *= out_FragColor.a; -czm_writeDepthClamp(); -} -`;var Oqt=S(T(),1),GW=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; -#endif -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { -return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); -} -void main(void) -{ -vec4 eyeCoordinate = gl_FragCoord; -eyeCoordinate /= eyeCoordinate.w; -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); -float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); -distanceFromStart = max(0.0, distanceFromStart); -distanceFromEnd = max(0.0, distanceFromEnd); -float s = distanceFromStart / (distanceFromStart + distanceFromEnd); -s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, v_texcoordT); -materialInput.str = vec3(s, v_texcoordT, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -} -`;var Kqt=S(T(),1),EW=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -in float batchId; -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; -#endif -void main() -{ -v_batchId = batchId; -vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); -vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); -vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec4 startPlane2D; -vec4 startPlane3D; -startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); -startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); -vec4 rightPlane2D; -vec4 rightPlane3D; -rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); -rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); -posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); -posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); -posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); -vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); -vec4 endPlane2D; -vec4 endPlane3D; -endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); -endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); -v_forwardDirectionEC = normalize(endEC - startEC); -vec2 cleanTexcoordNormalization2D; -cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); -cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); -vec2 cleanTexcoordNormalization3D; -cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; -cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); -v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR -v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); -v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR -#ifdef WIDTH_VARYING -float width = czm_batchTable_width(batchId); -float halfWidth = width * 0.5; -v_width = width; -v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else -float halfWidth = 0.5 * czm_batchTable_width(batchId); -v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#endif -vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); -float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); -vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); -geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc3D.xyz += geodeticSurfaceNormal; -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; -vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); -absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); -planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); -upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); -normalEC = normalize(cross(planeDirection, upOrDown)); -geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); -geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc2D.xyz += geodeticSurfaceNormal; -normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR -v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif -positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; -gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var Hqt=S(T(),1),WW=`in vec3 position3DHigh; -in vec3 position3DLow; -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif -in float batchId; -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif -void main() -{ -#ifdef COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; -vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); -vec3 ecEnd = forwardDirectionEC + ecStart; -forwardDirectionEC = normalize(forwardDirectionEC); -v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); -v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; -#else // COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; -vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); -vec3 ecEnd = ecStart + offset; -vec3 forwardDirectionEC = normalize(offset); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; -#endif // COLUMBUS_VIEW_2D -v_endEcAndStartEcX.xyz = ecEnd; -v_endEcAndStartEcX.w = ecStart.x; -v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR -vec4 positionRelativeToEye = czm_computePosition(); -vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; -float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); -vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -upOrDown = cross(forwardDirectionEC, normalEC); -upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; -upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; -upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; -positionEC.xyz += upOrDown; -v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); -float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING -v_width = width; -#endif -v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; -v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; -v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; -v_endPlaneNormalEcAndBatchId.w = batchId; -width = width * max(0.0, czm_metersPerPixel(positionEC)); -width = width / dot(normalEC, v_rightPlaneEC.xyz); -#ifdef COLUMBUS_VIEW_2D -normalEC *= sign(texcoordNormalization2D.x); -#else -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -#endif -positionEC.xyz += width * normalEC; -gl_Position = czm_depthClamp(czm_projection * positionEC); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var a$t=S(T(),1);var Qqt=S(T(),1),IW=`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 qqt=S(T(),1),Ru=`void clipLineSegmentToNearPlane( -vec3 p0, -vec3 p1, -out vec4 positionWC, -out bool clipped, -out bool culledByNearPlane, -out vec4 clippedPositionEC) -{ -culledByNearPlane = false; -clipped = false; -vec3 p0ToP1 = p1 - p0; -float magnitude = length(p0ToP1); -vec3 direction = normalize(p0ToP1); -float endPoint0Distance = czm_currentFrustum.x + p0.z; -float denominator = -direction.z; -if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) -{ -culledByNearPlane = true; -} -else if (endPoint0Distance > 0.0) -{ -float t = endPoint0Distance / denominator; -if (t < 0.0 || t > magnitude) -{ -culledByNearPlane = true; -} -else -{ -p0 = p0 + t * direction; -p0.z = min(p0.z, -czm_currentFrustum.x); -clipped = true; -} -} -clippedPositionEC = vec4(p0, 1.0); -positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ -#ifdef POLYLINE_DASH -vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); -vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); -vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); -vec2 lineDir; -if (usePrevious) { -lineDir = normalize(positionWindow.xy - previousWindow.xy); -} -else { -lineDir = normalize(nextWindow.xy - positionWindow.xy); -} -angle = atan(lineDir.x, lineDir.y) - 1.570796327; -angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif -vec4 clippedPrevWC, clippedPrevEC; -bool prevSegmentClipped, prevSegmentCulled; -clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); -vec4 clippedNextWC, clippedNextEC; -bool nextSegmentClipped, nextSegmentCulled; -clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); -bool segmentClipped, segmentCulled; -vec4 clippedPositionWC, clippedPositionEC; -clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); -if (segmentCulled) -{ -return vec4(0.0, 0.0, 0.0, 1.0); -} -vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); -vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); -if (prevSegmentCulled) -{ -directionToPrevWC = -directionToNextWC; -} -else if (nextSegmentCulled) -{ -directionToNextWC = -directionToPrevWC; -} -vec2 thisSegmentForwardWC, otherSegmentForwardWC; -if (usePrevious) -{ -thisSegmentForwardWC = -directionToPrevWC; -otherSegmentForwardWC = directionToNextWC; -} -else -{ -thisSegmentForwardWC = directionToNextWC; -otherSegmentForwardWC = -directionToPrevWC; -} -vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); -vec2 leftWC = thisSegmentLeftWC; -float expandWidth = width * 0.5; -if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) -{ -vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); -vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; -float leftSumLength = length(leftSumWC); -leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); -vec2 u = -thisSegmentForwardWC; -vec2 v = leftWC; -float sinAngle = abs(u.x * v.y - u.y * v.x); -expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); -} -vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; -return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ -vec4 positionEC = czm_modelViewRelativeToEye * position; -vec4 prevEC = czm_modelViewRelativeToEye * previous; -vec4 nextEC = czm_modelViewRelativeToEye * next; -return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var ez=`${Ru} -${IW}`,Fve=Ax;At.isInternetExplorer()||(ez=`#define CLIP_POLYLINE -${ez}`);function qx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=qx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,ez),this._fragmentShaderSource=y(e.fragmentShaderSource,Fve),this._renderState=oo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(qx.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}}});qx.VERTEX_FORMAT=we.POSITION_ONLY;qx.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;qx.prototype.isTranslucent=oo.prototype.isTranslucent;qx.prototype.getRenderState=oo.prototype.getRenderState;var ts=qx;var T$t=S(T(),1);var l$t=S(T(),1),XW=`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 d$t=S(T(),1),$x=`#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 tz=`${Ru} -${XW}`,Ave=$x;At.isInternetExplorer()||(tz=`#define CLIP_POLYLINE -${tz}`);function e_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=e_.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,tz),this._fragmentShaderSource=y(e.fragmentShaderSource,Ave),this._renderState=oo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(e_.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}}});e_.VERTEX_FORMAT=we.POSITION_AND_ST;e_.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;e_.prototype.isTranslucent=oo.prototype.isTranslucent;e_.prototype.getRenderState=oo.prototype.getRenderState;var fa=e_;function Yp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new fa),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Bn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(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=Qoe(!1),this._renderState3DTiles=Qoe(!0),this._renderStateMorph=Oe.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Yp.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}}});Yp.initializeTerrainHeights=function(){return mi.initialize()};function Mve(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(WW);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(EW);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(RW),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],d="",m="";l(n.material)?(m=l(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),m.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],b=new De({defines:u,sources:[s]}),h=new De({defines:p,sources:[m,c]});e._sp=qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:b,fragmentShaderSource:h,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new De({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:h,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let C=new De({defines:u.concat([`MAX_TERRAIN_HEIGHT ${mi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(GW);let V=new De({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function Qoe(e){return Oe.fromCache({cull:{enabled:!0},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},backFunction:On.EQUAL,backOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function Nve(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof ts?{}:n._uniforms,d=s._batchTable.getUniformMapCallback()(u);for(let m=0;m{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Yp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Yp.isSupported=function(e){return e.frameState.context.depthTexture};Yp.prototype.isDestroyed=function(){return!1};Yp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,de(this)};var Bm=Yp;var Sen=S(T(),1);var hen=S(T(),1);var aen=S(T(),1);var kve=new B(1,1),Dve=!1,Bve=Y.WHITE;function zC(e){e=y(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(zC.prototype,{isConstant:{get:function(){return J.isConstant(this._image)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});zC.prototype.getType=function(e){return"Image"};zC.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=J.getValueOrUndefined(this._image,e),t.repeat=J.getValueOrClonedDefault(this._repeat,e,kve,t.repeat),t.color=J.getValueOrClonedDefault(this._color,e,Bve,t.color),J.getValueOrDefault(this._transparent,e,Dve)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};zC.prototype.equals=function(e){return this===e||e instanceof zC&&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 mg=zC;function Ove(e){if(e instanceof Y)return new zt(e);if(typeof e=="string"||e instanceof We||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new mg;return t.image=e,t}}function Yve(e,t){return me(e,t,Ove)}var Fo=Yve;function PW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(PW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:Fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});PW.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 PW(this)};PW.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var t_=PW;var Nen=S(T(),1);var Cen=S(T(),1),Kve={FIXED:0,INERTIAL:1},so=Object.freeze(Kve);var Ien=S(T(),1);function HC(){he.throwInstantiationError()}Object.defineProperties(HC.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});HC.prototype.getValue=he.throwInstantiationError;HC.prototype.getValueInReferenceFrame=he.throwInstantiationError;HC.prototype.equals=he.throwInstantiationError;var nz=new $;HC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new f),n===i)return f.clone(t,o);let r=Vt.computeIcrfToFixedMatrix(e,nz);if(l(r)||(r=Vt.computeTemeToPseudoFixedMatrix(e,nz)),n===so.INERTIAL)return $.multiplyByVector(r,t,o);if(n===so.FIXED)return $.multiplyByVector($.transpose(r,nz),t,o)};var Kp=HC;function n_(e,t){this._definitionChanged=new be,this._value=f.clone(e),this._referenceFrame=y(t,so.FIXED)}Object.defineProperties(n_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===so.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});n_.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,so.FIXED,t)};n_.prototype.setValue=function(e,t){let n=!1;f.equals(this._value,e)||(n=!0,this._value=f.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};n_.prototype.getValueInReferenceFrame=function(e,t,n){return Kp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};n_.prototype.equals=function(e){return this===e||e instanceof n_&&f.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var ol=n_;var Ken=S(T(),1);function vW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:Fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});vW.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 vW(this)};vW.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var i_=vW;var Jen=S(T(),1);function zve(e){return e}function Hve(e,t){return me(e,t,zve)}var Ul=Hve;var ntn=S(T(),1);function wW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:Fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});wW.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 wW(this)};wW.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var o_=wW;var ltn=S(T(),1);function FW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(FW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:Fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});FW.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 FW(this)};FW.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var r_=FW;var btn=S(T(),1);function AW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(AW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:Fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});AW.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 AW(this)};AW.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var s_=AW;var Ttn=S(T(),1);function MW(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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(MW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});MW.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 MW(this)};MW.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Om=MW;var qtn=S(T(),1);var Ftn=S(T(),1);var Gtn=S(T(),1);var Jve=new f(1,1,1),Qve=f.ZERO,jve=Pe.IDENTITY;function qoe(e,t,n){this.translation=f.clone(y(e,Qve)),this.rotation=Pe.clone(y(t,jve)),this.scale=f.clone(y(n,Jve))}qoe.prototype.equals=function(e){return this===e||l(e)&&f.equals(this.translation,e.translation)&&Pe.equals(this.rotation,e.rotation)&&f.equals(this.scale,e.scale)};var fg=qoe;var iz=new fg;function NW(e){e=y(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(NW.prototype,{isConstant:{get:function(){return J.isConstant(this._translation)&&J.isConstant(this._rotation)&&J.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});NW.prototype.getValue=function(e,t){return l(t)||(t=new fg),t.translation=J.getValueOrClonedDefault(this._translation,e,iz.translation,t.translation),t.rotation=J.getValueOrClonedDefault(this._rotation,e,iz.rotation,t.rotation),t.scale=J.getValueOrClonedDefault(this._scale,e,iz.scale,t.scale),t};NW.prototype.equals=function(e){return this===e||e instanceof NW&&J.equals(this._translation,e._translation)&&J.equals(this._rotation,e._rotation)&&J.equals(this._scale,e._scale)};var a_=NW;var Otn=S(T(),1);function zp(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(zp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};QC.prototype.getValue=function(e,t){let n=J.getValueOrDefault(this._heightReference,e,je.NONE),i=J.getValueOrDefault(this._extrudedHeightReference,e,je.NONE);if(n===je.NONE&&!XC(i))return this._position=f.clone(f.ZERO,this._position),f.clone(f.ZERO,t);if(this._positionProperty.isConstant)return f.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,ire);if(!l(r)||f.equals(r,f.ZERO)||!l(o.globe))return f.clone(f.ZERO,t);if(f.equalsEpsilon(this._position,r,X.EPSILON10))return f.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=f.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return f.multiplyByScalar(s,this._terrainHeight,t)};QC.prototype.isDestroyed=function(){return!1};QC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var d_=QC;function pwe(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new zm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new d_(this._scene,s,r)}}var jp=pwe;var ore=f.ZERO,rre=new f,bwe=new f,sre=new Y;function gwe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Gu(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new gwe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Gu.prototype=Object.create(oi.prototype),Gu.prototype.constructor=Gu);Object.defineProperties(Gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=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,sre)),l(a)||(a=Y.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=qi.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ore,rre))),new Rt({id:t,geometry:Al.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Gu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,sre),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=qi.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ore,rre))),new Rt({id:t,geometry:Mm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Gu.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Gu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||oi.prototype._isHidden.call(this,e,t)};Gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};Gu.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ke.MINIMUM_VALUE,je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?fn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ke.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==je.NONE?mn.ALL:void 0};Gu.prototype._onEntityPropertyChanged=jp;Gu.DynamicGeometryUpdater=jC;function jC(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(jC.prototype=Object.create(ii.prototype),jC.prototype.constructor=jC);jC.prototype._isHidden=function(e,t,n){let i=J.getValueOrUndefined(e.position,n,bwe),o=this._options.dimensions;return!l(i)||!l(o)||ii.prototype._isHidden.call(this,e,t,n)};jC.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,je.NONE),o=this._options;o.dimensions=J.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==je.NONE?mn.ALL:void 0};var jW=Gu;var RHn=S(T(),1);var bHn=S(T(),1);var orn=S(T(),1),cre=S(are(),1);var ywe=0,cz={};function gh(e,t){let n,i=e;l(cz[i])?n=cz[i]:(n=ywe++,cz[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(gh.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=cre.default.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 (textureSize.y / textureSize.x)) -{ -mipLevel = 1.0; -if (uv.y - pixel.y > yMipLevel1) -{ -mipLevel = 2.0; -if (uv.y - pixel.y * 3.0 > yMipLevel2) -{ -mipLevel = 3.0; -if (uv.y - pixel.y * 5.0 > yMipLevel3) -{ -mipLevel = 4.0; -if (uv.y - pixel.y * 7.0 > yMipLevel4) -{ -mipLevel = 5.0; -} -} -} -} -} -if (mipLevel > 0.0) -{ -float scale = pow(2.0, mipLevel); -uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); -uv.x *= ((textureSize.x - 2.0) / textureSize.y); -uv.x -= 1.0 + pixel.x; -uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); -uv *= scale; -} -else -{ -uv.x *= (textureSize.x / textureSize.y); -} -if(mipLevel == 0.0) -{ -out_FragColor = texture(texture0, uv); -} -else if(mipLevel == 1.0) -{ -out_FragColor = texture(texture1, uv); -} -else if(mipLevel == 2.0) -{ -out_FragColor = texture(texture2, uv); -} -else if(mipLevel == 3.0) -{ -out_FragColor = texture(texture3, uv); -} -else if(mipLevel == 4.0) -{ -out_FragColor = texture(texture4, uv); -} -else if(mipLevel == 5.0) -{ -out_FragColor = texture(texture5, uv); -} -else -{ -out_FragColor = vec4(0.0); -} -} -`;var prn=S(T(),1),f_=`in vec3 v_cubeMapCoordinates; -uniform samplerCube cubeMap; -void main() -{ -vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); -#ifdef RGBA_NORMALIZED -out_FragColor = vec4(rgba.rgb, 1.0); -#else -float m = rgba.a * 16.0; -vec3 r = rgba.rgb * m; -out_FragColor = vec4(r * r, 1.0); -#endif -} -`;var grn=S(T(),1),h_=`in vec4 position; -in vec3 cubeMapCoordinates; -out vec3 v_cubeMapCoordinates; -void main() -{ -gl_Position = position; -v_cubeMapCoordinates = cubeMapCoordinates; -} -`;function p_(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(p_.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}}});p_.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var _we=new f(1,0,0),Swe=new f(0,0,1),Twe=new f(-1,0,0),Cwe=new f(0,0,-1),D5=new f(0,1,0),Vwe=new f(0,-1,0),mre=[D5,Twe,Swe,Vwe,_we,D5,Cwe,D5,D5],fre=mre.length,hre=new Float32Array(fre*3),ure=0;for(let e=0;e0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function Gwe(e,t){if(Hm.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new Hm(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}qW.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;B.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=B.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),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._specularEnvironmentMapAtlasDirty&&(Gwe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentMapAtlas)&&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._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};qW.prototype.isDestroyed=function(){return!1};qW.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var b_=qW;var rsn=S(T(),1),dz=S(_u(),1);var jrn=S(T(),1);var uz,pre="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyYTI3ZDMxOS1mODc4LTQ5NzktOGUzNy04OTA0ZGI5MmM1NGIiLCJpZCI6MjU5LCJpYXQiOjE3MTk4NDM5OTN9.FDHD-mZOIAzA9J_kzOz6AkKK2PHzl2yoMbFqbpsfH6Q",B5={};B5.defaultAccessToken=pre;B5.defaultServer=new We({url:"https://api.cesium.com/"});B5.getDefaultTokenCredit=function(e){if(e===pre){if(!l(uz)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;uz=new Ct(t,!0)}return uz}};var Jm=B5;function sl(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Ewe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ue("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");We.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new dz.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)&&(sl.prototype=Object.create(We.prototype),sl.prototype.constructor=sl);sl.fromAssetId=function(e,t){let n=sl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new sl(i,n)})};Object.defineProperties(sl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=sl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});sl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=Jm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Ct.clone(i)),n};sl.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new sl(t._ionEndpoint,t._ionEndpointResource)),e=We.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};sl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return We.prototype.fetchImage.call(this,e)};sl.prototype._makeRequest=function(e){return this._isExternal||new dz.default(this.url).authority()!==this._ionEndpointDomain?We.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),We.prototype._makeRequest.call(this,e))};sl._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Jm.defaultServer),i=y(t.accessToken,Jm.defaultAccessToken);n=We.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function Ewe(e,t){let n=y(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 Eu=sl;var csn=S(T(),1);function yh(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(yh.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});yh.prototype.get=function(e){return this._array[e]};yh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};yh.prototype.peek=function(){return this._array[this._length-1]};yh.prototype.push=function(e){let t=this.length++;this._array[t]=e};yh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};yh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};yh.prototype.resize=function(e){this.length=e};yh.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var al=yh;var msn=S(T(),1);function O5(e){e=y(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}O5.ALL=Object.freeze(new O5({color:new Y(0,0,0,0),depth:1,stencil:0}));O5.prototype.execute=function(e,t){e.clear(this,t)};var ri=O5;var bsn=S(T(),1);var qp={X:0,Y:1,Z:2};qp.Y_UP_TO_Z_UP=v.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));qp.Z_UP_TO_Y_UP=v.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));qp.X_UP_TO_Z_UP=v.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));qp.Z_UP_TO_X_UP=v.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));qp.X_UP_TO_Y_UP=v.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));qp.Y_UP_TO_X_UP=v.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));qp.fromName=function(e){return qp[e]};var Ao=Object.freeze(qp);var XYn=S(T(),1);var Vsn=S(T(),1);function Xd(e){this.planes=y(e,[])}var $W=[new f,new f,new f];f.clone(f.UNIT_X,$W[0]);f.clone(f.UNIT_Y,$W[1]);f.clone(f.UNIT_Z,$W[2]);var hg=new f,Wwe=new f,bre=new on(new f(1,0,0),0);Xd.fromBoundingSphere=function(e,t){l(t)||(t=new Xd);let n=$W.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a>10)+55296,(r&1023)+56320))}return t};function eI(e,t,n){return t<=e&&e<=n}function vwe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c0){let o=Math.min(t,Mt.maximumTextureSize),r=Math.ceil(t/Mt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new B(o,r),i=new re(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Sc.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}}});Sc.DEFAULT_COLOR_VALUE=Y.WHITE;Sc.DEFAULT_SHOW_VALUE=!0;function xre(e){let t=e._textureDimensions;return t.x*t.y*4}function _re(e){if(!l(e._batchValues)){let t=xre(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Sre(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Sc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Sre(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=_re(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Sc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=xre(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=d.pop(),c[t]===u)continue;c[t]=u;let m=n(e,t);if(l(m))return m;let p=o[t],b=s[t];for(let h=0;h0?(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} -${sFe(i)}${s}`}};function Cre(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 aFe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u0?(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}};bo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=De.replaceMain(e,"tile_main"),Mt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function cFe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Bl.HIGHLIGHT)return 0;if(n===Bl.REPLACE)return 1;if(n===Bl.MIX)return X.clamp(i,X.EPSILON4,1)}bo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return ft(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return cFe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};bo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var gg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};bo.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=lFe(this);for(let u=t;u>>Yt.SKIP_LOD_BIT_SHIFT}function gFe(e){let t=Ue(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=hn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}function yFe(e){let t=Ue(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}bo.prototype.update=function(e,t){this._batchTexture.update(e,t)};bo.prototype.isDestroyed=function(){return!1};bo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var eb=bo;var Zln=S(T(),1);var pcn=S(T(),1);function xFe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var _h=xFe;var fln=S(T(),1);var gcn=S(T(),1),qC=`in vec3 position; -in float a_batchId; -uniform mat4 u_modifiedModelViewProjection; -void main() -{ -gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var Scn=S(T(),1);function vd(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(vd.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 Y),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)}}});vd.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};vd.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};vd.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};vd.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};vd.prototype.getPropertyInherited=function(e){return vd.getPropertyInherited(this._content,this._batchId,e)};vd.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};vd.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};vd.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};vd.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ys=vd;var Acn=S(T(),1);var Vcn=S(T(),1),pz=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)})}},bz=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)})}},Ol=class e{static get version(){return"1.3.9"}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.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&d(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length=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":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Ol.max_unop_len=Ol.getMaxKeyLen(Ol.unary_ops);Ol.max_binop_len=Ol.getMaxKeyLen(Ol.binary_ops);var yg=e=>new Ol(e).parse(),SFe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Ol).filter(e=>!SFe.includes(e)&&yg[e]===void 0).forEach(e=>{yg[e]=Ol[e]});yg.Jsep=Ol;var TFe="ConditionalExpression",CFe={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:TFe,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 :")}})}};yg.plugins.register(CFe);var Zcn=S(T(),1),VFe={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},_t=Object.freeze(VFe);function Qm(e,t){this._expression=e,e=AFe(e,t),e=NFe(MFe(e)),yg.addBinaryOp("=~",0),yg.addBinaryOp("!~",0);let n;try{n=yg(e)}catch(i){throw new ue(i)}this._runtimeAst=Vi(this,n)}Object.defineProperties(Qm.prototype,{expression:{get:function(){return this._expression}}});var An={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new B],cartesian3Array:[new f],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 B),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new f),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new re),this.cartesian4Array[this.cartesian4Index++]}};Qm.prototype.evaluate=function(e,t){An.reset();let n=this._runtimeAst.evaluate(e);return t instanceof Y&&n instanceof re?Y.fromCartesian4(n,t):n instanceof B||n instanceof f||n instanceof re?n.clone(t):n};Qm.prototype.evaluateColor=function(e,t){An.reset();let n=this._runtimeAst.evaluate(e);return Y.fromCartesian4(n,t)};Qm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Qm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Qm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var LFe=["!","-","+"],Zre=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],z5=/\${(.*?)}/g,ZFe=/\\/g,RFe="@#%",GFe=/@#%/g,H5=new Y,J5={abs:Ks(Math.abs),sqrt:Ks(Math.sqrt),cos:Ks(Math.cos),sin:Ks(Math.sin),tan:Ks(Math.tan),acos:Ks(Math.acos),asin:Ks(Math.asin),atan:Ks(Math.atan),radians:Ks(X.toRadians),degrees:Ks(X.toDegrees),sign:Ks(X.sign),floor:Ks(Math.floor),ceil:Ks(Math.ceil),round:Ks(Math.round),exp:Ks(Math.exp),exp2:Ks(WFe),log:Ks(Math.log),log2:Ks(IFe),fract:Ks(EFe),length:XFe,normalize:PFe},Q5={atan2:Y5(Math.atan2,!1),pow:Y5(Math.pow,!1),min:Y5(Math.min,!0),max:Y5(Math.max,!0),distance:vFe,dot:wFe,cross:FFe},xz={clamp:Rre(X.clamp,!0),mix:Rre(X.lerp,!0)};function EFe(e){return e-Math.floor(e)}function WFe(e){return Math.pow(2,e)}function IFe(e){return X.log2(e)}function Ks(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof B)return B.fromElements(e(n.x),e(n.y),An.getCartesian2());if(n instanceof f)return f.fromElements(e(n.x),e(n.y),e(n.z),An.getCartesian3());if(n instanceof re)return re.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),An.getCartesian4());throw new ue(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function Y5(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof B)return B.fromElements(e(i.x,o),e(i.y,o),An.getCartesian2());if(i instanceof f)return f.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),An.getCartesian3());if(i instanceof re)return re.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),An.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof B&&o instanceof B)return B.fromElements(e(i.x,o.x),e(i.y,o.y),An.getCartesian2());if(i instanceof f&&o instanceof f)return f.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),An.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),An.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Rre(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 B&&o instanceof B)return B.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),An.getCartesian2());if(i instanceof f&&o instanceof f)return f.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),An.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),An.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof B&&o instanceof B&&r instanceof B)return B.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),An.getCartesian2());if(i instanceof f&&o instanceof f&&r instanceof f)return f.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),An.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),An.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function XFe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof B)return B.magnitude(t);if(t instanceof f)return f.magnitude(t);if(t instanceof re)return re.magnitude(t);throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function PFe(e,t){if(typeof t=="number")return 1;if(t instanceof B)return B.normalize(t,An.getCartesian2());if(t instanceof f)return f.normalize(t,An.getCartesian3());if(t instanceof re)return re.normalize(t,An.getCartesian4());throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function vFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof B&&n instanceof B)return B.distance(t,n);if(t instanceof f&&n instanceof f)return f.distance(t,n);if(t instanceof re&&n instanceof re)return re.distance(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function wFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof B&&n instanceof B)return B.dot(t,n);if(t instanceof f&&n instanceof f)return f.dot(t,n);if(t instanceof re&&n instanceof re)return re.dot(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function FFe(e,t,n){if(t instanceof f&&n instanceof f)return f.cross(t,n,An.getCartesian3());throw new ue(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Lt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,JFe(this)}function AFe(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 MFe(e){return e.replace(ZFe,RFe)}function yz(e){return e.replace(GFe,"\\")}function NFe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new Lt(_t.VARIABLE_IN_STRING,e.value):new Lt(_t.LITERAL_STRING,yz(e.value))}function kFe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ue(`${o} is not a function.`);return i===0?o==="test"?new Lt(_t.LITERAL_BOOLEAN,!1):new Lt(_t.LITERAL_NULL,null):(s=Vi(e,c),a=Vi(e,n[0]),new Lt(_t.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Vi(e,c),new Lt(_t.FUNCTION_CALL,o,r);throw new ue(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Lt(_t.LITERAL_COLOR,o);if(r=Vi(e,n[0]),l(n[1])){let c=Vi(e,n[1]);return new Lt(_t.LITERAL_COLOR,o,[r,c])}return new Lt(_t.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ue(`${o} requires three arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2])],new Lt(_t.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ue(`${o} requires four arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2]),Vi(e,n[3])],new Lt(_t.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new ue(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Lt(_t.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ue(`${o} does not take any argument.`);return new Lt(_t.UNARY,o)}else if(l(J5[o])){if(i!==1)throw new ue(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Lt(_t.UNARY,o,r)}else if(l(Q5[o])){if(i!==2)throw new ue(`${o} requires exactly two arguments.`);return s=Vi(e,n[0]),a=Vi(e,n[1]),new Lt(_t.BINARY,o,s,a)}else if(l(xz[o])){if(i!==3)throw new ue(`${o} requires exactly three arguments.`);s=Vi(e,n[0]),a=Vi(e,n[1]);let c=Vi(e,n[2]);return new Lt(_t.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Lt(_t.LITERAL_BOOLEAN,!1):(r=Vi(e,n[0]),new Lt(_t.UNARY,o,r));if(o==="Number")return i===0?new Lt(_t.LITERAL_NUMBER,0):(r=Vi(e,n[0]),new Lt(_t.UNARY,o,r));if(o==="String")return i===0?new Lt(_t.LITERAL_STRING,""):(r=Vi(e,n[0]),new Lt(_t.UNARY,o,r));if(o==="regExp")return DFe(e,t)}}throw new ue(`Unexpected function call "${o}".`)}function DFe(e,t){let n=t.arguments;if(n.length===0)return new Lt(_t.LITERAL_REGEX,new RegExp);let i=Vi(e,n[0]),o;if(n.length>1){let r=Vi(e,n[1]);if(gz(i)&&gz(r)){try{o=new RegExp(yz(String(i._value)),r._value)}catch(s){throw new ue(s)}return new Lt(_t.LITERAL_REGEX,o)}return new Lt(_t.REGEX,i,r)}if(gz(i)){try{o=new RegExp(yz(String(i._value)))}catch(r){throw new ue(r)}return new Lt(_t.LITERAL_REGEX,o)}return new Lt(_t.REGEX,i)}function BFe(e){if(zFe(e.name)){let t=HFe(e.name);return t.substr(0,8)==="tiles3d_"?new Lt(_t.BUILTIN_VARIABLE,t):new Lt(_t.VARIABLE,t)}else{if(e.name==="NaN")return new Lt(_t.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Lt(_t.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Lt(_t.LITERAL_UNDEFINED,void 0)}throw new ue(`${e.name} is not defined.`)}function OFe(e){let t=e.property.name;if(t==="PI")return new Lt(_t.LITERAL_NUMBER,Math.PI);if(t==="E")return new Lt(_t.LITERAL_NUMBER,Math.E)}function YFe(e){if(e.property.name==="POSITIVE_INFINITY")return new Lt(_t.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function KFe(e,t){if(t.object.name==="Math")return OFe(t);if(t.object.name==="Number")return YFe(t);let n,i=Vi(e,t.object);return t.computed?(n=Vi(e,t.property),new Lt(_t.MEMBER,"brackets",i,n)):(n=new Lt(_t.LITERAL_STRING,t.property.name),new Lt(_t.MEMBER,"dot",i,n))}function gz(e){return e._type>=_t.LITERAL_NULL}function zFe(e){return e.substr(0,4)==="czm_"}function HFe(e){return e.substr(4)}function Vi(e,t){let n,i,o,r;if(t.type==="Literal")n=UFe(t);else if(t.type==="CallExpression")n=kFe(e,t);else if(t.type==="Identifier")n=BFe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Vi(e,t.argument);if(LFe.indexOf(i)>-1)n=new Lt(_t.UNARY,i,s);else throw new ue(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),Zre.indexOf(i)>-1)n=new Lt(_t.BINARY,i,o,r);else throw new ue(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),Zre.indexOf(i)>-1&&(n=new Lt(_t.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 Lt(_t.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=KFe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?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(Q5[e._value])&&(e.evaluate=qFe(e._value)):e._type===_t.TERNARY?e.evaluate=$Fe(e._value):e._type===_t.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===_t.ARRAY?e.evaluate=e._evaluateArray:e._type===_t.VARIABLE?e.evaluate=e._evaluateVariable:e._type===_t.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===_t.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===_t.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===_t.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===_t.REGEX?e.evaluate=e._evaluateRegExp:e._type===_t.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=QFe):e.evaluate=e._evaluateLiteral}function QFe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function jFe(e){let t=J5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function qFe(e){let t=Q5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function $Fe(e){let t=xz[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 j5(e,t){if(l(e))return e.getPropertyInherited(t)}Lt.prototype._evaluateLiteral=function(){return this._value};Lt.prototype._evaluateLiteralColor=function(e){let t=H5,n=this._left;if(this._value==="color")l(n)?n.length>1?(Y.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):Y.fromCssColorString(n[0].evaluate(e),t):Y.fromBytes(255,255,255,255,t);else if(this._value==="rgb")Y.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;Y.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return re.fromColor(t,An.getCartesian4())};Lt.prototype._evaluateLiteralVector=function(e){let t=An.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new ue(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ue(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return B.fromArray(t,0,An.getCartesian2());if(n==="vec3")return f.fromArray(t,0,An.getCartesian3());if(n==="vec4")return re.fromArray(t,0,An.getCartesian4())};Lt.prototype._evaluateLiteralString=function(){return this._value};Lt.prototype._evaluateVariableString=function(e){let t=this._value,n=z5.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=j5(e,o);l(r)||(r=""),t=t.replace(i,r),n=z5.exec(t)}return t};Lt.prototype._evaluateVariable=function(e){return j5(e,this._value)};function x_(e){return e._value==="feature"}Lt.prototype._evaluateMemberDot=function(e){if(x_(this._left))return j5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof B||t instanceof f||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]};Lt.prototype._evaluateMemberBrackets=function(e){if(x_(this._left))return j5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof B||t instanceof f||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]};Lt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Lt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Lt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Lt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Lt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.add(t,n,An.getCartesian2());if(n instanceof f&&t instanceof f)return f.add(t,n,An.getCartesian3());if(n instanceof re&&t instanceof re)return re.add(t,n,An.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ue(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.subtract(t,n,An.getCartesian2());if(n instanceof f&&t instanceof f)return f.subtract(t,n,An.getCartesian3());if(n instanceof re&&t instanceof re)return re.subtract(t,n,An.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ue(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.multiplyComponents(t,n,An.getCartesian2());if(n instanceof B&&typeof t=="number")return B.multiplyByScalar(n,t,An.getCartesian2());if(t instanceof B&&typeof n=="number")return B.multiplyByScalar(t,n,An.getCartesian2());if(n instanceof f&&t instanceof f)return f.multiplyComponents(t,n,An.getCartesian3());if(n instanceof f&&typeof t=="number")return f.multiplyByScalar(n,t,An.getCartesian3());if(t instanceof f&&typeof n=="number")return f.multiplyByScalar(t,n,An.getCartesian3());if(n instanceof re&&t instanceof re)return re.multiplyComponents(t,n,An.getCartesian4());if(n instanceof re&&typeof t=="number")return re.multiplyByScalar(n,t,An.getCartesian4());if(t instanceof re&&typeof n=="number")return re.multiplyByScalar(t,n,An.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ue(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.divideComponents(t,n,An.getCartesian2());if(t instanceof B&&typeof n=="number")return B.divideByScalar(t,n,An.getCartesian2());if(n instanceof f&&t instanceof f)return f.divideComponents(t,n,An.getCartesian3());if(t instanceof f&&typeof n=="number")return f.divideByScalar(t,n,An.getCartesian3());if(n instanceof re&&t instanceof re)return re.divideComponents(t,n,An.getCartesian4());if(t instanceof re&&typeof n=="number")return re.divideByScalar(t,n,An.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ue(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.fromElements(t.x%n.x,t.y%n.y,An.getCartesian2());if(n instanceof f&&t instanceof f)return f.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,An.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,An.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ue(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof B&&t instanceof B||n instanceof f&&t instanceof f||n instanceof re&&t instanceof re?t.equals(n):t===n};Lt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof B&&t instanceof B||n instanceof f&&t instanceof f||n instanceof re&&t instanceof re?!t.equals(n):t!==n};Lt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ue(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Lt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Lt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Lt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Lt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Lt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Lt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Lt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ue(o)}return i};Lt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Lt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ue(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ue(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Lt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof B||t instanceof f||t instanceof re)return String(t);throw new ue(`Unexpected function call "${this._value}".`)};function Gre(e){let t=e._left,n=t.length;for(let a=0;a1){let p=u[0],b=u[1];return b!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${b})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Ere(this),l(i)?K5(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Ere(this),l(i)?K5(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Gre(this),l(i)?K5(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Gre(this),l(i)?(i.alpha!==1&&(t.translucent=!0),K5(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case _t.LITERAL_VECTOR:d=o.length,m=`${c}(`;for(let p=0;p0;){let d=t.pop();if(Y.equals(d.color,a.color))u=_z(n,s,u,i,o,d.batchIds,r),a.batchIds=a.batchIds.concat(d.batchIds),a.count=u-a.offset;else{let m=u;u=_z(n,s,u,i,o,d.batchIds,r),d.offset=m,d.count=u-m,c.push(d),a=d}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function Sz(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u0;){let m=t.pop();if(Y.equals(m.color,r.color))u=Sz(a,c,u,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=u-r.offset;else{let p=u;u=Sz(a,c,u,n,i,m.batchIds,o),m.offset=p,m.count=u-p,s.push(m),r=m}}let d=e._va;e._va=e._vaSwap,e._vaSwap=d,e._batchedIndices=s}function uAe(e,t){return t.color.toRgba()-e.color.toRgba()}function dAe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=x&&s{e.isDestroyed()||(e._error=h)}):void 0}}function RAe(e){l(e._primitive)||(e._primitive=new S_({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:y(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)}Iu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Iu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Iu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Iu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Iu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=ZAe(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)};Iu.prototype.isDestroyed=function(){return!1};Iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var nb=Iu;function Sh(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,WAe(this,i,o)}Object.defineProperties(Sh.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 GAe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function EAe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),d=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,u)}if(d>0&&l(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,d)}let m=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||d>0&&!l(r);if(m&&p)throw new ue("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let h=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(u),s=0;s0)for(r=new Uint16Array(d),s=0;s0&&(b=Zo(i,n,u),n+=u,d>0&&(h=new Uint8Array(t,n,d),h=new Uint8Array(h)));let x=y(m.BOXES_LENGTH,0),_=y(m.CYLINDERS_LENGTH,0),C=y(m.ELLIPSOIDS_LENGTH,0),V=y(m.SPHERES_LENGTH,0),L=x+_+C+V,R=new eb(e,L,b,h,GAe(e));if(e._batchTable=R,L===0)return;let G=e.tile.computedTransform,W;l(m.RTC_CENTER)&&(W=f.unpack(m.RTC_CENTER),v.multiplyByPoint(G,W,W));let w=EAe(m,p);if(x>0||_>0||C>0||V>0){let P,F,M,g;if(x>0){let Z=p.byteOffset+m.BOXES.byteOffset;P=new Float32Array(p.buffer,Z,nb.packedBoxLength*x)}if(_>0){let Z=p.byteOffset+m.CYLINDERS.byteOffset;F=new Float32Array(p.buffer,Z,nb.packedCylinderLength*_)}if(C>0){let Z=p.byteOffset+m.ELLIPSOIDS.byteOffset;M=new Float32Array(p.buffer,Z,nb.packedEllipsoidLength*C)}if(V>0){let Z=p.byteOffset+m.SPHERES.byteOffset;g=new Float32Array(p.buffer,Z,nb.packedSphereLength*V)}return e._geometries=new nb({boxes:P,boxBatchIds:w.boxes,cylinders:F,cylinderBatchIds:w.cylinders,ellipsoids:M,ellipsoidBatchIds:w.ellipsoids,spheres:g,sphereBatchIds:w.spheres,center:W,modelMatrix:G,batchTable:R,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function wre(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}}Sh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Sh.prototype.getFeature=function(e){return wre(this),this._features[e]};Sh.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Sh.prototype.applyStyle=function(e){wre(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Sh.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)};Sh.prototype.pick=function(e,t,n){};Sh.prototype.isDestroyed=function(){return!1};Sh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var oI=Sh;var ggn=S(T(),1);var Nln=S(T(),1);var Tz={};Tz.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),Fre(i,o,r,s);return c};Tz.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>>0,Cz=2*C_+1,_g=4,Nre=[],Ure=[],PAe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Sg=1,e1=2,q5=[Sg,0,0,Sg|e1];function ns(e){if(!At.supportsBigInt())throw new ue("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(Cz)>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(BAe(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 C_-(t>>1)};ns.prototype.getChild=function(e){let t=Bre(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ns(n)};ns.prototype.getParent=function(){let e=Bre(this._cellId)<>1&1;return Dre(i[0],o[0][r^n&1],o[1][r])}function FAe(e,t){let n=kre(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,d=(r<<1)+c;return[i,u,d]}function kre(e){Nre.length===0&&UAe();let t=Number(e>>BigInt(Cz)),n=t&Sg,i=(1<<_g)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?C_-7*_g:_g))-1;n+=Number(e>>BigInt(s*2*_g+1)&BigInt(c))<<2,n=Ure[n];let u=s*_g;o+=n>>_g+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Are(e){return 1/XAe*e}function MAe(e,t){let n=[[],[]],i=NAe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=$5(Mre(r)),n[o][1]=$5(Mre(s))}return n}function NAe(e){return 1<>>0}function Mre(e){return 1/IAe*e}function Tg(e,t,n,i,o,r){if(e===_g){let s=(t<<_g)+n;Nre[(s<<2)+i]=(o<<2)+r,Ure[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=PAe[r];Tg(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^q5[0]),Tg(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^q5[1]),Tg(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^q5[2]),Tg(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^q5[3])}}function UAe(){Tg(0,0,0,0,0,0),Tg(0,0,0,Sg,0,Sg),Tg(0,0,0,e1,0,e1),Tg(0,0,0,Sg|e1,0,Sg|e1)}function Bre(e){return e&~e+BigInt(1)}function kAe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(Vz.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Vz.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 t1=Vz;var oun=S(T(),1);function ob(e){e=y(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(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 this._metadataTable.hasProperty(e)};ob.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};ob.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};ob.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};ob.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};ob.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};ob.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var n1=ob;var sun=S(T(),1);var eU={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};eU.getBranchingFactor=function(e){switch(e){case eU.OCTREE:return 8;case eU.QUADTREE:return 4}};var is=Object.freeze(eU);var bun=S(T(),1);var dun=S(T(),1);function ha(){}Object.defineProperties(ha.prototype,{class:{get:function(){he.throwInstantiationError()}}});ha.prototype.hasProperty=function(e){he.throwInstantiationError()};ha.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};ha.prototype.getPropertyIds=function(e){he.throwInstantiationError()};ha.prototype.getProperty=function(e){he.throwInstantiationError()};ha.prototype.setProperty=function(e,t){he.throwInstantiationError()};ha.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};ha.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};ha.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))};ha.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ha.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};ha.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=Ue(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ha.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};ha.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ha.getProperty(o.id,t,n)};ha.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ha.setProperty(r.id,t,n,i):!1};var kn=ha;function rb(e){e=y(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(rb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});rb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};rb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};rb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};rb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};rb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};rb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};rb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var rI=rb;var adn=S(T(),1);var edn=S(T(),1);var Sun=S(T(),1);var Ut={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Ut.getMinimum=function(e){switch(e){case Ut.INT8:return-128;case Ut.UINT8:return 0;case Ut.INT16:return-32768;case Ut.UINT16:return 0;case Ut.INT32:return-2147483648;case Ut.UINT32:return 0;case Ut.INT64:return At.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Ut.UINT64:return At.supportsBigInt()?BigInt(0):0;case Ut.FLOAT32:return-34028234663852886e22;case Ut.FLOAT64:return-Number.MAX_VALUE}};Ut.getMaximum=function(e){switch(e){case Ut.INT8:return 127;case Ut.UINT8:return 255;case Ut.INT16:return 32767;case Ut.UINT16:return 65535;case Ut.INT32:return 2147483647;case Ut.UINT32:return 4294967295;case Ut.INT64:return At.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Ut.UINT64:return At.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Ut.FLOAT32:return 34028234663852886e22;case Ut.FLOAT64:return Number.MAX_VALUE}};Ut.isIntegerType=function(e){switch(e){case Ut.INT8:case Ut.UINT8:case Ut.INT16:case Ut.UINT16:case Ut.INT32:case Ut.UINT32:case Ut.INT64:case Ut.UINT64:return!0;default:return!1}};Ut.isUnsignedIntegerType=function(e){switch(e){case Ut.UINT8:case Ut.UINT16:case Ut.UINT32:case Ut.UINT64:return!0;default:return!1}};Ut.isVectorCompatible=function(e){switch(e){case Ut.INT8:case Ut.UINT8:case Ut.INT16:case Ut.UINT16:case Ut.INT32:case Ut.UINT32:case Ut.FLOAT32:case Ut.FLOAT64:return!0;default:return!1}};Ut.normalize=function(e,t){return Math.max(Number(e)/Number(Ut.getMaximum(t)),-1)};Ut.unnormalize=function(e,t){let n=Ut.getMaximum(t),i=Ut.isUnsignedIntegerType(t)?0:-n;return e=X.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Ut.INT64||t===Ut.UINT64)&&At.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;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)};Da.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!zre(e,t))return e};function zre(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Da.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=jt.getMathType(this._type),i=this._isArray,o=jt.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};Da.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?HAe(this,e):Hre(this,e)};function HAe(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;i1?Ore(e,t,n):void 0}if(edn.getMaximum(t))return Ore(e,t,n)}function Kre(e,t){return`value ${e} of type ${t} must be finite`}function Lz(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function rMe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<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 aMe(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)<96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x=3),c(n.exports.meshopt_spatialSortRemap,b,b.length/h,h*4)},encodeVertexBuffer:function(b,h,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(h,x);return u(n.exports.meshopt_encodeVertexBuffer,_,b,h,x)},encodeIndexBuffer:function(b,h,x){r(x==2||x==4),r(h%3==0);var _=m(b,x),C=n.exports.meshopt_encodeIndexBufferBound(h,d(_)+1);return u(n.exports.meshopt_encodeIndexBuffer,C,_,h,4)},encodeIndexSequence:function(b,h,x){r(x==2||x==4);var _=m(b,x),C=n.exports.meshopt_encodeIndexSequenceBound(h,d(_)+1);return u(n.exports.meshopt_encodeIndexSequence,C,_,h,4)},encodeGltfBuffer:function(b,h,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](b,h,x)},encodeFilterOct:function(b,h,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,b,h,x,_,16)},encodeFilterQuat:function(b,h,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,b,h,x,_,16)},encodeFilterExp:function(b,h,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2};return p(n.exports.meshopt_encodeFilterExp,b,h,x,_,x,C?V[C]:1)}}}();var Zdn=S(T()),$re=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",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(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L96?R-97:R>64?R-39:R+4}for(var G=0,L=0;L0?x(C,V,L,d[R],u[G]):s.then(function(){var W=new Uint8Array(C*V);return c(r,r.exports[d[R]],W,C,V,L,r.exports[u[G]]),W})}}}();var Edn=S(T()),Rdn=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq:f97sdbk:39si8Au8A99zu8Jjjjjbc;W;ab9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdndnamcdGmbcbhHxekasalcrfci4gecbyd;S1jjbHjjjjbbgOBdxasceBd2aOcbaez:ljjjbhAcbhlcbhednadTmbcbhlabheadhOinaAaeydbgCci4fgXaXRbbgXceaCcrGgCtV86bbaXcu7aC4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekasaecbyd;S1jjbHjjjjbbgHBdzascdBd2alcd4alfhCcehOinaOgecethOaeaC6mbkcdhzcbhQascuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbgCBdCasciBd2aCcFeaOz:ljjjbhLdnadTmbaecufhXcbhKinabaQcdtfgYydbgAc:v;t;h;Ev2hCcbhedndninaLaCaXGgCcdtfg8AydbgOcuSmeaHaOcdtfydbaASmdaecefgeaCfhCaeaX9nmbxdkkaHaKcdtfaABdba8AaKBdbaKhOaKcefhKkaYaOBdbaQcefgQad9hmbkkaLcbyd;O1jjbH:bjjjbbascdBd2kascxfazcdtfcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgEBdbasaEBdlasazceVgeBd2ascxfaecdtfcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbg3Bdbasa3BdwasazcdfgeBd2asclfabadalcbz:cjjjbascxfaecdtfcualcdtg5alcFFFFi0Eg8Ecbyd;S1jjbHjjjjbbgOBdbasazcifgeBd2ascxfaecdtfa8Ecbyd;S1jjbHjjjjbbg8FBdbasazclVgaBd2alcd4alfhXcehCinaCgecethCaeaX6mbkcbhKascxfaacdtfghcuaecdtgCaecFFFFi0Ecbyd;S1jjbHjjjjbbgXBdbasazcvVggBd2aXcFeaCz:ljjjbhQdnalTmbavcd4hAaecufhCinaKhednaHTmbaHaKcdtfydbhekaiaeaA2cdtfgeydlgXcH4aX7c:F:b:DD2aeydbgXcH4aX7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aCGheaKcdth8JdndndndndnaHTmbaHa8JfhYcbhXinaQaecdtfgLydbg8AcuSmlaiaHa8AcdtfydbaA2cdtfaiaYydbaA2cdtfcxz:ojjjbTmiaXcefgXaefaCGheaXaC9nmbxdkkaiaKaA2cdtfhYcbhXinaQaecdtfgLydbg8AcuSmiaia8AaA2cdtfaYcxz:ojjjbTmdaXcefgXaefaCGheaXaC9nmbkkcbhLkaLydbgecu9hmekaLaKBdbaKhekaOa8JfaeBdbaKcefgKal9hmbkcbhea8FhCinaCaeBdbaCclfhCalaecefge9hmbkcbheaOhCa8FhXindnaeaCydbgASmbaXa8FaAcdtfgAydbBdbaAaeBdbkaCclfhCaXclfhXalaecefge9hmbkkcbh8KaQcbyd;O1jjbH:bjjjbbasaaBd2ahalcbyd;S1jjbHjjjjbbgABdbasagBd2ascxfagcdtfa8Ecbyd;S1jjbHjjjjbbgeBdbasazcofgCBd2ascxfaCcdtfa8Ecbyd;S1jjbHjjjjbbgCBdbasazcrfg8LBd2aecFea5z:ljjjbh8MaCcFea5z:ljjjbh8NdnalTmba3cwfhyindnaEa8KgXcefg8Kcdtfydbg8AaEaXcdtgefydbgCSmba8AaC9Rh8Ja3aCcitfh5a8Naefhga8MaefhKcbhLindndna5aLcitfydbgQaX9hmbaKaXBdbagaXBdbxekdnaEaQcdtgafgeclfydbgCaeydbgeSmba3aecitg8AfydbaXSmeaCae9Rhhaecu7aCfhYaya8AfhCcbheinaYaeSmeaecefheaCydbh8AaCcwfhCa8AaX9hmbkaeah6meka8NaafgeaXaQaeydbcuSEBdbaKaQaXaKydbcuSEBdbkaLcefgLa8J9hmbkka8Kal9hmbkaOhCaHhLa8FhXa8Nh8Aa8MhQcbheindndnaeaCydbgY9hmbdnaqTmbaehYdnaHTmbaLydbhYkaqaYfRbbTmbaAaefcl86bbxdkdnaeaXydbgY9hmbaQydbhYdna8AydbgKcu9hmbaYcu9hmbaAaefcb86bbxikaAaefh8JdnaeaKSmbaeaYSmba8Jce86bbxika8Jcl86bbxdkdnaea8FaYcdtgKfydb9hmbdna8Aydbg8JcuSmbaea8JSmbaQydbg5cuSmbaea5Smba8NaKfydbgacuSmbaaaYSmba8MaKfydbgKcuSmbaKaYSmbdnaOa8JcdtfydbaOaKcdtfydb9hmbaOa5cdtfydbaOaacdtfydb9hmbaAaefcd86bbxlkaAaefcl86bbxikaAaefcl86bbxdkaAaefcl86bbxekaAaefaAaYfRbb86bbkaCclfhCaLclfhLaXclfhXa8Aclfh8AaQclfhQalaecefge9hmbkamceGTmbaAhealhCindnaeRbbce9hmbaecl86bbkaecefheaCcufgCmbkkascxfa8Lcdtfcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbggBdbasazcwVg8JBd2agaialavaHz:djjjbh8PdndnaDmbcbhvxekascxfa8JcdtfcualaD2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgvBdbasazcDVg8JBd2alTmbarcd4hYdnaHTmbaDcdthKcbhLavhQinaoaHaLcdtfydbaY2cdtfheawhCaQhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaQaKfhQaLcefgLal9hmbxdkkaYcdthYaDcdthKcbhQavhLinaoheawhCaLhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaoaYfhoaLaKfhLaQcefgQal9hmbkkascxfa8Jcdtfcualc8S2gealc;D;O;f8U0EgXcbyd;S1jjbHjjjjbbgCBdbasa8Jcefg8ABd2aCcbaez:ljjjbh8KdndndnaDTmbascxfa8AcdtfaXcbyd;S1jjbHjjjjbbgqBdbasa8JcdfgCBd2aqcbaez:ljjjb8AascxfaCcdtfcualaD2gecltgCaecFFFFb0Ecbyd;S1jjbHjjjjbbgwBdb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a8UNaXIdzaINaXIdaMgRaRMMa8UNaXIdla8SNaXIdCa8UNaXId3MgRaRMMa8SNaXIdbaINaXIdxa8SNaXIdKMgRaRMMaINaXId8KMMMh8WavaKaD2cdtfhCawaaaD2cltfheaXIdyh8XaDhXinaCIdbgRJbbb;aNaecxfIdba8UaecwfIdbNaIaeIdbNa8SaeclfIdbNMMMNaRaRNa8XNa8WMMh8WaCclfhCaeczfheaXcufgXmbka80a8W:lMh80a81a8R:lMh81ka5aLaKa81a809FgeEBdba8AaQaiaeEBdba8Ja81a80aeEUdbaYcefgYaE9hmbkasc;Wbfcbcj;abz:ljjjb8AaSheaEhCinasc;WbfaeydbcO4c;8ZGfgXaXydbcefBdbaecxfheaCcufgCmbkcbhecbhCinasc;WbfaefgXydbh8AaXaCBdba8AaCfhCaeclfgecj;ab9hmbkcbheaShCinasc;WbfaCydbcO4c;8ZGfgXaXydbgXcefBdbazaXcdtfaeBdbaCcxfhCaEaecefge9hmbkaoak9RgXci9Uh9hdnalTmbcbhea3hCinaCaeBdbaCclfhCalaecefge9hmbkkcbh9ia9ecbalz:ljjjbh6aXcO9Uh9ka9hce4h0asydwh9mcbhdcbh5dninahaza5cdtfydbcx2fg8JIdwg8RaB9Emeada9h9pmeJFFuuhRdna0aE9pmbahaza0cdtfydbcx2fIdwJbb;aZNhRkdna8RaR9ETmbada9k0mdkdna6aOa8Jydlg9ncdtg9ofydbg8Afg9pRbba6aOa8Jydbgicdtg9qfydbg9rfg9sRbbVmbdnaJa9rcdtfgeclfydbgCaeydbgeSmbaCae9RhQa9maecitfheaga8Acx2fgKcwfhyaKclfh8Eaga9rcx2fgacwfhmaaclfhrcbhCcehYdnindna3aeydbcdtfydbgXa8ASmba3aeclfydbcdtfydbgLa8ASmbaXaLSmbagaLcx2fgLIdbagaXcx2fgXIdbg8W:tgRarIdbaXIdlg8U:tg8XNaaIdba8W:tg8VaLIdla8U:tg8RN:tgIaRa8EIdba8U:tg8YNaKIdba8W:tg80a8RN:tg8UNa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NheindnaeydbgXcuSmbdnaCa3aXcdtg8AfydbgX9hmba8Na8AfydbhXkaeaXBdbkaeclfhealaCcefgC9hmbkkcbhdabhecbhLindna3aeydbcdtfydbgCa3aeclfydbcdtfydbgXSmbaCa3aecwfydbcdtfydbg8ASmbaXa8ASmbabadcdtfgQaCBdbaQcwfa8ABdbaQclfaXBdbadcifhdkaecxfheaLcifgLao6mbkadak9nmdxbkkasclfabadalaOz:cjjjbkdnaHTmbadTmbadheinabaHabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaca83:rNUdbkasyd2gecdtascxffc98fhOdninaeTmeaOydbcbyd;O1jjbH:bjjjbbaOc98fhOaecufhexbkkasc;W;abf8Kjjjjbadk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk;3Aowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd;S1jjbHjjjjbbgsBdCawciBd2dndnar:Zgz:rJbbbZMgH:lJbbb9p9DTmbaH:Ohexekcjjjj94hekaicufhOc:bwhAcbhCcbhXadhQinaChLaeaAgKcufaeaK9iEamgDcefaeaD9kEhYdndnadTmbaYcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbh3cbh5indnaEaxa5cdtfydbgAcm4aA7c:v;t;h;Ev2gics4ai7aOGgmcdtfgCydbgecuSmbaeaASmbcehiinaEamaifaOGgmcdtfgCydbgecuSmeaicefhiaeaA9hmbkkaCaABdba3aecuSfh3a5cefg5ad9hmbxdkkascFeaPz:ljjjb8Acbh3kaDaYa3ar0giEhmaLa3aiEhCdna3arSmbaYaKaiEgAam9Rcd9imbdndnaXcl0mbdnaQ:ZgHaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa3:Zghaz:tNNNaHaz:taaNa8Aah:tNa8Aaz:ta8FNahaH:tNM:va8EMJbbbZMgH:lJbbb9p9DTmbaH:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg5BdKawclBd2dndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhCavcd4hxdnadTmbdnalTmbaxcdthEa5hAalheaqhmadhOinaCaAydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaAclfhAaeaEfheamcxfhmaOcufgOmbxdkka5hmaqheadhAinaCamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaAcufgAmbkkdnaDTmbaChiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgH:vaHJbbbb9BEgHNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaicxfgmaHamIdbNUdbaiczfgmaHamIdbNUdbaicCfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbgEBd8KaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaCa5ydbgOc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aOcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc;Owkxebbbdbbbj9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(h){n=h.instance,n.exports.__wasm_call_ctors()});function o(h){for(var x=new Uint8Array(h.length),_=0;_96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_=3),r(C>=0&&C<=h.length),r(C%3==0),r(V>=0);for(var R=0,G=0;G<(L?L.length:0);++G)r(L[G]in b),R|=b[L[G]];var W=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),w=u(n.exports.meshopt_simplify,W,h.length,x,x.length/_,_*4,C,V,R);return w[0]=h instanceof Uint32Array?w[0]:new h.constructor(w[0]),w},simplifyWithAttributes:function(h,x,_,C,V,L,R,G,W,w){r(this.useExperimentalFeatures),r(h instanceof Uint32Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Int16Array),r(h.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(R==null||R.length==x.length),r(G>=0&&G<=h.length),r(G%3==0),r(W>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=16);for(var P=0,F=0;F<(w?w.length:0);++F)r(w[F]in b),P|=b[w[F]];var M=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),g=d(n.exports.meshopt_simplifyWithAttributes,M,h.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),R?new Uint8Array(R):null,G,W,P);return g[0]=h instanceof Uint32Array?g[0]:new h.constructor(g[0]),g},getScale:function(h,x){return r(h instanceof Float32Array),r(h.length%x==0),r(x>=3),m(n.exports.meshopt_simplifyScale,h,h.length/x,x*4)},simplifyPoints:function(h,x,_,C,V,L){return r(this.useExperimentalFeatures),r(h instanceof Float32Array),r(h.length%x==0),r(x>=3),r(_>=0&&_<=h.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(h.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,h,h.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,h,h.length/x,x*4,void 0,0,0,_)}}}();function L_(e){e=y(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,u=a.byteOffset,d=a.byteLength,m=!1,p,b,h,x;if(si(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,u=y(C.byteOffset,0),d=C.byteLength,m=!0,p=C.byteStride,b=C.count,h=C.mode,x=y(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=m,this._meshoptByteStride=p,this._meshoptCount=b,this._meshoptMode=h,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=_,this._bufferId=c,this._byteOffset=u,this._byteLength=d,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=vt.UNLOADED,this._promise=void 0}l(Object.create)&&(L_.prototype=Object.create(ao.prototype),L_.prototype.constructor=L_);Object.defineProperties(L_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function yMe(e){try{let t=xMe(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);$re.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=vt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=vt.FAILED,e.getError("Failed to load buffer view",t)}}L_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=yMe(this),this._promise)};function xMe(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})}L_.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var i1=L_;var tmn=S(T(),1);var Hdn=S(T(),1);function vr(){}vr._maxDecodingConcurrency=Math.max(At.hardwareConcurrency-1,1);vr._decoderTaskProcessor=void 0;vr._taskProcessorReady=!1;vr._error=void 0;vr._getDecoderTaskProcessor=function(){if(!l(vr._decoderTaskProcessor)){let e=new di("decodeDraco",vr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?vr._taskProcessorReady=!0:vr._error=new ue("Draco decoder could not be initialized.")}).catch(t=>{vr._error=t}),vr._decoderTaskProcessor=e}return vr._decoderTaskProcessor};vr.decodePointCloud=function(e){let t=vr._getDecoderTaskProcessor();if(l(vr._error))throw vr._error;if(vr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};vr.decodeBufferView=function(e){let t=vr._getDecoderTaskProcessor();if(l(vr._error))throw vr._error;if(vr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var ab=vr;function Lg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=vt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Lg.prototype=Object.create(ao.prototype),Lg.prototype.constructor=Lg);Object.defineProperties(Lg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function _Me(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=vt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;ese(e,n)}}Lg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=vt.LOADING,this._promise=_Me(this),this._promise)};function ese(e,t){throw e.unload(),e._state=vt.FAILED,e.getError("Failed to load Draco",t)}async function SMe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=vt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}Lg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.PROCESSING||(l(this._dracoError)&&ese(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=ab.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=SMe(this,c)};Lg.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};var o1=Lg;var pmn=S(T(),1);var smn=S(T(),1);function TMe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return We.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(We.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new We({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 cb=TMe;function lb(e){e=y(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,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=vt.UNLOADED,this._promise=void 0}l(Object.create)&&(lb.prototype=Object.create(ao.prototype),lb.prototype.constructor=lb);Object.defineProperties(lb.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});lb.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=CMe(this),this._promise):(this._promise=VMe(this),this._promise)};function tse(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 CMe(e){e._state=vt.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 ZMe(i);if(e.isDestroyed())return;let r=tse(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=vt.READY,e}catch(n){return e.isDestroyed()?void 0:nse(e,n,"Failed to load embedded image")}}async function VMe(e){e._state=vt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await GMe(i);if(e.isDestroyed())return;let r=tse(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=vt.READY,e}catch(o){return e.isDestroyed()?void 0:nse(e,o,`Failed to load image: ${n}`)}}function nse(e,t,n){return e.unload(),e._state=vt.FAILED,Promise.reject(e.getError(n,t))}function LMe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ue("Image format is not recognized")}async function ZMe(e){let t=LMe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ns(n)}return lb._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var RMe=/(^data:image\/ktx2)|(\.ktx2$)/i;function GMe(e){let t=e.getUrlComponent(!1,!0);return RMe.test(t)?Ns(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}lb.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};lb._loadImageFromTypedArray=cb;var r1=lb;var Emn=S(T(),1);var gmn=S(T(),1),EMe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ba=Object.freeze(EMe);function Zg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),d=y(e.loadTypedArray,!1),m=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=m,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=d,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=vt.UNLOADED,this._promise=void 0}l(Object.create)&&(Zg.prototype=Object.create(ao.prototype),Zg.prototype.constructor=Zg);Object.defineProperties(Zg.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 WMe=new Gz;Zg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=IMe(this),this._promise):(this._promise=XMe(this),this._promise)};async function IMe(e){e._state=vt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=vt.LOADED,e)}catch(n){if(e.isDestroyed())return;Rz(e,n)}}async function XMe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=vt.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=PMe(e,a),e._state=vt.PROCESSING,e}catch(s){if(e.isDestroyed())return;Rz(e,s)}}function PMe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=ke.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let m=r*a,p=new Uint8Array(c,u,m);c=new Uint8Array(p).buffer,u=0,po("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let d;return s===ke.UNSIGNED_BYTE?d=new Uint8Array(c,u,r):s===ke.UNSIGNED_SHORT?d=new Uint16Array(c,u,r):s===ke.UNSIGNED_INT&&(d=new Uint32Array(c,u,r)),d}function Rz(e,t){throw e.unload(),e._state=vt.FAILED,e.getError("Failed to load index buffer",t)}function Gz(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}Gz.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};Gz.prototype.execute=function(){this.buffer=ise(this.typedArray,this.indexDatatype,this.context)};function ise(e,t,n){let i=ut.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Zg.prototype.process=function(e){if(this._state===vt.READY)return!0;if(this._state!==vt.LOADED&&this._state!==vt.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){Rz(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=WMe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ba.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=ise(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=vt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Zg.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};var s1=Zg;var Upn=S(T(),1);var efn=S(T(),1);var Xmn=S(T(),1);function vMe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ls=vMe;var Nmn=S(T(),1);var wmn=S(T(),1);function wMe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var fr=wMe;function $t(){}$t.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}}};$t.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*Xu(t.type)}var Kl=AMe;function MMe(e){ve.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),ve.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),ve.mesh(e,function(n){ve.meshPrimitive(n,function(i){if(i.mode=y(i.mode,H.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Ls(e.materials,o)}})}),ve.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Kl(e,i),r.target=H.ARRAY_BUFFER}}),ve.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=H.ELEMENT_ARRAY_BUFFER}}),ve.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&ve.materialValue(n,function(c){l(c.index)&&Z_(c)}),Z_(n.emissiveTexture),Z_(n.normalTexture),Z_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),Z_(s.baseColorTexture),Z_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),Z_(a.specularGlossinessTexture))}),ve.animation(e,function(n){ve.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=NMe(e);return ve.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),ve.sampler(e,function(n){n.wrapS=y(n.wrapS,H.REPEAT),n.wrapT=y(n.wrapT,H.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function NMe(e){let t={};return ve.animation(e,function(n){ve.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 Z_(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var cI=MMe;var ofn=S(T(),1);function UMe(e){return ve.shader(e,function(t){nU(t)}),ve.buffer(e,function(t){nU(t)}),ve.image(e,function(t){nU(t)}),nU(e),e}function nU(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Rg=UMe;var _fn=S(T(),1);var dfn=S(T(),1);var afn=S(T(),1);function kMe(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 lI=kMe;function DMe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),lI(e,t),n.length===0&&delete e.extensionsUsed}}var R_=DMe;var BMe=4;function OMe(e){if(cl(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=ose(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ue("Binary glTF version is not 1 or 2");return i===1?YMe(e,n):KMe(e,n)}function ose(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let m=y(d.binary_glTF,d.KHR_binary_glTF);l(m)&&(m.extras._pipeline.source=u,delete m.uri)}return R_(c,"KHR_binary_glTF"),c}function KMe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var uI=OMe;var Vfn=S(T(),1);function zMe(e){return ve.shader(e,function(t){iU(t)}),ve.buffer(e,function(t){iU(t)}),ve.image(e,function(t){iU(t)}),iU(e),e}function iU(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var dI=zMe;var rpn=S(T(),1);var Gfn=S(T(),1);function HMe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ls(n,t,!0)}var Fd=HMe;var Mfn=S(T(),1);var Ifn=S(T(),1);function JMe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var $Me=[H.ZERO,H.ONE,H.SRC_COLOR,H.ONE_MINUS_SRC_COLOR,H.SRC_ALPHA,H.ONE_MINUS_SRC_ALPHA,H.DST_ALPHA,H.ONE_MINUS_DST_ALPHA,H.DST_COLOR,H.ONE_MINUS_DST_COLOR];function e9e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if($Me.indexOf(e[n])===-1)return t;return e}function t9e(e){let t={},n={},i=e.techniques;return l(i)&&(ve.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(rse(s,H.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,jMe),blendFactors:e9e(c.blendFuncSeparate,qMe)})}rse(s,H.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Fd(e,"KHR_blend")),ve.material(e,function(o){if(l(o.technique)){let r=n[o.technique];ve.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 mI=t9e;var ihn=S(T(),1);var Qfn=S(T(),1);function n9e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ls(n,t,!0),Fd(e,t)}var fI=n9e;function i9e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,ve.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},d;if(ve.techniqueAttribute(a,function(m,p){d=a.parameters[m],u.attributes[p]={semantic:d.semantic}}),ve.techniqueUniform(a,function(m,p){d=a.parameters[m],u.uniforms[p]={count:d.count,node:d.node,type:d.type,semantic:d.semantic,value:d.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))u.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},b=e.shaders[m.fragmentShader];p.fragmentShader=Ls(r.shaders,b,!0);let h=e.shaders[m.vertexShader];p.vertexShader=Ls(r.shaders,h,!0),u.program=Ls(r.programs,p),o[a.program]=u.program}i[c]=Ls(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Fd(e,"KHR_techniques_webgl"),fI(e,"KHR_techniques_webgl"))}return ve.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};ve.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var hI=i9e;var phn=S(T(),1);var chn=S(T(),1);function o9e(e,t){no.typeOf.object("material",e),no.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let d=t(c.index,c);if(l(d))return d}if(l(u)){let d=t(u.index,u);if(l(d))return d}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:d,specular:m}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(m)&&l(m.index)){let p=t(m.index,m);if(l(p))return p}}}let o=ve.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 a1=o9e;var sse=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function r9e(e,t){return t=y(t,sse),sse.forEach(function(n){t.indexOf(n)>-1&&a9e(e,n)}),e}var s9e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function a9e(e,t){let n=s9e[t],i=e[n];if(l(i)){let o=0,r=Ch[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),ve.meshPrimitiveTarget(o,function(a){ve.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),ve.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ve.animation(e,function(i){ve.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Th.buffer=function(e,t){e.buffers.splice(t,1),ve.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--})};Th.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ve.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ve.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ve.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),fr(e,"KHR_draco_mesh_compression")&&ve.mesh(e,function(i){ve.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--})}),fr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(fr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&d.values--,l(d.arrayOffsets)&&d.arrayOffsets>t&&d.arrayOffsets--,l(d.stringOffsets)&&d.stringOffsets>t&&d.stringOffsets--}}}}};Th.image=function(e,t){e.images.splice(t,1),ve.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})};Th.mesh=function(e,t){e.meshes.splice(t,1),ve.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Th.node=function(e,t){e.nodes.splice(t,1),ve.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})}),ve.animation(e,function(i){ve.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),ve.technique(e,function(i){ve.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),ve.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}))}),ve.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Th.material=function(e,t){e.materials.splice(t,1),ve.mesh(e,function(i){ve.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Th.sampler=function(e,t){e.samplers.splice(t,1),ve.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Th.texture=function(e,t){if(e.textures.splice(t,1),ve.material(e,function(i){a1(i,function(o,r){r.index>t&&--r.index})}),fr(e,"EXT_feature_metadata")){ve.mesh(e,function(r){ve.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let d=u.length;for(let m=0;mt&&--b.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 d=a[c].texture;d.index>t&&--d.index}}}}if(fr(e,"EXT_mesh_features")&&ve.mesh(e,function(i){ve.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;ut&&--d.texture.index}}}})}),fr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--d.index}}}}};function Ch(){}Ch.accessor=function(e){let t={};return ve.mesh(e,function(n){ve.meshPrimitive(n,function(i){ve.meshPrimitiveAttribute(i,function(r){t[r]=!0}),ve.meshPrimitiveTarget(i,function(r){ve.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),ve.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ve.animation(e,function(n){ve.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),fr(e,"EXT_mesh_gpu_instancing")&&ve.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})}),fr(e,"CESIUM_primitive_outline")&&ve.mesh(e,function(n){ve.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};Ch.buffer=function(e){let t={};return ve.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};Ch.bufferView=function(e){let t={};if(ve.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ve.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ve.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),fr(e,"KHR_draco_mesh_compression")&&ve.mesh(e,function(n){ve.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),fr(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(fr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function ase(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!ase(e,o,n)}).length===0}Ch.node=function(e){let t={};return ve.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ve.skinJoint(n,function(i){t[i]=!0})}),ve.animation(e,function(n){ve.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ve.technique(e,function(n){ve.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ve.node(e,function(n,i){ase(e,i,t)||(t[i]=!0)}),t};Ch.material=function(e){let t={};return ve.mesh(e,function(n){ve.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Ch.texture=function(e){let t={};if(ve.material(e,function(n){a1(n,function(i){t[i]=!0})}),fr(e,"EXT_feature_metadata")){ve.mesh(e,function(o){ve.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let d=0;d0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let d=e.skins[s.skin];d.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),ve.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let u,d=W9e[a];l(d)?(u=d+c,t[r]=u):l(E9e[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),ve.technique(e,function(n){ve.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function X9e(e){ve.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 Iz(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Kl(e,t)}function P9e(e){ve.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ve.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=Iz(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function v9e(e){let t,n,i,o=e.bufferViews,r={};ve.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};ve.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(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,b){return p.byteOffset-b.byteOffset});let u=0,d=0,m=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),ve.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),dse(n)&&mse(e,i))}}),delete e.nodes[t]}function F9e(e){return ve.node(e,function(t,n){dse(t)&&mse(e,n)}),e}function A9e(e){ve.animation(e,function(t){ve.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=G_(e,i);i.min=o.min,i.max=o.max}})})}function M9e(e){ve.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=G_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function N9e(e){e.asset=y(e.asset,{}),e.asset.version="2.0",use(e),x9e(e),F9e(e),_9e(e),S9e(e),C9e(e),L9e(e),P9e(e),v9e(e),w9e(e),A9e(e),M9e(e),Z9e(e),R9e(e),G9e(e),I9e(e),yI(e),X9e(e),mI(e),hI(e),T9e(e)}var U9e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],k9e=["u_diffuse","u_diffuse_mat"];function Xz(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function Pz(e){return l(e.index)}function vz(e){return Array.isArray(e)&&e.length===4}function fse(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 D9e(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,U9e),i=y(t.baseColorFactorNames,k9e);ve.material(e,function(o){ve.materialValue(o,function(r,s){n.indexOf(s)!==-1&&Pz(r)?(Xz(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&vz(r)&&(Xz(o),o.pbrMetallicRoughness.baseColorFactor=fse(r))})}),E_(e,"KHR_techniques_webgl"),E_(e,"KHR_blend")}function Wz(e,t){l(t)&&(vz(t)?e.pbrMetallicRoughness.baseColorFactor=fse(t):Pz(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function lse(e,t){l(t)&&(vz(t)?e.emissiveFactor=t.slice(0,3):Pz(t)&&(e.emissiveTexture=t))}function B9e(e){ve.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;Xz(t),n.technique==="CONSTANT"?(Fd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Wz(t,s),Wz(t,o)):(Wz(t,r),lse(t,o),lse(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),E_(e,"KHR_materials_common")}var xI=f9e;var Spn=S(T(),1);var cpn=S(T(),1);var ai={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function O9e(e){switch(e){case ai.POSITION:return"positionMC";case ai.NORMAL:return"normalMC";case ai.TANGENT:return"tangentMC";case ai.TEXCOORD:return"texCoord";case ai.COLOR:return"color";case ai.JOINTS:return"joints";case ai.WEIGHTS:return"weights";case ai.FEATURE_ID:return"featureId"}}ai.hasSetIndex=function(e){switch(e){case ai.POSITION:case ai.NORMAL:case ai.TANGENT:return!1;case ai.TEXCOORD:case ai.COLOR:case ai.JOINTS:case ai.WEIGHTS:case ai.FEATURE_ID:return!0}};ai.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ai.POSITION;case"NORMAL":return ai.NORMAL;case"TANGENT":return ai.TANGENT;case"TEXCOORD":return ai.TEXCOORD;case"COLOR":return ai.COLOR;case"JOINTS":return ai.JOINTS;case"WEIGHTS":return ai.WEIGHTS;case"_FEATURE_ID":return ai.FEATURE_ID}};ai.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ai.POSITION;case"RGBA":case"RGB":case"RGB565":return ai.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ai.NORMAL;case"BATCH_ID":return ai.FEATURE_ID}};ai.getGlslType=function(e){switch(e){case ai.POSITION:case ai.NORMAL:case ai.TANGENT:return"vec3";case ai.TEXCOORD:return"vec2";case ai.COLOR:return"vec4";case ai.JOINTS:return"ivec4";case ai.WEIGHTS:return"vec4";case ai.FEATURE_ID:return"int"}};ai.getVariableName=function(e,t){let n=O9e(e);return l(t)&&(n+=`_${t}`),n};var Zt=Object.freeze(ai);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 ue(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:v.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:f.ZERO,l(e.rotation)?e.rotation:Pe.IDENTITY,l(e.scale)?e.scale:f.ONE)};Tc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r>t};pa.fromSubtreeJson=async function(e,t,n,i,o){let r=new pa(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=vNe(n);let a=s.json;r._subtreeJson=a;let c;if(si(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let u=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L0;d=d||m;for(let p=0;p>BigInt(61)),u=c%2===0?$C.encode2D(i,o,r):$C.encode2D(i,r,o),d=ib.fromFacePositionLevel(c,BigInt(u),i),m,p;if(l(s)){let b=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:b,p=n<4?b:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:ib.getTokenFromId(d._cellId),minimumHeight:m,maximumHeight:p}}}}var n5e=new f,i5e=new f,Dz=new f,o5e=new $;function Rse(e,t,n,i,o){if(t===0)return e;let r=f.unpack(e,0,i5e),s=$.unpack(e,3,o5e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,d=0,m=f.fromElements(a,a,1,n5e);l(o)&&(d=-1+(2*o+1)*a,m.z=a);let p=f.fromElements(c,u,d,Dz);p=$.multiplyByVector(s,p,Dz),p=f.add(p,r,Dz);let b=$.clone(s);b=$.multiplyByScale(b,m,b);let h=new Array(12);return f.pack(p,h),$.pack(b,h,3),h}var r5e=new le;function Gse(e,t,n,i,o){if(t===0)return e.slice();let r=le.unpack(e,0,r5e),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,d=X.negativePiToPi(r.west+n*u),m=X.negativePiToPi(d+u),p=c*r.height,b=X.negativePiToPi(r.south+i*p),h=X.negativePiToPi(b+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[d,b,m,h,x,_]}function s5e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Lse(i,o,n,!1,t),s=Vse(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Ese(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Ese(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}ul.prototype.hasProperty=function(e,t){return!1};ul.prototype.getFeature=function(e){};ul.prototype.applyDebugSettings=function(e,t){};ul.prototype.applyStyle=function(e){};ul.prototype.update=function(e,t){};ul.prototype.pick=function(e,t,n){};ul.prototype.isDestroyed=function(){return!1};ul.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};ul._deriveBoundingBox=Rse;ul._deriveBoundingRegion=Gse;ul._deriveBoundingVolumeS2=Zse;var f1=ul;var PAn=S(T(),1);var xgn=S(T(),1),a5e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Jl=Object.freeze(a5e);var CAn=S(T(),1);var Bgn=S(T(),1);var Cgn=S(T(),1);function h1(e,t){this._distance=t,this._normal=new Wse(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(h1.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)&&!f.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),f.clone(e,this._normal._cartesian3)}}});h1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new h1(e.normal,e.distance),t};h1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new h1(e.normal,e.distance)};function Wse(e,t){this._clippingPlane=t,this._cartesian3=f.clone(e)}Object.defineProperties(Wse.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 w_=h1;function Cc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this.edgeColor=Y.clone(y(e.edgeColor,Y.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?wse:Fse,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;o0&&(r=Ot.OUTSIDE);for(let s=0;s0?ps.COUNTER_CLOCKWISE:ps.CLOCKWISE};Pg.triangulate=function(e,t){let n=B.packArray(e);return(0,zse.default)(n,t,2)};var Hse=new f,Jse=new f,Qse=new f,Ose=new f,Yse=new f,Kse=new f,db=new f,jse=new B,qse=new B,$se=new B,b1=new B;Pg.computeSubdivision=function(e,t,n,i,o){o=y(o,X.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),d=new Array(c*2),m=0,p=0;for(a=0;a0;){let L=s.pop(),R=s.pop(),G=s.pop(),W=f.fromArray(u,G*3,Hse),w=f.fromArray(u,R*3,Jse),P=f.fromArray(u,L*3,Qse),F,M,g;r&&(F=B.fromArray(d,G*2,jse),M=B.fromArray(d,R*2,qse),g=B.fromArray(d,L*2,$se));let Z=f.multiplyByScalar(f.normalize(W,Ose),x,Ose),E=f.multiplyByScalar(f.normalize(w,Yse),x,Yse),I=f.multiplyByScalar(f.normalize(P,Kse),x,Kse),A=f.magnitudeSquared(f.subtract(Z,E,db)),N=f.magnitudeSquared(f.subtract(E,I,db)),D=f.magnitudeSquared(f.subtract(I,Z,db)),k=Math.max(A,N,D),O,U,j;k>C?A===k?(O=`${Math.min(G,R)} ${Math.max(G,R)}`,a=h[O],l(a)||(U=f.add(W,w,db),f.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[O]=a,r&&(j=B.add(F,M,b1),B.multiplyByScalar(j,.5,j),d.push(j.x,j.y))),s.push(G,a,L),s.push(a,R,L)):N===k?(O=`${Math.min(R,L)} ${Math.max(R,L)}`,a=h[O],l(a)||(U=f.add(w,P,db),f.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[O]=a,r&&(j=B.add(M,g,b1),B.multiplyByScalar(j,.5,j),d.push(j.x,j.y))),s.push(R,a,G),s.push(a,L,G)):D===k&&(O=`${Math.min(L,G)} ${Math.max(L,G)}`,a=h[O],l(a)||(U=f.add(P,W,db),f.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,h[O]=a,r&&(j=B.add(g,F,b1),B.multiplyByScalar(j,.5,j),d.push(j.x,j.y))),s.push(L,a,R),s.push(a,G,R)):(b.push(G),b.push(R),b.push(L))}let V={attributes:{position:new Ie({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:u})},indices:b,primitiveType:Ae.TRIANGLES};return r&&(V.attributes.st=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})),new mt(V)};var E5e=new fe,W5e=new fe,I5e=new fe,Hz=new fe;Pg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,X.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),d=new Array(c*2),m=0,p=0;for(a=0;a0;){let G=s.pop(),W=s.pop(),w=s.pop(),P=f.fromArray(u,w*3,Hse),F=f.fromArray(u,W*3,Jse),M=f.fromArray(u,G*3,Qse),g,Z,E;r&&(g=B.fromArray(d,w*2,jse),Z=B.fromArray(d,W*2,qse),E=B.fromArray(d,G*2,$se));let I=e.cartesianToCartographic(P,E5e),A=e.cartesianToCartographic(F,W5e),N=e.cartesianToCartographic(M,I5e);C.setEndPoints(I,A);let D=C.surfaceDistance;V.setEndPoints(A,N);let k=V.surfaceDistance;L.setEndPoints(N,I);let O=L.surfaceDistance,U=Math.max(D,k,O),j,K,te,z,q;U>_?D===U?(j=`${Math.min(w,W)} ${Math.max(w,W)}`,a=h[j],l(a)||(K=C.interpolateUsingFraction(.5,Hz),te=(I.height+A.height)*.5,z=f.fromRadians(K.longitude,K.latitude,te,e,db),u.push(z.x,z.y,z.z),a=u.length/3-1,h[j]=a,r&&(q=B.add(g,Z,b1),B.multiplyByScalar(q,.5,q),d.push(q.x,q.y))),s.push(w,a,G),s.push(a,W,G)):k===U?(j=`${Math.min(W,G)} ${Math.max(W,G)}`,a=h[j],l(a)||(K=V.interpolateUsingFraction(.5,Hz),te=(A.height+N.height)*.5,z=f.fromRadians(K.longitude,K.latitude,te,e,db),u.push(z.x,z.y,z.z),a=u.length/3-1,h[j]=a,r&&(q=B.add(Z,E,b1),B.multiplyByScalar(q,.5,q),d.push(q.x,q.y))),s.push(W,a,w),s.push(a,G,w)):O===U&&(j=`${Math.min(G,w)} ${Math.max(G,w)}`,a=h[j],l(a)||(K=L.interpolateUsingFraction(.5,Hz),te=(N.height+I.height)*.5,z=f.fromRadians(K.longitude,K.latitude,te,e,db),u.push(z.x,z.y,z.z),a=u.length/3-1,h[j]=a,r&&(q=B.add(E,g,b1),B.multiplyByScalar(q,.5,q),d.push(q.x,q.y))),s.push(G,a,W),s.push(a,w,W)):(b.push(w),b.push(W),b.push(G))}let R={attributes:{position:new Ie({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:u})},indices:b,primitiveType:Ae.TRIANGLES};return r&&(R.attributes.st=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})),new mt(R)};Pg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ie.default);let o=R5e,r=G5e;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};vg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};vg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};vg.prototype.clear=function(){this._array.length=this._offset=this._length=0};vg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var dl=vg;var or={};or.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;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u0?new Array(o):void 0;for(let a=0;aX.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function k5e(e,t,n,i){if(i===rn.RHUMB)return U5e(e,t,n);let o=ei.lineSegmentPlane(e,t,on.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var D5e=new fe;function B5e(e,t,n){let i=[],o,r,s,a,c,u=0;for(;ut.cartesianToCartographic(m,D5e).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:d(o)});else if(a!==0){if(c=k5e(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:d(c)})}++u}return i}function iae(e,t,n,i,o,r,s){let a=[],c=r,u=m=>p=>p.position===m,d=[];do{let m=n[c];a.push(m);let p=i.findIndex(u(c)),b=i[p];if(!l(b)){++c;continue}let{visited:h,type:x,next:_}=b;if(b.visited=!0,x===0){if(_===0){let R=i[p-(s?1:-1)];if(R?.position===c+1)R.visited=!0;else{++c;continue}}if(!h&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}h||d.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c=0&&c!==r&&a.lengthu.theta-d.theta);let c=s[0].z>=0;o=iae(i,o,s,a,1,0,c)}return i};or.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new dl;c.enqueue(e);let u=l(r);for(;c.length!==0;){let d=c.dequeue(),m=d.positions,p=d.holes,b,h;if(i)for(h=m.length,b=0;b1){for(let w of W)c.enqueue(new Ua(w,p));continue}}let V=m.slice(),L=l(p)?p.length:0,R=[],G;for(b=0;bMath.PI&&(e-=X.TWO_PI),e}}});var g1=new fe,Q5e=new f;Fr.prototype.getLatitude=function(e){l(e)||(e=ie.default),g1.latitude=this.conformalLatitude,g1.longitude=this.longitude,g1.height=0;let t=this.ellipsoid.cartographicToCartesian(g1,Q5e);return e.cartesianToCartographic(t,g1),g1.latitude};var j5e=new yn,q5e=new f,$5e=new f;Fr.fromCartesian=function(e,t){let n=X.signNotZero(e.z),i=Fr.NORTH_POLE_TANGENT_PLANE,o=Fr.SOUTH_POLE;n<0&&(i=Fr.SOUTH_POLE_TANGENT_PLANE,o=Fr.NORTH_POLE);let r=j5e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=f.subtract(r.origin,o,q5e),f.normalize(r.direction,r.direction);let s=ei.rayPlane(r,i.plane,$5e),a=f.subtract(s,o,s),c=f.dot(i.xAxis,a),u=n*f.dot(i.yAxis,a);return l(t)?(t.position=new B(c,u),t.tangentPlane=i,t):new Fr(new B(c,u),i)};Fr.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=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),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==rn.RHUMB){let p=B.subtract(t.position,e.position,gUe),b=B.dot(t.position,p)/B.dot(p,p);if(b>0&&b<1){let h=B.add(t.position,B.multiplyByScalar(p,-b,p),yUe),x=Vc.clone(t,xUe);x.position=h;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(u=_)}}let d=t.x*e.y-e.x*t.y,m=Math.sign(d);m!==0&&(m*=B.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=m),u<=0&&(o.southAngle+=m)}var lae=new Vc,_Ue=new Vc,Ad={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Md.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,Ad.northAngle=0,Ad.southAngle=0,Ad.westOverIdl=Number.POSITIVE_INFINITY,Ad.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Vc.fromCartesian(e[0],_Ue);for(let s=1;sAd.eastOverIdl-Ad.westOverIdl&&(i.west=Ad.westOverIdl,i.east=Ad.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(Ad.northAngle),X.TWO_PI,X.EPSILON10)&&(i.north=X.PI_OVER_TWO,i.east=X.PI,i.west=-X.PI),X.equalsEpsilon(Math.abs(Ad.southAngle),X.TWO_PI,X.EPSILON10)&&(i.south=-X.PI_OVER_TWO,i.east=X.PI,i.west=-X.PI),i};var SUe=new Vc;function TUe(e,t,n){return e.height>=X.PI||e.width>=X.PI?Vc.fromCartesian(t[0],SUe).tangentPlane:es.fromPoints(t,n)}var uae=new fe;function CUe(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=X.PI||e.width>=X.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,uae);return l(r)||(r=new B),r.x=s.longitude/X.PI,r.y=s.latitude/X.PI_OVER_TWO,r}return Vc.fromCartesian(o,r)};let i=es.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function LUe(e,t,n,i){return(o,r)=>!i&&(e.height>=X.PI_OVER_TWO||e.width>=2*X.PI_OVER_THREE)?Yn.splitPolygonsOnEquator(o,t,n,r):o}function ZUe(e,t,n,i){if(t.height>=X.PI||t.width>=X.PI)return Je.fromRectangle(t,void 0,rae);let o=e,r=es.fromPoints(o,n);return Yn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,rae)}Md.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,d=e._textureCoordinates,m=l(d),p=r.positions;if(p.length<3)return;let b=e.rectangle,h=Yn.polygonsFromHierarchy(r,m,CUe(b,p,n),!s,n,LUe(b,n,u,s)),x=h.hierarchy,_=h.polygons,C=function(I){return I},V=m?Yn.polygonsFromHierarchy(d,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,R=ZUe(L,b,n,o),G=[],W=e._height,w=e._extrudedHeight,P=e._perPositionHeightExtrude||!X.equalsEpsilon(W,w,0,X.EPSILON2),F={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:TUe(b,L,n).plane.normal,projectTo2d:VUe(b,L,n),boundingRectangle:R,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},M;if(P)for(F.extrude=!0,F.top=a,F.bottom=c,F.shadowVolume=e._shadowVolume,F.offsetAttribute=e._offsetAttribute,M=0;M<_.length;M++){let I=fUe(n,_[M],m?V[M]:void 0,i,x[M],s,a,c,t,u),A;a&&c?(A=I.topAndBottom,F.geometry=Yn.scaleToGeodeticHeightExtruded(A.geometry,W,w,n,s)):a?(A=I.topAndBottom,A.geometry.attributes.position.values=ci.scaleToGeodeticHeight(A.geometry.attributes.position.values,W,n,!s),F.geometry=A.geometry):c&&(A=I.topAndBottom,A.geometry.attributes.position.values=ci.scaleToGeodeticHeight(A.geometry.attributes.position.values,w,n,!0),F.geometry=A.geometry),(a||c)&&(F.wall=!1,A.geometry=Jz(F),G.push(A));let N=I.walls;F.wall=!0;for(let D=0;D 2) { -dimension = ceil(log2(float(u_extentsLength))); -} -int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); -for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { -ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); -int positionsLength = positionsLengthAndExtents.x; -int polygonExtentsIndex = positionsLengthAndExtents.y; -lastPolygonIndex += 1; -if (polygonExtentsIndex == regionIndex) { -float clipAmount = czm_infinity; -vec4 extents = getExtents(polygonExtentsIndex); -vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; -vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); -float s = 1.0; -for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { -vec2 a = getPolygonPosition(lastPolygonIndex + i); -vec2 b = getPolygonPosition(lastPolygonIndex + j); -vec2 ab = b - a; -vec2 pa = p - a; -float t = dot(pa, ab) / dot(ab, ab); -t = clamp(t, 0.0, 1.0); -vec2 pq = pa - t * ab; -float d = length(pq); -bvec3 cond = bvec3(p.y >= a.y, -p.y < b.y, -ab.x * pa.y > ab.y * pa.x); -if (all(cond) || all(not(cond))) s = -s; -if (abs(d) < abs(clipAmount)) { -clipAmount = d; -} -} -vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; -out_FragColor = min(out_FragColor, result); -} -lastPolygonIndex += positionsLength; -} -} -`;function os(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(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;ix1.equals(t,e))};os.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 EUe=new le;function WUe(e){let t=[],n=[],i=e.length;for(let r=0;rle.union(e[_].computeSphericalExtents(EUe),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),d=le.clone(a,d),d.south-=c,d.west-=u,d.north+=c,d.east+=u,d.south=Math.max(d.south,-Math.PI),d.west=Math.max(d.west,-Math.PI),d.north=Math.min(d.north,Math.PI),d.east=Math.min(d.east,Math.PI),p=-1}}t.push(d),n.push(m)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}os.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;ns+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{e._signedDistanceComputeCommand=void 0}})}var mae=new le,PUe=new le;os.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Ot.OUTSIDE;this.inverse&&(o=Ot.INSIDE);for(let r=0;r=r;)C=o[C-r];o.push(C),s[x]=_}_>nke&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>ike&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===u?(u=_,t[a+1]=_):(d=_,t[a+2]=_),x=bae(i,c,u,d,p,b,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function bae(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,d=eH(e,t,a,c,u);if(d===0)return t;let m=0,p=o?1:0,b=r?1:0,h=eH(e,n,m,p,b);if(h===0)return n;let x=s?1:0,_=0,C=r?1:0,V=eH(e,i,x,_,C);if(V===0)return i;let L=d&h&V,R,G,W;if(L&1)R=0,G=1,W=2;else if(L&2)R=0,W=1,G=2;else if(L&4)G=0,R=1,W=2;else if(L&8)G=0,W=1,R=2;else if(L&16)W=0,R=1,G=2;else if(L&32)W=0,G=1,R=2;else{let M=tH(d),g=tH(h),Z=tH(V);return M>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}_U.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;a1;)i>>=1,r.push(gae(i));let s=new bt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:nt.LUMINANCE,sampler:new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:ni.LINEAR})});return t.outlineTexture=s,s};function gae(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 yae(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Mo.FAILED;let o=this._processError;this._processError=void 0,TU(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===Mo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Mo.FAILED,TU(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Mo.FAILED,TU(this,o)}return this._incrementallyLoadTextures?n:n&&i};function Mke(e,t,n,i,o,r,s){let a=e.gltfJson,u=a.accessors[t].bufferView;return Ki.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:u,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function Nke(e,t,n,i,o,r){return Ki.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function Uke(e,t){let n=Ki.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Cae(e,t,n){let i=t.byteOffset,o=Kl(e,t),r=t.count,s=Xu(t.type),a=t.componentType,c=Q.getSizeInBytes(a),u=c*s,d=r*s;if(o===u)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,d);let m=Q.createTypedArray(a,d),p=new DataView(n.buffer),b=new Array(s),h=ub(t.componentType);i=n.byteOffset+i;for(let x=0;x{l(i)&&l(i.attributes)&&l(i.attributes[d])?qke(x,_,o,r):$ke(a,c,x,_,o,r)},x}function Zae(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Zt.POSITION,u=a===Zt.FEATURE_ID,d=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,m=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&u,b=e._loadAttributesAsTypedArray,h=!b,x=b||d||m||p,V=Lae(e,t,n,i,r?!1:h,r?!0:x,s),L=new D_.AttributeLoadPlan(V);return L.loadBuffer=h,L.loadTypedArray=x,L}function eDe(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=oH(e,rs,i),u=c.modelSemantic,d=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,m=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&d||!o.context.instancedArrays,b=e._enablePick&&!o.context.webgl2,h=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return Lae(e,t,c,void 0,h,p||m&&(!a||x||b),o)}function tDe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new fke;c.count=s.count;let u=e._loadAttributesAsTypedArray,d=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,b=!u,h=u||d||m,C=Nke(e,t,n,o?!1:b,o?!0:h,r),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{c.indexDatatype=C.indexDatatype,c.buffer=C.buffer,c.typedArray=C.typedArray};let R=new D_.IndicesLoadPlan(c);return R.loadBuffer=b,R.loadTypedArray=h,R}function fl(e,t,n,i){let o=e.gltfJson,r=zl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ki.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=zl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=Mo.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function nDe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Wke;return l(i)&&(c.diffuseTexture=fl(e,i,n)),l(o)&&(c.specularGlossinessTexture=fl(e,o,n)),c.diffuseFactor=Pu(re,r),c.specularFactor=Pu(f,s),c.glossinessFactor=a,c}function iDe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Eke;return l(i)&&(c.baseColorTexture=fl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=fl(e,o,n)),c.baseColorFactor=Pu(re,r),c.metallicFactor=s,c.roughnessFactor=a,c}function oDe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Ike;return l(o)&&(a.specularTexture=fl(e,o,n)),l(s)&&(a.specularColorTexture=fl(e,s,n)),a.specularFactor=i,a.specularColorFactor=Pu(f,r),a}function rDe(e,t,n){let{anisotropyStrength:i=nH.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=nH.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new nH;return l(r)&&(s.anisotropyTexture=fl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function sDe(e,t,n){let{clearcoatFactor:i=iH.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=iH.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new iH;return l(o)&&(c.clearcoatTexture=fl(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=fl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=fl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function aDe(e,t,n){let i=new Xke,o=y(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,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=nDe(e,r,n):(l(u)&&(i.metallicRoughness=iDe(e,u,n)),l(s)&&!i.unlit&&(i.specular=oDe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=rDe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=sDe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=fl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=fl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=fl(e,t.occlusionTexture,n)),i.emissiveFactor=Pu(f,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Rae(e,t){let n=new _ae;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 Gae(e,t,n,i){let o=new _ae,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Vae(r.attribute),o.positionalLabel=i,o}function Eae(e,t){let n=new Tae;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 Wae(e,t,n,i){let o=new Tae,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function cDe(e,t,n,i){let o=new Sae;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=fl(e,r,n,Qt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function lDe(e,t,n,i,o,r){let s=new Sae,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=fl(e,c,i,Qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function uDe(e,t,n,i,o){let r=new hke,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let u=t[c],d=oH(e,Zt,c),m=Zae(e,u,d,s,a,n,o);r.attributes.push(m.attribute),i.attributePlans.push(m)}return r}function dDe(e,t,n,i){let o=new pke,r=new D_(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=aDe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=mDe(e,u,r));let d=e._loadForClassification,m=a.KHR_draco_mesh_compression,p=!1,b=t.attributes;if(l(b))for(let G in b){if(!b.hasOwnProperty(G))continue;let W=b[G],w=oH(e,Zt,G),P=w.modelSemantic;if(d&&!jke(P))continue;P===Zt.FEATURE_ID&&(p=!0);let F=Zae(e,W,w,m,n,c,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}let h=t.targets;if(l(h)&&!d)for(let G=0;Gn[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=CU(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(v.IDENTITY);return i}function CDe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=TDe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r0&&(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)};S1.prototype.isDestroyed=function(){return!1};S1.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var BI=S1;var DTn=S(T(),1);var wTn=S(T(),1);var Ql={RGBA4:H.RGBA4,RGBA8:H.RGBA8,RGBA16F:H.RGBA16F,RGBA32F:H.RGBA32F,RGB5_A1:H.RGB5_A1,RGB565:H.RGB565,DEPTH_COMPONENT16:H.DEPTH_COMPONENT16,STENCIL_INDEX8:H.STENCIL_INDEX8,DEPTH_STENCIL:H.DEPTH_STENCIL,DEPTH24_STENCIL8:H.DEPTH24_STENCIL8,validate:function(e){return e===Ql.RGBA4||e===Ql.RGBA8||e===Ql.RGBA16F||e===Ql.RGBA32F||e===Ql.RGB5_A1||e===Ql.RGB565||e===Ql.DEPTH_COMPONENT16||e===Ql.STENCIL_INDEX8||e===Ql.DEPTH_STENCIL||e===Ql.DEPTH24_STENCIL8},getColorFormat:function(e){return e===H.FLOAT?Ql.RGBA32F:e===H.HALF_FLOAT_OES?Ql.RGBA16F:Ql.RGBA8}},hl=Object.freeze(Ql);function OI(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Mt.maximumRenderbufferSize,o=y(e.format,hl.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(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(OI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});OI.prototype._getRenderbuffer=function(){return this._renderbuffer};OI.prototype.isDestroyed=function(){return!1};OI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var vu=OI;function Zs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(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(Zs.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}}});Zs.prototype.isDirty=function(e,t,n,i,o){n=y(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])};Zs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,ze.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,nt.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;s1){let a=hl.getColorFormat(o);this._colorRenderbuffers[s]=new vu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new bt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new vu({context:e,width:t,height:n,format:hl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new vu({context:e,width:t,height:n,format:hl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new bt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:Qt.NEAREST}):this._depthRenderbuffer=new vu({context:e,width:t,height:n,format:hl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new BI({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 ba({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Zs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Zs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Zs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Zs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Zs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Zs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Zs.prototype.getDepthTexture=function(){return this._depthTexture};Zs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Zs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Zs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Zs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Zs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Zs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Zs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Zs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Zs.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e=s.clientWidth)u=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,Ec=KI(r,n,c,Ec),ys.clipToGLWindowCoordinates(a,Ec,aH),a.x+=L.x,c.position.x=-c.position.x;let R=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-R,Ec=KI(r,n,c,Ec),ys.clipToGLWindowCoordinates(a,Ec,cH)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,Ec=KI(r,n,c,Ec),ys.clipToGLWindowCoordinates(a,Ec,aH),a.x=a.x-a.width,c.position.x=-c.position.x;let R=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-R,Ec=KI(r,n,c,Ec),ys.clipToGLWindowCoordinates(a,Ec,cH)}f.clone(b,c.position),c.frustum=h.clone(),i=B.clone(aH,i),(i.x<0||i.x>s.clientWidth)&&(i.x=cH.x)}}if(o.mode!==oe.SCENE2D||u){if(Ec=KI(r,n,c,Ec),Ec.z<0&&!(c.frustum instanceof un)&&!(c.frustum instanceof Pr))return;i=ys.clipToGLWindowCoordinates(a,Ec,i)}return i.y=s.clientHeight-i.y,i};ys.worldToDrawingBufferCoordinates=function(e,t,n){if(n=ys.worldToWindowCoordinates(e,t,n),!!l(n))return ys.transformWindowToDrawingBuffer(e,n,n)};ys.wgs84ToDrawingBufferCoordinates=function(e,t,n){return po("SceneTransforms.wgs84ToDrawingBufferCoordinates","SceneTransforms.wgs84ToDrawingBufferCoordinates has been deprecated. It will be removed in 1.21. Use SceneTransforms.worldToDrawingBufferCoordinates instead."),ys.worldToDrawingBufferCoordinates(e,t,n)};var bb=new f,QDe=new fe;ys.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return f.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,QDe);if(!l(r))return;if(o.project(r,bb),i===oe.COLUMBUS_VIEW)return f.fromElements(bb.z,bb.x,bb.y,n);if(i===oe.SCENE2D)return f.fromElements(0,bb.x,bb.y,n);let s=e.morphTime;return f.fromElements(X.lerp(bb.z,t.x,s),X.lerp(bb.x,t.y,s),X.lerp(bb.y,t.z,s),n)};var Fae=new f,Aae=new f,Mae=new v;ys.clipToGLWindowCoordinates=function(e,t,n){return f.divideByScalar(t,t.w,Fae),v.computeViewportTransformation(e,0,1,Mae),v.multiplyByPoint(Mae,Fae,Aae),B.fromCartesian3(Aae,n)};ys.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return B.fromElements(t.x*o,t.y*r,n)};var jDe=new re,Nae=new re;ys.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 b=n*r.log2FarDepthFromNearPlusOne,h=Math.pow(2,b)-1;n=c*(1-a/(h+a))/(c-a)}let u=e.view.passState.viewport,d=re.clone(re.UNIT_W,jDe);d.x=(t.x-u.x)/u.width*2-1,d.y=(t.y-u.y)/u.height*2-1,d.z=n*2-1,d.w=1;let m,p=e.camera.frustum;if(l(p.fovy)){m=v.multiplyByVector(r.inverseViewProjection,d,Nae);let b=1/m.w;f.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=Nae,m.x=(d.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(d.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(d.z*(a-c)-a-c)*.5,m.w=1,m=v.multiplyByVector(r.inverseView,m,m)}return f.fromCartesian4(m,i)};var zi=ys;var NCn=S(T(),1),qDe={LEFT:-1,NONE:0,RIGHT:1},pl=Object.freeze(qDe);var v1n=S(T(),1);var YCn=S(T(),1);var C1={};C1._deprecationWarning=po;var gb=Uint32Array.BYTES_PER_ELEMENT;C1.parse=function(e,t){let n=y(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 ue(`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 u=o.getUint32(t,!0);t+=gb;let d=o.getUint32(t,!0);t+=gb;let m;u>=570425344?(t-=gb*2,m=a,u=c,d=0,a=0,c=0,C1._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.")):d>=570425344&&(t-=gb,m=u,u=a,d=c,a=0,c=0,C1._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:y(m,0)}:(p=Zo(i,t,a),t+=a);let b=new Uint8Array(e,t,c);t+=c;let h,x;u>0&&(h=Zo(i,t,u),t+=u,d>0&&(x=new Uint8Array(e,t,d),x=new Uint8Array(x),t+=d));let _=n+s-t;if(_===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(C1._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:b,batchTableJson:h,batchTableBinary:x,gltf:C}};var zI=C1;var QCn=S(T(),1);function HI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Uae(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 $De(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}HI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),Uae(this,e,t,n,1,i.byteOffset)):i};HI.prototype.hasProperty=function(e){return l(this.json[e])};HI.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)),Uae(this,e,t,n,this.featuresLength,i.byteOffset)):$De(this,e,t,i)};HI.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;a0&&(h=Zo(i,t,u),t+=u,d>0&&(x=new Uint8Array(e,t,d),x=new Uint8Array(x),t+=d));let _=n+s-t;if(_===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(ZU._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:b,batchTableJson:h,batchTableBinary:x,gltf:C}};var qI=ZU;var xb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},RU=Vn.Attribute,_Be=Vn.FeatureIdAttribute,Kae=Vn.Instances;function _b(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Ao.Y),u=y(e.forwardAxis,Ao.X),d=y(e.loadAttributesAsTypedArray,!1),m=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),b=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._enablePick=b,this._state=xb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=v.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(_b.prototype=Object.create(ao.prototype),_b.prototype.constructor=_b);Object.defineProperties(_b.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});_b.prototype.load=function(){if(l(this._promise))return this._promise;let e=qI.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new sf(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ue("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=v.fromTranslation(f.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let m=Os(e.gltf);m=m.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:m});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let d=new hb(u);return this._gltfLoader=d,this._state=xb.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=xb.PROCESSING,this}).catch(m=>{if(!this.isDestroyed())throw SBe(this,m)}),this._promise};function SBe(e,t){return e.unload(),e._state=xb.FAILED,e.getError("Failed to load i3dm",t)}_b.prototype.process=function(e){if(this._state===xb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===xb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=v.multiplyTransformation(this._transform,i.transform,i.transform),VBe(this,i,e),TBe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=xb.READY,!0};function TBe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=yb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new ml({name:qm.BATCH_TABLE_CLASS_NAME,count:i});o=new Oa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var GU=new f,dH=new Array(4),CBe=new v;function VBe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),d=ZBe(o,r),m;c&&(m=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let b=new Float32Array(r),h=f.unpackArray(d),x=new f,_=new f,C=new f,V=new f,L=new $,R=new Pe,G=new Array(4),W=new f,w=new Array(3),P=new v;if(!l(s)||f.equals(f.unpack(s),f.ZERO)){let k=ae.fromPoints(h);for(i=0;i0&&(k.instances=D?LBe(F):F,D=!0)}}function LBe(e){let t=new Kae;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};V1.prototype.clampTime=function(e){let t=this.times;return X.clamp(e,t[0],t[t.length-1])};var Hi=V1;function L1(e){this._value=e,this._valueType=Hi.getPointType(e)}Object.defineProperties(L1.prototype,{value:{get:function(){return this._value}}});L1.prototype.findTimeInterval=function(e){};L1.prototype.wrapTime=function(e){return 0};L1.prototype.clampTime=function(e){return 0};L1.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var Sb=L1;var pLn=S(T(),1);var nLn=S(T(),1);function Z1(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Hi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(Z1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});Z1.prototype.findTimeInterval=Hi.prototype.findTimeInterval;Z1.prototype.wrapTime=Hi.prototype.wrapTime;Z1.prototype.clampTime=Hi.prototype.clampTime;Z1.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 f),f.lerp(n[o],n[o+1],r,t))};var Nd=Z1;var rLn=S(T(),1);var zae={};zae.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=0;--a)s[a]=f.subtract(r[a],f.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var R1=zae;var Hae=[],Jae=[],Qae=[],jae=[];function IBe(e,t,n){let i=Hae,o=Qae,r=Jae,s=jae;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 f),f.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Jl.REPEAT)b=b-Math.floor(b);else if(a.loop===Jl.MIRRORED_REPEAT){let C=Math.floor(b),V=b-C;b=C%2===1?1-V:V}a.reverse&&(b=1-b);let _=b*u*a.multiplier;_=X.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=af.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&EU.push(a))}}n=EU.length;for(let s=0;ss||o<-s&&r>-s}function X1(e,t){if(!l(t))return;let n=Vb.clone(t),i=He.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 tOe(e){X1(e,e._originalCommand),X1(e,e._translucentCommand),X1(e,e._skipLodBackfaceCommand),X1(e,e._skipLodStencilCommand),X1(e,e._silhouetteModelCommand),X1(e,e._silhouetteColorCommand)}function nOe(e){let t=He.shallowClone(e);t.pass=Ze.TRANSLUCENT;let n=Ue(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=hn.ALPHA_BLEND,t.renderState=Oe.fromCache(n),t}function iOe(e,t){let n=t._silhouetteId%255,i=He.shallowClone(e),o=Ue(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:H.ALWAYS,backFunction:H.ALWAYS,reference:n,mask:-1,frontOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.REPLACE},backOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Oe.fromCache(o),i}function oOe(e,t){let n=t._silhouetteId%255,i=He.shallowClone(e),o=Ue(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ze.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ze.TRANSLUCENT,o.depthMask=!1,o.blending=hn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:H.NOTEQUAL,backFunction:H.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.KEEP},backOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.KEEP}};let s=Ue(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Oe.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function rOe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=sOe(o);if(r!==s){let a=aOe(r),c=Ue(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Oe.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function sOe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function aOe(e){return Yt.CESIUM_3D_TILE_MASK|e<X.EPSILON3}};var pX=oce;var qRn=S(T(),1);var YRn=S(T(),1),bX=`vec3 getProceduralSkyMetrics(vec3 positionWC, vec3 reflectionWC) -{ -float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / length(positionWC)); -float reflectionDotNadir = dot(reflectionWC, normalize(positionWC)); -float atmosphereHeight = 0.05; -float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); -return vec3(horizonDotNadir, reflectionDotNadir, smoothstepHeight); -} -vec3 getProceduralDiffuseIrradiance(vec3 skyMetrics) -{ -vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); -float diffuseIrradianceFromEarth = (1.0 - skyMetrics.x) * (skyMetrics.y * 0.25 + 0.75) * skyMetrics.z; -float diffuseIrradianceFromSky = (1.0 - skyMetrics.z) * (1.0 - (skyMetrics.y * 0.25 + 0.25)); -return blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); -} -vec3 getProceduralSpecularIrradiance(vec3 reflectionWC, vec3 skyMetrics, float roughness) -{ -reflectionWC.x = -reflectionWC.x; -reflectionWC = -normalize(czm_temeToPseudoFixed * reflectionWC); -reflectionWC.x = -reflectionWC.x; -float inverseRoughness = 1.04 - roughness; -inverseRoughness *= inverseRoughness; -vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, reflectionWC).rgb * inverseRoughness; -vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), skyMetrics.z); -vec3 nadirColor = belowHorizonColor * 0.5; -vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); -vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, skyMetrics.y * inverseRoughness * 0.5 + 0.75); -vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, skyMetrics.z); -float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - skyMetrics.x); -float blendRegionOffset = roughness * -1.0; -float farAboveHorizon = clamp(skyMetrics.x - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); -float aroundHorizon = clamp(skyMetrics.x + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); -float farBelowHorizon = clamp(skyMetrics.x + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); -float notDistantRough = (1.0 - skyMetrics.x * roughness * 0.8); -vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, skyMetrics.y) * notDistantRough); -specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, skyMetrics.y) * inverseRoughness); -specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, skyMetrics.y) * inverseRoughness); -return specularIrradiance; -} -#ifdef USE_SUN_LUMINANCE -float clampedDot(vec3 x, vec3 y) -{ -return clamp(dot(x, y), 0.001, 1.0); -} -float getSunLuminance(vec3 positionWC, vec3 normalEC, vec3 lightDirectionEC) -{ -vec3 normalWC = normalize(czm_inverseViewRotation * normalEC); -vec3 lightDirectionWC = normalize(czm_inverseViewRotation * lightDirectionEC); -vec3 vWC = -normalize(positionWC); -float LdotZenith = clampedDot(lightDirectionWC, vWC); -float S = acos(LdotZenith); -float NdotZenith = clampedDot(normalWC, vWC); -float NdotL = clampedDot(normalEC, lightDirectionEC); -float gamma = acos(NdotL); -float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * NdotL * NdotL) * (1.0 - exp(-0.32 / NdotZenith))); -float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * LdotZenith * LdotZenith) * (1.0 - exp(-0.32)); -return model_luminanceAtZenith * (numerator / denominator); -} -#endif -vec3 proceduralIBL( -vec3 positionEC, -vec3 normalEC, -vec3 lightDirectionEC, -czm_modelMaterial material -) { -vec3 viewDirectionEC = -normalize(positionEC); -vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); -vec3 reflectionWC = normalize(czm_inverseViewRotation * normalize(reflect(viewDirectionEC, normalEC))); -vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC); -float roughness = material.roughness; -vec3 f0 = material.specular; -vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness); -float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001; -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y); -vec3 specularContribution = specularIrradiance * specularColor * model_iblFactor.y; -#ifdef USE_SPECULAR -specularContribution *= material.specularWeight; -#endif -vec3 diffuseIrradiance = getProceduralDiffuseIrradiance(skyMetrics); -vec3 diffuseColor = material.diffuse; -vec3 diffuseContribution = diffuseIrradiance * diffuseColor * model_iblFactor.x; -vec3 iblColor = specularContribution + diffuseContribution; -#ifdef USE_SUN_LUMINANCE -iblColor *= getSunLuminance(positionWC, normalEC, lightDirectionEC); -#endif -return iblColor; -} -#ifdef DIFFUSE_IBL -vec3 computeDiffuseIBL(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 maxLod = model_specularEnvironmentMapsMaximumLOD; -float lod = roughness * maxLod; -return czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, lod, maxLod); -#else -float maxLod = czm_specularEnvironmentMapsMaximumLOD; -float lod = roughness * maxLod; -return czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, lod, maxLod); -#endif -} -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, float VdotH, vec3 f0, float roughness) -{ -float reflectance = czm_maximumComponent(f0); -vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -vec3 F = fresnelSchlick2(f0, f90, VdotH); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); -return specularSample * (F * brdfLut.x + brdfLut.y); -} -#endif -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL( -vec3 viewDirectionEC, -vec3 normalEC, -vec3 lightDirectionEC, -czm_modelMaterial material -) { -vec3 cubeDir = normalize(model_iblReferenceFrameMatrix * normalize(reflect(-viewDirectionEC, normalEC))); -#ifdef DIFFUSE_IBL -vec3 diffuseContribution = computeDiffuseIBL(cubeDir) * material.diffuse; -#else -vec3 diffuseContribution = vec3(0.0); -#endif -float roughness = material.roughness; -#ifdef USE_ANISOTROPY -vec3 anisotropyDirection = material.anisotropicB; -vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); -vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); -float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); -float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; -vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); -cubeDir = normalize(model_iblReferenceFrameMatrix * normalize(reflect(-viewDirectionEC, bentNormal))); -#endif -#ifdef SPECULAR_IBL -float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001; -vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC); -float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0); -vec3 f0 = material.specular; -vec3 specularContribution = computeSpecularIBL(cubeDir, NdotV, VdotH, f0, roughness); -#else -vec3 specularContribution = vec3(0.0); -#endif -#ifdef USE_SPECULAR -specularContribution *= material.specularWeight; -#endif -return diffuseContribution + specularContribution; -} -#endif -`;var rce={name:"ImageBasedLightingPipelineStage"};rce.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,_e.FRAGMENT),o.addUniform("vec2","model_iblFactor",_e.FRAGMENT),Hm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",_e.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,_e.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,_e.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",_e.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,_e.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(o.addDefine("SPECULAR_IBL",void 0,_e.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,_e.FRAGMENT),o.addUniform("sampler2D","model_specularEnvironmentMaps",_e.FRAGMENT),o.addUniform("vec2","model_specularEnvironmentMapsSize",_e.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",_e.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,_e.FRAGMENT)),l(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,_e.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",_e.FRAGMENT)),o.addFragmentLines(bX);let r={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=ft(r,e.uniformMap)};var gX=rce;var mGn=S(T(),1);var sGn=S(T(),1);var mOe=X.EPSILON16;function yH(e){e=y(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(yH.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,mOe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var fOe=new f,gH=new $;yH.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=fOe,o;switch(t){case Zc.XROTATE:o=$.fromRotationX(X.toRadians(n),gH),e=v.multiplyByMatrix3(e,o,e);break;case Zc.YROTATE:o=$.fromRotationY(X.toRadians(n),gH),e=v.multiplyByMatrix3(e,o,e);break;case Zc.ZROTATE:o=$.fromRotationZ(X.toRadians(n),gH),e=v.multiplyByMatrix3(e,o,e);break;case Zc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=v.multiplyByTranslation(e,i,e);break;case Zc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=v.multiplyByTranslation(e,i,e);break;case Zc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=v.multiplyByTranslation(e,i,e);break;case Zc.XSCALE:i.x=n,i.y=1,i.z=1,e=v.multiplyByScale(e,i,e);break;case Zc.YSCALE:i.x=1,i.y=n,i.z=1,e=v.multiplyByScale(e,i,e);break;case Zc.ZSCALE:i.x=1,i.y=1,i.z=n,e=v.multiplyByScale(e,i,e);break;case Zc.UNIFORMSCALE:e=v.multiplyByUniformScale(e,n,e);break;default:break}return e};var yX=yH;function IU(e){e=y(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,hOe(this)}Object.defineProperties(IU.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 hOe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { -color = clippingPlanesEdgeColor; -} -} -`;var sce={name:"ModelClippingPlanesPipelineStage"},gOe=new B;sce.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,_e.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,_e.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,_e.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,_e.FRAGMENT);let s=gs.getTextureResolution(i,o,gOe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,_e.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,_e.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",_e.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",_e.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",_e.FRAGMENT),r.addFragmentLines(SX);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=Y.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=ft(a,e.uniformMap)};var TX=sce;var kGn=S(T(),1);var PGn=S(T(),1),CX=`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 wGn=S(T(),1),VX=`void modelClippingPolygonsStage() -{ -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var ace={name:"ModelClippingPolygonsPipelineStage"};ace.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,_e.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,_e.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,_e.BOTH),o.addUniform("sampler2D","model_clippingDistance",_e.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",_e.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(CX),o.addFragmentLines(VX);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=ft(r,e.uniformMap)};var LX=ace;var OGn=S(T(),1);function cce(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(cce.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 ZX=cce;var AEn=S(T(),1);var yEn=S(T(),1);var KGn=S(T(),1),RX=`mat4 getInstancingTransform() -{ -mat4 instancingTransform; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform = mat4( -a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, -a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, -a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, -a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 -); -#else -vec3 translation = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation = a_instanceTranslation; -#endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; -#endif -instancingTransform = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation.x, translation.y, translation.z, 1.0 -); -#endif -return instancingTransform; -} -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ -mat4 instancingTransform2D; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform2D = mat4( -a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, -a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, -a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, -a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 -); -#else -vec3 translation2D = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation2D = a_instanceTranslation2D; -#endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; -#endif -instancingTransform2D = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation2D.x, translation2D.y, translation2D.z, 1.0 -); -#endif -return instancingTransform2D; -} -#endif -`;var HGn=S(T(),1),GX=`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 QGn=S(T(),1),EX=`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 XU=new v,yOe=new v,xOe=new v,uce={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:pce,_transformsToTypedArray:_H};uce.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(RX);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,d=s._enablePick&&!n.context.webgl2,m=[];vOe(e,n,i,m,u,d),AOe(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,_e.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",_e.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",_e.VERTEX),p.u_instance_modifiedModelView=function(){let b=v.multiplyTransformation(s.modelMatrix,a.components.transform,XU);return u?v.multiplyTransformation(n.context.uniformState.view3D,b,XU):(n.mode!==oe.SCENE3D&&(b=Vt.basisTo2D(n.mapProjection,b,XU)),v.multiplyTransformation(n.context.uniformState.view,b,XU))},p.u_instance_nodeTransform=function(){return v.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,yOe)},r.addVertexLines(EX)):r.addVertexLines(GX),u){r.addDefine("USE_2D_INSTANCING",void 0,_e.VERTEX),r.addUniform("mat4","u_modelView2D",_e.VERTEX);let b=n.context,h=v.fromTranslation(c.instancingReferencePoint2D,new v);p.u_modelView2D=function(){return v.multiplyTransformation(b.uniformState.view,h,xOe)}}e.uniformMap=ft(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,m)};var WX=new v,_Oe=new f;function SOe(e,t,n,i,o){let r=v.multiplyTransformation(t,e,WX);return r=v.multiplyTransformation(r,n,WX),o=Vt.basisTo2D(i.mapProjection,r,o),o}function TOe(e,t,n,i,o){let r=v.fromTranslation(e,WX),s=v.multiplyTransformation(t,r,WX);s=v.multiplyTransformation(s,n,WX);let a=v.getTranslation(s,_Oe);return o=zi.computeActualEllipsoidPosition(i,a,o),o}function dce(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=v.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=v.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=v.clone(o.computedModelMatrix,t),t=v.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=v.clone(v.IDENTITY,n))}var mce=new v,fce=new v,COe=new v,VOe=new f;function LOe(e,t,n,i){let o=mce,r=fce;dce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:cn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var IX=uce;var CEn=S(T(),1);var TH={};TH.name="ModelMatrixUpdateStage";TH.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;bce(e,t,o,e.transformToRoot),e._transformDirty=!1}};function bce(e,t,n,i){let o;i=v.multiplyTransformation(i,e.transform,new v),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=ft(o,e.uniformMap)};var FX=Sce;var tWn=S(T(),1);var Tce={name:"ClassificationPipelineStage"};Tce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,_e.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||NOe(t,o)};function NOe(e,t){let n=nn.getAttributeBySemantic(e,Zt.POSITION);if(!l(n))throw new ue("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=nn.getAttributeBySemantic(e,Zt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],d=[0],m=r?i[0]:0,p=c[m],b=0;for(let x=1;xJOe(i,t,n)):[]}function JOe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=nn,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let d=0;djOe(n,t)):[]}function jOe(e,t){let{sanitizeGlslIdentifier:n}=nn,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;ad),n.addStructField(Li.STRUCT_ID_METADATA_FS,r,o);let b=`attributes.texCoord_${a}`,h=b;if(l(m)&&!$.equals(m,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,_e.FRAGMENT),i[L]=function(){return m},h=`vec2(${L} * vec3(${b}, 1.0))`}let x=`texture(${p}, ${h}).${c}`,_=s.unpackInShader(x),C=Wce({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:_e.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function Rce(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Ece(Li.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Li.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,s),_e.includesVertexShader(r)&&(e.addStructField(Li.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Gce(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===jt.ENUM)return;let s=Li.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Ece(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,c),_e.includesVertexShader(t.shaderDestination)&&(e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Ece(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 Wce(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:d,scale:m}=n;return a[o]=()=>d,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}var Ud=Li;var $Wn=S(T(),1),s3e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Bg=Object.freeze(s3e);var ga={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Bt};ga.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Bg.TRANSLUCENT?r.pass=Ze.TRANSLUCENT:c===Bg.OPAQUE&&(r.pass=void 0);let u=h3e(s,t);if(!u.customShaderEnabled)return;if(y3e(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,_e.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,_e.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,_e.FRAGMENT);let p=Lb.getDefineName(s.mode);i.addDefine(p,void 0,_e.FRAGMENT)}let d=s.uniforms;for(let p in d)if(d.hasOwnProperty(p)){let b=d[p];i.addUniform(b.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let b=m[p];i.addVarying(b,p)}e.uniformMap=ft(e.uniformMap,s.uniformMap)};function a3e(e){let t={};for(let n=0;n1?(b=e.attributeIndex,e.attributeIndex+=m):p&&!a?b=0:b=e.attributeIndex++,L3e(e,d,b,m,r,s)}v3e(i,t.attributes),t.primitiveType===Ae.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(jX),i.addFragmentLines(QX)};function L3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=nn.getAttributeInfo(t),c=o&&!r;i>1?G3e(e,t,n,i):R3e(e,t,n,c),W3e(s,a,c),E3e(s,a),l(t.semantic)&&Z3e(s,t),I3e(s,a,o),X3e(s,a,c),P3e(s,a)}function Z3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Zt.NORMAL:e.addDefine("HAS_NORMALS");break;case Zt.TANGENT:e.addDefine("HAS_TANGENTS");break;case Zt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Zt.TEXCOORD:case Zt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function R3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Zt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===Zt.POSITION,d=u?0:n,m=cn.getNumberOfComponents(a),p={index:d,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let b=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:b,count:t.count,componentsPerAttribute:m,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function G3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=cn.getNumberOfComponents(s)/i,d=Q.getSizeInBytes(a),m=u*d,p=t.byteStride;for(let b=0;b0,u=!l(a)&&c;if(l(r)&&!u){let x=rYe(a),_=sYe(r,x);aYe(i,_);let V=cYe(_).indexOf("normalMC")>=0,L=nn.getAttributeBySemantic(t,Zt.NORMAL);if(V&&!L)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,_e.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ze.TRANSLUCENT)}let d=o.pointCloudShading;d.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,_e.VERTEX),d.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,_e.VERTEX);let m,p,b;hr.is3DTiles(o.type)&&(p=!0,m=o.content,b=m.tile.refine===Oo.ADD),i.addUniform("vec4","model_pointCloudParameters",_e.VERTEX),i.addVertexLines(a2);let h=e.uniformMap;h.model_pointCloudParameters=function(){let x=tYe,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),x.x=y(d.maximumAttenuation,_),x.x*=n.pixelRatio;let C=nYe(e,t,d,m);x.y=C*d.geometricErrorScale;let V=n.context,L=n.camera.frustum,R;return n.mode===oe.SCENE2D||L instanceof un?R=Number.POSITIVE_INFINITY:R=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=R,p&&(x.w=m.tileset.timeSinceLoad),x}};var Oce=new f;function nYe(e,t,n,i){if(l(i)){let d=i.tile.geometricError;if(d>0)return d}if(l(n.baseResolution))return n.baseResolution;let o=nn.getAttributeBySemantic(t,Zt.POSITION),r=o.count,s=e.runtimeNode.transform,a=f.subtract(o.max,o.min,Oce);a=v.multiplyByPointAsVector(s,a,Oce);let c=a.x*a.y*a.z;return X.cbrt(c/r)}var iYe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},oYe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function rYe(e){let t=Ue(oYe);if(!l(e))return t;for(let n=0;n0,p=l(i.skin),b=l(r),x=!(b&&l(r.fragmentShaderText))||r.mode!==Lb.REPLACE_MATERIAL,_=nn.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&Ae.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,R=l(V)&&V.backFaceCulling,G=n.primitiveType===Ae.POINTS&&(l(s)||L||R),W=o._enableShowOutline&&l(n.outlineCoordinates),w=WYe(o,i,n),P=l(o.classificationType);u&&t.push(f2),t.push($X),C&&t.push(y2),P&&t.push(AX),m&&t.push(r2),p&&t.push(p2),G&&t.push(c2),_&&t.push(JX),x&&t.push(i2),t.push(Dg),t.push(Ud),w.hasPropertyTable&&(t.push(Og),t.push(FX),t.push(UX)),d&&t.push(g2),b&&t.push(zX),t.push(t2),o.allowPicking&&t.push(s2),W&&t.push(d2),t.push(wX),t.push(m2)};function WYe(e,t,n){let i;return l(t.instances)&&(i=nn.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=nn.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var x2=ole;var $Pn=S(T(),1);function EH(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],IYe(this)}Object.defineProperties(EH.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 IYe(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 czm_splitPosition) discard; -if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var vU={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};vU.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,_e.FRAGMENT),i.addFragmentLines(G2);let o={};i.addUniform("float",vU.SPLIT_DIRECTION_UNIFORM_NAME,_e.FRAGMENT),o[vU.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=ft(o,e.uniformMap)};var E2=vU;var Dvn=S(T(),1);function AYe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ue(e.uniformMap),this.alphaOptions=Ue(e.alphaOptions),this.renderStateOptions=Ue(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 W2=AYe;var ewn=S(T(),1);var Kvn=S(T(),1);function MYe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Gh.UNLIT)}var I2=MYe;function NYe(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=Ue(e.uniformMap),this.alphaOptions=Ue(e.alphaOptions),this.renderStateOptions=Ue(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:nn.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=nn.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=f.clone(i.min,new f),this.positionMax=f.clone(i.max,new f),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new I2,this.pickId=void 0}var X2=NYe;function wu(e){e=y(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=v.clone(v.IDENTITY),this._computedModelMatrix2D=v.clone(v.IDENTITY),this._axisCorrectionMatrix=nn.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new v),this._runtimeArticulations={},UYe(this)}Object.defineProperties(wu.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 UYe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;sle(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V0&&(m=Zo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let b=new sf(u,d),h=b.getGlobalProperty("POINTS_LENGTH");if(b.featuresLength=h,!l(h))throw new ue("Feature table global property: POINTS_LENGTH must be defined");let x=b.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=f.unpack(x));let _=tKe(b,m);if(_.rtcCenter=x,_.pointsLength=h,!_.hasPositions){let C=nKe(b);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new ue("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=oKe(b);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=iKe(b);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=rKe(b);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=b.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ue("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=m,_.batchTableBinary=p),_};function tKe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,d,m,p;if(l(s)){o=s.properties;let h=s.byteOffset,x=s.byteLength;if(!l(o)||!l(h)||!l(x))throw new ue("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),d=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let b;return l(i)&&(b={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:ft(o,r),dequantizeInShader:!0}),{draco:b,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:d,hasBatchIds:m}}function nKe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:Zt.POSITION,semantic:Zt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:cn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new ue("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Zt.POSITION,semantic:Zt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:cn.VEC3,quantizedRange:o,quantizedVolumeOffset:f.unpack(r),quantizedVolumeScale:f.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:cn.VEC3}}}function iKe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:Zt.COLOR,semantic:Zt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:cn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Zt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:cn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Zt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:cn.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=Y.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Zt.COLOR,semantic:Zt.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:cn.VEC4,isQuantized:!1,isTranslucent:s}}}function oKe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:Zt.NORMAL,semantic:Zt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:cn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:Zt.NORMAL,semantic:Zt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:cn.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:cn.VEC3}}function rKe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:Zt.FEATURE_ID,semantic:Zt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:cn.SCALAR}}}var Q_=ule;var sKe=Vn.Components,aKe=Vn.Scene,cKe=Vn.Node,lKe=Vn.Primitive,uKe=Vn.Attribute,dle=Vn.Quantization,dKe=Vn.FeatureIdAttribute,mKe=Vn.Material,fKe=Vn.MetallicRoughness;function Yg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(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=vt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=v.IDENTITY}l(Object.create)&&(Yg.prototype=Object.create(ao.prototype),Yg.prototype.constructor=Yg);Object.defineProperties(Yg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Yg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=Q_.parse(this._arrayBuffer,this._byteOffset),this._state=vt.PROCESSING,this._promise=Promise.resolve(this)};Yg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===vt.READY)return!0;if(this._state===vt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=hKe(this,e.context)}return!1};function hKe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=ab.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&pKe(e,i,r),ZKe(e,t),e._state=vt.READY,e}).catch(function(r){e.unload(),e._state=vt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function pKe(e,t,n){e._state=vt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Zt.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:cn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=f.fromElements(c,c,c),d=f.unpack(a.minValues),m=(1<0&&RKe(e,a,m,t),l(n.rtcCenter)&&(d.transform=v.multiplyByTranslation(d.transform,n.rtcCenter,d.transform));let p=n.positions;l(p)&&p.isQuantized&&(d.transform=v.multiplyByTranslation(d.transform,p.quantizedVolumeOffset,d.transform)),e._components=d,e._parsedContent=void 0,e._arrayBuffer=void 0}function RKe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=yn.getPoint(t,a,s),n.mode!==oe.SCENE3D){f.fromElements(s.y,s.z,s.x,s);let d=n.mapProjection,m=d.ellipsoid,p=d.unproject(s,vKe);m.cartographicToCartesian(p,s)}return s}}function XH(e,t,n,i,o,r,s,a,c,u){let d=n+t*i;if(u.x=e[d],u.y=e[d+1],u.z=e[d+2],l(o))if(o.octEncoded){if(u=Fn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let m=u.x;u.x=u.z,u.z=u.y,u.y=m}}else u=f.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=f.add(u,o.quantizedVolumeOffset,u);return u=v.multiplyByPoint(r,u,u),s!==1&&Tr.getPosition(u,c,s,a,u),u}function go(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,hr.GLTF),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._modelMatrix=v.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(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 nX(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=Y.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Lc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,Y.RED);this._silhouetteColor=Y.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ze.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(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 ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,je.NONE),this._heightDirty=this._heightReference!==je.NONE,this._removeUpdateHeightCallback=void 0,this._verticalExaggerationOn=!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 Zh(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=v.clone(v.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?nf.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=f.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new b_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,Cn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===hr.GLTF&&Bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let c=e.credit;typeof c=="string"&&(c=new Ct(c)),this._credits=[],this._credit=c,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,pl.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,Y.BLACK),this._classificationType=e.classificationType,this._statistics=new v2,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(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}function PH(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function FKe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r0&&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 ble(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&&Bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(nf.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=f.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())}},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}}});go.prototype.getNode=function(e){return this._nodesByName[e]};go.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};go.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};go.prototype.makeStyleDirty=function(){this._styleDirty=!0};go.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var MKe=new v,NKe=new $,UKe=new v;go.prototype.update=function(e){let t=!1;try{t=kKe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")PH(this,n);else{let i=nn.getError("model",this._resource,n);PH(this,i)}}if(DKe(this,e),BKe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=nn.getError("model",this._resource,new ue("Failed to load model."));PH(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&FKe(this,i);let o=new P2({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(OKe(this),YKe(this),KKe(this,e),zKe(this),HKe(this,e),JKe(this,e),QKe(this,e),jKe(this,e),qKe(this,e),$Ke(this,e),eze(this,e),this._defaultTexture=e.context.defaultTexture,tze(this,e),nze(this,e),ize(this),oze(this,e),cze(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)),sze(this),lze(this,e),uze(this),dze(this,e)}};function kKe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function DKe(e,t){l(e._customShader)&&e._customShader.update(t)}function BKe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function OKe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=AKe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function YKe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function KKe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r=i&&r<=o}function pze(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r0&&e.alpha<1};go.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function gle(e){return e.context.stencilBuffer}go.prototype.hasSilhouette=function(e){return gle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};go.prototype.hasSkipLevelOfDetail=function(e){if(!hr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};go.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};go.prototype.pick=function(e,t,n,i,o){return N1(this,e,t,n,i,o)};go.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};go.prototype.isDestroyed=function(){return!1};go.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let r=0;r0,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),ple(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function A2(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var lf=go;function Rs(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(Rs.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}}});Rs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Rs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Rs.prototype.applyDebugSettings=function(e,t){t=e?t:Y.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Rs.prototype.applyStyle=function(e){this._model.style=e};Rs.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),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let r=e.clippingPolygons;l(r)&&i.clippingPolygonsDirty&&(n._clippingPolygons=r.enabled&&i._isClippedByPolygon?r:void 0),l(r)&&l(n._clippingPolygons)&&n._clippingPolygons!==r&&(n._clippingPolygons=r,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Jl.REPEAT}),this._ready=!0)};Rs.prototype.isDestroyed=function(){return!1};Rs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};Rs.fromGltf=async function(e,t,n,i){let o=new Rs(e,t,n),s=M2(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await lf.fromGltfAsync(s);return o._model=c,o};Rs.fromB3dm=async function(e,t,n,i,o){let r=new Rs(e,t,n),a=M2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await lf.fromB3dm(a);return r._model=u,r};Rs.fromI3dm=async function(e,t,n,i,o){let r=new Rs(e,t,n),a=M2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await lf.fromI3dm(a);return r._model=c,r};Rs.fromPnts=async function(e,t,n,i,o){let r=new Rs(e,t,n),a=M2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await lf.fromPnts(a);return r._model=c,r};Rs.fromGeoJson=async function(e,t,n,i){let o=new Rs(e,t,n),s=M2(e,t,o,{geoJson:i,resource:n}),a=await lf.fromGeoJson(s);return o._model=a,o};Rs.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function M2(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ze.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return ft(i,o)}var Eh=Rs;var FAn=S(T(),1);function kd(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(kd.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}}});kd.fromJson=function(e,t,n,i){let o=new kd(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};kd.prototype.hasProperty=function(e,t){return!1};kd.prototype.getFeature=function(e){};kd.prototype.applyDebugSettings=function(e,t){};kd.prototype.applyStyle=function(e){};kd.prototype.update=function(e,t){};kd.prototype.pick=function(e,t,n){};kd.prototype.isDestroyed=function(){return!1};kd.prototype.destroy=function(){return de(this)};var N2=kd;var Qkn=S(T(),1);var J5n=S(T(),1);var b9n=S(T(),1);var KAn=S(T(),1);function Hs(e,t,n,i){let o=Hs._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let m=0;m0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Hs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){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;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Hs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t 0.0) -{ -float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); -float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); -float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); -return vec4(sdfColor.rgb, sdfColor.a * alpha); -} -else -{ -float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -return vec4(v_color.rgb, v_color.a * alpha); -} -} -#endif -void main() -{ -vec4 color = texture(u_atlas, v_textureCoordinates); -#ifdef SDF -float outlineWidth = v_outlineWidth; -vec4 outlineColor = v_outlineColor; -float distance = getDistance(v_textureCoordinates); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float smoothing = fwidth(distance); -vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); -vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -color = (center + color1 + color2 + color3 + color4)/5.0; -#else -float smoothing = 1.0/32.0; -color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif -color = czm_gammaCorrect(color); -#else -color = czm_gammaCorrect(color); -color *= czm_gammaCorrect(v_color); -#endif -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; -} -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; -} -#else -if (color.a >= 0.995) -{ -discard; -} -#endif -#endif -#ifdef VECTOR_TILE -color *= u_highlightColor; -#endif -out_FragColor = color; -#ifdef LOG_DEPTH -czm_writeLogDepth(); -#endif -#ifdef FRAGMENT_DEPTH_CHECK -float temp = v_compressed.y; -temp = temp * SHIFT_RIGHT1; -float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; -bool enableDepthTest = temp2 != 0.0; -bool applyTranslate = floor(temp) != 0.0; -if (enableDepthTest) { -temp = v_compressed.z; -temp = temp * SHIFT_RIGHT12; -vec2 dimensions; -dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; -dimensions.x = floor(temp); -temp = v_compressed.w; -temp = temp * SHIFT_RIGHT12; -vec2 imageSize; -imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; -imageSize.x = floor(temp); -vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; -adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); -float epsilonEyeDepth = v_compressed.x + czm_epsilon1; -float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); -if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) -{ -float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) -{ -float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) -{ -discard; -} -} -} -} -#endif -} -`;var QAn=S(T(),1),k2=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 compressedAttribute2; -in vec4 eyeOffset; -in vec4 scaleByDistance; -in vec4 pixelOffsetScaleByDistance; -in vec4 compressedAttribute3; -in vec2 sdf; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) -in vec4 textureCoordinateBoundsOrLabelTranslate; -#endif -#ifdef VECTOR_TILE -in float a_batchId; -#endif -out vec2 v_textureCoordinates; -#ifdef FRAGMENT_DEPTH_CHECK -out vec4 v_textureCoordinateBounds; -out vec4 v_originTextureCoordinateAndTranslate; -out vec4 v_compressed; -out mat2 v_rotationMatrix; -#endif -out vec4 v_pickColor; -out vec4 v_color; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; -#endif -const float UPPER_BOUND = 32768.0; -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) -{ -vec2 halfSize = imageSize * scale * 0.5; -halfSize *= ((direction * 2.0) - 1.0); -vec2 originTranslate = origin * abs(halfSize); -#if defined(ROTATION) || defined(ALIGNED_AXIS) -if (validAlignedAxis || rotation != 0.0) -{ -float angle = rotation; -if (validAlignedAxis) -{ -vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); -angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / -(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); -} -float cosTheta = cos(angle); -float sinTheta = sin(angle); -rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); -halfSize = rotationMatrix * halfSize; -} -else -{ -rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); -} -#endif -mpp = czm_metersPerPixel(positionEC); -positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); -positionEC.xy += (translate + pixelOffset) * mpp; -return positionEC; -} -#ifdef VERTEX_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) -{ -vec4 posWC = czm_eyeToWindowCoordinates(positionEC); -float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); -if (globeDepth == 0.0) -{ -return 0.0; -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); -return eyeCoordinate.z / eyeCoordinate.w; -} -#endif -void main() -{ -vec3 positionHigh = positionHighAndScale.xyz; -vec3 positionLow = positionLowAndRotation.xyz; -float scale = positionHighAndScale.w; -#if defined(ROTATION) || defined(ALIGNED_AXIS) -float rotation = positionLowAndRotation.w; -#else -float rotation = 0.0; -#endif -float compressed = compressedAttribute0.x; -vec2 pixelOffset; -pixelOffset.x = floor(compressed * SHIFT_RIGHT7); -compressed -= pixelOffset.x * SHIFT_LEFT7; -pixelOffset.x -= UPPER_BOUND; -vec2 origin; -origin.x = floor(compressed * SHIFT_RIGHT5); -compressed -= origin.x * SHIFT_LEFT5; -origin.y = floor(compressed * SHIFT_RIGHT3); -compressed -= origin.y * SHIFT_LEFT3; -#ifdef FRAGMENT_DEPTH_CHECK -vec2 depthOrigin = origin.xy; -#endif -origin -= vec2(1.0); -float show = floor(compressed * SHIFT_RIGHT2); -compressed -= show * SHIFT_LEFT2; -#ifdef INSTANCED -vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); -vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); -vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; -#else -vec2 direction; -direction.x = floor(compressed * SHIFT_RIGHT1); -direction.y = compressed - direction.x * SHIFT_LEFT1; -vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); -#endif -float temp = compressedAttribute0.y * SHIFT_RIGHT8; -pixelOffset.y = -(floor(temp) - UPPER_BOUND); -vec2 translate; -translate.y = (temp - floor(temp)) * SHIFT_LEFT16; -temp = compressedAttribute0.z * SHIFT_RIGHT8; -translate.x = floor(temp) - UPPER_BOUND; -translate.y += (temp - floor(temp)) * SHIFT_LEFT8; -translate.y -= UPPER_BOUND; -temp = compressedAttribute1.x * SHIFT_RIGHT8; -float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); -vec2 imageSize = vec2(floor(temp), temp2); -#ifdef FRAGMENT_DEPTH_CHECK -float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); -float applyTranslate = 0.0; -if (labelHorizontalOrigin != 0.0) -{ -applyTranslate = 1.0; -labelHorizontalOrigin -= 2.0; -depthOrigin.x = labelHorizontalOrigin + 1.0; -} -depthOrigin = vec2(1.0) - (depthOrigin * 0.5); -#endif -#ifdef EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) -temp = compressedAttribute3.w; -temp = temp * SHIFT_RIGHT12; -vec2 dimensions; -dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; -dimensions.x = floor(temp); -#endif -#ifdef ALIGNED_AXIS -vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); -temp = compressedAttribute2.z * SHIFT_RIGHT5; -bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; -#else -vec3 alignedAxis = vec3(0.0); -bool validAlignedAxis = false; -#endif -vec4 pickColor; -vec4 color; -temp = compressedAttribute2.y; -temp = temp * SHIFT_RIGHT8; -pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; -pickColor.r = floor(temp); -temp = compressedAttribute2.x; -temp = temp * SHIFT_RIGHT8; -color.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -color.g = (temp - floor(temp)) * SHIFT_LEFT8; -color.r = floor(temp); -temp = compressedAttribute2.z * SHIFT_RIGHT8; -bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; -temp = floor(temp) * SHIFT_RIGHT8; -pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; -pickColor /= 255.0; -color.a = floor(temp); -color /= 255.0; -vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); -vec4 positionEC = czm_modelViewRelativeToEye * p; -#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) -float eyeDepth = positionEC.z; -#endif -positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); -positionEC.xyz *= show; -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; -} -else -{ -lengthSq = dot(positionEC.xyz, positionEC.xyz); -} -#endif -#ifdef EYE_DISTANCE_SCALING -float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); -scale *= distanceScale; -translate *= distanceScale; -if (scale == 0.0) -{ -positionEC.xyz = vec3(0.0); -} -#endif -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency == 0.0) -{ -positionEC.xyz = vec3(0.0); -} -#endif -#ifdef EYE_DISTANCE_PIXEL_OFFSET -float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); -pixelOffset *= pixelOffsetScale; -#endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = compressedAttribute3.x; -float farSq = compressedAttribute3.y; -if (lengthSq < nearSq || lengthSq > farSq) -{ -positionEC.xyz = vec3(0.0); -} -#endif -mat2 rotationMatrix; -float mpp; -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = compressedAttribute3.z; -#endif -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { -float depthsilon = 10.0; -vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; -vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -float globeDepth1 = getGlobeDepth(pEC1); -if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) -{ -vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -float globeDepth2 = getGlobeDepth(pEC2); -if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) -{ -vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -float globeDepth3 = getGlobeDepth(pEC3); -if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) -{ -positionEC.xyz = vec3(0.0); -} -} -} -} -#endif -positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -gl_Position = czm_projection * positionEC; -v_textureCoordinates = textureCoordinates; -#ifdef LOG_DEPTH -czm_vertexLogDepth(); -#endif -#ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) -{ -float zclip = gl_Position.z / gl_Position.w; -bool clipped = (zclip < -1.0 || zclip > 1.0); -if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) -{ -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -v_depthFromNearPlusOne = 1.0; -#endif -} -} -#endif -#ifdef FRAGMENT_DEPTH_CHECK -if (sizeInMeters) { -translate /= mpp; -dimensions /= mpp; -imageSize /= mpp; -} -#if defined(ROTATION) || defined(ALIGNED_AXIS) -v_rotationMatrix = rotationMatrix; -#else -v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); -#endif -float enableDepthCheck = 0.0; -if (lengthSq < disableDepthTestDistance) -{ -enableDepthCheck = 1.0; -} -float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); -float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); -float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); -float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); -v_compressed.x = eyeDepth; -v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; -v_compressed.z = dw * SHIFT_LEFT12 + dh; -v_compressed.w = iw * SHIFT_LEFT12 + ih; -v_originTextureCoordinateAndTranslate.xy = depthOrigin; -v_originTextureCoordinateAndTranslate.zw = translate; -v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; -#endif -#ifdef SDF -vec4 outlineColor; -float outlineWidth; -temp = sdf.x; -temp = temp * SHIFT_RIGHT8; -outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; -outlineColor.r = floor(temp); -temp = sdf.y; -temp = temp * SHIFT_RIGHT8; -float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; -outlineColor.a = floor(temp); -outlineColor /= 255.0; -v_outlineWidth = outlineWidth / 255.0; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency; -#endif -v_pickColor = pickColor; -v_color = color; -v_color.a *= translucency; -} -`;var gMn=S(T(),1);function Zi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Dt.clone(n)),l(i)&&(i=Dt.clone(i)),l(o)&&(o=Dt.clone(o)),l(r)&&(r=It.clone(r)),this._show=y(e.show,!0),this._position=f.clone(y(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._pixelOffset=B.clone(y(e.pixelOffset,B.ZERO)),this._translate=new B(0,0),this._eyeOffset=f.clone(y(e.eyeOffset,f.ZERO)),this._heightReference=y(e.heightReference,je.NONE),this._verticalOrigin=y(e.verticalOrigin,wn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=Y.clone(y(e.color,Y.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=f.clone(y(e.alignedAxis,f.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,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=Nn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=Y.clone(y(e.outlineColor,Y.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping()}var yle=Zi.SHOW_INDEX=0,NU=Zi.POSITION_INDEX=1,Tle=Zi.PIXEL_OFFSET_INDEX=2,_ze=Zi.EYE_OFFSET_INDEX=3,Sze=Zi.HORIZONTAL_ORIGIN_INDEX=4,Tze=Zi.VERTICAL_ORIGIN_INDEX=5,Cze=Zi.SCALE_INDEX=6,UU=Zi.IMAGE_INDEX_INDEX=7,xle=Zi.COLOR_INDEX=8,Vze=Zi.ROTATION_INDEX=9,Lze=Zi.ALIGNED_AXIS_INDEX=10,Zze=Zi.SCALE_BY_DISTANCE_INDEX=11,Rze=Zi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Gze=Zi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Eze=Zi.DISTANCE_DISPLAY_CONDITION=14,Wze=Zi.DISABLE_DEPTH_DISTANCE=15;Zi.TEXTURE_COORDINATE_BOUNDS=16;var _le=Zi.SDF_INDEX=17;Zi.NUMBER_OF_PROPERTIES=18;function Yo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Zi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Yo(this,yle))}},position:{get:function(){return this._position},set:function(e){let t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),this._updateClamping(),Yo(this,NU))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Yo(this,NU))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;B.equals(t,e)||(B.clone(e,t),Yo(this,Tle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Dt.equals(t,e)||(this._scaleByDistance=Dt.clone(e,t),Yo(this,Zze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Dt.equals(t,e)||(this._translucencyByDistance=Dt.clone(e,t),Yo(this,Rze))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Dt.equals(t,e)||(this._pixelOffsetScaleByDistance=Dt.clone(e,t),Yo(this,Gze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;f.equals(t,e)||(f.clone(e,t),Yo(this,_ze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Yo(this,Sze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Yo(this,Tze))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Yo(this,Cze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),Yo(this,xle))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Yo(this,Vze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;f.equals(t,e)||(f.clone(e,t),Yo(this,Lze))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Yo(this,UU))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Yo(this,UU))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Yo(this,xle))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Yo(this,Eze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Yo(this,Wze))}},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._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof We?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Nn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Yo(this,UU))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=f.clone(e,this._actualClampedPosition),Yo(this,NU)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Yo(this,yle))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),Yo(this,_le))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Yo(this,_le))}}});Zi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Zi.prototype._updateClamping=function(){Zi._updateClamping(this._billboardCollection,this)};var kU=new fe;Zi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ie.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===je.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===je.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(u){let d=i.cartographicToCartesian(u,t._clampedPosition);XC(t._heightReference)&&(t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,d)):d.x+=s.height),t._clampedPosition=d}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,kU);let c=n.getHeight(s,t._heightReference);l(c)&&(kU.height=c),a(kU)};Zi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!Je.equals(r._imageSubRegion,i))return;let u=e.textureCoordinates[c];r._imageWidth=e.texture.width*u.width,r._imageHeight=e.texture.height*u.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Yo(r,UU);let d=r._billboardCollection._scene;l(d)&&d.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};Zi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};Zi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Je.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Je.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Zi.prototype._setTranslate=function(e){let t=this._translate;B.equals(t,e)||(B.clone(e,t),Yo(this,Tle))};Zi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Zi.prototype._setActualPosition=function(e){l(this._clampedPosition)||f.clone(e,this._actualPosition),Yo(this,NU)};var Sle=new re;Zi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(v.multiplyByPoint(i,t,Sle),zi.computeActualEllipsoidPosition(n,Sle))};var Cle=new f;Zi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=v.multiplyByPoint(e,t,Cle),a=zi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return B.add(a,i,a),a};var MU=new B(0,0);Zi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new B),B.clone(this._pixelOffset,MU),B.add(MU,this._translate,MU);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,kU);o=a.cartographicToCartesian(c,Cle),i=v.IDENTITY}return Zi._computeScreenSpacePosition(i,o,this._eyeOffset,MU,e,t)};Zi.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===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===wn.BOTTOM||e.verticalOrigin===wn.BASELINE?a-=o:e.verticalOrigin===wn.CENTER&&(a-=o*.5),l(n)||(n=new Je),n.x=s,n.y=a,n.width=i,n.height=o,n};Zi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&f.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Je.equals(this._imageSubRegion,e._imageSubRegion)&&Y.equals(this._color,e._color)&&B.equals(this._pixelOffset,e._pixelOffset)&&B.equals(this._translate,e._translate)&&f.equals(this._eyeOffset,e._eyeOffset)&&Dt.equals(this._scaleByDistance,e._scaleByDistance)&&Dt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Dt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Zi.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 yo=Zi;var xMn=S(T(),1),Ize={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Wo=Object.freeze(Ize);var SMn=S(T(),1),Xze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Js=Object.freeze(Xze);var vMn=S(T(),1);function Rb(e,t,n,i,o){this.bottomLeft=y(e,B.ZERO),this.topRight=y(t,B.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var Pze=new B(16,16);function zg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,Pze);this._context=e.context,this._pixelFormat=y(e.pixelFormat,nt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Nn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(zg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new bt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function vze(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),d=s/c,m=a/u,p=new Rb(new B(s+r,r),new B(c,a)),b=new Rb(new B,new B(c,a),e._root,p),h=new Rb(new B(r,a+r),new B(c,u)),x=new Rb(new B,new B(c,u),b,h);for(let V=0;Vs){t.childNode1=new Rb(new B(t.bottomLeft.x,t.bottomLeft.y),new B(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let p,b;if(l(o._labelDimensions))b=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let R=e._textureAtlas.texture.width;b=Math.round(y(o.width,R*V))}let h=Math.floor(X.clamp(b,0,UH)),x=Math.floor(X.clamp(p,0,UH)),_=h*UH+x;e._instanced?(r=o._index,s(r,a,c,d,_)):(r=o._index*4,s(r+0,a,c,d,_),s(r+1,a,c,d,_),s(r+2,a,c,d,_),s(r+3,a,c,d,_))}function Kle(e,t,n,i,o){if(Ld(o.heightReference)){let h=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=l(h.globe)&&h.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[Ro.textureCoordinateBoundsOrLabelTranslate];if(Mt.maximumVertexTextureImageUnits>0){let h=0,x=0;l(o._labelTranslate)&&(h=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,h,x,0,0)):(r=o._index*4,s(r+0,h,x,0,0),s(r+1,h,x,0,0),s(r+2,h,x,0,0),s(r+3,h,x,0,0));return}let a=0,c=0,u=0,d=0,m=o._imageIndex;if(m!==-1){let h=n[m];a=h.x,c=h.y,u=h.width,d=h.height}let p=a+u,b=c+d;e._instanced?(r=o._index,s(r,a,c,p,b)):(r=o._index*4,s(r+0,a,c,p,b),s(r+1,a,c,p,b),s(r+2,a,c,p,b),s(r+3,a,c,p,b))}function $ze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[Ro.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function zle(e,t,n,i,o){if(!e._sdf)return;let r,s=i[Ro.sdf],a=o.outlineColor,c=o.outlineWidth,u=Y.floatToByte(a.red),d=Y.floatToByte(a.green),m=Y.floatToByte(a.blue),p=u*U1+d*Wh+m,b=c/Js.RADIUS,h=Y.floatToByte(a.alpha)*U1+Y.floatToByte(b)*Wh;e._instanced?(r=o._index,s(r,p,h)):(r=o._index*4,s(r+0,p+Ale,h),s(r+1,p+Mle,h),s(r+2,p+Nle,h),s(r+3,p+Ule,h))}function eHe(e,t,n,i,o){wle(e,t,n,i,o),kle(e,t,n,i,o),Dle(e,t,n,i,o),DH(e,t,n,i,o),BH(e,t,n,i,o),Ble(e,t,n,i,o),Ole(e,t,n,i,o),Yle(e,t,n,i,o),Kle(e,t,n,i,o),$ze(e,t,n,i,o),zle(e,t,n,i,o)}function kH(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;c0){this._vaf=Hze(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),m=this._vaf.writers;for(let P=0;P0){let P=oHe;P.length=0,(c[B2]||c[Nze]||c[Mze])&&P.push(wle),(c[D2]||c[Zle]||c[Fze]||c[Aze]||c[wze])&&(P.push(kle),this._instanced&&P.push(BH)),(c[D2]||c[Uze]||c[Wle])&&(P.push(Dle),P.push(DH)),(c[D2]||c[Gle])&&P.push(DH),c[Rle]&&P.push(BH),c[Ele]&&P.push(Ble),c[Ile]&&P.push(Ole),(c[Xle]||c[kze]||c[D2]||c[B2])&&P.push(Yle),(c[D2]||c[B2])&&P.push(Kle),c[Ple]&&P.push(zle);let F=P.length;if(m=this._vaf.writers,a/n>.1){for(let M=0;Mn*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,x=v.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),nHe(this,e,h);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Wo.OPAQUE||this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:H.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Wo.TRANSLUCENT;this._blendOption===Wo.TRANSLUCENT||this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:P?H.LEQUAL:H.LESS},depthMask:P,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,R,G,W=Mt.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=k2,V=U2,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new De({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(W?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Js.CUTOFF;this._sdf&&L.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT&&(R=new De({defines:["OPAQUE",F],sources:[V]}),this._shaderClampToGround&&(W?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:Ro}),R=new De({defines:["TRANSLUCENT",F],sources:[V]}),this._shaderClampToGround&&(W?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:Ro})),this._blendOption===Wo.OPAQUE&&(R=new De({defines:[F],sources:[V]}),this._shaderClampToGround&&(W?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:Ro})),this._blendOption===Wo.TRANSLUCENT&&(R=new De({defines:[F],sources:[V]}),this._shaderClampToGround&&(W?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:Ro})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let w=e.commandList;if(p.render||p.pick){let P=this._colorCommands,F=this._blendOption===Wo.OPAQUE,M=this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT,g=this._vaf.va,Z=g.length,E=this._uniforms,I;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),I=this._batchTable.getPickId()):I="v_pickColor",P.length=Z;let A=M?Z*2:Z;for(let N=0;N0}},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=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,sHe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=Y.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&k1(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}}});ya.defaultColor=Y.WHITE;ya.defaultPointOutlineColor=Y.BLACK;ya.defaultPointOutlineWidth=0;ya.defaultPointSize=8;function k1(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=y(e._color,ya.defaultColor),i=y(e._pointOutlineColor,ya.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ya.defaultPointOutlineWidth),r=y(e._pointSize,ya.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(Y.equals(n,s)&&Y.equals(i,a)&&o===c&&r===u)return;e._billboardColor=Y.clone(n,e._billboardColor),e._billboardOutlineColor=Y.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let d=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),b=JSON.stringify([m,r,p,o]);t.setImage(b,j_(d,m,p,o,r))}ya.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ya.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ya.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ya.prototype.getPropertyInherited=function(e){return Ys.getPropertyInherited(this._content,this._batchId,e)};ya.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ya.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ya.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ya.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Gb=ya;var yNn=S(T(),1);var I9n=S(T(),1);function aHe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,d=r.width+u|0,m=3*a,p=m/2;c.width=d,c.height=m;let b=c.getContext("2d");b.font=n,b.fillStyle="white",b.fillRect(0,0,c.width+1,c.height+1),i&&(b.strokeStyle="black",b.lineWidth=e.lineWidth,b.strokeText(t,u/2,p)),o&&(b.fillStyle="black",b.fillText(t,u/2,p));let h=b.getImageData(0,0,d,m).data,x=h.length,_=d*4,C,V,L,R;for(C=0;C=0;--C)if(h[C]!==255){R=C/_|0;break}let G=-1;for(C=0;C]/,o=[],r="",s=xs.LTR,a="",c=e.length;for(let u=0;u";case">":return"<"}}var gHe="\u05D0-\u05EA",yHe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",eue=new RegExp(`[${gHe}${yHe}]`);function xHe(e){let t=e.split(` -`),n="";for(let i=0;iu+1?s[u+1].Type===xs.RTL?(c=m+c,a=0):(c=z2(c,a,d.Word),a+=d.Word.length):c=z2(c,0,m)):d.Type===xs.RTL?c=z2(c,a,m):d.Type===xs.LTR?(c+=d.Word,a=c.length):(d.Type===xs.WEAK||d.Type===xs.BRACKETS)&&(u>0&&s[u-1].Type===xs.RTL?s.length>u+1?s[u+1].Type===xs.RTL?c=z2(c,a,m):(c+=d.Word,a=c.length):c+=d.Word:(c+=d.Word,a=c.length))}n+=c,i0,m=t._backgroundBillboard,p=e._backgroundBillboardCollection;d?(l(m)||(m=p.add({collection:e,image:sue,imageSubRegion:VHe}),t._backgroundBillboard=m),m.color=t._backgroundColor,m.show=t._show,m.position=t._position,m.eyeOffset=t._eyeOffset,m.pixelOffset=t._pixelOffset,m.horizontalOrigin=gi.LEFT,m.verticalOrigin=t._verticalOrigin,m.heightReference=t._heightReference,m.scale=t.totalScale,m.pickPrimitive=t,m.id=t._id,m.translucencyByDistance=t._translucencyByDistance,m.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,m.scaleByDistance=t._scaleByDistance,m.distanceDisplayCondition=t._distanceDisplayCondition,m.disableDepthTestDistance=t._disableDepthTestDistance,m.clusterShow=t.clusterShow):l(m)&&(p.remove(m),t._backgroundBillboard=m=void 0);let b=e._glyphTextureCache;for(u=0;u0&&L.height>0){let R=(0,oue.default)(L,{cutoff:Js.CUTOFF,radius:Js.RADIUS}),G=L.getContext("2d"),W=L.width,w=L.height,P=G.getImageData(0,0,W,w);for(let F=0;F0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new B,V._labelTranslate=new B),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=gi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===Ko.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===Ko.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===Ko.OUTLINE&&(V.color=Y.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function iue(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var pr=new B,WHe=new B;function IHe(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,d=1,m,p=t.length,b=e._backgroundBillboard,h=B.clone(l(b)?e._backgroundPadding:B.ZERO,WHe);for(h.x/=e._relativeSize,h.y/=e._relativeSize,m=0;m0&&(C===gi.CENTER?G=-s/2-h.x:C===gi.RIGHT?G=-(s+h.x*2):G=0,pr.x=G*_,V===wn.TOP?pr.y=x-u-c:V===wn.CENTER?pr.y=(x-u)/2-c:V===wn.BASELINE?pr.y=-h.y-c:pr.y=0,pr.y=pr.y*_,b.width=P,b.height=F,b._setTranslate(pr),b._labelTranslate=B.clone(pr,b._labelTranslate)),Ld(e.heightReference))for(m=0;m0?Wo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),de(this)};var Xh=Ih;var W5n=S(T(),1);var _Nn=S(T(),1),H2=`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 YNn=S(T(),1);var PNn=S(T(),1);var gl={};gl.numberOfPoints=function(e,t,n){let i=f.distance(e,t);return Math.ceil(i/n)};gl.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 XHe=new fe;gl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=y(t,v.IDENTITY);let o=v.inverseTransformation(t,PHe),r=v.multiplyByPoint(o,f.ZERO,vHe),s=f.normalize(v.multiplyByPointAsVector(o,f.UNIT_Y,cue),cue),a=on.fromPointNormal(r,s,wHe),c=f.normalize(v.multiplyByPointAsVector(o,f.UNIT_X,lue),lue),u=on.fromPointNormal(r,c,FHe),d=1;n.push(f.clone(e[0]));let m=n[0],p=e.length;for(let b=1;b2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(f.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=v.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Ii.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(fue),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var mue=Au.POSITION_INDEX=0,BHe=Au.SHOW_INDEX=1,OHe=Au.WIDTH_INDEX=2,YHe=Au.MATERIAL_INDEX=3,Q2=Au.POSITION_SIZE_INDEX=4,KHe=Au.DISTANCE_DISPLAY_CONDITION=5,fue=Au.NUMBER_OF_PROPERTIES=6;function Wb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Au.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Wb(this,BHe))}},positions:{get:function(){return this._positions},set:function(e){let t=Lo(e,f.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(f.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Wb(this,Q2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Wb(this,mue),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Wb(this,YHe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Wb(this,OHe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!f.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(f.clone(t[0]))):t.length>2&&f.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Wb(this,Q2)}}},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){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Wb(this,KHe))}}});Au.prototype.update=function(){let e=v.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[mue]>0||this._propertiesChanged[Q2]>0;if((!v.equals(e,this._modelMatrix)||i)&&(this._segments=Ii.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=v.clone(e,this._modelMatrix),this._segments.positions.length!==t)Wb(this,Q2);else{let o=n.length;for(let r=0;r2){if(o[qH]||o[hue]){let h=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Kn.fromCartesian(h.center,Tue),_=re.fromElements(x.low.x,x.low.y,x.low.z,h.radius,Cue);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[QHe]){let h=Vue;h.x=0,h.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(h.x=x.near,h.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c0){let O=F.isTranslucent();a>=s?(g=new He({owner:e}),n.push(g)):g=n[a],++a,Z=ft(p(F._uniforms),e._uniformMap),g.boundingVolume=ae.clone(j2,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=G,g.vertexArray=x.va,g.renderState=O?e._translucentRS:e._opaqueRS,g.pass=O?Ze.TRANSLUCENT:Ze.OPAQUE,g.debugShowBoundingVolume=d,g.pickId="v_pickColor",g.uniformMap=Z,g.count=M,g.offset=R,R+=M,M=0,c=!0,r.push(g)}F=I._material,F.update(o),P=A}let N=I._locatorBuckets,D=N.length;for(let O=0;O0&&(a>=s?(g=new He({owner:e}),n.push(g)):g=n[a],++a,Z=ft(p(F._uniforms),e._uniformMap),g.boundingVolume=ae.clone(j2,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=G,g.vertexArray=x.va,g.renderState=F.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=F.isTranslucent()?Ze.TRANSLUCENT:Ze.OPAQUE,g.debugShowBoundingVolume=d,g.pickId="v_pickColor",g.uniformMap=Z,g.count=M,g.offset=R,c=!0,r.push(g)),P=void 0}}n.length=a}uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){return Lue(this),eJ(this),Zue(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function $He(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[qH]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var bue=[0,0,0];function gue(e,t,n){e._createVertexArray=!1,eJ(e),Lue(e),nJe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],d=0,m=e._polylineBuckets,p,b;for(p in m)m.hasOwnProperty(p)&&(b=m[p],b.updateShader(t,r,s),d+=b.lengthOfPositions);if(d>0){let h=e._mode,x=new Float32Array(6*d*3),_=new Float32Array(d*4),C,V=0,L=0,R=0;for(p in m)if(m.hasOwnProperty(p)){b=m[p],b.write(x,_,V,L,R,r,t,n),h===oe.MORPHING&&(l(C)||(C=new Float32Array(6*d*3)),b.writeForMorph(C,V));let Z=b.lengthOfPositions;V+=6*Z*3,L+=Z*4,R+=Z*4,c=b.updateIndices(i,a,u,c)}let G=e._positionBufferUsage.bufferUsage,W=Me.STATIC_DRAW;e._positionBuffer=ut.createVertexBuffer({context:t,typedArray:x,usage:G});let w;l(C)&&(w=ut.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=ut.createVertexBuffer({context:t,typedArray:_,usage:W});let P=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,M=0,g=i.length;for(let Z=0;Z0){let E=new Uint16Array(o),I=ut.createIndexBuffer({context:t,typedArray:E,usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});M+=a[Z];let A=6*(Z*(P*X.SIXTY_FOUR_KILOBYTES)-M*P),N=P+A,D=P+N,k=P+D,O=P+k,U=P+O,j=Z*(F*X.SIXTY_FOUR_KILOBYTES)-M*F,K=[{index:$l.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:$l.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:$l.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:$l.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:$l.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:D,strideInBytes:6*P},{index:$l.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:$l.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:D,strideInBytes:6*P},{index:$l.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:$l.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:$l.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:$l.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:$l.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:$l.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:j}],te,z,q,ee;h===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",q=bue,ee="value"):h===oe.SCENE2D||h===oe.COLUMBUS_VIEW?(z=bue,te="value",q=e._positionBuffer,ee="vertexBuffer"):(z=w,te="vertexBuffer",q=e._positionBuffer,ee="vertexBuffer"),K[0][te]=z,K[1][te]=z,K[2][ee]=q,K[3][ee]=q,K[4][te]=z,K[5][te]=z,K[6][ee]=q,K[7][ee]=q,K[8][te]=z,K[9][te]=z,K[10][ee]=q,K[11][ee]=q;let pe=new Jn({context:t,attributes:K,indexBuffer:I});e._vertexArrays.push({va:pe,buckets:u[Z]})}}}function eJe(e,t){return t instanceof bt?t.id:t}var KU=[];function tJe(e){let t=Yi._uniformList[e.type],n=t.length;KU.length=2*n;let i=0;for(let o=0;o1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Ph(c,t,n)),u.addPolyline(a)}}}function iJe(e,t){let n=t.mode;(e._mode!==n||!v.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=v.clone(e.modelMatrix),e._createVertexArray=!0)}function $H(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s0,_=b._index,C=this.getSegments(b,a),V=C.positions,L=C.lengths,R=V.length,G=b.getPickId(s).color,W=0,w=0,P;for(let D=0;D0||Gs.x>0&&zd.x<0)&&f.clone(Gs,zd),(Gs.x<0&&Hd.x>0||Gs.x>0&&Hd.x<0)&&f.clone(Gs,Hd));let j=O?2:0,K=U?2:4;for(let te=j;te2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,I),r.setBatchedAttribute(_,4,A))}};var sJe=new f,aJe=new f,cJe=new f,yue=new f;Ph.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r0&&(c=a[a.length-1]+1);let u=this.polylines,d=u.length;for(let m=0;m0)b[0]=x;else continue}else b=p._segments.lengths;let h=b.length;if(h>0){let x=0;for(let _=0;_X.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new jH(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>X.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new jH(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Ph.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new f(u.z,u.x,u.y)}return D1.positions=o,D1.lengths=e._segments.lengths,D1};var _ue;Ph.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=_ue,c=6*s*3;!l(a)||a.lengthc&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),d=u.positions,m=u.lengths,p=0,b=0,h=0,x;s=d.length;for(let _=0;_0||Gs.x>0&&zd.x<0)&&f.clone(Gs,zd),(Gs.x<0&&Hd.x>0||Gs.x>0&&Hd.x<0)&&f.clone(Gs,Hd));let R=V?2:0,G=L?2:4;for(let W=R;W{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,d=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3;for(let b=0;b{e.isDestroyed()||(e._error=a)})}jg.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{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(b.packedBuffer),x=h[0];VJe(e,h),e._indices=ke.getSizeInBytes(x)===2?new Uint16Array(b.indices):new Uint32Array(b.indices),e._indexOffsets=new Uint32Array(b.indexOffsets),e._indexCounts=new Uint32Array(b.indexCounts),e._batchedPositions=new Float32Array(b.positions),e._vertexBatchIds=new Uint16Array(b.batchIds),GJe(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function GJe(e){l(e._primitive)||(e._primitive=new S_({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)}Ib.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Ib.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Ib.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Ib.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Ib.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=RJe(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)};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var tP=Ib;var MUn=S(T(),1);var mUn=S(T(),1),nP=`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 mf(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ie.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(mf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function EJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+le.packedLength+ie.packedLength+f.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,le.pack(t,a,c),c+=le.packedLength,ie.pack(o,a,c),c+=ie.packedLength,f.pack(r,a,c),a}var WJe=new di("createVectorTilePolylines",5),B1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function IJe(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=EJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=WJe.scheduleTask(c,a);if(l(u))return u.then(function(d){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(d.decodedPositions),e._decodedPositionOffsets=new Uint32Array(d.decodedPositionOffsets)),e._currentPositions=new Float32Array(d.currentPositions),e._previousPositions=new Float32Array(d.previousPositions),e._nextPositions=new Float32Array(d.nextPositions),e._expandAndWidth=new Float32Array(d.expandAndWidth),e._vertexBatchIds=new Uint16Array(d.batchIds);let m=d.indexDatatype;e._indices=m===ke.UNSIGNED_SHORT?new Uint16Array(d.indices):new Uint32Array(d.indices),XJe(e,t),e._ready=!0}).catch(d=>{e.isDestroyed()||(e._error=d)})}function XJe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=ut.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),d=ut.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),m=ut.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=ut.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),b=ut.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),h=ut.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),x=[{index:B1.previousPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:B1.currentPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:B1.nextPosition,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:B1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:B1.a_batchId,vertexBuffer:b,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Jn({context:t,attributes:x,indexBuffer:h}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var iP=new v,Gue=new f;function PJe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return v.clone(n,iP),v.multiplyByPoint(iP,e._center,Gue),v.setTranslation(iP,Gue,iP),iP},u_highlightColor:function(){return e._highlightColor}})}function vJe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Oe.fromCache({blending:hn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var wJe=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function FJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(nP),o=n.getFragmentShaderCallback(!1,void 0,!1)(wJe),r=new De({defines:["VECTOR_TILE",At.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ru,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:B1})}function AJe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new He({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ze.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}mf.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r 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 Xb(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ie.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new B(mi._defaultMinTerrainHeight,mi._defaultMaxTerrainHeight),this._boundingVolume=Wn.fromRectangle(e.rectangle,mi._defaultMinTerrainHeight,mi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function DJe(e,t,n){let i=mi.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;Wn.fromRectangle(c,o,r,n,a)}function BJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+le.packedLength+ie.packedLength+f.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,le.pack(t,a,c),c+=le.packedLength,ie.pack(o,a,c),c+=ie.packedLength,f.pack(r,a,c),a}var OJe=new di("createVectorTileClampedPolylines"),qg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function YJe(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=BJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=OJe.scheduleTask(c,a);if(l(u))return u.then(function(d){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(d.decodedPositions),e._decodedPositionOffsets=new Uint32Array(d.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(d.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(d.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(d.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(d.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(d.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(d.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(d.vertexBatchIds);let m=d.indexDatatype;e._indices=m===ke.UNSIGNED_SHORT?new Uint16Array(d.indices):new Uint32Array(d.indices),KJe(e,t),e._ready=!0}).catch(d=>{e.isDestroyed()||(e._error=d)})}function KJe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,d=n.byteLength+i.byteLength;d+=o.byteLength+r.byteLength,d+=s.byteLength+a.byteLength,d+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=d;let m=ut.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=ut.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),b=ut.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),h=ut.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=ut.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=ut.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=ut.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=ut.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),L=[{index:qg.startEllipsoidNormal,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:qg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:qg.startPositionAndHeight,vertexBuffer:b,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:qg.endPositionAndHeight,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:qg.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:qg.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:qg.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Jn({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var sP=new v,Eue=new f;function zJe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return v.clone(n,sP),v.multiplyByPoint(sP,e._center,Eue),v.setTranslation(sP,Eue,sP),sP},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Wue(e){return Oe.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:hn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},backFunction:On.EQUAL,backOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function HJe(e){l(e._rs)||(e._rs=Wue(!1),e._rs3DTiles=Wue(!0))}function JJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(oP),o=n.getFragmentShaderCallback(!1,void 0,!0)(rP),r=new De({defines:["VECTOR_TILE",At.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ru,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:qg})}function QJe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new He({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ze.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=He.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ze.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Bn.TERRAIN||i===Bn.BOTH)&&t.commandList.push(n),(i===Bn.CESIUM_3D_TILE||i===Bn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Xb.prototype.getPositions=function(e){return tS.getPolylinePositions(this,e)};Xb.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o{e.isDestroyed()||(e._error=t)})}Xb.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=tQe(this).then(YJe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}zJe(this,t),JJe(this,t),HJe(this);let n=e.passes;(n.render||n.pick)&&QJe(this,e)};Xb.prototype.isDestroyed=function(){return!1};Xb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var aP=Xb;var Wkn=S(T(),1);var nJ=32767,nQe=new fe,iQe=new f;function oQe(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 u=new Float64Array(e.length);for(let d=0;d0&&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 u=l(n)||l(i)||l(o),d=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&d)throw new ue("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(c),r=0;r0&&(C=Zo(i,n,u),n+=u,d>0&&(V=new Uint8Array(t,n,d),V=new Uint8Array(V),n+=d));let L=y(x.POLYGONS_LENGTH,0),R=y(x.POLYLINES_LENGTH,0),G=y(x.POINTS_LENGTH,0),W=L+R+G,w=new eb(e,W,C,V,rQe(e));if(e._batchTable=w,W===0)return;let P=new sf(x,_),F=P.getGlobalProperty("REGION");if(!l(F))throw new ue("Feature table global property: REGION must be defined");let M=le.unpack(F),g=F[4],Z=F[5],E=e._tile.computedTransform,I=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(I)?(I=f.unpack(I),v.multiplyByPoint(E,I,I)):(I=le.center(M),I.height=X.lerp(g,Z,.5),I=ie.WGS84.cartographicToCartesian(I));let A=sQe(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ue("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let D=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(D))throw new ue("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=N.reduce(function(z,q){return z+q*2},0),O=D.reduce(function(z,q){return z+q},0),U=new Uint32Array(t,n,O);n+=m;let j=new Uint16Array(t,n,k);n+=p;let K,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(K=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new tP({positions:j,counts:N,indexCounts:D,indices:U,minimumHeight:g,maximumHeight:Z,polygonMinimumHeights:K,polygonMaximumHeights:te,center:I,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,batchIds:A.polygons,modelMatrix:E})}if(R>0){P.featuresLength=R;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ue("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let D=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(D)){D=new Uint16Array(R);for(let te=0;te0){let N=new Uint16Array(t,n,G*3);n+=h,e._points=new eP({positions:N,batchIds:A.points,minimumHeight:g,maximumHeight:Z,rectangle:M,batchTable:w})}}function iJ(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}}hf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};hf.prototype.getFeature=function(e){return l(this._features)||iJ(this),this._features[e]};hf.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)};hf.prototype.applyStyle=function(e){l(this._features)||iJ(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)};hf.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)||iJ(this),this._batchTable.update(e,t),this._ready=!0)};hf.prototype.pick=function(e,t,n){};hf.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function uQe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c=0?i[r]:void 0}var oS=fQe;var DDn=S(T(),1);var wDn=S(T(),1);function wb(e){e=y(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(wb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wb.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};wb.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};wb.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};wb.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};wb.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};wb.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};wb.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var dP=wb;function rJ(e,t){let n=si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){rJ._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=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new dP({tile:n,class:o})}}rJ._oneTimeWarning=Bt;var mP=rJ;var dBn=S(T(),1);var JDn=S(T(),1);function hQe(e){let t=new Uint8Array(e),n=cl(t);if(n==="glTF"&&(n="glb"),Es.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=pQe(t);if(l(i.root))return{contentType:Es.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Es.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Es.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Es.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Es.VOXEL_JSON,jsonPayload:i};throw new ue("Invalid tile content.")}function pQe(e){let t;try{t=Zo(e)}catch{throw new ue("Invalid tile content.")}return t}var wh=hQe;function Qd(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;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;sxQe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function xQe(e,t,n){if(l(t))try{let i=wh(t);if(i.contentType===Es.EXTERNAL_TILESET)throw new ue("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Es.GEOMETRY||i.contentType===Es.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=nS[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=iS(o,u));let d=oS(o,u);return l(d)&&(a.group=new g_({metadata:d})),a}catch(i){Pue(e,n,i)}}function Pue(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}`))}Qd.prototype.cancelRequests=function(){for(let e=0;ea?b=X.TWO_PI-c+a:b=a-c;let x=Math.ceil(b/t)+1,_=Math.ceil(h/t)+1,C=b/(x-1),V=h/(_-1),L=le.northwest(e,r),R=le.center(e,TQe);(n!==0||i!==0)&&(R.longitude=0;h--)Ws.computePosition(t,n,!1,b,h,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(h=0,b=i-2;b>0;b--)Ws.computePosition(t,n,!1,b,h,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;let _=m.length/3*2,C=ke.createTypedArray(m.length/3,_),V=0;for(let R=0;R0){qd.longitude=(t.west+t.east)*.5,qd.latitude=u;let x=n.cartographicToCartesian(qd,z1.origin);f.clone(c,z1.direction);let _=on.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Due);ei.rayPlane(z1,_,e.southwestCornerCartesian),d=n.geodeticSurfaceNormal(x,JU)}else d=n.geodeticSurfaceNormalCartographic(le.southeast(t),JU);let m=f.cross(d,a,kue);f.normalize(m,e.southNormal);let p=t.north,b;if(p<0){qd.longitude=(t.west+t.east)*.5,qd.latitude=p;let x=n.cartographicToCartesian(qd,z1.origin);f.negate(c,z1.direction);let _=on.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Due);ei.rayPlane(z1,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(x,JU)}else b=n.geodeticSurfaceNormalCartographic(le.northwest(t),JU);let h=f.cross(a,b,kue);f.normalize(h,e.northNormal)}var vQe=new f,wQe=new f,FQe=new f(0,-1,0),AQe=new f(0,0,-1),Bue=new f;function MQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!le.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,d=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,b=e.eastNormal,h=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(le.southwest(e.rectangle),vQe),u.z=u.y,u.y=u.x,u.x=0,d=t.mapProjection.project(le.northeast(e.rectangle),wQe),d.z=d.y,d.y=d.x,d.x=0,m=FQe,b=f.UNIT_Y,p=AQe,h=f.UNIT_Z);let x=f.subtract(i,u,Bue),_=f.dot(x,m),C=f.dot(x,p),V=f.subtract(i,d,Bue),L=f.dot(V,b),R=f.dot(V,h);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:R>0&&(r+=R*R)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):on.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,on.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=gJ(on.projectPointOntoPlane(c,t,bJ),i[0],c,o),f.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=Que(t,p[0],p[1]),f.distance(a,t)}let d=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=gJ(on.projectPointOntoPlane(c,t,bJ),i[r],c,this._edgeNormals[n[r]]),m=f.distanceSquared(a,t),m3)return a=gJ(on.projectPointOntoPlane(this._boundingPlanes[1],t,bJ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),f.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?f.distance(t,this._vertices[(n[1]-2+u)%4]):f.distance(t,this._vertices[4+(n[1]-2+u)%4])};var t4e=new f,n4e=new f;function Que(e,t,n){let i=f.subtract(n,t,t4e),o=f.subtract(e,t,n4e),r=f.dot(i,o);if(r<=0)return t;let s=f.dot(i,i);return r>=s?n:(r=r/s,new f((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var i4e=new on(f.UNIT_X,0);function gJ(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c0&&(h=!0,m+=u),s1||si(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?v.unpack(n.transform):v.clone(v.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=v.multiply(a,this.transform,new v),u=l(i)?i._initialTransform:v.IDENTITY;this._initialTransform=v.multiply(u,this.transform,new v),this.computedTransform=c,this.metadata=mP(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let d;l(s)&&l(s.boundingVolume)&&(d=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=d,this._contentBoundingVolume2D=void 0;let m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,rr._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")&&rr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Oo.REPLACE:Oo.ADD):l(i)?p=i.refine:p=Oo.REPLACE,this.refine=p,this.children=[],this.parent=i;let b,h=!1,x,_,C;if(t=We.createIfNeeded(t),r)x=zo.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&(rr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(rr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),b=new O1(e,this),h=!0,x=zo.READY):(x=zo.UNLOADED,_=t.getDerivedResource({url:G}),C=fc.getServerKey(_.getUrlComponent()))}else b=new O1(e,this),h=!0,x=zo.READY;this._content=b,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,R;l(V)&&(L=V.duration,l(V.date)&&(R=ne.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=R,this.lastStyleTime=0,this._optimChildrenWithinParent=Jd.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=Y.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ne,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}rr._deprecationWarning=po;Object.defineProperties(rr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(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 Y),Y.clone(this._color)},set:function(e){this._color=Y.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===zo.READY}},contentUnloaded:{get:function(){return this._contentState===zo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===zo.EXPIRED}},contentFailed:{get:function(){return this._contentState===zo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ey=new f;function u4e(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=f.multiplyByScalar(s.directionWC,e._centerZDepth,ey),c=f.add(s.positionWC,a,ey),u=f.subtract(c,r,ey);if(f.magnitude(u)>o){let R=f.normalize(u,ey),G=f.multiplyByScalar(R,o,ey),W=f.add(r,G,ey),w=f.subtract(W,s.positionWC,ey),P=f.normalize(w,ey);e._foveatedFactor=1-Math.abs(f.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Oo.REPLACE,b=n.isSkippingLevelOfDetail;if(p&&!b||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&b||n._pass===No.PRELOAD_FLIGHT||n._pass===No.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*h;if(e._foveatedFactor<=x)return!1;let _=h-x,C=X.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var ide=new ne;rr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,d=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof un){let b=u.offCenterFrustum;l(b)&&(u=b);let h=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(d,m);p=s/h}else{let b=Math.max(this._distanceToCamera,X.EPSILON7),h=u.sseDenominator;if(p=s*m/(b*h),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=X.fog(b,x)*_;p-=C}}return p/=e.pixelRatio,p};function d4e(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 m4e(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}rr.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=m4e(n,this),this._priorityProgressiveResolution=d4e(n,this),this.priorityDeferred=u4e(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};rr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ne.now(ide);ne.lessThan(this.expireDate,e)&&(this._contentState=zo.EXPIRED,this._expiredContent=this._content)}};function f4e(e){if(!l(e.expireDuration))return;let t=ne.now(ide);ne.addSeconds(t,e.expireDuration,t),l(e.expireDate)?ne.lessThan(e.expireDate,t)&&ne.clone(t,e.expireDate):e.expireDate=ne.clone(t)}function h4e(e){return function(){return e._priority}}rr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?p4e(this):g4e(this)};function p4e(e){let t=e._content,n=e._tileset;if(!l(t)){let o=si(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new fP(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=zo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=zo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=zo.FAILED,o})}async function b4e(e,t,n,i,o){let r=e._contentState;e._contentState=zo.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=zo.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 y4e(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=zo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=zo.FAILED,a}}function g4e(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new $o({throttle:!0,throttleByServer:!0,type:fs.TILES3D,priorityFunction:h4e(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 b4e(e,o,i,n,r)}async function y4e(e,t){let n=wh(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Es.GEOMETRY||n.contentType===Es.VECTOR,(n.contentType===Es.IMPLICIT_SUBTREE||n.contentType===Es.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Es.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=nS[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=iS(i,s));let a=oS(i,s);return l(a)&&(o.group=new g_({metadata:a})),o}rr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};rr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=zo.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 ode=new ae;function _J(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,ode);e._boundingVolume2D=new Nb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function x4e(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,ode);e._contentBoundingVolume2D=new Nb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}rr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=_J(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Ot.INSIDE,a===Ot.OUTSIDE)return bs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Ot.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};rr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Ot.INSIDE;if(this._visibilityPlaneMask===bs.MASK_INSIDE)return Ot.INSIDE;let t=e.cullingVolume,n=x4e(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Ot.INSIDE,s===Ot.OUTSIDE)return Ot.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Ot.OUTSIDE,s===Ot.INSIDE)return Ot.OUTSIDE}return t.computeVisibility(n)};rr.prototype.distanceToTile=function(e){return _J(this,e).distanceToCamera(e)};var _4e=new f;rr.prototype.distanceToTileCenter=function(e){let n=_J(this,e).boundingVolume,i=f.subtract(n.center,e.camera.positionWC,_4e);return f.dot(e.camera.directionWC,i)};rr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var rde=new $,sde=new f,S4e=new $,SJ=new f,ade=new le,cde=new Wn,xJ=new v;function T4e(e,t,n){let i=f.fromElements(e[0],e[1],e[2],SJ),o=$.fromArray(e,3,S4e);i=v.multiplyByPoint(t,i,i);let r=v.getMatrix3(t,rde);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Nu(i,o)}function C4e(e,t,n,i){let o=le.unpack(e,0,ade),r=e[4],s=e[5],a=Wn.fromRectangle(o,r,s,ie.WGS84,cde),c=a.center,u=a.halfAxes;t=v.multiplyTransformation(t,v.inverseTransformation(n,xJ),xJ),c=v.multiplyByPoint(t,c,c);let d=v.getMatrix3(t,rde);return u=$.multiply(d,u,u),l(i)&&i instanceof Nu?(i.update(c,u),i):new Nu(c,u)}function V4e(e,t,n,i){if(!v.equalsEpsilon(t,n,X.EPSILON8))return C4e(e,t,n,i);let o=le.unpack(e,0,ade);return l(i)?(i.rectangle=le.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new $d({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function L4e(e,t,n){let i=f.fromElements(e[0],e[1],e[2],SJ),o=e[3];i=v.multiplyByPoint(t,i,i);let r=v.getScale(t,sde),s=f.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Nb(i,o)}rr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=v_.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ue("boundingVolume must be defined");if(si(e,"3DTILES_bounding_volume_S2"))return new gP(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=T4e(r,t,n);return this._verticalExaggeration!==1&&ede(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=V4e(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Nu?ede(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Tr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Tr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ie.WGS84))),c}if(l(a)){let c=L4e(a,t,n);if(this._verticalExaggeration!==1){let u=Tr.getPosition(c.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,SJ),d=c.radius*this._verticalExaggeration;c.update(u,d)}return c}throw new ue("boundingVolume must contain a sphere, region, or box")};var Z4e=f.unpackArray(new Array(8*3).fill(0));function ede(e,t,n){let i=e.boundingVolume.computeCorners(Z4e).map(r=>Tr.getPosition(r,ie.WGS84,t,n,r)),o=Wn.fromPoints(i,cde);e.update(o.center,o.halfAxes)}rr.prototype.updateTransform=function(e,t){e=y(e,v.IDENTITY);let n=v.multiplyTransformation(e,this.transform,xJ),i=!v.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&v.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()};rr.prototype.updateGeometricErrorScale=function(){let e=v.getScale(this.computedTransform,sde),t=f.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function R4e(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=Y.WHITE:c=Y.DARKGRAY:c=Y.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Y.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(Y.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=Y.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function G4e(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=zo.FAILED,o}}function E4e(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 W4e(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)}rr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;E4e(this,e),W4e(this,e),R4e(this,e,t,n),G4e(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;se.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};fS.prototype.trim=function(){this._trimTiles=!0};var TP=fS;var fKn=S(T(),1);function ek(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 CJ(e,t){let n;return t==="_loadTimestamp"?n=ne.toDate(e).getTime():n=e,n}ek.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=CJ(e,n),this._referenceMaximum[n]=CJ(t,n)};function P4e(e,t){let n=e.tilePropertyName;if(l(n)){let i=CJ(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 TJ=[new Y(.1,.1,.1,1),new Y(.153,.278,.878,1),new Y(.827,.231,.49,1),new Y(.827,.188,.22,1),new Y(1,.592,.259,1),new Y(1,.843,0,1)];ek.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=P4e(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,u=TJ.length-1,d=c*u,m=Math.floor(d),p=Math.ceil(d),b=d-m,h=TJ[m],x=TJ[p],_=Y.clone(Y.WHITE);_.red=X.lerp(h.red,x.red,b),_.green=X.lerp(h.green,x.green,b),_.blue=X.lerp(h.blue,x.blue,b),e._debugColor=_};ek.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 CP=ek;var bKn=S(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.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};function tk(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,d=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-d:d):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),l(o)){let m=o.length;for(let p=0;p>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function LJ(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}ZP.encode2D=function(e,t){return(mde(e)|mde(t)<<1)>>>0};ZP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=fde(e),t[1]=fde(e>>1),t};ZP.encode3D=function(e,t,n){return VJ(e)|VJ(t)<<1|VJ(n)<<2};ZP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=LJ(e),t[1]=LJ(e>>1),t[2]=LJ(e>>2),t};var ty=ZP;function Ho(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===is.OCTREE&&(this.z=e.z)}Object.defineProperties(Ho.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===is.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===is.OCTREE?ty.encode3D(this.x,this.y,this.z):ty.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===is.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Ho.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===is.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Ho.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===is.OCTREE?this.z===e.z:!0)};Ho.prototype.isImplicitTilesetRoot=function(){return this.level===0};Ho.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Ho.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Ho.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===is.OCTREE&&(e.z=this.z),e};var hde=[0,0,0];Ho.fromMortonIndex=function(e,t,n,i){let o;return e===is.OCTREE?(o=ty.decode3D(i,hde),new Ho({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=ty.decode2D(i,hde),new Ho({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Ho.fromTileIndex=function(e,t,n){let i,o,r;return e===is.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),Ho.fromMortonIndex(e,t,i,r)};var pS=Ho;var HKn=S(T(),1);var DKn=S(T(),1);function Bb(){}Bb.selectTiles=function(e,t){he.throwInstantiationError()};Bb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Bb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Bb.selectTile=function(e,t){if(e.contentVisibility(t)===Ot.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];pde(r,t),e._visible=r._visible;return}if(M4e(e,t)){e._visible=!1;return}let i=e.refine===Oo.REPLACE,o=e._optimChildrenWithinParent===Jd.USE_OPTIMIZATION;if(i&&o&&n&&!N4e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function M4e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Oo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function N4e(e,t){let n=!1,i=e.children;for(let o=0;o0;){RP.stackMaximumLength=Math.max(RP.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Oo.ADD,u=a.refine===Oo.REPLACE,d=k4e(a);d&&D4e(a,s,t),(c||u&&!d)&&(B4e(e,a),o(a,t),O4e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return RP.stack.trim(RP.stackMaximumLength),n};function k4e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function D4e(e,t,n){let{children:i}=e;for(let o=0;o0;){EP.stackMaximumLength=Math.max(EP.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,d=!l(u)||u._refines;c._refines=i(c)?Y4e(c,a,t)&&d:!1;let m=!c._refines&&d;c.hasRenderableContent?c.refine===Oo.ADD?(ZJ(c,t),o(c,t)):c.refine===Oo.REPLACE&&(o(c,t),m&&ZJ(c,t)):(n._emptyTiles.push(c),o(c,t),m&&ZJ(c,t)),r(c,t),s(c,t)}}function z4e(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=js,s=!0,a=WP.stack;for(a.push(e);a.length>0;){WP.stackMaximumLength=Math.max(WP.stackMaximumLength,a.length);let c=a.pop(),u=c.children,d=u.length,m=!c.hasRenderableContent&&n(c);if(!m&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),m)for(let p=0;p0;){PP.stackMaximumLength=Math.max(PP.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;cn._depth+e.skipLevels)}function q4e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=js;for(let u=0;ut:e._screenSpaceError>t:!0}function eje(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}=js,c=XP.stack;for(c.push(e);c.length>0;){XP.stackMaximumLength=Math.max(XP.stackMaximumLength,c.length);let u=c.pop();Q4e(u,t);let d=u.parent,m=!l(d)||d._refines;u._refines=o(u)?q4e(u,c,t)&&m:!1;let p=!u._refines&&m;u.hasRenderableContent?u.refine===Oo.ADD?(nk(u,t),r(u,t)):u.refine===Oo.REPLACE&&($4e(u,i)?(r(u,t),p&&nk(u,t)):p?(nk(u,t),r(u,t)):j4e(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&nk(u,t)),s(u,t),a(u,t)}}function tje(e,t){let{selectTile:n,canTraverse:i}=js,{stack:o,ancestorStack:r}=Ob,s;for(o.push(e);o.length>0||r.length>0;){if(Ob.stackMaximumLength=Math.max(Ob.stackMaximumLength,o.length),Ob.ancestorStackMaximumLength=Math.max(Ob.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Oo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let d=0;dmi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Vt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=v.clone(s._initialClippingPlanesOriginMatrix),s};sr.loadJson=function(e){return We.createIfNeeded(e).fetchJson()};sr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};sr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ue("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ue("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&sr.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=xde(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===Oo.ADD;let u=c._header.children;if(l(u))for(let d=0;d_.minimumRadius){let L=fe.fromCartesian(V,_,ije);n=f.normalize(a.positionWC,_de),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=v.multiplyByPoint(x,a.positionWC,sje);if(n=f.UNIT_Z,i=v.multiplyByPointAsVector(x,a.directionWC,aje),i=f.normalize(i,i),o=L.z,u instanceof Nu){let R=$.getColumn(C.halfAxes,2,cje),G=f.magnitude(R);r=V.z-G,s=V.z+G}else if(u instanceof Nb){let R=C.radius;r=V.z-R,s=V.z+R}}}let d=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*d,p=s,b=X.clamp((o-m)/(p-m),0,1),h=1-Math.abs(f.dot(i,n));h=h*(1-b),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function uje(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=>{Cde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?Vje(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Tde(e,t){return e._priority-t._priority}sr.prototype.postPassesUpdate=function(e){l(this._root)&&(dje(this,e),Zje(this,e),this._cache.unloadTiles(this,Lde),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};sr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;yje(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=ne.clone(e.time)),this._timeSinceLoad=Math.max(ne.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&lje(this,e),e.newFrame&&this._cache.reset()};function dje(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o=1;if(r._contentState!==zo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function mje(e){let t=e._requestedTiles;t.sort(Tde);for(let n=0;n0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`))}function fje(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=o)}t.length-=n}var hje=new fe,pje=new fe,bje=new f;function gje(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=fe.clone(r.positionCartographic,hje),c=fe.fromCartesian(o.center,s,pje);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,bje);f.distance(u,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function yje(e,t){fje(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;cs){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(d){--r.numberOfTilesProcessing,Cde(d,e,u)}}e.totalMemoryUsageInBytes0&&xje(e)}function xje(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n0&&(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: ${Sde(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Sde(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ri({stencil:0,pass:Ze.CESIUM_3D_TILE,renderState:Oe.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,d=n.isRender,m=i.length;for(let h=0;h=0;--_)i[m+x+_]=i[m+_];for(let _=0;_0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Xh),Tje(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Vde=[];function Vje(e,t){let n=t,i=Vde;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r{t.push(Ct.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;oi.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}sr.prototype.getTraversal=function(e){let{pass:t}=e;return t===No.MOST_DETAILED_PRELOAD||t===No.MOST_DETAILED_PICK?GP:this.isSkippingLevelOfDetail?vP:IP};sr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};sr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===No.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===No.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===No.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=No.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r);let d=this._clippingPolygons;l(d)&&d.enabled&&d.queueCommands(e);let m=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=Eje(this,e,m,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};sr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};sr.prototype.isDestroyed=function(){return!1};sr.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=Vde;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a{let d=ae.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),m=ae.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return d-m});let a;for(let c=0;c-1;i--)EJ(this,e[i],t,n);return de(this)};ny.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ht.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ht.DONE):ht.FAILED:ht.PENDING};ny.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):(EJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],EJ(this,r,a,c),s.remove(r.id)};function EJ(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function Fje(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await xa.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 wP=ny;var FHn=S(T(),1);var Aje=Y.WHITE,Mje=Y.BLACK,Nje=new B(2,2);function nV(e){e=y(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:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});nV.prototype.getType=function(e){return"Checkerboard"};nV.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=J.getValueOrClonedDefault(this._evenColor,e,Aje,t.lightColor),t.darkColor=J.getValueOrClonedDefault(this._oddColor,e,Mje,t.darkColor),t.repeat=J.getValueOrDefault(this._repeat,e,Nje),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 eJn=S(T(),1);var zHn=S(T(),1);var Rde={id:void 0};function FP(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 Wc(e){this._owner=e,this._entities=new Gt,this._addedEntities=new Gt,this._removedEntities=new Gt,this._changedEntities=new Gt,this._suspendCount=0,this._collectionChanged=new be,this._id=Nn(),this._show=!0,this._firing=!1,this._refire=!1}Wc.prototype.suspendEvents=function(){this._suspendCount++};Wc.prototype.resumeEvents=function(){this._suspendCount--,FP(this)};Object.defineProperties(Wc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t-1;c--)s=a[c],Ede(e,p,b,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Mr.prototype._onCollectionChanged,e),a=u.values,b=u.id,c=a.length-1;c>-1;c--){s=a[c],Gde(e,p,b,s);let x=m.getById(s.id);l(x)||(x=d.getById(s.id),l(x)?WJ(x):(ok.id=s.id,x=new ir(ok)),m.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),d.suspendEvents(),d.removeAll();let h=m.values;for(r=0;r=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),WJ(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let b=t.length;for(s=0;s=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?WJ(u):(ok.id=x,u=new ir(ok),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Mr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],d=!l(u),m=!0;for(let p=s-1;p>=0;p--){let b=o[p].getById(e.id);if(l(b)){let h=b[t];if(l(h)){if(m)if(m=!1,l(h.merge)&&l(h.clone))u=h.clone(u);else{u=h;break}u.merge(h)}}}d&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var IJ=Mr;var ZJn=S(T(),1);var _Jn=S(T(),1);var nJn=S(T(),1);function XJ(){this._removalFunctions=[]}XJ.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)}};XJ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ur.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ur.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ur.prototype.contains=function(e){return this.indexOf(e)>=0};var PJ=new Zn;Ur.prototype.indexOf=function(e){let t=this._intervals;PJ.start=e,PJ.stop=e;let n=wo(t,PJ,wJ);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-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(o=ne.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)?(ne.greaterThan(e.stop,n[i-1].stop)?e=new Zn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Zn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=ne.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Zn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Zn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Zn({start:e.start,stop:ne.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ne.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Zn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ur.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=wo(t,e,wJ);n<0&&(n=~n);let i=!1;for(n>0&&(ne.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ne.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Zn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Zn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=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),AP[2]=vm(u)?29:28;a>AP[c]||c>=13;)a>AP[c]&&(a-=AP[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),AP[2]=vm(u)?29:28;return Ic.millisecond=i,Ic.second=o,Ic.minute=r,Ic.hour=s,Ic.day=a,Ic.month=c,Ic.year=u,ne.fromGregorianDate(Ic,n)}var Uje=new ne,kje=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Ide(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(kje);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"),ne.toGregorianDate(ne.fromIso8601(e,Uje),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var MP=new Gp;Ur.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=ne.fromIso8601(n[0]),o=ne.fromIso8601(n[1]),r=[];if(!Ide(n[2],MP))r.push(i,o);else{let s=ne.clone(i);for(r.push(s);ne.compare(s,o)<0;)s=vJ(s,MP),ne.compare(o,s)<=0&&ne.clone(o,s),r.push(s)}return Ur.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DateArray=function(e,t){return Ur.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ne.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u=0?-a:a}var t8e=new f(-1,0,0),gS=new v,n8e=new v,MJ=new $,i8e=$.IDENTITY.clone(),o8e=new f,r8e=new re,Xde=new f;function Yb(e,t,n,i,o,r,s,a){let c=o8e,u=r8e;gS=Vt.eastNorthUpToFixedFrame(e,o,gS),c=v.multiplyByPointAsVector(gS,t8e,c),c=f.normalize(c,c);let d=e8e(c,t,e,o);MJ=$.fromRotationZ(d,MJ),Xde.z=r,gS=v.multiplyTransformation(gS,v.fromRotationTranslation(MJ,Xde,n8e),gS);let m=i8e;m[0]=s;for(let p=0;p0){let x=u?2:1;for(let _=0;_=0};var c8e=new f,l8e=new f;NP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=$je(e,r),a=i._granularity,c=i._cornerType,u=o?a8e(t,n):Pde(t,n),d=o?Pde(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,h=[],x=o?[]:void 0,_=Oje,C=Yje,V=Kje,L=zje,R=Hje,G=Jje,W=Qje,w=jje,P=qje,F=e[0],M=e[1];L=r.geodeticSurfaceNormal(F,L),_=f.subtract(M,F,_),_=f.normalize(_,_),w=f.cross(L,_,w),w=f.normalize(w,w);let g=s[0],Z=s[1];o&&(x=Yb(F,w,d,x,r,g+m,1,1)),P=f.clone(F,P),F=M,C=f.negate(_,C);let E,I;for(let D=1;DLe;p--)Te=X.PI_OVER_TWO-p*ye,ee[ce++]=1-pe*(1+Math.cos(Te)),ee[ce++]=.5*(1+Math.sin(Te));for(p=Le;p>0;p--)Te=X.PI_OVER_TWO-ye*p,ee[ce++]=1-xe*(1+Math.cos(Te)),ee[ce++]=.5*(1+Math.sin(Te));for(p=d-_;p>0;p--)ee[ce++]=p*xe,ee[ce++]=1;for(p=1;p0;p--)ee[ce++]=(p-1)*xe,ee[ce++]=1}c.st=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:W.normals})),t.tangent&&(c.tangent=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:W.tangents})),t.bitangent&&(c.bitangent=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:W.bitangents})),{attributes:c,indices:k}}function T8e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let d=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,b=Hde,h=Jde,x=uk,_=dk,C=S8e,V=Qde,L=c;for(u=0;u-t?(o=E8e,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),OJ(e,o,i)};Ah.prototype.computeHorizonCullingPoint=function(e,t,n){return fme(this._ellipsoid,e,t,n)};var dme=ie.clone(ie.UNIT_SPHERE);Ah.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=mme(this._ellipsoid,n,dme);return fme(o,e,t,i)};Ah.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return hme(this._ellipsoid,e,t,n,i,o)};Ah.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=mme(this._ellipsoid,o,dme);return hme(s,e,t,n,i,r)};var W8e=[];Ah.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=le.subsample(e,t,0,W8e),o=ae.fromPoints(i);if(!(f.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var I8e=new f;function mme(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=f.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,I8e);e=ie.fromCartesian3(i,n)}return e}function fme(e,t,n,i){l(i)||(i=new f);let o=gme(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/f.magnitudeSquared(r)>o)}var X8e=new f,P8e=new f;function pme(e,t,n){let i=e.transformPositionToScaledSpace(t,X8e),o=f.magnitudeSquared(i),r=Math.sqrt(o),s=f.divideByScalar(i,r,P8e);o=Math.max(1,o),r=Math.max(1,r);let a=f.dot(s,n),c=f.magnitude(f.cross(s,n,s)),u=1/r,d=Math.sqrt(o-1)*u;return 1/(a*u-c*d)}function bme(e,t,n){if(!(t<=0||t===1/0||t!==t))return f.multiplyByScalar(e,t,n)}var BJ=new f;function gme(e,t){return f.equals(t,f.ZERO)?t:(e.transformPositionToScaledSpace(t,BJ),f.normalize(BJ,BJ))}var Hb=Ah;var tjn=S(T(),1);function Br(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Dt.clone(n)),l(i)&&(i=Dt.clone(i)),l(o)&&(o=It.clone(o)),this._show=y(e.show,!0),this._position=f.clone(y(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._color=Y.clone(y(e.color,Y.WHITE)),this._outlineColor=Y.clone(y(e.outlineColor,Y.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var yme=Br.SHOW_INDEX=0,Sme=Br.POSITION_INDEX=1,v8e=Br.COLOR_INDEX=2,w8e=Br.OUTLINE_COLOR_INDEX=3,F8e=Br.OUTLINE_WIDTH_INDEX=4,A8e=Br.PIXEL_SIZE_INDEX=5,M8e=Br.SCALE_BY_DISTANCE_INDEX=6,N8e=Br.TRANSLUCENCY_BY_DISTANCE_INDEX=7,U8e=Br.DISTANCE_DISPLAY_CONDITION_INDEX=8,k8e=Br.DISABLE_DEPTH_DISTANCE_INDEX=9;Br.NUMBER_OF_PROPERTIES=10;function om(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Br.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,om(this,yme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),om(this,Sme))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Dt.equals(t,e)||(this._scaleByDistance=Dt.clone(e,t),om(this,M8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Dt.equals(t,e)||(this._translucencyByDistance=Dt.clone(e,t),om(this,N8e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,om(this,A8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),om(this,v8e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),om(this,w8e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,om(this,F8e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),om(this,U8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,om(this,k8e))}},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,om(this,yme))}}});Br.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Br.prototype._getActualPosition=function(){return this._actualPosition};Br.prototype._setActualPosition=function(e){f.clone(e,this._actualPosition),om(this,Sme)};var xme=new re;Br._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(v.multiplyByPoint(n,e,xme),zi.computeActualEllipsoidPosition(t,xme))};var _me=new re;Br._computeScreenSpacePosition=function(e,t,n,i){let o=v.multiplyByVector(e,re.fromElements(t.x,t.y,t.z,1,_me),_me);return zi.worldToWindowCoordinates(n,o,i)};Br.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new B);let i=n.modelMatrix,o=Br._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Br.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 Je),n.x=r,n.y=s,n.width=a,n.height=c,n};Br.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&f.equals(this._position,e._position)&&Y.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&Y.equals(this._outlineColor,e._outlineColor)&&Dt.equals(this._scaleByDistance,e._scaleByDistance)&&Dt.equals(this._translucencyByDistance,e._translucencyByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Br.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var $s=Br;var Xjn=S(T(),1);var ijn=S(T(),1),cy=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -void main() -{ -float distanceToCenter = length(gl_PointCoord - vec2(0.5)); -float maxDistance = max(0.0, 0.5 - v_pixelDistance); -float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); -float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); -vec4 color = mix(v_outlineColor, v_color, innerAlpha); -color.a *= wholeAlpha; -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; -} -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; -} -#else -if (color.a >= 0.995) -{ -discard; -} -#endif -#endif -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); -} -`;var rjn=S(T(),1),YP=`uniform float u_maxTotalPointSize; -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 scaleByDistance; -in vec3 distanceDisplayConditionAndDisableDepth; -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -void main() -{ -vec3 positionHigh = positionHighAndSize.xyz; -vec3 positionLow = positionLowAndOutline.xyz; -float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; -float totalSize = positionHighAndSize.w + outlineWidthBothSides; -float outlinePercent = outlineWidthBothSides / totalSize; -totalSize *= czm_pixelRatio; -float temp = compressedAttribute1.x * SHIFT_RIGHT8; -float show = floor(temp); -#ifdef EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -vec4 color; -vec4 outlineColor; -vec4 pickColor; -temp = compressedAttribute0.z * SHIFT_RIGHT8; -pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; -pickColor.r = floor(temp); -temp = compressedAttribute0.x * SHIFT_RIGHT8; -color.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -color.g = (temp - floor(temp)) * SHIFT_LEFT8; -color.r = floor(temp); -temp = compressedAttribute0.y * SHIFT_RIGHT8; -outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; -temp = floor(temp) * SHIFT_RIGHT8; -outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; -outlineColor.r = floor(temp); -temp = compressedAttribute0.w * SHIFT_RIGHT8; -pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; -pickColor = pickColor / 255.0; -temp = floor(temp) * SHIFT_RIGHT8; -outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; -outlineColor /= 255.0; -color.a = floor(temp); -color /= 255.0; -vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); -vec4 positionEC = czm_modelViewRelativeToEye * p; -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; -} -else -{ -lengthSq = dot(positionEC.xyz, positionEC.xyz); -} -#endif -#ifdef EYE_DISTANCE_SCALING -totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif -if (totalSize > 0.0) { -totalSize += 3.0; -} -totalSize = min(totalSize, u_maxTotalPointSize); -if (totalSize < 1.0) -{ -positionEC.xyz = vec3(0.0); -totalSize = 1.0; -} -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency < 0.004) -{ -positionEC.xyz = vec3(0.0); -} -#endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = distanceDisplayConditionAndDisableDepth.x; -float farSq = distanceDisplayConditionAndDisableDepth.y; -if (lengthSq < nearSq || lengthSq > farSq) { -positionEC.xyz = vec3(0.0, 0.0, 1.0); -} -#endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) -{ -float zclip = gl_Position.z / gl_Position.w; -bool clipped = (zclip < -1.0 || zclip > 1.0); -if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) -{ -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif -} -} -#endif -v_color = color; -v_color.a *= translucency * show; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency * show; -v_innerPercent = 1.0 - outlinePercent; -v_pixelDistance = 2.0 / totalSize; -gl_PointSize = totalSize * show; -gl_Position *= show; -v_pickColor = pickColor; -} -`;var D8e=$s.SHOW_INDEX,zJ=$s.POSITION_INDEX,Tme=$s.COLOR_INDEX,B8e=$s.OUTLINE_COLOR_INDEX,O8e=$s.OUTLINE_WIDTH_INDEX,Y8e=$s.PIXEL_SIZE_INDEX,Cme=$s.SCALE_BY_DISTANCE_INDEX,Vme=$s.TRANSLUCENCY_BY_DISTANCE_INDEX,Lme=$s.DISTANCE_DISPLAY_CONDITION_INDEX,K8e=$s.DISABLE_DEPTH_DISTANCE_INDEX,HJ=$s.NUMBER_OF_PROPERTIES,Pc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function rm(e){e=y(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(HJ),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._modelMatrix=v.clone(v.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Wo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(rm.prototype,{length:{get:function(){return JJ(this),this._pointPrimitives.length}}});function Zme(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),r(o,s,a,u)}function H8e(e,t,n,i){Rme(e,t,n,i),Gme(e,t,n,i),Eme(e,t,n,i),Wme(e,t,n,i),Ime(e,t,n,i)}function KJ(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;c0){this._vaf=z8e(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G0){let G=j8e;G.length=0,(r[zJ]||r[O8e]||r[Y8e])&&G.push(Rme),(r[Tme]||r[B8e])&&G.push(Gme),(r[D8e]||r[Vme])&&G.push(Eme),r[Cme]&&G.push(Wme),(r[Lme]||r[K8e])&&G.push(Ime);let W=G.length;if(a=this._vaf.writers,o/n>.1){for(let w=0;wn*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=v.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,m=ae.clone(this._baseVolumeWC,this._boundingVolume)):m=ae.clone(this._baseVolume2D,this._boundingVolume),Q8e(this,e,m);let b=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,b&&(this._blendOption===Wo.OPAQUE||this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:H.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Wo.TRANSLUCENT||this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:H.LEQUAL},depthMask:!1,blending:hn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,x;(b||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new De({sources:[YP]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT&&(x=new De({defines:["OPAQUE"],sources:[cy]}),this._sp=qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:Pc}),x=new De({defines:["TRANSLUCENT"],sources:[cy]}),this._spTranslucent=qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:Pc})),this._blendOption===Wo.OPAQUE&&(x=new De({sources:[cy]}),this._sp=qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:Pc})),this._blendOption===Wo.TRANSLUCENT&&(x=new De({sources:[cy]}),this._spTranslucent=qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:x,attributeLocations:Pc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,R=e.commandList;if(u.render||d){let G=this._colorCommands,W=this._blendOption===Wo.OPAQUE,w=this._blendOption===Wo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let P=w?C*2:C;for(L=0;L>4;if(o!==QJ)throw new Error(`Got v${o} data when expected v${QJ}.`);let r=Xme[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=Xme.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,zP,t),this.coords=new this.ArrayType(this.data,zP+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(zP+s+a+c),this.ids=new this.IndexArrayType(this.data,zP,t),this.coords=new this.ArrayType(this.data,zP+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(QJ<<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 qJ(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let d=c.pop()||0,m=c.pop()||0,p=c.pop()||0;if(m-p<=a){for(let _=p;_<=m;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&u.push(r[_])}continue}let b=p+m>>1,h=s[2*b],x=s[2*b+1];h>=t&&h<=i&&x>=n&&x<=o&&u.push(r[b]),(d===0?t<=h:n<=x)&&(c.push(p),c.push(b-1),c.push(1-d)),(d===0?i>=h:o>=x)&&(c.push(b+1),c.push(m),c.push(1-d))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let d=a.pop()||0,m=a.pop()||0,p=a.pop()||0;if(m-p<=s){for(let _=p;_<=m;_++)Pme(r[2*_],r[2*_+1],t,n)<=u&&c.push(o[_]);continue}let b=p+m>>1,h=r[2*b],x=r[2*b+1];Pme(h,x,t,n)<=u&&c.push(o[b]),(d===0?t-i<=h:n-i<=x)&&(a.push(p),a.push(b-1),a.push(1-d)),(d===0?t+i>=h:n+i>=x)&&(a.push(b+1),a.push(m),a.push(1-d))}return c}};function qJ(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;vme(e,t,s,i,o,r),qJ(e,t,n,i,s-1,1-r),qJ(e,t,n,s+1,o,1-r)}function vme(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,d=n-i+1,m=Math.log(u),p=.5*Math.exp(2*m/3),b=.5*Math.sqrt(m*p*(u-p)/u)*(d-u/2<0?-1:1),h=Math.max(i,Math.floor(n-d*p/u+b)),x=Math.min(o,Math.floor(n+(u-d)*p/u+b));vme(e,t,n,h,x,r)}let s=t[2*n+r],a=i,c=o;for(HP(e,t,i,n),t[2*o+r]>s&&HP(e,t,i,o);as;)c--}t[2*i+r]===s?HP(e,t,i,c):(c++,HP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function HP(e,t,n,i){jJ(e,n,i),jJ(t,2*n,2*i),jJ(t,2*n+1,2*i+1)}function jJ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Pme(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function xf(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(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=y(e.show,!0)}function wme(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var q8e=new Je;function Fme(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Jg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=yo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=$s.getScreenSpaceBoundingBox(e,t,o)),wme(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Mme(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Jg.getScreenSpaceBoundingBox(s,t,q8e);wme(a,n),o=Je.union(o,a,o)}return o}function $8e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Mme(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 Ame(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 Mme(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function $J(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s0){let A=new JP(V.length,64,Uint32Array);for(let N=0;N=d)for(Ame(N.position,Z,g,e),p.push(N),R=0;R=d){let U=f.multiplyByScalar(O,1/Z,O);for(Ame(U,Z,g,e),p.push({position:U,width:k.width,height:k.height,minimumWidth:W.width,minimumHeight:W.height}),R=0;R0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let d=this;return Promise.resolve().then(function(){d._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]}xf.prototype.getLabel=tQ("_labelCollection",Xh,"_unusedLabelIndices","labelIndex");xf.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};xf.prototype.getBillboard=tQ("_billboardCollection",Fu,"_unusedBillboardIndices","billboardIndex");xf.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};xf.prototype.getPoint=tQ("_pointCollection",uV,"_unusedPointIndices","pointIndex");xf.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 eQ(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,o7e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};xf.prototype.destroy=function(){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(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 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=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Uu=xf;function iQ(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 qs(this),this._entityCluster=new Uu}Object.defineProperties(iQ.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){Dr.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}}});iQ.prototype.update=function(e){return!0};var QP=iQ;var a7n=S(T(),1);var V8n=S(T(),1);var a8n=S(T(),1);var Nme={};Nme.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),d,m=0,p=0,b=o?a*3:0,h=o?(a+i)*3:i*3;for(d=0;d0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let d=ke.createTypedArray(s,c*2),m=0,p;for(p=0;p0)for(p=0;p0){for(c=0;c=t;i--)e[i]=e[a--]}for(i=0;i=0||l(m)&&ne.compare(d,m)>=0));){for(mQ[p++]=d,r=r+1,s=0;s0&&(fQ.length=b,Kme(n,u,fQ),mQ.length=p,Kme(t,c,mQ))}else{for(s=0;so)return;if(this._backwardExtrapolationType===Du.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let R=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Du.NONE||o!==0&&ne.secondsDifference(e,R)>o)return;if(this._forwardExtrapolationType===Du.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,d=this._interpolationAlgorithm,m=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let R=Math.min(d.getRequiredDataPoints(this._interpolationDegree,p),i);R!==this._numberOfPoints&&(this._numberOfPoints=R,c.length=R,u.length=R*m)}let b=this._numberOfPoints-1;if(b<1)return;let h=0,x=i-1;if(x-h+1>=b+1){let R=a-(b/2|0)-1;Rx&&(G=x,R=G-b,R0){n=new Array(t);for(let i=0;ic&&e!==Object}let h=typeof e.unpack=="function"&&e!==sm;if(!b&&!p){m?t[n]=new qn(h?e.unpack(u,0):u):t[n]=$me(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=ne.fromIso8601(C)),b&&!p){x instanceof Ou||(t[n]=x=new Ou(e)),x.addSamplesPackedArray(u,_),yk(i,x);return}let V;if(!b&&p){a=a.clone(),m?a.data=h?e.unpack(u,0):u:a.data=$me(e,s,i),l(x)||(t[n]=x=m?new t0:new Xc),m&&x instanceof t0?x.intervals.addInterval(a):x instanceof Xc?(m&&(a.data=new qn(a.data)),x.intervals.addInterval(a)):(t[n]=x=rfe(x),m&&(a.data=new qn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Xc),x instanceof Xc||(t[n]=x=rfe(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof Ou))&&(V=a.clone(),V.data=new Ou(e),L.addInterval(V)),V.data.addSamplesPackedArray(u,_),yk(i,V.data)}function gfe(e,t){if(e instanceof Ou){e.removeSamples(t);return}else if(e instanceof t0){e.intervals.removeInterval(t);return}else if(e instanceof Xc){let n=e.intervals;for(let i=0;ic),!h&&!p){m?e[t]=new ol(f.unpack(u),b):e[t]=rv(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=ne.fromIso8601(C)),h&&!p){(!(x instanceof Ta)||l(b)&&x.referenceFrame!==b)&&(e[t]=x=new Ta(b,a)),x.addSamplesPackedArray(u,_),yk(n,x);return}let V;if(!h&&p){s=s.clone(),m?s.data=f.unpack(u):s.data=rv(r,n.reference),l(x)||(m?x=new e0(b):x=new _a(b),e[t]=x),m&&x instanceof e0&&l(b)&&x.referenceFrame===b?x.intervals.addInterval(s):x instanceof _a?(m&&(s.data=new ol(s.data,b)),x.intervals.addInterval(s)):(e[t]=x=sfe(x),m&&(s.data=new ol(s.data,b)),x.intervals.addInterval(s));return}l(x)?x instanceof _a||(e[t]=x=sfe(x)):e[t]=x=new _a(b);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof Ta)||l(b)&&V.data.referenceFrame!==b)&&(V=s.clone(),V.data=new Ta(b,a),L.addInterval(V)),V.data.addSamplesPackedArray(u,_),yk(n,V.data)}function yfe(e,t){if(e instanceof Ta){e.removeSamples(t);return}else if(e instanceof e0){e.intervals.removeInterval(t);return}else if(e instanceof _a){let n=e.intervals;for(let i=0;i. 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=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function g6e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=br(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new r_),Se(Boolean,s,"show",o.show,r,i,n),Se(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Se(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Se(Number,s,"height",o.height,r,i,n),Se(je,s,"heightReference",o.heightReference,r,i,n),Se(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Se(je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Se(sm,s,"rotation",o.rotation,r,i,n),Se(sm,s,"stRotation",o.stRotation,r,i,n),Se(Number,s,"granularity",o.granularity,r,i,n),Se(Boolean,s,"fill",o.fill,r,i,n),Yu(s,"material",o.material,r,i,n),Se(Boolean,s,"outline",o.outline,r,i,n),Se(Y,s,"outlineColor",o.outlineColor,r,i,n),Se(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Se(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Se(Cn,s,"shadows",o.shadows,r,i,n),Se(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Se(Bn,s,"classificationType",o.classificationType,r,i,n),Se(Number,s,"zIndex",o.zIndex,r,i,n)}function y6e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=br(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new s_),Se(Boolean,s,"show",o.show,r,i,n),Se(f,s,"radii",o.radii,r,i,n),Se(f,s,"innerRadii",o.innerRadii,r,i,n),Se(Number,s,"minimumClock",o.minimumClock,r,i,n),Se(Number,s,"maximumClock",o.maximumClock,r,i,n),Se(Number,s,"minimumCone",o.minimumCone,r,i,n),Se(Number,s,"maximumCone",o.maximumCone,r,i,n),Se(je,s,"heightReference",o.heightReference,r,i,n),Se(Boolean,s,"fill",o.fill,r,i,n),Yu(s,"material",o.material,r,i,n),Se(Boolean,s,"outline",o.outline,r,i,n),Se(Y,s,"outlineColor",o.outlineColor,r,i,n),Se(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Se(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Se(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Se(Number,s,"subdivisions",o.subdivisions,r,i,n),Se(Cn,s,"shadows",o.shadows,r,i,n),Se(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function x6e(e,t,n,i){let o=t.label;if(!l(o))return;let r=br(o.interval),s=e.label;l(s)||(e.label=s=new Om),Se(Boolean,s,"show",o.show,r,i,n),Se(String,s,"text",o.text,r,i,n),Se(String,s,"font",o.font,r,i,n),Se(Ko,s,"style",o.style,r,i,n),Se(Number,s,"scale",o.scale,r,i,n),Se(Boolean,s,"showBackground",o.showBackground,r,i,n),Se(Y,s,"backgroundColor",o.backgroundColor,r,i,n),Se(B,s,"backgroundPadding",o.backgroundPadding,r,i,n),Se(B,s,"pixelOffset",o.pixelOffset,r,i,n),Se(f,s,"eyeOffset",o.eyeOffset,r,i,n),Se(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Se(wn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Se(je,s,"heightReference",o.heightReference,r,i,n),Se(Y,s,"fillColor",o.fillColor,r,i,n),Se(Y,s,"outlineColor",o.outlineColor,r,i,n),Se(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Se(Dt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Se(Dt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Se(Dt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Se(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Se(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function _6e(e,t,n,i){let o=t.model;if(!l(o))return;let r=br(o.interval),s=e.model;l(s)||(e.model=s=new Hp),Se(Boolean,s,"show",o.show,r,i,n),Se(av.default,s,"uri",o.gltf,r,i,n),Se(Number,s,"scale",o.scale,r,i,n),Se(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Se(Number,s,"maximumScale",o.maximumScale,r,i,n),Se(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Se(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Se(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Se(Cn,s,"shadows",o.shadows,r,i,n),Se(je,s,"heightReference",o.heightReference,r,i,n),Se(Y,s,"silhouetteColor",o.silhouetteColor,r,i,n),Se(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Se(Y,s,"color",o.color,r,i,n),Se(Lc,s,"colorBlendMode",o.colorBlendMode,r,i,n),Se(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Se(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a-1;c--)n[c](s,e,t,i)}pQ=void 0}function W6e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ke.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=ne.secondsDifference(s,r),c=Math.round(a/120);return t=new Sf,t.startTime=ne.clone(r),t.stopTime=ne.clone(s),t.clockRange=Or.LOOP_STOP,t.multiplier=c,t.currentTime=ne.clone(r),t.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Sf,t.startTime=Ke.MINIMUM_VALUE.clone(),t.stopTime=Ke.MAXIMUM_VALUE.clone(),t.currentTime=Ke.MINIMUM_VALUE.clone(),t.clockRange=Or.LOOP_STOP,t.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=br(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=ne.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Or[n.range],Or.LOOP_STOP)),l(n.step)&&(t.clockStep=y(xo[n.step],xo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function _fe(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Ct(s)),e._credit=s,typeof t=="string"||t instanceof We){t=We.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let d=0;d1;--g){if(C=X.PI_OVER_TWO-(g-1)*_,G=EV(-C,r,h,b,c,d,u,m,p,G),W=EV(C+Math.PI,r,h,b,c,d,u,m,p,W),t){for(L[R++]=G.x,L[R++]=G.y,L[R++]=G.z,E=2*(g-1)+2,Z=1;Z1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aX.PI&&(m.north=m.north>0?X.PI_OVER_TWO-X.EPSILON7:m.north,m.south=m.south<0?X.EPSILON7-X.PI_OVER_TWO:m.south,m.east=X.PI,m.west=-X.PI),m}function Uh(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ie.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,X.RADIANS_PER_DEGREE),s=y(e.vertexFormat,we.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=f.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=we.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Uh.packedLength=f.packedLength+ie.packedLength+we.packedLength+9;Uh.pack=function(e,t,n){return n=y(n,0),f.pack(e._center,t,n),n+=f.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Nfe=new f,Ufe=new ie,kfe=new we,Nh={center:Nfe,ellipsoid:Ufe,vertexFormat:kfe,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};Uh.unpack=function(e,t,n){t=y(t,0);let i=f.unpack(e,t,Nfe);t+=f.packedLength;let o=ie.unpack(e,t,Ufe);t+=ie.packedLength;let r=we.unpack(e,t,kfe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],d=e[t++],m=e[t++],p=e[t++],b=e[t++]===1,h=e[t];return l(n)?(n._center=f.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=d,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=b,n._offsetAttribute=h===-1?void 0:h,n):(Nh.height=d,Nh.extrudedHeight=p,Nh.granularity=m,Nh.stRotation=u,Nh.rotation=c,Nh.semiMajorAxis=s,Nh.semiMinorAxis=a,Nh.shadowVolume=b,Nh.offsetAttribute=h===-1?void 0:h,new Uh(Nh))};Uh.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ie.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,X.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Mfe(n,o,r,a,s,i,t)};Uh.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=U6e(o);else if(r=A6e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ie({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new mt({attributes:r.attributes,indices:r.indices,primitiveType:Ae.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Uh.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Uh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};function k6e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=iu.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;c0){let h=Math.min(u,c);b=Math.round(c/h);let x=Math.min(b*u,c);for(p=0;p0&&(R=!0,C+=c-1),s0&&d!==x-1&&m!==0&&m!==_-1&&(M[K]=!0),K++;p=0;let te,z;for(d=1;d=Be&&d1||G>1))for(let Z=0;Z0;d-=u)Te=d*3,j=MV(j,ee,Te,p,_),ee+=6,o.st&&(z=NV(z,pe,d*2,G),pe+=4),n&&(xe+=3,K[xe++]=W[Te],K[xe++]=W[Te+1],K[xe++]=W[Te+2]),q&&(te[ce++]=1,ce+=1);if(E){let Be=ye;for(Te=Be*3,d=0;d<2;d++)j=MV(j,ee,Te,p,_),ee+=6,o.st&&(z=NV(z,pe,Be*2,G),pe+=4),n&&(xe+=3,K[xe++]=W[Te],K[xe++]=W[Te+1],K[xe++]=W[Te+2]),q&&(te[ce++]=1,ce+=1)}else for(d=u-1;d>=0;d--)Te=d*3,j=MV(j,ee,Te,p,_),ee+=6,o.st&&(z=NV(z,pe,d*2,G),pe+=4),n&&(xe+=3,K[xe++]=W[Te],K[xe++]=W[Te+1],K[xe++]=W[Te+2]),q&&(te[ce++]=1,ce+=1);let Le=Oqe(j,o,a);o.st&&(Le.attributes.st=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Le.attributes.extrudeDirection=new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:K})),P&&(Le.attributes.applyOffset=new Ie({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Xe=ke.createTypedArray(U,D*6),Re,Ne,yt,Nt;b=j.length/3;let pt=0;for(d=0;d0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(AS.prototype._onEntityPropertyChanged,this)}AS.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=nr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance: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=nr.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=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}DV.prototype.remove=function(e){Nhe(this._solidItems,e)||Nhe(this._translucentItems,e)};function Uhe(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=nr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=nr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{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=nr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=nr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};BV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new nl({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=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};OV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=nr.getValue(e,this.materialProperty,this.material),n=new nl({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=nr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};KV.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;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new fn({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;r0)for(m=!0,t=0;t0)for(m=!0,t=0;t-1;a--)c=s[a],u=c.id,d=this._updaterSets.get(u),d.entity===c?d.forEach(function(x){m._removeUpdater(x),m._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,d=this._updaterSets.get(u),d.forEach(this._removeUpdater.bind(this)),d.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,d=new MS(c,this._scene),this._updaterSets.set(u,d),d.forEach(function(x){m._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,d.geometryChanged.addEventListener(ou._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,b=this._batches,h=b.length;for(a=0;a-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 Fv=ou;var Sdi=S(T(),1);var U$e=1,k$e="30px sans-serif",D$e=Ko.FILL,B$e=Y.WHITE,O$e=Y.BLACK,Y$e=1,K$e=!1,z$e=new Y(.165,.165,.165,.8),H$e=new B(7,5),J$e=B.ZERO,Q$e=f.ZERO,j$e=je.NONE,q$e=gi.CENTER,$$e=wn.CENTER,eet=new f,tet=new Y,net=new Y,iet=new Y,oet=new B,ret=new f,set=new B,aet=new Dt,cet=new Dt,uet=new Dt,det=new It;function Yhe(e){this.entity=e,this.label=void 0,this.index=void 0}function by(e,t){t.collectionChanged.addEventListener(by.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}by.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Yhe(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 Yhe(r)):(wQ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],wQ(s.get(r.id),r,a),s.remove(r.id)};function wQ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Av=by;var Ddi=S(T(),1);var met=1,fet=0,het=!0,pet=!0,bet=Cn.ENABLED,get=je.NONE,yet=Y.RED,xet=0,_et=Y.WHITE,Tet=Lc.HIGHLIGHT,Cet=.5,Vet=new B(1,1),Let=new v,Zet=new v,Khe=new Y,zhe=new Array(4),Ret=new f;function gy(e,t){t.collectionChanged.addEventListener(gy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Gt,this._onCollectionChanged(t,t.values,[],[])}async function Get(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await lf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}gy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o-1;i--)FQ(this,e[i],t,n);return de(this)};var Fk=new f,Eet=new fe;gy.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ht.FAILED;if(n.loadFailed)return ht.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ht.PENDING;if(!i.ready||!n.modelUpdated)return ht.PENDING;let o=this._scene,r=y(o.ellipsoid,ie.default);if(i.heightReference!==je.NONE){let a=i.modelMatrix;Fk.x=a[12],Fk.y=a[13],Fk.z=a[14];let c=r.cartesianToCartographic(Fk,Eet),u=o.getHeight(c,i.heightReference);return l(u)&&(Ld(i.heightReference)?c.height=u:c.height+=u),ae.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ht.DONE}return ae.clone(i.boundingSphere,t),ht.DONE};gy.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)?(Wet(r,a),s.set(r.id,r)):(FQ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],FQ(this,r,a,c),s.remove(r.id)};function FQ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Wet(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Mv=gy;var gmi=S(T(),1);var Jdi=S(T(),1);function yy(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(yy.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:so.FIXED}}});yy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,so.FIXED,t)};yy.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))};yy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};yy.prototype.equals=function(e){return this===e||e instanceof yy&&this._value===e._value};yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bh=yy;var Iet=60,Xet=1,Qhe=new Zn,AQ=new Zn,MQ=new Zn;function Hhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Pet(e,t,n,i,o,r,s,a,c){let u=a,d;d=e.getValueInReferenceFrame(t,r,c[u]),l(d)&&(c[u++]=d);let m=!l(o)||ne.lessThanOrEquals(o,t)||ne.greaterThanOrEquals(o,n),p=0,b=i.length,h=i[p],x=n,_=!1,C,V,L;for(;p0&&!_){let R=i[p+1],G=ne.secondsDifference(R,h);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V0){let b=m.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let d=J.getValueOrDefault(i._resolution,e,Iet);c.show=!0,c.positions=qhe(o,r,s,e,this._referenceFrame,d,c.positions.slice()),c.material=nr.getValue(e,i._material,c.material),c.width=J.getValueOrDefault(i._width,e,Xet),c.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Nv.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)};Nv.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function xy(e,t){t.collectionChanged.addEventListener(xy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}xy.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-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Hhe(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 Hhe(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))};xy._subSample=qhe;var Uv=xy;var Wmi=S(T(),1);var $he=Y.WHITE,epe=Y.BLACK,tpe=0,npe=1,ipe=0,ope=new Y,Met=new f,rpe=new Y,spe=new Dt,ape=new Dt,cpe=new It;function lpe(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 _y(e,t){t.collectionChanged.addEventListener(_y.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Gt,this._onCollectionChanged(t,t.values,[],[])}_y.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i0?(u.scale=1,b=b||C!==r.outlineWidth||V!==r.pixelSize||!Y.equals(x,r.color)||!Y.equals(_,r.outlineColor)):(u.scale=V/50,V=50,b=b||C!==r.outlineWidth||!Y.equals(x,r.color)||!Y.equals(_,r.outlineColor)),b){r.color=Y.clone(x,r.color),r.outlineColor=Y.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,R=x.toCssColorString(),G=_.toCssColorString(),W=JSON.stringify([R,V,G,C]);u.setImage(W,j_(L,R,G,C,V))}h&&u._updateClamping()}}return!0};_y.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ht.FAILED;if(l(n.pointPrimitive))t.center=f.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ht.PENDING;t.center=f.clone(i._clampedPosition,t.center)}return t.radius=0,ht.DONE};_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_y.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new lpe(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 lpe(r)):(kv(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],kv(s.get(r.id),r,a),s.remove(r.id)};function kv(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 Dv=_y;var chi=S(T(),1);var Rfi=S(T(),1);var Qmi=S(T(),1);var hpe=[];function Net(e,t,n,i,o){let r=hpe;r.length=o;let s,a=n.red,c=n.green,u=n.blue,d=n.alpha,m=i.red,p=i.green,b=i.blue,h=i.alpha;if(Y.equals(n,i)){for(s=0;s0?new Array(o):void 0;for(i=0;i0){let A=0,N=m[0];i=i.filter(function(D,k){let O=!1;return o?O=k===N||k===0&&N===1:O=k+1===N,O?(A++,N=m[A],!1):!0})}let b=p.length;if(b<2||t<=0)return;if(r===rn.GEODESIC||r===rn.RHUMB){let A,N;r===rn.GEODESIC?(A=X.chordLength(s,a.maximumRadius),N=Ii.numberOfPoints):(A=s,N=Ii.numberOfPointsRhumbLine);let D=Ii.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c0)return ae.fromPoints(t.positions,e),ht.DONE}return ht.FAILED};Ov.prototype.isDestroyed=function(){return!1};Ov.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Ak[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Ak[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var Yv=Ef;var Ofi=S(T(),1);var Het=new Y,Jet=new It,Qet=new It;function Wf(e,t,n,i,o){let r;n instanceof zt?r=ts:r=fa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Gt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Gt,this.material=void 0,this.updatersWithAttributes=new Gt,this.attributes=new Gt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Wf.prototype.onMaterialChanged,this),this.subscriptions=new Gt,this.showsUpdated=new Gt,this.zIndex=i,this._asynchronous=o}Wf.prototype.onMaterialChanged=function(){this.invalidated=!0};Wf.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)};Wf.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};Wf.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};Wf.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 Bm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===fa&&(this.material=nr.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===fa&&(this.material=nr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};QV.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-1;a--)c=s[a],u=c.id,d=this._updaters.get(u),d.entity===c?(xpe(this,d),_pe(this,e,d)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,d=this._updaters.get(u),xpe(this,d),d.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,d=new Yv(c,this._scene),this._updaters.set(u,d),_pe(this,e,d),this._subscriptions.set(u,d.geometryChanged.addEventListener(Oh._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,b=p.length;for(a=0;a-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 zv=Oh;function ru(e){nl.initializeTerrainHeights(),Bm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Nr,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=y(e.visualizersCallback,ru.defaultVisualizersCallback);let i=!1,o=new nu,r=new nu;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,d=n.length;unew o(e,i))]};Object.defineProperties(ru.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}}});ru.prototype.isDestroyed=function(){return!1};ru.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;titt*s.maximumRadius?(m=Vpe,f.normalize(c,m),f.negate(m,m),b=f.clone(f.UNIT_Z,UQ),p=f.cross(b,m,Mk),f.magnitude(p)>X.EPSILON7&&(f.normalize(m,m),f.normalize(p,p),b=f.cross(m,p,UQ),f.normalize(b,b),u=!0)):f.equalsEpsilon(c,V,X.EPSILON7)||(b=Vpe,f.normalize(W,b),f.normalize(w,w),p=f.cross(b,w,UQ),d&&(p=f.multiplyByScalar(p,-1,p)),f.equalsEpsilon(p,f.ZERO,X.EPSILON7)||(m=f.cross(p,b,Mk),$.multiplyByVector(G,m,m),$.multiplyByVector(G,p,p),$.multiplyByVector(G,b,b),f.normalize(m,m),f.normalize(p,p),f.normalize(b,b),u=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let h,x,_;i&&(h=f.clone(t.position,kQ),x=f.clone(t.direction,Lpe),_=f.clone(t.up,Zpe));let C=ntt;u?(C[0]=m.x,C[1]=m.y,C[2]=m.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=b.x,C[9]=b.y,C[10]=b.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Vt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(f.clone(h,t.position),f.clone(x,t.direction),f.clone(_,t.up),f.cross(x,_,t.right))}if(n){let u=a===oe.SCENE2D||f.equals(e._offset3D,f.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,u)}}function Jv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ie.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new f,this._defaultOffset3D=void 0,this._offset3D=new f}Object.defineProperties(Jv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=f.clone(e,new f)}}});Jv.defaultOffset3D=new f(-14e3,3500,3500);var Nk=new mm,rtt=new f;Jv.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.position;if(!l(s))return;let a=r!==this._lastEntity,c=o!==this._mode,u=n.camera,d=a||c,m=!0;if(a){let p=r.viewFrom,b=l(p);if(!b&&l(t)){Nk.pitch=-X.PI_OVER_FOUR,Nk.range=0;let h=s.getValue(e,rtt);if(l(h)){let x=2-1/Math.max(1,f.magnitude(h)/i.maximumRadius);Nk.pitch*=x}u.viewBoundingSphere(t,Nk),this.boundingSphere=t,d=!1,m=!1}else(!b||!l(p.getValue(e,this._offset3D)))&&f.clone(Jv._defaultOffset3D,this._offset3D)}else!c&&this._mode!==oe.SCENE2D&&f.clone(u.position,this._offset3D);this._lastEntity=r,this._mode=o,ott(this,u,d,m,s,e,i)};var Qv=Jv;var p0i=S(T(),1);var Fbi=S(T(),1);var Jhi=S(T(),1);function Kk(e){return zk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function zk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?zk(n):n),[])}var Rpe=[0,1,2,3].concat(...Kk([[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 gr(){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,u=e.stat_desc.max_length,d,m,p,b,h,x,_=0;for(b=0;b<=15;b++)o.bl_count[b]=0;for(r[o.heap[o.heap_max]*2+1]=0,d=o.heap_max+1;d<573;d++)m=o.heap[d],b=r[r[m*2+1]*2+1]+1,b>u&&(b=u,_++),r[m*2+1]=b,!(m>e.max_code)&&(o.bl_count[b]++,h=0,m>=c&&(h=a[m-c]),x=r[m*2],o.opt_len+=x*(b+h),s&&(o.static_len+=x*(s[m*2+1]+h)));if(_!==0){do{for(b=u-1;o.bl_count[b]===0;)b--;o.bl_count[b]--,o.bl_count[b+1]+=2,o.bl_count[u]--,_-=2}while(_>0);for(b=u;b!==0;b--)for(m=o.bl_count[b];m!==0;)p=o.heap[--d],!(p>e.max_code)&&(r[p*2+1]!=b&&(o.opt_len+=(b-r[p*2+1])*r[p*2],r[p*2+1]=b),m--)}}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,u,d,m;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(d=0;d<=r;d++)m=o[d*2+1],m!==0&&(o[d*2]=n(a[m]++,m))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,d=-1,m;for(o.heap_len=0,o.heap_max=573,c=0;c=1;c--)o.pqdownheap(r,c);m=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[m*2]=r[c*2]+r[u*2],o.depth[m]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=m,o.heap[1]=m++,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)}}gr._length_code=[0,1,2,3,4,5,6,7].concat(...Kk([[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]]));gr.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];gr.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];gr.d_code=function(e){return e<256?Rpe[e]:Rpe[256+(e>>>7)]};gr.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];gr.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];gr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];gr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ka(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var stt=[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],att=Kk([[144,8],[112,9],[24,7],[8,8]]);Ka.static_ltree=zk(stt.map((e,t)=>[e,att[t]]));var ctt=[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],ltt=Kk([[30,5]]);Ka.static_dtree=zk(ctt.map((e,t)=>[e,ltt[t]]));Ka.static_l_desc=new Ka(Ka.static_ltree,gr.extra_lbits,257,286,15);Ka.static_d_desc=new Ka(Ka.static_dtree,gr.extra_dbits,0,30,15);Ka.static_bl_desc=new Ka(null,gr.extra_blbits,0,19,7);var utt=9,dtt=8;function Yh(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 Epe=0,Ok=1,DS=2,If=[new Yh(0,0,0,0,Epe),new Yh(4,4,8,4,Ok),new Yh(4,5,16,8,Ok),new Yh(4,6,32,32,Ok),new Yh(4,4,16,16,DS),new Yh(8,16,32,32,DS),new Yh(8,16,128,128,DS),new Yh(8,32,128,256,DS),new Yh(32,128,258,1024,DS),new Yh(32,258,258,4096,DS)],Uk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],fm=0,kk=1,jv=2,Dk=3,mtt=32,DQ=42,Bk=113,qv=666,BQ=8,ftt=0,OQ=1,htt=2,Zr=3,Yk=258,Ju=Yk+Zr+1;function Gpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o=3&&D[gr.bl_order[Ye]*2+1]===0;Ye--);return e.opt_len+=3*(Ye+1)+5+5+4,Ye}function Le(Ye){e.pending_buf[e.pending++]=Ye}function Xe(Ye){Le(Ye&255),Le(Ye>>>8&255)}function Re(Ye){Le(Ye>>8&255),Le(Ye&255&255)}function Ne(Ye,st){let ot,tt=st;ee>16-tt?(ot=Ye,q|=ot<>>16-ee,ee+=tt-16):(q|=Ye<=8&&(Le(q&255),q>>>=8,ee-=8)}function et(){Ne(OQ<<1,3),yt(256,Ka.static_ltree),Be(),1+z+10-ee<9&&(Ne(OQ<<1,3),yt(256,Ka.static_ltree),Be()),z=7}function qe(Ye,st){let ot,tt,St;if(e.dist_buf[K]=Ye,e.lc_buf[K]=st&255,K++,Ye===0?A[st*2]++:(te++,Ye--,A[(gr._length_code[st]+256+1)*2]++,N[gr.d_code(Ye)*2]++),!(K&8191)&&g>2){for(ot=K*8,tt=G-C,St=0;St<30;St++)ot+=N[St*2]*(5+gr.extra_dbits[St]);if(ot>>>=3,te8?Xe(q):ee>0&&Le(q&255),q=0,ee=0}function ge(Ye,st,ot){Kt(),z=8,ot&&(Xe(st),Xe(~st)),e.pending_buf.set(c.subarray(Ye,Ye+st),e.pending),e.pending+=st}function Ve(Ye,st,ot){Ne((ftt<<1)+(ot?1:0),3),ge(Ye,st,!0)}function Ht(Ye,st,ot){let tt,St,Et=0;g>0?(k.build_tree(e),O.build_tree(e),Et=Te(),tt=e.opt_len+3+7>>>3,St=e.static_len+3+7>>>3,St<=tt&&(tt=St)):tt=St=st+5,st+4<=tt&&Ye!=-1?Ve(Ye,st,ot):St==tt?(Ne((OQ<<1)+(ot?1:0),3),$e(Ka.static_ltree,Ka.static_dtree)):(Ne((htt<<1)+(ot?1:0),3),pt(k.max_code+1,O.max_code+1,Et+1),$e(A,N)),xe(),ot&&Kt()}function xt(Ye){Ht(C>=0?C:-1,G-C,Ye),C=G,t.flush_pending()}function fi(){let Ye,st,ot,tt;do{if(tt=u-w-G,tt===0&&G===0&&w===0)tt=r;else if(tt==-1)tt--;else if(G>=r+r-Ju){c.set(c.subarray(r,r+r),0),W-=r,G-=r,C-=r,Ye=b,ot=Ye;do st=m[--ot]&65535,m[ot]=st>=r?st-r:0;while(--Ye!==0);Ye=r,ot=Ye;do st=d[--ot]&65535,d[ot]=st>=r?st-r:0;while(--Ye!==0);tt+=r}if(t.avail_in===0)return;Ye=t.read_buf(c,G+w,tt),w+=Ye,w>=Zr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(wi-5&&(st=i-5);;){if(w<=1){if(fi(),w===0&&Ye==0)return fm;if(w===0)break}if(G+=w,w=0,ot=C+st,(G===0||G>=ot)&&(w=G-ot,G=ot,xt(!1),t.avail_out===0)||G-C>=r-Ju&&(xt(!1),t.avail_out===0))return fm}return xt(Ye==4),t.avail_out===0?Ye==4?jv:fm:Ye==4?Dk:kk}function Ms(Ye){let st=F,ot=G,tt,St,Et=P,Sn=G>r-Ju?G-(r-Ju):0,Co=I,mr=a,oc=G+Yk,rc=c[ot+Et-1],Rr=c[ot+Et];P>=E&&(st>>=2),Co>w&&(Co=w);do if(tt=Ye,!(c[tt+Et]!=Rr||c[tt+Et-1]!=rc||c[tt]!=c[ot]||c[++tt]!=c[ot+1])){ot+=2,tt++;do;while(c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&c[++ot]==c[++tt]&&otEt){if(W=Ye,Et=St,St>=Co)break;rc=c[ot+Et-1],Rr=c[ot+Et]}}while((Ye=d[Ye&mr]&65535)>Sn&&--st!==0);return Et<=w?Et:w}function sa(Ye){let st=0,ot;for(;;){if(w=Zr&&(p=(p<<_^c[G+(Zr-1)]&255)&x,st=m[p]&65535,d[G&a]=m[p],m[p]=G),st!==0&&(G-st&65535)<=r-Ju&&Z!=2&&(V=Ms(st)),V>=Zr)if(ot=qe(G-W,V-Zr),w-=V,V<=M&&w>=Zr){V--;do G++,p=(p<<_^c[G+(Zr-1)]&255)&x,st=m[p]&65535,d[G&a]=m[p],m[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else ot=qe(0,c[G]&255),w--,G++;if(ot&&(xt(!1),t.avail_out===0))return fm}return xt(Ye==4),t.avail_out===0?Ye==4?jv:fm:Ye==4?Dk:kk}function Jr(Ye){let st=0,ot,tt;for(;;){if(w=Zr&&(p=(p<<_^c[G+(Zr-1)]&255)&x,st=m[p]&65535,d[G&a]=m[p],m[p]=G),P=V,L=W,V=Zr-1,st!==0&&P4096)&&(V=Zr-1)),P>=Zr&&V<=P){tt=G+w-Zr,ot=qe(G-1-L,P-Zr),w-=P-1,P-=2;do++G<=tt&&(p=(p<<_^c[G+(Zr-1)]&255)&x,st=m[p]&65535,d[G&a]=m[p],m[p]=G);while(--P!==0);if(R=0,V=Zr-1,G++,ot&&(xt(!1),t.avail_out===0))return fm}else if(R!==0){if(ot=qe(0,c[G-1]&255),ot&&xt(!1),G++,w--,t.avail_out===0)return fm}else R=1,G++,w--}return R!==0&&(ot=qe(0,c[G-1]&255),R=0),xt(Ye==4),t.avail_out===0?Ye==4?jv:fm:Ye==4?Dk:kk}function Qr(Ye){return Ye.total_in=Ye.total_out=0,Ye.msg=null,e.pending=0,e.pending_out=0,n=Bk,o=0,ce(),pe(),0}e.deflateInit=function(Ye,st,ot,tt,St,Et){return tt||(tt=BQ),St||(St=dtt),Et||(Et=0),Ye.msg=null,st==-1&&(st=6),St<1||St>utt||tt!=BQ||ot<9||ot>15||st<0||st>9||Et<0||Et>2?-2:(Ye.dstate=e,s=ot,r=1<9||ot<0||ot>2?-2:(If[g].func!=If[st].func&&Ye.total_in!==0&&(tt=Ye.deflate(1)),g!=st&&(g=st,M=If[g].max_lazy,E=If[g].good_length,I=If[g].nice_length,F=If[g].max_chain),Z=ot,tt)},e.deflateSetDictionary=function(Ye,st,ot){let tt=ot,St,Et=0;if(!st||n!=DQ)return-2;if(ttr-Ju&&(tt=r-Ju,Et=ot-tt),c.set(st.subarray(Et,Et+tt),0),G=tt,C=tt,p=c[0]&255,p=(p<<_^c[1]&255)&x,St=0;St<=tt-Zr;St++)p=(p<<_^c[St+(Zr-1)]&255)&x,d[St&a]=m[p],m[p]=St;return 0},e.deflate=function(Ye,st){let ot,tt,St,Et,Sn;if(st>4||st<0)return-2;if(!Ye.next_out||!Ye.next_in&&Ye.avail_in!==0||n==qv&&st!=4)return Ye.msg=Uk[4],-2;if(Ye.avail_out===0)return Ye.msg=Uk[7],-5;if(t=Ye,Et=o,o=st,n==DQ&&(tt=BQ+(s-8<<4)<<8,St=(g-1&255)>>1,St>3&&(St=3),tt|=St<<6,G!==0&&(tt|=mtt),tt+=31-tt%31,n=Bk,Re(tt)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&st<=Et&&st!=4)return t.msg=Uk[7],-5;if(n==qv&&t.avail_in!==0)return Ye.msg=Uk[7],-5;if(t.avail_in!==0||w!==0||st!=0&&n!=qv){switch(Sn=-1,If[g].func){case Epe:Sn=vo(st);break;case Ok:Sn=sa(st);break;case DS:Sn=Jr(st);break;default:}if((Sn==jv||Sn==Dk)&&(n=qv),Sn==fm||Sn==jv)return t.avail_out===0&&(o=-1),0;if(Sn==kk){if(st==1)et();else if(Ve(0,0,!1),st==3)for(ot=0;otn&&(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 Ipe(e){let t=this,n=new Wpe,i=btt(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 u,d,m=0,p=0,b=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(r)):h.push(r.subarray(0,n.next_out_index))),b+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=m&&(c(n.next_in_index),m=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(d=new Uint8Array(b),h.forEach(function(x){d.set(x,p),p+=x.length})):d=h[0]?new Uint8Array(h[0]):new Uint8Array,d}},t.flush=function(){let a,c,u=0,d=0,m=[];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&&m.push(r.slice(0,n.next_out_index)),d+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(d),m.forEach(function(p){c.set(p,u),u+=p.length}),c}}function btt(e){return e+5*(Math.floor(e/16383)+1)}var jhi=S(T(),1);var Qu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],jpe=1440,gtt=0,ytt=4,xtt=9,_tt=5,Stt=[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],Ttt=[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],Ctt=[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],Vtt=[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],Ltt=[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],Ztt=[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],Sy=15;function HQ(){let e=this,t,n,i,o,r,s;function a(u,d,m,p,b,h,x,_,C,V,L){let R,G,W,w,P,F,M,g,Z,E,I,A,N,D,k;E=0,P=m;do i[u[d+E]]++,E++,P--;while(P!==0);if(i[0]==m)return x[0]=-1,_[0]=0,0;for(g=_[0],F=1;F<=Sy&&i[F]===0;F++);for(M=F,gP&&(g=P),_[0]=g,D=1<A+g;){if(w++,A+=g,k=W-A,k=k>g?g:k,(G=1<<(F=M-A))>R+1&&(G-=R+1,N=M,Fjpe)return-3;r[w]=I=V[0],V[0]+=k,w!==0?(s[w]=P,o[0]=F,o[1]=g,F=P>>>A-g,o[2]=I-r[w-1]-F,C.set(o,(r[w-1]+F)*3)):x[0]=I}for(o[1]=M-A,E>=m?o[0]=192:L[E]>>A;F>>=1)P^=F;for(P^=F,Z=(1<257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}HQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=xtt,t[0]=_tt,n[0]=Stt,i[0]=Ttt,0};var Hk=0,Xpe=1,Ppe=2,vpe=3,wpe=4,Fpe=5,Ape=6,YQ=7,Mpe=8,Jk=9;function Rtt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,d=0,m,p=0,b,h=0;function x(_,C,V,L,R,G,W,w){let P,F,M,g,Z,E,I,A,N,D,k,O,U,j,K,te;I=w.next_in_index,A=w.avail_in,Z=W.bitb,E=W.bitk,N=W.write,D=N>=F[te+1],E-=F[te+1],W.win[N++]=F[te+2],D--;continue}do{if(Z>>=F[te+1],E-=F[te+1],g&16){for(g&=15,U=F[te+2]+(Z&Qu[g]),Z>>=g,E-=g;E<15;)A--,Z|=(w.read_byte(I++)&255)<>=F[te+1],E-=F[te+1],g&16){for(g&=15;E>=g,E-=g,D-=U,N>=j)K=N-j,N-K>0&&2>N-K?(W.win[N++]=W.win[K++],W.win[N++]=W.win[K++],U-=2):(W.win.set(W.win.subarray(K,K+2),N),N+=2,K+=2,U-=2);else{K=N-j;do K+=W.end;while(K<0);if(g=W.end-K,U>g){if(U-=g,N-K>0&&g>N-K)do W.win[N++]=W.win[K++];while(--g!==0);else W.win.set(W.win.subarray(K,K+g),N),N+=g,K+=g,g=0;K=0}}if(N-K>0&&U>N-K)do W.win[N++]=W.win[K++];while(--U!==0);else W.win.set(W.win.subarray(K,K+U),N),N+=U,K+=U,U=0;break}else if(!(g&64))P+=F[te+2],P+=Z&Qu[g],te=(M+P)*3,g=F[te];else return w.msg="invalid distance code",U=w.avail_in-A,U=E>>3>3:U,A+=U,I-=U,E-=U<<3,W.bitb=Z,W.bitk=E,w.avail_in=A,w.total_in+=I-w.next_in_index,w.next_in_index=I,W.write=N,-3;while(!0);break}if(g&64)return g&32?(U=w.avail_in-A,U=E>>3>3:U,A+=U,I-=U,E-=U<<3,W.bitb=Z,W.bitk=E,w.avail_in=A,w.total_in+=I-w.next_in_index,w.next_in_index=I,W.write=N,1):(w.msg="invalid literal/length code",U=w.avail_in-A,U=E>>3>3:U,A+=U,I-=U,E-=U<<3,W.bitb=Z,W.bitk=E,w.avail_in=A,w.total_in+=I-w.next_in_index,w.next_in_index=I,W.write=N,-3);if(P+=F[te+2],P+=Z&Qu[g],te=(M+P)*3,(g=F[te])===0){Z>>=F[te+1],E-=F[te+1],W.win[N++]=F[te+2],D--;break}}while(!0)}while(D>=258&&A>=10);return U=w.avail_in-A,U=E>>3>3:U,A+=U,I-=U,E-=U<<3,W.bitb=Z,W.bitk=E,w.avail_in=A,w.total_in+=I-w.next_in_index,w.next_in_index=I,W.write=N,0}e.init=function(_,C,V,L,R,G){t=Hk,u=_,d=C,m=V,p=L,b=R,h=G,i=null},e.proc=function(_,C,V){let L,R,G,W=0,w=0,P=0,F,M,g,Z;for(P=C.next_in_index,F=C.avail_in,W=_.bitb,w=_.bitk,M=_.write,g=M<_.read?_.read-M-1:_.end-M;;)switch(t){case Hk:if(g>=258&&F>=10&&(_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,V=x(u,d,m,p,b,h,_,C),P=C.next_in_index,F=C.avail_in,W=_.bitb,w=_.bitk,M=_.write,g=M<_.read?_.read-M-1:_.end-M,V!=0)){t=V==1?YQ:Jk;break}r=u,i=m,o=p,t=Xpe;case Xpe:for(L=r;w>>=i[R+1],w-=i[R+1],G=i[R],G===0){s=i[R+2],t=Ape;break}if(G&16){a=G&15,n=i[R+2],t=Ppe;break}if(!(G&64)){r=G,o=R/3+i[R+2];break}if(G&32){t=YQ;break}return t=Jk,C.msg="invalid literal/length code",V=-3,_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case Ppe:for(L=a;w>=L,w-=L,r=d,i=b,o=h,t=vpe;case vpe:for(L=r;w>=i[R+1],w-=i[R+1],G=i[R],G&16){a=G&15,c=i[R+2],t=wpe;break}if(!(G&64)){r=G,o=R/3+i[R+2];break}return t=Jk,C.msg="invalid distance code",V=-3,_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case wpe:for(L=a;w>=L,w-=L,t=Fpe;case Fpe:for(Z=M-c;Z<0;)Z+=_.end;for(;n!==0;){if(g===0&&(M==_.end&&_.read!==0&&(M=0,g=M<_.read?_.read-M-1:_.end-M),g===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,g=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,g=M<_.read?_.read-M-1:_.end-M),g===0)))return _.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);_.win[M++]=_.win[Z++],g--,Z==_.end&&(Z=0),n--}t=Hk;break;case Ape:if(g===0&&(M==_.end&&_.read!==0&&(M=0,g=M<_.read?_.read-M-1:_.end-M),g===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,g=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,g=M<_.read?_.read-M-1:_.end-M),g===0)))return _.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);V=0,_.win[M++]=s,g--,t=Hk;break;case YQ:if(w>7&&(w-=8,F++,P--),_.write=M,V=_.inflate_flush(C,V),M=_.write,g=M<_.read?_.read-M-1:_.end-M,_.read!=_.write)return _.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);t=Mpe;case Mpe:return V=1,_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case Jk:return V=-3,_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);default:return V=-2,_.bitb=W,_.bitk=w,C.avail_in=F,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V)}},e.free=function(){}}var Npe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$V=0,KQ=1,Upe=2,kpe=3,Dpe=4,Bpe=5,Qk=6,jk=7,Ope=8,BS=9;function Gtt(e,t){let n=this,i=$V,o=0,r=0,s=0,a,c=[0],u=[0],d=new Rtt,m=0,p=new Int32Array(jpe*3),b=0,h=new HQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=b),i==Qk&&d.free(x),i=$V,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,R,G,W,w,P;for(R=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,W=n.write,w=W>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=KQ;break;case 1:F=[],M=[],g=[[]],Z=[[]],HQ.inflate_trees_fixed(F,M,g,Z),d.init(F[0],M[0],g[0],0,Z[0],0),V>>>=3,L-=3,i=Qk;break;case 2:V>>>=3,L-=3,i=kpe;break;case 3:return V>>>=3,L-=3,i=BS,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_)}break;case KQ:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<>>16&65535)!=(V&65535))return i=BS,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?Upe:m!==0?jk:$V;break;case Upe:if(G===0||w===0&&(W==n.end&&n.read!==0&&(W=0,w=WG&&(C=G),C>w&&(C=w),n.win.set(x.read_buf(R,C),W),R+=C,G-=C,W+=C,w-=C,(o-=C)!==0)break;i=m!==0?jk:$V;break;case kpe:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<29||(C>>5&31)>29)return i=BS,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length>>=14,L-=14,s=0,i=Dpe;case Dpe:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);G--,V|=(x.read_byte(R++)&255)<>>=3,L-=3}for(;s<19;)a[Npe[s++]]=0;if(c[0]=7,C=h.inflate_trees_bits(a,c,u,p,x),C!=0)return _=C,_==-3&&(a=null,i=BS),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);s=0,i=Bpe;case Bpe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let D,k;for(C=c[0];L>>=C,L-=C,a[s++]=k;else{for(P=k==18?7:k-14,D=k==18?11:3;L>>=C,L-=C,D+=V&Qu[P],V>>>=P,L-=P,P=s,C=r,P+D>258+(C&31)+(C>>5&31)||k==16&&P<1)return a=null,i=BS,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);k=k==16?a[P-1]:0;do a[P++]=k;while(--D!==0);s=P}}if(u[0]=-1,E=[],I=[],A=[],N=[],E[0]=9,I[0]=6,C=r,C=h.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,I,A,N,p,x),C!=0)return C==-3&&(a=null,i=BS),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,n.inflate_flush(x,_);d.init(E[0],I[0],p,A[0],p,N[0]),i=Qk;case Qk:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=R-x.next_in_index,x.next_in_index=R,n.write=W,(_=d.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,d.free(x),R=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,W=n.write,w=W15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Gtt(n,1<>4)+8>s.wbits){s.mode=Ty,n.msg="invalid win size",s.marker=5;break}s.mode=Ype;case Ype: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=Ty,n.msg="incorrect header check",s.marker=5;break}if(!(r&Ett)){s.mode=$v;break}s.mode=Kpe;case Kpe: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=zpe;case zpe: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=Hpe;case Hpe: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=Jpe;case Jpe: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=zQ,2);case zQ:return s.mode=Ty,n.msg="need dictionary",s.marker=0,-2;case $v:if(o=s.blocks.proc(n,o),o==-3){s.mode=Ty,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Qpe;case Qpe:return n.avail_in=0,1;case Ty:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=zQ)return-2;let a=n.istate;return s>=1<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 u.length>1?(m=new Uint8Array(h),u.forEach(function(x){m.set(x,b),b+=x.length})):m=u[0]?new Uint8Array(u[0]):new Uint8Array,m}},t.flush=function(){n.inflateEnd()}}var spi=S(T(),1);var $hi=S(T(),1);var eL="/",JQ=new Date(2107,11,31),QQ=new Date(1980,0,1),$i=void 0,ju="undefined",c0="function";var tpi=S(T(),1);var ew=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 vtt=64,ebe=2;try{typeof navigator!=ju&&navigator.hardwareConcurrency&&(ebe=navigator.hardwareConcurrency)}catch{}var wtt={chunkSize:512*1024,maxWorkers:ebe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:$i,CompressionStreamNative:typeof CompressionStream!=ju&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=ju&&DecompressionStream},Vy=Object.assign({},wtt);function tw(){return Vy}function qk(e){return Math.max(e.chunkSize,vtt)}function tL(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:d,workerScripts:m}=e;if(Cy("baseURL",t),Cy("chunkSize",n),Cy("maxWorkers",i),Cy("terminateWorkerTimeout",o),Cy("useCompressionStream",r),Cy("useWebWorkers",s),a&&(Vy.CompressionStream=new ew(a)),c&&(Vy.DecompressionStream=new ew(c)),Cy("CompressionStream",u),Cy("DecompressionStream",d),m!==$i){let{deflate:p,inflate:b}=m;if((p||b)&&(Vy.workerScripts||(Vy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Vy.workerScripts.deflate=p}if(b){if(!Array.isArray(b))throw new Error("workerScripts.inflate must be an array");Vy.workerScripts.inflate=b}}}function Cy(e,t){t!==$i&&(Vy[e]=t)}var cpi=S(T(),1);var ebi=S(T(),1);var Ypi=S(T(),1);var Dpi=S(T(),1);var fpi=S(T(),1);var upi=S(T(),1),tbe=[];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;tbe[e]=t}var l0=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i>>8^tbe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var nw=class extends TransformStream{constructor(){let t,n=new l0;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 Xpi=S(T(),1);var bpi=S(T(),1);function nL(e){if(typeof TextEncoder==ju){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=Cl.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>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Cl.getPartial(o);return i.push(Cl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},iw={bytes:{fromBits(e){let n=Cl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)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=Cl.concat(t,[Cl.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<>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let d=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=d}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 jQ={};jQ.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let d=s[u&3?r:r-4];r<=4||u<4?a[u]=d:a[u]=i[0][n[d>>>24]]^i[1][n[d>>16&255]]^i[2][n[d>>8&255]]^i[3][n[d&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let d=0;d<256;d++)r[(o[d]=d<<1^(d>>7)*283)^d]=d;for(let d=s=0;!n[d];d^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[d]=m,i[m]=d,u=o[c=o[a=o[d]]];let p=u*16843009^c*65537^a*257^d*16843008,b=o[m]*257^m*16843008;for(let h=0;h<4;h++)e[h][d]=b=b<<24^b>>>8,t[h][m]=p=p<<24^p>>>8}for(let d=0;d<5;d++)e[d]=e[d].slice(0),t[d]=t[d].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],d=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],h=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L>>24]^a[p>>16&255]^c[b>>8&255]^u[h&255]^n[x],C=s[p>>>24]^a[b>>16&255]^c[h>>8&255]^u[m&255]^n[x+1],V=s[b>>>24]^a[h>>16&255]^c[m>>8&255]^u[p&255]^n[x+2],h=s[h>>>24]^a[m>>16&255]^c[p>>8&255]^u[b&255]^n[x+3],x+=4,m=_,p=C,b=V;for(let L=0;L<4;L++)o[t?3&-L:L]=d[m>>>24]<<24^d[p>>16&255]<<16^d[b>>8&255]<<8^d[h&255]^n[x++],_=m,m=p,p=b,b=h,h=_;return o}};var ibe={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>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=Cl.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,u,d=new ArrayBuffer(o),m=new DataView(d),p=0,b=Cl;for(t=iw.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(b.concat(t,[u])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;rthis.resolveReady=s),password:ube(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:d,resolveReady:m,ready:p}=c;u?(await Ktt(c,d,u,hm(s,0,rw[d]+2)),s=hm(s,rw[d]+2),r?a.error(new Error(u0)):m()):await p;let b=new Uint8Array(s.length-Ry-(s.length-Ry)%iL);a.enqueue(cbe(c,s,b,0,Ry,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:d,ready:m}=this;if(u&&c){await m;let p=hm(d,0,d.length-Ry),b=hm(d,d.length-Ry),h=new Uint8Array;if(p.length){let x=aw(Kh,p);u.update(x);let _=c.update(x);h=sw(Kh,_)}if(a){let x=hm(sw(Kh,u.digest()),0,Ry);for(let _=0;_this.resolveReady=r),password:ube(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:d,ready:m}=a,p=new Uint8Array;c?(p=await ztt(a,u,c),d()):await m;let b=new Uint8Array(p.length+r.length-r.length%iL);b.set(p,0),s.enqueue(cbe(a,r,b,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let d=new Uint8Array;if(c.length){let m=s.update(aw(Kh,c));a.update(m),d=sw(Kh,m)}o.signature=sw(Kh,a.digest()).slice(0,Ry),r.enqueue(e4(d,o.signature))}}}),o=this}};function cbe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=e4(c,t),n=Qtt(n,u-u%iL));let d;for(d=0;d<=u-iL;d+=iL){let m=aw(Kh,hm(t,d,d+iL));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(sw(Kh,p),d+i)}return e.pending=hm(t,d),n}async function Ktt(e,t,n,i){let o=await lbe(e,t,n,hm(i,0,rw[t])),r=hm(i,rw[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Zy)}async function ztt(e,t,n){let i=$k(new Uint8Array(rw[t])),o=await lbe(e,t,n,i);return e4(i,o)}async function lbe(e,t,n,i){e.password=null;let o=await Htt(Att,n,Utt,!1,ktt),r=await Jtt(Object.assign({salt:i},$Q),o,8*(ow[t]*2+2)),s=new Uint8Array(r),a=aw(Kh,hm(s,0,ow[t])),c=aw(Kh,hm(s,ow[t],ow[t]*2)),u=hm(s,ow[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Ott(new Btt(a),Array.from(Dtt)),hmac:new Ytt(c)}),u}async function Htt(e,t,n,i,o){if(obe)try{return await cw.importKey(e,t,n,i,o)}catch{return obe=!1,Ly.importKey(t)}else return Ly.importKey(t)}async function Jtt(e,t,n){if(rbe)try{return await cw.deriveBits(e,t,n)}catch{return rbe=!1,Ly.pbkdf2(t,e.salt,$Q.iterations,n)}else return Ly.pbkdf2(t,e.salt,$Q.iterations,n)}function ube(e,t){return t===$i?nL(e):t}function e4(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 Qtt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function hm(e,t,n){return e.subarray(t,n)}function sw(e,t){return e.fromBits(t)}function aw(e,t){return e.toBits(t)}var Fpi=S(T(),1);var oL=12,iD=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),hbe(this,t)},transform(o,r){let s=this;if(s.password){let a=dbe(s,o.subarray(0,oL));if(s.password=null,a[oL-1]!=s.passwordVerification)throw new Error(Zy);o=o.subarray(oL)}i?r.error(new Error(u0)):r.enqueue(dbe(s,o))}})}},oD=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),hbe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=$k(new Uint8Array(oL));c[oL-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(mbe(r,c),0),a=oL}else s=new Uint8Array(i.length),a=0;s.set(mbe(r,i),a),o.enqueue(s)}})}};function dbe(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function pbe(e){let t=e.keys[2]|2;return bbe(Math.imul(t,t^1)>>>8)}function bbe(e){return e&255}function fbe(e){return e&4294967295}var gbe="deflate-raw",rD=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:d}=t,m=this,p,b,h=ybe(super.readable);(!s||c)&&u&&(p=new nw,h=zh(h,p)),r&&(h=_be(h,a,{level:d,chunkSize:n},o,i)),s&&(c?h=zh(h,new oD(t)):(b=new tD(t),h=zh(h,b))),xbe(m,h,()=>{let x;s&&!c&&(x=b.signature),(!s||c)&&u&&(x=new DataView(p.value.buffer).getUint32(0)),m.signature=x})}},sD=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:d}=t,m,p,b=ybe(super.readable);s&&(r?b=zh(b,new iD(t)):(p=new eD(t),b=zh(b,p))),u&&(b=_be(b,d,{chunkSize:n},o,i)),(!s||r)&&a&&(m=new nw,b=zh(b,m)),xbe(this,b,()=>{if((!s||r)&&a){let h=new DataView(m.value.buffer);if(c!=h.getUint32(0,!1))throw new Error(OS)}})}};function ybe(e){return zh(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function xbe(e,t,n){t=zh(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function _be(e,t,n,i,o){try{let r=t&&i?i:o;e=zh(e,new r(gbe,n))}catch{if(t)try{e=zh(e,new o(gbe,n))}catch{return e}else return e}return e}function zh(e,t){return e.pipeThrough(t)}var Sbe="message",Tbe="start",Cbe="pull",n4="data",Vbe="ack",i4="close",lD="deflate",uD="inflate";var aD=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(lD)?r=rD:o.startsWith(uD)&&(r=sD);let s=0,a=0,c=new r(t,n),u=super.readable,d=new TransformStream({transform(p,b){p&&p.length&&(a+=p.length,b.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),m=new TransformStream({transform(p,b){p&&p.length&&(s+=p.length,b.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(d).pipeThrough(c).pipeThrough(m)}})}},cD=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 Jpi=S(T(),1);var Rbe=typeof Worker!=ju;var rL=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},d){let{signal:m}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new cD(r.chunkSize)).pipeThrough(new r4(n,s),{signal:m}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:b,busy:h}=t;b?(h?t.resolveTerminated=p:(b.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,d(t)}}),(a&&Rbe?jtt:Gbe)(t,r)}},r4=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await o4(n,o)},async transform(a,c){s+=a.length,i&&await o4(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await o4(r,s)}})}};async function o4(e,...t){try{await e(...t)}catch{}}function Gbe(e,t){return{run:()=>qtt(e,t)}}function jtt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=tnt(e.scripts[0],n,e)}catch{return Rbe=!1,Gbe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>$tt(e,{chunkSize:i})}})}return e.interface}async function qtt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new aD(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 $tt(e,t){let n,i,o=new Promise((p,b)=>{n=p,i=b});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=ent(e.writable),d=dD({type:Tbe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);d||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let m=await o;return d||await c.getWriter().close(),await u,m}function ent(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Lbe=!0,Zbe=!0;function tnt(e,t,n){let i={type:"module"},o,r;typeof e==c0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Lbe)try{r=new Worker(o)}catch{Lbe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Sbe,s=>nnt(s,n)),r}function dD(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength!C.busy);if(_)return Wbe(_),new rL(_,e,t,x);if(YS.lengths4.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(s4.length){let[{resolve:C,stream:V,workerOptions:L}]=s4.splice(0,1);C(new rL(_,V,L,x))}else _.worker?(Wbe(_),int(_,t)):YS=YS.filter(C=>C!=_)}}function int(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{YS=YS.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Wbe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var obi=S(T(),1);var ont="Writer iterator completed too soon",rnt="text/plain";var snt="Content-Type";var ant=64*1024,l4="writable",sL=class{constructor(){this.size=0}init(){this.initialized=!0}},fD=class extends sL{get readable(){let t=this,{chunkSize:n=ant}=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}},a4=class extends sL{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,l4,{get(){return n}})}writeUint8Array(){}};var hD=class extends a4{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;i2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},d0=class extends fD{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||on&&(s=s.slice(t,o)),new Uint8Array(s)}},lw=class extends sL{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([snt,t]),Object.defineProperty(n,l4,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},pD=class extends d0{constructor(t){super(new Blob([t],{type:rnt}))}},bD=class extends lw{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 fD{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 u=r[a],d=u.size;if(c+n<=d)s=await za(u,c,n);else{let m=d-c;s=new Uint8Array(n),s.set(await za(u,c,m)),s.set(await o.readUint8Array(t+m,n-m,i),m)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},gD=class extends sL{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(d){let{availableSize:m}=i;if(s)d.length>=m?(await c(d.slice(0,m)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(d.slice(m))):await c(d);else{let{value:p,done:b}=await t.next();if(b&&!p)throw new Error(ont);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Jh(o),r=p.writable,s=r.getWriter(),await this.write(d)}},async close(){await s.ready,await u()}});Object.defineProperty(i,l4,{get(){return a}});async function c(d){let m=d.length;m&&(await s.ready,await s.write(d),o.size+=m,i.size+=m,i.availableSize-=m)}async function u(){r.size=o.size,await s.close()}}};async function Jh(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function yD(e){return Array.isArray(e)&&(e=new c4(e)),e instanceof ReadableStream&&(e={readable:e}),e}function xD(e){e.writable===$i&&typeof e.next==c0&&(e=new gD(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===$i&&(t.size=0),e instanceof gD||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 _bi=S(T(),1);var lbi=S(T(),1);var sbi=S(T(),1),Ibe="\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(""),cnt=Ibe.length==256;function Xbe(e){if(cnt){let t="";for(let n=0;nthis[n]=t[n])}};var S4="File format is not recognized",fnt="End of central directory not found",hnt="End of Zip64 central directory locator not found",pnt="Central directory header not found",bnt="Local file header not found",gnt="Zip64 extra field not found",ynt="File contains encrypted entry",xnt="Encryption method not supported",wbe="Compression method not supported",Fbe="Split zip file",Abe="utf-8",Mbe="cp437",_nt=[[h4,4294967295],[p4,4294967295],[b4,4294967295],[_D,65535]],Snt={[65535]:{getValue:Ss,bytes:4},[4294967295]:{getValue:TD,bytes:8}},ED=class{constructor(t,n={}){Object.assign(this,{reader:yD(t),options:n,config:tw()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Jh(i),(i.size===$i||!i.readUint8Array)&&(i=new d0(await new Response(i.readable).blob()),await Jh(i)),i.size<22)throw new Error(S4);i.chunkSize=qk(o);let r=await Znt(i,101010256,i.size,22,65535*16);if(!r){let M=await za(i,0,4),g=La(M);throw Ss(g)==134695760?new Error(Fbe):new Error(fnt)}let s=La(r),a=Ss(s,12),c=Ss(s,16),u=r.offset,d=Va(s,20),m=u+22+d,p=Va(s,4),b=i.lastDiskNumber||0,h=Va(s,6),x=Va(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||h==65535){let M=await za(i,r.offset-20,20),g=La(M);if(Ss(g,0)==117853008){c=TD(g,8);let Z=await za(i,c,56,-1),E=La(Z),I=r.offset-20-56;if(Ss(E,0)!=101075792&&c!=I){let A=c;c=I,_=c-A,Z=await za(i,c,56,-1),E=La(Z)}if(Ss(E,0)!=101075792)throw new Error(hnt);p==65535&&(p=Ss(E,16)),h==65535&&(h=Ss(E,20)),x==65535&&(x=TD(E,32)),a==4294967295&&(a=TD(E,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),b!=p)throw new Error(Fbe);if(c<0)throw new Error(S4);let V=0,L=await za(i,c,a,h),R=La(L);if(a){let M=r.offset-a;if(Ss(R,V)!=33639248&&c!=M){let g=c;c=M,_+=c-g,L=await za(i,c,a,h),R=La(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await za(i,c,a,h),R=La(L)),c<0||c>=i.size)throw new Error(S4);let W=su(n,t,"filenameEncoding"),w=su(n,t,"commentEncoding");for(let M=0;Mg.getData(Xe,Te,Re),V=U;let{onprogress:Le}=t;if(Le)try{await Le(M+1,x,new Gy(g))}catch{}yield Te}let P=su(n,t,"extractPrependedData"),F=su(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await za(i,0,C):new Uint8Array),n.comment=d?await za(i,u+22,d):new Uint8Array,F&&(n.appendedData=m>>8&255:p>>>24&255),signature:p,compressed:u!=0,encrypted:G,useWebWorkers:su(o,i,"useWebWorkers"),useCompressionStream:su(o,i,"useCompressionStream"),transferStreams:su(o,i,"transferStreams"),checkPasswordOnly:g},config:d,streamOptions:{signal:M,size:P,onstart:E,onprogress:I,onend:A}},D=0;try{({outputSize:D}=await mD({readable:F,writable:Z},N))}catch(k){if(!g||k.message!=u0)throw k}finally{let k=su(o,i,"preventClose");Z.size+=D,!k&&!Z.locked&&await Z.getWriter().close()}return g?$i:t.getData?t.getData():Z}};function Ube(e,t,n){let i=e.rawBitFlag=Va(t,n+2),o=(i&1)==1,r=Ss(t,n+6);Object.assign(e,{encrypted:o,version:Va(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Rnt(r),filenameLength:Va(t,n+22),extraFieldLength:Va(t,n+24)})}async function kbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=La(new Uint8Array(r)),c=0;try{for(;ct[o]==r);for(let o=0,r=0;o=5&&(r.push(aL),s.push(SD));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let d=Ss(i,a);t[c]=e[c]=new Date(d*1e3);let m=s[u];e[m]=d}a+=4})}async function Znt(e,t,n,i,o){let r=new Uint8Array(4),s=La(r);Gnt(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let d=n-u,m=await za(e,d,u);for(let p=m.length-i;p>=0;p--)if(m[p]==r[0]&&m[p+1]==r[1]&&m[p+2]==r[2]&&m[p+3]==r[3])return{offset:d+p,buffer:m.slice(p,p+i).buffer}}}function su(e,t,n){return t[n]===$i?e.options[n]:t[n]}function Rnt(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 T4(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function cL(e,t){return e.getUint8(t)}function Va(e,t){return e.getUint16(t,!0)}function Ss(e,t){return e.getUint32(t,!0)}function TD(e,t){return Number(e.getBigUint64(t,!0))}function Gnt(e,t,n){e.setUint32(t,n,!0)}function La(e){return new DataView(e.buffer)}var Gbi=S(T(),1);var Xnt="File already exists",Pnt="Zip file comment exceeds 64KB",vnt="File entry comment exceeds 64KB",wnt="File entry name exceeds 64KB",Obe="Version exceeds 65535",Fnt="The strength must equal 1, 2, or 3",Ant="Extra field type exceeds 65535",Mnt="Extra field data exceeds 64KB",A4="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Ybe=new Uint8Array([7,0,2,0,65,69,3,0,0]),w4=0,Kbe=[],XD=class{constructor(t,n={}){t=xD(t);let i=t.availableSize!==$i&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==$i&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:tw(),files:new Map,filenames:new Set,offset:t.writable.size,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;w4Kbe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Xnt);return o.filenames.add(t),a=Nnt(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Kbe.shift();c?c():w4--}}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 Hnt(this,t,n),Jo(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Nnt(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(eL)?t+=eL:i.directory=t.endsWith(eL);let o=Jo(e,i,"encodeText",nL),r=o(t);if(r===$i&&(r=nL(t)),Qi(r)>65535)throw new Error(wnt);let s=i.comment||"",a=o(s);if(a===$i&&(a=nL(s)),Qi(a)>65535)throw new Error(vnt);let c=Jo(e,i,"version",20);if(c>65535)throw new Error(Obe);let u=Jo(e,i,"versionMadeBy",20);if(u>65535)throw new Error(Obe);let d=Jo(e,i,aL,new Date),m=Jo(e,i,dw),p=Jo(e,i,mw),b=Jo(e,i,x4,!0),h=Jo(e,i,g4,0),x=Jo(e,i,y4,0),_=Jo(e,i,"password"),C=Jo(e,i,"rawPassword"),V=Jo(e,i,"encryptionStrength",3),L=Jo(e,i,"zipCrypto"),R=Jo(e,i,"extendedTimestamp",!0),G=Jo(e,i,"keepOrder",!0),W=Jo(e,i,"level"),w=Jo(e,i,"useWebWorkers"),P=Jo(e,i,"bufferedWrite"),F=Jo(e,i,"dataDescriptorSignature",!1),M=Jo(e,i,"signal"),g=Jo(e,i,"useCompressionStream"),Z=Jo(e,i,"dataDescriptor",!0),E=Jo(e,i,_4);if(_!==$i&&V!==$i&&(V<1||V>3))throw new Error(Fnt);let I=new Uint8Array,{extraField:A}=i;if(A){let Le=0,Xe=0;A.forEach(Re=>Le+=4+Qi(Re)),I=new Uint8Array(Le),A.forEach((Re,Ne)=>{if(Ne>65535)throw new Error(Ant);if(Qi(Re)>65535)throw new Error(Mnt);Xs(I,new Uint16Array([Ne]),Xe),Xs(I,new Uint16Array([Qi(Re)]),Xe+2),Xs(I,Re,Xe+4),Xe+=4+Qi(Re)})}let N=0,D=0,k=0,O=E===!0;n&&(n=yD(n),await Jh(n),n.size===$i?(Z=!0,(E||E===$i)&&(E=!0,k=N=4294967296)):(k=n.size,N=Jnt(k)));let{diskOffset:U,diskNumber:j,maxSize:K}=e.writer,te=O||k>4294967295,z=O||N>4294967295,q=O||e.offset+e.pendingEntriesSize-U>4294967295,pe=Jo(e,i,"supportZip64SplitFile",!0)&&O||j+Math.ceil(e.pendingEntriesSize/K)>65535;if(q||te||z||pe){if(E===!1||!G)throw new Error(A4);E=!0}E=E||!1,i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:u,lastModDate:d,lastAccessDate:m,creationDate:p,rawExtraField:I,zip64:E,zip64UncompressedSize:te,zip64CompressedSize:z,zip64Offset:q,zip64DiskNumberStart:pe,password:_,rawPassword:C,level:!g&&e.config.CompressionStream===$i&&e.config.CompressionStreamNative===$i?0:W,useWebWorkers:w,encryptionStrength:V,extendedTimestamp:R,zipCrypto:L,bufferedWrite:P,keepOrder:G,dataDescriptor:Z,dataDescriptorSignature:F,signal:M,msDosCompatible:b,internalFileAttribute:h,externalFileAttribute:x,useCompressionStream:g});let xe=Dnt(i),ce=Ont(i),ye=Qi(xe.localHeaderArray,ce.dataDescriptorArray);D=ye+N,e.options.usdz&&(D+=D+64),e.pendingEntriesSize+=D;let Te;try{Te=await Unt(e,t,n,{headerInfo:xe,dataDescriptorInfo:ce,metadataSize:ye},i)}finally{e.pendingEntriesSize-=D}return Object.assign(Te,{name:t,comment:s,extraField:A}),new Gy(Te)}async function Unt(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:d}=i,{usdz:m}=e.options,p=Array.from(r.values()).pop(),b={},h,x,_,C,V,L,R;r.set(t,b);try{let P;a&&(P=p&&p.lock,G()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!m?(L=new TransformStream,R=new Response(L.readable).blob(),L.writable.size=0,h=!0,e.bufferedWrites++,await Jh(s)):(L=s,await W()),await Jh(L);let{writable:F}=s,{diskOffset:M}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let Z=new Uint8Array(4),E=Ha(Z);Ji(E,0,134695760),await Qh(F,Z),e.offset+=4}m&&Bnt(i,e.offset-M),h||(await P,await w(F));let{diskNumber:g}=s;if(V=!0,b.diskNumberStart=g,b=await knt(n,L,b,i,e.config,o),V=!1,r.set(t,b),b.filename=t,h){await L.writable.getWriter().close();let Z=await R;await P,await W(),C=!0,c||(Z=await Knt(b,Z,F,o)),await w(F),b.diskNumberStart=s.diskNumber,M=s.diskOffset,await Z.stream().pipeTo(F,{preventClose:!0,preventAbort:!0,signal:u}),F.size+=Z.size,C=!1}if(b.offset=e.offset-M,b.zip64)znt(b,o);else if(b.offset>4294967295)throw new Error(A4);return e.offset+=b.size,b}catch(P){if(h&&C||!h&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}h?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{h&&e.bufferedWrites--,_&&_(),x&&x()}function G(){b.lock=new Promise(P=>_=P)}async function W(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(F=>x=()=>{e.writerLocked=!1,F()}),await P}async function w(P){Qi(d.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Qh(P,new Uint8Array))}}async function knt(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:d,headerArray:m,lastModDate:p,rawLastModDate:b,encrypted:h,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:R,rawExtraFieldAES:G}=a,{dataDescriptorArray:W}=c,{rawFilename:w,lastAccessDate:P,creationDate:F,password:M,rawPassword:g,level:Z,zip64:E,zip64UncompressedSize:I,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:D,zipCrypto:k,dataDescriptor:O,directory:U,versionMadeBy:j,rawComment:K,rawExtraField:te,useWebWorkers:z,onstart:q,onprogress:ee,onend:pe,signal:xe,encryptionStrength:ce,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Le,externalFileAttribute:Xe,useCompressionStream:Re}=s,Ne={lock:i,versionMadeBy:j,zip64:E,directory:!!U,filenameUTF8:!0,rawFilename:w,commentUTF8:!0,rawComment:K,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:R,rawExtraFieldAES:G,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Le,externalFileAttribute:Xe,diskNumberStart:n},yt=0,Nt=0,pt,{writable:Be}=t;if(e){e.chunkSize=qk(r),await Qh(Be,d);let qe=e.readable,$e=qe.size=e.size,Kt={options:{codecType:lD,level:Z,rawPassword:g,password:M,encryptionStrength:ce,zipCrypto:h&&k,passwordVerification:h&&k&&b>>8&255,signed:!0,compressed:x,encrypted:h,useWebWorkers:z,useCompressionStream:Re,transferStreams:!1},config:r,streamOptions:{signal:xe,size:$e,onstart:q,onprogress:ee,onend:pe}},ge=await mD({readable:qe,writable:Be},Kt);Nt=ge.inputSize,yt=ge.outputSize,pt=ge.signature,Be.size+=Nt}else await Qh(Be,d);let et;if(E){let qe=4;I&&(qe+=8),A&&(qe+=8),N&&(qe+=8),D&&(qe+=4),et=new Uint8Array(qe)}else et=new Uint8Array;return Ynt({signature:pt,rawExtraFieldZip64:et,compressedSize:yt,uncompressedSize:Nt,headerInfo:a,dataDescriptorInfo:c},s),O&&await Qh(Be,W),Object.assign(Ne,{uncompressedSize:Nt,compressedSize:yt,lastModDate:p,rawLastModDate:b,creationDate:F,lastAccessDate:P,encrypted:h,size:u+yt,compressionMethod:C,version:_,headerArray:m,signature:pt,rawExtraFieldZip64:et,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:I,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:D}),Ne}function Dnt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,rawPassword:r,password:s,level:a,zip64:c,zipCrypto:u,dataDescriptor:d,directory:m,rawExtraField:p,encryptionStrength:b,extendedTimestamp:h}=e,x=a!==0&&!m,_=!!(s&&Qi(s)||r&&Qi(r)),C=e.version,V;if(_&&!u){V=new Uint8Array(Qi(Ybe)+2);let D=Ha(V);co(D,0,39169),Xs(V,Ybe,2),PD(D,8,b)}else V=new Uint8Array;let L,R,G;if(h){R=new Uint8Array(9+(i?4:0)+(o?4:0));let D=Ha(R);co(D,0,21589),co(D,2,Qi(R)-4),G=1+(i?2:0)+(o?4:0),PD(D,4,G);let k=5;Ji(D,k,Math.floor(n.getTime()/1e3)),k+=4,i&&(Ji(D,k,Math.floor(i.getTime()/1e3)),k+=4),o&&Ji(D,k,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let O=Ha(L),U=F4(n);co(O,0,10),co(O,2,32),co(O,8,1),co(O,10,24),au(O,12,U),au(O,20,F4(i)||U),au(O,28,F4(o)||U)}catch{L=new Uint8Array}}else L=R=new Uint8Array;let W=2048;d&&(W=W|8);let w=0;x&&(w=8),c&&(C=C>45?C:45),_&&(W=W|1,u||(C=C>51?C:51,w=99,x&&(V[9]=8)));let P=new Uint8Array(26),F=Ha(P);co(F,0,C),co(F,2,W),co(F,4,w);let M=new Uint32Array(1),g=Ha(M),Z;nJQ?Z=JQ:Z=n,co(g,0,(Z.getHours()<<6|Z.getMinutes())<<5|Z.getSeconds()/2),co(g,2,(Z.getFullYear()-1980<<4|Z.getMonth()+1)<<5|Z.getDate());let E=M[0];Ji(F,6,E),co(F,22,Qi(t));let I=Qi(V,R,L,p);co(F,24,I);let A=new Uint8Array(30+Qi(t)+I),N=Ha(A);return Ji(N,0,67324752),Xs(A,P,4),Xs(A,t,30),Xs(A,V,30+Qi(t)),Xs(A,R,30+Qi(t,V)),Xs(A,L,30+Qi(t,V,R)),Xs(A,p,30+Qi(t,V,R,L)),{localHeaderArray:A,headerArray:P,headerView:F,lastModDate:n,rawLastModDate:E,encrypted:_,compressed:x,version:C,compressionMethod:w,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:I}}function Bnt(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ha(i),s=64-(t+Qi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ha(a);co(c,0,6534),co(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Qi(u)+s),Xs(i,u),Xs(i,a,Qi(u)),r=Ha(i),co(r,28,o+s),e.metadataSize+=s}function Ont(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,Ji(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Ynt(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:d,dataDescriptorOffset:m}=a,{zip64:p,zip64UncompressedSize:b,zip64CompressedSize:h,zipCrypto:x,dataDescriptor:_}=t;if((!u||x)&&n!==$i&&(Ji(c,10,n),_&&Ji(d,m,n)),p){let C=Ha(i);co(C,0,1),co(C,2,Qi(i)-4);let V=4;b&&(Ji(c,18,4294967295),au(C,V,BigInt(r)),V+=8),h&&(Ji(c,14,4294967295),au(C,V,BigInt(o))),_&&(au(d,m+4,BigInt(o)),au(d,m+12,BigInt(r)))}else Ji(c,14,o),Ji(c,18,r),_&&(Ji(d,m+4,o),Ji(d,m+8,r))}async function Knt(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)&&Ji(r,14,e.signature),e.zip64?(Ji(r,18,4294967295),Ji(r,22,4294967295)):(Ji(r,18,e.compressedSize),Ji(r,22,e.uncompressedSize)),await Qh(n,new Uint8Array(o)),t.slice(o.byteLength)}function znt(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=Ha(n),d=4;r&&(d+=8),s&&(d+=8),a&&(au(u,d,BigInt(i)),d+=8),c&&Ji(u,d,o)}async function Hnt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,d=e.offset-r,m=i.size;for(let[,G]of i){let{rawFilename:W,rawExtraFieldZip64:w,rawExtraFieldAES:P,rawComment:F,rawExtraFieldNTFS:M,rawExtraField:g,extendedTimestamp:Z,extraFieldExtendedTimestampFlag:E,lastModDate:I}=G,A;if(Z){A=new Uint8Array(9);let N=Ha(A);co(N,0,21589),co(N,2,5),PD(N,4,E),Ji(N,5,Math.floor(I.getTime()/1e3))}else A=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=A,u+=46+Qi(W,F,w,P,M,A,g)}let p=new Uint8Array(u),b=Ha(p);await Jh(o);let h=0;for(let[G,W]of Array.from(i.values()).entries()){let{offset:w,rawFilename:P,rawExtraFieldZip64:F,rawExtraFieldAES:M,rawExtraFieldCDExtendedTimestamp:g,rawExtraFieldNTFS:Z,rawExtraField:E,rawComment:I,versionMadeBy:A,headerArray:N,directory:D,zip64:k,zip64UncompressedSize:O,zip64CompressedSize:U,zip64DiskNumberStart:j,zip64Offset:K,msDosCompatible:te,internalFileAttribute:z,externalFileAttribute:q,diskNumberStart:ee,uncompressedSize:pe,compressedSize:xe}=W,ce=Qi(F,M,g,Z,E);Ji(b,c,33639248),co(b,c+4,A);let ye=Ha(N);O||Ji(ye,18,pe),U||Ji(ye,14,xe),Xs(p,N,c+6),co(b,c+30,ce),co(b,c+32,Qi(I)),co(b,c+34,k&&j?65535:ee),co(b,c+36,z),q?Ji(b,c+38,q):D&&te&&PD(b,c+38,16),Ji(b,c+42,k&&K?4294967295:w),Xs(p,P,c+46),Xs(p,F,c+46+Qi(P)),Xs(p,M,c+46+Qi(P,F)),Xs(p,g,c+46+Qi(P,F,M)),Xs(p,Z,c+46+Qi(P,F,M,g)),Xs(p,E,c+46+Qi(P,F,M,g,Z)),Xs(p,I,c+46+Qi(P)+ce);let Te=46+Qi(P,I)+ce;if(c-h>o.availableSize&&(o.availableSize=0,await Qh(s,p.slice(h,c)),h=c),c+=Te,n.onprogress)try{await n.onprogress(G+1,i.size,new Gy(W))}catch{}}await Qh(s,h?p.slice(h):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=Jo(e,n,"zip64");if(d>4294967295||u>4294967295||m>65535||x>65535){if(C===!1)throw new Error(A4);C=!0}let V=new Uint8Array(C?98:22),L=Ha(V);c=0,C&&(Ji(L,0,101075792),au(L,4,BigInt(44)),co(L,12,45),co(L,14,45),Ji(L,16,x),Ji(L,20,a),au(L,24,BigInt(m)),au(L,32,BigInt(m)),au(L,40,BigInt(u)),au(L,48,BigInt(d)),Ji(L,56,117853008),au(L,64,BigInt(d)+BigInt(u)),Ji(L,72,x+1),Jo(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),m=65535,d=4294967295,u=4294967295,c+=76),Ji(L,c,101010256),co(L,c+4,x),co(L,c+6,a),co(L,c+8,m),co(L,c+10,m),Ji(L,c+12,u),Ji(L,c+16,d);let R=Qi(t);if(R)if(R<=65535)co(L,c+20,R);else throw new Error(Pnt);await Qh(s,V),R&&await Qh(s,t)}async function Qh(e,t){let n=e.getWriter();try{await n.ready,e.size+=Qi(t),await n.write(t)}finally{n.releaseLock()}}function F4(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Jo(e,t,n,i){let o=t[n]===$i?e.options[n]:t[n];return o===$i?i:o}function Jnt(e){return e+5*(Math.floor(e/16383)+1)}function PD(e,t,n){e.setUint8(t,n)}function co(e,t,n){e.setUint16(t,n,!0)}function Ji(e,t,n){e.setUint32(t,n,!0)}function au(e,t,n){e.setBigUint64(t,n,!0)}function Xs(e,t,n){e.set(t,n)}function Ha(e){return new DataView(e.buffer)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}tL({Deflate:Ipe,Inflate:$pe});var M4=32,Qnt="http://www.opengis.net/kml/2.2",Pf="http://www.google.com/kml/ext/2.2",jnt="http://www.w3.org/2000/xmlns/";function vD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var qnt=/^data:image\/([^,;]+)/;vD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof We){if(e=We.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(qnt);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 $nt(e,t){return function(n){e._files[t]=n}}vD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ue("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then($nt(this,r))}return o};Object.defineProperties(vD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function wD(e){this._time=e}wD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};wD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return zS(n)};wD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function N4(){this._ids={},this._styles={},this._count=0}N4.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};N4.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 Qbe(){this._ids={}}Qbe.prototype.get=function(e){if(!l(e))return this.get(Nn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function U4(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=U4._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(jnt,"xmlns:gx",Pf);let a=r.createElement("Document");s.appendChild(a),qbe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let d=new XMLSerializer().serializeToString(i.kmlDoc);return n?eit(d,c.files):{kml:d,externalFiles:c.files}})}function eit(e,t){let n=an("ThirdParty/Workers/z-worker-pako.js");tL({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new lw,o=new XD(i);return o.add("doc.kml",new pD(e)).then(function(){let r=Object.keys(t);return jbe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function jbe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new d0(n[o])).then(function(){return jbe(e,t,n,i+1)})}U4._createState=function(e){let t=e.entities,n=new N4,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Ke.MINIMUM_VALUE?r.stop===Ke.MAXIMUM_VALUE?r=new Zn:ne.addSeconds(r.stop,-10*s,r.start):r.stop===Ke.MAXIMUM_VALUE&&ne.addSeconds(r.start,10*s,r.stop);let a=new vD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Qnt,"kml"),ellipsoid:y(e.ellipsoid,ie.default),idManager:new Qbe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new wD(o),sampleDuration:s,defaultAvailability:new kr([r])}};function qbe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,d;for(let m=0;m0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),W=r.get(L.text);V=l(W)&&W.length>0?W:V;let w=r.getColor(L.fillColor);l(w)&&(G.appendChild(bn(i,"color",w)),G.appendChild(bn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&G.appendChild(bn(i,"scale",P)),d.push(G)}C.appendChild(bn(i,"name",V)),C.appendChild(bn(i,"visibility",p.show)),C.appendChild(bn(i,"description",p.description)),l(b)&&C.appendChild(b),t.appendChild(C);let R=d.length;if(R>0){let G=i.createElement("Style");for(let W=0;W1){let G=i.createElement("MultiGeometry");for(let W=0;W0){let C=i.createElement("Folder");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)),t.appendChild(C),qbe(e,C,_)}}}var cu=new f,Vl=new fe,Xf=new ne;function tit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){$be(e,t,a,n,i);return}s.get(c,void 0,cu);let u=bn(o,"coordinates",KS(cu,r)),d=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(HS(e,a.heightReference)),d.appendChild(m),d.appendChild(u),n.push(d);let p=a instanceof uc?t0e(e,a):e0e(e,a);i.push(p)}function $be(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,d=!0;u instanceof _a?(c=u.intervals,d=!1):c=y(t.availability,e.defaultAvailability);let m=n instanceof Hp,p,b,h,x=[];for(p=0;p1){let C=r.createElementNS(Pf,"MultiTrack");for(p=0;p0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[le.northeast,le.southeast,le.southwest,le.northwest];for(let b=0;b<4;++b)u[b](a,Vl),c.push(`${X.toDegrees(Vl.longitude)},${X.toDegrees(Vl.latitude)},${r}`);let d=bn(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(d),m.appendChild(p),[m]}function Hbe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let d=0;d0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),d=Array.isArray(u)?u:u.positions,m=i.createElement("outerBoundaryIs");m.appendChild(Hbe(e,d,r,s)),a.push(m);let p=u.holes;if(l(p)){let b=p.length;for(let h=0;h0&&c.appendChild(bn(r,"extrude",!0));let d=a?iit(e,t,u):oit(e,t,u),m=d.length;for(let _=0;_=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var D4=U4;var zgi=S(T(),1);var T0i=S(T(),1);function bw(){this._cache={}}bw.prototype.fromColor=function(e,t){return FD(void 0,void 0,e,t,this._cache)};bw.prototype.fromUrl=function(e,t,n){return FD(e,void 0,t,n,this._cache)};bw.prototype.fromMakiIconId=function(e,t,n){return FD(an(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};bw.prototype.fromText=function(e,t,n){return FD(void 0,e,t,n,this._cache)};var ait=new Y;function cit(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,ait).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 i0e(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width${i}${c0e(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),n}function pit(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function bit(e,t){return new zm(pit(c0e,e,t),!0)}function ND(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Nn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let d in r)if(r.hasOwnProperty(d)&&r[d]){let m=d.toLowerCase();if(u>1&&m==="title"){u=1,s=d;break}else u>2&&m==="name"?(u=2,s=d):u>3&&/title/i.test(d)?(u=3,s=d):u>4&&/name/i.test(d)&&(u=4,s=d)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new qn(c):n(r,s))}return o}function ej(e,t){let n=new Array(e.length);for(let i=0;i2?u.perPositionHeight=new qn(!0):o.clampToGround||(u.height=0);let p=ND(t,e._entityCollection,o.describe);p.polygon=u}function _0e(e,t,n,i,o){x0e(e,t,i,n.coordinates,o)}function S0e(e,t,n,i,o){let r=n.coordinates;for(let s=0;st&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Qo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Wy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Iy(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var yyi=S(T());var ryi=S(T());var nyi=S(T()),Xy=/[A-Za-z]/,ta=/[\d]/;var $u=/\s/,UD=/['"]/,R0e=/[\x00-\x1F\x7F]/,G0e=/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,Sit=/\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,Tit=/\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,Cit=G0e+Sit+Tit,E0e=/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,eyi=new RegExp("[".concat(G0e+E0e,"]")),tj=Cit+E0e,vf=new RegExp("[".concat(tj,"]"));var kD=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($u):[],o=t.split($u),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($u):[],o=t.split($u),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(),""].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 ayi=S(T());function W0e(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},R=V,G=R.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],R=R.substr(G[0].length)),G=R.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],R=R.substr(G[0].length)),G=R.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],R=R.substr(G[0].length)),G=R.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],R=R.substr(G[0].length)),G=R.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var R=L/2,G=Math.ceil(R),W=-1*Math.floor(R),w="";return W<0&&(w=V.substr(W)),V.substr(0,G)+n+w};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var d=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);d&&(u.query=u.query.substr(0,d[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var m="";if(u.host&&(m+=u.host),m.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(m,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((m+p).length>=c){if((m+p).length==t)return(m+p).substr(0,t);var b=c-m.length;return(m+a(p,b)).substr(0,c+i)}else m+=p;if(u.fragment){var h="#"+u.fragment;if((m+h).length>=c){if((m+h).length==t)return(m+h).substr(0,t);var x=c-m.length;return(m+a(h,x)).substr(0,c+i)}else m+=h}if(u.scheme&&u.host){var _=u.scheme+"://";if((m+_).length0&&(C=m.substr(-1*Math.floor(c/2))),(m.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var lyi=S(T());function I0e(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 myi=S(T());function X0e(e,t,n){return Z0e(e,t,n)}var P0e=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 kD({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=0;b--){var h=d[b];switch(h.state){case 11:W(h,p);break;case 12:w(h,p);break;case 0:C(h,p);break;case 1:V(h,p);break;case 2:L(h,p);break;case 3:R(h,p);break;case 4:G(h,p);break;case 5:P(h,p);break;case 6:F(h,p);break;case 7:M(h,p);break;case 13:g(h,p);break;case 14:Z(h,p);break;case 8:E(h,p);break;case 9:I(h,p);break;case 10:A(h,p);break;case 15:N(h,p);break;case 16:D(h,p);break;case 17:k(h,p);break;case 18:O(h,p);break;case 19:U(h,p);break;case 20:j(h,p);break;case 21:K(h,p);break;case 22:te(h,p);break;case 23:z(h,p);break;case 24:q(h,p);break;case 25:ee(h,p);break;case 26:pe(h,p);break;case 27:xe(h,p);break;case 28:ce(h,p);break;case 29:ye(h,p);break;case 30:Te(h,p);break;case 31:Le(h,p);break;case 32:Re(h,p);break;case 33:Ne(h,p);break;case 34:yt(h,p);break;case 35:Nt(h,p);break;case 36:pt(h,p);break;case 37:Xe(h,p);break;case 38:Be(h,p);break;case 39:et(h,p);break;case 40:qe(h,p);break;case 41:$e(h,p);break;default:Iy(h.state)}}}for(var x=d.length-1;x>=0;x--)d.forEach(function(ge){return Kt(ge)});return c;function _(ge){if(ge==="#")d.push(qit(m,28));else if(ge==="@")d.push($it(m,30));else if(ge==="/")d.push(dj(m,11));else if(ge==="+")d.push(mj(m,37));else if(ge==="(")d.push(mj(m,32));else{if(ta.test(ge)&&(d.push(mj(m,38)),d.push(Qit(m,13))),B0e(ge)){var Ve=ge.toLowerCase()==="m"?15:22;d.push(jit(m,Ve))}DD(ge)&&d.push(uj(m,0)),vf.test(ge)&&d.push(dj(m,5))}}function C(ge,Ve){Ve===":"?ge.state=2:Ve==="-"?ge.state=1:oj(Ve)||Qo(d,ge)}function V(ge,Ve){Ve==="-"||(Ve==="/"?(Qo(d,ge),d.push(dj(m,11))):oj(Ve)?ge.state=0:Qo(d,ge))}function L(ge,Ve){Ve==="/"?ge.state=3:Ve==="."?Qo(d,ge):f0(Ve)?(ge.state=5,DD(Ve)&&d.push(uj(m,0))):Qo(d,ge)}function R(ge,Ve){Ve==="/"?ge.state=4:rj(Ve)?(ge.state=10,ge.acceptStateReached=!0):Kt(ge)}function G(ge,Ve){Ve==="/"?ge.state=10:f0(Ve)?(ge.state=5,ge.acceptStateReached=!0):Qo(d,ge)}function W(ge,Ve){Ve==="/"?ge.state=12:Qo(d,ge)}function w(ge,Ve){f0(Ve)?ge.state=5:Qo(d,ge)}function P(ge,Ve){Ve==="."?ge.state=7:Ve==="-"?ge.state=6:Ve===":"?ge.state=8:OD(Ve)?ge.state=10:BD(Ve)||Kt(ge)}function F(ge,Ve){Ve==="-"||(Ve==="."?Kt(ge):f0(Ve)?ge.state=5:Kt(ge))}function M(ge,Ve){Ve==="."?Kt(ge):f0(Ve)?(ge.state=5,ge.acceptStateReached=!0):Kt(ge)}function g(ge,Ve){Ve==="."?ge.state=14:Ve===":"?ge.state=8:ta.test(Ve)||(OD(Ve)?ge.state=10:vf.test(Ve)?Qo(d,ge):Kt(ge))}function Z(ge,Ve){ta.test(Ve)?(ge.octetsEncountered++,ge.octetsEncountered===4&&(ge.acceptStateReached=!0),ge.state=13):Kt(ge)}function E(ge,Ve){ta.test(Ve)?ge.state=9:Kt(ge)}function I(ge,Ve){ta.test(Ve)||(OD(Ve)?ge.state=10:Kt(ge))}function A(ge,Ve){rj(Ve)||Kt(ge)}function N(ge,Ve){Ve.toLowerCase()==="a"?ge.state=16:te(ge,Ve)}function D(ge,Ve){Ve.toLowerCase()==="i"?ge.state=17:te(ge,Ve)}function k(ge,Ve){Ve.toLowerCase()==="l"?ge.state=18:te(ge,Ve)}function O(ge,Ve){Ve.toLowerCase()==="t"?ge.state=19:te(ge,Ve)}function U(ge,Ve){Ve.toLowerCase()==="o"?ge.state=20:te(ge,Ve)}function j(ge,Ve){Ve.toLowerCase()===":"?ge.state=21:te(ge,Ve)}function K(ge,Ve){YD(Ve)?ge.state=22:Qo(d,ge)}function te(ge,Ve){Ve==="."?ge.state=23:Ve==="@"?ge.state=24:YD(Ve)?ge.state=22:Qo(d,ge)}function z(ge,Ve){Ve==="."?Qo(d,ge):Ve==="@"?Qo(d,ge):YD(Ve)?ge.state=22:Qo(d,ge)}function q(ge,Ve){f0(Ve)?ge.state=25:Qo(d,ge)}function ee(ge,Ve){Ve==="."?ge.state=27:Ve==="-"?ge.state=26:BD(Ve)||Kt(ge)}function pe(ge,Ve){Ve==="-"||Ve==="."?Kt(ge):BD(Ve)?ge.state=25:Kt(ge)}function xe(ge,Ve){Ve==="."||Ve==="-"?Kt(ge):f0(Ve)?(ge.state=25,ge.acceptStateReached=!0):Kt(ge)}function ce(ge,Ve){aj(Ve)?(ge.state=29,ge.acceptStateReached=!0):Qo(d,ge)}function ye(ge,Ve){aj(Ve)||Kt(ge)}function Te(ge,Ve){cj(Ve)?(ge.state=31,ge.acceptStateReached=!0):Qo(d,ge)}function Le(ge,Ve){cj(Ve)||(vf.test(Ve)?Qo(d,ge):Kt(ge))}function Xe(ge,Ve){ta.test(Ve)?ge.state=38:(Qo(d,ge),_(Ve))}function Re(ge,Ve){ta.test(Ve)?ge.state=33:Qo(d,ge),_(Ve)}function Ne(ge,Ve){ta.test(Ve)?ge.state=34:Qo(d,ge)}function yt(ge,Ve){ta.test(Ve)?ge.state=35:Qo(d,ge)}function Nt(ge,Ve){Ve===")"?ge.state=36:Qo(d,ge)}function pt(ge,Ve){ta.test(Ve)?ge.state=38:lj(Ve)?ge.state=39:Qo(d,ge)}function Be(ge,Ve){ge.acceptStateReached=!0,KD(Ve)?ge.state=40:Ve==="#"?ge.state=41:ta.test(Ve)||(Ve==="("?ge.state=32:lj(Ve)?ge.state=39:(Kt(ge),DD(Ve)&&d.push(uj(m,0))))}function et(ge,Ve){ta.test(Ve)?ge.state=38:Ve==="("?ge.state=32:(Kt(ge),_(Ve))}function qe(ge,Ve){KD(Ve)||(Ve==="#"?ge.state=41:ta.test(Ve)?ge.state=38:Kt(ge))}function $e(ge,Ve){KD(Ve)?ge.state=40:ta.test(Ve)?Qo(d,ge):Kt(ge)}function Kt(ge){if(Qo(d,ge),!!ge.acceptStateReached){var Ve=ge.startIdx,Ht=e.slice(ge.startIdx,m);if(Ht=Jit(Ht),ge.type==="url"){var xt=e.charAt(ge.startIdx-1);if(xt==="@")return;var fi=ge.matchType;if(fi==="scheme"){var vo=ij.exec(Ht);if(vo&&(Ve=Ve+vo.index,Ht=Ht.slice(vo.index)),!M0e(Ht))return}else if(fi==="tld"){if(!N0e(Ht))return}else if(fi==="ipV4"){if(!U0e(Ht))return}else Iy(fi);c.push(new k0e({tagBuilder:n,matchedText:Ht,offset:Ve,urlMatchType:fi,url:Ht,protocolRelativeMatch:Ht.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(ge.type==="email")O0e(Ht)&&c.push(new Y0e({tagBuilder:n,matchedText:Ht,offset:Ve,email:Ht.replace(D0e,"")}));else if(ge.type==="hashtag")K0e(Ht)&&c.push(new H0e({tagBuilder:n,matchedText:Ht,offset:Ve,serviceName:s,hashtag:Ht.slice(1)}));else if(ge.type==="mention")J0e(Ht,a)&&c.push(new j0e({tagBuilder:n,matchedText:Ht,offset:Ve,serviceName:a,mention:Ht.slice(1)}));else if(ge.type==="phone"){if(Ht=Ht.replace(/ +$/g,""),q0e(Ht)){var Ms=Ht.replace(/[^0-9,;#]/g,"");c.push(new $0e({tagBuilder:n,matchedText:Ht,offset:Ve,number:Ms,plusSign:Ht.charAt(0)==="+"}))}}else Iy(ge)}}}var Hit=/[\(\{\[]/,ege=/[\)\}\]]/,tge={")":"(","}":"{","]":"["};function Jit(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(r=e.charAt(o),ege.test(r)){var s=tge[r];if(t[s]<0)t[s]++,o--;else break}else if(A0e.test(r))o--;else break;return e.slice(0,o+1)}function uj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function dj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Qit(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function jit(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function qit(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function $it(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function mj(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var Zxi=S(T());function ige(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new $h,c=0,u=e.length,d=0,m=0,p=a;c"?(p=new $h(na(na({},p),{name:te()})),j()):!Xy.test(q)&&!ta.test(q)&&q!==":"&&O()}function C(q){q===">"?O():Xy.test(q)?d=3:O()}function V(q){$u.test(q)||(q==="/"?d=12:q===">"?j():q==="<"?U():q==="="||UD.test(q)||R0e.test(q)?O():d=5)}function L(q){$u.test(q)?d=6:q==="/"?d=12:q==="="?d=7:q===">"?j():q==="<"?U():UD.test(q)&&O()}function R(q){$u.test(q)||(q==="/"?d=12:q==="="?d=7:q===">"?j():q==="<"?U():UD.test(q)?O():d=5)}function G(q){$u.test(q)||(q==='"'?d=8:q==="'"?d=9:/[>=`]/.test(q)?O():q==="<"?U():d=10)}function W(q){q==='"'&&(d=11)}function w(q){q==="'"&&(d=11)}function P(q){$u.test(q)?d=4:q===">"?j():q==="<"&&U()}function F(q){$u.test(q)?d=4:q==="/"?d=12:q===">"?j():q==="<"?U():(d=4,z())}function M(q){q===">"?(p=new $h(na(na({},p),{isClosing:!0})),j()):d=4}function g(q){e.substr(c,2)==="--"?(c+=2,p=new $h(na(na({},p),{type:"comment"})),d=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new $h(na(na({},p),{type:"doctype"})),d=20):O()}function Z(q){q==="-"?d=15:q===">"?O():d=16}function E(q){q==="-"?d=18:q===">"?O():d=16}function I(q){q==="-"&&(d=17)}function A(q){q==="-"?d=18:d=16}function N(q){q===">"?j():q==="!"?d=19:q==="-"||(d=16)}function D(q){q==="-"?d=17:q===">"?j():d=16}function k(q){q===">"?j():q==="<"&&U()}function O(){d=0,p=a}function U(){d=1,p=new $h({idx:c})}function j(){var q=e.slice(m,p.idx);q&&o(q,m),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)),O(),m=c+1}function K(){var q=e.slice(m,c);o(q,m),m=c+1}function te(){var q=p.idx+(p.isClosing?2:1);return e.slice(q,c).toLowerCase()}function z(){c--}}var $h=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 eot=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=tot(t.urls),this.email=qu(t.email)?t.email:this.email,this.phone=qu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=qu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=not(t.stripPrefix),this.stripTrailingSlash=qu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=qu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Q0e.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&z0e.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=iot(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 ige(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),d=a;u.forEach(function(m,p){if(p%2===0){var b=n.parseText(m,d);r.push.apply(r,b)}d+=m.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,u){return c.getOffset()-u.getOffset()});for(var n=0;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function fj(e,t){let n=_w(e,"id");return n=l(n)?n:Nn(),t.getOrCreateEntity(n)}function hj(e){let t=lge(e,"lon"),n=lge(e,"lat"),i=yw(e,"ele",Io.gpx);return f.fromDegrees(t,n,i)}function lge(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 _w(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Py(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r${m.text}: ${m.value}

`)}if(!l(i)||i==="")return;i=oot.link(i),xw.innerHTML=i;let s=xw.querySelectorAll("a");for(n=0;n',u+=`${xw.innerHTML}`,xw.innerHTML="",u}function bge(e,t,n,i){let o=hj(t),r=fj(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,HD);r.billboard=hge(s);let a=lu(t,"name",Io.gpx);r.name=a,r.label=aot(),r.label.text=a,r.description=bj(t,r),i.clampToGround&&(r.billboard.heightReference=je.CLAMP_TO_GROUND,r.label.heightReference=je.CLAMP_TO_GROUND)}function cot(e,t,n,i){let o=fj(t,n);o.description=bj(t,o);let r=pj(t,"rtept",Io.gpx),s=new Array(r.length);for(let a=0;a0?(a=a.concat(c.times),d.addSamples(a,s),u=u&&!0):u=!1;if(u){let m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,HD);o.billboard=hge(m),o.position=d,i.clampToGround&&(o.billboard.heightReference=je.CLAMP_TO_GROUND),o.availability=new kr,o.availability.addInterval(new Zn({start:a[0],stop:a[a.length-1]}))}o.polyline=pge(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function uot(e){let t={positions:[],times:[]},n=pj(e,"trkpt",Io.gpx),i;for(let o=0;o=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function Sot(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++,xge.call(this,e,t,n)}}var Vw=JD;var lSi=S(T(),1);var iSi=S(T(),1);var eSi=S(T(),1),Pi=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-Pi.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?Pi.Bounce.In(e*2)*.5:Pi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?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}}}}),Lw=function(){return performance.now()},Tot=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}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(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=Lw()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?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=uL.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=uL.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[n1;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}}},_ge=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),gj=new Tot,Sge=function(){function e(t,n){n===void 0&&(n=gj),this._object=t,this._group=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=Pi.Linear.None,this._interpolationFunction=uL.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=_ge.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}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=Lw()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,d=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(d){var m=i[s];if(m.length===0)continue;for(var p=[a],b=0,h=m.length;b"u"||r)&&(n[s]=a),c||(n[s]*=1),d?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._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=Lw()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=Lw()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;to)return!1;n&&this.start(t,!0)}if(this._goToEnd=!1,ti)return 1;var o=t%n,r=Math.min(o/this._duration,1);return r===0&&t!==0&&t%this._duration===0?1:r},e.prototype._calculateCompletionStatus=function(t,n){return this._duration!==0&&tthis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Zot(e){let t=e.slice(0,Math.min(4,e.size)),n=ca(),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 Rot(e){let t=ca(),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 Xge(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("",t),i,o,r;for(;t!==-1&&t0?(uu.maximumRed=r,uu.red=void 0):(uu.maximumRed=void 0,uu.red=0),o>0?(uu.maximumGreen=o,uu.green=void 0):(uu.maximumGreen=void 0,uu.green=0),i>0?(uu.maximumBlue=i,uu.blue=void 0):(uu.maximumBlue=void 0,uu.blue=0),uu.alpha=n,Y.fromRandom(uu)):new Y(r,o,i,n)}function JS(e,t,n){let i=vn(e,t,n);if(l(i))return Cj(i,vn(e,"colorMode",n)==="random")}function Eot(e){let t=vi(e,"TimeStamp",Fe.kmlgx),n=vn(t,"when",Fe.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=ne.fromIso8601(n),o=new kr;return o.addInterval(new Zn({start:i,stop:Ke.MAXIMUM_VALUE})),o}function Wot(e){let t=vi(e,"TimeSpan",Fe.kmlgx);if(!l(t))return;let n,i=vi(t,"begin",Fe.kmlgx),o=l(i)?ne.fromIso8601(i.textContent):void 0,r=vi(t,"end",Fe.kmlgx),s=l(r)?ne.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(ne.lessThan(s,o)){let a=o;o=s,s=a}n=new kr,n.addInterval(new Zn({start:o,stop:s}))}else l(o)?(n=new kr,n.addInterval(new Zn({start:o,stop:Ke.MAXIMUM_VALUE}))):l(s)&&(n=new kr,n.addInterval(new Zn({start:Ke.MINIMUM_VALUE,stop:s})));return n}function wge(){let e=new uc;return e.width=vy,e.height=vy,e.scaleByDistance=new Dt(Tge,Cge,Vge,Lge),e.pixelOffsetScaleByDistance=new Dt(Tge,Cge,Vge,Lge),e}function Gj(){let e=new Ym;return e.outline=!0,e.outlineColor=Y.WHITE,e}function Fge(){let e=new Om;return e.translucencyByDistance=new Dt(3e6,1,5e6,0),e.pixelOffset=new B(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Ko.FILL_AND_OUTLINE,e}function Ej(e,t,n,i,o){let r=vn(e,"href",Fe.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(ti(e,"x",Fe.gx),0),u=y(ti(e,"y",Fe.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let d=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${d}.png`}let s=Rj(r,n,i);if(o){let a=vn(e,"refreshMode",Fe.kml),c=vn(e,"viewRefreshMode",Fe.kml);a==="onInterval"||a==="onExpire"?Bt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Bt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(vn(e,"viewBoundScale",Fe.kml),1),d=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=y(vn(e,"viewFormat",Fe.kml),d),p=vn(e,"httpQuery",Fe.kml);l(m)&&s.setQueryParameters(Tu($D(m))),l(p)&&s.setQueryParameters(Tu($D(p)));let b=t._ellipsoid;return Ij(s,t.camera,t.canvas,u,t._lastCameraView.bbox,b),s}return s}function Iot(e,t,n,i,o){let r=ti(t,"scale",Fe.kml),s=ti(t,"heading",Fe.kml),a=JS(t,"color",Fe.kml),c=vi(t,"Icon",Fe.kml),u=Ej(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let d=ti(c,"x",Fe.gx),m=ti(c,"y",Fe.gx),p=ti(c,"w",Fe.gx),b=ti(c,"h",Fe.gx),h=vi(t,"hotSpot",Fe.kml),x=wy(h,"x"),_=wy(h,"y"),C=Ps(h,"xunits"),V=Ps(h,"yunits"),L=n.billboard;l(L)||(L=wge(),n.billboard=L),L.image=u,L.scale=r,L.color=a,(l(d)||l(m)||l(p)||l(b))&&(L.imageSubRegion=new Je(d,m,p,b)),l(s)&&s!==0&&(L.rotation=X.toRadians(-s),L.alignedAxis=f.UNIT_Z),r=y(r,1);let R,G;l(x)&&(C==="pixels"?R=-x*r:C==="insetPixels"?R=(x-vy)*r:C==="fraction"&&(R=-x*vy*r),R+=vy*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+vy)*r:V==="fraction"&&(G=_*vy*r),G-=vy*.5*r),(l(R)||l(G))&&(L.pixelOffset=new B(R,G))}function qD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r:clampToSeaFloor is currently not supported, using :clampToGround."),je.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Bt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),je.RELATIVE_TO_GROUND):(l(e)?Bt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):Bt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),je.CLAMP_TO_GROUND)}function vot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Bh(e))}function wot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r0&&Bt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let b=Math.min(a.length,u.length),h=[],x=[];for(let C=0;C0&&i.availability.addInterval(new Zn({start:x[0],stop:x[x.length-1]})),m&&d&&Wj(t,i,o),!0}function Wge(e,t,n,i,o,r,s,a,c){let u=e[0],d=e[e.length-1],m=new Ta;m.addSamples(e,t),n.intervals.addInterval(new Zn({start:u,stop:d,isStartIncluded:c,isStopIncluded:c,data:vot(m,s,a)})),i.addInterval(new Zn({start:u,stop:d,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Zn({start:u,stop:d,isStartIncluded:c,isStopIncluded:c,data:r}))}function Not(e,t,n,i,o){let r=Ff(n,"interpolate",Fe.gx),s=wf(n,"Track",Fe.gx),a,c,u,d=!1,m=new t0,p=new kr,b=new _a,h=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=wf(C,"when",Fe.kml),L=wf(C,"coord",Fe.gx),R=vn(C,"altitudeMode",Fe.kml),G=vn(C,"altitudeMode",Fe.gx),W=Ew(R,G),w=Ff(C,"extrude",Fe.kml),P=Math.min(L.length,V.length),F=[];a=[];for(let M=0;M0)){for(h='',r=0;r`;h+="
${y(x.displayName,s)}${y(x.value,"")}
"}if(!l(h))return;h=Vot.link(h),_o.innerHTML=h;let _=_o.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(ed(_o,"a","href",i),ed(_o,"link","href",i),ed(_o,"area","href",i),ed(_o,"img","src",i),ed(_o,"iframe","src",i),ed(_o,"video","src",i),ed(_o,"audio","src",i),ed(_o,"source","src",i),ed(_o,"track","src",i),ed(_o,"input","src",i),ed(_o,"embed","src",i),ed(_o,"script","src",i),ed(_o,"video","poster",i)),td(_o,"a","href",o),td(_o,"link","href",o),td(_o,"area","href",o),td(_o,"img","src",o),td(_o,"iframe","src",o),td(_o,"video","src",o),td(_o,"audio","src",o),td(_o,"source","src",o),td(_o,"track","src",o),td(_o,"input","src",o),td(_o,"embed","src",o),td(_o,"script","src",o),td(_o,"video","poster",o);let C='
',C+=`${_o.innerHTML}
`,_o.innerHTML="",t.description=C}function nB(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=vge(t,i,n.context),c=a.kml,u=Xot(e,t,n.styleCollection,r,s),d=vn(t,"name",Fe.kml);a.name=d,a.parent=o;let m=Wot(t);l(m)||(m=Eot(t)),a.availability=m,Pj(a);function p(L){return L?L.show&&p(L.parent):!0}let b=Ff(t,"visibility",Fe.kml);a.show=p(o)&&y(b,!0);let h=vi(t,"author",Fe.atom),x=c.author;x.name=vn(h,"name",Fe.atom),x.uri=vn(h,"uri",Fe.atom),x.email=vn(h,"email",Fe.atom);let _=vi(t,"link",Fe.atom),C=c.link;C.href=Ps(_,"href"),C.hreflang=Ps(_,"hreflang"),C.rel=Ps(_,"rel"),C.type=Ps(_,"type"),C.title=Ps(_,"title"),C.length=Ps(_,"length"),c.address=vn(t,"address",Fe.kml),c.phoneNumber=vn(t,"phoneNumber",Fe.kml),c.snippet=vn(t,"Snippet",Fe.kml),Dot(t,a),Bot(t,a,u,s,r);let V=e._ellipsoid;return Bge(t,a,V),Dge(t,a,V),l(vi(t,"Region",Fe.kml))&&Bt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function kge(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Oot(e,t,n,i){let o=nB(e,t,n),r=Ue(n);r.parentEntity=o.entity,kge(e,t,r,i)}function Yot(e,t,n,i){let o=nB(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,d=c.length;uX.PI_OVER_TWO?X.PI_OVER_TWO:u}function a(u){return u>X.PI?u-X.TWO_PI:u<-X.PI?u+X.TWO_PI:u}let c=Gx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let u,d;if(o=y(o,qot),l(n)&&(Sj.x=n.clientWidth*.5,Sj.y=n.clientHeight*.5,u=t.pickEllipsoid(Sj,r,$ot)),l(u)?d=r.cartesianToCartographic(u,dL):(d=le.center(o,dL),u=r.cartographicToCartesian(d)),l(i)&&!X.equalsEpsilon(i,1,X.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new le(a(d.longitude-C),s(d.latitude-V),a(d.longitude+C),s(d.latitude+V))}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 m=X.toDegrees(d.longitude).toString(),p=X.toDegrees(d.latitude).toString();c=c.replace("[lookatLon]",m),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]",f.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",d.height.toString()),r.cartesianToCartographic(t.positionWC,dL),c=c.replace("[cameraLon]",X.toDegrees(dL.longitude).toString()),c=c.replace("[cameraLat]",X.toDegrees(dL.latitude).toString()),c=c.replace("[cameraAlt]",X.toDegrees(dL.height).toString());let b=t.frustum,h=b.aspectRatio,x="",_="";if(l(h)){let C=X.toDegrees(b.fov);h>1?(x=C,_=C/h):(_=C,x=C*h)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.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(Tu(c))}function ert(e,t,n,i){let r=nB(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=vi(t,"Link",Fe.kml);if(l(c)||(c=vi(t,"Url",Fe.kml)),l(c)){let u=vn(c,"href",Fe.kml),d,m;if(l(u)){let p=u;if(u=Rj(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),d=vn(c,"viewRefreshMode",Fe.kml),d==="onRegion"){Bt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=y(vn(c,"viewBoundScale",Fe.kml),1);let _=d==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(vn(c,"viewFormat",Fe.kml),_),V=vn(c,"httpQuery",Fe.kml);l(C)&&u.setQueryParameters(Tu($D(C))),l(V)&&u.setQueryParameters(Tu($D(V)));let L=e._ellipsoid;Ij(u,e.camera,e.canvas,m,e._lastCameraView.bbox,L)}let b={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},h=new qs,x=Xj(e,h,u,b).then(function(_){let C=e._entityCollection,V=h.values;C.suspendEvents();for(let G=0;G0||L==="onExpire"||d==="onStop"){let G=vi(_,"NetworkLinkControl",Fe.kml),W=l(G),w=ne.now(),P={id:Nn(),href:u,cookie:{},lastUpdated:w,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:w},F=0;if(W&&(P.cookie=Tu(y(vn(G,"cookie",Fe.kml),"")),F=y(ti(G,"minRefreshPeriod",Fe.kml),0)),L==="onInterval")W&&(R=Math.max(F,R)),P.refreshMode=Fy.INTERVAL,P.time=R;else if(L==="onExpire"){let M;if(W&&(M=vn(G,"expires",Fe.kml)),l(M))try{let g=ne.fromIso8601(M),Z=ne.secondsDifference(g,w);Z>0&&Z0;)this._screenOverlays.pop().remove()};function Pj(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 irt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=vi(r,"NetworkLinkControl",Fe.kml),c=l(a),u=0;if(c){if(l(vi(a,"Update",Fe.kml))){Bt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Tu(y(vn(a,"cookie",Fe.kml),"")),u=y(ti(a,"minRefreshPeriod",Fe.kml),0)}let d=ne.now(),m=t.refreshMode;if(m===Fy.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(m===Fy.EXPIRE){let w;if(l(a)&&(w=vn(a,"expires",Fe.kml)),l(w))try{let P=ne.fromIso8601(w),F=ne.secondsDifference(P,d);F>0&&Fd.time&&(p=!0):d.refreshMode===Fy.EXPIRE?ne.greaterThan(n,d.time)&&(p=!0):d.refreshMode===Fy.STOP&&(r&&(d.needsUpdate=!0,d.cameraUpdateTime=n),d.needsUpdate&&ne.secondsDifference(n,d.cameraUpdateTime)>=d.time&&(p=!0)),p){o(m),d.updating=!0;let b=new qs,h=d.href.clone();h.setQueryParameters(d.cookie);let x=y(i._ellipsoid,ie.default);Ij(h,i.camera,i.canvas,d.viewBoundScale,s.bbox,x),Xj(i,b,h,{context:m.id}).then(irt(i,d,b,c,h)).catch(function(_){let C=`NetworkLink ${d.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(d.id,d)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function ort(){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}nd._DeferredLoading=tp;nd._getTimestamp=Si;var Ww=nd;var ETi=S(T(),1);function Iw(){he.throwInstantiationError()}Iw.prototype.update=he.throwInstantiationError;Iw.prototype.getBoundingSphere=he.throwInstantiationError;Iw.prototype.isDestroyed=he.throwInstantiationError;Iw.prototype.destroy=he.throwInstantiationError;var vj=Iw;var OTi=S(T(),1);var ITi=S(T(),1),QS=`in vec4 position; -in vec2 textureCoordinates; -out vec2 v_textureCoordinates; -void main() -{ -gl_Position = position; -v_textureCoordinates = textureCoordinates; -} -`;function iB(e){this._context=e}var Xw,rrt=new He({primitiveType:Ae.TRIANGLES}),srt=new ri({color:new Y(0,0,0,0)});function art(e,t){return new ba({context:e,colorTextures:[t],destroyAttachments:!1})}function crt(e,t){return qt.fromCache({context:e,vertexShaderSource:QS,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function lrt(e,t){return(!l(Xw)||Xw.viewport.width!==e||Xw.viewport.height!==t)&&(Xw=Oe.fromCache({viewport:new Je(0,0,e,t)})),Xw}iB.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:crt(o,e.fragmentShaderSource),a=art(o,t),c=lrt(n,i),u=e.uniformMap,d=srt;d.framebuffer=a,d.renderState=c,d.execute(o);let m=rrt;m.vertexArray=r,m.renderState=c,m.shaderProgram=s,m.uniformMap=u,m.framebuffer=a,m.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};iB.prototype.isDestroyed=function(){return!1};iB.prototype.destroy=function(){return de(this)};var Pw=iB;var f1i=S(T(),1);var KTi=S(T(),1);function urt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Fc=urt;var qTi=S(T(),1);function Af(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Af.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Af.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function drt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Af.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)?drt(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,d=t.createCombinedVertexShader(u),m=n.createCombinedFragmentShader(u),p=new qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:d,fragmentShaderSource:n,fragmentShaderText:m,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};Af.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){wj(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Af.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Af.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,u=r.createCombinedVertexShader(c),d=s.createCombinedFragmentShader(c),m=new qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:d,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function wj(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;oxrt;++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 Srt(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 Trt(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var Crt=1.0000010178*Ja,Vrt=100.46645683*pm,Lrt=129597742283429e-5*id,Kge=16002,zge=21863,Hge=32004,Jge=10931,Qge=14529,jge=16368,qge=15318,$ge=32794,Zrt=64*1e-7*Ja,Rrt=-152*1e-7*Ja,Grt=62*1e-7*Ja,Ert=-8*1e-7*Ja,Wrt=32*1e-7*Ja,Irt=-41*1e-7*Ja,Xrt=19*1e-7*Ja,Prt=-11*1e-7*Ja,vrt=-150*1e-7*Ja,wrt=-46*1e-7*Ja,Frt=68*1e-7*Ja,Art=54*1e-7*Ja,Mrt=14*1e-7*Ja,Nrt=24*1e-7*Ja,Urt=-28*1e-7*Ja,krt=22*1e-7*Ja,eye=10,tye=16002,nye=21863,iye=10931,oye=1473,rye=32004,sye=4387,aye=73,Drt=-325*1e-7,Brt=-322*1e-7,Ort=-79*1e-7,Yrt=232*1e-7,Krt=-52*1e-7,zrt=97*1e-7,Hrt=55*1e-7,Jrt=-41*1e-7,Qrt=-105*1e-7,jrt=-137*1e-7,qrt=258*1e-7,$rt=35*1e-7,est=-116*1e-7,tst=-88*1e-7,nst=-112*1e-7,ist=-80*1e-7,mL=new ne(0,0,Hn.TAI);function ost(e,t){lye(e,mL);let i=(mL.dayNumber-oB.dayNumber+(mL.secondsOfDay-oB.secondsOfDay)/Qn.SECONDS_PER_DAY)/(Qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=Crt+Zrt*Math.cos(Kge*o)+vrt*Math.sin(Kge*o)+Rrt*Math.cos(zge*o)+wrt*Math.sin(zge*o)+Grt*Math.cos(Hge*o)+Frt*Math.sin(Hge*o)+Ert*Math.cos(Jge*o)+Art*Math.sin(Jge*o)+Wrt*Math.cos(Qge*o)+Mrt*Math.sin(Qge*o)+Irt*Math.cos(jge*o)+Nrt*Math.sin(jge*o)+Xrt*Math.cos(qge*o)+Urt*Math.sin(qge*o)+Prt*Math.cos($ge*o)+krt*Math.sin($ge*o),s=Vrt+Lrt*i+Drt*Math.cos(eye*o)+Qrt*Math.sin(eye*o)+Brt*Math.cos(tye*o)+jrt*Math.sin(tye*o)+Ort*Math.cos(nye*o)+qrt*Math.sin(nye*o)+Yrt*Math.cos(iye*o)+$rt*Math.sin(iye*o)+Krt*Math.cos(oye*o)+est*Math.sin(oye*o)+zrt*Math.cos(rye*o)+tst*Math.sin(rye*o)+Hrt*Math.cos(sye*o)+nst*Math.sin(sye*o)+Jrt*Math.cos(aye*o)+ist*Math.sin(aye*o),a=.0167086342-.0004203654*i,c=102.93734808*pm+11612.3529*id*i,u=469.97289*id*i,d=174.87317577*pm-8679.27034*id*i;return uye(r,a,u,c,d,s,t)}function dye(e,t){lye(e,mL);let i=(mL.dayNumber-oB.dayNumber+(mL.secondsOfDay-oB.secondsOfDay)/Qn.SECONDS_PER_DAY)/Qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*pm,d=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*pm,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,b=125.04455501*pm,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*pm,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*pm+id*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*pm+id*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*pm+id*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),R=357.52910918*pm+id*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*pm-id*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),W=2*C,w=4*C,P=6*C,F=2*L,M=3*L,g=4*L,Z=2*V;a+=3400.4*Math.cos(W)-635.6*Math.cos(W-L)-235.6*Math.cos(L)+218.1*Math.cos(W-R)+181*Math.cos(W+L),c+=.014216*Math.cos(W-L)+.008551*Math.cos(W-F)-.001383*Math.cos(L)+.001356*Math.cos(W+L)-.001147*Math.cos(w-M)-914e-6*Math.cos(w-F)+869e-6*Math.cos(W-R-L)-627e-6*Math.cos(W)-394e-6*Math.cos(w-g)+282e-6*Math.cos(W-R-F)-279e-6*Math.cos(C-L)-236e-6*Math.cos(F)+231e-6*Math.cos(w)+229e-6*Math.cos(P-g)-201e-6*Math.cos(F-Z),d+=486.26*Math.cos(W-Z)-40.13*Math.cos(W)+37.51*Math.cos(Z)+25.73*Math.cos(F-Z)+19.97*Math.cos(W-R-Z),p+=-55609*Math.sin(W-L)-34711*Math.sin(W-F)-9792*Math.sin(L)+9385*Math.sin(w-M)+7505*Math.sin(w-F)+5318*Math.sin(W+L)+3484*Math.sin(w-g)-3417*Math.sin(W-R-L)-2530*Math.sin(P-g)-2376*Math.sin(W)-2075*Math.sin(W-M)-1883*Math.sin(F)-1736*Math.sin(P-5*L)+1626*Math.sin(R)-1370*Math.sin(P-M),h+=-5392*Math.sin(W-Z)-540*Math.sin(R)-441*Math.sin(W)+423*Math.sin(Z)-288*Math.sin(F-Z),_+=-3332.9*Math.sin(W)+1197.4*Math.sin(W-L)-662.5*Math.sin(R)+396.3*Math.sin(L)-218*Math.sin(W-R);let E=2*G,I=3*G;d+=46.997*Math.cos(G)*i-.614*Math.cos(W-Z+G)*i+.614*Math.cos(W-Z-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(W-Z+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(E)*r;let A=2.116*Math.sin(G)*i-.111*Math.sin(W-Z-G)*i-.0015*Math.sin(G)*o;p+=A,_+=A,h+=-520.77*Math.sin(G)*i+13.66*Math.sin(W-Z+G)*i+1.12*Math.sin(W-G)*i-1.06*Math.sin(Z-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(W-Z+E)*o-.015*Math.sin(W-Z+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(E)*r,a*=prt;let N=u+d*id,D=m+p*id,k=x+_*id,O=b+h*id;return uye(a,c,N,D,O,k,t)}var cye=.012300034,rst=cye/(cye+1)*-1;function sst(e,t){return t=dye(e,t),f.multiplyByScalar(t,rst,t)}var mye=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),Fw=new f;Fj.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ne.now()),l(t)||(t=new f),Fw=ost(e,Fw),t=f.negate(Fw,t),sst(e,Fw),f.subtract(t,Fw,t),$.multiplyByVector(mye,t,t),t};Fj.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=ne.now()),t=dye(e,t),$.multiplyByVector(mye,t,t),t};var Ay=Fj;var pCi=S(T(),1);function ast(e){e=y(e,y.EMPTY_OBJECT),this.color=Y.clone(y(e.color,Y.WHITE)),this.intensity=y(e.intensity,2)}var h0=ast;function fL(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Je,this._viewportCartesian4=new re,this._viewportDirty=!1,this._viewportOrthographicMatrix=v.clone(v.IDENTITY),this._viewportTransformation=v.clone(v.IDENTITY),this._model=v.clone(v.IDENTITY),this._view=v.clone(v.IDENTITY),this._inverseView=v.clone(v.IDENTITY),this._projection=v.clone(v.IDENTITY),this._infiniteProjection=v.clone(v.IDENTITY),this._entireFrustum=new B,this._currentFrustum=new B,this._frustumPlanes=new re,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(v.IDENTITY),this._view3DDirty=!0,this._view3D=new v,this._inverseView3DDirty=!0,this._inverseView3D=new v,this._inverseModelDirty=!0,this._inverseModel=new v,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new v,this._modelViewDirty=!0,this._modelView=new v,this._modelView3DDirty=!0,this._modelView3D=new v,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new v,this._inverseModelViewDirty=!0,this._inverseModelView=new v,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new v,this._viewProjectionDirty=!0,this._viewProjection=new v,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new v,this._modelViewProjectionDirty=!0,this._modelViewProjection=new v,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new v,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new v,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new v,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 Kn,this._cameraPosition=new f,this._sunPositionWC=new f,this._sunPositionColumbusView=new f,this._sunDirectionWC=new f,this._sunDirectionEC=new f,this._moonDirectionEC=new f,this._lightDirectionWC=new f,this._lightDirectionEC=new f,this._lightColor=new f,this._lightColorHdr=new f,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new f,this._cameraRight=new f,this._cameraUp=new f,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new B,this._eyeEllipsoidNormalEC=new f,this._eyeEllipsoidCurvature=new B,this._modelToEnu=new v,this._enuToModel=new v,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Y,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new B,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new f,this._atmosphereRayleighScaleHeight=new f,this._atmosphereMieCoefficient=new f,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(fL.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Je.equals(e,this._viewport)){Je.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return hye(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return hye(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){v.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,v.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,v.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return Aj(this),this._view3D}},viewRotation:{get:function(){return Aj(this),this._viewRotation}},viewRotation3D:{get:function(){return Aj(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return gye(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return gye(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return yst(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return xst(this),this._modelView}},modelView3D:{get:function(){return _st(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Zst(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Sst(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Tst(this),this._inverseModelView3D}},viewProjection:{get:function(){return Cst(this),this._viewProjection}},inverseViewProjection:{get:function(){return Vst(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return Lst(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Rst(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Gst(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Est(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Wst(this),this._normal}},normal3D:{get:function(){return Ist(this),this._normal3D}},inverseNormal:{get:function(){return Xst(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Pst(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 bye(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return bye(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},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}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},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 y(this._ellipsoid,ie.default)}}});function cst(e,t){v.clone(t,e._view),v.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 lst(e,t){v.clone(t,e._inverseView),v.getMatrix3(t,e._inverseViewRotation)}function ust(e,t){v.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function dst(e,t){v.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var fye=new f,mst=new v;function fst(e,t){f.clone(t.positionWC,e._cameraPosition),f.clone(t.directionWC,e._cameraDirection),f.clone(t.rightWC,e._cameraRight),f.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=f.fromRadians(o.longitude,o.latitude,0,n,fye)):(e._eyeHeight=-n.maximumRadius,f.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=f.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,fye)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Vt.eastNorthUpToFixedFrame(i,n,mst);e._enuToModel=v.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=v.inverseTransformation(e._enuToModel,e._modelToEnu),X.equalsEpsilon(n._radii.x,n._radii.y,X.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Aw=new $,hst=new fe;function pst(e,t){l(Vt.computeIcrfToFixedMatrix(t.time,Aw))||(Aw=Vt.computeTemeToPseudoFixedMatrix(t.time,Aw));let n=Ay.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(Aw,n,n),f.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),f.normalize(n,n),n=Ay.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(Aw,n,n),$.multiplyByVector(e.viewRotation3D,n,n),f.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,hst);i.project(r,e._sunPositionColumbusView)}fL.prototype.updateCamera=function(e){cst(this,e.viewMatrix),lst(this,e.inverseViewMatrix),fst(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};fL.prototype.updateFrustum=function(e){ust(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&dst(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};fL.prototype.updatePass=function(e){this._pass=e};var bst=[],gst=new h0;fL.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),pst(this,e);let n=y(e.light,gst);n instanceof h0?(this._lightDirectionWC=f.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=f.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=f.normalize(f.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=f.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=f.multiplyByScalar(o,n.intensity,o);let r=f.maximumComponent(o);r>1?f.divideByScalar(o,r,this._lightColor):f.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,bst),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&B.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=f.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=f.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=f.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=Vt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,d=this._viewport,m;l(u)?d.height>d.width?m=Math.tan(.5*u)*2/d.height:m=Math.tan(.5*u)*2/d.width:m=1/Math.max(d.width,d.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,Y.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function hye(e){if(e._viewportDirty){let t=e._viewport;v.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),v.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function yst(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?v.inverse(e._projection,e._inverseProjection):v.clone(v.ZERO,e._inverseProjection))}function xst(e){e._modelViewDirty&&(e._modelViewDirty=!1,v.multiplyTransformation(e._view,e._model,e._modelView))}function _st(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,v.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function Sst(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,v.inverse(e.modelView,e._inverseModelView))}function Tst(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,v.inverse(e.modelView3D,e._inverseModelView3D))}function Cst(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,v.multiply(e._projection,e._view,e._viewProjection))}function Vst(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,v.inverse(e.viewProjection,e._inverseViewProjection))}function Lst(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,v.multiply(e._projection,e.modelView,e._modelViewProjection))}function Zst(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 Rst(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,v.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Gst(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,v.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Est(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,v.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Wst(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;v.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function Ist(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;v.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function Xst(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;v.getMatrix3(e.modelView,t),$.transpose(t,t)}}function Pst(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;v.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var pye=new f;function bye(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,v.multiplyByPoint(e.inverseModel,e._cameraPosition,pye),Kn.fromCartesian(pye,e._encodedCameraPositionMC))}var vst=new f,wst=new f,Fst=new f,Ast=new f,Mst=new fe,Nst=new f,Ust=new v;function kst(e,t,n,i,o,r,s,a){let c=vst;c.x=e.y,c.y=e.z,c.z=e.x;let u=wst;u.x=n.y,u.y=n.z,u.z=n.x;let d=Fst;d.x=i.y,d.y=i.z,d.z=i.x;let m=Ast;m.x=t.y,m.y=t.z,m.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,Mst);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 b=s.ellipsoid,h=b.cartographicToCartesian(p,Nst),x=Vt.eastNorthUpToFixedFrame(h,b,Ust);return v.multiplyByPointAsVector(x,u,u),v.multiplyByPointAsVector(x,d,d),v.multiplyByPointAsVector(x,m,m),l(a)||(a=new v),a[0]=u.x,a[1]=d.x,a[2]=-m.x,a[3]=0,a[4]=u.y,a[5]=d.y,a[6]=-m.y,a[7]=0,a[8]=u.z,a[9]=d.z,a[10]=-m.z,a[11]=0,a[12]=-f.dot(u,h),a[13]=-f.dot(d,h),a[14]=f.dot(m,h),a[15]=1,a}function Aj(e){e._view3DDirty&&(e._mode===oe.SCENE3D?v.clone(e._view,e._view3D):kst(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),v.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function gye(e){e._inverseView3DDirty&&(v.inverseTransformation(e.view3D,e._inverseView3D),v.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var Mw=fL;function od(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):Dst(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Nn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new vw(this),this._textureCache=new ww;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Mt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Mt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Mt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Mt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Mt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Mt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Mt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Mt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Mt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Mt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let d=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Mt._minimumAliasedLineWidth=d[0],Mt._maximumAliasedLineWidth=d[1];let m=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Mt._minimumAliasedPointSize=m[0],Mt._maximumAliasedPointSize=m[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Mt._maximumViewportWidth=p[0],Mt._maximumViewportHeight=p[1];let b=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Mt._highpFloatSupported=b.precision!==0;let h=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Mt._highpIntSupported=h.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!zr(u,["OES_standard_derivatives"]),this._blendMinmax=!!zr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!zr(u,["OES_element_index_uint"]),this._depthTexture=!!zr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!zr(u,["EXT_frag_depth"]),this._debugShaders=zr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!zr(u,["OES_texture_float"]),this._textureHalfFloat=!!zr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!zr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!zr(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!zr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!zr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!zr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!zr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!zr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!zr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!zr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!zr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!zr(u,["EXT_texture_compression_bptc"]),Ns.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?zr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Mt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,R,G,W,w,P,F;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(I){E._gl.bindVertexArray(I)},V=function(I){E._gl.deleteVertexArray(I)},L=function(I,A,N,D,k){u.drawElementsInstanced(I,A,N,D,k)},R=function(I,A,N,D){u.drawArraysInstanced(I,A,N,D)},G=function(I,A){u.vertexAttribDivisor(I,A)},W=function(I){u.drawBuffers(I)}}else w=zr(u,["OES_vertex_array_object"]),l(w)&&(_=function(){return w.createVertexArrayOES()},C=function(E){w.bindVertexArrayOES(E)},V=function(E){w.deleteVertexArrayOES(E)}),P=zr(u,["ANGLE_instanced_arrays"]),l(P)&&(L=function(E,I,A,N,D){P.drawElementsInstancedANGLE(E,I,A,N,D)},R=function(E,I,A,N){P.drawArraysInstancedANGLE(E,I,A,N)},G=function(E,I){P.vertexAttribDivisorANGLE(E,I)}),F=zr(u,["WEBGL_draw_buffers"]),l(F)&&(W=function(E){F.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=R,this.glVertexAttribDivisor=G,this.glDrawBuffers=W,this._vertexArrayObject=!!w,this._instancedArrays=!!P,this._drawBuffers=!!F,Mt._maximumDrawBuffers=this.drawBuffers?u.getParameter(H.MAX_DRAW_BUFFERS):1,Mt._maximumColorAttachments=this.drawBuffers?u.getParameter(H.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Y(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let M=new Mw,g=new Fc(this),Z=Oe.fromCache();this._defaultPassState=g,this._defaultRenderState=Z,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=M,this._currentRenderState=Z,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E"u")throw new ue("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ue("The browser supports WebGL, but initialization failed.");return r}function Bst(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 Ost(e,t,n,i){let o=`${Bst(e,i)}: ${t.name}(`;for(let r=0;r=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}},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=zst(this._originalGLContext,e?Yst:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new bt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new bt({context:this,pixelFormat:nt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new bt({context:this,pixelFormat:nt.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 da({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 Hst}}});function yye(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Oe.partialApply(e._gl,o,t,r,n,i)}var Mj;typeof WebGLRenderingContext<"u"&&(Mj=[H.BACK]);function Nj(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Mj;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Jst=new ri;od.prototype.clear=function(e,t){e=y(e,Jst),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(Y.equals(this._clearColor,o)||(Y.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),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=y(e.renderState,this._defaultRenderState);yye(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);Nj(this,c),n.clear(i)};function Qst(e,t,n,i,o){Nj(e,t),yye(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function jst(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,v.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}od.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),Qst(this,o,t,n,r),jst(this,e,n,i)};od.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Mj;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let c=nt.createTypedArray(nt.RGBA,a,o,r);return Nj(this,s),t.readPixels(n,i,o,r,nt.RGBA,ze.toWebGLConstant(a,this),c),c};var xye={position:0,textureCoordinates:1};od.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new mt({attributes:{position:new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ie({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=Jn.fromGeometry({context:this,geometry:t,attributeLocations:xye,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};od.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new He({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ae.TRIANGLES,renderState:t.renderState,shaderProgram:qt.fromCache({context:this,vertexShaderSource:QS,fragmentShaderSource:e,attributeLocations:xye}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};od.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function Uj(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(Uj.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});Uj.prototype.destroy=function(){delete this._pickObjects[this.key]};od.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ue("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Uj(this._pickObjects,t,Y.fromRgba(t))};od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),de(this)};od._deprecationWarning=po;var Nw=od;var g1i=S(T(),1);function qst(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[We.createIfNeeded(t.positiveX).fetchImage(i),We.createIfNeeded(t.negativeX).fetchImage(i),We.createIfNeeded(t.positiveY).fetchImage(i),We.createIfNeeded(t.negativeY).fetchImage(i),We.createIfNeeded(t.positiveZ).fetchImage(i),We.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new da({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var Uw=qst;var hLi=S(T(),1);var x1i=S(T(),1),$st={NONE:0,LERC:1},bm=Object.freeze($st);var LVi=S(T(),1);var Q1i=S(T(),1);var P1i=S(T(),1);var S1i=S(T(),1),eat={NONE:0,BITS12:1},ia=Object.freeze(eat);var qS=new f,tat=new f,gm=new B,rB=new v,nat=new v,iat=Math.pow(2,12);function Ac(e,t,n,i,o,r,s,a,c,u){let d=ia.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let b=t.minimum,h=t.maximum,x=f.subtract(h,b,tat),_=i-n;Math.max(f.maximumComponent(x),_)0,b=y(e.isGeographic,!0),h=y(e.ellipsoid,ie.default),x=1/h.maximumRadius,_=le.clone(e.nativeRectangle),C=le.clone(e.rectangle),V,L,R,G;l(C)?(V=C.west,L=C.south,R=C.east,G=C.north):b?(V=a(_.west),L=a(_.south),R=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),R=_.east*x,G=s-2*o(r(-_.north*x)));let W=e.relativeToCenter,w=l(W);W=w?W:f.ZERO;let P=y(e.includeWebMercatorT,!1),F=y(e.exaggeration,1),M=y(e.exaggerationRelativeHeight,0),Z=F!==1,E=y(e.structure,np.DEFAULT_STRUCTURE),I=y(E.heightScale,np.DEFAULT_STRUCTURE.heightScale),A=y(E.heightOffset,np.DEFAULT_STRUCTURE.heightOffset),N=y(E.elementsPerHeight,np.DEFAULT_STRUCTURE.elementsPerHeight),D=y(E.stride,np.DEFAULT_STRUCTURE.stride),k=y(E.elementMultiplier,np.DEFAULT_STRUCTURE.elementMultiplier),O=y(E.isBigEndian,np.DEFAULT_STRUCTURE.isBigEndian),U=le.computeWidth(_),j=le.computeHeight(_),K=U/(u-1),te=j/(d-1);b||(U*=x,j*=x);let z=h.radiiSquared,q=z.x,ee=z.y,pe=z.z,xe=65536,ce=-65536,ye=Vt.eastNorthUpToFixedFrame(W,h),Te=v.inverseTransformation(ye,rat),Le,Xe;P&&(Le=Wi.geodeticLatitudeToMercatorAngle(L),Xe=1/(Wi.geodeticLatitudeToMercatorAngle(G)-Le));let Re=sat;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Ne=aat;Ne.x=Number.NEGATIVE_INFINITY,Ne.y=Number.NEGATIVE_INFINITY,Ne.z=Number.NEGATIVE_INFINITY;let yt=Number.POSITIVE_INFINITY,Nt=u*d,pt=m>0?u*2+d*2:0,Be=Nt+pt,et=new Array(Be),qe=new Array(Be),$e=new Array(Be),Kt=P?new Array(Be):[],ge=Z?new Array(Be):[],Ve=0,Ht=d,xt=0,fi=u;p&&(--Ve,++Ht,--xt,++fi);let vo=1e-5;for(let tt=Ve;tt=d&&(St=d-1);let Et=_.north-te*St;b?Et=a(Et):Et=s-2*o(r(-Et*x));let Sn=(Et-L)/(G-L);Sn=X.clamp(Sn,0,1);let Co=tt===Ve,mr=tt===Ht-1;m>0&&(Co?Et+=vo*j:mr&&(Et-=vo*j));let oc=t(Et),rc=n(Et),Rr=pe*rc,ui;P&&(ui=(Wi.geodeticLatitudeToMercatorAngle(Et)-Le)*Xe);for(let Cs=xt;Cs=u&&(Gr=u-1);let sc=St*(u*D)+Gr*D,jo;if(N===1)jo=c[sc];else{jo=0;let qr;if(O)for(qr=0;qr=0;--qr)jo=jo*k+c[sc+qr]}jo=jo*I+A,ce=Math.max(ce,jo),xe=Math.min(xe,jo);let Er=_.west+K*Gr;b?Er=a(Er):Er=Er*x;let xx=(Er-V)/(R-V);xx=X.clamp(xx,0,1);let ac=St*u+Gr;if(m>0){let qr=Cs===xt,H0=Cs===fi-1,LN=Co||mr||qr||H0;if((Co||mr)&&(qr||H0))continue;LN&&(jo-=m,qr?(ac=Nt+(d-St-1),Er-=vo*U):mr?ac=Nt+d+(u-Gr-1):H0?(ac=Nt+d+u+St,Er+=vo*U):Co&&(ac=Nt+d+u+d+Gr))}let Hc=oc*t(Er),K0=oc*n(Er),to=q*Hc,cc=ee*K0,Wr=1/i(to*Hc+cc*K0+Rr*rc),ho=to*Wr,Jc=cc*Wr,z0=Rr*Wr,jr=new f;jr.x=ho+Hc*jo,jr.y=Jc+K0*jo,jr.z=z0+rc*jo,v.multiplyByPoint(Te,jr,kj),f.minimumByComponent(kj,Re,Re),f.maximumByComponent(kj,Ne,Ne),yt=Math.min(yt,jo),et[ac]=jr,$e[ac]=new B(xx,Sn),qe[ac]=jo,P&&(Kt[ac]=ui),Z&&(ge[ac]=h.geodeticSurfaceNormal(jr))}}let Ms=ae.fromPoints(et),sa;l(C)&&(sa=Wn.fromRectangle(C,xe,ce,h));let Jr;w&&(Jr=new Hb(h).computeHorizonCullingPointPossiblyUnderEllipsoid(W,et,xe));let Qr=new sg(Re,Ne,W),Ye=new Mc(W,Qr,yt,ce,ye,!1,P,Z,F,M),st=new Float32Array(Be*Ye.stride),ot=0;for(let tt=0;tt0?L=as.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=as.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let R=V.gridWidth*V.gridHeight;return C._mesh=new ym(m,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,R,V.minimumHeight,V.maximumHeight,ae.clone(V.boundingSphere3D),f.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Wn.clone(V.orientedBoundingBox),Mc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};p0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),d=a.cartographicToCartesian(le.center(u)),m=this._structure,b=as.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?x=as.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=as.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=h.gridWidth*h.gridHeight;return this._mesh=new ym(d,h.vertices,x.indices,x.indexCountWithoutSkirts,_,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};p0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,d=r.heightOffset,m=r.heightScale,p=l(this._mesh),b=this._encoding===bm.LERC;if(!p&&b)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=Rye(_,C,d,m,e,i,o,t,n)}else x=dat(this._buffer,a,c,s,u,e,i,o,t,n),x=x*m+d;return x};p0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,d=this._structure,m=d.stride,p=new this._bufferType(c*u*m),b=a.vertices,h=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=d.heightOffset,V=d.heightScale,L=d.elementsPerHeight,R=d.elementMultiplier,G=d.isBigEndian,W=Math.pow(R,L-1);for(let w=0;wd.highestEncodedHeight?d.highestEncodedHeight:g,mat(p,L,R,W,m,G,w*c+F,g)}}return Promise.resolve(new p0({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};p0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<=s&&(b=s-1,p=s-2);let h=m|0,x=h+1;x>=a&&(x=a-1,h=a-2);let _=d-p,C=m-h;h=a-1-h,x=a-1-x;let V=lB(e,t,n,i,o,h*s+p),L=lB(e,t,n,i,o,h*s+b),R=lB(e,t,n,i,o,x*s+p),G=lB(e,t,n,i,o,x*s+b);return Gye(_,C,V,L,R,G)}function Rye(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),d=(c-o.south)*(s-1)/(o.north-o.south),m=u|0,p=m+1;p>=r&&(p=r-1,m=r-2);let b=d|0,h=b+1;h>=s&&(h=s-1,b=s-2);let x=u-m,_=d-b;b=s-1-b,h=s-1-h;let C=(t.decodeHeight(e,b*r+m)-n)/i,V=(t.decodeHeight(e,b*r+p)-n)/i,L=(t.decodeHeight(e,h*r+m)-n)/i,R=(t.decodeHeight(e,h*r+p)-n)/i;return Gye(x,_,C,V,L,R)}function Gye(e,t,n,i,o,r){return t=0;--a)s=s*n+e[r+a];return s}function mat(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Qa=p0;var IVi=S(T(),1);function gL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var $S=new le;function fat(e,t,n,i){let o=i.length;for(let r=0;r=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Eye=new fe;gL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,$S);return le.center(i,Eye),this.computeMaximumLevelAtPosition(Eye)>=e};gL.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 pL(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(pL.prototype,{nw:{get:function(){return this._nw||(this._nw=new pL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new pL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new pL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new pL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function yat(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function Dj(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=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function bL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function kw(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&bL(t._nw.extent,n),s=t._ne&&bL(t._ne.extent,n),a=t._sw&&bL(t._sw.extent,n),c=t._se&&bL(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,kw(t,t._nw,n))),s&&(i=Math.max(i,kw(t,t._ne,n))),a&&(i=Math.max(i,kw(t,t._sw,n))),c&&(i=Math.max(i,kw(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];bL(a,n)&&(i=a.level)}t=t.parent}return i}function Dw(e,t,n){if(!t)return;let i,o=!1;for(i=0;it.east&&n.push(new le(t.east,o.south,o.east,o.north)),o.southt.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 Nf=gL;var NVi=S(T(),1);var vVi=S(T(),1);function Tat(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 ip=Tat;function dB(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}dB.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 dB(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}": ${ip(i)}`),c};dB.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Xo=dB;var zVi=S(T(),1);function Ny(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ie.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Wi(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 B(-i,-i),this._rectangleNortheastInMeters=new B(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(Ny.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Ny.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(h=o-1);let x=b/u|0;return x>=r&&(x=r-1),l(n)?(n.x=h,n.y=x,n):new B(h,x)};var cs=Ny;var Cat=15;function Wye(e){this.ellipsoid=y(e.ellipsoid,ie.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Wye.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 Vat(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=y(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 _i(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new B(r.xmin,r.ymin),s.rectangleNortheastInMeters=new B(r.xmax,r.ymax),e.tilingScheme=new cs(s)}else throw new ue("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ue("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?bm.LERC:bm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Nf(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Nf(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=as.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 Lat(e,t,n){try{let i=await t.fetchJson();Vat(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Xo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Uy(e){e=y(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(Uy.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}}});Uy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=We.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new Wye(t);await Lat(o,i);let r=new Uy(t);return o.build(r),r._resource=n,r};Uy.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(Bj(this,n+1,e*2,t*2))){let m=Iye(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,d=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new Qa({buffer:m[0],width:u._width,height:u._height,childTileMask:r?d.computeChildMaskForTile(n,e,t):Cat,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(m){if(l(a)&&a.state===$n.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=$n.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function Bj(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}Uy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0;){let c=a.pop(),u=Zat(c,n,i,o);if(u.value===1){let m=u.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let d=u.endingIndices;d.length>0&&(a=a.concat(d))}return r}function Iye(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<',!1)}Object.defineProperties(Yj.prototype,{url:{get:function(){return Xye}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Yj.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:le.fromDegrees(a,s,u,c)}})})};var Kj=Yj;var VLi=S(T(),1);function zj(){}Object.defineProperties(zj.prototype,{credit:{get:function(){}}});zj.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;s2&&(l(i)||(i=Wat,f.multiplyByScalar(t[1],2,i),f.subtract(i,t[2],i),f.subtract(i,t[0],i),f.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Iat,f.multiplyByScalar(t[r-1],2,o),f.subtract(t[r],o,o),f.add(o,t[r-2],o),f.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=f.clone(i),this._lastTangent=f.clone(o),this._evaluateFunction=Eat(this),this._lastTimeIndex=0}Object.defineProperties(ky.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}}});ky.catmullRomCoefficientMatrix=new v(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);ky.prototype.findTimeInterval=Hi.prototype.findTimeInterval;ky.prototype.wrapTime=Hi.prototype.wrapTime;ky.prototype.clampTime=Hi.prototype.clampTime;ky.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Jj=ky;var VZi=S(T(),1);var $Li=S(T(),1);var MLi=S(T(),1);var mB={};mB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=ne,a=i>e,c=o>e);let u=s+a+c,d,m,p,b,h,x;return u===1?s?(d=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),d!==1&&(r.push(-1),r.push(0),r.push(1),r.push(d))):a?(p=(e-i)/(o-i),b=(e-i)/(n-i),r.push(2),r.push(0),b!==1&&(r.push(-1),r.push(1),r.push(0),r.push(b)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(h=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),h!==1&&(r.push(-1),r.push(2),r.push(0),r.push(h))):u===2?!s&&n!==e?(b=(e-i)/(n-i),h=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(b),r.push(-1),r.push(2),r.push(0),r.push(h)):!a&&i!==e?(x=(e-o)/(i-o),d=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(d)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};mB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,d=s-o,m=r-a,p=i-a,b=1/(m*u+d*p),h=t-a,x=e-s,_=(m*x+d*h)*b,C=(-p*x+u*h)*b,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new f(_,C,V)};mB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),d=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=u/m,b=d/m;if(p>=0&&p<=1&&b>=0&&b<=1)return l(c)||(c=new B),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var b0=mB;function Dy(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=hB(e.westIndices,o,t),this._southIndices=hB(e.southIndices,r,t),this._eastIndices=hB(e.eastIndices,o,t),this._northIndices=hB(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Dy.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 fB=[];function hB(e,t,n){fB.length=e.length;let i=!1;for(let o=0,r=e.length;o0&&t(e[o-1],e[o])>0;return i?(fB.sort(t),ke.createTypedArray(n,fB)):e}var vye="createVerticesFromQuantizedTerrainMesh",Xat=new di(vye),Pat=new di(vye,Mf.maximumAsynchronousTasks);Dy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),m=(a?Pat:Xat).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(m))return;let p=this;return Promise.resolve(m).then(function(b){let h=p._quantizedVertices.length/3,x=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=ke.createTypedArray(x,b.indices),C=new Float32Array(b.vertices),V=b.center,L=b.minimumHeight,R=b.maximumHeight,G=p._boundingSphere,W=p._orientedBoundingBox,w=y(f.clone(b.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=b.vertexStride,F=Mc.clone(b.encoding);return p._mesh=new ym(V,C,_,b.indexCountWithoutSkirts,h,L,R,G,w,P,W,F,b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.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 vat=new di("upsampleQuantizedTerrainMesh",Mf.maximumAsynchronousTasks);Dy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,d=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=vat.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:m,ellipsoid:d});if(!l(p))return;let b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);let h=c?b*.5:this._westSkirtHeight,x=u?b*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:b*.5,C=u?this._northSkirtHeight:b*.5,V=this._credits;return Promise.resolve(p).then(function(L){let R=new Uint16Array(L.vertices),G=ke.createTypedArray(R.length/3,L.indices),W;return l(L.encodedNormals)&&(W=new Uint8Array(L.encodedNormals)),new Dy({quantizedVertices:R,indices:G,encodedNormals:W,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:ae.clone(L.boundingSphere),orientedBoundingBox:Wn.clone(L.orientedBoundingBox),horizonOcclusionPoint:f.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:h,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var Qj=32767,wye=new f;Dy.prototype.interpolateHeight=function(e,t,n){let i=X.clamp((t-e.west)/e.width,0,1);i*=Qj;let o=X.clamp((n-e.south)/e.height,0,1);return o*=Qj,l(this._mesh)?Mat(this,i,o):Nat(this,i,o)};function Fye(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),d=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=u&&t>=d&&t<=m}var wat=new B,Fat=new B,Aat=new B;function Mat(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,u),C=r.decodeHeight(o,d),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}}function Nat(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[u]+V.y*r[d]+V.z*r[m];return X.lerp(e._minimumHeight,e._maximumHeight,L/Qj)}}}}Dy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Uat({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:b,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:d,littleEndianExtensionSize:s}));let h=t.parentUrl;return l(h)?l(b)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await $j(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function kat(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Xo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return $j(e,n);throw new ue(i)}async function Dat(e,t,n){await Nye(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Nf(e.tilingScheme,e.overallMaxZoom);for(let r=0;r0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function $j(e,t){try{let n=await e.layerJsonResource.fetchJson();return Dat(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Nye(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):kat(e,n,t)}}function Uf(e){e=y(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=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var jj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Aye(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 Bat(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Qa({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 Oat(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,d=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*u,b=Uint16Array.BYTES_PER_ELEMENT*3,h=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*h,C=new DataView(t),V=new f(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=d;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let R=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new ae(new f(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+d,!0));a+=m;let W=new f(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=d;let w=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,w*3);a+=w*b,w>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*h);let F=P.subarray(0,w),M=P.subarray(w,2*w),g=P.subarray(w*2,3*w);Fn.zigZagDeltaDecode(F,M,g),a%x!==0&&(a+=x-a%x);let Z=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=ke.createTypedArrayFromArrayBuffer(w,t,a,Z*h);a+=Z*_;let I=0,A=E.length;for(let ce=0;ce0){let Xe=Zo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Te).available;if(l(Xe))for(let Re=0;Rem.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let d=this.requestTileGeometry(e,t,n,i);u(d)},0)})):Uye(this,e,t,n,r,i)};function Uye(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ue("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,d,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(d={extensions:c.join("-")}),u=Aye(void 0)):u=Aye(c);let b=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:d,headers:u,request:r}).fetchArrayBuffer();if(l(b))return b.then(function(h){return l(h)?l(e._heightmapStructure)?Bat(e,h,i,t,n):Oat(e,h,i,t,n,o):Promise.reject(new ue("Mesh buffer doesn't exist."))})}Object.defineProperties(Uf.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}}});Uf.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<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;rthis._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r=u&&(m=(m+8)%24,d=m);se;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});kf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new kf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r=2&&(this._array[0]=this._array[e-1],Oye(this,0)),this._array[e-1]=void 0,t};kf.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=s8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Oye(this,n)}return this._array[e-1]=void 0,t};kf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};kf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[s8(this,1,2)?1:2]};function pB(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function Yw(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function s8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Bye(e,t){if(t===0)return;let n=Math.floor(X.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=Yw(e,t,i);for(o!==n&&(pB(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(Yw(e,t,r)!==o)break;pB(e,t,r),t=r}}function Oye(e,t){let n=e._length,i=Math.floor(X.log2(t+1))%2===0,o;for(;(o=2*t+1)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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\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function sd(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(sd.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});sd.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof We)&&(t=e.url);let n=We.createIfNeeded(t);n.appendForwardSlash();let i=new sd;i._resource=n;try{await Zct(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${qye(i,"",1).url}: ${o}`;throw new ue(r)}return i};sd.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<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 jye=new di("decodeGoogleEarthEnterprisePacket");sd.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=qye(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return jye.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let d,m=-1;if(e!==""){m=e.length+1;let h=u[e];d=r[e],d._bits|=h._bits,delete u[e]}let p=Object.keys(u);p.sort(function(h,x){return h.length-x.length});let b=p.length;for(let h=0;h1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};sd.prototype.populateSubtree=function(e,t,n,i){let o=sd.tileXYToQuadKey(e,t,n);return h8(this,o,i)};function h8(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 $o({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),h8(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ue(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new $o({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),h8(e,t,s)}).finally(function(){delete a[o]})}sd.prototype.getTileInformation=function(e,t,n){let i=sd.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};sd.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function qye(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var m8,f8;function Zct(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(f8)){let n=an("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;f8=Rx(n).then(function(){m8=window.cesiumGoogleEarthDbRootParser(Cct),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return f8.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=m8.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 jye.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=m8.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,u),C=r.decodeHeight(o,d),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}var vct=Uint16Array.BYTES_PER_ELEMENT,exe=Uint32Array.BYTES_PER_ELEMENT,b8=Int32Array.BYTES_PER_ELEMENT,wct=Float32Array.BYTES_PER_ELEMENT,g8=Float64Array.BYTES_PER_ELEMENT;function Fct(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let G=0;G=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*V[G]+I.y*V[W]+I.z*V[w]}}var VL=sT;var WEi=S(T(),1);var xm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},yB=new ne;function xB(){this._terrainCache={},this._lastTidy=ne.now()}xB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ne.now()}};xB.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};xB.prototype.tidy=function(){if(ne.now(yB),ne.secondsDifference(yB,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i10&&delete e[o]}ne.clone(yB,this._lastTidy)}};function Yy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new _i({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 Ct(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new xB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(Yy.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(){}}});Yy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ue(`The server ${e.url} doesn't have terrain`);let n=new Yy(t);return n._metadata=e,n};var Act=new di("decodeGoogleEarthEnterprisePacket");function ixe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===xm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var y8=Yy;var vEi=S(T(),1);var _B={};_B.defaultApiKey=void 0;_B.mapTilesApiEndpoint=new We({url:"https://tile.googleapis.com/v1/"});_B.getDefaultCredit=function(){return new Ct('Google',!0)};var aT=_B;var BEi=S(T(),1);var FEi=S(T(),1);function Nct(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var jw=Nct;var gxe={},Uct=32.184,kct=2451545,oxe=-.0529921,rxe=-.1059842,sxe=13.0120009,axe=13.3407154,cxe=.9856003,lxe=26.4057084,uxe=13.064993,dxe=.3287146,mxe=1.7484877,fxe=-.1589763,hxe=.0036096,pxe=.1643573,bxe=12.9590088,x8=new ne;gxe.ComputeMoon=function(e,t){l(e)||(e=ne.now()),x8=ne.addSeconds(e,Uct,x8);let n=ne.totalDays(x8)-kct,i=n/Qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+oxe*n)*X.RADIANS_PER_DEGREE,r=(250.089+rxe*n)*X.RADIANS_PER_DEGREE,s=(260.008+sxe*n)*X.RADIANS_PER_DEGREE,a=(176.625+axe*n)*X.RADIANS_PER_DEGREE,c=(357.529+cxe*n)*X.RADIANS_PER_DEGREE,u=(311.589+lxe*n)*X.RADIANS_PER_DEGREE,d=(134.963+uxe*n)*X.RADIANS_PER_DEGREE,m=(276.617+dxe*n)*X.RADIANS_PER_DEGREE,p=(34.226+mxe*n)*X.RADIANS_PER_DEGREE,b=(15.134+fxe*n)*X.RADIANS_PER_DEGREE,h=(119.743+hxe*n)*X.RADIANS_PER_DEGREE,x=(239.961+pxe*n)*X.RADIANS_PER_DEGREE,_=(25.053+bxe*n)*X.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),R=Math.sin(a),G=Math.sin(c),W=Math.sin(u),w=Math.sin(d),P=Math.sin(m),F=Math.sin(p),M=Math.sin(b),g=Math.sin(h),Z=Math.sin(x),E=Math.sin(_),I=Math.cos(o),A=Math.cos(r),N=Math.cos(s),D=Math.cos(a),k=Math.cos(c),O=Math.cos(u),U=Math.cos(d),j=Math.cos(m),K=Math.cos(p),te=Math.cos(b),z=Math.cos(h),q=Math.cos(x),ee=Math.cos(_),pe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*R+.0072*W-.0052*M+.0043*E)*X.RADIANS_PER_DEGREE,xe=(66.5392+.013*i+1.5419*I+.0239*A-.0278*N+.0068*D-.0029*O+9e-4*U+8e-4*te-9e-4*ee)*X.RADIANS_PER_DEGREE,ce=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*R+.0252*G-.0066*W-.0047*w-.0046*P+.0028*F+.0052*M+.004*g+.0019*Z-.0044*E)*X.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*oxe+.1208*A*rxe-.0642*N*sxe+.0158*D*axe+.0252*k*cxe-.0066*O*lxe-.0047*U*uxe-.0046*j*dxe+.0028*K*mxe+.0052*te*fxe+.004*z*hxe+.0019*q*pxe-.0044*ee*bxe)/86400*X.RADIANS_PER_DEGREE;return l(t)||(t=new jw),t.rightAscension=pe,t.declination=xe,t.rotation=ce,t.rotationRate=ye,t};var qw=gxe;var qEi=S(T(),1);function yxe(e){(!l(e)||typeof e!="function")&&(e=qw.ComputeMoon),this._computeFunction=e}var Dct=new f,Bct=new f,Oct=new f;function Yct(e,t,n){let i=Dct;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=Oct;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=f.cross(r,i,Bct);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 Kct=new $,zct=new Pe;yxe.prototype.evaluate=function(e,t){l(e)||(e=ne.now());let n=this._computeFunction(e),i=Yct(n.rightAscension,n.declination,t),o=X.zeroToTwoPi(n.rotation),r=Pe.fromAxisAngle(f.UNIT_Z,o,zct),s=$.fromQuaternion(Pe.conjugate(r,r),Kct);return $.multiply(s,i,i)};var $w=yxe;var tWi=S(T(),1);var eF={};eF.type=void 0;eF.getRequiredDataPoints=he.throwInstantiationError;eF.interpolateOrderZero=he.throwInstantiationError;eF.interpolate=he.throwInstantiationError;var _8=eF;var bWi=S(T(),1);var cWi=S(T(),1);function S8(e){this._url=We.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(S8.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});S8.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Oy.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=f.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var tF=S8;function T8(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,Jm.defaultAccessToken),n=We.createIfNeeded(y(e.server,Jm.defaultServer));n.appendForwardSlash();let i=Jm.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});l(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new tF(o)}Object.defineProperties(T8.prototype,{credit:{get:function(){}}});T8.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var nF=T8;var yWi=S(T(),1),Hct={SHIFT:0,CTRL:1,ALT:2},Za=Object.freeze(Hct);var SWi=S(T(),1);function SB(){he.throwInstantiationError()}Object.defineProperties(SB.prototype,{ellipsoid:{get:he.throwInstantiationError}});SB.prototype.project=he.throwInstantiationError;SB.prototype.unproject=he.throwInstantiationError;var C8=SB;var CWi=S(T(),1);var V8=[],L8=[];function Jct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=V8,u=L8,d,m;for(d=0;d=a||t(b,h,n)<=0)?(e[p]=b,++d):m=o)return;let r=Math.floor((i+o)*.5);Z8(e,t,n,i,r),Z8(e,t,n,r+1,o),Jct(e,t,n,i,r,o)}function Qct(e,t,n){let i=e.length,o=Math.ceil(i*.5);V8.length=o,L8.length=o,Z8(e,t,n,0,i-1),V8.length=0,L8.length=0}var x0=Qct;var GWi=S(T(),1);function LL(e){e=y(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(LL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});LL.prototype.findTimeInterval=Hi.prototype.findTimeInterval;LL.prototype.wrapTime=Hi.prototype.wrapTime;LL.prototype.clampTime=Hi.prototype.clampTime;LL.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;si){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=f.multiplyByScalar(t,n,TB);let a=o*o*n;s=f.add(e,f.multiplyByScalar(r,a,TB),TB)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Uc.fromBoundingSphere=function(e,t,n){return l(n)?(f.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Uc(e,t)};var _xe=new f;Uc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=f.subtract(e,this._occluderPosition,_xe),n=this._occluderRadius;if(n=f.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=f.subtract(e,this._cameraPosition,t),n*n>f.magnitudeSquared(t)}return!1};var qct=new f;Uc.prototype.isBoundingSphereVisible=function(e){let t=f.clone(e.center,qct),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=f.subtract(t,this._occluderPosition,_xe),o=this._occluderRadius-n;if(o=f.magnitudeSquared(i)-o*o,n0?(o=Math.sqrt(o)+this._horizonDistance,i=f.subtract(t,this._cameraPosition,i),o*o+n*n>f.magnitudeSquared(i)):!1;if(o>0){i=f.subtract(t,this._cameraPosition,i);let r=f.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 $ct=new f;Uc.prototype.computeVisibility=function(e){let t=f.clone(e.center),n=e.radius;if(n>this._occluderRadius)return yr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=f.subtract(t,this._occluderPosition,$ct),o=this._occluderRadius-n,r=f.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=f.subtract(t,this._cameraPosition,i);let s=f.magnitudeSquared(i);return o*o+n*n0?(o=Math.sqrt(o)+this._horizonDistance,s-n?yr.PARTIAL:yr.FULL))}}return yr.NONE};var CB=new f;Uc.computeOccludeePoint=function(e,t,n){let i=f.clone(t),o=f.clone(e.center),r=e.radius,s=n.length,a=f.normalize(f.subtract(i,o,CB),CB),c=-f.dot(a,o),u=Uc._anyRotationVector(o,a,c),d=Uc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!d)return;let m;for(let b=1;bi.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new f,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=f.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=f.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=f.UNIT_Z);let a=(f.dot(t,i)+n)/-f.dot(t,s);return f.normalize(f.subtract(f.add(i,f.multiplyByScalar(s,a,r),i),e,i),i)};var nlt=new f;Uc._rotationVector=function(e,t,n,i,o){let r=f.subtract(i,e,nlt);if(r=f.normalize(r,r),f.dot(t,r)<.9999999847691291){let s=f.cross(t,r,r);if(f.magnitude(s)>X.EPSILON13)return f.normalize(s,new f)}return o};var R8=new f,ilt=new f,VB=new f,xxe=new f;Uc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=f.clone(o,R8),s=f.clone(e.center,ilt),a=e.radius,c=f.subtract(s,r,VB),u=f.magnitudeSquared(c),d=a*a;if(uOpenStreetMap contributors',!1)}Object.defineProperties(G8.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});G8.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:ft(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=f.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var E8=G8;var qWi=S(T(),1);var olt={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},W8=olt;var tIi=S(T(),1);var rlt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},I8=rlt;var sIi=S(T(),1);var slt=new f;function alt(e,t,n,i){let o=Bx(e,t,n,i,slt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var X8=alt;var lIi=S(T(),1);function Sxe(){he.throwInstantiationError()}Sxe.prototype.getURL=he.throwInstantiationError;var P8=Sxe;var mIi=S(T(),1);async function clt(e,t,n,i){return l(i)||(i=!1),dlt(e,t,n,i)}function llt(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(Cxe(i)):r=o.then(Cxe(i)).catch(mlt(i)),e.shift(),t.push(r),!0}function ult(e){return new Promise(function(t){setTimeout(t,e)})}function v8(e,t,n){return e.length?llt(e,t,n)?v8(e,t,n):ult(100).then(()=>v8(e,t,n)):Promise.resolve()}function dlt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r0&&await Vxe(e,a,n),t}var cT=Vxe;var WIi=S(T(),1);var xIi=S(T(),1),flt={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},Ln=Object.freeze(flt);function Ky(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function k8(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function lT(e){if(e.shiftKey)return Za.SHIFT;if(e.ctrlKey)return Za.CTRL;if(e.altKey)return Za.ALT}var vs={LEFT:0,MIDDLE:1,RIGHT:2};function ad(e,t,n,i){function o(r){i(e,r)}At.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function hlt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;At.supportsPointerEvents()?(ad(e,"pointerdown",t,_lt),ad(e,"pointerup",t,vxe),ad(e,"pointermove",t,Slt),ad(e,"pointercancel",t,vxe)):(ad(e,"mousedown",t,wxe),ad(e,"mouseup",n,Fxe),ad(e,"mousemove",n,Axe),ad(e,"touchstart",t,ylt),ad(e,"touchend",n,Exe),ad(e,"touchmove",n,xlt),ad(e,"touchcancel",n,Exe)),ad(e,"dblclick",t,blt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",ad(e,i,t,glt)}function plt(e){let t=e._removalFunctions;for(let n=0;nBf.mouseEmulationIgnoreMilliseconds}function U8(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=lT(t),o=e.getInputAction(Ln.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function ylt(e,t){D8(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i0?new Array(o):void 0;for(i=0;i0&&(f.pack(W,m,R),R+=3,h=n[u-1],b[G++]=Y.floatToByte(h.red),b[G++]=Y.floatToByte(h.green),b[G++]=Y.floatToByte(h.blue),b[G++]=Y.floatToByte(h.alpha)),c&&u===d-1)break;f.pack(W,m,R),R+=3,l(n)&&(h=n[u],b[G++]=Y.floatToByte(h.red),b[G++]=Y.floatToByte(h.green),b[G++]=Y.floatToByte(h.blue),b[G++]=Y.floatToByte(h.alpha))}}let _=new pn;_.position=new Ie({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Ie({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),p=m.length/3;let C=(p-1)*2,V=ke.createTypedArray(p,C),L=0;for(u=0;ua?c=a:s<0?c=0:c=s;let d=i?y(this.tolerance,1):.001;Math.abs(c-u)>d&&(this._seeking=!0,t.currentTime=c)};function Rlt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var z8=dT;var WXi=S(T(),1);function Glt(e,t){this.rectangle=e,this.maxLevel=t}function Nxe(e){this.ellipsoid=y(e.ellipsoid,ie.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Nxe.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 Elt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new _i({ellipsoid:e.ellipsoid});else throw new ue(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=as.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r= PRIMARY_STEPS) { -break; -} -vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); -float sampleHeight = length(samplePosition) - atmosphereInnerRadius; -vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; -opticalDepth += sampleDensity; -czm_ray lightRay = czm_ray(samplePosition, lightDirection); -czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); -float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); -float lightPositionLength = 0.0; -vec2 lightOpticalDepth = vec2(0.0); -for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { -if (j >= LIGHT_STEPS) { -break; -} -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; -} -vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -rayleighAccumulation += sampleDensity.x * attenuation; -mieAccumulation += sampleDensity.y * attenuation; -rayPositionLength += (rayStepLength += rayStepLengthIncrease); -} -rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = u_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); -} -vec4 computeAtmosphereColor( -vec3 positionWC, -vec3 lightDirection, -vec3 rayleighColor, -vec3 mieColor, -float opacity -) { -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -float cosAngle = dot(cameraToPositionWCDirection, lightDirection); -float cosAngleSq = cosAngle * cosAngle; -float G = u_atmosphereMieAnisotropy; -float GSq = G * G; -float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); -float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); -vec3 rayleigh = rayleighPhase * rayleighColor; -vec3 mie = miePhase * mieColor; -vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; -return vec4(color, opacity); -} -`;var BXi=S(T(),1),lF=`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 roughness, vec3 N) -{ -float a = roughness * roughness; -float phi = 2.0 * M_PI * xi.x; -float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); -vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); -vec3 tangentX = normalize(cross(upVector, N)); -vec3 tangentY = cross(N, tangentX); -return tangentX * H.x + tangentY * H.y + N * H.z; -} -float G1_Smith(float NdotV, float k) -{ -return NdotV / (NdotV * (1.0 - k) + k); -} -float G_Smith(float roughness, float NdotV, float NdotL) -{ -float k = roughness * roughness / 2.0; -return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); -} -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; -for (int i = 0; i < NumSamples; i++) -{ -vec2 xi = hammersley2D(i, NumSamples); -vec3 H = importanceSampleGGX(xi, roughness, 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 = G_Smith(roughness, NdotV, NdotL); -float G_Vis = G * VdotH / (NdotH * NdotV); -float Fc = pow(1.0 - VdotH, 5.0); -A += (1.0 - Fc) * G_Vis; -B += Fc * G_Vis; -} -} -return vec2(A, B) / float(NumSamples); -} -void main() -{ -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var YXi=S(T(),1),uF=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; -float wrap(float value, float rangeLength) { -if(value < 0.0) { -float absValue = abs(value); -float modValue = mod(absValue, rangeLength); -return mod(rangeLength - modValue, rangeLength); -} -return mod(value, rangeLength); -} -vec3 wrapVec(vec3 value, float rangeLength) { -return vec3(wrap(value.x, rangeLength), -wrap(value.y, rangeLength), -wrap(value.z, rangeLength)); -} -vec2 voxelToUV(vec3 voxelIndex) { -float textureSliceWidth = u_noiseTextureDimensions.x; -float noiseTextureRows = u_noiseTextureDimensions.y; -float inverseNoiseTextureRows = u_noiseTextureDimensions.z; -float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; -vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, -inverseNoiseTextureRows / textureSliceWidth); -vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); -float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); -float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); -float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; -float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; -return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} -vec4 lerpSamplesX(vec3 voxelIndex, float x) { -vec2 uv0 = voxelToUV(voxelIndex); -vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); -vec4 sample0 = texture(u_noiseTexture, uv0); -vec4 sample1 = texture(u_noiseTexture, uv1); -return mix(sample0, sample1, x); -} -vec4 sampleNoiseTexture(vec3 position) { -float textureSliceWidth = u_noiseTextureDimensions.x; -vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); -vec3 lerpValue = fract(recenteredPos); -vec3 voxelIndex = floor(recenteredPos); -vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); -vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); -vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); -vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); -vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); -vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); -return mix(yLerp0, yLerp1, lerpValue.z); -} -bool intersectSphere(vec3 origin, vec3 dir, float slice, -out vec3 point, out vec3 normal) { -float A = dot(dir, dir); -float B = dot(origin, dir); -float C = dot(origin, origin) - 0.25; -float discriminant = (B * B) - (A * C); -if(discriminant < 0.0) { -return false; -} -float root = sqrt(discriminant); -float t = (-B - root) / A; -if(t < 0.0) { -t = (-B + root) / A; -} -point = origin + t * dir; -if(slice >= 0.0) { -point.z = (slice / 2.0) - 0.5; -if(length(point) > 0.5) { -return false; -} -} -normal = normalize(point); -point -= czm_epsilon2 * normal; -return true; -} -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, -out vec3 point, out vec3 normal) { -if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { -return false; -} -vec3 o = (origin - center) / scale; -vec3 d = dir / scale; -vec3 p, n; -bool intersected = intersectSphere(o, d, slice, p, n); -if(intersected) { -point = (p * scale) + center; -normal = n; -} -return intersected; -} -vec2 phaseShift2D(vec2 p, vec2 freq) { -return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} -vec2 phaseShift3D(vec3 p, vec2 freq) { -return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} -const float T0 = 0.6; -const float k = 0.1; -const float C0 = 0.8; -const float FX0 = 0.6; -const float FY0 = 0.6; -const int octaves = 5; -float T(vec3 point) { -vec2 sum = vec2(0.0); -float Ci = C0; -vec2 FXY = vec2(FX0, FY0); -vec2 PXY = vec2(0.0); -for(int i = 1; i <= octaves; i++) { -PXY = phaseShift3D(point, FXY); -Ci *= 0.707; -FXY *= 2.0; -vec2 sinTerm = sin(FXY * point.xy + PXY); -sum += Ci * sinTerm + vec2(T0); -} -return k * sum.x * sum.y; -} -const float a = 0.5; -const float t = 0.4; -const float s = 0.25; -float I(float Id, float Is, float It) { -return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, -float brightness) { -vec3 cloudPoint, cloudNormal; -if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, -cloudPoint, cloudNormal)) { -return vec4(0.0); -} -float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); -float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); -float It = T(cloudPoint); -float intensity = I(Id, Is, It); -vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); -vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); -float W = noise.x; -float W2 = noise.y; -float W3 = noise.z; -float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); -float TR = pow(ndDot, 3.0) - W; -TR *= 1.3; -float minusDot = 0.5 - ndDot; -TR -= min(minusDot * W2, 0.0); -TR -= 0.8 * (minusDot + 0.25) * W3; -float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); -shading = clamp(shading + 0.2, 0.3, 1.0); -vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); -return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} -void main() { -#ifdef DEBUG_BILLBOARDS -out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif -vec2 coordinate = v_maximumSize.xy * v_offset; -vec3 ellipsoidScale = 0.82 * v_maximumSize; -vec3 ellipsoidCenter = vec3(0.0); -float zOffset = max(ellipsoidScale.z - 10.0, 0.0); -vec3 eye = vec3(0, 0, -10.0 - zOffset); -vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); -vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS -vec3 point, normal; -if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, -point, normal)) { -out_FragColor = v_brightness * v_color; -} -#else -#ifndef DEBUG_BILLBOARDS -vec4 cloud = drawCloud(rayOrigin, rayDir, -ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); -if(cloud.w < 0.01) { -discard; -} -out_FragColor = cloud; -#endif -#endif -} -`;var zXi=S(T(),1),dF=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; -void main() { -vec3 positionHigh = positionHighAndScaleX.xyz; -vec3 positionLow = positionLowAndScaleY.xyz; -vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); -float show = packedAttribute0.x; -float brightness = packedAttribute0.y; -vec2 coordinates = packedAttribute0.wz; -vec3 maximumSize = packedAttribute1.xyz; -float slice = packedAttribute1.w; -#ifdef INSTANCED -vec2 dir = direction; -#else -vec2 dir = coordinates; -#endif -vec2 offset = dir - vec2(0.5, 0.5); -vec2 scaledOffset = scale * offset; -vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); -vec4 positionEC = czm_modelViewRelativeToEye * p; -positionEC.xy += scaledOffset; -positionEC.xyz *= show; -gl_Position = czm_projection * positionEC; -v_offset = offset; -v_maximumSize = maximumSize; -v_color = color; -v_slice = slice; -v_brightness = brightness; -} -`;var JXi=S(T(),1),mF=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; -float wrap(float value, float rangeLength) { -if(value < 0.0) { -float absValue = abs(value); -float modValue = mod(absValue, rangeLength); -return mod(rangeLength - modValue, rangeLength); -} -return mod(value, rangeLength); -} -vec3 wrapVec(vec3 value, float rangeLength) { -return vec3(wrap(value.x, rangeLength), -wrap(value.y, rangeLength), -wrap(value.z, rangeLength)); -} -vec3 random3(vec3 p) { -float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); -float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); -return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { -float textureSliceWidth = u_noiseTextureDimensions.x; -vec3 cell = centerCell + offset; -cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); -cell += floor(u_noiseOffset / u_noiseDetail); -vec3 p = offset + random3(cell); -return p; -} -float worleyNoise(vec3 p, float freq) { -vec3 centerCell = floor(p * freq); -vec3 pointInCell = fract(p * freq); -float shortestDistance = 1000.0; -for(float z = -1.0; z <= 1.0; z++) { -for(float y = -1.0; y <= 1.0; y++) { -for(float x = -1.0; x <= 1.0; x++) { -vec3 offset = vec3(x, y, z); -vec3 point = getWorleyCellPoint(centerCell, offset, freq); -float distance = length(pointInCell - point); -if(distance < shortestDistance) { -shortestDistance = distance; -} -} -} -} -return shortestDistance; -} -const float MAX_FBM_ITERATIONS = 10.0; -float worleyFBMNoise(vec3 p, float octaves, float scale) { -float noise = 0.0; -float freq = 1.0; -float persistence = 0.625; -for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { -if(i >= octaves) { -break; -} -noise += worleyNoise(p * scale, freq * scale) * persistence; -persistence *= 0.5; -freq *= 2.0; -} -return noise; -} -void main() { -float textureSliceWidth = u_noiseTextureDimensions.x; -float inverseNoiseTextureRows = u_noiseTextureDimensions.z; -float x = mod(v_position.x, textureSliceWidth); -float y = mod(v_position.y, textureSliceWidth); -float sliceRow = floor(v_position.y / textureSliceWidth); -float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; -vec3 position = vec3(x, y, z); -position /= u_noiseDetail; -float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); -float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); -float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); -out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var jXi=S(T(),1),fF=`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 $Xi=S(T(),1),hF=`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 t2i=S(T(),1),pF=`uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; -in vec2 v_textureCoordinates; -void main() -{ -vec4 opaque = texture(u_opaque, v_textureCoordinates); -vec4 accum = texture(u_accumulation, v_textureCoordinates); -float r = texture(u_revealage, v_textureCoordinates).r; -#ifdef MRT -vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else -vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif -out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; -if (opaque != czm_backgroundColor) -{ -out_FragColor.a = 1.0; -} -} -`;var i2i=S(T(),1),bF=`in vec4 positionEC; -void main() -{ -vec3 position; -vec3 direction; -if (czm_orthographicIn3D == 1.0) -{ -vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); -vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); -position = vec3(mix(minPlane, maxPlane, uv), 0.0); -direction = vec3(0.0, 0.0, -1.0); -} -else -{ -position = vec3(0.0); -direction = normalize(positionEC.xyz); -} -czm_ray ray = czm_ray(position, direction); -vec3 ellipsoid_center = czm_view[3].xyz; -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); -if (!czm_isEmpty(intersection)) -{ -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); -} -else -{ -discard; -} -czm_writeLogDepth(); -} -`;var r2i=S(T(),1),gF=`in vec4 position; -out vec4 positionEC; -void main() -{ -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -} -`;var a2i=S(T(),1),GL=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ -vec3 positionEC = czm_pointAlongRay(ray, intersection); -vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; -vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); -vec3 sphericalNormal = normalize(positionMC / u_radii); -vec3 normalMC = geodeticNormal * side; -vec3 normalEC = normalize(czm_normal * normalMC); -vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); -vec3 positionToEyeEC = -positionEC; -czm_materialInput materialInput; -materialInput.s = st.s; -materialInput.st = st; -materialInput.str = (positionMC + u_radii) / u_radii; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef ONLY_SUN_LIGHTING -return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else -return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -void main() -{ -float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; -vec3 direction = normalize(v_positionEC); -vec3 ellipsoidCenter = czm_modelView[3].xyz; -float t1 = -1.0; -float t2 = -1.0; -float b = -2.0 * dot(direction, ellipsoidCenter); -float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; -float discriminant = b * b - 4.0 * c; -if (discriminant >= 0.0) { -t1 = (-b - sqrt(discriminant)) * 0.5; -t2 = (-b + sqrt(discriminant)) * 0.5; -} -if (t1 < 0.0 && t2 < 0.0) { -discard; -} -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; -} -czm_ray ray = czm_ray(t * direction, direction); -vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); -if (czm_isEmpty(intersection)) -{ -discard; -} -vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); -vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); -out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); -out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) -t = (intersection.start != 0.0) ? intersection.start : intersection.stop; -vec3 positionEC = czm_pointAlongRay(ray, t); -vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH -czm_writeLogDepth(1.0 + positionCC.w); -#else -float z = positionCC.z / positionCC.w; -float n = czm_depthRange.near; -float f = czm_depthRange.far; -gl_FragDepth = (z * (f - n) + f + n) * 0.5; -#endif -#endif -} -`;var l2i=S(T(),1),EL=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; -void main() -{ -vec4 p = vec4(u_radii * position, 1.0); -v_positionEC = (czm_modelView * p).xyz; -gl_Position = czm_modelViewProjection * p; -gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); -czm_vertexLogDepth(); -} -`;var d2i=S(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 yF=`#if (FXAA_QUALITY_PRESET == 10) -#define FXAA_QUALITY_PS 3 -#define FXAA_QUALITY_P0 1.5 -#define FXAA_QUALITY_P1 3.0 -#define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) -#define FXAA_QUALITY_PS 4 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 3.0 -#define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) -#define FXAA_QUALITY_PS 5 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 4.0 -#define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) -#define FXAA_QUALITY_PS 6 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 4.0 -#define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) -#define FXAA_QUALITY_PS 7 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 4.0 -#define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) -#define FXAA_QUALITY_PS 8 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 4.0 -#define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) -#define FXAA_QUALITY_PS 3 -#define FXAA_QUALITY_P0 1.5 -#define FXAA_QUALITY_P1 2.0 -#define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) -#define FXAA_QUALITY_PS 4 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) -#define FXAA_QUALITY_PS 5 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) -#define FXAA_QUALITY_PS 6 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) -#define FXAA_QUALITY_PS 7 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 3.0 -#define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) -#define FXAA_QUALITY_PS 8 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 4.0 -#define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) -#define FXAA_QUALITY_PS 9 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 2.0 -#define FXAA_QUALITY_P7 4.0 -#define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) -#define FXAA_QUALITY_PS 10 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 2.0 -#define FXAA_QUALITY_P7 2.0 -#define FXAA_QUALITY_P8 4.0 -#define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) -#define FXAA_QUALITY_PS 11 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 2.0 -#define FXAA_QUALITY_P7 2.0 -#define FXAA_QUALITY_P8 2.0 -#define FXAA_QUALITY_P9 4.0 -#define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) -#define FXAA_QUALITY_PS 12 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.5 -#define FXAA_QUALITY_P2 2.0 -#define FXAA_QUALITY_P3 2.0 -#define FXAA_QUALITY_P4 2.0 -#define FXAA_QUALITY_P5 2.0 -#define FXAA_QUALITY_P6 2.0 -#define FXAA_QUALITY_P7 2.0 -#define FXAA_QUALITY_P8 2.0 -#define FXAA_QUALITY_P9 2.0 -#define FXAA_QUALITY_P10 4.0 -#define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) -#define FXAA_QUALITY_PS 12 -#define FXAA_QUALITY_P0 1.0 -#define FXAA_QUALITY_P1 1.0 -#define FXAA_QUALITY_P2 1.0 -#define FXAA_QUALITY_P3 1.0 -#define FXAA_QUALITY_P4 1.0 -#define FXAA_QUALITY_P5 1.5 -#define FXAA_QUALITY_P6 2.0 -#define FXAA_QUALITY_P7 2.0 -#define FXAA_QUALITY_P8 2.0 -#define FXAA_QUALITY_P9 2.0 -#define FXAA_QUALITY_P10 4.0 -#define FXAA_QUALITY_P11 8.0 -#endif -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } -FxaaFloat4 FxaaPixelShader( -FxaaFloat2 pos, -FxaaTex tex, -FxaaFloat2 fxaaQualityRcpFrame, -FxaaFloat fxaaQualitySubpix, -FxaaFloat fxaaQualityEdgeThreshold, -FxaaFloat fxaaQualityEdgeThresholdMin -) { -FxaaFloat2 posM; -posM.x = pos.x; -posM.y = pos.y; -FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); -#define lumaM rgbyM.y -FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); -FxaaFloat maxSM = max(lumaS, lumaM); -FxaaFloat minSM = min(lumaS, lumaM); -FxaaFloat maxESM = max(lumaE, maxSM); -FxaaFloat minESM = min(lumaE, minSM); -FxaaFloat maxWN = max(lumaN, lumaW); -FxaaFloat minWN = min(lumaN, lumaW); -FxaaFloat rangeMax = max(maxWN, maxESM); -FxaaFloat rangeMin = min(minWN, minESM); -FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; -FxaaFloat range = rangeMax - rangeMin; -FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); -FxaaBool earlyExit = range < rangeMaxClamped; -if(earlyExit) -return rgbyM; -FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); -FxaaFloat lumaNS = lumaN + lumaS; -FxaaFloat lumaWE = lumaW + lumaE; -FxaaFloat subpixRcpRange = 1.0/range; -FxaaFloat subpixNSWE = lumaNS + lumaWE; -FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; -FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; -FxaaFloat lumaNESE = lumaNE + lumaSE; -FxaaFloat lumaNWNE = lumaNW + lumaNE; -FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; -FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; -FxaaFloat lumaNWSW = lumaNW + lumaSW; -FxaaFloat lumaSWSE = lumaSW + lumaSE; -FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); -FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); -FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; -FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; -FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; -FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; -FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; -FxaaFloat lengthSign = fxaaQualityRcpFrame.x; -FxaaBool horzSpan = edgeHorz >= edgeVert; -FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; -if(!horzSpan) lumaN = lumaW; -if(!horzSpan) lumaS = lumaE; -if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; -FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; -FxaaFloat gradientN = lumaN - lumaM; -FxaaFloat gradientS = lumaS - lumaM; -FxaaFloat lumaNN = lumaN + lumaM; -FxaaFloat lumaSS = lumaS + lumaM; -FxaaBool pairN = abs(gradientN) >= abs(gradientS); -FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); -if(pairN) lengthSign = -lengthSign; -FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); -FxaaFloat2 posB; -posB.x = posM.x; -posB.y = posM.y; -FxaaFloat2 offNP; -offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; -offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; -if(!horzSpan) posB.x += lengthSign * 0.5; -if( horzSpan) posB.y += lengthSign * 0.5; -FxaaFloat2 posN; -posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; -posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; -FxaaFloat2 posP; -posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; -posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; -FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; -FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); -FxaaFloat subpixE = subpixC * subpixC; -FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); -if(!pairN) lumaNN = lumaSS; -FxaaFloat gradientScaled = gradient * 1.0/4.0; -FxaaFloat lumaMM = lumaM - lumaNN * 0.5; -FxaaFloat subpixF = subpixD * subpixE; -FxaaBool lumaMLTZero = lumaMM < 0.0; -lumaEndN -= lumaNN * 0.5; -lumaEndP -= lumaNN * 0.5; -FxaaBool doneN = abs(lumaEndN) >= gradientScaled; -FxaaBool doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; -FxaaBool doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; -#if (FXAA_QUALITY_PS > 3) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; -#if (FXAA_QUALITY_PS > 4) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; -#if (FXAA_QUALITY_PS > 5) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; -#if (FXAA_QUALITY_PS > 6) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; -#if (FXAA_QUALITY_PS > 7) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; -#if (FXAA_QUALITY_PS > 8) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; -#if (FXAA_QUALITY_PS > 9) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; -#if (FXAA_QUALITY_PS > 10) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; -#if (FXAA_QUALITY_PS > 11) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; -#if (FXAA_QUALITY_PS > 12) -if(doneNP) { -if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); -if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); -if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; -if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; -doneN = abs(lumaEndN) >= gradientScaled; -doneP = abs(lumaEndP) >= gradientScaled; -if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; -if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; -doneNP = (!doneN) || (!doneP); -if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; -if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -FxaaFloat dstN = posM.x - posN.x; -FxaaFloat dstP = posP.x - posM.x; -if(!horzSpan) dstN = posM.y - posN.y; -if(!horzSpan) dstP = posP.y - posM.y; -FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; -FxaaFloat spanLength = (dstP + dstN); -FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; -FxaaFloat spanLengthRcp = 1.0/spanLength; -FxaaBool directionN = dstN < dstP; -FxaaFloat dst = min(dstN, dstP); -FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; -FxaaFloat subpixG = subpixF * subpixF; -FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; -FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; -FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); -if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; -if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; -return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); -} -`;var f2i=S(T(),1),xF=`uniform vec4 u_initialColor; -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; -#endif -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; -#endif -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; -#endif -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; -#endif -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; -#endif -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; -#endif -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; -#endif -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; -#endif -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif -#ifdef SHOW_REFLECTIVE_OCEAN -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; -#endif -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif -#ifdef ENABLE_CLIPPING_POLYGONS -uniform highp sampler2D u_clippingDistance; -in vec2 v_clippingPosition; -flat in int v_regionIndex; -#endif -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; -#endif -#ifdef HIGHLIGHT_FILL_TILE -uniform vec4 u_fillHighlightColor; -#endif -#ifdef TRANSLUCENT -uniform vec4 u_frontFaceAlphaByDistance; -uniform vec4 u_backFaceAlphaByDistance; -uniform vec4 u_translucencyRectangle; -#endif -#ifdef UNDERGROUND_COLOR -uniform vec4 u_undergroundColor; -uniform vec4 u_undergroundColorAlphaByDistance; -#endif -#ifdef ENABLE_VERTEX_LIGHTING -uniform float u_lambertDiffuseMultiplier; -uniform float u_vertexShadowDarkness; -#endif -in vec3 v_positionMC; -in vec3 v_positionEC; -in vec3 v_textureCoordinates; -in vec3 v_normalMC; -in vec3 v_normalEC; -#ifdef APPLY_MATERIAL -in float v_height; -in float v_slope; -in float v_aspect; -#endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; -#endif -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ -float startDistance = nearFarScalar.x; -float startValue = nearFarScalar.y; -float endDistance = nearFarScalar.z; -float endValue = nearFarScalar.w; -float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); -return mix(startValue, endValue, t); -} -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); -} -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ -return -v_textureCoordinates.x > u_translucencyRectangle.x && -v_textureCoordinates.x < u_translucencyRectangle.z && -v_textureCoordinates.y > u_translucencyRectangle.y && -v_textureCoordinates.y < u_translucencyRectangle.w; -} -#endif -vec4 sampleAndBlend( -vec4 previousColor, -sampler2D textureToSample, -vec2 tileTextureCoordinates, -vec4 textureCoordinateRectangle, -vec4 textureCoordinateTranslationAndScale, -float textureAlpha, -float textureNightAlpha, -float textureDayAlpha, -float textureBrightness, -float textureContrast, -float textureHue, -float textureSaturation, -float textureOneOverGamma, -float split, -vec4 colorToAlpha, -float nightBlend) -{ -vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); -textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; -alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); -textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) -textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif -vec2 translation = textureCoordinateTranslationAndScale.xy; -vec2 scale = textureCoordinateTranslationAndScale.zw; -vec2 textureCoordinates = tileTextureCoordinates * scale + translation; -vec4 value = texture(textureToSample, textureCoordinates); -vec3 color = value.rgb; -float alpha = value.a; -#ifdef APPLY_COLOR_TO_ALPHA -vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); -colorDiff.r = czm_maximumComponent(colorDiff); -alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif -#if !defined(APPLY_GAMMA) -vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); -color = tempColor.rgb; -alpha = tempColor.a; -#else -color = pow(color, vec3(textureOneOverGamma)); -#endif -#ifdef APPLY_SPLIT -float splitPosition = czm_splitPosition; -if (split < 0.0 && gl_FragCoord.x > splitPosition) { -alpha = 0.0; -} -else if (split > 0.0 && gl_FragCoord.x < splitPosition) { -alpha = 0.0; -} -#endif -#ifdef APPLY_BRIGHTNESS -color = mix(vec3(0.0), color, textureBrightness); -#endif -#ifdef APPLY_CONTRAST -color = mix(vec3(0.5), color, textureContrast); -#endif -#ifdef APPLY_HUE -color = czm_hue(color, textureHue); -#endif -#ifdef APPLY_SATURATION -color = czm_saturation(color, textureSaturation); -#endif -float sourceAlpha = alpha * textureAlpha; -float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); -outAlpha += sign(outAlpha) - 1.0; -vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; -return vec4(outColor, max(outAlpha, 0.0)); -} -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); -const float fExposure = 2.0; -vec3 computeEllipsoidPosition() -{ -float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); -vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); -xy *= czm_viewport.zw * mpp * 0.5; -vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); -czm_ray ray = czm_ray(vec3(0.0), direction); -vec3 ellipsoid_center = czm_view[3].xyz; -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); -vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); -return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; -} -void main() -{ -#ifdef TILE_LIMIT_RECTANGLE -if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || -v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) -{ -discard; -} -#endif -#ifdef ENABLE_CLIPPING_PLANES -float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) -vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); -vec3 normalEC = czm_normal3D * normalMC; -#endif -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) -float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); -#else -float nightBlend = 0.0; -#endif -vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); -#ifdef SHOW_TILE_BOUNDARIES -if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || -v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) -{ -color = vec4(1.0, 0.0, 0.0, 1.0); -} -#endif -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -float cameraDist; -if (czm_sceneMode == czm_sceneMode2D) -{ -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; -} -else if (czm_sceneMode == czm_sceneModeColumbusView) -{ -cameraDist = -czm_view[3].z; -} -else -{ -cameraDist = length(czm_view[3]); -} -float fadeOutDist = u_lightingFadeDistance.x; -float fadeInDist = u_lightingFadeDistance.y; -if (czm_sceneMode != czm_sceneMode3D) { -vec3 radii = czm_ellipsoidRadii; -float maxRadii = max(radii.x, max(radii.y, radii.z)); -fadeOutDist -= maxRadii; -fadeInDist -= maxRadii; -} -float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else -float fade = 0.0; -#endif -#ifdef SHOW_REFLECTIVE_OCEAN -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; -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 -#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; -czm_material material = czm_getMaterial(materialInput); -vec4 materialColor = vec4(material.diffuse, material.alpha); -color = alphaBlend(materialColor, color); -#endif -#ifdef ENABLE_VERTEX_LIGHTING -float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); -vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) -float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); -diffuseIntensity = mix(1.0, diffuseIntensity, fade); -vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else -vec4 finalColor = color; -#endif -#ifdef ENABLE_CLIPPING_PLANES -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; -if (clipDistance < clippingPlanesEdgeWidth) -{ -finalColor = clippingPlanesEdgeColor; -} -#endif -#ifdef ENABLE_CLIPPING_POLYGONS -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -#endif -#ifdef HIGHLIGHT_FILL_TILE -finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); -#endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) -vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else -vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -if (!czm_backFacing()) -{ -bool dynamicLighting = false; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) -dynamicLighting = true; -#endif -vec3 rayleighColor; -vec3 mieColor; -float opacity; -vec3 positionWC; -vec3 lightDirection; -#ifdef PER_FRAGMENT_GROUND_ATMOSPHERE -positionWC = computeEllipsoidPosition(); -lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); -computeAtmosphereScattering( -positionWC, -lightDirection, -rayleighColor, -mieColor, -opacity -); -#else -positionWC = v_positionMC; -lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); -rayleighColor = v_atmosphereRayleighColor; -mieColor = v_atmosphereMieColor; -opacity = v_atmosphereOpacity; -#endif -#ifdef COLOR_CORRECT -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); -#endif -vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); -#ifdef FOG -vec3 fogColor = groundAtmosphereColor.rgb; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); -fogColor *= darken; -#endif -#ifndef HDR -fogColor.rgb = czm_acesTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); -#endif -const float modifier = 0.15; -finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); -#else -const float transmittanceModifier = 0.5; -float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); -vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -float fadeInDist = u_nightFadeDistance.x; -float fadeOutDist = u_nightFadeDistance.y; -float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); -float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); -vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); -finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); -#endif -#ifndef HDR -finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); -#else -finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); -#endif -finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); -#endif -} -#endif -#ifdef UNDERGROUND_COLOR -if (czm_backFacing()) -{ -float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); -float distance = max(v_distance - distanceFromEllipsoid, 0.0); -float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); -vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); -finalColor = alphaBlend(undergroundColor, finalColor); -} -#endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) -{ -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); -} -#endif -out_FragColor = finalColor; -} -#ifdef SHOW_REFLECTIVE_OCEAN -float waveFade(float edge0, float edge1, float x) -{ -float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -return pow(1.0 - y, 5.0); -} -float linearFade(float edge0, float edge1, float x) -{ -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ -vec3 positionToEyeEC = -positionEyeCoordinates; -float positionToEyeECLength = length(positionToEyeEC); -vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); -float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); -#ifdef SHOW_OCEAN_WAVES -float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; -vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); -vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); -time = czm_frameNumber * oceanAnimationSpeedLowAltitude; -noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); -vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); -float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); -float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); -vec3 normalTangentSpace = -(highAltitudeFade * normalTangentSpaceHighAltitude) + -(lowAltitudeFade * normalTangentSpaceLowAltitude); -normalTangentSpace = normalize(normalTangentSpace); -normalTangentSpace.xy *= waveIntensity; -normalTangentSpace = normalize(normalTangentSpace); -#else -vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif -vec3 normalEC = enuToEye * normalTangentSpace; -const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); -float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; -vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); -#ifdef SHOW_OCEAN_WAVES -float tsPerturbationRatio = normalTangentSpace.z; -vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else -vec3 nonDiffuseHighlight = vec3(0.0); -#endif -float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); -float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); -float specular = specularIntensity * surfaceReflectance; -#ifdef HDR -specular *= 1.4; -float e = 0.2; -float d = 3.3; -float c = 1.7; -vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); -#else -vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; -#endif -return vec4(color, imageryColor.a); -} -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var p2i=S(T(),1),_F=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; -#else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; -#endif -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; -#endif -#ifdef EXAGGERATION -uniform vec2 u_verticalExaggerationAndRelativeHeight; -#endif -uniform vec3 u_center3D; -uniform mat4 u_modifiedModelView; -uniform mat4 u_modifiedModelViewProjection; -uniform vec4 u_tileRectangle; -uniform vec2 u_southAndNorthLatitude; -uniform vec2 u_southMercatorYAndOneOverHeight; -out vec3 v_positionMC; -out vec3 v_positionEC; -out vec3 v_textureCoordinates; -out vec3 v_normalMC; -out vec3 v_normalEC; -#ifdef APPLY_MATERIAL -out float v_slope; -out float v_aspect; -out float v_height; -#endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; -#endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; -#endif -#ifdef ENABLE_CLIPPING_POLYGONS -uniform highp sampler2D u_clippingExtents; -out vec2 v_clippingPosition; -flat out int v_regionIndex; -#endif -vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); -float get2DYPositionFraction(vec2 textureCoordinates); -vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) -{ -return u_modifiedModelViewProjection * vec4(position, 1.0); -} -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ -const float maxTileWidth = 0.003068; -float positionFraction = textureCoordinates.y; -float southLatitude = u_southAndNorthLatitude.x; -float northLatitude = u_southAndNorthLatitude.y; -if (northLatitude - southLatitude > maxTileWidth) -{ -float southMercatorY = u_southMercatorYAndOneOverHeight.x; -float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; -float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); -currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); -positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); -} -return positionFraction; -} -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ -return textureCoordinates.y; -} -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) -{ -float yPositionFraction = get2DYPositionFraction(textureCoordinates); -vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); -return u_modifiedModelViewProjection * rtcPosition2D; -} -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, 0.0, textureCoordinates); -} -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, height, textureCoordinates); -} -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ -vec3 position3DWC = position + u_center3D; -float yPositionFraction = get2DYPositionFraction(textureCoordinates); -vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); -vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); -return czm_modelViewProjection * morphPosition; -} -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; -#endif -void main() -{ -#ifdef QUANTIZATION_BITS12 -vec2 xy = czm_decompressTextureCoordinates(compressed0.x); -vec2 zh = czm_decompressTextureCoordinates(compressed0.y); -vec3 position = vec3(xy, zh.x); -float height = zh.y; -vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); -height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; -position = (u_scaleAndBias * vec4(position, 1.0)).xyz; -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL) -float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; -float encodedNormal = compressed1; -#elif defined(INCLUDE_WEB_MERCATOR_Y) -float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; -float encodedNormal = 0.0; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) -float webMercatorT = textureCoordinates.y; -float encodedNormal = compressed0.w; -#else -float webMercatorT = textureCoordinates.y; -float encodedNormal = 0.0; -#endif -#else -vec3 position = position3DAndHeight.xyz; -float height = position3DAndHeight.w; -vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; -#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y) -float webMercatorT = textureCoordAndEncodedNormals.z; -float encodedNormal = textureCoordAndEncodedNormals.w; -#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) -float webMercatorT = textureCoordinates.y; -float encodedNormal = textureCoordAndEncodedNormals.z; -#elif defined(INCLUDE_WEB_MERCATOR_Y) -float webMercatorT = textureCoordAndEncodedNormals.z; -float encodedNormal = 0.0; -#else -float webMercatorT = textureCoordinates.y; -float encodedNormal = 0.0; -#endif -#endif -vec3 position3DWC = position + u_center3D; -#ifdef GEODETIC_SURFACE_NORMALS -vec3 ellipsoidNormal = geodeticSurfaceNormal; -#else -vec3 ellipsoidNormal = normalize(position3DWC); -#endif -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) -float exaggeration = u_verticalExaggerationAndRelativeHeight.x; -float relativeHeight = u_verticalExaggerationAndRelativeHeight.y; -float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; -float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); -newHeight = max(newHeight, -minRadius); -vec3 offset = ellipsoidNormal * (newHeight - height); -position += offset; -position3DWC += offset; -height = newHeight; -#endif -gl_Position = getPosition(position, height, textureCoordinates); -v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; -v_positionMC = position3DWC; -v_textureCoordinates = vec3(textureCoordinates, webMercatorT); -#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) -vec3 normalMC = czm_octDecode(encodedNormal); -#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) -vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; -vec3 rejection = normalMC - projection; -normalMC = normalize(projection + rejection * exaggeration); -#endif -v_normalMC = normalMC; -v_normalEC = czm_normal3D * v_normalMC; -#endif -#ifdef ENABLE_CLIPPING_POLYGONS -vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC); -sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); -vec2 minDistance = vec2(czm_infinity); -v_clippingPosition = vec2(czm_infinity); -v_regionIndex = -1; -for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { -vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex); -vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; -vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); -vec2 distance = abs(rectUv - clamped) * extents.wz; -float threshold = 0.01; -if (minDistance.x > distance.x || minDistance.y > distance.y) { -minDistance = distance; -v_clippingPosition = rectUv; -if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { -v_regionIndex = regionIndex; -} -} -} -#endif -#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) -bool dynamicLighting = false; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) -dynamicLighting = true; -#endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) -vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else -vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif -vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); -computeAtmosphereScattering( -position3DWC, -lightDirection, -v_atmosphereRayleighColor, -v_atmosphereMieColor, -v_atmosphereOpacity -); -#endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); -#endif -#ifdef APPLY_MATERIAL -float northPoleZ = czm_ellipsoidRadii.z; -vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); -vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); -float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); -v_slope = acos(dotProd); -vec3 normalRejected = ellipsoidNormal * dotProd; -vec3 normalProjected = v_normalMC - normalRejected; -vec3 aspectVector = normalize(normalProjected); -v_aspect = acos(dot(aspectVector, vectorEastMC)); -float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); -v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); -v_height = height; -#endif -} -`;var g2i=S(T(),1),WL=`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 x2i=S(T(),1),SF=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var S2i=S(T(),1),TF=`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 C2i=S(T(),1),IL=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ -float startDistance = nearFarScalar.x; -float startValue = nearFarScalar.y; -float endDistance = nearFarScalar.z; -float endValue = nearFarScalar.w; -float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); -return mix(startValue, endValue, t); -} -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ -float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; -float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; -float distanceAdjustMax = czm_ellipsoidRadii.x; -float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; -float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); -float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; -float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); -underTranslucentGlobe = 0.0; -#if defined(GLOBE_TRANSLUCENT) -czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); -if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { -vec3 direction = normalize(positionWC); -czm_ray ellipsoidRay = czm_ray(positionWC, -direction); -czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); -vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); -float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); -opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); -vec3 horizonColor = vec3(0.1, 0.2, 0.3); -vec3 nearColor = vec3(0.0); -rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); -underTranslucentGlobe = 1.0; -return; -} -#endif -computeScattering( -primaryRay, -length(cameraToPositionWC), -lightDirection, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; -float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; -opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); -float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; -opacity *= pow(nightAlpha, 0.5); -} -`;var L2i=S(T(),1),CF=`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_acesTonemapping(color.rgb); -color.rgb = czm_inverseGamma(color.rgb); -#endif -#ifdef COLOR_CORRECT -const bool ignoreBlackPixels = true; -color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); -#endif -if (translucent == 0.0) { -color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); -} -out_FragColor = color; -} -`;var R2i=S(T(),1),VF=`in vec4 position; -out vec3 v_outerPositionWC; -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif -void main(void) -{ -vec4 positionWC = czm_model * position; -float lightEnum = u_radiiAndDynamicAtmosphereColor.z; -vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); -#ifndef PER_FRAGMENT_ATMOSPHERE -computeAtmosphereScattering( -positionWC.xyz, -lightDirection, -v_rayleighColor, -v_mieColor, -v_opacity, -v_translucent -); -#endif -v_outerPositionWC = positionWC.xyz; -gl_Position = czm_modelViewProjection * position; -} -`;var E2i=S(T(),1),LF=`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 I2i=S(T(),1),ZF=`in vec3 position; -out vec3 v_texCoord; -void main() -{ -vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); -gl_Position = czm_projection * vec4(p, 1.0); -v_texCoord = position.xyz; -} -`;var P2i=S(T(),1),RF=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ -vec4 color = texture(u_texture, v_textureCoordinates); -out_FragColor = czm_gammaCorrect(color); -} -`;var w2i=S(T(),1),GF=`uniform float u_radiusTS; -in vec2 v_textureCoordinates; -vec2 rotate(vec2 p, vec2 direction) -{ -return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); -} -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) -{ -vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); -float radius = length(rotatedPosition) * lengthScalar; -float burst = 1.0 - smoothstep(0.0, 0.55, radius); -return vec4(burst); -} -void main() -{ -float lengthScalar = 2.0 / sqrt(2.0); -vec2 position = v_textureCoordinates - vec2(0.5); -float radius = length(position) * lengthScalar; -float surface = step(radius, u_radiusTS); -vec4 color = vec4(vec2(1.0), surface + 0.2, surface); -float glow = 1.0 - smoothstep(0.0, 0.55, radius); -color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; -vec4 burst = vec4(0.0); -burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); -color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; -out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); -} -`;var A2i=S(T(),1),EF=`in vec2 direction; -uniform float u_size; -out vec2 v_textureCoordinates; -void main() -{ -vec4 position; -if (czm_morphTime == 1.0) -{ -position = vec4(czm_sunPositionWC, 1.0); -} -else -{ -position = vec4(czm_sunPositionColumbusView.zxy, 1.0); -} -vec4 positionEC = czm_view * position; -vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); -vec2 halfSize = vec2(u_size * 0.5); -halfSize *= ((direction * 2.0) - 1.0); -gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); -v_textureCoordinates = direction; -} -`;var N2i=S(T(),1),WF=`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 g$i=S(T(),1);var QNi=S(T(),1);var j2i=S(T(),1);var B2i=S(T(),1);var Flt=new B;function Alt(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,Flt),s=r.x,a=r.y,c=o?Ult(s,a):klt(s,a);return c+=` -`,c+=n?Mlt(i):Nlt(i),c}function Mlt(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 Nlt(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 Ult(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 klt(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 T0=Alt;function Dlt(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 Q8(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Blt(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 Olt(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 Ylt(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 Klt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}Q8.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,d=e.applyDayNightAlpha,m=e.applySplit,p=e.showReflectiveOcean,b=e.showOceanWaves,h=e.enableLighting,x=e.dynamicAtmosphereLighting,_=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,V=e.perFragmentGroundAtmosphere,L=e.hasVertexNormals,R=e.useWebMercatorProjection,G=e.enableFog,W=e.enableClippingPlanes,w=e.clippingPlanes,P=e.enableClippingPolygons,F=e.clippingPolygons,M=e.clippedByBoundaries,g=e.hasImageryLayerCutout,Z=e.colorCorrect,E=e.highlightFillTile,I=e.colorToAlpha,A=e.hasGeodeticSurfaceNormals,N=e.hasExaggeration,D=e.showUndergroundColor,k=e.translucent,O=0,U="",K=n.renderedMesh.encoding;K.quantization===ia.BITS12&&(O=1,U="QUANTIZATION_BITS12");let z=0,q="";M&&(z=1,q="TILE_LIMIT_RECTANGLE");let ee=0,pe="";g&&(ee=1,pe="APPLY_IMAGERY_CUTOUT");let xe=t.mode,ce=xe|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|b<<9|h<<10|x<<11|_<<12|C<<13|V<<14|L<<15|R<<16|G<<17|O<<18|m<<19|W<<20|P<<21|z<<22|ee<<23|Z<<24|E<<25|I<<26|A<<27|N<<28|D<<29|k<<30|d<<31,ye=0;l(w)&&w.length>0&&(ye=W?w.clippingPlanesState:0);let Te=0;l(F)&&F.length>0&&(Te=P?F.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===ce&&Le.material===this.material&&Le.clippingShaderState===ye&&Le.clippingPolygonShaderState===Te)return Le.shaderProgram;let Xe=this._shadersByTexturesFlags[i];if(l(Xe)||(Xe=this._shadersByTexturesFlags[i]=[]),Le=Xe[ce],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==ye||Le.clippingPolygonShaderState!==Te){let Re=this.baseVertexShaderSource.clone(),Ne=this.baseFragmentShaderSource.clone();ye!==0&&Ne.sources.unshift(T0(w,t.context)),Te!==0&&(Ne.sources.unshift(Olt(t.context)),Re.sources.unshift(Ylt(t.context))),Re.defines.push(U),Ne.defines.push(`TEXTURE_UNITS ${i}`,q,pe),o&&Ne.defines.push("APPLY_BRIGHTNESS"),r&&Ne.defines.push("APPLY_CONTRAST"),s&&Ne.defines.push("APPLY_HUE"),a&&Ne.defines.push("APPLY_SATURATION"),c&&Ne.defines.push("APPLY_GAMMA"),u&&Ne.defines.push("APPLY_ALPHA"),d&&Ne.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Ne.defines.push("SHOW_REFLECTIVE_OCEAN"),Re.defines.push("SHOW_REFLECTIVE_OCEAN")),b&&Ne.defines.push("SHOW_OCEAN_WAVES"),I&&Ne.defines.push("APPLY_COLOR_TO_ALPHA"),D&&(Re.defines.push("UNDERGROUND_COLOR"),Ne.defines.push("UNDERGROUND_COLOR")),k&&(Re.defines.push("TRANSLUCENT"),Ne.defines.push("TRANSLUCENT")),h&&(L?(Re.defines.push("ENABLE_VERTEX_LIGHTING"),Ne.defines.push("ENABLE_VERTEX_LIGHTING")):(Re.defines.push("ENABLE_DAYNIGHT_SHADING"),Ne.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Re.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ne.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),_&&(Re.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ne.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(Re.defines.push("GROUND_ATMOSPHERE"),Ne.defines.push("GROUND_ATMOSPHERE"),V&&(Re.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ne.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Re.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ne.defines.push("INCLUDE_WEB_MERCATOR_Y"),G&&(Re.defines.push("FOG"),Ne.defines.push("FOG")),m&&Ne.defines.push("APPLY_SPLIT"),W&&Ne.defines.push("ENABLE_CLIPPING_PLANES"),P&&(Ne.defines.push("ENABLE_CLIPPING_POLYGONS"),Re.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&Ne.defines.push("CLIPPING_INVERSE"),Ne.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),Re.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),Z&&Ne.defines.push("COLOR_CORRECT"),E&&Ne.defines.push("HIGHLIGHT_FILL_TILE"),A&&Re.defines.push("GEODETIC_SURFACE_NORMALS"),N&&Re.defines.push("EXAGGERATION");let yt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;g&&(yt+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let pt=0;pt=0&&(d=V)}return d!==Number.MAX_VALUE?yn.getPoint(e,d,o):void 0};ar.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=fo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t=fo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)cut(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function nut(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=oa.FAILED;return}let c=a.data.terrainData,u=a.x,d=a.y,m=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,d,m,o,r,s);l(p)&&(e.terrainState=fo.RECEIVING,Promise.resolve(p).then(function(b){l(b)&&(e.terrainData=b,e.terrainState=fo.RECEIVED)}).catch(function(){e.terrainState=fo.FAILED}))}function iut(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=fo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainState=fo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Xo.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new $o({throttle:!1,throttleByServer:!0,type:fs.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=fo.RECEIVING,Promise.resolve(u).then(function(d){r(d)}).catch(function(d){s(d)})):(e.terrainState=fo.UNLOADED,e.request=void 0)}a()}var out={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function rut(e,t,n,i,o,r){let s=n.tilingScheme,a=out;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=fo.TRANSFORMING,Promise.resolve(u).then(function(d){e.mesh=d,e.terrainState=fo.TRANSFORMED}).catch(function(){e.terrainState=fo.FAILED}))}ar._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ut.createVertexBuffer({context:e,typedArray:n,usage:Me.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=ut.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new Jn({context:e,attributes:o,indexBuffer:s})};ar._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 sut(e,t,n,i,o,r,s){e.vertexArray=ar._createVertexArrayForMesh(t,e.mesh),e.terrainState=fo.READY,e.fill=e.fill&&e.fill.destroy(s)}function aut(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=bt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR,magnificationFilter:ni.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function cut(e,t){let n=t.terrainData.waterMask,i=aut(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=bt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:ze.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)}ar.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};ar.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 _m=ar;var $Ai=S(T(),1);var oAi=S(T(),1);var jFi=S(T(),1);var Tvi=S(T(),1);var APi=S(T(),1);var q8,Dxe="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRcs5cw5x8CvIyg2oiotXJmY_GjoEUuuKAUvdWxusIx25kUy2AttkOs0FgosGzFJSsjafpWC40GiE5hiD0FLNSh3kxIW6w-5qqUQCEAwGY1t4yH7Fj-PjrkjPfSpw0_r2xF3lKLd0_LSmPWXCkYhqV1O67tWLNImHyr7SurJ92sA5YIG1pMJKEQU3Qv5k18p0g.AT1_sGbfSYDL",XL={};XL.defaultAccessToken=Dxe;XL.defaultWorldImageryServer=new We({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});XL.defaultWorldHillshadeServer=new We({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});XL.defaultWorldOceanServer=new We({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});XL.getDefaultTokenCredit=function(e){if(e===Dxe){if(!l(q8)){let t=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken 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 https://developers.arcgis.com/.';q8=new Ct(t,!0)}return q8}};var ld=XL;var BPi=S(T(),1);function $8(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=We.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=wm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let d=0,m=u.length;a&&d0&&(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)}$8.prototype.isReady=function(){return this._isReady};$8.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=wm(e),o=e.width;for(let r=0,s=t.length;r1&&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])};e7.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",i}this.description=t(e)};var Of=e7;var qPi=S(T(),1);function PL(){he.throwInstantiationError()}Object.defineProperties(PL.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});PL.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};PL.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};PL.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var lut=/\.ktx2$/i;PL.loadImage=function(e,t){let n=We.createIfNeeded(t);return lut.test(n.url)?Ns(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Rl=PL;var evi=S(T(),1),uut={SATELLITE:1,OCEANS:2,HILLSHADE:3},Yf=Object.freeze(uut);function Bxe(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new _i({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Bxe.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 XF({missingImageUrl:Oxe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new B(0,0),new B(200,20),new B(20,200),new B(80,110),new B(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function dut(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 cs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new _i({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ue(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Wi,o=e.fullExtent,r=i.unproject(new f(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 f(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 ue(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function mut(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ue(n)}async function fut(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();dut(i,t)}catch(i){mut(e,i)}}function ap(e){e=y(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=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new _i({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new be}ap.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Yf.SATELLITE:{n=y(t.token,ld.defaultAccessToken),i=We.createIfNeeded(ld.defaultWorldImageryServer),i.appendForwardSlash();let r=ld.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Yf.OCEANS:{n=y(t.token,ld.defaultAccessToken),i=We.createIfNeeded(ld.defaultWorldOceanServer),i.appendForwardSlash();let r=ld.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Yf.HILLSHADE:{n=y(t.token,ld.defaultAccessToken),i=We.createIfNeeded(ld.defaultWorldHillshadeServer),i.appendForwardSlash();let r=ld.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;default:}return ap.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Oxe(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Gi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(ap.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});ap.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=We.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new ap(t);i._resource=n;let o=new Bxe(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await fut(n,o),o.build(i),i};ap.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ap.prototype.requestImage=function(e,t,n,i){return Rl.loadImage(this,Oxe(this,e,t,n,i))};ap.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Gi)s=X.toDegrees(i),a=X.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let d={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:d}).fetchJson().then(function(p){let b=[],h=p.results;if(!l(h))return b;for(let x=0;x`),this._tilingScheme=new cs({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(ws.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});ws.fromUrl=async function(e,t){t=y(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=y(t.mapStyle,vL.AERIAL),o=We.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 ws(t);a._resource=o;let c=new Yxe(t);return await gut(s,c),c.build(a),a};var yut=new le;ws.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,yut);return Sut(this._attributionList,n,i)};ws.prototype.requestImage=function(e,t,n,i){let o=Rl.loadImage(this,xut(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?wL.EMPTY_IMAGE:Promise.reject(r)})};ws.prototype.pickFeatures=function(e,t,n,i,o){};ws.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<=m.zoomMin&&t<=m.zoomMax){let p=le.intersection(n,m.bbox,_ut);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ws._metadataCache={};var vF=ws;var _wi=S(T(),1);var rwi=S(T(),1);var Kxe=/{[^}]+}/g,zxe={x:Lut,y:Rut,z:Wut,s:Iut,reverseX:Zut,reverseY:Gut,reverseZ:Eut,westDegrees:Xut,southDegrees:Put,eastDegrees:vut,northDegrees:wut,westProjected:Fut,southProjected:Aut,eastProjected:Mut,northProjected:Nut,width:Uut,height:kut},Tut=ft(zxe,{i:Dut,j:But,reverseI:Out,reverseJ:Yut,longitudeDegrees:zut,latitudeDegrees:Hut,longitudeProjected:Jut,latitudeProjected:Qut,format:qut});function wF(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be;let t=We.createIfNeeded(e.url),n=We.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=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new cs({ellipsoid:e.ellipsoid})),this._rectangle=y(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 Ct(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=ft(zxe,r),a=ft(Tut,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=y(e.enablePickFeatures,!0)}Object.defineProperties(wF.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}}});wF.prototype.getTileCredits=function(e,t,n){};wF.prototype.requestImage=function(e,t,n,i){return Rl.loadImage(this,Cut(this,e,t,n,i))};wF.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,d){return u.callback(d)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],d=Vut(s,e,t,n,i,o,u.format);return++r,u.type==="json"?d.fetchJson().then(u.callback).catch(c):u.type==="xml"?d.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?d.fetchText().then(u.callback).catch(c):d.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var WB=!1,ud=new le,IB=!1,FF=new le;function Cut(e,t,n,i,o){WB=!1,IB=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(Kxe);return l(u)&&u.forEach(function(d){let m=d.substring(1,d.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var t7=!1,AL=new B,n7=!1;function Vut(e,t,n,i,o,r,s){WB=!1,IB=!1,t7=!1,n7=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,d={},m=c.match(Kxe);return l(m)&&m.forEach(function(p){let b=p.substring(1,p.length-1);l(u[b])&&(d[b]=u[b](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:d})}function ML(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 Lut(e,t,n,i){return ML(e,"{x}",t)}function Zut(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return ML(e,"{reverseX}",o)}function Rut(e,t,n,i){return ML(e,"{y}",n)}function Gut(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return ML(e,"{reverseY}",o)}function Eut(e,t,n,i){let o=e.maximumLevel,r=l(o)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function Jxe(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}Sm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,d,m,p=[],b=e.childNodes[0].childNodes;for(let P=0;P`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(mu.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}}});mu.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=We.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 Qxe(n);s.channel=t,await tdt(r,s);let a=new mu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};mu.prototype.getTileCredits=function(e,t,n){};mu.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 Rl.loadImage(this,o)};mu.prototype.pickFeatures=function(e,t,n,i,o){};mu._logoUrl=void 0;Object.defineProperties(mu,{logoUrl:{get:function(){return l(mu._logoUrl)||(mu._logoUrl=an("Assets/Images/google_earth_credit.png")),mu._logoUrl},set:function(e){mu._logoUrl=e}}});var AF=mu;var kwi=S(T(),1);var ndt=/\/$/,jxe=new Ct('© Mapbox © OpenStreetMap Improve this map');function NL(e){e=y(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=We.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();ndt.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 Ct(s))):s=jxe,this._resource=i,this._imageryProvider=new qa({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(NL.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}}});NL.prototype.getTileCredits=function(e,t,n){};NL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};NL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};NL._defaultCredit=jxe;var MF=NL;var $wi=S(T(),1);function mT(e){e=y(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=y(e.rectangle,le.MAX_VALUE),n=new _i({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 Ct(i)),this._credit=i;let o=We.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(mT.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 idt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Xo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return o7(e,n,r);throw l(n)&&(n._hasError=!0),new ue(o)}async function o7(e,t,n){try{return await Rl.loadImage(null,e)}catch(i){return idt(e,i,t,n)}}mT.fromUrl=async function(e,t){let n=We.createIfNeeded(e),i=await o7(n);t=y(t,y.EMPTY_OBJECT);let o=new mT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};mT.prototype.getTileCredits=function(e,t,n){};mT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await o7(this._resource,this);return this._image=o,Xo.reportSuccess(this._errorEvent),o}return this._image};mT.prototype.pickFeatures=function(e,t,n,i,o){};var NF=mT;var CFi=S(T(),1);var rFi=S(T(),1);function odt(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=rdt:e==="xml"?n=ldt:(e==="html"||e==="text")&&(n=qxe)),this.callback=n}function rdt(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,bdt=//im,gdt=/([\s\S]*)<\/title>/im;function qxe(e){if(pdt.test(e)||bdt.test(e))return;let t,n=gdt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Of;return i.name=t,i.description=e,i.data=e,[i]}var fT=odt;var mFi=S(T(),1);function UF(e){e=y(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(UF.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)}}});UF.prototype.getFromCache=function(e,t,n,i){let o=$xe(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};UF.prototype.checkApproachingInterval=function(e,t,n,i){let o=$xe(e,t,n),r=this._tilesRequestedForInterval,s=e_e(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!t_e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};UF.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=e_e(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=t_e(this,c,r),a||s.push(c)}}};function $xe(e,t,n){return`${e}-${t}-${n}`}function ydt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function e_e(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=ne.secondsDifference(c.stop,i),++a):(s=ne.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function t_e(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=ydt(s),c=new $o({throttle:!1,throttleByServer:!0,type:fs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var hT=UF;var xdt=[3034,3035,3042,3043,3044],_dt=[4471,4559];function Kf(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new he("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=y(e.getFeatureInfoUrl,e.url);let t=We.createIfNeeded(e.url),n=We.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Kf.DefaultParameters,!0),n.setQueryParameters(Kf.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(n_e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(n_e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new hT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,d){return i_e(i,s,a,c,u,d)},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=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Wi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!_dt.includes(a)||xdt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Wi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new qa({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new _i({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:y(e.getFeatureInfoFormats,Kf.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function i_e(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 Sdt(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(Kf.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}}});Kf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Kf.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=i_e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Kf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Sdt(this,e,t,n,i,o,s)};Kf.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Kf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Kf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new fT("json","application/json")),Object.freeze(new fT("xml","text/xml")),Object.freeze(new fT("text","text/html"))]);function n_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var kF=Kf;var wFi=S(T(),1);var Tdt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function DF(e){e=y(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=We.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 m={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(m),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new cs({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new hT({clock:e.clock,times:e.times,requestImageFunction:function(m,p,b,h,x){return o_e(s,m,p,b,h,x)},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),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let d=e.credit;this._credit=typeof d=="string"?new Ct(d):d,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 o_e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,d=l(r)?r.data:void 0,m,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({request:o}),m.setTemplateValues(p),l(u)&&m.setTemplateValues(u),l(d)&&m.setTemplateValues(d);else{let b={};b.tilematrix=a,b.layer=e._layer,b.style=e._style,b.tilerow=n,b.tilecol=t,b.tilematrixset=e._tileMatrixSetID,b.format=e._format,l(u)&&(b=ft(b,u)),l(d)&&(b=ft(b,d)),p={s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({queryParameters:b,request:o}),m.setTemplateValues(p)}return Rl.loadImage(e,m)}Object.defineProperties(DF.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())}}});DF.prototype.getTileCredits=function(e,t,n){};DF.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=o_e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};DF.prototype.pickFeatures=function(e,t,n,i,o){};var BF=DF;var Cdt={ARCGIS_MAPSERVER:C0.fromUrl,BING:async(e,t)=>vF.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,AF.fromUrl(e,n,t)},MAPBOX:(e,t)=>new MF({url:e,...t}),SINGLE_TILE:NF.fromUrl,TMS:Qy.fromUrl,URL_TEMPLATE:(e,t)=>new qa({url:e,...t}),WMS:(e,t)=>new kF({url:e,...t}),WMTS:(e,t)=>new BF({url:e,...t})};function cp(e){e=y(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(cp.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(){}}});cp.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Eu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=cp._endpointCache[i];l(o)||(o=n.fetchJson(),cp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ue(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Qy.fromUrl(new Eu(r,n));else{let u=Cdt[a];if(!l(u))throw new ue(`Unrecognized Cesium ion imagery type: ${a}`);let d={...r.options},m=d.url;delete d.url,s=await u(m,d)}let c=new cp(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Eu.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};cp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};cp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};cp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};cp._endpointCache={};var V0=cp;var $Fi=S(T(),1),Vdt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},L0=Object.freeze(Vdt);function Ldt(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,L0.AERIAL);return V0.fromAssetId(t)}var Z0=Ldt;var lAi=S(T(),1);function UL(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=li.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}UL.createPlaceholder=function(e){let t=new UL(e,0,0,0);return t.addReference(),t.state=li.PLACEHOLDER,t};UL.prototype.addReference=function(){++this.referenceCount};UL.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),de(this),0):this.referenceCount};UL.prototype.processStateMachine=function(e,t,n){this.state===li.UNLOADED&&!n&&(this.state=li.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===li.RECEIVED&&(this.state=li.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===li.READY&&t&&!this.texture;(this.state===li.TEXTURE_LOADED||i)&&(this.state=li.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var kL=UL;var fAi=S(T(),1);function a7(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}a7.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};a7.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===li.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!==li.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==li.FAILED&&r.state!==li.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===li.FAILED||i.state===li.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var DL=a7;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ti.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ti.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ti.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ti.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ti.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ti.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ti.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ti.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,le.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new DL(kL.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=y(t.colorToAlphaThreshold,Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ti.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}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=pl.NONE;Ti.DEFAULT_MINIFICATION_FILTER=Ft.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=ni.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return Wdt(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ti.fromProviderAsync(Z0({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return de(this)};var a_e=new le,r_e=new le,c7=new le,c_e=new le;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return le.intersection(e.rectangle,t)};Ti.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 Wi&&e.rectangle.north<Wi.MaximumLatitude&&e.rectangle.south>-Wi.MaximumLatitude,s=le.intersection(o.rectangle,this._rectangle,a_e),a=le.intersection(e.rectangle,s,r_e);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,I=e.rectangle;a=r_e,I.south>=E.north?a.north=a.south=E.north:I.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(I.south,E.south),a.north=Math.min(I.north,E.north)),I.west>=E.east?a.west=a.east=E.east:I.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(I.west,E.west),a.east=Math.min(I.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let d=1*t.getLevelMaximumGeometricError(e.level),m=Gdt(this,d,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let E=o.minimumLevel;m<E&&(m=E)}let b=o.tilingScheme,h=b.positionToTileXY(le.northwest(a),m),x=b.positionToTileXY(le.southeast(a),m),_=e.rectangle.width/512,C=e.rectangle.height/512,V=b.tileXYToRectangle(h.x,h.y,m);Math.abs(V.south-e.rectangle.north)<C&&h.y<x.y&&++h.y,Math.abs(V.east-e.rectangle.west)<_&&h.x<x.x&&++h.x;let L=b.tileXYToRectangle(x.x,x.y,m);Math.abs(L.north-e.rectangle.south)<C&&x.y>h.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>h.x&&--x.x;let R=le.clone(e.rectangle,c_e),G=b.tileXYToRectangle(h.x,h.y,m),W=le.intersection(G,s,c7),w;r?(b.rectangleToNativeRectangle(R,R),b.rectangleToNativeRectangle(G,G),b.rectangleToNativeRectangle(W,W),b.rectangleToNativeRectangle(s,s),w=b.tileXYToNativeRectangle.bind(b),_=R.width/512,C=R.height/512):w=b.tileXYToRectangle.bind(b);let P,F=0,M=1,g;!this.isBaseLayer()&&Math.abs(W.west-R.west)>=_&&(F=Math.min(1,(W.west-R.west)/R.width)),!this.isBaseLayer()&&Math.abs(W.north-R.north)>=C&&(M=Math.max(0,(W.north-R.south)/R.height));let Z=M;for(let E=h.x;E<=x.x;E++)if(P=F,G=w(E,h.y,m),W=le.simpleIntersection(G,s,c7),!!l(W)){F=Math.min(1,(W.east-R.west)/R.width),E===x.x&&(this.isBaseLayer()||Math.abs(W.east-R.east)<_)&&(F=1),M=Z;for(let I=h.y;I<=x.y;I++){if(g=M,G=w(E,I,m),W=le.simpleIntersection(G,s,c7),!l(W))continue;M=Math.max(0,(W.south-R.south)/R.height),I===x.y&&(this.isBaseLayer()||Math.abs(W.south-R.south)<C)&&(M=0);let A=new re(P,M,F,g),N=this.getImageryFromCache(E,I,m);i.imagery.splice(n,0,new DL(N,A,r)),++n}}return!0};Ti.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,a_e),i=c.rectangleToNativeRectangle(i,c_e)}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)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=li.RECEIVED,e.request=void 0,Xo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===$n.CANCELLED){e.state=li.UNLOADED,e.request=void 0;return}e.state=li.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Xo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new $o({throttle:!1,throttleByServer:!0,type:fs.IMAGERY});e.request=s,e.state=li.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=li.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new Qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new bt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new bt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?nt.RGBA:nt.RGB,sampler:n})};Ti.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=li.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=li.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Wi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=li.TEXTURE_LOADED};function s_e(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Ft.LINEAR&&i===ni.LINEAR&&!nt.isCompressedFormat(t.pixelFormat)&&X.isPowerOfTwo(t.width)&&X.isPowerOfTwo(t.height)){n=Ft.LINEAR_MIPMAP_LINEAR;let r=Mt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=s_e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(uh.NICEST),t.sampler=u}else{let r=s_e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Gi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new ka({persists:!0,owner:this,preExecute:function(c){Rdt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=li.READY,t.releaseReference()},canceled:function(){t.state=li.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=li.READY};Ti.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};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=l_e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new kL(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=l_e(e.x,e.y,e.level);delete this._imageryCache[t]};function l_e(e,t,n){return JSON.stringify([e,t,n])}var FB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new B,texture:void 0},Zdt=At.supportsTypedArrays()?new Float32Array(2*64):void 0;function Rdt(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 _=new Float32Array(2*64*2),C=0;for(let W=0;W<64;++W){let w=W/63;_[C++]=0,_[C++]=w,_[C++]=1,_[C++]=w}let V={position:0,webMercatorT:1},L=as.getRegularGridIndices(2,64),R=ut.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});o.vertexArray=new Jn({context:t,attributes:[{index:V.position,vertexBuffer:ut.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:ut.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:R});let G=new De({sources:[TF]});o.shaderProgram=qt.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:SF,attributeLocations:V}),o.sampler=new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR,magnificationFilter:ni.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;FB.textureDimensions.x=r,FB.textureDimensions.y=s,FB.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let d=1/(.5*Math.log((1+a)/(1-a))-c),m=new bt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});X.isPowerOfTwo(r)&&X.isPowerOfTwo(s)&&m.generateMipmap(uh.NICEST);let p=i.south,b=i.north,h=Zdt,x=0;for(let _=0;_<64;++_){let C=_/63,V=X.lerp(p,b,C);a=Math.sin(V);let R=(.5*Math.log((1+a)/(1-a))-c)*d;h[x++]=R,h[x++]=R}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=FB,e.vertexArray=o.vertexArray}function Gdt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Gi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,d=Math.log(u)/Math.log(2);return Math.round(d)|0}function Edt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Wdt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Edt(e._errorEvent,i)}}var Ra=Ti;var CMi=S(T(),1);var tMi=S(T(),1),u_e={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>=u_e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},jn=u_e;function OL(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}OL.prototype.update=function(e,t,n){this.changedThisFrame&&(g_e(e,t,this.tile,n),this.changedThisFrame=!1)};OL.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};OL.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):_m._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Idt=new dl;OL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Idt;a.clear();for(let u=0;u<t.length;++u){let d=t[u];l(d.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),d=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);Fs(e,n,c,u,s,_n.EAST,!1,a,i),Fs(e,n,c,d,s,_n.NORTH,!1,a,i),Fs(e,n,c,m,s,_n.WEST,!1,a,i),Fs(e,n,c,p,s,_n.SOUTH,!1,a,i);let b=u.findTileToNorth(r),h=u.findTileToSouth(r),x=m.findTileToNorth(r),_=m.findTileToSouth(r);Fs(e,n,c,b,s,_n.SOUTHEAST,!1,a,i),Fs(e,n,c,x,s,_n.SOUTHWEST,!1,a,i),Fs(e,n,c,h,s,_n.NORTHEAST,!1,a,i),Fs(e,n,c,_,s,_n.NORTHWEST,!1,a,i),c=a.dequeue()}};function Fs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||jn.wasKicked(u._lastSelectionResult)||jn.originalResult(u._lastSelectionResult)===jn.CULLED);){if(s)return;let d=u.parent;if(r>=_n.NORTHWEST&&d!==void 0)switch(r){case _n.NORTHWEST:u=u===d.northwestChild?d:void 0;break;case _n.NORTHEAST:u=u===d.northeastChild?d:void 0;break;case _n.SOUTHWEST:u=u===d.southwestChild?d:void 0;break;case _n.SOUTHEAST:u=u===d.southeastChild?d:void 0;break}else u=d}if(u!==void 0){if(u._lastSelectionResult===jn.RENDERED){if(l(u.data.vertexArray))return;Xdt(e,t,n,u,r,o,a,c);return}if(jn.originalResult(i._lastSelectionResult)!==jn.CULLED)switch(r){case _n.WEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c),Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.EAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c),Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTH:Fs(e,t,n,i.southwestChild,o,r,!0,a,c),Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case _n.NORTH:Fs(e,t,n,i.northeastChild,o,r,!0,a,c),Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHWEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHEAST:Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTHWEST:Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.SOUTHEAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function Xdt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new OL(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Pdt(e,t,n,i,o,a)}function Pdt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(g_e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,d;switch(o){case _n.WEST:u=s.westMeshes,d=s.westTiles;break;case _n.SOUTH:u=s.southMeshes,d=s.southTiles;break;case _n.EAST:u=s.eastMeshes,d=s.eastTiles;break;case _n.NORTH:u=s.northMeshes,d=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||u[0]!==a||u.length!==1,u[0]=a,d[0]=n,u.length=1,d.length=1;return}let m,p,b,h,x=n.rectangle,_,C=i.rectangle;switch(o){case _n.WEST:for(_=(C.north-C.south)*X.EPSILON5,m=0;m<d.length&&(b=d[m],h=b.rectangle,!X.greaterThan(x.north,h.south,_));++m);for(p=m;p<d.length&&(b=d[p],h=b.rectangle,!X.greaterThanOrEquals(x.south,h.north,_));++p);break;case _n.SOUTH:for(_=(C.east-C.west)*X.EPSILON5,m=0;m<d.length&&(b=d[m],h=b.rectangle,!X.lessThan(x.west,h.east,_));++m);for(p=m;p<d.length&&(b=d[p],h=b.rectangle,!X.lessThanOrEquals(x.east,h.west,_));++p);break;case _n.EAST:for(_=(C.north-C.south)*X.EPSILON5,m=0;m<d.length&&(b=d[m],h=b.rectangle,!X.lessThan(x.south,h.north,_));++m);for(p=m;p<d.length&&(b=d[p],h=b.rectangle,!X.lessThanOrEquals(x.north,h.south,_));++p);break;case _n.NORTH:for(_=(C.east-C.west)*X.EPSILON5,m=0;m<d.length&&(b=d[m],h=b.rectangle,!X.greaterThan(x.east,h.west,_));++m);for(p=m;p<d.length&&(b=d[p],h=b.rectangle,!X.greaterThanOrEquals(x.west,h.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||u[m]!==a,u[m]=a,d[m]=n):(s.changedThisFrame=!0,u.splice(m,p-m,a),d.splice(m,p-m,n))}var pT=new fe,vdt=new fe,BL=new f,m7=new f,l7=new B,u7=new B,dd=new B;function BB(){this.height=0,this.encodedNormal=new B}function AB(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,b=0;l(m)&&(p=m.minimumHeight,b=m.maximumHeight),u=(p+b)*.5}return y_e(e,t,n,i,u,c),c}var wdt={minimumHeight:0,maximumHeight:0},Fdt=new f,d_e=new BB,m_e=new BB,f_e=new BB,h_e=new BB,Adt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Mdt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function g_e(e,t,n,i){_m.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,d=n.tilingScheme.ellipsoid,m=NB(r,d,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,f_e),p=NB(r,d,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,d_e),b=NB(r,d,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,m_e),h=NB(r,d,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,h_e);m=AB(r,d,0,1,m,p,h,b,f_e),p=AB(r,d,0,0,p,m,b,h,d_e),b=AB(r,d,1,1,b,p,h,m,m_e),h=AB(r,d,1,1,h,b,m,p,h_e);let x=p.height,_=b.height,C=m.height,V=h.height,L=Math.min(x,_,C,V),R=Math.max(x,_,C,V),G=(L+R)*.5,W,w,P=e.getLevelMaximumGeometricError(n.level),F=d.maximumRadius-P,M=Math.acos(F/d.maximumRadius)*4;if(M*=1.5,s.width>M&&R-L<=P){let E=new Qa({width:9,height:9,buffer:Adt,structure:{heightOffset:R}}),I=Mdt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(I)}else{let E=u,I=le.center(s,vdt);I.height=G;let A=d.cartographicToCartesian(I,Fdt),N=new Mc(A,void 0,void 0,void 0,void 0,!0,!0,E,a,c),D=5,k;for(k=r.westMeshes,W=0,w=k.length;W<w;++W)D+=k[W].eastIndicesNorthToSouth.length;for(k=r.southMeshes,W=0,w=k.length;W<w;++W)D+=k[W].northIndicesWestToEast.length;for(k=r.eastMeshes,W=0,w=k.length;W<w;++W)D+=k[W].westIndicesSouthToNorth.length;for(k=r.northMeshes,W=0,w=k.length;W<w;++W)D+=k[W].southIndicesEastToWest.length;let O=wdt;O.minimumHeight=L,O.maximumHeight=R;let U=N.stride,j=new Float32Array(D*U),K=0,te=K;K=MB(d,s,N,j,K,0,1,m.height,m.encodedNormal,1,O),K=kB(r,d,N,j,K,r.westTiles,r.westMeshes,_n.EAST,O);let z=K;K=MB(d,s,N,j,K,0,0,p.height,p.encodedNormal,0,O),K=kB(r,d,N,j,K,r.southTiles,r.southMeshes,_n.NORTH,O);let q=K;K=MB(d,s,N,j,K,1,0,b.height,b.encodedNormal,0,O),K=kB(r,d,N,j,K,r.eastTiles,r.eastMeshes,_n.WEST,O);let ee=K;K=MB(d,s,N,j,K,1,1,h.height,h.encodedNormal,1,O),K=kB(r,d,N,j,K,r.northTiles,r.northMeshes,_n.SOUTH,O),L=O.minimumHeight,R=O.maximumHeight;let pe=Wn.fromRectangle(s,L,R,n.tilingScheme.ellipsoid),xe=Wi.geodeticLatitudeToMercatorAngle(s.south),ce=1/(Wi.geodeticLatitudeToMercatorAngle(s.north)-xe),ye=(Wi.geodeticLatitudeToMercatorAngle(I.latitude)-xe)*ce,Te=d.geodeticSurfaceNormalCartographic(pT,m7),Le=Fn.octEncode(Te,l7),Xe=K;N.encode(j,K*U,pe.center,B.fromElements(.5,.5,dd),G,Le,ye,Te),++K;let Re=K,Ne=Re<256?1:2,yt=(Re-1)*3,Nt=yt*Ne,pt=(j.length-Re*U)*Float32Array.BYTES_PER_ELEMENT,Be;if(pt>=Nt){let Ve=Re*U*Float32Array.BYTES_PER_ELEMENT;Be=Re<256?new Uint8Array(j.buffer,Ve,yt):new Uint16Array(j.buffer,Ve,yt)}else Be=Re<256?new Uint8Array(yt):new Uint16Array(yt);j=new Float32Array(j.buffer,0,Re*U);let et=0;for(W=0;W<Re-2;++W)Be[et++]=Xe,Be[et++]=W,Be[et++]=W+1;Be[et++]=Xe,Be[et++]=W,Be[et++]=0;let qe=[];for(W=z;W>=te;--W)qe.push(W);let $e=[];for(W=q;W>=z;--W)$e.push(W);let Kt=[];for(W=ee;W>=q;--W)Kt.push(W);let ge=[];for(ge.push(0),W=Xe-1;W>=ee;--W)ge.push(W);r.mesh=new ym(N.center,j,Be,yt,Re,L,R,ae.fromOrientedBoundingBox(pe),Ydt(e,pe.center,s,L,R),N.stride,pe,N,qe,$e,Kt,ge)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=_m._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let Z=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(Z)&&(--Z.referenceCount,Z.referenceCount===0&&Z.destroy())}function MB(e,t,n,i,o,r,s,a,c,u,d){let m=pT;m.longitude=X.lerp(t.west,t.east,r),m.latitude=X.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,BL),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,m7));let h=u7;return h.x=r,h.y=s,n.encode(i,o*n.stride,p,h,a,c,u,b),d.minimumHeight=Math.min(d.minimumHeight,a),d.maximumHeight=Math.max(d.maximumHeight,a),o+1}var DB=new le;function OF(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,DB),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,DB),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,u=o.north-o.south,d=(r.south-o.south)/u,m=(r.north-o.south)/u,p=(n.x-a)/(c-a),b=(n.y-d)/(m-d);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(b)<Math.EPSILON5?b=0:Math.abs(b-1)<Math.EPSILON5&&(b=1),i.x=p,i.y=b,i}var Ndt=new B;function d7(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 Udt=new B,kdt=new f;function Ddt(e,t,n,i,o,r,s,a,c,u){let d=i.encoding,m=i.vertices,p=OF(t,n,d.decodeTextureCoordinates(m,o,dd),dd),b=OF(t,n,d.decodeTextureCoordinates(m,r,u7),u7),h;c?h=(s-p.x)/(b.x-p.x):h=(a-p.y)/(b.y-p.y);let x=d.decodeHeight(m,o),_=d.decodeHeight(m,r),C=n.rectangle;pT.longitude=X.lerp(C.west,C.east,s),pT.latitude=X.lerp(C.south,C.north,a),u.height=pT.height=X.lerp(x,_,h);let V;if(d.hasVertexNormals){let L=d.getOctEncodedNormal(m,o,Ndt),R=d.getOctEncodedNormal(m,r,Udt),G=Fn.octDecode(L.x,L.y,BL),W=Fn.octDecode(R.x,R.y,kdt);V=f.lerp(G,W,h,BL),f.normalize(V,V),Fn.octEncode(V,u.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(pT,BL),Fn.octEncode(V,u.encodedNormal)}function y_e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(pT,BL);Fn.octEncode(s,r.encodedNormal)}function NB(e,t,n,i,o,r,s,a,c,u,d){if(b_e(e,t,a,s,!1,n,i,d)||b_e(e,t,u,c,!0,n,i,d))return d;let p;if(f7(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],d7(r,p,n,i,d),d;let b;if(n===0?i===0?b=UB(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):b=UB(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?b=UB(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):b=UB(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),l(b))return y_e(e,t,n,i,b,d),d}function UB(e,t,n,i,o,r,s,a){let c=p_e(e,t,!1,n,s,a),u=p_e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function kB(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Bdt(e,t,n,i,o,r[u],s[u],a,c);return o}function Bdt(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===_n.EAST&&e.tile.x===0?(u=le.clone(r.rectangle,DB),u.west-=X.TWO_PI,u.east-=X.TWO_PI):a===_n.WEST&&r.x===0&&(u=le.clone(r.rectangle,DB),u.west+=X.TWO_PI,u.east+=X.TWO_PI);let d=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,dd),m=dd.x,p=dd.y);let b,h;switch(a){case _n.WEST:b=s.westIndicesSouthToNorth,h=!1;break;case _n.NORTH:b=s.northIndicesWestToEast,h=!0;break;case _n.EAST:b=s.eastIndicesNorthToSouth,h=!1;break;case _n.SOUTH:b=s.southIndicesEastToWest,h=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,R,G;C.hasWebMercatorT&&(R=Wi.geodeticLatitudeToMercatorAngle(d.south),G=1/(Wi.geodeticLatitudeToMercatorAngle(d.north)-R));for(let W=0;W<b.length;++W){let w=b[W],P=C.decodeTextureCoordinates(V,w,dd);OF(x,_,P,P);let F=P.x,M=P.y,g=h?F:M;if(g<0||g>1||Math.abs(F-m)<X.EPSILON5&&Math.abs(M-p)<X.EPSILON5)continue;let Z=Math.abs(F)<X.EPSILON5||Math.abs(F-1)<X.EPSILON5,E=Math.abs(M)<X.EPSILON5||Math.abs(M-1)<X.EPSILON5;if(Z&&E)continue;let I=C.decodePosition(V,w,BL),A=C.decodeHeight(V,w),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,w,l7):(N=l7,N.x=0,N.y=0);let D=M;if(C.hasWebMercatorT){let O=X.lerp(d.south,d.north,M);D=(Wi.geodeticLatitudeToMercatorAngle(O)-R)*G}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,m7)),n.encode(i,o*L,I,P,A,N,D,k),c.minimumHeight=Math.min(c.minimumHeight,A),c.maximumHeight=Math.max(c.maximumHeight,A),++o}return o}function p_e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let d=e[u],m=t[u];if(!f7(m,d))continue;let p;switch(i){case _n.WEST:p=d.westIndicesSouthToNorth;break;case _n.SOUTH:p=d.southIndicesEastToWest;break;case _n.EAST:p=d.eastIndicesNorthToSouth;break;case _n.NORTH:p=d.northIndicesWestToEast;break}let b=p[n?0:p.length-1];if(l(b))return d.encoding.decodeHeight(d.vertices,b)}}function f7(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function b_e(e,t,n,i,o,r,s,a){let c,u,d,m,p,b=i[o?0:n.length-1],h=n[o?0:n.length-1];if(f7(b,h)&&(r===0?s===0?(c=o?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,u=o,d=o):(c=o?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,u=!o,d=!1):s===0?(c=o?h.westIndicesSouthToNorth:h.northIndicesWestToEast,u=!o,d=!0):(c=o?h.southIndicesEastToWest:h.westIndicesSouthToNorth,u=o,d=!o),c.length>0)){m=o?0:c.length-1,p=c[m],h.encoding.decodeTextureCoordinates(h.vertices,p,dd);let x=OF(b,e.tile,dd,dd);if(x.x===r&&x.y===s)return d7(h,p,r,s,a),!0;if(m=wo(c,u?r:s,function(_,C){h.encoding.decodeTextureCoordinates(h.vertices,_,dd);let V=OF(b,e.tile,dd,dd);return d?u?V.x-r:V.y-s:u?r-V.x:s-V.y}),m<0){if(m=~m,m>0&&m<c.length)return Ddt(t,b,e.tile,h,c[m-1],c[m],r,s,u,a),!0}else return d7(h,c[m],r,s,a),!0}return!1}var Odt=[new f,new f,new f,new f];function Ydt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Odt;return f.fromRadians(n.west,n.south,o,a,c[0]),f.fromRadians(n.east,n.south,o,a,c[1]),f.fromRadians(n.west,n.north,o,a,c[2]),f.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var YL=OL;function cr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!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(cr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(cr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(cr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(cr.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 Y(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}Object.defineProperties(cr.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){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){nf.setOwner(e,this,"_clippingPolygons")}}});function Kdt(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}cr.prototype.update=function(e){this._imageryLayers._update()};function zdt(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)}}cr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Kdt)})),zdt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)_m._freeVertexArray(t[i]);t.length=0};cr.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};cr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS}}),this._blendRenderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},blending:hn.ALPHA_BLEND});let s=Ue(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Oe.fromCache(s),s=Ue(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Oe.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&YL.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 u=0,d=c.length;u<d;++u){let m=c[u],p=m.data.tileBoundingRegion;gmt(this,m,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function C_e(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)}cr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)C_e(t[n],e)};cr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};cr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};cr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===jn.CULLED_BUT_NEEDED,o=n.terrainState),_m.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==yr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,_m.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Hdt=new ae,V_e=new le,Jdt=new le,Qdt=new fe;function YB(e,t){if(t.west<t.east)return t;let n=le.clone(t,Jdt);return le.center(e,Qdt).longitude>0?n.east=X.PI:n.west=-X.PI,n}function L_e(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))}cr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=L_e(this,t);if(t.fog.enabled&&!o&&X.fog(i,t.fog.density)>=1)return yr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return yr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=YB(e.rectangle,this.cartographicLimitRectangle),d=le.simpleIntersection(u,e.rectangle,V_e);if(!l(d))return yr.NONE;if(le.equals(d,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=Hdt,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),f.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return yr.PARTIAL;let m=this._clippingPlanes;if(l(m)&&m.enabled){let _=m.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==Ot.INSIDE,_===Ot.OUTSIDE)return yr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==Ot.OUTSIDE}let b,h=a.computeVisibility(c);if(h===Ot.OUTSIDE?b=yr.NONE:h===Ot.INTERSECTING?b=yr.PARTIAL:h===Ot.INSIDE&&(b=yr.FULL),b===yr.NONE)return b;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof un;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?b:yr.NONE}return b};cr.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 jdt=[],qdt=[];cr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=jdt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===fo.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 m=s[a],p=m.loadingImagery,b=!l(p)||p.state===li.FAILED||p.state===li.INVALID,h=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[h]=b&&i[h]}let u=this.quadtree._lastSelectionFrameNumber,d=qdt;for(d.length=0,d.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);d.length>0;){let m=d.pop(),p=m._lastSelectionResultFrame===u?m._lastSelectionResult:jn.NONE;if(p===jn.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===fo.READY)return!1;let h=m.data.imagery;for(a=0,c=h.length;a<c;++a){let x=h[a],_=x.loadingImagery,C=!l(_)||_.state===li.FAILED||_.state===li.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===jn.REFINED&&d.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var $dt=new f;cr.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=f.subtract(i.center,o,$dt),a=f.magnitude(s);return a<X.EPSILON5?0:(f.divideByScalar(s,a,s),(1-f.dot(s,r))*e._distance)};var x_e=new v,OB=new v,emt=new re,tmt=new re,nmt=new re,imt=new f,__e=new f,omt=new f,rmt=new f;cr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var smt=[new f,new f,new f,new f];function S_e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=smt;return f.fromRadians(n.west,n.south,o,a,c[0]),f.fromRadians(n.east,n.south,o,a,c[1]),f.fromRadians(n.west,n.north,o,a,c[2]),f.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}cr.prototype.computeDistanceToTile=function(e,t){amt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),d=Math.abs(c-s);u>d?(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 amt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new _m);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new $d({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,d=i.mesh,m=i.terrainData;if(d!==void 0&&d.minimumHeight!==void 0&&d.maximumHeight!==void 0)r.minimumHeight=d.minimumHeight,r.maximumHeight=d.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let b=p.data;if(b!==void 0){let h=b.mesh,x=b.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0){r.minimumHeight=h.minimumHeight,r.maximumHeight=h.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,b=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Tr.getHeight(r.minimumHeight,p,b),r.maximumHeight=Tr.getHeight(r.maximumHeight,p,b)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Wn.clone(d.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(d.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=f.clone(d.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=S_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=S_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}cr.prototype.isDestroyed=function(){return!1};cr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),de(this)};function cmt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let d=s+e;if(o=a[d],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,d);for(u=s;u<d;++u)a[u].freeResources();a.splice(s,e)}return!0}}cr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,d=-1,m=0;for(a=0;a<u;++a){let b=c[a];if(y(b.readyImagery,b.loadingImagery).imageryLayer===e)d===-1&&(d=a),++m;else if(d!==-1)break}if(d===-1)return;let p=d+m;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=cmt(m,e,n),s.state=oa.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=oa.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};cr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};cr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};cr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var lmt=new v,umt=new v;function T_e(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=v.multiplyByPoint(i,this.properties.rtc,__e);return v.setTranslation(i,o,x_e),x_e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=v.multiplyByPoint(i,this.properties.rtc,__e);return v.setTranslation(i,r,OB),v.multiply(o,OB,OB),OB},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)?v.multiply(e.context.uniformState.view,i.modelMatrix,lmt):v.IDENTITY;return v.inverseTranspose(o,umt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new re(0,0,.5,1),fillHighlightColor:new Y(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new B(65e5,9e6),nightFadeDistance:new B(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new f(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new f(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new f,center3D:void 0,rtc:new f,modifiedModelView:new v,tileRectangle:new re,verticalExaggerationAndRelativeHeight:new B(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new B,southMercatorYAndOneOverHeight:new B,waterMask:void 0,waterMaskTranslationAndScale:new re,minMaxHeight:new B,scaleAndBias:new v,clippingPlanesEdgeColor:Y.clone(Y.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new re,frontFaceAlphaByDistance:new re,backFaceAlphaByDistance:new re,localizedTranslucencyRectangle:new re,undergroundColor:Y.clone(Y.TRANSPARENT),undergroundColorAlphaByDistance:new re,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?ft(n,t.materialUniformMap):n}function dmt(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=mmt(e,r,o),i.wireframeVertexArray.mesh=o}}function mmt(e,t,n){let o={indices:n.indices,primitiveType:Ae.TRIANGLES};Un.toWireframe(o);let r=o.indices,s=ut.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Jn({context:e,attributes:t._attributes,indexBuffer:s})}var Z_e,R_e,KB;(function(){let e=new Rt({geometry:Mm.fromDimensions({dimensions:new f(2,2,2)})}),t=new Rt({geometry:new Mb({radius:1})}),n=new v,i,o;function r(s){return new In({geometryInstances:s,appearance:new fn({translucent:!1,flat:!0}),asynchronous:!1})}Z_e=function(s,a){return s===i||(KB(),i=s,n=v.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),o=r(e)),o},R_e=function(s,a){return s===i||(KB(),i=s,n=v.fromTranslation(s.center,n),n=v.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),o=r(t)),o},KB=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var fmt=new re(0,0,0,0),hmt={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},pmt=Y.TRANSPARENT,bmt=new Dt;function gmt(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new YL(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let ge=r.credits;for(let Ve=0,Ht=ge.length;Ve<Ht;++Ve)o.addCreditToNextFrame(ge[Ve])}let s=Mt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,d=n.globeTranslucencyState,m=d.translucent,p=d.frontFaceAlphaByDistance,b=d.backFaceAlphaByDistance,h=d.rectangle,x=y(e.undergroundColor,pmt),_=y(e.undergroundColorAlphaByDistance,bmt),C=L_e(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,R=e.hasWaterMask&&l(a),G=e.oceanNormalMap,W=R&&l(G),w=e.terrainProvider,P=l(w)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!u,M=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,g=Cn.castShadows(e.shadows)&&!m,Z=Cn.receiveShadows(e.shadows)&&!m,E=e.hueShift,I=e.saturationShift,A=e.brightnessShift,N=!(X.equalsEpsilon(E,0,X.EPSILON7)&&X.equalsEpsilon(I,0,X.EPSILON7)&&X.equalsEpsilon(A,0,X.EPSILON7)),D=!1;if(M){let ge=f.magnitude(n.camera.positionWC),Ve=e.nightFadeOutDistance;D=ge>Ve}R&&--s,W&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=d.numberOfTextureUniforms;let k=i.renderedMesh,O=k.center,U=k.encoding,j=i.tileBoundingRegion,K=n.verticalExaggeration,te=n.verticalExaggerationRelativeHeight,z=K!==1,q=U.hasGeodeticSurfaceNormals,ee=emt,pe=0,xe=0,ce=0,ye=0,Te=!1;if(n.mode!==oe.SCENE3D){let ge=n.mapProjection,Ve=ge.project(le.southwest(t.rectangle),omt),Ht=ge.project(le.northeast(t.rectangle),rmt);if(ee.x=Ve.x,ee.y=Ve.y,ee.z=Ht.x,ee.w=Ht.y,n.mode!==oe.MORPHING&&(O=imt,O.x=0,O.y=(ee.z+ee.x)*.5,O.z=(ee.w+ee.y)*.5,ee.x-=O.y,ee.y-=O.z,ee.z-=O.y,ee.w-=O.z),n.mode===oe.SCENE2D&&U.quantization===ia.BITS12){let xt=1/(Math.pow(2,12)-1)*.5,fi=(ee.z-ee.x)*xt,vo=(ee.w-ee.y)*xt;ee.x-=fi,ee.y-=vo,ee.z+=fi,ee.w+=vo}ge instanceof Wi&&(pe=t.rectangle.south,xe=t.rectangle.north,ce=Wi.geodeticLatitudeToMercatorAngle(pe),ye=1/(Wi.geodeticLatitudeToMercatorAngle(xe)-ce),Te=!0)}let Le=hmt;Le.frameState=n,Le.surfaceTile=i,Le.showReflectiveOcean=R,Le.showOceanWaves=W,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=M,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=D,Le.hasVertexNormals=P,Le.useWebMercatorProjection=Te,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=q,Le.hasExaggeration=z;let Xe=i.imagery,Re=0,Ne=Xe.length,yt=e.showSkirts&&!u&&!m,Nt=e.backFaceCulling&&!u&&!m,pt=Nt?e._renderState:e._disableCullingRenderState,Be=Nt?e._blendRenderState:e._disableCullingBlendRenderState,et=pt,qe=e._firstPassInitialColor,$e=n.context;if(l(e._debug.boundingSphereTile)||KB(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ge=e._drawCommands.length;for(let Ve=0;Ve<ge;++Ve)e._uniformMaps[Ve]=T_e(n,e)}do{let ge=0,Ve,Ht;if(e._drawCommands.length<=e._usedDrawCommands?(Ve=new He,Ve.owner=t,Ve.cull=!1,Ve.boundingVolume=new ae,Ve.orientedBoundingBox=void 0,Ht=T_e(n,e),e._drawCommands.push(Ve),e._uniformMaps.push(Ht)):(Ve=e._drawCommands[e._usedDrawCommands],Ht=e._uniformMaps[e._usedDrawCommands]),Ve.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let to=j.boundingVolume,cc=j.boundingSphere;l(to)?Z_e(to,Y.RED).update(n):l(cc)&&R_e(cc,Y.RED).update(n)}let xt=Ht.properties;re.clone(qe,xt.initialColor),xt.oceanNormalMap=G,xt.lightingFadeDistance.x=e.lightingFadeOutDistance,xt.lightingFadeDistance.y=e.lightingFadeInDistance,xt.nightFadeDistance.x=e.nightFadeOutDistance,xt.nightFadeDistance.y=e.nightFadeInDistance,xt.atmosphereLightIntensity=e.atmosphereLightIntensity,xt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,xt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,xt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,xt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,xt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,xt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let fi=u?b:p,vo=u?p:b;l(fi)&&(re.fromElements(fi.near,fi.nearValue,fi.far,fi.farValue,xt.frontFaceAlphaByDistance),re.fromElements(vo.near,vo.nearValue,vo.far,vo.farValue,xt.backFaceAlphaByDistance)),re.fromElements(_.near,_.nearValue,_.far,_.farValue,xt.undergroundColorAlphaByDistance),Y.clone(x,xt.undergroundColor),xt.lambertDiffuseMultiplier=V,xt.vertexShadowDarkness=L;let Ms=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ms&&Y.clone(e.fillHighlightColor,xt.fillHighlightColor),xt.verticalExaggerationAndRelativeHeight.x=K,xt.verticalExaggerationAndRelativeHeight.y=te,xt.center3D=k.center,f.clone(O,xt.rtc),re.clone(ee,xt.tileRectangle),xt.southAndNorthLatitude.x=pe,xt.southAndNorthLatitude.y=xe,xt.southMercatorYAndOneOverHeight.x=ce,xt.southMercatorYAndOneOverHeight.y=ye;let sa=tmt,Jr=YB(t.rectangle,e.cartographicLimitRectangle),Qr=nmt,Ye=YB(t.rectangle,h);f.fromElements(E,I,A,xt.hsbShift);let st=t.rectangle,ot=1/st.width,tt=1/st.height;sa.x=(Jr.west-st.west)*ot,sa.y=(Jr.south-st.south)*tt,sa.z=(Jr.east-st.west)*ot,sa.w=(Jr.north-st.south)*tt,re.clone(sa,xt.localizedCartographicLimitRectangle),Qr.x=(Ye.west-st.west)*ot,Qr.y=(Ye.south-st.south)*tt,Qr.z=(Ye.east-st.west)*ot,Qr.w=(Ye.north-st.south)*tt,re.clone(Qr,xt.localizedTranslucencyRectangle);let St=F&&X.fog(t._distance,n.fog.density)>X.EPSILON3;N=N&&(St||M);let Et=!1,Sn=!1,Co=!1,mr=!1,oc=!1,rc=!1,Rr=!1,ui=!1,Cs=!1,Gr=!1;for(;ge<s&&Re<Ne;){let to=Xe[Re],cc=to.readyImagery;if(++Re,!l(cc)||cc.imageryLayer.alpha===0)continue;let ms=to.useWebMercatorT?cc.textureWebMercator:cc.texture,Wr=cc.imageryLayer;l(to.textureTranslationAndScale)||(to.textureTranslationAndScale=Wr._calculateTextureTranslationAndScale(t,to)),xt.dayTextures[ge]=ms,xt.dayTextureTranslationAndScale[ge]=to.textureTranslationAndScale,xt.dayTextureTexCoordsRectangle[ge]=to.textureCoordinateRectangle,xt.dayTextureUseWebMercatorT[ge]=to.useWebMercatorT,xt.dayTextureAlpha[ge]=Wr.alpha,rc=rc||xt.dayTextureAlpha[ge]!==1,xt.dayTextureNightAlpha[ge]=Wr.nightAlpha,Rr=Rr||xt.dayTextureNightAlpha[ge]!==1,xt.dayTextureDayAlpha[ge]=Wr.dayAlpha,Rr=Rr||xt.dayTextureDayAlpha[ge]!==1,xt.dayTextureBrightness[ge]=Wr.brightness,Et=Et||xt.dayTextureBrightness[ge]!==Ra.DEFAULT_BRIGHTNESS,xt.dayTextureContrast[ge]=Wr.contrast,Sn=Sn||xt.dayTextureContrast[ge]!==Ra.DEFAULT_CONTRAST,xt.dayTextureHue[ge]=Wr.hue,Co=Co||xt.dayTextureHue[ge]!==Ra.DEFAULT_HUE,xt.dayTextureSaturation[ge]=Wr.saturation,mr=mr||xt.dayTextureSaturation[ge]!==Ra.DEFAULT_SATURATION,xt.dayTextureOneOverGamma[ge]=1/Wr.gamma,oc=oc||xt.dayTextureOneOverGamma[ge]!==1/Ra.DEFAULT_GAMMA,xt.dayTextureSplit[ge]=Wr.splitDirection,ui=ui||xt.dayTextureSplit[ge]!==0;let ho=xt.dayTextureCutoutRectangles[ge];if(l(ho)||(ho=xt.dayTextureCutoutRectangles[ge]=new re),re.clone(re.ZERO,ho),l(Wr.cutoutRectangle)){let jr=YB(st,Wr.cutoutRectangle),qr=le.simpleIntersection(jr,st,V_e);Cs=l(qr)||Cs,ho.x=(jr.west-st.west)*ot,ho.y=(jr.south-st.south)*tt,ho.z=(jr.east-st.west)*ot,ho.w=(jr.north-st.south)*tt}let Jc=xt.colorsToAlpha[ge];l(Jc)||(Jc=xt.colorsToAlpha[ge]=new re);let z0=l(Wr.colorToAlpha)&&Wr.colorToAlphaThreshold>0;if(Gr=Gr||z0,z0){let jr=Wr.colorToAlpha;Jc.x=jr.red,Jc.y=jr.green,Jc.z=jr.blue,Jc.w=Wr.colorToAlphaThreshold}else Jc.w=-1;if(l(cc.credits)){let jr=cc.credits;for(let qr=0,H0=jr.length;qr<H0;++qr)o.addCreditToNextFrame(jr[qr])}++ge}xt.dayTextures.length=ge,xt.waterMask=a,re.clone(c,xt.waterMaskTranslationAndScale),xt.minMaxHeight.x=U.minimumHeight,xt.minMaxHeight.y=U.maximumHeight,v.clone(U.matrix,xt.scaleAndBias);let sc=e._clippingPlanes,jo=l(sc)&&sc.enabled&&t.isClipped;jo&&(xt.clippingPlanesEdgeColor=Y.clone(sc.edgeColor,xt.clippingPlanesEdgeColor),xt.clippingPlanesEdgeWidth=sc.edgeWidth);let Er=e._clippingPolygons,xx=l(Er)&&Er.enabled&&t.isClipped;Le.numberOfDayTextures=ge,Le.applyBrightness=Et,Le.applyContrast=Sn,Le.applyHue=Co,Le.applySaturation=mr,Le.applyGamma=oc,Le.applyAlpha=rc,Le.applyDayNightAlpha=Rr,Le.applySplit=ui,Le.enableFog=St,Le.enableClippingPlanes=jo,Le.clippingPlanes=sc,Le.enableClippingPolygons=xx,Le.clippingPolygons=Er,Le.hasImageryLayerCutout=Cs,Le.colorCorrect=N,Le.highlightFillTile=Ms,Le.colorToAlpha=Gr,Le.showUndergroundColor=C,Le.translucent=m;let ac=i.renderedMesh.indices.length;yt||(ac=i.renderedMesh.indexCountWithoutSkirts),Ve.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),Ve.castShadows=g,Ve.receiveShadows=Z,Ve.renderState=et,Ve.primitiveType=Ae.TRIANGLES,Ve.vertexArray=i.vertexArray||i.fill.vertexArray,Ve.count=ac,Ve.uniformMap=Ht,Ve.pass=Ze.GLOBE,e._debug.wireframe&&(dmt($e,e,t),l(i.wireframeVertexArray)&&(Ve.vertexArray=i.wireframeVertexArray,Ve.primitiveType=Ae.LINES,Ve.count=ac*2));let Hc=Ve.boundingVolume,K0=Ve.orientedBoundingBox;n.mode!==oe.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,j.minimumHeight,j.maximumHeight,Hc),f.fromElements(Hc.center.z,Hc.center.x,Hc.center.y,Hc.center),n.mode===oe.MORPHING&&(Hc=ae.union(j.boundingSphere,Hc,Hc))):(Ve.boundingVolume=ae.clone(j.boundingSphere,Hc),Ve.orientedBoundingBox=Wn.clone(j.boundingVolume,K0)),Ve.dirty=!0,m&&d.updateDerivedCommands(Ve,n),C_e(Ve,n),et=Be,qe=fmt}while(Re<Ne)}var YF=cr;var E9i=S(T(),1);function G_e(){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(G_e.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=Dt.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=Dt.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 KF=G_e;var M9i=S(T(),1);function As(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(As.prototype,{length:{get:function(){return this._layers.length}}});As.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()})};As.prototype.addImageryProvider=function(e,t){let n=new Ra(e);return this.add(n,t),n};As.prototype.remove=function(e,t){t=y(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};As.prototype.removeAll=function(e){e=y(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=[]};As.prototype.contains=function(e){return this.indexOf(e)!==-1};As.prototype.indexOf=function(e){return this._layers.indexOf(e)};As.prototype.get=function(e){return this._layers[e]};function zB(e,t){return e.indexOf(t)}function E_e(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)}As.prototype.raise=function(e){let t=zB(this._layers,e);E_e(this,t,t+1)};As.prototype.lower=function(e){let t=zB(this._layers,e);E_e(this,t,t-1)};As.prototype.raiseToTop=function(e){let t=zB(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))};As.prototype.lowerToBottom=function(e){let t=zB(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 ymt=new le;function W_e(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],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let d=u.imageryLayer.imageryProvider;if(n&&!l(d.pickFeatures)||!le.contains(u.rectangle,t))continue;let m=ymt,p=1/1024;m.west=X.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=X.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=X.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=X.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),le.contains(m,t)&&i(u)}}As.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(W_e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};As.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(W_e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],d=r[c];if(l(u)&&u.length>0)for(let m=0;m<u.length;++m){let p=u[m];p.imageryLayer=d,l(p.position)||(p.position=i),a.push(p)}}return a})};As.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};As.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};As.prototype.isDestroyed=function(){return!1};As.prototype.destroy=function(){return this.removeAll(!0),de(this)};As.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 zF=As;var yNi=S(T(),1);var D9i=S(T(),1);function I_e(e){this._ellipsoid=new Hb(e.ellipsoid,f.ZERO)}Object.defineProperties(I_e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var HF=I_e;var H9i=S(T(),1);function Gl(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=jn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=oa.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Gl.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 Gl({tilingScheme:e,x:s,y:r,level:0});return i};Gl.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(Gl.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 Gl({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 Gl({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 Gl({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 Gl({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<oa.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Gl.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]};Gl.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};Gl.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};Gl.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};Gl.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};Gl.prototype.freeResources=function(){this.state=oa.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),HB(this._southwestChild),this._southwestChild=void 0,HB(this._southeastChild),this._southeastChild=void 0,HB(this._northwestChild),this._northwestChild=void 0,HB(this._northeastChild),this._northeastChild=void 0};function HB(e){l(e)&&e.freeResources()}var JF=Gl;var j9i=S(T(),1);function JB(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}JB.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};JB.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(),X_e(this,t)),t=i}};function X_e(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}JB.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))&&X_e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var QF=JB;function Tm(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 QF,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=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new HF({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Tm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Tm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function xmt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,v_e(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()}Tm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==oa.START&&e(t),t=t.replacementNext};Tm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Tm.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};Tm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function v_e(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}Tm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(xmt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),v_e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Tm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Cmt(this,e),Pmt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function _mt(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))}Tm.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(Emt(this,e),Xmt(this,e),_mt(this,e))};Tm.prototype.isDestroyed=function(){return!1};Tm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var qF,P_e=new fe;function Smt(e,t){let n=le.center(e.rectangle,P_e),i=n.longitude-qF.longitude,o=n.latitude-qF.latitude;n=le.center(t.rectangle,P_e);let r=n.longitude-qF.longitude,s=n.latitude-qF.latitude;return i*i+o*o-(r*r+s*s)}var Tmt=new f,jF=[];function Cmt(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 x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=JF.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(jF.length<C)for(jF=new Array(C),o=0;o<C;++o)jF[o]===void 0&&(jF[o]=new $F)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;qF=t.camera.positionCartographic,a.sort(Smt);let u=e._addHeightCallbacks,d=e._removeHeightCallbacks,m=t.frameNumber,p;if(u.length>0||d.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(m,u,d);u.length=0,d.length=0}let b=t.camera;e._cameraPositionCartographic=b.positionCartographic;let h=v.getTranslation(b.transform,Tmt);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?$a(e,s,r,t,c,!1,jF[o]):(R0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}function R0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function $F(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function w_e(){this.southwest=new $F,this.southeast=new $F,this.northwest=new $F,this.northeast=new $F}w_e.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 b7=new Array(31);for(let e=0;e<b7.length;++e)b7[e]=new w_e;function Vmt(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=Rmt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,d=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:jn.NONE,b=e.tileProvider;if(s||i){let h=jn.originalResult(p)===jn.RENDERED,x=jn.originalResult(p)===jn.CULLED||p===jn.NONE,_=n.state===oa.DONE,C=h||x||_;if(C||l(b.canRenderWithoutLosingDetail)&&(C=b.canRenderWithoutLosingDetail(n)),C){s&&R0(e,e._tileLoadQueueMedium,n,t),QB(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&R0(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&d.upsampledFromParent){QB(e,n),R0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(d),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Lmt(e,a,c,u,d,t,i,o),x!==e._tilesToRender.length){let R=o.allAreRenderable,G=o.anyWereRenderedLastFrame,W=o.notYetRenderableCount,w=!1;if(!R&&!G){let P=e._tilesToRender;for(let M=x;M<P.length;++M){let g=P[M];for(;g!==void 0&&g._lastSelectionResult!==jn.KICKED&&g!==n;)g._lastSelectionResult=jn.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,QB(e,n),n._lastSelectionResult=jn.RENDERED;let F=p===jn.RENDERED;!F&&W>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,R0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,w=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=F,F||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!w&&R0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=jn.RENDERED,QB(e,n),R0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Lmt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,d=e._occluders,m=b7[t.level],p=m.southwest,b=m.southeast,h=m.northwest,x=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?($a(e,t,u,r,d,s,p),$a(e,n,u,r,d,s,b),$a(e,i,u,r,d,s,h),$a(e,o,u,r,d,s,x)):($a(e,i,u,r,d,s,h),$a(e,t,u,r,d,s,p),$a(e,o,u,r,d,s,x),$a(e,n,u,r,d,s,b)):c.latitude<t.rectangle.north?($a(e,n,u,r,d,s,b),$a(e,t,u,r,d,s,p),$a(e,o,u,r,d,s,x),$a(e,i,u,r,d,s,h)):($a(e,o,u,r,d,s,x),$a(e,i,u,r,d,s,h),$a(e,n,u,r,d,s,b),$a(e,t,u,r,d,s,p)),m.combine(a)}function Zmt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&le.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&le.contains(n,e._cameraReferenceFrameOriginCartographic)}function $a(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==yr.NONE)return Vmt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Zmt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&R0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:jn.NONE;c!==jn.CULLED_BUT_NEEDED&&c!==jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(R0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=jn.CULLED):t._lastSelectionResult=jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Rmt(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof un||t.camera.frustum instanceof Pr)return Gmt(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 Gmt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),d=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=u/d;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(m-=X.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function QB(e,t){e._tilesToRender.push(t)}function Emt(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=Si()+e._loadQueueTimeSlice,s=e._tileProvider,a=h7(e,t,s,r,n,!1);a=h7(e,t,s,r,i,a),h7(e,t,s,r,o,a)}function Wmt(e,t){return e._loadPriority-t._loadPriority}function h7(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Wmt);for(let s=0,a=o.length;s<a&&(Si()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var KL=new yn,p7=new fe,jy=new f,Imt=[];function Xmt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Imt;n.length=0;let i=e._tileToUpdateHeights,o=Si(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,d;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let x=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:jn.NONE;(x===jn.RENDERED||x===jn.CULLED_BUT_NEEDED)&&n.push(m),i.shift(),e._lastTileIndex=0;continue}let p=m.customData,b=p.length,h=!1;for(d=e._lastTileIndex;d<b;++d){let x=p[d],_=m.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(m.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=f.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let L=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,KL.direction),R=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,KL.origin);if(!l(R)){let G=0;l(m.data.tileBoundingRegion)&&(G=m.data.tileBoundingRegion.minimumHeight);let W=Math.min(G,-11500),w=f.multiplyByScalar(L,Math.abs(W)+1,jy);f.subtract(x.positionOnEllipsoidSurface,w,KL.origin)}}else fe.clone(x.positionCartographic,p7),p7.height=-11500,c.project(p7,jy),f.fromElements(jy.z,jy.x,jy.y,jy),f.clone(jy,KL.origin),f.clone(f.UNIT_X,KL.direction);let V=m.data.pick(KL,a,c,!1,jy);l(V)&&(l(x.callback)&&x.callback(V),x.level=m.level)}if(Si()>=s){h=!0;break}}if(h){e._lastTileIndex=d;break}else e._lastTileIndex=0,i.shift()}for(d=0;d<n.length;d++)i.push(n[d])}function Pmt(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 eA=Tm;function zf(e){e=y(e,ie.default);let t=new op({ellipsoid:e}),n=new zF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new IF,this._material=void 0,this._surface=new eA({tileProvider:new YF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=Y.clone(Y.BLACK),this._undergroundColorAlphaByDistance=new Dt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new KF,y7(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new We({url:an("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ie.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new f(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new f(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(zf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=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)&&y7(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,y7(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Y.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Dt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function y7(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[S0,WL];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(xF),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[S0,WL,_F],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function vmt(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var wmt=[],Fmt={start:0,stop:0};zf.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=wmt;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,d;for(d=0;d<c;++d){u=a[d];let p=u.data;if(!l(p))continue;let b=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=b=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,b),f.fromElements(b.center.z,b.center.x,b.center.y,b.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,b);else continue;let h=ei.raySphere(e,b,Fmt);l(h)&&s.push(p)}s.sort(vmt(e.origin));let m;for(c=s.length,d=0;d<c&&(m=s[d].pick(e,t.mode,t.mapProjection,n,i),!l(m));++d);return m};var Amt=new fe;zf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=f.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Amt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Mmt=new f,F_e=new f,Nmt=new fe,Umt=new yn;function g7(e,t){return l(e)&&le.contains(e.rectangle,t)?e:void 0}zf.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!le.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=g7(n._southwestChild,e)||g7(n._southeastChild,e)||g7(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=f.fromRadians(e.longitude,e.latitude,0,a,Mmt),u=Umt,d=a.geodeticSurfaceNormal(c,u.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(m)){let b;l(n.data.tileBoundingRegion)&&(b=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y(b,0),-11500),x=f.multiplyByScalar(d,Math.abs(h)+1,F_e);f.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,F_e);if(l(p))return a.cartesianToCartographic(p,Nmt).height};zf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};zf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=this.showWaterEffect&&l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(d){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new bt({context:e.context,source:d}))})}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.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};zf.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};zf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),de(this)};var tA=zf;var w5i=S(T(),1);var _5i=S(T(),1);var x7={position:0};function jB(e){e=y(e,y.EMPTY_OBJECT),this.center=f.clone(y(e.center,f.ZERO)),this._center=new f,this.radii=f.clone(e.radii),this._radii=new f,this._oneOverEllipsoidRadiiSquared=new f,this._boundingSphere=new ae,this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._modelMatrix=new v,this._computedModelMatrix=new v,this.show=y(e.show,!0),this.material=y(e.material,Yi.fromType(Yi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(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 He({owner:y(e._owner,this)}),this._pickCommand=new He({owner:y(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 kmt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Al.createGeometry(Al.fromDimensions({dimensions:new f(2,2,2),vertexFormat:we.POSITION_ONLY}));return t=Jn.fromGeometry({context:e,geometry:n,attributeLocations:x7,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}jB.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=Oe.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?hn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=kmt(t));let o=!1,r=this.radii;if(!f.equals(this._radii,r)){f.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!v.equals(this.modelMatrix,this._modelMatrix)||!f.equals(this.center,this._center))&&(v.clone(this.modelMatrix,this._modelMatrix),f.clone(this.center,this._center),v.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(f.clone(f.ZERO,this._boundingSphere.center),this._boundingSphere.radius=f.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let d=this._colorCommand,m,p;(s||a||i||u)&&(m=new De({sources:[EL]}),p=new De({sources:[this.material.shaderSource,GL]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:x7}),d.vertexArray=this._va,d.renderState=this._rs,d.shaderProgram=this._sp,d.uniformMap=ft(this._uniforms,this.material._uniforms),d.executeInClosestFrustum=n);let b=e.commandList,h=e.passes;if(h.render&&(d.boundingVolume=this._boundingSphere,d.debugShowBoundingVolume=this.debugShowBoundingVolume,d.modelMatrix=this._computedModelMatrix,d.pass=n?Ze.TRANSLUCENT:Ze.OPAQUE,b.push(d)),h.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(m=new De({sources:[EL]}),p=new De({sources:[this.material.shaderSource,GL],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:x7}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=ft(ft(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ze.TRANSLUCENT:Ze.OPAQUE,b.push(x)}};jB.prototype.isDestroyed=function(){return!1};jB.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var nA=jB;function iA(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=an("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ie.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new nA({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new $w}Object.defineProperties(iA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var qB=new $,Dmt=new $,Bmt=new f,$B=[];iA.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(Vt.computeIcrfToFixedMatrix(n,qB))||Vt.computeTemeToPseudoFixedMatrix(n,qB);let i=this._axes.evaluate(n,Dmt);$.transpose(i,i),$.multiply(qB,i,i);let o=Ay.computeMoonPositionInEarthInertialFrame(n,Bmt);$.multiplyByVector(qB,o,o),v.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=$B,$B.length=0,t.update(e),e.commandList=r,$B.length===1?$B[0]:void 0};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var oA=iA;var Z6i=S(T(),1);var k5i=S(T(),1);var A5i=S(T(),1),rA={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};rA.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?rA.SUNLIGHT:rA.SCENE_LIGHT:rA.NONE};var bT=Object.freeze(rA);function Omt(){this.lightIntensity=10,this.rayleighCoefficient=new f(55e-7,13e-6,284e-7),this.mieCoefficient=new f(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=bT.NONE}var sA=Omt;var $5i=S(T(),1);function aA(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(aA.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Ymt(e,t,n){let i=t.createViewportQuadCommand(lF,{framebuffer:n,renderState:Oe.fromCache({viewport:new Je(0,0,256,256)})});e._drawCommand=i}aA.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new bt({context:t,width:256,height:256,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Qt.NEAREST});this._colorTexture=n;let i=new ba({context:t,colorTextures:[n],destroyAttachments:!1});Ymt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};aA.prototype.isDestroyed=function(){return!1};aA.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var cA=aA;var BUi=S(T(),1);var dUi=S(T(),1);var U_e={};function Kmt(e,t,n){let i,o,r;if(e instanceof Ri){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 Zl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var zmt=new f,A_e=new f;function k_e(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let d=n(u);if(u<=.5){let p=(d-o)/a;return X.lerp(e,-X.PI_OVER_TWO,p)}let m=(d-r)/c;return X.lerp(-X.PI_OVER_TWO,t,1-m)}}return function(o){return X.lerp(e,t,o)}}function S7(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,d=e.right,m=e.frustum,p=f.subtract(a,c,zmt),b=f.magnitude(f.multiplyByScalar(u,f.dot(p,u),A_e)),h=f.magnitude(f.multiplyByScalar(d,f.dot(p,d),A_e));r=Math.min(Kmt(m,b,h)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),d=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(d-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return X.lerp(n,i,a)}}function lA(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 D_e=new f;function Hmt(e,t,n,i,o,r,s,a){let c=e.camera,u=f.clone(c.position,D_e),d=c.pitch,m=lA(c.heading,i),p=lA(c.roll,r),b=S7(c,n,u.z,n.z,s),h=k_e(d,o,b,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:X.lerp(m,i,C),pitch:h(C),roll:X.lerp(p,r,C)}}),B.lerp(u,n,C,c.position),c.position.z=b(C)}return x}function Jmt(e,t){e.longitude<t.longitude?e.longitude+=X.TWO_PI:t.longitude+=X.TWO_PI}function Qmt(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 jmt=new fe,qmt=new fe;function $mt(e,t,n,i,o,r,s,a,c,u){let d=e.camera,p=e.mapProjection.ellipsoid,b=fe.clone(d.positionCartographic,jmt),h=d.pitch,x=lA(d.heading,i),_=lA(d.roll,r),C=p.cartesianToCartographic(n,qmt);b.longitude=X.zeroToTwoPi(b.longitude),C.longitude=X.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let W=X.zeroToTwoPi(a),w=Math.min(b.longitude,C.longitude),P=Math.max(b.longitude,C.longitude),F=W>=w&&W<=P;if(l(c)){let M=Math.abs(b.longitude-C.longitude),g=X.TWO_PI-M;(F?M:g)<(F?g:M)*c&&!F&&(V=!0)}else F||(V=!0)}V?Jmt(b,C):Qmt(b,C);let L=S7(d,n,b.height,C.height,s),R=k_e(h,o,L,u);function G(){let W=b.longitude,w=C.longitude,P=b.latitude,F=C.latitude;return function(g){let Z=g.time/t,E=f.fromRadians(X.lerp(W,w,Z),X.lerp(P,F,Z),L(Z),p);d.setView({destination:E,orientation:{heading:X.lerp(x,i,Z),pitch:R(Z),roll:X.lerp(_,r,Z)}})}}return G()}function eft(e,t,n,i,o,r,s){let a=e.camera,c=f.clone(a.position,D_e),u=lA(a.heading,i),d=a.frustum.right-a.frustum.left,m=S7(a,n,d,n.z,s);function p(b){let h=b.time/t;a.setView({orientation:{heading:X.lerp(u,i,h)}}),B.lerp(c,n,h,a.position);let x=m(h),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var M_e=new fe,tft=new f;function _7(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function N_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}U_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return _7();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,d=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,M_e),n=r.project(M_e,tft));let p=e.camera,b=t.endTransform;l(b)&&p._setTransform(b);let h=t.duration;l(h)||(h=Math.ceil(f.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let x=y(t.heading,0),_=y(t.pitch,-X.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=N_e(V,t.complete),R=N_e(V,t.cancel),G=p.frustum,W=e.mode===oe.SCENE2D;if(W=W&&B.equalsEpsilon(p.position,n,X.EPSILON6),W=W&&X.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,X.EPSILON6),W=W||e.mode!==oe.SCENE2D&&f.equalsEpsilon(n,p.position,X.EPSILON10),W=W&&X.equalsEpsilon(X.negativePiToPi(x),X.negativePiToPi(p.heading),X.EPSILON10)&&X.equalsEpsilon(X.negativePiToPi(_),X.negativePiToPi(p.pitch),X.EPSILON10)&&X.equalsEpsilon(X.negativePiToPi(C),X.negativePiToPi(p.roll),X.EPSILON10),W)return _7(L,R);let w=new Array(4);if(w[oe.SCENE2D]=eft,w[oe.SCENE3D]=$mt,w[oe.COLUMBUS_VIEW]=Hmt,h<=0)return _7(function(){w[i](e,1,n,x,_,C,a,c,u,d)({time:1}),typeof L=="function"&&L()},R);let P=w[i](e,h,n,x,_,C,a,c,u,d);if(!l(m)){let F=p.positionCartographic.height,M=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;F>M&&F>11500?m=Kr.CUBIC_OUT:m=Kr.QUINTIC_IN_OUT}return{duration:h,easingFunction:m,startObject:{time:0},stopObject:{time:h},update:P,complete:L,cancel:R}};var uA=U_e;var fUi=S(T(),1),nft={ROTATE:0,INFINITE_SCROLL:1},fu=Object.freeze(nft);function sn(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new f,this._position=new f,this._positionWC=new f,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new f,this._direction=new f,this._directionWC=new f,this.up=new f,this._up=new f,this._upWC=new f,this.right=new f,this._right=new f,this._rightWC=new f,this.frustum=new Ri,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 v,this._invViewMatrix=new v,Q_e(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,X.PI_OVER_TWO)),this._max2Dfrustum=void 0,cSe(this,sn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=f.magnitude(this.position);n+=n*sn.DEFAULT_VIEW_FACTOR,f.normalize(this.position,this.position),f.multiplyByScalar(this.position,n,this.position)}sn.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);sn.TRANSFORM_2D_INVERSE=v.inverseTransformation(sn.TRANSFORM_2D,new v);sn.DEFAULT_VIEW_RECTANGLE=le.fromDegrees(-95,-20,-70,90);sn.DEFAULT_VIEW_FACTOR=.5;sn.DEFAULT_OFFSET=new mm(0,-X.PI_OVER_FOUR,0);function Q_e(e){v.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),v.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function ift(e){if(!l(e._oldPositionWC))e._oldPositionWC=f.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=f.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=f.magnitude(t),e._oldPositionWC=f.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Si()):e.timeSinceMoved=Math.max(Si()-e._lastMovedTimestamp,0)/1e3}}sn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};sn.prototype._updateCameraChanged=function(){let e=this;if(ift(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=f.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,b=e._changedPosition,h=e.frustum,x=e._changedFrustum,_=p.x+h.left,C=p.x+h.right,V=b.x+x.left,L=b.x+x.right,R=p.y+h.bottom,G=p.y+h.top,W=b.y+x.bottom,w=b.y+x.top,P=Math.max(_,V),F=Math.min(C,L),M=Math.max(R,W),g=Math.min(G,w),Z;if(P>=F||M>=G)Z=1;else{let E=x;_<V&&C>L&&R<W&&G>w&&(E=h),Z=1-(F-P)*(g-M)/((E.right-E.left)*(E.top-E.bottom))}Z>t&&(e._changed.raiseEvent(Z),e._changedPosition=f.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=f.clone(e.positionWC,e._changedPosition),e._changedDirection=f.clone(e.directionWC,e._changedDirection);return}let c=X.acosClamped(f.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let m=f.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||m>t)&&(e._changed.raiseEvent(Math.max(u,m)),e._changedPosition=f.clone(e.positionWC,e._changedPosition),e._changedDirection=f.clone(e.directionWC,e._changedDirection))};function oft(e){Vt.basisTo2D(e._projection,e._transform,e._actualTransform)}var rft=new fe,sft=new f,eO=new f,aft=new re,cft=new re,lft=new re,uft=new re,dft=new re;function mft(e){let t=e._projection,n=t.ellipsoid,i=v.getColumn(e._transform,3,aft),o=n.cartesianToCartographic(i,rft),r=t.project(o,sft),s=cft;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=re.clone(re.UNIT_X,dft),c=re.add(v.getColumn(e._transform,0,eO),i,eO);n.cartesianToCartographic(c,o),t.project(o,r);let u=lft;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,f.subtract(u,s,u),u.x=0;let d=uft;if(f.magnitudeSquared(u)>X.EPSILON10)f.cross(a,u,d);else{let m=re.add(v.getColumn(e._transform,1,eO),i,eO);n.cartesianToCartographic(m,o),t.project(o,r),d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,f.subtract(d,s,d),d.x=0,f.magnitudeSquared(d)<X.EPSILON10&&(re.clone(re.UNIT_Y,u),re.clone(re.UNIT_Z,d))}f.cross(d,a,u),f.normalize(u,u),f.cross(a,u,d),f.normalize(d,d),v.setColumn(e._actualTransform,0,u,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,a,e._actualTransform),v.setColumn(e._actualTransform,3,s,e._actualTransform)}var T7=new f;function Dc(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=!f.equals(o,e.position)||n;r&&(o=f.clone(e.position,e._position));let s=e._direction,a=!f.equals(s,e.direction);a&&(f.normalize(e.direction,e.direction),s=f.clone(e.direction,e._direction));let c=e._up,u=!f.equals(c,e.up);u&&(f.normalize(e.up,e.up),c=f.clone(e.up,e._up));let d=e._right,m=!f.equals(d,e.right);m&&(f.normalize(e.right,e.right),d=f.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(sn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?oft(e):mft(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let b=e._actualTransform;if(r||p)if(e._positionWC=v.multiplyByPoint(b,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=T7;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===oe.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||u||m){let h=f.dot(s,f.cross(c,d,T7));if(Math.abs(1-h)>X.EPSILON2){let x=1/f.magnitudeSquared(c),_=f.dot(c,s)*x,C=f.multiplyByScalar(s,_,T7);c=f.normalize(f.subtract(c,C,e._up),e._up),f.clone(c,e.up),d=f.cross(s,c,e._right),f.clone(d,e.right)}}(a||p)&&(e._directionWC=v.multiplyByPointAsVector(b,s,e._directionWC),f.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=v.multiplyByPointAsVector(b,c,e._upWC),f.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=v.multiplyByPointAsVector(b,d,e._rightWC),f.normalize(e._rightWC,e._rightWC)),(r||a||u||m||p)&&Q_e(e)}function j_e(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 q_e(e){return X.PI_OVER_TWO-X.acosClamped(e.z)}function $_e(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 iO=new v,oO=new v;Object.defineProperties(sn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Dc(this),this._invTransform}},viewMatrix:{get:function(){return Dc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Dc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Dc(this),this._positionCartographic}},positionWC:{get:function(){return Dc(this),this._positionWC}},directionWC:{get:function(){return Dc(this),this._directionWC}},upWC:{get:function(){return Dc(this),this._upWC}},rightWC:{get:function(){return Dc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=v.clone(this._transform,iO),n=Vt.eastNorthUpToFixedFrame(this.positionWC,e,oO);this._setTransform(n);let i=j_e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=v.clone(this._transform,iO),n=Vt.eastNorthUpToFixedFrame(this.positionWC,e,oO);this._setTransform(n);let i=q_e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=v.clone(this._transform,iO),n=Vt.eastNorthUpToFixedFrame(this.positionWC,e,oO);this._setTransform(n);let i=$_e(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}}});sn.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&&iSe(this,this.position)};var fft=new f,hft=new f,pft=new f;sn.prototype._setTransform=function(e){let t=f.clone(this.positionWC,fft),n=f.clone(this.upWC,hft),i=f.clone(this.directionWC,pft);v.clone(e,this._transform),this._transformChanged=!0,Dc(this);let o=this._actualInvTransform;v.multiplyByPoint(o,t,this.position),v.multiplyByPointAsVector(o,i,this.direction),v.multiplyByPointAsVector(o,n,this.up),f.cross(this.direction,this.up,this.right),Dc(this)};var bft=new B,gft=new yn,yft=new f,xft=new f;function eSe(e){if(!v.equals(v.IDENTITY,e.transform))return f.magnitude(e.position);let t=e._scene,n=t.globe,i=bft;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,gft);o=n.pickWorldCoordinates(a,t,!0,yft)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,xft));let s;if(l(o)||l(r)){let a=l(r)?f.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?f.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}sn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof un&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=eSe(this)))};var rO=new f,R7=new v,_ft=new v,G7=new Pe,E7=new $,tSe=new fe;function Sft(e,t,n){let i=v.clone(e.transform,R7),o=Vt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,_ft);e._setTransform(o),f.clone(f.ZERO,e.position),n.heading=n.heading-X.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,G7),s=$.fromQuaternion(r,E7);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),f.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Tft(e,t,n,i){let o=v.clone(e.transform,R7);if(e._setTransform(v.IDENTITY),!f.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,tSe);t=a.project(c,rO)}f.clone(t,e.position)}n.heading=n.heading-X.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,G7),s=$.fromQuaternion(r,E7);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),f.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Cft(e,t,n,i){let o=v.clone(e.transform,R7);if(e._setTransform(v.IDENTITY),!f.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,tSe);t=c.project(u,rO)}B.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===fu.ROTATE){n.heading=n.heading-X.PI_OVER_TWO,n.pitch=-X.PI_OVER_TWO,n.roll=0;let r=Pe.fromHeadingPitchRoll(n,G7),s=$.fromQuaternion(r,E7);$.getColumn(s,2,e.up),f.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Vft=new f,Lft=new f,Zft=new f;function nSe(e,t,n,i){let o=f.clone(n.direction,Vft),r=f.clone(n.up,Lft);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=Vt.eastNorthUpToFixedFrame(t,a,iO),u=v.inverseTransformation(c,oO);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,r,r)}let s=f.cross(o,r,Zft);return i.heading=j_e(o,r),i.pitch=q_e(o),i.roll=$_e(o,r,s),i}var Z7={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},zL=new pc;sn.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,f.clone(this.positionWC,rO));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,rO),i=!1),l(t.direction)&&(t=nSe(this,o,t,Z7.orientation)),zL.heading=y(t.heading,0),zL.pitch=y(t.pitch,-X.PI_OVER_TWO),zL.roll=y(t.roll,0),n===oe.SCENE3D?Sft(this,o,zL):n===oe.SCENE2D?Cft(this,o,zL,i):Tft(this,o,zL,i)};var Rft=new f;sn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:sn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:v.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(sn.DEFAULT_VIEW_RECTANGLE),i=f.magnitude(n);i+=i*sn.DEFAULT_VIEW_FACTOR,f.normalize(n,n),f.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:v.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new f(0,-1,1);i=f.multiplyByScalar(f.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(f.normalize(i,Rft).z),roll:0},endTransform:v.IDENTITY,convert:!1})}};sn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new re),Dc(this),v.multiplyByVector(this._actualInvTransform,e,t)};sn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new f),Dc(this),v.multiplyByPoint(this._actualInvTransform,e,t)};sn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new f),Dc(this),v.multiplyByPointAsVector(this._actualInvTransform,e,t)};sn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new re),Dc(this),v.multiplyByVector(this._actualTransform,e,t)};sn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new f),Dc(this),v.multiplyByPoint(this._actualTransform,e,t)};sn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new f),Dc(this),v.multiplyByPointAsVector(this._actualTransform,e,t)};function iSe(e,t){let n=e._scene.mapMode2D===fu.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 B_e=new f;sn.prototype.move=function(e,t){let n=this.position;f.multiplyByScalar(e,t,B_e),f.add(n,B_e,n),this._mode===oe.SCENE2D&&iSe(this,n),this._adjustOrthographicFrustum(!0)};sn.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?sO(this,e):this.move(this.direction,e)};sn.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?sO(this,-e):this.move(this.direction,-e)};sn.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};sn.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};sn.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};sn.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};sn.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};sn.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};sn.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};sn.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Gft=new Pe,Eft=new $;sn.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Pe.fromAxisAngle(e,-n,Gft),o=$.fromQuaternion(i,Eft),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};sn.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};sn.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Wft=new Pe,Ift=new $;sn.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Pe.fromAxisAngle(e,-n,Wft),o=$.fromQuaternion(i,Ift);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),f.cross(this.direction,this.up,this.right),f.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};sn.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),oSe(this,e)};sn.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),oSe(this,-e)};var Xft=new f,Pft=new f,vft=new f,O_e=new f;function oSe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!f.equalsEpsilon(e.position,f.ZERO,X.EPSILON2)){let i=f.normalize(n,Xft),o=f.equalsEpsilon(i,e.constrainedAxis,X.EPSILON2),r=f.equalsEpsilon(i,f.negate(e.constrainedAxis,O_e),X.EPSILON2);if(!o&&!r){let s=f.normalize(e.constrainedAxis,Pft),a=f.dot(i,s),c=X.acosClamped(a);t>0&&t>c&&(t=c-X.EPSILON4),a=f.dot(i,f.negate(s,O_e)),c=X.acosClamped(a),t<0&&-t>c&&(t=-c+X.EPSILON4);let u=f.cross(s,i,vft);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}sn.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),rSe(this,-e)};sn.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),rSe(this,e)};function rSe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function sO(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===fu.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===fu.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 sSe(e,t){e.move(e.direction,t)}sn.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?sO(this,e):sSe(this,e)};sn.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?sO(this,-e):sSe(this,-e)};sn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return f.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 wft=new v;sn.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ie.default),o=Vt.eastNorthUpToFixedFrame(e,i,wft);this.lookAtTransform(o,t)};var Fft=new f,Aft=new Pe,Mft=new Pe,Nft=new $;function aSe(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=Pe.fromAxisAngle(f.UNIT_Y,-t,Aft),o=Pe.fromAxisAngle(f.UNIT_Z,-e,Mft),r=Pe.multiply(o,i,o),s=$.fromQuaternion(r,Nft),a=f.clone(f.UNIT_X,Fft);return $.multiplyByVector(s,a,a),f.negate(a,a),f.multiplyByScalar(a,n,a),a}sn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=aSe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){B.clone(B.ZERO,this.position),f.negate(n,this.up),this.up.z=0,f.magnitudeSquared(this.up)<X.EPSILON10&&f.clone(f.UNIT_Y,this.up),f.normalize(this.up,this.up),this._setTransform(v.IDENTITY),f.negate(f.UNIT_Z,this.direction),f.cross(this.direction,this.up,this.right),f.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=f.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}f.clone(n,this.position),f.negate(this.position,this.direction),f.normalize(this.direction,this.direction),f.cross(this.direction,f.UNIT_Z,this.right),f.magnitudeSquared(this.right)<X.EPSILON10&&f.clone(f.UNIT_X,this.right),f.normalize(this.right,this.right),f.cross(this.right,this.direction,this.up),f.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var dA=new fe,Uft=new fe,kft=new f,Dft=new f,Bft=new f,Oft=new f,Yft=new f,Kft=new f,zft=new f,C7=new f,Hft={direction:new f,right:new f,up:new f},Y_e;function kc(e,t,n,i){return Math.abs(f.dot(t,n))/i-f.dot(e,n)}function cSe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Hft,s=t.north,a=t.south,c=t.east,u=t.west;u>c&&(c+=X.TWO_PI);let d=(u+c)*.5,m;if(a<-X.PI_OVER_TWO+X.RADIANS_PER_DEGREE&&s>X.PI_OVER_TWO-X.RADIANS_PER_DEGREE)m=0;else{let F=dA;F.longitude=d,F.latitude=s,F.height=0;let M=Uft;M.longitude=d,M.latitude=a,M.height=0;let g=Y_e;(!l(g)||g.ellipsoid!==o)&&(Y_e=g=new Dp(void 0,void 0,o)),g.setEndPoints(F,M),m=g.interpolateUsingFraction(.5,dA).latitude}let p=dA;p.longitude=d,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,zft),h=dA;h.longitude=c,h.latitude=s;let x=o.cartographicToCartesian(h,kft);h.longitude=u;let _=o.cartographicToCartesian(h,Bft);h.longitude=d;let C=o.cartographicToCartesian(h,Yft);h.latitude=a;let V=o.cartographicToCartesian(h,Kft);h.longitude=c;let L=o.cartographicToCartesian(h,Oft);h.longitude=u;let R=o.cartographicToCartesian(h,Dft);f.subtract(_,b,_),f.subtract(L,b,L),f.subtract(x,b,x),f.subtract(R,b,R),f.subtract(C,b,C),f.subtract(V,b,V);let G=o.geodeticSurfaceNormal(b,r.direction);f.negate(G,G);let W=f.cross(G,f.UNIT_Z,r.right);f.normalize(W,W);let w=f.cross(W,G,r.up),P;if(e.frustum instanceof un){let F=Math.max(f.distance(x,_),f.distance(L,R)),M=Math.max(f.distance(x,L),f.distance(_,R)),g,Z,E=e.frustum._offCenterFrustum,I=E.right/E.top,A=M*I;F>A?(g=F,Z=g/I):(Z=M,g=A),P=Math.max(g,Z)}else{let F=Math.tan(e.frustum.fovy*.5),M=e.frustum.aspectRatio*F;if(P=Math.max(kc(G,w,_,F),kc(G,w,L,F),kc(G,w,x,F),kc(G,w,R,F),kc(G,w,C,F),kc(G,w,V,F),kc(G,W,_,M),kc(G,W,L,M),kc(G,W,x,M),kc(G,W,R,M),kc(G,W,C,M),kc(G,W,V,M)),a<0&&s>0){let g=dA;g.longitude=u,g.latitude=0,g.height=0;let Z=o.cartographicToCartesian(g,C7);f.subtract(Z,b,Z),P=Math.max(P,kc(G,w,Z,F),kc(G,W,Z,M)),g.longitude=c,Z=o.cartographicToCartesian(g,C7),f.subtract(Z,b,Z),P=Math.max(P,kc(G,w,Z,F),kc(G,W,Z,M))}}return f.add(b,f.multiplyByScalar(G,-P,C7),n)}var Jft=new fe,Qft=new f,jft=new f;function qft(e,t,n){let i=e._projection;t.west>t.east&&(t=le.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Jft;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Qft);v.multiplyByPoint(o,a,a),v.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,jft);if(v.multiplyByPoint(o,c,c),v.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),d=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/d,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,d=a.y-c.y;n.z=Math.max(u,d)}return n}var $ft=new fe,eht=new f,tht=new f;function nht(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===fu.INFINITE_SCROLL?o+=X.TWO_PI:(t=le.MAX_VALUE,o=t.east));let r=$ft;r.longitude=o,r.latitude=t.north;let s=i.project(r,eht);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,tht),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,d,m,p=e.frustum.right/e.frustum.top,b=u*p;return c>b?(d=c,m=d/p):(m=u,d=b),u=Math.max(2*d,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}sn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new f),n===oe.SCENE3D)return cSe(this,e,t);if(n===oe.COLUMBUS_VIEW)return qft(this,e,t);if(n===oe.SCENE2D)return nht(this,e,t)};var iht=new yn;function oht(e,t,n,i){n=y(n,ie.default);let o=e.getPickRay(t,iht),r=ei.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return yn.getPoint(o,s,i)}var rht=new yn;function sht(e,t,n,i){let r=e.getPickRay(t,rht).origin;r=f.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 aht=new yn;function cht(e,t,n,i){let o=e.getPickRay(t,aht),r=-o.origin.x/o.direction.x;yn.getPoint(o,r,i);let s=n.unproject(new f(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)}sn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new f),t=y(t,ie.default),this._mode===oe.SCENE3D)n=oht(this,e,t,n);else if(this._mode===oe.SCENE2D)n=sht(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=cht(this,e,this._projection,n);else return;return n}};var lht=new f,uht=new f,dht=new f;function mht(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,d=2/r*(r-t.y)-1,m=e.positionWC;f.clone(m,n.origin);let p=f.multiplyByScalar(e.directionWC,c,lht);f.add(m,p,p);let b=f.multiplyByScalar(e.rightWC,u*c*a,uht),h=f.multiplyByScalar(e.upWC,d*c*s,dht),x=f.add(p,b,n.direction);return f.add(x,h,x),f.subtract(x,m,x),f.normalize(x,x),n}var tO=new f;function fht(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let d=n.origin;return f.clone(e.position,d),f.multiplyByScalar(e.right,c,tO),f.add(tO,d,d),f.multiplyByScalar(e.up,u,tO),f.add(tO,d,d),f.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&f.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}sn.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)?mht(this,e,t):fht(this,e,t)};var hht=new f,pht=new f;sn.prototype.distanceToBoundingSphere=function(e){let t=f.subtract(this.positionWC,e.center,hht),n=f.multiplyByScalar(this.directionWC,f.dot(t,this.directionWC),pht);return Math.max(0,f.magnitude(n)-e.radius)};var bht=new B;sn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,bht);return Math.max(o.x,o.y)};function ght(e,t,n,i,o,r){let s=f.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=f.lerp(t,s,c.time,new f);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Kr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var yht=new f,K_e=new f,xht=new f,_ht=new f;function Sht(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(f.UNIT_X,yht),r=-f.dot(o,n)/f.dot(o,i),s=f.add(n,f.multiplyByScalar(i,r,K_e),K_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,xht);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=f.magnitude(f.subtract(n,s,_ht)),d=c*u,m=a*u,p=e._maxCoord.x,b=e._maxCoord.y,h=Math.max(d-p,p),x=Math.max(m-b,b);if(n.z<-h||n.z>h||n.y<-x||n.y>x){let _=s.y<-h||s.y>h,C=s.z<-x||s.z>x;if(_||C)return ght(e,n,s,h,x,t)}}sn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return Sht(this,e)};var Tht=new f,ra={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};sn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};sn.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=ra.destination,e.orientation.heading=ra.heading,e.orientation.pitch=ra.pitch,e.orientation.roll=ra.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};sn.prototype.flyTo=function(e){e=y(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,Tht));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=nSe(this,t,o,Z7.orientation)),l(e.duration)&&e.duration<=0){let d=Z7;d.destination=e.destination,d.orientation.heading=o.heading,d.orientation.pitch=o.pitch,d.orientation.roll=o.roll,d.convert=e.convert,d.endTransform=e.endTransform,this.setView(d),typeof e.complete=="function"&&e.complete();return}let r=this,s;ra.destination=t,ra.heading=o.heading,ra.pitch=o.pitch,ra.roll=o.roll,ra.duration=e.duration,ra.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ra.cancel=e.cancel,ra.endTransform=e.endTransform,ra.convert=i?!1:e.convert,ra.maximumHeight=e.maximumHeight,ra.pitchAdjustHeight=e.pitchAdjustHeight,ra.flyOverLongitude=e.flyOverLongitude,ra.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ra.easingFunction=e.easingFunction;let a=this._scene,c=uA.createTween(a,ra);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(u)||(u=sn.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Cht(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Vht(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 Lht=100;function lSe(e,t,n){n=mm.clone(l(n)?n:sn.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=Lht:e.frustum instanceof un||e._mode===oe.SCENE2D?n.range=Vht(e,s):n.range=Cht(e,s),n.range=X.clamp(n.range,i,o)}return n}sn.prototype.viewBoundingSphere=function(e,t){t=lSe(this,e,t),this.lookAt(e.center,t)};var Zht=new v,Rht=new f,Ght=new f,Eht=new f,Wht=new f,Iht=new re,Xht=new Pe,Pht=new $;sn.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(v.IDENTITY);let i=lSe(this,e,t.offset),o;n?o=f.multiplyByScalar(f.UNIT_Z,i.range,Rht):o=aSe(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ie.default),a=Vt.eastNorthUpToFixedFrame(e.center,s,Zht);v.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=f.subtract(e.center,o,Ght),f.normalize(c,c),u=v.multiplyByPointAsVector(a,f.UNIT_Z,Eht),1-Math.abs(f.dot(c,u))<X.EPSILON6){let m=Pe.fromAxisAngle(c,i.heading,Xht),p=$.fromQuaternion(m,Pht);f.fromCartesian4(v.getColumn(a,1,Iht),u),$.multiplyByVector(p,u,u)}let d=f.cross(c,u,Wht);f.cross(d,c,u),f.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var z_e=new f,H_e=new f,V7=new f,J_e=new f,mA=[new f,new f,new f,new f];function vht(e,t){let n=t.radii,i=e.positionWC,o=f.multiplyComponents(t.oneOverRadii,i,z_e),r=f.magnitude(o),s=f.normalize(o,H_e),a,c;f.equalsEpsilon(s,f.UNIT_Z,X.EPSILON10)?(a=new f(0,1,0),c=new f(0,0,1)):(a=f.normalize(f.cross(f.UNIT_Z,s,V7),V7),c=f.normalize(f.cross(s,a,J_e),J_e));let u=Math.sqrt(f.magnitudeSquared(o)-1),d=f.multiplyByScalar(s,1/r,z_e),m=u/r,p=f.multiplyByScalar(a,m,H_e),b=f.multiplyByScalar(c,m,V7),h=f.add(d,b,mA[0]);f.subtract(h,p,h),f.multiplyComponents(n,h,h);let x=f.subtract(d,b,mA[1]);f.subtract(x,p,x),f.multiplyComponents(n,x,x);let _=f.subtract(d,b,mA[2]);f.add(_,p,_),f.multiplyComponents(n,_,_);let C=f.add(d,b,mA[3]);return f.add(C,p,C),f.multiplyComponents(n,C,C),mA}var L7=new B,wht=new f,qy=[new fe,new fe,new fe,new fe];function nO(e,t,n,i,o,r){L7.x=e,L7.y=t;let s=i.pickEllipsoid(L7,o,wht);return l(s)?(qy[n]=o.cartesianToCartographic(s,qy[n]),1):(qy[n]=o.cartesianToCartographic(r[n],qy[n]),0)}sn.prototype.computeViewRectangle=function(e,t){e=y(e,ie.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(f.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Ot.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=vht(this,e);if(c+=nO(0,0,0,this,e,u),c+=nO(0,a,1,this,e,u),c+=nO(s,a,2,this,e,u),c+=nO(s,0,3,this,e,u),c<2)return le.MAX_VALUE;t=le.fromCartographicArray(qy,t);let d=0,m=qy[3].longitude;for(let p=0;p<4;++p){let b=qy[p].longitude,h=Math.abs(b-m);h>X.PI?d+=X.TWO_PI-h:d+=h,m=b}return X.equalsEpsilon(Math.abs(d),X.TWO_PI,X.EPSILON9)&&(t.west=-X.PI,t.east=X.PI,qy[0].latitude>=0?t.north=X.PI_OVER_TWO:t.south=-X.PI_OVER_TWO),t};sn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Ri)return;let e=this._scene;this.frustum=new Ri,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=X.toRadians(60)};sn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof un)return;let e=eSe(this),t=this._scene;this.frustum=new un,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};sn.clone=function(e,t){return l(t)||(t=new sn(e._scene)),f.clone(e.position,t.position),f.clone(e.direction,t.direction),f.clone(e.up,t.up),f.clone(e.right,t.right),v.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var lo=sn;var YUi=S(T(),1);function Fht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Cm=Fht;var $Ui=S(T(),1);var hSe=S(_u(),1),uSe=576,Aht=100,fA="#ffffff",aO="#48b";function pSe(e,t){this.credit=e,this.count=y(t,1)}function Mht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Ct.equals(o,t))return!0}return!1}function Nht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var bSe="cesium-credit-delimiter";function dSe(e){let t=document.createElement("span");return t.textContent=e,t.className=bSe,t}function mSe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function fSe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(dSe(n));else{let d=o[u];d.className!==bSe&&e.replaceChild(dSe(n),d)}}let c=a.element;if(o.length<=r)e.appendChild(mSe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(mSe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Uht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<uSe?(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>=uSe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function kht(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: ${fA}; - position: relative; - min-height: ${Aht}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: ${fA}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${aO}; -} -.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: ${fA}; -} -.cesium-credit-lightbox-close:hover { - color: ${aO}; -} -.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: ${fA}; -} -.cesium-credit-expand-link:hover { - color: ${aO}; -} - -.cesium-credit-text { - color: ${fA}; -} - -.cesium-credit-delimiter { - padding: 0 5px; -} - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; -} - -.cesium-credit-textContainer a:hover { - color: ${aO} -} - -.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=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function xr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(h){r.contains(h.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let m=document.createElement("div");m.className="cesium-credit-textContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),kht(e);let b=Ct.clone(xr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=m,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=b,this._previousCesiumCredit=void 0,this._currentCesiumCredit=b,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Gt,lightboxCredits:new Gt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function gSe(e,t,n,i){i=y(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 pSe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}xr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Ct.clone(ySe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,gSe(this,t,e)};xr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Mht(t,e)||t.push(e)};xr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};xr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};xr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};xr.prototype.update=function(){this._expanded&&Uht(this)};xr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Ct.equals(xr.cesiumCredit,this._cesiumCredit)||gSe(this,s,r,Number.MAX_VALUE)}Ct.equals(xr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(xr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};xr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;fSe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",fSe(this._creditList,t,void 0,"li"),Nht(this)};xr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),de(this)};xr.prototype.isDestroyed=function(){return!1};xr._cesiumCredit=void 0;xr._cesiumCreditInitialized=!1;var cO;function ySe(){if(!l(cO)){let e=an("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new hSe.default(e).path()),cO=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return xr._cesiumCreditInitialized||(xr._cesiumCredit=cO,xr._cesiumCreditInitialized=!0),cO}Object.defineProperties(xr,{cesiumCredit:{get:function(){return ySe(),xr._cesiumCredit},set:function(e){xr._cesiumCredit=e,xr._cesiumCreditInitialized=!0}}});xr.CreditDisplayElement=pSe;var hA=xr;var yki=S(T(),1);function lO(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,Y.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Dht=new f,Bht=new $,Oht=new Pe,Yht=new Ri,Kht=new Zl,zht=new un,Hht=new Pr,Jht=new Y,Qht=[1,1e5];lO.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 Ri?a=Yht:s instanceof Zl?a=Kht:s instanceof un?a=zht:a=Hht,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Qht,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let d=r.positionWC,m=r.directionWC,p=r.upWC,b=r.rightWC;b=f.negate(b,Dht);let h=Bht;$.setColumn(h,0,b,h),$.setColumn(h,1,p,h),$.setColumn(h,2,m,h);let x=Pe.fromRotationMatrix(h,Oht);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new Rt({geometry:new rT({origin:d,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(Y.fromAlpha(this._color,.1,Jht))},id:this.id,pickPrimitive:this}),appearance:new fn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Rt({geometry:new Hw({origin:d,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new fn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};lO.prototype.isDestroyed=function(){return!1};lO.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return de(this)};var lp=lO;var kki=S(T(),1);function bA(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=y(e,0)}var pA=At.supportsTypedArrays()?new Float32Array(12):[],xSe=new f,_Se=new f,W7=new f,SSe=new f,uO=new f;function jht(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof un)o=f.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=f.multiplyComponents(e.oneOverRadii,m,xSe),b=f.normalize(p,_Se),h=f.normalize(f.cross(f.UNIT_Z,p,W7),W7),x=f.normalize(f.cross(b,h,SSe),SSe),_=f.magnitude(p),C=Math.sqrt(_*_-1);o=f.multiplyByScalar(b,1/_,xSe);let V=C/_;r=f.multiplyByScalar(h,V,_Se),s=f.multiplyByScalar(x,V,W7)}let a=f.add(o,s,uO);f.subtract(a,r,a),f.multiplyComponents(n,a,a),f.pack(a,pA,0);let c=f.subtract(o,s,uO);f.subtract(c,r,c),f.multiplyComponents(n,c,c),f.pack(c,pA,3);let u=f.add(o,s,uO);f.add(u,r,u),f.multiplyComponents(n,u,u),f.pack(u,pA,6);let d=f.subtract(o,s,uO);return f.add(d,r,d),f.multiplyComponents(n,d,d),f.pack(d,pA,9),pA}bA.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 ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new He({renderState:this._rs,boundingVolume:new ae(f.ZERO,i.maximumRadius),pass:Ze.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[gF]}),a=new De({sources:[bF]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=jht(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new mt({attributes:{position:new Ie({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ae.TRIANGLES});this._va=Jn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};bA.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};bA.prototype.isDestroyed=function(){return!1};bA.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var gA=bA;var zki=S(T(),1);function yA(){}var qht=/\bgl_FragDepth\b/,$ht=/\bdiscard\b/;function ept(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource,r,s=!1,a=o.sources,c=a.length;for(r=0;r<c;++r)if(qht.test(a[r])||$ht.test(a[r])){s=!0;break}let u=!1,d=o.defines;for(c=d.length,r=0;r<c;++r)if(d[r]==="LOG_DEPTH"){u=!0;break}let m;!s&&!u?(m=`void main() -{ - out_FragColor = vec4(1.0); -} -`,o=new De({sources:[m]})):!s&&u&&(m=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`,o=new De({defines:["LOG_DEPTH"],sources:[m]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}function tpt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let o=Oe.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Oe.fromCache(o),n[t.id]=i}return i}yA.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.depthOnlyCommand)&&(o=i.depthOnlyCommand.shaderProgram,r=i.depthOnlyCommand.renderState),i.depthOnlyCommand=He.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=ept(n,t.shaderProgram),i.depthOnlyCommand.renderState=tpt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var npt=/\s+czm_writeLogDepth\(/,ipt=/\s+czm_vertexLogDepth\(/;function opt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(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,c,u=!1,d=r.sources,m=d.length;for(a=0;a<m;++a)if(ipt.test(d[a])){u=!0;break}if(!u){for(a=0;a<m;++a)d[a]=De.replaceMain(d[a],"czm_log_depth_main");c=` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`,d.push(c)}for(d=s.sources,m=d.length,u=!1,a=0;a<m;++a)npt.test(d[a])&&(u=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(u=!0);let p="";if(!u){for(a=0;a<m;a++)d[a]=De.replaceMain(d[a],"czm_log_depth_main");p+=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}d.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}return i}yA.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=He.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=opt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function rpt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let o=t._attributeLocations,r=t.fragmentShaderSource,s=r.sources,a=s.length,u=s.some(p=>p.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () -{ - czm_non_pick_main(); - if (${u}.a == 0.0) { - discard; - } - ${u} = ${n}; -} `,m=new Array(a+1);for(let p=0;p<a;++p)m[p]=De.replaceMain(s[p],"czm_non_pick_main");m[a]=d,r=new De({sources:m,defines:r.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:o})}return i}function spt(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let o=Oe.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=Oe.fromCache(o),n[t.id]=i}return i}yA.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.pickCommand)&&(o=i.pickCommand.shaderProgram,r=i.pickCommand.renderState),i.pickCommand=He.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=rpt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=spt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function apt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();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"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}return n}yA.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=He.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=apt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var G0=yA;var eDi=S(T(),1);function dO(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 cpt=new Pe,TSe=new Pe,lpt=new $;function upt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Pe.fromAxisAngle(o,n,TSe),c=Pe.fromAxisAngle(r,i,cpt),u=Pe.multiply(c,a,c),d=Pe.fromAxisAngle(s,t,TSe);Pe.multiply(d,u,u);let m=$.fromQuaternion(u,lpt);$.multiplyByVector(m,r,r),$.multiplyByVector(m,s,s),$.multiplyByVector(m,o,o)}dO.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;upt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};dO.prototype.isDestroyed=function(){return!1};dO.prototype.destroy=function(){return this._removeListener(),de(this)};var xA=dO;var sDi=S(T(),1);function CSe(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var mO=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],up=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<up.length;++e)up[e]*=1e6;var VSe=up[1],I7=up[up.length-1];for(let e=0;e<up.length;++e)up[e]=(up[e]-I7)/(VSe-I7);var Ga=0;function dpt(e){let t=mO,n=t.length;if(e<t[0])return Ga=0,Ga;if(e>t[n-1])return Ga=n-2,Ga;if(e>=t[Ga]){if(Ga+1<n&&e<t[Ga+1])return Ga;if(Ga+2<n&&e<t[Ga+2])return++Ga,Ga}else if(Ga-1>=0&&e>=t[Ga-1])return--Ga,Ga;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return Ga=i,Ga}var mpt=new f;CSe.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>8e5||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=dpt(o),s=X.clamp((o-mO[r])/(mO[r+1]-mO[r]),0,1),a=X.lerp(up[r],up[r+1],s),c=this.density*1e6,u=c/VSe*I7;a=a*(c-u)*1e-6;let d=f.normalize(n.positionWC,mpt),m=Math.abs(f.dot(n.directionWC,d));a*=1-m,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var _A=CSe;var lDi=S(T(),1);function fpt(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,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}var SA=fpt;var CDi=S(T(),1);var Ea={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},gT=Ea.DERIVED_COMMANDS_MAXIMUM_LENGTH,vSe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function yT(){this._frontFaceAlphaByDistance=new Dt(0,1,0,1),this._backFaceAlphaByDistance=new Dt(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(gT),this._derivedBlendCommandTypes=new Array(gT),this._derivedPickCommandTypes=new Array(gT),this._derivedCommandTypesToUpdate=new Array(gT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(yT.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}}});yT.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=LSe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=LSe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=ZSe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=ZSe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=gpt(this,e,t),this._sunVisibleThroughGlobe=hpt(this,e),this._environmentVisible=ppt(this,e),this._useDepthPlane=bpt(this,e),this._numberOfTextureUniforms=ypt(this),this._rectangle=le.clone(t.translucency.rectangle,this._rectangle),xpt(this,e)};function LSe(e,t,n,i){return e?l(n)?(Dt.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 ZSe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function hpt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function ppt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function bpt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function gpt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function ypt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function xpt(e,t){e._derivedCommandsLength=X7(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=X7(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=X7(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<gT;++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=vpt())}function X7(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,d=i?Ea.PICK_FRONT_FACE:u?Ea.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ea.TRANSLUCENT_FRONT_FACE,m=i?Ea.PICK_BACK_FACE:u?Ea.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ea.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Ea.DEPTH_ONLY_FRONT_FACE,o[r++]=d,r):(a?(n||(o[r++]=Ea.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=d,o[r++]=m):(o[r++]=m,o[r++]=d)):c?(n||(o[r++]=Ea.DEPTH_ONLY_BACK_FACE),o[r++]=Ea.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=Ea.DEPTH_ONLY_FRONT_FACE),o[r++]=Ea.OPAQUE_BACK_FACE,o[r++]=d),r)}function Vm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function RSe(e,t){return e.indexOf(t)>-1}function _pt(e,t){Vm(e.defines,"TRANSLUCENT"),Vm(t.defines,"TRANSLUCENT")}function Spt(e,t){Vm(e.defines,"GROUND_ATMOSPHERE"),Vm(t.defines,"GROUND_ATMOSPHERE"),Vm(e.defines,"FOG"),Vm(t.defines,"FOG"),Vm(e.defines,"TRANSLUCENT"),Vm(t.defines,"TRANSLUCENT")}function P7(e,t){if(RSe(t.defines,"TILE_LIMIT_RECTANGLE")||RSe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function v7(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 wSe(e,t){v7(e,t),Vm(e.defines,"GROUND_ATMOSPHERE"),Vm(t.defines,"GROUND_ATMOSPHERE"),Vm(e.defines,"FOG"),Vm(t.defines,"FOG")}function Tpt(e,t){v7(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Cpt(e,t){wSe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function GSe(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 Vpt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Lpt(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Zpt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function Rpt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Gpt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Ept(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ESe(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function WSe(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=hn.ALPHA_BLEND}function Wpt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Ipt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Xpt(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=Oe.getState(e);i(s),r=Oe.fromCache(s),o[e.id]=r}return r}function HL(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Ppt(e,t,n,i,o){return l(o)?!i&&l(n)?n:ft(t,o(e),!1):t}function Hf(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function vpt(){return[new Hf({pass:Ze.GLOBE,pickOnly:!1,getShaderProgramFunction:_pt,getRenderStateFunction:Lpt,getUniformMapFunction:void 0}),new Hf({pass:Ze.GLOBE,pickOnly:!1,getShaderProgramFunction:Spt,getRenderStateFunction:Zpt,getUniformMapFunction:void 0}),new Hf({pass:Ze.GLOBE,pickOnly:!1,getShaderProgramFunction:P7,getRenderStateFunction:Rpt,getUniformMapFunction:void 0}),new Hf({pass:Ze.GLOBE,pickOnly:!1,getShaderProgramFunction:P7,getRenderStateFunction:Gpt,getUniformMapFunction:void 0}),new Hf({pass:Ze.GLOBE,pickOnly:!1,getShaderProgramFunction:P7,getRenderStateFunction:Ept,getUniformMapFunction:void 0}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:v7,getRenderStateFunction:ESe,getUniformMapFunction:HL}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wSe,getRenderStateFunction:WSe,getUniformMapFunction:HL}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Tpt,getRenderStateFunction:ESe,getUniformMapFunction:HL}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Cpt,getRenderStateFunction:WSe,getUniformMapFunction:HL}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:GSe,getRenderStateFunction:Wpt,getUniformMapFunction:HL}),new Hf({pass:Ze.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:GSe,getRenderStateFunction:Ipt,getUniformMapFunction:HL})]}var ISe=new Array(gT),XSe=new Array(gT);yT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)XSe[o]=this._derivedCommandPacks[n[o]],ISe[o]=vSe[n[o]];wpt(this,e,i,n,ISe,XSe,t)}};function wpt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,d=y(a.uniformMapDirtyFrame,0),m=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),b=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;b&&(a.uniformMapDirtyFrame=u),h&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],R=a[L],G,W,w;l(R)?(G=R.uniformMap,W=R.shaderProgram,w=R.renderState):(G=void 0,W=void 0,w=void 0),R=He.shallowClone(t,R),a[L]=R;let P=y(R.derivedCommands.uniformMapDirtyFrame,0),F=y(R.derivedCommands.shaderProgramDirtyFrame,0),M=y(R.derivedCommands.renderStateDirtyFrame,0),g=b||P<d,Z=h||F<m,E=x||M<p;g&&(R.derivedCommands.uniformMapDirtyFrame=u),Z&&(R.derivedCommands.shaderProgramDirtyFrame=u),E&&(R.derivedCommands.renderStateDirtyFrame=u),R.derivedCommands.type=V,R.pass=C.pass,R.pickOnly=C.pickOnly,R.uniformMap=Ppt(e,t.uniformMap,G,g,C.getUniformMapFunction),R.shaderProgram=Vpt(s.context,t.shaderProgram,W,Z,C.getShaderProgramFunction,L),R.renderState=Xpt(t.renderState,w,E,C.getRenderStateFunction,C.renderStateCache)}}}yT.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=vSe[o[a]];n.commandList.push(s[c])}};function FSe(e,t,n,i,o,r,s){for(let a=0;a<t;++a){let c=e[a],u=c.derivedCommands.type;(!l(s)||s.indexOf(u)>-1)&&n(c,i,o,r)}}function PSe(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var Fpt=[Ea.OPAQUE_FRONT_FACE,Ea.OPAQUE_BACK_FACE],Apt=[Ea.DEPTH_ONLY_FRONT_FACE,Ea.DEPTH_ONLY_BACK_FACE,Ea.DEPTH_ONLY_FRONT_AND_BACK_FACE];yT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ze.GLOBE],a=e.indices[Ze.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),FSe(s,a,t,i,r,o,Fpt))};yT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ze.GLOBE],a=e.indices[Ze.GLOBE],c=e.commands[Ze.TERRAIN_CLASSIFICATION],u=e.indices[Ze.TERRAIN_CLASSIFICATION];if(a===0||u===0)return;let d=this._frontFaceTranslucent,m=this._backFaceTranslucent;if((!d||!m)&&PSe(c,u,t,i,r,o),!d&&!m)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,b=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,FSe(s,a,t,i,r,o,Apt),r.depthTexture){let h=n.packDepth(r,o);r.uniformState.globeDepthTexture=h}PSe(c,u,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=b};var TA=yT;var ODi=S(T(),1);var LDi=S(T(),1),hu=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;function dp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ri({color:new Y(0,0,0,0),owner:this}),this._clearCommand=new ri({color:new Y(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(dp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});dp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Mpt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},backFunction:On.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},Npt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},backFunction:On.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:hn.ALPHA_BLEND},Upt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:hn.ALPHA_BLEND},kpt=`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; -} -`,Dpt=`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 -} -`;dp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new bt({context:e,width:s,height:a,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new vu({context:e,width:s,height:a,format:hl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,d;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),d=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,d=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(d)&&this._fbo.setDepthStencilRenderbuffer(d),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Oe.fromCache(Mpt),this._rsClassified=Oe.fromCache(Npt),this._rsDefault=Oe.fromCache(Upt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Dpt:kpt,d=new De({defines:["UNCLASSIFIED"],sources:[u]}),m=new De({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{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(hu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};dp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};dp.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))};dp.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)};dp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),de(this)};var JL=dp;var JDi=S(T(),1);function fO(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(fO.prototype,{total:{get:function(){return this._total}}});function $y(e){let t=new Array(Ba.NUMBER_OF_JOB_TYPES);t[Ba.TEXTURE]=new fO(l(e)?e[Ba.TEXTURE]:10),t[Ba.PROGRAM]=new fO(l(e)?e[Ba.PROGRAM]:10),t[Ba.BUFFER]=new fO(l(e)?e[Ba.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}$y.getTimestamp=Si;Object.defineProperties($y.prototype,{totalBudget:{get:function(){return this._totalBudget}}});$y.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};$y.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};$y.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=$y.getTimestamp();e.execute();let a=$y.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var CA=$y;var tBi=S(T(),1);function hO(e){e=y(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=Si(),this._lastMsSampleTime=Si(),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(hO.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});hO.prototype.update=function(e){let t=Si(),n=y(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}};hO.prototype.destroy=function(){return de(this)};var E0=hO;var OYi=S(T(),1);var cBi=S(T(),1);function xT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(xT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Bpt(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Opt(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:Oe.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}xT.prototype.update=function(e,t){Bpt(this,e,t),Opt(this,e,t)};var Ypt=new re,Kpt=new re(1,1/255,1/65025,1/16581375);xT.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,Ypt);return re.divideByScalar(o,255,o),re.dot(o,Kpt)};xT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};xT.prototype.isDestroyed=function(){return!1};xT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var VA=xT;var yYi=S(T(),1);var mBi=S(T(),1);function zpt(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ze.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 LA=zpt;var WBi=S(T(),1);var hBi=S(T(),1),ex=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function mp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Je,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(mp.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 Hpt(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function ASe(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Je.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Je.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND}),e._rsUpdate=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:gt.KEEP,zFail:gt.KEEP,zPass:gt.KEEP},backFunction:On.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(ex,{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(hu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(ex,{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(hu,{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 ri({color:new Y(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}mp.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.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),ASe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};mp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};mp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};mp.prototype.executeUpdateDepth=function(e,t,n,i){let o=l(i)?i:t.framebuffer.depthStencilTexture;if(n||o!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==o||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,r,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(o),this._updateDepthFramebuffer.update(e,r,s),ASe(this,e,r,s,t)}this._tempCopyDepthTexture=o,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};mp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};mp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(Y.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return Hpt(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),de(this)};var ZA=mp;var kBi=S(T(),1);function _T(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(_T.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 Jpt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Qpt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function jpt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Je.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(ex,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ri({color:new Y(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}_T.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Qpt(this,n,o,r,e),jpt(this,n,o,r,i),this._useHdr=e};_T.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};_T.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};_T.prototype.isDestroyed=function(){return!1};_T.prototype.destroy=function(){return Jpt(this),de(this)};var RA=_T;var sOi=S(T(),1);function W0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ri({color:new Y(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ri({color:new Y(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ri({color:new Y(0,0,0,0),owner:this}),this._alphaClearCommand=new ri({color:new Y(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function MSe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function w7(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function NSe(e){MSe(e),w7(e)}function qpt(e,t,n,i){MSe(e),e._accumulationTexture=new bt({context:t,width:n,height:i,pixelFormat:nt.RGBA,pixelDatatype:ze.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new bt({context:t,pixelFormat:nt.RGBA,pixelDatatype:ze.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function $pt(e,t){w7(e);let n=H.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)&&(w7(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(NSe(e),e._translucentMultipassSupport=!1,i=!1)}return i}W0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,qpt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!$pt(this,e))return;this._useHDR=i;let d=this,m,p;l(this._compositeCommand)||(m=new De({sources:[pF]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return d._opaqueTexture},u_accumulation:function(){return d._accumulationTexture},u_revealage:function(){return d._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new De({defines:["MRT"],sources:[RL]}),p={u_bgColor:function(){return d._translucentMRTClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new De({sources:[RL]}),p={u_bgColor:function(){return d._translucentMultipassClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return d._alphaClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let b=!Je.equals(this._viewport,t.viewport),h=b!==this._useScissorTest;this._useScissorTest=b,Je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Je.clone(t.viewport,this._scissorRectangle),h=!0),(!l(this._rs)||!Je.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Oe.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 ebt={enabled:!0,color:new Y(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Go.ONE,functionDestinationRgb:Go.ONE,functionSourceAlpha:Go.ZERO,functionDestinationAlpha:Go.ONE_MINUS_SOURCE_ALPHA},tbt={enabled:!0,color:new Y(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Go.ONE,functionDestinationRgb:Go.ONE,functionSourceAlpha:Go.ONE,functionDestinationAlpha:Go.ONE},nbt={enabled:!0,color:new Y(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Go.ZERO,functionDestinationRgb:Go.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Go.ZERO,functionDestinationAlpha:Go.ONE_MINUS_SOURCE_ALPHA};function F7(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Oe.getState(i);r.depthMask=!1,r.blending=t,o=Oe.fromCache(r),n[i.id]=o}return o}function ibt(e,t,n){return F7(t,ebt,e._translucentRenderStateCache,n)}function obt(e,t,n){return F7(t,tbt,e._translucentRenderStateCache,n)}function rbt(e,t,n){return F7(t,nbt,e._alphaRenderStateCache,n)}var sbt=` 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); -`,abt=` 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; -`,cbt=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function A7(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(d){return De.replaceMain(d,"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)],u="";for(let d=0;d<c.length;d++){let m=c[d];u=`layout (location = ${m[1]}) out vec4 ${m[0]}; -${u}`}return a.sources.push(u),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; - } -${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function lbt(e,t){return A7(e,t,"translucentMRT",sbt)}function ubt(e,t){return A7(e,t,"translucentMultipass",abt)}function dbt(e,t){return A7(e,t,"alphaMultipass",cbt)}W0.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=He.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=lbt(t,e.shaderProgram),n.translucentCommand.renderState=ibt(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=He.shallowClone(e,n.translucentCommand),n.alphaCommand=He.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=ubt(t,e.shaderProgram),n.translucentCommand.renderState=obt(this,t,e.renderState),n.alphaCommand.shaderProgram=dbt(t,e.shaderProgram),n.alphaCommand.renderState=rbt(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 mbt(e,t,n,i,o,r){let s,a,c,{context:u,frameState:d}=t,{useLogDepth:m,shadowState:p}=d,b=t._hdr,h=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);let _=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=b?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,_);for(l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,u,i,_)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=b?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,_);l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,u,i,_)),i.framebuffer=h}function fbt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,d=t._hdr,m=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let h,x;for(let _=0;_<o.length;++_)h=o[_],h=c?h.derivedCommands.logDepth.command:h,h=d?h.derivedCommands.hdr.command:h,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,b);l(r)&&(h=r.unclassifiedCommand,x=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,n(x,t,s,i,b)),i.framebuffer=m}W0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){fbt(this,e,t,n,i,o);return}mbt(this,e,t,n,i,o)};W0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};W0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,Y.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};W0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return NSe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),de(this)};var GA=W0;var mOi=S(T(),1);function EA(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(EA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function hbt(e){e._framebuffer.destroy()}function pbt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Fc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Je},o.viewport=new Je,e._passState=o}EA.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&pbt(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};EA.prototype.isDestroyed=function(){return!1};EA.prototype.destroy=function(){return hbt(this),de(this)};var WA=EA;var SOi=S(T(),1);function QL(e){let t=new Fc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Je},t.viewport=new Je,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}QL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Je.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var IA=new Y;QL.prototype.end=function(e){let t=y(e.width,1),n=y(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),u=0,d=0,m=0,p=-1;for(let b=0;b<s;++b){if(-a<=u&&u<=a&&-c<=d&&d<=c){let h=4*((c-d)*t+u+a);IA.red=Y.byteToFloat(o[h]),IA.green=Y.byteToFloat(o[h+1]),IA.blue=Y.byteToFloat(o[h+2]),IA.alpha=Y.byteToFloat(o[h+3]);let x=i.getObjectByPickColor(IA);if(l(x))return x}if(u===d||u<0&&-u===d||u>0&&u===1-d){let h=m;m=-p,p=h}u+=m,d+=p}};QL.prototype.readVoxelInfo=function(e){let t=y(e.width,1),n=y(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)};QL.prototype.isDestroyed=function(){return!1};QL.prototype.destroy=function(){return this._fb.destroy(),de(this)};var XA=QL;var GOi=S(T(),1);function I0(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new Y(0,0,0,0),this._clearCommand=new ri({color:new Y(0,0,0,0),depth:1,owner:this})}function bbt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(I0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});I0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};I0.prototype.clear=function(e,t,n){Y.clone(n,this._clearCommand.color),Y.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};I0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};I0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};I0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};I0.prototype.isDestroyed=function(){return!1};I0.prototype.destroy=function(){return bbt(this),de(this)};var ST=I0;var L3i=S(T(),1);var XOi=S(T(),1);function TT(){}TT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};TT.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 u=0;u<a;++u)o[u]=De.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new De({defines:i,sources:o})};TT.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 d=0;d<c;++d)r[d]=De.replaceMain(r[d],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,r.push(u),new De({defines:o,sources:r})};TT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,d=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${d}${t}${n}${i}`};TT.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})};TT.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),u=t._usesDepthTexture,d=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,b=t._numberOfCascades>1,h=t.debugCascadeColors,x=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let W=0;W<L;++W)V[W]=De.replaceMain(V[W],"czm_shadow_receive_main");m?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!m&&C.push("USE_SOFT_SHADOWS"),b&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let R="";m?R+=`uniform samplerCube shadowMap_textureCube; -`:R+=`uniform sampler2D shadowMap_texture; -`;let G;return c?G=` return vec4(${a}, 1.0); -`:G=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,R+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${G}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${_.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,R+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,R+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?R+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:d||(R+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),m?R+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; - float distance = length(directionEC); - directionEC = normalize(directionEC); - float radius = shadowMap_lightPositionEC.w; - // Stop early if the fragment is beyond the point light radius - if (distance > radius) - { - return; - } - vec3 directionWC = czm_inverseViewRotation * directionEC; - shadowParameters.depth = distance / radius; - shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - shadowParameters.texCoords = directionWC; - float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); -`:p?R+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:b?R+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${h?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:R+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,R+=` out_FragColor.rgb *= visibility; -} -`,V.push(R),new De({defines:C,sources:V})};var fp=TT;function hp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(At.isInternetExplorer()||At.isEdge()||(At.isChrome()||At.isFirefox())&&At.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new v,this._shadowMapTexture=void 0,this._lightDirectionEC=new f,this._lightPositionEC=new re,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new pO,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new B,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new re,new re],this._cascadeMatrices=[new v,new v,new v,new v],this._cascadeDistances=new re;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new gbt(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,N7(this),this._clearCommand=new ri({depth:1,color:new Y}),this._clearPassState=new Fc(t),this._size=y(e.size,2048),this.size=this._size}hp.MAXIMUM_DISTANCE=2e4;function gbt(e){this.camera=new pO,this.passState=new Fc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function M7(e,t){return Oe.fromCache({cull:{enabled:!0,face:xi.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 N7(e){let t=!e._usesDepthTexture;e._primitiveRenderState=M7(t,e._primitiveBias),e._terrainRenderState=M7(t,e._terrainBias),e._pointRenderState=M7(t,e._pointBias)}hp.prototype.debugCreateRenderStates=function(){N7(this)};Object.defineProperties(hp.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){Cbt(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 U7(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 ybt(e,t){let n=new vu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:hl.DEPTH_COMPONENT16}),i=new bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=new ba({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 xbt(e,t){let n=new bt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),i=new ba({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 _bt(e,t){let n=new vu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:hl.DEPTH_COMPONENT16}),i=new da({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new ba({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 DSe(e,t){e._isPointLight?_bt(e,t):e._usesDepthTexture?xbt(e,t):ybt(e,t)}function Sbt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==H.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,N7(e),U7(e),DSe(e,t))}function Tbt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(U7(e),DSe(e,t),Sbt(e,t),BSe(e,t))}function BSe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Cbt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Mt.maximumCubeMapSize>=t?t:Mt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Je(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Mt.maximumTextureSize>=t?t:Mt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Je(0,0,t,t)):i===4&&(t=Mt.maximumTextureSize>=t*2?t:Mt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Je(0,0,t,t),n[1].passState.viewport=new Je(t,0,t,t),n[2].passState.viewport=new Je(0,t,t,t),n[3].passState.viewport=new Je(t,t,t,t));e._clearPassState.viewport=new Je(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,d=a.width/o.x,m=a.height/o.y;s.textureOffsets=new v(d,0,0,c,0,m,0,u,0,0,1,0,0,0,0,1)}}var Vbt=new Je;function Lbt(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=Ze.OVERLAY,i}function Zbt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Vbt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Lbt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Je.equals(a.renderState.viewport,s))&&(a.renderState=Oe.fromCache({viewport:Je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var pp=new Array(8);pp[0]=new re(-1,-1,-1,1);pp[1]=new re(1,-1,-1,1);pp[2]=new re(1,1,-1,1);pp[3]=new re(-1,1,-1,1);pp[4]=new re(-1,-1,1,1);pp[5]=new re(1,-1,1,1);pp[6]=new re(1,1,1,1);pp[7]=new re(-1,1,1,1);var tx=new v,k7=new Array(8);for(let e=0;e<8;++e)k7[e]=new re;function Rbt(e,t){let n=new Rt({geometry:new Mm({minimum:new f(-.5,-.5,-.5),maximum:new f(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Rt({geometry:new Mb({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new fn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Gbt=[Y.RED,Y.GREEN,Y.BLUE,Y.MAGENTA],Ebt=new f;function Wbt(e,t){Zbt(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 lp({camera:e._sceneCamera,color:Y.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new lp({camera:e._shadowMapCamera,color:Y.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new lp({camera:e._passes[i].camera,color:Gbt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Pe.IDENTITY,r=e._pointLightRadius*2,s=f.fromElements(r,r,r,Ebt),a=v.fromTranslationQuaternionRotationScale(i,o,s,tx);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Rbt(a,Y.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new lp({camera:e._shadowMapCamera,color:Y.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function pO(){this.viewMatrix=new v,this.inverseViewMatrix=new v,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new f,this.directionWC=f.clone(f.UNIT_Z),this.upWC=f.clone(f.UNIT_Y),this.rightWC=f.clone(f.UNIT_X),this.viewProjectionMatrix=new v}pO.prototype.clone=function(e){v.clone(e.viewMatrix,this.viewMatrix),v.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),f.clone(e.positionWC,this.positionWC),f.clone(e.directionWC,this.directionWC),f.clone(e.upWC,this.upWC),f.clone(e.rightWC,this.rightWC)};var Ibt=new v(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);pO.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return v.multiply(t,e,this.viewProjectionMatrix),v.multiply(Ibt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Xbt=new Array(5),Pbt=new Ri,vbt=new Array(4),OSe=new f,YSe=new f;function wbt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,d=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,d=.9);let p=vbt,b=Xbt;for(b[0]=o,b[s]=r,a=0;a<s;++a){let M=(a+1)/s,g=o*Math.pow(u,M),Z=o+c*M,E=X.lerp(Z,g,d);b[a+1]=E,p[a]=E-b[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let M=b[0];for(a=0;a<s-1;++a)M+=p[a],b[a+1]=M}re.unpack(b,0,e._cascadeSplits[0]),re.unpack(b,1,e._cascadeSplits[1]),re.unpack(p,0,e._cascadeDistances);let h=n.frustum,x=h.left,_=h.right,C=h.bottom,V=h.top,L=h.near,R=h.far,G=n.positionWC,W=n.directionWC,w=n.upWC,P=i.frustum.clone(Pbt),F=n.getViewProjection();for(a=0;a<s;++a){P.near=b[a],P.far=b[a+1];let M=v.multiply(P.projectionMatrix,i.viewMatrix,tx),g=v.inverse(M,tx),Z=v.multiply(F,g,tx),E=f.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,OSe),I=f.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,YSe);for(let O=0;O<8;++O){let U=re.clone(pp[O],k7[O]);v.multiplyByVector(Z,U,U),f.divideByScalar(U,U.w,U),f.minimumByComponent(U,E,E),f.maximumByComponent(U,I,I)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let A=e._passes[a],N=A.camera;N.clone(n);let D=N.frustum;D.left=x+E.x*(_-x),D.right=x+I.x*(_-x),D.bottom=C+E.y*(V-C),D.top=C+I.y*(V-C),D.near=L+E.z*(R-L),D.far=L+I.z*(R-L),A.cullingVolume=N.frustum.computeCullingVolume(G,W,w);let k=e._cascadeMatrices[a];v.multiply(N.getViewProjection(),i.inverseViewMatrix,k),v.multiply(A.textureOffsets,k,k)}}var Fbt=new v,Abt=new f,Mbt=new f,USe=new f;function Nbt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=v.multiply(i.frustum.projectionMatrix,i.viewMatrix,tx),r=v.inverse(o,tx),s=n.directionWC,a=i.directionWC;f.equalsEpsilon(s,a,X.EPSILON10)&&(a=i.upWC);let c=f.cross(s,a,Abt);a=f.cross(c,s,Mbt),f.normalize(a,a),f.normalize(c,c);let u=f.fromElements(0,0,0,USe),d=v.computeView(u,s,a,c,Fbt),m=v.multiply(d,r,tx),p=f.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,OSe),b=f.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,YSe);for(let R=0;R<8;++R){let G=re.clone(pp[R],k7[R]);v.multiplyByVector(m,G,G),f.divideByScalar(G,G.w,G),f.minimumByComponent(G,p,p),f.maximumByComponent(G,b,b)}b.z+=1e3,p.z-=10;let h=USe;h.x=-(.5*(p.x+b.x)),h.y=-(.5*(p.y+b.y)),h.z=-b.z;let x=v.fromTranslation(h,tx);d=v.multiply(x,d,d);let _=.5*(b.x-p.x),C=.5*(b.y-p.y),V=b.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,v.clone(d,n.viewMatrix),v.inverse(d,n.inverseViewMatrix),v.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),f.clone(s,n.directionWC),f.clone(a,n.upWC),f.clone(c,n.rightWC)}var Ubt=[new f(-1,0,0),new f(0,-1,0),new f(0,0,-1),new f(1,0,0),new f(0,1,0),new f(0,0,1)],kbt=[new f(0,-1,0),new f(0,0,-1),new f(0,-1,0),new f(0,-1,0),new f(0,0,1),new f(0,-1,0)],Dbt=[new f(0,0,1),new f(1,0,0),new f(-1,0,0),new f(0,0,-1),new f(1,0,0),new f(1,0,0)];function Bbt(e,t){let n=new Ri;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=Ubt[i],o.upWC=kbt[i],o.rightWC=Dbt[i],v.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),v.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Obt=new f,Ybt=new f,KSe=new ae,kSe=KSe.center;function Kbt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=KSe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Obt),s=f.negate(i.directionWC,Ybt),a=f.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)===Ot.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=f.add(i.positionWC,f.multiplyByScalar(i.directionWC,r,kSe),kSe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Ot.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function zbt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?f.clone(i.directionWC,r.directionWC):e._isPointLight?f.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;v.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),f.normalize(s,s),f.negate(s,s),v.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,Kbt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}hp.prototype.update=function(e){if(zbt(this,e),this._needsUpdate)if(Tbt(this,e.context),this._isPointLight&&Bbt(this,e),this._cascadesEnabled&&(Nbt(this,e),this._numberOfCascades>1&&wbt(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;v.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Wbt(this,e)};hp.prototype.updatePass=function(e,t){BSe(this,e,t)};var Hbt=new B;function zSe(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=Hbt;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 ft(t,o,!1)}function Jbt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=He.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,d=n.pass===Ze.GLOBE,m=n.pass!==Ze.TRANSLUCENT,p=e._isPointLight,b=e._usesDepthTexture,h=fp.getShadowCastShaderKeyword(p,d,b,m);if(s=i.shaderCache.getDerivedShaderProgram(u,h),!l(s)){let _=u.vertexShaderSource,C=u.fragmentShaderSource,V=fp.createShadowCastVertexShader(_,p,d),L=fp.createShadowCastFragmentShader(C,p,b,m);s=i.shaderCache.createDerivedShaderProgram(u,h,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:d&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ue(a,!1),a.cull=Ue(a.cull,!1),a.cull.enabled=!1,a=Oe.fromCache(a)),c=zSe(e,n.uniformMap,d)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}hp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ze.GLOBE,d=!1;if(u&&(d=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=He.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let b=o.receiveShaderCastShadows!==t.castShadows,h=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||h||n||b){let x=fp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,d);if(m=i.shaderCache.getDerivedShaderProgram(s,x),!l(m)){let _=fp.createShadowReceiveVertexShader(a,u,d),C=fp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,d);m=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=zSe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};hp.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]=Jbt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){U7(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return de(this)};var X0=hp;var H3i=S(T(),1);var R3i=S(T(),1),CT=`uniform sampler2D colorTexture; -#ifdef DEBUG_SHOW_DEPTH -uniform sampler2D u_packedTranslucentDepth; -#endif -in vec2 v_textureCoordinates; -void main() -{ -#ifdef DEBUG_SHOW_DEPTH -if (v_textureCoordinates.x < 0.5) -{ -out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); -out_FragColor.a = 1.0; -} -#else -vec4 color = texture(colorTexture, v_textureCoordinates); -#ifdef PICK -if (color == vec4(0.0)) -{ -discard; -} -#else -color.rgb /= color.a; -#endif -out_FragColor = color; -#endif -} -`;var Qbt=!1;function nx(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ri({color:new Y(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ri({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Je,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(nx.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function HSe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function JSe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function jbt(e,t,n,i){HSe(e),e._translucentDepthStencilTexture=new bt({context:t,width:n,height:i,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Qt.NEAREST})}function qbt(e,t,n,i){JSe(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 $bt(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)&&(jbt(e,t,o,r),qbt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[hF]}),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:[CT]}),a={colorTexture:function(){return e._textureToComposite}},Qbt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let d=e._compositeCommand,m=d.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),b=He.shallowClone(d);b.shaderProgram=p,d.derivedCommands.pick=b}l(e._copyCommand)||(s=new De({sources:[CT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[CT]}),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=!Je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:hn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}nx.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=i.length,s,a,c=e.frameState.useLogDepth,u=e.context,d=n.framebuffer;for(a=0;a<r;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for($bt(this,u,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(u,n),a=0;a<r;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let m=s.derivedCommands.depth.depthOnlyCommand;t(m,e,u,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(u,n)),n.framebuffer=d}};nx.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(o,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ze.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ze.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ze.CESIUM_3D_TILE_CLASSIFICATION];for(let d=0;d<u;++d)t(c[d],e,o,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};nx.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),e0t(this,e,t)};function e0t(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}nx.prototype.isSupported=function(){return this._supported};nx.prototype.isDestroyed=function(){return!1};nx.prototype.destroy=function(){return HSe(this),JSe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),de(this)};var PA=nx;function t0t(){this.command=void 0,this.near=void 0,this.far=void 0}function bO(e,t,n){let i=e.context,o;i.depthTexture&&(o=new ZA);let r;e._useOIT&&i.depthTexture&&(r=new GA(i));let s=new Fc(i);s.viewport=Je.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 XA(i),this.pickDepthFramebuffer=new WA,this.sceneFramebuffer=new ST,this.globeDepth=o,this.globeTranslucencyFramebuffer=new RA,this.oit=r,this.translucentTileClassification=new PA(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var QSe=new f,jSe=new f;function n0t(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),o=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),o)}function i0t(e,t,n){let i=1/Math.max(1,n0t(e.position,t.position));return f.multiplyByScalar(e.position,i,QSe),f.multiplyByScalar(t.position,i,jSe),f.equalsEpsilon(QSe,jSe,n)&&f.equalsEpsilon(e.direction,t.direction,n)&&f.equalsEpsilon(e.up,t.up,n)&&f.equalsEpsilon(e.right,t.right,n)&&v.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}bO.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return i0t(t,n,X.EPSILON15)?(this._cameraStartFired&&Si()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Si(),lo.clone(t,n),!0)};function o0t(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===oe.SCENE2D,c=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);let u;a?(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(s));let d=e.frustumCommandsList;d.length=u;for(let m=0;m<u;++m){let p,b;a?(p=Math.min(i-c,n+m*c),b=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,m)*n),b=Math.min(i,s*p));let h=d[m];l(h)?(h.near=p,h.far=b):h=d[m]=new LA(p,b)}}function r0t(e,t,n,i,o){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let r=e.frustumCommandsList,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.near,d=c.far;if(i>d)continue;if(o<u)break;let m=n.pass,p=c.indices[m]++;if(c.commands[m][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var qSe=new bs,s0t=new Fa;bO.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,o=n.positionWC,r=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,u=c.length,d=Ze.NUMBER_OF_PASSES;for(let Z=0;Z<u;++Z)for(let E=0;E<d;++E)c[Z].indices[E]=0;r.length=0,s.length=0;let m=this._commandExtents,p=m.length,b=0,h=+Number.MAX_VALUE,x=-Number.MAX_VALUE,_=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,R=t.mode===oe.SCENE3D?t.occluder:void 0,G=t.cullingVolume,W=qSe.planes;for(let Z=0;Z<5;++Z)W[Z]=G.planes[Z];G=qSe;let w=a.length;for(let Z=0;Z<w;++Z){let E=a[Z],I=E.pass;if(I===Ze.COMPUTE)r.push(E);else if(I===Ze.OVERLAY)s.push(E);else{let A,N,D=E.boundingVolume;if(l(D)){if(!e.isVisible(E,G,R))continue;let O=D.computePlaneDistances(o,i,s0t);if(A=O.start,N=O.stop,h=Math.min(h,A),x=Math.max(x,N),_&&E.receiveShadows&&A<X0.MAXIMUM_DISTANCE&&!(I===Ze.GLOBE&&A<-100&&N>100)){let U=N-A;I!==Ze.GLOBE&&A<100&&(L=Math.min(L,U)),C=Math.min(C,A),V=Math.max(V,N)}}else E instanceof ri?(A=n.frustum.near,N=n.frustum.far):(A=n.frustum.near,N=n.frustum.far,h=Math.min(h,A),x=Math.max(x,N));let k=m[b];l(k)||(k=m[b]=new t0t),k.command=E,k.near=A,k.far=N,b++}}_&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),V=Math.max(Math.min(V,n.frustum.far),C)),_&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=V,t.shadowState.closestObjectSize=L),o0t(this,e,h,x);let P,F;for(P=0;P<b;P++)F=m[P],r0t(this,e,F.command,F.near,F.far);if(b<p)for(P=b;P<p&&(F=m[P],!!l(F.command));P++)F.command=void 0;let M=c.length,g=t.frustumSplits;g.length=M+1;for(let Z=0;Z<M;++Z)g[Z]=c[Z].near,Z===M-1&&(g[Z+1]=c[Z].far)};bO.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,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var VT=bO;var eTe=.1,a0t=new Cm({pass:No.MOST_DETAILED_PRELOAD}),c0t=new Cm({pass:No.MOST_DETAILED_PICK}),yO=new Cm({pass:No.PICK});function Wa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Je(0,0,1,1),n=new lo(e);n.frustum=new un({width:eTe,aspectRatio:1,near:.1}),this._pickOffscreenView=new VT(e,n,t)}Wa.prototype.update=function(){this._pickPositionCacheDirty=!0};Wa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new VA,n[t]=i),i};var l0t=new Pr,u0t=new f,gO=new f,d0t=new B,m0t=new v;function f0t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let d=v.clone(r.transform,m0t);r._setTransform(v.IDENTITY);let m=f.clone(r.position,u0t);f.multiplyByScalar(r.right,c,gO),f.add(gO,m,m),f.multiplyByScalar(r.up,u,gO),f.add(gO,m,m),r._setTransform(d),e.mode===oe.SCENE2D&&f.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,d0t),b=l0t;return b.right=p.x*.5,b.left=-b.right,b.top=p.y*.5,b.bottom=-b.top,b.near=s.near,b.far=s.far,b.computeCullingVolume(m,r.directionWC,r.upWC)}var h0t=new Zl,p0t=new B;function b0t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,d=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=d*a*u,b=m*a*c,h=s.getPixelDimensions(o.width,o.height,1,1,p0t),x=h.x*n*.5,_=h.y*i*.5,C=h0t;return C.top=b+_,C.bottom=b-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function D7(e,t,n,i,o){let r=e.camera.frustum;return r instanceof un||r instanceof Pr?f0t(e,t,n,i,o):b0t(e,t,n,i,o)}var Jf=3,P0=3,Bc=new Je(0,0,Jf,P0),B7=new B,xO=new Y(0,0,0,0);Wa.prototype.pick=function(e,t,n,i){Jf=y(n,3),P0=y(i,Jf);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Je.clone(a,u.viewport);let d=zi.transformWindowToDrawingBuffer(e,t,B7);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=D7(e,d,Jf,P0,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=yO,o.uniformState.update(r),e.updateEnvironment(),Bc.x=d.x-(Jf-1)*.5,Bc.y=e.drawingBufferHeight-d.y-(P0-1)*.5,Bc.width=Jf,Bc.height=P0,u=c.begin(Bc,a),e.updateAndExecuteCommands(u,xO),e.resolveFramebuffers(u);let m=c.end(Bc);return o.endFrame(),m};Wa.prototype.pickVoxelCoordinate=function(e,t,n,i){Jf=y(n,3),P0=y(i,Jf);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Je.clone(a,u.viewport);let d=zi.transformWindowToDrawingBuffer(e,t,B7);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=D7(e,d,Jf,P0,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=yO,o.uniformState.update(r),e.updateEnvironment(),Bc.x=d.x-(Jf-1)*.5,Bc.y=e.drawingBufferHeight-d.y-(P0-1)*.5,Bc.width=Jf,Bc.height=P0,u=c.begin(Bc,a),e.updateAndExecuteCommands(u,xO),e.resolveFramebuffers(u);let m=c.readVoxelInfo(Bc);return o.endFrame(),m};function g0t(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=Je.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=D7(e,t,1,1,s),o.tilesetPassState=yO,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,xO),e.resolveFramebuffers(c),i.endFrame()}var y0t=new Ri,x0t=new Zl,_0t=new un,S0t=new Pr;Wa.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 f.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=zi.transformWindowToDrawingBuffer(e,t,B7);e.pickTranslucentDepth?g0t(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let d;l(s.frustum.fov)?d=s.frustum.clone(y0t):l(s.frustum.infiniteProjectionMatrix)?d=s.frustum.clone(x0t):l(s.frustum.width)?d=s.frustum.clone(_0t):d=s.frustum.clone(S0t);let m=a.frustumCommandsList,p=m.length;for(let b=0;b<p;++b){let x=this.getPickDepth(e,b).getDepth(o,u.x,u.y);if(l(x)&&x>0&&x<1){let _=m[b],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,d.far=Math.max(1,_.far-_.near),d.near=1,c.update(r),c.updateFrustum(d)):(d.near=_.near*(b!==0?e.opaqueFrustumNearOffset:1),d.far=_.far,c.updateFrustum(d)),n=zi.drawingBufferToWorldCoordinates(e,u,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=f.clone(n),n}}this._pickPositionCache[i]=void 0};var T0t=new fe;Wa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){f.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,T0t);o.cartographicToCartesian(r,n)}return n};function tTe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,d=c.position,m=c.exclude;if(l(d)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!m&&(o.push(c),0>=--e))break;let p=u.primitive,b=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(b=!0,i.show=Tn.toValue(!1,i.show),s.push(i))),u instanceof Ys&&(b=!0,u.show=!1,a.push(u)),b||(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=Tn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Wa.prototype.drillPick=function(e,t,n,i,o){let r=this;return tTe(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 $Se=new f,C0t=new f;function V0t(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 nTe(e,t,n,i){let o=t.direction,r=f.mostOrthogonalAxis(o,$Se),s=f.cross(o,r,$Se),a=f.cross(o,s,C0t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,eTe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function L0t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=nTe(e,o,r,a),u=a0t;u.camera=a,u.cullingVolume=c;let d=!0,m=s.length;for(let p=0;p<m;++p){let b=s[p];b.show&&t.primitives.contains(b)&&(b.updateForPass(i,u),d=d&&u.ready)}return d&&n._completePick(),d}Wa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)L0t(this,e,t[n])&&t.splice(n--,1)};function iTe(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 nu&&iTe(o,t,n))}}function _O(e,t,n,i,o,r){let s=[];if(iTe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new V0t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Z0t(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 R0t(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,d=e._pickOffscreenView;t.view=d,nTe(e,n,o,d.camera),Bc=Je.clone(d.viewport,Bc);let m=d.pickFramebuffer.begin(Bc,d.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=c0t:c.tilesetPassState=yO,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(m,xO),t.resolveFramebuffers(m);let p,b=d.pickFramebuffer.end(Bc);if(t.context.depthTexture){let h=d.frustumCommandsList.length;for(let x=0;x<h;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let V=d.frustumCommandsList[x],L=V.near*(x!==0?t.opaqueFrustumNearOffset:1),R=V.far,G=L+C*(R-L);p=yn.getPoint(n,G);break}}}if(t.view=t.defaultView,a.endFrame(),l(b)||l(p))return{object:b,position:p,exclude:!l(p)&&r||Z0t(b,i)}}function oTe(e,t,n,i,o,r,s,a){return tTe(i,function(){return R0t(e,t,n,o,r,s,a)})}function jL(e,t,n,i,o,r,s){let a=oTe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function rTe(e,t,n,i,o,r,s,a){return oTe(e,t,n,i,o,r,s,a)}function SO(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)})})}Wa.prototype.pickFromRay=function(e,t,n,i){return jL(this,e,t,n,i,!1,!1)};Wa.prototype.drillPickFromRay=function(e,t,n,i,o){return rTe(this,e,t,n,i,o,!1,!1)};Wa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=yn.clone(t),n=l(n)?n.slice():n,SO(e,_O(o,e,t,n,i,function(){return jL(o,e,t,n,i,!1,!0)}))};Wa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=yn.clone(t),i=l(i)?i.slice():i,SO(e,_O(r,e,t,i,o,function(){return rTe(r,e,t,n,i,o,!1,!0)}))};var G0t=new f,E0t=new f,W0t=new yn,sTe=new fe;function O7(e,t){let n=e.ellipsoid,i=mi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,E0t),r=fe.toCartesian(t,n,G0t),s=W0t;s.origin=r,s.direction=o;let a=new yn;return yn.getPoint(s,i,a.origin),f.negate(o,a.direction),a}function aTe(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,sTe);return O7(e,i)}function cTe(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,sTe).height}function I0t(e,t,n,i,o){let r=O7(t,n);return _O(e,t,r,i,o,function(){let s=jL(e,t,r,i,o,!0,!0);if(l(s))return cTe(t,s.position)})}function X0t(e,t,n,i,o,r){let s=aTe(t,n);return _O(e,t,s,i,o,function(){let a=jL(e,t,s,i,o,!0,!0);if(l(a))return f.clone(a.position,r)})}Wa.prototype.sampleHeight=function(e,t,n,i){let o=O7(e,t),r=jL(this,e,o,n,i,!0,!1);if(l(r))return cTe(e,r.position)};Wa.prototype.clampToHeight=function(e,t,n,i,o){let r=aTe(e,t),s=jL(this,e,r,n,i,!0,!1);if(l(s))return f.clone(s.position,o)};Wa.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]=I0t(this,e,t[s],n,i);return SO(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}))};Wa.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]=X0t(this,e,t[s],n,i,t[s]);return SO(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Wa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var vA=Wa;var dHi=S(T(),1);var Uzi=S(T(),1);var KYi=S(T(),1),wA=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif -void main() -{ -vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); -vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE -color /= texture(autoExposure, vec2(0.5)).r; -#endif -color = czm_acesTonemapping(color); -color = czm_inverseGamma(color); -out_FragColor = vec4(color, fragmentColor.a); -} -`;var HYi=S(T(),1),FA=`uniform sampler2D randomTexture; -uniform sampler2D depthTexture; -uniform float intensity; -uniform float bias; -uniform float lengthCap; -uniform float stepSize; -uniform float frustumLength; -in vec2 v_textureCoordinates; -vec4 clipToEye(vec2 uv, float depth) -{ -vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); -vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); -posEC = posEC / posEC.w; -return posEC; -} -vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) -{ -vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); -vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); -vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); -vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); -vec3 up = posInCamera.xyz - posInCameraUp.xyz; -vec3 down = posInCameraDown.xyz - posInCamera.xyz; -vec3 left = posInCamera.xyz - posInCameraLeft.xyz; -vec3 right = posInCameraRight.xyz - posInCamera.xyz; -vec3 DX = length(left) < length(right) ? left : right; -vec3 DY = length(up) < length(down) ? up : down; -return normalize(cross(DY, DX)); -} -void main(void) -{ -float depth = czm_readDepth(depthTexture, v_textureCoordinates); -vec4 posInCamera = clipToEye(v_textureCoordinates, depth); -if (posInCamera.z > frustumLength) -{ -out_FragColor = vec4(1.0); -return; -} -vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; -float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); -float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); -float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); -float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); -vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); -float ao = 0.0; -vec2 sampleDirection = vec2(1.0, 0.0); -float gapAngle = 90.0 * czm_radiansPerDegree; -float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; -for (int i = 0; i < 4; i++) -{ -float newGapAngle = gapAngle * (float(i) + randomVal); -float cosVal = cos(newGapAngle); -float sinVal = sin(newGapAngle); -vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); -float localAO = 0.0; -float localStepSize = stepSize; -for (int j = 0; j < 6; j++) -{ -vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; -if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) -{ -break; -} -float stepDepthInfo = czm_readDepth(depthTexture, newCoords); -vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); -vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; -float len = length(diffVec); -if (len > lengthCap) -{ -break; -} -float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); -float weight = len / lengthCap; -weight = 1.0 - weight * weight; -if (dotVal < bias) -{ -dotVal = 0.0; -} -localAO = max(localAO, dotVal * weight); -localStepSize += stepSize; -} -ao += localAO; -} -ao /= 4.0; -ao = 1.0 - clamp(ao, 0.0, 1.0); -ao = pow(ao, intensity); -out_FragColor = vec4(vec3(ao), 1.0); -} -`;var QYi=S(T(),1),AA=`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 qYi=S(T(),1),MA=`uniform sampler2D colorTexture; -uniform float gradations; -in vec2 v_textureCoordinates; -void main(void) -{ -vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; -#ifdef CZM_SELECTED_FEATURE -if (czm_selected()) { -out_FragColor = vec4(rgb, 1.0); -return; -} -#endif -float luminance = czm_luminance(rgb); -float darkness = luminance * gradations; -darkness = (darkness - fract(darkness)) / gradations; -out_FragColor = vec4(vec3(darkness), 1.0); -} -`;var eKi=S(T(),1),NA=`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 nKi=S(T(),1),UA=`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 oKi=S(T(),1),kA=`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 sKi=S(T(),1),DA=`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 cKi=S(T(),1),BA=`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 uKi=S(T(),1),OA=`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 mKi=S(T(),1),YA=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif -void main() -{ -vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); -vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE -float exposure = texture(autoExposure, vec2(0.5)).r; -color /= exposure; -#endif -const float A = 0.22; -const float B = 0.30; -const float C = 0.10; -const float D = 0.20; -const float E = 0.01; -const float F = 0.30; -const float white = 11.2; -vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; -float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; -c = czm_inverseGamma(c / w); -out_FragColor = vec4(c, fragmentColor.a); -} -`;var hKi=S(T(),1),KA=`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 bKi=S(T(),1),ix=`#define SAMPLES 8 -uniform float delta; -uniform float sigma; -uniform float direction; -uniform sampler2D colorTexture; -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif -in vec2 v_textureCoordinates; -void main() -{ -vec2 st = v_textureCoordinates; -vec2 dir = vec2(1.0 - direction, direction); -#ifdef USE_STEP_SIZE -vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); -#else -vec2 step = step; -#endif -vec3 g; -g.x = 1.0 / (sqrt(czm_twoPi) * sigma); -g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); -g.z = g.y * g.y; -vec4 result = texture(colorTexture, st) * g.x; -for (int i = 1; i < SAMPLES; ++i) -{ -g.xy *= g.yz; -vec2 offset = float(i) * dir * step; -result += texture(colorTexture, st - offset) * g.x; -result += texture(colorTexture, st + offset) * g.x; -} -out_FragColor = result; -} -`;var yKi=S(T(),1),zA=`uniform sampler2D colorTexture; -uniform sampler2D dirtTexture; -uniform sampler2D starTexture; -uniform vec2 dirtTextureDimensions; -uniform float distortion; -uniform float ghostDispersal; -uniform float haloWidth; -uniform float dirtAmount; -uniform float earthRadius; -uniform float intensity; -in vec2 v_textureCoordinates; -#define DISTANCE_TO_SPACE 6500000.0 -vec4 getNDCFromWC(vec3 WC, float earthRadius) -{ -vec4 positionEC = czm_view * vec4(WC, 1.0); -positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); -vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); -return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); -} -float isInEarth(vec2 texcoord, vec2 sceneSize) -{ -vec2 NDC = texcoord * 2.0 - 1.0; -vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); -vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); -NDC.xy -= earthPosSC.xy; -float X = abs(NDC.x) * sceneSize.x; -float Y = abs(NDC.y) * sceneSize.y; -return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); -} -vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) -{ -vec2 sceneSize = czm_viewport.zw; -vec3 color; -if(isSpace) -{ -color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; -color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; -color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; -} -else -{ -color.r = texture(tex, texcoord + direction * distortion.r).r; -color.g = texture(tex, texcoord + direction * distortion.g).g; -color.b = texture(tex, texcoord + direction * distortion.b).b; -} -return vec4(clamp(color, 0.0, 1.0), 0.0); -} -void main(void) -{ -vec4 originalColor = texture(colorTexture, v_textureCoordinates); -vec3 rgb = originalColor.rgb; -bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; -vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); -vec4 sunPositionEC = czm_view * sunPos; -vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); -sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); -if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) -{ -out_FragColor = originalColor; -return; -} -vec2 texcoord = vec2(1.0) - v_textureCoordinates; -vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; -vec2 invPixelSize = 1.0 / pixelSize; -vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); -vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; -vec3 direction = normalize(vec3(ghostVec, 0.0)); -vec4 result = vec4(0.0); -vec4 ghost = vec4(0.0); -for (int i = 0; i < 4; ++i) -{ -vec2 offset = fract(texcoord + ghostVec * float(i)); -ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); -} -result += ghost; -vec2 haloVec = normalize(ghostVec) * haloWidth; -float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); -weightForHalo = pow(1.0 - weightForHalo, 5.0); -result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; -vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; -if (dirtTexCoords.x > 1.0) -{ -dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); -} -if (dirtTexCoords.y > 1.0) -{ -dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); -} -result += dirtAmount * texture(dirtTexture, dirtTexCoords); -float camrot = czm_view[0].z + czm_view[1].y; -float cosValue = cos(camrot); -float sinValue = sin(camrot); -mat3 rotation = mat3( -cosValue, -sinValue, 0.0, -sinValue, cosValue, 0.0, -0.0, 0.0, 1.0 -); -vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); -vec3 st2 = vec3((rotation * st1).xy, 1.0); -vec3 st3 = st2 * 0.5 + vec3(0.5); -vec2 lensStarTexcoord = st3.xy; -float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); -float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); -if (!isSpace) -{ -result *= oneMinusWeightForLensFlare * intensity * 0.2; -} -else -{ -result *= oneMinusWeightForLensFlare * intensity; -result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; -} -result += texture(colorTexture, v_textureCoordinates); -out_FragColor = result; -} -`;var _Ki=S(T(),1),HA=`uniform sampler2D colorTexture; -uniform vec3 white; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif -void main() -{ -vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); -vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE -float exposure = texture(autoExposure, vec2(0.5)).r; -color /= exposure; -#endif -color = (color * (1.0 + color / white)) / (1.0 + color); -color = czm_inverseGamma(color); -out_FragColor = vec4(color, fragmentColor.a); -} -`;var TKi=S(T(),1),JA=`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 VKi=S(T(),1),QA=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#endif -void main() -{ -vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); -vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE -float exposure = texture(autoExposure, vec2(0.5)).r; -color /= exposure; -#endif -color = color / (1.0 + color); -color = czm_inverseGamma(color); -out_FragColor = vec4(color, fragmentColor.a); -} -`;var ZKi=S(T(),1),jA=`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 wKi=S(T(),1);function LT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new B,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(LT.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 lTe(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 P0t(e,t){lTe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.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 hi,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 uTe(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 v0t(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 w0t(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 F0t(e,t){uTe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(w0t(r,i),{framebuffer:n[r].framebuffer,uniformMap:v0t(e,r)});e._commands=o}LT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ri({color:new Y(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};LT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,P0t(this,e),F0t(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};LT.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)};LT.prototype.isDestroyed=function(){return!1};LT.prototype.destroy=function(){return lTe(this),uTe(this),de(this)};var qA=LT;var ozi=S(T(),1);var AKi=S(T(),1),A0t={NEAREST:0,LINEAR:1},md=A0t;function ZT(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,nt.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,md.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,ze.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,Y.BLACK),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 o=new Fc;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Je.clone(e.scissorRectangle):new Je},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=Nn()),this._name=r,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(ZT.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 M0t=/uniform\s+sampler2D\s+depthTexture/g;ZT.prototype._isSupported=function(e){return!M0t.test(this._fragmentShader)||e.depthTexture};function N0t(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof bt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof bt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function U0t(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function k0t(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function D0t(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i)if(i.hasOwnProperty(r)){typeof i[r]!="function"?(t[r]=U0t(e,r),n[r]=N0t(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof bt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=k0t(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=ft(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 B0t(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=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#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 < ${o}; ++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)); -} - -${n}`}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function O0t(e){let t=e._sampleMode,n,i;t===md.LINEAR?(n=Ft.LINEAR,i=ni.LINEAR):(n=Ft.NEAREST,i=ni.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Y0t(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function K0t(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function z0t(e,t){let n,i,o,r=e._texturesToRelease,s=r.length;for(n=0;n<s;++n)i=r[n],i=i&&i.destroy();r.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let m=a[n];o=m.name;let p=m.source;e._actualUniforms[o]=new bt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let u=e._uniforms,d=[];for(n=0;n<s;++n){o=c[n];let m=u[o],p=e._textureCache.getStageByName(m);if(l(p))e._actualUniforms[o]=K0t(e,m);else if(typeof m=="string"){let b=new We({url:m});d.push(b.fetchImage().then(Y0t(e,o)))}else e._texturesToCreate.push({name:o,source:m})}c.length=0,d.length>0?(e._ready=!1,e._texturePromise=Promise.all(d).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function dTe(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)i.hasOwnProperty(o)&&i[o]instanceof bt&&(l(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function H0t(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}function J0t(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,o,r=0,s=n.length;for(i=0;i<s;++i)o=n[i],l(o.pickIds)?r+=o.pickIds.length:l(o.pickId)&&++r;if(s===0||r===0){let d=new Uint8Array(4);d[0]=255,d[1]=255,d[2]=255,d[3]=255,e._selectedIdTexture=new bt({context:t,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:1,height:1},sampler:Qt.NEAREST});return}let a,c=0,u=new Uint8Array(r*4);for(i=0;i<s;++i)if(o=n[i],l(o.pickIds)){let d=o.pickIds,m=d.length;for(let p=0;p<m;++p)a=d[p].color,u[c]=Y.floatToByte(a.red),u[c+1]=Y.floatToByte(a.green),u[c+2]=Y.floatToByte(a.blue),u[c+3]=Y.floatToByte(a.alpha),c+=4}else l(o.pickId)&&(a=o.pickId.color,u[c]=Y.floatToByte(a.red),u[c+1]=Y.floatToByte(a.green),u[c+2]=Y.floatToByte(a.blue),u[c+3]=Y.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new bt({context:t,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:u,width:r,height:1},sampler:Qt.NEAREST})}ZT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&dTe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=H0t(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,J0t(this,e),D0t(this),z0t(this,e),B0t(this,e),O0t(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=Oe.fromCache({viewport:new Je(0,0,i.width,i.height)}))),this._command.renderState=o};ZT.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,Qt.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)};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return dTe(this),de(this)};var So=ZT;var uzi=S(T(),1);function RT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Nn()),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(RT.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}}});RT.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};RT.prototype.get=function(e){return this._stages[e]};function Q0t(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}RT.prototype.update=function(e,t){this._selectedDirty=Q0t(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)}};RT.prototype.isDestroyed=function(){return!1};RT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var El=RT;var Hr={};function TO(e){let o=`#define USE_STEP_SIZE -${ix}`,r=new So({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:md.LINEAR}),s=new So({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:md.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,d=s.uniforms;u.delta=d.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,d=s.uniforms;u.sigma=d.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,d=s.uniforms;u.stepSize=d.stepSize=c}}}),new El({name:e,stages:[r,s],uniforms:a})}Hr.createBlurStage=function(){return TO("czm_blur")};Hr.createDepthOfFieldStage=function(){let e=TO("czm_depth_of_field_blur"),t=new So({name:"czm_depth_of_field_composite",fragmentShader:DA,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 El({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Hr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Hr.createEdgeDetectionStage=function(){let e=Nn();return new So({name:`czm_edge_detection_${e}`,fragmentShader:OA,uniforms:{length:.25,color:Y.clone(Y.BLACK)}})};Hr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function j0t(e){if(!l(e))return Hr.createEdgeDetectionStage();let t=new El({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 So({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new El({name:"czm_edge_detection_composite",stages:[t,s]})}Hr.createSilhouetteStage=function(e){let t=j0t(e),n=new So({name:"czm_silhouette_color_edges",fragmentShader:jA,uniforms:{silhouetteTexture:t.name}});return new El({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Hr.isSilhouetteSupported=function(e){return e.context.depthTexture};Hr.createBloomStage=function(){let e=new So({name:"czm_bloom_contrast_bias",fragmentShader:kA,uniforms:{contrast:128,brightness:-.3}}),t=TO("czm_bloom_blur"),n=new El({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new So({name:"czm_bloom_generate_composite",fragmentShader:NA,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 El({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Hr.createAmbientOcclusionStage=function(){let e=new So({name:"czm_ambient_occlusion_generate",fragmentShader:FA,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=TO("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new El({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new So({name:"czm_ambient_occlusion_composite",fragmentShader:AA,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=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}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new El({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Hr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var q0t=`#define FXAA_QUALITY_PRESET 39 -${yF} -${KA}`;Hr.createFXAAStage=function(){return new So({name:"czm_FXAA",fragmentShader:q0t,sampleMode:md.LINEAR})};Hr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=wA,new So({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Hr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=YA,new So({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Hr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=QA,new So({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Hr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=HA,new So({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:Y.WHITE,autoExposure:void 0}})};Hr.createAutoExposureStage=function(){return new qA};Hr.createBlackAndWhiteStage=function(){return new So({name:"czm_black_and_white",fragmentShader:MA,uniforms:{gradations:5}})};Hr.createBrightnessStage=function(){return new So({name:"czm_brightness",fragmentShader:UA,uniforms:{brightness:.5}})};Hr.createNightVisionStage=function(){return new So({name:"czm_night_vision",fragmentShader:JA})};Hr.createDepthViewStage=function(){return new So({name:"czm_depth_view",fragmentShader:BA})};Hr.createLensFlareStage=function(){return new So({name:"czm_lens_flare",fragmentShader:zA,uniforms:{dirtTexture:an("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:an("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var Lm=Hr;var Hzi=S(T(),1);function v0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function eM(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Y7(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[eM(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let d=s[a[u]];if(typeof d=="string"){let m=e.getStageByName(d);l(m)&&(r[eM(m)]=!0)}}}return i.name}function $A(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 m=0;m<c;++m){let p=i.get(m);l(p.length)?a=$A(e,t,n,p,o):a=Y7(e,t,n,p,o),s&&(o=a)}let u,d;if(s)for(u=1;u<c;++u)d=eM(i.get(u)),l(n[d])||(n[d]={}),n[d][r]=!0;else for(u=1;u<c;++u){d=eM(i.get(u));let m=n[d];for(let p=0;p<u;++p)m[eM(i.get(p))]=!0}return a}function $0t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=$A(e,t,n,i,void 0);a=$A(e,t,n,o,a),a=Y7(e,t,n,r,a),a=$A(e,t,n,e,a),Y7(e,t,n,s,a)}else $A(e,t,n,e,void 0);return n}function egt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,d,m,p=e._framebuffers,b=p.length;for(d=0;d<b;++d){if(m=p[d],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!Y.equals(u,m.clearColor))continue;let h=m.stages,x=h.length,_=!1;for(let C=0;C<x;++C)if(n[h[C]]){_=!0;break}if(!_)break}return l(m)&&d<b?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function tgt(e,t){let n=$0t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=egt(e,i,n[i]))}function K7(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function ngt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),d=Math.ceil(i*c),m=Math.min(u,d);a.forcePowerOfTwo&&(X.isPowerOfTwo(m)||(m=X.nextPowerOfTwo(m)),u=m,d=m),a.buffer.update(t,u,d),a.clear=new ri({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}v0.prototype.updateDependencies=function(){this._updateDependencies=!0};v0.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)&&(K7(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&tgt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,d=this._width!==c||this._height!==u;!n&&!d||(this._width=c,this._height=u,this._updateDependencies=!1,K7(this),ngt(this,e))};v0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};v0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};v0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};v0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};v0.prototype.isDestroyed=function(){return!1};v0.prototype.destroy=function(){return K7(this),de(this)};var GT=v0;var Qzi=S(T(),1),tM={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===tM.REINHARD||e===tM.MODIFIED_REINHARD||e===tM.FILMIC||e===tM.ACES}},ox=Object.freeze(tM);var z7=[];function Wl(){let e=Lm.createFXAAStage(),t=Lm.createAmbientOcclusionStage(),n=Lm.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Lm.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=ox.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new GT(this),r={},s=z7;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let d=0;d<u;++d)s.push(c.get(d))}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(Wl.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 H7(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 ox.REINHARD:n=Lm.createReinhardTonemappingStage(t);break;case ox.MODIFIED_REINHARD:n=Lm.createModifiedReinhardTonemappingStage(t);break;case ox.FILMIC:n=Lm.createFilmicTonemappingStage(t);break;default:n=Lm.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function H7(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._stages=t}Wl.prototype.add=function(e){let t=this._stageNames,n=z7;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};Wl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=z7;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};Wl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Wl.prototype.get=function(e){return H7(this),this._stages[e]};Wl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Wl.prototype.getStageByName=function(e){return this._stageNames[e]};Wl.prototype.update=function(e,t,n){H7(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages,s=o.length=r.length,a,c,u=0;for(a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&(o[u++]=c);o.length=u;let d=u!==i.length;if(!d){for(a=0;a<u;++a)if(o[a]!==i[a]){d=!0;break}}let m=this._ao,p=this._bloom,b=this._autoExposure,h=this._tonemapping,x=this._fxaa;h.enabled=n;let _=m.enabled&&m._isSupported(e),C=p.enabled&&p._isSupported(e),V=h.enabled&&h._isSupported(e),L=x.enabled&&x._isSupported(e);if((d||this._textureCacheDirty||_!==this._aoEnabled||C!==this._bloomEnabled||V!==this._tonemappingEnabled||L!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=C,this._tonemappingEnabled=V,this._fxaaEnabled=L,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){s=256*256*3;let R=new Uint8Array(s);for(a=0;a<s;a+=3)R[a]=Math.floor(Math.random()*255);this._randomTexture=new bt({context:e,pixelFormat:nt.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:R,width:256,height:256},sampler:new Qt({wrapS:ln.REPEAT,wrapT:ln.REPEAT,minificationFilter:Ft.NEAREST,magnificationFilter:ni.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),m.update(e,t),p.update(e,t),h.update(e,t),this._autoExposureEnabled&&b.update(e,t),s=r.length,a=0;a<s;++a)r[a].update(e,t);for(u=0,a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&u++;d=u!==o.length,d&&this.update(e,t,n)};Wl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function ET(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Wl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return ET(t)};function bp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}let r=e.length,s;if(e.inputPreviousStageTexture)for(bp(e.get(0),t,n,i,o),s=1;s<r;++s)bp(e.get(s),t,ET(e.get(s-1)),i,o);else for(s=0;s<r;++s)bp(e.get(s),t,n,i,o)}Wl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,d=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),b=this._autoExposureEnabled,h=d.enabled&&d._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!m&&!p&&!h&&r===0)return;let _=t;m&&a.ready&&(bp(a,e,_,n,i),_=ET(a)),p&&c.ready&&(bp(c,e,_,n,i),_=ET(c)),b&&u.ready&&bp(u,e,_,n,i),h&&d.ready&&(bp(d,e,_,n,i),_=ET(d));let C=_;if(r>0){bp(o[0],e,_,n,i);for(let V=1;V<r;++V)bp(o[V],e,ET(o[V-1]),n,i);C=ET(o[r-1])}x&&s.ready&&bp(s,e,C,n,i)};Wl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(hu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),de(this)};var nM=Wl;var EHi=S(T(),1);function WT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}WT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};WT.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(v.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?wgt(this,e):Dgt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var igt=new f,ogt=new f,rgt=new f,sgt=new f,agt=new f,cgt=new f,lgt=new f,ugt=new fe,dgt=new v,mgt=new Ri,fgt=new un,hgt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};WT.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(v.IDENTITY);let i=igt,o=ogt,r=rgt;if(e>0)i.x=0,i.y=-1,i.z=1,i=f.multiplyByScalar(f.normalize(i,i),5*t.maximumRadius,i),f.negate(f.normalize(i,o),o),f.cross(f.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)f.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,f.negate(f.UNIT_Z,o),f.clone(f.UNIT_Y,r);else{f.clone(u.positionWC,i),f.clone(u.directionWC,o),f.clone(u.upWC,r);let d=t.scaleToGeodeticSurface(i,lgt),m=Vt.eastNorthUpToFixedFrame(d,t,dgt);v.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,ugt),i),v.multiplyByPointAsVector(m,o,o),v.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=fgt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=mgt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=X.toRadians(60));let a=hgt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Ogt(a);iM(this,c),this._previousMode===oe.SCENE2D?Bgt(this,e,a,c):(a.position2D=v.multiplyByPoint(lo.TRANSFORM_2D,i,sgt),a.direction2D=v.multiplyByPointAsVector(lo.TRANSFORM_2D,o,agt),a.up2D=v.multiplyByPointAsVector(lo.TRANSFORM_2D,r,cgt),n._mode=oe.MORPHING,TTe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var j7={position:new f,direction:new f,up:new f,frustum:void 0},fTe=new Ri;WT.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(v.IDENTITY),this._previousMode===oe.SCENE2D)Lgt(this,e,t);else{let i;e>0?(i=j7,f.fromDegrees(0,0,5*t.maximumRadius,t,i.position),f.negate(i.position,i.direction),f.normalize(i.direction,i.direction),f.clone(f.UNIT_Z,i.up)):i=hTe(this,t);let o,r=n.camera;r.frustum instanceof un?o=r.frustum.clone():(o=fTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=X.toRadians(60)),i.frustum=o;let s=VTe(i);iM(this,s),Q7(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};WT.prototype.isDestroyed=function(){return!1};WT.prototype.destroy=function(){return CO(this),de(this)};function iM(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new cd(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Ln.LEFT_DOWN),e._morphHandler.setInputAction(n,Ln.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Ln.RIGHT_DOWN),e._morphHandler.setInputAction(n,Ln.WHEEL)}}function CO(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 pgt=new fe,bgt=new f,ggt=new v;function hTe(e,t){let n=e._scene,i=n.camera,o=j7,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,pgt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,bgt),d=Vt.eastNorthUpToFixedFrame(u,t,ggt);return v.multiplyByPointAsVector(d,i.direction,s),v.multiplyByPointAsVector(d,i.up,a),o}var ygt=new f,xgt=new f,_gt=new f,Sgt=new f,Tgt=new f,Cgt=new f;function Q7(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=f.clone(r.position,ygt),a=f.clone(r.direction,xgt),c=f.clone(r.up,_gt),u=v.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,n.position,Sgt),d=v.multiplyByPointAsVector(lo.TRANSFORM_2D_INVERSE,n.direction,Tgt),m=v.multiplyByPointAsVector(lo.TRANSFORM_2D_INVERSE,n.up,Cgt);function p(h){Zm(s,u,h.time,r.position),Zm(a,d,h.time,r.direction),Zm(c,m,h.time,r.up),f.cross(r.direction,r.up,r.right),f.normalize(r.right,r.right)}let b=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){CTe(e,o,0,1,t,i)}});e._currentTweens.push(b)}var Vgt=new un,pTe=new f,bTe=new f,gTe=new f,q7=new f,yTe=new f,xTe=new f;function Lgt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=j7,f.fromDegrees(0,0,5*n.maximumRadius,n,r.position),f.negate(r.position,r.direction),f.normalize(r.direction,r.direction),f.clone(f.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=hTe(e,n));let s;e._morphToOrthographic?(s=Vgt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=fTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=X.toRadians(60)),r.frustum=s;let a=VTe(r);iM(e,a);let c;e._morphToOrthographic?c=function(){Q7(e,t,r,a)}:c=function(){STe(e,t,r,function(){Q7(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:f.fromDegrees(0,0,5*n.maximumRadius,n,q7),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function Zm(e,t,n,i){return f.lerp(e,t,n,i)}function _Te(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,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function d(p){s.frustum.fov=X.lerp(a,c,p.time);let b=u/Math.tan(s.frustum.fov*.5);i(s,b)}let m=r.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:d,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var Zgt=new f,Rgt=new f,Ggt=new f,J7=new f,Egt=new f,Wgt=new f,Igt=new Pr,Xgt=new yn,Pgt=new f,vgt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function wgt(e,t){t*=.5;let n=e._scene,i=n.camera,o=f.clone(i.position,Zgt),r=f.clone(i.direction,Rgt),s=f.clone(i.up,Ggt),a=f.negate(f.UNIT_Z,Egt),c=f.clone(f.UNIT_Y,Wgt),u=J7;if(t>0)f.clone(f.ZERO,J7),u.z=5*n.ellipsoid.maximumRadius;else{f.clone(o,J7);let _=Xgt;v.multiplyByPoint(lo.TRANSFORM_2D,o,_.origin),v.multiplyByPointAsVector(lo.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,Pgt);l(V)&&(v.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,V,u),u.z+=f.distance(o,u))}}let d=Igt;d.right=u.z*.5,d.left=-d.right,d.top=d.right*(n.drawingBufferHeight/n.drawingBufferWidth),d.bottom=-d.top;let m=vgt;m.position=u,m.direction=a,m.up=c,m.frustum=d;let p=LTe(m);iM(e,p);function b(_){Zm(o,u,_.time,i.position),Zm(r,a,_.time,i.direction),Zm(s,c,_.time,i.up),f.cross(i.direction,i.up,i.right),f.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){_Te(e,t,m,h,p)}});e._currentTweens.push(x)}var mTe=new fe,Fgt={position:new f,direction:new f,up:new f,position2D:new f,direction2D:new f,up2D:new f,frustum:new Pr},Agt={position:new f,direction:new f,up:new f,frustum:void 0},Mgt=new f,Ngt=new yn,Ugt=new v,kgt=new f;function Dgt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Fgt;if(t>0)f.clone(f.ZERO,r.position),r.position.z=5*n.maximumRadius,f.negate(f.UNIT_Z,r.direction),f.clone(f.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,mTe),i.mapProjection.project(mTe,r.position),f.negate(f.UNIT_Z,r.direction),f.clone(f.UNIT_Y,r.up);let m=Ngt;f.clone(r.position2D,m.origin);let p=f.clone(o.directionWC,m.direction),b=n.scaleToGeodeticSurface(o.positionWC,kgt),h=Vt.eastNorthUpToFixedFrame(b,n,Ugt);v.inverseTransformation(h,h),v.multiplyByPointAsVector(h,p,p),v.multiplyByPointAsVector(lo.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(m,i,!0,Mgt);if(l(_)){let C=f.distance(r.position2D,_);_.x+=C,f.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}v.multiplyByPoint(lo.TRANSFORM_2D,r.position,r.position2D),v.multiplyByPointAsVector(lo.TRANSFORM_2D,r.direction,r.direction2D),v.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=Agt;v.multiplyByPoint(lo.TRANSFORM_2D_INVERSE,r.position2D,c.position),f.clone(r.direction,c.direction),f.clone(r.up,c.up),c.frustum=a;let u=LTe(c);iM(e,u);function d(){_Te(e,t,r,s,u)}TTe(e,t,r,d)}function STe(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,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function d(p){r.frustum.fov=X.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:d,complete:function(){i(e)}});e._currentTweens.push(m)}function Bgt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=f.clone(n.position,q7),a=f.clone(n.direction,yTe),c=f.clone(n.up,xTe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let d=f.clone(r.position,pTe),m=f.clone(r.direction,bTe),p=f.clone(r.up,gTe);d.z=s.z;function b(x){Zm(d,s,x.time,r.position),Zm(m,a,x.time,r.direction),Zm(p,c,x.time,r.up),f.cross(r.direction,r.up,r.right),f.normalize(r.right,r.right)}let h=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?u():STe(e,0,n,u)}function TTe(e,t,n,i){let o=e._scene,r=o.camera,s=f.clone(r.position,pTe),a=f.clone(r.direction,bTe),c=f.clone(r.up,gTe),u=f.clone(n.position2D,q7),d=f.clone(n.direction2D,yTe),m=f.clone(n.up2D,xTe);function p(h){Zm(s,u,h.time,r.position),Zm(a,d,h.time,r.direction),Zm(c,m,h.time,r.up),f.cross(r.direction,r.up,r.right),f.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let b=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){CTe(e,o,1,0,t,i)}});e._currentTweens.push(b)}function CTe(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 VTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),CO(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,f.clone(e.position,i.position),f.clone(e.direction,i.direction),f.clone(e.up,i.up),f.cross(i.direction,i.up,i.right),f.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 LTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),CO(t);let i=n.camera;f.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,f.clone(e.direction,i.direction),f.clone(e.up,i.up),f.cross(i.direction,i.up,i.right),f.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 Ogt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),CO(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,f.clone(e.position,i.position),f.clone(e.direction,i.direction),f.clone(e.up,i.up),f.cross(i.direction,i.up,i.right),f.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 oM=WT;var VJi=S(T(),1);var kHi=S(T(),1);var IHi=S(T(),1),Ygt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},wi=Object.freeze(Ygt);function Oc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Kgt(e,t){B.clone(e.distance.startPosition,t.distance.startPosition),B.clone(e.distance.endPosition,t.distance.endPosition),B.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),B.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function ZTe(e,t,n){let i=Oc(wi.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 B;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new B,endPosition:new B},u.angleAndHeight={startPosition:new B,endPosition:new B},u.prevAngle=0,e._eventHandler.setInputAction(function(d){e._buttonsDown++,r[i]=!0,a[i]=new Date,B.lerp(d.position1,d.position2,.5,s[i])},Ln.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Ln.PINCH_END,t),e._eventHandler.setInputAction(function(d){if(r[i]){o[i]?(Kgt(d,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(B.clone(d.distance.endPosition,u.distance.endPosition),B.clone(d.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let m=u.angleAndHeight.endPosition.x,p=u.prevAngle,b=Math.PI*2;for(;m>=p+Math.PI;)m-=b;for(;m<p-Math.PI;)m+=b;u.angleAndHeight.endPosition.x=-m*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Ln.PINCH_MOVE,t)}function RTe(e,t){let n=Oc(wi.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 B,endPosition:new B,valid:!1}),s.startPosition=new B,B.clone(B.ZERO,s.startPosition),s.endPosition=new B,e._eventHandler.setInputAction(function(c){let u=7.5*X.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,B.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Ln.WHEEL,t)}function qL(e,t,n){let i=Oc(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;o[i]=!1,r[i]=new B;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new B,endPosition:new B,valid:!1});let u,d;n===wi.LEFT_DRAG?(u=Ln.LEFT_DOWN,d=Ln.LEFT_UP):n===wi.RIGHT_DRAG?(u=Ln.RIGHT_DOWN,d=Ln.RIGHT_UP):n===wi.MIDDLE_DRAG&&(u=Ln.MIDDLE_DOWN,d=Ln.MIDDLE_UP),e._eventHandler.setInputAction(function(m){e._buttonsDown++,c.valid=!1,o[i]=!0,s[i]=new Date,B.clone(m.position,r[i])},u,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,a[i]=new Date},d,t)}function GTe(e,t){B.clone(e.startPosition,t.startPosition),B.clone(e.endPosition,t.endPosition)}function ETe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in wi)if(wi.hasOwnProperty(s)){let a=wi[s];if(l(a)){let c=Oc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new B,endPosition:new B,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new B,endPosition:new B})}}e._eventHandler.setInputAction(function(s){for(let a in wi)if(wi.hasOwnProperty(a)){let c=wi[a];if(l(c)){let u=Oc(c,t);r[u]&&(n[u]?(GTe(i[u],o[u]),o[u].valid=!0,GTe(s,i[u]),n[u]=!1):B.clone(s.endPosition,i[u].endPosition))}}B.clone(s.endPosition,e._currentMousePosition)},Ln.MOUSE_MOVE,t)}function Rm(e){this._eventHandler=new cd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new B,RTe(this,void 0),ZTe(this,void 0,e),qL(this,void 0,wi.LEFT_DRAG),qL(this,void 0,wi.RIGHT_DRAG),qL(this,void 0,wi.MIDDLE_DRAG),ETe(this,void 0);for(let t in Za)if(Za.hasOwnProperty(t)){let n=Za[t];l(n)&&(RTe(this,n),ZTe(this,n,e),qL(this,n,wi.LEFT_DRAG),qL(this,n,wi.RIGHT_DRAG),qL(this,n,wi.MIDDLE_DRAG),ETe(this,n))}}Object.defineProperties(Rm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Oc(wi.WHEEL)]||!this._update[Oc(wi.WHEEL,Za.SHIFT)]||!this._update[Oc(wi.WHEEL,Za.CTRL)]||!this._update[Oc(wi.WHEEL,Za.ALT)];return this._buttonsDown>0||e}}});Rm.prototype.isMoving=function(e,t){let n=Oc(e,t);return!this._update[n]};Rm.prototype.getMovement=function(e,t){let n=Oc(e,t);return this._movement[n]};Rm.prototype.getLastMovement=function(e,t){let n=Oc(e,t),i=this._lastMovement[n];if(i.valid)return i};Rm.prototype.isButtonDown=function(e,t){let n=Oc(e,t);return this._isDown[n]};Rm.prototype.getStartMousePosition=function(e,t){if(e===wi.WHEEL)return this._currentMousePosition;let n=Oc(e,t);return this._eventStartPosition[n]};Rm.prototype.getButtonPressTime=function(e,t){let n=Oc(e,t);return this._pressTime[n]};Rm.prototype.getButtonReleaseTime=function(e,t){let n=Oc(e,t);return this._releaseTime[n]};Rm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Rm.prototype.isDestroyed=function(){return!1};Rm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var rM=Rm;var QHi=S(T(),1);function VO(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ue(n),this._stopObject=Ue(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(VO.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}}});VO.prototype.cancelTween=function(){this._tweens.remove(this)};function Qf(){this._tweens=[]}Object.defineProperties(Qf.prototype,{length:{get:function(){return this._tweens.length}}});Qf.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new VO(this);let t=e.duration/Qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Qn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Kr.LINEAR_NONE),r=e.startObject,s=new Sge(r);s.to(Ue(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new VO(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Qf.prototype.addProperty=function(e){e=y(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:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Qf.prototype.addAlpha=function(e){e=y(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:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Qf.prototype.addOffsetIncrement=function(e){e=y(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})};Qf.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};Qf.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};Qf.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Qf.prototype.get=function(e){return this._tweens[e]};Qf.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Qn.SECONDS_PER_MILLISECOND:Si();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 IT=Qf;function aM(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.translateEventTypes=wi.LEFT_DRAG,this.zoomEventTypes=[wi.RIGHT_DRAG,wi.WHEEL,wi.PINCH],this.rotateEventTypes=wi.LEFT_DRAG,this.tiltEventTypes=[wi.MIDDLE_DRAG,wi.PINCH,{eventType:wi.LEFT_DRAG,modifier:Za.CTRL},{eventType:wi.RIGHT_DRAG,modifier:Za.CTRL}],this.lookEventTypes={eventType:wi.LEFT_DRAG,modifier:Za.SHIFT};let t=y(e.ellipsoid,ie.default);this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new rM(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 IT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new B(-1,-1),this._tiltCenter=new f,this._rotateMousePosition=new B(-1,-1),this._rotateStartPosition=new f,this._strafeStartPosition=new f,this._strafeMousePosition=new B,this._strafeEndMousePosition=new B,this._zoomMouseStart=new B(-1,-1),this._zoomWorldPosition=new f,this._useZoomWorldPosition=!1,this._panLastMousePosition=new B,this._panLastWorldPosition=new f,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 fe(Math.PI,X.PI_OVER_TWO)),this._zoomFactor=5,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 zgt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Hgt(e){return B.equalsEpsilon(e.startPosition,e.endPosition,X.EPSILON14)}var Jgt=.4;function Qgt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new B,endPosition:new B,motion:new B,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),d=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&d<Jgt){let b=zgt(p,i),h=e.getLastMovement(t,n);if(!l(h)||Hgt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=B.clone(h.startPosition,a.startPosition),a.endPosition=B.multiplyByScalar(a.motion,b,a.endPosition),a.endPosition=B.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||B.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function jgt(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 WTe=[];function Il(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(WTe[0]=n,n=WTe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],d=l(u.eventType)?u.eventType:u,m=u.modifier,p=s.isMoving(d,m)&&s.getMovement(d,m),b=s.getStartMousePosition(d,m);e.enableInputs&&t&&(p?(i(e,b,p),jgt(e,r)):o<1&&Qgt(s,d,m,o,i,e,r))}}var LO=new yn,qgt=new f,$gt=new B,eyt=new f,tyt=new B,nyt=new f,iyt=new f,oyt=new f,ryt=new f,DTe=new f,syt=new f,ayt=new f,cyt=new f,lyt=new f,uyt=new f,dyt=new f,myt=new f,fyt=new f,hyt=new f,pyt=new f,XT=new f,ITe=new f,XTe=new f,$7={orientation:new pc};function a6(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,u=a>0?e.minimumZoomDistance*s:0,d=e.maximumZoomDistance,m=o-u,p=i*m;p=X.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let b=a/e._scene.canvas.clientHeight;b=Math.min(b,e.maximumMovementRatio);let h=p*b;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(h>0&&Math.abs(o-u)<1||h<0&&Math.abs(o-d)<1)return;o-h<u?h=o-u-1:o-h>d&&(h=o-d)}let x=e._scene,_=x.camera,C=x.mode,V=$7.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof un){Math.abs(h)>0&&(_.zoomIn(h),_._adjustOrthographicFrustum(!0));return}let L=y(n.inertiaEnabled,B.equals(t,e._zoomMouseStart)),R=e._zoomingOnVector,G=e._rotatingZoom,W;if(L||(e._zoomMouseStart=B.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(W=_.getPickRay(t,LO).origin,W=f.fromElements(W.y,W.z,W.x)):l(e._globe)&&(W=w0(e,t,qgt)),l(W)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=f.clone(W,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,R=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(h);return}let w=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,F=_.position;if(!f.equals(P,F)&&_.positionCartographic.height<e._maxCoord.x*2){let M=_.position.x,g=f.subtract(P,F,eyt);f.normalize(g,g);let Z=f.distance(P,F)*h/(_.getMagnitude()*.5);_.move(g,Z*.5),(_.position.x<0&&M>0||_.position.x>0&&M<0)&&(W=_.getPickRay(t,LO).origin,W=f.fromElements(W.y,W.z,W.x),e._zoomWorldPosition=f.clone(W,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=f.normalize(_.position,DTe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(f.dot(_.direction,P))<.6)w=!0;else{let F=x.canvas,M=tyt;M.x=F.clientWidth/2,M.y=F.clientHeight/2;let g=w0(e,M,nyt);if(!l(g))w=!0;else if(_.positionCartographic.height<1e6)if(f.dot(_.direction,P)>=-.5)w=!0;else{let Z=ayt;f.clone(_.position,Z);let E=e._zoomWorldPosition,I=syt;if(I=f.normalize(E,I),f.dot(I,P)<0)return;let A=pyt,N=uyt;f.clone(_.direction,N),f.add(Z,f.multiplyByScalar(N,1e3,XT),A);let D=dyt,k=myt;f.subtract(E,Z,D),f.normalize(D,k);let O=f.dot(P,k);if(O>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-O),j=f.magnitude(Z),K=f.magnitude(E),te=j-h,z=f.magnitude(D),q=Math.asin(X.clamp(z/K*Math.sin(U),-1,1)),ee=Math.asin(X.clamp(te/K*Math.sin(U),-1,1)),pe=q-ee+U,xe=cyt;f.normalize(Z,xe);let ce=lyt;ce=f.cross(k,xe,ce),ce=f.normalize(ce,ce),f.normalize(f.cross(xe,ce,XT),N),f.multiplyByScalar(f.normalize(A,XT),f.magnitude(A)-h,A),f.normalize(Z,Z),f.multiplyByScalar(Z,te,Z);let ye=fyt;f.multiplyByScalar(f.add(f.multiplyByScalar(xe,Math.cos(pe)-1,ITe),f.multiplyByScalar(N,Math.sin(pe),XTe),XT),te,ye),f.add(Z,ye,Z),f.normalize(A,xe),f.normalize(f.cross(xe,ce,XT),N);let Te=hyt;f.multiplyByScalar(f.add(f.multiplyByScalar(xe,Math.cos(pe)-1,ITe),f.multiplyByScalar(N,Math.sin(pe),XTe),XT),f.magnitude(A),Te),f.add(A,Te,A),f.clone(Z,_.position),f.normalize(f.subtract(A,Z,XT),_.direction),f.clone(_.direction,_.direction),f.cross(_.direction,_.up,_.right),f.cross(_.right,_.direction,_.up),_.setView($7);return}else{let Z=f.normalize(g,iyt),E=f.normalize(e._zoomWorldPosition,oyt),I=f.dot(E,Z);if(I>0&&I<1){let A=X.acosClamped(I),N=f.cross(E,Z,ryt),D=Math.abs(A)>X.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-h,k=h/D;_.rotate(N,A*k)}}}}e._rotatingZoom=!w}if(!L&&w||R){let P,F=zi.worldToWindowCoordinates(x,e._zoomWorldPosition,$gt);C!==oe.COLUMBUS_VIEW&&B.equals(t,e._zoomMouseStart)&&l(F)?P=_.getPickRay(F,LO):P=_.getPickRay(t,LO);let M=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&f.fromElements(M.y,M.z,M.x,M),_.move(M,h),e._zoomingOnVector=!0}else _.zoomIn(h);e._cameraUnderground||_.setView($7)}var byt=new yn,gyt=new yn,yyt=new f;function xyt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,byt).origin,s=o.getPickRay(n.endPosition,gyt).origin;r=f.fromElements(r.y,r.z,r.x,r),s=f.fromElements(s.y,s.z,s.x,s);let a=f.subtract(r,s,yyt),c=f.magnitude(a);c>0&&(f.normalize(a,a),o.move(a,c))}function PTe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;a6(e,t,n,e._zoomFactor,o.getMagnitude())}var _yt=new B,Syt=new B;function vTe(e,t,n){if(l(n.angleAndHeight)){Tyt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=_yt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=B.normalize(c,c);let u=Syt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=B.normalize(u,u);let d=X.acosClamped(c.x);c.y<0&&(d=X.TWO_PI-d);let m=X.acosClamped(u.x);u.y<0&&(m=X.TWO_PI-m);let p=m-d;o.twistRight(p)}function Tyt(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 Cyt(e){let t=e._scene.mapMode2D===fu.ROTATE;v.equals(v.IDENTITY,e._scene.camera.transform)?(Il(e,e.enableTranslate,e.translateEventTypes,xyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Il(e,e.enableZoom,e.zoomEventTypes,PTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Il(e,e.enableRotate,e.tiltEventTypes,vTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Il(e,e.enableZoom,e.zoomEventTypes,PTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Il(e,e.enableRotate,e.translateEventTypes,vTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var BTe=new yn,Vyt=new f,Lyt=new f;function w0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Vyt)),!l(o))return f.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,BTe),u=o.pickWorldCoordinates(c,i,a,Lyt),d=l(s)?f.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(u)?f.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return d<m?f.clone(s,n):f.clone(u,n)}var Zyt=new fe;function XO(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,Zyt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var Ryt=new f;function OTe(e,t){let n=t.origin,i=t.direction,o=XO(e),r=f.normalize(n,Ryt),s=Math.abs(f.dot(r,i));return s=Math.max(s,.5)*2,o*s}function YTe(e,t,n,i){let o=f.distance(t.origin,n),r=XO(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 KTe(e,t,n,i){let o;return l(n)?(o=f.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=XO(e))):o=XO(e),yn.getPoint(t,o,i)}var Gyt=new B;function zTe(e,t){let n=t.endPosition,i=B.subtract(t.endPosition,t.startPosition,Gyt),o=e._strafeEndMousePosition;B.add(o,i,o),t.endPosition=o,c6(e,t,e._strafeStartPosition),t.endPosition=n}var wTe=new yn,Eyt=new yn,e6=new f,Wyt=new f,Iyt=new f,Xyt=new f,Pyt=new on(f.UNIT_X,0),vyt=new B,wyt=new B;function Fyt(e,t,n){if(f.equals(t,e._translateMousePosition)||(e._looking=!1),f.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){hd(e,t,n);return}if(e._strafing){zTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=B.clone(n.startPosition,vyt),a=B.clone(n.endPosition,wyt),c=o.getPickRay(s,wTe),u=f.clone(f.ZERO,Xyt),d=f.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=w0(e,s,e6),l(m)&&(u.x=m.x)),r||u.x>o.position.z&&l(m)){let L=m;r&&(L=KTe(e,c,m,e6)),B.clone(t,e._strafeMousePosition),B.clone(t,e._strafeEndMousePosition),f.clone(L,e._strafeStartPosition),e._strafing=!0,c6(e,n,e._strafeStartPosition);return}let p=on.fromPointNormal(u,d,Pyt);c=o.getPickRay(s,wTe);let b=ei.rayPlane(c,p,e6),h=o.getPickRay(a,Eyt),x=ei.rayPlane(h,p,Wyt);if(!l(b)||!l(x)){e._looking=!0,hd(e,t,n),B.clone(t,e._translateMousePosition);return}let _=f.subtract(b,x,Iyt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=f.magnitude(_);V>X.EPSILON6&&(f.normalize(_,_),o.move(_,V))}var HTe=new B,GO=new yn,EO=new f,Ayt=new f,JTe=new v,Myt=new v,Nyt=new f,Uyt=new on(f.UNIT_X,0),t6=new f,o6=new fe,QTe=new v,kyt=new Pe,Dyt=new $,WO=new f;function Byt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),B.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){hd(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Oyt(e,t,n)):Yyt(e,t,n)}function Oyt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=HTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,GO),c=f.UNIT_X,u=a.origin,d=a.direction,m,p=f.dot(c,d);if(Math.abs(p)>X.EPSILON6&&(m=-f.dot(c,u)/p),!l(m)||m<=0){e._looking=!0,hd(e,t,n),B.clone(t,e._tiltCenterMousePosition);return}let b=f.multiplyByScalar(d,m,EO);f.add(u,b,b);let h=i.mapProjection,x=h.ellipsoid;f.fromElements(b.y,b.z,b.x,b);let _=h.unproject(b,o6);x.cartographicToCartesian(_,b);let C=Vt.eastNorthUpToFixedFrame(b,x,JTe),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=v.clone(o.transform,QTe);o._setTransform(C),fd(e,t,n,f.UNIT_Z),o._setTransform(R),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function Yyt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=f.UNIT_X;if(B.equals(t,e._tiltCenterMousePosition))s=f.clone(e._tiltCenter,EO);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=w0(e,t,EO)),!l(s)){a=o.getPickRay(t,GO);let g=a.origin,Z=a.direction,E,I=f.dot(c,Z);if(Math.abs(I)>X.EPSILON6&&(E=-f.dot(c,g)/I),!l(E)||E<=0){e._looking=!0,hd(e,t,n),B.clone(t,e._tiltCenterMousePosition);return}s=f.multiplyByScalar(Z,E,EO),f.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,GO)),YTe(e,a,s,s)),B.clone(t,e._tiltCenterMousePosition),f.clone(s,e._tiltCenter)}let u=i.canvas,d=HTe;d.x=u.clientWidth/2,d.y=e._tiltCenterMousePosition.y,a=o.getPickRay(d,GO);let m=f.clone(f.ZERO,Nyt);m.x=s.x;let p=on.fromPointNormal(m,c,Uyt),b=ei.rayPlane(a,p,Ayt),h=o._projection,x=h.ellipsoid;f.fromElements(s.y,s.z,s.x,s);let _=h.unproject(s,o6);x.cartographicToCartesian(_,s);let C=Vt.eastNorthUpToFixedFrame(s,x,JTe),V;l(b)?(f.fromElements(b.y,b.z,b.x,b),_=h.unproject(b,o6),x.cartographicToCartesian(_,b),V=Vt.eastNorthUpToFixedFrame(b,x,Myt)):V=C;let L=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=f.UNIT_Z,W=v.clone(o.transform,QTe);o._setTransform(C);let w=f.cross(f.UNIT_Z,f.normalize(o.position,t6),t6),P=f.dot(o.right,w);if(fd(e,t,n,G,!1,!0),o._setTransform(V),P<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(G=void 0);let Z=o.constrainedAxis;o.constrainedAxis=void 0,fd(e,t,n,G,!0,!1),o.constrainedAxis=Z}else fd(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let g=f.cross(o.direction,o.constrainedAxis,WO);f.equalsEpsilon(g,f.ZERO,X.EPSILON6)||(f.dot(g,o.right)<0&&f.negate(g,g),f.cross(g,o.direction,o.up),f.cross(o.direction,o.up,o.right),f.normalize(o.up,o.up),f.normalize(o.right,o.right))}o._setTransform(W),e._globe=L,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let M=f.clone(o.positionWC,t6);if(e.enableCollisionDetection&&d6(e,!0),!f.equals(o.positionWC,M)){o._setTransform(V),o.worldToCameraCoordinatesPoint(M,M);let g=f.magnitudeSquared(M);f.magnitudeSquared(o.position)>g&&(f.normalize(o.position,o.position),f.multiplyByScalar(o.position,Math.sqrt(g),o.position));let Z=f.angleBetween(M,o.position),E=f.cross(M,o.position,M);f.normalize(E,E);let I=Pe.fromAxisAngle(E,Z,kyt),A=$.fromQuaternion(I,Dyt);$.multiplyByVector(A,o.direction,o.direction),$.multiplyByVector(A,o.up,o.up),f.cross(o.direction,o.up,o.right),f.cross(o.right,o.direction,o.up),o._setTransform(W)}}var jTe=new B,qTe=new yn,$Te=new f;function Kyt(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=jTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,qTe),u=c.origin,d=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=w0(e,a,$Te));let b;if(l(p)&&(b=f.distance(u,p)),s){let h=OTe(e,c,m);l(b)?b=Math.min(b,h):b=h}if(!l(b)){let h=f.UNIT_X;b=-f.dot(h,u)/f.dot(h,d)}a6(e,t,n,e._zoomFactor,b)}function zyt(e){let n=e._scene.camera;if(!v.equals(v.IDENTITY,n.transform))Il(e,e.enableRotate,e.rotateEventTypes,fd,e.inertiaSpin,"_lastInertiaSpinMovement"),Il(e,e.enableZoom,e.zoomEventTypes,tCe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Il(e,e.enableTilt,e.tiltEventTypes,Byt,e.inertiaSpin,"_lastInertiaTiltMovement"),Il(e,e.enableTranslate,e.translateEventTypes,Fyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Il(e,e.enableZoom,e.zoomEventTypes,Kyt,e.inertiaZoom,"_lastInertiaZoomMovement"),Il(e,e.enableLook,e.lookEventTypes,hd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Hyt=new yn,Jyt=new on(f.UNIT_X,0),Qyt=new f,jyt=new f;function c6(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Hyt),s=f.clone(o.direction,jyt);i.mode===oe.COLUMBUS_VIEW&&f.fromElements(s.z,s.x,s.y,s);let a=on.fromPointNormal(n,s,Jyt),c=ei.rayPlane(r,a,Qyt);l(c)&&(s=f.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&f.fromElements(s.y,s.z,s.x,s),f.add(o.position,s,o.position))}var FTe=new f,eCe=new fe,r6=new f,s6=new ie,qyt=new f,$yt=new f,ext=new f;function txt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!v.equals(o.transform,v.IDENTITY)){fd(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,qyt);if(B.equals(t,e._rotateMousePosition)){if(e._looking)hd(e,t,n,u);else if(e._rotating)fd(e,t,n);else if(e._strafing)zTe(e,n);else{if(f.magnitude(o.position)<f.magnitude(e._rotateStartPosition))return;a=f.magnitude(e._rotateStartPosition),c=r6,c.x=c.y=c.z=a,s=ie.fromCartesian3(c,s6),i6(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let d=s.cartesianToCartographic(o.positionWC,eCe).height,m=e._globe;if(l(m)&&d<e._minimumPickingTerrainHeight){let p=w0(e,n.startPosition,ext);if(l(p)){let b=!1,h=o.getPickRay(n.startPosition,BTe);if(r)b=!0,KTe(e,h,p,p);else{let x=s.geodeticSurfaceNormal(p,$yt);Math.abs(f.dot(h.direction,x))<.05?b=!0:b=f.magnitude(o.position)<f.magnitude(p)}b?(B.clone(t,e._strafeEndMousePosition),f.clone(p,e._strafeStartPosition),e._strafing=!0,c6(e,n,e._strafeStartPosition)):(a=f.magnitude(p),c=r6,c.x=c.y=c.z=a,s=ie.fromCartesian3(c,s6),i6(e,t,n,s),f.clone(p,e._rotateStartPosition))}else e._looking=!0,hd(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,FTe))?(i6(e,t,n,e._ellipsoid),f.clone(FTe,e._rotateStartPosition)):d>e._minimumTrackBallHeight?(e._rotating=!0,fd(e,t,n)):(e._looking=!0,hd(e,t,n,u));B.clone(t,e._rotateMousePosition)}function fd(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let d=f.magnitude(a.position),m=e._rotateFactor*(d-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,b=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),b=Math.min(b,e.maximumMovementRatio);let h=m*p*Math.PI*2,x=m*b*Math.PI;o||a.rotateRight(h),r||a.rotateUp(x),a.constrainedAxis=u}var n6=re.clone(re.UNIT_W),ATe=re.clone(re.UNIT_W),ZO=new f,$L=new f,RO=new f,MTe=new f,nxt=new B,ixt=new B,oxt=new B,rxt=new B,sxt=new yn;function i6(e,t,n,i){let o=e._scene,r=o.camera,s=B.clone(n.startPosition,nxt),a=B.clone(n.endPosition,ixt),c=i.cartesianToCartographic(r.positionWC,eCe).height,u,d;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=f.clone(e._panLastWorldPosition,n6),!l(e._globe)&&!B.equalsEpsilon(s,e._panLastMousePosition)&&(u=w0(e,s,n6)),!l(e._globe)&&l(u))){let m=f.subtract(u,r.positionWC,$L),p=f.multiplyByScalar(r.directionWC,f.dot(r.directionWC,m),$L),b=f.magnitude(p),h=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,rxt),x=B.subtract(a,s,oxt),_=f.multiplyByScalar(r.rightWC,x.x*h.x,$L),C=f.normalize(r.positionWC,DTe),V=r.getPickRay(a,sxt).direction,L=f.subtract(V,f.projectVector(V,r.rightWC,RO),RO),R=f.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(R),.1));let W=Math.abs(f.dot(r.directionWC,C)),w=-x.y*h.y*2/Math.sqrt(G)*(1-W),P=f.multiplyByScalar(V,w,RO);W=Math.abs(f.dot(r.upWC,C));let F=f.multiplyByScalar(r.upWC,-x.y*(1-W)*h.y,MTe);d=f.add(u,_,ATe),d=f.add(d,P,d),d=f.add(d,F,d),f.clone(d,e._panLastWorldPosition),B.clone(a,e._panLastMousePosition)}if((!l(u)||!l(d))&&(u=r.pickEllipsoid(s,i,n6),d=r.pickEllipsoid(a,i,ATe)),!l(u)||!l(d)){e._rotating=!0,fd(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),d=r.worldToCameraCoordinates(d,d),l(r.constrainedAxis)){let m=r.constrainedAxis,p=f.mostOrthogonalAxis(m,ZO);f.cross(p,m,p),f.normalize(p,p);let b=f.cross(m,p,$L),h=f.magnitude(u),x=f.dot(m,u),_=Math.acos(x/h),C=f.multiplyByScalar(m,x,RO);f.subtract(u,C,C),f.normalize(C,C);let V=f.magnitude(d),L=f.dot(m,d),R=Math.acos(L/V),G=f.multiplyByScalar(m,L,MTe);f.subtract(d,G,G),f.normalize(G,G);let W=Math.acos(f.dot(C,p));f.dot(C,b)<0&&(W=X.TWO_PI-W);let w=Math.acos(f.dot(G,p));f.dot(G,b)<0&&(w=X.TWO_PI-w);let P=W-w,F;f.equalsEpsilon(m,r.position,X.EPSILON2)?F=r.right:F=f.cross(m,r.position,ZO);let M=f.cross(m,F,ZO),g=f.dot(M,f.subtract(u,m,$L)),Z=f.dot(M,f.subtract(d,m,$L)),E;g>0&&Z>0?E=R-_:g>0&&Z<=0?f.dot(r.position,m)>0?E=-_-R:E=_+R:E=_-R,r.rotateRight(P),r.rotateUp(E)}else{f.normalize(u,u),f.normalize(d,d);let m=f.dot(u,d),p=f.cross(u,d,ZO);if(m<1&&!f.equalsEpsilon(p,f.ZERO,X.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var axt=new f,cxt=new fe,NTe=0;function tCe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=jTe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let d=s.getPickRay(u,qTe),m,p=o.cartesianToCartographic(s.position,cxt).height,b=Math.abs(NTe)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=w0(e,u,$Te));let x;if(l(m)&&(x=f.distance(d.origin,m),NTe=x),c){let C=OTe(e,d,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=f.normalize(s.position,axt);a6(e,t,n,e._zoomFactor,x,f.dot(_,s.direction))}var nCe=new B,IO=new yn,sM=new f,lxt=new f,iCe=new v,uxt=new v,oCe=new v,dxt=new Pe,mxt=new $,l6=new fe,u6=new f;function fxt(e,t,n){let o=e._scene.camera;if(!v.equals(o.transform,v.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),B.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,u6);hd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,l6);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,pxt(e,t,n)):bxt(e,t,n)}var hxt=new fe;function pxt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,hxt).height;if(a-s-1<X.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=nCe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let d=r.getPickRay(u,IO),m,p=ei.rayEllipsoid(d,i);if(l(p))m=yn.getPoint(d,p.start,sM);else if(a>e._minimumTrackBallHeight){let V=ei.grazingAltitudeLocation(d,i);if(!l(V))return;let L=i.cartesianToCartographic(V,l6);L.height=0,m=i.cartographicToCartesian(L,sM)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,u6);hd(e,t,n,V),B.clone(t,e._tiltCenterMousePosition);return}let b=Vt.eastNorthUpToFixedFrame(m,i,iCe),h=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=v.clone(r.transform,oCe);r._setTransform(b),fd(e,t,n,f.UNIT_Z),r._setTransform(_),e._globe=h,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function bxt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(B.equals(t,e._tiltCenterMousePosition))a=f.clone(e._tiltCenter,sM);else{if(a=w0(e,t,sM),!l(a)){if(c=r.getPickRay(t,IO),u=ei.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,l6).height<=e._minimumTrackBallHeight){e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,u6);hd(e,t,n,Z),B.clone(t,e._tiltCenterMousePosition)}return}a=yn.getPoint(c,u.start,sM)}s&&(l(c)||(c=r.getPickRay(t,IO)),YTe(e,c,a,a)),B.clone(t,e._tiltCenterMousePosition),f.clone(a,e._tiltCenter)}let d=o.canvas,m=nCe;m.x=d.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,IO);let p=f.magnitude(a),b=f.fromElements(p,p,p,r6),h=ie.fromCartesian3(b,s6);if(u=ei.rayEllipsoid(c,h),!l(u))return;let x=f.magnitude(c.origin)>p?u.start:u.stop,_=yn.getPoint(c,x,lxt),C=Vt.eastNorthUpToFixedFrame(a,i,iCe),V=Vt.eastNorthUpToFixedFrame(_,h,uxt),L=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=f.UNIT_Z,W=v.clone(r.transform,oCe);r._setTransform(V);let w=f.cross(_,r.positionWC,WO);if(f.dot(r.rightWC,w)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(G=void 0);let Z=r.constrainedAxis;r.constrainedAxis=void 0,fd(e,t,n,G,!0,!1),r.constrainedAxis=Z}else fd(e,t,n,G,!0,!1);if(r._setTransform(C),fd(e,t,n,G,!1,!0),l(r.constrainedAxis)){let g=f.cross(r.direction,r.constrainedAxis,WO);f.equalsEpsilon(g,f.ZERO,X.EPSILON6)||(f.dot(g,r.right)<0&&f.negate(g,g),f.cross(g,r.direction,r.up),f.cross(r.direction,r.up,r.right),f.normalize(r.up,r.up),f.normalize(r.right,r.right))}r._setTransform(W),e._globe=L,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let M=f.clone(r.positionWC,WO);if(e.enableCollisionDetection&&d6(e,!0),!f.equals(r.positionWC,M)){r._setTransform(V),r.worldToCameraCoordinatesPoint(M,M);let g=f.magnitudeSquared(M);f.magnitudeSquared(r.position)>g&&(f.normalize(r.position,r.position),f.multiplyByScalar(r.position,Math.sqrt(g),r.position));let Z=f.angleBetween(M,r.position),E=f.cross(M,r.position,M);f.normalize(E,E);let I=Pe.fromAxisAngle(E,Z,dxt),A=$.fromQuaternion(I,mxt);$.multiplyByVector(A,r.direction,r.direction),$.multiplyByVector(A,r.up,r.up),f.cross(r.direction,r.up,r.right),f.cross(r.right,r.direction,r.up),r._setTransform(W)}}var gxt=new B,yxt=new B,UTe=new yn,kTe=new yn,xxt=new f,_xt=new f;function hd(e,t,n,i){let r=e._scene.camera,s=gxt;s.x=n.startPosition.x,s.y=0;let a=yxt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,UTe),u=r.getPickRay(a,kTe),d=0,m,p;r.frustum instanceof un?(m=c.origin,p=u.origin,f.add(r.direction,m,m),f.add(r.direction,p,p),f.subtract(m,r.position,m),f.subtract(p,r.position,p),f.normalize(m,m),f.normalize(p,p)):(m=c.direction,p=u.direction);let b=f.dot(m,p);b<1&&(d=Math.acos(b)),d=n.startPosition.x>n.endPosition.x?-d:d;let h=e._horizontalRotationAxis;if(l(i)?r.look(i,-d):l(h)?r.look(h,-d):r.lookLeft(d),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,UTe),u=r.getPickRay(a,kTe),d=0,r.frustum instanceof un?(m=c.origin,p=u.origin,f.add(r.direction,m,m),f.add(r.direction,p,p),f.subtract(m,r.position,m),f.subtract(p,r.position,p),f.normalize(m,m),f.normalize(p,p)):(m=c.direction,p=u.direction),b=f.dot(m,p),b<1&&(d=Math.acos(b)),d=n.startPosition.y>n.endPosition.y?-d:d,i=y(i,h),l(i)){let x=r.direction,_=f.negate(i,xxt),C=f.equalsEpsilon(x,i,X.EPSILON2),V=f.equalsEpsilon(x,_,X.EPSILON2);if(!C&&!V){b=f.dot(x,i);let L=X.acosClamped(b);d>0&&d>L&&(d=L-X.EPSILON4),b=f.dot(x,_),L=X.acosClamped(b),d<0&&-d>L&&(d=-L+X.EPSILON4);let R=f.cross(i,x,_xt);r.look(R,d)}else(C&&d<0||V&&d>0)&&r.look(r.right,-d)}else r.lookUp(d)}function Sxt(e){Il(e,e.enableRotate,e.rotateEventTypes,txt,e.inertiaSpin,"_lastInertiaSpinMovement"),Il(e,e.enableZoom,e.zoomEventTypes,tCe,e.inertiaZoom,"_lastInertiaZoomMovement"),Il(e,e.enableTilt,e.tiltEventTypes,fxt,e.inertiaSpin,"_lastInertiaTiltMovement"),Il(e,e.enableLook,e.lookEventTypes,hd)}var Txt=new v,Cxt=new fe;function d6(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=y(n.ellipsoid,ie.WGS84),s=n.mapProjection,a,c;v.equals(o.transform,v.IDENTITY)||(a=v.clone(o.transform,Txt),c=f.magnitude(o.position),o._setTransform(v.IDENTITY));let u=Cxt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let d=!1;if(u.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance,b=m-e._lastGlobeHeight,h=b/e._lastGlobeHeight;u.height<p&&(t||Math.abs(h)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),d=!0),t||Math.abs(h)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=b*.1}}l(a)&&(o._setTransform(a),d&&(f.normalize(o.position,o.position),f.negate(o.position,o.direction),f.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),f.normalize(o.direction,o.direction),f.cross(o.direction,o.up,o.right),f.cross(o.right,o.direction,o.up)))}aM.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 Vxt=new f,Lxt=new f;aM.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;v.equals(t.transform,v.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ie.default)):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Tr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Tr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Tr.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=f.clone(t.positionWC,Vxt),c=f.clone(t.directionWC,Lxt);if(i===oe.SCENE2D?Cyt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=f.UNIT_Z,zyt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Sxt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!f.equals(a,t.positionWC)||!f.equals(c,t.directionWC);d6(this,u)}this._aggregator.reset()};aM.prototype.isDestroyed=function(){return!1};aM.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var cM=aM;var zJi=S(T(),1);var ZJi=S(T(),1),lM=`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 GJi=S(T(),1),uM=`uniform sampler2D colorTexture; -uniform float avgLuminance; -uniform float threshold; -uniform float offset; -in vec2 v_textureCoordinates; -float key(float avg) -{ -float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); -return max(0.0, guess) + 0.1; -} -void main() -{ -vec4 color = texture(colorTexture, v_textureCoordinates); -vec3 xyz = czm_RGBToXYZ(color.rgb); -float luminance = xyz.r; -float scaledLum = key(avgLuminance) * luminance / avgLuminance; -float brightLum = max(scaledLum - threshold, 0.0); -float brightness = brightLum / (offset + brightLum); -xyz.r = brightness; -out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); -} -`;function F0(){this._sceneFramebuffer=new ST;let e=.125,t=new Array(6);t[0]=new So({fragmentShader:hu,textureScale:e,forcePowerOfTwo:!0,sampleMode:md.LINEAR});let n=t[1]=new So({fragmentShader:uM,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new B,t[2]=new So({fragmentShader:ix,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 So({fragmentShader:ix,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 So({fragmentShader:hu,sampleMode:md.LINEAR}),this._uCenter=new B,this._uRadius=void 0,t[5]=new So({fragmentShader:lM,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new El({stages:t});let o=new GT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}F0.prototype.get=function(e){return this._stages.get(e)};F0.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 Zxt=new re,rCe=new B,Rxt=new B,sCe=new v;function Gxt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=v.computeViewportTransformation(n,0,1,sCe),u=v.multiplyByPoint(r,o,Zxt),d=Vt.pointToGLWindowCoordinates(s,c,o,rCe);u.x+=X.SOLAR_RADIUS;let m=Vt.pointToGLWindowCoordinates(a,c,u,u),p=B.magnitude(B.subtract(m,d,m))*30*2,b=Rxt;b.x=p,b.y=p,e._uCenter=B.clone(d,e._uCenter),e._uRadius=Math.max(b.x,b.y)*.15;let h=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,R=new Je;R.width=V,R.height=L,c=v.computeViewportTransformation(R,0,1,sCe),d=Vt.pointToGLWindowCoordinates(s,c,o,rCe),b.x*=V/h,b.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(d.x-b.x*.5,0),G.y=Math.max(d.y-b.y*.5,0),G.width=Math.min(b.x,h),G.height=Math.min(b.y,x);for(let W=1;W<4;++W)Je.clone(G,_.get(W).scissorRectangle)}F0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};F0.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),Gxt(this,t,n),o};F0.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)};F0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(hu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var dM=F0;var eQi=S(T(),1);function aCe(){this._cachedShowFrustumsShaders={}}function Ext(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Wxt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(d){d=De.replaceMain(d,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(d))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return d});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=Ext(i);return qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var mM=new Y;function Ixt(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=Y.fromRandom()),t._debugColor):Y.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(mM.red=t.debugOverlappingFrustums&1?1:0,mM.green=t.debugOverlappingFrustums&2?1:0,mM.blue=t.debugOverlappingFrustums&4?1:0,mM.alpha=1,mM):Y.WHITE}),n}var Xxt=new He;aCe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Wxt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=He.shallowClone(t,Xxt);r.shaderProgram=o,r.uniformMap=Ixt(e,t),r.execute(e.context,n)};var fM=aCe;var sQi=S(T(),1);function PT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Wn}PT.fromKeyframeNode=function(e,t,n,i){let o=new PT(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=Pxt(e,s,n),o._orientedBoundingBox=wxt(e,r,n,o._orientedBoundingBox),o};function Pxt(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=jt.getComponentCount(o[s]),u=t[s].slice(n*c,(n+1)*c);r[a]=u}return r}var cCe=new f,vxt=new f;function wxt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,d=f.fromElements(u,c,s,cCe),m=f.divideComponents(f.subtract(d,e._paddingBefore,cCe),e.dimensions,vxt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(PT.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()}}});PT.prototype.hasProperty=function(e){return l(this._metadata[e])};PT.prototype.getNames=function(){return Object.keys(this._metadata)};PT.prototype.getProperty=function(e){return this._metadata[e]};var hM=PT;var t7i=S(T(),1);var L4i=S(T(),1);var a4i=S(T(),1);var cQi=S(T(),1),pM=`struct Ray { -vec3 pos; -vec3 dir; -vec3 rawDir; -}; -#if defined(JITTER) -float hash(vec2 p) -{ -vec3 p3 = fract(vec3(p.xyx) * 50.0); -p3 += dot(p3, p3.yzx + 19.19); -return fract((p3.x + p3.y) * p3.z); -} -#endif -float minComponent(in vec3 v) { -return min(min(v.x, v.y), v.z); -} -float maxComponent(in vec3 v) { -return max(max(v.x, v.y), v.z); -} -struct PointJacobianT { -vec3 point; -mat3 jacobianT; -}; -`;var uQi=S(T(),1),bM=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops -#if defined(PICKING_VOXEL) -#define ALPHA_ACCUM_MAX 0.1 -#else -#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 -#endif -uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; -uniform float u_stepSize; -#if defined(PICKING) -uniform vec4 u_pickColor; -#endif -vec3 getSampleSize(in int level) { -vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions); -vec3 sampleSizeUv = 1.0 / sampleCount; -return scaleShapeUvToShapeSpace(sampleSizeUv); -} -#define MINIMUM_STEP_SCALAR (0.02) -#define SHIFT_FRACTION (0.001) -RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) { -vec3 voxelCoord = tileUv * vec3(u_dimensions); -vec3 directions = sign(sampleSizeAlongRay); -vec3 positiveDirections = max(directions, 0.0); -vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections); -vec3 exitCoord = entryCoord + directions; -vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay); -float lastEntry = maxComponent(distanceFromEntry); -bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry)); -vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions; -vec4 entry = vec4(entryNormal, lastEntry); -vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay); -float firstExit = minComponent(distanceToExit); -bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit)); -vec3 exitNormal = vec3(isFirstExit) * directions; -vec4 exit = vec4(exitNormal, firstExit); -return RayShapeIntersection(entry, exit); -} -vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) { -vec3 gradient = 2.0 * viewRay.rawDir * jacobianT; -vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; -RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); -vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz); -vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w); -vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry); -float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize; -float shift = fixedStep * SHIFT_FRACTION; -float dt = voxelIntersection.exit.w + shift; -if ((currentT + dt) > shapeIntersection.exit.w) { -dt = shapeIntersection.exit.w - currentT + shift; -} -float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); -return vec4(entry.xyz, stepSize); -} -vec2 packIntToVec2(int value) { -float shifted = float(value) / 255.0; -float lowBits = fract(shifted); -float highBits = floor(shifted) / 255.0; -return vec2(highBits, lowBits); -} -vec2 packFloatToVec2(float value) { -float lowBits = fract(value); -float highBits = floor(value) / 255.0; -return vec2(highBits, lowBits); -} -int getSampleIndex(in vec3 tileUv) { -ivec3 voxelDimensions = u_dimensions; -vec3 sampleCoordinate = tileUv * vec3(voxelDimensions); -vec3 maxCoordinate = vec3(voxelDimensions) - vec3(0.5); -sampleCoordinate = clamp(sampleCoordinate, vec3(0.0), maxCoordinate); -ivec3 sampleIndex = ivec3(floor(sampleCoordinate)); -#if defined(PADDING) -voxelDimensions += u_paddingBefore + u_paddingAfter; -sampleIndex += u_paddingBefore; -#endif -return sampleIndex.x + voxelDimensions.x * (sampleIndex.y + voxelDimensions.y * sampleIndex.z); -} -void main() -{ -vec4 fragCoord = gl_FragCoord; -vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); -vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); -vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); -vec3 viewPosUv = u_cameraPositionUv; -#if defined(SHAPE_ELLIPSOID) -vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv; -Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir); -#else -Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv); -#endif -Intersections ix; -RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); -if (shapeIntersection.entry.w == NO_HIT) { -discard; -} -float currentT = shapeIntersection.entry.w; -float endT = shapeIntersection.exit.w; -vec3 positionUv = viewPosUv + currentT * viewDirUv; -PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); -TraversalData traversalData; -SampleData sampleDatas[SAMPLE_COUNT]; -traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas); -vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); -#if defined(JITTER) -float noise = hash(screenCoord); -currentT += noise * step.w; -positionUv += noise * step.w * viewDirUv; -#endif -FragmentInput fragmentInput; -#if defined(STATISTICS) -setStatistics(fragmentInput.metadata.statistics); -#endif -vec4 colorAccum = vec4(0.0); -for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { -Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); -copyPropertiesToMetadata(properties, fragmentInput.metadata); -fragmentInput.voxel.positionUv = positionUv; -fragmentInput.voxel.positionShapeUv = pointJacobian.point; -fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; -fragmentInput.voxel.viewDirUv = viewDirUv; -fragmentInput.voxel.viewDirWorld = viewDirWorld; -fragmentInput.voxel.surfaceNormal = step.xyz; -fragmentInput.voxel.travelDistance = step.w; -fragmentInput.voxel.stepCount = stepCount; -fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex; -fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0].tileUv); -czm_modelMaterial materialOutput; -fragmentMain(fragmentInput, materialOutput); -vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); -color.rgb = max(color.rgb, vec3(0.0)); -color.a = clamp(color.a, 0.0, 1.0); -colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); -if (colorAccum.a > ALPHA_ACCUM_MAX) { -colorAccum.a = ALPHA_ACCUM_MAX; -break; -} -if (step.w == 0.0) { -step.w == 0.00001; -} -currentT += step.w; -positionUv = viewPosUv + currentT * viewDirUv; -if (currentT > endT) { -#if (INTERSECTION_COUNT == 1) -break; -#else -shapeIntersection = nextIntersection(ix); -if (shapeIntersection.entry.w == NO_HIT) { -break; -} else { -currentT = shapeIntersection.entry.w; -endT = shapeIntersection.exit.w; -positionUv = viewPosUv + currentT * viewDirUv; -} -#endif -} -pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); -traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas); -step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); -} -colorAccum.a /= ALPHA_ACCUM_MAX; -#if defined(PICKING) -if (colorAccum.a == 0.0) { -discard; -} -out_FragColor = u_pickColor; -#elif defined(PICKING_VOXEL) -if (colorAccum.a == 0.0) { -discard; -} -vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex); -vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0].tileUv)); -out_FragColor = vec4(megatextureId, sampleIndex); -#else -out_FragColor = colorAccum; -#endif -} -`;var mQi=S(T(),1),gM=`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 hQi=S(T(),1),yM=`#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -struct RayShapeIntersection { -vec4 entry; -vec4 exit; -}; -vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1) -{ -if (intersect0.w == NO_HIT) { -return intersect1; -} else if (intersect1.w == NO_HIT) { -return intersect0; -} -return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; -} -vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) -{ -return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; -} -RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) -{ -bool missed = (intersect0.entry.w == NO_HIT) || -(intersect1.entry.w == NO_HIT) || -(intersect0.exit.w < intersect1.entry.w) || -(intersect0.entry.w > intersect1.exit.w); -if (missed) { -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -return RayShapeIntersection(miss, miss); -} -vec4 entry = intersectionMax(intersect0.entry, intersect1.entry); -vec4 exit = intersectionMin(intersect0.exit, intersect1.exit); -return RayShapeIntersection(entry, exit); -} -struct Intersections { -vec4 intersections[INTERSECTION_COUNT * 2]; -#if (INTERSECTION_COUNT > 1) -int index; -int surroundCount; -bool surroundIsPositive; -#endif -}; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ -return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); -} -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) -{ -float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; -return vec4(intersection.xyz * scale, intersection.w); -} -#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) -#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) -#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter)) -#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) -#if (INTERSECTION_COUNT > 1) -void initializeIntersections(inout Intersections ix) { -const int sortPasses = INTERSECTION_COUNT * 2 - 1; -for (int n = sortPasses; n > 0; --n) { -for (int i = 0; i < sortPasses; ++i) { -if (i >= n) { break; } -vec4 intersect0 = ix.intersections[i + 0]; -vec4 intersect1 = ix.intersections[i + 1]; -bool inOrder = intersect0.w <= intersect1.w; -ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; -ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; -} -} -ix.index = 0; -ix.surroundCount = 0; -ix.surroundIsPositive = false; -} -#endif -#if (INTERSECTION_COUNT > 1) -RayShapeIntersection nextIntersection(inout Intersections ix) { -vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); -RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); -const int passCount = INTERSECTION_COUNT * 2; -if (ix.index == passCount) { -return shapeIntersection; -} -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; -} -ix.index = i + 1; -surfaceIntersection = ix.intersections[i]; -int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); -bool currShapeIsPositive = intersectionType < 2; -bool enter = intMod(intersectionType, 2) == 0; -ix.surroundCount += enter ? +1 : -1; -ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; -if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { -shapeIntersection.entry = surfaceIntersection; -} -bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; -bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; -if (exitPositive || enterNegativeFromPositive) { -shapeIntersection.exit = surfaceIntersection; -if (exitPositive) { -ix.index = passCount; -} -break; -} -} -return shapeIntersection; -} -#endif -`;var bQi=S(T(),1),xM=`uniform mat4 u_transformPositionViewToUv; -void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); -if (logDepthOrDepth != 0.0) { -vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); -eyeCoordinateDepth /= eyeCoordinateDepth.w; -vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); -float t = dot(depthPositionUv - ray.pos, ray.dir); -setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); -} else { -setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); -} -} -`;var yQi=S(T(),1),_M=`uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; -vec4 intersectPlane(in Ray ray, in vec4 plane) { -vec3 n = plane.xyz; -float w = plane.w; -float a = dot(ray.pos, n); -float b = dot(ray.dir, n); -float t = -(w + a) / b; -return vec4(n, t); -} -void intersectClippingPlanes(in Ray ray, inout Intersections ix) { -vec4 backSide = vec4(-ray.dir, -INF_HIT); -vec4 farSide = vec4(ray.dir, +INF_HIT); -RayShapeIntersection clippingVolume; -#if (CLIPPING_PLANES_COUNT == 1) -vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); -vec4 intersection = intersectPlane(ray, planeUv); -bool reflects = dot(ray.dir, intersection.xyz) < 0.0; -clippingVolume.entry = reflects ? backSide : intersection; -clippingVolume.exit = reflects ? intersection : farSide; -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); -#elif defined(CLIPPING_PLANES_UNION) -vec4 firstTransmission = vec4(ray.dir, +INF_HIT); -vec4 lastReflection = vec4(-ray.dir, -INF_HIT); -for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { -vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); -vec4 intersection = intersectPlane(ray, planeUv); -if (dot(ray.dir, planeUv.xyz) > 0.0) { -firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; -} else { -lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; -} -} -clippingVolume.entry = backSide; -clippingVolume.exit = lastReflection; -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); -clippingVolume.entry = firstTransmission; -clippingVolume.exit = farSide; -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); -#else // intersection -vec4 lastTransmission = vec4(ray.dir, -INF_HIT); -vec4 firstReflection = vec4(-ray.dir, +INF_HIT); -for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { -vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); -vec4 intersection = intersectPlane(ray, planeUv); -if (dot(ray.dir, planeUv.xyz) > 0.0) { -lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; -} else { -firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; -} -} -if (lastTransmission.w < firstReflection.w) { -clippingVolume.entry = lastTransmission; -clippingVolume.exit = firstReflection; -} else { -clippingVolume.entry = vec4(-ray.dir, NO_HIT); -clippingVolume.exit = vec4(ray.dir, NO_HIT); -} -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); -#endif -} -`;var _Qi=S(T(),1),eZ=`vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) { -float normalSign = positiveNormal ? 1.0 : -1.0; -vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign; -vec2 position = ray.pos.xy; -vec2 direction = ray.dir.xy; -float approachRate = dot(direction, planeNormal); -float distance = -dot(position, planeNormal); -float t = (approachRate == 0.0) -? NO_HIT -: distance / approachRate; -return vec4(planeNormal, 0.0, t); -} -RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) -{ -vec4 intersection = intersectLongitude(ray, angle, positiveNormal); -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0); -if (!hitFront) { -return RayShapeIntersection(intersection, farSide); -} else { -return RayShapeIntersection(-1.0 * farSide, intersection); -} -} -void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) -{ -intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false); -intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true); -} -bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) { -float normalSign = positiveNormal ? 1.0 : -1.0; -vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign; -vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy; -return dot(hit, planeDirection) > 0.0; -} -void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) { -vec4 intersection = intersectLongitude(ray, angle, true); -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -if (hitPositiveHalfPlane(ray, intersection, true)) { -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w); -intersections[1].entry = intersection; -intersections[1].exit = farSide; -} else { -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = farSide; -intersections[1].entry = miss; -intersections[1].exit = miss; -} -} -RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) -{ -vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); -vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); -bool inOrder = intersect1.w <= intersect2.w; -vec4 first = inOrder ? intersect1 : intersect2; -vec4 last = inOrder ? intersect2 : intersect1; -bool firstIsAhead = first.w >= 0.0; -bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0; -bool exitFromInside = firstIsAhead == startedInsideFirst; -bool lastIsAhead = last.w > 0.0; -bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0; -bool enterFromOutside = lastIsAhead == startedOutsideLast; -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -if (exitFromInside && enterFromOutside) { -return RayShapeIntersection(first, last); -} else if (!exitFromInside && enterFromOutside) { -return RayShapeIntersection(-1.0 * farSide, first); -} else if (exitFromInside && !enterFromOutside) { -return RayShapeIntersection(last, farSide); -} else { -return RayShapeIntersection(miss, miss); -} -} -`;var TQi=S(T(),1),SM=`uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; -RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound) -{ -vec3 t0 = (minBound - ray.pos) / ray.dir; -vec3 t1 = (maxBound - ray.pos) / ray.dir; -vec3 entries = min(t0, t1); -vec3 exits = max(t0, t1); -vec3 directions = sign(ray.dir); -float lastEntry = maxComponent(entries); -bvec3 isLastEntry = equal(entries, vec3(lastEntry)); -vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions; -vec4 entry = vec4(entryNormal, lastEntry); -float firstExit = minComponent(exits); -bvec3 isFirstExit = equal(exits, vec3(firstExit)); -vec3 exitNormal = vec3(isLastEntry) * directions; -vec4 exit = vec4(exitNormal, firstExit); -if (entry.w > exit.w) { -entry.w = NO_HIT; -exit.w = NO_HIT; -} -return RayShapeIntersection(entry, exit); -} -void intersectShape(in Ray ray, inout Intersections ix) -{ -RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); -setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); -} -`;var VQi=S(T(),1),TM=`uniform vec2 u_cylinderRenderRadiusMinMax; -uniform vec2 u_cylinderRenderHeightMinMax; -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) -uniform vec2 u_cylinderRenderAngleMinMax; -#endif -RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex) -{ -float zPosition = ray.pos.z; -float zDirection = ray.dir.z; -float tmin = (minMaxHeight.x - zPosition) / zDirection; -float tmax = (minMaxHeight.y - zPosition) / zDirection; -float signFlip = convex ? 1.0 : -1.0; -vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin); -vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax); -bool topEntry = zDirection < 0.0; -vec4 entry = topEntry ? intersectMax : intersectMin; -vec4 exit = topEntry ? intersectMin : intersectMax; -return RayShapeIntersection(entry, exit); -} -RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) -{ -vec2 position = ray.pos.xy; -vec2 direction = ray.dir.xy; -float a = dot(direction, direction); -float b = dot(position, direction); -float c = dot(position, position) - radius * radius; -float determinant = b * b - a * c; -if (determinant < 0.0) { -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -return RayShapeIntersection(miss, miss); -} -determinant = sqrt(determinant); -float t1 = (-b - determinant) / a; -float t2 = (-b + determinant) / a; -float signFlip = convex ? 1.0 : -1.0; -vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1); -vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2); -return RayShapeIntersection(intersect1, intersect2); -} -RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight) -{ -RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); -RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true); -return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); -} -void intersectShape(Ray ray, inout Intersections ix) -{ -ray.pos = ray.pos * 2.0 - 1.0; -ray.dir *= 2.0; -RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); -if (outerIntersect.entry.w == NO_HIT) { -return; -} -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) -RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); -setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) -RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); -#endif -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) -RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) -RayShapeIntersection wedgeIntersects[2]; -intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) -RayShapeIntersection wedgeIntersects[2]; -intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); -#endif -} -`;var ZQi=S(T(),1),CM=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) -uniform vec2 u_ellipsoidRenderLongitudeMinMax; -#endif -uniform float u_eccentricitySquared; -uniform vec2 u_ellipsoidRenderLatitudeSinMinMax; -uniform vec2 u_clipMinMaxHeight; -RayShapeIntersection intersectZPlane(in Ray ray, in float z) { -float t = -ray.pos.z / ray.dir.z; -bool startsOutside = sign(ray.pos.z) == sign(z); -bool entry = (t >= 0.0) != startsOutside; -vec4 intersect = vec4(0.0, 0.0, z, t); -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -if (entry) { -return RayShapeIntersection(intersect, farSide); -} else { -return RayShapeIntersection(-1.0 * farSide, intersect); -} -} -RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex) -{ -vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight); -vec3 position = ray.pos * radiiCorrection; -vec3 direction = ray.dir * radiiCorrection; -float a = dot(direction, direction); -float b = dot(direction, position); -float c = dot(position, position) - 1.0; -float determinant = b * b - a * c; -if (determinant < 0.0) { -vec4 miss = vec4(normalize(direction), NO_HIT); -return RayShapeIntersection(miss, miss); -} -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -float t1 = (-b - signB * determinant) / a; -float t2 = c / (a * t1); -float tmin = min(t1, t2); -float tmax = max(t1, t2); -float directionScale = convex ? 1.0 : -1.0; -vec3 d1 = directionScale * normalize(position + tmin * direction); -vec3 d2 = directionScale * normalize(position + tmax * direction); -return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax)); -} -vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) -{ -vec3 o = ray.pos; -vec3 d = ray.dir; -float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle; -float aSin = d.z * d.z * sinSqrHalfAngle; -float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle; -float a = aSin + aCos; -float bSin = d.z * o.z * sinSqrHalfAngle; -float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle; -float b = bSin + bCos; -float cSin = o.z * o.z * sinSqrHalfAngle; -float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle; -float c = cSin + cCos; -float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos; -if (determinant < 0.0) { -return vec2(NO_HIT); -} else if (a == 0.0) { -return (b == 0.0) -? vec2(NO_HIT) -: vec2(-0.5 * c / b, NO_HIT); -} -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -float t1 = (-b - signB * determinant) / a; -float t2 = c / (a * t1); -float tmin = min(t1, t2); -float tmax = max(t1, t2); -return vec2(tmin, tmax); -} -vec3 getConeNormal(in vec3 p, in bool convex) { -vec2 radial = -abs(p.z) * normalize(p.xy); -float zSign = (p.z < 0.0) ? -1.0 : 1.0; -float z = length(p.xy) * zSign; -float flip = (convex) ? -1.0 : 1.0; -return normalize(vec3(radial, z) * flip); -} -float getLatitudeConeShift(in float sinLatitude) { -float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; -float primeVerticalRadius = inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; -} -void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -ray.pos.z += getLatitudeConeShift(cosHalfAngle); -float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle; -vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = farSide; -intersections[1].entry = miss; -intersections[1].exit = miss; -if (intersect.x == NO_HIT) { -return; -} -float tmin = intersect.x; -float tmax = intersect.y; -vec3 p0 = ray.pos + tmin * ray.dir; -vec3 p1 = ray.pos + tmax * ray.dir; -vec4 intersect0 = vec4(getConeNormal(p0, true), tmin); -vec4 intersect1 = vec4(getConeNormal(p1, true), tmax); -bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); -bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); -if (p0InShadowCone && p1InShadowCone) { -} else if (p0InShadowCone) { -intersections[0].exit = intersect1; -} else if (p1InShadowCone) { -intersections[0].entry = intersect0; -} else { -intersections[0].exit = intersect0; -intersections[1].entry = intersect1; -intersections[1].exit = farSide; -} -} -RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -ray.pos.z += getLatitudeConeShift(cosHalfAngle); -float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle; -vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); -vec4 miss = vec4(normalize(ray.dir), NO_HIT); -vec4 farSide = vec4(normalize(ray.dir), INF_HIT); -if (intersect.x == NO_HIT) { -return RayShapeIntersection(miss, miss); -} -float tmin = intersect.x; -float tmax = intersect.y; -vec3 p0 = ray.pos + tmin * ray.dir; -vec3 p1 = ray.pos + tmax * ray.dir; -vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); -vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); -bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); -bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); -if (p0InShadowCone && p1InShadowCone) { -return RayShapeIntersection(miss, miss); -} else if (p0InShadowCone) { -return RayShapeIntersection(intersect1, farSide); -} else if (p1InShadowCone) { -return RayShapeIntersection(-1.0 * farSide, intersect0); -} else { -return RayShapeIntersection(intersect0, intersect1); -} -} -void intersectShape(in Ray ray, inout Intersections ix) { -ray.pos = ray.pos * 2.0 - 1.0; -ray.dir *= 2.0; -RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); -if (outerIntersect.entry.w == NO_HIT) { -return; -} -RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); -if (innerIntersect.entry.w == NO_HIT) { -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); -} else { -innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w); -innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w); -setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); -} -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) -RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) -RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) -RayShapeIntersection bottomConeIntersections[2]; -intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]); -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) -RayShapeIntersection topConeIntersections[2]; -intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) -RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) -RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) -RayShapeIntersection wedgeIntersects[2]; -intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) -RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); -#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) -RayShapeIntersection wedgeIntersects[2]; -intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); -#endif -} -`;var GQi=S(T(),1),vT=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { -intersectShape(ray, ix); -RayShapeIntersection intersection = getFirstIntersection(ix); -if (intersection.entry.w == NO_HIT) { -return intersection; -} -#if defined(CLIPPING_PLANES) -intersectClippingPlanes(ray, ix); -#endif -#if defined(DEPTH_TEST) -intersectDepth(screenCoord, ray, ix); -#endif -#if (INTERSECTION_COUNT > 1) -initializeIntersections(ix); -for (int i = 0; i < INTERSECTION_COUNT; ++i) { -intersection = nextIntersection(ix); -if (intersection.exit.w > 0.0) { -intersection.entry.w = max(intersection.entry.w, 0.0); -break; -} -} -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; -} -`;var WQi=S(T(),1),VM=`#if defined(BOX_HAS_SHAPE_BOUNDS) -uniform vec3 u_boxUvToShapeUvScale; -uniform vec3 u_boxUvToShapeUvTranslate; -#endif -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -return PointJacobianT(positionUv, mat3(0.5)); -} -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else -return positionShape; -#endif -} -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; -} -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif -} -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return shapeUv / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif -} -`;var XQi=S(T(),1),LM=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) -uniform vec2 u_cylinderUvToShapeUvRadius; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -uniform vec2 u_cylinderUvToShapeUvHeight; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -uniform vec2 u_cylinderUvToShapeUvAngle; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) -uniform vec2 u_cylinderShapeUvAngleMinMax; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) -uniform float u_cylinderShapeUvAngleRangeZeroMid; -#endif -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -vec3 position = positionUv * 2.0 - 1.0; -float radius = length(position.xy); -vec3 radial = normalize(vec3(position.xy, 0.0)); -float height = positionUv.z; -vec3 z = vec3(0.0, 0.0, 1.0); -float angle = atan(position.y, position.x); -vec3 east = normalize(vec3(-position.y, position.x, 0.0)); -vec3 point = vec3(radius, height, angle); -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 height = positionShape.y; -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; -#endif -float angle = (positionShape.z + czm_pi) / czm_twoPi; -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) -angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) -angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; -#elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) -angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; -#endif -angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; -#endif -return vec3(radius, height, angle); -} -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 height = shapeUv.y; -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -height /= u_cylinderUvToShapeUvHeight.x; -#endif -float angle = shapeUv.z * czm_twoPi; -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -angle /= u_cylinderUvToShapeUvAngle.x; -#endif -return vec3(radius, height, angle); -} -`;var vQi=S(T(),1),ZM=`uniform vec3 u_ellipsoidRadiiUv; -uniform vec2 u_evoluteScale; -uniform vec3 u_ellipsoidInverseRadiiSquaredUv; -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) -uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -uniform vec2 u_ellipsoidUvToShapeUvLongitude; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -uniform vec2 u_ellipsoidUvToShapeUvLatitude; -#endif -uniform float u_ellipsoidInverseHeightDifferenceUv; -vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { -vec2 p = abs(pos); -vec2 inverseRadii = 1.0 / radii; -vec2 tTrigs = vec2(0.7071067811865476); -vec2 v = radii * tTrigs; -vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; -const int iterations = 3; -for (int i = 0; i < iterations; ++i) { -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; -} -return vec3(v * sign(pos), length(v - evolute)); -} -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -vec3 position = positionUv * 2.0 - 1.0; -position = position * u_ellipsoidRadiiUv; -float longitude = atan(position.y, position.x); -vec3 east = normalize(vec3(-position.y, position.x, 0.0)); -float distanceFromZAxis = length(position.xy); -vec2 posEllipse = vec2(distanceFromZAxis, position.z); -vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz); -vec2 surfacePoint = surfacePointAndRadius.xy; -vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz); -float latitude = atan(normal2d.y, normal2d.x); -vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x)); -float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0; -float height = heightSign * length(posEllipse - surfacePoint); -vec3 up = normalize(cross(east, north)); -vec3 point = vec3(longitude, latitude, height); -mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up); -return PointJacobianT(point, jacobianT); -} -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -float longitude = (positionShape.x + czm_pi) / czm_twoPi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) -longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) -longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; -#endif -#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) -longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; -#endif -float latitude = (positionShape.y + czm_piOverTwo) / czm_pi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; -#endif -float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv; -return vec3(longitude, latitude, height); -} -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; -} -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -float longitude = shapeUv.x * czm_twoPi; -#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -longitude /= u_ellipsoidUvToShapeUvLongitude.x; -#endif -float latitude = shapeUv.y * czm_pi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -latitude /= u_ellipsoidUvToShapeUvLatitude.x; -#endif -float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv; -return vec3(longitude, latitude, height); -} -`;var FQi=S(T(),1),RM=`#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 -struct OctreeNodeData { -int data; -int flag; -}; -struct TraversalData { -ivec4 octreeCoords; -int parentOctreeIndex; -}; -struct SampleData { -int megatextureIndex; -ivec4 tileCoords; -vec3 tileUv; -#if (SAMPLE_COUNT > 1) -float weight; -#endif -}; -int intMod(in int a, in int b) { -return a - (b * (a / b)); -} -int normU8_toInt(in float value) { -return int(value * 255.0); -} -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { -return float(normU8x2_toInt(value)) / 65535.0; -} -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { -vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -OctreeNodeData data; -data.data = normU8x2_toInt(texData.xy); -data.flag = normU8x2_toInt(texData.zw); -return data; -} -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { -int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; -int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; -int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; -vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); -return getOctreeNodeData(octreeUv); -} -int getOctreeParentIndex(in int octreeIndex) { -int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; -int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; -vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); -vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); -int parentOctreeIndex = normU8x2_toInt(parentData.xy); -return parentOctreeIndex; -} -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -float dimAtLevel = exp2(float(octreeCoords.w)); -return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); -} -vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -vec3 tileUv = getTileUv(shapePosition, octreeCoords); -return clamp(tileUv, vec3(0.0), vec3(1.0)); -} -void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { -sampleData.megatextureIndex = data.data; -sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) -? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) -: octreeCoords; -} -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { -int leafIndex = data.data; -int leafNodeTexelCount = 2; -float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; -float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; -vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); -vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); -float lerp = normU8x2_toFloat(leafData0.xy); -sampleDatas[0].weight = 1.0 - lerp; -sampleDatas[1].weight = lerp; -sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) -? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) -: octreeCoords; -sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) -? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) -: octreeCoords; -vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); -vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); -sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); -sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); -} -#endif -OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { -float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w)); -vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; -vec3 end = start + vec3(sizeAtLevel); -OctreeNodeData childData; -for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { -vec3 center = 0.5 * (start + end); -vec3 childCoord = step(center, shapePosition); -ivec4 octreeCoords = traversalData.octreeCoords; -traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); -childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); -if (childData.flag != OCTREE_FLAG_INTERNAL) { -break; -} -start = mix(start, center, childCoord); -end = mix(center, end, childCoord); -traversalData.parentOctreeIndex = childData.data; -} -return childData; -} -void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { -traversalData.octreeCoords = ivec4(0); -traversalData.parentOctreeIndex = 0; -OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); -if (nodeData.flag != OCTREE_FLAG_LEAF) { -nodeData = traverseOctreeDownwards(shapePosition, traversalData); -} -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords); -#else -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords); -sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords); -#endif -} -bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { -return clamp(v, minVal, maxVal) == v; -} -bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { -vec3 tileUv = getTileUv(shapePosition, octreeCoords); -bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); -return inside || octreeCoords.w == 0; -} -void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { -if (insideTile(shapePosition, traversalData.octreeCoords)) { -for (int i = 0; i < SAMPLE_COUNT; i++) { -sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords); -} -return; -} -for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { -traversalData.octreeCoords.xyz /= 2; -traversalData.octreeCoords.w -= 1; -if (insideTile(shapePosition, traversalData.octreeCoords)) { -break; -} -traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); -} -OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords); -#else -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords); -sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords); -#endif -} -`;var MQi=S(T(),1),GM=`uniform ivec2 u_megatextureSliceDimensions; -uniform ivec2 u_megatextureTileDimensions; -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; -uniform ivec3 u_dimensions; -#if defined(PADDING) -uniform ivec3 u_paddingBefore; -uniform ivec3 u_paddingAfter; -#endif -int intMin(int a, int b) { -return a <= b ? a : b; -} -int intMax(int a, int b) { -return a >= b ? a : b; -} -int intClamp(int v, int minVal, int maxVal) { -return intMin(intMax(v, minVal), maxVal); -} -vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) -{ -int indexX = intMod(index, dimensions.x); -int indexY = index / dimensions.x; -return vec2(indexX, indexY) * uvScale; -} -Properties getPropertiesFromMegatexture(in SampleData sampleData) { -int tileIndex = sampleData.megatextureIndex; -vec3 voxelCoord = sampleData.tileUv * vec3(u_dimensions); -ivec3 voxelDimensions = u_dimensions; -#if defined(PADDING) -voxelDimensions += u_paddingBefore + u_paddingAfter; -voxelCoord += vec3(u_paddingBefore); -#endif -#if defined(NEAREST_SAMPLING) -voxelCoord = floor(voxelCoord) + vec3(0.5); -#endif -vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -float slice = voxelCoord.z - 0.5; -int sliceIndex = int(floor(slice)); -int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); -vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); -vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; -#if defined(NEAREST_SAMPLING) -return getPropertiesFromMegatextureAtUv(uv0); -#else -float sliceLerp = fract(slice); -int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); -vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); -vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; -Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); -Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); -return mixProperties(properties0, properties1, sliceLerp); -#endif -} -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { -#if (SAMPLE_COUNT == 1) -return getPropertiesFromMegatexture(sampleDatas[0]); -#else -Properties properties = clearProperties(); -for (int i = 0; i < SAMPLE_COUNT; ++i) { -float weight = sampleDatas[i].weight; -if (weight > 0.0) { -Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); -tempProperties = scaleProperties(tempProperties, weight); -properties = sumProperties(properties, tempProperties); -} -} -return properties; -#endif -} -`;function Fxt(e){let t=new H_;this.shaderBuilder=t;let n=e._customShader,i=ft(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let b=o[p];t.addUniform(b.type,p,_e.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",_e.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([gM]),t.addFragmentLines([n.fragmentShaderText,"#line 0",RM,pM,yM,GM]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,_e.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,_e.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,_e.FRAGMENT),t.addFragmentLines([_M])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,_e.FRAGMENT),t.addFragmentLines([xM]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([VM,SM,vT]):a==="CYLINDER"?t.addFragmentLines([LM,eZ,TM,vT]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,_e.FRAGMENT),t.addFragmentLines([ZM,eZ,CM,vT])),t.addFragmentLines([bM]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let b=u[p];l(b)&&(b=b===!0?void 0:b,t.addDefine(p,b,_e.FRAGMENT))}let d=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",d,_e.FRAGMENT),s===1?d+=1:r.unionClippingRegions?d+=2:d+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",d,_e.FRAGMENT),d+=1),t.addDefine("INTERSECTION_COUNT",d,_e.FRAGMENT),(!f.equals(e.paddingBefore,f.ZERO)||!f.equals(e.paddingAfter,f.ZERO))&&t.addDefine("PADDING",void 0,_e.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,_e.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,_e.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,_e.FRAGMENT);let m=e._traversal;t.addDefine("SAMPLE_COUNT",`${m._sampleCount}`,_e.FRAGMENT)}var EM=Fxt;var m4i=S(T(),1);function Axt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,_e.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,_e.FRAGMENT);for(let P=0;P<c;P++){let F=i[P],M=o[P],g=`PropertyStatistics_${F}`,Z=`PropertyStatistics_${F}`;n.addStruct(g,Z,_e.FRAGMENT);let E=PO(M);n.addStructField(g,E,"min"),n.addStructField(g,E,"max")}let d="Statistics",m="Statistics",p="statistics";n.addStruct(d,m,_e.FRAGMENT);for(let P=0;P<c;P++){let F=i[P],M=`PropertyStatistics_${F}`,g=F;n.addStructField(d,M,g)}let b="Metadata",h="Metadata",x="metadata";n.addStruct(b,h,_e.FRAGMENT),n.addStructField(b,m,p);for(let P=0;P<c;P++){let F=i[P],M=o[P],g=PO(M);n.addStructField(b,g,F)}for(let P=0;P<c;P++){let F=i[P],M=o[P],g=Nxt(M),Z=`VoxelProperty_${F}`,E=`VoxelProperty_${F}`;n.addStruct(Z,E,_e.FRAGMENT),n.addStructField(Z,g,"partialDerivativeLocal"),n.addStructField(Z,g,"partialDerivativeWorld"),n.addStructField(Z,g,"partialDerivativeView"),n.addStructField(Z,g,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,_e.FRAGMENT);for(let P=0;P<c;P++){let F=i[P],M=`VoxelProperty_${F}`;n.addStructField(_,M,F)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",_e.FRAGMENT),n.addStructField(L,h,x),n.addStructField(L,C,V);let G="Properties",W="Properties",w="properties";n.addStruct(G,W,_e.FRAGMENT);for(let P=0;P<c;P++){let F=i[P],M=o[P],g=PO(M);n.addStructField(G,g,F)}{let P="clearProperties";n.addFunction(P,`${W} clearProperties()`,_e.FRAGMENT),n.addFunctionLines(P,[`${W} ${w};`]);for(let F=0;F<c;F++){let M=i[F],g=o[F],Z=r[F],E=PO(g,Z);n.addFunctionLines(P,[`${w}.${M} = ${E}(0.0);`])}n.addFunctionLines(P,[`return ${w};`])}{let P="sumProperties";n.addFunction(P,`${W} sumProperties(${W} propertiesA, ${W} propertiesB)`,_e.FRAGMENT),n.addFunctionLines(P,[`${W} ${w};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(P,[`${w}.${M} = propertiesA.${M} + propertiesB.${M};`])}n.addFunctionLines(P,[`return ${w};`])}{let P="scaleProperties";n.addFunction(P,`${W} scaleProperties(${W} ${w}, float scale)`,_e.FRAGMENT),n.addFunctionLines(P,[`${W} scaledProperties = ${w};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(P,[`scaledProperties.${M} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${W} mixProperties(${W} propertiesA, ${W} propertiesB, float mixFactor)`,_e.FRAGMENT),n.addFunctionLines(P,[`${W} ${w};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(P,[`${w}.${M} = mix(propertiesA.${M}, propertiesB.${M}, mixFactor);`])}n.addFunctionLines(P,[`return ${w};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${W} ${w}, inout ${h} ${x})`,_e.FRAGMENT);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(P,[`${x}.${M} = ${w}.${M};`])}}if(u){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${m} ${p})`,_e.FRAGMENT);for(let F=0;F<c;F++){let M=i[F],g=o[F],Z=jt.getComponentCount(g);for(let E=0;E<Z;E++){let I=Uxt(g,E),A=s[F][E],N=a[F][E];n.addFunctionLines(P,[`${p}.${M}.min${I} = ${lCe(A)};`,`${p}.${M}.max${I} = ${lCe(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${W} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,_e.FRAGMENT),n.addFunctionLines(P,[`${W} ${w};`]);for(let F=0;F<c;F++){let M=i[F],g=o[F],Z=r[F],E=Mxt(g,Z);n.addFunctionLines(P,[`properties.${M} = texture(u_megatextureTextures[${F}], texcoord)${E};`])}n.addFunctionLines(P,[`return ${w};`])}}function PO(e){if(e===jt.SCALAR)return"float";if(e===jt.VEC2)return"vec2";if(e===jt.VEC3)return"vec3";if(e===jt.VEC4)return"vec4"}function Mxt(e){if(e===jt.SCALAR)return".r";if(e===jt.VEC2)return".ra";if(e===jt.VEC3)return".rgb";if(e===jt.VEC4)return""}function Nxt(e){if(e===jt.SCALAR)return"vec3";if(e===jt.VEC2)return"mat2";if(e===jt.VEC3)return"mat3";if(e===jt.VEC4)return"mat4"}function lCe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Uxt(e,t){return e===jt.SCALAR?"":`[${t}]`}var WM=Axt;function kxt(e,t){let n=new EM(e);WM(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=T0(o,t),L=0,R=V.indexOf(")")+1,G=V.indexOf("{",R)+1,W=V.indexOf("}",G),w=V.slice(L,R),P=V.slice(G,W);i.addFunction(C,w,_e.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,_e.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,_e.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),d=a.buildShaderProgram(t),m=Oe.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:hn.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),b=e._depthTest,h=new He({vertexArray:p,primitiveType:Ae.TRIANGLES,renderState:m,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ze.VOXELS,executeInClosestFrustum:!0,owner:this,cull:b,occlude:b}),x=He.shallowClone(h,new He);x.shaderProgram=u,x.pickOnly=!0;let _=He.shallowClone(h,new He);if(_.shaderProgram=d,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=h,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var IM=kxt;var cji=S(T(),1);var v4i=S(T(),1);function pu(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ae,this.boundTransform=new v,this.shapeTransform=new v,this._minBounds=f.clone(pu.DefaultMinBounds,new f),this._maxBounds=f.clone(pu.DefaultMaxBounds,new f),this.shaderUniforms={renderMinBounds:new f,renderMaxBounds:new f,boxUvToShapeUvScale:new f,boxUvToShapeUvTranslate:new f},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Dxt=new f,m6=new f,Bxt=new $,Oxt=new f,Yxt=new f,Kxt=new f,zxt=new f,uCe=v.fromRotationTranslation($.fromUniformScale(.5,new $),new f(.5,.5,.5),new v);pu.prototype.update=function(e,t,n,i,o){i=y(i,pu.DefaultMinBounds),o=y(o,pu.DefaultMaxBounds);let r=pu.DefaultMinBounds,s=pu.DefaultMaxBounds;t=this._minBounds=f.clamp(t,r,s,this._minBounds),n=this._maxBounds=f.clamp(n,r,s,this._maxBounds),i=f.clamp(i,r,s,Oxt),o=f.clamp(o,r,s,Yxt);let a=f.clamp(t,i,o,Kxt),c=f.clamp(n,i,o,zxt),u=v.getScale(e,m6);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||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=v.clone(e,this.shapeTransform),this.orientedBoundingBox=h6(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=v.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:d,shaderDefines:m}=this;for(let h in m)m.hasOwnProperty(h)&&(m[h]=void 0);let p=!f.equals(t,r)||!f.equals(n,s),b=0;if(m.BOX_INTERSECTION_INDEX=b,b+=1,d.renderMinBounds=v.multiplyByPoint(uCe,a,d.renderMinBounds),d.renderMaxBounds=v.multiplyByPoint(uCe,c,d.renderMaxBounds),p){m.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,x=n;d.boxUvToShapeUvScale=f.fromElements(2/(h.x===x.x?1:x.x-h.x),2/(h.y===x.y?1:x.y-h.y),2/(h.z===x.z?1:x.z-h.z),d.boxUvToShapeUvScale),d.boxUvToShapeUvTranslate=f.fromElements(-d.boxUvToShapeUvScale.x*(h.x*.5+.5),-d.boxUvToShapeUvScale.y*(h.y*.5+.5),-d.boxUvToShapeUvScale.z*(h.z*.5+.5),d.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=b,!0};var vO=new f,f6=new f;pu.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=f.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),vO),u=f.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)),f6);return h6(c,u,this.shapeTransform,o)};var dCe=new f;pu.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=f.divideComponents(f.ONE,t,dCe),s=f.multiplyByScalar(r,o,dCe),a=f.multiplyByScalar(f.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,vO),o,vO),c=f.add(a,s,f6),u=this._minBounds,d=this._maxBounds,m=f.fromElements(X.lerp(u.x,d.x,a.x),X.lerp(u.y,d.y,a.y),X.lerp(u.z,d.z,a.z),vO),p=f.fromElements(X.lerp(u.x,d.x,c.x),X.lerp(u.y,d.y,c.y),X.lerp(u.z,d.z,c.z),f6);return h6(m,p,this.shapeTransform,i)};pu.DefaultMinBounds=Object.freeze(new f(-1,-1,-1));pu.DefaultMaxBounds=Object.freeze(new f(1,1,1));function h6(e,t,n,i){let o=pu.DefaultMinBounds,r=pu.DefaultMaxBounds;if(f.equals(e,o)&&f.equals(t,r))i.center=v.getTranslation(n,i.center),i.halfAxes=v.getMatrix3(n,i.halfAxes);else{let a=v.getScale(n,m6),c=f.midpoint(e,t,Dxt);i.center=v.multiplyByPoint(n,c,i.center),a=f.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),m6);let u=v.getRotation(n,Bxt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var gp=pu;var Y4i=S(T(),1);function ls(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ae,this.boundTransform=new v,this.shapeTransform=new v,this._minimumRadius=ls.DefaultMinBounds.x,this._maximumRadius=ls.DefaultMaxBounds.x,this._minimumHeight=ls.DefaultMinBounds.y,this._maximumHeight=ls.DefaultMaxBounds.y,this._minimumAngle=ls.DefaultMinBounds.z,this._maximumAngle=ls.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new B,cylinderRenderRadiusMinMax:new B,cylinderRenderAngleMinMax:new B,cylinderUvToShapeUvRadius:new B,cylinderUvToShapeUvHeight:new B,cylinderUvToShapeUvAngle:new B,cylinderShapeUvAngleMinMax:new B,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 pCe=new f;ls.prototype.update=function(e,t,n,i,o){i=y(i,ls.DefaultMinBounds),o=y(o,ls.DefaultMaxBounds);let r=ls.DefaultMinBounds.x,s=ls.DefaultMaxBounds.x,a=ls.DefaultMinBounds.y,c=ls.DefaultMaxBounds.y,u=ls.DefaultMinBounds.z,d=ls.DefaultMaxBounds.z,m=d-u,p=.5*m,b=X.EPSILON10,h=X.EPSILON3,x=X.EPSILON10,_=X.clamp(t.x,r,s),C=X.clamp(n.x,r,s),V=X.clamp(i.x,r,s),L=X.clamp(o.x,r,s),R=Math.max(_,V),G=Math.min(C,L),W=X.clamp(t.y,a,c),w=X.clamp(n.y,a,c),P=X.clamp(i.y,a,c),F=X.clamp(o.y,a,c),M=Math.max(W,P),g=Math.min(w,F),Z=X.negativePiToPi(t.z),E=X.negativePiToPi(n.z),I=X.negativePiToPi(i.z),A=X.negativePiToPi(o.z),N=Math.max(Z,I),D=Math.min(E,A),k=v.getScale(e,pCe);if(G===0||R>G||M>g||X.equalsEpsilon(k.x,0,void 0,b)||X.equalsEpsilon(k.y,0,void 0,b)||X.equalsEpsilon(k.z,0,void 0,b))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=W,this._maximumHeight=w,this._minimumAngle=Z,this._maximumAngle=E,this.shapeTransform=v.clone(e,this.shapeTransform),this.orientedBoundingBox=b6(R,G,M,g,N,D,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=v.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let j=_===r&&C===s,K=W===a&&w===c,te=E<Z,z=E-Z+te*m,q=z>p+x&&z<m-x,ee=z<p-x,pe=z>=p-x&&z<=p+x,xe=q||ee||pe,ce=X.equalsEpsilon(Z,u,void 0,h),ye=X.equalsEpsilon(E,d,void 0,h),Te=R===r,Le=D<N,Xe=D-N+Le*m,Re=Xe>=p-x&&Xe<m-x,Ne=Xe>x&&Xe<p-x,yt=Xe<=x,Nt=Re||Ne||yt,{shaderUniforms:pt,shaderDefines:Be}=this;for(let qe in Be)Be.hasOwnProperty(qe)&&(Be[qe]=void 0);let et=0;if(Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=et,et+=1,Te||(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=et,et+=1),pt.cylinderRenderRadiusMinMax=B.fromElements(R,G,pt.cylinderRenderRadiusMinMax),R===G&&(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!j){Be.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let qe=C-_,$e=0,Kt=1;qe!==0&&($e=1/qe,Kt=-_/qe),pt.cylinderUvToShapeUvRadius=B.fromElements($e,Kt,pt.cylinderUvToShapeUvRadius)}if(!K){Be.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let qe=w-W,$e=0,Kt=1;qe!==0&&($e=2/qe,Kt=-(W+1)/qe),pt.cylinderUvToShapeUvHeight=B.fromElements($e,Kt,pt.cylinderUvToShapeUvHeight)}if(pt.cylinderRenderHeightMinMax=B.fromElements(M,g,pt.cylinderRenderHeightMinMax),te&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Nt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Be.CYLINDER_INTERSECTION_INDEX_ANGLE=et,Re?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,et+=1):Ne?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,et+=2):yt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,et+=2),pt.cylinderRenderAngleMinMax=B.fromElements(N,D,pt.cylinderRenderAngleMinMax)),xe){Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ce&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ye&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let qe=(Z-u)/m,$e=(E-u)/m,Kt=1-z/m;if(pt.cylinderShapeUvAngleMinMax=B.fromElements(qe,$e,pt.cylinderShapeUvAngleMinMax),pt.cylinderShapeUvAngleRangeZeroMid=($e+.5*Kt)%1,z<=x)pt.cylinderUvToShapeUvAngle=B.fromElements(0,1,pt.cylinderUvToShapeUvAngle);else{let ge=m/z,Ve=-(Z-u)/z;pt.cylinderUvToShapeUvAngle=B.fromElements(ge,Ve,pt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=et,!0};ls.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,d=this._maximumAngle,m=1/Math.pow(2,e),p=X.lerp(r,s,t*m),b=X.lerp(r,s,(t+1)*m),h=X.lerp(a,c,n*m),x=X.lerp(a,c,(n+1)*m),_=X.lerp(u,d,i*m),C=X.lerp(u,d,(i+1)*m);return b6(p,b,h,x,_,C,this.shapeTransform,o)};var mCe=new f,fCe=new f,Hxt=new f;ls.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=f.divideComponents(f.ONE,t,mCe),s=f.multiplyByScalar(r,o,mCe),a=f.multiplyByScalar(f.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,fCe),o,fCe),c=f.add(a,s,Hxt),u=this._minimumRadius,d=this._maximumRadius,m=this._minimumHeight,p=this._maximumHeight,b=this._minimumAngle,h=this._maximumAngle,x=X.lerp(u,d,a.x),_=X.lerp(u,d,c.x),C=X.lerp(m,p,a.y),V=X.lerp(m,p,c.y),L=X.lerp(b,h,a.z),R=X.lerp(b,h,c.z);return b6(x,_,C,V,L,R,this.shapeTransform,i)};ls.DefaultMinBounds=Object.freeze(new f(0,-1,-X.PI));ls.DefaultMaxBounds=Object.freeze(new f(1,1,+X.PI));var Jxt=5,Qxt=new Array(Jxt),jxt=new f,qxt=new $,$xt=new v,e_t=new v,t_t=new v,p6=new v,n_t=new f,i_t=new f,o_t=new f,bCe=new Array(8);for(let e=0;e<8;e++)bCe[e]=new f;function hCe(e,t,n){return Math.abs(re.dot(e,t))<n}function r_t(e){let t=v.getColumn(e,0,n_t),n=v.getColumn(e,1,i_t),i=v.getColumn(e,2,o_t),o=X.EPSILON4;return hCe(t,n,o)&&hCe(n,i,o)}function s_t(e,t){let n=bCe;f.fromElements(-.5,-.5,-.5,n[0]),f.fromElements(-.5,-.5,.5,n[1]),f.fromElements(-.5,.5,-.5,n[2]),f.fromElements(-.5,.5,.5,n[3]),f.fromElements(.5,-.5,-.5,n[4]),f.fromElements(.5,-.5,.5,n[5]),f.fromElements(.5,.5,-.5,n[6]),f.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)v.multiplyByPoint(e,n[i],n[i]);return Wn.fromPoints(n,t)}function b6(e,t,n,i,o,r,s,a){let c=ls.DefaultMinBounds,u=ls.DefaultMaxBounds,d=c.x,m=u.x,p=c.y,b=u.y,h=c.z,x=u.z;if(e===d&&t===m&&n===p&&i===b&&o===h&&r===x)return a.center=v.getTranslation(s,a.center),a.halfAxes=v.getMatrix3(s,a.halfAxes),a;r<o&&(r+=X.TWO_PI);let C=r-o,V=o+C*.5,L=Qxt,R=0;L[R++]=o,L[R++]=r,L[R++]=V,C>X.PI&&(L[R++]=V-X.PI_OVER_TWO,L[R++]=V+X.PI_OVER_TWO);let G=1,W=1,w=-1,P=-1;for(let te=0;te<R;++te){let z=L[te]-V,q=Math.cos(z),ee=Math.sin(z),pe=q*e,xe=ee*e,ce=q*t,ye=ee*t;G=Math.min(G,pe),W=Math.min(W,xe),G=Math.min(G,ce),W=Math.min(W,ye),w=Math.max(w,pe),P=Math.max(P,xe),w=Math.max(w,ce),P=Math.max(P,ye)}let F=w-G,M=P-W,g=i-n,Z=(G+w)*.5,E=(W+P)*.5,I=(n+i)*.5,A=f.fromElements(Z,E,I,jxt),N=$.fromRotationZ(V,qxt),D=f.fromElements(F,M,g,pCe),k=v.fromScale(D,t_t),O=v.fromRotation(N,e_t),U=v.fromTranslation(A,$xt),j=v.multiplyTransformation(O,v.multiplyTransformation(U,k,p6),p6),K=v.multiplyTransformation(s,j,p6);return r_t(K)?Wn.fromTransformation(K,a):s_t(K,a)}var yp=ls;var iji=S(T(),1);function A0(){this.orientedBoundingBox=new Wn,this.boundingSphere=new ae,this.boundTransform=new v,this.shapeTransform=new v,this._rectangle=new le,this._minimumHeight=A0.DefaultMinBounds.z,this._maximumHeight=A0.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new f,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new f,eccentricitySquared:0,evoluteScale:new B,ellipsoidInverseRadiiSquaredUv:new f,ellipsoidRenderLongitudeMinMax:new B,ellipsoidShapeUvLongitudeMinMaxMid:new f,ellipsoidUvToShapeUvLongitude:new B,ellipsoidUvToShapeUvLatitude:new B,ellipsoidRenderLatitudeSinMinMax:new B,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new B},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 a_t=new f,c_t=new f,l_t=new f,u_t=new f,d_t=new f,m_t=new f,f_t=new f,h_t=new f,p_t=new $,gCe=new f,yCe=new f,b_t=new le;A0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=A0;i=y(i,r),o=y(o,s);let a=X.EPSILON10,c=X.EPSILON3,u=X.EPSILON10,d=X.EPSILON10,m=X.EPSILON3,p=v.getScale(e,h_t),b=f.clone(r,a_t);b.z=-f.minimumComponent(p);let h=f.clamp(t,b,s,c_t),x=f.clamp(n,b,s,l_t),_=f.clamp(i,b,s,u_t),C=f.clamp(o,b,s,d_t),V=f.maximumByComponent(h,_,m_t),L=f.minimumByComponent(x,C,f_t),R=f.add(p,f.fromElements(x.z,x.z,x.z,gCe),gCe),G=f.maximumComponent(R),W=f.add(p,f.fromElements(L.z,L.z,L.z,yCe),yCe);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||X.equalsEpsilon(W,f.ZERO,void 0,a))return!1;this._rectangle=le.fromRadians(h.x,h.y,x.x,x.y),this._translation=v.getTranslation(e,this._translation),this._rotation=v.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=h.z,this._maximumHeight=x.z;let w=le.fromRadians(V.x,V.y,L.x,L.y,b_t);this.orientedBoundingBox=g6(w,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=v.fromRotationTranslation($.setScale(this._rotation,R,p_t),this._translation,this.shapeTransform),this.boundTransform=v.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,F=.5*P,M=L.x<V.x,g=L.x-V.x+M*P,Z=g<=u,E=g>=F-u&&g<P-u,I=g>u&&g<F-u,A=Z||E||I,N=x.x<h.x,D=x.x-h.x+N*P,k=D>F+u&&D<P-u,O=D>=F-u&&D<=F+u,U=D<F-u,j=k||O||U,K=L.y<-m,te=L.y>=-m&&L.y<=+m,z=L.y>+m&&L.y<s.y-d,q=K||te||z,ee=V.y>r.y+d&&V.y<-m,pe=V.y>=-m&&V.y<=+m,xe=V.y>+m,ce=ee||pe||xe,ye=q||ce,Te=x.y-h.y,Le=x.y<-m,Xe=x.y>=-m&&x.y<=+m,Re=x.y>+m&&x.y<s.y-d,Ne=Le||Xe||Re,yt=h.y>r.y+d&&h.y<-m,Nt=h.y>=-m&&h.y<=+m,pt=h.y>+m,et=Ne||(yt||Nt||pt),{shaderUniforms:qe,shaderDefines:$e}=this;for(let fi in $e)$e.hasOwnProperty(fi)&&($e[fi]=void 0);qe.ellipsoidRadiiUv=f.divideByScalar(R,G,qe.ellipsoidRadiiUv);let{x:Kt,z:ge}=qe.ellipsoidRadiiUv,Ve=ge/Kt;qe.eccentricitySquared=1-Ve*Ve,qe.evoluteScale=B.fromElements((Kt*Kt-ge*ge)/Kt,(ge*ge-Kt*Kt)/ge,qe.evoluteScale),qe.ellipsoidInverseRadiiSquaredUv=f.divideComponents(f.ONE,f.multiplyComponents(qe.ellipsoidRadiiUv,qe.ellipsoidRadiiUv,qe.ellipsoidInverseRadiiSquaredUv),qe.ellipsoidInverseRadiiSquaredUv);let Ht=0;$e.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ht,Ht+=1,$e.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ht,Ht+=1,qe.clipMinMaxHeight=B.fromElements((V.z-x.z)/G,(L.z-x.z)/G,qe.clipMinMaxHeight);let xt=(x.z-h.z)/G;if(qe.ellipsoidInverseHeightDifferenceUv=1/xt,h.z===x.z&&(qe.ellipsoidInverseHeightDifferenceUv=0),A&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,$e.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ht,E?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ht+=1):I?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ht+=2):Z&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ht+=2),qe.ellipsoidRenderLongitudeMinMax=B.fromElements(V.x,L.x,qe.ellipsoidRenderLongitudeMinMax)),j)if($e.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<h.x&&($e.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),D<=u)qe.ellipsoidUvToShapeUvLongitude=B.fromElements(0,1,qe.ellipsoidUvToShapeUvLongitude);else{let vo=P/D,Ms=-(h.x-r.x)/D;qe.ellipsoidUvToShapeUvLongitude=B.fromElements(vo,Ms,qe.ellipsoidUvToShapeUvLongitude)}if(A){let fi=X.equalsEpsilon(V.x,r.x,void 0,c),vo=X.equalsEpsilon(L.x,s.x,void 0,c);fi&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),vo&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Ms=(h.x-r.x)/P,sa=(x.x-r.x)/P,Jr=(L.x-r.x)/P,Qr=1-g/P,Ye=(Jr+.5*Qr)%1;qe.ellipsoidShapeUvLongitudeMinMaxMid=f.fromElements(Ms,sa,Ye,qe.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ce&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,$e.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ht,ee?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ht+=1):pe?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ht+=1):xe&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ht+=2)),q&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,$e.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ht,K?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ht+=2):te?($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ht+=1):z&&($e.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ht+=1)),qe.ellipsoidRenderLatitudeSinMinMax=B.fromElements(Math.sin(V.y),Math.sin(L.y),qe.ellipsoidRenderLatitudeSinMinMax)),et)if($e.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Te<d)qe.ellipsoidUvToShapeUvLatitude=B.fromElements(0,1,qe.ellipsoidUvToShapeUvLatitude);else{let vo=(s.y-r.y)/Te,Ms=(r.y-h.y)/Te;qe.ellipsoidUvToShapeUvLatitude=B.fromElements(vo,Ms,qe.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ht,!0};var SCe=new le;A0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,d=i*r,m=(i+1)*r,p=le.subsection(this._rectangle,s,c,a,u,SCe),b=X.lerp(this._minimumHeight,this._maximumHeight,d),h=X.lerp(this._minimumHeight,this._maximumHeight,m);return g6(p,b,h,this._ellipsoid,this._translation,this._rotation,o)};var xCe=new f,_Ce=new f,g_t=new f;A0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=f.divideComponents(f.ONE,t,xCe),s=f.multiplyByScalar(r,o,xCe),a=f.multiplyByScalar(f.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,_Ce),o,_Ce),c=f.add(a,s,g_t),u=le.subsection(this._rectangle,a.x,a.y,c.x,c.y,SCe),d=X.lerp(this._minimumHeight,this._maximumHeight,a.z),m=X.lerp(this._minimumHeight,this._maximumHeight,c.z);return g6(u,d,m,this._ellipsoid,this._translation,this._rotation,i)};function g6(e,t,n,i,o,r,s){return s=Wn.fromRectangle(e,t,n,i,s),s.center=f.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}A0.DefaultMinBounds=Object.freeze(new f(-X.PI,-X.PI_OVER_TWO,-ie.WGS84.minimumRadius));A0.DefaultMaxBounds=Object.freeze(new f(X.PI,X.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var wT=A0;var pd={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};pd.getMinBounds=function(e){switch(e){case pd.BOX:return gp.DefaultMinBounds;case pd.ELLIPSOID:return wT.DefaultMinBounds;case pd.CYLINDER:return yp.DefaultMinBounds}};pd.getMaxBounds=function(e){switch(e){case pd.BOX:return gp.DefaultMaxBounds;case pd.ELLIPSOID:return wT.DefaultMaxBounds;case pd.CYLINDER:return yp.DefaultMaxBounds}};pd.getShapeConstructor=function(e){switch(e){case pd.BOX:return gp;case pd.ELLIPSOID:return wT;case pd.CYLINDER:return yp}};var Fi=Object.freeze(pd);var r8i=S(T(),1);var uji=S(T(),1),TCe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function wO(e,t){this.spatialNode=e,this.keyframe=t,this.state=TCe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}wO.priorityComparator=function(e,t){return e.priority-t.priority};wO.searchComparator=function(e,t){return e.keyframe-t.keyframe};wO.LoadState=TCe;var eo=wO;var Wji=S(T(),1);function rx(e,t,n,i,o){i===dn.UNSIGNED_SHORT&&(i=dn.FLOAT32);let r=e.floatingPointTexture;if(i===dn.FLOAT32&&!r)throw new ue("Floating point texture not supported");let s;i===dn.FLOAT32||i===dn.FLOAT64?s=ze.FLOAT:i===dn.UINT8&&(s=ze.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?nt.RED:nt.LUMINANCE:n===2?a=e.webgl2?nt.RG:nt.LUMINANCE_ALPHA:n===3?a=nt.RGB:n===4&&(a=nt.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let d=Mt.maximumTextureSize,m=dn.getSizeInBytes(i),p=Math.floor(o/(n*m)),b=Math.min(d,X.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),h=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/h),_=h*t.x,C=x*t.y,V=Math.floor(b/_),L=Math.floor(b/C);if(V===0||L===0)throw new ue("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=f.clone(t,new f),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new B(V,L),this.voxelCountPerRegion=new B(_,C),this.sliceCountPerRegion=new B(h,x),this.voxelSizeUv=new B(1/b,1/b),this.sliceSizeUv=new B(t.x/b,t.y/b),this.regionSizeUv=new B(_/b,C/b),this.texture=new bt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:b,height:b,sampler:new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR,magnificationFilter:ni.LINEAR})});let R=dn.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(R,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new y_t(G);for(let G=0;G<this.maximumTileCount;G++){let W=this.nodes[G];W.previousNode=G>0?this.nodes[G-1]:void 0,W.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function y_t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}rx.prototype.add=function(e){if(this.isFull())throw new he("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};rx.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("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--};rx.prototype.isFull=function(){return this.emptyList===void 0};rx.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===dn.UNSIGNED_SHORT&&(i=dn.FLOAT32);let o=dn.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,d=X.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(d/c),b=Math.floor(d/u);if(p*b>=e)break;d*=2}return d*d*n*o};rx.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let R=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let W=0;W<s;W++)a[G*s+W]=n[R*s+W]}}let c=this.regionCountPerMegatexture,u=r.x,d=r.y,m=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,h={source:{arrayBufferView:a,width:u,height:d},xOffset:m,yOffset:p};this.texture.copyFrom(h)};rx.prototype.isDestroyed=function(){return!1};rx.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var tZ=rx;var Uji=S(T(),1);function Gm(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=f.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Wn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var x_t=new f;Gm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,x_t),n=2*f.maximumComponent(t);this.approximateVoxelSize=n/f.minimumComponent(this.dimensions)};Gm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,d=a+1,m=t+1,p=[[m,r,s,a],[m,u,s,a],[m,r,c,a],[m,u,c,a],[m,r,s,d],[m,u,s,d],[m,r,c,d],[m,u,c,d]];this.children=p.map(([b,h,x,_])=>new Gm(b,h,x,_,this,e,this.dimensions))};Gm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Gm.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 CCe={keyframe:0};function XM(e,t){return CCe.keyframe=e,wo(t,CCe,eo.searchComparator)}Gm.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:m}=t;if(m.length>=1){let p=__t(i,m),b=m[p],h=o===i||i<b.keyframe?p:Math.min(p+1,m.length-1),x=m[h],_=i-b.keyframe,C=VCe(n-t.level,_);C<a&&(a=C,r=b);let V=x.keyframe-o,L=VCe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,d=s.keyframe;this.renderableKeyframeNodeLerp=u===d?0:X.clamp((e-u)/(d-u),0,1)};function __t(e,t){let n=XM(e,t);return n<0?X.clamp(~n-1,0,t.length-1):n}function VCe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Gm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Gm.prototype.createKeyframeNode=function(e){let t=XM(e,this.keyframeNodes);if(t<0){t=~t;let n=new eo(this,e);this.keyframeNodes.splice(t,0,n)}};Gm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=XM(n,this.keyframeNodes);if(i<0)throw new he("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=XM(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=eo.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Gm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==eo.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new he("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=eo.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=XM(e.keyframe,n);if(i>=0)throw new he("Keyframe already renderable");i=~i,n.splice(i,0,e)};Gm.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 PM=Gm;function M0(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let h=0;h<i.length;h++){let x=i[h],_=jt.getComponentCount(x),C=o[h];this.megatextures[h]=new tZ(t,n,_,C,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new PM(0,0,0,0,void 0,c,n),this._priorityQueue=new iT({maximumLength:a,comparator:eo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,y6(u,1,r-2,0);let d=9,m=2048,p=Math.floor(m/d),b=Math.ceil(a/p);this.internalNodeTexture=new bt({context:t,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:b,sampler:new Qt({minificationFilter:Ft.NEAREST,magnificationFilter:ni.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new B(1/m,1/b),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new B}M0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function y6(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,y6(e,t,o-1,i+1),y6(e,o+1,n,i+1)}M0.simultaneousRequestCountMaximum=50;M0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,d=a>1,m=(u?2:1)*(d?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new bt({context:r,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new Qt({minificationFilter:Ft.NEAREST,magnificationFilter:ni.NEAREST})}),this.leafNodeTexelSizeUv=B.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&&LCe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Si();C_t(this,e);let h=Si();Z_t(this,m,c);let x=Si();if(this._debugPrint){let _=h-b,C=x-h,V=x-b;L_t(this,_,C,V)}};M0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};M0.prototype.isDestroyed=function(){return!1};M0.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.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),de(this)};function LCe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];LCe(e,i)}}function S_t(e,t){if(e._simultaneousRequestCount>=M0.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let u=n.types.length;if(!l(c))t.state=eo.LoadState.UNAVAILABLE;else if(c===eo.LoadState.FAILED)t.state=eo.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==u)t.state=eo.LoadState.FAILED;else{let d=e.megatextures;for(let m=0;m<u;m++){let{voxelCountPerTile:p,channelCount:b}=d[m],{x:h,y:x,z:_}=p,C=h*x*_,V=c[m],L=C*b;if(V.length===L)t.metadata[m]=V,t.state=eo.LoadState.RECEIVED;else{t.state=eo.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=eo.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=eo.LoadState.RECEIVING,a.then(i).catch(o)):t.state=eo.LoadState.FAILED}function T_t(e){return e/(1+e)}function C_t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=X.clamp(Math.floor(e._keyframeLocation),0,a-2),u=c+1,{camera:d,context:m,pixelRatio:p}=t,{positionWC:b,frustum:h}=d,_=m.drawingBufferHeight/p/h.sseDenominator;function C(M,g){if(M.computeScreenSpaceError(b,_),g=M.visibility(t,g),g===bs.MASK_OUTSIDE)return;if(M.visitedFrameNumber=n,a===1)M.createKeyframeNode(0);else if(M.keyframeNodes.length!==a)for(let N=0;N<a;N++)M.createKeyframeNode(N);let{screenSpaceError:Z,keyframeNodes:E}=M,I=T_t(Z),A=!1;for(let N=0;N<E.length;N++){let D=E[N];D.priority=10*I+V_t(c,D.keyframe,u,e),D.state!==eo.LoadState.UNAVAILABLE&&D.state!==eo.LoadState.FAILED&&D.priority!==-Number.MAX_VALUE&&s.insert(D),D.state===eo.LoadState.LOADED&&(A=!0)}if(Z<r||!A){M.children=void 0;return}l(M.children)||M.constructChildNodes(o);for(let N=0;N<8;N++){let D=M.children[N];C(D,g)}}s.reset(),C(e.rootNode,bs.MASK_INDETERMINATE);let V=e._highPriorityKeyframeNodes,L=0,R;for(;s.length>0;)R=s.removeMaximum(),R.highPriorityFrameNumber=n,V[L]=R,L++;let G=e._keyframeNodesInMegatexture,W=e.megatextures[0],w=W.occupiedCount;G.length=w,G.sort(function(M,g){return M.highPriorityFrameNumber===g.highPriorityFrameNumber?g.priority-M.priority:g.highPriorityFrameNumber-M.highPriorityFrameNumber});let P=0,F=0;for(let M=0;M<L;M++)if(R=V[M],!(R.state===eo.LoadState.LOADED||R.spatialNode===void 0)&&(R.state===eo.LoadState.UNLOADED&&S_t(e,R),R.state===eo.LoadState.RECEIVED)){let g=0;if(W.isFull()){g=w-1-P,P++;let Z=G[g];Z.spatialNode.destroyKeyframeNode(Z,e.megatextures)}else g=w+F,F++;R.spatialNode.addKeyframeNodeToMegatextures(R,e.megatextures),G[g]=R}}function V_t(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 L_t(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(eo.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function d(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let R=V[L],G=R.keyframe,W=R.state;a[W][G]+=1,c[W]+=1,u++}if(l(C.children))for(let L=0;L<8;L++){let R=C.children[L];d(R)}}d(r);let m=`KEYFRAMES: ${a[eo.LoadState.LOADED]}`,p=`UNLOADED: ${c[eo.LoadState.UNLOADED]} | RECEIVING: ${c[eo.LoadState.RECEIVING]} | RECEIVED: ${c[eo.LoadState.RECEIVED]} | LOADED: ${c[eo.LoadState.LOADED]} | FAILED: ${c[eo.LoadState.FAILED]} | UNAVAILABLE: ${c[eo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,b=Math.round(t*100)/100,h=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${b} | OCT: ${h} | ALL: ${x}`;console.log(`${m} || ${p} || ${_}`)}var FO={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Z_t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],d=[];function m(b,h,x,_,C){let V=!1;if(l(b.children))for(let L=0;L<8;L++){let R=b.children[L];R.computeSurroundingRenderableKeyframeNodes(o),R.isRenderable(r)&&(V=!0)}if(V){u[C]=FO.INTERNAL<<16|h,u[x]=_,a++,_=h,C=_*9+1;for(let L=0;L<8;L++){let R=b.children[L];h=a,x=h*9+0,m(R,h,x,_,C+L)}}else{if(s){let L=c*5,R=b.renderableKeyframeNodePrevious,G=b.level-R.spatialNode.level,W=R.spatialNode.parent,w=l(W)?W.renderableKeyframeNodePrevious:R,P=R_t(b,i,n),F=G,M=1,g=R.megatextureIndex,Z=w.megatextureIndex;d[L+0]=P,d[L+1]=F,d[L+2]=M,d[L+3]=g,d[L+4]=Z,u[C]=FO.LEAF<<16|c}else{let L=b.renderableKeyframeNodePrevious,G=b.level-L.spatialNode.level===0?FO.LEAF:FO.PACKED_LEAF_FROM_PARENT;u[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),G_t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&E_t(d,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function R_t(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 G_t(e,t,n,i){let o=nt.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 m=0;m<e.length;m++){let p=e[m],b=m*o;for(let h=0;h<o;h++)c[b+h]=p>>>h*8&255}let d={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(d)}function E_t(e,t,n,i){let o=nt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let b=e[p*r+0],h=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=X.clamp(Math.floor(65536*b),0,65535);u[p*8+0]=V>>>0&255,u[p*8+1]=V>>>8&255,u[p*8+2]=h&255,u[p*8+3]=x&255,u[p*8+4]=_>>>0&255,u[p*8+5]=_>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let m={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}M0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=jt.getComponentCount(a);o+=tZ.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var nZ=M0;var G8i=S(T(),1);var a8i=S(T(),1),W_t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},iZ=Object.freeze(W_t);var y8i=S(T(),1);function oZ(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}oZ.prototype.getTexture=function(e){return this._textures[e]};function I_t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}oZ.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):I_t(this,e,t)};function X_t(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?AO(o,r,n):P_t(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function AO(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?RCe(e,n):new bt({context:n,source:t,sampler:o});return ZCe(o)&&r.generateMipmap(),r}function P_t(e,t,n){let{typedArray:i,sampler:o}=e,r=ZCe(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,u=[a,c].every(X.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let m=Jw(i,a,c),p=Wg(m);return AO({sampler:o},p,n)}}else{let m=Wg(t);return AO(e,m,n)}else return AO(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."),RCe(e,n)}function ZCe(e){return[Ft.NEAREST_MIPMAP_NEAREST,Ft.NEAREST_MIPMAP_LINEAR,Ft.LINEAR_MIPMAP_NEAREST,Ft.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function RCe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new bt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}oZ.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];X_t(this,o,t)}n.length=0};oZ.prototype.isDestroyed=function(){return!1};oZ.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return de(this)};var vM=oZ;function wM(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,Lb.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Bg.INHERIT),this._textureManager=new vM,this._defaultTexture=void 0,this.uniformMap=v_t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},A_t(this),M_t(this)}function v_t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===iZ.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=w_t(e,i)):n[i]=F_t(e,i)}return n}function w_t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function F_t(e,t){return function(){return e.uniforms[t].value}}function FT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function A_t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,FT(r,t,o),o=e.usedVariablesVertex.featureIdSet,FT(r,n,o),o=e.usedVariablesVertex.metadataSet,FT(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,FT(s,t,o),o=e.usedVariablesFragment.featureIdSet,FT(s,n,o),o=e.usedVariablesFragment.metadataSet,FT(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;FT(s,a,c)}}function GCe(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 Yc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${GCe(t)} is not available in the ${i} shader. Did you mean ${GCe(n)} instead?`;throw new he(o)}}function M_t(e){let t=e.usedVariablesVertex.attributeSet;Yc(t,"position","positionMC","vertex"),Yc(t,"normal","normalMC","vertex"),Yc(t,"tangent","tangentMC","vertex"),Yc(t,"bitangent","bitangentMC","vertex"),Yc(t,"positionWC","positionMC","vertex"),Yc(t,"positionEC","positionMC","vertex"),Yc(t,"normalEC","normalMC","vertex"),Yc(t,"tangentEC","tangentMC","vertex"),Yc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Yc(n,"position","positionEC","fragment"),Yc(n,"normal","normalEC","fragment"),Yc(n,"tangent","tangentEC","fragment"),Yc(n,"bitangent","bitangentEC","fragment"),Yc(n,"normalMC","normalEC","fragment"),Yc(n,"tangentMC","tangentEC","fragment"),Yc(n,"bitangentMC","bitangentEC","fragment")}wM.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===iZ.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};wM.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};wM.prototype.isDestroyed=function(){return!1};wM.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var AT=wM;function xp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,xp.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new f,this._paddingAfter=new f,this._minBounds=new f,this._minBoundsOld=new f,this._maxBounds=new f,this._maxBoundsOld=new f,this._exaggeratedMinBounds=new f,this._exaggeratedMinBoundsOld=new f,this._exaggeratedMaxBounds=new f,this._exaggeratedMaxBoundsOld=new f,this._minClippingBounds=new f,this._minClippingBoundsOld=new f,this._maxClippingBounds=new f,this._maxClippingBoundsOld=new f,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._exaggeratedModelMatrix=v.clone(this._modelMatrix),this._compoundModelMatrix=new v,this._compoundModelMatrixOld=new v,this._customShader=y(e.customShader,xp.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 v,this._transformPositionUvToWorld=new v,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._jitter=!1,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new df,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new B,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new B,megatextureTextures:[],megatextureSliceDimensions:new B,megatextureTileDimensions:new B,megatextureVoxelSizeUv:new B,megatextureSliceSizeUv:new B,megatextureTileSizeUv:new B,dimensions:new f,paddingBefore:new f,paddingAfter:new f,transformPositionViewToUv:new v,transformPositionUvToView:new v,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new f,ndcSpaceAxisAlignedBoundingBox:new re,clippingPlanesTexture:void 0,clippingPlanesMatrix:new v,stepSize:0,pickColor:new Y},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;N_t(this,i)}function N_t(e,t){let{shape:n,minBounds:i=Fi.getMinBounds(n),maxBounds:o=Fi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Fi.getMinBounds(n),e.maxClippingBounds=Fi.getMaxBounds(n),e._exaggeratedMinBounds=f.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=f.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=v.clone(e._modelMatrix,e._exaggeratedModelMatrix),WCe(e,t);let r=Fi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=ICe(e,e._shape,t)}Object.defineProperties(xp.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=v.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},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)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=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=f.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=f.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=f.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=f.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.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=xp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var U_t=new f,k_t=new re,D_t=new re,B_t=new f,O_t=new f,Y_t=new $,K_t=new $,z_t=new v,H_t=new v,J_t=new v,Q_t=v.fromRotationTranslation($.fromUniformScale(.5,new $),new f(.5,.5,.5),new v),j_t=v.fromRotationTranslation($.fromUniformScale(2,new $),new f(-1,-1,-1),new v);xp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){iSt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}tSt(this,e);let i=WCe(this,t),o=this._shape;if(i&&(this._shapeVisible=ICe(this,o,t),sSt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=aSt(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&&pSt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),cSt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,d=this._uniforms;l(u)&&(d.octreeLeafNodeTexture=s.leafNodeTexture,d.octreeLeafNodeTexelSizeUv=B.clone(s.leafNodeTexelSizeUv,d.octreeLeafNodeTexelSizeUv),d.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(IM(this,n),this._shaderDirty=!1);let m=n.uniformState.viewProjection,p=o.orientedBoundingBox,b=dSt(p,m,D_t);if(b.x===1||b.y===1||b.z===-1||b.w===-1)return;d.ndcSpaceAxisAlignedBoundingBox=re.clone(b,d.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;d.transformPositionViewToUv=v.multiplyTransformation(this._transformPositionWorldToUv,x,d.transformPositionViewToUv);let _=n.uniformState.view;d.transformPositionUvToView=v.multiplyTransformation(_,this._transformPositionUvToWorld,d.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;d.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,d.transformDirectionViewToLocal),d.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,d.transformNormalLocalToWorld);let V=e.camera.positionWC;d.cameraPositionUv=v.multiplyByPoint(this._transformPositionWorldToUv,V,d.cameraPositionUv),d.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var q_t=new f,x6=new f,$_t=new fe,eSt=new f;function tSt(e,t){if(e._exaggeratedMinBounds=f.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=f.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Fi.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 if(e.shape===Fi.BOX){let n=f.fromElements(1,1,t.verticalExaggeration,q_t);e._exaggeratedModelMatrix=v.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=v.multiplyByTranslation(e._exaggeratedModelMatrix,nSt(e,t),e._exaggeratedModelMatrix)}}function nSt(e,t){let{shapeTransform:n=v.IDENTITY,globalTransform:i=v.IDENTITY}=e._provider,o=v.getTranslation(n,x6),r=v.multiplyByPoint(e._modelMatrix,o,x6),s=v.multiplyByPoint(i,r,x6),c=ie.WGS84.cartesianToCartographic(s,$_t),u=0;l(c)&&(u=c.height);let d=Tr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return f.fromElements(0,0,(d-u)/t.verticalExaggeration,eSt)}function iSt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=Y.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ue(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=f.clone(t.dimensions,i.dimensions),e._paddingBefore=f.clone(y(t.paddingBefore,f.ZERO),e._paddingBefore),i.paddingBefore=f.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=f.clone(y(t.paddingAfter,f.ZERO),e._paddingBefore),i.paddingAfter=f.clone(e._paddingAfter,i.paddingAfter),e._traversal=oSt(e,t,n),rSt(e._traversal,i)}function WCe(e,t){let n=y(t.shapeTransform,v.IDENTITY),i=y(t.globalTransform,v.IDENTITY);return v.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),v.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),MT(e,"_compoundModelMatrix","_compoundModelMatrixOld")+MT(e,"_minBounds","_minBoundsOld")+MT(e,"_maxBounds","_maxBoundsOld")+MT(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+MT(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+MT(e,"_minClippingBounds","_minClippingBoundsOld")+MT(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function MT(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function ICe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=v.inverse(o,z_t),s=v.getRotation(o,Y_t),a=v.getScale(o,B_t),c=f.maximumComponent(a),u=f.divideByScalar(a,c,O_t),d=$.multiplyByScale(s,u,K_t);return e._transformPositionWorldToUv=v.multiplyTransformation(Q_t,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=v.multiplyTransformation(o,j_t,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=v.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(d,e._transformNormalLocalToWorld),!0}function oSt(e,t,n){let i=f.clone(t.dimensions,U_t);f.add(i,e._paddingBefore,i),f.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?nZ.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new nZ(e,n,i,t.types,t.componentTypes,s,r)}function rSt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=B.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=B.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=B.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=B.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=B.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=B.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function sSt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ue(n,!0)),i}function aSt(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=ne.secondsDifference(i.stop,i.start),a=ne.secondsDifference(n,i.start)/r;return o+a}function cSt(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=v.transpose(v.multiplyTransformation(v.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)}xp.prototype.isDestroyed=function(){return!1};xp.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._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),de(this)};var ECe=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)),lSt=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),uSt=new Array(new re,new re,new re,new re,new re,new re,new re,new re);function dSt(e,t,n){let i=v.fromRotationTranslation(e.halfAxes,e.center,H_t),o=v.multiply(t,i,J_t),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,d=uSt,m=ECe.length;for(u=0;u<m;u++)v.multiplyByVector(o,ECe[u],d[u]);for(u=0;u<m;u++){let p=d[u];if(p.z>=-p.w){let b=p.x/p.w,h=p.y/p.w;r=Math.min(r,b),s=Math.max(s,b),a=Math.min(a,h),c=Math.max(c,h)}else for(let b=0;b<3;b++){let h=lSt[u*3+b],x=d[h];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=re.lerp(p,x,V,k_t),R=L.x/L.w,G=L.y/L.w;r=Math.min(r,R),s=Math.max(s,R),a=Math.min(a,G),c=Math.max(c,G)}}}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 _6=3e7,mSt=new f(_6,0,0),fSt=new f(0,_6,0),hSt=new f(0,0,_6);function pSt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,d,m){i.add({positions:[c,u],width:m,material:Yi.fromType("Color",{color:d})})}function r(c,u,d){let m=c.computeCorners();o(m[0],m[1],u,d),o(m[2],m[3],u,d),o(m[4],m[5],u,d),o(m[6],m[7],u,d),o(m[0],m[2],u,d),o(m[4],m[6],u,d),o(m[1],m[3],u,d),o(m[5],m[7],u,d),o(m[0],m[4],u,d),o(m[2],m[6],u,d),o(m[1],m[5],u,d),o(m[3],m[7],u,d)}function s(c){if(!n.isRenderable(c))return;let u=c.level,m=Math.max(1,5/Math.pow(2,u)),b=[Y.RED,Y.LIME,Y.BLUE][u%3];if(r(c.orientedBoundingBox,b,m),l(c.children))for(let h=0;h<8;h++)s(c.children[h])}r(e._shape.orientedBoundingBox,Y.WHITE,5),s(n.rootNode);let a=10;o(f.ZERO,mSt,Y.RED,a),o(f.ZERO,fSt,Y.LIME,a),o(f.ZERO,hSt,Y.BLUE,a),i.update(t)}xp.DefaultCustomShader=new AT({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) -{ - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function XCe(){this.ready=!0,this.shape=Fi.BOX,this.dimensions=new f(1,1,1),this.names=["data"],this.types=[jt.SCALAR],this.componentTypes=[dn.FLOAT32],this.maximumTileCount=1}XCe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};xp.DefaultProvider=new XCe;var sx=xp;var NO=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function pi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ue(e.contextOptions),r=l(n),s=new Nw(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=Nn(),this._jobScheduler=new CA,this._frameState=new SA(s,new hA(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new Pw(s),this._ellipsoid=y(e.ellipsoid,ie.default),this._globe=void 0,this._globeTranslucencyState=new TA,this._primitives=new nu,this._groundPrimitives=new nu,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=pi.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new IT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new gA(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ri({color:new Y,stencil:0,owner:this}),this._depthClearCommand=new ri({depth:1,owner:this}),this._stencilClearCommand=new ri({stencil:0}),this._classificationStencilClearCommand=new ri({stencil:0,renderState:Oe.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new oM(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 fM,this._msaaSamples=y(e.msaaSamples,1),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=Y.clone(Y.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Gi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new sA,this.fog=new _A,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(lo.DEFAULT_VIEW_RECTANGLE=le.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new lo(this),this.shadowMap=new X0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=Y.clone(Y.WHITE),this._actualInvertClassificationColor=Y.clone(this._invertClassificationColor),this._invertClassification=new JL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new nM,this._brdfLutGenerator=new cA,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new cM(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,fu.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=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=fc.requestCompletedEvent.addEventListener(NO(this)),this._removeTaskProcessorListenerCallback=di.taskCompletedEvent.addEventListener(NO(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Je(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 vA(this),this._defaultView=new VT(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._specularEnvironmentMapAtlas=void 0,this.light=new h0,FCe(this,0,ne.now()),this.updateFrameState(),this.initializeFrame()}pi.defaultLogDepthBuffer=!0;function bSt(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(NO(e))),n.push(t.terrainProviderChanged.addEventListener(NO(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(pi.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Mt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Mt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Hm.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,bSt(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 xA(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,Mt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});pi.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 PCe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=G0.createPickDerivedCommand(e,t,o,c.picking)),t.pickOnly||(c.depth=G0.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=G0.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=X0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ze.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))}pi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,o=t.shadowState.lastDirtyTime;e.lastDirtyTime!==o&&(e.lastDirtyTime=o,e.dirty=!0,i=!0);let r=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),u=l(a.hdr),d=l(a.originalCommand),m=r&&!c,p=s&&!u,b=(!r||!s)&&!d;if(e.dirty=e.dirty||m||p||b,e.dirty){e.dirty=!1;let h=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=X0.createCastDerivedCommand(h,e,i,n,a.shadows)),(c||m)&&(a.logDepth=G0.createLogDepthCommand(e,n,a.logDepth),PCe(this,a.logDepth.command,i)),(d||b)&&PCe(this,e,i)}};var gSt=new Cm({pass:No.RENDER}),S6=new Cm({pass:No.PRELOAD}),T6=new Cm({pass:No.PRELOAD_FLIGHT}),ySt=new Cm({pass:No.REQUEST_RENDER_MODE_DEFER_CHECK}),vCe=new ae,C6;function xSt(e){let t=e.globe;if(e._mode===oe.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=e.ellipsoid,i=e.frameState.minimumTerrainHeight;return vCe.radius=n.minimumRadius+i,C6=oF.fromBoundingSphere(vCe,e.camera.positionWC,C6),C6}}pi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function FCe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ne.clone(n,i.time)}pi.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=xSt(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 Pr),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._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Y.clone(this.invertClassificationColor,this._actualInvertClassificationColor),JL.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};pi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Ot.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var MO=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);MO=v.inverseTransformation(MO,MO);function _St(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=f.clone(s.center);if(o.mode!==oe.SCENE3D){c=v.multiplyByPoint(MO,c,c);let p=o.mapProjection,b=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(b)}if(l(s.radius)){let p=s.radius;a=Un.toWireframe(ea.createGeometry(new ea({radii:new f(p,p,p),vertexFormat:fn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new In({geometryInstances:new Rt({geometry:a,modelMatrix:v.fromTranslation(c),attributes:{color:new Jt(1,0,0,1)}}),appearance:new fn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Un.toWireframe(Al.createGeometry(Al.fromDimensions({dimensions:new f(2,2,2),vertexFormat:fn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new In({geometryInstances:new Rt({geometry:a,modelMatrix:v.fromRotationTranslation(p,c,new v),attributes:{color:new Jt(1,0,0,1)}}),appearance:new fn({flat:!0,translucent:!1}),asynchronous:!1})}let u=o.commandList,d=o.commandList=[];t._debugVolume.update(o),e=d[0],o.useLogDepth&&(e=G0.createLogDepthCommand(e,r).command);let m;l(i)&&(m=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(m)&&(n.framebuffer=m),o.commandList=u}function ec(e,t,n,i,o){let r=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ri){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&_St(e,t,i,o),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.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&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function FM(e,t,n,i){let o=t._frameState,r=e.derivedCommands;l(r)&&(o.useLogDepth&&l(r.logDepth)&&(e=r.logDepth.command),r=e.derivedCommands,l(r.picking)?(e=r.picking.pickCommand,e.execute(n,i)):l(r.depth)&&(e=r.depth.depthOnlyCommand,e.execute(n,i)))}function ACe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function SSt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+X.EPSILON12}function TSt(e,t,n,i,o){let r=e.context;x0(i,ACe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function CSt(e,t,n,i,o){let r=e.context;x0(i,SSt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function VSt(e,t,n,i){let o=e.context;x0(i,ACe,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var LSt=new Ri,ZSt=new Zl,RSt=new un,GSt=new Pr;function L6(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(LSt):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(ZSt):l(n.frustum.width)?s=n.frustum.clone(RSt):s=n.frustum.clone(GSt),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Ze.ENVIRONMENT);let a=o.passes,c=a.pick||a.pickVoxel,u=e._environmentState,d=e._view,m=u.renderTranslucentDepthForPick,p=u.useWebVR;if(!c){let Z=u.skyBoxCommand;if(l(Z)&&ec(Z,e,i,t),u.isSkyAtmosphereVisible&&ec(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let E;u.useGlobeDepthFramebuffer?E=d.globeDepth.framebuffer:u.usePostProcess?E=d.sceneFramebuffer.framebuffer:E=u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,E),t.framebuffer=E}u.isMoonVisible&&u.moonCommand.execute(i,t)}let b;u.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(Z,E,I,A,N){d.globeDepth.prepareColorTextures(i),d.oit.executeCommands(Z,E,I,A,N)}),b=e._executeOITFunction):a.render?b=TSt:b=CSt;let h=d.frustumCommandsList,x=h.length,_=u.clearGlobeDepth,C=u.useDepthPlane,V=e._globeTranslucencyState,L=V.translucent,R=e._view.globeTranslucencyFramebuffer,G=e._depthClearCommand,W=e._stencilClearCommand,w=e._classificationStencilClearCommand,P=e._depthPlane,F=u.usePostProcessSelected,M=n.position.z,g;for(let Z=0;Z<x;++Z){let E=x-Z-1,I=h[E];e.mode===oe.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&W.execute(i,t),r.updatePass(Ze.GLOBE);let A=I.commands[Ze.GLOBE],N=I.indices[Ze.GLOBE];if(L)V.executeGlobeCommands(I,ec,R,e,t);else for(g=0;g<N;++g)ec(A[g],e,i,t);let D=d.globeDepth;if(l(D)&&u.useGlobeDepthFramebuffer&&D.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(r.updatePass(Ze.TERRAIN_CLASSIFICATION),A=I.commands[Ze.TERRAIN_CLASSIFICATION],N=I.indices[Ze.TERRAIN_CLASSIFICATION],L)V.executeGlobeClassificationCommands(I,ec,R,e,t);else for(g=0;g<N;++g)ec(A[g],e,i,t);if(_&&(G.execute(i,t),C&&P.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(r.updatePass(Ze.CESIUM_3D_TILE),A=I.commands[Ze.CESIUM_3D_TILE],N=I.indices[Ze.CESIUM_3D_TILE],g=0;g<N;++g)ec(A[g],e,i,t);if(N>0&&(l(D)&&u.useGlobeDepthFramebuffer&&(D.prepareColorTextures(i,_),D.executeUpdateDepth(i,t,_,D.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(r.updatePass(Ze.CESIUM_3D_TILE_CLASSIFICATION),A=I.commands[Ze.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Ze.CESIUM_3D_TILE_CLASSIFICATION],g=0;g<N;++g)ec(A[g],e,i,t)}else{e._invertClassification.clear(i,t);let j=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Ze.CESIUM_3D_TILE),A=I.commands[Ze.CESIUM_3D_TILE],N=I.indices[Ze.CESIUM_3D_TILE],g=0;g<N;++g)ec(A[g],e,i,t);for(l(D)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),D.executeUpdateDepth(i,t,_,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Ze.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),A=I.commands[Ze.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Ze.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],g=0;g<N;++g)ec(A[g],e,i,t);for(t.framebuffer=j,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&w.execute(i,t),r.updatePass(Ze.CESIUM_3D_TILE_CLASSIFICATION),A=I.commands[Ze.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Ze.CESIUM_3D_TILE_CLASSIFICATION],g=0;g<N;++g)ec(A[g],e,i,t)}for(N>0&&i.stencilBuffer&&W.execute(i,t),r.updatePass(Ze.VOXELS),A=I.commands[Ze.VOXELS],N=I.indices[Ze.VOXELS],A.length=N,VSt(e,ec,t,A),r.updatePass(Ze.OPAQUE),A=I.commands[Ze.OPAQUE],N=I.indices[Ze.OPAQUE],g=0;g<N;++g)ec(A[g],e,i,t);E!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s));let k;if(!c&&u.useInvertClassification&&o.invertClassificationColor.alpha<1&&(k=e._invertClassification),r.updatePass(Ze.TRANSLUCENT),A=I.commands[Ze.TRANSLUCENT],A.length=I.indices[Ze.TRANSLUCENT],b(e,ec,t,A,k),I.indices[Ze.CESIUM_3D_TILE_CLASSIFICATION]>0&&d.translucentTileClassification.isSupported()&&(d.translucentTileClassification.executeTranslucentCommands(e,ec,t,A,D.depthStencilTexture),d.translucentTileClassification.executeClassificationCommands(e,ec,t,I)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||m)){let j=D.depthStencilTexture,K=e._picking.getPickDepth(e,E);K.update(i,j),K.executeCopyDepth(i,t)}if(c||!F)continue;let U=t.framebuffer;if(t.framebuffer=d.sceneFramebuffer.getIdFramebuffer(),s.near=E!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),r.updatePass(Ze.GLOBE),A=I.commands[Ze.GLOBE],N=I.indices[Ze.GLOBE],L)V.executeGlobeCommands(I,FM,R,e,t);else for(g=0;g<N;++g)FM(A[g],e,i,t);for(_&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),_&&C&&P.execute(i,t),r.updatePass(Ze.CESIUM_3D_TILE),A=I.commands[Ze.CESIUM_3D_TILE],N=I.indices[Ze.CESIUM_3D_TILE],g=0;g<N;++g)FM(A[g],e,i,t);for(r.updatePass(Ze.OPAQUE),A=I.commands[Ze.OPAQUE],N=I.indices[Ze.OPAQUE],g=0;g<N;++g)FM(A[g],e,i,t);for(r.updatePass(Ze.TRANSLUCENT),A=I.commands[Ze.TRANSLUCENT],N=I.indices[Ze.TRANSLUCENT],g=0;g<N;++g)FM(A[g],e,i,t);t.framebuffer=U}}function MCe(e){e.context.uniformState.updatePass(Ze.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,o=i.length;for(let r=0;r<o;++r)i[r].execute(e._computeEngine)}function ESt(e,t){e.context.uniformState.updatePass(Ze.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function WSt(e,t,n){let i=n.shadowMapCullingVolume,o=n.isPointLight,r=n.passes,s=r.length,a=t.length;for(let c=0;c<a;++c){let u=t[c];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Ze.GLOBE||u.pass===Ze.CESIUM_3D_TILE||u.pass===Ze.OPAQUE||u.pass===Ze.TRANSLUCENT)&&e.isVisible(u,i))if(o)for(let d=0;d<s;++d)r[d].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let d=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(u,p))r[m].commandList.push(u),d=!0;else if(d)break}}}}function NCe(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let o=e.context,r=o.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,u=c.length;for(let m=0;m<u;++m)c[m].commandList.length=0;let d=e.frameState.commandList;WSt(e,d,a);for(let m=0;m<u;++m){let p=a.passes[m];r.updateCamera(p.camera),a.updatePass(o,m);let b=p.commandList.length;for(let h=0;h<b;++h){let x=p.commandList[h];r.updatePass(x.pass),ec(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var ISt=new f;pi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?XSt(this,e,t):i!==oe.SCENE2D||this._mapMode2D===fu.ROTATE?ax(!0,this,e,t):(Z6(this,e,t),kSt(this,e))};function XSt(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;Z6(e,t,n),UCe(e),i.createPotentiallyVisibleSet(e),MCe(e),s||NCe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=lo.clone(o,e._cameraVR);c.frustum=o.frustum;let u=o.frustum.near,d=u*y(e.focalLength,5),m=y(e.eyeSeparation,d/30),p=f.multiplyByScalar(c.right,m*.5,ISt);o.frustum.aspectRatio=a.width/a.height;let b=.5*m*u/d;f.add(c.position,p,o.position),o.frustum.xOffset=b,L6(e,t),a.x=a.width,f.subtract(c.position,p,o.position),o.frustum.xOffset=-b,L6(e,t),lo.clone(c,o)}var PSt=new fe(Math.PI,X.PI_OVER_TWO),vSt=new f,wSt=new f,FSt=new v,ASt=new v,MSt=new f,NSt=new f,USt=new Je;function kSt(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=Je.clone(r,USt);t.viewport=s;let a=PSt,c=vSt;e.mapProjection.project(a,c);let d=f.clone(o.position,wSt),m=v.clone(o.transform,ASt),p=o.frustum.clone();o._setTransform(v.IDENTITY);let b=v.computeViewportTransformation(s,0,1,FSt),h=o.frustum.projectionMatrix,x=o.positionWC.y,_=f.fromElements(X.sign(x)*c.x-x,0,-o.positionWC.x,MSt),C=Vt.pointToGLWindowCoordinates(h,b,_,NSt);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)ax(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,o.position.x*=X.sign(o.position.x),o.frustum.right=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!0,e,t),s.x=C.x,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let R=o.frustum.right;o.frustum.right=c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!0,e,t),s.x=C.x,s.width=V+L-C.x,o.position.x=-o.position.x,o.frustum.left=-o.frustum.right,o.frustum.right=R-o.frustum.right*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let R=o.frustum.left;o.frustum.left=-c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!0,e,t),s.x=V,s.width=C.x-V,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=R-o.frustum.left*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),ax(!1,e,t)}o._setTransform(m),f.clone(d,o.position),o.frustum=p.clone(),t.viewport=r}function ax(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),UCe(t),r.createPotentiallyVisibleSet(t),e&&(l(i)&&Z6(t,n,i),MCe(t),s||NCe(t)),L6(t,n)}var wCe=new bs;pi.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(bT.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),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 _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let m=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,b=wCe.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=wCe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,p,m),n.isMoonVisible=this.isVisible(n.moonCommand,p,m);let h=this.specularEnvironmentMaps,x=this._specularEnvironmentMapAtlas;l(h)&&(!l(x)||x.url!==h)?(x=x&&x.destroy(),this._specularEnvironmentMapAtlas=new Hm(h)):!l(h)&&l(x)&&(x.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function DSt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new lp({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 BSt(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&!t.passes.pickVoxel&&e.mode===oe.SCENE3D;if(o!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=o),t.shadowState.lightShadowsEnabled=!1,!!o){for(let r=0;r<i;++r)if(n[r]!==t.shadowState.shadowMaps[r]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let r=0;r<i;++r){let s=n[r];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function UCe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),DSt(e),BSt(e),e._globe&&e._globe.render(t)}function Z6(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=e._frameState.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new dM: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 d=e._clearColorCommand;Y.clone(n,d.color),d.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,b=r.useOIT=!c&&l(p)&&p.isSupported();b&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let h=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,o.useLogDepth,e._hdr),h.clear(i),x=r.usePostProcess=h.ready,r.usePostProcessSelected=x&&h.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&d.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&r.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&b){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}pi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,o=i.globeDepth;l(o)&&o.prepareColorTextures(t);let r=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,u=s?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,m=i.sceneFramebuffer.idFramebuffer;r&&(e.framebuffer=a?d.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let b=d;s&&!r&&(b=u);let h=this.postProcessStages,x=b.getColorTexture(0),_=m.getColorTexture(0),C=y(u,d).getDepthStencilTexture();h.execute(t,x,C,_),h.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function OSt(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function YSt(e){if(e.mode===oe.MORPHING)return;let n=e.camera.positionCartographic;return e.getHeight(n)}pi.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===je.CLAMP_TO_TERRAIN||t===je.RELATIVE_TO_TERRAIN,i=t===je.CLAMP_TO_3D_TILE||t===je.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let u=c.getHeight(e,this);l(u)&&u>o&&(o=u)}}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 V6=new fe;pi.prototype.updateHeight=function(e,t,n){let i=()=>{fe.clone(e,V6);let b=this.getHeight(e,n);l(b)&&(V6.height=b,t(V6))},o=n===je.CLAMP_TO_TERRAIN||n===je.RELATIVE_TO_TERRAIN,r=n===je.CLAMP_TO_3D_TILE||n===je.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,u=b=>{if(o||b.isDestroyed()||!b.isCesium3DTileset)return;let h=b.updateHeight(e,i,c);a[b.id]=h};if(!o){let b=this.primitives.length;for(let h=0;h<b;++h){let x=this.primitives.get(h);u(x)}}let d=this.primitives.primitiveAdded.addEventListener(u),m=this.primitives.primitiveRemoved.addEventListener(b=>{b.isDestroyed()||!b.isCesium3DTileset||(l(a[b.id])&&a[b.id](),delete a[b.id])});return()=>{s=s&&s(),Object.values(a).forEach(b=>b()),a={},d(),m()}};function KSt(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}pi.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=YSt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=KSt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function zSt(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 E0({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 HSt(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 JSt(e){let t=e._frameState;e.primitives.postPassesUpdate(t),fc.update()}var QSt=new Y;function jSt(e){let t=e._frameState,n=e.context,i=n.uniformState,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=gSt;let r=y(e.backgroundColor,Y.BLACK);e._hdr&&(r=Y.clone(r,QSt),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 h0?f.negate(i.sunDirectionWC,e._shadowMapCamera.direction):f.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=Je.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,ESt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function NT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function qSt(e){return e._picking.updateMostDetailedRayPicks(e)}pi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=ne.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(ne.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ne.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=X.incrementWrap(t.frameNumber,15e6,1);FCe(this,o,e),t.newFrame=!0}NT(this,HSt),this.primitives.show&&(NT(this,qSt),NT(this,$St),NT(this,eTt),i||NT(this,tTt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),NT(this,jSt)),zSt(this,i),NT(this,JSt),OSt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};pi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};pi.prototype.requestRender=function(){this._renderRequested=!0};pi.prototype.clampLineWidth=function(e){return Math.max(Mt.minimumAliasedLineWidth,Math.min(e,Mt.maximumAliasedLineWidth))};pi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};pi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof sx))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 hM.fromKeyframeNode(o,s,c,a)};pi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};pi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};pi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function $St(e){let t=e._frameState;S6.camera=t.camera,S6.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,S6)}function eTt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;T6.camera=e.preloadFlightCamera,T6.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,T6)}function tTt(e){e.primitives.updateForPass(e._frameState,ySt)}pi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};pi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};pi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};pi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};pi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};pi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};pi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};pi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};pi.prototype.cartesianToCanvasCoordinates=function(e,t){return zi.worldToWindowCoordinates(this,e,t)};pi.prototype.completeMorph=function(){this._transitioner.completeMorph()};pi.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};pi.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};pi.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function nTt(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()})}pi.prototype.setTerrain=function(e){return nTt(this,e),e};pi.prototype.isDestroyed=function(){return!1};pi.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),de(this)};var AM=pi;var q6i=S(T(),1);function rZ(e){e=y(e,ie.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=f.multiplyByScalar(e.radii,t,new f);this._scaleMatrix=v.fromScale(n),this._modelMatrix=new v,this._command=new He({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new f(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new f(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 f;let i=new f;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(rZ.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});rZ.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var R6=new v;rZ.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=v.fromRotationTranslation(e.context.uniformState.inverseViewRotation,f.ZERO,R6),o=v.multiplyTransformation(i,Ao.Y_UP_TO_Z_UP,R6),r=v.multiply(this._scaleMatrix,o,R6);v.clone(r,this._modelMatrix);let s=e.context,a=iTt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,d=this._command;if(!l(d.vertexArray)){let p=ea.createGeometry(new ea({radii:new f(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:we.POSITION_ONLY}));d.vertexArray=Jn.fromGeometry({context:s,geometry:p,attributeLocations:Un.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),d.renderState=Oe.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:hn.ALPHA_BLEND,depthMask:!1})}let m=a|u<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let b=new De({defines:p,sources:[S0,IL,VF]}),h=new De({defines:p,sources:[S0,IL,CF]});this._spSkyAtmosphere=qt.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:h}),d.shaderProgram=this._spSkyAtmosphere}return d};function iTt(e){return!(X.equalsEpsilon(e.hueShift,0,X.EPSILON7)&&X.equalsEpsilon(e.saturationShift,0,X.EPSILON7)&&X.equalsEpsilon(e.brightnessShift,0,X.EPSILON7))}rZ.prototype.isDestroyed=function(){return!1};rZ.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var MM=rZ;var Sqi=S(T(),1);function aZ(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new He({modelMatrix:v.clone(v.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}aZ.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==oe.SCENE3D&&e.mode!==oe.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let r=this.sources;typeof r.positiveX=="string"?Uw(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new da({context:i,source:r}))}let o=this._command;if(!l(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return n._cubeMap}};let r=Al.createGeometry(Al.fromDimensions({dimensions:new f(2,2,2),vertexFormat:we.POSITION_ONLY})),s=this._attributeLocations=Un.createAttributeLocations(r);o.vertexArray=Jn.fromGeometry({context:i,geometry:r,attributeLocations:s,bufferUsage:Me.STATIC_DRAW}),o.renderState=Oe.fromCache({blending:hn.ALPHA_BLEND})}if(!l(o.shaderProgram)||this._useHdr!==t){let r=new De({defines:[t?"HDR":""],sources:[LF]});o.shaderProgram=qt.fromCache({context:i,vertexShaderSource:ZF,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return o};aZ.prototype.isDestroyed=function(){return!1};aZ.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),de(this)};function sZ(e){return an(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}aZ.createEarthSkyBox=function(){return new aZ({sources:{positiveX:sZ("px"),negativeX:sZ("mx"),positiveY:sZ("py"),negativeY:sZ("my"),positiveZ:sZ("pz"),negativeZ:sZ("mz")}})};var NM=aZ;var Qqi=S(T(),1);function kM(){this.show=!0,this._drawCommand=new He({primitiveType:Ae.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,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(kM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var oTt=new B,rTt=new B,sTt=new re,UM=new re;kM.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 R=Math.max(r,s);R=Math.pow(2,Math.ceil(Math.log(R)/Math.log(2))-2),R=Math.max(1,R);let G=n?o.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new bt({context:o,width:R,height:R,pixelFormat:nt.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let W=this,w={u_radiusTS:function(){return W._radiusTS}};this._commands.computeCommand=new ka({fragmentShaderSource:GF,outputTexture:this._texture,uniformMap:w,persists:!1,owner:this,postExecute:function(){W._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let R={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let W=ut.createVertexBuffer({context:o,typedArray:G,usage:Me.STATIC_DRAW}),w=[{index:R.direction,vertexBuffer:W,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=ut.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});a.vertexArray=new Jn({context:o,attributes:w,indexBuffer:P}),a.shaderProgram=qt.fromCache({context:o,vertexShaderSource:EF,fragmentShaderSource:RF,attributeLocations:R}),a.renderState=Oe.fromCache({blending:hn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,d=this._boundingVolume,m=this._boundingVolume2D;f.clone(c,d.center),m.center.x=u.z,m.center.y=u.x,m.center.z=u.y,d.radius=X.SOLAR_RADIUS+X.SOLAR_RADIUS*this._glowLengthTS,m.radius=d.radius,i===oe.SCENE3D?ae.clone(d,a.boundingVolume):i===oe.COLUMBUS_VIEW&&ae.clone(m,a.boundingVolume);let p=zi.computeActualEllipsoidPosition(e,c,UM),b=f.magnitude(f.subtract(p,e.camera.position,UM)),h=o.uniformState.projection,x=sTt;x.x=0,x.y=0,x.z=-b,x.w=1;let _=v.multiplyByVector(h,x,UM),C=zi.clipToGLWindowCoordinates(t.viewport,_,oTt);x.x=X.SOLAR_RADIUS;let V=v.multiplyByVector(h,x,UM),L=zi.clipToGLWindowCoordinates(t.viewport,V,rTt);return this._size=B.magnitude(B.subtract(L,C,UM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};kM.prototype.isDestroyed=function(){return!1};kM.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),de(this)};var DM=kM;function aTt(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 kCe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function DCe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=kCe(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 BCe(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 UT(e,t){e=Pn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=At.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=At.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(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 u=l(t.creditViewport)?Pn(t.creditViewport):n,d=y(t.showRenderLoopErrors,!0),m=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=d,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new _f,DCe(this);try{let p=y(t.ellipsoid,ie.default),b=new AM({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=b,b.camera.constrainedAxis=f.UNIT_Z,kCe(this),BCe(this);let h=t.globe;l(h)||(h=new tA(p)),h!==!1&&(b.globe=h,b.globe.shadows=y(t.terrainShadows,Cn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ie.WGS84.equals(p)&&(x=NM.createEarthSkyBox()),x!==!1&&(b.skyBox=x,b.sun=new DM,ie.WGS84.equals(p)&&(b.moon=new oA));let _=t.skyAtmosphere;!l(_)&&ie.WGS84.equals(p)&&(_=new MM(p),_.show=t.globe!==!1&&h.show),_!==!1&&(b.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=Ra.fromWorldImagery()),b.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(b.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&b.setTerrain(t.terrain),this._screenSpaceEventHandler=new cd(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=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(L,R){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,R)},b.renderError.addEventListener(this._onRenderError)}catch(p){throw d&&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(UT.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}},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&&aTt(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)}}});UT.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),d=l(n);if(u||d){let b=document.createElement("div");if(b.className="cesium-widget-errorPanel-message",a.appendChild(b),d){let h=ip(n);u||(typeof n=="string"&&(n=new Error(n)),t=ip({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${h}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(h)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}b.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);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)},m.appendChild(p),i.appendChild(o)};UT.prototype.isDestroyed=function(){return!1};UT.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),de(this)};UT.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,DCe(this),BCe(this),this._scene.requestRender())};UT.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var BM=UT;var T$i=S(T(),1);var cTt=new f(1,1,1);function G6(e){e=y(e,cTt),this._dimensions=f.clone(e)}Object.defineProperties(G6.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){f.clone(e,this._dimensions)}}});var lTt=new f;G6.prototype.emit=function(e){let t=this._dimensions,n=f.multiplyByScalar(t,.5,lTt),i=X.randomBetween(-n.x,n.x),o=X.randomBetween(-n.y,n.y),r=X.randomBetween(-n.z,n.z);e.position=f.fromElements(i,o,r,e.position),e.velocity=f.normalize(e.position,e.velocity)};var E6=G6;var L$i=S(T(),1);function _p(){this.featurePropertiesDirty=!1}Object.defineProperties(_p.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});_p.prototype.hasProperty=function(e,t){he.throwInstantiationError()};_p.prototype.getFeature=function(e){he.throwInstantiationError()};_p.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};_p.prototype.applyStyle=function(e){he.throwInstantiationError()};_p.prototype.update=function(e,t){he.throwInstantiationError()};_p.prototype.pick=function(e,t,n){he.throwInstantiationError()};_p.prototype.isDestroyed=function(){he.throwInstantiationError()};_p.prototype.destroy=function(){he.throwInstantiationError()};var W6=_p;var M$i=S(T(),1);var W$i=S(T(),1);function cZ(e,t){this._conditionsExpression=Ue(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,dTt(this,t)}Object.defineProperties(cZ.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function uTt(e,t){this.condition=e,this.expression=t}function dTt(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 uTt(new wd(a,t),new wd(c,t)))}e._runtimeConditions=n}cZ.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)}};cZ.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)}};cZ.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),d=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) - { - return ${d}; - } -`}return r=`${i} ${e} -{ -${r} return ${i}(1.0); -} -`,r};cZ.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 OM=cZ;function cx(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,mTt(this,e)}function mTt(e,t){t=y(Ue(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=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new wd(o[r],i))}e._meta=n,e._ready=!0}function lr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new wd(String(t));if(typeof t=="string")return new wd(t,n);if(l(t.conditions))return new OM(t,n)}else return;return t}function ur(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ue(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(cx.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=lr(this,e),this._style.show=ur(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=lr(this,e),this._style.color=ur(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=lr(this,e),this._style.pointSize=ur(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=lr(this,e),this._style.pointOutlineColor=ur(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=lr(this,e),this._style.pointOutlineWidth=ur(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=lr(this,e),this._style.labelColor=ur(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=lr(this,e),this._style.labelOutlineColor=ur(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=lr(this,e),this._style.labelOutlineWidth=ur(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=lr(this,e),this._style.font=ur(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=lr(this,e),this._style.labelStyle=ur(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=lr(this,e),this._style.labelText=ur(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=lr(this,e),this._style.backgroundColor=ur(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=lr(this,e),this._style.backgroundPadding=ur(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=lr(this,e),this._style.backgroundEnabled=ur(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=lr(this,e),this._style.scaleByDistance=ur(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=lr(this,e),this._style.translucencyByDistance=ur(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=lr(this,e),this._style.distanceDisplayCondition=ur(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=lr(this,e),this._style.heightOffset=ur(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=lr(this,e),this._style.anchorLineEnabled=ur(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=lr(this,e),this._style.anchorLineColor=ur(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=lr(this,e),this._style.image=ur(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=lr(this,e),this._style.disableDepthTestDistance=ur(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=lr(this,e),this._style.horizontalOrigin=ur(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=lr(this,e),this._style.verticalOrigin=ur(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=lr(this,e),this._style.labelHorizontalOrigin=ur(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=lr(this,e),this._style.labelVerticalOrigin=ur(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});cx.fromUrl=function(e){return We.createIfNeeded(e).fetchJson(e).then(function(n){return new cx(n)})};cx.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)};cx.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)};cx.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)};cx.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 kT=cx;var geo=S(T(),1);var D$i=S(T(),1);function YM(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new iT({comparator:YM.comparator})}YM.prototype.addSubtree=function(e){let t=new fTt(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()};YM.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}};YM.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 fTt(e,t){this.subtree=e,this.stamp=t}var KM=YM;var z$i=S(T(),1);function UO(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(UO.prototype,{metadataTable:{get:function(){return this._metadataTable}}});UO.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=pTt(n);let r=await hTt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let m=0;m<a;++m){let p=o.json.bufferViews[m],b=p.byteOffset,h=b+p.byteLength,_=r[p.buffer].subarray(b,h);s[m]=_}let c=o.json.voxelTable,u=o.json.propertyTables[c],d=new UO(e);return d._metadataTable=new Yl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),d};function hTt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function pTt(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=Zo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var zM=UO;function kO(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new KM}kO.fromUrl=async function(e){let t=We.createIfNeeded(e),n=await t.fetchJson();gTt(n);let i=TTt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=si(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new mS({metadataJson:a,schema:c}),d=new kO;CTt(d,u,s);let m=new hS(t,o,c),{shape:p,minBounds:b,maxBounds:h,shapeTransform:x,globalTransform:_}=yTt(o);d.shape=p,d.minBounds=b,d.maxBounds=h,d.dimensions=f.unpack(r.dimensions),d.shapeTransform=x,d.globalTransform=_,d.maximumTileCount=bTt(u);let C,V;return l(r.padding)&&(C=f.unpack(r.padding.before),V=f.unpack(r.padding.after)),d.paddingBefore=C,d.paddingAfter=V,d._implicitTileset=m,Ki.unload(i),d};function bTt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(P_.TILESET_TILE_COUNT)}function gTt(e){let t=e.root;if(!l(t.content))throw new ue("Root must have content");if(!si(t.content,"3DTILES_content_voxels"))throw new ue("Root tile content must have 3DTILES_content_voxels extension");if(!si(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ue("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!si(e,"3DTILES_metadata"))throw new ue("Tileset must have a metadata schema")}function yTt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=v.unpack(e.transform):n=v.clone(v.IDENTITY),l(t.box))return _Tt(t.box,n);if(l(t.region))return xTt(t.region);if(si(t,"3DTILES_bounding_volume_cylinder"))return STt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new ue("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function xTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=v.fromScale(ie.WGS84.radii),c=new f(t,n,r),u=new f(i,o,s);return{shape:Fi.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a,globalTransform:v.clone(v.IDENTITY)}}function _Tt(e,t){let n=Wn.unpack(e),i=v.fromRotationTranslation(n.halfAxes,n.center);return{shape:Fi.BOX,minBounds:f.clone(gp.DefaultMinBounds),maxBounds:f.clone(gp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function STt(e,t){let n=Wn.unpack(e),i=v.fromRotationTranslation(n.halfAxes,n.center);return{shape:Fi.CYLINDER,minBounds:f.clone(yp.DefaultMinBounds),maxBounds:f.clone(yp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function TTt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ki.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ki.getSchemaLoader({schema:i})}function CTt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([m,p])=>{let{type:b,componentType:h}=p,x=r?.properties[m].min,_=r?.properties[m].max,C=jt.getComponentCount(b),V=OCe(x,C),L=OCe(_,C);return{id:m,type:b,componentType:h,minValue:V,maxValue:L}});e.names=a.map(m=>m.id),e.types=a.map(m=>m.type),e.componentTypes=a.map(m=>m.componentType);let c=a.map(m=>m.minValue),u=a.map(m=>m.maxValue),d=c.some(l);e.minimumValues=d?c:void 0,e.maximumValues=d?u:void 0}function OCe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function VTt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=wh(o);return await zM.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function LTt(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=wh(a);return o=await X_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}kO.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new pS({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,d=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return LTt(this,d).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?VTt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(b){return p.metadataTable.getPropertyTypedArray(b)})})};var I6=kO;var Teo=S(T(),1);function X6(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(X6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});X6.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=f.fromElements(i,o,r,e.position),e.velocity=f.clone(f.UNIT_Z,e.velocity)};var HM=X6;var mto=S(T(),1);var Veo=S(T(),1),P6={CUMULUS:0};P6.validate=function(e){return e===P6.CUMULUS};var lZ=Object.freeze(P6);var Ieo=S(T(),1);function jf(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=f.clone(y(e.position,f.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=f.clone(e.maximumSize),this._scale=new B(this._maximumSize.x,this._maximumSize.y);else{this._scale=B.clone(y(e.scale,new B(20,12)));let n=new f(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=f.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=Y.clone(y(e.color,Y.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var ZTt=jf.SHOW_INDEX=0,RTt=jf.POSITION_INDEX=1,GTt=jf.SCALE_INDEX=2,ETt=jf.MAXIMUM_SIZE_INDEX=3,WTt=jf.SLICE_INDEX=4,ITt=jf.BRIGHTNESS_INDEX=5,XTt=jf.COLOR_INDEX=6;jf.NUMBER_OF_PROPERTIES=7;function DT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(jf.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,DT(this,ZTt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;f.equals(t,e)||(f.clone(e,t),DT(this,RTt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;B.equals(t,e)||(B.clone(e,t),DT(this,GTt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;f.equals(t,e)||(f.clone(e,t),DT(this,ETt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),DT(this,XTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,DT(this,WTt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,DT(this,ITt))}}});jf.prototype._destroy=function(){this._cloudCollection=void 0};var bd=jf;var gd,DO=new f,PTt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},vTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},wTt=bd.SHOW_INDEX,FTt=bd.POSITION_INDEX,ATt=bd.SCALE_INDEX,MTt=bd.MAXIMUM_SIZE_INDEX,NTt=bd.SLICE_INDEX,UTt=bd.BRIGHTNESS_INDEX,kTt=bd.NUMBER_OF_PROPERTIES,DTt=bd.COLOR_INDEX;function qf(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(kTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=f.clone(y(e.noiseOffset,f.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:YCe(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=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function YCe(e){return function(){return DO.x=e._textureSliceWidth,DO.y=e._noiseTextureRows,DO.z=1/e._noiseTextureRows,DO}}Object.defineProperties(qf.prototype,{length:{get:function(){return w6(this),this._clouds.length}}});function KCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}qf.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,lZ.CUMULUS),n;return t===lZ.CUMULUS&&(n=new bd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};qf.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};qf.prototype.removeAll=function(){KCe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function w6(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}}qf.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};qf.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};qf.prototype.get=function(e){return w6(this),this._clouds[e]};var BTt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),OTt=new Uint16Array([0,1,2,0,2,3]);function YTt(e){let t=ut.createVertexBuffer({context:e,typedArray:BTt,usage:Me.STATIC_DRAW}),n=ut.createIndexBuffer({context:e,typedArray:OTt,usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new Jn({context:e,attributes:i,indexBuffer:n})}var F6;function KTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=ut.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function zTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ut.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function HTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ut.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function JTt(e,t,n){let i=[{index:gd.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:gd.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:gd.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:gd.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:gd.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:gd.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:HTt(e)});let o=n?t:4*t;return new Zb(e,i,o,n)}var v6=new Kn;function zCe(e,t,n,i){let o,r=n[gd.positionHighAndScaleX],s=n[gd.positionLowAndScaleY],a=i.position;Kn.fromCartesian(a,v6);let c=i.scale,u=v6.high,d=v6.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,d.x,d.y,d.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,d.x,d.y,d.z,c.y),s(o+1,d.x,d.y,d.z,c.y),s(o+2,d.x,d.y,d.z,c.y),s(o+3,d.x,d.y,d.z,c.y))}function HCe(e,t,n,i){let o,r=n[gd.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 JCe(e,t,n,i){let o,r=n[gd.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 QCe(e,t,n,i){let o,r=n[gd.color],s=i.color,a=Y.floatToByte(s.red),c=Y.floatToByte(s.green),u=Y.floatToByte(s.blue),d=Y.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,d)):(o=i._index*4,r(o+0,a,c,u,d),r(o+1,a,c,u,d),r(o+2,a,c,u,d),r(o+3,a,c,u,d))}function QTt(e,t,n,i){zCe(e,t,n,i),HCe(e,t,n,i),JCe(e,t,n,i),QCe(e,t,n,i)}function jTt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=YTt(a),o._spNoise=qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new bt({context:a,width:r*r/s,height:r*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:nt.RGBA,sampler:new Qt({wrapS:ln.REPEAT,wrapT:ln.REPEAT,minificationFilter:Ft.NEAREST,magnificationFilter:ni.NEAREST})});let d=new ka({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:YCe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(d),o._loading=!0}function qTt(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=JTt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];QTt(e,t,s,c)}n._vaf.commit(F6(i))}}var $Tt=[];function eCt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=$Tt;u.length=0,(c[FTt]||c[ATt])&&u.push(zCe),(c[wTt]||c[UTt])&&u.push(HCe),(c[MTt]||c[NTt])&&u.push(JCe),c[DTt]&&u.push(QCe);let d=u.length,m=i._vaf.writers,p,b,h;if(a/r>.1){for(p=0;p<a;++p)for(b=s[p],b._dirty=!1,h=0;h<d;++h)u[h](e,t,m,b);i._vaf.commit(F6(n))}else{for(p=0;p<a;++p){for(b=s[p],b._dirty=!1,h=0;h<d;++h)u[h](e,t,m,b);i._instanced?i._vaf.subCommit(b._index,1):i._vaf.subCommit(b._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function tCt(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=qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:gd}),r._rs=Oe.fromCache({depthTest:{enabled:!0,func:H.LESS},depthMask:!1,blending:hn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function nCt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let d=s[u];l(d)||(d=s[u]=new He),d.pass=Ze.TRANSLUCENT,d.owner=e,d.uniformMap=o,d.count=a[u].indicesCount,d.vertexArray=a[u].va,d.shaderProgram=n._sp,d.renderState=n._rs,n._instanced&&(d.count=6,d.instanceCount=n._clouds.length),r.push(d)}}}qf.prototype.update=function(e){if(w6(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&jTt(this,e,fF,mF),this._instanced=e.context.instancedArrays,gd=this._instanced?vTt:PTt,F6=this._instanced?zTt:KTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?qTt(this,e):r>0&&eCt(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)&&tCt(this,e,dF,uF),nCt(this,e))};qf.prototype.isDestroyed=function(){return!1};qf.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(),KCe(this._clouds),de(this)};var A6=qf;var yto=S(T(),1);async function M6(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)],u=await M6._sampleTerrainMostDetailed(n,c),d=!1,m=u.reduce(function(b,h){return l(h.height)?(d=!0,Math.max(h.height,b)):b},-Number.MAX_VALUE),p=r;return d&&(p.height+=m),p}M6._sampleTerrainMostDetailed=cT;var BT=M6;var Cto=S(T(),1);var iCt=X.toRadians(30);function N6(e){this._angle=y(e,iCt)}Object.defineProperties(N6.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});N6.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=f.fromElements(o,r,s,e.velocity),f.normalize(e.velocity,e.velocity),e.position=f.clone(f.ZERO,e.position)};var U6=N6;var Nto=S(T(),1);var oCt=new Y,rCt=new Y,sCt=new Y,aCt=new Y,jCe=new re,JM=new Uint8Array(4);function qCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return Y.lerp(t.color,n.color,o,i)}function BO(e,t){return{height:e,color:Y.clone(t)}}function $Ce(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?Y.equals(t.color,i[n-1].color):!1,a=r?Y.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?Y.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function cCt(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 b=s[n],h=X.clamp(b.height,bu._minimumHeight,bu._maximumHeight),x=Y.clone(b.color,oCt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(BO(h,x))}let u=!0,d=!0;for(n=0;n<a-1;n++){let b=c[n+0],h=c[n+1];u=u&&b.height<=h.height,d=d&&b.height>=h.height}d?c=c.reverse():u||x0(c,function(b,h){return X.sign(b.height-h.height)});let m=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,BO(bu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,BO(bu._maximumHeight,c[c.length-1].color)),c=$Ce(c),i.push(c)}return i}function lCt(e){let t=cCt(e),n=[],i=[],o;function r(u,d){n.push(BO(u,d))}function s(u,d,m){let p=Y.multiplyByScalar(m,1-d.alpha,aCt);p=Y.add(p,d,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],d=0,m=0;i=n,n=[];let p=u.length,b=i.length;for(;d<p||m<b;){let h=d<p?u[d]:void 0,x=d>0?u[d-1]:void 0,_=d<p-1?u[d+1]:void 0,C=m<b?i[m]:void 0,V=m>0?i[m-1]:void 0,L=m<b-1?i[m+1]:void 0;if(l(h)&&l(C)&&h.height===C.height){let R=l(L)&&C.height===L.height,G=!l(V),W=!l(L),w=l(_)&&h.height===_.height,P=!l(x),F=!l(_);R?w?(s(h.height,h.color,C.color),s(h.height,_.color,L.color)):P?(r(h.height,C.color),s(h.height,h.color,L.color)):F?(s(h.height,h.color,C.color),r(h.height,L.color)):(s(h.height,h.color,C.color),s(h.height,h.color,L.color)):G?w?(r(h.height,h.color),s(h.height,_.color,C.color)):F?(r(h.height,h.color),r(h.height,C.color)):(P||r(h.height,h.color),s(h.height,h.color,C.color)):W?w?(s(h.height,h.color,C.color),r(h.height,_.color)):P?(r(h.height,C.color),r(h.height,h.color)):F?s(h.height,h.color,C.color):(s(h.height,h.color,C.color),r(h.height,h.color)):w?(s(h.height,h.color,C.color),s(h.height,_.color,C.color)):P?(r(h.height,C.color),s(h.height,h.color,C.color)):F?(s(h.height,h.color,C.color),r(h.height,C.color)):s(h.height,h.color,C.color),d+=w?2:1,m+=R?2:1}else if(l(h)&&l(C)&&l(V)&&h.height<C.height){let R=qCe(h.height,V,C,sCt);l(x)?l(_)?s(h.height,h.color,R):(s(h.height,h.color,R),r(h.height,R)):(r(h.height,R),s(h.height,h.color,R)),d++}else if(l(C)&&l(h)&&l(x)&&C.height<h.height){let R=qCe(C.height,x,h,rCt);l(V)?l(L)?s(C.height,R,C.color):(s(C.height,R,C.color),r(C.height,R)):(r(C.height,R),s(C.height,R,C.color)),m++}else l(h)&&(!l(C)||h.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(h.height,h.color),r(h.height,bu._emptyColor),r(C.height,bu._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,bu._emptyColor),r(h.height,bu._emptyColor)),r(h.height,h.color)),d++):l(C)&&(!l(h)||C.height<h.height)&&(r(C.height,C.color),m++)}}return $Ce(n)}function bu(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=lCt(n),r=o.length,s,a,c;if(!bu._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=nt.RGBA,s=new Uint8Array(r*4);for(let b=0;b<r;b++)re.packFloat(o[b].height,jCe),re.pack(jCe,s,b*4)}else{a=ze.FLOAT,c=i.webgl2?nt.RED:nt.LUMINANCE,s=new Float32Array(r);for(let b=0;b<r;b++)s[b]=o[b].height}let d=bt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.NEAREST,magnificationFilter:ni.NEAREST})}),m=new Uint8Array(r*4);for(let b=0;b<r;b++)o[b].color.toBytes(JM),m[b*4+0]=JM[0],m[b*4+1]=JM[1],m[b*4+2]=JM[2],m[b*4+3]=JM[3];let p=bt.create({context:i,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR,magnificationFilter:ni.LINEAR})});return Yi.fromType("ElevationBand",{heights:d,colors:p})}bu._useFloatTexture=function(e){return e.floatingPointTexture};bu._maximumHeight=5906376425472;bu._minimumHeight=-5906376425472;bu._emptyColor=new Y(0,0,0,0);var k6=bu;var zto=S(T(),1);async function uCt(e,t){if(t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,aT.defaultApiKey),!l(e))return dCt(t);let n,i=aT.getDefaultCredit();l(i)&&(n=[i]);let o=new We({url:`${aT.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return xa.fromUrl(o,t)}var e1e={};async function dCt(e){let i=e1e[2275207];l(i)||(i=Eu.fromAssetId(2275207),e1e[2275207]=i);let o=await i;return xa.fromUrl(o,e)}var D6=uCt;var eno=S(T(),1);async function mCt(e){let t=await xa.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,Y.WHITE).toCssColorString();n=new kT({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var B6=mCt;var uno=S(T(),1);function fCt(e){e=y(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=v.clone(y(e.modelMatrix,v.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Jt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Jt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Rt({geometry:Un.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Jt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new fn({flat:!0,translucent:!1})})}var O6=fCt;var pno=S(T(),1);function QM(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(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=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=oo.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(QM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});QM.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;QM.prototype.isTranslucent=oo.prototype.isTranslucent;QM.prototype.getRenderState=oo.prototype.getRenderState;var Y6=QM;var Gno=S(T(),1);function OO(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._modelMatrix=new v,this.id=e.id,this._id=void 0,this._primitive=void 0}OO.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!v.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=v.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Rt({geometry:new a0({positions:[f.ZERO,f.UNIT_X],width:this.width,vertexFormat:ts.VERTEX_FORMAT,colors:[Y.RED,Y.RED],arcType:rn.NONE}),modelMatrix:v.multiplyByUniformScale(this.modelMatrix,this.length,new v),id:this.id,pickPrimitive:this}),n=new Rt({geometry:new a0({positions:[f.ZERO,f.UNIT_Y],width:this.width,vertexFormat:ts.VERTEX_FORMAT,colors:[Y.GREEN,Y.GREEN],arcType:rn.NONE}),modelMatrix:v.multiplyByUniformScale(this.modelMatrix,this.length,new v),id:this.id,pickPrimitive:this}),i=new Rt({geometry:new a0({positions:[f.ZERO,f.UNIT_Z],width:this.width,vertexFormat:ts.VERTEX_FORMAT,colors:[Y.BLUE,Y.BLUE],arcType:rn.NONE}),modelMatrix:v.multiplyByUniformScale(this.modelMatrix,this.length,new v),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new ts,asynchronous:!1})}this._primitive.update(e)}};OO.prototype.isDestroyed=function(){return!1};OO.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var jM=OO;var Pno=S(T(),1);function hCt(e){this.direction=f.clone(e.direction),this.color=Y.clone(y(e.color,Y.WHITE)),this.intensity=y(e.intensity,1)}var K6=hCt;var Kno=S(T(),1);var wno=S(T(),1),qM=`in vec3 v_positionMC; -in vec3 v_positionEC; -in vec2 v_st; -void main() -{ -czm_materialInput materialInput; -vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0))); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -materialInput.s = v_st.s; -materialInput.st = v_st; -materialInput.str = vec3(v_st, 0.0); -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); -vec3 positionToEyeEC = -v_positionEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var Ano=S(T(),1),$M=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec2 st; -in float batchId; -out vec3 v_positionMC; -out vec3 v_positionEC; -out vec2 v_st; -void main() -{ -vec4 p = czm_computePosition(); -v_positionMC = position3DHigh + position3DLow; -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function OT(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,$M),this._fragmentShaderSource=y(e.fragmentShaderSource,qM),this._renderState=oo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(OT.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 OT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});OT.VERTEX_FORMAT=we.POSITION_AND_ST;OT.prototype.getFragmentShaderSource=oo.prototype.getFragmentShaderSource;OT.prototype.isTranslucent=oo.prototype.isTranslucent;OT.prototype.getRenderState=oo.prototype.getRenderState;var z6=OT;var eio=S(T(),1);function gu(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,gu.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,gu.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,gu.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,gu.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,gu.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){pCt(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(){bCt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}gu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};gu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new gu({scene:e})),e._frameRateMonitor};Object.defineProperties(gu.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}}});gu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};gu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};gu.prototype.isDestroyed=function(){return!1};gu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function pCt(e,t){if(e._pauseCount>0)return;let n=Si();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Qn.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 bCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var e9=gu;var nio=S(T(),1);function gCt(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 t9=gCt;var bio=S(T(),1);var t1e=S(d8(),1);function H6(){this._image=new Image}H6.prototype.isReady=function(){return!0};H6.prototype.shouldDiscardImage=function(e){return e===this._image};function YT(e){e=y(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 _i({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 Ct(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(YT.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}}});YT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ue(`The server ${e.url} doesn't have imagery`);let n=new YT(t);return n._metadata=e,n};YT.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]}};YT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=y0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new $o({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=yCt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){Ow(r.key,u);let d=new Uint8Array(u),m,p=r.protoImagery;if((!l(p)||!p)&&(m=xCt(d)),!l(m)&&(!l(p)||p)){let b=_Ct(d);m=b.imageType,d=b.imageData}return!l(m)||!l(d)?o:cb({uint8Array:d,format:m,flipY:!0})})};YT.prototype.pickFeatures=function(e,t,n,i,o){};function yCt(e,t,n,i,o,r){let s=y0.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 xCt(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 _Ct(e){let t=t1e.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ue("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var J6=YT;var Cio=S(T(),1);var SCt=new Y(1,1,1,.4),TCt=new Y(0,1,0,.05),CCt=new Y(0,.5,0,.2);function KT(e){e=y(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 _i({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,SCt),this._glowColor=y(e.glowColor,TCt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,CCt),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(KT.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}}});KT.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()};KT.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};KT.prototype.getTileCredits=function(e,t,n){};KT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};KT.prototype.pickFeatures=function(e,t,n,i,o){};var Q6=KT;var rro=S(T(),1);var Woo=S(T(),1);var moo=S(T(),1);var Pio=S(T(),1);function $f(){}$f._maxDecodingConcurrency=Math.max(At.hardwareConcurrency-1,1);$f._decodeTaskProcessor=new di("decodeI3S",$f._maxDecodingConcurrency);$f._promise=void 0;async function VCt(){if(await $f._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return $f._decodeTaskProcessor;throw new ue("I3S decoder could not be initialized.")}$f.decode=async function(e,t,n,i,o){return l($f._promise)||($f._promise=VCt()),$f._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,d=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],d=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],d=s.mbs[2]);let m=$.fromRotationX(-X.PI_OVER_TWO),p=new $;$.multiply(m,a,p);let b=fe.fromDegrees(c,u,d),h=ie.WGS84.cartographicToCartesian(b),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:b,cartesianCenter:h,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var n9=$f;var Aio=S(T(),1);function j6(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(j6.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});j6.prototype.load=async function(){return this._data=await eh.loadJson(this._resource),this._data};var i9=j6;var kio=S(T(),1);function N0(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(N0.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 YO(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:YO(e)}async function ZCt(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)}N0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=ZCt(this).catch(function(e){console.error(e)}),this._loadPromise)};N0.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}};N0.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};N0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let d=this._parseValue(e,r.valueType,t);d.value.charCodeAt(0)!==0&&(c+=d.value),t=d.offset}this._values[o].push(c)}}}};N0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=YO(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=YO(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};N0.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 ue(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};N0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ue(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=YO(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ue(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ue(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var o9=N0;var Hio=S(T(),1);function r9(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(r9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});r9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var RCt=new f,GCt=new f,ECt=new f,WCt=new f,ICt=new f;function q6(e,t,n,i){let o=f.subtract(i,n,RCt),r=f.cross(o,f.subtract(e,n,GCt),WCt),s=f.cross(o,f.subtract(t,n,ECt),ICt);return f.dot(r,s)>=0}var XCt=new f,PCt=new f,vCt=new f,wCt=new f,FCt=new f,ACt=new f,MCt=new f,NCt=new f,UCt=new f,kCt=new f;r9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new f(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,u=this._customAttributes.positions,d=this._customAttributes.indices,m;l(d)?m=d.length:m=u.length/3;for(let p=0;p<m;p++){let b,h,x;l(d)?(b=d[p],h=d[p+1],x=d[p+2]):(b=p*3,h=p*3+1,x=p*3+2);let _=f.fromElements(u[b*3],u[b*3+1],u[b*3+2],XCt),C=f.fromElements(u[h*3],u[h*3+1],u[h*3+2],PCt),V=new f(u[x*3],u[x*3+1],u[x*3+2],vCt);if(!q6(i,_,C,V)||!q6(i,C,_,V)||!q6(i,V,_,C))continue;let L=f.subtract(C,_,wCt),R=f.subtract(V,_,FCt),G=f.cross(L,R,ACt);if(f.magnitude(G)===0)continue;let W=f.normalize(G,MCt),w=f.subtract(i,_,NCt),P=Math.abs(f.dot(w,W));if(P<o){o=P,r=p;let F=f.magnitudeSquared(f.subtract(i,_,w)),M=f.magnitudeSquared(f.subtract(i,C,UCt)),g=f.magnitudeSquared(f.subtract(i,V,kCt));F<M&&F<g?(a=b,c=_,s=F):M<g?(a=h,c=C,s=M):(a=x,c=V,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:f.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function n1e(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(uT(e[i])):t.push(e[i]);return t}r9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,d,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(d=this._layer._data.materialDefinitions[L],c=d,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let R="0";if(l(this._layer._data.textureSetDefinitions))for(let G=0;G<this._layer._data.textureSetDefinitions.length;G++){let W=this._layer._data.textureSetDefinitions[G];for(let w=0;w<W.formats.length;w++){let P=W.formats[w];if(P.format==="jpg"){R=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${R}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=n1e(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=n1e(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,m=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=[],b=[],h=[];u&&(p=[{sampler:0,source:0}],b=[{uri:m}],h=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,R=L.length;for(let G=0;G<R;G++){let W=L[G];if(l(W.material)){for(;W.material>=x.length;){let P=Ue(c,!0);x.push(P)}let w=x[W.material];l(W.extra)&&W.extra.isTransparent?l(w.alphaMode)||(w.alphaMode="BLEND"):w.alphaMode==="BLEND"&&(w.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:b,samplers:h,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var uZ=r9;function Kc(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(Kc.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}}});Kc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new tm(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await eh.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)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function i1e(e,t){let n=new o9(e,t);return e._fields[t.name]=n,n.load()}Kc.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(i1e(this,i))}return Promise.all(t)};Kc.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 i1e(this,o)}return Promise.resolve()};Kc.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)};Kc.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};Kc.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 Kc(e,y(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};Kc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new uZ(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 uZ(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Kc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new i9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Kc.prototype._clearGeometryData=function(){this._geometryData=[]};Kc.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=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=YCt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new pc(0,0,0),u=Vt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Pe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let d=$.fromQuaternion(u),m=$.inverse(d,new $),p=new v(d[0],d[1],d[2],0,d[3],d[4],d[5],0,d[6],d[7],d[8],0,o.x,o.y,o.z,1),b=v.inverse(p,new v),h=v.clone(p);l(this._parent._globalTransform)&&v.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=b,this._inverseRotationMatrix=m;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Kc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Kc.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 n9.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 DCt(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 BCt(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 o1e(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await DCt(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(!BCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Kc.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=o1e(this,t);e.push(n)}return Promise.all(e)};tm.prototype._hookedRequestContent=tm.prototype.requestContent;tm.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 We({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(()=>{o1e(e._i3sNode,n)})),e._isLoading=!1,t})}};function OCt(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 KO(e,t,n,i){let o=e+t*n;return i[o]}function YCt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let d=KO(s,a,n.width,n.buffer),m=KO(c,a,n.width,n.buffer),p=KO(s,u,n.width,n.buffer),b=KO(c,u,n.width,n.buffer),h=OCt(o,r,d,m,p,b);return h=h*n.scale+n.offset,h}Object.defineProperties(tm.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var dZ=Kc;var yoo=S(T(),1);function zO(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(zO.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function $6(e,t){let n=[];for(let i=0;i<e.length;i++){let o=Y.byteToFloat(e[i]);i<3?n.push(uT(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function mZ(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=$6(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=$6(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=$6(a.color,a.transparency)))}break}}return n}function KCt(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=mZ(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],d=n;for(let m=0;m<u.length;m++){let p=u[m];m===u.length-1?d[p]=s:(l(d[p])||(d[p]={}),d=d[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]=mZ(o.symbol,t)}return n}}function zCt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(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(mZ(r.symbol,t)))}return i.symbols.push(void 0),i}}zO.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=mZ(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=mZ(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=KCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=mZ(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=zCt(i,n))}};function r1e(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?r1e(s,t,n,i):s}}function HCt(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 JCt(e,t,n){let i=t[n],o=HCt(e.ranges,i);return e.symbols[o]}zO.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=>r1e(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>JCt(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 s9=zO;function yu(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 We({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(yu.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}}});yu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ue(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new s9(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()};yu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};yu.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}}return 0};yu.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 dZ(this,t,!0)}else this._rootNode=new dZ(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};yu.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]})};yu._fetchJson=function(e){return e.fetchJson()};yu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=yu._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]};yu.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]))};yu.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)?Ue(e):{},e.outlineColor=Y.fromCartesian4(re.fromArray(o))),this._tileset=await xa.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()})};yu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};yu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ue(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var zT=yu;var woo=S(T(),1);function HO(e,t){this._dataProvider=e,this._resource=new We({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(HO.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}}});HO.prototype.load=async function(){return this._data=await eh.loadJson(this._resource),this._data};HO.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 a9=HO;var Doo=S(T(),1);function c9(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(c9.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}}});c9._fromData=async function(e,t,n,i){let o=new c9(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=c9._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new We({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await eh.loadJson(o._resource),c=new zT(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 l9=c9;var c1e=S(s1e(),1);function Ts(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(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(Ts.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}}});Ts.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};Ts.prototype.isDestroyed=function(){return!1};Ts.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Ts.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Ts.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Ts.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 QCt(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 a1e(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=QCt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=l9._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 a9(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 zT(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.`)}Ts.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=We.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Ts.loadJson(n),o=new Ts(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=a1e(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await a1e(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};Ts._fetchJson=function(e){return e.fetchJson()};Ts.loadJson=async function(e){let t=await Ts._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ue(t.error)}return t};Ts.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ue(`Failed to load binary: ${e.url}`);return t};Ts.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 jCt=new B;function qCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let m=c.x;m<=u.x;m++)for(let p=c.y;p<=u.y;p++){let b=B.fromElements(m,p,jCt),h=b.toString();if(!o.hasOwnProperty(h)){let x={x:b.x,y:b.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[h]=x,i.push(x)}}let d=[];for(let m=0;m<i.length;++m){let p=i[m],b=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);d.push(b)}return Promise.all(d).then(function(m){let p=[];for(let b=0;b<m.length;b++){let h={tilingScheme:n,x:i[b].x,y:i[b].y,level:i[b].level},x=m[b],_="Geographic";n._projection instanceof Wi&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===bm.LERC){let V=c1e.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function $Ct(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await qCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Ts.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=$Ct(this),this._geoidDataPromise)};Ts.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};Ts.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Ts.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[]};Ts.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 eh=Ts;var cro=S(T(),1);function l1e(){}Object.defineProperties(l1e.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var eq=l1e;var pro=S(T(),1);var e1t=/\/$/,u1e=new Ct('© <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 fZ(e){e=y(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=We.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();e1t.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 Ct(c))):c=u1e,this._resource=i,this._imageryProvider=new qa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(fZ.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}}});fZ.prototype.getTileCredits=function(e,t,n){};fZ.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};fZ.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};fZ._defaultCredit=u1e;var tq=fZ;var gro=S(T(),1);function nq(e){}nq.prototype.isReady=function(){return!0};nq.prototype.shouldDiscardImage=function(e){return!1};var iq=nq;var Zro=S(T(),1);var t1t=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function QO(e){e=y(e,y.EMPTY_OBJECT);let t=We.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new cs({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(le.southwest(a),r),u=n.positionToTileXY(le.northeast(a),r),d=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),m=y(e.credit,t1t);typeof m=="string"&&(m=new Ct(m)),qa.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(QO.prototype=Object.create(qa.prototype),QO.prototype.constructor=QO);var U0=QO;var Pro=S(T(),1);var n1t=new B(1,1);function oq(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=f.clone(y(e.position,f.ZERO)),this.velocity=f.clone(y(e.velocity,f.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Y.clone(y(e.startColor,Y.WHITE)),this.endColor=Y.clone(y(e.endColor,Y.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=B.clone(y(e.imageSize,n1t)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(oq.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var d1e=new f;oq.prototype.update=function(e,t){return f.multiplyByScalar(this.velocity,e,d1e),f.add(this.position,d1e,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 hZ=oq;var Fro=S(T(),1);function m1e(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(m1e.prototype,{complete:{get:function(){return this._complete}}});var rq=m1e;var Nro=S(T(),1);function f1e(e){}f1e.prototype.emit=function(e){he.throwInstantiationError()};var sq=f1e;var eso=S(T(),1);var h1e=new B(1,1);function u9(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new HM(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._emitterModelMatrix=v.clone(y(e.emitterModelMatrix,v.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new v,this._startColor=Y.clone(y(e.color,y(e.startColor,Y.WHITE))),this._endColor=Y.clone(y(e.color,y(e.endColor,Y.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=B.clone(y(e.imageSize,y(e.minimumImageSize,h1e))),this._maximumImageSize=B.clone(y(e.imageSize,y(e.maximumImageSize,h1e))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(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(u9.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||!v.equals(this._modelMatrix,e),v.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!v.equals(this._emitterModelMatrix,e),v.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Y.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Y.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 i1t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,d=Math.max(a-c.length-u.length,0);for(let m=0;m<d;++m){let p=new hZ;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function o1t(e){let t=e._particlePool.pop();return l(t)||(t=new hZ),t}function r1t(e,t){e._particlePool.push(t)}function s1t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function a1t(e){l(e._billboard)&&(e._billboard.show=!1)}function p1e(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 Y(i,o,r,s),n.scale=X.lerp(t.startScale,t.endScale,t.normalizedAge)}function c1t(e,t){t.startColor=Y.clone(e._startColor,t.startColor),t.endColor=Y.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=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);f.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function l1t(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 jO=new f;u9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Fu),this._updateParticlePool&&(i1t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ne.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)?p1e(this,s):(a1t(s),r1t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=l1t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=v.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=o1t(this),this._emitter.emit(s),f.add(s.position,s.velocity,jO),v.multiplyByPoint(u,jO,jO),s.position=v.multiplyByPoint(u,s.position,s.position),f.subtract(jO,s.position,s.velocity),f.normalize(s.velocity,s.velocity),c1t(this,s),p1e(this,s)}if(this._billboardCollection.update(e),this._previousTime=ne.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 u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&s1t(this)};u9.prototype.isDestroyed=function(){return!1};u9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var aq=u9;var Uso=S(T(),1);var y1e=S(PN(),1);var iso=S(T(),1);var u1t={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}}},pZ=u1t;var HT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function d9(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Y.clone(Y.DARKGRAY),this._highlightColor=Y.clone(Y.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=HT.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=y(e.opaquePass,Ze.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=v.clone(v.IDENTITY),this._modelMatrix=v.clone(v.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=y(e.splitDirection,pl.NONE),this._splittingEnabled=!1,this._error=void 0,d1t(this,e)}Object.defineProperties(d9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return Y.clone(this._highlightColor)},set:function(e){this._highlightColor=Y.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function d1t(e,t){let n=Q_.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=eb.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=HT.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=Y.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 m1t=new f,f1t=new f,h1t=new f,b1e,qO;function p1t(e){if(!l(qO)){b1e=new y1e.default(0),qO=new Array(e);for(let t=0;t<e;++t)qO[t]=b1e.random()}return qO}function b1t(e){let n=e.length/3,i=Math.min(n,20),o=p1t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=f.fromElements(r,r,r,m1t),c=f.fromElements(s,s,s,f1t);for(let d=0;d<i;++d){let m=Math.floor(o[d]*n),p=f.unpack(e,m*3,h1t);f.minimumByComponent(a,p,a),f.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=X.EPSILON2,u}function g1e(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(Bt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var g1t=new re,y1t=new re,x1t=new Y,x1e=0,$O=1,mq=2,_1e=3,_1t=4,cq=new v,S1t=new v;function T1t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,d=l(u),m=e._isQuantized,p=e._isQuantizedDraco,b=e._isOctEncoded16P,h=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,R=e._hasNormals,G=e._hasBatchIds,W,w,P=[],F={};if(e._styleableShaderAttributes=F,d){let k=_1t;for(let O in u)if(u.hasOwnProperty(O)){let U=u[O],j=g1e(U.typedArray,O);W=U.componentCount,w=Q.fromTypedArray(j);let K=ut.createVertexBuffer({context:n,typedArray:j,usage:Me.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:k,vertexBuffer:K,componentsPerAttribute:W,componentDatatype:w,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),F[O]={location:k,componentCount:W},++k}}let M=ut.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=M.sizeInBytes;let g;L&&(g=ut.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let Z;R&&(Z=ut.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=Z.sizeInBytes);let E;G&&(c.typedArray=g1e(c.typedArray,"batchIds"),E=ut.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let I=[];if(m?w=Q.UNSIGNED_SHORT:p?w=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:w=Q.FLOAT,I.push({index:x1e,vertexBuffer:M,componentsPerAttribute:3,componentDatatype:w,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=ae.fromCornerPoints(f.ZERO,e._quantizedVolumeScale):e._boundingSphere=b1t(r.typedArray)),L)if(C)I.push({index:$O,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=V?4:3;I.push({index:$O,vertexBuffer:g,componentsPerAttribute:k,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}R&&(b?(W=2,w=Q.UNSIGNED_BYTE):h?(W=2,w=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(W=3,w=Q.FLOAT),I.push({index:mq,vertexBuffer:Z,componentsPerAttribute:W,componentDatatype:w,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&I.push({index:_1e,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),d&&(I=I.concat(P));let A=new Jn({context:n,attributes:I}),N={depthTest:{enabled:!0}},D={depthTest:{enabled:!0},depthMask:!1,blending:hn.ALPHA_BLEND};e._opaquePass===Ze.CESIUM_3D_TILE&&(N.stencilTest=Yt.setCesium3DTileBit(),N.stencilMask=Yt.CESIUM_3D_TILE_MASK,D.stencilTest=Yt.setCesium3DTileBit(),D.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Oe.fromCache(N),e._translucentRenderState=Oe.fromCache(D),e._drawCommand=new He({boundingVolume:new ae,cull:e._cull,modelMatrix:new v,primitiveType:Ae.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ze.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function C1t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=g1t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===oe.SCENE2D||c instanceof un?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return Y.TRANSPARENT;let c=Y.clone(a.edgeColor,x1t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return v.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);v.multiply(n.uniformState.view3D,c,cq);let u=v.multiply(cq,a.modelMatrix,cq);return v.inverseTranspose(u,S1t)}};pZ.addUniforms(e,s),(i||o||r)&&(s=ft(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=y1t;if(l(e._quantizedVolumeScale)){let c=f.clone(e._quantizedVolumeScale,a);f.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function lq(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 uq(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 dq(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 V1t={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 L1t(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,d=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,b=e._isTranslucent,h=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,R=e.clippingPlanes,G=e._attenuation,W,w,P,F=b,M=Ue(V1t),g={},Z=e._styleableShaderAttributes;for(o in Z)Z.hasOwnProperty(o)&&(r=Z[o],M[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let ce={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";W=n.getColorShaderFunction(`getColorFromStyle${ye}`,M,ce),w=n.getShowShaderFunction(`getShowFromStyle${ye}`,M,ce),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,M,ce),l(W)&&ce.translucent&&(F=!0)}e._styleTranslucent=F;let E=l(W),I=l(w),A=l(P),N=e.isClipped,D=[],k=[];E&&(lq(W,D),uq(W,k)),I&&(lq(w,D),uq(w,k)),A&&(lq(P,D),uq(P,k));let O=k.indexOf("COLOR")>=0,U=k.indexOf("NORMAL")>=0;if(U&&!x)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");for(o in Z)if(Z.hasOwnProperty(o)){r=Z[o];let ce=D.indexOf(r.location)>=0,ye=dq(L,r.location);ye.enabled=ce}let j=h&&(!E||O);if(h){let ce=dq(L,$O);ce.enabled=j}let K=x&&(V||C||U);if(x){let ce=dq(L,mq);ce.enabled=K}let te={a_position:x1e};j&&(te.a_color=$O),K&&(te.a_normal=mq),_&&(te.a_batchId=_1e);let z="",q=D.length;for(i=0;i<q;++i){let ce=D[i];r=g[ce];let ye=r.componentCount,Te=`czm_3dtiles_property_${ce}`,Le;ye===1?Le="float":Le=`vec${ye}`,z+=`in ${Le} ${Te}; -`,te[Te]=r.location}C1t(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; -`,G&&(ee+=`float u_geometricError; -float u_depthMultiplier; -`),ee+=z,j&&(b?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&&(d||m?ee+=`in vec2 a_normal; -`:ee+=`in vec3 a_normal; -`),_&&(ee+=`in float a_batchId; -`),(c||u||m)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),E&&(ee+=W),I&&(ee+=w),A&&(ee+=P),ee+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,G&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),j?b?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||u?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?(d?ee+=` vec3 normal = czm_octDecode(a_normal); -`:m?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); -`,E&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),A?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:G?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&&V&&(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&&C&&(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; -`;N&&(pe+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,pe+=` -`,pe+=T0(R,s),pe+=` -`),pe+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,N&&(pe+=t9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),pe+=`} -`,e.splitDirection!==pl.NONE&&(pe=pZ.modifyFragmentShader(pe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(pe=e._fragmentShaderLoaded(pe));let xe=e._drawCommand;l(xe.shaderProgram)&&xe.shaderProgram.destroy(),xe.shaderProgram=qt.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:pe,attributeLocations:te});try{xe.shaderProgram._bind()}catch{throw new ue("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Z1t(e,t){if(e._decodingState===HT.READY)return!1;if(e._decodingState===HT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=ab.decodePointCloud(i,t);l(o)&&(e._decodingState=HT.DECODING,o.then(function(r){e._decodingState=HT.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,d=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=f.fromElements(C,C,C),e._quantizedVolumeOffset=f.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let b=n.styleableProperties,h=i.batchTableProperties;for(let _ in h)if(h.hasOwnProperty(_)){let C=r[_];l(b)||(b={}),b[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(d)&&(n.batchIds={typedArray:d}),n.styleableProperties=b}).catch(function(r){e._decodingState=HT.FAILED,e._error=r}))}return!0}var R1t=new re,G1t=new f;d9.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(Z1t(this,t))return;let i=!1,o=!v.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(T1t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){v.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(v.clone(this._modelMatrix,u),l(this._rtcCenter)&&v.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&v.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let m=e.mapProjection,p=v.getColumn(u,3,R1t);re.equals(p,re.UNIT_W)||Vt.basisTo2D(m,u,u)}let d=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,d),this._cull){let m=d.center;v.multiplyByPoint(u,m,m);let p=v.getScale(u,G1t);d.radius*=f.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!==pl.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&L1t(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?Ze.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};d9.prototype.isDestroyed=function(){return!1};d9.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var m9=d9;var Bso=S(T(),1);function yd(){he.throwInstantiationError()}yd.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(yd.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});yd.prototype.update=he.throwInstantiationError;yd.prototype.beginUpdate=he.throwInstantiationError;yd.prototype.endUpdate=he.throwInstantiationError;yd.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;yd.prototype.loadTile=he.throwInstantiationError;yd.prototype.computeTileVisibility=he.throwInstantiationError;yd.prototype.showTileThisFrame=he.throwInstantiationError;yd.prototype.computeDistanceToTile=he.throwInstantiationError;yd.prototype.isDestroyed=he.throwInstantiationError;yd.prototype.destroy=he.throwInstantiationError;var fq=yd;var Hso=S(T(),1);function hq(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(hq.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});hq.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=f.fromElements(o,r,s,e.position),e.velocity=f.normalize(e.position,e.velocity)};var pq=hq;var jso=S(T(),1);function f9(){}f9.prototype.evaluate=function(e,t){he.throwInstantiationError()};f9.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};f9.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};f9.prototype.getVariables=function(){he.throwInstantiationError()};var bq=f9;var nao=S(T(),1);function bZ(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,W1t(this,e)}Object.defineProperties(bZ.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}}});bZ.fromWorldTerrain=function(e){return new bZ(nT(e))};bZ.fromWorldBathymetry=function(e){return new bZ(Bw(e))};function E1t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function W1t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){E1t(e._errorEvent,i)}}var h9=bZ;var rao=S(T(),1);function gZ(){}gZ.prototype.boundingVolume=void 0;gZ.prototype.boundingSphere=void 0;gZ.prototype.distanceToCamera=function(e){he.throwInstantiationError()};gZ.prototype.intersectPlane=function(e){he.throwInstantiationError()};gZ.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var gq=gZ;var mao=S(T(),1);function p9(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new _i({ellipsoid:e.ellipsoid}),this._color=y(e.color,Y.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(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(p9.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}}});p9.prototype.getTileCredits=function(e,t,n){};p9.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)};p9.prototype.pickFeatures=function(e,t,n,i,o){};var b9=p9;var xao=S(T(),1);function g9(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new _i({ellipsoid:e.ellipsoid}),this._color=y(e.color,Y.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._readyPromise=Promise.resolve(!0),this._type="flw",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(g9.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});g9.prototype.getTileCredits=function(e,t,n){};g9.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n),c=Cesium.Cartesian3.fromDegrees(a.west,a.south),u=Cesium.Cartesian3.fromDegrees(a.east,a.south),d=Cesium.Cartesian3.fromDegrees(a.west,a.north),m=Number(Cesium.Cartesian3.distance(c,u).toFixed(2)),p=Number(Cesium.Cartesian3.distance(c,d).toFixed(2)),b="m",h="m";return m>=1e3&&(m=Number((m/1e3).toFixed(2)),b="\u339E"),p>=1e3&&(p=Number((p/1e3).toFixed(2)),h="\u339E"),r.fillText(`${m} ${b}`,124,246),r.textAlign="left",r.fillText(`${p} ${h}`,14,136),Promise.resolve(o)};g9.prototype.pickFeatures=function(e,t,n,i,o){};var yq=g9;var Zao=S(T(),1);function y9(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new _i({ellipsoid:e.ellipsoid}),this._color=y(e.color,Y.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._readyPromise=Promise.resolve(!0),this._type="jww",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(y9.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});y9.prototype.getTileCredits=function(e,t,n){};y9.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n);return e%2&&t%2&&r.fillText(`${a.south<0?"S":"N"} ${Math.abs(Number(a.south.toFixed(1)))}\xB0`,124,246),!(e%2)&&!(t%2)&&(r.textAlign="left",r.fillText(`${a.west<0?"W":"E"} ${Math.abs(Number(a.west.toFixed(1)))}\xB0`,14,136)),Promise.resolve(o)};y9.prototype.pickFeatures=function(e,t,n,i,o){};var xq=y9;var Eao=S(T(),1);function _q(e){he.throwInstantiationError()}_q.prototype.isReady=he.throwInstantiationError;_q.prototype.shouldDiscardImage=he.throwInstantiationError;var Sq=_q;var Iao=S(T(),1),I1t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Tq=Object.freeze(I1t);var Jao=S(T(),1);function QT(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this.shadows=y(e.shadows,Cn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Zh(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 pb,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(QT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function X1t(e){return`uniform vec4 czm_pickColor; -${e}`}function P1t(e){return function(t){return ft(t,{czm_pickColor:function(){return e._pickId.color}})}}function v1t(){return"czm_pickColor"}QT.prototype.makeStyleDirty=function(){this._styleDirty=!0};QT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var w1t=new ne;function Vq(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function JT(e,t){return e._intervals.indexOf(t.start)}function F1t(e,t){let n=e._intervals,i=e._clock,o=Vq(e);if(o===0)return;let r=e._getAverageLoadTime(),s=ne.addSeconds(i.currentTime,r*o,w1t),a=n.indexOf(s),c=JT(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function A1t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function M1t(e,t,n){let i=Vq(e),o=JT(e,t),r=JT(e,n);return i>=0?o>=r:o<=r}function T1e(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 N1t(e,t,n){let i=JT(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?v.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Si(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,We.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new m9({arrayBuffer:u,cull:!0,fragmentShaderLoaded:X1t,uniformMapLoaded:P1t(e),pickIdLoaded:v1t})}).catch(T1e(e,c))}return r}function U1t(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 k1t(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(C1e(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Si()-t.timestamp)/1e3;U1t(e,a)}}t.touchedFrameNumber=i.frameNumber}var D1t=new v;function B1t(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 O1t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Y1t=new Zh;function C1e(e,t,n,i){let o=y(e.shading,Y1t),r=t.pointCloud,s=y(t.transform,v.IDENTITY);r.modelMatrix=v.multiplyTransformation(e.modelMatrix,s,D1t),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=B1t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=O1t(e);try{r.update(i)}catch(a){T1e(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Cq(e,t,n,i){let o=N1t(e,t,i);k1t(e,o,n,i)}function K1t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function V1e(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 z1t(e,t){let n=JT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function S1e(e,t,n,i,o){return l(n)?n.ready?!0:(Cq(e,t,i,o),n.ready):!1}function H1t(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,d=JT(e,n),m=JT(e,t);if(d>=m){for(r=d;r>=m;--r)if(s=c.get(r),a=u[r],S1e(e,s,a,i,o))return s}else for(r=d;r<=m;++r)if(s=c.get(r),a=u[r],S1e(e,s,a,i,o))return s;return t}function J1t(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 yZ={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};QT.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=ne.clone(e.time));let t=Math.max(ne.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)&&J1t(this,o,s),yZ.timeSinceLoad=t,yZ.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,d=u.length,m=this._previousInterval,p=this._nextInterval,b=A1t(this);if(!l(b))return;let h=!1,x=Vq(this),_=x===0;x!==this._clockMultiplier&&(h=!0,this._clockMultiplier=x),(!l(m)||_)&&(m=b),(!l(p)||h||M1t(this,b,p))&&(p=F1t(this,b)),m=H1t(this,m,b,yZ,e);let C=z1t(this,m);l(C)||(Cq(this,m,yZ,e),C=this._lastRenderedFrame),l(C)&&C1e(this,C,yZ,e),l(p)&&Cq(this,p,yZ,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,R=this.maximumMemoryUsage*1024*1024;L>R&&V1e(this,K1t(e));let W=u.length-d;l(a)&&a.attenuation&&a.eyeDomeLighting&&W>0&&c.update(e,d,a,this.boundingSphere)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return V1e(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var xZ=QT;var aco=S(T(),1);function e3(e,t){this.show=!0,l(e)||(e=new Je),this.rectangle=Je.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new Y(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}e3.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Je.equals(t.viewport,this.rectangle))&&(this._rs=Oe.fromCache({blending:hn.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,WF]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ze.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};e3.prototype.isDestroyed=function(){return!1};e3.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var Lq=e3;var uco=S(T(),1);function Zq(){he.throwInstantiationError()}Object.defineProperties(Zq.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});Zq.prototype.requestData=he.throwInstantiationError;var Rq=Zq;var fco=S(T(),1);function jT(){he.throwInstantiationError()}Object.defineProperties(jT.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});jT.prototype.update=he.throwInstantiationError;jT.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;jT.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;jT.DefaultMinBounds=he.throwInstantiationError;jT.DefaultMaxBounds=he.throwInstantiationError;var Gq=jT;var pco=S(T(),1),Eq=`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 Cco=S(T(),1);function Q1t(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,nt.RGBA),this.pixelDatatype=y(e.pixelDatatype,ze.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=We.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?ln.REPEAT:ln.CLAMP_TO_EDGE;this.sampler=new Qt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Wq=Q1t;var Lco=S(T(),1),j1t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},Iq=Object.freeze(j1t);var Gco=S(T(),1);function q1t(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: ${ip(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 Xq=q1t;var X0o=S(T(),1);var nlo=S(T(),1);var Jco=S(T(),1);function qT(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoadFromCache=o=>{Pq(this),this._texture=o,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,n()},t._failLoad=o=>{i(o)},t._completeLoad=()=>{this._ready=!0,n()}})}Object.defineProperties(qT.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});qT.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var $1t=new f(1,0,0),eVt=new f(0,0,1),tVt=new f(-1,0,0),nVt=new f(0,0,-1),t3=new f(0,1,0),iVt=new f(0,-1,0),R1e=[t3,tVt,eVt,iVt,$1t,t3,nVt,t3,t3],G1e=R1e.length,E1e=new Float32Array(G1e*3),L1e=0;for(let e=0;e<G1e;++e,L1e+=3)f.pack(R1e[e],E1e,L1e);var oVt=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),rVt=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function sVt(e){let t=ut.createVertexBuffer({context:e,typedArray:oVt,usage:Me.STATIC_DRAW}),n=ut.createVertexBuffer({context:e,typedArray:E1e,usage:Me.STATIC_DRAW}),i=ut.createIndexBuffer({context:e,typedArray:rVt,usage:Me.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:Q.FLOAT}];return new Jn({context:e,attributes:o,indexBuffer:i})}function Z1e(e){return function(){return e}}function Pq(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(l(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}qT.prototype.update=function(e){let t=e.context;if(!qT.isSupported(t)||(l(this._texture)&&l(this._va)&&Pq(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let b=e.context.textureCache.getTexture(this._url);l(b)&&this._completeLoadFromCache(b)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let b=this;Ns(this._url).then(function(h){b._cubeMapBuffers=h,b._loading=!1}).catch(function(h){b._failLoad(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;l(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT;let r=nt.RGBA,s=new De({defines:i,sources:[f_]});this._va=sVt(t),this._sp=qt.fromCache({context:t,vertexShaderSource:h_,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),d=n[0].positiveX.width*2,m={originalSize:function(){return d}};for(let b=0;b<a;++b){let h=n[b].positiveY;n[b].positiveY=n[b].negativeY,n[b].negativeY=h;let x=c[b]=new da({context:t,source:n[b],pixelDatatype:o}),_=c[b].width*2,C=u[b]=new bt({context:t,width:_,height:_,pixelDatatype:o,pixelFormat:r}),V=new ka({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:Z1e(x)},outputTexture:C,persists:!0,owner:this});e.commandList.push(V),m[`texture${b}`]=Z1e(C)}this._texture=new bt({context:t,width:d*1.5+2,height:d,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new ka({fragmentShaderSource:m_,uniformMap:m,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._completeLoad()};qT.prototype.isDestroyed=function(){return!1};qT.prototype.destroy=function(){return Pq(this),this._texture=this._texture&&this._texture.destroy(),de(this)};var _Z=qT;function x9(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?B.clone(e.imageBasedLightingFactor):new B(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=B.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i}Object.defineProperties(x9.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=B.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=B.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},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._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||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}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function aVt(e,t){if(_Z.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new _Z(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,n.readyPromise.then(function(){e._specularEnvironmentMapLoaded=!0}).catch(function(i){console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}x9.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;B.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=B.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),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._specularEnvironmentMapAtlasDirty&&(aVt(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);let o=!l(this._specularEnvironmentMapAtlas)&&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._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};x9.prototype.isDestroyed=function(){return!1};x9.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),de(this)};var n3=x9;var llo=S(T(),1);var rlo=S(T(),1);function cVt(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var To=cVt;function en(){}en.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}}};en.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}}};en.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?en.objectLegacy(i,n):en.object(i,n)};en.accessor=function(e,t){return en.topLevel(e,"accessors",t)};en.accessorWithSemantic=function(e,t,n){let i={};return en.mesh(e,function(o){return en.meshPrimitive(o,function(r){let s=en.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:en.meshPrimitiveTarget(r,function(a){return en.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let d=n(c);if(l(d))return d}})})})})};en.accessorContainingVertexAttributeData=function(e,t){let n={};return en.mesh(e,function(i){return en.meshPrimitive(i,function(o){let r=en.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:en.meshPrimitiveTarget(o,function(s){return en.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};en.accessorContainingIndexData=function(e,t){let n={};return en.mesh(e,function(i){return en.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}})})};en.animation=function(e,t){return en.topLevel(e,"animations",t)};en.animationChannel=function(e,t){let n=e.channels;return en.object(n,t)};en.animationSampler=function(e,t){let n=e.samplers;return en.object(n,t)};en.buffer=function(e,t){return en.topLevel(e,"buffers",t)};en.bufferView=function(e,t){return en.topLevel(e,"bufferViews",t)};en.camera=function(e,t){return en.topLevel(e,"cameras",t)};en.image=function(e,t){return en.topLevel(e,"images",t)};en.material=function(e,t){return en.topLevel(e,"materials",t)};en.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}};en.mesh=function(e,t){return en.topLevel(e,"meshes",t)};en.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}}};en.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}};en.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}}};en.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}};en.node=function(e,t){return en.topLevel(e,"nodes",t)};en.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=en.nodeInTree(e,u,n),l(c)))return c}}}};en.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return en.nodeInTree(e,i,n)};en.program=function(e,t){return To(e,"KHR_techniques_webgl")?en.object(e.extensions.KHR_techniques_webgl.programs,t):en.topLevel(e,"programs",t)};en.sampler=function(e,t){return en.topLevel(e,"samplers",t)};en.scene=function(e,t){return en.topLevel(e,"scenes",t)};en.shader=function(e,t){return To(e,"KHR_techniques_webgl")?en.object(e.extensions.KHR_techniques_webgl.shaders,t):en.topLevel(e,"shaders",t)};en.skin=function(e,t){return en.topLevel(e,"skins",t)};en.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}}};en.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}};en.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}};en.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}};en.technique=function(e,t){return To(e,"KHR_techniques_webgl")?en.object(e.extensions.KHR_techniques_webgl.techniques,t):en.topLevel(e,"techniques",t)};en.texture=function(e,t){return en.topLevel(e,"textures",t)};var Ge=en;var qbo=S(T(),1);var Rlo=S(T(),1);var mlo=S(T(),1);function lVt(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Po=lVt;var xlo=S(T(),1);var hlo=S(T(),1);function uVt(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 xu=uVt;function dVt(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)*xu(t.type)}var xd=dVt;function mVt(e){Ge.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Ge.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){if(i.mode=y(i.mode,H.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Po(e.materials,o)}})}),Ge.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=xd(e,i),r.target=H.ARRAY_BUFFER}}),Ge.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=H.ELEMENT_ARRAY_BUFFER}}),Ge.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Ge.materialValue(n,function(c){l(c.index)&&$T(c)}),$T(n.emissiveTexture),$T(n.normalTexture),$T(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),$T(s.baseColorTexture),$T(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),$T(a.specularGlossinessTexture))}),Ge.animation(e,function(n){Ge.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=fVt(e);return Ge.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Ge.sampler(e,function(n){n.wrapS=y(n.wrapS,H.REPEAT),n.wrapT=y(n.wrapT,H.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function fVt(e){let t={};return Ge.animation(e,function(n){Ge.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 $T(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var W1e=mVt;var Ilo=S(T(),1);function hVt(e){return Ge.shader(e,function(t){i3(t)}),Ge.buffer(e,function(t){i3(t)}),Ge.image(e,function(t){i3(t)}),i3(e),e}function i3(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var _9=hVt;var zlo=S(T(),1);var Mlo=S(T(),1);var vlo=S(T(),1);function pVt(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 I1e=pVt;function bVt(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),I1e(e,t),n.length===0&&delete e.extensionsUsed}}var o3=bVt;var gVt=4;function yVt(e){if(cl(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=X1e(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ue("Binary glTF version is not 1 or 2");return i===1?xVt(e,n):_Vt(e,n)}function X1e(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*gVt,!0);return o}function xVt(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ue("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Os(e,r,i),c=JSON.parse(a);_9(c);let u=e.subarray(s,n),d=c.buffers;if(l(d)&&Object.keys(d).length>0){let m=y(d.binary_glTF,d.KHR_binary_glTF);l(m)&&(m.extras._pipeline.source=u,delete m.uri)}return o3(c,"KHR_binary_glTF"),c}function _Vt(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=X1e(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let d=Os(u);o=JSON.parse(d),_9(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var vq=yVt;var Gdo=S(T(),1);var jlo=S(T(),1);function SVt(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Po(n,t,!0)}var k0=SVt;var auo=S(T(),1);var euo=S(T(),1);function TVt(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 r3=TVt;function CVt(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=xu(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,m=i[u].extras._pipeline.source,p=t.count,b=xd(e,t),h=t.byteOffset+c.byteOffset+m.byteOffset,x=t.componentType,_=Q.getSizeInBytes(x),C=new DataView(m.buffer),V=new Array(r),L=r3(x);for(let R=0;R<p;R++){L(C,h,r,_,V);for(let G=0;G<r;G++){let W=V[G];s[G]=Math.min(s[G],W),a[G]=Math.max(a[G],W)}h+=b}return{min:s,max:a}}var s3=CVt;var huo=S(T(),1);var VVt=[H.FUNC_ADD,H.FUNC_ADD],LVt=[H.ONE,H.ZERO,H.ONE,H.ZERO];function P1e(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var ZVt=[H.ZERO,H.ONE,H.SRC_COLOR,H.ONE_MINUS_SRC_COLOR,H.SRC_ALPHA,H.ONE_MINUS_SRC_ALPHA,H.DST_ALPHA,H.ONE_MINUS_DST_ALPHA,H.DST_COLOR,H.ONE_MINUS_DST_COLOR];function RVt(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(ZVt.indexOf(e[n])===-1)return t;return e}function GVt(e){let t={},n={},i=e.techniques;return l(i)&&(Ge.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(P1e(s,H.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,VVt),blendFactors:RVt(c.blendFuncSeparate,LVt)})}P1e(s,H.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),k0(e,"KHR_blend")),Ge.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Ge.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 v1e=GVt;var Zuo=S(T(),1);var xuo=S(T(),1);function EVt(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Po(n,t,!0),k0(e,t)}var w1e=EVt;function WVt(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ge.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},d;if(Ge.techniqueAttribute(a,function(m,p){d=a.parameters[m],u.attributes[p]={semantic:d.semantic}}),Ge.techniqueUniform(a,function(m,p){d=a.parameters[m],u.uniforms[p]={count:d.count,node:d.node,type:d.type,semantic:d.semantic,value:d.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))u.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},b=e.shaders[m.fragmentShader];p.fragmentShader=Po(r.shaders,b,!0);let h=e.shaders[m.vertexShader];p.vertexShader=Po(r.shaders,h,!0),u.program=Po(r.programs,p),o[a.program]=u.program}i[c]=Po(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,k0(e,"KHR_techniques_webgl"),w1e(e,"KHR_techniques_webgl"))}return Ge.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Ge.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var F1e=WVt;var Muo=S(T(),1);var Iuo=S(T(),1);function IVt(e,t){no.typeOf.object("material",e),no.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,u=r.values.specular;if(l(s)&&l(s.index)){let d=t(s.index,s);if(l(d))return d}if(l(a)&&l(a.index)){let d=t(a.index,a);if(l(d))return d}if(l(c)&&l(c.index)){let d=t(c.index,c);if(l(d))return d}if(l(u)&&l(u.index)){let d=t(u.index,u);if(l(d))return d}}}let i=Ge.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var wq=IVt;var A1e=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function XVt(e,t){return t=y(t,A1e),A1e.forEach(function(n){t.indexOf(n)>-1&&vVt(e,n)}),e}var PVt={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function vVt(e,t){let n=PVt[t],i=e[n];if(l(i)){let o=0,r=Tp[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Sp[t](e,a-o),o++)}}function Sp(){}Sp.accessor=function(e,t){e.accessors.splice(t,1),Ge.mesh(e,function(i){Ge.meshPrimitive(i,function(o){Ge.meshPrimitiveAttribute(o,function(s,a){s>t&&o.attributes[a]--}),Ge.meshPrimitiveTarget(o,function(s){Ge.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let r=o.indices;l(r)&&r>t&&o.indices--})}),Ge.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ge.animation(e,function(i){Ge.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Sp.buffer=function(e,t){e.buffers.splice(t,1),Ge.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--})};Sp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ge.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ge.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ge.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),To(e,"KHR_draco_mesh_compression")&&Ge.mesh(e,function(i){Ge.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--})}),To(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(To(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let d=c[u];l(d.values)&&d.values>t&&d.values--,l(d.arrayOffsets)&&d.arrayOffsets>t&&d.arrayOffsets--,l(d.stringOffsets)&&d.stringOffsets>t&&d.stringOffsets--}}}}};Sp.image=function(e,t){e.images.splice(t,1),Ge.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})};Sp.mesh=function(e,t){e.meshes.splice(t,1),Ge.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Sp.node=function(e,t){e.nodes.splice(t,1),Ge.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})}),Ge.animation(e,function(i){Ge.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Ge.technique(e,function(i){Ge.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Ge.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}))}),Ge.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Sp.material=function(e,t){e.materials.splice(t,1),Ge.mesh(e,function(i){Ge.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Sp.sampler=function(e,t){e.samplers.splice(t,1),Ge.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Sp.texture=function(e,t){if(e.textures.splice(t,1),Ge.material(e,function(i){wq(i,function(o,r){r.index>t&&--r.index})}),To(e,"EXT_feature_metadata")){Ge.mesh(e,function(r){Ge.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let d=u.length;for(let m=0;m<d;++m){let b=u[m].featureIds.texture;b.index>t&&--b.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 d=a[c].texture;d.index>t&&--d.index}}}}if(To(e,"EXT_mesh_features")&&Ge.mesh(e,function(i){Ge.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let d=a[u];l(d.texture)&&d.texture.index>t&&--d.texture.index}}}})}),To(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let d=c[u];d.index>t&&--d.index}}}}};function Tp(){}Tp.accessor=function(e){let t={};return Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){Ge.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Ge.meshPrimitiveTarget(i,function(r){Ge.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Ge.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ge.animation(e,function(n){Ge.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),To(e,"EXT_mesh_gpu_instancing")&&Ge.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})}),t};Tp.buffer=function(e){let t={};return Ge.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};Tp.bufferView=function(e){let t={};if(Ge.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ge.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ge.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),To(e,"KHR_draco_mesh_compression")&&Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),To(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(To(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Tp.image=function(e){let t={};return Ge.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};Tp.mesh=function(e){let t={};return Ge.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 M1e(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!M1e(e,o,n)}).length===0}Tp.node=function(e){let t={};return Ge.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ge.skinJoint(n,function(i){t[i]=!0})}),Ge.animation(e,function(n){Ge.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ge.technique(e,function(n){Ge.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ge.node(e,function(n,i){M1e(e,i,t)||(t[i]=!0)}),t};Tp.material=function(e){let t={};return Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Tp.texture=function(e){let t={};if(Ge.material(e,function(n){wq(n,function(i){t[i]=!0})}),To(e,"EXT_feature_metadata")){Ge.mesh(e,function(o){Ge.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let d=0;d<u;++d){let p=c[d].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 u=s[a].texture;t[u.index]=!0}}}}if(To(e,"EXT_mesh_features")&&Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),To(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Tp.sampler=function(e){let t={};return Ge.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var N1e=XVt;var tdo=S(T(),1);var kuo=S(T(),1);function wVt(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Po(e.buffers,n),byteOffset:0,byteLength:t.length};return Po(e.bufferViews,o)}var U1e=wVt;var Huo=S(T(),1);function FVt(e,t){let n=xd(e,t),i=Q.getSizeInBytes(t.componentType),o=xu(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,d=new DataView(c.buffer),m=new Array(o),p=r3(t.componentType);for(let b=0;b<r;++b){p(d,u,o,i,m);for(let h=0;h<o;++h)s[b*o+h]=m[h];u+=n}return s}var k1e=FVt;function AVt(e){let t;return Ge.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===H.BYTE?a3(e,i,Q.UNSIGNED_BYTE):t!==H.UNSIGNED_BYTE&&t!==H.UNSIGNED_SHORT&&a3(e,i,Q.UNSIGNED_SHORT)}),Ge.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===H.BYTE?a3(e,i,Q.UNSIGNED_BYTE):t===H.SHORT&&a3(e,i,Q.UNSIGNED_SHORT)}),e}function a3(e,t,n){let i=Q.createTypedArray(n,k1e(e,t)),o=new Uint8Array(i.buffer);t.bufferView=U1e(e,o),t.componentType=n,t.byteOffset=0}var D1e=AVt;var sdo=S(T(),1);function MVt(e,t){return o3(e,t),t==="CESIUM_RTC"&&NVt(e),Fq(e,t)}function NVt(e){Ge.technique(e,function(t){Ge.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Fq(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Fq(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)&&Fq(e[o],t);return i}}var c3=MVt;var l3={.8:YVt,"1.0":mLt,"2.0":void 0};function UVt(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(l3,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(l3,i)||(i="1.0"));let o=l3[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=l3[i];return t.keepLegacyExtensions||(pLt(e),bLt(e)),e}function O1e(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 kVt(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=y(a.primitive,H.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function DVt(e){let t=e.nodes,n=new f,i=new Pe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;f.fromArray(a,0,n),Pe.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 BVt(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new f,a=new Pe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],d=u.channels,m=u.parameters,p=u.samplers;if(l(d)){let b=d.length;for(let h=0;h<b;++h){let x=d[h];if(x.target.path==="rotation"){let _=m[p[x.sampler].output];if(l(r[_]))continue;r[_]=!0;let C=n[_],V=i[C.bufferView],R=o[V.buffer].extras._pipeline.source,G=R.byteOffset+V.byteOffset+C.byteOffset,W=C.componentType,w=C.count,P=xu(C.type),F=C.count*P,M=Q.createArrayBufferView(W,R.buffer,G,F);for(let g=0;g<w;g++){let Z=g*P;f.unpack(M,Z,s);let E=M[Z+3];Pe.fromAxisAngle(s,E,a),Pe.pack(a,M,Z)}}}}}}function OVt(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=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function YVt(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,O1e(e),kVt(e),DVt(e),BVt(e),OVt(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,k0(e,"KHR_materials_common")}}function KVt(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 B1e(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 zVt(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]=B1e(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]),Ge.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ge.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ge.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}}),Ge.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ge.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ge.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]})})}),Ge.mesh(e,function(s){Ge.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ge.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ge.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let d={mesh:n.meshes[c[t]]},m=Po(e.nodes,d);l(a)||(a=[],s.children=a),a.push(m)}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 d=e.skins[s.skin];d.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ge.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Ge.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]]}}),Ge.animation(e,function(s){let a={};s.samplers=B1e(s.samplers,a),Ge.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ge.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ge.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ge.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ge.materialValue(c,function(u,d){typeof u=="string"&&(c.values[d]={index:n.textures[u]})})}}),Ge.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}}),Ge.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function HVt(e){Ge.animation(e,function(t){Ge.animationSampler(t,function(n){delete n.name})})}function JVt(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]}Ge.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function QVt(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var jVt={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function qVt(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(jVt[o])&&e.extensionsRequired.push(o)}}}function $Vt(e){Ge.buffer(e,function(t){delete t.type})}function eLt(e){Ge.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function tLt(e){Ge.mesh(e,function(t){Ge.meshPrimitive(t,function(n){Ge.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})}),Ge.technique(e,function(t){Ge.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var nLt={POSITION:!0,NORMAL:!0,TANGENT:!0},iLt={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function oLt(e){let t={};Ge.mesh(e,function(n){Ge.meshPrimitive(n,function(i){Ge.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,d=iLt[a];l(d)?(u=d+c,t[r]=u):l(nLt[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Ge.technique(e,function(n){Ge.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function rLt(e){Ge.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 Aq(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:xd(e,t)}function sLt(e){Ge.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ge.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=Aq(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function aLt(e){let t,n,i,o=e.bufferViews,r={};Ge.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Ge.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(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,b){return p.byteOffset-b.byteOffset});let u=0,d=0,m=c.length;for(t=0;t<m;++t){let p=c[t],b=Aq(e,p),h=p.byteOffset,x=p.count*b;delete p.byteStride;let _=t<m-1,C=_?Aq(e,c[t+1]):void 0;if(b!==C){let V=Ue(i,!0);r[a]&&(V.byteStride=b),V.byteOffset+=u,V.byteLength=h+x-u;let L=Po(o,V);for(n=d;n<=t;++n)p=c[n],p.bufferView=L,p.byteOffset=p.byteOffset-u;u=_?c[t+1].byteOffset:void 0,d=t+1}}}N1e(e,["accessor","bufferView","buffer"])}function cLt(e){Ge.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=s3(e,n);n.min=i.min,n.max=i.max}})}function Y1e(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)||f.fromArray(e.translation).equals(f.ZERO))&&(!l(e.scale)||f.fromArray(e.scale).equals(new f(1,1,1)))&&(!l(e.rotation)||re.fromArray(e.rotation).equals(new re(0,0,0,1)))&&(!l(e.matrix)||v.fromColumnMajorArray(e.matrix).equals(v.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function K1e(e,t){Ge.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}}}),Ge.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Y1e(n)&&K1e(e,i))}}),delete e.nodes[t]}function lLt(e){return Ge.node(e,function(t,n){Y1e(t)&&K1e(e,n)}),e}function uLt(e){Ge.animation(e,function(t){Ge.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=s3(e,i);i.min=o.min,i.max=o.max}})})}function dLt(e){Ge.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=s3(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function mLt(e){e.asset=y(e.asset,{}),e.asset.version="2.0",O1e(e),KVt(e),lLt(e),zVt(e),HVt(e),QVt(e),qVt(e),sLt(e),aLt(e),cLt(e),uLt(e),dLt(e),$Vt(e),eLt(e),tLt(e),oLt(e),D1e(e),rLt(e),v1e(e),F1e(e),JVt(e)}var fLt=["u_tex","u_diffuse","u_emission"],hLt=["u_diffuse"];function Mq(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function u3(e){return l(e.index)}function d3(e){return Array.isArray(e)&&e.length===4}function z1e(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 pLt(e){Ge.material(e,function(t){Ge.materialValue(t,function(n,i){fLt.indexOf(i)!==-1&&u3(n)?(Mq(t),t.pbrMetallicRoughness.baseColorTexture=n):hLt.indexOf(i)!==-1&&d3(n)&&(Mq(t),t.pbrMetallicRoughness.baseColorFactor=z1e(n))})}),c3(e,"KHR_techniques_webgl"),c3(e,"KHR_blend")}function bLt(e){Ge.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(k0(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,u=n.doubleSided,d=n.transparent;Mq(t),l(r)&&(d3(r)?t.emissiveFactor=r.slice(0,3):u3(r)&&(t.emissiveTexture=r)),l(s)&&(d3(s)?t.pbrMetallicRoughness.baseColorFactor=z1e(s):u3(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(d3(a)?t.emissiveFactor=a.slice(0,3):u3(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}}),c3(e,"KHR_materials_common")}var H1e=UVt;var Pdo=S(T(),1);var D0={X:0,Y:1,Z:2};D0.Y_UP_TO_Z_UP=v.fromRotationTranslation($.fromRotationX(X.PI_OVER_TWO));D0.Z_UP_TO_Y_UP=v.fromRotationTranslation($.fromRotationX(-X.PI_OVER_TWO));D0.X_UP_TO_Z_UP=v.fromRotationTranslation($.fromRotationY(-X.PI_OVER_TWO));D0.Z_UP_TO_X_UP=v.fromRotationTranslation($.fromRotationY(X.PI_OVER_TWO));D0.X_UP_TO_Y_UP=v.fromRotationTranslation($.fromRotationZ(X.PI_OVER_TWO));D0.Y_UP_TO_X_UP=v.fromRotationTranslation($.fromRotationZ(-X.PI_OVER_TWO));D0.fromName=function(e){return D0[e]};var tc=Object.freeze(D0);var Bdo=S(T(),1);var Fdo=S(T(),1);var gLt={ADD:H.FUNC_ADD,SUBTRACT:H.FUNC_SUBTRACT,REVERSE_SUBTRACT:H.FUNC_REVERSE_SUBTRACT,MIN:H.MIN,MAX:H.MAX},eC=Object.freeze(gLt);var Ndo=S(T(),1);var yLt={ZERO:H.ZERO,ONE:H.ONE,SOURCE_COLOR:H.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:H.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:H.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:H.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:H.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:H.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:H.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:H.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:H.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:H.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:H.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:H.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:H.SRC_ALPHA_SATURATE},_d=Object.freeze(yLt);var xLt={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:eC.ADD,equationAlpha:eC.ADD,functionSourceRgb:_d.SOURCE_ALPHA,functionSourceAlpha:_d.ONE,functionDestinationRgb:_d.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:_d.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:eC.ADD,equationAlpha:eC.ADD,functionSourceRgb:_d.ONE,functionSourceAlpha:_d.ONE,functionDestinationRgb:_d.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:_d.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:eC.ADD,equationAlpha:eC.ADD,functionSourceRgb:_d.SOURCE_ALPHA,functionSourceAlpha:_d.ONE,functionDestinationRgb:_d.ONE,functionDestinationAlpha:_d.ONE})},Nq=Object.freeze(xLt);var fmo=S(T(),1);var zdo=S(T(),1);function SZ(e,t){this._distance=t,this._normal=new J1e(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(SZ.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)&&!f.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),f.clone(e,this._normal._cartesian3)}}});SZ.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new SZ(e.normal,e.distance),t};SZ.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new SZ(e.normal,e.distance)};function J1e(e,t){this._clippingPlane=t,this._cartesian3=f.clone(e)}Object.defineProperties(J1e.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 m3=SZ;function zc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this.edgeColor=Y.clone(y(e.edgeColor,Y.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?eVe:tVe,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 eVe(e){return e===Ot.OUTSIDE}function tVe(e){return e===Ot.INSIDE}Object.defineProperties(zc.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?eVe:tVe)}},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 Q1e(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}zc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Q1e(n,i)},e.index=t,Q1e(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};zc.prototype.get=function(e){return this._planes[e]};function nVe(e,t){let n=e.length;for(let i=0;i<n;++i)if(on.equals(e[i],t))return i;return-1}zc.prototype.contains=function(e){return nVe(this._planes,e)!==-1};zc.prototype.remove=function(e){let t=this._planes,n=nVe(t,e);if(n===-1)return!1;e instanceof m3&&(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 m3&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};zc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof m3&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var _Lt=new re,SLt=new re;function j1e(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,SLt);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=re.packFloat(a.distance,_Lt);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function q1e(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 iVe(e,t){let n=Mt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var TLt=new B;zc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=zc.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=iVe(o,TLt);s.y*=2,i?(t=new bt({context:n,width:s.x,height:s.y,pixelFormat:nt.RGBA,pixelDatatype:ze.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new bt({context:n,width:s.x,height:s.y,pixelFormat:nt.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Qt.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?(q1e(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(j1e(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),q1e(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),j1e(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 CLt=new v,$1e=new on(f.UNIT_X,0);zc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=v.multiply(t,o,CLt));let r=Ot.INSIDE;!this.unionClippingRegions&&i>0&&(r=Ot.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];on.transform(a,o,$1e);let c=e.intersectPlane($1e);if(c===Ot.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};zc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};zc.useFloatTexture=function(e){return e.floatingPointTexture};zc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=zc.useFloatTexture(t)?e.length:e.length*2,r=iVe(o,n);return r.y*=2,r};zc.prototype.isDestroyed=function(){return!1};zc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var S9=zc;var bmo=S(T(),1);var T9={HIGHLIGHT:0,REPLACE:1,MIX:2};T9.getColorBlend=function(e,t){if(e===T9.HIGHLIGHT)return 0;if(e===T9.REPLACE)return 1;if(e===T9.MIX)return X.clamp(t,X.EPSILON4,1)};var f3=Object.freeze(T9);var xmo=S(T(),1);var VLt={NEVER:H.NEVER,LESS:H.LESS,EQUAL:H.EQUAL,LESS_OR_EQUAL:H.LEQUAL,GREATER:H.GREATER,NOT_EQUAL:H.NOTEQUAL,GREATER_OR_EQUAL:H.GEQUAL,ALWAYS:H.ALWAYS},oVe=Object.freeze(VLt);var Zmo=S(T(),1);function Ai(){}Ai._maxDecodingConcurrency=Math.max(At.hardwareConcurrency-1,1);Ai._decoderTaskProcessor=void 0;Ai._taskProcessorReady=!1;Ai._getDecoderTaskProcessor=function(){if(!l(Ai._decoderTaskProcessor)){let e=new di("decodeDraco",Ai._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Ai._taskProcessorReady=!0}),Ai._decoderTaskProcessor=e}return Ai._decoderTaskProcessor};Ai.hasExtension=function(e){return l(e.extensionsRequired.KHR_draco_mesh_compression)||l(e.extensionsUsed.KHR_draco_mesh_compression)};function sVe(e,t){let n=`runtime.${Object.keys(e.createdBufferViews).length}`,i=e.buffers,o=Object.keys(i).length;return i[o]=t,e.createdBufferViews[n]={buffer:o,byteOffset:0,byteLength:t.byteLength},n}function LLt(e,t,n){let i=t._loadResources,o=sVe(i,e);return i.vertexBuffersToCreate.enqueue(o),o}function ZLt(e,t,n){let i=e.typedArray,o=t._loadResources,r=sVe(o,i);return o.indexBuffersToCreate.enqueue({id:r,componentType:Q.fromTypedArray(i)}),{bufferViewId:r,numberOfIndices:e.numberOfIndices}}function rVe(e,t,n,i){if(!Ai._taskProcessorReady)return;let o=n.primitivesToDecode.peek();if(!l(o))return;let r=e.scheduleTask(o,[o.array.buffer]);if(l(r))return n.activeDecodingTasks++,n.primitivesToDecode.dequeue(),r.then(function(s){n.activeDecodingTasks--;let a=ZLt(s.indexArray,t,i),c={},u=s.attributeData;for(let d in u)if(u.hasOwnProperty(d)){let m=u[d],p=m.array,b=LLt(p,t,i),h=m.data;h.bufferView=b,c[d]=h}t._decodedData[`${o.mesh}.primitive.${o.primitive}`]={bufferView:a.bufferViewId,numberOfIndices:a.numberOfIndices,attributes:c}})}Ai._decodedModelResourceCache=void 0;Ai.parse=function(e,t){if(!Ai.hasExtension(e))return;let n=e._loadResources,i=e.cacheKey;if(l(i)){l(Ai._decodedModelResourceCache)||(l(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),Ai._decodedModelResourceCache=t.cache.modelDecodingCache);let s=Ai._decodedModelResourceCache[i];if(l(s)){s.count++,n.pendingDecodingCache=!0;return}}let o=e._dequantizeInShader,r=e.gltfInternal;Ge.mesh(r,function(s,a){Ge.meshPrimitive(s,function(c,u){if(!l(c.extensions))return;let d=c.extensions.KHR_draco_mesh_compression;if(!l(d))return;let m=r.bufferViews[d.bufferView],b=r.buffers[m.buffer].extras._pipeline.source.slice(m.byteOffset,m.byteOffset+m.byteLength);n.primitivesToDecode.enqueue({mesh:a,primitive:u,array:b,bufferView:m,compressedAttributes:d.attributes,dequantizeInShader:o})})})};Ai.decodeModel=function(e,t){if(!Ai.hasExtension(e))return Promise.resolve();let n=e._loadResources,i=e.cacheKey;if(l(i)&&l(Ai._decodedModelResourceCache)){let a=Ai._decodedModelResourceCache[i];if(l(a)&&n.pendingDecodingCache)return Promise.resolve(a.ready).then(function(){e._decodedData=a.data,n.pendingDecodingCache=!1});Ai._decodedModelResourceCache[i]={ready:!1,count:1,data:void 0}}if(n.primitivesToDecode.length===0)return Promise.resolve();let o=Ai._getDecoderTaskProcessor(),r=[],s=rVe(o,e,n,t);for(;l(s);)r.push(s),s=rVe(o,e,n,t);return Promise.all(r)};Ai.decodePointCloud=function(e){let t=Ai._getDecoderTaskProcessor();if(Ai._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ai.decodeBufferView=function(e){let t=Ai._getDecoderTaskProcessor();if(Ai._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};Ai.cacheDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Ai._decodedModelResourceCache)){let n=Ai._decodedModelResourceCache[t];l(n)&&(n.ready=!0,n.data=e._decodedData)}};Ai.destroyCachedDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Ai._decodedModelResourceCache)){let n=Ai._decodedModelResourceCache[t];l(n)&&--n.count===0&&delete Ai._decodedModelResourceCache[t]}};var TZ=Ai;var Gmo=S(T(),1);function RLt(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) - { - gl_FragColor = clippingPlanesEdgeColor; - } -`}var aVe=RLt;var Xmo=S(T(),1);var GLt=new B;function ELt(e,t){let n=e.unionClippingRegions,i=e.length,o=S9.useFloatTexture(t),r=S9.getTextureResolution(e,t,GLt),s=r.x,a=r.y,c=o?XLt(s,a):PLt(s,a);return c+=` -`,c+=n?WLt(i):ILt(i),c}function WLt(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 ILt(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 XLt(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 = texture2D(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -`}function PLt(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 = texture2D(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(texture2D(packedClippingPlanes, vec2(u + ${o}, v))); - return czm_transformPlane(plane, transform); -} -`}var cVe=ELt;var vmo=S(T(),1),vLt={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},CZ=Object.freeze(vLt);var Fmo=S(T(),1),wLt={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},C9=Object.freeze(wLt);var afo=S(T(),1);var Omo=S(T(),1);var uo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};uo.getMathType=function(e){switch(e){case uo.SCALAR:return Number;case uo.VEC2:return B;case uo.VEC3:return f;case uo.VEC4:return re;case uo.MAT2:return yi;case uo.MAT3:return $;case uo.MAT4:return v}};uo.getNumberOfComponents=function(e){switch(e){case uo.SCALAR:return 1;case uo.VEC2:return 2;case uo.VEC3:return 3;case uo.VEC4:case uo.MAT2:return 4;case uo.MAT3:return 9;case uo.MAT4:return 16}};uo.getAttributeLocationCount=function(e){switch(e){case uo.SCALAR:case uo.VEC2:case uo.VEC3:case uo.VEC4:return 1;case uo.MAT2:return 2;case uo.MAT3:return 3;case uo.MAT4:return 4}};uo.getGlslType=function(e){switch(e){case uo.SCALAR:return"float";case uo.VEC2:return"vec2";case uo.VEC3:return"vec3";case uo.VEC4:return"vec4";case uo.MAT2:return"mat2";case uo.MAT3:return"mat3";case uo.MAT4:return"mat4"}};var tC=Object.freeze(uo);function h3(){}var FLt=/^data\:/i;function mVe(e,t){let n=e.gltfInternal,i=n.buffers,r=n.bufferViews[t.bufferView],s=i[r.buffer],a=r.byteOffset+t.byteOffset,c=t.count*xu(t.type),u=FLt.test(s.uri)?"":s.uri;return`${e.cacheKey}//${u}/${a}/${c}`}var lVe={};h3.getAnimationParameterValues=function(e,t){let n=mVe(e,t),i=lVe[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,a=o.bufferViews[t.bufferView],c=a.buffer,d=r[c].extras._pipeline.source,m=t.componentType,p=t.type,b=xu(p),h=t.count,x=xd(o,t);i=new Array(h);let _=y(t.byteOffset,0),C=a.byteOffset+_;for(let V=0;V<h;V++){let L=Q.createArrayBufferView(m,d.buffer,d.byteOffset+C,b);p==="SCALAR"?i[V]=L[0]:p==="VEC3"?i[V]=f.fromArray(L):p==="VEC4"&&(i[V]=Pe.unpack(L)),C+=x}l(e.cacheKey)&&(lVe[n]=i)}return i};var uVe={};function ALt(e,t,n){return`${e.cacheKey}//${t}/${n}`}function VZ(e){this._spline=e,this._lastTimeIndex=0}VZ.prototype.findTimeInterval=Hi.prototype.findTimeInterval;VZ.prototype.evaluate=function(e,t){let n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),i=this._spline.times,o=e>=i[n+1]?i[n+1]:i[n];return this._spline.evaluate(o,t)};Object.defineProperties(VZ.prototype,{times:{get:function(){return this._spline.times}}});VZ.prototype.wrapTime=function(e){return this._spline.wrapTime(e)};VZ.prototype.clampTime=function(e){return this._spline.clampTime(e)};h3.getAnimationSpline=function(e,t,n,i,o,r,s,a){let c=ALt(e,t,i),u=uVe[c];if(!l(u)){let d=r,m=a;d.length===1&&m.length===1?u=new Sb(m[0]):(o.interpolation==="LINEAR"||o.interpolation==="STEP")&&(s==="translation"||s==="scale"?u=new Nd({times:d,points:m}):s==="rotation"?u=new Tb({times:d,points:m}):s==="weights"&&(u=new iF({times:d,weights:m})),l(u)&&o.interpolation==="STEP"&&(u=new VZ(u))),l(e.cacheKey)&&(uVe[c]=u)}return u};var dVe={};h3.getSkinInverseBindMatrices=function(e,t){let n=mVe(e,t),i=dVe[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,s=o.bufferViews,a=t.bufferView,c=s[a],u=c.buffer,m=r[u].extras._pipeline.source,p=t.componentType,b=t.type,h=t.count,x=xd(o,t),_=c.byteOffset+t.byteOffset,C=xu(b);if(i=new Array(h),p===H.FLOAT&&b===tC.MAT4)for(let V=0;V<h;++V){let L=Q.createArrayBufferView(p,m.buffer,m.byteOffset+_,C);i[V]=v.fromArray(L),_+=x}dVe[n]=i}return i};var V9=h3;var qfo=S(T(),1);var Dfo=S(T(),1);var lfo=S(T(),1),MLt={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},nC=Object.freeze(MLt);var dfo=S(T(),1),NLt={STOPPED:0,ANIMATING:1},lx=Object.freeze(NLt);var Pfo=S(T(),1);var _fo=S(T(),1);var ffo=S(T(),1),ULt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},fVe=Object.freeze(ULt);var dr={};function kLt(){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 DLt(){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 BLt(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function OLt(){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 YLt(){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 KLt(){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 zLt(){this.attributes=[]}function HLt(){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 JLt(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function QLt(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function jLt(){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 qLt(){this.nodes=[]}var $Lt={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function eZt(){this.input=[],this.interpolation=void 0,this.output=[]}function tZt(){this.node=void 0,this.path=void 0}function nZt(){this.sampler=void 0,this.target=void 0}function iZt(){this.name=void 0,this.samplers=[],this.channels=[]}function oZt(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function rZt(){this.name=void 0,this.stages=[]}function hVe(){this.credits=[]}function sZt(){this.asset=new hVe,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=v.clone(v.IDENTITY)}function aZt(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.channels=void 0}function ux(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=re.clone(ux.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=ux.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=ux.DEFAULT_ROUGHNESS_FACTOR}ux.DEFAULT_BASE_COLOR_FACTOR=re.ONE;ux.DEFAULT_METALLIC_FACTOR=1;ux.DEFAULT_ROUGHNESS_FACTOR=1;function iC(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=re.clone(iC.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=f.clone(iC.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=iC.DEFAULT_GLOSSINESS_FACTOR}iC.DEFAULT_DIFFUSE_FACTOR=re.ONE;iC.DEFAULT_SPECULAR_FACTOR=f.ONE;iC.DEFAULT_GLOSSINESS_FACTOR=1;function Uq(){this.metallicRoughness=new ux,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=f.clone(Uq.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=fVe.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}Uq.DEFAULT_EMISSIVE_FACTOR=f.ZERO;dr.Quantization=kLt;dr.Attribute=DLt;dr.Indices=BLt;dr.FeatureIdAttribute=OLt;dr.FeatureIdTexture=KLt;dr.FeatureIdImplicitRange=YLt;dr.MorphTarget=zLt;dr.Primitive=HLt;dr.Instances=JLt;dr.Skin=QLt;dr.Node=jLt;dr.Scene=qLt;dr.AnimatedPropertyType=Object.freeze($Lt);dr.AnimationSampler=eZt;dr.AnimationTarget=tZt;dr.AnimationChannel=nZt;dr.Animation=iZt;dr.ArticulationStage=oZt;dr.Articulation=rZt;dr.Asset=hVe;dr.Components=sZt;dr.TextureReader=aZt;dr.MetallicRoughness=ux;dr.SpecularGlossiness=iC;dr.Material=Uq;var pVe=dr;var oC=pVe.AnimatedPropertyType;function Dq(e){e=y(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,uZt(this)}Object.defineProperties(Dq.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 cZt(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 Rh({times:e,points:n,inTangents:i,outTangents:o})}function bVe(e,t,n,i){if(e.length===1&&t.length===1)return new Sb(t[0]);switch(n){case Rc.STEP:return new O_({times:e,points:t});case Rc.CUBICSPLINE:return cZt(e,t);case Rc.LINEAR:return i===oC.ROTATION?new Tb({times:e,points:t}):new Nd({times:e,points:t})}}function lZt(e,t,n,i,o){let r=[];if(i===oC.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let d=new Array(a),m=c;if(n===Rc.CUBICSPLINE)for(u=0;u<a;u+=3)d[u]=t[m],d[u+1]=t[m+o],d[u+2]=t[m+2*o],m+=o*3;else for(u=0;u<a;u++)d[u]=t[m],m+=o;r.push(bVe(e,d,n,i))}}else r.push(bVe(e,t,n,i));return r}var kq;function uZt(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,d=lZt(i,o,r,a,u);switch(e._splines=d,e._path=a,a){case oC.TRANSLATION:case oC.SCALE:kq=new f;break;case oC.ROTATION:kq=new Pe;break;case oC.WEIGHTS:break}}Dq.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===oC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);o[n]=r.evaluate(s,kq)}}};var gVe=Dq;function Bq(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ne.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=ne.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,nC.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=lx.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,dZt(this)}Object.defineProperties(Bq.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 dZt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],d=u.target;if(!l(d))continue;let m=d.node.index,p=i._runtimeNodes[m],b=new gVe({channel:u,runtimeAnimation:e,runtimeNode:p}),h=u.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(b)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}Bq.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var yVe=Bq;function B0(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(B0.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function Oq(e,t,n){let i=e._model,o=new yVe(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}B0.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return Oq(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 Oq(this,n[i],e)};B0.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=Oq(this,n[r],e);i.push(s)}return i};B0.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};B0.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])};B0.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};B0.prototype.get=function(e){return this._runtimeAnimations[e]};var p3=[];function mZt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}B0.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ne.equals(e.time,this._previousTime))return!1;this._previousTime=ne.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=ne.addSeconds(y(a.startTime,o),a.delay,new ne)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,d=a.stopTime,m=ne.lessThanOrEquals(c,o),p=l(d)&&ne.greaterThan(o,d),b=0;if(u!==0){let _=ne.secondsDifference(p?d:o,c);b=l(a._animationTime)?a._animationTime(u,_):_/u}let h=a.loop===nC.REPEAT||a.loop===nC.MIRRORED_REPEAT,x=(m||h&&!l(a.startTime))&&(b<=1||h)&&!p;if(b===a._prevAnimationDelta){let _=a._state===lx.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=b,x||a._state===lx.ANIMATING){if(x&&a._state===lx.STOPPED&&(a._state=lx.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===nC.REPEAT)b=b-Math.floor(b);else if(a.loop===nC.MIRRORED_REPEAT){let C=Math.floor(b),V=b-C;b=C%2===1?1-V:V}a.reverse&&(b=1-b);let _=b*u*a.multiplier;_=X.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=lx.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&p3.push(a))}}n=p3.length;for(let s=0;s<n;++s){let a=p3[s];t.splice(t.indexOf(a),1),e.afterRender.push(mZt(this,r,a))}return p3.length=0,i};var xVe=B0;var tho=S(T(),1);function O0(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new dl,this.indexBuffersToCreate=new dl,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new dl,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new dl,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new dl,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new dl,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function fZt(e,t,n){return e.subarray(t,t+n)}O0.prototype.getBuffer=function(e){return fZt(this.buffers[e.buffer],e.byteOffset,e.byteLength)};O0.prototype.finishedPendingBufferLoads=function(){return this.pendingBufferLoads===0};O0.prototype.finishedBuffersCreation=function(){return this.pendingBufferLoads===0&&this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0};O0.prototype.finishedProgramCreation=function(){return this.pendingShaderLoads===0&&this.programsToCreate.length===0};O0.prototype.finishedTextureCreation=function(){let e=this.pendingTextureLoads===0,t=this.texturesToCreate.length===0&&this.texturesToCreateFromBufferView.length===0;return e&&t};O0.prototype.finishedEverythingButTextureCreation=function(){let e=this.pendingBufferLoads===0&&this.pendingShaderLoads===0,t=this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0&&this.programsToCreate.length===0&&this.pendingBufferViewToImage===0;return this.finishedDecoding()&&e&&t};O0.prototype.finishedDecoding=function(){return this.primitivesToDecode.length===0&&this.activeDecodingTasks===0&&!this.pendingDecodingCache};O0.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var _Ve=O0;var oho=S(T(),1);function b3(e,t,n){this._name=t.name,this._id=n,this._uniformMap=e._uniformMaps[n],this._technique=void 0,this._program=void 0,this._values=void 0}Object.defineProperties(b3.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}});b3.prototype.setValue=function(e,t){let n=`u_${e}`,i=this._uniformMap.values[n];i.value=i.clone(t,i.value)};b3.prototype.getValue=function(e){let t=`u_${e}`,n=this._uniformMap.values[t];if(l(n))return n.value};var SVe=b3;var sho=S(T(),1);function TVe(e,t,n){let i=[],o=e.primitives,r=o.length;for(let s=0;s<r;++s){let a=o[s];i[s]=t[a.material]}this._name=e.name,this._materials=i,this._id=n}Object.defineProperties(TVe.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}});var CVe=TVe;var lho=S(T(),1);function Yq(e,t,n,i,o){this._model=e,this._runtimeNode=n,this._name=t.name,this._id=i,this.useMatrix=!1,this._show=!0,this._matrix=v.clone(o),this._originalMatrix=v.clone(o)}Object.defineProperties(Yq.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=v.clone(e,this._matrix),this.useMatrix=!0;let t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}});Yq.prototype.setMatrix=function(e){v.clone(e,this._matrix)};var VVe=Yq;var _ho=S(T(),1);var hZt=65534;function L9(){}L9.hasExtension=function(e){return l(e.extensionsRequired.CESIUM_primitive_outline)||l(e.extensionsUsed.CESIUM_primitive_outline)};L9.outlinePrimitives=function(e){if(!L9.hasExtension(e))return;let t=e.gltfInternal,n=[];Ge.mesh(t,function(i,o){Ge.meshPrimitive(i,function(r,s){if(!l(r.extensions))return;let a=r.extensions.CESIUM_primitive_outline;if(!l(a))return;let c=xZt(e,r);c!==void 0&&(n.indexOf(c)<0&&n.push(c),pZt(e,o,s,a.indices,c))})});for(let i=0;i<n.length;++i)bZt(e,n[i].bufferViews);gZt(e)};L9.createTexture=function(e,t){let n=t.cache.modelOutliningCache;if(l(n)||(n=t.cache.modelOutliningCache={}),l(n.outlineTexture))return n.outlineTexture;let i=Math.min(4096,Mt.maximumTextureSize),o=i,r=ZVe(o),s=[];for(;o>1;)o>>=1,s.push(ZVe(o));let a=new bt({context:t,source:{arrayBufferView:r,mipLevels:s},width:i,height:1,pixelFormat:nt.LUMINANCE,sampler:new Qt({wrapS:ln.CLAMP_TO_EDGE,wrapT:ln.CLAMP_TO_EDGE,minificationFilter:Ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:ni.LINEAR})});return n.outlineTexture=a,a};function pZt(e,t,n,i,o){let r=o.vertexCopies,s=o.extraVertices,a=o.outlineCoordinates,c=e.gltfInternal,d=c.meshes[t].primitives[n],m=c.accessors,p=c.bufferViews,b;for(let M in d.attributes)if(d.attributes.hasOwnProperty(M)){let g=d.attributes[M],Z=m[g];if(l(Z)){b=Z.count;break}}if(!l(b))return;let h=m[d.indices],x=p[h.bufferView],_=m[i],C=p[_.bufferView],V=e._loadResources,L=V.getBuffer(x),R=V.getBuffer(C),G=h.componentType===5123?new Uint16Array(L.buffer,L.byteOffset+h.byteOffset,h.count):new Uint32Array(L.buffer,L.byteOffset+h.byteOffset,h.count),W=_.componentType===5123?new Uint16Array(R.buffer,R.byteOffset+_.byteOffset,_.count):new Uint32Array(R.buffer,R.byteOffset+_.byteOffset,_.count),w=b,P=[w],F;for(F=0;F<W.length;F+=2){let M=W[F],g=W[F+1],Z=Math.min(M,g),E=Math.max(M,g);P[Z*w+E]=1}for(F=0;F<G.length;F+=3){let M=G[F],g=G[F+1],Z=G[F+2],E=!1,I=E||Hq(P,M,g),A=E||Hq(P,g,Z),N=E||Hq(P,Z,M),D=LVe(a,M,g,Z,I,A,N);for(;D>=0;){let k;if(D===M?k=r[M]:D===g?k=r[g]:k=r[Z],k===void 0){k=b+s.length;let O=D;for(;O>=b;)O=s[O-b];s.push(O),r[D]=k}k>hZt&&G instanceof Uint16Array&&(G=new Uint32Array(G),h.componentType=5125,x.buffer=c.buffers.push({byteLength:G.byteLength,extras:{_pipeline:{source:G.buffer}}})-1,x.byteLength=G.byteLength,x.byteOffset=0,e._loadResources.buffers[x.buffer]=new Uint8Array(G.buffer,0,G.byteLength),V.indexBuffersToCreate._array.forEach(function(O){l(O)&&O.id===h.bufferView&&(O.componentType=h.componentType)})),D===M?(M=k,G[F]=k):D===g?(g=k,G[F+1]=k):(Z=k,G[F+2]=k),l(h.max)&&(h.max[0]=Math.max(h.max[0],k)),D=LVe(a,M,g,Z,I,A,N)}}}function Kq(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return s===void 0?63:((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)}function zq(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function LVe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,d=Kq(e,t,a,c,u);if(d===0)return t;let m=0,p=o?1:0,b=r?1:0,h=Kq(e,n,m,p,b);if(h===0)return n;let x=s?1:0,_=0,C=r?1:0,V=Kq(e,i,x,_,C);if(V===0)return i;let L=d&h&V,R,G,W;if(L&1)R=0,G=1,W=2;else if(L&2)R=0,W=1,G=2;else if(L&4)G=0,R=1,W=2;else if(L&8)G=0,W=1,R=2;else if(L&16)W=0,R=1,G=2;else if(L&32)W=0,G=1,R=2;else{let M=zq(d),g=zq(h),Z=zq(V);return M<g&&M<Z?t:g<Z?n:i}let w=t*3;e[w+R]=a,e[w+G]=c,e[w+W]=u;let P=n*3;e[P+R]=m,e[P+G]=p,e[P+W]=b;let F=i*3;return e[F+R]=x,e[F+G]=_,e[F+W]=C,-1}function Hq(e,t,n){let i=e[0],o=Math.min(t,n)*i+Math.max(t,n);return e[o]===1}function ZVe(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 bZt(e,t){let n=e.gltfInternal,i=e._loadResources,o,r;for(o=0;o<t.length;++o){let s=t[o],a=s.extras._pipeline.vertexNumberingScope;s.extras._pipeline.vertexNumberingScope=void 0;let c=a.extraVertices,u=i.getBuffer(s),d=s.byteStride||4,m=c.length,p=new Uint8Array(u.byteLength+m*d);for(p.set(u),r=0;r<m;++r){let x=c[r]*d,_=u.length+r*d;for(let C=0;C<d;++C)p[_+C]=p[x+C]}s.byteOffset=0,s.byteLength=p.byteLength;let b=n.buffers.push({byteLength:p.byteLength,extras:{_pipeline:{source:p.buffer}}})-1;s.buffer=b,i.buffers[b]=p;let h=a.accessors;for(r=0;r<h.length;++r){let x=h[r];n.accessors[x].count+=m}if(!a.createdOutlines){let x=a.outlineCoordinates,_=new Float32Array(x),C=e.gltfInternal.buffers.push({byteLength:_.byteLength,extras:{_pipeline:{source:_.buffer}}})-1;i.buffers[C]=new Uint8Array(_.buffer,0,_.byteLength);let V=e.gltfInternal.bufferViews.push({buffer:C,byteLength:_.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,L=e.gltfInternal.accessors.push({bufferView:V,byteOffset:0,componentType:5126,count:_.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,R=a.primitives;for(r=0;r<R.length;++r)R[r].attributes._OUTLINE_COORDINATES=L;i.vertexBuffersToCreate.enqueue(V),a.createdOutlines=!0}}}function gZt(e){let t=e.gltfInternal,n=e._loadResources,i;for(i=0;i<t.buffers.length;++i){let o=t.buffers[i],r=t.bufferViews.filter(yZt.bind(void 0,i)),s=r.reduce(function(u,d){return u+d.byteLength},0);if(s===o.byteLength)continue;let a=new Uint8Array(s),c=0;for(let u=0;u<r.length;++u){let d=r[u],m=n.getBuffer(d);a.set(m,c),d.byteOffset=c,c+=m.byteLength}n.buffers[i]=a,o.extras._pipeline.source=a.buffer,o.byteLength=s}}function yZt(e,t){return t.buffer===e}function xZt(e,t){let n=t.attributes;if(n===void 0)return;let i=e.gltfInternal,o;for(let r in n){if(!n.hasOwnProperty(r))continue;let s=n[r],c=i.accessors[s].bufferView,u=i.bufferViews[c];if(l(u.extras)||(u.extras={}),l(u.extras._pipeline)||(u.extras._pipeline={}),!l(u.extras._pipeline.vertexNumberingScope))u.extras._pipeline.vertexNumberingScope=o||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};else if(o!==void 0&&u.extras._pipeline.vertexNumberingScope!==o)return;o=u.extras._pipeline.vertexNumberingScope,o.bufferViews.indexOf(u)<0&&o.bufferViews.push(u),o.accessors.indexOf(s)<0&&o.accessors.push(s)}return o.primitives.push(t),o}var Jq=L9;var Uho=S(T(),1);var Bi={};Bi.updateForwardAxis=function(e){let t=e.gltfInternal.extras.sourceVersion;(l(t)&&t!=="2.0"||Bi.getAssetVersion(e.gltfInternal)!=="2.0")&&(e._gltfForwardAxis=tc.X)};Bi.getAssetVersion=function(e){return!l(e.asset)||!l(e.asset.version)?"1.0":e.asset.version};Bi.splitIncompatibleMaterials=function(e){let t=e.accessors,n=e.materials,i={};return Ge.mesh(e,function(o){Ge.meshPrimitive(o,function(r){let s=r.material,a=n[s],c=r.attributes.JOINTS_0,u,d;if(l(c)){let R=t[c];u=R.componentType,d=R.type}let m=l(c)&&d==="VEC4",p=l(r.attributes.COLOR_0),b=l(r.targets),h=l(r.attributes.NORMAL),x=l(r.attributes.TANGENT),_=l(r.attributes.TEXCOORD_0),C=_&&l(r.attributes.TEXCOORD_1),V=l(r.extensions)&&l(r.extensions.CESIUM_primitive_outline),L=i[s];if(!l(L))i[s]={skinning:{skinned:m,componentType:u},hasVertexColors:p,hasMorphTargets:b,hasNormals:h,hasTangents:x,hasTexCoords:_,hasTexCoord1:C,hasOutline:V};else if(L.skinning.skinned!==m||L.hasVertexColors!==p||L.hasMorphTargets!==b||L.hasNormals!==h||L.hasTangents!==x||L.hasTexCoords!==_||L.hasTexCoord1!==C||L.hasOutline!==V){let R=Ue(a,!0);s=Po(n,R),r.material=s,i[s]={skinning:{skinned:m,componentType:u},hasVertexColors:p,hasMorphTargets:b,hasNormals:h,hasTangents:x,hasTexCoords:_,hasTexCoord1:C,hasOutline:V}}})}),i};Bi.getShaderVariable=function(e){return e==="SCALAR"?"float":e.toLowerCase()};Bi.ModelState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};Bi.getFailedLoadFunction=function(e,t,n){return function(i){e._state=Bi.ModelState.FAILED;let o=`Failed to load ${t}: ${n}`;l(i)&&(o+=` -${i.message}`),e._readyPromise.reject(new ue(o))}};Bi.parseBuffers=function(e,t){let n=e._loadResources;Ge.buffer(e.gltfInternal,function(i,o){if(l(i.extras._pipeline.source))n.buffers[o]=i.extras._pipeline.source;else if(l(t)){let r=e._resource.getDerivedResource({url:i.uri});++n.pendingBufferLoads,r.fetchArrayBuffer().then(t(e,o)).catch(Bi.getFailedLoadFunction(e,"buffer",r.url))}})};var _Zt=new f,SZt=new f;Bi.computeBoundingSphere=function(e){let t=e.gltfInternal,n=t.nodes,i=t.meshes,o=t.scenes[t.scene].nodes,r=o.length,s=[],a=new f(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new f(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let d=0;d<r;++d){let m=n[o[d]];for(m._transformToRoot=Bi.getTransform(m),s.push(m);s.length>0;){m=s.pop();let p=m._transformToRoot,b=m.mesh;if(l(b)){let _=i[b].primitives,C=_.length;for(let V=0;V<C;++V){let L=_[V].attributes.POSITION;if(l(L)){let R=Bi.getAccessorMinMax(t,L);if(l(R.min)&&l(R.max)){let G=f.fromArray(R.min,0,_Zt),W=f.fromArray(R.max,0,SZt);v.multiplyByPoint(p,G,G),v.multiplyByPoint(p,W,W),f.minimumByComponent(a,G,a),f.maximumByComponent(c,W,c)}}}}let h=m.children;if(l(h)){let x=h.length;for(let _=0;_<x;++_){let C=n[h[_]];C._transformToRoot=Bi.getTransform(C),v.multiplyTransformation(p,C._transformToRoot,C._transformToRoot),s.push(C)}}delete m._transformToRoot}}let u=ae.fromCornerPoints(a,c);return e.forwardAxis===tc.Z&&ae.transformWithoutScale(u,tc.Z_UP_TO_X_UP,u),e._upAxis===tc.Y?ae.transformWithoutScale(u,tc.Y_UP_TO_Z_UP,u):e._upAxis===tc.X&&ae.transformWithoutScale(u,tc.X_UP_TO_Z_UP,u),u};function TZt(e,t){return Ge.techniqueAttribute(e,function(n,i){if(n.semantic===t)return i})}function CZt(e,t){let n=e.accessors,i=e.materials,o=e.extensions.KHR_techniques_webgl,r=o.techniques,s=o.programs,a=o.shaders,c=t.targets,u=t.attributes;for(let h in c)if(c.hasOwnProperty(h)){let x=c[h];for(let _ in x)_!=="extras"&&(u[`${_}_${h}`]=x[_])}let d=i[t.material],m=r[d.extensions.KHR_techniques_webgl.technique],p=s[m.program],b=a[p.vertexShader];for(let h in u)if(u.hasOwnProperty(h)&&!l(TZt(m,h))){let x=u[h],_=n[x],C=h.toLowerCase();C.charAt(0)==="_"&&(C=C.slice(1));let V=`a_${C}`;m.attributes[V]={semantic:h,type:_.componentType};let L=b.extras._pipeline,R=L.source;R=`attribute ${Bi.getShaderVariable(_.type)} ${V}; -${R}`,L.source=R}}Bi.ensureSemanticExistence=function(e){return Ge.mesh(e,function(t){Ge.meshPrimitive(t,function(n){CZt(e,n)})}),e};Bi.createAttributeLocations=function(e,t){let n={},i=!1,o=1;if(Ge.techniqueAttribute(e,function(r,s){/pos/i.test(s)&&!i?(n[s]=0,i=!0):n[s]=o++}),l(t))for(let r in t)t.hasOwnProperty(r)&&(n[r]=o++);return n};Bi.getAccessorMinMax=function(e,t){let n=e.accessors[t],i=n.extensions,o=n.min,r=n.max;if(l(i)){let s=i.WEB3D_quantized_attributes;l(s)&&(o=s.decodedMin,r=s.decodedMax)}return{min:o,max:r}};function RVe(e,t,n,i){return To(e,"KHR_techniques_webgl")?function(o,r){if(o.semantic===n&&(!i||!l(o.node)))return r}:function(o,r){let s=t.parameters[o];if(s.semantic===n&&(!i||!l(s.node)))return r}}Bi.getAttributeOrUniformBySemantic=function(e,t,n,i){return Ge.technique(e,function(o){if(l(n)&&o.program!==n)return;let r=Ge.techniqueAttribute(o,RVe(e,o,t,i));return l(r)?r:Ge.techniqueUniform(o,RVe(e,o,t,i))})};Bi.getDiffuseAttributeOrUniform=function(e,t){let n=Bi.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return l(n)||(n=Bi.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),n};var VZt=new f,LZt=new Pe,ZZt=new f;Bi.getTransform=function(e,t){return l(e.matrix)?v.fromColumnMajorArray(e.matrix,t):v.fromTranslationQuaternionRotationScale(f.fromArray(e.translation,0,VZt),Pe.unpack(e.rotation,0,LZt),f.fromArray(e.scale,0,ZZt),t)};Bi.getUsedExtensions=function(e){let t=e.extensionsUsed,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};Bi.getRequiredExtensions=function(e){let t=e.extensionsRequired,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};Bi.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_texture_basisu:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Bi.checkSupportedExtensions=function(e,t){for(let n in e)if(e.hasOwnProperty(n)){if(!Bi.supportedExtensions[n])throw new ue(`Unsupported glTF Extension: ${n}`);if(n==="EXT_texture_webp"&&t===!1)throw new ue("Loaded model requires WebP but browser does not support it.")}};Bi.checkSupportedGlExtensions=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(o!=="OES_element_index_uint")throw new ue(`Unsupported WebGL Extension: ${o}`);if(!t.elementIndexUint)throw new ue("OES_element_index_uint WebGL extension is not enabled.")}}};function Qq(e,t,n){t+="(?!\\w)",t=new RegExp(t,"g");let i=e.search(t);return e.replace(t,function(o,r){return i===r?o:n})}function RZt(e,t){let i=e.accessors[t].extensions;if(l(i))return i.WEB3D_quantized_attributes}function GVe(e,t,n){let i=t.material,o=e.materials[i];if(!To(e,"KHR_techniques_webgl")||!l(o.extensions)||!l(o.extensions.KHR_techniques_webgl))return;let r=o.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[r];return Ge.techniqueAttribute(a,function(c,u){if(c.semantic===n)return u})}Bi.modifyShaderForDracoQuantizedAttributes=function(e,t,n,i){let o={};for(let r in i)if(i.hasOwnProperty(r)){let s=i[r],a=s.quantization;if(!l(a))continue;let c=GVe(e,t,r);r.charAt(0)==="_"&&(r=r.substring(1));let u=`gltf_u_dec_${r.toLowerCase()}`;if(!l(o[u])){let d=`gltf_decoded_${r}`,m=c.replace("a_","gltf_a_dec_"),p=s.componentsPerAttribute;n=Qq(n,c,m);let b;a.octEncoded?b="vec3":p>1?b=`vec${p}`:b="float",n=`${b} ${m}; -${n}`;let h=p===3&&r==="COLOR_0";h&&(n=Qq(n,m,`vec4(${m}, 1.0)`));let x="";if(a.octEncoded){let _=`${u}_rangeConstant`;n=`uniform float ${_}; -${n}`,x=` -void main() { - ${m} = czm_octDecode(${c}.xy, ${_}).zxy; - ${d}(); -} -`}else{let _=`${u}_normConstant`,C=`${u}_min`;n=`uniform float ${_}; -uniform ${b} ${C}; -${n}`,x=` -void main() { - ${m} = ${C} + ${c}${h?".xyz":""} * ${_}; - ${d}(); -} -`}n=De.replaceMain(n,d),n+=x}}return{shader:n}};Bi.modifyShaderForQuantizedAttributes=function(e,t,n){let i={},o=t.attributes;for(let r in o)if(o.hasOwnProperty(r)){let s=GVe(e,t,r),a=t.attributes[r];r.charAt(0)==="_"&&(r=r.substring(1));let c=`gltf_u_dec_${r.toLowerCase()}`,u=`${c}_scale`,d=`${c}_translate`;if(!l(i[c])&&!l(i[u])){let m=RZt(e,a);if(l(m)){let p=m.decodeMatrix,b=`gltf_decoded_${r}`,h=s.replace("a_","gltf_a_dec_"),x=Math.floor(Math.sqrt(p.length));n=Qq(n,s,h);let _;x>2?_=`vec${x-1}`:_="float",n=`${_} ${h}; -${n}`;let C="";x===5?(n=`uniform mat4 ${u}; -${n}`,n=`uniform vec4 ${d}; -${n}`,C=` -void main() { - ${h} = ${u} * ${s} + ${d}; - ${b}(); -} -`,i[u]={mat:4},i[d]={vec:4}):(n=`uniform mat${x} ${c}; -${n}`,C=` -void main() { - ${h} = ${_}(${c} * vec${x}(${s},1.0)); - ${b}(); -} -`,i[c]={mat:x}),n=De.replaceMain(n,b),n+=C}}}return{shader:n,uniforms:i}};function ZZ(e){let t={value:e,clone:function(n,i){return n},func:function(){return t.value}};return t}function y3(e){let t={value:B.fromArray(e),clone:B.clone,func:function(){return t.value}};return t}function x3(e){let t={value:f.fromArray(e),clone:f.clone,func:function(){return t.value}};return t}function RZ(e){let t={value:re.fromArray(e),clone:re.clone,func:function(){return t.value}};return t}function jq(e){let t={value:yi.fromColumnMajorArray(e),clone:yi.clone,func:function(){return t.value}};return t}function qq(e){let t={value:$.fromColumnMajorArray(e),clone:$.clone,func:function(){return t.value}};return t}function g3(e){let t={value:v.fromColumnMajorArray(e),clone:v.clone,func:function(){return t.value}};return t}function _3(e,t,n){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=n}Object.defineProperties(_3.prototype,{value:{get:function(){if(!l(this._value)){let e=this._textures[this._textureId];if(l(e))this._value=e;else return this._defaultTexture}return this._value},set:function(e){this._value=e}}});_3.prototype.clone=function(e){return e};_3.prototype.func=void 0;function GZt(e,t,n){let i=new _3(e,t,n);return i.func=function(){return i.value},i}var nc={};nc[H.FLOAT]=ZZ;nc[H.FLOAT_VEC2]=y3;nc[H.FLOAT_VEC3]=x3;nc[H.FLOAT_VEC4]=RZ;nc[H.INT]=ZZ;nc[H.INT_VEC2]=y3;nc[H.INT_VEC3]=x3;nc[H.INT_VEC4]=RZ;nc[H.BOOL]=ZZ;nc[H.BOOL_VEC2]=y3;nc[H.BOOL_VEC3]=x3;nc[H.BOOL_VEC4]=RZ;nc[H.FLOAT_MAT2]=jq;nc[H.FLOAT_MAT3]=qq;nc[H.FLOAT_MAT4]=g3;nc[H.SAMPLER_2D]=GZt;Bi.createUniformFunction=function(e,t,n,i){return nc[e](t,n,i)};function EZt(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function WZt(e){return[e[20],e[21],e[22],e[23]]}Bi.createUniformsForDracoQuantizedAttributes=function(e){let t={};for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.quantization;if(!l(o))continue;n.charAt(0)==="_"&&(n=n.substring(1));let r=`gltf_u_dec_${n.toLowerCase()}`;if(o.octEncoded){let u=`${r}_rangeConstant`,d=(1<<o.quantizationBits)-1;t[u]=ZZ(d).func;continue}let s=`${r}_normConstant`,a=o.range/(1<<o.quantizationBits);t[s]=ZZ(a).func;let c=`${r}_min`;switch(i.componentsPerAttribute){case 1:t[c]=ZZ(o.minValues).func;break;case 2:t[c]=y3(o.minValues).func;break;case 3:t[c]=x3(o.minValues).func;break;case 4:t[c]=RZ(o.minValues).func;break}}return t};Bi.createUniformsForQuantizedAttributes=function(e,t,n){let i=e.accessors,o={},r={},s=t.attributes;for(let a in s)if(s.hasOwnProperty(a)){let c=s[a],u=i[c],d=u.extensions;if(a.charAt(0)==="_"&&(a=a.substring(1)),l(d)){let m=d.WEB3D_quantized_attributes;if(l(m)){let p=m.decodeMatrix,b=`gltf_u_dec_${a.toLowerCase()}`,h,x;switch(u.type){case tC.SCALAR:r[b]=jq(p).func,o[b]=!0;break;case tC.VEC2:r[b]=qq(p).func,o[b]=!0;break;case tC.VEC3:r[b]=g3(p).func,o[b]=!0;break;case tC.VEC4:h=`${b}_scale`,x=`${b}_translate`,r[h]=g3(EZt(p)).func,r[x]=RZ(WZt(p)).func,o[h]=!0,o[x]=!0;break}}}}for(let a in n)if(n.hasOwnProperty(a)&&!o[a]){let c=n[a];l(c.mat)&&(c.mat===2?r[a]=jq(yi.IDENTITY).func:c.mat===3?r[a]=qq($.IDENTITY).func:c.mat===4&&(r[a]=g3(v.IDENTITY).func)),l(c.vec)&&c.vec===4&&(r[a]=RZ([0,0,0,0]).func)}return r};var LZ=new f,IZt={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){let n=new v;return function(){return l(t._rtcCenter)?(v.getTranslation(e.model,LZ),f.add(LZ,t._rtcCenter,LZ),v.multiplyByPoint(e.view,LZ,LZ),v.setTranslation(e.modelView,LZ,n)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};Bi.getGltfSemanticUniforms=function(){return IZt};var Ci=Bi;var Qho=S(T(),1);function XZt(e,t){if(t=y(t,y.EMPTY_OBJECT),!l(e)||!To(e,"KHR_materials_common"))return;To(e,"KHR_techniques_webgl")||(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));let n=e.extensions.KHR_techniques_webgl;FZt(e);let i=PZt(e),o=Ci.splitIncompatibleMaterials(e),r={},s=!1;return Ge.material(e,function(a,c){if(l(a.extensions)&&l(a.extensions.KHR_materials_common)){let u=a.extensions.KHR_materials_common,d=o[c],m=wZt(u,d),p=r[m];l(p)||(p=vZt(e,n,d,u,i,t.addBatchIdToGeneratedShaders),r[m]=p,s=!0);let b={},h=u.values,x;for(let _ in h)h.hasOwnProperty(_)&&_!=="transparent"&&_!=="doubleSided"&&(x=`u_${_.toLowerCase()}`,b[x]=h[_]);a.extensions.KHR_techniques_webgl={technique:p,values:b},a.alphaMode="OPAQUE",u.transparent&&(a.alphaMode="BLEND"),u.doubleSided&&(a.doubleSided=!0)}}),s&&Ci.ensureSemanticExistence(e),e}function PZt(e){let t={},n;if(l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(n=e.extensions.KHR_materials_common.lights),l(n)){let i=e.nodes;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r];if(l(s.extensions)&&l(s.extensions.KHR_materials_common)){let a=s.extensions.KHR_materials_common.light;l(a)&&l(n[a])&&(n[a].node=r),delete s.extensions.KHR_materials_common}}let o=0;for(let r in n)if(n.hasOwnProperty(r)){let s=n[r],a=s.type;if(a!=="ambient"&&!l(s.node)){delete n[r];continue}let c=`light${o.toString()}`;s.baseName=c;let u,d,m,p;switch(a){case"ambient":u=s.ambient,t[`${c}Color`]={type:H.FLOAT_VEC3,value:u.color};break;case"directional":d=s.directional,t[`${c}Color`]={type:H.FLOAT_VEC3,value:d.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:H.FLOAT_MAT4});break;case"point":m=s.point,t[`${c}Color`]={type:H.FLOAT_VEC3,value:m.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:H.FLOAT_MAT4}),t[`${c}Attenuation`]={type:H.FLOAT_VEC3,value:[m.constantAttenuation,m.linearAttenuation,m.quadraticAttenuation]};break;case"spot":p=s.spot,t[`${c}Color`]={type:H.FLOAT_VEC3,value:p.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:H.FLOAT_MAT4},t[`${c}InverseTransform`]={node:s.node,semantic:"MODELVIEWINVERSE",type:H.FLOAT_MAT4,useInFragment:!0}),t[`${c}Attenuation`]={type:H.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]},t[`${c}FallOff`]={type:H.FLOAT_VEC2,value:[p.fallOffAngle,p.fallOffExponent]};break}++o}}return t}function vZt(e,t,n,i,o,r){l(i)||(i={}),r=y(r,!1);let s=t.techniques,a=t.shaders,c=t.programs,u=i.technique.toUpperCase(),d;l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(d=e.extensions.KHR_materials_common.lights);let m=i.values,p=y(i.jointCount,0),b,h=!1,x=!1;l(n)&&(b=n.skinning,h=b.skinned,x=n.hasVertexColors);let _=`precision highp float; -`,C=`precision highp float; -`,V=u!=="CONSTANT",L={u_modelViewMatrix:{semantic:To(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:H.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:H.FLOAT_MAT4}};V&&(L.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:H.FLOAT_MAT3}),h&&(L.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:H.FLOAT_MAT4});let R,G=!1;for(let O in m)if(m.hasOwnProperty(O)&&O!=="transparent"&&O!=="doubleSided"){let U=EVe(O,m[O]);R=`u_${O.toLowerCase()}`,!G&&U===H.SAMPLER_2D&&(G=!0),L[R]={type:U}}if(l(L.u_diffuse)&&(L.u_diffuse.semantic="_3DTILESDIFFUSE"),l(o))for(let O in o)o.hasOwnProperty(O)&&(R=`u_${O}`,L[R]=o[O]);for(R in L)if(L.hasOwnProperty(R)){let O=L[R],U=l(O.count)?`[${O.count}]`:"";O.type!==H.FLOAT_MAT3&&O.type!==H.FLOAT_MAT4||O.useInFragment?(C+=`uniform ${_0(O.type)} ${R}${U}; -`,delete O.useInFragment):_+=`uniform ${_0(O.type)} ${R}${U}; -`}let W="";h&&(W+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let w={a_position:{semantic:"POSITION"}};_+=`attribute vec3 a_position; -`,_+=`varying vec3 v_positionEC; -`,h?W+=` vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0); -`:W+=` vec4 pos = u_modelViewMatrix * vec4(a_position,1.0); -`,W+=` v_positionEC = pos.xyz; -`,W+=` gl_Position = u_projectionMatrix * pos; -`,C+=`varying vec3 v_positionEC; -`,V&&(w.a_normal={semantic:"NORMAL"},_+=`attribute vec3 a_normal; -`,_+=`varying vec3 v_normal; -`,h?W+=` v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal; -`:W+=` v_normal = u_normalMatrix * a_normal; -`,C+=`varying vec3 v_normal; -`);let P;G&&(w.a_texcoord_0={semantic:"TEXCOORD_0"},P="v_texcoord_0",_+=`attribute vec2 a_texcoord_0; -`,_+=`varying vec2 ${P}; -`,W+=` ${P} = a_texcoord_0; -`,C+=`varying vec2 ${P}; -`),h&&(w.a_joint={semantic:"JOINTS_0"},w.a_weight={semantic:"WEIGHTS_0"},_+=`attribute vec4 a_joint; -`,_+=`attribute vec4 a_weight; -`),x&&(w.a_vertexColor={semantic:"COLOR_0"},_+=`attribute vec4 a_vertexColor; -`,_+=`varying vec4 v_vertexColor; -`,W+=` v_vertexColor = a_vertexColor; -`,C+=`varying vec4 v_vertexColor; -`),r&&(w.a_batchId={semantic:"_BATCHID"},_+=`attribute float a_batchId; -`);let F=V&&(u==="BLINN"||u==="PHONG")&&l(L.u_specular)&&l(L.u_shininess)&&L.u_shininess>0,M=!1,g=!1,Z="";for(let O in d)if(d.hasOwnProperty(O)){let U=d[O],j=U.type.toLowerCase(),K=U.baseName;Z+=` { -`;let te=`u_${K}Color`;if(j==="ambient")g=!0,Z+=` ambientLight += ${te}; -`;else if(V){M=!0;let z=`v_${K}Direction`,q=`v_${K}Position`;j!=="point"&&(_+=`varying vec3 ${z}; -`,C+=`varying vec3 ${z}; -`,W+=` ${z} = mat3(u_${K}Transform) * vec3(0.,0.,1.); -`,j==="directional"&&(Z+=` vec3 l = normalize(${z}); -`)),j!=="directional"?(_+=`varying vec3 ${q}; -`,C+=`varying vec3 ${q}; -`,W+=` ${q} = u_${K}Transform[3].xyz; -`,Z+=` vec3 VP = ${q} - v_positionEC; -`,Z+=` vec3 l = normalize(VP); -`,Z+=` float range = length(VP); -`,Z+=` float attenuation = 1.0 / (u_${K}Attenuation.x + `,Z+=`(u_${K}Attenuation.y * range) + `,Z+=`(u_${K}Attenuation.z * range * range)); -`):Z+=` float attenuation = 1.0; -`,j==="spot"&&(Z+=` float spotDot = dot(l, normalize(${z})); -`,Z+=` if (spotDot < cos(u_${K}FallOff.x * 0.5)) -`,Z+=` { -`,Z+=` attenuation = 0.0; -`,Z+=` } -`,Z+=` else -`,Z+=` { -`,Z+=` attenuation *= max(0.0, pow(spotDot, u_${K}FallOff.y)); -`,Z+=` } -`),Z+=` diffuseLight += ${te}* max(dot(normal,l), 0.) * attenuation; -`,F&&(u==="BLINN"?(Z+=` vec3 h = normalize(l + viewDir); -`,Z+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation; -`):(Z+=` vec3 reflectDir = reflect(-l, normal); -`,Z+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation; -`),Z+=` specularLight += ${te} * specularIntensity; -`)}Z+=` } -`}g||(Z+=` ambientLight += vec3(0.2, 0.2, 0.2); -`),!M&&u!=="CONSTANT"&&(C+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,C+=`uniform vec3 gltf_lightColor; -`,C+=`#endif -`,Z+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,Z+=` vec3 lightColor = czm_lightColor; -`,Z+=`#else -`,Z+=` vec3 lightColor = gltf_lightColor; -`,Z+=`#endif -`,Z+=` vec3 l = normalize(czm_lightDirectionEC); -`,Z+=` diffuseLight += lightColor * max(dot(normal,l), 0.2); -`,F&&(u==="BLINN"?(Z+=` vec3 h = normalize(l + viewDir); -`,Z+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)); -`):(Z+=` vec3 reflectDir = reflect(-l, normal); -`,Z+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)); -`),Z+=` specularLight += lightColor * specularIntensity; -`)),_+=`void main(void) { -`,_+=W,_+=`} -`,C+=`void main(void) { -`;let E=` vec3 color = vec3(0.0, 0.0, 0.0); -`;V&&(C+=` vec3 normal = normalize(v_normal); -`,i.doubleSided&&(C+=` if (czm_backFacing()) -`,C+=` { -`,C+=` normal = -normal; -`,C+=` } -`));let I;u!=="CONSTANT"?(l(L.u_diffuse)&&(L.u_diffuse.type===H.SAMPLER_2D?C+=` vec4 diffuse = texture2D(u_diffuse, ${P}); -`:C+=` vec4 diffuse = u_diffuse; -`,C+=` vec3 diffuseLight = vec3(0.0, 0.0, 0.0); -`,E+=` color += diffuse.rgb * diffuseLight; -`),F&&(L.u_specular.type===H.SAMPLER_2D?C+=` vec3 specular = texture2D(u_specular, ${P}).rgb; -`:C+=` vec3 specular = u_specular.rgb; -`,C+=` vec3 specularLight = vec3(0.0, 0.0, 0.0); -`,E+=` color += specular * specularLight; -`),l(L.u_transparency)?I=` gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency); -`:I=` gl_FragColor = vec4(color * diffuse.a, diffuse.a); -`):l(L.u_transparency)?I=` gl_FragColor = vec4(color * u_transparency, u_transparency); -`:I=` gl_FragColor = vec4(color, 1.0); -`,x&&(E+=` color *= v_vertexColor.rgb; -`),l(L.u_emission)&&(L.u_emission.type===H.SAMPLER_2D?C+=` vec3 emission = texture2D(u_emission, ${P}).rgb; -`:C+=` vec3 emission = u_emission.rgb; -`,E+=` color += emission; -`),(l(L.u_ambient)||u!=="CONSTANT")&&(l(L.u_ambient)?L.u_ambient.type===H.SAMPLER_2D?C+=` vec3 ambient = texture2D(u_ambient, ${P}).rgb; -`:C+=` vec3 ambient = u_ambient.rgb; -`:C+=` vec3 ambient = diffuse.rgb; -`,E+=` color += ambient * ambientLight; -`),C+=` vec3 viewDir = -normalize(v_positionEC); -`,C+=` vec3 ambientLight = vec3(0.0, 0.0, 0.0); -`,C+=Z,C+=E,C+=I,C+=`} -`;let A=Po(a,{type:H.VERTEX_SHADER,extras:{_pipeline:{source:_,extension:".glsl"}}}),N=Po(a,{type:H.FRAGMENT_SHADER,extras:{_pipeline:{source:C,extension:".glsl"}}}),D=Po(c,{fragmentShader:N,vertexShader:A});return Po(s,{attributes:w,program:D,uniforms:L})}function EVe(e,t){let n;switch(l(t.value)?n=t.value:l(t.index)?n=[t.index]:n=t,e){case"ambient":return n.length===1?H.SAMPLER_2D:H.FLOAT_VEC4;case"diffuse":return n.length===1?H.SAMPLER_2D:H.FLOAT_VEC4;case"emission":return n.length===1?H.SAMPLER_2D:H.FLOAT_VEC4;case"specular":return n.length===1?H.SAMPLER_2D:H.FLOAT_VEC4;case"shininess":return H.FLOAT;case"transparency":return H.FLOAT;case"transparent":return H.BOOL;case"doubleSided":return H.BOOL}}function wZt(e,t){let n="";n+=`technique:${e.technique};`;let i=e.values,o=Object.keys(i).sort(),r=o.length;for(let a=0;a<r;++a){let c=o[a];i.hasOwnProperty(c)&&(n+=`${c}:${EVe(c,i[c])}`,n+=";")}let s=y(e.jointCount,0);if(n+=`${s.toString()};`,l(t)){let a=t.skinning;s>0&&(n+=`${a.type};`),n+=t.hasVertexColors}return n}function FZt(e){let t=e.extensions.KHR_materials_common;if(!l(t)||!l(t.lights))return;let n=t.lights,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.type==="ambient"){l(r.ambient)||(r.ambient={});let s=r.ambient;l(s.color)||(s.color=[1,1,1])}else if(r.type==="directional"){l(r.directional)||(r.directional={});let s=r.directional;l(s.color)||(s.color=[1,1,1])}else if(r.type==="point"){l(r.point)||(r.point={});let s=r.point;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=y(s.constantAttenuation,1),s.linearAttenuation=y(s.linearAttenuation,0),s.quadraticAttenuation=y(s.quadraticAttenuation,0)}else if(r.type==="spot"){l(r.spot)||(r.spot={});let s=r.spot;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=y(s.constantAttenuation,1),s.fallOffAngle=y(s.fallOffAngle,3.14159265),s.fallOffExponent=y(s.fallOffExponent,0),s.linearAttenuation=y(s.linearAttenuation,0),s.quadraticAttenuation=y(s.quadraticAttenuation,0)}}}var WVe=XZt;var spo=S(T(),1);function AZt(e,t){if(t=y(t,y.EMPTY_OBJECT),To(e,"KHR_techniques_webgl")||!l(e.materials)||e.materials.length===0)return e;l(e.extensions)||(e.extensions={}),l(e.extensionsUsed)||(e.extensionsUsed=[]),l(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");let n=Ci.splitIncompatibleMaterials(e);return Ge.material(e,function(i,o){let r={},s=DZt(e,i,o,r,n,t);l(i.extensions)||(i.extensions={}),i.extensions.KHR_techniques_webgl={values:r,technique:s}}),Ci.ensureSemanticExistence(e),e}function MZt(e){return l(e.extensions)&&l(e.extensions.KHR_materials_pbrSpecularGlossiness)}function rC(e,t,n,i,o){let r,s=n[t];return l(s)&&l(s.texCoord)&&s.texCoord===1&&(i=i.replace("0","1")),l(n[`${t}Offset`])?(r=`${t}Coord`,o.fragmentShaderMain+=` vec2 ${r} = computeTexCoord(${i}, ${t}Offset, ${t}Rotation, ${t}Scale); -`):r=i,r}var NZt=[0,0],UZt=[0],kZt=[1,1];function $q(e,t,n){if(e.indexOf("Texture")===-1||!l(t.extensions)||!l(t.extensions.KHR_texture_transform))return;let i=`u_${e}`,o=t.extensions.KHR_texture_transform;n[`${i}Offset`]=y(o.offset,NZt),n[`${i}Rotation`]=y(o.rotation,UZt),n[`${i}Scale`]=y(o.scale,kZt),l(t.texCoord)&&l(o.texCoord)&&(n[i].texCoord=o.texCoord)}function DZt(e,t,n,i,o,r){let s=y(r.addBatchIdToGeneratedShaders,!1),a=e.extensions.KHR_techniques_webgl,c=a.techniques,u=a.shaders,d=a.programs,m=MZt(t),p,b,h;if(!m){let Re=t.pbrMetallicRoughness;if(l(Re))for(b in Re)Re.hasOwnProperty(b)&&(h=Re[b],p=`u_${b}`,i[p]=h,$q(b,h,i));else i.u_baseColorFactor=[1,1,1,1]}if(m){let Re=t.extensions.KHR_materials_pbrSpecularGlossiness;for(b in Re)Re.hasOwnProperty(b)&&(h=Re[b],p=`u_${b}`,i[p]=h,$q(b,h,i))}for(let Re in t)t.hasOwnProperty(Re)&&(Re.indexOf("Texture")>=0||Re.indexOf("Factor")>=0)&&(h=t[Re],p=`u_${Re}`,i[p]=h,$q(Re,h,i));let x=`precision highp float; -`,_=`precision highp float; -`,C;l(e.skins)&&(C=e.skins[0]);let V=l(C)?C.joints:[],L=V.length,R=o[n],G,W=!1,w=!1,P=!1,F=!1,M=!1,g=!1,Z=!1,E=!1,I=!1;l(R)&&(G=R.skinning,W=G.skinned&&V.length>0,w=R.hasVertexColors,P=R.hasMorphTargets,F=R.hasNormals,M=R.hasTangents,g=R.hasTexCoords,Z=R.hasTexCoord1,E=R.hasOutline);let A;P&&Ge.mesh(e,function(Re){Ge.meshPrimitive(Re,function(Ne){if(Ne.material===n){let yt=Ne.targets;l(yt)&&(A=yt)}})});let N={u_modelViewMatrix:{semantic:To(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:H.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:H.FLOAT_MAT4}};l(t.extensions)&&l(t.extensions.KHR_materials_unlit)&&(I=!0),F&&(N.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:H.FLOAT_MAT3}),W&&(N.u_jointMatrix={count:L,semantic:"JOINTMATRIX",type:H.FLOAT_MAT4}),P&&(N.u_morphWeights={count:A.length,semantic:"MORPHWEIGHTS",type:H.FLOAT});let D=t.alphaMode;l(D)&&D==="MASK"&&(N.u_alphaCutoff={semantic:"ALPHACUTOFF",type:H.FLOAT});for(p in i)i.hasOwnProperty(p)&&(N[p]={type:BZt(p)});let k=y(N.u_baseColorTexture,N.u_baseColorFactor);l(k)&&(k.semantic="_3DTILESDIFFUSE");for(p in N)if(N.hasOwnProperty(p)){let Re=N[p],Ne=l(Re.count)?`[${Re.count}]`:"";Re.type!==H.FLOAT_MAT3&&Re.type!==H.FLOAT_MAT4&&p!=="u_morphWeights"||Re.useInFragment?(_+=`uniform ${_0(Re.type)} ${p}${Ne}; -`,delete Re.useInFragment):x+=`uniform ${_0(Re.type)} ${p}${Ne}; -`}E&&(_+=`uniform sampler2D u_outlineTexture; -`);let O="";W&&(O+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let U={a_position:{semantic:"POSITION"}};if(E&&(U.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"}),x+=`attribute vec3 a_position; -`,F&&(x+=`varying vec3 v_positionEC; -`),E&&(x+=`attribute vec3 a_outlineCoordinates; -`,x+=`varying vec3 v_outlineCoordinates; -`),O+=` vec3 weightedPosition = a_position; -`,F&&(O+=` vec3 weightedNormal = a_normal; -`),M&&(O+=` vec4 weightedTangent = a_tangent; -`),P)for(let Re=0;Re<A.length;Re++){let Ne=A[Re];for(let yt in Ne)if(Ne.hasOwnProperty(yt)&&yt!=="extras"){let Nt=`a_${yt}_${Re}`;U[Nt]={semantic:`${yt}_${Re}`},x+=`attribute vec3 ${Nt}; -`,yt==="POSITION"?O+=` weightedPosition += u_morphWeights[${Re}] * ${Nt}; -`:yt==="NORMAL"?O+=` weightedNormal += u_morphWeights[${Re}] * ${Nt}; -`:M&&yt==="TANGENT"&&(O+=` weightedTangent.xyz += u_morphWeights[${Re}] * ${Nt}; -`)}}W?O+=` vec4 position = skinMatrix * vec4(weightedPosition, 1.0); -`:O+=` vec4 position = vec4(weightedPosition, 1.0); -`,O+=` position = u_modelViewMatrix * position; -`,F&&(O+=` v_positionEC = position.xyz; -`),O+=` gl_Position = u_projectionMatrix * position; -`,E&&(O+=` v_outlineCoordinates = a_outlineCoordinates; -`),F&&(U.a_normal={semantic:"NORMAL"},x+=`attribute vec3 a_normal; -`,I||(x+=`varying vec3 v_normal; -`,W?O+=` v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal; -`:O+=` v_normal = u_normalMatrix * weightedNormal; -`,_+=`varying vec3 v_normal; -`),_+=`varying vec3 v_positionEC; -`),M&&(U.a_tangent={semantic:"TANGENT"},x+=`attribute vec4 a_tangent; -`,x+=`varying vec4 v_tangent; -`,O+=` v_tangent.xyz = u_normalMatrix * weightedTangent.xyz; -`,O+=` v_tangent.w = weightedTangent.w; -`,_+=`varying vec4 v_tangent; -`),E&&(_+=`varying vec3 v_outlineCoordinates; -`);let j="",K,te,z,q,ee,pe,xe,ce;if(g){if(U.a_texcoord_0={semantic:"TEXCOORD_0"},K="v_texcoord_0",x+=`attribute vec2 a_texcoord_0; -`,x+=`varying vec2 ${K}; -`,O+=` ${K} = a_texcoord_0; -`,_+=`varying vec2 ${K}; -`,Z){U.a_texcoord_1={semantic:"TEXCOORD_1"};let Ne=K.replace("0","1");x+=`attribute vec2 a_texcoord_1; -`,x+=`varying vec2 ${Ne}; -`,O+=` ${Ne} = a_texcoord_1; -`,_+=`varying vec2 ${Ne}; -`}let Re={fragmentShaderMain:j};te=rC(e,"u_normalTexture",i,K,Re),z=rC(e,"u_baseColorTexture",i,K,Re),q=rC(e,"u_specularGlossinessTexture",i,K,Re),ee=rC(e,"u_diffuseTexture",i,K,Re),pe=rC(e,"u_metallicRoughnessTexture",i,K,Re),xe=rC(e,"u_occlusionTexture",i,K,Re),ce=rC(e,"u_emissiveTexture",i,K,Re),j=Re.fragmentShaderMain}W&&(U.a_joint={semantic:"JOINTS_0"},U.a_weight={semantic:"WEIGHTS_0"},x+=`attribute vec4 a_joint; -`,x+=`attribute vec4 a_weight; -`),w&&(U.a_vertexColor={semantic:"COLOR_0"},x+=`attribute vec4 a_vertexColor; -`,x+=`varying vec4 v_vertexColor; -`,O+=` v_vertexColor = a_vertexColor; -`,_+=`varying vec4 v_vertexColor; -`),s&&(U.a_batchId={semantic:"_BATCHID"},x+=`attribute float a_batchId; -`),x+=`void main(void) -{ -`,x+=O,x+=`} -`,F&&!I&&(_+=`const float M_PI = 3.141592653589793; -`,_+=`vec3 lambertianDiffuse(vec3 diffuseColor) -{ - return diffuseColor / M_PI; -} - -`,_+=`vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - -`,_+=`vec3 fresnelSchlick(float metalness, float VdotH) -{ - return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0); -} - -`,_+=`float smithVisibilityG1(float NdotV, float roughness) -{ - float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; - return NdotV / (NdotV * (1.0 - k) + k); -} - -`,_+=`float smithVisibilityGGX(float roughness, float NdotL, float NdotV) -{ - return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness); -} - -`,_+=`float GGX(float roughness, float NdotH) -{ - float roughnessSquared = roughness * roughness; - float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; - return roughnessSquared / (M_PI * f * f); -} - -`),_+=`vec3 SRGBtoLINEAR3(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -`,_+=`vec4 SRGBtoLINEAR4(vec4 srgbIn) -{ - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} - -`,_+=`vec3 applyTonemapping(vec3 linearIn) -{ -#ifndef HDR - return czm_acesTonemapping(linearIn); -#else - return linearIn; -#endif -} - -`,_+=`vec3 LINEARtoSRGB(vec3 linearIn) -{ -#ifndef HDR - return pow(linearIn, vec3(1.0/2.2)); -#else - return linearIn; -#endif -} - -`,_+=`vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) -{ - rotation = -rotation; - mat3 transform = mat3( - cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, - -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, - offset.x, offset.y, 1.0); - vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; - return transformedTexCoords; -} - -`,_+=`#ifdef USE_IBL_LIGHTING -`,_+=`uniform vec2 gltf_iblFactor; -`,_+=`#endif -`,_+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,_+=`uniform vec3 gltf_lightColor; -`,_+=`#endif -`,_+=`void main(void) -{ -`,_+=j,F&&!I&&(_+=` vec3 ng = normalize(v_normal); -`,_+=` vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0)); -`,l(i.u_normalTexture)?M?(_+=` vec3 t = normalize(v_tangent.xyz); -`,_+=` vec3 b = normalize(cross(ng, t) * v_tangent.w); -`,_+=` mat3 tbn = mat3(t, b, ng); -`,_+=` vec3 n = texture2D(u_normalTexture, ${te}).rgb; -`,_+=` n = normalize(tbn * (2.0 * n - 1.0)); -`):(_=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -${_}`,_+=`#ifdef GL_OES_standard_derivatives -`,_+=` vec3 pos_dx = dFdx(v_positionEC); -`,_+=` vec3 pos_dy = dFdy(v_positionEC); -`,_+=` vec3 tex_dx = dFdx(vec3(${te},0.0)); -`,_+=` vec3 tex_dy = dFdy(vec3(${te},0.0)); -`,_+=` vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); -`,_+=` t = normalize(t - ng * dot(ng, t)); -`,_+=` vec3 b = normalize(cross(ng, t)); -`,_+=` mat3 tbn = mat3(t, b, ng); -`,_+=` vec3 n = texture2D(u_normalTexture, ${te}).rgb; -`,_+=` n = normalize(tbn * (2.0 * n - 1.0)); -`,_+=`#else -`,_+=` vec3 n = ng; -`,_+=`#endif -`):_+=` vec3 n = ng; -`,t.doubleSided&&(_+=` if (czm_backFacing()) -`,_+=` { -`,_+=` n = -n; -`,_+=` } -`)),l(i.u_baseColorTexture)?(_+=` vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, ${z})); -`,l(i.u_baseColorFactor)&&(_+=` baseColorWithAlpha *= u_baseColorFactor; -`)):l(i.u_baseColorFactor)?_+=` vec4 baseColorWithAlpha = u_baseColorFactor; -`:_+=` vec4 baseColorWithAlpha = vec4(1.0); -`,w&&(_+=` baseColorWithAlpha *= v_vertexColor; -`),_+=` vec3 baseColor = baseColorWithAlpha.rgb; -`,F&&!I?(m?(l(i.u_specularGlossinessTexture)?(_+=` vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, ${q})); -`,_+=` vec3 specular = specularGlossiness.rgb; -`,_+=` float glossiness = specularGlossiness.a; -`,l(i.u_specularFactor)&&(_+=` specular *= u_specularFactor; -`),l(i.u_glossinessFactor)&&(_+=` glossiness *= u_glossinessFactor; -`)):(l(i.u_specularFactor)?_+=` vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); -`:_+=` vec3 specular = vec3(1.0); -`,l(i.u_glossinessFactor)?_+=` float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -`:_+=` float glossiness = 1.0; -`),l(i.u_diffuseTexture)?(_+=` vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, ${ee})); -`,l(i.u_diffuseFactor)&&(_+=` diffuse *= u_diffuseFactor; -`)):l(i.u_diffuseFactor)?_+=` vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -`:_+=` vec4 diffuse = vec4(1.0); -`,_+=` baseColorWithAlpha.a = diffuse.a; -`):l(i.u_metallicRoughnessTexture)?(_+=` vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, ${pe}).rgb; -`,_+=` float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -`,_+=` float roughness = clamp(metallicRoughness.g, 0.04, 1.0); -`,l(i.u_metallicFactor)&&(_+=` metalness *= u_metallicFactor; -`),l(i.u_roughnessFactor)&&(_+=` roughness *= u_roughnessFactor; -`)):(l(i.u_metallicFactor)?_+=` float metalness = clamp(u_metallicFactor, 0.0, 1.0); -`:_+=` float metalness = 1.0; -`,l(i.u_roughnessFactor)?_+=` float roughness = clamp(u_roughnessFactor, 0.04, 1.0); -`:_+=` float roughness = 1.0; -`),_+=` vec3 v = -normalize(v_positionEC); -`,_+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,_+=` vec3 lightColorHdr = czm_lightColorHdr; -`,_+=`#else -`,_+=` vec3 lightColorHdr = gltf_lightColor; -`,_+=`#endif -`,_+=` vec3 l = normalize(czm_lightDirectionEC); -`,_+=` vec3 h = normalize(v + l); -`,_+=` float NdotL = clamp(dot(n, l), 0.001, 1.0); -`,_+=` float NdotV = abs(dot(n, v)) + 0.001; -`,_+=` float NdotH = clamp(dot(n, h), 0.0, 1.0); -`,_+=` float LdotH = clamp(dot(l, h), 0.0, 1.0); -`,_+=` float VdotH = clamp(dot(v, h), 0.0, 1.0); -`,_+=` vec3 f0 = vec3(0.04); -`,m?(_+=` float roughness = 1.0 - glossiness; -`,_+=` vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b)); -`,_+=` vec3 specularColor = specular; -`):(_+=` vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0); -`,_+=` vec3 specularColor = mix(f0, baseColor, metalness); -`),_+=` float alpha = roughness * roughness; -`,_+=` float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); -`,_+=` vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -`,_+=` vec3 r0 = specularColor.rgb; -`,_+=` vec3 F = fresnelSchlick2(r0, r90, VdotH); -`,_+=` float G = smithVisibilityGGX(alpha, NdotL, NdotV); -`,_+=` float D = GGX(alpha, NdotH); -`,_+=` vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); -`,_+=` vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); -`,_+=` vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution); -`,_+=`#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) -`,_+=` vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); -`,_+=` float vertexRadius = length(positionWC); -`,_+=` float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); -`,_+=` float reflectionDotNadir = dot(r, normalize(positionWC)); -`,_+=` r.x = -r.x; -`,_+=` r = -normalize(czm_temeToPseudoFixed * r); -`,_+=` r.x = -r.x; -`,_+=` float inverseRoughness = 1.04 - roughness; -`,_+=` inverseRoughness *= inverseRoughness; -`,_+=` vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness; -`,_+=` float atmosphereHeight = 0.05; -`,_+=` float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); -`,_+=` float blendRegionOffset = roughness * -1.0; -`,_+=` float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); -`,_+=` float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); -`,_+=` float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); -`,_+=` float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); -`,_+=` vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); -`,_+=` vec3 nadirColor = belowHorizonColor * 0.5; -`,_+=` vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); -`,_+=` vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); -`,_+=` vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); -`,_+=` vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); -`,_+=` float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; -`,_+=` float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); -`,_+=` vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); -`,_+=` float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); -`,_+=` vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); -`,_+=` specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); -`,_+=` specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -`,_+=`#ifdef USE_SUN_LUMINANCE -`,_+=` float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0); -`,_+=` float S = acos(LdotZenith); -`,_+=` float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0); -`,_+=` float gamma = acos(NdotL); -`,_+=` float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); -`,_+=` float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); -`,_+=` float luminance = gltf_luminanceAtZenith * (numerator / denominator); -`,_+=`#endif -`,_+=` vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,_+=` vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y); -`,_+=` float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); -`,_+=` vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); -`,_+=` IBLColor *= lightColor; -`,_+=`#ifdef USE_SUN_LUMINANCE -`,_+=` color += IBLColor * luminance; -`,_+=`#else -`,_+=` color += IBLColor; -`,_+=`#endif -`,_+=`#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -`,_+=` const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); -`,_+=` vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n))); -`,_+=`#ifdef DIFFUSE_IBL -`,_+=`#ifdef CUSTOM_SPHERICAL_HARMONICS -`,_+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); -`,_+=`#else -`,_+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); -`,_+=`#endif -`,_+=`#else -`,_+=` vec3 diffuseIrradiance = vec3(0.0); -`,_+=`#endif -`,_+=`#ifdef SPECULAR_IBL -`,_+=` vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,_+=`#ifdef CUSTOM_SPECULAR_IBL -`,_+=` vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD); -`,_+=`#else -`,_+=` vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); -`,_+=`#endif -`,_+=` specularIBL *= F * brdfLut.x + brdfLut.y; -`,_+=`#else -`,_+=` vec3 specularIBL = vec3(0.0); -`,_+=`#endif -`,_+=` color += diffuseIrradiance * diffuseColor + specularColor * specularIBL; -`,_+=`#endif -`):_+=` vec3 color = baseColor; -`,I||(l(i.u_occlusionTexture)&&(_+=` color *= texture2D(u_occlusionTexture, ${xe}).r; -`),l(i.u_emissiveTexture)?(_+=` vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, ${ce}).rgb); -`,l(i.u_emissiveFactor)&&(_+=` emissive *= u_emissiveFactor; -`),_+=` color += emissive; -`):l(i.u_emissiveFactor)&&(_+=` color += u_emissiveFactor; -`)),I||(_+=` color = applyTonemapping(color); -`),_+=` color = LINEARtoSRGB(color); -`,E&&(_+=` float outlineness = max( -`,_+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r, -`,_+=` max( -`,_+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r, -`,_+=` texture2D(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r)); -`,_+=` color = mix(color, vec3(0.0, 0.0, 0.0), outlineness); -`),l(D)?D==="MASK"?(_+=` if (baseColorWithAlpha.a < u_alphaCutoff) { -`,_+=` discard; -`,_+=` } -`,_+=` gl_FragColor = vec4(color, 1.0); -`):D==="BLEND"?_+=` gl_FragColor = vec4(color, baseColorWithAlpha.a); -`:_+=` gl_FragColor = vec4(color, 1.0); -`:_+=` gl_FragColor = vec4(color, 1.0); -`,_+=`} -`;let ye=Po(u,{type:H.VERTEX_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),Te=Po(u,{type:H.FRAGMENT_SHADER,extras:{_pipeline:{source:_,extension:".glsl"}}}),Le=Po(d,{fragmentShader:Te,vertexShader:ye});return Po(c,{attributes:U,program:Le,uniforms:N})}function BZt(e){if(e.indexOf("Offset")!==-1)return H.FLOAT_VEC2;if(e.indexOf("Rotation")!==-1)return H.FLOAT;if(e.indexOf("Scale")!==-1)return H.FLOAT_VEC2;if(e.indexOf("Texture")!==-1)return H.SAMPLER_2D;switch(e){case"u_baseColorFactor":return H.FLOAT_VEC4;case"u_metallicFactor":return H.FLOAT;case"u_roughnessFactor":return H.FLOAT;case"u_emissiveFactor":return H.FLOAT_VEC3;case"u_diffuseFactor":return H.FLOAT_VEC4;case"u_specularFactor":return H.FLOAT_VEC3;case"u_glossinessFactor":return H.FLOAT}}var IVe=AZt;var cpo=S(T(),1),S3={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};S3.getMorphTime=function(e){return e===S3.SCENE3D?1:e===S3.MORPHING?void 0:0};var Em=Object.freeze(S3);var upo=S(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 Cp=Object.freeze(Sd);var mpo=S(T(),1),OZt={LEFT:-1,NONE:0,RIGHT:1},sC=Object.freeze(OZt);var ppo=S(T(),1);var YZt={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}}},e$=YZt;var Lpo=S(T(),1);var ypo=S(T(),1);var KZt={NEVER:H.NEVER,LESS:H.LESS,EQUAL:H.EQUAL,LESS_OR_EQUAL:H.LEQUAL,GREATER:H.GREATER,NOT_EQUAL:H.NOTEQUAL,GREATER_OR_EQUAL:H.GEQUAL,ALWAYS:H.ALWAYS},t$=Object.freeze(KZt);var Spo=S(T(),1);var zZt={ZERO:H.ZERO,KEEP:H.KEEP,REPLACE:H.REPLACE,INCREMENT:H.INCR,DECREMENT:H.DECR,INVERT:H.INVERT,INCREMENT_WRAP:H.INCR_WRAP,DECREMENT_WRAP:H.DECR_WRAP},aC=Object.freeze(zZt);var T3={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};T3.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:t$.ALWAYS,frontOperation:{fail:aC.KEEP,zFail:aC.KEEP,zPass:aC.REPLACE},backFunction:t$.ALWAYS,backOperation:{fail:aC.KEEP,zFail:aC.KEEP,zPass:aC.REPLACE},reference:T3.CESIUM_3D_TILE_MASK,mask:T3.CESIUM_3D_TILE_MASK}};var n$=Object.freeze(T3);var HZt=new f,dx=Ci.ModelState,JZt="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",QZt=X.EPSILON16;function l$(e,t){e._cachedGltf=t}function R9(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(R9.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}});R9.prototype.makeReady=function(e){this.gltf=e;let t=this.modelsToLoad,n=t.length;for(let i=0;i<n;++i){let o=t[i];o.isDestroyed()||l$(o,this)}this.modelsToLoad=void 0,this.ready=!0};var fx={},XVe={};function Xa(e){e=y(e,y.EMPTY_OBJECT);let t=e.cacheKey;this._cacheKey=t,this._cachedGltf=void 0,this._releaseGltfJson=y(e.releaseGltfJson,!1);let n;if(l(t)&&l(fx[t])&&fx[t].ready)n=fx[t],++n.count;else{let s=e.gltf;if(l(s)){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),s instanceof Uint8Array){let a=vq(s);n=new R9({gltf:a,ready:!0})}else n=new R9({gltf:e.gltf,ready:!0});n.count=1,l(t)&&(fx[t]=n)}}l$(this,n);let i=y(e.basePath,"");this._resource=We.createIfNeeded(i);let o=e.credit;typeof o=="string"&&(o=new Ct(o)),this._credit=o,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this.show=y(e.show,!0),this.silhouetteColor=y(e.silhouetteColor,Y.RED),this._silhouetteColor=new Y,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=y(e.silhouetteSize,0),this.modelMatrix=v.clone(y(e.modelMatrix,v.IDENTITY)),this._modelMatrix=v.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=y(e.scale,1),this._scale=this.scale,this.minimumPixelSize=y(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=y(e.heightReference,CZ.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;let r=e.scene;this._scene=r,l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=y(e.allowPicking,!0),this._ready=!1,this._readyPromise=ca(),this.activeAnimations=new xVe(this),this.clampAnimations=y(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=y(e.incrementallyLoadTextures,!0),this._asynchronous=y(e.asynchronous,!0),this.shadows=y(e.shadows,Cp.ENABLED),this._shadows=this.shadows,this.color=Y.clone(y(e.color,Y.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=y(e.colorBlendMode,f3.HIGHLIGHT),this.colorBlendAmount=y(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=y(e.backFaceCulling,!0),this.showOutline=y(e.showOutline,!0),this.splitDirection=y(e.splitDirection,sC.NONE),this._splittingEnabled=!1,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=y(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=y(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=y(e.upAxis,tc.Y),this._gltfForwardAxis=tc.Z,this._forwardAxis=e.forwardAxis,this.cull=y(e.cull,!0),this.opaquePass=y(e.opaquePass,Ze.OPAQUE),this._computedModelMatrix=new v,this._clippingPlanesMatrix=v.clone(v.IDENTITY),this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new ae,this._state=dx.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,e.dequantizeInShader&&po("Model.dequantizeInShader","The Model dequantizeInShader constructor parameter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this._dequantizeInShader=y(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._pointsLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._lightColor=f.clone(e.lightColor),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new n3,this._shouldDestroyImageBasedLighting=!0),this._shouldRegenerateShaders=!1}Object.defineProperties(Xa.prototype,{gltf:{get:function(){return po("Model.gltf","Model.gltf getter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this.gltfInternal}},gltfInternal:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return po("model.basePath","Model.basePath getter is deprecated in CesiumJS 1.94. It will be removed in CesiumJS 1.97"),this.basePathInternal}},basePathInternal:{get:function(){return this._resource.url}},boundingSphere:{get:function(){let e=this.modelMatrix;this.heightReference!==CZ.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,n=ae.clone(this._boundingSphere,this._scaledBoundingSphere);return n.radius*=t,ae.transform(n,e,n),l(this._rtcCenter)&&f.add(this._rtcCenter,n.center,n.center),n}},boundingSphereInternal:{get:function(){let e=this.modelMatrix;this.heightReference!==CZ.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=v.getScale(e,HZt),n=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;f.multiplyByScalar(t,n,t);let i=this._scaledBoundingSphere;return i.center=f.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=f.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&f.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return po("Model.pendingTextureLoads","The Model.pendingTextureLoads getter was deprecated in CesiumJS 1.94 and will be removed in CesiumJS 1.97"),this.pendingTextureLoadsInternal}},pendingTextureLoadsInternal:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=Ci.getUsedExtensions(this.gltfInternal)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=Ci.getRequiredExtensions(this.gltfInternal)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return l(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&S9.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},lightColor:{get:function(){return this._lightColor},set:function(e){let t=this._lightColor;e===t||f.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(t)&&!l(e)||l(e)&&!l(t),this._lightColor=f.clone(e,t))}},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._shouldRegenerateShaders=!0)}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){if(this._showCreditsOnScreen!==e){l(this._credit)&&(this._credit.showOnScreen=e);let t=this._resourceCredits.length;for(let i=0;i<t;i++)this._resourceCredits[i].showOnScreen=e;let n=this._gltfCredits.length;for(let i=0;i<n;i++)this._gltfCredits[i].showOnScreen=e}this._showCreditsOnScreen=e}}});function OVe(e){return e.stencilBuffer}function u$(e){return!Y.equals(e.color,Y.WHITE)||e.colorBlendMode!==f3.HIGHLIGHT}function d$(e){let t=e._clippingPlanes;return l(t)&&t.enabled&&t.length!==0}Xa.silhouetteSupported=function(e){return OVe(e.context)};function jZt(e){return cl(e)==="glTF"}Xa.fromGltf=function(e){let t=e.url;e=Ue(e);let n=We.createIfNeeded(t),i=y(e.basePath,n.clone()),o=We.createIfNeeded(i),r=y(e.cacheKey,XVe[Su(n.url)]);l(r)||(r=Nn(),XVe[Su(n.url)]=r),l(e.basePath)&&!l(e.cacheKey)&&(r+=o.url),e.cacheKey=r,e.basePath=o;let s=new Xa(e),a=fx[r];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(s)):(a=new R9({ready:!1}),a.count=1,a.modelsToLoad.push(s),l$(s,a),fx[r]=a,l(n.headers.Accept)||(n.headers.Accept=JZt),n.fetchArrayBuffer().then(function(c){let u=new Uint8Array(c);if(jZt(u)){let p=vq(u);a.makeReady(p)}else{let p=Zo(u);a.makeReady(p)}let d=s._resourceCredits,m=n.credits;if(l(m)){let p=m.length;for(let b=0;b<p;b++)d.push(m[b])}}).catch(Ci.getFailedLoadFunction(s,"model",n.url))),s};Xa._gltfCache=fx;function G9(e,t,n){return e._runtime[t][n]}Xa.prototype.getNode=function(e){let t=G9(this,"nodesByName",e);return l(t)?t.publicNode:void 0};Xa.prototype.getMesh=function(e){return G9(this,"meshesByName",e)};Xa.prototype.getMaterial=function(e){return G9(this,"materialsByName",e)};Xa.prototype.setArticulationStage=function(e,t){let n=G9(this,"stagesByKey",e),i=G9(this,"articulationsByStageKey",e);l(n)&&l(i)&&(t=X.clamp(t,n.minimumValue,n.maximumValue),X.equalsEpsilon(n.currentValue,t,QZt)||(n.currentValue=t,i.isDirty=!0))};var qZt=new f,i$=new $;function YVe(e,t){let n=e.currentValue,i=qZt,o;switch(e.type){case"xRotate":o=$.fromRotationX(X.toRadians(n),i$),v.multiplyByMatrix3(t,o,t);break;case"yRotate":o=$.fromRotationY(X.toRadians(n),i$),v.multiplyByMatrix3(t,o,t);break;case"zRotate":o=$.fromRotationZ(X.toRadians(n),i$),v.multiplyByMatrix3(t,o,t);break;case"xTranslate":i.x=n,i.y=0,i.z=0,v.multiplyByTranslation(t,i,t);break;case"yTranslate":i.x=0,i.y=n,i.z=0,v.multiplyByTranslation(t,i,t);break;case"zTranslate":i.x=0,i.y=0,i.z=n,v.multiplyByTranslation(t,i,t);break;case"xScale":i.x=n,i.y=1,i.z=1,v.multiplyByScale(t,i,t);break;case"yScale":i.x=1,i.y=n,i.z=1,v.multiplyByScale(t,i,t);break;case"zScale":i.x=1,i.y=1,i.z=n,v.multiplyByScale(t,i,t);break;case"uniformScale":v.multiplyByUniformScale(t,n,t);break;default:break}return t}var $Zt=new v;Xa.prototype.applyArticulations=function(){let e=this._runtime.articulationsByName;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];if(n.isDirty){n.isDirty=!1;let i=n.nodes.length;for(let o=0;o<i;++o){let r=n.nodes[o],s=v.clone(r.originalMatrix,$Zt),a=n.stages.length;for(let c=0;c<a;++c){let u=n.stages[c];s=YVe(u,s)}r.matrix=s}}}};function eRt(e){let t=e.gltfInternal,n=e._loadResources;Ge.buffer(t,function(i,o){n.buffers[o]=i.extras._pipeline.source})}function tRt(e,t){return function(n){let i=e._loadResources,o=new Uint8Array(n);--i.pendingBufferLoads,e.gltfInternal.buffers[t].extras._pipeline.source=o}}function nRt(e){let t=e.gltfInternal.bufferViews,n=e._loadResources.vertexBuffersToCreate;Ge.bufferView(e.gltfInternal,function(r,s){r.target===H.ARRAY_BUFFER&&n.enqueue(s)});let i=e._loadResources.indexBuffersToCreate,o={};Ge.accessor(e.gltfInternal,function(r){let s=r.bufferView;if(!l(s))return;t[s].target===H.ELEMENT_ARRAY_BUFFER&&!l(o[s])&&(o[s]=!0,i.enqueue({id:s,componentType:r.componentType}))})}function iRt(e){let t=e.gltfInternal;if(!To(t,"KHR_techniques_webgl"))return;let n=e._sourcePrograms,i=e._sourceTechniques,o=t.extensions.KHR_techniques_webgl.programs;Ge.technique(t,function(r,s){i[s]=Ue(r);let a=r.program;l(n[a])||(n[a]=Ue(o[a]))})}function oRt(e,t,n){return function(i){let o=e._loadResources;o.shaders[n]={source:i,type:t,bufferView:void 0},--o.pendingShaderLoads,e._rendererResources.sourceShaders[n]=i}}function rRt(e){let t=e.gltfInternal,n=t.buffers,i=t.bufferViews,o=e._rendererResources.sourceShaders;Ge.shader(t,function(r,s){if(l(r.bufferView)){let a=r.bufferView,c=i[a],u=c.buffer,d=n[u],m=Os(d.extras._pipeline.source,c.byteOffset,c.byteLength);o[s]=m}else if(l(r.extras._pipeline.source))o[s]=r.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;let a=e._resource.getDerivedResource({url:r.uri});a.fetchText().then(oRt(e,r.type,s)).catch(Ci.getFailedLoadFunction(e,"shader",a.url))}})}function sRt(e){let t=e._sourceTechniques;for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:n})}}function aRt(e){let t={},n={},i={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=n,e._runtime.stagesByKey=i;let o=e.gltfInternal;if(!To(o,"AGI_articulations")||!l(o.extensions)||!l(o.extensions.AGI_articulations))return;let r=o.extensions.AGI_articulations.articulations;if(!l(r))return;let s=r.length;for(let a=0;a<s;++a){let c=Ue(r[a]);c.nodes=[],c.isDirty=!0,t[c.name]=c;let u=c.stages.length;for(let d=0;d<u;++d){let m=c.stages[d];m.currentValue=m.initialValue;let p=`${c.name} ${m.name}`;n[p]=c,i[p]=m}}}function KVe(e,t){return function(n){let i=e._loadResources;--i.pendingTextureLoads;let o;Array.isArray(n)&&(o=n.slice(1,n.length).map(function(r){return r.bufferView}),n=n[0]),i.texturesToCreate.enqueue({id:t,image:n,bufferView:n.bufferView,width:n.width,height:n.height,internalFormat:n.internalFormat,mipLevels:o})}}var cRt=/(^data:image\/ktx2)|(\.ktx2$)/i;function lRt(e,t,n){let i=e.gltfInternal,o=i.images,r;Ge.texture(i,function(s,a){let c=s.source;l(s.extensions)&&l(s.extensions.EXT_texture_webp)&&n?c=s.extensions.EXT_texture_webp.source:l(s.extensions)&&l(s.extensions.KHR_texture_basisu)&&t.supportsBasis&&(c=s.extensions.KHR_texture_basisu.source);let u=o[c],d=u.bufferView,m=u.mimeType;if(r=u.uri,l(d))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:d,mimeType:m});else{++e._loadResources.pendingTextureLoads;let p=e._resource.getDerivedResource({url:r}),b;cRt.test(r)?b=Ns(p):b=p.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0}),b.then(KVe(e,a,c)).catch(Ci.getFailedLoadFunction(e,"image",p.url))}})}var uRt=new v;function dRt(e){let t={},n={},i=[],o=e._loadResources.skinnedNodesIds,r=e._runtime.articulationsByName;Ge.node(e.gltfInternal,function(s,a){let c={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new v,computedMatrix:new v,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(c.publicNode=new VVe(e,s,c,a,Ci.getTransform(s)),t[a]=c,n[s.name]=c,l(s.skin)&&(o.push(a),i.push(c)),l(s.extensions)&&l(s.extensions.AGI_articulations)){let u=s.extensions.AGI_articulations.articulationName;if(l(u)){let d=v.clone(c.publicNode.originalMatrix,uRt),m=r[u];m.nodes.push(c.publicNode);let p=m.stages.length;for(let b=0;b<p;++b){let h=m.stages[b];d=YVe(h,d)}c.publicNode.matrix=d}}}),e._runtime.nodes=t,e._runtime.nodesByName=n,e._runtime.skinnedNodes=i}function mRt(e){let t=e.gltfInternal,n=e._sourceTechniques,i={},o={},r=e._uniformMaps;Ge.material(t,function(s,a){r[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};let c=new SVe(e,s,a);if(l(s.extensions)&&l(s.extensions.KHR_techniques_webgl)){let u=s.extensions.KHR_techniques_webgl.technique;c._technique=u,c._program=n[u].program,Ge.materialValue(s,function(d,m){l(c._values)||(c._values={}),c._values[m]=Ue(d)})}i[s.name]=c,o[a]=c}),e._runtime.materialsByName=i,e._runtime.materialsById=o}function fRt(e){let t={},n=e._runtime.materialsById;Ge.mesh(e.gltfInternal,function(i,o){t[i.name]=new CVe(i,n,o),(l(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&Ge.meshPrimitive(i,function(r,s){let a=h$(e,r),c=e._programPrimitives[a];l(c)||(c={},e._programPrimitives[a]=c),c[`${o}.primitive.${s}`]=r})}),e._runtime.meshesByName=t}function hRt(e){let n=e.gltfInternal.asset.copyright;if(!l(n))return;let i=e._showCreditsOnScreen,o=n.split(";").map(function(r){return new Ct(r.trim(),i)});e._gltfCredits=o}var m$=function(){this.id=void 0,this.model=void 0,this.context=void 0};m$.prototype.set=function(e,t,n){this.id=e,this.model=t,this.context=n};m$.prototype.execute=function(){zVe(this.id,this.model,this.context)};function zVe(e,t,n){let i=t._loadResources,r=t.gltfInternal.bufferViews[e];l(r)||(r=i.createdBufferViews[e]);let s=ut.createVertexBuffer({context:n,typedArray:i.getBuffer(r),usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=s,t._geometryByteLength+=s.sizeInBytes}var f$=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};f$.prototype.set=function(e,t,n,i){this.id=e,this.componentType=t,this.model=n,this.context=i};f$.prototype.execute=function(){HVe(this.id,this.componentType,this.model,this.context)};function HVe(e,t,n,i){let o=n._loadResources,s=n.gltfInternal.bufferViews[e];l(s)||(s=o.createdBufferViews[e]);let a=ut.createIndexBuffer({context:i,typedArray:o.getBuffer(s),usage:Me.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,n._rendererResources.buffers[e]=a,n._geometryByteLength+=a.sizeInBytes}var PVe=new m$,vVe=new f$;function pRt(e,t){let n=e._loadResources;if(n.pendingBufferLoads!==0)return;let i=t.context,o=n.vertexBuffersToCreate,r=n.indexBuffersToCreate,s;if(e.asynchronous){for(;o.length>0&&(PVe.set(o.peek(),e,i),!!t.jobScheduler.execute(PVe,C9.BUFFER));)o.dequeue();for(;r.length>0&&(s=r.peek(),vVe.set(s.id,s.componentType,e,i),!!t.jobScheduler.execute(vVe,C9.BUFFER));)r.dequeue()}else{for(;o.length>0;)zVe(o.dequeue(),e,i);for(;r.length>0;)s=r.dequeue(),HVe(s.id,s.componentType,e,i)}}function h$(e,t){let n=e._runtime.materialsById[t.material];if(l(n))return n._program}function JVe(e,t,n){let i,o=n._programPrimitives[t];if(!l(o))return e;let r;for(r in o)if(o.hasOwnProperty(r)&&(i=o[r],h$(n,i)===t))break;n._programPrimitives[t]=void 0;let s;if(n.extensionsUsed.WEB3D_quantized_attributes)s=Ci.modifyShaderForQuantizedAttributes(n.gltfInternal,i,e),n._quantizedUniforms[t]=s.uniforms;else{let a=n._decodedData[r];if(l(a))s=Ci.modifyShaderForDracoQuantizedAttributes(n.gltfInternal,i,e,a.attributes);else return e}return s.shader}function bRt(e){return e=De.replaceMain(e,"gltf_blend_main"),e+=`uniform vec4 gltf_color; -uniform float gltf_colorBlend; -void main() -{ - gltf_blend_main(); - gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); - float highlight = ceil(gltf_colorBlend); - gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); - gl_FragColor.a *= gltf_color.a; -} -`,e}function E9(e,t,n){return l(n)&&(e=n(e,t)),e}var p$=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};p$.prototype.set=function(e,t,n){this.programToCreate=e,this.model=t,this.context=n};p$.prototype.execute=function(){QVe(this.programToCreate,this.model,this.context)};function QVe(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=s[r.vertexShader],c=s[r.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){let h=u[i];l(h)||(h=JVe(a,i,t),u[i]=h),a=h}let d=E9(a,i,t._vertexShaderLoaded),m=E9(c,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(m=`uniform vec4 czm_pickColor; -${m}`);let p=t._imageBasedLighting,b=p.enabled;if(b&&(m=`#define USE_IBL_LIGHTING - -${m}`),l(t._lightColor)&&(m=`#define USE_CUSTOM_LIGHT_COLOR - -${m}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(m=De.replaceMain(m,"non_gamma_corrected_main"),m=`${m} -void main() { - non_gamma_corrected_main(); - gl_FragColor = czm_gammaCorrect(gl_FragColor); -} -`),_Z.isSupported(n)){let h=p.useSphericalHarmonicCoefficients,x=p.useSpecularEnvironmentMaps;(h||x||b)&&(m=`uniform mat3 gltf_iblReferenceFrameMatrix; -${m}`),l(p.sphericalHarmonicCoefficients)?m=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${m}`:p.useDefaultSphericalHarmonics&&(m=`#define DIFFUSE_IBL -${m}`),l(p.specularEnvironmentMapAtlas)&&p.specularEnvironmentMapAtlas.ready?m=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${m}`:p.useDefaultSpecularMaps&&(m=`#define SPECULAR_IBL -${m}`)}l(p.luminanceAtZenith)&&(m=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${m}`),jVe(i,o,m,d,t,n)}function gRt(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=t._quantizedVertexShaders,c=t.clippingPlanes,u=d$(t),d=s[r.vertexShader],m=s[r.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(d=a[i]);let p=m;u$(t)&&(p=Xa._modifyShaderForColor(p)),u&&(p=_Gt(p,c,n)),t.splitDirection!==sC.NONE&&(p=e$.modifyFragmentShader(p));let b=E9(d,i,t._vertexShaderLoaded),h=E9(p,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(h=`uniform vec4 czm_pickColor; -${h}`);let x=t._imageBasedLighting,_=x.enabled;if(_&&(h=`#define USE_IBL_LIGHTING - -${h}`),l(t._lightColor)&&(h=`#define USE_CUSTOM_LIGHT_COLOR - -${h}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(h=De.replaceMain(h,"non_gamma_corrected_main"),h=`${h} -void main() { - non_gamma_corrected_main(); - gl_FragColor = czm_gammaCorrect(gl_FragColor); -} -`),_Z.isSupported(n)){let C=x.useSphericalHarmonicCoefficients,V=x.useSpecularEnvironmentMaps;(C||V||_)&&(h=`uniform mat3 gltf_iblReferenceFrameMatrix; -${h}`),l(x.sphericalHarmonicCoefficients)?h=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${h}`:x.useDefaultSphericalHarmonics&&(h=`#define DIFFUSE_IBL -${h}`),l(x.specularEnvironmentMapAtlas)&&x.specularEnvironmentMapAtlas.ready?h=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${h}`:x.useDefaultSpecularMaps&&(h=`#define SPECULAR_IBL -${h}`)}l(x.luminanceAtZenith)&&(h=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${h}`),jVe(i,o,h,b,t,n)}function jVe(e,t,n,i,o,r){let s=o._sourceTechniques[t],a=Ci.createAttributeLocations(s,o._precreatedAttributes);o._rendererResources.programs[e]=qt.fromCache({context:r,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:a})}var wVe=new p$;function yRt(e,t){let n=e._loadResources,i=n.programsToCreate;if(n.pendingShaderLoads!==0||n.pendingBufferLoads!==0)return;let o=t.context;if(e.asynchronous)for(;i.length>0&&(wVe.set(i.peek(),e,o),!!t.jobScheduler.execute(wVe,C9.PROGRAM));)i.dequeue();else for(;i.length>0;)QVe(i.dequeue(),e,o)}function xRt(e,t){return function(n){e.texturesToCreate.enqueue({id:t.id,image:n,bufferView:void 0}),--e.pendingBufferViewToImage}}function _Rt(e){let t=e._loadResources;if(t.pendingBufferLoads===0)for(;t.texturesToCreateFromBufferView.length>0;){let n=t.texturesToCreateFromBufferView.dequeue(),i=e.gltfInternal,o=i.bufferViews[n.bufferView],r=i.textures[n.id].source,s=Ci.getFailedLoadFunction(e,"image",`id: ${n.id}, bufferView: ${n.bufferView}`);if(n.mimeType==="image/ktx2"){let a=new Uint8Array(t.getBuffer(o));Ns(a).then(KVe(e,n.id,r)).catch(s),++e._loadResources.pendingTextureLoads}else{let a=xRt(t,n);cb({uint8Array:t.getBuffer(o),format:n.mimeType,flipY:!1,skipColorSpaceConversion:!0}).then(a).catch(s),++t.pendingBufferViewToImage}}}function SRt(e){let t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;let n=e._rendererResources.samplers;Ge.sampler(e.gltfInternal,function(i,o){n[o]=new Qt({wrapS:i.wrapS,wrapT:i.wrapT,minificationFilter:i.minFilter,magnificationFilter:i.magFilter})})}}var b$=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};b$.prototype.set=function(e,t,n){this.gltfTexture=e,this.model=t,this.context=n};b$.prototype.execute=function(){qVe(this.gltfTexture,this.model,this.context)};function qVe(e,t,n){let o=t.gltfInternal.textures[e.id],s=t._rendererResources.samplers[o.sampler];l(s)||(s=new Qt({wrapS:ln.REPEAT,wrapT:ln.REPEAT}));let a=!1,c=t.gltfInternal.materials,u=c.length;for(let L=0;L<u;++L){let R=c[L];if(l(R.extensions)&&l(R.extensions.KHR_techniques_webgl)){let G=R.extensions.KHR_techniques_webgl.values;for(let W in G)if(G.hasOwnProperty(W)&&W.indexOf("Texture")!==-1){let w=G[W];if(w.index===e.id&&l(w.extensions)&&l(w.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}let d=s.wrapS,m=s.wrapT,p=s.minificationFilter;a&&p!==Ft.LINEAR&&p!==Ft.NEAREST&&(p===Ft.NEAREST_MIPMAP_NEAREST||p===Ft.NEAREST_MIPMAP_LINEAR?p=Ft.NEAREST:p=Ft.LINEAR,s=new Qt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:p,magnificationFilter:s.magnificationFilter}));let b=e.internalFormat,h=!(l(b)&&nt.isCompressedFormat(b))&&(p===Ft.NEAREST_MIPMAP_NEAREST||p===Ft.NEAREST_MIPMAP_LINEAR||p===Ft.LINEAR_MIPMAP_NEAREST||p===Ft.LINEAR_MIPMAP_LINEAR),x=h||d===ln.REPEAT||d===ln.MIRRORED_REPEAT||m===ln.REPEAT||m===ln.MIRRORED_REPEAT,_,C,V=e.image;if(l(b)){_=!X.isPowerOfTwo(e.width)||!X.isPowerOfTwo(e.height),!n.webgl2&&nt.isCompressedFormat(b)&&_&&x&&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. See the Model.js constructor documentation for more information.");let L=s.minificationFilter;!l(e.mipLevels)&&(p===Ft.NEAREST_MIPMAP_NEAREST||p===Ft.NEAREST_MIPMAP_LINEAR)?L=Ft.NEAREST:!l(e.mipLevels)&&(p===Ft.LINEAR_MIPMAP_NEAREST||p===Ft.LINEAR_MIPMAP_LINEAR)&&(L=Ft.LINEAR),s=new Qt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:L,magnificationFilter:s.magnificationFilter}),C=new bt({context:n,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:b,sampler:s})}else if(l(V)){if(_=!X.isPowerOfTwo(V.width)||!X.isPowerOfTwo(V.height),x&&_){let L=document.createElement("canvas");L.width=X.nextPowerOfTwo(V.width),L.height=X.nextPowerOfTwo(V.height),L.getContext("2d").drawImage(V,0,0,V.width,V.height,0,0,L.width,L.height),V=L}C=new bt({context:n,source:V,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1,skipColorSpaceConversion:!0}),h&&C.generateMipmap()}l(C)&&(t._rendererResources.textures[e.id]=C,t._texturesByteLength+=C.sizeInBytes)}var FVe=new b$;function TRt(e,t){let n=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(FVe.set(i.peek(),e,n),!!t.jobScheduler.execute(FVe,C9.TEXTURE));)i.dequeue();else for(;i.length>0;)qVe(i.dequeue(),e,n)}function CRt(e,t){let n=e._sourceTechniques,i={},o,r,s=e._runtime.materialsById[t.material];if(!l(s))return i;let a=n[s._technique];if(!l(a))return i;let c=a.attributes,d=e._rendererResources.programs[a.program]._attributeLocations;for(o in d)if(d.hasOwnProperty(o)){let p=c[o];l(p)&&(r=d[o],i[p.semantic]=r)}let m=e._precreatedAttributes;if(l(m))for(o in m)m.hasOwnProperty(o)&&(r=d[o],i[o]=r);return i}function VRt(e,t){let n=e.gltfInternal,i=n.skins,o=n.nodes,r=e._runtime.nodes,s=e._loadResources.skinnedNodesIds,a=s.length;for(let c=0;c<a;++c){let u=s[c],d=r[u],m=o[u],p=t[m.skin];d.inverseBindMatrices=p.inverseBindMatrices,d.bindShapeMatrix=p.bindShapeMatrix;let b=i[m.skin].joints,h=b.length;for(let x=0;x<h;++x){let _=b[x],C=r[_];d.joints.push(C)}}}function LRt(e){let t=e._loadResources;if(t.pendingBufferLoads!==0||!t.createSkins)return;t.createSkins=!1;let n=e.gltfInternal,i=n.accessors,o={};Ge.skin(n,function(r,s){let a=i[r.inverseBindMatrices],c;v.equals(r.bindShapeMatrix,v.IDENTITY)||(c=v.clone(r.bindShapeMatrix)),o[s]={inverseBindMatrices:V9.getSkinInverseBindMatrices(e,a),bindShapeMatrix:c}}),VRt(e,o)}function ZRt(e,t,n,i){return function(o){l(i)&&(o=e.clampAnimations?i.clampTime(o):i.wrapTime(o),t[n]=i.evaluate(o,t[n]),t.dirtyNumber=e._maxDirtyNumber)}}function RRt(e){let t=e._loadResources;if(!t.finishedPendingBufferLoads()||!t.createRuntimeAnimations)return;t.createRuntimeAnimations=!1,e._runtime.animations=[];let n=e._runtime.nodes,i=e.gltfInternal.accessors;Ge.animation(e.gltfInternal,function(o,r){let s=o.channels,a=o.samplers,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=s.length,m=new Array(d);for(let p=0;p<d;++p){let b=s[p],h=b.target,x=h.path,_=a[b.sampler],C=V9.getAnimationParameterValues(e,i[_.input]),V=V9.getAnimationParameterValues(e,i[_.output]);c=Math.min(c,C[0]),u=Math.max(u,C[C.length-1]);let L=V9.getAnimationSpline(e,r,o,b.sampler,_,C,x,V);m[p]=ZRt(e,n[h.node],h.path,L)}e._runtime.animations[r]={name:o.name,startTime:c,stopTime:u,channelEvaluators:m}})}function AVe(e,t){let n=e._loadResources;if(!n.finishedBuffersCreation()||!n.finishedProgramCreation()||!n.createVertexArrays)return;n.createVertexArrays=!1;let i=e._rendererResources.buffers,o=e._rendererResources.vertexArrays,r=e.gltfInternal,s=r.accessors;Ge.mesh(r,function(a,c){Ge.meshPrimitive(a,function(u,d){let m=[],p,b=CRt(e,u),h=e._decodedData[`${c}.primitive.${d}`];Ge.meshPrimitiveAttribute(u,function(L,R){if(p=b[R],l(p)){if(l(h)){let w=h.attributes;if(w.hasOwnProperty(R)){let P=w[R];m.push({index:p,vertexBuffer:i[P.bufferView],componentsPerAttribute:P.componentsPerAttribute,componentDatatype:P.componentDatatype,normalize:P.normalized,offsetInBytes:P.byteOffset,strideInBytes:P.byteStride});return}}let G=s[L],W=l(G.normalized)&&G.normalized;m.push({index:p,vertexBuffer:i[G.bufferView],componentsPerAttribute:xu(G.type),componentDatatype:G.componentType,normalize:W,offsetInBytes:G.byteOffset,strideInBytes:xd(r,G)})}});let x,_,C=e._precreatedAttributes;if(l(C))for(_ in C)C.hasOwnProperty(_)&&(p=b[_],l(p)&&(x=C[_],x.index=p,m.push(x)));let V;if(l(u.indices)){let R=s[u.indices].bufferView;l(h)&&(R=h.bufferView),V=i[R]}o[`${c}.primitive.${d}`]=new Jn({context:t,attributes:m,indexBuffer:V})})})}function GRt(e){let t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,Ge.material(e.gltfInternal,function(n,i){ERt(e,n,i)}))}function ERt(e,t,n){let i=e._rendererResources.renderStates,o=[H.FUNC_ADD,H.FUNC_ADD],r=[H.ONE,H.ONE_MINUS_SRC_ALPHA,H.ONE,H.ONE_MINUS_SRC_ALPHA];l(t.extensions)&&l(t.extensions.KHR_blend)&&(o=t.extensions.KHR_blend.blendEquation,r=t.extensions.KHR_blend.blendFactors);let s=!t.doubleSided,a=t.alphaMode==="BLEND";i[n]=Oe.fromCache({cull:{enabled:s},depthTest:{enabled:!0,func:oVe.LESS_OR_EQUAL},depthMask:!a,blending:{enabled:a,equationRgb:o[0],equationAlpha:o[1],functionSourceRgb:r[0],functionDestinationRgb:r[1],functionSourceAlpha:r[2],functionDestinationAlpha:r[3]}})}var WRt={MODEL:function(e,t,n){return function(){return n.computedMatrix}},VIEW:function(e,t,n){return function(){return e.view}},PROJECTION:function(e,t,n){return function(){return e.projection}},MODELVIEW:function(e,t,n){let i=new v;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,n){let i=new v;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i),v.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,n){let i=new v;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i),v.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,n){let i=new v;return function(){return v.inverse(n.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,n){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,n){let i=new v,o=new v;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i),v.inverse(i,o)}},MODELVIEWPROJECTIONINVERSE:function(e,t,n){let i=new v,o=new v;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i),v.multiply(e._projection,i,i),v.inverse(i,o)}},MODELINVERSETRANSPOSE:function(e,t,n){let i=new v,o=new $;return function(){return v.inverse(n.computedMatrix,i),v.getMatrix3(i,o),$.transpose(o,o)}},MODELVIEWINVERSETRANSPOSE:function(e,t,n){let i=new v,o=new v,r=new $;return function(){return v.multiplyTransformation(e.view,n.computedMatrix,i),v.inverse(i,o),v.getMatrix3(o,r),$.transpose(r,r)}},VIEWPORT:function(e,t,n){return function(){return e.viewportCartesian4}}};function IRt(e,t,n,i){let o=t._runtime.nodes[e];return WRt[n](i,t,o)}function XRt(e,t,n,i,o,r,s){let a={},c={},u,d;return Ge.techniqueUniform(n,function(m,p){let b;if(l(i)&&l(i[p]))b=Ci.createUniformFunction(m.type,i[p],r,s),a[p]=b.func,c[p]=b;else if(l(m.node))a[p]=IRt(m.node,e,m.semantic,o.uniformState);else if(l(m.semantic))if(m.semantic==="JOINTMATRIX")u=p;else if(m.semantic==="MORPHWEIGHTS")d=p;else if(m.semantic==="ALPHACUTOFF"){let h=t.alphaMode;if(l(h)&&h==="MASK"){let x=y(t.alphaCutoff,.5);b=Ci.createUniformFunction(m.type,x,r,s),a[p]=b.func,c[p]=b}}else a[p]=Ci.getGltfSemanticUniforms()[m.semantic](o.uniformState,e);else if(l(m.value)){let h=Ci.createUniformFunction(m.type,m.value,r,s);a[p]=h.func,c[p]=h}}),{map:a,values:c,jointMatrixUniformName:u,morphWeightsUniformName:d}}function PRt(e,t){let n=e._loadResources;if(!n.finishedProgramCreation()||!n.createUniformMaps)return;n.createUniformMaps=!1;let i=e.gltfInternal,o=e._sourceTechniques,r=e._uniformMaps,s=e._rendererResources.textures,a=e._defaultTexture;Ge.material(i,function(c,u){let d=e._runtime.materialsById[u],m=o[d._technique],p=d._values,b=XRt(e,c,m,p,t,s,a),h=r[u];if(h.uniformMap=b.map,h.values=b.values,h.jointMatrixUniformName=b.jointMatrixUniformName,h.morphWeightsUniformName=b.morphWeightsUniformName,l(m.attributes.a_outlineCoordinates)){let x=Jq.createTexture(e,t);h.uniformMap.u_outlineTexture=function(){return x}}})}function vRt(e){return Ci.createUniformsForDracoQuantizedAttributes(e.attributes)}function wRt(e,t){let n=h$(e,t),i=e._quantizedUniforms[n];return Ci.createUniformsForQuantizedAttributes(e.gltfInternal,t,i)}function FRt(e){return function(){return e}}function ARt(e){return function(){return e.computedJointMatrices}}function MRt(e){return function(){return e.weights}}function NRt(e){return function(){return e.silhouetteColor}}function URt(e){return function(){return e.silhouetteSize}}function kRt(e){return function(){return e.color}}function DRt(e){return function(){return e._clippingPlanesMatrix}}function BRt(e){return function(){return e._iblReferenceFrameMatrix}}function ORt(e){return function(){let t=e.clippingPlanes;return!l(t)||!t.enabled?e._defaultTexture:t.texture}}function YRt(e){return function(){let t=e.clippingPlanes;if(!l(t))return Y.WHITE.withAlpha(0);let n=Y.clone(t.edgeColor);return n.alpha=t.edgeWidth,n}}function KRt(e){return function(){return f3.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function zRt(e){return function(){return e._imageBasedLighting.imageBasedLightingFactor}}function HRt(e){return function(){return e._lightColor}}function JRt(e){return function(){return e._imageBasedLighting.luminanceAtZenith}}function QRt(e){return function(){return e._imageBasedLighting.sphericalHarmonicCoefficients}}function jRt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture}}function qRt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions}}function $Rt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel}}function eGt(e,t){switch(e.mode){case Ae.TRIANGLES:return t/3;case Ae.TRIANGLE_STRIP:case Ae.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function tGt(e,t,n,i,o){let r=e._nodeCommands,s=e._pickIds,a=e.allowPicking,c=e._runtime.meshesByName,u=e._rendererResources,d=u.vertexArrays,m=u.programs,p=u.renderStates,b=e._uniformMaps,h=e.gltfInternal,x=h.accessors,_=h.meshes,C=t.mesh,V=_[C],L=V.primitives,R=L.length;for(let G=0;G<R;++G){let W=L[G],w=x[W.indices],F=e._runtime.materialsById[W.material]._program,M=e._decodedData[`${C}.primitive.${G}`],g,Z=W.attributes.POSITION;if(l(Z)){let xe=Ci.getAccessorMinMax(h,Z);g=ae.fromCornerPoints(f.fromArray(xe.min),f.fromArray(xe.max))}let E=d[`${C}.primitive.${G}`],I,A;l(M)?(A=M.numberOfIndices,I=0):l(w)?(A=w.count,I=w.byteOffset/ke.getSizeInBytes(w.componentType)):(A=x[W.attributes.POSITION].count,I=0),e._trianglesLength+=eGt(W,A),W.mode===Ae.POINTS&&(e._pointsLength+=A);let N=b[W.material],D=N.uniformMap;if(l(N.jointMatrixUniformName)){let xe={};xe[N.jointMatrixUniformName]=ARt(n),D=ft(D,xe)}if(l(N.morphWeightsUniformName)){let xe={};xe[N.morphWeightsUniformName]=MRt(n),D=ft(D,xe)}D=ft(D,{gltf_color:kRt(e),gltf_colorBlend:KRt(e),gltf_clippingPlanes:ORt(e),gltf_clippingPlanesEdgeStyle:YRt(e),gltf_clippingPlanesMatrix:DRt(e),gltf_iblReferenceFrameMatrix:BRt(e),gltf_iblFactor:zRt(e),gltf_lightColor:HRt(e),gltf_sphericalHarmonicCoefficients:QRt(e),gltf_specularMap:jRt(e),gltf_specularMapSize:qRt(e),gltf_maxSpecularLOD:$Rt(e),gltf_luminanceAtZenith:JRt(e)}),e$.addUniforms(e,D),l(e._uniformMapLoaded)&&(D=e._uniformMapLoaded(D,F,n));let k={};e.extensionsUsed.WEB3D_quantized_attributes?k=wRt(e,W):e._dequantizeInShader&&l(M)&&(k=vRt(M)),D=ft(D,k);let O=p[W.material],U=O.blending.enabled,j=e._pickObject;l(j)||(j={primitive:e,id:e.id,node:n.publicNode,mesh:c[V.name]});let K=Cp.castShadows(e._shadows),te=Cp.receiveShadows(e._shadows),z;if(a&&!l(e._uniformMapLoaded)){z=i.createPickId(j),s.push(z);let xe={czm_pickColor:FRt(z.color)};D=ft(D,xe)}a&&(l(e._pickIdLoaded)&&l(e._uniformMapLoaded)?z=e._pickIdLoaded():z="czm_pickColor");let q=new He({boundingVolume:new ae,cull:e.cull,modelMatrix:new v,primitiveType:W.mode,vertexArray:E,count:A,offset:I,shaderProgram:m[F],castShadows:K,receiveShadows:te,uniformMap:D,renderState:O,owner:j,pass:U?Ze.TRANSLUCENT:e.opaquePass,pickId:z}),ee;o||(ee=He.shallowClone(q),ee.boundingVolume=new ae,ee.modelMatrix=new v);let pe={show:!0,boundingSphere:g,command:q,command2D:ee,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:F};n.commands.push(pe),r.push(pe)}}function nGt(e,t,n){let i=e._loadResources;if(!i.finishedEverythingButTextureCreation()||!i.createRuntimeNodes)return;i.createRuntimeNodes=!1;let o=[],r=e._runtime.nodes,s=e.gltfInternal,a=s.nodes,u=s.scenes[s.scene].nodes,d=u.length,m=[],p={};for(let b=0;b<d;++b)for(m.push({parentRuntimeNode:void 0,gltfNode:a[u[b]],id:u[b]});m.length>0;){let h=m.pop();p[h.id]=!0;let x=h.parentRuntimeNode,_=h.gltfNode,C=r[h.id];if(C.parents.length===0)if(l(_.matrix))C.matrix=v.fromColumnMajorArray(_.matrix);else{let L=_.rotation;C.translation=f.fromArray(_.translation),C.rotation=Pe.unpack(L),C.scale=f.fromArray(_.scale)}l(x)?(x.children.push(C),C.parents.push(x)):o.push(C),l(_.mesh)&&tGt(e,_,C,t,n);let V=_.children;if(l(V)){let L=V.length;for(let R=0;R<L;R++){let G=V[R];p[G]||m.push({parentRuntimeNode:C,gltfNode:a[G],id:V[R]})}}}e._runtime.rootNodes=o,e._runtime.nodes=r}function iGt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function oGt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function MVe(e,t){let n=t.context,i=t.scene3DOnly,o=e._quantizedVertexShaders,r=e._sourceTechniques,s=e._sourcePrograms,a=e._rendererResources,c=a.sourceShaders;e._loadRendererResourcesFromCache&&(c=a.sourceShaders=e._cachedRendererResources.sourceShaders);for(let u in r)if(r.hasOwnProperty(u)){let d=r[u].program,m=s[d],p=c[m.vertexShader];if(Ci.checkSupportedGlExtensions(m.glExtensions,n),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){let b=o[d];l(b)||(b=JVe(p,d,e),o[d]=b),p=b}p=E9(p,d,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){let u=e._cachedRendererResources;a.buffers=u.buffers,a.vertexArrays=u.vertexArrays,a.programs=u.programs,a.silhouettePrograms=u.silhouettePrograms,a.textures=u.textures,a.samplers=u.samplers,a.renderStates=u.renderStates,l(e._precreatedAttributes)&&AVe(e,n),e._cachedGeometryByteLength+=iGt(u.buffers),e._cachedTexturesByteLength+=oGt(u.textures)}else pRt(e,t),yRt(e,t),SRt(e,n),_Rt(e),TRt(e,t);LRt(e),RRt(e),e._loadRendererResourcesFromCache||(AVe(e,n),GRt(e)),PRt(e,n),nGt(e,n,i)}function NVe(e,t){let n=e.publicNode,i=n.matrix;n.useMatrix&&l(i)?v.clone(i,t):l(e.matrix)?v.clone(e.matrix,t):(v.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),n.setMatrix(t))}var $Ve=[],rGt=new re,o$=new v;function sGt(e,t,n,i){let o=e._maxDirtyNumber,r=e._runtime.rootNodes,s=r.length,a=$Ve,c=e._computedModelMatrix;if(e._mode!==Em.SCENE3D&&!e._ignoreCommands){let u=v.getColumn(c,3,rGt);if(!re.equals(u,re.UNIT_W))c=Vt.basisTo2D(i,c,o$),e._rtcCenter=e._rtcCenter3D;else{let d=e.boundingSphereInternal.center,m=Vt.wgs84To2DModelMatrix(i,d,o$);c=v.multiply(m,c,o$),l(e._rtcCenter)&&(v.setTranslation(c,re.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)}}for(let u=0;u<s;++u){let d=r[u];for(NVe(d,d.transformToRoot),a.push(d);a.length>0;){d=a.pop();let m=d.transformToRoot,p=d.commands;if(d.dirtyNumber===o||t||n){let h=v.multiplyTransformation(c,m,d.computedMatrix),x=p.length;if(x>0)for(let _=0;_<x;++_){let C=p[_],V=C.command;v.clone(h,V.modelMatrix),ae.transform(C.boundingSphere,V.modelMatrix,V.boundingVolume),l(e._rtcCenter)&&f.add(e._rtcCenter,V.boundingVolume.center,V.boundingVolume.center),V=C.command2D,l(V)&&e._mode===Em.SCENE2D&&(v.clone(h,V.modelMatrix),V.modelMatrix[13]-=X.sign(V.modelMatrix[13])*2*X.PI*i.ellipsoid.maximumRadius,ae.transform(C.boundingSphere,V.modelMatrix,V.boundingVolume))}}let b=d.children;if(l(b)){let h=b.length;for(let x=0;x<h;++x){let _=b[x];_.dirtyNumber=Math.max(_.dirtyNumber,d.dirtyNumber),(_.dirtyNumber===o||n)&&(NVe(_,_.transformToRoot),v.multiplyTransformation(m,_.transformToRoot,_.transformToRoot)),a.push(_)}}}}++e._maxDirtyNumber}var r$=new v;function aGt(e){let t=e._runtime.skinnedNodes,n=t.length;for(let i=0;i<n;++i){let o=t[i];r$=v.inverseTransformation(o.transformToRoot,r$);let r=o.computedJointMatrices,s=o.joints,a=o.bindShapeMatrix,c=o.inverseBindMatrices,u=c.length;for(let d=0;d<u;++d)l(r[d])||(r[d]=new v),r[d]=v.multiplyTransformation(r$,s[d].transformToRoot,r[d]),r[d]=v.multiplyTransformation(r[d],c[d],r[d]),l(a)&&(r[d]=v.multiplyTransformation(r[d],a,r[d]))}}function cGt(e){let t=e._runtime.rootNodes,n=t.length,i=$Ve;for(let o=0;o<n;++o){let r=t[o];for(r.computedShow=r.publicNode.show,i.push(r);i.length>0;){r=i.pop();let s=r.computedShow,a=r.commands,c=a.length;for(let d=0;d<c;++d)a[d].show=s;let u=r.children;if(l(u)){let d=u.length;for(let m=0;m<d;++m){let p=u[m];p.computedShow=s&&p.publicNode.show,i.push(p)}}}}}function lGt(e,t){let n=e.id;if(e._id!==n){e._id=n;let i=e._pickIds,o=i.length;for(let r=0;r<o;++r)i[r].object.id=n}}function uGt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;let t=e.debugWireframe?Ae.LINES:Ae.TRIANGLES,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.primitiveType=t}}function dGt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let t=e.debugShowBoundingVolume,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.debugShowBoundingVolume=t}}function mGt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;let t=Cp.castShadows(e.shadows),n=Cp.receiveShadows(e.shadows),i=e._nodeCommands,o=i.length;for(let r=0;r<o;r++){let s=i[r];s.command.castShadows=t,s.command.receiveShadows=n}}}function fGt(e,t){let n=Ue(t,!0);return n.cull.enabled=!1,n.depthTest.enabled=!0,n.depthMask=!1,n.blending=Nq.ALPHA_BLEND,e.opaquePass===Ze.CESIUM_3D_TILE&&(n.stencilTest=n$.setCesium3DTileBit(),n.stencilMask=n$.CESIUM_3D_TILE_MASK),Oe.fromCache(n)}function UVe(e,t){let n=He.shallowClone(t);return n.pass=Ze.TRANSLUCENT,n.renderState=fGt(e,t.renderState),n}function eLe(e,t,n){let i=t.scene3DOnly,o=e.color.alpha;if(o>0&&o<1){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].translucentCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.translucentCommand=UVe(e,u),!i){let d=c.command2D;c.translucentCommand2D=UVe(e,d)}}}}function hGt(e){let t=Ue(e,!0);return t.cull.enabled=!1,Oe.fromCache(t)}function kVe(e){let t=He.shallowClone(e);return t.renderState=hGt(e.renderState),t}function tLe(e,t,n){let i=t.scene3DOnly;if(!e.backFaceCulling){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].disableCullingCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.disableCullingCommand=kVe(u),!i){let d=c.command2D;c.disableCullingCommand2D=kVe(d)}}}}function pGt(e,t){let n=e._rendererResources.programs;for(let i in n)if(n.hasOwnProperty(i)&&n[i]===t)return i}function bGt(e,t,n){let i=t.vertexShaderSource.sources[0],o=t._attributeLocations,r=e._normalAttributeName;return i=De.replaceMain(i,"gltf_silhouette_main"),i+=`uniform float gltf_silhouetteSize; -void main() -{ - gltf_silhouette_main(); - vec3 n = normalize(czm_normal3D * ${r}); - n.x *= czm_projection[0][0]; - n.y *= czm_projection[1][1]; - vec4 clip = gl_Position; - clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; - gl_Position = clip; -}`,qt.fromCache({context:n.context,vertexShaderSource:i,fragmentShaderSource:`uniform vec4 gltf_silhouetteColor; -void main() -{ - gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor); -}`,attributeLocations:o})}function nLe(e,t){return OVe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&l(e._normalAttributeName)}function gGt(e){let t=e._nodeCommands,n=t.length;for(let i=0;i<n;++i)if(t[i].command.pass===Ze.TRANSLUCENT)return!0;return!1}function a$(e){return e.color.alpha>0&&e.color.alpha<1}function iLe(e){return e.color.alpha===0}function DVe(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var yGt=0;function xGt(e,t){let n=++yGt%255,i=gGt(e)||a$(e)||e.silhouetteColor.alpha<1,o=e._rendererResources.silhouettePrograms,r=t.scene3DOnly,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c],d=u.command,m=a$(e)?u.translucentCommand:d,p=He.shallowClone(m),b=Ue(m.renderState);b.stencilTest={enabled:!0,frontFunction:H.ALWAYS,backFunction:H.ALWAYS,reference:n,mask:-1,frontOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.REPLACE},backOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.REPLACE}},iLe(e)&&(b.colorMask={red:!1,green:!1,blue:!1,alpha:!1},b.depthMask=!1),b=Oe.fromCache(b),p.renderState=b,u.silhouetteModelCommand=p;let h=He.shallowClone(d);b=Ue(d.renderState,!0),b.depthTest.enabled=!0,b.cull.enabled=!1,i&&(h.pass=Ze.TRANSLUCENT,b.depthMask=!1,b.blending=Nq.ALPHA_BLEND),b.stencilTest={enabled:!0,frontFunction:H.NOTEQUAL,backFunction:H.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.KEEP},backOperation:{fail:H.KEEP,zFail:H.KEEP,zPass:H.KEEP}},b=Oe.fromCache(b);let x=d.shaderProgram,_=pGt(e,x),C=o[_];l(C)||(C=bGt(e,x,t),o[_]=C);let V=ft(d.uniformMap,{gltf_silhouetteColor:NRt(e),gltf_silhouetteSize:URt(e)});if(h.renderState=b,h.shaderProgram=C,h.uniformMap=V,h.castShadows=!1,h.receiveShadows=!1,u.silhouetteColorCommand=h,!r){let L=u.command2D,R=He.shallowClone(p);R.boundingVolume=L.boundingVolume,R.modelMatrix=L.modelMatrix,u.silhouetteModelCommand2D=R;let G=He.shallowClone(h);R.boundingVolume=L.boundingVolume,R.modelMatrix=L.modelMatrix,u.silhouetteColorCommand2D=G}}}function _Gt(e,t,n){return e=De.replaceMain(e,"gltf_clip_main"),e+=`${Xa._getClippingFunction(t,n)} -`,e+=`uniform highp sampler2D gltf_clippingPlanes; -uniform mat4 gltf_clippingPlanesMatrix; -uniform vec4 gltf_clippingPlanesEdgeStyle; -void main() -{ - gltf_clip_main(); -${aVe("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")}} -`,e}function oLe(e,t,n){if(!nLe(e,t))return;let i=e._nodeCommands,o=i.length>0&&(DVe(e.color.alpha,e._colorPreviousAlpha)||DVe(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!l(i[0].silhouetteModelCommand));e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(o||n)&&xGt(e,t)}function SGt(e,t){let n=e._clippingPlanes;l(n)&&n.owner===e&&n.enabled&&n.update(t)}var s$=new ae;function TGt(e,t,n){return s$.center=e,s$.radius=t,n.camera.getPixelSize(s$,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Ia=new f,Z9=new fe;function CGt(e,t){let n=e.scale;if(e.minimumPixelSize!==0){let i=t.context,o=Math.max(i.drawingBufferWidth,i.drawingBufferHeight),r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Ia.x=r[12],Ia.y=r[13],Ia.z=r[14],l(e._rtcCenter)&&f.add(e._rtcCenter,Ia,Ia),e._mode!==Em.SCENE3D){let d=t.mapProjection,m=d.ellipsoid.cartesianToCartographic(Ia,Z9);d.project(m,Ia),f.fromElements(Ia.z,Ia.x,Ia.y,Ia)}let s=e.boundingSphereInternal.radius,a=TGt(Ia,s,t),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(n=e.minimumPixelSize*a/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,n):n}function rLe(e){l(e._cacheKey)&&l(e._cachedGltf)&&--e._cachedGltf.count===0&&delete fx[e._cacheKey],e._cachedGltf=void 0}function c$(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function mx(e){for(let t in e)e.hasOwnProperty(t)&&e[t].destroy()}function VGt(e){mx(e.buffers),mx(e.vertexArrays),mx(e.programs),mx(e.silhouettePrograms),mx(e.textures)}c$.prototype.release=function(){if(--this.count===0)return l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],VGt(this),de(this)};function BVe(e,t,n){return function(i){if(e.heightReference===CZ.RELATIVE_TO_GROUND){let r=t.cartesianToCartographic(i,Z9);r.height+=n.height,t.cartographicToCartesian(r,i)}let o=e._clampedModelMatrix;v.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function LGt(e){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===CZ.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,o=e.modelMatrix;Ia.x=o[12],Ia.y=o[13],Ia.z=o[14];let r=i.cartesianToCartographic(Ia);l(e._clampedModelMatrix)||(e._clampedModelMatrix=v.clone(o,new v));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(r,BVe(e,i,r));let a=n.getHeight(r);if(l(a)){let c=BVe(e,i,r);fe.clone(r,Z9),Z9.height=a,i.cartographicToCartesian(Z9,Ia),c(Ia)}}var ZGt=new f,RGt=new fe;function GGt(e,t){let n,i=e.distanceDisplayCondition,o=i.near*i.near,r=i.far*i.far;if(t.mode===Em.SCENE2D)n=(t.camera.frustum.right-t.camera.frustum.left)*.5,n=n*n;else{let s=v.getTranslation(e.modelMatrix,ZGt);if(t.mode===Em.COLUMBUS_VIEW){let a=t.mapProjection,u=a.ellipsoid.cartesianToCartographic(s,RGt);s=a.project(u,s),f.fromElements(s.z,s.x,s.y,s)}n=f.distanceSquared(s,t.camera.positionWC)}return n>=o&&n<=r}var EGt=new v,WGt=new $,IGt=new v;Xa.prototype.update=function(e){if(e.mode===Em.MORPHING)return;if(!At.supportsWebP.initialized){At.supportsWebP.initialize();return}let t=e.context;this._defaultTexture=t.defaultTexture;let n=At.supportsWebP();if(this._state===dx.NEEDS_LOAD&&l(this.gltfInternal)){let C,V=this.cacheKey;if(l(V)){t.cache.modelRendererResourceCache=y(t.cache.modelRendererResourceCache,{});let L=t.cache.modelRendererResourceCache;if(C=L[this.cacheKey],l(C)){if(!C.ready)return;++C.count,this._loadRendererResourcesFromCache=!0}else C=new c$(t,V),C.count=1,L[this.cacheKey]=C;this._cachedRendererResources=C}else C=new c$(t),C.count=1,this._cachedRendererResources=C;if(this._state=dx.LOADING,this._state!==dx.FAILED){let L=this.gltfInternal.extensions;if(l(L)&&l(L.CESIUM_RTC)){let R=f.fromArray(L.CESIUM_RTC.center);if(!f.equals(R,f.ZERO)){this._rtcCenter3D=R;let G=e.mapProjection,w=G.ellipsoid.cartesianToCartographic(this._rtcCenter3D),P=G.project(w);f.fromElements(P.z,P.x,P.y,P),this._rtcCenter2D=P,this._rtcCenterEye=new f,this._rtcCenter=this._rtcCenter3D}}_9(this.gltfInternal),this._loadResources=new _Ve,this._loadRendererResourcesFromCache||Ci.parseBuffers(this,tRt)}}let i=this._loadResources,o=this._incrementallyLoadTextures,r=!1;if(this._state===dx.LOADING){if(i.pendingBufferLoads===0){if(!i.initialized){if(e.brdfLutGenerator.update(e),Ci.checkSupportedExtensions(this.extensionsRequired,n),Ci.updateForwardAxis(this),!l(this.gltfInternal.extras.sourceVersion)){let C=this.gltfInternal,V=Ci.getAssetVersion(C),L=l(Ci.getUsedExtensions(C).KHR_techniques_webgl);V!=="2.0"&&po("gltf-1.0","glTF 1.0 assets were deprecated in CesiumJS 1.94. They will be removed in 1.97. Please convert any glTF 1.0 assets to glTF 2.0."),L&&po("KHR_techniques_webgl","Support for glTF 1.0 techniques and the KHR_techniques_webgl glTF extension were deprecated in CesiumJS 1.94. It will be removed in 1.97. If custom GLSL shaders are needed, use CustomShader instead."),C.extras.sourceVersion=V,C.extras.sourceKHRTechniquesWebGL=L,this._sourceVersion=V,this._sourceKHRTechniquesWebGL=L,H1e(C),W1e(C);let R={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};WVe(C,R),IVe(C,R)}this._sourceVersion=this.gltfInternal.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltfInternal.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&TZ.hasExtension(this),eRt(this),aRt(this),iRt(this),this._loadRendererResourcesFromCache||(nRt(this),rRt(this),sRt(this),lRt(this,t,n)),mRt(this),fRt(this),dRt(this),hRt(this),TZ.parse(this,t),i.initialized=!0}i.finishedDecoding()||TZ.decodeModel(this,t).catch(Ci.getFailedLoadFunction(this,"model",this.basePathInternal)),i.finishedDecoding()&&!i.resourcesParsed&&(this._boundingSphere=Ci.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,TZ.cacheDataForModel(this),i.resourcesParsed=!0),i.resourcesParsed&&i.pendingShaderLoads===0&&(this.showOutline&&Jq.outlinePrimitives(this),MVe(this,e))}(i.finished()||o&&i.finishedEverythingButTextureCreation())&&(this._state=dx.LOADED,r=!0)}if(l(i)&&this._state===dx.LOADED&&(o&&!r&&MVe(this,e),i.finished())){this._loadResources=void 0;let C=this._rendererResources,V=this._cachedRendererResources;V.buffers=C.buffers,V.vertexArrays=C.vertexArrays,V.programs=C.programs,V.sourceShaders=C.sourceShaders,V.silhouettePrograms=C.silhouettePrograms,V.textures=C.textures,V.samplers=C.samplers,V.renderStates=C.renderStates,V.ready=!0,this._normalAttributeName=Ci.getAttributeOrUniformBySemantic(this.gltfInternal,"NORMAL"),l(this._precreatedAttributes)&&(V.vertexArrays={}),this.releaseGltfJson&&rLe(this)}let s=nLe(this,e),a=a$(this),c=iLe(this),u=this.backFaceCulling,d=l(this.distanceDisplayCondition)?GGt(this,e):!0,m=this.show&&d&&this.scale!==0&&(!c||s);if(this._imageBasedLighting.update(e),m&&this._state===dx.LOADED||r){let C=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;let V=this.modelMatrix,L=e.mode!==this._mode;this._mode=e.mode;let R=!v.equals(this._modelMatrix,V)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||this.minimumPixelSize!==0||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||L;if(R||r){v.clone(V,this._modelMatrix),LGt(this),l(this._clampedModelMatrix)&&(V=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;let M=CGt(this,e),g=this._computedModelMatrix;v.multiplyByUniformScale(V,M,g),this._upAxis===tc.Y?v.multiplyTransformation(g,tc.Y_UP_TO_Z_UP,g):this._upAxis===tc.X&&v.multiplyTransformation(g,tc.X_UP_TO_Z_UP,g),this.forwardAxis===tc.Z&&v.multiplyTransformation(g,tc.Z_UP_TO_X_UP,g)}(C||R||r)&&(sGt(this,R,r,e.mapProjection),this._dirty=!0,(C||r)&&aGt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,cGt(this)),lGt(this,t),uGt(this),dGt(this),mGt(this),SGt(this,e);let G=this._clippingPlanes,W=0,w=y(this.referenceMatrix,V);if(this._imageBasedLighting.useSphericalHarmonicCoefficients||this._imageBasedLighting.useSpecularEnvironmentMaps){let M=WGt,g=EGt;g=v.multiply(t.uniformState.view3D,w,g),M=v.getMatrix3(g,M),M=$.getRotation(M,M),this._iblReferenceFrameMatrix=$.transpose(M,this._iblReferenceFrameMatrix)}if(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLighting.shouldRegenerateShaders,d$(this)){let M=IGt;M=v.multiply(t.uniformState.view3D,w,M),M=v.multiply(M,G.modelMatrix,M),this._clippingPlanesMatrix=v.inverseTranspose(M,this._clippingPlanesMatrix),W=G.clippingPlanesState}this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._clippingPlanesState!==W,this._clippingPlanesState=W;let P=u$(this);P!==this._colorShadingEnabled&&(this._colorShadingEnabled=P,this._shouldRegenerateShaders=!0);let F=this.splitDirection!==sC.NONE;this._splittingEnabled!==F&&(this._splittingEnabled=F,this._shouldRegenerateShaders=!0),this._shouldRegenerateShaders?XGt(this,e):(eLe(this,e,!1),tLe(this,e,!1),oLe(this,e,!1))}if(r){let C=this;e.afterRender.push(function(){C._ready=!0,C._readyPromise.resolve(C)});return}if(m&&!this._ignoreCommands){let C=e.commandList,V=e.passes,L=this._nodeCommands,R=L.length,G,W,w=e.mapProjection.ellipsoid.maximumRadius*X.PI,P;if(V.render||V.pick&&this.allowPicking){for(G=0;G<R;++G)if(W=L[G],W.show){let F=W.command;s?F=W.silhouetteModelCommand:a?F=W.translucentCommand:u||(F=W.disableCullingCommand),C.push(F),P=W.command.boundingVolume;let M=P.center.y-P.radius,g=P.center.y+P.radius,Z=M<w&&g>w||M<-w&&g>-w;if(e.mode===Em.SCENE2D&&Z){let E=W.command2D;s?E=W.silhouetteModelCommand2D:a?E=W.translucentCommand2D:u||(E=W.disableCullingCommand2D),C.push(E)}}if(s&&!V.pick){for(G=0;G<R;++G)if(W=L[G],W.show){C.push(W.silhouetteColorCommand),P=W.command.boundingVolume;let F=P.center.y-P.radius,M=P.center.y+P.radius,g=F<w&&M>w||F<-w&&M>-w;e.mode===Em.SCENE2D&&g&&C.push(W.silhouetteColorCommand2D)}}}}let p=this._credit;l(p)&&e.creditDisplay.addCredit(p);let b=this._resourceCredits,h=b.length;for(let C=0;C<h;C++)e.creditDisplay.addCredit(b[C]);let x=this._gltfCredits,_=x.length;for(let C=0;C<_;C++)e.creditDisplay.addCredit(x[C])};function sLe(e,t){e.programs!==t.programs&&mx(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&mx(e.silhouettePrograms)}function XGt(e,t){let n=e._rendererResources,i=e._cachedRendererResources;sLe(n,i);let o;if(d$(e)||u$(e)||e.splitDirection!==sC.NONE||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,n.programs={},n.silhouettePrograms={};let c={},u=e._sourceTechniques,d;for(let m in u)u.hasOwnProperty(m)&&(d=u[m],o=d.program,c[o]||(c[o]=!0,gRt({programId:o,techniqueId:m},e,t.context)))}else n.programs=i.programs,n.silhouettePrograms=i.silhouettePrograms;let r=n.programs,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c];o=u.programId;let d=r[o];u.command.shaderProgram=d,l(u.command2D)&&(u.command2D.shaderProgram=d)}eLe(e,t,!0),tLe(e,t,!0),oLe(e,t,!0)}Xa.prototype.isDestroyed=function(){return!1};Xa.prototype.destroy=function(){l(this._precreatedAttributes)&&mx(this._rendererResources.vertexArrays),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),l(this._cachedRendererResources)&&sLe(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),TZ.destroyCachedDataForModel(this);let e=this._pickIds,t=e.length;for(let i=0;i<t;++i)e[i].destroy();rLe(this),this._quantizedVertexShaders=void 0;let n=this._clippingPlanes;return l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,de(this)};Xa._getClippingFunction=cVe;Xa._modifyShaderForColor=bRt;var g$=Xa;var t0o=S(T(),1);function aLe(e,t,n){this.primitive=e,this._modelMatrix=v.clone(t),this._instanceId=n}Object.defineProperties(aLe.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return v.clone(this._modelMatrix)},set:function(e){v.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var cLe=aLe;var cC={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function GZ(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this._instancingSupported=!1,this._dynamic=y(e.dynamic,!1),this._allowPicking=y(e.allowPicking,!0),this._ready=!1,this._readyPromise=ca(),this._state=cC.NEEDS_LOAD,this._dirty=!1,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ze.OPAQUE),this._instances=PGt(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=vGt(this),this._center=f.clone(this._boundingSphere.center),this._rtcTransform=new v,this._rtcModelView=new v,this._mode=void 0,this.modelMatrix=v.clone(v.IDENTITY),this._modelMatrix=v.clone(this.modelMatrix),this._url=We.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=We.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=y(e.shadows,Cp.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.splitDirection=y(e.splitDirection,sC.NONE),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=y(e.debugWireframe,!1),this._debugWireframe=!1,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new n3,this._shouldDestroyImageBasedLighting=!0),this.backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling,this.showCreditsOnScreen=y(e.showCreditsOnScreen,!1)}Object.defineProperties(GZ.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},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)}}});function PGt(e,t){t=y(t,[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let r=t[o],s=r.modelMatrix,a=y(r.batchId,o);i[o]=new cLe(e,s,a)}return i}function vGt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=v.getTranslation(e._instances[i]._modelMatrix,new f);return ae.fromPoints(n)}var wGt=new f,y$=new v;GZ.prototype.expandBoundingSphere=function(e){let t=v.getTranslation(e,wGt);ae.expand(this._boundingSphere,t,this._boundingSphere)};function FGt(e,t,n,i){return function(o,r){let s=o.semantic;if(l(s)&&e.indexOf(s)>-1)if(t.indexOf(s)>-1)i[r]=s;else throw new ue(`Shader program cannot be optimized for instancing. Uniform "${r}" in program "${n}" uses unsupported semantic "${s}"`)}}function uLe(e,t){if(l(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];let n={};e._instancedUniformsByProgram=n;let i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],o=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],r=e._model._sourceTechniques;for(let s in r)if(r.hasOwnProperty(s)){let a=r[s],c=a.program;if(!l(n[c])){let u={};n[c]=u,Ge.techniqueUniform(a,FGt(i,o,t,u))}}return n[t]}function AGt(e){return function(t,n){let i=uLe(e,n),o=l(e._batchTable),r=De.replaceMain(t,"czm_instancing_main"),s="",a="";for(let b in i)if(i.hasOwnProperty(b)){let h=i[b],x;h==="MODELVIEW"||h==="CESIUM_RTC_MODELVIEW"?x="czm_instanced_modelView":h==="MODELVIEWPROJECTION"?(x="czm_instanced_modelViewProjection",s+=`mat4 czm_instanced_modelViewProjection; -`,a+=`czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView; -`):h==="MODELVIEWINVERSETRANSPOSE"&&(x="czm_instanced_modelViewInverseTranspose",s+=`mat3 czm_instanced_modelViewInverseTranspose; -`,a+=`czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView); -`);let _=new RegExp(`uniform.*${b}.*`);r=r.replace(_,""),_=new RegExp(`${b}\\b`,"g"),r=r.replace(_,x)}let c=`uniform mat4 czm_instanced_modifiedModelView; -uniform mat4 czm_instanced_nodeTransform; -`,u,d,m;o?(u=`attribute float a_batchId; -`,d="",m=""):(u="",d=`attribute vec4 pickColor; -varying vec4 v_pickColor; -`,m=` v_pickColor = pickColor; -`);let p=`${c+s}mat4 czm_instanced_modelView; -attribute vec4 czm_modelMatrixRow0; -attribute vec4 czm_modelMatrixRow1; -attribute vec4 czm_modelMatrixRow2; -${u}${d}${r}void main() -{ - mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0); - czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform; -${a} czm_instancing_main(); -${m}} -`;if(o){let b=e._model.gltfInternal,h=Ci.getDiffuseAttributeOrUniform(b,n);p=e._batchTable.getVertexShaderCallback(!0,"a_batchId",h)(p)}return p}}function MGt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=Ci.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`varying vec4 v_pickColor; -${t}`;return t}}function NGt(e,t){return function(){return v.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function UGt(e){return function(){return e.computedMatrix}}function kGt(e,t){return function(n,i,o){n=Ue(n),n.czm_instanced_modifiedModelView=NGt(e,t),n.czm_instanced_nodeTransform=UGt(o);let r=uLe(e,i);for(let s in r)r.hasOwnProperty(s)&&delete n[s];return l(e._batchTable)&&(n=e._batchTable.getUniformMapCallback()(n)),n}}function DGt(e){return function(t,n){if(l(e._batchTable)){let i=e._model.gltfInternal,o=Ci.getDiffuseAttributeOrUniform(i,n);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",o)(t),t=`uniform float a_batchId -;${t}`}return t}}function BGt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=Ci.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`uniform vec4 czm_pickColor; -${t}`;return t}}function OGt(e){return function(t){return l(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function dLe(e){let t=e._instances,n=e.length,i=e._center,o=12,r=e._vertexBufferTypedArray;l(r)||(r=new Float32Array(n*o)),e._dynamic&&(e._vertexBufferTypedArray=r);for(let s=0;s<n;++s){let a=t[s]._modelMatrix,c=v.clone(a,y$);c[12]-=i.x,c[13]-=i.y,c[14]-=i.z;let u=s*o;r[u+0]=c[0],r[u+1]=c[4],r[u+2]=c[8],r[u+3]=c[12],r[u+4]=c[1],r[u+5]=c[5],r[u+6]=c[9],r[u+7]=c[13],r[u+8]=c[2],r[u+9]=c[6],r[u+10]=c[10],r[u+11]=c[14]}return r}function YGt(e,t){let n,i=e._instances,o=e.length,r=e._dynamic,s=l(e._batchTable);if(s){let c=new Uint16Array(o);for(n=0;n<o;++n)c[n]=i[n]._instanceId;e._batchIdBuffer=ut.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW})}if(!s){let c=new Uint8Array(o*4);for(n=0;n<o;++n){let d=e._pickIds[n].color,m=n*4;c[m]=Y.floatToByte(d.red),c[m+1]=Y.floatToByte(d.green),c[m+2]=Y.floatToByte(d.blue),c[m+3]=Y.floatToByte(d.alpha)}e._pickIdBuffer=ut.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW})}let a=dLe(e);e._vertexBuffer=ut.createVertexBuffer({context:t,typedArray:a,usage:r?Me.STREAM_DRAW:Me.STATIC_DRAW})}function KGt(e){let t=dLe(e);e._vertexBuffer.copyFromArrayView(t)}function zGt(e,t){let n=e._instances,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createPickId(n[r]);return o}function HGt(e,t){let n=e._instancingSupported;n||po("cpuModelInstancing","Support for rendering instanced models on the CPU has been deprecated and will be removed in CesiumJS 1.97.");let i=l(e._batchTable),o=e._allowPicking,r={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:o,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLighting:e._imageBasedLighting,showOutline:e.showOutline,showCreditsOnScreen:e.showCreditsOnScreen};if(i||(e._pickIds=zGt(e,t)),n){YGt(e,t);let s=12,a=Q.getSizeInBytes(Q.FLOAT),c={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:a*4,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:a*8,strideInBytes:a*s,instanceDivisor:1}};i&&(c.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),i||(c.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r.precreatedAttributes=c,r.vertexShaderLoaded=AGt(e),r.fragmentShaderLoaded=MGt(e),r.uniformMapLoaded=kGt(e,t),l(e._url)&&(r.cacheKey=`${e._url.getUrlComponent()}#instanced`)}else r.vertexShaderLoaded=DGt(e),r.fragmentShaderLoaded=BGt(e),r.uniformMapLoaded=OGt(e,t);l(e._url)?e._model=g$.fromGltf(r):e._model=new g$(r)}function JGt(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;let n=e.debugWireframe?Ae.LINES:Ae.TRIANGLES,i=e._drawCommands,o=i.length;for(let r=0;r<o;++r)i[r].primitiveType=n}}function QGt(e){let t=Ue(e,!0);return t.cull.enabled=!1,Oe.fromCache(t)}function jGt(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;let n=e._drawCommands,i=n.length,o;if(!l(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(i),e._renderStates=new Array(i),o=0;o<i;++o){let r=n[o].renderState,s=QGt(r);e._disableCullingRenderStates[o]=s,e._renderStates[o]=r}for(o=0;o<i;++o)n[o].renderState=e._backFaceCulling?e._renderStates[o]:e._disableCullingRenderStates[o]}}function qGt(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let n=e._drawCommands,i=n.length;for(let o=0;o<i;++o)n[o].debugShowBoundingVolume=e.debugShowBoundingVolume}}function $Gt(e,t){let n=t.length,i=e.length,o=e._boundingSphere,r=e._cull;for(let s=0;s<n;++s){let a=He.shallowClone(t[s]);a.instanceCount=i,a.boundingVolume=o,a.cull=r,l(e._batchTable)?a.pickId=e._batchTable.getPickId():a.pickId="v_pickColor",e._drawCommands.push(a)}}function eEt(e){return function(){return e}}function tEt(e){return function(){return e}}function nEt(e,t){let n=e._instances,i=t.length,o=e.length,r=e._batchTable,s=l(r),a=e._cull;for(let c=0;c<i;++c)for(let u=0;u<o;++u){let d=He.shallowClone(t[c]);if(d.modelMatrix=new v,d.boundingVolume=new ae,d.cull=a,d.uniformMap=Ue(d.uniformMap),s)d.uniformMap.a_batchId=eEt(n[u]._instanceId);else{let m=e._pickIds[u];d.uniformMap.czm_pickColor=tEt(m.color)}e._drawCommands.push(d)}}function mLe(e){let t=e._modelCommands,n=t.length,i=e.length,o=e._rtcTransform,r=e._center;for(let s=0;s<n;++s){let a=t[s];for(let c=0;c<i;++c){let u=s*i+c,d=e._drawCommands[u],m=v.clone(e._instances[c]._modelMatrix,y$);m[12]-=r.x,m[13]-=r.y,m[14]-=r.z,m=v.multiply(o,m,y$);let p=a.modelMatrix,b=d.modelMatrix;v.multiply(m,p,b);let h=a.boundingVolume,x=d.boundingVolume;ae.transform(h,m,x)}}}function fLe(e){let t=e._nodeCommands,n=t.length,i=[];for(let o=0;o<n;++o){let r=t[o];r.show&&i.push(r.command)}return i}function iEt(e){let t=e._nodeCommands,n=t.length,i=!1;for(let o=0;o<n;o++){let r=t[o];r.command.dirty&&(r.command.dirty=!1,i=!0)}return i}function lLe(e,t){e._drawCommands=[];let n=fLe(e._model);t?$Gt(e,n):(nEt(e,n),mLe(e))}function oEt(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;let n=Cp.castShadows(e.shadows),i=Cp.receiveShadows(e.shadows),o=e._drawCommands,r=o.length;for(let s=0;s<r;++s){let a=o[s];a.castShadows=n,a.receiveShadows=i}}}GZ.prototype.update=function(e){if(e.mode===Em.MORPHING||!this.show||this.length===0)return;let t=e.context;if(this._state===cC.NEEDS_LOAD){this._state=cC.LOADING,this._instancingSupported=t.instancedArrays,HGt(this,t);let p=this;this._model.readyPromise.catch(function(b){p._state=cC.FAILED,p._readyPromise.reject(b)})}let n=this._instancingSupported,i=this._model;if(i.imageBasedLighting=this._imageBasedLighting,i.showCreditsOnScreen=this.showCreditsOnScreen,i.splitDirection=this.splitDirection,i.update(e),i.ready&&this._state===cC.LOADING){this._state=cC.LOADED,this._ready=!0;let p=i.boundingSphereInternal.radius+f.magnitude(i.boundingSphereInternal.center);this._boundingSphere.radius+=p,this._modelCommands=fLe(i),lLe(this,n),this._readyPromise.resolve(this);return}if(this._state!==cC.LOADED)return;let o=e.mode!==this._mode,r=this.modelMatrix,s=!v.equals(this._modelMatrix,r);if(o||s){this._mode=e.mode,v.clone(r,this._modelMatrix);let p=v.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==Em.SCENE3D&&(p=Vt.basisTo2D(e.mapProjection,p,p)),v.getTranslation(p,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,KGt(this));let a=iEt(i);a&&lLe(this,n),!n&&(i.dirty||this._dirty||o||s)&&mLe(this),oEt(this,a),JGt(this,a),jGt(this,a),qGt(this,a);let c=e.passes;if(!c.render&&!c.pick)return;let u=e.commandList,d=this._drawCommands,m=d.length;for(let p=0;p<m;++p)u.push(d[p])};GZ.prototype.isDestroyed=function(){return!1};GZ.prototype.destroy=function(){this._model=this._model&&this._model.destroy();let e=this._pickIds;if(l(e)){let t=e.length;for(let n=0;n<t;++n)e[n].destroy()}return this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,de(this)};var x$=GZ;globalThis.CESIUM_VERSION="1.119";var D5o=S(T(),1);var yFo=S(T(),1);var hFo=S(T(),1);var rFo=S(T(),1),W9;typeof ko<"u"&&(W9=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(g,Z){return g===null||typeof g in x?g===Z:!1}function u(g,Z){var E;return function(){E||(E=h.a.setTimeout(function(){E=e,g()},Z))}}function d(g,Z){var E;return function(){clearTimeout(E),E=h.a.setTimeout(g,Z)}}function m(g,Z){Z&&Z!=="change"?Z==="beforeChange"?this.pc(g):this.gb(g,Z):this.qc(g)}function p(g,Z){Z!==null&&Z.s&&Z.s()}function b(g,Z){var E=this.qd,I=E[R];I.ra||(this.Qb&&this.mb[Z]?(E.uc(Z,g,this.mb[Z]),this.mb[Z]=null,--this.Qb):I.I[Z]||E.uc(Z,g,I.J?{da:g}:E.$c(g)),g.Ja&&g.gd())}var h=typeof s<"u"?s:{};h.b=function(g,Z){for(var E=g.split("."),I=h,A=0;A<E.length-1;A++)I=I[E[A]];I[E[E.length-1]]=Z},h.L=function(g,Z,E){g[Z]=E},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function g(z,q){for(var ee in z)A.call(z,ee)&&q(ee,z[ee])}function Z(z,q){if(q)for(var ee in q)A.call(q,ee)&&(z[ee]=q[ee]);return z}function E(z,q){return z.__proto__=q,z}function I(z,q,ee,pe){var xe=z[q].match(K)||[];h.a.D(ee.match(K),function(ce){h.a.Na(xe,ce,pe)}),z[q]=xe.join(" ")}var A=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,D=typeof Symbol=="function",k={},O={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(k,function(z,q){if(q.length)for(var ee=0,pe=q.length;ee<pe;ee++)O[q[ee]]=z});var U={propertychange:!0},j=n&&function(){for(var z=3,q=n.createElement("div"),ee=q.getElementsByTagName("i");q.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),K=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,q,ee){for(var pe=0,xe=z.length;pe<xe;pe++)q.call(ee,z[pe],pe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,q){return Array.prototype.indexOf.call(z,q)}:function(z,q){for(var ee=0,pe=z.length;ee<pe;ee++)if(z[ee]===q)return ee;return-1},Lb:function(z,q,ee){for(var pe=0,xe=z.length;pe<xe;pe++)if(q.call(ee,z[pe],pe,z))return z[pe];return e},Pa:function(z,q){var ee=h.a.A(z,q);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var q=[];return z&&h.a.D(z,function(ee){0>h.a.A(q,ee)&&q.push(ee)}),q},Mb:function(z,q,ee){var pe=[];if(z)for(var xe=0,ce=z.length;xe<ce;xe++)pe.push(q.call(ee,z[xe],xe));return pe},jb:function(z,q,ee){var pe=[];if(z)for(var xe=0,ce=z.length;xe<ce;xe++)q.call(ee,z[xe],xe)&&pe.push(z[xe]);return pe},Nb:function(z,q){if(q instanceof Array)z.push.apply(z,q);else for(var ee=0,pe=q.length;ee<pe;ee++)z.push(q[ee]);return z},Na:function(z,q,ee){var pe=h.a.A(h.a.bc(z),q);0>pe?ee&&z.push(q):ee||z.splice(pe,1)},Ba:N,extend:Z,setPrototypeOf:E,Ab:N?E:Z,P:g,Ga:function(z,q,ee){if(!z)return z;var pe={},xe;for(xe in z)A.call(z,xe)&&(pe[xe]=q.call(ee,z[xe],xe,z));return pe},Tb:function(z){for(;z.firstChild;)h.removeNode(z.firstChild)},Yb:function(z){z=h.a.la(z);for(var q=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,pe=z.length;ee<pe;ee++)q.appendChild(h.oa(z[ee]));return q},Ca:function(z,q){for(var ee=0,pe=z.length,xe=[];ee<pe;ee++){var ce=z[ee].cloneNode(!0);xe.push(q?h.oa(ce):ce)}return xe},va:function(z,q){if(h.a.Tb(z),q)for(var ee=0,pe=q.length;ee<pe;ee++)z.appendChild(q[ee])},Xc:function(z,q){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var pe=ee[0],xe=pe.parentNode,ce=0,ye=q.length;ce<ye;ce++)xe.insertBefore(q[ce],pe);for(ce=0,ye=ee.length;ce<ye;ce++)h.removeNode(ee[ce])}},Ua:function(z,q){if(z.length){for(q=q.nodeType===8&&q.parentNode||q;z.length&&z[0].parentNode!==q;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==q;)z.length--;if(1<z.length){var ee=z[0],pe=z[z.length-1];for(z.length=0;ee!==pe;)z.push(ee),ee=ee.nextSibling;z.push(pe)}}return z},Zc:function(z,q){7>j?z.setAttribute("selected",q):z.selected=q},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,q){return z=z||"",q.length>z.length?!1:z.substring(0,q.length)===q},vd:function(z,q){if(z===q)return!0;if(z.nodeType===11)return!1;if(q.contains)return q.contains(z.nodeType!==1?z.parentNode:z);if(q.compareDocumentPosition)return(q.compareDocumentPosition(z)&16)==16;for(;z&&z!=q;)z=z.parentNode;return!!z},Sb:function(z){return h.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!h.a.Lb(z,h.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return h.onError?function(){try{return z.apply(this,arguments)}catch(q){throw h.onError&&h.onError(q),q}}:z},setTimeout:function(z,q){return setTimeout(h.a.Ac(z),q)},Gc:function(z){setTimeout(function(){throw h.onError&&h.onError(z),z},0)},B:function(z,q,ee){var pe=h.a.Ac(ee);if(ee=U[q],h.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var xe=function(ye){pe.call(z,ye)},ce="on"+q;z.attachEvent(ce,xe),h.a.K.za(z,function(){z.detachEvent(ce,xe)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(q,pe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](q,pe)},Fb:function(z,q){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(h.a.R(z)==="input"&&z.type&&q.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,h.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(O[q]||"HTMLEvents"),ee.initEvent(q,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+q);else throw Error("Browser doesn't support triggering events");else o(z).trigger(q)},f:function(z){return h.O(z)?z():z},bc:function(z){return h.O(z)?z.v():z},Eb:function(z,q,ee){var pe;q&&(typeof z.classList=="object"?(pe=z.classList[ee?"add":"remove"],h.a.D(q.match(K),function(xe){pe.call(z.classList,xe)})):typeof z.className.baseVal=="string"?I(z.className,"baseVal",q,ee):I(z,"className",q,ee))},Bb:function(z,q){var ee=h.a.f(q);(ee===null||ee===e)&&(ee="");var pe=h.h.firstChild(z);!pe||pe.nodeType!=3||h.h.nextSibling(pe)?h.h.va(z,[z.ownerDocument.createTextNode(ee)]):pe.data=ee,h.a.Ad(z)},Yc:function(z,q){if(z.name=q,7>=j)try{var ee=z.name.replace(/[&<>'"]/g,function(pe){return"&#"+pe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=j&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(j){var q=z.style.width;z.style.width=0,z.style.width=q}},Pd:function(z,q){z=h.a.f(z),q=h.a.f(q);for(var ee=[],pe=z;pe<=q;pe++)ee.push(pe);return ee},la:function(z){for(var q=[],ee=0,pe=z.length;ee<pe;ee++)q.push(z[ee]);return q},Da:function(z){return D?Symbol(z):z},Zd:j===6,$d:j===7,W:j,Lc:function(z,q){for(var ee=h.a.la(z.getElementsByTagName("input")).concat(h.a.la(z.getElementsByTagName("textarea"))),pe=typeof q=="string"?function(ye){return ye.name===q}:function(ye){return q.test(ye.name)},xe=[],ce=ee.length-1;0<=ce;ce--)pe(ee[ce])&&xe.push(ee[ce]);return xe},Nd:function(z){return typeof z=="string"&&(z=h.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,q,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(h.a.f(z),q,ee)},Od:function(z,q,ee){ee=ee||{};var pe=ee.params||{},xe=ee.includeFields||this.Jc,ce=z;if(typeof z=="object"&&h.a.R(z)==="form")for(var ce=z.action,ye=xe.length-1;0<=ye;ye--)for(var Te=h.a.Lc(z,xe[ye]),Le=Te.length-1;0<=Le;Le--)pe[Te[Le].name]=Te[Le].value;q=h.a.f(q);var Xe=n.createElement("form");Xe.style.display="none",Xe.action=ce,Xe.method="post";for(var Re in q)z=n.createElement("input"),z.type="hidden",z.name=Re,z.value=h.a.hc(h.a.f(q[Re])),Xe.appendChild(z);g(pe,function(Ne,yt){var Nt=n.createElement("input");Nt.type="hidden",Nt.name=Ne,Nt.value=yt,Xe.appendChild(Nt)}),n.body.appendChild(Xe),ee.submitter?ee.submitter(Xe):Xe.submit(),setTimeout(function(){Xe.parentNode.removeChild(Xe)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var Z=this;if(arguments.length===1)return function(){return Z.apply(g,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var I=E.slice(0);return I.push.apply(I,arguments),Z.apply(g,I)}}),h.a.g=new function(){var g=0,Z="__ko__"+new Date().getTime(),E={},I,A;return h.a.W?(I=function(N,D){var k=N[Z];if(!k||k==="null"||!E[k]){if(!D)return e;k=N[Z]="ko"+g++,E[k]={}}return E[k]},A=function(N){var D=N[Z];return D?(delete E[D],N[Z]=null,!0):!1}):(I=function(N,D){var k=N[Z];return!k&&D&&(k=N[Z]={}),k},A=function(N){return N[Z]?(delete N[Z],!0):!1}),{get:function(N,D){var k=I(N,!1);return k&&k[D]},set:function(N,D,k){(N=I(N,k!==e))&&(N[D]=k)},Ub:function(N,D,k){return N=I(N,!0),N[D]||(N[D]=k)},clear:A,Z:function(){return g+++Z}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function g(D,k){var O=h.a.g.get(D,I);return O===e&&k&&(O=[],h.a.g.set(D,I,O)),O}function Z(D){var k=g(D,!1);if(k)for(var k=k.slice(0),O=0;O<k.length;O++)k[O](D);h.a.g.clear(D),h.a.K.cleanExternalData(D),N[D.nodeType]&&E(D.childNodes,!0)}function E(D,k){for(var O=[],U,j=0;j<D.length;j++)if((!k||D[j].nodeType===8)&&(Z(O[O.length]=U=D[j]),D[j]!==U))for(;j--&&h.a.A(O,D[j])==-1;);}var I=h.a.g.Z(),A={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(D,k){if(typeof k!="function")throw Error("Callback must be a function");g(D,!0).push(k)},yb:function(D,k){var O=g(D,!1);O&&(h.a.Pa(O,k),O.length==0&&h.a.g.set(D,I,e))},oa:function(D){return h.u.G(function(){A[D.nodeType]&&(Z(D),N[D.nodeType]&&E(D.getElementsByTagName("*")))}),D},removeNode:function(D){h.oa(D),D.parentNode&&D.parentNode.removeChild(D)},cleanExternalData:function(D){o&&typeof o.cleanData=="function"&&o.cleanData([D])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var g=[0,"",""],Z=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],A={thead:Z,tbody:Z,tfoot:Z,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:I,optgroup:I},N=8>=h.a.W;h.a.ua=function(D,k){var O;if(o){if(o.parseHTML)O=o.parseHTML(D,k)||[];else if((O=o.clean([D],k))&&O[0]){for(var U=O[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(O=k)||(O=n);var U=O.parentWindow||O.defaultView||t,j=h.a.Db(D).toLowerCase(),K=O.createElement("div"),te;for(te=(j=j.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[j[1]]||g,j=te[0],te="ignored<div>"+te[1]+D+te[2]+"</div>",typeof U.innerShiv=="function"?K.appendChild(U.innerShiv(te)):(N&&O.body.appendChild(K),K.innerHTML=te,N&&K.parentNode.removeChild(K));j--;)K=K.lastChild;O=h.a.la(K.lastChild.childNodes)}return O},h.a.Md=function(D,k){var O=h.a.ua(D,k);return O.length&&O[0].parentElement||h.a.Yb(O)},h.a.fc=function(D,k){if(h.a.Tb(D),k=h.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(D).html(k);else for(var O=h.a.ua(k,D.ownerDocument),U=0;U<O.length;U++)D.appendChild(O[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function g(E,I){if(E){if(E.nodeType==8){var A=h.aa.Uc(E.nodeValue);A!=null&&I.push({ud:E,Kd:A})}else if(E.nodeType==1)for(var A=0,N=E.childNodes,D=N.length;A<D;A++)g(N[A],I)}}var Z={};return{Xb:function(E){if(typeof E!="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 Z[I]=E,"<!--[ko_memo:"+I+"]-->"},bd:function(E,I){var A=Z[E];if(A===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return A.apply(null,I||[]),!0}finally{delete Z[E]}},cd:function(E,I){var A=[];g(E,A);for(var N=0,D=A.length;N<D;N++){var k=A[N].ud,O=[k];I&&h.a.Nb(O,I),h.aa.bd(A[N].Kd,O),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function g(){if(A){for(var k=A,O=0,U;D<A;)if(U=I[D++]){if(D>k){if(5e3<=++O){D=A,h.a.Gc(Error("'Too much recursion' after processing "+O+" task groups."));break}k=A}try{U()}catch(j){h.a.Gc(j)}}}}function Z(){g(),D=A=I.length=0}var E,I=[],A=0,N=1,D=0;return t.MutationObserver?E=function(k){var O=n.createElement("div");return new MutationObserver(k).observe(O,{attributes:!0}),function(){O.classList.toggle("foo")}}(Z):E=n&&"onreadystatechange"in n.createElement("script")?function(k){var O=n.createElement("script");O.onreadystatechange=function(){O.onreadystatechange=null,n.documentElement.removeChild(O),O=null,k()},n.documentElement.appendChild(O)}:function(k){setTimeout(k,0)},{scheduler:E,zb:function(k){return A||h.na.scheduler(Z),I[A++]=k,N++},cancel:function(k){k=k-(N-A),k>=D&&k<A&&(I[k]=null)},resetForTesting:function(){var k=A-D;return D=A=I.length=0,k},Sd:g}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(g,Z){g.throttleEvaluation=Z;var E=null;return h.$({read:g,write:function(I){clearTimeout(E),E=h.a.setTimeout(function(){g(I)},Z)}})},rateLimit:function(g,Z){var E,I,A;typeof Z=="number"?E=Z:(E=Z.timeout,I=Z.method),g.Hb=!1,A=typeof I=="function"?I:I=="notifyWhenChangesStop"?d:u,g.ub(function(N){return A(N,E,Z)})},deferred:function(g,Z){if(Z!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(E){var I,A=!1;return function(){if(!A){h.na.cancel(I),I=h.na.zb(E);try{A=!0,g.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(g,Z){g.equalityComparer=Z=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(g,Z,E){this.da=g,this.lc=Z,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(g){this.Jb=g,h.a.K.za(g,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,_),_.qb(this)};var _={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,Z,E){var I=this;E=E||"change";var A=new h.ic(I,Z?g.bind(Z):g,function(){h.a.Pa(I.U[E],A),I.hb&&I.hb(E)});return I.Qa&&I.Qa(E),I.U[E]||(I.U[E]=[]),I.U[E].push(A),A},notifySubscribers:function(g,Z){if(Z=Z||"change",Z==="change"&&this.Gb(),this.Wa(Z)){var E=Z==="change"&&this.ed||this.U[Z].slice(0);try{h.u.xc();for(var I=0,A;A=E[I];++I)A.Ib||A.lc(g)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var Z=this,E=h.O(Z),I,A,N,D,k;Z.gb||(Z.gb=Z.notifySubscribers,Z.notifySubscribers=m);var O=g(function(){Z.Ja=!1,E&&D===Z&&(D=Z.nc?Z.nc():Z());var U=A||k&&Z.sb(N,D);k=A=I=!1,U&&Z.gb(N=D)});Z.qc=function(U,j){j&&Z.Ja||(k=!j),Z.ed=Z.U.change.slice(0),Z.Ja=I=!0,D=U,O()},Z.pc=function(U){I||(N=U,Z.gb(U,"beforeChange"))},Z.rc=function(){k=!0},Z.gd=function(){Z.sb(N,Z.v(!0))&&(A=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var Z=0;return h.a.P(this.U,function(E,I){E!=="dirty"&&(Z+=I.length)}),Z},sb:function(g,Z){return!this.equalityComparer||!this.equalityComparer(g,Z)},toString:function(){return"[object Object]"},extend:function(g){var Z=this;return g&&h.a.P(g,function(E,I){var A=h.Ta[E];typeof A=="function"&&(Z=A(Z,I)||Z)}),Z}};h.L(_,"init",_.qb),h.L(_,"subscribe",_.subscribe),h.L(_,"extend",_.extend),h.L(_,"getSubscriptionsCount",_.Bd),h.a.Ba&&h.a.setPrototypeOf(_,Function.prototype),h.T.fn=_,h.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function g(N){E.push(I),I=N}function Z(){I=E.pop()}var E=[],I,A=0;return{xc:g,end:Z,cc:function(N){if(I){if(!h.Qc(N))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,N,N.fd||(N.fd=++A))}},G:function(N,D,k){try{return g(),N.apply(D,k||[])}finally{Z()}},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}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var C=h.a.Da("_latestValue");h.ta=function(g){function Z(){return 0<arguments.length?(Z.sb(Z[C],arguments[0])&&(Z.ya(),Z[C]=arguments[0],Z.xa()),this):(h.u.cc(Z),Z[C])}return Z[C]=g,h.a.Ba||h.a.extend(Z,h.T.fn),h.T.fn.qb(Z),h.a.Ab(Z,V),h.options.deferUpdates&&h.Ta.deferred(Z,!0),Z};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(V,h.T.fn);var L=h.ta.Ma="__ko_proto__";V[L]=h.ta,h.O=function(g){if((g=typeof g=="function"&&g[L])&&g!==V[L]&&g!==h.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},h.Za=function(g){return typeof g=="function"&&(g[L]===V[L]||g[L]===h.o.fn[L]&&g.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",V),h.L(V,"peek",V.v),h.L(V,"valueHasMutated",V.xa),h.L(V,"valueWillMutate",V.ya),h.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=h.ta(g),h.a.Ab(g,h.Ha.fn),g.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(g){for(var Z=this.v(),E=[],I=typeof g!="function"||h.O(g)?function(D){return D===g}:g,A=0;A<Z.length;A++){var N=Z[A];if(I(N)){if(E.length===0&&this.ya(),Z[A]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),Z.splice(A,1),A--}}return E.length&&this.xa(),E},removeAll:function(g){if(g===e){var Z=this.v(),E=Z.slice(0);return this.ya(),Z.splice(0,Z.length),this.xa(),E}return g?this.remove(function(I){return 0<=h.a.A(g,I)}):[]},destroy:function(g){var Z=this.v(),E=typeof g!="function"||h.O(g)?function(N){return N===g}:g;this.ya();for(var I=Z.length-1;0<=I;I--){var A=Z[I];E(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(Z){return 0<=h.a.A(g,Z)}):[]},indexOf:function(g){var Z=this();return h.a.A(Z,g)},replace:function(g,Z){var E=this.indexOf(g);0<=E&&(this.ya(),this.v()[E]=Z,this.xa())},sorted:function(g){var Z=this().slice(0);return g?Z.sort(g):Z.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){h.Ha.fn[g]=function(){var Z=this.v();this.ya(),this.zc(Z,g,arguments);var E=Z[g].apply(Z,arguments);return this.xa(),E===Z?this:E}}),h.a.D(["slice"],function(g){h.Ha.fn[g]=function(){var Z=this();return Z[g].apply(Z,arguments)}}),h.Pc=function(g){return h.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(g,Z){function E(){function K(){if(k){var te=[].concat(g.v()||[]),z;g.Wa("arrayChange")&&((!A||1<k)&&(A=h.a.Pb(O,te,g.Ob)),z=A),O=te,A=null,k=0,z&&z.length&&g.notifySubscribers(z,"arrayChange")}}I?K():(I=!0,D=g.subscribe(function(){++k},null,"spectate"),O=[].concat(g.v()||[]),A=null,N=g.subscribe(K))}if(g.Ob={},Z&&typeof Z=="object"&&h.a.extend(g.Ob,Z),g.Ob.sparse=!0,!g.zc){var I=!1,A=null,N,D,k=0,O,U=g.Qa,j=g.hb;g.Qa=function(K){U&&U.call(g,K),K==="arrayChange"&&E()},g.hb=function(K){j&&j.call(g,K),K!=="arrayChange"||g.Wa("arrayChange")||(N&&N.s(),D&&D.s(),D=N=null,I=!1,O=e)},g.zc=function(K,te,z){function q(Xe,Re,Ne){return ee[ee.length]={status:Xe,value:Re,index:Ne}}if(I&&!k){var ee=[],pe=K.length,xe=z.length,ce=0;switch(te){case"push":ce=pe;case"unshift":for(te=0;te<xe;te++)q("added",z[te],ce+te);break;case"pop":ce=pe-1;case"shift":pe&&q("deleted",K[ce],ce);break;case"splice":te=Math.min(Math.max(0,0>z[0]?pe+z[0]:z[0]),pe);for(var pe=xe===1?pe:Math.min(te+(z[1]||0),pe),xe=te+xe-2,ce=Math.max(pe,xe),ye=[],Te=[],Le=2;te<ce;++te,++Le)te<pe&&Te.push(q("deleted",K[te],te)),te<xe&&ye.push(q("added",z[Le],te));h.a.Kc(Te,ye);break;default:return}A=ee}}}};var R=h.a.Da("_state");h.o=h.$=function(g,Z,E){function I(){if(0<arguments.length){if(typeof A=="function")A.apply(N.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 N.ra||h.u.cc(I),(N.ka||N.J&&I.Xa())&&I.ha(),N.X}if(typeof g=="object"?E=g:(E=E||{},g&&(E.read=g)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:Z||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return I[R]=N,I.Nc=typeof A=="function",h.a.Ba||h.a.extend(I,h.T.fn),h.T.fn.qb(I),h.a.Ab(I,G),E.pure?(N.wb=!0,N.J=!0,h.a.extend(I,W)):E.deferEvaluation&&h.a.extend(I,w),h.options.deferUpdates&&h.Ta.deferred(I,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||I.ha(),N.l&&I.ja()&&h.a.K.za(N.l,N.Rb=function(){I.s()}),I};var G={equalityComparer:c,qa:function(){return this[R].V},Va:function(){var g=[];return h.a.P(this[R].I,function(Z,E){g[E.Ka]=E.da}),g},Vb:function(g){if(!this[R].V)return!1;var Z=this.Va();return h.a.A(Z,g)!==-1?!0:!!h.a.Lb(Z,function(E){return E.Vb&&E.Vb(g)})},uc:function(g,Z,E){if(this[R].wb&&Z===this)throw Error("A 'pure' computed must not be called recursively");this[R].I[g]=E,E.Ka=this[R].V++,E.La=Z.ob()},Xa:function(){var g,Z,E=this[R].I;for(g in E)if(Object.prototype.hasOwnProperty.call(E,g)&&(Z=E[g],this.Ia&&Z.da.Ja||Z.da.Dd(Z.La)))return!0},Jd:function(){this.Ia&&!this[R].rb&&this.Ia(!1)},ja:function(){var g=this[R];return g.ka||0<g.V},Rd:function(){this.Ja?this[R].ka&&(this[R].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var Z=g.subscribe(this.Jd,this,"dirty"),E=g.subscribe(this.Rd,this);return{da:g,s:function(){Z.s(),E.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,Z=g.throttleEvaluation;Z&&0<=Z?(clearTimeout(this[R].Ic),this[R].Ic=h.a.setTimeout(function(){g.ha(!0)},Z)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var Z=this[R],E=Z.Sa,I=!1;if(!Z.rb&&!Z.ra){if(Z.l&&!h.a.Sb(Z.l)||E&&E()){if(!Z.jc){this.s();return}}else Z.jc=!1;Z.rb=!0;try{I=this.zd(g)}finally{Z.rb=!1}return I}},zd:function(g){var Z=this[R],I=!1,E=Z.wb?e:!Z.V,I={qd:this,mb:Z.I,Qb:Z.V};h.u.xc({pd:I,od:b,o:this,Ya:E}),Z.I={},Z.V=0;var A=this.yd(Z,I);return Z.V?I=this.sb(Z.X,A):(this.s(),I=!0),I&&(Z.J?this.Gb():this.notifySubscribers(Z.X,"beforeChange"),Z.X=A,this.notifySubscribers(Z.X,"spectate"),!Z.J&&g&&this.notifySubscribers(Z.X),this.rc&&this.rc()),E&&this.notifySubscribers(Z.X,"awake"),I},yd:function(g,Z){try{var E=g.Wc;return g.nb?E.call(g.nb):E()}finally{h.u.end(),Z.Qb&&!g.J&&h.a.P(Z.mb,p),g.sa=g.ka=!1}},v:function(g){var Z=this[R];return(Z.ka&&(g||!Z.V)||Z.J&&this.Xa())&&this.ha(),Z.X},ub:function(g){h.T.fn.ub.call(this,g),this.nc=function(){return this[R].J||(this[R].sa?this.ha():this[R].ka=!1),this[R].X},this.Ia=function(Z){this.pc(this[R].X),this[R].ka=!0,Z&&(this[R].sa=!0),this.qc(this,!Z)}},s:function(){var g=this[R];!g.J&&g.I&&h.a.P(g.I,function(Z,E){E.s&&E.s()}),g.l&&g.Rb&&h.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},W={Qa:function(g){var Z=this,E=Z[R];if(!E.ra&&E.J&&g=="change"){if(E.J=!1,E.sa||Z.Xa())E.I=null,E.V=0,Z.ha()&&Z.Gb();else{var I=[];h.a.P(E.I,function(A,N){I[N.Ka]=A}),h.a.D(I,function(A,N){var D=E.I[A],k=Z.$c(D.da);k.Ka=N,k.La=D.La,E.I[A]=k}),Z.Xa()&&Z.ha()&&Z.Gb()}E.ra||Z.notifySubscribers(E.X,"awake")}},hb:function(g){var Z=this[R];Z.ra||g!="change"||this.Wa("change")||(h.a.P(Z.I,function(E,I){I.s&&(Z.I[E]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),Z.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[R];return g.J&&(g.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},w={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(G,h.T.fn);var P=h.ta.Ma;G[P]=h.o,h.Oc=function(g){return typeof g=="function"&&g[P]===G[P]},h.Fd=function(g){return h.Oc(g)&&g[R]&&g[R].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",G),h.L(G,"peek",G.v),h.L(G,"dispose",G.s),h.L(G,"isActive",G.ja),h.L(G,"getDependenciesCount",G.qa),h.L(G,"getDependencies",G.Va),h.xb=function(g,Z){return typeof g=="function"?h.o(g,Z,{pure:!0}):(g=h.a.extend({},g),g.pure=!0,h.o(g,Z))},h.b("pureComputed",h.xb),function(){function g(I,A,N){if(N=N||new E,I=A(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 D=I instanceof Array?[]:{};return N.save(I,D),Z(I,function(k){var O=A(I[k]);switch(typeof O){case"boolean":case"number":case"string":case"function":D[k]=O;break;case"object":case"undefined":var U=N.get(O);D[k]=U!==e?U:g(O,A,N)}}),D}function Z(I,A){if(I instanceof Array){for(var N=0;N<I.length;N++)A(N);typeof I.toJSON=="function"&&A("toJSON")}else for(N in I)A(N)}function E(){this.keys=[],this.values=[]}h.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(I,function(A){for(var N=0;h.O(A)&&10>N;N++)A=A();return A})},h.toJSON=function(I,A,N){return I=h.ad(I),h.a.hc(I,A,N)},E.prototype={constructor:E,save:function(I,A){var N=h.a.A(this.keys,I);0<=N?this.values[N]=A:(this.keys.push(I),this.values.push(A))},get:function(I){return I=h.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(g,Z,E){function I(A){var N=h.xb(g,E).extend({ma:"always"}),D=N.subscribe(function(k){k&&(D.s(),A(k))});return N.notifySubscribers(N.v()),D}return typeof Promise!="function"||Z?I(Z.bind(E)):new Promise(I)},h.b("when",h.Wd),function(){h.w={M:function(g){switch(h.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?h.a.g.get(g,h.c.options.$b):7>=h.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?h.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,Z,E){switch(h.a.R(g)){case"option":typeof Z=="string"?(h.a.g.set(g,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=Z):(h.a.g.set(g,h.c.options.$b,Z),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof Z=="number"?Z:"");break;case"select":(Z===""||Z===null)&&(Z=e);for(var I=-1,A=0,N=g.options.length,D;A<N;++A)if(D=h.w.M(g.options[A]),D==Z||D===""&&Z===e){I=A;break}(E||0<=I||Z===e&&1<g.size)&&(g.selectedIndex=I,h.a.W===6&&h.a.setTimeout(function(){g.selectedIndex=I},0));break;default:(Z===null||Z===e)&&(Z=""),g.value=Z}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function g(k){k=h.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=` -,`;var O=[],U=k.match(I),j,K=[],te=0;if(1<U.length){for(var z=0,q;q=U[z];++z){var ee=q.charCodeAt(0);if(ee===44){if(0>=te){O.push(j&&K.length?{key:j,value:K.join("")}:{unknown:j||K.join("")}),j=te=0,K=[];continue}}else if(ee===58){if(!te&&!j&&K.length===1){j=K.pop();continue}}else{if(ee===47&&1<q.length&&(q.charCodeAt(1)===47||q.charCodeAt(1)===42))continue;ee===47&&z&&1<q.length?(ee=U[z-1].match(A))&&!N[ee[0]]&&(k=k.substr(k.indexOf(q)+1),U=k.match(I),z=-1,q="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:j||K.length||ee!==34&&ee!==39||(q=q.slice(1,-1))}K.push(q)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return O}var Z=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},D={};return{Ra:[],wa:D,ac:g,vb:function(k,O){function U(ee,pe){var xe;if(!z){var ce=h.getBindingHandler(ee);if(ce&&ce.preprocess&&!(pe=ce.preprocess(pe,ee,U)))return;(ce=D[ee])&&(xe=pe,0<=h.a.A(Z,xe)?xe=!1:(ce=xe.match(E),xe=ce===null?!1:ce[1]?"Object("+ce[1]+")"+ce[2]:xe),ce=xe),ce&&K.push("'"+(typeof D[ee]=="string"?D[ee]:ee)+"':function(_z){"+xe+"=_z}")}te&&(pe="function(){return "+pe+" }"),j.push("'"+ee+"':"+pe)}O=O||{};var j=[],K=[],te=O.valueAccessors,z=O.bindingParams,q=typeof k=="string"?g(k):k;return h.a.D(q,function(ee){U(ee.key||ee.unknown,ee.value)}),K.length&&U("_ko_property_writers","{"+K.join(",")+" }"),j.join(",")},Id:function(k,O){for(var U=0;U<k.length;U++)if(k[U].key==O)return!0;return!1},eb:function(k,O,U,j,K){k&&h.O(k)?!h.Za(k)||K&&k.v()===j||k(j):(k=O.get("_ko_property_writers"))&&k[U]&&k[U](j)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function g(U){return U.nodeType==8&&N.test(A?U.text:U.nodeValue)}function Z(U){return U.nodeType==8&&D.test(A?U.text:U.nodeValue)}function E(U,j){for(var K=U,te=1,z=[];K=K.nextSibling;){if(Z(K)&&(h.a.g.set(K,O,!0),te--,te===0))return z;z.push(K),g(K)&&te++}if(!j)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,j){var K=E(U,j);return K?0<K.length?K[K.length-1].nextSibling:U.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",N=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,D=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},O="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return g(U)?E(U):U.childNodes},Ea:function(U){if(g(U)){U=h.h.childNodes(U);for(var j=0,K=U.length;j<K;j++)h.removeNode(U[j])}else h.a.Tb(U)},va:function(U,j){if(g(U)){h.h.Ea(U);for(var K=U.nextSibling,te=0,z=j.length;te<z;te++)K.parentNode.insertBefore(j[te],K)}else h.a.va(U,j)},Vc:function(U,j){var K;g(U)?(K=U.nextSibling,U=U.parentNode):K=U.firstChild,K?j!==K&&U.insertBefore(j,K):U.appendChild(j)},Wb:function(U,j,K){K?(K=K.nextSibling,g(U)&&(U=U.parentNode),K?j!==K&&U.insertBefore(j,K):U.appendChild(j)):h.h.Vc(U,j)},firstChild:function(U){if(g(U))return!U.nextSibling||Z(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&Z(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(g(U)&&(U=I(U)),U.nextSibling&&Z(U.nextSibling)){var j=U.nextSibling;if(Z(j)&&!h.a.g.get(j,O))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:g,Vd:function(U){return(U=(A?U.text:U.nodeValue).match(N))?U[1]:null},Sc:function(U){if(k[h.a.R(U)]){var j=U.firstChild;if(j)do if(j.nodeType===1){var K;K=j.firstChild;var te=null;if(K)do if(te)te.push(K);else if(g(K)){var z=I(K,!0);z?K=z:te=[K]}else Z(K)&&(te=[K]);while(K=K.nextSibling);if(K=te)for(te=j.nextSibling,z=0;z<K.length;z++)te?U.insertBefore(K[z],te):U.appendChild(K[z])}while(j=j.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(g);case 8:return h.h.Cd(g);default:return!1}},getBindings:function(g,Z){var E=this.getBindingsString(g,Z),E=E?this.parseBindingsString(E,Z,g):null;return h.j.tc(E,g,Z,!1)},getBindingAccessors:function(g,Z){var E=this.getBindingsString(g,Z),E=E?this.parseBindingsString(E,Z,g,{valueAccessors:!0}):null;return h.j.tc(E,g,Z,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return h.h.Vd(g);default:return null}},parseBindingsString:function(g,Z,E,I){try{var A=this.nd,N=g+(I&&I.valueAccessors||""),D;if(!(D=A[N])){var k,O="with($context){with($data||{}){return{"+h.m.vb(g,I)+"}}}";k=new Function("$context","$element",O),D=A[N]=k}return D(Z,E)}catch(U){throw U.message=`Unable to parse bindings. -Bindings value: `+g+` -Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function g(ce){var ye=(ce=h.a.g.get(ce,xe))&&ce.N;ye&&(ce.N=null,ye.Tc())}function Z(ce,ye,Te){this.node=ce,this.yc=ye,this.kb=[],this.H=!1,ye.N||h.a.K.za(ce,g),Te&&Te.N&&(Te.N.kb.push(ce),this.Kb=Te)}function E(ce){return function(){return ce}}function I(ce){return ce()}function A(ce){return h.a.Ga(h.u.G(ce),function(ye,Te){return function(){return ce()[Te]}})}function N(ce,ye,Te){return typeof ce=="function"?A(ce.bind(null,ye,Te)):h.a.Ga(ce,E)}function D(ce,ye){return A(this.getBindings.bind(this,ce,ye))}function k(ce,ye){var Te=h.h.firstChild(ye);if(Te){var Le,Xe=h.ga.instance,Re=Xe.preprocessNode;if(Re){for(;Le=Te;)Te=h.h.nextSibling(Le),Re.call(Xe,Le);Te=h.h.firstChild(ye)}for(;Le=Te;)Te=h.h.nextSibling(Le),O(ce,Le)}h.i.ma(ye,h.i.H)}function O(ce,ye){var Te=ce,Le=ye.nodeType===1;Le&&h.h.Sc(ye),(Le||h.ga.instance.nodeHasBindings(ye))&&(Te=j(ye,null,ce).bindingContextForDescendants),Te&&!ee[h.a.R(ye)]&&k(Te,ye)}function U(ce){var ye=[],Te={},Le=[];return h.a.P(ce,function Xe(Re){if(!Te[Re]){var Ne=h.getBindingHandler(Re);Ne&&(Ne.after&&(Le.push(Re),h.a.D(Ne.after,function(yt){if(ce[yt]){if(h.a.A(Le,yt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Le.join(", "));Xe(yt)}}),Le.length--),ye.push({key:Re,Mc:Ne})),Te[Re]=!0}}),ye}function j(ce,ye,Te){var Le=h.a.g.Ub(ce,xe,{}),Xe=Le.hd;if(!ye){if(Xe)throw Error("You cannot apply bindings multiple times to the same element.");Le.hd=!0}Xe||(Le.context=Te),Le.Zb||(Le.Zb={});var Re;if(ye&&typeof ye!="function")Re=ye;else{var Ne=h.ga.instance,yt=Ne.getBindingAccessors||D,Nt=h.$(function(){return(Re=ye?ye(Te,ce):yt.call(Ne,ce,Te))&&(Te[te]&&Te[te](),Te[q]&&Te[q]()),Re},null,{l:ce});Re&&Nt.ja()||(Nt=null)}var pt=Te,Be;if(Re){var et=function(){return h.a.Ga(Nt?Nt():Re,I)},qe=Nt?function($e){return function(){return I(Nt()[$e])}}:function($e){return Re[$e]};et.get=function($e){return Re[$e]&&I(qe($e))},et.has=function($e){return $e in Re},h.i.H in Re&&h.i.subscribe(ce,h.i.H,function(){var $e=(0,Re[h.i.H])();if($e){var Kt=h.h.childNodes(ce);Kt.length&&$e(Kt,h.Ec(Kt[0]))}}),h.i.pa in Re&&(pt=h.i.Cb(ce,Te),h.i.subscribe(ce,h.i.pa,function(){var $e=(0,Re[h.i.pa])();$e&&h.h.firstChild(ce)&&$e(ce)})),Le=U(Re),h.a.D(Le,function($e){var Kt=$e.Mc.init,ge=$e.Mc.update,Ve=$e.key;if(ce.nodeType===8&&!h.h.ea[Ve])throw Error("The binding '"+Ve+"' cannot be used with virtual elements");try{typeof Kt=="function"&&h.u.G(function(){var Ht=Kt(ce,qe(Ve),et,pt.$data,pt);if(Ht&&Ht.controlsDescendantBindings){if(Be!==e)throw Error("Multiple bindings ("+Be+" and "+Ve+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Be=Ve}}),typeof ge=="function"&&h.$(function(){ge(ce,qe(Ve),et,pt.$data,pt)},null,{l:ce})}catch(Ht){throw Ht.message='Unable to process binding "'+Ve+": "+Re[Ve]+`" -Message: `+Ht.message,Ht}})}return Le=Be===e,{shouldBindDescendants:Le,bindingContextForDescendants:Le&&pt}}function K(ce,ye){return ce&&ce instanceof h.fa?ce:new h.fa(ce,e,e,ye)}var te=h.a.Da("_subscribable"),z=h.a.Da("_ancestorBindingInfo"),q=h.a.Da("_dataDependency");h.c={};var ee={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(ce){return h.c[ce]};var pe={};h.fa=function(ce,ye,Te,Le,Xe){function Re(){var qe=pt?Nt():Nt,$e=h.a.f(qe);return ye?(h.a.extend(Ne,ye),z in ye&&(Ne[z]=ye[z])):(Ne.$parents=[],Ne.$root=$e,Ne.ko=h),Ne[te]=Be,yt?$e=Ne.$data:(Ne.$rawData=qe,Ne.$data=$e),Te&&(Ne[Te]=$e),Le&&Le(Ne,ye,$e),ye&&ye[te]&&!h.S.o().Vb(ye[te])&&ye[te](),et&&(Ne[q]=et),Ne.$data}var Ne=this,yt=ce===pe,Nt=yt?e:ce,pt=typeof Nt=="function"&&!h.O(Nt),Be,et=Xe&&Xe.dataDependency;Xe&&Xe.exportDependencies?Re():(Be=h.xb(Re),Be.v(),Be.ja()?Be.equalityComparer=null:Ne[te]=e)},h.fa.prototype.createChildContext=function(ce,ye,Te,Le){if(!Le&&ye&&typeof ye=="object"&&(Le=ye,ye=Le.as,Te=Le.extend),ye&&Le&&Le.noChildContext){var Xe=typeof ce=="function"&&!h.O(ce);return new h.fa(pe,this,null,function(Re){Te&&Te(Re),Re[ye]=Xe?ce():ce},Le)}return new h.fa(ce,this,ye,function(Re,Ne){Re.$parentContext=Ne,Re.$parent=Ne.$data,Re.$parents=(Ne.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),Te&&Te(Re)},Le)},h.fa.prototype.extend=function(ce,ye){return new h.fa(pe,this,null,function(Te){h.a.extend(Te,typeof ce=="function"?ce(Te):ce)},ye)};var xe=h.a.g.Z();Z.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},Z.prototype.sd=function(ce){h.a.Pa(this.kb,ce),!this.kb.length&&this.H&&this.Cc()},Z.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,g),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ce,ye,Te,Le,Xe){var Re=h.a.g.Ub(ce,xe,{});return Re.Fa||(Re.Fa=new h.T),Xe&&Xe.notifyImmediately&&Re.Zb[ye]&&h.u.G(Te,Le,[ce]),Re.Fa.subscribe(Te,Le,ye)},ma:function(ce,ye){var Te=h.a.g.get(ce,xe);if(Te&&(Te.Zb[ye]=!0,Te.Fa&&Te.Fa.notifySubscribers(ce,ye),ye==h.i.H)){if(Te.N)Te.N.Cc();else if(Te.N===e&&Te.Fa&&Te.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ce,ye){var Te=h.a.g.Ub(ce,xe,{});return Te.N||(Te.N=new Z(ce,Te,ye[z])),ye[z]==Te?ye:ye.extend(function(Le){Le[z]=Te})}},h.Td=function(ce){return(ce=h.a.g.get(ce,xe))&&ce.context},h.ib=function(ce,ye,Te){return ce.nodeType===1&&h.h.Sc(ce),j(ce,ye,K(Te))},h.ld=function(ce,ye,Te){return Te=K(Te),h.ib(ce,N(ye,Te,ce),Te)},h.Oa=function(ce,ye){ye.nodeType!==1&&ye.nodeType!==8||k(K(ce),ye)},h.vc=function(ce,ye,Te){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");O(K(ce,Te),ye)},h.Dc=function(ce){return!ce||ce.nodeType!==1&&ce.nodeType!==8?e:h.Td(ce)},h.Ec=function(ce){return(ce=h.Dc(ce))?ce.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(g){function Z(D,k){var O=Object.prototype.hasOwnProperty.call(A,D)?A[D]:g,U;O?O.subscribe(k):(O=A[D]=new h.T,O.subscribe(k),E(D,function(j,K){var te=!(!K||!K.synchronous);N[D]={definition:j,Gd:te},delete A[D],U||te?O.notifySubscribers(j):h.na.zb(function(){O.notifySubscribers(j)})}),U=!0)}function E(D,k){I("getConfig",[D],function(O){O?I("loadComponent",[D,O],function(U){k(U,O)}):k(null,null)})}function I(D,k,O,U){U||(U=h.j.loaders.slice(0));var j=U.shift();if(j){var K=j[D];if(K){var te=!1;if(K.apply(j,k.concat(function(z){te?O(null):z!==null?O(z):I(D,k,O,U)}))!==g&&(te=!0,!j.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(D,k,O,U)}else O(null)}var A={},N={};h.j={get:function(D,k){var O=Object.prototype.hasOwnProperty.call(N,D)?N[D]:g;O?O.Gd?h.u.G(function(){k(O.definition)}):h.na.zb(function(){k(O.definition)}):Z(D,k)},Bc:function(D){delete N[D]},oc:I},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function g(O,U,j,K){function te(){--q===0&&K(z)}var z={},q=2,ee=j.template;j=j.viewModel,ee?A(U,ee,function(pe){h.j.oc("loadTemplate",[O,pe],function(xe){z.template=xe,te()})}):te(),j?A(U,j,function(pe){h.j.oc("loadViewModel",[O,pe],function(xe){z[k]=xe,te()})}):te()}function Z(O,U,j){if(typeof U=="function")j(function(te){return new U(te)});else if(typeof U[k]=="function")j(U[k]);else if("instance"in U){var K=U.instance;j(function(){return K})}else"viewModel"in U?Z(O,U.viewModel,j):O("Unknown viewModel value: "+U)}function E(O){switch(h.a.R(O)){case"script":return h.a.ua(O.text);case"textarea":return h.a.ua(O.value);case"template":if(I(O.content))return h.a.Ca(O.content.childNodes)}return h.a.Ca(O.childNodes)}function I(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function A(O,U,j){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),j(K)}):O("Uses require, but no AMD loader is present"):j(U)}function N(O){return function(U){throw Error("Component '"+O+"': "+U)}}var D={};h.j.register=function(O,U){if(!U)throw Error("Invalid configuration for "+O);if(h.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=U},h.j.tb=function(O){return Object.prototype.hasOwnProperty.call(D,O)},h.j.unregister=function(O){delete D[O],h.j.Bc(O)},h.j.Fc={getConfig:function(O,U){U(h.j.tb(O)?D[O]:null)},loadComponent:function(O,U,j){var K=N(O);A(K,U,function(te){g(O,K,te,j)})},loadTemplate:function(O,U,j){if(O=N(O),typeof U=="string")j(h.a.ua(U));else if(U instanceof Array)j(U);else if(I(U))j(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)j(E(U));else if(typeof U=="string"){var K=n.getElementById(U);K?j(E(K)):O("Cannot find element with ID "+U)}else O("Unknown element type: "+U);else O("Unknown template value: "+U)},loadViewModel:function(O,U,j){Z(N(O),U,j)}};var k="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=D}(),function(){function g(E,I){var A=E.getAttribute("params");if(A){var A=Z.parseBindingsString(A,I,E,{valueAccessors:!0,bindingParams:!0}),A=h.a.Ga(A,function(k){return h.o(k,null,{l:E})}),N=h.a.Ga(A,function(k){var O=k.v();return k.ja()?h.o({read:function(){return h.a.f(k())},write:h.Za(O)&&function(U){k()(U)},l:E}):O});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=A),N}return{$raw:{}}}h.j.getComponentNameForNode=function(E){var I=h.a.R(E);if(h.j.tb(I)&&(I.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=h.a.W&&E.tagName===I))return I},h.j.tc=function(E,I,A,N){if(I.nodeType===1){var D=h.j.getComponentNameForNode(I);if(D){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:D,params:g(I,A)};E.component=N?function(){return k}:k}}return E};var Z=new h.ga;9>h.a.W&&(h.j.register=function(E){return function(I){return E.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(E){return function(){var I=E(),A=h.j.dd,N;for(N in A);return I}}(n.createDocumentFragment))}(),function(){function g(I,A,N){if(A=A.template,!A)throw Error("Component '"+I+"' has no template");I=h.a.Ca(A),h.h.va(N,I)}function Z(I,A,N){var D=I.createViewModel;return D?D.call(I,A,N):A}var E=0;h.c.component={init:function(I,A,N,D,k){function O(){var z=U&&U.dispose;typeof z=="function"&&z.call(U),K&&K.s(),j=U=K=null}var U,j,K,te=h.a.la(h.h.childNodes(I));return h.h.Ea(I),h.a.K.za(I,O),h.o(function(){var z=h.a.f(A()),q,ee;if(typeof z=="string"?q=z:(q=h.a.f(z.name),ee=h.a.f(z.params)),!q)throw Error("No component name specified");var pe=h.i.Cb(I,k),xe=j=++E;h.j.get(q,function(ce){if(j===xe){if(O(),!ce)throw Error("Unknown component '"+q+"'");g(q,ce,I);var ye=Z(ce,ee,{element:I,templateNodes:te});ce=pe.createChildContext(ye,{extend:function(Te){Te.$component=ye,Te.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(K=h.i.subscribe(I,h.i.pa,ye.koDescendantsComplete,ye)),U=ye,h.Oa(ce,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var F={class:"className",for:"htmlFor"};h.c.attr={update:function(g,Z){var E=h.a.f(Z())||{};h.a.P(E,function(I,A){A=h.a.f(A);var N=I.indexOf(":"),N="lookupNamespaceURI"in g&&0<N&&g.lookupNamespaceURI(I.substr(0,N)),D=A===!1||A===null||A===e;D?N?g.removeAttributeNS(N,I):g.removeAttribute(I):A=A.toString(),8>=h.a.W&&I in F?(I=F[I],D?g.removeAttribute(I):g[I]=A):D||(N?g.setAttributeNS(N,I,A):g.setAttribute(I,A)),I==="name"&&h.a.Yc(g,D?"":A)})}},function(){h.c.checked={after:["value","attr"],init:function(g,Z,E){function I(){var z=g.checked,q=N();if(!h.S.Ya()&&(z||!k&&!h.S.qa())){var ee=h.u.G(Z);if(U){var pe=j?ee.v():ee,xe=te;te=q,xe!==q?z&&(h.a.Na(pe,q,!0),h.a.Na(pe,xe,!1)):h.a.Na(pe,q,z),j&&h.Za(ee)&&ee(pe)}else D&&(q===e?q=z:z||(q=e)),h.m.eb(ee,E,"checked",q,!0)}}function A(){var z=h.a.f(Z()),q=N();U?(g.checked=0<=h.a.A(z,q),te=q):g.checked=D&&q===e?!!z:N()===z}var N=h.xb(function(){if(E.has("checkedValue"))return h.a.f(E.get("checkedValue"));if(K)return E.has("value")?h.a.f(E.get("value")):g.value}),D=g.type=="checkbox",k=g.type=="radio";if(D||k){var O=Z(),U=D&&h.a.f(O)instanceof Array,j=!(U&&O.push&&O.splice),K=k||U,te=U?N():e;k&&!g.name&&h.c.uniqueName.init(g,function(){return!0}),h.o(I,null,{l:g}),h.a.B(g,"click",I),h.o(A,null,{l:g}),O=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(g,Z){g.value=h.a.f(Z())}}}(),h.c.class={update:function(g,Z){var E=h.a.Db(h.a.f(Z()));h.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=E,h.a.Eb(g,E,!0)}},h.c.css={update:function(g,Z){var E=h.a.f(Z());E!==null&&typeof E=="object"?h.a.P(E,function(I,A){A=h.a.f(A),h.a.Eb(g,I,A)}):h.c.class.update(g,Z)}},h.c.enable={update:function(g,Z){var E=h.a.f(Z());E&&g.disabled?g.removeAttribute("disabled"):E||g.disabled||(g.disabled=!0)}},h.c.disable={update:function(g,Z){h.c.enable.update(g,function(){return!h.a.f(Z())})}},h.c.event={init:function(g,Z,E,I,A){var N=Z()||{};h.a.P(N,function(D){typeof D=="string"&&h.a.B(g,D,function(k){var O,U=Z()[D];if(U){try{var j=h.a.la(arguments);I=A.$data,j.unshift(I),O=U.apply(I,j)}finally{O!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}E.get(D+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},h.c.foreach={Rc:function(g){return function(){var Z=g(),E=h.a.bc(Z);return!E||typeof E.length=="number"?{foreach:Z,templateEngine:h.ba.Ma}:(h.a.f(Z),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:h.ba.Ma})}},init:function(g,Z){return h.c.template.init(g,h.c.foreach.Rc(Z))},update:function(g,Z,E,I,A){return h.c.template.update(g,h.c.foreach.Rc(Z),E,I,A)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(g,Z,E){function I(D){g.__ko_hasfocusUpdating=!0;var k=g.ownerDocument;if("activeElement"in k){var O;try{O=k.activeElement}catch{O=k.body}D=O===g}k=Z(),h.m.eb(k,E,"hasfocus",D,!0),g.__ko_hasfocusLastValue=D,g.__ko_hasfocusUpdating=!1}var A=I.bind(null,!0),N=I.bind(null,!1);h.a.B(g,"focus",A),h.a.B(g,"focusin",A),h.a.B(g,"blur",N),h.a.B(g,"focusout",N),g.__ko_hasfocusLastValue=!1},update:function(g,Z){var E=!!h.a.f(Z());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===E||(E?g.focus():g.blur(),!E&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[g,E?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,Z){h.a.fc(g,Z())}},function(){function g(Z,E,I){h.c[Z]={init:function(A,N,D,k,O){var U,j,K={},te,z,q;if(E){k=D.get("as");var ee=D.get("noChildContext");q=!(k&&ee),K={as:k,noChildContext:ee,exportDependencies:q}}return z=(te=D.get("completeOn")=="render")||D.has(h.i.pa),h.o(function(){var pe=h.a.f(N()),xe=!I!=!pe,ce=!j,ye;(q||xe!==U)&&(z&&(O=h.i.Cb(A,O)),xe&&((!E||q)&&(K.dataDependency=h.S.o()),ye=E?O.createChildContext(typeof pe=="function"?pe:N,K):h.S.qa()?O.extend(null,K):O),ce&&h.S.qa()&&(j=h.a.Ca(h.h.childNodes(A),!0)),xe?(ce||h.h.va(A,h.a.Ca(j)),h.Oa(ye,A)):(h.h.Ea(A),te||h.i.ma(A,h.i.H)),U=xe)},null,{l:A}),{controlsDescendantBindings:!0}}},h.m.Ra[Z]=!1,h.h.ea[Z]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)}(),h.c.let={init:function(g,Z,E,I,A){return Z=A.extend(Z),h.Oa(Z,g),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var M={};h.c.options={init:function(g){if(h.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,Z,E){function I(){return h.a.jb(g.options,function(ee){return ee.selected})}function A(ee,pe,xe){var ce=typeof pe;return ce=="function"?pe(ee):ce=="string"?ee[pe]:xe}function N(ee,pe){if(z&&U)h.i.ma(g,h.i.H);else if(te.length){var xe=0<=h.a.A(te,h.w.M(pe[0]));h.a.Zc(pe[0],xe),z&&!xe&&h.u.G(h.a.Fb,null,[g,"change"])}}var D=g.multiple,k=g.length!=0&&D?g.scrollTop:null,O=h.a.f(Z()),U=E.get("valueAllowUnset")&&E.has("value"),j=E.get("optionsIncludeDestroyed");Z={};var K,te=[];U||(D?te=h.a.Mb(I(),h.w.M):0<=g.selectedIndex&&te.push(h.w.M(g.options[g.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),K=h.a.jb(O,function(ee){return j||ee===e||ee===null||!h.a.f(ee._destroy)}),E.has("optionsCaption")&&(O=h.a.f(E.get("optionsCaption")),O!==null&&O!==e&&K.unshift(M)));var z=!1;if(Z.beforeRemove=function(ee){g.removeChild(ee)},O=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(O=function(ee,pe){N(0,pe),h.u.G(E.get("optionsAfterRender"),null,[pe[0],ee!==M?ee:e])}),h.a.ec(g,K,function(ee,pe,xe){return xe.length&&(te=!U&&xe[0].selected?[h.w.M(xe[0])]:[],z=!0),pe=g.ownerDocument.createElement("option"),ee===M?(h.a.Bb(pe,E.get("optionsCaption")),h.w.cb(pe,e)):(xe=A(ee,E.get("optionsValue"),ee),h.w.cb(pe,h.a.f(xe)),ee=A(ee,E.get("optionsText"),xe),h.a.Bb(pe,ee)),[pe]},Z,O),!U){var q;D?q=te.length&&I().length<te.length:q=te.length&&0<=g.selectedIndex?h.w.M(g.options[g.selectedIndex])!==te[0]:te.length||0<=g.selectedIndex,q&&h.u.G(h.a.Fb,null,[g,"change"])}(U||h.S.Ya())&&h.i.ma(g,h.i.H),h.a.wd(g),k&&20<Math.abs(k-g.scrollTop)&&(g.scrollTop=k)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(g,Z,E){function I(){var D=Z(),k=[];h.a.D(g.getElementsByTagName("option"),function(O){O.selected&&k.push(h.w.M(O))}),h.m.eb(D,E,"selectedOptions",k)}function A(){var D=h.a.f(Z()),k=g.scrollTop;D&&typeof D.length=="number"&&h.a.D(g.getElementsByTagName("option"),function(O){var U=0<=h.a.A(D,h.w.M(O));O.selected!=U&&h.a.Zc(O,U)}),g.scrollTop=k}if(h.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;h.i.subscribe(g,h.i.H,function(){N?I():(h.a.B(g,"change",I),N=h.o(A,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(g,Z){var E=h.a.f(Z()||{});h.a.P(E,function(I,A){if(A=h.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(g).css(I,A);else if(/^--/.test(I))g.style.setProperty(I,A);else{I=I.replace(/-(\w)/g,function(D,k){return k.toUpperCase()});var N=g.style[I];g.style[I]=A,A===N||g.style[I]!=N||isNaN(A)||(g.style[I]=A+"px")}})}},h.c.submit={init:function(g,Z,E,I,A){if(typeof Z()!="function")throw Error("The value for a submit binding must be a function");h.a.B(g,"submit",function(N){var D,k=Z();try{D=k.call(A.$data,g)}finally{D!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,Z){h.a.Bb(g,Z())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var g=function(K){if(K)return parseFloat(K[1])},Z=t.navigator.userAgent,E,I,A,N,D;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(D=g(Z.match(/Edge\/([^ ]+)$/)))||g(Z.match(/Chrome\/([^ ]+)/))||(I=g(Z.match(/Version\/([^ ]+) Safari/)))||(A=g(Z.match(/Firefox\/([^ ]+)/)))||(N=h.a.W||g(Z.match(/MSIE ([^ ]+)/)))||(N=g(Z.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var k=h.a.g.Z(),O=h.a.g.Z(),U=function(K){var te=this.activeElement;(te=te&&h.a.g.get(te,O))&&te(K)},j=function(K,te){var z=K.ownerDocument;h.a.g.get(z,k)||(h.a.g.set(z,k,!0),h.a.B(z,"selectionchange",U)),h.a.g.set(K,O,te)};h.c.textInput={init:function(K,te,z){function q(Re,Ne){h.a.B(K,Re,Ne)}function ee(){var Re=h.a.f(te());(Re===null||Re===e)&&(Re=""),Te!==e&&Re===Te?h.a.setTimeout(ee,4):K.value!==Re&&(Xe=!0,K.value=Re,Xe=!1,ce=K.value)}function pe(){ye||(Te=K.value,ye=h.a.setTimeout(xe,4))}function xe(){clearTimeout(ye),Te=ye=e;var Re=K.value;ce!==Re&&(ce=Re,h.m.eb(te(),z,"textInput",Re))}var ce=K.value,ye,Te,Le=h.a.W==9?pe:xe,Xe=!1;N&&q("keypress",xe),11>N&&q("propertychange",function(Re){Xe||Re.propertyName!=="value"||Le(Re)}),N==8&&(q("keyup",xe),q("keydown",xe)),j&&(j(K,Le),q("dragend",pe)),(!N||9<=N)&&q("input",Le),5>I&&h.a.R(K)==="textarea"?(q("keydown",pe),q("paste",pe),q("cut",pe)):11>E?q("keydown",pe):4>A?(q("DOMAutoComplete",xe),q("dragdrop",xe),q("drop",xe)):D&&K.type==="number"&&q("keydown",pe),q("change",xe),q("blur",xe),h.o(ee,null,{l:K})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(K,te,z){z("textInput",K)}}}(),h.c.uniqueName={init:function(g,Z){if(Z()){var E="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(g,E)}}},h.c.uniqueName.rd=0,h.c.using={init:function(g,Z,E,I,A){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),Z=A.createChildContext(Z,N),h.Oa(Z,g),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(g,Z,E){var I=h.a.R(g),A=I=="input";if(!A||g.type!="checkbox"&&g.type!="radio"){var N=[],D=E.get("valueUpdate"),k=!1,O=null;D&&(typeof D=="string"?N=[D]:N=h.a.wc(D),h.a.Pa(N,"change"));var U=function(){O=null,k=!1;var te=Z(),z=h.w.M(g);h.m.eb(te,E,"value",z)};!h.a.W||!A||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||h.a.A(N,"propertychange")!=-1||(h.a.B(g,"propertychange",function(){k=!0}),h.a.B(g,"focus",function(){k=!1}),h.a.B(g,"blur",function(){k&&U()})),h.a.D(N,function(te){var z=U;h.a.Ud(te,"after")&&(z=function(){O=h.w.M(g),h.a.setTimeout(U,0)},te=te.substring(5)),h.a.B(g,te,z)});var j;if(j=A&&g.type=="file"?function(){var te=h.a.f(Z());te===null||te===e||te===""?g.value="":h.u.G(U)}:function(){var te=h.a.f(Z()),z=h.w.M(g);O!==null&&te===O?h.a.setTimeout(j,0):(te!==z||z===e)&&(I==="select"?(z=E.get("valueAllowUnset"),h.w.cb(g,te,z),z||te===h.w.M(g)||h.u.G(U)):h.w.cb(g,te))},I==="select"){var K;h.i.subscribe(g,h.i.H,function(){K?E.get("valueAllowUnset")?j():U():(h.a.B(g,"change",U),K=h.o(j,null,{l:g}))},null,{notifyImmediately:!0})}else h.a.B(g,"change",U),h.o(j,null,{l:g})}else h.ib(g,{checkedValue:Z})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(g,Z){var E=h.a.f(Z()),I=g.style.display!="none";E&&!I?g.style.display="":!E&&I&&(g.style.display="none")}},h.c.hidden={update:function(g,Z){h.c.visible.update(g,function(){return!h.a.f(Z())})}},function(g){h.c[g]={init:function(Z,E,I,A,N){return h.c.event.init.call(this,Z,function(){var D={};return D[g]=E(),D},I,A,N)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(g,Z){if(typeof g=="string"){Z=Z||n;var E=Z.getElementById(g);if(!E)throw Error("Cannot find template with ID "+g);return new h.C.F(E)}if(g.nodeType==1||g.nodeType==8)return new h.C.ia(g);throw Error("Unknown template type: "+g)},h.ca.prototype.renderTemplate=function(g,Z,E,I){return g=this.makeTemplateSource(g,I),this.renderTemplateSource(g,Z,E,I)},h.ca.prototype.isTemplateRewritten=function(g,Z){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,Z).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(g,Z,E){g=this.makeTemplateSource(g,E),Z=Z(g.text()),g.text(Z),g.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function g(I,A,N,D){I=h.m.ac(I);for(var k=h.m.Ra,O=0;O<I.length;O++){var U=I[O].key;if(Object.prototype.hasOwnProperty.call(k,U)){var j=k[U];if(typeof j=="function"){if(U=j(I[O].value))throw Error(U)}else if(!j)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(I,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",D.createJavaScriptEvaluatorBlock(N)+A}var Z=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,A,N){A.isTemplateRewritten(I,N)||A.rewriteTemplate(I,function(D){return h.kc.Ld(D,A)},N)},Ld:function(I,A){return I.replace(Z,function(N,D,k,O,U){return g(U,D,k,A)}).replace(E,function(N,D){return g(D,"<!-- ko -->","#comment",A)})},md:function(I,A){return h.aa.Xb(function(N,D){var k=N.nextSibling;k&&k.nodeName.toLowerCase()===A&&h.ib(k,I,D)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(E){if(this.F=E){var I=h.a.R(E);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&E.content&&E.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var I=arguments[0];E==="innerHTML"?h.a.fc(this.F,I):this.F[E]=I};var g=h.a.g.Z()+"_";h.C.F.prototype.data=function(E){if(arguments.length===1)return h.a.g.get(this.F,g+E);h.a.g.set(this.F,g+E,arguments[1])};var Z=h.a.g.Z();h.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var I=h.a.g.get(E,Z)||{},A=I.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!A||I.jd){var N=this.text();N&&N!==I.bb&&(A=h.a.Md(N,E.ownerDocument),h.a.g.set(E,Z,{lb:A,bb:N,jd:!0}))}return A}I=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(E,Z,{lb:I})},h.C.ia=function(E){this.F=E},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var E=h.a.g.get(this.F,Z)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}h.a.g.set(this.F,Z,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function g(O,U,j){var K;for(U=h.h.nextSibling(U);O&&(K=O)!==U;)O=h.h.nextSibling(K),j(K,O)}function Z(O,U){if(O.length){var j=O[0],K=O[O.length-1],te=j.parentNode,z=h.ga.instance,q=z.preprocessNode;if(q){if(g(j,K,function(ee,pe){var xe=ee.previousSibling,ce=q.call(z,ee);ce&&(ee===j&&(j=ce[0]||pe),ee===K&&(K=ce[ce.length-1]||xe))}),O.length=0,!j)return;j===K?O.push(j):(O.push(j,K),h.a.Ua(O,te))}g(j,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||h.vc(U,ee)}),g(j,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||h.aa.cd(ee,[U])}),h.a.Ua(O,te)}}function E(O){return O.nodeType?O:0<O.length?O[0]:null}function I(O,U,j,K,te){te=te||{};var z=(O&&E(O)||j||{}).ownerDocument,q=te.templateEngine||N;if(h.kc.xd(j,q,z),j=q.renderTemplate(j,K,te,z),typeof j.length!="number"||0<j.length&&typeof j[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,U){case"replaceChildren":h.h.va(O,j),z=!0;break;case"replaceNode":h.a.Xc(O,j),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return z&&(Z(j,K),te.afterRender&&h.u.G(te.afterRender,null,[j,K[te.as||"$data"]]),U=="replaceChildren"&&h.i.ma(O,h.i.H)),j}function A(O,U,j){return h.O(O)?O():typeof O=="function"?O(U,j):O}var N;h.gc=function(O){if(O!=e&&!(O instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=O},h.dc=function(O,U,j,K,te){if(j=j||{},(j.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var z=E(K);return h.$(function(){var ee=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),q=A(O,ee.$data,ee),ee=I(K,te,q,ee,j);te=="replaceNode"&&(K=ee,z=E(K))},null,{Sa:function(){return!z||!h.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return h.aa.Xb(function(q){h.dc(O,U,j,q,"replaceNode")})},h.Qd=function(O,U,j,K,te){function z(Te,Le){h.u.G(h.a.ec,null,[K,Te,ee,j,q,Le]),h.i.ma(K,h.i.H)}function q(Te,Le){Z(Le,pe),j.afterRender&&j.afterRender(Le,Te),pe=null}function ee(Te,Le){pe=te.createChildContext(Te,{as:xe,noChildContext:j.noChildContext,extend:function(Re){Re.$index=Le,xe&&(Re[xe+"Index"]=Le)}});var Xe=A(O,Te,pe);return I(K,"ignoreTargetNode",Xe,pe,j)}var pe,xe=j.as,ce=j.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!j.includeDestroyed;if(ce||j.beforeRemove||!h.Pc(U))return h.$(function(){var Te=h.a.f(U)||[];typeof Te.length>"u"&&(Te=[Te]),ce&&(Te=h.a.jb(Te,function(Le){return Le===e||Le===null||!h.a.f(Le._destroy)})),z(Te)},null,{l:K});z(U.v());var ye=U.subscribe(function(Te){z(U(),Te)},null,"arrayChange");return ye.l(K),ye};var D=h.a.g.Z(),k=h.a.g.Z();h.c.template={init:function(O,U){var j=h.a.f(U());if(typeof j=="string"||"name"in j)h.h.Ea(O);else if("nodes"in j){if(j=j.nodes||[],h.O(j))throw Error('The "nodes" option must be a plain, non-observable array.');var K=j[0]&&j[0].parentNode;K&&h.a.g.get(K,k)||(K=h.a.Yb(j),h.a.g.set(K,k,!0)),new h.C.ia(O).nodes(K)}else if(j=h.h.childNodes(O),0<j.length)K=h.a.Yb(j),new h.C.ia(O).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,U,j,K,te){var z=U();U=h.a.f(z),j=!0,K=null,typeof U=="string"?U={}:(z="name"in U?U.name:O,"if"in U&&(j=h.a.f(U.if)),j&&"ifnot"in U&&(j=!h.a.f(U.ifnot)),j&&!z&&(j=!1)),"foreach"in U?K=h.Qd(z,j&&U.foreach||[],U,O,te):j?(j=te,"data"in U&&(j=te.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),K=h.dc(z,j,U,O)):h.h.Ea(O),te=K,(U=h.a.g.get(O,D))&&typeof U.s=="function"&&U.s(),h.a.g.set(O,D,!te||te.ja&&!te.ja()?e:te)}},h.m.Ra.template=function(O){return O=h.m.ac(O),O.length==1&&O[0].unknown||h.m.Id(O,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(g,Z,E){if(g.length&&Z.length){var I,A,N,D,k;for(I=A=0;(!E||I<E)&&(D=g[A]);++A){for(N=0;k=Z[N];++N)if(D.value===k.value){D.moved=k.index,k.moved=D.index,Z.splice(N,1),I=N=0;break}I+=N}}},h.a.Pb=function(){function g(Z,E,I,A,N){var D=Math.min,k=Math.max,O=[],U,j=Z.length,K,te=E.length,z=te-j||1,q=j+te+1,ee,pe,xe;for(U=0;U<=j;U++)for(pe=ee,O.push(ee=[]),xe=D(te,U+z),K=k(0,U-1);K<=xe;K++)ee[K]=K?U?Z[U-1]===E[K-1]?pe[K-1]:D(pe[K]||q,ee[K-1]||q)+1:K+1:U+1;for(D=[],k=[],z=[],U=j,K=te;U||K;)te=O[U][K]-1,K&&te===O[U][K-1]?k.push(D[D.length]={status:I,value:E[--K],index:K}):U&&te===O[U-1][K]?z.push(D[D.length]={status:A,value:Z[--U],index:U}):(--K,--U,N.sparse||D.push({status:"retained",value:E[K]}));return h.a.Kc(z,k,!N.dontLimitMoves&&10*j),D.reverse()}return function(Z,E,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},Z=Z||[],E=E||[],Z.length<E.length?g(Z,E,"added","deleted",I):g(E,Z,"deleted","added",I)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function g(I,A,N,D,k){var O=[],U=h.$(function(){var j=A(N,k,h.a.Ua(O,I))||[];0<O.length&&(h.a.Xc(O,j),D&&h.u.G(D,null,[N,j,k])),O.length=0,h.a.Nb(O,j)},null,{l:I,Sa:function(){return!h.a.kd(O)}});return{Y:O,$:U.ja()?U:e}}var Z=h.a.g.Z(),E=h.a.g.Z();h.a.ec=function(I,A,N,D,k,O){function U($e){Xe={Aa:$e,pb:h.ta(pe++)},q.push(Xe),z||Le.push(Xe)}function j($e){Xe=te[$e],pe!==Xe.pb.v()&&Te.push(Xe),Xe.pb(pe++),h.a.Ua(Xe.Y,I),q.push(Xe)}function K($e,Kt){if($e)for(var ge=0,Ve=Kt.length;ge<Ve;ge++)h.a.D(Kt[ge].Y,function(Ht){$e(Ht,ge,Kt[ge].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),D=D||{};var te=h.a.g.get(I,Z),z=!te,q=[],ee=0,pe=0,xe=[],ce=[],ye=[],Te=[],Le=[],Xe,Re=0;if(z)h.a.D(A,U);else{if(!O||te&&te._countWaitingForRemove){var Ne=h.a.Mb(te,function($e){return $e.Aa});O=h.a.Pb(Ne,A,{dontLimitMoves:D.dontLimitMoves,sparse:!0})}for(var Ne=0,yt,Nt,pt;yt=O[Ne];Ne++)switch(Nt=yt.moved,pt=yt.index,yt.status){case"deleted":for(;ee<pt;)j(ee++);Nt===e&&(Xe=te[ee],Xe.$&&(Xe.$.s(),Xe.$=e),h.a.Ua(Xe.Y,I).length&&(D.beforeRemove&&(q.push(Xe),Re++,Xe.Aa===E?Xe=null:ye.push(Xe)),Xe&&xe.push.apply(xe,Xe.Y))),ee++;break;case"added":for(;pe<pt;)j(ee++);Nt!==e?(ce.push(q.length),j(Nt)):U(yt.value)}for(;pe<A.length;)j(ee++);q._countWaitingForRemove=Re}h.a.g.set(I,Z,q),K(D.beforeMove,Te),h.a.D(xe,D.beforeRemove?h.oa:h.removeNode);var Be,et,qe;try{qe=I.ownerDocument.activeElement}catch{}if(ce.length)for(;(Ne=ce.shift())!=e;){for(Xe=q[Ne],Be=e;Ne;)if((et=q[--Ne].Y)&&et.length){Be=et[et.length-1];break}for(A=0;ee=Xe.Y[A];Be=ee,A++)h.h.Wb(I,ee,Be)}for(Ne=0;Xe=q[Ne];Ne++){for(Xe.Y||h.a.extend(Xe,g(I,N,Xe.Aa,k,Xe.pb)),A=0;ee=Xe.Y[A];Be=ee,A++)h.h.Wb(I,ee,Be);!Xe.Ed&&k&&(k(Xe.Aa,Xe.Y,Xe.pb),Xe.Ed=!0,Be=Xe.Y[Xe.Y.length-1])}for(qe&&I.ownerDocument.activeElement!=qe&&qe.focus(),K(D.beforeRemove,ye),Ne=0;Ne<ye.length;++Ne)ye[Ne].Aa=E;K(D.afterMove,Te),K(D.afterAdd,Le)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(g,Z,E,I){return(Z=!(9>h.a.W)&&g.nodes?g.nodes():null)?h.a.la(Z.cloneNode(!0).childNodes):(g=g.text(),h.a.ua(g,I))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var Z=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(E,I,A,N){if(N=N||n,A=A||{},2>Z)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var D=E.data("precompiled");return D||(D=E.text()||"",D=o.template(null,"{{ko_with $item.koBindingContext}}"+D+"{{/ko_with}}"),E.data("precompiled",D)),E=[I.$data],I=o.extend({koBindingContext:I},A.templateOptions),I=o.tmpl(D,E,I),I.appendTo(N.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,I){n.write("<script type='text/html' id='"+E+"'>"+I+"<\/script>")},0<Z&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var g=new h.$a;0<g.Hd&&h.gc(g),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var rEt=ko;typeof window<"u"?(ko=window.ko,typeof W9<"u"?window.ko=W9:delete window.ko):(ko=global.ko,typeof W9<"u"?global.ko=W9:delete global.ko);var lC=rEt;var aFo=S(T(),1);/** - * @license - * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 - * Copyright (c) Steve Sanderson - * MIT license - */var _$="__knockoutObservables",S$="__knockoutSubscribable";function hLe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=pLe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===_$||o===S$)&&!(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&&aEt(n,a)}}),e}function pLe(e,t){var n=e[_$];return!n&&t&&(n={},Object.defineProperty(e,_$,{value:n})),n}function sEt(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),hLe.call(i,e,[t]),e}function aEt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=cEt(e,t,i))})}function cEt(e,t,n){var i=lEt(e,n);return i.subscribe(t)}function lEt(e,t){var n=t[S$];if(!n){n=new e.subscribable,Object.defineProperty(t,S$,{value:n});var i={};uEt(t,n,i),dEt(e,t,n,i)}return n}function uEt(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 dEt(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 bLe(e,t){if(!e)return null;var n=pLe(e,!1);return n&&n[t]||null}function mEt(e,t){var n=bLe(e,t);n&&n.valueHasMutated()}function fEt(e){e.track=hLe,e.getObservable=bLe,e.valueHasMutated=mEt,e.defineProperty=sEt}var I9={attachToKo:fEt};var lFo=S(T(),1),gLe="http://www.w3.org/2000/svg",yLe="cesium-svgPath-svg",hEt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(gLe,"svg:svg");i.setAttribute("class",yLe);let o=document.createElementNS(gLe,"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",`${yLe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},X9=hEt;I9.attachToKo(lC);X9.register(lC);var Ce=lC;function P9(e){l(e)||(e=new _f),this._clock=e,this._eventHelper=new Nr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(ne.now()),this.systemTime.equalityComparer=ne.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=ne.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=ne.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=ne.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(P9.prototype,{clock:{get:function(){return this._clock}}});P9.prototype.synchronize=function(){let e=this._clock;this.systemTime=ne.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};P9.prototype.isDestroyed=function(){return!1};P9.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var v9=P9;var SFo=S(T(),1);function pEt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var T$=pEt;var RFo=S(T(),1);function bEt(e,t){t=y(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,Ce.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=bEt;var IFo=S(T(),1);var w9={};w9.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};w9.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};w9.createRangeInput=function(e,t,n,i,o,r){r=y(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=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};w9.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 ic=w9;var vFo=S(T(),1);function gEt(e,t,n,i,o){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,o)}var Pa=gEt;var UFo=S(T(),1);function xLe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(xLe.prototype,{command:{get:function(){return this._command}}});var hx=xLe;var YFo=S(T(),1);var uC="http://www.w3.org/2000/svg",TLe="http://www.w3.org/1999/xlink",C3,F9=Y.fromCssColorString("rgba(247,250,255,0.384)"),V3=Y.fromCssColorString("rgba(143,191,255,0.216)"),C$=Y.fromCssColorString("rgba(153,197,255,0.098)"),L3=Y.fromCssColorString("rgba(255,255,255,0.086)"),yEt=Y.fromCssColorString("rgba(255,255,255,0.267)"),xEt=Y.fromCssColorString("rgba(255,255,255,0)"),_Le=Y.fromCssColorString("rgba(66,67,68,0.3)"),SLe=Y.fromCssColorString("rgba(0,0,0,0.5)");function px(e){return Y.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var A9={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 th(e){let t=document.createElementNS(uC,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(th(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(TLe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function V$(e,t,n){let i=document.createElementNS(uC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(uC,"tspan");return o.textContent=n,i.appendChild(o),i}function _Et(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Z3=new Y;function us(e,t){let n=t.alpha,i=1-n;return Z3.red=e.red*i+t.red*n,Z3.green=e.green*i+t.green*n,Z3.blue=e.blue*i+t.blue*n,Z3.toCssColorString()}function L$(e,t,n){let i=A9[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 th(o)}function SEt(e,t,n){let i=A9[n],o=A9.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 th(r)}function TEt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&C3!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let d=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=u-r-a.top,b=Math.atan2(p,m)*180/Math.PI+90;b>180&&(b-=360);let h=n.shuttleRingAngle;i||c<d.right&&c>d.left&&u>d.top&&u<d.bottom?(C3=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<h?n.slower():b>h&&n.faster(),t.preventDefault()}else e===C3&&(C3=void 0),n.shuttleRingDragging=!1}function Y0(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=[Pa(t,"toggled",this.setToggled,this),Pa(t,"tooltip",this.setTooltip,this),Pa(t.command,"canExecute",this.setEnabled,this)]}Y0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();de(this)};Y0.prototype.isDestroyed=function(){return!1};Y0.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")}};Y0.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")))};Y0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function EZ(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(uC,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",TLe);let s=document.createElementNS(uC,"g");this._topG=s,this._realtimeSVG=new Y0(SEt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Y0(L$(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Y0(L$(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Y0(L$(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(uC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=th({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=A9.animation_pathSwooshFX,d=A9.animation_pathPointer,m=th({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=th({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:d.tagName,d:d.d});let p=th({tagName:"g",transform:"translate(100,100)"});this._knobOuter=th({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let b=61,h=th({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:b});this._knobDate=V$(0,-24,""),this._knobTime=V$(0,-7,""),this._knobStatus=V$(0,-41,"");let x=th({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:b}),_=document.createElementNS(uC,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(m),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(w){TEt(C,w)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),m.addEventListener("mousedown",V,!0),m.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],R=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],W;this._subscriptions=[Pa(t.pauseViewModel,"toggled",function(w){W!==w&&(W=w,W?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Pa(t,"shuttleRingAngle",function(w){_Et(C._shuttleRingPointer,C._knobOuter,w)}),Pa(t,"dateLabel",function(w){R.textContent!==w&&(R.textContent=w)}),Pa(t,"timeLabel",function(w){L.textContent!==w&&(L.textContent=w)}),Pa(t,"multiplierLabel",function(w){G.textContent!==w&&(G.textContent=w)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(EZ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EZ.prototype.isDestroyed=function(){return!1};EZ.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return de(this)};EZ.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};EZ.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let d=this;d._observer=new MutationObserver(function(){e.body.contains(d._container)&&(d._observer.disconnect(),d._observer=void 0,d.applyThemeChanges())}),d._observer.observe(e,{childList:!0,subtree:!0});return}let t=px(this._themeNormal),n=px(this._themeHover),i=px(this._themeSelect),o=px(this._themeDisabled),r=px(this._themeKnob),s=px(this._themePointer),a=px(this._themeSwoosh),c=px(this._themeSwooshHover),u=th({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,F9)},{tagName:"stop",offset:"12%","stop-color":us(t,V3)},{tagName:"stop",offset:"46%","stop-color":us(t,C$)},{tagName:"stop",offset:"81%","stop-color":us(t,L3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(n,F9)},{tagName:"stop",offset:"12%","stop-color":us(n,V3)},{tagName:"stop",offset:"46%","stop-color":us(n,C$)},{tagName:"stop",offset:"81%","stop-color":us(n,L3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(i,F9)},{tagName:"stop",offset:"12%","stop-color":us(i,V3)},{tagName:"stop",offset:"46%","stop-color":us(i,C$)},{tagName:"stop",offset:"81%","stop-color":us(i,L3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":us(o,yEt)},{tagName:"stop",offset:"75%","stop-color":us(o,xEt)}]},{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,SLe)},{tagName:"stop",offset:"100%","stop-color":us(s,SLe)}]},{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,F9)},{tagName:"stop",offset:"60%","stop-color":us(r,_Le)},{tagName:"stop",offset:"85%","stop-color":us(r,V3)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":us(r,_Le)},{tagName:"stop",offset:"60%","stop-color":us(r,F9)},{tagName:"stop",offset:"85%","stop-color":us(r,L3)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var M9=EZ;var $Fo=S(T(),1);var CEt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bx=15,WZ=105;function CLe(e,t){return e-t}function Z$(e,t){let n=wo(t,e,CLe);return n<0?~n:n}function VEt(e,t){if(Math.abs(e)<=bx)return e/bx;let n=bx,i=WZ,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 LEt(e,t,n){if(n.clockStep===xo.SYSTEM_CLOCK)return bx;if(Math.abs(e)<=1)return e*bx;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=bx,r=WZ,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 Wm(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Wm.defaultDateFormatter,this._timeFormatter=Wm.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Wm.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===xo.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,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return LEt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,WZ),-WZ);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=xo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===WZ){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=VEt(s,a);if(t.snapToTicks)u=a[Z$(u,a)];else if(u!==0){let d=Math.abs(u);if(d>100){let m=d.toFixed(0).length-2,p=Math.pow(10,m);u=Math.round(u/p)*p|0}else d>bx?u=Math.round(u):d>1?u=+u.toFixed(1):d>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Or.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,d=s.startTime,m=!1;if(a===Or.LOOP_STOP)m=ne.greaterThan(u,d)||u.equals(d)&&c>0;else{let p=s.stopTime;m=ne.greaterThan(u,d)&&ne.lessThan(u,p)||u.equals(d)&&c>0||u.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Or.UNBOUNDED)return!0;let c=s.systemTime;return ne.greaterThanOrEquals(c,s.startTime)&&ne.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new hx(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new hx(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new hx(o,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==xo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=xo.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new hx(r,{toggled:Ce.computed(function(){return e.clockStep===xo.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Z$(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Z$(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Wm.defaultDateFormatter=function(e,t){let n=ne.toGregorianDate(e);return`${CEt[n.month-1]} ${n.day} ${n.year}`};Wm.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];Wm.defaultTimeFormatter=function(e,t){let n=ne.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`};Wm.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Wm.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(CLe);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(Wm.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}}});Wm._maxShuttleRingAngle=WZ;Wm._realtimeShuttleRingAngle=bx;var N9=Wm;var fAo=S(T(),1);var rAo=S(T(),1);function ZEt(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 R$(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var REt=new yn,GEt=new f;function U9(e,t){let n=this,i=e.canvas,o=new cd(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="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new E0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new jM({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let u=n.depthFrustum+1;return n.depthFrustum=R$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=R$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new b9({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let d=n._scene.pick({x:u.position.x,y:u.position.y});l(d)&&(n.primitive=l(d.collection)?d.collection:d.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Ln.LEFT_CLICK):o.removeInputAction(Ln.LEFT_CLICK)});function c(u){let d,m=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,REt),b=r.pick(p,n._scene,GEt);if(l(b)){let h=m.cartesianToCartographic(b),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!d&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!d&&V<C.length;++V){let L=C[V];le.contains(L.rectangle,h)&&(d=L)}}}n.tile=d,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Ln.LEFT_CLICK):o.removeInputAction(Ln.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(U9.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,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}}});U9.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ZEt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=R$(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}`};U9.prototype.isDestroyed=function(){return!1};U9.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),de(this)};var k9=U9;function R3(e,t){e=Pn(e);let n=document.createElement("div"),i=new k9(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=ic.createSection,c=ic.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),d=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),d.appendChild(m),u.appendChild(d),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let b=document.createElement("div");u.appendChild(b);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(h);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(R),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let W=a(s,"Terrain","terrainVisible","toggleTerrain"),w=document.createElement("div");w.className="cesium-cesiumInspector-pickSection",W.appendChild(w);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(P),G.className="cesium-cesiumInspector-center",w.appendChild(G);let F=document.createElement("div");w.appendChild(F);let M=document.createElement("input");M.type="button",M.value="Parent",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.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 A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",F.className="cesium-cesiumInspector-frustumStatistics",F.appendChild(A),F.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",F.appendChild(N);let D=document.createElement("table"),k=document.createElement("tr"),O=document.createElement("tr"),U=document.createElement("td");U.appendChild(M);let j=document.createElement("td");j.appendChild(g);let K=document.createElement("td");K.appendChild(Z),k.appendChild(U),k.appendChild(j),k.appendChild(K);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(E);let q=document.createElement("td");q.appendChild(I),O.appendChild(te),O.appendChild(z),O.appendChild(q),D.appendChild(k),D.appendChild(O),F.appendChild(D),w.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),w.appendChild(c("Show only selected","filterTile","hasPickedTile")),W.appendChild(c("Wireframe","wireframe")),W.appendChild(c("Suspend LOD update","suspendUpdates")),W.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}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 Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var D9=R3;var ZAo=S(T(),1);var xAo=S(T(),1);function VLe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ce.getObservable(this,"imageryProviderViewModels"),r=Ce.pureComputed(function(){let m=o(),p={},b;for(b=0;b<m.length;b++){let _=m[b],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let h=Object.keys(p),x=[];for(b=0;b<h.length;b++){let _=h[b];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let m=s(),p={},b;for(b=0;b<m.length;b++){let _=m[b],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let h=Object.keys(p),x=[];for(b=0;b<h.length;b++){let _=h[b];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,b=l(m)?m.name:void 0,h=l(p)?p.name:void 0;return l(b)&&l(h)?`${b} -${h}`:l(b)?b:h}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,b=this._currentImageryLayers,h=b.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<h;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===b[p]){x.remove(L),_=!0;break}}}if(l(m)){let C=m.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=Ra.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=Ra.fromProviderAsync(C);if(V.name=m.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(m){if(u()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof op),this._globe.terrainProvider=p;else if(l(p)){let b=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{b=!0,h()}),_=new h9(p).readyEvent.addEventListener(C=>{b||(this._globe.depthTestAgainstTerrain=!(C instanceof op),this._globe.terrainProvider=C,_())})}u(m),this.dropDownVisible=!1}});let d=this;this._toggleDropDown=Rn(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(VLe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var B9=VLe;function G3(e,t){e=Pn(e);let n=new B9(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: providers"),c.appendChild(d);let m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),d.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let b=document.createElement("div");b.className="cesium-baseLayerPicker-itemLabel",b.setAttribute("data-bind","text: name"),m.appendChild(b);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",r.appendChild(h);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let R=document.createElement("img");R.className="cesium-baseLayerPicker-itemIcon",R.setAttribute("data-bind","attr: { src: iconUrl }"),R.setAttribute("draggable","false"),L.appendChild(R);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Ce.applyBindings(n,i),Ce.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(W){i.contains(W.target)||r.contains(W.target)||(n.dropDownVisible=!1)},At.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 At.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),de(this)};var O9=G3;var FAo=S(T(),1);var XAo=S(T(),1);function LLe(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(LLe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=LLe;function EEt(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:an("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Z0({style:L0.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:an("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Z0({style:L0.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:an("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Z0({style:L0.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:an("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 C0.fromBasemapType(Yf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:an("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 C0.fromBasemapType(Yf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:an("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 C0.fromBasemapType(Yf.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:an("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 U0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:an("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 U0({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:an("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 U0({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:an("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 U0({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:an("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 U0({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:an("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 V0.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:an("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return V0.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:an("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 V0.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:an("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Qy.fromUrl(an("Assets/Textures/NaturalEarthII"))}})),e}var Y9=EEt;var UAo=S(T(),1);function WEt(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:an("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new op({ellipsoid:ie.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:an("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 nT({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var K9=WEt;var qAo=S(T(),1);var YAo=S(T(),1);function IEt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof xa&&(e.tileset=n.primitive),e.pickActive=!1}}function RLe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof xa&&(e.tileset=i.primitive)},Ln.MOUSE_MOVE):(e._eventHandler.removeInputAction(Ln.MOUSE_MOVE),e.picking=e.picking)}var XEt={maximumFractionDigits:3};function z9(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,XEt):Math.round(t).toLocaleString()}function H9(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[No.PICK]:e._statisticsPerPass[No.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>${z9(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${z9(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${z9(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function GLe(){let e=Ki.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${z9(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${z9(e.texturesByteLength)}</li> - </ul> - `}var PEt=[{text:"Highlight",value:Bl.HIGHLIGHT},{text:"Replace",value:Bl.REPLACE},{text:"Mix",value:Bl.MIX}],ZLe=new Y(1,1,0,.4),vEt=new Y,E3=new Y;function va(e,t){let n=this,i=e.canvas;this._eventHandler=new cd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new E0({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,Ce.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=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let U=[],j=n._properties();for(let K in j)j.hasOwnProperty(K)&&U.push(K);return U});let o=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),l(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Bl.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(j){let K=e.pick(j.endPosition);if(K instanceof Ys?(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(j.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Ln.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Ln.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),l(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),l(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let d=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return d()},set:function(U){d(U),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(U){m(U),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(U){b(U),l(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),l(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(U){x(U),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(U){_(U),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),l(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let V=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(U){U=Number(U),isNaN(U)||(V(U),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let L=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(U){let j=Math.pow(U,6);L(j),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=j)}});let R=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let G=IEt(this),W=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return W()},set:function(U){W(U),U?n._eventHandler.setInputAction(G,Ln.LEFT_CLICK):n._eventHandler.removeInputAction(Ln.LEFT_CLICK)}});let w=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return w()},set:function(U){w(U),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let P=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(U){U=Number(U),isNaN(U)||(P(U),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let F=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let M=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return M()},set:function(U){U=Number(U),isNaN(U)||(M(U),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let g=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(U){g(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let Z=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return Z()},set:function(U){U=Number(U),isNaN(U)||(Z(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let E=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),l(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let A=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let N=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),l(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let D=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),l(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let k=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(U){k(U),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(U){O(U),l(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||RLe(this,!0)}Object.defineProperties(va.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 PEt}},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=H9(e,!1),this._pickStatisticsText=H9(e,!0),this._resourceCacheStatisticsText=GLe(),RLe(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,vEt):Y.WHITE:t.color=E3,this._scene.requestRender()),l(e)&&(Y.clone(e.color,E3),e.color=ZLe,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()&&!G$(t.content)&&(t.color=E3,this._scene.requestRender()),l(e)&&!G$(e.content)&&(Y.clone(e.color,E3),e.color=ZLe,this._scene.requestRender()),this._tile=e}}});function G$(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(!G$(t[i]))return!1;return!0}return!1}va.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};va.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};va.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};va.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};va.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};va.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};va.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};va.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};va.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};va.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};va.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 kT(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};va.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let d=a.join(` -`);n.value=n.value.slice(0,i)+d+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};va.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=H9(e,!1),this._pickStatisticsText=H9(e,!0),this._resourceCacheStatisticsText=GLe())};va.prototype.isDestroyed=function(){return!1};va.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),de(this)};va.getStatistics=H9;var J9=va;function W3(e,t){e=Pn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new J9(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=ic.createSection,c=ic.createCheckbox,u=ic.createRangeInput,d=ic.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),b=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let R=document.createElement("div");R.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(R),m.appendChild(V),m.appendChild(d("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(d("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),W=document.createElement("p");W.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),W.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),W.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(W),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let w=document.createElement("div");w.setAttribute("data-bind","visible: pointCloudShading"),w.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),w.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),w.appendChild(u("Base Resolution","baseResolution",0,1,.01)),w.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(w);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),w.appendChild(P),b.appendChild(c("Freeze Frame","freezeFrame")),b.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let F=document.createElement("div");F.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),b.appendChild(F);let M=document.createElement("div");M.setAttribute("data-bind","visible: dynamicScreenSpaceError"),M.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),M.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),b.appendChild(M),h.appendChild(c("Performance","performance")),h.appendChild(i),h.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(g),h.appendChild(c("Pick Statistics","showPickStatistics"));let Z=document.createElement("div");Z.className="cesium-3dTilesInspector-statistics",Z.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(Z),h.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(E);let I=document.createElement("div");_.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(A);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(N);let D=d("Compile (Ctrl+Enter)","compileStyle");I.appendChild(D);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),I.appendChild(k),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let O=document.createElement("div");O.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(O);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let j=document.createElement("div");j.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(j),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(o,n)}Object.defineProperties(W3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});W3.prototype.isDestroyed=function(){return!1};W3.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var Q9=W3;var dMo=S(T(),1);var oMo=S(T(),1);var ELe=1e3;function Im(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new nF({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=ILe,this._handleArrowUp=WLe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let o=Ce.getObservable(t,"_suggestions")().length>0,r=Ce.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=y(i,Oy.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)UEt(t);else return MEt(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?WLe(t):r?ILe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;vLe(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=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Im.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Im._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Im.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}}});Im.prototype.destroy=function(){this._suggestionSubscription.dispose()};function WLe(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],Im._adjustSuggestionsScroll(e,n)}function ILe(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],Im._adjustSuggestionsScroll(e,i)}function wEt(e,t){let n=l(t)?t.availability:void 0;return l(n)?cT(t,[e]).then(function(i){return e=i[0],e.height+=ELe,e}):(e.height+=ELe,Promise.resolve(e))}function FEt(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=BT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=wEt(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:v.IDENTITY})})}async function AEt(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 MEt(e,t,n){let i=e._searchText;if(PLe(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 AEt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,W$(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=XLe(e,CL.getCreditsFromResult(s[0]));l(a)||E$(e,t[o].credit);return}e._searchText=`${i} (not found)`}function E$(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function XLe(e,t){return l(t)&&t.forEach(n=>E$(e,n)),t}function W$(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function NEt(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 UEt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function PLe(e){return/^\s*$/.test(e)}function vLe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function kEt(e){if(!e.autoComplete)return;let t=e._searchText;if(vLe(e),W$(e),!PLe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Oy.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=CL.getCreditsFromResult(r);o=o&&!l(s),XLe(e,s)}),o&&E$(e,n.credit)}if(e._suggestions.length>=5)return}}Im.flyToDestination=FEt;Im._updateSearchSuggestions=kEt;Im._adjustSuggestionsScroll=NEt;Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return W$(this),de(this)};var j9=Im;var DEt="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",BEt="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 I3(e){let t=Pn(e.container),n=new j9(e);n._startSearchPath=DEt,n._stopSearchPath=BEt;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),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let d=u.target;typeof u.composedPath=="function"&&(d=u.composedPath()[0]),t.contains(d)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},At.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(I3.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});I3.prototype.isDestroyed=function(){return!1};I3.prototype.destroy=function(){let e=this._container;return At.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(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),de(this)};var q9=I3;var TMo=S(T(),1);var pMo=S(T(),1);function wLe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(wLe.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 $9=wLe;function X3(e,t,n){e=Pn(e);let i=new $9(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),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}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 Ce.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var eN=X3;var wMo=S(T(),1);var GMo=S(T(),1);function P3(e,t){l(t)||(t=document.body),t=Pn(t);let n=this,i=Ce.observable(_r.fullscreen),o=Ce.observable(_r.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&_r.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){_r.fullscreen?_r.exitFullscreen():_r.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Pn(e),r.body),this._callback=function(){i(_r.fullscreen)},r.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(P3.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});P3.prototype.isDestroyed=function(){return!1};P3.prototype.destroy=function(){document.removeEventListener(_r.changeEventName,this._callback),de(this)};var tN=P3;var OEt="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",YEt="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 v3(e,t){e=Pn(e);let n=new tN(t,e);n._exitFullScreenPath=YEt,n._enterFullScreenPath=OEt;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),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}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 this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var nN=v3;var YMo=S(T(),1);var NMo=S(T(),1);function KEt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function ALe(e,t){Ce.track(e);for(let n=0;n<e.sublayers.length;n++)ALe(e.sublayers[n],t)}function w3(e){return e.modelName==="FullModel"}function MLe(e){return e.modelName==="Overview"}function NLe(e){return MLe(e)||w3(e)}function FLe(e,t){if(NLe(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:Ce.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function zEt(e,t){if(NLe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");w3(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function HEt(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 JEt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ce.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ce.observable(!0),index:-1}],currentLayer:Ce.observable(),expandClickHandler:KEt,setOptionDisable:function(i,o){Ce.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){zEt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){ALe(n[i],this.viewModel);let o=FLe(n[i],this.viewModel);l(o)&&(MLe(o)||!l(this.viewModel.defaultLayer)&&w3(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=FLe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=w3(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return HEt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var iN=JEt;function QEt(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 iN(t);Ce.track(o),Ce.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var I$=QEt;var n9o=S(T(),1);var JMo=S(T(),1);var jEt="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",qEt="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 X$(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.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,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?qEt:jEt}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}X$.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(X$.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var oN=X$;function F3(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 oN;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=an("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let d=c.createElement("div");d.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(d),a._descriptionSubscription=Pa(s,"description",function(m){r.style.height="5px",d.innerHTML=m;let p=null,b=d.firstElementChild;if(b!==null&&d.childNodes.length===1){let x=window.getComputedStyle(b);if(x!==null){let _=x["background-color"],C=Y.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let h=d.getBoundingClientRect().height;r.style.height=`${h}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(F3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});F3.prototype.isDestroyed=function(){return!1};F3.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var rN=F3;var f9o=S(T(),1);var s9o=S(T(),1);function ULe(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(ULe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var sN=ULe;function A3(e){let t=Pn(e.container),n=new sN,i=y(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=an("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let d=document.createElement("img");d.src=an("Widgets/Images/NavigationHelp/Touch.svg"),d.className="cesium-navigation-button-icon",d.style.width="25px",d.style.height="25px",u.appendChild(d),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${an("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="${an("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="${an("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(m);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="${an("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="${an("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="${an("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="${an("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),Ce.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(b){o.contains(b.target)||(n.showInstructions=!1)},At.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(A3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});A3.prototype.isDestroyed=function(){return!1};A3.prototype.destroy=function(){return At.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var aN=A3;var R9o=S(T(),1);var _9o=S(T(),1);function P$(e){this._scene=e.scene,this.lowFrameRateMessage=y(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,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=e9.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(P$.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});P$.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var cN=P$;function M3(e){let t=Pn(e.container),n=new cN(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),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}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(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var lN=M3;var U9o=S(T(),1);var P9o=S(T(),1);function N3(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,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Nr,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=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(N3.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}}});N3.prototype.isDestroyed=function(){return!1};N3.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var uN=N3;var $Et="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",eWt="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 U3(e,t){e=Pn(e);let n=new uN(t);n._perspectivePath=$Et,n._orthographicPath=eWt;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),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},At.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}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 this._viewModel.destroy(),At.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var dN=U3;var eNo=S(T(),1);var z9o=S(T(),1);function k3(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Nr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(k3.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}}});k3.prototype.isDestroyed=function(){return!1};k3.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var mN=k3;var tWt="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",nWt="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",iWt="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 D3(e,t,n){e=Pn(e);let i=new mN(t,n);i._globePath=tWt,i._flatMapPath=nWt,i._columbusViewPath=iWt;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),Ce.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},At.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(D3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});D3.prototype.isDestroyed=function(){return!1};D3.prototype.destroy=function(){return this._viewModel.destroy(),At.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var fN=D3;var mNo=S(T(),1);var rNo=S(T(),1);var oWt=new B,B3="-1000px";function hN(e,t,n){this._scene=e,this._screenPositionX=B3,this._screenPositionY=B3,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return zi.worldToWindowCoordinates(e,i,o)}}hN.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,oWt);if(!l(e))this._screenPositionX=B3,this._screenPositionY=B3;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`}}};hN.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};hN.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};Object.defineProperties(hN.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var pN=hN;function O3(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 pN(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(O3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});O3.prototype.isDestroyed=function(){return!1};O3.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),de(this)};var bN=O3;var VNo=S(T(),1);var pNo=S(T(),1);function dC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}dC.prototype.getHeight=function(){return this._height};dC.prototype.getBase=function(){return this._base};dC.prototype.getStartTime=function(){return this._start};dC.prototype.getStopTime=function(){return this._stop};dC.prototype.setRange=function(e,t){this._start=e,this._stop=t};dC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ne.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=ne.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 gN=dC;var yNo=S(T(),1);function kLe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new Y(.5,.5,.5,1),this.backgroundColor=i||new Y(0,0,0,0)}kLe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=ne.addSeconds(t.startJulian,t.duration,new ne);if(ne.lessThan(n,o)&&ne.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ne.lessThanOrEquals(n,r)&&ne.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=ne.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ne);!l(a)&&ne.greaterThanOrEquals(u,n)?a=s:!l(c)&&ne.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var yN=kLe;var v$=1e12,Xm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Xl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},gx=[.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],rWt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Pl(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=sWt(this),this._onMouseUp=aWt(this),this._onMouseMove=cWt(this),this._onMouseWheel=lWt(this),this._onTouchStart=uWt(this),this._onTouchMove=mWt(this),this._onTouchEnd=dWt(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()}Pl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Pl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Pl.prototype.isDestroyed=function(){return!1};Pl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),de(this)};Pl.prototype.addHighlightRange=function(e,t,n){let i=new gN(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Pl.prototype.addTrack=function(e,t,n,i){let o=new yN(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Pl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ne.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Or.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=ne.secondsDifference(o,i),s=ne.secondsDifference(i,this._startJulian),a=ne.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ne.addSeconds(this._endJulian,s,new ne),this._startJulian=i,this._timeBarSecondsSpan=ne.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ne.addSeconds(this._startJulian,a,new ne),this._endJulian=o,this._timeBarSecondsSpan=ne.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)};Pl.prototype.zoomFrom=function(e){let t=ne.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(ne.addSeconds(this._startJulian,t-t*e,new ne),ne.addSeconds(this._endJulian,n*e-n,new ne))};function w$(e){return e<10?`0${e.toString()}`:e.toString()}Pl.prototype.makeLabel=function(e){let t=ne.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`${rWt[t.month-1]} ${t.day} ${t.year} ${w$(t.hour)}:${w$(t.minute)}:${w$(t.second)}${i}`};Pl.prototype.smallestTicInPixels=7;Pl.prototype._makeTics=function(){let e=this._timeBarEle,t=ne.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,d=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=ne.addSeconds(this._startJulian,a,new ne)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=ne.addSeconds(this._startJulian,c,new ne));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let b=this._startJulian,h=Math.min(m/p*1e-5,.4),x,_=ne.toGregorianDate(b);m>31536e4?x=ne.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?x=ne.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?x=ne.fromDate(new Date(Date.UTC(_.year,0))):x=ne.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=ne.secondsDifference(this._startJulian,ne.addSeconds(x,h,new ne)),V=C+m;this._epochJulian=x;function L(U){return Math.floor(C/U)*U}function R(U,j){return Math.ceil(U/j+.5)*j}function G(U){return(U-C)/m}function W(U,j){return U-j*Math.round(U/j)}this._rulerEle.innerHTML=this.makeLabel(ne.addSeconds(this._endJulian,-a,new ne));let w=this._rulerEle.offsetWidth+20;w<30&&(w=180);let P=d;d-=u;let F={startTime:C,startJulian:b,epochJulian:x,duration:m,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(U){s+=U.render(F)});let M=0,g=0,Z=0,E=w/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let I=-1,A=-1,N=gx.length,D;for(D=0;D<N;++D){let U=gx[D];if(++I,M=U,U>E&&U>d)break;A<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=I)}if(I>0){for(;I>0;)if(--I,Math.abs(W(M,gx[I]))<1e-5){gx[I]>=d&&(g=gx[I]);break}if(A>=0)for(;A<I;){if(Math.abs(W(g,gx[A]))<1e-5&&gx[A]>=d){Z=gx[A];break}++A}}d=P,d>u&&Z<1e-5&&Math.abs(d-M)>u&&(Z=d,d<=M+u&&(g=0));let k=-999999,O;if(p*(Z/this._timeBarSecondsSpan)>=3)for(o=L(Z);o<=V;o=R(o,Z))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=L(g);o<=V;o=R(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(M/this._timeBarSecondsSpan)>=2){this._mainTicSpan=M,V+=M,o=L(M);let U=ne.computeTaiMinusUtc(x);for(;o<=V;){let j=ne.addSeconds(b,o-C,new ne);if(M>2.1){let q=ne.computeTaiMinusUtc(j);Math.abs(q-U)>.1&&(o+=q-U,j=ne.addSeconds(b,o-C,new ne))}let K=Math.round(p*G(o)),te=this.makeLabel(j);this._rulerEle.innerHTML=te,O=this._rulerEle.offsetWidth,O<10&&(O=w);let z=K-(O/2-1);z>k?(k=z+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=R(o,M)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),F.y=0,this._trackList.forEach(function(U){U.render(r._context,F),F.y+=U.height})};Pl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=ne.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(ne.addSeconds(this._startJulian,this._timelineDrag,new ne),ne.addSeconds(this._endJulian,this._timelineDrag,new ne)))};Pl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ne.addSeconds(this._startJulian,t,new ne),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 sWt(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 aWt(e){return function(t){e._mouseMode=Xm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function cWt(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(ne.addSeconds(e._startJulian,i,new ne),ne.addSeconds(e._endJulian,i,new ne))}}else e._mouseMode===Xm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function lWt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;v$=Math.max(Math.min(Math.abs(n),v$),1),n/=v$,e.zoomFrom(Math.pow(1.05,-n))}}function uWt(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=ne.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 dWt(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 mWt(e){return function(t){let n,i,o,r,s,a,c=1,u=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-u,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-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=ne.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new ne)):(n=e._touchState.centerX-r,a=ne.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ne)),e.zoomTo(a,ne.addSeconds(a,e._timeBarSecondsSpan*c,new ne)),e._touchState.centerX=r,e._touchState.spanX=s))}}Pl.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 xN=Pl;var l5o=S(T(),1);var kNo=S(T(),1);var vNo=S(T(),1);var KLe=S(YLe(),1);function pWt(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 zLe(){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 bWt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(zLe(),e._locked=!1),e._noSleep.disable(),_r.exitFullscreen(),n(!1)):(_r.fullscreen||_r.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=pWt("landscape")),t.useWebVR=!0,n(!0)))}function Y3(e,t){let n=this,i=Ce.observable(_r.enabled),o=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&_r.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Nr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof un)}),this._locked=!1,this._noSleep=new KLe.default,this._command=Rn(function(){bWt(n,e,o,r)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(Pn(t),document.body),this._callback=function(){!_r.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(zLe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(Y3.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});Y3.prototype.isDestroyed=function(){return!1};Y3.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(_r.changeEventName,this._callback),de(this)};var _N=Y3;var gWt="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",yWt="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 _N(t,n);i._exitVRPath=yWt,i._enterVRPath=gWt;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),Ce.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(),Ce.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var SN=K3;var yx=new ae;function QLe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function xWt(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 _Wt(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 HLe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof ir)return i;if(n instanceof Ys)return new ir({name:_Wt(n),description:xWt(n),feature:n})}if(l(e.scene.globe))return CWt(e,t.position)}var SWt=new ne;function jLe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let o=i.startTime,r=i.stopTime;ne.equals(o,r)&&(r=ne.addSeconds(o,X.EPSILON2,SWt)),e.updateFromClock(),e.zoomTo(o,r)}}}var TWt=new f;function CWt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new ir({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=JLe();return}let a=s[0],c=new ir({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,TWt);c.position=new ol(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=JLe())}),r}function JLe(){return new ir({id:"None",description:"No features found."})}function VWt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,d=e._infoBox,m=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(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),l(m)&&(m.container.style.visibility=p),e._container){let b=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${b}px`,e.forceResize()}}function Mi(e,t){e=Pn(e),t=y(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=y(t.scene3DOnly,!1),c,u,d=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new _f,u=new v9(c),d=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let m=new BM(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,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,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=t.dataSources,b=!1;l(p)||(p=new uv,b=!0);let h=m.scene,x=new Hv({scene:h,dataSourceCollection:p}),_=new Nr;_.add(c.onTick,Mi.prototype._onTick,this),_.add(h.morphStart,Mi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(K),C=new bN(K,h)}let V;if(!l(t.infoBox)||t.infoBox!==!1){let K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",o.appendChild(K),V=new rN(K);let te=V.viewModel;_.add(te.cameraClicked,Mi.prototype._onInfoBoxCameraClicked,this),_.add(te.closeClicked,Mi.prototype._onInfoBoxClockClicked,this)}let L=document.createElement("div");L.className="cesium-viewer-toolbar",o.appendChild(L);let R;if(!l(t.geocoder)||t.geocoder!==!1){let K=document.createElement("div");K.className="cesium-viewer-geocoderContainer",L.appendChild(K);let te;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(te=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),R=new q9({container:K,geocoderServices:te,scene:h}),_.add(R.viewModel.search.beforeExecute,Mi.prototype._clearObjects,this)}let G;(!l(t.homeButton)||t.homeButton!==!1)&&(G=new eN(L,h),l(R)&&_.add(G.viewModel.command.afterExecute,function(){let K=R.viewModel;K.searchText="",K.isSearchInProgress&&K.search()}),_.add(G.viewModel.command.beforeExecute,Mi.prototype._clearTrackedObject,this));let W;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(W=new fN(L,h));let w;t.projectionPicker&&(w=new dN(L,h));let P,F;if(n){let K=y(t.imageryProviderViewModels,Y9()),te=y(t.terrainProviderViewModels,K9());P=new O9(L,{globe:h.globe,imageryProviderViewModels:K,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:te,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),F=L.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(P.viewModel.selectedImagery=void 0),h.imageryLayers.removeAll(),h.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(P.viewModel.selectedTerrain=void 0),h.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(h.globe.depthTestAgainstTerrain=!0),h.setTerrain(t.terrain));let M;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let K=!0;try{if(l(window.localStorage)){let te=window.localStorage.getItem("cesium-hasSeenNavHelp");l(te)&&te?K=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new aN({container:L,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,K)})}let g;if(!l(t.animation)||t.animation!==!1){let K=document.createElement("div");K.className="cesium-viewer-animationContainer",o.appendChild(K),g=new M9(K,new N9(u))}let Z;if(!l(t.timeline)||t.timeline!==!1){let K=document.createElement("div");K.className="cesium-viewer-timelineContainer",o.appendChild(K),Z=new xN(K,c),Z.addEventListener("settime",QLe,!1),Z.zoomTo(c.startTime,c.stopTime)}let E,I,A;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(A=document.createElement("div"),A.className="cesium-viewer-fullscreenContainer",o.appendChild(A),E=new nN(A,t.fullscreenElement),I=Pa(E.viewModel,"isFullscreenEnabled",function(K){A.style.display=K?"block":"none",l(Z)&&(Z.container.style.right=`${A.clientWidth}px`,Z.resize())}));let N,D,k;if(t.vrButton){let K=document.createElement("div");K.className="cesium-viewer-vrContainer",o.appendChild(K),N=new SN(K,h,t.fullScreenElement),D=Pa(N.viewModel,"isVREnabled",function(te){K.style.display=te?"block":"none",l(E)&&(K.style.right=`${A.clientWidth}px`),l(Z)&&(Z.container.style.right=`${K.clientWidth}px`,Z.resize())}),k=Pa(N.viewModel,"isVRMode",function(te){VWt(i,te)})}this._baseLayerPickerDropDown=F,this._fullscreenSubscription=I,this._vrSubscription=D,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=C,this._infoBox=V,this._dataSourceCollection=p,this._destroyDataSourceCollection=b,this._dataSourceDisplay=x,this._clockViewModel=u,this._destroyClockViewModel=d,this._toolbar=L,this._homeButton=G,this._sceneModePicker=W,this._projectionPicker=w,this._baseLayerPicker=P,this._navigationHelpButton=M,this._animation=g,this._timeline=Z,this._fullscreenButton=E,this._vrButton=N,this._geocoder=R,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(V)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new be,this._trackedEntityChanged=new be,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),_.add(p.dataSourceAdded,Mi.prototype._onDataSourceAdded,this),_.add(p.dataSourceRemoved,Mi.prototype._onDataSourceRemoved,this),_.add(h.postUpdate,Mi.prototype.resize,this),_.add(h.postRender,Mi.prototype._postRender,this);let O=p.length;for(let K=0;K<O;K++)this._dataSourceAdded(p,p.get(K));this._dataSourceAdded(void 0,x.defaultDataSource),_.add(p.dataSourceAdded,Mi.prototype._dataSourceAdded,this),_.add(p.dataSourceRemoved,Mi.prototype._dataSourceRemoved,this);function U(K){let te=HLe(i,K);l(te)?J.getValueOrUndefined(te.position,i.clock.currentTime)?i.trackedEntity=te:i.zoomTo(te):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function j(K){i.selectedEntity=HLe(i,K)}m.screenSpaceEventHandler.setInputAction(j,Ln.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(U,Ln.LEFT_DOUBLE_CLICK)}Object.defineProperties(Mi.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._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},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._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,N$(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(v.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},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._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,jLe(this._timeline,this.clock,e))}}});Mi.prototype.extend=function(e,t){e(this,t)};Mi.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 h=this._geocoder.searchSuggestionsContainer;h.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,d=0,m=5,p=3,b=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let h=this._lastWidth;u=this._animation.container,n>900?(d=169,h<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(d=136,(h<600||h>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(d=106,(h>600||h===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),m=d+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let h=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${d}px`;let V=0;l(h)&&(V+=h.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(b=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${b}px`,this._lastWidth=n,this._lastHeight=i};Mi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Mi.prototype.render=function(){this._cesiumWidget.render()};Mi.prototype.isDestroyed=function(){return!1};Mi.prototype.destroy=function(){let e;l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Ln.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Ln.LEFT_DOUBLE_CLICK));let t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),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",QLe,!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._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),de(this)};Mi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Mi.prototype._onEntityCollectionChanged,this)};Mi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Mi.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Mi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let d=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(d,!1,yx)===ht.DONE&&i.update(t,yx)}let o,r=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,yx)!==ht.FAILED?o=yx.center:l(s.position)&&(o=s.position.getValue(t,o)),r=l(o));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=f.clone(o,c.position),c.showSelection=a&&r,c.update());let u=l(this._infoBox)?this._infoBox.viewModel:void 0;l(u)&&(u.showInfo=a,u.enableCamera=r,u.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(u.titleText=y(s.name,s.id),u.description=J.getValueOrDefault(s.description,t,"")):(u.titleText="",u.description=""))};Mi.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),this.selectedEntity===r&&(this.selectedEntity=void 0)}};Mi.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)}};Mi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Mi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Mi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Mi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&jLe(this.timeline,this.clock,e)};Mi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Mi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Mi.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}};Mi.prototype.zoomTo=function(e,t){return qLe(this,e,{offset:t},!1)};Mi.prototype.flyTo=function(e,t){return qLe(this,e,t,!0)};function qLe(e,t,n,i){N$(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 Ra){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 BT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof xa||r instanceof xZ||r instanceof sx){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=y(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 TN(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function N$(e){let t=e._zoomPromise;l(t)&&(TN(e),e._completeZoom(!1))}Mi.prototype._postRender=function(){LWt(this),ZWt(this)};function LWt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=y(e._zoomOptions,{}),r;function s(d){l(o.offset)||(o.offset=new mm(0,-.5,d.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(d,o.offset),i.lookAtTransform(v.IDENTITY),e._completeZoom(!0)),TN(e)}if(t instanceof xZ){if(l(t.boundingSphere)){s(t.boundingSphere);return}let d=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),d()});return}if(t instanceof xa||t instanceof sx){s(t.boundingSphere);return}if(t instanceof fe){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)),TN(e);return}let a=t,c=[];for(let d=0,m=a.length;d<m;d++){let p=e._dataSourceDisplay.getBoundingSphere(a[d],!1,yx);if(p===ht.PENDING)return;p!==ht.FAILED&&c.push(ae.clone(yx))}if(c.length===0){N$(e);return}e.trackedEntity=void 0;let u=ae.fromBoundingSpheres(c);e._zoomIsFlight?(TN(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(v.IDENTITY),TN(e),e._completeZoom(!0))}function ZWt(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,yx);if(r===ht.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!==ht.FAILED?yx:void 0;e._entityView=new Qv(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var U$=Mi;var m5o=S(T(),1);function RWt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Q9(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var k$=RWt;var p5o=S(T(),1);function GWt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new D9(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var D$=GWt;var x5o=S(T(),1);function EWt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new be,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Pn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(d){$Le(s,u),s=d,B$(s,u)}},dropEnabled:{get:function(){return n},set:function(d){d!==n&&(d?B$(s,u):$Le(s,u),n=d)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(d){r=d}},flyToOnDrop:{get:function(){return i},set:function(d){i=d}},proxy:{get:function(){return c},set:function(d){c=d}},clampToGround:{get:function(){return a},set:function(d){a=d}}});function u(d){mC(d),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=d.dataTransfer.files,p=m.length;for(let b=0;b<p;b++){let h=m[b],x=new FileReader;x.onload=WWt(e,h,c,a),x.onerror=IWt(e,h),x.readAsText(h)}}B$(s,u),e.destroy=cF(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function mC(e){e.stopPropagation(),e.preventDefault()}function $Le(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",mC,!1),n.removeEventListener("dragover",mC,!1),n.removeEventListener("dragexit",mC,!1))}function B$(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",mC,!1),e.addEventListener("dragover",mC,!1),e.addEventListener("dragexit",mC,!1)}function WWt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=lv.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gw.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Ww.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Sw.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 IWt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var O$=EWt;var L5o=S(T(),1);function XWt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new lN({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Y$=XWt;var U5o=S(T(),1);var A5o=S(T(),1);var W5o=S(T(),1);function eZe(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 Pm(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(d){t._voxelPrimitive[r]=d});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Ce.observable();return Ce.defineProperty(t,r,{get:function(){return u()},set:function(d){typeof s=="number"&&typeof d=="string"&&(d=Number(d),isNaN(d)&&(d=s)),typeof s=="boolean"&&typeof d=="number"&&(d=d===1),u(d),l(a)&&l(t._voxelPrimitive)&&(a(d),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=eZe(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===Fi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Fi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Fi.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:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=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:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.translationX=v.getTranslation(t._voxelPrimitive.modelMatrix,new f).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.translationY=v.getTranslation(t._voxelPrimitive.modelMatrix,new f).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.translationZ=v.getTranslation(t._voxelPrimitive.modelMatrix,new f).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.scaleX=v.getScale(t._voxelPrimitive.modelMatrix,new f).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.scaleY=v.getScale(t._voxelPrimitive.modelMatrix,new f).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)},getPrimitiveFunction:function(){t.scaleZ=v.getScale(t._voxelPrimitive.modelMatrix,new f).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Vp(t)}})}var PWt=new f,vWt=new f,wWt=new pc,FWt=new $;function Vp(e){let t=f.fromElements(e.translationX,e.translationY,e.translationZ,PWt),n=f.fromElements(e.scaleX,e.scaleY,e.scaleZ,vWt),i=wWt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,FWt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=v.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Pm.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=eZe(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,Vp(t)}}}});Pm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Pm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Pm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Pm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Pm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new AT({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Pm.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let d=a.join(` -`);n.value=n.value.slice(0,i)+d+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};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),de(this)};var CN=Pm;function z3(e,t){e=Pn(e);let n=document.createElement("div"),i=new CN(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=ic.createSection,a=ic.createCheckbox,c=ic.createRangeInput,u=ic.createButton,d=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),b=s(r,"Clipping","clippingVisible","toggleClipping"),h=s(r,"Shader","shaderVisible","toggleShader");d.appendChild(a("Depth Test","depthTest")),d.appendChild(a("Show","show")),d.appendChild(a("Disable Update","disableUpdate")),d.appendChild(a("Debug Draw","debugDraw")),d.appendChild(a("Jitter","jitter")),d.appendChild(a("Nearest Sampling","nearestSampling")),d.appendChild(c("Screen Space Error","screenSpaceError",0,128)),d.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=X.PI;m.appendChild(c("Translation X","translationX",-x,+x)),m.appendChild(c("Translation Y","translationY",-x,+x)),m.appendChild(c("Translation Z","translationZ",-x,+x)),m.appendChild(c("Scale X","scaleX",0,+_)),m.appendChild(c("Scale Y","scaleY",0,+_)),m.appendChild(c("Scale Z","scaleZ",0,+_)),m.appendChild(c("Heading","angleX",-C,+C)),m.appendChild(c("Pitch","angleY",-C,+C)),m.appendChild(c("Roll","angleZ",-C,+C));let V=Fi.getMinBounds(Fi.BOX),L=Fi.getMaxBounds(Fi.BOX),R=f.fromElements(Fi.getMinBounds(Fi.ELLIPSOID).x,Fi.getMinBounds(Fi.ELLIPSOID).y,-ie.WGS84.maximumRadius,new f),G=f.fromElements(Fi.getMaxBounds(Fi.ELLIPSOID).x,Fi.getMaxBounds(Fi.ELLIPSOID).y,1e7,new f),W=Fi.getMinBounds(Fi.CYLINDER),w=Fi.getMaxBounds(Fi.CYLINDER);IZ("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),IZ("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",R,G,"shapeIsEllipsoid",p),IZ("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",W,w,"shapeIsCylinder",p),IZ("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",b),IZ("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",R,G,"shapeIsEllipsoid",b),IZ("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",W,w,"shapeIsCylinder",b);let P=document.createElement("div");h.appendChild(P);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(F);let M=u("Compile (Ctrl+Enter)","compileShader");P.appendChild(M);let g=document.createElement("label");g.style.display="block",g.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(g),Ce.applyBindings(i,n)}Object.defineProperties(z3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});z3.prototype.isDestroyed=function(){return!1};z3.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function IZ(e,t,n,i,o,r,s,a,c,u,d,m,p,b,h,x){let _=ic.createRangeInput,C=p,V=b,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${h}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,u,C.y,V.y)),L.appendChild(_(o,d,C.z,V.z)),L.appendChild(_(r,m,C.z,V.z))}var VN=z3;function AWt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new VN(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var K$=AWt;globalThis.CESIUM_VERSION="1.119";var MWt="1.119";return pZe(NWt);})(); -//# sourceMappingURL=Cesium.js.map diff --git a/src/renderer/public/sdk/Cesium/Widgets/Animation/Animation.css.map b/src/renderer/public/sdk/Cesium/Widgets/Animation/Animation.css.map deleted file mode 100644 index e14591e..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Animation/Animation.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Animation/Animation.css"], - "sourcesContent": [".cesium-animation-theme {\n visibility: hidden;\n display: block;\n position: absolute;\n z-index: -100;\n}\n\n.cesium-animation-themeNormal {\n color: #222;\n}\n\n.cesium-animation-themeHover {\n color: #4488b0;\n}\n\n.cesium-animation-themeSelect {\n color: #242;\n}\n\n.cesium-animation-themeDisabled {\n color: #333;\n}\n\n.cesium-animation-themeKnob {\n color: #222;\n}\n\n.cesium-animation-themePointer {\n color: #2e2;\n}\n\n.cesium-animation-themeSwoosh {\n color: #8ac;\n}\n\n.cesium-animation-themeSwooshHover {\n color: #aef;\n}\n\n.cesium-animation-svgText {\n fill: #edffff;\n font-family: Sans-Serif;\n font-size: 15px;\n text-anchor: middle;\n}\n\n.cesium-animation-blank {\n fill: #000;\n fill-opacity: 0.01; /* This must be clickable, so it can't be 'fill: none'. */\n stroke: none;\n}\n\n.cesium-animation-rectButton {\n cursor: pointer;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonGlow {\n fill: #fff;\n stroke: none;\n /* Widget will add: filter: url(#animation_blurred); */\n display: none;\n}\n\n.cesium-animation-rectButton:hover .cesium-animation-buttonGlow {\n display: block;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonPath {\n fill: #edffff;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonNormal); */\n stroke: #444;\n stroke-width: 1.2;\n}\n\n.cesium-animation-rectButton:hover .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonHovered); */\n stroke: #aef;\n}\n\n.cesium-animation-rectButton:active .cesium-animation-buttonMain {\n fill: #abd6ff;\n}\n\n.cesium-animation-buttonDisabled {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonDisabled); */\n stroke: #555;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonPath {\n fill: #818181;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonGlow {\n display: none;\n}\n\n.cesium-animation-buttonToggled .cesium-animation-buttonGlow {\n display: block;\n fill: #2e2;\n}\n\n.cesium-animation-buttonToggled .cesium-animation-buttonMain {\n stroke: #2e2;\n}\n\n.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow {\n fill: #fff;\n}\n\n.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain {\n stroke: #2e2;\n}\n\n.cesium-animation-shuttleRingG {\n cursor: pointer;\n}\n\n/* Widget will add:\n.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh {\n fill: url(#animation_shuttleRingSwooshGradient);\n}\n\n.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh {\n fill: url(#animation_shuttleRingSwooshHovered);\n}\n*/\n\n.cesium-animation-shuttleRingPointer {\n /* Widget will add: fill: url(#animation_shuttleRingPointerGradient); */\n cursor: pointer;\n}\n\n.cesium-animation-shuttleRingPausePointer {\n /* Widget will add: fill: url(#animation_shuttleRingPointerPaused); */\n cursor: pointer;\n}\n\n.cesium-animation-shuttleRingBack {\n fill: #181818;\n fill-opacity: 0.8;\n stroke: #333;\n stroke-width: 1.2;\n}\n\n.cesium-animation-shuttleRingSwoosh line {\n stroke: #8ac;\n stroke-width: 3;\n stroke-opacity: 0.2;\n stroke-linecap: round;\n}\n\n.cesium-animation-knobOuter {\n /* Widget will add: fill: url(#animation_knobOuter); */\n cursor: pointer;\n stroke: #444;\n stroke-width: 1.2;\n}\n\n.cesium-animation-knobInner {\n /* Widget will add: fill: url(#animation_knobInner); */\n cursor: pointer;\n}\n"], - "mappings": "AAAA,wBACE,kBACA,cACA,kBACA,aAGF,8BACE,WAGF,6BACE,cAGF,8BACE,WAGF,gCACE,WAGF,4BACE,WAGF,+BACE,WAGF,8BACE,WAGF,mCACE,WAGF,0BACE,aACA,uBACA,eACA,mBAGF,wBACE,UACA,iBACA,YAGF,6BACE,eACA,sBACA,yBACA,qBACA,iBAGF,0DACE,UACA,YAEA,aAGF,gEACE,cAGF,0DACE,aAGF,0DAEE,YACA,iBAGF,gEAEE,YAGF,iEACE,aAGF,iCACE,sBACA,yBACA,qBACA,iBAGF,8DAEE,YAGF,8DACE,aAGF,8DACE,aAGF,6DACE,cACA,UAGF,6DACE,YAGF,mEACE,UAGF,mEACE,YAGF,8GACE,eAuBF,kCACE,aACA,gBACA,YACA,iBAGF,yCACE,YACA,eACA,kBACA,qBAGF,4BAEE,eACA,YACA,iBAGF,4BAEE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Animation/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/Animation/lighter.css.map deleted file mode 100644 index ab1727e..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Animation/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Animation/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-animation-themeNormal {\n color: #e5f2fe;\n}\n\n.cesium-lighter .cesium-animation-themeHover {\n color: #abd6ff;\n}\n\n.cesium-lighter .cesium-animation-themeSelect {\n color: #e5f2fe;\n}\n\n.cesium-lighter .cesium-animation-themeDisabled {\n color: #efefef;\n}\n\n.cesium-lighter .cesium-animation-themeKnob {\n color: #e1e2e3;\n}\n\n.cesium-lighter .cesium-animation-themePointer {\n color: #fa5;\n}\n\n.cesium-lighter .cesium-animation-themeSwoosh {\n color: #ace;\n}\n\n.cesium-lighter .cesium-animation-themeSwooshHover {\n color: #bdf;\n}\n\n.cesium-lighter .cesium-animation-svgText {\n fill: #111;\n}\n\n.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath {\n fill: #111;\n}\n\n.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain {\n stroke: #759dc0;\n}\n\n.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow {\n fill: #ffaa2a;\n}\n\n.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonToggled); */\n stroke: #ea0;\n}\n\n.cesium-lighter\n .cesium-animation-rectButton:hover\n .cesium-animation-buttonMain {\n stroke: #759dc0;\n}\n\n.cesium-lighter\n .cesium-animation-buttonToggled:hover\n .cesium-animation-buttonGlow {\n fill: #fff;\n}\n\n.cesium-lighter\n .cesium-animation-buttonToggled:hover\n .cesium-animation-buttonMain {\n stroke: #ea0;\n}\n\n.cesium-lighter\n .cesium-animation-rectButton:active\n .cesium-animation-buttonMain {\n fill: #abd6ff;\n}\n\n.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain {\n stroke: #d3d3d3;\n}\n\n.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath {\n fill: #818181;\n}\n\n.cesium-lighter .cesium-animation-shuttleRingBack {\n fill: #fafafa;\n fill-opacity: 1;\n stroke: #aeaeae;\n stroke-width: 1.2;\n}\n\n.cesium-lighter .cesium-animation-shuttleRingSwoosh line {\n stroke: #8ac;\n}\n\n.cesium-lighter .cesium-animation-knobOuter {\n stroke: #a5a5a5;\n}\n"], - "mappings": "AAAA,8CACE,cAGF,6CACE,cAGF,8CACE,cAGF,gDACE,cAGF,4CACE,cAGF,+CACE,WAGF,8CACE,WAGF,mDACE,WAGF,oHACE,UAOF,0EACE,eAGF,6EACE,aAGF,6EAEE,YAGF,gFAGE,eAGF,mFAGE,UAGF,mFAGE,YAGF,iFAGE,aAGF,8EACE,eAGF,8EACE,aAGF,kDACE,aACA,eACA,eACA,iBAGF,yDACE,YAGF,4CACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css.map b/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css.map deleted file mode 100644 index 6fd2587..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/BaseLayerPicker/BaseLayerPicker.css"], - "sourcesContent": [".cesium-baseLayerPicker-selected {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.cesium-baseLayerPicker-dropDown {\n display: block;\n position: absolute;\n box-sizing: content-box;\n top: auto;\n right: 0;\n width: 320px; /* Includes space needed for scrollbar */\n max-height: 500px;\n margin-top: 5px;\n background-color: rgba(38, 38, 38, 0.75);\n border: 1px solid #444;\n padding: 6px;\n overflow: auto;\n border-radius: 10px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n transform: translate(0, -20%);\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in;\n}\n\n.cesium-baseLayerPicker-dropDown-visible {\n transform: translate(0, 0);\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n}\n\n.cesium-baseLayerPicker-sectionTitle {\n display: block;\n font-family: sans-serif;\n font-size: 16pt;\n text-align: left;\n color: #edffff;\n margin-bottom: 4px;\n}\n\n.cesium-baseLayerPicker-choices {\n margin-bottom: 5px;\n}\n\n.cesium-baseLayerPicker-categoryTitle {\n color: #edffff;\n font-size: 11pt;\n}\n\n.cesium-baseLayerPicker-choices {\n display: block;\n border: 1px solid #888;\n border-radius: 5px;\n padding: 5px 0;\n}\n\n.cesium-baseLayerPicker-item {\n display: inline-block;\n vertical-align: top;\n margin: 2px 5px;\n width: 64px;\n text-align: center;\n cursor: pointer;\n}\n\n.cesium-baseLayerPicker-itemLabel {\n display: block;\n font-family: sans-serif;\n font-size: 8pt;\n text-align: center;\n vertical-align: middle;\n color: #edffff;\n cursor: pointer;\n word-wrap: break-word;\n}\n\n.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,\n.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel {\n text-decoration: underline;\n}\n\n.cesium-baseLayerPicker-itemIcon {\n display: inline-block;\n position: relative;\n width: inherit;\n height: auto;\n background-size: 100% 100%;\n border: solid 1px #444;\n border-radius: 9px;\n color: #edffff;\n margin: 0;\n padding: 0;\n cursor: pointer;\n box-sizing: border-box;\n}\n\n.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon {\n border-color: #fff;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n\n.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel {\n color: rgb(189, 236, 248);\n}\n\n.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon {\n border: double 4px rgb(189, 236, 248);\n}\n"], - "mappings": "AAAA,iCACE,kBACA,MACA,OACA,WACA,YACA,YAGF,iCACE,cACA,kBACA,uBACA,SACA,QACA,YACA,iBACA,eACA,2BACA,sBAnBF,YAqBE,cArBF,mBAuBE,sBACA,yBACA,qBACA,iBACA,2BACA,kBACA,UACA,uEAGF,yCACE,uBACA,mBACA,UACA,uDAGF,qCACE,cACA,uBACA,eACA,gBACA,cACA,kBAGF,gCACE,kBAGF,sCACE,cACA,eAGF,gCACE,cACA,sBA5DF,gCAiEA,6BACE,qBACA,mBAnEF,eAqEE,WACA,kBACA,eAGF,kCACE,cACA,uBACA,cACA,kBACA,sBACA,cACA,eACA,qBAGF,0IAEE,0BAGF,iCACE,qBACA,kBACA,cACA,YACA,0BACA,sBAhGF,kBAkGE,cAlGF,mBAqGE,eACA,sBAGF,oEACE,kBACA,qCAGF,uEACE,cAGF,sEACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/lighter.css.map deleted file mode 100644 index ff63524..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/BaseLayerPicker/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/BaseLayerPicker/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-baseLayerPicker-itemIcon {\n border-color: #759dc0;\n}\n\n.cesium-lighter .cesium-baseLayerPicker-dropDown {\n background-color: rgba(240, 240, 240, 0.75);\n}\n\n.cesium-lighter .cesium-baseLayerPicker-sectionTitle {\n color: black;\n}\n\n.cesium-lighter .cesium-baseLayerPicker-itemLabel {\n color: black;\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-item:hover\n .cesium-baseLayerPicker-itemIcon {\n border-color: #000;\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-selectedItem\n .cesium-baseLayerPicker-itemLabel {\n color: rgb(0, 61, 168);\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-selectedItem\n .cesium-baseLayerPicker-itemIcon {\n border: double 4px rgb(0, 61, 168);\n}\n"], - "mappings": "AAAA,iDACE,qBAGF,iDACE,2BAGF,uGACE,WAOF,oFAGE,kBAGF,uFAGE,cAGF,sFAGE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css.map b/src/renderer/public/sdk/Cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css.map deleted file mode 100644 index c5047e1..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css"], - "sourcesContent": ["ul.cesium-cesiumInspector-statistics {\n margin: 0;\n padding-top: 3px;\n padding-bottom: 3px;\n}\n\nul.cesium-cesiumInspector-statistics + ul.cesium-cesiumInspector-statistics {\n border-top: 1px solid #aaa;\n}\n\n.cesium-cesiumInspector-slider {\n margin-top: 5px;\n}\n\n.cesium-cesiumInspector-slider input[type=\"number\"] {\n text-align: left;\n background-color: #222;\n outline: none;\n border: 1px solid #444;\n color: #edffff;\n width: 100px;\n border-radius: 3px;\n padding: 1px;\n margin-left: 10px;\n cursor: auto;\n}\n\n.cesium-cesiumInspector-slider input[type=\"number\"]::-webkit-outer-spin-button,\n.cesium-cesiumInspector-slider input[type=\"number\"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.cesium-cesiumInspector-slider input[type=\"range\"] {\n margin-left: 5px;\n vertical-align: middle;\n}\n\n.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor {\n display: none;\n}\n\n.cesium-cesiumInspector-styleEditor {\n padding: 10px;\n border-radius: 5px;\n background: rgba(48, 51, 54, 0.8);\n border: 1px solid #444;\n}\n\n.cesium-cesiumInspector-styleEditor textarea {\n width: 100%;\n height: 300px;\n background: transparent;\n color: #edffff;\n border: none;\n padding: 0;\n white-space: pre;\n overflow-wrap: normal;\n overflow-x: auto;\n}\n\n.cesium-3DTilesInspector {\n width: 300px;\n pointer-events: all;\n}\n\n.cesium-3DTilesInspector-statistics {\n font-size: 11px;\n}\n\n.cesium-3DTilesInspector-disabledElementsInfo {\n margin: 5px 0 0 0;\n padding: 0 0 0 20px;\n color: #eed202;\n}\n\n.cesium-3DTilesInspector div,\n.cesium-3DTilesInspector input[type=\"range\"] {\n width: 100%;\n box-sizing: border-box;\n}\n\n.cesium-cesiumInspector-error {\n color: #ff9e9e;\n overflow: auto;\n}\n\n.cesium-3DTilesInspector .cesium-cesiumInspector-section {\n margin-top: 3px;\n}\n\n.cesium-3DTilesInspector\n .cesium-cesiumInspector-sectionHeader\n + .cesium-cesiumInspector-show {\n border-top: 1px solid white;\n}\n\ninput.cesium-cesiumInspector-url {\n overflow: hidden;\n white-space: nowrap;\n overflow-x: scroll;\n background-color: transparent;\n color: white;\n outline: none;\n border: none;\n height: 1em;\n width: 100%;\n}\n\n.cesium-cesiumInspector .field-group {\n display: table;\n}\n\n.cesium-cesiumInspector .field-group > label {\n display: table-cell;\n font-weight: bold;\n}\n\n.cesium-cesiumInspector .field-group > .field {\n display: table-cell;\n width: 100%;\n}\n"], - "mappings": "AAAA,8CAEE,gBACA,mBAGF,0EACE,0BAGF,+BACE,eAGF,kDACE,gBACA,sBACA,aACA,sBACA,cACA,YApBF,8BAuBE,iBACA,YAGF,0JAEE,wBA7BF,SAiCA,iDACE,gBACA,sBAGF,iEACE,aAGF,oCA1CA,+BA6CE,6BACA,sBAGF,6CACE,WACA,aACA,uBACA,cACA,YAtDF,UAwDE,gBACA,qBACA,gBAGF,yBACE,YACA,mBAGF,oCACE,eAGF,8CAtEA,kCAyEE,cAGF,wEAEE,WACA,sBAGF,8BACE,cACA,cAGF,yDACE,eAGF,4FAGE,2BAGF,iCACE,gBACA,mBACA,kBACA,6BACA,WACA,aACA,YACA,WACA,WAGF,qCACE,cAGF,2CACE,mBACA,gBAGF,4CACE,mBACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/CesiumInspector/CesiumInspector.css.map b/src/renderer/public/sdk/Cesium/Widgets/CesiumInspector/CesiumInspector.css.map deleted file mode 100644 index bb1f4bc..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/CesiumInspector/CesiumInspector.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/CesiumInspector/CesiumInspector.css"], - "sourcesContent": [".cesium-cesiumInspector {\n border-radius: 5px;\n transition: width ease-in-out 0.25s;\n background: rgba(48, 51, 54, 0.8);\n border: 1px solid #444;\n color: #edffff;\n display: inline-block;\n position: relative;\n padding: 4px 12px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n}\n\n.cesium-cesiumInspector-button {\n text-align: center;\n font-size: 11pt;\n}\n\n.cesium-cesiumInspector-visible .cesium-cesiumInspector-button {\n border-bottom: 1px solid #aaa;\n padding-bottom: 3px;\n}\n\n.cesium-cesiumInspector input:enabled,\n.cesium-cesiumInspector-button {\n cursor: pointer;\n}\n\n.cesium-cesiumInspector-visible {\n width: 185px;\n height: auto;\n}\n\n.cesium-cesiumInspector-hidden {\n width: 122px;\n height: 17px;\n}\n\n.cesium-cesiumInspector-sectionContent {\n max-height: 600px;\n}\n\n.cesium-cesiumInspector-section-collapsed\n .cesium-cesiumInspector-sectionContent {\n max-height: 0;\n padding: 0 !important;\n overflow: hidden;\n}\n\n.cesium-cesiumInspector-dropDown {\n margin: 5px 0;\n font-family: sans-serif;\n font-size: 10pt;\n width: 185px;\n}\n\n.cesium-cesiumInspector-frustumStatistics {\n padding-left: 10px;\n padding: 5px;\n background-color: rgba(80, 80, 80, 0.75);\n}\n\n.cesium-cesiumInspector-pickButton {\n background-color: rgba(0, 0, 0, 0.3);\n border: 1px solid #444;\n color: #edffff;\n border-radius: 5px;\n padding: 3px 7px;\n cursor: pointer;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: 0 auto;\n}\n\n.cesium-cesiumInspector-pickButton:focus {\n outline: none;\n}\n\n.cesium-cesiumInspector-pickButton:active,\n.cesium-cesiumInspector-pickButtonHighlight {\n color: #000; /* For text buttons */\n background: #adf;\n border-color: #fff;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-cesiumInspector-center {\n text-align: center;\n}\n\n.cesium-cesiumInspector-sectionHeader {\n font-weight: bold;\n font-size: 10pt;\n margin: 0;\n cursor: pointer;\n}\n\n.cesium-cesiumInspector-pickSection {\n border: 1px solid #aaa;\n border-radius: 5px;\n padding: 3px;\n margin-bottom: 5px;\n}\n\n.cesium-cesiumInspector-sectionContent {\n margin-bottom: 10px;\n transition: max-height 0.25s;\n}\n\n.cesium-cesiumInspector-tileText {\n padding-bottom: 10px;\n border-bottom: 1px solid #aaa;\n}\n\n.cesium-cesiumInspector-relativeText {\n padding-top: 10px;\n}\n\n.cesium-cesiumInspector-sectionHeader::before {\n margin-right: 5px;\n content: \"-\";\n width: 1ch;\n display: inline-block;\n}\n\n.cesium-cesiumInspector-section-collapsed\n .cesium-cesiumInspector-sectionHeader::before {\n content: \"+\";\n}\n"], - "mappings": "AAAA,0CAEE,kCACA,6BACA,sBACA,cACA,qBACA,kBAPF,iBASE,sBACA,yBACA,qBACA,iBACA,gBAGF,+BACE,kBACA,eAGF,+DACE,6BACA,mBAGF,qEAEE,eAGF,gCACE,YACA,YAGF,+BACE,YACA,YAGF,uCACE,iBAGF,iFAEE,aA/CF,oBAiDE,gBAGF,iCApDA,aAsDE,uBACA,eACA,YAGF,0CA3DA,YA8DE,2BAGF,mCACE,2BACA,sBACA,cApEF,kCAuEE,eACA,sBACA,yBACA,qBACA,iBA3EF,cA+EA,yCACE,aAGF,sFAEE,WACA,gBACA,kBACA,wBAGF,+BACE,kBAGF,sCACE,gBACA,eAjGF,SAmGE,eAGF,oCACE,sBAvGF,8BA0GE,kBAGF,uCACE,mBACA,2BAGF,iCACE,oBACA,6BAGF,qCACE,iBAGF,6CACE,iBACA,YACA,UACA,qBAGF,uFAEE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/CesiumWidget.css.map b/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/CesiumWidget.css.map deleted file mode 100644 index d4552b2..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/CesiumWidget.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/CesiumWidget/CesiumWidget.css"], - "sourcesContent": [".cesium-widget {\n position: relative;\n}\n\n.cesium-widget,\n.cesium-widget canvas {\n width: 100%;\n height: 100%;\n touch-action: none;\n}\n\n.cesium-widget-credits {\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n color: #fff;\n font-size: 10px;\n text-shadow: 0px 0px 2px #000000;\n padding-right: 5px;\n}\n\n.cesium-widget-credits a,\n.cesium-widget-credits a:visited {\n color: #fff;\n}\n\n.cesium-widget-errorPanel {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n text-align: center;\n background: rgba(0, 0, 0, 0.7);\n z-index: 99999;\n}\n\n.cesium-widget-errorPanel:before {\n display: inline-block;\n vertical-align: middle;\n height: 100%;\n content: \"\";\n}\n\n.cesium-widget-errorPanel-content {\n width: 75%;\n max-width: 500px;\n display: inline-block;\n text-align: left;\n vertical-align: middle;\n border: 1px solid #510c00;\n border-radius: 7px;\n background-color: #f0d9d5;\n font-size: 14px;\n color: #510c00;\n}\n\n.cesium-widget-errorPanel-content.expanded {\n max-width: 75%;\n}\n\n.cesium-widget-errorPanel-header {\n font-size: 18px;\n font-family: \"Open Sans\", Verdana, Geneva, sans-serif;\n background: #d69d93;\n border-bottom: 2px solid #510c00;\n padding-bottom: 10px;\n border-radius: 3px 3px 0 0;\n padding: 15px;\n}\n\n.cesium-widget-errorPanel-scroll {\n overflow: auto;\n font-family: \"Open Sans\", Verdana, Geneva, sans-serif;\n white-space: pre-wrap;\n padding: 0 15px;\n margin: 10px 0 20px 0;\n}\n\n.cesium-widget-errorPanel-buttonPanel {\n padding: 0 15px;\n margin: 10px 0 20px 0;\n text-align: right;\n}\n\n.cesium-widget-errorPanel-buttonPanel button {\n border-color: #510c00;\n background: #d69d93;\n color: #202020;\n margin: 0;\n}\n.cesium-widget-errorPanel-buttonPanel button:focus {\n border-color: #510c00;\n background: #f0d9d5;\n color: #510c00;\n}\n.cesium-widget-errorPanel-buttonPanel button:hover {\n border-color: #510c00;\n background: #f0d9d5;\n color: #510c00;\n}\n.cesium-widget-errorPanel-buttonPanel button:active {\n border-color: #510c00;\n background: #b17b72;\n color: #510c00;\n}\n\n.cesium-widget-errorPanel-more-details {\n text-decoration: underline;\n cursor: pointer;\n}\n\n.cesium-widget-errorPanel-more-details:hover {\n color: #2b0700;\n}\n"], - "mappings": "AAAA,eACE,kBAGF,qCAEE,WACA,YACA,kBAGF,uBACE,cACA,kBACA,SACA,OACA,WACA,eACA,gCACA,kBAGF,0DAEE,WAGF,0BACE,kBA5BF,QAiCE,kBACA,0BACA,cAGF,iCACE,qBACA,sBACA,YACA,WAGF,kCACE,UACA,gBACA,qBACA,gBACA,sBACA,yBAnDF,kBAqDE,yBACA,eACA,cAGF,2CACE,cAGF,iCACE,eACA,gDACA,mBACA,gCAlEF,uCAwEA,iCACE,cACA,gDACA,qBA3EF,kCAgFA,sCAhFA,kCAmFE,iBAGF,6CACE,qBACA,mBACA,cAzFF,SA4FA,mDACE,qBACA,mBACA,cAEF,mDACE,qBACA,mBACA,cAEF,oDACE,qBACA,mBACA,cAGF,uCACE,0BACA,eAGF,6CACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/lighter.css.map deleted file mode 100644 index 132ffee..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/CesiumWidget/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/CesiumWidget/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-widget-errorPanel {\n background: rgba(255, 255, 255, 0.7);\n}\n\n.cesium-lighter .cesium-widget-errorPanel-content {\n border: 1px solid #526f82;\n border-radius: 7px;\n background-color: white;\n color: black;\n}\n\n.cesium-lighter .cesium-widget-errorPanel-header {\n color: #b87d00;\n}\n"], - "mappings": "AAAA,0CACE,gCAGF,kDACE,yBALF,kBAOE,sBACA,WAGF,iDACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/FullscreenButton/FullscreenButton.css.map b/src/renderer/public/sdk/Cesium/Widgets/FullscreenButton/FullscreenButton.css.map deleted file mode 100644 index b77f985..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/FullscreenButton/FullscreenButton.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/FullscreenButton/FullscreenButton.css"], - "sourcesContent": [".cesium-button.cesium-fullscreenButton {\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n}\n"], - "mappings": "AAAA,uCACE,cACA,WACA,YAHF", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Geocoder/Geocoder.css.map b/src/renderer/public/sdk/Cesium/Widgets/Geocoder/Geocoder.css.map deleted file mode 100644 index c526848..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Geocoder/Geocoder.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Geocoder/Geocoder.css"], - "sourcesContent": [".cesium-viewer-geocoderContainer .cesium-geocoder-input {\n border: solid 1px #444;\n background-color: rgba(40, 40, 40, 0.7);\n color: white;\n display: inline-block;\n vertical-align: middle;\n width: 0;\n height: 32px;\n margin: 0;\n padding: 0 32px 0 0;\n border-radius: 0;\n box-sizing: border-box;\n transition: width ease-in-out 0.25s, background-color 0.2s ease-in-out;\n -webkit-appearance: none;\n}\n\n.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus {\n border-color: #ea4;\n background-color: rgba(15, 15, 15, 0.9);\n box-shadow: none;\n outline: none;\n}\n\n.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,\n.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,\n.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide {\n padding-left: 4px;\n width: 250px;\n}\n\n.cesium-viewer-geocoderContainer .search-results {\n position: absolute;\n background-color: #000;\n color: #eee;\n overflow-y: auto;\n opacity: 0.8;\n width: 100%;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul li {\n font-size: 14px;\n padding: 3px 10px;\n}\n.cesium-viewer-geocoderContainer .search-results ul li:hover {\n cursor: pointer;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul li.active {\n background: #48b;\n}\n\n.cesium-geocoder-searchButton {\n background-color: #303336;\n display: inline-block;\n position: absolute;\n cursor: pointer;\n width: 32px;\n top: 1px;\n right: 1px;\n height: 30px;\n vertical-align: middle;\n fill: #edffff;\n}\n\n.cesium-geocoder-searchButton:hover {\n background-color: #48b;\n}\n"], - "mappings": "AAAA,wDACE,sBACA,2BACA,WACA,qBACA,sBACA,QACA,YAPF,4CAWE,sBACA,mEACA,wBAGF,8DACE,kBACA,wBAGF,8DACE,kBACA,2BACA,gBACA,aAGF,yLAGE,iBACA,YAGF,iDACE,kBACA,sBACA,WACA,gBACA,WACA,WAGF,oDACE,qBA7CF,mBAkDA,uDACE,eAnDF,iBAsDA,6DACE,eAGF,8DACE,gBAGF,8BACE,yBACA,qBACA,kBACA,eACA,WACA,QACA,UACA,YACA,sBACA,aAGF,oCACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Geocoder/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/Geocoder/lighter.css.map deleted file mode 100644 index 92fcb61..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Geocoder/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Geocoder/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-geocoder-input {\n border: solid 1px #759dc0;\n background-color: rgba(240, 240, 240, 0.9);\n color: black;\n}\n\n.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-lighter .cesium-geocoder-searchButton {\n background-color: #e2f0ff;\n fill: #111;\n}\n\n.cesium-lighter .cesium-geocoder-searchButton:hover {\n background-color: #a6d2ff;\n}\n"], - "mappings": "AAAA,uCACE,yBACA,2BACA,WAGF,8EACE,kBACA,wBAGF,8CACE,yBACA,UAGF,oDACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css b/src/renderer/public/sdk/Cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css deleted file mode 100644 index 49b6230..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +++ /dev/null @@ -1,27 +0,0 @@ -/* packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css */ -.cesium-viewer-i3s-explorer ul { - list-style-type: none; -} -.cesium-viewer-i3s-explorer .layersList { - padding: 0; -} -.cesium-viewer-i3s-explorer input { - margin: 0 3px 0 0; -} -.cesium-viewer-i3s-explorer .expandItem { - cursor: pointer; - user-select: none; - width: 20px; -} -.cesium-viewer-i3s-explorer .nested, -.cesium-viewer-i3s-explorer #bsl-wrapper { - display: none; -} -.cesium-viewer-i3s-explorer .active { - display: block; -} -.cesium-viewer-i3s-explorer .li-wrapper { - display: flex; - flex-direction: row; - align-content: center; -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png b/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png deleted file mode 100644 index bd5976d..0000000 Binary files a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png and /dev/null differ diff --git a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png b/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png deleted file mode 100644 index 46ffe9c..0000000 Binary files a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png and /dev/null differ diff --git a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png b/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png deleted file mode 100644 index 286f3a0..0000000 Binary files a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png and /dev/null differ diff --git a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png b/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png deleted file mode 100644 index 0520e17..0000000 Binary files a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png and /dev/null differ diff --git a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png b/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png deleted file mode 100644 index 1546494..0000000 Binary files a/src/renderer/public/sdk/Cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png and /dev/null differ diff --git a/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBox.css.map b/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBox.css.map deleted file mode 100644 index 2354c13..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBox.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/InfoBox/InfoBox.css"], - "sourcesContent": [".cesium-infoBox {\n display: block;\n position: absolute;\n top: 50px;\n right: 0;\n width: 40%;\n max-width: 480px;\n background: rgba(38, 38, 38, 0.95);\n color: #edffff;\n border: 1px solid #444;\n border-right: none;\n border-top-left-radius: 7px;\n border-bottom-left-radius: 7px;\n box-shadow: 0 0 10px 1px #000;\n transform: translate(100%, 0);\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in;\n}\n\n.cesium-infoBox-visible {\n transform: translate(0, 0);\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n}\n\n.cesium-infoBox-title {\n display: block;\n height: 20px;\n padding: 5px 30px 5px 25px;\n background: rgba(84, 84, 84, 1);\n border-top-left-radius: 7px;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: content-box;\n}\n\n.cesium-infoBox-bodyless .cesium-infoBox-title {\n border-bottom-left-radius: 7px;\n}\n\nbutton.cesium-infoBox-camera {\n display: block;\n position: absolute;\n top: 4px;\n left: 4px;\n width: 22px;\n height: 22px;\n background: transparent;\n border-color: transparent;\n border-radius: 3px;\n padding: 0 5px;\n margin: 0;\n}\n\nbutton.cesium-infoBox-close {\n display: block;\n position: absolute;\n top: 5px;\n right: 5px;\n height: 20px;\n background: transparent;\n border: none;\n border-radius: 2px;\n font-weight: bold;\n font-size: 16px;\n padding: 0 5px;\n margin: 0;\n color: #edffff;\n}\n\nbutton.cesium-infoBox-close:focus {\n background: rgba(238, 136, 0, 0.44);\n outline: none;\n}\n\nbutton.cesium-infoBox-close:hover {\n background: #888;\n color: #000;\n}\n\nbutton.cesium-infoBox-close:active {\n background: #a00;\n color: #000;\n}\n\n.cesium-infoBox-bodyless .cesium-infoBox-iframe {\n display: none;\n}\n\n.cesium-infoBox-iframe {\n border: none;\n width: 100%; /* Fallback */\n width: calc(100% - 2px);\n}\n"], - "mappings": "AAAA,gBACE,cACA,kBACA,SACA,QACA,UACA,gBACA,8BACA,cACA,sBACA,kBACA,2BACA,8BACA,6BACA,0BACA,kBACA,UACA,uEAGF,wBACE,uBACA,mBACA,UACA,uDAGF,sBACE,cACA,YA7BF,0BA+BE,4BACA,2BACA,kBACA,uBACA,mBACA,gBACA,uBAGF,+CACE,8BAGF,6BACE,cACA,kBACA,QACA,SACA,WACA,YACA,uBACA,yBApDF,yCA0DA,4BACE,cACA,kBACA,QACA,UACA,YACA,uBACA,YAjEF,kBAmEE,gBACA,eApEF,uBAuEE,cAGF,kCACE,+BACA,aAGF,kCACE,gBACA,WAGF,mCACE,gBACA,WAGF,gDACE,aAGF,uBACE,YACA,WACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBoxDescription.css.map b/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBoxDescription.css.map deleted file mode 100644 index 05a04dc..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/InfoBox/InfoBoxDescription.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/shared.css", "../../../../Source/Widgets/InfoBox/InfoBoxDescription.css"], - "sourcesContent": [".cesium-svgPath-svg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.cesium-button {\n display: inline-block;\n position: relative;\n background: #303336;\n border: 1px solid #444;\n color: #edffff; /* For text buttons */\n fill: #edffff; /* For SVG buttons */\n border-radius: 4px;\n padding: 5px 12px;\n margin: 2px 3px;\n cursor: pointer;\n overflow: hidden;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-button:focus {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n border-color: #ea4;\n outline: none;\n}\n\n.cesium-button:hover {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n background: #48b;\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:active {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n background: #adf;\n border-color: #fff;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:disabled,\n.cesium-button-disabled,\n.cesium-button-disabled:focus,\n.cesium-button-disabled:hover,\n.cesium-button-disabled:active {\n background: #303336;\n border-color: #444;\n color: #646464; /* For text buttons */\n fill: #646464; /* For SVG buttons */\n box-shadow: none;\n cursor: default;\n}\n\n.cesium-button option {\n background-color: #000;\n color: #eee;\n}\n\n.cesium-button option:disabled {\n color: #777;\n}\n\n.cesium-button input,\n.cesium-button label {\n cursor: pointer;\n}\n\n.cesium-button input {\n vertical-align: sub;\n}\n\n.cesium-toolbar-button {\n box-sizing: border-box;\n width: 32px;\n height: 32px;\n border-radius: 14%;\n padding: 0;\n vertical-align: middle;\n z-index: 0; /* Workaround for rounded raster image corners in Chrome */\n}\n\n.cesium-performanceDisplay-defaultContainer {\n position: absolute;\n top: 50px;\n right: 10px;\n text-align: right;\n}\n\n.cesium-performanceDisplay {\n background-color: rgba(40, 40, 40, 0.7);\n padding: 7px;\n border-radius: 5px;\n border: 1px solid #444;\n font: bold 12px sans-serif;\n}\n\n.cesium-performanceDisplay-fps {\n color: #e52;\n}\n\n.cesium-performanceDisplay-throttled {\n color: #a42;\n}\n\n.cesium-performanceDisplay-ms {\n color: #de3;\n}\n", "@import url(../shared.css);\nbody {\n margin: 0;\n padding: 0;\n}\n\n.cesium-infoBox-description {\n font-family: sans-serif;\n font-size: 13px;\n padding: 4px 10px;\n margin-right: 4px;\n color: #edffff;\n}\n\n.cesium-infoBox-description a:link,\n.cesium-infoBox-description a:visited,\n.cesium-infoBox-description a:hover,\n.cesium-infoBox-description a:active {\n color: #edffff;\n}\n\n.cesium-infoBox-description table {\n color: #edffff;\n}\n\n.cesium-infoBox-defaultTable {\n width: 100%;\n color: #edffff;\n}\n\n.cesium-infoBox-defaultTable tr:nth-child(odd) {\n background-color: rgba(84, 84, 84, 0.8);\n}\n\n.cesium-infoBox-defaultTable tr:nth-child(even) {\n background-color: rgba(84, 84, 84, 0.25);\n}\n\n.cesium-infoBox-defaultTable th {\n font-weight: normal;\n padding: 3px;\n vertical-align: middle;\n text-align: center;\n}\n\n.cesium-infoBox-defaultTable td {\n padding: 3px;\n vertical-align: middle;\n text-align: left;\n}\n\n.cesium-infoBox-description-lighter {\n color: #000000;\n}\n\n.cesium-infoBox-description-lighter a:link,\n.cesium-infoBox-description-lighter a:visited,\n.cesium-infoBox-description-lighter a:hover,\n.cesium-infoBox-description-lighter a:active {\n color: #000000;\n}\n\n.cesium-infoBox-description-lighter table {\n color: #000000;\n}\n\n.cesium-infoBox-defaultTable-lighter {\n width: 100%;\n color: #000000;\n}\n\n.cesium-infoBox-defaultTable-lighter tr:nth-child(odd) {\n background-color: rgba(179, 179, 179, 0.8);\n}\n\n.cesium-infoBox-defaultTable-lighter tr:nth-child(even) {\n background-color: rgba(179, 179, 179, 0.25);\n}\n\n.cesium-infoBox-loadingContainer {\n margin: 5px;\n text-align: center;\n}\n\n.cesium-infoBox-loading {\n display: inline-block;\n background-image: url(../Images/info-loading.gif);\n width: 16px;\n height: 11px;\n}\n"], - "mappings": "AAAA,oBACE,kBACA,MACA,OACA,WACA,YACA,gBAGF,eACE,qBACA,kBACA,mBACA,sBACA,cACA,aAfF,kDAmBE,eACA,gBACA,sBACA,yBACA,qBACA,iBAGF,qBACE,WACA,UACA,kBACA,aAGF,qBACE,WACA,UACA,gBACA,kBACA,wBAGF,sBACE,WACA,UACA,gBACA,kBACA,wBAGF,2IAKE,mBACA,kBACA,cACA,aACA,gBACA,eAGF,sBACE,sBACA,WAGF,+BACE,WAGF,0CAEE,eAGF,qBACE,mBAGF,uBACE,sBACA,WACA,YApFF,4BAuFE,sBACA,UAGF,4CACE,kBACA,SACA,WACA,iBAGF,2BACE,2BAnGF,8BAsGE,sBACA,yBAGF,+BACE,WAGF,qCACE,WAGF,8BACE,WClHF,KADA,mBAMA,4BACE,uBACA,eARF,iBAUE,iBACA,cAGF,oLAIE,cAOF,6BACE,WACA,cAGF,+CACE,2BAGF,gDACE,2BAGF,gCACE,gBAvCF,YAyCE,sBACA,kBAGF,gCA7CA,YA+CE,sBACA,gBAGF,gQACE,WAcF,qCACE,WACA,WAGF,uDACE,2BAGF,wDACE,2BAGF,iCA/EA,WAiFE,kBAGF,wBACE,qBACA,k/BACA,WACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css.map b/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css.map deleted file mode 100644 index fbc8825..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/NavigationHelpButton/NavigationHelpButton.css"], - "sourcesContent": [".cesium-navigationHelpButton-wrapper {\n position: relative;\n display: inline-block;\n}\n\n.cesium-navigation-help {\n visibility: hidden;\n position: absolute;\n top: 38px;\n right: 2px;\n width: 250px;\n border-radius: 10px;\n transform: scale(0.01);\n transform-origin: 234px -10px;\n transition: visibility 0s 0.25s, transform 0.25s ease-in;\n}\n\n.cesium-navigation-help-visible {\n visibility: visible;\n transform: scale(1);\n transition: transform 0.25s ease-out;\n}\n\n.cesium-navigation-help-instructions {\n border: 1px solid #444;\n background-color: rgba(38, 38, 38, 0.75);\n padding-bottom: 5px;\n border-radius: 0 0 10px 10px;\n}\n\n.cesium-click-navigation-help {\n display: none;\n}\n\n.cesium-touch-navigation-help {\n display: none;\n padding-top: 5px;\n}\n\n.cesium-click-navigation-help-visible {\n display: block;\n}\n\n.cesium-touch-navigation-help-visible {\n display: block;\n}\n\n.cesium-navigation-help-pan {\n color: #66ccff;\n font-weight: bold;\n}\n\n.cesium-navigation-help-zoom {\n color: #65fd00;\n font-weight: bold;\n}\n\n.cesium-navigation-help-rotate {\n color: #ffd800;\n font-weight: bold;\n}\n\n.cesium-navigation-help-tilt {\n color: #d800d8;\n font-weight: bold;\n}\n\n.cesium-navigation-help-details {\n color: #ffffff;\n}\n\n.cesium-navigation-button {\n color: #fff;\n background-color: transparent;\n border-bottom: none;\n border-top: 1px solid #444;\n border-right: 1px solid #444;\n margin: 0;\n width: 50%;\n cursor: pointer;\n}\n\n.cesium-navigation-button-icon {\n vertical-align: middle;\n padding: 5px 1px;\n}\n\n.cesium-navigation-button:focus {\n outline: none;\n}\n\n.cesium-navigation-button-left {\n border-radius: 10px 0 0 0;\n border-left: 1px solid #444;\n}\n\n.cesium-navigation-button-right {\n border-radius: 0 10px 0 0;\n border-left: none;\n}\n\n.cesium-navigation-button-selected {\n background-color: rgba(38, 38, 38, 0.75);\n}\n\n.cesium-navigation-button-unselected {\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.cesium-navigation-button-unselected:hover {\n background-color: rgba(76, 76, 76, 0.75);\n}\n"], - "mappings": "AAAA,qCACE,kBACA,qBAGF,wBACE,kBACA,kBACA,SACA,UACA,YAVF,mBAYE,qBACA,6BACA,qDAGF,gCACE,mBACA,mBACA,mCAGF,qCACE,sBACA,2BACA,mBA1BF,4BA8BA,8BACE,aAGF,8BACE,aACA,gBAGF,4EACE,cAOF,4BACE,WACA,gBAGF,6BACE,cACA,gBAGF,+BACE,cACA,gBAGF,6BACE,cACA,gBAGF,gCACE,WAGF,0BACE,WACA,6BACA,mBACA,0BACA,4BA5EF,SA8EE,UACA,eAGF,+BACE,sBAnFF,gBAuFA,gCACE,aAGF,+BA3FA,uBA6FE,2BAGF,gCAhGA,yBAkGE,iBAGF,mCACE,2BAGF,qCACE,2BAGF,2CACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/lighter.css.map deleted file mode 100644 index ba2aa31..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/NavigationHelpButton/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/NavigationHelpButton/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-navigation-help-instructions {\n border: 1px solid #759dc0;\n background-color: rgba(255, 255, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-help-pan {\n color: #66ccee;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-zoom {\n color: #65ec00;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-rotate {\n color: #eec722;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-tilt {\n color: #d800d8;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-details {\n color: #222222;\n}\n\n.cesium-lighter .cesium-navigation-button {\n color: #222222;\n border-top: 1px solid #759dc0;\n border-right: 1px solid #759dc0;\n}\n\n.cesium-lighter .cesium-navigation-button-selected {\n background-color: rgba(196, 225, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-button-unselected {\n background-color: rgba(226, 240, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-button-unselected:hover {\n background-color: rgba(166, 210, 255, 0.9);\n}\n"], - "mappings": "AAAA,qDACE,yBACA,2BAGF,4CACE,WACA,gBAGF,6CACE,cACA,gBAGF,+CACE,cACA,gBAGF,6CACE,cACA,gBAGF,gDACE,WAGF,0CACE,WACA,6BACA,+BAGF,mDACE,2BAGF,qDACE,2BAGF,2DACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css.map b/src/renderer/public/sdk/Cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css.map deleted file mode 100644 index 8b9d2c7..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/PerformanceWatchdog/PerformanceWatchdog.css"], - "sourcesContent": [".cesium-performance-watchdog-message-area {\n position: relative;\n background-color: yellow;\n color: black;\n padding: 10px;\n}\n\n.cesium-performance-watchdog-message {\n margin-right: 30px;\n}\n\n.cesium-performance-watchdog-message-dismiss {\n position: absolute;\n right: 0;\n margin: 0 10px 0 0;\n}\n"], - "mappings": "AAAA,0CACE,kBACA,sBACA,WAHF,aAOA,qCACE,kBAGF,6CACE,kBACA,QAbF", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css.map b/src/renderer/public/sdk/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css.map deleted file mode 100644 index c35d308..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/ProjectionPicker/ProjectionPicker.css"], - "sourcesContent": ["span.cesium-projectionPicker-wrapper {\n display: inline-block;\n position: relative;\n margin: 0 3px;\n}\n\n.cesium-projectionPicker-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.25s linear;\n}\n\n.cesium-projectionPicker-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.25s, opacity 0.25s linear;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-none {\n display: none;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon {\n box-sizing: border-box;\n padding: 0;\n margin: 3px 0;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic {\n margin: 0 0 3px 0;\n}\n\n.cesium-projectionPicker-wrapper\n .cesium-projectionPicker-buttonPerspective\n .cesium-projectionPicker-iconOrthographic {\n left: 100%;\n}\n\n.cesium-projectionPicker-wrapper\n .cesium-projectionPicker-buttonOrthographic\n .cesium-projectionPicker-iconPerspective {\n left: -100%;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected {\n border-color: #2e2;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n"], - "mappings": "AAAA,qCACE,qBACA,kBAFF,aAMA,iCACE,mBACA,UACA,+BAGF,gCACE,kBACA,UACA,kDAGF,+DACE,aAGF,wEACE,sBAvBF,uBA4BA,yJA5BA,eAiCA,sHAGE,UAGF,sHAGE,WAGF,mEACE,kBACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/SceneModePicker/SceneModePicker.css.map b/src/renderer/public/sdk/Cesium/Widgets/SceneModePicker/SceneModePicker.css.map deleted file mode 100644 index 5ffe2b7..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/SceneModePicker/SceneModePicker.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/SceneModePicker/SceneModePicker.css"], - "sourcesContent": ["span.cesium-sceneModePicker-wrapper {\n display: inline-block;\n position: relative;\n margin: 0 3px;\n}\n\n.cesium-sceneModePicker-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.25s linear;\n}\n\n.cesium-sceneModePicker-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.25s, opacity 0.25s linear;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none {\n display: none;\n}\n\n.cesium-sceneModePicker-slide-svg {\n transition: left 2s;\n top: 0;\n left: 0;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon {\n box-sizing: border-box;\n padding: 0;\n margin: 3px 0;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D {\n margin: 0 0 3px 0;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button3D\n .cesium-sceneModePicker-icon2D {\n left: 100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button3D\n .cesium-sceneModePicker-iconColumbusView {\n left: 200%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-buttonColumbusView\n .cesium-sceneModePicker-icon3D {\n left: -200%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-buttonColumbusView\n .cesium-sceneModePicker-icon2D {\n left: -100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button2D\n .cesium-sceneModePicker-icon3D {\n left: -100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button2D\n .cesium-sceneModePicker-iconColumbusView {\n left: 100%;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected {\n border-color: #2e2;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n"], - "mappings": "AAAA,oCACE,qBACA,kBAFF,aAMA,gCACE,mBACA,UACA,+BAGF,+BACE,kBACA,UACA,kDAGF,6DACE,aAGF,kCACE,mBACA,MACA,OAGF,sEACE,sBA7BF,uBAkCA,6MAlCA,eAwCA,gGAGE,UAGF,0GAGE,UAGF,0GAGE,WAGF,0MAGE,WASF,0GAGE,UAGF,iEACE,kBACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css.map b/src/renderer/public/sdk/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css.map deleted file mode 100644 index 571bc16..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/SelectionIndicator/SelectionIndicator.css"], - "sourcesContent": [".cesium-selection-wrapper {\n position: absolute;\n width: 160px;\n height: 160px;\n pointer-events: none;\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in;\n}\n\n.cesium-selection-wrapper-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out;\n}\n\n.cesium-selection-wrapper svg {\n fill: #2e2;\n stroke: #000;\n stroke-width: 1.1px;\n}\n"], - "mappings": "AAAA,0BACE,kBACA,YACA,aACA,oBACA,kBACA,UACA,iDAGF,kCACE,mBACA,UACA,gCAGF,8BACE,UACA,YACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Timeline/Timeline.css.map b/src/renderer/public/sdk/Cesium/Widgets/Timeline/Timeline.css.map deleted file mode 100644 index 163dc1c..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Timeline/Timeline.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Timeline/Timeline.css"], - "sourcesContent": [".cesium-timeline-main {\n position: relative;\n left: 0;\n bottom: 0;\n overflow: hidden;\n border: solid 1px #888;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-timeline-trackContainer {\n width: 100%;\n overflow: auto;\n border-top: solid 1px #888;\n position: relative;\n top: 0;\n left: 0;\n}\n\n.cesium-timeline-tracks {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.cesium-timeline-needle {\n position: absolute;\n left: 0;\n top: 1.7em;\n bottom: 0;\n width: 1px;\n background: #f00;\n}\n\n.cesium-timeline-bar {\n position: relative;\n left: 0;\n top: 0;\n overflow: hidden;\n cursor: pointer;\n width: 100%;\n height: 1.7em;\n background: linear-gradient(\n to bottom,\n rgba(116, 117, 119, 0.8) 0%,\n rgba(58, 68, 82, 0.8) 11%,\n rgba(46, 50, 56, 0.8) 46%,\n rgba(53, 53, 53, 0.8) 81%,\n rgba(53, 53, 53, 0.8) 100%\n );\n}\n\n.cesium-timeline-ruler {\n /* NOTE: The label and the ruler must use the same font/size */\n visibility: hidden;\n white-space: nowrap;\n font-size: 80%;\n z-index: -200;\n}\n\n.cesium-timeline-highlight {\n position: absolute;\n bottom: 0;\n left: 0;\n background: #08f;\n}\n\n.cesium-timeline-ticLabel {\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n font-size: 80%;\n color: #eee;\n}\n\n.cesium-timeline-ticMain {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 50%;\n background: #eee;\n}\n\n.cesium-timeline-ticSub {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 33%;\n background: #aaa;\n}\n\n.cesium-timeline-ticTiny {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 25%;\n background: #888;\n}\n\n.cesium-timeline-icon16 {\n display: block;\n position: absolute;\n width: 16px;\n height: 16px;\n background-image: url(\"../Images/TimelineIcons.png\");\n background-repeat: no-repeat;\n}\n"], - "mappings": "AAAA,sBACE,kBACA,OACA,SACA,gBACA,sBACA,sBACA,yBACA,qBACA,iBAGF,gCACE,WACA,cACA,0BACA,kBACA,MACA,OAGF,wBACE,kBACA,MACA,OACA,WAGF,wBACE,kBACA,OACA,UACA,SACA,UACA,gBAGF,qBACE,kBACA,OACA,MACA,gBACA,eACA,WACA,aACA,uJAUF,uBAEE,kBACA,mBACA,cACA,aAGF,2BACE,kBACA,SACA,OACA,gBAGF,0BACE,kBACA,MACA,OACA,mBACA,cACA,WAGF,yBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,yBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wBACE,cACA,kBACA,WACA,YACA,kkCACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Timeline/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/Timeline/lighter.css.map deleted file mode 100644 index 21a2f1e..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Timeline/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Timeline/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-timeline-bar {\n background: linear-gradient(to bottom, #eeeeee 0%, #ffffff 50%, #fafafa 100%);\n}\n\n.cesium-lighter .cesium-timeline-ticLabel {\n color: #000;\n}\n\n.cesium-lighter .cesium-timeline-ticMain {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 50%;\n background: #000;\n}\n\n.cesium-lighter .cesium-timeline-ticSub {\n background: #444;\n}\n"], - "mappings": "AAAA,qCACE,0EAGF,0CACE,WAGF,yCACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wCACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/VRButton/VRButton.css.map b/src/renderer/public/sdk/Cesium/Widgets/VRButton/VRButton.css.map deleted file mode 100644 index ac8398b..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/VRButton/VRButton.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/VRButton/VRButton.css"], - "sourcesContent": [".cesium-button.cesium-vrButton {\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n}\n"], - "mappings": "AAAA,+BACE,cACA,WACA,YAHF", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/Viewer/Viewer.css.map b/src/renderer/public/sdk/Cesium/Widgets/Viewer/Viewer.css.map deleted file mode 100644 index e6f9690..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/Viewer/Viewer.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../Source/Widgets/Viewer/Viewer.css"], - "sourcesContent": [".cesium-viewer {\n font-family: sans-serif;\n font-size: 16px;\n overflow: hidden;\n display: block;\n position: relative;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.cesium-viewer-cesiumWidgetContainer {\n width: 100%;\n height: 100%;\n}\n\n.cesium-viewer-bottom {\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n padding-right: 5px;\n}\n\n.cesium-viewer .cesium-widget-credits {\n display: inline;\n position: static;\n bottom: auto;\n left: auto;\n padding-right: 0;\n color: #ffffff;\n font-size: 10px;\n text-shadow: 0 0 2px #000000;\n}\n\n.cesium-viewer-timelineContainer {\n position: absolute;\n bottom: 0;\n left: 169px;\n right: 29px;\n height: 27px;\n padding: 0;\n margin: 0;\n overflow: hidden;\n font-size: 14px;\n}\n\n.cesium-viewer-animationContainer {\n position: absolute;\n bottom: 0;\n left: 0;\n padding: 0;\n width: 169px;\n height: 112px;\n}\n\n.cesium-viewer-fullscreenContainer {\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0;\n width: 29px;\n height: 29px;\n overflow: hidden;\n}\n\n.cesium-viewer-vrContainer {\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0;\n width: 29px;\n height: 29px;\n overflow: hidden;\n}\n\n.cesium-viewer-toolbar {\n display: block;\n position: absolute;\n top: 5px;\n right: 5px;\n}\n\n.cesium-viewer-cesiumInspectorContainer {\n display: block;\n position: absolute;\n top: 50px;\n right: 10px;\n}\n\n.cesium-viewer-geocoderContainer {\n position: relative;\n display: inline-block;\n margin: 0 3px;\n}\n\n.cesium-viewer-cesium3DTilesInspectorContainer {\n display: block;\n position: absolute;\n top: 50px;\n right: 10px;\n max-height: calc(100% - 120px);\n box-sizing: border-box;\n overflow-y: auto;\n overflow-x: hidden;\n}\n"], - "mappings": "AAAA,eACE,uBACA,eACA,gBACA,cACA,kBACA,MACA,OACA,WACA,YAGF,qCACE,WACA,YAGF,sBACE,cACA,kBACA,SACA,OACA,kBAGF,sCACE,eACA,gBACA,YACA,UACA,gBACA,WACA,eACA,4BAGF,iCACE,kBACA,SACA,WACA,WACA,YAzCF,mBA4CE,gBACA,eAGF,kCACE,kBACA,SACA,OAnDF,UAqDE,YACA,aAGF,8DACE,kBACA,SACA,QA5DF,UA8DE,WACA,YACA,gBAaF,uBACE,cACA,kBACA,QACA,UAGF,wCACE,cACA,kBACA,SACA,WAGF,iCACE,kBACA,qBA7FF,aAiGA,+CACE,cACA,kBACA,SACA,WACA,8BACA,sBACA,gBACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/VoxelInspector/VoxelInspector.css b/src/renderer/public/sdk/Cesium/Widgets/VoxelInspector/VoxelInspector.css deleted file mode 100644 index a0a3102..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/VoxelInspector/VoxelInspector.css +++ /dev/null @@ -1,16 +0,0 @@ -/* packages/widgets/Source/VoxelInspector/VoxelInspector.css */ -.cesium-VoxelInspector { - width: 300px; - pointer-events: all; -} -.cesium-VoxelInspector div, -.cesium-VoxelInspector input[type=range] { - width: 100%; - box-sizing: border-box; -} -.cesium-VoxelInspector .cesium-cesiumInspector-section { - margin-top: 3px; -} -.cesium-VoxelInspector .cesium-cesiumInspector-sectionHeader + .cesium-cesiumInspector-show { - border-top: 1px solid white; -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/lighter.css.map b/src/renderer/public/sdk/Cesium/Widgets/lighter.css.map deleted file mode 100644 index ace0022..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/lighter.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../Source/Widgets/lighterShared.css", "../../../Source/Widgets/Animation/lighter.css", "../../../Source/Widgets/BaseLayerPicker/lighter.css", "../../../Source/Widgets/CesiumWidget/lighter.css", "../../../Source/Widgets/Geocoder/lighter.css", "../../../Source/Widgets/Timeline/lighter.css", "../../../Source/Widgets/NavigationHelpButton/lighter.css"], - "sourcesContent": [".cesium-lighter .cesium-button {\n color: #111; /* For text buttons */\n fill: #111; /* For SVG buttons */\n background: #e2f0ff;\n border: 1px solid #759dc0;\n}\n\n.cesium-lighter .cesium-button:focus {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n border-color: #ea4;\n}\n\n.cesium-lighter .cesium-button:hover {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n background: #a6d2ff;\n border-color: #aef;\n box-shadow: 0 0 8px #777;\n}\n\n.cesium-lighter .cesium-button:active {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n background: #48b;\n border-color: #ea0;\n}\n\n.cesium-lighter .cesium-button:disabled,\n.cesium-lighter .cesium-button-disabled,\n.cesium-lighter .cesium-button-disabled:focus,\n.cesium-lighter .cesium-button-disabled:hover,\n.cesium-lighter .cesium-button-disabled:active {\n background: #ccc;\n border-color: #999;\n color: #999; /* For text buttons */\n fill: #999; /* For SVG buttons */\n box-shadow: none;\n}\n\n.cesium-lighter .cesium-performanceDisplay {\n background-color: #e2f0ff;\n border-color: #759dc0;\n}\n\n.cesium-lighter .cesium-performanceDisplay-fps {\n color: #e52;\n}\n\n.cesium-lighter .cesium-performanceDisplay-ms {\n color: #ea4;\n}\n", ".cesium-lighter .cesium-animation-themeNormal {\n color: #e5f2fe;\n}\n\n.cesium-lighter .cesium-animation-themeHover {\n color: #abd6ff;\n}\n\n.cesium-lighter .cesium-animation-themeSelect {\n color: #e5f2fe;\n}\n\n.cesium-lighter .cesium-animation-themeDisabled {\n color: #efefef;\n}\n\n.cesium-lighter .cesium-animation-themeKnob {\n color: #e1e2e3;\n}\n\n.cesium-lighter .cesium-animation-themePointer {\n color: #fa5;\n}\n\n.cesium-lighter .cesium-animation-themeSwoosh {\n color: #ace;\n}\n\n.cesium-lighter .cesium-animation-themeSwooshHover {\n color: #bdf;\n}\n\n.cesium-lighter .cesium-animation-svgText {\n fill: #111;\n}\n\n.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath {\n fill: #111;\n}\n\n.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain {\n stroke: #759dc0;\n}\n\n.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow {\n fill: #ffaa2a;\n}\n\n.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonToggled); */\n stroke: #ea0;\n}\n\n.cesium-lighter\n .cesium-animation-rectButton:hover\n .cesium-animation-buttonMain {\n stroke: #759dc0;\n}\n\n.cesium-lighter\n .cesium-animation-buttonToggled:hover\n .cesium-animation-buttonGlow {\n fill: #fff;\n}\n\n.cesium-lighter\n .cesium-animation-buttonToggled:hover\n .cesium-animation-buttonMain {\n stroke: #ea0;\n}\n\n.cesium-lighter\n .cesium-animation-rectButton:active\n .cesium-animation-buttonMain {\n fill: #abd6ff;\n}\n\n.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain {\n stroke: #d3d3d3;\n}\n\n.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath {\n fill: #818181;\n}\n\n.cesium-lighter .cesium-animation-shuttleRingBack {\n fill: #fafafa;\n fill-opacity: 1;\n stroke: #aeaeae;\n stroke-width: 1.2;\n}\n\n.cesium-lighter .cesium-animation-shuttleRingSwoosh line {\n stroke: #8ac;\n}\n\n.cesium-lighter .cesium-animation-knobOuter {\n stroke: #a5a5a5;\n}\n", ".cesium-lighter .cesium-baseLayerPicker-itemIcon {\n border-color: #759dc0;\n}\n\n.cesium-lighter .cesium-baseLayerPicker-dropDown {\n background-color: rgba(240, 240, 240, 0.75);\n}\n\n.cesium-lighter .cesium-baseLayerPicker-sectionTitle {\n color: black;\n}\n\n.cesium-lighter .cesium-baseLayerPicker-itemLabel {\n color: black;\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-item:hover\n .cesium-baseLayerPicker-itemIcon {\n border-color: #000;\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-selectedItem\n .cesium-baseLayerPicker-itemLabel {\n color: rgb(0, 61, 168);\n}\n\n.cesium-lighter\n .cesium-baseLayerPicker-selectedItem\n .cesium-baseLayerPicker-itemIcon {\n border: double 4px rgb(0, 61, 168);\n}\n", ".cesium-lighter .cesium-widget-errorPanel {\n background: rgba(255, 255, 255, 0.7);\n}\n\n.cesium-lighter .cesium-widget-errorPanel-content {\n border: 1px solid #526f82;\n border-radius: 7px;\n background-color: white;\n color: black;\n}\n\n.cesium-lighter .cesium-widget-errorPanel-header {\n color: #b87d00;\n}\n", ".cesium-lighter .cesium-geocoder-input {\n border: solid 1px #759dc0;\n background-color: rgba(240, 240, 240, 0.9);\n color: black;\n}\n\n.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-lighter .cesium-geocoder-searchButton {\n background-color: #e2f0ff;\n fill: #111;\n}\n\n.cesium-lighter .cesium-geocoder-searchButton:hover {\n background-color: #a6d2ff;\n}\n", ".cesium-lighter .cesium-timeline-bar {\n background: linear-gradient(to bottom, #eeeeee 0%, #ffffff 50%, #fafafa 100%);\n}\n\n.cesium-lighter .cesium-timeline-ticLabel {\n color: #000;\n}\n\n.cesium-lighter .cesium-timeline-ticMain {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 50%;\n background: #000;\n}\n\n.cesium-lighter .cesium-timeline-ticSub {\n background: #444;\n}\n", ".cesium-lighter .cesium-navigation-help-instructions {\n border: 1px solid #759dc0;\n background-color: rgba(255, 255, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-help-pan {\n color: #66ccee;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-zoom {\n color: #65ec00;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-rotate {\n color: #eec722;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-tilt {\n color: #d800d8;\n font-weight: bold;\n}\n\n.cesium-lighter .cesium-navigation-help-details {\n color: #222222;\n}\n\n.cesium-lighter .cesium-navigation-button {\n color: #222222;\n border-top: 1px solid #759dc0;\n border-right: 1px solid #759dc0;\n}\n\n.cesium-lighter .cesium-navigation-button-selected {\n background-color: rgba(196, 225, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-button-unselected {\n background-color: rgba(226, 240, 255, 0.9);\n}\n\n.cesium-lighter .cesium-navigation-button-unselected:hover {\n background-color: rgba(166, 210, 255, 0.9);\n}\n"], - "mappings": "AAAA,+BACE,WACA,UACA,mBACA,yBAGF,qCACE,WACA,UACA,kBAGF,qCACE,WACA,UACA,mBACA,kBACA,wBAGF,sCACE,WACA,UACA,gBACA,kBAGF,2NAKE,gBACA,kBACA,WACA,UACA,gBAGF,2CACE,yBACA,qBAGF,+CACE,WAGF,8CACE,WClDF,8CACE,cAGF,6CACE,cAGF,8CACE,cAGF,gDACE,cAGF,4CACE,cAGF,+CACE,WAGF,8CACE,WAGF,mDACE,WAGF,oHACE,UAOF,0EACE,eAGF,6EACE,aAGF,6EAEE,YAGF,gFAGE,eAGF,mFAGE,UAGF,mFAGE,YAGF,iFAGE,aAGF,8EACE,eAGF,8EACE,aAGF,kDACE,aACA,eACA,eACA,iBAGF,yDACE,YAGF,4CACE,eCjGF,iDACE,qBAGF,iDACE,2BAGF,uGACE,WAOF,oFAGE,kBAGF,uFAGE,cAGF,sFAGE,gCC/BF,0CACE,gCAGF,kDACE,yBALF,kBAOE,sBACA,WAGF,iDACE,cCZF,uCACE,yBACA,2BACA,WAGF,8EACE,kBACA,wBAGF,8CACE,yBACA,UAGF,oDACE,yBCjBF,qCACE,0EAGF,0CACE,WAGF,yCACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wCACE,gBClBF,qDACE,yBACA,2BAGF,4CACE,WACA,gBAGF,6CACE,cACA,gBAGF,+CACE,cACA,gBAGF,6CACE,cACA,gBAGF,gDACE,WAGF,0CACE,WACA,6BACA,+BAGF,mDACE,2BAGF,qDACE,2BAGF,2DACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/lighterShared.css.map b/src/renderer/public/sdk/Cesium/Widgets/lighterShared.css.map deleted file mode 100644 index 84cee3d..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/lighterShared.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../Source/Widgets/lighterShared.css"], - "sourcesContent": [".cesium-lighter .cesium-button {\n color: #111; /* For text buttons */\n fill: #111; /* For SVG buttons */\n background: #e2f0ff;\n border: 1px solid #759dc0;\n}\n\n.cesium-lighter .cesium-button:focus {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n border-color: #ea4;\n}\n\n.cesium-lighter .cesium-button:hover {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n background: #a6d2ff;\n border-color: #aef;\n box-shadow: 0 0 8px #777;\n}\n\n.cesium-lighter .cesium-button:active {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n background: #48b;\n border-color: #ea0;\n}\n\n.cesium-lighter .cesium-button:disabled,\n.cesium-lighter .cesium-button-disabled,\n.cesium-lighter .cesium-button-disabled:focus,\n.cesium-lighter .cesium-button-disabled:hover,\n.cesium-lighter .cesium-button-disabled:active {\n background: #ccc;\n border-color: #999;\n color: #999; /* For text buttons */\n fill: #999; /* For SVG buttons */\n box-shadow: none;\n}\n\n.cesium-lighter .cesium-performanceDisplay {\n background-color: #e2f0ff;\n border-color: #759dc0;\n}\n\n.cesium-lighter .cesium-performanceDisplay-fps {\n color: #e52;\n}\n\n.cesium-lighter .cesium-performanceDisplay-ms {\n color: #ea4;\n}\n"], - "mappings": "AAAA,+BACE,WACA,UACA,mBACA,yBAGF,qCACE,WACA,UACA,kBAGF,qCACE,WACA,UACA,mBACA,kBACA,wBAGF,sCACE,WACA,UACA,gBACA,kBAGF,2NAKE,gBACA,kBACA,WACA,UACA,gBAGF,2CACE,yBACA,qBAGF,+CACE,WAGF,8CACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/shared.css.map b/src/renderer/public/sdk/Cesium/Widgets/shared.css.map deleted file mode 100644 index 8b9f4ed..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/shared.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../Source/Widgets/shared.css"], - "sourcesContent": [".cesium-svgPath-svg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.cesium-button {\n display: inline-block;\n position: relative;\n background: #303336;\n border: 1px solid #444;\n color: #edffff; /* For text buttons */\n fill: #edffff; /* For SVG buttons */\n border-radius: 4px;\n padding: 5px 12px;\n margin: 2px 3px;\n cursor: pointer;\n overflow: hidden;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-button:focus {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n border-color: #ea4;\n outline: none;\n}\n\n.cesium-button:hover {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n background: #48b;\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:active {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n background: #adf;\n border-color: #fff;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:disabled,\n.cesium-button-disabled,\n.cesium-button-disabled:focus,\n.cesium-button-disabled:hover,\n.cesium-button-disabled:active {\n background: #303336;\n border-color: #444;\n color: #646464; /* For text buttons */\n fill: #646464; /* For SVG buttons */\n box-shadow: none;\n cursor: default;\n}\n\n.cesium-button option {\n background-color: #000;\n color: #eee;\n}\n\n.cesium-button option:disabled {\n color: #777;\n}\n\n.cesium-button input,\n.cesium-button label {\n cursor: pointer;\n}\n\n.cesium-button input {\n vertical-align: sub;\n}\n\n.cesium-toolbar-button {\n box-sizing: border-box;\n width: 32px;\n height: 32px;\n border-radius: 14%;\n padding: 0;\n vertical-align: middle;\n z-index: 0; /* Workaround for rounded raster image corners in Chrome */\n}\n\n.cesium-performanceDisplay-defaultContainer {\n position: absolute;\n top: 50px;\n right: 10px;\n text-align: right;\n}\n\n.cesium-performanceDisplay {\n background-color: rgba(40, 40, 40, 0.7);\n padding: 7px;\n border-radius: 5px;\n border: 1px solid #444;\n font: bold 12px sans-serif;\n}\n\n.cesium-performanceDisplay-fps {\n color: #e52;\n}\n\n.cesium-performanceDisplay-throttled {\n color: #a42;\n}\n\n.cesium-performanceDisplay-ms {\n color: #de3;\n}\n"], - "mappings": "AAAA,oBACE,kBACA,MACA,OACA,WACA,YACA,gBAGF,eACE,qBACA,kBACA,mBACA,sBACA,cACA,aAfF,kDAmBE,eACA,gBACA,sBACA,yBACA,qBACA,iBAGF,qBACE,WACA,UACA,kBACA,aAGF,qBACE,WACA,UACA,gBACA,kBACA,wBAGF,sBACE,WACA,UACA,gBACA,kBACA,wBAGF,2IAKE,mBACA,kBACA,cACA,aACA,gBACA,eAGF,sBACE,sBACA,WAGF,+BACE,WAGF,0CAEE,eAGF,qBACE,mBAGF,uBACE,sBACA,WACA,YApFF,4BAuFE,sBACA,UAGF,4CACE,kBACA,SACA,WACA,iBAGF,2BACE,2BAnGF,8BAsGE,sBACA,yBAGF,+BACE,WAGF,qCACE,WAGF,8BACE", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Widgets/widgets.css.map b/src/renderer/public/sdk/Cesium/Widgets/widgets.css.map deleted file mode 100644 index 36fb008..0000000 --- a/src/renderer/public/sdk/Cesium/Widgets/widgets.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../Source/Widgets/shared.css", "../../../Source/Widgets/Animation/Animation.css", "../../../Source/Widgets/BaseLayerPicker/BaseLayerPicker.css", "../../../Source/Widgets/CesiumWidget/CesiumWidget.css", "../../../Source/Widgets/CesiumInspector/CesiumInspector.css", "../../../Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css", "../../../Source/Widgets/FullscreenButton/FullscreenButton.css", "../../../Source/Widgets/VRButton/VRButton.css", "../../../Source/Widgets/Geocoder/Geocoder.css", "../../../Source/Widgets/InfoBox/InfoBox.css", "../../../Source/Widgets/SceneModePicker/SceneModePicker.css", "../../../Source/Widgets/ProjectionPicker/ProjectionPicker.css", "../../../Source/Widgets/PerformanceWatchdog/PerformanceWatchdog.css", "../../../Source/Widgets/NavigationHelpButton/NavigationHelpButton.css", "../../../Source/Widgets/SelectionIndicator/SelectionIndicator.css", "../../../Source/Widgets/Timeline/Timeline.css", "../../../Source/Widgets/Viewer/Viewer.css"], - "sourcesContent": [".cesium-svgPath-svg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.cesium-button {\n display: inline-block;\n position: relative;\n background: #303336;\n border: 1px solid #444;\n color: #edffff; /* For text buttons */\n fill: #edffff; /* For SVG buttons */\n border-radius: 4px;\n padding: 5px 12px;\n margin: 2px 3px;\n cursor: pointer;\n overflow: hidden;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-button:focus {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n border-color: #ea4;\n outline: none;\n}\n\n.cesium-button:hover {\n color: #fff; /* For text buttons */\n fill: #fff; /* For SVG buttons */\n background: #48b;\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:active {\n color: #000; /* For text buttons */\n fill: #000; /* For SVG buttons */\n background: #adf;\n border-color: #fff;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-button:disabled,\n.cesium-button-disabled,\n.cesium-button-disabled:focus,\n.cesium-button-disabled:hover,\n.cesium-button-disabled:active {\n background: #303336;\n border-color: #444;\n color: #646464; /* For text buttons */\n fill: #646464; /* For SVG buttons */\n box-shadow: none;\n cursor: default;\n}\n\n.cesium-button option {\n background-color: #000;\n color: #eee;\n}\n\n.cesium-button option:disabled {\n color: #777;\n}\n\n.cesium-button input,\n.cesium-button label {\n cursor: pointer;\n}\n\n.cesium-button input {\n vertical-align: sub;\n}\n\n.cesium-toolbar-button {\n box-sizing: border-box;\n width: 32px;\n height: 32px;\n border-radius: 14%;\n padding: 0;\n vertical-align: middle;\n z-index: 0; /* Workaround for rounded raster image corners in Chrome */\n}\n\n.cesium-performanceDisplay-defaultContainer {\n position: absolute;\n top: 50px;\n right: 10px;\n text-align: right;\n}\n\n.cesium-performanceDisplay {\n background-color: rgba(40, 40, 40, 0.7);\n padding: 7px;\n border-radius: 5px;\n border: 1px solid #444;\n font: bold 12px sans-serif;\n}\n\n.cesium-performanceDisplay-fps {\n color: #e52;\n}\n\n.cesium-performanceDisplay-throttled {\n color: #a42;\n}\n\n.cesium-performanceDisplay-ms {\n color: #de3;\n}\n", ".cesium-animation-theme {\n visibility: hidden;\n display: block;\n position: absolute;\n z-index: -100;\n}\n\n.cesium-animation-themeNormal {\n color: #222;\n}\n\n.cesium-animation-themeHover {\n color: #4488b0;\n}\n\n.cesium-animation-themeSelect {\n color: #242;\n}\n\n.cesium-animation-themeDisabled {\n color: #333;\n}\n\n.cesium-animation-themeKnob {\n color: #222;\n}\n\n.cesium-animation-themePointer {\n color: #2e2;\n}\n\n.cesium-animation-themeSwoosh {\n color: #8ac;\n}\n\n.cesium-animation-themeSwooshHover {\n color: #aef;\n}\n\n.cesium-animation-svgText {\n fill: #edffff;\n font-family: Sans-Serif;\n font-size: 15px;\n text-anchor: middle;\n}\n\n.cesium-animation-blank {\n fill: #000;\n fill-opacity: 0.01; /* This must be clickable, so it can't be 'fill: none'. */\n stroke: none;\n}\n\n.cesium-animation-rectButton {\n cursor: pointer;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonGlow {\n fill: #fff;\n stroke: none;\n /* Widget will add: filter: url(#animation_blurred); */\n display: none;\n}\n\n.cesium-animation-rectButton:hover .cesium-animation-buttonGlow {\n display: block;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonPath {\n fill: #edffff;\n}\n\n.cesium-animation-rectButton .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonNormal); */\n stroke: #444;\n stroke-width: 1.2;\n}\n\n.cesium-animation-rectButton:hover .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonHovered); */\n stroke: #aef;\n}\n\n.cesium-animation-rectButton:active .cesium-animation-buttonMain {\n fill: #abd6ff;\n}\n\n.cesium-animation-buttonDisabled {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonMain {\n /* Widget will add: fill: url(#animation_buttonDisabled); */\n stroke: #555;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonPath {\n fill: #818181;\n}\n\n.cesium-animation-buttonDisabled .cesium-animation-buttonGlow {\n display: none;\n}\n\n.cesium-animation-buttonToggled .cesium-animation-buttonGlow {\n display: block;\n fill: #2e2;\n}\n\n.cesium-animation-buttonToggled .cesium-animation-buttonMain {\n stroke: #2e2;\n}\n\n.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow {\n fill: #fff;\n}\n\n.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain {\n stroke: #2e2;\n}\n\n.cesium-animation-shuttleRingG {\n cursor: pointer;\n}\n\n/* Widget will add:\n.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh {\n fill: url(#animation_shuttleRingSwooshGradient);\n}\n\n.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh {\n fill: url(#animation_shuttleRingSwooshHovered);\n}\n*/\n\n.cesium-animation-shuttleRingPointer {\n /* Widget will add: fill: url(#animation_shuttleRingPointerGradient); */\n cursor: pointer;\n}\n\n.cesium-animation-shuttleRingPausePointer {\n /* Widget will add: fill: url(#animation_shuttleRingPointerPaused); */\n cursor: pointer;\n}\n\n.cesium-animation-shuttleRingBack {\n fill: #181818;\n fill-opacity: 0.8;\n stroke: #333;\n stroke-width: 1.2;\n}\n\n.cesium-animation-shuttleRingSwoosh line {\n stroke: #8ac;\n stroke-width: 3;\n stroke-opacity: 0.2;\n stroke-linecap: round;\n}\n\n.cesium-animation-knobOuter {\n /* Widget will add: fill: url(#animation_knobOuter); */\n cursor: pointer;\n stroke: #444;\n stroke-width: 1.2;\n}\n\n.cesium-animation-knobInner {\n /* Widget will add: fill: url(#animation_knobInner); */\n cursor: pointer;\n}\n", ".cesium-baseLayerPicker-selected {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.cesium-baseLayerPicker-dropDown {\n display: block;\n position: absolute;\n box-sizing: content-box;\n top: auto;\n right: 0;\n width: 320px; /* Includes space needed for scrollbar */\n max-height: 500px;\n margin-top: 5px;\n background-color: rgba(38, 38, 38, 0.75);\n border: 1px solid #444;\n padding: 6px;\n overflow: auto;\n border-radius: 10px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n transform: translate(0, -20%);\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in;\n}\n\n.cesium-baseLayerPicker-dropDown-visible {\n transform: translate(0, 0);\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n}\n\n.cesium-baseLayerPicker-sectionTitle {\n display: block;\n font-family: sans-serif;\n font-size: 16pt;\n text-align: left;\n color: #edffff;\n margin-bottom: 4px;\n}\n\n.cesium-baseLayerPicker-choices {\n margin-bottom: 5px;\n}\n\n.cesium-baseLayerPicker-categoryTitle {\n color: #edffff;\n font-size: 11pt;\n}\n\n.cesium-baseLayerPicker-choices {\n display: block;\n border: 1px solid #888;\n border-radius: 5px;\n padding: 5px 0;\n}\n\n.cesium-baseLayerPicker-item {\n display: inline-block;\n vertical-align: top;\n margin: 2px 5px;\n width: 64px;\n text-align: center;\n cursor: pointer;\n}\n\n.cesium-baseLayerPicker-itemLabel {\n display: block;\n font-family: sans-serif;\n font-size: 8pt;\n text-align: center;\n vertical-align: middle;\n color: #edffff;\n cursor: pointer;\n word-wrap: break-word;\n}\n\n.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,\n.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel {\n text-decoration: underline;\n}\n\n.cesium-baseLayerPicker-itemIcon {\n display: inline-block;\n position: relative;\n width: inherit;\n height: auto;\n background-size: 100% 100%;\n border: solid 1px #444;\n border-radius: 9px;\n color: #edffff;\n margin: 0;\n padding: 0;\n cursor: pointer;\n box-sizing: border-box;\n}\n\n.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon {\n border-color: #fff;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n\n.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel {\n color: rgb(189, 236, 248);\n}\n\n.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon {\n border: double 4px rgb(189, 236, 248);\n}\n", ".cesium-widget {\n position: relative;\n}\n\n.cesium-widget,\n.cesium-widget canvas {\n width: 100%;\n height: 100%;\n touch-action: none;\n}\n\n.cesium-widget-credits {\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n color: #fff;\n font-size: 10px;\n text-shadow: 0px 0px 2px #000000;\n padding-right: 5px;\n}\n\n.cesium-widget-credits a,\n.cesium-widget-credits a:visited {\n color: #fff;\n}\n\n.cesium-widget-errorPanel {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n text-align: center;\n background: rgba(0, 0, 0, 0.7);\n z-index: 99999;\n}\n\n.cesium-widget-errorPanel:before {\n display: inline-block;\n vertical-align: middle;\n height: 100%;\n content: \"\";\n}\n\n.cesium-widget-errorPanel-content {\n width: 75%;\n max-width: 500px;\n display: inline-block;\n text-align: left;\n vertical-align: middle;\n border: 1px solid #510c00;\n border-radius: 7px;\n background-color: #f0d9d5;\n font-size: 14px;\n color: #510c00;\n}\n\n.cesium-widget-errorPanel-content.expanded {\n max-width: 75%;\n}\n\n.cesium-widget-errorPanel-header {\n font-size: 18px;\n font-family: \"Open Sans\", Verdana, Geneva, sans-serif;\n background: #d69d93;\n border-bottom: 2px solid #510c00;\n padding-bottom: 10px;\n border-radius: 3px 3px 0 0;\n padding: 15px;\n}\n\n.cesium-widget-errorPanel-scroll {\n overflow: auto;\n font-family: \"Open Sans\", Verdana, Geneva, sans-serif;\n white-space: pre-wrap;\n padding: 0 15px;\n margin: 10px 0 20px 0;\n}\n\n.cesium-widget-errorPanel-buttonPanel {\n padding: 0 15px;\n margin: 10px 0 20px 0;\n text-align: right;\n}\n\n.cesium-widget-errorPanel-buttonPanel button {\n border-color: #510c00;\n background: #d69d93;\n color: #202020;\n margin: 0;\n}\n.cesium-widget-errorPanel-buttonPanel button:focus {\n border-color: #510c00;\n background: #f0d9d5;\n color: #510c00;\n}\n.cesium-widget-errorPanel-buttonPanel button:hover {\n border-color: #510c00;\n background: #f0d9d5;\n color: #510c00;\n}\n.cesium-widget-errorPanel-buttonPanel button:active {\n border-color: #510c00;\n background: #b17b72;\n color: #510c00;\n}\n\n.cesium-widget-errorPanel-more-details {\n text-decoration: underline;\n cursor: pointer;\n}\n\n.cesium-widget-errorPanel-more-details:hover {\n color: #2b0700;\n}\n", ".cesium-cesiumInspector {\n border-radius: 5px;\n transition: width ease-in-out 0.25s;\n background: rgba(48, 51, 54, 0.8);\n border: 1px solid #444;\n color: #edffff;\n display: inline-block;\n position: relative;\n padding: 4px 12px;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n}\n\n.cesium-cesiumInspector-button {\n text-align: center;\n font-size: 11pt;\n}\n\n.cesium-cesiumInspector-visible .cesium-cesiumInspector-button {\n border-bottom: 1px solid #aaa;\n padding-bottom: 3px;\n}\n\n.cesium-cesiumInspector input:enabled,\n.cesium-cesiumInspector-button {\n cursor: pointer;\n}\n\n.cesium-cesiumInspector-visible {\n width: 185px;\n height: auto;\n}\n\n.cesium-cesiumInspector-hidden {\n width: 122px;\n height: 17px;\n}\n\n.cesium-cesiumInspector-sectionContent {\n max-height: 600px;\n}\n\n.cesium-cesiumInspector-section-collapsed\n .cesium-cesiumInspector-sectionContent {\n max-height: 0;\n padding: 0 !important;\n overflow: hidden;\n}\n\n.cesium-cesiumInspector-dropDown {\n margin: 5px 0;\n font-family: sans-serif;\n font-size: 10pt;\n width: 185px;\n}\n\n.cesium-cesiumInspector-frustumStatistics {\n padding-left: 10px;\n padding: 5px;\n background-color: rgba(80, 80, 80, 0.75);\n}\n\n.cesium-cesiumInspector-pickButton {\n background-color: rgba(0, 0, 0, 0.3);\n border: 1px solid #444;\n color: #edffff;\n border-radius: 5px;\n padding: 3px 7px;\n cursor: pointer;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: 0 auto;\n}\n\n.cesium-cesiumInspector-pickButton:focus {\n outline: none;\n}\n\n.cesium-cesiumInspector-pickButton:active,\n.cesium-cesiumInspector-pickButtonHighlight {\n color: #000; /* For text buttons */\n background: #adf;\n border-color: #fff;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-cesiumInspector-center {\n text-align: center;\n}\n\n.cesium-cesiumInspector-sectionHeader {\n font-weight: bold;\n font-size: 10pt;\n margin: 0;\n cursor: pointer;\n}\n\n.cesium-cesiumInspector-pickSection {\n border: 1px solid #aaa;\n border-radius: 5px;\n padding: 3px;\n margin-bottom: 5px;\n}\n\n.cesium-cesiumInspector-sectionContent {\n margin-bottom: 10px;\n transition: max-height 0.25s;\n}\n\n.cesium-cesiumInspector-tileText {\n padding-bottom: 10px;\n border-bottom: 1px solid #aaa;\n}\n\n.cesium-cesiumInspector-relativeText {\n padding-top: 10px;\n}\n\n.cesium-cesiumInspector-sectionHeader::before {\n margin-right: 5px;\n content: \"-\";\n width: 1ch;\n display: inline-block;\n}\n\n.cesium-cesiumInspector-section-collapsed\n .cesium-cesiumInspector-sectionHeader::before {\n content: \"+\";\n}\n", "ul.cesium-cesiumInspector-statistics {\n margin: 0;\n padding-top: 3px;\n padding-bottom: 3px;\n}\n\nul.cesium-cesiumInspector-statistics + ul.cesium-cesiumInspector-statistics {\n border-top: 1px solid #aaa;\n}\n\n.cesium-cesiumInspector-slider {\n margin-top: 5px;\n}\n\n.cesium-cesiumInspector-slider input[type=\"number\"] {\n text-align: left;\n background-color: #222;\n outline: none;\n border: 1px solid #444;\n color: #edffff;\n width: 100px;\n border-radius: 3px;\n padding: 1px;\n margin-left: 10px;\n cursor: auto;\n}\n\n.cesium-cesiumInspector-slider input[type=\"number\"]::-webkit-outer-spin-button,\n.cesium-cesiumInspector-slider input[type=\"number\"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.cesium-cesiumInspector-slider input[type=\"range\"] {\n margin-left: 5px;\n vertical-align: middle;\n}\n\n.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor {\n display: none;\n}\n\n.cesium-cesiumInspector-styleEditor {\n padding: 10px;\n border-radius: 5px;\n background: rgba(48, 51, 54, 0.8);\n border: 1px solid #444;\n}\n\n.cesium-cesiumInspector-styleEditor textarea {\n width: 100%;\n height: 300px;\n background: transparent;\n color: #edffff;\n border: none;\n padding: 0;\n white-space: pre;\n overflow-wrap: normal;\n overflow-x: auto;\n}\n\n.cesium-3DTilesInspector {\n width: 300px;\n pointer-events: all;\n}\n\n.cesium-3DTilesInspector-statistics {\n font-size: 11px;\n}\n\n.cesium-3DTilesInspector-disabledElementsInfo {\n margin: 5px 0 0 0;\n padding: 0 0 0 20px;\n color: #eed202;\n}\n\n.cesium-3DTilesInspector div,\n.cesium-3DTilesInspector input[type=\"range\"] {\n width: 100%;\n box-sizing: border-box;\n}\n\n.cesium-cesiumInspector-error {\n color: #ff9e9e;\n overflow: auto;\n}\n\n.cesium-3DTilesInspector .cesium-cesiumInspector-section {\n margin-top: 3px;\n}\n\n.cesium-3DTilesInspector\n .cesium-cesiumInspector-sectionHeader\n + .cesium-cesiumInspector-show {\n border-top: 1px solid white;\n}\n\ninput.cesium-cesiumInspector-url {\n overflow: hidden;\n white-space: nowrap;\n overflow-x: scroll;\n background-color: transparent;\n color: white;\n outline: none;\n border: none;\n height: 1em;\n width: 100%;\n}\n\n.cesium-cesiumInspector .field-group {\n display: table;\n}\n\n.cesium-cesiumInspector .field-group > label {\n display: table-cell;\n font-weight: bold;\n}\n\n.cesium-cesiumInspector .field-group > .field {\n display: table-cell;\n width: 100%;\n}\n", ".cesium-button.cesium-fullscreenButton {\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n}\n", ".cesium-button.cesium-vrButton {\n display: block;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n}\n", ".cesium-viewer-geocoderContainer .cesium-geocoder-input {\n border: solid 1px #444;\n background-color: rgba(40, 40, 40, 0.7);\n color: white;\n display: inline-block;\n vertical-align: middle;\n width: 0;\n height: 32px;\n margin: 0;\n padding: 0 32px 0 0;\n border-radius: 0;\n box-sizing: border-box;\n transition: width ease-in-out 0.25s, background-color 0.2s ease-in-out;\n -webkit-appearance: none;\n}\n\n.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {\n border-color: #aef;\n box-shadow: 0 0 8px #fff;\n}\n\n.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus {\n border-color: #ea4;\n background-color: rgba(15, 15, 15, 0.9);\n box-shadow: none;\n outline: none;\n}\n\n.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,\n.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,\n.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide {\n padding-left: 4px;\n width: 250px;\n}\n\n.cesium-viewer-geocoderContainer .search-results {\n position: absolute;\n background-color: #000;\n color: #eee;\n overflow-y: auto;\n opacity: 0.8;\n width: 100%;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul li {\n font-size: 14px;\n padding: 3px 10px;\n}\n.cesium-viewer-geocoderContainer .search-results ul li:hover {\n cursor: pointer;\n}\n\n.cesium-viewer-geocoderContainer .search-results ul li.active {\n background: #48b;\n}\n\n.cesium-geocoder-searchButton {\n background-color: #303336;\n display: inline-block;\n position: absolute;\n cursor: pointer;\n width: 32px;\n top: 1px;\n right: 1px;\n height: 30px;\n vertical-align: middle;\n fill: #edffff;\n}\n\n.cesium-geocoder-searchButton:hover {\n background-color: #48b;\n}\n", ".cesium-infoBox {\n display: block;\n position: absolute;\n top: 50px;\n right: 0;\n width: 40%;\n max-width: 480px;\n background: rgba(38, 38, 38, 0.95);\n color: #edffff;\n border: 1px solid #444;\n border-right: none;\n border-top-left-radius: 7px;\n border-bottom-left-radius: 7px;\n box-shadow: 0 0 10px 1px #000;\n transform: translate(100%, 0);\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in, transform 0.2s ease-in;\n}\n\n.cesium-infoBox-visible {\n transform: translate(0, 0);\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n}\n\n.cesium-infoBox-title {\n display: block;\n height: 20px;\n padding: 5px 30px 5px 25px;\n background: rgba(84, 84, 84, 1);\n border-top-left-radius: 7px;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: content-box;\n}\n\n.cesium-infoBox-bodyless .cesium-infoBox-title {\n border-bottom-left-radius: 7px;\n}\n\nbutton.cesium-infoBox-camera {\n display: block;\n position: absolute;\n top: 4px;\n left: 4px;\n width: 22px;\n height: 22px;\n background: transparent;\n border-color: transparent;\n border-radius: 3px;\n padding: 0 5px;\n margin: 0;\n}\n\nbutton.cesium-infoBox-close {\n display: block;\n position: absolute;\n top: 5px;\n right: 5px;\n height: 20px;\n background: transparent;\n border: none;\n border-radius: 2px;\n font-weight: bold;\n font-size: 16px;\n padding: 0 5px;\n margin: 0;\n color: #edffff;\n}\n\nbutton.cesium-infoBox-close:focus {\n background: rgba(238, 136, 0, 0.44);\n outline: none;\n}\n\nbutton.cesium-infoBox-close:hover {\n background: #888;\n color: #000;\n}\n\nbutton.cesium-infoBox-close:active {\n background: #a00;\n color: #000;\n}\n\n.cesium-infoBox-bodyless .cesium-infoBox-iframe {\n display: none;\n}\n\n.cesium-infoBox-iframe {\n border: none;\n width: 100%; /* Fallback */\n width: calc(100% - 2px);\n}\n", "span.cesium-sceneModePicker-wrapper {\n display: inline-block;\n position: relative;\n margin: 0 3px;\n}\n\n.cesium-sceneModePicker-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.25s linear;\n}\n\n.cesium-sceneModePicker-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.25s, opacity 0.25s linear;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none {\n display: none;\n}\n\n.cesium-sceneModePicker-slide-svg {\n transition: left 2s;\n top: 0;\n left: 0;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon {\n box-sizing: border-box;\n padding: 0;\n margin: 3px 0;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D {\n margin: 0 0 3px 0;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button3D\n .cesium-sceneModePicker-icon2D {\n left: 100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button3D\n .cesium-sceneModePicker-iconColumbusView {\n left: 200%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-buttonColumbusView\n .cesium-sceneModePicker-icon3D {\n left: -200%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-buttonColumbusView\n .cesium-sceneModePicker-icon2D {\n left: -100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button2D\n .cesium-sceneModePicker-icon3D {\n left: -100%;\n}\n\n.cesium-sceneModePicker-wrapper\n .cesium-sceneModePicker-button2D\n .cesium-sceneModePicker-iconColumbusView {\n left: 100%;\n}\n\n.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected {\n border-color: #2e2;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n", "span.cesium-projectionPicker-wrapper {\n display: inline-block;\n position: relative;\n margin: 0 3px;\n}\n\n.cesium-projectionPicker-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.25s linear;\n}\n\n.cesium-projectionPicker-hidden {\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.25s, opacity 0.25s linear;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-none {\n display: none;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon {\n box-sizing: border-box;\n padding: 0;\n margin: 3px 0;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic {\n margin: 0 0 3px 0;\n}\n\n.cesium-projectionPicker-wrapper\n .cesium-projectionPicker-buttonPerspective\n .cesium-projectionPicker-iconOrthographic {\n left: 100%;\n}\n\n.cesium-projectionPicker-wrapper\n .cesium-projectionPicker-buttonOrthographic\n .cesium-projectionPicker-iconPerspective {\n left: -100%;\n}\n\n.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected {\n border-color: #2e2;\n box-shadow: 0 0 8px #fff, 0 0 8px #fff;\n}\n", ".cesium-performance-watchdog-message-area {\n position: relative;\n background-color: yellow;\n color: black;\n padding: 10px;\n}\n\n.cesium-performance-watchdog-message {\n margin-right: 30px;\n}\n\n.cesium-performance-watchdog-message-dismiss {\n position: absolute;\n right: 0;\n margin: 0 10px 0 0;\n}\n", ".cesium-navigationHelpButton-wrapper {\n position: relative;\n display: inline-block;\n}\n\n.cesium-navigation-help {\n visibility: hidden;\n position: absolute;\n top: 38px;\n right: 2px;\n width: 250px;\n border-radius: 10px;\n transform: scale(0.01);\n transform-origin: 234px -10px;\n transition: visibility 0s 0.25s, transform 0.25s ease-in;\n}\n\n.cesium-navigation-help-visible {\n visibility: visible;\n transform: scale(1);\n transition: transform 0.25s ease-out;\n}\n\n.cesium-navigation-help-instructions {\n border: 1px solid #444;\n background-color: rgba(38, 38, 38, 0.75);\n padding-bottom: 5px;\n border-radius: 0 0 10px 10px;\n}\n\n.cesium-click-navigation-help {\n display: none;\n}\n\n.cesium-touch-navigation-help {\n display: none;\n padding-top: 5px;\n}\n\n.cesium-click-navigation-help-visible {\n display: block;\n}\n\n.cesium-touch-navigation-help-visible {\n display: block;\n}\n\n.cesium-navigation-help-pan {\n color: #66ccff;\n font-weight: bold;\n}\n\n.cesium-navigation-help-zoom {\n color: #65fd00;\n font-weight: bold;\n}\n\n.cesium-navigation-help-rotate {\n color: #ffd800;\n font-weight: bold;\n}\n\n.cesium-navigation-help-tilt {\n color: #d800d8;\n font-weight: bold;\n}\n\n.cesium-navigation-help-details {\n color: #ffffff;\n}\n\n.cesium-navigation-button {\n color: #fff;\n background-color: transparent;\n border-bottom: none;\n border-top: 1px solid #444;\n border-right: 1px solid #444;\n margin: 0;\n width: 50%;\n cursor: pointer;\n}\n\n.cesium-navigation-button-icon {\n vertical-align: middle;\n padding: 5px 1px;\n}\n\n.cesium-navigation-button:focus {\n outline: none;\n}\n\n.cesium-navigation-button-left {\n border-radius: 10px 0 0 0;\n border-left: 1px solid #444;\n}\n\n.cesium-navigation-button-right {\n border-radius: 0 10px 0 0;\n border-left: none;\n}\n\n.cesium-navigation-button-selected {\n background-color: rgba(38, 38, 38, 0.75);\n}\n\n.cesium-navigation-button-unselected {\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.cesium-navigation-button-unselected:hover {\n background-color: rgba(76, 76, 76, 0.75);\n}\n", ".cesium-selection-wrapper {\n position: absolute;\n width: 160px;\n height: 160px;\n pointer-events: none;\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s 0.2s, opacity 0.2s ease-in;\n}\n\n.cesium-selection-wrapper-visible {\n visibility: visible;\n opacity: 1;\n transition: opacity 0.2s ease-out;\n}\n\n.cesium-selection-wrapper svg {\n fill: #2e2;\n stroke: #000;\n stroke-width: 1.1px;\n}\n", ".cesium-timeline-main {\n position: relative;\n left: 0;\n bottom: 0;\n overflow: hidden;\n border: solid 1px #888;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cesium-timeline-trackContainer {\n width: 100%;\n overflow: auto;\n border-top: solid 1px #888;\n position: relative;\n top: 0;\n left: 0;\n}\n\n.cesium-timeline-tracks {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.cesium-timeline-needle {\n position: absolute;\n left: 0;\n top: 1.7em;\n bottom: 0;\n width: 1px;\n background: #f00;\n}\n\n.cesium-timeline-bar {\n position: relative;\n left: 0;\n top: 0;\n overflow: hidden;\n cursor: pointer;\n width: 100%;\n height: 1.7em;\n background: linear-gradient(\n to bottom,\n rgba(116, 117, 119, 0.8) 0%,\n rgba(58, 68, 82, 0.8) 11%,\n rgba(46, 50, 56, 0.8) 46%,\n rgba(53, 53, 53, 0.8) 81%,\n rgba(53, 53, 53, 0.8) 100%\n );\n}\n\n.cesium-timeline-ruler {\n /* NOTE: The label and the ruler must use the same font/size */\n visibility: hidden;\n white-space: nowrap;\n font-size: 80%;\n z-index: -200;\n}\n\n.cesium-timeline-highlight {\n position: absolute;\n bottom: 0;\n left: 0;\n background: #08f;\n}\n\n.cesium-timeline-ticLabel {\n position: absolute;\n top: 0;\n left: 0;\n white-space: nowrap;\n font-size: 80%;\n color: #eee;\n}\n\n.cesium-timeline-ticMain {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 50%;\n background: #eee;\n}\n\n.cesium-timeline-ticSub {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 33%;\n background: #aaa;\n}\n\n.cesium-timeline-ticTiny {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 1px;\n height: 25%;\n background: #888;\n}\n\n.cesium-timeline-icon16 {\n display: block;\n position: absolute;\n width: 16px;\n height: 16px;\n background-image: url(\"../Images/TimelineIcons.png\");\n background-repeat: no-repeat;\n}\n", ".cesium-viewer {\n font-family: sans-serif;\n font-size: 16px;\n overflow: hidden;\n display: block;\n position: relative;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.cesium-viewer-cesiumWidgetContainer {\n width: 100%;\n height: 100%;\n}\n\n.cesium-viewer-bottom {\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n padding-right: 5px;\n}\n\n.cesium-viewer .cesium-widget-credits {\n display: inline;\n position: static;\n bottom: auto;\n left: auto;\n padding-right: 0;\n color: #ffffff;\n font-size: 10px;\n text-shadow: 0 0 2px #000000;\n}\n\n.cesium-viewer-timelineContainer {\n position: absolute;\n bottom: 0;\n left: 169px;\n right: 29px;\n height: 27px;\n padding: 0;\n margin: 0;\n overflow: hidden;\n font-size: 14px;\n}\n\n.cesium-viewer-animationContainer {\n position: absolute;\n bottom: 0;\n left: 0;\n padding: 0;\n width: 169px;\n height: 112px;\n}\n\n.cesium-viewer-fullscreenContainer {\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0;\n width: 29px;\n height: 29px;\n overflow: hidden;\n}\n\n.cesium-viewer-vrContainer {\n position: absolute;\n bottom: 0;\n right: 0;\n padding: 0;\n width: 29px;\n height: 29px;\n overflow: hidden;\n}\n\n.cesium-viewer-toolbar {\n display: block;\n position: absolute;\n top: 5px;\n right: 5px;\n}\n\n.cesium-viewer-cesiumInspectorContainer {\n display: block;\n position: absolute;\n top: 50px;\n right: 10px;\n}\n\n.cesium-viewer-geocoderContainer {\n position: relative;\n display: inline-block;\n margin: 0 3px;\n}\n\n.cesium-viewer-cesium3DTilesInspectorContainer {\n display: block;\n position: absolute;\n top: 50px;\n right: 10px;\n max-height: calc(100% - 120px);\n box-sizing: border-box;\n overflow-y: auto;\n overflow-x: hidden;\n}\n"], - "mappings": "AAAA,oBACE,kBACA,MACA,OACA,WACA,YACA,gBAGF,eACE,qBACA,kBACA,mBACA,sBACA,cACA,aAfF,kDAmBE,eACA,gBACA,sBACA,yBACA,qBACA,iBAGF,qBACE,WACA,UACA,kBACA,aAGF,qBACE,WACA,UACA,gBACA,kBACA,wBAGF,sBACE,WACA,UACA,gBACA,kBACA,wBAGF,2IAKE,mBACA,kBACA,cACA,aACA,gBACA,eAGF,sBACE,sBACA,WAGF,+BACE,WAGF,0CAEE,eAGF,qBACE,mBAGF,uBACE,sBACA,WACA,YApFF,4BAuFE,sBACA,UAGF,4CACE,kBACA,SACA,WACA,iBAGF,2BACE,2BAnGF,8BAsGE,sBACA,yBAGF,+BACE,WAGF,qCACE,WAGF,8BACE,WCnHF,wBACE,kBACA,cACA,kBACA,aAGF,8BACE,WAGF,6BACE,cAGF,8BACE,WAGF,gCACE,WAGF,4BACE,WAGF,+BACE,WAGF,8BACE,WAGF,mCACE,WAGF,0BACE,aACA,uBACA,eACA,mBAGF,wBACE,UACA,iBACA,YAGF,6BACE,eACA,sBACA,yBACA,qBACA,iBAGF,0DACE,UACA,YAEA,aAGF,gEACE,cAGF,0DACE,aAGF,0DAEE,YACA,iBAGF,gEAEE,YAGF,iEACE,aAGF,iCACE,sBACA,yBACA,qBACA,iBAGF,8DAEE,YAGF,8DACE,aAGF,8DACE,aAGF,6DACE,cACA,UAGF,6DACE,YAGF,mEACE,UAGF,mEACE,YAGF,8GACE,eAuBF,kCACE,aACA,gBACA,YACA,iBAGF,yCACE,YACA,eACA,kBACA,qBAGF,4BAEE,eACA,YACA,iBAGF,4BAEE,eC9KF,iCACE,kBACA,MACA,OACA,WACA,YACA,YAGF,iCACE,cACA,kBACA,uBACA,SACA,QACA,YACA,iBACA,eACA,2BACA,sBAnBF,YAqBE,cArBF,mBAuBE,sBACA,yBACA,qBACA,iBACA,2BACA,kBACA,UACA,uEAGF,yCACE,uBACA,mBACA,UACA,uDAGF,qCACE,cACA,uBACA,eACA,gBACA,cACA,kBAGF,gCACE,kBAGF,sCACE,cACA,eAGF,gCACE,cACA,sBA5DF,gCAiEA,6BACE,qBACA,mBAnEF,eAqEE,WACA,kBACA,eAGF,kCACE,cACA,uBACA,cACA,kBACA,sBACA,cACA,eACA,qBAGF,0IAEE,0BAGF,iCACE,qBACA,kBACA,cACA,YACA,0BACA,sBAhGF,kBAkGE,cAlGF,mBAqGE,eACA,sBAGF,oEACE,kBACA,qCAGF,uEACE,cAGF,sEACE,mCCnHF,eACE,kBAGF,qCAEE,WACA,YACA,kBAGF,uBACE,cACA,kBACA,SACA,OACA,WACA,eACA,gCACA,kBAGF,0DAEE,WAGF,0BACE,kBA5BF,QAiCE,kBACA,0BACA,cAGF,iCACE,qBACA,sBACA,YACA,WAGF,kCACE,UACA,gBACA,qBACA,gBACA,sBACA,yBAnDF,kBAqDE,yBACA,eACA,cAGF,2CACE,cAGF,iCACE,eACA,gDACA,mBACA,gCAlEF,uCAwEA,iCACE,cACA,gDACA,qBA3EF,kCAgFA,sCAhFA,kCAmFE,iBAGF,6CACE,qBACA,mBACA,cAzFF,SA4FA,mDACE,qBACA,mBACA,cAEF,mDACE,qBACA,mBACA,cAEF,oDACE,qBACA,mBACA,cAGF,uCACE,0BACA,eAGF,6CACE,cClHF,0CAEE,kCACA,6BACA,sBACA,cACA,qBACA,kBAPF,iBASE,sBACA,yBACA,qBACA,iBACA,gBAGF,+BACE,kBACA,eAGF,+DACE,6BACA,mBAGF,qEAEE,eAGF,gCACE,YACA,YAGF,+BACE,YACA,YAGF,uCACE,iBAGF,iFAEE,aA/CF,oBAiDE,gBAGF,iCApDA,aAsDE,uBACA,eACA,YAGF,0CA3DA,YA8DE,2BAGF,mCACE,2BACA,sBACA,cApEF,kCAuEE,eACA,sBACA,yBACA,qBACA,iBA3EF,cA+EA,yCACE,aAGF,sFAEE,WACA,gBACA,kBACA,wBAGF,+BACE,kBAGF,sCACE,gBACA,eAjGF,SAmGE,eAGF,oCACE,sBAvGF,8BA0GE,kBAGF,uCACE,mBACA,2BAGF,iCACE,oBACA,6BAGF,qCACE,iBAGF,6CACE,iBACA,YACA,UACA,qBAGF,uFAEE,YCpIF,8CAEE,gBACA,mBAGF,0EACE,0BAGF,+BACE,eAGF,kDACE,gBACA,sBACA,aACA,sBACA,cACA,YApBF,8BAuBE,iBACA,YAGF,0JAEE,wBA7BF,SAiCA,iDACE,gBACA,sBAGF,iEACE,aAGF,oCA1CA,+BA6CE,6BACA,sBAGF,6CACE,WACA,aACA,uBACA,cACA,YAtDF,UAwDE,gBACA,qBACA,gBAGF,yBACE,YACA,mBAGF,oCACE,eAGF,8CAtEA,kCAyEE,cAGF,wEAEE,WACA,sBAGF,8BACE,cACA,cAGF,yDACE,eAGF,4FAGE,2BAGF,iCACE,gBACA,mBACA,kBACA,6BACA,WACA,aACA,YACA,WACA,WAGF,qCACE,cAGF,2CACE,mBACA,gBAGF,4CACE,mBACA,WCxHF,uCACE,cACA,WACA,YAHF,yBCAA,+BACE,cACA,WACA,YAHF,yBCAA,wDACE,sBACA,2BACA,WACA,qBACA,sBACA,QACA,YAPF,4CAWE,sBACA,mEACA,wBAGF,8DACE,kBACA,wBAGF,8DACE,kBACA,2BACA,gBACA,aAGF,yLAGE,iBACA,YAGF,iDACE,kBACA,sBACA,WACA,gBACA,WACA,WAGF,oDACE,qBA7CF,mBAkDA,uDACE,eAnDF,iBAsDA,6DACE,eAGF,8DACE,gBAGF,8BACE,yBACA,qBACA,kBACA,eACA,WACA,QACA,UACA,YACA,sBACA,aAGF,oCACE,sBC5EF,gBACE,cACA,kBACA,SACA,QACA,UACA,gBACA,8BACA,cACA,sBACA,kBACA,2BACA,8BACA,6BACA,0BACA,kBACA,UACA,uEAGF,wBACE,uBACA,mBACA,UACA,uDAGF,sBACE,cACA,YA7BF,0BA+BE,4BACA,2BACA,kBACA,uBACA,mBACA,gBACA,uBAGF,+CACE,8BAGF,6BACE,cACA,kBACA,QACA,SACA,WACA,YACA,uBACA,yBApDF,yCA0DA,4BACE,cACA,kBACA,QACA,UACA,YACA,uBACA,YAjEF,kBAmEE,gBACA,eApEF,uBAuEE,cAGF,kCACE,+BACA,aAGF,kCACE,gBACA,WAGF,mCACE,gBACA,WAGF,gDACE,aAGF,uBACE,YACA,WACA,uBChGF,oCACE,qBACA,kBAFF,aAMA,gCACE,mBACA,UACA,+BAGF,+BACE,kBACA,UACA,kDAGF,6DACE,aAGF,kCACE,mBACA,MACA,OAGF,sEACE,sBA7BF,uBAkCA,6MAlCA,eAwCA,gGAGE,UAGF,0GAGE,UAGF,0GAGE,WAGF,0MAGE,WASF,0GAGE,UAGF,iEACE,kBACA,qCC9EF,qCACE,qBACA,kBAFF,aAMA,iCACE,mBACA,UACA,+BAGF,gCACE,kBACA,UACA,kDAGF,+DACE,aAGF,wEACE,sBAvBF,uBA4BA,yJA5BA,eAiCA,sHAGE,UAGF,sHAGE,WAGF,mEACE,kBACA,qCC/CF,0CACE,kBACA,sBACA,WAHF,aAOA,qCACE,kBAGF,6CACE,kBACA,QAbF,kBCAA,qCACE,kBACA,qBAGF,wBACE,kBACA,kBACA,SACA,UACA,YAVF,mBAYE,qBACA,6BACA,qDAGF,gCACE,mBACA,mBACA,mCAGF,qCACE,sBACA,2BACA,mBA1BF,4BA8BA,8BACE,aAGF,8BACE,aACA,gBAGF,4EACE,cAOF,4BACE,WACA,gBAGF,6BACE,cACA,gBAGF,+BACE,cACA,gBAGF,6BACE,cACA,gBAGF,gCACE,WAGF,0BACE,WACA,6BACA,mBACA,0BACA,4BA5EF,SA8EE,UACA,eAGF,+BACE,sBAnFF,gBAuFA,gCACE,aAGF,+BA3FA,uBA6FE,2BAGF,gCAhGA,yBAkGE,iBAGF,mCACE,2BAGF,qCACE,2BAGF,2CACE,2BC9GF,0BACE,kBACA,YACA,aACA,oBACA,kBACA,UACA,iDAGF,kCACE,mBACA,UACA,gCAGF,8BACE,UACA,YACA,mBCnBF,sBACE,kBACA,OACA,SACA,gBACA,sBACA,sBACA,yBACA,qBACA,iBAGF,gCACE,WACA,cACA,0BACA,kBACA,MACA,OAGF,wBACE,kBACA,MACA,OACA,WAGF,wBACE,kBACA,OACA,UACA,SACA,UACA,gBAGF,qBACE,kBACA,OACA,MACA,gBACA,eACA,WACA,aACA,uJAUF,uBAEE,kBACA,mBACA,cACA,aAGF,2BACE,kBACA,SACA,OACA,gBAGF,0BACE,kBACA,MACA,OACA,mBACA,cACA,WAGF,yBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,yBACE,kBACA,SACA,OACA,UACA,WACA,gBAGF,wBACE,cACA,kBACA,WACA,YACA,kkCACA,4BChHF,eACE,uBACA,eACA,gBACA,cACA,kBACA,MACA,OACA,WACA,YAGF,qCACE,WACA,YAGF,sBACE,cACA,kBACA,SACA,OACA,kBAGF,sCACE,eACA,gBACA,YACA,UACA,gBACA,WACA,eACA,4BAGF,iCACE,kBACA,SACA,WACA,WACA,YAzCF,mBA4CE,gBACA,eAGF,kCACE,kBACA,SACA,OAnDF,UAqDE,YACA,aAGF,8DACE,kBACA,SACA,QA5DF,UA8DE,WACA,YACA,gBAaF,uBACE,cACA,kBACA,QACA,UAGF,wCACE,cACA,kBACA,SACA,WAGF,iCACE,kBACA,qBA7FF,aAiGA,+CACE,cACA,kBACA,SACA,WACA,8BACA,sBACA,gBACA", - "names": [] -} diff --git a/src/renderer/public/sdk/Cesium/Workers/AxisAlignedBoundingBox-cc32292c.js b/src/renderer/public/sdk/Cesium/Workers/AxisAlignedBoundingBox-cc32292c.js deleted file mode 100644 index 4b8ce56..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/AxisAlignedBoundingBox-cc32292c.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./Transforms-7ac1f9ee"],(function(e,n,t,i){"use strict";function a(e,i,a){this.minimum=n.Cartesian3.clone(t.defaultValue(e,n.Cartesian3.ZERO)),this.maximum=n.Cartesian3.clone(t.defaultValue(i,n.Cartesian3.ZERO)),a=t.defined(a)?n.Cartesian3.clone(a):n.Cartesian3.midpoint(this.minimum,this.maximum,new n.Cartesian3),this.center=a}a.fromCorners=function(e,i,m){return t.defined(m)||(m=new a),m.minimum=n.Cartesian3.clone(e,m.minimum),m.maximum=n.Cartesian3.clone(i,m.maximum),m.center=n.Cartesian3.midpoint(e,i,m.center),m},a.fromPoints=function(e,i){if(t.defined(i)||(i=new a),!t.defined(e)||0===e.length)return i.minimum=n.Cartesian3.clone(n.Cartesian3.ZERO,i.minimum),i.maximum=n.Cartesian3.clone(n.Cartesian3.ZERO,i.maximum),i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i;let m=e[0].x,r=e[0].y,s=e[0].z,u=e[0].x,c=e[0].y,o=e[0].z;const l=e.length;for(let n=1;n<l;n++){const t=e[n],i=t.x,a=t.y,l=t.z;m=Math.min(i,m),u=Math.max(i,u),r=Math.min(a,r),c=Math.max(a,c),s=Math.min(l,s),o=Math.max(l,o)}const f=i.minimum;f.x=m,f.y=r,f.z=s;const C=i.maximum;return C.x=u,C.y=c,C.z=o,i.center=n.Cartesian3.midpoint(f,C,i.center),i},a.clone=function(e,i){if(t.defined(e))return t.defined(i)?(i.minimum=n.Cartesian3.clone(e.minimum,i.minimum),i.maximum=n.Cartesian3.clone(e.maximum,i.maximum),i.center=n.Cartesian3.clone(e.center,i.center),i):new a(e.minimum,e.maximum,e.center)},a.equals=function(e,i){return e===i||t.defined(e)&&t.defined(i)&&n.Cartesian3.equals(e.center,i.center)&&n.Cartesian3.equals(e.minimum,i.minimum)&&n.Cartesian3.equals(e.maximum,i.maximum)};let m=new n.Cartesian3;a.intersectPlane=function(e,t){m=n.Cartesian3.subtract(e.maximum,e.minimum,m);const a=n.Cartesian3.multiplyByScalar(m,.5,m),r=t.normal,s=a.x*Math.abs(r.x)+a.y*Math.abs(r.y)+a.z*Math.abs(r.z),u=n.Cartesian3.dot(e.center,r)+t.distance;return u-s>0?i.Intersect.INSIDE:u+s<0?i.Intersect.OUTSIDE:i.Intersect.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},e.AxisAlignedBoundingBox=a})); diff --git a/src/renderer/public/sdk/Cesium/Workers/BoundingRectangle-766f44ee.js b/src/renderer/public/sdk/Cesium/Workers/BoundingRectangle-766f44ee.js deleted file mode 100644 index a825fed..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/BoundingRectangle-766f44ee.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./Transforms-7ac1f9ee"],(function(t,e,n,i){"use strict";function h(t,e,i,h){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.width=n.defaultValue(i,0),this.height=n.defaultValue(h,0)}h.packedLength=4,h.pack=function(t,e,i){return i=n.defaultValue(i,0),e[i++]=t.x,e[i++]=t.y,e[i++]=t.width,e[i]=t.height,e},h.unpack=function(t,e,i){return e=n.defaultValue(e,0),n.defined(i)||(i=new h),i.x=t[e++],i.y=t[e++],i.width=t[e++],i.height=t[e],i},h.fromPoints=function(t,e){if(n.defined(e)||(e=new h),!n.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;const i=t.length;let r=t[0].x,u=t[0].y,d=t[0].x,a=t[0].y;for(let e=1;e<i;e++){const n=t[e],i=n.x,h=n.y;r=Math.min(i,r),d=Math.max(i,d),u=Math.min(h,u),a=Math.max(h,a)}return e.x=r,e.y=u,e.width=d-r,e.height=a-u,e};const r=new i.GeographicProjection,u=new e.Cartographic,d=new e.Cartographic;h.fromRectangle=function(t,i,a){if(n.defined(a)||(a=new h),!n.defined(t))return a.x=0,a.y=0,a.width=0,a.height=0,a;const c=(i=n.defaultValue(i,r)).project(e.Rectangle.southwest(t,u)),o=i.project(e.Rectangle.northeast(t,d));return e.Cartesian2.subtract(o,c,o),a.x=c.x,a.y=c.y,a.width=o.x,a.height=o.y,a},h.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new h(t.x,t.y,t.width,t.height)},h.union=function(t,e,i){n.defined(i)||(i=new h);const r=Math.min(t.x,e.x),u=Math.min(t.y,e.y),d=Math.max(t.x+t.width,e.x+e.width),a=Math.max(t.y+t.height,e.y+e.height);return i.x=r,i.y=u,i.width=d-r,i.height=a-u,i},h.expand=function(t,e,n){n=h.clone(t,n);const i=e.x-n.x,r=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=e.y),n},h.intersect=function(t,e){const n=t.x,h=t.y,r=e.x,u=e.y;return n>r+e.width||n+t.width<r||h+t.height<u||h>u+e.height?i.Intersect.OUTSIDE:i.Intersect.INTERSECTING},h.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},h.prototype.clone=function(t){return h.clone(this,t)},h.prototype.intersect=function(t){return h.intersect(this,t)},h.prototype.equals=function(t){return h.equals(this,t)},t.BoundingRectangle=h})); diff --git a/src/renderer/public/sdk/Cesium/Workers/BoxGeometry-4a1f7949.js b/src/renderer/public/sdk/Cesium/Workers/BoxGeometry-4a1f7949.js deleted file mode 100644 index 24c7fc9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/BoxGeometry-4a1f7949.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./VertexFormat-fa0c27e8"],(function(t,e,n,a,r,i,o,m,u){"use strict";const s=new n.Cartesian3;function y(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,i=r.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT);this._minimum=n.Cartesian3.clone(e),this._maximum=n.Cartesian3.clone(a),this._vertexFormat=i,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}y.fromDimensions=function(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).dimensions,a=n.Cartesian3.multiplyByScalar(e,.5,new n.Cartesian3);return new y({minimum:n.Cartesian3.negate(a,new n.Cartesian3),maximum:a,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},y.fromAxisAlignedBoundingBox=function(t){return new y({minimum:t.minimum,maximum:t.maximum})},y.packedLength=2*n.Cartesian3.packedLength+u.VertexFormat.packedLength+1,y.pack=function(t,e,a){return a=r.defaultValue(a,0),n.Cartesian3.pack(t._minimum,e,a),n.Cartesian3.pack(t._maximum,e,a+n.Cartesian3.packedLength),u.VertexFormat.pack(t._vertexFormat,e,a+2*n.Cartesian3.packedLength),e[a+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength]=r.defaultValue(t._offsetAttribute,-1),e};const c=new n.Cartesian3,p=new n.Cartesian3,x=new u.VertexFormat,f={minimum:c,maximum:p,vertexFormat:x,offsetAttribute:void 0};let l;y.unpack=function(t,e,a){e=r.defaultValue(e,0);const i=n.Cartesian3.unpack(t,e,c),o=n.Cartesian3.unpack(t,e+n.Cartesian3.packedLength,p),m=u.VertexFormat.unpack(t,e+2*n.Cartesian3.packedLength,x),s=t[e+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength];return r.defined(a)?(a._minimum=n.Cartesian3.clone(i,a._minimum),a._maximum=n.Cartesian3.clone(o,a._maximum),a._vertexFormat=u.VertexFormat.clone(m,a._vertexFormat),a._offsetAttribute=-1===s?void 0:s,a):(f.offsetAttribute=-1===s?void 0:s,new y(f))},y.createGeometry=function(t){const u=t._minimum,y=t._maximum,c=t._vertexFormat;if(n.Cartesian3.equals(u,y))return;const p=new o.GeometryAttributes;let x,f;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(f=new Float64Array(72),f[0]=u.x,f[1]=u.y,f[2]=y.z,f[3]=y.x,f[4]=u.y,f[5]=y.z,f[6]=y.x,f[7]=y.y,f[8]=y.z,f[9]=u.x,f[10]=y.y,f[11]=y.z,f[12]=u.x,f[13]=u.y,f[14]=u.z,f[15]=y.x,f[16]=u.y,f[17]=u.z,f[18]=y.x,f[19]=y.y,f[20]=u.z,f[21]=u.x,f[22]=y.y,f[23]=u.z,f[24]=y.x,f[25]=u.y,f[26]=u.z,f[27]=y.x,f[28]=y.y,f[29]=u.z,f[30]=y.x,f[31]=y.y,f[32]=y.z,f[33]=y.x,f[34]=u.y,f[35]=y.z,f[36]=u.x,f[37]=u.y,f[38]=u.z,f[39]=u.x,f[40]=y.y,f[41]=u.z,f[42]=u.x,f[43]=y.y,f[44]=y.z,f[45]=u.x,f[46]=u.y,f[47]=y.z,f[48]=u.x,f[49]=y.y,f[50]=u.z,f[51]=y.x,f[52]=y.y,f[53]=u.z,f[54]=y.x,f[55]=y.y,f[56]=y.z,f[57]=u.x,f[58]=y.y,f[59]=y.z,f[60]=u.x,f[61]=u.y,f[62]=u.z,f[63]=y.x,f[64]=u.y,f[65]=u.z,f[66]=y.x,f[67]=u.y,f[68]=y.z,f[69]=u.x,f[70]=u.y,f[71]=y.z,p.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})),c.normal){const t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,p.normal=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(c.st){const t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,p.st=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})}if(c.tangent){const t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,p.tangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}if(c.bitangent){const t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,p.bitangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}x=new Uint16Array(36),x[0]=0,x[1]=1,x[2]=2,x[3]=0,x[4]=2,x[5]=3,x[6]=6,x[7]=5,x[8]=4,x[9]=7,x[10]=6,x[11]=4,x[12]=8,x[13]=9,x[14]=10,x[15]=8,x[16]=10,x[17]=11,x[18]=14,x[19]=13,x[20]=12,x[21]=15,x[22]=14,x[23]=12,x[24]=18,x[25]=17,x[26]=16,x[27]=19,x[28]=18,x[29]=16,x[30]=20,x[31]=21,x[32]=22,x[33]=20,x[34]=22,x[35]=23}else f=new Float64Array(24),f[0]=u.x,f[1]=u.y,f[2]=u.z,f[3]=y.x,f[4]=u.y,f[5]=u.z,f[6]=y.x,f[7]=y.y,f[8]=u.z,f[9]=u.x,f[10]=y.y,f[11]=u.z,f[12]=u.x,f[13]=u.y,f[14]=y.z,f[15]=y.x,f[16]=u.y,f[17]=y.z,f[18]=y.x,f[19]=y.y,f[20]=y.z,f[21]=u.x,f[22]=y.y,f[23]=y.z,p.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),x=new Uint16Array(36),x[0]=4,x[1]=5,x[2]=6,x[3]=4,x[4]=6,x[5]=7,x[6]=1,x[7]=0,x[8]=3,x[9]=1,x[10]=3,x[11]=2,x[12]=1,x[13]=6,x[14]=5,x[15]=1,x[16]=2,x[17]=6,x[18]=2,x[19]=3,x[20]=7,x[21]=2,x[22]=7,x[23]=6,x[24]=3,x[25]=0,x[26]=4,x[27]=3,x[28]=4,x[29]=7,x[30]=0,x[31]=1,x[32]=5,x[33]=0,x[34]=5,x[35]=4;const l=n.Cartesian3.subtract(y,u,s),A=.5*n.Cartesian3.magnitude(l);if(r.defined(t._offsetAttribute)){const e=f.length,n=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,r=new Uint8Array(e/3).fill(n);p.applyOffset=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new i.Geometry({attributes:p,indices:x,primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:new e.BoundingSphere(n.Cartesian3.ZERO,A),offsetAttribute:t._offsetAttribute})},y.getUnitBox=function(){return r.defined(l)||(l=y.createGeometry(y.fromDimensions({dimensions:new n.Cartesian3(1,1,1),vertexFormat:u.VertexFormat.POSITION_ONLY}))),l},t.BoxGeometry=y})); diff --git a/src/renderer/public/sdk/Cesium/Workers/Color-a3d9edc7.js b/src/renderer/public/sdk/Cesium/Workers/Color-a3d9edc7.js deleted file mode 100644 index ed272a2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/Color-a3d9edc7.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./defaultValue-50f7432c","./Transforms-7ac1f9ee","./ComponentDatatype-9b23164a"],(function(e,r,t,o){"use strict";function f(e,r,t){return t<0&&(t+=1),t>1&&(t-=1),6*t<1?e+6*(r-e)*t:2*t<1?r:3*t<2?e+(r-e)*(2/3-t)*6:e}function s(e,t,o,f){this.red=r.defaultValue(e,1),this.green=r.defaultValue(t,1),this.blue=r.defaultValue(o,1),this.alpha=r.defaultValue(f,1)}let n,l,C;s.fromCartesian4=function(e,t){return r.defined(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(e,t,o,f,n){return e=s.byteToFloat(r.defaultValue(e,255)),t=s.byteToFloat(r.defaultValue(t,255)),o=s.byteToFloat(r.defaultValue(o,255)),f=s.byteToFloat(r.defaultValue(f,255)),r.defined(n)?(n.red=e,n.green=t,n.blue=o,n.alpha=f,n):new s(e,t,o,f)},s.fromAlpha=function(e,t,o){return r.defined(o)?(o.red=e.red,o.green=e.green,o.blue=e.blue,o.alpha=t,o):new s(e.red,e.green,e.blue,t)},t.FeatureDetection.supportsTypedArrays()&&(n=new ArrayBuffer(4),l=new Uint32Array(n),C=new Uint8Array(n)),s.fromRgba=function(e,r){return l[0]=e,s.fromBytes(C[0],C[1],C[2],C[3],r)},s.fromHsl=function(e,t,o,n,l){e=r.defaultValue(e,0)%1,t=r.defaultValue(t,0),o=r.defaultValue(o,0),n=r.defaultValue(n,1);let C=o,i=o,a=o;if(0!==t){let r;r=o<.5?o*(1+t):o+t-o*t;const s=2*o-r;C=f(s,r,e+1/3),i=f(s,r,e),a=f(s,r,e-1/3)}return r.defined(l)?(l.red=C,l.green=i,l.blue=a,l.alpha=n,l):new s(C,i,a,n)},s.fromRandom=function(e,t){let f=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).red;if(!r.defined(f)){const t=r.defaultValue(e.minimumRed,0),s=r.defaultValue(e.maximumRed,1);f=t+o.CesiumMath.nextRandomNumber()*(s-t)}let n=e.green;if(!r.defined(n)){const t=r.defaultValue(e.minimumGreen,0),f=r.defaultValue(e.maximumGreen,1);n=t+o.CesiumMath.nextRandomNumber()*(f-t)}let l=e.blue;if(!r.defined(l)){const t=r.defaultValue(e.minimumBlue,0),f=r.defaultValue(e.maximumBlue,1);l=t+o.CesiumMath.nextRandomNumber()*(f-t)}let C=e.alpha;if(!r.defined(C)){const t=r.defaultValue(e.minimumAlpha,0),f=r.defaultValue(e.maximumAlpha,1);C=t+o.CesiumMath.nextRandomNumber()*(f-t)}return r.defined(t)?(t.red=f,t.green=n,t.blue=l,t.alpha=C,t):new s(f,n,l,C)};const i=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,a=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,E=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,u=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;s.fromCssColorString=function(e,t){r.defined(t)||(t=new s);const o=s[(e=e.replace(/\s/g,"")).toUpperCase()];if(r.defined(o))return s.clone(o,t),t;let f=i.exec(e);return null!==f?(t.red=parseInt(f[1],16)/15,t.green=parseInt(f[2],16)/15,t.blue=parseInt(f[3],16)/15,t.alpha=parseInt(r.defaultValue(f[4],"f"),16)/15,t):(f=a.exec(e),null!==f?(t.red=parseInt(f[1],16)/255,t.green=parseInt(f[2],16)/255,t.blue=parseInt(f[3],16)/255,t.alpha=parseInt(r.defaultValue(f[4],"ff"),16)/255,t):(f=E.exec(e),null!==f?(t.red=parseFloat(f[1])/("%"===f[1].substr(-1)?100:255),t.green=parseFloat(f[2])/("%"===f[2].substr(-1)?100:255),t.blue=parseFloat(f[3])/("%"===f[3].substr(-1)?100:255),t.alpha=parseFloat(r.defaultValue(f[4],"1.0")),t):(f=u.exec(e),null!==f?s.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(r.defaultValue(f[4],"1.0")),t):t=void 0)))},s.packedLength=4,s.pack=function(e,t,o){return o=r.defaultValue(o,0),t[o++]=e.red,t[o++]=e.green,t[o++]=e.blue,t[o]=e.alpha,t},s.unpack=function(e,t,o){return t=r.defaultValue(t,0),r.defined(o)||(o=new s),o.red=e[t++],o.green=e[t++],o.blue=e[t++],o.alpha=e[t],o},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},s.equalsArray=function(e,r,t){return e.red===r[t]&&e.green===r[t+1]&&e.blue===r[t+2]&&e.alpha===r[t+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return this===e||r.defined(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},s.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},s.prototype.toCssColorString=function(){const e=s.floatToByte(this.red),r=s.floatToByte(this.green),t=s.floatToByte(this.blue);return 1===this.alpha?`rgb(${e},${r},${t})`:`rgba(${e},${r},${t},${this.alpha})`},s.prototype.toCssHexString=function(){let e=s.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let r=s.floatToByte(this.green).toString(16);r.length<2&&(r=`0${r}`);let t=s.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let o=s.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${e}${r}${t}${o}`}return`#${e}${r}${t}`},s.prototype.toBytes=function(e){const t=s.floatToByte(this.red),o=s.floatToByte(this.green),f=s.floatToByte(this.blue),n=s.floatToByte(this.alpha);return r.defined(e)?(e[0]=t,e[1]=o,e[2]=f,e[3]=n,e):[t,o,f,n]},s.prototype.toRgba=function(){return C[0]=s.floatToByte(this.red),C[1]=s.floatToByte(this.green),C[2]=s.floatToByte(this.blue),C[3]=s.floatToByte(this.alpha),l[0]},s.prototype.brighten=function(e,r){return e=1-e,r.red=1-(1-this.red)*e,r.green=1-(1-this.green)*e,r.blue=1-(1-this.blue)*e,r.alpha=this.alpha,r},s.prototype.darken=function(e,r){return e=1-e,r.red=this.red*e,r.green=this.green*e,r.blue=this.blue*e,r.alpha=this.alpha,r},s.prototype.withAlpha=function(e,r){return s.fromAlpha(this,e,r)},s.add=function(e,r,t){return t.red=e.red+r.red,t.green=e.green+r.green,t.blue=e.blue+r.blue,t.alpha=e.alpha+r.alpha,t},s.subtract=function(e,r,t){return t.red=e.red-r.red,t.green=e.green-r.green,t.blue=e.blue-r.blue,t.alpha=e.alpha-r.alpha,t},s.multiply=function(e,r,t){return t.red=e.red*r.red,t.green=e.green*r.green,t.blue=e.blue*r.blue,t.alpha=e.alpha*r.alpha,t},s.divide=function(e,r,t){return t.red=e.red/r.red,t.green=e.green/r.green,t.blue=e.blue/r.blue,t.alpha=e.alpha/r.alpha,t},s.mod=function(e,r,t){return t.red=e.red%r.red,t.green=e.green%r.green,t.blue=e.blue%r.blue,t.alpha=e.alpha%r.alpha,t},s.lerp=function(e,r,t,f){return f.red=o.CesiumMath.lerp(e.red,r.red,t),f.green=o.CesiumMath.lerp(e.green,r.green,t),f.blue=o.CesiumMath.lerp(e.blue,r.blue,t),f.alpha=o.CesiumMath.lerp(e.alpha,r.alpha,t),f},s.multiplyByScalar=function(e,r,t){return t.red=e.red*r,t.green=e.green*r,t.blue=e.blue*r,t.alpha=e.alpha*r,t},s.divideByScalar=function(e,r,t){return t.red=e.red/r,t.green=e.green/r,t.blue=e.blue/r,t.alpha=e.alpha/r,t},s.ALICEBLUE=Object.freeze(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=Object.freeze(s.fromCssColorString("#FAEBD7")),s.AQUA=Object.freeze(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=Object.freeze(s.fromCssColorString("#7FFFD4")),s.AZURE=Object.freeze(s.fromCssColorString("#F0FFFF")),s.BEIGE=Object.freeze(s.fromCssColorString("#F5F5DC")),s.BISQUE=Object.freeze(s.fromCssColorString("#FFE4C4")),s.BLACK=Object.freeze(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=Object.freeze(s.fromCssColorString("#FFEBCD")),s.BLUE=Object.freeze(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=Object.freeze(s.fromCssColorString("#8A2BE2")),s.BROWN=Object.freeze(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=Object.freeze(s.fromCssColorString("#DEB887")),s.CADETBLUE=Object.freeze(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=Object.freeze(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=Object.freeze(s.fromCssColorString("#D2691E")),s.CORAL=Object.freeze(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=Object.freeze(s.fromCssColorString("#6495ED")),s.CORNSILK=Object.freeze(s.fromCssColorString("#FFF8DC")),s.CRIMSON=Object.freeze(s.fromCssColorString("#DC143C")),s.CYAN=Object.freeze(s.fromCssColorString("#00FFFF")),s.DARKBLUE=Object.freeze(s.fromCssColorString("#00008B")),s.DARKCYAN=Object.freeze(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=Object.freeze(s.fromCssColorString("#B8860B")),s.DARKGRAY=Object.freeze(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=Object.freeze(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=Object.freeze(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=Object.freeze(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=Object.freeze(s.fromCssColorString("#556B2F")),s.DARKORANGE=Object.freeze(s.fromCssColorString("#FF8C00")),s.DARKORCHID=Object.freeze(s.fromCssColorString("#9932CC")),s.DARKRED=Object.freeze(s.fromCssColorString("#8B0000")),s.DARKSALMON=Object.freeze(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=Object.freeze(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=Object.freeze(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=Object.freeze(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=Object.freeze(s.fromCssColorString("#00CED1")),s.DARKVIOLET=Object.freeze(s.fromCssColorString("#9400D3")),s.DEEPPINK=Object.freeze(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=Object.freeze(s.fromCssColorString("#00BFFF")),s.DIMGRAY=Object.freeze(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=Object.freeze(s.fromCssColorString("#1E90FF")),s.FIREBRICK=Object.freeze(s.fromCssColorString("#B22222")),s.FLORALWHITE=Object.freeze(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=Object.freeze(s.fromCssColorString("#228B22")),s.FUCHSIA=Object.freeze(s.fromCssColorString("#FF00FF")),s.GAINSBORO=Object.freeze(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=Object.freeze(s.fromCssColorString("#F8F8FF")),s.GOLD=Object.freeze(s.fromCssColorString("#FFD700")),s.GOLDENROD=Object.freeze(s.fromCssColorString("#DAA520")),s.GRAY=Object.freeze(s.fromCssColorString("#808080")),s.GREEN=Object.freeze(s.fromCssColorString("#008000")),s.GREENYELLOW=Object.freeze(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=Object.freeze(s.fromCssColorString("#F0FFF0")),s.HOTPINK=Object.freeze(s.fromCssColorString("#FF69B4")),s.INDIANRED=Object.freeze(s.fromCssColorString("#CD5C5C")),s.INDIGO=Object.freeze(s.fromCssColorString("#4B0082")),s.IVORY=Object.freeze(s.fromCssColorString("#FFFFF0")),s.KHAKI=Object.freeze(s.fromCssColorString("#F0E68C")),s.LAVENDER=Object.freeze(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=Object.freeze(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=Object.freeze(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=Object.freeze(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=Object.freeze(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=Object.freeze(s.fromCssColorString("#F08080")),s.LIGHTCYAN=Object.freeze(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=Object.freeze(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=Object.freeze(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=Object.freeze(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=Object.freeze(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=Object.freeze(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=Object.freeze(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=Object.freeze(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=Object.freeze(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=Object.freeze(s.fromCssColorString("#FFFFE0")),s.LIME=Object.freeze(s.fromCssColorString("#00FF00")),s.LIMEGREEN=Object.freeze(s.fromCssColorString("#32CD32")),s.LINEN=Object.freeze(s.fromCssColorString("#FAF0E6")),s.MAGENTA=Object.freeze(s.fromCssColorString("#FF00FF")),s.MAROON=Object.freeze(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=Object.freeze(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=Object.freeze(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=Object.freeze(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=Object.freeze(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=Object.freeze(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=Object.freeze(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=Object.freeze(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=Object.freeze(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=Object.freeze(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=Object.freeze(s.fromCssColorString("#191970")),s.MINTCREAM=Object.freeze(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=Object.freeze(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=Object.freeze(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=Object.freeze(s.fromCssColorString("#FFDEAD")),s.NAVY=Object.freeze(s.fromCssColorString("#000080")),s.OLDLACE=Object.freeze(s.fromCssColorString("#FDF5E6")),s.OLIVE=Object.freeze(s.fromCssColorString("#808000")),s.OLIVEDRAB=Object.freeze(s.fromCssColorString("#6B8E23")),s.ORANGE=Object.freeze(s.fromCssColorString("#FFA500")),s.ORANGERED=Object.freeze(s.fromCssColorString("#FF4500")),s.ORCHID=Object.freeze(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=Object.freeze(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=Object.freeze(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=Object.freeze(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=Object.freeze(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=Object.freeze(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=Object.freeze(s.fromCssColorString("#FFDAB9")),s.PERU=Object.freeze(s.fromCssColorString("#CD853F")),s.PINK=Object.freeze(s.fromCssColorString("#FFC0CB")),s.PLUM=Object.freeze(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=Object.freeze(s.fromCssColorString("#B0E0E6")),s.PURPLE=Object.freeze(s.fromCssColorString("#800080")),s.RED=Object.freeze(s.fromCssColorString("#FF0000")),s.ROSYBROWN=Object.freeze(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=Object.freeze(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=Object.freeze(s.fromCssColorString("#8B4513")),s.SALMON=Object.freeze(s.fromCssColorString("#FA8072")),s.SANDYBROWN=Object.freeze(s.fromCssColorString("#F4A460")),s.SEAGREEN=Object.freeze(s.fromCssColorString("#2E8B57")),s.SEASHELL=Object.freeze(s.fromCssColorString("#FFF5EE")),s.SIENNA=Object.freeze(s.fromCssColorString("#A0522D")),s.SILVER=Object.freeze(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=Object.freeze(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=Object.freeze(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=Object.freeze(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=Object.freeze(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=Object.freeze(s.fromCssColorString("#00FF7F")),s.STEELBLUE=Object.freeze(s.fromCssColorString("#4682B4")),s.TAN=Object.freeze(s.fromCssColorString("#D2B48C")),s.TEAL=Object.freeze(s.fromCssColorString("#008080")),s.THISTLE=Object.freeze(s.fromCssColorString("#D8BFD8")),s.TOMATO=Object.freeze(s.fromCssColorString("#FF6347")),s.TURQUOISE=Object.freeze(s.fromCssColorString("#40E0D0")),s.VIOLET=Object.freeze(s.fromCssColorString("#EE82EE")),s.WHEAT=Object.freeze(s.fromCssColorString("#F5DEB3")),s.WHITE=Object.freeze(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=Object.freeze(s.fromCssColorString("#F5F5F5")),s.YELLOW=Object.freeze(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=Object.freeze(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=Object.freeze(new s(0,0,0,0)),e.Color=s})); diff --git a/src/renderer/public/sdk/Cesium/Workers/CoplanarPolygonGeometryLibrary-747acc14.js b/src/renderer/public/sdk/Cesium/Workers/CoplanarPolygonGeometryLibrary-747acc14.js deleted file mode 100644 index ca05945..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/CoplanarPolygonGeometryLibrary-747acc14.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./OrientedBoundingBox-b6f8f1d3"],(function(n,t,e){"use strict";const r={},a=new t.Cartesian3,i=new t.Cartesian3,o=new t.Cartesian3,u=new t.Cartesian3,s=new e.OrientedBoundingBox;function c(n,e,r,i,o){const u=t.Cartesian3.subtract(n,e,a),s=t.Cartesian3.dot(r,u),c=t.Cartesian3.dot(i,u);return t.Cartesian2.fromElements(s,c,o)}r.validOutline=function(n){const r=e.OrientedBoundingBox.fromPoints(n,s).halfAxes,a=t.Matrix3.getColumn(r,0,i),c=t.Matrix3.getColumn(r,1,o),C=t.Matrix3.getColumn(r,2,u),m=t.Cartesian3.magnitude(a),g=t.Cartesian3.magnitude(c),l=t.Cartesian3.magnitude(C);return!(0===m&&(0===g||0===l)||0===g&&0===l)},r.computeProjectTo2DArguments=function(n,r,a,c){const C=e.OrientedBoundingBox.fromPoints(n,s),m=C.halfAxes,g=t.Matrix3.getColumn(m,0,i),l=t.Matrix3.getColumn(m,1,o),d=t.Matrix3.getColumn(m,2,u),f=t.Cartesian3.magnitude(g),x=t.Cartesian3.magnitude(l),B=t.Cartesian3.magnitude(d),M=Math.min(f,x,B);if(0===f&&(0===x||0===B)||0===x&&0===B)return!1;let P,w;return M!==x&&M!==B||(P=g),M===f?P=l:M===B&&(w=l),M!==f&&M!==x||(w=d),t.Cartesian3.normalize(P,a),t.Cartesian3.normalize(w,c),t.Cartesian3.clone(C.center,r),!0},r.createProjectPointsTo2DFunction=function(n,t,e){return function(r){const a=new Array(r.length);for(let i=0;i<r.length;i++)a[i]=c(r[i],n,t,e);return a}},r.createProjectPointTo2DFunction=function(n,t,e){return function(r,a){return c(r,n,t,e,a)}};var C=r;n.CoplanarPolygonGeometryLibrary=C})); diff --git a/src/renderer/public/sdk/Cesium/Workers/CorridorGeometryLibrary-0a8e9c4d.js b/src/renderer/public/sdk/Cesium/Workers/CorridorGeometryLibrary-0a8e9c4d.js deleted file mode 100644 index 7c7ae77..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/CorridorGeometryLibrary-0a8e9c4d.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./PolylineVolumeGeometryLibrary-29c95f7f","./defaultValue-50f7432c","./ComponentDatatype-9b23164a","./PolylinePipeline-b69fdb1d","./Transforms-7ac1f9ee"],(function(a,e,n,t,r,i,s){"use strict";const o={},l=new e.Cartesian3,C=new e.Cartesian3,c=new e.Cartesian3,y=new e.Cartesian3,u=[new e.Cartesian3,new e.Cartesian3],d=new e.Cartesian3,p=new e.Cartesian3,m=new e.Cartesian3,f=new e.Cartesian3,g=new e.Cartesian3,h=new e.Cartesian3,w=new e.Cartesian3,x=new e.Cartesian3,z=new e.Cartesian3,P=new e.Cartesian3,A=new s.Quaternion,B=new e.Matrix3;function E(a,t,i,o,c){const y=e.Cartesian3.angleBetween(e.Cartesian3.subtract(t,a,l),e.Cartesian3.subtract(i,a,C)),u=o===n.CornerType.BEVELED?1:Math.ceil(y/r.CesiumMath.toRadians(5))+1,d=3*u,p=new Array(d);let m;p[d-3]=i.x,p[d-2]=i.y,p[d-1]=i.z,m=c?e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(e.Cartesian3.negate(a,l),y/u,A),B):e.Matrix3.fromQuaternion(s.Quaternion.fromAxisAngle(a,y/u,A),B);let f=0;t=e.Cartesian3.clone(t,l);for(let a=0;a<u;a++)t=e.Matrix3.multiplyByVector(m,t,t),p[f++]=t.x,p[f++]=t.y,p[f++]=t.z;return p}function S(a,n,t,r){let i=l;return r||(n=e.Cartesian3.negate(n,n)),i=e.Cartesian3.add(a,n,i),[i.x,i.y,i.z,t.x,t.y,t.z]}function b(a,n,t,r){const i=new Array(a.length),s=new Array(a.length),o=e.Cartesian3.multiplyByScalar(n,t,l),u=e.Cartesian3.negate(o,C);let d=0,p=a.length-1;for(let n=0;n<a.length;n+=3){const t=e.Cartesian3.fromArray(a,n,c),r=e.Cartesian3.add(t,u,y);i[d++]=r.x,i[d++]=r.y,i[d++]=r.z;const l=e.Cartesian3.add(t,o,y);s[p--]=l.z,s[p--]=l.y,s[p--]=l.x}return r.push(i,s),r}o.addAttribute=function(a,e,n,r){const i=e.x,s=e.y,o=e.z;t.defined(n)&&(a[n]=i,a[n+1]=s,a[n+2]=o),t.defined(r)&&(a[r]=o,a[r-1]=s,a[r-2]=i)};const D=new e.Cartesian3,M=new e.Cartesian3;o.computePositions=function(a){const t=a.granularity,s=a.positions,o=a.ellipsoid,C=a.width/2,c=a.cornerType,y=a.saveAttributes;let A=d,B=p,T=m,N=f,L=g,V=h,O=w,R=x,Q=z,U=P,v=[];const G=y?[]:void 0,I=y?[]:void 0;let q,j=s[0],k=s[1];B=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,B),B),A=o.geodeticSurfaceNormal(j,A),N=e.Cartesian3.normalize(e.Cartesian3.cross(A,B,N),N),y&&(G.push(N.x,N.y,N.z),I.push(A.x,A.y,A.z)),O=e.Cartesian3.clone(j,O),j=k,T=e.Cartesian3.negate(B,T);const F=[];let H;const J=s.length;for(H=1;H<J-1;H++){A=o.geodeticSurfaceNormal(j,A),k=s[H+1],B=e.Cartesian3.normalize(e.Cartesian3.subtract(k,j,B),B),L=e.Cartesian3.normalize(e.Cartesian3.add(B,T,L),L);const a=e.Cartesian3.multiplyByScalar(A,e.Cartesian3.dot(B,A),D);e.Cartesian3.subtract(B,a,a),e.Cartesian3.normalize(a,a);const d=e.Cartesian3.multiplyByScalar(A,e.Cartesian3.dot(T,A),M);e.Cartesian3.subtract(T,d,d),e.Cartesian3.normalize(d,d);if(!r.CesiumMath.equalsEpsilon(Math.abs(e.Cartesian3.dot(a,d)),1,r.CesiumMath.EPSILON7)){L=e.Cartesian3.cross(L,A,L),L=e.Cartesian3.cross(A,L,L),L=e.Cartesian3.normalize(L,L);const a=C/Math.max(.25,e.Cartesian3.magnitude(e.Cartesian3.cross(L,T,l))),r=n.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(B,T,j,o);L=e.Cartesian3.multiplyByScalar(L,a,L),r?(R=e.Cartesian3.add(j,L,R),U=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,U),U),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=b(q,N,C,v),y&&(G.push(N.x,N.y,N.z),I.push(A.x,A.y,A.z)),V=e.Cartesian3.clone(Q,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(A,B,N),N),Q=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,2*C,Q),Q),O=e.Cartesian3.add(R,e.Cartesian3.multiplyByScalar(N,C,O),O),c===n.CornerType.ROUNDED||c===n.CornerType.BEVELED?F.push({leftPositions:E(R,V,Q,c,r)}):F.push({leftPositions:S(j,e.Cartesian3.negate(L,L),Q,r)})):(Q=e.Cartesian3.add(j,L,Q),U=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,U),U),U),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(U,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=b(q,N,C,v),y&&(G.push(N.x,N.y,N.z),I.push(A.x,A.y,A.z)),V=e.Cartesian3.clone(R,V),N=e.Cartesian3.normalize(e.Cartesian3.cross(A,B,N),N),R=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,2*C,R),R),R),O=e.Cartesian3.add(Q,e.Cartesian3.negate(e.Cartesian3.multiplyByScalar(N,C,O),O),O),c===n.CornerType.ROUNDED||c===n.CornerType.BEVELED?F.push({rightPositions:E(Q,V,R,c,r)}):F.push({rightPositions:S(j,L,R,r)})),T=e.Cartesian3.negate(B,T)}j=k}let K;return A=o.geodeticSurfaceNormal(j,A),u[0]=e.Cartesian3.clone(O,u[0]),u[1]=e.Cartesian3.clone(j,u[1]),q=i.PolylinePipeline.generateArc({positions:u,granularity:t,ellipsoid:o}),v=b(q,N,C,v),y&&(G.push(N.x,N.y,N.z),I.push(A.x,A.y,A.z)),c===n.CornerType.ROUNDED&&(K=function(a){let t=d,r=p,i=m,s=a[1];r=e.Cartesian3.fromArray(a[1],s.length-3,r),i=e.Cartesian3.fromArray(a[0],0,i),t=e.Cartesian3.midpoint(r,i,t);const o=E(t,r,i,n.CornerType.ROUNDED,!1),l=a.length-1,C=a[l-1];return s=a[l],r=e.Cartesian3.fromArray(C,C.length-3,r),i=e.Cartesian3.fromArray(s,0,i),t=e.Cartesian3.midpoint(r,i,t),[o,E(t,r,i,n.CornerType.ROUNDED,!1)]}(v)),{positions:v,corners:F,lefts:G,normals:I,endPositions:K}};var T=o;a.CorridorGeometryLibrary=T})); diff --git a/src/renderer/public/sdk/Cesium/Workers/CylinderGeometry-67237955.js b/src/renderer/public/sdk/Cesium/Workers/CylinderGeometry-67237955.js deleted file mode 100644 index 386eb35..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/CylinderGeometry-67237955.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./CylinderGeometryLibrary-8bcf1a43","./defaultValue-50f7432c","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./IndexDatatype-ceed713e","./VertexFormat-fa0c27e8"],(function(t,e,n,a,o,r,i,s,u,m,c){"use strict";const l=new n.Cartesian2,f=new n.Cartesian3,p=new n.Cartesian3,d=new n.Cartesian3,y=new n.Cartesian3;function b(t){const e=(t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT)).length,n=t.topRadius,a=t.bottomRadius,o=r.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT),i=r.defaultValue(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=a,this._vertexFormat=c.VertexFormat.clone(o),this._slices=i,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}b.packedLength=c.VertexFormat.packedLength+5,b.pack=function(t,e,n){return n=r.defaultValue(n,0),c.VertexFormat.pack(t._vertexFormat,e,n),n+=c.VertexFormat.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=r.defaultValue(t._offsetAttribute,-1),e};const A=new c.VertexFormat,x={vertexFormat:A,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};let g;b.unpack=function(t,e,n){e=r.defaultValue(e,0);const a=c.VertexFormat.unpack(t,e,A);e+=c.VertexFormat.packedLength;const o=t[e++],i=t[e++],s=t[e++],u=t[e++],m=t[e];return r.defined(n)?(n._vertexFormat=c.VertexFormat.clone(a,n._vertexFormat),n._length=o,n._topRadius=i,n._bottomRadius=s,n._slices=u,n._offsetAttribute=-1===m?void 0:m,n):(x.length=o,x.topRadius=i,x.bottomRadius=s,x.slices=u,x.offsetAttribute=-1===m?void 0:m,new b(x))},b.createGeometry=function(t){let c=t._length;const b=t._topRadius,A=t._bottomRadius,x=t._vertexFormat,g=t._slices;if(c<=0||b<0||A<0||0===b&&0===A)return;const _=g+g,h=g+_,F=_+_,v=o.CylinderGeometryLibrary.computePositions(c,b,A,g,!0),C=x.st?new Float32Array(2*F):void 0,w=x.normal?new Float32Array(3*F):void 0,G=x.tangent?new Float32Array(3*F):void 0,V=x.bitangent?new Float32Array(3*F):void 0;let D;const R=x.normal||x.tangent||x.bitangent;if(R){const t=x.tangent||x.bitangent;let e=0,o=0,r=0;const i=Math.atan2(A-b,c),s=f;s.z=Math.sin(i);const u=Math.cos(i);let m=d,l=p;for(D=0;D<g;D++){const i=D/g*a.CesiumMath.TWO_PI,c=u*Math.cos(i),f=u*Math.sin(i);R&&(s.x=c,s.y=f,t&&(m=n.Cartesian3.normalize(n.Cartesian3.cross(n.Cartesian3.UNIT_Z,s,m),m)),x.normal&&(w[e++]=s.x,w[e++]=s.y,w[e++]=s.z,w[e++]=s.x,w[e++]=s.y,w[e++]=s.z),x.tangent&&(G[o++]=m.x,G[o++]=m.y,G[o++]=m.z,G[o++]=m.x,G[o++]=m.y,G[o++]=m.z),x.bitangent&&(l=n.Cartesian3.normalize(n.Cartesian3.cross(s,m,l),l),V[r++]=l.x,V[r++]=l.y,V[r++]=l.z,V[r++]=l.x,V[r++]=l.y,V[r++]=l.z))}for(D=0;D<g;D++)x.normal&&(w[e++]=0,w[e++]=0,w[e++]=-1),x.tangent&&(G[o++]=1,G[o++]=0,G[o++]=0),x.bitangent&&(V[r++]=0,V[r++]=-1,V[r++]=0);for(D=0;D<g;D++)x.normal&&(w[e++]=0,w[e++]=0,w[e++]=1),x.tangent&&(G[o++]=1,G[o++]=0,G[o++]=0),x.bitangent&&(V[r++]=0,V[r++]=1,V[r++]=0)}const T=12*g-12,O=m.IndexDatatype.createTypedArray(F,T);let L=0,P=0;for(D=0;D<g-1;D++)O[L++]=P,O[L++]=P+2,O[L++]=P+3,O[L++]=P,O[L++]=P+3,O[L++]=P+1,P+=2;for(O[L++]=_-2,O[L++]=0,O[L++]=1,O[L++]=_-2,O[L++]=1,O[L++]=_-1,D=1;D<g-1;D++)O[L++]=_+D+1,O[L++]=_+D,O[L++]=_;for(D=1;D<g-1;D++)O[L++]=h,O[L++]=h+D,O[L++]=h+D+1;let M=0;if(x.st){const t=Math.max(b,A);for(D=0;D<F;D++){const e=n.Cartesian3.fromArray(v,3*D,y);C[M++]=(e.x+t)/(2*t),C[M++]=(e.y+t)/(2*t)}}const k=new s.GeometryAttributes;x.position&&(k.position=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v})),x.normal&&(k.normal=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),x.tangent&&(k.tangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),x.bitangent&&(k.bitangent=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),x.st&&(k.st=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:C})),l.x=.5*c,l.y=Math.max(A,b);const z=new e.BoundingSphere(n.Cartesian3.ZERO,n.Cartesian2.magnitude(l));if(r.defined(t._offsetAttribute)){c=v.length;const e=t._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(c/3).fill(e);k.applyOffset=new i.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new i.Geometry({attributes:k,indices:O,primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:z,offsetAttribute:t._offsetAttribute})},b.getUnitCylinder=function(){return r.defined(g)||(g=b.createGeometry(new b({topRadius:1,bottomRadius:1,length:1,vertexFormat:c.VertexFormat.POSITION_ONLY}))),g},t.CylinderGeometry=b})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipseGeometry-489315a9.js b/src/renderer/public/sdk/Cesium/Workers/EllipseGeometry-489315a9.js deleted file mode 100644 index be5abbd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipseGeometry-489315a9.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./EllipseGeometryLibrary-446608af","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryInstance-a6a77e5a","./GeometryOffsetAttribute-490bc2c9","./GeometryPipeline-51ce1008","./IndexDatatype-ceed713e","./VertexFormat-fa0c27e8"],(function(t,e,i,r,n,o,a,s,l,u,m,c,p){"use strict";const y=new i.Cartesian3,d=new i.Cartesian3,f=new i.Cartesian3,A=new i.Cartesian3,x=new i.Cartesian2,h=new i.Matrix3,g=new i.Matrix3,_=new e.Quaternion,b=new i.Cartesian3,C=new i.Cartesian3,w=new i.Cartesian3,M=new i.Cartographic,E=new i.Cartesian3,I=new i.Cartesian2,T=new i.Cartesian2;function G(t,l,m){const c=l.vertexFormat,p=l.center,A=l.semiMajorAxis,G=l.semiMinorAxis,N=l.ellipsoid,P=l.stRotation,v=m?t.length/3*2:t.length/3,V=l.shadowVolume,F=c.st?new Float32Array(2*v):void 0,D=c.normal?new Float32Array(3*v):void 0,O=c.tangent?new Float32Array(3*v):void 0,S=c.bitangent?new Float32Array(3*v):void 0,L=V?new Float32Array(3*v):void 0;let R=0,j=b,z=C,k=w;const B=new e.GeographicProjection(N),Y=B.project(N.cartesianToCartographic(p,M),E),H=N.scaleToGeodeticSurface(p,y);N.geodeticSurfaceNormal(H,H);let U=h,Q=g;if(0!==P){let t=e.Quaternion.fromAxisAngle(H,P,_);U=i.Matrix3.fromQuaternion(t,U),t=e.Quaternion.fromAxisAngle(H,-P,_),Q=i.Matrix3.fromQuaternion(t,Q)}else U=i.Matrix3.clone(i.Matrix3.IDENTITY,U),Q=i.Matrix3.clone(i.Matrix3.IDENTITY,Q);const W=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,I),J=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,T);let q=t.length;const Z=m?q:0,K=Z/3*2;for(let e=0;e<q;e+=3){const r=e+1,n=e+2,o=i.Cartesian3.fromArray(t,e,y);if(c.st){const t=i.Matrix3.multiplyByVector(U,o,d),e=B.project(N.cartesianToCartographic(t,M),f);i.Cartesian3.subtract(e,Y,e),x.x=(e.x+A)/(2*A),x.y=(e.y+G)/(2*G),W.x=Math.min(x.x,W.x),W.y=Math.min(x.y,W.y),J.x=Math.max(x.x,J.x),J.y=Math.max(x.y,J.y),m&&(F[R+K]=x.x,F[R+1+K]=x.y),F[R++]=x.x,F[R++]=x.y}(c.normal||c.tangent||c.bitangent||V)&&(j=N.geodeticSurfaceNormal(o,j),V&&(L[e+Z]=-j.x,L[r+Z]=-j.y,L[n+Z]=-j.z),(c.normal||c.tangent||c.bitangent)&&((c.tangent||c.bitangent)&&(z=i.Cartesian3.normalize(i.Cartesian3.cross(i.Cartesian3.UNIT_Z,j,z),z),i.Matrix3.multiplyByVector(Q,z,z)),c.normal&&(D[e]=j.x,D[r]=j.y,D[n]=j.z,m&&(D[e+Z]=-j.x,D[r+Z]=-j.y,D[n+Z]=-j.z)),c.tangent&&(O[e]=z.x,O[r]=z.y,O[n]=z.z,m&&(O[e+Z]=-z.x,O[r+Z]=-z.y,O[n+Z]=-z.z)),c.bitangent&&(k=i.Cartesian3.normalize(i.Cartesian3.cross(j,z,k),k),S[e]=k.x,S[r]=k.y,S[n]=k.z,m&&(S[e+Z]=k.x,S[r+Z]=k.y,S[n+Z]=k.z))))}if(c.st){q=F.length;for(let t=0;t<q;t+=2)F[t]=(F[t]-W.x)/(J.x-W.x),F[t+1]=(F[t+1]-W.y)/(J.y-W.y)}const X=new s.GeometryAttributes;if(c.position){const e=o.EllipseGeometryLibrary.raisePositionsToHeight(t,l,m);X.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}if(c.st&&(X.st=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:F})),c.normal&&(X.normal=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),c.tangent&&(X.tangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),c.bitangent&&(X.bitangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),V&&(X.extrudeDirection=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),m&&n.defined(l.offsetAttribute)){let t=new Uint8Array(v);if(l.offsetAttribute===u.GeometryOffsetAttribute.TOP)t=t.fill(1,0,v/2);else{const e=l.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}X.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return X}function N(t){const e=new Array(t*(t+1)*12-6);let i,r,n,o,a,s=0;for(i=0,n=1,o=0;o<3;o++)e[s++]=n++,e[s++]=i,e[s++]=n;for(o=2;o<t+1;++o){for(n=o*(o+1)-1,i=(o-1)*o-1,e[s++]=n++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=n++,e[s++]=i,e[s++]=n}for(r=2*t,++n,++i,o=0;o<r-1;++o)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;for(e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i++,e[s++]=i,++i,o=t-1;o>1;--o){for(e[s++]=i++,e[s++]=i,e[s++]=n,r=2*o,a=0;a<r-1;++a)e[s++]=n,e[s++]=i++,e[s++]=i,e[s++]=n++,e[s++]=i,e[s++]=n;e[s++]=i++,e[s++]=i++,e[s++]=n++}for(o=0;o<3;o++)e[s++]=i++,e[s++]=i,e[s++]=n;return e}let P=new i.Cartesian3;const v=new e.BoundingSphere,V=new e.BoundingSphere;function F(t){const p=t.center,g=t.ellipsoid,P=t.semiMajorAxis;let F=i.Cartesian3.multiplyByScalar(g.geodeticSurfaceNormal(p,y),t.height,y);v.center=i.Cartesian3.add(p,F,v.center),v.radius=P,F=i.Cartesian3.multiplyByScalar(g.geodeticSurfaceNormal(p,F),t.extrudedHeight,F),V.center=i.Cartesian3.add(p,F,V.center),V.radius=P;const D=o.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),O=D.positions,S=D.numPts,L=D.outerPositions,R=e.BoundingSphere.union(v,V),j=G(O,t,!0);let z=N(S);const k=z.length;z.length=2*k;const B=O.length/3;for(let t=0;t<k;t+=3)z[t+k]=z[t+2]+B,z[t+1+k]=z[t+1]+B,z[t+2+k]=z[t]+B;const Y=c.IndexDatatype.createTypedArray(2*B/3,z),H=new a.Geometry({attributes:j,indices:Y,primitiveType:a.PrimitiveType.TRIANGLES}),U=function(t,o){const l=o.vertexFormat,m=o.center,c=o.semiMajorAxis,p=o.semiMinorAxis,g=o.ellipsoid,G=o.height,N=o.extrudedHeight,P=o.stRotation,v=t.length/3*2,V=new Float64Array(3*v),F=l.st?new Float32Array(2*v):void 0,D=l.normal?new Float32Array(3*v):void 0,O=l.tangent?new Float32Array(3*v):void 0,S=l.bitangent?new Float32Array(3*v):void 0,L=o.shadowVolume,R=L?new Float32Array(3*v):void 0;let j=0,z=b,k=C,B=w;const Y=new e.GeographicProjection(g),H=Y.project(g.cartesianToCartographic(m,M),E),U=g.scaleToGeodeticSurface(m,y);g.geodeticSurfaceNormal(U,U);const Q=e.Quaternion.fromAxisAngle(U,P,_),W=i.Matrix3.fromQuaternion(Q,h),J=i.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,I),q=i.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,T);let Z=t.length;const K=Z/3*2;for(let e=0;e<Z;e+=3){const r=e+1,n=e+2;let o,a=i.Cartesian3.fromArray(t,e,y);if(l.st){const t=i.Matrix3.multiplyByVector(W,a,d),e=Y.project(g.cartesianToCartographic(t,M),f);i.Cartesian3.subtract(e,H,e),x.x=(e.x+c)/(2*c),x.y=(e.y+p)/(2*p),J.x=Math.min(x.x,J.x),J.y=Math.min(x.y,J.y),q.x=Math.max(x.x,q.x),q.y=Math.max(x.y,q.y),F[j+K]=x.x,F[j+1+K]=x.y,F[j++]=x.x,F[j++]=x.y}a=g.scaleToGeodeticSurface(a,a),o=i.Cartesian3.clone(a,d),z=g.geodeticSurfaceNormal(a,z),L&&(R[e+Z]=-z.x,R[r+Z]=-z.y,R[n+Z]=-z.z);let s=i.Cartesian3.multiplyByScalar(z,G,A);if(a=i.Cartesian3.add(a,s,a),s=i.Cartesian3.multiplyByScalar(z,N,s),o=i.Cartesian3.add(o,s,o),l.position&&(V[e+Z]=o.x,V[r+Z]=o.y,V[n+Z]=o.z,V[e]=a.x,V[r]=a.y,V[n]=a.z),l.normal||l.tangent||l.bitangent){B=i.Cartesian3.clone(z,B);const s=i.Cartesian3.fromArray(t,(e+3)%Z,A);i.Cartesian3.subtract(s,a,s);const u=i.Cartesian3.subtract(o,a,f);z=i.Cartesian3.normalize(i.Cartesian3.cross(u,s,z),z),l.normal&&(D[e]=z.x,D[r]=z.y,D[n]=z.z,D[e+Z]=z.x,D[r+Z]=z.y,D[n+Z]=z.z),l.tangent&&(k=i.Cartesian3.normalize(i.Cartesian3.cross(B,z,k),k),O[e]=k.x,O[r]=k.y,O[n]=k.z,O[e+Z]=k.x,O[e+1+Z]=k.y,O[e+2+Z]=k.z),l.bitangent&&(S[e]=B.x,S[r]=B.y,S[n]=B.z,S[e+Z]=B.x,S[r+Z]=B.y,S[n+Z]=B.z)}}if(l.st){Z=F.length;for(let t=0;t<Z;t+=2)F[t]=(F[t]-J.x)/(q.x-J.x),F[t+1]=(F[t+1]-J.y)/(q.y-J.y)}const X=new s.GeometryAttributes;if(l.position&&(X.position=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:V})),l.st&&(X.st=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:F})),l.normal&&(X.normal=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),l.tangent&&(X.tangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),l.bitangent&&(X.bitangent=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),L&&(X.extrudeDirection=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),n.defined(o.offsetAttribute)){let t=new Uint8Array(v);if(o.offsetAttribute===u.GeometryOffsetAttribute.TOP)t=t.fill(1,0,v/2);else{const e=o.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}X.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return X}(L,t);z=function(t){const e=t.length/3,i=c.IndexDatatype.createTypedArray(e,6*e);let r=0;for(let t=0;t<e;t++){const n=t,o=t+e,a=(n+1)%e,s=a+e;i[r++]=n,i[r++]=o,i[r++]=a,i[r++]=a,i[r++]=o,i[r++]=s}return i}(L);const Q=c.IndexDatatype.createTypedArray(2*L.length/3,z),W=new a.Geometry({attributes:U,indices:Q,primitiveType:a.PrimitiveType.TRIANGLES}),J=m.GeometryPipeline.combineInstances([new l.GeometryInstance({geometry:H}),new l.GeometryInstance({geometry:W})]);return{boundingSphere:R,attributes:J[0].attributes,indices:J[0].indices}}function D(t,e,n,a,s,l,u){const m=o.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:n,rotation:a,granularity:s},!1,!0).outerPositions,c=m.length/3,p=new Array(c);for(let t=0;t<c;++t)p[t]=i.Cartesian3.fromArray(m,3*t);const y=i.Rectangle.fromCartesianArray(p,l,u);return y.width>r.CesiumMath.PI&&(y.north=y.north>0?r.CesiumMath.PI_OVER_TWO-r.CesiumMath.EPSILON7:y.north,y.south=y.south<0?r.CesiumMath.EPSILON7-r.CesiumMath.PI_OVER_TWO:y.south,y.east=r.CesiumMath.PI,y.west=-r.CesiumMath.PI),y}function O(t){const e=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).center,o=n.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84),a=t.semiMajorAxis,s=t.semiMinorAxis,l=n.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE),u=n.defaultValue(t.vertexFormat,p.VertexFormat.DEFAULT),m=n.defaultValue(t.height,0),c=n.defaultValue(t.extrudedHeight,m);this._center=i.Cartesian3.clone(e),this._semiMajorAxis=a,this._semiMinorAxis=s,this._ellipsoid=i.Ellipsoid.clone(o),this._rotation=n.defaultValue(t.rotation,0),this._stRotation=n.defaultValue(t.stRotation,0),this._height=Math.max(c,m),this._granularity=l,this._vertexFormat=p.VertexFormat.clone(u),this._extrudedHeight=Math.min(c,m),this._shadowVolume=n.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}O.packedLength=i.Cartesian3.packedLength+i.Ellipsoid.packedLength+p.VertexFormat.packedLength+9,O.pack=function(t,e,r){return r=n.defaultValue(r,0),i.Cartesian3.pack(t._center,e,r),r+=i.Cartesian3.packedLength,i.Ellipsoid.pack(t._ellipsoid,e,r),r+=i.Ellipsoid.packedLength,p.VertexFormat.pack(t._vertexFormat,e,r),r+=p.VertexFormat.packedLength,e[r++]=t._semiMajorAxis,e[r++]=t._semiMinorAxis,e[r++]=t._rotation,e[r++]=t._stRotation,e[r++]=t._height,e[r++]=t._granularity,e[r++]=t._extrudedHeight,e[r++]=t._shadowVolume?1:0,e[r]=n.defaultValue(t._offsetAttribute,-1),e};const S=new i.Cartesian3,L=new i.Ellipsoid,R=new p.VertexFormat,j={center:S,ellipsoid:L,vertexFormat:R,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};O.unpack=function(t,e,r){e=n.defaultValue(e,0);const o=i.Cartesian3.unpack(t,e,S);e+=i.Cartesian3.packedLength;const a=i.Ellipsoid.unpack(t,e,L);e+=i.Ellipsoid.packedLength;const s=p.VertexFormat.unpack(t,e,R);e+=p.VertexFormat.packedLength;const l=t[e++],u=t[e++],m=t[e++],c=t[e++],y=t[e++],d=t[e++],f=t[e++],A=1===t[e++],x=t[e];return n.defined(r)?(r._center=i.Cartesian3.clone(o,r._center),r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._vertexFormat=p.VertexFormat.clone(s,r._vertexFormat),r._semiMajorAxis=l,r._semiMinorAxis=u,r._rotation=m,r._stRotation=c,r._height=y,r._granularity=d,r._extrudedHeight=f,r._shadowVolume=A,r._offsetAttribute=-1===x?void 0:x,r):(j.height=y,j.extrudedHeight=f,j.granularity=d,j.stRotation=c,j.rotation=m,j.semiMajorAxis=l,j.semiMinorAxis=u,j.shadowVolume=A,j.offsetAttribute=-1===x?void 0:x,new O(j))},O.computeRectangle=function(t,e){const o=(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT)).center,a=n.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84),s=t.semiMajorAxis,l=t.semiMinorAxis,u=n.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE);return D(o,s,l,n.defaultValue(t.rotation,0),u,a,e)},O.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;const s=t._height,l=t._extrudedHeight,m=!r.CesiumMath.equalsEpsilon(s,l,0,r.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);const p={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:s,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};let y;if(m)p.extrudedHeight=l,p.shadowVolume=t._shadowVolume,p.offsetAttribute=t._offsetAttribute,y=F(p);else if(y=function(t){const r=t.center;P=i.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,P),t.height,P),P=i.Cartesian3.add(r,P,P);const n=new e.BoundingSphere(P,t.semiMajorAxis),a=o.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),s=a.positions,l=a.numPts,u=G(s,t,!1);let m=N(l);return m=c.IndexDatatype.createTypedArray(s.length/3,m),{boundingSphere:n,attributes:u,indices:m}}(p),n.defined(t._offsetAttribute)){const e=y.attributes.position.values.length,i=t._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(e/3).fill(i);y.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new a.Geometry({attributes:y.attributes,indices:y.indices,primitiveType:a.PrimitiveType.TRIANGLES,boundingSphere:y.boundingSphere,offsetAttribute:t._offsetAttribute})},O.createShadowVolume=function(t,e,i){const r=t._granularity,n=t._ellipsoid,o=e(r,n),a=i(r,n);return new O({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:p.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(O.prototype,{rectangle:{get:function(){return n.defined(this._rectangle)||(this._rectangle=D(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return n.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const r=o.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,n=r.length/3,s=new Array(n);for(let t=0;t<n;++t)s[t]=i.Cartesian3.fromArray(r,3*t);const l=t._ellipsoid,u=t.rectangle;return a.Geometry._textureCoordinateRotationPoints(s,e,l,u)}(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=O})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipseGeometryLibrary-446608af.js b/src/renderer/public/sdk/Cesium/Workers/EllipseGeometryLibrary-446608af.js deleted file mode 100644 index dc70cae..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipseGeometryLibrary-446608af.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./Transforms-7ac1f9ee"],(function(t,a,e,n){"use strict";const i={},r=new a.Cartesian3,s=new a.Cartesian3,o=new n.Quaternion,l=new a.Matrix3;function c(t,e,i,c,C,y,u,m,h,x){const M=t+e;a.Cartesian3.multiplyByScalar(c,Math.cos(M),r),a.Cartesian3.multiplyByScalar(i,Math.sin(M),s),a.Cartesian3.add(r,s,r);let f=Math.cos(t);f*=f;let z=Math.sin(t);z*=z;const _=y/Math.sqrt(u*f+C*z)/m;return n.Quaternion.fromAxisAngle(r,_,o),a.Matrix3.fromQuaternion(o,l),a.Matrix3.multiplyByVector(l,h,x),a.Cartesian3.normalize(x,x),a.Cartesian3.multiplyByScalar(x,m,x),x}const C=new a.Cartesian3,y=new a.Cartesian3,u=new a.Cartesian3,m=new a.Cartesian3;i.raisePositionsToHeight=function(t,e,n){const i=e.ellipsoid,r=e.height,s=e.extrudedHeight,o=n?t.length/3*2:t.length/3,l=new Float64Array(3*o),c=t.length,h=n?c:0;for(let e=0;e<c;e+=3){const o=e+1,c=e+2,x=a.Cartesian3.fromArray(t,e,C);i.scaleToGeodeticSurface(x,x);const M=a.Cartesian3.clone(x,y),f=i.geodeticSurfaceNormal(x,m),z=a.Cartesian3.multiplyByScalar(f,r,u);a.Cartesian3.add(x,z,x),n&&(a.Cartesian3.multiplyByScalar(f,s,z),a.Cartesian3.add(M,z,M),l[e+h]=M.x,l[o+h]=M.y,l[c+h]=M.z),l[e]=x.x,l[o]=x.y,l[c]=x.z}return l};const h=new a.Cartesian3,x=new a.Cartesian3,M=new a.Cartesian3;i.computeEllipsePositions=function(t,n,i){const r=t.semiMinorAxis,s=t.semiMajorAxis,o=t.rotation,l=t.center,m=8*t.granularity,f=r*r,z=s*s,_=s*r,p=a.Cartesian3.magnitude(l),O=a.Cartesian3.normalize(l,h);let d=a.Cartesian3.cross(a.Cartesian3.UNIT_Z,l,x);d=a.Cartesian3.normalize(d,d);const w=a.Cartesian3.cross(O,d,M);let P=1+Math.ceil(e.CesiumMath.PI_OVER_TWO/m);const T=e.CesiumMath.PI_OVER_TWO/(P-1);let I=e.CesiumMath.PI_OVER_TWO-P*T;I<0&&(P-=Math.ceil(Math.abs(I)/T));const g=n?new Array(3*(P*(P+2)*2)):void 0;let E=0,V=C,A=y;const R=4*P*3;let W=R-1,S=0;const B=i?new Array(R):void 0;let b,v,Q,G,H;for(I=e.CesiumMath.PI_OVER_TWO,V=c(I,o,w,d,f,_,z,p,O,V),n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x),I=e.CesiumMath.PI_OVER_TWO-T,b=1;b<P+1;++b){if(V=c(I,o,w,d,f,_,z,p,O,V),A=c(Math.PI-I,o,w,d,f,_,z,p,O,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,Q=2*b+2,v=1;v<Q-1;++v)G=v/(Q-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z),I=e.CesiumMath.PI_OVER_TWO-(b+1)*T}for(b=P;b>1;--b){if(I=e.CesiumMath.PI_OVER_TWO-(b-1)*T,V=c(-I,o,w,d,f,_,z,p,O,V),A=c(I+Math.PI,o,w,d,f,_,z,p,O,A),n){for(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,Q=2*(b-1)+2,v=1;v<Q-1;++v)G=v/(Q-1),H=a.Cartesian3.lerp(V,A,G,u),g[E++]=H.x,g[E++]=H.y,g[E++]=H.z;g[E++]=A.x,g[E++]=A.y,g[E++]=A.z}i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,B[S++]=A.x,B[S++]=A.y,B[S++]=A.z)}I=e.CesiumMath.PI_OVER_TWO,V=c(-I,o,w,d,f,_,z,p,O,V);const N={};return n&&(g[E++]=V.x,g[E++]=V.y,g[E++]=V.z,N.positions=g,N.numPts=P),i&&(B[W--]=V.z,B[W--]=V.y,B[W--]=V.x,N.outerPositions=B),N};var f=i;t.EllipseGeometryLibrary=f})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipseOutlineGeometry-84be0378.js b/src/renderer/public/sdk/Cesium/Workers/EllipseOutlineGeometry-84be0378.js deleted file mode 100644 index b0266fb..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipseOutlineGeometry-84be0378.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./EllipseGeometryLibrary-446608af","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./IndexDatatype-ceed713e"],(function(e,t,i,r,n,o,a,s,l,u){"use strict";const c=new i.Cartesian3;let d=new i.Cartesian3;const f=new t.BoundingSphere,p=new t.BoundingSphere;function m(e){const t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).center,o=n.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84),a=e.semiMajorAxis,s=e.semiMinorAxis,l=n.defaultValue(e.granularity,r.CesiumMath.RADIANS_PER_DEGREE),u=n.defaultValue(e.height,0),c=n.defaultValue(e.extrudedHeight,u);this._center=i.Cartesian3.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=s,this._ellipsoid=i.Ellipsoid.clone(o),this._rotation=n.defaultValue(e.rotation,0),this._height=Math.max(c,u),this._granularity=l,this._extrudedHeight=Math.min(c,u),this._numberOfVerticalLines=Math.max(n.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}m.packedLength=i.Cartesian3.packedLength+i.Ellipsoid.packedLength+8,m.pack=function(e,t,r){return r=n.defaultValue(r,0),i.Cartesian3.pack(e._center,t,r),r+=i.Cartesian3.packedLength,i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._numberOfVerticalLines,t[r]=n.defaultValue(e._offsetAttribute,-1),t};const h=new i.Cartesian3,y=new i.Ellipsoid,b={center:h,ellipsoid:y,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};m.unpack=function(e,t,r){t=n.defaultValue(t,0);const o=i.Cartesian3.unpack(e,t,h);t+=i.Cartesian3.packedLength;const a=i.Ellipsoid.unpack(e,t,y);t+=i.Ellipsoid.packedLength;const s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],f=e[t++],p=e[t++],A=e[t];return n.defined(r)?(r._center=i.Cartesian3.clone(o,r._center),r._ellipsoid=i.Ellipsoid.clone(a,r._ellipsoid),r._semiMajorAxis=s,r._semiMinorAxis=l,r._rotation=u,r._height=c,r._granularity=d,r._extrudedHeight=f,r._numberOfVerticalLines=p,r._offsetAttribute=-1===A?void 0:A,r):(b.height=c,b.extrudedHeight=f,b.granularity=d,b.rotation=u,b.semiMajorAxis=s,b.semiMinorAxis=l,b.numberOfVerticalLines=p,b.offsetAttribute=-1===A?void 0:A,new m(b))},m.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;const m=e._height,h=e._extrudedHeight,y=!r.CesiumMath.equalsEpsilon(m,h,0,r.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);const b={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:m,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};let A;if(y)b.extrudedHeight=h,b.offsetAttribute=e._offsetAttribute,A=function(e){const d=e.center,m=e.ellipsoid,h=e.semiMajorAxis;let y=i.Cartesian3.multiplyByScalar(m.geodeticSurfaceNormal(d,c),e.height,c);f.center=i.Cartesian3.add(d,y,f.center),f.radius=h,y=i.Cartesian3.multiplyByScalar(m.geodeticSurfaceNormal(d,y),e.extrudedHeight,y),p.center=i.Cartesian3.add(d,y,p.center),p.radius=h;let b=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions;const A=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(b,e,!0)})});b=A.position.values;const _=t.BoundingSphere.union(f,p);let g=b.length/3;if(n.defined(e.offsetAttribute)){let t=new Uint8Array(g);if(e.offsetAttribute===l.GeometryOffsetAttribute.TOP)t=t.fill(1,0,g/2);else{const i=e.offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}A.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let x=n.defaultValue(e.numberOfVerticalLines,16);x=r.CesiumMath.clamp(x,0,g/2);const E=u.IndexDatatype.createTypedArray(g,2*g+2*x);g/=2;let M,C,G=0;for(M=0;M<g;++M)E[G++]=M,E[G++]=(M+1)%g,E[G++]=M+g,E[G++]=(M+1)%g+g;if(x>0){const e=Math.min(x,g);C=Math.round(g/e);const t=Math.min(C*x,g);for(M=0;M<t;M+=C)E[G++]=M,E[G++]=M+g}return{boundingSphere:_,attributes:A,indices:E}}(b);else if(A=function(e){const n=e.center;d=i.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(n,d),e.height,d),d=i.Cartesian3.add(n,d,d);const l=new t.BoundingSphere(d,e.semiMajorAxis),c=o.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,f=new s.GeometryAttributes({position:new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.EllipseGeometryLibrary.raisePositionsToHeight(c,e,!1)})}),p=c.length/3,m=u.IndexDatatype.createTypedArray(p,2*p);let h=0;for(let e=0;e<p;++e)m[h++]=e,m[h++]=(e+1)%p;return{boundingSphere:l,attributes:f,indices:m}}(b),n.defined(e._offsetAttribute)){const t=A.attributes.position.values.length,i=e._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=new Uint8Array(t/3).fill(i);A.attributes.applyOffset=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new a.Geometry({attributes:A.attributes,indices:A.indices,primitiveType:a.PrimitiveType.LINES,boundingSphere:A.boundingSphere,offsetAttribute:e._offsetAttribute})},e.EllipseOutlineGeometry=m})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipsoidGeometry-11a640a6.js b/src/renderer/public/sdk/Cesium/Workers/EllipsoidGeometry-11a640a6.js deleted file mode 100644 index 1567764..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipsoidGeometry-11a640a6.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./IndexDatatype-ceed713e","./VertexFormat-fa0c27e8"],(function(t,e,a,n,i,r,o,s,m,u){"use strict";const c=new a.Cartesian3,l=new a.Cartesian3,f=new a.Cartesian3,d=new a.Cartesian3,C=new a.Cartesian3,p=new a.Cartesian3(1,1,1),y=Math.cos,_=Math.sin;function h(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT);const e=i.defaultValue(t.radii,p),r=i.defaultValue(t.innerRadii,e),o=i.defaultValue(t.minimumClock,0),s=i.defaultValue(t.maximumClock,n.CesiumMath.TWO_PI),m=i.defaultValue(t.minimumCone,0),c=i.defaultValue(t.maximumCone,n.CesiumMath.PI),l=Math.round(i.defaultValue(t.stackPartitions,64)),f=Math.round(i.defaultValue(t.slicePartitions,64)),d=i.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT);this._radii=a.Cartesian3.clone(e),this._innerRadii=a.Cartesian3.clone(r),this._minimumClock=o,this._maximumClock=s,this._minimumCone=m,this._maximumCone=c,this._stackPartitions=l,this._slicePartitions=f,this._vertexFormat=u.VertexFormat.clone(d),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}h.packedLength=2*a.Cartesian3.packedLength+u.VertexFormat.packedLength+7,h.pack=function(t,e,n){return n=i.defaultValue(n,0),a.Cartesian3.pack(t._radii,e,n),n+=a.Cartesian3.packedLength,a.Cartesian3.pack(t._innerRadii,e,n),n+=a.Cartesian3.packedLength,u.VertexFormat.pack(t._vertexFormat,e,n),n+=u.VertexFormat.packedLength,e[n++]=t._minimumClock,e[n++]=t._maximumClock,e[n++]=t._minimumCone,e[n++]=t._maximumCone,e[n++]=t._stackPartitions,e[n++]=t._slicePartitions,e[n]=i.defaultValue(t._offsetAttribute,-1),e};const x=new a.Cartesian3,A=new a.Cartesian3,b=new u.VertexFormat,k={radii:x,innerRadii:A,vertexFormat:b,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let w;h.unpack=function(t,e,n){e=i.defaultValue(e,0);const r=a.Cartesian3.unpack(t,e,x);e+=a.Cartesian3.packedLength;const o=a.Cartesian3.unpack(t,e,A);e+=a.Cartesian3.packedLength;const s=u.VertexFormat.unpack(t,e,b);e+=u.VertexFormat.packedLength;const m=t[e++],c=t[e++],l=t[e++],f=t[e++],d=t[e++],C=t[e++],p=t[e];return i.defined(n)?(n._radii=a.Cartesian3.clone(r,n._radii),n._innerRadii=a.Cartesian3.clone(o,n._innerRadii),n._vertexFormat=u.VertexFormat.clone(s,n._vertexFormat),n._minimumClock=m,n._maximumClock=c,n._minimumCone=l,n._maximumCone=f,n._stackPartitions=d,n._slicePartitions=C,n._offsetAttribute=-1===p?void 0:p,n):(k.minimumClock=m,k.maximumClock=c,k.minimumCone=l,k.maximumCone=f,k.stackPartitions=d,k.slicePartitions=C,k.offsetAttribute=-1===p?void 0:p,new h(k))},h.createGeometry=function(t){const u=t._radii;if(u.x<=0||u.y<=0||u.z<=0)return;const p=t._innerRadii;if(p.x<=0||p.y<=0||p.z<=0)return;const h=t._minimumClock,x=t._maximumClock,A=t._minimumCone,b=t._maximumCone,k=t._vertexFormat;let w,P,g=t._slicePartitions+1,v=t._stackPartitions+1;g=Math.round(g*Math.abs(x-h)/n.CesiumMath.TWO_PI),v=Math.round(v*Math.abs(b-A)/n.CesiumMath.PI),g<2&&(g=2),v<2&&(v=2);let F=0;const V=[A],M=[h];for(w=0;w<v;w++)V.push(A+w*(b-A)/(v-1));for(V.push(b),P=0;P<g;P++)M.push(h+P*(x-h)/(g-1));M.push(x);const T=V.length,D=M.length;let G=0,L=1;const O=p.x!==u.x||p.y!==u.y||p.z!==u.z;let I=!1,E=!1,z=!1;O&&(L=2,A>0&&(I=!0,G+=g-1),b<Math.PI&&(E=!0,G+=g-1),(x-h)%n.CesiumMath.TWO_PI?(z=!0,G+=2*(v-1)+1):G+=1);const N=D*T*L,R=new Float64Array(3*N),U=new Array(N).fill(!1),S=new Array(N).fill(!1),B=g*v*L,W=6*(B+G+1-(g+v)*L),Y=m.IndexDatatype.createTypedArray(B,W),J=k.normal?new Float32Array(3*N):void 0,X=k.tangent?new Float32Array(3*N):void 0,Z=k.bitangent?new Float32Array(3*N):void 0,j=k.st?new Float32Array(2*N):void 0,q=new Array(T),H=new Array(T);for(w=0;w<T;w++)q[w]=_(V[w]),H[w]=y(V[w]);const K=new Array(D),Q=new Array(D);for(P=0;P<D;P++)Q[P]=y(M[P]),K[P]=_(M[P]);for(w=0;w<T;w++)for(P=0;P<D;P++)R[F++]=u.x*q[w]*Q[P],R[F++]=u.y*q[w]*K[P],R[F++]=u.z*H[w];let $,tt,et,at,nt=N/2;if(O)for(w=0;w<T;w++)for(P=0;P<D;P++)R[F++]=p.x*q[w]*Q[P],R[F++]=p.y*q[w]*K[P],R[F++]=p.z*H[w],U[nt]=!0,w>0&&w!==T-1&&0!==P&&P!==D-1&&(S[nt]=!0),nt++;for(F=0,w=1;w<T-2;w++)for($=w*D,tt=(w+1)*D,P=1;P<D-2;P++)Y[F++]=tt+P,Y[F++]=tt+P+1,Y[F++]=$+P+1,Y[F++]=tt+P,Y[F++]=$+P+1,Y[F++]=$+P;if(O){const t=T*D;for(w=1;w<T-2;w++)for($=t+w*D,tt=t+(w+1)*D,P=1;P<D-2;P++)Y[F++]=tt+P,Y[F++]=$+P,Y[F++]=$+P+1,Y[F++]=tt+P,Y[F++]=$+P+1,Y[F++]=tt+P+1}if(O){if(I)for(at=T*D,w=1;w<D-2;w++)Y[F++]=w,Y[F++]=w+1,Y[F++]=at+w+1,Y[F++]=w,Y[F++]=at+w+1,Y[F++]=at+w;if(E)for(et=T*D-D,at=T*D*L-D,w=1;w<D-2;w++)Y[F++]=et+w+1,Y[F++]=et+w,Y[F++]=at+w,Y[F++]=et+w+1,Y[F++]=at+w,Y[F++]=at+w+1}if(z){for(w=1;w<T-2;w++)at=D*T+D*w,et=D*w,Y[F++]=at,Y[F++]=et+D,Y[F++]=et,Y[F++]=at,Y[F++]=at+D,Y[F++]=et+D;for(w=1;w<T-2;w++)at=D*T+D*(w+1)-1,et=D*(w+1)-1,Y[F++]=et+D,Y[F++]=at,Y[F++]=et,Y[F++]=et+D,Y[F++]=at+D,Y[F++]=at}const it=new o.GeometryAttributes;k.position&&(it.position=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:R}));let rt=0,ot=0,st=0,mt=0;const ut=N/2;let ct;const lt=a.Ellipsoid.fromCartesian3(u),ft=a.Ellipsoid.fromCartesian3(p);if(k.st||k.normal||k.tangent||k.bitangent){for(w=0;w<N;w++){ct=U[w]?ft:lt;const t=a.Cartesian3.fromArray(R,3*w,c),e=ct.geodeticSurfaceNormal(t,l);if(S[w]&&a.Cartesian3.negate(e,e),k.st){const t=a.Cartesian2.negate(e,C);j[rt++]=Math.atan2(t.y,t.x)/n.CesiumMath.TWO_PI+.5,j[rt++]=Math.asin(e.z)/Math.PI+.5}if(k.normal&&(J[ot++]=e.x,J[ot++]=e.y,J[ot++]=e.z),k.tangent||k.bitangent){const t=f;let n,i=0;if(U[w]&&(i=ut),n=!I&&w>=i&&w<i+2*D?a.Cartesian3.UNIT_X:a.Cartesian3.UNIT_Z,a.Cartesian3.cross(n,e,t),a.Cartesian3.normalize(t,t),k.tangent&&(X[st++]=t.x,X[st++]=t.y,X[st++]=t.z),k.bitangent){const n=a.Cartesian3.cross(e,t,d);a.Cartesian3.normalize(n,n),Z[mt++]=n.x,Z[mt++]=n.y,Z[mt++]=n.z}}}k.st&&(it.st=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:j})),k.normal&&(it.normal=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:J})),k.tangent&&(it.tangent=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:X})),k.bitangent&&(it.bitangent=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:Z}))}if(i.defined(t._offsetAttribute)){const e=R.length,a=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,i=new Uint8Array(e/3).fill(a);it.applyOffset=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new r.Geometry({attributes:it,indices:Y,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromEllipsoid(lt),offsetAttribute:t._offsetAttribute})},h.getUnitEllipsoid=function(){return i.defined(w)||(w=h.createGeometry(new h({radii:new a.Cartesian3(1,1,1),vertexFormat:u.VertexFormat.POSITION_ONLY}))),w},t.EllipsoidGeometry=h})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipsoidOutlineGeometry-21af8485.js b/src/renderer/public/sdk/Cesium/Workers/EllipsoidOutlineGeometry-21af8485.js deleted file mode 100644 index c79cd3d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipsoidOutlineGeometry-21af8485.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./IndexDatatype-ceed713e"],(function(t,i,e,n,a,o,r,s,u){"use strict";const m=new e.Cartesian3(1,1,1),f=Math.cos,c=Math.sin;function l(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);const i=a.defaultValue(t.radii,m),o=a.defaultValue(t.innerRadii,i),r=a.defaultValue(t.minimumClock,0),s=a.defaultValue(t.maximumClock,n.CesiumMath.TWO_PI),u=a.defaultValue(t.minimumCone,0),f=a.defaultValue(t.maximumCone,n.CesiumMath.PI),c=Math.round(a.defaultValue(t.stackPartitions,10)),l=Math.round(a.defaultValue(t.slicePartitions,8)),d=Math.round(a.defaultValue(t.subdivisions,128));this._radii=e.Cartesian3.clone(i),this._innerRadii=e.Cartesian3.clone(o),this._minimumClock=r,this._maximumClock=s,this._minimumCone=u,this._maximumCone=f,this._stackPartitions=c,this._slicePartitions=l,this._subdivisions=d,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}l.packedLength=2*e.Cartesian3.packedLength+8,l.pack=function(t,i,n){return n=a.defaultValue(n,0),e.Cartesian3.pack(t._radii,i,n),n+=e.Cartesian3.packedLength,e.Cartesian3.pack(t._innerRadii,i,n),n+=e.Cartesian3.packedLength,i[n++]=t._minimumClock,i[n++]=t._maximumClock,i[n++]=t._minimumCone,i[n++]=t._maximumCone,i[n++]=t._stackPartitions,i[n++]=t._slicePartitions,i[n++]=t._subdivisions,i[n]=a.defaultValue(t._offsetAttribute,-1),i};const d=new e.Cartesian3,C=new e.Cartesian3,_={radii:d,innerRadii:C,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};l.unpack=function(t,i,n){i=a.defaultValue(i,0);const o=e.Cartesian3.unpack(t,i,d);i+=e.Cartesian3.packedLength;const r=e.Cartesian3.unpack(t,i,C);i+=e.Cartesian3.packedLength;const s=t[i++],u=t[i++],m=t[i++],f=t[i++],c=t[i++],p=t[i++],h=t[i++],y=t[i];return a.defined(n)?(n._radii=e.Cartesian3.clone(o,n._radii),n._innerRadii=e.Cartesian3.clone(r,n._innerRadii),n._minimumClock=s,n._maximumClock=u,n._minimumCone=m,n._maximumCone=f,n._stackPartitions=c,n._slicePartitions=p,n._subdivisions=h,n._offsetAttribute=-1===y?void 0:y,n):(_.minimumClock=s,_.maximumClock=u,_.minimumCone=m,_.maximumCone=f,_.stackPartitions=c,_.slicePartitions=p,_.subdivisions=h,_.offsetAttribute=-1===y?void 0:y,new l(_))},l.createGeometry=function(t){const m=t._radii;if(m.x<=0||m.y<=0||m.z<=0)return;const l=t._innerRadii;if(l.x<=0||l.y<=0||l.z<=0)return;const d=t._minimumClock,C=t._maximumClock,_=t._minimumCone,p=t._maximumCone,h=t._subdivisions,y=e.Ellipsoid.fromCartesian3(m);let b=t._slicePartitions+1,k=t._stackPartitions+1;b=Math.round(b*Math.abs(C-d)/n.CesiumMath.TWO_PI),k=Math.round(k*Math.abs(p-_)/n.CesiumMath.PI),b<2&&(b=2),k<2&&(k=2);let x=0,A=1;const P=l.x!==m.x||l.y!==m.y||l.z!==m.z;let v=!1,M=!1;P&&(A=2,_>0&&(v=!0,x+=b),p<Math.PI&&(M=!0,x+=b));const w=h*A*(k+b),V=new Float64Array(3*w),g=2*(w+x-(b+k)*A),G=u.IndexDatatype.createTypedArray(w,g);let E,O,D,I,T=0;const z=new Array(k),L=new Array(k);for(E=0;E<k;E++)I=_+E*(p-_)/(k-1),z[E]=c(I),L[E]=f(I);const R=new Array(h),N=new Array(h);for(E=0;E<h;E++)D=d+E*(C-d)/(h-1),R[E]=c(D),N[E]=f(D);for(E=0;E<k;E++)for(O=0;O<h;O++)V[T++]=m.x*z[E]*N[O],V[T++]=m.y*z[E]*R[O],V[T++]=m.z*L[E];if(P)for(E=0;E<k;E++)for(O=0;O<h;O++)V[T++]=l.x*z[E]*N[O],V[T++]=l.y*z[E]*R[O],V[T++]=l.z*L[E];for(z.length=h,L.length=h,E=0;E<h;E++)I=_+E*(p-_)/(h-1),z[E]=c(I),L[E]=f(I);for(R.length=b,N.length=b,E=0;E<b;E++)D=d+E*(C-d)/(b-1),R[E]=c(D),N[E]=f(D);for(E=0;E<h;E++)for(O=0;O<b;O++)V[T++]=m.x*z[E]*N[O],V[T++]=m.y*z[E]*R[O],V[T++]=m.z*L[E];if(P)for(E=0;E<h;E++)for(O=0;O<b;O++)V[T++]=l.x*z[E]*N[O],V[T++]=l.y*z[E]*R[O],V[T++]=l.z*L[E];for(T=0,E=0;E<k*A;E++){const t=E*h;for(O=0;O<h-1;O++)G[T++]=t+O,G[T++]=t+O+1}let B=k*h*A;for(E=0;E<b;E++)for(O=0;O<h-1;O++)G[T++]=B+E+O*b,G[T++]=B+E+(O+1)*b;if(P)for(B=k*h*A+b*h,E=0;E<b;E++)for(O=0;O<h-1;O++)G[T++]=B+E+O*b,G[T++]=B+E+(O+1)*b;if(P){let t=k*h*A,i=t+h*b;if(v)for(E=0;E<b;E++)G[T++]=t+E,G[T++]=i+E;if(M)for(t+=h*b-b,i+=h*b-b,E=0;E<b;E++)G[T++]=t+E,G[T++]=i+E}const S=new r.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:V})});if(a.defined(t._offsetAttribute)){const i=V.length,e=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,a=new Uint8Array(i/3).fill(e);S.applyOffset=new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return new o.Geometry({attributes:S,indices:G,primitiveType:o.PrimitiveType.LINES,boundingSphere:i.BoundingSphere.fromEllipsoid(y),offsetAttribute:t._offsetAttribute})},t.EllipsoidOutlineGeometry=l})); diff --git a/src/renderer/public/sdk/Cesium/Workers/EllipsoidTangentPlane-a3de5387.js b/src/renderer/public/sdk/Cesium/Workers/EllipsoidTangentPlane-a3de5387.js deleted file mode 100644 index 84e6acc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/EllipsoidTangentPlane-a3de5387.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./AxisAlignedBoundingBox-cc32292c","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./IntersectionTests-e2577c22","./Plane-b9f0711b","./Transforms-7ac1f9ee"],(function(t,n,e,i,o,r,s){"use strict";const a=new e.Cartesian4;function l(t,n){t=(n=i.defaultValue(n,e.Ellipsoid.WGS84)).scaleToGeodeticSurface(t);const o=s.Transforms.eastNorthUpToFixedFrame(t,n);this._ellipsoid=n,this._origin=t,this._xAxis=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(o,0,a)),this._yAxis=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(o,1,a));const l=e.Cartesian3.fromCartesian4(e.Matrix4.getColumn(o,2,a));this._plane=r.Plane.fromPointNormal(t,l)}Object.defineProperties(l.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}}});const c=new n.AxisAlignedBoundingBox;l.fromPoints=function(t,e){return new l(n.AxisAlignedBoundingBox.fromPoints(t,c).center,e)};const d=new o.Ray,f=new e.Cartesian3;l.prototype.projectPointOntoPlane=function(t,n){const r=d;r.origin=t,e.Cartesian3.normalize(t,r.direction);let s=o.IntersectionTests.rayPlane(r,this._plane,f);if(i.defined(s)||(e.Cartesian3.negate(r.direction,r.direction),s=o.IntersectionTests.rayPlane(r,this._plane,f)),i.defined(s)){const t=e.Cartesian3.subtract(s,this._origin,s),o=e.Cartesian3.dot(this._xAxis,t),r=e.Cartesian3.dot(this._yAxis,t);return i.defined(n)?(n.x=o,n.y=r,n):new e.Cartesian2(o,r)}},l.prototype.projectPointsOntoPlane=function(t,n){i.defined(n)||(n=[]);let e=0;const o=t.length;for(let r=0;r<o;r++){const o=this.projectPointOntoPlane(t[r],n[e]);i.defined(o)&&(n[e]=o,e++)}return n.length=e,n},l.prototype.projectPointToNearestOnPlane=function(t,n){i.defined(n)||(n=new e.Cartesian2);const r=d;r.origin=t,e.Cartesian3.clone(this._plane.normal,r.direction);let s=o.IntersectionTests.rayPlane(r,this._plane,f);i.defined(s)||(e.Cartesian3.negate(r.direction,r.direction),s=o.IntersectionTests.rayPlane(r,this._plane,f));const a=e.Cartesian3.subtract(s,this._origin,s),l=e.Cartesian3.dot(this._xAxis,a),c=e.Cartesian3.dot(this._yAxis,a);return n.x=l,n.y=c,n},l.prototype.projectPointsToNearestOnPlane=function(t,n){i.defined(n)||(n=[]);const e=t.length;n.length=e;for(let i=0;i<e;i++)n[i]=this.projectPointToNearestOnPlane(t[i],n[i]);return n};const p=new e.Cartesian3;l.prototype.projectPointOntoEllipsoid=function(t,n){i.defined(n)||(n=new e.Cartesian3);const o=this._ellipsoid,r=this._origin,s=this._xAxis,a=this._yAxis,l=p;return e.Cartesian3.multiplyByScalar(s,t.x,l),n=e.Cartesian3.add(r,l,n),e.Cartesian3.multiplyByScalar(a,t.y,l),e.Cartesian3.add(n,l,n),o.scaleToGeocentricSurface(n,n),n},l.prototype.projectPointsOntoEllipsoid=function(t,n){const e=t.length;i.defined(n)?n.length=e:n=new Array(e);for(let i=0;i<e;++i)n[i]=this.projectPointOntoEllipsoid(t[i],n[i]);return n},t.EllipsoidTangentPlane=l})); diff --git a/src/renderer/public/sdk/Cesium/Workers/FrustumGeometry-8107694d.js b/src/renderer/public/sdk/Cesium/Workers/FrustumGeometry-8107694d.js deleted file mode 100644 index 1062836..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/FrustumGeometry-8107694d.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./Plane-b9f0711b","./VertexFormat-fa0c27e8"],(function(t,e,a,n,i,r,o,s,f){"use strict";function u(t){this.planes=i.defaultValue(t,[])}const l=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,l[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,l[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,l[2]);const c=new a.Cartesian3,h=new a.Cartesian3,p=new s.Plane(new a.Cartesian3(1,0,0),0);function d(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=i.defaultValue(t.near,1),this._near=this.near,this.far=i.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new u,this._orthographicMatrix=new a.Matrix4}function m(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}u.fromBoundingSphere=function(t,e){i.defined(e)||(e=new u);const n=l.length,r=e.planes;r.length=2*n;const o=t.center,s=t.radius;let f=0;for(let t=0;t<n;++t){const e=l[t];let n=r[f],u=r[f+1];i.defined(n)||(n=r[f]=new a.Cartesian4),i.defined(u)||(u=r[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(e,-s,c),a.Cartesian3.add(o,c,c),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,c),a.Cartesian3.multiplyByScalar(e,s,c),a.Cartesian3.add(o,c,c),u.x=-e.x,u.y=-e.y,u.z=-e.z,u.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,h),c),f+=2}return e},u.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(s.Plane.fromCartesian4(a[i],p));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},u.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===u.MASK_OUTSIDE||a===u.MASK_INSIDE)return a;let n=u.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&!(a&o))continue;const f=t.intersectPlane(s.Plane.fromCartesian4(i[r],p));if(f===e.Intersect.OUTSIDE)return u.MASK_OUTSIDE;f===e.Intersect.INTERSECTING&&(n|=o)}return n},u.MASK_OUTSIDE=4294967295,u.MASK_INSIDE=0,u.MASK_INDETERMINATE=2147483647,Object.defineProperties(d.prototype,{projectionMatrix:{get:function(){return m(this),this._orthographicMatrix}}});const C=new a.Cartesian3,_=new a.Cartesian3,y=new a.Cartesian3,g=new a.Cartesian3;function w(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new d,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=i.defaultValue(t.near,1),this._near=this.near,this.far=i.defaultValue(t.far,5e8),this._far=this.far}function x(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function v(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=i.defaultValue(t.near,1),this._near=this.near,this.far=i.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new u,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function b(t){const e=t.top,n=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&n===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=n,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(r,i,n,e,o,s,t._perspectiveMatrix),t._infinitePerspective=a.Matrix4.computeInfinitePerspectiveOffCenter(r,i,n,e,o,t._infinitePerspective))}d.prototype.computeCullingVolume=function(t,e,n){const r=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,C);a.Cartesian3.normalize(h,h);const p=_;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=y;a.Cartesian3.multiplyByScalar(h,u,d),a.Cartesian3.add(p,d,d);let m=r[0];return i.defined(m)||(m=r[0]=new a.Cartesian4),m.x=h.x,m.y=h.y,m.z=h.z,m.w=-a.Cartesian3.dot(h,d),a.Cartesian3.multiplyByScalar(h,f,d),a.Cartesian3.add(p,d,d),m=r[1],i.defined(m)||(m=r[1]=new a.Cartesian4),m.x=-h.x,m.y=-h.y,m.z=-h.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,g),d),a.Cartesian3.multiplyByScalar(n,s,d),a.Cartesian3.add(p,d,d),m=r[2],i.defined(m)||(m=r[2]=new a.Cartesian4),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-a.Cartesian3.dot(n,d),a.Cartesian3.multiplyByScalar(n,o,d),a.Cartesian3.add(p,d,d),m=r[3],i.defined(m)||(m=r[3]=new a.Cartesian4),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(n,g),d),m=r[4],i.defined(m)||(m=r[4]=new a.Cartesian4),m.x=e.x,m.y=e.y,m.z=e.z,m.w=-a.Cartesian3.dot(e,p),a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d),m=r[5],i.defined(m)||(m=r[5]=new a.Cartesian4),m.x=-e.x,m.y=-e.y,m.z=-e.z,m.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,g),d),this._cullingVolume},d.prototype.getPixelDimensions=function(t,e,a,n,i){m(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},d.prototype.clone=function(t){return i.defined(t)||(t=new d),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},d.prototype.equals=function(t){return i.defined(t)&&t instanceof d&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},d.prototype.equalsEpsilon=function(t,e,a){return t===this||i.defined(t)&&t instanceof d&&n.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&n.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&n.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&n.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&n.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&n.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},w.packedLength=4,w.pack=function(t,e,a){return a=i.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},w.unpack=function(t,e,a){return e=i.defaultValue(e,0),i.defined(a)||(a=new w),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(w.prototype,{projectionMatrix:{get:function(){return x(this),this._offCenterFrustum.projectionMatrix}}}),w.prototype.computeCullingVolume=function(t,e,a){return x(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},w.prototype.getPixelDimensions=function(t,e,a,n,i){return x(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},w.prototype.clone=function(t){return i.defined(t)||(t=new w),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},w.prototype.equals=function(t){return!!(i.defined(t)&&t instanceof w)&&(x(this),x(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},w.prototype.equalsEpsilon=function(t,e,a){return!!(i.defined(t)&&t instanceof w)&&(x(this),x(t),n.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&n.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return b(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return b(this),this._infinitePerspective}}});const M=new a.Cartesian3,V=new a.Cartesian3,F=new a.Cartesian3,E=new a.Cartesian3;function O(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new v,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=i.defaultValue(t.near,1),this._near=this.near,this.far=i.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=i.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=i.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function P(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}v.prototype.computeCullingVolume=function(t,e,n){const r=this._cullingVolume.planes,o=this.top,s=this.bottom,f=this.right,u=this.left,l=this.near,c=this.far,h=a.Cartesian3.cross(e,n,M),p=V;a.Cartesian3.multiplyByScalar(e,l,p),a.Cartesian3.add(t,p,p);const d=F;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=E;a.Cartesian3.multiplyByScalar(h,u,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.normalize(m,m),a.Cartesian3.cross(m,n,m),a.Cartesian3.normalize(m,m);let C=r[0];return i.defined(C)||(C=r[0]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(n,m,m),a.Cartesian3.normalize(m,m),C=r[1],i.defined(C)||(C=r[1]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,s,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(h,m,m),a.Cartesian3.normalize(m,m),C=r[2],i.defined(C)||(C=r[2]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),a.Cartesian3.multiplyByScalar(n,o,m),a.Cartesian3.add(p,m,m),a.Cartesian3.subtract(m,t,m),a.Cartesian3.cross(m,h,m),a.Cartesian3.normalize(m,m),C=r[3],i.defined(C)||(C=r[3]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,t),C=r[4],i.defined(C)||(C=r[4]=new a.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,p),a.Cartesian3.negate(e,m),C=r[5],i.defined(C)||(C=r[5]=new a.Cartesian4),C.x=m.x,C.y=m.y,C.z=m.z,C.w=-a.Cartesian3.dot(m,d),this._cullingVolume},v.prototype.getPixelDimensions=function(t,e,a,n,i){b(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},v.prototype.clone=function(t){return i.defined(t)||(t=new v),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},v.prototype.equals=function(t){return i.defined(t)&&t instanceof v&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},v.prototype.equalsEpsilon=function(t,e,a){return t===this||i.defined(t)&&t instanceof v&&n.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&n.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&n.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&n.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&n.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&n.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},O.packedLength=6,O.pack=function(t,e,a){return a=i.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},O.unpack=function(t,e,a){return e=i.defaultValue(e,0),i.defined(a)||(a=new O),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(O.prototype,{projectionMatrix:{get:function(){return P(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return P(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return P(this),this._fovy}},sseDenominator:{get:function(){return P(this),this._sseDenominator}}}),O.prototype.computeCullingVolume=function(t,e,a){return P(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},O.prototype.getPixelDimensions=function(t,e,a,n,i){return P(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},O.prototype.clone=function(t){return i.defined(t)||(t=new O),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},O.prototype.equals=function(t){return!!(i.defined(t)&&t instanceof O)&&(P(this),P(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},O.prototype.equalsEpsilon=function(t,e,a){return!!(i.defined(t)&&t instanceof O)&&(P(this),P(t),n.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&n.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function z(t){const n=t.frustum,r=t.orientation,o=t.origin,s=i.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT),u=i.defaultValue(t._drawNearPlane,!0);let l,c;n instanceof O?(l=0,c=O.packedLength):n instanceof w&&(l=1,c=w.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(o),this._orientation=e.Quaternion.clone(r),this._drawNearPlane=u,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+c+a.Cartesian3.packedLength+e.Quaternion.packedLength+f.VertexFormat.packedLength}z.pack=function(t,n,r){r=i.defaultValue(r,0);const o=t._frustumType,s=t._frustum;return n[r++]=o,0===o?(O.pack(s,n,r),r+=O.packedLength):(w.pack(s,n,r),r+=w.packedLength),a.Cartesian3.pack(t._origin,n,r),r+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,r),r+=e.Quaternion.packedLength,f.VertexFormat.pack(t._vertexFormat,n,r),n[r+=f.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const R=new O,S=new w,T=new e.Quaternion,k=new a.Cartesian3,A=new f.VertexFormat;function D(t,e,a,n,r,o,s,f){const u=t/3*2;for(let r=0;r<4;++r)i.defined(e)&&(e[t]=o.x,e[t+1]=o.y,e[t+2]=o.z),i.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),i.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;r[u]=0,r[u+1]=0,r[u+2]=1,r[u+3]=0,r[u+4]=1,r[u+5]=1,r[u+6]=0,r[u+7]=1}z.unpack=function(t,n,r){n=i.defaultValue(n,0);const o=t[n++];let s;0===o?(s=O.unpack(t,n,R),n+=O.packedLength):(s=w.unpack(t,n,S),n+=w.packedLength);const u=a.Cartesian3.unpack(t,n,k);n+=a.Cartesian3.packedLength;const l=e.Quaternion.unpack(t,n,T);n+=e.Quaternion.packedLength;const c=f.VertexFormat.unpack(t,n,A),h=1===t[n+=f.VertexFormat.packedLength];if(!i.defined(r))return new z({frustum:s,origin:u,orientation:l,vertexFormat:c,_drawNearPlane:h});const p=o===r._frustumType?r._frustum:void 0;return r._frustum=s.clone(p),r._frustumType=o,r._origin=a.Cartesian3.clone(u,r._origin),r._orientation=e.Quaternion.clone(l,r._orientation),r._vertexFormat=f.VertexFormat.clone(c,r._vertexFormat),r._drawNearPlane=h,r};const I=new a.Matrix3,q=new a.Matrix4,B=new a.Matrix4,L=new a.Cartesian3,N=new a.Cartesian3,G=new a.Cartesian3,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new Array(3),Y=new Array(4);Y[0]=new a.Cartesian4(-1,-1,1,1),Y[1]=new a.Cartesian4(1,-1,1,1),Y[2]=new a.Cartesian4(1,1,1,1),Y[3]=new a.Cartesian4(-1,1,1,1);const J=new Array(4);for(let t=0;t<4;++t)J[t]=new a.Cartesian4;z._computeNearFarPlanes=function(t,e,n,r,o,s,f,u){const l=a.Matrix3.fromQuaternion(e,I);let c=i.defaultValue(s,L),h=i.defaultValue(f,N),p=i.defaultValue(u,G);c=a.Matrix3.getColumn(l,0,c),h=a.Matrix3.getColumn(l,1,h),p=a.Matrix3.getColumn(l,2,p),a.Cartesian3.normalize(c,c),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.negate(c,c);const d=a.Matrix4.computeView(t,p,h,c,q);let m,C;if(0===n){const t=r.projectionMatrix,e=a.Matrix4.multiply(t,d,B);C=a.Matrix4.inverse(e,B)}else m=a.Matrix4.inverseTransformation(d,B);i.defined(C)?(K[0]=r.near,K[1]=r.far):(K[0]=0,K[1]=r.near,K[2]=r.far);for(let e=0;e<2;++e)for(let n=0;n<4;++n){let s=a.Cartesian4.clone(Y[n],J[n]);if(i.defined(C)){s=a.Matrix4.multiplyByVector(C,s,s);const n=1/s.w;a.Cartesian3.multiplyByScalar(s,n,s),a.Cartesian3.subtract(s,t,s),a.Cartesian3.normalize(s,s);const i=a.Cartesian3.dot(p,s);a.Cartesian3.multiplyByScalar(s,K[e]/i,s),a.Cartesian3.add(s,t,s)}else{i.defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);const t=K[e],n=K[e+1];s.x=.5*(s.x*(r.right-r.left)+r.left+r.right),s.y=.5*(s.y*(r.top-r.bottom)+r.bottom+r.top),s.z=.5*(s.z*(t-n)-t-n),s.w=1,a.Matrix4.multiplyByVector(m,s,s)}o[12*e+3*n]=s.x,o[12*e+3*n+1]=s.y,o[12*e+3*n+2]=s.z}},z.createGeometry=function(t){const s=t._frustumType,f=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);z._computeNearFarPlanes(u,l,s,f,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new o.GeometryAttributes({position:new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(i.defined(h.normal)||i.defined(h.tangent)||i.defined(h.bitangent)||i.defined(h.st)){const t=i.defined(h.normal)?new Float32Array(12*p):void 0,e=i.defined(h.tangent)?new Float32Array(12*p):void 0,o=i.defined(h.bitangent)?new Float32Array(12*p):void 0,s=i.defined(h.st)?new Float32Array(8*p):void 0,f=L,u=N,l=G,d=a.Cartesian3.negate(f,j),_=a.Cartesian3.negate(u,U),y=a.Cartesian3.negate(l,Q);m=0,c&&(D(m,t,e,o,s,y,f,u),m+=12),D(m,t,e,o,s,l,d,u),m+=12,D(m,t,e,o,s,d,y,u),m+=12,D(m,t,e,o,s,_,y,d),m+=12,D(m,t,e,o,s,f,l,u),m+=12,D(m,t,e,o,s,u,l,d),i.defined(t)&&(C.normal=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),i.defined(e)&&(C.tangent=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),i.defined(o)&&(C.bitangent=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:o})),i.defined(s)&&(C.st=new r.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new r.Geometry({attributes:C,indices:_,primitiveType:r.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=z,t.OrthographicFrustum=w,t.PerspectiveFrustum=O})); diff --git a/src/renderer/public/sdk/Cesium/Workers/GeometryAttribute-10955f8d.js b/src/renderer/public/sdk/Cesium/Workers/GeometryAttribute-10955f8d.js deleted file mode 100644 index 4a6837c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/GeometryAttribute-10955f8d.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./WebGLConstants-58abc51a","./Transforms-7ac1f9ee"],(function(t,e,n,a,r){"use strict";var i=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const o={POINTS:a.WebGLConstants.POINTS,LINES:a.WebGLConstants.LINES,LINE_LOOP:a.WebGLConstants.LINE_LOOP,LINE_STRIP:a.WebGLConstants.LINE_STRIP,TRIANGLES:a.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:a.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:a.WebGLConstants.TRIANGLE_FAN,isLines:function(t){return t===o.LINES||t===o.LINE_LOOP||t===o.LINE_STRIP},isTriangles:function(t){return t===o.TRIANGLES||t===o.TRIANGLE_STRIP||t===o.TRIANGLE_FAN},validate:function(t){return t===o.POINTS||t===o.LINES||t===o.LINE_LOOP||t===o.LINE_STRIP||t===o.TRIANGLES||t===o.TRIANGLE_STRIP||t===o.TRIANGLE_FAN}};var s=Object.freeze(o);function u(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=n.defaultValue(t.primitiveType,s.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=n.defaultValue(t.geometryType,i.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}u.computeNumberOfVertices=function(t){let e=-1;for(const a in t.attributes)if(t.attributes.hasOwnProperty(a)&&n.defined(t.attributes[a])&&n.defined(t.attributes[a].values)){const n=t.attributes[a];e=n.values.length/n.componentsPerAttribute}return e};const I=new e.Cartographic,N=new e.Cartesian3,c=new e.Matrix4,T=[new e.Cartographic,new e.Cartographic,new e.Cartographic],l=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],L=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=new e.Cartesian3,f=new r.Quaternion,p=new e.Matrix4,m=new e.Matrix2;u._textureCoordinateRotationPoints=function(t,n,a,i){let o;const s=e.Rectangle.center(i,I),u=e.Cartographic.toCartesian(s,a,N),y=r.Transforms.eastNorthUpToFixedFrame(u,a,c),b=e.Matrix4.inverse(y,c),C=l,h=T;h[0].longitude=i.west,h[0].latitude=i.south,h[1].longitude=i.west,h[1].latitude=i.north,h[2].longitude=i.east,h[2].latitude=i.south;let A=E;for(o=0;o<3;o++)e.Cartographic.toCartesian(h[o],a,A),A=e.Matrix4.multiplyByPointAsVector(b,A,A),C[o].x=A.x,C[o].y=A.y;const x=r.Quaternion.fromAxisAngle(e.Cartesian3.UNIT_Z,-n,f),S=e.Matrix3.fromQuaternion(x,p),d=t.length;let P=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(o=0;o<d;o++)A=e.Matrix4.multiplyByPointAsVector(b,t[o],A),A=e.Matrix3.multiplyByVector(S,A,A),P=Math.min(P,A.x),G=Math.min(G,A.y),R=Math.max(R,A.x),_=Math.max(_,A.y);const O=e.Matrix2.fromRotation(n,m),g=L;g[0].x=P,g[0].y=G,g[1].x=P,g[1].y=_,g[2].x=R,g[2].y=G;const w=C[0],V=C[2].x-w.x,M=C[1].y-w.y;for(o=0;o<3;o++){const t=g[o];e.Matrix2.multiplyByVector(O,t,t),t.x=(t.x-w.x)/V,t.y=(t.y-w.y)/M}const v=g[0],F=g[1],W=g[2],Y=new Array(6);return e.Cartesian2.pack(v,Y),e.Cartesian2.pack(F,Y,2),e.Cartesian2.pack(W,Y,4),Y},t.Geometry=u,t.GeometryAttribute=function(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=n.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=i,t.PrimitiveType=s})); diff --git a/src/renderer/public/sdk/Cesium/Workers/GeometryPipeline-51ce1008.js b/src/renderer/public/sdk/Cesium/Workers/GeometryPipeline-51ce1008.js deleted file mode 100644 index ac6eb13..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/GeometryPipeline-51ce1008.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./AttributeCompression-b4dfdf5f","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./ComponentDatatype-9b23164a","./Transforms-7ac1f9ee","./EncodedCartesian3-0b8c686b","./GeometryAttribute-10955f8d","./IndexDatatype-ceed713e","./IntersectionTests-e2577c22","./Plane-b9f0711b"],(function(e,t,n,i,r,a,s,o,u,c,l){"use strict";const p=new n.Cartesian3,d=new n.Cartesian3,f=new n.Cartesian3;const y={calculateACMR:function(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const r=i.defaultValue(e.cacheSize,24),a=t.length;if(!i.defined(n)){n=0;let e=0,i=t[e];for(;e<a;)i>n&&(n=i),++e,i=t[e]}const s=[];for(let e=0;e<n+1;e++)s[e]=0;let o=r+1;for(let e=0;e<a;++e)o-s[t[e]]>r&&(s[t[e]]=o,++o);return(o-r+1)/(a/3)}};y.tipsify=function(e){const t=(e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT)).indices,n=e.maximumIndex,r=i.defaultValue(e.cacheSize,24);let a;function s(e,t,n,i,r,s,o){let u,c=-1,l=-1,p=0;for(;p<n.length;){const e=n[p];i[e].numLiveTriangles&&(u=0,r-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(u=r-i[e].timeStamp),(u>l||-1===l)&&(l=u,c=e)),++p}return-1===c?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;a<i;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}(i,s,0,o):c}const o=t.length;let u=0,c=0,l=t[c];const p=o;if(i.defined(n))u=n+1;else{for(;c<p;)l>u&&(u=l),++c,l=t[c];if(-1===u)return 0;++u}const d=[];let f;for(f=0;f<u;f++)d[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;let y=0;for(;c<p;)d[t[c]].vertexTriangles.push(y),++d[t[c]].numLiveTriangles,d[t[c+1]].vertexTriangles.push(y),++d[t[c+1]].numLiveTriangles,d[t[c+2]].vertexTriangles.push(y),++d[t[c+2]].numLiveTriangles,++y,c+=3;let m=0,C=r+1;a=1;let h=[];const v=[];let b,g,A=0;const T=[],x=o/3,P=[];for(f=0;f<x;f++)P[f]=!1;let w,S;for(;-1!==m;){h=[],g=d[m],S=g.vertexTriangles.length;for(let e=0;e<S;++e)if(y=g.vertexTriangles[e],!P[y]){P[y]=!0,c=y+y+y;for(let e=0;e<3;++e)w=t[c],h.push(w),v.push(w),T[A]=w,++A,b=d[w],--b.numLiveTriangles,C-b.timeStamp>r&&(b.timeStamp=C,++C),++c}m=s(0,r,h,d,C,v,u)}return T};var m=y;const C={};function h(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function v(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&i.defined(e[n])&&i.defined(e[n].values)){const i=e[n];t[n]=new o.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function b(e,t,n){for(const r in t)if(t.hasOwnProperty(r)&&i.defined(t[r])&&i.defined(t[r].values)){const i=t[r];for(let t=0;t<i.componentsPerAttribute;++t)e[r].values.push(i.values[n*i.componentsPerAttribute+t])}}C.toWireframe=function(e){const t=e.indices;if(i.defined(t)){switch(e.primitiveType){case o.PrimitiveType.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=u.IndexDatatype.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)h(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case o.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=u.IndexDatatype.createTypedArray(t,n);h(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)h(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case o.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=u.IndexDatatype.createTypedArray(t,n),r=e[0];let a=0;for(let n=1;n<t;++n,a+=6)h(i,a,r,e[n],e[n+1]);return i}return new Uint16Array}(t)}e.primitiveType=o.PrimitiveType.LINES}return e},C.createLineSegmentsForVectors=function(e,t,n){t=i.defaultValue(t,"normal"),n=i.defaultValue(n,1e4);const s=e.attributes.position.values,u=e.attributes[t].values,c=s.length,l=new Float64Array(2*c);let p,d=0;for(let e=0;e<c;e+=3)l[d++]=s[e],l[d++]=s[e+1],l[d++]=s[e+2],l[d++]=s[e]+u[e]*n,l[d++]=s[e+1]+u[e+1]*n,l[d++]=s[e+2]+u[e+2]*n;const f=e.boundingSphere;return i.defined(f)&&(p=new a.BoundingSphere(f.center,f.radius+n)),new o.Geometry({attributes:{position:new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:o.PrimitiveType.LINES,boundingSphere:p})},C.createAttributeLocations=function(e){const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,r={};let a,s=0;const o=t.length;for(a=0;a<o;++a){const e=t[a];i.defined(n[e])&&(r[e]=s++)}for(const e in n)n.hasOwnProperty(e)&&!i.defined(r[e])&&(r[e]=s++);return r},C.reorderForPreVertexCache=function(e){const t=o.Geometry.computeNumberOfVertices(e),n=e.indices;if(i.defined(n)){const a=new Int32Array(t);for(let e=0;e<t;e++)a[e]=-1;const s=n,o=s.length,c=u.IndexDatatype.createTypedArray(t,o);let l,p=0,d=0,f=0;for(;p<o;)l=a[s[p]],-1!==l?c[d]=l:(l=s[p],a[l]=f,c[d]=f,++f),++p,++d;e.indices=c;const y=e.attributes;for(const e in y)if(y.hasOwnProperty(e)&&i.defined(y[e])&&i.defined(y[e].values)){const n=y[e],i=n.values;let s=0;const o=n.componentsPerAttribute,u=r.ComponentDatatype.createTypedArray(n.componentDatatype,f*o);for(;s<t;){const e=a[s];if(-1!==e)for(let t=0;t<o;t++)u[o*e+t]=i[o*s+t];++s}n.values=u}}return e},C.reorderForPostVertexCache=function(e,t){const n=e.indices;if(e.primitiveType===o.PrimitiveType.TRIANGLES&&i.defined(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=m.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},C.fitToUnsignedShortIndices=function(e){const t=[],n=o.Geometry.computeNumberOfVertices(e);if(i.defined(e.indices)&&n>=r.CesiumMath.SIXTY_FOUR_KILOBYTES){let n=[],a=[],s=0,u=v(e.attributes);const c=e.indices,l=c.length;let p;e.primitiveType===o.PrimitiveType.TRIANGLES?p=3:e.primitiveType===o.PrimitiveType.LINES?p=2:e.primitiveType===o.PrimitiveType.POINTS&&(p=1);for(let d=0;d<l;d+=p){for(let t=0;t<p;++t){const r=c[d+t];let o=n[r];i.defined(o)||(o=s++,n[r]=o,b(u,e.attributes,r)),a.push(o)}s+p>=r.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new o.Geometry({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],a=[],s=0,u=v(e.attributes))}0!==a.length&&t.push(new o.Geometry({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const g=new n.Cartesian3,A=new n.Cartographic;C.projectTo2D=function(e,t,s,u,c){const l=e.attributes[t],p=(c=i.defined(c)?c:new a.GeographicProjection).ellipsoid,d=l.values,f=new Float64Array(d.length);let y=0;for(let e=0;e<d.length;e+=3){const t=n.Cartesian3.fromArray(d,e,g),i=p.cartesianToCartographic(t,A),r=c.project(i,g);f[y++]=r.x,f[y++]=r.y,f[y++]=r.z}return e.attributes[s]=l,e.attributes[u]=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};const T={high:0,low:0};C.encodeAttribute=function(e,t,n,i){const a=e.attributes[t],u=a.values,c=u.length,l=new Float32Array(c),p=new Float32Array(c);for(let e=0;e<c;++e)s.EncodedCartesian3.encode(u[e],T),l[e]=T.high,p[e]=T.low;const d=a.componentsPerAttribute;return e.attributes[n]=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:d,values:p}),delete e.attributes[t],e};let x=new n.Cartesian3;function P(e,t){if(i.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix4.multiplyByPoint(e,x,x),n.Cartesian3.pack(x,i,t)}}function w(e,t){if(i.defined(t)){const i=t.values,r=i.length;for(let t=0;t<r;t+=3)n.Cartesian3.unpack(i,t,x),n.Matrix3.multiplyByVector(e,x,x),x=n.Cartesian3.normalize(x,x),n.Cartesian3.pack(x,i,t)}}const S=new n.Matrix4,I=new n.Matrix3;C.transformToWorldCoordinates=function(e){const t=e.modelMatrix;if(n.Matrix4.equals(t,n.Matrix4.IDENTITY))return e;const r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(i.defined(r.normal)||i.defined(r.tangent)||i.defined(r.bitangent))&&(n.Matrix4.inverse(t,S),n.Matrix4.transpose(S,S),n.Matrix4.getMatrix3(S,I),w(I,r.normal),w(I,r.tangent),w(I,r.bitangent));const s=e.geometry.boundingSphere;return i.defined(s)&&(e.geometry.boundingSphere=a.BoundingSphere.transform(s,t,s)),e.modelMatrix=n.Matrix4.clone(n.Matrix4.IDENTITY),e};const O=new n.Cartesian3;function E(e,t){const s=e.length;let c,l,p,d;e[0].modelMatrix;const f=i.defined(e[0][t].indices),y=e[0][t].primitiveType,m=function(e,t){const n=e.length,a={},s=e[0][t].attributes;let u;for(u in s)if(s.hasOwnProperty(u)&&i.defined(s[u])&&i.defined(s[u].values)){const c=s[u];let l=c.values.length,p=!0;for(let r=1;r<n;++r){const n=e[r][t].attributes[u];if(!i.defined(n)||c.componentDatatype!==n.componentDatatype||c.componentsPerAttribute!==n.componentsPerAttribute||c.normalize!==n.normalize){p=!1;break}l+=n.values.length}p&&(a[u]=new o.GeometryAttribute({componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:r.ComponentDatatype.createTypedArray(c.componentDatatype,l)}))}return a}(e,t);let C,h,v,b;for(c in m)if(m.hasOwnProperty(c))for(C=m[c].values,d=0,l=0;l<s;++l)for(h=e[l][t].attributes[c].values,v=h.length,p=0;p<v;++p)C[d++]=h[p];if(f){let n=0;for(l=0;l<s;++l)n+=e[l][t].indices.length;const i=o.Geometry.computeNumberOfVertices(new o.Geometry({attributes:m,primitiveType:o.PrimitiveType.POINTS})),r=u.IndexDatatype.createTypedArray(i,n);let a=0,c=0;for(l=0;l<s;++l){const n=e[l][t].indices,i=n.length;for(d=0;d<i;++d)r[a++]=c+n[d];c+=o.Geometry.computeNumberOfVertices(e[l][t])}b=r}let g,A=new n.Cartesian3,T=0;for(l=0;l<s;++l){if(g=e[l][t].boundingSphere,!i.defined(g)){A=void 0;break}n.Cartesian3.add(g.center,A,A)}if(i.defined(A))for(n.Cartesian3.divideByScalar(A,s,A),l=0;l<s;++l){g=e[l][t].boundingSphere;const i=n.Cartesian3.magnitude(n.Cartesian3.subtract(g.center,A,O))+g.radius;i>T&&(T=i)}return new o.Geometry({attributes:m,indices:b,primitiveType:y,boundingSphere:i.defined(A)?new a.BoundingSphere(A,T):void 0})}C.combineInstances=function(e){const t=[],n=[],r=e.length;for(let a=0;a<r;++a){const r=e[a];i.defined(r.geometry)?t.push(r):i.defined(r.westHemisphereGeometry)&&i.defined(r.eastHemisphereGeometry)&&n.push(r)}const a=[];return t.length>0&&a.push(E(t,"geometry")),n.length>0&&(a.push(E(n,"westHemisphereGeometry")),a.push(E(n,"eastHemisphereGeometry"))),a};const N=new n.Cartesian3,L=new n.Cartesian3,z=new n.Cartesian3,D=new n.Cartesian3;C.computeNormal=function(e){const t=e.indices,i=e.attributes,a=i.position.values,s=i.position.values.length/3,u=t.length,c=new Array(s),l=new Array(u/3),p=new Array(u);let d;for(d=0;d<s;d++)c[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<u;d+=3){const e=t[d],i=t[d+1],r=t[d+2],s=3*e,o=3*i,u=3*r;L.x=a[s],L.y=a[s+1],L.z=a[s+2],z.x=a[o],z.y=a[o+1],z.z=a[o+2],D.x=a[u],D.y=a[u+1],D.z=a[u+2],c[e].count++,c[i].count++,c[r].count++,n.Cartesian3.subtract(z,L,z),n.Cartesian3.subtract(D,L,D),l[f]=n.Cartesian3.cross(z,D,new n.Cartesian3),f++}let y,m=0;for(d=0;d<s;d++)c[d].indexOffset+=m,m+=c[d].count;for(f=0,d=0;d<u;d+=3){y=c[t[d]];let e=y.indexOffset+y.currentCount;p[e]=f,y.currentCount++,y=c[t[d+1]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,y=c[t[d+2]],e=y.indexOffset+y.currentCount,p[e]=f,y.currentCount++,f++}const C=new Float32Array(3*s);for(d=0;d<s;d++){const e=3*d;if(y=c[d],n.Cartesian3.clone(n.Cartesian3.ZERO,N),y.count>0){for(f=0;f<y.count;f++)n.Cartesian3.add(N,l[p[y.indexOffset+f]],N);n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,r.CesiumMath.EPSILON10)&&n.Cartesian3.clone(l[p[y.indexOffset]],N)}n.Cartesian3.equalsEpsilon(n.Cartesian3.ZERO,N,r.CesiumMath.EPSILON10)&&(N.z=1),n.Cartesian3.normalize(N,N),C[e]=N.x,C[e+1]=N.y,C[e+2]=N.z}return e.attributes.normal=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const M=new n.Cartesian3,G=new n.Cartesian3,V=new n.Cartesian3;C.computeTangentAndBitangent=function(e){e.attributes;const t=e.indices,i=e.attributes.position.values,a=e.attributes.normal.values,s=e.attributes.st.values,u=e.attributes.position.values.length/3,c=t.length,l=new Array(3*u);let p,d,f,y;for(p=0;p<l.length;p++)l[p]=0;for(p=0;p<c;p+=3){const e=t[p],n=t[p+1],r=t[p+2];d=3*e,f=3*n,y=3*r;const a=2*e,o=2*n,u=2*r,c=i[d],m=i[d+1],C=i[d+2],h=s[a],v=s[a+1],b=s[o+1]-v,g=s[u+1]-v,A=1/((s[o]-h)*g-(s[u]-h)*b),T=(g*(i[f]-c)-b*(i[y]-c))*A,x=(g*(i[f+1]-m)-b*(i[y+1]-m))*A,P=(g*(i[f+2]-C)-b*(i[y+2]-C))*A;l[d]+=T,l[d+1]+=x,l[d+2]+=P,l[f]+=T,l[f+1]+=x,l[f+2]+=P,l[y]+=T,l[y+1]+=x,l[y+2]+=P}const m=new Float32Array(3*u),C=new Float32Array(3*u);for(p=0;p<u;p++){d=3*p,f=d+1,y=d+2;const e=n.Cartesian3.fromArray(a,d,M),t=n.Cartesian3.fromArray(l,d,V),i=n.Cartesian3.dot(e,t);n.Cartesian3.multiplyByScalar(e,i,G),n.Cartesian3.normalize(n.Cartesian3.subtract(t,G,t),t),m[d]=t.x,m[f]=t.y,m[y]=t.z,n.Cartesian3.normalize(n.Cartesian3.cross(e,t,t),t),C[d]=t.x,C[f]=t.y,C[y]=t.z}return e.attributes.tangent=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};const R=new n.Cartesian2,F=new n.Cartesian3,B=new n.Cartesian3,_=new n.Cartesian3;let k=new n.Cartesian2;function q(e){switch(e.primitiveType){case o.PrimitiveType.TRIANGLE_FAN:return function(e){const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=o.PrimitiveType.TRIANGLES,e}(e);case o.PrimitiveType.TRIANGLE_STRIP:return function(e){const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,3*(t-2));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 e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=o.PrimitiveType.TRIANGLES,e}(e);case o.PrimitiveType.TRIANGLES:return function(e){if(i.defined(e.indices))return e;const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case o.PrimitiveType.LINE_STRIP:return function(e){const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=o.PrimitiveType.LINES,e}(e);case o.PrimitiveType.LINE_LOOP:return function(e){const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=o.PrimitiveType.LINES,e}(e);case o.PrimitiveType.LINES:return function(e){if(i.defined(e.indices))return e;const t=o.Geometry.computeNumberOfVertices(e),n=u.IndexDatatype.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function U(e,t){Math.abs(e.y)<r.CesiumMath.EPSILON6&&(e.y=t?-r.CesiumMath.EPSILON6:r.CesiumMath.EPSILON6)}C.compressVertices=function(e){const a=e.attributes.extrudeDirection;let s,u;if(i.defined(a)){const i=a.values;u=i.length/3;const c=new Float32Array(2*u);let l=0;for(s=0;s<u;++s)n.Cartesian3.fromArray(i,3*s,F),n.Cartesian3.equals(F,n.Cartesian3.ZERO)?l+=2:(k=t.AttributeCompression.octEncodeInRange(F,65535,k),c[l++]=k.x,c[l++]=k.y);return e.attributes.compressedAttributes=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c}),delete e.attributes.extrudeDirection,e}const c=e.attributes.normal,l=e.attributes.st,p=i.defined(c),d=i.defined(l);if(!p&&!d)return e;const f=e.attributes.tangent,y=e.attributes.bitangent,m=i.defined(f),C=i.defined(y);let h,v,b,g;p&&(h=c.values),d&&(v=l.values),m&&(b=f.values),C&&(g=y.values);u=(p?h.length:v.length)/(p?3:2);let A=u,T=d&&p?2:1;T+=m||C?1:0,A*=T;const x=new Float32Array(A);let P=0;for(s=0;s<u;++s){d&&(n.Cartesian2.fromArray(v,2*s,R),x[P++]=t.AttributeCompression.compressTextureCoordinates(R));const e=3*s;p&&i.defined(b)&&i.defined(g)?(n.Cartesian3.fromArray(h,e,F),n.Cartesian3.fromArray(b,e,B),n.Cartesian3.fromArray(g,e,_),t.AttributeCompression.octPack(F,B,_,R),x[P++]=R.x,x[P++]=R.y):(p&&(n.Cartesian3.fromArray(h,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),m&&(n.Cartesian3.fromArray(b,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)),C&&(n.Cartesian3.fromArray(g,e,F),x[P++]=t.AttributeCompression.octEncodeFloat(F)))}return e.attributes.compressedAttributes=new o.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:T,values:x}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};const Y=new n.Cartesian3;function Z(e,t,i,r){n.Cartesian3.add(e,n.Cartesian3.multiplyByScalar(n.Cartesian3.subtract(t,e,Y),e.y/(e.y-t.y),Y),i),n.Cartesian3.clone(i,r),U(i,!0),U(r,!1)}const H=new n.Cartesian3,W=new n.Cartesian3,X=new n.Cartesian3,j=new n.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return U(e,e.y<0),U(t,t.y<0),void U(n,n.y<0);const i=Math.abs(e.y),a=Math.abs(t.y),s=Math.abs(n.y);let o;o=i>a?i>s?r.CesiumMath.sign(e.y):r.CesiumMath.sign(n.y):a>s?r.CesiumMath.sign(t.y):r.CesiumMath.sign(n.y);const u=o<0;U(e,u),U(t,u),U(n,u)}(e,t,n);const i=e.y<0,a=t.y<0,s=n.y<0;let o=0;o+=i?1:0,o+=a?1:0,o+=s?1:0;const u=J.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,i?(Z(e,t,H,X),Z(e,n,W,j),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(Z(t,n,H,X),Z(t,e,W,j),u[0]=1,u[3]=2,u[4]=0,u[6]=2):s&&(Z(n,e,H,X),Z(n,t,W,j),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,i?a?s||(Z(n,e,H,X),Z(n,t,W,j),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Z(t,n,H,X),Z(t,e,W,j),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Z(e,t,H,X),Z(e,n,W,j),u[0]=1,u[1]=2,u[3]=1,u[6]=0));const c=J.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==o&&2!==o||(c[3]=H,c[4]=W,c[5]=X,c[6]=j,c.length=7),J}function Q(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&i.defined(n[e])&&i.defined(n[e].values)){const t=n[e];t.values=r.ComponentDatatype.createTypedArray(t.componentDatatype,t.values)}const s=o.Geometry.computeNumberOfVertices(e);return e.indices=u.IndexDatatype.createTypedArray(s,e.indices),t&&(e.boundingSphere=a.BoundingSphere.fromVertices(n.position.values)),e}function $(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&i.defined(t[e])&&i.defined(t[e].values)){const i=t[e];n[e]=new o.GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new o.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,n){const r=i.defined(e.geometry.boundingSphere);t=Q(t,r),n=Q(n,r),i.defined(n)&&!i.defined(t)?e.geometry=n:!i.defined(n)&&i.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function te(e,t){const n=new e,i=new e,r=new e;return function(a,s,o,u,c,l,p,d){const f=e.fromArray(c,a*t,n),y=e.fromArray(c,s*t,i),m=e.fromArray(c,o*t,r);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(y,u.y,y),e.multiplyByScalar(m,u.z,m);const C=e.add(f,y,f);e.add(C,m,C),d&&e.normalize(C,C),e.pack(C,l,p*t)}}const ne=te(n.Cartesian4,4),ie=te(n.Cartesian3,3),re=te(n.Cartesian2,2),ae=function(e,t,n,i,a,s,o){const u=a[e]*i.x,c=a[t]*i.y,l=a[n]*i.z;s[o]=u+c+l>r.CesiumMath.EPSILON6?1:0},se=new n.Cartesian3,oe=new n.Cartesian3,ue=new n.Cartesian3,ce=new n.Cartesian3;function le(e,t,a,s,o,u,c,l,y,m,C,h,v,b,g,A){if(!(i.defined(u)||i.defined(c)||i.defined(l)||i.defined(y)||i.defined(m)||0!==b))return;const T=function(e,t,a,s,o){let u,c,l,y,m,C,h,v;if(i.defined(o)||(o=new n.Cartesian3),i.defined(t.z)){if(n.Cartesian3.equalsEpsilon(e,t,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian3.equalsEpsilon(e,a,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian3.equalsEpsilon(e,s,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian3.subtract(a,t,p),c=n.Cartesian3.subtract(s,t,d),l=n.Cartesian3.subtract(e,t,f),y=n.Cartesian3.dot(u,u),m=n.Cartesian3.dot(u,c),C=n.Cartesian3.dot(u,l),h=n.Cartesian3.dot(c,c),v=n.Cartesian3.dot(c,l)}else{if(n.Cartesian2.equalsEpsilon(e,t,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_X,o);if(n.Cartesian2.equalsEpsilon(e,a,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Y,o);if(n.Cartesian2.equalsEpsilon(e,s,r.CesiumMath.EPSILON14))return n.Cartesian3.clone(n.Cartesian3.UNIT_Z,o);u=n.Cartesian2.subtract(a,t,p),c=n.Cartesian2.subtract(s,t,d),l=n.Cartesian2.subtract(e,t,f),y=n.Cartesian2.dot(u,u),m=n.Cartesian2.dot(u,c),C=n.Cartesian2.dot(u,l),h=n.Cartesian2.dot(c,c),v=n.Cartesian2.dot(c,l)}o.y=h*C-m*v,o.z=y*v-m*C;const b=y*h-m*m;if(0!==b)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}(s,n.Cartesian3.fromArray(o,3*e,se),n.Cartesian3.fromArray(o,3*t,oe),n.Cartesian3.fromArray(o,3*a,ue),ce);if(i.defined(T)){if(i.defined(u)&&ie(e,t,a,T,u,h.normal.values,A,!0),i.defined(m)){const i=n.Cartesian3.fromArray(m,3*e,se),r=n.Cartesian3.fromArray(m,3*t,oe),s=n.Cartesian3.fromArray(m,3*a,ue);let o;n.Cartesian3.multiplyByScalar(i,T.x,i),n.Cartesian3.multiplyByScalar(r,T.y,r),n.Cartesian3.multiplyByScalar(s,T.z,s),n.Cartesian3.equals(i,n.Cartesian3.ZERO)&&n.Cartesian3.equals(r,n.Cartesian3.ZERO)&&n.Cartesian3.equals(s,n.Cartesian3.ZERO)?(o=se,o.x=0,o.y=0,o.z=0):(o=n.Cartesian3.add(i,r,i),n.Cartesian3.add(o,s,o),n.Cartesian3.normalize(o,o)),n.Cartesian3.pack(o,h.extrudeDirection.values,3*A)}if(i.defined(C)&&ae(e,t,a,T,C,h.applyOffset.values,A),i.defined(c)&&ie(e,t,a,T,c,h.tangent.values,A,!0),i.defined(l)&&ie(e,t,a,T,l,h.bitangent.values,A,!0),i.defined(y)&&re(e,t,a,T,y,h.st.values,A),b>0)for(let n=0;n<b;n++){const i=v[n];pe(e,t,a,T,A,g[i],h[i])}}}function pe(e,t,n,i,r,a,s){const o=a.componentsPerAttribute,u=a.values,c=s.values;switch(o){case 4:ne(e,t,n,i,u,c,r,!1);break;case 3:ie(e,t,n,i,u,c,r,!1);break;case 2:re(e,t,n,i,u,c,r,!1);break;default:c[r]=u[e]*i.x+u[t]*i.y+u[n]*i.z}}function de(e,t,n,i,r,a){const s=e.position.values.length/3;if(-1!==r){const o=i[r],u=n[o];return-1===u?(n[o]=s,e.position.values.push(a.x,a.y,a.z),t.push(s),s):(t.push(u),u)}return e.position.values.push(a.x,a.y,a.z),t.push(s),s}const fe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ye(e){const t=e.geometry,r=t.attributes,a=r.position.values,s=i.defined(r.normal)?r.normal.values:void 0,o=i.defined(r.bitangent)?r.bitangent.values:void 0,u=i.defined(r.tangent)?r.tangent.values:void 0,c=i.defined(r.st)?r.st.values:void 0,l=i.defined(r.extrudeDirection)?r.extrudeDirection.values:void 0,p=i.defined(r.applyOffset)?r.applyOffset.values:void 0,d=t.indices,f=[];for(const e in r)r.hasOwnProperty(e)&&!fe[e]&&i.defined(r[e])&&f.push(e);const y=f.length,m=$(t),C=$(t);let h,v,b,g,A;const T=[];T.length=a.length/3;const x=[];for(x.length=a.length/3,A=0;A<T.length;++A)T[A]=-1,x[A]=-1;const P=d.length;for(A=0;A<P;A+=3){const e=d[A],t=d[A+1],P=d[A+2];let w=n.Cartesian3.fromArray(a,3*e),S=n.Cartesian3.fromArray(a,3*t),I=n.Cartesian3.fromArray(a,3*P);const O=K(w,S,I);if(i.defined(O)&&O.positions.length>3){const n=O.positions,i=O.indices,w=i.length;for(let S=0;S<w;++S){const w=i[S],I=n[w];I.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=de(h,v,b,d,w<3?A+w:-1,I),le(e,t,P,I,a,s,u,o,c,l,p,h,f,y,r,g)}}else i.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),w.y<0?(h=C.attributes,v=C.indices,b=T):(h=m.attributes,v=m.indices,b=x),g=de(h,v,b,d,A,w),le(e,t,P,w,a,s,u,o,c,l,p,h,f,y,r,g),g=de(h,v,b,d,A+1,S),le(e,t,P,S,a,s,u,o,c,l,p,h,f,y,r,g),g=de(h,v,b,d,A+2,I),le(e,t,P,I,a,s,u,o,c,l,p,h,f,y,r,g)}ee(e,C,m)}const me=l.Plane.fromPointNormal(n.Cartesian3.ZERO,n.Cartesian3.UNIT_Y),Ce=new n.Cartesian3,he=new n.Cartesian3;function ve(e,t,a,s,o,u,c){if(!i.defined(c))return;const l=n.Cartesian3.fromArray(s,3*e,se);n.Cartesian3.equalsEpsilon(l,a,r.CesiumMath.EPSILON10)?u.applyOffset.values[o]=c[e]:u.applyOffset.values[o]=c[t]}function be(e){const t=e.geometry,a=t.attributes,s=a.position.values,o=i.defined(a.applyOffset)?a.applyOffset.values:void 0,u=t.indices,l=$(t),p=$(t);let d;const f=u.length,y=[];y.length=s.length/3;const m=[];for(m.length=s.length/3,d=0;d<y.length;++d)y[d]=-1,m[d]=-1;for(d=0;d<f;d+=2){const e=u[d],t=u[d+1],a=n.Cartesian3.fromArray(s,3*e,se),f=n.Cartesian3.fromArray(s,3*t,oe);let C;Math.abs(a.y)<r.CesiumMath.EPSILON6&&(a.y<0?a.y=-r.CesiumMath.EPSILON6:a.y=r.CesiumMath.EPSILON6),Math.abs(f.y)<r.CesiumMath.EPSILON6&&(f.y<0?f.y=-r.CesiumMath.EPSILON6:f.y=r.CesiumMath.EPSILON6);let h=l.attributes,v=l.indices,b=m,g=p.attributes,A=p.indices,T=y;const x=c.IntersectionTests.lineSegmentPlane(a,f,me,ue);if(i.defined(x)){const i=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,5*r.CesiumMath.EPSILON9,Ce);a.y<0&&(n.Cartesian3.negate(i,i),h=p.attributes,v=p.indices,b=y,g=l.attributes,A=l.indices,T=m);const c=n.Cartesian3.add(x,i,he);C=de(h,v,b,u,d,a),ve(e,t,a,s,C,h,o),C=de(h,v,b,u,-1,c),ve(e,t,c,s,C,h,o),n.Cartesian3.negate(i,i),n.Cartesian3.add(x,i,c),C=de(g,A,T,u,-1,c),ve(e,t,c,s,C,g,o),C=de(g,A,T,u,d+1,f),ve(e,t,f,s,C,g,o)}else{let n,i,r;a.y<0?(n=p.attributes,i=p.indices,r=y):(n=l.attributes,i=l.indices,r=m),C=de(n,i,r,u,d,a),ve(e,t,a,s,C,n,o),C=de(n,i,r,u,d+1,f),ve(e,t,f,s,C,n,o)}}ee(e,p,l)}const ge=new n.Cartesian2,Ae=new n.Cartesian2,Te=new n.Cartesian3,xe=new n.Cartesian3,Pe=new n.Cartesian3,we=new n.Cartesian3,Se=new n.Cartesian3,Ie=new n.Cartesian3,Oe=new n.Cartesian4;function Ee(e){const t=e.attributes,i=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,s=i.length;for(let e=0;e<s;e+=3){const t=n.Cartesian3.unpack(i,e,Te);if(t.x>0)continue;const o=n.Cartesian3.unpack(r,e,xe);(t.y<0&&o.y>0||t.y>0&&o.y<0)&&(e-3>0?(r[e]=i[e-3],r[e+1]=i[e-2],r[e+2]=i[e-1]):n.Cartesian3.pack(t,r,e));const u=n.Cartesian3.unpack(a,e,Pe);(t.y<0&&u.y>0||t.y>0&&u.y<0)&&(e+3<s?(a[e]=i[e+3],a[e+1]=i[e+4],a[e+2]=i[e+5]):n.Cartesian3.pack(t,a,e))}}const Ne=5*r.CesiumMath.EPSILON9,Le=r.CesiumMath.EPSILON6;C.splitLongitude=function(e){const t=e.geometry,s=t.boundingSphere;if(i.defined(s)){if(s.center.x-s.radius>0||a.BoundingSphere.intersectPlane(s,l.Plane.ORIGIN_ZX_PLANE)!==a.Intersect.INTERSECTING)return e}if(t.geometryType!==o.GeometryType.NONE)switch(t.geometryType){case o.GeometryType.POLYLINES:!function(e){const t=e.geometry,a=t.attributes,s=a.position.values,o=a.prevPosition.values,u=a.nextPosition.values,l=a.expandAndWidth.values,p=i.defined(a.st)?a.st.values:void 0,d=i.defined(a.color)?a.color.values:void 0,f=$(t),y=$(t);let m,C,h,v=!1;const b=s.length/3;for(m=0;m<b;m+=4){const e=m,t=m+2,a=n.Cartesian3.fromArray(s,3*e,Te),b=n.Cartesian3.fromArray(s,3*t,xe);if(Math.abs(a.y)<Le)for(a.y=Le*(b.y<0?-1:1),s[3*m+1]=a.y,s[3*(m+1)+1]=a.y,C=3*e;C<3*e+12;C+=3)o[C]=s[3*m],o[C+1]=s[3*m+1],o[C+2]=s[3*m+2];if(Math.abs(b.y)<Le)for(b.y=Le*(a.y<0?-1:1),s[3*(m+2)+1]=b.y,s[3*(m+3)+1]=b.y,C=3*e;C<3*e+12;C+=3)u[C]=s[3*(m+2)],u[C+1]=s[3*(m+2)+1],u[C+2]=s[3*(m+2)+2];let g=f.attributes,A=f.indices,T=y.attributes,x=y.indices;const P=c.IntersectionTests.lineSegmentPlane(a,b,me,we);if(i.defined(P)){v=!0;const s=n.Cartesian3.multiplyByScalar(n.Cartesian3.UNIT_Y,Ne,Se);a.y<0&&(n.Cartesian3.negate(s,s),g=y.attributes,A=y.indices,T=f.attributes,x=f.indices);const c=n.Cartesian3.add(P,s,Ie);g.position.values.push(a.x,a.y,a.z,a.x,a.y,a.z),g.position.values.push(c.x,c.y,c.z),g.position.values.push(c.x,c.y,c.z),g.prevPosition.values.push(o[3*e],o[3*e+1],o[3*e+2]),g.prevPosition.values.push(o[3*e+3],o[3*e+4],o[3*e+5]),g.prevPosition.values.push(a.x,a.y,a.z,a.x,a.y,a.z),g.nextPosition.values.push(c.x,c.y,c.z),g.nextPosition.values.push(c.x,c.y,c.z),g.nextPosition.values.push(c.x,c.y,c.z),g.nextPosition.values.push(c.x,c.y,c.z),n.Cartesian3.negate(s,s),n.Cartesian3.add(P,s,c),T.position.values.push(c.x,c.y,c.z),T.position.values.push(c.x,c.y,c.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(c.x,c.y,c.z),T.prevPosition.values.push(c.x,c.y,c.z),T.prevPosition.values.push(c.x,c.y,c.z),T.prevPosition.values.push(c.x,c.y,c.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);const w=n.Cartesian2.fromArray(l,2*e,ge),S=Math.abs(w.y);g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S),T.expandAndWidth.values.push(-1,S,1,S),T.expandAndWidth.values.push(-1,-S,1,-S);let I=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(P,a,Pe));if(I/=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(b,a,Pe)),i.defined(d)){const i=n.Cartesian4.fromArray(d,4*e,Oe),a=n.Cartesian4.fromArray(d,4*t,Oe),s=r.CesiumMath.lerp(i.x,a.x,I),o=r.CesiumMath.lerp(i.y,a.y,I),u=r.CesiumMath.lerp(i.z,a.z,I),c=r.CesiumMath.lerp(i.w,a.w,I);for(C=4*e;C<4*e+8;++C)g.color.values.push(d[C]);for(g.color.values.push(s,o,u,c),g.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),T.color.values.push(s,o,u,c),C=4*t;C<4*t+8;++C)T.color.values.push(d[C])}if(i.defined(p)){const i=n.Cartesian2.fromArray(p,2*e,ge),a=n.Cartesian2.fromArray(p,2*(m+3),Ae),s=r.CesiumMath.lerp(i.x,a.x,I);for(C=2*e;C<2*e+4;++C)g.st.values.push(p[C]);for(g.st.values.push(s,i.y),g.st.values.push(s,a.y),T.st.values.push(s,i.y),T.st.values.push(s,a.y),C=2*t;C<2*t+4;++C)T.st.values.push(p[C])}h=g.position.values.length/3-4,A.push(h,h+2,h+1),A.push(h+1,h+2,h+3),h=T.position.values.length/3-4,x.push(h,h+2,h+1),x.push(h+1,h+2,h+3)}else{let e,t;for(a.y<0?(e=y.attributes,t=y.indices):(e=f.attributes,t=f.indices),e.position.values.push(a.x,a.y,a.z),e.position.values.push(a.x,a.y,a.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),C=3*m;C<3*m+12;++C)e.prevPosition.values.push(o[C]),e.nextPosition.values.push(u[C]);for(C=2*m;C<2*m+8;++C)e.expandAndWidth.values.push(l[C]),i.defined(p)&&e.st.values.push(p[C]);if(i.defined(d))for(C=4*m;C<4*m+16;++C)e.color.values.push(d[C]);h=e.position.values.length/3-4,t.push(h,h+2,h+1),t.push(h+1,h+2,h+3)}}v&&(Ee(y),Ee(f)),ee(e,y,f)}(e);break;case o.GeometryType.TRIANGLES:ye(e);break;case o.GeometryType.LINES:be(e)}else q(t),t.primitiveType===o.PrimitiveType.TRIANGLES?ye(e):t.primitiveType===o.PrimitiveType.LINES&&be(e);return e};var ze=C;e.GeometryPipeline=ze})); diff --git a/src/renderer/public/sdk/Cesium/Workers/IntersectionTests-e2577c22.js b/src/renderer/public/sdk/Cesium/Workers/IntersectionTests-e2577c22.js deleted file mode 100644 index 9bf0ffe..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/IntersectionTests-e2577c22.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./Transforms-7ac1f9ee","./ComponentDatatype-9b23164a"],(function(t,n,e,a,i){"use strict";const r={};function s(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}r.computeDiscriminant=function(t,n,e){return n*n-4*t*e},r.computeRealRoots=function(t,n,e){let a;if(0===t)return 0===n?[]:[-e/n];if(0===n){if(0===e)return[0,0];const n=Math.abs(e),r=Math.abs(t);if(n<r&&n/r<i.CesiumMath.EPSILON14)return[0,0];if(n>r&&r/n<i.CesiumMath.EPSILON14)return[];if(a=-e/t,a<0)return[];const s=Math.sqrt(a);return[-s,s]}if(0===e)return a=-n/t,a<0?[a,0]:[0,a];const r=s(n*n,-(4*t*e),i.CesiumMath.EPSILON14);if(r<0)return[];const o=-.5*s(n,i.CesiumMath.sign(n)*Math.sqrt(r),i.CesiumMath.EPSILON14);return n>0?[o/t,e/o]:[e/o,o/t]};var o=r;const c={};function u(t,n,e,a){const i=t,r=n/3,s=e/3,o=a,c=i*s,u=r*o,l=r*r,C=s*s,M=i*s-l,h=i*o-r*s,f=r*o-C,m=4*M*f-h*h;let d,g;if(m<0){let t,n,e;l*u>=c*C?(t=i,n=M,e=-2*r*M+i*h):(t=o,n=f,e=-o*h+2*s*f);const a=-(e<0?-1:1)*Math.abs(t)*Math.sqrt(-m);g=-e+a;const p=g/2,w=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),R=g===a?-w:-n/w;return d=n<=0?w+R:-e/(w*w+R*R+n),l*u>=c*C?[(d-r)/i]:[-o/(d+s)]}const p=M,w=-2*r*M+i*h,R=f,S=-o*h+2*s*f,O=Math.sqrt(m),x=Math.sqrt(3)/2;let y=Math.abs(Math.atan2(i*O,-w)/3);d=2*Math.sqrt(-p);let P=Math.cos(y);g=d*P;let N=d*(-P/2-x*Math.sin(y));const b=g+N>2*r?g-r:N-r,q=i,L=b/q;y=Math.abs(Math.atan2(o*O,-S)/3),d=2*Math.sqrt(-R),P=Math.cos(y),g=d*P,N=d*(-P/2-x*Math.sin(y));const I=-o,E=g+N<2*s?g+s:N+s,v=I/E,z=-b*E-q*I,T=(s*z-r*(b*I))/(-r*z+s*(q*E));return L<=T?L<=v?T<=v?[L,T,v]:[L,v,T]:[v,L,T]:L<=v?[T,L,v]:T<=v?[T,v,L]:[v,T,L]}c.computeDiscriminant=function(t,n,e,a){const i=n*n,r=e*e;return 18*t*n*e*a+i*r-27*(t*t)*(a*a)-4*(t*r*e+i*n*a)},c.computeRealRoots=function(t,n,e,a){let i,r;if(0===t)return o.computeRealRoots(n,e,a);if(0===n){if(0===e){if(0===a)return[0,0,0];r=-a/t;const n=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[n,n,n]}return 0===a?(i=o.computeRealRoots(t,0,e),0===i.Length?[0]:[i[0],0,i[1]]):u(t,0,e,a)}return 0===e?0===a?(r=-n/t,r<0?[r,0,0]:[0,0,r]):u(t,n,0,a):0===a?(i=o.computeRealRoots(t,n,e),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):u(t,n,e,a)};var l=c;const C={};function M(t,n,e,a){const r=t*t,s=n-3*r/8,c=e-n*t/2+r*t/8,u=a-e*t/4+n*r/16-3*r*r/256,C=l.computeRealRoots(1,2*s,s*s-4*u,-c*c);if(C.length>0){const n=-t/4,e=C[C.length-1];if(Math.abs(e)<i.CesiumMath.EPSILON14){const t=o.computeRealRoots(1,s,u);if(2===t.length){const e=t[0],a=t[1];let i;if(e>=0&&a>=0){const t=Math.sqrt(e),i=Math.sqrt(a);return[n-i,n-t,n+t,n+i]}if(e>=0&&a<0)return i=Math.sqrt(e),[n-i,n+i];if(e<0&&a>=0)return i=Math.sqrt(a),[n-i,n+i]}return[]}if(e>0){const t=Math.sqrt(e),a=(s+e-c/t)/2,i=(s+e+c/t)/2,r=o.computeRealRoots(1,t,a),u=o.computeRealRoots(1,-t,i);return 0!==r.length?(r[0]+=n,r[1]+=n,0!==u.length?(u[0]+=n,u[1]+=n,r[1]<=u[0]?[r[0],r[1],u[0],u[1]]:u[1]<=r[0]?[u[0],u[1],r[0],r[1]]:r[0]>=u[0]&&r[1]<=u[1]?[u[0],r[0],r[1],u[1]]:u[0]>=r[0]&&u[1]<=r[1]?[r[0],u[0],u[1],r[1]]:r[0]>u[0]&&r[0]<u[1]?[u[0],r[0],u[1],r[1]]:[r[0],u[0],r[1],u[1]]):r):0!==u.length?(u[0]+=n,u[1]+=n,u):[]}}return[]}function h(t,n,e,a){const r=t*t,s=-2*n,c=e*t+n*n-4*a,u=r*a-e*n*t+e*e,C=l.computeRealRoots(1,s,c,u);if(C.length>0){const s=C[0],c=n-s,u=c*c,l=t/2,M=c/2,h=u-4*a,f=u+4*Math.abs(a),m=r-4*s,d=r+4*Math.abs(s);let g,p,w,R,S,O;if(s<0||h*d<m*f){const n=Math.sqrt(m);g=n/2,p=0===n?0:(t*M-e)/n}else{const n=Math.sqrt(h);g=0===n?0:(t*M-e)/n,p=n/2}0===l&&0===g?(w=0,R=0):i.CesiumMath.sign(l)===i.CesiumMath.sign(g)?(w=l+g,R=s/w):(R=l-g,w=s/R),0===M&&0===p?(S=0,O=0):i.CesiumMath.sign(M)===i.CesiumMath.sign(p)?(S=M+p,O=a/S):(O=M-p,S=a/O);const x=o.computeRealRoots(1,w,S),y=o.computeRealRoots(1,R,O);if(0!==x.length)return 0!==y.length?x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>y[0]&&x[0]<y[1]?[y[0],x[0],y[1],x[1]]:[x[0],y[0],x[1],y[1]]:x;if(0!==y.length)return y}return[]}C.computeDiscriminant=function(t,n,e,a,i){const r=t*t,s=n*n,o=s*n,c=e*e,u=c*e,l=a*a,C=l*a,M=i*i;return s*c*l-4*o*C-4*t*u*l+18*t*n*e*C-27*r*l*l+256*(r*t)*(M*i)+i*(18*o*e*a-4*s*u+16*t*c*c-80*t*n*c*a-6*t*s*l+144*r*e*l)+M*(144*t*s*e-27*s*s-128*r*c-192*r*n*a)},C.computeRealRoots=function(t,n,e,a,r){if(Math.abs(t)<i.CesiumMath.EPSILON15)return l.computeRealRoots(n,e,a,r);const s=n/t,o=e/t,c=a/t,u=r/t;let C=s<0?1:0;switch(C+=o<0?C+1:C,C+=c<0?C+1:C,C+=u<0?C+1:C,C){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return M(s,o,c,u);case 1:case 2:case 5:case 8:case 11:return h(s,o,c,u);default:return}};var f=C;function m(t,a){a=n.Cartesian3.clone(e.defaultValue(a,n.Cartesian3.ZERO)),n.Cartesian3.equals(a,n.Cartesian3.ZERO)||n.Cartesian3.normalize(a,a),this.origin=n.Cartesian3.clone(e.defaultValue(t,n.Cartesian3.ZERO)),this.direction=a}m.clone=function(t,a){if(e.defined(t))return e.defined(a)?(a.origin=n.Cartesian3.clone(t.origin),a.direction=n.Cartesian3.clone(t.direction),a):new m(t.origin,t.direction)},m.getPoint=function(t,a,i){return e.defined(i)||(i=new n.Cartesian3),i=n.Cartesian3.multiplyByScalar(t.direction,a,i),n.Cartesian3.add(t.origin,i,i)};const d={rayPlane:function(t,a,r){e.defined(r)||(r=new n.Cartesian3);const s=t.origin,o=t.direction,c=a.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON15)return;const l=(-a.distance-n.Cartesian3.dot(c,s))/u;return l<0?void 0:(r=n.Cartesian3.multiplyByScalar(o,l,r),n.Cartesian3.add(s,r,r))}},g=new n.Cartesian3,p=new n.Cartesian3,w=new n.Cartesian3,R=new n.Cartesian3,S=new n.Cartesian3;d.rayTriangleParametric=function(t,a,r,s,o){o=e.defaultValue(o,!1);const c=t.origin,u=t.direction,l=n.Cartesian3.subtract(r,a,g),C=n.Cartesian3.subtract(s,a,p),M=n.Cartesian3.cross(u,C,w),h=n.Cartesian3.dot(l,M);let f,m,d,O,x;if(o){if(h<i.CesiumMath.EPSILON6)return;if(f=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(f,M),d<0||d>h)return;if(m=n.Cartesian3.cross(f,l,S),O=n.Cartesian3.dot(u,m),O<0||d+O>h)return;x=n.Cartesian3.dot(C,m)/h}else{if(Math.abs(h)<i.CesiumMath.EPSILON6)return;const t=1/h;if(f=n.Cartesian3.subtract(c,a,R),d=n.Cartesian3.dot(f,M)*t,d<0||d>1)return;if(m=n.Cartesian3.cross(f,l,S),O=n.Cartesian3.dot(u,m)*t,O<0||d+O>1)return;x=n.Cartesian3.dot(C,m)*t}return x},d.rayTriangle=function(t,a,i,r,s,o){const c=d.rayTriangleParametric(t,a,i,r,s);if(e.defined(c)&&!(c<0))return e.defined(o)||(o=new n.Cartesian3),n.Cartesian3.multiplyByScalar(t.direction,c,o),n.Cartesian3.add(t.origin,o,o)};const O=new m;d.lineSegmentTriangle=function(t,a,i,r,s,o,c){const u=O;n.Cartesian3.clone(t,u.origin),n.Cartesian3.subtract(a,t,u.direction),n.Cartesian3.normalize(u.direction,u.direction);const l=d.rayTriangleParametric(u,i,r,s,o);if(!(!e.defined(l)||l<0||l>n.Cartesian3.distance(t,a)))return e.defined(c)||(c=new n.Cartesian3),n.Cartesian3.multiplyByScalar(u.direction,l,c),n.Cartesian3.add(u.origin,c,c)};const x={root0:0,root1:0};function y(t,i,r){e.defined(r)||(r=new a.Interval);const s=t.origin,o=t.direction,c=i.center,u=i.radius*i.radius,l=n.Cartesian3.subtract(s,c,w),C=function(t,n,e,a){const i=n*n-4*t*e;if(i<0)return;if(i>0){const e=1/(2*t),r=Math.sqrt(i),s=(-n+r)*e,o=(-n-r)*e;return s<o?(a.root0=s,a.root1=o):(a.root0=o,a.root1=s),a}const r=-n/(2*t);return 0!==r?(a.root0=a.root1=r,a):void 0}(n.Cartesian3.dot(o,o),2*n.Cartesian3.dot(o,l),n.Cartesian3.magnitudeSquared(l)-u,x);if(e.defined(C))return r.start=C.root0,r.stop=C.root1,r}d.raySphere=function(t,n,a){if(a=y(t,n,a),e.defined(a)&&!(a.stop<0))return a.start=Math.max(a.start,0),a};const P=new m;d.lineSegmentSphere=function(t,a,i,r){const s=P;n.Cartesian3.clone(t,s.origin);const o=n.Cartesian3.subtract(a,t,s.direction),c=n.Cartesian3.magnitude(o);if(n.Cartesian3.normalize(o,o),r=y(s,i,r),!(!e.defined(r)||r.stop<0||r.start>c))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,c),r};const N=new n.Cartesian3,b=new n.Cartesian3;function q(t,n,e){const a=t+n;return i.CesiumMath.sign(t)!==i.CesiumMath.sign(n)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(n)))<e?0:a}d.rayEllipsoid=function(t,e){const i=e.oneOverRadii,r=n.Cartesian3.multiplyComponents(i,t.origin,N),s=n.Cartesian3.multiplyComponents(i,t.direction,b),o=n.Cartesian3.magnitudeSquared(r),c=n.Cartesian3.dot(r,s);let u,l,C,M,h;if(o>1){if(c>=0)return;const t=c*c;if(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,t<C)return;if(t>C){M=c*c-C,h=-c+Math.sqrt(M);const t=h/l,n=u/h;return t<n?new a.Interval(t,n):{start:n,stop:t}}const e=Math.sqrt(u/l);return new a.Interval(e,e)}return o<1?(u=o-1,l=n.Cartesian3.magnitudeSquared(s),C=l*u,M=c*c-C,h=-c+Math.sqrt(M),new a.Interval(0,h/l)):c<0?(l=n.Cartesian3.magnitudeSquared(s),new a.Interval(0,-c/l)):void 0};const L=new n.Cartesian3,I=new n.Cartesian3,E=new n.Cartesian3,v=new n.Cartesian3,z=new n.Cartesian3,T=new n.Matrix3,U=new n.Matrix3,W=new n.Matrix3,B=new n.Matrix3,V=new n.Matrix3,Z=new n.Matrix3,D=new n.Matrix3,A=new n.Cartesian3,F=new n.Cartesian3,G=new n.Cartographic;d.grazingAltitudeLocation=function(t,a){const r=t.origin,s=t.direction;if(!n.Cartesian3.equals(r,n.Cartesian3.ZERO)){const t=a.geodeticSurfaceNormal(r,L);if(n.Cartesian3.dot(s,t)>=0)return r}const c=e.defined(this.rayEllipsoid(t,a)),u=a.transformPositionToScaledSpace(s,L),l=n.Cartesian3.normalize(u,u),C=n.Cartesian3.mostOrthogonalAxis(u,v),M=n.Cartesian3.normalize(n.Cartesian3.cross(C,l,I),I),h=n.Cartesian3.normalize(n.Cartesian3.cross(l,M,E),E),m=T;m[0]=l.x,m[1]=l.y,m[2]=l.z,m[3]=M.x,m[4]=M.y,m[5]=M.z,m[6]=h.x,m[7]=h.y,m[8]=h.z;const d=n.Matrix3.transpose(m,U),g=n.Matrix3.fromScale(a.radii,W),p=n.Matrix3.fromScale(a.oneOverRadii,B),w=V;w[0]=0,w[1]=-s.z,w[2]=s.y,w[3]=s.z,w[4]=0,w[5]=-s.x,w[6]=-s.y,w[7]=s.x,w[8]=0;const R=n.Matrix3.multiply(n.Matrix3.multiply(d,p,Z),w,Z),S=n.Matrix3.multiply(n.Matrix3.multiply(R,g,D),m,D),O=n.Matrix3.multiplyByVector(R,r,z),x=function(t,e,a,r,s){const c=r*r,u=s*s,l=(t[n.Matrix3.COLUMN1ROW1]-t[n.Matrix3.COLUMN2ROW2])*u,C=s*(r*q(t[n.Matrix3.COLUMN1ROW0],t[n.Matrix3.COLUMN0ROW1],i.CesiumMath.EPSILON15)+e.y),M=t[n.Matrix3.COLUMN0ROW0]*c+t[n.Matrix3.COLUMN2ROW2]*u+r*e.x+a,h=u*q(t[n.Matrix3.COLUMN2ROW1],t[n.Matrix3.COLUMN1ROW2],i.CesiumMath.EPSILON15),m=s*(r*q(t[n.Matrix3.COLUMN2ROW0],t[n.Matrix3.COLUMN0ROW2])+e.z);let d;const g=[];if(0===m&&0===h){if(d=o.computeRealRoots(l,C,M),0===d.length)return g;const t=d[0],e=Math.sqrt(Math.max(1-t*t,0));if(g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e)),2===d.length){const t=d[1],e=Math.sqrt(Math.max(1-t*t,0));g.push(new n.Cartesian3(r,s*t,s*-e)),g.push(new n.Cartesian3(r,s*t,s*e))}return g}const p=m*m,w=h*h,R=m*h,S=l*l+w,O=2*(C*l+R),x=2*M*l+C*C-w+p,y=2*(M*C-R),P=M*M-p;if(0===S&&0===O&&0===x&&0===y)return g;d=f.computeRealRoots(S,O,x,y,P);const N=d.length;if(0===N)return g;for(let t=0;t<N;++t){const e=d[t],a=e*e,o=Math.max(1-a,0),c=Math.sqrt(o);let u;u=i.CesiumMath.sign(l)===i.CesiumMath.sign(M)?q(l*a+M,C*e,i.CesiumMath.EPSILON12):i.CesiumMath.sign(M)===i.CesiumMath.sign(C*e)?q(l*a,C*e+M,i.CesiumMath.EPSILON12):q(l*a+C*e,M,i.CesiumMath.EPSILON12);const f=u*q(h*e,m,i.CesiumMath.EPSILON15);f<0?g.push(new n.Cartesian3(r,s*e,s*c)):f>0?g.push(new n.Cartesian3(r,s*e,s*-c)):0!==c?(g.push(new n.Cartesian3(r,s*e,s*-c)),g.push(new n.Cartesian3(r,s*e,s*c)),++t):g.push(new n.Cartesian3(r,s*e,s*c))}return g}(S,n.Cartesian3.negate(O,L),0,0,1);let y,P;const N=x.length;if(N>0){let t=n.Cartesian3.clone(n.Cartesian3.ZERO,F),e=Number.NEGATIVE_INFINITY;for(let a=0;a<N;++a){y=n.Matrix3.multiplyByVector(g,n.Matrix3.multiplyByVector(m,x[a],A),A);const i=n.Cartesian3.normalize(n.Cartesian3.subtract(y,r,v),v),o=n.Cartesian3.dot(i,s);o>e&&(e=o,t=n.Cartesian3.clone(y,t))}const o=a.cartesianToCartographic(t,G);return e=i.CesiumMath.clamp(e,0,1),P=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r,v))*Math.sqrt(1-e*e),P=c?-P:P,o.height=P,a.cartographicToCartesian(o,new n.Cartesian3)}};const Y=new n.Cartesian3;d.lineSegmentPlane=function(t,a,r,s){e.defined(s)||(s=new n.Cartesian3);const o=n.Cartesian3.subtract(a,t,Y),c=r.normal,u=n.Cartesian3.dot(c,o);if(Math.abs(u)<i.CesiumMath.EPSILON6)return;const l=n.Cartesian3.dot(c,t),C=-(r.distance+l)/u;return C<0||C>1?void 0:(n.Cartesian3.multiplyByScalar(o,C,s),n.Cartesian3.add(t,s,s),s)},d.trianglePlaneIntersection=function(t,e,a,i){const r=i.normal,s=i.distance,o=n.Cartesian3.dot(r,t)+s<0,c=n.Cartesian3.dot(r,e)+s<0,u=n.Cartesian3.dot(r,a)+s<0;let l,C,M=0;if(M+=o?1:0,M+=c?1:0,M+=u?1:0,1!==M&&2!==M||(l=new n.Cartesian3,C=new n.Cartesian3),1===M){if(o)return d.lineSegmentPlane(t,e,i,l),d.lineSegmentPlane(t,a,i,C),{positions:[t,e,a,l,C],indices:[0,3,4,1,2,4,1,4,3]};if(c)return d.lineSegmentPlane(e,a,i,l),d.lineSegmentPlane(e,t,i,C),{positions:[t,e,a,l,C],indices:[1,3,4,2,0,4,2,4,3]};if(u)return d.lineSegmentPlane(a,t,i,l),d.lineSegmentPlane(a,e,i,C),{positions:[t,e,a,l,C],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===M){if(!o)return d.lineSegmentPlane(e,t,i,l),d.lineSegmentPlane(a,t,i,C),{positions:[t,e,a,l,C],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return d.lineSegmentPlane(a,e,i,l),d.lineSegmentPlane(t,e,i,C),{positions:[t,e,a,l,C],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return d.lineSegmentPlane(t,a,i,l),d.lineSegmentPlane(e,a,i,C),{positions:[t,e,a,l,C],indices:[0,1,4,0,4,3,2,3,4]}}};var _=d;t.IntersectionTests=_,t.Ray=m})); diff --git a/src/renderer/public/sdk/Cesium/Workers/OrientedBoundingBox-b6f8f1d3.js b/src/renderer/public/sdk/Cesium/Workers/OrientedBoundingBox-b6f8f1d3.js deleted file mode 100644 index 8a5555b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/OrientedBoundingBox-b6f8f1d3.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./EllipsoidTangentPlane-a3de5387","./ComponentDatatype-9b23164a","./Plane-b9f0711b"],(function(a,t,e,n,r,i,s){"use strict";function o(a,t){this.center=e.Cartesian3.clone(n.defaultValue(a,e.Cartesian3.ZERO)),this.halfAxes=e.Matrix3.clone(n.defaultValue(t,e.Matrix3.ZERO))}o.packedLength=e.Cartesian3.packedLength+e.Matrix3.packedLength,o.pack=function(a,t,r){return r=n.defaultValue(r,0),e.Cartesian3.pack(a.center,t,r),e.Matrix3.pack(a.halfAxes,t,r+e.Cartesian3.packedLength),t},o.unpack=function(a,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new o),e.Cartesian3.unpack(a,t,r.center),e.Matrix3.unpack(a,t+e.Cartesian3.packedLength,r.halfAxes),r};const c=new e.Cartesian3,C=new e.Cartesian3,u=new e.Cartesian3,l=new e.Cartesian3,d=new e.Cartesian3,h=new e.Cartesian3,x=new e.Matrix3,m={unitary:new e.Matrix3,diagonal:new e.Matrix3};o.fromPoints=function(a,t){if(n.defined(t)||(t=new o),!n.defined(a)||0===a.length)return t.halfAxes=e.Matrix3.ZERO,t.center=e.Cartesian3.ZERO,t;let r;const i=a.length,s=e.Cartesian3.clone(a[0],c);for(r=1;r<i;r++)e.Cartesian3.add(s,a[r],s);const f=1/i;e.Cartesian3.multiplyByScalar(s,f,s);let M,p=0,w=0,g=0,y=0,b=0,N=0;for(r=0;r<i;r++)M=e.Cartesian3.subtract(a[r],s,C),p+=M.x*M.x,w+=M.x*M.y,g+=M.x*M.z,y+=M.y*M.y,b+=M.y*M.z,N+=M.z*M.z;p*=f,w*=f,g*=f,y*=f,b*=f,N*=f;const T=x;T[0]=p,T[1]=w,T[2]=g,T[3]=w,T[4]=y,T[5]=b,T[6]=g,T[7]=b,T[8]=N;const O=e.Matrix3.computeEigenDecomposition(T,m),A=e.Matrix3.clone(O.unitary,t.halfAxes);let P=e.Matrix3.getColumn(A,0,l),I=e.Matrix3.getColumn(A,1,d),R=e.Matrix3.getColumn(A,2,h),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,L=Number.MAX_VALUE,z=Number.MAX_VALUE,B=Number.MAX_VALUE;for(r=0;r<i;r++)M=a[r],E=Math.max(e.Cartesian3.dot(P,M),E),S=Math.max(e.Cartesian3.dot(I,M),S),U=Math.max(e.Cartesian3.dot(R,M),U),L=Math.min(e.Cartesian3.dot(P,M),L),z=Math.min(e.Cartesian3.dot(I,M),z),B=Math.min(e.Cartesian3.dot(R,M),B);P=e.Cartesian3.multiplyByScalar(P,.5*(L+E),P),I=e.Cartesian3.multiplyByScalar(I,.5*(z+S),I),R=e.Cartesian3.multiplyByScalar(R,.5*(B+U),R);const V=e.Cartesian3.add(P,I,t.center);e.Cartesian3.add(V,R,V);const _=u;return _.x=E-L,_.y=S-z,_.z=U-B,e.Cartesian3.multiplyByScalar(_,.5,_),e.Matrix3.multiplyByScale(t.halfAxes,_,t.halfAxes),t};const f=new e.Cartesian3,M=new e.Cartesian3;function p(a,t,r,i,s,c,C,u,l,d,h){n.defined(h)||(h=new o);const x=h.halfAxes;e.Matrix3.setColumn(x,0,t,x),e.Matrix3.setColumn(x,1,r,x),e.Matrix3.setColumn(x,2,i,x);let m=f;m.x=(s+c)/2,m.y=(C+u)/2,m.z=(l+d)/2;const p=M;p.x=(c-s)/2,p.y=(u-C)/2,p.z=(d-l)/2;const w=h.center;return m=e.Matrix3.multiplyByVector(x,m,m),e.Cartesian3.add(a,m,w),e.Matrix3.multiplyByScale(x,p,x),h}const w=new e.Cartographic,g=new e.Cartesian3,y=new e.Cartographic,b=new e.Cartographic,N=new e.Cartographic,T=new e.Cartographic,O=new e.Cartographic,A=new e.Cartesian3,P=new e.Cartesian3,I=new e.Cartesian3,R=new e.Cartesian3,E=new e.Cartesian3,S=new e.Cartesian2,U=new e.Cartesian2,L=new e.Cartesian2,z=new e.Cartesian2,B=new e.Cartesian2,V=new e.Cartesian3,_=new e.Cartesian3,k=new e.Cartesian3,W=new e.Cartesian3,D=new e.Cartesian2,X=new e.Cartesian3,q=new e.Cartesian3,j=new e.Cartesian3,Z=new s.Plane(e.Cartesian3.UNIT_X,0);o.fromRectangle=function(a,t,o,c,C){let u,l,d,h,x,m,f;if(t=n.defaultValue(t,0),o=n.defaultValue(o,0),c=n.defaultValue(c,e.Ellipsoid.WGS84),a.width<=i.CesiumMath.PI){const n=e.Rectangle.center(a,w),i=c.cartographicToCartesian(n,g),M=new r.EllipsoidTangentPlane(i,c);f=M.plane;const V=n.longitude,_=a.south<0&&a.north>0?0:n.latitude,k=e.Cartographic.fromRadians(V,a.north,o,y),W=e.Cartographic.fromRadians(a.west,a.north,o,b),D=e.Cartographic.fromRadians(a.west,_,o,N),X=e.Cartographic.fromRadians(a.west,a.south,o,T),q=e.Cartographic.fromRadians(V,a.south,o,O),j=c.cartographicToCartesian(k,A);let Z=c.cartographicToCartesian(W,P);const v=c.cartographicToCartesian(D,I);let Y=c.cartographicToCartesian(X,R);const G=c.cartographicToCartesian(q,E),F=M.projectPointToNearestOnPlane(j,S),H=M.projectPointToNearestOnPlane(Z,U),J=M.projectPointToNearestOnPlane(v,L),K=M.projectPointToNearestOnPlane(Y,z),Q=M.projectPointToNearestOnPlane(G,B);return u=Math.min(H.x,J.x,K.x),l=-u,h=Math.max(H.y,F.y),d=Math.min(K.y,Q.y),W.height=X.height=t,Z=c.cartographicToCartesian(W,P),Y=c.cartographicToCartesian(X,R),x=Math.min(s.Plane.getPointDistance(f,Z),s.Plane.getPointDistance(f,Y)),m=o,p(M.origin,M.xAxis,M.yAxis,M.zAxis,u,l,d,h,x,m,C)}const M=a.south>0,v=a.north<0,Y=M?a.south:v?a.north:0,G=e.Rectangle.center(a,w).longitude,F=e.Cartesian3.fromRadians(G,Y,o,c,V);F.z=0;const H=Math.abs(F.x)<i.CesiumMath.EPSILON10&&Math.abs(F.y)<i.CesiumMath.EPSILON10?e.Cartesian3.UNIT_X:e.Cartesian3.normalize(F,_),J=e.Cartesian3.UNIT_Z,K=e.Cartesian3.cross(H,J,k);f=s.Plane.fromPointNormal(F,H,Z);const Q=e.Cartesian3.fromRadians(G+i.CesiumMath.PI_OVER_TWO,Y,o,c,W);l=e.Cartesian3.dot(s.Plane.projectPointOntoPlane(f,Q,D),K),u=-l,h=e.Cartesian3.fromRadians(0,a.north,v?t:o,c,X).z,d=e.Cartesian3.fromRadians(0,a.south,M?t:o,c,q).z;const $=e.Cartesian3.fromRadians(a.east,Y,o,c,j);return x=s.Plane.getPointDistance(f,$),m=0,p(F,K,J,H,u,l,d,h,x,m,C)},o.fromTransformation=function(a,t){return n.defined(t)||(t=new o),t.center=e.Matrix4.getTranslation(a,t.center),t.halfAxes=e.Matrix4.getMatrix3(a,t.halfAxes),t.halfAxes=e.Matrix3.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},o.clone=function(a,t){if(n.defined(a))return n.defined(t)?(e.Cartesian3.clone(a.center,t.center),e.Matrix3.clone(a.halfAxes,t.halfAxes),t):new o(a.center,a.halfAxes)},o.intersectPlane=function(a,n){const r=a.center,i=n.normal,s=a.halfAxes,o=i.x,c=i.y,C=i.z,u=Math.abs(o*s[e.Matrix3.COLUMN0ROW0]+c*s[e.Matrix3.COLUMN0ROW1]+C*s[e.Matrix3.COLUMN0ROW2])+Math.abs(o*s[e.Matrix3.COLUMN1ROW0]+c*s[e.Matrix3.COLUMN1ROW1]+C*s[e.Matrix3.COLUMN1ROW2])+Math.abs(o*s[e.Matrix3.COLUMN2ROW0]+c*s[e.Matrix3.COLUMN2ROW1]+C*s[e.Matrix3.COLUMN2ROW2]),l=e.Cartesian3.dot(i,r)+n.distance;return l<=-u?t.Intersect.OUTSIDE:l>=u?t.Intersect.INSIDE:t.Intersect.INTERSECTING};const v=new e.Cartesian3,Y=new e.Cartesian3,G=new e.Cartesian3,F=new e.Cartesian3,H=new e.Cartesian3,J=new e.Cartesian3;o.distanceSquaredTo=function(a,t){const n=e.Cartesian3.subtract(t,a.center,f),r=a.halfAxes;let s=e.Matrix3.getColumn(r,0,v),o=e.Matrix3.getColumn(r,1,Y),c=e.Matrix3.getColumn(r,2,G);const C=e.Cartesian3.magnitude(s),u=e.Cartesian3.magnitude(o),l=e.Cartesian3.magnitude(c);let d=!0,h=!0,x=!0;C>0?e.Cartesian3.divideByScalar(s,C,s):d=!1,u>0?e.Cartesian3.divideByScalar(o,u,o):h=!1,l>0?e.Cartesian3.divideByScalar(c,l,c):x=!1;const m=!d+!h+!x;let M,p,w;if(1===m){let a=s;M=o,p=c,h?x||(a=c,p=s):(a=o,M=s),w=e.Cartesian3.cross(M,p,H),a===s?s=w:a===o?o=w:a===c&&(c=w)}else if(2===m){M=s,h?M=o:x&&(M=c);let a=e.Cartesian3.UNIT_Y;a.equalsEpsilon(M,i.CesiumMath.EPSILON3)&&(a=e.Cartesian3.UNIT_X),p=e.Cartesian3.cross(M,a,F),e.Cartesian3.normalize(p,p),w=e.Cartesian3.cross(M,p,H),e.Cartesian3.normalize(w,w),M===s?(o=p,c=w):M===o?(c=p,s=w):M===c&&(s=p,o=w)}else 3===m&&(s=e.Cartesian3.UNIT_X,o=e.Cartesian3.UNIT_Y,c=e.Cartesian3.UNIT_Z);const g=J;g.x=e.Cartesian3.dot(n,s),g.y=e.Cartesian3.dot(n,o),g.z=e.Cartesian3.dot(n,c);let y,b=0;return g.x<-C?(y=g.x+C,b+=y*y):g.x>C&&(y=g.x-C,b+=y*y),g.y<-u?(y=g.y+u,b+=y*y):g.y>u&&(y=g.y-u,b+=y*y),g.z<-l?(y=g.z+l,b+=y*y):g.z>l&&(y=g.z-l,b+=y*y),b};const K=new e.Cartesian3,Q=new e.Cartesian3;o.computePlaneDistances=function(a,r,i,s){n.defined(s)||(s=new t.Interval);let o=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const C=a.center,u=a.halfAxes,l=e.Matrix3.getColumn(u,0,v),d=e.Matrix3.getColumn(u,1,Y),h=e.Matrix3.getColumn(u,2,G),x=e.Cartesian3.add(l,d,K);e.Cartesian3.add(x,h,x),e.Cartesian3.add(x,C,x);const m=e.Cartesian3.subtract(x,r,Q);let f=e.Cartesian3.dot(i,m);return o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.add(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.add(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.add(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),e.Cartesian3.subtract(C,l,x),e.Cartesian3.subtract(x,d,x),e.Cartesian3.subtract(x,h,x),e.Cartesian3.subtract(x,r,m),f=e.Cartesian3.dot(i,m),o=Math.min(f,o),c=Math.max(f,c),s.start=o,s.stop=c,s};const $=new e.Cartesian3,aa=new e.Cartesian3,ta=new e.Cartesian3;o.computeCorners=function(a,t){n.defined(t)||(t=[new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3,new e.Cartesian3]);const r=a.center,i=a.halfAxes,s=e.Matrix3.getColumn(i,0,$),o=e.Matrix3.getColumn(i,1,aa),c=e.Matrix3.getColumn(i,2,ta);return e.Cartesian3.clone(r,t[0]),e.Cartesian3.subtract(t[0],s,t[0]),e.Cartesian3.subtract(t[0],o,t[0]),e.Cartesian3.subtract(t[0],c,t[0]),e.Cartesian3.clone(r,t[1]),e.Cartesian3.subtract(t[1],s,t[1]),e.Cartesian3.subtract(t[1],o,t[1]),e.Cartesian3.add(t[1],c,t[1]),e.Cartesian3.clone(r,t[2]),e.Cartesian3.subtract(t[2],s,t[2]),e.Cartesian3.add(t[2],o,t[2]),e.Cartesian3.subtract(t[2],c,t[2]),e.Cartesian3.clone(r,t[3]),e.Cartesian3.subtract(t[3],s,t[3]),e.Cartesian3.add(t[3],o,t[3]),e.Cartesian3.add(t[3],c,t[3]),e.Cartesian3.clone(r,t[4]),e.Cartesian3.add(t[4],s,t[4]),e.Cartesian3.subtract(t[4],o,t[4]),e.Cartesian3.subtract(t[4],c,t[4]),e.Cartesian3.clone(r,t[5]),e.Cartesian3.add(t[5],s,t[5]),e.Cartesian3.subtract(t[5],o,t[5]),e.Cartesian3.add(t[5],c,t[5]),e.Cartesian3.clone(r,t[6]),e.Cartesian3.add(t[6],s,t[6]),e.Cartesian3.add(t[6],o,t[6]),e.Cartesian3.subtract(t[6],c,t[6]),e.Cartesian3.clone(r,t[7]),e.Cartesian3.add(t[7],s,t[7]),e.Cartesian3.add(t[7],o,t[7]),e.Cartesian3.add(t[7],c,t[7]),t};const ea=new e.Matrix3;o.computeTransformation=function(a,t){n.defined(t)||(t=new e.Matrix4);const r=a.center,i=e.Matrix3.multiplyByUniformScale(a.halfAxes,2,ea);return e.Matrix4.fromRotationTranslation(i,r,t)};const na=new t.BoundingSphere;o.isOccluded=function(a,e){const n=t.BoundingSphere.fromOrientedBoundingBox(a,na);return!e.isBoundingSphereVisible(n)},o.prototype.intersectPlane=function(a){return o.intersectPlane(this,a)},o.prototype.distanceSquaredTo=function(a){return o.distanceSquaredTo(this,a)},o.prototype.computePlaneDistances=function(a,t,e){return o.computePlaneDistances(this,a,t,e)},o.prototype.computeCorners=function(a){return o.computeCorners(this,a)},o.prototype.computeTransformation=function(a){return o.computeTransformation(this,a)},o.prototype.isOccluded=function(a){return o.isOccluded(this,a)},o.equals=function(a,t){return a===t||n.defined(a)&&n.defined(t)&&e.Cartesian3.equals(a.center,t.center)&&e.Matrix3.equals(a.halfAxes,t.halfAxes)},o.prototype.clone=function(a){return o.clone(this,a)},o.prototype.equals=function(a){return o.equals(this,a)},a.OrientedBoundingBox=o})); diff --git a/src/renderer/public/sdk/Cesium/Workers/PolygonGeometryLibrary-a7e9b473.js b/src/renderer/public/sdk/Cesium/Workers/PolygonGeometryLibrary-a7e9b473.js deleted file mode 100644 index 0b1d35e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/PolygonGeometryLibrary-a7e9b473.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./ArcType-24f44850","./arrayRemoveDuplicates-fd3a3f4e","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./EllipsoidRhumbLine-0cc30625","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryPipeline-51ce1008","./IndexDatatype-ceed713e","./PolygonPipeline-f526e04e","./Transforms-7ac1f9ee"],(function(e,t,n,i,o,r,a,s,c,l,u,h,p){"use strict";function f(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(f.prototype,{length:{get:function(){return this._length}}}),f.prototype.enqueue=function(e){this._array.push(e),this._length++},f.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},f.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},f.prototype.contains=function(e){return-1!==this._array.indexOf(e)},f.prototype.clear=function(){this._array.length=this._offset=this._length=0},f.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};const d={computeHierarchyPackedLength:function(e,t){let n=0;const i=[e];for(;i.length>0;){const e=i.pop();if(!r.defined(e))continue;n+=2;const o=e.positions,a=e.holes;if(r.defined(o)&&o.length>0&&(n+=o.length*t.packedLength),r.defined(a)){const e=a.length;for(let t=0;t<e;++t)i.push(a[t])}}return n},packPolygonHierarchy:function(e,t,n,i){const o=[e];for(;o.length>0;){const e=o.pop();if(!r.defined(e))continue;const a=e.positions,s=e.holes;if(t[n++]=r.defined(a)?a.length:0,t[n++]=r.defined(s)?s.length:0,r.defined(a)){const e=a.length;for(let o=0;o<e;++o,n+=i.packedLength)i.pack(a[o],t,n)}if(r.defined(s)){const e=s.length;for(let t=0;t<e;++t)o.push(s[t])}}return n},unpackPolygonHierarchy:function(e,t,n){const i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let o=0;o<i;++o,t+=n.packedLength)r[o]=n.unpack(e,t);for(let i=0;i<o;++i)a[i]=d.unpackPolygonHierarchy(e,t,n),t=a[i].startingIndex,delete a[i].startingIndex;return{positions:r,holes:a,startingIndex:t}}},y=new i.Cartesian2;function g(e,t,n,o){return i.Cartesian2.subtract(t,e,y),i.Cartesian2.multiplyByScalar(y,n/o,y),i.Cartesian2.add(e,y,y),[y.x,y.y]}const m=new i.Cartesian3;function C(e,t,n,o){return i.Cartesian3.subtract(t,e,m),i.Cartesian3.multiplyByScalar(m,n/o,m),i.Cartesian3.add(e,m,m),[m.x,m.y,m.z]}d.subdivideLineCount=function(e,t,n){const r=i.Cartesian3.distance(e,t)/n,a=Math.max(0,Math.ceil(o.CesiumMath.log2(r)));return Math.pow(2,a)};const b=new i.Cartographic,T=new i.Cartographic,x=new i.Cartographic,v=new i.Cartesian3,w=new a.EllipsoidRhumbLine;d.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,b),s=e.cartesianToCartographic(n,T),c=new a.EllipsoidRhumbLine(r,s,e).surfaceDistance/i,l=Math.max(0,Math.ceil(o.CesiumMath.log2(c)));return Math.pow(2,l)},d.subdivideTexcoordLine=function(e,t,n,o,r,a){const s=d.subdivideLineCount(n,o,r),c=i.Cartesian2.distance(e,t),l=c/s,u=a;u.length=2*s;let h=0;for(let n=0;n<s;n++){const i=g(e,t,n*l,c);u[h++]=i[0],u[h++]=i[1]}return u},d.subdivideLine=function(e,t,n,o){const a=d.subdivideLineCount(e,t,n),s=i.Cartesian3.distance(e,t),c=s/a;r.defined(o)||(o=[]);const l=o;l.length=3*a;let u=0;for(let n=0;n<a;n++){const i=C(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1],l[u++]=i[2]}return l},d.subdivideTexcoordRhumbLine=function(e,t,n,r,a,s,c){const l=n.cartesianToCartographic(r,b),u=n.cartesianToCartographic(a,T);w.setEndPoints(l,u);const h=w.surfaceDistance/s,p=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),f=Math.pow(2,p),d=i.Cartesian2.distance(e,t),y=d/f,m=c;m.length=2*f;let C=0;for(let n=0;n<f;n++){const i=g(e,t,n*y,d);m[C++]=i[0],m[C++]=i[1]}return m},d.subdivideRhumbLine=function(e,t,n,i,s){const c=e.cartesianToCartographic(t,b),l=e.cartesianToCartographic(n,T),u=new a.EllipsoidRhumbLine(c,l,e),h=u.surfaceDistance/i,p=Math.max(0,Math.ceil(o.CesiumMath.log2(h))),f=Math.pow(2,p),d=u.surfaceDistance/f;r.defined(s)||(s=[]);const y=s;y.length=3*f;let g=0;for(let t=0;t<f;t++){const n=u.interpolateUsingSurfaceDistance(t*d,x),i=e.cartographicToCartesian(n,v);y[g++]=i.x,y[g++]=i.y,y[g++]=i.z}return y};const A=new i.Cartesian3,L=new i.Cartesian3,E=new i.Cartesian3,I=new i.Cartesian3;d.scaleToGeodeticHeightExtruded=function(e,t,n,o,a){o=r.defaultValue(o,i.Ellipsoid.WGS84);const s=A;let c=L;const l=E;let u=I;if(r.defined(e)&&r.defined(e.attributes)&&r.defined(e.attributes.position)){const r=e.attributes.position.values,h=r.length/2;for(let e=0;e<h;e+=3)i.Cartesian3.fromArray(r,e,l),o.geodeticSurfaceNormal(l,s),u=o.scaleToGeodeticSurface(l,u),c=i.Cartesian3.multiplyByScalar(s,n,c),c=i.Cartesian3.add(u,c,c),r[e+h]=c.x,r[e+1+h]=c.y,r[e+2+h]=c.z,a&&(u=i.Cartesian3.clone(l,u)),c=i.Cartesian3.multiplyByScalar(s,t,c),c=i.Cartesian3.add(u,c,c),r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return e},d.polygonOutlinesFromHierarchy=function(e,t,o){const a=[],s=new f;let c,l,u;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let h=e.positions;if(t)for(u=h.length,c=0;c<u;c++)o.scaleToGeodeticSurface(h[c],h[c]);if(h=n.arrayRemoveDuplicates(h,i.Cartesian3.equalsEpsilon,!0),h.length<3)continue;const p=e.holes?e.holes.length:0;for(c=0;c<p;c++){const h=e.holes[c];let p=h.positions;if(t)for(u=p.length,l=0;l<u;++l)o.scaleToGeodeticSurface(p[l],p[l]);if(p=n.arrayRemoveDuplicates(p,i.Cartesian3.equalsEpsilon,!0),p.length<3)continue;a.push(p);let f=0;for(r.defined(h.holes)&&(f=h.holes.length),l=0;l<f;l++)s.enqueue(h.holes[l])}a.push(h)}return a},d.polygonsFromHierarchy=function(e,t,o,a,s){const c=[],l=[],u=new f;for(u.enqueue(e);0!==u.length;){const e=u.dequeue();let p=e.positions;const f=e.holes;let d,y;if(a)for(y=p.length,d=0;d<y;d++)s.scaleToGeodeticSurface(p[d],p[d]);if(t||(p=n.arrayRemoveDuplicates(p,i.Cartesian3.equalsEpsilon,!0)),p.length<3)continue;let g=o(p);if(!r.defined(g))continue;const m=[];let C=h.PolygonPipeline.computeWindingOrder2D(g);C===h.WindingOrder.CLOCKWISE&&(g.reverse(),p=p.slice().reverse());let b=p.slice();const T=r.defined(f)?f.length:0,x=[];let v;for(d=0;d<T;d++){const e=f[d];let c=e.positions;if(a)for(y=c.length,v=0;v<y;++v)s.scaleToGeodeticSurface(c[v],c[v]);if(t||(c=n.arrayRemoveDuplicates(c,i.Cartesian3.equalsEpsilon,!0)),c.length<3)continue;const l=o(c);if(!r.defined(l))continue;C=h.PolygonPipeline.computeWindingOrder2D(l),C===h.WindingOrder.CLOCKWISE&&(l.reverse(),c=c.slice().reverse()),x.push(c),m.push(b.length),b=b.concat(c),g=g.concat(l);let p=0;for(r.defined(e.holes)&&(p=e.holes.length),v=0;v<p;v++)u.enqueue(e.holes[v])}c.push({outerRing:p,holes:x}),l.push({positions:b,positions2D:g,holes:m})}return{hierarchy:c,polygons:l}};const P=new i.Cartesian2,D=new i.Cartesian3,M=new p.Quaternion,_=new i.Matrix3;d.computeBoundingRectangle=function(e,t,n,o,a){const s=p.Quaternion.fromAxisAngle(e,o,M),c=i.Matrix3.fromQuaternion(s,_);let l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const o=i.Cartesian3.clone(n[e],D);i.Matrix3.multiplyByVector(c,o,o);const a=t(o,P);r.defined(a)&&(l=Math.min(l,a.x),u=Math.max(u,a.x),h=Math.min(h,a.y),f=Math.max(f,a.y))}return a.x=l,a.y=h,a.width=u-l,a.height=f-h,a},d.createGeometryFromPositions=function(e,n,a,c,u,p,f){let d=h.PolygonPipeline.triangulate(n.positions2D,n.holes);d.length<3&&(d=[0,1,2]);const y=n.positions,g=r.defined(a),m=g?a.positions:void 0;if(u){const e=y.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=y[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const r={attributes:{position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t})},indices:d,primitiveType:s.PrimitiveType.TRIANGLES};g&&(r.attributes.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i.Cartesian2.packArray(m)}));const a=new s.Geometry(r);return p.normal?l.GeometryPipeline.computeNormal(a):a}return f===t.ArcType.GEODESIC?h.PolygonPipeline.computeSubdivision(e,y,d,m,c):f===t.ArcType.RHUMB?h.PolygonPipeline.computeRhumbLineSubdivision(e,y,d,m,c):void 0};const G=[],S=[],R=new i.Cartesian3,N=new i.Cartesian3;d.computeWallGeometry=function(e,n,a,l,h,p){let f,y,g,m,C,b,T,x,v,w=e.length,A=0,L=0;const E=r.defined(n),I=E?n.positions:void 0;if(h)for(y=3*w*2,f=new Array(2*y),E&&(v=2*w*2,x=new Array(2*v)),g=0;g<w;g++)m=e[g],C=e[(g+1)%w],f[A]=f[A+y]=m.x,++A,f[A]=f[A+y]=m.y,++A,f[A]=f[A+y]=m.z,++A,f[A]=f[A+y]=C.x,++A,f[A]=f[A+y]=C.y,++A,f[A]=f[A+y]=C.z,++A,E&&(b=I[g],T=I[(g+1)%w],x[L]=x[L+v]=b.x,++L,x[L]=x[L+v]=b.y,++L,x[L]=x[L+v]=T.x,++L,x[L]=x[L+v]=T.y,++L);else{const n=o.CesiumMath.chordLength(l,a.maximumRadius);let i=0;if(p===t.ArcType.GEODESIC)for(g=0;g<w;g++)i+=d.subdivideLineCount(e[g],e[(g+1)%w],n);else if(p===t.ArcType.RHUMB)for(g=0;g<w;g++)i+=d.subdivideRhumbLineCount(a,e[g],e[(g+1)%w],n);for(y=3*(i+w),f=new Array(2*y),E&&(v=2*(i+w),x=new Array(2*v)),g=0;g<w;g++){let i,o;m=e[g],C=e[(g+1)%w],E&&(b=I[g],T=I[(g+1)%w]),p===t.ArcType.GEODESIC?(i=d.subdivideLine(m,C,n,S),E&&(o=d.subdivideTexcoordLine(b,T,m,C,n,G))):p===t.ArcType.RHUMB&&(i=d.subdivideRhumbLine(a,m,C,n,S),E&&(o=d.subdivideTexcoordRhumbLine(b,T,a,m,C,n,G)));const r=i.length;for(let e=0;e<r;++e,++A)f[A]=i[e],f[A+y]=i[e];if(f[A]=C.x,f[A+y]=C.x,++A,f[A]=C.y,f[A+y]=C.y,++A,f[A]=C.z,f[A+y]=C.z,++A,E){const e=o.length;for(let t=0;t<e;++t,++L)x[L]=o[t],x[L+v]=o[t];x[L]=T.x,x[L+v]=T.x,++L,x[L]=T.y,x[L+v]=T.y,++L}}}w=f.length;const P=u.IndexDatatype.createTypedArray(w/3,w-6*e.length);let D=0;for(w/=6,g=0;g<w;g++){const e=g,t=e+1,n=e+w,r=n+1;m=i.Cartesian3.fromArray(f,3*e,R),C=i.Cartesian3.fromArray(f,3*t,N),i.Cartesian3.equalsEpsilon(m,C,o.CesiumMath.EPSILON10,o.CesiumMath.EPSILON10)||(P[D++]=e,P[D++]=n,P[D++]=t,P[D++]=t,P[D++]=n,P[D++]=r)}const M={attributes:new c.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})}),indices:P,primitiveType:s.PrimitiveType.TRIANGLES};E&&(M.attributes.st=new s.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:x}));return new s.Geometry(M)};var O=d;e.PolygonGeometryLibrary=O})); diff --git a/src/renderer/public/sdk/Cesium/Workers/PolygonPipeline-f526e04e.js b/src/renderer/public/sdk/Cesium/Workers/PolygonPipeline-f526e04e.js deleted file mode 100644 index 71d89a4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/PolygonPipeline-f526e04e.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./EllipsoidRhumbLine-0cc30625","./GeometryAttribute-10955f8d","./WebGLConstants-58abc51a"],(function(e,t,n,r,a,i,o){"use strict";var s={exports:{}};function u(e,t,n){n=n||2;var r,a,i,o,s,u,p,h=t&&t.length,y=h?t[0]*n:e.length,c=x(e,0,y,n,!0),f=[];if(!c||c.next===c.prev)return f;if(h&&(c=function(e,t,n,r){var a,i,o,s=[];for(a=0,i=t.length;a<i;a++)(o=x(e,t[a]*r,a<i-1?t[a+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(g(o));for(s.sort(v),a=0;a<s.length;a++)n=d(s[a],n);return n}(e,t,c,n)),e.length>80*n){r=i=e[0],a=o=e[1];for(var m=n;m<y;m+=n)(s=e[m])<r&&(r=s),(u=e[m+1])<a&&(a=u),s>i&&(i=s),u>o&&(o=u);p=0!==(p=Math.max(i-r,o-a))?32767/p:0}return l(c,f,n,r,a,p,0),f}function x(e,t,n,r,a){var i,o;if(a===O(e,t,n,r)>0)for(i=t;i<n;i+=r)o=D(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=D(i,e[i],e[i+1],o);return o&&S(o,o.next)&&(R(o),o=o.next),o}function p(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(R(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function l(e,t,n,r,a,i,o){if(e){!o&&i&&function(e,t,n,r){var a=e;do{0===a.z&&(a.z=C(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,o,s,u,x=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,x*=2}while(o>1)}(a)}(e,r,a,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?y(e,r,a,i):h(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),R(e),e=u.next,x=u.next;else if((e=u)===x){o?1===o?l(e=c(p(e),t,n),t,n,r,a,i,2):2===o&&f(e,t,n,r,a,i):l(p(e),t,n,r,a,i,1);break}}}function h(e){var t=e.prev,n=e,r=e.next;if(b(t,n,r)>=0)return!1;for(var a=t.x,i=n.x,o=r.x,s=t.y,u=n.y,x=r.y,p=a<i?a<o?a:o:i<o?i:o,l=s<u?s<x?s:x:u<x?u:x,h=a>i?a>o?a:o:i>o?i:o,y=s>u?s>x?s:x:u>x?u:x,c=r.next;c!==t;){if(c.x>=p&&c.x<=h&&c.y>=l&&c.y<=y&&w(a,s,i,u,o,x,c.x,c.y)&&b(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function y(e,t,n,r){var a=e.prev,i=e,o=e.next;if(b(a,i,o)>=0)return!1;for(var s=a.x,u=i.x,x=o.x,p=a.y,l=i.y,h=o.y,y=s<u?s<x?s:x:u<x?u:x,c=p<l?p<h?p:h:l<h?l:h,f=s>u?s>x?s:x:u>x?u:x,v=p>l?p>h?p:h:l>h?l:h,d=C(y,c,t,n,r),m=C(f,v,t,n,r),g=e.prevZ,A=e.nextZ;g&&g.z>=d&&A&&A.z<=m;){if(g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&w(s,p,u,l,x,h,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,A.x>=y&&A.x<=f&&A.y>=c&&A.y<=v&&A!==a&&A!==o&&w(s,p,u,l,x,h,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;g&&g.z>=d;){if(g.x>=y&&g.x<=f&&g.y>=c&&g.y<=v&&g!==a&&g!==o&&w(s,p,u,l,x,h,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;A&&A.z<=m;){if(A.x>=y&&A.x<=f&&A.y>=c&&A.y<=v&&A!==a&&A!==o&&w(s,p,u,l,x,h,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!S(a,i)&&E(a,r,r.next,i)&&z(a,i)&&z(i,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),R(r),R(r.next),r=e=i),r=r.next}while(r!==e);return p(r)}function f(e,t,n,r,a,i){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&A(o,s)){var u=L(o,s);return o=p(o,o.next),u=p(u,u.next),l(o,t,n,r,a,i,0),void l(u,t,n,r,a,i,0)}s=s.next}o=o.next}while(o!==e)}function v(e,t){return e.x-t.x}function d(e,t){var n=function(e,t){var n,r=t,a=e.x,i=e.y,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=a&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===a))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,p=n.x,l=n.y,h=1/0;r=n;do{a>=r.x&&r.x>=p&&a!==r.x&&w(i<l?a:o,i,p,l,i<l?o:a,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(a-r.x),z(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&m(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=L(n,e);return p(r,r.next),p(n,n.next)}function m(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function C(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*a|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function g(e){var 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 w(e,t,n,r,a,i,o,s){return(a-o)*(t-s)>=(e-o)*(i-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(i-s)>=(a-o)*(r-s)}function A(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&E(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(z(e,t)&&z(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function E(e,t,n,r){var a=Z(b(e,t,n)),i=Z(b(e,t,r)),o=Z(b(n,r,e)),s=Z(b(n,r,t));return a!==i&&o!==s||(!(0!==a||!M(e,n,t))||(!(0!==i||!M(e,r,t))||(!(0!==o||!M(n,e,r))||!(0!==s||!M(n,t,r)))))}function M(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 Z(e){return e>0?1:e<0?-1:0}function z(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function L(e,t){var n=new G(e.i,e.x,e.y),r=new G(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function D(e,t,n,r){var a=new G(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function R(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 G(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}s.exports=u,s.exports.default=u,u.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(O(e,0,i,n));if(a)for(var s=0,u=t.length;s<u;s++){var x=t[s]*n,p=s<u-1?t[s+1]*n:e.length;o-=Math.abs(O(e,x,p,n))}var l=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,y=r[s+1]*n,c=r[s+2]*n;l+=Math.abs((e[h]-e[c])*(e[y+1]-e[h+1])-(e[h]-e[y])*(e[c+1]-e[h+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},u.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n};const T={CLOCKWISE:o.WebGLConstants.CW,COUNTER_CLOCKWISE:o.WebGLConstants.CCW,validate:function(e){return e===T.CLOCKWISE||e===T.COUNTER_CLOCKWISE}};var B=Object.freeze(T);const W=new t.Cartesian3,P=new t.Cartesian3,$={computeArea2D:function(e){const t=e.length;let n=0;for(let r=t-1,a=0;a<t;r=a++){const t=e[r],i=e[a];n+=t.x*i.y-i.x*t.y}return.5*n},computeWindingOrder2D:function(e){return $.computeArea2D(e)>0?B.COUNTER_CLOCKWISE:B.CLOCKWISE},triangulate:function(e,n){const r=t.Cartesian2.packArray(e);return s.exports(r,n,2)}},I=new t.Cartesian3,N=new t.Cartesian3,U=new t.Cartesian3,_=new t.Cartesian3,K=new t.Cartesian3,V=new t.Cartesian3,F=new t.Cartesian3,k=new t.Cartesian2,q=new t.Cartesian2,j=new t.Cartesian2,H=new t.Cartesian2;$.computeSubdivision=function(e,a,o,s,u){u=r.defaultValue(u,n.CesiumMath.RADIANS_PER_DEGREE);const x=r.defined(s),p=o.slice(0);let l;const h=a.length,y=new Array(3*h),c=new Array(2*h);let f=0,v=0;for(l=0;l<h;l++){const e=a[l];if(y[f++]=e.x,y[f++]=e.y,y[f++]=e.z,x){const e=s[l];c[v++]=e.x,c[v++]=e.y}}const d=[],m={},C=e.maximumRadius,g=n.CesiumMath.chordLength(u,C),w=g*g;for(;p.length>0;){const e=p.pop(),n=p.pop(),a=p.pop(),i=t.Cartesian3.fromArray(y,3*a,I),o=t.Cartesian3.fromArray(y,3*n,N),s=t.Cartesian3.fromArray(y,3*e,U);let u,h,f;x&&(u=t.Cartesian2.fromArray(c,2*a,k),h=t.Cartesian2.fromArray(c,2*n,q),f=t.Cartesian2.fromArray(c,2*e,j));const v=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(i,_),C,_),g=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(o,K),C,K),A=t.Cartesian3.multiplyByScalar(t.Cartesian3.normalize(s,V),C,V),b=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(v,g,F)),S=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(g,A,F)),E=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(A,v,F)),M=Math.max(b,S,E);let Z,z,L;M>w?b===M?(Z=`${Math.min(a,n)} ${Math.max(a,n)}`,l=m[Z],r.defined(l)||(z=t.Cartesian3.add(i,o,F),t.Cartesian3.multiplyByScalar(z,.5,z),y.push(z.x,z.y,z.z),l=y.length/3-1,m[Z]=l,x&&(L=t.Cartesian2.add(u,h,H),t.Cartesian2.multiplyByScalar(L,.5,L),c.push(L.x,L.y))),p.push(a,l,e),p.push(l,n,e)):S===M?(Z=`${Math.min(n,e)} ${Math.max(n,e)}`,l=m[Z],r.defined(l)||(z=t.Cartesian3.add(o,s,F),t.Cartesian3.multiplyByScalar(z,.5,z),y.push(z.x,z.y,z.z),l=y.length/3-1,m[Z]=l,x&&(L=t.Cartesian2.add(h,f,H),t.Cartesian2.multiplyByScalar(L,.5,L),c.push(L.x,L.y))),p.push(n,l,a),p.push(l,e,a)):E===M&&(Z=`${Math.min(e,a)} ${Math.max(e,a)}`,l=m[Z],r.defined(l)||(z=t.Cartesian3.add(s,i,F),t.Cartesian3.multiplyByScalar(z,.5,z),y.push(z.x,z.y,z.z),l=y.length/3-1,m[Z]=l,x&&(L=t.Cartesian2.add(f,u,H),t.Cartesian2.multiplyByScalar(L,.5,L),c.push(L.x,L.y))),p.push(e,l,n),p.push(l,a,n)):(d.push(a),d.push(n),d.push(e))}const A={attributes:{position:new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y})},indices:d,primitiveType:i.PrimitiveType.TRIANGLES};return x&&(A.attributes.st=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:c})),new i.Geometry(A)};const J=new t.Cartographic,Q=new t.Cartographic,X=new t.Cartographic,Y=new t.Cartographic;$.computeRhumbLineSubdivision=function(e,o,s,u,x){x=r.defaultValue(x,n.CesiumMath.RADIANS_PER_DEGREE);const p=r.defined(u),l=s.slice(0);let h;const y=o.length,c=new Array(3*y),f=new Array(2*y);let v=0,d=0;for(h=0;h<y;h++){const e=o[h];if(c[v++]=e.x,c[v++]=e.y,c[v++]=e.z,p){const e=u[h];f[d++]=e.x,f[d++]=e.y}}const m=[],C={},g=e.maximumRadius,w=n.CesiumMath.chordLength(x,g),A=new a.EllipsoidRhumbLine(void 0,void 0,e),b=new a.EllipsoidRhumbLine(void 0,void 0,e),S=new a.EllipsoidRhumbLine(void 0,void 0,e);for(;l.length>0;){const n=l.pop(),a=l.pop(),i=l.pop(),o=t.Cartesian3.fromArray(c,3*i,I),s=t.Cartesian3.fromArray(c,3*a,N),u=t.Cartesian3.fromArray(c,3*n,U);let x,y,v;p&&(x=t.Cartesian2.fromArray(f,2*i,k),y=t.Cartesian2.fromArray(f,2*a,q),v=t.Cartesian2.fromArray(f,2*n,j));const d=e.cartesianToCartographic(o,J),g=e.cartesianToCartographic(s,Q),E=e.cartesianToCartographic(u,X);A.setEndPoints(d,g);const M=A.surfaceDistance;b.setEndPoints(g,E);const Z=b.surfaceDistance;S.setEndPoints(E,d);const z=S.surfaceDistance,L=Math.max(M,Z,z);let D,R,G,O,T;L>w?M===L?(D=`${Math.min(i,a)} ${Math.max(i,a)}`,h=C[D],r.defined(h)||(R=A.interpolateUsingFraction(.5,Y),G=.5*(d.height+g.height),O=t.Cartesian3.fromRadians(R.longitude,R.latitude,G,e,F),c.push(O.x,O.y,O.z),h=c.length/3-1,C[D]=h,p&&(T=t.Cartesian2.add(x,y,H),t.Cartesian2.multiplyByScalar(T,.5,T),f.push(T.x,T.y))),l.push(i,h,n),l.push(h,a,n)):Z===L?(D=`${Math.min(a,n)} ${Math.max(a,n)}`,h=C[D],r.defined(h)||(R=b.interpolateUsingFraction(.5,Y),G=.5*(g.height+E.height),O=t.Cartesian3.fromRadians(R.longitude,R.latitude,G,e,F),c.push(O.x,O.y,O.z),h=c.length/3-1,C[D]=h,p&&(T=t.Cartesian2.add(y,v,H),t.Cartesian2.multiplyByScalar(T,.5,T),f.push(T.x,T.y))),l.push(a,h,i),l.push(h,n,i)):z===L&&(D=`${Math.min(n,i)} ${Math.max(n,i)}`,h=C[D],r.defined(h)||(R=S.interpolateUsingFraction(.5,Y),G=.5*(E.height+d.height),O=t.Cartesian3.fromRadians(R.longitude,R.latitude,G,e,F),c.push(O.x,O.y,O.z),h=c.length/3-1,C[D]=h,p&&(T=t.Cartesian2.add(v,x,H),t.Cartesian2.multiplyByScalar(T,.5,T),f.push(T.x,T.y))),l.push(n,h,a),l.push(h,i,a)):(m.push(i),m.push(a),m.push(n))}const E={attributes:{position:new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})},indices:m,primitiveType:i.PrimitiveType.TRIANGLES};return p&&(E.attributes.st=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),new i.Geometry(E)},$.scaleToGeodeticHeight=function(e,n,a,i){a=r.defaultValue(a,t.Ellipsoid.WGS84);let o=W,s=P;if(n=r.defaultValue(n,0),i=r.defaultValue(i,!0),r.defined(e)){const r=e.length;for(let u=0;u<r;u+=3)t.Cartesian3.fromArray(e,u,s),i&&(s=a.scaleToGeodeticSurface(s,s)),0!==n&&(o=a.geodeticSurfaceNormal(s,o),t.Cartesian3.multiplyByScalar(o,n,o),t.Cartesian3.add(s,o,s)),e[u]=s.x,e[u+1]=s.y,e[u+2]=s.z}return e};var ee=$;e.PolygonPipeline=ee,e.WindingOrder=B})); diff --git a/src/renderer/public/sdk/Cesium/Workers/PolylinePipeline-b69fdb1d.js b/src/renderer/public/sdk/Cesium/Workers/PolylinePipeline-b69fdb1d.js deleted file mode 100644 index eef178d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/PolylinePipeline-b69fdb1d.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./EllipsoidGeodesic-759beff8","./EllipsoidRhumbLine-0cc30625","./IntersectionTests-e2577c22","./ComponentDatatype-9b23164a","./Plane-b9f0711b"],(function(e,t,a,n,i,r,o,s){"use strict";const c={numberOfPoints:function(e,a,n){const i=t.Cartesian3.distance(e,a);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,a){const n=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(a*a))))}},l=new t.Cartographic;c.extractHeights=function(e,t){const a=e.length,n=new Array(a);for(let i=0;i<a;i++){const a=e[i];n[i]=t.cartesianToCartographic(a,l).height}return n};const u=new t.Matrix4,h=new t.Cartesian3,f=new t.Cartesian3,g=new s.Plane(t.Cartesian3.UNIT_X,0),C=new t.Cartesian3,p=new s.Plane(t.Cartesian3.UNIT_X,0),d=new t.Cartesian3,m=new t.Cartesian3,w=[];function P(e,t,a){const n=w;let i;if(n.length=e,t===a){for(i=0;i<e;i++)n[i]=t;return n}const r=(a-t)/e;for(i=0;i<e;i++){const e=t+i*r;n[i]=e}return n}const T=new t.Cartographic,y=new t.Cartographic,A=new t.Cartesian3,b=new t.Cartesian3,E=new t.Cartesian3,R=new n.EllipsoidGeodesic;let M=new i.EllipsoidRhumbLine;function S(e,a,n,i,r,o,s,l){const u=i.scaleToGeodeticSurface(e,b),h=i.scaleToGeodeticSurface(a,E),f=c.numberOfPoints(e,a,n),g=i.cartesianToCartographic(u,T),C=i.cartesianToCartographic(h,y),p=P(f,r,o);R.setEndPoints(g,C);const d=R.surfaceDistance/f;let m=l;g.height=r;let w=i.cartographicToCartesian(g,A);t.Cartesian3.pack(w,s,m),m+=3;for(let e=1;e<f;e++){const a=R.interpolateUsingSurfaceDistance(e*d,y);a.height=p[e],w=i.cartographicToCartesian(a,A),t.Cartesian3.pack(w,s,m),m+=3}return m}function D(e,a,n,r,o,s,l,u){const h=r.cartesianToCartographic(e,T),f=r.cartesianToCartographic(a,y),g=c.numberOfPointsRhumbLine(h,f,n);h.height=0,f.height=0;const C=P(g,o,s);M.ellipsoid.equals(r)||(M=new i.EllipsoidRhumbLine(void 0,void 0,r)),M.setEndPoints(h,f);const p=M.surfaceDistance/g;let d=u;h.height=o;let m=r.cartographicToCartesian(h,A);t.Cartesian3.pack(m,l,d),d+=3;for(let e=1;e<g;e++){const a=M.interpolateUsingSurfaceDistance(e*p,y);a.height=C[e],m=r.cartographicToCartesian(a,A),t.Cartesian3.pack(m,l,d),d+=3}return d}c.wrapLongitude=function(e,n){const i=[],o=[];if(a.defined(e)&&e.length>0){n=a.defaultValue(n,t.Matrix4.IDENTITY);const c=t.Matrix4.inverseTransformation(n,u),l=t.Matrix4.multiplyByPoint(c,t.Cartesian3.ZERO,h),w=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(c,t.Cartesian3.UNIT_Y,f),f),P=s.Plane.fromPointNormal(l,w,g),T=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(c,t.Cartesian3.UNIT_X,C),C),y=s.Plane.fromPointNormal(l,T,p);let A=1;i.push(t.Cartesian3.clone(e[0]));let b=i[0];const E=e.length;for(let n=1;n<E;++n){const c=e[n];if(s.Plane.getPointDistance(y,b)<0||s.Plane.getPointDistance(y,c)<0){const e=r.IntersectionTests.lineSegmentPlane(b,c,P,d);if(a.defined(e)){const a=t.Cartesian3.multiplyByScalar(w,5e-9,m);s.Plane.getPointDistance(P,b)<0&&t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),o.push(A+1),t.Cartesian3.negate(a,a),i.push(t.Cartesian3.add(e,a,new t.Cartesian3)),A=1}}i.push(t.Cartesian3.clone(e[n])),A++,b=c}o.push(A)}return{positions:i,lengths:o}},c.generateArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const l=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],b);if(s=l?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}let u=e.minDistance;if(!a.defined(u)){const t=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);u=o.CesiumMath.chordLength(t,r.maximumRadius)}let h,f=0;for(h=0;h<i-1;h++)f+=c.numberOfPoints(n[h],n[h+1],u);const g=3*(f+1),C=new Array(g);let p=0;for(h=0;h<i-1;h++){p=S(n[h],n[h+1],u,r,l?s[h]:s,l?s[h+1]:s,C,p)}w.length=0;const d=n[i-1],m=r.cartesianToCartographic(d,T);m.height=l?s[i-1]:s;const P=r.cartographicToCartesian(m,A);return t.Cartesian3.pack(P,C,g-3),C};const x=new t.Cartographic,N=new t.Cartographic;c.generateRhumbArc=function(e){a.defined(e)||(e={});const n=e.positions,i=n.length,r=a.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);let s=a.defaultValue(e.height,0);const l=Array.isArray(s);if(i<1)return[];if(1===i){const e=r.scaleToGeodeticSurface(n[0],b);if(s=l?s[0]:s,0!==s){const a=r.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(a,s,a),t.Cartesian3.add(e,a,e)}return[e.x,e.y,e.z]}const u=a.defaultValue(e.granularity,o.CesiumMath.RADIANS_PER_DEGREE);let h,f,g=0,C=r.cartesianToCartographic(n[0],x);for(h=0;h<i-1;h++)f=r.cartesianToCartographic(n[h+1],N),g+=c.numberOfPointsRhumbLine(C,f,u),C=t.Cartographic.clone(f,x);const p=3*(g+1),d=new Array(p);let m=0;for(h=0;h<i-1;h++){m=D(n[h],n[h+1],u,r,l?s[h]:s,l?s[h+1]:s,d,m)}w.length=0;const P=n[i-1],y=r.cartesianToCartographic(P,T);y.height=l?s[i-1]:s;const E=r.cartographicToCartesian(y,A);return t.Cartesian3.pack(E,d,p-3),d},c.generateCartesianArc=function(e){const a=c.generateArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i},c.generateCartesianRhumbArc=function(e){const a=c.generateRhumbArc(e),n=a.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=t.Cartesian3.unpack(a,3*e);return i};var G=c;e.PolylinePipeline=G})); diff --git a/src/renderer/public/sdk/Cesium/Workers/PolylineVolumeGeometryLibrary-29c95f7f.js b/src/renderer/public/sdk/Cesium/Workers/PolylineVolumeGeometryLibrary-29c95f7f.js deleted file mode 100644 index 682160c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/PolylineVolumeGeometryLibrary-29c95f7f.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./EllipsoidTangentPlane-a3de5387","./ComponentDatatype-9b23164a","./PolylinePipeline-b69fdb1d","./Transforms-7ac1f9ee","./defaultValue-50f7432c"],(function(e,a,t,n,r,i,s){"use strict";var o=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});const l={};function c(e,a){s.defined(l[e])||(l[e]=!0,console.warn(s.defaultValue(a,e)))}c.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.",c.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",c.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",c.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";const C=[new a.Cartesian3,new a.Cartesian3],u=new a.Cartesian3,d=new a.Cartesian3,g=new a.Cartesian3,y=new a.Cartesian3,f=new a.Cartesian3,m=new a.Cartesian3,h=new a.Cartesian3,p=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3,E=new a.Cartesian3,P={};let b=new a.Cartographic;function M(e,t,n,r){const i=e[0],s=e[1],o=a.Cartesian3.angleBetween(i,s),l=Math.ceil(o/r),c=new Array(l);let C;if(t===n){for(C=0;C<l;C++)c[C]=t;return c.push(n),c}const u=(n-t)/l;for(C=1;C<l;C++){const e=t+C*u;c[C]=e}return c[0]=t,c.push(n),c}const T=new a.Cartesian3,B=new a.Cartesian3;const z=new a.Cartesian3(-1,0,0);let S=new a.Matrix4;const A=new a.Matrix4;let D=new a.Matrix3;const R=a.Matrix3.IDENTITY.clone(),O=new a.Cartesian3,V=new a.Cartesian4,I=new a.Cartesian3;function v(e,n,r,s,o,l,c,C){let u=O,d=V;S=i.Transforms.eastNorthUpToFixedFrame(e,o,S),u=a.Matrix4.multiplyByPointAsVector(S,z,u),u=a.Cartesian3.normalize(u,u);const g=function(e,n,r,i){const s=new t.EllipsoidTangentPlane(r,i),o=s.projectPointOntoPlane(a.Cartesian3.add(r,e,T),T),l=s.projectPointOntoPlane(a.Cartesian3.add(r,n,B),B),c=a.Cartesian2.angleBetween(o,l);return l.x*o.y-l.y*o.x>=0?-c:c}(u,n,e,o);D=a.Matrix3.fromRotationZ(g,D),I.z=l,S=a.Matrix4.multiplyTransformation(S,a.Matrix4.fromRotationTranslation(D,I,A),S);const y=R;y[0]=c;for(let e=0;e<C;e++)for(let e=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(S,d,d),s.push(d.x,d.y,d.z);return s}const N=new a.Cartesian3;function G(e,t,n,r,i,s,o){for(let l=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,N),t,n,r,i,s[l/3],o,1)}return r}function H(e,a){const t=e.length,n=new Array(3*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;for(let a=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-s;return n}const L=new i.Quaternion,j=new a.Cartesian3,Q=new a.Matrix3;function q(e,t,r,s,l,c,C,u,d,g){const y=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,x),a.Cartesian3.subtract(r,e,E)),f=s===o.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));let m,h,p;if(m=l?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,x),y/(f+1),L),Q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(f+1),L),Q),t=a.Cartesian3.clone(t,j),f>0){const n=g?2:1;for(let r=0;r<f;r++)t=a.Matrix3.multiplyByVector(m,t,t),h=a.Cartesian3.subtract(t,e,x),h=a.Cartesian3.normalize(h,h),l||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(t,E),C=v(p,h,u,C,c,d,1,n)}else h=a.Cartesian3.subtract(t,e,x),h=a.Cartesian3.normalize(h,h),l||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(t,E),C=v(p,h,u,C,c,d,1,1),r=a.Cartesian3.clone(r,j),h=a.Cartesian3.subtract(r,e,x),h=a.Cartesian3.normalize(h,h),l||(h=a.Cartesian3.negate(h,h)),p=c.scaleToGeodeticSurface(r,E),C=v(p,h,u,C,c,d,1,1);return C}P.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let r=t-1,i=0;i<t;r=i++){const t=e[r],s=e[i];a.Cartesian2.equals(t,s)||n.push(s)}return n},P.angleIsGreaterThanPi=function(e,n,r,i){const s=new t.EllipsoidTangentPlane(r,i),o=s.projectPointOntoPlane(a.Cartesian3.add(r,e,T),T),l=s.projectPointOntoPlane(a.Cartesian3.add(r,n,B),B);return l.x*o.y-l.y*o.x>=0};const F=new a.Cartesian3,U=new a.Cartesian3;P.computePositions=function(e,t,i,s,l){const E=s._ellipsoid,T=function(e,a){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];b=a.cartesianToCartographic(r,b),t[n]=b.height,e[n]=a.scaleToGeodeticSurface(r,r)}return t}(e,E),B=s._granularity,z=s._cornerType,S=l?function(e,a){const t=e.length,n=new Array(6*t);let r=0;const i=a.x+a.width/2,s=a.y+a.height/2;let o=e[0];n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s;for(let a=1;a<t;a++){o=e[a];const t=o.x-i,l=o.y-s;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}return o=e[0],n[r++]=o.x-i,n[r++]=0,n[r++]=o.y-s,n}(t,i):H(t,i),A=l?H(t,i):void 0,D=i.height/2,R=i.width/2;let O=e.length,V=[],I=l?[]:void 0,N=u,L=d,j=g,Q=y,_=f,Z=m,W=h,Y=p,k=w,J=e[0],K=e[1];Q=E.geodeticSurfaceNormal(J,Q),N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y);let X,$,ee=T[0],ae=T[1];l&&(I=v(J,Y,A,I,E,ee+D,1,1)),k=a.Cartesian3.clone(J,k),J=K,L=a.Cartesian3.negate(N,L);for(let t=1;t<O-1;t++){const i=l?2:1;if(K=e[t+1],J.equals(K)){c("Positions are too close and are considered equivalent with rounding error.");continue}N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),j=a.Cartesian3.add(N,L,j),j=a.Cartesian3.normalize(j,j),Q=E.geodeticSurfaceNormal(J,Q);const s=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(N,Q),F);a.Cartesian3.subtract(N,s,s),a.Cartesian3.normalize(s,s);const u=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(L,Q),U);a.Cartesian3.subtract(L,u,u),a.Cartesian3.normalize(u,u);if(!n.CesiumMath.equalsEpsilon(Math.abs(a.Cartesian3.dot(s,u)),1,n.CesiumMath.EPSILON7)){j=a.Cartesian3.cross(j,Q,j),j=a.Cartesian3.cross(Q,j,j),j=a.Cartesian3.normalize(j,j);const e=1/Math.max(.25,a.Cartesian3.magnitude(a.Cartesian3.cross(j,L,x))),t=P.angleIsGreaterThanPi(N,L,J,E);t?(_=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),_),Z=a.Cartesian3.add(_,a.Cartesian3.multiplyByScalar(Y,R,Z),Z),C[0]=a.Cartesian3.clone(k,C[0]),C[1]=a.Cartesian3.clone(Z,C[1]),X=M(C,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:C,granularity:B,ellipsoid:E}),V=G($,Y,S,V,E,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(_,a.Cartesian3.multiplyByScalar(Y,R,W),W),z===o.ROUNDED||z===o.BEVELED?q(_,Z,W,z,t,E,V,S,ae+D,l):(j=a.Cartesian3.negate(j,j),V=v(J,j,S,V,E,ae+D,e,i)),k=a.Cartesian3.clone(W,k)):(_=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),_),Z=a.Cartesian3.add(_,a.Cartesian3.multiplyByScalar(Y,-R,Z),Z),C[0]=a.Cartesian3.clone(k,C[0]),C[1]=a.Cartesian3.clone(Z,C[1]),X=M(C,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:C,granularity:B,ellipsoid:E}),V=G($,Y,S,V,E,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(_,a.Cartesian3.multiplyByScalar(Y,-R,W),W),z===o.ROUNDED||z===o.BEVELED?q(_,Z,W,z,t,E,V,S,ae+D,l):V=v(J,j,S,V,E,ae+D,e,i),k=a.Cartesian3.clone(W,k)),L=a.Cartesian3.negate(N,L)}else V=v(k,Y,S,V,E,ee+D,1,1),k=J;ee=ae,ae=T[t+1],J=K}C[0]=a.Cartesian3.clone(k,C[0]),C[1]=a.Cartesian3.clone(J,C[1]),X=M(C,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:C,granularity:B,ellipsoid:E}),V=G($,Y,S,V,E,X,1),l&&(I=v(J,Y,A,I,E,ae+D,1,1)),O=V.length;const te=l?O+I.length:O,ne=new Float64Array(te);return ne.set(V),l&&ne.set(I,O),ne};var _=P;e.CornerType=o,e.PolylineVolumeGeometryLibrary=_,e.oneTimeWarning=c})); diff --git a/src/renderer/public/sdk/Cesium/Workers/PrimitivePipeline-9246e734.js b/src/renderer/public/sdk/Cesium/Workers/PrimitivePipeline-9246e734.js deleted file mode 100644 index 7dd076e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/PrimitivePipeline-9246e734.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./Matrix2-cf4c6e69","./GeometryAttribute-10955f8d","./GeometryAttributes-8bab1b25","./GeometryPipeline-51ce1008","./IndexDatatype-ceed713e","./WebMercatorProjection-019b6547"],(function(e,t,n,r,o,i,s,c,a,d){"use strict";function p(e,t,n){e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,0),this.value=new Float32Array([e,t,n])}function u(e,t){const r=e.attributes,o=r.position,s=o.values.length/o.componentsPerAttribute;r.batchId=new i.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(s)});const c=r.batchId.values;for(let e=0;e<s;++e)c[e]=t}function f(e){const i=e.instances,s=e.projection,a=e.elementIndexUintSupported,d=e.scene3DOnly,p=e.vertexCacheOptimize,f=e.compressVertices,l=e.modelMatrix;let m,h,g=i.length;for(m=0;m<g;++m)if(r.defined(i[m].geometry)){i[m].geometry.primitiveType;break}if(function(e,t,n){let i=!n;const s=e.length;let a;if(!i&&s>1){const t=e[0].modelMatrix;for(a=1;a<s;++a)if(!o.Matrix4.equals(t,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<s;++a)r.defined(e[a].geometry)&&c.GeometryPipeline.transformToWorldCoordinates(e[a]);else o.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(i,l,d),!d)for(m=0;m<g;++m)r.defined(i[m].geometry)&&c.GeometryPipeline.splitLongitude(i[m]);if(function(e){const t=e.length;for(let n=0;n<t;++n){const t=e[n];r.defined(t.geometry)?u(t.geometry,n):r.defined(t.westHemisphereGeometry)&&r.defined(t.eastHemisphereGeometry)&&(u(t.westHemisphereGeometry,n),u(t.eastHemisphereGeometry,n))}}(i),p)for(m=0;m<g;++m){const e=i[m];r.defined(e.geometry)?(c.GeometryPipeline.reorderForPostVertexCache(e.geometry),c.GeometryPipeline.reorderForPreVertexCache(e.geometry)):r.defined(e.westHemisphereGeometry)&&r.defined(e.eastHemisphereGeometry)&&(c.GeometryPipeline.reorderForPostVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.westHemisphereGeometry),c.GeometryPipeline.reorderForPostVertexCache(e.eastHemisphereGeometry),c.GeometryPipeline.reorderForPreVertexCache(e.eastHemisphereGeometry))}let y=c.GeometryPipeline.combineInstances(i);for(g=y.length,m=0;m<g;++m){h=y[m];const e=h.attributes;if(d)for(const t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===n.ComponentDatatype.DOUBLE&&c.GeometryPipeline.encodeAttribute(h,t,`${t}3DHigh`,`${t}3DLow`);else for(const o in e)if(e.hasOwnProperty(o)&&e[o].componentDatatype===n.ComponentDatatype.DOUBLE){const e=`${o}3D`,n=`${o}2D`;c.GeometryPipeline.projectTo2D(h,o,e,n,s),r.defined(h.boundingSphere)&&"position"===o&&(h.boundingSphereCV=t.BoundingSphere.fromVertices(h.attributes.position2D.values)),c.GeometryPipeline.encodeAttribute(h,e,`${e}High`,`${e}Low`),c.GeometryPipeline.encodeAttribute(h,n,`${n}High`,`${n}Low`)}f&&c.GeometryPipeline.compressVertices(h)}if(!a){let e=[];for(g=y.length,m=0;m<g;++m)h=y[m],e=e.concat(c.GeometryPipeline.fitToUnsignedShortIndices(h));y=e}return y}function l(e,t,n,o){let i,s,c;const a=o.length-1;if(a>=0){const e=o[a];i=e.offset+e.count,c=e.index,s=n[c].indices.length}else i=0,c=0,s=n[c].indices.length;const d=e.length;for(let a=0;a<d;++a){const d=e[a][t];if(!r.defined(d))continue;const p=d.indices.length;i+p>s&&(i=0,s=n[++c].indices.length),o.push({index:c,offset:i,count:p}),i+=p}}Object.defineProperties(p.prototype,{componentDatatype:{get:function(){return n.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),p.fromCartesian3=function(e){return new p(e.x,e.y,e.z)},p.toValue=function(e,t){return r.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const m={};function h(e,t){const n=e.attributes;for(const e in n)if(n.hasOwnProperty(e)){const o=n[e];r.defined(o)&&r.defined(o.values)&&t.push(o.values.buffer)}r.defined(e.indices)&&t.push(e.indices.buffer)}function g(e,t){const n=e.length,i=new Float64Array(1+19*n);let s=0;i[s++]=n;for(let t=0;t<n;t++){const n=e[t];if(o.Matrix4.pack(n.modelMatrix,i,s),s+=o.Matrix4.packedLength,r.defined(n.attributes)&&r.defined(n.attributes.offset)){const e=n.attributes.offset.value;i[s]=e[0],i[s+1]=e[1],i[s+2]=e[2]}s+=3}return t.push(i.buffer),i}function y(e){const n=e.length,o=1+(t.BoundingSphere.packedLength+1)*n,i=new Float32Array(o);let s=0;i[s++]=n;for(let o=0;o<n;++o){const n=e[o];r.defined(n)?(i[s++]=1,t.BoundingSphere.pack(e[o],i,s)):i[s++]=0,s+=t.BoundingSphere.packedLength}return i}function b(e){const n=new Array(e[0]);let r=0,o=1;for(;o<e.length;)1===e[o++]&&(n[r]=t.BoundingSphere.unpack(e,o)),++r,o+=t.BoundingSphere.packedLength;return n}m.combineGeometry=function(e){let n,o;const i=e.instances,s=i.length;let a,d,p=!1;s>0&&(n=f(e),n.length>0&&(o=c.GeometryPipeline.createAttributeLocations(n[0]),e.createPickOffsets&&(a=function(e,t){const n=[];return l(e,"geometry",t,n),l(e,"westHemisphereGeometry",t,n),l(e,"eastHemisphereGeometry",t,n),n}(i,n))),r.defined(i[0].attributes)&&r.defined(i[0].attributes.offset)&&(d=new Array(s),p=!0));const u=new Array(s),m=new Array(s);for(let e=0;e<s;++e){const n=i[e],o=n.geometry;r.defined(o)&&(u[e]=o.boundingSphere,m[e]=o.boundingSphereCV,p&&(d[e]=n.geometry.offsetAttribute));const s=n.eastHemisphereGeometry,c=n.westHemisphereGeometry;r.defined(s)&&r.defined(c)&&(r.defined(s.boundingSphere)&&r.defined(c.boundingSphere)&&(u[e]=t.BoundingSphere.union(s.boundingSphere,c.boundingSphere)),r.defined(s.boundingSphereCV)&&r.defined(c.boundingSphereCV)&&(m[e]=t.BoundingSphere.union(s.boundingSphereCV,c.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:o,pickOffsets:a,offsetInstanceExtend:d,boundingSpheres:u,boundingSpheresCV:m}},m.packCreateGeometryResults=function(e,n){const o=new Float64Array(function(e){let n=1;const o=e.length;for(let i=0;i<o;i++){const o=e[i];if(++n,!r.defined(o))continue;const s=o.attributes;n+=7+2*t.BoundingSphere.packedLength+(r.defined(o.indices)?o.indices.length:0);for(const e in s)s.hasOwnProperty(e)&&r.defined(s[e])&&(n+=5+s[e].values.length)}return n}(e)),i=[],s={},c=e.length;let a=0;o[a++]=c;for(let n=0;n<c;n++){const c=e[n],d=r.defined(c);if(o[a++]=d?1:0,!d)continue;o[a++]=c.primitiveType,o[a++]=c.geometryType,o[a++]=r.defaultValue(c.offsetAttribute,-1);const p=r.defined(c.boundingSphere)?1:0;o[a++]=p,p&&t.BoundingSphere.pack(c.boundingSphere,o,a),a+=t.BoundingSphere.packedLength;const u=r.defined(c.boundingSphereCV)?1:0;o[a++]=u,u&&t.BoundingSphere.pack(c.boundingSphereCV,o,a),a+=t.BoundingSphere.packedLength;const f=c.attributes,l=[];for(const e in f)f.hasOwnProperty(e)&&r.defined(f[e])&&(l.push(e),r.defined(s[e])||(s[e]=i.length,i.push(e)));o[a++]=l.length;for(let e=0;e<l.length;e++){const t=l[e],n=f[t];o[a++]=s[t],o[a++]=n.componentDatatype,o[a++]=n.componentsPerAttribute,o[a++]=n.normalize?1:0,o[a++]=n.values.length,o.set(n.values,a),a+=n.values.length}const m=r.defined(c.indices)?c.indices.length:0;o[a++]=m,m>0&&(o.set(c.indices,a),a+=m)}return n.push(o.buffer),{stringTable:i,packedData:o}},m.unpackCreateGeometryResults=function(e){const r=e.stringTable,o=e.packedData;let c;const d=new Array(o[0]);let p=0,u=1;for(;u<o.length;){if(!(1===o[u++])){d[p++]=void 0;continue}const e=o[u++],f=o[u++];let l,m,h=o[u++];-1===h&&(h=void 0);1===o[u++]&&(l=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;let g,y,b;1===o[u++]&&(m=t.BoundingSphere.unpack(o,u)),u+=t.BoundingSphere.packedLength;const x=new s.GeometryAttributes,G=o[u++];for(c=0;c<G;c++){const e=r[o[u++]],t=o[u++];b=o[u++];const s=0!==o[u++];g=o[u++],y=n.ComponentDatatype.createTypedArray(t,g);for(let e=0;e<g;e++)y[e]=o[u++];x[e]=new i.GeometryAttribute({componentDatatype:t,componentsPerAttribute:b,normalize:s,values:y})}let S;if(g=o[u++],g>0){const e=y.length/b;for(S=a.IndexDatatype.createTypedArray(e,g),c=0;c<g;c++)S[c]=o[u++]}d[p++]=new i.Geometry({primitiveType:e,geometryType:f,boundingSphere:l,boundingSphereCV:m,indices:S,attributes:x,offsetAttribute:h})}return d},m.packCombineGeometryParameters=function(e,n){const r=e.createGeometryResults,o=r.length;for(let e=0;e<o;e++)n.push(r[e].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:g(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof t.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},m.unpackCombineGeometryParameters=function(e){const n=function(e){const t=e,n=new Array(t[0]);let i=0,s=1;for(;s<t.length;){const e=o.Matrix4.unpack(t,s);let c;s+=o.Matrix4.packedLength,r.defined(t[s])&&(c={offset:new p(t[s],t[s+1],t[s+2])}),s+=3,n[i++]={modelMatrix:e,attributes:c}}return n}(e.packedInstances),i=e.createGeometryResults,s=i.length;let c=0;for(let e=0;e<s;e++){const t=m.unpackCreateGeometryResults(i[e]),r=t.length;for(let e=0;e<r;e++){const r=t[e];n[c].geometry=r,++c}}const a=o.Ellipsoid.clone(e.ellipsoid);return{instances:n,ellipsoid:a,projection:e.isGeographic?new t.GeographicProjection(a):new d.WebMercatorProjection(a),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:o.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},m.packCombineGeometryResults=function(e,t){r.defined(e.geometries)&&function(e,t){const n=e.length;for(let r=0;r<n;++r)h(e[r],t)}(e.geometries,t);const n=y(e.boundingSpheres),o=y(e.boundingSpheresCV);return t.push(n.buffer,o.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:o}},m.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:b(e.boundingSpheres),boundingSpheresCV:b(e.boundingSpheresCV)}};var x=m;e.PrimitivePipeline=x})); diff --git a/src/renderer/public/sdk/Cesium/Workers/RectangleGeometryLibrary-8951ccaa.js b/src/renderer/public/sdk/Cesium/Workers/RectangleGeometryLibrary-8951ccaa.js deleted file mode 100644 index 7509c47..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/RectangleGeometryLibrary-8951ccaa.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./Transforms-7ac1f9ee","./ComponentDatatype-9b23164a"],(function(t,n,a,e,o){"use strict";const r=Math.cos,s=Math.sin,i=Math.sqrt,c={computePosition:function(t,n,e,o,c,g,u){const h=n.radiiSquared,l=t.nwCorner,C=t.boundingRectangle;let S=l.latitude-t.granYCos*o+c*t.granXSin;const d=r(S),w=s(S),M=h.z*w;let X=l.longitude+o*t.granYSin+c*t.granXCos;const Y=d*r(X),f=d*s(X),m=h.x*Y,p=h.y*f,x=i(m*Y+p*f+M*w);if(g.x=m/x,g.y=p/x,g.z=M/x,e){const n=t.stNwCorner;a.defined(n)?(S=n.latitude-t.stGranYCos*o+c*t.stGranXSin,X=n.longitude+o*t.stGranYSin+c*t.stGranXCos,u.x=(X-t.stWest)*t.lonScalar,u.y=(S-t.stSouth)*t.latScalar):(u.x=(X-C.west)*t.lonScalar,u.y=(S-C.south)*t.latScalar)}}},g=new n.Matrix2;let u=new n.Cartesian3;const h=new n.Cartographic;let l=new n.Cartesian3;const C=new e.GeographicProjection;function S(t,a,e,o,r,s,i){const c=Math.cos(a),h=o*c,S=e*c,d=Math.sin(a),w=o*d,M=e*d;u=C.project(t,u),u=n.Cartesian3.subtract(u,l,u);const X=n.Matrix2.fromRotation(a,g);u=n.Matrix2.multiplyByVector(X,u,u),u=n.Cartesian3.add(u,l,u),s-=1,i-=1;const Y=(t=C.unproject(u,t)).latitude,f=Y+s*M,m=Y-h*i,p=Y-h*i+s*M,x=Math.max(Y,f,m,p),G=Math.min(Y,f,m,p),R=t.longitude,y=R+s*S,O=R+i*w,P=R+i*w+s*S;return{north:x,south:G,east:Math.max(R,y,O,P),west:Math.min(R,y,O,P),granYCos:h,granYSin:w,granXCos:S,granXSin:M,nwCorner:t}}c.computeOptions=function(t,a,e,r,s,i,c){let g,u=t.east,d=t.west,w=t.north,M=t.south,X=!1,Y=!1;w===o.CesiumMath.PI_OVER_TWO&&(X=!0),M===-o.CesiumMath.PI_OVER_TWO&&(Y=!0);const f=w-M;g=d>u?o.CesiumMath.TWO_PI-d+u:u-d;const m=Math.ceil(g/a)+1,p=Math.ceil(f/a)+1,x=g/(m-1),G=f/(p-1),R=n.Rectangle.northwest(t,i),y=n.Rectangle.center(t,h);0===e&&0===r||(y.longitude<R.longitude&&(y.longitude+=o.CesiumMath.TWO_PI),l=C.project(y,l));const O=G,P=x,W=n.Rectangle.clone(t,s),_={granYCos:O,granYSin:0,granXCos:P,granXSin:0,nwCorner:R,boundingRectangle:W,width:m,height:p,northCap:X,southCap:Y};if(0!==e){const t=S(R,e,x,G,0,m,p);w=t.north,M=t.south,u=t.east,d=t.west,_.granYCos=t.granYCos,_.granYSin=t.granYSin,_.granXCos=t.granXCos,_.granXSin=t.granXSin,W.north=w,W.south=M,W.east=u,W.west=d}if(0!==r){e-=r;const t=n.Rectangle.northwest(W,c),a=S(t,e,x,G,0,m,p);_.stGranYCos=a.granYCos,_.stGranXCos=a.granXCos,_.stGranYSin=a.granYSin,_.stGranXSin=a.granXSin,_.stNwCorner=t,_.stWest=a.west,_.stSouth=a.south}return _};var d=c;t.RectangleGeometryLibrary=d})); diff --git a/src/renderer/public/sdk/Cesium/Workers/TerrainEncoding-978fa982.js b/src/renderer/public/sdk/Cesium/Workers/TerrainEncoding-978fa982.js deleted file mode 100644 index ad7d2cc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/TerrainEncoding-978fa982.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./Transforms-7ac1f9ee","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./AttributeCompression-b4dfdf5f","./ComponentDatatype-9b23164a"],(function(t,e,i,o,a,r){"use strict";function n(t,e){this._ellipsoid=t,this._cameraPosition=new i.Cartesian3,this._cameraPositionInScaledSpace=new i.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,o.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(n.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){const e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),o=i.Cartesian3.magnitudeSquared(e)-1;i.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=o}}});const s=new i.Cartesian3;n.prototype.isPointVisible=function(t){return x(this._ellipsoid.transformPositionToScaledSpace(t,s),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},n.prototype.isScaledSpacePointVisible=function(t){return x(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const c=new i.Cartesian3;n.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){const i=this._ellipsoid;let a,r;return o.defined(e)&&e<0&&i.minimumRadius>-e?(r=c,r.x=this._cameraPosition.x/(i.radii.x+e),r.y=this._cameraPosition.y/(i.radii.y+e),r.z=this._cameraPosition.z/(i.radii.z+e),a=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),x(t,r,a)},n.prototype.computeHorizonCullingPoint=function(t,e,i){return h(this._ellipsoid,t,e,i)};const u=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE);n.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,o){return h(m(this._ellipsoid,i,u),t,e,o)},n.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,o,a){return p(this._ellipsoid,t,e,i,o,a)},n.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,o,a,r){return p(m(this._ellipsoid,a,u),t,e,i,o,r)};const d=[];n.prototype.computeHorizonCullingPointFromRectangle=function(t,o,a){const r=i.Rectangle.subsample(t,o,0,d),n=e.BoundingSphere.fromPoints(r);if(!(i.Cartesian3.magnitude(n.center)<.1*o.minimumRadius))return this.computeHorizonCullingPoint(n.center,r,a)};const l=new i.Cartesian3;function m(t,e,a){if(o.defined(e)&&e<0&&t.minimumRadius>-e){const o=i.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,l);t=i.Ellipsoid.fromCartesian3(o,a)}return t}function h(t,e,a,r){o.defined(r)||(r=new i.Cartesian3);const n=M(t,e);let s=0;for(let e=0,i=a.length;e<i;++e){const i=g(t,a[e],n);if(i<0)return;s=Math.max(s,i)}return y(n,s,r)}const f=new i.Cartesian3;function p(t,e,a,r,n,s){o.defined(s)||(s=new i.Cartesian3),r=o.defaultValue(r,3),n=o.defaultValue(n,i.Cartesian3.ZERO);const c=M(t,e);let u=0;for(let e=0,i=a.length;e<i;e+=r){f.x=a[e]+n.x,f.y=a[e+1]+n.y,f.z=a[e+2]+n.z;const i=g(t,f,c);if(i<0)return;u=Math.max(u,i)}return y(c,u,s)}function x(t,e,o){const a=e,r=o,n=i.Cartesian3.subtract(t,a,s),c=-i.Cartesian3.dot(n,a);return!(r<0?c>0:c>r&&c*c/i.Cartesian3.magnitudeSquared(n)>r)}const S=new i.Cartesian3,C=new i.Cartesian3;function g(t,e,o){const a=t.transformPositionToScaledSpace(e,S);let r=i.Cartesian3.magnitudeSquared(a),n=Math.sqrt(r);const s=i.Cartesian3.divideByScalar(a,n,C);r=Math.max(1,r),n=Math.max(1,n);const c=1/n;return 1/(i.Cartesian3.dot(s,o)*c-i.Cartesian3.magnitude(i.Cartesian3.cross(s,o,s))*(Math.sqrt(r-1)*c))}function y(t,e,o){if(!(e<=0||e===1/0||e!=e))return i.Cartesian3.multiplyByScalar(t,e,o)}const N=new i.Cartesian3;function M(t,e){return i.Cartesian3.equals(e,i.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,N),i.Cartesian3.normalize(N,N))}const T={getHeight:function(t,e,i){return(t-i)*e+i}},b=new i.Cartesian3;T.getPosition=function(t,e,o,a,r){const n=e.cartesianToCartographic(t,b),s=T.getHeight(n.height,o,a);return i.Cartesian3.fromRadians(n.longitude,n.latitude,s,e,r)};var P=T;var z=Object.freeze({NONE:0,BITS12:1});const _=new i.Cartesian3,E=new i.Cartesian3,H=new i.Cartesian2,w=new i.Matrix4,A=new i.Matrix4,I=Math.pow(2,12);function V(t,e,a,r,n,s,c,u,d,l){let m,h,f=z.NONE;if(o.defined(e)&&o.defined(a)&&o.defined(r)&&o.defined(n)){const t=e.minimum,o=e.maximum,s=i.Cartesian3.subtract(o,t,E),c=r-a;f=Math.max(i.Cartesian3.maximumComponent(s),c)<I-1?z.BITS12:z.NONE,m=i.Matrix4.inverseTransformation(n,new i.Matrix4);const u=i.Cartesian3.negate(t,_);i.Matrix4.multiply(i.Matrix4.fromTranslation(u,w),m,m);const d=_;d.x=1/s.x,d.y=1/s.y,d.z=1/s.z,i.Matrix4.multiply(i.Matrix4.fromScale(d,w),m,m),h=i.Matrix4.clone(n),i.Matrix4.setTranslation(h,i.Cartesian3.ZERO,h),n=i.Matrix4.clone(n,new i.Matrix4);const l=i.Matrix4.fromTranslation(t,w),p=i.Matrix4.fromScale(s,A),x=i.Matrix4.multiply(l,p,w);i.Matrix4.multiply(n,x,n),i.Matrix4.multiply(h,x,h)}this.quantization=f,this.minimumHeight=a,this.maximumHeight=r,this.center=i.Cartesian3.clone(t),this.toScaledENU=m,this.fromScaledENU=n,this.matrix=h,this.hasVertexNormals=s,this.hasWebMercatorT=o.defaultValue(c,!1),this.hasGeodeticSurfaceNormals=o.defaultValue(u,!1),this.exaggeration=o.defaultValue(d,1),this.exaggerationRelativeHeight=o.defaultValue(l,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}V.prototype.encode=function(t,e,o,n,s,c,u,d){const l=n.x,m=n.y;if(this.quantization===z.BITS12){(o=i.Matrix4.multiplyByPoint(this.toScaledENU,o,_)).x=r.CesiumMath.clamp(o.x,0,1),o.y=r.CesiumMath.clamp(o.y,0,1),o.z=r.CesiumMath.clamp(o.z,0,1);const n=this.maximumHeight-this.minimumHeight,c=r.CesiumMath.clamp((s-this.minimumHeight)/n,0,1);i.Cartesian2.fromElements(o.x,o.y,H);const d=a.AttributeCompression.compressTextureCoordinates(H);i.Cartesian2.fromElements(o.z,c,H);const h=a.AttributeCompression.compressTextureCoordinates(H);i.Cartesian2.fromElements(l,m,H);const f=a.AttributeCompression.compressTextureCoordinates(H);if(t[e++]=d,t[e++]=h,t[e++]=f,this.hasWebMercatorT){i.Cartesian2.fromElements(u,0,H);const o=a.AttributeCompression.compressTextureCoordinates(H);t[e++]=o}}else i.Cartesian3.subtract(o,this.center,_),t[e++]=_.x,t[e++]=_.y,t[e++]=_.z,t[e++]=s,t[e++]=l,t[e++]=m,this.hasWebMercatorT&&(t[e++]=u);return this.hasVertexNormals&&(t[e++]=a.AttributeCompression.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(t[e++]=d.x,t[e++]=d.y,t[e++]=d.z),e};const q=new i.Cartesian3,G=new i.Cartesian3;V.prototype.addGeodeticSurfaceNormals=function(t,e,i){if(this.hasGeodeticSurfaceNormals)return;const o=this.stride,a=t.length/o;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();const r=this.stride;for(let n=0;n<a;n++){for(let i=0;i<o;i++){const a=n*o+i;e[n*r+i]=t[a]}const a=this.decodePosition(e,n,q),s=i.geodeticSurfaceNormal(a,G),c=n*r+this._offsetGeodeticSurfaceNormal;e[c]=s.x,e[c+1]=s.y,e[c+2]=s.z}},V.prototype.removeGeodeticSurfaceNormals=function(t,e){if(!this.hasGeodeticSurfaceNormals)return;const i=this.stride,o=t.length/i;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();const a=this.stride;for(let r=0;r<o;r++)for(let o=0;o<a;o++){const n=r*i+o;e[r*a+o]=t[n]}},V.prototype.decodePosition=function(t,e,r){if(o.defined(r)||(r=new i.Cartesian3),e*=this.stride,this.quantization===z.BITS12){const o=a.AttributeCompression.decompressTextureCoordinates(t[e],H);r.x=o.x,r.y=o.y;const n=a.AttributeCompression.decompressTextureCoordinates(t[e+1],H);return r.z=n.x,i.Matrix4.multiplyByPoint(this.fromScaledENU,r,r)}return r.x=t[e],r.y=t[e+1],r.z=t[e+2],i.Cartesian3.add(r,this.center,r)},V.prototype.getExaggeratedPosition=function(t,e,i){i=this.decodePosition(t,e,i);const o=this.exaggeration,a=this.exaggerationRelativeHeight;if(1!==o&&this.hasGeodeticSurfaceNormals){const r=this.decodeGeodeticSurfaceNormal(t,e,G),n=this.decodeHeight(t,e),s=P.getHeight(n,o,a)-n;i.x+=r.x*s,i.y+=r.y*s,i.z+=r.z*s}return i},V.prototype.decodeTextureCoordinates=function(t,e,r){return o.defined(r)||(r=new i.Cartesian2),e*=this.stride,this.quantization===z.BITS12?a.AttributeCompression.decompressTextureCoordinates(t[e+2],r):i.Cartesian2.fromElements(t[e+4],t[e+5],r)},V.prototype.decodeHeight=function(t,e){if(e*=this.stride,this.quantization===z.BITS12){return a.AttributeCompression.decompressTextureCoordinates(t[e+1],H).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[e+3]},V.prototype.decodeWebMercatorT=function(t,e){return e*=this.stride,this.quantization===z.BITS12?a.AttributeCompression.decompressTextureCoordinates(t[e+3],H).x:t[e+6]},V.prototype.getOctEncodedNormal=function(t,e,o){const a=t[e=e*this.stride+this._offsetVertexNormal]/256,r=Math.floor(a),n=256*(a-r);return i.Cartesian2.fromElements(r,n,o)},V.prototype.decodeGeodeticSurfaceNormal=function(t,e,i){return e=e*this.stride+this._offsetGeodeticSurfaceNormal,i.x=t[e],i.y=t[e+1],i.z=t[e+2],i},V.prototype._calculateStrideAndOffsets=function(){let t=0;if(this.quantization===z.BITS12)t+=3;else t+=6;this.hasWebMercatorT&&(t+=1),this.hasVertexNormals&&(this._offsetVertexNormal=t,t+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=t,t+=3),this.stride=t};const O={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},B={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};V.prototype.getAttributes=function(t){const e=r.ComponentDatatype.FLOAT,i=r.ComponentDatatype.getSizeInBytes(e),o=this.stride*i;let a=0;const n=[];function s(r,s){n.push({index:r,vertexBuffer:t,componentDatatype:e,componentsPerAttribute:s,offsetInBytes:a,strideInBytes:o}),a+=s*i}if(this.quantization===z.NONE){s(O.position3DAndHeight,4);let t=2;t+=this.hasWebMercatorT?1:0,t+=this.hasVertexNormals?1:0,s(O.textureCoordAndEncodedNormals,t),this.hasGeodeticSurfaceNormals&&s(O.geodeticSurfaceNormal,3)}else{const t=this.hasWebMercatorT||this.hasVertexNormals,e=this.hasWebMercatorT&&this.hasVertexNormals;s(B.compressed0,t?4:3),e&&s(B.compressed1,1),this.hasGeodeticSurfaceNormals&&s(B.geodeticSurfaceNormal,3)}return n},V.prototype.getAttributeLocations=function(){return this.quantization===z.NONE?O:B},V.clone=function(t,e){if(o.defined(t))return o.defined(e)||(e=new V),e.quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=i.Cartesian3.clone(t.center),e.toScaledENU=i.Matrix4.clone(t.toScaledENU),e.fromScaledENU=i.Matrix4.clone(t.fromScaledENU),e.matrix=i.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e.hasGeodeticSurfaceNormals=t.hasGeodeticSurfaceNormals,e.exaggeration=t.exaggeration,e.exaggerationRelativeHeight=t.exaggerationRelativeHeight,e._calculateStrideAndOffsets(),e},t.EllipsoidalOccluder=n,t.TerrainEncoding=V})); diff --git a/src/renderer/public/sdk/Cesium/Workers/Transforms-7ac1f9ee.js b/src/renderer/public/sdk/Cesium/Workers/Transforms-7ac1f9ee.js deleted file mode 100644 index 6d208dd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/Transforms-7ac1f9ee.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["require","exports","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./ComponentDatatype-9b23164a","./combine-8462e002","./RuntimeError-48e1f06d"],(function(e,t,n,r,o,i,s){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}function u(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}r.defined(Object.create)&&(u.prototype=Object.create(Error.prototype),u.prototype.constructor=u),u.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return r.defined(this.stack)&&(e+=`\n${this.stack.toString()}`),e},u.throwInstantiationError=function(){throw new u("This function defines an interface and should not be called directly.")};const c={};function l(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}c.typeOf={},c.defined=function(e,t){if(!r.defined(t))throw new u(function(e){return`${e} is required, actual value was undefined`}(e))},c.typeOf.func=function(e,t){if("function"!=typeof t)throw new u(l(typeof t,"function",e))},c.typeOf.string=function(e,t){if("string"!=typeof t)throw new u(l(typeof t,"string",e))},c.typeOf.number=function(e,t){if("number"!=typeof t)throw new u(l(typeof t,"number",e))},c.typeOf.number.lessThan=function(e,t,n){if(c.typeOf.number(e,t),t>=n)throw new u(`Expected ${e} to be less than ${n}, actual value was ${t}`)},c.typeOf.number.lessThanOrEquals=function(e,t,n){if(c.typeOf.number(e,t),t>n)throw new u(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},c.typeOf.number.greaterThan=function(e,t,n){if(c.typeOf.number(e,t),t<=n)throw new u(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},c.typeOf.number.greaterThanOrEquals=function(e,t,n){if(c.typeOf.number(e,t),t<n)throw new u(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},c.typeOf.object=function(e,t){if("object"!=typeof t)throw new u(l(typeof t,"object",e))},c.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new u(l(typeof t,"boolean",e))},c.typeOf.bigint=function(e,t){if("bigint"!=typeof t)throw new u(l(typeof t,"bigint",e))},c.typeOf.number.equals=function(e,t,n,r){if(c.typeOf.number(e,n),c.typeOf.number(t,r),n!==r)throw new u(`${e} must be equal to ${t}, the actual values are ${n} and ${r}`)};var d=c,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e){this._ellipsoid=r.defaultValue(e,n.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),p.prototype.project=function(e,t){const o=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;return r.defined(t)?(t.x=i,t.y=s,t.z=a,t):new n.Cartesian3(i,s,a)},p.prototype.unproject=function(e,t){const o=this._oneOverSemimajorAxis,i=e.x*o,s=e.y*o,a=e.z;return r.defined(t)?(t.longitude=i,t.latitude=s,t.height=a,t):new n.Cartographic(i,s,a)};var h=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function m(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}function g(e,t){this.center=n.Cartesian3.clone(r.defaultValue(e,n.Cartesian3.ZERO)),this.radius=r.defaultValue(t,0)}const y=new n.Cartesian3,v=new n.Cartesian3,w=new n.Cartesian3,_=new n.Cartesian3,C=new n.Cartesian3,b=new n.Cartesian3,x=new n.Cartesian3,S=new n.Cartesian3,A=new n.Cartesian3,E=new n.Cartesian3,O=new n.Cartesian3,I=new n.Cartesian3,P=4/3*o.CesiumMath.PI;g.fromPoints=function(e,t){if(r.defined(t)||(t=new g),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=n.Cartesian3.clone(e[0],x),i=n.Cartesian3.clone(o,y),s=n.Cartesian3.clone(o,v),a=n.Cartesian3.clone(o,w),u=n.Cartesian3.clone(o,_),c=n.Cartesian3.clone(o,C),l=n.Cartesian3.clone(o,b),d=e.length;let f;for(f=1;f<d;f++){n.Cartesian3.clone(e[f],o);const t=o.x,r=o.y,d=o.z;t<i.x&&n.Cartesian3.clone(o,i),t>u.x&&n.Cartesian3.clone(o,u),r<s.y&&n.Cartesian3.clone(o,s),r>c.y&&n.Cartesian3.clone(o,c),d<a.z&&n.Cartesian3.clone(o,a),d>l.z&&n.Cartesian3.clone(o,l)}const p=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(u,i,S)),h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,S)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S));let P=i,R=u,T=p;h>T&&(T=h,P=s,R=c),m>T&&(T=m,P=a,R=l);const q=A;q.x=.5*(P.x+R.x),q.y=.5*(P.y+R.y),q.z=.5*(P.z+R.z);let z=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(R,q,S)),M=Math.sqrt(z);const D=E;D.x=i.x,D.y=s.y,D.z=a.z;const U=O;U.x=u.x,U.y=c.y,U.z=l.z;const k=n.Cartesian3.midpoint(D,U,I);let F=0;for(f=0;f<d;f++){n.Cartesian3.clone(e[f],o);const t=n.Cartesian3.magnitude(n.Cartesian3.subtract(o,k,S));t>F&&(F=t);const r=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(o,q,S));if(r>z){const e=Math.sqrt(r);M=.5*(M+e),z=M*M;const t=e-M;q.x=(M*q.x+t*o.x)/e,q.y=(M*q.y+t*o.y)/e,q.z=(M*q.z+t*o.z)/e}}return M<F?(n.Cartesian3.clone(q,t.center),t.radius=M):(n.Cartesian3.clone(k,t.center),t.radius=F),t};const R=new p,T=new n.Cartesian3,q=new n.Cartesian3,z=new n.Cartographic,M=new n.Cartographic;g.fromRectangle2D=function(e,t,n){return g.fromRectangleWithHeights2D(e,t,0,0,n)},g.fromRectangleWithHeights2D=function(e,t,o,i,s){if(r.defined(s)||(s=new g),!r.defined(e))return s.center=n.Cartesian3.clone(n.Cartesian3.ZERO,s.center),s.radius=0,s;t=r.defaultValue(t,R),n.Rectangle.southwest(e,z),z.height=o,n.Rectangle.northeast(e,M),M.height=i;const a=t.project(z,T),u=t.project(M,q),c=u.x-a.x,l=u.y-a.y,d=u.z-a.z;s.radius=.5*Math.sqrt(c*c+l*l+d*d);const f=s.center;return f.x=a.x+.5*c,f.y=a.y+.5*l,f.z=a.z+.5*d,s};const D=[];g.fromRectangle3D=function(e,t,o,i){if(t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,0),r.defined(i)||(i=new g),!r.defined(e))return i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i.radius=0,i;const s=n.Rectangle.subsample(e,t,o,D);return g.fromPoints(s,i)},g.fromVertices=function(e,t,o,i){if(r.defined(i)||(i=new g),!r.defined(e)||0===e.length)return i.center=n.Cartesian3.clone(n.Cartesian3.ZERO,i.center),i.radius=0,i;t=r.defaultValue(t,n.Cartesian3.ZERO),o=r.defaultValue(o,3);const s=x;s.x=e[0]+t.x,s.y=e[1]+t.y,s.z=e[2]+t.z;const a=n.Cartesian3.clone(s,y),u=n.Cartesian3.clone(s,v),c=n.Cartesian3.clone(s,w),l=n.Cartesian3.clone(s,_),d=n.Cartesian3.clone(s,C),f=n.Cartesian3.clone(s,b),p=e.length;let h;for(h=0;h<p;h+=o){const r=e[h]+t.x,o=e[h+1]+t.y,i=e[h+2]+t.z;s.x=r,s.y=o,s.z=i,r<a.x&&n.Cartesian3.clone(s,a),r>l.x&&n.Cartesian3.clone(s,l),o<u.y&&n.Cartesian3.clone(s,u),o>d.y&&n.Cartesian3.clone(s,d),i<c.z&&n.Cartesian3.clone(s,c),i>f.z&&n.Cartesian3.clone(s,f)}const m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S)),P=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,S)),R=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(f,c,S));let T=a,q=l,z=m;P>z&&(z=P,T=u,q=d),R>z&&(z=R,T=c,q=f);const M=A;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(q,M,S)),U=Math.sqrt(D);const k=E;k.x=a.x,k.y=u.y,k.z=c.z;const F=O;F.x=l.x,F.y=d.y,F.z=f.z;const N=n.Cartesian3.midpoint(k,F,I);let j=0;for(h=0;h<p;h+=o){s.x=e[h]+t.x,s.y=e[h+1]+t.y,s.z=e[h+2]+t.z;const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(s,N,S));r>j&&(j=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(s,M,S));if(o>D){const e=Math.sqrt(o);U=.5*(U+e),D=U*U;const t=e-U;M.x=(U*M.x+t*s.x)/e,M.y=(U*M.y+t*s.y)/e,M.z=(U*M.z+t*s.z)/e}}return U<j?(n.Cartesian3.clone(M,i.center),i.radius=U):(n.Cartesian3.clone(N,i.center),i.radius=j),i},g.fromEncodedCartesianVertices=function(e,t,o){if(r.defined(o)||(o=new g),!r.defined(e)||!r.defined(t)||e.length!==t.length||0===e.length)return o.center=n.Cartesian3.clone(n.Cartesian3.ZERO,o.center),o.radius=0,o;const i=x;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const s=n.Cartesian3.clone(i,y),a=n.Cartesian3.clone(i,v),u=n.Cartesian3.clone(i,w),c=n.Cartesian3.clone(i,_),l=n.Cartesian3.clone(i,C),d=n.Cartesian3.clone(i,b),f=e.length;let p;for(p=0;p<f;p+=3){const r=e[p]+t[p],o=e[p+1]+t[p+1],f=e[p+2]+t[p+2];i.x=r,i.y=o,i.z=f,r<s.x&&n.Cartesian3.clone(i,s),r>c.x&&n.Cartesian3.clone(i,c),o<a.y&&n.Cartesian3.clone(i,a),o>l.y&&n.Cartesian3.clone(i,l),f<u.z&&n.Cartesian3.clone(i,u),f>d.z&&n.Cartesian3.clone(i,d)}const h=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(c,s,S)),m=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(l,a,S)),P=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(d,u,S));let R=s,T=c,q=h;m>q&&(q=m,R=a,T=l),P>q&&(q=P,R=u,T=d);const z=A;z.x=.5*(R.x+T.x),z.y=.5*(R.y+T.y),z.z=.5*(R.z+T.z);let M=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(T,z,S)),D=Math.sqrt(M);const U=E;U.x=s.x,U.y=a.y,U.z=u.z;const k=O;k.x=c.x,k.y=l.y,k.z=d.z;const F=n.Cartesian3.midpoint(U,k,I);let N=0;for(p=0;p<f;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const r=n.Cartesian3.magnitude(n.Cartesian3.subtract(i,F,S));r>N&&(N=r);const o=n.Cartesian3.magnitudeSquared(n.Cartesian3.subtract(i,z,S));if(o>M){const e=Math.sqrt(o);D=.5*(D+e),M=D*D;const t=e-D;z.x=(D*z.x+t*i.x)/e,z.y=(D*z.y+t*i.y)/e,z.z=(D*z.z+t*i.z)/e}}return D<N?(n.Cartesian3.clone(z,o.center),o.radius=D):(n.Cartesian3.clone(F,o.center),o.radius=N),o},g.fromCornerPoints=function(e,t,o){r.defined(o)||(o=new g);const i=n.Cartesian3.midpoint(e,t,o.center);return o.radius=n.Cartesian3.distance(i,t),o},g.fromEllipsoid=function(e,t){return r.defined(t)||(t=new g),n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};const U=new n.Cartesian3;g.fromBoundingSpheres=function(e,t){if(r.defined(t)||(t=new g),!r.defined(e)||0===e.length)return t.center=n.Cartesian3.clone(n.Cartesian3.ZERO,t.center),t.radius=0,t;const o=e.length;if(1===o)return g.clone(e[0],t);if(2===o)return g.union(e[0],e[1],t);const i=[];let s;for(s=0;s<o;s++)i.push(e[s].center);const a=(t=g.fromPoints(i,t)).center;let u=t.radius;for(s=0;s<o;s++){const t=e[s];u=Math.max(u,n.Cartesian3.distance(a,t.center,U)+t.radius)}return t.radius=u,t};const k=new n.Cartesian3,F=new n.Cartesian3,N=new n.Cartesian3;g.fromOrientedBoundingBox=function(e,t){r.defined(t)||(t=new g);const o=e.halfAxes,i=n.Matrix3.getColumn(o,0,k),s=n.Matrix3.getColumn(o,1,F),a=n.Matrix3.getColumn(o,2,N);return n.Cartesian3.add(i,s,i),n.Cartesian3.add(i,a,i),t.center=n.Cartesian3.clone(e.center,t.center),t.radius=n.Cartesian3.magnitude(i),t};const j=new n.Cartesian3,B=new n.Cartesian3;g.fromTransformation=function(e,t){r.defined(t)||(t=new g);const o=n.Matrix4.getTranslation(e,j),i=n.Matrix4.getScale(e,B),s=.5*n.Cartesian3.magnitude(i);return t.center=n.Cartesian3.clone(o,t.center),t.radius=s,t},g.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.center=n.Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new g(e.center,e.radius)},g.packedLength=4,g.pack=function(e,t,n){n=r.defaultValue(n,0);const o=e.center;return t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius,t},g.unpack=function(e,t,n){t=r.defaultValue(t,0),r.defined(n)||(n=new g);const o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};const V=new n.Cartesian3,$=new n.Cartesian3;g.union=function(e,t,o){r.defined(o)||(o=new g);const i=e.center,s=e.radius,a=t.center,u=t.radius,c=n.Cartesian3.subtract(a,i,V),l=n.Cartesian3.magnitude(c);if(s>=l+u)return e.clone(o),o;if(u>=l+s)return t.clone(o),o;const d=.5*(s+l+u),f=n.Cartesian3.multiplyByScalar(c,(-s+d)/l,$);return n.Cartesian3.add(f,i,f),n.Cartesian3.clone(f,o.center),o.radius=d,o};const L=new n.Cartesian3;g.expand=function(e,t,r){r=g.clone(e,r);const o=n.Cartesian3.magnitude(n.Cartesian3.subtract(t,r.center,L));return o>r.radius&&(r.radius=o),r},g.intersectPlane=function(e,t){const r=e.center,o=e.radius,i=t.normal,s=n.Cartesian3.dot(i,r)+t.distance;return s<-o?h.OUTSIDE:s<o?h.INTERSECTING:h.INSIDE},g.transform=function(e,t,o){return r.defined(o)||(o=new g),o.center=n.Matrix4.multiplyByPoint(t,e.center,o.center),o.radius=n.Matrix4.getMaximumScale(t)*e.radius,o};const Q=new n.Cartesian3;g.distanceSquaredTo=function(e,t){const r=n.Cartesian3.subtract(e.center,t,Q),o=n.Cartesian3.magnitude(r)-e.radius;return o<=0?0:o*o},g.transformWithoutScale=function(e,t,o){return r.defined(o)||(o=new g),o.center=n.Matrix4.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};const W=new n.Cartesian3;g.computePlaneDistances=function(e,t,o,i){r.defined(i)||(i=new m);const s=n.Cartesian3.subtract(e.center,t,W),a=n.Cartesian3.dot(o,s);return i.start=a-e.radius,i.stop=a+e.radius,i};const H=new n.Cartesian3,Y=new n.Cartesian3,Z=new n.Cartesian3,J=new n.Cartesian3,X=new n.Cartesian3,G=new n.Cartographic,K=new Array(8);for(let e=0;e<8;++e)K[e]=new n.Cartesian3;const ee=new p;let te;g.projectTo2D=function(e,t,o){const i=(t=r.defaultValue(t,ee)).ellipsoid;let s=e.center;const a=e.radius;let u;u=n.Cartesian3.equals(s,n.Cartesian3.ZERO)?n.Cartesian3.clone(n.Cartesian3.UNIT_X,H):i.geodeticSurfaceNormal(s,H);const c=n.Cartesian3.cross(n.Cartesian3.UNIT_Z,u,Y);n.Cartesian3.normalize(c,c);const l=n.Cartesian3.cross(u,c,Z);n.Cartesian3.normalize(l,l),n.Cartesian3.multiplyByScalar(u,a,u),n.Cartesian3.multiplyByScalar(l,a,l),n.Cartesian3.multiplyByScalar(c,a,c);const d=n.Cartesian3.negate(l,X),f=n.Cartesian3.negate(c,J),p=K;let h=p[0];n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[1],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[2],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[3],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h),n.Cartesian3.negate(u,u),h=p[4],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,c,h),h=p[5],n.Cartesian3.add(u,l,h),n.Cartesian3.add(h,f,h),h=p[6],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,f,h),h=p[7],n.Cartesian3.add(u,d,h),n.Cartesian3.add(h,c,h);const m=p.length;for(let e=0;e<m;++e){const r=p[e];n.Cartesian3.add(s,r,r);const o=i.cartesianToCartographic(r,G);t.project(o,r)}s=(o=g.fromPoints(p,o)).center;const y=s.x,v=s.y,w=s.z;return s.x=w,s.y=y,s.z=v,o},g.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},g.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&n.Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},g.prototype.intersectPlane=function(e){return g.intersectPlane(this,e)},g.prototype.distanceSquaredTo=function(e){return g.distanceSquaredTo(this,e)},g.prototype.computePlaneDistances=function(e,t,n){return g.computePlaneDistances(this,e,t,n)},g.prototype.isOccluded=function(e){return g.isOccluded(this,e)},g.prototype.equals=function(e){return g.equals(this,e)},g.prototype.clone=function(e){return g.clone(this,e)},g.prototype.volume=function(){const e=this.radius;return P*e*e*e};const ne={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},re={};Object.defineProperties(re,{element:{get:function(){if(re.supportsFullscreen())return document[ne.fullscreenElement]}},changeEventName:{get:function(){if(re.supportsFullscreen())return ne.fullscreenchange}},errorEventName:{get:function(){if(re.supportsFullscreen())return ne.fullscreenerror}},enabled:{get:function(){if(re.supportsFullscreen())return document[ne.fullscreenEnabled]}},fullscreen:{get:function(){if(re.supportsFullscreen())return null!==re.element}}}),re.supportsFullscreen=function(){if(r.defined(te))return te;te=!1;const e=document.body;if("function"==typeof e.requestFullscreen)return ne.requestFullscreen="requestFullscreen",ne.exitFullscreen="exitFullscreen",ne.fullscreenEnabled="fullscreenEnabled",ne.fullscreenElement="fullscreenElement",ne.fullscreenchange="fullscreenchange",ne.fullscreenerror="fullscreenerror",te=!0,te;const t=["webkit","moz","o","ms","khtml"];let n;for(let r=0,o=t.length;r<o;++r){const o=t[r];n=`${o}RequestFullscreen`,"function"==typeof e[n]?(ne.requestFullscreen=n,te=!0):(n=`${o}RequestFullScreen`,"function"==typeof e[n]&&(ne.requestFullscreen=n,te=!0)),n=`${o}ExitFullscreen`,"function"==typeof document[n]?ne.exitFullscreen=n:(n=`${o}CancelFullScreen`,"function"==typeof document[n]&&(ne.exitFullscreen=n)),n=`${o}FullscreenEnabled`,void 0!==document[n]?ne.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,void 0!==document[n]&&(ne.fullscreenEnabled=n)),n=`${o}FullscreenElement`,void 0!==document[n]?ne.fullscreenElement=n:(n=`${o}FullScreenElement`,void 0!==document[n]&&(ne.fullscreenElement=n)),n=`${o}fullscreenchange`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenChange"),ne.fullscreenchange=n),n=`${o}fullscreenerror`,void 0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenError"),ne.fullscreenerror=n)}return te},re.requestFullscreen=function(e,t){re.supportsFullscreen()&&e[ne.requestFullscreen]({vrDisplay:t})},re.exitFullscreen=function(){re.supportsFullscreen()&&document[ne.exitFullscreen]()},re._names=ne;var oe=re;let ie,se,ae,ue,ce,le,de,fe,pe,he,me,ge,ye,ve,we,_e,Ce,be;function xe(e){const t=e.split(".");for(let e=0,n=t.length;e<n;++e)t[e]=parseInt(t[e],10);return t}function Se(){if(!r.defined(se)&&(se=!1,!Ie())){const e=/ Chrome\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(se=!0,ae=xe(e[1]))}return se}function Ae(){if(!r.defined(ue)&&(ue=!1,!Se()&&!Ie()&&/ Safari\/[\.0-9]+/.test(ie.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(ue=!0,ce=xe(e[1]))}return ue}function Ee(){if(!r.defined(le)){le=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ie.userAgent);null!==e&&(le=!0,de=xe(e[1]),de.isNightly=!!e[2])}return le}function Oe(){if(!r.defined(fe)){let e;fe=!1,"Microsoft Internet Explorer"===ie.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ie.userAgent),null!==e&&(fe=!0,pe=xe(e[1]))):"Netscape"===ie.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ie.userAgent),null!==e&&(fe=!0,pe=xe(e[1])))}return fe}function Ie(){if(!r.defined(he)){he=!1;const e=/ Edg\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(he=!0,me=xe(e[1]))}return he}function Pe(){if(!r.defined(ge)){ge=!1;const e=/Firefox\/([\.0-9]+)/.exec(ie.userAgent);null!==e&&(ge=!0,ye=xe(e[1]))}return ge}function Re(){if(!r.defined(be)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;be=r.defined(t)&&""!==t,be&&(Ce=t)}return be}function Te(){return Te._result}ie="undefined"!=typeof navigator?navigator:{},Te._promise=void 0,Te._result=void 0,Te.initialize=function(){return r.defined(Te._promise)||(Te._promise=new Promise((e=>{const t=new Image;t.onload=function(){Te._result=t.width>0&&t.height>0,e(Te._result)},t.onerror=function(){Te._result=!1,e(Te._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}))),Te._promise},Object.defineProperties(Te,{initialized:{get:function(){return r.defined(Te._result)}}});const qe=[];"undefined"!=typeof ArrayBuffer&&(qe.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&qe.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&qe.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&qe.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&qe.push(BigUint64Array));const ze={isChrome:Se,chromeVersion:function(){return Se()&&ae},isSafari:Ae,safariVersion:function(){return Ae()&&ce},isWebkit:Ee,webkitVersion:function(){return Ee()&&de},isInternetExplorer:Oe,internetExplorerVersion:function(){return Oe()&&pe},isEdge:Ie,edgeVersion:function(){return Ie()&&me},isFirefox:Pe,firefoxVersion:function(){return Pe()&&ye},isWindows:function(){return r.defined(ve)||(ve=/Windows/i.test(ie.appVersion)),ve},isIPadOrIOS:function(){return r.defined(we)||(we="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),we},hardwareConcurrency:r.defaultValue(ie.hardwareConcurrency,3),supportsPointerEvents:function(){return r.defined(_e)||(_e=!Pe()&&"undefined"!=typeof PointerEvent&&(!r.defined(ie.pointerEnabled)||ie.pointerEnabled)),_e},supportsImageRenderingPixelated:Re,supportsWebP:Te,imageRenderingValue:function(){return Re()?Ce:void 0},typedArrayTypes:qe,supportsBasis:function(e){return ze.supportsWebAssembly()&&e.context.supportsBasis},supportsFullscreen:function(){return oe.supportsFullscreen()},supportsTypedArrays:function(){return"undefined"!=typeof ArrayBuffer},supportsBigInt64Array:function(){return"undefined"!=typeof BigInt64Array},supportsBigUint64Array:function(){return"undefined"!=typeof BigUint64Array},supportsBigInt:function(){return"undefined"!=typeof BigInt},supportsWebWorkers:function(){return"undefined"!=typeof Worker},supportsWebAssembly:function(){return"undefined"!=typeof WebAssembly}};var Me=ze;function De(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}let Ue=new n.Cartesian3;De.fromAxisAngle=function(e,t,o){const i=t/2,s=Math.sin(i);Ue=n.Cartesian3.normalize(e,Ue);const a=Ue.x*s,u=Ue.y*s,c=Ue.z*s,l=Math.cos(i);return r.defined(o)?(o.x=a,o.y=u,o.z=c,o.w=l,o):new De(a,u,c,l)};const ke=[1,2,0],Fe=new Array(3);De.fromRotationMatrix=function(e,t){let o,i,s,a,u;const c=e[n.Matrix3.COLUMN0ROW0],l=e[n.Matrix3.COLUMN1ROW1],d=e[n.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)o=Math.sqrt(f+1),u=.5*o,o=.5/o,i=(e[n.Matrix3.COLUMN1ROW2]-e[n.Matrix3.COLUMN2ROW1])*o,s=(e[n.Matrix3.COLUMN2ROW0]-e[n.Matrix3.COLUMN0ROW2])*o,a=(e[n.Matrix3.COLUMN0ROW1]-e[n.Matrix3.COLUMN1ROW0])*o;else{const t=ke;let r=0;l>c&&(r=1),d>c&&d>l&&(r=2);const f=t[r],p=t[f];o=Math.sqrt(e[n.Matrix3.getElementIndex(r,r)]-e[n.Matrix3.getElementIndex(f,f)]-e[n.Matrix3.getElementIndex(p,p)]+1);const h=Fe;h[r]=.5*o,o=.5/o,u=(e[n.Matrix3.getElementIndex(p,f)]-e[n.Matrix3.getElementIndex(f,p)])*o,h[f]=(e[n.Matrix3.getElementIndex(f,r)]+e[n.Matrix3.getElementIndex(r,f)])*o,h[p]=(e[n.Matrix3.getElementIndex(p,r)]+e[n.Matrix3.getElementIndex(r,p)])*o,i=-h[0],s=-h[1],a=-h[2]}return r.defined(t)?(t.x=i,t.y=s,t.z=a,t.w=u,t):new De(i,s,a,u)};const Ne=new De;let je=new De,Be=new De,Ve=new De;De.fromHeadingPitchRoll=function(e,t){return Ve=De.fromAxisAngle(n.Cartesian3.UNIT_X,e.roll,Ne),Be=De.fromAxisAngle(n.Cartesian3.UNIT_Y,-e.pitch,t),t=De.multiply(Be,Ve,Be),je=De.fromAxisAngle(n.Cartesian3.UNIT_Z,-e.heading,Ne),De.multiply(je,t,t)};const $e=new n.Cartesian3,Le=new n.Cartesian3,Qe=new De,We=new De,He=new De;De.packedLength=4,De.pack=function(e,t,n){return n=r.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},De.unpack=function(e,t,n){return t=r.defaultValue(t,0),r.defined(n)||(n=new De),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},De.packedInterpolationLength=3,De.convertPackedArrayForInterpolation=function(e,t,n,o){De.unpack(e,4*n,He),De.conjugate(He,He);for(let i=0,s=n-t+1;i<s;i++){const n=3*i;De.unpack(e,4*(t+i),Qe),De.multiply(Qe,He,Qe),Qe.w<0&&De.negate(Qe,Qe),De.computeAxis(Qe,$e);const s=De.computeAngle(Qe);r.defined(o)||(o=[]),o[n]=$e.x*s,o[n+1]=$e.y*s,o[n+2]=$e.z*s}},De.unpackInterpolationResult=function(e,t,o,i,s){r.defined(s)||(s=new De),n.Cartesian3.fromArray(e,0,Le);const a=n.Cartesian3.magnitude(Le);return De.unpack(t,4*i,We),0===a?De.clone(De.IDENTITY,Qe):De.fromAxisAngle(Le,a,Qe),De.multiply(Qe,We,s)},De.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new De(e.x,e.y,e.z,e.w)},De.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},De.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},De.magnitude=function(e){return Math.sqrt(De.magnitudeSquared(e))},De.normalize=function(e,t){const n=1/De.magnitude(e),r=e.x*n,o=e.y*n,i=e.z*n,s=e.w*n;return t.x=r,t.y=o,t.z=i,t.w=s,t},De.inverse=function(e,t){const n=De.magnitudeSquared(e);return t=De.conjugate(e,t),De.multiplyByScalar(t,1/n,t)},De.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},De.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},De.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},De.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},De.multiply=function(e,t,n){const r=e.x,o=e.y,i=e.z,s=e.w,a=t.x,u=t.y,c=t.z,l=t.w,d=s*a+r*l+o*c-i*u,f=s*u-r*c+o*l+i*a,p=s*c+r*u-o*a+i*l,h=s*l-r*a-o*u-i*c;return n.x=d,n.y=f,n.z=p,n.w=h,n},De.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},De.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},De.computeAxis=function(e,t){const n=e.w;if(Math.abs(n-1)<o.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;const r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},De.computeAngle=function(e){return Math.abs(e.w-1)<o.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};let Ye=new De;De.lerp=function(e,t,n,r){return Ye=De.multiplyByScalar(t,n,Ye),r=De.multiplyByScalar(e,1-n,r),De.add(Ye,r,r)};let Ze=new De,Je=new De,Xe=new De;De.slerp=function(e,t,n,r){let i=De.dot(e,t),s=t;if(i<0&&(i=-i,s=Ze=De.negate(t,Ze)),1-i<o.CesiumMath.EPSILON6)return De.lerp(e,s,n,r);const a=Math.acos(i);return Je=De.multiplyByScalar(e,Math.sin((1-n)*a),Je),Xe=De.multiplyByScalar(s,Math.sin(n*a),Xe),r=De.add(Je,Xe,r),De.multiplyByScalar(r,1/Math.sin(a),r)},De.log=function(e,t){const r=o.CesiumMath.acosClamped(e.w);let i=0;return 0!==r&&(i=r/Math.sin(r)),n.Cartesian3.multiplyByScalar(e,i,t)},De.exp=function(e,t){const r=n.Cartesian3.magnitude(e);let o=0;return 0!==r&&(o=Math.sin(r)/r),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(r),t};const Ge=new n.Cartesian3,Ke=new n.Cartesian3,et=new De,tt=new De;De.computeInnerQuadrangle=function(e,t,r,o){const i=De.conjugate(t,et);De.multiply(i,r,tt);const s=De.log(tt,Ge);De.multiply(i,e,tt);const a=De.log(tt,Ke);return n.Cartesian3.add(s,a,s),n.Cartesian3.multiplyByScalar(s,.25,s),n.Cartesian3.negate(s,s),De.exp(s,et),De.multiply(t,et,o)},De.squad=function(e,t,n,r,o,i){const s=De.slerp(e,t,o,et),a=De.slerp(n,r,o,tt);return De.slerp(s,a,2*o*(1-o),i)};const nt=new De,rt=1.9011074535173003,ot=Me.supportsTypedArrays()?new Float32Array(8):[],it=Me.supportsTypedArrays()?new Float32Array(8):[],st=Me.supportsTypedArrays()?new Float32Array(8):[],at=Me.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;ot[e]=1/(t*n),it[e]=t/n}function ut(e,t,n){let r,o,i=0,s=e.length-1;for(;i<=s;)if(r=~~((i+s)/2),o=n(e[r],t),o<0)i=r+1;else{if(!(o>0))return r;s=r-1}return~(s+1)}function ct(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function lt(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function dt(e){return e%4==0&&e%100!=0||e%400==0}function ft(e,t){this.julianDate=e,this.offset=t}ot[7]=rt/136,it[7]=8*rt/17,De.fastSlerp=function(e,t,n,r){let o,i=De.dot(e,t);i>=0?o=1:(o=-1,i=-i);const s=i-1,a=1-n,u=n*n,c=a*a;for(let e=7;e>=0;--e)st[e]=(ot[e]*u-it[e])*s,at[e]=(ot[e]*c-it[e])*s;const l=o*n*(1+st[0]*(1+st[1]*(1+st[2]*(1+st[3]*(1+st[4]*(1+st[5]*(1+st[6]*(1+st[7])))))))),d=a*(1+at[0]*(1+at[1]*(1+at[2]*(1+at[3]*(1+at[4]*(1+at[5]*(1+at[6]*(1+at[7])))))))),f=De.multiplyByScalar(e,d,nt);return De.multiplyByScalar(t,l,r),De.add(f,r,r)},De.fastSquad=function(e,t,n,r,o,i){const s=De.fastSlerp(e,t,o,et),a=De.fastSlerp(n,r,o,tt);return De.fastSlerp(s,a,2*o*(1-o),i)},De.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},De.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(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},De.ZERO=Object.freeze(new De(0,0,0,0)),De.IDENTITY=Object.freeze(new De(0,0,0,1)),De.prototype.clone=function(e){return De.clone(this,e)},De.prototype.equals=function(e){return De.equals(this,e)},De.prototype.equalsEpsilon=function(e,t){return De.equalsEpsilon(this,e,t)},De.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var pt=Object.freeze({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:2400000.5});var ht=Object.freeze({UTC:0,TAI:1});const mt=new lt,gt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(e,t){return qt.compare(e.julianDate,t.julianDate)}const vt=new ft;function wt(e){vt.julianDate=e;const t=qt.leapSeconds;let n=ut(t,vt,yt);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){qt.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}qt.addSeconds(e,r,e)}function _t(e,t){vt.julianDate=e;const n=qt.leapSeconds;let r=ut(n,vt,yt);if(r<0&&(r=~r),0===r)return qt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return qt.addSeconds(e,-n[r-1].offset,t);const o=qt.secondsDifference(n[r].julianDate,e);return 0===o?qt.addSeconds(e,-n[r].offset,t):o<=1?void 0:qt.addSeconds(e,-n[--r].offset,t)}function Ct(e,t,n){const r=t/pt.SECONDS_PER_DAY|0;return e+=r,(t-=pt.SECONDS_PER_DAY*r)<0&&(e--,t+=pt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function bt(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);const l=i+(r*pt.SECONDS_PER_HOUR+o*pt.SECONDS_PER_MINUTE+s*pt.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const xt=/^(\d{4})$/,St=/^(\d{4})-(\d{2})$/,At=/^(\d{4})-?(\d{3})$/,Et=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Ot=/^(\d{4})-?(\d{2})-?(\d{2})$/,It=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Pt=/^(\d{2})(\.\d+)?/.source+It.source,Rt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+It.source,Tt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+It.source;function qt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,ht.UTC);const o=0|e;Ct(o,t+=(e-o)*pt.SECONDS_PER_DAY,this),n===ht.UTC&&wt(this)}qt.fromGregorianDate=function(e,t){const n=bt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return r.defined(t)?(Ct(n[0],n[1],t),wt(t),t):new qt(n[0],n[1],ht.UTC)},qt.fromDate=function(e,t){const n=bt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r.defined(t)?(Ct(n[0],n[1],t),wt(t),t):new qt(n[0],n[1],ht.UTC)},qt.fromIso8601=function(e,t){let n,o=(e=e.replace(",",".")).split("T"),i=1,s=1,a=0,u=0,c=0,l=0;const d=o[0],f=o[1];let p,h,m;if(o=d.match(Ot),null!==o)n=+o[1],i=+o[2],s=+o[3];else if(o=d.match(St),null!==o)n=+o[1],i=+o[2];else if(o=d.match(xt),null!==o)n=+o[1];else{let e;if(o=d.match(At),null!==o)n=+o[1],e=+o[2],h=dt(n);else if(o=d.match(Et),null!==o){n=+o[1];e=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),i=p.getUTCMonth()+1,s=p.getUTCDate()}if(h=dt(n),r.defined(f)){o=f.match(Tt),null!==o?(a=+o[1],u=+o[2],c=+o[3],l=1e3*+(o[4]||0),m=5):(o=f.match(Rt),null!==o?(a=+o[1],u=+o[2],c=60*+(o[3]||0),m=4):(o=f.match(Pt),null!==o&&(a=+o[1],u=60*+(o[2]||0),m=3)));const e=o[m],t=+o[m+1],r=+(o[m+2]||0);switch(e){case"+":a-=t,u-=r;break;case"-":a+=t,u+=r;break;case"Z":break;default:u+=new Date(Date.UTC(n,i-1,s,a,u)).getTimezoneOffset()}}const g=60===c;for(g&&c--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,s++;for(p=h&&2===i?29:gt[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:gt[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)i--,i<1&&(i+=12,n--),p=h&&2===i?29:gt[i-1],s+=p;const y=bt(n,i,s,a,u,c,l);return r.defined(t)?(Ct(y[0],y[1],t),wt(t)):t=new qt(y[0],y[1],ht.UTC),g&&qt.addSeconds(t,1,t),t},qt.now=function(e){return qt.fromDate(new Date,e)};const zt=new qt(0,0,ht.TAI);qt.toGregorianDate=function(e,t){let n=!1,o=_t(e,zt);r.defined(o)||(qt.addSeconds(e,-1,zt),o=_t(zt,zt),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let a=i+68569|0;const u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const l=80*a/2447|0,d=a-(2447*l/80|0)|0;a=l/11|0;const f=l+2-12*a|0,p=100*(u-49)+c+a|0;let h=s/pt.SECONDS_PER_HOUR|0,m=s-h*pt.SECONDS_PER_HOUR;const g=m/pt.SECONDS_PER_MINUTE|0;m-=g*pt.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/pt.SECONDS_PER_MILLISECOND;return h+=12,h>23&&(h-=24),n&&(y+=1),r.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=y,t.millisecond=v,t.isLeapSecond=n,t):new lt(p,f,d,h,g,y,v,n)},qt.toDate=function(e){const t=qt.toGregorianDate(e,mt);let 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))},qt.toIso8601=function(e,t){const n=qt.toGregorianDate(e,mt);let o=n.year,i=n.month,s=n.day,a=n.hour;const u=n.minute,c=n.second,l=n.millisecond;let d;return 1e4===o&&1===i&&1===s&&0===a&&0===u&&0===c&&0===l&&(o=9999,i=12,s=31,a=24),r.defined(t)||0===l?r.defined(t)&&0!==t?(d=(.01*l).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*l).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},qt.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new qt(e.dayNumber,e.secondsOfDay,ht.TAI)},qt.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},qt.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},qt.equalsEpsilon=function(e,t,n){return n=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(qt.secondsDifference(e,t))<=n},qt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/pt.SECONDS_PER_DAY},qt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*pt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},qt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/pt.SECONDS_PER_DAY},qt.computeTaiMinusUtc=function(e){vt.julianDate=e;const t=qt.leapSeconds;let n=ut(t,vt,yt);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},qt.addSeconds=function(e,t,n){return Ct(e.dayNumber,e.secondsOfDay+t,n)},qt.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*pt.SECONDS_PER_MINUTE;return Ct(e.dayNumber,r,n)},qt.addHours=function(e,t,n){const r=e.secondsOfDay+t*pt.SECONDS_PER_HOUR;return Ct(e.dayNumber,r,n)},qt.addDays=function(e,t,n){return Ct(e.dayNumber+t,e.secondsOfDay,n)},qt.lessThan=function(e,t){return qt.compare(e,t)<0},qt.lessThanOrEquals=function(e,t){return qt.compare(e,t)<=0},qt.greaterThan=function(e,t){return qt.compare(e,t)>0},qt.greaterThanOrEquals=function(e,t){return qt.compare(e,t)>=0},qt.prototype.clone=function(e){return qt.clone(this,e)},qt.prototype.equals=function(e){return qt.equals(this,e)},qt.prototype.equalsEpsilon=function(e,t){return qt.equalsEpsilon(this,e,t)},qt.prototype.toString=function(){return qt.toIso8601(this)},qt.leapSeconds=[new ft(new qt(2441317,43210,ht.TAI),10),new ft(new qt(2441499,43211,ht.TAI),11),new ft(new qt(2441683,43212,ht.TAI),12),new ft(new qt(2442048,43213,ht.TAI),13),new ft(new qt(2442413,43214,ht.TAI),14),new ft(new qt(2442778,43215,ht.TAI),15),new ft(new qt(2443144,43216,ht.TAI),16),new ft(new qt(2443509,43217,ht.TAI),17),new ft(new qt(2443874,43218,ht.TAI),18),new ft(new qt(2444239,43219,ht.TAI),19),new ft(new qt(2444786,43220,ht.TAI),20),new ft(new qt(2445151,43221,ht.TAI),21),new ft(new qt(2445516,43222,ht.TAI),22),new ft(new qt(2446247,43223,ht.TAI),23),new ft(new qt(2447161,43224,ht.TAI),24),new ft(new qt(2447892,43225,ht.TAI),25),new ft(new qt(2448257,43226,ht.TAI),26),new ft(new qt(2448804,43227,ht.TAI),27),new ft(new qt(2449169,43228,ht.TAI),28),new ft(new qt(2449534,43229,ht.TAI),29),new ft(new qt(2450083,43230,ht.TAI),30),new ft(new qt(2450630,43231,ht.TAI),31),new ft(new qt(2451179,43232,ht.TAI),32),new ft(new qt(2453736,43233,ht.TAI),33),new ft(new qt(2454832,43234,ht.TAI),34),new ft(new qt(2456109,43235,ht.TAI),35),new ft(new qt(2457204,43236,ht.TAI),36),new ft(new qt(2457754,43237,ht.TAI),37)];var Mt,Dt={exports:{}},Ut={exports:{}};var kt,Ft={exports:{}}; -/*! - * 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 - * - */var Nt,jt,Bt,Vt,$t={exports:{}}; -/*! - * 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 - * - */Bt=f,Vt=function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1;if(!(this instanceof i))return n?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var s=i.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function d(e,t){var n,r,o={};if("RegExp"===c(t))o=null;else if(l(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;else o[t]=!0;for(n=0,r=e.length;n<r;n++)(o&&void 0!==o[e[n]]||!o&&t.test(e[n]))&&(e.splice(n,1),r--,n--);return e}function f(e,t){var n,r;if(l(t)){for(n=0,r=t.length;n<r;n++)if(!f(e,t[n]))return!1;return!0}var o=c(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"==typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function p(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function h(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.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*$/,i.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`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.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"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,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)/gi,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)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},w=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(e){return n}}};for(y in v)i[y+"PathSegment"]=w("pathname",v[y]),i[y+"UrnPathSegment"]=w("urnpath",v[y]);var _=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);return s.join(e)}};function C(e){return function(t,n){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}function b(e,t){return function(n,r){return void 0===n?this._parts[e]||"":(null!==n&&(n+="").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!r),this)}}i.decodePath=_("/","decodePathSegment"),i.decodeUrnPath=_(":","decodeUrnPathSegment"),i.recodePath=_("/","encodePathSegment","decode"),i.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(e,t){var n;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(n=(e=(e=e.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var n,r,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var n=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var r,o=e.indexOf("/"),s=e.lastIndexOf("@",o>-1?o:e.length-1);return s>-1&&(-1===o||s<o)?(r=e.substring(0,s).split(":"),t.username=r[0]?i.decode(r[0]):null,r.shift(),t.password=r[0]?i.decode(r.join(":")):null,e=n.substring(s+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var n,r,o,s={},u=e.split("&"),c=u.length,l=0;l<c;l++)n=u[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(a.call(s,r)?("string"!=typeof s[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);return s},i.build=function(e){var t="",n=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){var r,o,s,u,c="";for(o in e)if("__proto__"!==o&&a.call(e,o))if(l(e[o]))for(r={},s=0,u=e[o].length;s<u;s++)void 0!==e[o][s]&&void 0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));return c.substring(1)},i.buildQueryParameter=function(e,t,n){return i.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=n);"string"==typeof e[t]&&(e[t]=[e[t]]),l(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"==typeof t)for(var r in t)a.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===n?null:n}},i.removeQuery=function(e,t,n){var r,o,s;if(l(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void 0;else if("RegExp"===c(t))for(s in e)t.test(s)&&(e[s]=void 0);else if("object"==typeof t)for(s in t)a.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===c(n)?!l(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=d(e[t],n):e[t]!==String(n)||l(n)&&1!==n.length?l(e[t])&&(e[t]=d(e[t],n)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,n,r){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(a.call(e,o)&&t.test(o)&&(void 0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(var s in t)if(a.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(n)){case"Undefined":return t in e;case"Boolean":return n===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!n(e[t],t,e);case"Array":return!!l(e[t])&&(r?f:p)(e[t],n);case"RegExp":return l(e[t])?!!r&&f(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":return l(e[t])?!!r&&f(e[t],n):e[t]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],n=0,r=0;r<arguments.length;r++){var o=new i(arguments[r]);e.push(o);for(var s=o.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});var r=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(r.lastIndex=0;;){var c=r.exec(e);if(!c)break;var l=c.index;if(n.ignoreHtml){var d=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}for(var f=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;;){var m=a.exec(p);if(!m)break;var g=m.index+m[0].length;h=Math.max(h,g)}if(!((p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){var y=t(p,l,f=l+p.length,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=C("protocol"),s.username=C("username"),s.password=C("password"),s.hostname=C("hostname"),s.port=C("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=r||o))&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+u(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(l(t)){s=[];for(var a=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(h(t[a])))}else(t||"string"==typeof t)&&(t=h(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));else t?s[e]=h(t):s.splice(e,1);return i&&s.unshift(""),this.path(s.join(r),n)},s.segmentCoded=function(e,t,n){var r,o,s;if("number"!=typeof e&&(n=t,t=e,e=void 0),void 0===t){if(l(r=this.segment(e,t,n)))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);else r=void 0!==r?i.decode(r):void 0;return r}if(l(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,n)};var E=s.query;return s.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);return this._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},s.setQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)a.call(e,o)&&(r[o]=e[o])}return this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.addQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(r,e,void 0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.removeQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},s.hasQuery=function(e,t,n){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(r,e,t,n)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(n){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(!n)),this},s.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var r,o,s="";for("/"!==(n=i.recodePath(n)).charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"")&&(s=s[0]);-1!==(r=n.search(/\/\.\.(\/|$)/));)0!==r?(-1===(o=n.substring(0,r).lastIndexOf("/"))&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3);return t&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.unicode=function(){var e=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.readable=function(){var t=this.clone();t.username("").password("").normalize();var n="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(var r="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){var u=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}return n+=i.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){var t,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},s.relativeTo=function(e){var t,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==s.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==n.hostname||t.port!==n.port)return a.build();if(t.hostname=null,t.port=null,o===s)return t.path="",a.build();if(!(r=i.commonPath(o,s)))return a.build();var u=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(r.length)||"./",a.build()},s.equals=function(e){var t,n,r,o,s,u=this.clone(),c=new i(e),d={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(r=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(r.length!==o.length)return!1;for(s in t=i.parseQuery(r,this._parts.escapeQuerySpace),n=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,s)){if(l(t[s])){if(!p(t[s],n[s]))return!1}else if(t[s]!==n[s])return!1;d[s]=!0}for(s in n)if(a.call(n,s)&&!d[s])return!1;return!0},s.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i},( -/*! - * 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 - * - */ -jt=Dt).exports?jt.exports=Vt((Mt||(Mt=1,function(e,t){!function(n){var r=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,i="object"==typeof f&&f;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var s,a,u=2147483647,c=36,l=1,d=26,p=38,h=700,m=72,g=128,y="-",v=/^xn--/,w=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=c-l,x=Math.floor,S=String.fromCharCode;function A(e){throw new RangeError(C[e])}function E(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function O(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+E((e=e.replace(_,".")).split("."),t).join(".")}function I(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function P(e){return E(e,(function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+S(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>b*d>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+p))}function q(e){var t,n,r,o,i,s,a,f,p,h,v,w=[],_=e.length,C=0,b=g,S=m;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&A("not-basic"),w.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<_;){for(i=C,s=1,a=c;o>=_&&A("invalid-input"),((f=(v=e.charCodeAt(o++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||f>x((u-C)/s))&&A("overflow"),C+=f*s,!(f<(p=a<=S?l:a>=S+d?d:a-S));a+=c)s>x(u/(h=c-p))&&A("overflow"),s*=h;S=T(C-i,t=w.length+1,0==i),x(C/t)>u-b&&A("overflow"),b+=x(C/t),C%=t,w.splice(C++,0,b)}return P(w)}function z(e){var t,n,r,o,i,s,a,f,p,h,v,w,_,C,b,E=[];for(w=(e=I(e)).length,t=g,n=0,i=m,s=0;s<w;++s)(v=e[s])<128&&E.push(S(v));for(r=o=E.length,o&&E.push(y);r<w;){for(a=u,s=0;s<w;++s)(v=e[s])>=t&&v<a&&(a=v);for(a-t>x((u-n)/(_=r+1))&&A("overflow"),n+=(a-t)*_,t=a,s=0;s<w;++s)if((v=e[s])<t&&++n>u&&A("overflow"),v==t){for(f=n,p=c;!(f<(h=p<=i?l:p>=i+d?d:p-i));p+=c)b=f-h,C=c-h,E.push(S(R(h+b%C,0))),f=x(b/C);E.push(S(R(f,0))),i=T(n,_,r==o),n=0,++r}++n,++t}return E.join("")}if(s={version:"1.3.2",ucs2:{decode:I,encode:P},decode:q,encode:z,toASCII:function(e){return O(e,(function(e){return w.test(e)?"xn--"+z(e):e}))},toUnicode:function(e){return O(e,(function(e){return v.test(e)?q(e.slice(4).toLowerCase()):e}))}},r&&o)if(e.exports==r)o.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else n.punycode=s}(f)}(Ut,Ut.exports)),Ut.exports),function(){return kt||(kt=1,t=f,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(":"),o=r.length,i=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[o-1]&&""===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==r[t];t++);if(t<i)for(r.splice(t,1,"0000");r.length<i;)r.splice(t,0,"0000");for(var s=0;s<i;s++){n=r[s].split("");for(var a=0;a<3&&"0"===n[0]&&n.length>1;a++)n.splice(0,1);r[s]=n.join("")}var u=-1,c=0,l=0,d=-1,f=!1;for(s=0;s<i;s++)f?"0"===r[s]?l+=1:(f=!1,l>c&&(u=d,c=l)):"0"===r[s]&&(f=!0,d=s,l=1);l>c&&(u=d,c=l),c>1&&r.splice(u,c,""),o=r.length;var p="";for(""===r[0]&&(p=":"),s=0;s<o&&(p+=r[s],s!==o-1);s++)p+=":";return""===r[o-1]&&(p+=":"),p},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}},(e=Ft).exports?e.exports=n():t.IPv6=n(t)),Ft.exports;var e,t,n}(),function(){return Nt||(Nt=1,t=f,n=function(e){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(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n},(e=$t).exports?e.exports=n():t.SecondLevelDomains=n(t)),$t.exports;var e,t,n}()):Bt.URI=Vt(Bt.punycode,Bt.IPv6,Bt.SecondLevelDomains,Bt);var Lt=Dt.exports;function Qt(e,t){if(null===e||"object"!=typeof e)return e;t=r.defaultValue(t,!1);const n=new e.constructor;for(const r in e)if(e.hasOwnProperty(r)){let o=e[r];t&&(o=Qt(o,t)),n[r]=o}return n}function Wt(){let e,t;const n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}function Ht(e,t){let n;return"undefined"!=typeof document&&(n=document),Ht._implementation(e,t,n)}Ht._implementation=function(e,t,n){if(!r.defined(t)){if(void 0===n)return e;t=r.defaultValue(n.baseURI,n.location.href)}const o=new Lt(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};const Yt={};function Zt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);let o=Yt[t];r.defined(o)||(o={},Yt[t]=o);let i=o[n];if(!r.defined(i)){const e=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d"),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const Jt=/^blob:/i;function Xt(e){return Jt.test(e)}let Gt;const Kt=/^data:/i;function en(e){return Kt.test(e)}var tn=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});var nn=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function rn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,nn.OTHER),this.serverKey=void 0,this.state=tn.UNISSUED,this.deferred=void 0,this.cancelled=!1}function on(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){const t={};if(!e)return t;const n=e.split("\r\n");for(let e=0;e<n.length;++e){const r=n[e],o=r.indexOf(": ");if(o>0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function sn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function an(e,t){return t-e}function un(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function cn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}rn.prototype.cancel=function(){this.cancelled=!0},rn.prototype.clone=function(e){return r.defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new rn(this)},on.prototype.toString=function(){let e="Request has failed.";return r.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(sn.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),sn.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},sn.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i<n.length;i++)if(n[i]===e&&r[i]===t){o=i;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,r[o]=void 0):(n.splice(o,1),r.splice(o,1)),!0)},sn.prototype.raiseEvent=function(){let e;this._insideRaiseEvent=!0;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const o=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(an),e=0;e<o;e++){const r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(un.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){const t=this._length;if(e<t){const n=this._array;for(let r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),un.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},un.prototype.heapify=function(e){e=r.defaultValue(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;for(;s;){const r=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(cn(o,i,e),e=i):s=!1}},un.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},un.prototype.insert=function(e){const t=this._array,n=this._comparator,o=this._maximumLength;let i,s=this._length++;for(s<t.length?t[s]=e:t.push(e);0!==s;){const e=Math.floor((s-1)/2);if(!(n(t[s],t[e])<0))break;cn(t,s,e),s=e}return r.defined(o)&&this._length>o&&(i=t[o],this._length=o),i},un.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return cn(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const ln={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let dn=20;const fn=new un({comparator:function(e,t){return e.priority-t.priority}});fn.maximumLength=dn,fn.reserve(dn);const pn=[];let hn={};const mn="undefined"!=typeof document?new Lt(document.location.href):new Lt,gn=new sn;function yn(){}function vn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function wn(e){return e.state===tn.UNISSUED&&(e.state=tn.ISSUED,e.deferred=Wt()),e.deferred.promise}function _n(e){const t=wn(e);return e.state=tn.ACTIVE,pn.push(e),++ln.numberOfActiveRequests,++ln.numberOfActiveRequestsEver,++hn[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===tn.CANCELLED)return;const n=e.deferred;--ln.numberOfActiveRequests,--hn[e.serverKey],gn.raiseEvent(),e.state=tn.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).catch(function(e){return function(t){e.state!==tn.CANCELLED&&(++ln.numberOfFailedRequests,--ln.numberOfActiveRequests,--hn[e.serverKey],gn.raiseEvent(t),e.state=tn.FAILED,e.deferred.reject(t))}}(e)),t}function Cn(e){const t=e.state===tn.ACTIVE;if(e.state=tn.CANCELLED,++ln.numberOfCancelledRequests,r.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--ln.numberOfActiveRequests,--hn[e.serverKey],++ln.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}yn.maximumRequests=50,yn.maximumRequestsPerServer=6,yn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},yn.throttleRequests=!0,yn.debugShowStatistics=!1,yn.requestCompletedEvent=gn,Object.defineProperties(yn,{statistics:{get:function(){return ln}},priorityHeapLength:{get:function(){return dn},set:function(e){if(e<dn)for(;fn.length>e;){Cn(fn.pop())}dn=e,fn.maximumLength=e,fn.reserve(e)}}}),yn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);const n=r.defaultValue(yn.requestsByServer[e],yn.maximumRequestsPerServer);return hn[e]+t<=n},yn.heapHasOpenSlots=function(e){return fn.length+e<=dn},yn.update=function(){let e,t,n=0;const r=pn.length;for(e=0;e<r;++e)t=pn[e],t.cancelled&&Cn(t),t.state===tn.ACTIVE?n>0&&(pn[e-n]=t):++n;pn.length-=n;const o=fn.internalArray,i=fn.length;for(e=0;e<i;++e)vn(o[e]);fn.resort();const s=Math.max(yn.maximumRequests-pn.length,0);let a=0;for(;a<s&&fn.length>0;)t=fn.pop(),t.cancelled?Cn(t):!t.throttleByServer||yn.serverHasOpenSlots(t.serverKey)?(_n(t),++a):Cn(t);!function(){if(!yn.debugShowStatistics)return;0===ln.numberOfActiveRequests&&ln.lastNumberOfActiveRequests>0&&(ln.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${ln.numberOfAttemptedRequests}`),ln.numberOfAttemptedRequests=0),ln.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${ln.numberOfCancelledRequests}`),ln.numberOfCancelledRequests=0),ln.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${ln.numberOfCancelledActiveRequests}`),ln.numberOfCancelledActiveRequests=0),ln.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${ln.numberOfFailedRequests}`),ln.numberOfFailedRequests=0));ln.lastNumberOfActiveRequests=ln.numberOfActiveRequests}()},yn.getServerKey=function(e){let t=new Lt(e);""===t.scheme()&&(t=new Lt(e).absoluteTo(mn),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const o=hn[n];return r.defined(o)||(hn[n]=0),n},yn.request=function(e){if(en(e.url)||Xt(e.url))return gn.raiseEvent(),e.state=tn.RECEIVED,e.requestFunction();if(++ln.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=yn.getServerKey(e.url)),yn.throttleRequests&&e.throttleByServer&&!yn.serverHasOpenSlots(e.serverKey))return;if(!yn.throttleRequests||!e.throttle)return _n(e);if(pn.length>=yn.maximumRequests)return;vn(e);const t=fn.insert(e);if(r.defined(t)){if(t===e)return;Cn(t)}return wn(e)},yn.clearForSpecs=function(){for(;fn.length>0;){Cn(fn.pop())}const e=pn.length;for(let t=0;t<e;++t)Cn(pn[t]);pn.length=0,hn={},ln.numberOfAttemptedRequests=0,ln.numberOfActiveRequests=0,ln.numberOfCancelledRequests=0,ln.numberOfCancelledActiveRequests=0,ln.numberOfFailedRequests=0,ln.numberOfActiveRequestsEver=0,ln.lastNumberOfActiveRequests=0},yn.numberOfActiveRequestsByServer=function(e){return hn[e]},yn.requestHeap=fn;const bn={};let xn={};bn.add=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(xn[n])||(xn[n]=!0)},bn.remove=function(e,t){const n=`${e.toLowerCase()}:${t}`;r.defined(xn[n])&&delete xn[n]},bn.contains=function(e){const t=function(e){const t=new Lt(e);t.normalize();let n=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){const e=n.split("@");n=e[1]}if(-1===n.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}return n}}(e);return!(!r.defined(t)||!r.defined(xn[t]))},bn.clear=function(){xn={}};var Sn=bn;const An=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function En(e,t,n,o){const i=e.query();if(0===i.length)return{};let s;if(-1===i.indexOf("=")){const e={};e[i]=void 0,s=e}else s=function(e){const t={};if(""===e)return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,o=n.length;e<o;++e){const o=n[e].split("="),i=decodeURIComponent(o[0]);let s=o[1];s=r.defined(s)?decodeURIComponent(s):"";const a=t[i];"string"==typeof a?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}return t}(i);t._queryParameters=n?Rn(s,t._queryParameters,o):s,e.search("")}function On(e,t){const n=t._queryParameters,o=Object.keys(n);1!==o.length||r.defined(n[o[0]])?e.search(function(e){let t="";for(const n in e)if(e.hasOwnProperty(n)){const r=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(let e=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;else t+=`${o+encodeURIComponent(r)}&`}return t=t.slice(0,-1),t}(n)):e.search(o[0])}function In(e,t){return r.defined(e)?r.defined(e.clone)?e.clone():Qt(e):t}function Pn(e){if(e.state===tn.ISSUED||e.state===tn.ACTIVE)throw new s.RuntimeError("The Resource is already being fetched.");e.state=tn.UNISSUED,e.deferred=void 0}function Rn(e,t,n){if(!n)return i.combine(e,t);const o=Qt(e,!0);for(const e in t)if(t.hasOwnProperty(e)){let n=o[e];const i=t[e];r.defined(n)?(Array.isArray(n)||(n=o[e]=[n]),o[e]=n.concat(i)):o[e]=Array.isArray(i)?i.slice():i}return o}function Tn(e){"string"==typeof(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=In(e.templateValues,{}),this._queryParameters=In(e.queryParameters,{}),this.headers=In(e.headers,{}),this.request=r.defaultValue(e.request,new rn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;const t=new Lt(e.url);En(t,this,!0,!0),t.fragment(""),this._url=t.toString()}let qn;function zn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);const r=Wt();return Tn._Implementations.createImage(s,e,r,n,o,i),r.promise};const a=yn.request(s);if(r.defined(a))return a.catch((function(e){return s.state!==tn.FAILED?Promise.reject(e):t.retryOnError(e).then((function(r){return r?(s.state=tn.UNISSUED,s.deferred=void 0,zn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(e)}))}))}function Mn(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request;i.url=e.url,i.requestFunction=function(){const t=Wt();return window[n]=function(e){t.resolve(e);try{delete window[n]}catch(e){window[n]=void 0}},Tn._Implementations.loadAndExecuteScript(e.url,n,t),t.promise};const s=yn.request(i);if(r.defined(s))return s.catch((function(r){return i.state!==tn.FAILED?Promise.reject(r):e.retryOnError(r).then((function(o){return o?(i.state=tn.UNISSUED,i.deferred=void 0,Mn(e,t,n)):Promise.reject(r)}))}))}Tn.createIfNeeded=function(e){return e instanceof Tn?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Tn({url:e})},Tn.supportsImageBitmapOptions=function(){if(r.defined(qn))return qn;if("function"!=typeof createImageBitmap)return qn=Promise.resolve(!1),qn;return qn=Tn.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){return Promise.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){const t=Zt(e[0]),n=Zt(e[1]);return t[1]!==n[1]})).catch((function(){return!1})),qn},Object.defineProperties(Tn,{isBlobSupported:{get:function(){return An}}}),Object.defineProperties(Tn.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){const t=new Lt(e);En(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){return function(e){const t=new Lt(e);t.normalize();let n=t.path(),r=n.lastIndexOf("/");return-1!==r&&(n=n.substr(r+1)),r=n.lastIndexOf("."),n=-1===r?"":n.substr(r+1),n}(this._url)}},isDataUri:{get:function(){return en(this._url)}},isBlobUri:{get:function(){return Xt(this._url)}},isCrossOriginUrl:{get:function(){return function(e){r.defined(Gt)||(Gt=document.createElement("a")),Gt.href=window.location.href;const t=Gt.host,n=Gt.protocol;return Gt.href=e,Gt.href=Gt.href,n!==Gt.protocol||t!==Gt.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),Tn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},Tn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const n=new Lt(this._url);e&&On(n,this);let o=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return o=o.replace(/{(.*?)}/g,(function(e,t){const n=i[t];return r.defined(n)?encodeURIComponent(n):e})),t&&r.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},Tn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Rn(this._queryParameters,e,!1):Rn(e,this._queryParameters,!1)},Tn.prototype.appendQueryParameters=function(e){this._queryParameters=Rn(e,this._queryParameters,!0)},Tn.prototype.setTemplateValues=function(e,t){this._templateValues=t?i.combine(this._templateValues,e):i.combine(e,this._templateValues)},Tn.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,r.defined(e.url)){const n=new Lt(e.url);En(n,t,!0,r.defaultValue(e.preserveQueryParameters,!1)),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new Lt(Ht(this._url))).toString()}return r.defined(e.queryParameters)&&(t._queryParameters=i.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=i.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=i.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},Tn.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},Tn.prototype.clone=function(e){return r.defined(e)||(e=new Tn({url:this._url})),e._url=this._url,e._queryParameters=Qt(this._queryParameters),e._templateValues=Qt(this._templateValues),e.headers=Qt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Tn.prototype.getBaseUri=function(e){return function(e,t){let n="";const r=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=new Lt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},Tn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},Tn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Tn.fetchArrayBuffer=function(e){return new Tn(e).fetchArrayBuffer()},Tn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Tn.fetchBlob=function(e){return new Tn(e).fetchBlob()},Tn.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);const t=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(Pn(this.request),!An||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return zn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!r.defined(s))return;let a,u,c,l;return Tn.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return Tn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new Tn({url:t}),zn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){return r.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},Tn.fetchImage=function(e){return new Tn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Tn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Tn.fetchText=function(e){return new Tn(e).fetchText()},Tn.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))return e.then((function(e){if(r.defined(e))return JSON.parse(e)}))},Tn.fetchJson=function(e){return new Tn(e).fetchJson()},Tn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Tn.fetchXML=function(e){return new Tn(e).fetchXML()},Tn.prototype.fetchJsonp=function(e){let t;e=r.defaultValue(e,"callback"),Pn(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));return Mn(this,e,t)},Tn.fetchJsonp=function(e){return new Tn(e).fetchJsonp(e.callbackParameterName)},Tn.prototype._makeRequest=function(e){const t=this;Pn(t.request);const n=t.request;n.url=t.url,n.requestFunction=function(){const o=e.responseType,s=i.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=Wt(),d=Tn._Implementations.loadWithXhr(t.url,o,u,c,s,l,a);return r.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};const o=yn.request(n);if(r.defined(o))return o.then((function(e){return console.log("data",e),n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==tn.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=tn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const Dn=/^data:(.*?)(;base64)?,(.*)$/;function Un(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function kn(e,t){const n=Un(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let e=0;e<n.length;e++)o[e]=n.charCodeAt(e);return r}function Fn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Tn.prototype.fetch=function(e){return(e=In(e,{})).method="GET",this._makeRequest(e)},Tn.fetch=function(e){return new Tn(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.delete=function(e){return(e=In(e,{})).method="DELETE",this._makeRequest(e)},Tn.delete=function(e){return new Tn(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Tn.prototype.head=function(e){return(e=In(e,{})).method="HEAD",this._makeRequest(e)},Tn.head=function(e){return new Tn(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.options=function(e){return(e=In(e,{})).method="OPTIONS",this._makeRequest(e)},Tn.options=function(e){return new Tn(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.post=function(e,t){return d.defined("data",e),(t=In(t,{})).method="POST",t.data=e,this._makeRequest(t)},Tn.post=function(e){return new Tn(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.put=function(e,t){return d.defined("data",e),(t=In(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Tn.put=function(e){return new Tn(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn.prototype.patch=function(e,t){return d.defined("data",e),(t=In(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Tn.patch=function(e){return new Tn(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Tn._Implementations={},Tn._Implementations.loadImageElement=function(e,t,n){const r=new Image;r.onload=function(){0===r.naturalWidth&&0===r.naturalHeight&&0===r.width&&0===r.height&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(Sn.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},Tn._Implementations.createImage=function(e,t,n,o,i,a){const u=e.url;Tn.supportsImageBitmapOptions().then((function(c){if(!c||!a)return void Tn._Implementations.loadImageElement(u,t,n);const l=Wt(),d=Tn._Implementations.loadWithXhr(u,"blob","GET",void 0,void 0,l,void 0,void 0,void 0);return r.defined(d)&&r.defined(d.abort)&&(e.cancelFunction=function(){d.abort()}),l.promise.then((function(e){if(r.defined(e))return Tn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});n.reject(new s.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then((function(e){n.resolve(e)}))})).catch((function(e){n.reject(e)}))},Tn.createImageBitmapFromBlob=function(e,t){return d.defined("options",t),d.typeOf.bool("options.flipY",t.flipY),d.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),d.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};const Nn="undefined"==typeof XMLHttpRequest;function jn(e){if(e=r.defaultValue(e,r.defaultValue.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._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data))Vn(this,e.data);else if(r.defined(e.url)){const t=Tn.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then((function(e){Vn(n,e)})).catch((function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`}))}else Vn(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function Bn(e,t){return qt.compare(e.julianDate,t)}function Vn(e,t){if(!r.defined(t.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||a<0||u<0||c<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const l=e._samples=t.samples,d=e._dates=[];let f;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;const p=e._addNewLeapSeconds;for(let t=0,o=l.length;t<o;t+=e._columnCount){const e=l[t+n],o=l[t+c],i=new qt(e+pt.MODIFIED_JULIAN_DATE_DIFFERENCE,o,ht.TAI);if(d.push(i),p){if(o!==f&&r.defined(f)){const e=qt.leapSeconds,t=ut(e,i,Bn);if(t<0){const n=new ft(i,o);e.splice(~t,0,n)}}f=o}}}function $n(e,t,n,r,o){const i=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function Ln(e,t,n){return t+e*(n-t)}function Qn(e,t,n,r,o,i,s){const a=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return $n(e,n,o,a,s),s;if(r.equals(c))return $n(e,n,i,a,s),s;const l=qt.secondsDifference(r,u)/qt.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=Ln(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=Ln(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Ln(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Ln(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Ln(l,p,h),s}function Wn(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}Tn._Implementations.loadWithXhr=function(t,n,o,i,u,c,l){const d=Dn.exec(t);if(null!==d)return void c.resolve(function(e,t){t=r.defaultValue(t,"");const n=e[1],o=!!e[2],i=e[3];let s,a;switch(t){case"":case"text":return Un(o,i);case"arraybuffer":return kn(o,i);case"blob":return s=kn(o,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(Un(o,i),n);case"json":return JSON.parse(Un(o,i))}}(d,n));if(Nn)return void function(t,n,r,o,i,u){let c,l;Promise.all([new Promise((function(t,n){e(["url"],(function(e){t(a(e))}),n)})),new Promise((function(t,n){e(["zlib"],(function(e){t(a(e))}),n)}))]).then((([n,r])=>(c=n.parse(t),l=r,"https:"===c.protocol?new Promise((function(t,n){e(["https"],(function(e){t(a(e))}),n)})):new Promise((function(t,n){e(["http"],(function(e){t(a(e))}),n)}))))).then((e=>{const t={protocol:c.protocol,hostname:c.hostname,port:c.port,path:c.path,query:c.query,method:r,headers:i};e.request(t).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void u.reject(new on(e.statusCode,e,e.headers));const t=[];e.on("data",(function(e){t.push(e)})),e.on("end",(function(){const r=Buffer.concat(t);"gzip"===e.headers["content-encoding"]?l.gunzip(r,(function(e,t){e?u.reject(new s.RuntimeError("Error decompressing response.")):u.resolve(Fn(t,n))})):u.resolve(Fn(r,n))}))})).on("error",(function(e){u.reject(new on)})).end()}))}(t,n,o,0,u,c);const f=new XMLHttpRequest;if(Sn.contains(t)&&(f.withCredentials=!0),f.open(o,t,!0),r.defined(l)&&r.defined(f.overrideMimeType)&&f.overrideMimeType(l),r.defined(u))for(const e in u)u.hasOwnProperty(e)&&f.setRequestHeader(e,u[e]);r.defined(n)&&(f.responseType=n);let p=!1;return"string"==typeof t&&(p=0===t.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),f.onload=function(){if((f.status<200||f.status>=300)&&(!p||0!==f.status))return void c.reject(new on(f.status,f.response,f.getAllResponseHeaders()));const e=f.response,t=f.responseType;if("HEAD"===o||"OPTIONS"===o){const e=f.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void c.resolve(t)}if(204===f.status)c.resolve();else if(!r.defined(e)||r.defined(n)&&t!==n)if("json"===n&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===t||"document"===t)&&r.defined(f.responseXML)&&f.responseXML.hasChildNodes()?c.resolve(f.responseXML):""!==t&&"text"!==t||!r.defined(f.responseText)?c.reject(new s.RuntimeError("Invalid XMLHttpRequest response type.")):c.resolve(f.responseText);else c.resolve(e)},f.onerror=function(e){c.reject(new on)},f.send(i),f},Tn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise(((e,n)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),e()},t.onerror=function(e){n(e)},r.appendChild(t)}))}(e).catch((function(e){n.reject(e)}))},Tn._DefaultImplementations={},Tn._DefaultImplementations.createImage=Tn._Implementations.createImage,Tn._DefaultImplementations.loadWithXhr=Tn._Implementations.loadWithXhr,Tn._DefaultImplementations.loadAndExecuteScript=Tn._Implementations.loadAndExecuteScript,Tn.DEFAULT=Object.freeze(new Tn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),jn.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.resolve()},compute:function(e,t){return r.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ct(0,0,0,0,0),t}}),jn.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)},jn.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))throw new s.RuntimeError(this._dataError);return}if(r.defined(t)||(t=new ct(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,o=this._lastIndex;let i=0,a=0;if(r.defined(o)){const s=n[o],u=n[o+1],c=qt.lessThanOrEquals(s,e),l=!r.defined(u),d=l||qt.greaterThanOrEquals(u,e);if(c&&d)return i=o,!l&&u.equals(e)&&++i,a=i+1,Qn(this,n,this._samples,e,i,a,t),t}let u=ut(n,e,qt.compare,this._dateColumn);return u>=0?(u<n.length-1&&n[u+1].equals(e)&&++u,i=u,a=u):(a=~u,i=a-1,i<0&&(i=0)),this._lastIndex=i,Qn(this,n,this._samples,e,i,a,t),t},Wn.fromQuaternion=function(e,t){r.defined(t)||(t=new Wn);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),s=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(u,a),t.roll=Math.atan2(s,i),t.pitch=-o.CesiumMath.asinClamped(n),t},Wn.fromDegrees=function(e,t,n,i){return r.defined(i)||(i=new Wn),i.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,i.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,i.roll=n*o.CesiumMath.RADIANS_PER_DEGREE,i},Wn.clone=function(e,t){if(r.defined(e))return r.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Wn(e.heading,e.pitch,e.roll)},Wn.equals=function(e,t){return e===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},Wn.equalsEpsilon=function(e,t,n,i){return e===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},Wn.prototype.clone=function(e){return Wn.clone(this,e)},Wn.prototype.equals=function(e){return Wn.equals(this,e)},Wn.prototype.equalsEpsilon=function(e,t,n){return Wn.equalsEpsilon(this,e,t,n)},Wn.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Hn=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;let Yn,Zn,Jn;function Xn(e){return"undefined"==typeof document?e:(r.defined(Yn)||(Yn=document.createElement("a")),Yn.href=e,Yn.href=Yn.href,Yn.href)}function Gn(){if(r.defined(Zn))return Zn;let t;return t="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?Ht("..",tr("Core/buildModuleUrl.js")):function(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const n=e[t].getAttribute("src"),r=Hn.exec(n);if(null!==r)return r[1]}}(),Zn=new Tn({url:Xn(t)}),Zn.appendForwardSlash(),Zn}function Kn(t){return Xn(e.toUrl(`../${t}`))}function er(e){return Gn().getDerivedResource({url:e}).url}function tr(t){r.defined(Jn)||(Jn="object"==typeof define&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(e.toUrl)?Kn:er);return Jn(t)}function nr(e,t,n){this.x=e,this.y=t,this.s=n}function rr(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=Tn.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new qt(this._sampleZeroJulianEphemerisDate,0,ht.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){n[e]=i,o[e]=e*this._stepSizeDays;for(let r=0;r<=t;++r)r!==e&&(n[e]*=e-r);n[e]=1/n[e]}this._work=new Array(t+1),this._coef=new Array(t+1)}tr._cesiumScriptRegex=Hn,tr._buildModuleUrlFromBaseUrl=er,tr._clearBaseResource=function(){Zn=void 0},tr.setBaseUrl=function(e){Zn=Tn.DEFAULT.getDerivedResource({url:e})},tr.getCesiumBaseUrl=Gn;const or=new qt(0,0,ht.TAI);function ir(e,t,n){const r=or;return r.dayNumber=t,r.secondsOfDay=n,qt.daysDifference(r,e._sampleZeroDateTT)}function sr(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const o=e._xysFileUrlTemplate;n=r.defined(o)?o.getDerivedResource({templateValues:{0:t}}):new Tn({url:tr(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const i=n.fetchJson().then((function(n){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,o=n.samples,i=t*e._samplesPerXysFile*3;for(let e=0,t=o.length;e<t;++e)r[i+e]=o[e]}));return e._chunkDownloadsInProgress[t]=i,i}rr.prototype.preload=function(e,t,n,r){const o=ir(this,e,t),i=ir(this,n,r);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=i/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let e=u;e<=c;++e)l.push(sr(this,e));return Promise.all(l)},rr.prototype.computeXysRadians=function(e,t,n){const o=ir(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(r.defined(l[3*a])||(sr(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(sr(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=new nr(0,0,0);const d=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const ar={},ur={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"}},cr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},lr={},dr={east:new n.Cartesian3,north:new n.Cartesian3,up:new n.Cartesian3,west:new n.Cartesian3,south:new n.Cartesian3,down:new n.Cartesian3};let fr=new n.Cartesian3,pr=new n.Cartesian3,hr=new n.Cartesian3;ar.localFrameToFixedFrameGenerator=function(e,t){if(!ur.hasOwnProperty(e)||!ur[e].hasOwnProperty(t))throw new u("firstAxis and secondAxis must be east, north, up, west, south or down.");const i=ur[e][t];let s;const a=e+t;return r.defined(lr[a])?s=lr[a]:(s=function(s,a,u){if(r.defined(u)||(u=new n.Matrix4),n.Cartesian3.equalsEpsilon(s,n.Cartesian3.ZERO,o.CesiumMath.EPSILON14))n.Cartesian3.unpack(cr[e],0,fr),n.Cartesian3.unpack(cr[t],0,pr),n.Cartesian3.unpack(cr[i],0,hr);else if(o.CesiumMath.equalsEpsilon(s.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(s.y,0,o.CesiumMath.EPSILON14)){const r=o.CesiumMath.sign(s.z);n.Cartesian3.unpack(cr[e],0,fr),"east"!==e&&"west"!==e&&n.Cartesian3.multiplyByScalar(fr,r,fr),n.Cartesian3.unpack(cr[t],0,pr),"east"!==t&&"west"!==t&&n.Cartesian3.multiplyByScalar(pr,r,pr),n.Cartesian3.unpack(cr[i],0,hr),"east"!==i&&"west"!==i&&n.Cartesian3.multiplyByScalar(hr,r,hr)}else{(a=r.defaultValue(a,n.Ellipsoid.WGS84)).geodeticSurfaceNormal(s,dr.up);const o=dr.up,u=dr.east;u.x=-s.y,u.y=s.x,u.z=0,n.Cartesian3.normalize(u,dr.east),n.Cartesian3.cross(o,u,dr.north),n.Cartesian3.multiplyByScalar(dr.up,-1,dr.down),n.Cartesian3.multiplyByScalar(dr.east,-1,dr.west),n.Cartesian3.multiplyByScalar(dr.north,-1,dr.south),fr=dr[e],pr=dr[t],hr=dr[i]}return u[0]=fr.x,u[1]=fr.y,u[2]=fr.z,u[3]=0,u[4]=pr.x,u[5]=pr.y,u[6]=pr.z,u[7]=0,u[8]=hr.x,u[9]=hr.y,u[10]=hr.z,u[11]=0,u[12]=s.x,u[13]=s.y,u[14]=s.z,u[15]=1,u},lr[a]=s),s},ar.eastNorthUpToFixedFrame=ar.localFrameToFixedFrameGenerator("east","north"),ar.northEastDownToFixedFrame=ar.localFrameToFixedFrameGenerator("north","east"),ar.northUpEastToFixedFrame=ar.localFrameToFixedFrameGenerator("north","up"),ar.northWestUpToFixedFrame=ar.localFrameToFixedFrameGenerator("north","west");const mr=new De,gr=new n.Cartesian3(1,1,1),yr=new n.Matrix4;ar.headingPitchRollToFixedFrame=function(e,t,o,i,s){i=r.defaultValue(i,ar.eastNorthUpToFixedFrame);const a=De.fromHeadingPitchRoll(t,mr),u=n.Matrix4.fromTranslationQuaternionRotationScale(n.Cartesian3.ZERO,a,gr,yr);return s=i(e,o,s),n.Matrix4.multiply(s,u,s)};const vr=new n.Matrix4,wr=new n.Matrix3;ar.headingPitchRollQuaternion=function(e,t,r,o,i){const s=ar.headingPitchRollToFixedFrame(e,t,r,o,vr),a=n.Matrix4.getMatrix3(s,wr);return De.fromRotationMatrix(a,i)};const _r=new n.Cartesian3(1,1,1),Cr=new n.Cartesian3,br=new n.Matrix4,xr=new n.Matrix4,Sr=new n.Matrix3,Ar=new De;ar.fixedFrameToHeadingPitchRoll=function(e,t,o,i){t=r.defaultValue(t,n.Ellipsoid.WGS84),o=r.defaultValue(o,ar.eastNorthUpToFixedFrame),r.defined(i)||(i=new Wn);const s=n.Matrix4.getTranslation(e,Cr);if(n.Cartesian3.equals(s,n.Cartesian3.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let a=n.Matrix4.inverseTransformation(o(s,t,br),br),u=n.Matrix4.setScale(e,_r,xr);u=n.Matrix4.setTranslation(u,n.Cartesian3.ZERO,u),a=n.Matrix4.multiply(a,u,a);let c=De.fromRotationMatrix(n.Matrix4.getMatrix3(a,Sr),Ar);return c=De.normalize(c,c),Wn.fromQuaternion(c,i)};const Er=o.CesiumMath.TWO_PI/86400;let Or=new qt;ar.computeTemeToPseudoFixedMatrix=function(e,t){Or=qt.addSeconds(e,-qt.computeTaiMinusUtc(e),Or);const i=Or.dayNumber,s=Or.secondsOfDay;let a;const u=i-2451545;a=s>=43200?(u+.5)/pt.DAYS_PER_JULIAN_CENTURY:(u-.5)/pt.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*Er%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*pt.SECONDS_PER_DAY)%pt.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return r.defined(t)?(t[0]=l,t[1]=-d,t[2]=0,t[3]=d,t[4]=l,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new n.Matrix3(l,d,0,-d,l,0,0,0,1)},ar.iau2006XysData=new rr,ar.earthOrientationParameters=jn.NONE;const Ir=32.184;ar.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+Ir,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Ir,i=ar.iau2006XysData.preload(t,n,r,o),s=ar.earthOrientationParameters.getPromiseToLoad();return Promise.all([i,s])},ar.computeIcrfToFixedMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const o=ar.computeFixedToIcrfMatrix(e,t);if(r.defined(o))return n.Matrix3.transpose(o,t)};const Pr=new nr(0,0,0),Rr=new ct(0,0,0,0,0),Tr=new n.Matrix3,qr=new n.Matrix3;ar.computeFixedToIcrfMatrix=function(e,t){r.defined(t)||(t=new n.Matrix3);const i=ar.earthOrientationParameters.compute(e,Rr);if(!r.defined(i))return;const s=e.dayNumber,a=e.secondsOfDay+Ir,u=ar.iau2006XysData.computeXysRadians(s,a,Pr);if(!r.defined(u))return;const c=u.x+i.xPoleOffset,l=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=Tr;f[0]=1-d*c*c,f[3]=-d*c*l,f[6]=c,f[1]=-d*c*l,f[4]=1-d*l*l,f[7]=l,f[2]=-c,f[5]=-l,f[8]=1-d*(c*c+l*l);const p=n.Matrix3.fromRotationZ(-u.s,qr),h=n.Matrix3.multiply(f,p,Tr),m=e.dayNumber-2451545,g=(e.secondsOfDay-qt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/pt.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;const v=n.Matrix3.fromRotationZ(y,qr),w=n.Matrix3.multiply(h,v,Tr),_=Math.cos(i.xPoleWander),C=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);let S=s-2451545+a/pt.SECONDS_PER_DAY;S/=36525;const A=-47e-6*S*o.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=qr;return I[0]=_*E,I[1]=_*O,I[2]=b,I[3]=-C*O+x*b*E,I[4]=C*E+x*b*O,I[5]=-x*_,I[6]=-x*O-C*b*E,I[7]=x*E-C*b*O,I[8]=C*_,n.Matrix3.multiply(w,I,t)};const zr=new n.Cartesian4;ar.pointToWindowCoordinates=function(e,t,n,r){return(r=ar.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},ar.pointToGLWindowCoordinates=function(e,t,o,i){r.defined(i)||(i=new n.Cartesian2);const s=zr;return n.Matrix4.multiplyByVector(e,n.Cartesian4.fromElements(o.x,o.y,o.z,1,s),s),n.Cartesian4.multiplyByScalar(s,1/s.w,s),n.Matrix4.multiplyByVector(t,s,s),n.Cartesian2.fromCartesian4(s,i)};const Mr=new n.Cartesian3,Dr=new n.Cartesian3,Ur=new n.Cartesian3;ar.rotationMatrixFromPositionVelocity=function(e,t,i,s){const a=r.defaultValue(i,n.Ellipsoid.WGS84).geodeticSurfaceNormal(e,Mr);let u=n.Cartesian3.cross(t,a,Dr);n.Cartesian3.equalsEpsilon(u,n.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=n.Cartesian3.clone(n.Cartesian3.UNIT_X,u));const c=n.Cartesian3.cross(u,t,Ur);return n.Cartesian3.normalize(c,c),n.Cartesian3.cross(t,c,u),n.Cartesian3.negate(u,u),n.Cartesian3.normalize(u,u),r.defined(s)||(s=new n.Matrix3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=u.x,s[4]=u.y,s[5]=u.z,s[6]=c.x,s[7]=c.y,s[8]=c.z,s};const kr=new n.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Fr=new n.Cartographic,Nr=new n.Cartesian3,jr=new n.Cartesian3,Br=new n.Matrix3,Vr=new n.Matrix4,$r=new n.Matrix4;ar.basisTo2D=function(e,t,r){const o=n.Matrix4.getTranslation(t,jr),i=e.ellipsoid,s=i.cartesianToCartographic(o,Fr),a=e.project(s,Nr);n.Cartesian3.fromElements(a.z,a.x,a.y,a);const u=ar.eastNorthUpToFixedFrame(o,i,Vr),c=n.Matrix4.inverseTransformation(u,$r),l=n.Matrix4.getMatrix3(t,Br),d=n.Matrix4.multiplyByMatrix3(c,l,r);return n.Matrix4.multiply(kr,d,r),n.Matrix4.setTranslation(r,a,r),r},ar.wgs84To2DModelMatrix=function(e,t,r){const o=e.ellipsoid,i=ar.eastNorthUpToFixedFrame(t,o,Vr),s=n.Matrix4.inverseTransformation(i,$r),a=o.cartesianToCartographic(t,Fr),u=e.project(a,Nr);n.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=n.Matrix4.fromTranslation(u,Vr);return n.Matrix4.multiply(kr,s,r),n.Matrix4.multiply(c,r,r),r};var Lr=ar;t.BoundingSphere=g,t.DeveloperError=u,t.FeatureDetection=Me,t.GeographicProjection=p,t.Intersect=h,t.Interval=m,t.Quaternion=De,t.Resource=Tn,t.Transforms=Lr,t.buildModuleUrl=tr})); diff --git a/src/renderer/public/sdk/Cesium/Workers/WallGeometryLibrary-257a069c.js b/src/renderer/public/sdk/Cesium/Workers/WallGeometryLibrary-257a069c.js deleted file mode 100644 index cc27254..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/WallGeometryLibrary-257a069c.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.98 - * - * 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. - */ -define(["exports","./arrayRemoveDuplicates-fd3a3f4e","./Matrix2-cf4c6e69","./defaultValue-50f7432c","./ComponentDatatype-9b23164a","./PolylinePipeline-b69fdb1d"],(function(e,t,i,n,o,r){"use strict";const a={};function s(e,t){return o.CesiumMath.equalsEpsilon(e.latitude,t.latitude,o.CesiumMath.EPSILON10)&&o.CesiumMath.equalsEpsilon(e.longitude,t.longitude,o.CesiumMath.EPSILON10)}const l=new i.Cartographic,h=new i.Cartographic;const c=new Array(2),g=new Array(2),u={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};a.computePositions=function(e,a,p,d,f,y){const m=function(e,o,r,a){const c=(o=t.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon)).length;if(c<2)return;const g=n.defined(a),u=n.defined(r),p=new Array(c),d=new Array(c),f=new Array(c),y=o[0];p[0]=y;const m=e.cartesianToCartographic(y,l);u&&(m.height=r[0]),d[0]=m.height,f[0]=g?a[0]:0;let P=d[0]===f[0],A=1;for(let t=1;t<c;++t){const n=o[t],l=e.cartesianToCartographic(n,h);u&&(l.height=r[t]),P=P&&0===l.height,s(m,l)?m.height<l.height&&(d[A-1]=l.height):(p[A]=n,d[A]=l.height,f[A]=g?a[t]:0,P=P&&d[A]===f[A],i.Cartographic.clone(l,m),++A)}return P||A<2?void 0:(p.length=A,d.length=A,f.length=A,{positions:p,topHeights:d,bottomHeights:f})}(e,a,p,d);if(!n.defined(m))return;a=m.positions,p=m.topHeights,d=m.bottomHeights;const P=a.length,A=P-2;let C,w;const b=o.CesiumMath.chordLength(f,e.maximumRadius),v=u;if(v.minDistance=b,v.ellipsoid=e,y){let e,t=0;for(e=0;e<P-1;e++)t+=r.PolylinePipeline.numberOfPoints(a[e],a[e+1],b)+1;C=new Float64Array(3*t),w=new Float64Array(3*t);const i=c,n=g;v.positions=i,v.height=n;let o=0;for(e=0;e<P-1;e++){i[0]=a[e],i[1]=a[e+1],n[0]=p[e],n[1]=p[e+1];const t=r.PolylinePipeline.generateArc(v);C.set(t,o),n[0]=d[e],n[1]=d[e+1],w.set(r.PolylinePipeline.generateArc(v),o),o+=t.length}}else v.positions=a,v.height=p,C=new Float64Array(r.PolylinePipeline.generateArc(v)),v.height=d,w=new Float64Array(r.PolylinePipeline.generateArc(v));return{bottomPositions:w,topPositions:C,numCorners:A}};var p=a;e.WallGeometryLibrary=p})); diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-255CHCZV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-255CHCZV.js deleted file mode 100644 index 0f27cb5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-255CHCZV.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,console.log("11111",Cesium),Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return console.log("22222",Cesium),Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-27YZQBV6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-27YZQBV6.js deleted file mode 100644 index c2d080b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-27YZQBV6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-QJHUWGM2.js";import{a as I}from"./chunk-HZEX5MXO.js";import{b as B,c as G,d as k}from"./chunk-T4N45YIS.js";import{b as j,h as X}from"./chunk-NPMNTDSM.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2GI3PW2M.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2GI3PW2M.js deleted file mode 100644 index fcaebc6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2GI3PW2M.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-Z3X57746.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2H7KDC2A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2H7KDC2A.js deleted file mode 100644 index 5a90b5b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2H7KDC2A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-QWQ7HFAB.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-RDJ4UYGG.js";import{a as V,d as y}from"./chunk-FXULDDZU.js";import{b as G}from"./chunk-Z3X57746.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2K5M4ZYE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2K5M4ZYE.js deleted file mode 100644 index a41e2d3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2K5M4ZYE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-A24L4QN2.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2NLWVZKG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2NLWVZKG.js deleted file mode 100644 index 8f26a63..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2NLWVZKG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-SGSO4PDT.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-34GCBYYX.js";import{d as E}from"./chunk-CCZ6XI6A.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2O22COAB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2O22COAB.js deleted file mode 100644 index 013c543..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2O22COAB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-4647PJA5.js";import{a as U}from"./chunk-DNPSKORP.js";import{f as I}from"./chunk-H6HCBMP2.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2P4SA4ZJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2P4SA4ZJ.js deleted file mode 100644 index a00a5ad..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2P4SA4ZJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-A4L3VMPJ.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2PCKFVTE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2PCKFVTE.js deleted file mode 100644 index 7022b9c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2PCKFVTE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-S765I756.js";import{a as I}from"./chunk-Y7Y54VVF.js";import{b as B,c as G,d as k}from"./chunk-QMTXW4VP.js";import{b as j,h as X}from"./chunk-H6HCBMP2.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2SHIVLQV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2SHIVLQV.js deleted file mode 100644 index a7f37b9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2SHIVLQV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y,b as P,d as B}from"./chunk-MGW7GK6C.js";import{a as L}from"./chunk-WFYQVCMU.js";import{b as q}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";function X(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,f=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-f)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,M=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,u=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,d=1-3*c+35*o/4,g=1-5*c,w=u*M-C*Math.sin(2*M)*c/2-d*Math.sin(4*M)*o/16-g*Math.sin(6*M)*h/48-Math.sin(8*M)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=f,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=M,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=u,s.a1=C,s.a2=d,s.a3=g,s.distanceRatio=w}function Y(n,a){return n*a*(4+n*(4-3*a))/16}function k(n,a,t,e,f,m,_){let r=Y(n,t);return(1-r)*n*a*(e+r*f*(_+r*m*(2*_*_-1)))}function Z(n,a,t,e,f,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(f)),M=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(M),A=Math.sin(M),c=l*i,o=l*A,h=U*A,S=U*i,u=p,C=L.TWO_PI,d=Math.cos(u),g=Math.sin(u),w,s,O,H,b;do{d=Math.cos(u),g=Math.sin(u);let z=o-S*d;O=Math.sqrt(i*i*g*g+z*z),s=h+c*d,w=Math.atan2(O,s);let D;O===0?(D=0,H=1):(D=c*g/O,H=1-D*D),C=u,b=s-2*h/H,isFinite(b)||(b=0),u=p+k(r,D,H,w,O,s,b)}while(Math.abs(u-C)>L.EPSILON12);let v=H*(a*a-t*t)/(t*t),W=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,J=I*O*(b+I*(s*(2*F-1)-I*b*(4*O*O-3)*(4*F-3)/6)/4),K=t*W*(w-J),Q=Math.atan2(i*g,o-S*d),V=Math.atan2(l*g,o*d-S);n._distance=K,n._startHeading=Q,n._endHeading=V,n._uSquared=v}var $=new y,x=new y;function N(n,a,t,e){let f=y.normalize(e.cartographicToCartesian(a,x),$),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(f,m))-Math.PI),.0125),Z(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=P.clone(a,n._start),n._end=P.clone(t,n._end),n._start.height=0,n._end.height=0,X(n)}function E(n,a,t){let e=t??B.default;this._ellipsoid=e,this._start=new P,this._end=new P,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,T(n)&&T(a)&&N(this,n,a,e)}Object.defineProperties(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});E.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),N(this,n,a,this._ellipsoid)};E.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};E.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,f=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),M=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*f/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*f-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*M/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),u=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),d=Math.sin(h),g=Math.cos(h),w=t.cosineU*g,s=t.sineU*d,H=Math.atan2(d*t.sineHeading,w-s*t.cosineHeading)-k(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,d,g,C);return T(a)?(a.longitude=this._start.longitude+H,a.latitude=u,a.height=0,a):new P(this._start.longitude+H,u,0)};var et=E;export{et as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2T3YAWDY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2T3YAWDY.js deleted file mode 100644 index f810659..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2T3YAWDY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-GRWCOIDY.js";import{a as U}from"./chunk-UOX6KQJA.js";import{f as I}from"./chunk-A4L3VMPJ.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2VGJ4QVX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2VGJ4QVX.js deleted file mode 100644 index f3c4755..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2VGJ4QVX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-A3K2ZLIM.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-2XKPPEOJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-2XKPPEOJ.js deleted file mode 100644 index dc1382d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-2XKPPEOJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-I7G5IWDK.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-34GCBYYX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-34GCBYYX.js deleted file mode 100644 index 8375d1d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-34GCBYYX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-VPFNPTPP.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3EGXQTAL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3EGXQTAL.js deleted file mode 100644 index e391ef0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3EGXQTAL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-JQA4D4QZ.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3FUL4W2X.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3FUL4W2X.js deleted file mode 100644 index 9b538a9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3FUL4W2X.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-LFMGBZZM.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-CXINSY4K.js";import{a as V,d as y}from"./chunk-QMTXW4VP.js";import{b as G}from"./chunk-H6HCBMP2.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3HC265IM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3HC265IM.js deleted file mode 100644 index 4ebe4ea..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3HC265IM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-4KZEUE2E.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-NXRSA4OE.js";import{d as E}from"./chunk-YE4R2EE7.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3HQKTQKM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3HQKTQKM.js deleted file mode 100644 index a5138e2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3HQKTQKM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-GIDGP7AL.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-CXINSY4K.js";import{d as E}from"./chunk-QMTXW4VP.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3JZYPFLA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3JZYPFLA.js deleted file mode 100644 index 7a6a22d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3JZYPFLA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-FXKWBJNE.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3OFCT7WF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3OFCT7WF.js deleted file mode 100644 index 581052b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3OFCT7WF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-LYHCBQ5D.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-UC53JWAC.js";import{a as Et}from"./chunk-AMEMP742.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-5KD2FCJ5.js";import{a as _t,b as Ut,d as ot}from"./chunk-BSMSCZPP.js";import{a as pt,b as H}from"./chunk-AVM7XNMU.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3QAR24RW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3QAR24RW.js deleted file mode 100644 index 23693cd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3QAR24RW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-34GCBYYX.js";import{d as j}from"./chunk-CCZ6XI6A.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3R7YZYAU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3R7YZYAU.js deleted file mode 100644 index 2f5ec74..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3R7YZYAU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-76AWMMRZ.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3RCLXWWK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3RCLXWWK.js deleted file mode 100644 index 1b33f3a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3RCLXWWK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-WLRKMATH.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-3WQQGQIW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-3WQQGQIW.js deleted file mode 100644 index 86d3722..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-3WQQGQIW.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{e as f}from"./chunk-OVZZEY7C.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=` -${o}`),n}var i=c;function l(t){async function n({data:e}){let o=[],s={id:e.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=e.baseUrl;try{let r=await t(e.parameters,o);s.result=r}catch(r){r instanceof Error?s.error={name:r.name,message:r.message,stack:r.stack}:s.error=r}e.canTransferArrayBuffer||(o.length=0);try{postMessage(s,o)}catch(r){s.result=void 0,s.error=`postMessage failed with error: ${i(r)} - with responseMessage: ${JSON.stringify(s)}`,postMessage(s)}}function a(e){postMessage({id:e.data?.id,error:`postMessage failed with error: ${JSON.stringify(e)}`})}return self.onmessage=n,self.onmessageerror=a,self}var d=l;export{d as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-44VOGP6Y.js b/src/renderer/public/sdk/Cesium/Workers/chunk-44VOGP6Y.js deleted file mode 100644 index fe03ae3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-44VOGP6Y.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-KZM3XMI2.js";import{a as C}from"./chunk-JWULCKZP.js";import{b as L}from"./chunk-76AWMMRZ.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4647CB3P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4647CB3P.js deleted file mode 100644 index 74cca73..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4647CB3P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-LSPQJS2I.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-BBGWUPII.js";import{d as E}from"./chunk-HUYVXCIF.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4647PJA5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4647PJA5.js deleted file mode 100644 index ff82db0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4647PJA5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-DNPSKORP.js";import{a as te}from"./chunk-S765I756.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-H6HCBMP2.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4KTYBIT7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4KTYBIT7.js deleted file mode 100644 index cecff0b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4KTYBIT7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var e={NONE:0,GEODESIC:1,RHUMB:2},t=Object.freeze(e);export{t as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4KZEUE2E.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4KZEUE2E.js deleted file mode 100644 index 0178373..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4KZEUE2E.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-255CHCZV.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4LRCCZKQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4LRCCZKQ.js deleted file mode 100644 index 4a21f98..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4LRCCZKQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-NNNSDBCQ.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4STI2OZJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4STI2OZJ.js deleted file mode 100644 index 76e9354..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4STI2OZJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-A3K2ZLIM.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-4YKTCJME.js b/src/renderer/public/sdk/Cesium/Workers/chunk-4YKTCJME.js deleted file mode 100644 index 8cf104e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-4YKTCJME.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-MKGFLCRO.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5FLX3VRH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5FLX3VRH.js deleted file mode 100644 index 59e3cc2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5FLX3VRH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-65CSGAYD.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-JCBDR53F.js";import{a as Et}from"./chunk-65RJEMLK.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-A24L4QN2.js";import{a as _t,b as Ut,d as ot}from"./chunk-ZA6CVU2J.js";import{a as pt,b as H}from"./chunk-IU3JXFWW.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5FXAHZ5M.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5FXAHZ5M.js deleted file mode 100644 index 4f46a6b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5FXAHZ5M.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-QMTXW4VP.js";import{h as I,i as b}from"./chunk-H6HCBMP2.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5HZA7BMF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5HZA7BMF.js deleted file mode 100644 index 5841fe8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5HZA7BMF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-R4PUNGMZ.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-SGDQE7H4.js";import{d as E}from"./chunk-WHDDCNJ6.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5IUKPU5Q.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5IUKPU5Q.js deleted file mode 100644 index b4afab9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5IUKPU5Q.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var E={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},_=Object.freeze(E);export{_ as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5KD2FCJ5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5KD2FCJ5.js deleted file mode 100644 index c64758c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5KD2FCJ5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-AVM7XNMU.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5OLATPUE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5OLATPUE.js deleted file mode 100644 index 14124a8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5OLATPUE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-44VOGP6Y.js";import{a as te}from"./chunk-FUK4M7FE.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-76AWMMRZ.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5ULDHPPR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5ULDHPPR.js deleted file mode 100644 index ba36503..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5ULDHPPR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-O5YU7IER.js";import{a as C}from"./chunk-6Q5ALWJL.js";import{b as L}from"./chunk-255CHCZV.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5WBHPCVF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5WBHPCVF.js deleted file mode 100644 index 94be509..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5WBHPCVF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-QPZHRXZ6.js";import{d as L}from"./chunk-OZA4MN4W.js";import{b as d,h as W}from"./chunk-FXKWBJNE.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5WFJ6IXL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5WFJ6IXL.js deleted file mode 100644 index 3a01ada..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5WFJ6IXL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-UW34AHI2.js";import{a as u,b as d}from"./chunk-O5YU7IER.js";import{a as j}from"./chunk-6Q5ALWJL.js";import{a as _,b as h,g as A}from"./chunk-255CHCZV.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5XFO4WM3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5XFO4WM3.js deleted file mode 100644 index fe462fa..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5XFO4WM3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-OUVOIUY3.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5XN4HN24.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5XN4HN24.js deleted file mode 100644 index 9b44fc1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5XN4HN24.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-DNPSKORP.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5Y376J3P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5Y376J3P.js deleted file mode 100644 index 347e0ad..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5Y376J3P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-VMDPGM26.js";import{a as u,b as d}from"./chunk-AYSYNDKT.js";import{a as j}from"./chunk-2P4SA4ZJ.js";import{a as _,b as h,g as A}from"./chunk-A4L3VMPJ.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-5YRYTSRV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-5YRYTSRV.js deleted file mode 100644 index 52e2dd3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-5YRYTSRV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-KZU6RORI.js";import{d as j}from"./chunk-4YKTCJME.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-634EHAHA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-634EHAHA.js deleted file mode 100644 index 02f2189..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-634EHAHA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-AEEM7M2L.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-64BTZVEA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-64BTZVEA.js deleted file mode 100644 index e771d7f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-64BTZVEA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-BBGWUPII.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-65CSGAYD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-65CSGAYD.js deleted file mode 100644 index ccc0030..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-65CSGAYD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-IU3JXFWW.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-65O5AGVQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-65O5AGVQ.js deleted file mode 100644 index cf4b93c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-65O5AGVQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-A4L3VMPJ.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-65RJEMLK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-65RJEMLK.js deleted file mode 100644 index 1ad6652..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-65RJEMLK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-IU3JXFWW.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-65VSR2I4.js b/src/renderer/public/sdk/Cesium/Workers/chunk-65VSR2I4.js deleted file mode 100644 index ca425a5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-65VSR2I4.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-NBE2CPYA.js";import{a as C}from"./chunk-TMD5QYHK.js";import{b as L}from"./chunk-Z3X57746.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6G4YC4UJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6G4YC4UJ.js deleted file mode 100644 index 9167679..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6G4YC4UJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-NXQK7ZFF.js";import{a as U}from"./chunk-5ULDHPPR.js";import{f as I}from"./chunk-255CHCZV.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6JQLPYBQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6JQLPYBQ.js deleted file mode 100644 index 174155b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6JQLPYBQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-SGDQE7H4.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6K7MTBG7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6K7MTBG7.js deleted file mode 100644 index 19e9a98..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6K7MTBG7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-NNNSDBCQ.js";import{d as l}from"./chunk-T4N45YIS.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6KOEIIY6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6KOEIIY6.js deleted file mode 100644 index aa46ece..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6KOEIIY6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-WLRKMATH.js";import{d as H}from"./chunk-OZA4MN4W.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6Q5ALWJL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6Q5ALWJL.js deleted file mode 100644 index 8c7c400..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6Q5ALWJL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-255CHCZV.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6U7I2ZOL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6U7I2ZOL.js deleted file mode 100644 index 8ef7f85..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6U7I2ZOL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-ZAYZJA3R.js";import{d as H}from"./chunk-NJVZPI6A.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6UPZ5ZH3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6UPZ5ZH3.js deleted file mode 100644 index 80d46c9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6UPZ5ZH3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-KOARSSWM.js";import{a as Z,b as H}from"./chunk-DAECZ4MV.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-ZLGB7AC5.js";import{a as it}from"./chunk-QQ2JU7XK.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-KZU6RORI.js";import{f as K}from"./chunk-MKGFLCRO.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6YTTQEBY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6YTTQEBY.js deleted file mode 100644 index e20fb32..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6YTTQEBY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-WU6XDITA.js";import{a as U}from"./chunk-WHSFAWNA.js";import{f as I}from"./chunk-IU3JXFWW.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-6ZVBKUW7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-6ZVBKUW7.js deleted file mode 100644 index 78677e0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-6ZVBKUW7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-ZLGB7AC5.js";import{a as C}from"./chunk-QQ2JU7XK.js";import{b as L}from"./chunk-MKGFLCRO.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-72J3HP67.js b/src/renderer/public/sdk/Cesium/Workers/chunk-72J3HP67.js deleted file mode 100644 index 0f23673..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-72J3HP67.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-65O5AGVQ.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-ZAYZJA3R.js";import{d as E}from"./chunk-NJVZPI6A.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-76AWMMRZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-76AWMMRZ.js deleted file mode 100644 index 965e2a7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-76AWMMRZ.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as L,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Et,c as Tt,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Tt((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,B=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=B(z>>>10&1023|55296),z=56320|z&1023),D+=B(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(B(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(B(c(de+ft%je,0))),he=k(ft/je);V.push(B(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Tt((qn,Ut)=>{/*! - * 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 Ut=="object"&&Ut.exports?Ut.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Tt((Nn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Tt((Fn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,B=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=B("pathname",F[k]),r[k+"UrnPathSegment"]=B("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var Ct=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,Ct),j.magnitude(Ct)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,Ct),j.magnitudeSquared(Ct)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),B=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=B*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(L.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Bo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Lo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],B=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*B+w*Q+v*W,D=i*k+d*B+E*Q+I*W,Y=r*k+m*B+T*Q+N*W,re=s*k+l*B+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],B=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*B,y=i*F+u*k+l*B,O=r*F+d*k+w*B,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],B=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*B,c=i*F+u*k+l*B,f=r*F+d*k+w*B;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new L,$o=new L,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,B=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+B*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=B*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+B*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(B*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,B=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+B*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=B*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=B*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+B*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(L.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var vt=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new vt,At=[31,28,31,30,31,30,31,31,30,31,30,31],jt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Pt(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Pt(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof vt))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Pt(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Pt(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],B=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+B-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>At[i-1]||T&&i===2&&r>jt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],B=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-B;break;case"-":s=s+k,u=u+B;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?jt:At[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?jt:At[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?jt:At[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Pt(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Mt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Mt);p(o)||(U.addSeconds(e,-1,Mt),o=Un(Mt,Mt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new vt(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Bn(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Bn(i,t)),n[o]=i}return n}var nt=Bn;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Ln=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Ln.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var qt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Dt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function Nt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}Nt.prototype.cancel=function(){this.cancelled=!0};Nt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Nt(this)};var Kn=Nt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var kt=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new kt.default(document.location.href):new kt.default,Ft=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=Ft;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],Ft.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],Ft.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new kt.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Dt(e.url)||qt(e.url))return Ft.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",Ot;console.log("IndexedDB open",window);console.log("IndexedDB open2",indexedDB);var xt=window.indexedDB.open(Ir,1),qr=1024*1024*1024;var Es=qr*3;xt.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})};xt.onsuccess=function(e){Ot=e.target.result};xt.onerror=function(e){console.error("IndexedDB open error:",e.target.error)};function ao(e,t){if(!Ot)return;let o=Ot.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!Ot)n();else{let r=Ot.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},xt.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Dt(this._url)}},isBlobUri:{get:function(){return qt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=Dr(i.query());this._queryParameters=t?Lt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function Dr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Lt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Nr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Nr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Lt(this._queryParameters,e,!1):this._queryParameters=Lt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Lt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var kr=/^data:(.*?)(;base64)?,(.*)$/;function Bt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Bt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function Fr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Bt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Bt(o,i),n);case"json":return JSON.parse(Bt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function xr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var Br=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=kr.exec(e);if(u!==null){r.resolve(Fr(u,t));return}if(Br){xr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function _t(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_t.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new _t({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};_t.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});_t.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,B=Qe(k,F,Lr);if(B<0){let Q=new te(F,I);k.splice(~B,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function gt(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=gt(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=gt(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=gt(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=gt(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=gt(l,T,M),s}var bo=_t;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Qr(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Et.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Qr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Wr(e){return go(Et.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Et.toUrl)?$t=Wr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Hr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Hr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 $r=new ue(0,0,H.TAI);function pn(e,t,n){let o=$r;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var St=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);St=g.normalize(e,St);let r=St.x*i,s=St.y*i,u=St.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var Yr=[1,2,0],Vr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[L.COLUMN0ROW0],d=e[L.COLUMN1ROW1],m=e[L.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[L.COLUMN1ROW2]-e[L.COLUMN2ROW1])*n,i=(e[L.COLUMN2ROW0]-e[L.COLUMN0ROW2])*n,r=(e[L.COLUMN0ROW1]-e[L.COLUMN1ROW0])*n;else{let w=Yr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[L.getElementIndex(E,E)]-e[L.getElementIndex(T,T)]-e[L.getElementIndex(M,M)]+1);let v=Vr;v[E]=.5*n,n=.5/n,s=(e[L.getElementIndex(M,T)]-e[L.getElementIndex(T,M)])*n,v[T]=(e[L.getElementIndex(T,E)]+e[L.getElementIndex(E,T)])*n,v[M]=(e[L.getElementIndex(M,E)]+e[L.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Xr=new g,Zr=new g,Rt=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Rt);S.multiply(i,n,st);let r=S.log(st,Xr);S.multiply(i,e,st);let s=S.log(st,Zr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Rt),S.multiply(t,Rt,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Rt),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Jr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Jr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Rt),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Be=new g,Le=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Be),g.unpack(at[n],0,Le);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Be),t!=="east"&&t!=="west"&&g.multiplyByScalar(Be,d,Be),g.unpack(at[n],0,Le),n!=="east"&&n!=="west"&&g.multiplyByScalar(Le,d,Le)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Be=Oe[t],Le=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Be.x,u[5]=Be.y,u[6]=Be.z,u[7]=0,u[8]=Le.x,u[9]=Le.y,u[10]=Le.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Gr=new Xe,Kr=new g(1,1,1),ei=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Gr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Kr,ei);return i=o(e,n,i),J.multiply(i,s,i)};var ti=new J,ni=new L;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ti),s=J.getMatrix3(r,ni);return Xe.fromRotationMatrix(s,i)};var oi=new g(1,1,1),ri=new g,Po=new J,ii=new J,ci=new L,si=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,ri);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,oi,ii);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ci),si);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var ai=6*3600+41*60+50.54841,fi=8640184812866e-6,ui=.093104,pi=-62e-7,hi=11772758384668e-32,di=72921158553e-15,mi=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ai+i*(fi+i*(ui+i*pi)))*mi%R.TWO_PI,d=di+hi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new L(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,yi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return L.transpose(n,t)};var li=32.184,wi=2451545,Kt=new Wt,bi=new L,Oi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=ue.addSeconds(e,li,Oi),o=ue.totalDays(n)-wi,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),L.fromHeadingPitchRoll(Kt,bi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return L.transpose(n,t)};var gi=new Yt(0,0,0),_i=new ht(0,0,0,0,0,0),_n=new L,Sn=new L;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.earthOrientationParameters.compute(e,_i);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,gi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=L.fromRotationZ(-r.s,Sn),w=L.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=L.fromRotationZ(I,Sn),F=L.multiply(w,N,_n),k=Math.cos(n.xPoleWander),B=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-yi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-B*ne+W*Q*X,Z[4]=B*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-B*Q*X,Z[7]=W*X-B*Q*ne,Z[8]=B*k,L.multiply(F,Z,t)};var Si=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=Si;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Ri=new g,Ei=new g,Ti=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Ri),r=g.cross(t,i,Ei);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ti);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new L),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ci=new g,vi=new L,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ci),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,vi),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var Ai=new g,ji=new g,Mi=new g,Pi=new g,Ui=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,Ai),s=J.multiplyByPointAsVector(r,g.UNIT_X,ji);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Mi);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Ui),m=g.negate(s,Pi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var zi=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=zi;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var hf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var Ii=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var qi=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,qi),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var Di=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,Di);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Ni=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Ni);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var bf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,hf as h,bf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7BLPWQ26.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7BLPWQ26.js deleted file mode 100644 index 78c0bcc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7BLPWQ26.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-HUYVXCIF.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7D2EEZP6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7D2EEZP6.js deleted file mode 100644 index d29f5ef..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7D2EEZP6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-5FLX3VRH.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-A24L4QN2.js";import{a as V,d as y}from"./chunk-ZA6CVU2J.js";import{b as G}from"./chunk-IU3JXFWW.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7HNQTPZY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7HNQTPZY.js deleted file mode 100644 index 325e9d9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7HNQTPZY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-NQPD6VVH.js";import{a as I}from"./chunk-PP2DTLZK.js";import{b as B,c as G,d as k}from"./chunk-HUYVXCIF.js";import{b as j,h as X}from"./chunk-OL26GLX5.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7PITPWF5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7PITPWF5.js deleted file mode 100644 index 5afd47e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7PITPWF5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-6Q5ALWJL.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-NXRSA4OE.js";import{b as E,d as ie}from"./chunk-YE4R2EE7.js";import{a as C,b as F,f as D}from"./chunk-255CHCZV.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7QPK2P6X.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7QPK2P6X.js deleted file mode 100644 index 98693ec..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7QPK2P6X.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-NXRSA4OE.js";import{d as l}from"./chunk-YE4R2EE7.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7TBBFHIG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7TBBFHIG.js deleted file mode 100644 index 9c96537..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7TBBFHIG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-GVNSIHVZ.js";import{a as At}from"./chunk-B3LZ6ZW2.js";import{a as yt}from"./chunk-5FLX3VRH.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-A24L4QN2.js";import{a as lt,d as it}from"./chunk-ZA6CVU2J.js";import{f as nt,h as bt}from"./chunk-IU3JXFWW.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7VDAIOK4.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7VDAIOK4.js deleted file mode 100644 index 08cc2bd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7VDAIOK4.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-NNNSDBCQ.js";import{d as H}from"./chunk-T4N45YIS.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-7WYA434Q.js b/src/renderer/public/sdk/Cesium/Workers/chunk-7WYA434Q.js deleted file mode 100644 index 4dc7ad3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-7WYA434Q.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-NXRSA4OE.js";import{d as ht}from"./chunk-YE4R2EE7.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A24L4QN2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A24L4QN2.js deleted file mode 100644 index 3380b00..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A24L4QN2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-IU3JXFWW.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A3JBN73Y.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A3JBN73Y.js deleted file mode 100644 index 1107bc6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A3JBN73Y.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-4KZEUE2E.js";import{a as At}from"./chunk-ZTMTVESE.js";import{a as yt}from"./chunk-ZB37QSBP.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-NXRSA4OE.js";import{a as lt,d as it}from"./chunk-YE4R2EE7.js";import{f as nt,h as bt}from"./chunk-255CHCZV.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A3K2ZLIM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A3K2ZLIM.js deleted file mode 100644 index 026ab4c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A3K2ZLIM.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as Ie,e as B,f as _e,g as un}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as s}from"./chunk-BOXFFUY5.js";import{a as Sn,c as Rn,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var Pt=Rn((en,nn)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var n=typeof en=="object"&&en&&!en.nodeType&&en,t=typeof nn=="object"&&nn&&!nn.nodeType&&nn,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,a=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=a-u,k=Math.floor,x=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),se=K(re,z).join(".");return Y+se}function X(b){for(var z=[],D=0,Y=b.length,re,se;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(se=b.charCodeAt(D++),(se&64512)==56320?z.push(((re&1023)<<10)+(se&1023)+65536):(z.push(re),D--)):z.push(re);return z}function te(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=x(z>>>10&1023|55296),z=56320|z&1023),D+=x(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:a}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=a)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,se=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=a;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=a||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=a)je=a-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-se&&W("overflow"),se+=k(re/Y),re%=Y,z.splice(re++,0,se)}return te(z)}function y(b){var z,D,Y,re,se,ee,fe,he,me,de,pe,V=[],ge,Te,je,fn;for(b=X(b),ge=b.length,z=E,D=0,se=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(x(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=a;de=me<=se?u:me>=se+d?d:me-se,!(he<de);me+=a)fn=he-de,je=a-de,V.push(x(c(de+fn%je,0))),he=k(fn/je);V.push(x(c(he,0))),se=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:te},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(n&&t)if(nn.exports==n)t.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(n[Q]=i[Q]);else e.punycode=i})(en)});var zt=Rn((Ut,Mn)=>{/*! - * 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,n){"use strict";typeof Mn=="object"&&Mn.exports?Mn.exports=n():typeof define=="function"&&define.amd?define(n):e.IPv6=n(e)})(Ut,function(e){"use strict";var n=e&&e.IPv6;function t(i){var r=i.toLowerCase(),a=r.split(":"),u=a.length,d=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[u-1]===""&&a[u-2]===""&&a.pop(),u=a.length,a[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&a[m]!=="";m++);if(m<d)for(a.splice(m,1,"0000");a.length<d;)a.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=a[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);a[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?a[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):a[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&a.splice(T,M,""),u=a.length;var F="";for(a[0]===""&&(F=":"),w=0;w<u&&(F+=a[w],w!==u-1);w++)F+=":";return a[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=n),this}return{best:t,noConflict:o}})});var qt=Rn((It,Pn)=>{/*! - * 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,n){"use strict";typeof Pn=="object"&&Pn.exports?Pn.exports=n():typeof define=="function"&&define.amd?define(n):e.SecondLevelDomains=n(e)})(It,function(e){"use strict";var n=e&&e.SecondLevelDomains,t={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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var a=t.list[o.slice(i+1)];return!a||a.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=n),this}};return t})});var Qe=Rn((Dt,Un)=>{/*! - * 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,n){"use strict";typeof Un=="object"&&Un.exports?Un.exports=n(Pt(),zt(),qt()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):e.URI=n(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Dt,function(e,n,t,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function a(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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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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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,x=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=x("pathname",F[k]),r[k+"UrnPathSegment"]=x("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=x("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var se=Y+c.slice(Y).search(O),ee=c.slice(Y,se),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){se=Y+ee.length;var de=f(ee,Y,se,c);if(de===void 0){y.lastIndex=se;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(se),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(a(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&t&&t.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,te=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return te.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&t&&t.list[y.toLowerCase()]&&t.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(t&&t.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,n,t,o){this.x=e??0,this.y=n??0,this.z=t??0,this.w=o??0}j.fromElements=function(e,n,t,o,i){return p(i)?(i.x=e,i.y=n,i.z=t,i.w=o,i):new j(e,n,t,o)};j.fromColor=function(e,n){return s.typeOf.object("color",e),p(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};j.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new j),t.x=e[n++],t.y=e[n++],t.z=e[n++],t.w=e[n],t};j.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)j.pack(e[i],n,i*4);return n};j.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=j.unpack(e,o,n[i])}return n};j.fromArray=j.unpack;j.maximumComponent=function(e){return s.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return s.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.min(e.x,n.x),t.y=Math.min(e.y,n.y),t.z=Math.min(e.z,n.z),t.w=Math.min(e.w,n.w),t};j.maximumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.max(e.x,n.x),t.y=Math.max(e.y,n.y),t.z=Math.max(e.z,n.z),t.w=Math.max(e.w,n.w),t};j.clamp=function(e,n,t,o){s.typeOf.object("value",e),s.typeOf.object("min",n),s.typeOf.object("max",t),s.typeOf.object("result",o);let i=R.clamp(e.x,n.x,t.x),r=R.clamp(e.y,n.y,t.y),a=R.clamp(e.z,n.z,t.z),u=R.clamp(e.w,n.w,t.w);return o.x=i,o.y=r,o.z=a,o.w=u,o};j.magnitudeSquared=function(e){return s.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var En=new j;j.distance=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),j.subtract(e,n,En),j.magnitude(En)};j.distanceSquared=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),j.subtract(e,n,En),j.magnitudeSquared(En)};j.normalize=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=j.magnitude(e);if(n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new A("normalized result is not a number");return n};j.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};j.multiplyComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x*n.x,t.y=e.y*n.y,t.z=e.z*n.z,t.w=e.w*n.w,t};j.divideComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x/n.x,t.y=e.y/n.y,t.z=e.z/n.z,t.w=e.w/n.w,t};j.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};j.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};j.multiplyByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};j.divideByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};j.negate=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};j.abs=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};var Et=new j;j.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),j.multiplyByScalar(n,t,Et),o=j.multiplyByScalar(e,1-t,o),j.add(Et,o,o)};var zo=new j;j.mostOrthogonalAxis=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=j.normalize(e,zo);return j.abs(t,t),t.x<=t.y?t.x<=t.z?t.x<=t.w?n=j.clone(j.UNIT_X,n):n=j.clone(j.UNIT_W,n):t.z<=t.w?n=j.clone(j.UNIT_Z,n):n=j.clone(j.UNIT_W,n):t.y<=t.z?t.y<=t.w?n=j.clone(j.UNIT_Y,n):n=j.clone(j.UNIT_W,n):t.z<=t.w?n=j.clone(j.UNIT_Z,n):n=j.clone(j.UNIT_W,n),n};j.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};j.equalsArray=function(e,n,t){return e.x===n[t]&&e.y===n[t+1]&&e.z===n[t+2]&&e.w===n[t+3]};j.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&R.equalsEpsilon(e.x,n.x,t,o)&&R.equalsEpsilon(e.y,n.y,t,o)&&R.equalsEpsilon(e.z,n.z,t,o)&&R.equalsEpsilon(e.w,n.w,t,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,n,t){return j.equalsEpsilon(this,e,n,t)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Jn=new Float32Array(1),ye=new Uint8Array(Jn.buffer),Io=new Uint32Array([287454020]),qo=new Uint8Array(Io.buffer),Tt=qo[0]===68;j.packFloat=function(e,n){return s.typeOf.number("value",e),p(n)||(n=new j),Jn[0]=e,Tt?(n.x=ye[0],n.y=ye[1],n.z=ye[2],n.w=ye[3]):(n.x=ye[3],n.y=ye[2],n.z=ye[1],n.w=ye[0]),n};j.unpackFloat=function(e){return s.typeOf.object("packedFloat",e),Tt?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),Jn[0]};var qe=j;function _(e,n,t,o,i,r,a,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=n??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=t??0,this[9]=a??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n[t++]=e[4],n[t++]=e[5],n[t++]=e[6],n[t++]=e[7],n[t++]=e[8],n[t++]=e[9],n[t++]=e[10],n[t++]=e[11],n[t++]=e[12],n[t++]=e[13],n[t++]=e[14],n[t]=e[15],n};_.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new _),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t[4]=e[n++],t[5]=e[n++],t[6]=e[n++],t[7]=e[n++],t[8]=e[n++],t[9]=e[n++],t[10]=e[n++],t[11]=e[n++],t[12]=e[n++],t[13]=e[n++],t[14]=e[n++],t[15]=e[n],t};_.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*16;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)_.pack(e[i],n,i*16);return n};_.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let t=e.length;p(n)?n.length=t/16:n=new Array(t/16);for(let o=0;o<t;o+=16){let i=o/16;n[i]=_.unpack(e,o,n[i])}return n};_.clone=function(e,n){if(p(e))return p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):new _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,n){return s.defined("values",e),_.clone(e,n)};_.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15],n):new _(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])};_.fromRotationTranslation=function(e,n,t){return s.typeOf.object("rotation",e),n=n??g.ZERO,p(t)?(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]=n.x,t[13]=n.y,t[14]=n.z,t[15]=1,t):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)};_.fromTranslationQuaternionRotationScale=function(e,n,t,o){s.typeOf.object("translation",e),s.typeOf.object("rotation",n),s.typeOf.object("scale",t),p(o)||(o=new _);let i=t.x,r=t.y,a=t.z,u=n.x*n.x,d=n.x*n.y,m=n.x*n.z,l=n.x*n.w,w=n.y*n.y,E=n.y*n.z,T=n.y*n.w,M=n.z*n.z,v=n.z*n.w,I=n.w*n.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),x=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=x*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*a,o[9]=W*a,o[10]=X*a,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,n){return s.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)};_.fromTranslation=function(e,n){return s.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,n)};_.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,n){return s.typeOf.object("rotation",e),p(n)||(n=new _),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]=0,n[13]=0,n[14]=0,n[15]=1,n};var Je=new g,Ge=new g,pn=new g;_.fromCamera=function(e,n){s.typeOf.object("camera",e);let t=e.position,o=e.direction,i=e.up;s.typeOf.object("camera.position",t),s.typeOf.object("camera.direction",o),s.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pn),pn);let r=Ge.x,a=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pn.x,E=pn.y,T=pn.z,M=t.x,v=t.y,I=t.z,N=r*-M+a*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(n)?(n[0]=r,n[1]=w,n[2]=-d,n[3]=0,n[4]=a,n[5]=E,n[6]=-m,n[7]=0,n[8]=u,n[9]=T,n[10]=-l,n[11]=0,n[12]=N,n[13]=F,n[14]=k,n[15]=1,n):new _(r,a,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,n,t,o,i){s.typeOf.number.greaterThan("fovY",e,0),s.typeOf.number.lessThan("fovY",e,Math.PI),s.typeOf.number.greaterThan("near",t,0),s.typeOf.number.greaterThan("far",o,0),s.typeOf.object("result",i);let a=1/Math.tan(e*.5),u=a/n,d=(o+t)/(t-o),m=2*o*t/(t-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=1/(n-e),d=1/(o-t),m=1/(r-i),l=-(n+e)*u,w=-(o+t)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=m,a[11]=0,a[12]=l,a[13]=w,a[14]=E,a[15]=1,a};_.computePerspectiveOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=2*i/(n-e),d=2*i/(o-t),m=(n+e)/(n-e),l=(o+t)/(o-t),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=m,a[9]=l,a[10]=w,a[11]=E,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a};_.computeInfinitePerspectiveOffCenter=function(e,n,t,o,i,r){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.object("result",r);let a=2*i/(n-e),u=2*i/(o-t),d=(n+e)/(n-e),m=(o+t)/(o-t),l=-1,w=-1,E=-2*i;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,n,t,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,a=e.width??0,u=e.height??0;n=n??0,t=t??1;let d=a*.5,m=u*.5,l=(t-n)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=n+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,n,t,o,i){return s.typeOf.object("position",e),s.typeOf.object("direction",n),s.typeOf.object("up",t),s.typeOf.object("right",o),s.typeOf.object("result",i),i[0]=o.x,i[1]=t.x,i[2]=-n.x,i[3]=0,i[4]=o.y,i[5]=t.y,i[6]=-n.y,i[7]=0,i[8]=o.z,i[9]=t.z,i[10]=-n.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(t,e),i[14]=g.dot(n,e),i[15]=1,i};_.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):[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]]};_.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,3),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,3),e*4+n};_.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=n*4,i=e[o],r=e[o+1],a=e[o+2],u=e[o+3];return t.x=i,t.y=r,t.z=a,t.w=u,t};_.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=_.clone(e,o);let i=n*4;return o[i]=t.x,o[i+1]=t.y,o[i+2]=t.z,o[i+3]=t.w,o};_.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=e[n],i=e[n+4],r=e[n+8],a=e[n+12];return t.x=o,t.y=i,t.z=r,t.w=a,t};_.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=_.clone(e,o),o[n]=t.x,o[n+4]=t.y,o[n+8]=t.z,o[n+12]=t.w,o};_.setTranslation=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=n.x,t[13]=n.y,t[14]=n.z,t[15]=e[15],t};var Do=new g;_.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=_.getScale(e,Do),i=n.x/o.x,r=n.y/o.y,a=n.z/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var No=new g;_.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=_.getScale(e,No),i=n/o.x,r=n/o.y,a=n/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Gn=new g;_.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=g.magnitude(g.fromElements(e[0],e[1],e[2],Gn)),n.y=g.magnitude(g.fromElements(e[4],e[5],e[6],Gn)),n.z=g.magnitude(g.fromElements(e[8],e[9],e[10],Gn)),n};var Ct=new g;_.getMaximumScale=function(e){return _.getScale(e,Ct),g.maximumComponent(Ct)};var ko=new g;_.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=_.getScale(e,ko);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.x,t[3]=e[3],t[4]=n[3]*o.y,t[5]=n[4]*o.y,t[6]=n[5]*o.y,t[7]=e[7],t[8]=n[6]*o.z,t[9]=n[7]*o.z,t[10]=n[8]*o.z,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Fo=new g;_.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=_.getScale(e,Fo);return n[0]=e[0]/t.x,n[1]=e[1]/t.x,n[2]=e[2]/t.x,n[3]=e[4]/t.y,n[4]=e[5]/t.y,n[5]=e[6]/t.y,n[6]=e[8]/t.z,n[7]=e[9]/t.z,n[8]=e[10]/t.z,n};_.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=n[0],x=n[1],Q=n[2],W=n[3],K=n[4],oe=n[5],X=n[6],te=n[7],Z=n[8],c=n[9],f=n[10],h=n[11],y=n[12],O=n[13],C=n[14],b=n[15],z=o*k+u*x+w*Q+v*W,D=i*k+d*x+E*Q+I*W,Y=r*k+m*x+T*Q+N*W,re=a*k+l*x+M*Q+F*W,se=o*K+u*oe+w*X+v*te,ee=i*K+d*oe+E*X+I*te,fe=r*K+m*oe+T*X+N*te,he=a*K+l*oe+M*X+F*te,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=a*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,fn=a*y+l*O+M*C+F*b;return t[0]=z,t[1]=D,t[2]=Y,t[3]=re,t[4]=se,t[5]=ee,t[6]=fe,t[7]=he,t[8]=me,t[9]=de,t[10]=pe,t[11]=V,t[12]=ge,t[13]=Te,t[14]=je,t[15]=fn,t};_.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t};_.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t};_.multiplyTransformation=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=n[0],I=n[1],N=n[2],F=n[4],k=n[5],x=n[6],Q=n[8],W=n[9],K=n[10],oe=n[12],X=n[13],te=n[14],Z=o*v+a*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+a*k+m*x,y=i*F+u*k+l*x,O=r*F+d*k+w*x,C=o*Q+a*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+a*X+m*te+E,Y=i*oe+u*X+l*te+T,re=r*oe+d*X+w*te+M;return t[0]=Z,t[1]=c,t[2]=f,t[3]=0,t[4]=h,t[5]=y,t[6]=O,t[7]=0,t[8]=C,t[9]=b,t[10]=z,t[11]=0,t[12]=D,t[13]=Y,t[14]=re,t[15]=1,t};_.multiplyByMatrix3=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("rotation",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=n[0],T=n[1],M=n[2],v=n[3],I=n[4],N=n[5],F=n[6],k=n[7],x=n[8],Q=o*E+a*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+a*I+m*N,X=i*v+u*I+l*N,te=r*v+d*I+w*N,Z=o*F+a*k+m*x,c=i*F+u*k+l*x,f=r*F+d*k+w*x;return t[0]=Q,t[1]=W,t[2]=K,t[3]=0,t[4]=oe,t[5]=X,t[6]=te,t[7]=0,t[8]=Z,t[9]=c,t[10]=f,t[11]=0,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};_.multiplyByTranslation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*e[6]+r*e[10]+e[14];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]=a,t[13]=u,t[14]=d,t[15]=e[15],t};_.multiplyByScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z;return o===1&&i===1&&r===1?_.clone(e,t):(t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=i*e[6],t[7]=e[7],t[8]=r*e[8],t[9]=r*e[9],t[10]=r*e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t)};_.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3],t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7],t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};_.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=n.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*a,d=e[1]*o+e[5]*i+e[9]*r+e[13]*a,m=e[2]*o+e[6]*i+e[10]*r+e[14]*a,l=e[3]*o+e[7]*i+e[11]*r+e[15]*a;return t.x=u,t.y=d,t.z=m,t.w=l,t};_.multiplyByPointAsVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return t.x=a,t.y=u,t.z=d,t};_.multiplyByPoint=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return t.x=a,t.y=u,t.z=d,t};_.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t};_.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n[9]=-e[9],n[10]=-e[10],n[11]=-e[11],n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n};_.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[1],o=e[2],i=e[3],r=e[6],a=e[7],u=e[11];return n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=o,n[9]=r,n[10]=e[10],n[11]=e[14],n[12]=i,n[13]=a,n[14]=u,n[15]=e[15],n};_.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n};_.equals=function(e,n){return e===n||p(e)&&p(n)&&e[12]===n[12]&&e[13]===n[13]&&e[14]===n[14]&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[8]===n[8]&&e[9]===n[9]&&e[10]===n[10]&&e[3]===n[3]&&e[7]===n[7]&&e[11]===n[11]&&e[15]===n[15]};_.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t&&Math.abs(e[4]-n[4])<=t&&Math.abs(e[5]-n[5])<=t&&Math.abs(e[6]-n[6])<=t&&Math.abs(e[7]-n[7])<=t&&Math.abs(e[8]-n[8])<=t&&Math.abs(e[9]-n[9])<=t&&Math.abs(e[10]-n[10])<=t&&Math.abs(e[11]-n[11])<=t&&Math.abs(e[12]-n[12])<=t&&Math.abs(e[13]-n[13])<=t&&Math.abs(e[14]-n[14])<=t&&Math.abs(e[15]-n[15])<=t};_.getTranslation=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n};_.getMatrix3=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};var Lo=new B,xo=new B,Bo=new qe,Qo=new qe(0,0,0,1);_.inverse=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[4],i=e[8],r=e[12],a=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,x=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,te=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+x*d+K*m),y=k*a+oe*d+Z*m-(F*a+X*d+te*m),O=x*a+X*u+c*m-(Q*a+oe*u+f*m),C=K*a+te*u+f*d-(W*a+Z*u+c*d),b=k*o+x*i+K*r-(F*o+Q*i+W*r),z=F*t+X*i+te*r-(k*t+oe*i+Z*r),D=Q*t+oe*o+f*r-(x*t+X*o+c*r),Y=W*t+Z*o+c*i-(K*t+te*o+f*i);F=i*m,k=r*d,x=o*m,Q=r*u,W=o*d,K=i*u,oe=t*m,X=r*a,te=t*d,Z=i*a,c=t*u,f=o*a;let re=F*v+Q*I+W*N-(k*v+x*I+K*N),se=k*M+oe*I+Z*N-(F*M+X*I+te*N),ee=x*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+te*v+f*I-(W*M+Z*v+c*I),he=x*E+K*T+k*w-(W*T+F*w+Q*E),me=te*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+x*l+X*w),pe=c*E+W*l+Z*w-(te*w+f*E+K*l),V=t*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Lo),xo,R.EPSILON7)&&qe.equals(_.getRow(e,3,Bo),Qo))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;throw new Se("matrix is not invertible because its determinate is zero.")}return V=1/V,n[0]=h*V,n[1]=y*V,n[2]=O*V,n[3]=C*V,n[4]=b*V,n[5]=z*V,n[6]=D*V,n[7]=Y*V,n[8]=re*V,n[9]=se*V,n[10]=ee*V,n[11]=fe*V,n[12]=he*V,n[13]=me*V,n[14]=de*V,n[15]=pe*V,n};_.inverseTransformation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[1],i=e[2],r=e[4],a=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-t*w-o*E-i*T,v=-r*w-a*E-u*T,I=-d*w-m*E-l*T;return n[0]=t,n[1]=r,n[2]=d,n[3]=0,n[4]=o,n[5]=a,n[6]=m,n[7]=0,n[8]=i,n[9]=u,n[10]=l,n[11]=0,n[12]=M,n[13]=v,n[14]=I,n[15]=1,n};var Wo=new _;_.inverseTranspose=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),_.inverse(_.transpose(e,Wo),n)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]&&e[4]===n[t+4]&&e[5]===n[t+5]&&e[6]===n[t+6]&&e[7]===n[t+7]&&e[8]===n[t+8]&&e[9]===n[t+9]&&e[10]===n[t+10]&&e[11]===n[t+11]&&e[12]===n[t+12]&&e[13]===n[t+13]&&e[14]===n[t+14]&&e[15]===n[t+15]};_.prototype.equalsEpsilon=function(e,n){return _.equalsEpsilon(this,e,n)};_.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 J=_;function vt(e,n,t){t=t??!1;let o={},i=p(e),r=p(n),a,u,d;if(i)for(a in e)e.hasOwnProperty(a)&&(u=e[a],r&&t&&typeof u=="object"&&n.hasOwnProperty(a)?(d=n[a],typeof d=="object"?o[a]=vt(u,d,t):o[a]=u):o[a]=u);if(r)for(a in n)n.hasOwnProperty(a)&&!o.hasOwnProperty(a)&&(d=n[a],o[a]=d);return o}var De=vt;function Ho(e,n,t){s.defined("array",e),s.defined("itemToFind",n),s.defined("comparator",t);let o=0,i=e.length-1,r,a;for(;o<=i;){if(r=~~((o+i)/2),a=t(e[r],n),a<0){o=r+1;continue}if(a>0){i=r-1;continue}return r}return~(i+1)}var Be=Ho;function $o(e,n,t,o,i){this.xPoleWander=e,this.yPoleWander=n,this.xPoleOffset=t,this.yPoleOffset=o,this.ut1MinusUtc=i}var hn=$o;function Yo(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dn=Yo;var At=[31,28,31,30,31,30,31,31,30,31,30,31];function Vo(e,n,t,o,i,r,a,u){e=e??1,n=n??1,t=t??1,o=o??0,i=i??0,r=r??0,a=a??0,u=u??!1,v(),I(),this.year=e,this.month=n,this.day=t,this.hour=o,this.minute=i,this.second=r,this.millisecond=a,this.isLeapSecond=u;function v(){s.typeOf.number.greaterThanOrEquals("Year",e,1),s.typeOf.number.lessThanOrEquals("Year",e,9999),s.typeOf.number.greaterThanOrEquals("Month",n,1),s.typeOf.number.lessThanOrEquals("Month",n,12),s.typeOf.number.greaterThanOrEquals("Day",t,1),s.typeOf.number.lessThanOrEquals("Day",t,31),s.typeOf.number.greaterThanOrEquals("Hour",o,0),s.typeOf.number.lessThanOrEquals("Hour",o,23),s.typeOf.number.greaterThanOrEquals("Minute",i,0),s.typeOf.number.lessThanOrEquals("Minute",i,59),s.typeOf.bool("IsLeapSecond",u),s.typeOf.number.greaterThanOrEquals("Second",r,0),s.typeOf.number.lessThanOrEquals("Second",r,u?60:59),s.typeOf.number.greaterThanOrEquals("Millisecond",a,0),s.typeOf.number.lessThan("Millisecond",a,1e3)}function I(){let N=n===2&&dn(e)?At[n-1]+1:At[n-1];if(t>N)throw new A("Month and Day represents invalid date")}}var Tn=Vo;function Xo(e,n){this.julianDate=e,this.offset=n}var ne=Xo;var Zo={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},ie=Object.freeze(Zo);var Jo={UTC:0,TAI:1},H=Object.freeze(Jo);var Mt=new Tn,Cn=[31,28,31,30,31,30,31,31,30,31,30,31],vn=29;function Kn(e,n){return U.compare(e.julianDate,n.julianDate)}var Ke=new ne;function jn(e){Ke.julianDate=e;let n=U.leapSeconds,t=Be(n,Ke,Kn);t<0&&(t=~t),t>=n.length&&(t=n.length-1);let o=n[t].offset;t>0&&U.secondsDifference(n[t].julianDate,e)>o&&(t--,o=n[t].offset),U.addSeconds(e,o,e)}function jt(e,n){Ke.julianDate=e;let t=U.leapSeconds,o=Be(t,Ke,Kn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-t[0].offset,n);if(o>=t.length)return U.addSeconds(e,-t[o-1].offset,n);let i=U.secondsDifference(t[o].julianDate,e);if(i===0)return U.addSeconds(e,-t[o].offset,n);if(!(i<=1))return U.addSeconds(e,-t[--o].offset,n)}function Ne(e,n,t){let o=n/ie.SECONDS_PER_DAY|0;return e+=o,n-=ie.SECONDS_PER_DAY*o,n<0&&(e--,n+=ie.SECONDS_PER_DAY),t.dayNumber=e,t.secondsOfDay=n,t}function et(e,n,t,o,i,r,a){let u=(n-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(n-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+t-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+a*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var Go=/^(\d{4})$/,Ko=/^(\d{4})-(\d{2})$/,er=/^(\d{4})-?(\d{3})$/,nr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tr=/^(\d{4})-?(\d{2})-?(\d{2})$/,nt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,or=/^(\d{2})(\.\d+)?/.source+nt.source,rr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,ir=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,Re="Invalid ISO 8601 date.";function U(e,n,t){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,n=n??0,t=t??H.UTC;let o=e|0;n=n+(e-o)*ie.SECONDS_PER_DAY,Ne(o,n,this),t===H.UTC&&jn(this)}U.fromGregorianDate=function(e,n){if(!(e instanceof Tn))throw new A("date must be a valid GregorianDate.");let t=et(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(n)?(Ne(t[0],t[1],n),jn(n),n):new U(t[0],t[1],H.UTC)};U.fromDate=function(e,n){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let t=et(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(n)?(Ne(t[0],t[1],n),jn(n),n):new U(t[0],t[1],H.UTC)};U.fromIso8601=function(e,n){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let t=e.split("T"),o,i=1,r=1,a=0,u=0,d=0,m=0,l=t[0],w=t[1],E,T;if(!p(l))throw new A(Re);let M;if(t=l.match(tr),t!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+t[1],i=+t[2],r=+t[3]}else if(t=l.match(Ko),t!==null)o=+t[1],i=+t[2];else if(t=l.match(Go),t!==null)o=+t[1];else{let F;if(t=l.match(er),t!==null){if(o=+t[1],F=+t[2],T=dn(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(t=l.match(nr),t!==null){o=+t[1];let k=+t[2],x=+t[3]||0;if(M=l.split("-").length-1,M>0&&(!p(t[3])&&M!==1||p(t[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+x-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dn(o),i<1||i>12||r<1||(i!==2||!T)&&r>Cn[i-1]||T&&i===2&&r>vn)throw new A(Re);let v;if(p(w)){if(t=w.match(ir),t!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);a=+t[1],u=+t[2],d=+t[3],m=+(t[4]||0)*1e3,v=5}else if(t=w.match(rr),t!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);a=+t[1],u=+t[2],d=+(t[3]||0)*60,v=4}else if(t=w.match(or),t!==null)a=+t[1],u=+(t[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||a>24||a===24&&(u>0||d>0||m>0))throw new A(Re);let F=t[v],k=+t[v+1],x=+(t[v+2]||0);switch(F){case"+":a=a-k,u=u-x;break;case"-":a=a+k,u=u+x;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,a,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,r++;for(E=T&&i===2?vn:Cn[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?vn:Cn[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?vn:Cn[i-1],r+=E;let N=et(o,i,r,a,u,d,m);return p(n)?(Ne(N[0],N[1],n),jn(n)):n=new U(N[0],N[1],H.UTC),I&&U.addSeconds(n,1,n),n};U.now=function(e){return U.fromDate(new Date,e)};var An=new U(0,0,H.TAI);U.toGregorianDate=function(e,n){if(!p(e))throw new A("julianDate is required.");let t=!1,o=jt(e,An);p(o)||(U.addSeconds(e,-1,An),o=jt(An,An),t=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let a=i+68569|0,u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let m=80*a/2447|0,l=a-(2447*m/80|0)|0;a=m/11|0;let w=m+2-12*a|0,E=100*(u-49)+d+a|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),t&&(I+=1),p(n)?(n.year=E,n.month=w,n.day=l,n.hour=T,n.minute=v,n.second=I,n.millisecond=N,n.isLeapSecond=t,n):new Tn(E,w,l,T,v,I,N,t)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,Mt),t=n.second;return n.isLeapSecond&&(t-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,t,n.millisecond))};U.toIso8601=function(e,n){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,Mt),o=t.year,i=t.month,r=t.day,a=t.hour,u=t.minute,d=t.second,m=t.millisecond;o===1e4&&i===1&&r===1&&a===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,a=24);let l;if(!p(n)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(n)||n===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,n){if(p(e))return p(n)?(n.dayNumber=e.dayNumber,n.secondsOfDay=e.secondsOfDay,n):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");let t=e.dayNumber-n.dayNumber;return t!==0?t:e.secondsOfDay-n.secondsOfDay};U.equals=function(e,n){return e===n||p(e)&&p(n)&&e.dayNumber===n.dayNumber&&e.secondsOfDay===n.secondsOfDay};U.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(U.secondsDifference(e,n))<=t};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");return(e.dayNumber-n.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-n.secondsOfDay)};U.daysDifference=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");let t=e.dayNumber-n.dayNumber,o=(e.secondsOfDay-n.secondsOfDay)/ie.SECONDS_PER_DAY;return t+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let n=U.leapSeconds,t=Be(n,Ke,Kn);return t<0&&(t=~t,--t,t<0&&(t=0)),n[t].offset};U.addSeconds=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("seconds is required.");if(!p(t))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+n,t)};U.addMinutes=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("minutes is required.");if(!p(t))throw new A("result is required.");let o=e.secondsOfDay+n*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,t)};U.addHours=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("hours is required.");if(!p(t))throw new A("result is required.");let o=e.secondsOfDay+n*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,t)};U.addDays=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("days is required.");if(!p(t))throw new A("result is required.");let o=e.dayNumber+n;return Ne(o,e.secondsOfDay,t)};U.lessThan=function(e,n){return U.compare(e,n)<0};U.lessThanOrEquals=function(e,n){return U.compare(e,n)<=0};U.greaterThan=function(e,n){return U.compare(e,n)>0};U.greaterThanOrEquals=function(e,n){return U.compare(e,n)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,n){return U.equalsEpsilon(this,e,n)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new ne(new U(2441317,43210,H.TAI),10),new ne(new U(2441499,43211,H.TAI),11),new ne(new U(2441683,43212,H.TAI),12),new ne(new U(2442048,43213,H.TAI),13),new ne(new U(2442413,43214,H.TAI),14),new ne(new U(2442778,43215,H.TAI),15),new ne(new U(2443144,43216,H.TAI),16),new ne(new U(2443509,43217,H.TAI),17),new ne(new U(2443874,43218,H.TAI),18),new ne(new U(2444239,43219,H.TAI),19),new ne(new U(2444786,43220,H.TAI),20),new ne(new U(2445151,43221,H.TAI),21),new ne(new U(2445516,43222,H.TAI),22),new ne(new U(2446247,43223,H.TAI),23),new ne(new U(2447161,43224,H.TAI),24),new ne(new U(2447892,43225,H.TAI),25),new ne(new U(2448257,43226,H.TAI),26),new ne(new U(2448804,43227,H.TAI),27),new ne(new U(2449169,43228,H.TAI),28),new ne(new U(2449534,43229,H.TAI),29),new ne(new U(2450083,43230,H.TAI),30),new ne(new U(2450630,43231,H.TAI),31),new ne(new U(2451179,43232,H.TAI),32),new ne(new U(2453736,43233,H.TAI),33),new ne(new U(2454832,43234,H.TAI),34),new ne(new U(2456109,43235,H.TAI),35),new ne(new U(2457204,43236,H.TAI),36),new ne(new U(2457754,43237,H.TAI),37)];var ue=U;var co=Ze(Qe(),1);function cr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var Nt=cr;function kt(e,n){if(e===null||typeof e!="object")return e;n=n??!1;let t=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];n&&(i=kt(i,n)),t[o]=i}return t}var tn=kt;function sr(){let e,n,t=new Promise(function(o,i){e=o,n=i});return{resolve:e,reject:n,promise:t}}var We=sr;var Ft=Ze(Qe(),1);function tt(e,n){let t;return typeof document<"u"&&(t=document),tt._implementation(e,n,t)}tt._implementation=function(e,n,t){if(!p(e))throw new A("relative uri is required.");if(!p(n)){if(typeof t>"u")return e;n=t.baseURI??t.location.href}let o=new Ft.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(n).toString()};var mn=tt;var Lt=Ze(Qe(),1);function ar(e,n){if(!p(e))throw new A("uri is required.");let t="",o=e.lastIndexOf("/");return o!==-1&&(t=e.substring(0,o+1)),n&&(e=new Lt.default(e),e.query().length!==0&&(t+=`?${e.query()}`),e.fragment().length!==0&&(t+=`#${e.fragment()}`)),t}var xt=ar;var Bt=Ze(Qe(),1);function fr(e){if(!p(e))throw new A("uri is required.");let n=new Bt.default(e);n.normalize();let t=n.path(),o=t.lastIndexOf("/");return o!==-1&&(t=t.substr(o+1)),o=t.lastIndexOf("."),o===-1?t="":t=t.substr(o+1),t}var Qt=fr;var Wt={};function ur(e,n,t){p(n)||(n=e.width),p(t)||(t=e.height);let o=Wt[n];p(o)||(o={},Wt[n]=o);let i=o[t];if(!p(i)){let r=document.createElement("canvas");r.width=n,r.height=t,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[t]=i}return i.drawImage(e,0,0,n,t),i.getImageData(0,0,n,t).data}var ot=ur;var pr=/^blob:/i;function hr(e){return s.typeOf.string("uri",e),pr.test(e)}var zn=hr;var Ce;function dr(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let n=Ce.host,t=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,t!==Ce.protocol||n!==Ce.host}var Ht=dr;var mr=/^data:/i;function yr(e){return s.typeOf.string("uri",e),mr.test(e)}var In=yr;function lr(e){let n=document.createElement("script");return n.async=!0,n.src=e,new Promise((t,o)=>{window.crossOriginIsolated&&n.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];n.onload=function(){n.onload=void 0,i.removeChild(n),t()},n.onerror=function(r){o(r)},i.appendChild(n)})}var $t=lr;function wr(e){if(!p(e))throw new A("obj is required.");let n="";for(let t in e)if(e.hasOwnProperty(t)){let o=e[t],i=`${encodeURIComponent(t)}=`;if(Array.isArray(o))for(let r=0,a=o.length;r<a;++r)n+=`${i+encodeURIComponent(o[r])}&`;else n+=`${i+encodeURIComponent(o)}&`}return n=n.slice(0,-1),n}var Yt=wr;function br(e){if(!p(e))throw new A("queryString is required.");let n={};if(e==="")return n;let t=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=t.length;o<i;++o){let r=t[o].split("="),a=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=n[a];typeof d=="string"?n[a]=[d,u]:Array.isArray(d)?d.push(u):n[a]=u}return n}var Vt=br;var Or={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ae=Object.freeze(Or);var gr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Xt=Object.freeze(gr);function qn(e){e=e??_e.EMPTY_OBJECT;let n=e.throttleByServer??!1,t=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=t,this.throttleByServer=n,this.type=e.type??Xt.OTHER,this.serverKey=e.serverKey,this.state=ae.UNISSUED,this.deferred=void 0,this.cancelled=!1}qn.prototype.cancel=function(){this.cancelled=!0};qn.prototype.clone=function(e){return p(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=ae.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new qn(this)};var Zt=qn;function _r(e){let n={};if(!e)return n;let t=e.split(`\r -`);for(let o=0;o<t.length;++o){let i=t[o],r=i.indexOf(": ");if(r>0){let a=i.substring(0,r),u=i.substring(r+2);n[a]=u}}return n}var Jt=_r;function Gt(e,n,t){this.statusCode=e,this.response=n,this.responseHeaders=t,typeof this.responseHeaders=="string"&&(this.responseHeaders=Jt(this.responseHeaders))}Gt.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yn=Gt;var Dn=Ze(Qe(),1);function ln(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(ln.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});ln.prototype.addEventListener=function(e,n){s.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(n);let t=this;return function(){t.removeEventListener(e,n)}};ln.prototype.removeEventListener=function(e,n){s.typeOf.func("listener",e);let t=this._listeners,o=this._scopes,i=-1;for(let r=0;r<t.length;r++)if(t[r]===e&&o[r]===n){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),t[i]=void 0,o[i]=void 0):(t.splice(i,1),o.splice(i,1)),!0):!1};function Sr(e,n){return n-e}ln.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,n=this._listeners,t=this._scopes,o=n.length;for(e=0;e<o;e++){let r=n[e];p(r)&&n[e].apply(t[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(Sr),e=0;e<o;e++){let r=i[e];n.splice(r,1),t.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var Kt=ln;function He(e){s.typeOf.object("options",e),s.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){s.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let n=this._length;if(e<n){let t=this._array;for(let o=e;o<n;++o)t[o]=void 0;this._length=e,t.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function rt(e,n,t){let o=e[n];e[n]=e[t],e[t]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let n=this._length,t=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let a=2*(e+1),u=a-1;u<n&&t(o[u],o[e])<0?i=u:i=e,a<n&&t(o[a],o[i])<0&&(i=a),i!==e?(rt(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let n=Math.ceil(e/2);n>=0;--n)this.heapify(n)};He.prototype.insert=function(e){s.defined("element",e);let n=this._array,t=this._comparator,o=this._maximumLength,i=this._length++;for(i<n.length?n[i]=e:n.push(e);i!==0;){let a=Math.floor((i-1)/2);if(t(n[i],n[a])<0)rt(n,i,a),i=a;else break}let r;return p(o)&&this._length>o&&(r=n[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;s.typeOf.number.lessThan("index",e,this._length);let n=this._array,t=n[e];return rt(n,e,--this._length),this.heapify(e),n[this._length]=void 0,t};var eo=He;function Rr(e,n){return e.priority-n.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},on=20,le=new eo({comparator:Rr});le.maximumLength=on;le.reserve(on);var ve=[],Pe={},Er=typeof document<"u"?new Dn.default(document.location.href):new Dn.default,Nn=new Kt;function ce(){}ce.maximumRequests=50;ce.maximumRequestsPerServer=18;ce.requestsByServer={};ce.throttleRequests=!0;ce.debugShowStatistics=!1;ce.requestCompletedEvent=Nn;Object.defineProperties(ce,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return on},set:function(e){if(e<on)for(;le.length>e;){let n=le.pop();$e(n)}on=e,le.maximumLength=e,le.reserve(e)}}});function no(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}ce.serverHasOpenSlots=function(e,n){n=n??1;let t=ce.requestsByServer[e]??ce.maximumRequestsPerServer;return Pe[e]+n<=t};ce.heapHasOpenSlots=function(e){return le.length+e<=on};function to(e){return e.state===ae.UNISSUED&&(e.state=ae.ISSUED,e.deferred=We()),e.deferred.promise}function Tr(e){return function(n){if(e.state===ae.CANCELLED)return;let t=e.deferred;--G.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(),e.state=ae.RECEIVED,e.deferred=void 0,t.resolve(n)}}function Cr(e){return function(n){e.state!==ae.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(n),e.state=ae.FAILED,e.deferred.reject(n))}}function oo(e){let n=to(e);return e.state=ae.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Pe[e.serverKey],e.requestFunction().then(Tr(e)).catch(Cr(e)),n}function $e(e){let n=e.state===ae.ACTIVE;if(e.state=ae.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let t=e.deferred;e.deferred=void 0,t.reject()}n&&(--G.numberOfActiveRequests,--Pe[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}ce.update=function(){let e,n,t=0,o=ve.length;for(e=0;e<o;++e){if(n=ve[e],n.cancelled&&$e(n),n.state!==ae.ACTIVE){++t;continue}t>0&&(ve[e-t]=n)}ve.length-=t;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)no(i[e]);le.resort();let a=Math.max(ce.maximumRequests-ve.length,0),u=0;for(;u<a&&le.length>0;){if(n=le.pop(),n.cancelled){$e(n);continue}if(n.throttleByServer&&!ce.serverHasOpenSlots(n.serverKey)){$e(n);continue}oo(n),++u}vr()};ce.getServerKey=function(e){s.typeOf.string("url",e);let n=new Dn.default(e);n.scheme()===""&&(n=n.absoluteTo(Er),n.normalize());let t=n.authority();/:/.test(t)||(t=`${t}:${n.scheme()==="https"?"443":"80"}`);let o=Pe[t];return p(o)||(Pe[t]=0),t};ce.request=function(e){if(s.typeOf.object("request",e),s.typeOf.string("request.url",e.url),s.typeOf.func("request.requestFunction",e.requestFunction),In(e.url)||zn(e.url))return Nn.raiseEvent(),e.state=ae.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=ce.getServerKey(e.url)),ce.throttleRequests&&e.throttleByServer&&!ce.serverHasOpenSlots(e.serverKey))return;if(!ce.throttleRequests||!e.throttle)return oo(e);if(ve.length>=ce.maximumRequests)return;no(e);let n=le.insert(e);if(p(n)){if(n===e)return;$e(n)}return to(e)};function vr(){ce.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}ce.clearForSpecs=function(){for(;le.length>0;){let n=le.pop();$e(n)}let e=ve.length;for(let n=0;n<e;++n)$e(ve[n]);ve.length=0,Pe={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};ce.numberOfActiveRequestsByServer=function(e){return Pe[e]};ce.requestHeap=le;var kn=ce;var ro=Ze(Qe(),1);var wn={},rn={};wn.add=function(e,n){if(!p(e))throw new A("host is required.");if(!p(n)||n<=0)throw new A("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])||(rn[t]=!0)};wn.remove=function(e,n){if(!p(e))throw new A("host is required.");if(!p(n)||n<=0)throw new A("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])&&delete rn[t]};function Ar(e){let n=new ro.default(e);n.normalize();let t=n.authority();if(t.length!==0){if(n.authority(t),t.indexOf("@")!==-1&&(t=t.split("@")[1]),t.indexOf(":")===-1){let o=n.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")t+=":80";else if(o==="https")t+=":443";else return}return t}}wn.contains=function(e){if(!p(e))throw new A("url is required.");let n=Ar(e);return!!(p(n)&&p(rn[n]))};wn.clear=function(){rn={}};var it=wn;var so=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),s.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Zt,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 Ae(e,n){return p(e)?tn(e):n}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var cn;P.supportsImageBitmapOptions=function(){return p(cn)?cn:typeof createImageBitmap!="function"?(cn=Promise.resolve(!1),cn):(cn=P.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(n){let t={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(n,t),createImageBitmap(n)])}).then(function(n){let t=ot(n[0]),o=ot(n[1]);return t[1]!==o[1]}).catch(function(){return!1}),cn)};Object.defineProperties(P,{isBlobSupported:{get:function(){return so}}});Object.defineProperties(P.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 Qt(this._url)}},isDataUri:{get:function(){return In(this._url)}},isBlobUri:{get:function(){return zn(this._url)}},isCrossOriginUrl:{get:function(){return Ht(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,n,t,o){let i=new co.default(e),r=jr(i.query());this._queryParameters=n?Ln(r,this.queryParameters,t):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mn(o))),this._url=i.toString()};function jr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Vt(e)}function Ln(e,n,t){if(!t)return De(e,n);let o=tn(e,!0);for(let i in n)if(n.hasOwnProperty(i)){let r=o[i],a=n[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(a)):o[i]=Array.isArray(a)?a.slice():a}return o}P.prototype.getUrlComponent=function(e,n){if(this.isDataUri)return this._url;let t=this._url;e&&(t=`${t}${Mr(this.queryParameters)}`),t=t.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(t=t.replace(/{(.*?)}/g,function(i,r){let a=o[r];return p(a)?encodeURIComponent(a):i})),n&&p(this.proxy)&&(t=this.proxy.getURL(t)),t};function Mr(e){let n=Object.keys(e);return n.length===0?"":n.length===1&&!p(e[n[0]])?`?${n[0]}`:`?${Yt(e)}`}P.prototype.setQueryParameters=function(e,n){n?this._queryParameters=Ln(this._queryParameters,e,!1):this._queryParameters=Ln(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Ln(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,n){n?this._templateValues=De(this._templateValues,e):this._templateValues=De(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let n=this.clone();if(n._retryCount=0,p(e.url)){let t=e.preserveQueryParameters??!1;n.parseUrl(e.url,!0,t,this._url)}return p(e.queryParameters)&&(n._queryParameters=De(e.queryParameters,n.queryParameters)),p(e.templateValues)&&(n._templateValues=De(e.templateValues,n.templateValues)),p(e.headers)&&(n.headers=De(e.headers,n.headers)),p(e.proxy)&&(n.proxy=e.proxy),p(e.request)&&(n.request=e.request),p(e.retryCallback)&&(n.retryCallback=e.retryCallback),p(e.retryAttempts)&&(n.retryAttempts=e.retryAttempts),n};P.prototype.retryOnError=function(e){let n=this.retryCallback;if(typeof n!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let t=this;return Promise.resolve(n(this,e)).then(function(o){return++t._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=tn(this._queryParameters),e._templateValues=tn(this._templateValues),e.headers=tn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return xt(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=Nt(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let n=e.preferImageBitmap??!1,t=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(st(this.request),!so||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!t)return ct({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:n});let r=this.fetchBlob();if(!p(r))return;let a,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return a=l,u=a&&n,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),ct({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function ct(e){let n=e.resource,t=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=n.request;r.url=n.url,r.requestFunction=function(){let u=!1;!n.isDataUri&&!n.isBlobUri&&(u=n.isCrossOriginUrl);let d=We();return P._Implementations.createImage(r,u,d,t,o,i),d.promise};let a=kn.request(r);if(p(a))return a.catch(function(u){return r.state!==ae.FAILED?Promise.reject(u):n.retryOnError(u).then(function(d){return d?(r.state=ae.UNISSUED,r.deferred=void 0,ct({resource:n,flipY:t,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(n){if(p(n))return JSON.parse(n)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",st(this.request);let n;do n=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[n]));return ao(this,e,n)};function ao(e,n,t){let o={};o[n]=t,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=We();return window[t]=function(d){u.resolve(d);try{delete window[t]}catch{window[t]=void 0}},P._Implementations.loadAndExecuteScript(r,t,u),u.promise};let a=kn.request(i);if(p(a))return a.catch(function(u){return i.state!==ae.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ae.UNISSUED,i.deferred=void 0,ao(e,n,t)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest=function(e){let n=this;st(n.request);let t=n.request,o=n.url;t.url=o,t.requestFunction=function(){let r=e.responseType,a=De(e.headers,n.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=We(),w=P._Implementations.loadWithXhr(o,r,d,m,a,l,u);return p(w)&&p(w.abort)&&(t.cancelFunction=function(){w.abort()}),l.promise};let i=kn.request(t);if(p(i))return i.then(function(r){return t.cancelFunction=void 0,r}).catch(function(r){return t.cancelFunction=void 0,t.state!==ae.FAILED?Promise.reject(r):n.retryOnError(r).then(function(a){return a?(t.state=ae.UNISSUED,t.deferred=void 0,n.fetch(e)):Promise.reject(r)})})};function st(e){if(e.state===ae.ISSUED||e.state===ae.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ae.UNISSUED,e.deferred=void 0}var Pr=/^data:(.*?)(;base64)?,(.*)$/;function Fn(e,n){let t=decodeURIComponent(n);return e?atob(t):t}function io(e,n){let t=Fn(e,n),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return o}function Ur(e,n){n=n??"";let t=e[1],o=!!e[2],i=e[3],r,a;switch(n){case"":case"text":return Fn(o,i);case"arraybuffer":return io(o,i);case"blob":return r=io(o,i),new Blob([r],{type:t});case"document":return a=new DOMParser,a.parseFromString(Fn(o,i),t);case"json":return JSON.parse(Fn(o,i));default:throw new A(`Unhandled responseType: ${n}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="POST",n.data=e,this._makeRequest(n)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PUT",n.data=e,this._makeRequest(n)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PATCH",n.data=e,this._makeRequest(n)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,n,t){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),t.resolve(o)},o.onerror=function(i){t.reject(i)},n&&(it.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,n,t,o,i,r){let a=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(a,n,t);return}let d="blob",m="GET",l=We(),w=P._Implementations.loadWithXhr(a,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){t.reject(new Se(`Successfully retrieved ${a} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){t.resolve(E)})}).catch(function(u){t.reject(u)})};P.createImageBitmapFromBlob=function(e,n){return s.defined("options",n),s.typeOf.bool("options.flipY",n.flipY),s.typeOf.bool("options.premultiplyAlpha",n.premultiplyAlpha),s.typeOf.bool("options.skipColorSpaceConversion",n.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:n.flipY?"flipY":"none",premultiplyAlpha:n.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:n.skipColorSpaceConversion?"none":"default"})};function zr(e,n,t,o,i,r,a){fetch(e,{method:t,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yn(u.status,u,d));return}switch(n){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yn)})}var Ir=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,n,t,o,i,r,a){let u=Pr.exec(e);if(u!==null){r.resolve(Ur(u,n));return}if(Ir){zr(e,n,t,o,i,r,a);return}let d=new XMLHttpRequest;if(it.contains(e)&&(d.withCredentials=!0),d.open(t,e,!0),p(a)&&p(d.overrideMimeType)&&d.overrideMimeType(a),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(n)&&(d.responseType=n);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yn(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(t==="HEAD"||t==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(n)||w===n))r.resolve(l);else if(n==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yn)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,n,t){return $t(e,n).catch(function(o){t.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ke=P;function On(e){e=e??_e.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,p(e.data)?fo(this,e.data):fo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}On.fromUrl=async function(e,n){s.defined("url",e),n=n??_e.EMPTY_OBJECT;let t=ke.createIfNeeded(e),o;try{o=await t.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${t.url}.`)}return new On({addNewLeapSeconds:n.addNewLeapSeconds,data:o})};On.NONE=Object.freeze({compute:function(e,n){return p(n)?(n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0):n=new hn(0,0,0,0,0),n}});On.prototype.compute=function(e,n){if(!p(this._samples))return;if(p(n)||(n=new hn(0,0,0,0,0)),this._samples.length===0)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;let t=this._dates,o=this._lastIndex,i=0,r=0;if(p(o)){let u=t[o],d=t[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,po(this,t,this._samples,e,i,r,n),n}let a=Be(t,e,ue.compare,this._dateColumn);return a>=0?(a<t.length-1&&t[a+1].equals(e)&&++a,i=a,r=a):(r=~a,i=r-1,i<0&&(i=0)),this._lastIndex=i,po(this,t,this._samples,e,i,r,n),n};function qr(e,n){return ue.compare(e.julianDate,n)}function fo(e,n){if(!p(n.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(n.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let t=n.columnNames.indexOf("modifiedJulianDateUtc"),o=n.columnNames.indexOf("xPoleWanderRadians"),i=n.columnNames.indexOf("yPoleWanderRadians"),r=n.columnNames.indexOf("ut1MinusUtcSeconds"),a=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("taiMinusUtcSeconds");if(t<0||o<0||i<0||r<0||a<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=n.samples,l=e._dates=[];e._dateColumn=t,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=n.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+t],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,x=Be(k,F,qr);if(x<0){let Q=new ne(F,I);k.splice(~x,0,Q)}}w=I}}}function uo(e,n,t,o,i){let r=t*o;i.xPoleWander=n[r+e._xPoleWanderRadiansColumn],i.yPoleWander=n[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=n[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=n[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=n[r+e._ut1MinusUtcSecondsColumn]}function bn(e,n,t){return n+e*(t-n)}function po(e,n,t,o,i,r,a){let u=e._columnCount;if(r>n.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let d=n[i],m=n[r];if(d.equals(m)||o.equals(d))return uo(e,t,i,u,a),a;if(o.equals(m))return uo(e,t,r,u,a),a;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=t[w+e._ut1MinusUtcSecondsColumn],M=t[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=t[w+e._taiMinusUtcSecondsColumn],N=t[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return a.xPoleWander=bn(l,t[w+e._xPoleWanderRadiansColumn],t[E+e._xPoleWanderRadiansColumn]),a.yPoleWander=bn(l,t[w+e._yPoleWanderRadiansColumn],t[E+e._yPoleWanderRadiansColumn]),a.xPoleOffset=bn(l,t[w+e._xCelestialPoleOffsetRadiansColumn],t[E+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=bn(l,t[w+e._yCelestialPoleOffsetRadiansColumn],t[E+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=bn(l,T,M),a}var ho=On;function we(e,n,t){this.heading=e??0,this.pitch=n??0,this.roll=t??0}we.fromQuaternion=function(e,n){if(!p(e))throw new A("quaternion is required");p(n)||(n=new we);let t=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(a,r),n.roll=Math.atan2(i,o),n.pitch=-R.asinClamped(t),n};we.fromDegrees=function(e,n,t,o){if(!p(e))throw new A("heading is required");if(!p(n))throw new A("pitch is required");if(!p(t))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=n*R.RADIANS_PER_DEGREE,o.roll=t*R.RADIANS_PER_DEGREE,o};we.clone=function(e,n){if(p(e))return p(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,n){return e===n||p(e)&&p(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll};we.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&R.equalsEpsilon(e.heading,n.heading,t,o)&&R.equalsEpsilon(e.pitch,n.pitch,t,o)&&R.equalsEpsilon(e.roll,n.roll,t,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,n,t){return we.equalsEpsilon(this,e,n,t)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var xn=we;var mo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Dr(){let e=document.getElementsByTagName("script");for(let n=0,t=e.length;n<t;++n){let o=e[n].getAttribute("src"),i=mo.exec(o);if(i!==null)return i[1]}}var Bn;function yo(e){return typeof document>"u"?e:(p(Bn)||(Bn=document.createElement("a")),Bn.href=e,Bn.href)}var Ye;function lo(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mn(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?e=mn("..",Ve("Core/buildModuleUrl.js")):e=Dr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new ke({url:yo(e)}),Ye.appendForwardSlash(),Ye}function Nr(e){return yo(Sn.toUrl(`../${e}`))}function wo(e){return lo().getDerivedResource({url:e}).url}var Qn;function Ve(e){return p(Qn)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?Qn=Nr:Qn=wo),Qn(e)}Ve._cesiumScriptRegex=mo;Ve._buildModuleUrlFromBaseUrl=wo;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=ke.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=lo;var bo=Ve;function kr(e,n,t){this.x=e,this.y=n,this.s=t}var Wn=kr;function ut(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=ke.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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 n=this._interpolationOrder,t=this._denominators=new Array(n+1),o=this._xTable=new Array(n+1),i=Math.pow(this._stepSizeDays,n);for(let r=0;r<=n;++r){t[r]=i,o[r]=r*this._stepSizeDays;for(let a=0;a<=n;++a)a!==r&&(t[r]*=r-a);t[r]=1/t[r]}this._work=new Array(n+1),this._coef=new Array(n+1)}var Fr=new ue(0,0,H.TAI);function at(e,n,t){let o=Fr;return o.dayNumber=n,o.secondsOfDay=t,ue.daysDifference(o,e._sampleZeroDateTT)}ut.prototype.preload=function(e,n,t,o){let i=at(this,e,n),r=at(this,t,o),a=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=a/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(ft(this,w));return Promise.all(l)};ut.prototype.computeXysRadians=function(e,n,t){let o=at(this,e,n);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,a=i-(r/2|0);a<0&&(a=0);let u=a+r;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-r,a<0&&(a=0));let d=!1,m=this._samples;if(p(m[a*3])||(ft(this,a/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(ft(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(t)?(t.x=0,t.y=0,t.s=0):t=new Wn(0,0,0);let l=o-a*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(a+v)*3;t.x+=T[v]*m[N++],t.y+=T[v]*m[N++],t.s+=T[v]*m[N]}return t};function ft(e,n){if(e._chunkDownloadsInProgress[n])return e._chunkDownloadsInProgress[n];let t,o=e._xysFileUrlTemplate;p(o)?t=o.getDerivedResource({templateValues:{0:n}}):t=new ke({url:bo(`Assets/IAU2006_XYS/IAU2006_XYS_${n}.json`)});let i=t.fetchJson().then(function(r){e._chunkDownloadsInProgress[n]=!1;let a=e._samples,u=r.samples,d=n*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)a[d+m]=u[m]});return e._chunkDownloadsInProgress[n]=i,i}var Oo=ut;function S(e,n,t,o){this.x=e??0,this.y=n??0,this.z=t??0,this.w=o??0}var gn=new g;S.fromAxisAngle=function(e,n,t){s.typeOf.object("axis",e),s.typeOf.number("angle",n);let o=n/2,i=Math.sin(o);gn=g.normalize(e,gn);let r=gn.x*i,a=gn.y*i,u=gn.z*i,d=Math.cos(o);return p(t)?(t.x=r,t.y=a,t.z=u,t.w=d,t):new S(r,a,u,d)};var Lr=[1,2,0],xr=new Array(3);S.fromRotationMatrix=function(e,n){s.typeOf.object("matrix",e);let t,o,i,r,a,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)t=Math.sqrt(l+1),a=.5*t,t=.5/t,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*t,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*t,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*t;else{let w=Lr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];t=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=xr;v[E]=.5*t,t=.5/t,a=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*t,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*t,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*t,o=-v[0],i=-v[1],r=-v[2]}return p(n)?(n.x=o,n.y=i,n.z=r,n.w=a,n):new S(o,i,r,a)};var go=new S,_o=new S,pt=new S,So=new S;S.fromHeadingPitchRoll=function(e,n){return s.typeOf.object("headingPitchRoll",e),So=S.fromAxisAngle(g.UNIT_X,e.roll,go),pt=S.fromAxisAngle(g.UNIT_Y,-e.pitch,n),n=S.multiply(pt,So,pt),_o=S.fromAxisAngle(g.UNIT_Z,-e.heading,go),S.multiply(_o,n,n)};var Hn=new g,ht=new g,Ee=new S,Ro=new S,$n=new S;S.packedLength=4;S.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};S.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new S),t.x=e[n],t.y=e[n+1],t.z=e[n+2],t.w=e[n+3],t};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,n,t,o){S.unpack(e,t*4,$n),S.conjugate($n,$n);for(let i=0,r=t-n+1;i<r;i++){let a=i*3;S.unpack(e,(n+i)*4,Ee),S.multiply(Ee,$n,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Hn);let u=S.computeAngle(Ee);p(o)||(o=[]),o[a]=Hn.x*u,o[a+1]=Hn.y*u,o[a+2]=Hn.z*u}};S.unpackInterpolationResult=function(e,n,t,o,i){p(i)||(i=new S),g.fromArray(e,0,ht);let r=g.magnitude(ht);return S.unpack(n,o*4,Ro),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(ht,r,Ee),S.multiply(Ee,Ro,i)};S.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=e.w,n};S.magnitudeSquared=function(e){return s.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,n){s.typeOf.object("result",n);let t=1/S.magnitude(e),o=e.x*t,i=e.y*t,r=e.z*t,a=e.w*t;return n.x=o,n.y=i,n.z=r,n.w=a,n};S.inverse=function(e,n){s.typeOf.object("result",n);let t=S.magnitudeSquared(e);return n=S.conjugate(e,n),S.multiplyByScalar(n,1/t,n)};S.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};S.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};S.negate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};S.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};S.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e.x,i=e.y,r=e.z,a=e.w,u=n.x,d=n.y,m=n.z,l=n.w,w=a*u+o*l+i*m-r*d,E=a*d-o*m+i*l+r*u,T=a*m+o*d-i*u+r*l,M=a*l-o*u-i*d-r*m;return t.x=w,t.y=E,t.z=T,t.w=M,t};S.multiplyByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};S.divideByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};S.computeAxis=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=e.w;if(Math.abs(t-1)<R.EPSILON6||Math.abs(t+1)<R.EPSILON6)return n.x=1,n.y=n.z=0,n;let o=1/Math.sqrt(1-t*t);return n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n};S.computeAngle=function(e){return s.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var dt=new S;S.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),dt=S.multiplyByScalar(n,t,dt),o=S.multiplyByScalar(e,1-t,o),S.add(dt,o,o)};var Eo=new S,mt=new S,yt=new S;S.slerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=S.dot(e,n),r=n;if(i<0&&(i=-i,r=Eo=S.negate(n,Eo)),1-i<R.EPSILON6)return S.lerp(e,r,t,o);let a=Math.acos(i);return mt=S.multiplyByScalar(e,Math.sin((1-t)*a),mt),yt=S.multiplyByScalar(r,Math.sin(t*a),yt),o=S.add(mt,yt,o),S.multiplyByScalar(o,1/Math.sin(a),o)};S.log=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=R.acosClamped(e.w),o=0;return t!==0&&(o=t/Math.sin(t)),g.multiplyByScalar(e,o,n)};S.exp=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=g.magnitude(e),o=0;return t!==0&&(o=Math.sin(t)/t),n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n.w=Math.cos(t),n};var Br=new g,Qr=new g,_n=new S,sn=new S;S.computeInnerQuadrangle=function(e,n,t,o){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("q2",t),s.typeOf.object("result",o);let i=S.conjugate(n,_n);S.multiply(i,t,sn);let r=S.log(sn,Br);S.multiply(i,e,sn);let a=S.log(sn,Qr);return g.add(r,a,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,_n),S.multiply(n,_n,o)};S.squad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=S.slerp(e,n,i,_n),u=S.slerp(t,o,i,sn);return S.slerp(a,u,2*i*(1-i),r)};var Wr=new S,To=1.9011074535173003,Yn=un.supportsTypedArrays()?new Float32Array(8):[],Vn=un.supportsTypedArrays()?new Float32Array(8):[],Ue=un.supportsTypedArrays()?new Float32Array(8):[],ze=un.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let n=e+1,t=2*n+1;Yn[e]=1/(n*t),Vn[e]=n/t}Yn[7]=To/(8*17);Vn[7]=To*8/17;S.fastSlerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=S.dot(e,n),r;i>=0?r=1:(r=-1,i=-i);let a=i-1,u=1-t,d=t*t,m=u*u;for(let T=7;T>=0;--T)Ue[T]=(Yn[T]*d-Vn[T])*a,ze[T]=(Yn[T]*m-Vn[T])*a;let l=r*t*(1+Ue[0]*(1+Ue[1]*(1+Ue[2]*(1+Ue[3]*(1+Ue[4]*(1+Ue[5]*(1+Ue[6]*(1+Ue[7])))))))),w=u*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),E=S.multiplyByScalar(e,w,Wr);return S.multiplyByScalar(n,l,o),S.add(E,o,o)};S.fastSquad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=S.fastSlerp(e,n,i,_n),u=S.fastSlerp(t,o,i,sn);return S.fastSlerp(a,u,2*i*(1-i),r)};S.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};S.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e.x-n.x)<=t&&Math.abs(e.y-n.y)<=t&&Math.abs(e.z-n.z)<=t&&Math.abs(e.w-n.w)<=t};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,n){return S.equalsEpsilon(this,e,n)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},lt={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"}},an={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wt={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},Fe=new g,Le=new g,xe=new g;$.localFrameToFixedFrameGenerator=function(e,n){if(!lt.hasOwnProperty(e)||!lt[e].hasOwnProperty(n))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let t=lt[e][n],o,i=e+n;return p(wt[i])?o=wt[i]:(o=function(r,a,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(an[e],0,Fe),g.unpack(an[n],0,Le),g.unpack(an[t],0,xe);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(an[e],0,Fe),e!=="east"&&e!=="west"&&g.multiplyByScalar(Fe,d,Fe),g.unpack(an[n],0,Le),n!=="east"&&n!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(an[t],0,xe),t!=="east"&&t!=="west"&&g.multiplyByScalar(xe,d,xe)}else{a=a??Ie.default,a.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),Fe=Oe[e],Le=Oe[n],xe=Oe[t]}return u[0]=Fe.x,u[1]=Fe.y,u[2]=Fe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=xe.x,u[9]=xe.y,u[10]=xe.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},wt[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Hr=new Xe,$r=new g(1,1,1),Yr=new J;$.headingPitchRollToFixedFrame=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(n,Hr),a=J.fromTranslationQuaternionRotationScale(g.ZERO,r,$r,Yr);return i=o(e,t,i),J.multiply(i,a,i)};var Vr=new J,Xr=new B;$.headingPitchRollQuaternion=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n);let r=$.headingPitchRollToFixedFrame(e,n,t,o,Vr),a=J.getMatrix3(r,Xr);return Xe.fromRotationMatrix(a,i)};var Zr=new g(1,1,1),Jr=new g,Co=new J,Gr=new J,Kr=new B,ei=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,n,t,o){s.defined("transform",e),n=n??Ie.default,t=t??$.eastNorthUpToFixedFrame,p(o)||(o=new xn);let i=J.getTranslation(e,Jr);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(t(i,n,Co),Co),a=J.setScale(e,Zr,Gr);a=J.setTranslation(a,g.ZERO,a),r=J.multiply(r,a,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,Kr),ei);return u=Xe.normalize(u,u),xn.fromQuaternion(u,o)};var ni=6*3600+41*60+50.54841,ti=8640184812866e-6,oi=.093104,ri=-62e-7,ii=11772758384668e-32,ci=72921158553e-15,si=R.TWO_PI/86400,Xn=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,n){let t=$.computeIcrfToFixedMatrix(e,n);return p(t)||(t=$.computeTemeToPseudoFixedMatrix(e,n)),t};$.computeTemeToPseudoFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");Xn=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Xn);let t=Xn.dayNumber,o=Xn.secondsOfDay,i,r=t-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ni+i*(ti+i*(oi+i*ri)))*si%R.TWO_PI,d=ci+ii*(t-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(n)?(n[0]=w,n[1]=-E,n[2]=0,n[3]=E,n[4]=w,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Oo;$.earthOrientationParameters=ho.NONE;var gt=32.184,ai=2451545;$.preloadIcrfFixed=function(e){let n=e.start.dayNumber,t=e.start.secondsOfDay+gt,o=e.stop.dayNumber,i=e.stop.secondsOfDay+gt;return $.iau2006XysData.preload(n,t,o,i)};$.computeIcrfToFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.computeFixedToIcrfMatrix(e,n);if(p(t))return B.transpose(t,n)};var fi=32.184,ui=2451545,Zn=new xn,pi=new B,hi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=ue.addSeconds(e,fi,hi),o=ue.totalDays(t)-ui,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,a=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Zn.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(a)-R.toRadians(.017)*Math.sin(u),Zn.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(a)+R.toRadians(.007)*Math.cos(u),Zn.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(a)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Zn,pi)};$.computeIcrfToMoonFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.computeMoonFixedToIcrfMatrix(e,n);if(p(t))return B.transpose(t,n)};var di=new Wn(0,0,0),mi=new hn(0,0,0,0,0,0),bt=new B,Ot=new B;$.computeFixedToIcrfMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.earthOrientationParameters.compute(e,mi);if(!p(t))return;let o=e.dayNumber,i=e.secondsOfDay+gt,r=$.iau2006XysData.computeXysRadians(o,i,di);if(!p(r))return;let a=r.x+t.xPoleOffset,u=r.y+t.yPoleOffset,d=1/(1+Math.sqrt(1-a*a-u*u)),m=bt;m[0]=1-d*a*a,m[3]=-d*a*u,m[6]=a,m[1]=-d*a*u,m[4]=1-d*u*u,m[7]=u,m[2]=-a,m[5]=-u,m[8]=1-d*(a*a+u*u);let l=B.fromRotationZ(-r.s,Ot),w=B.multiply(m,l,bt),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+t.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Ot),F=B.multiply(w,N,bt),k=Math.cos(t.xPoleWander),x=Math.cos(t.yPoleWander),Q=Math.sin(t.xPoleWander),W=Math.sin(t.yPoleWander),K=o-ai+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),te=Math.sin(oe),Z=Ot;return Z[0]=k*X,Z[1]=k*te,Z[2]=Q,Z[3]=-x*te+W*Q*X,Z[4]=x*X+W*Q*te,Z[5]=-W*k,Z[6]=-W*te-x*Q*X,Z[7]=W*X-x*Q*te,Z[8]=x*k,B.multiply(F,Z,n)};var yi=new qe;$.pointToWindowCoordinates=function(e,n,t,o){return o=$.pointToGLWindowCoordinates(e,n,t,o),o.y=2*n[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,n,t,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(n))throw new A("viewportTransformation is required.");if(!p(t))throw new A("point is required.");p(o)||(o=new be);let i=yi;return J.multiplyByVector(e,qe.fromElements(t.x,t.y,t.z,1,i),i),qe.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(n,i,i),be.fromCartesian4(i,o)};var li=new g,wi=new g,bi=new g;$.rotationMatrixFromPositionVelocity=function(e,n,t,o){if(!p(e))throw new A("position is required.");if(!p(n))throw new A("velocity is required.");let i=(t??Ie.default).geodeticSurfaceNormal(e,li),r=g.cross(n,i,wi);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let a=g.cross(r,n,bi);return g.normalize(a,a),g.cross(n,a,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=a.x,o[7]=a.y,o[8]=a.z,o};var vo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ao=new Me,_t=new g,Oi=new g,gi=new B,St=new J,jo=new J;$.basisTo2D=function(e,n,t){if(!p(e))throw new A("projection is required.");if(!p(n))throw new A("matrix is required.");if(!p(t))throw new A("result is required.");let o=J.getTranslation(n,Oi),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,_t);else{let l=i.cartesianToCartographic(o,Ao);r=e.project(l,_t),g.fromElements(r.z,r.x,r.y,r)}let a=$.eastNorthUpToFixedFrame(o,i,St),u=J.inverseTransformation(a,jo),d=J.getMatrix3(n,gi),m=J.multiplyByMatrix3(u,d,t);return J.multiply(vo,m,t),J.setTranslation(t,r,t),t};$.ellipsoidTo2DModelMatrix=function(e,n,t){if(!p(e))throw new A("projection is required.");if(!p(n))throw new A("center is required.");if(!p(t))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(n,o,St),r=J.inverseTransformation(i,jo),a=o.cartesianToCartographic(n,Ao),u=e.project(a,_t);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,St);return J.multiply(vo,r,t),J.multiply(d,t,t),t};var Mo=$;function L(e,n,t,o){this.west=e??0,this.south=n??0,this.east=t??0,this.north=o??0}Object.defineProperties(L.prototype,{width:{get:function(){return L.computeWidth(this)}},height:{get:function(){return L.computeHeight(this)}}});L.packedLength=4;L.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.west,n[t++]=e.south,n[t++]=e.east,n[t]=e.north,n};L.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new L),t.west=e[n++],t.south=e[n++],t.east=e[n++],t.north=e[n],t};L.computeWidth=function(e){s.typeOf.object("rectangle",e);let n=e.east,t=e.west;return n<t&&(n+=R.TWO_PI),n-t};L.computeHeight=function(e){return s.typeOf.object("rectangle",e),e.north-e.south};L.fromDegrees=function(e,n,t,o,i){return e=R.toRadians(e??0),n=R.toRadians(n??0),t=R.toRadians(t??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=n,i.east=t,i.north=o,i):new L(e,n,t,o)};L.fromRadians=function(e,n,t,o,i){return p(i)?(i.west=e??0,i.south=n??0,i.east=t??0,i.north=o??0,i):new L(e,n,t,o)};L.fromCartographicArray=function(e,n){s.defined("cartographics",e);let t=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];t=Math.min(t,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-t>r-i&&(t=i,o=r,o>R.PI&&(o=o-R.TWO_PI),t>R.PI&&(t=t-R.TWO_PI)),p(n)?(n.west=t,n.south=a,n.east=o,n.north=u,n):new L(t,a,o,u)};L.fromCartesianArray=function(e,n,t){s.defined("cartesians",e),n=n??Ie.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=n.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),a=Math.max(a,E)}return i-o>a-r&&(o=r,i=a,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(t)?(t.west=o,t.south=u,t.east=i,t.north=d,t):new L(o,u,i,d)};var _i=new g,Si=new g,Ri=new g,Ei=new g,Ti=new g,Rt=new Array(5);for(let e=0;e<Rt.length;++e)Rt[e]=new g;L.fromBoundingSphere=function(e,n,t){s.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(n)||(n=Ie.default),p(t)||(t=new L),g.equals(o,g.ZERO))return L.clone(L.MAX_VALUE,t),t;let r=Mo.eastNorthUpToFixedFrame(o,n,_i),a=J.multiplyByPointAsVector(r,g.UNIT_X,Si);g.normalize(a,a);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Ri);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(a,i,a);let d=g.negate(u,Ti),m=g.negate(a,Ei),l=Rt,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,a,w),l[4]=o,L.fromCartesianArray(l,n,t)};L.clone=function(e,n){if(p(e))return p(n)?(n.west=e.west,n.south=e.south,n.east=e.east,n.north=e.north,n):new L(e.west,e.south,e.east,e.north)};L.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e.west-n.west)<=t&&Math.abs(e.south-n.south)<=t&&Math.abs(e.east-n.east)<=t&&Math.abs(e.north-n.north)<=t};L.prototype.clone=function(e){return L.clone(this,e)};L.prototype.equals=function(e){return L.equals(this,e)};L.equals=function(e,n){return e===n||p(e)&&p(n)&&e.west===n.west&&e.south===n.south&&e.east===n.east&&e.north===n.north};L.prototype.equalsEpsilon=function(e,n){return L.equalsEpsilon(this,e,n)};L._validate=function(e){s.typeOf.object("rectangle",e);let n=e.north;s.typeOf.number.greaterThanOrEquals("north",n,-R.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("north",n,R.PI_OVER_TWO);let t=e.south;s.typeOf.number.greaterThanOrEquals("south",t,-R.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("south",t,R.PI_OVER_TWO);let o=e.west;s.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),s.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;s.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),s.typeOf.number.lessThanOrEquals("east",i,Math.PI)};L.southwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new Me(e.west,e.south)};L.northwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new Me(e.west,e.north)};L.northeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new Me(e.east,e.north)};L.southeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new Me(e.east,e.south)};L.center=function(e,n){s.typeOf.object("rectangle",e);let t=e.east,o=e.west;t<o&&(t+=R.TWO_PI);let i=R.negativePiToPi((o+t)*.5),r=(e.south+e.north)*.5;return p(n)?(n.longitude=i,n.latitude=r,n.height=0,n):new Me(i,r)};L.intersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=R.TWO_PI:r<a&&o>0&&(r+=R.TWO_PI),o<i&&a<0?a+=R.TWO_PI:r<a&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,a)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||n.west<n.east)&&d<=u)return;let m=Math.max(e.south,n.south),l=Math.min(e.north,n.north);if(!(m>=l))return p(t)?(t.west=u,t.south=m,t.east=d,t.north=l,t):new L(u,m,d,l)};L.simpleIntersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=Math.max(e.west,n.west),i=Math.max(e.south,n.south),r=Math.min(e.east,n.east),a=Math.min(e.north,n.north);if(!(i>=a||o>=r))return p(t)?(t.west=o,t.south=i,t.east=r,t.north=a,t):new L(o,i,r,a)};L.union=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n),p(t)||(t=new L);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=R.TWO_PI:r<a&&o>0&&(r+=R.TWO_PI),o<i&&a<0?a+=R.TWO_PI:r<a&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,a)),d=R.negativePiToPi(Math.max(o,r));return t.west=u,t.south=Math.min(e.south,n.south),t.east=d,t.north=Math.max(e.north,n.north),t};L.expand=function(e,n,t){return s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n),p(t)||(t=new L),t.west=Math.min(e.west,n.longitude),t.south=Math.min(e.south,n.latitude),t.east=Math.max(e.east,n.longitude),t.north=Math.max(e.north,n.latitude),t};L.contains=function(e,n){s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n);let t=n.longitude,o=n.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,t<0&&(t+=R.TWO_PI)),(t>i||R.equalsEpsilon(t,i,R.EPSILON14))&&(t<r||R.equalsEpsilon(t,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ci=new Me;L.subsample=function(e,n,t,o){s.typeOf.object("rectangle",e),n=n??Ie.default,t=t??0,p(o)||(o=[]);let i=0,r=e.north,a=e.south,u=e.east,d=e.west,m=Ci;m.height=t,m.longitude=d,m.latitude=r,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.latitude=a,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:a>0?m.latitude=a:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,L.contains(e,m)&&(o[i]=n.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++),o.length=i,o};L.subsection=function(e,n,t,o,i,r){if(s.typeOf.object("rectangle",e),s.typeOf.number.greaterThanOrEquals("westLerp",n,0),s.typeOf.number.lessThanOrEquals("westLerp",n,1),s.typeOf.number.greaterThanOrEquals("southLerp",t,0),s.typeOf.number.lessThanOrEquals("southLerp",t,1),s.typeOf.number.greaterThanOrEquals("eastLerp",o,0),s.typeOf.number.lessThanOrEquals("eastLerp",o,1),s.typeOf.number.greaterThanOrEquals("northLerp",i,0),s.typeOf.number.lessThanOrEquals("northLerp",i,1),s.typeOf.number.lessThanOrEquals("westLerp",n,o),s.typeOf.number.lessThanOrEquals("southLerp",t,i),p(r)||(r=new L),e.west<=e.east){let u=e.east-e.west;r.west=e.west+n*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+n*u),r.east=R.negativePiToPi(e.west+o*u)}let a=e.north-e.south;return r.south=e.south+t*a,r.north=e.south+i*a,n===1&&(r.west=e.east),o===1&&(r.east=e.east),t===1&&(r.south=e.north),i===1&&(r.north=e.north),r};L.MAX_VALUE=Object.freeze(new L(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var nf=L;function q(e,n,t,o){this[0]=e??0,this[1]=t??0,this[2]=n??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n};q.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new q),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t};q.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)q.pack(e[i],n,i*4);return n};q.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=q.unpack(e,o,n[i])}return n};q.clone=function(e,n){if(p(e))return p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,n){return s.defined("values",e),q.clone(e,n)};q.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[2],n[2]=e[1],n[3]=e[3],n):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=e.y,n):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=e,n):new q(e,0,0,e)};q.fromRotation=function(e,n){s.typeOf.number("angle",e);let t=Math.cos(e),o=Math.sin(e);return p(n)?(n[0]=t,n[1]=o,n[2]=-o,n[3]=t,n):new q(t,-o,o,t)};q.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):[e[0],e[1],e[2],e[3]]};q.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,1),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,1),e*2+n};q.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=n*2,i=e[o],r=e[o+1];return t.x=i,t.y=r,t};q.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=q.clone(e,o);let i=n*2;return o[i]=t.x,o[i+1]=t.y,o};q.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=e[n],i=e[n+2];return t.x=o,t.y=i,t};q.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=q.clone(e,o),o[n]=t.x,o[n+2]=t.y,o};var vi=new be;q.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=q.getScale(e,vi),i=n.x/o.x,r=n.y/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Ai=new be;q.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=q.getScale(e,Ai),i=n/o.x,r=n/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Po=new be;q.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=be.magnitude(be.fromElements(e[0],e[1],Po)),n.y=be.magnitude(be.fromElements(e[2],e[3],Po)),n};var Uo=new be;q.getMaximumScale=function(e){return q.getScale(e,Uo),be.maximumComponent(Uo)};var ji=new be;q.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=q.getScale(e,ji);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.y,t[3]=n[3]*o.y,t};var Mi=new be;q.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=q.getScale(e,Mi);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};q.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0]*n[0]+e[2]*n[1],i=e[0]*n[2]+e[2]*n[3],r=e[1]*n[0]+e[3]*n[1],a=e[1]*n[2]+e[3]*n[3];return t[0]=o,t[1]=r,t[2]=i,t[3]=a,t};q.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t};q.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t};q.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=e[0]*n.x+e[2]*n.y,i=e[1]*n.x+e[3]*n.y;return t.x=o,t.y=i,t};q.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};q.multiplyByScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t),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};q.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};q.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n};q.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[2],i=e[1],r=e[3];return n[0]=t,n[1]=o,n[2]=i,n[3]=r,n};q.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n};q.equals=function(e,n){return e===n||p(e)&&p(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]};q.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]};q.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,n){return q.equalsEpsilon(this,e,n)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var af=q;export{qe as a,J as b,De as c,ke as d,bo as e,Xe as f,Mo as g,nf as h,af as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A4L3VMPJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A4L3VMPJ.js deleted file mode 100644 index d2201c2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A4L3VMPJ.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",Ot;console.log("IndexedDB open","========");var gt;try{gt=window.indexedDB.open(Ir,1)}catch{}var qr=1024*1024*1024;var Es=qr*3;gt.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})};gt.onsuccess=function(e){Ot=e.target.result};gt.onerror=function(e){console.error("IndexedDB open error:",e.target.error)};function ao(e,t){if(!Ot)return;let o=Ot.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!Ot)n();else{let r=Ot.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},gt.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=Dr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function Dr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Nr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Nr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var kr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function Fr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function xr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var Lr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=kr.exec(e);if(u!==null){r.resolve(Fr(u,t));return}if(Lr){xr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Br(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Br);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Qr(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Qr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Wr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Wr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Hr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Hr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 $r=new ue(0,0,H.TAI);function pn(e,t,n){let o=$r;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var Yr=[1,2,0],Vr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=Yr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Vr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Xr=new g,Zr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Xr);S.multiply(i,e,st);let s=S.log(st,Zr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Jr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Jr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Gr=new Xe,Kr=new g(1,1,1),ei=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Gr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Kr,ei);return i=o(e,n,i),J.multiply(i,s,i)};var ti=new J,ni=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ti),s=J.getMatrix3(r,ni);return Xe.fromRotationMatrix(s,i)};var oi=new g(1,1,1),ri=new g,Po=new J,ii=new J,ci=new B,si=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,ri);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,oi,ii);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ci),si);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var ai=6*3600+41*60+50.54841,fi=8640184812866e-6,ui=.093104,pi=-62e-7,hi=11772758384668e-32,di=72921158553e-15,mi=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ai+i*(fi+i*(ui+i*pi)))*mi%R.TWO_PI,d=di+hi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,yi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var li=32.184,wi=2451545,Kt=new Wt,bi=new B,Oi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,li,Oi),o=ue.totalDays(n)-wi,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,bi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var gi=new Yt(0,0,0),_i=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,_i);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,gi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-yi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var Si=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=Si;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Ri=new g,Ei=new g,Ti=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Ri),r=g.cross(t,i,Ei);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ti);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ci=new g,vi=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ci),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,vi),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var Ai=new g,ji=new g,Mi=new g,Pi=new g,Ui=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,Ai),s=J.multiplyByPointAsVector(r,g.UNIT_X,ji);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Mi);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Ui),m=g.negate(s,Pi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var zi=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=zi;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var hf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var Ii=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var qi=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,qi),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var Di=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,Di);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Ni=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Ni);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var bf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,hf as h,bf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A4Y356GL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A4Y356GL.js deleted file mode 100644 index cff96de..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A4Y356GL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-HMAJSNAK.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-34GCBYYX.js";import{a as V,d as y}from"./chunk-CCZ6XI6A.js";import{b as G}from"./chunk-VPFNPTPP.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-A6LYFLOJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-A6LYFLOJ.js deleted file mode 100644 index 360ea25..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-A6LYFLOJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-MM26GJV3.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-B554QTY7.js";import{a as Et}from"./chunk-4STI2OZJ.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-2VGJ4QVX.js";import{a as _t,b as Ut,d as ot}from"./chunk-DUJ2U2S3.js";import{a as pt,b as H}from"./chunk-A3K2ZLIM.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AC4TD4ZJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AC4TD4ZJ.js deleted file mode 100644 index 4e56833..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AC4TD4ZJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-DNF254EX.js";import{a as At}from"./chunk-3JZYPFLA.js";import{a as yt}from"./chunk-BEESOPLV.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-WLRKMATH.js";import{a as lt,d as it}from"./chunk-OZA4MN4W.js";import{f as nt,h as bt}from"./chunk-FXKWBJNE.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AEEM7M2L.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AEEM7M2L.js deleted file mode 100644 index 165d208..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AEEM7M2L.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-5Y376J3P.js";import{a as I}from"./chunk-2P4SA4ZJ.js";import{b as B,c as G,d as k}from"./chunk-NJVZPI6A.js";import{b as j,h as X}from"./chunk-A4L3VMPJ.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AEP7LW36.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AEP7LW36.js deleted file mode 100644 index 93c1486..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AEP7LW36.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-Y5MQ7Q4T.js";import{a as I}from"./chunk-SFVU4I7K.js";import{b as B,c as G,d as k}from"./chunk-WHDDCNJ6.js";import{b as j,h as X}from"./chunk-ENETEM2P.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AHVYSSYY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AHVYSSYY.js deleted file mode 100644 index ddaf7a5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AHVYSSYY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-ODBYUYEB.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AMEMP742.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AMEMP742.js deleted file mode 100644 index 1751c64..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AMEMP742.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-AVM7XNMU.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ANZRIPXW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ANZRIPXW.js deleted file mode 100644 index baed03a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ANZRIPXW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-SGSO4PDT.js";import{a as At}from"./chunk-AOXXCVZW.js";import{a as yt}from"./chunk-HMAJSNAK.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-34GCBYYX.js";import{a as lt,d as it}from"./chunk-CCZ6XI6A.js";import{f as nt,h as bt}from"./chunk-VPFNPTPP.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AOXXCVZW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AOXXCVZW.js deleted file mode 100644 index 313cd48..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AOXXCVZW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-VPFNPTPP.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ATSUE4IK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ATSUE4IK.js deleted file mode 100644 index 0bb24b2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ATSUE4IK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-T4N45YIS.js";import{h as x}from"./chunk-NPMNTDSM.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AV2HKXAS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AV2HKXAS.js deleted file mode 100644 index fb73e43..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AV2HKXAS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-RDJ4UYGG.js";import{d as H}from"./chunk-FXULDDZU.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AVM7XNMU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AVM7XNMU.js deleted file mode 100644 index 1b37297..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AVM7XNMU.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{let o=function(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};return Cesium.ManageIndexedDB.GetManageIndexexDBState()?fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o()):o()}catch{}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AYKQZ4BO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AYKQZ4BO.js deleted file mode 100644 index 28abf47..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AYKQZ4BO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-QWQ7HFAB.js";import{a as Z,b as H}from"./chunk-DQ4U477U.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-NBE2CPYA.js";import{a as it}from"./chunk-TMD5QYHK.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-RDJ4UYGG.js";import{f as K}from"./chunk-Z3X57746.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AYSYNDKT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AYSYNDKT.js deleted file mode 100644 index f14172a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AYSYNDKT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-NJVZPI6A.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AZ2FU2B7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AZ2FU2B7.js deleted file mode 100644 index e13d145..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AZ2FU2B7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-G5IU4JGW.js";import{d as L}from"./chunk-3R7YZYAU.js";import{b as d,h as W}from"./chunk-76AWMMRZ.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-AZVTKWUJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-AZVTKWUJ.js deleted file mode 100644 index 74fb4d8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-AZVTKWUJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-SGDQE7H4.js";import{d as H}from"./chunk-WHDDCNJ6.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-B3LZ6ZW2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-B3LZ6ZW2.js deleted file mode 100644 index 0a91681..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-B3LZ6ZW2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-IU3JXFWW.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-B3NSNNUV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-B3NSNNUV.js deleted file mode 100644 index 7fc8c09..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-B3NSNNUV.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{e}from"./chunk-OVZZEY7C.js";function t(r){this.name="RuntimeError",this.message=r;let o;try{throw new Error}catch(s){o=s.stack}this.stack=o}e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t);t.prototype.toString=function(){let r=`${this.name}: ${this.message}`;return e(this.stack)&&(r+=` -${this.stack.toString()}`),r};var c=t;export{c as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-B554QTY7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-B554QTY7.js deleted file mode 100644 index dbb0595..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-B554QTY7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-DUJ2U2S3.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-B734VWRR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-B734VWRR.js deleted file mode 100644 index 589d3d3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-B734VWRR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-U7DFWOO3.js";import{a as Z,b as H}from"./chunk-JWNJJPN5.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-AYSYNDKT.js";import{a as it}from"./chunk-2P4SA4ZJ.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-ZAYZJA3R.js";import{f as K}from"./chunk-A4L3VMPJ.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BBGWUPII.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BBGWUPII.js deleted file mode 100644 index c15b776..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BBGWUPII.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-OL26GLX5.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BC2MYPBM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BC2MYPBM.js deleted file mode 100644 index 083448d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BC2MYPBM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-A24L4QN2.js";import{d as l}from"./chunk-ZA6CVU2J.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BEESOPLV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BEESOPLV.js deleted file mode 100644 index 1a17aba..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BEESOPLV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-QPZHRXZ6.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-BWWXWBXF.js";import{a as Et}from"./chunk-XCMSHRLY.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-WLRKMATH.js";import{a as _t,b as Ut,d as ot}from"./chunk-OZA4MN4W.js";import{a as pt,b as H}from"./chunk-FXKWBJNE.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BGOLYQDQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BGOLYQDQ.js deleted file mode 100644 index 388661f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BGOLYQDQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-WHOQYW75.js";import{d as H}from"./chunk-3R7YZYAU.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BIDFGZ7W.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BIDFGZ7W.js deleted file mode 100644 index 0e35350..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BIDFGZ7W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-TYCFEZIY.js";import{d as L}from"./chunk-HUYVXCIF.js";import{b as d,h as W}from"./chunk-OL26GLX5.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BNYNAA6Z.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BNYNAA6Z.js deleted file mode 100644 index 6261400..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BNYNAA6Z.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-AMEMP742.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-5KD2FCJ5.js";import{b as E,d as ie}from"./chunk-BSMSCZPP.js";import{a as C,b as F,f as D}from"./chunk-AVM7XNMU.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BO4T3WCV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BO4T3WCV.js deleted file mode 100644 index 4d0a98d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BO4T3WCV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-CCZ6XI6A.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BODFY54A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BODFY54A.js deleted file mode 100644 index 9923e7c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BODFY54A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-CXINSY4K.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BOPAQYS3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BOPAQYS3.js deleted file mode 100644 index df242e8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BOPAQYS3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-3R7YZYAU.js";import{h as x}from"./chunk-76AWMMRZ.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BOXFFUY5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BOXFFUY5.js deleted file mode 100644 index 89c3cce..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BOXFFUY5.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{e as u}from"./chunk-OVZZEY7C.js";function f(t){this.name="DeveloperError",this.message=t;let e;try{throw new Error}catch(o){e=o.stack}this.stack=e}u(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f);f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return u(this.stack)&&(t+=` -${this.stack.toString()}`),t};f.throwInstantiationError=function(){throw new f("This function defines an interface and should not be called directly.")};var r=f;var n={};n.typeOf={};function c(t){return`${t} is required, actual value was undefined`}function a(t,e,o){return`Expected ${o} to be typeof ${e}, actual typeof was ${t}`}n.defined=function(t,e){if(!u(e))throw new r(c(t))};n.typeOf.func=function(t,e){if(typeof e!="function")throw new r(a(typeof e,"function",t))};n.typeOf.string=function(t,e){if(typeof e!="string")throw new r(a(typeof e,"string",t))};n.typeOf.number=function(t,e){if(typeof e!="number")throw new r(a(typeof e,"number",t))};n.typeOf.number.lessThan=function(t,e,o){if(n.typeOf.number(t,e),e>=o)throw new r(`Expected ${t} to be less than ${o}, actual value was ${e}`)};n.typeOf.number.lessThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e>o)throw new r(`Expected ${t} to be less than or equal to ${o}, actual value was ${e}`)};n.typeOf.number.greaterThan=function(t,e,o){if(n.typeOf.number(t,e),e<=o)throw new r(`Expected ${t} to be greater than ${o}, actual value was ${e}`)};n.typeOf.number.greaterThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e<o)throw new r(`Expected ${t} to be greater than or equal to ${o}, actual value was ${e}`)};n.typeOf.object=function(t,e){if(typeof e!="object")throw new r(a(typeof e,"object",t))};n.typeOf.bool=function(t,e){if(typeof e!="boolean")throw new r(a(typeof e,"boolean",t))};n.typeOf.bigint=function(t,e){if(typeof e!="bigint")throw new r(a(typeof e,"bigint",t))};n.typeOf.number.equals=function(t,e,o,i){if(n.typeOf.number(t,o),n.typeOf.number(e,i),o!==i)throw new r(`${t} must be equal to ${e}, the actual values are ${o} and ${i}`)};var l=n;export{r as a,l as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BQGEOXB2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BQGEOXB2.js deleted file mode 100644 index d6bce1d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BQGEOXB2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-A24L4QN2.js";import{d as j}from"./chunk-ZA6CVU2J.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BQLI5W2E.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BQLI5W2E.js deleted file mode 100644 index 2e6024d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BQLI5W2E.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-SGDQE7H4.js";import{d as ht}from"./chunk-WHDDCNJ6.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BSHSPZS2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BSHSPZS2.js deleted file mode 100644 index 830d006..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BSHSPZS2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-YVBS4WYJ.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BSMSCZPP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BSMSCZPP.js deleted file mode 100644 index 00c7f7b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BSMSCZPP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-AVM7XNMU.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BWWXWBXF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BWWXWBXF.js deleted file mode 100644 index 824d2a3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BWWXWBXF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-OZA4MN4W.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-BWZHTLPP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-BWZHTLPP.js deleted file mode 100644 index e34d02b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-BWZHTLPP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-OZA4MN4W.js";import{h as x}from"./chunk-FXKWBJNE.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-C2D7B2B5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-C2D7B2B5.js deleted file mode 100644 index 9174587..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-C2D7B2B5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-MQB7GV4P.js";import{a as Z,b as H}from"./chunk-6JQLPYBQ.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-LO5P6EVV.js";import{a as it}from"./chunk-SFVU4I7K.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-SGDQE7H4.js";import{f as K}from"./chunk-ENETEM2P.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-C3PHUGHU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-C3PHUGHU.js deleted file mode 100644 index b626003..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-C3PHUGHU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-LSPQJS2I.js";import{a as At}from"./chunk-EY65AWRH.js";import{a as yt}from"./chunk-USXGVOKU.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-BBGWUPII.js";import{a as lt,d as it}from"./chunk-HUYVXCIF.js";import{f as nt,h as bt}from"./chunk-OL26GLX5.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CASNBMDG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CASNBMDG.js deleted file mode 100644 index 2032689..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CASNBMDG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-BBGWUPII.js";import{d as l}from"./chunk-HUYVXCIF.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CCRD2SOF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CCRD2SOF.js deleted file mode 100644 index d122366..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CCRD2SOF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-7HNQTPZY.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CCUNKJIF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CCUNKJIF.js deleted file mode 100644 index 43226c5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CCUNKJIF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-DPXA7VFT.js";import{a as U}from"./chunk-TDH4RANW.js";import{f as I}from"./chunk-ENETEM2P.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CCVUJ4RL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CCVUJ4RL.js deleted file mode 100644 index aac821e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CCVUJ4RL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-2PCKFVTE.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CCZ6XI6A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CCZ6XI6A.js deleted file mode 100644 index 12290c0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CCZ6XI6A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-VPFNPTPP.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CJXCHLZG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CJXCHLZG.js deleted file mode 100644 index 2c578e9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CJXCHLZG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-HY3NA4VQ.js";import{a as At}from"./chunk-K3VCVJVE.js";import{a as yt}from"./chunk-RD5EBYQO.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-NNNSDBCQ.js";import{a as lt,d as it}from"./chunk-T4N45YIS.js";import{f as nt,h as bt}from"./chunk-NPMNTDSM.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CQUN5S6E.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CQUN5S6E.js deleted file mode 100644 index d307371..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CQUN5S6E.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-65VSR2I4.js";import{a as te}from"./chunk-ZFFA2UHH.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-Z3X57746.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CUJOHOBY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CUJOHOBY.js deleted file mode 100644 index f8fc9db..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CUJOHOBY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-XBCBWMWB.js";import{a as U}from"./chunk-NL2AQYZR.js";import{f as I}from"./chunk-OL26GLX5.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CVLCYAKB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CVLCYAKB.js deleted file mode 100644 index e419ef1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CVLCYAKB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-WHSFAWNA.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CW2W75FS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CW2W75FS.js deleted file mode 100644 index 4e28c59..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CW2W75FS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-R4PUNGMZ.js";import{a as At}from"./chunk-RISC6EPB.js";import{a as yt}from"./chunk-MQB7GV4P.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-SGDQE7H4.js";import{a as lt,d as it}from"./chunk-WHDDCNJ6.js";import{f as nt,h as bt}from"./chunk-ENETEM2P.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CW7S2NZX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CW7S2NZX.js deleted file mode 100644 index a54330e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CW7S2NZX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-QMTXW4VP.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CXINSY4K.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CXINSY4K.js deleted file mode 100644 index a93009f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CXINSY4K.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-H6HCBMP2.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-CZX66LE3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-CZX66LE3.js deleted file mode 100644 index 9434762..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-CZX66LE3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-5KD2FCJ5.js";import{d as H}from"./chunk-BSMSCZPP.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DAECZ4MV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DAECZ4MV.js deleted file mode 100644 index 0069f3c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DAECZ4MV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-KZU6RORI.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DHCNOWTB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DHCNOWTB.js deleted file mode 100644 index 1da6fed..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DHCNOWTB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-T4A75GEN.js";import{a as I}from"./chunk-AMEMP742.js";import{b as B,c as G,d as k}from"./chunk-BSMSCZPP.js";import{b as j,h as X}from"./chunk-AVM7XNMU.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DJITW2PE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DJITW2PE.js deleted file mode 100644 index d2e08f7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DJITW2PE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-MM26GJV3.js";import{d as L}from"./chunk-DUJ2U2S3.js";import{b as d,h as W}from"./chunk-A3K2ZLIM.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DJONG6H5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DJONG6H5.js deleted file mode 100644 index 8e97bb4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DJONG6H5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-VPFNPTPP.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DMBRM43L.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DMBRM43L.js deleted file mode 100644 index b2e4330..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DMBRM43L.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-5ULDHPPR.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DNF254EX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DNF254EX.js deleted file mode 100644 index ef4d216..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DNF254EX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-FXKWBJNE.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DNPSKORP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DNPSKORP.js deleted file mode 100644 index ac12a5b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DNPSKORP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-CW7S2NZX.js";import{a as C}from"./chunk-Y7Y54VVF.js";import{b as L}from"./chunk-H6HCBMP2.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DPXA7VFT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DPXA7VFT.js deleted file mode 100644 index 554a72f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DPXA7VFT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-TDH4RANW.js";import{a as te}from"./chunk-Y5MQ7Q4T.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-ENETEM2P.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DQ4U477U.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DQ4U477U.js deleted file mode 100644 index 792f67b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DQ4U477U.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-RDJ4UYGG.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DUJ2U2S3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DUJ2U2S3.js deleted file mode 100644 index e672e74..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DUJ2U2S3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-A3K2ZLIM.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-DYKFHN3V.js b/src/renderer/public/sdk/Cesium/Workers/chunk-DYKFHN3V.js deleted file mode 100644 index 0318dd8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-DYKFHN3V.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-RDJ4UYGG.js";import{d as j}from"./chunk-FXULDDZU.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-E37TBOOO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-E37TBOOO.js deleted file mode 100644 index 35837f1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-E37TBOOO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-QMTXW4VP.js";import{h as x}from"./chunk-H6HCBMP2.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-E3KEZ4QR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-E3KEZ4QR.js deleted file mode 100644 index 5ef2ed1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-E3KEZ4QR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-MWDDKL2H.js";import{a as u,b as d}from"./chunk-B554QTY7.js";import{a as j}from"./chunk-4STI2OZJ.js";import{a as _,b as h,g as A}from"./chunk-A3K2ZLIM.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-EK6GOLXU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-EK6GOLXU.js deleted file mode 100644 index a8bad27..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-EK6GOLXU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as e}from"./chunk-MGW7GK6C.js";function r(t){t=t??e.EMPTY_OBJECT,this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var n=r;export{n as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ELRZCEDL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ELRZCEDL.js deleted file mode 100644 index 379a6e4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ELRZCEDL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-65RJEMLK.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-A24L4QN2.js";import{b as E,d as ie}from"./chunk-ZA6CVU2J.js";import{a as C,b as F,f as D}from"./chunk-IU3JXFWW.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ENETEM2P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ENETEM2P.js deleted file mode 100644 index 1a4ceea..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ENETEM2P.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{return Cesium.ManageIndexedDB.GetManageIndexexDBState()?fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o()):o()}catch{return o()}function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){try{Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r)}catch{}return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ENF2GT4K.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ENF2GT4K.js deleted file mode 100644 index 9e18ec3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ENF2GT4K.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-YWXO6FX2.js";import{a as At}from"./chunk-MINWOLZP.js";import{a as yt}from"./chunk-XI6BGJK3.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-WHOQYW75.js";import{a as lt,d as it}from"./chunk-3R7YZYAU.js";import{f as nt,h as bt}from"./chunk-76AWMMRZ.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-EP7GHWIN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-EP7GHWIN.js deleted file mode 100644 index d6fc477..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-EP7GHWIN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-FXULDDZU.js";import{h as x}from"./chunk-Z3X57746.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-EPFB26QY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-EPFB26QY.js deleted file mode 100644 index cc58ab4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-EPFB26QY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-JZUU4LFN.js";import{d as L}from"./chunk-4YKTCJME.js";import{b as d,h as W}from"./chunk-MKGFLCRO.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ERPH4BED.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ERPH4BED.js deleted file mode 100644 index 82fd0b3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ERPH4BED.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-ZA6CVU2J.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ETRX5M4H.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ETRX5M4H.js deleted file mode 100644 index ec10289..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ETRX5M4H.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-T4N45YIS.js";import{h as I,i as b}from"./chunk-NPMNTDSM.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-EY65AWRH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-EY65AWRH.js deleted file mode 100644 index c204c75..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-EY65AWRH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-OL26GLX5.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-EZMLIBYS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-EZMLIBYS.js deleted file mode 100644 index a48f761..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-EZMLIBYS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-TY7ZXIN2.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-5KD2FCJ5.js";import{d as E}from"./chunk-BSMSCZPP.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-F4ANYJ4I.js b/src/renderer/public/sdk/Cesium/Workers/chunk-F4ANYJ4I.js deleted file mode 100644 index 23fd77c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-F4ANYJ4I.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as c}from"./chunk-MGW7GK6C.js";import{b as t}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";function f(){this.high=c.clone(c.ZERO),this.low=c.clone(c.ZERO)}f.encode=function(n,o){t.typeOf.number("value",n),g(o)||(o={high:0,low:0});let h;return n>=0?(h=Math.floor(n/65536)*65536,o.high=h,o.low=n-h):(h=Math.floor(-n/65536)*65536,o.high=-h,o.low=n+h),o};var e={high:0,low:0};f.fromCartesian=function(n,o){t.typeOf.object("cartesian",n),g(o)||(o=new f);let h=o.high,i=o.low;return f.encode(n.x,e),h.x=e.high,i.x=e.low,f.encode(n.y,e),h.y=e.high,i.y=e.low,f.encode(n.z,e),h.z=e.high,i.z=e.low,o};var m=new f;f.writeElements=function(n,o,h){t.defined("cartesianArray",o),t.typeOf.number("index",h),t.typeOf.number.greaterThanOrEquals("index",h,0),f.fromCartesian(n,m);let i=m.high,w=m.low;o[h]=i.x,o[h+1]=i.y,o[h+2]=i.z,o[h+3]=w.x,o[h+4]=w.y,o[h+5]=w.z};var O=f;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-F53ZJJWZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-F53ZJJWZ.js deleted file mode 100644 index 66d4dda..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-F53ZJJWZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-T4N45YIS.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-F7556CQK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-F7556CQK.js deleted file mode 100644 index 02ea359..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-F7556CQK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-YE4R2EE7.js";import{h as x}from"./chunk-255CHCZV.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FHVNSICD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FHVNSICD.js deleted file mode 100644 index 8cb3605..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FHVNSICD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-SVV2TSM6.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-RDJ4UYGG.js";import{d as E}from"./chunk-FXULDDZU.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FJBT3N33.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FJBT3N33.js deleted file mode 100644 index 5153071..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FJBT3N33.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-FXULDDZU.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FQD5XO6L.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FQD5XO6L.js deleted file mode 100644 index 3f492e9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FQD5XO6L.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-5FLX3VRH.js";import{a as Z,b as H}from"./chunk-2K5M4ZYE.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-JCBDR53F.js";import{a as it}from"./chunk-65RJEMLK.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-A24L4QN2.js";import{f as K}from"./chunk-IU3JXFWW.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FSVIMGN5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FSVIMGN5.js deleted file mode 100644 index 3a4a244..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FSVIMGN5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-4YKTCJME.js";import{h as x}from"./chunk-MKGFLCRO.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FUK4M7FE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FUK4M7FE.js deleted file mode 100644 index 299bbf6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FUK4M7FE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-UKIWMELT.js";import{a as u,b as d}from"./chunk-KZM3XMI2.js";import{a as j}from"./chunk-JWULCKZP.js";import{a as _,b as h,g as A}from"./chunk-76AWMMRZ.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FXKWBJNE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FXKWBJNE.js deleted file mode 100644 index f5b2575..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FXKWBJNE.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as L,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,B=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=B(z>>>10&1023|55296),z=56320|z&1023),D+=B(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(B(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(B(c(de+ft%je,0))),he=k(ft/je);V.push(B(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,B=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=B("pathname",F[k]),r[k+"UrnPathSegment"]=B("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),B=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=B*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(L.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Bo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Lo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],B=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*B+w*Q+v*W,D=i*k+d*B+E*Q+I*W,Y=r*k+m*B+T*Q+N*W,re=s*k+l*B+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],B=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*B,y=i*F+u*k+l*B,O=r*F+d*k+w*B,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],B=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*B,c=i*F+u*k+l*B,f=r*F+d*k+w*B;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new L,$o=new L,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,B=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+B*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=B*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+B*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(B*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,B=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+B*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=B*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=B*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+B*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(L.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],B=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+B-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],B=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-B;break;case"-":s=s+k,u=u+B;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Bn(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Bn(i,t)),n[o]=i}return n}var nt=Bn;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Ln=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Ln.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",Ot;console.log("IndexedDB open","========");console.log("IndexedDB open",window);console.log("IndexedDB open2",indexedDB);var gt;window&&(gt=window.indexedDB.open(Ir,1));var qr=1024*1024*1024;var Es=qr*3;gt.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})};gt.onsuccess=function(e){Ot=e.target.result};gt.onerror=function(e){console.error("IndexedDB open error:",e.target.error)};function ao(e,t){if(!Ot)return;let o=Ot.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!Ot)n();else{let r=Ot.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},gt.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=Dr(i.query());this._queryParameters=t?Lt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function Dr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Lt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Nr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Nr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Lt(this._queryParameters,e,!1):this._queryParameters=Lt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Lt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var kr=/^data:(.*?)(;base64)?,(.*)$/;function Bt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Bt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function Fr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Bt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Bt(o,i),n);case"json":return JSON.parse(Bt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function xr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var Br=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=kr.exec(e);if(u!==null){r.resolve(Fr(u,t));return}if(Br){xr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,B=Qe(k,F,Lr);if(B<0){let Q=new te(F,I);k.splice(~B,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Qr(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Qr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Wr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Wr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Hr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Hr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 $r=new ue(0,0,H.TAI);function pn(e,t,n){let o=$r;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var Yr=[1,2,0],Vr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[L.COLUMN0ROW0],d=e[L.COLUMN1ROW1],m=e[L.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[L.COLUMN1ROW2]-e[L.COLUMN2ROW1])*n,i=(e[L.COLUMN2ROW0]-e[L.COLUMN0ROW2])*n,r=(e[L.COLUMN0ROW1]-e[L.COLUMN1ROW0])*n;else{let w=Yr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[L.getElementIndex(E,E)]-e[L.getElementIndex(T,T)]-e[L.getElementIndex(M,M)]+1);let v=Vr;v[E]=.5*n,n=.5/n,s=(e[L.getElementIndex(M,T)]-e[L.getElementIndex(T,M)])*n,v[T]=(e[L.getElementIndex(T,E)]+e[L.getElementIndex(E,T)])*n,v[M]=(e[L.getElementIndex(M,E)]+e[L.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Xr=new g,Zr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Xr);S.multiply(i,e,st);let s=S.log(st,Zr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Jr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Jr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Be=new g,Le=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Be),g.unpack(at[n],0,Le);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Be),t!=="east"&&t!=="west"&&g.multiplyByScalar(Be,d,Be),g.unpack(at[n],0,Le),n!=="east"&&n!=="west"&&g.multiplyByScalar(Le,d,Le)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Be=Oe[t],Le=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Be.x,u[5]=Be.y,u[6]=Be.z,u[7]=0,u[8]=Le.x,u[9]=Le.y,u[10]=Le.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Gr=new Xe,Kr=new g(1,1,1),ei=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Gr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Kr,ei);return i=o(e,n,i),J.multiply(i,s,i)};var ti=new J,ni=new L;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ti),s=J.getMatrix3(r,ni);return Xe.fromRotationMatrix(s,i)};var oi=new g(1,1,1),ri=new g,Po=new J,ii=new J,ci=new L,si=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,ri);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,oi,ii);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ci),si);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var ai=6*3600+41*60+50.54841,fi=8640184812866e-6,ui=.093104,pi=-62e-7,hi=11772758384668e-32,di=72921158553e-15,mi=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ai+i*(fi+i*(ui+i*pi)))*mi%R.TWO_PI,d=di+hi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new L(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,yi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return L.transpose(n,t)};var li=32.184,wi=2451545,Kt=new Wt,bi=new L,Oi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=ue.addSeconds(e,li,Oi),o=ue.totalDays(n)-wi,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),L.fromHeadingPitchRoll(Kt,bi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return L.transpose(n,t)};var gi=new Yt(0,0,0),_i=new ht(0,0,0,0,0,0),_n=new L,Sn=new L;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new L);let n=$.earthOrientationParameters.compute(e,_i);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,gi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=L.fromRotationZ(-r.s,Sn),w=L.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=L.fromRotationZ(I,Sn),F=L.multiply(w,N,_n),k=Math.cos(n.xPoleWander),B=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-yi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-B*ne+W*Q*X,Z[4]=B*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-B*Q*X,Z[7]=W*X-B*Q*ne,Z[8]=B*k,L.multiply(F,Z,t)};var Si=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=Si;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Ri=new g,Ei=new g,Ti=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Ri),r=g.cross(t,i,Ei);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ti);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new L),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ci=new g,vi=new L,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ci),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,vi),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var Ai=new g,ji=new g,Mi=new g,Pi=new g,Ui=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,Ai),s=J.multiplyByPointAsVector(r,g.UNIT_X,ji);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Mi);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Ui),m=g.negate(s,Pi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var zi=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=zi;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var hf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var Ii=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var qi=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,qi),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var Di=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,Di);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Ni=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Ni);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var bf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,hf as h,bf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-FXULDDZU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-FXULDDZU.js deleted file mode 100644 index 54687dd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-FXULDDZU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-Z3X57746.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-G5IU4JGW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-G5IU4JGW.js deleted file mode 100644 index 6017a9a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-G5IU4JGW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-76AWMMRZ.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-G5KXXUYH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-G5KXXUYH.js deleted file mode 100644 index 1f44e71..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-G5KXXUYH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-N4QQ5FWX.js";import{a as C}from"./chunk-HZEX5MXO.js";import{b as L}from"./chunk-NPMNTDSM.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-G675V32C.js b/src/renderer/public/sdk/Cesium/Workers/chunk-G675V32C.js deleted file mode 100644 index c82a7e6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-G675V32C.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-ZAYZJA3R.js";import{d as j}from"./chunk-NJVZPI6A.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GAOEVLU3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GAOEVLU3.js deleted file mode 100644 index 6c25624..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GAOEVLU3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-ND6FO376.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GAS6PLQ2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GAS6PLQ2.js deleted file mode 100644 index 1e08580..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GAS6PLQ2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-JWULCKZP.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-WHOQYW75.js";import{b as E,d as ie}from"./chunk-3R7YZYAU.js";import{a as C,b as F,f as D}from"./chunk-76AWMMRZ.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GC55BW6Q.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GC55BW6Q.js deleted file mode 100644 index 662c8b9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GC55BW6Q.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-LYHCBQ5D.js";import{d as L}from"./chunk-BSMSCZPP.js";import{b as d,h as W}from"./chunk-AVM7XNMU.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GDUPQZNM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GDUPQZNM.js deleted file mode 100644 index eb95442..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GDUPQZNM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-ERPH4BED.js";import{a as u,b as d}from"./chunk-JCBDR53F.js";import{a as j}from"./chunk-65RJEMLK.js";import{a as _,b as h,g as A}from"./chunk-IU3JXFWW.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GIDGP7AL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GIDGP7AL.js deleted file mode 100644 index dede8af..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GIDGP7AL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-H6HCBMP2.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GLTWLRO3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GLTWLRO3.js deleted file mode 100644 index 0659b68..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GLTWLRO3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-E3KEZ4QR.js";import{a as I}from"./chunk-4STI2OZJ.js";import{b as B,c as G,d as k}from"./chunk-DUJ2U2S3.js";import{b as j,h as X}from"./chunk-A3K2ZLIM.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GMJDH4BC.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GMJDH4BC.js deleted file mode 100644 index 275d68f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GMJDH4BC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-CCZ6XI6A.js";import{h as I,i as b}from"./chunk-VPFNPTPP.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GPQJ32YH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GPQJ32YH.js deleted file mode 100644 index 7d37160..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GPQJ32YH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-ZGP6ZNQR.js";import{a as te}from"./chunk-KHXD6UFU.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-FXKWBJNE.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GPU4NS2J.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GPU4NS2J.js deleted file mode 100644 index 0c56187..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GPU4NS2J.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-OZA4MN4W.js";import{h as I,i as b}from"./chunk-FXKWBJNE.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GQNQYKAA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GQNQYKAA.js deleted file mode 100644 index 32f4857..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GQNQYKAA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-U7DXVADV.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GRWCOIDY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GRWCOIDY.js deleted file mode 100644 index e9dfeef..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GRWCOIDY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-UOX6KQJA.js";import{a as te}from"./chunk-5Y376J3P.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-A4L3VMPJ.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GSF435LU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GSF435LU.js deleted file mode 100644 index 6465763..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GSF435LU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-RT7ONYAF.js";import{d as L}from"./chunk-YE4R2EE7.js";import{b as d,h as W}from"./chunk-255CHCZV.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GUSS76AO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GUSS76AO.js deleted file mode 100644 index f034896..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GUSS76AO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-KZU6RORI.js";import{d as ht}from"./chunk-4YKTCJME.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GUYEKV5Z.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GUYEKV5Z.js deleted file mode 100644 index 4206684..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GUYEKV5Z.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-ZB37QSBP.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-NXRSA4OE.js";import{a as V,d as y}from"./chunk-YE4R2EE7.js";import{b as G}from"./chunk-255CHCZV.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-GVNSIHVZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-GVNSIHVZ.js deleted file mode 100644 index 589aa26..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-GVNSIHVZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-IU3JXFWW.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-H5XNRALF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-H5XNRALF.js deleted file mode 100644 index 2332090..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-H5XNRALF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as fn,c as Tn}from"./chunk-OVZZEY7C.js";var Dn=Tn((nt,bt)=>{var _=_||{};_.scope={};_.arrayIteratorImpl=function(p){var c=0;return function(){return c<p.length?{done:!1,value:p[c++]}:{done:!0}}};_.arrayIterator=function(p){return{next:_.arrayIteratorImpl(p)}};_.makeIterator=function(p){var c=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return c?c.call(p):_.arrayIterator(p)};_.ASSUME_ES5=!1;_.ASSUME_NO_NATIVE_MAP=!1;_.ASSUME_NO_NATIVE_SET=!1;_.SIMPLE_FROUND_POLYFILL=!1;_.ISOLATE_POLYFILLS=!1;_.FORCE_POLYFILL_PROMISE=!1;_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;_.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var c=0;c<p.length;++c){var s=p[c];if(s&&s.Math==Math)return s}throw Error("Cannot find global object")};_.global=_.getGlobal(nt);_.defineProperty=_.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,c,s){return p==Array.prototype||p==Object.prototype||(p[c]=s.value),p};_.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol";_.TRUST_ES6_POLYFILLS=!_.ISOLATE_POLYFILLS||_.IS_SYMBOL_NATIVE;_.polyfills={};_.propertyToPolyfillSymbol={};_.POLYFILL_PREFIX="$jscp$";_.polyfill=function(p,c,s,y){c&&(_.ISOLATE_POLYFILLS?_.polyfillIsolated(p,c,s,y):_.polyfillUnisolated(p,c,s,y))};_.polyfillUnisolated=function(p,c,s,y){for(s=_.global,p=p.split("."),y=0;y<p.length-1;y++){var a=p[y];if(!(a in s))return;s=s[a]}p=p[p.length-1],y=s[p],c=c(y),c!=y&&c!=null&&_.defineProperty(s,p,{configurable:!0,writable:!0,value:c})};_.polyfillIsolated=function(p,c,s,y){var a=p.split(".");p=a.length===1,y=a[0],y=!p&&y in _.polyfills?_.polyfills:_.global;for(var g=0;g<a.length-1;g++){var i=a[g];if(!(i in y))return;y=y[i]}a=a[a.length-1],s=_.IS_SYMBOL_NATIVE&&s==="es6"?y[a]:null,c=c(s),c!=null&&(p?_.defineProperty(_.polyfills,a,{configurable:!0,writable:!0,value:c}):c!==s&&(_.propertyToPolyfillSymbol[a]===void 0&&(s=1e9*Math.random()>>>0,_.propertyToPolyfillSymbol[a]=_.IS_SYMBOL_NATIVE?_.global.Symbol(a):_.POLYFILL_PREFIX+s+"$"+a),_.defineProperty(y,_.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:c})))};_.polyfill("Promise",function(p){function c(){this.batch_=null}function s(i){return i instanceof a?i:new a(function(l,h){l(i)})}if(p&&(!(_.FORCE_POLYFILL_PROMISE||_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof _.global.PromiseRejectionEvent>"u")||!_.global.Promise||_.global.Promise.toString().indexOf("[native code]")===-1))return p;c.prototype.asyncExecute=function(i){if(this.batch_==null){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(i)};var y=_.global.setTimeout;c.prototype.asyncExecuteFunction=function(i){y(i,0)},c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var i=this.batch_;this.batch_=[];for(var l=0;l<i.length;++l){var h=i[l];i[l]=null;try{h()}catch(I){this.asyncThrow_(I)}}}this.batch_=null},c.prototype.asyncThrow_=function(i){this.asyncExecuteFunction(function(){throw i})};var a=function(i){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var l=this.createResolveAndReject_();try{i(l.resolve,l.reject)}catch(h){l.reject(h)}};a.prototype.createResolveAndReject_=function(){function i(I){return function(C){h||(h=!0,I.call(l,C))}}var l=this,h=!1;return{resolve:i(this.resolveTo_),reject:i(this.reject_)}},a.prototype.resolveTo_=function(i){if(i===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(i instanceof a)this.settleSameAsPromise_(i);else{t:switch(typeof i){case"object":var l=i!=null;break t;case"function":l=!0;break t;default:l=!1}l?this.resolveToNonPromiseObj_(i):this.fulfill_(i)}},a.prototype.resolveToNonPromiseObj_=function(i){var l=void 0;try{l=i.then}catch(h){this.reject_(h);return}typeof l=="function"?this.settleSameAsThenable_(l,i):this.fulfill_(i)},a.prototype.reject_=function(i){this.settle_(2,i)},a.prototype.fulfill_=function(i){this.settle_(1,i)},a.prototype.settle_=function(i,l){if(this.state_!=0)throw Error("Cannot settle("+i+", "+l+"): Promise already settled in state"+this.state_);this.state_=i,this.result_=l,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},a.prototype.scheduleUnhandledRejectionCheck_=function(){var i=this;y(function(){if(i.notifyUnhandledRejection_()){var l=_.global.console;typeof l<"u"&&l.error(i.result_)}},1)},a.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var i=_.global.CustomEvent,l=_.global.Event,h=_.global.dispatchEvent;return typeof h>"u"?!0:(typeof i=="function"?i=new i("unhandledrejection",{cancelable:!0}):typeof l=="function"?i=new l("unhandledrejection",{cancelable:!0}):(i=_.global.document.createEvent("CustomEvent"),i.initCustomEvent("unhandledrejection",!1,!0,i)),i.promise=this,i.reason=this.result_,h(i))},a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var i=0;i<this.onSettledCallbacks_.length;++i)g.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var g=new c;return a.prototype.settleSameAsPromise_=function(i){var l=this.createResolveAndReject_();i.callWhenSettled_(l.resolve,l.reject)},a.prototype.settleSameAsThenable_=function(i,l){var h=this.createResolveAndReject_();try{i.call(l,h.resolve,h.reject)}catch(I){h.reject(I)}},a.prototype.then=function(i,l){function h(f,T){return typeof f=="function"?function(G){try{I(f(G))}catch(V){C(V)}}:T}var I,C,K=new a(function(f,T){I=f,C=T});return this.callWhenSettled_(h(i,I),h(l,C)),K},a.prototype.catch=function(i){return this.then(void 0,i)},a.prototype.callWhenSettled_=function(i,l){function h(){switch(I.state_){case 1:i(I.result_);break;case 2:l(I.result_);break;default:throw Error("Unexpected state: "+I.state_)}}var I=this;this.onSettledCallbacks_==null?g.asyncExecute(h):this.onSettledCallbacks_.push(h),this.isRejectionHandled_=!0},a.resolve=s,a.reject=function(i){return new a(function(l,h){h(i)})},a.race=function(i){return new a(function(l,h){for(var I=_.makeIterator(i),C=I.next();!C.done;C=I.next())s(C.value).callWhenSettled_(l,h)})},a.all=function(i){var l=_.makeIterator(i),h=l.next();return h.done?s([]):new a(function(I,C){function K(G){return function(V){f[G]=V,T--,T==0&&I(f)}}var f=[],T=0;do f.push(void 0),T++,s(h.value).callWhenSettled_(K(f.length-1),C),h=l.next();while(!h.done)})},a},"es6","es3");_.owns=function(p,c){return Object.prototype.hasOwnProperty.call(p,c)};_.assign=_.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,c){for(var s=1;s<arguments.length;s++){var y=arguments[s];if(y)for(var a in y)_.owns(y,a)&&(p[a]=y[a])}return p};_.polyfill("Object.assign",function(p){return p||_.assign},"es6","es3");_.checkStringArgs=function(p,c,s){if(p==null)throw new TypeError("The 'this' value for String.prototype."+s+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+s+" must not be a regular expression");return p+""};_.polyfill("String.prototype.startsWith",function(p){return p||function(c,s){var y=_.checkStringArgs(this,c,"startsWith");c+="";var a=y.length,g=c.length;s=Math.max(0,Math.min(s|0,y.length));for(var i=0;i<g&&s<a;)if(y[s++]!=c[i++])return!1;return i>=g}},"es6","es3");_.polyfill("Array.prototype.copyWithin",function(p){function c(s){return s=Number(s),s===1/0||s===-1/0?s:s|0}return p||function(s,y,a){var g=this.length;if(s=c(s),y=c(y),a=a===void 0?g:c(a),s=0>s?Math.max(g+s,0):Math.min(s,g),y=0>y?Math.max(g+y,0):Math.min(y,g),a=0>a?Math.max(g+a,0):Math.min(a,g),s<y)for(;y<a;)y in this?this[s++]=this[y++]:(delete this[s++],y++);else for(a=Math.min(a,g+y-s),s+=a-y;a>y;)--a in this?this[--s]=this[a]:delete this[--s];return this}},"es6","es3");_.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin};_.polyfill("Int8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8ClampedArray.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float64Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");var dt=function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(c){function s(e){return t.locateFile?t.locateFile(e,Q):Q+e}function y(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&&Ot)return Ot.decode(e.subarray(r,n));for(o="";r<n;){var m=e[r++];if(m&128){var b=e[r++]&63;if((m&224)==192)o+=String.fromCharCode((m&31)<<6|b);else{var X=e[r++]&63;m=(m&240)==224?(m&15)<<12|b<<6|X:(m&7)<<18|b<<12|X<<6|e[r++]&63,65536>m?o+=String.fromCharCode(m):(m-=65536,o+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else o+=String.fromCharCode(m)}return o}function a(e,r){return e?y(tt,e,r):""}function g(){var e=_t.buffer;t.HEAP8=q=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=et=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function i(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",J(e),Gt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),ot(e),e}function l(e){try{if(e==z&&Z)return new Uint8Array(Z);if(ut)return ut(e);throw"both async and sync fetching of the wasm failed"}catch(r){i(r)}}function h(){if(!Z&&(It||$)){if(typeof fetch=="function"&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return l(z)});if(st)return new Promise(function(e,r){st(z,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return l(z)})}function I(e){for(;0<e.length;)e.shift()(t)}function C(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){et[this.ptr>>2]=r},this.set_caught=function(r){q[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(r){q[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return q[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){et[this.ptr>>2]+=1},this.release_ref=function(){var r=et[this.ptr>>2];return et[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ln(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function K(){function e(){if(!it&&(it=!0,t.calledRun=!0,!Gt)){if(Rt=!0,I(ct),ht(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());I(Pt)}}if(!(0<k)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());I(jt),0<k||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function f(){}function T(e){return(e||f).__cache__}function G(e,r){var n=T(r),o=n[e];return o||(o=Object.create((r||f).prototype),o.ptr=e,n[e]=o)}function V(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var m=0;m<e.length;++m){var b=e.charCodeAt(m);if(55296<=b&&57343>=b){var X=e.charCodeAt(++m);b=65536+((b&1023)<<10)|X&1023}if(127>=b){if(n>=o)break;r[n++]=b}else{if(2047>=b){if(n+1>=o)break;r[n++]=192|b>>6}else{if(65535>=b){if(n+2>=o)break;r[n++]=224|b>>12}else{if(n+3>=o)break;r[n++]=240|b>>18,r[n++]=128|b>>12&63}r[n++]=128|b>>6&63}r[n++]=128|b&63}}r[n]=0}return e=d.alloc(r,q),d.copy(r,q,e),e}return e}function at(e){if(typeof e=="object"){var r=d.alloc(e,q);return d.copy(e,q,r),r}return e}function H(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),T(B)[this.ptr]=this}function w(){this.ptr=Ft(),T(w)[this.ptr]=this}function Y(){this.ptr=wt(),T(Y)[this.ptr]=this}function A(){this.ptr=Vt(),T(A)[this.ptr]=this}function E(){this.ptr=Jt(),T(E)[this.ptr]=this}function j(){this.ptr=ne(),T(j)[this.ptr]=this}function P(){this.ptr=ae(),T(P)[this.ptr]=this}function O(){this.ptr=ce(),T(O)[this.ptr]=this}function W(){this.ptr=de(),T(W)[this.ptr]=this}function v(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),T(R)[this.ptr]=this}function S(){this.ptr=Ge(),T(S)[this.ptr]=this}function M(){this.ptr=Re(),T(M)[this.ptr]=this}function N(){this.ptr=Ue(),T(N)[this.ptr]=this}function U(){this.ptr=we(),T(U)[this.ptr]=this}function F(){this.ptr=We(),T(F)[this.ptr]=this}function L(){this.ptr=He(),T(L)[this.ptr]=this}function D(){this.ptr=Ke(),T(D)[this.ptr]=this}function u(){this.ptr=_r(),T(u)[this.ptr]=this}c=c===void 0?{}:c;var t=typeof c<"u"?c:{},ht,ot;t.ready=new Promise(function(e,r){ht=e,ot=r});var At=!1,Tt=!1;t.onRuntimeInitialized=function(){At=!0,Tt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){Tt=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Dt=Object.assign({},t),It=typeof window=="object",$=typeof importScripts=="function",gt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q="";if(gt){var vt=fn("fs"),pt=fn("path");Q=$?pt.dirname(Q)+"/":__dirname+"/";var Et=function(e,r){return e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFileSync(e,r?void 0:"utf8")},ut=function(e){return e=Et(e,!0),e.buffer||(e=new Uint8Array(e)),e},st=function(e,r,n){e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFile(e,function(o,m){o?n(o):r(m.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(It||$)&&($?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),p&&(Q=p),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Et=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},$&&(ut=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),st=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var dn=t.print||console.log.bind(console),J=t.printErr||console.warn.bind(console);Object.assign(t,Dt),Dt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&i("no native wasm support detected");var _t,Gt=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q,tt,et,x,jt=[],ct=[],Pt=[],Rt=!1,k=0,yt=null,rt=null,z="draco_decoder.wasm";z.startsWith("data:application/octet-stream;base64,")||(z=s(z));var bn=0,hn=[null,[],[]],An={b:function(e,r,n){throw new C(e).init(r,n),bn++,e},a:function(){i("")},g:function(e,r,n){tt.copyWithin(e,r,r+n)},e:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var m=Math;o=Math.max(e,o),m=m.min.call(m,2147483648,o+(65536-o%65536)%65536);t:{o=_t.buffer;try{_t.grow(m-o.byteLength+65535>>>16),g();var b=1;break t}catch{}b=void 0}if(b)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,m){return 70},c:function(e,r,n,o){for(var m=0,b=0;b<n;b++){var X=x[r>>2],mn=x[r+4>>2];r+=8;for(var lt=0;lt<mn;lt++){var mt=tt[X+lt],ft=hn[e];mt===0||mt===10?((e===1?dn:J)(y(ft,0)),ft.length=0):ft.push(mt)}m+=mn}return x[o>>2]=m,0}};(function(){function e(m,b){t.asm=m.exports,_t=t.asm.h,g(),ct.unshift(t.asm.i),k--,t.monitorRunDependencies&&t.monitorRunDependencies(k),k==0&&(yt!==null&&(clearInterval(yt),yt=null),rt&&(m=rt,rt=null,m()))}function r(m){e(m.instance)}function n(m){return h().then(function(b){return WebAssembly.instantiate(b,o)}).then(function(b){return b}).then(m,function(b){J("failed to asynchronously prepare wasm: "+b),i(b)})}var o={a:An};if(k++,t.monitorRunDependencies&&t.monitorRunDependencies(k),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(m){J("Module.instantiateWasm callback failed with error: "+m),ot(m)}return function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||z.startsWith("data:application/octet-stream;base64,")||z.startsWith("file://")||gt||typeof fetch!="function"?n(r):fetch(z,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,o).then(r,function(b){return J("wasm streaming compile failed: "+b),J("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(ot),{}})();var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Ct=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_INT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var ln=function(){return(ln=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var it;if(rt=function e(){it||K(),it||(rt=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();K(),f.prototype=Object.create(f.prototype),f.prototype.constructor=f,f.prototype.__class__=f,f.__cache__={},t.WrapperObject=f,t.getCache=T,t.wrapPointer=G,t.castObject=function(e,r){return G(e.ptr,r)},t.NULL=G(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete T(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var d={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(d.needed){for(var e=0;e<d.temps.length;e++)t._free(d.temps[e]);d.temps.length=0,t._free(d.buffer),d.buffer=0,d.size+=d.needed,d.needed=0}d.buffer||(d.size+=128,d.buffer=t._malloc(d.size),d.buffer||i(void 0)),d.pos=0},alloc:function(e,r){return d.buffer||i(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,d.pos+e>=d.size?(0<e||i(void 0),d.needed+=e,r=t._malloc(e),d.temps.push(r)):(r=d.buffer+d.pos,d.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return H.prototype=Object.create(f.prototype),H.prototype.constructor=H,H.prototype.__class__=H,H.__cache__={},t.VoidPtr=H,H.prototype.__destroy__=H.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(f.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(f.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Lt(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Ct(this.ptr)},Y.prototype=Object.create(f.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.GeometryAttribute=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){zt(this.ptr)},A.prototype=Object.create(f.prototype),A.prototype.constructor=A,A.prototype.__class__=A,A.__cache__={},t.PointAttribute=A,A.prototype.size=A.prototype.size=function(){return Bt(this.ptr)},A.prototype.GetAttributeTransformData=A.prototype.GetAttributeTransformData=function(){return G(Wt(this.ptr),w)},A.prototype.attribute_type=A.prototype.attribute_type=function(){return Qt(this.ptr)},A.prototype.data_type=A.prototype.data_type=function(){return xt(this.ptr)},A.prototype.num_components=A.prototype.num_components=function(){return Yt(this.ptr)},A.prototype.normalized=A.prototype.normalized=function(){return!!Ht(this.ptr)},A.prototype.byte_stride=A.prototype.byte_stride=function(){return qt(this.ptr)},A.prototype.byte_offset=A.prototype.byte_offset=function(){return kt(this.ptr)},A.prototype.unique_id=A.prototype.unique_id=function(){return Xt(this.ptr)},A.prototype.__destroy__=A.prototype.__destroy__=function(){Kt(this.ptr)},E.prototype=Object.create(f.prototype),E.prototype.constructor=E,E.prototype.__class__=E,E.__cache__={},t.AttributeQuantizationTransform=E,E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!$t(r,e)},E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Zt(this.ptr)},E.prototype.min_value=E.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},E.prototype.range=E.prototype.range=function(){return ee(this.ptr)},E.prototype.__destroy__=E.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(f.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},O.prototype=Object.create(f.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.Mesh=O,O.prototype.num_faces=O.prototype.num_faces=function(){return ye(this.ptr)},O.prototype.num_attributes=O.prototype.num_attributes=function(){return le(this.ptr)},O.prototype.num_points=O.prototype.num_points=function(){return me(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(f.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},v.prototype=Object.create(f.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.Status=v,v.prototype.code=v.prototype.code=function(){return he(this.ptr)},v.prototype.ok=v.prototype.ok=function(){return!!Ae(this.ptr)},v.prototype.error_msg=v.prototype.error_msg=function(){return a(Te(this.ptr))},v.prototype.__destroy__=v.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(f.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(f.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(f.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(f.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(f.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},L.prototype=Object.create(f.prototype),L.prototype.constructor=L,L.prototype.__class__=L,L.__cache__={},t.DracoUInt32Array=L,L.prototype.GetValue=L.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},L.prototype.size=L.prototype.size=function(){return ke(this.ptr)},L.prototype.__destroy__=L.prototype.__destroy__=function(){Xe(this.ptr)},D.prototype=Object.create(f.prototype),D.prototype.constructor=D,D.prototype.__class__=D,D.__cache__={},t.MetadataQuerier=D,D.prototype.HasEntry=D.prototype.HasEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),!!Je(n,e,r)},D.prototype.GetIntEntry=D.prototype.GetIntEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),$e(n,e,r)},D.prototype.GetIntEntryArray=D.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},D.prototype.GetDoubleEntry=D.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),tr(n,e,r)},D.prototype.GetStringEntry=D.prototype.GetStringEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),a(er(n,e,r))},D.prototype.NumEntries=D.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},D.prototype.GetEntryName=D.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),a(nr(n,e,r))},D.prototype.__destroy__=D.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(f.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ir(o,e,r,n),v)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ar(o,e,r,n),v)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n=n&&typeof n=="object"?n.ptr:V(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(cr(n,e,r),A)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(yr(n,e,r),A)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),G(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,m){var b=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),m&&typeof m=="object"&&(m=m.ptr),!!jr(b,e,r,n,o,m)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Sr(n,e,r),v)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Mr(n,e,r),v)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Lr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Cr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=Jr(),t.DT_INT32=$r(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():ct.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},c.ready}}();typeof nt=="object"&&typeof bt=="object"?bt.exports=dt:typeof define=="function"&&define.amd?define([],function(){return dt}):typeof nt=="object"&&(nt.DracoDecoderModule=dt)});export{Dn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-H6HCBMP2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-H6HCBMP2.js deleted file mode 100644 index 55aaad9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-H6HCBMP2.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch(e){console.error("error:",e)}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-H7HQRV7K.js b/src/renderer/public/sdk/Cesium/Workers/chunk-H7HQRV7K.js deleted file mode 100644 index a739d67..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-H7HQRV7K.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-4YKTCJME.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HGIPQK63.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HGIPQK63.js deleted file mode 100644 index a8478e7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HGIPQK63.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-WH7Z3BNJ.js";import{d as L}from"./chunk-T4N45YIS.js";import{b as d,h as W}from"./chunk-NPMNTDSM.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HGSBF6UH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HGSBF6UH.js deleted file mode 100644 index f32aad8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HGSBF6UH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-DUJ2U2S3.js";import{h as I,i as b}from"./chunk-A3K2ZLIM.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HHED4DQF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HHED4DQF.js deleted file mode 100644 index 299ba94..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HHED4DQF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-2VGJ4QVX.js";import{d as j}from"./chunk-DUJ2U2S3.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HIMYP7QY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HIMYP7QY.js deleted file mode 100644 index 7be56bb..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HIMYP7QY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-65O5AGVQ.js";import{a as At}from"./chunk-OENTOTMT.js";import{a as yt}from"./chunk-U7DFWOO3.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-ZAYZJA3R.js";import{a as lt,d as it}from"./chunk-NJVZPI6A.js";import{f as nt,h as bt}from"./chunk-A4L3VMPJ.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HLPDXSHW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HLPDXSHW.js deleted file mode 100644 index 9291d41..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HLPDXSHW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-CXINSY4K.js";import{d as H}from"./chunk-QMTXW4VP.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HMAJSNAK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HMAJSNAK.js deleted file mode 100644 index c4b8b53..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HMAJSNAK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-NINXVCBW.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-V5JG7NIH.js";import{a as Et}from"./chunk-DJONG6H5.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-34GCBYYX.js";import{a as _t,b as Ut,d as ot}from"./chunk-CCZ6XI6A.js";import{a as pt,b as H}from"./chunk-VPFNPTPP.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HNJRTQHB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HNJRTQHB.js deleted file mode 100644 index cedeada..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HNJRTQHB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var e={NONE:0,TOP:1,ALL:2},t=Object.freeze(e);export{t as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HPXIVWCW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HPXIVWCW.js deleted file mode 100644 index fa7f669..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HPXIVWCW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-XCMSHRLY.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-WLRKMATH.js";import{b as E,d as ie}from"./chunk-OZA4MN4W.js";import{a as C,b as F,f as D}from"./chunk-FXKWBJNE.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HT4RXP45.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HT4RXP45.js deleted file mode 100644 index 65e4d8a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HT4RXP45.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-2VGJ4QVX.js";import{d as l}from"./chunk-DUJ2U2S3.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HUYVXCIF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HUYVXCIF.js deleted file mode 100644 index 313aeac..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HUYVXCIF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-OL26GLX5.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HY3NA4VQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HY3NA4VQ.js deleted file mode 100644 index 19a40f2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HY3NA4VQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-NPMNTDSM.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HYAOHMSK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HYAOHMSK.js deleted file mode 100644 index ae191ff..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HYAOHMSK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-HZEX5MXO.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-NNNSDBCQ.js";import{b as E,d as ie}from"./chunk-T4N45YIS.js";import{a as C,b as F,f as D}from"./chunk-NPMNTDSM.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-HZEX5MXO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-HZEX5MXO.js deleted file mode 100644 index 8c3026f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-HZEX5MXO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-NPMNTDSM.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-I7G5IWDK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-I7G5IWDK.js deleted file mode 100644 index df3e108..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-I7G5IWDK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-KUWWELEK.js";import{a as I}from"./chunk-DJONG6H5.js";import{b as B,c as G,d as k}from"./chunk-CCZ6XI6A.js";import{b as j,h as X}from"./chunk-VPFNPTPP.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-IBDH4VHO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-IBDH4VHO.js deleted file mode 100644 index 3b911e4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-IBDH4VHO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-Z3X57746.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ID7ROH5M.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ID7ROH5M.js deleted file mode 100644 index 86d269d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ID7ROH5M.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-NJVZPI6A.js";import{h as x}from"./chunk-A4L3VMPJ.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-IFT7PF72.js b/src/renderer/public/sdk/Cesium/Workers/chunk-IFT7PF72.js deleted file mode 100644 index 8fe1826..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-IFT7PF72.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-5KD2FCJ5.js";import{d as l}from"./chunk-BSMSCZPP.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-IHVDVYHC.js b/src/renderer/public/sdk/Cesium/Workers/chunk-IHVDVYHC.js deleted file mode 100644 index dba4b84..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-IHVDVYHC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-H7HQRV7K.js";import{a as u,b as d}from"./chunk-ZLGB7AC5.js";import{a as j}from"./chunk-QQ2JU7XK.js";import{a as _,b as h,g as A}from"./chunk-MKGFLCRO.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ILUGD3VF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ILUGD3VF.js deleted file mode 100644 index 8108918..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ILUGD3VF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-GPQJ32YH.js";import{a as U}from"./chunk-ZGP6ZNQR.js";import{f as I}from"./chunk-FXKWBJNE.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ISMVKFQC.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ISMVKFQC.js deleted file mode 100644 index 1107c8a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ISMVKFQC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-QMTXW4VP.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ISNFIQH7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ISNFIQH7.js deleted file mode 100644 index 040887b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ISNFIQH7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-WHOQYW75.js";import{d as ht}from"./chunk-3R7YZYAU.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-IU3JXFWW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-IU3JXFWW.js deleted file mode 100644 index 4f972fe..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-IU3JXFWW.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Pe,c as be,d as De,e as B,f as _e,g as pt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Ct,c as vt,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=vt((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,W;function Q(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,Me;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&Q("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&Q("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&Q("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)Me=s-Te,pe>k(r/Me)&&Q("overflow"),pe*=Me;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&Q("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,Me,ut;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&Q("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&Q("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ut=he-de,Me=s-de,V.push(L(c(de+ut%Me,0))),he=k(ut/Me);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(W in i)i.hasOwnProperty(W)&&(t[W]=i[W]);else e.punycode=i})(et)});var Dn=vt((qn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=vt((Nn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Qe=vt((Fn,Dt)=>{/*! - * 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 Dt=="object"&&Dt.exports?Dt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var W=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=W("/","decodePathSegment"),r.decodeUrnPath=W(":","decodeUrnPathSegment"),r.recodePath=W("/","encodePathSegment","decode"),r.recodeUrnPath=W(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function Q(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=Q("protocol"),u.username=Q("username"),u.password=Q("password"),u.hostname=Q("hostname"),u.port=Q("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var At=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,At),j.magnitude(At)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,At),j.magnitudeSquared(At)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var Ne=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),W=-u+w-M+I,Q=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=W*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=Q*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,ht=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,ht),ht);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=ht.x,E=ht.y,T=ht.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Wo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Wo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Qo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Qo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],W=t[2],Q=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*W+v*Q,D=i*k+d*L+E*W+I*Q,Y=r*k+m*L+T*W+N*Q,re=s*k+l*L+M*W+F*Q,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,Me=r*y+m*O+T*C+N*b,ut=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=Me,n[15]=ut,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],W=t[8],Q=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*W+s*Q+m*K,b=i*W+u*Q+l*K,z=r*W+d*Q+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],W=o*E+s*T+m*M,Q=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=W,n[1]=Q,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new Ne,Vo=new Ne(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,W=T*v,Q=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+W*d+Q*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(W*s+oe*u+f*m),C=K*s+ne*u+f*d-(Q*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+W*i+Q*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=W*n+oe*o+f*r-(L*n+X*o+c*r),Y=Q*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,W=r*u,Q=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+W*I+Q*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(W*M+oe*v+f*N),fe=K*M+ne*v+f*I-(Q*M+Z*v+c*I),he=L*E+K*T+k*w-(Q*T+F*w+W*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+W*l-(c*T+L*l+X*w),pe=c*E+Q*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&Ne.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Ce=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var We=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var dt=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var mt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&mt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var jt=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ce=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new jt,Mt=[31,28,31,30,31,30,31,31,30,31,30,31],Pt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function zt(e){Ke.julianDate=e;let t=U.leapSeconds,n=We(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=We(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function ke(e,t,n){let o=t/ce.SECONDS_PER_DAY|0;return e+=o,t-=ce.SECONDS_PER_DAY*o,t<0&&(e--,t+=ce.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ce.SECONDS_PER_HOUR+i*ce.SECONDS_PER_MINUTE+s*ce.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Ee="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ce.SECONDS_PER_DAY,ke(o,t,this),n===H.UTC&&zt(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof jt))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(ke(n[0],n[1],t),zt(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(ke(n[0],n[1],t),zt(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Ee);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Ee);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Ee);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=mt(o),F<1||T&&F>366||!T&&F>365)throw new A(Ee)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Ee);let W=new Date(Date.UTC(o,0,4));F=k*7+L-W.getUTCDay()-3}else throw new A(Ee);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=mt(o),i<1||i>12||r<1||(i!==2||!T)&&r>Mt[i-1]||T&&i===2&&r>Pt)throw new A(Ee);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Ee);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Ee);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Ee);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Ee);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Pt:Mt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Pt:Mt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Pt:Mt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(ke(N[0],N[1],t),zt(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Ut=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Ut);p(o)||(U.addSeconds(e,-1,Ut),o=Un(Ut,Ut),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ce.SECONDS_PER_HOUR|0,M=r-T*ce.SECONDS_PER_HOUR,v=M/ce.SECONDS_PER_MINUTE|0;M=M-v*ce.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ce.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new jt(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ce.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ce.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ce.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=We(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return ke(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ce.SECONDS_PER_MINUTE;return ke(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ce.SECONDS_PER_HOUR;return ke(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return ke(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(Qe(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var Ue=hr;var Bn=Ze(Qe(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var yt=cn;var Wn=Ze(Qe(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Wn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Qn=dr;var Hn=Ze(Qe(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Nt=wr;var ve;function br(e){p(ve)||(ve=document.createElement("a")),ve.href=window.location.href;let t=ve.host,n=ve.protocol;return ve.href=e,ve.href=ve.href,n!==ve.protocol||t!==ve.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var kt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Er(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Er;var Rr={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ie=Object.freeze(Rr);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function Ft(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ie.UNISSUED,this.deferred=void 0,this.cancelled=!1}Ft.prototype.cancel=function(){this.cancelled=!0};Ft.prototype.clone=function(e){return p(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=ie.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Ft(this)};var Kn=Ft;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var lt=to;var xt=Ze(Qe(),1);function wt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(wt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});wt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};wt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}wt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=wt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var Ae=[],ze={},jr=typeof document<"u"?new xt.default(document.location.href):new xt.default,Lt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=Lt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return ze[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ie.UNISSUED&&(e.state=ie.ISSUED,e.deferred=Ue()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ie.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--ze[e.serverKey],Lt.raiseEvent(),e.state=ie.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ie.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--ze[e.serverKey],Lt.raiseEvent(t),e.state=ie.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ie.ACTIVE,Ae.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++ze[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ie.ACTIVE;if(e.state=ie.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--ze[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=Ae.length;for(e=0;e<o;++e){if(t=Ae[e],t.cancelled&&$e(t),t.state!==ie.ACTIVE){++n;continue}n>0&&(Ae[e-n]=t)}Ae.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-Ae.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new xt.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=ze[n];return p(o)||(ze[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),kt(e.url)||Nt(e.url))return Lt.raiseEvent(),e.state=ie.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(Ae.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=Ae.length;for(let t=0;t<e;++t)$e(Ae[t]);Ae.length=0,ze={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return ze[e]};se.requestHeap=le;var rt=se;var so=Ze(Qe(),1);var bt={},it={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(it[n])||(it[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(it[n])&&delete it[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(it[t]))};bt.clear=function(){it={}};var fn=bt;var Ir="mapDatabase",ct="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(ct)||t.createObjectStore(ct,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([ct],"readwrite").objectStore(ct),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([ct],"readonly").objectStore(ct).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=je(e.templateValues,{}),this._queryParameters=je(e.queryParameters,{}),this.headers=je(e.headers,{}),this.request=e.request??new Kn,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 je(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var st;P.supportsImageBitmapOptions=function(){return p(st)?st:typeof createImageBitmap!="function"?(st=Promise.resolve(!1),st):(st=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),st)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return kt(this._url)}},isBlobUri:{get:function(){return Nt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Wt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(yt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Wt(e,t,n){if(!n)return Ce(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Wt(this._queryParameters,e,!1):this._queryParameters=Wt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Wt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ce(this._templateValues,e):this._templateValues=Ce(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Ce(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Ce(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Ce(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Qn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(_t(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=Ue();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=rt.request(r);if(p(s))return s.catch(function(u){return r.state!==ie.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ie.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",_t(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=Ue();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=rt.request(i);if(p(s))return s.catch(function(u){return i.state!==ie.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ie.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;_t(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Ce(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=Ue(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=rt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ie.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ie.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{let o=function(){_t(t.request),n.requestFunction=function(){let r=e.responseType,s=Ce(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=Ue(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=rt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ie.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ie.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};return Cesium.ManageIndexedDB.GetManageIndexexDBState()?fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o()):o()}catch{return function(){_t(t.request),n.requestFunction=function(){let s=e.responseType,u=Ce(e.headers,t.headers),d=e.overrideMimeType,m=e.method,l=e.data,w=Ue(),E=P._Implementations.loadWithXhr(t.url,s,m,l,u,w,d);return p(E)&&p(E.abort)&&(n.cancelFunction=function(){E.abort()}),w.promise};let r=rt.request(n);if(p(r))return r.then(function(s){return n.cancelFunction=void 0,s}).catch(function(s){return n.cancelFunction=void 0,n.state!==ie.FAILED?Promise.reject(s):t.retryOnError(s).then(function(u){return u?(n.state=ie.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})}()}};function _t(e){if(e.state===ie.ISSUED||e.state===ie.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ie.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Bt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Bt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Bt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Bt(o,i),n);case"json":return JSON.parse(Bt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=je(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=je(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=je(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=je(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=je(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=je(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=je(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=Ue(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new lt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new lt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new lt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new lt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function Et(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Et.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Et({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};Et.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new dt(0,0,0,0,0),t}});Et.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new dt(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=We(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ce.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=We(k,F,Lr);if(L<0){let W=new te(F,I);k.splice(~L,0,W)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function St(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=St(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=St(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=St(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=St(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=St(l,T,M),s}var bo=Et;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Qt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=yt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Ct.toUrl)?e=yt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Wr(e){return go(Ct.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Ct.toUrl)?$t=Wr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Eo=Ve;function Qr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Qr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Eo(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Ro=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Re=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Re),S.multiply(Re,Xt,Re),Re.w<0&&S.negate(Re,Re),S.computeAxis(Re,Vt);let u=S.computeAngle(Re);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Re):S.fromAxisAngle(yn,r,Re),S.multiply(Re,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Tt=new S,at=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Tt);S.multiply(i,n,at);let r=S.log(at,Vr);S.multiply(i,e,at);let s=S.log(at,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Tt),S.multiply(t,Tt,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Tt),u=S.slerp(n,o,i,at);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=pt.supportsTypedArrays()?new Float32Array(8):[],Jt=pt.supportsTypedArrays()?new Float32Array(8):[],Ie=pt.supportsTypedArrays()?new Float32Array(8):[],qe=pt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)Ie[T]=(Zt[T]*d-Jt[T])*s,qe[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),w=u*(1+qe[0]*(1+qe[1]*(1+qe[2]*(1+qe[3]*(1+qe[4]*(1+qe[5]*(1+qe[6]*(1+qe[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Tt),u=S.fastSlerp(n,o,i,at);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},ft={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(ft[e],0,xe),g.unpack(ft[t],0,Le),g.unpack(ft[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(ft[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(ft[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(ft[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??De.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??De.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Qt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Qt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ce.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ce.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ce.SECONDS_PER_DAY*.5)%ce.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Ro;$.earthOrientationParameters=bo.NONE;var En=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+En,o=e.stop.dayNumber,i=e.stop.secondsOfDay+En;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Qt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new dt(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+En,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ce.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),W=Math.sin(n.xPoleWander),Q=Math.sin(n.yPoleWander),K=o-mi+i/ce.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=W,Z[3]=-L*ne+Q*W*X,Z[4]=L*X+Q*W*ne,Z[5]=-Q*k,Z[6]=-Q*ne-L*W*X,Z[7]=Q*X-L*W*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new Ne;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,Ne.fromElements(n.x,n.y,n.z,1,i),i),Ne.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ei=new g,Ri=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??De.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ei);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ri);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Pe,Rn=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,Rn);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,Rn),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,Rn);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??De.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=De.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Pe(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Pe(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Pe(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Pe(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Pe(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Pe;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??De.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{Ne as a,J as b,Ce as c,Fe as d,Eo as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-J4RA3VLE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-J4RA3VLE.js deleted file mode 100644 index 2c18b48..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-J4RA3VLE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-5IUKPU5Q.js";import{a}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new a("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new a("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new a("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,E,t){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("buffer is required.");switch(E=E??0,t=t??(e.byteLength-E)/r.getSizeInBytes(n),n){case r.BYTE:return new Int8Array(e,E,t);case r.UNSIGNED_BYTE:return new Uint8Array(e,E,t);case r.SHORT:return new Int16Array(e,E,t);case r.UNSIGNED_SHORT:return new Uint16Array(e,E,t);case r.INT:return new Int32Array(e,E,t);case r.UNSIGNED_INT:return new Uint32Array(e,E,t);case r.FLOAT:return new Float32Array(e,E,t);case r.DOUBLE:return new Float64Array(e,E,t);default:throw new a("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new a("name is not a valid value.")}};var A=Object.freeze(r);export{A as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-J6G3ODD3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-J6G3ODD3.js deleted file mode 100644 index 2d1fea1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-J6G3ODD3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-ENETEM2P.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-J6MTQVGW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-J6MTQVGW.js deleted file mode 100644 index 442c333..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-J6MTQVGW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-HUYVXCIF.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JCBDR53F.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JCBDR53F.js deleted file mode 100644 index dbfbd53..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JCBDR53F.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-ZA6CVU2J.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JFQFKCQN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JFQFKCQN.js deleted file mode 100644 index 51b1a93..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JFQFKCQN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-DJONG6H5.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-34GCBYYX.js";import{b as E,d as ie}from"./chunk-CCZ6XI6A.js";import{a as C,b as F,f as D}from"./chunk-VPFNPTPP.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JHDCQEDT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JHDCQEDT.js deleted file mode 100644 index 913ca25..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JHDCQEDT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-WHDDCNJ6.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JHKWWG2I.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JHKWWG2I.js deleted file mode 100644 index 97d67f8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JHKWWG2I.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-5KD2FCJ5.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JQA4D4QZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JQA4D4QZ.js deleted file mode 100644 index cf0d058..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JQA4D4QZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-FUK4M7FE.js";import{a as I}from"./chunk-JWULCKZP.js";import{b as B,c as G,d as k}from"./chunk-3R7YZYAU.js";import{b as j,h as X}from"./chunk-76AWMMRZ.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JQMWZIFY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JQMWZIFY.js deleted file mode 100644 index b6286aa..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JQMWZIFY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-HMAJSNAK.js";import{a as Z,b as H}from"./chunk-ZWQBJUQ6.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-V5JG7NIH.js";import{a as it}from"./chunk-DJONG6H5.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-34GCBYYX.js";import{f as K}from"./chunk-VPFNPTPP.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JWJYYHHF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JWJYYHHF.js deleted file mode 100644 index 413aab4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JWJYYHHF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-GLTWLRO3.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JWNJJPN5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JWNJJPN5.js deleted file mode 100644 index 96df3b2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JWNJJPN5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-ZAYZJA3R.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JWULCKZP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JWULCKZP.js deleted file mode 100644 index c7d321b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JWULCKZP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-76AWMMRZ.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JYKV6DZH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JYKV6DZH.js deleted file mode 100644 index a932784..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JYKV6DZH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-NNNSDBCQ.js";import{d as j}from"./chunk-T4N45YIS.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JZAYRSGP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JZAYRSGP.js deleted file mode 100644 index ecbc8a3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JZAYRSGP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-H6HCBMP2.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-JZUU4LFN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-JZUU4LFN.js deleted file mode 100644 index 5ca249a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-JZUU4LFN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-MKGFLCRO.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-K3VCVJVE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-K3VCVJVE.js deleted file mode 100644 index 39525db..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-K3VCVJVE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-NPMNTDSM.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-K4YNC4UT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-K4YNC4UT.js deleted file mode 100644 index 8e7f121..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-K4YNC4UT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-A4L3VMPJ.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KAEN44IR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KAEN44IR.js deleted file mode 100644 index 130cd9f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KAEN44IR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-WFYQVCMU.js";import{b as g}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var d=C.EPSILON10;function x(e,r,h,n){if(g.defined("equalsEpsilon",r),!f(e))return;h=h??!1;let c=f(n),l=e.length;if(l<2)return e;let i,s=e[0],o,t,p=0,m=-1;for(i=1;i<l;++i)o=e[i],r(s,o,d)?(f(t)||(t=e.slice(0,i),p=i-1,m=0),c&&n.push(i)):(f(t)&&(t.push(o),p=i,c&&(m=n.length)),s=o);return h&&r(e[0],e[l-1],d)&&(c&&(f(t)?n.splice(m,0,p):n.push(l-1)),f(t)?t.length-=1:t=e.slice(0,-1)),f(t)?t:e}var k=x;export{k as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KH3E3M3A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KH3E3M3A.js deleted file mode 100644 index e1f8c65..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KH3E3M3A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-MKGFLCRO.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KHXD6UFU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KHXD6UFU.js deleted file mode 100644 index 0b31418..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KHXD6UFU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-QW3YEGB3.js";import{a as u,b as d}from"./chunk-BWWXWBXF.js";import{a as j}from"./chunk-XCMSHRLY.js";import{a as _,b as h,g as A}from"./chunk-FXKWBJNE.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KJJG5ZYQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KJJG5ZYQ.js deleted file mode 100644 index c223cc7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KJJG5ZYQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-65VSR2I4.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KMW4OO4I.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KMW4OO4I.js deleted file mode 100644 index b144cdc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KMW4OO4I.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-34GCBYYX.js";import{d as H}from"./chunk-CCZ6XI6A.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KO227CAR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KO227CAR.js deleted file mode 100644 index ac87041..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KO227CAR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-ZGP6ZNQR.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KOARSSWM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KOARSSWM.js deleted file mode 100644 index 3ef32e8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KOARSSWM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-JZUU4LFN.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-ZLGB7AC5.js";import{a as Et}from"./chunk-QQ2JU7XK.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-KZU6RORI.js";import{a as _t,b as Ut,d as ot}from"./chunk-4YKTCJME.js";import{a as pt,b as H}from"./chunk-MKGFLCRO.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KOI2VCSO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KOI2VCSO.js deleted file mode 100644 index e935a3e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KOI2VCSO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-K4YNC4UT.js";import{d as L}from"./chunk-NJVZPI6A.js";import{b as d,h as W}from"./chunk-A4L3VMPJ.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KUWWELEK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KUWWELEK.js deleted file mode 100644 index 3f1d052..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KUWWELEK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-BO4T3WCV.js";import{a as u,b as d}from"./chunk-V5JG7NIH.js";import{a as j}from"./chunk-DJONG6H5.js";import{a as _,b as h,g as A}from"./chunk-VPFNPTPP.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KY25UUXN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KY25UUXN.js deleted file mode 100644 index dede10e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KY25UUXN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-BEESOPLV.js";import{a as Z,b as H}from"./chunk-3RCLXWWK.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-BWWXWBXF.js";import{a as it}from"./chunk-XCMSHRLY.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-WLRKMATH.js";import{f as K}from"./chunk-FXKWBJNE.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KYP7OKF3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KYP7OKF3.js deleted file mode 100644 index 06d6ffd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KYP7OKF3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-B554QTY7.js";import{a as C}from"./chunk-4STI2OZJ.js";import{b as L}from"./chunk-A3K2ZLIM.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KZM3XMI2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KZM3XMI2.js deleted file mode 100644 index 1f464ee..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KZM3XMI2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-3R7YZYAU.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-KZU6RORI.js b/src/renderer/public/sdk/Cesium/Workers/chunk-KZU6RORI.js deleted file mode 100644 index ba1ba78..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-KZU6RORI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-MKGFLCRO.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-L6WGY4JW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-L6WGY4JW.js deleted file mode 100644 index f21ffa8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-L6WGY4JW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-WLRKMATH.js";import{d as j}from"./chunk-OZA4MN4W.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LDAMYOT3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LDAMYOT3.js deleted file mode 100644 index fee057b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LDAMYOT3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-A6LYFLOJ.js";import{a as Z,b as H}from"./chunk-M3Y4OHDA.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-B554QTY7.js";import{a as it}from"./chunk-4STI2OZJ.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-2VGJ4QVX.js";import{f as K}from"./chunk-A3K2ZLIM.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LFMGBZZM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LFMGBZZM.js deleted file mode 100644 index e291fe3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LFMGBZZM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-POTM4NUQ.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-CW7S2NZX.js";import{a as Et}from"./chunk-Y7Y54VVF.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-CXINSY4K.js";import{a as _t,b as Ut,d as ot}from"./chunk-QMTXW4VP.js";import{a as pt,b as H}from"./chunk-H6HCBMP2.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LO5P6EVV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LO5P6EVV.js deleted file mode 100644 index dd8de88..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LO5P6EVV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-WHDDCNJ6.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LOJ56F7P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LOJ56F7P.js deleted file mode 100644 index 8923ef5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LOJ56F7P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-GVNSIHVZ.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-A24L4QN2.js";import{d as E}from"./chunk-ZA6CVU2J.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LSPQJS2I.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LSPQJS2I.js deleted file mode 100644 index c15d0be..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LSPQJS2I.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-OL26GLX5.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LU6XLEYX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LU6XLEYX.js deleted file mode 100644 index 2a6d82d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LU6XLEYX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-6ZVBKUW7.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LWD3R7NU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LWD3R7NU.js deleted file mode 100644 index ca1e506..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LWD3R7NU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-BBGWUPII.js";import{d as j}from"./chunk-HUYVXCIF.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LYEJWTAZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LYEJWTAZ.js deleted file mode 100644 index 9ba6cb1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LYEJWTAZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-ZFFA2UHH.js";import{a as I}from"./chunk-TMD5QYHK.js";import{b as B,c as G,d as k}from"./chunk-FXULDDZU.js";import{b as j,h as X}from"./chunk-Z3X57746.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LYH4IL7J.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LYH4IL7J.js deleted file mode 100644 index 68f8346..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LYH4IL7J.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-65CSGAYD.js";import{d as L}from"./chunk-ZA6CVU2J.js";import{b as d,h as W}from"./chunk-IU3JXFWW.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-LYHCBQ5D.js b/src/renderer/public/sdk/Cesium/Workers/chunk-LYHCBQ5D.js deleted file mode 100644 index 8ade79c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-LYHCBQ5D.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-AVM7XNMU.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-M3Y4OHDA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-M3Y4OHDA.js deleted file mode 100644 index a567f38..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-M3Y4OHDA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-2VGJ4QVX.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-M4LUEIHP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-M4LUEIHP.js deleted file mode 100644 index 4a4d627..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-M4LUEIHP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-2VGJ4QVX.js";import{d as H}from"./chunk-DUJ2U2S3.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MECM573T.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MECM573T.js deleted file mode 100644 index c66ad98..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MECM573T.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-RDJ4UYGG.js";import{d as ht}from"./chunk-FXULDDZU.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MEJLEB3E.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MEJLEB3E.js deleted file mode 100644 index 040e272..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MEJLEB3E.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-A6LYFLOJ.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-2VGJ4QVX.js";import{a as V,d as y}from"./chunk-DUJ2U2S3.js";import{b as G}from"./chunk-A3K2ZLIM.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MGIFDCDH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MGIFDCDH.js deleted file mode 100644 index 63e824a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MGIFDCDH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-WHDDCNJ6.js";import{h as I,i as b}from"./chunk-ENETEM2P.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MGW7GK6C.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MGW7GK6C.js deleted file mode 100644 index ee35596..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MGW7GK6C.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-WFYQVCMU.js";import{a as g,b as c}from"./chunk-BOXFFUY5.js";import{e as u}from"./chunk-OVZZEY7C.js";function f(n,e,o){this.x=n??0,this.y=e??0,this.z=o??0}f.fromSpherical=function(n,e){c.typeOf.object("spherical",n),u(e)||(e=new f);let o=n.clock,t=n.cone,i=n.magnitude??1,p=i*Math.sin(t);return e.x=p*Math.cos(o),e.y=p*Math.sin(o),e.z=i*Math.cos(t),e};f.fromElements=function(n,e,o,t){return u(t)?(t.x=n,t.y=e,t.z=o,t):new f(n,e,o)};f.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e.z=n.z,e):new f(n.x,n.y,n.z)};f.fromCartesian4=f.clone;f.packedLength=3;f.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n.x,e[o++]=n.y,e[o]=n.z,e};f.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new f),o.x=n[e++],o.y=n[e++],o.z=n[e],o};f.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*3;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 3 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)f.pack(n[i],e,i*3);return e};f.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new g("array length must be a multiple of 3.");let o=n.length;u(e)?e.length=o/3:e=new Array(o/3);for(let t=0;t<o;t+=3){let i=t/3;e[i]=f.unpack(n,t,e[i])}return e};f.fromArray=f.unpack;f.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)};f.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)};f.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o.z=Math.min(n.z,e.z),o};f.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o.z=Math.max(n.z,e.z),o};f.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=h.clamp(n.x,e.x,o.x),p=h.clamp(n.y,e.y,o.y),d=h.clamp(n.z,e.z,o.z);return t.x=i,t.y=p,t.z=d,t};f.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z};f.magnitude=function(n){return Math.sqrt(f.magnitudeSquared(n))};var X=new f;f.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,X),f.magnitude(X)};f.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,X),f.magnitudeSquared(X)};f.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,e.z=n.z/o,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new g("normalized result is not a number");return e};f.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y+n.z*e.z};f.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o.z=n.z*e.z,o};f.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o.z=n.z/e.z,o};f.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o.z=n.z+e.z,o};f.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o.z=n.z-e.z,o};f.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o.z=n.z*e,o};f.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o.z=n.z/e,o};f.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e.z=-n.z,e};f.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e.z=Math.abs(n.z),e};var Tn=new f;f.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),f.multiplyByScalar(e,o,Tn),t=f.multiplyByScalar(n,1-o,t),f.add(Tn,t,t)};var Y=new f,dn=new f;f.angleBetween=function(n,e){c.typeOf.object("left",n),c.typeOf.object("right",e),f.normalize(n,Y),f.normalize(e,dn);let o=f.dot(Y,dn),t=f.magnitude(f.cross(Y,dn,Y));return Math.atan2(t,o)};var Yn=new f;f.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.normalize(n,Yn);return f.abs(o,o),o.x<=o.y?o.x<=o.z?e=f.clone(f.UNIT_X,e):e=f.clone(f.UNIT_Z,e):o.y<=o.z?e=f.clone(f.UNIT_Y,e):e=f.clone(f.UNIT_Z,e),e};f.projectVector=function(n,e,o){c.defined("a",n),c.defined("b",e),c.defined("result",o);let t=f.dot(n,e)/f.dot(e,e);return f.multiplyByScalar(e,t,o)};f.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y&&n.z===e.z};f.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]&&n.z===e[o+2]};f.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&h.equalsEpsilon(n.x,e.x,o,t)&&h.equalsEpsilon(n.y,e.y,o,t)&&h.equalsEpsilon(n.z,e.z,o,t)};f.cross=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n.x,i=n.y,p=n.z,d=e.x,m=e.y,s=e.z,b=i*s-p*m,w=p*d-t*s,S=t*m-i*d;return o.x=b,o.y=w,o.z=S,o};f.midpoint=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=(n.x+e.x)*.5,o.y=(n.y+e.y)*.5,o.z=(n.z+e.z)*.5,o};f.fromDegrees=function(n,e,o,t,i){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=h.toRadians(n),e=h.toRadians(e),f.fromRadians(n,e,o,t,i)};var T=new f,V=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);f.fromRadians=function(n,e,o,t,i){c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=o??0;let p=u(t)?t.radiiSquared:f._ellipsoidRadiiSquared,d=Math.cos(e);T.x=d*Math.cos(n),T.y=d*Math.sin(n),T.z=Math.sin(e),T=f.normalize(T,T),f.multiplyComponents(p,T,V);let m=Math.sqrt(f.dot(T,V));return V=f.divideByScalar(V,m,V),T=f.multiplyByScalar(T,o,T),u(i)||(i=new f),f.add(V,T,i)};f.fromDegreesArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new g("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromDegrees(p,d,0,e,o[m])}return o};f.fromRadiansArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new g("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromRadians(p,d,0,e,o[m])}return o};f.fromDegreesArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new g("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromDegrees(p,d,m,e,o[s])}return o};f.fromRadiansArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new g("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromRadians(p,d,m,e,o[s])}return o};f.ZERO=Object.freeze(new f(0,0,0));f.ONE=Object.freeze(new f(1,1,1));f.UNIT_X=Object.freeze(new f(1,0,0));f.UNIT_Y=Object.freeze(new f(0,1,0));f.UNIT_Z=Object.freeze(new f(0,0,1));f.prototype.clone=function(n){return f.clone(this,n)};f.prototype.equals=function(n){return f.equals(this,n)};f.prototype.equalsEpsilon=function(n,e,o){return f.equalsEpsilon(this,n,e,o)};f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var y=f;var Xn=new y,Gn=new y;function Hn(n,e,o,t,i){if(!u(n))throw new g("cartesian is required.");if(!u(e))throw new g("oneOverRadii is required.");if(!u(o))throw new g("oneOverRadiiSquared is required.");if(!u(t))throw new g("centerToleranceSquared is required.");let p=n.x,d=n.y,m=n.z,s=e.x,b=e.y,w=e.z,S=p*p*s*s,R=d*d*b*b,M=m*m*w*w,C=S+R+M,_=Math.sqrt(1/C),N=y.multiplyByScalar(n,_,Xn);if(C<t)return isFinite(_)?y.clone(N,i):void 0;let B=o.x,U=o.y,P=o.z,F=Gn;F.x=N.x*B*2,F.y=N.y*U*2,F.z=N.z*P*2;let Z=(1-_)*y.magnitude(n)/(.5*y.magnitude(F)),Mn=0,rn,qn,I,L,W,pn,un,an,En,An,_n;do{Z-=Mn,I=1/(1+Z*B),L=1/(1+Z*U),W=1/(1+Z*P),pn=I*I,un=L*L,an=W*W,En=pn*I,An=un*L,_n=an*W,rn=S*pn+R*un+M*an-1,qn=S*En*B+R*An*U+M*_n*P;let Zn=-2*qn;Mn=rn/Zn}while(Math.abs(rn)>h.EPSILON12);return u(i)?(i.x=p*I,i.y=d*L,i.z=m*W,i):new y(p*I,d*L,m*W)}var G=Hn;function j(n,e,o){this.longitude=n??0,this.latitude=e??0,this.height=o??0}j.fromRadians=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=o??0,u(t)?(t.longitude=n,t.latitude=e,t.height=o,t):new j(n,e,o)};j.fromDegrees=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=h.toRadians(n),e=h.toRadians(e),j.fromRadians(n,e,o,t)};var Qn=new y,Jn=new y,Kn=new y;j._ellipsoidOneOverRadii=new y(1/6378137,1/6378137,1/6356752314245179e-9);j._ellipsoidOneOverRadiiSquared=new y(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));j._ellipsoidCenterToleranceSquared=h.EPSILON1;j.fromCartesian=function(n,e,o){let t=u(e)?e.oneOverRadii:j._ellipsoidOneOverRadii,i=u(e)?e.oneOverRadiiSquared:j._ellipsoidOneOverRadiiSquared,p=u(e)?e._centerToleranceSquared:j._ellipsoidCenterToleranceSquared,d=G(n,t,i,p,Jn);if(!u(d))return;let m=y.multiplyComponents(d,i,Qn);m=y.normalize(m,m);let s=y.subtract(n,d,Kn),b=Math.atan2(m.y,m.x),w=Math.asin(m.z),S=h.sign(y.dot(s,n))*y.magnitude(s);return u(o)?(o.longitude=b,o.latitude=w,o.height=S,o):new j(b,w,S)};j.toCartesian=function(n,e,o){return c.defined("cartographic",n),y.fromRadians(n.longitude,n.latitude,n.height,e,o)};j.clone=function(n,e){if(u(n))return u(e)?(e.longitude=n.longitude,e.latitude=n.latitude,e.height=n.height,e):new j(n.longitude,n.latitude,n.height)};j.equals=function(n,e){return n===e||u(n)&&u(e)&&n.longitude===e.longitude&&n.latitude===e.latitude&&n.height===e.height};j.equalsEpsilon=function(n,e,o){return o=o??0,n===e||u(n)&&u(e)&&Math.abs(n.longitude-e.longitude)<=o&&Math.abs(n.latitude-e.latitude)<=o&&Math.abs(n.height-e.height)<=o};j.ZERO=Object.freeze(new j(0,0,0));j.prototype.clone=function(n){return j.clone(this,n)};j.prototype.equals=function(n){return j.equals(this,n)};j.prototype.equalsEpsilon=function(n,e){return j.equalsEpsilon(this,n,e)};j.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var $=j;function a(n,e){this.x=n??0,this.y=e??0}a.fromElements=function(n,e,o){return u(o)?(o.x=n,o.y=e,o):new a(n,e)};a.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e):new a(n.x,n.y)};a.fromCartesian3=a.clone;a.fromCartesian4=a.clone;a.packedLength=2;a.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n.x,e[o]=n.y,e};a.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new a),o.x=n[e++],o.y=n[e],o};a.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*2;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)a.pack(n[i],e,i*2);return e};a.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,2),n.length%2!==0)throw new g("array length must be a multiple of 2.");let o=n.length;u(e)?e.length=o/2:e=new Array(o/2);for(let t=0;t<o;t+=2){let i=t/2;e[i]=a.unpack(n,t,e[i])}return e};a.fromArray=a.unpack;a.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y)};a.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y)};a.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o};a.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o};a.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=h.clamp(n.x,e.x,o.x),p=h.clamp(n.y,e.y,o.y);return t.x=i,t.y=p,t};a.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y};a.magnitude=function(n){return Math.sqrt(a.magnitudeSquared(n))};var H=new a;a.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,H),a.magnitude(H)};a.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,H),a.magnitudeSquared(H)};a.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,isNaN(e.x)||isNaN(e.y))throw new g("normalized result is not a number");return e};a.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y};a.cross=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.y-n.y*e.x};a.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o};a.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o};a.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o};a.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o};a.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o};a.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o};a.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e};a.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e};var ln=new a;a.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),a.multiplyByScalar(e,o,ln),t=a.multiplyByScalar(n,1-o,t),a.add(ln,t,t)};var Cn=new a,Nn=new a;a.angleBetween=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.normalize(n,Cn),a.normalize(e,Nn),h.acosClamped(a.dot(Cn,Nn))};var ne=new a;a.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.normalize(n,ne);return a.abs(o,o),o.x<=o.y?e=a.clone(a.UNIT_X,e):e=a.clone(a.UNIT_Y,e),e};a.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y};a.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]};a.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&h.equalsEpsilon(n.x,e.x,o,t)&&h.equalsEpsilon(n.y,e.y,o,t)};a.ZERO=Object.freeze(new a(0,0));a.ONE=Object.freeze(new a(1,1));a.UNIT_X=Object.freeze(new a(1,0));a.UNIT_Y=Object.freeze(new a(0,1));a.prototype.clone=function(n){return a.clone(this,n)};a.prototype.equals=function(n){return a.equals(this,n)};a.prototype.equalsEpsilon=function(n,e,o){return a.equalsEpsilon(this,n,e,o)};a.prototype.toString=function(){return`(${this.x}, ${this.y})`};var yn=a;function Fn(n,e,o,t){e=e??0,o=o??0,t=t??0,c.typeOf.number.greaterThanOrEquals("x",e,0),c.typeOf.number.greaterThanOrEquals("y",o,0),c.typeOf.number.greaterThanOrEquals("z",t,0),n._radii=new y(e,o,t),n._radiiSquared=new y(e*e,o*o,t*t),n._radiiToTheFourth=new y(e*e*e*e,o*o*o*o,t*t*t*t),n._oneOverRadii=new y(e===0?0:1/e,o===0?0:1/o,t===0?0:1/t),n._oneOverRadiiSquared=new y(e===0?0:1/(e*e),o===0?0:1/(o*o),t===0?0:1/(t*t)),n._minimumRadius=Math.min(e,o,t),n._maximumRadius=Math.max(e,o,t),n._centerToleranceSquared=h.EPSILON1,n._radiiSquared.z!==0&&(n._squaredXOverSquaredZ=n._radiiSquared.x/n._radiiSquared.z)}function O(n,e,o){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,Fn(this,n,e,o)}Object.defineProperties(O.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}}});O.clone=function(n,e){if(!u(n))return;let o=n._radii;return u(e)?(y.clone(o,e._radii),y.clone(n._radiiSquared,e._radiiSquared),y.clone(n._radiiToTheFourth,e._radiiToTheFourth),y.clone(n._oneOverRadii,e._oneOverRadii),y.clone(n._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=n._minimumRadius,e._maximumRadius=n._maximumRadius,e._centerToleranceSquared=n._centerToleranceSquared,e):new O(o.x,o.y,o.z)};O.fromCartesian3=function(n,e){return u(e)||(e=new O),u(n)&&Fn(e,n.x,n.y,n.z),e};O.WGS84=Object.freeze(new O(6378137,6378137,6356752314245179e-9));O.UNIT_SPHERE=Object.freeze(new O(1,1,1));O.MOON=Object.freeze(new O(h.LUNAR_RADIUS,h.LUNAR_RADIUS,h.LUNAR_RADIUS));O._default=O.WGS84;Object.defineProperties(O,{default:{get:function(){return O._default},set:function(n){c.typeOf.object("value",n),O._default=n,y._ellipsoidRadiiSquared=n.radiiSquared,$._ellipsoidOneOverRadii=n.oneOverRadii,$._ellipsoidOneOverRadiiSquared=n.oneOverRadiiSquared,$._ellipsoidCenterToleranceSquared=n._centerToleranceSquared}}});O.prototype.clone=function(n){return O.clone(this,n)};O.packedLength=y.packedLength;O.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,y.pack(n._radii,e,o),e};O.unpack=function(n,e,o){c.defined("array",n),e=e??0;let t=y.unpack(n,e);return O.fromCartesian3(t,o)};O.prototype.geocentricSurfaceNormal=y.normalize;O.prototype.geodeticSurfaceNormalCartographic=function(n,e){c.typeOf.object("cartographic",n);let o=n.longitude,t=n.latitude,i=Math.cos(t),p=i*Math.cos(o),d=i*Math.sin(o),m=Math.sin(t);return u(e)||(e=new y),e.x=p,e.y=d,e.z=m,y.normalize(e,e)};O.prototype.geodeticSurfaceNormal=function(n,e){if(c.typeOf.object("cartesian",n),isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new g("cartesian has a NaN component");if(!y.equalsEpsilon(n,y.ZERO,h.EPSILON14))return u(e)||(e=new y),e=y.multiplyComponents(n,this._oneOverRadiiSquared,e),y.normalize(e,e)};var ee=new y,oe=new y;O.prototype.cartographicToCartesian=function(n,e){let o=ee,t=oe;this.geodeticSurfaceNormalCartographic(n,o),y.multiplyComponents(this._radiiSquared,o,t);let i=Math.sqrt(y.dot(o,t));return y.divideByScalar(t,i,t),y.multiplyByScalar(o,n.height,o),u(e)||(e=new y),y.add(t,o,e)};O.prototype.cartographicArrayToCartesianArray=function(n,e){c.defined("cartographics",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;t++)e[t]=this.cartographicToCartesian(n[t],e[t]);return e};var te=new y,ce=new y,ie=new y;O.prototype.cartesianToCartographic=function(n,e){let o=this.scaleToGeodeticSurface(n,ce);if(!u(o))return;let t=this.geodeticSurfaceNormal(o,te),i=y.subtract(n,o,ie),p=Math.atan2(t.y,t.x),d=Math.asin(t.z),m=h.sign(y.dot(i,n))*y.magnitude(i);return u(e)?(e.longitude=p,e.latitude=d,e.height=m,e):new $(p,d,m)};O.prototype.cartesianArrayToCartographicArray=function(n,e){c.defined("cartesians",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;++t)e[t]=this.cartesianToCartographic(n[t],e[t]);return e};O.prototype.scaleToGeodeticSurface=function(n,e){return G(n,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)};O.prototype.scaleToGeocentricSurface=function(n,e){c.typeOf.object("cartesian",n),u(e)||(e=new y);let o=n.x,t=n.y,i=n.z,p=this._oneOverRadiiSquared,d=1/Math.sqrt(o*o*p.x+t*t*p.y+i*i*p.z);return y.multiplyByScalar(n,d,e)};O.prototype.transformPositionToScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._oneOverRadii,e)};O.prototype.transformPositionFromScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._radii,e)};O.prototype.equals=function(n){return this===n||u(n)&&y.equals(this._radii,n._radii)};O.prototype.toString=function(){return this._radii.toString()};O.prototype.getSurfaceNormalIntersectionWithZAxis=function(n,e,o){if(c.typeOf.object("position",n),!h.equalsEpsilon(this._radii.x,this._radii.y,h.EPSILON15))throw new g("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");c.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=e??0;let t=this._squaredXOverSquaredZ;if(u(o)||(o=new y),o.x=0,o.y=0,o.z=n.z*(1-t),!(Math.abs(o.z)>=this._radii.z-e))return o};var fe=new y;O.prototype.getLocalCurvature=function(n,e){c.typeOf.object("surfacePosition",n),u(e)||(e=new yn);let o=this.getSurfaceNormalIntersectionWithZAxis(n,0,fe),t=y.distance(n,o),i=this.minimumRadius*t/this.maximumRadius**2,p=t*i**2;return yn.fromElements(1/t,1/p,e)};var re=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],pe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xn(n,e,o){c.typeOf.number("a",n),c.typeOf.number("b",e),c.typeOf.func("func",o);let t=.5*(e+n),i=.5*(e-n),p=0;for(let d=0;d<5;d++){let m=i*re[d];p+=pe[d]*(o(t+m)+o(t-m))}return p*=i,p}O.prototype.surfaceArea=function(n){c.typeOf.object("rectangle",n);let e=n.west,o=n.east,t=n.south,i=n.north;for(;o<e;)o+=h.TWO_PI;let p=this._radiiSquared,d=p.x,m=p.y,s=p.z,b=d*m;return xn(t,i,function(w){let S=Math.cos(w),R=Math.sin(w);return Math.cos(w)*xn(e,o,function(M){let C=Math.cos(M),_=Math.sin(M);return Math.sqrt(b*R*R+s*(m*C*C+d*_*_)*S*S)})})};var oo=O;function r(n,e,o,t,i,p,d,m,s){this[0]=n??0,this[1]=t??0,this[2]=d??0,this[3]=e??0,this[4]=i??0,this[5]=m??0,this[6]=o??0,this[7]=p??0,this[8]=s??0}r.packedLength=9;r.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n[0],e[o++]=n[1],e[o++]=n[2],e[o++]=n[3],e[o++]=n[4],e[o++]=n[5],e[o++]=n[6],e[o++]=n[7],e[o++]=n[8],e};r.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new r),o[0]=n[e++],o[1]=n[e++],o[2]=n[e++],o[3]=n[e++],o[4]=n[e++],o[5]=n[e++],o[6]=n[e++],o[7]=n[e++],o[8]=n[e++],o};r.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*9;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 9 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)r.pack(n[i],e,i*9);return e};r.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,9),n.length%9!==0)throw new g("array length must be a multiple of 9.");let o=n.length;u(e)?e.length=o/9:e=new Array(o/9);for(let t=0;t<o;t+=9){let i=t/9;e[i]=r.unpack(n,t,e[i])}return e};r.clone=function(n,e){if(u(n))return u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):new r(n[0],n[3],n[6],n[1],n[4],n[7],n[2],n[5],n[8])};r.fromArray=r.unpack;r.fromColumnMajorArray=function(n,e){return c.defined("values",n),r.clone(n,e)};r.fromRowMajorArray=function(n,e){return c.defined("values",n),u(e)?(e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],e):new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])};r.fromQuaternion=function(n,e){c.typeOf.object("quaternion",n);let o=n.x*n.x,t=n.x*n.y,i=n.x*n.z,p=n.x*n.w,d=n.y*n.y,m=n.y*n.z,s=n.y*n.w,b=n.z*n.z,w=n.z*n.w,S=n.w*n.w,R=o-d-b+S,M=2*(t-w),C=2*(i+s),_=2*(t+w),N=-o+d-b+S,B=2*(m-p),U=2*(i-s),P=2*(m+p),F=-o-d+b+S;return u(e)?(e[0]=R,e[1]=_,e[2]=U,e[3]=M,e[4]=N,e[5]=P,e[6]=C,e[7]=B,e[8]=F,e):new r(R,M,C,_,N,B,U,P,F)};r.fromHeadingPitchRoll=function(n,e){c.typeOf.object("headingPitchRoll",n);let o=Math.cos(-n.pitch),t=Math.cos(-n.heading),i=Math.cos(n.roll),p=Math.sin(-n.pitch),d=Math.sin(-n.heading),m=Math.sin(n.roll),s=o*t,b=-i*d+m*p*t,w=m*d+i*p*t,S=o*d,R=i*t+m*p*d,M=-m*t+i*p*d,C=-p,_=m*o,N=i*o;return u(e)?(e[0]=s,e[1]=S,e[2]=C,e[3]=b,e[4]=R,e[5]=_,e[6]=w,e[7]=M,e[8]=N,e):new r(s,b,w,S,R,M,C,_,N)};r.fromScale=function(n,e){return c.typeOf.object("scale",n),u(e)?(e[0]=n.x,e[1]=0,e[2]=0,e[3]=0,e[4]=n.y,e[5]=0,e[6]=0,e[7]=0,e[8]=n.z,e):new r(n.x,0,0,0,n.y,0,0,0,n.z)};r.fromUniformScale=function(n,e){return c.typeOf.number("scale",n),u(e)?(e[0]=n,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=n,e):new r(n,0,0,0,n,0,0,0,n)};r.fromCrossProduct=function(n,e){return c.typeOf.object("vector",n),u(e)?(e[0]=0,e[1]=n.z,e[2]=-n.y,e[3]=-n.z,e[4]=0,e[5]=n.x,e[6]=n.y,e[7]=-n.x,e[8]=0,e):new r(0,-n.z,n.y,n.z,0,-n.x,-n.y,n.x,0)};r.fromRotationX=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=o,e[5]=t,e[6]=0,e[7]=-t,e[8]=o,e):new r(1,0,0,0,o,-t,0,t,o)};r.fromRotationY=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=0,e[2]=-t,e[3]=0,e[4]=1,e[5]=0,e[6]=t,e[7]=0,e[8]=o,e):new r(o,0,t,0,1,0,-t,0,o)};r.fromRotationZ=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=t,e[2]=0,e[3]=-t,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new r(o,-t,0,t,o,0,0,0,1)};r.toArray=function(n,e){return c.typeOf.object("matrix",n),u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8]]};r.getElementIndex=function(n,e){return c.typeOf.number.greaterThanOrEquals("row",e,0),c.typeOf.number.lessThanOrEquals("row",e,2),c.typeOf.number.greaterThanOrEquals("column",n,0),c.typeOf.number.lessThanOrEquals("column",n,2),n*3+e};r.getColumn=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=e*3,i=n[t],p=n[t+1],d=n[t+2];return o.x=i,o.y=p,o.z=d,o};r.setColumn=function(n,e,o,t){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t);let i=e*3;return t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t};r.getRow=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=n[e],i=n[e+3],p=n[e+6];return o.x=t,o.y=i,o.z=p,o};r.setRow=function(n,e,o,t){return c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t),t[e]=o.x,t[e+3]=o.y,t[e+6]=o.z,t};var ue=new y;r.setScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ue),i=e.x/t.x,p=e.y/t.y,d=e.z/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var ae=new y;r.setUniformScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ae),i=e/t.x,p=e/t.y,d=e/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var mn=new y;r.getScale=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e.x=y.magnitude(y.fromElements(n[0],n[1],n[2],mn)),e.y=y.magnitude(y.fromElements(n[3],n[4],n[5],mn)),e.z=y.magnitude(y.fromElements(n[6],n[7],n[8],mn)),e};var kn=new y;r.getMaximumScale=function(n){return r.getScale(n,kn),y.maximumComponent(kn)};var de=new y;r.setRotation=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let t=r.getScale(n,de);return o[0]=e[0]*t.x,o[1]=e[1]*t.x,o[2]=e[2]*t.x,o[3]=e[3]*t.y,o[4]=e[4]*t.y,o[5]=e[5]*t.y,o[6]=e[6]*t.z,o[7]=e[7]*t.z,o[8]=e[8]*t.z,o};var ye=new y;r.getRotation=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=r.getScale(n,ye);return e[0]=n[0]/o.x,e[1]=n[1]/o.x,e[2]=n[2]/o.x,e[3]=n[3]/o.y,e[4]=n[4]/o.y,e[5]=n[5]/o.y,e[6]=n[6]/o.z,e[7]=n[7]/o.z,e[8]=n[8]/o.z,e};r.multiply=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n[0]*e[0]+n[3]*e[1]+n[6]*e[2],i=n[1]*e[0]+n[4]*e[1]+n[7]*e[2],p=n[2]*e[0]+n[5]*e[1]+n[8]*e[2],d=n[0]*e[3]+n[3]*e[4]+n[6]*e[5],m=n[1]*e[3]+n[4]*e[4]+n[7]*e[5],s=n[2]*e[3]+n[5]*e[4]+n[8]*e[5],b=n[0]*e[6]+n[3]*e[7]+n[6]*e[8],w=n[1]*e[6]+n[4]*e[7]+n[7]*e[8],S=n[2]*e[6]+n[5]*e[7]+n[8]*e[8];return o[0]=t,o[1]=i,o[2]=p,o[3]=d,o[4]=m,o[5]=s,o[6]=b,o[7]=w,o[8]=S,o};r.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]+e[0],o[1]=n[1]+e[1],o[2]=n[2]+e[2],o[3]=n[3]+e[3],o[4]=n[4]+e[4],o[5]=n[5]+e[5],o[6]=n[6]+e[6],o[7]=n[7]+e[7],o[8]=n[8]+e[8],o};r.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],o[3]=n[3]-e[3],o[4]=n[4]-e[4],o[5]=n[5]-e[5],o[6]=n[6]-e[6],o[7]=n[7]-e[7],o[8]=n[8]-e[8],o};r.multiplyByVector=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("cartesian",e),c.typeOf.object("result",o);let t=e.x,i=e.y,p=e.z,d=n[0]*t+n[3]*i+n[6]*p,m=n[1]*t+n[4]*i+n[7]*p,s=n[2]*t+n[5]*i+n[8]*p;return o.x=d,o.y=m,o.z=s,o};r.multiplyByScalar=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.multiplyByScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e.x,o[1]=n[1]*e.x,o[2]=n[2]*e.x,o[3]=n[3]*e.y,o[4]=n[4]*e.y,o[5]=n[5]*e.y,o[6]=n[6]*e.z,o[7]=n[7]*e.z,o[8]=n[8]*e.z,o};r.multiplyByUniformScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.negate=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=-n[0],e[1]=-n[1],e[2]=-n[2],e[3]=-n[3],e[4]=-n[4],e[5]=-n[5],e[6]=-n[6],e[7]=-n[7],e[8]=-n[8],e};r.transpose=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[3],i=n[6],p=n[1],d=n[4],m=n[7],s=n[2],b=n[5],w=n[8];return e[0]=o,e[1]=t,e[2]=i,e[3]=p,e[4]=d,e[5]=m,e[6]=s,e[7]=b,e[8]=w,e};function me(n){let e=0;for(let o=0;o<9;++o){let t=n[o];e+=t*t}return Math.sqrt(e)}var sn=[1,0,0],On=[2,2,1];function se(n){let e=0;for(let o=0;o<3;++o){let t=n[r.getElementIndex(On[o],sn[o])];e+=2*t*t}return Math.sqrt(e)}function Oe(n,e){let o=h.EPSILON15,t=0,i=1;for(let b=0;b<3;++b){let w=Math.abs(n[r.getElementIndex(On[b],sn[b])]);w>t&&(i=b,t=w)}let p=1,d=0,m=sn[i],s=On[i];if(Math.abs(n[r.getElementIndex(s,m)])>o){let b=n[r.getElementIndex(s,s)],w=n[r.getElementIndex(m,m)],S=n[r.getElementIndex(s,m)],R=(b-w)/2/S,M;R<0?M=-1/(-R+Math.sqrt(1+R*R)):M=1/(R+Math.sqrt(1+R*R)),p=1/Math.sqrt(1+M*M),d=M*p}return e=r.clone(r.IDENTITY,e),e[r.getElementIndex(m,m)]=e[r.getElementIndex(s,s)]=p,e[r.getElementIndex(s,m)]=d,e[r.getElementIndex(m,s)]=-d,e}var Q=new r,Bn=new r;r.computeEigenDecomposition=function(n,e){c.typeOf.object("matrix",n);let o=h.EPSILON20,t=10,i=0,p=0;u(e)||(e={});let d=e.unitary=r.clone(r.IDENTITY,e.unitary),m=e.diagonal=r.clone(n,e.diagonal),s=o*me(m);for(;p<t&&se(m)>s;)Oe(m,Q),r.transpose(Q,Bn),r.multiply(m,Q,m),r.multiply(Bn,m,m),r.multiply(d,Q,d),++i>2&&(++p,i=0);return e};r.abs=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=Math.abs(n[0]),e[1]=Math.abs(n[1]),e[2]=Math.abs(n[2]),e[3]=Math.abs(n[3]),e[4]=Math.abs(n[4]),e[5]=Math.abs(n[5]),e[6]=Math.abs(n[6]),e[7]=Math.abs(n[7]),e[8]=Math.abs(n[8]),e};r.determinant=function(n){c.typeOf.object("matrix",n);let e=n[0],o=n[3],t=n[6],i=n[1],p=n[4],d=n[7],m=n[2],s=n[5],b=n[8];return e*(p*b-s*d)+i*(s*t-o*b)+m*(o*d-p*t)};r.inverse=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[1],i=n[2],p=n[3],d=n[4],m=n[5],s=n[6],b=n[7],w=n[8],S=r.determinant(n);if(Math.abs(S)<=h.EPSILON15)throw new g("matrix is not invertible");e[0]=d*w-b*m,e[1]=b*i-t*w,e[2]=t*m-d*i,e[3]=s*m-p*w,e[4]=o*w-s*i,e[5]=p*i-o*m,e[6]=p*b-s*d,e[7]=s*t-o*b,e[8]=o*d-p*t;let R=1/S;return r.multiplyByScalar(e,R,e)};var be=new r;r.inverseTranspose=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),r.inverse(r.transpose(n,be),e)};r.equals=function(n,e){return n===e||u(n)&&u(e)&&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]};r.equalsEpsilon=function(n,e,o){return o=o??0,n===e||u(n)&&u(e)&&Math.abs(n[0]-e[0])<=o&&Math.abs(n[1]-e[1])<=o&&Math.abs(n[2]-e[2])<=o&&Math.abs(n[3]-e[3])<=o&&Math.abs(n[4]-e[4])<=o&&Math.abs(n[5]-e[5])<=o&&Math.abs(n[6]-e[6])<=o&&Math.abs(n[7]-e[7])<=o&&Math.abs(n[8]-e[8])<=o};r.IDENTITY=Object.freeze(new r(1,0,0,0,1,0,0,0,1));r.ZERO=Object.freeze(new r(0,0,0,0,0,0,0,0,0));r.COLUMN0ROW0=0;r.COLUMN0ROW1=1;r.COLUMN0ROW2=2;r.COLUMN1ROW0=3;r.COLUMN1ROW1=4;r.COLUMN1ROW2=5;r.COLUMN2ROW0=6;r.COLUMN2ROW1=7;r.COLUMN2ROW2=8;Object.defineProperties(r.prototype,{length:{get:function(){return r.packedLength}}});r.prototype.clone=function(n){return r.clone(this,n)};r.prototype.equals=function(n){return r.equals(this,n)};r.equalsArray=function(n,e,o){return n[0]===e[o]&&n[1]===e[o+1]&&n[2]===e[o+2]&&n[3]===e[o+3]&&n[4]===e[o+4]&&n[5]===e[o+5]&&n[6]===e[o+6]&&n[7]===e[o+7]&&n[8]===e[o+8]};r.prototype.equalsEpsilon=function(n,e){return r.equalsEpsilon(this,n,e)};r.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) -(${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var uo=r;var bn={};bn.EMPTY_OBJECT=Object.freeze({});bn.EMPTY_ARRAY=Object.freeze([]);var yo=bn;var x,z={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},A={};Object.defineProperties(A,{element:{get:function(){if(A.supportsFullscreen())return document[z.fullscreenElement]}},changeEventName:{get:function(){if(A.supportsFullscreen())return z.fullscreenchange}},errorEventName:{get:function(){if(A.supportsFullscreen())return z.fullscreenerror}},enabled:{get:function(){if(A.supportsFullscreen())return document[z.fullscreenEnabled]}},fullscreen:{get:function(){if(A.supportsFullscreen())return A.element!==null}}});A.supportsFullscreen=function(){if(u(x))return x;x=!1;let n=document.body;if(typeof n.requestFullscreen=="function")return z.requestFullscreen="requestFullscreen",z.exitFullscreen="exitFullscreen",z.fullscreenEnabled="fullscreenEnabled",z.fullscreenElement="fullscreenElement",z.fullscreenchange="fullscreenchange",z.fullscreenerror="fullscreenerror",x=!0,x;let e=["webkit","moz","o","ms","khtml"],o;for(let t=0,i=e.length;t<i;++t){let p=e[t];o=`${p}RequestFullscreen`,typeof n[o]=="function"?(z.requestFullscreen=o,x=!0):(o=`${p}RequestFullScreen`,typeof n[o]=="function"&&(z.requestFullscreen=o,x=!0)),o=`${p}ExitFullscreen`,typeof document[o]=="function"?z.exitFullscreen=o:(o=`${p}CancelFullScreen`,typeof document[o]=="function"&&(z.exitFullscreen=o)),o=`${p}FullscreenEnabled`,document[o]!==void 0?z.fullscreenEnabled=o:(o=`${p}FullScreenEnabled`,document[o]!==void 0&&(z.fullscreenEnabled=o)),o=`${p}FullscreenElement`,document[o]!==void 0?z.fullscreenElement=o:(o=`${p}FullScreenElement`,document[o]!==void 0&&(z.fullscreenElement=o)),o=`${p}fullscreenchange`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenChange"),z.fullscreenchange=o),o=`${p}fullscreenerror`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenError"),z.fullscreenerror=o)}return x};A.requestFullscreen=function(n,e){A.supportsFullscreen()&&n[z.requestFullscreen]({vrDisplay:e})};A.exitFullscreen=function(){A.supportsFullscreen()&&document[z.exitFullscreen]()};A._names=z;var Un=A;var E;typeof navigator<"u"?E=navigator:E={};function k(n){let e=n.split(".");for(let o=0,t=e.length;o<t;++o)e[o]=parseInt(e[o],10);return e}var J,Pn;function zn(){if(!u(J)&&(J=!1,!cn())){let n=/ Chrome\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(J=!0,Pn=k(n[1]))}return J}function he(){return zn()&&Pn}var K,In;function Ln(){if(!u(K)&&(K=!1,!zn()&&!cn()&&/ Safari\/[\.0-9]+/.test(E.userAgent))){let n=/ Version\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(K=!0,In=k(n[1]))}return K}function we(){return Ln()&&In}var nn,gn;function Wn(){if(!u(nn)){nn=!1;let n=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(E.userAgent);n!==null&&(nn=!0,gn=k(n[1]),gn.isNightly=!!n[2])}return nn}function je(){return Wn()&&gn}var D,Sn;function Vn(){if(!u(D)){D=!1;let n;E.appName==="Microsoft Internet Explorer"?(n=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent),n!==null&&(D=!0,Sn=k(n[1]))):E.appName==="Netscape"&&(n=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent),n!==null&&(D=!0,Sn=k(n[1])))}return D}function ge(){return Vn()&&Sn}var en,vn;function cn(){if(!u(en)){en=!1;let n=/ Edg\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(en=!0,vn=k(n[1]))}return en}function Se(){return cn()&&vn}var on,Rn;function fn(){if(!u(on)){on=!1;let n=/Firefox\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(on=!0,Rn=k(n[1]))}return on}var hn;function ze(){return u(hn)||(hn=/Windows/i.test(E.appVersion)),hn}var wn;function Re(){return u(wn)||(wn=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),wn}function Me(){return fn()&&Rn}var jn;function qe(){return u(jn)||(jn=!fn()&&typeof PointerEvent<"u"&&(!u(E.pointerEnabled)||E.pointerEnabled)),jn}var $n,tn;function Dn(){if(!u(tn)){let n=document.createElement("canvas");n.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let e=n.style.imageRendering;tn=u(e)&&e!=="",tn&&($n=e)}return tn}function Ee(){return Dn()?$n:void 0}function q(){if(!q.initialized)throw new g("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return q._result}q._promise=void 0;q._result=void 0;q.initialize=function(){return u(q._promise)||(q._promise=new Promise(n=>{let e=new Image;e.onload=function(){q._result=e.width>0&&e.height>0,n(q._result)},e.onerror=function(){q._result=!1,n(q._result)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),q._promise};Object.defineProperties(q,{initialized:{get:function(){return u(q._result)}}});var v=[];typeof ArrayBuffer<"u"&&(v.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&v.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&v.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&v.push(BigInt64Array),typeof BigUint64Array<"u"&&v.push(BigUint64Array));var l={isChrome:zn,chromeVersion:he,isSafari:Ln,safariVersion:we,isWebkit:Wn,webkitVersion:je,isInternetExplorer:Vn,internetExplorerVersion:ge,isEdge:cn,edgeVersion:Se,isFirefox:fn,firefoxVersion:Me,isWindows:ze,isIPadOrIOS:Re,hardwareConcurrency:E.hardwareConcurrency??3,supportsPointerEvents:qe,supportsImageRenderingPixelated:Dn,supportsWebP:q,imageRenderingValue:Ee,typedArrayTypes:v};l.supportsBasis=function(n){return l.supportsWebAssembly()&&n.context.supportsBasis};l.supportsFullscreen=function(){return Un.supportsFullscreen()};l.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};l.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};l.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};l.supportsBigInt=function(){return typeof BigInt<"u"};l.supportsWebWorkers=function(){return typeof Worker<"u"};l.supportsWebAssembly=function(){return typeof WebAssembly<"u"};l.supportsWebgl2=function(n){return c.defined("scene",n),n.context.webgl2};l.supportsEsmWebWorkers=function(){return!fn()||parseInt(Rn)>=114};var go=l;export{y as a,$ as b,yn as c,oo as d,uo as e,yo as f,go as g}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MINWOLZP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MINWOLZP.js deleted file mode 100644 index 9118860..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MINWOLZP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-76AWMMRZ.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MKDHS6G7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MKDHS6G7.js deleted file mode 100644 index c73932e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MKDHS6G7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-R6ZFBAA7.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MKGFLCRO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MKGFLCRO.js deleted file mode 100644 index c445da3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MKGFLCRO.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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-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|(\([^\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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MLQMEEAJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MLQMEEAJ.js deleted file mode 100644 index fabc81f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MLQMEEAJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-5OLATPUE.js";import{a as U}from"./chunk-44VOGP6Y.js";import{f as I}from"./chunk-76AWMMRZ.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MM26GJV3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MM26GJV3.js deleted file mode 100644 index 8d00155..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MM26GJV3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-A3K2ZLIM.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MNHXHWX5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MNHXHWX5.js deleted file mode 100644 index 8c54ea0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MNHXHWX5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-J6G3ODD3.js";import{d as L}from"./chunk-WHDDCNJ6.js";import{b as d,h as W}from"./chunk-ENETEM2P.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MNXCKS6O.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MNXCKS6O.js deleted file mode 100644 index 8b2e199..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MNXCKS6O.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-G5KXXUYH.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MO4E2GUB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MO4E2GUB.js deleted file mode 100644 index e1ad0fc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MO4E2GUB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-KYP7OKF3.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MQB7GV4P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MQB7GV4P.js deleted file mode 100644 index d478858..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MQB7GV4P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-J6G3ODD3.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-LO5P6EVV.js";import{a as Et}from"./chunk-SFVU4I7K.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-SGDQE7H4.js";import{a as _t,b as Ut,d as ot}from"./chunk-WHDDCNJ6.js";import{a as pt,b as H}from"./chunk-ENETEM2P.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MSUMYM3P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MSUMYM3P.js deleted file mode 100644 index 0e96349..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MSUMYM3P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-YE4R2EE7.js";import{h as I,i as b}from"./chunk-255CHCZV.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-MWDDKL2H.js b/src/renderer/public/sdk/Cesium/Workers/chunk-MWDDKL2H.js deleted file mode 100644 index 0d23178..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-MWDDKL2H.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-DUJ2U2S3.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-N4QQ5FWX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-N4QQ5FWX.js deleted file mode 100644 index ff5e1bc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-N4QQ5FWX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-T4N45YIS.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-N6MM37ZV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-N6MM37ZV.js deleted file mode 100644 index 717c3dd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-N6MM37ZV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-2P4SA4ZJ.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-ZAYZJA3R.js";import{b as E,d as ie}from"./chunk-NJVZPI6A.js";import{a as C,b as F,f as D}from"./chunk-A4L3VMPJ.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NBE2CPYA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NBE2CPYA.js deleted file mode 100644 index 8434dbc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NBE2CPYA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-FXULDDZU.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ND6FO376.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ND6FO376.js deleted file mode 100644 index b2a960a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ND6FO376.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-UC53JWAC.js";import{a as C}from"./chunk-AMEMP742.js";import{b as L}from"./chunk-AVM7XNMU.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NINXVCBW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NINXVCBW.js deleted file mode 100644 index bbbcfbb..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NINXVCBW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-VPFNPTPP.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NJVZPI6A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NJVZPI6A.js deleted file mode 100644 index adce076..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NJVZPI6A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-A4L3VMPJ.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NL2AQYZR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NL2AQYZR.js deleted file mode 100644 index 31e0be8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NL2AQYZR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-7BLPWQ26.js";import{a as C}from"./chunk-PP2DTLZK.js";import{b as L}from"./chunk-OL26GLX5.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NNNSDBCQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NNNSDBCQ.js deleted file mode 100644 index 3925ab1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NNNSDBCQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-NPMNTDSM.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NPMNTDSM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NPMNTDSM.js deleted file mode 100644 index 0f4bfd1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NPMNTDSM.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{let o=function(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};return Cesium.ManageIndexedDB.GetManageIndexexDBState()?fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o()):o()}catch{return fetchData()}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NPZX2V4A.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NPZX2V4A.js deleted file mode 100644 index c151fc3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NPZX2V4A.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-CQUN5S6E.js";import{a as U}from"./chunk-65VSR2I4.js";import{f as I}from"./chunk-Z3X57746.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NQPD6VVH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NQPD6VVH.js deleted file mode 100644 index 2896ce3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NQPD6VVH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-J6MTQVGW.js";import{a as u,b as d}from"./chunk-7BLPWQ26.js";import{a as j}from"./chunk-PP2DTLZK.js";import{a as _,b as h,g as A}from"./chunk-OL26GLX5.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NXQK7ZFF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NXQK7ZFF.js deleted file mode 100644 index 32a91bf..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NXQK7ZFF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-5ULDHPPR.js";import{a as te}from"./chunk-5WFJ6IXL.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-255CHCZV.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-NXRSA4OE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-NXRSA4OE.js deleted file mode 100644 index d823f3c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-NXRSA4OE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-255CHCZV.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-O5YU7IER.js b/src/renderer/public/sdk/Cesium/Workers/chunk-O5YU7IER.js deleted file mode 100644 index b0a9195..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-O5YU7IER.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-YE4R2EE7.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OCYK3DYL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OCYK3DYL.js deleted file mode 100644 index fff3907..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OCYK3DYL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-A24L4QN2.js";import{d as ht}from"./chunk-ZA6CVU2J.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ODBYUYEB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ODBYUYEB.js deleted file mode 100644 index a87e01d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ODBYUYEB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-KHXD6UFU.js";import{a as I}from"./chunk-XCMSHRLY.js";import{b as B,c as G,d as k}from"./chunk-OZA4MN4W.js";import{b as j,h as X}from"./chunk-FXKWBJNE.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OENTOTMT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OENTOTMT.js deleted file mode 100644 index 9ddc4a7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OENTOTMT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-A4L3VMPJ.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OL26GLX5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OL26GLX5.js deleted file mode 100644 index c5ed0eb..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OL26GLX5.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,console.log("11111"),console.log("11111",Cesium),Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return console.log("22222"),console.log("22222",Cesium),Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OLYSJX67.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OLYSJX67.js deleted file mode 100644 index 8850c89..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OLYSJX67.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-DNF254EX.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-WLRKMATH.js";import{d as E}from"./chunk-OZA4MN4W.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OOS6OUMR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OOS6OUMR.js deleted file mode 100644 index 65c145b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OOS6OUMR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-MKGFLCRO.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OUVOIUY3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OUVOIUY3.js deleted file mode 100644 index f54886b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OUVOIUY3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-V5JG7NIH.js";import{a as C}from"./chunk-DJONG6H5.js";import{b as L}from"./chunk-VPFNPTPP.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OVZZEY7C.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OVZZEY7C.js deleted file mode 100644 index cbb2a66..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OVZZEY7C.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var i=Object.create;var u=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var a=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,d)=>(typeof require<"u"?require:e)[d]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')}),b=n=>e=>{var d=n[e];if(d)return d();throw new Error("Module not found in bundle: "+e)};var g=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var p=(n,e,d,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of l(e))!c.call(n,f)&&f!==d&&u(n,f,{get:()=>e[f],enumerable:!(t=r(e,f))||t.enumerable});return n};var h=(n,e,d)=>(d=n!=null?i(o(n)):{},p(e||!n||!n.__esModule?u(d,"default",{value:n,enumerable:!0}):d,n));function x(n){return n!=null}var k=x;export{a,b,g as c,h as d,k as e}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OZA4MN4W.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OZA4MN4W.js deleted file mode 100644 index 3e0a65c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OZA4MN4W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-FXKWBJNE.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-OZEHKI37.js b/src/renderer/public/sdk/Cesium/Workers/chunk-OZEHKI37.js deleted file mode 100644 index e64ea0f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-OZEHKI37.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-AEP7LW36.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-P463PE5X.js b/src/renderer/public/sdk/Cesium/Workers/chunk-P463PE5X.js deleted file mode 100644 index bf9a1ce..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-P463PE5X.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-SGDQE7H4.js";import{d as j}from"./chunk-WHDDCNJ6.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-P4IVVUXR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-P4IVVUXR.js deleted file mode 100644 index 51c59ea..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-P4IVVUXR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-3OFCT7WF.js";import{a as Z,b as H}from"./chunk-JHKWWG2I.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-UC53JWAC.js";import{a as it}from"./chunk-AMEMP742.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-5KD2FCJ5.js";import{f as K}from"./chunk-AVM7XNMU.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-P4KNTCYU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-P4KNTCYU.js deleted file mode 100644 index 8f5403b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-P4KNTCYU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-ZAYZJA3R.js";import{d as l}from"./chunk-NJVZPI6A.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-P5PM27BT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-P5PM27BT.js deleted file mode 100644 index 58c30e3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-P5PM27BT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-34GCBYYX.js";import{d as l}from"./chunk-CCZ6XI6A.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PGA62WKS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PGA62WKS.js deleted file mode 100644 index 9440e34..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PGA62WKS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-OUVOIUY3.js";import{a as te}from"./chunk-KUWWELEK.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-VPFNPTPP.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PGM6B4G2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PGM6B4G2.js deleted file mode 100644 index d7e25e1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PGM6B4G2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w}from"./chunk-WFYQVCMU.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PL2D6B4G.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PL2D6B4G.js deleted file mode 100644 index 6b2d9ab..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PL2D6B4G.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-PGA62WKS.js";import{a as U}from"./chunk-OUVOIUY3.js";import{f as I}from"./chunk-VPFNPTPP.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-POLUDXGV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-POLUDXGV.js deleted file mode 100644 index 02b3837..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-POLUDXGV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as u,b as c,d as p}from"./chunk-MGW7GK6C.js";import{a as d}from"./chunk-WFYQVCMU.js";import{a as s}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function e(t){this._ellipsoid=t??p.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});e.mercatorAngleToGeodeticLatitude=function(t){return d.PI_OVER_TWO-2*Math.atan(Math.exp(-t))};e.geodeticLatitudeToMercatorAngle=function(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let i=Math.sin(t);return .5*Math.log((1+i)/(1-i))};e.MaximumLatitude=e.mercatorAngleToGeodeticLatitude(Math.PI);e.prototype.project=function(t,i){let o=this._semimajorAxis,r=t.longitude*o,n=e.geodeticLatitudeToMercatorAngle(t.latitude)*o,m=t.height;return a(i)?(i.x=r,i.y=n,i.z=m,i):new u(r,n,m)};e.prototype.unproject=function(t,i){if(!a(t))throw new s("cartesian is required");let o=this._oneOverSemimajorAxis,r=t.x*o,n=e.mercatorAngleToGeodeticLatitude(t.y*o),m=t.z;return a(i)?(i.longitude=r,i.latitude=n,i.height=m,i):new c(r,n,m)};var A=e;export{A as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-POTM4NUQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-POTM4NUQ.js deleted file mode 100644 index 904128b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-POTM4NUQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-H6HCBMP2.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PP2DTLZK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PP2DTLZK.js deleted file mode 100644 index 5499a9c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PP2DTLZK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-OL26GLX5.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PR4E736K.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PR4E736K.js deleted file mode 100644 index e299714..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PR4E736K.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-3R7YZYAU.js";import{h as I,i as b}from"./chunk-76AWMMRZ.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PYNHSWKA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PYNHSWKA.js deleted file mode 100644 index 82d3c35..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PYNHSWKA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-WHDDCNJ6.js";import{h as x}from"./chunk-ENETEM2P.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-PZY24SWP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-PZY24SWP.js deleted file mode 100644 index 245e06f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-PZY24SWP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-BSMSCZPP.js";import{h as I,i as b}from"./chunk-AVM7XNMU.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Q2K7HV7W.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Q2K7HV7W.js deleted file mode 100644 index 0f441e1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Q2K7HV7W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-44VOGP6Y.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Q3VOOFSE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Q3VOOFSE.js deleted file mode 100644 index 0afeabb..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Q3VOOFSE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as p,b as P,d as T}from"./chunk-MGW7GK6C.js";import{a}from"./chunk-WFYQVCMU.js";import{a as I,b as g}from"./chunk-BOXFFUY5.js";import{e as l}from"./chunk-OVZZEY7C.js";function w(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function H(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),v=Math.sin(4*t),W=Math.cos(4*t),V=Math.sin(6*t),C=Math.cos(6*t),N=Math.sin(8*t),R=Math.cos(8*t),b=Math.sin(10*t),x=Math.cos(10*t),U=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*W+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*C+(1097*t*M/65536+42783*t*_/1048576)*R+8011*t*_/1048576*x+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*v+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*V+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*N+(8011*M/2621440+8011*_/1048576)*b+293393*_/251658240*U}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function z(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function k(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=w(n._ellipticity,i,e);d=(w(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var A=new p,q=new p;function y(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,q),A),c=p.normalize(t.cartographicToCartesian(o,q),q);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=z(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=k(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function D(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=w(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=H(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=o??T.default;this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&y(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=t??T.default,r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=D(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),y(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");return D(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)return i.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(n,c.longitude,a.EPSILON12)?void 0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);let r=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;let M=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));return i.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;let c=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);return l(i)?(i.longitude=s,i.latitude=n,i.height=0,i):new P(s,n,0)};var Y=m;export{Y as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QJHUWGM2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QJHUWGM2.js deleted file mode 100644 index 2d6fa3c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QJHUWGM2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-F53ZJJWZ.js";import{a as u,b as d}from"./chunk-N4QQ5FWX.js";import{a as j}from"./chunk-HZEX5MXO.js";import{a as _,b as h,g as A}from"./chunk-NPMNTDSM.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QMTXW4VP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QMTXW4VP.js deleted file mode 100644 index 50c1301..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QMTXW4VP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-H6HCBMP2.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QPZHRXZ6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QPZHRXZ6.js deleted file mode 100644 index e3e6782..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QPZHRXZ6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-FXKWBJNE.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QQ2JU7XK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QQ2JU7XK.js deleted file mode 100644 index 3ee332b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QQ2JU7XK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-MKGFLCRO.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QTK3ESXM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QTK3ESXM.js deleted file mode 100644 index 860392a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QTK3ESXM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-WHOQYW75.js";import{d as j}from"./chunk-3R7YZYAU.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QUP6LJVQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QUP6LJVQ.js deleted file mode 100644 index d7ba10a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QUP6LJVQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-SNO2N7JZ.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-2VGJ4QVX.js";import{d as E}from"./chunk-DUJ2U2S3.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QVFINFPA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QVFINFPA.js deleted file mode 100644 index d4042a3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QVFINFPA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-NXRSA4OE.js";import{d as H}from"./chunk-YE4R2EE7.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QW3YEGB3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QW3YEGB3.js deleted file mode 100644 index 9c65f46..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QW3YEGB3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-OZA4MN4W.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QWQ7HFAB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QWQ7HFAB.js deleted file mode 100644 index 8aebe97..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QWQ7HFAB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-2GI3PW2M.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-NBE2CPYA.js";import{a as Et}from"./chunk-TMD5QYHK.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-RDJ4UYGG.js";import{a as _t,b as Ut,d as ot}from"./chunk-FXULDDZU.js";import{a as pt,b as H}from"./chunk-Z3X57746.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-QWZ67HJK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-QWZ67HJK.js deleted file mode 100644 index a5c7f72..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-QWZ67HJK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-BBGWUPII.js";import{d as H}from"./chunk-HUYVXCIF.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-R4PUNGMZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-R4PUNGMZ.js deleted file mode 100644 index b01060e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-R4PUNGMZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-ENETEM2P.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-R6YER4KK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-R6YER4KK.js deleted file mode 100644 index 7a63116..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-R6YER4KK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-NJVZPI6A.js";import{h as I,i as b}from"./chunk-A4L3VMPJ.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-R6ZFBAA7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-R6ZFBAA7.js deleted file mode 100644 index 57571ee..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-R6ZFBAA7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-GDUPQZNM.js";import{a as I}from"./chunk-65RJEMLK.js";import{b as B,c as G,d as k}from"./chunk-ZA6CVU2J.js";import{b as j,h as X}from"./chunk-IU3JXFWW.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RALTHVRZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RALTHVRZ.js deleted file mode 100644 index 9900ca2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RALTHVRZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-ND6FO376.js";import{a as te}from"./chunk-T4A75GEN.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-AVM7XNMU.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RB3QH3QZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RB3QH3QZ.js deleted file mode 100644 index f30552c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RB3QH3QZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-YWXO6FX2.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-WHOQYW75.js";import{d as E}from"./chunk-3R7YZYAU.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RD5EBYQO.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RD5EBYQO.js deleted file mode 100644 index 9b48f41..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RD5EBYQO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-WH7Z3BNJ.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-N4QQ5FWX.js";import{a as Et}from"./chunk-HZEX5MXO.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-NNNSDBCQ.js";import{a as _t,b as Ut,d as ot}from"./chunk-T4N45YIS.js";import{a as pt,b as H}from"./chunk-NPMNTDSM.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RDJ4UYGG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RDJ4UYGG.js deleted file mode 100644 index 41dbb46..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RDJ4UYGG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-Z3X57746.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RI7KBXN6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RI7KBXN6.js deleted file mode 100644 index cb86a85..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RI7KBXN6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-ZA6CVU2J.js";import{h as I,i as b}from"./chunk-IU3JXFWW.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RISC6EPB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RISC6EPB.js deleted file mode 100644 index 88ec950..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RISC6EPB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-ENETEM2P.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RM2VAJJM.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RM2VAJJM.js deleted file mode 100644 index 80d1bdf..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RM2VAJJM.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-WLRKMATH.js";import{d as ht}from"./chunk-OZA4MN4W.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RT7ONYAF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RT7ONYAF.js deleted file mode 100644 index b299cfc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RT7ONYAF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-255CHCZV.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RTULWHP7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RTULWHP7.js deleted file mode 100644 index 7f41873..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RTULWHP7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-NXRSA4OE.js";import{d as j}from"./chunk-YE4R2EE7.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RUDAAIIY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RUDAAIIY.js deleted file mode 100644 index 6c7863a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RUDAAIIY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-KZU6RORI.js";import{d as l}from"./chunk-4YKTCJME.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-RXPZRQSQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-RXPZRQSQ.js deleted file mode 100644 index 5467c13..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-RXPZRQSQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-ZA6CVU2J.js";import{h as x}from"./chunk-IU3JXFWW.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-S3Q3KCZ2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-S3Q3KCZ2.js deleted file mode 100644 index b019369..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-S3Q3KCZ2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-POTM4NUQ.js";import{d as L}from"./chunk-QMTXW4VP.js";import{b as d,h as W}from"./chunk-H6HCBMP2.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-S765I756.js b/src/renderer/public/sdk/Cesium/Workers/chunk-S765I756.js deleted file mode 100644 index 6527795..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-S765I756.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-ISMVKFQC.js";import{a as u,b as d}from"./chunk-CW7S2NZX.js";import{a as j}from"./chunk-Y7Y54VVF.js";import{a as _,b as h,g as A}from"./chunk-H6HCBMP2.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-S7FHSXXI.js b/src/renderer/public/sdk/Cesium/Workers/chunk-S7FHSXXI.js deleted file mode 100644 index ceeb522..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-S7FHSXXI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-DUJ2U2S3.js";import{h as x}from"./chunk-A3K2ZLIM.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-S7RYDELD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-S7RYDELD.js deleted file mode 100644 index 82fab91..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-S7RYDELD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-ZXPHRBXH.js";import{a as U}from"./chunk-G5KXXUYH.js";import{f as I}from"./chunk-NPMNTDSM.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SC4QQWAR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SC4QQWAR.js deleted file mode 100644 index cbdf746..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SC4QQWAR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-TY7ZXIN2.js";import{a as At}from"./chunk-UO3PFVIQ.js";import{a as yt}from"./chunk-3OFCT7WF.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-5KD2FCJ5.js";import{a as lt,d as it}from"./chunk-BSMSCZPP.js";import{f as nt,h as bt}from"./chunk-AVM7XNMU.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SFVU4I7K.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SFVU4I7K.js deleted file mode 100644 index f9b5331..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SFVU4I7K.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-ENETEM2P.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SFW3OK7F.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SFW3OK7F.js deleted file mode 100644 index f57c50e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SFW3OK7F.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-Y7Y54VVF.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-CXINSY4K.js";import{b as E,d as ie}from"./chunk-QMTXW4VP.js";import{a as C,b as F,f as D}from"./chunk-H6HCBMP2.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SGDQE7H4.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SGDQE7H4.js deleted file mode 100644 index 808f551..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SGDQE7H4.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-ENETEM2P.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SGSO4PDT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SGSO4PDT.js deleted file mode 100644 index 9b037f4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SGSO4PDT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-VPFNPTPP.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SIGLLOLJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SIGLLOLJ.js deleted file mode 100644 index 73e3f5b..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SIGLLOLJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-CXINSY4K.js";import{d as ht}from"./chunk-QMTXW4VP.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SJFJGS33.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SJFJGS33.js deleted file mode 100644 index 111dc22..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SJFJGS33.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-XI6BGJK3.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-WHOQYW75.js";import{a as V,d as y}from"./chunk-3R7YZYAU.js";import{b as G}from"./chunk-76AWMMRZ.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SNO2N7JZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SNO2N7JZ.js deleted file mode 100644 index a1352dd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SNO2N7JZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-A3K2ZLIM.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SQ3AZTY7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SQ3AZTY7.js deleted file mode 100644 index 6d67e40..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SQ3AZTY7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-PP2DTLZK.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-BBGWUPII.js";import{b as E,d as ie}from"./chunk-HUYVXCIF.js";import{a as C,b as F,f as D}from"./chunk-OL26GLX5.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SRA3P2UR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SRA3P2UR.js deleted file mode 100644 index 15c1f8c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SRA3P2UR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-SVV2TSM6.js";import{a as At}from"./chunk-IBDH4VHO.js";import{a as yt}from"./chunk-QWQ7HFAB.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-RDJ4UYGG.js";import{a as lt,d as it}from"./chunk-FXULDDZU.js";import{f as nt,h as bt}from"./chunk-Z3X57746.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ST7VNABR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ST7VNABR.js deleted file mode 100644 index 7245bf7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ST7VNABR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a}from"./chunk-WFYQVCMU.js";import{a as N}from"./chunk-5IUKPU5Q.js";import{a as t}from"./chunk-BOXFFUY5.js";import{e as i}from"./chunk-OVZZEY7C.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var u=Object.freeze(r);export{u as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-SVV2TSM6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-SVV2TSM6.js deleted file mode 100644 index ab50bc9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-SVV2TSM6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-Z3X57746.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-T3ZCXEDQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-T3ZCXEDQ.js deleted file mode 100644 index 0b9da40..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-T3ZCXEDQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-USXGVOKU.js";import{a as Z,b as H}from"./chunk-64BTZVEA.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-7BLPWQ26.js";import{a as it}from"./chunk-PP2DTLZK.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-BBGWUPII.js";import{f as K}from"./chunk-OL26GLX5.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-T4A75GEN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-T4A75GEN.js deleted file mode 100644 index 72ca660..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-T4A75GEN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-VTQ3OY4W.js";import{a as u,b as d}from"./chunk-UC53JWAC.js";import{a as j}from"./chunk-AMEMP742.js";import{a as _,b as h,g as A}from"./chunk-AVM7XNMU.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-T4N45YIS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-T4N45YIS.js deleted file mode 100644 index 6ae036d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-T4N45YIS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-NPMNTDSM.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-T5T75WGP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-T5T75WGP.js deleted file mode 100644 index bc2eb58..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-T5T75WGP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-WLRKMATH.js";import{d as l}from"./chunk-OZA4MN4W.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TD6F2MD4.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TD6F2MD4.js deleted file mode 100644 index f27dce6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TD6F2MD4.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-WFH7G22Z.js";import{a as U}from"./chunk-6ZVBKUW7.js";import{f as I}from"./chunk-MKGFLCRO.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TDH4RANW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TDH4RANW.js deleted file mode 100644 index d2180df..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TDH4RANW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-LO5P6EVV.js";import{a as C}from"./chunk-SFVU4I7K.js";import{b as L}from"./chunk-ENETEM2P.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TDSKLIAS.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TDSKLIAS.js deleted file mode 100644 index 3a746c5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TDSKLIAS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-FXULDDZU.js";import{h as I,i as b}from"./chunk-Z3X57746.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TEOZJNA2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TEOZJNA2.js deleted file mode 100644 index b91928c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TEOZJNA2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-2VGJ4QVX.js";import{d as ht}from"./chunk-DUJ2U2S3.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TICS7I3F.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TICS7I3F.js deleted file mode 100644 index e2f0171..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TICS7I3F.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-2GI3PW2M.js";import{d as L}from"./chunk-FXULDDZU.js";import{b as d,h as W}from"./chunk-Z3X57746.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TMD5QYHK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TMD5QYHK.js deleted file mode 100644 index ffbcd4c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TMD5QYHK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-Z3X57746.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TMXXSBXR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TMXXSBXR.js deleted file mode 100644 index 089a3b4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TMXXSBXR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-NNNSDBCQ.js";import{d as ht}from"./chunk-T4N45YIS.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TPTDE67F.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TPTDE67F.js deleted file mode 100644 index 91016be..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TPTDE67F.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-OOS6OUMR.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-KZU6RORI.js";import{d as E}from"./chunk-4YKTCJME.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TUMM5OCT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TUMM5OCT.js deleted file mode 100644 index 104acf6..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TUMM5OCT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-5KD2FCJ5.js";import{d as j}from"./chunk-BSMSCZPP.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TY7ZXIN2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TY7ZXIN2.js deleted file mode 100644 index da4c361..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TY7ZXIN2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-AVM7XNMU.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-TYCFEZIY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-TYCFEZIY.js deleted file mode 100644 index 3cb07e3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-TYCFEZIY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-OL26GLX5.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-U4KPRBXW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-U4KPRBXW.js deleted file mode 100644 index 8d9d334..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-U4KPRBXW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as y}from"./chunk-NINXVCBW.js";import{d as L}from"./chunk-CCZ6XI6A.js";import{b as d,h as W}from"./chunk-VPFNPTPP.js";import{a as A}from"./chunk-J4RA3VLE.js";import{a as s,b as k,c as T,d as b}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as I,b as z}from"./chunk-BOXFFUY5.js";import{e as h}from"./chunk-OVZZEY7C.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-U53OYCDK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-U53OYCDK.js deleted file mode 100644 index a263164..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-U53OYCDK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-HUYVXCIF.js";import{h as x}from"./chunk-OL26GLX5.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-U7DFWOO3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-U7DFWOO3.js deleted file mode 100644 index b76c7fd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-U7DFWOO3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-K4YNC4UT.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-AYSYNDKT.js";import{a as Et}from"./chunk-2P4SA4ZJ.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-ZAYZJA3R.js";import{a as _t,b as Ut,d as ot}from"./chunk-NJVZPI6A.js";import{a as pt,b as H}from"./chunk-A4L3VMPJ.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-U7DXVADV.js b/src/renderer/public/sdk/Cesium/Workers/chunk-U7DXVADV.js deleted file mode 100644 index f5ab1c2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-U7DXVADV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-5WFJ6IXL.js";import{a as I}from"./chunk-6Q5ALWJL.js";import{b as B,c as G,d as k}from"./chunk-YE4R2EE7.js";import{b as j,h as X}from"./chunk-255CHCZV.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-U7QFGE5P.js b/src/renderer/public/sdk/Cesium/Workers/chunk-U7QFGE5P.js deleted file mode 100644 index ab05d46..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-U7QFGE5P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as g,g as j}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-WFYQVCMU.js";import{b as n}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";function F(r,o,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?r+(o-r)*6*t:t*2<1?o:t*3<2?r+(o-r)*(2/3-t)*6:r}function e(r,o,t,f){this.red=r??1,this.green=o??1,this.blue=t??1,this.alpha=f??1}e.fromCartesian4=function(r,o){return n.typeOf.object("cartesian",r),b(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new e(r.x,r.y,r.z,r.w)};e.fromBytes=function(r,o,t,f,C){return r=e.byteToFloat(r??255),o=e.byteToFloat(o??255),t=e.byteToFloat(t??255),f=e.byteToFloat(f??255),b(C)?(C.red=r,C.green=o,C.blue=t,C.alpha=f,C):new e(r,o,t,f)};e.fromAlpha=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("alpha",o),b(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new e(r.red,r.green,r.blue,o)};var l,A,E;j.supportsTypedArrays()&&(l=new ArrayBuffer(4),A=new Uint32Array(l),E=new Uint8Array(l));e.fromRgba=function(r,o){return A[0]=r,e.fromBytes(E[0],E[1],E[2],E[3],o)};e.fromHsl=function(r,o,t,f,C){r=(r??0)%1,o=o??0,t=t??0,f=f??1;let m=t,s=t,O=t;if(o!==0){let c;t<.5?c=t*(1+o):c=t+o-t*o;let S=2*t-c;m=F(S,c,r+1/3),s=F(S,c,r),O=F(S,c,r-1/3)}return b(C)?(C.red=m,C.green=s,C.blue=O,C.alpha=f,C):new e(m,s,O,f)};e.fromRandom=function(r,o){r=r??g.EMPTY_OBJECT;let t=r.red;if(!b(t)){let s=r.minimumRed??0,O=r.maximumRed??1;n.typeOf.number.lessThanOrEquals("minimumRed",s,O),t=s+i.nextRandomNumber()*(O-s)}let f=r.green;if(!b(f)){let s=r.minimumGreen??0,O=r.maximumGreen??1;n.typeOf.number.lessThanOrEquals("minimumGreen",s,O),f=s+i.nextRandomNumber()*(O-s)}let C=r.blue;if(!b(C)){let s=r.minimumBlue??0,O=r.maximumBlue??1;n.typeOf.number.lessThanOrEquals("minimumBlue",s,O),C=s+i.nextRandomNumber()*(O-s)}let m=r.alpha;if(!b(m)){let s=r.minimumAlpha??0,O=r.maximumAlpha??1;n.typeOf.number.lessThanOrEquals("minimumAlpha",s,O),m=s+i.nextRandomNumber()*(O-s)}return b(o)?(o.red=t,o.green=f,o.blue=C,o.alpha=m,o):new e(t,f,C,m)};var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,z=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.fromCssColorString=function(r,o){n.typeOf.string("color",r),b(o)||(o=new e),r=r.trim();let t=e[r.toUpperCase()];if(b(t))return e.clone(t,o),o;let f=a.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(f[4]??"f",16)/15,o):(f=z.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(f[4]??"ff",16)/255,o):(f=p.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(f[4]??"1.0"),o):(f=R.exec(r),f!==null?e.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(f[4]??"1.0"),o):(o=void 0,o))))};e.packedLength=4;e.pack=function(r,o,t){return n.typeOf.object("value",r),n.defined("array",o),t=t??0,o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o};e.unpack=function(r,o,t){return n.defined("array",r),o=o??0,b(t)||(t=new e),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t};e.byteToFloat=function(r){return r/255};e.floatToByte=function(r){return r===1?255:r*256|0};e.clone=function(r,o){if(b(r))return b(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new e(r.red,r.green,r.blue,r.alpha)};e.equals=function(r,o){return r===o||b(r)&&b(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha};e.equalsArray=function(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]};e.prototype.clone=function(r){return e.clone(this,r)};e.prototype.equals=function(r){return e.equals(this,r)};e.prototype.equalsEpsilon=function(r,o){return this===r||b(r)&&Math.abs(this.red-r.red)<=o&&Math.abs(this.green-r.green)<=o&&Math.abs(this.blue-r.blue)<=o&&Math.abs(this.alpha-r.alpha)<=o};e.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};e.prototype.toCssColorString=function(){let r=e.floatToByte(this.red),o=e.floatToByte(this.green),t=e.floatToByte(this.blue);return this.alpha===1?`rgb(${r},${o},${t})`:`rgba(${r},${o},${t},${this.alpha})`};e.prototype.toCssHexString=function(){let r=e.floatToByte(this.red).toString(16);r.length<2&&(r=`0${r}`);let o=e.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let t=e.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let f=e.floatToByte(this.alpha).toString(16);return f.length<2&&(f=`0${f}`),`#${r}${o}${t}${f}`}return`#${r}${o}${t}`};e.prototype.toBytes=function(r){let o=e.floatToByte(this.red),t=e.floatToByte(this.green),f=e.floatToByte(this.blue),C=e.floatToByte(this.alpha);return b(r)?(r[0]=o,r[1]=t,r[2]=f,r[3]=C,r):[o,t,f,C]};e.prototype.toRgba=function(){return E[0]=e.floatToByte(this.red),E[1]=e.floatToByte(this.green),E[2]=e.floatToByte(this.blue),E[3]=e.floatToByte(this.alpha),A[0]};e.prototype.brighten=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=1-(1-this.red)*r,o.green=1-(1-this.green)*r,o.blue=1-(1-this.blue)*r,o.alpha=this.alpha,o};e.prototype.darken=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=this.red*r,o.green=this.green*r,o.blue=this.blue*r,o.alpha=this.alpha,o};e.prototype.withAlpha=function(r,o){return e.fromAlpha(this,r,o)};e.add=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red+o.red,t.green=r.green+o.green,t.blue=r.blue+o.blue,t.alpha=r.alpha+o.alpha,t};e.subtract=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red-o.red,t.green=r.green-o.green,t.blue=r.blue-o.blue,t.alpha=r.alpha-o.alpha,t};e.multiply=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red*o.red,t.green=r.green*o.green,t.blue=r.blue*o.blue,t.alpha=r.alpha*o.alpha,t};e.divide=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red/o.red,t.green=r.green/o.green,t.blue=r.blue/o.blue,t.alpha=r.alpha/o.alpha,t};e.mod=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red%o.red,t.green=r.green%o.green,t.blue=r.blue%o.blue,t.alpha=r.alpha%o.alpha,t};e.lerp=function(r,o,t,f){return n.typeOf.object("start",r),n.typeOf.object("end",o),n.typeOf.number("t",t),n.typeOf.object("result",f),f.red=i.lerp(r.red,o.red,t),f.green=i.lerp(r.green,o.green,t),f.blue=i.lerp(r.blue,o.blue,t),f.alpha=i.lerp(r.alpha,o.alpha,t),f};e.multiplyByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red*o,t.green=r.green*o,t.blue=r.blue*o,t.alpha=r.alpha*o,t};e.divideByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red/o,t.green=r.green/o,t.blue=r.blue/o,t.alpha=r.alpha/o,t};e.ALICEBLUE=Object.freeze(e.fromCssColorString("#F0F8FF"));e.ANTIQUEWHITE=Object.freeze(e.fromCssColorString("#FAEBD7"));e.AQUA=Object.freeze(e.fromCssColorString("#00FFFF"));e.AQUAMARINE=Object.freeze(e.fromCssColorString("#7FFFD4"));e.AZURE=Object.freeze(e.fromCssColorString("#F0FFFF"));e.BEIGE=Object.freeze(e.fromCssColorString("#F5F5DC"));e.BISQUE=Object.freeze(e.fromCssColorString("#FFE4C4"));e.BLACK=Object.freeze(e.fromCssColorString("#000000"));e.BLANCHEDALMOND=Object.freeze(e.fromCssColorString("#FFEBCD"));e.BLUE=Object.freeze(e.fromCssColorString("#0000FF"));e.BLUEVIOLET=Object.freeze(e.fromCssColorString("#8A2BE2"));e.BROWN=Object.freeze(e.fromCssColorString("#A52A2A"));e.BURLYWOOD=Object.freeze(e.fromCssColorString("#DEB887"));e.CADETBLUE=Object.freeze(e.fromCssColorString("#5F9EA0"));e.CHARTREUSE=Object.freeze(e.fromCssColorString("#7FFF00"));e.CHOCOLATE=Object.freeze(e.fromCssColorString("#D2691E"));e.CORAL=Object.freeze(e.fromCssColorString("#FF7F50"));e.CORNFLOWERBLUE=Object.freeze(e.fromCssColorString("#6495ED"));e.CORNSILK=Object.freeze(e.fromCssColorString("#FFF8DC"));e.CRIMSON=Object.freeze(e.fromCssColorString("#DC143C"));e.CYAN=Object.freeze(e.fromCssColorString("#00FFFF"));e.DARKBLUE=Object.freeze(e.fromCssColorString("#00008B"));e.DARKCYAN=Object.freeze(e.fromCssColorString("#008B8B"));e.DARKGOLDENROD=Object.freeze(e.fromCssColorString("#B8860B"));e.DARKGRAY=Object.freeze(e.fromCssColorString("#A9A9A9"));e.DARKGREEN=Object.freeze(e.fromCssColorString("#006400"));e.DARKGREY=e.DARKGRAY;e.DARKKHAKI=Object.freeze(e.fromCssColorString("#BDB76B"));e.DARKMAGENTA=Object.freeze(e.fromCssColorString("#8B008B"));e.DARKOLIVEGREEN=Object.freeze(e.fromCssColorString("#556B2F"));e.DARKORANGE=Object.freeze(e.fromCssColorString("#FF8C00"));e.DARKORCHID=Object.freeze(e.fromCssColorString("#9932CC"));e.DARKRED=Object.freeze(e.fromCssColorString("#8B0000"));e.DARKSALMON=Object.freeze(e.fromCssColorString("#E9967A"));e.DARKSEAGREEN=Object.freeze(e.fromCssColorString("#8FBC8F"));e.DARKSLATEBLUE=Object.freeze(e.fromCssColorString("#483D8B"));e.DARKSLATEGRAY=Object.freeze(e.fromCssColorString("#2F4F4F"));e.DARKSLATEGREY=e.DARKSLATEGRAY;e.DARKTURQUOISE=Object.freeze(e.fromCssColorString("#00CED1"));e.DARKVIOLET=Object.freeze(e.fromCssColorString("#9400D3"));e.DEEPPINK=Object.freeze(e.fromCssColorString("#FF1493"));e.DEEPSKYBLUE=Object.freeze(e.fromCssColorString("#00BFFF"));e.DIMGRAY=Object.freeze(e.fromCssColorString("#696969"));e.DIMGREY=e.DIMGRAY;e.DODGERBLUE=Object.freeze(e.fromCssColorString("#1E90FF"));e.FIREBRICK=Object.freeze(e.fromCssColorString("#B22222"));e.FLORALWHITE=Object.freeze(e.fromCssColorString("#FFFAF0"));e.FORESTGREEN=Object.freeze(e.fromCssColorString("#228B22"));e.FUCHSIA=Object.freeze(e.fromCssColorString("#FF00FF"));e.GAINSBORO=Object.freeze(e.fromCssColorString("#DCDCDC"));e.GHOSTWHITE=Object.freeze(e.fromCssColorString("#F8F8FF"));e.GOLD=Object.freeze(e.fromCssColorString("#FFD700"));e.GOLDENROD=Object.freeze(e.fromCssColorString("#DAA520"));e.GRAY=Object.freeze(e.fromCssColorString("#808080"));e.GREEN=Object.freeze(e.fromCssColorString("#008000"));e.GREENYELLOW=Object.freeze(e.fromCssColorString("#ADFF2F"));e.GREY=e.GRAY;e.HONEYDEW=Object.freeze(e.fromCssColorString("#F0FFF0"));e.HOTPINK=Object.freeze(e.fromCssColorString("#FF69B4"));e.INDIANRED=Object.freeze(e.fromCssColorString("#CD5C5C"));e.INDIGO=Object.freeze(e.fromCssColorString("#4B0082"));e.IVORY=Object.freeze(e.fromCssColorString("#FFFFF0"));e.KHAKI=Object.freeze(e.fromCssColorString("#F0E68C"));e.LAVENDER=Object.freeze(e.fromCssColorString("#E6E6FA"));e.LAVENDAR_BLUSH=Object.freeze(e.fromCssColorString("#FFF0F5"));e.LAWNGREEN=Object.freeze(e.fromCssColorString("#7CFC00"));e.LEMONCHIFFON=Object.freeze(e.fromCssColorString("#FFFACD"));e.LIGHTBLUE=Object.freeze(e.fromCssColorString("#ADD8E6"));e.LIGHTCORAL=Object.freeze(e.fromCssColorString("#F08080"));e.LIGHTCYAN=Object.freeze(e.fromCssColorString("#E0FFFF"));e.LIGHTGOLDENRODYELLOW=Object.freeze(e.fromCssColorString("#FAFAD2"));e.LIGHTGRAY=Object.freeze(e.fromCssColorString("#D3D3D3"));e.LIGHTGREEN=Object.freeze(e.fromCssColorString("#90EE90"));e.LIGHTGREY=e.LIGHTGRAY;e.LIGHTPINK=Object.freeze(e.fromCssColorString("#FFB6C1"));e.LIGHTSEAGREEN=Object.freeze(e.fromCssColorString("#20B2AA"));e.LIGHTSKYBLUE=Object.freeze(e.fromCssColorString("#87CEFA"));e.LIGHTSLATEGRAY=Object.freeze(e.fromCssColorString("#778899"));e.LIGHTSLATEGREY=e.LIGHTSLATEGRAY;e.LIGHTSTEELBLUE=Object.freeze(e.fromCssColorString("#B0C4DE"));e.LIGHTYELLOW=Object.freeze(e.fromCssColorString("#FFFFE0"));e.LIME=Object.freeze(e.fromCssColorString("#00FF00"));e.LIMEGREEN=Object.freeze(e.fromCssColorString("#32CD32"));e.LINEN=Object.freeze(e.fromCssColorString("#FAF0E6"));e.MAGENTA=Object.freeze(e.fromCssColorString("#FF00FF"));e.MAROON=Object.freeze(e.fromCssColorString("#800000"));e.MEDIUMAQUAMARINE=Object.freeze(e.fromCssColorString("#66CDAA"));e.MEDIUMBLUE=Object.freeze(e.fromCssColorString("#0000CD"));e.MEDIUMORCHID=Object.freeze(e.fromCssColorString("#BA55D3"));e.MEDIUMPURPLE=Object.freeze(e.fromCssColorString("#9370DB"));e.MEDIUMSEAGREEN=Object.freeze(e.fromCssColorString("#3CB371"));e.MEDIUMSLATEBLUE=Object.freeze(e.fromCssColorString("#7B68EE"));e.MEDIUMSPRINGGREEN=Object.freeze(e.fromCssColorString("#00FA9A"));e.MEDIUMTURQUOISE=Object.freeze(e.fromCssColorString("#48D1CC"));e.MEDIUMVIOLETRED=Object.freeze(e.fromCssColorString("#C71585"));e.MIDNIGHTBLUE=Object.freeze(e.fromCssColorString("#191970"));e.MINTCREAM=Object.freeze(e.fromCssColorString("#F5FFFA"));e.MISTYROSE=Object.freeze(e.fromCssColorString("#FFE4E1"));e.MOCCASIN=Object.freeze(e.fromCssColorString("#FFE4B5"));e.NAVAJOWHITE=Object.freeze(e.fromCssColorString("#FFDEAD"));e.NAVY=Object.freeze(e.fromCssColorString("#000080"));e.OLDLACE=Object.freeze(e.fromCssColorString("#FDF5E6"));e.OLIVE=Object.freeze(e.fromCssColorString("#808000"));e.OLIVEDRAB=Object.freeze(e.fromCssColorString("#6B8E23"));e.ORANGE=Object.freeze(e.fromCssColorString("#FFA500"));e.ORANGERED=Object.freeze(e.fromCssColorString("#FF4500"));e.ORCHID=Object.freeze(e.fromCssColorString("#DA70D6"));e.PALEGOLDENROD=Object.freeze(e.fromCssColorString("#EEE8AA"));e.PALEGREEN=Object.freeze(e.fromCssColorString("#98FB98"));e.PALETURQUOISE=Object.freeze(e.fromCssColorString("#AFEEEE"));e.PALEVIOLETRED=Object.freeze(e.fromCssColorString("#DB7093"));e.PAPAYAWHIP=Object.freeze(e.fromCssColorString("#FFEFD5"));e.PEACHPUFF=Object.freeze(e.fromCssColorString("#FFDAB9"));e.PERU=Object.freeze(e.fromCssColorString("#CD853F"));e.PINK=Object.freeze(e.fromCssColorString("#FFC0CB"));e.PLUM=Object.freeze(e.fromCssColorString("#DDA0DD"));e.POWDERBLUE=Object.freeze(e.fromCssColorString("#B0E0E6"));e.PURPLE=Object.freeze(e.fromCssColorString("#800080"));e.RED=Object.freeze(e.fromCssColorString("#FF0000"));e.ROSYBROWN=Object.freeze(e.fromCssColorString("#BC8F8F"));e.ROYALBLUE=Object.freeze(e.fromCssColorString("#4169E1"));e.SADDLEBROWN=Object.freeze(e.fromCssColorString("#8B4513"));e.SALMON=Object.freeze(e.fromCssColorString("#FA8072"));e.SANDYBROWN=Object.freeze(e.fromCssColorString("#F4A460"));e.SEAGREEN=Object.freeze(e.fromCssColorString("#2E8B57"));e.SEASHELL=Object.freeze(e.fromCssColorString("#FFF5EE"));e.SIENNA=Object.freeze(e.fromCssColorString("#A0522D"));e.SILVER=Object.freeze(e.fromCssColorString("#C0C0C0"));e.SKYBLUE=Object.freeze(e.fromCssColorString("#87CEEB"));e.SLATEBLUE=Object.freeze(e.fromCssColorString("#6A5ACD"));e.SLATEGRAY=Object.freeze(e.fromCssColorString("#708090"));e.SLATEGREY=e.SLATEGRAY;e.SNOW=Object.freeze(e.fromCssColorString("#FFFAFA"));e.SPRINGGREEN=Object.freeze(e.fromCssColorString("#00FF7F"));e.STEELBLUE=Object.freeze(e.fromCssColorString("#4682B4"));e.TAN=Object.freeze(e.fromCssColorString("#D2B48C"));e.TEAL=Object.freeze(e.fromCssColorString("#008080"));e.THISTLE=Object.freeze(e.fromCssColorString("#D8BFD8"));e.TOMATO=Object.freeze(e.fromCssColorString("#FF6347"));e.TURQUOISE=Object.freeze(e.fromCssColorString("#40E0D0"));e.VIOLET=Object.freeze(e.fromCssColorString("#EE82EE"));e.WHEAT=Object.freeze(e.fromCssColorString("#F5DEB3"));e.WHITE=Object.freeze(e.fromCssColorString("#FFFFFF"));e.WHITESMOKE=Object.freeze(e.fromCssColorString("#F5F5F5"));e.YELLOW=Object.freeze(e.fromCssColorString("#FFFF00"));e.YELLOWGREEN=Object.freeze(e.fromCssColorString("#9ACD32"));e.TRANSPARENT=Object.freeze(new e(0,0,0,0));var h=e;export{h as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UC53JWAC.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UC53JWAC.js deleted file mode 100644 index 7961e44..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UC53JWAC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-BSMSCZPP.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UELY7C3B.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UELY7C3B.js deleted file mode 100644 index dd67de8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UELY7C3B.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-HUYVXCIF.js";import{h as I,i as b}from"./chunk-OL26GLX5.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UFLNPO5S.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UFLNPO5S.js deleted file mode 100644 index f171a83..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UFLNPO5S.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-LFMGBZZM.js";import{a as Z,b as H}from"./chunk-BODFY54A.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-CW7S2NZX.js";import{a as it}from"./chunk-Y7Y54VVF.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-CXINSY4K.js";import{f as K}from"./chunk-H6HCBMP2.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UI3RX6LP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UI3RX6LP.js deleted file mode 100644 index e1c0cd1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UI3RX6LP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-3OFCT7WF.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-5KD2FCJ5.js";import{a as V,d as y}from"./chunk-BSMSCZPP.js";import{b as G}from"./chunk-AVM7XNMU.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UIOUPQTJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UIOUPQTJ.js deleted file mode 100644 index 6f38f79..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UIOUPQTJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-SFVU4I7K.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-SGDQE7H4.js";import{b as E,d as ie}from"./chunk-WHDDCNJ6.js";import{a as C,b as F,f as D}from"./chunk-ENETEM2P.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UKIWMELT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UKIWMELT.js deleted file mode 100644 index 3cf8bd9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UKIWMELT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-3R7YZYAU.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UO3PFVIQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UO3PFVIQ.js deleted file mode 100644 index 6963495..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UO3PFVIQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-AVM7XNMU.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UOX6KQJA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UOX6KQJA.js deleted file mode 100644 index 9954dc1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UOX6KQJA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-AYSYNDKT.js";import{a as C}from"./chunk-2P4SA4ZJ.js";import{b as L}from"./chunk-A4L3VMPJ.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UOYV36KX.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UOYV36KX.js deleted file mode 100644 index 8086cde..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UOYV36KX.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-TMD5QYHK.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-RDJ4UYGG.js";import{b as E,d as ie}from"./chunk-FXULDDZU.js";import{a as C,b as F,f as D}from"./chunk-Z3X57746.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-USOVZCJZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-USOVZCJZ.js deleted file mode 100644 index 486bde0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-USOVZCJZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z}from"./chunk-4YKTCJME.js";import{h as I,i as b}from"./chunk-MKGFLCRO.js";import{a as W,b as O,d as L}from"./chunk-MGW7GK6C.js";import{a as m}from"./chunk-WFYQVCMU.js";import{a as v}from"./chunk-BOXFFUY5.js";import{e as k}from"./chunk-OVZZEY7C.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-USXGVOKU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-USXGVOKU.js deleted file mode 100644 index 8b1e592..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-USXGVOKU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-TYCFEZIY.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-7BLPWQ26.js";import{a as Et}from"./chunk-PP2DTLZK.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-BBGWUPII.js";import{a as _t,b as Ut,d as ot}from"./chunk-HUYVXCIF.js";import{a as pt,b as H}from"./chunk-OL26GLX5.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UW34AHI2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UW34AHI2.js deleted file mode 100644 index 94d19e8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UW34AHI2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-YE4R2EE7.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-UZD4YVOQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-UZD4YVOQ.js deleted file mode 100644 index cd02b87..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-UZD4YVOQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-ZB37QSBP.js";import{a as Z,b as H}from"./chunk-V5NRAWL6.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-O5YU7IER.js";import{a as it}from"./chunk-6Q5ALWJL.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-NXRSA4OE.js";import{f as K}from"./chunk-255CHCZV.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-V246HDED.js b/src/renderer/public/sdk/Cesium/Workers/chunk-V246HDED.js deleted file mode 100644 index 725a8e2..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-V246HDED.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as Q}from"./chunk-PGM6B4G2.js";import{a as N}from"./chunk-HNJRTQHB.js";import{a as _}from"./chunk-XJK3AZF6.js";import{a as K}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as J,c as W,d as L}from"./chunk-CXINSY4K.js";import{d as j}from"./chunk-QMTXW4VP.js";import{a as S}from"./chunk-J4RA3VLE.js";import{a as b,c as E,f as Z}from"./chunk-MGW7GK6C.js";import{a as Y}from"./chunk-WFYQVCMU.js";import{a as F}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-V5JG7NIH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-V5JG7NIH.js deleted file mode 100644 index 168f7c3..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-V5JG7NIH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-CCZ6XI6A.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-V5NRAWL6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-V5NRAWL6.js deleted file mode 100644 index 83fc334..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-V5NRAWL6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-NXRSA4OE.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-V5X3UAM5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-V5X3UAM5.js deleted file mode 100644 index 368c422..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-V5X3UAM5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as L}from"./chunk-HY3NA4VQ.js";import{a as S}from"./chunk-HNJRTQHB.js";import{a as D}from"./chunk-ST7VNABR.js";import{a as H}from"./chunk-EK6GOLXU.js";import{b as T,c as B,d as x}from"./chunk-NNNSDBCQ.js";import{d as E}from"./chunk-T4N45YIS.js";import{a as O}from"./chunk-J4RA3VLE.js";import{a as c,d,f as V}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";import{a as A}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,0,w.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VBHK7U5X.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VBHK7U5X.js deleted file mode 100644 index e2f1709..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VBHK7U5X.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-U7DFWOO3.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-ZAYZJA3R.js";import{a as V,d as y}from"./chunk-NJVZPI6A.js";import{b as G}from"./chunk-A4L3VMPJ.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VJKWOLRI.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VJKWOLRI.js deleted file mode 100644 index c8c513c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VJKWOLRI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-CXINSY4K.js";import{d as l}from"./chunk-QMTXW4VP.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VMDPGM26.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VMDPGM26.js deleted file mode 100644 index 5d90c67..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VMDPGM26.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-NJVZPI6A.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VPEROESZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VPEROESZ.js deleted file mode 100644 index 28d6c19..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VPEROESZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-UOX6KQJA.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VPFNPTPP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VPFNPTPP.js deleted file mode 100644 index 5610979..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VPFNPTPP.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Tt,c as Ct,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Ct((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Ct((qn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Ct((Nn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Ct((Fn,qt)=>{/*! - * 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 qt=="object"&&qt.exports?qt.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var vt=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitude(vt)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,vt),j.magnitudeSquared(vt)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var At=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new At,jt=[31,28,31,30,31,30,31,31,30,31,30,31],Mt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Ut(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Ut(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof At))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Ut(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>jt[i-1]||T&&i===2&&r>Mt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?Mt:jt[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?Mt:jt[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?Mt:jt[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Ut(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Pt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Pt);p(o)||(U.addSeconds(e,-1,Pt),o=Un(Pt,Pt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new At(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var Dt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Nt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function kt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}kt.prototype.cancel=function(){this.cancelled=!0};kt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new kt(this)};var Kn=kt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var Ft=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new Ft.default(document.location.href):new Ft.default,xt=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=xt;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],xt.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new Ft.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Nt(e.url)||Dt(e.url))return xt.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",gt,Ot;try{Ot=window.indexedDB.open(Ir,1),Ot.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})},Ot.onsuccess=function(e){gt=e.target.result},Ot.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function ao(e,t){if(!gt)return;let o=gt.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!gt)n();else{let r=gt.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},Ot.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Nt(this._url)}},isBlobUri:{get:function(){return Dt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=qr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function qr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Dr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Dr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest2=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var Nr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function kr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Fr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var xr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=Nr.exec(e);if(u!==null){r.resolve(kr(u,t));return}if(xr){Fr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function St(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}St.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new St({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};St.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});St.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Lr(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Lr);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function _t(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=_t(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=_t(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_t(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_t(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_t(l,T,M),s}var bo=St;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Br(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Br(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Qr(e){return go(Tt.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Tt.toUrl)?$t=Qr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Wr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Wr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 Hr=new ue(0,0,H.TAI);function pn(e,t,n){let o=Hr;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var Rt=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Rt=g.normalize(e,Rt);let r=Rt.x*i,s=Rt.y*i,u=Rt.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var $r=[1,2,0],Yr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=$r,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Yr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Vr=new g,Xr=new g,Et=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Et);S.multiply(i,n,st);let r=S.log(st,Vr);S.multiply(i,e,st);let s=S.log(st,Xr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Et),S.multiply(t,Et,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Et),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Zr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Zr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Et),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Jr=new Xe,Gr=new g(1,1,1),Kr=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Jr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Gr,Kr);return i=o(e,n,i),J.multiply(i,s,i)};var ei=new J,ti=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ei),s=J.getMatrix3(r,ti);return Xe.fromRotationMatrix(s,i)};var ni=new g(1,1,1),oi=new g,Po=new J,ri=new J,ii=new B,ci=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,oi);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,ni,ri);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ii),ci);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var si=6*3600+41*60+50.54841,ai=8640184812866e-6,fi=.093104,ui=-62e-7,pi=11772758384668e-32,hi=72921158553e-15,di=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(si+i*(ai+i*(fi+i*ui)))*di%R.TWO_PI,d=hi+pi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,mi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var yi=32.184,li=2451545,Kt=new Wt,wi=new B,bi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,yi,bi),o=ue.totalDays(n)-li,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,wi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var Oi=new Yt(0,0,0),gi=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,gi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,Oi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-mi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var _i=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=_i;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Si=new g,Ri=new g,Ei=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Si),r=g.cross(t,i,Ri);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ei);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ti=new g,Ci=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ti),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,Ci),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var vi=new g,Ai=new g,ji=new g,Mi=new g,Pi=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,vi),s=J.multiplyByPointAsVector(r,g.UNIT_X,Ai);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,ji);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Pi),m=g.negate(s,Mi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ui=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=Ui;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var uf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var zi=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,zi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ii=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var qi=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,qi);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Di=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Di);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var lf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,uf as h,lf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VQJOM3ZG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VQJOM3ZG.js deleted file mode 100644 index b90fbec..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VQJOM3ZG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-CCZ6XI6A.js";import{h as x}from"./chunk-VPFNPTPP.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VRJWOB4B.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VRJWOB4B.js deleted file mode 100644 index 77b775c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VRJWOB4B.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-BEESOPLV.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-WLRKMATH.js";import{a as V,d as y}from"./chunk-OZA4MN4W.js";import{b as G}from"./chunk-FXKWBJNE.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VRMOVC5W.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VRMOVC5W.js deleted file mode 100644 index 2a3b395..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VRMOVC5W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-RD5EBYQO.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-NNNSDBCQ.js";import{a as V,d as y}from"./chunk-T4N45YIS.js";import{b as G}from"./chunk-NPMNTDSM.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VTQ3OY4W.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VTQ3OY4W.js deleted file mode 100644 index 69e781e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VTQ3OY4W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as d}from"./chunk-BSMSCZPP.js";import{a as i}from"./chunk-MGW7GK6C.js";import{b as r}from"./chunk-BOXFFUY5.js";import{e as c}from"./chunk-OVZZEY7C.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VUEOYWG4.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VUEOYWG4.js deleted file mode 100644 index d2d62b4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VUEOYWG4.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-GIDGP7AL.js";import{a as At}from"./chunk-JZAYRSGP.js";import{a as yt}from"./chunk-LFMGBZZM.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-CXINSY4K.js";import{a as lt,d as it}from"./chunk-QMTXW4VP.js";import{f as nt,h as bt}from"./chunk-H6HCBMP2.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-VVEMFYB5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-VVEMFYB5.js deleted file mode 100644 index f127f56..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-VVEMFYB5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-MQB7GV4P.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-SGDQE7H4.js";import{a as V,d as y}from"./chunk-WHDDCNJ6.js";import{b as G}from"./chunk-ENETEM2P.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-W2DKFKTQ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-W2DKFKTQ.js deleted file mode 100644 index 6c99369..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-W2DKFKTQ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-BBGWUPII.js";import{d as ht}from"./chunk-HUYVXCIF.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-W465DA7H.js b/src/renderer/public/sdk/Cesium/Workers/chunk-W465DA7H.js deleted file mode 100644 index a4bff15..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-W465DA7H.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-WHOQYW75.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-W7YKUALL.js b/src/renderer/public/sdk/Cesium/Workers/chunk-W7YKUALL.js deleted file mode 100644 index 60e7c26..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-W7YKUALL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-KYP7OKF3.js";import{a as te}from"./chunk-E3KEZ4QR.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-A3K2ZLIM.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WFH7G22Z.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WFH7G22Z.js deleted file mode 100644 index 1762ac8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WFH7G22Z.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-6ZVBKUW7.js";import{a as te}from"./chunk-IHVDVYHC.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-MKGFLCRO.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WFRL2ODN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WFRL2ODN.js deleted file mode 100644 index 33f5c06..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WFRL2ODN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-SNO2N7JZ.js";import{a as At}from"./chunk-ZSXVKIGK.js";import{a as yt}from"./chunk-A6LYFLOJ.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-2VGJ4QVX.js";import{a as lt,d as it}from"./chunk-DUJ2U2S3.js";import{f as nt,h as bt}from"./chunk-A3K2ZLIM.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WFYQVCMU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WFYQVCMU.js deleted file mode 100644 index 456262f..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WFYQVCMU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as n,b as a}from"./chunk-BOXFFUY5.js";import{c as E,d as I,e as o}from"./chunk-OVZZEY7C.js";var d=E((_,m)=>{var f=function(t){t==null&&(t=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,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};f.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};f.prototype.init_by_array=function(t,i){var e,s,h;for(this.init_seed(19650218),e=1,s=0,h=this.N>i?this.N:i;h;h--){var u=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((u&4294901760)>>>16)*1664525<<16)+(u&65535)*1664525)+t[s]+s,this.mt[e]>>>=0,e++,s++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),s>=i&&(s=0)}for(h=this.N-1;h;h--){var u=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((u&4294901760)>>>16)*1566083941<<16)+(u&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};f.prototype.random_int=function(){var t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};f.prototype.random_int31=function(){return this.random_int()>>>1};f.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};f.prototype.random=function(){return this.random_int()*(1/4294967296)};f.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};f.prototype.random_long=function(){var t=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};m.exports=f});var w=I(d(),1);var r={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1};r.signNotZero=function(t){return t<0?-1:1};r.toSNorm=function(t,i){return i=i??255,Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){return i=i??255,r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2};r.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2};r.lerp=function(t,i,e){return(1-e)*t+e*i};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!o(t))throw new n("degrees is required.");return t*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!o(t))throw new n("radians is required.");return t*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!o(t))throw new n("angle is required.");let i=r.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!o(t))throw new n("angle is required.");return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!o(t))throw new n("angle is required.");return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!o(t))throw new n("angle is required.");if(t>=0&&t<=r.TWO_PI)return t;let i=r.mod(t,r.TWO_PI);return Math.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!o(t))throw new n("m is required.");if(!o(i))throw new n("n is required.");if(i===0)throw new n("divisor cannot be 0.");return r.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,s){if(!o(t))throw new n("left is required.");if(!o(i))throw new n("right is required.");e=e??0,s=s??e;let h=Math.abs(t-i);return h<=s||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<-e};r.lessThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<e};r.greaterThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>e};r.greaterThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>-e};var c=[1];r.factorial=function(t){if(typeof t!="number"||t<0)throw new n("A number greater than or equal to 0 is required.");let i=c.length;if(t>=i){let e=c[i-1];for(let s=i;s<=t;s++){let h=e*s;c.push(h),e=h}}return c[t]};r.incrementWrap=function(t,i,e){if(e=e??0,!o(t))throw new n("n is required.");if(i<=e)throw new n("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new n("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){return a.typeOf.number("value",t),a.typeOf.number("min",i),a.typeOf.number("max",e),t<i?i:t>e?e:t};var P=new w.default;r.setRandomNumberSeed=function(t){if(!o(t))throw new n("seed is required.");P=new w.default(t)};r.nextRandomNumber=function(){return P.random()};r.randomBetween=function(t,i){return r.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!o(t))throw new n("value is required.");return Math.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!o(t))throw new n("value is required.");return Math.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!o(t))throw new n("angle is required.");if(!o(i))throw new n("radius is required.");return 2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!o(t))throw new n("number is required.");if(!o(i))throw new n("base is required.");return Math.log(t)/Math.log(i)};r.cbrt=Math.cbrt??function(i){let e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e};r.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E};r.fog=function(t,i){let e=t*i;return 1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){return a.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){a.typeOf.number("x",t),a.typeOf.number("y",i);let e,s=Math.abs(t);e=Math.abs(i);let h=Math.max(s,e);e=Math.min(s,e);let u=e/h;if(isNaN(u))throw new n("either x or y must be nonzero");return s=r.fastApproximateAtan(u),s=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-s:s,s=t<0?r.PI-s:s,s=i<0?-s:s,s};var M=r;export{M as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WH7Z3BNJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WH7Z3BNJ.js deleted file mode 100644 index 831283a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WH7Z3BNJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as w,b as z,i as S}from"./chunk-NPMNTDSM.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as C,c as T,e as x}from"./chunk-MGW7GK6C.js";import{a as h}from"./chunk-WFYQVCMU.js";import{a as u,b as a}from"./chunk-BOXFFUY5.js";import{e as b}from"./chunk-OVZZEY7C.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WHDDCNJ6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WHDDCNJ6.js deleted file mode 100644 index 066f313..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WHDDCNJ6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-ENETEM2P.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WHOQYW75.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WHOQYW75.js deleted file mode 100644 index 1fe89df..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WHOQYW75.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-76AWMMRZ.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WHSFAWNA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WHSFAWNA.js deleted file mode 100644 index 0d657f8..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WHSFAWNA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-JCBDR53F.js";import{a as C}from"./chunk-65RJEMLK.js";import{b as L}from"./chunk-IU3JXFWW.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WJJED6SN.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WJJED6SN.js deleted file mode 100644 index dba1ee1..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WJJED6SN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-5KD2FCJ5.js";import{d as ht}from"./chunk-BSMSCZPP.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WKAVOFTU.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WKAVOFTU.js deleted file mode 100644 index 24977f4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WKAVOFTU.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-NL2AQYZR.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WLRKMATH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WLRKMATH.js deleted file mode 100644 index 0412be0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WLRKMATH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-FXKWBJNE.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WMH5MOXD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WMH5MOXD.js deleted file mode 100644 index 7813363..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WMH5MOXD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-KZU6RORI.js";import{d as H}from"./chunk-4YKTCJME.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WQAMNE2X.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WQAMNE2X.js deleted file mode 100644 index f96290e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WQAMNE2X.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-ZAYZJA3R.js";import{d as ht}from"./chunk-NJVZPI6A.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WSUD4NWK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WSUD4NWK.js deleted file mode 100644 index e15c391..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WSUD4NWK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-RDJ4UYGG.js";import{d as l}from"./chunk-FXULDDZU.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WU6XDITA.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WU6XDITA.js deleted file mode 100644 index b35f9ab..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WU6XDITA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-WHSFAWNA.js";import{a as te}from"./chunk-GDUPQZNM.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-IU3JXFWW.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WXNTIR55.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WXNTIR55.js deleted file mode 100644 index 87df561..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WXNTIR55.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-QQ2JU7XK.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-KZU6RORI.js";import{b as E,d as ie}from"./chunk-4YKTCJME.js";import{a as C,b as F,f as D}from"./chunk-MKGFLCRO.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-WY7EJ2MW.js b/src/renderer/public/sdk/Cesium/Workers/chunk-WY7EJ2MW.js deleted file mode 100644 index aafa0a5..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-WY7EJ2MW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as F}from"./chunk-HNJRTQHB.js";import{a as Z}from"./chunk-ST7VNABR.js";import{a as X}from"./chunk-EK6GOLXU.js";import{b as K,c as Q,d as U}from"./chunk-A24L4QN2.js";import{d as H}from"./chunk-ZA6CVU2J.js";import{a as y}from"./chunk-J4RA3VLE.js";import{a as r,d as J,f as V}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as b}from"./chunk-BOXFFUY5.js";import{e as R}from"./chunk-OVZZEY7C.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XADRZOAD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XADRZOAD.js deleted file mode 100644 index cc78b50..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XADRZOAD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as d}from"./chunk-BSMSCZPP.js";import{h as x}from"./chunk-AVM7XNMU.js";import{b as p,c as M,d as O}from"./chunk-MGW7GK6C.js";import{b as m}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XBCBWMWB.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XBCBWMWB.js deleted file mode 100644 index 097ab86..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XBCBWMWB.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-NL2AQYZR.js";import{a as te}from"./chunk-NQPD6VVH.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-OL26GLX5.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XCMSHRLY.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XCMSHRLY.js deleted file mode 100644 index ed08902..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XCMSHRLY.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-FXKWBJNE.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XI6BGJK3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XI6BGJK3.js deleted file mode 100644 index 4bcdb42..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XI6BGJK3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-G5IU4JGW.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-KZM3XMI2.js";import{a as Et}from"./chunk-JWULCKZP.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-WHOQYW75.js";import{a as _t,b as Ut,d as ot}from"./chunk-3R7YZYAU.js";import{a as pt,b as H}from"./chunk-76AWMMRZ.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XJK3AZF6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XJK3AZF6.js deleted file mode 100644 index bda02b4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XJK3AZF6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as O}from"./chunk-MGW7GK6C.js";import{a as f}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function n(e){e=e??O.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}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!t(e))throw new f("value is required");if(!t(o))throw new f("array is required");return i=i??0,o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!t(e))throw new f("array is required");return o=o??0,t(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(t(e))return t(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XOQIYWSP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XOQIYWSP.js deleted file mode 100644 index 175e20a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XOQIYWSP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as wt}from"./chunk-HNJRTQHB.js";import{a as C}from"./chunk-XJK3AZF6.js";import{a as kt}from"./chunk-ST7VNABR.js";import{a as Ct}from"./chunk-EK6GOLXU.js";import{b as dt,c as _t,d as N}from"./chunk-34GCBYYX.js";import{d as ht}from"./chunk-CCZ6XI6A.js";import{a as M}from"./chunk-J4RA3VLE.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-MGW7GK6C.js";import{a as E}from"./chunk-WFYQVCMU.js";import{a as g}from"./chunk-BOXFFUY5.js";import{e as v}from"./chunk-OVZZEY7C.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XQB6VLFK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XQB6VLFK.js deleted file mode 100644 index ff405ec..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XQB6VLFK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-LYEJWTAZ.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XTQGQGJD.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XTQGQGJD.js deleted file mode 100644 index 1352b2a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XTQGQGJD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-RALTHVRZ.js";import{a as U}from"./chunk-ND6FO376.js";import{f as I}from"./chunk-AVM7XNMU.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XX42UME3.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XX42UME3.js deleted file mode 100644 index ef4b65d..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XX42UME3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-DHCNOWTB.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-XZYWVF4L.js b/src/renderer/public/sdk/Cesium/Workers/chunk-XZYWVF4L.js deleted file mode 100644 index 198f40c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-XZYWVF4L.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-SGDQE7H4.js";import{d as l}from"./chunk-WHDDCNJ6.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Y4HURLGK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Y4HURLGK.js deleted file mode 100644 index 1ec7673..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Y4HURLGK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as C}from"./chunk-TDH4RANW.js";import{a as P}from"./chunk-KAEN44IR.js";import{a as O,b as L}from"./chunk-MGW7GK6C.js";import{a as y}from"./chunk-WFYQVCMU.js";import{e as S}from"./chunk-OVZZEY7C.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Y5C3MNEC.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Y5C3MNEC.js deleted file mode 100644 index 3f77ee7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Y5C3MNEC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-KOARSSWM.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-KZU6RORI.js";import{a as V,d as y}from"./chunk-4YKTCJME.js";import{b as G}from"./chunk-MKGFLCRO.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Y5MQ7Q4T.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Y5MQ7Q4T.js deleted file mode 100644 index a0afc87..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Y5MQ7Q4T.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-JHDCQEDT.js";import{a as u,b as d}from"./chunk-LO5P6EVV.js";import{a as j}from"./chunk-SFVU4I7K.js";import{a as _,b as h,g as A}from"./chunk-ENETEM2P.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Y7Y54VVF.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Y7Y54VVF.js deleted file mode 100644 index f62eaa4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Y7Y54VVF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as l,b as d}from"./chunk-H6HCBMP2.js";import{a as t}from"./chunk-MGW7GK6C.js";import{a as s}from"./chunk-WFYQVCMU.js";import{a as f,b as r}from"./chunk-BOXFFUY5.js";import{e as m}from"./chunk-OVZZEY7C.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-YE4R2EE7.js b/src/renderer/public/sdk/Cesium/Workers/chunk-YE4R2EE7.js deleted file mode 100644 index edf3f1e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-YE4R2EE7.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-255CHCZV.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-YREVEM5L.js b/src/renderer/public/sdk/Cesium/Workers/chunk-YREVEM5L.js deleted file mode 100644 index 7e13af7..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-YREVEM5L.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-XI6BGJK3.js";import{a as Z,b as H}from"./chunk-W465DA7H.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-KZM3XMI2.js";import{a as it}from"./chunk-JWULCKZP.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-WHOQYW75.js";import{f as K}from"./chunk-76AWMMRZ.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-YVBS4WYJ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-YVBS4WYJ.js deleted file mode 100644 index a578293..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-YVBS4WYJ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as J}from"./chunk-IHVDVYHC.js";import{a as I}from"./chunk-QQ2JU7XK.js";import{b as B,c as G,d as k}from"./chunk-4YKTCJME.js";import{b as j,h as X}from"./chunk-MKGFLCRO.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-MGW7GK6C.js";import{a as g}from"./chunk-WFYQVCMU.js";import{a as b,b as W}from"./chunk-BOXFFUY5.js";import{e as p}from"./chunk-OVZZEY7C.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-YWXO6FX2.js b/src/renderer/public/sdk/Cesium/Workers/chunk-YWXO6FX2.js deleted file mode 100644 index 79eef7e..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-YWXO6FX2.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{f as C}from"./chunk-76AWMMRZ.js";import{a as n,e as b}from"./chunk-MGW7GK6C.js";import{a as w}from"./chunk-WFYQVCMU.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Z3TSMW7F.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Z3TSMW7F.js deleted file mode 100644 index 795d459..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Z3TSMW7F.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-OOS6OUMR.js";import{a as At}from"./chunk-KH3E3M3A.js";import{a as yt}from"./chunk-KOARSSWM.js";import{a as $}from"./chunk-HNJRTQHB.js";import{a as v}from"./chunk-XJK3AZF6.js";import{a as st}from"./chunk-ST7VNABR.js";import{a as ht}from"./chunk-EK6GOLXU.js";import{b as ct,c as rt,d as F}from"./chunk-KZU6RORI.js";import{a as lt,d as it}from"./chunk-4YKTCJME.js";import{f as nt,h as bt}from"./chunk-MKGFLCRO.js";import{a as P}from"./chunk-J4RA3VLE.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as ot,b as k}from"./chunk-BOXFFUY5.js";import{e as Z}from"./chunk-OVZZEY7C.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Z3X57746.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Z3X57746.js deleted file mode 100644 index 5bbcdd4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Z3X57746.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as g,b as Me,c as be,d as qe,e as B,f as _e,g as ut}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as Se}from"./chunk-B3NSNNUV.js";import{a as A,b as a}from"./chunk-BOXFFUY5.js";import{a as Et,c as Tt,d as Ze,e as p}from"./chunk-OVZZEY7C.js";var In=Tt((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,s=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=s-u,k=Math.floor,L=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),ae=K(re,z).join(".");return Y+ae}function X(b){for(var z=[],D=0,Y=b.length,re,ae;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(ae=b.charCodeAt(D++),(ae&64512)==56320?z.push(((re&1023)<<10)+(ae&1023)+65536):(z.push(re),D--)):z.push(re);return z}function ne(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=L(z>>>10&1023|55296),z=56320|z&1023),D+=L(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:s}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=s)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,ae=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=s;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=s||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=s)je=s-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-ae&&W("overflow"),ae+=k(re/Y),re%=Y,z.splice(re++,0,ae)}return ne(z)}function y(b){var z,D,Y,re,ae,ee,fe,he,me,de,pe,V=[],ge,Te,je,ft;for(b=X(b),ge=b.length,z=E,D=0,ae=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(L(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=s;de=me<=ae?u:me>=ae+d?d:me-ae,!(he<de);me+=s)ft=he-de,je=s-de,V.push(L(c(de+ft%je,0))),he=k(ft/je);V.push(L(c(he,0))),ae=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:ne},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(t[Q]=i[Q]);else e.punycode=i})(et)});var Dn=Tt((qn,Ut)=>{/*! - * 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 Ut=="object"&&Ut.exports?Ut.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(qn,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),s=r.split(":"),u=s.length,d=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[u-1]===""&&s[u-2]===""&&s.pop(),u=s.length,s[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&s[m]!=="";m++);if(m<d)for(s.splice(m,1,"0000");s.length<d;)s.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=s[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);s[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?s[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):s[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&s.splice(T,M,""),u=s.length;var F="";for(s[0]===""&&(F=":"),w=0;w<u&&(F+=s[w],w!==u-1);w++)F+=":";return s[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var kn=Tt((Nn,zt)=>{/*! - * 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 zt=="object"&&zt.exports?zt.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Nn,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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var s=n.list[o.slice(i+1)];return s?s.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var s=n.list[o.slice(i+1)];return!s||s.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var We=Tt((Fn,It)=>{/*! - * 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 It=="object"&&It.exports?It.exports=t(In(),Dn(),kn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Fn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function s(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,L=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=L("pathname",F[k]),r[k+"UrnPathSegment"]=L("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=L("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var ae=Y+c.slice(Y).search(O),ee=c.slice(Y,ae),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){ae=Y+ee.length;var de=f(ee,Y,ae,c);if(de===void 0){y.lastIndex=ae;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(ae),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(s(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&n&&n.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,ne=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return ne.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){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(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}j.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new j(e,t,n,o)};j.fromColor=function(e,t){return a.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};j.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new j),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};j.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)j.pack(e[i],t,i*4);return t};j.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=j.unpack(e,o,t[i])}return t};j.fromArray=j.unpack;j.maximumComponent=function(e){return a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};j.maximumByComponent=function(e,t,n){return a.typeOf.object("first",e),a.typeOf.object("second",t),a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};j.clamp=function(e,t,n,o){a.typeOf.object("value",e),a.typeOf.object("min",t),a.typeOf.object("max",n),a.typeOf.object("result",o);let i=R.clamp(e.x,t.x,n.x),r=R.clamp(e.y,t.y,n.y),s=R.clamp(e.z,t.z,n.z),u=R.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=s,o.w=u,o};j.magnitudeSquared=function(e){return a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var Ct=new j;j.distance=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,Ct),j.magnitude(Ct)};j.distanceSquared=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),j.subtract(e,t,Ct),j.magnitudeSquared(Ct)};j.normalize=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t};j.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};j.multiplyComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};j.divideComponents=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};j.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};j.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};j.multiplyByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};j.divideByScalar=function(e,t,n){return a.typeOf.object("cartesian",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};j.negate=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};j.abs=function(e,t){return a.typeOf.object("cartesian",e),a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var vn=new j;j.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),j.multiplyByScalar(t,n,vn),o=j.multiplyByScalar(e,1-n,o),j.add(vn,o,o)};var ko=new j;j.mostOrthogonalAxis=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=j.normalize(e,ko);return j.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=j.clone(j.UNIT_X,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=j.clone(j.UNIT_Y,t):t=j.clone(j.UNIT_W,t):n.z<=n.w?t=j.clone(j.UNIT_Z,t):t=j.clone(j.UNIT_W,t),t};j.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};j.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]};j.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.x,t.x,n,o)&&R.equalsEpsilon(e.y,t.y,n,o)&&R.equalsEpsilon(e.z,t.z,n,o)&&R.equalsEpsilon(e.w,t.w,n,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,t,n){return j.equalsEpsilon(this,e,t,n)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var en=new Float32Array(1),ye=new Uint8Array(en.buffer),Fo=new Uint32Array([287454020]),xo=new Uint8Array(Fo.buffer),An=xo[0]===68;j.packFloat=function(e,t){return a.typeOf.number("value",e),p(t)||(t=new j),en[0]=e,An?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t};j.unpackFloat=function(e){return a.typeOf.object("packedFloat",e),An?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),en[0]};var De=j;function _(e,t,n,o,i,r,s,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=t??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=n??0,this[9]=s??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};_.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new _),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};_.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)_.pack(e[i],t,i*16);return t};_.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=_.unpack(e,o,t[i])}return t};_.clone=function(e,t){if(p(e))return p(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 _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,t){return a.defined("values",e),_.clone(e,t)};_.fromRowMajorArray=function(e,t){return a.defined("values",e),p(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 _(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])};_.fromRotationTranslation=function(e,t,n){return a.typeOf.object("rotation",e),t=t??g.ZERO,p(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 _(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)};_.fromTranslationQuaternionRotationScale=function(e,t,n,o){a.typeOf.object("translation",e),a.typeOf.object("rotation",t),a.typeOf.object("scale",n),p(o)||(o=new _);let i=n.x,r=n.y,s=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,E=t.y*t.z,T=t.y*t.w,M=t.z*t.z,v=t.z*t.w,I=t.w*t.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),L=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=L*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*s,o[9]=W*s,o[10]=X*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,t){return a.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};_.fromTranslation=function(e,t){return a.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,t)};_.fromScale=function(e,t){return a.typeOf.object("scale",e),p(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,t){return a.typeOf.object("rotation",e),p(t)||(t=new _),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 Je=new g,Ge=new g,pt=new g;_.fromCamera=function(e,t){a.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;a.typeOf.object("camera.position",n),a.typeOf.object("camera.direction",o),a.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pt),pt);let r=Ge.x,s=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pt.x,E=pt.y,T=pt.z,M=n.x,v=n.y,I=n.z,N=r*-M+s*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=s,t[5]=E,t[6]=-m,t[7]=0,t[8]=u,t[9]=T,t[10]=-l,t[11]=0,t[12]=N,t[13]=F,t[14]=k,t[15]=1,t):new _(r,s,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,t,n,o,i){a.typeOf.number.greaterThan("fovY",e,0),a.typeOf.number.lessThan("fovY",e,Math.PI),a.typeOf.number.greaterThan("near",n,0),a.typeOf.number.greaterThan("far",o,0),a.typeOf.object("result",i);let s=1/Math.tan(e*.5),u=s/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=m,s[11]=0,s[12]=l,s[13]=w,s[14]=E,s[15]=1,s};_.computePerspectiveOffCenter=function(e,t,n,o,i,r,s){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.number("far",r),a.typeOf.object("result",s);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=d,s[6]=0,s[7]=0,s[8]=m,s[9]=l,s[10]=w,s[11]=E,s[12]=0,s[13]=0,s[14]=T,s[15]=0,s};_.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){a.typeOf.number("left",e),a.typeOf.number("right",t),a.typeOf.number("bottom",n),a.typeOf.number("top",o),a.typeOf.number("near",i),a.typeOf.object("result",r);let s=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,E=-2*i;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,s=e.width??0,u=e.height??0;t=t??0,n=n??1;let d=s*.5,m=u*.5,l=(n-t)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=t+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,t,n,o,i){return a.typeOf.object("position",e),a.typeOf.object("direction",t),a.typeOf.object("up",n),a.typeOf.object("right",o),a.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(n,e),i[14]=g.dot(t,e),i[15]=1,i};_.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};_.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,3),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};_.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],s=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=s,n.w=u,n};_.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};_.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],s=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=s,n};_.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,3),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=_.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};_.setTranslation=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lo=new g;_.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Lo),i=t.x/o.x,r=t.y/o.y,s=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 Bo=new g;_.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=_.getScale(e,Bo),i=t/o.x,r=t/o.y,s=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,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 tn=new g;_.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=g.magnitude(g.fromElements(e[0],e[1],e[2],tn)),t.y=g.magnitude(g.fromElements(e[4],e[5],e[6],tn)),t.z=g.magnitude(g.fromElements(e[8],e[9],e[10],tn)),t};var jn=new g;_.getMaximumScale=function(e){return _.getScale(e,jn),g.maximumComponent(jn)};var Qo=new g;_.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=_.getScale(e,Qo);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Wo=new g;_.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=_.getScale(e,Wo);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};_.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=t[0],L=t[1],Q=t[2],W=t[3],K=t[4],oe=t[5],X=t[6],ne=t[7],Z=t[8],c=t[9],f=t[10],h=t[11],y=t[12],O=t[13],C=t[14],b=t[15],z=o*k+u*L+w*Q+v*W,D=i*k+d*L+E*Q+I*W,Y=r*k+m*L+T*Q+N*W,re=s*k+l*L+M*Q+F*W,ae=o*K+u*oe+w*X+v*ne,ee=i*K+d*oe+E*X+I*ne,fe=r*K+m*oe+T*X+N*ne,he=s*K+l*oe+M*X+F*ne,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=s*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,ft=s*y+l*O+M*C+F*b;return n[0]=z,n[1]=D,n[2]=Y,n[3]=re,n[4]=ae,n[5]=ee,n[6]=fe,n[7]=he,n[8]=me,n[9]=de,n[10]=pe,n[11]=V,n[12]=ge,n[13]=Te,n[14]=je,n[15]=ft,n};_.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};_.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};_.multiplyTransformation=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=t[0],I=t[1],N=t[2],F=t[4],k=t[5],L=t[6],Q=t[8],W=t[9],K=t[10],oe=t[12],X=t[13],ne=t[14],Z=o*v+s*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+s*k+m*L,y=i*F+u*k+l*L,O=r*F+d*k+w*L,C=o*Q+s*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+s*X+m*ne+E,Y=i*oe+u*X+l*ne+T,re=r*oe+d*X+w*ne+M;return n[0]=Z,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=O,n[7]=0,n[8]=C,n[9]=b,n[10]=z,n[11]=0,n[12]=D,n[13]=Y,n[14]=re,n[15]=1,n};_.multiplyByMatrix3=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("rotation",t),a.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],s=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=t[0],T=t[1],M=t[2],v=t[3],I=t[4],N=t[5],F=t[6],k=t[7],L=t[8],Q=o*E+s*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+s*I+m*N,X=i*v+u*I+l*N,ne=r*v+d*I+w*N,Z=o*F+s*k+m*L,c=i*F+u*k+l*L,f=r*F+d*k+w*L;return n[0]=Q,n[1]=W,n[2]=K,n[3]=0,n[4]=oe,n[5]=X,n[6]=ne,n[7]=0,n[8]=Z,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByTranslation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("translation",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*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]=u,n[14]=d,n[15]=e[15],n};_.multiplyByScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?_.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*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)};_.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};_.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*s,d=e[1]*o+e[5]*i+e[9]*r+e[13]*s,m=e[2]*o+e[6]*i+e[10]*r+e[14]*s,l=e[3]*o+e[7]*i+e[11]*r+e[15]*s;return n.x=u,n.y=d,n.z=m,n.w=l,n};_.multiplyByPointAsVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=s,n.y=u,n.z=d,n};_.multiplyByPoint=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,s=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=s,n.y=u,n.z=d,n};_.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};_.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};_.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],s=e[7],u=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]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=s,t[14]=u,t[15]=e[15],t};_.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};_.equals=function(e,t){return e===t||p(e)&&p(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]};_.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};_.getTranslation=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};_.getMatrix3=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Ho=new B,$o=new B,Yo=new De,Vo=new De(0,0,0,1);_.inverse=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],s=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,L=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,ne=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+L*d+K*m),y=k*s+oe*d+Z*m-(F*s+X*d+ne*m),O=L*s+X*u+c*m-(Q*s+oe*u+f*m),C=K*s+ne*u+f*d-(W*s+Z*u+c*d),b=k*o+L*i+K*r-(F*o+Q*i+W*r),z=F*n+X*i+ne*r-(k*n+oe*i+Z*r),D=Q*n+oe*o+f*r-(L*n+X*o+c*r),Y=W*n+Z*o+c*i-(K*n+ne*o+f*i);F=i*m,k=r*d,L=o*m,Q=r*u,W=o*d,K=i*u,oe=n*m,X=r*s,ne=n*d,Z=i*s,c=n*u,f=o*s;let re=F*v+Q*I+W*N-(k*v+L*I+K*N),ae=k*M+oe*I+Z*N-(F*M+X*I+ne*N),ee=L*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+ne*v+f*I-(W*M+Z*v+c*I),he=L*E+K*T+k*w-(W*T+F*w+Q*E),me=ne*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+L*l+X*w),pe=c*E+W*l+Z*w-(ne*w+f*E+K*l),V=n*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Ho),$o,R.EPSILON7)&&De.equals(_.getRow(e,3,Yo),Vo))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 Se("matrix is not invertible because its determinate is zero.")}return V=1/V,t[0]=h*V,t[1]=y*V,t[2]=O*V,t[3]=C*V,t[4]=b*V,t[5]=z*V,t[6]=D*V,t[7]=Y*V,t[8]=re*V,t[9]=ae*V,t[10]=ee*V,t[11]=fe*V,t[12]=he*V,t[13]=me*V,t[14]=de*V,t[15]=pe*V,t};_.inverseTransformation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],s=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-n*w-o*E-i*T,v=-r*w-s*E-u*T,I=-d*w-m*E-l*T;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=s,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=M,t[13]=v,t[14]=I,t[15]=1,t};var Xo=new _;_.inverseTranspose=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),_.inverse(_.transpose(e,Xo),t)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.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]};_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)};_.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 J=_;function Mn(e,t,n){n=n??!1;let o={},i=p(e),r=p(t),s,u,d;if(i)for(s in e)e.hasOwnProperty(s)&&(u=e[s],r&&n&&typeof u=="object"&&t.hasOwnProperty(s)?(d=t[s],typeof d=="object"?o[s]=Mn(u,d,n):o[s]=u):o[s]=u);if(r)for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(d=t[s],o[s]=d);return o}var Pe=Mn;function Zo(e,t,n){a.defined("array",e),a.defined("itemToFind",t),a.defined("comparator",n);let o=0,i=e.length-1,r,s;for(;o<=i;){if(r=~~((o+i)/2),s=n(e[r],t),s<0){o=r+1;continue}if(s>0){i=r-1;continue}return r}return~(i+1)}var Qe=Zo;function Jo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var ht=Jo;function Go(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dt=Go;var Pn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ko(e,t,n,o,i,r,s,u){e=e??1,t=t??1,n=n??1,o=o??0,i=i??0,r=r??0,s=s??0,u=u??!1,v(),I(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=s,this.isLeapSecond=u;function v(){a.typeOf.number.greaterThanOrEquals("Year",e,1),a.typeOf.number.lessThanOrEquals("Year",e,9999),a.typeOf.number.greaterThanOrEquals("Month",t,1),a.typeOf.number.lessThanOrEquals("Month",t,12),a.typeOf.number.greaterThanOrEquals("Day",n,1),a.typeOf.number.lessThanOrEquals("Day",n,31),a.typeOf.number.greaterThanOrEquals("Hour",o,0),a.typeOf.number.lessThanOrEquals("Hour",o,23),a.typeOf.number.greaterThanOrEquals("Minute",i,0),a.typeOf.number.lessThanOrEquals("Minute",i,59),a.typeOf.bool("IsLeapSecond",u),a.typeOf.number.greaterThanOrEquals("Second",r,0),a.typeOf.number.lessThanOrEquals("Second",r,u?60:59),a.typeOf.number.greaterThanOrEquals("Millisecond",s,0),a.typeOf.number.lessThan("Millisecond",s,1e3)}function I(){let N=t===2&&dt(e)?Pn[t-1]+1:Pn[t-1];if(n>N)throw new A("Month and Day represents invalid date")}}var vt=Ko;function er(e,t){this.julianDate=e,this.offset=t}var te=er;var tr={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},ie=Object.freeze(tr);var nr={UTC:0,TAI:1},H=Object.freeze(nr);var zn=new vt,At=[31,28,31,30,31,30,31,31,30,31,30,31],jt=29;function nn(e,t){return U.compare(e.julianDate,t.julianDate)}var Ke=new te;function Pt(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&U.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),U.addSeconds(e,o,e)}function Un(e,t){Ke.julianDate=e;let n=U.leapSeconds,o=Qe(n,Ke,nn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-n[0].offset,t);if(o>=n.length)return U.addSeconds(e,-n[o-1].offset,t);let i=U.secondsDifference(n[o].julianDate,e);if(i===0)return U.addSeconds(e,-n[o].offset,t);if(!(i<=1))return U.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ie.SECONDS_PER_DAY|0;return e+=o,t-=ie.SECONDS_PER_DAY*o,t<0&&(e--,t+=ie.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function on(e,t,n,o,i,r,s){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+s*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var or=/^(\d{4})$/,rr=/^(\d{4})-(\d{2})$/,ir=/^(\d{4})-?(\d{3})$/,cr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,sr=/^(\d{4})-?(\d{2})-?(\d{2})$/,rn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,ar=/^(\d{2})(\.\d+)?/.source+rn.source,fr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,ur=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+rn.source,Re="Invalid ISO 8601 date.";function U(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??H.UTC;let o=e|0;t=t+(e-o)*ie.SECONDS_PER_DAY,Ne(o,t,this),n===H.UTC&&Pt(this)}U.fromGregorianDate=function(e,t){if(!(e instanceof vt))throw new A("date must be a valid GregorianDate.");let n=on(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),Pt(t),t):new U(n[0],n[1],H.UTC)};U.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let n=on(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),Pt(t),t):new U(n[0],n[1],H.UTC)};U.fromIso8601=function(e,t){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,s=0,u=0,d=0,m=0,l=n[0],w=n[1],E,T;if(!p(l))throw new A(Re);let M;if(n=l.match(sr),n!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(rr),n!==null)o=+n[1],i=+n[2];else if(n=l.match(or),n!==null)o=+n[1];else{let F;if(n=l.match(ir),n!==null){if(o=+n[1],F=+n[2],T=dt(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(n=l.match(cr),n!==null){o=+n[1];let k=+n[2],L=+n[3]||0;if(M=l.split("-").length-1,M>0&&(!p(n[3])&&M!==1||p(n[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+L-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dt(o),i<1||i>12||r<1||(i!==2||!T)&&r>At[i-1]||T&&i===2&&r>jt)throw new A(Re);let v;if(p(w)){if(n=w.match(ur),n!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);s=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,v=5}else if(n=w.match(fr),n!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);s=+n[1],u=+n[2],d=+(n[3]||0)*60,v=4}else if(n=w.match(ar),n!==null)s=+n[1],u=+(n[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||s>24||s===24&&(u>0||d>0||m>0))throw new A(Re);let F=n[v],k=+n[v+1],L=+(n[v+2]||0);switch(F){case"+":s=s-k,u=u-L;break;case"-":s=s+k,u=u+L;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,s,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,s++;for(;s>=24;)s-=24,r++;for(E=T&&i===2?jt:At[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?jt:At[i-1];for(;u<0;)u+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?jt:At[i-1],r+=E;let N=on(o,i,r,s,u,d,m);return p(t)?(Ne(N[0],N[1],t),Pt(t)):t=new U(N[0],N[1],H.UTC),I&&U.addSeconds(t,1,t),t};U.now=function(e){return U.fromDate(new Date,e)};var Mt=new U(0,0,H.TAI);U.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=!1,o=Un(e,Mt);p(o)||(U.addSeconds(e,-1,Mt),o=Un(Mt,Mt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let s=i+68569|0,u=4*s/146097|0;s=s-((146097*u+3)/4|0)|0;let d=4e3*(s+1)/1461001|0;s=s-(1461*d/4|0)+31|0;let m=80*s/2447|0,l=s-(2447*m/80|0)|0;s=m/11|0;let w=m+2-12*s|0,E=100*(u-49)+d+s|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(I+=1),p(t)?(t.year=E,t.month=w,t.day=l,t.hour=T,t.minute=v,t.second=I,t.millisecond=N,t.isLeapSecond=n,t):new vt(E,w,l,T,v,I,N,n)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,zn),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))};U.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,zn),o=n.year,i=n.month,r=n.day,s=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&s===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,s=24);let l;if(!p(t)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};U.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};U.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(t)&&Math.abs(U.secondsDifference(e,t))<=n};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};U.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ie.SECONDS_PER_DAY;return n+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=U.leapSeconds,n=Qe(t,Ke,nn);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};U.addSeconds=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(n))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};U.addMinutes=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};U.addHours=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(n))throw new A("result is required.");let o=e.secondsOfDay+t*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};U.addDays=function(e,t,n){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(n))throw new A("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};U.lessThan=function(e,t){return U.compare(e,t)<0};U.lessThanOrEquals=function(e,t){return U.compare(e,t)<=0};U.greaterThan=function(e,t){return U.compare(e,t)>0};U.greaterThanOrEquals=function(e,t){return U.compare(e,t)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,t){return U.equalsEpsilon(this,e,t)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new te(new U(2441317,43210,H.TAI),10),new te(new U(2441499,43211,H.TAI),11),new te(new U(2441683,43212,H.TAI),12),new te(new U(2442048,43213,H.TAI),13),new te(new U(2442413,43214,H.TAI),14),new te(new U(2442778,43215,H.TAI),15),new te(new U(2443144,43216,H.TAI),16),new te(new U(2443509,43217,H.TAI),17),new te(new U(2443874,43218,H.TAI),18),new te(new U(2444239,43219,H.TAI),19),new te(new U(2444786,43220,H.TAI),20),new te(new U(2445151,43221,H.TAI),21),new te(new U(2445516,43222,H.TAI),22),new te(new U(2446247,43223,H.TAI),23),new te(new U(2447161,43224,H.TAI),24),new te(new U(2447892,43225,H.TAI),25),new te(new U(2448257,43226,H.TAI),26),new te(new U(2448804,43227,H.TAI),27),new te(new U(2449169,43228,H.TAI),28),new te(new U(2449534,43229,H.TAI),29),new te(new U(2450083,43230,H.TAI),30),new te(new U(2450630,43231,H.TAI),31),new te(new U(2451179,43232,H.TAI),32),new te(new U(2453736,43233,H.TAI),33),new te(new U(2454832,43234,H.TAI),34),new te(new U(2456109,43235,H.TAI),35),new te(new U(2457204,43236,H.TAI),36),new te(new U(2457754,43237,H.TAI),37)];var ue=U;var po=Ze(We(),1);function pr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var xn=pr;function Ln(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=Ln(i,t)),n[o]=i}return n}var nt=Ln;function hr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var ke=hr;var Bn=Ze(We(),1);function cn(e,t){let n;return typeof document<"u"&&(n=document),cn._implementation(e,t,n)}cn._implementation=function(e,t,n){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let o=new Bn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var mt=cn;var Qn=Ze(We(),1);function dr(e,t){if(!p(e))throw new A("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Qn.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var Wn=dr;var Hn=Ze(We(),1);function mr(e){if(!p(e))throw new A("uri is required.");let t=new Hn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var $n=mr;var Yn={};function yr(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Yn[t];p(o)||(o={},Yn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var sn=yr;var lr=/^blob:/i;function wr(e){return a.typeOf.string("uri",e),lr.test(e)}var qt=wr;var Ce;function br(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Vn=br;var Or=/^data:/i;function gr(e){return a.typeOf.string("uri",e),Or.test(e)}var Dt=gr;function _r(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var Xn=_r;function Sr(e){if(!p(e))throw new A("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,s=o.length;r<s;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Zn=Sr;function Rr(e){if(!p(e))throw new A("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),s=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[s];typeof d=="string"?t[s]=[d,u]:Array.isArray(d)?d.push(u):t[s]=u}return t}var Jn=Rr;var Er={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ce=Object.freeze(Er);var Tr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Gn=Object.freeze(Tr);function Nt(e){e=e??_e.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??Gn.OTHER,this.serverKey=e.serverKey,this.state=ce.UNISSUED,this.deferred=void 0,this.cancelled=!1}Nt.prototype.cancel=function(){this.cancelled=!0};Nt.prototype.clone=function(e){return p(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=ce.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Nt(this)};var Kn=Nt;function Cr(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let s=i.substring(0,r),u=i.substring(r+2);t[s]=u}}return t}var eo=Cr;function to(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eo(this.responseHeaders))}to.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yt=to;var kt=Ze(We(),1);function lt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(lt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});lt.prototype.addEventListener=function(e,t){a.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};lt.prototype.removeEventListener=function(e,t){a.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function vr(e,t){return t-e}lt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(vr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var no=lt;function He(e){a.typeOf.object("options",e),a.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function an(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let s=2*(e+1),u=s-1;u<t&&n(o[u],o[e])<0?i=u:i=e,s<t&&n(o[s],o[i])<0&&(i=s),i!==e?(an(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){a.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let s=Math.floor((i-1)/2);if(n(t[i],t[s])<0)an(t,i,s),i=s;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;a.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return an(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var oo=He;function Ar(e,t){return e.priority-t.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,le=new oo({comparator:Ar});le.maximumLength=ot;le.reserve(ot);var ve=[],Ue={},jr=typeof document<"u"?new kt.default(document.location.href):new kt.default,Ft=new no;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=Ft;Object.defineProperties(se,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;le.length>e;){let t=le.pop();$e(t)}ot=e,le.maximumLength=e,le.reserve(e)}}});function ro(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=t??1;let n=se.requestsByServer[e]??se.maximumRequestsPerServer;return Ue[e]+t<=n};se.heapHasOpenSlots=function(e){return le.length+e<=ot};function io(e){return e.state===ce.UNISSUED&&(e.state=ce.ISSUED,e.deferred=ke()),e.deferred.promise}function Mr(e){return function(t){if(e.state===ce.CANCELLED)return;let n=e.deferred;--G.numberOfActiveRequests,--Ue[e.serverKey],Ft.raiseEvent(),e.state=ce.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Pr(e){return function(t){e.state!==ce.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Ue[e.serverKey],Ft.raiseEvent(t),e.state=ce.FAILED,e.deferred.reject(t))}}function co(e){let t=io(e);return e.state=ce.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Ue[e.serverKey],e.requestFunction().then(Mr(e)).catch(Pr(e)),t}function $e(e){let t=e.state===ce.ACTIVE;if(e.state=ce.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--G.numberOfActiveRequests,--Ue[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==ce.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)ro(i[e]);le.resort();let s=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<s&&le.length>0;){if(t=le.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}co(t),++u}Ur()};se.getServerKey=function(e){a.typeOf.string("url",e);let t=new kt.default(e);t.scheme()===""&&(t=t.absoluteTo(jr),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Ue[n];return p(o)||(Ue[n]=0),n};se.request=function(e){if(a.typeOf.object("request",e),a.typeOf.string("request.url",e.url),a.typeOf.func("request.requestFunction",e.requestFunction),Dt(e.url)||qt(e.url))return Ft.raiseEvent(),e.state=ce.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return co(e);if(ve.length>=se.maximumRequests)return;ro(e);let t=le.insert(e);if(p(t)){if(t===e)return;$e(t)}return io(e)};function Ur(){se.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}se.clearForSpecs=function(){for(;le.length>0;){let t=le.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Ue={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Ue[e]};se.requestHeap=le;var wt=se;var so=Ze(We(),1);var bt={},rt={};bt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};bt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function zr(e){let t=new so.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 o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}bt.contains=function(e){if(!p(e))throw new A("url is required.");let t=zr(e);return!!(p(t)&&p(rt[t]))};bt.clear=function(){rt={}};var fn=bt;var Ir="mapDatabase",it="mapStore",Ot,xt=window.indexedDB.open(Ir,1),qr=1024*1024*1024;var Es=qr*3;xt.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(it)||t.createObjectStore(it,{keyPath:"url"})};xt.onsuccess=function(e){Ot=e.target.result};xt.onerror=function(e){console.error("IndexedDB open error:",e.target.error)};function ao(e,t){if(!Ot)return;let o=Ot.transaction([it],"readwrite").objectStore(it),i={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);i.content=s,i.type="xml"}o.add(i)}function fo(e){return new Promise(async(t,n)=>{if(!Ot)n();else{let r=Ot.transaction([it],"readonly").objectStore(it).get(e);r.onsuccess=function(s){let u=s.target.result;u?t(u):n()},xt.onerror=s=>{n()}}})}var ho=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),a.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Kn,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 Ae(e,t){return p(e)?nt(e):t}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var ct;P.supportsImageBitmapOptions=function(){return p(ct)?ct:typeof createImageBitmap!="function"?(ct=Promise.resolve(!1),ct):(ct=P.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=sn(t[0]),o=sn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),ct)};Object.defineProperties(P,{isBlobSupported:{get:function(){return ho}}});Object.defineProperties(P.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 $n(this._url)}},isDataUri:{get:function(){return Dt(this._url)}},isBlobUri:{get:function(){return qt(this._url)}},isCrossOriginUrl:{get:function(){return Vn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,t,n,o){let i=new po.default(e),r=Dr(i.query());this._queryParameters=t?Bt(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mt(o))),this._url=i.toString()};function Dr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jn(e)}function Bt(e,t,n){if(!n)return Pe(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],s=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(s)):o[i]=Array.isArray(s)?s.slice():s}return o}P.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Nr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let s=o[r];return p(s)?encodeURIComponent(s):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Nr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Zn(e)}`}P.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Bt(this._queryParameters,e,!1):this._queryParameters=Bt(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Bt(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pe(this._templateValues,e):this._templateValues=Pe(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=Pe(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=Pe(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=Pe(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};P.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(o){return++n._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return Wn(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=xn(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(Qt(this.request),!ho||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return un({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let s,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return s=l,u=s&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),un({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function un(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=ke();return P._Implementations.createImage(r,u,d,n,o,i),d.promise};let s=wt.request(r);if(p(s))return s.catch(function(u){return r.state!==ce.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=ce.UNISSUED,r.deferred=void 0,un({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",Qt(this.request);let t;do t=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return mo(this,e,t)};function mo(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=ke();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},P._Implementations.loadAndExecuteScript(r,n,u),u.promise};let s=wt.request(i);if(p(s))return s.catch(function(u){return i.state!==ce.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ce.UNISSUED,i.deferred=void 0,mo(e,t,n)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest2=function(e){let t=this;Qt(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(o,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};P.prototype._makeRequest=function(e){let t=this,n=t.request;if(n.url=t.url,Cesium.ManageIndexedDB.GetManageIndexexDBState())return fo(n.url).then(i=>{let r=i.content;return i.type==="xml"&&(r=new DOMParser().parseFromString(i.content,"application/xml")),r}).catch(i=>o());return o();function o(){Qt(t.request),n.requestFunction=function(){let r=e.responseType,s=Pe(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=ke(),w=P._Implementations.loadWithXhr(t.url,r,d,m,s,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=wt.request(n);if(p(i))return i.then(function(r){return Cesium.ManageIndexedDB.GetManageIndexexDBState()&&ao(n.url,r),n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ce.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ce.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function Qt(e){if(e.state===ce.ISSUED||e.state===ce.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ce.UNISSUED,e.deferred=void 0}var kr=/^data:(.*?)(;base64)?,(.*)$/;function Lt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function uo(e,t){let n=Lt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function Fr(e,t){t=t??"";let n=e[1],o=!!e[2],i=e[3],r,s;switch(t){case"":case"text":return Lt(o,i);case"arraybuffer":return uo(o,i);case"blob":return r=uo(o,i),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lt(o,i),n);case"json":return JSON.parse(Lt(o,i));default:throw new A(`Unhandled responseType: ${t}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,t){return a.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(fn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,t,n,o,i,r){let s=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(s,t,n);return}let d="blob",m="GET",l=ke(),w=P._Implementations.loadWithXhr(s,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){n.reject(new Se(`Successfully retrieved ${s} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){n.resolve(E)})}).catch(function(u){n.reject(u)})};P.createImageBitmapFromBlob=function(e,t){return a.defined("options",t),a.typeOf.bool("options.flipY",t.flipY),a.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),a.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function xr(e,t,n,o,i,r,s){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yt)})}var Lr=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,t,n,o,i,r,s){let u=kr.exec(e);if(u!==null){r.resolve(Fr(u,t));return}if(Lr){xr(e,t,n,o,i,r,s);return}let d=new XMLHttpRequest;if(fn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(s)&&p(d.overrideMimeType)&&d.overrideMimeType(s),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yt)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,t,n){return Xn(e,t).catch(function(o){n.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Fe=P;function _t(e){e=e??_e.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,p(e.data)?yo(this,e.data):yo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_t.fromUrl=async function(e,t){a.defined("url",e),t=t??_e.EMPTY_OBJECT;let n=Fe.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new _t({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};_t.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ht(0,0,0,0,0),t}});_t.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new ht(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,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,wo(this,n,this._samples,e,i,r,t),t}let s=Qe(n,e,ue.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,i=s,r=s):(r=~s,i=r-1,i<0&&(i=0)),this._lastIndex=i,wo(this,n,this._samples,e,i,r,t),t};function Br(e,t){return ue.compare(e.julianDate,t)}function yo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||s<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+n],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,L=Qe(k,F,Br);if(L<0){let Q=new te(F,I);k.splice(~L,0,Q)}}w=I}}}function lo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function gt(e,t,n){return t+e*(n-t)}function wo(e,t,n,o,i,r,s){let u=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 d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return lo(e,n,i,u,s),s;if(o.equals(m))return lo(e,n,r,u,s),s;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=n[w+e._ut1MinusUtcSecondsColumn],M=n[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=n[w+e._taiMinusUtcSecondsColumn],N=n[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return s.xPoleWander=gt(l,n[w+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),s.yPoleWander=gt(l,n[w+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),s.xPoleOffset=gt(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=gt(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=gt(l,T,M),s}var bo=_t;function we(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}we.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new we);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=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(i,o),t.pitch=-R.asinClamped(n),t};we.fromDegrees=function(e,t,n,o){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(n))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=t*R.RADIANS_PER_DEGREE,o.roll=n*R.RADIANS_PER_DEGREE,o};we.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};we.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&R.equalsEpsilon(e.heading,t.heading,n,o)&&R.equalsEpsilon(e.pitch,t.pitch,n,o)&&R.equalsEpsilon(e.roll,t.roll,n,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,t,n){return we.equalsEpsilon(this,e,t,n)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Wt=we;var Oo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Qr(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=Oo.exec(o);if(i!==null)return i[1]}}var Ht;function go(e){return typeof document>"u"?e:(p(Ht)||(Ht=document.createElement("a")),Ht.href=e,Ht.href)}var Ye;function _o(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Et.toUrl)?e=mt("..",Ve("Core/buildModuleUrl.js")):e=Qr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new Fe({url:go(e)}),Ye.appendForwardSlash(),Ye}function Wr(e){return go(Et.toUrl(`../${e}`))}function So(e){return _o().getDerivedResource({url:e}).url}var $t;function Ve(e){return p($t)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Et.toUrl)?$t=Wr:$t=So),$t(e)}Ve._cesiumScriptRegex=Oo;Ve._buildModuleUrlFromBaseUrl=So;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=Fe.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=_o;var Ro=Ve;function Hr(e,t,n){this.x=e,this.y=t,this.s=n}var Yt=Hr;function dn(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=Fe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.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),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[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 $r=new ue(0,0,H.TAI);function pn(e,t,n){let o=$r;return o.dayNumber=t,o.secondsOfDay=n,ue.daysDifference(o,e._sampleZeroDateTT)}dn.prototype.preload=function(e,t,n,o){let i=pn(this,e,t),r=pn(this,n,o),s=i/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=s/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(hn(this,w));return Promise.all(l)};dn.prototype.computeXysRadians=function(e,t,n){let o=pn(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,s=i-(r/2|0);s<0&&(s=0);let u=s+r;u>=this._totalSamples&&(u=this._totalSamples-1,s=u-r,s<0&&(s=0));let d=!1,m=this._samples;if(p(m[s*3])||(hn(this,s/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(hn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Yt(0,0,0);let l=o-s*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(s+v)*3;n.x+=T[v]*m[N++],n.y+=T[v]*m[N++],n.s+=T[v]*m[N]}return n};function hn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new Fe({url:Ro(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)s[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Eo=dn;function S(e,t,n,o){this.x=e??0,this.y=t??0,this.z=n??0,this.w=o??0}var St=new g;S.fromAxisAngle=function(e,t,n){a.typeOf.object("axis",e),a.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);St=g.normalize(e,St);let r=St.x*i,s=St.y*i,u=St.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=s,n.z=u,n.w=d,n):new S(r,s,u,d)};var Yr=[1,2,0],Vr=new Array(3);S.fromRotationMatrix=function(e,t){a.typeOf.object("matrix",e);let n,o,i,r,s,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),s=.5*n,n=.5/n,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*n,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*n,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*n;else{let w=Yr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];n=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=Vr;v[E]=.5*n,n=.5/n,s=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*n,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*n,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*n,o=-v[0],i=-v[1],r=-v[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=s,t):new S(o,i,r,s)};var To=new S,Co=new S,mn=new S,vo=new S;S.fromHeadingPitchRoll=function(e,t){return a.typeOf.object("headingPitchRoll",e),vo=S.fromAxisAngle(g.UNIT_X,e.roll,To),mn=S.fromAxisAngle(g.UNIT_Y,-e.pitch,t),t=S.multiply(mn,vo,mn),Co=S.fromAxisAngle(g.UNIT_Z,-e.heading,To),S.multiply(Co,t,t)};var Vt=new g,yn=new g,Ee=new S,Ao=new S,Xt=new S;S.packedLength=4;S.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};S.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new S),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,t,n,o){S.unpack(e,n*4,Xt),S.conjugate(Xt,Xt);for(let i=0,r=n-t+1;i<r;i++){let s=i*3;S.unpack(e,(t+i)*4,Ee),S.multiply(Ee,Xt,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Vt);let u=S.computeAngle(Ee);p(o)||(o=[]),o[s]=Vt.x*u,o[s+1]=Vt.y*u,o[s+2]=Vt.z*u}};S.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new S),g.fromArray(e,0,yn);let r=g.magnitude(yn);return S.unpack(t,o*4,Ao),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(yn,r,Ee),S.multiply(Ee,Ao,i)};S.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};S.magnitudeSquared=function(e){return a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,t){a.typeOf.object("result",t);let n=1/S.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,s=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=s,t};S.inverse=function(e,t){a.typeOf.object("result",t);let n=S.magnitudeSquared(e);return t=S.conjugate(e,t),S.multiplyByScalar(t,1/n,t)};S.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};S.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};S.negate=function(e,t){return a.typeOf.object("quaternion",e),a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};S.dot=function(e,t){return a.typeOf.object("left",e),a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};S.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,s=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=s*u+o*l+i*m-r*d,E=s*d-o*m+i*l+r*u,T=s*m+o*d-i*u+r*l,M=s*l-o*u-i*d-r*m;return n.x=w,n.y=E,n.z=T,n.w=M,n};S.multiplyByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};S.divideByScalar=function(e,t,n){return a.typeOf.object("quaternion",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};S.computeAxis=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<R.EPSILON6||Math.abs(n+1)<R.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};S.computeAngle=function(e){return a.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var ln=new S;S.lerp=function(e,t,n,o){return a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o),ln=S.multiplyByScalar(t,n,ln),o=S.multiplyByScalar(e,1-n,o),S.add(ln,o,o)};var jo=new S,wn=new S,bn=new S;S.slerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r=t;if(i<0&&(i=-i,r=jo=S.negate(t,jo)),1-i<R.EPSILON6)return S.lerp(e,r,n,o);let s=Math.acos(i);return wn=S.multiplyByScalar(e,Math.sin((1-n)*s),wn),bn=S.multiplyByScalar(r,Math.sin(n*s),bn),o=S.add(wn,bn,o),S.multiplyByScalar(o,1/Math.sin(s),o)};S.log=function(e,t){a.typeOf.object("quaternion",e),a.typeOf.object("result",t);let n=R.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),g.multiplyByScalar(e,o,t)};S.exp=function(e,t){a.typeOf.object("cartesian",e),a.typeOf.object("result",t);let n=g.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Xr=new g,Zr=new g,Rt=new S,st=new S;S.computeInnerQuadrangle=function(e,t,n,o){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("q2",n),a.typeOf.object("result",o);let i=S.conjugate(t,Rt);S.multiply(i,n,st);let r=S.log(st,Xr);S.multiply(i,e,st);let s=S.log(st,Zr);return g.add(r,s,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,Rt),S.multiply(t,Rt,o)};S.squad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.slerp(e,t,i,Rt),u=S.slerp(n,o,i,st);return S.slerp(s,u,2*i*(1-i),r)};var Jr=new S,Mo=1.9011074535173003,Zt=ut.supportsTypedArrays()?new Float32Array(8):[],Jt=ut.supportsTypedArrays()?new Float32Array(8):[],ze=ut.supportsTypedArrays()?new Float32Array(8):[],Ie=ut.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Zt[e]=1/(t*n),Jt[e]=t/n}Zt[7]=Mo/(8*17);Jt[7]=Mo*8/17;S.fastSlerp=function(e,t,n,o){a.typeOf.object("start",e),a.typeOf.object("end",t),a.typeOf.number("t",n),a.typeOf.object("result",o);let i=S.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let s=i-1,u=1-n,d=n*n,m=u*u;for(let T=7;T>=0;--T)ze[T]=(Zt[T]*d-Jt[T])*s,Ie[T]=(Zt[T]*m-Jt[T])*s;let l=r*n*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),w=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),E=S.multiplyByScalar(e,w,Jr);return S.multiplyByScalar(t,l,o),S.add(E,o,o)};S.fastSquad=function(e,t,n,o,i,r){a.typeOf.object("q0",e),a.typeOf.object("q1",t),a.typeOf.object("s0",n),a.typeOf.object("s1",o),a.typeOf.number("t",i),a.typeOf.object("result",r);let s=S.fastSlerp(e,t,i,Rt),u=S.fastSlerp(n,o,i,st);return S.fastSlerp(s,u,2*i*(1-i),r)};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};S.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},On={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"}},at={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},gn={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},xe=new g,Le=new g,Be=new g;$.localFrameToFixedFrameGenerator=function(e,t){if(!On.hasOwnProperty(e)||!On[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=On[e][t],o,i=e+t;return p(gn[i])?o=gn[i]:(o=function(r,s,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(at[e],0,xe),g.unpack(at[t],0,Le),g.unpack(at[n],0,Be);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(at[e],0,xe),e!=="east"&&e!=="west"&&g.multiplyByScalar(xe,d,xe),g.unpack(at[t],0,Le),t!=="east"&&t!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(at[n],0,Be),n!=="east"&&n!=="west"&&g.multiplyByScalar(Be,d,Be)}else{s=s??qe.default,s.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),xe=Oe[e],Le=Oe[t],Be=Oe[n]}return u[0]=xe.x,u[1]=xe.y,u[2]=xe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=Be.x,u[9]=Be.y,u[10]=Be.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},gn[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Gr=new Xe,Kr=new g(1,1,1),ei=new J;$.headingPitchRollToFixedFrame=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(t,Gr),s=J.fromTranslationQuaternionRotationScale(g.ZERO,r,Kr,ei);return i=o(e,n,i),J.multiply(i,s,i)};var ti=new J,ni=new B;$.headingPitchRollQuaternion=function(e,t,n,o,i){a.typeOf.object("HeadingPitchRoll",t);let r=$.headingPitchRollToFixedFrame(e,t,n,o,ti),s=J.getMatrix3(r,ni);return Xe.fromRotationMatrix(s,i)};var oi=new g(1,1,1),ri=new g,Po=new J,ii=new J,ci=new B,si=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,t,n,o){a.defined("transform",e),t=t??qe.default,n=n??$.eastNorthUpToFixedFrame,p(o)||(o=new Wt);let i=J.getTranslation(e,ri);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(n(i,t,Po),Po),s=J.setScale(e,oi,ii);s=J.setTranslation(s,g.ZERO,s),r=J.multiply(r,s,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,ci),si);return u=Xe.normalize(u,u),Wt.fromQuaternion(u,o)};var ai=6*3600+41*60+50.54841,fi=8640184812866e-6,ui=.093104,pi=-62e-7,hi=11772758384668e-32,di=72921158553e-15,mi=R.TWO_PI/86400,Gt=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=$.computeIcrfToFixedMatrix(e,t);return p(n)||(n=$.computeTemeToPseudoFixedMatrix(e,t)),n};$.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");Gt=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Gt);let n=Gt.dayNumber,o=Gt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ai+i*(fi+i*(ui+i*pi)))*mi%R.TWO_PI,d=di+hi*(n-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(t)?(t[0]=w,t[1]=-E,t[2]=0,t[3]=E,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Eo;$.earthOrientationParameters=bo.NONE;var Rn=32.184,yi=2451545;$.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Rn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+Rn;return $.iau2006XysData.preload(t,n,o,i)};$.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var li=32.184,wi=2451545,Kt=new Wt,bi=new B,Oi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=ue.addSeconds(e,li,Oi),o=ue.totalDays(n)-wi,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,s=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Kt.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(s)-R.toRadians(.017)*Math.sin(u),Kt.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(s)+R.toRadians(.007)*Math.cos(u),Kt.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(s)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Kt,bi)};$.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return B.transpose(n,t)};var gi=new Yt(0,0,0),_i=new ht(0,0,0,0,0,0),_n=new B,Sn=new B;$.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new B);let n=$.earthOrientationParameters.compute(e,_i);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+Rn,r=$.iau2006XysData.computeXysRadians(o,i,gi);if(!p(r))return;let s=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-s*s-u*u)),m=_n;m[0]=1-d*s*s,m[3]=-d*s*u,m[6]=s,m[1]=-d*s*u,m[4]=1-d*u*u,m[7]=u,m[2]=-s,m[5]=-u,m[8]=1-d*(s*s+u*u);let l=B.fromRotationZ(-r.s,Sn),w=B.multiply(m,l,_n),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+n.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Sn),F=B.multiply(w,N,_n),k=Math.cos(n.xPoleWander),L=Math.cos(n.yPoleWander),Q=Math.sin(n.xPoleWander),W=Math.sin(n.yPoleWander),K=o-yi+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),ne=Math.sin(oe),Z=Sn;return Z[0]=k*X,Z[1]=k*ne,Z[2]=Q,Z[3]=-L*ne+W*Q*X,Z[4]=L*X+W*Q*ne,Z[5]=-W*k,Z[6]=-W*ne-L*Q*X,Z[7]=W*X-L*Q*ne,Z[8]=L*k,B.multiply(F,Z,t)};var Si=new De;$.pointToWindowCoordinates=function(e,t,n,o){return o=$.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(n))throw new A("point is required.");p(o)||(o=new be);let i=Si;return J.multiplyByVector(e,De.fromElements(n.x,n.y,n.z,1,i),i),De.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(t,i,i),be.fromCartesian4(i,o)};var Ri=new g,Ei=new g,Ti=new g;$.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let i=(n??qe.default).geodeticSurfaceNormal(e,Ri),r=g.cross(t,i,Ei);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let s=g.cross(r,t,Ti);return g.normalize(s,s),g.cross(t,s,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=s.x,o[7]=s.y,o[8]=s.z,o};var Uo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),zo=new Me,En=new g,Ci=new g,vi=new B,Tn=new J,Io=new J;$.basisTo2D=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(n))throw new A("result is required.");let o=J.getTranslation(t,Ci),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,En);else{let l=i.cartesianToCartographic(o,zo);r=e.project(l,En),g.fromElements(r.z,r.x,r.y,r)}let s=$.eastNorthUpToFixedFrame(o,i,Tn),u=J.inverseTransformation(s,Io),d=J.getMatrix3(t,vi),m=J.multiplyByMatrix3(u,d,n);return J.multiply(Uo,m,n),J.setTranslation(n,r,n),n};$.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(n))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(t,o,Tn),r=J.inverseTransformation(i,Io),s=o.cartesianToCartographic(t,zo),u=e.project(s,En);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,Tn);return J.multiply(Uo,r,n),J.multiply(d,n,n),n};var qo=$;function x(e,t,n,o){this.west=e??0,this.south=t??0,this.east=n??0,this.north=o??0}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){a.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=R.TWO_PI),t-n};x.computeHeight=function(e){return a.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=R.toRadians(e??0),t=R.toRadians(t??0),n=R.toRadians(n??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=e??0,i.south=t??0,i.east=n??0,i.north=o??0,i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){a.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),s=Math.min(s,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>R.PI&&(o=o-R.TWO_PI),n>R.PI&&(n=n-R.TWO_PI)),p(t)?(t.west=n,t.south=s,t.east=o,t.north=u,t):new x(n,s,o,u)};x.fromCartesianArray=function(e,t,n){a.defined("cartesians",e),t=t??qe.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),s=Math.max(s,E)}return i-o>s-r&&(o=r,i=s,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var Ai=new g,ji=new g,Mi=new g,Pi=new g,Ui=new g,Cn=new Array(5);for(let e=0;e<Cn.length;++e)Cn[e]=new g;x.fromBoundingSphere=function(e,t,n){a.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=qe.default),p(n)||(n=new x),g.equals(o,g.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=qo.eastNorthUpToFixedFrame(o,t,Ai),s=J.multiplyByPointAsVector(r,g.UNIT_X,ji);g.normalize(s,s);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Mi);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(s,i,s);let d=g.negate(u,Ui),m=g.negate(s,Pi),l=Cn,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,s,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){a.typeOf.object("rectangle",e);let t=e.north;a.typeOf.number.greaterThanOrEquals("north",t,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("north",t,R.PI_OVER_TWO);let n=e.south;a.typeOf.number.greaterThanOrEquals("south",n,-R.PI_OVER_TWO),a.typeOf.number.lessThanOrEquals("south",n,R.PI_OVER_TWO);let o=e.west;a.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),a.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;a.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),a.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return a.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){a.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=R.TWO_PI);let i=R.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,s)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(i>=s||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=s,n):new x(o,i,r,s)};x.union=function(e,t,n){a.typeOf.object("rectangle",e),a.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,s=t.west;o<i&&r>0?o+=R.TWO_PI:r<s&&o>0&&(r+=R.TWO_PI),o<i&&s<0?s+=R.TWO_PI:r<s&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,s)),d=R.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t),p(n)||(n=new x),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};x.contains=function(e,t){a.typeOf.object("rectangle",e),a.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,n<0&&(n+=R.TWO_PI)),(n>i||R.equalsEpsilon(n,i,R.EPSILON14))&&(n<r||R.equalsEpsilon(n,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var zi=new Me;x.subsample=function(e,t,n,o){a.typeOf.object("rectangle",e),t=t??qe.default,n=n??0,p(o)||(o=[]);let i=0,r=e.north,s=e.south,u=e.east,d=e.west,m=zi;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=s,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:s>0?m.latitude=s:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(a.typeOf.object("rectangle",e),a.typeOf.number.greaterThanOrEquals("westLerp",t,0),a.typeOf.number.lessThanOrEquals("westLerp",t,1),a.typeOf.number.greaterThanOrEquals("southLerp",n,0),a.typeOf.number.lessThanOrEquals("southLerp",n,1),a.typeOf.number.greaterThanOrEquals("eastLerp",o,0),a.typeOf.number.lessThanOrEquals("eastLerp",o,1),a.typeOf.number.greaterThanOrEquals("northLerp",i,0),a.typeOf.number.lessThanOrEquals("northLerp",i,1),a.typeOf.number.lessThanOrEquals("westLerp",t,o),a.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+t*u),r.east=R.negativePiToPi(e.west+o*u)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+i*s,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var hf=x;function q(e,t,n,o){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,t,n){return a.typeOf.object("value",e),a.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};q.unpack=function(e,t,n){return a.defined("array",e),t=t??0,p(n)||(n=new q),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};q.packArray=function(e,t){a.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)q.pack(e[i],t,i*4);return t};q.unpackArray=function(e,t){if(a.defined("array",e),a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=q.unpack(e,o,t[i])}return t};q.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,t){return a.defined("values",e),q.clone(e,t)};q.fromRowMajorArray=function(e,t){return a.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,t){return a.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,t){return a.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new q(e,0,0,e)};q.fromRotation=function(e,t){a.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new q(n,-o,o,n)};q.toArray=function(e,t){return a.typeOf.object("matrix",e),p(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]]};q.getElementIndex=function(e,t){return a.typeOf.number.greaterThanOrEquals("row",t,0),a.typeOf.number.lessThanOrEquals("row",t,1),a.typeOf.number.greaterThanOrEquals("column",e,0),a.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};q.getColumn=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};q.setColumn=function(e,t,n,o){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};q.getRow=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};q.setRow=function(e,t,n,o){return a.typeOf.object("matrix",e),a.typeOf.number.greaterThanOrEquals("index",t,0),a.typeOf.number.lessThanOrEquals("index",t,1),a.typeOf.object("cartesian",n),a.typeOf.object("result",o),o=q.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var Ii=new be;q.setScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,Ii),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var qi=new be;q.setUniformScale=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n);let o=q.getScale(e,qi),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Do=new be;q.getScale=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t.x=be.magnitude(be.fromElements(e[0],e[1],Do)),t.y=be.magnitude(be.fromElements(e[2],e[3],Do)),t};var No=new be;q.getMaximumScale=function(e){return q.getScale(e,No),be.maximumComponent(No)};var Di=new be;q.setRotation=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("result",n);let o=q.getScale(e,Di);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Ni=new be;q.getRotation=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=q.getScale(e,Ni);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};q.multiply=function(e,t,n){a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=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]=o,n[1]=r,n[2]=i,n[3]=s,n};q.add=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};q.subtract=function(e,t,n){return a.typeOf.object("left",e),a.typeOf.object("right",t),a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};q.multiplyByVector=function(e,t,n){a.typeOf.object("matrix",e),a.typeOf.object("cartesian",t),a.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};q.multiplyByScalar=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scalar",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.multiplyByScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.object("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};q.multiplyByUniformScale=function(e,t,n){return a.typeOf.object("matrix",e),a.typeOf.number("scale",t),a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};q.negate=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};q.transpose=function(e,t){a.typeOf.object("matrix",e),a.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};q.abs=function(e,t){return a.typeOf.object("matrix",e),a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};q.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};q.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]};q.equalsEpsilon=function(e,t,n){return n=n??0,e===t||p(e)&&p(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};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var bf=q;export{De as a,J as b,Pe as c,Fe as d,Ro as e,Xe as f,qo as g,hf as h,bf as i}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-Z7GBEB6Q.js b/src/renderer/public/sdk/Cesium/Workers/chunk-Z7GBEB6Q.js deleted file mode 100644 index 90a9a2a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-Z7GBEB6Q.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as b}from"./chunk-HNJRTQHB.js";import{a as u}from"./chunk-XJK3AZF6.js";import{a as O}from"./chunk-EK6GOLXU.js";import{b as w,c as h,d as y}from"./chunk-WHOQYW75.js";import{d as l}from"./chunk-3R7YZYAU.js";import{a as p}from"./chunk-J4RA3VLE.js";import{a as i,f as A}from"./chunk-MGW7GK6C.js";import{a as d,b as c}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZA6CVU2J.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZA6CVU2J.js deleted file mode 100644 index c6291c0..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZA6CVU2J.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as Z,h as A}from"./chunk-IU3JXFWW.js";import{a as n,b as v,d as N,e as _}from"./chunk-MGW7GK6C.js";import{a as on}from"./chunk-WFYQVCMU.js";import{a as en,b as h}from"./chunk-BOXFFUY5.js";import{e as x}from"./chunk-OVZZEY7C.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZAVL4QMT.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZAVL4QMT.js deleted file mode 100644 index 19d8d95..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZAVL4QMT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as R}from"./chunk-4KTYBIT7.js";import{a as ct}from"./chunk-RD5EBYQO.js";import{a as Z,b as H}from"./chunk-4LRCCZKQ.js";import{a as V}from"./chunk-KAEN44IR.js";import{a as U}from"./chunk-Q3VOOFSE.js";import{b as ot}from"./chunk-N4QQ5FWX.js";import{a as it}from"./chunk-HZEX5MXO.js";import{a as nt}from"./chunk-ST7VNABR.js";import{a as et}from"./chunk-EK6GOLXU.js";import{b as J,c as X,d as z}from"./chunk-NNNSDBCQ.js";import{f as K}from"./chunk-NPMNTDSM.js";import{a as k}from"./chunk-J4RA3VLE.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-MGW7GK6C.js";import{a as I}from"./chunk-WFYQVCMU.js";import{e as x}from"./chunk-OVZZEY7C.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZAYZJA3R.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZAYZJA3R.js deleted file mode 100644 index e81b2e4..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZAYZJA3R.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-A4L3VMPJ.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-MGW7GK6C.js";import{a as u}from"./chunk-5IUKPU5Q.js";import{a as I,b as w}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZB37QSBP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZB37QSBP.js deleted file mode 100644 index a531af9..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZB37QSBP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as tt}from"./chunk-RT7ONYAF.js";import{a as jt}from"./chunk-F4ANYJ4I.js";import{b as Lt}from"./chunk-O5YU7IER.js";import{a as Et}from"./chunk-6Q5ALWJL.js";import{a as j}from"./chunk-ST7VNABR.js";import{a as dt,b as D,c as B,d as U}from"./chunk-NXRSA4OE.js";import{a as _t,b as Ut,d as ot}from"./chunk-YE4R2EE7.js";import{a as pt,b as H}from"./chunk-255CHCZV.js";import{a as F}from"./chunk-J4RA3VLE.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-MGW7GK6C.js";import{a as N}from"./chunk-WFYQVCMU.js";import{a as I,b as ft}from"./chunk-BOXFFUY5.js";import{e as f}from"./chunk-OVZZEY7C.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZFFA2UHH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZFFA2UHH.js deleted file mode 100644 index fa8e673..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZFFA2UHH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as P}from"./chunk-FJBT3N33.js";import{a as u,b as d}from"./chunk-NBE2CPYA.js";import{a as j}from"./chunk-TMD5QYHK.js";import{a as _,b as h,g as A}from"./chunk-Z3X57746.js";import{a as e,c as l,d as g}from"./chunk-MGW7GK6C.js";import{a as y,b as p}from"./chunk-BOXFFUY5.js";import{e as r}from"./chunk-OVZZEY7C.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZGP6ZNQR.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZGP6ZNQR.js deleted file mode 100644 index c781b08..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZGP6ZNQR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as G}from"./chunk-2SHIVLQV.js";import{a as z}from"./chunk-Q3VOOFSE.js";import{b as B}from"./chunk-BWWXWBXF.js";import{a as C}from"./chunk-XCMSHRLY.js";import{b as L}from"./chunk-FXKWBJNE.js";import{a,b as D,d as I}from"./chunk-MGW7GK6C.js";import{a as S}from"./chunk-WFYQVCMU.js";import{a as x}from"./chunk-BOXFFUY5.js";import{e as T}from"./chunk-OVZZEY7C.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZLGB7AC5.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZLGB7AC5.js deleted file mode 100644 index 854f23c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZLGB7AC5.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{c as Z}from"./chunk-4YKTCJME.js";import{a as o,b as at,e as b}from"./chunk-MGW7GK6C.js";import{a as R}from"./chunk-WFYQVCMU.js";import{a as w,b as tt}from"./chunk-BOXFFUY5.js";import{e as g}from"./chunk-OVZZEY7C.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZPGEP2LZ.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZPGEP2LZ.js deleted file mode 100644 index b42ba5a..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZPGEP2LZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as N}from"./chunk-XJK3AZF6.js";import{a as Q}from"./chunk-4STI2OZJ.js";import{a as ae}from"./chunk-EK6GOLXU.js";import{b as oe,c as re,d as J}from"./chunk-2VGJ4QVX.js";import{b as E,d as ie}from"./chunk-DUJ2U2S3.js";import{a as C,b as F,f as D}from"./chunk-A3K2ZLIM.js";import{a as H}from"./chunk-J4RA3VLE.js";import{a as r,e as G,f as A}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{a as w,b}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&(t&p)===0)continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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 $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,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}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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 $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZRZRQLXP.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZRZRQLXP.js deleted file mode 100644 index 7fd72fc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZRZRQLXP.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as h}from"./chunk-27YZQBV6.js";import{a as n,c as y,e as a}from"./chunk-MGW7GK6C.js";import{b as f}from"./chunk-BOXFFUY5.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZSXVKIGK.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZSXVKIGK.js deleted file mode 100644 index 0106bbd..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZSXVKIGK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-A3K2ZLIM.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZTMTVESE.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZTMTVESE.js deleted file mode 100644 index 9d86c71..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZTMTVESE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{b as r}from"./chunk-255CHCZV.js";import{f as m}from"./chunk-MGW7GK6C.js";import{a as i}from"./chunk-BOXFFUY5.js";import{e as t}from"./chunk-OVZZEY7C.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZVFDWZLG.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZVFDWZLG.js deleted file mode 100644 index 9f8a9dc..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZVFDWZLG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as U}from"./chunk-POLUDXGV.js";import{a as b}from"./chunk-USXGVOKU.js";import{a as E}from"./chunk-ST7VNABR.js";import{a as z}from"./chunk-EK6GOLXU.js";import{c as B,d as D}from"./chunk-BBGWUPII.js";import{a as V,d as y}from"./chunk-HUYVXCIF.js";import{b as G}from"./chunk-OL26GLX5.js";import{a as k}from"./chunk-J4RA3VLE.js";import{d as F}from"./chunk-MGW7GK6C.js";import{a as M,b as I}from"./chunk-BOXFFUY5.js";import{e as a}from"./chunk-OVZZEY7C.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZWQBJUQ6.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZWQBJUQ6.js deleted file mode 100644 index 41a558c..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZWQBJUQ6.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-Q3VOOFSE.js";import{b as xt,c as at,d as et}from"./chunk-34GCBYYX.js";import{a as tt}from"./chunk-J4RA3VLE.js";import{a,b as Y,c as g,d as gt}from"./chunk-MGW7GK6C.js";import{a as X}from"./chunk-WFYQVCMU.js";import{a as ft}from"./chunk-5IUKPU5Q.js";import{b as A}from"./chunk-BOXFFUY5.js";import{e as F}from"./chunk-OVZZEY7C.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZXPHRBXH.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZXPHRBXH.js deleted file mode 100644 index 5325689..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZXPHRBXH.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _}from"./chunk-G5KXXUYH.js";import{a as te}from"./chunk-QJHUWGM2.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-NPMNTDSM.js";import{a as e,b as se,c as ee,e as O}from"./chunk-MGW7GK6C.js";import{a as Q}from"./chunk-WFYQVCMU.js";import{a as le}from"./chunk-BOXFFUY5.js";import{e as $}from"./chunk-OVZZEY7C.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/src/renderer/public/sdk/Cesium/Workers/chunk-ZYYOUO3B.js b/src/renderer/public/sdk/Cesium/Workers/chunk-ZYYOUO3B.js deleted file mode 100644 index 9753398..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/chunk-ZYYOUO3B.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as z,c as q}from"./chunk-W7YKUALL.js";import{a as U}from"./chunk-KYP7OKF3.js";import{f as I}from"./chunk-A3K2ZLIM.js";import{a as e,e as C}from"./chunk-MGW7GK6C.js";import{a as O}from"./chunk-WFYQVCMU.js";import{e as j}from"./chunk-OVZZEY7C.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/src/renderer/public/sdk/Cesium/Workers/decodeI3S.js b/src/renderer/public/sdk/Cesium/Workers/decodeI3S.js deleted file mode 100644 index 90fc484..0000000 --- a/src/renderer/public/sdk/Cesium/Workers/decodeI3S.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as mt}from"./chunk-H5XNRALF.js";import{a as P}from"./chunk-U7QFGE5P.js";import{a as ht}from"./chunk-3WQQGQIW.js";import{a as ft}from"./chunk-POLUDXGV.js";import{a as g,b as ot,d as st,e as it}from"./chunk-MGW7GK6C.js";import{a as M}from"./chunk-WFYQVCMU.js";import{b as lt}from"./chunk-BOXFFUY5.js";import{d as pt,e as h}from"./chunk-OVZZEY7C.js";var at=pt(mt(),1);function xt(n){return lt.defined("value",n),n<=.04045?n*.07739938080495357:Math.pow((n+.055)*.9478672985781991,2.4)}var k=xt;var ut;function wt(n,t,e,o,a,i){let r=e*(1-n)+o*n,s=a*(1-n)+i*n;return r*(1-t)+s*t}function H(n,t,e,o){let a=n+t*e;return o[a]}function It(n,t,e){let o=e.nativeExtent,a=(n-o.west)/(o.east-o.west)*(e.width-1),i=(t-o.south)/(o.north-o.south)*(e.height-1),r=Math.floor(a),s=Math.floor(i);a-=r,i-=s;let c=r<e.width?r+1:r,u=s<e.height?s+1:s;s=e.height-1-s,u=e.height-1-u;let l=H(r,s,e.width,e.buffer),f=H(c,s,e.width,e.buffer),p=H(r,u,e.width,e.buffer),m=H(c,u,e.width,e.buffer),d=wt(a,i,l,f,p,m);return d=d*e.scale+e.offset,d}function yt(n,t,e){for(let o=0;o<e.length;o++){let a=e[o].nativeExtent,i=new g;if(e[o].projectionType==="WebMercator"){let r=e[o].projection._ellipsoid._radii;i=new ft(new st(r.x,r.y,r.z)).project(new ot(n,t,0))}else i.x=n,i.y=t;if(i.x>a.west&&i.x<a.east&&i.y>a.south&&i.y<a.north)return It(i.x,i.y,e[o])}return 0}function At(n,t,e,o,a,i,r){if(r)return;let s=yt(a.longitude,a.latitude,i);for(let c=0;c<n;++c){let u=yt(a.longitude+M.toRadians(e*t[c*3]),a.latitude+M.toRadians(o*t[c*3+1]),i);t[c*3+2]+=u-s}}function Lt(n,t,e,o,a,i,r,s,c){if(n===0||!h(t)||t.length===0)return;let u=new st(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z));for(let l=0;l<n;++l){let f=l*3,p=f+1,m=f+2,d=new ot;d.longitude=o.longitude+M.toRadians(s*t[f]),d.latitude=o.latitude+M.toRadians(c*t[p]),d.height=o.height+t[m];let b={};u.cartographicToCartesian(d,b),b.x-=a.x,b.y-=a.y,b.z-=a.z;let x={};if(it.multiplyByVector(i,b,x),t[f]=x.x,t[p]=x.y,t[m]=x.z,h(e)){let T=new g(e[f],e[p],e[m]),I={};it.multiplyByVector(i,T,I),e[f]=I.x,e[p]=I.y,e[m]=I.z}}}function Ot(n,t,e){for(let o=0;o<n;++o){let a=e[o*4]/65535,i=e[o*4+1]/65535,r=(e[o*4+2]-e[o*4])/65535,s=(e[o*4+3]-e[o*4+1])/65535;t[o*2]*=r,t[o*2]+=a,t[o*2+1]*=s,t[o*2+1]+=i}}function Tt(n,t,e,o){let a=new Uint32Array(n),i=h(t)?s=>t[s]:s=>s,r=0;if(o&&h(e)){let s=c=>e[i(c)*4+3]<255;for(let c=0;c<n;c+=3)!s(c)&&!s(c+1)&&!s(c+2)&&(a[r++]=i(c),a[r++]=i(c+1),a[r++]=i(c+2));if(r>0){let c=r;for(let u=0;u<n;u+=3)(s(u)||s(u+1)||s(u+2))&&(a[c++]=i(u),a[c++]=i(u+1),a[c++]=i(u+2))}else for(let c=0;c<n;++c)a[c]=i(c)}else{r=n;for(let s=0;s<n;++s)a[s]=i(s)}return{indexArray:a,transparentVertexOffset:r}}function Ct(n,t,e){let o=t[e];if(h(o))return o;let a=t[e]={positions:{},indices:{},edges:{}},i=n[e]??n.default;return a.hasOutline=h(i?.edges),a}function Ft(n,t,e,o){if(!h(n[e])){let a=e*3,i=t;for(let r=0;r<3;r++){let s=o[a+r];h(i[s])||(i[s]={}),i=i[s]}h(i.index)||(i.index=e),n[e]=i.index}}function Ut(n,t,e,o,a,i){let r,s;o<a?(r=o,s=a):(r=a,s=o);let c=n[r];h(c)||(c=n[r]={});let u=c[s];h(u)||(u=c[s]={normalsIndex:[],outlines:[]}),u.normalsIndex.push(i),(u.outlines.length===0||t!==o||e!==a)&&u.outlines.push(t,e)}function Vt(n,t,e,o){let a=[];for(let i=0;i<e.length;i+=3){let r=h(t)?t[e[i]]:"default",s=Ct(n,a,r);if(!s.hasOutline)continue;let c=s.indices,u=s.positions;for(let f=0;f<3;f++){let p=e[i+f];Ft(c,u,p,o)}let l=s.edges;for(let f=0;f<3;f++){let p=e[i+f],m=e[i+(f+1)%3],d=c[p],b=c[m];Ut(l,p,m,d,b,i)}}return a}var O=new g,X=new g,Y=new g;function bt(n,t,e,o){let a=e[t]*3,i=e[t+1]*3,r=e[t+2]*3;g.fromArray(o,a,O),g.fromArray(o,i,X),g.fromArray(o,r,Y),g.subtract(X,O,X),g.subtract(Y,O,Y),g.cross(X,Y,O);let s=g.magnitude(O);s!==0&&g.divideByScalar(O,s,O);let c=t*3,u=(t+1)*3,l=(t+2)*3;g.pack(O,n,c),g.pack(O,n,u),g.pack(O,n,l)}var z=new g,ct=new g;function Et(n,t,e){g.fromArray(n,t,z),g.fromArray(n,e,ct);let o=g.dot(z,ct),a=g.magnitude(g.cross(z,ct,z));return Math.atan2(a,o)<.25}function _t(n,t,e,o,a){if(t.normalsIndex.length>1){let i=o.length===a.length;for(let r=0;r<t.normalsIndex.length;r++){let s=t.normalsIndex[r];if(h(a[s*3])||bt(a,s,e,o),r!==0)for(let c=0;c<r;c++){let u=t.normalsIndex[c],l=i?e[s]*3:s*3,f=i?e[u]*3:u*3;if(Et(a,l,f))return}}}n.push(...t.outlines)}function Rt(n,t,e,o,a){let i=Object.keys(t);for(let r=0;r<i.length;r++){let s=t[i[r]],c=Object.keys(s);for(let u=0;u<c.length;u++){let l=s[c[u]];_t(n,l,e,o,a)}}}function Nt(n,t,e,o){let a=[],i=Object.keys(n);for(let r=0;r<i.length;r++){let s=n[i[r]].edges;Rt(a,s,t,e,o)}return a}function Bt(n,t,e,o,a){if(!h(n)||Object.keys(n).length===0)return;let i=Vt(n,t,e,o);(!h(a)||e.length*3!==a.length)&&(a=[]);let r=Nt(i,e,o,a);return r.length>0?new Uint32Array(r):void 0}function Gt(n){let t=new Float32Array(n.length);for(let e=0;e<n.length;e+=4)t[e]=k(P.byteToFloat(n[e])),t[e+1]=k(P.byteToFloat(n[e+1])),t[e+2]=k(P.byteToFloat(n[e+2])),t[e+3]=P.byteToFloat(n[e+3]);return t}function St(n,t,e,o,a,i,r){let s={normals:void 0,positions:void 0,uv0s:void 0,colors:void 0,featureIndex:void 0,vertexCount:void 0};if(n===0||!h(e)||e.length===0||h(o))return s;if(h(t)){s.vertexCount=t.length,s.positions=new Float32Array(t.length*3),s.uv0s=h(a)?new Float32Array(t.length*2):void 0,s.colors=h(i)?new Uint8Array(t.length*4):void 0,s.featureIndex=h(r)?new Array(t.length):void 0;for(let c=0;c<t.length;c++){let u=t[c];s.positions[c*3]=e[u*3],s.positions[c*3+1]=e[u*3+1],s.positions[c*3+2]=e[u*3+2],h(s.uv0s)&&(s.uv0s[c*2]=a[u*2],s.uv0s[c*2+1]=a[u*2+1]),h(s.colors)&&(s.colors[c*4]=i[u*4],s.colors[c*4+1]=i[u*4+1],s.colors[c*4+2]=i[u*4+2],s.colors[c*4+3]=i[u*4+3]),h(s.featureIndex)&&(s.featureIndex[c]=r[u])}n=t.length,e=s.positions}t=new Array(n);for(let c=0;c<n;c++)t[c]=c;s.normals=new Float32Array(t.length*3);for(let c=0;c<t.length;c+=3)bt(s.normals,c,t,e);return s}function vt(n,t,e,o,a,i,r,s){if(n===0||!h(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let c=[],u=[],l=[],f=[],p=[],m=[],d={},b=[];h(t)&&(n=t.length);let{indexArray:x,transparentVertexOffset:T}=Tt(n,t,i,s.splitGeometryByColorTransparency),I=new Blob([x],{type:"application/binary"}),A=URL.createObjectURL(I),w=n,F=s.enableFeatures&&h(r)?new Float32Array(r.length):void 0,C=0;if(h(F))for(let y=0;y<r.length;++y){F[y]=r[y];let E=r[y]+1;C<E&&(C=E)}let U,R=Bt(s.symbologyData,r,x,e,o);if(h(R)){let y=new Blob([R],{type:"application/binary"});U=URL.createObjectURL(y)}let L=e.subarray(0,w*3),gt=new Blob([L],{type:"application/binary"}),dt=URL.createObjectURL(gt),D=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY;for(let y=0;y<L.length/3;y++)D=Math.min(D,L[y*3+0]),K=Math.max(K,L[y*3+0]),Q=Math.min(Q,L[y*3+1]),Z=Math.max(Z,L[y*3+1]),J=Math.min(J,L[y*3+2]),$=Math.max($,L[y*3+2]);let N=o?o.subarray(0,w*3):void 0,q;if(h(N)){let y=new Blob([N],{type:"application/binary"});q=URL.createObjectURL(y)}let B=a?a.subarray(0,w*2):void 0,tt;if(h(B)){let y=new Blob([B],{type:"application/binary"});tt=URL.createObjectURL(y)}let G=h(i)?Gt(i.subarray(0,w*4)):void 0,et;if(h(G)){let y=new Blob([G],{type:"application/binary"});et=URL.createObjectURL(y)}let S=h(F)?F.subarray(0,w):void 0,nt;if(h(S)){let y=new Blob([S],{type:"application/binary"});nt=URL.createObjectURL(y)}let _=h(F)?new Float32Array(C):void 0,rt;if(h(_)){for(let E=0;E<_.length;++E)_[E]=E;let y=new Blob([_],{type:"application/binary"});rt=URL.createObjectURL(y)}let V={},j={};V.POSITION=l.length,c.push({uri:dt,byteLength:L.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:L.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:L.length/3,type:"VEC3",max:[D,Q,J],min:[K,Z,$]}),h(q)&&(V.NORMAL=l.length,c.push({uri:q,byteLength:N.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:N.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:N.length/3,type:"VEC3"})),h(tt)&&(V.TEXCOORD_0=l.length,c.push({uri:tt,byteLength:B.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:B.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:B.length/2,type:"VEC2"})),h(et)&&(V.COLOR_0=l.length,c.push({uri:et,byteLength:G.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:G.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:G.length/4,type:"VEC4"})),h(nt)&&(V._FEATURE_ID_0=l.length,c.push({uri:nt,byteLength:S.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:S.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:S.length,type:"SCALAR"}),j.EXT_mesh_features={featureIds:[{attribute:0,propertyTable:0,featureCount:C}]},b.push("EXT_mesh_features")),h(rt)&&(c.push({uri:rt,byteLength:_.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:_.byteLength,target:34963}),d.EXT_structural_metadata={schema:{id:"i3s-metadata-schema-001",name:"I3S metadata schema 001",description:"The schema for I3S metadata",version:"1.0",classes:{feature:{name:"feature",description:"Feature metadata",properties:{index:{description:"The feature index",type:"SCALAR",componentType:"FLOAT32",required:!0}}}}},propertyTables:[{name:"feature-indices-mapping",class:"feature",count:C,properties:{index:{values:u.length-1}}}]},b.push("EXT_structural_metadata")),h(U)&&(c.push({uri:U,byteLength:R.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:R.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:R.length,type:"SCALAR"}),j.CESIUM_primitive_outline={indices:l.length-1},b.push("CESIUM_primitive_outline")),c.push({uri:A,byteLength:x.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:x.byteLength,target:34963});let v=[];return T>0&&(l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j})),T<n&&(l.push({bufferView:u.length-1,byteOffset:4*T,componentType:5125,count:n-T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j,extra:{isTransparent:!0}})),f.push({primitives:v}),m.push(0),p.push({mesh:0}),{buffers:c,bufferViews:u,accessors:l,meshes:f,nodes:p,nodesInScene:m,rootExtensions:d,extensionsUsed:b}}function Mt(n,t,e,o){let a=new Uint8Array(n,0,5);return a[0]===68&&a[1]===82&&a[2]===65&&a[3]===67&&a[4]===79?Pt(n,e):kt(n,t,e,o)}function Pt(n){let t=ut,e=new t.DecoderBuffer,o=new Uint8Array(n);e.Init(o,o.length);let a=new t.Decoder,i=a.GetEncodedGeometryType(e),r=new t.MetadataQuerier,s,c;i===t.TRIANGULAR_MESH&&(s=new t.Mesh,c=a.DecodeBufferToMesh(e,s));let u={vertexCount:[0],featureCount:0};if(h(c)&&c.ok()&&s.ptr!==0){let l=s.num_faces(),f=s.num_attributes(),p=s.num_points();u.indices=new Uint32Array(l*3);let m=u.indices;u.vertexCount[0]=p,u.scale_x=1,u.scale_y=1;let d=new t.DracoInt32Array(3);for(let b=0;b<l;++b)a.GetFaceFromMesh(s,b,d),m[b*3]=d.GetValue(0),m[b*3+1]=d.GetValue(1),m[b*3+2]=d.GetValue(2);t.destroy(d);for(let b=0;b<f;++b){let x=a.GetAttribute(s,b),T=jt(t,a,s,x,p),I=x.attribute_type(),A="unknown";I===t.POSITION?A="positions":I===t.NORMAL?A="normals":I===t.COLOR?A="colors":I===t.TEX_COORD&&(A="uv0s");let w=a.GetAttributeMetadata(s,b);if(w.ptr!==0){let F=r.NumEntries(w);for(let C=0;C<F;++C){let U=r.GetEntryName(w,C);U==="i3s-scale_x"?u.scale_x=r.GetDoubleEntry(w,"i3s-scale_x"):U==="i3s-scale_y"?u.scale_y=r.GetDoubleEntry(w,"i3s-scale_y"):U==="i3s-attribute-type"&&(A=r.GetStringEntry(w,"i3s-attribute-type"))}}h(u[A])&&console.log("Attribute already exists",A),u[A]=T,A==="feature-index"&&u.featureCount++}t.destroy(s)}return t.destroy(r),t.destroy(a),u}function jt(n,t,e,o,a){let i=o.num_components()*a,r,c=[function(){},function(){r=new n.DracoInt8Array(i),t.GetAttributeInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeUInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeUInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){},function(){r=new n.DracoFloat32Array(i),t.GetAttributeFloatForAllPoints(e,o,r)||console.error("Bad stream");let l=new Float32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){r=new n.DracoUInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l}][o.data_type()]();return h(r)&&n.destroy(r),c}var W={position:function(n,t,e){let o=n.vertexCount*3;return n.positions=new Float32Array(t,e,o),e+=o*4,e},normal:function(n,t,e){let o=n.vertexCount*3;return n.normals=new Float32Array(t,e,o),e+=o*4,e},uv0:function(n,t,e){let o=n.vertexCount*2;return n.uv0s=new Float32Array(t,e,o),e+=o*4,e},color:function(n,t,e){let o=n.vertexCount*4;return n.colors=new Uint8Array(t,e,o),e+=o,e},featureId:function(n,t,e){let o=n.featureCount;return e+=o*8,e},id:function(n,t,e){let o=n.featureCount;return e+=o*8,e},faceRange:function(n,t,e){let o=n.featureCount*2;return n.faceRange=new Uint32Array(t,e,o),e+=o*4,e},uvRegion:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e},region:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e}};function kt(n,t,e,o){let a={vertexCount:0},i=new DataView(n);try{let r=0;if(a.vertexCount=i.getUint32(r,1),r+=4,a.featureCount=i.getUint32(r,1),r+=4,h(e))for(let s=0;s<e.attributes.length;s++)h(W[e.attributes[s]])?r=W[e.attributes[s]](a,n,r):console.error("Unknown decoder for",e.attributes[s]);else{let s=t.ordering,c=t.featureAttributeOrder;h(o)&&h(o.geometryData)&&h(o.geometryData[0])&&h(o.geometryData[0].params)&&(s=Object.keys(o.geometryData[0].params.vertexAttributes),c=Object.keys(o.geometryData[0].params.featureAttributes));for(let u=0;u<s.length;u++){let l=W[s[u]];r=l(a,n,r)}for(let u=0;u<c.length;u++){let l=W[c[u]];r=l(a,n,r)}}}catch(r){console.error(r)}return a.scale_x=1,a.scale_y=1,a}function Ht(n){let t=Mt(n.binaryData,n.schema,n.bufferInfo,n.featureData);h(n.geoidDataList)&&n.geoidDataList.length>0&&At(t.vertexCount,t.positions,t.scale_x,t.scale_y,n.cartographicCenter,n.geoidDataList,!1),Lt(t.vertexCount,t.positions,t.normals,n.cartographicCenter,n.cartesianCenter,n.parentRotation,n.ellipsoidRadiiSquare,t.scale_x,t.scale_y),h(t.uv0s)&&h(t["uv-region"])&&Ot(t.vertexCount,t.uv0s,t["uv-region"]);let e;if(h(t["feature-index"]))e=t["feature-index"];else if(h(t.faceRange)){e=new Array(t.vertexCount);for(let r=0;r<t.faceRange.length-1;r+=2){let s=r/2,c=t.faceRange[r],u=t.faceRange[r+1];for(let l=c;l<=u;l++)e[l*3]=s,e[l*3+1]=s,e[l*3+2]=s}}if(n.calculateNormals){let r=St(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e);h(r.normals)&&(t.normals=r.normals,h(r.vertexCount)&&(t.vertexCount=r.vertexCount,t.indices=r.indices,t.positions=r.positions,t.uv0s=r.uv0s,t.colors=r.colors,e=r.featureIndex))}let o=vt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e,n),a={positions:t.positions,indices:t.indices,featureIndex:e,sourceURL:n.url,cartesianCenter:n.cartesianCenter,parentRotation:n.parentRotation};return o._customAttributes=a,{meshData:o}}async function Xt(n,t){let e=n.webAssemblyConfig;return h(e)&&h(e.wasmBinaryFile)?ut=await(0,at.default)(e):ut=await(0,at.default)(),!0}function Yt(n,t){let e=n.webAssemblyConfig;return h(e)?Xt(n,t):Ht(n,t)}var re=ht(Yt);export{re as default}; diff --git a/src/renderer/public/sdk/Cesium/index.cjs b/src/renderer/public/sdk/Cesium/index.cjs deleted file mode 100644 index 8c95891..0000000 --- a/src/renderer/public/sdk/Cesium/index.cjs +++ /dev/null @@ -1,16851 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var KPe=Object.create;var zz=Object.defineProperty;var $Pe=Object.getOwnPropertyDescriptor;var ZPe=Object.getOwnPropertyNames;var QPe=Object.getPrototypeOf,JPe=Object.prototype.hasOwnProperty;var eDe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jte=(e,t)=>{for(var n in t)zz(e,n,{get:t[n],enumerable:!0})},ene=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ZPe(t))!JPe.call(e,o)&&o!==n&&zz(e,o,{get:()=>t[o],enumerable:!(i=$Pe(t,o))||i.enumerable});return e};var er=(e,t,n)=>(n=e!=null?KPe(QPe(e)):{},ene(t||!e||!e.__esModule?zz(n,"default",{value:e,enumerable:!0}):n,e)),eh=e=>ene(zz({},"__esModule",{value:!0}),e);var Vz=Zn((yBt,tne)=>{var Kp=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)};Kp.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}};Kp.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};Kp.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};Kp.prototype.random_int31=function(){return this.random_int()>>>1};Kp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Kp.prototype.random=function(){return this.random_int()*(1/4294967296)};Kp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Kp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};tne.exports=Kp});var vne=Zn((QA,JA)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof QA=="object"&&QA&&!QA.nodeType&&QA,n=typeof JA=="object"&&JA&&!JA.nodeType&&JA,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,_="-",m=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,C=Math.floor,A=String.fromCharCode,S;function w(k){throw new RangeError(x[k])}function R(k,z){for(var B=k.length,j=[];B--;)j[B]=z(k[B]);return j}function P(k,z){var B=k.split("@"),j="";B.length>1&&(j=B[0]+"@",k=B[1]),k=k.replace(b,".");var W=k.split("."),J=R(W,z).join(".");return j+J}function O(k){for(var z=[],B=0,j=k.length,W,J;B<j;)W=k.charCodeAt(B++),W>=55296&&W<=56319&&B<j?(J=k.charCodeAt(B++),(J&64512)==56320?z.push(((W&1023)<<10)+(J&1023)+65536):(z.push(W),B--)):z.push(W);return z}function L(k){return R(k,function(z){var B="";return z>65535&&(z-=65536,B+=A(z>>>10&1023|55296),z=56320|z&1023),B+=A(z),B}).join("")}function g(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function E(k,z){return k+22+75*(k<26)-((z!=0)<<5)}function v(k,z,B){var j=0;for(k=B?C(k/f):k>>1,k+=C(k/z);k>T*c>>1;j+=s)k=C(k/T);return C(j+(T+1)*k/(k+u))}function I(k){var z=[],B=k.length,j,W=0,J=p,Y=d,ee,Q,de,ge,le,ye,xe,Ie,Te;for(ee=k.lastIndexOf(_),ee<0&&(ee=0),Q=0;Q<ee;++Q)k.charCodeAt(Q)>=128&&w("not-basic"),z.push(k.charCodeAt(Q));for(de=ee>0?ee+1:0;de<B;){for(ge=W,le=1,ye=s;de>=B&&w("invalid-input"),xe=g(k.charCodeAt(de++)),(xe>=s||xe>C((r-W)/le))&&w("overflow"),W+=xe*le,Ie=ye<=Y?a:ye>=Y+c?c:ye-Y,!(xe<Ie);ye+=s)Te=s-Ie,le>C(r/Te)&&w("overflow"),le*=Te;j=z.length+1,Y=v(W-ge,j,ge==0),C(W/j)>r-J&&w("overflow"),J+=C(W/j),W%=j,z.splice(W++,0,J)}return L(z)}function N(k){var z,B,j,W,J,Y,ee,Q,de,ge,le,ye=[],xe,Ie,Te,ve;for(k=O(k),xe=k.length,z=p,B=0,J=d,Y=0;Y<xe;++Y)le=k[Y],le<128&&ye.push(A(le));for(j=W=ye.length,W&&ye.push(_);j<xe;){for(ee=r,Y=0;Y<xe;++Y)le=k[Y],le>=z&&le<ee&&(ee=le);for(Ie=j+1,ee-z>C((r-B)/Ie)&&w("overflow"),B+=(ee-z)*Ie,z=ee,Y=0;Y<xe;++Y)if(le=k[Y],le<z&&++B>r&&w("overflow"),le==z){for(Q=B,de=s;ge=de<=J?a:de>=J+c?c:de-J,!(Q<ge);de+=s)ve=Q-ge,Te=s-ge,ye.push(A(E(ge+ve%Te,0))),Q=C(ve/Te);ye.push(A(E(Q,0))),J=v(B,Ie,j==W),B=0,++j}++B,++z}return ye.join("")}function F(k){return P(k,function(z){return m.test(z)?I(z.slice(4).toLowerCase()):z})}function U(k){return P(k,function(z){return y.test(z)?"xn--"+N(z):z})}if(o={version:"1.3.2",ucs2:{decode:O,encode:L},decode:I,encode:N,toASCII:U,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(JA.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(QA)});var Ine=Zn((wne,aV)=>{/*! - * 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 aV=="object"&&aV.exports?aV.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(wne,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var _=-1,m=0,y=0,b=-1,x=!1;for(d=0;d<c;d++)x?s[d]==="0"?y+=1:(x=!1,y>m&&(_=b,m=y)):s[d]==="0"&&(x=!0,b=d,y=1);y>m&&(_=b,m=y),m>1&&s.splice(_,m,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d<a&&(T+=s[d],d!==a-1);d++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Dne=Zn((Pne,cV)=>{/*! - * 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 cV=="object"&&cV.exports?cV.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Pne,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 Ru=Zn((Rne,lV)=>{/*! - * 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 lV=="object"&&lV.exports?lV.exports=t(vne(),Ine(),Dne()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Rne,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,v){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(E,v):new r(E):new r;if(E===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(E),v!==void 0?this.absoluteTo(v):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,v){var I={},N,F;if(f(v)==="RegExp")I=null;else if(d(v))for(N=0,F=v.length;N<F;N++)I[v[N]]=!0;else I[v]=!0;for(N=0,F=E.length;N<F;N++){var U=I&&I[E[N]]!==void 0||!I&&v.test(E[N]);U&&(E.splice(N,1),F--,N--)}return E}function _(E,v){var I,N;if(d(v)){for(I=0,N=v.length;I<N;I++)if(!_(E,v[I]))return!1;return!0}var F=f(v);for(I=0,N=E.length;I<N;I++)if(F==="RegExp"){if(typeof E[I]=="string"&&E[I].match(v))return!0}else if(E[I]===v)return!0;return!1}function m(E,v){if(!d(E)||!d(v)||E.length!==v.length)return!1;E.sort(),v.sort();for(var I=0,N=E.length;I<N;I++)if(E[I]!==v[I])return!1;return!0}function y(E){var v=/^\/+|\/+$/g;return E.replace(v,"")}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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A-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(E){if(!(!E||!E.nodeName)){var v=E.nodeName.toLowerCase();if(!(v==="input"&&E.type!=="image"))return r.domAttributes[v]}};function b(E){return escape(E)}function x(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,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(E,v){var I=r.encode(E+"");return v===void 0&&(v=r.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},r.decodeQuery=function(E,v){E+="",v===void 0&&(v=r.escapeQuerySpace);try{return r.decode(v?E.replace(/\+/g,"%20"):E)}catch{return E}};var T={encode:"encode",decode:"decode"},C,A=function(E,v){return function(I){try{return r[v](I+"").replace(r.characters[E][v].expression,function(N){return r.characters[E][v].map[N]})}catch{return I}}};for(C in T)r[C+"PathSegment"]=A("pathname",T[C]),r[C+"UrnPathSegment"]=A("urnpath",T[C]);var S=function(E,v,I){return function(N){var F;I?F=function(B){return r[v](r[I](B))}:F=r[v];for(var U=(N+"").split(E),k=0,z=U.length;k<z;k++)U[k]=F(U[k]);return U.join(E)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=A("reserved","encode"),r.parse=function(E,v){var I;return v||(v={preventInvalidHostname:r.preventInvalidHostname}),E=E.replace(r.leading_whitespace_expression,""),E=E.replace(r.ascii_tab_whitespace,""),I=E.indexOf("#"),I>-1&&(v.fragment=E.substring(I+1)||null,E=E.substring(0,I)),I=E.indexOf("?"),I>-1&&(v.query=E.substring(I+1)||null,E=E.substring(0,I)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(v.protocol=null,E=E.substring(2),E=r.parseAuthority(E,v)):(I=E.indexOf(":"),I>-1&&(v.protocol=E.substring(0,I)||null,v.protocol&&!v.protocol.match(r.protocol_expression)?v.protocol=void 0:E.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(E=E.substring(I+3),E=r.parseAuthority(E,v)):(E=E.substring(I+1),v.urn=!0))),v.path=E,v},r.parseHost=function(E,v){E||(E=""),E=E.replace(/\\/g,"/");var I=E.indexOf("/"),N,F;if(I===-1&&(I=E.length),E.charAt(0)==="[")N=E.indexOf("]"),v.hostname=E.substring(1,N)||null,v.port=E.substring(N+2,I)||null,v.port==="/"&&(v.port=null);else{var U=E.indexOf(":"),k=E.indexOf("/"),z=E.indexOf(":",U+1);z!==-1&&(k===-1||z<k)?(v.hostname=E.substring(0,I)||null,v.port=null):(F=E.substring(0,I).split(":"),v.hostname=F[0]||null,v.port=F[1]||null)}return v.hostname&&E.substring(I).charAt(0)!=="/"&&(I++,E="/"+E),v.preventInvalidHostname&&r.ensureValidHostname(v.hostname,v.protocol),v.port&&r.ensureValidPort(v.port),E.substring(I)||"/"},r.parseAuthority=function(E,v){return E=r.parseUserinfo(E,v),r.parseHost(E,v)},r.parseUserinfo=function(E,v){var I=E,N=E.indexOf("\\");N!==-1&&(E=E.replace(/\\/g,"/"));var F=E.indexOf("/"),U=E.lastIndexOf("@",F>-1?F:E.length-1),k;return U>-1&&(F===-1||U<F)?(k=E.substring(0,U).split(":"),v.username=k[0]?r.decode(k[0]):null,k.shift(),v.password=k[0]?r.decode(k.join(":")):null,E=I.substring(U+1)):(v.username=null,v.password=null),E},r.parseQuery=function(E,v){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var I={},N=E.split("&"),F=N.length,U,k,z,B=0;B<F;B++)U=N[B].split("="),k=r.decodeQuery(U.shift(),v),z=U.length?r.decodeQuery(U.join("="),v):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(z)):I[k]=z);return I},r.build=function(E){var v="",I=!1;return E.protocol&&(v+=E.protocol+":"),!E.urn&&(v||E.hostname)&&(v+="//",I=!0),v+=r.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&I&&(v+="/"),v+=E.path),typeof E.query=="string"&&E.query&&(v+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(v+="#"+E.fragment),v},r.buildHost=function(E){var v="";if(E.hostname)r.ip6_expression.test(E.hostname)?v+="["+E.hostname+"]":v+=E.hostname;else return"";return E.port&&(v+=":"+E.port),v},r.buildAuthority=function(E){return r.buildUserinfo(E)+r.buildHost(E)},r.buildUserinfo=function(E){var v="";return E.username&&(v+=r.encode(E.username)),E.password&&(v+=":"+r.encode(E.password)),v&&(v+="@"),v},r.buildQuery=function(E,v,I){var N="",F,U,k,z;for(U in E)if(U!=="__proto__"&&c.call(E,U))if(d(E[U]))for(F={},k=0,z=E[U].length;k<z;k++)E[U][k]!==void 0&&F[E[U][k]+""]===void 0&&(N+="&"+r.buildQueryParameter(U,E[U][k],I),v!==!0&&(F[E[U][k]+""]=!0));else E[U]!==void 0&&(N+="&"+r.buildQueryParameter(U,E[U],I));return N.substring(1)},r.buildQueryParameter=function(E,v,I){return r.encodeQuery(E,I)+(v!==null?"="+r.encodeQuery(v,I):"")},r.addQuery=function(E,v,I){if(typeof v=="object")for(var N in v)c.call(v,N)&&r.addQuery(E,N,v[N]);else if(typeof v=="string"){if(E[v]===void 0){E[v]=I;return}else typeof E[v]=="string"&&(E[v]=[E[v]]);d(I)||(I=[I]),E[v]=(E[v]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(E,v,I){if(typeof v=="object")for(var N in v)c.call(v,N)&&r.setQuery(E,N,v[N]);else if(typeof v=="string")E[v]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(E,v,I){var N,F,U;if(d(v))for(N=0,F=v.length;N<F;N++)E[v[N]]=void 0;else if(f(v)==="RegExp")for(U in E)v.test(U)&&(E[U]=void 0);else if(typeof v=="object")for(U in v)c.call(v,U)&&r.removeQuery(E,U,v[U]);else if(typeof v=="string")I!==void 0?f(I)==="RegExp"?!d(E[v])&&I.test(E[v])?E[v]=void 0:E[v]=p(E[v],I):E[v]===String(I)&&(!d(I)||I.length===1)?E[v]=void 0:d(E[v])&&(E[v]=p(E[v],I)):E[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(E,v,I,N){switch(f(v)){case"String":break;case"RegExp":for(var F in E)if(c.call(E,F)&&v.test(F)&&(I===void 0||r.hasQuery(E,F,I)))return!0;return!1;case"Object":for(var U in v)if(c.call(v,U)&&!r.hasQuery(E,U,v[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return v in E;case"Boolean":var k=!!(d(E[v])?E[v].length:E[v]);return I===k;case"Function":return!!I(E[v],v,E);case"Array":if(!d(E[v]))return!1;var z=N?_:m;return z(E[v],I);case"RegExp":return d(E[v])?N?_(E[v],I):!1:!!(E[v]&&E[v].match(I));case"Number":I=String(I);case"String":return d(E[v])?N?_(E[v],I):!1:E[v]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var E=[],v=[],I=0,N=0;N<arguments.length;N++){var F=new r(arguments[N]);E.push(F);for(var U=F.segment(),k=0;k<U.length;k++)typeof U[k]=="string"&&v.push(U[k]),U[k]&&I++}if(!v.length||!I)return new r("");var z=new r("").segment(v);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(E,v){var I=Math.min(E.length,v.length),N;for(N=0;N<I;N++)if(E.charAt(N)!==v.charAt(N)){N--;break}return N<1?E.charAt(0)===v.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(N)!=="/"||v.charAt(N)!=="/")&&(N=E.substring(0,N).lastIndexOf("/")),E.substring(0,N+1))},r.withinString=function(E,v,I){I||(I={});var N=I.start||r.findUri.start,F=I.end||r.findUri.end,U=I.trim||r.findUri.trim,k=I.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var B=N.exec(E);if(!B)break;var j=B.index;if(I.ignoreHtml){var W=E.slice(Math.max(j-3,0),j);if(W&&z.test(W))continue}for(var J=j+E.slice(j).search(F),Y=E.slice(j,J),ee=-1;;){var Q=k.exec(Y);if(!Q)break;var de=Q.index+Q[0].length;ee=Math.max(ee,de)}if(ee>-1?Y=Y.slice(0,ee)+Y.slice(ee).replace(U,""):Y=Y.replace(U,""),!(Y.length<=B[0].length)&&!(I.ignore&&I.ignore.test(Y))){J=j+Y.length;var ge=v(Y,j,J,E);if(ge===void 0){N.lastIndex=J;continue}ge=String(ge),E=E.slice(0,j)+ge+E.slice(J),N.lastIndex=j+ge.length}}return N.lastIndex=0,E},r.ensureValidHostname=function(E,v){var I=!!E,N=!!v,F=!1;if(N&&(F=_(r.hostProtocols,v)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var v=Number(E);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function w(E){return function(v,I){return v===void 0?this._parts[E]||"":(this._parts[E]=v||null,this.build(!I),this)}}function R(E,v){return function(I,N){return I===void 0?this._parts[E]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[E]=I,this.build(!N),this)}}a.protocol=w("protocol"),a.username=w("username"),a.password=w("password"),a.hostname=w("hostname"),a.port=w("port"),a.query=R("query","?"),a.fragment=R("fragment","#"),a.search=function(E,v){var I=this.query(E,v);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(E,v){var I=this.fragment(E,v);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(E,v){if(E===void 0||E===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!v),this},a.path=a.pathname,a.href=function(E,v){var I;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var N=E instanceof r,F=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var U=r.getDomAttribute(E);E=E[U]||"",F=!1}if(!N&&F&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(N||F){var k=N?E._parts:E;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(!v),this},a.is=function(E){var v=!1,I=!1,N=!1,F=!1,U=!1,k=!1,z=!1,B=!this._parts.urn;switch(this._parts.hostname&&(B=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),v=I||N,F=!v,U=F&&n&&n.has(this._parts.hostname),k=F&&r.idn_expression.test(this._parts.hostname),z=F&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return B;case"absolute":return!B;case"domain":case"name":return F;case"sld":return U;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var P=a.protocol,O=a.port,L=a.hostname;a.protocol=function(E,v){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,E,v)},a.scheme=a.protocol,a.port=function(E,v){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),O.call(this,E,v))},a.hostname=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(E,I);if(N!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return L.call(this,E,v)},a.origin=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var F=r(E);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!v),this},a.resource=function(E,v){var I;return E===void 0?this.path()+this.search()+this.hash():(I=r.parse(E),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},a.subdomain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===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 N=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,N),U=new RegExp("^"+u(F));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,E),this.build(!v),this}},a.domain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===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 N=this._parts.hostname.length-this.tld(v).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,E)}return this.build(!v),this}},a.tld=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var F;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E);else throw new TypeError('TLD "'+E+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return E?r.decodePath(N):N}else{var F=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,F),k=new RegExp("^"+u(U));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(k,E),this.build(!v),this}},a.filename=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return E?r.decodePathSegment(N):N}else{var F=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(F=!0);var U=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(U,E),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),F,U;return N===-1?"":(F=I.substring(N+1),U=/^[a-z0-9%]+$/i.test(F)?F:"",E?r.decodePathSegment(U):U)}else{E.charAt(0)==="."&&(E=E.substring(1));var k=this.suffix(),z;if(k)E?z=new RegExp(u(k)+"$"):z=new RegExp(u("."+k)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return z&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(z,E)),this.build(!v),this}},a.segment=function(E,v,I){var N=this._parts.urn?":":"/",F=this.path(),U=F.substring(0,1)==="/",k=F.split(N);if(E!==void 0&&typeof E!="number"&&(I=v,v=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(U&&k.shift(),E<0&&(E=Math.max(k.length+E,0)),v===void 0)return E===void 0?k:k[E];if(E===null||k[E]===void 0)if(d(v)){k=[];for(var z=0,B=v.length;z<B;z++)!v[z].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(y(v[z])))}else(v||typeof v=="string")&&(v=y(v),k[k.length-1]===""?k[k.length-1]=v:k.push(v));else v?k[E]=y(v):k.splice(E,1);return U&&k.unshift(""),this.path(k.join(N),I)},a.segmentCoded=function(E,v,I){var N,F,U;if(typeof E!="number"&&(I=v,v=E,E=void 0),v===void 0){if(N=this.segment(E,v,I),!d(N))N=N!==void 0?r.decode(N):void 0;else for(F=0,U=N.length;F<U;F++)N[F]=r.decode(N[F]);return N}if(!d(v))v=typeof v=="string"||v instanceof String?r.encode(v):v;else for(F=0,U=v.length;F<U;F++)v[F]=r.encode(v[F]);return this.segment(E,v,I)};var g=a.query;return a.query=function(E,v){if(E===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=E.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=r.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):g.call(this,E,v)},a.setQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)N[E]=v!==void 0?v:null;else if(typeof E=="object")for(var F in E)c.call(E,F)&&(N[F]=E[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.addQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,E,v===void 0?null:v),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.removeQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,E,v),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.hasQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,E,v,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(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){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(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;v=r.recodePath(v);var I,N="",F,U;for(v.charAt(0)!=="/"&&(I=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=v.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));F=v.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){v=v.substring(3);continue}U=v.substring(0,F).lastIndexOf("/"),U===-1&&(U=F),v=v.substring(0,U)+v.substring(F+3)}return I&&this.is("relative")&&(v=N+v.substring(1)),this._parts.path=v,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){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(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=r.encode,v=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=E,r.decode=v}return this},a.unicode=function(){var E=r.encode,v=r.decode;r.encode=x,r.decode=unescape;try{this.normalize()}finally{r.encode=E,r.decode=v}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var v="";if(E._parts.protocol&&(v+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(v+=e.toUnicode(E._parts.hostname),E._parts.port&&(v+=":"+E._parts.port)):v+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(v+="/"),v+=E.path(!0),E._parts.query){for(var I="",N=0,F=E._parts.query.split("&"),U=F.length;N<U;N++){var k=(F[N]||"").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"))}v+="?"+I.substring(1)}return v+=r.decodeQuery(E.hash(),!0),v},a.absoluteTo=function(E){var v=this.clone(),I=["protocol","username","password","hostname","port"],N,F,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof r||(E=new r(E)),v._parts.protocol||(v._parts.protocol=E._parts.protocol,this._parts.hostname))return v;for(F=0;U=I[F];F++)v._parts[U]=E._parts[U];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(N=E.directory(),N=N||(E.path().indexOf("/")===0?"/":""),v._parts.path=(N?N+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=E._parts.path,v._parts.query||(v._parts.query=E._parts.query)),v.build(),v},a.relativeTo=function(E){var v=this.clone().normalize(),I,N,F,U,k;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new r(E).normalize(),I=v._parts,N=E._parts,U=v.path(),k=E.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return v.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return v.build();if(U===k)return I.path="",v.build();if(F=r.commonPath(U,k),!F)return v.build();var z=N.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=z+I.path.substring(F.length)||"./",v.build()},a.equals=function(E){var v=this.clone(),I=new r(E),N={},F={},U={},k,z,B;if(v.normalize(),I.normalize(),v.toString()===I.toString())return!0;if(k=v.query(),z=I.query(),v.query(""),I.query(""),v.toString()!==I.toString()||k.length!==z.length)return!1;N=r.parseQuery(k,this._parts.escapeQuerySpace),F=r.parseQuery(z,this._parts.escapeQuerySpace);for(B in N)if(c.call(N,B)){if(d(N[B])){if(!m(N[B],F[B]))return!1}else if(N[B]!==F[B])return!1;U[B]=!0}for(B in F)if(c.call(F,B)&&!U[B])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},r})});var Lce=Zn((dO,s7)=>{var _4=function(){"use strict";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(_){n=_.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(_){for(var m=new Uint8Array(_.length),y=0;y<_.length;++y){var b=_.charCodeAt(y);m[y]=b>96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y<_.length;++y)m[x++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,x)}function r(_){if(!_)throw new Error("Assertion failed")}function s(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}function a(_,m,y,b){var x=n.exports.sbrk,T=x(m.length*4),C=x(y*4),A=new Uint8Array(n.exports.memory.buffer),S=s(m);A.set(S,T),b&&b(T,T,m.length,y);var w=_(C,T,m.length,y);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(y);new Uint8Array(R.buffer).set(A.subarray(C,C+y*4)),S.set(A.subarray(T,T+m.length*4)),x(T-x(0));for(var P=0;P<m.length;++P)m[P]=R[m[P]];return[R,w]}function c(_,m,y,b){var x=n.exports.sbrk,T=x(y*4),C=x(y*b),A=new Uint8Array(n.exports.memory.buffer);A.set(s(m),C),_(T,C,y,b),A=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(y);return new Uint8Array(S.buffer).set(A.subarray(T,T+y*4)),x(T-x(0)),S}function u(_,m,y,b,x){var T=n.exports.sbrk,C=T(m),A=T(b*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(y),A);var w=_(C,m,A,b,x),R=new Uint8Array(w);return R.set(S.subarray(C,C+w)),T(C-T(0)),R}function f(_){for(var m=0,y=0;y<_.length;++y){var b=_[y];m=m<b?b:m}return m}function d(_,m){if(r(m==2||m==4),m==4)return new Uint32Array(_.buffer,_.byteOffset,_.byteLength/4);var y=new Uint16Array(_.buffer,_.byteOffset,_.byteLength/2);return new Uint32Array(y)}function p(_,m,y,b,x,T,C){var A=n.exports.sbrk,S=A(y*b),w=A(y*T),R=new Uint8Array(n.exports.memory.buffer);R.set(s(m),w),_(S,y,b,x,w,C);var P=new Uint8Array(y*b);return P.set(R.subarray(S,S+y*b)),A(S-A(0)),P}return{ready:i,supported:!0,reorderMesh:function(_,m,y){var b=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,_,f(_)+1,b)},reorderPoints:function(_,m){return r(_ instanceof Float32Array),r(_.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,_,_.length/m,m*4)},encodeVertexBuffer:function(_,m,y){r(y>0&&y<=256),r(y%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,b,_,m,y)},encodeIndexBuffer:function(_,m,y){r(y==2||y==4),r(m%3==0);var b=d(_,y),x=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,b,m,4)},encodeIndexSequence:function(_,m,y){r(y==2||y==4);var b=d(_,y),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,x,b,m,4)},encodeGltfBuffer:function(_,m,y,b){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(x[b]),x[b](_,m,y)},encodeFilterOct:function(_,m,y,b){return r(y==4||y==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,_,m,y,b,16)},encodeFilterQuat:function(_,m,y,b){return r(y==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,_,m,y,b,16)},encodeFilterExp:function(_,m,y,b,x){r(y>0&&y%4==0),r(b>=1&&b<=24);var T={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,_,m,y,b,y,x?T[x]:1)}}}();typeof dO=="object"&&typeof s7=="object"?s7.exports=_4:typeof define=="function"&&define.amd?define([],function(){return _4}):typeof dO=="object"?dO.MeshoptEncoder=_4:(typeof self<"u"?self:dO).MeshoptEncoder=_4});var Nce=Zn((hO,a7)=>{var g4=function(){"use strict";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;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8Ep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naeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9: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(x){r=x.instance,r.exports.__wasm_call_ctors()});function a(x){for(var T=new Uint8Array(x.length),C=0;C<x.length;++C){var A=x.charCodeAt(C);T[C]=A>96?A-97:A>64?A-39:A+4}for(var S=0,C=0;C<x.length;++C)T[S++]=T[C]<60?i[T[C]]:(T[C]-60)*64+T[++C];return T.buffer.slice(0,S)}function c(x,T,C,A,S,w,R){var P=x.exports.sbrk,O=A+3&-4,L=P(O*S),g=P(w.length),E=new Uint8Array(x.exports.memory.buffer);E.set(w,g);var v=T(L,A,S,g,w.length);if(v==0&&R&&R(L,O,S),C.set(E.subarray(L,L+A*S)),P(L-P(0)),v!=0)throw new Error("Malformed buffer data: "+v)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function _(x){var T={object:new Worker(x),pending:0,requests:{}};return T.object.onmessage=function(C){var A=C.data;T.pending-=A.count,T.requests[A.id][A.action](A.value),delete T.requests[A.id]},T}function m(x){for(var T="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+c.toString()+b.toString(),C=new Blob([T],{type:"text/javascript"}),A=URL.createObjectURL(C),S=d.length;S<x;++S)d[S]=_(A);for(var S=x;S<d.length;++S)d[S].object.postMessage({});d.length=x,URL.revokeObjectURL(A)}function y(x,T,C,A,S){for(var w=d[0],R=1;R<d.length;++R)d[R].pending<w.pending&&(w=d[R]);return new Promise(function(P,O){var L=new Uint8Array(C),g=++p;w.pending+=x,w.requests[g]={resolve:P,reject:O},w.object.postMessage({id:g,count:x,size:T,source:L,mode:A,filter:S},[L.buffer])})}function b(x){var T=x.data;if(!T.id)return self.close();self.ready.then(function(C){try{var A=new Uint8Array(T.count*T.size);c(C,C.exports[T.mode],A,T.count,T.size,T.source,C.exports[T.filter]),self.postMessage({id:T.id,count:T.count,action:"resolve",value:A},[A.buffer])}catch(S){self.postMessage({id:T.id,count:T.count,action:"reject",value:S})}})}return{ready:s,supported:!0,useWorkers:function(x){m(x)},decodeVertexBuffer:function(x,T,C,A,S){c(r,r.exports.meshopt_decodeVertexBuffer,x,T,C,A,r.exports[u[S]])},decodeIndexBuffer:function(x,T,C,A){c(r,r.exports.meshopt_decodeIndexBuffer,x,T,C,A)},decodeIndexSequence:function(x,T,C,A){c(r,r.exports.meshopt_decodeIndexSequence,x,T,C,A)},decodeGltfBuffer:function(x,T,C,A,S,w){c(r,r.exports[f[S]],x,T,C,A,r.exports[u[w]])},decodeGltfBufferAsync:function(x,T,C,A,S){return d.length>0?y(x,T,C,f[A],u[S]):s.then(function(){var w=new Uint8Array(x*T);return c(r,r.exports[f[A]],w,x,T,C,r.exports[u[S]]),w})}}}();typeof hO=="object"&&typeof a7=="object"?a7.exports=g4:typeof define=="function"&&define.amd?define([],function(){return g4}):typeof hO=="object"?hO.MeshoptDecoder=g4:(typeof self<"u"?self:hO).MeshoptDecoder=g4});var Fce=Zn((mO,c7)=>{var y4=function(){"use strict";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:tg8Sa8S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WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaraicltfhQcbhHa8JhCinaQaHfgeasc;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:cjjjbabh3cbhEcbh5inaba5cdtfhwcbheindnaLa3aefydbgOcdtg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OahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhAabhecbhQindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgXSmbaOaXSmbabaAcdtfgYaHBdbaYcwfaXBdbaYclfaOBdbaAcifhAkaecxfheaQcifgQad6mbkdndna9cTmbaAak9nmba8UaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgQaOBdbaQclfaeclfydbBdbaQcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaA6mbkJFFuuh8UaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8UaOEh8UaeclfheaHcufgHmbxdkkaAhdkadak0mbxdkkasclfabadalaLz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<m.length;++b)y[T++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,T)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,y,b){var x=n.exports.sbrk,T=x(y.length*4),C=x(b*4),A=new Uint8Array(n.exports.memory.buffer),S=s(y);A.set(S,T);var w=m(C,T,y.length,b);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);new Uint8Array(R.buffer).set(A.subarray(C,C+b*4)),S.set(A.subarray(T,T+y.length*4)),x(T-x(0));for(var P=0;P<y.length;++P)y[P]=R[y[P]];return[R,w]}function c(m){for(var y=0,b=0;b<m.length;++b){var x=m[b];y=y<x?x:y}return y}function u(m,y,b,x,T,C,A,S,w){var R=n.exports.sbrk,P=R(4),O=R(b*4),L=R(T*C),g=R(b*4),E=new Uint8Array(n.exports.memory.buffer);E.set(s(x),L),E.set(s(y),g);var v=m(O,g,b,L,T,C,A,S,w,P);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(v);s(I).set(E.subarray(O,O+v*4));var N=new Float32Array(1);return s(N).set(E.subarray(P,P+4)),R(P-R(0)),[I,N[0]]}function f(m,y,b,x,T,C,A,S,w,R,P,O,L){var g=n.exports.sbrk,E=g(4),v=g(b*4),I=g(T*C),N=g(T*S),F=g(w.length*4),U=g(b*4),k=R?g(T):0,z=new Uint8Array(n.exports.memory.buffer);z.set(s(x),I),z.set(s(A),N),z.set(s(w),F),z.set(s(y),U),R&&z.set(s(R),k);var B=m(v,U,b,I,T,C,N,S,F,w.length,k,P,O,L,E);z=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(z.subarray(v,v+B*4));var W=new Float32Array(1);return s(W).set(z.subarray(E,E+4)),g(E-g(0)),[j,W[0]]}function d(m,y,b,x){var T=n.exports.sbrk,C=T(b*x),A=new Uint8Array(n.exports.memory.buffer);A.set(s(y),C);var S=m(C,b,x);return T(C-T(0)),S}function p(m,y,b,x,T,C,A,S){var w=n.exports.sbrk,R=w(S*4),P=w(b*x),O=w(b*C),L=new Uint8Array(n.exports.memory.buffer);L.set(s(y),P),T&&L.set(s(T),O);var g=m(R,P,b,x,O,C,A,S);L=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(g);return s(E).set(L.subarray(R,R+g*4)),w(R-w(0)),E}var _={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var y=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,c(m)+1)},simplify:function(m,y,b,x,T,C){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x>=0&&x<=m.length),r(x%3==0),r(T>=0);for(var A=0,S=0;S<(C?C.length:0);++S)r(C[S]in _),A|=_[C[S]];var w=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),R=u(n.exports.meshopt_simplify,w,m.length,y,y.length/b,b*4,x,T,A);return R[0]=m instanceof Uint32Array?R[0]:new m.constructor(R[0]),R},simplifyWithAttributes:function(m,y,b,x,T,C,A,S,w,R){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x instanceof Float32Array),r(x.length%T==0),r(T>=0),r(A==null||A instanceof Uint8Array),r(A==null||A.length==y.length/b),r(S>=0&&S<=m.length),r(S%3==0),r(w>=0),r(Array.isArray(C)),r(T>=C.length),r(C.length<=32);for(var P=0;P<C.length;++P)r(C[P]>=0);for(var O=0,P=0;P<(R?R.length:0);++P)r(R[P]in _),O|=_[R[P]];var L=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),g=f(n.exports.meshopt_simplifyWithAttributes,L,m.length,y,y.length/b,b*4,x,T*4,new Float32Array(C),A?new Uint8Array(A):null,S,w,O);return g[0]=m instanceof Uint32Array?g[0]:new m.constructor(g[0]),g},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),d(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,b,x,T,C){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(b>=0&&b<=m.length/y),x?(r(x instanceof Float32Array),r(x.length%T==0),r(T>=3),r(m.length/y==x.length/T),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,x,T*4,C,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,b)}}}();typeof mO=="object"&&typeof c7=="object"?c7.exports=y4:typeof define=="function"&&define.amd?define([],function(){return y4}):typeof mO=="object"?mO.MeshoptSimplifier=y4:(typeof self<"u"?self:mO).MeshoptSimplifier=y4});var Bce=Zn((pO,l7)=>{var b4=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:njjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd:e1jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:njjjbhYamcuaLcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd:WwamcoBd;8waEaq:ZNhEdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaE:rhhcuh8PamcuaLcltalcFFFFd0Ecbyd:e1jjbHjjjjbbgIBd:0wamcrBd;8wcbaIa8AaCaLz:djjjb8AJFFuuhyJFFuuh8RJFFuuh8Sdnalci6gXmbJFFuuh8Sa8AhsaLhAJFFuuh8RJFFuuhyinascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<m.length;++b)y[T++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,T)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,y){var b=m.meshlets[y*4+0],x=m.meshlets[y*4+1],T=m.meshlets[y*4+2],C=m.meshlets[y*4+3];return{vertices:m.vertices.subarray(b,b+T),triangles:m.triangles.subarray(x,x+C*3)}}function f(m,y,b,x,T,C,A){var S=n.exports.sbrk,w=n.exports.meshopt_buildMeshletsBound(m.length,T,C),R=S(w*c),P=S(w*T*4),O=S(w*C*3),L=S(m.byteLength),g=S(y.byteLength),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),L),E.set(s(y),g);var v=n.exports.meshopt_buildMeshlets(R,P,O,L,m.length,g,b,x,T,C,A);E=new Uint8Array(n.exports.memory.buffer);for(var I=E.subarray(R,R+v*c),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),F=0;F<v;++F){var U=N[F*4+0],k=N[F*4+1],b=N[F*4+2],z=N[F*4+3];n.exports.meshopt_optimizeMeshlet(P+U*4,O+k,z,b)}var B=N[(v-1)*4+0],j=N[(v-1)*4+1],W=N[(v-1)*4+2],J=N[(v-1)*4+3],Y=B+W,ee=j+(J*3+3&-4),Q={meshlets:N,vertices:new Uint32Array(E.buffer,P,Y).slice(),triangles:new Uint8Array(E.buffer,O,ee*3).slice(),meshletCount:v};return S(R-S(0)),Q}function d(m){var y=new Float32Array(n.exports.memory.buffer,m,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(m,y,b,x){var T=n.exports.sbrk,C=[],A=T(y.byteLength),S=T(m.vertices.byteLength),w=T(m.triangles.byteLength),R=T(a),P=new Uint8Array(n.exports.memory.buffer);P.set(s(y),A),P.set(s(m.vertices),S),P.set(s(m.triangles),w);for(var O=0;O<m.meshletCount;++O){var L=m.meshlets[O*4+0],g=m.meshlets[O*4+0+1],E=m.meshlets[O*4+0+3];n.exports.meshopt_computeMeshletBounds(R,S+L*4,w+g,E,A,b,x),C.push(d(R))}return T(A-T(0)),C}function _(m,y,b,x){var T=n.exports.sbrk,C=T(a),A=T(m.byteLength),S=T(y.byteLength),w=new Uint8Array(n.exports.memory.buffer);w.set(s(m),A),w.set(s(y),S),n.exports.meshopt_computeClusterBounds(C,A,m.length,S,b,x);var R=d(C);return T(C-T(0)),R}return{ready:i,supported:!0,buildMeshlets:function(m,y,b,x,T,C){r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x<=256||x>0),r(T<=512),r(T%4==0),C=C||0;var A=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(A,y,y.length/b,b*4,x,T,C)},computeClusterBounds:function(m,y,b){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return _(x,y,y.length/b,b*4)},computeMeshletBounds:function(m,y,b){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),p(m,y,y.length/b,b*4)},extractMeshlet:function(m,y){return r(y>=0&&y<m.meshletCount),u(m,y)}}}();typeof pO=="object"&&typeof l7=="object"?l7.exports=b4:typeof define=="function"&&define.amd?define([],function(){return b4}):typeof pO=="object"?pO.MeshoptClusterizer=b4:(typeof self<"u"?self:pO).MeshoptClusterizer=b4});var Uce=Zn((kdn,kce)=>{var G4e=Lce(),j4e=Nce(),W4e=Fce(),q4e=Bce();kce.exports={MeshoptEncoder:G4e,MeshoptDecoder:j4e,MeshoptSimplifier:W4e,MeshoptClusterizer:q4e}});var Zde=Zn((v2n,$de)=>{"use strict";$de.exports=e$e;var cN=1e20;function e$e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,_,m,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?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,_=d.getImageData(0,0,r,s),c=_.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,_=d.getImageData(0,0,r,s),c=_.data,f=4):window.ImageData&&e instanceof window.ImageData&&(_=e,r=e.width,s=e.height,c=_.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),x=Array(r*s),T=Array(a),C=Array(a),A=Array(a+1),S=Array(a);for(m=0,y=r*s;m<y;m++){var w=c[m];b[m]=w===1?0:w===0?cN:Math.pow(Math.max(0,.5-w),2),x[m]=w===1?cN:w===0?0:Math.pow(Math.max(0,w-.5),2)}Xde(b,r,s,T,C,S,A),Xde(x,r,s,T,C,S,A);var R=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,y=r*s;m<y;m++)R[m]=Math.min(Math.max(1-((b[m]-x[m])/i+n),0),1);return R}function Xde(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(Kde(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(Kde(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Kde(e,t,n,i,o){n[0]=0,i[0]=-cN,i[1]=+cN;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]=+cN}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 nhe=Zn((G2n,n8)=>{function f$e(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,_=13,m=14,y=15,b=16,x=17,T=0,C=1,A=2,S=3,w=4;function R(g,E){return 55296<=g.charCodeAt(E)&&g.charCodeAt(E)<=56319&&56320<=g.charCodeAt(E+1)&&g.charCodeAt(E+1)<=57343}function P(g,E){E===void 0&&(E=0);var v=g.charCodeAt(E);if(55296<=v&&v<=56319&&E<g.length-1){var I=v,N=g.charCodeAt(E+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=v&&v<=57343&&E>=1){var I=g.charCodeAt(E-1),N=v;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return v}function O(g,E,v){var I=[g].concat(E).concat([v]),N=I[I.length-2],F=v,U=I.lastIndexOf(m);if(U>1&&I.slice(1,U).every(function(B){return B==i})&&[i,_,x].indexOf(g)==-1)return A;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(B){return B==o})&&[p,o].indexOf(N)==-1)return I.filter(function(B){return B==o}).length%2==1?S:w;if(N==e&&F==t)return T;if(N==n||N==e||N==t)return F==m&&E.every(function(B){return B==i})?A:C;if(F==n||F==e||F==t)return C;if(N==s&&(F==s||F==a||F==u||F==f))return T;if((N==u||N==a)&&(F==a||F==c))return T;if((N==f||N==c)&&F==c)return T;if(F==i||F==y)return T;if(F==r)return T;if(N==p)return T;var z=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[_,x].indexOf(I[z])!=-1&&I.slice(z+1,-1).every(function(B){return B==i})&&F==m||N==y&&[b,x].indexOf(F)!=-1?T:E.indexOf(o)!=-1?A:N==o&&F==o?T:C}this.nextBreak=function(g,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=g.length-1)return g.length;for(var v=L(P(g,E)),I=[],N=E+1;N<g.length;N++)if(!R(g,N-1)){var F=L(P(g,N));if(O(v,I,F))return N;I.push(F)}return g.length},this.splitGraphemes=function(g){for(var E=[],v=0,I;(I=this.nextBreak(g,v))<g.length;)E.push(g.slice(v,I)),v=I;return v<g.length&&E.push(g.slice(v)),E},this.iterateGraphemes=function(g){var E=0,v={next:function(){var I,N;return(N=this.nextBreak(g,E))<g.length?(I=g.slice(E,N),E=N,{value:I,done:!1}):E<g.length?(I=g.slice(E),E=g.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(g){for(var E=0,v=0,I;(I=this.nextBreak(g,v))<g.length;)v=I,E++;return v<g.length&&E++,E};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?s:4448<=g&&g<=4519||55216<=g&&g<=55238?a:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?_:127995<=g&&g<=127999?m:g==8205?y:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?b:128102<=g&&g<=128105?x:d}return this}typeof n8<"u"&&n8.exports&&(n8.exports=f$e)});var jge=Zn((dX,hX)=>{(function(e,t){typeof dX=="object"&&typeof hX<"u"?hX.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(dX,function(){"use strict";function e(C,A,S,w,R){t(C,A,S||0,w||C.length-1,R||i)}function t(C,A,S,w,R){for(;w>S;){if(w-S>600){var P=w-S+1,O=A-S+1,L=Math.log(P),g=.5*Math.exp(2*L/3),E=.5*Math.sqrt(L*g*(P-g)/P)*(O-P/2<0?-1:1),v=Math.max(S,Math.floor(A-O*g/P+E)),I=Math.min(w,Math.floor(A+(P-O)*g/P+E));t(C,A,v,I,R)}var N=C[A],F=S,U=w;for(n(C,S,A),R(C[w],N)>0&&n(C,S,w);F<U;){for(n(C,F,U),F++,U--;R(C[F],N)<0;)F++;for(;R(C[U],N)>0;)U--}R(C[S],N)===0?n(C,S,U):(U++,n(C,U,w)),U<=A&&(S=U+1),A<=U&&(w=U-1)}}function n(C,A,S){var w=C[A];C[A]=C[S],C[S]=w}function i(C,A){return C<A?-1:C>A?1:0}var o=function(A){A===void 0&&(A=9),this._maxEntries=Math.max(4,A),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(A){var S=this.data,w=[];if(!b(A,S))return w;for(var R=this.toBBox,P=[];S;){for(var O=0;O<S.children.length;O++){var L=S.children[O],g=S.leaf?R(L):L;b(A,g)&&(S.leaf?w.push(L):y(A,g)?this._all(L,w):P.push(L))}S=P.pop()}return w},o.prototype.collides=function(A){var S=this.data;if(!b(A,S))return!1;for(var w=[];S;){for(var R=0;R<S.children.length;R++){var P=S.children[R],O=S.leaf?this.toBBox(P):P;if(b(A,O)){if(S.leaf||y(A,O))return!0;w.push(P)}}S=w.pop()}return!1},o.prototype.load=function(A){if(!(A&&A.length))return this;if(A.length<this._minEntries){for(var S=0;S<A.length;S++)this.insert(A[S]);return this}var w=this._build(A.slice(),0,A.length-1,0);if(!this.data.children.length)this.data=w;else if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var R=this.data;this.data=w,w=R}this._insert(w,this.data.height-w.height-1,!0)}return this},o.prototype.insert=function(A){return A&&this._insert(A,this.data.height-1),this},o.prototype.clear=function(){return this.data=x([]),this},o.prototype.remove=function(A,S){if(!A)return this;for(var w=this.data,R=this.toBBox(A),P=[],O=[],L,g,E;w||P.length;){if(w||(w=P.pop(),g=P[P.length-1],L=O.pop(),E=!0),w.leaf){var v=r(A,w.children,S);if(v!==-1)return w.children.splice(v,1),P.push(w),this._condense(P),this}!E&&!w.leaf&&y(w,R)?(P.push(w),O.push(L),L=0,g=w,w=w.children[0]):g?(L++,w=g.children[L],E=!1):w=null}return this},o.prototype.toBBox=function(A){return A},o.prototype.compareMinX=function(A,S){return A.minX-S.minX},o.prototype.compareMinY=function(A,S){return A.minY-S.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(A){return this.data=A,this},o.prototype._all=function(A,S){for(var w=[];A;)A.leaf?S.push.apply(S,A.children):w.push.apply(w,A.children),A=w.pop();return S},o.prototype._build=function(A,S,w,R){var P=w-S+1,O=this._maxEntries,L;if(P<=O)return L=x(A.slice(S,w+1)),s(L,this.toBBox),L;R||(R=Math.ceil(Math.log(P)/Math.log(O)),O=Math.ceil(P/Math.pow(O,R-1))),L=x([]),L.leaf=!1,L.height=R;var g=Math.ceil(P/O),E=g*Math.ceil(Math.sqrt(O));T(A,S,w,E,this.compareMinX);for(var v=S;v<=w;v+=E){var I=Math.min(v+E-1,w);T(A,v,I,g,this.compareMinY);for(var N=v;N<=I;N+=g){var F=Math.min(N+g-1,I);L.children.push(this._build(A,N,F,R-1))}}return s(L,this.toBBox),L},o.prototype._chooseSubtree=function(A,S,w,R){for(;R.push(S),!(S.leaf||R.length-1===w);){for(var P=1/0,O=1/0,L=void 0,g=0;g<S.children.length;g++){var E=S.children[g],v=d(E),I=_(A,E)-v;I<O?(O=I,P=v<P?v:P,L=E):I===O&&v<P&&(P=v,L=E)}S=L||S.children[0]}return S},o.prototype._insert=function(A,S,w){var R=w?A:this.toBBox(A),P=[],O=this._chooseSubtree(R,this.data,S,P);for(O.children.push(A),c(O,R);S>=0&&P[S].children.length>this._maxEntries;)this._split(P,S),S--;this._adjustParentBBoxes(R,P,S)},o.prototype._split=function(A,S){var w=A[S],R=w.children.length,P=this._minEntries;this._chooseSplitAxis(w,P,R);var O=this._chooseSplitIndex(w,P,R),L=x(w.children.splice(O,w.children.length-O));L.height=w.height,L.leaf=w.leaf,s(w,this.toBBox),s(L,this.toBBox),S?A[S-1].children.push(L):this._splitRoot(w,L)},o.prototype._splitRoot=function(A,S){this.data=x([A,S]),this.data.height=A.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(A,S,w){for(var R,P=1/0,O=1/0,L=S;L<=w-S;L++){var g=a(A,0,L,this.toBBox),E=a(A,L,w,this.toBBox),v=m(g,E),I=d(g)+d(E);v<P?(P=v,R=L,O=I<O?I:O):v===P&&I<O&&(O=I,R=L)}return R||w-S},o.prototype._chooseSplitAxis=function(A,S,w){var R=A.leaf?this.compareMinX:u,P=A.leaf?this.compareMinY:f,O=this._allDistMargin(A,S,w,R),L=this._allDistMargin(A,S,w,P);O<L&&A.children.sort(R)},o.prototype._allDistMargin=function(A,S,w,R){A.children.sort(R);for(var P=this.toBBox,O=a(A,0,S,P),L=a(A,w-S,w,P),g=p(O)+p(L),E=S;E<w-S;E++){var v=A.children[E];c(O,A.leaf?P(v):v),g+=p(O)}for(var I=w-S-1;I>=S;I--){var N=A.children[I];c(L,A.leaf?P(N):N),g+=p(L)}return g},o.prototype._adjustParentBBoxes=function(A,S,w){for(var R=w;R>=0;R--)c(S[R],A)},o.prototype._condense=function(A){for(var S=A.length-1,w=void 0;S>=0;S--)A[S].children.length===0?S>0?(w=A[S-1].children,w.splice(w.indexOf(A[S]),1)):this.clear():s(A[S],this.toBBox)};function r(C,A,S){if(!S)return A.indexOf(C);for(var w=0;w<A.length;w++)if(S(C,A[w]))return w;return-1}function s(C,A){a(C,0,C.children.length,A,C)}function a(C,A,S,w,R){R||(R=x(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var P=A;P<S;P++){var O=C.children[P];c(R,C.leaf?w(O):O)}return R}function c(C,A){return C.minX=Math.min(C.minX,A.minX),C.minY=Math.min(C.minY,A.minY),C.maxX=Math.max(C.maxX,A.maxX),C.maxY=Math.max(C.maxY,A.maxY),C}function u(C,A){return C.minX-A.minX}function f(C,A){return C.minY-A.minY}function d(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function p(C){return C.maxX-C.minX+(C.maxY-C.minY)}function _(C,A){return(Math.max(A.maxX,C.maxX)-Math.min(A.minX,C.minX))*(Math.max(A.maxY,C.maxY)-Math.min(A.minY,C.minY))}function m(C,A){var S=Math.max(C.minX,A.minX),w=Math.max(C.minY,A.minY),R=Math.min(C.maxX,A.maxX),P=Math.min(C.maxY,A.maxY);return Math.max(0,R-S)*Math.max(0,P-w)}function y(C,A){return C.minX<=A.minX&&C.minY<=A.minY&&A.maxX<=C.maxX&&A.maxY<=C.maxY}function b(C,A){return A.minX<=C.maxX&&A.minY<=C.maxY&&A.maxX>=C.minX&&A.maxY>=C.minY}function x(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(C,A,S,w,R){for(var P=[A,S];P.length;)if(S=P.pop(),A=P.pop(),!(S-A<=w)){var O=A+Math.ceil((S-A)/w/2)*w;e(C,O,A,S,R),P.push(A,O,O,S)}}return o})});var cbe=Zn(($H,abe)=>{(function(e,t){typeof $H=="object"&&typeof abe<"u"?t($H):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})($H,function(e){"use strict";function t(C){return C}function n(C){if(C==null)return t;var A,S,w=C.scale[0],R=C.scale[1],P=C.translate[0],O=C.translate[1];return function(L,g){g||(A=S=0);var E=2,v=L.length,I=new Array(v);for(I[0]=(A+=L[0])*w+P,I[1]=(S+=L[1])*R+O;E<v;)I[E]=L[E],++E;return I}}function i(C){var A=n(C.transform),S,w=1/0,R=w,P=-w,O=-w;function L(E){E=A(E),E[0]<w&&(w=E[0]),E[0]>P&&(P=E[0]),E[1]<R&&(R=E[1]),E[1]>O&&(O=E[1])}function g(E){switch(E.type){case"GeometryCollection":E.geometries.forEach(g);break;case"Point":L(E.coordinates);break;case"MultiPoint":E.coordinates.forEach(L);break}}C.arcs.forEach(function(E){for(var v=-1,I=E.length,N;++v<I;)N=A(E[v],v),N[0]<w&&(w=N[0]),N[0]>P&&(P=N[0]),N[1]<R&&(R=N[1]),N[1]>O&&(O=N[1])});for(S in C.objects)g(C.objects[S]);return[w,R,P,O]}function o(C,A){for(var S,w=C.length,R=w-A;R<--w;)S=C[R],C[R++]=C[w],C[w]=S}function r(C,A){return typeof A=="string"&&(A=C.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(S){return s(C,S)})}:s(C,A)}function s(C,A){var S=A.id,w=A.bbox,R=A.properties==null?{}:A.properties,P=a(C,A);return S==null&&w==null?{type:"Feature",properties:R,geometry:P}:w==null?{type:"Feature",id:S,properties:R,geometry:P}:{type:"Feature",id:S,bbox:w,properties:R,geometry:P}}function a(C,A){var S=n(C.transform),w=C.arcs;function R(v,I){I.length&&I.pop();for(var N=w[v<0?~v:v],F=0,U=N.length;F<U;++F)I.push(S(N[F],F));v<0&&o(I,U)}function P(v){return S(v)}function O(v){for(var I=[],N=0,F=v.length;N<F;++N)R(v[N],I);return I.length<2&&I.push(I[0]),I}function L(v){for(var I=O(v);I.length<4;)I.push(I[0]);return I}function g(v){return v.map(L)}function E(v){var I=v.type,N;switch(I){case"GeometryCollection":return{type:I,geometries:v.geometries.map(E)};case"Point":N=P(v.coordinates);break;case"MultiPoint":N=v.coordinates.map(P);break;case"LineString":N=O(v.arcs);break;case"MultiLineString":N=v.arcs.map(O);break;case"Polygon":N=g(v.arcs);break;case"MultiPolygon":N=v.arcs.map(g);break;default:return null}return{type:I,coordinates:N}}return E(A)}function c(C,A){var S={},w={},R={},P=[],O=-1;A.forEach(function(E,v){var I=C.arcs[E<0?~E:E],N;I.length<3&&!I[1][0]&&!I[1][1]&&(N=A[++O],A[O]=E,A[v]=N)}),A.forEach(function(E){var v=L(E),I=v[0],N=v[1],F,U;if(F=R[I])if(delete R[F.end],F.push(E),F.end=N,U=w[N]){delete w[U.start];var k=U===F?F:F.concat(U);w[k.start=F.start]=R[k.end=U.end]=k}else w[F.start]=R[F.end]=F;else if(F=w[N])if(delete w[F.start],F.unshift(E),F.start=I,U=R[I]){delete R[U.end];var z=U===F?F:U.concat(F);w[z.start=U.start]=R[z.end=F.end]=z}else w[F.start]=R[F.end]=F;else F=[E],w[F.start=I]=R[F.end=N]=F});function L(E){var v=C.arcs[E<0?~E:E],I=v[0],N;return C.transform?(N=[0,0],v.forEach(function(F){N[0]+=F[0],N[1]+=F[1]})):N=v[v.length-1],E<0?[N,I]:[I,N]}function g(E,v){for(var I in E){var N=E[I];delete v[N.start],delete N.start,delete N.end,N.forEach(function(F){S[F<0?~F:F]=1}),P.push(N)}}return g(R,w),g(w,R),A.forEach(function(E){S[E<0?~E:E]||P.push([E])}),P}function u(C){return a(C,f.apply(this,arguments))}function f(C,A,S){var w,R,P;if(arguments.length>1)w=d(C,A,S);else for(R=0,w=new Array(P=C.arcs.length);R<P;++R)w[R]=R;return{type:"MultiLineString",arcs:c(C,w)}}function d(C,A,S){var w=[],R=[],P;function O(I){var N=I<0?~I:I;(R[N]||(R[N]=[])).push({i:I,g:P})}function L(I){I.forEach(O)}function g(I){I.forEach(L)}function E(I){I.forEach(g)}function v(I){switch(P=I,I.type){case"GeometryCollection":I.geometries.forEach(v);break;case"LineString":L(I.arcs);break;case"MultiLineString":case"Polygon":g(I.arcs);break;case"MultiPolygon":E(I.arcs);break}}return v(A),R.forEach(S==null?function(I){w.push(I[0].i)}:function(I){S(I[0].g,I[I.length-1].g)&&w.push(I[0].i)}),w}function p(C){for(var A=-1,S=C.length,w,R=C[S-1],P=0;++A<S;)w=R,R=C[A],P+=w[0]*R[1]-w[1]*R[0];return Math.abs(P)}function _(C){return a(C,m.apply(this,arguments))}function m(C,A){var S={},w=[],R=[];A.forEach(P);function P(g){switch(g.type){case"GeometryCollection":g.geometries.forEach(P);break;case"Polygon":O(g.arcs);break;case"MultiPolygon":g.arcs.forEach(O);break}}function O(g){g.forEach(function(E){E.forEach(function(v){(S[v=v<0?~v:v]||(S[v]=[])).push(g)})}),w.push(g)}function L(g){return p(a(C,{type:"Polygon",arcs:[g]}).coordinates[0])}return w.forEach(function(g){if(!g._){var E=[],v=[g];for(g._=1,R.push(E);g=v.pop();)E.push(g),g.forEach(function(I){I.forEach(function(N){S[N<0?~N:N].forEach(function(F){F._||(F._=1,v.push(F))})})})}}),w.forEach(function(g){delete g._}),{type:"MultiPolygon",arcs:R.map(function(g){var E=[],v;if(g.forEach(function(k){k.forEach(function(z){z.forEach(function(B){S[B<0?~B:B].length<2&&E.push(B)})})}),E=c(C,E),(v=E.length)>1)for(var I=1,N=L(E[0]),F,U;I<v;++I)(F=L(E[I]))>N&&(U=E[0],E[0]=E[I],E[I]=U,N=F);return E}).filter(function(g){return g.length>0})}}function y(C,A){for(var S=0,w=C.length;S<w;){var R=S+w>>>1;C[R]<A?S=R+1:w=R}return S}function b(C){var A={},S=C.map(function(){return[]});function w(k,z){k.forEach(function(B){B<0&&(B=~B);var j=A[B];j?j.push(z):A[B]=[z]})}function R(k,z){k.forEach(function(B){w(B,z)})}function P(k,z){k.type==="GeometryCollection"?k.geometries.forEach(function(B){P(B,z)}):k.type in O&&O[k.type](k.arcs,z)}var O={LineString:w,MultiLineString:R,Polygon:R,MultiPolygon:function(k,z){k.forEach(function(B){R(B,z)})}};C.forEach(P);for(var L in A)for(var g=A[L],E=g.length,v=0;v<E;++v)for(var I=v+1;I<E;++I){var N=g[v],F=g[I],U;(U=S[N])[L=y(U,F)]!==F&&U.splice(L,0,F),(U=S[F])[L=y(U,N)]!==N&&U.splice(L,0,N)}return S}function x(C){if(C==null)return t;var A,S,w=C.scale[0],R=C.scale[1],P=C.translate[0],O=C.translate[1];return function(L,g){g||(A=S=0);var E=2,v=L.length,I=new Array(v),N=Math.round((L[0]-P)/w),F=Math.round((L[1]-O)/R);for(I[0]=N-A,A=N,I[1]=F-S,S=F;E<v;)I[E]=L[E],++E;return I}}function T(C,A){if(C.transform)throw new Error("already quantized");if(!A||!A.scale){if(!((O=Math.floor(A))>=2))throw new Error("n must be \u22652");g=C.bbox||i(C);var S=g[0],w=g[1],R=g[2],P=g[3],O;A={scale:[R-S?(R-S)/(O-1):1,P-w?(P-w)/(O-1):1],translate:[S,w]}}else g=C.bbox;var L=x(A),g,E,v=C.objects,I={};function N(k){return L(k)}function F(k){var z;switch(k.type){case"GeometryCollection":z={type:"GeometryCollection",geometries:k.geometries.map(F)};break;case"Point":z={type:"Point",coordinates:N(k.coordinates)};break;case"MultiPoint":z={type:"MultiPoint",coordinates:k.coordinates.map(N)};break;default:return k}return k.id!=null&&(z.id=k.id),k.bbox!=null&&(z.bbox=k.bbox),k.properties!=null&&(z.properties=k.properties),z}function U(k){var z=0,B=1,j=k.length,W,J=new Array(j);for(J[0]=L(k[0],0);++z<j;)((W=L(k[z],z))[0]||W[1])&&(J[B++]=W);return B===1&&(J[B++]=[0,0]),J.length=B,J}for(E in v)I[E]=F(v[E]);return{type:"Topology",bbox:g,transform:A,objects:I,arcs:C.arcs.map(U)}}e.bbox=i,e.feature=r,e.merge=_,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=b,e.quantize=T,e.transform=n,e.untransform=x,Object.defineProperty(e,"__esModule",{value:!0})})});var rm={};Jte(rm,{__addDisposableResource:()=>Qbe,__assign:()=>JH,__asyncDelegator:()=>jbe,__asyncGenerator:()=>Gbe,__asyncValues:()=>Wbe,__await:()=>zv,__awaiter:()=>Bbe,__classPrivateFieldGet:()=>Kbe,__classPrivateFieldIn:()=>Zbe,__classPrivateFieldSet:()=>$be,__createBinding:()=>tG,__decorate:()=>Dbe,__disposeResources:()=>Jbe,__esDecorate:()=>Obe,__exportStar:()=>Ube,__extends:()=>Ibe,__generator:()=>kbe,__importDefault:()=>Xbe,__importStar:()=>Ybe,__makeTemplateObject:()=>qbe,__metadata:()=>Fbe,__param:()=>Rbe,__propKey:()=>Lbe,__read:()=>GK,__rest:()=>Pbe,__rewriteRelativeImportExtension:()=>exe,__runInitializers:()=>Mbe,__setFunctionName:()=>Nbe,__spread:()=>zbe,__spreadArray:()=>Hbe,__spreadArrays:()=>Vbe,__values:()=>eG,default:()=>Blt});function Ibe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");VK(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Pbe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function Dbe(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function Rbe(e,t){return function(n,i){t(n,i,e)}}function Obe(e,t,n,i,o,r){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,_=n.length-1;_>=0;_--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(x){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(x||null))};var b=(0,n[_])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=s(b.get))&&(f.get=d),(d=s(b.set))&&(f.set=d),(d=s(b.init))&&o.unshift(d)}else(d=s(b))&&(a==="field"?o.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function Mbe(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function Lbe(e){return typeof e=="symbol"?e:"".concat(e)}function Nbe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Fbe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Bbe(e,t,n,i){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?r(f.value):o(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function kbe(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Ube(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&tG(t,e,n)}function eG(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function GK(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function zbe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(GK(arguments[t]));return e}function Vbe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],s=0,a=r.length;s<a;s++,o++)i[o]=r[s];return i}function Hbe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function zv(e){return this instanceof zv?(this.v=e,this):new zv(e)}function Gbe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(_){return function(m){return Promise.resolve(m).then(_,d)}}function a(_,m){i[_]&&(o[_]=function(y){return new Promise(function(b,x){r.push([_,y,b,x])>1||c(_,y)})},m&&(o[_]=m(o[_])))}function c(_,m){try{u(i[_](m))}catch(y){p(r[0][3],y)}}function u(_){_.value instanceof zv?Promise.resolve(_.value.v).then(f,d):p(r[0][2],_)}function f(_){c("next",_)}function d(_){c("throw",_)}function p(_,m){_(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function jbe(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(s){return(n=!n)?{value:zv(e[o](s)),done:!1}:r?r(s):s}:r}}function Wbe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof eG=="function"?eG(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(s){return new Promise(function(a,c){s=e[r](s),o(a,c,s.done,s.value)})}}function o(r,s,a,c){Promise.resolve(c).then(function(u){r({value:u,done:a})},s)}}function qbe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Ybe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=HK(e),i=0;i<n.length;i++)n[i]!=="default"&&tG(t,e,n[i]);return Nlt(t,e),t}function Xbe(e){return e&&e.__esModule?e:{default:e}}function Kbe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function $be(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function Zbe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Qbe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function Jbe(e){function t(r){e.error=e.hasError?new Flt(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var r=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(r).then(o,function(s){return t(s),o()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function exe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,o,r,s){return i?t?".jsx":".js":o&&(!r||!s)?n:o+r+"."+s.toLowerCase()+"js"}):e}var VK,JH,tG,Nlt,HK,Flt,Blt,sm=eDe(()=>{VK=function(e,t){return VK=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])},VK(e,t)};JH=function(){return JH=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},JH.apply(this,arguments)};tG=Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};Nlt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},HK=function(e){return HK=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},HK(e)};Flt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Blt={__extends:Ibe,__assign:JH,__rest:Pbe,__decorate:Dbe,__param:Rbe,__esDecorate:Obe,__runInitializers:Mbe,__propKey:Lbe,__setFunctionName:Nbe,__metadata:Fbe,__awaiter:Bbe,__generator:kbe,__createBinding:tG,__exportStar:Ube,__values:eG,__read:GK,__spread:zbe,__spreadArrays:Vbe,__spreadArray:Hbe,__await:zv,__asyncGenerator:Gbe,__asyncDelegator:jbe,__asyncValues:Wbe,__makeTemplateObject:qbe,__importStar:Ybe,__importDefault:Xbe,__classPrivateFieldGet:Kbe,__classPrivateFieldSet:$be,__classPrivateFieldIn:Zbe,__addDisposableResource:Qbe,__disposeResources:Jbe,__rewriteRelativeImportExtension:exe}});var txe=Zn(nG=>{"use strict";Object.defineProperty(nG,"__esModule",{value:!0});nG.version=void 0;nG.version="4.1.5"});var ob=Zn(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});ib.hasOwnProperty=void 0;ib.isBoolean=klt;ib.ellipsis=Ult;ib.removeWithPredicate=zlt;ib.assertNever=Vlt;ib.hasOwnProperty=Object.prototype.hasOwnProperty;function klt(e){return typeof e=="boolean"}function Ult(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 zlt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Vlt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var iG=Zn(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.HtmlTag=yp.whitespaceRe=void 0;var Hlt=ob();yp.whitespaceRe=/\s+/;var Glt=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(yp.whitespaceRe):[],o=t.split(yp.whitespaceRe),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(yp.whitespaceRe):[],o=t.split(yp.whitespaceRe),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)Hlt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();yp.HtmlTag=Glt});var ixe=Zn(WK=>{"use strict";Object.defineProperty(WK,"__esModule",{value:!0});WK.truncateSmart=jlt;function jlt(e,t,n){var i,o;if(n==null?(n="…",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=Wlt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=nxe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=nxe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):jK(c,r,n).substr(0,r+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=r){if((c+u).length==t)return(c+u).substr(0,t);var f=r-c.length;return(c+jK(u,f,n)).substr(0,r+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var p=r-c.length;return(c+jK(d,p,n)).substr(0,r+i)}else c+=d}if(s.scheme&&s.host){var _=s.scheme+"://";if((c+_).length<r)return(_+c).substr(0,t)}if(c.length<=t)return c;var m="";return r>0&&(m=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+m).substr(0,r+i)}function Wlt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function nxe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function jK(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}});var oxe=Zn(qK=>{"use strict";Object.defineProperty(qK,"__esModule",{value:!0});qK.truncateMiddle=qlt;function qlt(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 rxe=Zn(YK=>{"use strict";Object.defineProperty(YK,"__esModule",{value:!0});YK.truncateEnd=Xlt;var Ylt=ob();function Xlt(e,t,n){return(0,Ylt.ellipsis)(e,t,n)}});var XK=Zn(oG=>{"use strict";Object.defineProperty(oG,"__esModule",{value:!0});oG.AnchorTagBuilder=void 0;var Klt=iG(),$lt=ixe(),Zlt=oxe(),Qlt=rxe(),Jlt=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 Klt.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,o=n.location;return o==="smart"?(0,$lt.truncateSmart)(t,i):o==="middle"?(0,Zlt.truncateMiddle)(t,i):(0,Qlt.truncateEnd)(t,i)},e}();oG.AnchorTagBuilder=Jlt});var CC=Zn(rG=>{"use strict";Object.defineProperty(rG,"__esModule",{value:!0});rG.AbstractMatch=void 0;var eut=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}();rG.AbstractMatch=eut});var AC=Zn(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.isControlChar=tut;pf.isAsciiLetterChar=nut;pf.isDigitChar=iut;pf.isQuoteChar=out;pf.isWhitespaceChar=rut;pf.isAlphaNumericOrMarkChar=sut;pf.isValidEmailLocalPartSpecialChar=aut;pf.isUrlSuffixAllowedSpecialChar=cut;pf.isUrlSuffixNotAllowedAsFinalChar=lut;pf.isOpenBraceChar=uut;pf.isCloseBraceChar=fut;function tut(e){return e>=0&&e<=31||e==127}function nut(e){return e>=65&&e<=90||e>=97&&e<=122}function iut(e){return e>=48&&e<=57}function out(e){return e==34||e==39}function rut(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function sut(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function aut(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function cut(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function lut(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function uut(e){return e<91?e==40:e==91||e==123}function fut(e){return e<93?e==41:e==93||e==125}});var sxe=Zn(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});sG.tldRegex=void 0;sG.tldRegex=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/});var aG=Zn(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.isDomainLabelStartChar=Oo.isSchemeStartChar=Oo.tldUrlHostRe=Oo.schemeUrlRe=Oo.invalidSchemeRe=Oo.httpSchemePrefixRe=Oo.httpSchemeRe=void 0;Oo.isSchemeChar=hut;Oo.isDomainLabelChar=mut;Oo.isPathChar=put;Oo.isUrlSuffixStartChar=_ut;Oo.isKnownTld=axe;Oo.isValidSchemeUrl=gut;Oo.isValidTldMatch=yut;Oo.isValidIpV4Address=Tut;var EC=AC(),dut=sxe();Oo.httpSchemeRe=/https?:\/\//i;Oo.httpSchemePrefixRe=new RegExp("^"+Oo.httpSchemeRe.source,"i");Oo.invalidSchemeRe=/^(javascript|vbscript):/i;Oo.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Oo.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Oo.isSchemeStartChar=EC.isAsciiLetterChar;function hut(e){return(0,EC.isAsciiLetterChar)(e)||(0,EC.isDigitChar)(e)||e===43||e===45||e===46}Oo.isDomainLabelStartChar=EC.isAlphaNumericOrMarkChar;function mut(e){return e===95||(0,Oo.isDomainLabelStartChar)(e)}function put(e){return(0,EC.isAlphaNumericOrMarkChar)(e)||(0,EC.isUrlSuffixAllowedSpecialChar)(e)||(0,EC.isUrlSuffixNotAllowedAsFinalChar)(e)}function _ut(e){return e===47||e===63||e===35}function axe(e){return dut.tldRegex.test(e.toLowerCase())}function gut(e){if(Oo.invalidSchemeRe.test(e))return!1;var t=e.match(Oo.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function yut(e){var t=e.match(Oo.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!axe(o)}var but=/^(?:(?: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]?)$/,xut=/[:/?#]/;function Tut(e){var t=e.split(xut,1)[0];return but.test(t)}});var KK=Zn(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});cG.UrlMatch=void 0;var Cut=(sm(),eh(rm)),Aut=CC(),Eut=aG(),Sut=/^(https?:\/\/)?(?:www\.)?/i,vut=/^\/\//,wut=function(e){Cut.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Dut(n)),this.stripPrefix.scheme&&(n=Iut(n)),this.stripPrefix.www&&(n=Put(n)),this.stripTrailingSlash&&(n=Rut(n)),this.decodePercentEncoding&&(n=Out(n)),n},t}(Aut.AbstractMatch);cG.UrlMatch=wut;function Iut(e){return e.replace(Eut.httpSchemePrefixRe,"")}function Put(e){return e.includes("www.")?e.replace(Sut,"$1"):e}function Dut(e){return e.replace(vut,"")}function Rut(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Out(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}});var lxe=Zn(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.isEmailLocalPartStartChar=Hg.mailtoSchemePrefixRe=void 0;Hg.isEmailLocalPartChar=Lut;Hg.isValidEmail=Nut;var cxe=AC(),Mut=aG();Hg.mailtoSchemePrefixRe=/^mailto:/i;Hg.isEmailLocalPartStartChar=cxe.isAlphaNumericOrMarkChar;function Lut(e){return(0,Hg.isEmailLocalPartStartChar)(e)||(0,cxe.isValidEmailLocalPartSpecialChar)(e)}function Nut(e){var t=e.split(".").pop();return(0,Mut.isKnownTld)(t)}});var $K=Zn(lG=>{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});lG.EmailMatch=void 0;var Fut=(sm(),eh(rm)),But=CC(),kut=function(e){Fut.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(But.AbstractMatch);lG.EmailMatch=kut});var ZK=Zn(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});Vv.hashtagServices=void 0;Vv.isHashtagTextChar=zut;Vv.isValidHashtag=Vut;var Uut=AC();function zut(e){return e===95||(0,Uut.isAlphaNumericOrMarkChar)(e)}function Vut(e){return e.length<=140}Vv.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var QK=Zn(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});uG.HashtagMatch=void 0;var Hut=(sm(),eh(rm)),Gut=ob(),jut=CC(),Wut=function(e){Hut.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:(0,Gut.assertNever)(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(jut.AbstractMatch);uG.HashtagMatch=Wut});var JK=Zn(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});Hv.mentionServices=void 0;Hv.isMentionTextChar=Yut;Hv.isValidMention=Xut;var uxe=AC(),qut={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Yut(e){return e===45||e===46||e===95||(0,uxe.isAsciiLetterChar)(e)||(0,uxe.isDigitChar)(e)}function Xut(e,t){var n=qut[t];return n.test(e)}Hv.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var e$=Zn(fG=>{"use strict";Object.defineProperty(fG,"__esModule",{value:!0});fG.MentionMatch=void 0;var Kut=(sm(),eh(rm)),$ut=ob(),Zut=CC(),Qut=function(e){Kut.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:(0,$ut.assertNever)(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Zut.AbstractMatch);fG.MentionMatch=Qut});var fxe=Zn(N2=>{"use strict";Object.defineProperty(N2,"__esModule",{value:!0});N2.isPhoneNumberSeparatorChar=ift;N2.isPhoneNumberControlChar=oft;N2.isValidPhoneNumber=rft;var Jut=/[-. ()]/,eft=/(?:(?:(?:(\+)?\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]+#?)*/,tft=/(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})/,nft=new RegExp("^".concat(eft.source,"|").concat(tft.source,"$"));function ift(e){return e===45||e===46||e===32}function oft(e){return e===44||e===59}function rft(e){var t=e.charAt(0)==="+"||Jut.test(e);return t&&nft.test(e)}});var t$=Zn(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});dG.PhoneMatch=void 0;var sft=(sm(),eh(rm)),aft=CC(),cft=function(e){sft.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(aft.AbstractMatch);dG.PhoneMatch=cft});var s$=Zn(_G=>{"use strict";Object.defineProperty(_G,"__esModule",{value:!0});_G.parseMatches=pft;_G.excludeUnbalancedTrailingBracesAndPunctuation=mxe;var lft=KK(),hG=ob(),dr=aG(),Gv=lxe(),uft=$K(),o$=ZK(),fft=QK(),r$=JK(),dft=e$(),jv=fxe(),hft=t$(),Ds=AC(),mft=function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),hxe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),hxe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e}();function pft(e,t){for(var n=new mft(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)mG(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:Tft(n,s,o);break;case 12:Cft(n,s,o);break;case 0:_ft(n,s,o);break;case 1:gft(n,s,o);break;case 2:yft(n,s,o);break;case 3:bft(n,s,o);break;case 4:xft(n,s,i,o);break;case 5:Aft(n,s,o);break;case 6:Eft(n,s,i,o);break;case 7:Sft(n,s,i,o);break;case 13:vft(n,s,o);break;case 14:wft(n,s,o);break;case 8:Ift(n,s,o);break;case 9:Pft(n,s,o);break;case 10:Dft(n,s,o);break;case 15:Rft(n,s,i,o);break;case 16:Oft(n,s,i,o);break;case 17:Mft(n,s,i,o);break;case 18:Lft(n,s,i,o);break;case 19:Nft(n,s,i,o);break;case 20:Fft(n,s,o);break;case 21:Bft(n,s,o);break;case 22:SC(n,s,o);break;case 23:kft(n,s,o);break;case 24:Uft(n,s,o);break;case 25:zft(n,s,o);break;case 26:Vft(n,s,o);break;case 27:Hft(n,s,o);break;case 28:Gft(n,s,o);break;case 29:jft(n,s,o);break;case 30:Wft(n,s,o);break;case 31:qft(n,s,o);break;case 32:Xft(n,s,i,o);break;case 33:Kft(n,s,o);break;case 34:$ft(n,s,o);break;case 35:Zft(n,s,o);break;case 36:Qft(n,s,i,o);break;case 37:Yft(n,s,i,o);break;case 38:Jft(n,s,i,o);break;case 39:edt(n,s,i,o);break;case 40:tdt(n,s,o);break;case 41:ndt(n,s,o);break;default:(0,hG.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,dr.isSchemeStartChar)(o)){var a=n.text.charCodeAt(n.charIdx-1);(0,dr.isSchemeStartChar)(a)||n.addMachine(pG(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return is(n,u)});return n.matches}function mG(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(sdt(i,28));else if(n===64)e.addMachine(adt(i,30));else if(n===47)e.addMachine(i$(i,11));else if(n===43)e.addMachine(n$(i,37));else if(n===40)e.addMachine(n$(i,32));else{if((0,Ds.isDigitChar)(n)&&(e.addMachine(n$(i,38)),e.addMachine(odt(i,13))),(0,Gv.isEmailLocalPartStartChar)(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(rdt(i,o))}(0,dr.isSchemeStartChar)(n)&&e.addMachine(pG(i,0)),(0,Ds.isAlphaNumericOrMarkChar)(n)&&e.addMachine(i$(i,5))}}function _ft(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,dr.isSchemeChar)(n)||e.removeMachine(t)}function gft(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(i$(i,11))):(0,dr.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function yft(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,dr.isDomainLabelStartChar)(n)?(t.state=5,(0,dr.isSchemeStartChar)(n)&&e.addMachine(pG(i,0))):e.removeMachine(t)}function bft(e,t,n){n===47?t.state=4:(0,dr.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):is(e,t)}function xft(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,dr.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function Tft(e,t,n){n===47?t.state=12:e.removeMachine(t)}function Cft(e,t,n){(0,dr.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function Aft(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,dr.isUrlSuffixStartChar)(n)?t.state=10:(0,dr.isDomainLabelChar)(n)||is(e,t)}function Eft(e,t,n,i){i===45||(i===46?is(e,t):(0,dr.isDomainLabelStartChar)(i)?t.state=5:is(e,t))}function Sft(e,t,n,i){i===46?is(e,t):(0,dr.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):is(e,t)}function vft(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,Ds.isDigitChar)(n)||((0,dr.isUrlSuffixStartChar)(n)?t.state=10:(0,Ds.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):is(e,t))}function wft(e,t,n){(0,Ds.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):is(e,t)}function Ift(e,t,n){(0,Ds.isDigitChar)(n)?t.state=9:is(e,t)}function Pft(e,t,n){(0,Ds.isDigitChar)(n)||((0,dr.isUrlSuffixStartChar)(n)?t.state=10:is(e,t))}function Dft(e,t,n){(0,dr.isPathChar)(n)||is(e,t)}function Rft(e,t,n,i){n.toLowerCase()==="a"?t.state=16:SC(e,t,i)}function Oft(e,t,n,i){n.toLowerCase()==="i"?t.state=17:SC(e,t,i)}function Mft(e,t,n,i){n.toLowerCase()==="l"?t.state=18:SC(e,t,i)}function Lft(e,t,n,i){n.toLowerCase()==="t"?t.state=19:SC(e,t,i)}function Nft(e,t,n,i){n.toLowerCase()==="o"?t.state=20:SC(e,t,i)}function Fft(e,t,n){n===58?t.state=21:SC(e,t,n)}function Bft(e,t,n){(0,Gv.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function SC(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,Gv.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function kft(e,t,n){n===46||n===64?e.removeMachine(t):(0,Gv.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function Uft(e,t,n){(0,dr.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function zft(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,dr.isDomainLabelChar)(n)||is(e,t)}function Vft(e,t,n){n===45||n===46?is(e,t):(0,dr.isDomainLabelChar)(n)?t.state=25:is(e,t)}function Hft(e,t,n){n===46||n===45?is(e,t):(0,dr.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):is(e,t)}function Gft(e,t,n){(0,o$.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function jft(e,t,n){(0,o$.isHashtagTextChar)(n)||is(e,t)}function Wft(e,t,n){(0,r$.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function qft(e,t,n){(0,r$.isMentionTextChar)(n)||((0,Ds.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):is(e,t))}function Yft(e,t,n,i){(0,Ds.isDigitChar)(i)?t.state=38:(e.removeMachine(t),mG(e,n,i))}function Xft(e,t,n,i){(0,Ds.isDigitChar)(i)?t.state=33:e.removeMachine(t),mG(e,n,i)}function Kft(e,t,n){(0,Ds.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function $ft(e,t,n){(0,Ds.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function Zft(e,t,n){n===41?t.state=36:e.removeMachine(t)}function Qft(e,t,n,i){(0,Ds.isDigitChar)(i)?t.state=38:(0,jv.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function Jft(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,(0,jv.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,Ds.isDigitChar)(i)||(i===40?t.state=32:(0,jv.isPhoneNumberSeparatorChar)(i)?t.state=39:(is(e,t),(0,dr.isSchemeStartChar)(i)&&e.addMachine(pG(o,0))))}function edt(e,t,n,i){(0,Ds.isDigitChar)(i)?t.state=38:i===40?t.state=32:(is(e,t),mG(e,n,i))}function tdt(e,t,n){(0,jv.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,Ds.isDigitChar)(n)?t.state=38:is(e,t))}function ndt(e,t,n){(0,jv.isPhoneNumberControlChar)(n)?t.state=40:(0,Ds.isDigitChar)(n)?e.removeMachine(t):is(e,t)}function is(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,o);switch(p=mxe(p),t.type){case 0:{var _=i.charCodeAt(t.startIdx-1);if(_===64)return;switch(t.matchType){case 0:{var m=dr.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,dr.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,dr.isValidTldMatch)(p))return;break}case 2:{if(!(0,dr.isValidIpV4Address)(p))return;break}default:(0,hG.assertNever)(t)}n.push(new lft.UrlMatch({tagBuilder:r,matchedText:p,offset:d,urlMatchType:idt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,Gv.isValidEmail)(p)&&n.push(new uft.EmailMatch({tagBuilder:r,matchedText:p,offset:d,email:p.replace(Gv.mailtoSchemePrefixRe,"")}));break}case 2:{(0,o$.isValidHashtag)(p)&&n.push(new fft.HashtagMatch({tagBuilder:r,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,r$.isValidMention)(p,f)&&n.push(new dft.MentionMatch({tagBuilder:r,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,jv.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new hft.PhoneMatch({tagBuilder:r,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,hG.assertNever)(t)}}}function idt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,hG.assertNever)(e)}}var dxe={")":"(","}":"{","]":"["};function mxe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);(0,Ds.isOpenBraceChar)(o)?t[i]++:(0,Ds.isCloseBraceChar)(o)&&t[dxe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if((0,Ds.isCloseBraceChar)(o)){var s=dxe[i];if(t[s]<0)t[s]++,r--;else break}else if((0,Ds.isUrlSuffixNotAllowedAsFinalChar)(o))r--;else break}return e.slice(0,r+1)}function pG(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function i$(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function odt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function rdt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function sdt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function adt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function n$(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function hxe(e){return e.type===0&&e.matchType===0}});var pxe=Zn(l$=>{"use strict";Object.defineProperty(l$,"__esModule",{value:!0});l$.parseHtml=udt;var Wc=(sm(),eh(rm)),Fl=AC(),cdt=ob(),bp=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}(),c$=new bp,ldt=function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=c$,this.html=t,this.callbacks=n}return e}();function udt(e,t){for(var n=new ldt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:fdt(n,o);break;case 1:ddt(n,o,r);break;case 2:mdt(n,o,r);break;case 3:hdt(n,o,r);break;case 4:pdt(n,o,r);break;case 5:_dt(n,o,r);break;case 6:gdt(n,o,r);break;case 7:ydt(n,o,r);break;case 8:bdt(n,o);break;case 9:xdt(n,o);break;case 10:Tdt(n,o,r);break;case 11:Cdt(n,o,r);break;case 12:Adt(n,o);break;case 13:Edt(n);break;case 14:Sdt(n,o);break;case 15:vdt(n,o);break;case 16:wdt(n,o);break;case 17:Idt(n,o);break;case 18:Pdt(n,o);break;case 19:Ddt(n,o);break;case 20:Rdt(n,o);break;default:(0,cdt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&Odt(n)}function fdt(e,t){t==="<"&&xp(e)}function ddt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?xp(e):(0,Fl.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=c$)}function hdt(e,t,n){(0,Fl.isWhitespaceChar)(n)?(e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{name:a$(e)})),e.state=4):t==="<"?xp(e):t==="/"?(e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{name:a$(e)})),e.state=12):t===">"?(e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{name:a$(e)})),Tp(e)):!(0,Fl.isAsciiLetterChar)(n)&&!(0,Fl.isDigitChar)(n)&&t!==":"&&Nd(e)}function mdt(e,t,n){t===">"?Nd(e):(0,Fl.isAsciiLetterChar)(n)?e.state=3:Nd(e)}function pdt(e,t,n){(0,Fl.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?Tp(e):t==="<"?xp(e):t==="="||(0,Fl.isQuoteChar)(n)||(0,Fl.isControlChar)(n)?Nd(e):e.state=5)}function _dt(e,t,n){(0,Fl.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Tp(e):t==="<"?xp(e):(0,Fl.isQuoteChar)(n)&&Nd(e)}function gdt(e,t,n){(0,Fl.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Tp(e):t==="<"?xp(e):(0,Fl.isQuoteChar)(n)?Nd(e):e.state=5)}function ydt(e,t,n){(0,Fl.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Nd(e):t==="<"?xp(e):e.state=10)}function bdt(e,t){t==='"'&&(e.state=11)}function xdt(e,t){t==="'"&&(e.state=11)}function Tdt(e,t,n){(0,Fl.isWhitespaceChar)(n)?e.state=4:t===">"?Tp(e):t==="<"&&xp(e)}function Cdt(e,t,n){(0,Fl.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?Tp(e):t==="<"?xp(e):(e.state=4,Mdt(e))}function Adt(e,t){t===">"?(e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{isClosing:!0})),Tp(e)):Nd(e)}function Edt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new bp(Wc.__assign(Wc.__assign({},e.currentTag),{type:"doctype"})),e.state=20):Nd(e)}function Sdt(e,t){t==="-"?e.state=15:t===">"?Nd(e):e.state=16}function vdt(e,t){t==="-"?e.state=18:t===">"?Nd(e):e.state=16}function wdt(e,t){t==="-"&&(e.state=17)}function Idt(e,t){t==="-"?e.state=18:e.state=16}function Pdt(e,t){t===">"?Tp(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function Ddt(e,t){t==="-"?e.state=17:t===">"?Tp(e):e.state=16}function Rdt(e,t){t===">"?Tp(e):t==="<"&&xp(e)}function Nd(e){e.state=0,e.currentTag=c$}function xp(e){e.state=1,e.currentTag=new bp({idx:e.charIdx})}function Tp(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Nd(e),e.currentDataIdx=e.charIdx+1}function Odt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function a$(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function Mdt(e){e.charIdx--}});var gG=Zn(f$=>{"use strict";Object.defineProperty(f$,"__esModule",{value:!0});var u$=(sm(),eh(rm)),Ldt=txe(),ha=ob(),Ndt=XK(),Fdt=iG(),Bdt=s$(),kdt=pxe(),Udt=JK(),zdt=ZK(),Vdt=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=Hdt(t.urls),this.email=(0,ha.isBoolean)(t.email)?t.email:this.email,this.phone=(0,ha.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,ha.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Gdt(t.stripPrefix),this.stripTrailingSlash=(0,ha.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,ha.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Udt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&zdt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=jdt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return(0,kdt.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var _=n.parseText(d,f);r.push.apply(r,u$.__spreadArray([],u$.__read(_),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(Wdt);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,ha.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,Bdt.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof Fdt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Ndt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Ldt.version,e}();f$.default=Vdt;function Hdt(e){return e==null&&(e=!0),(0,ha.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,ha.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,ha.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,ha.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function Gdt(e){return e==null&&(e=!0),(0,ha.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,ha.isBoolean)(e.scheme)?e.scheme:!0,www:(0,ha.isBoolean)(e.www)?e.www:!0}}function jdt(e){return typeof e=="number"?{length:e,location:"end"}:u$.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function Wdt(e,t){return e.getOffset()-t.getOffset()}});var gxe=Zn(_xe=>{"use strict";Object.defineProperty(_xe,"__esModule",{value:!0})});var yxe=Zn(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});var vC=(sm(),eh(rm));vC.__exportStar(gxe(),Gg);vC.__exportStar($K(),Gg);vC.__exportStar(QK(),Gg);vC.__exportStar(CC(),Gg);vC.__exportStar(e$(),Gg);vC.__exportStar(t$(),Gg);vC.__exportStar(KK(),Gg)});var bxe=Zn(d$=>{"use strict";Object.defineProperty(d$,"__esModule",{value:!0});var qdt=(sm(),eh(rm));qdt.__exportStar(s$(),d$)});var h$=Zn((am,Txe)=>{"use strict";am=Txe.exports=gG().default;Object.defineProperty(am,"__esModule",{value:!0});am.Autolinker=void 0;var Wv=(sm(),eh(rm)),xxe=Wv.__importDefault(gG());am.Autolinker=xxe.default;am.default=xxe.default;Wv.__exportStar(gG(),am);Wv.__exportStar(XK(),am);Wv.__exportStar(iG(),am);Wv.__exportStar(yxe(),am);Wv.__exportStar(bxe(),am)});var sZ=Zn((exports,module)=>{/*! - * 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,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var y=new Array(arguments.length-1),b=0;b<y.length;)y[b++]=arguments[b];d.apply(null,y)}};try{o.apply(r||null,s)}catch(_){u&&(u=!1,p(_))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,_=[],m=0,y=0,b;f<d;){var x=u[f++];switch(y){case 0:_[m++]=o[x>>2],b=(x&3)<<4,y=1;break;case 1:_[m++]=o[b|x>>4],b=(x&15)<<2,y=2;break;case 2:_[m++]=o[b|x>>6],_[m++]=o[x&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,_)),m=0)}return y&&(_[m++]=o[b],_[m++]=61,y===1&&(_[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,_.slice(0,m))),p.join("")):String.fromCharCode.apply(String,_.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,_=0,m,y=0;y<u.length;){var b=u.charCodeAt(y++);if(b===61&&_>1)break;if((b=r[b])===undefined)throw Error(a);switch(_){case 0:m=b,_=1;break;case 1:f[d++]=m<<2|(b&48)>>4,m=b,_=2;break;case 2:f[d++]=(m&15)<<4|(b&60)>>2,m=b,_=3;break;case 3:f[d++]=(m&3)<<6|b,_=0;break}}if(_===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(b,x,T){u[0]=b,x[T]=f[0],x[T+1]=f[1],x[T+2]=f[2],x[T+3]=f[3]}function _(b,x,T){u[0]=b,x[T]=f[3],x[T+1]=f[2],x[T+2]=f[1],x[T+3]=f[0]}c.writeFloatLE=d?p:_,c.writeFloatBE=d?_:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],u[0]}function y(b,x){return f[3]=b[x],f[2]=b[x+1],f[1]=b[x+2],f[0]=b[x+3],u[0]}c.readFloatLE=d?m:y,c.readFloatBE=d?y:m}():function(){function u(d,p,_,m){var y=p<0?1:0;if(y&&(p=-p),p===0)d(1/p>0?0:2147483648,_,m);else if(isNaN(p))d(2143289344,_,m);else if(p>34028234663852886e22)d((y<<31|2139095040)>>>0,_,m);else if(p<11754943508222875e-54)d((y<<31|Math.round(p/1401298464324817e-60))>>>0,_,m);else{var b=Math.floor(Math.log(p)/Math.LN2),x=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((y<<31|b+127<<23|x)>>>0,_,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,_){var m=d(p,_),y=(m>>31)*2+1,b=m>>>23&255,x=m&8388607;return b===255?x?NaN:y*(1/0):b===0?y*1401298464324817e-60*x:y*Math.pow(2,b-150)*(x+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,x,T){u[0]=b,x[T]=f[0],x[T+1]=f[1],x[T+2]=f[2],x[T+3]=f[3],x[T+4]=f[4],x[T+5]=f[5],x[T+6]=f[6],x[T+7]=f[7]}function _(b,x,T){u[0]=b,x[T]=f[7],x[T+1]=f[6],x[T+2]=f[5],x[T+3]=f[4],x[T+4]=f[3],x[T+5]=f[2],x[T+6]=f[1],x[T+7]=f[0]}c.writeDoubleLE=d?p:_,c.writeDoubleBE=d?_:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],f[4]=b[x+4],f[5]=b[x+5],f[6]=b[x+6],f[7]=b[x+7],u[0]}function y(b,x){return f[7]=b[x],f[6]=b[x+1],f[5]=b[x+2],f[4]=b[x+3],f[3]=b[x+4],f[2]=b[x+5],f[1]=b[x+6],f[0]=b[x+7],u[0]}c.readDoubleLE=d?m:y,c.readDoubleBE=d?y:m}():function(){function u(d,p,_,m,y,b){var x=m<0?1:0;if(x&&(m=-m),m===0)d(0,y,b+p),d(1/m>0?0:2147483648,y,b+_);else if(isNaN(m))d(0,y,b+p),d(2146959360,y,b+_);else if(m>17976931348623157e292)d(0,y,b+p),d((x<<31|2146435072)>>>0,y,b+_);else{var T;if(m<22250738585072014e-324)T=m/5e-324,d(T>>>0,y,b+p),d((x<<31|T/4294967296)>>>0,y,b+_);else{var C=Math.floor(Math.log(m)/Math.LN2);C===1024&&(C=1023),T=m*Math.pow(2,-C),d(T*4503599627370496>>>0,y,b+p),d((x<<31|C+1023<<20|T*1048576&1048575)>>>0,y,b+_)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,_,m,y){var b=d(m,y+p),x=d(m,y+_),T=(x>>31)*2+1,C=x>>>20&2047,A=4294967296*(x&1048575)+b;return C===2047?A?NaN:T*(1/0):C===0?T*5e-324*A:T*Math.pow(2,C-1075)*(A+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var _=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),_}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=r[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(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,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d<r.length;++d)u=r.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=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")},f=function(){return i.Buffer?function(b){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):u(T)})(b)}:u};c.create=f(),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 d(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[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 _(){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(),b=this.pos,x=this.pos+y;if(x>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(b,x);if(b===x){var T=i.Buffer;return T?T.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,x)},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(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[y](!1)},uint64:function(){return d.call(this)[y](!0)},sint64:function(){return d.call(this).zzDecode()[y](!1)},fixed64:function(){return _.call(this)[y](!0)},sfixed64:function(){return _.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,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(_,m){if(_)return d.emit("error",_,s),f(_);if(m===null)return d.end(!0),undefined;if(!(m instanceof c))try{m=c[d.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return d.emit("error",y,s),f(y)}return d.emit("data",m,s),f(null,m)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(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,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(C,A,S){this.fn=C,this.len=A,this.next=undefined,this.val=S}function u(){}function f(C){this.head=C.head,this.tail=C.tail,this.len=C.len,this.next=C.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new o})()}:function(){return new d}};d.create=p(),d.alloc=function(A){return new i.Array(A)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(A,S,w){return this.tail=this.tail.next=new c(A,S,w),this.len+=S,this};function _(C,A,S){A[S]=C&255}function m(C,A,S){for(;C>127;)A[S++]=C&127|128,C>>>=7;A[S]=C}function y(C,A){this.len=C,this.next=undefined,this.val=A}y.prototype=Object.create(c.prototype),y.prototype.fn=m,d.prototype.uint32=function(A){return this.len+=(this.tail=this.tail.next=new y((A=A>>>0)<128?1:A<16384?2:A<2097152?3:A<268435456?4:5,A)).len,this},d.prototype.int32=function(A){return A<0?this._push(b,10,r.fromNumber(A)):this.uint32(A)},d.prototype.sint32=function(A){return this.uint32((A<<1^A>>31)>>>0)};function b(C,A,S){for(;C.hi;)A[S++]=C.lo&127|128,C.lo=(C.lo>>>7|C.hi<<25)>>>0,C.hi>>>=7;for(;C.lo>127;)A[S++]=C.lo&127|128,C.lo=C.lo>>>7;A[S++]=C.lo}d.prototype.uint64=function(A){var S=r.from(A);return this._push(b,S.length(),S)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(A){var S=r.from(A).zzEncode();return this._push(b,S.length(),S)},d.prototype.bool=function(A){return this._push(_,1,A?1:0)};function x(C,A,S){A[S]=C&255,A[S+1]=C>>>8&255,A[S+2]=C>>>16&255,A[S+3]=C>>>24}d.prototype.fixed32=function(A){return this._push(x,4,A>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(A){var S=r.from(A);return this._push(x,4,S.lo)._push(x,4,S.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(A){return this._push(i.float.writeFloatLE,4,A)},d.prototype.double=function(A){return this._push(i.float.writeDoubleLE,8,A)};var T=i.Array.prototype.set?function(A,S,w){S.set(A,w)}:function(A,S,w){for(var R=0;R<A.length;++R)S[w+R]=A[R]};d.prototype.bytes=function(A){var S=A.length>>>0;if(!S)return this._push(_,1,0);if(i.isString(A)){var w=d.alloc(S=s.length(A));s.decode(A,w,0),A=w}return this.uint32(S)._push(T,S,A)},d.prototype.string=function(A){var S=a.length(A);return S?this.uint32(S)._push(a.write,S,A):this._push(_,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var A=this.head,S=this.tail,w=this.len;return this.reset().uint32(w),w&&(this.tail.next=A.next,this.tail=S,this.len+=w),this},d.prototype.finish=function(){for(var A=this.head.next,S=this.constructor.alloc(this.len),w=0;A;)A.fn(A.val,S,w),w+=A.len,A=A.next;return S},d._configure=function(C){o=C,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var hwe=Zn((Bji,g6)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,_=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,y=r(_,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),b={width:_.width,height:_.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:_.pixels.maxValue,noDataValue:m};return y.resultMask&&(b.maskData=y.resultMask),d.returnEncodedMask&&_.mask&&(b.encodedMaskData=_.mask.bitset?_.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(_),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(_))),b};var r=function(f,d,p,_,m){var y=0,b=f.pixels.numBlocksX,x=f.pixels.numBlocksY,T=Math.floor(f.width/b),C=Math.floor(f.height/x),A=2*f.maxZError,S=Number.MAX_VALUE,w;p=p||(f.mask?f.mask.bitset:null);var R,P;R=new d(f.width*f.height),m&&p&&(P=new Uint8Array(f.width*f.height));for(var O=new Float32Array(T*C),L,g,E=0;E<=x;E++){var v=E!==x?C:f.height%x;if(v!==0)for(var I=0;I<=b;I++){var N=I!==b?T:f.width%b;if(N!==0){var F=E*f.width*C+I*T,U=f.width-N,k=f.pixels.blocks[y],z,B,j;k.encoding<2?(k.encoding===0?z=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,A,O,f.pixels.maxValue),z=O),B=0):k.encoding===2?j=0:j=k.offset;var W;if(p)for(g=0;g<v;g++){for(F&7&&(W=p[F>>3],W<<=F&7),L=0;L<N;L++)F&7||(W=p[F>>3]),W&128?(P&&(P[F]=1),w=k.encoding<2?z[B++]:j,S=S>w?w:S,R[F++]=w):(P&&(P[F]=0),R[F++]=_),W<<=1;F+=U}else if(k.encoding<2)for(g=0;g<v;g++){for(L=0;L<N;L++)w=z[B++],S=S>w?w:S,R[F++]=w;F+=U}else for(S=S>j?j:S,g=0;g<v;g++){for(L=0;L<N;L++)R[F++]=j;F+=U}if(k.encoding===1&&B!==k.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:R,resultMask:P,minValue:S}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},_=0;_<d;_++){var m=f.pixels.blocks[_];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var _={},m=new Uint8Array(f,d,10);if(_.fileIdentifierString=String.fromCharCode.apply(null,m),_.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+_.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(_.fileVersion=y.getInt32(0,!0),_.imageType=y.getInt32(4,!0),_.height=y.getUint32(8,!0),_.width=y.getUint32(12,!0),_.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),_.mask={},_.mask.numBlocksY=y.getUint32(0,!0),_.mask.numBlocksX=y.getUint32(4,!0),_.mask.numBytes=y.getUint32(8,!0),_.mask.maxValue=y.getFloat32(12,!0),d+=16,_.mask.numBytes>0){var b=new Uint8Array(Math.ceil(_.width*_.height/8));y=new DataView(f,d,_.mask.numBytes);var x=y.getInt16(0,!0),T=2,C=0;do{if(x>0)for(;x--;)b[C++]=y.getUint8(T++);else{var A=y.getUint8(T++);for(x=-x;x--;)b[C++]=A}x=y.getInt16(T,!0),T+=2}while(T<_.mask.numBytes);if(x!==-32768||C<b.length)throw"Unexpected end of mask RLE encoding";_.mask.bitset=b,d+=_.mask.numBytes}else(_.mask.numBytes|_.mask.numBlocksY|_.mask.maxValue)===0&&(_.mask.bitset=new Uint8Array(Math.ceil(_.width*_.height/8)));y=new DataView(f,d,16),_.pixels={},_.pixels.numBlocksY=y.getUint32(0,!0),_.pixels.numBlocksX=y.getUint32(4,!0),_.pixels.numBytes=y.getUint32(8,!0),_.pixels.maxValue=y.getFloat32(12,!0),d+=16;var S=_.pixels.numBlocksX,w=_.pixels.numBlocksY,R=S+(_.width%S>0?1:0),P=w+(_.height%w>0?1:0);_.pixels.blocks=new Array(R*P);for(var O=0,L=0;L<P;L++)for(var g=0;g<R;g++){var E=0,v=f.byteLength-d;y=new DataView(f,d,Math.min(10,v));var I={};_.pixels.blocks[O++]=I;var N=y.getUint8(0);if(E++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),E++;else if(N===1)I.offset=y.getInt16(1,!0),E+=2;else if(N===0)I.offset=y.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(E),E++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(E),E++;else if(N===1)I.numValidPixels=y.getUint16(E,!0),E+=2;else if(N===0)I.numValidPixels=y.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,I.encoding!==3){var F,U;if(I.encoding===0){var k=(_.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";F=new ArrayBuffer(k*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,k*4));var z=new Float32Array(F);I.rawData=z,d+=k*4}else if(I.encoding===1){var B=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),j=Math.ceil(B/4);F=new ArrayBuffer(j*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,B)),I.stuffedData=new Uint32Array(F),d+=B}}}return _.eofOffset=d,_},u=function(f,d,p,_,m,y,b){var x=(1<<d)-1,T=0,C,A=0,S,w,R=Math.ceil((b-_)/m),P=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*P,C=0;C<p;C++){if(A===0&&(w=f[T++],A=32),A>=d)S=w>>>A-d&x,A-=d;else{var O=d-A;S=(w&x)<<O&x,w=f[T++],A=32-O,S+=w>>>A}y[C]=S<R?_+S*m:b}return y};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,d,p,_,m,y){var b=(1<<f)-1,x=0,T,C=0,A,S,w,R,P=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*P,p)for(T=0;T<d;T++)C===0&&(S=c[x++],C=32),C>=f?(A=S>>>C-f&b,C-=f):(w=f-C,A=(S&b)<<w&b,S=c[x++],C=32-w,A+=S>>>C),u[T]=p[A];else for(R=Math.ceil((y-_)/m),T=0;T<d;T++)C===0&&(S=c[x++],C=32),C>=f?(A=S>>>C-f&b,C-=f):(w=f-C,A=(S&b)<<w&b,S=c[x++],C=32-w,A+=S>>>C),u[T]=A<R?_+A*m:y},unstuffLUT:function(c,u,f,d,p,_){var m=(1<<u)-1,y=0,b=0,x=0,T=0,C=0,A,S=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var R=Math.ceil((_-d)/p);for(b=0;b<f;b++)T===0&&(A=c[y++],T=32),T>=u?(C=A>>>T-u&m,T-=u):(x=u-T,C=(A&m)<<x&m,A=c[y++],T=32-x,C+=A>>>T),S[b]=C<R?d+C*p:_;return S.unshift(d),S},unstuff2:function(c,u,f,d,p,_,m,y){var b=(1<<f)-1,x=0,T,C=0,A=0,S,w,R;if(p)for(T=0;T<d;T++)C===0&&(w=c[x++],C=32,A=0),C>=f?(S=w>>>A&b,C-=f,A+=f):(R=f-C,S=w>>>A&b,w=c[x++],C=32-R,S|=(w&(1<<R)-1)<<f-R,A=R),u[T]=p[S];else{var P=Math.ceil((y-_)/m);for(T=0;T<d;T++)C===0&&(w=c[x++],C=32,A=0),C>=f?(S=w>>>A&b,C-=f,A+=f):(R=f-C,S=w>>>A&b,w=c[x++],C=32-R,S|=(w&(1<<R)-1)<<f-R,A=R),u[T]=S<P?_+S*m:y}return u},unstuffLUT2:function(c,u,f,d,p,_){var m=(1<<u)-1,y=0,b=0,x=0,T=0,C=0,A=0,S,w=[],R=Math.ceil((_-d)/p);for(b=0;b<f;b++)T===0&&(S=c[y++],T=32,A=0),T>=u?(C=S>>>A&m,T-=u,A+=u):(x=u-T,C=S>>>A&m,S=c[y++],T=32-x,C|=(S&(1<<x)-1)<<u-x,A=x),w[b]=C<R?d+C*p:_;return w.unshift(d),w},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,_=0,m,y=0,b,x,T,C=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*C,m=0;m<d;m++)y===0&&(x=c[_++],y=32),y>=f?(b=x>>>y-f&p,y-=f):(T=f-y,b=(x&p)<<T&p,x=c[_++],y=32-T,b+=x>>>y),u[m]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,_=0,m,y=0,b=0,x,T,C;for(m=0;m<d;m++)y===0&&(T=c[_++],y=32,b=0),y>=f?(x=T>>>b&p,y-=f,b+=f):(C=f-y,x=T>>>b&p,T=c[_++],y=32-C,x|=(T&(1<<C)-1)<<f-C,b=C),u[m]=x;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),_=0;p;){var m=p>=359?359:p;p-=m;do u+=c[_++]<<8,f+=u+=c[_++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[_]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var _=new DataView(c,f,8),m=_.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=_.getUint32(4,!0),f+=4),_=new DataView(c,f,12),p.height=_.getUint32(0,!0),p.width=_.getUint32(4,!0),f+=8,m>=4?(p.numDims=_.getUint32(8,!0),f+=4):p.numDims=1,_=new DataView(c,f,40),p.numValidPixel=_.getUint32(0,!0),p.microBlockSize=_.getInt32(4,!0),p.blobSize=_.getInt32(8,!0),p.imageType=_.getInt32(12,!0),p.maxZError=_.getFloat64(16,!0),p.zMin=_.getFloat64(24,!0),p.zMax=_.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,b;if(m>=3&&(b=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),_=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,b=!0;for(y=0;y<f.numDims;y++)if(_[y]!==m[y]){b=!1;break}return f.minValues=_,f.maxValues=m,b},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var _=new ArrayBuffer(d),m=new Uint8Array(_);m.set(new Uint8Array(c,u,d)),p=new f(_)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,_=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(_===0||p===_)&&y.numBytes!==0)throw"invalid mask";var b,x;if(_===0)b=new Uint8Array(Math.ceil(p/8)),y.bitset=b,x=new Uint8Array(p),u.pixels.resultMask=x,f+=y.numBytes;else if(y.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var T=m.getInt16(0,!0),C=2,A=0,S=0;do{if(T>0)for(;T--;)b[A++]=m.getUint8(C++);else for(S=m.getUint8(C++),T=-T;T--;)b[A++]=S;T=m.getInt16(C,!0),C+=2}while(C<y.numBytes);if(T!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";x=new Uint8Array(p);var w=0,R=0;for(R=0;R<p;R++)R&7?(w=b[R>>3],w<<=R&7):w=b[R>>3],w&128&&(x[R]=1);u.pixels.resultMask=x,y.bitset=b,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,_=p.numDims,m=p.width*p.height,y=p.imageType,b=p.numValidPixel*r.getDataTypeSize(y)*_,x,T=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(c,d,b);else{var C=new ArrayBuffer(b),A=new Uint8Array(C);A.set(new Uint8Array(c,d,b)),x=new f(C)}if(x.length===m*_)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*_);var S=0,w=0,R=0,P=0;if(_>1)for(R=0;R<_;R++)for(P=R*m,w=0;w<m;w++)T[w]&&(u.pixels.resultPixels[P+w]=x[S++]);else for(w=0;w<m;w++)T[w]&&(u.pixels.resultPixels[w]=x[S++])}return d+=b,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var _=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(c,u,b);var x=[],T,C,A,S;for(T=m;T<y;T++)C=T-(T<_?0:_),x[C]={first:b[T-m],second:null};var w=c.byteLength-u.ptr,R=Math.ceil(w/4),P=new ArrayBuffer(R*4),O=new Uint8Array(P);O.set(new Uint8Array(c,u.ptr,w));var L=new Uint32Array(P),g=0,E,v=0;for(E=L[0],T=m;T<y;T++)C=T-(T<_?0:_),S=x[C].first,S>0&&(x[C].second=E<<g>>>32-S,32-g>=S?(g+=S,g===32&&(g=0,v++,E=L[v])):(g+=S-32,v++,E=L[v],x[C].second|=E>>>32-g));var I=0,N=0,F=new s;for(T=0;T<x.length;T++)x[T]!==void 0&&(I=Math.max(I,x[T].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var U=[],k,z,B,j,W,J;for(T=m;T<y;T++)if(C=T-(T<_?0:_),S=x[C].first,S>0)if(k=[S,C],S<=N)for(z=x[C].second<<N-S,B=1<<N-S,A=0;A<B;A++)U[z|A]=k;else for(z=x[C].second,J=F,j=S-1;j>=0;j--)W=z>>>j&1,W?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),j===0&&!J.val&&(J.val=k[1]);return{decodeLut:U,numBitsLUTQick:N,numBitsLUT:I,tree:F,stuffedData:L,srcPtr:v,bitPos:g}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,_=u.headerInfo.height,m=u.headerInfo.width,y=m*_,b=this.readHuffmanTree(c,u),x=b.decodeLut,T=b.tree,C=b.stuffedData,A=b.srcPtr,S=b.bitPos,w=b.numBitsLUTQick,R=b.numBitsLUT,P=u.headerInfo.imageType===0?128:0,O,L,g,E=u.pixels.resultMask,v,I,N,F,U,k,z,B=0;S>0&&(A++,S=0);var j=C[A],W=u.encodeMode===1,J=new f(y*p),Y=J,ee;for(ee=0;ee<d.numDims;ee++){if(p>1&&(Y=new f(J.buffer,y*ee,y),B=0),u.headerInfo.numValidPixel===m*_)for(k=0,F=0;F<_;F++)for(U=0;U<m;U++,k++){if(L=0,v=j<<S>>>32-w,I=v,32-S<w&&(v|=C[A+1]>>>64-S-w,I=v),x[I])L=x[I][1],S+=x[I][0];else for(v=j<<S>>>32-R,I=v,32-S<R&&(v|=C[A+1]>>>64-S-R,I=v),O=T,z=0;z<R;z++)if(N=v>>>R-z-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,S=S+z+1;break}S>=32&&(S-=32,A++,j=C[A]),g=L-P,W?(U>0?g+=B:F>0?g+=Y[k-m]:g+=B,g&=255,Y[k]=g,B=g):Y[k]=g}else for(k=0,F=0;F<_;F++)for(U=0;U<m;U++,k++)if(E[k]){if(L=0,v=j<<S>>>32-w,I=v,32-S<w&&(v|=C[A+1]>>>64-S-w,I=v),x[I])L=x[I][1],S+=x[I][0];else for(v=j<<S>>>32-R,I=v,32-S<R&&(v|=C[A+1]>>>64-S-R,I=v),O=T,z=0;z<R;z++)if(N=v>>>R-z-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,S=S+z+1;break}S>=32&&(S-=32,A++,j=C[A]),g=L-P,W?(U>0&&E[k-1]?g+=B:F>0&&E[k-m]?g+=Y[k-m]:g+=B,g&=255,Y[k]=g,B=g):Y[k]=g}u.ptr=u.ptr+(A+1)*4+(S>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var _=u.headerInfo,m=_.fileVersion,y=0,b=new DataView(c,u.ptr,5),x=b.getUint8(0);y++;var T=x>>6,C=T===0?4:3-T,A=(x&32)>0,S=x&31,w=0;if(C===1)w=b.getUint8(y),y++;else if(C===2)w=b.getUint16(y,!0),y+=2;else if(C===4)w=b.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var R=2*_.maxZError,P,O,L,g,E,v,I,N,F,U,k=_.numDims>1?_.maxValues[p]:_.zMax;if(A){for(u.counter.lut++,N=b.getUint8(y),F=S,y++,g=Math.ceil((N-1)*S/8),E=Math.ceil(g/4),O=new ArrayBuffer(E*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,g)),I=new Uint32Array(O),u.ptr+=g,U=0;N-1>>>U;)U++;g=Math.ceil(w*U/8),E=Math.ceil(g/4),O=new ArrayBuffer(E*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(O),u.ptr+=g,m>=3?v=o.unstuffLUT2(I,S,N-1,d,R,k):v=o.unstuffLUT(I,S,N-1,d,R,k),m>=3?o.unstuff2(P,f,U,w,v):o.unstuff(P,f,U,w,v)}else u.counter.bitstuffer++,U=S,u.ptr+=y,U>0&&(g=Math.ceil(w*U/8),E=Math.ceil(g/4),O=new ArrayBuffer(E*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(O),u.ptr+=g,m>=3?d==null?o.originalUnstuff2(P,f,U,w):o.unstuff2(P,f,U,w,!1,d,R,k):d==null?o.originalUnstuff(P,f,U,w):o.unstuff(P,f,U,w,!1,d,R,k))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,_=d.height,m=d.microBlockSize,y=d.imageType,b=r.getDataTypeSize(y),x=Math.ceil(p/m),T=Math.ceil(_/m);u.pixels.numBlocksY=T,u.pixels.numBlocksX=x,u.pixels.ptr=0;var C=0,A=0,S=0,w=0,R=0,P=0,O=0,L=0,g=0,E=0,v=0,I=0,N=0,F=0,U=0,k=0,z,B,j,W,J,Y,ee=new f(m*m),Q=_%m||m,de=p%m||m,ge,le,ye=d.numDims,xe,Ie=u.pixels.resultMask,Te=u.pixels.resultPixels;for(S=0;S<T;S++)for(R=S!==T-1?m:Q,w=0;w<x;w++)for(P=w!==x-1?m:de,v=S*p*m+w*m,I=p-P,xe=0;xe<ye;xe++){if(ye>1&&(Te=new f(u.pixels.resultPixels.buffer,p*_*xe*b,p*_)),O=c.byteLength-u.ptr,z=new DataView(c,u.ptr,Math.min(10,O)),B={},k=0,L=z.getUint8(0),k++,g=L>>6&255,E=L>>2&15,E!==(w*m>>3&15))throw"integrity issue";if(Y=L&3,Y>3)throw u.ptr+=k,"Invalid block encoding ("+Y+")";if(Y===2){u.counter.constant++,u.ptr+=k;continue}else if(Y===0){if(u.counter.uncompressed++,u.ptr+=k,N=R*P*b,F=c.byteLength-u.ptr,N=N<F?N:F,j=new ArrayBuffer(N%b===0?N:N+b-N%b),W=new Uint8Array(j),W.set(new Uint8Array(c,u.ptr,N)),J=new f(j),U=0,Ie)for(C=0;C<R;C++){for(A=0;A<P;A++)Ie[v]&&(Te[v]=J[U++]),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<P;A++)Te[v++]=J[U++];v+=I}u.ptr+=U*b}else if(ge=r.getDataTypeUsed(y,g),le=r.getOnePixel(B,k,ge,z),k+=r.getDataTypeSize(ge),Y===3)if(u.ptr+=k,u.counter.constantoffset++,Ie)for(C=0;C<R;C++){for(A=0;A<P;A++)Ie[v]&&(Te[v]=le),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<P;A++)Te[v++]=le;v+=I}else if(u.ptr+=k,r.decodeBits(c,u,ee,le,xe),k=0,Ie)for(C=0;C<R;C++){for(A=0;A<P;A++)Ie[v]&&(Te[v]=ee[k++]),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<P;A++)Te[v++]=ee[k++];v+=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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,_=0,m=0,y=0,b=c.pixels.resultMask;if(b)if(f>1)for(_=0;_<f;_++)for(y=_*d,m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var _=p.headerInfo,m=_.fileVersion,y=r.getDataTypeArray(_.imageType);r.readMask(c,p),_.numValidPixel!==_.width*_.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=_.width*_.height;if(p.pixels.resultPixels=new y(b*_.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},_.numValidPixel!==0)if(_.zMax===_.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var x=new DataView(c,p.ptr,2),T=x.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,y);else if(m>1&&_.imageType<=1&&Math.abs(_.maxZError-.5)<1e-5){var C=x.getUint8(1);if(p.ptr++,p.encodeMode=C,C>2||m<4&&C>1)throw"Invalid Huffman flag "+C;C?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var A;u.inputOffset?(A=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(A)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(A=p.headerInfo.blobSize-p.ptr,Math.abs(A)>=1&&(p.eofOffset=p.headerInfo.blobSize));var S={width:_.width,height:_.height,pixelData:p.pixels.resultPixels,minValue:_.zMin,maxValue:_.zMax,validPixelCount:_.numValidPixel,dimCount:_.numDims,dimStats:{minValues:_.minValues,maxValues:_.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(_.imageType,f)){var w=p.pixels.resultMask;for(d=0;d<b;d++)w[d]||(S.pixelData[d]=f);S.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(p)),S}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,_,m=[],y,b,x={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var T=u.decode(o,{inputOffset:s,encodedMaskData:_,maskData:b,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=T.fileInfo.eofOffset,d===0&&(_=T.encodedMaskData,b=T.maskData,x.width=T.width,x.height=T.height,x.dimCount=T.dimCount||1,x.pixelType=T.pixelType||T.fileInfo.pixelType,x.mask=T.maskData),f>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&m.push(T.maskData),d++,x.pixels.push(T.pixelData),x.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var C,A,S;if(f>1&&m.length>1){for(S=x.width*x.height,x.bandMasks=m,b=new Uint8Array(S),b.set(m[0]),C=1;C<m.length;C++)for(y=m[C],A=0;A<S;A++)b[A]=b[A]&y[A];x.maskData=b}return x}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof g6<"u"&&g6.exports?g6.exports=i:this.Lerc=i})()});var zPe=Zn((Nz,Vte)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof Nz=="object"&&typeof Vte=="object"?Vte.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Nz=="object"?Nz.NoSleep=t():e.NoSleep=t()})(Nz,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(d,p){for(var _=0;_<p.length;_++){var m=p[_];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,_){return p&&f(d.prototype,p),_&&f(d,_),d}}(),o=n(1),r=o.webm,s=o.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=function(){function f(){var d=this;if(function(_,m){if(!(_ instanceof m))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,_){var m=document.createElement("source");m.src=_,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then(function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` - NoSleep enabled for older iOS devices. This can interrupt - active or long-running network requests from completing successfully. - See https://github.com/richtr/NoSleep.js/issues/15 for more details. - `),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(function(p){return d.enabled=!0,p}).catch(function(p){throw d.enabled=!1,p})}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` - NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAA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qq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAA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UuMzMuMTAw"}}])})});var uBt={};Jte(uBt,{AlphaMode:()=>Ym,AlphaPipelineStage:()=>$M,AnchorPointDirect:()=>iM,AnchorPointIndirect:()=>oM,Animation:()=>JU,AnimationViewModel:()=>ez,Appearance:()=>co,ApproximateTerrainHeights:()=>hi,ArcGISTiledElevationTerrainProvider:()=>U$,ArcGisBaseMapType:()=>gm,ArcGisMapServerImageryProvider:()=>Qg,ArcGisMapService:()=>Af,ArcType:()=>tn,ArticulationStageType:()=>Nc,AssociativeArray:()=>wt,Atmosphere:()=>hT,AtmospherePipelineStage:()=>DM,AttributeCompression:()=>On,AttributeType:()=>rn,AutoExposure:()=>X3,AutomaticUniforms:()=>$p,Axis:()=>Vo,AxisAlignedBoundingBox:()=>By,B3dmLoader:()=>gM,B3dmParser:()=>mM,BaseLayerPicker:()=>nz,BaseLayerPickerViewModel:()=>tz,BatchTable:()=>Cx,BatchTableHierarchy:()=>Wx,BatchTexture:()=>xl,BatchTexturePipelineStage:()=>ZM,Billboard:()=>po,BillboardCollection:()=>Zu,BillboardGraphics:()=>vc,BillboardLoadState:()=>ms,BillboardTexture:()=>tg,BillboardVisualizer:()=>B1,BingMapsGeocoderService:()=>V$,BingMapsImageryProvider:()=>TB,BingMapsStyle:()=>fw,BlendEquation:()=>Za,BlendFunction:()=>Io,BlendOption:()=>Ro,BlendingState:()=>fn,BoundingRectangle:()=>Xe,BoundingSphere:()=>re,BoundingSphereState:()=>ut,BoundingVolumeSemantics:()=>cT,BoxEmitter:()=>zJ,BoxGeometry:()=>Ka,BoxGeometryUpdater:()=>KR,BoxGraphics:()=>Dx,BoxOutlineGeometry:()=>fh,BrdfLutGenerator:()=>$B,Buffer:()=>st,BufferLoader:()=>Zx,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>tL,CallbackPositionProperty:()=>$R,CallbackProperty:()=>gh,Camera:()=>uo,CameraEventAggregator:()=>ek,CameraEventType:()=>zi,CameraFlightPath:()=>QB,Cartesian2:()=>V,Cartesian3:()=>h,Cartesian4:()=>ie,Cartographic:()=>fe,CartographicGeocoderService:()=>G$,CatmullRomSpline:()=>j$,Cesium3DContentGroup:()=>jx,Cesium3DTile:()=>Td,Cesium3DTileBatchTable:()=>v_,Cesium3DTileColorBlendMode:()=>tu,Cesium3DTileContent:()=>VJ,Cesium3DTileContentFactory:()=>PT,Cesium3DTileContentState:()=>Zo,Cesium3DTileContentType:()=>ks,Cesium3DTileFeature:()=>oa,Cesium3DTileFeatureTable:()=>Dh,Cesium3DTileOptimizationHint:()=>_d,Cesium3DTileOptimizations:()=>BN,Cesium3DTilePass:()=>jo,Cesium3DTilePassState:()=>Gd,Cesium3DTilePointFeature:()=>ng,Cesium3DTileRefine:()=>Ko,Cesium3DTileStyle:()=>EA,Cesium3DTileStyleEngine:()=>GN,Cesium3DTilesInspector:()=>fz,Cesium3DTilesInspectorViewModel:()=>uz,Cesium3DTilesVoxelProvider:()=>HJ,Cesium3DTileset:()=>ws,Cesium3DTilesetBaseTraversal:()=>KN,Cesium3DTilesetCache:()=>zN,Cesium3DTilesetGraphics:()=>Bx,Cesium3DTilesetHeatmap:()=>VN,Cesium3DTilesetMetadata:()=>UT,Cesium3DTilesetMostDetailedTraversal:()=>qN,Cesium3DTilesetSkipTraversal:()=>QN,Cesium3DTilesetStatistics:()=>Vh,Cesium3DTilesetTraversal:()=>ua,Cesium3DTilesetVisualizer:()=>JN,CesiumInspector:()=>az,CesiumInspectorViewModel:()=>sz,CesiumTerrainProvider:()=>OC,CesiumWidget:()=>Jk,Check:()=>ro,CheckerboardMaterialProperty:()=>NS,CircleEmitter:()=>dU,CircleGeometry:()=>$$,CircleOutlineGeometry:()=>Z$,ClassificationModelDrawCommand:()=>YL,ClassificationPipelineStage:()=>QM,ClassificationPrimitive:()=>CE,ClassificationType:()=>zn,ClearCommand:()=>oi,ClippingPlane:()=>lT,ClippingPlaneCollection:()=>Ss,ClippingPolygon:()=>ZE,ClippingPolygonCollection:()=>vh,Clock:()=>qh,ClockRange:()=>ts,ClockStep:()=>bo,ClockViewModel:()=>$U,CloudCollection:()=>XJ,CloudType:()=>Xw,Color:()=>H,ColorBlendMode:()=>Lc,ColorGeometryInstanceAttribute:()=>Yt,ColorMaterialProperty:()=>Wt,Command:()=>wte,ComponentDatatype:()=>K,Composite3DTileContent:()=>rO,CompositeEntityCollection:()=>uY,CompositeMaterialProperty:()=>BS,CompositePositionProperty:()=>Oa,CompositeProperty:()=>Vc,CompressedTextureBuffer:()=>BI,ComputeCommand:()=>Ea,ComputeEngine:()=>FI,ConditionsExpression:()=>cU,ConeEmitter:()=>$J,ConstantPositionProperty:()=>ul,ConstantProperty:()=>Qn,ConstantSpline:()=>K_,ContentMetadata:()=>IN,Context:()=>P1,ContextLimits:()=>Lt,CoplanarPolygonGeometry:()=>BF,CoplanarPolygonGeometryLibrary:()=>fg,CoplanarPolygonOutlineGeometry:()=>xd,CornerType:()=>Bi,CorrelationGroup:()=>rM,CorridorGeometry:()=>WT,CorridorGeometryLibrary:()=>qi,CorridorGeometryUpdater:()=>cF,CorridorGraphics:()=>Ox,CorridorOutlineGeometry:()=>aF,Credit:()=>_t,CreditDisplay:()=>n3,CubeMap:()=>or,CubeMapFace:()=>YI,CubicRealPolynomial:()=>sx,CullFace:()=>Ai,CullingVolume:()=>Es,CumulusCloud:()=>Rf,CustomDataSource:()=>mF,CustomHeightmapTerrainProvider:()=>Q$,CustomShader:()=>mA,CustomShaderMode:()=>Q_,CustomShaderPipelineStage:()=>cL,CustomShaderTranslucencyMode:()=>_0,CylinderGeometry:()=>pF,CylinderGeometryLibrary:()=>qT,CylinderGeometryUpdater:()=>gF,CylinderGraphics:()=>Mx,CylinderOutlineGeometry:()=>_F,CzmlDataSource:()=>wF,DataSource:()=>es,DataSourceClock:()=>Yh,DataSourceCollection:()=>IF,DataSourceDisplay:()=>d2,DebugAppearance:()=>tee,DebugCameraPrimitive:()=>Rp,DebugInspector:()=>ck,DebugModelMatrixPrimitive:()=>pU,DefaultProxy:()=>eZ,DepthFunction:()=>wc,DepthPlane:()=>a3,DequantizationPipelineStage:()=>uL,DerivedCommand:()=>Op,DeveloperError:()=>he,DeviceOrientationCameraController:()=>c3,DirectionalLight:()=>nee,DiscardEmptyTileImagePolicy:()=>dw,DiscardMissingTileImagePolicy:()=>bB,DistanceDisplayCondition:()=>Rt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Un,DoubleEndedPriorityQueue:()=>LC,DoublyLinkedList:()=>UN,DracoLoader:()=>M_,DrawCommand:()=>qe,DynamicAtmosphereLightingType:()=>U_,DynamicEnvironmentMapManager:()=>z_,DynamicGeometryBatch:()=>JT,DynamicGeometryUpdater:()=>ri,EarthOrientationParameters:()=>II,EarthOrientationParametersSample:()=>Cy,EasingFunction:()=>os,EllipseGeometry:()=>Ol,EllipseGeometryLibrary:()=>mu,EllipseGeometryUpdater:()=>DF,EllipseGraphics:()=>Lx,EllipseOutlineGeometry:()=>lf,Ellipsoid:()=>te,EllipsoidGeodesic:()=>m_,EllipsoidGeometry:()=>da,EllipsoidGeometryUpdater:()=>OF,EllipsoidGraphics:()=>Nx,EllipsoidOutlineGeometry:()=>ef,EllipsoidPrimitive:()=>WB,EllipsoidRhumbLine:()=>Qa,EllipsoidSurfaceAppearance:()=>iee,EllipsoidTangentPlane:()=>cs,EllipsoidTerrainProvider:()=>vp,EllipsoidalOccluder:()=>Cg,Empty3DTileContent:()=>CS,EncodedCartesian3:()=>Gn,Entity:()=>ar,EntityCluster:()=>nf,EntityCollection:()=>fa,EntityView:()=>m2,Event:()=>me,EventHelper:()=>Tr,Expression:()=>id,ExpressionNodeType:()=>gt,ExtrapolationType:()=>rf,FeatureDetection:()=>Nt,FeatureIdPipelineStage:()=>p0,Fog:()=>l3,ForEach:()=>Re,FrameRateMonitor:()=>yU,FrameState:()=>u3,Framebuffer:()=>Gr,FramebufferManager:()=>_i,Frozen:()=>G,FrustumCommands:()=>p3,FrustumGeometry:()=>FC,FrustumOutlineGeometry:()=>nB,Fullscreen:()=>Ir,FullscreenButton:()=>hz,FullscreenButtonViewModel:()=>dz,GeoJsonDataSource:()=>nb,GeoJsonLoader:()=>yM,GeocodeType:()=>pb,Geocoder:()=>gz,GeocoderService:()=>ow,GeocoderViewModel:()=>_z,GeographicProjection:()=>Mi,GeographicTilingScheme:()=>Ei,Geometry:()=>lt,Geometry3DTileContent:()=>cO,GeometryAttribute:()=>we,GeometryAttributes:()=>dn,GeometryFactory:()=>rZ,GeometryInstance:()=>It,GeometryInstanceAttribute:()=>Ic,GeometryOffsetAttribute:()=>an,GeometryPipeline:()=>Nn,GeometryPipelineStage:()=>mL,GeometryType:()=>Gf,GeometryUpdater:()=>si,GeometryUpdaterSet:()=>uC,GeometryVisualizer:()=>e2,GetFeatureInfoFormat:()=>qC,Globe:()=>jB,GlobeDepth:()=>_3,GlobeSurfaceShaderSet:()=>yB,GlobeSurfaceTile:()=>zd,GlobeSurfaceTileProvider:()=>LB,GlobeTranslucency:()=>NB,GlobeTranslucencyFramebuffer:()=>g3,GlobeTranslucencyState:()=>f3,GltfBufferViewLoader:()=>NE,GltfDracoLoader:()=>FE,GltfGpmLoader:()=>aM,GltfGpmLocal:()=>JE,GltfImageLoader:()=>BE,GltfIndexBufferLoader:()=>kE,GltfJsonLoader:()=>zE,GltfLoader:()=>Ph,GltfLoaderUtil:()=>ou,GltfMeshPrimitiveGpmLoader:()=>fM,GltfStructuralMetadataLoader:()=>tM,GltfTextureLoader:()=>VE,GltfVertexBufferLoader:()=>HE,GoogleEarthEnterpriseImageryProvider:()=>ree,GoogleEarthEnterpriseMapsProvider:()=>EB,GoogleEarthEnterpriseMetadata:()=>Yg,GoogleEarthEnterpriseTerrainData:()=>rw,GoogleEarthEnterpriseTerrainProvider:()=>hZ,GoogleEarthEnterpriseTileInformation:()=>oB,GoogleGeocoderService:()=>pZ,GoogleMaps:()=>kC,GpxDataSource:()=>U2,GregorianDate:()=>Qp,GridImageryProvider:()=>see,GridMaterialProperty:()=>YS,GroundGeometryUpdater:()=>jn,GroundPolylineGeometry:()=>vx,GroundPolylinePrimitive:()=>dh,GroundPrimitive:()=>cl,GroupMetadata:()=>OS,HeadingPitchRange:()=>Od,HeadingPitchRoll:()=>qa,Heap:()=>CI,HeightReference:()=>Ke,HeightmapEncoding:()=>Fd,HeightmapTerrainData:()=>ac,HeightmapTessellator:()=>Kv,HermitePolynomialApproximation:()=>yF,HermiteSpline:()=>$m,HilbertOrder:()=>RE,HomeButton:()=>pz,HomeButtonViewModel:()=>mz,HorizontalOrigin:()=>Ci,I3SBuildingSceneLayerExplorer:()=>Fte,I3SBuildingSceneLayerExplorerViewModel:()=>yz,I3SDataProvider:()=>Sm,I3SDecoder:()=>bU,I3SFeature:()=>xU,I3SField:()=>TU,I3SGeometry:()=>Kw,I3SLayer:()=>PA,I3SNode:()=>$w,I3SStatistics:()=>EU,I3SSublayer:()=>vU,I3SSymbology:()=>AU,I3dmLoader:()=>xM,I3dmParser:()=>bM,ITwinData:()=>uee,ITwinPlatform:()=>js,Iau2000Orientation:()=>sB,Iau2006XysData:()=>PI,Iau2006XysSample:()=>nx,IauOrientationAxes:()=>aB,IauOrientationParameters:()=>rB,ImageBasedLighting:()=>Gx,ImageBasedLightingPipelineStage:()=>OM,ImageMaterialProperty:()=>Vy,Imagery:()=>yw,ImageryLayer:()=>uc,ImageryLayerCollection:()=>FB,ImageryLayerFeatureInfo:()=>_m,ImageryProvider:()=>Ul,ImageryState:()=>ui,Implicit3DTileContent:()=>WE,ImplicitAvailabilityBitstream:()=>ME,ImplicitMetadataView:()=>LE,ImplicitSubdivisionScheme:()=>fs,ImplicitSubtree:()=>sT,ImplicitSubtreeCache:()=>uU,ImplicitSubtreeMetadata:()=>lO,ImplicitTileCoordinates:()=>HT,ImplicitTileset:()=>VT,IndexDatatype:()=>ke,InfoBox:()=>xz,InfoBoxViewModel:()=>bz,InspectorShared:()=>Du,InstanceAttributeSemantic:()=>hs,InstancingPipelineStage:()=>qM,InterpolationAlgorithm:()=>gZ,InterpolationType:()=>Fc,Intersect:()=>Ht,IntersectionTests:()=>ti,Intersections2D:()=>Wg,Interval:()=>Xa,InvertClassification:()=>Dw,Ion:()=>xh,IonGeocodeProviderType:()=>Xg,IonGeocoderService:()=>UC,IonImageryProvider:()=>Jg,IonResource:()=>Hu,IonWorldImageryStyle:()=>ey,Iso8601:()=>Ge,JobScheduler:()=>d3,JobType:()=>tc,JsonMetadataTable:()=>V_,JulianDate:()=>$,KTX2Transcoder:()=>kI,KeyboardEventModifier:()=>pa,KeyframeNode:()=>To,KmlCamera:()=>z2,KmlDataSource:()=>IC,KmlLookAt:()=>V2,KmlTour:()=>H2,KmlTourFlyTo:()=>j2,KmlTourWait:()=>W2,Label:()=>T0,LabelCollection:()=>ep,LabelGraphics:()=>mh,LabelStyle:()=>$o,LabelVisualizer:()=>t2,LagrangePolynomialApproximation:()=>bF,LeapSecond:()=>Ki,Light:()=>fee,LightingModel:()=>Zm,LightingPipelineStage:()=>_L,LinearApproximation:()=>XT,LinearSpline:()=>cd,ManageIndexedDB:()=>xZ,ManagedArray:()=>yl,MapMode2D:()=>Au,MapProjection:()=>TZ,MapboxImageryProvider:()=>SB,MapboxStyleImageryProvider:()=>dee,Material:()=>$i,MaterialAppearance:()=>ho,MaterialPipelineStage:()=>yL,MaterialProperty:()=>sr,Math:()=>D,Matrix2:()=>ei,Matrix3:()=>Z,Matrix4:()=>M,Megatexture:()=>Uw,MeshPrimitiveGpmLocal:()=>uM,MetadataClass:()=>Ah,MetadataClassProperty:()=>jm,MetadataComponentType:()=>Ft,MetadataEntity:()=>kn,MetadataEnum:()=>MO,MetadataEnumValue:()=>OO,MetadataPicking:()=>h3,MetadataPickingPipelineStage:()=>Xu,MetadataPipelineStage:()=>ld,MetadataSchema:()=>qu,MetadataSchemaLoader:()=>GE,MetadataSemantic:()=>aT,MetadataTable:()=>od,MetadataTableProperty:()=>fO,MetadataType:()=>at,MipmapHint:()=>qf,Model:()=>Mh,Model3DTileContent:()=>$u,ModelAlphaOptions:()=>FL,ModelAnimation:()=>CM,ModelAnimationChannel:()=>TM,ModelAnimationCollection:()=>AM,ModelAnimationLoop:()=>su,ModelAnimationState:()=>Rh,ModelArticulation:()=>LM,ModelArticulationStage:()=>MM,ModelClippingPlanesPipelineStage:()=>BM,ModelClippingPolygonsPipelineStage:()=>zM,ModelColorPipelineStage:()=>m0,ModelComponents:()=>Tn,ModelDrawCommand:()=>XL,ModelDrawCommands:()=>ZL,ModelFeature:()=>EM,ModelFeatureTable:()=>vM,ModelGraphics:()=>b_,ModelInstanceCollection:()=>Ete,ModelLightingOptions:()=>jL,ModelMatrixUpdateStage:()=>YM,ModelNode:()=>VM,ModelRenderResources:()=>BL,ModelRuntimeNode:()=>KM,ModelRuntimePrimitive:()=>LL,ModelSceneGraph:()=>QL,ModelSilhouettePipelineStage:()=>zL,ModelSkin:()=>NL,ModelSplitterPipelineStage:()=>HL,ModelStatistics:()=>JL,ModelType:()=>br,ModelUtility:()=>Qt,ModelVisualizer:()=>n2,Moon:()=>YB,MorphTargetsPipelineStage:()=>xL,MorphWeightSpline:()=>uB,MortonOrder:()=>w0,Multiple3DTileContent:()=>RN,MultisampleFramebuffer:()=>D1,NavigationHelpButton:()=>Cz,NavigationHelpButtonViewModel:()=>Tz,NearFarScalar:()=>Vt,NeverTileDiscardPolicy:()=>mee,NodeRenderResources:()=>GL,NodeStatisticsPipelineStage:()=>XM,NodeTransformationProperty:()=>Fx,OIT:()=>b3,Occluder:()=>fB,OffsetGeometryInstanceAttribute:()=>io,OpenCageGeocoderService:()=>wZ,OpenStreetMapImageryProvider:()=>py,OrderedGroundPrimitiveCollection:()=>PF,OrientedBoundingBox:()=>In,OrthographicFrustum:()=>cn,OrthographicOffCenterFrustum:()=>jr,Packable:()=>IZ,PackableForInterpolation:()=>PZ,Particle:()=>Jw,ParticleBurst:()=>_ee,ParticleEmitter:()=>gee,ParticleSystem:()=>yee,Pass:()=>Se,PassState:()=>Sc,PathGraphics:()=>x_,PathVisualizer:()=>o2,PeliasGeocoderService:()=>lB,PerInstanceColorAppearance:()=>un,PerformanceDisplay:()=>iy,PerformanceWatchdog:()=>Ez,PerformanceWatchdogViewModel:()=>Az,PerspectiveFrustum:()=>Oi,PerspectiveOffCenterFrustum:()=>kl,PickDepth:()=>m3,PickDepthFramebuffer:()=>T3,PickFramebuffer:()=>A3,PickedMetadataInfo:()=>Lk,Picking:()=>I3,PickingPipelineStage:()=>TL,PinBuilder:()=>Vg,PixelDatatype:()=>He,PixelFormat:()=>je,Plane:()=>en,PlaneGeometry:()=>MF,PlaneGeometryUpdater:()=>NF,PlaneGraphics:()=>HR,PlaneOutlineGeometry:()=>LF,PntsLoader:()=>tN,PntsParser:()=>CT,PointCloud:()=>Zk,PointCloudEyeDomeLighting:()=>G_,PointCloudShading:()=>Km,PointCloudStylingPipelineStage:()=>AL,PointGraphics:()=>kx,PointPrimitive:()=>zs,PointPrimitiveCollection:()=>HS,PointVisualizer:()=>s2,PolygonGeometry:()=>k_,PolygonGeometryLibrary:()=>Hn,PolygonGeometryUpdater:()=>UF,PolygonGraphics:()=>ph,PolygonHierarchy:()=>Ja,PolygonOutlineGeometry:()=>kF,PolygonPipeline:()=>li,Polyline:()=>hd,PolylineArrowMaterialProperty:()=>KS,PolylineCollection:()=>Fh,PolylineColorAppearance:()=>ls,PolylineDashMaterialProperty:()=>ZS,PolylineGeometry:()=>Fg,PolylineGeometryUpdater:()=>l2,PolylineGlowMaterialProperty:()=>JS,PolylineGraphics:()=>Pc,PolylineMaterialAppearance:()=>wa,PolylineOutlineMaterialProperty:()=>N0,PolylinePipeline:()=>Fi,PolylineVisualizer:()=>f2,PolylineVolumeGeometry:()=>HF,PolylineVolumeGeometryLibrary:()=>Hh,PolylineVolumeGeometryUpdater:()=>qF,PolylineVolumeGraphics:()=>Ux,PolylineVolumeOutlineGeometry:()=>WF,PositionProperty:()=>hh,PositionPropertyArray:()=>vg,PostProcessStage:()=>yo,PostProcessStageCollection:()=>Z3,PostProcessStageComposite:()=>Su,PostProcessStageLibrary:()=>wf,PostProcessStageSampleMode:()=>vf,PostProcessStageTextureCache:()=>sA,PpeMetadata:()=>lM,PpeSource:()=>Fee,PpeTexture:()=>cM,Primitive:()=>Pn,PrimitiveCollection:()=>Rl,PrimitiveLoadPlan:()=>_T,PrimitiveOutlineGenerator:()=>pT,PrimitiveOutlinePipelineStage:()=>vL,PrimitivePipeline:()=>Ax,PrimitiveRenderResources:()=>WL,PrimitiveState:()=>Mr,PrimitiveStatisticsPipelineStage:()=>wL,PrimitiveType:()=>Le,ProjectionPicker:()=>vz,ProjectionPickerViewModel:()=>Sz,Property:()=>X,PropertyArray:()=>tv,PropertyAttribute:()=>mT,PropertyAttributeProperty:()=>ZO,PropertyBag:()=>dl,PropertyTable:()=>Al,PropertyTexture:()=>H_,PropertyTextureProperty:()=>$O,ProviderViewModel:()=>bs,Proxy:()=>RZ,QuadraticRealPolynomial:()=>il,QuadtreeOccluders:()=>BB,QuadtreePrimitive:()=>GB,QuadtreeTile:()=>kB,QuadtreeTileLoadState:()=>_a,QuadtreeTileProvider:()=>bee,QuantizedMeshTerrainData:()=>RC,QuarticRealPolynomial:()=>VI,Quaternion:()=>Pe,QuaternionSpline:()=>$_,Queue:()=>Cl,Ray:()=>_n,Rectangle:()=>ae,RectangleCollisionChecker:()=>dC,RectangleGeometry:()=>oC,RectangleGeometryLibrary:()=>Us,RectangleGeometryUpdater:()=>YF,RectangleGraphics:()=>_h,RectangleOutlineGeometry:()=>OT,ReferenceFrame:()=>Gi,ReferenceProperty:()=>wg,RenderState:()=>ze,Renderbuffer:()=>Fu,RenderbufferFormat:()=>rl,Request:()=>tr,RequestErrorEvent:()=>Im,RequestScheduler:()=>Wa,RequestState:()=>Xn,RequestType:()=>Ts,Resource:()=>Ee,ResourceCache:()=>Di,ResourceCacheKey:()=>ru,ResourceCacheStatistics:()=>FO,ResourceLoader:()=>Zi,ResourceLoaderState:()=>yt,Rotation:()=>Sd,RuntimeError:()=>se,S2Cell:()=>P_,SDFSettings:()=>ca,SampledPositionProperty:()=>La,SampledProperty:()=>af,Sampler:()=>zt,ScaledPositionProperty:()=>up,Scene:()=>Fk,SceneFramebuffer:()=>JC,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>IL,SceneModePicker:()=>Iz,SceneModePickerViewModel:()=>wz,SceneTransforms:()=>ji,SceneTransitioner:()=>J3,ScreenSpaceCameraController:()=>ik,ScreenSpaceEventHandler:()=>Cf,ScreenSpaceEventType:()=>Cn,SelectedFeatureIdPipelineStage:()=>g0,SelectionIndicator:()=>Rz,SelectionIndicatorViewModel:()=>Dz,SensorVolumePortionToDisplay:()=>rv,ShaderBuilder:()=>px,ShaderCache:()=>E1,ShaderDestination:()=>pe,ShaderFunction:()=>L1,ShaderProgram:()=>Xt,ShaderSource:()=>Be,ShaderStruct:()=>M1,ShadowMap:()=>sy,ShadowMapShader:()=>Np,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>Uu,ShowGeometryInstanceAttribute:()=>bn,Simon1994PlanetaryPositions:()=>My,SimplePolylineGeometry:()=>HZ,SingleTileImageryProvider:()=>vB,SkinningPipelineStage:()=>DL,SkyAtmosphere:()=>Uk,SkyBox:()=>Hk,SpatialNode:()=>Rk,Spdcf:()=>sM,SpecularEnvironmentCubeMap:()=>bh,SphereEmitter:()=>Tee,SphereGeometry:()=>GZ,SphereOutlineGeometry:()=>hg,Spherical:()=>xF,Spline:()=>Qi,SplitDirection:()=>Wr,Splitter:()=>jw,StaticGeometryColorBatch:()=>Pd,StaticGeometryPerMaterialBatch:()=>Dd,StaticGroundGeometryColorBatch:()=>Av,StaticGroundGeometryPerMaterialBatch:()=>JF,StaticGroundPolylinePerMaterialBatch:()=>u2,StaticOutlineGeometryBatch:()=>vv,StencilConstants:()=>jt,StencilFunction:()=>Vn,StencilOperation:()=>ht,SteppedSpline:()=>yT,Stereographic:()=>Mc,StorageType:()=>l0,StripeMaterialProperty:()=>iv,StripeOrientation:()=>Xh,StructuralMetadata:()=>sa,StyleCommandsNeeded:()=>Oh,StyleExpression:()=>Cee,Sun:()=>Xk,SunLight:()=>c_,SunPostProcess:()=>sk,SupportedImageFormats:()=>nM,SvgPathBindingHandler:()=>XU,TaskProcessor:()=>di,Terrain:()=>DU,TerrainData:()=>um,TerrainEncoding:()=>Yc,TerrainFillMesh:()=>Cw,TerrainMesh:()=>kd,TerrainOffsetProperty:()=>zx,TerrainProvider:()=>_s,TerrainQuantization:()=>ma,TerrainState:()=>go,Texture:()=>dt,Texture3D:()=>iW,TextureAtlas:()=>gx,TextureCache:()=>S1,TextureMagnificationFilter:()=>Kn,TextureManager:()=>wk,TextureMinificationFilter:()=>ft,TexturePacker:()=>mE,TextureUniform:()=>Lee,TextureWrap:()=>sn,TileAvailability:()=>fm,TileBoundingRegion:()=>Ju,TileBoundingS2Cell:()=>NN,TileBoundingSphere:()=>mg,TileBoundingVolume:()=>Aee,TileCoordinatesImageryProvider:()=>OU,TileCoordinatesImageryProviderFlw:()=>Eee,TileCoordinatesImageryProviderJww:()=>See,TileDiscardPolicy:()=>wee,TileEdge:()=>yn,TileImagery:()=>bw,TileMapServiceImageryProvider:()=>Cb,TileMetadata:()=>PN,TileOrientedBoundingBox:()=>fu,TileProviderError:()=>Lo,TileReplacementQueue:()=>UB,TileSelectionResult:()=>$n,TileState:()=>Iee,Tileset3DTileContent:()=>oN,TilesetMetadata:()=>FN,TilesetPipelineStage:()=>wM,TilingScheme:()=>jZ,TimeConstants:()=>Yn,TimeDynamicImagery:()=>YC,TimeDynamicPointCloud:()=>qw,TimeInterval:()=>En,TimeIntervalCollection:()=>Jr,TimeIntervalCollectionPositionProperty:()=>Ig,TimeIntervalCollectionProperty:()=>Pg,TimeStandard:()=>Wn,Timeline:()=>Lz,TimelineHighlightRange:()=>Oz,TimelineTrack:()=>Mz,Tipsify:()=>HI,ToggleButtonViewModel:()=>zb,Tonemapper:()=>cy,TrackingReferenceFrame:()=>h_,Transforms:()=>At,TranslationRotationScale:()=>Hy,TranslucentTileClassification:()=>S3,TridiagonalSystemSolver:()=>sS,TrustedServers:()=>nE,TweenCollection:()=>lA,UniformState:()=>I1,UniformType:()=>Bw,UrlTemplateImageryProvider:()=>lc,VERSION:()=>lBt,VRButton:()=>Bz,VRButtonViewModel:()=>Fz,VRTheWorldTerrainProvider:()=>qZ,VaryingType:()=>Nee,Vector3DTileBatch:()=>Hm,Vector3DTileClampedPolylines:()=>SN,Vector3DTileContent:()=>wN,Vector3DTileGeometry:()=>I_,Vector3DTilePoints:()=>yN,Vector3DTilePolygons:()=>bN,Vector3DTilePolylines:()=>IT,Vector3DTilePrimitive:()=>Xx,VelocityOrientationProperty:()=>CF,VelocityVectorProperty:()=>Dg,VertexArray:()=>qn,VertexArrayFacade:()=>l_,VertexAttributeSemantic:()=>mt,VertexFormat:()=>De,VerticalExaggeration:()=>Or,VerticalExaggerationPipelineStage:()=>OL,VerticalOrigin:()=>Fn,VideoSynchronizer:()=>WZ,View:()=>nA,Viewer:()=>Gte,ViewportQuad:()=>Pee,Visibility:()=>Er,Visualizer:()=>N$,VoxelBoxShape:()=>_A,VoxelCell:()=>lk,VoxelContent:()=>pA,VoxelCylinderShape:()=>gA,VoxelEllipsoidShape:()=>yA,VoxelInspector:()=>Uz,VoxelInspectorViewModel:()=>kz,VoxelMetadataOrder:()=>Yd,VoxelPrimitive:()=>Ob,VoxelProvider:()=>Ree,VoxelRenderResources:()=>Ek,VoxelShape:()=>Oee,VoxelShapeType:()=>za,VoxelTraversal:()=>Ok,VulkanConstants:()=>YZ,WallGeometry:()=>KF,WallGeometryLibrary:()=>rC,WallGeometryUpdater:()=>QF,WallGraphics:()=>T_,WallOutlineGeometry:()=>ZF,WebGLConstants:()=>q,WebMapServiceImageryProvider:()=>IB,WebMapTileServiceImageryProvider:()=>DB,WebMercatorProjection:()=>Li,WebMercatorTilingScheme:()=>gs,WindingOrder:()=>Cs,WireframeIndexGenerator:()=>mS,WireframePipelineStage:()=>ML,_shadersAcesTonemappingStage:()=>P3,_shadersAdditiveBlend:()=>ok,_shadersAdjustTranslucentFS:()=>Rw,_shadersAllMaterialAppearanceFS:()=>z1,_shadersAllMaterialAppearanceVS:()=>V1,_shadersAmbientOcclusionGenerate:()=>D3,_shadersAmbientOcclusionModulate:()=>R3,_shadersAspectRampMaterial:()=>q1,_shadersAtmosphereCommon:()=>wh,_shadersAtmosphereStageFS:()=>IM,_shadersAtmosphereStageVS:()=>PM,_shadersBasicMaterialAppearanceFS:()=>H1,_shadersBasicMaterialAppearanceVS:()=>G1,_shadersBillboardCollectionFS:()=>rN,_shadersBillboardCollectionVS:()=>sN,_shadersBlackAndWhite:()=>O3,_shadersBloomComposite:()=>M3,_shadersBrdfLutGeneratorFS:()=>XB,_shadersBrightPass:()=>rk,_shadersBrightness:()=>L3,_shadersBumpMapMaterial:()=>Y1,_shadersCPUStylingStageFS:()=>eL,_shadersCPUStylingStageVS:()=>JM,_shadersCheckerboardMaterial:()=>X1,_shadersCloudCollectionFS:()=>eU,_shadersCloudCollectionVS:()=>tU,_shadersCloudNoiseFS:()=>nU,_shadersCloudNoiseVS:()=>iU,_shadersCompareAndPackTranslucentDepth:()=>E3,_shadersCompositeOITFS:()=>y3,_shadersCompositeTranslucentClassification:()=>tA,_shadersComputeIrradianceFS:()=>GO,_shadersComputeRadianceMapFS:()=>jO,_shadersContrastBias:()=>N3,_shadersConvolveSpecularMapFS:()=>WO,_shadersConvolveSpecularMapVS:()=>qO,_shadersCustomShaderStageFS:()=>iL,_shadersCustomShaderStageVS:()=>nL,_shadersCzmBuiltins:()=>dx,_shadersDepthOfField:()=>F3,_shadersDepthPlaneFS:()=>i3,_shadersDepthPlaneVS:()=>o3,_shadersDepthView:()=>B3,_shadersDepthViewPacked:()=>Mee,_shadersDotMaterial:()=>K1,_shadersEdgeDetection:()=>k3,_shadersElevationBandMaterial:()=>$1,_shadersElevationContourMaterial:()=>Z1,_shadersElevationRampMaterial:()=>Q1,_shadersEllipsoidFS:()=>Ew,_shadersEllipsoidSurfaceAppearanceFS:()=>_U,_shadersEllipsoidSurfaceAppearanceVS:()=>gU,_shadersEllipsoidVS:()=>Sw,_shadersFXAA:()=>V3,_shadersFXAA3_11:()=>Y3,_shadersFadeMaterial:()=>J1,_shadersFeatureIdStageFS:()=>oL,_shadersFeatureIdStageVS:()=>rL,_shadersFilmicTonemapping:()=>U3,_shadersGaussianBlur1D:()=>Pb,_shadersGeometryStageFS:()=>fL,_shadersGeometryStageVS:()=>dL,_shadersGlobeFS:()=>_B,_shadersGlobeVS:()=>gB,_shadersGridMaterial:()=>eR,_shadersGroundAtmosphere:()=>cw,_shadersHSBToRGB:()=>AD,_shadersHSLToRGB:()=>ED,_shadersImageBasedLightingStageFS:()=>RM,_shadersInstancingStageCommon:()=>HM,_shadersInstancingStageVS:()=>GM,_shadersIntersectBox:()=>_k,_shadersIntersectClippingPlanes:()=>pk,_shadersIntersectCylinder:()=>gk,_shadersIntersectDepth:()=>mk,_shadersIntersectEllipsoid:()=>yk,_shadersIntersectLongitude:()=>Fw,_shadersIntersection:()=>dA,_shadersIntersectionUtils:()=>hk,_shadersLegacyInstancingStageVS:()=>jM,_shadersLensFlare:()=>H3,_shadersLightingStageFS:()=>pL,_shadersMaterialStageFS:()=>gL,_shadersMegatexture:()=>Ak,_shadersMetadataStageFS:()=>sL,_shadersMetadataStageVS:()=>aL,_shadersModelClippingPlanesStageFS:()=>FM,_shadersModelClippingPolygonsStageFS:()=>UM,_shadersModelClippingPolygonsStageVS:()=>kM,_shadersModelColorStageFS:()=>NM,_shadersModelFS:()=>$L,_shadersModelSilhouetteStageFS:()=>kL,_shadersModelSilhouetteStageVS:()=>UL,_shadersModelSplitterStageFS:()=>VL,_shadersModelVS:()=>KL,_shadersModifiedReinhardTonemapping:()=>G3,_shadersMorphTargetsStageVS:()=>bL,_shadersNightVision:()=>j3,_shadersNormalMapMaterial:()=>tR,_shadersOctahedralProjectionAtlasFS:()=>oU,_shadersOctahedralProjectionFS:()=>rU,_shadersOctahedralProjectionVS:()=>sU,_shadersOctree:()=>Ck,_shadersPassThrough:()=>Eu,_shadersPassThroughDepth:()=>vb,_shadersPbrNeutralTonemapping:()=>z3,_shadersPerInstanceColorAppearanceFS:()=>dR,_shadersPerInstanceColorAppearanceVS:()=>hR,_shadersPerInstanceFlatColorAppearanceFS:()=>Tx,_shadersPerInstanceFlatColorAppearanceVS:()=>mR,_shadersPointCloudEyeDomeLighting:()=>dM,_shadersPointCloudStylingStageVS:()=>CL,_shadersPointPrimitiveCollectionFS:()=>L0,_shadersPointPrimitiveCollectionVS:()=>lF,_shadersPolygonSignedDistanceFS:()=>VO,_shadersPolylineArrowMaterial:()=>nR,_shadersPolylineColorAppearanceVS:()=>PR,_shadersPolylineCommon:()=>zu,_shadersPolylineDashMaterial:()=>iR,_shadersPolylineFS:()=>Ix,_shadersPolylineGlowMaterial:()=>oR,_shadersPolylineMaterialAppearanceVS:()=>DR,_shadersPolylineOutlineMaterial:()=>rR,_shadersPolylineShadowVolumeFS:()=>SR,_shadersPolylineShadowVolumeMorphFS:()=>vR,_shadersPolylineShadowVolumeMorphVS:()=>wR,_shadersPolylineShadowVolumeVS:()=>IR,_shadersPolylineVS:()=>dN,_shadersPrimitiveOutlineStageFS:()=>SL,_shadersPrimitiveOutlineStageVS:()=>EL,_shadersRGBToHSB:()=>$D,_shadersRGBToHSL:()=>ZD,_shadersRGBToXYZ:()=>QD,_shadersReinhardTonemapping:()=>W3,_shadersReprojectWebMercatorFS:()=>RB,_shadersReprojectWebMercatorVS:()=>OB,_shadersRimLightingMaterial:()=>sR,_shadersSelectedFeatureIdStageCommon:()=>hS,_shadersShadowVolumeAppearanceFS:()=>xE,_shadersShadowVolumeAppearanceVS:()=>gR,_shadersShadowVolumeFS:()=>ky,_shadersSilhouette:()=>q3,_shadersSkinningStageVS:()=>PL,_shadersSkyAtmosphereCommon:()=>zw,_shadersSkyAtmosphereFS:()=>Bk,_shadersSkyAtmosphereVS:()=>kk,_shadersSkyBoxFS:()=>zk,_shadersSkyBoxVS:()=>Vk,_shadersSlopeRampMaterial:()=>aR,_shadersStripeMaterial:()=>cR,_shadersSunFS:()=>Gk,_shadersSunTextureFS:()=>jk,_shadersSunVS:()=>Wk,_shadersTexturedMaterialAppearanceFS:()=>j1,_shadersTexturedMaterialAppearanceVS:()=>W1,_shadersVector3DTileClampedPolylinesFS:()=>AN,_shadersVector3DTileClampedPolylinesVS:()=>CN,_shadersVector3DTilePolylinesVS:()=>xN,_shadersVectorTileVS:()=>DE,_shadersVerticalExaggerationStageVS:()=>RL,_shadersViewportQuadFS:()=>aU,_shadersViewportQuadVS:()=>ix,_shadersVoxelFS:()=>fk,_shadersVoxelUtils:()=>uk,_shadersVoxelVS:()=>dk,_shadersWater:()=>uR,_shadersWaterMaskMaterial:()=>lR,_shadersXYZToRGB:()=>C1,_shadersacesTonemapping:()=>VP,_shadersalphaWeight:()=>HP,_shadersantialias:()=>GP,_shadersapplyHSBShift:()=>jP,_shadersapproximateSphericalCoordinates:()=>WP,_shadersapproximateTanh:()=>qP,_shadersbackFacing:()=>YP,_shadersbranchFreeTernary:()=>XP,_shaderscascadeColor:()=>KP,_shaderscascadeDistance:()=>$P,_shaderscascadeMatrix:()=>ZP,_shaderscascadeWeights:()=>QP,_shadersclipPolygons:()=>JP,_shaderscolumbusViewMorph:()=>eD,_shaderscomputeAtmosphereColor:()=>tD,_shaderscomputeGroundAtmosphereScattering:()=>nD,_shaderscomputePosition:()=>iD,_shaderscomputeScattering:()=>oD,_shadersconvertUvToBox:()=>bk,_shadersconvertUvToCylinder:()=>xk,_shadersconvertUvToEllipsoid:()=>Tk,_shaderscosineAndSine:()=>rD,_shadersdecompressTextureCoordinates:()=>sD,_shadersdegreesPerRadian:()=>KI,_shadersdepthClamp:()=>aD,_shadersdepthRange:()=>$I,_shadersdepthRangeStruct:()=>MP,_shaderseastNorthUpToEyeCoordinates:()=>cD,_shadersellipsoidContainsPoint:()=>lD,_shadersellipsoidTextureCoordinates:()=>uD,_shadersepsilon1:()=>ZI,_shadersepsilon2:()=>QI,_shadersepsilon3:()=>JI,_shadersepsilon4:()=>eP,_shadersepsilon5:()=>tP,_shadersepsilon6:()=>nP,_shadersepsilon7:()=>iP,_shadersequalsEpsilon:()=>fD,_shaderseyeOffset:()=>dD,_shaderseyeToWindowCoordinates:()=>hD,_shadersfastApproximateAtan:()=>mD,_shadersfog:()=>pD,_shadersgammaCorrect:()=>_D,_shadersgeodeticSurfaceNormal:()=>gD,_shadersgetDefaultMaterial:()=>yD,_shadersgetDynamicAtmosphereLightDirection:()=>bD,_shadersgetLambertDiffuse:()=>xD,_shadersgetSpecular:()=>TD,_shadersgetWaterNoise:()=>CD,_shadershue:()=>SD,_shadersinfinity:()=>oP,_shadersinverseGamma:()=>vD,_shadersisEmpty:()=>wD,_shadersisFull:()=>ID,_shaderslatitudeToWebMercatorFraction:()=>PD,_shaderslineDistance:()=>RD,_shaderslinearToSrgb:()=>DD,_shadersluminance:()=>OD,_shadersmaterial:()=>LP,_shadersmaterialInput:()=>NP,_shadersmaximumComponent:()=>MD,_shadersmetersPerPixel:()=>LD,_shadersmodelMaterial:()=>FP,_shadersmodelToWindowCoordinates:()=>ND,_shadersmodelVertexOutput:()=>BP,_shadersmultiplyWithColorBalance:()=>FD,_shadersnearFarScalar:()=>BD,_shadersoctDecode:()=>kD,_shadersoneOverPi:()=>rP,_shadersoneOverTwoPi:()=>sP,_shaderspackDepth:()=>UD,_shaderspassCesium3DTile:()=>aP,_shaderspassCesium3DTileClassification:()=>cP,_shaderspassCesium3DTileClassificationIgnoreShow:()=>lP,_shaderspassClassification:()=>uP,_shaderspassCompute:()=>fP,_shaderspassEnvironment:()=>dP,_shaderspassGlobe:()=>hP,_shaderspassOpaque:()=>mP,_shaderspassOverlay:()=>pP,_shaderspassTerrainClassification:()=>_P,_shaderspassTranslucent:()=>gP,_shaderspassVoxels:()=>yP,_shaderspbrLighting:()=>zD,_shaderspbrNeutralTonemapping:()=>VD,_shadersphong:()=>HD,_shaderspi:()=>bP,_shaderspiOverFour:()=>xP,_shaderspiOverSix:()=>TP,_shaderspiOverThree:()=>CP,_shaderspiOverTwo:()=>AP,_shadersplaneDistance:()=>GD,_shaderspointAlongRay:()=>jD,_shadersradiansPerDegree:()=>EP,_shadersray:()=>kP,_shadersrayEllipsoidIntersectionInterval:()=>WD,_shadersraySegment:()=>UP,_shadersraySphereIntersectionInterval:()=>qD,_shadersreadDepth:()=>YD,_shadersreadNonPerspective:()=>XD,_shadersreverseLogDepth:()=>KD,_shadersround:()=>JD,_shaderssaturation:()=>e1,_shaderssceneMode2D:()=>SP,_shaderssceneMode3D:()=>vP,_shaderssceneModeColumbusView:()=>wP,_shaderssceneModeMorphing:()=>IP,_shadersshadowDepthCompare:()=>t1,_shadersshadowParameters:()=>zP,_shadersshadowVisibility:()=>n1,_shaderssignNotZero:()=>i1,_shaderssolarRadius:()=>PP,_shaderssphericalHarmonics:()=>o1,_shaderssrgbToLinear:()=>r1,_shaderstangentToEyeSpaceMatrix:()=>s1,_shaderstextureCube:()=>a1,_shadersthreePiOver2:()=>DP,_shaderstransformPlane:()=>c1,_shaderstranslateRelativeToEye:()=>l1,_shaderstranslucentPhong:()=>u1,_shaderstranspose:()=>f1,_shaderstwoPi:()=>RP,_shadersunpackClippingExtents:()=>d1,_shadersunpackDepth:()=>h1,_shadersunpackFloat:()=>m1,_shadersunpackUint:()=>p1,_shadersvalueTransform:()=>_1,_shadersvertexLogDepth:()=>g1,_shaderswebMercatorMaxLatitude:()=>OP,_shaderswindowToEyeCoordinates:()=>y1,_shaderswriteDepthClamp:()=>b1,_shaderswriteLogDepth:()=>x1,_shaderswriteNonPerspective:()=>T1,addBuffer:()=>EO,addDefaults:()=>_O,addExtensionsRequired:()=>TO,addExtensionsUsed:()=>rd,addPipelineExtras:()=>Jy,addToArray:()=>Fs,appendForwardSlash:()=>yI,arrayRemoveDuplicates:()=>So,barycentricCoordinates:()=>rx,binarySearch:()=>Uo,buildModuleUrl:()=>on,buildVoxelDrawCommands:()=>vk,clone:()=>Fe,combine:()=>ct,computeFlyToLocationForRectangle:()=>jC,createBillboardPointCallback:()=>ET,createCommand:()=>Sn,createDefaultImageryProviderViewModels:()=>iz,createDefaultTerrainProviderViewModels:()=>oz,createElevationBandMaterial:()=>ZJ,createGooglePhotorealistic3DTileset:()=>QJ,createGuid:()=>Ln,createMaterialPropertyDescriptor:()=>zo,createOsmBuildingsAsync:()=>JJ,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>fl,createTangentSpaceDebugPrimitive:()=>eee,createTaskProcessorWorker:()=>Bee,createUniform:()=>MI,createUniformArray:()=>LI,createWorldBathymetryAsync:()=>Z2,createWorldImageryAsync:()=>ty,createWorldTerrainAsync:()=>MC,decodeGoogleEarthEnterpriseData:()=>Q2,decodeVectorPolylinePositions:()=>vN,defaultValue:()=>Oe,defer:()=>Zs,defined:()=>l,demodernizeShader:()=>A1,deprecationWarning:()=>Po,destroyObject:()=>ce,exportKml:()=>RK,findAccessorMinMax:()=>nT,findContentMetadata:()=>DT,findGroupMetadata:()=>RT,findTileMetadata:()=>DN,forEachTextureInMaterial:()=>UE,formatError:()=>Sp,freezeRenderState:()=>rj,getAbsoluteUri:()=>Ou,getAccessorByteStride:()=>iu,getBaseUri:()=>bI,getBinaryAccessor:()=>Gu,getClipAndStyleCode:()=>Kk,getClippingFunction:()=>Zg,getComponentReader:()=>F_,getElement:()=>Dn,getExtensionFromUri:()=>Xb,getFilenameFromUri:()=>Eg,getImageFromTypedArray:()=>iB,getImagePixels:()=>nh,getJsonFromTypedArray:()=>Ho,getMagic:()=>bl,getMetadataClassProperty:()=>Mk,getMetadataProperty:()=>Nk,getStringFromTypedArray:()=>ia,getTimestamp:()=>Si,hasExtension:()=>ai,heightReferenceOnEntityPropertyChanged:()=>C_,isBitSet:()=>Xc,isBlobUri:()=>Kb,isCrossOriginUrl:()=>Ey,isDataUri:()=>Jp,isLeapYear:()=>th,knockout:()=>be,knockout_3_5_1:()=>HA,knockout_es5:()=>YU,loadAndExecuteScript:()=>$b,loadCubeMap:()=>O1,loadImageFromTypedArray:()=>L_,loadKTX2:()=>Qs,mergeSort:()=>Kg,moveTechniqueRenderStates:()=>xO,moveTechniquesToExtension:()=>CO,numberOfComponentsForType:()=>Wu,objectToQuery:()=>Zb,oneTimeWarning:()=>bt,parseBatchTable:()=>q_,parseFeatureMetadataLegacy:()=>eM,parseGlb:()=>yO,parseResponseHeaders:()=>xI,parseStructuralMetadata:()=>JO,pickModel:()=>gS,pointInsideTriangle:()=>DZ,preprocess3DTileContent:()=>ug,processVoxelProperties:()=>Sk,queryToObject:()=>Mu,readAccessorPacked:()=>SO,removeExtension:()=>iT,removeExtensionsRequired:()=>gO,removeExtensionsUsed:()=>tT,removePipelineExtras:()=>bO,removeUnusedElements:()=>AO,resizeImageToNextPowerOfTwo:()=>n0,sampleTerrain:()=>dB,sampleTerrainMostDetailed:()=>zC,scaleToGeodeticSurface:()=>Yb,srgbToLinear:()=>HC,subdivideArray:()=>yR,subscribeAndEvaluate:()=>Ga,updateAccessorComponentTypes:()=>vO,updateVersion:()=>wO,usesExtension:()=>yr,viewerCesium3DTilesInspectorMixin:()=>jte,viewerCesiumInspectorMixin:()=>Wte,viewerDragDropMixin:()=>Yte,viewerPerformanceWatchdogMixin:()=>Xte,viewerVoxelInspectorMixin:()=>$te,webGLConstantToGlslType:()=>$g,wrapFunction:()=>pB,writeTextToCanvas:()=>vT});module.exports=eh(uBt);function tDe(e){return e!=null}var l=tDe;function Wb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Wb.prototype=Object.create(Error.prototype),Wb.prototype.constructor=Wb);Wb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};Wb.throwInstantiationError=function(){throw new Wb("This function defines an interface and should not be called directly.")};var he=Wb;var Ls={};Ls.typeOf={};function nDe(e){return`${e} is required, actual value was undefined`}function qA(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ls.defined=function(e,t){if(!l(t))throw new he(nDe(e))};Ls.typeOf.func=function(e,t){if(typeof t!="function")throw new he(qA(typeof t,"function",e))};Ls.typeOf.string=function(e,t){if(typeof t!="string")throw new he(qA(typeof t,"string",e))};Ls.typeOf.number=function(e,t){if(typeof t!="number")throw new he(qA(typeof t,"number",e))};Ls.typeOf.number.lessThan=function(e,t,n){if(Ls.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ls.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ls.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ls.typeOf.number.greaterThan=function(e,t,n){if(Ls.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ls.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ls.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Ls.typeOf.object=function(e,t){if(typeof t!="object")throw new he(qA(typeof t,"object",e))};Ls.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(qA(typeof t,"boolean",e))};Ls.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(qA(typeof t,"bigint",e))};Ls.typeOf.number.equals=function(e,t,n,i){if(Ls.typeOf.number(e,n),Ls.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var ro=Ls;var p9=er(Vz(),1);var rt={};rt.EPSILON1=.1;rt.EPSILON2=.01;rt.EPSILON3=.001;rt.EPSILON4=1e-4;rt.EPSILON5=1e-5;rt.EPSILON6=1e-6;rt.EPSILON7=1e-7;rt.EPSILON8=1e-8;rt.EPSILON9=1e-9;rt.EPSILON10=1e-10;rt.EPSILON11=1e-11;rt.EPSILON12=1e-12;rt.EPSILON13=1e-13;rt.EPSILON14=1e-14;rt.EPSILON15=1e-15;rt.EPSILON16=1e-16;rt.EPSILON17=1e-17;rt.EPSILON18=1e-18;rt.EPSILON19=1e-19;rt.EPSILON20=1e-20;rt.EPSILON21=1e-21;rt.GRAVITATIONALPARAMETER=3986004418e5;rt.SOLAR_RADIUS=6955e5;rt.LUNAR_RADIUS=1737400;rt.SIXTY_FOUR_KILOBYTES=64*1024;rt.FOUR_GIGABYTES=4*1024*1024*1024;rt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};rt.signNotZero=function(e){return e<0?-1:1};rt.toSNorm=function(e,t){return t=t??255,Math.round((rt.clamp(e,-1,1)*.5+.5)*t)};rt.fromSNorm=function(e,t){return t=t??255,rt.clamp(e,0,t)/t*2-1};rt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:rt.clamp((e-t)/n,0,1)};rt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};rt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};rt.lerp=function(e,t,n){return(1-n)*e+n*t};rt.PI=Math.PI;rt.ONE_OVER_PI=1/Math.PI;rt.PI_OVER_TWO=Math.PI/2;rt.PI_OVER_THREE=Math.PI/3;rt.PI_OVER_FOUR=Math.PI/4;rt.PI_OVER_SIX=Math.PI/6;rt.THREE_PI_OVER_TWO=3*Math.PI/2;rt.TWO_PI=2*Math.PI;rt.ONE_OVER_TWO_PI=1/(2*Math.PI);rt.RADIANS_PER_DEGREE=Math.PI/180;rt.DEGREES_PER_RADIAN=180/Math.PI;rt.RADIANS_PER_ARCSECOND=rt.RADIANS_PER_DEGREE/3600;rt.toRadians=function(e){return e*rt.RADIANS_PER_DEGREE};rt.toDegrees=function(e){return e*rt.DEGREES_PER_RADIAN};rt.convertLongitudeRange=function(e){let t=rt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};rt.clampToLatitudeRange=function(e){return rt.clamp(e,-1*rt.PI_OVER_TWO,rt.PI_OVER_TWO)};rt.negativePiToPi=function(e){return e>=-rt.PI&&e<=rt.PI?e:rt.zeroToTwoPi(e+rt.PI)-rt.PI};rt.zeroToTwoPi=function(e){if(e>=0&&e<=rt.TWO_PI)return e;let t=rt.mod(e,rt.TWO_PI);return Math.abs(t)<rt.EPSILON14&&Math.abs(e)>rt.EPSILON14?rt.TWO_PI:t};rt.mod=function(e,t){return rt.sign(e)===rt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};rt.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))};rt.lessThan=function(e,t,n){return e-t<-n};rt.lessThanOrEquals=function(e,t,n){return e-t<n};rt.greaterThan=function(e,t,n){return e-t>n};rt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var Hz=[1];rt.factorial=function(e){let t=Hz.length;if(e>=t){let n=Hz[t-1];for(let i=t;i<=e;i++){let o=n*i;Hz.push(o),n=o}}return Hz[e]};rt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};rt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};rt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};rt.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};rt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var nne=new p9.default;rt.setRandomNumberSeed=function(e){nne=new p9.default(e)};rt.nextRandomNumber=function(){return nne.random()};rt.randomBetween=function(e,t){return rt.nextRandomNumber()*(t-e)+e};rt.acosClamped=function(e){return Math.acos(rt.clamp(e,-1,1))};rt.asinClamped=function(e){return Math.asin(rt.clamp(e,-1,1))};rt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};rt.logBase=function(e,t){return Math.log(e)/Math.log(t)};rt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};rt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};rt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};rt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};rt.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=rt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?rt.PI_OVER_TWO-i:i,i=e<0?rt.PI-i:i,i=t<0?-i:i,i};var D=rt;function Je(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Je.fromSpherical=function(e,t){l(t)||(t=new Je);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};Je.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Je(e,t,n)};Je.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Je(e.x,e.y,e.z)};Je.fromCartesian4=Je.clone;Je.packedLength=3;Je.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Je.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Je),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Je.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)Je.pack(e[o],t,o*3);return t};Je.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]=Je.unpack(e,i,t[o])}return t};Je.fromArray=Je.unpack;Je.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Je.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Je.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};Je.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};Je.clamp=function(e,t,n,i){let o=D.clamp(e.x,t.x,n.x),r=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Je.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Je.magnitude=function(e){return Math.sqrt(Je.magnitudeSquared(e))};var jz=new Je;Je.distance=function(e,t){return Je.subtract(e,t,jz),Je.magnitude(jz)};Je.distanceSquared=function(e,t){return Je.subtract(e,t,jz),Je.magnitudeSquared(jz)};Je.normalize=function(e,t){let n=Je.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Je.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Je.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};Je.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};Je.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};Je.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};Je.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Je.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Je.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Je.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 ine=new Je;Je.lerp=function(e,t,n,i){return Je.multiplyByScalar(t,n,ine),i=Je.multiplyByScalar(e,1-n,i),Je.add(ine,i,i)};var Gz=new Je,_9=new Je;Je.angleBetween=function(e,t){Je.normalize(e,Gz),Je.normalize(t,_9);let n=Je.dot(Gz,_9),i=Je.magnitude(Je.cross(Gz,_9,Gz));return Math.atan2(i,n)};var iDe=new Je;Je.mostOrthogonalAxis=function(e,t){let n=Je.normalize(e,iDe);return Je.abs(n,n),n.x<=n.y?n.x<=n.z?t=Je.clone(Je.UNIT_X,t):t=Je.clone(Je.UNIT_Z,t):n.y<=n.z?t=Je.clone(Je.UNIT_Y,t):t=Je.clone(Je.UNIT_Z,t),t};Je.projectVector=function(e,t,n){let i=Je.dot(e,t)/Je.dot(t,t);return Je.multiplyByScalar(t,i,n)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Je.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Je.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)};Je.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,d=i*a-o*s;return n.x=u,n.y=f,n.z=d,n};Je.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};Je.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e),t=D.toRadians(t),Je.fromRadians(e,t,n,i,o)};var zf=new Je,YA=new Je;Je._ellipsoidRadiiSquared=new Je(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Je.fromRadians=function(e,t,n,i,o){n=n??0;let r=l(i)?i.radiiSquared:Je._ellipsoidRadiiSquared,s=Math.cos(t);zf.x=s*Math.cos(e),zf.y=s*Math.sin(e),zf.z=Math.sin(t),zf=Je.normalize(zf,zf),Je.multiplyComponents(r,zf,YA);let a=Math.sqrt(Je.dot(zf,YA));return YA=Je.divideByScalar(YA,a,YA),zf=Je.multiplyByScalar(zf,n,zf),l(o)||(o=new Je),Je.add(YA,zf,o)};Je.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]=Je.fromDegrees(r,s,0,t,n[a])}return n};Je.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]=Je.fromRadians(r,s,0,t,n[a])}return n};Je.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]=Je.fromDegrees(r,s,a,t,n[c])}return n};Je.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]=Je.fromRadians(r,s,a,t,n[c])}return n};Je.ZERO=Object.freeze(new Je(0,0,0));Je.ONE=Object.freeze(new Je(1,1,1));Je.UNIT_X=Object.freeze(new Je(1,0,0));Je.UNIT_Y=Object.freeze(new Je(0,1,0));Je.UNIT_Z=Object.freeze(new Je(0,0,1));Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.prototype.equalsEpsilon=function(e,t,n){return Je.equalsEpsilon(this,e,t,n)};Je.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=Je;function Tt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}Tt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Tt(e,t,n,i)};Tt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Tt(e.red,e.green,e.blue,e.alpha)};Tt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Tt(e.x,e.y,e.z,e.w)};Tt.packedLength=4;Tt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};Tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Tt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};Tt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Tt.pack(e[o],t,o*4);return t};Tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Tt.unpack(e,i,t[o])}return t};Tt.fromArray=Tt.unpack;Tt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};Tt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};Tt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};Tt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};Tt.clamp=function(e,t,n,i){let o=D.clamp(e.x,t.x,n.x),r=D.clamp(e.y,t.y,n.y),s=D.clamp(e.z,t.z,n.z),a=D.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};Tt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};Tt.magnitude=function(e){return Math.sqrt(Tt.magnitudeSquared(e))};var Wz=new Tt;Tt.distance=function(e,t){return Tt.subtract(e,t,Wz),Tt.magnitude(Wz)};Tt.distanceSquared=function(e,t){return Tt.subtract(e,t,Wz),Tt.magnitudeSquared(Wz)};Tt.normalize=function(e,t){let n=Tt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};Tt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Tt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};Tt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};Tt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};Tt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};Tt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};Tt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};Tt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Tt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var one=new Tt;Tt.lerp=function(e,t,n,i){return Tt.multiplyByScalar(t,n,one),i=Tt.multiplyByScalar(e,1-n,i),Tt.add(one,i,i)};var oDe=new Tt;Tt.mostOrthogonalAxis=function(e,t){let n=Tt.normalize(e,oDe);return Tt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Tt.clone(Tt.UNIT_X,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Tt.clone(Tt.UNIT_Y,t):t=Tt.clone(Tt.UNIT_W,t):n.z<=n.w?t=Tt.clone(Tt.UNIT_Z,t):t=Tt.clone(Tt.UNIT_W,t),t};Tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};Tt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};Tt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.equalsEpsilon(e.y,t.y,n,i)&&D.equalsEpsilon(e.z,t.z,n,i)&&D.equalsEpsilon(e.w,t.w,n,i)};Tt.ZERO=Object.freeze(new Tt(0,0,0,0));Tt.ONE=Object.freeze(new Tt(1,1,1,1));Tt.UNIT_X=Object.freeze(new Tt(1,0,0,0));Tt.UNIT_Y=Object.freeze(new Tt(0,1,0,0));Tt.UNIT_Z=Object.freeze(new Tt(0,0,1,0));Tt.UNIT_W=Object.freeze(new Tt(0,0,0,1));Tt.prototype.clone=function(e){return Tt.clone(this,e)};Tt.prototype.equals=function(e){return Tt.equals(this,e)};Tt.prototype.equalsEpsilon=function(e,t,n){return Tt.equalsEpsilon(this,e,t,n)};Tt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var g9=new Float32Array(1),xc=new Uint8Array(g9.buffer),rDe=new Uint32Array([287454020]),sDe=new Uint8Array(rDe.buffer),rne=sDe[0]===68;Tt.packFloat=function(e,t){return l(t)||(t=new Tt),g9[0]=e,rne?(t.x=xc[0],t.y=xc[1],t.z=xc[2],t.w=xc[3]):(t.x=xc[3],t.y=xc[2],t.z=xc[1],t.w=xc[0]),t};Tt.unpackFloat=function(e){return rne?(xc[0]=e.x,xc[1]=e.y,xc[2]=e.z,xc[3]=e.w):(xc[0]=e.w,xc[1]=e.z,xc[2]=e.y,xc[3]=e.x),g9[0]};var ie=Tt;var y9={};y9.EMPTY_OBJECT=Object.freeze({});y9.EMPTY_ARRAY=Object.freeze([]);var G=y9;function tt(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}tt.packedLength=9;tt.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};tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new tt),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};tt.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)tt.pack(e[o],t,o*9);return t};tt.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]=tt.unpack(e,i,t[o])}return t};tt.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 tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.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 tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,_=2*(i-f),m=2*(o+c),y=2*(i+f),b=-n+s-u+d,x=2*(a-r),T=2*(o-c),C=2*(a+r),A=-n-s+u+d;return l(t)?(t[0]=p,t[1]=y,t[2]=T,t[3]=_,t[4]=b,t[5]=C,t[6]=m,t[7]=x,t[8]=A,t):new tt(p,_,m,y,b,x,T,C,A)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,d=n*s,p=o*i+a*r*s,_=-a*i+o*r*s,m=-r,y=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=d,t[2]=m,t[3]=u,t[4]=p,t[5]=y,t[6]=f,t[7]=_,t[8]=b,t):new tt(c,u,f,d,p,_,m,y,b)};tt.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 tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.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 tt(e,0,0,0,e,0,0,0,e)};tt.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 tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.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 tt(1,0,0,0,n,-i,0,i,n)};tt.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 tt(n,0,i,0,1,0,-i,0,n)};tt.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 tt(n,-i,0,i,n,0,0,0,1)};tt.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]]};tt.getElementIndex=function(e,t){return e*3+t};tt.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};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.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};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var aDe=new h;tt.setScale=function(e,t,n){let i=tt.getScale(e,aDe),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 cDe=new h;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,cDe),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 b9=new h;tt.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],b9)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],b9)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],b9)),t};var sne=new h;tt.getMaximumScale=function(e){return tt.getScale(e,sne),h.maximumComponent(sne)};var lDe=new h;tt.setRotation=function(e,t,n){let i=tt.getScale(e,lDe);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 uDe=new h;tt.getRotation=function(e,t){let n=tt.getScale(e,uDe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[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};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};tt.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};tt.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};tt.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};tt.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};tt.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};tt.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};tt.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};tt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function fDe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var x9=[1,0,0],T9=[2,2,1];function dDe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(T9[n],x9[n])];t+=2*i*i}return Math.sqrt(t)}function hDe(e,t){let n=D.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(T9[u],x9[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=x9[o],c=T9[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,_;p<0?_=-1/(-p+Math.sqrt(1+p*p)):_=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+_*_),s=_*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var qz=new tt,ane=new tt;tt.computeEigenDecomposition=function(e,t){let n=D.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*fDe(a);for(;r<i&&dDe(a)>c;)hDe(a,qz),tt.transpose(qz,ane),tt.multiply(a,qz,a),tt.multiply(ane,a,a),tt.multiply(s,qz,s),++o>2&&(++r,o=0);return t};tt.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};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var mDe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,mDe),t)};tt.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]};tt.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};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.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]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) -(${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var Z=tt;function pI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(pI.prototype=Object.create(Error.prototype),pI.prototype.constructor=pI);pI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var se=pI;function et(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,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]=u??0,this[7]=_??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=d??0,this[15]=y??0}et.packedLength=16;et.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};et.unpack=function(e,t,n){return t=t??0,l(n)||(n=new et),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};et.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)et.pack(e[o],t,o*16);return t};et.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]=et.unpack(e,i,t[o])}return t};et.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 et(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])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return et.clone(e,t)};et.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 et(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])};et.fromRotationTranslation=function(e,t,n){return t=t??h.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 et(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)};et.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new et);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,_=t.y*t.w,m=t.z*t.z,y=t.z*t.w,b=t.w*t.w,x=a-d-m+b,T=2*(c-y),C=2*(u+_),A=2*(c+y),S=-a+d-m+b,w=2*(p-f),R=2*(u-_),P=2*(p+f),O=-a-d+m+b;return i[0]=x*o,i[1]=A*o,i[2]=R*o,i[3]=0,i[4]=T*r,i[5]=S*r,i[6]=P*r,i[7]=0,i[8]=C*s,i[9]=w*s,i[10]=O*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};et.fromTranslationRotationScale=function(e,t){return et.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};et.fromTranslation=function(e,t){return et.fromRotationTranslation(Z.IDENTITY,e,t)};et.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 et(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};et.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 et(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};et.fromRotation=function(e,t){return l(t)||(t=new et),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 XA=new h,KA=new h,_I=new h;et.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,XA),h.normalize(h.cross(XA,o,KA),KA),h.normalize(h.cross(KA,XA,_I),_I);let r=KA.x,s=KA.y,a=KA.z,c=XA.x,u=XA.y,f=XA.z,d=_I.x,p=_I.y,_=_I.z,m=n.x,y=n.y,b=n.z,x=r*-m+s*-y+a*-b,T=d*-m+p*-y+_*-b,C=c*m+u*y+f*b;return l(t)?(t[0]=r,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=_,t[10]=-f,t[11]=0,t[12]=x,t[13]=T,t[14]=C,t[15]=1,t):new et(r,s,a,x,d,p,_,T,-c,-u,-f,C,0,0,0,1)};et.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};et.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,d=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};et.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(r+o)/(r-o),p=-1,_=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=_,s[15]=0,s};et.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-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]=u,r[10]=f,r[11]=d,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};et.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new et),e=e??G.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,_=f,m=o+c,y=r+u,b=t+f,x=1;return i[0]=d,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]=_,i[11]=0,i[12]=m,i[13]=y,i[14]=b,i[15]=x,i};et.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]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};et.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]]};et.getElementIndex=function(e,t){return e*4+t};et.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};et.setColumn=function(e,t,n,i){i=et.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};et.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};et.setRow=function(e,t,n,i){return i=et.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};et.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 pDe=new h;et.setScale=function(e,t,n){let i=et.getScale(e,pDe),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 _De=new h;et.setUniformScale=function(e,t,n){let i=et.getScale(e,_De),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 C9=new h;et.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],C9)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],C9)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],C9)),t};var cne=new h;et.getMaximumScale=function(e){return et.getScale(e,cne),h.maximumComponent(cne)};var gDe=new h;et.setRotation=function(e,t,n){let i=et.getScale(e,gDe);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 yDe=new h;et.getRotation=function(e,t){let n=et.getScale(e,yDe);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};et.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],_=e[10],m=e[11],y=e[12],b=e[13],x=e[14],T=e[15],C=t[0],A=t[1],S=t[2],w=t[3],R=t[4],P=t[5],O=t[6],L=t[7],g=t[8],E=t[9],v=t[10],I=t[11],N=t[12],F=t[13],U=t[14],k=t[15],z=i*C+a*A+d*S+y*w,B=o*C+c*A+p*S+b*w,j=r*C+u*A+_*S+x*w,W=s*C+f*A+m*S+T*w,J=i*R+a*P+d*O+y*L,Y=o*R+c*P+p*O+b*L,ee=r*R+u*P+_*O+x*L,Q=s*R+f*P+m*O+T*L,de=i*g+a*E+d*v+y*I,ge=o*g+c*E+p*v+b*I,le=r*g+u*E+_*v+x*I,ye=s*g+f*E+m*v+T*I,xe=i*N+a*F+d*U+y*k,Ie=o*N+c*F+p*U+b*k,Te=r*N+u*F+_*U+x*k,ve=s*N+f*F+m*U+T*k;return n[0]=z,n[1]=B,n[2]=j,n[3]=W,n[4]=J,n[5]=Y,n[6]=ee,n[7]=Q,n[8]=de,n[9]=ge,n[10]=le,n[11]=ye,n[12]=xe,n[13]=Ie,n[14]=Te,n[15]=ve,n};et.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};et.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};et.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],_=e[13],m=e[14],y=t[0],b=t[1],x=t[2],T=t[4],C=t[5],A=t[6],S=t[8],w=t[9],R=t[10],P=t[12],O=t[13],L=t[14],g=i*y+s*b+u*x,E=o*y+a*b+f*x,v=r*y+c*b+d*x,I=i*T+s*C+u*A,N=o*T+a*C+f*A,F=r*T+c*C+d*A,U=i*S+s*w+u*R,k=o*S+a*w+f*R,z=r*S+c*w+d*R,B=i*P+s*O+u*L+p,j=o*P+a*O+f*L+_,W=r*P+c*O+d*L+m;return n[0]=g,n[1]=E,n[2]=v,n[3]=0,n[4]=I,n[5]=N,n[6]=F,n[7]=0,n[8]=U,n[9]=k,n[10]=z,n[11]=0,n[12]=B,n[13]=j,n[14]=W,n[15]=1,n};et.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],_=t[1],m=t[2],y=t[3],b=t[4],x=t[5],T=t[6],C=t[7],A=t[8],S=i*p+s*_+u*m,w=o*p+a*_+f*m,R=r*p+c*_+d*m,P=i*y+s*b+u*x,O=o*y+a*b+f*x,L=r*y+c*b+d*x,g=i*T+s*C+u*A,E=o*T+a*C+f*A,v=r*T+c*C+d*A;return n[0]=S,n[1]=w,n[2]=R,n[3]=0,n[4]=P,n[5]=O,n[6]=L,n[7]=0,n[8]=g,n[9]=E,n[10]=v,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.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};et.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?et.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)};et.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};et.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};et.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};et.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};et.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};et.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};et.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};et.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};et.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]};et.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};et.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};et.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 bDe=new Z,xDe=new Z,TDe=new ie,CDe=new ie(0,0,0,1);et.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],_=e[14],m=e[3],y=e[7],b=e[11],x=e[15],T=p*x,C=_*b,A=d*x,S=_*y,w=d*b,R=p*y,P=f*x,O=_*m,L=f*b,g=p*m,E=f*y,v=d*m,I=T*a+S*c+w*u-(C*a+A*c+R*u),N=C*s+P*c+g*u-(T*s+O*c+L*u),F=A*s+O*a+E*u-(S*s+P*a+v*u),U=R*s+L*a+v*c-(w*s+g*a+E*c),k=C*i+A*o+R*r-(T*i+S*o+w*r),z=T*n+O*o+L*r-(C*n+P*o+g*r),B=S*n+P*i+v*r-(A*n+O*i+E*r),j=w*n+g*i+E*o-(R*n+L*i+v*o);T=o*u,C=r*c,A=i*u,S=r*a,w=i*c,R=o*a,P=n*u,O=r*s,L=n*c,g=o*s,E=n*a,v=i*s;let W=T*y+S*b+w*x-(C*y+A*b+R*x),J=C*m+P*b+g*x-(T*m+O*b+L*x),Y=A*m+O*y+E*x-(S*m+P*y+v*x),ee=R*m+L*y+v*b-(w*m+g*y+E*b),Q=A*p+R*_+C*d-(w*_+T*d+S*p),de=L*_+T*f+O*p-(P*p+g*_+C*f),ge=P*d+v*_+S*f-(E*_+A*f+O*d),le=E*p+w*f+g*d-(L*d+v*p+R*f),ye=n*I+i*N+o*F+r*U;if(Math.abs(ye)<D.EPSILON21){if(Z.equalsEpsilon(et.getMatrix3(e,bDe),xDe,D.EPSILON7)&&ie.equals(et.getRow(e,3,TDe),CDe))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 se("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=I*ye,t[1]=N*ye,t[2]=F*ye,t[3]=U*ye,t[4]=k*ye,t[5]=z*ye,t[6]=B*ye,t[7]=j*ye,t[8]=W*ye,t[9]=J*ye,t[10]=Y*ye,t[11]=ee*ye,t[12]=Q*ye,t[13]=de*ye,t[14]=ge*ye,t[15]=le*ye,t};et.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],_=e[14],m=-n*d-i*p-o*_,y=-r*d-s*p-a*_,b=-c*d-u*p-f*_;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=b,t[15]=1,t};var ADe=new et;et.inverseTranspose=function(e,t){return et.inverse(et.transpose(e,ADe),t)};et.IDENTITY=Object.freeze(new et(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN0ROW3=3;et.COLUMN1ROW0=4;et.COLUMN1ROW1=5;et.COLUMN1ROW2=6;et.COLUMN1ROW3=7;et.COLUMN2ROW0=8;et.COLUMN2ROW1=9;et.COLUMN2ROW2=10;et.COLUMN2ROW3=11;et.COLUMN3ROW0=12;et.COLUMN3ROW1=13;et.COLUMN3ROW2=14;et.COLUMN3ROW3=15;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.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]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) -(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) -(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var M=et;var EDe={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},q=Object.freeze(EDe);var SDe=new h;function Dt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Aa={};Aa[q.FLOAT]="float";Aa[q.FLOAT_VEC2]="vec2";Aa[q.FLOAT_VEC3]="vec3";Aa[q.FLOAT_VEC4]="vec4";Aa[q.INT]="int";Aa[q.INT_VEC2]="ivec2";Aa[q.INT_VEC3]="ivec3";Aa[q.INT_VEC4]="ivec4";Aa[q.BOOL]="bool";Aa[q.BOOL_VEC2]="bvec2";Aa[q.BOOL_VEC3]="bvec3";Aa[q.BOOL_VEC4]="bvec4";Aa[q.FLOAT_MAT2]="mat2";Aa[q.FLOAT_MAT3]="mat3";Aa[q.FLOAT_MAT4]="mat4";Aa[q.SAMPLER_2D]="sampler2D";Aa[q.SAMPLER_CUBE]="samplerCube";Dt.prototype.getDeclaration=function(e){let t=`uniform ${Aa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var vDe={czm_viewport:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Dt({size:1,datatype:q.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,SDe)}}),czm_frameNumber:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Dt({size:1,datatype:q.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Dt({size:1,datatype:q.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Dt({size:1,datatype:q.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Dt({size:9,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},$p=vDe;function wDe(){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 Ln=wDe;function IDe(){return!0}function PDe(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=IDe}var ce=PDe;var $s={UNSIGNED_BYTE:q.UNSIGNED_BYTE,UNSIGNED_SHORT:q.UNSIGNED_SHORT,UNSIGNED_INT:q.UNSIGNED_INT};$s.getSizeInBytes=function(e){switch(e){case $s.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case $s.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case $s.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};$s.fromSizeInBytes=function(e){switch(e){case 2:return $s.UNSIGNED_SHORT;case 4:return $s.UNSIGNED_INT;case 1:return $s.UNSIGNED_BYTE}};$s.validate=function(e){return l(e)&&(e===$s.UNSIGNED_BYTE||e===$s.UNSIGNED_SHORT||e===$s.UNSIGNED_INT)};$s.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};$s.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};$s.fromTypedArray=function(e){if(e instanceof Uint8Array)return $s.UNSIGNED_BYTE;if(e instanceof Uint16Array)return $s.UNSIGNED_SHORT;if(e instanceof Uint32Array)return $s.UNSIGNED_INT};var ke=Object.freeze($s);var Yz={STREAM_DRAW:q.STREAM_DRAW,STATIC_DRAW:q.STATIC_DRAW,DYNAMIC_DRAW:q.DYNAMIC_DRAW,validate:function(e){return e===Yz.STREAM_DRAW||e===Yz.STATIC_DRAW||e===Yz.DYNAMIC_DRAW}},Ne=Object.freeze(Yz);function Vf(e){e=e??G.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=Ln(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Vf.createVertexBuffer=function(e){return new Vf({context:e.context,bufferTarget:q.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Vf.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=ke.getSizeInBytes(n),o=new Vf({context:t,bufferTarget:q.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(Vf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Vf.prototype._getBuffer=function(){return this._buffer};Vf.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)};Vf.prototype.copyFromBuffer=function(e,t,n,i){let o=q.COPY_READ_BUFFER,r=q.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)};Vf.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=q.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ce(this)};var st=Vf;var Ty,Vr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Xl={};Object.defineProperties(Xl,{element:{get:function(){if(Xl.supportsFullscreen())return document[Vr.fullscreenElement]}},changeEventName:{get:function(){if(Xl.supportsFullscreen())return Vr.fullscreenchange}},errorEventName:{get:function(){if(Xl.supportsFullscreen())return Vr.fullscreenerror}},enabled:{get:function(){if(Xl.supportsFullscreen())return document[Vr.fullscreenEnabled]}},fullscreen:{get:function(){if(Xl.supportsFullscreen())return Xl.element!==null}}});Xl.supportsFullscreen=function(){if(l(Ty))return Ty;Ty=!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",Ty=!0,Ty;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,Ty=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Vr.requestFullscreen=n,Ty=!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 Ty};Xl.requestFullscreen=function(e,t){Xl.supportsFullscreen()&&e[Vr.requestFullscreen]({vrDisplay:t})};Xl.exitFullscreen=function(){Xl.supportsFullscreen()&&document[Vr.exitFullscreen]()};Xl._names=Vr;var Ir=Xl;var Tc;typeof navigator<"u"?Tc=navigator:Tc={};function qb(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var Xz,lne;function I9(){if(!l(Xz)&&(Xz=!1,!eV())){let e=/ Chrome\/([\.0-9]+)/.exec(Tc.userAgent);e!==null&&(Xz=!0,lne=qb(e[1]))}return Xz}function DDe(){return I9()&&lne}var Kz,une;function fne(){if(!l(Kz)&&(Kz=!1,!I9()&&!eV()&&/ Safari\/[\.0-9]+/.test(Tc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Tc.userAgent);e!==null&&(Kz=!0,une=qb(e[1]))}return Kz}function RDe(){return fne()&&une}var $z,v9;function dne(){if(!l($z)){$z=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Tc.userAgent);e!==null&&($z=!0,v9=qb(e[1]),v9.isNightly=!!e[2])}return $z}function ODe(){return dne()&&v9}var gI,w9;function hne(){if(!l(gI)){gI=!1;let e;Tc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Tc.userAgent),e!==null&&(gI=!0,w9=qb(e[1]))):Tc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Tc.userAgent),e!==null&&(gI=!0,w9=qb(e[1])))}return gI}function MDe(){return hne()&&w9}var Zz,mne;function eV(){if(!l(Zz)){Zz=!1;let e=/ Edg\/([\.0-9]+)/.exec(Tc.userAgent);e!==null&&(Zz=!0,mne=qb(e[1]))}return Zz}function LDe(){return eV()&&mne}var Qz,P9;function tV(){if(!l(Qz)){Qz=!1;let e=/Firefox\/([\.0-9]+)/.exec(Tc.userAgent);e!==null&&(Qz=!0,P9=qb(e[1]))}return Qz}var A9;function NDe(){return l(A9)||(A9=/Windows/i.test(Tc.appVersion)),A9}var E9;function FDe(){return l(E9)||(E9=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),E9}function BDe(){return tV()&&P9}var S9;function kDe(){return l(S9)||(S9=!tV()&&typeof PointerEvent<"u"&&(!l(Tc.pointerEnabled)||Tc.pointerEnabled)),S9}var pne,Jz;function _ne(){if(!l(Jz)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;Jz=l(t)&&t!=="",Jz&&(pne=t)}return Jz}function UDe(){return _ne()?pne:void 0}function nl(){return nl._result}nl._promise=void 0;nl._result=void 0;nl.initialize=function(){return l(nl._promise)||(nl._promise=new Promise(e=>{let t=new Image;t.onload=function(){nl._result=t.width>0&&t.height>0,e(nl._result)},t.onerror=function(){nl._result=!1,e(nl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),nl._promise};Object.defineProperties(nl,{initialized:{get:function(){return l(nl._result)}}});var $A=[];typeof ArrayBuffer<"u"&&($A.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&$A.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&$A.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&$A.push(BigInt64Array),typeof BigUint64Array<"u"&&$A.push(BigUint64Array));var Hf={isChrome:I9,chromeVersion:DDe,isSafari:fne,safariVersion:RDe,isWebkit:dne,webkitVersion:ODe,isInternetExplorer:hne,internetExplorerVersion:MDe,isEdge:eV,edgeVersion:LDe,isFirefox:tV,firefoxVersion:BDe,isWindows:NDe,isIPadOrIOS:FDe,hardwareConcurrency:Tc.hardwareConcurrency??3,supportsPointerEvents:kDe,supportsImageRenderingPixelated:_ne,supportsWebP:nl,imageRenderingValue:UDe,typedArrayTypes:$A};Hf.supportsBasis=function(e){return Hf.supportsWebAssembly()&&e.context.supportsBasis};Hf.supportsFullscreen=function(){return Ir.supportsFullscreen()};Hf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Hf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Hf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Hf.supportsBigInt=function(){return typeof BigInt<"u"};Hf.supportsWebWorkers=function(){return typeof Worker<"u"};Hf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Hf.supportsWebgl2=function(e){return e.context.webgl2};Hf.supportsEsmWebWorkers=function(){return!tV()||parseInt(P9)>=114};var Nt=Hf;function D9(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 oe(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}oe.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 oe(e.x,e.y,e.z,e.w)};oe.fromBytes=function(e,t,n,i,o){return e=oe.byteToFloat(e??255),t=oe.byteToFloat(t??255),n=oe.byteToFloat(n??255),i=oe.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new oe(e,t,n,i)};oe.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 oe(e.red,e.green,e.blue,t)};var R9,O9,Zp;Nt.supportsTypedArrays()&&(R9=new ArrayBuffer(4),O9=new Uint32Array(R9),Zp=new Uint8Array(R9));oe.fromRgba=function(e,t){return O9[0]=e,oe.fromBytes(Zp[0],Zp[1],Zp[2],Zp[3],t)};oe.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=D9(u,c,e+1/3),s=D9(u,c,e),a=D9(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new oe(r,s,a,i)};oe.fromRandom=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.red;if(!l(n)){let s=e.minimumRed??0,a=e.maximumRed??1;n=s+D.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;i=s+D.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;o=s+D.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;r=s+D.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new oe(n,i,o,r)};var zDe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,VDe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,HDe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,GDe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;oe.fromCssColorString=function(e,t){l(t)||(t=new oe),e=e.trim();let n=oe[e.toUpperCase()];if(l(n))return oe.clone(n,t),t;let i=zDe.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=VDe.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=HDe.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=GDe.exec(e),i!==null?oe.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};oe.packedLength=4;oe.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};oe.unpack=function(e,t,n){return t=t??0,l(n)||(n=new oe),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};oe.byteToFloat=function(e){return e/255};oe.floatToByte=function(e){return e===1?255:e*256|0};oe.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 oe(e.red,e.green,e.blue,e.alpha)};oe.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};oe.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]};oe.prototype.clone=function(e){return oe.clone(this,e)};oe.prototype.equals=function(e){return oe.equals(this,e)};oe.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};oe.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};oe.prototype.toCssColorString=function(){let e=oe.floatToByte(this.red),t=oe.floatToByte(this.green),n=oe.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};oe.prototype.toCssHexString=function(){let e=oe.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=oe.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=oe.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=oe.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};oe.prototype.toBytes=function(e){let t=oe.floatToByte(this.red),n=oe.floatToByte(this.green),i=oe.floatToByte(this.blue),o=oe.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};oe.prototype.toRgba=function(){return Zp[0]=oe.floatToByte(this.red),Zp[1]=oe.floatToByte(this.green),Zp[2]=oe.floatToByte(this.blue),Zp[3]=oe.floatToByte(this.alpha),O9[0]};oe.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};oe.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};oe.prototype.withAlpha=function(e,t){return oe.fromAlpha(this,e,t)};oe.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};oe.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};oe.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};oe.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};oe.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};oe.lerp=function(e,t,n,i){return i.red=D.lerp(e.red,t.red,n),i.green=D.lerp(e.green,t.green,n),i.blue=D.lerp(e.blue,t.blue,n),i.alpha=D.lerp(e.alpha,t.alpha,n),i};oe.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};oe.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};oe.ALICEBLUE=Object.freeze(oe.fromCssColorString("#F0F8FF"));oe.ANTIQUEWHITE=Object.freeze(oe.fromCssColorString("#FAEBD7"));oe.AQUA=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.AQUAMARINE=Object.freeze(oe.fromCssColorString("#7FFFD4"));oe.AZURE=Object.freeze(oe.fromCssColorString("#F0FFFF"));oe.BEIGE=Object.freeze(oe.fromCssColorString("#F5F5DC"));oe.BISQUE=Object.freeze(oe.fromCssColorString("#FFE4C4"));oe.BLACK=Object.freeze(oe.fromCssColorString("#000000"));oe.BLANCHEDALMOND=Object.freeze(oe.fromCssColorString("#FFEBCD"));oe.BLUE=Object.freeze(oe.fromCssColorString("#0000FF"));oe.BLUEVIOLET=Object.freeze(oe.fromCssColorString("#8A2BE2"));oe.BROWN=Object.freeze(oe.fromCssColorString("#A52A2A"));oe.BURLYWOOD=Object.freeze(oe.fromCssColorString("#DEB887"));oe.CADETBLUE=Object.freeze(oe.fromCssColorString("#5F9EA0"));oe.CHARTREUSE=Object.freeze(oe.fromCssColorString("#7FFF00"));oe.CHOCOLATE=Object.freeze(oe.fromCssColorString("#D2691E"));oe.CORAL=Object.freeze(oe.fromCssColorString("#FF7F50"));oe.CORNFLOWERBLUE=Object.freeze(oe.fromCssColorString("#6495ED"));oe.CORNSILK=Object.freeze(oe.fromCssColorString("#FFF8DC"));oe.CRIMSON=Object.freeze(oe.fromCssColorString("#DC143C"));oe.CYAN=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.DARKBLUE=Object.freeze(oe.fromCssColorString("#00008B"));oe.DARKCYAN=Object.freeze(oe.fromCssColorString("#008B8B"));oe.DARKGOLDENROD=Object.freeze(oe.fromCssColorString("#B8860B"));oe.DARKGRAY=Object.freeze(oe.fromCssColorString("#A9A9A9"));oe.DARKGREEN=Object.freeze(oe.fromCssColorString("#006400"));oe.DARKGREY=oe.DARKGRAY;oe.DARKKHAKI=Object.freeze(oe.fromCssColorString("#BDB76B"));oe.DARKMAGENTA=Object.freeze(oe.fromCssColorString("#8B008B"));oe.DARKOLIVEGREEN=Object.freeze(oe.fromCssColorString("#556B2F"));oe.DARKORANGE=Object.freeze(oe.fromCssColorString("#FF8C00"));oe.DARKORCHID=Object.freeze(oe.fromCssColorString("#9932CC"));oe.DARKRED=Object.freeze(oe.fromCssColorString("#8B0000"));oe.DARKSALMON=Object.freeze(oe.fromCssColorString("#E9967A"));oe.DARKSEAGREEN=Object.freeze(oe.fromCssColorString("#8FBC8F"));oe.DARKSLATEBLUE=Object.freeze(oe.fromCssColorString("#483D8B"));oe.DARKSLATEGRAY=Object.freeze(oe.fromCssColorString("#2F4F4F"));oe.DARKSLATEGREY=oe.DARKSLATEGRAY;oe.DARKTURQUOISE=Object.freeze(oe.fromCssColorString("#00CED1"));oe.DARKVIOLET=Object.freeze(oe.fromCssColorString("#9400D3"));oe.DEEPPINK=Object.freeze(oe.fromCssColorString("#FF1493"));oe.DEEPSKYBLUE=Object.freeze(oe.fromCssColorString("#00BFFF"));oe.DIMGRAY=Object.freeze(oe.fromCssColorString("#696969"));oe.DIMGREY=oe.DIMGRAY;oe.DODGERBLUE=Object.freeze(oe.fromCssColorString("#1E90FF"));oe.FIREBRICK=Object.freeze(oe.fromCssColorString("#B22222"));oe.FLORALWHITE=Object.freeze(oe.fromCssColorString("#FFFAF0"));oe.FORESTGREEN=Object.freeze(oe.fromCssColorString("#228B22"));oe.FUCHSIA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.GAINSBORO=Object.freeze(oe.fromCssColorString("#DCDCDC"));oe.GHOSTWHITE=Object.freeze(oe.fromCssColorString("#F8F8FF"));oe.GOLD=Object.freeze(oe.fromCssColorString("#FFD700"));oe.GOLDENROD=Object.freeze(oe.fromCssColorString("#DAA520"));oe.GRAY=Object.freeze(oe.fromCssColorString("#808080"));oe.GREEN=Object.freeze(oe.fromCssColorString("#008000"));oe.GREENYELLOW=Object.freeze(oe.fromCssColorString("#ADFF2F"));oe.GREY=oe.GRAY;oe.HONEYDEW=Object.freeze(oe.fromCssColorString("#F0FFF0"));oe.HOTPINK=Object.freeze(oe.fromCssColorString("#FF69B4"));oe.INDIANRED=Object.freeze(oe.fromCssColorString("#CD5C5C"));oe.INDIGO=Object.freeze(oe.fromCssColorString("#4B0082"));oe.IVORY=Object.freeze(oe.fromCssColorString("#FFFFF0"));oe.KHAKI=Object.freeze(oe.fromCssColorString("#F0E68C"));oe.LAVENDER=Object.freeze(oe.fromCssColorString("#E6E6FA"));oe.LAVENDAR_BLUSH=Object.freeze(oe.fromCssColorString("#FFF0F5"));oe.LAWNGREEN=Object.freeze(oe.fromCssColorString("#7CFC00"));oe.LEMONCHIFFON=Object.freeze(oe.fromCssColorString("#FFFACD"));oe.LIGHTBLUE=Object.freeze(oe.fromCssColorString("#ADD8E6"));oe.LIGHTCORAL=Object.freeze(oe.fromCssColorString("#F08080"));oe.LIGHTCYAN=Object.freeze(oe.fromCssColorString("#E0FFFF"));oe.LIGHTGOLDENRODYELLOW=Object.freeze(oe.fromCssColorString("#FAFAD2"));oe.LIGHTGRAY=Object.freeze(oe.fromCssColorString("#D3D3D3"));oe.LIGHTGREEN=Object.freeze(oe.fromCssColorString("#90EE90"));oe.LIGHTGREY=oe.LIGHTGRAY;oe.LIGHTPINK=Object.freeze(oe.fromCssColorString("#FFB6C1"));oe.LIGHTSEAGREEN=Object.freeze(oe.fromCssColorString("#20B2AA"));oe.LIGHTSKYBLUE=Object.freeze(oe.fromCssColorString("#87CEFA"));oe.LIGHTSLATEGRAY=Object.freeze(oe.fromCssColorString("#778899"));oe.LIGHTSLATEGREY=oe.LIGHTSLATEGRAY;oe.LIGHTSTEELBLUE=Object.freeze(oe.fromCssColorString("#B0C4DE"));oe.LIGHTYELLOW=Object.freeze(oe.fromCssColorString("#FFFFE0"));oe.LIME=Object.freeze(oe.fromCssColorString("#00FF00"));oe.LIMEGREEN=Object.freeze(oe.fromCssColorString("#32CD32"));oe.LINEN=Object.freeze(oe.fromCssColorString("#FAF0E6"));oe.MAGENTA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.MAROON=Object.freeze(oe.fromCssColorString("#800000"));oe.MEDIUMAQUAMARINE=Object.freeze(oe.fromCssColorString("#66CDAA"));oe.MEDIUMBLUE=Object.freeze(oe.fromCssColorString("#0000CD"));oe.MEDIUMORCHID=Object.freeze(oe.fromCssColorString("#BA55D3"));oe.MEDIUMPURPLE=Object.freeze(oe.fromCssColorString("#9370DB"));oe.MEDIUMSEAGREEN=Object.freeze(oe.fromCssColorString("#3CB371"));oe.MEDIUMSLATEBLUE=Object.freeze(oe.fromCssColorString("#7B68EE"));oe.MEDIUMSPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FA9A"));oe.MEDIUMTURQUOISE=Object.freeze(oe.fromCssColorString("#48D1CC"));oe.MEDIUMVIOLETRED=Object.freeze(oe.fromCssColorString("#C71585"));oe.MIDNIGHTBLUE=Object.freeze(oe.fromCssColorString("#191970"));oe.MINTCREAM=Object.freeze(oe.fromCssColorString("#F5FFFA"));oe.MISTYROSE=Object.freeze(oe.fromCssColorString("#FFE4E1"));oe.MOCCASIN=Object.freeze(oe.fromCssColorString("#FFE4B5"));oe.NAVAJOWHITE=Object.freeze(oe.fromCssColorString("#FFDEAD"));oe.NAVY=Object.freeze(oe.fromCssColorString("#000080"));oe.OLDLACE=Object.freeze(oe.fromCssColorString("#FDF5E6"));oe.OLIVE=Object.freeze(oe.fromCssColorString("#808000"));oe.OLIVEDRAB=Object.freeze(oe.fromCssColorString("#6B8E23"));oe.ORANGE=Object.freeze(oe.fromCssColorString("#FFA500"));oe.ORANGERED=Object.freeze(oe.fromCssColorString("#FF4500"));oe.ORCHID=Object.freeze(oe.fromCssColorString("#DA70D6"));oe.PALEGOLDENROD=Object.freeze(oe.fromCssColorString("#EEE8AA"));oe.PALEGREEN=Object.freeze(oe.fromCssColorString("#98FB98"));oe.PALETURQUOISE=Object.freeze(oe.fromCssColorString("#AFEEEE"));oe.PALEVIOLETRED=Object.freeze(oe.fromCssColorString("#DB7093"));oe.PAPAYAWHIP=Object.freeze(oe.fromCssColorString("#FFEFD5"));oe.PEACHPUFF=Object.freeze(oe.fromCssColorString("#FFDAB9"));oe.PERU=Object.freeze(oe.fromCssColorString("#CD853F"));oe.PINK=Object.freeze(oe.fromCssColorString("#FFC0CB"));oe.PLUM=Object.freeze(oe.fromCssColorString("#DDA0DD"));oe.POWDERBLUE=Object.freeze(oe.fromCssColorString("#B0E0E6"));oe.PURPLE=Object.freeze(oe.fromCssColorString("#800080"));oe.RED=Object.freeze(oe.fromCssColorString("#FF0000"));oe.ROSYBROWN=Object.freeze(oe.fromCssColorString("#BC8F8F"));oe.ROYALBLUE=Object.freeze(oe.fromCssColorString("#4169E1"));oe.SADDLEBROWN=Object.freeze(oe.fromCssColorString("#8B4513"));oe.SALMON=Object.freeze(oe.fromCssColorString("#FA8072"));oe.SANDYBROWN=Object.freeze(oe.fromCssColorString("#F4A460"));oe.SEAGREEN=Object.freeze(oe.fromCssColorString("#2E8B57"));oe.SEASHELL=Object.freeze(oe.fromCssColorString("#FFF5EE"));oe.SIENNA=Object.freeze(oe.fromCssColorString("#A0522D"));oe.SILVER=Object.freeze(oe.fromCssColorString("#C0C0C0"));oe.SKYBLUE=Object.freeze(oe.fromCssColorString("#87CEEB"));oe.SLATEBLUE=Object.freeze(oe.fromCssColorString("#6A5ACD"));oe.SLATEGRAY=Object.freeze(oe.fromCssColorString("#708090"));oe.SLATEGREY=oe.SLATEGRAY;oe.SNOW=Object.freeze(oe.fromCssColorString("#FFFAFA"));oe.SPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FF7F"));oe.STEELBLUE=Object.freeze(oe.fromCssColorString("#4682B4"));oe.TAN=Object.freeze(oe.fromCssColorString("#D2B48C"));oe.TEAL=Object.freeze(oe.fromCssColorString("#008080"));oe.THISTLE=Object.freeze(oe.fromCssColorString("#D8BFD8"));oe.TOMATO=Object.freeze(oe.fromCssColorString("#FF6347"));oe.TURQUOISE=Object.freeze(oe.fromCssColorString("#40E0D0"));oe.VIOLET=Object.freeze(oe.fromCssColorString("#EE82EE"));oe.WHEAT=Object.freeze(oe.fromCssColorString("#F5DEB3"));oe.WHITE=Object.freeze(oe.fromCssColorString("#FFFFFF"));oe.WHITESMOKE=Object.freeze(oe.fromCssColorString("#F5F5F5"));oe.YELLOW=Object.freeze(oe.fromCssColorString("#FFFF00"));oe.YELLOWGREEN=Object.freeze(oe.fromCssColorString("#9ACD32"));oe.TRANSPARENT=Object.freeze(new oe(0,0,0,0));var H=oe;function nV(e){e=e??G.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}nV.ALL=Object.freeze(new nV({color:new H(0,0,0,0),depth:1,stencil:0}));nV.prototype.execute=function(e,t){e.clear(this,t)};var oi=nV;var jDe={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},Se=Object.freeze(jDe);function gne(e){e=e??G.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=Se.COMPUTE,this.owner=e.owner}gne.prototype.execute=function(e){e.execute(this)};var Ea=gne;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=D.clamp(e.x,t.x,n.x),r=D.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ut.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ut.magnitude=function(e){return Math.sqrt(Ut.magnitudeSquared(e))};var iV=new Ut;Ut.distance=function(e,t){return Ut.subtract(e,t,iV),Ut.magnitude(iV)};Ut.distanceSquared=function(e,t){return Ut.subtract(e,t,iV),Ut.magnitudeSquared(iV)};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 yne=new Ut;Ut.lerp=function(e,t,n,i){return Ut.multiplyByScalar(t,n,yne),i=Ut.multiplyByScalar(e,1-n,i),Ut.add(yne,i,i)};var bne=new Ut,xne=new Ut;Ut.angleBetween=function(e,t){return Ut.normalize(e,bne),Ut.normalize(t,xne),D.acosClamped(Ut.dot(bne,xne))};var WDe=new Ut;Ut.mostOrthogonalAxis=function(e,t){let n=Ut.normalize(e,WDe);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)&&D.equalsEpsilon(e.x,t.x,n,i)&&D.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 V=Ut;var qDe=new h,YDe=new h;function XDe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=s*s*u*u,_=a*a*f*f,m=d+p+_,y=Math.sqrt(1/m),b=h.multiplyByScalar(e,y,qDe);if(m<i)return isFinite(y)?h.clone(b,o):void 0;let x=n.x,T=n.y,C=n.z,A=YDe;A.x=b.x*x*2,A.y=b.y*T*2,A.z=b.z*C*2;let S=(1-y)*h.magnitude(e)/(.5*h.magnitude(A)),w=0,R,P,O,L,g,E,v,I,N,F,U;do{S-=w,O=1/(1+S*x),L=1/(1+S*T),g=1/(1+S*C),E=O*O,v=L*L,I=g*g,N=E*O,F=v*L,U=I*g,R=d*E+p*v+_*I-1,P=d*N*x+p*F*T+_*U*C;let k=-2*P;w=R/k}while(Math.abs(R)>D.EPSILON12);return l(o)?(o.x=r*O,o.y=s*L,o.z=a*g,o):new h(r*O,s*L,a*g)}var Yb=XDe;function qo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}qo.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new qo(e,t,n)};qo.fromDegrees=function(e,t,n,i){return e=D.toRadians(e),t=D.toRadians(t),qo.fromRadians(e,t,n,i)};var KDe=new h,$De=new h,ZDe=new h;qo._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);qo._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));qo._ellipsoidCenterToleranceSquared=D.EPSILON1;qo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:qo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:qo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:qo._ellipsoidCenterToleranceSquared,s=Yb(e,i,o,r,$De);if(!l(s))return;let a=h.multiplyComponents(s,o,KDe);a=h.normalize(a,a);let c=h.subtract(e,s,ZDe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=D.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new qo(u,f,d)};qo.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};qo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new qo(e.longitude,e.latitude,e.height)};qo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};qo.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};qo.ZERO=Object.freeze(new qo(0,0,0));qo.prototype.clone=function(e){return qo.clone(this,e)};qo.prototype.equals=function(e){return qo.equals(this,e)};qo.prototype.equalsEpsilon=function(e,t){return qo.equalsEpsilon(this,e,t)};qo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=qo;function Cne(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ti(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Cne(this,e,t,n)}Object.defineProperties(Ti.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});Ti.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ti(n.x,n.y,n.z)};Ti.fromCartesian3=function(e,t){return l(t)||(t=new Ti),l(e)&&Cne(t,e.x,e.y,e.z),t};Ti.WGS84=Object.freeze(new Ti(6378137,6378137,6356752314245179e-9));Ti.UNIT_SPHERE=Object.freeze(new Ti(1,1,1));Ti.MOON=Object.freeze(new Ti(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Ti._default=Ti.WGS84;Object.defineProperties(Ti,{default:{get:function(){return Ti._default},set:function(e){Ti._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});Ti.prototype.clone=function(e){return Ti.clone(this,e)};Ti.packedLength=h.packedLength;Ti.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),t};Ti.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t);return Ti.fromCartesian3(i,n)};Ti.prototype.geocentricSurfaceNormal=h.normalize;Ti.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};Ti.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,D.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var QDe=new h,JDe=new h;Ti.prototype.cartographicToCartesian=function(e,t){let n=QDe,i=JDe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};Ti.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var e1e=new h,t1e=new h,n1e=new h;Ti.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,t1e);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,e1e),o=h.subtract(e,n,n1e),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=D.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};Ti.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};Ti.prototype.scaleToGeodeticSurface=function(e,t){return Yb(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Ti.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);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 h.multiplyByScalar(e,s,t)};Ti.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};Ti.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};Ti.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};Ti.prototype.toString=function(){return this._radii.toString()};Ti.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var i1e=new h;Ti.prototype.getLocalCurvature=function(e,t){l(t)||(t=new V);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,i1e),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return V.fromElements(1/i,1/r,t)};var o1e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],r1e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Tne(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*o1e[s];r+=r1e[s]*(n(i+a)+n(i-a))}return r*=o,r}Ti.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=D.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return Tne(i,o,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*Tne(t,n,function(_){let m=Math.cos(_),y=Math.sin(_);return Math.sqrt(u*p*p+c*(a*m*m+s*y*y)*d*d)})})};var te=Ti;function oV(e){this._ellipsoid=e??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(oV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});oV.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 h(i,o,r)};oV.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 fe(i,o,r)};var Mi=oV;var s1e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Ht=Object.freeze(s1e);function a1e(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 Uo=a1e;function c1e(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Cy=c1e;function l1e(e){return e%4===0&&e%100!==0||e%400===0}var th=l1e;var Ane=[31,28,31,30,31,30,31,31,30,31,30,31];function u1e(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(){ro.typeOf.number.greaterThanOrEquals("Year",e,1),ro.typeOf.number.lessThanOrEquals("Year",e,9999),ro.typeOf.number.greaterThanOrEquals("Month",t,1),ro.typeOf.number.lessThanOrEquals("Month",t,12),ro.typeOf.number.greaterThanOrEquals("Day",n,1),ro.typeOf.number.lessThanOrEquals("Day",n,31),ro.typeOf.number.greaterThanOrEquals("Hour",i,0),ro.typeOf.number.lessThanOrEquals("Hour",i,23),ro.typeOf.number.greaterThanOrEquals("Minute",o,0),ro.typeOf.number.lessThanOrEquals("Minute",o,59),ro.typeOf.bool("IsLeapSecond",a),ro.typeOf.number.greaterThanOrEquals("Second",r,0),ro.typeOf.number.lessThanOrEquals("Second",r,a?60:59),ro.typeOf.number.greaterThanOrEquals("Millisecond",s,0),ro.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let x=t===2&&th(e)?Ane[t-1]+1:Ane[t-1];if(n>x)throw new he("Month and Day represents invalid date")}}var Qp=u1e;function f1e(e,t){this.julianDate=e,this.offset=t}var Ki=f1e;var d1e={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},Yn=Object.freeze(d1e);var h1e={UTC:0,TAI:1},Wn=Object.freeze(h1e);var Sne=new Qp,M9=[31,28,31,30,31,30,31,31,30,31,30,31],L9=29;function N9(e,t){return Mt.compare(e.julianDate,t.julianDate)}var ZA=new Ki;function sV(e){ZA.julianDate=e;let t=Mt.leapSeconds,n=Uo(t,ZA,N9);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Mt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Mt.addSeconds(e,i,e)}function Ene(e,t){ZA.julianDate=e;let n=Mt.leapSeconds,i=Uo(n,ZA,N9);if(i<0&&(i=~i),i===0)return Mt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Mt.addSeconds(e,-n[i-1].offset,t);let o=Mt.secondsDifference(n[i].julianDate,e);if(o===0)return Mt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Mt.addSeconds(e,-n[--i].offset,t)}function Ay(e,t,n){let i=t/Yn.SECONDS_PER_DAY|0;return e+=i,t-=Yn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Yn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function F9(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*Yn.SECONDS_PER_HOUR+o*Yn.SECONDS_PER_MINUTE+s*Yn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var m1e=/^(\d{4})$/,p1e=/^(\d{4})-(\d{2})$/,_1e=/^(\d{4})-?(\d{3})$/,g1e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,y1e=/^(\d{4})-?(\d{2})-?(\d{2})$/,B9=/([Z+\-])?(\d{2})?:?(\d{2})?$/,b1e=/^(\d{2})(\.\d+)?/.source+B9.source,x1e=/^(\d{2}):?(\d{2})(\.\d+)?/.source+B9.source,T1e=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+B9.source;function Mt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*Yn.SECONDS_PER_DAY,Ay(i,t,this),n===Wn.UTC&&sV(this)}Mt.fromGregorianDate=function(e,t){let n=F9(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Ay(n[0],n[1],t),sV(t),t):new Mt(n[0],n[1],Wn.UTC)};Mt.fromDate=function(e,t){let n=F9(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Ay(n[0],n[1],t),sV(t),t):new Mt(n[0],n[1],Wn.UTC)};Mt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,_;if(n=f.match(y1e),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(p1e),n!==null)i=+n[1],o=+n[2];else if(n=f.match(m1e),n!==null)i=+n[1];else{let x;if(n=f.match(_1e),n!==null)i=+n[1],x=+n[2],_=th(i);else if(n=f.match(g1e),n!==null){i=+n[1];let T=+n[2],C=+n[3]||0,A=new Date(Date.UTC(i,0,4));x=T*7+C-A.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(x),o=p.getUTCMonth()+1,r=p.getUTCDate()}_=th(i);let m;if(l(d)){n=d.match(T1e),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=d.match(x1e),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=d.match(b1e),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let x=n[m],T=+n[m+1],C=+(n[m+2]||0);switch(x){case"+":s=s-T,a=a-C;break;case"-":s=s+T,a=a+C;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=_&&o===2?L9:M9[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=_&&o===2?L9:M9[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=_&&o===2?L9:M9[o-1],r+=p;let b=F9(i,o,r,s,a,c,u);return l(t)?(Ay(b[0],b[1],t),sV(t)):t=new Mt(b[0],b[1],Wn.UTC),y&&Mt.addSeconds(t,1,t),t};Mt.now=function(e){return Mt.fromDate(new Date,e)};var rV=new Mt(0,0,Wn.TAI);Mt.toGregorianDate=function(e,t){let n=!1,i=Ene(e,rV);l(i)||(Mt.addSeconds(e,-1,rV),i=Ene(rV,rV),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,_=r/Yn.SECONDS_PER_HOUR|0,m=r-_*Yn.SECONDS_PER_HOUR,y=m/Yn.SECONDS_PER_MINUTE|0;m=m-y*Yn.SECONDS_PER_MINUTE;let b=m|0,x=(m-b)/Yn.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=_,t.minute=y,t.second=b,t.millisecond=x,t.isLeapSecond=n,t):new Qp(p,d,f,_,y,b,x,n)};Mt.toDate=function(e){let t=Mt.toGregorianDate(e,Sne),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))};Mt.toIso8601=function(e,t){let n=Mt.toGregorianDate(e,Sne),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!l(t)&&u!==0){let d=u*.01;return f=d<1e-6?d.toFixed(20).replace(".","").replace(/0+$/,""):d.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Mt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Mt(e.dayNumber,e.secondsOfDay,Wn.TAI)};Mt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Mt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Mt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(Mt.secondsDifference(e,t))<=n};Mt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Yn.SECONDS_PER_DAY};Mt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Yn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Mt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Yn.SECONDS_PER_DAY;return n+i};Mt.computeTaiMinusUtc=function(e){ZA.julianDate=e;let t=Mt.leapSeconds,n=Uo(t,ZA,N9);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Mt.addSeconds=function(e,t,n){return Ay(e.dayNumber,e.secondsOfDay+t,n)};Mt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_MINUTE;return Ay(e.dayNumber,i,n)};Mt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_HOUR;return Ay(e.dayNumber,i,n)};Mt.addDays=function(e,t,n){let i=e.dayNumber+t;return Ay(i,e.secondsOfDay,n)};Mt.lessThan=function(e,t){return Mt.compare(e,t)<0};Mt.lessThanOrEquals=function(e,t){return Mt.compare(e,t)<=0};Mt.greaterThan=function(e,t){return Mt.compare(e,t)>0};Mt.greaterThanOrEquals=function(e,t){return Mt.compare(e,t)>=0};Mt.prototype.clone=function(e){return Mt.clone(this,e)};Mt.prototype.equals=function(e){return Mt.equals(this,e)};Mt.prototype.equalsEpsilon=function(e,t){return Mt.equalsEpsilon(this,e,t)};Mt.prototype.toString=function(){return Mt.toIso8601(this)};Mt.leapSeconds=[new Ki(new Mt(2441317,43210,Wn.TAI),10),new Ki(new Mt(2441499,43211,Wn.TAI),11),new Ki(new Mt(2441683,43212,Wn.TAI),12),new Ki(new Mt(2442048,43213,Wn.TAI),13),new Ki(new Mt(2442413,43214,Wn.TAI),14),new Ki(new Mt(2442778,43215,Wn.TAI),15),new Ki(new Mt(2443144,43216,Wn.TAI),16),new Ki(new Mt(2443509,43217,Wn.TAI),17),new Ki(new Mt(2443874,43218,Wn.TAI),18),new Ki(new Mt(2444239,43219,Wn.TAI),19),new Ki(new Mt(2444786,43220,Wn.TAI),20),new Ki(new Mt(2445151,43221,Wn.TAI),21),new Ki(new Mt(2445516,43222,Wn.TAI),22),new Ki(new Mt(2446247,43223,Wn.TAI),23),new Ki(new Mt(2447161,43224,Wn.TAI),24),new Ki(new Mt(2447892,43225,Wn.TAI),25),new Ki(new Mt(2448257,43226,Wn.TAI),26),new Ki(new Mt(2448804,43227,Wn.TAI),27),new Ki(new Mt(2449169,43228,Wn.TAI),28),new Ki(new Mt(2449534,43229,Wn.TAI),29),new Ki(new Mt(2450083,43230,Wn.TAI),30),new Ki(new Mt(2450630,43231,Wn.TAI),31),new Ki(new Mt(2451179,43232,Wn.TAI),32),new Ki(new Mt(2453736,43233,Wn.TAI),33),new Ki(new Mt(2454832,43234,Wn.TAI),34),new Ki(new Mt(2456109,43235,Wn.TAI),35),new Ki(new Mt(2457204,43236,Wn.TAI),36),new Ki(new Mt(2457754,43237,Wn.TAI),37)];var $=Mt;var Xne=er(Ru(),1);function C1e(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var yI=C1e;function One(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=One(o,t)),n[i]=o}return n}var Fe=One;function Mne(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]=Mne(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 ct=Mne;function A1e(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Zs=A1e;var Lne=er(Ru(),1);function k9(e,t){let n;return typeof document<"u"&&(n=document),k9._implementation(e,t,n)}k9._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Lne.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Ou=k9;var Nne=er(Ru(),1);function E1e(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Nne.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var bI=E1e;var Fne=er(Ru(),1);function S1e(e){let t=new Fne.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 Xb=S1e;var Bne={};function v1e(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Bne[t];l(i)||(i={},Bne[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 nh=v1e;var w1e=/^blob:/i;function I1e(e){return w1e.test(e)}var Kb=I1e;var wm;function P1e(e){l(wm)||(wm=document.createElement("a")),wm.href=window.location.href;let t=wm.host,n=wm.protocol;return wm.href=e,wm.href=wm.href,n!==wm.protocol||t!==wm.host}var Ey=P1e;var D1e=/^data:/i;function R1e(e){return D1e.test(e)}var Jp=R1e;function O1e(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 $b=O1e;function M1e(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 Zb=M1e;function L1e(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 Mu=L1e;var N1e={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Xn=Object.freeze(N1e);var F1e={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Ts=Object.freeze(F1e);function uV(e){e=e??G.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??Ts.OTHER,this.serverKey=e.serverKey,this.state=Xn.UNISSUED,this.deferred=void 0,this.cancelled=!1}uV.prototype.cancel=function(){this.cancelled=!0};uV.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=Xn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new uV(this)};var tr=uV;function B1e(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 xI=B1e;function kne(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=xI(this.responseHeaders))}kne.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Im=kne;var fV=er(Ru(),1);function TI(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(TI.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});TI.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};TI.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 k1e(e,t){return t-e}TI.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(k1e),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var me=TI;function Qb(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Qb.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 U9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Qb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};Qb.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?(U9(i,o,e),e=o):r=!1}};Qb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Qb.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)U9(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};Qb.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return U9(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var CI=Qb;function U1e(e,t){return e.priority-t.priority}var so={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},eE=20,Cc=new CI({comparator:U1e});Cc.maximumLength=eE;Cc.reserve(eE);var Pm=[],e_={},z1e=typeof document<"u"?new fV.default(document.location.href):new fV.default,dV=new me;function nr(){}nr.maximumRequests=50;nr.maximumRequestsPerServer=18;nr.requestsByServer={};nr.throttleRequests=!0;nr.debugShowStatistics=!1;nr.requestCompletedEvent=dV;Object.defineProperties(nr,{statistics:{get:function(){return so}},priorityHeapLength:{get:function(){return eE},set:function(e){if(e<eE)for(;Cc.length>e;){let t=Cc.pop();Jb(t)}eE=e,Cc.maximumLength=e,Cc.reserve(e)}}});function Une(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}nr.serverHasOpenSlots=function(e,t){t=t??1;let n=nr.requestsByServer[e]??nr.maximumRequestsPerServer;return e_[e]+t<=n};nr.heapHasOpenSlots=function(e){return Cc.length+e<=eE};function zne(e){return e.state===Xn.UNISSUED&&(e.state=Xn.ISSUED,e.deferred=Zs()),e.deferred.promise}function V1e(e){return function(t){if(e.state===Xn.CANCELLED)return;let n=e.deferred;--so.numberOfActiveRequests,--e_[e.serverKey],dV.raiseEvent(),e.state=Xn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function H1e(e){return function(t){e.state!==Xn.CANCELLED&&(++so.numberOfFailedRequests,--so.numberOfActiveRequests,--e_[e.serverKey],dV.raiseEvent(t),e.state=Xn.FAILED,e.deferred.reject(t))}}function Vne(e){let t=zne(e);return e.state=Xn.ACTIVE,Pm.push(e),++so.numberOfActiveRequests,++so.numberOfActiveRequestsEver,++e_[e.serverKey],e.requestFunction().then(V1e(e)).catch(H1e(e)),t}function Jb(e){let t=e.state===Xn.ACTIVE;if(e.state=Xn.CANCELLED,++so.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--so.numberOfActiveRequests,--e_[e.serverKey],++so.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}nr.update=function(){let e,t,n=0,i=Pm.length;for(e=0;e<i;++e){if(t=Pm[e],t.cancelled&&Jb(t),t.state!==Xn.ACTIVE){++n;continue}n>0&&(Pm[e-n]=t)}Pm.length-=n;let o=Cc.internalArray,r=Cc.length;for(e=0;e<r;++e)Une(o[e]);Cc.resort();let s=Math.max(nr.maximumRequests-Pm.length,0),a=0;for(;a<s&&Cc.length>0;){if(t=Cc.pop(),t.cancelled){Jb(t);continue}if(t.throttleByServer&&!nr.serverHasOpenSlots(t.serverKey)){Jb(t);continue}Vne(t),++a}G1e()};nr.getServerKey=function(e){let t=new fV.default(e);t.scheme()===""&&(t=t.absoluteTo(z1e),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=e_[n];return l(i)||(e_[n]=0),n};nr.request=function(e){if(Jp(e.url)||Kb(e.url))return dV.raiseEvent(),e.state=Xn.RECEIVED,e.requestFunction();if(++so.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=nr.getServerKey(e.url)),nr.throttleRequests&&e.throttleByServer&&!nr.serverHasOpenSlots(e.serverKey))return;if(!nr.throttleRequests||!e.throttle)return Vne(e);if(Pm.length>=nr.maximumRequests)return;Une(e);let t=Cc.insert(e);if(l(t)){if(t===e)return;Jb(t)}return zne(e)};function G1e(){nr.debugShowStatistics&&(so.numberOfActiveRequests===0&&so.lastNumberOfActiveRequests>0&&(so.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${so.numberOfAttemptedRequests}`),so.numberOfAttemptedRequests=0),so.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${so.numberOfCancelledRequests}`),so.numberOfCancelledRequests=0),so.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${so.numberOfCancelledActiveRequests}`),so.numberOfCancelledActiveRequests=0),so.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${so.numberOfFailedRequests}`),so.numberOfFailedRequests=0)),so.lastNumberOfActiveRequests=so.numberOfActiveRequests)}nr.clearForSpecs=function(){for(;Cc.length>0;){let t=Cc.pop();Jb(t)}let e=Pm.length;for(let t=0;t<e;++t)Jb(Pm[t]);Pm.length=0,e_={},so.numberOfAttemptedRequests=0,so.numberOfActiveRequests=0,so.numberOfCancelledRequests=0,so.numberOfCancelledActiveRequests=0,so.numberOfFailedRequests=0,so.numberOfActiveRequestsEver=0,so.lastNumberOfActiveRequests=0};nr.numberOfActiveRequestsByServer=function(e){return e_[e]};nr.requestHeap=Cc;var Wa=nr;var Hne=er(Ru(),1);var AI={},tE={};AI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(tE[n])||(tE[n]=!0)};AI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(tE[n])&&delete tE[n]};function j1e(e){let t=new Hne.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}}AI.contains=function(e){let t=j1e(e);return!!(l(t)&&l(tE[t]))};AI.clear=function(){tE={}};var nE=AI;var W1e="mapDatabase",Dm="mapStore",t_,EI;var SI=3221225472;try{EI=window.indexedDB.open(W1e,1),EI.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(Dm)||t.createObjectStore(Dm,{keyPath:"url"})},EI.onsuccess=function(e){t_=e.target.result},EI.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function Gne(e,t){if(!t_)return;let i=t_.transaction([Dm],"readwrite").objectStore(Dm),o={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);o.content=s,o.type="xml"}i.add(o)}function jne(e){return new Promise(async(t,n)=>{if(!t_)n();else{let r=t_.transaction([Dm],"readonly").objectStore(Dm).get(e);r.onsuccess=function(s){let a=s.target.result;a?t(a):n()},EI.onerror=s=>{n()}}})}function q1e(){if(!t_)return;let t=t_.transaction([Dm],"readonly").objectStore(Dm),n=t.getAll();n.onsuccess=function(i){let o=i.target.result,r=0;o.forEach(s=>{r+=JSON.stringify(s).length}),r>SI&&(o.sort((a,c)=>a.timestamp-c.timestamp),o.slice(0,Math.ceil(r/SI)).forEach(a=>{let c=t.delete(a.url);c.onsuccess=function(){},c.onerror=function(){}}))}}function z9(){return SI}function Wne(e){typeof e!="number"||isNaN(e)||e<1073741824?SI=1073741824:SI=e,q1e()}function qne(){return new Promise(async(e,t)=>{if(!t_)t();else{let o=t_.transaction([Dm],"readonly").objectStore(Dm).getAll();o.onsuccess=function(r){let s=r.target.result,a=0;s.forEach(c=>{a+=JSON.stringify(c).length}),e(a)}}})}var Kne=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function vt(e){e=e??G.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Rm(e.templateValues,{}),this._queryParameters=Rm(e.queryParameters,{}),this.headers=Rm(e.headers,{}),this.request=e.request??new tr,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 Rm(e,t){return l(e)?Fe(e):t}vt.createIfNeeded=function(e){return e instanceof vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new vt({url:e})};var iE;vt.supportsImageBitmapOptions=function(){return l(iE)?iE:typeof createImageBitmap!="function"?(iE=Promise.resolve(!1),iE):(iE=vt.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=nh(t[0]),i=nh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),iE)};Object.defineProperties(vt,{isBlobSupported:{get:function(){return Kne}}});Object.defineProperties(vt.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 Xb(this._url)}},isDataUri:{get:function(){return Jp(this._url)}},isBlobUri:{get:function(){return Kb(this._url)}},isCrossOriginUrl:{get:function(){return Ey(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new Xne.default(e),r=Y1e(o.query());this._queryParameters=t?mV(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Ou(i))),this._url=o.toString()};function Y1e(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Mu(e)}function mV(e,t,n){if(!n)return ct(e,t);let i=Fe(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}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${X1e(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 X1e(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Zb(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=mV(this._queryParameters,e,!1):this._queryParameters=mV(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=mV(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=ct(this._templateValues,e):this._templateValues=ct(e,this._templateValues)};vt.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=ct(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=ct(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=ct(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};vt.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})};vt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Fe(this._queryParameters),e._templateValues=Fe(this._templateValues),e.headers=Fe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new vt({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})};vt.prototype.getBaseUri=function(e){return bI(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=yI(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??G.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(pV(this.request),!Kne||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return V9({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new vt({url:d}),V9({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function V9(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=Zs();return vt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Wa.request(r);if(l(s))return s.catch(function(a){return r.state!==Xn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Xn.UNISSUED,r.deferred=void 0,V9({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.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)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",pV(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return $ne(this,e,t)};function $ne(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=Zs();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Wa.request(o);if(l(s))return s.catch(function(a){return o.state!==Xn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Xn.UNISSUED,o.deferred=void 0,$ne(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest2=function(e){let t=this;pV(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=ct(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Zs(),d=vt._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=Wa.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!==Xn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Xn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};vt.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{return Cesium.ManageIndexedDB.GetManageIndexexDBState()?jne(n.url).then(o=>{let r=o.content;return o.type==="xml"&&(r=new DOMParser().parseFromString(o.content,"application/xml")),r}).catch(o=>i()):i()}catch{return i()}function i(){pV(t.request),n.requestFunction=function(){let r=e.responseType,s=ct(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Zs(),d=vt._Implementations.loadWithXhr(t.url,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=Wa.request(n);if(l(o))return o.then(function(r){try{Cesium.ManageIndexedDB.GetManageIndexexDBState()&&Gne(n.url,r)}catch{}return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Xn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Xn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function pV(e){if(e.state===Xn.ISSUED||e.state===Xn.ACTIVE)throw new se("The Resource is already being fetched.");e.state=Xn.UNISSUED,e.deferred=void 0}var K1e=/^data:(.*?)(;base64)?,(.*)$/;function hV(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Yne(e,t){let n=hV(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 $1e(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return hV(i,o);case"arraybuffer":return Yne(i,o);case"blob":return r=Yne(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(hV(i,o),n);case"json":return JSON.parse(hV(i,o));default:}}vt.prototype.fetch=function(e){return e=Rm(e,{}),e.method="GET",this._makeRequest(e)};vt.fetch=function(e){return new vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.delete=function(e){return e=Rm(e,{}),e.method="DELETE",this._makeRequest(e)};vt.delete=function(e){return new vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};vt.prototype.head=function(e){return e=Rm(e,{}),e.method="HEAD",this._makeRequest(e)};vt.head=function(e){return new vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.options=function(e){return e=Rm(e,{}),e.method="OPTIONS",this._makeRequest(e)};vt.options=function(e){return new vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.post=function(e,t){return ro.defined("data",e),t=Rm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};vt.post=function(e){return new vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.put=function(e,t){return ro.defined("data",e),t=Rm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};vt.put=function(e){return new vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.patch=function(e,t){return ro.defined("data",e),t=Rm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};vt.patch=function(e){return new vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt._Implementations={};vt._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&&(nE.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){vt._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=Zs(),d=vt._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new se(`Successfully retrieved ${s} but it contained no content.`));return}return vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};vt.createImageBitmapFromBlob=function(e,t){return ro.defined("options",t),ro.typeOf.bool("options.flipY",t.flipY),ro.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),ro.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Z1e(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new Im(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 Im)})}var Q1e=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=K1e.exec(e);if(a!==null){r.resolve($1e(a,t));return}if(Q1e){Z1e(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(nE.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new Im(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let _=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};_.forEach(function(y){let b=y.split(": "),x=b.shift();m[x]=b.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new se("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new Im)},c.send(i),c};vt._Implementations.loadAndExecuteScript=function(e,t,n){return $b(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ee=vt;function wI(e){e=e??G.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)?Zne(this,e.data):Zne(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}wI.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new wI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};wI.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 Cy(0,0,0,0,0),t}});wI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Cy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=$.lessThanOrEquals(a,e),f=!l(c),d=f||$.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,Jne(this,n,this._samples,e,o,r,t),t}let s=Uo(n,e,$.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,Jne(this,n,this._samples,e,o,r,t),t};function J1e(e,t){return $.compare(e.julianDate,t)}function Zne(e,t){if(!l(t.columnNames))throw new se("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new se("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 se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let _=0,m=u.length;_<m;_+=e._columnCount){let y=u[_+n],b=u[_+c],x=y+Yn.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new $(x,b,Wn.TAI);if(f.push(T),p){if(b!==d&&l(d)){let C=$.leapSeconds,A=Uo(C,T,J1e);if(A<0){let S=new Ki(T,b);C.splice(~A,0,S)}}d=b}}}function Qne(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 vI(e,t,n){return t+e*(n-t)}function Jne(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return Qne(e,n,o,a,s),s;if(i.equals(u))return Qne(e,n,r,a,s),s;let f=$.secondsDifference(i,c)/$.secondsDifference(u,c),d=o*a,p=r*a,_=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-_;if(y>.5||y<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];b!==x&&(u.equals(i)?_=m:m-=x-b)}return s.xPoleWander=vI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=vI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=vI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=vI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=vI(f,_,m),s}var II=wI;function Ac(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Ac.fromQuaternion=function(e,t){l(t)||(t=new Ac);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-D.asinClamped(n),t};Ac.fromDegrees=function(e,t,n,i){return l(i)||(i=new Ac),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Ac.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ac(e.heading,e.pitch,e.roll)};Ac.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ac.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Ac.prototype.clone=function(e){return Ac.clone(this,e)};Ac.prototype.equals=function(e){return Ac.equals(this,e)};Ac.prototype.equalsEpsilon=function(e,t,n){return Ac.equalsEpsilon(this,e,t,n)};Ac.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var qa=Ac;var eie={},tie=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function eRe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=tie.exec(i);if(o!==null)return o[1]}}var _V;function nie(e){return typeof document>"u"?e:(l(_V)||(_V=document.createElement("a")),_V.href=e,_V.href)}var ex;function iie(){if(l(ex))return ex;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(eie?.url)?e=Ou(".",eie.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Ou("..",tx("Core/buildModuleUrl.js")):e=eRe(),ex=new Ee({url:nie(e)}),ex.appendForwardSlash(),ex}function tRe(e){return nie(require.toUrl(`../${e}`))}function oie(e){return iie().getDerivedResource({url:e}).url}var gV;function tx(e){return l(gV)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?gV=tRe:gV=oie),gV(e)}tx._cesiumScriptRegex=tie;tx._buildModuleUrlFromBaseUrl=oie;tx._clearBaseResource=function(){ex=void 0};tx.setBaseUrl=function(e){ex=Ee.DEFAULT.getDerivedResource({url:e})};tx.getCesiumBaseUrl=iie;var on=tx;function nRe(e,t,n){this.x=e,this.y=t,this.s=n}var nx=nRe;function j9(e){e=e??G.EMPTY_OBJECT,this._xysFileUrlTemplate=Ee.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new $(this._sampleZeroJulianEphemerisDate,0,Wn.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 iRe=new $(0,0,Wn.TAI);function H9(e,t,n){let i=iRe;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}j9.prototype.preload=function(e,t,n,i){let o=H9(this,e,t),r=H9(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(G9(this,d));return Promise.all(f)};j9.prototype.computeXysRadians=function(e,t,n){let i=H9(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(G9(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(G9(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new nx(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,_=this._coef,m=this._xTable,y,b;for(y=0;y<=r;++y)d[y]=f-m[y];for(y=0;y<=r;++y){for(_[y]=1,b=0;b<=r;++b)b!==y&&(_[y]*=d[b]);_[y]*=p[y];let x=(s+y)*3;n.x+=_[y]*u[x++],n.y+=_[y]*u[x++],n.s+=_[y]*u[x]}return n};function G9(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 Ee({url:on(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var PI=j9;function it(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var DI=new h;it.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);DI=h.normalize(e,DI);let r=DI.x*o,s=DI.y*o,a=DI.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new it(r,s,a,c)};var oRe=[1,2,0],rRe=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[Z.COLUMN0ROW0],c=e[Z.COLUMN1ROW1],u=e[Z.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,o=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,r=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=oRe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let _=d[p],m=d[_];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(_,_)]-e[Z.getElementIndex(m,m)]+1);let y=rRe;y[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(m,_)]-e[Z.getElementIndex(_,m)])*n,y[_]=(e[Z.getElementIndex(_,p)]+e[Z.getElementIndex(p,_)])*n,y[m]=(e[Z.getElementIndex(m,p)]+e[Z.getElementIndex(p,m)])*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 it(i,o,r,s)};var rie=new it,sie=new it,W9=new it,aie=new it;it.fromHeadingPitchRoll=function(e,t){return aie=it.fromAxisAngle(h.UNIT_X,e.roll,rie),W9=it.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=it.multiply(W9,aie,W9),sie=it.fromAxisAngle(h.UNIT_Z,-e.heading,rie),it.multiply(sie,t,t)};var yV=new h,q9=new h,ih=new it,cie=new it,bV=new it;it.packedLength=4;it.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};it.unpack=function(e,t,n){return t=t??0,l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,bV),it.conjugate(bV,bV);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;it.unpack(e,(t+o)*4,ih),it.multiply(ih,bV,ih),ih.w<0&&it.negate(ih,ih),it.computeAxis(ih,yV);let a=it.computeAngle(ih);l(i)||(i=[]),i[s]=yV.x*a,i[s+1]=yV.y*a,i[s+2]=yV.z*a}};it.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new it),h.fromArray(e,0,q9);let r=h.magnitude(q9);return it.unpack(t,i*4,cie),r===0?it.clone(it.IDENTITY,ih):it.fromAxisAngle(q9,r,ih),it.multiply(ih,cie,o)};it.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 it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.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};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.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};it.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};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,_=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=d,n.y=p,n.z=_,n.w=m,n};it.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};it.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};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};it.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var Y9=new it;it.lerp=function(e,t,n,i){return Y9=it.multiplyByScalar(t,n,Y9),i=it.multiplyByScalar(e,1-n,i),it.add(Y9,i,i)};var lie=new it,X9=new it,K9=new it;it.slerp=function(e,t,n,i){let o=it.dot(e,t),r=t;if(o<0&&(o=-o,r=lie=it.negate(t,lie)),1-o<D.EPSILON6)return it.lerp(e,r,n,i);let s=Math.acos(o);return X9=it.multiplyByScalar(e,Math.sin((1-n)*s),X9),K9=it.multiplyByScalar(r,Math.sin(n*s),K9),i=it.add(X9,K9,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=h.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 sRe=new h,aRe=new h,RI=new it,oE=new it;it.computeInnerQuadrangle=function(e,t,n,i){let o=it.conjugate(t,RI);it.multiply(o,n,oE);let r=it.log(oE,sRe);it.multiply(o,e,oE);let s=it.log(oE,aRe);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),it.exp(r,RI),it.multiply(t,RI,i)};it.squad=function(e,t,n,i,o,r){let s=it.slerp(e,t,o,RI),a=it.slerp(n,i,o,oE);return it.slerp(s,a,2*o*(1-o),r)};var cRe=new it,uie=1.9011074535173003,xV=Nt.supportsTypedArrays()?new Float32Array(8):[],TV=Nt.supportsTypedArrays()?new Float32Array(8):[],n_=Nt.supportsTypedArrays()?new Float32Array(8):[],i_=Nt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;xV[e]=1/(t*n),TV[e]=t/n}xV[7]=uie/(8*17);TV[7]=uie*8/17;it.fastSlerp=function(e,t,n,i){let o=it.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let _=7;_>=0;--_)n_[_]=(xV[_]*c-TV[_])*s,i_[_]=(xV[_]*u-TV[_])*s;let f=r*n*(1+n_[0]*(1+n_[1]*(1+n_[2]*(1+n_[3]*(1+n_[4]*(1+n_[5]*(1+n_[6]*(1+n_[7])))))))),d=a*(1+i_[0]*(1+i_[1]*(1+i_[2]*(1+i_[3]*(1+i_[4]*(1+i_[5]*(1+i_[6]*(1+i_[7])))))))),p=it.multiplyByScalar(e,d,cRe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,o,r){let s=it.fastSlerp(e,t,o,RI),a=it.fastSlerp(n,i,o,oE);return it.fastSlerp(s,a,2*o*(1-o),r)};it.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};it.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};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Pe=it;var mi={},$9={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"}},rE={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Z9={},Kl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Sy=new h,vy=new h,wy=new h;mi.localFrameToFixedFrameGenerator=function(e,t){if(!$9.hasOwnProperty(e)||!$9[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=$9[e][t],i,o=e+t;return l(Z9[o])?i=Z9[o]:(i=function(r,s,a){if(l(a)||(a=new M),h.equalsEpsilon(r,h.ZERO,D.EPSILON14))h.unpack(rE[e],0,Sy),h.unpack(rE[t],0,vy),h.unpack(rE[n],0,wy);else if(D.equalsEpsilon(r.x,0,D.EPSILON14)&&D.equalsEpsilon(r.y,0,D.EPSILON14)){let c=D.sign(r.z);h.unpack(rE[e],0,Sy),e!=="east"&&e!=="west"&&h.multiplyByScalar(Sy,c,Sy),h.unpack(rE[t],0,vy),t!=="east"&&t!=="west"&&h.multiplyByScalar(vy,c,vy),h.unpack(rE[n],0,wy),n!=="east"&&n!=="west"&&h.multiplyByScalar(wy,c,wy)}else{s=s??te.default,s.geodeticSurfaceNormal(r,Kl.up);let c=Kl.up,u=Kl.east;u.x=-r.y,u.y=r.x,u.z=0,h.normalize(u,Kl.east),h.cross(c,u,Kl.north),h.multiplyByScalar(Kl.up,-1,Kl.down),h.multiplyByScalar(Kl.east,-1,Kl.west),h.multiplyByScalar(Kl.north,-1,Kl.south),Sy=Kl[e],vy=Kl[t],wy=Kl[n]}return a[0]=Sy.x,a[1]=Sy.y,a[2]=Sy.z,a[3]=0,a[4]=vy.x,a[5]=vy.y,a[6]=vy.z,a[7]=0,a[8]=wy.x,a[9]=wy.y,a[10]=wy.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Z9[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 lRe=new Pe,uRe=new h(1,1,1),fRe=new M;mi.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??mi.eastNorthUpToFixedFrame;let r=Pe.fromHeadingPitchRoll(t,lRe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,r,uRe,fRe);return o=i(e,n,o),M.multiply(o,s,o)};var dRe=new M,hRe=new Z;mi.headingPitchRollQuaternion=function(e,t,n,i,o){let r=mi.headingPitchRollToFixedFrame(e,t,n,i,dRe),s=M.getMatrix3(r,hRe);return Pe.fromRotationMatrix(s,o)};var mRe=new h(1,1,1),pRe=new h,fie=new M,_Re=new M,gRe=new Z,yRe=new Pe;mi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??mi.eastNorthUpToFixedFrame,l(i)||(i=new qa);let o=M.getTranslation(e,pRe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,fie),fie),s=M.setScale(e,mRe,_Re);s=M.setTranslation(s,h.ZERO,s),r=M.multiply(r,s,r);let a=Pe.fromRotationMatrix(M.getMatrix3(r,gRe),yRe);return a=Pe.normalize(a,a),qa.fromQuaternion(a,i)};var bRe=6*3600+41*60+50.54841,xRe=8640184812866e-6,TRe=.093104,CRe=-62e-7,ARe=11772758384668e-32,ERe=72921158553e-15,SRe=D.TWO_PI/86400,CV=new $;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){CV=$.addSeconds(e,-$.computeTaiMinusUtc(e),CV);let n=CV.dayNumber,i=CV.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Yn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Yn.DAYS_PER_JULIAN_CENTURY;let a=(bRe+o*(xRe+o*(TRe+o*CRe)))*SRe%D.TWO_PI,c=ERe+ARe*(n-24515455e-1),u=(i+Yn.SECONDS_PER_DAY*.5)%Yn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};mi.iau2006XysData=new PI;mi.earthOrientationParameters=II.NONE;var ej=32.184,vRe=2451545;mi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+ej,i=e.stop.dayNumber,o=e.stop.secondsOfDay+ej;return mi.iau2006XysData.preload(t,n,i,o)};mi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=mi.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var wRe=32.184,IRe=2451545,AV=new qa,PRe=new Z,DRe=new $;mi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=$.addSeconds(e,wRe,DRe),i=$.totalDays(n)-IRe,o=D.toRadians(12.112)-D.toRadians(.052992)*i,r=D.toRadians(24.224)-D.toRadians(.105984)*i,s=D.toRadians(227.645)+D.toRadians(13.012)*i,a=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return AV.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(o)-D.toRadians(.12)*Math.sin(r)+D.toRadians(.07)*Math.sin(s)-D.toRadians(.017)*Math.sin(a),AV.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(o)+D.toRadians(.24)*Math.cos(r)-D.toRadians(.028)*Math.cos(s)+D.toRadians(.007)*Math.cos(a),AV.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(o)+D.toRadians(.121)*Math.sin(r)-D.toRadians(.064)*Math.sin(s)+D.toRadians(.016)*Math.sin(a)+D.toRadians(.025)*Math.sin(c),Z.fromHeadingPitchRoll(AV,PRe)};mi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new Z);let n=mi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var RRe=new nx(0,0,0),ORe=new Cy(0,0,0,0,0,0),Q9=new Z,J9=new Z;mi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=mi.earthOrientationParameters.compute(e,ORe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+ej,r=mi.iau2006XysData.computeXysRadians(i,o,RRe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Q9;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-r.s,J9),d=Z.multiply(u,f,Q9),p=e.dayNumber,_=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=_/Yn.SECONDS_PER_DAY,b=.779057273264+y+.00273781191135448*(m+y);b=b%1*D.TWO_PI;let x=Z.fromRotationZ(b,J9),T=Z.multiply(d,x,Q9),C=Math.cos(n.xPoleWander),A=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),R=i-vRe+o/Yn.SECONDS_PER_DAY;R/=36525;let P=-47e-6*R*D.RADIANS_PER_DEGREE/3600,O=Math.cos(P),L=Math.sin(P),g=J9;return g[0]=C*O,g[1]=C*L,g[2]=S,g[3]=-A*L+w*S*O,g[4]=A*O+w*S*L,g[5]=-w*C,g[6]=-w*L-A*S*O,g[7]=w*O-A*S*L,g[8]=A*C,Z.multiply(T,g,t)};var MRe=new ie;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 V);let o=MRe;return M.multiplyByVector(e,ie.fromElements(n.x,n.y,n.z,1,o),o),ie.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),V.fromCartesian4(o,i)};var LRe=new h,NRe=new h,FRe=new h;mi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,LRe),r=h.cross(t,o,NRe);h.equalsEpsilon(r,h.ZERO,D.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,FRe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new Z),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 die=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),hie=new fe,tj=new h,BRe=new h,kRe=new Z,nj=new M,mie=new M;mi.basisTo2D=function(e,t,n){let i=M.getTranslation(t,BRe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,tj);else{let f=o.cartesianToCartographic(i,hie);r=e.project(f,tj),h.fromElements(r.z,r.x,r.y,r)}let s=mi.eastNorthUpToFixedFrame(i,o,nj),a=M.inverseTransformation(s,mie),c=M.getMatrix3(t,kRe),u=M.multiplyByMatrix3(a,c,n);return M.multiply(die,u,n),M.setTranslation(n,r,n),n};mi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=mi.eastNorthUpToFixedFrame(t,i,nj),r=M.inverseTransformation(o,mie),s=i.cartesianToCartographic(t,hie),a=e.project(s,tj);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,nj);return M.multiply(die,r,n),M.multiply(c,n,n),n};var At=mi;function wn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(wn.prototype,{width:{get:function(){return wn.computeWidth(this)}},height:{get:function(){return wn.computeHeight(this)}}});wn.packedLength=4;wn.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};wn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};wn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=D.TWO_PI),t-n};wn.computeHeight=function(e){return e.north-e.south};wn.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e??0),t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new wn(e,t,n,i)};wn.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 wn(e,t,n,i)};wn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+D.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>D.PI&&(i=i-D.TWO_PI),n>D.PI&&(n=n-D.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new wn(n,s,i,a)};wn.fromCartesianArray=function(e,t,n){t=t??te.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>D.PI&&(o=o-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new wn(i,a,o,c)};var URe=new h,zRe=new h,VRe=new h,HRe=new h,GRe=new h,ij=new Array(5);for(let e=0;e<ij.length;++e)ij[e]=new h;wn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=te.default),l(n)||(n=new wn),h.equals(i,h.ZERO))return wn.clone(wn.MAX_VALUE,n),n;let r=At.eastNorthUpToFixedFrame(i,t,URe),s=M.multiplyByPointAsVector(r,h.UNIT_X,zRe);h.normalize(s,s);let a=M.multiplyByPointAsVector(r,h.UNIT_Y,VRe);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,GRe),u=h.negate(s,HRe),f=ij,d=f[0];return h.add(i,a,d),d=f[1],h.add(i,u,d),d=f[2],h.add(i,c,d),d=f[3],h.add(i,s,d),f[4]=i,wn.fromCartesianArray(f,t,n)};wn.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 wn(e.west,e.south,e.east,e.north)};wn.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};wn.prototype.clone=function(e){return wn.clone(this,e)};wn.prototype.equals=function(e){return wn.equals(this,e)};wn.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};wn.prototype.equalsEpsilon=function(e,t){return wn.equalsEpsilon(this,e,t)};wn._validate=function(e){};wn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};wn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};wn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};wn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};wn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=D.TWO_PI);let o=D.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};wn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=D.TWO_PI:r<s&&i>0&&(r+=D.TWO_PI),i<o&&s<0?s+=D.TWO_PI:r<s&&o<0&&(o+=D.TWO_PI);let a=D.negativePiToPi(Math.max(o,s)),c=D.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new wn(a,u,c,f)};wn.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 wn(i,o,r,s)};wn.union=function(e,t,n){l(n)||(n=new wn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=D.TWO_PI:r<s&&i>0&&(r+=D.TWO_PI),i<o&&s<0?s+=D.TWO_PI:r<s&&o<0&&(o+=D.TWO_PI);let a=D.negativePiToPi(Math.min(o,s)),c=D.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};wn.expand=function(e,t,n){return l(n)||(n=new wn),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};wn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=D.TWO_PI,n<0&&(n+=D.TWO_PI)),(n>o||D.equalsEpsilon(n,o,D.EPSILON14))&&(n<r||D.equalsEpsilon(n,r,D.EPSILON14))&&i>=e.south&&i<=e.north};var jRe=new fe;wn.subsample=function(e,t,n,i){t=t??te.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=jRe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*D.PI_OVER_TWO,wn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};wn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new wn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=D.TWO_PI+e.east-e.west;r.west=D.negativePiToPi(e.west+t*a),r.east=D.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};wn.MAX_VALUE=Object.freeze(new wn(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ae=wn;function Hr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}Hr.packedLength=4;Hr.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};Hr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Hr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Hr.fromPoints=function(e,t){if(l(t)||(t=new Hr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var pie=new Mi,WRe=new fe,qRe=new fe;Hr.fromRectangle=function(e,t,n){if(l(n)||(n=new Hr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;pie._ellipsoid=te.default,t=t??pie;let i=t.project(ae.southwest(e,WRe)),o=t.project(ae.northeast(e,qRe));return V.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Hr.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 Hr(e.x,e.y,e.width,e.height)};Hr.union=function(e,t,n){l(n)||(n=new Hr);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};Hr.expand=function(e,t,n){n=Hr.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};Hr.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?Ht.OUTSIDE:Ht.INTERSECTING};Hr.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};Hr.prototype.clone=function(e){return Hr.clone(this,e)};Hr.prototype.intersect=function(e){return Hr.intersect(this,e)};Hr.prototype.equals=function(e){return Hr.equals(this,e)};var Xe=Hr;var Ya={POINTS:q.POINTS,LINES:q.LINES,LINE_LOOP:q.LINE_LOOP,LINE_STRIP:q.LINE_STRIP,TRIANGLES:q.TRIANGLES,TRIANGLE_STRIP:q.TRIANGLE_STRIP,TRIANGLE_FAN:q.TRIANGLE_FAN};Ya.isLines=function(e){return e===Ya.LINES||e===Ya.LINE_LOOP||e===Ya.LINE_STRIP};Ya.isTriangles=function(e){return e===Ya.TRIANGLES||e===Ya.TRIANGLE_STRIP||e===Ya.TRIANGLE_FAN};Ya.validate=function(e){return e===Ya.POINTS||e===Ya.LINES||e===Ya.LINE_LOOP||e===Ya.LINE_STRIP||e===Ya.TRIANGLES||e===Ya.TRIANGLE_STRIP||e===Ya.TRIANGLE_FAN};var Le=Object.freeze(Ya);var ix=`in vec4 position; -in vec2 textureCoordinates; - -out vec2 v_textureCoordinates; - -void main() -{ - gl_Position = position; - v_textureCoordinates = textureCoordinates; -} -`;var Pr={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 OI(e){e=e??G.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Le.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 Ec(e,t){return(e._flags&t)===t}function Iy(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(OI.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 Ec(this,Pr.CULL)},set:function(e){Ec(this,Pr.CULL)!==e&&(Iy(this,Pr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ec(this,Pr.OCCLUDE)},set:function(e){Ec(this,Pr.OCCLUDE)!==e&&(Iy(this,Pr.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 Ec(this,Pr.CAST_SHADOWS)},set:function(e){Ec(this,Pr.CAST_SHADOWS)!==e&&(Iy(this,Pr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ec(this,Pr.RECEIVE_SHADOWS)},set:function(e){Ec(this,Pr.RECEIVE_SHADOWS)!==e&&(Iy(this,Pr.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 Ec(this,Pr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ec(this,Pr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Iy(this,Pr.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 Ec(this,Pr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ec(this,Pr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Iy(this,Pr.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 Ec(this,Pr.PICK_ONLY)},set:function(e){Ec(this,Pr.PICK_ONLY)!==e&&(Iy(this,Pr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ec(this,Pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ec(this,Pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Iy(this,Pr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});OI.shallowClone=function(e,t){if(l(e))return l(t)||(t=new OI),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};OI.prototype.execute=function(e,t){e.draw(this,t)};var qe=OI;var pi={UNSIGNED_BYTE:q.UNSIGNED_BYTE,UNSIGNED_SHORT:q.UNSIGNED_SHORT,UNSIGNED_INT:q.UNSIGNED_INT,FLOAT:q.FLOAT,HALF_FLOAT:q.HALF_FLOAT_OES,UNSIGNED_INT_24_8:q.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:q.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:q.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:q.UNSIGNED_SHORT_5_6_5};pi.toWebGLConstant=function(e,t){switch(e){case pi.UNSIGNED_BYTE:return q.UNSIGNED_BYTE;case pi.UNSIGNED_SHORT:return q.UNSIGNED_SHORT;case pi.UNSIGNED_INT:return q.UNSIGNED_INT;case pi.FLOAT:return q.FLOAT;case pi.HALF_FLOAT:return t.webgl2?q.HALF_FLOAT:q.HALF_FLOAT_OES;case pi.UNSIGNED_INT_24_8:return q.UNSIGNED_INT_24_8;case pi.UNSIGNED_SHORT_4_4_4_4:return q.UNSIGNED_SHORT_4_4_4_4;case pi.UNSIGNED_SHORT_5_5_5_1:return q.UNSIGNED_SHORT_5_5_5_1;case pi.UNSIGNED_SHORT_5_6_5:return pi.UNSIGNED_SHORT_5_6_5}};pi.isPacked=function(e){return e===pi.UNSIGNED_INT_24_8||e===pi.UNSIGNED_SHORT_4_4_4_4||e===pi.UNSIGNED_SHORT_5_5_5_1||e===pi.UNSIGNED_SHORT_5_6_5};pi.sizeInBytes=function(e){switch(e){case pi.UNSIGNED_BYTE:return 1;case pi.UNSIGNED_SHORT:case pi.UNSIGNED_SHORT_4_4_4_4:case pi.UNSIGNED_SHORT_5_5_5_1:case pi.UNSIGNED_SHORT_5_6_5:case pi.HALF_FLOAT:return 2;case pi.UNSIGNED_INT:case pi.FLOAT:case pi.UNSIGNED_INT_24_8:return 4}};pi.validate=function(e){return e===pi.UNSIGNED_BYTE||e===pi.UNSIGNED_SHORT||e===pi.UNSIGNED_INT||e===pi.FLOAT||e===pi.HALF_FLOAT||e===pi.UNSIGNED_INT_24_8||e===pi.UNSIGNED_SHORT_4_4_4_4||e===pi.UNSIGNED_SHORT_5_5_5_1||e===pi.UNSIGNED_SHORT_5_6_5};pi.getTypedArrayConstructor=function(e){let t=pi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===pi.FLOAT?Float32Array:Uint32Array};var He=Object.freeze(pi);var nt={DEPTH_COMPONENT:q.DEPTH_COMPONENT,DEPTH_STENCIL:q.DEPTH_STENCIL,ALPHA:q.ALPHA,RED:q.RED,RG:q.RG,RGB:q.RGB,RGBA:q.RGBA,LUMINANCE:q.LUMINANCE,LUMINANCE_ALPHA:q.LUMINANCE_ALPHA,RGB_DXT1:q.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:q.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:q.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:q.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:q.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:q.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:q.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:q.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:q.COMPRESSED_RGBA_BPTC_UNORM};nt.componentsLength=function(e){switch(e){case nt.RGB:return 3;case nt.RGBA:return 4;case nt.LUMINANCE_ALPHA:case nt.RG:return 2;case nt.ALPHA:case nt.RED:case nt.LUMINANCE:return 1;default:return 1}};nt.validate=function(e){return e===nt.DEPTH_COMPONENT||e===nt.DEPTH_STENCIL||e===nt.ALPHA||e===nt.RED||e===nt.RG||e===nt.RGB||e===nt.RGBA||e===nt.LUMINANCE||e===nt.LUMINANCE_ALPHA||e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5||e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1||e===nt.RGBA_ASTC||e===nt.RGB_ETC1||e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC||e===nt.RGBA_BC7};nt.isColorFormat=function(e){return e===nt.RED||e===nt.ALPHA||e===nt.RGB||e===nt.RGBA||e===nt.LUMINANCE||e===nt.LUMINANCE_ALPHA};nt.isDepthFormat=function(e){return e===nt.DEPTH_COMPONENT||e===nt.DEPTH_STENCIL};nt.isCompressedFormat=function(e){return e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5||e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1||e===nt.RGBA_ASTC||e===nt.RGB_ETC1||e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC||e===nt.RGBA_BC7};nt.isDXTFormat=function(e){return e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5};nt.isPVRTCFormat=function(e){return e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1};nt.isASTCFormat=function(e){return e===nt.RGBA_ASTC};nt.isETC1Format=function(e){return e===nt.RGB_ETC1};nt.isETC2Format=function(e){return e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC};nt.isBC7Format=function(e){return e===nt.RGBA_BC7};nt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case nt.RGB_DXT1:case nt.RGBA_DXT1:case nt.RGB_ETC1:case nt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case nt.RGBA_DXT3:case nt.RGBA_DXT5:case nt.RGBA_ASTC:case nt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case nt.RGB_PVRTC_4BPPV1:case nt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case nt.RGB_PVRTC_2BPPV1:case nt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case nt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};nt.textureSizeInBytes=function(e,t,n,i){let o=nt.componentsLength(e);return He.isPacked(t)&&(o=1),o*He.sizeInBytes(t)*n*i};nt.texture3DSizeInBytes=function(e,t,n,i,o){let r=nt.componentsLength(e);return He.isPacked(t)&&(r=1),r*He.sizeInBytes(t)*n*i*o};nt.alignmentInBytes=function(e,t,n){let i=nt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};nt.createTypedArray=function(e,t,n,i){let o=He.getTypedArrayConstructor(t),r=nt.componentsLength(e)*n*i;return new o(r)};nt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=nt.createTypedArray(t,n,i,o),s=nt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let d=0;d<a;++d)r[f+d]=e[u+d]}return r};nt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===nt.DEPTH_STENCIL)return q.DEPTH24_STENCIL8;if(e===nt.DEPTH_COMPONENT){if(t===He.UNSIGNED_SHORT)return q.DEPTH_COMPONENT16;if(t===He.UNSIGNED_INT)return q.DEPTH_COMPONENT24}if(t===He.FLOAT)switch(e){case nt.RGBA:return q.RGBA32F;case nt.RGB:return q.RGB32F;case nt.RG:return q.RG32F;case nt.RED:return q.R32F}if(t===He.HALF_FLOAT)switch(e){case nt.RGBA:return q.RGBA16F;case nt.RGB:return q.RGB16F;case nt.RG:return q.RG16F;case nt.RED:return q.R16F}if(t===He.UNSIGNED_BYTE)switch(e){case nt.RGBA:return q.RGBA8;case nt.RGB:return q.RGB8;case nt.RG:return q.RG8;case nt.RED:return q.R8}return e};var je=Object.freeze(nt);var Dr={_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(Dr,{maximumCombinedTextureImageUnits:{get:function(){return Dr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Dr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Dr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Dr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Dr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Dr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Dr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Dr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Dr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Dr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Dr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Dr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Dr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Dr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Dr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Dr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Dr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Dr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Dr._maximumColorAttachments}},maximumSamples:{get:function(){return Dr._maximumSamples}},highpFloatSupported:{get:function(){return Dr._highpFloatSupported}},highpIntSupported:{get:function(){return Dr._highpIntSupported}}});var Lt=Dr;function oj(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function EV(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function oh(e){e=e??G.EMPTY_OBJECT;let n=e.context._gl,i=Lt.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;oj(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;EV(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;oj(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;EV(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;EV(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;oj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;EV(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(oh.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)}}});oh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};oh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};oh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};oh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};oh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};oh.prototype.getColorTexture=function(e){return this._colorTextures[e]};oh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};oh.prototype.isDestroyed=function(){return!1};oh.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),ce(this)};var Gr=oh;var SV={CLOCKWISE:q.CW,COUNTER_CLOCKWISE:q.CCW};SV.validate=function(e){return e===SV.CLOCKWISE||e===SV.COUNTER_CLOCKWISE};var Cs=Object.freeze(SV);function _ie(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]=_ie(e[t]));return Object.freeze(e)}var rj=_ie;function Mm(e){let t=e??G.EMPTY_OBJECT,n=t.cull??G.EMPTY_OBJECT,i=t.polygonOffset??G.EMPTY_OBJECT,o=t.scissorTest??G.EMPTY_OBJECT,r=o.rectangle??G.EMPTY_OBJECT,s=t.depthRange??G.EMPTY_OBJECT,a=t.depthTest??G.EMPTY_OBJECT,c=t.colorMask??G.EMPTY_OBJECT,u=t.blending??G.EMPTY_OBJECT,f=u.color??G.EMPTY_OBJECT,d=t.stencilTest??G.EMPTY_OBJECT,p=d.frontOperation??G.EMPTY_OBJECT,_=d.backOperation??G.EMPTY_OBJECT,m=t.sampleCoverage??G.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??Cs.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??q.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Xe.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??q.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new H(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??q.FUNC_ADD,equationAlpha:u.equationAlpha??q.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??q.ONE,functionSourceAlpha:u.functionSourceAlpha??q.ONE,functionDestinationRgb:u.functionDestinationRgb??q.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??q.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??q.ALWAYS,backFunction:d.backFunction??q.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??q.KEEP,zFail:p.zFail??q.KEEP,zPass:p.zPass??q.KEEP},backOperation:{fail:_.fail??q.KEEP,zFail:_.zFail??q.KEEP,zPass:_.zPass??q.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new Xe(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var YRe=0,Om={};Mm.fromCache=function(e){let t=JSON.stringify(e),n=Om[t];if(l(n))return++n.referenceCount,n.state;let i=new Mm(e),o=JSON.stringify(i);return n=Om[o],l(n)||(i.id=YRe++,n={referenceCount:0,state:i},Om[o]=n),++n.referenceCount,Om[t]={referenceCount:1,state:n.state},n.state};Mm.removeFromCache=function(e){let t=new Mm(e),n=JSON.stringify(t),i=Om[n],o=JSON.stringify(e),r=Om[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Om[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Om[n]};Mm.getCache=function(){return Om};Mm.clearCache=function(){Om={}};function ox(e,t,n){n?e.enable(t):e.disable(t)}function gie(e,t){e.frontFace(t.frontFace)}function yie(e,t){let n=t.cull,i=n.enabled;ox(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function bie(e,t){e.lineWidth(t.lineWidth)}function xie(e,t){let n=t.polygonOffset,i=n.enabled;ox(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Tie(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(ox(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 Cie(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Aie(e,t){let n=t.depthTest,i=n.enabled;ox(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Eie(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Sie(e,t){e.depthMask(t.depthMask)}function vie(e,t){e.stencilMask(t.stencilMask)}function XRe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function wie(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;ox(e,e.BLEND,o),o&&(XRe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Iie(e,t){let n=t.stencilTest,i=n.enabled;if(ox(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,_=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,_,m,y)}}function Pie(e,t){let n=t.sampleCoverage,i=n.enabled;ox(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var KRe=new Xe;function Die(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=KRe,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)}Mm.apply=function(e,t,n){gie(e,t),yie(e,t),bie(e,t),xie(e,t),Cie(e,t),Aie(e,t),Eie(e,t),Sie(e,t),vie(e,t),Iie(e,t),Pie(e,t),Tie(e,t,n),wie(e,t,n),Die(e,t,n)};function $Re(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(gie),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(yie),e.lineWidth!==t.lineWidth&&n.push(bie),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(xie),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Cie),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Aie),(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(Eie),e.depthMask!==t.depthMask&&n.push(Sie),e.stencilMask!==t.stencilMask&&n.push(vie),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Iie),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Pie),n}Mm.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=$Re(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&Tie(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&wie(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Die(e,n,o)};Mm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Xe.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:H.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Xe.clone(e.viewport):void 0}};var ze=Mm;function Zt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}Zt.packedLength=4;Zt.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};Zt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Zt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Zt.pack(e[o],t,o*4);return t};Zt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Zt.unpack(e,i,t[o])}return t};Zt.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 Zt(e[0],e[2],e[1],e[3])};Zt.fromArray=Zt.unpack;Zt.fromColumnMajorArray=function(e,t){return Zt.clone(e,t)};Zt.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 Zt(e[0],e[1],e[2],e[3])};Zt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Zt(e.x,0,0,e.y)};Zt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Zt(e,0,0,e)};Zt.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 Zt(n,-i,i,n)};Zt.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]]};Zt.getElementIndex=function(e,t){return e*2+t};Zt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Zt.setColumn=function(e,t,n,i){i=Zt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Zt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Zt.setRow=function(e,t,n,i){return i=Zt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var ZRe=new V;Zt.setScale=function(e,t,n){let i=Zt.getScale(e,ZRe),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 QRe=new V;Zt.setUniformScale=function(e,t,n){let i=Zt.getScale(e,QRe),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 Rie=new V;Zt.getScale=function(e,t){return t.x=V.magnitude(V.fromElements(e[0],e[1],Rie)),t.y=V.magnitude(V.fromElements(e[2],e[3],Rie)),t};var Oie=new V;Zt.getMaximumScale=function(e){return Zt.getScale(e,Oie),V.maximumComponent(Oie)};var JRe=new V;Zt.setRotation=function(e,t,n){let i=Zt.getScale(e,JRe);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 eOe=new V;Zt.getRotation=function(e,t){let n=Zt.getScale(e,eOe);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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Zt.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};Zt.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};Zt.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]};Zt.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]};Zt.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};Zt.IDENTITY=Object.freeze(new Zt(1,0,0,1));Zt.ZERO=Object.freeze(new Zt(0,0,0,0));Zt.COLUMN0ROW0=0;Zt.COLUMN0ROW1=1;Zt.COLUMN1ROW0=2;Zt.COLUMN1ROW1=3;Object.defineProperties(Zt.prototype,{length:{get:function(){return Zt.packedLength}}});Zt.prototype.clone=function(e){return Zt.clone(this,e)};Zt.prototype.equals=function(e){return Zt.equals(this,e)};Zt.prototype.equalsEpsilon=function(e,t){return Zt.equalsEpsilon(this,e,t)};Zt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var ei=Zt;function tOe(e,t,n,i){switch(t.type){case e.FLOAT:return new Mie(e,t,n,i);case e.FLOAT_VEC2:return new Lie(e,t,n,i);case e.FLOAT_VEC3:return new Nie(e,t,n,i);case e.FLOAT_VEC4:return new Fie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new sj(e,t,n,i);case e.INT:case e.BOOL:return new Bie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new kie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Uie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new zie(e,t,n,i);case e.FLOAT_MAT2:return new Vie(e,t,n,i);case e.FLOAT_MAT3:return new Hie(e,t,n,i);case e.FLOAT_MAT4:return new Gie(e,t,n,i);default:throw new se(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Mie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Mie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Lie(e,t,n,i){this.name=n,this.value=void 0,this._value=new V,this._gl=e,this._location=i}Lie.prototype.set=function(){let e=this.value;V.equals(e,this._value)||(V.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Nie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Nie.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function Fie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Fie.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(ie.equals(e,this._value)||(this._value=ie.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function sj(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}sj.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};sj.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Bie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Bie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function kie(e,t,n,i){this.name=n,this.value=void 0,this._value=new V,this._gl=e,this._location=i}kie.prototype.set=function(){let e=this.value;V.equals(e,this._value)||(V.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Uie(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}Uie.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function zie(e,t,n,i){this.name=n,this.value=void 0,this._value=new ie,this._gl=e,this._location=i}zie.prototype.set=function(){let e=this.value;ie.equals(e,this._value)||(ie.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var nOe=new Float32Array(4);function Vie(e,t,n,i){this.name=n,this.value=void 0,this._value=new ei,this._gl=e,this._location=i}Vie.prototype.set=function(){if(!ei.equalsArray(this.value,this._value,0)){ei.clone(this.value,this._value);let e=ei.toArray(this.value,nOe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var iOe=new Float32Array(9);function Hie(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}Hie.prototype.set=function(){if(!Z.equalsArray(this.value,this._value,0)){Z.clone(this.value,this._value);let e=Z.toArray(this.value,iOe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var oOe=new Float32Array(16);function Gie(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}Gie.prototype.set=function(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let e=M.toArray(this.value,oOe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var MI=tOe;function rOe(e,t,n,i){switch(t.type){case e.FLOAT:return new jie(e,t,n,i);case e.FLOAT_VEC2:return new Wie(e,t,n,i);case e.FLOAT_VEC3:return new qie(e,t,n,i);case e.FLOAT_VEC4:return new Yie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new aj(e,t,n,i);case e.INT:case e.BOOL:return new Xie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Kie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new $ie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Zie(e,t,n,i);case e.FLOAT_MAT2:return new Qie(e,t,n,i);case e.FLOAT_MAT3:return new Jie(e,t,n,i);case e.FLOAT_MAT4:return new eoe(e,t,n,i);default:throw new se(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function jie(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]}jie.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 Wie(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]}Wie.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];V.equalsArray(s,n,o)||(V.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function qie(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]}qie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let 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)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Yie(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]}Yie.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)?H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0):l(s.x)&&(ie.equalsArray(s,n,o)||(ie.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function aj(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}aj.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};aj.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 Xie(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]}Xie.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 Kie(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]}Kie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];V.equalsArray(s,n,o)||(V.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function $ie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}$ie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function Zie(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]}Zie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];ie.equalsArray(s,n,o)||(ie.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function Qie(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]}Qie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];ei.equalsArray(s,n,o)||(ei.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Jie(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]}Jie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Z.equalsArray(s,n,o)||(Z.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function eoe(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]}eoe.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];M.equalsArray(s,n,o)||(M.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var LI=rOe;var sOe=0;function o_(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=aOe(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=sOe++}o_.fromCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};o_.replaceCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(o_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return vV(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return vV(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return vV(this),this._uniformsByName}}});function toe(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 aOe(e,t){let n={};if(!Lt.highpFloatSupported||!Lt.highpIntSupported){let i,o,r,s,a=toe(e),c=toe(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Lm="[Cesium WebGL] ";function cOe(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(`${Lm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Lm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Lm}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Lm}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Lm}Vertex shader compile log: ${c}`),console.error(`${Lm} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Lm}Fragment shader compile log: ${c}`),console.error(`${Lm} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new se(u);function d(p,_){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Lm}${_} shader translation failed.`);return}console.error(`${Lm}Translated ${_} shaderSource: -${m}`)}}function lOe(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 uOe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=MI(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,_,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,_=e.getUniformLocation(t,u),_!==null&&(d.push(_),p.push(e.getUniform(t,_))))}else{d=[];for(let y=0;y<a.size;++y)_=e.getUniformLocation(t,`${u}[${y}]`),_!==null&&d.push(_);f=LI(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function fOe(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=$p[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function dOe(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 vV(e){l(e._program)||noe(e)}function noe(e){let t=e._program,n=e._gl,i=cOe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=uOe(n,i),s=fOe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=lOe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=dOe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,_=/ ! = /g;e._vertexShaderText=a.replace(_," != "),e._fragmentShaderText=c.replace(_," != ");try{noe(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}o_.prototype._bind=function(){vV(this),this._gl.useProgram(this._program)};o_.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)}};o_.prototype.isDestroyed=function(){return!1};o_.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};o_.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ce(this)};var Xt=o_;function wV(e){this._context=e}var NI,hOe=new qe({primitiveType:Le.TRIANGLES}),mOe=new oi({color:new H(0,0,0,0)});function pOe(e,t){return new Gr({context:e,colorTextures:[t],destroyAttachments:!1})}function _Oe(e,t){return Xt.fromCache({context:e,vertexShaderSource:ix,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function gOe(e,t){return(!l(NI)||NI.viewport.width!==e||NI.viewport.height!==t)&&(NI=ze.fromCache({viewport:new Xe(0,0,e,t)})),NI}wV.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:_Oe(o,e.fragmentShaderSource),a=pOe(o,t),c=gOe(n,i),u=e.uniformMap,f=mOe;f.framebuffer=a,f.renderState=c,f.execute(o);let d=hOe;d.vertexArray=r,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};wV.prototype.isDestroyed=function(){return!1};wV.prototype.destroy=function(){return ce(this)};var FI=wV;var vn={BYTE:q.BYTE,UNSIGNED_BYTE:q.UNSIGNED_BYTE,SHORT:q.SHORT,UNSIGNED_SHORT:q.UNSIGNED_SHORT,INT:q.INT,UNSIGNED_INT:q.UNSIGNED_INT,FLOAT:q.FLOAT,DOUBLE:q.DOUBLE};vn.getSizeInBytes=function(e){switch(e){case vn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case vn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case vn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case vn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case vn.INT:return Int32Array.BYTES_PER_ELEMENT;case vn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case vn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case vn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};vn.fromTypedArray=function(e){if(e instanceof Int8Array)return vn.BYTE;if(e instanceof Uint8Array)return vn.UNSIGNED_BYTE;if(e instanceof Int16Array)return vn.SHORT;if(e instanceof Uint16Array)return vn.UNSIGNED_SHORT;if(e instanceof Int32Array)return vn.INT;if(e instanceof Uint32Array)return vn.UNSIGNED_INT;if(e instanceof Float32Array)return vn.FLOAT;if(e instanceof Float64Array)return vn.DOUBLE};vn.validate=function(e){return l(e)&&(e===vn.BYTE||e===vn.UNSIGNED_BYTE||e===vn.SHORT||e===vn.UNSIGNED_SHORT||e===vn.INT||e===vn.UNSIGNED_INT||e===vn.FLOAT||e===vn.DOUBLE)};vn.createTypedArray=function(e,t){switch(e){case vn.BYTE:return new Int8Array(t);case vn.UNSIGNED_BYTE:return new Uint8Array(t);case vn.SHORT:return new Int16Array(t);case vn.UNSIGNED_SHORT:return new Uint16Array(t);case vn.INT:return new Int32Array(t);case vn.UNSIGNED_INT:return new Uint32Array(t);case vn.FLOAT:return new Float32Array(t);case vn.DOUBLE:return new Float64Array(t)}};vn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/vn.getSizeInBytes(e),e){case vn.BYTE:return new Int8Array(t,n,i);case vn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case vn.SHORT:return new Int16Array(t,n,i);case vn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case vn.INT:return new Int32Array(t,n,i);case vn.UNSIGNED_INT:return new Uint32Array(t,n,i);case vn.FLOAT:return new Float32Array(t,n,i);case vn.DOUBLE:return new Float64Array(t,n,i)}};vn.fromName=function(e){switch(e){case"BYTE":return vn.BYTE;case"UNSIGNED_BYTE":return vn.UNSIGNED_BYTE;case"SHORT":return vn.SHORT;case"UNSIGNED_SHORT":return vn.UNSIGNED_SHORT;case"INT":return vn.INT;case"UNSIGNED_INT":return vn.UNSIGNED_INT;case"FLOAT":return vn.FLOAT;case"DOUBLE":return vn.DOUBLE}};var K=Object.freeze(vn);var yOe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Gf=Object.freeze(yOe);function cj(e){e=e??G.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Le.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??Gf.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}cj.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 bOe=new fe,xOe=new h,ioe=new M,TOe=[new fe,new fe,new fe],COe=[new V,new V,new V],AOe=[new V,new V,new V],EOe=new h,SOe=new Pe,vOe=new M,wOe=new ei;cj._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ae.center(i,bOe),s=fe.toCartesian(r,n,xOe),a=At.eastNorthUpToFixedFrame(s,n,ioe),c=M.inverse(a,ioe),u=COe,f=TOe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=EOe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,d),d=M.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Pe.fromAxisAngle(h.UNIT_Z,-t,SOe),_=Z.fromQuaternion(p,vOe),m=e.length,y=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)d=M.multiplyByPointAsVector(c,e[o],d),d=Z.multiplyByVector(_,d,d),y=Math.min(y,d.x),b=Math.min(b,d.y),x=Math.max(x,d.x),T=Math.max(T,d.y);let C=ei.fromRotation(t,wOe),A=AOe;A[0].x=y,A[0].y=b,A[1].x=y,A[1].y=T,A[2].x=x,A[2].y=b;let S=u[0],w=u[2].x-S.x,R=u[1].y-S.y;for(o=0;o<3;o++){let E=A[o];ei.multiplyByVector(C,E,E),E.x=(E.x-S.x)/w,E.y=(E.y-S.y)/R}let P=A[0],O=A[1],L=A[2],g=new Array(6);return V.pack(P,g),V.pack(O,g,2),V.pack(L,g,4),g};var lt=cj;function IOe(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var we=IOe;function sE(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(sE.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}}});sE.clone=function(e){if(l(e))return new sE(e._format,e._datatype,e._width,e._height,e._buffer)};sE.prototype.clone=function(){return sE.clone(this)};var BI=sE;var ooe=er(Ru(),1);function roe(){if(!l(Sa._canTransferArrayBuffer)){let e=fj("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Sa._canTransferArrayBuffer=!1,Sa._canTransferArrayBuffer}Sa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),Sa._canTransferArrayBuffer=s}})}return Sa._canTransferArrayBuffer}var uj=new me;function lj(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 fj(e){let t=new ooe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Ey(e))s=e;else if(!n){let a=on(`${Sa._workerModulePrefix}/${i}.js`);Ey(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=lj(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${lj(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return r=lj(a),new Worker(r,o)}if(r=e,n||(r=on(`${Sa._workerModulePrefix+i}.js`)),!Nt.supportsEsmWebWorkers())throw new se("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function POe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Nt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new se(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=on(t.fallbackModulePath),n}n.wasmBinaryFile=on(t.wasmBinaryFile);let i=await Ee.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Sa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var DOe=(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 se(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),uj.raiseEvent(s),i(s)}else uj.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},ROe=[];async function OOe(e,t,n){let i=await Promise.resolve(roe());l(n)?i||(n.length=0):n=ROe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",DOe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:on.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function MOe(e,t,n){++e._activeTasks;try{let i=await OOe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Sa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=fj(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return MOe(this,e,t)};Sa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=fj(this._workerPath),i=await POe(this,e),o=await Promise.resolve(roe()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new se("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Sa.prototype.isDestroyed=function(){return!1};Sa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ce(this)};Sa.taskCompletedEvent=uj;Sa._defaultWorkerModulePrefix="Workers/";Sa._workerModulePrefix=Sa._defaultWorkerModulePrefix;Sa._canTransferArrayBuffer=void 0;var di=Sa;function r_(){}r_._transcodeTaskProcessor=new di("transcodeKTX2",Number.POSITIVE_INFINITY);r_._readyPromise=void 0;function LOe(){let e=r_._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return r_._transcodeTaskProcessor;throw new se("KTX2 transcoder could not be initialized.")});r_._readyPromise=e}r_.transcode=function(e,t){return l(r_._readyPromise)||LOe(),r_._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 BI(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 kI=r_;var soe;aoe.setKTX2SupportedFormats=function(e,t,n,i,o,r){soe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function aoe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ee.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return kI.transcode(n,soe)})}var Qs=aoe;function NOe(e,t){this.start=e??0,this.stop=t??0}var Xa=NOe;function pn(e,t){this.center=h.clone(e??h.ZERO),this.radius=t??0}var mj=new h,pj=new h,_j=new h,gj=new h,yj=new h,bj=new h,xj=new h,va=new h,Tj=new h,Cj=new h,Aj=new h,Ej=new h,FOe=4/3*D.PI;pn.fromPoints=function(e,t){if(l(t)||(t=new pn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],xj),i=h.clone(n,mj),o=h.clone(n,pj),r=h.clone(n,_j),s=h.clone(n,gj),a=h.clone(n,yj),c=h.clone(n,bj),u=e.length,f;for(f=1;f<u;f++){h.clone(e[f],n);let P=n.x,O=n.y,L=n.z;P<i.x&&h.clone(n,i),P>s.x&&h.clone(n,s),O<o.y&&h.clone(n,o),O>a.y&&h.clone(n,a),L<r.z&&h.clone(n,r),L>c.z&&h.clone(n,c)}let d=h.magnitudeSquared(h.subtract(s,i,va)),p=h.magnitudeSquared(h.subtract(a,o,va)),_=h.magnitudeSquared(h.subtract(c,r,va)),m=i,y=s,b=d;p>b&&(b=p,m=o,y=a),_>b&&(b=_,m=r,y=c);let x=Tj;x.x=(m.x+y.x)*.5,x.y=(m.y+y.y)*.5,x.z=(m.z+y.z)*.5;let T=h.magnitudeSquared(h.subtract(y,x,va)),C=Math.sqrt(T),A=Cj;A.x=i.x,A.y=o.y,A.z=r.z;let S=Aj;S.x=s.x,S.y=a.y,S.z=c.z;let w=h.midpoint(A,S,Ej),R=0;for(f=0;f<u;f++){h.clone(e[f],n);let P=h.magnitude(h.subtract(n,w,va));P>R&&(R=P);let O=h.magnitudeSquared(h.subtract(n,x,va));if(O>T){let L=Math.sqrt(O);C=(C+L)*.5,T=C*C;let g=L-C;x.x=(C*x.x+g*n.x)/L,x.y=(C*x.y+g*n.y)/L,x.z=(C*x.z+g*n.z)/L}}return C<R?(h.clone(x,t.center),t.radius=C):(h.clone(w,t.center),t.radius=R),t};var coe=new Mi,BOe=new h,kOe=new h,dj=new fe,hj=new fe;pn.fromRectangle2D=function(e,t,n){return pn.fromRectangleWithHeights2D(e,t,0,0,n)};pn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new pn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;coe._ellipsoid=te.default,t=t??coe,ae.southwest(e,dj),dj.height=n,ae.northeast(e,hj),hj.height=i;let r=t.project(dj,BOe),s=t.project(hj,kOe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var UOe=[];pn.fromRectangle3D=function(e,t,n,i){if(t=t??te.default,n=n??0,l(i)||(i=new pn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=ae.subsample(e,t,n,UOe);return pn.fromPoints(o,i)};pn.fromVertices=function(e,t,n,i){if(l(i)||(i=new pn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=t??h.ZERO,n=n??3;let o=xj;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,mj),s=h.clone(o,pj),a=h.clone(o,_j),c=h.clone(o,gj),u=h.clone(o,yj),f=h.clone(o,bj),d=e.length,p;for(p=0;p<d;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,E=e[p+2]+t.z;o.x=L,o.y=g,o.z=E,L<r.x&&h.clone(o,r),L>c.x&&h.clone(o,c),g<s.y&&h.clone(o,s),g>u.y&&h.clone(o,u),E<a.z&&h.clone(o,a),E>f.z&&h.clone(o,f)}let _=h.magnitudeSquared(h.subtract(c,r,va)),m=h.magnitudeSquared(h.subtract(u,s,va)),y=h.magnitudeSquared(h.subtract(f,a,va)),b=r,x=c,T=_;m>T&&(T=m,b=s,x=u),y>T&&(T=y,b=a,x=f);let C=Tj;C.x=(b.x+x.x)*.5,C.y=(b.y+x.y)*.5,C.z=(b.z+x.z)*.5;let A=h.magnitudeSquared(h.subtract(x,C,va)),S=Math.sqrt(A),w=Cj;w.x=r.x,w.y=s.y,w.z=a.z;let R=Aj;R.x=c.x,R.y=u.y,R.z=f.z;let P=h.midpoint(w,R,Ej),O=0;for(p=0;p<d;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=h.magnitude(h.subtract(o,P,va));L>O&&(O=L);let g=h.magnitudeSquared(h.subtract(o,C,va));if(g>A){let E=Math.sqrt(g);S=(S+E)*.5,A=S*S;let v=E-S;C.x=(S*C.x+v*o.x)/E,C.y=(S*C.y+v*o.y)/E,C.z=(S*C.z+v*o.z)/E}}return S<O?(h.clone(C,i.center),i.radius=S):(h.clone(P,i.center),i.radius=O),i};pn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new pn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=xj;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,mj),r=h.clone(i,pj),s=h.clone(i,_j),a=h.clone(i,gj),c=h.clone(i,yj),u=h.clone(i,bj),f=e.length,d;for(d=0;d<f;d+=3){let O=e[d]+t[d],L=e[d+1]+t[d+1],g=e[d+2]+t[d+2];i.x=O,i.y=L,i.z=g,O<o.x&&h.clone(i,o),O>a.x&&h.clone(i,a),L<r.y&&h.clone(i,r),L>c.y&&h.clone(i,c),g<s.z&&h.clone(i,s),g>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,o,va)),_=h.magnitudeSquared(h.subtract(c,r,va)),m=h.magnitudeSquared(h.subtract(u,s,va)),y=o,b=a,x=p;_>x&&(x=_,y=r,b=c),m>x&&(x=m,y=s,b=u);let T=Tj;T.x=(y.x+b.x)*.5,T.y=(y.y+b.y)*.5,T.z=(y.z+b.z)*.5;let C=h.magnitudeSquared(h.subtract(b,T,va)),A=Math.sqrt(C),S=Cj;S.x=o.x,S.y=r.y,S.z=s.z;let w=Aj;w.x=a.x,w.y=c.y,w.z=u.z;let R=h.midpoint(S,w,Ej),P=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let O=h.magnitude(h.subtract(i,R,va));O>P&&(P=O);let L=h.magnitudeSquared(h.subtract(i,T,va));if(L>C){let g=Math.sqrt(L);A=(A+g)*.5,C=A*A;let E=g-A;T.x=(A*T.x+E*i.x)/g,T.y=(A*T.y+E*i.y)/g,T.z=(A*T.z+E*i.z)/g}}return A<P?(h.clone(T,n.center),n.radius=A):(h.clone(R,n.center),n.radius=P),n};pn.fromCornerPoints=function(e,t,n){l(n)||(n=new pn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};pn.fromEllipsoid=function(e,t){return l(t)||(t=new pn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var zOe=new h;pn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new pn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return pn.clone(e[0],t);if(n===2)return pn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=pn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,zOe)+a.radius)}return t.radius=s,t};var VOe=new h,HOe=new h,GOe=new h;pn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new pn);let n=e.halfAxes,i=Z.getColumn(n,0,VOe),o=Z.getColumn(n,1,HOe),r=Z.getColumn(n,2,GOe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var jOe=new h,WOe=new h;pn.fromTransformation=function(e,t){l(t)||(t=new pn);let n=M.getTranslation(e,jOe),i=M.getScale(e,WOe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};pn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new pn(e.center,e.radius)};pn.packedLength=4;pn.pack=function(e,t,n){n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};pn.unpack=function(e,t,n){t=t??0,l(n)||(n=new pn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var qOe=new h,YOe=new h;pn.union=function(e,t,n){l(n)||(n=new pn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,qOe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=h.multiplyByScalar(a,(-o+u)/c,YOe);return h.add(f,i,f),h.clone(f,n.center),n.radius=u,n};var XOe=new h;pn.expand=function(e,t,n){n=pn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,XOe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?Ht.OUTSIDE:r<i?Ht.INTERSECTING:Ht.INSIDE};pn.transform=function(e,t,n){return l(n)||(n=new pn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=M.getMaximumScale(t)*e.radius,n};var KOe=new h;pn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,KOe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};pn.transformWithoutScale=function(e,t,n){return l(n)||(n=new pn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var $Oe=new h;pn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Xa);let o=h.subtract(e.center,t,$Oe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var loe=new h,ZOe=new h,QOe=new h,JOe=new h,eMe=new h,tMe=new fe,foe=new Array(8);for(let e=0;e<8;++e)foe[e]=new h;var uoe=new Mi;pn.projectTo2D=function(e,t,n){uoe._ellipsoid=te.default,t=t??uoe;let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,loe):s=i.geodeticSurfaceNormal(o,loe);let a=h.cross(h.UNIT_Z,s,ZOe);h.normalize(a,a);let c=h.cross(s,a,QOe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let u=h.negate(c,eMe),f=h.negate(a,JOe),d=foe,p=d[0];h.add(s,c,p),h.add(p,a,p),p=d[1],h.add(s,c,p),h.add(p,f,p),p=d[2],h.add(s,u,p),h.add(p,f,p),p=d[3],h.add(s,u,p),h.add(p,a,p),h.negate(s,s),p=d[4],h.add(s,c,p),h.add(p,a,p),p=d[5],h.add(s,c,p),h.add(p,f,p),p=d[6],h.add(s,u,p),h.add(p,f,p),p=d[7],h.add(s,u,p),h.add(p,a,p);let _=d.length;for(let x=0;x<_;++x){let T=d[x];h.add(o,T,T);let C=i.cartesianToCartographic(T,tMe);t.project(C,T)}n=pn.fromPoints(d,n),o=n.center;let m=o.x,y=o.y,b=o.z;return o.x=b,o.y=m,o.z=y,n};pn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};pn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};pn.prototype.intersectPlane=function(e){return pn.intersectPlane(this,e)};pn.prototype.distanceSquaredTo=function(e){return pn.distanceSquaredTo(this,e)};pn.prototype.computePlaneDistances=function(e,t,n){return pn.computePlaneDistances(this,e,t,n)};pn.prototype.isOccluded=function(e){return pn.isOccluded(this,e)};pn.prototype.equals=function(e){return pn.equals(this,e)};pn.prototype.clone=function(e){return pn.clone(this,e)};pn.prototype.volume=function(){let e=this.radius;return FOe*e*e*e};var re=pn;function nMe(e){e=e??G.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 dn=nMe;var iMe={NONE:0,TOP:1,ALL:2},an=Object.freeze(iMe);function As(e){e=e??G.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}As.POSITION_ONLY=Object.freeze(new As({position:!0}));As.POSITION_AND_NORMAL=Object.freeze(new As({position:!0,normal:!0}));As.POSITION_NORMAL_AND_ST=Object.freeze(new As({position:!0,normal:!0,st:!0}));As.POSITION_AND_ST=Object.freeze(new As({position:!0,st:!0}));As.POSITION_AND_COLOR=Object.freeze(new As({position:!0,color:!0}));As.ALL=Object.freeze(new As({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));As.DEFAULT=As.POSITION_NORMAL_AND_ST;As.packedLength=6;As.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};As.unpack=function(e,t,n){return t=t??0,l(n)||(n=new As),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};As.clone=function(e,t){if(l(e))return l(t)||(t=new As),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 De=As;var oMe=new h;function Lu(e){e=e??G.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??De.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Lu.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Lu({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Lu.fromAxisAlignedBoundingBox=function(e){return new Lu({minimum:e.minimum,maximum:e.maximum})};Lu.packedLength=2*h.packedLength+De.packedLength+1;Lu.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),De.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+De.packedLength]=e._offsetAttribute??-1,t};var hoe=new h,moe=new h,poe=new De,doe={minimum:hoe,maximum:moe,vertexFormat:poe,offsetAttribute:void 0};Lu.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,hoe),o=h.unpack(e,t+h.packedLength,moe),r=De.unpack(e,t+2*h.packedLength,poe),s=e[t+2*h.packedLength+De.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=De.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(doe.offsetAttribute=s===-1?void 0:s,new Lu(doe))};Lu.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new dn,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 we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}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 we({componentDatatype:K.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=h.subtract(n,t,oMe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===an.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new lt({attributes:o,indices:r,primitiveType:Le.TRIANGLES,boundingSphere:new re(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var Sj;Lu.getUnitBox=function(){return l(Sj)||(Sj=Lu.createGeometry(Lu.fromDimensions({dimensions:new h(1,1,1),vertexFormat:De.POSITION_ONLY}))),Sj};var Ka=Lu;var ao={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};ao.getMathType=function(e){switch(e){case ao.SCALAR:return Number;case ao.VEC2:return V;case ao.VEC3:return h;case ao.VEC4:return ie;case ao.MAT2:return ei;case ao.MAT3:return Z;case ao.MAT4:return M}};ao.getNumberOfComponents=function(e){switch(e){case ao.SCALAR:return 1;case ao.VEC2:return 2;case ao.VEC3:return 3;case ao.VEC4:case ao.MAT2:return 4;case ao.MAT3:return 9;case ao.MAT4:return 16}};ao.getAttributeLocationCount=function(e){switch(e){case ao.SCALAR:case ao.VEC2:case ao.VEC3:case ao.VEC4:return 1;case ao.MAT2:return 2;case ao.MAT3:return 3;case ao.MAT4:return 4}};ao.getGlslType=function(e){switch(e){case ao.SCALAR:return"float";case ao.VEC2:return"vec2";case ao.VEC3:return"vec3";case ao.VEC4:return"vec4";case ao.MAT2:return"mat2";case ao.MAT3:return"mat3";case ao.MAT4:return"mat4"}};var rn=Object.freeze(ao);var _oe=1/256,goe=256,Eo={};Eo.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(o)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Eo.octEncode=function(e,t){return Eo.octEncodeInRange(e,255,t)};var UI=new V,yoe=new Uint8Array(1);function IV(e){return yoe[0]=e,yoe[0]}Eo.octEncodeToCartesian4=function(e,t){return Eo.octEncodeInRange(e,65535,UI),t.x=IV(UI.x*_oe),t.y=IV(UI.x),t.z=IV(UI.y*_oe),t.w=IV(UI.y),t};Eo.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(o),i.y=(1-Math.abs(o))*D.signNotZero(i.y)}return h.normalize(i,i)};Eo.octDecode=function(e,t,n){return Eo.octDecodeInRange(e,t,255,n)};Eo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*goe+i,a=o*goe+r;return Eo.octDecodeInRange(s,a,65535,t)};Eo.octPackFloat=function(e){return 256*e.x+e.y};var wj=new V;Eo.octEncodeFloat=function(e){return Eo.octEncode(e,wj),Eo.octPackFloat(wj)};Eo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return Eo.octDecode(i,o,t)};Eo.octPack=function(e,t,n,i){let o=Eo.octEncodeFloat(e),r=Eo.octEncodeFloat(t),s=Eo.octEncode(n,wj);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};Eo.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;Eo.octDecodeFloat(s,t),Eo.octDecodeFloat(c,n),Eo.octDecode(r,a,i)};Eo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Eo.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 vj(e){return e>>1^-(e&1)}Eo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=vj(e[a]),r+=vj(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=vj(n[a]),n[a]=s)};Eo.dequantize=function(e,t,n,i){let o=rn.getNumberOfComponents(n),r;switch(t){case K.BYTE:r=127;break;case K.UNSIGNED_BYTE:r=255;break;case K.SHORT:r=32767;break;case K.UNSIGNED_SHORT:r=65535;break;case K.INT:r=2147483647;break;case K.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};Eo.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var On=Eo;var boe=new h,xoe=new h,Toe=new h;function rMe(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,boe),s=h.subtract(i,t,xoe),a=h.subtract(e,t,Toe),c=h.dot(r,r),u=h.dot(r,s),f=h.dot(r,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(V.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,o);if(V.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,o);if(V.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,o);r=V.subtract(n,t,boe),s=V.subtract(i,t,xoe),a=V.subtract(e,t,Toe),c=V.dot(r,r),u=V.dot(r,s),f=V.dot(r,a),d=V.dot(s,s),p=V.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let _=c*d-u*u;if(_!==0)return o.y/=_,o.z/=_,o.x=1-o.y-o.z,o}var rx=rMe;function Nm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Nm.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 s_={high:0,low:0};Nm.fromCartesian=function(e,t){l(t)||(t=new Nm);let n=t.high,i=t.low;return Nm.encode(e.x,s_),n.x=s_.high,i.x=s_.low,Nm.encode(e.y,s_),n.y=s_.high,i.y=s_.low,Nm.encode(e.z,s_),n.z=s_.high,i.z=s_.low,t};var Ij=new Nm;Nm.writeElements=function(e,t,n){Nm.fromCartesian(e,Ij);let i=Ij.high,o=Ij.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 Gn=Nm;var Pj={};Pj.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Coe(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Pj.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Coe(o,-r,D.EPSILON14);if(s<0)return[];let a=-.5*Coe(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var il=Pj;var Rj={};Rj.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 Dj(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,_=o*a-r*s,m=r*a-d,y=4*p*m-_*_,b,x;if(y<0){let j,W,J;f*u>=c*d?(j=o,W=p,J=-2*r*p+o*_):(j=a,W=m,J=-a*_+2*s*m);let ee=-(J<0?-1:1)*Math.abs(j)*Math.sqrt(-y);x=-J+ee;let Q=x/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),ge=x===ee?-de:-W/de;return b=W<=0?de+ge:-J/(de*de+ge*ge+W),f*u>=c*d?[(b-r)/o]:[-a/(b+s)]}let T=p,C=-2*r*p+o*_,A=m,S=-a*_+2*s*m,w=Math.sqrt(y),R=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-C)/3);b=2*Math.sqrt(-T);let O=Math.cos(P);x=b*O;let L=b*(-O/2-R*Math.sin(P)),g=x+L>2*r?x-r:L-r,E=o,v=g/E;P=Math.abs(Math.atan2(a*w,-S)/3),b=2*Math.sqrt(-A),O=Math.cos(P),x=b*O,L=b*(-O/2-R*Math.sin(P));let I=-a,N=x+L<2*s?x+s:L+s,F=I/N,U=E*N,k=-g*N-E*I,z=g*I,B=(s*k-r*z)/(-r*k+s*U);return v<=B?v<=F?B<=F?[v,B,F]:[v,F,B]:[F,v,B]:v<=F?[B,v,F]:B<=F?[B,F,v]:[F,B,v]}Rj.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return il.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=il.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Dj(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Dj(e,t,0,i);if(i===0)return o=il.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Dj(e,t,n,i)};var sx=Rj;var Oj={};Oj.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,_=o*o,m=_*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+_*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function rh(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=sx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=il.computeRealRoots(1,r,a);if(d.length===2){let p=d[0],_=d[1],m;if(p>=0&&_>=0){let y=Math.sqrt(p),b=Math.sqrt(_);return[u-b,u-y,u+y,u+b]}else{if(p>=0&&_<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&_>=0)return m=Math.sqrt(_),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,_=(r+f+s/d)/2,m=il.computeRealRoots(1,d,p),y=il.computeRealRoots(1,-d,_);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function zI(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=sx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,_=p*p,m=e/2,y=p/2,b=_-4*i,x=_+4*Math.abs(i),T=s-4*d,C=s+4*Math.abs(d),A,S;if(d<0||b*C<T*x){let E=Math.sqrt(T);A=E/2,S=E===0?0:(e*y-n)/E}else{let E=Math.sqrt(b);A=E===0?0:(e*y-n)/E,S=E/2}let w,R;m===0&&A===0?(w=0,R=0):D.sign(m)===D.sign(A)?(w=m+A,R=d/w):(R=m-A,w=d/R);let P,O;y===0&&S===0?(P=0,O=0):D.sign(y)===D.sign(S)?(P=y+S,O=i/P):(O=y-S,P=i/O);let L=il.computeRealRoots(1,w,P),g=il.computeRealRoots(1,R,O);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}Oj.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<D.EPSILON15)return sx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return rh(r,s,a,c);case 1:return zI(r,s,a,c);case 2:return zI(r,s,a,c);case 3:return rh(r,s,a,c);case 4:return rh(r,s,a,c);case 5:return zI(r,s,a,c);case 6:return rh(r,s,a,c);case 7:return rh(r,s,a,c);case 8:return zI(r,s,a,c);case 9:return rh(r,s,a,c);case 10:return rh(r,s,a,c);case 11:return zI(r,s,a,c);case 12:return rh(r,s,a,c);case 13:return rh(r,s,a,c);case 14:return rh(r,s,a,c);case 15:return rh(r,s,a,c);default:return}};var VI=Oj;function PV(e,t){t=h.clone(t??h.ZERO),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(e??h.ZERO),this.direction=t}PV.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new PV(e.origin,e.direction)};PV.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var _n=PV;var Yo={};Yo.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var sMe=new h,aMe=new h,Doe=new h,Aoe=new h,Eoe=new h;Yo.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,s=e.direction,a=h.subtract(n,t,sMe),c=h.subtract(i,t,aMe),u=h.cross(s,c,Doe),f=h.dot(a,u),d,p,_,m,y;if(o){if(f<D.EPSILON6||(d=h.subtract(r,t,Aoe),_=h.dot(d,u),_<0||_>f)||(p=h.cross(d,a,Eoe),m=h.dot(s,p),m<0||_+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let b=1/f;if(d=h.subtract(r,t,Aoe),_=h.dot(d,u)*b,_<0||_>1||(p=h.cross(d,a,Eoe),m=h.dot(s,p)*b,m<0||_+m>1))return;y=h.dot(c,p)*b}return y};Yo.rayTriangle=function(e,t,n,i,o,r){let s=Yo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var cMe=new _n;Yo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=cMe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Yo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function lMe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var uMe={root0:0,root1:0};function Roe(e,t,n){l(n)||(n=new Xa);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,Doe),c=h.dot(o,o),u=2*h.dot(o,a),f=h.magnitudeSquared(a)-s,d=lMe(c,u,f,uMe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Yo.raySphere=function(e,t,n){if(n=Roe(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var fMe=new _n;Yo.lineSegmentSphere=function(e,t,n,i){let o=fMe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=Roe(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 dMe=new h,hMe=new h;Yo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,dMe),o=h.multiplyComponents(n,e.direction,hMe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Xa(m,y):{start:y,stop:m}}let _=Math.sqrt(a/c);return new Xa(_,_)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Xa(0,d/c);if(s<0)return c=h.magnitudeSquared(o),new Xa(0,-s/c)};function ax(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Yo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[Z.COLUMN1ROW1]-e[Z.COLUMN2ROW2])*s,c=o*(i*ax(e[Z.COLUMN1ROW0],e[Z.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[Z.COLUMN0ROW0]*r+e[Z.COLUMN2ROW2]*s+i*t.x+n,f=s*ax(e[Z.COLUMN2ROW1],e[Z.COLUMN1ROW2],D.EPSILON15),d=o*(i*ax(e[Z.COLUMN2ROW0],e[Z.COLUMN0ROW2])+t.z),p,_=[];if(d===0&&f===0){if(p=il.computeRealRoots(a,c,u),p.length===0)return _;let P=p[0],O=Math.sqrt(Math.max(1-P*P,0));if(_.push(new h(i,o*P,o*-O)),_.push(new h(i,o*P,o*O)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));_.push(new h(i,o*L,o*-g)),_.push(new h(i,o*L,o*g))}return _}let m=d*d,y=f*f,b=a*a,x=d*f,T=b+y,C=2*(c*a+x),A=2*u*a+c*c-y+m,S=2*(u*c-x),w=u*u-m;if(T===0&&C===0&&A===0&&S===0)return _;p=VI.computeRealRoots(T,C,A,S,w);let R=p.length;if(R===0)return _;for(let P=0;P<R;++P){let O=p[P],L=O*O,g=Math.max(1-L,0),E=Math.sqrt(g),v;D.sign(a)===D.sign(u)?v=ax(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?v=ax(a*L,c*O+u,D.EPSILON12):v=ax(a*L+c*O,u,D.EPSILON12);let I=ax(f*O,d,D.EPSILON15),N=v*I;N<0?_.push(new h(i,o*O,o*E)):N>0?_.push(new h(i,o*O,o*-E)):E!==0?(_.push(new h(i,o*O,o*-E)),_.push(new h(i,o*O,o*E)),++P):_.push(new h(i,o*O,o*E))}return _};var Mj=new h,Soe=new h,voe=new h,DV=new h,mMe=new h,pMe=new Z,_Me=new Z,gMe=new Z,yMe=new Z,bMe=new Z,woe=new Z,Ioe=new Z,Poe=new h,xMe=new h,TMe=new fe;Yo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let w=t.geodeticSurfaceNormal(n,Mj);if(h.dot(i,w)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Mj),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,DV),c=h.normalize(h.cross(a,s,Soe),Soe),u=h.normalize(h.cross(s,c,voe),voe),f=pMe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,_Me),p=Z.fromScale(t.radii,gMe),_=Z.fromScale(t.oneOverRadii,yMe),m=bMe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=Z.multiply(Z.multiply(d,_,woe),m,woe),b=Z.multiply(Z.multiply(y,p,Ioe),f,Ioe),x=Z.multiplyByVector(y,n,mMe),T=Yo.quadraticVectorExpression(b,h.negate(x,Mj),0,0,1),C,A,S=T.length;if(S>0){let w=h.clone(h.ZERO,xMe),R=Number.NEGATIVE_INFINITY;for(let O=0;O<S;++O){C=Z.multiplyByVector(p,Z.multiplyByVector(f,T[O],Poe),Poe);let L=h.normalize(h.subtract(C,n,DV),DV),g=h.dot(L,i);g>R&&(R=g,w=h.clone(C,w))}let P=t.cartesianToCartographic(w,TMe);return R=D.clamp(R,0,1),A=h.magnitude(h.subtract(w,n,DV))*Math.sqrt(1-R*R),A=o?-A:A,P.height=A,t.cartographicToCartesian(P,new h)}};var CMe=new h;Yo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,CMe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<D.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Yo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Yo.lineSegmentPlane(e,t,i,f),Yo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Yo.lineSegmentPlane(t,n,i,f),Yo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Yo.lineSegmentPlane(n,e,i,f),Yo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Yo.lineSegmentPlane(e,n,i,f),Yo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Yo.lineSegmentPlane(n,t,i,f),Yo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Yo.lineSegmentPlane(t,e,i,f),Yo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var ti=Yo;function Js(e,t){this.normal=h.clone(e),this.distance=t}Js.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Js(t,i)};var AMe=new h;Js.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,AMe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Js(n,i)};Js.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var EMe=new h;Js.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Js.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,EMe);return h.subtract(t,o,n)};var SMe=new M,vMe=new ie,wMe=new h;Js.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,SMe),s=ie.fromElements(i.x,i.y,i.z,o,vMe);s=M.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,wMe);return s=ie.divideByScalar(s,h.magnitude(a),s),Js.fromCartesian4(s,n)};Js.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Js(e.normal,e.distance)};Js.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Js.ORIGIN_XY_PLANE=Object.freeze(new Js(h.UNIT_Z,0));Js.ORIGIN_YZ_PLANE=Object.freeze(new Js(h.UNIT_X,0));Js.ORIGIN_ZX_PLANE=Object.freeze(new Js(h.UNIT_Y,0));var en=Js;var Lj={};Lj.calculateACMR=function(e){e=e??G.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)};Lj.tipsify=function(e){e=e??G.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,E,v,I){for(;E.length>=1;){let N=E[E.length-1];if(E.splice(E.length-1,1),g[N].numLiveTriangles>0)return N}for(;o<I;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(g,E,v,I,N,F,U){let k=-1,z,B=-1,j=0;for(;j<v.length;){let W=v[j];I[W].numLiveTriangles&&(z=0,N-I[W].timeStamp+2*I[W].numLiveTriangles<=E&&(z=N-I[W].timeStamp),(z>B||B===-1)&&(B=z,k=W)),++j}return k===-1?r(I,F,g,U):k}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],_;for(_=0;_<c;_++)p[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,b=i+1;o=1;let x=[],T=[],C,A,S=0,w=[],R=a/3,P=[];for(_=0;_<R;_++)P[_]=!1;let O,L;for(;y!==-1;){x=[],A=p[y],L=A.vertexTriangles.length;for(let g=0;g<L;++g)if(m=A.vertexTriangles[g],!P[m]){P[m]=!0,u=m+m+m;for(let E=0;E<3;++E)O=t[u],x.push(O),T.push(O),w[S]=O,++S,C=p[O],--C.numLiveTriangles,b-C.timeStamp>i&&(C.timeStamp=b,++b),++u}y=s(t,i,x,p,b,T,c)}return w};var HI=Lj;var ol={};function BV(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function IMe(e){let t=e.length,n=t/3*6,i=ke.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)BV(i,o,e[r],e[r+1],e[r+2]);return i}function PMe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=ke.createTypedArray(t,n);BV(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)BV(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function DMe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=ke.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)BV(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}ol.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Le.TRIANGLES:e.indices=IMe(t);break;case Le.TRIANGLE_STRIP:e.indices=PMe(t);break;case Le.TRIANGLE_FAN:e.indices=DMe(t);break}e.primitiveType=Le.LINES}return e};ol.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new re(u.center,u.radius+n)),new lt({attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Le.LINES,boundingSphere:c})};ol.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};ol.reorderForPreVertexCache=function(e){let t=lt.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=ke.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let _=d[p],m=_.values,y=0,b=_.componentsPerAttribute,x=K.createTypedArray(_.componentDatatype,u*b);for(;y<t;){let T=i[y];if(T!==-1)for(let C=0;C<b;C++)x[b*T+C]=m[b*y+C];++y}_.values=x}}return e};ol.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Le.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=HI.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Ooe(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new we({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function RMe(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])}}ol.fitToUnsignedShortIndices=function(e){let t=[],n=lt.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Ooe(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Le.TRIANGLES?u=3:e.primitiveType===Le.LINES?u=2:e.primitiveType===Le.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],_=i[p];l(_)||(_=r++,i[p]=_,RMe(s,e.attributes,p)),o.push(_)}r+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Ooe(e.attributes))}o.length!==0&&t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Moe=new h,OMe=new fe;ol.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Mi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,Moe),p=s.cartesianToCartographic(d,OMe),_=o.project(p,Moe);c[u++]=_.x,c[u++]=_.y,c[u++]=_.z}return e.attributes[n]=r,e.attributes[i]=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var Nj={high:0,low:0};ol.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Gn.encode(r[f],Nj),a[f]=Nj.high,c[f]=Nj.low;let u=o.componentsPerAttribute;return e.attributes[n]=new we({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new we({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var ah=new h;function Fj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,ah),M.multiplyByPoint(e,ah,ah),h.pack(ah,n,o)}}function Bj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,ah),Z.multiplyByVector(e,ah,ah),ah=h.normalize(ah,ah),h.pack(ah,n,o)}}var RV=new M,OV=new Z;ol.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;Fj(t,n.position),Fj(t,n.prevPosition),Fj(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,RV),M.transpose(RV,RV),M.getMatrix3(RV,OV),Bj(OV,n.normal),Bj(OV,n.tangent),Bj(OV,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=re.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function MMe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new we({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:K.createTypedArray(s.componentDatatype,a)}))}return i}var LMe=new h;function kj(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=MMe(e,t),d,p,_;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,_=p.length,r=0;r<_;++r)d[s++]=p[r];let m;if(c){let T=0;for(o=0;o<n;++o)T+=e[o][t].indices.length;let C=lt.computeNumberOfVertices(new lt({attributes:f,primitiveType:Le.POINTS})),A=ke.createTypedArray(C,T),S=0,w=0;for(o=0;o<n;++o){let R=e[o][t].indices,P=R.length;for(s=0;s<P;++s)A[S++]=w+R[s];w+=lt.computeNumberOfVertices(e[o][t])}m=A}let y=new h,b=0,x;for(o=0;o<n;++o){if(x=e[o][t].boundingSphere,!l(x)){y=void 0;break}h.add(x.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),o=0;o<n;++o){x=e[o][t].boundingSphere;let T=h.magnitude(h.subtract(x.center,y,LMe))+x.radius;T>b&&(b=T)}return new lt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new re(y,b):void 0})}ol.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(kj(t,"geometry")),n.length>0&&(o.push(kj(n,"westHemisphereGeometry")),o.push(kj(n,"eastHemisphereGeometry"))),o};var jf=new h,GI=new h,aE=new h,cE=new h;ol.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],y=t[u+1],b=t[u+2],x=m*3,T=y*3,C=b*3;GI.x=i[x],GI.y=i[x+1],GI.z=i[x+2],aE.x=i[T],aE.y=i[T+1],aE.z=i[T+2],cE.x=i[C],cE.y=i[C+1],cE.z=i[C+2],s[m].count++,s[y].count++,s[b].count++,h.subtract(aE,GI,aE),h.subtract(cE,GI,cE),a[f]=h.cross(aE,cE,new h),f++}let d=0;for(u=0;u<o;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let _=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,jf),p.count>0){for(f=0;f<p.count;f++)h.add(jf,a[c[p.indexOffset+f]],jf);h.equalsEpsilon(h.ZERO,jf,D.EPSILON10)&&h.clone(a[c[p.indexOffset]],jf)}h.equalsEpsilon(h.ZERO,jf,D.EPSILON10)&&(jf.z=1),h.normalize(jf,jf),_[m]=jf.x,_[m+1]=jf.y,_[m+2]=jf.z}return e.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_}),e};var NMe=new h,Loe=new h,FMe=new h;ol.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],b=n[u+1],x=n[u+2];f=y*3,d=b*3,p=x*3;let T=y*2,C=b*2,A=x*2,S=i[f],w=i[f+1],R=i[f+2],P=r[T],O=r[T+1],L=r[C+1]-O,g=r[A+1]-O,E=1/((r[C]-P)*g-(r[A]-P)*L),v=(g*(i[d]-S)-L*(i[p]-S))*E,I=(g*(i[d+1]-w)-L*(i[p+1]-w))*E,N=(g*(i[d+2]-R)-L*(i[p+2]-R))*E;c[f]+=v,c[f+1]+=I,c[f+2]+=N,c[d]+=v,c[d+1]+=I,c[d+2]+=N,c[p]+=v,c[p+1]+=I,c[p+2]+=N}let _=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(o,f,NMe),b=h.fromArray(c,f,FMe),x=h.dot(y,b);h.multiplyByScalar(y,x,Loe),h.normalize(h.subtract(b,Loe,b),b),_[f]=b.x,_[d]=b.y,_[p]=b.z,h.normalize(h.cross(y,b,b),b),m[f]=b.x,m[d]=b.y,m[p]=b.z}return e.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m}),e};var jI=new V,sh=new h,Noe=new h,Foe=new h,MV=new V;ol.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let R=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(h.fromArray(w,n*3,sh),h.equals(sh,h.ZERO)){P+=2;continue}MV=On.octEncodeInRange(sh,65535,MV),R[P++]=MV.x,R[P++]=MV.y}return e.attributes.compressedAttributes=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:R}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,_,m,y;s&&(p=o.values),a&&(_=r.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:_.length)/(s?3:2);let T=i,C=a&&s?2:1;C+=f||d?1:0,T*=C;let A=new Float32Array(T),S=0;for(n=0;n<i;++n){a&&(V.fromArray(_,n*2,jI),A[S++]=On.compressTextureCoordinates(jI));let w=n*3;s&&l(m)&&l(y)?(h.fromArray(p,w,sh),h.fromArray(m,w,Noe),h.fromArray(y,w,Foe),On.octPack(sh,Noe,Foe,jI),A[S++]=jI.x,A[S++]=jI.y):(s&&(h.fromArray(p,w,sh),A[S++]=On.octEncodeFloat(sh)),f&&(h.fromArray(m,w,sh),A[S++]=On.octEncodeFloat(sh)),d&&(h.fromArray(y,w,sh),A[S++]=On.octEncodeFloat(sh)))}return e.attributes.compressedAttributes=new we({componentDatatype:K.FLOAT,componentsPerAttribute:C,values:A}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function BMe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=ke.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function kMe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.TRIANGLES,e}function UMe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.TRIANGLES,e}function zMe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=ke.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function VMe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.LINES,e}function HMe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.LINES,e}function GMe(e){switch(e.primitiveType){case Le.TRIANGLE_FAN:return kMe(e);case Le.TRIANGLE_STRIP:return UMe(e);case Le.TRIANGLES:return BMe(e);case Le.LINE_STRIP:return VMe(e);case Le.LINE_LOOP:return HMe(e);case Le.LINES:return zMe(e)}return e}function Py(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function jMe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Py(e,e.y<0),Py(t,t.y<0),Py(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=D.sign(e.y):s=D.sign(n.y):o>r?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;Py(e,a),Py(t,a),Py(n,a)}var Boe=new h;function Wf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Boe),e.y/(e.y-t.y),Boe),n),h.clone(n,i),Py(n,!0),Py(i,!1)}var cx=new h,lx=new h,ux=new h,fx=new h,Uj={positions:new Array(7),indices:new Array(3*3)};function WMe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;jMe(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=Uj.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Wf(e,t,cx,ux),Wf(e,n,lx,fx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Wf(t,n,cx,ux),Wf(t,e,lx,fx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Wf(n,e,cx,ux),Wf(n,t,lx,fx),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||(Wf(n,e,cx,ux),Wf(n,t,lx,fx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Wf(t,n,cx,ux),Wf(t,e,lx,fx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Wf(e,t,cx,ux),Wf(e,n,lx,fx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=Uj.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=cx,c[4]=lx,c[5]=ux,c[6]=fx,c.length=7),Uj}function koe(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=K.createTypedArray(r.componentDatatype,r.values)}let i=lt.computeNumberOfVertices(e);return e.indices=ke.createTypedArray(i,e.indices),t&&(e.boundingSphere=re.fromVertices(n.position.values)),e}function uE(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new we({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new lt({attributes:n,indices:[],primitiveType:e.primitiveType})}function Gj(e,t,n){let i=l(e.geometry.boundingSphere);t=koe(t,i),n=koe(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 jj(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let _=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(_,c.x,_),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let b=e.add(_,m,_);e.add(b,y,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var qMe=jj(ie,4),FV=jj(h,3),joe=jj(V,2),YMe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>D.EPSILON6?1:0},WI=new h,zj=new h,Vj=new h,XMe=new h;function LV(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&_===0)return;let b=h.fromArray(o,e*3,WI),x=h.fromArray(o,t*3,zj),T=h.fromArray(o,n*3,Vj),C=rx(i,b,x,T,XMe);if(l(C)){if(l(r)&&FV(e,t,n,C,r,d.normal.values,y,!0),l(u)){let A=h.fromArray(u,e*3,WI),S=h.fromArray(u,t*3,zj),w=h.fromArray(u,n*3,Vj);h.multiplyByScalar(A,C.x,A),h.multiplyByScalar(S,C.y,S),h.multiplyByScalar(w,C.z,w);let R;!h.equals(A,h.ZERO)||!h.equals(S,h.ZERO)||!h.equals(w,h.ZERO)?(R=h.add(A,S,A),h.add(R,w,R),h.normalize(R,R)):(R=WI,R.x=0,R.y=0,R.z=0),h.pack(R,d.extrudeDirection.values,y*3)}if(l(f)&&YMe(e,t,n,C,f,d.applyOffset.values,y),l(s)&&FV(e,t,n,C,s,d.tangent.values,y,!0),l(a)&&FV(e,t,n,C,a,d.bitangent.values,y,!0),l(c)&&joe(e,t,n,C,c,d.st.values,y),_>0)for(let A=0;A<_;A++){let S=p[A];KMe(e,t,n,C,y,m[S],d[S])}}}function KMe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:qMe(e,t,n,i,c,u,o,!1);break;case 3:FV(e,t,n,i,c,u,o,!1);break;case 2:joe(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Fm(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 $Me={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Uoe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let R in n)n.hasOwnProperty(R)&&!$Me[R]&&l(n[R])&&d.push(R);let p=d.length,_=uE(t),m=uE(t),y,b,x,T,C,A=[];A.length=i.length/3;let S=[];for(S.length=i.length/3,C=0;C<A.length;++C)A[C]=-1,S[C]=-1;let w=f.length;for(C=0;C<w;C+=3){let R=f[C],P=f[C+1],O=f[C+2],L=h.fromArray(i,R*3),g=h.fromArray(i,P*3),E=h.fromArray(i,O*3),v=WMe(L,g,E);if(l(v)&&v.positions.length>3){let I=v.positions,N=v.indices,F=N.length;for(let U=0;U<F;++U){let k=N[U],z=I[k];z.y<0?(y=m.attributes,b=m.indices,x=A):(y=_.attributes,b=_.indices,x=S),T=Fm(y,b,x,f,k<3?C+k:-1,z),LV(R,P,O,z,i,o,s,r,a,c,u,y,d,p,n,T)}}else l(v)&&(L=v.positions[0],g=v.positions[1],E=v.positions[2]),L.y<0?(y=m.attributes,b=m.indices,x=A):(y=_.attributes,b=_.indices,x=S),T=Fm(y,b,x,f,C,L),LV(R,P,O,L,i,o,s,r,a,c,u,y,d,p,n,T),T=Fm(y,b,x,f,C+1,g),LV(R,P,O,g,i,o,s,r,a,c,u,y,d,p,n,T),T=Fm(y,b,x,f,C+2,E),LV(R,P,O,E,i,o,s,r,a,c,u,y,d,p,n,T)}Gj(e,m,_)}var Woe=en.fromPointNormal(h.ZERO,h.UNIT_Y),ZMe=new h,QMe=new h;function lE(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,WI);h.equalsEpsilon(a,n,D.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function zoe(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=uE(t),a=uE(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],_=r[c+1],m=h.fromArray(i,p*3,WI),y=h.fromArray(i,_*3,zj),b;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(y.y)<D.EPSILON6&&(y.y<0?y.y=-D.EPSILON6:y.y=D.EPSILON6);let x=s.attributes,T=s.indices,C=d,A=a.attributes,S=a.indices,w=f,R=ti.lineSegmentPlane(m,y,Woe,Vj);if(l(R)){let P=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,ZMe);m.y<0&&(h.negate(P,P),x=a.attributes,T=a.indices,C=f,A=s.attributes,S=s.indices,w=d);let O=h.add(R,P,QMe);b=Fm(x,T,C,r,c,m),lE(p,_,m,i,b,x,o),b=Fm(x,T,C,r,-1,O),lE(p,_,O,i,b,x,o),h.negate(P,P),h.add(R,P,O),b=Fm(A,S,w,r,-1,O),lE(p,_,O,i,b,A,o),b=Fm(A,S,w,r,c+1,y),lE(p,_,y,i,b,A,o)}else{let P,O,L;m.y<0?(P=a.attributes,O=a.indices,L=f):(P=s.attributes,O=s.indices,L=d),b=Fm(P,O,L,r,c,m),lE(p,_,m,i,b,P,o),b=Fm(P,O,L,r,c+1,y),lE(p,_,y,i,b,P,o)}}Gj(e,a,s)}var Voe=new V,JMe=new V,qoe=new h,Yoe=new h,Hj=new h,eLe=new h,tLe=new h,nLe=new h,Hoe=new ie;function Goe(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=h.unpack(n,s,qoe);if(a.x>0)continue;let c=h.unpack(i,s,Yoe);(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]):h.pack(a,i,s));let u=h.unpack(o,s,Hj);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var iLe=5*D.EPSILON9,NV=D.EPSILON6;function oLe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=uE(t),f=uE(t),d,p,_,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let b=d,x=d+2,T=h.fromArray(i,b*3,qoe),C=h.fromArray(i,x*3,Yoe);if(Math.abs(T.y)<NV)for(T.y=NV*(C.y<0?-1:1),i[d*3+1]=T.y,i[(d+1)*3+1]=T.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(C.y)<NV)for(C.y=NV*(T.y<0?-1:1),i[(d+2)*3+1]=C.y,i[(d+3)*3+1]=C.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let A=u.attributes,S=u.indices,w=f.attributes,R=f.indices,P=ti.lineSegmentPlane(T,C,Woe,eLe);if(l(P)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,iLe,tLe);T.y<0&&(h.negate(O,O),A=f.attributes,S=f.indices,w=u.attributes,R=u.indices);let L=h.add(P,O,nLe);A.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.position.values.push(L.x,L.y,L.z),A.position.values.push(L.x,L.y,L.z),A.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),A.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),A.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(P,O,L),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.nextPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),w.nextPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),w.nextPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]);let g=V.fromArray(s,b*2,Voe),E=Math.abs(g.y);A.expandAndWidth.values.push(-1,E,1,E),A.expandAndWidth.values.push(-1,-E,1,-E),w.expandAndWidth.values.push(-1,E,1,E),w.expandAndWidth.values.push(-1,-E,1,-E);let v=h.magnitudeSquared(h.subtract(P,T,Hj));if(v/=h.magnitudeSquared(h.subtract(C,T,Hj)),l(c)){let I=ie.fromArray(c,b*4,Hoe),N=ie.fromArray(c,x*4,Hoe),F=D.lerp(I.x,N.x,v),U=D.lerp(I.y,N.y,v),k=D.lerp(I.z,N.z,v),z=D.lerp(I.w,N.w,v);for(p=b*4;p<b*4+2*4;++p)A.color.values.push(c[p]);for(A.color.values.push(F,U,k,z),A.color.values.push(F,U,k,z),w.color.values.push(F,U,k,z),w.color.values.push(F,U,k,z),p=x*4;p<x*4+2*4;++p)w.color.values.push(c[p])}if(l(a)){let I=V.fromArray(a,b*2,Voe),N=V.fromArray(a,(d+3)*2,JMe),F=D.lerp(I.x,N.x,v);for(p=b*2;p<b*2+2*2;++p)A.st.values.push(a[p]);for(A.st.values.push(F,I.y),A.st.values.push(F,N.y),w.st.values.push(F,I.y),w.st.values.push(F,N.y),p=x*2;p<x*2+2*2;++p)w.st.values.push(a[p])}_=A.position.values.length/3-4,S.push(_,_+2,_+1),S.push(_+1,_+2,_+3),_=w.position.values.length/3-4,R.push(_,_+2,_+1),R.push(_+1,_+2,_+3)}else{let O,L;for(T.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(C.x,C.y,C.z),O.position.values.push(C.x,C.y,C.z),p=d*3;p<d*3+4*3;++p)O.prevPosition.values.push(o[p]),O.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+4*2;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)O.color.values.push(c[p]);_=O.position.values.length/3-4,L.push(_,_+2,_+1),L.push(_+1,_+2,_+3)}}m&&(Goe(f),Goe(u)),Gj(e,f,u)}ol.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||re.intersectPlane(n,en.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING))return e;if(t.geometryType!==Gf.NONE)switch(t.geometryType){case Gf.POLYLINES:oLe(e);break;case Gf.TRIANGLES:Uoe(e);break;case Gf.LINES:zoe(e);break}else GMe(t),t.primitiveType===Le.TRIANGLES?Uoe(e):t.primitiveType===Le.LINES&&zoe(e);return e};var Nn=ol;function qI(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(qI.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});qI.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,_=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,x=4;l(f)&&(x=je.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,x),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){let C;t===0&&n===0&&r===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=je.flipY(f,p,m,d,d)),C=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),C=i),T=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C=je.createTypedArray(p,m,d,d)),a.texImage2D(u,0,_,d,d,0,p,He.toWebGLConstant(m,this._context),C),this._initialized=!0}T||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=je.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,He.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,He.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};qI.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};qI.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 YI=qI;var kV={DONT_CARE:q.DONT_CARE,FASTEST:q.FASTEST,NICEST:q.NICEST,validate:function(e){return e===kV.DONT_CARE||e===kV.FASTEST||e===kV.NICEST}},qf=Object.freeze(kV);var UV={NEAREST:q.NEAREST,LINEAR:q.LINEAR};UV.validate=function(e){return e===UV.NEAREST||e===UV.LINEAR};var Kn=Object.freeze(UV);var Dy={NEAREST:q.NEAREST,LINEAR:q.LINEAR,NEAREST_MIPMAP_NEAREST:q.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:q.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:q.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:q.LINEAR_MIPMAP_LINEAR};Dy.validate=function(e){return e===Dy.NEAREST||e===Dy.LINEAR||e===Dy.NEAREST_MIPMAP_NEAREST||e===Dy.LINEAR_MIPMAP_NEAREST||e===Dy.NEAREST_MIPMAP_LINEAR||e===Dy.LINEAR_MIPMAP_LINEAR};var ft=Object.freeze(Dy);var zV={CLAMP_TO_EDGE:q.CLAMP_TO_EDGE,REPEAT:q.REPEAT,MIRRORED_REPEAT:q.MIRRORED_REPEAT,validate:function(e){return e===zV.CLAMP_TO_EDGE||e===zV.REPEAT||e===zV.MIRRORED_REPEAT}},sn=Object.freeze(zV);function XI(e){e=e??G.EMPTY_OBJECT;let{wrapS:t=sn.CLAMP_TO_EDGE,wrapT:n=sn.CLAMP_TO_EDGE,minificationFilter:i=ft.LINEAR,magnificationFilter:o=Kn.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(XI.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}}});XI.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};XI.NEAREST=Object.freeze(new XI({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST}));var zt=XI;function rLe(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??K.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Koe(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 a_(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)rLe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let _=p.strideInBytes||p.componentsPerAttribute*K.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/_;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Koe(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function Xoe(e){return e.values.length/e.componentsPerAttribute}function sLe(e){return K.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function aLe(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===K.DOUBLE&&(e[n].componentDatatype=K.FLOAT,e[n].values=K.createTypedArray(K.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Xoe(e[o[0]]),t=1;t<s;++t){let u=Xoe(e[o[t]]);if(u!==r)throw new se(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return K.getSizeInBytes(e[f].componentDatatype)-K.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=sLe(i);if(a>0){let u=K.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),_={};for(t=0;t<s;++t){n=o[t];let m=K.getSizeInBytes(e[n].componentDatatype);_[n]={pointer:K.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let y=i.values,b=_[n],x=b.pointer,T=i.componentsPerAttribute;for(let C=0;C<T;++C)x[b.index+C]=y[t*T+C];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}a_.fromGeometry=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=e.geometry??G.EMPTY_OBJECT,i=e.bufferUsage??Ne.DYNAMIC_DRAW,o=e.attributeLocations??G.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(r){let m=aLe(d);if(l(m)){u=st.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===K.DOUBLE&&(m=K.FLOAT),u=void 0,l(c.values)&&(u=st.createVertexBuffer({context:t,typedArray:K.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,_=n.indices;return l(_)&&(lt.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=st.createIndexBuffer({context:t,typedArray:new Uint32Array(_),usage:i,indexDatatype:ke.UNSIGNED_INT}):p=st.createIndexBuffer({context:t,typedArray:new Uint16Array(_),usage:i,indexDatatype:ke.UNSIGNED_SHORT})),new a_({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(a_.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});a_.prototype.getAttribute=function(e){return this._attributes[e]};function cLe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Lt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function lLe(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)}}a_.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&cLe(this),this._hasConstantAttributes&&lLe(this,this._gl)):Koe(this._gl,this._attributes,this._indexBuffer)};a_.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)}};a_.prototype.isDestroyed=function(){return!1};a_.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),ce(this)};var qn=a_;function ir(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e,c=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=je.textureSizeInBytes(i,o,d,d)*6,_=je.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let x=l(n);function T(C){return new YI(t,b,y,C,_,i,o,d,c,r,x)}this._positiveX=T(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=T(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=T(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=T(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=T(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=T(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,$oe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let C of ir.faceNames())Wj(this[C],n?.[C],0);m.bindTexture(y,null)}ir.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Gr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};ir.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*uLe(){yield ir.FaceName.POSITIVEX,yield ir.FaceName.NEGATIVEX,yield ir.FaceName.POSITIVEY,yield ir.FaceName.NEGATIVEY,yield ir.FaceName.POSITIVEZ,yield ir.FaceName.NEGATIVEZ}ir.faceNames=function(){return uLe()};function Wj(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,o,o,0,r,He.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,_=4;l(p)&&(_=je.alignmentInBytes(r,s,o)),d.pixelStorei(d.UNPACK_ALIGNMENT,_),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=je.flipY(p,r,s,o,o)),d.texImage2D(i,n,a,o,o,0,r,He.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,r,He.toWebGLConstant(s,f),t))}ir.loadFace=Wj;Object.defineProperties(ir.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){$oe(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}}});ir.getDirection=function(e,t){switch(e){case ir.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case ir.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case ir.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case ir.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case ir.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case ir.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function $oe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.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)}ir.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 ir.faceNames())Wj(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};ir.prototype.generateMipmap=function(e){e=e??qf.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)};ir.createVertexArray=function(e){let t=Ka.createGeometry(Ka.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return qn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW})};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ce(this._positiveX),this._negativeX=ce(this._negativeX),this._positiveY=ce(this._positiveY),this._negativeY=ce(this._negativeY),this._positiveZ=ce(this._positiveZ),this._negativeZ=ce(this._negativeZ),ce(this)};var or=ir;function fLe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Sc=fLe;var KI=`/** - * 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 $I=`/** - * 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 ZI=`/** - * 0.1 - * - * @name czm_epsilon1 - * @glslConstant - */ -const float czm_epsilon1 = 0.1; -`;var QI=`/** - * 0.01 - * - * @name czm_epsilon2 - * @glslConstant - */ -const float czm_epsilon2 = 0.01; -`;var JI=`/** - * 0.001 - * - * @name czm_epsilon3 - * @glslConstant - */ -const float czm_epsilon3 = 0.001; -`;var eP=`/** - * 0.0001 - * - * @name czm_epsilon4 - * @glslConstant - */ -const float czm_epsilon4 = 0.0001; -`;var tP=`/** - * 0.00001 - * - * @name czm_epsilon5 - * @glslConstant - */ -const float czm_epsilon5 = 0.00001; -`;var nP=`/** - * 0.000001 - * - * @name czm_epsilon6 - * @glslConstant - */ -const float czm_epsilon6 = 0.000001; -`;var iP=`/** - * 0.0000001 - * - * @name czm_epsilon7 - * @glslConstant - */ -const float czm_epsilon7 = 0.0000001; -`;var oP=`/** - * 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 rP=`/** - * 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 sP=`/** - * 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 aP=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} - * - * @name czm_passCesium3DTile - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTile = 4.0; -`;var cP=`/** - * 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 lP=`/** - * 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 uP=`/** - * The automatic GLSL constant for {@link Pass#CLASSIFICATION} - * - * @name czm_passClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passClassification = 7.0; -`;var fP=`/** - * The automatic GLSL constant for {@link Pass#COMPUTE} - * - * @name czm_passCompute - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCompute = 1.0; -`;var dP=`/** - * The automatic GLSL constant for {@link Pass#ENVIRONMENT} - * - * @name czm_passEnvironment - * @glslConstant - * - * @see czm_pass - */ -const float czm_passEnvironment = 0.0; -`;var hP=`/** - * The automatic GLSL constant for {@link Pass#GLOBE} - * - * @name czm_passGlobe - * @glslConstant - * - * @see czm_pass - */ -const float czm_passGlobe = 2.0; -`;var mP=`/** - * The automatic GLSL constant for {@link Pass#OPAQUE} - * - * @name czm_passOpaque - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOpaque = 7.0; -`;var pP=`/** - * The automatic GLSL constant for {@link Pass#OVERLAY} - * - * @name czm_passOverlay - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOverlay = 10.0; -`;var _P=`/** - * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} - * - * @name czm_passTerrainClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTerrainClassification = 3.0; -`;var gP=`/** - * The automatic GLSL constant for {@link Pass#TRANSLUCENT} - * - * @name czm_passTranslucent - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTranslucent = 8.0; -`;var yP=`/** - * The automatic GLSL constant for {@link Pass#VOXELS} - * - * @name czm_passVoxels - * @glslConstant - * - * @see czm_pass - */ -const float czm_passVoxels = 9.0; -`;var bP=`/** - * 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 xP=`/** - * 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 TP=`/** - * 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 CP=`/** - * 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 AP=`/** - * 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 EP=`/** - * 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 SP=`/** - * 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 vP=`/** - * 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 wP=`/** - * 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 IP=`/** - * 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 PP=`/** - * 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 DP=`/** - * 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 RP=`/** - * 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 OP=`/** - * 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 MP=`/** - * @name czm_depthRangeStruct - * @glslStruct - */ -struct czm_depthRangeStruct -{ - float near; - float far; -}; -`;var LP=`/** - * 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 NP=`/** - * 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 FP=`/** - * 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 BP=`/** - * 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 kP=`/** - * DOC_TBA - * - * @name czm_ray - * @glslStruct - */ -struct czm_ray -{ - vec3 origin; - vec3 direction; -}; -`;var UP=`/** - * 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 zP=`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 VP=`// 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 HP=`/** - * @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 GP=`/** - * 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 jP=`/** - * 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 WP=`/** - * 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 qP=`/** - * 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 YP=`/** - * 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 XP=`/** - * 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 KP=` -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 $P=` -uniform vec4 shadowMap_cascadeDistances; - -float czm_cascadeDistance(vec4 weights) -{ - return dot(shadowMap_cascadeDistances, weights); -} -`;var ZP=` -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 QP=` -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 JP=`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 eD=`/** - * 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 tD=`/** - * 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 nD=`/** - * 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 iD=`/** - * 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 oD=`/** - * 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 rD=`/** - * @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 sD=`/** - * 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 aD=`// 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 cD=`/** - * 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 lD=`/** - * 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 uD=`/** - * 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 fD=`/** - * 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 dD=`/** - * 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 hD=`/** - * 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 mD=`/** - * 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 pD=`/** - * 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 _D=`/** - * 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 gD=`/** - * 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 yD=`/** - * 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 bD=`/** - * 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 xD=`/** - * 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 TD=`/** - * 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 CD=`/** - * @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 AD=`/** - * 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 ED=`/** - * 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 SD=`/** - * 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 vD=`/** - * 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 wD=`/** - * 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 ID=`/** - * 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 PD=`/** - * 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 DD=`/** - * 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 RD=`/** - * 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 OD=`/** - * 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 MD=`/** - * 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 LD=`/** - * 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 ND=`/** - * 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 FD=`/** - * 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 BD=`/** - * 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 kD=` /** - * 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 UD=`/** - * 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 zD=`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 VD=`// 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 HD=`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 GD=`/** - * 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 jD=`/** - * 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 WD=`/** - * 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 qD=`/** - * 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 YD=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) -{ - return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var XD=`/** - * 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 KD=`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 $D=`/** - * 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 ZD=`/** - * 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 QD=`/** - * 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 JD=`/** - * 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 e1=`/** - * 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 t1=` -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 n1=` -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 i1=`/** - * 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 o1=`/** - * 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 r1=`/** - * 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 s1=`/** - * 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 a1=`/** - * 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 c1=`/** - * 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 l1=`/** - * 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 u1=`/** - * @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 f1=`/** - * 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 d1=`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 h1=`/** - * 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 m1=`/** - * 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 p1=`/** - * 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 _1=`/** - * 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 g1=`#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 y1=`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 b1=`// 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 x1=`#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 T1=`/** - * 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 C1=`/** - * 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 dx={czm_degreesPerRadian:KI,czm_depthRange:$I,czm_epsilon1:ZI,czm_epsilon2:QI,czm_epsilon3:JI,czm_epsilon4:eP,czm_epsilon5:tP,czm_epsilon6:nP,czm_epsilon7:iP,czm_infinity:oP,czm_oneOverPi:rP,czm_oneOverTwoPi:sP,czm_passCesium3DTile:aP,czm_passCesium3DTileClassification:cP,czm_passCesium3DTileClassificationIgnoreShow:lP,czm_passClassification:uP,czm_passCompute:fP,czm_passEnvironment:dP,czm_passGlobe:hP,czm_passOpaque:mP,czm_passOverlay:pP,czm_passTerrainClassification:_P,czm_passTranslucent:gP,czm_passVoxels:yP,czm_pi:bP,czm_piOverFour:xP,czm_piOverSix:TP,czm_piOverThree:CP,czm_piOverTwo:AP,czm_radiansPerDegree:EP,czm_sceneMode2D:SP,czm_sceneMode3D:vP,czm_sceneModeColumbusView:wP,czm_sceneModeMorphing:IP,czm_solarRadius:PP,czm_threePiOver2:DP,czm_twoPi:RP,czm_webMercatorMaxLatitude:OP,czm_depthRangeStruct:MP,czm_material:LP,czm_materialInput:NP,czm_modelMaterial:FP,czm_modelVertexOutput:BP,czm_ray:kP,czm_raySegment:UP,czm_shadowParameters:zP,czm_acesTonemapping:VP,czm_alphaWeight:HP,czm_antialias:GP,czm_applyHSBShift:jP,czm_approximateSphericalCoordinates:WP,czm_approximateTanh:qP,czm_backFacing:YP,czm_branchFreeTernary:XP,czm_cascadeColor:KP,czm_cascadeDistance:$P,czm_cascadeMatrix:ZP,czm_cascadeWeights:QP,czm_clipPolygons:JP,czm_columbusViewMorph:eD,czm_computeAtmosphereColor:tD,czm_computeGroundAtmosphereScattering:nD,czm_computePosition:iD,czm_computeScattering:oD,czm_cosineAndSine:rD,czm_decompressTextureCoordinates:sD,czm_depthClamp:aD,czm_eastNorthUpToEyeCoordinates:cD,czm_ellipsoidContainsPoint:lD,czm_ellipsoidTextureCoordinates:uD,czm_equalsEpsilon:fD,czm_eyeOffset:dD,czm_eyeToWindowCoordinates:hD,czm_fastApproximateAtan:mD,czm_fog:pD,czm_gammaCorrect:_D,czm_geodeticSurfaceNormal:gD,czm_getDefaultMaterial:yD,czm_getDynamicAtmosphereLightDirection:bD,czm_getLambertDiffuse:xD,czm_getSpecular:TD,czm_getWaterNoise:CD,czm_HSBToRGB:AD,czm_HSLToRGB:ED,czm_hue:SD,czm_inverseGamma:vD,czm_isEmpty:wD,czm_isFull:ID,czm_latitudeToWebMercatorFraction:PD,czm_linearToSrgb:DD,czm_lineDistance:RD,czm_luminance:OD,czm_maximumComponent:MD,czm_metersPerPixel:LD,czm_modelToWindowCoordinates:ND,czm_multiplyWithColorBalance:FD,czm_nearFarScalar:BD,czm_octDecode:kD,czm_packDepth:UD,czm_pbrLighting:zD,czm_pbrNeutralTonemapping:VD,czm_phong:HD,czm_planeDistance:GD,czm_pointAlongRay:jD,czm_rayEllipsoidIntersectionInterval:WD,czm_raySphereIntersectionInterval:qD,czm_readDepth:YD,czm_readNonPerspective:XD,czm_reverseLogDepth:KD,czm_RGBToHSB:$D,czm_RGBToHSL:ZD,czm_RGBToXYZ:QD,czm_round:JD,czm_saturation:e1,czm_shadowDepthCompare:t1,czm_shadowVisibility:n1,czm_signNotZero:i1,czm_sphericalHarmonics:o1,czm_srgbToLinear:r1,czm_tangentToEyeSpaceMatrix:s1,czm_textureCube:a1,czm_transformPlane:c1,czm_translateRelativeToEye:l1,czm_translucentPhong:u1,czm_transpose:f1,czm_unpackClippingExtents:d1,czm_unpackDepth:h1,czm_unpackFloat:m1,czm_unpackUint:p1,czm_valueTransform:_1,czm_vertexLogDepth:g1,czm_windowToEyeCoordinates:y1,czm_writeDepthClamp:b1,czm_writeLogDepth:x1,czm_writeNonPerspective:T1,czm_XYZToRGB:C1};function dLe(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 A1=dLe;function Zoe(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 Qoe(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=Zoe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Joe(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&&ea._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=Qoe(i,ea._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),Joe(o,t)}}))}function hLe(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 mLe(e){let t=[],n=Qoe("main",e,t);Joe(n,t),hLe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function ere(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=Zoe(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){return a=b,` -`});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 u=e.pickColorQualifier;l(u)&&(r=ea.createPickFragmentShaderSource(r,u));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp int; -#else - precision mediump float; - precision mediump int; - #define highp mediump -#endif - -`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(f+=`#define ${y} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear - -`),n.floatingPointTexture&&(f+=`#define OES_texture_float - -`);let _="";e.includeBuiltIns&&(_=mLe(r)),f+=` -#line 0 -`;let m=_+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; - -`),f+=_,f+=r,n.webgl2?f=`#version 300 es -${f}`:f=A1(f,t),f}function ea(e){e=e??G.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}ea.prototype.clone=function(){return new ea({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};ea.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};ea.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}`};ea.prototype.createCombinedVertexShader=function(e){return ere(this,!1,e)};ea.prototype.createCombinedFragmentShader=function(e){return ere(this,!0,e)};ea._czmBuiltinsAndUniforms={};for(let e in dx)dx.hasOwnProperty(e)&&(ea._czmBuiltinsAndUniforms[e]=dx[e]);for(let e in $p)if($p.hasOwnProperty(e)){let t=$p[e];typeof t.getDeclaration=="function"&&(ea._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}ea.createPickVertexShaderSource=function(e){return`${ea.replaceMain(e,"czm_old_main")} -in vec4 pickColor; -out vec4 czm_pickColor; -void main() -{ - czm_old_main(); - czm_pickColor = pickColor; -}`};ea.createPickFragmentShaderSource=function(e,t){let n=ea.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 pLe(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 tre(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 nre(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(tre(e,o))return o}}var _Le=["v_normalEC","v_normal"];ea.findNormalVarying=function(e){return tre(e,"#ifdef HAS_NORMALS")?pLe(e,"HAS_NORMALS")?"v_normalEC":void 0:nre(e,_Le)};var gLe=["v_positionEC"];ea.findPositionVarying=function(e){return nre(e,gLe)};var Be=ea;function ch(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(ch.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});ch.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function yLe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}ch.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Be({sources:[t]})),typeof n=="string"&&(n=new Be({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?yLe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Xt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,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};ch.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){qj(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};ch.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};ch.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Be({sources:[r]})),typeof s=="string"&&(s=new Be({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Xt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function qj(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];qj(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}ch.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];qj(this,n),--this._numberOfShaders}this._shadersToRelease={}};ch.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ce(this)};var E1=ch;function lh(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,d=je.toInternalFormat(i,o,t),p=je.isCompressedFormat(d),_=t._gl,m=p?je.compressedTextureSizeInBytes(i,c,u):je.textureSizeInBytes(i,o,c,u);this._id=e.id??Ln(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_.TEXTURE_2D,this._texture=_.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new V(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,sre(this,a),_.activeTexture(_.TEXTURE0),_.bindTexture(this._textureTarget,this._texture),l(n)?(s?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?je.isCompressedFormat(d)?bLe(this,n):ire(this,n):l(n.framebuffer)?TLe(this,n):ore(this,n),this._initialized=!0):rre(this),_.bindTexture(this._textureTarget,null)}function bLe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=VV(c),u=VV(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function ire(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=je.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=je.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,He.toWebGLConstant(u,n),p),l(t.mipLevels)){let _=s,m=a;for(let y=0;y<t.mipLevels.length;++y)_=VV(_),m=VV(m),i.texImage2D(o,y+1,r,_,m,0,c,He.toWebGLConstant(u,n),t.mipLevels[y])}}function xLe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=je.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=je.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,He.toWebGLConstant(u,s),t)}function TLe(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 ore(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,He.toWebGLConstant(e.pixelDatatype,n),t)}function CLe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,He.toWebGLConstant(e.pixelDatatype,o),t)}function VV(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function rre(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}lh.create=function(e){return new lh(e)};lh.fromFramebuffer=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,{pixelFormat:i=je.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new lh({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(lh.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){sre(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 sre(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.NEAREST),r.webgl2&&je.isDepthFormat(s)&&(n=ft.NEAREST,i=Kn.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}lh.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?ire(this,i):ore(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),rre(this)),this._initialized=!0),f||(l(i.arrayBufferView)?xLe(this,i.arrayBufferView,t,n,c,u):CLe(this,i,t,n)),s.bindTexture(a,null)};lh.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};lh.prototype.generateMipmap=function(e){e=e??qf.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)};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ce(this)};var dt=lh;function hx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(hx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});hx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};hx.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};hx.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={}};hx.prototype.isDestroyed=function(){return!1};hx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ce(this)};var S1=hx;function Yf(e){this.planes=e??[]}var v1=[new h,new h,new h];h.clone(h.UNIT_X,v1[0]);h.clone(h.UNIT_Y,v1[1]);h.clone(h.UNIT_Z,v1[2]);var Ry=new h,ALe=new h,are=new en(new h(1,0,0),0);Yf.fromBoundingSphere=function(e,t){l(t)||(t=new Yf);let n=v1.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=v1[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new ie),l(f)||(f=i[s+1]=new ie),h.multiplyByScalar(c,-r,Ry),h.add(o,Ry,Ry),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Ry),h.multiplyByScalar(c,r,Ry),h.add(o,Ry,Ry),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,ALe),Ry),s+=2}return t};Yf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(en.fromCartesian4(t[i],are));if(r===Ht.OUTSIDE)return Ht.OUTSIDE;r===Ht.INTERSECTING&&(n=!0)}return n?Ht.INTERSECTING:Ht.INSIDE};Yf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Yf.MASK_OUTSIDE||t===Yf.MASK_INSIDE)return t;let n=Yf.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(en.fromCartesian4(i[o],are));if(a===Ht.OUTSIDE)return Yf.MASK_OUTSIDE;a===Ht.INTERSECTING&&(n|=s)}return n};Yf.MASK_OUTSIDE=4294967295;Yf.MASK_INSIDE=0;Yf.MASK_INDETERMINATE=2147483647;var Es=Yf;function Bm(e){e=e??G.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 Es,this._orthographicMatrix=new M}function cre(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Bm.prototype,{projectionMatrix:{get:function(){return cre(this),this._orthographicMatrix}}});var ELe=new h,SLe=new h,vLe=new h,Yj=new h;Bm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,ELe);h.normalize(f,f);let d=SLe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=vLe;h.multiplyByScalar(f,a,p),h.add(d,p,p);let _=i[0];return l(_)||(_=i[0]=new ie),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),_=i[1],l(_)||(_=i[1]=new ie),_.x=-f.x,_.y=-f.y,_.z=-f.z,_.w=-h.dot(h.negate(f,Yj),p),h.multiplyByScalar(n,r,p),h.add(d,p,p),_=i[2],l(_)||(_=i[2]=new ie),_.x=n.x,_.y=n.y,_.z=n.z,_.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(d,p,p),_=i[3],l(_)||(_=i[3]=new ie),_.x=-n.x,_.y=-n.y,_.z=-n.z,_.w=-h.dot(h.negate(n,Yj),p),_=i[4],l(_)||(_=i[4]=new ie),_.x=t.x,_.y=t.y,_.z=t.z,_.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),_=i[5],l(_)||(_=i[5]=new ie),_.x=-t.x,_.y=-t.y,_.z=-t.z,_.w=-h.dot(h.negate(t,Yj),p),this._cullingVolume};Bm.prototype.getPixelDimensions=function(e,t,n,i,o){cre(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};Bm.prototype.clone=function(e){return l(e)||(e=new Bm),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};Bm.prototype.equals=function(e){return l(e)&&e instanceof Bm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Bm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Bm&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var jr=Bm;function $l(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new jr,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}$l.packedLength=4;$l.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};$l.unpack=function(e,t,n){return t=t??0,l(n)||(n=new $l),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Oy(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($l.prototype,{projectionMatrix:{get:function(){return Oy(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Oy(this),this._offCenterFrustum}}});$l.prototype.computeCullingVolume=function(e,t,n){return Oy(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};$l.prototype.getPixelDimensions=function(e,t,n,i,o){return Oy(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};$l.prototype.clone=function(e){return l(e)||(e=new $l),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};$l.prototype.equals=function(e){return!l(e)||!(e instanceof $l)?!1:(Oy(this),Oy(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};$l.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof $l)?!1:(Oy(this),Oy(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var cn=$l;var Xj={};function wLe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var ILe=32.184,PLe=2451545;function wre(e,t){t=$.addSeconds(e,ILe,t);let n=$.totalDays(t)-PLe;return t=$.addSeconds(t,wLe(n),t),t}var HV=new $(2451545,0,Wn.TAI),DLe=1e3,Xf=D.RADIANS_PER_DEGREE,Nu=D.RADIANS_PER_ARCSECOND,$a=14959787e4,lre=new Z;function Ire(e,t,n,i,o,r,s){n<0&&(n=-n,o+=D.PI);let a=e*(1-t),c=i-o,u=o,f=OLe(r-i,t),d=RLe(t,0);BLe(c,n,u,lre);let p=a*(1+t),_=Math.cos(f),m=Math.sin(f),y=1+t*_,b=p/y;return l(s)?(s.x=b*_,s.y=b*m,s.z=0):s=new h(b*_,b*m,0),Z.multiplyByVector(lre,s,s)}function RLe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function OLe(e,t){let n=NLe(e,t);return FLe(n,t)}var MLe=50,LLe=D.EPSILON8;function NLe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<MLe&&Math.abs(o-i)>LLe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*D.TWO_PI,o}function FLe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=D.zeroToTwoPi(r),e<0&&(r-=D.TWO_PI),r+=n*D.TWO_PI,r}function BLe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var kLe=1.0000010178*$a,ULe=100.46645683*Xf,zLe=129597742283429e-5*Nu,ure=16002,fre=21863,dre=32004,hre=10931,mre=14529,pre=16368,_re=15318,gre=32794,VLe=64*1e-7*$a,HLe=-152*1e-7*$a,GLe=62*1e-7*$a,jLe=-8*1e-7*$a,WLe=32*1e-7*$a,qLe=-41*1e-7*$a,YLe=19*1e-7*$a,XLe=-11*1e-7*$a,KLe=-150*1e-7*$a,$Le=-46*1e-7*$a,ZLe=68*1e-7*$a,QLe=54*1e-7*$a,JLe=14*1e-7*$a,eNe=24*1e-7*$a,tNe=-28*1e-7*$a,nNe=22*1e-7*$a,yre=10,bre=16002,xre=21863,Tre=10931,Cre=1473,Are=32004,Ere=4387,Sre=73,iNe=-325*1e-7,oNe=-322*1e-7,rNe=-79*1e-7,sNe=232*1e-7,aNe=-52*1e-7,cNe=97*1e-7,lNe=55*1e-7,uNe=-41*1e-7,fNe=-105*1e-7,dNe=-137*1e-7,hNe=258*1e-7,mNe=35*1e-7,pNe=-116*1e-7,_Ne=-88*1e-7,gNe=-112*1e-7,yNe=-80*1e-7,fE=new $(0,0,Wn.TAI);function bNe(e,t){wre(e,fE);let i=(fE.dayNumber-HV.dayNumber+(fE.secondsOfDay-HV.secondsOfDay)/Yn.SECONDS_PER_DAY)/(Yn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=kLe+VLe*Math.cos(ure*o)+KLe*Math.sin(ure*o)+HLe*Math.cos(fre*o)+$Le*Math.sin(fre*o)+GLe*Math.cos(dre*o)+ZLe*Math.sin(dre*o)+jLe*Math.cos(hre*o)+QLe*Math.sin(hre*o)+WLe*Math.cos(mre*o)+JLe*Math.sin(mre*o)+qLe*Math.cos(pre*o)+eNe*Math.sin(pre*o)+YLe*Math.cos(_re*o)+tNe*Math.sin(_re*o)+XLe*Math.cos(gre*o)+nNe*Math.sin(gre*o),s=ULe+zLe*i+iNe*Math.cos(yre*o)+fNe*Math.sin(yre*o)+oNe*Math.cos(bre*o)+dNe*Math.sin(bre*o)+rNe*Math.cos(xre*o)+hNe*Math.sin(xre*o)+sNe*Math.cos(Tre*o)+mNe*Math.sin(Tre*o)+aNe*Math.cos(Cre*o)+pNe*Math.sin(Cre*o)+cNe*Math.cos(Are*o)+_Ne*Math.sin(Are*o)+lNe*Math.cos(Ere*o)+gNe*Math.sin(Ere*o)+uNe*Math.cos(Sre*o)+yNe*Math.sin(Sre*o),a=.0167086342-.0004203654*i,c=102.93734808*Xf+11612.3529*Nu*i,u=469.97289*Nu*i,f=174.87317577*Xf-8679.27034*Nu*i;return Ire(r,a,u,c,f,s,t)}function Pre(e,t){wre(e,fE);let i=(fE.dayNumber-HV.dayNumber+(fE.secondsOfDay-HV.secondsOfDay)/Yn.SECONDS_PER_DAY)/Yn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Xf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Xf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,_=125.04455501*Xf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Xf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,x=297.85019547*Xf+Nu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*Xf+Nu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),C=134.96340251*Xf+Nu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),A=357.52910918*Xf+Nu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),S=310.17137918*Xf-Nu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),w=2*x,R=4*x,P=6*x,O=2*C,L=3*C,g=4*C,E=2*T;a+=3400.4*Math.cos(w)-635.6*Math.cos(w-C)-235.6*Math.cos(C)+218.1*Math.cos(w-A)+181*Math.cos(w+C),c+=.014216*Math.cos(w-C)+.008551*Math.cos(w-O)-.001383*Math.cos(C)+.001356*Math.cos(w+C)-.001147*Math.cos(R-L)-914e-6*Math.cos(R-O)+869e-6*Math.cos(w-A-C)-627e-6*Math.cos(w)-394e-6*Math.cos(R-g)+282e-6*Math.cos(w-A-O)-279e-6*Math.cos(x-C)-236e-6*Math.cos(O)+231e-6*Math.cos(R)+229e-6*Math.cos(P-g)-201e-6*Math.cos(O-E),f+=486.26*Math.cos(w-E)-40.13*Math.cos(w)+37.51*Math.cos(E)+25.73*Math.cos(O-E)+19.97*Math.cos(w-A-E),p+=-55609*Math.sin(w-C)-34711*Math.sin(w-O)-9792*Math.sin(C)+9385*Math.sin(R-L)+7505*Math.sin(R-O)+5318*Math.sin(w+C)+3484*Math.sin(R-g)-3417*Math.sin(w-A-C)-2530*Math.sin(P-g)-2376*Math.sin(w)-2075*Math.sin(w-L)-1883*Math.sin(O)-1736*Math.sin(P-5*C)+1626*Math.sin(A)-1370*Math.sin(P-L),m+=-5392*Math.sin(w-E)-540*Math.sin(A)-441*Math.sin(w)+423*Math.sin(E)-288*Math.sin(O-E),b+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-C)-662.5*Math.sin(A)+396.3*Math.sin(C)-218*Math.sin(w-A);let v=2*S,I=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(w-E+S)*i+.614*Math.cos(w-E-S)*i-.0297*Math.cos(v)*o-.0335*Math.cos(S)*o+.0012*Math.cos(w-E+v)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(v)*r;let N=2.116*Math.sin(S)*i-.111*Math.sin(w-E-S)*i-.0015*Math.sin(S)*o;p+=N,b+=N,m+=-520.77*Math.sin(S)*i+13.66*Math.sin(w-E+S)*i+1.12*Math.sin(w-S)*i-1.06*Math.sin(E-S)*i+.66*Math.sin(v)*o+.371*Math.sin(S)*o-.035*Math.sin(w-E+v)*o-.015*Math.sin(w-E+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(v)*r,a*=DLe;let F=u+f*Nu,U=d+p*Nu,k=y+b*Nu,z=_+m*Nu;return Ire(a,c,F,U,z,k,t)}var vre=.012300034,xNe=vre/(vre+1)*-1;function TNe(e,t){return t=Pre(e,t),h.multiplyByScalar(t,xNe,t)}var Dre=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),w1=new h;Xj.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=$.now()),l(t)||(t=new h),w1=bNe(e,w1),t=h.negate(w1,t),TNe(e,w1),h.subtract(t,w1,t),Z.multiplyByVector(Dre,t,t),t};Xj.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=$.now()),t=Pre(e,t),Z.multiplyByVector(Dre,t,t),t};var My=Xj;var GV={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};GV.getMorphTime=function(e){return e===GV.SCENE3D?1:e===GV.MORPHING?void 0:0};var ne=Object.freeze(GV);function CNe(e){e=e??G.EMPTY_OBJECT,this.color=H.clone(e.color??H.WHITE),this.intensity=e.intensity??2}var c_=CNe;function dE(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Xe,this._viewportCartesian4=new ie,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new V,this._currentFrustum=new V,this._frustumPlanes=new ie,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Gn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new V,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new V,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new H,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(dE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Xe.equals(e,this._viewport)){Xe.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Ore(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ore(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return $j(this),this._view3D}},viewRotation:{get:function(){return $j(this),this._viewRotation}},viewRotation3D:{get:function(){return $j(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Nre(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Nre(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return MNe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return LNe(this),this._modelView}},modelView3D:{get:function(){return NNe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return VNe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return FNe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return BNe(this),this._inverseModelView3D}},viewProjection:{get:function(){return kNe(this),this._viewProjection}},inverseViewProjection:{get:function(){return UNe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return zNe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return HNe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return GNe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return jNe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return WNe(this),this._normal}},normal3D:{get:function(){return qNe(this),this._normal3D}},inverseNormal:{get:function(){return YNe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return XNe(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 Lre(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Lre(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??te.default}}});function ANe(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function ENe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function SNe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function vNe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Rre=new h,wNe=new M;function INe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.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=h.fromRadians(o.longitude,o.latitude,0,n,Rre)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Rre)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=Z.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=At.eastNorthUpToFixedFrame(i,n,wNe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Kj=new Z,PNe=new fe;function DNe(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,Kj);let n=My.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(Kj,n,n),h.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=My.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(Kj,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,PNe);i.project(r,e._sunPositionColumbusView)}dE.prototype.updateCamera=function(e){ANe(this,e.viewMatrix),ENe(this,e.inverseViewMatrix),INe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof cn};dE.prototype.updateFrustum=function(e){SNe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&vNe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};dE.prototype.updatePass=function(e){this._pass=e};var RNe=[],ONe=new c_;dE.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===ne.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),DNe(this,e);let n=e.light??ONe;n instanceof c_?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.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??RNe,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=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,H.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ore(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function MNe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function LNe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function NNe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function FNe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function BNe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function kNe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function UNe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function zNe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function VNe(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 HNe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function GNe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function jNe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function WNe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),Z.transpose(t,t)}}function qNe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),Z.transpose(t,t)}}function YNe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),Z.transpose(t,t)}}function XNe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),Z.transpose(t,t)}}var Mre=new h;function Lre(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Mre),Gn.fromCartesian(Mre,e._encodedCameraPositionMC))}var KNe=new h,$Ne=new h,ZNe=new h,QNe=new h,JNe=new fe,eFe=new h,tFe=new M;function nFe(e,t,n,i,o,r,s,a){let c=KNe;c.x=e.y,c.y=e.z,c.z=e.x;let u=$Ne;u.x=n.y,u.y=n.z,u.z=n.x;let f=ZNe;f.x=i.y,f.y=i.z,f.z=i.x;let d=QNe;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,JNe);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let _=s.ellipsoid,m=_.cartographicToCartesian(p,eFe),y=At.eastNorthUpToFixedFrame(m,_,tFe);return M.multiplyByPointAsVector(y,u,u),M.multiplyByPointAsVector(y,f,f),M.multiplyByPointAsVector(y,d,d),l(a)||(a=new M),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function $j(e){e._view3DDirty&&(e._mode===ne.SCENE3D?M.clone(e._view,e._view3D):nFe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Nre(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var I1=dE;function Kf(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):iFe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Ln(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new E1(this),this._textureCache=new S1;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Lt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Lt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Lt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Lt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Lt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Lt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Lt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Lt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Lt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Lt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Lt._minimumAliasedLineWidth=f[0],Lt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Lt._minimumAliasedPointSize=d[0],Lt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Lt._maximumViewportWidth=p[0],Lt._maximumViewportHeight=p[1];let _=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Lt._highpFloatSupported=_.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Lt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Rr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Rr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Rr(u,["OES_element_index_uint"]),this._depthTexture=!!Rr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Rr(u,["EXT_frag_depth"]),this._debugShaders=Rr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Rr(u,["OES_texture_float"]),this._textureHalfFloat=!!Rr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Rr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Rr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Rr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Rr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Rr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Rr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Rr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Rr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Rr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Rr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Rr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Rr(u,["EXT_texture_compression_bptc"]),Qs.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?Rr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,Lt._maximumTextureFilterAnisotropy=l(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,C,A,S,w,R,P,O;if(c){let v=this;b=function(){return v._gl.createVertexArray()},x=function(I){v._gl.bindVertexArray(I)},T=function(I){v._gl.deleteVertexArray(I)},C=function(I,N,F,U,k){u.drawElementsInstanced(I,N,F,U,k)},A=function(I,N,F,U){u.drawArraysInstanced(I,N,F,U)},S=function(I,N){u.vertexAttribDivisor(I,N)},w=function(I){u.drawBuffers(I)}}else R=Rr(u,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(v){R.bindVertexArrayOES(v)},T=function(v){R.deleteVertexArrayOES(v)}),P=Rr(u,["ANGLE_instanced_arrays"]),l(P)&&(C=function(v,I,N,F,U){P.drawElementsInstancedANGLE(v,I,N,F,U)},A=function(v,I,N,F){P.drawArraysInstancedANGLE(v,I,N,F)},S=function(v,I){P.vertexAttribDivisorANGLE(v,I)}),O=Rr(u,["WEBGL_draw_buffers"]),l(O)&&(w=function(v){O.drawBuffersWEBGL(v)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=A,this.glVertexAttribDivisor=S,this.glDrawBuffers=w,this._vertexArrayObject=!!R,this._instancedArrays=!!P,this._drawBuffers=!!O,Lt._maximumDrawBuffers=this.drawBuffers?u.getParameter(q.MAX_DRAW_BUFFERS):1,Lt._maximumColorAttachments=this.drawBuffers?u.getParameter(q.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new H(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new I1,g=new Sc(this),E=ze.fromCache();this._defaultPassState=g,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=E,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<Lt._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ze.apply(u,E,g)}function iFe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new se("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 se("The browser supports WebGL, but initialization failed.");return r}function oFe(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 rFe(e,t,n,i){let o=`${oFe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function sFe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new se(rFe(e,t,n,i))}function aFe(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 cFe(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,aFe(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 lFe={};Object.defineProperties(Kf.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=cFe(this._originalGLContext,e?sFe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new dt({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 dt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new dt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new or({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 lFe}}});function Fre(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var Zj;typeof WebGLRenderingContext<"u"&&(Zj=[q.BACK]);function Qj(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Zj;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var uFe=new oi;Kf.prototype.clear=function(e,t){e=e??uFe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(H.equals(this._clearColor,o)||(H.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;Fre(this,a,t,!0);let c=e.framebuffer??t.framebuffer;Qj(this,c),n.clear(i)};function fFe(e,t,n,i,o){Qj(e,t),Fre(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function dFe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Kf.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,fFe(this,o,t,n,r),dFe(this,e,n,i)};Kf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Zj;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)};Kf.prototype.readPixels=function(e){let t=this._gl;e=e??G.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=He.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=je.createTypedArray(je.RGBA,a,o,r);return Qj(this,s),t.readPixels(n,i,o,r,je.RGBA,He.toWebGLConstant(a,this),c),c};var Bre={position:0,textureCoordinates:1};Kf.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new lt({attributes:{position:new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Le.TRIANGLES});e=qn.fromGeometry({context:this,geometry:t,attributeLocations:Bre,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Kf.prototype.createViewportQuadCommand=function(e,t){return t=t??G.EMPTY_OBJECT,new qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Le.TRIANGLES,renderState:t.renderState,shaderProgram:Xt.fromCache({context:this,vertexShaderSource:ix,fragmentShaderSource:e,attributeLocations:Bre}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Kf.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function Jj(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(Jj.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});Jj.prototype.destroy=function(){delete this._pickObjects[this.key]};Kf.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new se("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Jj(this._pickObjects,t,H.fromRgba(t))};Kf.prototype.isDestroyed=function(){return!1};Kf.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(),ce(this)};var P1=Kf;function hE(e){e=e??G.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 he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Gr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Gr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}hE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};hE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};hE.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)};hE.prototype.isDestroyed=function(){return!1};hE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ce(this)};var D1=hE;var Zl={RGBA4:q.RGBA4,RGBA8:q.RGBA8,RGBA16F:q.RGBA16F,RGBA32F:q.RGBA32F,RGB5_A1:q.RGB5_A1,RGB565:q.RGB565,DEPTH_COMPONENT16:q.DEPTH_COMPONENT16,STENCIL_INDEX8:q.STENCIL_INDEX8,DEPTH_STENCIL:q.DEPTH_STENCIL,DEPTH24_STENCIL8:q.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===q.FLOAT?Zl.RGBA32F:e===q.HALF_FLOAT_OES?Zl.RGBA16F:Zl.RGBA8}},rl=Object.freeze(Zl);function R1(e){e=e??G.EMPTY_OBJECT;let n=e.context._gl,i=Lt.maximumRenderbufferSize,o=e.format??rl.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(R1.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});R1.prototype._getRenderbuffer=function(){return this._renderbuffer};R1.prototype.isDestroyed=function(){return!1};R1.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ce(this)};var Fu=R1;function Ns(e){e=e??G.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(Ns.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}}});Ns.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])};Ns.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??He.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??je.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new dt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:zt.NEAREST}),this._numSamples>1){let a=rl.getColorFormat(o);this._colorRenderbuffers[s]=new Fu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new dt({context:e,width:t,height:n,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Fu({context:e,width:t,height:n,format:rl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Fu({context:e,width:t,height:n,format:rl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new dt({context:e,width:t,height:n,pixelFormat:je.DEPTH_COMPONENT,pixelDatatype:He.UNSIGNED_INT,sampler:zt.NEAREST}):this._depthRenderbuffer=new Fu({context:e,width:t,height:n,format:rl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new D1({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 Gr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ns.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};Ns.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ns.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};Ns.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ns.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ns.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ns.prototype.getDepthTexture=function(){return this._depthTexture};Ns.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ns.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ns.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ns.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ns.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ns.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ns.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ns.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ns.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 _i=Ns;function hFe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ee.createIfNeeded(t.positiveX).fetchImage(i),Ee.createIfNeeded(t.negativeX).fetchImage(i),Ee.createIfNeeded(t.positiveY).fetchImage(i),Ee.createIfNeeded(t.negativeY).fetchImage(i),Ee.createIfNeeded(t.positiveZ).fetchImage(i),Ee.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new or({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var O1=hFe;var mx={VERTEX:0,FRAGMENT:1,BOTH:2};mx.includesVertexShader=function(e){return e===mx.VERTEX||e===mx.BOTH};mx.includesFragmentShader=function(e){return e===mx.FRAGMENT||e===mx.BOTH};var pe=Object.freeze(mx);function eW(e){this.name=e,this.fields=[]}eW.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};eW.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var M1=eW;function tW(e){this.signature=e,this.body=[]}tW.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}`)};tW.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var L1=tW;function sl(){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(sl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});sl.prototype.addDefine=function(e,t,n){n=n??pe.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),pe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};sl.prototype.addStruct=function(e,t,n){this._structs[e]=new M1(t),pe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};sl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};sl.prototype.addFunction=function(e,t,n){this._functions[e]=new L1(t),pe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};sl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};sl.prototype.addUniform=function(e,t,n){n=n??pe.BOTH;let i=`uniform ${e} ${t};`;pe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};sl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};sl.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+=pFe(e),i};sl.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}`)};sl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};sl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};sl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=mFe(this),i=_Fe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),r=new Be({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Be({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Xt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};sl.prototype.clone=function(){return Fe(this,!0)};function mFe(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 pFe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function _Fe(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 px=sl;function _x(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e;if(!t.webgl2)throw new he("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,p=je.toInternalFormat(i,o,t),_=je.isCompressedFormat(p),m=t._gl,y=je.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??Ln(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,kre(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new he("For Texture3D, options.source.arrayBufferView must be defined");gFe(this,n),this._initialized=!0}else yFe(this);m.bindTexture(this._textureTarget,null)}function gFe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=je.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:_}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(o,m,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,u,He.toWebGLConstant(f,n),_),m>1){let y=s,b=a,x=c;for(let T=0;T<t.mipLevels.length;++T)y=nW(y),b=nW(b),x=nW(x),i.texSubImage3D(o,T+1,0,0,0,y,b,x,u,He.toWebGLConstant(f,n),t.mipLevels[T])}}function nW(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function yFe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}_x.create=function(e){return new _x(e)};Object.defineProperties(_x.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){kre(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function kre(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.NEAREST),je.isDepthFormat(s)&&(n=ft.NEAREST,i=Kn.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}_x.prototype.generateMipmap=function(e){e=e??qf.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)};_x.prototype.isDestroyed=function(){return!1};_x.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ce(this)};var iW=_x;function N1({x:e,y:t,width:n,height:i}){this.rectangle=new Xe(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function oW({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new N1({x:n,y:n,width:e-2*n,height:t-2*n})}oW.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};oW.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 N1({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new N1({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new N1({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new N1({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 mE=oW;var Ure=16;function Ql(e){e=e??G.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new V(Ure,Ure);this._pixelFormat=e.pixelFormat??je.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Ln(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Ql.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}}});Ql.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Xe),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/o,t.y=u/r,t.width=s/o,t.height=a/r,t};Ql.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new dt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,u=this._texture,f=new Gr({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let _=0;_<d.length;++_){let m=i[_],y=d[_];if(!l(m)||!l(y)||l(p.get(_)))continue;let{x:b,y:x,width:T,height:C}=m;a.copyTexSubImage2D(c,0,b,x,y.x,y.y,T,C)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};Ql.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,c=this._subRegions,u=i.map((T,C)=>new zre({index:C,image:T})).filter((T,C)=>l(T.image)&&!l(c.get(C))),f=0,d=0,p=0;for(let T=t;T<o.length;++T){let{width:C,height:A}=o[T].image;f=Math.max(f,C),d=Math.max(d,A),p+=C*A,u.push(o[T])}s=Math.max(f,s),a=Math.max(d,a),e.webgl2||(s=D.nextPowerOfTwo(s),a=D.nextPowerOfTwo(a));let _=p,m=1;for(;_/s/a>=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:T},{image:C})=>C.height*C.width-T.height*T.width);let y=new Array(this._nextIndex);for(let T of this._subRegions.keys())l(c.get(T))&&(y[T]=i[T]);let b,x=!1;for(;!x;){b=new mE({height:a,width:s,borderPadding:n});let T;for(T=0;T<u.length;++T){let{index:C,image:A}=u[T];if(!l(A))continue;let S=b.pack(C,A);if(!l(S)){s>a?a*=2:s*=2;break}y[C]=S.rectangle}x=T===u.length}this._texturePacker=b,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=Ln()};Ql.prototype.getImageIndex=function(e){return this._indexById.get(e)};Ql.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 zre({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Ql.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new zre({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Ql.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};Ql.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 dt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new mE({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function bFe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Ee)&&(e=Ee.createIfNeeded(e).fetchImage()),e}Ql.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 bFe(t,e),this.isDestroyed()||!l(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Ql.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new se(`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})};Ql.prototype.isDestroyed=function(){return!1};Ql.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ce(this)};var gx=Ql;function ta(e,t,n,i){let o=ta._verifyAttributes(t);n=n??0;let r=[],s={},a,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return K.getSizeInBytes(p.componentDatatype)-K.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=ta._vertexSizeInBytes(a),p=a[0].usage,_={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:ta._createArrayViews(a,d)};this._allBuffers.push(_)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}ta._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??K.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Ne.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};ta._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*K.getSizeInBytes(a.componentDatatype)}let i=n>0?K.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};ta._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/K.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*K.getSizeInBytes(a)}return n};ta.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];ta._resize(o,this._size),ta._appendWriters(this.writers,o)}rW(this)};ta._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=K.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var xFe=[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}}];ta._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]=xFe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};ta.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=TFe(this,i)||t;if(t||!l(this.va)){rW(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*a);ta._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new qn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function TFe(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=st.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}ta._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})}};ta.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)CFe(n[i],e,t)};function CFe(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)}}ta.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function rW(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}ta.prototype.isDestroyed=function(){return!1};ta.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 rW(this),ce(this)};var l_=ta;function Ly(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new me,this.setValue(e)}Object.defineProperties(Ly.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Ly.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Ly.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))}};Ly.prototype.equals=function(e){return this===e||e instanceof Ly&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Ly.prototype.valueOf=function(){return this._value};Ly.prototype.toString=function(){return String(this._value)};var Qn=Ly;function AFe(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 EFe(e){return new Qn(e)}function SFe(e,t,n){return AFe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??EFe)}var ue=SFe;function F1(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(F1.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")});F1.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 F1(this)};F1.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 vc=F1;function yx(){this._array=[],this._hash={}}Object.defineProperties(yx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});yx.prototype.contains=function(e){return l(this._hash[e])};yx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};yx.prototype.get=function(e){return this._hash[e]};yx.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};yx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var wt=yx;function Bu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Bu.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}}});Bu.packedLength=2;Bu.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Bu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Bu),n.near=e[t++],n.far=e[t],n};Bu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Bu.clone=function(e,t){if(l(e))return l(t)||(t=new Bu),t.near=e.near,t.far=e.far,t};Bu.prototype.clone=function(e){return Bu.clone(this,e)};Bu.prototype.equals=function(e){return Bu.equals(this,e)};var Rt=Bu;function $f(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}$f.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 $f(e.near,e.nearValue,e.far,e.farValue)};$f.packedLength=4;$f.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};$f.unpack=function(e,t,n){return t=t??0,l(n)||(n=new $f),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};$f.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};$f.prototype.clone=function(e){return $f.clone(this,e)};$f.prototype.equals=function(e){return $f.equals(this,e)};var Vt=$f;var bx={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(bx);function Zf(e){return e===bx.CLAMP_TO_GROUND||e===bx.CLAMP_TO_3D_TILE||e===bx.CLAMP_TO_TERRAIN}function pE(e){return e===bx.RELATIVE_TO_GROUND||e===bx.RELATIVE_TO_3D_TILE||e===bx.RELATIVE_TO_TERRAIN}var vFe={CENTER:0,LEFT:1,RIGHT:-1},Ci=Object.freeze(vFe);var wFe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Fn=Object.freeze(wFe);var IFe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),ut=IFe;function uh(){he.throwInstantiationError()}Object.defineProperties(uh.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});uh.prototype.getValue=he.throwInstantiationError;uh.prototype.equals=he.throwInstantiationError;uh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};uh.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(!uh.equals(e[i],t[i]))return!1;return!0};uh.isConstant=function(e){return!l(e)||e.isConstant};uh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};uh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};uh.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var X=uh;var PFe={LEFT:-1,NONE:0,RIGHT:1},Wr=Object.freeze(PFe);var DFe=H.WHITE,RFe=h.ZERO,OFe=Ke.NONE,MFe=V.ZERO,LFe=1,NFe=0,FFe=h.ZERO,BFe=Ci.CENTER,kFe=Fn.CENTER,UFe=!1,zFe=Wr.NONE,VFe=new h,HFe=new H,GFe=new h,jFe=new V,WFe=new Vt,qFe=new Vt,YFe=new Vt,XFe=new Xe,KFe=new Rt;function Vre(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Ny(e,t){t.collectionChanged.addEventListener(Ny.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new wt,this._onCollectionChanged(t,t.values,[],[])}Ny.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,VFe),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){sW(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,r.textureValue!==c&&(u.image=c,r.textureValue=c),u.position=d,u.color=X.getValueOrDefault(a._color,e,DFe,HFe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,RFe,GFe),u.heightReference=X.getValueOrDefault(a._heightReference,e,OFe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,MFe,jFe),u.scale=X.getValueOrDefault(a._scale,e,LFe),u.rotation=X.getValueOrDefault(a._rotation,e,NFe),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,FFe),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,BFe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,kFe),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,WFe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,qFe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,YFe),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,UFe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,KFe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,zFe);let p=X.getValueOrUndefined(a._imageSubRegion,e,XFe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};Ny.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=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};Ny.prototype.isDestroyed=function(){return!1};Ny.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ny.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ce(this)};Ny.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 Vre(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 Vre(r)):(sW(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],sW(s.get(r.id),r,a),s.remove(r.id)};function sW(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var B1=Ny;var $Fe=new h;function km(e){e=e??G.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}km.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new km({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};km.fromAxisAlignedBoundingBox=function(e){return new km({minimum:e.minimum,maximum:e.maximum})};km.packedLength=2*h.packedLength+1;km.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Gre=new h,jre=new h,Hre={minimum:Gre,maximum:jre,offsetAttribute:void 0};km.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Gre),o=h.unpack(e,t+h.packedLength,jre),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Hre.offsetAttribute=r===-1?void 0:r,new km(Hre))};km.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new dn,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 we({componentDatatype:K.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=h.subtract(n,t,$Fe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===an.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new lt({attributes:i,indices:o,primitiveType:Le.LINES,boundingSphere:new re(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var fh=km;function _E(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([H.floatToByte(e),H.floatToByte(t),H.floatToByte(n),H.floatToByte(i)])}Object.defineProperties(_E.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});_E.fromColor=function(e){return new _E(e.red,e.green,e.blue,e.alpha)};_E.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};_E.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 Yt=_E;function k1(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(k1.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});k1.fromDistanceDisplayCondition=function(e){return new k1(e.near,e.far)};k1.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Un=k1;function ZFe(e){e=e??G.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var It=ZFe;function rr(e){e=e??G.EMPTY_OBJECT,this.start=l(e.start)?$.clone(e.start):new $,this.stop=l(e.stop)?$.clone(e.stop):new $,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(rr.prototype,{isEmpty:{get:function(){let e=$.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var gE={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};rr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=$.fromIso8601(n[0]),o=$.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):(gE.start=i,gE.stop=o,gE.isStartIncluded=r,gE.isStopIncluded=s,gE.data=a,new rr(gE))};rr.toIso8601=function(e,t){return`${$.toIso8601(e.start,t)}/${$.toIso8601(e.stop,t)}`};rr.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 rr(e)};rr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equals(e.start,t.start)&&$.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};rr.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&&$.equalsEpsilon(e.start,t.start,n)&&$.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};rr.intersect=function(e,t,n,i){if(!l(t))return rr.clone(rr.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=$.greaterThanOrEquals(s,o)&&$.greaterThanOrEquals(r,s),u=!c&&$.lessThanOrEquals(s,o)&&$.lessThanOrEquals(o,a);if(!c&&!u)return rr.clone(rr.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,_=t.isStopIncluded,m=$.lessThan(r,a);return l(n)||(n=new rr),n.start=c?s:o,n.isStartIncluded=f&&p||!$.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?d:d&&_||!$.equals(a,r)&&_,n.data=l(i)?i(e.data,t.data):e.data,n};rr.contains=function(e,t){if(e.isEmpty)return!1;let n=$.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=$.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};rr.prototype.clone=function(e){return rr.clone(this,e)};rr.prototype.equals=function(e,t){return rr.equals(this,e,t)};rr.prototype.equalsEpsilon=function(e,t,n){return rr.equalsEpsilon(this,e,t,n)};rr.prototype.toString=function(){return rr.toIso8601(this)};rr.EMPTY=Object.freeze(new rr({start:new $,stop:new $,isStartIncluded:!1,isStopIncluded:!1}));var En=rr;var Wre=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),qre=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),QFe=Object.freeze(new En({start:Wre,stop:qre})),JFe={MINIMUM_VALUE:Wre,MAXIMUM_VALUE:qre,MAXIMUM_INTERVAL:QFe},Ge=JFe;function U1(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(U1.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});U1.fromCartesian3=function(e){return new U1(e.x,e.y,e.z)};U1.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=U1;function jV(e){e=e??!0,this.value=jV.toValue(e)}Object.defineProperties(jV.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});jV.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var bn=jV;var z1=`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 V1=`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 H1=`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 G1=`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 j1=`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 W1=`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 e2e={ADD:q.FUNC_ADD,SUBTRACT:q.FUNC_SUBTRACT,REVERSE_SUBTRACT:q.FUNC_REVERSE_SUBTRACT,MIN:q.MIN,MAX:q.MAX},Za=Object.freeze(e2e);var t2e={ZERO:q.ZERO,ONE:q.ONE,SOURCE_COLOR:q.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:q.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:q.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:q.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:q.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:q.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:q.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:q.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:q.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:q.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:q.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:q.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:q.SRC_ALPHA_SATURATE},Io=Object.freeze(t2e);var n2e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.SOURCE_ALPHA,functionSourceAlpha:Io.ONE,functionDestinationRgb:Io.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Io.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.ONE,functionSourceAlpha:Io.ONE,functionDestinationRgb:Io.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Io.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.SOURCE_ALPHA,functionSourceAlpha:Io.ONE,functionDestinationRgb:Io.ONE,functionDestinationAlpha:Io.ONE})},fn=Object.freeze(n2e);var i2e={FRONT:q.FRONT,BACK:q.BACK,FRONT_AND_BACK:q.FRONT_AND_BACK},Ai=Object.freeze(i2e);function yE(e){e=e??G.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(yE.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}}});yE.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(` -`)};yE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};yE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Fe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=fn.ALPHA_BLEND):t.depthMask=!0,t};yE.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:Ai.BACK}),l(n)&&(i=ct(n,i,!0)),i};var co=yE;var q1=`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 Y1=`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 X1=`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 K1=`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 $1=`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 Z1=`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 Q1=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var J1=`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 eR=`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 tR=`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 nR=`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 iR=`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 oR=`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 rR=`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 sR=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); - - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); - - return material; -} -`;var aR=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var cR=`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 lR=`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 uR=`// 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 We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??ft.LINEAR,this._magnificationFilter=e.magnificationFilter??Kn.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,o2e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.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};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new dt({context:e,source:u,sampler:d});let _=this._textures[n];l(_)&&_!==this._defaultTexture&&_.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];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 u=c.images,f=new or({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.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 ce(this)};function o2e(e,t){e=e??G.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Fe(e.fabric??G.EMPTY_OBJECT),t._template.uniforms=Fe(t._template.uniforms??G.EMPTY_OBJECT),t._template.materials=Fe(t._template.materials??G.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Ln(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Fe(i.fabric,!0);t._template=ct(t._template,r,!0),n=i.translucent}c2e(t),l(i)||We._materialCache.addMaterial(t.type,t),u2e(t),m2e(t),_2e(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 aW(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 Yre(e,t){}function r2e(e,t){}var s2e=["type","materials","uniforms","components","source"],a2e=["diffuse","specular","shininess","normal","emission","alpha"];function c2e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;aW(t,s2e,Yre,!0),aW(o,a2e,Yre,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);aW(n,r,r2e,!1)}function l2e(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 u2e(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&&l2e(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 Xre={mat2:ei,mat3:Z,mat4:M},f2e=/\.ktx2$/i;function d2e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new zt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new dt({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 dt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof Ee;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:Ee.createIfNeeded(r),_;f2e.test(p.url)?_=Qs(p.url):_=p.fetchImage(),Promise.resolve(_).then(function(m){n._loadedImages.push({id:e,image:m})}).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 h2e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof or){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===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ee.createIfNeeded(i.positiveX).fetchImage(),Ee.createIfNeeded(i.negativeX).fetchImage(),Ee.createIfNeeded(i.positiveY).fetchImage(),Ee.createIfNeeded(i.negativeY).fetchImage(),Ee.createIfNeeded(i.positiveZ).fetchImage(),Ee.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function m2e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Kre(e,n)}function Kre(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=p2e(o),s;if(r==="channels")s=fR(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;g2e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Kre(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=fR(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(d2e(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(h2e(t));else if(r.indexOf("mat")!==-1){let u=new Xre[r];e._uniforms[c]=function(){return Xre[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function p2e(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 Ee||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.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 _2e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=ct(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;fR(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=fR(e,i,a)}}function fR(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function g2e(e,t,n){return fR(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new H(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new V(1,1),color:new H(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}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new V(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new V(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new V(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new V(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new V(1,1)},source:Y1},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new V(1,1)},source:tR},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new H(0,1,0,1),cellAlpha:.1,lineCount:new V(8,8),lineThickness:new V(1,1),lineOffset:new V(0,0)},source:eR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new H(1,1,1,.5),oddColor:new H(0,0,1,.5),offset:0,repeat:5},source:cR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new H(1,1,1,.5),darkColor:new H(0,0,0,.5),repeat:new V(5,5)},source:X1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new H(1,1,0,.75),darkColor:new H(0,1,1,.75),repeat:new V(5,5)},source:K1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new H(.2,.3,.6,1),blendColor:new H(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:uR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new H(1,0,0,.7),rimColor:new H(1,1,1,.4),width:.3},source:sR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new H(1,0,0,1),fadeOutColor:new H(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new V(.5,.5)},source:J1},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new H(1,1,1,1)},source:nR},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new H(1,0,1,1),gapColor:new H(0,0,0,0),dashLength:16,dashPattern:255},source:iR},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new H(0,.5,1,1),glowPower:.25,taperPower:1},source:oR},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new H(1,1,1,1),outlineColor:new H(1,0,0,1),outlineWidth:1},source:rR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new H(1,0,0,1),width:1},source:Z1},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:Q1},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:aR},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:q1},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:$1},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:lR,uniforms:{waterColor:new H(1,1,1,1),landColor:new H(0,0,0,0)}},translucent:!1});var $i=We;function xx(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??xx.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:$i.fromType($i.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(xx.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}}});xx.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;xx.prototype.isTranslucent=co.prototype.isTranslucent;xx.prototype.getRenderState=co.prototype.getRenderState;xx.MaterialSupport={BASIC:Object.freeze({vertexFormat:De.POSITION_AND_NORMAL,vertexShaderSource:G1,fragmentShaderSource:H1}),TEXTURED:Object.freeze({vertexFormat:De.POSITION_NORMAL_AND_ST,vertexShaderSource:W1,fragmentShaderSource:j1}),ALL:Object.freeze({vertexFormat:De.ALL,vertexShaderSource:V1,fragmentShaderSource:z1})};var ho=xx;var dR=`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 hR=`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 Tx=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var mR=`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 u_(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?mR:hR,r=i?Tx:dR,s=i?u_.FLAT_VERTEX_FORMAT:u_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(u_.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}}});u_.VERTEX_FORMAT=De.POSITION_AND_NORMAL;u_.FLAT_VERTEX_FORMAT=De.POSITION_ONLY;u_.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;u_.prototype.isTranslucent=co.prototype.isTranslucent;u_.prototype.getRenderState=co.prototype.getRenderState;var un=u_;function bE(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(bE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});bE.prototype.getType=function(e){return"Color"};var y2e=new $;bE.prototype.getValue=function(e,t){return l(e)||(e=$.now(y2e)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};bE.prototype.equals=function(e){return this===e||e instanceof bE&&X.equals(this._color,e._color)};var Wt=bE;function Fy(e){e=e??G.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._rectangle=e.rectangle??ae.MAX_VALUE,this._projection=new Mi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Fy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Fy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Fy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Fy.prototype.rectangleToNativeRectangle=function(e,t){let n=D.toDegrees(e.west),i=D.toDegrees(e.south),o=D.toDegrees(e.east),r=D.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ae(n,i,o,r)};Fy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o};Fy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,d=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new ae(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};Fy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=D.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new V(u,f)};var Ei=Fy;var $re=new h,Zre=new h,Qre=new fe,cW=new h,b2e=new h,Jre=new re,x2e=new Ei,pR=[new fe,new fe,new fe,new fe],_R=new V,as={};as.initialize=function(){let e=as._initPromise;return l(e)||(e=Ee.fetchJson(on("Assets/approximateTerrainHeights.json")).then(function(t){as._terrainHeights=t}),as._initPromise=e),e};as.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=ese(e),i=as._defaultMinTerrainHeight,o=as._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=as._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ae.northeast(e,Qre),$re),t.cartographicToCartesian(ae.southwest(e,Qre),Zre),h.midpoint(Zre,$re,cW);let a=t.scaleToGeodeticSurface(cW,b2e);if(l(a)){let c=h.distance(cW,a);i=Math.min(i,-c)}else i=as._defaultMinTerrainHeight}return i=Math.max(as._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};as.getBoundingSphere=function(e,t){t=t??te.default;let n=ese(e),i=as._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=as._terrainHeights[r];l(s)&&(i=s[1])}let o=re.fromRectangle3D(e,t,0);return re.fromRectangle3D(e,t,i,Jre),re.union(o,Jre,o)};function ese(e){fe.fromRadians(e.east,e.north,0,pR[0]),fe.fromRadians(e.west,e.north,0,pR[1]),fe.fromRadians(e.east,e.south,0,pR[2]),fe.fromRadians(e.west,e.south,0,pR[3]);let t=0,n=0,i=0,o=0,r=as._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=pR[c];if(x2e.positionToTileXY(u,s,_R),c===0)i=_R.x,o=_R.y;else if(i!==_R.x||o!==_R.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}}as._terrainHeightsMaxLevel=6;as._defaultMaxTerrainHeight=9e3;as._defaultMinTerrainHeight=-1e5;as._terrainHeights=void 0;as._initPromise=void 0;Object.defineProperties(as,{initialized:{get:function(){return l(as._terrainHeights)}}});var hi=as;function al(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}al.fromCorners=function(e,t,n){return l(n)||(n=new al),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};al.fromPoints=function(e,t){if(l(t)||(t=new al),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.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 d=1;d<c;d++){let p=e[d],_=p.x,m=p.y,y=p.z;n=Math.min(_,n),r=Math.max(_,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};al.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new al(e.minimum,e.maximum,e.center)};al.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var WV=new h;al.intersectPlane=function(e,t){WV=h.subtract(e.maximum,e.minimum,WV);let n=h.multiplyByScalar(WV,.5,WV),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?Ht.INSIDE:r+o<0?Ht.OUTSIDE:Ht.INTERSECTING};al.prototype.clone=function(e){return al.clone(this,e)};al.prototype.intersectPlane=function(e){return al.intersectPlane(this,e)};al.prototype.equals=function(e){return al.equals(this,e)};var By=al;var lW=new ie;function Um(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(M.getColumn(n,0,lW)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,lW));let i=h.fromCartesian4(M.getColumn(n,2,lW));this._plane=en.fromPointNormal(e,i)}Object.defineProperties(Um.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 T2e=new By;Um.fromPoints=function(e,t){let n=By.fromPoints(e,T2e);return new Um(n.center,t)};var tse=new _n,qV=new h;Um.prototype.projectPointOntoPlane=function(e,t){let n=tse;n.origin=e,h.normalize(e,n.direction);let i=ti.rayPlane(n,this._plane,qV);if(l(i)||(h.negate(n.direction,n.direction),i=ti.rayPlane(n,this._plane,qV)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new V(r,s)}};Um.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};Um.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new V);let n=tse;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ti.rayPlane(n,this._plane,qV);l(i)||(h.negate(n.direction,n.direction),i=ti.rayPlane(n,this._plane,qV));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};Um.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 C2e=new h;Um.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=C2e;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Um.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 cs=Um;function Hi(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=Z.clone(t??Z.ZERO)}Hi.packedLength=h.packedLength+Z.packedLength;Hi.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),Z.pack(e.halfAxes,t,n+h.packedLength),t};Hi.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Hi),h.unpack(e,t,n.center),Z.unpack(e,t+h.packedLength,n.halfAxes),n};var A2e=new h,E2e=new h,S2e=new h,v2e=new h,w2e=new h,I2e=new h,P2e=new Z,D2e={unitary:new Z,diagonal:new Z};Hi.fromPoints=function(e,t){if(l(t)||(t=new Hi),!l(e)||e.length===0)return t.halfAxes=Z.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],A2e);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,E2e),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,d*=r;let _=P2e;_[0]=s,_[1]=a,_[2]=c,_[3]=a,_[4]=u,_[5]=f,_[6]=c,_[7]=f,_[8]=d;let m=Z.computeEigenDecomposition(_,D2e),y=Z.clone(m.unitary,t.halfAxes),b=Z.getColumn(y,0,v2e),x=Z.getColumn(y,1,w2e),T=Z.getColumn(y,2,I2e),C=-Number.MAX_VALUE,A=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=Number.MAX_VALUE,R=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],C=Math.max(h.dot(b,p),C),A=Math.max(h.dot(x,p),A),S=Math.max(h.dot(T,p),S),w=Math.min(h.dot(b,p),w),R=Math.min(h.dot(x,p),R),P=Math.min(h.dot(T,p),P);b=h.multiplyByScalar(b,.5*(w+C),b),x=h.multiplyByScalar(x,.5*(R+A),x),T=h.multiplyByScalar(T,.5*(P+S),T);let O=h.add(b,x,t.center);h.add(O,T,O);let L=S2e;return L.x=C-w,L.y=A-R,L.z=S-P,h.multiplyByScalar(L,.5,L),Z.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var ase=new h,R2e=new h;function nse(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Hi);let d=f.halfAxes;Z.setColumn(d,0,t,d),Z.setColumn(d,1,n,d),Z.setColumn(d,2,i,d);let p=ase;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let _=R2e;_.x=(r-o)/2,_.y=(a-s)/2,_.z=(u-c)/2;let m=f.center;return p=Z.multiplyByVector(d,p,p),h.add(e,p,m),Z.multiplyByScale(d,_,d),f}var ise=new fe,O2e=new h,M2e=new fe,L2e=new fe,N2e=new fe,F2e=new fe,B2e=new fe,k2e=new h,ose=new h,U2e=new h,rse=new h,z2e=new h,V2e=new V,H2e=new V,G2e=new V,j2e=new V,W2e=new V,q2e=new h,Y2e=new h,X2e=new h,K2e=new h,$2e=new V,Z2e=new h,Q2e=new h,J2e=new h,eBe=new en(h.UNIT_X,0);Hi.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,s,a,c,u,f,d;if(e.width<=D.PI){let R=ae.center(e,ise),P=i.cartographicToCartesian(R,O2e),O=new cs(P,i);d=O.plane;let L=R.longitude,g=e.south<0&&e.north>0?0:R.latitude,E=fe.fromRadians(L,e.north,n,M2e),v=fe.fromRadians(e.west,e.north,n,L2e),I=fe.fromRadians(e.west,g,n,N2e),N=fe.fromRadians(e.west,e.south,n,F2e),F=fe.fromRadians(L,e.south,n,B2e),U=i.cartographicToCartesian(E,k2e),k=i.cartographicToCartesian(v,ose),z=i.cartographicToCartesian(I,U2e),B=i.cartographicToCartesian(N,rse),j=i.cartographicToCartesian(F,z2e),W=O.projectPointToNearestOnPlane(U,V2e),J=O.projectPointToNearestOnPlane(k,H2e),Y=O.projectPointToNearestOnPlane(z,G2e),ee=O.projectPointToNearestOnPlane(B,j2e),Q=O.projectPointToNearestOnPlane(j,W2e);return r=Math.min(J.x,Y.x,ee.x),s=-r,c=Math.max(J.y,W.y),a=Math.min(ee.y,Q.y),v.height=N.height=t,k=i.cartographicToCartesian(v,ose),B=i.cartographicToCartesian(N,rse),u=Math.min(en.getPointDistance(d,k),en.getPointDistance(d,B)),f=n,nse(O.origin,O.xAxis,O.yAxis,O.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,_=e.north<0,m=p?e.south:_?e.north:0,y=ae.center(e,ise).longitude,b=h.fromRadians(y,m,n,i,q2e);b.z=0;let T=Math.abs(b.x)<D.EPSILON10&&Math.abs(b.y)<D.EPSILON10?h.UNIT_X:h.normalize(b,Y2e),C=h.UNIT_Z,A=h.cross(T,C,X2e);d=en.fromPointNormal(b,T,eBe);let S=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,K2e);s=h.dot(en.projectPointOntoPlane(d,S,$2e),A),r=-s,c=h.fromRadians(0,e.north,_?t:n,i,Z2e).z,a=h.fromRadians(0,e.south,p?t:n,i,Q2e).z;let w=h.fromRadians(e.east,m,n,i,J2e);return u=en.getPointDistance(d,w),f=0,nse(b,A,C,T,r,s,a,c,u,f,o)};Hi.fromTransformation=function(e,t){return l(t)||(t=new Hi),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=Z.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Hi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),Z.clone(e.halfAxes,t.halfAxes),t):new Hi(e.center,e.halfAxes)};Hi.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[Z.COLUMN0ROW0]+s*o[Z.COLUMN0ROW1]+a*o[Z.COLUMN0ROW2])+Math.abs(r*o[Z.COLUMN1ROW0]+s*o[Z.COLUMN1ROW1]+a*o[Z.COLUMN1ROW2])+Math.abs(r*o[Z.COLUMN2ROW0]+s*o[Z.COLUMN2ROW1]+a*o[Z.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?Ht.OUTSIDE:u>=c?Ht.INSIDE:Ht.INTERSECTING};var cse=new h,lse=new h,use=new h,tBe=new h,sse=new h,nBe=new h;Hi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,ase),i=e.halfAxes,o=Z.getColumn(i,0,cse),r=Z.getColumn(i,1,lse),s=Z.getColumn(i,2,use),a=h.magnitude(o),c=h.magnitude(r),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(o,a,o):f=!1,c>0?h.divideByScalar(r,c,r):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let _=!f+!d+!p,m,y,b;if(_===1){let A=o;m=r,y=s,d?p||(A=s,y=o):(A=r,m=o),b=h.cross(m,y,sse),A===o?o=b:A===r?r=b:A===s&&(s=b)}else if(_===2){m=o,d?m=r:p&&(m=s);let A=h.UNIT_Y;A.equalsEpsilon(m,D.EPSILON3)&&(A=h.UNIT_X),y=h.cross(m,A,tBe),h.normalize(y,y),b=h.cross(m,y,sse),h.normalize(b,b),m===o?(r=y,s=b):m===r?(s=y,o=b):m===s&&(o=y,r=b)}else _===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let x=nBe;x.x=h.dot(n,o),x.y=h.dot(n,r),x.z=h.dot(n,s);let T=0,C;return x.x<-a?(C=x.x+a,T+=C*C):x.x>a&&(C=x.x-a,T+=C*C),x.y<-c?(C=x.y+c,T+=C*C):x.y>c&&(C=x.y-c,T+=C*C),x.z<-u?(C=x.z+u,T+=C*C):x.z>u&&(C=x.z-u,T+=C*C),T};var iBe=new h,oBe=new h;Hi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Xa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,cse),u=Z.getColumn(a,1,lse),f=Z.getColumn(a,2,use),d=h.add(c,u,iBe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,oBe),_=h.dot(n,p);return o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),i.start=o,i.stop=r,i};var rBe=new h,sBe=new h,aBe=new h;Hi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=Z.getColumn(i,0,rBe),r=Z.getColumn(i,1,sBe),s=Z.getColumn(i,2,aBe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var cBe=new Z;Hi.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,cBe);return M.fromRotationTranslation(i,n,t)};var lBe=new re;Hi.isOccluded=function(e,t){let n=re.fromOrientedBoundingBox(e,lBe);return!t.isBoundingSphereVisible(n)};Hi.prototype.intersectPlane=function(e){return Hi.intersectPlane(this,e)};Hi.prototype.distanceSquaredTo=function(e){return Hi.distanceSquaredTo(this,e)};Hi.prototype.computePlaneDistances=function(e,t,n){return Hi.computePlaneDistances(this,e,t,n)};Hi.prototype.computeCorners=function(e){return Hi.computeCorners(this,e)};Hi.prototype.computeTransformation=function(e){return Hi.computeTransformation(this,e)};Hi.prototype.isOccluded=function(e){return Hi.isOccluded(this,e)};Hi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Hi.prototype.clone=function(e){return Hi.clone(this,e)};Hi.prototype.equals=function(e){return Hi.equals(this,e)};var In=Hi;var YV={};YV.getHeight=function(e,t,n){return(e-n)*t+n};var uBe=new fe;YV.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,uBe);if(!l(r))return h.clone(e,o);let s=YV.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Or=YV;var gR=`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 ky=`#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 fse={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};fse.NUMBER_OF_CLASSIFICATION_TYPES=3;var zn=Object.freeze(fse);var fBe={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},wc=Object.freeze(fBe);function dBe(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 yR=dBe;function f_(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=hBe(t),o=e.floatingPointTexture,r=i===He.FLOAT&&!o,s=mBe(t,r),a=pBe(s,t,r),c=Math.floor(Lt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,_=p*.5,m=1/d,y=m*.5;this._textureDimensions=new V(f,d),this._textureStep=new ie(p,_,m,y),this._pixelDatatype=r?He.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*d;this._batchValues=i===He.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(f_.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function hBe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==K.UNSIGNED_BYTE){t=!0;break}return t?He.FLOAT:He.UNSIGNED_BYTE}function hse(e,t){let n=e[t].componentsPerAttribute;return n===2?V:n===3?h:n===4?ie:Number}function mBe(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!==K.UNSIGNED_BYTE&&t?i+=4:++i}return n}function pBe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==K.UNSIGNED_BYTE&&n?o+4:o+1}var bR=new ie;function _Be(e,t,n){let i=ie.unpack(e,t,bR),o=ie.unpackFloat(i);i=ie.unpack(e,t+4,bR);let r=ie.unpackFloat(i);i=ie.unpack(e,t+8,bR);let s=ie.unpackFloat(i);i=ie.unpack(e,t+12,bR);let a=ie.unpackFloat(i);return ie.fromElements(o,r,s,a,n)}function gBe(e,t,n){let i=ie.packFloat(e.x,bR);ie.pack(i,t,n),i=ie.packFloat(e.y,i),ie.pack(i,t,n+4),i=ie.packFloat(e.z,i),ie.pack(i,t,n+8),i=ie.packFloat(e.w,i),ie.pack(i,t,n+12)}var dse=new ie;f_.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!==He.UNSIGNED_BYTE?a=_Be(this._batchValues,s,dse):a=ie.unpack(this._batchValues,s,dse);let c=hse(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var yBe=[void 0,void 0,new V,new h,new ie],bBe=new ie;f_.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=yBe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=hse(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=bBe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?gBe(c,this._batchValues,d):ie.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function xBe(e,t){let n=e._textureDimensions;e._texture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:zt.NEAREST,flipY:!1})}function TBe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}f_.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||xBe(this,e.context),TBe(this))};f_.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:ct(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function CBe(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 ABe(e){return e===1?"float":`vec${e}`}function EBe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function SBe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=ABe(o),a=EBe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==He.UNSIGNED_BYTE?u+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:u+=` vec4 textureValue = texture(batchTexture, st); -`,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===He.UNSIGNED_BYTE&&i.componentDatatype===K.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===He.FLOAT&&i.componentDatatype===K.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; -`),u+=` return value; -} -`,u}f_.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${CBe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=SBe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} -${t} -${s}`}};f_.prototype.isDestroyed=function(){return!1};f_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ce(this)};var Cx=f_;function Jl(e){this._ellipsoid=e??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Jl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Jl.mercatorAngleToGeodeticLatitude=function(e){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Jl.geodeticLatitudeToMercatorAngle=function(e){e>Jl.MaximumLatitude?e=Jl.MaximumLatitude:e<-Jl.MaximumLatitude&&(e=-Jl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Jl.MaximumLatitude=Jl.mercatorAngleToGeodeticLatitude(Math.PI);Jl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Jl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};Jl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Jl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Li=Jl;function vBe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!M.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function uW(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new we({componentDatatype:K.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function wBe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?uW(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(uW(i.westHemisphereGeometry,n),uW(i.eastHemisphereGeometry,n))}}function IBe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(vBe(t,a,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&Nn.splitLongitude(t[c]);if(wBe(t),r)for(c=0;c<d;++c){let _=t[c];l(_.geometry)?(Nn.reorderForPostVertexCache(_.geometry),Nn.reorderForPreVertexCache(_.geometry)):l(_.westHemisphereGeometry)&&l(_.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(_.westHemisphereGeometry),Nn.reorderForPreVertexCache(_.westHemisphereGeometry),Nn.reorderForPostVertexCache(_.eastHemisphereGeometry),Nn.reorderForPreVertexCache(_.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let _=u.attributes;if(o)for(let m in _)_.hasOwnProperty(m)&&_[m].componentDatatype===K.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in _)if(_.hasOwnProperty(m)&&_[m].componentDatatype===K.DOUBLE){let y=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,y,b,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=re.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let _=[];for(d=p.length,c=0;c<d;++c)u=p[c],_=_.concat(Nn.fitToUnsignedShortIndices(u));p=_}return p}function fW(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function PBe(e,t){let n=[];return fW(e,"geometry",t,n),fW(e,"westHemisphereGeometry",t,n),fW(e,"eastHemisphereGeometry",t,n),n}var d_={};d_.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=IBe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=PBe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let _=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(_)&&l(m)&&(l(_.boundingSphere)&&l(m.boundingSphere)&&(c[f]=re.union(_.boundingSphere,m.boundingSphere)),l(_.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=re.union(_.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function DBe(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 RBe(e,t){let n=e.length;for(let i=0;i<n;++i)DBe(e[i],t)}function OBe(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*re.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}d_.packCreateGeometryResults=function(e,t){let n=new Float64Array(OBe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&re.pack(c.boundingSphere,n,s),s+=re.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&re.pack(c.boundingSphereCV,n,s),s+=re.packedLength;let p=c.attributes,_=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(_.push(y),l(o[y])||(o[y]=i.length,i.push(y)));n[s++]=_.length;for(let y=0;y<_.length;y++){let b=_[y],x=p[b];n[s++]=o[b],n[s++]=x.componentDatatype,n[s++]=x.componentsPerAttribute,n[s++]=x.normalize?1:0,n[s++]=x.values.length,n.set(x.values,s),s+=x.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};d_.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=re.unpack(n,s)),s+=re.packedLength,n[s++]===1&&(p=re.unpack(n,s)),s+=re.packedLength;let y,b,x,T=new dn,C=n[s++];for(i=0;i<C;i++){let S=t[n[s++]],w=n[s++];x=n[s++];let R=n[s++]!==0;y=n[s++],b=K.createTypedArray(w,y);for(let P=0;P<y;P++)b[P]=n[s++];T[S]=new we({componentDatatype:w,componentsPerAttribute:x,normalize:R,values:b})}let A;if(y=n[s++],y>0){let S=b.length/x;for(A=ke.createTypedArray(S,y),i=0;i<y;i++)A[i]=n[s++]}o[r++]=new lt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:A,attributes:T,offsetAttribute:f})}return o};function MBe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(M.pack(s.modelMatrix,i,o),o+=M.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function LBe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=M.unpack(t,o),s;o+=M.packedLength,l(t[o])&&(s={offset:new io(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}d_.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:MBe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Mi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};d_.unpackCombineGeometryParameters=function(e){let t=LBe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=d_.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=te.clone(e.ellipsoid),s=e.isGeographic?new Mi(r):new Li(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function mse(e){let t=e.length,n=1+(re.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,re.pack(e[r],i,o)):i[o++]=0,o+=re.packedLength}return i}function pse(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=re.unpack(e,i)),++n,i+=re.packedLength;return t}d_.packCombineGeometryResults=function(e,t){l(e.geometries)&&RBe(e.geometries,t);let n=mse(e.boundingSpheres),i=mse(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}};d_.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:pse(e.boundingSpheres),boundingSpheresCV:pse(e.boundingSpheresCV)}};var Ax=d_;var NBe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Mr=Object.freeze(NBe);var ku={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};ku.NUMBER_OF_SHADOW_MODES=4;ku.castShadows=function(e){return e===ku.ENABLED||e===ku.CAST_ONLY};ku.receiveShadows=function(e){return e===ku.ENABLED||e===ku.RECEIVE_ONLY};ku.fromCastReceive=function(e,t){return e&&t?ku.ENABLED:e?ku.CAST_ONLY:t?ku.RECEIVE_ONLY:ku.DISABLED};var xn=Object.freeze(ku);function Lr(e){e=e??G.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??xn.DISABLED,this._translucent=void 0,this._state=Mr.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(Lr.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 FBe(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 BBe=new V,kBe=new h,Ese=new ie;function Sse(e){let t=e.length;if(t===1)return e[0];if(t===2)return V.unpack(e,0,BBe);if(t===3)return h.unpack(e,0,kBe);if(t===4)return ie.unpack(e,0,Ese)}function UBe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=FBe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,_,m,y;for(_=0;_<s;++_)m=r[_],y=p[m],c[m]=_,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:K.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:K.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,x=new Cx(t,a,o);for(_=0;_<o;++_){let T=i[_];p=T.attributes;for(let R=0;R<s;++R){m=r[R],y=p[m];let P=Sse(y.value),O=c[m];x.setBatchedAttribute(_,O,P)}let C={primitive:T.pickPrimitive??e};l(T.id)&&(C.id=T.id);let A=t.createPickId(C);e._pickIds.push(A);let S=A.color,w=Ese;w.x=H.floatToByte(S.red),w.y=H.floatToByte(S.green),w.z=H.floatToByte(S.blue),w.w=H.floatToByte(S.alpha),x.setBatchedAttribute(_,b-1,w)}e._batchTable=x,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function zBe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new we({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function VBe(e){let t=e.attributes,n=new dn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=zBe(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 lt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:re.clone(e.boundingSphere)})}function HBe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var GBe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Lr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=GBe.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(` -`)};Lr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Be.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};Lr._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 _se(e){return`${Be.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function gse(e){return`in vec4 v_pickColor; -${e}`}Lr._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};Lr._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};Lr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Be.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function yse(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,d+=` 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=Be.replaceMain(p,"czm_non_compressed_main");let _=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,_].join(` -`)}function jBe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function WBe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function bse(e,t){let n=e.vertexAttributes}function qBe(e,t){return function(){return e[t]}}var dW=Math.max(Nt.hardwareConcurrency-1,1),XV,YBe=new di("combineGeometry");function XBe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Mr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(XV))for(XV=new Array(dW),o=0;o<dW;o++)XV[o]=new di("createGeometry");let f;for(u=yR(u,dW),o=0;o<u.length;o++){let d=0,p=u[o],_=p.length;for(r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(XV[o].scheduleTask({subTasks:u[o]},m))}e._state=Mr.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Mr.CREATED}).catch(function(d){TR(e,t,Mr.FAILED,d)})}else if(e._state===Mr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=YBe.scheduleTask(Ax.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Mr.COMBINING,Promise.resolve(f).then(function(d){let p=Ax.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):TR(e,t,Mr.FAILED,void 0)}).catch(function(d){TR(e,t,Mr.FAILED,d)})}}function KBe(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,_;l(p.attributes)&&l(p.primitiveType)?_=VBe(p):_=p.constructor.createGeometry(p),o[c++]=HBe(s,_),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Ax.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=M.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):TR(e,t,Mr.FAILED,void 0)}function $Be(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 re;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],b=e._batchTable.getBatchedAttribute(i,n,new h);y=r[i].clone(y),Pse(y,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||re.intersectPlane(y,en.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],_=u[0];for(i=1;i<c.length;i++)d=re.union(d,c[i]);for(i=1;i<f.length;i++)p=re.union(p,f[i]);for(i=1;i<u.length;i++)_=re.union(_,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(_)&&m.push(_),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=re.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Lr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var xse=new Gn,vse=new fe,wse=new h,Ise=new re;function ZBe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,_=p.length;for(let m=0;m<_;++m){let y=p[m];if(!l(y))continue;let b=e.modelMatrix;l(b)&&(y=re.transform(y,b,Ise));let x=y.center,T=y.radius,C=Gn.fromCartesian(x,xse);if(d.setBatchedAttribute(m,o,C.high),d.setBatchedAttribute(m,r,C.low),!t.scene3DOnly){let A=f.cartesianToCartographic(x,vse),S=u.project(A,wse);C=Gn.fromCartesian(S,xse),d.setBatchedAttribute(m,s,C.high),d.setBatchedAttribute(m,a,C.low)}d.setBatchedAttribute(m,c,T)}e._batchTableBoundingSpheresUpdated=!0}var hW=new h,QBe=new h;function Tse(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=re.transform(f,p,Ise));let _=f.center;_=r.scaleToGeodeticSurface(_,QBe);let m=r.cartesianToCartographic(_,vse),y=o.project(m,wse),b=h.add(d,_,hW);m=r.cartesianToCartographic(b,m);let x=o.project(m,hW),T=h.subtract(x,y,hW),C=T.x;T.x=T.z,T.z=T.y,T.y=C,s.setBatchedAttribute(u,i,T)}e._batchTableOffsetsUpdated=!0}function JBe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(qn.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(re.clone(u.boundingSphere)),e._boundingSphereWC.push(new re),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,_=f.z;f.x=_,f.y=d,f.z=p,e._boundingSphereCV.push(re.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new re),e._boundingSphereMorph.push(new re)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,TR(e,t,Mr.COMPLETE,void 0)}function e3e(e,t,n,i){let o=n.getRenderState(),r;i?(r=Fe(o,!1),r.cull={enabled:!0,face:Ai.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=Ai.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Fe(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Fe(o,!1),r.depthTest.func=wc.GREATER,i?(r.cull={enabled:!0,face:Ai.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=Ai.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function t3e(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Lr._appendOffsetToShader(e,r),r=Lr._appendShowToShader(e,r),r=Lr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=_se(r),r=Lr._updateColorAttribute(e,r,!1),r=yse(e,r),r=Lr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=gse(s),e._sp=Xt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),bse(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Lr._appendShowToShader(e,r),r=Lr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=_se(r),r=Lr._updateColorAttribute(e,r,!0),r=yse(e,r),r=Lr._modifyShaderPosition(e,r,t.scene3DOnly),r=jBe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=gse(s),s=WBe(s),e._spDepthFail=Xt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),bse(e._spDepthFail,o))}var xR=new M,Cse=new h;function Ase(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]=qBe(s,c));let a=ct(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,xR),M.multiplyByPoint(xR,e.rtcCenter,Cse),M.setTranslation(xR,Cse,xR),xR}),a}function n3e(e,t,n,i,o,r,s,a){let c=Ase(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Ase(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Se.TRANSLUCENT:Se.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,_=0;for(let m=0;m<p;++m){let y;o&&(y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(o&&(++m,y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++_}}Lr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=re.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=re.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=re.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function i3e(e,t,n,i,o,r,s,a){Lr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=xn.castShadows(e.shadows),_=xn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let x=Math.floor(b/y),T=n[b];T.modelMatrix=o,T.boundingVolume=c[x],T.cull=r,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=_,d?T.pickId="v_pickColor":T.pickId=void 0,u.push(T)}}}Lr.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!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Mr.FAILED)return;let t=e.context;if(l(this._batchTable)||UBe(this,t),this._batchTable.attributes.length>0){if(Lt.maximumVertexTextureImageUnits===0)throw new se("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!==Mr.COMPLETE&&this._state!==Mr.COMBINED&&(this.asynchronous?XBe(this,e):KBe(this,e)),this._state===Mr.COMBINED&&(ZBe(this,e),Tse(this,e),JBe(this,e)),!this.show||this._state!==Mr.COMPLETE)return;this._batchTableOffsetsUpdated||Tse(this,e),this._recomputeBoundingSpheres&&$Be(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&(this._createRenderStatesFunction??e3e)(this,t,n,u),r&&(this._createShaderProgramFunction??t3e)(this,e,n),(o||r)&&(this._createCommandsFunction??n3e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??i3e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var o3e=new re,r3e=new re;function Pse(e,t,n){if(n===an.TOP){let i=re.clone(e,o3e),o=re.clone(e,r3e);o.center=h.add(o.center,t,o.center),e=re.union(i,o,e)}else n===an.ALL&&(e.center=h.add(e.center,t,e.center));return e}function s3e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=K.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function a3e(e,t,n,i,o){return function(r){let s=Sse(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var c3e=new h;function l3e(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)&&Pse(i,h.fromArray(r.get(),0,c3e),e._offsetInstanceExtend[n]),l(o)&&(i=re.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function u3e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Lr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:s3e(s,n,f),set:a3e(s,n,f,this,u)}}return l3e(this,c,n),u3e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Lr.prototype.isDestroyed=function(){return!1};Lr.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,ce(this)};function TR(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Mr.COMPLETE||e._state===Mr.FAILED})}var Pn=Lr;function f3e(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Ic=f3e;var xE=`#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 Qf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new mW;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new mW;if(o.requiresTextureCoordinates=e,n instanceof un)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}Qf.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 un&&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 un||(o=t.material.shaderSource),new Be({defines:i,sources:[o,xE]})};Qf.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 Be({defines:n,sources:[xE],pickColorQualifier:"in"})};Qf.prototype.createVertexShader=function(e,t,n,i){return Bse(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Qf.prototype.createPickVertexShader=function(e,t,n,i){return Bse(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Dse=new h,Rse=new fe,Ose={high:0,low:0};function Bse(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Rse;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,Dse),d=Gn.encode(f.x,Ose);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=Rse;p.longitude=-D.PI,p.latitude=0,p.height=0;let _=s.project(p,Dse);d=Gn.encode(_.x,Ose),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.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 un&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Be({defines:c,sources:[o]})}function mW(){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(mW.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 Mse(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)/V.distance(t,e)}var d3e=[new V,new V,new V,new V];function kse(e,t){let n=d3e,i=V.unpack(t,0,n[0]),o=V.unpack(t,2,n[1]),r=V.unpack(t,4,n[2]);e.uMaxVmax=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Mse(i,o,r),a=1/Mse(i,r,o);e.uvMinAndExtents=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Use=new fe,zse=new h,h3e=new h,m3e=new h,KV={high:0,low:0};function Vse(e,t,n){let i=Use;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,zse);i.latitude=e.north;let r=t.project(i,h3e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,m3e),a=[0,0,0,0],c=[0,0,0,0],u=Gn.encode(o.x,KV);a[0]=u.high,c[0]=u.low,u=Gn.encode(o.y,KV),a[1]=u.high,c[1]=u.low,u=Gn.encode(r.y,KV),a[2]=u.high,c[2]=u.low,u=Gn.encode(s.x,KV),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var p3e=new M,_3e=new M,Lse=new h,g3e=new fe,y3e=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function b3e(e,t,n,i,o,r){let s=ae.center(e,g3e);s.height=n;let a=fe.toCartesian(s,t,Lse),c=At.eastNorthUpToFixedFrame(a,t,p3e),u=M.inverse(c,_3e),f=e.west,d=e.east,p=e.north,_=e.south,m=y3e;m[0].latitude=_,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=_,m[3].longitude=d;let y=(f+d)*.5,b=(p+_)*.5;m[4].latitude=_,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=d;let x=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){m[P].height=n;let O=fe.toCartesian(m[P],t,Lse);M.multiplyByPoint(u,O,O),O.z=0,x=Math.min(x,O.x),T=Math.max(T,O.x),C=Math.min(C,O.y),A=Math.max(A,O.y)}let S=i;S.x=x,S.y=C,S.z=0,M.multiplyByPoint(c,S,S);let w=o;w.x=T,w.y=C,w.z=0,M.multiplyByPoint(c,w,w),h.subtract(w,S,o);let R=r;R.x=x,R.y=A,R.z=0,M.multiplyByPoint(c,R,R),h.subtract(R,S,r)}var x3e=new h,T3e=new h,C3e=new Gn;Qf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=zse,s=x3e,a=T3e;b3e(e,n,o??0,r,s,a);let c={};kse(c,t);let u=Gn.fromCartesian(r,C3e);return c.southWest_HIGH=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Vse(e,i,c),c};var A3e=new h;function Nse(e,t,n,i){let o=Use;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,A3e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=D.fastApproximateAtan2(s,r.z),c=D.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Fse=new V;Qf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Nse(e.south,e.west,n,Fse),r=o.x,s=o.y,a=Nse(e.north,e.east,n,Fse),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),r-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-s),p=1/(c-r),_={sphericalExtents:new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new Ic({componentDatatype:K.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return kse(_,t),Vse(e,i,_),_};Qf.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)};Qf.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 E3e(e){return Math.max(e.width,e.height)>Qf.MAX_WIDTH_FOR_PLANAR_EXTENTS}Qf.shouldUseSphericalCoordinates=function(e){return E3e(e)};Qf.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Uu=Qf;var S3e={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},Vn=Object.freeze(S3e);var v3e={ZERO:q.ZERO,KEEP:q.KEEP,REPLACE:q.REPLACE,INCREMENT:q.INCR,DECREMENT:q.DECR,INVERT:q.INVERT,INCREMENT_WRAP:q.INCR_WRAP,DECREMENT_WRAP:q.DECR_WRAP},ht=Object.freeze(v3e);var $V={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};$V.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:$V.CESIUM_3D_TILE_MASK,mask:$V.CESIUM_3D_TILE_MASK}};var jt=Object.freeze($V);function Ex(e){e=e??G.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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(Ex.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}}});Ex.isSupported=function(e){return e.context.stencilBuffer};function TE(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}function _W(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}}var w3e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function I3e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(TE(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(TE(o,!0)),e._rsColorPass=ze.fromCache(_W(o,!1)),e._rsPickPass=ze.fromCache(w3e)}function P3e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Be.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function D3e(e,t){let n=t.context,i=e._primitive,o=gR;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pn._appendDistanceDisplayConditionToShader(i,o),o=Pn._modifyShaderPosition(e,o,t.scene3DOnly),o=Pn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=P3e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Be({defines:[a],sources:[o]}),u=new Be({sources:[ky]}),f=e._primitive._attributeLocations,d=new Uu(s,r,e.appearance);if(e._spStencil=Xt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Be.createPickVertexShaderSource(o);m=Pn._appendShowToShader(i,m),m=Pn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Xt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f}),s){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(x)){let T=d.createPickFragmentShader(!0),C=d.createPickVertexShader([a],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=x}}else e._spPick=Xt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Pn._appendShowToShader(i,o),c=new Be({defines:[a],sources:[o]}),e._sp=Xt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),_=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Xt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:_,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),b=d.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function R3e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let _=n._va[a++];r=t[o],l(r)||(r=t[o]=new qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Se.TERRAIN_CLASSIFICATION,s=qe.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Se.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=ct(c,y._uniforms)),r.uniformMap=c,s=qe.shallowClone(r,r.derivedCommands.tileset),s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=qe.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=qe.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let _=0;_<i;++_){let m=f[_]=qe.shallowClone(t[p],f[_]);m.shaderProgram=d,m.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function O3e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),_=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[d++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=qe.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=qe.shallowClone(u,u.derivedCommands.tileset),f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,_){let y=qe.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=qe.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function M3e(e,t,n,i,o,r,s){R3e(e,r),O3e(e,s)}function Hse(e,t){return Math.floor(e%t/2)}function pW(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Gse(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function L3e(e,t,n,i,o,r,s,a){let c=e._primitive;Pn._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN,_=t.passes,m,y,b;if(_.render){let x=n.length;for(m=0;m<x;++m)y=u[Hse(m,x)],d&&(b=n[m],pW(b,t,o,r,y,s)),p&&(b=n[m].derivedCommands.tileset,pW(b,t,o,r,y,s));if(t.invertClassification){let T=e._commandsIgnoreShow,C=T.length;for(m=0;m<C;++m)y=u[m],b=T[m],pW(b,t,o,r,y,s)}}if(_.pick){let x=i.length,T=c._pickOffsets;for(m=0;m<x;++m){let C=T[Hse(m,x)];y=u[C.index],d&&(b=i[m],Gse(b,t,o,r,y)),p&&(b=i[m].derivedCommands.tileset,Gse(b,t,o,r,y))}}}Ex.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,d,p=!1,_=!1;for(r>0&&(c=o[0].attributes,p=Uu.hasAttributesForSphericalExtents(c),_=Uu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Yt.equals(d,y)}if(!f&&!p&&!_)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new un({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!_,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=_,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new It({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,b){n._createBoundingVolumeFunction(y,b)}),i._createRenderStatesFunction=function(y,b,x,T){I3e(n,b)},i._createShaderProgramFunction=function(y,b,x){D3e(n,b)},i._createCommandsFunction=function(y,b,x,T,C,A,S){M3e(n,void 0,void 0,!0,!1,A,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,b,x,T,C,A,S,w){n._updateAndQueueCommandsFunction(y,b,x,T,C,A,S,w)}:i._updateAndQueueCommandsFunction=function(y,b,x,T,C,A,S,w){L3e(n,b,x,T,C,A,S,w)},this._primitive=new Pn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(TE(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(TE(!1,!0)),this._rsColorPass=ze.fromCache(_W(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(TE(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(TE(!0,!0)),this._rsColorPass=ze.fromCache(_W(!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))})};Ex.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ex.prototype.isDestroyed=function(){return!1};Ex.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,ce(this)};var CE=Ex;var N3e={u_globeMinimumAltitude:function(){return 55e3}};function eu(e){e=e??G.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 un({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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=hi._defaultMaxTerrainHeight,this._minTerrainHeight=hi._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:N3e}}Object.defineProperties(eu.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}}});eu.isSupported=CE.isSupported;function jse(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Wse(e){return function(t,n){return e._minHeight}}var F3e=new h,B3e=new h,k3e=new h,U3e=new fe,z3e=new ae;function ZV(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=h.unpack(i,d,F3e),_=h.unpack(o,d,B3e),m=h.add(p,_,k3e),y=n.cartesianToCartographic(m,U3e),b=y.latitude,x=y.longitude;s=Math.min(s,b),a=Math.min(a,x),c=Math.max(c,b),u=Math.max(u,x)}let f=z3e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function V3e(e,t,n){let i=hi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function H3e(e,t,n){let i=t.mapProjection.ellipsoid,o=ZV(t,n),r=In.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=re.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function gW(e,t){return Math.floor(e%t/2)}function yW(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.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 qse(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.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 G3e(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==zn.CESIUM_3D_TILE,d=u!==zn.TERRAIN,p=t.passes,_=e._primitive,m,y,b;if(p.render){let x=n.length;for(m=0;m<x;++m)y=c[gW(m,x)],f&&(b=n[m],yW(e,b,t,o,r,y,s)),d&&(b=n[m].derivedCommands.tileset,yW(e,b,t,o,r,y,s));if(t.invertClassification){let T=_._commandsIgnoreShow,C=T.length;for(m=0;m<C;++m)y=c[m],b=T[m],yW(e,b,t,o,r,y,s)}}if(p.pick){let x=i.length,T;for(e._useFragmentCulling||(T=_._primitive._pickOffsets),m=0;m<x;++m){if(y=c[gW(m,x)],!e._useFragmentCulling){let C=T[gW(m,x)];y=c[C.index]}f&&(b=i[m],qse(e,b,t,o,r,y)),d&&(b=i[m].derivedCommands.tileset,qse(e,b,t,o,r,y))}}}eu.initializeTerrainHeights=function(){return hi.initialize()};eu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!hi.initialized){eu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){o=a[f],r=o.geometry;let y=ZV(e,r);l(d)?l(y)&&ae.union(d,y,d):d=ae.clone(y);let b=o.id;if(l(b)&&l(y)){let x=hi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(x)}s=r.constructor,!l(s)||l(s.createShadowVolume)}V3e(this,d,i);let p=e.verticalExaggeration,_=e.verticalExaggerationRelativeHeight;this._minHeight=Or.getHeight(this._minTerrainHeight,p,_),this._maxHeight=Or.getHeight(this._maxTerrainHeight,p,_);let m=eu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,d=ZV(e,r),Uu.shouldUseSphericalCoordinates(d)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let x=ZV(e,r),T=r.textureCoordinateRotationPoints;b?y=Uu.getPlanarTextureCoordinateAttributes(x,T,i,e.mapProjection,this._maxHeight):y=Uu.getSphericalExtentGeometryInstanceAttributes(x,T,i,e.mapProjection);let C=o.attributes;for(let A in C)C.hasOwnProperty(A)&&(y[A]=C[A]);u[f]=new It({geometry:s.createShadowVolume(r,Wse(this),jse(this)),attributes:y,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new It({geometry:s.createShadowVolume(r,Wse(this),jse(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,b){H3e(t,y,b)},n._updateAndQueueCommandsFunction=function(y,b,x,T,C,A,S,w){G3e(t,b,x,T,C,A,S,w)},this._primitive=new CE(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))})};eu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};eu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};eu.prototype.isDestroyed=function(){return!1};eu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};eu._supportsMaterials=function(e){return e.depthTexture};eu.supportsMaterials=function(e){return eu._supportsMaterials(e.frameState.context)};var cl=eu;function AE(){he.throwInstantiationError()}Object.defineProperties(AE.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});AE.prototype.getType=he.throwInstantiationError;AE.prototype.getValue=he.throwInstantiationError;AE.prototype.equals=he.throwInstantiationError;var j3e=new $;AE.getValue=function(e,t,n){let i;return l(e)||(e=$.now(j3e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=$i.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==$i.ColorType)&&(n=$i.fromType($i.ColorType)),H.clone(H.WHITE,n.uniforms.color),n)};var sr=AE;function Sx(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}Sx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Sx.prototype._setOptions=he.throwInstantiationError;Sx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Wt,d,p=t._getIsClosed(c);if(f)d=new un({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let _=sr.getValue(e,u,this._material);this._material=_,d=new ho({material:_,translucent:_.isTranslucent(),closed:p})}if(n)c.vertexFormat=un.VERTEX_FORMAT,this._primitive=o.add(new cl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let _=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=_.attributes.color.value[3]!==255),this._primitive=i.add(new Pn({geometryInstances:_,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Pn({geometryInstances:u,appearance:new un({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Sx.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))?(re.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(re.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};Sx.prototype.isDestroyed=function(){return!1};Sx.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),ce(this)};var ri=Sx;var Yse={};function CR(e,t){l(Yse[e])||(Yse[e]=!0,console.warn(t??e))}CR.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.";CR.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";CR.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";CR.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var bt=CR;var W3e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},h_=Object.freeze(W3e);var q3e={NONE:0,GEODESIC:1,RHUMB:2},tn=Object.freeze(q3e);var Xse=D.EPSILON10;function Y3e(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Xse)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(d=i.length)),a=c);return n&&t(e[0],e[r-1],Xse)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var So=Y3e;function X3e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),d=c*s,p=d*d,_=1-p,m=Math.sqrt(_),y=t/4,b=y*y,x=b*y,T=b*b,C=1+y-3*b/4+5*x/4-175*T/64,A=1-y+15*b/8-35*x/8,S=1-3*y+35*b/4,w=1-5*y,R=C*f-A*Math.sin(2*f)*y/2-S*Math.sin(4*f)*b/16-w*Math.sin(6*f)*x/48-Math.sin(8*f)*5*T/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=c,P.sineU=u,P.sigma=f,P.sineAlpha=d,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=_,P.cosineAlpha=m,P.u2Over4=y,P.u4Over16=b,P.u6Over64=x,P.u8Over256=T,P.a0=C,P.a1=A,P.a2=S,P.a3=w,P.distanceRatio=R}function K3e(e,t){return e*t*(4+e*(4-3*t))/16}function Kse(e,t,n,i,o,r,s){let a=K3e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function $3e(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),_=Math.cos(f),m=Math.sin(f),y=d*_,b=d*m,x=p*m,T=p*_,C=c,A=D.TWO_PI,S=Math.cos(C),w=Math.sin(C),R,P,O,L,g;do{S=Math.cos(C),w=Math.sin(C);let B=b-T*S;O=Math.sqrt(_*_*w*w+B*B),P=x+y*S,R=Math.atan2(O,P);let j;O===0?(j=0,L=1):(j=y*w/O,L=1-j*j),A=C,g=P-2*x/L,isFinite(g)||(g=0),C=c+Kse(a,j,L,R,O,P,g)}while(Math.abs(C-A)>D.EPSILON12);let E=L*(t*t-n*n)/(n*n),v=1+E*(4096+E*(E*(320-175*E)-768))/16384,I=E*(256+E*(E*(74-47*E)-128))/1024,N=g*g,F=I*O*(g+I*(P*(2*N-1)-I*g*(4*O*O-3)*(4*N-3)/6)/4),U=n*v*(R-F),k=Math.atan2(_*w,b-T*S),z=Math.atan2(d*w,b*S-T);e._distance=U,e._startHeading=k,e._endHeading=z,e._uSquared=E}var Z3e=new h,bW=new h;function $se(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,bW),Z3e),r=h.normalize(i.cartographicToCartesian(n,bW),bW);$3e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,X3e(e)}function AR(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&$se(this,e,t,i)}Object.defineProperties(AR.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}}});AR.prototype.setEndPoints=function(e,t){$se(this,e,t,this._ellipsoid)};AR.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};AR.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,_=n.u8Over256,m=n.u2Over4,y=n.u6Over64,b=n.u4Over16,x=2*p*_*o/3+i*(1-m+7*b/4-15*y/4+579*_/64-(b-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*r-29*_*s/16)+(m/2-b+71*y/32-85*_/16)*a+(5*b/16-5*y/4+383*_/96)*c-d*((y-11*_/2)*a+5*_*c/2)+(29*y/96-29*_/16)*u+539*_*f/1536,T=Math.asin(Math.sin(x)*n.cosineAlpha),C=Math.atan(n.a/n.b*Math.tan(T));x=x-n.sigma;let A=Math.cos(2*n.sigma+x),S=Math.sin(x),w=Math.cos(x),R=n.cosineU*w,P=n.sineU*S,L=Math.atan2(S*n.sineHeading,R-P*n.cosineHeading)-Kse(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,S,w,A);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=C,t.height=0,t):new fe(this._start.longitude+L,C,0)};var m_=AR;function TW(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),_=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*_-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function Q3e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,_=p*c,m=Math.sin(2*i),y=Math.cos(2*i),b=Math.sin(4*i),x=Math.cos(4*i),T=Math.sin(6*i),C=Math.cos(6*i),A=Math.sin(8*i),S=Math.cos(8*i),w=Math.sin(10*i),R=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*_/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*_/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*_/1048576)*x+(151*i*d/4096+4681*i*p/65536+1479*i*_/16384-453*r*_/32768)*C+(1097*i*p/65536+42783*i*_/1048576)*S+8011*i*_/1048576*R+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*_/1048576-471*o*_/8192+9*s*_/4096)*m+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*_/16777216-12517*o*_/131072+7*s*_/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*_/786432-8607*o*_/131072)*T+(1097*d/131072+1097*p/65536+225797*_/10485760-1097*o*_/65536)*A+(8011*p/2621440+8011*_/1048576)*w+293393*_/251658240*P}function EE(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function J3e(e,t,n,i,o){let r=EE(e._ellipticity,n),s=EE(e._ellipticity,o);return Math.atan2(D.negativePiToPi(i-t),s-r)}function eke(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(o)*D.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=TW(e._ellipticity,t,o);u=(TW(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var tke=new h,xW=new h;function Zse(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,xW),tke),r=h.normalize(i.cartographicToCartesian(n,xW),xW),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=J3e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=eke(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Qse(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=TW(o,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=Q3e(p,o,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let _=EE(o,e.latitude),m=EE(o,c);u=Math.tan(t)*(m-_),a=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function p_(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Zse(this,e,t,i)}Object.defineProperties(p_.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}}});p_.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=Qse(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new p_(e,d,r):(o.setEndPoints(e,d),o)};p_.prototype.setEndPoints=function(e,t){Zse(this,e,t,this._ellipsoid)};p_.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};p_.prototype.interpolateUsingSurfaceDistance=function(e,t){return Qse(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};p_.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(D.PI_OVER_TWO-o)<=D.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-o),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,r.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),_=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(_/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};p_.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let r=EE(n,o.latitude),s=EE(n,e),a=Math.tan(i)*(s-r),c=D.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var Qa=p_;var PW=[Mi,Li],nke=PW.length,yae=Math.cos(D.toRadians(30)),Jse=Math.cos(D.toRadians(150)),bae=0,xae=1e3;function zy(e){e=e??G.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??tn.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(zy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});zy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<nke;i++)if(t instanceof PW[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var ike=new h,eae=new h,tae=new h;function IW(e,t,n,i,o){let r=ll(i,e,0,ike),s=ll(i,e,n,eae),a=ll(i,t,0,tae),c=__(s,r,eae),u=__(a,r,tae);return h.cross(u,c,o),h.normalize(o,o)}var oke=new fe,rke=new h,ske=new h,ake=new h;function CW(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let d;r===tn.GEODESIC?d=new m_(e,t,s):r===tn.RHUMB&&(d=new Qa(e,t,s));let p=d.surfaceDistance;if(p<o)return;let _=IW(e,t,i,s,ake),m=Math.ceil(p/o),y=p/m,b=y,x=m-1,T=a.length;for(let C=0;C<x;C++){let A=d.interpolateUsingSurfaceDistance(b,oke),S=ll(s,A,n,rke),w=ll(s,A,i,ske);h.pack(_,a,T),h.pack(S,c,T),h.pack(w,u,T),f.push(A.latitude),f.push(A.longitude),T+=3,b+=y}}var AW=new fe;function ll(e,t,n,i){return fe.clone(t,AW),AW.height=n,fe.toCartesian(AW,e,i)}zy.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];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};zy.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]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new zy({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function __(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function nae(e,t,n,i){return i=__(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var cke=new h,lke=new h,uke=new h,Tae=new h,fke=0,dke=-1;function EW(e,t,n,i,o){let r=__(n,t,Tae),s=nae(e,t,r,cke),a=nae(i,t,r,lke);if(D.equalsEpsilon(h.dot(s,a),dke,D.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,uke);return h.dot(a,c)<fke&&(o=h.negate(o,o)),o}var t4=en.fromPointNormal(h.ZERO,h.UNIT_Y),hke=new h,mke=new h,pke=new h,_ke=new h,gke=new h,QV=new h,JV=new fe,iae=new fe,oae=new fe;zy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new PW[e._projectionIndex](i),a=bae,c=xae,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let _,m,y,b,x=new Qa(void 0,void 0,i),T,C,A,S=[d[0]];for(f=0;f<p-1;f++)_=d[f],m=d[f+1],T=ti.lineSegmentPlane(_,m,t4,QV),l(T)&&!h.equalsEpsilon(T,_,D.EPSILON7)&&!h.equalsEpsilon(T,m,D.EPSILON7)&&(e.arcType===tn.GEODESIC?S.push(h.clone(T)):e.arcType===tn.RHUMB&&(A=i.cartesianToCartographic(T,JV).longitude,y=i.cartesianToCartographic(_,JV),b=i.cartesianToCartographic(m,iae),x.setEndPoints(y,b),C=x.findIntersectionWithLongitude(A,oae),T=i.cartographicToCartesian(C,QV),l(T)&&!h.equalsEpsilon(T,_,D.EPSILON7)&&!h.equalsEpsilon(T,m,D.EPSILON7)&&S.push(h.clone(T)))),S.push(m);n&&(_=d[p-1],m=d[0],T=ti.lineSegmentPlane(_,m,t4,QV),l(T)&&!h.equalsEpsilon(T,_,D.EPSILON7)&&!h.equalsEpsilon(T,m,D.EPSILON7)&&(e.arcType===tn.GEODESIC?S.push(h.clone(T)):e.arcType===tn.RHUMB&&(A=i.cartesianToCartographic(T,JV).longitude,y=i.cartesianToCartographic(_,JV),b=i.cartesianToCartographic(m,iae),x.setEndPoints(y,b),C=x.findIntersectionWithLongitude(A,oae),T=i.cartographicToCartesian(C,QV),l(T)&&!h.equalsEpsilon(T,_,D.EPSILON7)&&!h.equalsEpsilon(T,m,D.EPSILON7)&&S.push(h.clone(T)))));let w=S.length,R=new Array(w);for(f=0;f<w;f++){let W=fe.fromCartesian(S[f],i);W.height=0,R[f]=W}if(R=So(R,fe.equalsEpsilon),w=R.length,w<2)return;let P=[],O=[],L=[],g=[],E=hke,v=mke,I=pke,N=_ke,F=gke,U=R[0],k=R[1],z=R[w-1];for(E=ll(i,z,a,E),N=ll(i,k,a,N),v=ll(i,U,a,v),I=ll(i,U,c,I),n?F=EW(E,v,I,N,F):F=IW(U,k,c,i,F),h.pack(F,O,0),h.pack(v,L,0),h.pack(I,g,0),P.push(U.latitude),P.push(U.longitude),CW(U,k,a,c,o,r,i,O,L,g,P),f=1;f<w-1;++f){E=h.clone(v,E),v=h.clone(N,v);let W=R[f];ll(i,W,c,I),ll(i,R[f+1],a,N),EW(E,v,I,N,F),u=O.length,h.pack(F,O,u),h.pack(v,L,u),h.pack(I,g,u),P.push(W.latitude),P.push(W.longitude),CW(R[f],R[f+1],a,c,o,r,i,O,L,g,P)}let B=R[w-1],j=R[w-2];if(v=ll(i,B,a,v),I=ll(i,B,c,I),n){let W=R[0];E=ll(i,j,a,E),N=ll(i,W,a,N),F=EW(E,v,I,N,F)}else F=IW(j,B,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(v,L,u),h.pack(I,g,u),P.push(B.latitude),P.push(B.longitude),n){for(CW(B,U,a,c,o,r,i,O,L,g,P),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],g[u+f]=g[f];P.push(U.latitude),P.push(U.longitude)}return Gke(n,s,L,g,O,P,t)};var yke=new h,bke=new Z,xke=new Pe;function rae(e,t,n,i){let o=__(n,t,yke),r=h.dot(o,e);if(r>yae||r<Jse){let s=__(i,n,Tae),a=r<Jse?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Pe.fromAxisAngle(s,a,xke),u=Z.fromQuaternion(c,bke);return Z.multiplyByVector(u,e,e),!0}return!1}var sae=new fe,Tke=new h,aae=new h;function ER(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,Tke),s=h.add(r,n,aae),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,sae);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,aae),u=c.cartesianToCartographic(s,sae)),u.height=0;let f=e.project(u,o);return o=h.subtract(f,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var Cke=new h,cae=new h;function lae(e,t,n,i,o,r){let s=h.subtract(t,e,Cke);h.normalize(s,s);let a=n-bae,c=h.multiplyByScalar(s,a,cae);h.add(e,c,o);let u=i-xae;c=h.multiplyByScalar(s,u,cae),h.add(t,c,r)}var Ake=new h;function e4(e,t){let n=en.getPointDistance(t4,e),i=en.getPointDistance(t4,t),o=Ake;D.equalsEpsilon(n,0,D.EPSILON2)?(o=__(t,e,o),h.multiplyByScalar(o,D.EPSILON2,o),h.add(e,o,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(o=__(e,t,o),h.multiplyByScalar(o,D.EPSILON2,o),h.add(t,o,t))}function Eke(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let o=D.sign(t.longitude);return e.longitude=o*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let o=D.sign(e.longitude);return t.longitude=o*(i-D.EPSILON11),2}return 0}var Cae=new fe,Aae=new fe,uae=new h,SW=new h,fae=new h,dae=new h,Ske=new h,hae=new h,vke=[Cae,Aae],wke=new ae,Ike=new h,Pke=new h,Dke=new h,Rke=new h,Oke=new h,Mke=new h,vW=new h,wW=new h,Lke=new h,Nke=new h,Fke=new h,mae=new h,Bke=new h,kke=new h,Uke=new Gn,zke=new Gn,pae=new h,Vke=new h,_ae=new h,Hke=[new re,new re],Eae=[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],gae=Eae.length;function Gke(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,_=f*36,m=d>65535?new Uint32Array(_):new Uint16Array(_),y=new Float64Array(d*3),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),S,w,R,P;s&&(S=new Float32Array(p),w=new Float32Array(p),R=new Float32Array(p),P=new Float32Array(d*2));let O=r.length/2,L=0,g=Cae;g.height=0;let E=Aae;E.height=0;let v=uae,I=SW;if(s)for(c=0,a=1;a<O;a++)g.latitude=r[c],g.longitude=r[c+1],E.latitude=r[c+2],E.longitude=r[c+3],v=t.project(g,v),I=t.project(E,I),L+=h.distance(v,I),c+=2;let N=i.length/3;I=h.unpack(i,0,I);let F=0;for(c=3,a=1;a<N;a++)v=h.clone(I,v),I=h.unpack(i,c,I),F+=h.distance(v,I),c+=3;let U;c=3;let k=0,z=0,B=0,j=0,W=!1,J=h.unpack(n,0,dae),Y=h.unpack(i,0,SW),ee=h.unpack(o,0,hae);if(e){let Te=h.unpack(n,n.length-6,fae);rae(ee,Te,J,Y)&&(ee=h.negate(ee,ee))}let Q=0,de=0,ge=0;for(a=0;a<f;a++){let Te=h.clone(J,fae),ve=h.clone(Y,uae),Ve=h.clone(ee,Ske);W&&(Ve=h.negate(Ve,Ve)),J=h.unpack(n,c,dae),Y=h.unpack(i,c,SW),ee=h.unpack(o,c,hae),W=rae(ee,Te,J,Y),g.latitude=r[k],g.longitude=r[k+1],E.latitude=r[k+2],E.longitude=r[k+3];let $e,Ct,Jt,Qe;if(s){let xi=Eke(g,E);$e=t.project(g,Oke),Ct=t.project(E,Mke);let Ta=__(Ct,$e,pae);Ta.y=Math.abs(Ta.y),Jt=vW,Qe=wW,xi===0||h.dot(Ta,h.UNIT_Y)>yae?(Jt=ER(t,g,Ve,$e,vW),Qe=ER(t,E,ee,Ct,wW)):xi===1?(Qe=ER(t,E,ee,Ct,wW),Jt.x=0,Jt.y=D.sign(g.longitude-Math.abs(E.longitude)),Jt.z=0):(Jt=ER(t,g,Ve,$e,vW),Qe.x=0,Qe.y=D.sign(g.longitude-E.longitude),Qe.z=0)}let mn=h.distance(ve,Y),Bt=Gn.fromCartesian(Te,Uke),Ot=h.subtract(J,Te,Lke),Jn=h.normalize(Ot,mae),bi=h.subtract(ve,Te,Nke);bi=h.normalize(bi,bi);let Gt=h.cross(Jn,bi,mae);Gt=h.normalize(Gt,Gt);let Pt=h.cross(bi,Ve,Bke);Pt=h.normalize(Pt,Pt);let oo=h.subtract(Y,J,Fke);oo=h.normalize(oo,oo);let xt=h.cross(ee,oo,kke);xt=h.normalize(xt,xt);let Jo=mn/F,vr=Q/F,mc=0,Ur,Ms,Ue,ot=0,Ye=0;if(s){mc=h.distance($e,Ct),Ur=Gn.fromCartesian($e,zke),Ms=h.subtract(Ct,$e,pae),Ue=h.normalize(Ms,Vke);let xi=Ue.x;Ue.x=Ue.y,Ue.y=-xi,ot=mc/L,Ye=de/L}for(U=0;U<8;U++){let xi=j+U*4,Ta=z+U*2,rs=xi+3,jl=U<4?1:-1,Ao=U===2||U===3||U===6||U===7?1:-1;h.pack(Bt.high,b,xi),b[rs]=Ot.x,h.pack(Bt.low,x,xi),x[rs]=Ot.y,h.pack(Pt,T,xi),T[rs]=Ot.z,h.pack(xt,C,xi),C[rs]=Jo*jl,h.pack(Gt,A,xi);let zr=vr*Ao;zr===0&&Ao<0&&(zr=9),A[rs]=zr,s&&(S[xi]=Ur.high.x,S[xi+1]=Ur.high.y,S[xi+2]=Ur.low.x,S[xi+3]=Ur.low.y,R[xi]=-Jt.y,R[xi+1]=Jt.x,R[xi+2]=Qe.y,R[xi+3]=-Qe.x,w[xi]=Ms.x,w[xi+1]=Ms.y,w[xi+2]=Ue.x,w[xi+3]=Ue.y,P[Ta]=ot*jl,zr=Ye*Ao,zr===0&&Ao<0&&(zr=9),P[Ta+1]=zr)}let Ze=Dke,pt=Rke,qt=Ike,An=Pke,Bo=ae.fromCartographicArray(vke,wke),wo=hi.getMinimumMaximumHeights(Bo,u),pc=wo.minimumTerrainHeight,_c=wo.maximumTerrainHeight;ge+=Math.abs(pc),ge+=Math.abs(_c),lae(Te,ve,pc,_c,Ze,qt),lae(J,Y,pc,_c,pt,An);let Ii=h.multiplyByScalar(Gt,D.EPSILON5,_ae);h.add(Ze,Ii,Ze),h.add(pt,Ii,pt),h.add(qt,Ii,qt),h.add(An,Ii,An),e4(Ze,pt),e4(qt,An),h.pack(Ze,y,B),h.pack(pt,y,B+3),h.pack(An,y,B+6),h.pack(qt,y,B+9),Ii=h.multiplyByScalar(Gt,-2*D.EPSILON5,_ae),h.add(Ze,Ii,Ze),h.add(pt,Ii,pt),h.add(qt,Ii,qt),h.add(An,Ii,An),e4(Ze,pt),e4(qt,An),h.pack(Ze,y,B+12),h.pack(pt,y,B+15),h.pack(An,y,B+18),h.pack(qt,y,B+21),k+=2,c+=3,z+=16,B+=24,j+=32,Q+=mn,de+=mc}c=0;let le=0;for(a=0;a<f;a++){for(U=0;U<gae;U++)m[c+U]=Eae[U]+le;le+=8,c+=gae}let ye=Hke;re.fromVertices(n,h.ZERO,3,ye[0]),re.fromVertices(i,h.ZERO,3,ye[1]);let xe=re.fromBoundingSpheres(ye);xe.radius+=ge/(f*2);let Ie={position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Uy(b),startLoAndForwardOffsetY:Uy(x),startNormalAndForwardOffsetZ:Uy(T),endNormalAndTextureCoordinateNormalizationX:Uy(C),rightNormalAndTextureCoordinateNormalizationY:Uy(A)};return s&&(Ie.startHiLo2D=Uy(S),Ie.offsetAndRight2D=Uy(w),Ie.startEndNormals2D=Uy(R),Ie.texcoordNormalization2D=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new lt({attributes:Ie,indices:m,boundingSphere:xe})}function Uy(e){return new we({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}zy._projectNormal=ER;var vx=zy;var SR=`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 vR=`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 wR=`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 IR=`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 PR=`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 zu=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var DW=`${zu} -${PR}`,jke=Tx;Nt.isInternetExplorer()||(DW=`#define CLIP_POLYLINE -${DW}`);function wx(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=wx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??DW,this._fragmentShaderSource=e.fragmentShaderSource??jke,this._renderState=co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(wx.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}}});wx.VERTEX_FORMAT=De.POSITION_ONLY;wx.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;wx.prototype.isTranslucent=co.prototype.isTranslucent;wx.prototype.getRenderState=co.prototype.getRenderState;var ls=wx;var DR=`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 Ix=`#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 RW=`${zu} -${DR}`,Wke=Ix;Nt.isInternetExplorer()||(RW=`#define CLIP_POLYLINE -${RW}`);function Px(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Px.VERTEX_FORMAT;this.material=l(e.material)?e.material:$i.fromType($i.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??RW,this._fragmentShaderSource=e.fragmentShaderSource??Wke,this._renderState=co.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Px.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}}});Px.VERTEX_FORMAT=De.POSITION_AND_ST;Px.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;Px.prototype.isTranslucent=co.prototype.isTranslucent;Px.prototype.getRenderState=co.prototype.getRenderState;var wa=Px;function g_(e){e=e??G.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new wa),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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=Sae(!1),this._renderState3DTiles=Sae(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Ai.FRONT},depthTest:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(g_.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}}});g_.initializeTerrainHeights=function(){return hi.initialize()};function qke(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(IR);s=Pn._appendShowToShader(o,s),s=Pn._appendDistanceDisplayConditionToShader(o,s),s=Pn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(wR);a=Pn._appendShowToShader(o,a),a=Pn._appendDistanceDisplayConditionToShader(o,a),a=Pn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(SR),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],_=new Be({defines:u,sources:[s]}),m=new Be({defines:p,sources:[d,c]});e._sp=Xt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let x=new Be({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let x=new Be({defines:u.concat([`MAX_TERRAIN_HEIGHT ${hi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(vR);let T=new Be({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=b}function Sae(e){return ze.fromCache({cull:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})}function Yke(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof ls?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],_=o[d];l(_)||(_=o[d]=new qe({owner:e,primitiveType:s._primitiveType})),_.vertexArray=p,_.renderState=e._renderState,_.shaderProgram=e._sp,_.uniformMap=f,_.pass=Se.TERRAIN_CLASSIFICATION,_.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=qe.shallowClone(_,_.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=m;let y=qe.shallowClone(_,_.derivedCommands.color2D);y.shaderProgram=e._sp2D,_.derivedCommands.color2D=y;let b=qe.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let x=qe.shallowClone(_,_.derivedCommands.colorMorph);x.renderState=e._renderStateMorph,x.shaderProgram=e._spMorph,x.pickId="czm_batchTable_pickColor(v_batchId)",_.derivedCommands.colorMorph=x}}function vae(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Xke(e,t,n,i,o,r,s){let a=e._primitive;Pn._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN&&!u,_,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let b=0;b<y;++b){let x=c[b];d&&(_=n[b],vae(e,_,t,o,r,x,s)),p&&(_=n[b].derivedCommands.tileset,vae(e,_,t,o,r,x,s))}}}g_.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!hi.initialized){g_.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Ic({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,vx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new It({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){qke(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,_,m){Yke(n,u,f,d,_,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,_,m,y){Xke(n,u,f,d,p,_,m)},this._primitive=new Pn(i)}if(this.appearance instanceof ls&&!this._hasPerInstanceColors)throw new he("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))})};g_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};g_.isSupported=function(e){return e.frameState.context.depthTexture};g_.prototype.isDestroyed=function(){return!1};g_.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,ce(this)};var dh=g_;var Kke=new V(1,1),$ke=!1,Zke=H.WHITE;function SE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(SE.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});SE.prototype.getType=function(e){return"Image"};var Qke=new $;SE.prototype.getValue=function(e,t){return l(e)||(e=$.now(Qke)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,Kke,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,Zke,t.color),X.getValueOrDefault(this._transparent,e,$ke)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};SE.prototype.equals=function(e){return this===e||e instanceof SE&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Vy=SE;function Jke(e){if(e instanceof H)return new Wt(e);if(typeof e=="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Vy;return t.image=e,t}}function eUe(e,t){return ue(e,t,Jke)}var zo=eUe;function RR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(RR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});RR.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 RR(this)};RR.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 Dx=RR;var tUe={FIXED:0,INERTIAL:1},Gi=Object.freeze(tUe);function vE(){he.throwInstantiationError()}Object.defineProperties(vE.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});vE.prototype.getValue=he.throwInstantiationError;vE.prototype.getValueInReferenceFrame=he.throwInstantiationError;vE.prototype.equals=he.throwInstantiationError;var wae=new Z;vE.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=At.computeIcrfToCentralBodyFixedMatrix(e,wae);if(n===Gi.INERTIAL)return Z.multiplyByVector(r,t,o);if(n===Gi.FIXED)return Z.multiplyByVector(Z.transpose(r,wae),t,o)};var hh=vE;function Rx(e,t){this._definitionChanged=new me,this._value=h.clone(e),this._referenceFrame=t??Gi.FIXED}Object.defineProperties(Rx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Gi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var nUe=new $;Rx.prototype.getValue=function(e,t){return l(e)||(e=$.now(nUe)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};Rx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Rx.prototype.getValueInReferenceFrame=function(e,t,n){return hh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Rx.prototype.equals=function(e){return this===e||e instanceof Rx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var ul=Rx;function OR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(OR.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:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});OR.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 OR(this)};OR.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 Ox=OR;function iUe(e){return e}function oUe(e,t){return ue(e,t,iUe)}var fl=oUe;function MR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(MR.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:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});MR.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 MR(this)};MR.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 Mx=MR;function LR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(LR.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:zo("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")});LR.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 LR(this)};LR.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 Lx=LR;function NR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(NR.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:zo("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")});NR.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 NR(this)};NR.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 Nx=NR;function FR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(FR.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")});FR.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 FR(this)};FR.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 mh=FR;var rUe=new h(1,1,1),sUe=h.ZERO,aUe=Pe.IDENTITY;function Iae(e,t,n){this.translation=h.clone(e??sUe),this.rotation=Pe.clone(t??aUe),this.scale=h.clone(n??rUe)}Iae.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Pe.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Hy=Iae;var OW=new Hy;function BR(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(BR.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var cUe=new $;BR.prototype.getValue=function(e,t){return l(e)||(e=$.now(cUe)),l(t)||(t=new Hy),t.translation=X.getValueOrClonedDefault(this._translation,e,OW.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,OW.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,OW.scale,t.scale),t};BR.prototype.equals=function(e){return this===e||e instanceof BR&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var Fx=BR;function y_(e,t){this._propertyNames=[],this._definitionChanged=new me,l(e)&&this.merge(e,t)}Object.defineProperties(y_.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});y_.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function lUe(e){return new Qn(e)}y_.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ue(e,!0,n??lUe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};y_.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var uUe=new $;y_.prototype.getValue=function(e,t){l(e)||(e=$.now(uUe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=X.getValueOrUndefined(this[r],e,t[r])}return t};y_.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 fUe(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||!X.equals(e[s],t[s]))return!1}return!0}y_.prototype.equals=function(e){return this===e||e instanceof y_&&fUe(this,e)};var dl=y_;function Pae(e){return new Fx(e)}function dUe(e){return new dl(e,Pae)}function hUe(e){return new dl(e)}function mUe(e){return new dl(e)}function kR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??G.EMPTY_OBJECT)}Object.defineProperties(kR.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,mUe),lightColor:ue("lightColor"),distanceDisplayCondition:ue("distanceDisplayCondition"),nodeTransformations:ue("nodeTransformations",void 0,dUe),articulations:ue("articulations",void 0,hUe),clippingPlanes:ue("clippingPlanes"),customShader:ue("customShader")});kR.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 kR(this)};kR.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 dl(t,Pae)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new dl(n)}};var b_=kR;function UR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(UR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),maximumScreenSpaceError:ue("maximumScreenSpaceError")});UR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new UR(this)};UR.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Bx=UR;function zR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(zR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),leadTime:ue("leadTime"),trailTime:ue("trailTime"),width:ue("width"),resolution:ue("resolution"),material:zo("material"),distanceDisplayCondition:ue("distanceDisplayCondition")});zR.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 zR(this)};zR.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 x_=zR;function VR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(VR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),plane:ue("plane"),dimensions:ue("dimensions"),fill:ue("fill"),material:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});VR.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 VR(this)};VR.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 HR=VR;function GR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(GR.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")});GR.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 GR(this)};GR.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var kx=GR;function pUe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Ja=pUe;function _Ue(e){return Array.isArray(e)&&(e=new Ja(e)),new Qn(e)}function jR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(jR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),hierarchy:ue("hierarchy",void 0,_Ue),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:zo("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")});jR.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 jR(this)};jR.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 ph=jR;function WR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(WR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),granularity:ue("granularity"),material:zo("material"),depthFailMaterial:zo("depthFailMaterial"),arcType:ue("arcType"),clampToGround:ue("clampToGround"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});WR.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 WR(this)};WR.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 Pc=WR;function qR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(qR.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:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});qR.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 qR(this)};qR.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 Ux=qR;function YR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(YR.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:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});YR.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 YR(this)};YR.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 _h=YR;function XR(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(XR.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:zo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});XR.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 XR(this)};XR.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 T_=XR;var gUe=new fe,MW=[];function yUe(e){return new ul(e)}function bUe(e){return ue(e,void 0,yUe)}function na(e,t){return ue(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Jf(e){e=e??G.EMPTY_OBJECT;let t=e.id;l(t)||(t=Ln()),this._availability=void 0,this._id=t,this._definitionChanged=new me,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??h_.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",...MW],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 LW(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)&&LW(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Jf.prototype,{availability:fl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:fl("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&&LW(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:fl("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&&LW(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:na("billboard",vc),box:na("box",Dx),corridor:na("corridor",Ox),cylinder:na("cylinder",Mx),description:ue("description"),ellipse:na("ellipse",Lx),ellipsoid:na("ellipsoid",Nx),label:na("label",mh),model:na("model",b_),tileset:na("tileset",Bx),orientation:ue("orientation"),path:na("path",x_),plane:na("plane",HR),point:na("point",kx),polygon:na("polygon",ph),polyline:na("polyline",Pc),polylineVolume:na("polylineVolume",Ux),properties:na("properties",dl),position:bUe("position"),rectangle:na("rectangle",_h),viewFrom:ue("viewFrom"),wall:na("wall",T_)});Jf.registerEntityType=function(e,t){Object.defineProperties(Jf.prototype,{[e]:na(e,t)}),MW.includes(e)||MW.push(e)};Jf.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Jf.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,fl(e,!0))};Jf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Jf.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 Dae=new Z,Rae=new h,Oae=new Pe;Jf.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,Rae);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,Oae);return l(i)?t=M.fromRotationTranslation(Z.fromQuaternion(i,Dae),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};Jf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=X.getValueOrDefault(t,e,Ke.NONE),s=X.getValueOrUndefined(this._position,e,Rae);if(r===Ke.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,gUe);Zf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,Oae);return l(c)?o=M.fromRotationTranslation(Z.fromQuaternion(c,Dae),s,o):o=At.eastNorthUpToFixedFrame(s,void 0,o),o};Jf.supportsMaterialsforEntitiesOnTerrain=function(e){return cl.supportsMaterials(e)};Jf.supportsPolylinesOnTerrain=function(e){return dh.isSupported(e)};var ar=Jf;var xUe=new Wt(H.WHITE),TUe=new Qn(!0),CUe=new Qn(!0),AUe=new Qn(!1),EUe=new Qn(H.BLACK),SUe=new Qn(xn.DISABLED),vUe=new Qn(new Rt),wUe=new Qn(zn.BOTH);function hl(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 me,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=ar.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(hl.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)&&X.isConstant(this._showProperty)&&X.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)&&X.isConstant(this._showProperty)&&X.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}}});hl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};hl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};hl.prototype.createFillGeometryInstance=he.throwInstantiationError;hl.prototype.createOutlineGeometryInstance=he.throwInstantiationError;hl.prototype.isDestroyed=function(){return!1};hl.prototype.destroy=function(){ce(this)};hl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};hl.prototype._isOnTerrain=function(e,t){return!1};hl.prototype._getIsClosed=function(e){return!0};hl.prototype._isDynamic=he.throwInstantiationError;hl.prototype._setStaticOptions=he.throwInstantiationError;hl.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(Ge.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ge.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??xUe,this._fillProperty=r??CUe,this._showProperty=u??TUe,this._showOutlineProperty=o.outline??AUe,this._outlineColorProperty=c?o.outlineColor??EUe:void 0,this._shadowsProperty=o.shadows??SUe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??vUe,this._classificationTypeProperty=o.classificationType??wUe,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Wt);if(c&&f&&(bt(bt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};hl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var si=hl;function wE(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(wE.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var IUe=new $;wE.prototype.getValue=function(e,t){return l(e)||(e=$.now(IUe)),this._callback(e,t)};wE.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};wE.prototype.equals=function(e){return this===e||e instanceof wE&&this._callback===e._callback&&this._isConstant===e._isConstant};var gh=wE;var Mae=new h;function IE(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new fe,this._normal=new h,this._definitionChanged=new me,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(Ge.MINIMUM_VALUE,Mae);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(IE.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});IE.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.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 PUe=new $;IE.prototype.getValue=function(e,t){l(e)||(e=$.now(PUe));let n=X.getValueOrDefault(this._heightReference,e,Ke.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,Ke.NONE);if(n===Ke.NONE&&!pE(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Mae);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,D.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};IE.prototype.isDestroyed=function(){return!1};IE.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ce(this)};var zx=IE;function DUe(e,t,n,i){if(si.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 gh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new zx(this._scene,s,r)}}var C_=DUe;var Lae=h.ZERO,Nae=new h,RUe=new h,Fae=new H;function OUe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Vu(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new OUe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Vu.prototype=Object.create(si.prototype),Vu.prototype.constructor=Vu);Object.defineProperties(Vu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Vu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Fae)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Lae,Nae))),new It({id:t,geometry:Ka.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Vu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Fae),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Lae,Nae))),new It({id:t,geometry:fh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Vu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Vu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||si.prototype._isHidden.call(this,e,t)};Vu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Vu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ke.NONE?an.ALL:void 0};Vu.prototype._onEntityPropertyChanged=C_;Vu.DynamicGeometryUpdater=PE;function PE(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(PE.prototype=Object.create(ri.prototype),PE.prototype.constructor=PE);PE.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,RUe),o=this._options.dimensions;return!l(i)||!l(o)||ri.prototype._isHidden.call(this,e,t,n)};PE.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.dimensions=X.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ke.NONE?an.ALL:void 0};var KR=Vu;function Vx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Gi.FIXED,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(Vx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var MUe=new $;Vx.prototype.getValue=function(e,t){return l(e)||(e=$.now(MUe)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};Vx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Vx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return hh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Vx.prototype.equals=function(e){return this===e||e instanceof Vx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var $R=Vx;/*! @license DOMPurify 3.2.6 | (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.6/LICENSE */var{entries:qae,setPrototypeOf:Bae,isFrozen:LUe,getPrototypeOf:NUe,getOwnPropertyDescriptor:FUe}=Object,{freeze:pl,seal:ed,create:Yae}=Object,{apply:zW,construct:VW}=typeof Reflect<"u"&&Reflect;pl||(pl=function(t){return t});ed||(ed=function(t){return t});zW||(zW=function(t,n,i){return t.apply(n,i)});VW||(VW=function(t,n){return new t(...n)});var n4=_l(Array.prototype.forEach),BUe=_l(Array.prototype.lastIndexOf),kae=_l(Array.prototype.pop),ZR=_l(Array.prototype.push),kUe=_l(Array.prototype.splice),o4=_l(String.prototype.toLowerCase),NW=_l(String.prototype.toString),Uae=_l(String.prototype.match),QR=_l(String.prototype.replace),UUe=_l(String.prototype.indexOf),zUe=_l(String.prototype.trim),yh=_l(Object.prototype.hasOwnProperty),ml=_l(RegExp.prototype.test),JR=VUe(TypeError);function _l(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return zW(e,t,i)}}function VUe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return VW(e,n)}}function Ni(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o4;Bae&&Bae(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(LUe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function HUe(e){for(let t=0;t<e.length;t++)yh(e,t)||(e[t]=null);return e}function A_(e){let t=Yae(null);for(let[n,i]of qae(e))yh(e,n)&&(Array.isArray(i)?t[n]=HUe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=A_(i):t[n]=i);return t}function eO(e,t){for(;e!==null;){let i=FUe(e,t);if(i){if(i.get)return _l(i.get);if(typeof i.value=="function")return _l(i.value)}e=NUe(e)}function n(){return null}return n}var zae=pl(["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"]),FW=pl(["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"]),BW=pl(["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"]),GUe=pl(["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"]),kW=pl(["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"]),jUe=pl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vae=pl(["#text"]),Hae=pl(["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"]),UW=pl(["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"]),Gae=pl(["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"]),i4=pl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),WUe=ed(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qUe=ed(/<%[\w\W]*|[\w\W]*%>/gm),YUe=ed(/\$\{[\w\W]*/gm),XUe=ed(/^data-[\-\w.\u00B7-\uFFFF]+$/),KUe=ed(/^aria-[\-\w]+$/),Xae=ed(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$Ue=ed(/^(?:\w+script|data):/i),ZUe=ed(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kae=ed(/^html$/i),QUe=ed(/^[a-z][.\w]*(-[.\w]+)+$/i),jae=Object.freeze({__proto__:null,ARIA_ATTR:KUe,ATTR_WHITESPACE:ZUe,CUSTOM_ELEMENT:QUe,DATA_ATTR:XUe,DOCTYPE_NAME:Kae,ERB_EXPR:qUe,IS_ALLOWED_URI:Xae,IS_SCRIPT_OR_DATA:$Ue,MUSTACHE_EXPR:WUe,TMPLIT_EXPR:YUe}),tO={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},JUe=function(){return typeof window>"u"?null:window},eze=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}},Wae=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function $ae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JUe(),t=ln=>$ae(ln);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==tO.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:_}=e,m=c.prototype,y=eO(m,"cloneNode"),b=eO(m,"remove"),x=eO(m,"nextSibling"),T=eO(m,"childNodes"),C=eO(m,"parentNode");if(typeof s=="function"){let ln=n.createElement("template");ln.content&&ln.content.ownerDocument&&(n=ln.content.ownerDocument)}let A,S="",{implementation:w,createNodeIterator:R,createDocumentFragment:P,getElementsByTagName:O}=n,{importNode:L}=i,g=Wae();t.isSupported=typeof qae=="function"&&typeof C=="function"&&w&&w.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:E,ERB_EXPR:v,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:z}=jae,{IS_ALLOWED_URI:B}=jae,j=null,W=Ni({},[...zae,...FW,...BW,...kW,...Vae]),J=null,Y=Ni({},[...Hae,...UW,...Gae,...i4]),ee=Object.seal(Yae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,ge=!0,le=!0,ye=!1,xe=!0,Ie=!1,Te=!0,ve=!1,Ve=!1,$e=!1,Ct=!1,Jt=!1,Qe=!1,mn=!0,Bt=!1,Ot="user-content-",Jn=!0,bi=!1,Gt={},Pt=null,oo=Ni({},["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"]),xt=null,Jo=Ni({},["audio","video","img","source","image","track"]),vr=null,mc=Ni({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",Ms="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml",ot=Ue,Ye=!1,Ze=null,pt=Ni({},[Ur,Ms,Ue],NW),qt=Ni({},["mi","mo","mn","ms","mtext"]),An=Ni({},["annotation-xml"]),Bo=Ni({},["title","style","font","a","script"]),wo=null,pc=["application/xhtml+xml","text/html"],_c="text/html",Ii=null,xi=null,Ta=n.createElement("form"),rs=function(Ae){return Ae instanceof RegExp||Ae instanceof Function},jl=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xi&&xi===Ae)){if((!Ae||typeof Ae!="object")&&(Ae={}),Ae=A_(Ae),wo=pc.indexOf(Ae.PARSER_MEDIA_TYPE)===-1?_c:Ae.PARSER_MEDIA_TYPE,Ii=wo==="application/xhtml+xml"?NW:o4,j=yh(Ae,"ALLOWED_TAGS")?Ni({},Ae.ALLOWED_TAGS,Ii):W,J=yh(Ae,"ALLOWED_ATTR")?Ni({},Ae.ALLOWED_ATTR,Ii):Y,Ze=yh(Ae,"ALLOWED_NAMESPACES")?Ni({},Ae.ALLOWED_NAMESPACES,NW):pt,vr=yh(Ae,"ADD_URI_SAFE_ATTR")?Ni(A_(mc),Ae.ADD_URI_SAFE_ATTR,Ii):mc,xt=yh(Ae,"ADD_DATA_URI_TAGS")?Ni(A_(Jo),Ae.ADD_DATA_URI_TAGS,Ii):Jo,Pt=yh(Ae,"FORBID_CONTENTS")?Ni({},Ae.FORBID_CONTENTS,Ii):oo,Q=yh(Ae,"FORBID_TAGS")?Ni({},Ae.FORBID_TAGS,Ii):A_({}),de=yh(Ae,"FORBID_ATTR")?Ni({},Ae.FORBID_ATTR,Ii):A_({}),Gt=yh(Ae,"USE_PROFILES")?Ae.USE_PROFILES:!1,ge=Ae.ALLOW_ARIA_ATTR!==!1,le=Ae.ALLOW_DATA_ATTR!==!1,ye=Ae.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=Ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Ae.SAFE_FOR_TEMPLATES||!1,Te=Ae.SAFE_FOR_XML!==!1,ve=Ae.WHOLE_DOCUMENT||!1,Ct=Ae.RETURN_DOM||!1,Jt=Ae.RETURN_DOM_FRAGMENT||!1,Qe=Ae.RETURN_TRUSTED_TYPE||!1,$e=Ae.FORCE_BODY||!1,mn=Ae.SANITIZE_DOM!==!1,Bt=Ae.SANITIZE_NAMED_PROPS||!1,Jn=Ae.KEEP_CONTENT!==!1,bi=Ae.IN_PLACE||!1,B=Ae.ALLOWED_URI_REGEXP||Xae,ot=Ae.NAMESPACE||Ue,qt=Ae.MATHML_TEXT_INTEGRATION_POINTS||qt,An=Ae.HTML_INTEGRATION_POINTS||An,ee=Ae.CUSTOM_ELEMENT_HANDLING||{},Ae.CUSTOM_ELEMENT_HANDLING&&rs(Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&rs(Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&typeof Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(le=!1),Jt&&(Ct=!0),Gt&&(j=Ni({},Vae),J=[],Gt.html===!0&&(Ni(j,zae),Ni(J,Hae)),Gt.svg===!0&&(Ni(j,FW),Ni(J,UW),Ni(J,i4)),Gt.svgFilters===!0&&(Ni(j,BW),Ni(J,UW),Ni(J,i4)),Gt.mathMl===!0&&(Ni(j,kW),Ni(J,Gae),Ni(J,i4))),Ae.ADD_TAGS&&(j===W&&(j=A_(j)),Ni(j,Ae.ADD_TAGS,Ii)),Ae.ADD_ATTR&&(J===Y&&(J=A_(J)),Ni(J,Ae.ADD_ATTR,Ii)),Ae.ADD_URI_SAFE_ATTR&&Ni(vr,Ae.ADD_URI_SAFE_ATTR,Ii),Ae.FORBID_CONTENTS&&(Pt===oo&&(Pt=A_(Pt)),Ni(Pt,Ae.FORBID_CONTENTS,Ii)),Jn&&(j["#text"]=!0),ve&&Ni(j,["html","head","body"]),j.table&&(Ni(j,["tbody"]),delete Q.tbody),Ae.TRUSTED_TYPES_POLICY){if(typeof Ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw JR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw JR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=Ae.TRUSTED_TYPES_POLICY,S=A.createHTML("")}else A===void 0&&(A=eze(_,o)),A!==null&&typeof S=="string"&&(S=A.createHTML(""));pl&&pl(Ae),xi=Ae}},Ao=Ni({},[...FW,...BW,...GUe]),zr=Ni({},[...kW,...jUe]),Yp=function(Ae){let St=C(Ae);(!St||!St.tagName)&&(St={namespaceURI:ot,tagName:"template"});let gn=o4(Ae.tagName),wr=o4(St.tagName);return Ze[Ae.namespaceURI]?Ae.namespaceURI===Ms?St.namespaceURI===Ue?gn==="svg":St.namespaceURI===Ur?gn==="svg"&&(wr==="annotation-xml"||qt[wr]):!!Ao[gn]:Ae.namespaceURI===Ur?St.namespaceURI===Ue?gn==="math":St.namespaceURI===Ms?gn==="math"&&An[wr]:!!zr[gn]:Ae.namespaceURI===Ue?St.namespaceURI===Ms&&!An[wr]||St.namespaceURI===Ur&&!qt[wr]?!1:!zr[gn]&&(Bo[gn]||!Ao[gn]):!!(wo==="application/xhtml+xml"&&Ze[Ae.namespaceURI]):!1},ss=function(Ae){ZR(t.removed,{element:Ae});try{C(Ae).removeChild(Ae)}catch{b(Ae)}},Wl=function(Ae,St){try{ZR(t.removed,{attribute:St.getAttributeNode(Ae),from:St})}catch{ZR(t.removed,{attribute:null,from:St})}if(St.removeAttribute(Ae),Ae==="is")if(Ct||Jt)try{ss(St)}catch{}else try{St.setAttribute(Ae,"")}catch{}},gc=function(Ae){let St=null,gn=null;if($e)Ae="<remove></remove>"+Ae;else{let Ks=Uae(Ae,/^[\r\n\t ]+/);gn=Ks&&Ks[0]}wo==="application/xhtml+xml"&&ot===Ue&&(Ae='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ae+"</body></html>");let wr=A?A.createHTML(Ae):Ae;if(ot===Ue)try{St=new p().parseFromString(wr,wo)}catch{}if(!St||!St.documentElement){St=w.createDocument(ot,"template",null);try{St.documentElement.innerHTML=Ye?S:wr}catch{}}let yc=St.body||St.documentElement;return Ae&&gn&&yc.insertBefore(n.createTextNode(gn),yc.childNodes[0]||null),ot===Ue?O.call(St,ve?"html":"body")[0]:ve?St.documentElement:yc},jb=function(Ae){return R.call(Ae.ownerDocument||Ae,Ae,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ca=function(Ae){return Ae instanceof d&&(typeof Ae.nodeName!="string"||typeof Ae.textContent!="string"||typeof Ae.removeChild!="function"||!(Ae.attributes instanceof f)||typeof Ae.removeAttribute!="function"||typeof Ae.setAttribute!="function"||typeof Ae.namespaceURI!="string"||typeof Ae.insertBefore!="function"||typeof Ae.hasChildNodes!="function")},ql=function(Ae){return typeof a=="function"&&Ae instanceof a};function tl(ln,Ae,St){n4(ln,gn=>{gn.call(t,Ae,St,xi)})}let xs=function(Ae){let St=null;if(tl(g.beforeSanitizeElements,Ae,null),Ca(Ae))return ss(Ae),!0;let gn=Ii(Ae.nodeName);if(tl(g.uponSanitizeElement,Ae,{tagName:gn,allowedTags:j}),Te&&Ae.hasChildNodes()&&!ql(Ae.firstElementChild)&&ml(/<[/\w!]/g,Ae.innerHTML)&&ml(/<[/\w!]/g,Ae.textContent)||Ae.nodeType===tO.progressingInstruction||Te&&Ae.nodeType===tO.comment&&ml(/<[/\w]/g,Ae.data))return ss(Ae),!0;if(!j[gn]||Q[gn]){if(!Q[gn]&&kf(gn)&&(ee.tagNameCheck instanceof RegExp&&ml(ee.tagNameCheck,gn)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(gn)))return!1;if(Jn&&!Pt[gn]){let wr=C(Ae)||Ae.parentNode,yc=T(Ae)||Ae.childNodes;if(yc&&wr){let Ks=yc.length;for(let Yl=Ks-1;Yl>=0;--Yl){let Xp=y(yc[Yl],!0);Xp.__removalCount=(Ae.__removalCount||0)+1,wr.insertBefore(Xp,x(Ae))}}}return ss(Ae),!0}return Ae instanceof c&&!Yp(Ae)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&ml(/<\/no(script|embed|frames)/i,Ae.innerHTML)?(ss(Ae),!0):(Ie&&Ae.nodeType===tO.text&&(St=Ae.textContent,n4([E,v,I],wr=>{St=QR(St,wr," ")}),Ae.textContent!==St&&(ZR(t.removed,{element:Ae.cloneNode()}),Ae.textContent=St)),tl(g.afterSanitizeElements,Ae,null),!1)},Bf=function(Ae,St,gn){if(mn&&(St==="id"||St==="name")&&(gn in n||gn in Ta))return!1;if(!(le&&!de[St]&&ml(N,St))){if(!(ge&&ml(F,St))){if(!J[St]||de[St]){if(!(kf(Ae)&&(ee.tagNameCheck instanceof RegExp&&ml(ee.tagNameCheck,Ae)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Ae))&&(ee.attributeNameCheck instanceof RegExp&&ml(ee.attributeNameCheck,St)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(St))||St==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&ml(ee.tagNameCheck,gn)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(gn))))return!1}else if(!vr[St]){if(!ml(B,QR(gn,k,""))){if(!((St==="src"||St==="xlink:href"||St==="href")&&Ae!=="script"&&UUe(gn,"data:")===0&&xt[Ae])){if(!(ye&&!ml(U,QR(gn,k,"")))){if(gn)return!1}}}}}}return!0},kf=function(Ae){return Ae!=="annotation-xml"&&Uae(Ae,z)},Uf=function(Ae){tl(g.beforeSanitizeAttributes,Ae,null);let{attributes:St}=Ae;if(!St||Ca(Ae))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},wr=St.length;for(;wr--;){let yc=St[wr],{name:Ks,namespaceURI:Yl,value:Xp}=yc,mI=Ii(Ks),m9=Xp,bc=Ks==="value"?m9:zUe(m9);if(gn.attrName=mI,gn.attrValue=bc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,tl(g.uponSanitizeAttribute,Ae,gn),bc=gn.attrValue,Bt&&(mI==="id"||mI==="name")&&(Wl(Ks,Ae),bc=Ot+bc),Te&&ml(/((--!?|])>)|<\/(style|title)/i,bc)){Wl(Ks,Ae);continue}if(gn.forceKeepAttr)continue;if(!gn.keepAttr){Wl(Ks,Ae);continue}if(!xe&&ml(/\/>/i,bc)){Wl(Ks,Ae);continue}Ie&&n4([E,v,I],Qte=>{bc=QR(bc,Qte," ")});let Zte=Ii(Ae.nodeName);if(!Bf(Zte,mI,bc)){Wl(Ks,Ae);continue}if(A&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!Yl)switch(_.getAttributeType(Zte,mI)){case"TrustedHTML":{bc=A.createHTML(bc);break}case"TrustedScriptURL":{bc=A.createScriptURL(bc);break}}if(bc!==m9)try{Yl?Ae.setAttributeNS(Yl,Ks,bc):Ae.setAttribute(Ks,bc),Ca(Ae)?ss(Ae):kae(t.removed)}catch{Wl(Ks,Ae)}}tl(g.afterSanitizeAttributes,Ae,null)},Wo=function ln(Ae){let St=null,gn=jb(Ae);for(tl(g.beforeSanitizeShadowDOM,Ae,null);St=gn.nextNode();)tl(g.uponSanitizeShadowNode,St,null),xs(St),Uf(St),St.content instanceof r&&ln(St.content);tl(g.afterSanitizeShadowDOM,Ae,null)};return t.sanitize=function(ln){let Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},St=null,gn=null,wr=null,yc=null;if(Ye=!ln,Ye&&(ln="<!-->"),typeof ln!="string"&&!ql(ln))if(typeof ln.toString=="function"){if(ln=ln.toString(),typeof ln!="string")throw JR("dirty is not a string, aborting")}else throw JR("toString is not a function");if(!t.isSupported)return ln;if(Ve||jl(Ae),t.removed=[],typeof ln=="string"&&(bi=!1),bi){if(ln.nodeName){let Xp=Ii(ln.nodeName);if(!j[Xp]||Q[Xp])throw JR("root node is forbidden and cannot be sanitized in-place")}}else if(ln instanceof a)St=gc("<!---->"),gn=St.ownerDocument.importNode(ln,!0),gn.nodeType===tO.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?St=gn:St.appendChild(gn);else{if(!Ct&&!Ie&&!ve&&ln.indexOf("<")===-1)return A&&Qe?A.createHTML(ln):ln;if(St=gc(ln),!St)return Ct?null:Qe?S:""}St&&$e&&ss(St.firstChild);let Ks=jb(bi?ln:St);for(;wr=Ks.nextNode();)xs(wr),Uf(wr),wr.content instanceof r&&Wo(wr.content);if(bi)return ln;if(Ct){if(Jt)for(yc=P.call(St.ownerDocument);St.firstChild;)yc.appendChild(St.firstChild);else yc=St;return(J.shadowroot||J.shadowrootmode)&&(yc=L.call(i,yc,!0)),yc}let Yl=ve?St.outerHTML:St.innerHTML;return ve&&j["!doctype"]&&St.ownerDocument&&St.ownerDocument.doctype&&St.ownerDocument.doctype.name&&ml(Kae,St.ownerDocument.doctype.name)&&(Yl="<!DOCTYPE "+St.ownerDocument.doctype.name+`> -`+Yl),Ie&&n4([E,v,I],Xp=>{Yl=QR(Yl,Xp," ")}),A&&Qe?A.createHTML(Yl):Yl},t.setConfig=function(){let ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jl(ln),Ve=!0},t.clearConfig=function(){xi=null,Ve=!1},t.isValidAttribute=function(ln,Ae,St){xi||jl({});let gn=Ii(ln),wr=Ii(Ae);return Bf(gn,wr,St)},t.addHook=function(ln,Ae){typeof Ae=="function"&&ZR(g[ln],Ae)},t.removeHook=function(ln,Ae){if(Ae!==void 0){let St=BUe(g[ln],Ae);return St===-1?void 0:kUe(g[ln],St,1)[0]}return kae(g[ln])},t.removeHooks=function(ln){g[ln]=[]},t.removeAllHooks=function(){g=Wae()},t}var Zae=$ae();var tze=0,HW={};function zm(e,t){let n,i=e;l(HW[i])?n=HW[i]:(n=tze++,HW[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(zm.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=Zae.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}}});zm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};zm.prototype.equals=function(e){return zm.equals(this,e)};zm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};zm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new zm(e.html,t)};zm.clone=function(e){if(l(e))return new zm(e.html,e.showOnScreen)};var _t=zm;function nze(e,t){bt(e,t)}var Po=nze;function Hx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new me}Object.defineProperties(Hx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Hx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function GW(e){e._cubeMapBuffers=void 0}Hx.prototype.update=function(e){let{context:t}=e;if(!Hx.isSupported(t))return;if(l(this._texture)){GW(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(GW(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Qs(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT);let o=je.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(or.FaceName).forEach(d=>{f[d]=void 0});for(let d=r;d<a;d++)n.push(f)}let c=new zt({minificationFilter:ft.LINEAR_MIPMAP_LINEAR}),u=new or({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Hx.prototype.isDestroyed=function(){return!1};Hx.prototype.destroy=function(){return GW(this),this._texture=this._texture&&this._texture.destroy(),ce(this)};var bh=Hx;function nO(e){e=e??G.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?V.clone(e.imageBasedLightingFactor):new V(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=V.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(nO.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=V.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 ize(e,t){if(bh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new bh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}nO.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;V.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=V.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&&(ize(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)};nO.prototype.isDestroyed=function(){return!1};nO.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ce(this)};var Gx=nO;var WW=er(Ru(),1);var jW,Qae="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",r4={};r4.defaultAccessToken=Qae;r4.defaultServer=new Ee({url:"https://api.cesium.com/"});r4.getDefaultTokenCredit=function(e){if(e===Qae){if(!l(jW)){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>`;jW=new _t(t,!0)}return jW}};var xh=r4;function gl(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:oze};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new se("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ee.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new WW.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)&&(gl.prototype=Object.create(Ee.prototype),gl.prototype.constructor=gl);gl.fromAssetId=function(e,t){let n=gl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new gl(i,n)})};Object.defineProperties(gl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=gl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});gl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(_t.getIonCredit),i=xh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(_t.clone(i)),n};gl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new gl(t._ionEndpoint,t._ionEndpointResource)),e=Ee.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};gl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ee.prototype.fetchImage.call(this,e)};gl.prototype._makeRequest=function(e){return this._isExternal||new WW.default(this.url).authority()!==this._ionEndpointDomain?Ee.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),Ee.prototype._makeRequest.call(this,e))};gl._createEndpointResource=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.server??xh.defaultServer,i=t.accessToken??xh.defaultAccessToken;n=Ee.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function oze(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 Hu=gl;function Vm(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Vm.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}}});Vm.prototype.get=function(e){return this._array[e]};Vm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Vm.prototype.peek=function(){return this._array[this._length-1]};Vm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Vm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Vm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Vm.prototype.resize=function(e){this.length=e};Vm.prototype.trim=function(e){e=e??this._length,this._array.length=e};var yl=Vm;var E_={X:0,Y:1,Z:2};E_.Y_UP_TO_Z_UP=M.fromRotationTranslation(Z.fromArray([1,0,0,0,0,1,0,-1,0]));E_.Z_UP_TO_Y_UP=M.fromRotationTranslation(Z.fromArray([1,0,0,0,0,-1,0,1,0]));E_.X_UP_TO_Z_UP=M.fromRotationTranslation(Z.fromArray([0,0,1,0,1,0,-1,0,0]));E_.Z_UP_TO_X_UP=M.fromRotationTranslation(Z.fromArray([0,0,-1,0,1,0,1,0,0]));E_.X_UP_TO_Y_UP=M.fromRotationTranslation(Z.fromArray([0,1,0,-1,0,0,0,0,1]));E_.Y_UP_TO_X_UP=M.fromRotationTranslation(Z.fromArray([0,-1,0,1,0,0,0,0,1]));E_.fromName=function(e){return E_[e]};var Vo=Object.freeze(E_);function Jae(e){e=e??G.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Jae.prototype,{metadata:{get:function(){return this._metadata}}});var jx=Jae;function Gy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Gy.decode(e)}Gy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Gy.decodeWithFromCharCode=function(e){let t="",n=rze(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 iO(e,t,n){return t<=e&&e<=n}function rze(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(iO(u,0,127)){s.push(u);continue}if(iO(u,194,223)){i=1,t=u&31;continue}if(iO(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(iO(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new se("String decoding failed.")}if(!iO(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?Gy.decode=Gy.decodeWithTextDecoder:Gy.decode=Gy.decodeWithFromCharCode;var ia=Gy;function sze(e,t){return t=t??0,ia(e,t,Math.min(4,e.length))}var bl=sze;function td(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(td.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 oO=Uint32Array.BYTES_PER_ELEMENT;td.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=oO;let c=a.getUint32(o,!0);if(c!==1)throw new se(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=oO,o+=oO;let u=a.getUint32(o,!0);o+=oO;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let m=0;m<u;++m){let y=bl(s,o),b=a.getUint32(o+oO*2,!0),x=r[y],T=`${f}${m}`,C=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))d[m]=Promise.resolve(x(e,t,C,i,o));else throw new se(`Unknown tile content type, ${y}, inside Composite tile`);o+=b}let p=await Promise.all(d);return new td(e,t,n,p)};td.prototype.hasProperty=function(e,t){return!1};td.prototype.getFeature=function(e){};td.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};td.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};td.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)};td.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var rO=td;function aze(e,t,n){return JSON.parse(ia(e,t,n))}var Ho=aze;function Dc(e){this._id=Ln();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,Lt.maximumTextureSize),r=Math.ceil(t/Lt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new V(o,r),i=new ie(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Dc.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}}});Dc.DEFAULT_COLOR_VALUE=H.WHITE;Dc.DEFAULT_SHOW_VALUE=!0;function ece(e){let t=e._textureDimensions;return t.x*t.y*4}function tce(e){if(!l(e._batchValues)){let t=ece(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function nce(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Dc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=nce(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=tce(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Dc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Dc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var cze=new Array(4);Dc.prototype.setColor=function(e,t){if(H.equals(t,Dc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(cze),i=n[3],o=tce(this),r=e*4,s=nce(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Dc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Dc.prototype.getColor=function(e,t){if(!l(this._batchValues))return H.clone(Dc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return H.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Dc.prototype.getPickColor=function(e){return this._pickIds[e]};function ice(e,t,n){let i=e._textureDimensions;return new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:zt.NEAREST})}function lze(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=ece(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=H.floatToByte(f.red),r[d+1]=H.floatToByte(f.green),r[d+2]=H.floatToByte(f.blue),r[d+3]=H.floatToByte(f.alpha)}e._pickTexture=ice(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function uze(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Dc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&lze(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=ice(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),uze(this))};Dc.prototype.isDestroyed=function(){return!1};Dc.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 ce(this)};var xl=Dc;var fze={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},dze={SCALAR:void 0,VEC2:V,VEC3:h,VEC4:ie,MAT2:ei,MAT3:Z,MAT4:M};function hze(e){let t=e.componentType,n;typeof t=="string"?n=K.fromName(t):n=t;let i=fze[e.type],o=dze[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return K.createArrayBufferView(n,r,s,i*a)}}}var Gu=hze;function S_(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,mze(this,e.extension,e.binaryBody)}Object.defineProperties(S_.prototype,{byteLength:{get:function(){return this._byteLength}}});function mze(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??K.UNSIGNED_SHORT,c.type=rn.SCALAR,r=Gu(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let _;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??K.UNSIGNED_SHORT,u.type=rn.SCALAR,r=Gu(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),_=new Uint16Array(s),d=0,i=0;i<s;++i)_[i]=d,d+=u[i];p+=_.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??K.UNSIGNED_SHORT,f.type=rn.SCALAR,r=Gu(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let x=a[i].length,T=a[i].instances,C=pze(x,T,n);p+=_ze(C),a[i].instances=ct(C,T)}let y=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=y[o],++y[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=_,e._parentIds=f,e._byteLength=p}function pze(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 se("componentType is required.");if(!l(c))throw new se("type is required.");if(!l(n))throw new se(`Property ${o} requires a batch table binary.`);let u=Gu(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function _ze(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var gze=[],yze=[],bze=0;function xze(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=gze;c.length=Math.max(c.length,a);let u=++bze,f=yze;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],_=s[t];for(let m=0;m<p;++m){let y=r[_+m];y!==t&&f.push(y)}}}function Tze(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 sO(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return xze(e,t,n)}else return n(e,t);return Tze(e,t,n)}S_.prototype.hasProperty=function(e,t){let n=sO(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};S_.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};S_.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,sO(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};S_.prototype.getProperty=function(e,t){return sO(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)?Cze(a,s):Fe(a[s],!0)})};function Cze(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}S_.prototype.setProperty=function(e,t,n){let i=sO(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?Aze(u,c,n):u[c]=Fe(n,!0),!0});return l(i)};function Aze(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}S_.prototype.isClass=function(e,t){let n=sO(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};S_.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Wx=S_;var Eze={HIGHLIGHT:0,REPLACE:1,MIX:2},tu=Object.freeze(Eze);var qW=xl.DEFAULT_COLOR_VALUE,YW=xl.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=Sze(n);this._properties=s,this._batchTableHierarchy=vze(this,n,i);let a=rce(t,s,i);this._binaryPropertiesByteLength=wze(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new xl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}vo._deprecationWarning=Po;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 Sze(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Fe(e[n],!0));return t}function vze(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 Wx({extension:i,binaryBody:n})}function rce(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 se("componentType is required.");if(!l(c))throw new se("type is required.");if(!l(n))throw new se(`Property ${o} requires a batch table binary.`);let u=Gu(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function wze(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 rce(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 Ize=new H;vo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(qW),this.setAllShow(YW);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,Ize)??qW:qW,s=l(e.show)?e.show.evaluate(o)??YW:YW;this.setColor(i,r),this.setShow(i,s)}};function Pze(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Dze(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 Pze(i,e)}let n=this._properties[t];if(l(n))return Fe(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)){Dze(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]=Fe(n,!0)};function Rze(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=sce(o,n,!1),s;return Lt.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} -${Rze(i)}${s}`}};function oce(e,t){return e=Be.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function Oze(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function sce(e,t,n){if(!l(t))return oce(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return oce(e,n);let r=o[0],s=o[2];e=Be.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=Oze(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${r} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}vo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=sce(i,t,!0),Lt.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 Mze(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===tu.HIGHLIGHT)return 0;if(n===tu.REPLACE)return 1;if(n===tu.MIX)return D.clamp(i,D.EPSILON4,1)}vo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return ct(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 Mze(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};vo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var jy={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=Lze(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Se.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=Nze(f),f.dirty=!1);let p=d.originalCommand;c!==jy.ALL_OPAQUE&&f.pass!==Se.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Fze(p))),c!==jy.ALL_TRANSLUCENT&&f.pass!==Se.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Bze(p)),a&&(r||(l(d.zback)||(d.zback=Uze(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==Vze(d.stencil))&&(f.renderState.depthMask?d.stencil=zze(p,o._selectionDepth):d.stencil=d.opaque)));let _=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Se.TRANSLUCENT?(c===jy.ALL_OPAQUE&&(n[u]=_),c===jy.ALL_TRANSLUCENT&&(n[u]=m),c===jy.OPAQUE_AND_TRANSLUCENT&&(n[u]=_,n.push(m))):n[u]=p}};function Lze(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?jy.ALL_OPAQUE:t===e.featuresLength?jy.ALL_TRANSLUCENT:jy.OPAQUE_AND_TRANSLUCENT}function Nze(e){let t=qe.shallowClone(e),n=t.pass===Se.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Fze(e){let t=qe.shallowClone(e);return t.pass=Se.TRANSLUCENT,t.renderState=Hze(e.renderState),t}function Bze(e){let t=qe.shallowClone(e);return t.renderState=Gze(e.renderState),t}function kze(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 Uze(e,t){let n=qe.shallowClone(t),i=Fe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ai.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=jt.setCesium3DTileBit(),i.stencilMask=jt.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Fe(t.uniformMap);let o=new V(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=kze(e,t.shaderProgram),n}function zze(e,t){let n=qe.shallowClone(e),i=Fe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=jt.SKIP_LOD_MASK,i.stencilTest.reference=jt.CESIUM_3D_TILE_MASK|t<<jt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=jt.CESIUM_3D_TILE_MASK|jt.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function Vze(e){return(e.renderState.stencilTest.reference&jt.SKIP_LOD_MASK)>>>jt.SKIP_LOD_BIT_SHIFT}function Hze(e){let t=Fe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=fn.ALPHA_BLEND,t.stencilTest=jt.setCesium3DTileBit(),t.stencilMask=jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function Gze(e){let t=Fe(e,!0);return t.stencilTest=jt.setCesium3DTileBit(),t.stencilMask=jt.CESIUM_3D_TILE_MASK,ze.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(),ce(this)};var v_=vo;function jze(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Hm=jze;var DE=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;function nd(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(nd.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 H),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)}}});nd.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};nd.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};nd.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};nd.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};nd.prototype.getPropertyInherited=function(e){return nd.getPropertyInherited(this._content,this._batchId,e)};nd.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};nd.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};nd.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};nd.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var oa=nd;var XW=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)})}},KW=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)})}},nu=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},Wze=new XW;Object.assign(nu,{hooks:Wze,plugins:new KW(nu),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"});nu.max_unop_len=nu.getMaxKeyLen(nu.unary_ops);nu.max_binop_len=nu.getMaxKeyLen(nu.binary_ops);var Wy=e=>new nu(e).parse(),qze=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(nu).filter(e=>!qze.includes(e)&&Wy[e]===void 0).forEach(e=>{Wy[e]=nu[e]});Wy.Jsep=nu;var Yze="ConditionalExpression",Xze={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:Yze,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 :")}})}};Wy.plugins.register(Xze);var Kze={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(Kze);function Th(e,t){this._expression=e,e=cVe(e,t),e=uVe(lVe(e)),Wy.addBinaryOp("=~",0),Wy.addBinaryOp("!~",0);let n;try{n=Wy(e)}catch(i){throw new se(i)}this._runtimeAst=Pi(this,n)}Object.defineProperties(Th.prototype,{expression:{get:function(){return this._expression}}});var Mn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new V],cartesian3Array:[new h],cartesian4Array:[new ie],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new V),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ie),this.cartesian4Array[this.cartesian4Index++]}};Th.prototype.evaluate=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof H&&n instanceof ie?H.fromCartesian4(n,t):n instanceof V||n instanceof h||n instanceof ie?n.clone(t):n};Th.prototype.evaluateColor=function(e,t){Mn.reset();let n=this._runtimeAst.evaluate(e);return H.fromCartesian4(n,t)};Th.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Th.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Th.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var $ze=["!","-","+"],ace=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],aO=/\${(.*?)}/g,Zze=/\\/g,Qze="@#%",Jze=/@#%/g,c4=new H,l4={abs:ra(Math.abs),sqrt:ra(Math.sqrt),cos:ra(Math.cos),sin:ra(Math.sin),tan:ra(Math.tan),acos:ra(Math.acos),asin:ra(Math.asin),atan:ra(Math.atan),radians:ra(D.toRadians),degrees:ra(D.toDegrees),sign:ra(D.sign),floor:ra(Math.floor),ceil:ra(Math.ceil),round:ra(Math.round),exp:ra(Math.exp),exp2:ra(tVe),log:ra(Math.log),log2:ra(nVe),fract:ra(eVe),length:iVe,normalize:oVe},u4={atan2:s4(Math.atan2,!1),pow:s4(Math.pow,!1),min:s4(Math.min,!0),max:s4(Math.max,!0),distance:rVe,dot:sVe,cross:aVe},QW={clamp:cce(D.clamp,!0),mix:cce(D.lerp,!0)};function eVe(e){return e-Math.floor(e)}function tVe(e){return Math.pow(2,e)}function nVe(e){return D.log2(e)}function ra(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof V)return V.fromElements(e(n.x),e(n.y),Mn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Mn.getCartesian3());if(n instanceof ie)return ie.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Mn.getCartesian4());throw new se(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function s4(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof V)return V.fromElements(e(i.x,o),e(i.y,o),Mn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Mn.getCartesian3());if(i instanceof ie)return ie.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Mn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof V&&o instanceof V)return V.fromElements(e(i.x,o.x),e(i.y,o.y),Mn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Mn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Mn.getCartesian4());throw new se(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function cce(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 V&&o instanceof V)return V.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Mn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Mn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Mn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof V&&o instanceof V&&r instanceof V)return V.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Mn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Mn.getCartesian3());if(i instanceof ie&&o instanceof ie&&r instanceof ie)return ie.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Mn.getCartesian4());throw new se(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function iVe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof V)return V.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ie)return ie.magnitude(t);throw new se(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function oVe(e,t){if(typeof t=="number")return 1;if(t instanceof V)return V.normalize(t,Mn.getCartesian2());if(t instanceof h)return h.normalize(t,Mn.getCartesian3());if(t instanceof ie)return ie.normalize(t,Mn.getCartesian4());throw new se(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function rVe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof V&&n instanceof V)return V.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ie&&n instanceof ie)return ie.distance(t,n);throw new se(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function sVe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof V&&n instanceof V)return V.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ie&&n instanceof ie)return ie.dot(t,n);throw new se(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function aVe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Mn.getCartesian3());throw new se(`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,xVe(this)}function cVe(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 lVe(e){return e.replace(Zze,Qze)}function ZW(e){return e.replace(Jze,"\\")}function uVe(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 se("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function fVe(e){let t=typeof e.value;if(e.value===null)return new Et(gt.LITERAL_NULL,null);if(t==="boolean")return new Et(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Et(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Et(gt.VARIABLE_IN_STRING,e.value):new Et(gt.LITERAL_STRING,ZW(e.value))}function dVe(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 se(`${o} is not a function.`);return i===0?o==="test"?new Et(gt.LITERAL_BOOLEAN,!1):new Et(gt.LITERAL_NULL,null):(s=Pi(e,c),a=Pi(e,n[0]),new Et(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Pi(e,c),new Et(gt.FUNCTION_CALL,o,r);throw new se(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Et(gt.LITERAL_COLOR,o);if(r=Pi(e,n[0]),l(n[1])){let c=Pi(e,n[1]);return new Et(gt.LITERAL_COLOR,o,[r,c])}return new Et(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new se(`${o} requires three arguments.`);return r=[Pi(e,n[0]),Pi(e,n[1]),Pi(e,n[2])],new Et(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new se(`${o} requires four arguments.`);return r=[Pi(e,n[0]),Pi(e,n[1]),Pi(e,n[2]),Pi(e,n[3])],new Et(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Pi(e,n[c]);return new Et(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Et(gt.LITERAL_BOOLEAN,!0):new Et(gt.LITERAL_BOOLEAN,!1):(r=Pi(e,n[0]),new Et(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new se(`${o} requires exactly one argument.`);return r=Pi(e,n[0]),new Et(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new se(`${o} does not take any argument.`);return new Et(gt.UNARY,o)}else if(l(l4[o])){if(i!==1)throw new se(`${o} requires exactly one argument.`);return r=Pi(e,n[0]),new Et(gt.UNARY,o,r)}else if(l(u4[o])){if(i!==2)throw new se(`${o} requires exactly two arguments.`);return s=Pi(e,n[0]),a=Pi(e,n[1]),new Et(gt.BINARY,o,s,a)}else if(l(QW[o])){if(i!==3)throw new se(`${o} requires exactly three arguments.`);s=Pi(e,n[0]),a=Pi(e,n[1]);let c=Pi(e,n[2]);return new Et(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Et(gt.LITERAL_BOOLEAN,!1):(r=Pi(e,n[0]),new Et(gt.UNARY,o,r));if(o==="Number")return i===0?new Et(gt.LITERAL_NUMBER,0):(r=Pi(e,n[0]),new Et(gt.UNARY,o,r));if(o==="String")return i===0?new Et(gt.LITERAL_STRING,""):(r=Pi(e,n[0]),new Et(gt.UNARY,o,r));if(o==="regExp")return hVe(e,t)}}throw new se(`Unexpected function call "${o}".`)}function hVe(e,t){let n=t.arguments;if(n.length===0)return new Et(gt.LITERAL_REGEX,new RegExp);let i=Pi(e,n[0]),o;if(n.length>1){let r=Pi(e,n[1]);if($W(i)&&$W(r)){try{o=new RegExp(ZW(String(i._value)),r._value)}catch(s){throw new se(s)}return new Et(gt.LITERAL_REGEX,o)}return new Et(gt.REGEX,i,r)}if($W(i)){try{o=new RegExp(ZW(String(i._value)))}catch(r){throw new se(r)}return new Et(gt.LITERAL_REGEX,o)}return new Et(gt.REGEX,i)}function mVe(e){if(yVe(e.name)){let t=bVe(e.name);return t.substr(0,8)==="tiles3d_"?new Et(gt.BUILTIN_VARIABLE,t):new Et(gt.VARIABLE,t)}else{if(e.name==="NaN")return new Et(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Et(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Et(gt.LITERAL_UNDEFINED,void 0)}throw new se(`${e.name} is not defined.`)}function pVe(e){let t=e.property.name;if(t==="PI")return new Et(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Et(gt.LITERAL_NUMBER,Math.E)}function _Ve(e){if(e.property.name==="POSITIVE_INFINITY")return new Et(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function gVe(e,t){if(t.object.name==="Math")return pVe(t);if(t.object.name==="Number")return _Ve(t);let n,i=Pi(e,t.object);return t.computed?(n=Pi(e,t.property),new Et(gt.MEMBER,"brackets",i,n)):(n=new Et(gt.LITERAL_STRING,t.property.name),new Et(gt.MEMBER,"dot",i,n))}function $W(e){return e._type>=gt.LITERAL_NULL}function yVe(e){return e.substr(0,4)==="czm_"}function bVe(e){return e.substr(4)}function Pi(e,t){let n,i,o,r;if(t.type==="Literal")n=fVe(t);else if(t.type==="CallExpression")n=dVe(e,t);else if(t.type==="Identifier")n=mVe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Pi(e,t.argument);if($ze.indexOf(i)>-1)n=new Et(gt.UNARY,i,s);else throw new se(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Pi(e,t.left),r=Pi(e,t.right),ace.indexOf(i)>-1)n=new Et(gt.BINARY,i,o,r);else throw new se(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Pi(e,t.left),r=Pi(e,t.right),ace.indexOf(i)>-1&&(n=new Et(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Pi(e,t.test);o=Pi(e,t.consequent),r=Pi(e,t.alternate),n=new Et(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=gVe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Pi(e,t.elements[a]);n=new Et(gt.ARRAY,s)}else throw t.type==="Compound"?new se("Provide exactly one expression."):new se("Cannot parse expression.");return n}function xVe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(l4[e._value])&&(e.evaluate=CVe(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(u4[e._value])&&(e.evaluate=AVe(e._value)):e._type===gt.TERNARY?e.evaluate=EVe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=TVe):e.evaluate=e._evaluateLiteral}function TVe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function CVe(e){let t=l4[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function AVe(e){let t=u4[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function EVe(e){let t=QW[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 f4(e,t){if(l(e))return e.getPropertyInherited(t)}Et.prototype._evaluateLiteral=function(){return this._value};Et.prototype._evaluateLiteralColor=function(e){let t=c4,n=this._left;if(this._value==="color")l(n)?n.length>1?(H.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):H.fromCssColorString(n[0].evaluate(e),t):H.fromBytes(255,255,255,255,t);else if(this._value==="rgb")H.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;H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ie.fromColor(t,Mn.getCartesian4())};Et.prototype._evaluateLiteralVector=function(e){let t=Mn.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 V)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof ie)t.push(c.x,c.y,c.z,c.w);else throw new se(`${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 se(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new se(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new se(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return V.fromArray(t,0,Mn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Mn.getCartesian3());if(n==="vec4")return ie.fromArray(t,0,Mn.getCartesian4())};Et.prototype._evaluateLiteralString=function(){return this._value};Et.prototype._evaluateVariableString=function(e){let t=this._value,n=aO.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=f4(e,o);l(r)||(r=""),t=t.replace(i,r),aO.lastIndex+=r.length-i.length,n=aO.exec(t)}return t};Et.prototype._evaluateVariable=function(e){return f4(e,this._value)};function qx(e){return e._value==="feature"}Et.prototype._evaluateMemberDot=function(e){if(qx(this._left))return f4(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof V||t instanceof h||t instanceof ie){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Et.prototype._evaluateMemberBrackets=function(e){if(qx(this._left))return f4(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof V||t instanceof h||t instanceof ie){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};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 se(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Et.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof V)return V.negate(t,Mn.getCartesian2());if(t instanceof h)return h.negate(t,Mn.getCartesian3());if(t instanceof ie)return ie.negate(t,Mn.getCartesian4());if(typeof t=="number")return-t;throw new se(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Et.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof V||t instanceof h||t instanceof ie||typeof t=="number"))throw new se(`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 se(`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 se(`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 se(`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 se(`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 se(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new se(`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 se(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new se(`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 V&&t instanceof V)return V.add(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Mn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.add(t,n,Mn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new se(`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 V&&t instanceof V)return V.subtract(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Mn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.subtract(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new se(`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 V&&t instanceof V)return V.multiplyComponents(t,n,Mn.getCartesian2());if(n instanceof V&&typeof t=="number")return V.multiplyByScalar(n,t,Mn.getCartesian2());if(t instanceof V&&typeof n=="number")return V.multiplyByScalar(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Mn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Mn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Mn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.multiplyComponents(t,n,Mn.getCartesian4());if(n instanceof ie&&typeof t=="number")return ie.multiplyByScalar(n,t,Mn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.multiplyByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new se(`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 V&&t instanceof V)return V.divideComponents(t,n,Mn.getCartesian2());if(t instanceof V&&typeof n=="number")return V.divideByScalar(t,n,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Mn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Mn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.divideComponents(t,n,Mn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.divideByScalar(t,n,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new se(`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 V&&t instanceof V)return V.fromElements(t.x%n.x,t.y%n.y,Mn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Mn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Mn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new se(`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 V&&t instanceof V||n instanceof h&&t instanceof h||n instanceof ie&&t instanceof ie?t.equals(n):t===n};Et.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof V&&t instanceof V||n instanceof h&&t instanceof h||n instanceof ie&&t instanceof ie?!t.equals(n):t!==n};Et.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new se(`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 se(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 se(`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 se(`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 se(`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 se(`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 V||t instanceof h||t instanceof ie)return String(t);throw new se(`Unexpected function call "${this._value}".`)};function lce(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return H.fromHsl(i,o,r,s,c4)}function uce(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=c4;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 qy(e){return e%1===0?e.toFixed(1):e.toString()}function SVe(e){let t=qy(e.red),n=qy(e.green),i=qy(e.blue);return`vec3(${t}, ${n}, ${i})`}function a4(e){let t=qy(e.red),n=qy(e.green),i=qy(e.blue),o=qy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function fce(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 dce(e,t){return l(t[e])?t[e]:Th.NULL_SENTINEL}Th.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=fce(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=fce(this._value,e,t,this));let u,f,d;switch(a){case gt.VARIABLE:return qx(this)?void 0:dce(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(l4[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 se(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(u4[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(QW[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return qx(this._left)?dce(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case gt.FUNCTION_CALL:throw new se(`Error generating style shader: "${c}" is not supported.`);case gt.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 se("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new se("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new se("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return Th.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return qy(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||qx(n._left)))return c;if(i=H.fromCssColorString(c,c4),l(i))return SVe(i);throw new se("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],_=u[1];return _!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${_})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=uce(this),l(i)?a4(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=uce(this),l(i)?a4(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=lce(this),l(i)?a4(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=lce(this),l(i)?(i.alpha!==1&&(t.translucent=!0),a4(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case gt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case gt.LITERAL_REGEX:throw new se("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return Th.NULL_SENTINEL;case gt.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 gt.VARIABLE:qx(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=aO.exec(s);a!==null;)e.push(a[1]),a=aO.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&qx(t._left)&&e.push(s);break}};var id=Th;function w_(e){e=e??G.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??h.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=H.clone(H.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??zn.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(w_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var vVe={position:0,a_batchId:1};function wVe(e,t){if(l(e._va))return;let n=st.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=st.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),o=st.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:K.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:K.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new qn({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new qn({context:t,attributes:r,indexBuffer:st.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function IVe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??vVe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Be.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`,e._spPick=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(DE),c=n.getFragmentShaderCallback(!1,void 0,!0)(ky);o=n.getPickId();let u=new Be({sources:[a]}),f=new Be({defines:["VECTOR_TILE"],sources:[c]});e._sp=Xt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Be({sources:[DE]}),f=new Be({defines:["VECTOR_TILE"],sources:[ky]}),e._spStencil=Xt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Be.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`;let d=new Be({sources:[a]}),p=new Be({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Xt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function hce(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}var PVe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},DVe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function RVe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(hce(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(hce(!0)),e._rsColorPass=ze.fromCache(PVe),e._rsPickPass=ze.fromCache(DVe))}var Yx=new M,mce=new h;function OVe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return M.clone(i,Yx),M.multiplyByPoint(Yx,e._center,mce),M.setTranslation(Yx,mce,Yx),M.multiply(o,Yx,Yx),Yx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function JW(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],_=o[d],m=new e.constructor(e.buffer,a*p,_);t.set(m,n),i[d]=n,n+=_}return n}function MVe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=JW(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(H.equals(f.color,a.color))u=JW(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=JW(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function e7(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],_=o[d];t.copyFromBuffer(e,p*a,n*a,_*a),i[d]=n,n+=_}return n}function LVe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=e7(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(H.equals(d.color,r.color))u=e7(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=e7(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function NVe(e,t){return t.color.toRgba()-e.color.toRgba()}function FVe(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(NVe),t.webgl2?LVe(e,n):MVe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function BVe(e,t){let n=FVe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let _=o[p].offset,m=o[p].count,y=i[p*2];l(y)||(y=i[p*2]=new qe({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=_,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Se.TERRAIN_CLASSIFICATION;let b=qe.shallowClone(y,y.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=b;let x=i[p*2+1];l(x)||(x=i[p*2+1]=new qe({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=_,x.count=m,x.renderState=e._rsColorPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=Se.TERRAIN_CLASSIFICATION;let T=qe.shallowClone(x,x.derivedCommands.tileset);T.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=T}e._commandsDirty=!0}function kVe(e,t){if(e.classificationType===zn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=qe.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function UVe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=e._modelMatrix??M.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new qe({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=d,p.pass=Se.TERRAIN_CLASSIFICATION;let _=qe.shallowClone(p,p.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=_;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new qe({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=d,m.pass=Se.TERRAIN_CLASSIFICATION;let y=qe.shallowClone(m,m.derivedCommands.tileset);y.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}w_.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 oa(e,r)}};w_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function zVe(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=H.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=H.clone(H.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var VVe=new H,HVe=H.WHITE,GVe=!0,jVe=/\$/;w_.prototype.applyStyle=function(e,t){if(!l(e)){zVe(this,t);return}let n=e.color,i=n instanceof id&&!jVe.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,VVe):HVe,c.show=l(e.show)?e.show.evaluate(c):GVe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=H.clone(H.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};w_.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,b=c[f].count;if(s>=y&&s<y+b)break}c.push(new Hm({color:H.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],_=c[f].batchIds,m=_.length;for(let y=0;y<m;++y){let b=_[y];if(b===e)continue;let x=n[b];o[x]<s?d.push(b):p.push(b)}p.length!==0&&c.push(new Hm({color:H.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function pce(e,t,n,i){let o=e.classificationType,r=o!==zn.CESIUM_3D_TILE,s=o!==zn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Se.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function WVe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Se.OPAQUE,n.push(r)}}function qVe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Le.LINES):(n=e._rsColorPass,i=Le.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}w_.prototype.update=function(e){let t=e.context;wVe(this,t),IVe(this,t),RVe(this),OVe(this,t);let n=e.passes;n.render&&(BVe(this,t),kVe(this,e),qVe(this),this._debugWireframe?WVe(e,this._commands):pce(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(UVe(this),pce(this,e,this._pickCommands))};w_.prototype.isDestroyed=function(){return!1};w_.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(),ce(this)};var Xx=w_;function ju(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=h.clone(this._boundingVolume.center):this._center=h.clone(h.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=zn.BOTH}Object.defineProperties(ju.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}}});ju.packedBoxLength=M.packedLength+h.packedLength;ju.packedCylinderLength=M.packedLength+2;ju.packedEllipsoidLength=M.packedLength+h.packedLength;ju.packedSphereLength=h.packedLength+1;function YVe(e){let t=new Float64Array(M.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,M.pack(e._modelMatrix,t,n),t}function XVe(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]=re.unpack(t,n),n+=re.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=H.unpack(t,n);n+=H.packedLength;let f=t[n++],d=t[n++],p=t[n++],_=new Array(p);for(let m=0;m<p;++m)_[m]=t[n++];a[c]=new Hm({color:u,offset:f,count:d,batchIds:_})}return i}var KVe=new di("createVectorTileGeometries",5),$Ve=new H;function ZVe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let b=0;b<m;++b){let x=y.getColor(b,$Ve);u[b]=x.toRgba()}f=e._packedBuffer=YVe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},_=e._verticesPromise=KVe.scheduleTask(p,d);return l(_)?_.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);XVe(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),QVe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function QVe(e){l(e._primitive)||(e._primitive=new Xx({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)}ju.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};ju.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};ju.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};ju.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};ju.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=ZVe(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)};ju.prototype.isDestroyed=function(){return!1};ju.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var I_=ju;function Gm(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,t4e(this,i,o)}Object.defineProperties(Gm.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 JVe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function e4e(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new se("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var Kx=Uint32Array.BYTES_PER_ELEMENT;function t4e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Kx;let r=o.getUint32(n,!0);if(r!==1)throw new se(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=Kx;let s=o.getUint32(n,!0);if(n+=Kx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Kx,a===0)throw new se("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Kx;let u=o.getUint32(n,!0);n+=Kx;let f=o.getUint32(n,!0);n+=Kx;let d=Ho(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let _,m;u>0&&(_=Ho(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,b=d.CYLINDERS_LENGTH??0,x=d.ELLIPSOIDS_LENGTH??0,T=d.SPHERES_LENGTH??0,C=y+b+x+T,A=new v_(e,C,_,m,JVe(e));if(e._batchTable=A,C===0)return;let S=e.tile.computedTransform,w;l(d.RTC_CENTER)&&(w=h.unpack(d.RTC_CENTER),M.multiplyByPoint(S,w,w));let R=e4e(d,p);if(y>0||b>0||x>0||T>0){let P,O,L,g;if(y>0){let E=p.byteOffset+d.BOXES.byteOffset;P=new Float32Array(p.buffer,E,I_.packedBoxLength*y)}if(b>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,E,I_.packedCylinderLength*b)}if(x>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,E,I_.packedEllipsoidLength*x)}if(T>0){let E=p.byteOffset+d.SPHERES.byteOffset;g=new Float32Array(p.buffer,E,I_.packedSphereLength*T)}return e._geometries=new I_({boxes:P,boxBatchIds:R.boxes,cylinders:O,cylinderBatchIds:R.cylinders,ellipsoids:L,ellipsoidBatchIds:R.ellipsoids,spheres:g,sphereBatchIds:R.spheres,center:w,modelMatrix:S,batchTable:A,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function _ce(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}}Gm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Gm.prototype.getFeature=function(e){return _ce(this),this._features[e]};Gm.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Gm.prototype.applyStyle=function(e){_ce(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Gm.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)};Gm.prototype.pick=function(e,t,n){};Gm.prototype.isDestroyed=function(){return!1};Gm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ce(this)};var cO=Gm;var t7={};t7.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),gce(i,o,r,s);return c};t7.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)),gce(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function gce(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 RE=t7;var $x=30,n4e=1<<$x,i4e=1<<$x+1>>>0,n7=2*$x+1,Yy=4,xce=[],Tce=[],o4e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Xy=1,OE=2,d4=[Xy,0,0,Xy|OE];function us(e){if(!Nt.supportsBigInt())throw new se("S2 required BigInt support");this._cellId=e,this._level=us.getLevel(e)}us.fromToken=function(e){return new us(us.getIdFromToken(e))};us.isValidId=function(e){return!(e<=0||e>>BigInt(n7)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};us.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?us.isValidId(us.getIdFromToken(e)):!1};us.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};us.getTokenFromId=function(e){let t=Math.floor(m4e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};us.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return $x-(t>>1)};us.prototype.getChild=function(e){let t=Ece(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new us(n)};us.prototype.getParent=function(){let e=Ece(this._cellId)<<BigInt(2);return new us(this._cellId&~e+BigInt(1)|e)};us.prototype.getParentAtLevel=function(e){let t=d4e(e);return new us(this._cellId&-t|t)};us.prototype.getCenter=function(e){e=e??te.WGS84;let t=r4e(this._cellId,this._level);t=h.normalize(t,t);let n=new fe.fromCartesian(t,te.UNIT_SPHERE);return fe.toCartesian(n,e,new h)};us.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=s4e(this._cellId,this._level,e);n=h.normalize(n,n);let i=new fe.fromCartesian(n,te.UNIT_SPHERE);return fe.toCartesian(i,t,new h)};us.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(n7-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new us(a)};function r4e(e,t){let n=a4e(e,t);return c4e(n[0],n[1],n[2])}function s4e(e,t,n){let i=Cce(e,t),o=l4e([i[1],i[2]],t),r=n>>1&1;return Ace(i[0],o[0][r^n&1],o[1][r])}function a4e(e,t){let n=Cce(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function Cce(e){xce.length===0&&f4e();let t=Number(e>>BigInt(n7)),n=t&Xy,i=(1<<Yy)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?$x-7*Yy:Yy))-1;n+=Number(e>>BigInt(s*2*Yy+1)&BigInt(c))<<2,n=Tce[n];let u=s*Yy;o+=n>>Yy+2<<u,r+=(n>>2&i)<<u,n&=Xy|OE}return[t,o,r]}function c4e(e,t,n){let i=yce(t),o=yce(n),r=h4(i),s=h4(o);return Ace(e,r,s)}function Ace(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function h4(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function yce(e){return 1/i4e*e}function l4e(e,t){let n=[[],[]],i=u4e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=h4(bce(r)),n[o][1]=h4(bce(s))}return n}function u4e(e){return 1<<$x-e>>>0}function bce(e){return 1/n4e*e}function Ky(e,t,n,i,o,r){if(e===Yy){let s=(t<<Yy)+n;xce[(s<<2)+i]=(o<<2)+r,Tce[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=o4e[r];Ky(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^d4[0]),Ky(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^d4[1]),Ky(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^d4[2]),Ky(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^d4[3])}}function f4e(){Ky(0,0,0,0,0,0),Ky(0,0,0,Xy,0,Xy),Ky(0,0,0,OE,0,OE),Ky(0,0,0,Xy|OE,0,Xy|OE)}function Ece(e){return e&~e+BigInt(1)}function d4e(e){return BigInt(1)<<BigInt(2*($x-e))}var h4e=[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 m4e(e){return h4e[(-e&e)%BigInt(67)]}var P_=us;function p4e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ai=p4e;function i7(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 se(`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=_4e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function _4e(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(i7.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});i7.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 ME=i7;function D_(e){e=e??G.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(D_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});D_.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};D_.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};D_.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};D_.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};D_.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};D_.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};D_.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var LE=D_;var m4={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};m4.getBranchingFactor=function(e){switch(e){case m4.OCTREE:return 8;case m4.QUADTREE:return 4}};var fs=Object.freeze(m4);function Ia(){}Object.defineProperties(Ia.prototype,{class:{get:function(){he.throwInstantiationError()}}});Ia.prototype.hasProperty=function(e){he.throwInstantiationError()};Ia.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};Ia.prototype.getPropertyIds=function(e){he.throwInstantiationError()};Ia.prototype.getProperty=function(e){he.throwInstantiationError()};Ia.prototype.setProperty=function(e,t){he.throwInstantiationError()};Ia.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};Ia.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};Ia.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))};Ia.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Ia.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};Ia.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=Fe(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Ia.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};Ia.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Ia.getProperty(o.id,t,n)};Ia.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Ia.setProperty(r.id,t,n,i):!1};var kn=Ia;function R_(e){e=e??G.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(R_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});R_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};R_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};R_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};R_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};R_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};R_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};R_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var lO=R_;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 Nt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case kt.UINT64:return Nt.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 Nt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case kt.UINT64:return Nt.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=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===kt.INT64||t===kt.UINT64)&&Nt.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 K.BYTE:return kt.INT8;case K.UNSIGNED_BYTE:return kt.UINT8;case K.SHORT:return kt.INT16;case K.UNSIGNED_SHORT:return kt.UINT16;case K.INT:return kt.INT32;case K.UNSIGNED_INT:return kt.UINT32;case K.FLOAT:return kt.FLOAT32;case K.DOUBLE:return kt.FLOAT64}};kt.toComponentDatatype=function(e){switch(e){case kt.INT8:return K.BYTE;case kt.UINT8:return K.UNSIGNED_BYTE;case kt.INT16:return K.SHORT;case kt.UINT16:return K.UNSIGNED_SHORT;case kt.INT32:return K.INT;case kt.UINT32:return K.UNSIGNED_INT;case kt.FLOAT32:return K.FLOAT;case kt.FLOAT64:return K.DOUBLE}};var Ft=Object.freeze(kt);var Xo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Xo.isVectorType=function(e){switch(e){case Xo.VEC2:case Xo.VEC3:case Xo.VEC4:return!0;default:return!1}};Xo.isMatrixType=function(e){switch(e){case Xo.MAT2:case Xo.MAT3:case Xo.MAT4:return!0;default:return!1}};Xo.getComponentCount=function(e){switch(e){case Xo.SCALAR:case Xo.STRING:case Xo.ENUM:case Xo.BOOLEAN:return 1;case Xo.VEC2:return 2;case Xo.VEC3:return 3;case Xo.VEC4:return 4;case Xo.MAT2:return 4;case Xo.MAT3:return 9;case Xo.MAT4:return 16}};Xo.getMathType=function(e){switch(e){case Xo.VEC2:return V;case Xo.VEC3:return h;case Xo.VEC4:return ie;case Xo.MAT2:return ei;case Xo.MAT3:return Z;case Xo.MAT4:return M;default:return}};var at=Object.freeze(Xo);function ec(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Ft.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=Fe(e.min,!0),this._max=Fe(e.max,!0),this._normalized=r;let s=Fe(e.offset,!0),a=Fe(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Fe(e.noData,!0),this._default=Fe(e.default,!0),this._required=e.required??!0,this._extras=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}ec.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.property,i=g4e(n),o=y4e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new ec({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(ec.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 g4e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===at.SCALAR||at.isMatrixType(t)||at.isVectorType(t))return!1;if(l(Ft[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 y4e(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===at.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===at.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.SCALAR||at.isMatrixType(n)||at.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.BOOLEAN||n===at.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===at.BOOLEAN||i===at.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Ft[i]))return{type:at.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Ft[n]))return{type:at.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}ec.prototype.normalize=function(e){return this._normalized?o7(e,this._valueType,Ft.normalize):e};ec.prototype.unnormalize=function(e){return this._normalized?o7(e,this._valueType,Ft.unnormalize):e};ec.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ec.valueTransformInPlace(e,this._offset,this._scale,Ft.applyValueTransform)};ec.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ec.valueTransformInPlace(e,this._offset,this._scale,Ft.unapplyValueTransform)};ec.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=at.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)};ec.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Ice(e,t))return e};function Ice(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(!Ice(e[n],t[n]))return!1;return!0}ec.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.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};ec.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.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};ec.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?b4e(this,e):Pce(this,e)};function b4e(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=Pce(e,t[i]);if(l(o))return o}}function Pce(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return at.isVectorType(n)?x4e(t,n,i):at.isMatrixType(n)?T4e(t,n,i):n===at.STRING?C4e(t):n===at.BOOLEAN?A4e(t):n===at.ENUM?E4e(t,o):S4e(t,i,r)}function x4e(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===at.VEC2&&!(e instanceof V))return`vector value ${e} must be a Cartesian2`;if(t===at.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===at.VEC4&&!(e instanceof ie))return`vector value ${e} must be a Cartesian4`}function T4e(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===at.MAT2&&!(e instanceof ei))return`matrix value ${e} must be a Matrix2`;if(t===at.MAT3&&!(e instanceof Z))return`matrix value ${e} must be a Matrix3`;if(t===at.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function C4e(e){if(typeof e!="string")return p4(e,at.STRING)}function A4e(e){if(typeof e!="boolean")return p4(e,at.BOOLEAN)}function E4e(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 S4e(e,t,n){let i=typeof e;switch(t){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return i!=="number"?p4(e,t):isFinite(e)?vce(e,t,n):wce(e,t);case Ft.INT64:case Ft.UINT64:return i!=="number"&&i!=="bigint"?p4(e,t):i==="number"&&!isFinite(e)?wce(e,t):vce(e,t,n)}}function p4(e,t){return`value ${e} does not match type ${t}`}function Sce(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function vce(e,t,n){if(n){let i=Ft.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Sce(e,t,n):void 0}if(e<Ft.getMinimum(t)||e>Ft.getMaximum(t))return Sce(e,t,n)}function wce(e,t){return`value ${e} of type ${t} must be finite`}function o7(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=o7(e[i],t,n);return e}ec.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]=ec.valueTransformInPlace(e[o],t[o],n[o],i);return e};var jm=ec;function uO(e){e=e??G.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===at.STRING,d=r===at.BOOLEAN,p=0,_;if(a){let g=n.arrayOffsetType??n.offsetType;g=Ft[g]??Ft.UINT32;let E=n.arrayOffsets??n.arrayOffsetBufferView;_=new r7(o[E],g,t+1),p+=_.typedArray.byteLength}let m=at.getComponentCount(r),y;a?y=_.get(t)-_.get(0):s?y=t*i.arrayLength:y=t;let b=m*y,x;if(f){let g=n.stringOffsetType??n.offsetType;g=Ft[g]??Ft.UINT32;let E=n.stringOffsets??n.stringOffsetBufferView;x=new r7(o[E],g,b+1),p+=x.typedArray.byteLength}(f||d)&&(c=Ft.UINT8);let T;f?T=x.get(b)-x.get(0):d?T=Math.ceil(b/8):T=b;let C=n.values??n.bufferView,A=new r7(o[C],c,T);p+=A.typedArray.byteLength;let S=n.offset,w=n.scale,R=i.hasValueTransform||l(S)||l(w);S=S??i.offset,w=w??i.scale,S=Dce(S),w=Dce(w);let P,O,L=this;f?P=function(g){return I4e(g,L._values,L._stringOffsets)}:d?(P=function(g){return P4e(g,L._values)},O=function(g,E){D4e(g,L._values,E)}):l(u)?(P=function(g){let E=L._values.get(g);return u.namesByValue[E]},O=function(g,E){let v=u.valuesByName[E];L._values.set(g,v)}):(P=function(g){return L._values.get(g)},O=function(g,E){L._values.set(g,E)}),this._arrayOffsets=_,this._stringOffsets=x,this._values=A,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=S,this._scale=w,this._hasValueTransform=R,this._getValue=P,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(uO.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}}});uO.prototype.get=function(e){let t=v4e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=k4e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};uO.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=U4e(this,t),t=n.unnormalize(t),w4e(this,e,t)};uO.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Dce(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 v4e(e,t){Oce(e)&&Mce(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Fe(s,!0):s}return!i&&r===1?e._getValue(t):Rce(e,n,t)}function Rce(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.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 w4e(e,t,n){F4e(e,t,n)&&Mce(e);let i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Fe(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function I4e(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return ia(t.typedArray,i,o)}function P4e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function D4e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function R4e(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 O4e(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 M4e(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 L4e(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 N4e(e){switch(e){case Ft.INT8:return K.BYTE;case Ft.UINT8:return K.UNSIGNED_BYTE;case Ft.INT16:return K.SHORT;case Ft.UINT16:return K.UNSIGNED_SHORT;case Ft.INT32:return K.INT;case Ft.UINT32:return K.UNSIGNED_INT;case Ft.FLOAT32:return K.FLOAT;case Ft.FLOAT64:return K.DOUBLE}}function Oce(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===at.STRING||i===Ft.INT64&&!Nt.supportsBigInt64Array()||i===Ft.UINT64&&!Nt.supportsBigUint64Array()}function F4e(e,t,n){if(Oce(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 Mce(e){e._unpackedValues=B4e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function B4e(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=at.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]=Rce(e,i,a);return n}function k4e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:jm.valueTransformInPlace(t,e._offset,e._scale,Ft.applyValueTransform)}function U4e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:jm.valueTransformInPlace(t,e._offset,e._scale,Ft.unapplyValueTransform)}function r7(e,t,n){let i=this,o,r,s;if(t===Ft.INT64)Nt.supportsBigInt()?Nt.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 O4e(a,i)}):(bt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return R4e(a,i)});else if(t===Ft.UINT64)Nt.supportsBigInt()?Nt.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 L4e(a,i)}):(bt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return M4e(a,i)});else{let a=N4e(t);o=K.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var fO=uO;function Ch(e){e=e??G.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 fO({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(Ch.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Ch.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Ch.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Ch.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Ch.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=z4e(this._class,t),i};Ch.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Ch.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)};Ch.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};Ch.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Ch.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function z4e(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=Fe(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var od=Ch;function $y(){}Object.defineProperties($y.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});$y.prototype.load=function(){he.throwInstantiationError()};$y.prototype.unload=function(){};$y.prototype.process=function(e){return!1};$y.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` -${t.message}`);let n=new se(e);return l(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};$y.prototype.isDestroyed=function(){return!1};$y.prototype.destroy=function(){return this.unload(),ce(this)};var Zi=$y;var V4e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},yt=Object.freeze(V4e);function O_(e){e=e??G.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(O_.prototype=Object.create(Zi.prototype),O_.prototype.constructor=O_);Object.defineProperties(O_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});O_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=H4e(this),this._promise)};async function H4e(e){let t=e._resource;e._state=yt.LOADING;try{let n=await O_._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}O_._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};O_.prototype.unload=function(){this._typedArray=void 0};var Zx=O_;var zce=er(Uce(),1);function Qx(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,_,m,y;if(ai(a,"EXT_meshopt_compression")){let x=a.extensions.EXT_meshopt_compression;c=x.buffer,u=x.byteOffset??0,f=x.byteLength,d=!0,p=x.byteStride,_=x.count,m=x.mode,y=x.filter??"NONE"}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=_,this._meshoptMode=m,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Qx.prototype=Object.create(Zi.prototype),Qx.prototype.constructor=Qx);Object.defineProperties(Qx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function Y4e(e){try{let t=X4e(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);zce.MeshoptDecoder.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=yt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load buffer view",t)}}Qx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=Y4e(this),this._promise)};function X4e(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})}Qx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var NE=Qx;function qr(){}qr._maxDecodingConcurrency=Math.max(Nt.hardwareConcurrency-1,1);qr._decoderTaskProcessor=void 0;qr._taskProcessorReady=!1;qr._error=void 0;qr._getDecoderTaskProcessor=function(){if(!l(qr._decoderTaskProcessor)){let e=new di("decodeDraco",qr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?qr._taskProcessorReady=!0:qr._error=new se("Draco decoder could not be initialized.")}).catch(t=>{qr._error=t}),qr._decoderTaskProcessor=e}return qr._decoderTaskProcessor};qr.decodePointCloud=function(e){let t=qr._getDecoderTaskProcessor();if(l(qr._error))throw qr._error;if(qr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};qr.decodeBufferView=function(e){let t=qr._getDecoderTaskProcessor();if(l(qr._error))throw qr._error;if(qr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var M_=qr;var ci={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function K4e(e){switch(e){case ci.POSITION:return"positionMC";case ci.NORMAL:return"normalMC";case ci.TANGENT:return"tangentMC";case ci.TEXCOORD:return"texCoord";case ci.COLOR:return"color";case ci.JOINTS:return"joints";case ci.WEIGHTS:return"weights";case ci.FEATURE_ID:return"featureId"}}ci.hasSetIndex=function(e){switch(e){case ci.POSITION:case ci.NORMAL:case ci.TANGENT:return!1;case ci.TEXCOORD:case ci.COLOR:case ci.JOINTS:case ci.WEIGHTS:case ci.FEATURE_ID:return!0}};ci.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ci.POSITION;case"NORMAL":return ci.NORMAL;case"TANGENT":return ci.TANGENT;case"TEXCOORD":return ci.TEXCOORD;case"COLOR":return ci.COLOR;case"JOINTS":return ci.JOINTS;case"WEIGHTS":return ci.WEIGHTS;case"_FEATURE_ID":return ci.FEATURE_ID}};ci.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ci.POSITION;case"RGBA":case"RGB":case"RGB565":return ci.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ci.NORMAL;case"BATCH_ID":return ci.FEATURE_ID}};ci.getGlslType=function(e){switch(e){case ci.POSITION:case ci.NORMAL:case ci.TANGENT:return"vec3";case ci.TEXCOORD:return"vec2";case ci.COLOR:return"vec4";case ci.JOINTS:return"ivec4";case ci.WEIGHTS:return"vec4";case ci.FEATURE_ID:return"int"}};ci.getVariableName=function(e,t){let n=K4e(e);return l(t)&&(n+=`_${t}`),n};var mt=Object.freeze(ci);function Zy(e){e=e??G.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=yt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Zy.prototype=Object.create(Zi.prototype),Zy.prototype.constructor=Zy);Object.defineProperties(Zy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function $4e(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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Vce(e,n)}}Zy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=$4e(this),this._promise)};function Vce(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load Draco",t)}async function Z4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var Jx={};Jx[mt.POSITION]="POSITION";Jx[mt.NORMAL]="NORMAL";Jx[mt.COLOR]="COLOR";Jx[mt.TEXCOORD]="TEX_COORD";function Q4e(e){for(let t in Jx)if(Jx.hasOwnProperty(t)&&e.startsWith(t))return Jx[t]}Zy.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._dracoError)&&Vce(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 d in n.attributes)if(n.attributes.hasOwnProperty(d)){let p=Q4e(d);l(p)&&i.accessors[n.attributes[d]].componentType===K.FLOAT&&(c.includes(p)||c.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},f=M_.decodeBufferView(u);if(!l(f))return!1;this._decodePromise=Z4e(this,f)};Zy.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 FE=Zy;function J4e(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 Ee.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ee.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ee({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 L_=J4e;function N_(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(N_.prototype=Object.create(Zi.prototype),N_.prototype.constructor=N_);Object.defineProperties(N_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});N_.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=e8e(this),this._promise):(this._promise=t8e(this),this._promise)};function Hce(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 e8e(e){e._state=yt.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 i8e(i);if(e.isDestroyed())return;let r=Hce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(n){return e.isDestroyed()?void 0:Gce(e,n,"Failed to load embedded image")}}async function t8e(e){e._state=yt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await r8e(i);if(e.isDestroyed())return;let r=Hce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(o){return e.isDestroyed()?void 0:Gce(e,o,`Failed to load image: ${n}`)}}function Gce(e,t,n){return e.unload(),e._state=yt.FAILED,Promise.reject(e.getError(n,t))}function n8e(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 se("Image format is not recognized")}async function i8e(e){let t=n8e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Qs(n)}return N_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var o8e=/(^data:image\/ktx2)|(\.ktx2$)/i;function r8e(e){let t=e.getUrlComponent(!1,!0);return o8e.test(t)?Qs(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}N_.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};N_._loadImageFromTypedArray=L_;var BE=N_;var s8e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},tc=Object.freeze(s8e);function Qy(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,c=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,d=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=u,this._loadBuffer=f,this._loadTypedArray=d,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Qy.prototype=Object.create(Zi.prototype),Qy.prototype.constructor=Qy);Object.defineProperties(Qy.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 a8e=new f7;Qy.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=c8e(this),this._promise):(this._promise=l8e(this),this._promise)};async function c8e(e){e._state=yt.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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;u7(e,n)}}async function l8e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=yt.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=u8e(e,a),e._state=yt.PROCESSING,e}catch(s){if(e.isDestroyed())return;u7(e,s)}}function u8e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=ke.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Po("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===ke.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===ke.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===ke.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function u7(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load index buffer",t)}function f7(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}f7.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};f7.prototype.execute=function(){this.buffer=jce(this.typedArray,this.indexDatatype,this.context)};function jce(e,t,n){let i=st.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Qy.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.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=K.fromTypedArray(t),this._indexDatatype=n)}catch(o){u7(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=a8e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,tc.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=jce(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Qy.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 kE=Qy;function f8e(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 Fs=f8e;function d8e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var yr=d8e;function Kt(){}Kt.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}}};Kt.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}}};Kt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Kt.objectLegacy(i,n):Kt.object(i,n)};Kt.accessor=function(e,t){return Kt.topLevel(e,"accessors",t)};Kt.accessorWithSemantic=function(e,t,n){let i={};return Kt.mesh(e,function(o){return Kt.meshPrimitive(o,function(r){let s=Kt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:Kt.meshPrimitiveTarget(r,function(a){return Kt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Kt.accessorContainingVertexAttributeData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=Kt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Kt.meshPrimitiveTarget(o,function(s){return Kt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Kt.accessorContainingIndexData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.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}})})};Kt.animation=function(e,t){return Kt.topLevel(e,"animations",t)};Kt.animationChannel=function(e,t){let n=e.channels;return Kt.object(n,t)};Kt.animationSampler=function(e,t){let n=e.samplers;return Kt.object(n,t)};Kt.buffer=function(e,t){return Kt.topLevel(e,"buffers",t)};Kt.bufferView=function(e,t){return Kt.topLevel(e,"bufferViews",t)};Kt.camera=function(e,t){return Kt.topLevel(e,"cameras",t)};Kt.image=function(e,t){return Kt.topLevel(e,"images",t)};Kt.material=function(e,t){return Kt.topLevel(e,"materials",t)};Kt.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}};Kt.mesh=function(e,t){return Kt.topLevel(e,"meshes",t)};Kt.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}}};Kt.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}};Kt.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}}};Kt.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}};Kt.node=function(e,t){return Kt.topLevel(e,"nodes",t)};Kt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=Kt.nodeInTree(e,u,n),l(c)))return c}}}};Kt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Kt.nodeInTree(e,i,n)};Kt.program=function(e,t){return yr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.programs,t):Kt.topLevel(e,"programs",t)};Kt.sampler=function(e,t){return Kt.topLevel(e,"samplers",t)};Kt.scene=function(e,t){return Kt.topLevel(e,"scenes",t)};Kt.shader=function(e,t){return yr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.shaders,t):Kt.topLevel(e,"shaders",t)};Kt.skin=function(e,t){return Kt.topLevel(e,"skins",t)};Kt.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}}};Kt.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}};Kt.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}};Kt.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}};Kt.technique=function(e,t){return yr(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.techniques,t):Kt.topLevel(e,"techniques",t)};Kt.texture=function(e,t){return Kt.topLevel(e,"textures",t)};var Re=Kt;function h8e(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 Wu=h8e;function m8e(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 K.getSizeInBytes(t.componentType)*Wu(t.type)}var iu=m8e;function p8e(e){Re.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Re.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){if(i.mode=i.mode??q.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Fs(e.materials,o)}})}),Re.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=iu(e,i),r.target=q.ARRAY_BUFFER}}),Re.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=q.ELEMENT_ARRAY_BUFFER}}),Re.material(e,function(n){let i=n.extensions??G.EMPTY_OBJECT,o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&Re.materialValue(n,function(c){l(c.index)&&eT(c)}),eT(n.emissiveTexture),eT(n.normalTexture),eT(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,eT(s.baseColorTexture),eT(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,eT(a.specularGlossinessTexture))}),Re.animation(e,function(n){Re.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=_8e(e);return Re.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]}),Re.sampler(e,function(n){n.wrapS=n.wrapS??q.REPEAT,n.wrapT=n.wrapT??q.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function _8e(e){let t={};return Re.animation(e,function(n){Re.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 eT(e){l(e)&&(e.texCoord=e.texCoord??0)}var _O=p8e;function g8e(e){return Re.shader(e,function(t){x4(t)}),Re.buffer(e,function(t){x4(t)}),Re.image(e,function(t){x4(t)}),x4(e),e}function x4(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Jy=g8e;function y8e(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 gO=y8e;function b8e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),gO(e,t),n.length===0&&delete e.extensionsUsed}}var tT=b8e;var x8e=4;function T8e(e){if(bl(e)!=="glTF")throw new se("File is not valid binary glTF");let n=Wce(e,0,5),i=n[1];if(i!==1&&i!==2)throw new se("Binary glTF version is not 1 or 2");return i===1?C8e(e,n):A8e(e,n)}function Wce(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*x8e,!0);return o}function C8e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new se("Binary glTF scene format is not JSON");let r=20,s=r+i,a=ia(e,r,i),c=JSON.parse(a);Jy(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return tT(c,"KHR_binary_glTF"),c}function A8e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Wce(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=ia(u);o=JSON.parse(f),Jy(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var yO=T8e;function E8e(e){return Re.shader(e,function(t){T4(t)}),Re.buffer(e,function(t){T4(t)}),Re.image(e,function(t){T4(t)}),T4(e),e}function T4(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var bO=E8e;function S8e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Fs(n,t,!0)}var rd=S8e;function v8e(e){switch(e){case K.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case K.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case K.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case K.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 K.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case K.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 K.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case K.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var F_=v8e;function w8e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Wu(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,_=iu(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,b=K.getSizeInBytes(y),x=new DataView(d.buffer),T=new Array(r),C=F_(y);for(let A=0;A<p;A++){C(x,m,r,b,T);for(let S=0;S<r;S++){let w=T[S];s[S]=Math.min(s[S],w),a[S]=Math.max(a[S],w)}m+=_}return{min:s,max:a}}var nT=w8e;var I8e=[q.FUNC_ADD,q.FUNC_ADD],P8e=[q.ONE,q.ZERO,q.ONE,q.ZERO];function qce(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var D8e=[q.ZERO,q.ONE,q.SRC_COLOR,q.ONE_MINUS_SRC_COLOR,q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA,q.DST_ALPHA,q.ONE_MINUS_DST_ALPHA,q.DST_COLOR,q.ONE_MINUS_DST_COLOR];function R8e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(D8e.indexOf(e[n])===-1)return t;return e}function O8e(e){let t={},n={},i=e.techniques;return l(i)&&(Re.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(qce(s,q.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??I8e,blendFactors:R8e(c.blendFuncSeparate,P8e)})}qce(s,q.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),rd(e,"KHR_blend")),Re.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Re.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 xO=O8e;function M8e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Fs(n,t,!0),rd(e,t)}var TO=M8e;function L8e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Re.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Re.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Re.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[d.fragmentShader];p.fragmentShader=Fs(r.shaders,_,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Fs(r.shaders,m,!0),u.program=Fs(r.programs,p),o[a.program]=u.program}i[c]=Fs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,rd(e,"KHR_techniques_webgl"),TO(e,"KHR_techniques_webgl"))}return Re.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Re.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var CO=L8e;function N8e(e,t){ro.typeOf.object("material",e),ro.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:d}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}}}let o=Re.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 UE=N8e;var Yce=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function F8e(e,t){return t=t??Yce,Yce.forEach(function(n){t.indexOf(n)>-1&&k8e(e,n)}),e}var B8e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function k8e(e,t){let n=B8e[t],i=e[n];if(l(i)){let o=0,r=qm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Wm[t](e,a-o),o++)}}function Wm(){}Wm.accessor=function(e,t){e.accessors.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){Re.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Re.meshPrimitiveTarget(o,function(a){Re.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Re.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Re.animation(e,function(i){Re.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Wm.buffer=function(e,t){e.buffers.splice(t,1),Re.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--})};Wm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Re.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),yr(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(i){Re.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--})}),yr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(yr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Wm.image=function(e,t){e.images.splice(t,1),Re.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})};Wm.mesh=function(e,t){e.meshes.splice(t,1),Re.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Wm.node=function(e,t){e.nodes.splice(t,1),Re.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})}),Re.animation(e,function(i){Re.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Re.technique(e,function(i){Re.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Re.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}))}),Re.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Wm.material=function(e,t){e.materials.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Wm.sampler=function(e,t){e.samplers.splice(t,1),Re.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Wm.texture=function(e,t){if(e.textures.splice(t,1),Re.material(e,function(i){UE(i,function(o,r){r.index>t&&--r.index})}),yr(e,"EXT_feature_metadata")){Re.mesh(e,function(r){Re.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let _=u[d].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(yr(e,"EXT_mesh_features")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),yr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function qm(){}qm.accessor=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Re.meshPrimitiveTarget(i,function(r){Re.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Re.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Re.animation(e,function(n){Re.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),yr(e,"EXT_mesh_gpu_instancing")&&Re.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})}),yr(e,"CESIUM_primitive_outline")&&Re.mesh(e,function(n){Re.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};qm.buffer=function(e){let t={};return Re.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};qm.bufferView=function(e){let t={};if(Re.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),yr(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),yr(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(yr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};qm.image=function(e){let t={};return Re.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};qm.mesh=function(e){let t={};return Re.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 Xce(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!Xce(e,o,n)}).length===0}qm.node=function(e){let t={};return Re.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Re.skinJoint(n,function(i){t[i]=!0})}),Re.animation(e,function(n){Re.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Re.technique(e,function(n){Re.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Re.node(e,function(n,i){Xce(e,i,t)||(t[i]=!0)}),t};qm.material=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};qm.texture=function(e){let t={};if(Re.material(e,function(n){UE(n,function(i){t[i]=!0})}),yr(e,"EXT_feature_metadata")){Re.mesh(e,function(o){Re.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(yr(e,"EXT_mesh_features")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),yr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};qm.sampler=function(e){let t={};return Re.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var AO=F8e;function U8e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Fs(e.buffers,n),byteOffset:0,byteLength:t.length};return Fs(e.bufferViews,o)}var EO=U8e;function z8e(e,t){let n=iu(e,t),i=K.getSizeInBytes(t.componentType),o=Wu(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=F_(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,d);for(let m=0;m<o;++m)s[_*o+m]=d[m];u+=n}return s}var SO=z8e;function V8e(e){let t;return Re.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?C4(e,i,K.UNSIGNED_BYTE):t!==q.UNSIGNED_BYTE&&t!==q.UNSIGNED_SHORT&&C4(e,i,K.UNSIGNED_SHORT)}),Re.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?C4(e,i,K.UNSIGNED_BYTE):t===q.SHORT&&C4(e,i,K.UNSIGNED_SHORT)}),e}function C4(e,t,n){let i=K.createTypedArray(n,SO(e,t)),o=new Uint8Array(i.buffer);t.bufferView=EO(e,o),t.componentType=n,t.byteOffset=0}var vO=V8e;function H8e(e,t){return tT(e,t),t==="CESIUM_RTC"&&G8e(e),d7(e,t)}function G8e(e){Re.technique(e,function(t){Re.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function d7(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)d7(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)&&d7(e[o],t);return i}}var iT=H8e;var A4={.8:K8e,"1.0":_He,"2.0":void 0};function j8e(e,t){t=t??G.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(A4,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(A4,i)||(i="1.0"));let o=A4[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=A4[i];return t.keepLegacyExtensions||(bHe(e,t),xHe(e)),e}function Zce(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 W8e(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??q.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function q8e(e){let t=e.nodes,n=new h,i=new Pe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Pe.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 Y8e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Pe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let y=f[m];if(y.target.path==="rotation"){let b=d[p[y.sampler].output];if(l(r[b]))continue;r[b]=!0;let x=n[b],T=i[x.bufferView],A=o[T.buffer].extras._pipeline.source,S=A.byteOffset+T.byteOffset+x.byteOffset,w=x.componentType,R=x.count,P=Wu(x.type),O=x.count*P,L=K.createArrayBufferView(w,A.buffer,S,O);for(let g=0;g<R;g++){let E=g*P;h.unpack(L,E,s);let v=L[E+3];Pe.fromAxisAngle(s,v,a),Pe.pack(a,L,E)}}}}}}function X8e(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 K8e(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,Zce(e),W8e(e),q8e(e),Y8e(e),X8e(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,rd(e,"KHR_materials_common")}}function $8e(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 Kce(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 Z8e(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]=Kce(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]),Re.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Re.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Re.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}}),Re.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Re.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Re.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]})})}),Re.mesh(e,function(s){Re.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Re.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Re.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Fs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Re.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Re.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]]}}),Re.animation(e,function(s){let a={};s.samplers=Kce(s.samplers,a),Re.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Re.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Re.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Re.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Re.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Re.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}}),Re.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function Q8e(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){delete n.name})})}function J8e(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]}Re.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function eHe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var tHe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function nHe(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(tHe[o])&&e.extensionsRequired.push(o)}}}function iHe(e){Re.buffer(e,function(t){delete t.type})}function oHe(e){Re.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function rHe(e){Re.mesh(e,function(t){Re.meshPrimitive(t,function(n){Re.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})}),Re.technique(e,function(t){Re.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var sHe={POSITION:!0,NORMAL:!0,TANGENT:!0},aHe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function cHe(e){let t={};Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=aHe[a];l(f)?(u=f+c,t[r]=u):l(sHe[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Re.technique(e,function(n){Re.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function lHe(e){Re.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 m7(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:iu(e,t)}function uHe(e){Re.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Re.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=m7(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function fHe(e){let t,n,i,o=e.bufferViews,r={};Re.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Re.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,_){return p.byteOffset-_.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],_=m7(e,p),m=p.byteOffset,y=p.count*_;delete p.byteStride;let b=t<d-1,x=b?m7(e,c[t+1]):void 0;if(_!==x){let T=Fe(i,!0);r[a]&&(T.byteStride=_),T.byteOffset+=u,T.byteLength=m+y-u;let C=Fs(o,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=C,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}AO(e,["accessor","bufferView","buffer"])}function dHe(e){Re.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=nT(e,n);n.min=i.min,n.max=i.max}})}function Qce(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Jce(e,t){Re.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}}}),Re.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Qce(n)&&Jce(e,i))}}),delete e.nodes[t]}function hHe(e){return Re.node(e,function(t,n){Qce(t)&&Jce(e,n)}),e}function mHe(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=nT(e,i);i.min=o.min,i.max=o.max}})})}function pHe(e){Re.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=nT(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function _He(e){e.asset=e.asset??{},e.asset.version="2.0",Zce(e),$8e(e),hHe(e),Z8e(e),Q8e(e),eHe(e),nHe(e),uHe(e),fHe(e),dHe(e),mHe(e),pHe(e),iHe(e),oHe(e),rHe(e),cHe(e),vO(e),lHe(e),xO(e),CO(e),J8e(e)}var gHe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],yHe=["u_diffuse","u_diffuse_mat"];function p7(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function _7(e){return l(e.index)}function g7(e){return Array.isArray(e)&&e.length===4}function ele(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 bHe(e,t){t=t??G.EMPTY_OBJECT;let n=t.baseColorTextureNames??gHe,i=t.baseColorFactorNames??yHe;Re.material(e,function(o){Re.materialValue(o,function(r,s){n.indexOf(s)!==-1&&_7(r)?(p7(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&g7(r)&&(p7(o),o.pbrMetallicRoughness.baseColorFactor=ele(r))})}),iT(e,"KHR_techniques_webgl"),iT(e,"KHR_blend")}function h7(e,t){l(t)&&(g7(t)?e.pbrMetallicRoughness.baseColorFactor=ele(t):_7(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function $ce(e,t){l(t)&&(g7(t)?e.emissiveFactor=t.slice(0,3):_7(t)&&(e.emissiveTexture=t))}function xHe(e){Re.material(e,function(t){let n=(t.extensions??G.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,u=n.transparent;p7(t),n.technique==="CONSTANT"?(rd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},h7(t,s),h7(t,o)):(h7(t,r),$ce(t,o),$ce(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),iT(e,"KHR_materials_common")}var wO=j8e;function Rc(){}Rc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let o=new se(i);return l(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};Rc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Pe.IDENTITY,l(e.scale)?e.scale:h.ONE)};Rc.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}};Rc.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}};Rc.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}};Rc.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};Rc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=mt.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=rn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":rn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var THe=new h,CHe=new h;Rc.getPositionMinMax=function(e,t,n){let i=Rc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,CHe),o=h.add(o,n,THe)),{min:r,max:o}};Rc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===Vo.Y?n=M.clone(Vo.Y_UP_TO_Z_UP,n):e===Vo.X&&(n=M.clone(Vo.X_UP_TO_Z_UP,n)),t===Vo.Z&&(n=M.multiplyTransformation(n,Vo.Z_UP_TO_X_UP,n)),n};var AHe=new Z;Rc.getCullFace=function(e,t){if(!Le.isTriangles(t))return Ai.BACK;let n=M.getMatrix3(e,AHe);return Z.determinant(n)<0?Ai.FRONT:Ai.BACK};Rc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Rc.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};Rc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Rc.supportedExtensions[i])throw new se(`Unsupported glTF Extension: ${i}`)}};var Qt=Rc;function e0(e){e=e??G.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=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(e0.prototype=Object.create(Zi.prototype),e0.prototype.constructor=e0);Object.defineProperties(e0.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});e0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,l(this._gltfJson)?(this._promise=tle(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=nle(this,this._typedArray),this._promise):(this._promise=EHe(this),this._promise))};async function EHe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;y7(e,n)}return nle(e,t)}function y7(e,t){e.unload(),e._state=yt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function SHe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!yr(t,"KHR_techniques_webgl")&&!yr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Re.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),wO(t)}function vHe(e){let t=[];return Re.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Jp(i)&&(delete n.uri,t.push(Ee.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function wHe(e,t){let n=[];return Re.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 tle(e,t){try{Jy(t),await vHe(t),await SHe(e,t),_O(t),await wHe(e,t),bO(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new se(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Qt.checkSupportedExtensions(i),e._gltf=t,e._state=yt.READY,e}catch(n){if(e.isDestroyed())return;y7(e,n)}}async function nle(e,t){let n;try{bl(t)==="glTF"?n=yO(t):n=Ho(t)}catch(i){if(e.isDestroyed())return;y7(e,i)}return tle(e,n)}e0.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};e0.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var zE=e0;var IHe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Ym=Object.freeze(IHe);var Do={};function PHe(){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 DHe(){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 RHe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function OHe(){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 MHe(){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 LHe(){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 NHe(){this.attributes=[]}function FHe(){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 BHe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function kHe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function UHe(){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 zHe(){this.nodes=[]}var VHe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function HHe(){this.input=[],this.interpolation=void 0,this.output=[]}function GHe(){this.node=void 0,this.path=void 0}function jHe(){this.sampler=void 0,this.target=void 0}function WHe(){this.name=void 0,this.samplers=[],this.channels=[]}function qHe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function YHe(){this.name=void 0,this.stages=[]}function ile(){this.credits=[]}function XHe(){this.asset=new ile,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=M.clone(M.IDENTITY),this.extensions={}}function KHe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.scale=1,this.channels=void 0}function t0(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(t0.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=t0.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=t0.DEFAULT_ROUGHNESS_FACTOR}t0.DEFAULT_BASE_COLOR_FACTOR=ie.ONE;t0.DEFAULT_METALLIC_FACTOR=1;t0.DEFAULT_ROUGHNESS_FACTOR=1;function oT(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(oT.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(oT.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=oT.DEFAULT_GLOSSINESS_FACTOR}oT.DEFAULT_DIFFUSE_FACTOR=ie.ONE;oT.DEFAULT_SPECULAR_FACTOR=h.ONE;oT.DEFAULT_GLOSSINESS_FACTOR=1;function IO(){this.specularFactor=IO.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(IO.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}IO.DEFAULT_SPECULAR_FACTOR=1;IO.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function PO(){this.anisotropyStrength=PO.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=PO.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}PO.DEFAULT_ANISOTROPY_STRENGTH=0;PO.DEFAULT_ANISOTROPY_ROTATION=0;function DO(){this.clearcoatFactor=DO.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=DO.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}DO.DEFAULT_CLEARCOAT_FACTOR=0;DO.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function b7(){this.metallicRoughness=new t0,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=h.clone(b7.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Ym.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}b7.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Do.Quantization=PHe;Do.Attribute=DHe;Do.Indices=RHe;Do.FeatureIdAttribute=OHe;Do.FeatureIdTexture=LHe;Do.FeatureIdImplicitRange=MHe;Do.MorphTarget=NHe;Do.Primitive=FHe;Do.Instances=BHe;Do.Skin=kHe;Do.Node=UHe;Do.Scene=zHe;Do.AnimatedPropertyType=Object.freeze(VHe);Do.AnimationSampler=HHe;Do.AnimationTarget=GHe;Do.AnimationChannel=jHe;Do.Animation=WHe;Do.ArticulationStage=qHe;Do.Articulation=YHe;Do.Asset=ile;Do.Components=XHe;Do.TextureReader=KHe;Do.MetallicRoughness=t0;Do.SpecularGlossiness=oT;Do.Specular=IO;Do.Anisotropy=PO;Do.Clearcoat=DO;Do.Material=b7;var Tn=Do;var E4={};E4.getImageIdFromTexture=function(e){e=e??G.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};E4.createSampler=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=sn.REPEAT,r=sn.REPEAT,s=ft.LINEAR,a=Kn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];o=d.wrapS??o,r=d.wrapT??r,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==ft.LINEAR&&s!==ft.NEAREST&&(s===ft.NEAREST_MIPMAP_NEAREST||s===ft.NEAREST_MIPMAP_LINEAR?s=ft.NEAREST:s=ft.LINEAR),new zt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var $He=new V(1,1);E4.createModelTextureReader=function(e){e=e??G.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)?V.unpack(s.offset):V.ZERO,u=s.rotation??0,f=l(s.scale)?V.unpack(s.scale):$He;u=-u,r=new Z(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new Tn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var ou=E4;function ZHe(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var n0=ZHe;function i0(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=e.asynchronous??!0,u=i.index,f=ou.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(i0.prototype=Object.create(Zi.prototype),i0.prototype.constructor=i0);Object.defineProperties(i0.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var QHe=new x7;async function JHe(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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load texture",n)}}i0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=JHe(this),this._promise)};function x7(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}x7.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};x7.prototype.execute=function(){this.texture=ole(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function ole(e,t,n,i,o,r){let s=i.internalFormat,a=!1;je.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=ou.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===ft.NEAREST_MIPMAP_NEAREST||u===ft.NEAREST_MIPMAP_LINEAR||u===ft.LINEAR_MIPMAP_NEAREST||u===ft.LINEAR_MIPMAP_LINEAR,_=!l(s)&&p,m=_||f===sn.REPEAT||f===sn.MIRRORED_REPEAT||d===sn.REPEAT||d===sn.MIRRORED_REPEAT,y=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),b=m&&y,x;return l(s)?(!r.webgl2&&je.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),x=dt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(b&&(i=n0(i)),x=dt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),_&&x.generateMipmap(),x}i0.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=yt.PROCESSING;let t;if(this._asynchronous){let n=QHe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,tc.TEXTURE))return;t=n.texture}else t=ole(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=yt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};i0.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 VE=i0;function o0(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,c=e.attributeSemantic,u=e.accessorId,f=e.cacheKey,d=e.asynchronous??!0,p=e.loadBuffer??!1,_=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=u,this._cacheKey=f,this._asynchronous=d,this._loadBuffer=p,this._loadTypedArray=_,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(o0.prototype=Object.create(Zi.prototype),o0.prototype.constructor=o0);Object.defineProperties(o0.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 eGe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}o0.prototype.load=async function(){return l(this._promise)?this._promise:eGe(this._draco,this._attributeSemantic)?(this._promise=nGe(this),this._promise):(this._promise=oGe(this),this._promise)};function tGe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Tn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=rn.VEC2,a.normalizationRange=r;else{let c=rn.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function nGe(e){e._state=yt.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=yt.LOADED,e)}catch{if(e.isDestroyed())return;T7(e)}}function iGe(e){e._state=yt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=tGe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function oGe(e){e._state=yt.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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;T7(e,n)}}function T7(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load vertex buffer",t)}function C7(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}C7.prototype.set=function(e,t){this.typedArray=e,this.context=t};C7.prototype.execute=function(){this.buffer=rle(this.typedArray,this.context)};function rle(e,t){let n=st.createVertexBuffer({typedArray:e,context:t,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var rGe=new C7;o0.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){T7(this,i)}iGe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=rGe;if(i.set(n,e.context),!e.jobScheduler.execute(i,tc.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=rle(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};o0.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 HE=o0;function RO(e){e=e??G.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=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}RO.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=jm.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new RO({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(RO.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}}});RO.BATCH_TABLE_CLASS_NAME="_batchTable";var Ah=RO;function S4(e){e=e??G.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}S4.fromJson=function(e){return new S4({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(S4.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 OO=S4;function v4(e){e=e??G.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??Ft.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=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}v4.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return OO.fromJson(o)});return new v4({id:t,values:i,valueType:Ft[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(v4.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 MO=v4;function w4(e){e=e??G.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=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}w4.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=MO.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]=Ah.fromJson({id:i,class:e.classes[i],enums:t}));return new w4({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(w4.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 qu=w4;function rT(e){e=e??G.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?qu.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(rT.prototype=Object.create(Zi.prototype),rT.prototype.constructor=rT);Object.defineProperties(rT.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});rT.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=sGe(this),this._promise)};async function sGe(e){let t=e._resource;e._state=yt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=qu.fromJson(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}rT.prototype.unload=function(){this._schema=void 0};var GE=rT;var Eh={};function jE(e){return Ou(e.url)}function I4(e){let{byteOffset:t,byteLength:n}=e;if(ai(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function aGe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function sle(e,t){return`${jE(e)}-buffer-id-${t}`}function LO(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return jE(o)}return sle(n,t)}function A7(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=LO(a,s,n,i),u=I4(r);return`${c}-range-${u}`}function ale(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 jE(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=LO(u,c,n,i),d=I4(a);return`${f}-range-${d}`}function cGe(e,t){let n=ou.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Eh.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${jE(n)}`};Eh.getExternalBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${jE(t)}`};Eh.getEmbeddedBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${sle(t,n)}`};Eh.getGltfCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${jE(t)}`};Eh.getBufferViewCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ai(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=LO(a,s,i,o),u=I4(r);return`buffer-view:${c}-range-${u}`};Eh.getDracoCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${A7(t,n,i,o)}`};Eh.getVertexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${o.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${A7(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[r],_=p.buffer,m=t.buffers[_],y=LO(m,_,n,i),b=I4(p);return`vertex-buffer:${y}-range-${b}${d}`};Eh.getIndexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${A7(t,s,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],_=p.buffer,m=t.buffers[_],y=LO(m,_,i,o),b=aGe(f,p);return`index-buffer:${y}-accessor-${b}${u}`};Eh.getImageCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${ale(t,n,i,o)}`};Eh.getTextureCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=ou.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=ale(t,c,i,o),f=cGe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var ru=Eh;function NO(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}NO.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};NO.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};NO.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};NO.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 FO=NO;function Bn(){}Bn.cacheEntries={};Bn.statistics=new FO;function lGe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Bn.get=function(e){let t=Bn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Bn.add=function(e){let t=e.cacheKey;return Bn.cacheEntries[t]=new lGe(e),e};Bn.unload=function(e){let t=e.cacheKey,n=Bn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Bn.statistics.removeLoader(e),e.destroy(),delete Bn.cacheEntries[t])};Bn.getSchemaLoader=function(e){e=e??G.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=ru.getSchemaCacheKey({schema:t,resource:n}),o=Bn.get(i);return l(o)?o:(o=new GE({schema:t,resource:n,cacheKey:i}),Bn.add(o))};Bn.getEmbeddedBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=ru.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Bn.get(o);return l(r)?r:(r=new Zx({typedArray:i,cacheKey:o}),Bn.add(r))};Bn.getExternalBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e,n=ru.getExternalBufferCacheKey({resource:t}),i=Bn.get(n);return l(i)?i:(i=new Zx({resource:t,cacheKey:n}),Bn.add(i))};Bn.getGltfJsonLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=ru.getGltfCacheKey({gltfResource:t}),s=Bn.get(r);return l(s)?s:(s=new zE({resourceCache:Bn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Bn.add(s))};Bn.getBufferViewLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=ru.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Bn.get(r);return l(s)?s:(s=new NE({resourceCache:Bn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Bn.add(s))};Bn.getDracoLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,s=ru.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Bn.get(s);return l(a)?a:(a=new FE({resourceCache:Bn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Bn.add(a))};Bn.getVertexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:u,asynchronous:f=!0,dequantize:d=!1,loadBuffer:p=!1,loadTypedArray:_=!1}=e,m=ru.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:c,dequantize:d,loadBuffer:p,loadTypedArray:_}),y=Bn.get(m);return l(y)?y:(y=new HE({resourceCache:Bn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:u,cacheKey:m,asynchronous:f,dequantize:d,loadBuffer:p,loadTypedArray:_}),Bn.add(y))};Bn.getIndexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=ru.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),p=Bn.get(d);return l(p)?p:(p=new kE({resourceCache:Bn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Bn.add(p))};Bn.getImageLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=ru.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Bn.get(r);return l(s)?s:(s=new BE({resourceCache:Bn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Bn.add(s))};Bn.getTextureLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=ru.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Bn.get(c);return l(u)?u:(u=new VE({resourceCache:Bn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Bn.add(u))};Bn.clearForSpecs=function(){let e=[HE,kE,FE,VE,BE,NE,Zx,GE,zE],t,n=Bn.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])}Bn.statistics.clear()};var Di=Bn;function Pa(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(Pa.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}}});Pa.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Pa.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Pa.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Pa.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Pa.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Pa.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Pa.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Pa.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===fs.OCTREE&&(t=3),e>>t};Pa.fromSubtreeJson=async function(e,t,n,i,o){let r=new Pa(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=uGe(n);let a=s.json;r._subtreeJson=a;let c;if(ai(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let C=0;C<T;C++){let A=a.contentMetadata[C];u.push(a.propertyTables[A])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let T=p.class,C=d.classes[T];f=new lO({subtreeMetadata:p,class:C})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let _={constant:0};a.contentAvailabilityHeaders=[],ai(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??_);let m=fGe(a.buffers),y=dGe(a.bufferViews,m);hGe(a,y),l(c)&&cle(c,y);for(let T=0;T<u.length;T++){let C=u[T];cle(C,y)}let b=await mGe(r,m,s.binary),x=_Ge(y,b);return gGe(r,a,i,x),l(c)&&(yGe(r,i,x),xGe(r)),bGe(r,i,x),TGe(r),r._ready=!0,r};function uGe(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=Ho(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function fGe(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 dGe(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 hGe(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 cle(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 mGe(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=pGe(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 pGe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Di.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function _Ge(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 gGe(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=ai(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=E7(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let _=E7(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(_)}e._childSubtreeAvailability=E7(t.childSubtreeAvailability,i,a)}function E7(e,t,n,i){if(l(e.constant))return new ME({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 ME({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function yGe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new od({class:a,count:o,properties:i.properties,bufferViews:n})}function bGe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,d=c.class,p=r.classes[d],_=new od({class:p,count:f,properties:c.properties,bufferViews:n});s.push(_)}}function lle(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 xGe(e){let t=lle(e._tileAvailability);e._tileJumpBuffer=t}function TGe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=lle(o);t.push(r)}}Pa.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new se("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Pa.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new se("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function CGe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function AGe(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]}Pa.prototype.getTileMetadataView=function(e){let t=CGe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new LE({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Pa.prototype.getContentMetadataView=function(e,t){let n=AGe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new LE({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Pa.prototype.isDestroyed=function(){return!1};Pa.prototype.destroy=function(){return l(this._bufferLoader)&&Di.unload(this._bufferLoader),ce(this)};var sT=Pa;var EGe={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"},aT=Object.freeze(EGe);var Sh={};Sh.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Sh.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Sh._parseMinimumHeight("TILE",e),maximumHeight:Sh._parseMaximumHeight("TILE",e)},content:{boundingVolume:Sh.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Sh._parseMinimumHeight("CONTENT",e),maximumHeight:Sh._parseMaximumHeight("CONTENT",e)}}};Sh.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}};Sh._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Sh._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var cT=Sh;function Tl(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(Tl.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}}});Tl.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await sT.fromSubtreeJson(n,i,s,a,c),f=new Tl(e,t,n);return f._implicitSubtree=u,SGe(f,u),f._ready=!0,f};function SGe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=wGe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=vGe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=FGe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function vGe(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 wGe(e,t,n,i){let s=ule(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),_=f.branchingFactor*c.length;for(let m=0;m<_;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),x=c[b],T=m%f.branchingFactor,C=ule(e,t,x,T,y);x.children.push(C),a.numberOfTilesTotal++,u.push(C)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function fle(e,t,n){let i=aT.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function ule(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let w=cT.parseAllBoundingVolumeSemantics(c);u=w.tile,f=w.content}let p=t.contentPropertyTableJsons.length,_=!1;for(let w=0;w<p;w++)if(t.contentIsAvailableAtCoordinates(a,w)){_=!0;break}let m=DGe(s,a,i,r,n,u),y=[];for(let w=0;w<s.contentCount;w++){if(!t.contentIsAvailableAtIndex(o,w))continue;let O={uri:s.contentUriTemplates[w].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=RGe(m,f);l(L)&&(O.boundingVolume=L),y.push(ct(O,s.contentHeaders[w]))}let b=fle(c,s,a),x={boundingVolume:m,geometricError:b,refine:s.refine,contents:y},T=!0,C=Fe(s.tileHeader,T);delete C.boundingVolume,delete C.transform,delete C.metadata;let A=ct(x,C,T),S=_le(e,s.baseResource,A,n);return S.implicitCoordinates=a,S.implicitSubtree=t,S.metadata=c,S.hasImplicitContentMetadata=_,S}function P4(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ai(e,"3DTILES_bounding_volume_S2")||l(e.region))}function v7(e,t){l(t)&&(ai(e,"3DTILES_bounding_volume_S2")?PGe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&IGe(e.region,t.minimumHeight,t.maximumHeight))}function IGe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function PGe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function DGe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!P4(r.boundingVolume,r)&&P4(e.boundingVolume,r)?s=dle(e,t,n,i??!1,o):s=r.boundingVolume,v7(s,r),s}function RGe(e,t){let n;return l(t)&&(n=t.boundingVolume),P4(n,t)?v7(n,t):P4(e,t)&&(n=Fe(e,!0),v7(n,t)),n}function dle(e,t,n,i,o){let r=e.boundingVolume;return ai(r,"3DTILES_bounding_volume_S2")?hle(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:ple(r.region,t.level,t.x,t.y,t.z)}:{box:mle(r.box,t.level,t.x,t.y,t.z)}}function hle(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)),u=c%2===0?RE.encode2D(i,o,r):RE.encode2D(i,r,o),f=P_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let _=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:_,p=n<4?_:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:P_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var OGe=new h,MGe=new h,S7=new h,LGe=new Z;function mle(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,MGe),s=Z.unpack(e,3,LGe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,OGe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=h.fromElements(c,u,f,S7);p=Z.multiplyByVector(s,p,S7),p=h.add(p,r,S7);let _=Z.clone(s);_=Z.multiplyByScale(_,d,_);let m=new Array(12);return h.pack(p,m),Z.pack(_,m,3),m}var NGe=new ae;function ple(e,t,n,i,o){if(t===0)return e.slice();let r=ae.unpack(e,0,NGe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=D.negativePiToPi(r.west+n*u),d=D.negativePiToPi(f+u),p=c*r.height,_=D.negativePiToPi(r.south+i*p),m=D.negativePiToPi(_+p),y=s,b=a;if(l(o)){let x=c*(a-s);y+=o*x,b=y+x}return[f,_,d,m,y,b]}function FGe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=dle(i,o,n,!1,t),s=fle(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=_le(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function _le(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Tl.prototype.hasProperty=function(e,t){return!1};Tl.prototype.getFeature=function(e){};Tl.prototype.applyDebugSettings=function(e,t){};Tl.prototype.applyStyle=function(e){};Tl.prototype.update=function(e,t){};Tl.prototype.pick=function(e,t,n){};Tl.prototype.isDestroyed=function(){return!1};Tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ce(this)};Tl._deriveBoundingBox=mle;Tl._deriveBoundingRegion=ple;Tl._deriveBoundingVolumeS2=hle;var WE=Tl;var BGe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},su=Object.freeze(BGe);function qE(e,t){this._distance=t,this._normal=new gle(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(qE.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});qE.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new qE(e.normal,e.distance),t};qE.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new qE(e.normal,e.distance)};function gle(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(gle.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 lT=qE;function Oc(e){e=e??G.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=H.clone(e.edgeColor??H.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Cle:Ale,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 Cle(e){return e===Ht.OUTSIDE}function Ale(e){return e===Ht.INSIDE}Object.defineProperties(Oc.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?Cle:Ale)}},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 yle(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Oc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){yle(n,i)},e.index=t,yle(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Oc.prototype.get=function(e){return this._planes[e]};function Ele(e,t){let n=e.length;for(let i=0;i<n;++i)if(en.equals(e[i],t))return i;return-1}Oc.prototype.contains=function(e){return Ele(this._planes,e)!==-1};Oc.prototype.remove=function(e){let t=this._planes,n=Ele(t,e);if(n===-1)return!1;e instanceof lT&&(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 lT&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Oc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof lT&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var kGe=new ie,UGe=new ie;function ble(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=On.octEncodeToCartesian4(a.normal,UGe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(a.distance,kGe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function xle(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 Sle(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var zGe=new V;Oc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Oc.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=Sle(o,zGe);s.y*=2,i?(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.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?(xle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(ble(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),xle(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),ble(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 VGe=new M,Tle=new en(h.UNIT_X,0);Oc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=M.multiply(t,o,VGe));let r=Ht.INSIDE;!this.unionClippingRegions&&i>0&&(r=Ht.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];en.transform(a,o,Tle);let c=e.intersectPlane(Tle);if(c===Ht.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Oc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Oc.useFloatTexture=function(e){return e.floatingPointTexture};Oc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Oc.useFloatTexture(t)?e.length:e.length*2,r=Sle(o,n);return r.y*=2,r};Oc.prototype.isDestroyed=function(){return!1};Oc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ce(this)};var Ss=Oc;function P7(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=wle(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=qGe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,d=-1/0;for(let p=n;p<o;p+=n){let _=e[p],m=e[p+1];_<a&&(a=_),m<c&&(c=m),_>f&&(f=_),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return kO(r,s,n,a,c,u,0),s}function wle(e,t,n,i,o){let r;if(o===i5e(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=vle(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=vle(s/i|0,e[s],e[s+1],r);return r&&YE(r,r.next)&&(zO(r),r=r.next),r}function uT(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(YE(n,n.next)||Yr(n.prev,n,n.next)===0)){if(zO(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function kO(e,t,n,i,o,r,s){if(!e)return;!s&&r&&ZGe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?GGe(e,i,o,r):HGe(e)){t.push(c.i,e.i,u.i),zO(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=jGe(uT(e),t),kO(e,t,n,i,o,r,2)):s===2&&WGe(e,t,n,i,o,r):kO(uT(e),t,n,i,o,r,1);break}}}function HGe(e){let t=e.prev,n=e,i=e.next;if(Yr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(o,r,s),d=Math.min(a,c,u),p=Math.max(o,r,s),_=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=_&&BO(o,a,r,c,s,u,m.x,m.y)&&Yr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function GGe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Yr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,_=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),b=Math.max(f,d,p),x=w7(_,m,t,n,i),T=w7(y,b,t,n,i),C=e.prevZ,A=e.nextZ;for(;C&&C.z>=x&&A&&A.z<=T;){if(C.x>=_&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&BO(a,f,c,d,u,p,C.x,C.y)&&Yr(C.prev,C,C.next)>=0||(C=C.prevZ,A.x>=_&&A.x<=y&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&BO(a,f,c,d,u,p,A.x,A.y)&&Yr(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;C&&C.z>=x;){if(C.x>=_&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&BO(a,f,c,d,u,p,C.x,C.y)&&Yr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;A&&A.z<=T;){if(A.x>=_&&A.x<=y&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&BO(a,f,c,d,u,p,A.x,A.y)&&Yr(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function jGe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!YE(i,o)&&Ple(i,n,n.next,o)&&UO(i,o)&&UO(o,i)&&(t.push(i.i,n.i,o.i),zO(n),zO(n.next),n=e=o),n=n.next}while(n!==e);return uT(n)}function WGe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&e5e(s,a)){let c=Dle(s,a);s=uT(s,s.next),c=uT(c,c.next),kO(s,t,n,i,o,r,0),kO(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function qGe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=wle(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(JGe(u))}o.sort(YGe);for(let r=0;r<o.length;r++)n=XGe(o[r],n);return n}function YGe(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 XGe(e,t){let n=KGe(e,t);if(!n)return t;let i=Dle(n,e);return uT(i,i.next),uT(n,n.next)}function KGe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(YE(e,n))return n;do{if(YE(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let d=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>r&&(r=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Ile(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let d=Math.abs(o-n.y)/(i-n.x);UO(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&$Ge(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function $Ge(e,t){return Yr(e.prev,e,t.prev)<0&&Yr(t.next,e,e.next)<0}function ZGe(e,t,n,i){let o=e;do o.z===0&&(o.z=w7(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,QGe(o)}function QGe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function w7(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 JGe(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 Ile(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 BO(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Ile(e,t,n,i,o,r,s,a)}function e5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!t5e(e,t)&&(UO(e,t)&&UO(t,e)&&n5e(e,t)&&(Yr(e.prev,e,t.prev)||Yr(e,t.prev,t))||YE(e,t)&&Yr(e.prev,e,e.next)>0&&Yr(t.prev,t,t.next)>0)}function Yr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function YE(e,t){return e.x===t.x&&e.y===t.y}function Ple(e,t,n,i){let o=R4(Yr(e,t,n)),r=R4(Yr(e,t,i)),s=R4(Yr(n,i,e)),a=R4(Yr(n,i,t));return!!(o!==r&&s!==a||o===0&&D4(e,n,t)||r===0&&D4(e,i,t)||s===0&&D4(n,e,i)||a===0&&D4(n,t,i))}function D4(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 R4(e){return e>0?1:e<0?-1:0}function t5e(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&&Ple(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function UO(e,t){return Yr(e.prev,e,e.next)<0?Yr(e,t,e.next)>=0&&Yr(e,e.prev,t)>=0:Yr(e,t,e.prev)<0||Yr(e,e.next,t)<0}function n5e(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 Dle(e,t){let n=I7(e.i,e.x,e.y),i=I7(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 vle(e,t,n,i){let o=I7(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 zO(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 I7(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function i5e(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 o5e=new h,r5e=new h,r0={};r0.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};r0.computeWindingOrder2D=function(e){return r0.computeArea2D(e)>0?Cs.COUNTER_CLOCKWISE:Cs.CLOCKWISE};r0.triangulate=function(e,t){let n=V.packArray(e);return P7(n,t,2)};var Lle=new h,Nle=new h,Fle=new h,Rle=new h,Ole=new h,Mle=new h,B_=new h,Ble=new V,kle=new V,Ule=new V,XE=new V;r0.computeSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let C=t[a];if(u[d++]=C.x,u[d++]=C.y,u[d++]=C.z,r){let A=i[a];f[p++]=A.x,f[p++]=A.y}}let _=[],m={},y=e.maximumRadius,b=D.chordLength(o,y),x=b*b;for(;s.length>0;){let C=s.pop(),A=s.pop(),S=s.pop(),w=h.fromArray(u,S*3,Lle),R=h.fromArray(u,A*3,Nle),P=h.fromArray(u,C*3,Fle),O,L,g;r&&(O=V.fromArray(f,S*2,Ble),L=V.fromArray(f,A*2,kle),g=V.fromArray(f,C*2,Ule));let E=h.multiplyByScalar(h.normalize(w,Rle),y,Rle),v=h.multiplyByScalar(h.normalize(R,Ole),y,Ole),I=h.multiplyByScalar(h.normalize(P,Mle),y,Mle),N=h.magnitudeSquared(h.subtract(E,v,B_)),F=h.magnitudeSquared(h.subtract(v,I,B_)),U=h.magnitudeSquared(h.subtract(I,E,B_)),k=Math.max(N,F,U),z,B,j;k>x?N===k?(z=`${Math.min(S,A)} ${Math.max(S,A)}`,a=m[z],l(a)||(B=h.add(w,R,B_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(O,L,XE),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(S,a,C),s.push(a,A,C)):F===k?(z=`${Math.min(A,C)} ${Math.max(A,C)}`,a=m[z],l(a)||(B=h.add(R,P,B_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(L,g,XE),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(A,a,S),s.push(a,C,S)):U===k&&(z=`${Math.min(C,S)} ${Math.max(C,S)}`,a=m[z],l(a)||(B=h.add(P,w,B_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(g,O,XE),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(C,a,A),s.push(a,S,A)):(_.push(S),_.push(A),_.push(C))}let T={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Le.TRIANGLES};return r&&(T.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new lt(T)};var s5e=new fe,a5e=new fe,c5e=new fe,D7=new fe;r0.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let S=t[a];if(u[d++]=S.x,u[d++]=S.y,u[d++]=S.z,r){let w=i[a];f[p++]=w.x,f[p++]=w.y}}let _=[],m={},y=e.maximumRadius,b=D.chordLength(o,y),x=new Qa(void 0,void 0,e),T=new Qa(void 0,void 0,e),C=new Qa(void 0,void 0,e);for(;s.length>0;){let S=s.pop(),w=s.pop(),R=s.pop(),P=h.fromArray(u,R*3,Lle),O=h.fromArray(u,w*3,Nle),L=h.fromArray(u,S*3,Fle),g,E,v;r&&(g=V.fromArray(f,R*2,Ble),E=V.fromArray(f,w*2,kle),v=V.fromArray(f,S*2,Ule));let I=e.cartesianToCartographic(P,s5e),N=e.cartesianToCartographic(O,a5e),F=e.cartesianToCartographic(L,c5e);x.setEndPoints(I,N);let U=x.surfaceDistance;T.setEndPoints(N,F);let k=T.surfaceDistance;C.setEndPoints(F,I);let z=C.surfaceDistance,B=Math.max(U,k,z),j,W,J,Y,ee;B>b?U===B?(j=`${Math.min(R,w)} ${Math.max(R,w)}`,a=m[j],l(a)||(W=x.interpolateUsingFraction(.5,D7),J=(I.height+N.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,B_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(g,E,XE),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(R,a,S),s.push(a,w,S)):k===B?(j=`${Math.min(w,S)} ${Math.max(w,S)}`,a=m[j],l(a)||(W=T.interpolateUsingFraction(.5,D7),J=(N.height+F.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,B_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(E,v,XE),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(w,a,R),s.push(a,S,R)):z===B&&(j=`${Math.min(S,R)} ${Math.max(S,R)}`,a=m[j],l(a)||(W=C.interpolateUsingFraction(.5,D7),J=(F.height+I.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,B_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(v,g,XE),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(S,a,w),s.push(a,R,w)):(_.push(R),_.push(w),_.push(S))}let A={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Le.TRIANGLES};return r&&(A.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new lt(A)};r0.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=o5e,r=r5e;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var li=r0;function s0(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(s0.prototype,{length:{get:function(){return this._length}}});s0.prototype.enqueue=function(e){this._array.push(e),this._length++};s0.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};s0.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};s0.prototype.contains=function(e){return this._array.indexOf(e)!==-1};s0.prototype.clear=function(){this._array.length=this._offset=this._length=0};s0.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Cl=s0;var cr={};cr.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};cr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};cr.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]=cr.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var fT=new V;function Hle(e,t,n,i){return V.subtract(t,e,fT),V.multiplyByScalar(fT,n/i,fT),V.add(e,fT,fT),[fT.x,fT.y]}var a0=new h;function l5e(e,t,n,i){return h.subtract(t,e,a0),h.multiplyByScalar(a0,n/i,a0),h.add(e,a0,a0),[a0.x,a0.y,a0.z]}cr.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(D.log2(o)));return Math.pow(2,r)};var M4=new fe,L4=new fe,u5e=new fe,f5e=new h,O4=new Qa;cr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,M4),r=e.cartesianToCartographic(n,L4),a=new Qa(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};cr.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=cr.subdivideLineCount(n,i,o),a=V.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Hle(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};cr.subdivideLine=function(e,t,n,i){let o=cr.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=l5e(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};cr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,M4),c=n.cartesianToCartographic(o,L4);O4.setEndPoints(a,c);let u=O4.surfaceDistance/r,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=V.distance(e,t),_=p/d,m=s;m.length=d*2;let y=0;for(let b=0;b<d;b++){let x=Hle(e,t,b*_,p);m[y++]=x[0],m[y++]=x[1]}return m};cr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,M4),s=e.cartesianToCartographic(n,L4),a=new Qa(r,s,e);if(l(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=o;p.length=f*3;let _=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,u5e),b=e.cartographicToCartesian(y,f5e);p[_++]=b.x,p[_++]=b.y,p[_++]=b.z}return p};var d5e=new h,h5e=new h,m5e=new h,p5e=new h;cr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=d5e,s=h5e,a=m5e,c=p5e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};cr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new Cl;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=So(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=So(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let _=0;for(l(d.holes)&&(_=d.holes.length),s=0;s<_;s++)o.enqueue(d.holes[s])}i.push(u)}return i};var _5e=new fe;function g5e(e,t,n){let i=n.cartesianToCartographic(e,M4),o=n.cartesianToCartographic(t,L4);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;O4.setEndPoints(i,o);let r=O4.findIntersectionWithLatitude(0,_5e);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>D.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function y5e(e,t,n,i){if(i===tn.RHUMB)return g5e(e,t,n);let o=ti.lineSegmentPlane(e,t,en.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var b5e=new fe;function x5e(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=D.sign(o.z),a=D.sign(r.z);let f=d=>t.cartesianToCartographic(d,b5e).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=y5e(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Gle(e,t,n,i,o,r,s){let a=[],c=r,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),_=i[p];if(!l(_)){++c;continue}let{visited:m,type:y,next:b}=_;if(_.visited=!0,y===0){if(b===0){let A=i[p-(s?1:-1)];if(A?.position===c+1)A.visited=!0;else{++c;continue}}if(!m&&s&&b>0||r===c&&!s&&b<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let T=p+(s?1:-1),C=i[T];if(!l(C)){++c;continue}c=C.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let d of f)t=Gle(e,++t,n,i,0,d,!s);return t}cr.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=x5e(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=Gle(i,o,s,a,1,0,c)}return i};cr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new Cl;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,_,m;if(i)for(m=d.length,_=0;_<m;_++)o.scaleToGeodeticSurface(d[_],d[_]);if(t||(d=So(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let b=[],x=li.computeWindingOrder2D(y);if(x===Cs.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let w=[d];if(w=r(w,w),w.length>1){for(let R of w)c.enqueue(new Ja(R,p));continue}}let T=d.slice(),C=l(p)?p.length:0,A=[],S;for(_=0;_<C;_++){let w=p[_],R=w.positions;if(i)for(m=R.length,S=0;S<m;++S)o.scaleToGeodeticSurface(R[S],R[S]);if(t||(R=So(R,h.equalsEpsilon,!0)),R.length<3)continue;let P=n(R);if(!l(P))continue;x=li.computeWindingOrder2D(P),x===Cs.CLOCKWISE&&(P.reverse(),R=R.slice().reverse()),A.push(R),b.push(T.length),T=T.concat(R),y=y.concat(P);let O=0;for(l(w.holes)&&(O=w.holes.length),S=0;S<O;S++)c.enqueue(w.holes[S])}s.push({outerRing:d,holes:A}),a.push({positions:T,positions2D:y,holes:b})}return{hierarchy:s,polygons:a}};var T5e=new V,C5e=new h,A5e=new Pe,E5e=new Z;cr.computeBoundingRectangle=function(e,t,n,i,o){let r=Pe.fromAxisAngle(e,i,A5e),s=Z.fromQuaternion(r,E5e),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let _=h.clone(n[p],C5e);Z.multiplyByVector(s,_,_);let m=t(_,T5e);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};cr.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=li.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),_=0;for(let b=0;b<d;b++){let x=c[b];p[_++]=x.x,p[_++]=x.y,p[_++]=x.z}let m={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Le.TRIANGLES};u&&(m.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:V.packArray(f)}));let y=new lt(m);return r.normal?Nn.computeNormal(y):y}if(s===tn.GEODESIC)return li.computeSubdivision(e,c,a,f,i);if(s===tn.RHUMB)return li.computeRhumbLineSubdivision(e,c,a,f,i)};var zle=[],Vle=[],S5e=new h,v5e=new h;cr.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,d,p,_,m,y=e.length,b=0,x=0,T=l(t),C=T?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),T&&(m=y*2*2,_=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,T&&(d=C[c],p=C[(c+1)%y],_[x]=_[x+m]=d.x,++x,_[x]=_[x+m]=d.y,++x,_[x]=_[x+m]=p.x,++x,_[x]=_[x+m]=p.y,++x);else{let P=D.chordLength(i,n.maximumRadius),O=0;if(r===tn.GEODESIC)for(c=0;c<y;c++)O+=cr.subdivideLineCount(e[c],e[(c+1)%y],P);else if(r===tn.RHUMB)for(c=0;c<y;c++)O+=cr.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],P);for(a=(O+y)*3,s=new Array(a*2),T&&(m=(O+y)*2,_=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,g;T&&(d=C[c],p=C[(c+1)%y]),r===tn.GEODESIC?(L=cr.subdivideLine(u,f,P,Vle),T&&(g=cr.subdivideTexcoordLine(d,p,u,f,P,zle))):r===tn.RHUMB&&(L=cr.subdivideRhumbLine(n,u,f,P,Vle),T&&(g=cr.subdivideTexcoordRhumbLine(d,p,n,u,f,P,zle)));let E=L.length;for(let v=0;v<E;++v,++b)s[b]=L[v],s[b+a]=L[v];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,T){let v=g.length;for(let I=0;I<v;++I,++x)_[x]=g[I],_[x+m]=g[I];_[x]=p.x,_[x+m]=p.x,++x,_[x]=p.y,_[x+m]=p.y,++x}}}y=s.length;let A=ke.createTypedArray(y/3,y-e.length*6),S=0;for(y/=6,c=0;c<y;c++){let P=c,O=P+1,L=P+y,g=L+1;u=h.fromArray(s,P*3,S5e),f=h.fromArray(s,O*3,v5e),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(A[S++]=P,A[S++]=L,A[S++]=O,A[S++]=O,A[S++]=L,A[S++]=g)}let w={attributes:new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),indices:A,primitiveType:Le.TRIANGLES};return T&&(w.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:_})),new lt(w)};var Hn=cr;function Xr(e,t){this.position=e,l(this.position)||(this.position=new V),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Xr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Xr.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=V.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var KE=new fe,w5e=new h;Xr.prototype.getLatitude=function(e){l(e)||(e=te.default),KE.latitude=this.conformalLatitude,KE.longitude=this.longitude,KE.height=0;let t=this.ellipsoid.cartographicToCartesian(KE,w5e);return e.cartesianToCartographic(t,KE),KE.latitude};var I5e=new _n,P5e=new h,D5e=new h;Xr.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=Xr.NORTH_POLE_TANGENT_PLANE,o=Xr.SOUTH_POLE;n<0&&(i=Xr.SOUTH_POLE_TANGENT_PLANE,o=Xr.NORTH_POLE);let r=I5e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,P5e),h.normalize(r.direction,r.direction);let s=ti.rayPlane(r,i.plane,D5e),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new V(c,u),t.tangentPlane=i,t):new Xr(new V(c,u),i)};Xr.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]=Xr.fromCartesian(e[i],t[i]);return t};Xr.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Xr(e.position,e.tangentPlane)};Xr.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));Xr.NORTH_POLE=Object.freeze(new h(0,0,.5));Xr.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Xr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new cs(Xr.NORTH_POLE,Xr.HALF_UNIT_SPHERE));Xr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new cs(Xr.SOUTH_POLE,Xr.HALF_UNIT_SPHERE));var Mc=Xr;var R5e=new fe,jle=new fe;function O5e(e,t,n,i){let r=i.cartesianToCartographic(e,R5e).height,s=i.cartesianToCartographic(t,jle);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,jle);a.height=r-100,i.cartographicToCartesian(a,n)}var Wle=new Xe,M5e=new h,L5e=new h,N5e=new h,F5e=new h,B5e=new h,k5e=new h,N4=new h,Xm=new h,$E=new h,U5e=new V,z5e=new V,V5e=new h,qle=new Pe,H5e=new Z,G5e=new Z;function R7(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,_=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,b=U5e;b.x=f.x,b.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,T;t.normal&&(y&&c&&!a?T=n.attributes.normal.values:T=new Float32Array(s));let C=t.tangent?new Float32Array(s):void 0,A=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,R=0,P=L5e,O=N5e,L=F5e,g=!0,E=H5e,v=G5e;if(m!==0){let F=Pe.fromAxisAngle(d,m,qle);E=Z.fromQuaternion(F,E),F=Pe.fromAxisAngle(d,-m,qle),v=Z.fromQuaternion(F,v)}else E=Z.clone(Z.IDENTITY,E),v=Z.clone(Z.IDENTITY,v);let I=0,N=0;c&&u&&(I=s/2,N=s/3,s/=2);for(let F=0;F<s;F+=3){let U=h.fromArray(o,F,V5e);if(t.st&&!l(r)){let k=Z.multiplyByVector(E,U,M5e);k=_.scaleToGeodeticSurface(k,k);let z=p([k],z5e)[0];V.subtract(z,b,z);let B=D.clamp(z.x/f.width,0,1),j=D.clamp(z.y/f.height,0,1);u&&(x[w+N]=B,x[w+1+N]=j),c&&(x[w]=B,x[w+1]=j),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=R+1,z=R+2;if(a){if(F+3<s){let B=h.fromArray(o,F+3,B5e);if(g){let j=h.fromArray(o,F+s,k5e);y&&O5e(U,B,j,_),h.subtract(B,U,B),h.subtract(j,U,j),P=h.normalize(h.cross(j,B,P),P),g=!1}h.equalsEpsilon(B,U,D.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=_.geodeticSurfaceNormal(U,L),t.tangent&&(O=h.normalize(h.cross(L,P,O),O)))}else P=_.geodeticSurfaceNormal(U,P),(t.tangent||t.bitangent)&&(y&&(N4=h.fromArray(T,R,N4),Xm=h.cross(h.UNIT_Z,N4,Xm),Xm=h.normalize(Z.multiplyByVector(v,Xm,Xm),Xm),t.bitangent&&($E=h.normalize(h.cross(N4,Xm,$E),$E))),O=h.cross(h.UNIT_Z,P,O),O=h.normalize(Z.multiplyByVector(v,O,O),O),t.bitangent&&(L=h.normalize(h.cross(P,O,L),L)));t.normal&&(e.wall?(T[R+I]=P.x,T[k+I]=P.y,T[z+I]=P.z):u&&(T[R+I]=-P.x,T[k+I]=-P.y,T[z+I]=-P.z),(c&&!y||a)&&(T[R]=P.x,T[k]=P.y,T[z]=P.z)),i&&(a&&(P=_.geodeticSurfaceNormal(U,P)),S[R+I]=-P.x,S[k+I]=-P.y,S[z+I]=-P.z),t.tangent&&(e.wall?(C[R+I]=O.x,C[k+I]=O.y,C[z+I]=O.z):u&&(C[R+I]=-O.x,C[k+I]=-O.y,C[z+I]=-O.z),c&&(y?(C[R]=Xm.x,C[k]=Xm.y,C[z]=Xm.z):(C[R]=O.x,C[k]=O.y,C[z]=O.z))),t.bitangent&&(u&&(A[R+I]=L.x,A[k+I]=L.y,A[z+I]=L.z),c&&(y?(A[R]=$E.x,A[k]=$E.y,A[z]=$E.z):(A[R]=L.x,A[k]=L.y,A[z]=L.z))),R+=3}}t.st&&!l(r)&&(n.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(n.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(n.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:A})),i&&(n.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===an.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===an.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Yle=[];function j5e(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let T=Hn.createGeometryFromPositions(e,t,n,i,r,c,u),C=T.attributes.position.values,A=T.indices,S,w;if(s&&a){let R=C.concat(C);S=R.length/3,w=ke.createTypedArray(S,A.length*2),w.set(A);let P=A.length,O=S/2;for(d=0;d<P;d+=3){let L=w[d]+O,g=w[d+1]+O,E=w[d+2]+O;w[d+P]=E,w[d+1+P]=g,w[d+2+P]=L}if(T.attributes.position.values=R,r&&c.normal){let L=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(R.length),T.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=T.attributes.st.values;T.attributes.st.values=new Float32Array(S*2),T.attributes.st.values=L.concat(L)}T.indices=w}else if(a){for(S=C.length/3,w=ke.createTypedArray(S,A.length),d=0;d<A.length;d+=3)w[d]=A[d+2],w[d+1]=A[d+1],w[d+2]=A[d];T.indices=w}f.topAndBottom=new It({geometry:T})}let p=o.outerRing,_=cs.fromPoints(p,e),m=_.projectPointsOntoPlane(p,Yle),y=li.computeWindingOrder2D(m);y===Cs.CLOCKWISE&&(p=p.slice().reverse());let b=Hn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new It({geometry:b}));let x=o.holes;for(d=0;d<x.length;d++){let T=x[d];m=_.projectPointsOntoPlane(T,Yle),y=li.computeWindingOrder2D(m),y===Cs.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),b=Hn.computeWallGeometry(T,n,e,i,r,u),f.walls.push(new It({geometry:b}))}return f}function ad(e){let t=e.polygonHierarchy,n=e.vertexFormat??De.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=De.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??tn.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+te.packedLength+De.packedLength+(s?Hn.computeHierarchyPackedLength(s,V):1)+12}ad.fromPositions=function(e){e=e??G.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 ad(t)};ad.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,V):t[n++]=-1,t[n++]=e.packedLength,t};var W5e=te.clone(te.UNIT_SPHERE),q5e=new De,Y5e={polygonHierarchy:{}};ad.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,W5e);t+=te.packedLength;let r=De.unpack(e,t,q5e);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,_=e[t++]===1,m=e[t++]===1,y=e[t++],b=e[t++],x=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,V);l(x)?(t=x.startingIndex,delete x.startingIndex):t++;let T=e[t++];return l(n)||(n=new ad(Y5e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=_,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=b,n._textureCoordinates=x,n.packedLength=T,n};var X5e=new V,K5e=new V,$5e=new Mc;function Xle(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+D.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==tn.RHUMB){let p=V.subtract(t.position,e.position,X5e),_=V.dot(t.position,p)/V.dot(p,p);if(_>0&&_<1){let m=V.add(t.position,V.multiplyByScalar(p,-_,p),K5e),y=Mc.clone(t,$5e);y.position=m;let b=y.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(c)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=V.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=d),u<=0&&(o.southAngle+=d)}var Kle=new Mc,Z5e=new Mc,sd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};ad.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ae),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,sd.northAngle=0,sd.southAngle=0,sd.westOverIdl=Number.POSITIVE_INFINITY,sd.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Mc.fromCartesian(e[0],Z5e);for(let s=1;s<o;s++){let a=Mc.fromCartesian(e[s],Kle);Xle(a,r,t,n,sd,i),r=Mc.clone(a,r)}return Xle(Mc.fromCartesian(e[0],Kle),r,t,n,sd,i),i.east-i.west>sd.eastOverIdl-sd.westOverIdl&&(i.west=sd.westOverIdl,i.east=sd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(sd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(sd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var Q5e=new Mc;function J5e(e,t,n){return e.height>=D.PI||e.width>=D.PI?Mc.fromCartesian(t[0],Q5e).tangentPlane:cs.fromPoints(t,n)}var $le=new fe;function e6e(e,t,n){return(i,o)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],$le);o[s]=new V(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return o.length=i.length,o}return Mc.fromCartesianArray(i,o)}return cs.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function t6e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,$le);return l(r)||(r=new V),r.x=s.longitude/D.PI,r.y=s.latitude/D.PI_OVER_TWO,r}return Mc.fromCartesian(o,r)};let i=cs.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function n6e(e,t,n,i){return(o,r)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?Hn.splitPolygonsOnEquator(o,t,n,r):o}function i6e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return Xe.fromRectangle(t,void 0,Wle);let o=e,r=cs.fromPoints(o,n);return Hn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Wle)}ad.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let _=e.rectangle,m=Hn.polygonsFromHierarchy(r,d,e6e(_,p,n),!s,n,n6e(_,n,u,s)),y=m.hierarchy,b=m.polygons,x=function(I){return I},T=d?Hn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(y.length===0)return;let C=y[0].outerRing,A=i6e(C,_,n,o),S=[],w=e._height,R=e._extrudedHeight,P=e._perPositionHeightExtrude||!D.equalsEpsilon(w,R,0,D.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:J5e(_,C,n).plane.normal,projectTo2d:t6e(_,C,n),boundingRectangle:A,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(P)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<b.length;L++){let I=j5e(n,b[L],d?T[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=I.topAndBottom,O.geometry=Hn.scaleToGeodeticHeightExtruded(N.geometry,w,R,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=li.scaleToGeodeticHeight(N.geometry.attributes.position.values,w,n,!s),O.geometry=N.geometry):c&&(N=I.topAndBottom,N.geometry.attributes.position.values=li.scaleToGeodeticHeight(N.geometry.attributes.position.values,R,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=R7(O),S.push(N));let F=I.walls;O.wall=!0;for(let U=0;U<F.length;U++){let k=F[U];O.geometry=Hn.scaleToGeodeticHeightExtruded(k.geometry,w,R,n,s),k.geometry=R7(O),S.push(k)}}else for(L=0;L<b.length;L++){let I=new It({geometry:Hn.createGeometryFromPositions(n,b[L],d?T[L]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=li.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!s),O.geometry=I.geometry,I.geometry=R7(O),l(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,F=e._offsetAttribute===an.NONE?0:1,U=new Uint8Array(N/3).fill(F);I.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}S.push(I)}let g=Nn.combineInstances(S)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=ke.createTypedArray(g.attributes.position.values.length/3,g.indices);let E=g.attributes,v=re.fromVertices(E.position.values);return t.position||delete E.position,new lt({attributes:E,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:v,offsetAttribute:e._offsetAttribute})};ad.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new ad({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function o6e(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 lt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(ad.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=ad.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=o6e(this)),this._textureCoordinateRotationPoints}}});var k_=ad;function dT(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=[...e.positions]}Object.defineProperties(dT.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});dT.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new dT({positions:e.positions,ellipsoid:e.ellipsoid})};dT.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};dT.prototype.computeRectangle=function(e){return k_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var r6e=new ae,Zle=new h;dT.prototype.computeSphericalExtents=function(e){l(e)||(e=new ae);let t=this.computeRectangle(r6e),n=fe.toCartesian(ae.southwest(t),this.ellipsoid,Zle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(ae.northeast(t),this.ellipsoid,Zle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var ZE=dT;var VO=`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 ds(e){e=e??G.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new me,this.polygonRemoved=new me,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(ds.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}}});ds.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};ds.prototype.get=function(e){return this._polygons[e]};ds.prototype.contains=function(e){return this._polygons.some(t=>ZE.equals(t,e))};ds.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>ZE.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var s6e=new ae;function a6e(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ae.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let d=[r];for(let p=0;p<t.length;++p){let _=t[p];if(l(_)&&l(ae.simpleIntersection(_,f))&&!ae.equals(_,f)){let m=n[p];d.push(...m),m.reduce((y,b)=>ae.union(e[b].computeSphericalExtents(s6e),y,y),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ae.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(d)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}ds.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 c6e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=a6e(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let d=0;d<f;++d){let p=u.positions[d],_=Math.hypot(p.x,p.y),m=D.fastApproximateAtan2(_,p.z),y=D.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=y}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var O7=new V;ds.prototype.update=function(e){let t=e.context;if(!ds.isSupported(e))throw new se("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=ds.getTextureResolution(i,this.pixelsNeededForPolygonPositions,O7);i=new dt({context:t,width:s.x,height:s.y,pixelFormat:je.RG,pixelDatatype:He.FLOAT,sampler:zt.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=ds.getTextureResolution(o,this.pixelsNeededForExtents,O7);o=new dt({context:t,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(c6e(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=ds.getClippingDistanceTextureResolution(this,O7);r=new dt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?je.RED:je.LUMINANCE,pixelDatatype:He.FLOAT,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=l6e(this)};ds.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function l6e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Ea({fragmentShaderSource:VO,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 Qle=new ae,u6e=new ae;ds.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Ht.OUTSIDE;this.inverse&&(o=Ht.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=ae.fromCartesianArray(f,t,Qle)}l(c)||(c=ae.fromBoundingSphere(e.boundingSphere,t,Qle));let u=ae.simpleIntersection(c,a,u6e);l(u)&&(o=Ht.INTERSECTING)}return o};ds.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ds.isSupported=function(e){return e?.context.webgl2};ds.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Lt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};ds.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Lt.maximumTextureSize,4096),t.y=Math.min(Lt.maximumTextureSize,4096),t)};ds.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):ds.getTextureResolution(n,e.pixelsNeededForExtents,t)};ds.prototype.isDestroyed=function(){return!1};ds.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(),ce(this)};var vh=ds;var HO={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};HO.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?HO.SUNLIGHT:HO.SCENE_LIGHT:HO.NONE};var U_=Object.freeze(HO);function Jle(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(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=U_.NONE}Jle.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var hT=Jle;var wh=`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 GO=`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 jO=`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 WO=`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 qO=`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 ni(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??G.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(Lt.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=ni.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new $;let n=Math.pow(2,t-1);this._textureDimensions=new V(n,n),this._radiiAndDynamicAtmosphereColor=new h,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??ni.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(ni.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.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}}});ni._maximumComputeCommandCount=8;ni._activeComputeCommandCount=0;ni._nextFrameCommandQueue=[];ni._queueCommand=(e,t)=>{if(ni._activeComputeCommandCount>=ni._maximumComputeCommandCount){ni._nextFrameCommandQueue.push(e);return}t.commandList.push(e),ni._activeComputeCommandCount++};ni._updateCommandQueue=e=>{if(ni._maximumComputeCommandCount=Math.log2(Lt.maximumCubeMapSize),ni._nextFrameCommandQueue.length>0&&ni._activeComputeCommandCount<ni._maximumComputeCommandCount){let t=ni._nextFrameCommandQueue.shift();for(;l(t)&&ni._activeComputeCommandCount<ni._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=ni._nextFrameCommandQueue.shift();continue}e.commandList.push(t),ni._activeComputeCommandCount++,t=ni._nextFrameCommandQueue.shift()}l(t)&&ni._nextFrameCommandQueue.push(t)}};ni.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ni.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 f6e=new h,d6e=new h;function h6e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,d6e),s=1.025,a=f6e,c=l(r)?h.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var eue=new h,m6e=new M,p6e=new ie,_6e=new H;function g6e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new or({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Be({sources:[wh,jO]}),e._radianceMapFS=o),hT.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(r,a,m6e),u=p6e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of or.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new dt({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA}),e._radianceMapTextures[f]=p;let _=f,m=new Ea({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>or.getDirection(d,eue),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,_6e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){ni._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[_]=void 0;let b=new Gr({context:n,colorTextures:[e._radianceMapTextures[_]]});b._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),b._unBind(),b.destroy(),ni._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,ni._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function y6e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(d,p,_,m,y)=>()=>{if(e.isDestroyed()||d.canceled){ni._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,_,m,y),c++,ni._activeComputeCommandCount--,_.destroy(),e._specularMapTextures[p]=void 0;let x=e._specularMapTextures.length;c>=x&&(e._irradianceCommandDirty=!0,n.sampler=new zt({minificationFilter:ft.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let d=1;d<i;++d){for(let p of or.faceNames()){l(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let _=e._specularMapTextures[f]=new dt({context:a,width:r,height:s,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA}),m=e._va;l(m)||(m=or.createVertexArray(a,p),e._va=m);let y=e._convolveSP;l(y)||(y=Xt.fromCache({context:a,vertexShaderSource:qO,fragmentShaderSource:WO,attributeLocations:{positions:0}}),e._convolveSP=y);let b=new Ea({shaderProgram:y,vertexArray:m,outputTexture:_,persists:!0,owner:e,uniformMap:{u_roughness:()=>d/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>or.getDirection(p,eue)}});b.postExecute=u(b,f,_,p,d),e._convolutionComputeCommands[f]=b,ni._queueCommand(b,t),++f}r/=2,s/=2}}var tue=new V(3,3);function b6e(e,t){let n=t.context,i=tue,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new dt({context:n,width:i.x,height:i.y,pixelDatatype:He.FLOAT,pixelFormat:je.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Be({sources:[GO]}),e._irradianceMapFS=r);let s=new Ea({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){ni._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,ni._activeComputeCommandCount--},e._irradianceComputeCommand=s,ni._queueCommand(s,t),e._irradianceTextureDirty=!0}function x6e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Gr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=tue,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]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}ni.prototype.update=function(e){let t=e.mode;if(!ni.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}ni._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=h6e(this,e)||i===U_.SUNLIGHT&&!$.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=$.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(g6e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(y6e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(b6e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){x6e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};ni.prototype.isDestroyed=function(){return!1};ni.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(),ce(this)};ni.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};ni.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(H.fromCssColorString("#717145"));ni.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var z_=ni;var YO={HIGHLIGHT:0,REPLACE:1,MIX:2};YO.getColorBlend=function(e,t){if(e===YO.HIGHLIGHT)return 0;if(e===YO.REPLACE)return 1;if(e===YO.MIX)return D.clamp(t,D.EPSILON4,1)};var Lc=Object.freeze(YO);var T6e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Nc=Object.freeze(T6e);var C6e={STEP:0,LINEAR:1,CUBICSPLINE:2},Fc=Object.freeze(C6e);var nue={};function XO(e){this._count=e.count,this._properties=Fe(e.properties,!0)}XO.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,nue)};XO.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,nue,e)};XO.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Fe(n[e],!0)};XO.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Fe(n,!0)};var V_=XO;function Bc(e){e=e??G.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(Bc.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}}});Bc.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))};Bc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Bc.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))};Bc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var M7=[];Bc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(M7)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,M7)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(M7)),t};Bc.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};Bc.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 V_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Bc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Bc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Bc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Bc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Bc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Bc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Bc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Al=Bc;function KO(e){e=e??G.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=ou.createModelTextureReader({textureInfo:r,channels:S6e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(KO.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}}});KO.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(bt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(bt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(bt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Ft.UINT8?(bt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==Ft.UINT8?(bt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(bt(`Property texture property ${e.id} has an unsupported type`),!1)};var A6e=[void 0,"float","vec2","vec3","vec4"],E6e=[void 0,"int","ivec2","ivec3","ivec4"];KO.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?A6e[t]:E6e[t]};KO.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function S6e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var $O=KO;function L7(e){e=e??G.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 $O({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(L7.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}}});L7.prototype.getProperty=function(e){return this._properties[e]};var H_=L7;function iue(e){e=e??G.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(iue.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 ZO=iue;function N7(e){e=e??G.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 ZO({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(N7.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}}});N7.prototype.getProperty=function(e){return this._properties[e]};var mT=N7;function QO(e){e=e??G.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(QO.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}}});QO.prototype.getPropertyTable=function(e){return this._propertyTables[e]};QO.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};QO.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var sa=QO;function v6e(e){e=e??G.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new od({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Al({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new H_({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 mT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new sa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var JO=v6e;function w6e(e){e=e??G.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new od({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new Al({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new H_({id:a,propertyTexture:I6e(c),class:n.classes[c.class],textures:e.textures}))}return new sa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function I6e(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:P6e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=ct(o.texture,r,!0)}return t}function P6e(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 eM=w6e;function c0(e){e=e??G.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(c0.prototype=Object.create(Zi.prototype),c0.prototype.constructor=c0);Object.defineProperties(c0.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function D6e(e){try{let t=N6e(e),n=z6e(e),i=V6e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=yt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load structural metadata",t)}}c0.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=D6e(this),this._promise)};function R6e(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 O6e(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 M6e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];R6e(o.properties,n)}return n}function L6e(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)&&O6e(r,n)}}return n}async function N6e(e){let t;l(e._extension)?t=M6e(e._extension):t=L6e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Di.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function F6e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&B6e(r,t)}return t}function B6e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function k6e(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)&&U6e(r,t)}}return t}function U6e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function z6e(e){let t;l(e._extension)?t=F6e(e._extension):t=k6e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Di.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function V6e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Di.getSchemaLoader({resource:i})}else n=Di.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}c0.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=JO({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=eM({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),oue(this),this._state=yt.READY,!0};function oue(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function H6e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}c0.prototype.unload=function(){oue(this),H6e(this),l(this._schemaLoader)&&Di.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var tM=c0;var QE={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};QE.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return QE.TRANSLATION;case"ROTATION":return QE.ROTATION;case"SCALE":return QE.SCALE;case"_FEATURE_ID":return QE.FEATURE_ID}};var hs=Object.freeze(QE);var G6e=65534,j6e=255;function F4(e){e=e??G.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new aue(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],W6e(this)}Object.defineProperties(F4.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function W6e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),_=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=rue(i,c,u,f,p,_,m);for(;l(y);){let b=s[y];if(!l(b)){b=r+o.length;let x=y;for(;x>=r;)x=o[x-r];o.push(x),s[y]=b}b>G6e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>j6e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=b,t[a]=b):y===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),y=rue(i,c,u,f,p,_,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function rue(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=F7(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,_=r?1:0,m=F7(e,n,d,p,_);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,T=F7(e,i,y,b,x);if(T===0)return i;let C=f&m&T,A,S,w;if(C&1)A=0,S=1,w=2;else if(C&2)A=0,w=1,S=2;else if(C&4)S=0,A=1,w=2;else if(C&8)S=0,w=1,A=2;else if(C&16)w=0,A=1,S=2;else if(C&32)w=0,S=1,A=2;else{let L=B7(f),g=B7(m),E=B7(T);return L<g&&L<E?t:g<E?n:i}let R=t*3;e[R+A]=a,e[R+S]=c,e[R+w]=u;let P=n*3;e[P+A]=d,e[P+S]=p,e[P+w]=_;let O=i*3;e[O+A]=y,e[O+S]=b,e[O+w]=x}function F7(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 B7(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}F4.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};F4.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,Lt.maximumTextureSize),i=n,o=sue(i),r=[];for(;i>1;)i>>=1,r.push(sue(i));let s=new dt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:je.LUMINANCE,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:Kn.LINEAR})});return t.outlineTexture=s,s};function sue(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 aue(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)}}aue.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 pT=F4;function cue(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function q6e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function B4(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}B4.prototype.postProcess=function(e){this.needsOutlines&&(Y6e(this),K6e(this,e))};function Y6e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new pT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=ke.fromTypedArray(n.typedArray);let r=X6e(o.outlineCoordinates),s=new cue(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function X6e(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=K.FLOAT,t.type=rn.VEC3,t.normalized=!1,t.count=e.length/3,t}function K6e(e,t){$6e(e.attributePlans,t),l(e.indicesPlan)&&Z6e(e.indicesPlan,t)}function $6e(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=st.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function Z6e(e,t){let n=e.indices;if(e.loadBuffer){let i=st.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}B4.AttributeLoadPlan=cue;B4.IndicesLoadPlan=q6e;var _T=B4;function Q6e(e){e=e??G.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var nM=Q6e;function lue(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(lue.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var iM=lue;function uue(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(uue.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var oM=uue;function fue(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(fue.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var rM=fue;var J6e={Direct:"Direct",Indirect:"Indirect"},l0=Object.freeze(J6e);function due(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(due.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 JE=due;function hue(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(hue.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 sM=hue;function eS(){}function mue(e){return new Z(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function e9e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new iM({position:t,adjustmentParams:n})}function t9e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=mue(e.covarianceMatrix);return new oM({position:t,adjustmentParams:n,covarianceMatrix:i})}function n9e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new sM({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new rM({groupFlags:t,rotationThetas:n,params:i})}eS.load=function(e){let t=e.storageType;if(t===l0.Direct)return eS.loadDirect(e);if(t===l0.Indirect)return eS.loadIndirect(e);throw new se(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};eS.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=e9e(r);t.push(s)}let i=mue(e.covarianceDirectUpperTriangle);return new JE({storageType:l0.Direct,anchorPointsDirect:t,covarianceDirect:i})};eS.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=t9e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=n9e(s);o.push(a)}return new JE({storageType:l0.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var aM=eS;function pue(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(pue.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 cM=pue;function _ue(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(_ue.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var lM=_ue;function gue(e){this._ppeTextures=e}Object.defineProperties(gue.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var uM=gue;function Nr(e){e=e??G.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=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Nr.prototype=Object.create(Zi.prototype),Nr.prototype.constructor=Nr);Object.defineProperties(Nr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Nr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=yt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=yt.FAILED,this.getError("Failed to load GPM data",e)}};Nr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=this._loadResources(this),this._promise)};function i9e(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}Nr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=i9e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Di.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};Nr.ppeTexturesMetadataSchemaCache=new Map;Nr._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}}}};Nr._obtainPpeTexturesMetadataSchema=function(e){let n=Nr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Nr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Nr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Nr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=qu.fromJson(r),Nr.ppeTexturesMetadataSchemaCache.set(n,i),i};Nr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Nr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Nr._convertToStructuralMetadata=function(e,t){let n=[],i=Nr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new H_({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new sa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Nr.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(o[f]=d.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new lM({min:d.min,max:d.max,source:d.source}),_=new cM({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(_)}}let a=new uM(r);this._meshPrimitiveGpmLocal=a;let c=Nr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=yt.READY,!0};Nr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Di.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Nr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var fM=Nr;var{Attribute:o9e,Indices:r9e,FeatureIdAttribute:yue,FeatureIdTexture:bue,FeatureIdImplicitRange:xue,MorphTarget:s9e,Primitive:a9e,Instances:c9e,Skin:l9e,Node:u9e,AnimatedPropertyType:f9e,AnimationSampler:d9e,AnimationTarget:h9e,AnimationChannel:m9e,Animation:p9e,ArticulationStage:_9e,Articulation:g9e,Asset:y9e,Scene:b9e,Components:x9e,MetallicRoughness:T9e,SpecularGlossiness:C9e,Specular:A9e,Anisotropy:k7,Clearcoat:U7,Material:E9e}=Tn,Go={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Ih(e){e=e??G.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:u=!1,enablePick:f=!1,loadIndicesForWireframe:d=!1,loadPrimitiveOutline:p=!0,loadForClassification:_=!1,renameBatchIdSemantic:m=!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=u,this._enablePick=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=_,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Go.NOT_LOADED,this._textureState=Go.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)&&(Ih.prototype=Object.create(Zi.prototype),Ih.prototype.constructor=Ih);Object.defineProperties(Ih.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 S9e(e){e._state=Go.LOADING,e._textureState=Go.LOADING;try{let t=Di.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Go.LOADED,e._textureState=Go.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Go.FAILED,e._textureState=Go.FAILED,k4(e,t)}}async function v9e(e,t){Nt.supportsWebP.initialized||await Nt.supportsWebP.initialize(),e._supportedImageFormats=new nM({webp:Nt.supportsWebP(),basis:t.context.supportsBasis});let n=Pje(e,t);return e._state=Go.PROCESSING,e._textureState=Go.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Di.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Ih.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=S9e(this),this._promise)};function k4(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function w9e(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)&&bt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=Go.POST_PROCESSING)}function I9e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&P9e(e,o)}}function P9e(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)}Ih.prototype._process=function(e){return this._state===Go.READY?!0:(this._state===Go.PROCESSING&&w9e(this,e),this._resourcesLoaded&&this._state===Go.POST_PROCESSING&&(I9e(this,e.context),this._state=Go.PROCESSED),this._resourcesLoaded&&this._state===Go.PROCESSED?(Pue(this),this._typedArray=void 0,this._state=Go.READY,!0):!1)};Ih.prototype._processTextures=function(e){if(this._textureState===Go.READY)return!0;if(this._textureState!==Go.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=Go.READY,this._texturesLoaded=!0,!0):!1};Ih.prototype.process=function(e){if(this._state===Go.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=v9e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Go.FAILED;let o=this._processError;this._processError=void 0,k4(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===Go.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Go.FAILED,k4(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Go.FAILED,k4(this,o)}return this._incrementallyLoadTextures?n:n&&i};function D9e(e,t,n,i,o,r,s,a){let c=e.gltfJson,f=c.accessors[t].bufferView;return Di.getVertexBufferLoader({gltf:c,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function R9e(e,t,n,i,o,r,s){return Di.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function O9e(e,t){let n=Di.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Tue(e,t,n){let i=t.byteOffset,o=iu(e,t),r=t.count,s=Wu(t.type),a=t.componentType,c=K.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),K.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=K.createTypedArray(a,f),p=new DataView(n.buffer),_=new Array(s),m=F_(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){m(p,i,s,c,_);for(let b=0;b<s;++b)d[y*s+b]=_[b];i+=o}return d}function M9e(e,t){let n=e.type;if(n===rn.SCALAR)return t.fill(0);let i=rn.getMathType(n);return t.fill(i.clone(i.ZERO))}function L9e(e,t,n,i){let o=e.type,r=e.count;if(o===rn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===rn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Pe.unpack(t,s*4);else{let s=rn.getMathType(o),a=rn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function N9e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Tue(r,n,t.typedArray);i=i??!1,L9e(n,s,o,i)}function U4(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=O9e(e,o),s=N9e(e,r,t,n,i);return e._loaderPromises.push(s),i}return M9e(t,i)}function Yu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function F9e(e){return e===Number?0:new e}function B9e(e){switch(e){case K.BYTE:return 127;case K.UNSIGNED_BYTE:return 255;case K.SHORT:return 32767;case K.UNSIGNED_SHORT:return 65535;default:return 1}}var k9e={VEC2:new V(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ie(-1,-1,-1,-1)};function U9e(e,t){let n=B9e(e.componentDatatype),i=k9e[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 z9e(e,t,n){let i=e.decodeMatrix,o=Yu(n,e.decodedMin),r=Yu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Tn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new V(i[6],i[7]),s.quantizedVolumeStepSize=new V(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ie(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ie(i[0],i[6],i[12],i[18])),t.quantization=s}function V9e(e,t,n,i,o){let r=e.accessors[t],s=rn.getMathType(r.type),a=r.normalized??!1,c=new o9e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=F9e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=Yu(s,r.min),c.max=Yu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=iu(e,r),ai(r,"WEB3D_quantized_attributes")&&z9e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===mt.POSITION||c.semantic===mt.NORMAL||c.semantic===mt.TANGENT||c.semantic===mt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&U9e(c,s),c}function Cue(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var H9e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function z7(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=H9e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function G9e(e){let t=e===mt.POSITION,n=e===mt.FEATURE_ID,i=e===mt.TEXCOORD;return t||n||i}function j9e(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=K.createArrayBufferView(o,t.typedArray.buffer)}}function W9e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Tue(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Aue(e,t,n,i,o,r,s,a){let c=e.gltfJson,u=c.accessors[t],f=u.bufferView,d=n.gltfSemantic,p=n.renamedSemantic,_=n.modelSemantic,m=l(_)?Cue(p):void 0,b=V9e(c,t,d,_,m);if(!l(o)&&!l(f))return b;let x=D9e(e,t,d,i,o,r,s,a),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let C=x.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[d])?j9e(b,x,r,s):W9e(c,u,b,x,r,s)},b}function Eue(e,t,n,i,o,r,s,a){let c=n.modelSemantic,u=c===mt.POSITION,f=c===mt.FEATURE_ID,d=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,_=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,b=m||d||p||_,C=Aue(e,t,n,i,o,s?!1:y,s?!0:b,a),A=new _T.AttributeLoadPlan(C);return A.loadBuffer=y,A.loadTypedArray=b,A}function q9e(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=z7(e,hs,i),u=c.modelSemantic,f=u===hs.TRANSLATION||u===hs.ROTATION||u===hs.SCALE,d=u===hs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,_=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Aue(e,t,c,void 0,void 0,m,p||d&&(!a||y||_),o)}function Y9e(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new r9e;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||d||p,T=R9e(e,t,n,i,r?!1:m,r?!0:y,s),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let S=new _T.IndicesLoadPlan(u);return S.loadBuffer=m,S.loadTypedArray=y,S}function El(e,t,n,i){let o=e.gltfJson,r=ou.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Di.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=ou.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Go.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function X9e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new C9e;return l(i)&&(c.diffuseTexture=El(e,i,n)),l(o)&&(c.specularGlossinessTexture=El(e,o,n)),c.diffuseFactor=Yu(ie,r),c.specularFactor=Yu(h,s),c.glossinessFactor=a,c}function K9e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new T9e;return l(i)&&(c.baseColorTexture=El(e,i,n)),l(o)&&(c.metallicRoughnessTexture=El(e,o,n)),c.baseColorFactor=Yu(ie,r),c.metallicFactor=s,c.roughnessFactor=a,c}function $9e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new A9e;return l(o)&&(a.specularTexture=El(e,o,n)),l(s)&&(a.specularColorTexture=El(e,s,n)),a.specularFactor=i,a.specularColorFactor=Yu(h,r),a}function Z9e(e,t,n){let{anisotropyStrength:i=k7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=k7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new k7;return l(r)&&(s.anisotropyTexture=El(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function Q9e(e,t,n){let{clearcoatFactor:i=U7.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=U7.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new U7;return l(o)&&(c.clearcoatTexture=El(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=El(e,s,n)),l(a)&&(c.clearcoatNormalTexture=El(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function J9e(e,t,n){let i=new E9e,o=t.extensions??G.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=X9e(e,r,n):(l(u)&&(i.metallicRoughness=K9e(e,u,n)),l(s)&&!i.unlit&&(i.specular=$9e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=Z9e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=Q9e(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=El(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=El(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=El(e,t.occlusionTexture,n)),i.emissiveFactor=Yu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Sue(e,t){let n=new yue;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 vue(e,t,n,i){let o=new yue,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Cue(r.attribute),o.positionalLabel=i,o}function wue(e,t){let n=new xue;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 Iue(e,t,n,i){let o=new xue,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 eje(e,t,n,i){let o=new bue;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=El(e,r,n,zt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function tje(e,t,n,i,o,r){let s=new bue,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=El(e,c,i,zt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function nje(e,t,n,i,o){let r=new s9e,s=void 0,a=void 0,c=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],d=z7(e,mt,u),p=Eue(e,f,d,s,a,c,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function ije(e,t,n,i){let o=new a9e,r=new _T(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=J9e(e,e.gltfJson.materials[s],i));let a=t.extensions??G.EMPTY_OBJECT,c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=oje(e,u,r));let f=e._loadForClassification,d=a.KHR_draco_mesh_compression,p=!1,_=t.attributes;if(l(_))for(let S in _){if(!_.hasOwnProperty(S))continue;let w=_[S],R=z7(e,mt,S),P=R.modelSemantic;if(f&&!G9e(P))continue;P===mt.FEATURE_ID&&(p=!0);let O=Eue(e,w,R,t,d,n,c,i);r.attributePlans.push(O),o.attributes.push(O.attribute)}let m=t.targets;if(l(m)&&!f)for(let S=0;S<m.length;++S)o.morphTargets.push(nje(e,m[S],c,r,i));let y=t.indices;if(l(y)){let S=Y9e(e,y,t,d,p,c,i);l(S)&&(r.indicesPlan=S,o.indices=S.indices)}let b=a.EXT_structural_metadata,x=a.EXT_mesh_features,T=a.EXT_feature_metadata,C=l(T);l(x)?rje(e,o,x,i):C&&sje(e,o,T,i),l(b)?aje(o,b):C&&cje(e,o,T);let A=t.mode;if(f&&A!==Le.TRIANGLES)throw new se("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function oje(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return U4(e,i,!1)}function rje(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=eje(e,s,i,a):l(s.attribute)?c=Sue(s,a):c=wue(s,a),t.featureIds.push(c)}}function sje(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=vue(u,d,p,_):m=Iue(u,d,p,_),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m=tje(e,u,d,i,p,_);t.featureIds.push(m)}}function aje(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function cje(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function lje(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new c9e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(q9e(e,f,r,u,n))}let s=i.extensions??G.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?uje(o,a):l(c)&&fje(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function uje(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=Sue(o,r):s=wue(o,r),e.featureIds.push(s)}}function fje(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=vue(a,u,f,d):p=Iue(a,u,f,d),t.featureIds.push(p)}}function dje(e,t,n){let i=new u9e;i.name=t.name,i.matrix=Yu(M,t.matrix),i.translation=Yu(h,t.translation),i.rotation=Yu(Pe,t.rotation),i.scale=Yu(h,t.scale);let o=t.extensions??G.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new se("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=lje(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(ije(e,u[p],l(i.instances),n));let f=t.weights??c.weights,d=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(d.length).fill(0)}return i}function hje(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=dje(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 mje(e,t,n){let i=new l9e,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=U4(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function pje(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=mje(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 _je(e,t,n,i){let o=new tM({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 gje(e,t,n,i){let o=new fM({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 yje(e,t){let n=new d9e,i=e.gltfJson.accessors,o=i[t.input];n.input=U4(e,o);let r=t.interpolation;n.interpolation=Fc[r]??Fc.LINEAR;let s=i[t.output];return n.output=U4(e,s,!0),n}function bje(e,t){let n=new h9e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=f9e[o],n}function xje(e,t,n){let i=new m9e,o=e.sampler;return i.sampler=t[o],i.target=bje(e.target,n),i}function Tje(e,t,n){let i=new p9e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=yje(e,s);return c.index=a,c}),r=t.channels.map(function(s){return xje(s,o,n)});return i.samplers=o,i.channels=r,i}function Cje(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=Tje(e,o,t);return s.index=r,s})}function Aje(e){let t=new _9e;t.name=e.name;let n=e.type.toUpperCase();return t.type=Nc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Eje(e){let t=new g9e;return t.name=e.name,t.stages=e.stages.map(Aje),t}function Sje(e){let n=(e.extensions??G.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Eje):[]}function vje(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 wje(e,t){let n=new b9e,i=vje(e);return n.nodes=i.map(function(o){return t[o]}),n}var Ije=new h;function Pje(e,t){let n=e.gltfJson,i=n.extensions??G.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let T=r.featureTables,C=r.featureTextures,A=l(T)?T:[],S=l(C)?C:[];e._sortedPropertyTableIds=Object.keys(A).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let a=hje(e,t),c=pje(e,a),u=Cje(e,a),f=Sje(n),d=wje(n,a),p=new x9e,_=new y9e,m=n.asset.copyright;if(l(m)){let T=m.split(";").map(function(C){return new _t(C.trim())});_.credits=T}if(p.asset=_,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let T=h.fromArray(s.center,0,Ije);p.transform=M.fromTranslation(T,p.transform)}if(e._components=p,l(o)||l(r)){let T=_je(e,o,r,t);e._loaderPromises.push(T)}let y=i.NGA_gpm_local;if(l(y)){let T=aM.load(y);e._components.extensions.NGA_gpm_local=T}let b=n.meshes;if(l(b))for(let T of b){let C=T.primitives;if(l(C))for(let A of C){let S=A.extensions;if(l(S)){let w=S.NGA_gpm_local;if(l(w)){let R=gje(e,n,w,t);e._loaderPromises.push(R)}}}}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function Dje(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._textureLoaders.length=0}function Pue(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._bufferViewLoaders.length=0}function Rje(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._geometryLoaders.length=0}function Oje(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 Mje(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Lje(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Ih.prototype.isUnloaded=function(){return this._state===Go.UNLOADED};Ih.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Di.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Dje(this),Pue(this),Rje(this),Oje(this),Mje(this),Lje(this),this._components=void 0,this._typedArray=void 0,this._state=Go.UNLOADED};var Ph=Ih;var dM=`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 tS(){this._framebuffer=new _i({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(tS.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 Nje(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var V7=new V;function Fje(e,t){let n=new Be({defines:["LOG_DEPTH_WRITE"],sources:[dM]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return V7.x=e._radius,V7.y=e._strength,V7}},o=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:jt.setCesium3DTileBit(),stencilMask:jt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Se.CESIUM_3D_TILE,owner:e}),e._clearCommand=new oi({framebuffer:e.framebuffer,color:new H(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Se.CESIUM_3D_TILE,owner:e})}function Bje(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Fje(e,t)}function Due(e){return e.drawBuffers&&e.fragmentDepth}tS.isSupported=Due;function kje(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=Be.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}tS.prototype.update=function(e,t,n,i){if(!Due(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Bje(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Le.POINTS||u.pass===Se.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=qe.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=kje(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};tS.prototype.isDestroyed=function(){return!1};tS.prototype.destroy=function(){return Nje(this),ce(this)};var G_=tS;function Rue(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}Rue.isSupported=function(e){return G_.isSupported(e.context)};var Km=Rue;var nc={},Uje=new ie(0,0,0,1),kc=new ie,zje=new Xe,H7=new V,G7=new V;nc.worldToWindowCoordinates=function(e,t,n){return nc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Oue=new ie,Mue=new h;function hM(e,t,n,i){let o=n.viewMatrix,r=M.multiplyByVector(o,ie.fromElements(e.x,e.y,e.z,1,Oue),Oue),s=h.multiplyComponents(t,h.normalize(r,Mue),Mue);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,r,i)}var Vje=new fe(Math.PI,D.PI_OVER_TWO),Hje=new h,Gje=new h;nc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=nc.computeActualEllipsoidPosition(o,t,Uje);if(!l(r))return;let s=e.canvas,a=zje;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,d=Vje,p=f.project(d,Hje),_=h.clone(c.position,Gje),m=c.frustum.clone(),y=M.computeViewportTransformation(a,0,1,new M),b=c.frustum.projectionMatrix,x=c.positionWC.y,T=h.fromElements(D.sign(x)*p.x-x,0,-c.positionWC.x),C=At.pointToGLWindowCoordinates(b,y,T);if(x===0||C.x<=0||C.x>=s.clientWidth)u=!0;else{if(C.x>s.clientWidth*.5){a.width=C.x,c.frustum.right=p.x-x,kc=hM(r,n,c,kc),nc.clipToGLWindowCoordinates(a,kc,H7),a.x+=C.x,c.position.x=-c.position.x;let A=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-A,kc=hM(r,n,c,kc),nc.clipToGLWindowCoordinates(a,kc,G7)}else{a.x+=C.x,a.width-=C.x,c.frustum.left=-p.x-x,kc=hM(r,n,c,kc),nc.clipToGLWindowCoordinates(a,kc,H7),a.x=a.x-a.width,c.position.x=-c.position.x;let A=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-A,kc=hM(r,n,c,kc),nc.clipToGLWindowCoordinates(a,kc,G7)}h.clone(_,c.position),c.frustum=m.clone(),i=V.clone(H7,i),(i.x<0||i.x>s.clientWidth)&&(i.x=G7.x)}}if(o.mode!==ne.SCENE2D||u){if(kc=hM(r,n,c,kc),kc.z<0&&!(c.frustum instanceof cn)&&!(c.frustum instanceof jr))return;i=nc.clipToGLWindowCoordinates(a,kc,i)}return i.y=s.clientHeight-i.y,i};nc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=nc.worldToWindowCoordinates(e,t,n),!!l(n))return nc.transformWindowToDrawingBuffer(e,n,n)};var j_=new h,jje=new fe;nc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,jje);if(!l(r))return;if(o.project(r,j_),i===ne.COLUMBUS_VIEW)return h.fromElements(j_.z,j_.x,j_.y,n);if(i===ne.SCENE2D)return h.fromElements(0,j_.x,j_.y,n);let s=e.morphTime;return h.fromElements(D.lerp(j_.z,t.x,s),D.lerp(j_.x,t.y,s),D.lerp(j_.y,t.z,s),n)};var Lue=new h,Nue=new h,Fue=new M;nc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Lue),M.computeViewportTransformation(e,0,1,Fue),M.multiplyByPoint(Fue,Lue,Nue),V.fromCartesian3(Nue,n)};nc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return V.fromElements(t.x*o,t.y*r,n)};var Wje=new ie,Bue=new ie;nc.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 _=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,_)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=ie.clone(ie.UNIT_W,Wje);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=M.multiplyByVector(r.inverseViewProjection,f,Bue);let _=1/d.w;h.multiplyByScalar(d,_,d)}else{let _=p.offCenterFrustum;l(_)&&(p=_),d=Bue,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=M.multiplyByVector(r.inverseView,d,d)}return h.fromCartesian4(d,i)};var ji=nc;var nS={};nS._deprecationWarning=Po;var W_=Uint32Array.BYTES_PER_ELEMENT;nS.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=W_;let r=o.getUint32(t,!0);if(r!==1)throw new se(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=W_;let s=o.getUint32(t,!0);t+=W_;let a=o.getUint32(t,!0);t+=W_;let c=o.getUint32(t,!0);t+=W_;let u=o.getUint32(t,!0);t+=W_;let f=o.getUint32(t,!0);t+=W_;let d;u>=570425344?(t-=W_*2,d=a,u=c,f=0,a=0,c=0,nS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=W_,d=u,u=a,f=c,a=0,c=0,nS._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:d??0}:(p=Ho(i,t,a),t+=a);let _=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ho(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new se("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(nS._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:y,gltf:x}};var mM=nS;function pM(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function kue(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=K.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function qje(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=K.createTypedArray(n,i),o[t]=r),r}pM.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??K.UNSIGNED_INT,n=n??1,kue(this,e,t,n,1,i.byteOffset)):i};pM.prototype.hasProperty=function(e){return l(this.json[e])};pM.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=K.fromName(i.componentType)),kue(this,e,t,n,this.featuresLength,i.byteOffset)):qje(this,e,t,i)};pM.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 Dh=pM;function _M(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=Yje(n),a;l(s.jsonProperties)&&(a=new V_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Wx({extension:s.hierarchy,binaryBody:i}));let u=Ah.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,_;if(o){let b=Kje(t,u,f,i,r);_=b.transcodedSchema,p=[new mT({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=Xje(t,u,f,i);_=b.transcodedSchema;let x=b.featureTableJson;d=new od({count:x.count,properties:x.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let b=new Al({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(b)}let y={schema:_,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new sa(y)}function Yje(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(_M._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 Xje(e,t,n,i){let o={},r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new se(`Property ${d} requires a batch table binary.`);let p=n[d],_=Gu(p);r[d]={bufferView:a},o[d]=Uue(p),s[a]=_.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=qu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function Kje(e,t,n,i,o){let r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new se(`Property ${d} requires a batch table binary.`);let _=Qt.sanitizeGlslIdentifier(d);(_===""||r.hasOwnProperty(_))&&(_=`property_${a}`,a++);let m=Uue(p);m.name=d,r[_]=m;let y=_.toUpperCase();y.startsWith("_")||(y=`_${y}`);let b=p.typedArray;l(b)||(b=Gu(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let x=new Tn.Attribute;x.name=y,x.count=e,x.type=p.type;let T=K.fromTypedArray(b);(T===K.INT||T===K.UNSIGNED_INT||T===K.DOUBLE)&&(_M._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.`),b=new Float32Array(b)),x.componentDatatype=K.fromTypedArray(b),x.typedArray=b,o.push(x),s[_]={attribute:y}}let c={classes:{}};c.classes[t]={properties:r};let u=qu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Uue(e){let t=$je(e.componentType);return{type:e.type,componentType:t}}function $je(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"}}_M._deprecationWarning=Po;_M._oneTimeWarning=bt;var q_=_M;var gT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Zje=Tn.FeatureIdAttribute;function u0(e){e=e??G.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,u=e.forwardAxis??Vo.X,f=e.loadAttributesAsTypedArray??!1,d=e.loadAttributesFor2D??!1,p=e.enablePick??!1,_=e.loadIndicesForWireframe??!1,m=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=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._enablePick=p,this._loadIndicesForWireframe=_,this._loadPrimitiveOutline=m,this._loadForClassification=y,this._state=gT.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(u0.prototype=Object.create(Zi.prototype),u0.prototype.constructor=u0);Object.defineProperties(u0.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});u0.prototype.load=function(){if(l(this._promise))return this._promise;let e=mM.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Dh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(a)&&(this._transform=M.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new Ph({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=gT.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=gT.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return Qje(u,f)}),this._promise};function Qje(e,t){return e.unload(),e._state=gT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}u0.prototype.process=function(e){if(this._state===gT.READY)return!0;if(this._state!==gT.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=M.multiplyTransformation(this._transform,n.transform,n.transform),Jje(this,n),this._components=n,this._arrayBuffer=void 0,this._state=gT.READY,!0};function Jje(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Al({name:Ah.BATCH_TABLE_CLASS_NAME,count:i});o=new sa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)zue(r[a]);t.structuralMetadata=o}function zue(e){let t=e.children.length;for(let i=0;i<t;i++)zue(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Qt.getAttributeBySemantic(o,mt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new Zje;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}u0.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var gM=u0;function f0(e){e=e??G.EMPTY_OBJECT,this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(f0.prototype=Object.create(Zi.prototype),f0.prototype.constructor=f0);Object.defineProperties(f0.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});f0.prototype.load=function(){return Promise.resolve(this)};f0.prototype.process=function(e){return l(this._components)||(this._components=dWe(this._geoJson,e),this._geoJson=void 0),!0};function eWe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function tWe(){this.features=[]}function j7(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function W7(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=j7(e[o]);return[n]}function nWe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=W7(e[i])[0];return n}function Vue(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=W7(e[i])[0];return n}function iWe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Vue(e[i]));return n}function oWe(e){return[j7(e)]}function rWe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=j7(e[i]);return n}var sWe={LineString:W7,MultiLineString:nWe,MultiPolygon:iWe,Polygon:Vue,MultiPoint:rWe,Point:oWe},aWe={LineString:Le.LINES,MultiLineString:Le.LINES,MultiPolygon:Le.LINES,Polygon:Le.LINES,MultiPoint:Le.POINTS,Point:Le.POINTS};function Hue(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=sWe[n],o=aWe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new eWe;o===Le.LINES?s.lines=i(r):o===Le.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function cWe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Hue(n[o],t)}var lWe={FeatureCollection:cWe,Feature:Hue},z4=new h;function uWe(e,t,n){let i=0,o=0,r=e.length;for(let O=0;O<r;O++){let L=e[O];if(l(L.lines)){let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E];i+=v.length,o+=(v.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=ke.createTypedArray(i,o),u=ke.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,_=0;for(let O=0;O<r;O++){let L=e[O];if(!l(L.lines))continue;let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E],I=v.length;for(let N=0;N<I;N++){let F=v[N],U=h.fromDegrees(F.x,F.y,F.z,te.WGS84,z4),k=M.multiplyByPoint(t,U,z4);h.minimumByComponent(f,k,f),h.maximumByComponent(d,k,d),h.pack(k,s,p*3),a[p]=O,N<I-1&&(c[_*2]=p,c[_*2+1]=p+1,_++),p++}}}let m=st.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=st.createVertexBuffer({typedArray:a,context:n.context,usage:Ne.STATIC_DRAW});y.vertexArrayDestroyable=!1;let b=st.createIndexBuffer({typedArray:c,context:n.context,usage:Ne.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let x=new Tn.Attribute;x.semantic=mt.POSITION,x.componentDatatype=K.FLOAT,x.type=rn.VEC3,x.count=i,x.min=f,x.max=d,x.buffer=m;let T=new Tn.Attribute;T.semantic=mt.FEATURE_ID,T.setIndex=0,T.componentDatatype=K.FLOAT,T.type=rn.SCALAR,T.count=i,T.buffer=y;let C=[x,T],A=new Tn.Material;A.unlit=!0;let S=new Tn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=b;let w=new Tn.FeatureIdAttribute;w.featureCount=r,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let R=[w],P=new Tn.Primitive;return P.attributes=C,P.indices=S,P.featureIds=R,P.primitiveType=Le.LINES,P.material=A,P}function fWe(e,t,n){let i=0,o=e.length;for(let C=0;C<o;C++){let A=e[C];l(A.points)&&(i+=A.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let C=0;C<o;C++){let A=e[C];if(!l(A.points))continue;let S=A.points.length;for(let w=0;w<S;w++){let R=A.points[w],P=h.fromDegrees(R.x,R.y,R.z,te.WGS84,z4),O=M.multiplyByPoint(t,P,z4);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,r,u*3),s[u]=C,u++}}let f=st.createVertexBuffer({typedArray:r,context:n.context,usage:Ne.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=st.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=mt.POSITION,p.componentDatatype=K.FLOAT,p.type=rn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let _=new Tn.Attribute;_.semantic=mt.FEATURE_ID,_.setIndex=0,_.componentDatatype=K.FLOAT,_.type=rn.SCALAR,_.count=i,_.buffer=d;let m=[p,_],y=new Tn.Material;y.unlit=!0;let b=new Tn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let x=[b],T=new Tn.Primitive;return T.attributes=m,T.featureIds=x,T.primitiveType=Le.POINTS,T.material=y,T}function dWe(e,t){let n=new tWe,i=lWe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new se("GeoJSON must have at least one feature");let s={};for(let O=0;O<r;O++){let g=o[O].properties??G.EMPTY_OBJECT;for(let E in g)g.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(r)))}for(let O=0;O<r;O++){let L=o[O];for(let g in s)if(s.hasOwnProperty(g)){let E=L.properties[g]??"";s[g][O]=E}}let a=new V_({count:r,properties:s}),u=[new Al({id:0,count:r,jsonMetadataTable:a})],f=qu.fromJson({}),d=new sa({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),_=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<r;O++){let L=o[O];if(l(L.lines)){m=!0;let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E],I=v.length;for(let N=0;N<I;N++)h.minimumByComponent(p,v[N],p),h.maximumByComponent(_,v[N],_)}}if(l(L.points)){y=!0;let g=L.points.length;for(let E=0;E<g;E++){let v=L.points[E];h.minimumByComponent(p,v,p),h.maximumByComponent(_,v,_)}}}let b=h.midpoint(p,_,new h),x=h.fromDegrees(b.x,b.y,b.z,te.WGS84,new h),T=At.eastNorthUpToFixedFrame(x,te.WGS84,new M),C=M.inverseTransformation(T,new M),A=[];m&&A.push(uWe(o,C,t)),y&&A.push(fWe(o,C,t));let S=new Tn.Node;S.index=0,S.primitives=A;let w=[S],R=new Tn.Scene;R.nodes=w;let P=new Tn.Components;return P.scene=R,P.nodes=w,P.transform=T,P.structuralMetadata=d,P}f0.prototype.unload=function(){this._components=void 0};var yM=f0;var V4={};V4._deprecationWarning=Po;var d0=Uint32Array.BYTES_PER_ELEMENT;V4.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=d0;let r=o.getUint32(t,!0);if(r!==1)throw new se(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=d0;let s=o.getUint32(t,!0);t+=d0;let a=o.getUint32(t,!0);if(a===0)throw new se("featureTableJsonByteLength is zero, the feature table must be defined.");t+=d0;let c=o.getUint32(t,!0);t+=d0;let u=o.getUint32(t,!0);t+=d0;let f=o.getUint32(t,!0);t+=d0;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new se(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=d0;let p=Ho(i,t,a);t+=a;let _=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ho(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new se("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(V4._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:y,gltf:x}};var bM=V4;var Y_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},H4=Tn.Attribute,hWe=Tn.FeatureIdAttribute,jue=Tn.Instances;function X_(e){e=e??G.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,u=e.forwardAxis??Vo.X,f=e.loadAttributesAsTypedArray??!1,d=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,_=e.enablePick??!1;i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._enablePick=_,this._state=Y_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(X_.prototype=Object.create(Zi.prototype),X_.prototype.constructor=X_);Object.defineProperties(X_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});X_.prototype.load=function(){if(l(this._promise))return this._promise;let e=bM.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Dh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new se("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=ia(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Ph(u);return this._gltfLoader=f,this._state=Y_.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Y_.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw mWe(this,d)}),this._promise};function mWe(e,t){return e.unload(),e._state=Y_.FAILED,e.getError("Failed to load i3dm",t)}X_.prototype.process=function(e){if(this._state===Y_.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Y_.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),gWe(this,i,e),pWe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Y_.READY,!0};function pWe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=q_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Al({name:Ah.BATCH_TABLE_CLASS_NAME,count:i});o=new sa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var G4=new h,q7=new Array(4),_We=new M;function gWe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",K.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=bWe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let _=new Float32Array(r),m=h.unpackArray(f),y=new h,b=new h,x=new h,T=new h,C=new Z,A=new Pe,S=new Array(4),w=new h,R=new Array(3),P=new M;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let k=re.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],k.center,G4),f[3*i+0]=G4.x,f[3*i+1]=G4.y,f[3*i+2]=G4.z;let z=M.fromTranslation(k.center,_We);t.transform=M.multiplyTransformation(z,t.transform,t.transform)}for(i=0;i<r;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(xWe(o,a,i,A,y,x,b,T,C,P),Pe.pack(A,S,0),d[4*i+0]=S[0],d[4*i+1]=S[1],d[4*i+2]=S[2],d[4*i+3]=S[3]),u&&(TWe(o,i,w),h.pack(w,R,0),p[3*i+0]=R[0],p[3*i+1]=R[1],p[3*i+2]=R[2]);let k=o.getProperty("BATCH_ID",K.UNSIGNED_SHORT,1,i);l(k)||(k=i),_[i]=k}let O=new jue;O.transformInWorldSpace=!0;let L=e._buffers,g=new H4;if(g.name="Instance Translation",g.semantic=hs.TRANSLATION,g.componentDatatype=K.FLOAT,g.type=rn.VEC3,g.count=r,g.typedArray=f,!c){let k=st.createVertexBuffer({context:n.context,typedArray:f,usage:Ne.STATIC_DRAW});k.vertexArrayDestroyable=!1,L.push(k),g.buffer=k}if(O.attributes.push(g),c){let k=new H4;k.name="Instance Rotation",k.semantic=hs.ROTATION,k.componentDatatype=K.FLOAT,k.type=rn.VEC4,k.count=r,k.typedArray=d,O.attributes.push(k)}if(u){let k=new H4;if(k.name="Instance Scale",k.semantic=hs.SCALE,k.componentDatatype=K.FLOAT,k.type=rn.VEC3,k.count=r,c)k.typedArray=p;else{let z=st.createVertexBuffer({context:n.context,typedArray:p,usage:Ne.STATIC_DRAW});z.vertexArrayDestroyable=!1,L.push(z),k.buffer=z}O.attributes.push(k)}let E=new H4;E.name="Instance Feature ID",E.setIndex=0,E.semantic=hs.FEATURE_ID,E.componentDatatype=K.FLOAT,E.type=rn.SCALAR,E.count=r;let v=st.createVertexBuffer({context:n.context,typedArray:_,usage:Ne.STATIC_DRAW});v.vertexArrayDestroyable=!1,L.push(v),E.buffer=v,O.attributes.push(E);let I=new hWe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",O.featureIds.push(I);let N=t.nodes,F=N.length,U=!1;for(i=0;i<F;i++){let k=N[i];k.primitives.length>0&&(k.instances=U?yWe(O):O,U=!0)}}function yWe(e){let t=new jue;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Fe(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function bWe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",K.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(i))throw new se("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(o))throw new se("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 se("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Gue=new Array(4);function xWe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",K.FLOAT,3,n,q7),d=e.getProperty("NORMAL_RIGHT",K.FLOAT,3,n,Gue),p=!1;if(l(f)){if(!l(d))throw new se("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,r),h.unpack(d,0,s),p=!0}else{let _=e.getProperty("NORMAL_UP_OCT32P",K.UNSIGNED_SHORT,2,n,q7),m=e.getProperty("NORMAL_RIGHT_OCT32P",K.UNSIGNED_SHORT,2,n,Gue);if(l(_)){if(!l(m))throw new se("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");On.octDecodeInRange(_[0],_[1],65535,r),On.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(o,te.WGS84,u),M.getMatrix3(u,c)):Z.clone(Z.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),Z.setColumn(c,0,s,c),Z.setColumn(c,1,r,c),Z.setColumn(c,2,a,c)),Pe.fromRotationMatrix(c,i)}function TWe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",K.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",K.FLOAT,3,t,q7);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function CWe(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}X_.prototype.isUnloaded=function(){return this._state===Y_.UNLOADED};X_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),CWe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Y_.UNLOADED};var xM=X_;var AWe={STOPPED:0,ANIMATING:1},Rh=Object.freeze(AWe);function iS(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}iS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Pe)return Pe};iS.prototype.evaluate=he.throwInstantiationError;iS.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};iS.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};iS.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Qi=iS;function oS(e){this._value=e,this._valueType=Qi.getPointType(e)}Object.defineProperties(oS.prototype,{value:{get:function(){return this._value}}});oS.prototype.findTimeInterval=function(e){};oS.prototype.wrapTime=function(e){return 0};oS.prototype.clampTime=function(e){return 0};oS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var K_=oS;function rS(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Qi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(rS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});rS.prototype.findTimeInterval=Qi.prototype.findTimeInterval;rS.prototype.wrapTime=Qi.prototype.wrapTime;rS.prototype.clampTime=Qi.prototype.clampTime;rS.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 h),h.lerp(n[o],n[o+1],r,t))};var cd=rS;var Wue={};Wue.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 h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.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]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var sS=Wue;var que=[],Yue=[],Xue=[],Kue=[];function EWe(e,t,n){let i=que,o=Xue,r=Yue,s=Kue;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 h),h.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 h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),sS.solve(i,r,o,s)}function SWe(e){let t=que,n=Xue,i=Yue,o=Kue;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.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 h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),sS.solve(t,i,n,o)}function au(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=Qi.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(au.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}}});au.createC1=function(e){e=e??G.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 au({times:t,points:n,inTangents:r,outTangents:o})};au.createNaturalCubic=function(e){e=e??G.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new cd({points:n,times:t});let i=SWe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new au({times:t,points:n,inTangents:r,outTangents:o})};au.createClampedCubic=function(e){e=e??G.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=Qi.getPointType(n[0]);if(n.length<3)return new cd({points:n,times:t});let s=EWe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new au({times:t,points:n,inTangents:c,outTangents:a})};au.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);au.prototype.findTimeInterval=Qi.prototype.findTimeInterval;var vWe=new ie,aS=new h;au.prototype.wrapTime=Qi.prototype.wrapTime;au.prototype.clampTime=Qi.prototype.clampTime;au.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=vWe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(au.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,aS),d.add(t,aS,t),d.multiplyByScalar(r[s],f.z,aS),d.add(t,aS,t),d.multiplyByScalar(o[s],f.w,aS),d.add(t,aS,t))};var $m=au;function cS(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Qi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cS.prototype.findTimeInterval=Qi.prototype.findTimeInterval;cS.prototype.wrapTime=Qi.prototype.wrapTime;cS.prototype.clampTime=Qi.prototype.clampTime;cS.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 yT=cS;function wWe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Pe);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 Pe.fastSlerp(a,c,s,o)}}function lS(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=wWe(this),this._lastTimeIndex=0}Object.defineProperties(lS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});lS.prototype.findTimeInterval=Qi.prototype.findTimeInterval;lS.prototype.wrapTime=Qi.prototype.wrapTime;lS.prototype.clampTime=Qi.prototype.clampTime;lS.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var $_=lS;var uS=Tn.AnimatedPropertyType;function Y7(e){e=e??G.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,OWe(this)}Object.defineProperties(Y7.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 IWe(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 $m({times:e,points:n,inTangents:i,outTangents:o})}function $ue(e,t,n,i){if(e.length===1&&t.length===1)return new K_(t[0]);switch(n){case Fc.STEP:return new yT({times:e,points:t});case Fc.CUBICSPLINE:return IWe(e,t);case Fc.LINEAR:return i===uS.ROTATION?new $_({times:e,points:t}):new cd({times:e,points:t})}}function PWe(e,t,n,i,o){let r=[];if(i===uS.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===Fc.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push($ue(e,f,n,i))}}else r.push($ue(e,t,n,i));return r}var DWe=new h,RWe=new Pe;function OWe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=PWe(i,o,r,a,u);e._splines=f,e._path=a}Y7.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===uS.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===uS.TRANSLATION||n===uS.SCALE?o[n]=r.evaluate(s,DWe):n===uS.ROTATION&&(o[n]=r.evaluate(s,RWe))}}};var TM=Y7;function X7(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=$.clone(n.startTime),this._delay=n.delay??0,this._stopTime=$.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??su.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=Rh.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,MWe(this)}Object.defineProperties(X7.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 MWe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],_=new TM({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}X7.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var CM=X7;function Z_(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Z_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function K7(e,t,n){let i=e._model,o=new CM(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Z_.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return K7(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 K7(this,n[i],e)};Z_.prototype.addAll=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=K7(this,n[r],e);i.push(s)}return i};Z_.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};Z_.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])};Z_.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Z_.prototype.get=function(e){return this._runtimeAnimations[e]};var j4=[];function LWe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Z_.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&$.equals(e.time,this._previousTime))return!1;this._previousTime=$.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=$.addSeconds(a.startTime??o,a.delay,new $)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=$.lessThanOrEquals(c,o),p=l(f)&&$.greaterThan(o,f),_=0;if(u!==0){let b=$.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===su.REPEAT||a.loop===su.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let b=a._state===Rh.STOPPED;if(y!==b)continue}if(a._prevAnimationDelta=_,y||a._state===Rh.ANIMATING){if(y&&a._state===Rh.STOPPED&&(a._state=Rh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===su.REPEAT)_=_-Math.floor(_);else if(a.loop===su.MIRRORED_REPEAT){let x=Math.floor(_),T=_-x;_=x%2===1?1-T:T}a.reverse&&(_=1-_);let b=_*u*a.multiplier;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Rh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&j4.push(a))}}n=j4.length;for(let s=0;s<n;++s){let a=j4[s];t.splice(t.indexOf(a),1),e.afterRender.push(LWe(this,r,a))}return j4.length=0,i};var AM=Z_;function bT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(bT.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 H),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}}});bT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};bT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};bT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};bT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};bT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var EM=bT;var SM={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};SM.getStyleCommandsNeeded=function(e,t){return t===0?SM.ALL_OPAQUE:t===e?SM.ALL_TRANSLUCENT:SM.OPAQUE_AND_TRANSLUCENT};var Oh=Object.freeze(SM);var h0={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};h0.is3DTiles=function(e){switch(e){case h0.TILE_GLTF:case h0.TILE_B3DM:case h0.TILE_I3DM:case h0.TILE_PNTS:case h0.TILE_GEOJSON:return!0;case h0.GLTF:return!1}};var br=Object.freeze(h0);function Kr(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=Oh.ALL_OPAQUE,NWe(this)}Object.defineProperties(Kr.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 NWe(e){let t=e._model,n=br.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 oa(s,o)}else for(o=0;o<i;o++)r[o]=new EM({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new xl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Kr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Oh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Kr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Kr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Kr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Kr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Kr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Kr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Kr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Kr.prototype.getFeature=function(e){return this._features[e]};Kr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Kr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Kr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Kr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Kr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Kr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Kr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Kr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Kr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var FWe=new H;Kr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(xl.DEFAULT_COLOR_VALUE),this.setAllShow(xl.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,FWe)??xl.DEFAULT_COLOR_VALUE:xl.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??xl.DEFAULT_SHOW_VALUE:xl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Kr.prototype.isDestroyed=function(){return!1};Kr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ce(this)};var vM=Kr;var Zue={name:"TilesetPipelineStage"};Zue.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,pe.FRAGMENT);let r={u_polygonOffset:function(){return V.ZERO}};e.uniformMap=ct(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=jt.setCesium3DTileBit(),i.stencilMask=jt.CESIUM_3D_TILE_MASK};var wM=Zue;var IM=`// 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 PM=`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 Que={name:"AtmospherePipelineStage"};Que.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,pe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([PM]),i.addFragmentLines([IM]),i.addUniform("bool","u_isInFog",pe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(o,n.fog.density)>D.EPSILON3}};var DM=Que;var RM=`#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 Jue={name:"ImageBasedLightingPipelineStage"},BWe=new V;Jue.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,pe.FRAGMENT),r.addUniform("vec2","model_iblFactor",pe.FRAGMENT),bh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",pe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,pe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",pe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,pe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",pe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",pe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT)),r.addFragmentLines(RM);let c={model_iblFactor:function(){return V.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,BWe)},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=ct(c,e.uniformMap)};var OM=Jue;var kWe=D.EPSILON16;function Z7(e){e=e??G.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(Z7.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,kWe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var UWe=new h,$7=new Z;Z7.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=UWe,o;switch(t){case Nc.XROTATE:o=Z.fromRotationX(D.toRadians(n),$7),e=M.multiplyByMatrix3(e,o,e);break;case Nc.YROTATE:o=Z.fromRotationY(D.toRadians(n),$7),e=M.multiplyByMatrix3(e,o,e);break;case Nc.ZROTATE:o=Z.fromRotationZ(D.toRadians(n),$7),e=M.multiplyByMatrix3(e,o,e);break;case Nc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Nc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Nc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Nc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Nc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Nc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Nc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var MM=Z7;function W4(e){e=e??G.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,zWe(this)}Object.defineProperties(W4.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 zWe(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 MM({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}W4.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var VWe=new M,HWe=new M;W4.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,VWe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=M.multiplyTransformation(s.originalTransform,e,HWe);s.transform=a}};var LM=W4;var NM=`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 fS={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};fS.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,pe.FRAGMENT),i.addFragmentLines(NM);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=Se.TRANSLUCENT),i.addUniform("vec4",fS.COLOR_UNIFORM_NAME,pe.FRAGMENT),o[fS.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",fS.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),o[fS.COLOR_BLEND_UNIFORM_NAME]=function(){return Lc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=ct(o,e.uniformMap)};var m0=fS;var FM=`#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 efe={name:"ModelClippingPlanesPipelineStage"},GWe=new V;efe.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,pe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,pe.FRAGMENT),Ss.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,pe.FRAGMENT);let s=Ss.getTextureResolution(i,o,GWe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,pe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",pe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",pe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",pe.FRAGMENT),r.addFragmentLines(FM);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=H.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=ct(a,e.uniformMap)};var BM=efe;var kM=`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 UM=`void modelClippingPolygonsStage() -{ - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var tfe={name:"ModelClippingPolygonsPipelineStage"};tfe.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,pe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,pe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,pe.BOTH),o.addUniform("sampler2D","model_clippingDistance",pe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",pe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(kM),o.addFragmentLines(UM);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=ct(r,e.uniformMap)};var zM=tfe;function nfe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(nfe.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 VM=nfe;var HM=`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 GM=`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 jM=`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 q4=new M,jWe=new M,WWe=new M,ofe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:lfe,_transformsToTypedArray:J7};ofe.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(HM);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];s7e(e,n,i,d,u,f),l7e(e,n,i,d);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",pe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",pe.VERTEX),p.u_instance_modifiedModelView=function(){let _=M.multiplyTransformation(s.modelMatrix,a.components.transform,q4);return u?M.multiplyTransformation(n.context.uniformState.view3D,_,q4):(n.mode!==ne.SCENE3D&&(_=At.basisTo2D(n.mapProjection,_,q4)),M.multiplyTransformation(n.context.uniformState.view,_,q4))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,jWe)},r.addVertexLines(jM)):r.addVertexLines(GM),u){r.addDefine("USE_2D_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_modelView2D",pe.VERTEX);let _=n.context,m=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(_.uniformState.view,m,WWe)}}e.uniformMap=ct(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,d)};var WM=new M,qWe=new h;function YWe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,WM);return r=M.multiplyTransformation(r,n,WM),o=At.basisTo2D(i.mapProjection,r,o),o}function XWe(e,t,n,i,o){let r=M.fromTranslation(e,WM),s=M.multiplyTransformation(t,r,WM);s=M.multiplyTransformation(s,n,WM);let a=M.getTranslation(s,qWe);return o=ji.computeActualEllipsoidPosition(i,a,o),o}function rfe(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var sfe=new M,afe=new M,KWe=new M,$We=new h;function ZWe(e,t,n,i){let o=sfe,r=afe;rfe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=YWe(f,o,r,n,KWe),p=M.getTranslation(d,$We),_=h.subtract(p,a,p);i[u]=M.setTranslation(d,_,i[u])}return i}function QWe(e,t,n,i){let o=sfe,r=afe;rfe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=XWe(f,o,r,n,f);i[u]=h.subtract(d,a,i[u])}return i}var JWe=new h,e7e=new h;function cfe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=M.multiplyByPoint(i,n.instancingTranslationMin,JWe),r=ji.computeActualEllipsoidPosition(t,o,o),s=M.multiplyByPoint(i,n.instancingTranslationMax,e7e),a=ji.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function J7(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 t7e(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 n7e=new h,i7e=new Pe,o7e=new h;function lfe(e,t,n){let i=new Array(t),o=Qt.getAttributeBySemantic(e,hs.TRANSLATION),r=Qt.getAttributeBySemantic(e,hs.ROTATION),s=Qt.getAttributeBySemantic(e,hs.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(s),p=u?o.typedArray:new Float32Array(t*3),_=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(_=On.dequantize(_,r.componentDatatype,r.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let x=new h(p[b*3],p[b*3+1],p[b*3+2],n7e);h.maximumByComponent(a,x,a),h.minimumByComponent(c,x,c);let T=new Pe(_[b*4],_[b*4+1],_[b*4+2],f?_[b*4+3]:1,i7e),C=new h(m[b*3],m[b*3+1],m[b*3+2],o7e),A=M.fromTranslationQuaternionRotationScale(x,T,C,new M);i[b]=A}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(s.typedArray=void 0),i}function r7e(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,h.minimumByComponent(r,u,r),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function eq(e,t){let n=st.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function s7e(e,t,n,i,o,r){let s=Qt.getAttributeBySemantic(n,hs.ROTATION);l(s)?a7e(e,n,i,t,o,r):c7e(e,n,i,t,o)}function a7e(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=lfe(t,a,e);let b=J7(d);p=eq(b,i),c._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(ife(e,p,n,f),!o)return;let _=Fe(i);_.mode=ne.COLUMBUS_VIEW,cfe(e,_);let m=u.instancingTransformsBuffer2D;if(!l(m)){let b=ZWe(d,e,_,d),x=J7(b);m=eq(x,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}ife(e,m,n,"Transform2D")}function c7e(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Qt.getAttributeBySemantic(t,hs.TRANSLATION),u=Qt.getAttributeBySemantic(t,hs.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),Q7(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=r7e(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),Q7(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let _=Fe(i);_.mode=ne.COLUMBUS_VIEW,cfe(e,_);let m=a.instancingTranslationBuffer2D;if(!l(m)){let T=QWe(f,e,_,f),C=t7e(T);r&&(a.transformsTypedArray=C),m=eq(C,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;Q7(e,m,0,void 0,n,"Translation2D")}function ife(e,t,n,i){let r=K.getSizeInBytes(K.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.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 Q7(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function l7e(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===hs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:rn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var qM=ofe;var tq={};tq.name="ModelMatrixUpdateStage";tq.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;ufe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function u7e(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Qt.getCullFace(e.modelMatrix,e.primitiveType)}function ufe(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];u7e(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=M.clone(i,a._transformToRoot),ufe(a,t,n,i),a._transformDirty=!1}}var YM=tq;var ffe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:dfe,_countGeneratedBuffers:hfe};ffe.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;dfe(i,o),hfe(i,r)};function dfe(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 hfe(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 XM=ffe;function dS(e){e=e??G.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,f7e(this)}Object.defineProperties(dS.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=M.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),nq(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Pe.equals(n,e)||(t.rotation=Pe.clone(e,t.rotation),nq(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),nq(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 f7e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Hy(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 nq(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}dS.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};dS.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(qM),t.push(XM),n.push(YM)};dS.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};dS.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new M);let r=M.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=M.inverseTransformation(r,t[o]);t[o]=M.multiplyTransformation(s,n[o],t[o])}};var KM=dS;var mfe={name:"AlphaPipelineStage"};mfe.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Se.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,pe.FRAGMENT),s.addUniform("float","u_alphaCutoff",pe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var $M=mfe;var pfe={name:"BatchTexturePipelineStage"};pfe.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=ct(o,e.uniformMap)};var ZM=pfe;var _fe={name:"ClassificationPipelineStage"};_fe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,pe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||d7e(t,o)};function d7e(e,t){let n=Qt.getAttributeBySemantic(e,mt.POSITION);if(!l(n))throw new se("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,mt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],_=0;for(let y=1;y<s;y++){let b=r?i[y]:y,x=c[b];if(x!==p){let T=y-_,C=y;u.push(T),f.push(C),_=C,p=x}}let m=s-_;u.push(m),t.batchLengths=u,t.batchOffsets=f}var QM=_fe;var JM=`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 eL=`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 gfe={name:"CPUStylingPipelineStage"};gfe.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(JM),o.addFragmentLines(eL),o.addDefine("USE_CPU_STYLING",void 0,pe.BOTH),l(i.color)||(o.addUniform("float",m0.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),e.uniformMap[m0.COLOR_BLEND_UNIFORM_NAME]=function(){return Lc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",pe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Se.TRANSLUCENT}};var tL=gfe;var yfe={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};yfe.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Q_=Object.freeze(yfe);var nL=`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 iL=`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 oL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var rL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Wi={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()"};Wi.process=function(e,t,n){let i=e.shaderBuilder;h7e(i);let o=e.runtimeNode.node.instances;l(o)&&m7e(e,o,n),p7e(e,t,n),i.addVertexLines(rL),i.addFragmentLines(oL)};function h7e(e){e.addStruct(Wi.STRUCT_ID_FEATURE_IDS_VS,Wi.STRUCT_NAME_FEATURE_IDS,pe.VERTEX),e.addStruct(Wi.STRUCT_ID_FEATURE_IDS_FS,Wi.STRUCT_NAME_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Wi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.VERTEX),e.addFunction(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Wi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Wi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Wi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.VERTEX),e.addFunction(Wi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Wi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.FRAGMENT),e.addFunction(Wi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Wi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,pe.VERTEX)}function m7e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Tn.FeatureIdAttribute?_7e(e,s,a):bfe(e,s,a,o,1,n);let c=s.label;l(c)&&xfe(e,a,c,pe.BOTH)}}function p7e(e,t,n){let i=t.featureIds,r=Qt.getAttributeBySemantic(t,mt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=pe.BOTH;a instanceof Tn.FeatureIdAttribute?g7e(e,a,c):a instanceof Tn.FeatureIdImplicitRange?bfe(e,a,c,r,void 0,n):(y7e(e,a,c,s,n),u=pe.FRAGMENT);let f=a.label;l(f)&&xfe(e,c,f,u)}}function _7e(e,t,n){let i=e.shaderBuilder;i.addStructField(Wi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Wi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Wi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function g7e(e,t,n){let i=e.shaderBuilder;i.addStructField(Wi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Wi.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(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function bfe(e,t,n,i,o,r){b7e(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(Wi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Wi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Wi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function y7e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(Wi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,pe.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,_=a.transform;if(l(_)&&!Z.equals(_,Z.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,pe.FRAGMENT),s[b]=function(){return _},p=`vec2(${b} * vec3(${d}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function xfe(e,t,n,i){let o=e.shaderBuilder,r=pe.includesVertexShader(i);r&&o.addStructField(Wi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Wi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Wi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function b7e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=x7e(t,n);s=st.createVertexBuffer({context:o.context,typedArray:u,usage:Ne.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:K.FLOAT,strideInBytes:K.getSizeInBytes(K.FLOAT),offsetInBytes:0};e.attributes.push(c)}function x7e(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 p0=Wi;var sL=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); -} -`;var aL=`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=T7e(r.propertyAttributes,t,a),u=A7e(r.propertyTextures,a),f=c.concat(u);S7e(i,f),I7e(i),i.addVertexLines(aL),i.addFragmentLines(sL);for(let d=0;d<c.length;d++){let p=c[d];P7e(e,p)}for(let d=0;d<u.length;d++){let p=u[d];R7e(e,p)}};function T7e(e,t,n){return l(e)?e.flatMap(i=>C7e(i,t,n)):[]}function C7e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],_=i(t,p.attribute),{glslType:m,variableName:y}=o(_);u[f]={metadataVariable:r(d),property:p,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:pe.BOTH}}return u}function A7e(e,t){return l(e)?e.flatMap(n=>E7e(n,t)):[]}function E7e(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,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:pe.FRAGMENT}}return s}function S7e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==at.ENUM&&i.add(u)}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,u){e.addStruct(a,a,pe.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?w7e(c):c;e.addStructField(a,p,d)}}}var v7e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function w7e(e){let t=v7e[e];return l(t)?t:e}function I7e(e){e.addStruct(Ri.STRUCT_ID_METADATA_VS,Ri.STRUCT_NAME_METADATA,pe.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_FS,Ri.STRUCT_NAME_METADATA,pe.FRAGMENT),e.addStruct(Ri.STRUCT_ID_METADATA_CLASS_VS,Ri.STRUCT_NAME_METADATA_CLASS,pe.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_CLASS_FS,Ri.STRUCT_NAME_METADATA_CLASS,pe.FRAGMENT),e.addStruct(Ri.STRUCT_ID_METADATA_STATISTICS_VS,Ri.STRUCT_NAME_METADATA_STATISTICS,pe.VERTEX),e.addStruct(Ri.STRUCT_ID_METADATA_STATISTICS_FS,Ri.STRUCT_NAME_METADATA_STATISTICS,pe.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,Ri.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.VERTEX),e.addFunction(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,Ri.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.FRAGMENT),e.addFunction(Ri.FUNCTION_ID_SET_METADATA_VARYINGS,Ri.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,pe.VERTEX)}function P7e(e,t){D7e(e,t),Tfe(e.shaderBuilder,t),Cfe(e.shaderBuilder,t)}function D7e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Efe({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:pe.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 R7e(e,t){O7e(e,t),Tfe(e.shaderBuilder,t),Cfe(e.shaderBuilder,t)}function O7e(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:d}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,pe.FRAGMENT),i[p]=()=>f),n.addStructField(Ri.STRUCT_ID_METADATA_FS,r,o);let _=`attributes.texCoord_${a}`,m=_;if(l(d)&&!Z.equals(d,Z.IDENTITY)){let C=`${p}Transform`;n.addUniform("mat3",C,pe.FRAGMENT),i[C]=function(){return d},m=`vec2(${C} * vec3(${_}, 1.0))`}let y=`texture(${p}, ${m}).${c}`,b=s.unpackInShader(y),x=Efe({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:pe.FRAGMENT,property:s}),T=`metadata.${o} = ${x};`;n.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,[T])}function Tfe(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Afe(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),pe.includesVertexShader(r)&&(e.addStructField(Ri.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Cfe(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Ri.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Afe(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,c),pe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Afe(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 Efe(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var ld=Ri;var M7e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},_0=Object.freeze(M7e);var Da={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:bt};Da.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===_0.TRANSLUCENT?r.pass=Se.TRANSLUCENT:c===_0.OPAQUE&&(r.pass=void 0);let u=V7e(s,t);if(!u.customShaderEnabled)return;if(W7e(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,pe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,pe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,pe.FRAGMENT);let p=Q_.getDefineName(s.mode);i.addDefine(p,void 0,pe.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let _=f[p];i.addUniform(_.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let _=d[p];i.addVarying(_,p)}e.uniformMap=ct(e.uniformMap,s.uniformMap)};function L7e(e){let t={};for(let n=0;n<e.length;n++){let i=Qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var N7e={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},F7e={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 Sfe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=N7e[t],i=F7e[t];if(l(n))return{attributeField:[n,e],value:i}}function B7e(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=vfe(t,n,!1),o=wfe(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=Sfe(u);if(!l(f))return Da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function k7e(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 U7e(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=vfe(t,n,!0),o=wfe(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let d=[i[u].glslType,u];s.push(d),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],d=Sfe(f);if(!l(d))return Da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(d.attributeField),r=`fsInput.attributes.${f} = ${d.value};`,a.push(r)}let c=k7e(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var z7e={positionWC:!0,positionEC:!0};function vfe(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 wfe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||z7e.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 V7e(e,t){let n=L7e(t.attributes),i=B7e(e,n),o=U7e(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function H7e(e,t){let n=Da.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Da.STRUCT_NAME_ATTRIBUTES,pe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Da.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Da.STRUCT_NAME_VERTEX_INPUT,pe.VERTEX),e.addStructField(n,Da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,p0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ld.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ld.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ld.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,pe.VERTEX),e.addFunctionLines(r,o)}function G7e(e,t){let n=Da.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Da.STRUCT_NAME_ATTRIBUTES,pe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Da.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Da.STRUCT_NAME_FRAGMENT_INPUT,pe.FRAGMENT),e.addStructField(n,Da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,p0.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ld.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ld.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ld.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,pe.FRAGMENT),e.addFunctionLines(r,o)}var j7e=[];function W7e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=j7e;i.enabled&&(H7e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,nL),e.addVertexLines(r)),o.enabled&&(G7e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,iL),e.addFragmentLines(r))}var cL=Da;var lL={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};lL.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,pe.VERTEX),i.addFunction(lL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,lL.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,pe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===mt.POSITION,d=c.semantic===mt.TEXCOORD;if(r&&!f&&!d)continue;let p=Qt.getAttributeInfo(c);Y7e(i,p),q7e(e,p)}};function q7e(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,pe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,pe.VERTEX),n.addUniform(c,a,pe.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Ife(u,0),f=Ife(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Ife(e,t){return e instanceof ie?e:new ie(e.x,e.y,e.z,t)}function Y7e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=X7e(n,i):o=K7e(n),e.addFunctionLines(lL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function X7e(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 K7e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var uL=lL;var fL=`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 dL=`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 hS=`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 hL={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};hL.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=$7e(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),Z7e(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===pe.BOTH&&i.addVertexLines(hS),i.addFragmentLines(hS)};function Pfe(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Dfe(e){return e instanceof Tn.FeatureIdTexture?pe.FRAGMENT:pe.BOTH}function $7e(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:Dfe(o),featureIdDefine:Pfe(o)}):(o=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Dfe(o),featureIdDefine:Pfe(o)})}function Z7e(e){e.addStructField(hL.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(hL.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(hL.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var g0=hL;var aa={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)"};aa.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",pe.VERTEX),i.addStruct(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",pe.FRAGMENT),i.addStruct(g0.STRUCT_ID_SELECTED_FEATURE,g0.STRUCT_NAME_SELECTED_FEATURE,pe.BOTH),i.addFunction(aa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,aa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,pe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(aa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,aa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.VERTEX),i.addFunction(aa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,aa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.FRAGMENT),o.type===br.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,pe.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=rn.getAttributeLocationCount(f.type),p=f.semantic===mt.POSITION,_;d>1?(_=e.attributeIndex,e.attributeIndex+=d):p&&!a?_=0:_=e.attributeIndex++,Q7e(e,f,_,d,r,s)}aqe(i,t.attributes),t.primitiveType===Le.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(dL),i.addFragmentLines(fL)};function Q7e(e,t,n,i,o,r){let s=e.shaderBuilder,a=Qt.getAttributeInfo(t),c=o&&!r;i>1?tqe(e,t,n,i):eqe(e,t,n,c),iqe(s,a,c),nqe(s,a),l(t.semantic)&&J7e(s,t),oqe(s,a,o),rqe(s,a,c),sqe(s,a)}function J7e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case mt.NORMAL:e.addDefine("HAS_NORMALS");break;case mt.TANGENT:e.addDefine("HAS_TANGENTS");break;case mt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case mt.TEXCOORD:case mt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function eqe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===mt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===mt.POSITION,f=u?0:n,d=rn.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let _=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:_,count:t.count,componentsPerAttribute:d,componentDatatype:K.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function tqe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=rn.getNumberOfComponents(s)/i,f=K.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let _=0;_<i;_++){let m=t.byteOffset+_*d,y={index:n+_,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(y)}}function nqe(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 iqe(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===mt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function oqe(e,t,n){let i=aa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=aa.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 rqe(e,t,n){let i=aa.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 sqe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=aa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=aa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function aqe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===mt.NORMAL?n=!0:r.semantic===mt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(aa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var mL=aa;var pL=`#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 cqe={UNLIT:0,PBR:1},Zm=Object.freeze(cqe);var Rfe={name:"LightingPipelineStage"};Rfe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,pe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",pe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Zm.PBR?o.addDefine("LIGHTING_PBR",void 0,pe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,pe.FRAGMENT),o.addFragmentLines(pL)};var _L=Rfe;var gL=`// 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:lqe,MetallicRoughness:iq,SpecularGlossiness:oq,Specular:Ofe,Clearcoat:Mfe}=Tn,Lfe={name:"MaterialPipelineStage",_processTexture:cu,_processTextureTransform:Nfe};Lfe.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;fqe(i,r,s,u,f,d,c),l(i.specularGlossiness)?dqe(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Qt.supportedExtensions.KHR_materials_specular&&hqe(i.specular,r,s,u,c),l(i.anisotropy)&&Qt.supportedExtensions.KHR_materials_anisotropy&&pqe(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Qt.supportedExtensions.KHR_materials_clearcoat&&_qe(i.clearcoat,r,s,u,c),gqe(i.metallicRoughness,r,s,u,c));let p=Qt.getAttributeBySemantic(t,mt.NORMAL),_=e.lightingOptions;i.unlit||!p||a?_.lightingModel=Zm.UNLIT:_.lightingModel=Zm.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let y=e.alphaOptions;i.alphaMode===Ym.BLEND?y.pass=Se.TRANSLUCENT:i.alphaMode===Ym.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines(gL),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,pe.BOTH)};function Nfe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,pe.FRAGMENT),t[s]=function(){return n.transform}}function uqe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,pe.FRAGMENT),t[s]=function(){return n.scale}}function cu(e,t,n,i,o,r){e.addUniform("sampler2D",i,pe.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,pe.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,pe.FRAGMENT);let f=n.transform;l(f)&&!Z.equals(f,Z.IDENTITY)&&Nfe(e,t,n,i,o);let{scale:d}=n;l(d)&&d!==1&&uqe(e,t,n,i,o)}function fqe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!h.equals(a,lqe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",pe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,pe.FRAGMENT),l(c)&&!s&&cu(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&cu(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&cu(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function dqe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,pe.FRAGMENT),l(r)&&!o&&cu(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!ie.equals(s,oq.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",pe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&cu(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,oq.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",pe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(u)&&u!==oq.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",pe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,pe.FRAGMENT))}function hqe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,pe.FRAGMENT),l(r)&&!o&&cu(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Ofe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",pe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&cu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Ofe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",pe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,pe.FRAGMENT))}var mqe=new h;function pqe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,pe.FRAGMENT),l(a)&&!o&&cu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",pe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,r,mqe)}}function _qe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,pe.FRAGMENT),l(r)&&r!==Mfe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",pe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,pe.FRAGMENT)),l(s)&&!o&&cu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Mfe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",pe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT)),l(c)&&!o&&cu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&cu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function gqe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,pe.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&cu(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!ie.equals(s,iq.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",pe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,pe.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&cu(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==iq.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",pe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,pe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==iq.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",pe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT))}var yL=Lfe;var Sl={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"};Sl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Sl.METADATA_PICKING_VALUE_TYPE,"float",pe.FRAGMENT),i.addDefine(Sl.METADATA_PICKING_VALUE_STRING,"0.0",pe.FRAGMENT),i.addDefine(Sl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",pe.FRAGMENT),i.addDefine(Sl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",pe.FRAGMENT),i.addDefine(Sl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",pe.FRAGMENT),i.addDefine(Sl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",pe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",pe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Sl.METADATA_PICKING_VALUE_TYPE} value = ${Sl.METADATA_PICKING_VALUE_TYPE}(${Sl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Sl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Sl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Sl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Sl.METADATA_PICKING_VALUE_COMPONENT_W};`],pe.FRAGMENT)};var Xu=Sl;var bL=`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 ic={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)"};ic.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,pe.VERTEX),Aqe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==mt.POSITION&&p!==mt.NORMAL&&p!==mt.TANGENT||(bqe(e,d,e.attributeIndex,a),e.attributeIndex++)}}Eqe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,pe.VERTEX),n.addVertexLines(bL);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=ct(s,e.uniformMap)};var yqe={attributeString:void 0,functionId:void 0};function bqe(e,t,n,i){let o=e.shaderBuilder;xqe(e,t,n);let r=Tqe(t,yqe);Cqe(o,r,i)}function xqe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:rn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Tqe(e,t){switch(e.semantic){case mt.POSITION:t.attributeString="Position",t.functionId=ic.FUNCTION_ID_GET_MORPHED_POSITION;break;case mt.NORMAL:t.attributeString="Normal",t.functionId=ic.FUNCTION_ID_GET_MORPHED_NORMAL;break;case mt.TANGENT:t.attributeString="Tangent",t.functionId=ic.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Cqe(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 Aqe(e){e.addFunction(ic.FUNCTION_ID_GET_MORPHED_POSITION,ic.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,pe.VERTEX),e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(ic.FUNCTION_ID_GET_MORPHED_NORMAL,ic.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,pe.VERTEX),e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(ic.FUNCTION_ID_GET_MORPHED_TANGENT,ic.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,pe.VERTEX),e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Eqe(e){e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(ic.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var xL=ic;var Ffe={name:"PickingPipelineStage"};Ffe.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)Sqe(e,t,a,i);else if(l(a))vqe(e,i);else{let c=Bfe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",pe.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Bfe(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(br.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 Sqe(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",pe.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function vqe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let d=0;d<n;d++){let p=Bfe(e,d),_=t.createPickId(p);s.push(_),i[d]=_;let m=_.color;o[d*4+0]=H.floatToByte(m.red),o[d*4+1]=H.floatToByte(m.green),o[d*4+2]=H.floatToByte(m.blue),o[d*4+3]=H.floatToByte(m.alpha)}r._pickIds=i;let a=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,pe.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var TL=Ffe;var wqe={ADD:0,REPLACE:1},Ko=Object.freeze(wqe);var CL=`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 Iqe=new ie,Ufe={name:"PointCloudStylingPipelineStage"};Ufe.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let y=Oqe(a),b=Mqe(r,y);Lqe(i,b);let T=Nqe(b).indexOf("normalMC")>=0,C=Qt.getAttributeBySemantic(t,mt.NORMAL);if(T&&!C)throw new se("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,pe.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=Se.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,pe.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,pe.VERTEX);let d,p,_;br.is3DTiles(o.type)&&(p=!0,d=o.content,_=d.tile.refine===Ko.ADD),i.addUniform("vec4","model_pointCloudParameters",pe.VERTEX),i.addVertexLines(CL);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Iqe,b=1;p&&(b=_?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??b,y.x*=n.pixelRatio;let x=Pqe(e,t,f,d);y.y=x*f.geometricErrorScale;let T=n.context,C=n.camera.frustum,A;return n.mode===ne.SCENE2D||C instanceof cn?A=Number.POSITIVE_INFINITY:A=T.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=A,p&&(y.w=d.tileset.timeSinceLoad),y}};var kfe=new h;function Pqe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Qt.getAttributeBySemantic(t,mt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,kfe);a=M.multiplyByPointAsVector(s,a,kfe);let c=a.x*a.y*a.z;return D.cbrt(c/r)}var Dqe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Rqe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Oqe(e){let t=Fe(Rqe);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 rq="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Mqe(e,t){let n=Dqe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${rq})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${rq})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${rq})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Lqe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,pe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,pe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,pe.VERTEX),e.addVertexLines(o))}function sq(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 Nqe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&sq(t,o),l(n)&&sq(n,o),l(i)&&sq(i,o),o}var AL=Ufe;var EL=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var SL=`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 zfe={name:"PrimitiveOutlinePipelineStage"};zfe.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,pe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:rn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",pe.FRAGMENT);let a=pT.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",pe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",pe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(EL),i.addFragmentLines(SL)};var vL=zfe;var Vfe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Hfe,_count2DPositions:Gfe,_countMorphTargetAttributes:jfe,_countMaterialTextures:Wfe,_countFeatureIdTextures:qfe,_countBinaryMetadata:Yfe};Vfe.process=function(e,t,n){let i=e.model,o=i.statistics;Hfe(o,t),Gfe(o,e.runtimePrimitive),jfe(o,t),Wfe(o,t.material),qfe(o,t.featureIds),Yfe(o,i)};function Hfe(e,t){let n=l(t.indices)?t.indices.count:Qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Le.POINTS?e.pointsLength+=n:Le.isTriangles(i)&&(e.trianglesLength+=Fqe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function Fqe(e,t){switch(e){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Gfe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function jfe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Wfe(e,t){let n=Bqe(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 Bqe(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 qfe(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Tn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Yfe(e,t){let n=t.structuralMetadata;l(n)&&(kqe(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 kqe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var wL=Vfe;var Uqe=new M,zqe=new M,Xfe={name:"SceneMode2DPipelineStage"};Xfe.process=function(e,t,n){let i=Qt.getAttributeBySemantic(t,mt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,Uqe),u=Gqe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=qqe(i,c,u,n);f.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,pe.VERTEX),o.addUniform("mat4","u_modelView2D",pe.VERTEX);let p=M.fromTranslation(u.center,new M),_=n.context,m={u_modelView2D:function(){return M.multiplyTransformation(_.uniformState.view,p,zqe)}};e.uniformMap=ct(m,e.uniformMap)};var Vqe=new h,Hqe=new h;function Gqe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,Vqe),o=ji.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,Hqe),s=ji.computeActualEllipsoidPosition(n,r,r);return re.fromCornerPoints(o,s,new re)}var Kfe=new h;function jqe(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=h.fromArray(e,s,Kfe),c=h.multiplyComponents(a,r,a),u=h.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function Wqe(e,t,n,i){let o;l(e.quantization)?o=jqe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=h.fromArray(o,c,Kfe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=ji.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function qqe(e,t,n,i){let o=Fe(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=Wqe(e,t,r,o),a=st.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var IL=Xfe;var PL=`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 xT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};xT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,pe.VERTEX),Xqe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,pe.VERTEX),n.addVertexLines(PL);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=ct(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===mt.JOINTS||r.semantic===mt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function Xqe(e,t){e.addFunction(xT.FUNCTION_ID_GET_SKINNING_MATRIX,xT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,pe.VERTEX),e.addFunctionLines(xT.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],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(xT.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(xT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var DL=xT;var RL=`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 $fe={name:"VerticalExaggerationPipelineStage"},Kqe=new V;$fe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(RL),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,pe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",pe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return V.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,Kqe)}};var OL=$fe;var aq={};function $qe(e){let t=ke.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 Zqe(e,t){let n=t.length,i=ke.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 Qqe(e){let t=e-2,n=2+t*4,i=ke.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 Jqe(e,t){let i=t.length-2,o=2+i*4,r=ke.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function eYe(e){let t=e-2,n=2+t*4,i=ke.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 tYe(e,t){let i=t.length-2,o=2+i*4,r=ke.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}aq.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Le.TRIANGLES)return i?Zqe(t,n):$qe(t);if(e===Le.TRIANGLE_STRIP)return i?Jqe(t,n):Qqe(t);if(e===Le.TRIANGLE_FAN)return i?tYe(t,n):eYe(t)};aq.getWireframeIndicesCount=function(e,t){return e===Le.TRIANGLES?t*2:e===Le.TRIANGLE_STRIP||e===Le.TRIANGLE_FAN?2+(t-2)*4:t};var mS=aq;var Zfe={name:"WireframePipelineStage"};Zfe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,pe.FRAGMENT);let o=e.model,r=nYe(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=Le.LINES,e.count=mS.getWireframeIndicesCount(a,c)};function nYe(e,t,n){let o=Qt.getAttributeBySemantic(e,mt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(s=f.sizeInBytes===d?new Uint8Array(d):ke.createTypedArray(o,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=mS.createWireframeIndices(a,o,s),u=ke.fromSizeInBytes(c.BYTES_PER_ELEMENT);return st.createIndexBuffer({context:n.context,typedArray:c,usage:Ne.STATIC_DRAW,indexDatatype:u})}var ML=Zfe;function Qfe(e){e=e??G.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=[]}Qfe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),_=l(r),y=!(_&&l(r.fragmentShaderText))||r.mode!==Q_.REPLACE_MATERIAL,b=Qt.hasQuantizedAttributes(n.attributes),x=o.debugWireframe&&Le.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),T=o.pointCloudShading,C=l(T)&&T.attenuation,A=l(T)&&T.backFaceCulling,S=n.primitiveType===Le.POINTS&&(l(s)||C||A),w=o._enableShowOutline&&l(n.outlineCoordinates),R=iYe(o,i,n),P=l(o.classificationType);u&&t.push(IL),t.push(mL),x&&t.push(ML),P&&t.push(QM),d&&t.push(xL),p&&t.push(DL),S&&t.push(AL),b&&t.push(uL),y&&t.push(yL),t.push(p0),t.push(ld),t.push(Xu),R.hasPropertyTable&&(t.push(g0),t.push(ZM),t.push(tL)),f&&t.push(OL),_&&t.push(cL),t.push(_L),o.allowPicking&&t.push(TL),w&&t.push(vL),t.push($M),t.push(wL)};function iYe(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 LL=Qfe;function cq(e){e=e??G.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],oYe(this)}Object.defineProperties(cq.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 oYe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let d=n[c],p=Jfe(f,d,new M);a.push(p)}}function Jfe(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}cq.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]=Jfe(i,o,e[n])}};var NL=cq;function rYe(){this.pass=void 0,this.alphaCutoff=void 0}var FL=rYe;function sYe(e){this.shaderBuilder=new px,this.model=e,this.uniformMap={},this.alphaOptions=new FL,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var BL=sYe;var kL=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var UL=`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 Y4={name:"ModelSilhouettePipelineStage"};Y4.silhouettesLength=0;Y4.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++Y4.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,pe.BOTH),i.addVertexLines(UL),i.addFragmentLines(kL),i.addUniform("vec4","model_silhouetteColor",pe.FRAGMENT),i.addUniform("float","model_silhouetteSize",pe.VERTEX),i.addUniform("bool","model_silhouettePass",pe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=ct(o,e.uniformMap),e.hasSilhouette=!0};var zL=Y4;var VL=`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 X4={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};X4.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,pe.FRAGMENT),i.addFragmentLines(VL);let o={};i.addUniform("float",X4.SPLIT_DIRECTION_UNIFORM_NAME,pe.FRAGMENT),o[X4.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=ct(o,e.uniformMap)};var HL=X4;function aYe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Fe(e.uniformMap),this.alphaOptions=Fe(e.alphaOptions),this.renderStateOptions=Fe(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 GL=aYe;function cYe(e){e=e??G.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Zm.UNLIT}var jL=cYe;function lYe(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=Fe(e.uniformMap),this.alphaOptions=Fe(e.alphaOptions),this.renderStateOptions=Fe(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=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=re.fromCornerPoints(this.positionMin,this.positionMax,new re),this.lightingOptions=new jL,this.pickId=void 0}var WL=lYe;function uq(e){e=e??G.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!==zn.CESIUM_3D_TILE,this._classifies3DTiles=o!==zn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],hYe(this)}function uYe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}var fYe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},dYe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},nde=[];function hYe(e){let t=e._command,n=nde;if(e._useDebugWireframe){t.pass=Se.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=qL(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=Se.TERRAIN_CLASSIFICATION,s=lq(t,r),a=ede(t,r);n.length=0,n.push(s,a),e._commandListTerrain=qL(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=tde(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Se.CESIUM_3D_TILE_CLASSIFICATION,s=lq(t,r),a=ede(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=qL(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=tde(e,n,e._commandList3DTilesPicking))}}function qL(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let d=0;d<a;d++){let p=t[d],_=qe.shallowClone(p);_.count=u,_.offset=f,n.push(_)}}return n}function lq(e,t){let n=qe.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Se.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=uYe(i);return n.renderState=ze.fromCache(o),n}function ede(e,t){let n=qe.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(fYe),n}var mYe=[];function tde(e,t,n){let i=ze.fromCache(dYe),o=t[0],r=t[1],s=qe.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=qe.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=mYe;return c.length=0,c.push(s,a),qL(e,c,n)}Object.defineProperties(uq.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=re.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});uq.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=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=lq(this._command,o),s=nde;s.length=0,s.push(r),this._commandListIgnoreShow=qL(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 YL=uq;function K4(e){e=e??G.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===Se.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c;this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=re.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new re,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,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,pYe(this)}function J_(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}J_.clone=function(e){return new J_({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function pYe(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 J_({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new J_({command:CYe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new J_({command:IYe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new J_({command:PYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new J_({command:AYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new J_({command:EYe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(K4.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=re.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,gYe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,yYe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,bYe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,xYe(this))}}});function _Ye(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=re.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function gYe(e){let t=e.shadows,n=xn.castShadows(t),i=xn.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 yYe(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=Fe(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function bYe(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=Fe(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function xYe(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}}}K4.prototype.pushCommands=function(e,t){let n=ide(this,e);n&&!this._has2DCommands&&(TYe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(_Ye(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Oh.ALL_OPAQUE&&_S(t,this._translucentCommand,n),i===Oh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||_S(o._backfaceCommands,this._skipLodBackfaceCommand,n),SYe(this,r,n),_S(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){_S(t,this._silhouetteModelCommand,n);return}return _S(t,this._originalCommand,n),t}};K4.prototype.pushSilhouetteCommands=function(e,t){let n=ide(this,e);return _S(t,this._silhouetteColorCommand,n),t};function _S(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function ide(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*D.PI;return o<s&&r>s||o<-s&&r>-s}function pS(e,t){if(!l(t))return;let n=J_.clone(t),i=qe.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 TYe(e){pS(e,e._originalCommand),pS(e,e._translucentCommand),pS(e,e._skipLodBackfaceCommand),pS(e,e._skipLodStencilCommand),pS(e,e._silhouetteModelCommand),pS(e,e._silhouetteColorCommand)}function CYe(e){let t=qe.shallowClone(e);t.pass=Se.TRANSLUCENT;let n=Fe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=fn.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function AYe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Fe(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:q.ALWAYS,backFunction:q.ALWAYS,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function EYe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Fe(e.renderState,!0);o.cull.enabled=!1,(e.pass===Se.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Se.TRANSLUCENT,o.depthMask=!1,o.blending=fn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:q.NOTEQUAL,backFunction:q.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP}};let s=Fe(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function SYe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=vYe(o);if(r!==s){let a=wYe(r),c=Fe(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function vYe(e){return(e.renderState.stencilTest.reference&jt.SKIP_LOD_MASK)>>>jt.SKIP_LOD_BIT_SHIFT}function wYe(e){return jt.CESIUM_3D_TILE_MASK|e<<jt.SKIP_LOD_BIT_SHIFT}function IYe(e){let t=qe.shallowClone(e),n=Fe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ai.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Fe(t.uniformMap),o=new V(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function PYe(e){let t=qe.shallowClone(e),n=Fe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=jt.SKIP_LOD_MASK,i.reference=jt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=jt.CESIUM_3D_TILE_MASK|jt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var XL=K4;var KL=`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 $L=` -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 ode(){}ode.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=DYe(e,n,t),o=RYe(e,i,t),r=e.model;return l(r.classificationType)?new YL({primitiveRenderResources:e,command:o}):new XL({primitiveRenderResources:e,command:o})};function DYe(e,t,n){t.addVertexLines(KL),t.addFragmentLines($L);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function RYe(e,t,n){let i=OYe(e),o=new qn({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===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=M.multiplyTransformation(x,e.runtimeNode.computedTransform,new M),f=re.transform(e.boundingSphere,u)}let d=Fe(ze.fromCache(e.renderStateOptions),!0);d.cull.face=Qt.getCullFace(u,e.primitiveType),d=ze.fromCache(d);let p=l(r.classificationType),_=p?!1:xn.castShadows(r.shadows),m=p?!1:xn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new qe({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,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:_,receiveShadows:m})}function OYe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var ZL=ode;function Ku(e){e=e??G.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=Qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},MYe(this)}Object.defineProperties(Ku.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 MYe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;rde(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let C=r[T],A=new LM({articulation:C,sceneGraph:e}),S=A.name;a[S]=A}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=M.IDENTITY;for(let T=0;T<d;T++){let C=n.nodes[T],A=sde(e,C,p);e._rootNodes.push(A)}let _=t.skins,m=e._runtimeSkins,y=_.length;for(let T=0;T<y;T++){let C=_[T];m.push(new NL({skin:C,sceneGraph:e}))}let b=e._skinnedNodes,x=b.length;for(let T=0;T<x;T++){let C=b[T],A=e._runtimeNodes[C],w=c[C].skin.index;A._runtimeSkin=m[w],A.updateJointMatrices()}e.applyArticulations()}function rde(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var LYe=new h;function NYe(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,LYe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=At.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=re.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function sde(e,t,n){let i=[],o=Qt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=M.multiplyTransformation(n,o,new M),_=sde(e,d,p);i.push(_)}let s=new KM({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new LL({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new VM(f,s);f._nodesByName[u]=d}return c}var FYe=new h,BYe=new h,kYe=new h,UYe=new h;Ku.prototype.buildDrawCommands=function(e){let t=this._model,n=new BL(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=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,FYe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,BYe);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new GL(n,u);for(r=0;r<f.length;r++)f[r].process(d,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let _=u.runtimePrimitives[r];_.configurePipeline(e);let m=_.pipelineStages,y=new WL(d,_);for(s=0;s<m.length;s++)m[s].process(y,_.primitive,e);_.boundingSphere=re.clone(y.boundingSphere,new re);let b=M.multiplyByPoint(p,y.positionMin,kYe),x=M.multiplyByPoint(p,y.positionMax,UYe);h.minimumByComponent(a,b,a),h.maximumByComponent(c,x,c);let T=ZL.buildModelDrawCommand(y,e);_.drawCommand=T}}this._boundingSphere=re.fromCornerPoints(a,c,new re),this._boundingSphere=re.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=re.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=re.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Ku.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(m0),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(OM),n.isClippingEnabled()&&t.push(BM),n.isClippingPolygonsEnabled()&&t.push(zM),n.hasSilhouette(e)&&t.push(zL),l(n.splitDirection)&&n.splitDirection!==Wr.NONE&&t.push(HL),br.is3DTiles(n.type)&&t.push(wM),i&&t.push(DM))};Ku.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!==ne.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)}}};Ku.prototype.updateModelMatrix=function(e,t){rde(this,e),t.mode!==ne.SCENE3D&&NYe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Ku.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 ade(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);ade(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function $4(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];ade(e,c,t,n,i)}}var zYe={backFaceCulling:void 0};Ku.prototype.updateBackFaceCulling=function(e){let t=zYe;t.backFaceCulling=e,$4(this,!1,VYe,t)};function VYe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var HYe={shadowMode:void 0};Ku.prototype.updateShadows=function(e){let t=HYe;t.shadowMode=e,$4(this,!1,GYe,t)};function GYe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var jYe={debugShowBoundingVolume:void 0};Ku.prototype.updateShowBoundingVolume=function(e){let t=jYe;t.debugShowBoundingVolume=e,$4(this,!1,WYe,t)};function WYe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var cde=[],qYe={frameState:void 0,hasSilhouette:void 0};Ku.prototype.pushDrawCommands=function(e){let t=cde;t.length=0;let n=qYe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,$4(this,!0,YYe,n),e.commandList.push.apply(e.commandList,t)};function YYe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=cde,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Ku.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)};Ku.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var QL=Ku;function y0(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new wt}Object.defineProperties(y0.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}}});y0.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()};y0.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};y0.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};y0.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};y0.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};y0.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var JL=y0;var dde=er(Vz(),1);var lde={},TT=Uint32Array.BYTES_PER_ELEMENT;lde.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=TT;let o=i.getUint32(t,!0);if(o!==1)throw new se(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=TT,t+=TT;let r=i.getUint32(t,!0);if(r===0)throw new se("Feature table must have a byte length greater than zero");t+=TT;let s=i.getUint32(t,!0);t+=TT;let a=i.getUint32(t,!0);t+=TT;let c=i.getUint32(t,!0);t+=TT;let u=Ho(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Ho(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let _=new Dh(u,f),m=_.getGlobalProperty("POINTS_LENGTH");if(_.featuresLength=m,!l(m))throw new se("Feature table global property: POINTS_LENGTH must be defined");let y=_.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(y)&&(y=h.unpack(y));let b=XYe(_,d);if(b.rtcCenter=y,b.pointsLength=m,!b.hasPositions){let x=KYe(_);b.positions=x,b.hasPositions=b.hasPositions||l(x)}if(!b.hasPositions)throw new se("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let x=ZYe(_);b.normals=x,b.hasNormals=b.hasNormals||l(x)}if(!b.hasColors){let x=$Ye(_);b.colors=x,b.hasColors=b.hasColors||l(x),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(x)&&x.isTranslucent}if(!b.hasBatchIds){let x=QYe(_);b.batchIds=x,b.hasBatchIds=b.hasBatchIds||l(x)}if(b.hasBatchIds){let x=_.getGlobalProperty("BATCH_LENGTH");if(!l(x))throw new se("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=x}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function XYe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(o)||!l(m)||!l(y))throw new se("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let _;return l(i)&&(_={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:ct(o,r),dequantizeInShader:!0}),{draco:_,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function KYe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",K.FLOAT,3),{name:mt.POSITION,semantic:mt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:K.FLOAT,type:rn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(i))throw new se("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(r))throw new se("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:mt.POSITION,semantic:mt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:K.FLOAT,type:rn.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:K.UNSIGNED_SHORT,quantizedType:rn.VEC3}}}function $Ye(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",K.UNSIGNED_BYTE,4),{name:mt.COLOR,semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",K.UNSIGNED_BYTE,3),{name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",K.UNSIGNED_SHORT,1),{name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.FLOAT,type:rn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",K.UNSIGNED_BYTE,4),o=i[3],r=H.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:mt.COLOR,semantic:mt.COLOR,setIndex:0,constantColor:r,componentDatatype:K.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:s}}}function ZYe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",K.FLOAT,3),{name:mt.NORMAL,semantic:mt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:K.FLOAT,type:rn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",K.UNSIGNED_BYTE,2),{name:mt.NORMAL,semantic:mt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:rn.VEC2,quantizedComponentDatatype:K.UNSIGNED_BYTE,componentDatatype:K.FLOAT,type:rn.VEC3}}function QYe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",K.UNSIGNED_SHORT,1);return{name:mt.FEATURE_ID,semantic:mt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:K.fromTypedArray(n),type:rn.SCALAR}}}var CT=lde;var JYe=Tn.Components,eXe=Tn.Scene,tXe=Tn.Node,nXe=Tn.Primitive,iXe=Tn.Attribute,ude=Tn.Quantization,oXe=Tn.FeatureIdAttribute,rXe=Tn.Material,sXe=Tn.MetallicRoughness;function b0(e){e=e??G.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=yt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(b0.prototype=Object.create(Zi.prototype),b0.prototype.constructor=b0);Object.defineProperties(b0.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});b0.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=CT.parse(this._arrayBuffer,this._byteOffset),this._state=yt.PROCESSING,this._promise=Promise.resolve(this)};b0.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===yt.READY)return!0;if(this._state===yt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=aXe(this,e.context)}return!1};function aXe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=M_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&cXe(e,i,r),bXe(e,t),e._state=yt.READY,e}).catch(function(r){e.unload(),e._state=yt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function cXe(e,t,n){e._state=yt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:mt.POSITION,typedArray:n.POSITION.array,componentDatatype:K.FLOAT,type:rn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT,o.quantizedType=rn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:mt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:K.FLOAT,type:rn.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=K.UNSIGNED_BYTE,o.quantizedType=rn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:mt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:K.fromTypedArray(a),type:rn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:lXe(u.componentsPerAttribute),componentType:uXe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function lXe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function uXe(e){switch(e){case q.BYTE:return"BYTE";case q.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case q.SHORT:return"SHORT";case q.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case q.INT:return"INT";case q.UNSIGNED_INT:return"UNSIGNED_INT";case q.DOUBLE:return"DOUBLE";case q.FLOAT:return"FLOAT"}}function eN(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new ude,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new ude;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new iXe;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=On.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=H.pack(t.constantColor,a)}else{let a=st.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===mt.POSITION&&s&&(r.typedArray=i),r}var fde,Z4;function fXe(e){if(!l(Z4)){fde=new dde.default(0),Z4=new Array(e);for(let t=0;t<e;++t)Z4[t]=fde.random()}return Z4}var dXe=new h,hXe=new h,mXe=new h;function pXe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=fXe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,dXe),u=h.fromElements(a,a,a,hXe),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=h.unpack(t,d*3,mXe),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var _Xe={name:mt.COLOR,semantic:mt.COLOR,setIndex:0,constantColor:H.DARKGRAY,componentDatatype:K.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:!1};function gXe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(pXe(r),o=eN(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=eN(e,t.normals,n),i.push(o)),l(t.colors)?(o=eN(e,t.colors,n),i.push(o)):(o=eN(e,_Xe,n),i.push(o)),l(t.batchIds)&&(o=eN(e,t.batchIds,n),i.push(o)),i}function yXe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);return l(o)||e.hasDracoBatchTable?q_({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new sa({schema:{},propertyTables:[]})}function bXe(e,t){let n=e._parsedContent,i=new sXe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new rXe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Ym.BLEND);let s=!l(n.normals);o.unlit=s;let a=new nXe;if(a.attributes=gXe(e,n,t),a.primitiveType=Le.POINTS,a.material=o,l(n.batchIds)){let _=new oXe;_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0",a.featureIds.push(_)}let c=new tXe;c.index=0,c.primitives=[a];let u=new eXe;u.nodes=[c],u.upAxis=Vo.Z,u.forwardAxis=Vo.X;let f=new JYe;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=yXe(n,d),d.length>0&&xXe(e,a,d,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function xXe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=st.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}b0.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 tN=b0;var TXe=new h,CXe=new h,AXe=new h,EXe=new M,SXe=new M,vXe=new M,wXe=new fe,IXe=new re;function gS(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let d=u[f],p=d.node,_=M.clone(d.computedTransform,EXe),m=M.clone(c.computedModelMatrix,SXe),y=p.instances;l(y)&&y.transformInWorldSpace&&(m=M.multiplyTransformation(e.modelMatrix,c.components.transform,m),_=M.multiplyTransformation(c.axisCorrectionMatrix,d.computedTransform,_));let b=M.multiplyTransformation(m,_,vXe);n.mode!==ne.SCENE3D&&(b=At.basisTo2D(n.mapProjection,b,b));let x=[];if(l(y)){let C=y.attributes[0].count,A=y.attributes[0].componentDatatype,S=12,w=d.transformsTypedArray;if(!l(w)){let R=d.instancingTransformsBuffer;l(R)&&n.context.webgl2&&(w=K.createTypedArray(A,C*S),R.getBufferData(w))}if(l(w))for(let R=0;R<C;R++){let P=R*S,O=new M(w[P],w[P+1],w[P+2],w[P+3],w[P+4],w[P+5],w[P+6],w[P+7],w[P+8],w[P+9],w[P+10],w[P+11],0,0,0,1);y.transformInWorldSpace?(M.multiplyTransformation(O,_,O),M.multiplyTransformation(m,O,O)):M.multiplyTransformation(O,b,O),x.push(O)}}x.length===0&&x.push(b);let T=d.runtimePrimitives.length;for(let C=0;C<T;C++){let A=d.runtimePrimitives[C],S=A.primitive;if(l(A.boundingSphere)&&!l(y)){let W=re.transform(A.boundingSphere,b,IXe),J=ti.raySphere(t,W);if(!l(J))continue}let w=Qt.getAttributeBySemantic(S,mt.POSITION),R=w.byteOffset,P=w.byteStride,O=w.count;if(!l(S.indices))continue;let L=S.indices.typedArray;if(!l(L)){let W=S.indices.buffer,J=S.indices.count,Y=S.indices.indexDatatype;l(W)&&n.context.webgl2&&(Y===ke.UNSIGNED_BYTE?L=new Uint8Array(J):Y===ke.UNSIGNED_SHORT?L=new Uint16Array(J):Y===ke.UNSIGNED_INT&&(L=new Uint32Array(J)),W.getBufferData(L))}let g=w.typedArray,E=w.componentDatatype,v=w.type,I=w.quantization;l(I)&&(E=w.quantization.componentDatatype,v=w.quantization.type);let N=rn.getNumberOfComponents(v),F=K.getSizeInBytes(E),U=!l(g)&&l(P)&&P!==N*F,k=N,z=0;U&&(k=P/F,z=R/F);let B=O*k;if(!l(g)){let W=w.buffer;l(W)&&n.context.webgl2&&(g=K.createTypedArray(E,B),W.getBufferData(g,U?0:R,0,B)),I&&w.normalized&&(g=On.dequantize(g,E,v,O))}if(!l(L)||!l(g))return;r=r??te.default,i=i??1,o=o??0;let j=L.length;for(let W=0;W<j;W+=3){let J=L[W],Y=L[W+1],ee=L[W+2];for(let Q of x){let de=fq(g,J,z,k,I,Q,i,o,r,TXe),ge=fq(g,Y,z,k,I,Q,i,o,r,CXe),le=fq(g,ee,z,k,I,Q,i,o,r,AXe),ye=ti.rayTriangleParametric(t,de,ge,le,e.backFaceCulling??!0);l(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=_n.getPoint(t,a,s),n.mode!==ne.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,d=f.ellipsoid,p=f.unproject(s,wXe);d.cartographicToCartesian(p,s)}return s}}function fq(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=On.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let d=u.x;u.x=u.z,u.z=u.y,u.y=d}}else u=h.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=h.add(u,o.quantizedVolumeOffset,u);return u=M.multiplyByPoint(r,u,u),s!==1&&Or.getPosition(u,c,s,a,u),u}function mo(e){e=e??G.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??br.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=Z.clone(Z.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 AM(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=H.clone(e.color),this._colorBlendMode=e.colorBlendMode??Lc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??H.RED;this._silhouetteColor=H.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Se.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 re,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 Km(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ss.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?vh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Gx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new z_(e.environmentMapOptions);z_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??xn.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===br.GLTF&&bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new _t(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Wr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??H.BLACK,this._classificationType=e.classificationType,this._statistics=new JL,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 me,this._readyEvent=new me,this._texturesReadyEvent=new me,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function dq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function PXe(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 vM({model:e,propertyTable:s});n.push(a)}return n}function DXe(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],u=Qt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function pq(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(mo.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=Rt.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){pq(e,this._color)&&this.resetDrawCommands(),this._color=H.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(!H.equals(e,this._silhouetteColor)){let t=pq(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=H.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 pde(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===br.GLTF&&bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Ss.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(vh.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=h.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&&(z_.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}}});mo.prototype.getNode=function(e){return this._nodesByName[e]};mo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};mo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};mo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};mo.prototype.makeStyleDirty=function(){this._styleDirty=!0};mo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var RXe=new M,OXe=new Z,MXe=new M;mo.prototype.update=function(e){let t=!1;try{t=LXe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")dq(this,n);else{let i=Qt.getError("model",this._resource,n);dq(this,i)}}if(NXe(this,e),FXe(this,e),BXe(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 se("Failed to load model."));dq(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&PXe(this,i);let o=new QL({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(kXe(this),UXe(this),zXe(this,e),VXe(this),HXe(this,e),GXe(this,e),jXe(this,e),WXe(this,e),qXe(this,e),YXe(this,e),XXe(this,e),this._defaultTexture=e.context.defaultTexture,KXe(this,e),$Xe(this,e),ZXe(this),QXe(this,e),nKe(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)),eKe(this),iKe(this,e),oKe(this),rKe(this,e)}};function LXe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function NXe(e,t){l(e._customShader)&&e._customShader.update(t)}function FXe(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 BXe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function kXe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=DXe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function UXe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function zXe(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&&mde(e)}function mde(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Oh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function VXe(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 HXe(e,t){e._silhouetteDirty&&(_de(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function GXe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function jXe(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 WXe(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 qXe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function YXe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function XXe(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 KXe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function $Xe(e,t){M.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix))}var x0=new h,hq=new fe;function ZXe(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??te.default,i=e.modelMatrix;x0.x=i[12],x0.y=i[13],x0.z=i[14];let o=n.cartesianToCartographic(x0);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,hde(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=hde(e,n,o);fe.clone(o,hq),hq.height=r,s(hq)}e._heightDirty=!1,e._updateModelMatrix=!0}function QXe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;pde(e,n),JXe(e,n,t)}function pde(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=re.transform(e._boundingSphere,t,e._boundingSphere)}function JXe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);M.getTranslation(t,x0),e._sceneMode!==ne.SCENE3D&&ji.computeActualEllipsoidPosition(n,x0,x0);let s=e._boundingSphere.radius,a=sKe(x0,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 eKe(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 tKe=new Z(1,0,0,0,0,1,0,-1,0);function nKe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=OXe,s=RXe;if(s=M.multiply(o.uniformState.view3D,i,s),r=M.getRotation(s,r),r=Z.transpose(r,r),e._iblReferenceFrameMatrix=Z.multiply(tKe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=MXe;a=M.multiply(o.uniformState.view3D,i,a),a=M.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function iKe(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 oKe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=_t.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=_t.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=_t.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function rKe(e,t){let n=cKe(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&&(lKe(e,t),e._sceneGraph.pushDrawCommands(t))}var mq=new re;function sKe(e,t,n){return mq.center=e,mq.radius=t,n.camera.getPixelSize(mq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Q4=new h;function hde(e,t,n){return function(i){pE(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,Q4);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=Q4.x,o[13]=Q4.y,o[14]=Q4.z,e._heightDirty=!0}}var aKe=new h;function cKe(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===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=M.getTranslation(e.modelMatrix,aKe);ji.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function lKe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}mo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};mo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function _de(e){return e.context.stencilBuffer}mo.prototype.hasSilhouette=function(e){return _de(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};mo.prototype.hasSkipLevelOfDetail=function(e){if(!br.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};mo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};mo.prototype.pick=function(e,t,n,i,o){return gS(this,e,t,n,i,o)};mo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};mo.prototype.isDestroyed=function(){return!1};mo.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,ce(this)};mo.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};mo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};mo.fromGltfAsync=async function(e){e=e??G.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=Ee.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=Ee.createIfNeeded(t);let r=new Ph(n),a=l(e.content)?br.TILE_GLTF:br.GLTF,c=n.gltfResource,u=nN(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(_){throw r.destroy(),Qt.getError("model",c,_)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new mo(u),p=d._resource.credits;if(l(p)){let _=p.length;for(let m=0;m<_;m++)d._resourceCredits.push(_t.clone(p[m]))}return d};mo.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 gM(t);try{await n.load();let i=nN(n,br.TILE_B3DM,e);return new mo(i)}catch(i){throw n.destroy(),i}};mo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new tN(t);try{await n.load();let i=nN(n,br.TILE_PNTS,e);return new mo(i)}catch(i){throw n.destroy(),i}};mo.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 xM(t);try{await n.load();let i=nN(n,br.TILE_I3DM,e);return new mo(i)}catch(i){throw n.destroy(),i}};mo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new yM(t),i=nN(n,br.TILE_GEOJSON,e);return new mo(i)};var uKe=new H;mo.prototype.applyColorAndShow=function(e){let t=H.clone(this._color,uKe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):H.clone(H.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,pq(t,this._color)&&this.resetDrawCommands()};mo.prototype.applyStyle=function(e){let t=this.type===br.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),mde(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function nN(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Mh=mo;function $r(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($r.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}}});$r.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};$r.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};$r.prototype.getExtension=function(e){return this._model.getExtension(e)};$r.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};$r.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};$r.prototype.applyDebugSettings=function(e,t){t=e?t:H.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};$r.prototype.applyStyle=function(e){this._model.style=e};$r.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:su.REPEAT}),this._ready=!0)};$r.prototype.isDestroyed=function(){return!1};$r.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ce(this)};$r.fromGltf=async function(e,t,n,i){let o=new $r(e,t,n),s=iN(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Mh.fromGltfAsync(s);return o._model=c,o};$r.fromB3dm=async function(e,t,n,i,o){let r=new $r(e,t,n),a=iN(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await Mh.fromB3dm(a);return r._model=u,r};$r.fromI3dm=async function(e,t,n,i,o){let r=new $r(e,t,n),a=iN(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Mh.fromI3dm(a);return r._model=c,r};$r.fromPnts=async function(e,t,n,i,o){let r=new $r(e,t,n),a=iN(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Mh.fromPnts(a);return r._model=c,r};$r.fromGeoJson=async function(e,t,n,i){let o=new $r(e,t,n),s=iN(e,t,o,{geoJson:i,resource:n}),a=await Mh.fromGeoJson(s);return o._model=a,o};$r.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,te.WGS84,n)};function iN(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Se.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return ct(i,o)}var $u=$r;function ud(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(ud.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}}});ud.fromJson=function(e,t,n,i){let o=new ud(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};ud.prototype.hasProperty=function(e,t){return!1};ud.prototype.getFeature=function(e){};ud.prototype.applyDebugSettings=function(e,t){};ud.prototype.applyStyle=function(e){};ud.prototype.update=function(e,t){};ud.prototype.pick=function(e,t,n){};ud.prototype.isDestroyed=function(){return!1};ud.prototype.destroy=function(){return ce(this)};var oN=ud;var rN=`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 sN=`#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 fKe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ms=fKe;function eg(e){this._billboardCollection=e,this._id=void 0,this._loadState=ms.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(eg.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ms.LOADED}},hasImage:{get:function(){return this._loadState!==ms.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});eg.prototype.unload=async function(){this._loadState!==ms.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ms.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};eg.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===ms.LOADING||t.loadState===ms.LOADED){eg.clone(o,this);return}l(o)||(o=new eg(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ms.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=ms.ERROR,o._loadError=c,this._id!==e)return;this._loadState=ms.ERROR,this._loadError=c;return}if(!l(r)||r===-1){if(o._loadState=ms.FAILED,o._index=-1,this._id!==e)return;this._loadState=ms.FAILED,this._index=-1;return}o._index=r,o._loadState=ms.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ms.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};eg.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ms.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=ms.ERROR,this._loadError=o;return}if(!l(n)||n===-1){this._loadState=ms.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=ms.LOADED,this.dirty=!0};eg.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};eg.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 tg=eg;function gi(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Vt.clone(o)),l(r)&&(r=Rt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=V.clone(e.pixelOffset??V.ZERO),this._translate=new V(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??Ke.NONE,this._verticalOrigin=e.verticalOrigin??Fn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Ci.CENTER,this._scale=e.scale??1,this._color=H.clone(e.color??H.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.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 tg(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=Ln()),this._imageTexture.loadImage(a,s)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=H.clone(e.outlineColor??H.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Wr.NONE}var gde=gi.SHOW_INDEX=0,e8=gi.POSITION_INDEX=1,Cde=gi.PIXEL_OFFSET_INDEX=2,dKe=gi.EYE_OFFSET_INDEX=3,hKe=gi.HORIZONTAL_ORIGIN_INDEX=4,mKe=gi.VERTICAL_ORIGIN_INDEX=5,pKe=gi.SCALE_INDEX=6,yde=gi.IMAGE_INDEX_INDEX=7,bde=gi.COLOR_INDEX=8,_Ke=gi.ROTATION_INDEX=9,gKe=gi.ALIGNED_AXIS_INDEX=10,yKe=gi.SCALE_BY_DISTANCE_INDEX=11,bKe=gi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,xKe=gi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,TKe=gi.DISTANCE_DISPLAY_CONDITION=14,CKe=gi.DISABLE_DEPTH_DISTANCE=15;gi.TEXTURE_COORDINATE_BOUNDS=16;var xde=gi.SDF_INDEX=17,AKe=gi.SPLIT_DIRECTION_INDEX=18;gi.NUMBER_OF_PROPERTIES=19;function lr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(gi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,lr(this,gde))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),lr(this,e8))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),lr(this,e8))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;V.equals(t,e)||(V.clone(e,t),lr(this,Cde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Vt.equals(t,e)||(this._scaleByDistance=Vt.clone(e,t),lr(this,yKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Vt.equals(t,e)||(this._translucencyByDistance=Vt.clone(e,t),lr(this,bKe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Vt.equals(t,e)||(this._pixelOffsetScaleByDistance=Vt.clone(e,t),lr(this,xKe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),lr(this,dKe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,lr(this,hKe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,lr(this,mKe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,lr(this,pKe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),lr(this,bde))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,lr(this,_Ke))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),lr(this,gKe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,lr(this,yde))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,lr(this,yde))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,lr(this,bde))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Rt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Rt.clone(e,this._distanceDisplayCondition),lr(this,TKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,lr(this,CKe))}},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 Ee?t=e._url:l(e.src)?t=e.src:t=Ln(),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=h.clone(e,this._actualClampedPosition),lr(this,e8)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,lr(this,gde))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),lr(this,xde))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,lr(this,xde))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,lr(this,AKe))}}});gi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};gi.prototype._updateClamping=function(){gi._updateClamping(this._billboardCollection,this)};var t8=new fe;gi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===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(u){let f=i.cartographicToCartesian(u,t._clampedPosition);pE(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,t8);let c=n.getHeight(s,t._heightReference);l(c)&&(t8.height=c),a(t8)};gi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};gi.prototype.setImage=function(e,t){this._imageTexture.loadImage(e,t)};gi.prototype.setImageTexture=function(e){tg.clone(e,this._imageTexture)};gi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};gi.prototype._setTranslate=function(e){let t=this._translate;V.equals(t,e)||(V.clone(e,t),lr(this,Cde))};gi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};gi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),lr(this,e8)};var Tde=new ie;gi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(M.multiplyByPoint(i,t,Tde),ji.computeActualEllipsoidPosition(n,Tde))};var Ade=new h;gi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,Ade),a=ji.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return V.add(a,i,a),a};var J4=new V(0,0);gi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new V),V.clone(this._pixelOffset,J4),V.add(J4,this._translate,J4);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,t8);o=a.cartographicToCartesian(c,Ade),i=M.IDENTITY}return gi._computeScreenSpacePosition(i,o,this._eyeOffset,J4,e,t)};gi.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===Ci.RIGHT?s-=i:e.horizontalOrigin===Ci.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?a-=o:e.verticalOrigin===Fn.CENTER&&(a-=o*.5),l(n)||(n=new Xe),n.x=s,n.y=a,n.width=i,n.height=o,n};gi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&H.equals(this._color,e._color)&&V.equals(this._pixelOffset,e._pixelOffset)&&V.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};gi.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 po=gi;var EKe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Ro=Object.freeze(EKe);var SKe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ca=Object.freeze(SKe);var vKe=po.SHOW_INDEX,aN=po.POSITION_INDEX,Ede=po.PIXEL_OFFSET_INDEX,Sde=po.EYE_OFFSET_INDEX,wKe=po.HORIZONTAL_ORIGIN_INDEX,IKe=po.VERTICAL_ORIGIN_INDEX,PKe=po.SCALE_INDEX,AT=po.IMAGE_INDEX_INDEX,vde=po.COLOR_INDEX,DKe=po.ROTATION_INDEX,RKe=po.ALIGNED_AXIS_INDEX,wde=po.SCALE_BY_DISTANCE_INDEX,Ide=po.TRANSLUCENCY_BY_DISTANCE_INDEX,Pde=po.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Dde=po.DISTANCE_DISPLAY_CONDITION,OKe=po.DISABLE_DEPTH_DISTANCE,MKe=po.TEXTURE_COORDINATE_BOUNDS,Rde=po.SDF_INDEX,Ode=po.SPLIT_DIRECTION_INDEX,Cq=po.NUMBER_OF_PROPERTIES,_o,LKe={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},NKe={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 dd(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new gx),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(Cq),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Ro.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=H.clone(H.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(dd.prototype,{length:{get:function(){return Aq(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 Mde(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}dd.prototype.add=function(e){let t=new po(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};dd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};dd.prototype.removeAll=function(){Mde(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Aq(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}}dd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};dd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};dd.prototype.get=function(e){return Aq(this),this._billboards[e]};var _q;function FKe(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=st.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function BKe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=st.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function kKe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=st.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}dd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Cq;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function UKe(e,t,n,i,o,r){let s=[{index:_o.positionHighAndScale,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[aN]},{index:_o.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[aN]},{index:_o.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Ede]},{index:_o.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Ide]},{index:_o.compressedAttribute2,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[vde]},{index:_o.eyeOffset,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Sde]},{index:_o.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[wde]},{index:_o.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Pde]},{index:_o.compressedAttribute3,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Dde]},{index:_o.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[MKe]},{index:_o.splitDirection,componentsPerAttribute:1,componentDatatype:K.FLOAT,usage:n[Ode]}];i&&s.push({index:_o.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:kKe(e)}),l(o)&&s.push({index:_o.a_batchId,componentsPerAttribute:1,componentDatatype:K.FLOAT,bufferUsage:Ne.STATIC_DRAW}),r&&s.push({index:_o.sdf,componentsPerAttribute:2,componentDatatype:K.FLOAT,usage:n[Rde]});let a=i?t:4*t;return new l_(e,s,a,i)}var gq=new Gn;function Lde(e,t,n,i){let o,r=n[_o.positionHighAndScale],s=n[_o.positionLowAndRotation],a=i._getActualPosition();e._mode===ne.SCENE3D&&(re.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(a,gq);let c=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let f=gq.high,d=gq.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,c),s(o,d.x,d.y,d.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,c),r(o+1,f.x,f.y,f.z,c),r(o+2,f.x,f.y,f.z,c),r(o+3,f.x,f.y,f.z,c),s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u))}var lu=new V,fd=32768,yS=65536,yq=4096,Qm=256,zKe=128,VKe=32,HKe=8,Nde=4,GKe=1/256,Fde=0,Bde=2,kde=3,Ude=1,Eq=new Xe;function zde(e,t,n,i){let o,r=n[_o.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,u=i._translate,f=u.x,d=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-c+d));let p=i.horizontalOrigin,_=i._verticalOrigin,m=i.show&&i.clusterShow;i.color.alpha===0&&(m=!1),_===Fn.BASELINE&&(_=Fn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===Ci.CENTER,e._allVerticalCenter=e._allVerticalCenter&&_===Fn.CENTER;let y=0,b=0,x=0,T=0;if(i.ready){let N=i.computeTextureCoordinates(Eq);y=N.x,b=N.y,x=N.width,T=N.height}let C=y+x,A=b+T,S=Math.floor(D.clamp(a,-fd,fd)+fd)*zKe;S+=(p+1)*VKe,S+=(_+1)*HKe,S+=(m?1:0)*Nde;let w=Math.floor(D.clamp(c,-fd,fd)+fd)*Qm,R=Math.floor(D.clamp(f,-fd,fd)+fd)*Qm,P=(D.clamp(d,-fd,fd)+fd)*GKe,O=Math.floor(P),L=Math.floor((P-O)*Qm);w+=O,R+=L,lu.x=y,lu.y=b;let g=On.compressTextureCoordinates(lu);lu.x=C;let E=On.compressTextureCoordinates(lu);lu.y=A;let v=On.compressTextureCoordinates(lu);lu.x=y;let I=On.compressTextureCoordinates(lu);e._instanced?(o=i._index,r(o,S,w,R,g)):(o=i._index*4,r(o+0,S+Fde,w,R,g),r(o+1,S+Bde,w,R,E),r(o+2,S+kde,w,R,v),r(o+3,S+Ude,w,R,I))}function Vde(e,t,n,i){let o,r=n[_o.compressedAttribute1],s=i.alignedAxis;h.equals(s,h.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,u=1,f=1,d=i.translucencyByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let _=D.clamp(p,0,yS),m=0;Math.abs(h.magnitudeSquared(s)-1)<D.EPSILON6&&(m=On.octEncodeFloat(s)),c=D.clamp(c,0,1),c=c===1?255:c*255|0,_=_*Qm+c,f=D.clamp(f,0,1),f=f===1?255:f*255|0,m=m*Qm+f,e._instanced?(o=i._index,r(o,_,m,a,u)):(o=i._index*4,r(o+0,_,m,a,u),r(o+1,_,m,a,u),r(o+2,_,m,a,u),r(o+3,_,m,a,u))}function xq(e,t,n,i){let o,r=n[_o.compressedAttribute2],s=i.color,a=l(e._batchTable)?H.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,u=Math.abs(h.magnitudeSquared(i.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let d=i._labelHorizontalOrigin??-2;d+=2;let p=f*Nde+d,_=H.floatToByte(s.red),m=H.floatToByte(s.green),y=H.floatToByte(s.blue),b=_*yS+m*Qm+y;_=H.floatToByte(a.red),m=H.floatToByte(a.green),y=H.floatToByte(a.blue);let x=_*yS+m*Qm+y,T=H.floatToByte(s.alpha)*yS+H.floatToByte(a.alpha)*Qm;T+=c*2+u,e._instanced?(o=i._index,r(o,b,x,T,p)):(o=i._index*4,r(o+0,b,x,T,p),r(o+1,b,x,T,p),r(o+2,b,x,T,p),r(o+3,b,x,T,p))}function Tq(e,t,n,i){let o,r=n[_o.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(lu.x=0,lu.y=0,i.ready){let u=i.computeTextureCoordinates(Eq);lu.x=u.width,lu.y=u.height}let c=On.compressTextureCoordinates(lu);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 Hde(e,t,n,i){let o,r=n[_o.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function Gde(e,t,n,i){let o,r=n[_o.pixelOffsetScaleByDistance],s=0,a=1,c=1,u=1,f=i.pixelOffsetScaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function jde(e,t,n,i){let o,r=n[_o.compressedAttribute3],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance,f=Zf(i.heightReference)&&t.context.depthTexture;l(u)||(u=f?5e3:0),u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d,p;l(i._labelDimensions)?(p=i._labelDimensions.x,d=i._labelDimensions.y):(p=i.width??0,d=i.height??0);let _=Math.floor(D.clamp(p,0,yq)),m=Math.floor(D.clamp(d,0,yq)),y=_*yq+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function Wde(e,t,n,i){if(Zf(i.heightReference)){let p=e._scene,_=t.context,m=t.globeTranslucencyState.translucent,y=l(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=_.depthTexture&&!m&&y}let o,r=n[_o.textureCoordinateBoundsOrLabelTranslate];if(Lt.maximumVertexTextureImageUnits>0){let p=0,_=0;l(i._labelTranslate)&&(p=i._labelTranslate.x,_=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,_,0,0)):(o=i._index*4,r(o+0,p,_,0,0),r(o+1,p,_,0,0),r(o+2,p,_,0,0),r(o+3,p,_,0,0));return}let s=0,a=0,c=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(Eq);s=p.x,a=p.y,c=p.width,u=p.height}let f=s+c,d=a+u;e._instanced?(o=i._index,r(o,s,a,f,d)):(o=i._index*4,r(o+0,s,a,f,d),r(o+1,s,a,f,d),r(o+2,s,a,f,d),r(o+3,s,a,f,d))}function jKe(e,t,n,i){if(!l(e._batchTable))return;let o=n[_o.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 qde(e,t,n,i){if(!e._sdf)return;let o,r=n[_o.sdf],s=i.outlineColor,a=i.outlineWidth,c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue),d=c*yS+u*Qm+f,p=a/ca.RADIUS,_=H.floatToByte(s.alpha)*yS+H.floatToByte(p)*Qm;e._instanced?(o=i._index,r(o,d,_)):(o=i._index*4,r(o+0,d+Fde,_),r(o+1,d+Bde,_),r(o+2,d+kde,_),r(o+3,d+Ude,_))}function Yde(e,t,n,i){let o=n[_o.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 WKe(e,t,n,i){Lde(e,t,n,i),zde(e,t,n,i),Vde(e,t,n,i),xq(e,t,n,i),Tq(e,t,n,i),Hde(e,t,n,i),Gde(e,t,n,i),jde(e,t,n,i),Wde(e,t,n,i),jKe(e,t,n,i),qde(e,t,n,i),Yde(e,t,n,i)}function bq(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=po._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):re.expand(s,d,s))}r&&re.fromPoints(a,s)}function qKe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&bq(e,i,i.length,t,r,!0)):n===ne.MORPHING?bq(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&bq(e,o,e._billboardsToUpdateIndex,t,r,!1)}function YKe(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 XKe(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=Se.OVERLAY,i}var KKe=[];dd.prototype.update=function(e){if(Aq(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,_o=this._instanced?NKe:LKe,_q=this._instanced?BKe:FKe;let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let O=n[P];l(O.loadError)&&(console.error(`Error loading image for billboard: ${O.loadError}`),O.image=void 0),O.textureDirty&&this._updateBillboard(O,AT),O.show&&(o=o&&O.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;qKe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,_=p.pick;if(f||!_&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Cq;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=UKe(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let P=0;P<i;++P){let O=this._billboards[P];O._dirty=!1,O.textureDirty=!1,WKe(this,e,d,O)}this._vaf.commit(_q(t))}this._billboardsToUpdateIndex=0}else if(a>0){let P=KKe;P.length=0,(c[aN]||c[DKe]||c[PKe])&&P.push(Lde),(c[AT]||c[Ede]||c[wKe]||c[IKe]||c[vKe])&&(P.push(zde),this._instanced&&P.push(Tq)),(c[AT]||c[RKe]||c[Ide])&&(P.push(Vde),P.push(xq)),(c[AT]||c[vde])&&P.push(xq),(c[AT]||c[Sde])&&P.push(Tq),c[wde]&&P.push(Hde),c[Pde]&&P.push(Gde),(c[Dde]||c[OKe]||c[AT]||c[aN])&&P.push(jde),(c[AT]||c[aN])&&P.push(Wde),c[Rde]&&P.push(qde),c[Ode]&&P.push(Yde);let O=P.length;if(d=this._vaf.writers,a/i>.1){for(let L=0;L<a;++L){let g=s[L];g._dirty=!1,g.textureDirty=!1;for(let E=0;E<O;++E)P[E](this,e,d,g)}this._vaf.commit(_q(t))}else{for(let L=0;L<a;++L){let g=s[L];g._dirty=!1,g.textureDirty=!1;for(let E=0;E<O;++E)P[E](this,e,d,g);this._instanced?this._vaf.subCommit(g._index,1):this._vaf.subCommit(g._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,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=M.IDENTITY;e.mode===ne.SCENE3D?(y=this.modelMatrix,m=re.clone(this._baseVolumeWC,this._boundingVolume)):m=re.clone(this._baseVolume2D,this._boundingVolume),YKe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Ro.OPAQUE||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:q.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Ro.TRANSLUCENT;this._blendOption===Ro.TRANSLUCENT||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:P?q.LEQUAL:q.LESS},depthMask:P,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,T,C,A,S,w=Lt.maximumVertexTextureImageUnits>0;if(b||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){x=sN,T=rN,S=[],l(this._batchTable)&&(S.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),C=new Be({defines:S,sources:[x]}),this._instanced&&C.defines.push("INSTANCED"),this._shaderRotation&&C.defines.push("ROTATION"),this._shaderAlignedAxis&&C.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&C.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&C.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&C.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&C.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&C.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(w?C.defines.push("VERTEX_DEPTH_CHECK"):C.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-ca.CUTOFF;this._sdf&&C.defines.push("SDF");let O=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT&&(A=new Be({defines:["OPAQUE",O],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${P}`)),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:_o}),A=new Be({defines:["TRANSLUCENT",O],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=Xt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:_o})),this._blendOption===Ro.OPAQUE&&(A=new Be({defines:[O],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${P}`)),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:_o})),this._blendOption===Ro.TRANSLUCENT&&(A=new Be({defines:[O],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=Xt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:_o})),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 R=e.commandList;if(p.render||p.pick){let P=this._colorCommands,O=this._blendOption===Ro.OPAQUE,L=this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT,g=this._vaf.va,E=g.length,v=this._uniforms,I;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),I=this._batchTable.getPickId()):I="v_pickColor",P.length=E;let N=L?E*2:E;for(let F=0;F<N;++F){let U=P[F];l(U)||(U=P[F]=new qe);let k=O||L&&F%2===0;U.pass=k||!L?Se.OPAQUE:Se.TRANSLUCENT,U.owner=this;let z=L?Math.floor(F/2):F;U.boundingVolume=m,U.modelMatrix=y,U.count=g[z].indicesCount,U.shaderProgram=k?this._sp:this._spTranslucent,U.uniformMap=v,U.vertexArray=g[z].va,U.renderState=k?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=I,this._instanced&&(U.count=6,U.instanceCount=i),R.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=XKe(this,e.context)),R.push(this.debugCommand))}this._allBillboardsReady=o};dd.prototype.isDestroyed=function(){return!1};dd.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(),Mde(this._billboards),ce(this)};var Zu=dd;function $Ke(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 ET=$Ke;function Ra(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),bS(this)}var ZKe=new fe;Object.defineProperties(Ra.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=H.clone(e,this._color),bS(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,bS(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=H.clone(e,this._pointOutlineColor),bS(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,bS(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,ZKe);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=H.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&&bS(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}}});Ra.defaultColor=H.WHITE;Ra.defaultPointOutlineColor=H.BLACK;Ra.defaultPointOutlineWidth=0;Ra.defaultPointSize=8;function bS(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??Ra.defaultColor,i=e._pointOutlineColor??Ra.defaultPointOutlineColor,o=e._pointOutlineWidth??Ra.defaultPointOutlineWidth,r=e._pointSize??Ra.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(H.equals(n,s)&&H.equals(i,a)&&o===c&&r===u)return;e._billboardColor=H.clone(n,e._billboardColor),e._billboardOutlineColor=H.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),_=JSON.stringify([d,r,p,o]);t.setImage(_,ET(f,d,p,o,r))}Ra.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Ra.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Ra.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Ra.prototype.getPropertyInherited=function(e){return oa.getPropertyInherited(this._content,this._batchId,e)};Ra.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Ra.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Ra.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Ra.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ng=Ra;function QKe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let _=c.getContext("2d");_.font=n,_.fillStyle="white",_.fillRect(0,0,c.width+1,c.height+1),i&&(_.strokeStyle="black",_.lineWidth=e.lineWidth,_.strokeText(t,u/2,p)),o&&(_.fillStyle="black",_.fillText(t,u/2,p));let m=_.getImageData(0,0,f,d).data,y=m.length,b=f*4,x,T,C,A;for(x=0;x<y;++x)if(m[x]!==255){C=x/b|0;break}for(x=y-1;x>=0;--x)if(m[x]!==255){A=x/b|0;break}let S=-1;for(x=0;x<f&&S===-1;++x)for(T=0;T<d;++T){let w=x*4+T*b;if(m[w]!==255||m[w+1]!==255||m[w+2]!==255||m[w+3]!==255){S=x;break}}return{width:r.width,height:A-C,ascent:p-C,descent:A-p,minx:S-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var ST;function JKe(e,t){if(e==="")return;t=t??G.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??H.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(ST)||(l(f.imageSmoothingEnabled)?ST="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?ST="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?ST="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(ST="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[ST]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=QKe(f,e,n,i,o);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,_=Math.ceil(d.width)+p+c,m=d.height+c,y=m-d.ascent+a,b=m-y+c;if(u.width=_,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[ST]=!1,s!==H.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let x=t.strokeColor??H.BLACK;f.strokeStyle=x.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let x=t.fillColor??H.WHITE;f.fillStyle=x.toCssColorString(),f.fillText(e,p+a,b)}return u}var vT=JKe;var rhe=er(Zde(),1);var t$e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},$o=Object.freeze(t$e);var Qde={},Jde=0,n$e=256,i$e=new H(.165,.165,.165,.8),o$e=new V(7,5),vs=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function wT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function lN(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function uN(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function the(e){let t=Qde[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(uN(n,"line-height"));isNaN(i)&&(i=void 0),t={family:uN(n,"font-family"),size:uN(n,"font-size").replace("px",""),style:uN(n,"font-style"),weight:uN(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Jde<n$e&&(Qde[e._font]=t,Jde++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Lh(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Vt.clone(o)),l(r)&&(r=Rt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=H.clone(e.fillColor??H.WHITE),this._outlineColor=H.clone(e.outlineColor??H.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=H.clone(e.backgroundColor??i$e),this._backgroundPadding=V.clone(e.backgroundPadding??o$e),this._style=e.style??$o.FILL,this._verticalOrigin=e.verticalOrigin??Fn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Ci.LEFT,this._pixelOffset=V.clone(e.pixelOffset??V.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.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,the(this),this._updateClamping()}Object.defineProperties(Lh.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(!h.equals(t,e)){h.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),lN(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Lh.filterUnsupportedCharacters(e);this._renderedText=Lh.enableRightToLeftDetection?u$e(t):t,wT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,wT(this),the(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;H.equals(t,e)||(H.clone(e,t),wT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),wT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,wT(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!H.equals(t,e)){H.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;V.equals(t,e)||(V.clone(e,t),lN(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,wT(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!V.equals(t,e)){V.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(!Vt.equals(t,e)){this._translucencyByDistance=Vt.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(!Vt.equals(t,e)){this._pixelOffsetScaleByDistance=Vt.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(!Vt.equals(t,e)){this._scaleByDistance=Vt.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(!h.equals(t,e)){h.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,lN(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),lN(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),lN(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Rt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Rt.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=h.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)}}}});Lh.prototype._updateClamping=function(){po._updateClamping(this._labelCollection,this)};Lh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new V);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return po._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Lh.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===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?o-=s:e.verticalOrigin===Fn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let _=0;_<p;++_){let m=d[_],y=m.billboard;if(!l(y))continue;let b=t.x+y._translate.x,x=t.y-y._translate.y,T=m.dimensions.width*a,C=m.dimensions.height*a;e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?x-=C:e.verticalOrigin===Fn.CENTER&&(x-=C*.5),e._verticalOrigin===Fn.TOP?x+=ca.PADDING*a:(e._verticalOrigin===Fn.BOTTOM||e._verticalOrigin===Fn.BASELINE)&&(x-=ca.PADDING*a),i=Math.min(i,b),o=Math.min(o,x),u=Math.max(u,b+T),f=Math.max(f,x+C)}r=u-i,s=f-o}return l(n)||(n=new Xe),n.x=i,n.y=o,n.width=r,n.height=s,n};Lh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Lh.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&&h.equals(this._position,e._position)&&H.equals(this._fillColor,e._fillColor)&&H.equals(this._outlineColor,e._outlineColor)&&H.equals(this._backgroundColor,e._backgroundColor)&&V.equals(this._backgroundPadding,e._backgroundPadding)&&V.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Lh.prototype.isDestroyed=function(){return!1};Lh.enableRightToLeftDetection=!1;function r$e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=vs.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=vs.RTL:n.test(f)?a=vs.LTR:i.test(f)?a=vs.BRACKETS:a=vs.WEAK,u===0&&(s=a),s===a&&a!==vs.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function s$e(e){return e.split("").reverse().join("")}function fN(e,t,n){return e.slice(0,t)+n+e.slice(t)}function a$e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var c$e="\u05D0-\u05EA",l$e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",ehe=new RegExp(`[${c$e}${l$e}]`);function u$e(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=ehe.test(o.charAt(0)),s=r$e(o,ehe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===vs.BRACKETS?a$e(f.Word):s$e(f.Word);r?f.Type===vs.RTL?(c=d+c,a=0):f.Type===vs.LTR?(c=fN(c,a,f.Word),a+=f.Word.length):(f.Type===vs.WEAK||f.Type===vs.BRACKETS)&&(f.Type===vs.WEAK&&s[u-1].Type===vs.BRACKETS?c=d+c:s[u-1].Type===vs.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===vs.RTL?(c=d+c,a=0):(c=fN(c,a,f.Word),a+=f.Word.length):c=fN(c,0,d)):f.Type===vs.RTL?c=fN(c,a,d):f.Type===vs.LTR?(c+=f.Word,a=c.length):(f.Type===vs.WEAK||f.Type===vs.BRACKETS)&&(u>0&&s[u-1].Type===vs.RTL?s.length>u+1?s[u+1].Type===vs.RTL?c=fN(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var T0=Lh;var she=er(nhe(),1);function d$e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var h$e=1.2,ihe="ID_WHITE_PIXEL",Sq=new V(4,4),m$e=new Xe(1,1,1,1);function p$e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=Sq.x,o.height=Sq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(ihe,o),n.addImageSubRegion(ihe,m$e)}let i=e.add({collection:t});return i.setImageTexture(n),i}var ig={};function _$e(e,t,n,i,o,r){return ig.font=t,ig.fillColor=n,ig.strokeColor=i,ig.strokeWidth=o,ig.padding=ca.PADDING,ig.fill=r===$o.FILL||r===$o.FILL_AND_OUTLINE,ig.stroke=r===$o.OUTLINE||r===$o.FILL_AND_OUTLINE,ig.backgroundColor=H.BLACK,vT(e,ig)}function vq(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 g$e=new she.default,y$e=/\s/;function b$e(e,t){let n=t._renderedText,i=g$e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/ca.FONT_SIZE,o<s)for(let _=o;_<s;++_)vq(e,r[_]);r.length=o;let a=t.show&&t._showBackground&&n.split(` -`).join("").length>0,c=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(l(c)||(c=p$e(u,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=Ci.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)&&(u.remove(c),t._backgroundBillboard=c=void 0);let f=e._glyphBillboardCollection,d=f.billboardTextureCache,p=e._textDimensionsCache;for(let _=0;_<o;++_){let m=i[_],y=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+y]),x=p[b],T=d.get(b);if(!l(T)||!l(x)){T=new tg(f),d.set(b,T);let w=`${t._fontStyle} ${t._fontWeight} ${ca.FONT_SIZE}px ${t._fontFamily}`,R=_$e(m,w,H.WHITE,H.WHITE,0,$o.FILL);if(x=R.dimensions,p[b]=x,R.width>0&&R.height>0&&!y$e.test(m)){let P=(0,rhe.default)(R,{cutoff:ca.CUTOFF,radius:ca.RADIUS}),O=R.getContext("2d"),L=R.width,g=R.height,E=O.getImageData(0,0,L,g);for(let v=0;v<L;v++)for(let I=0;I<g;I++){let N=I*L+v,F=P[N]*255,U=N*4;E.data[U+0]=F,E.data[U+1]=F,E.data[U+2]=F,E.data[U+3]=F}O.putImageData(E,0,0),T.loadImage(b,R)}}let C=r[_];if(l(C)||(C=new d$e,C.dimensions=x,C.billboardTexture=T,r[_]=C),C.billboardTexture.id!==b&&(C.billboardTexture=T,C.dimensions=x),!T.hasImage){vq(e,C);continue}let A=C.billboard,S=e._spareBillboards;l(A)||(S.length>0?A=S.pop():(A=f.add({collection:e}),A._labelDimensions=new V,A._labelTranslate=new V),C.billboard=A),A.setImageTexture(T),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=Ci.LEFT,A.verticalOrigin=t._verticalOrigin,A.heightReference=t._heightReference,A.scale=t.totalScale,A.pickPrimitive=t,A.id=t._id,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,A.scaleByDistance=t._scaleByDistance,A.distanceDisplayCondition=t._distanceDisplayCondition,A.disableDepthTestDistance=t._disableDepthTestDistance,A._batchIndex=t._batchIndex,A.outlineColor=t.outlineColor,t.style===$o.FILL_AND_OUTLINE?(A.color=t._fillColor,A.outlineWidth=t.outlineWidth):t.style===$o.FILL?(A.color=t._fillColor,A.outlineWidth=0):t.style===$o.OUTLINE&&(A.color=H.TRANSPARENT,A.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function ohe(e,t,n){return t===Ci.CENTER?-e/2:t===Ci.RIGHT?-(e+n.x):n.x}var xr=new V,x$e=new V;function T$e(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=V.clone(l(f)?e._backgroundPadding:V.ZERO,x$e);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){r.push(i),++c,i=0;continue}let g=t[O].dimensions;l(g)&&(a=Math.max(a,g.height-g.descent),s=Math.max(s,g.descent),i+=g.width-g.minx,O<u-1&&(i+=t[O+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,_=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,b=0,x=r[b],T=ohe(x,m,d),C=(l(e._lineHeight)?e._lineHeight:h$e*e._fontSize)/e._relativeSize,A=C*(c-1),S=o,w=p+A;l(f)&&(S+=d.x*2,w+=d.y*2,f._labelHorizontalOrigin=m),xr.x=T*_,xr.y=0;let R=!0,P=0;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){++b,P+=C,x=r[b],T=ohe(x,m,d),xr.x=T*_,R=!0;continue}let L=t[O],g=L.dimensions;if(l(g)&&(y===Fn.TOP?(xr.y=g.height-a-d.y,xr.y+=ca.PADDING):y===Fn.CENTER?xr.y=(A+g.height-a)/2:y===Fn.BASELINE?(xr.y=A,xr.y-=ca.PADDING):(xr.y=A+s+d.y,xr.y-=ca.PADDING),xr.y=(xr.y-g.descent-P)*_,R&&(xr.x-=ca.PADDING*_,R=!1),l(L.billboard)&&(L.billboard._setTranslate(xr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=w,L.billboard._labelHorizontalOrigin=m),O<u-1)){let E=t[O+1];xr.x+=(g.width-g.minx+E.dimensions.minx)*_}}if(l(f)&&n.split(` -`).join("").length>0&&(m===Ci.CENTER?T=-o/2-d.x:m===Ci.RIGHT?T=-(o+d.x*2):T=0,xr.x=T*_,y===Fn.TOP?xr.y=p-a-s:y===Fn.CENTER?xr.y=(p-a)/2-s:y===Fn.BASELINE?xr.y=-d.y-s:xr.y=0,xr.y=xr.y*_,f.width=S,f.height=w,f._setTranslate(xr),f._labelTranslate=V.clone(xr,f._labelTranslate)),Zf(e.heightReference))for(let O=0;O<u;++O){let g=t[O].billboard;l(g)&&(g._labelTranslate=V.clone(xr,g._labelTranslate))}}function ahe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)vq(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ce(t)}function Jm(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Zu({scene:this._scene,textureAtlas:new gx({initialSize:Sq})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new tg(t),this._glyphBillboardCollection=new Zu({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=H.clone(H.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Ro.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Jm.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}}});Jm.prototype.add=function(e){let t=new T0(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Jm.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),ahe(this,e),!0}return!1};Jm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)ahe(this,e[t]);e.length=0};Jm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Jm.prototype.get=function(e){return this._labels[e]};Jm.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&&(b$e(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(T$e(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Ro.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)};Jm.prototype.isDestroyed=function(){return!1};Jm.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ce(this)};var ep=Jm;var dN=`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 vl={};vl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};vl.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 C$e=new fe;vl.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,C$e).height}return i};var A$e=new M,E$e=new h,che=new h,S$e=new en(h.UNIT_X,0),lhe=new h,v$e=new en(h.UNIT_X,0),w$e=new h,I$e=new h,Iq=[];function fhe(e,t,n){let i=Iq;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 o8=new fe,i8=new fe,C0=new h,Pq=new h,P$e=new h,wq=new m_,hN=new Qa;function D$e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Pq),u=i.scaleToGeodeticSurface(t,P$e),f=vl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,o8),p=i.cartesianToCartographic(u,i8),_=fhe(f,o,r);wq.setEndPoints(d,p);let m=wq.surfaceDistance/f,y=a;d.height=o;let b=i.cartographicToCartesian(d,C0);h.pack(b,s,y),y+=3;for(let x=1;x<f;x++){let T=wq.interpolateUsingSurfaceDistance(x*m,i8);T.height=_[x],b=i.cartographicToCartesian(T,C0),h.pack(b,s,y),y+=3}return y}function R$e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,o8),u=i.cartesianToCartographic(t,i8),f=vl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=fhe(f,o,r);hN.ellipsoid.equals(i)||(hN=new Qa(void 0,void 0,i)),hN.setEndPoints(c,u);let p=hN.surfaceDistance/f,_=a;c.height=o;let m=i.cartographicToCartesian(c,C0);h.pack(m,s,_),_+=3;for(let y=1;y<f;y++){let b=hN.interpolateUsingSurfaceDistance(y*p,i8);b.height=d[y],m=i.cartographicToCartesian(b,C0),h.pack(m,s,_),_+=3}return _}vl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let o=M.inverseTransformation(t,A$e),r=M.multiplyByPoint(o,h.ZERO,E$e),s=h.normalize(M.multiplyByPointAsVector(o,h.UNIT_Y,che),che),a=en.fromPointNormal(r,s,S$e),c=h.normalize(M.multiplyByPointAsVector(o,h.UNIT_X,lhe),lhe),u=en.fromPointNormal(r,c,v$e),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let _=1;_<p;++_){let m=e[_];if(en.getPointDistance(u,d)<0||en.getPointDistance(u,m)<0){let y=ti.lineSegmentPlane(d,m,a,w$e);if(l(y)){let b=h.multiplyByScalar(s,5e-9,I$e);en.getPointDistance(a,d)<0&&h.negate(b,b),n.push(h.add(y,b,new h)),i.push(f+1),h.negate(b,b),n.push(h.add(y,b,new h)),f=1}}n.push(h.clone(e[_])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};vl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],Pq);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(y,C0);h.multiplyByScalar(b,o,b),h.add(y,b,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??D.RADIANS_PER_DEGREE;s=D.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=vl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],b=t[c+1],x=r?o[c]:o,T=r?o[c+1]:o;d=D$e(y,b,s,i,x,T,f,d)}Iq.length=0;let p=t[n-1],_=i.cartesianToCartographic(p,o8);_.height=r?o[n-1]:o;let m=i.cartographicToCartesian(_,C0);return h.pack(m,f,u-3),f};var uhe=new fe,O$e=new fe;vl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],Pq);if(o=r?o[0]:o,o!==0){let T=i.geodeticSurfaceNormal(x,C0);h.multiplyByScalar(T,o,T),h.add(x,T,x)}return[x.x,x.y,x.z]}let s=e.granularity??D.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],uhe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],O$e),a+=vl.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,uhe);let d=(a+1)*3,p=new Array(d),_=0;for(c=0;c<n-1;c++){let x=t[c],T=t[c+1],C=r?o[c]:o,A=r?o[c+1]:o;_=R$e(x,T,s,i,C,A,p,_)}Iq.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,o8);y.height=r?o[n-1]:o;let b=i.cartographicToCartesian(y,C0);return h.pack(b,p,d-3),p};vl.generateCartesianArc=function(e){let t=vl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};vl.generateCartesianRhumbArc=function(e){let t=vl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Fi=vl;function Qu(e,t){e=e??G.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=$i.fromType($i.ColorType,{color:new H(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=So(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Fi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(hhe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=re.fromPoints(this._actualPositions),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new re}var dhe=Qu.POSITION_INDEX=0,M$e=Qu.SHOW_INDEX=1,L$e=Qu.WIDTH_INDEX=2,N$e=Qu.MATERIAL_INDEX=3,mN=Qu.POSITION_SIZE_INDEX=4,F$e=Qu.DISTANCE_DISPLAY_CONDITION=5,hhe=Qu.NUMBER_OF_PROPERTIES=6;function og(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Qu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,og(this,M$e))}},positions:{get:function(){return this._positions},set:function(e){let t=So(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&og(this,mN),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=re.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),og(this,dhe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,og(this,N$e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,og(this,L$e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,og(this,mN)}}},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){Rt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Rt.clone(e,this._distanceDisplayCondition),og(this,F$e))}}});Qu.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[dhe]>0||this._propertiesChanged[mN]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Fi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=re.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)og(this,mN);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){og(this,mN);break}}};Qu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Qu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<hhe-1;++t)e[t]=0};Qu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var hd=Qu;var B$e=hd.SHOW_INDEX,k$e=hd.WIDTH_INDEX,Rq=hd.POSITION_INDEX,U$e=hd.MATERIAL_INDEX,mhe=hd.POSITION_SIZE_INDEX,z$e=hd.DISTANCE_DISPLAY_CONDITION,The=hd.NUMBER_OF_PROPERTIES,uu={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 Nh(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(The),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=H.clone(H.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Nh.prototype,{length:{get:function(){return Oq(this),this._polylines.length}}});Nh.prototype.add=function(e){let t=new hd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Nh.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};Nh.prototype.removeAll=function(){Mq(this),vhe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Nh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Nh.prototype.get=function(e){return Oq(this),this._polylines[e]};function V$e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:K.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:K.FLOAT,componentsPerAttribute:2}];e._batchTable=new Cx(t,n,e._polylines.length)}var Che=new Gn,Ahe=new ie,Ehe=new V;Nh.prototype.update=function(e){if(Oq(this),this._polylines.length===0||!this.show)return;Y$e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Lt.maximumVertexTextureImageUnits===0)throw new se("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");V$e(this,t),this._createBatchTable=!1}if(this._createVertexArray||G$e(this))ghe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[mhe]||o[U$e])ghe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,_=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[Rq]&&p.writeUpdate(_,i,this._positionBuffer,n);break}_+=f[m].lengthOfPositions}if((o[B$e]||o[k$e])&&this._batchTable.setBatchedAttribute(i._index,0,new V(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Rq]||o[mhe]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Gn.fromCartesian(m.center,Che),b=ie.fromElements(y.low.x,y.low.y,y.low.z,m.radius,Ahe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[z$e]){let m=Ehe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<The;++c)o[c]=0;let r=M.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;H$e(this,e,c,r)}};var pN=new re,phe=new re;function H$e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),_=u.length;for(let m=0;m<_;++m){let y=u[m],b=y.buckets,x=b.length;for(let T=0;T<x;++T){let C=b[T],A=C.offset,S=C.bucket.shaderProgram,w=C.bucket.polylines,R=w.length,P,O,L=0,g,E;for(let v=0;v<R;++v){let I=w[v],N=W$e(I._material);if(N!==P){if(l(P)&&L>0){let z=O.isTranslucent();a>=s?(g=new qe({owner:e}),n.push(g)):g=n[a],++a,E=ct(p(O._uniforms),e._uniformMap),g.boundingVolume=re.clone(pN,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=y.va,g.renderState=z?e._translucentRS:e._opaqueRS,g.pass=z?Se.TRANSLUCENT:Se.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=A,A+=L,L=0,c=!0,r.push(g)}O=I._material,O.update(o),P=N}let F=I._locatorBuckets,U=F.length;for(let z=0;z<U;++z){let B=F[z];B.locator===C&&(L+=B.count)}let k;t.mode===ne.SCENE3D?k=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(k=re.clone(I._boundingVolume2D,phe),k.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(k=re.union(I._boundingVolumeWC,I._boundingVolume2D,phe)),c?(c=!1,re.clone(k,pN)):re.union(k,pN,pN)}l(P)&&L>0&&(a>=s?(g=new qe({owner:e}),n.push(g)):g=n[a],++a,E=ct(p(O._uniforms),e._uniformMap),g.boundingVolume=re.clone(pN,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=y.va,g.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=O.isTranslucent()?Se.TRANSLUCENT:Se.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=A,c=!0,r.push(g)),P=void 0}}n.length=a}Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){return She(this),Mq(this),vhe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ce(this)};function G$e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Rq]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var _he=[0,0,0];function ghe(e,t,n){e._createVertexArray=!1,Mq(e),She(e),q$e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,_;for(p in d)d.hasOwnProperty(p)&&(_=d[p],_.updateShader(t,r,s),f+=_.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),b=new Float32Array(f*4),x,T=0,C=0,A=0;for(p in d)if(d.hasOwnProperty(p)){_=d[p],_.write(y,b,T,C,A,r,t,n),m===ne.MORPHING&&(l(x)||(x=new Float32Array(6*f*3)),_.writeForMorph(x,T));let E=_.lengthOfPositions;T+=6*E*3,C+=E*4,A+=E*4,c=_.updateIndices(i,a,u,c)}let S=e._positionBufferUsage.bufferUsage,w=Ne.STATIC_DRAW;e._positionBuffer=st.createVertexBuffer({context:t,typedArray:y,usage:S});let R;l(x)&&(R=st.createVertexBuffer({context:t,typedArray:x,usage:S})),e._texCoordExpandAndBatchIndexBuffer=st.createVertexBuffer({context:t,typedArray:b,usage:w});let P=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let E=0;E<g;++E)if(o=i[E],o.length>0){let v=new Uint16Array(o),I=st.createIndexBuffer({context:t,typedArray:v,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});L+=a[E];let N=6*(E*(P*D.SIXTY_FOUR_KILOBYTES)-L*P),F=P+N,U=P+F,k=P+U,z=P+k,B=P+z,j=E*(O*D.SIXTY_FOUR_KILOBYTES)-L*O,W=[{index:uu.position3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:uu.position3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:uu.position2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:uu.position2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:uu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:uu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:uu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:uu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:uu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:z,strideInBytes:6*P},{index:uu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:uu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:z,strideInBytes:6*P},{index:uu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:uu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:K.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:j}],J,Y,ee,Q;m===ne.SCENE3D?(Y=e._positionBuffer,J="vertexBuffer",ee=_he,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(Y=_he,J="value",ee=e._positionBuffer,Q="vertexBuffer"):(Y=R,J="vertexBuffer",ee=e._positionBuffer,Q="vertexBuffer"),W[0][J]=Y,W[1][J]=Y,W[2][Q]=ee,W[3][Q]=ee,W[4][J]=Y,W[5][J]=Y,W[6][Q]=ee,W[7][Q]=ee,W[8][J]=Y,W[9][J]=Y,W[10][Q]=ee,W[11][Q]=ee;let de=new qn({context:t,attributes:W,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[E]})}}}function j$e(e,t){return t instanceof dt?t.id:t}var r8=[];function W$e(e){let t=$i._uniformList[e.type],n=t.length;r8.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];r8[i]=r,r8[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(r8,j$e)}`}function q$e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new tp(c,t,n)),u.addPolyline(a)}}}function Y$e(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function Oq(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 Mq(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 She(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Nh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function vhe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Dq(e,t,n){this.count=e,this.offset=t,this.bucket=n}function tp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}tp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};tp.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"),Nt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Be({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,Ix]}),r=t.getVertexShaderCallback()(dN),s=new Be({defines:i,sources:[zu,r]});this.shaderProgram=Xt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:uu})};function whe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(en.ORIGIN_ZX_PLANE)===Ht.INTERSECTING}tp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!whe(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 Bs=new h,md=new h,pd=new h,s8=new h,X$e=new ie,K$e=new V;tp.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let _=f[p],m=_.width,y=_.show&&m>0,b=_._index,x=this.getSegments(_,a),T=x.positions,C=x.lengths,A=T.length,S=_.getPickId(s).color,w=0,R=0,P;for(let U=0;U<A;++U){U===0?_._loop?P=T[A-2]:(P=s8,h.subtract(T[0],T[1],P),h.add(T[0],P,P)):P=T[U-1],h.clone(P,md),h.clone(T[U],Bs),U===A-1?_._loop?P=T[1]:(P=s8,h.subtract(T[A-1],T[A-2],P),h.add(T[A-1],P,P)):P=T[U+1],h.clone(P,pd);let k=C[w];U===R+k&&(R+=k,++w);let z=U-R===0,B=U===R+C[w]-1;c===ne.SCENE2D&&(md.z=0,Bs.z=0,pd.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(z||B)&&u-Math.abs(Bs.x)<1&&((Bs.x<0&&md.x>0||Bs.x>0&&md.x<0)&&h.clone(Bs,md),(Bs.x<0&&pd.x>0||Bs.x>0&&pd.x<0)&&h.clone(Bs,pd));let j=z?2:0,W=B?2:4;for(let J=j;J<W;++J){Gn.writeElements(Bs,e,n),Gn.writeElements(md,e,n+6),Gn.writeElements(pd,e,n+12);let Y=J-2<0?-1:1;t[o]=U/(A-1),t[o+1]=2*(J%2)-1,t[o+2]=Y,t[o+3]=b,n+=6*3,o+=4}}let O=X$e;O.x=H.floatToByte(S.red),O.y=H.floatToByte(S.green),O.z=H.floatToByte(S.blue),O.w=H.floatToByte(S.alpha);let L=K$e;L.x=m,L.y=y?1:0;let g=c===ne.SCENE2D?_._boundingVolume2D:_._boundingVolumeWC,E=Gn.fromCartesian(g.center,Che),v=E.high,I=ie.fromElements(E.low.x,E.low.y,E.low.z,g.radius,Ahe),N=Ehe;N.x=0,N.y=Number.MAX_VALUE;let F=_.distanceDisplayCondition;l(F)&&(N.x=F.near,N.y=F.far),r.setBatchedAttribute(b,0,L),r.setBatchedAttribute(b,1,O),r.attributes.length>2&&(r.setBatchedAttribute(b,2,v),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var $$e=new h,Z$e=new h,Q$e=new h,yhe=new h;tp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let _;p===0?s._loop?_=a[u-2]:(_=yhe,h.subtract(a[0],a[1],_),h.add(a[0],_,_)):_=a[p-1],_=M.multiplyByPoint(n,_,Z$e);let m=M.multiplyByPoint(n,a[p],$$e),y;p===u-1?s._loop?y=a[1]:(y=yhe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=M.multiplyByPoint(n,y,Q$e);let b=c[f];p===d+b&&(d+=b,++f);let x=p-d===0,T=p===d+c[f]-1,C=x?2:0,A=T?2:4;for(let S=C;S<A;++S)Gn.writeElements(m,e,t),Gn.writeElements(_,e,t+6),Gn.writeElements(y,e,t+12),t+=6*3}}};var J$e=new Array(1);tp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Dq(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let _;if(this.mode===ne.SCENE3D){_=J$e;let y=p._actualPositions.length;if(y>0)_[0]=y;else continue}else _=p._segments.lengths;let m=_.length;if(m>0){let y=0;for(let b=0;b<m;++b){let x=_[b]-1;for(let T=0;T<x;++T)c+4>D.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 Dq(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>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Dq(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};tp.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 xS={positions:void 0,lengths:void 0},bhe=new Array(1),eZe=new h,tZe=new fe;tp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return bhe[0]=n.length,xS.positions=n,xS.lengths=bhe,xS;whe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=eZe;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,tZe)));if(o.length>0){e._boundingVolume2D=re.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return xS.positions=o,xS.lengths=e._segments.lengths,xS};var xhe;tp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=xhe,c=6*s*3;!l(a)||a.length<c?a=xhe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,_=0,m=0,y;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?y=f[s-2]:(y=s8,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[b-1],h.clone(y,md),h.clone(f[b],Bs),b===s-1?t._loop?y=f[1]:(y=s8,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[b+1],h.clone(y,pd);let x=d[_];b===m+x&&(m+=x,++_);let T=b-m===0,C=b===m+d[_]-1;o===ne.SCENE2D&&(md.z=0,Bs.z=0,pd.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(T||C)&&r-Math.abs(Bs.x)<1&&((Bs.x<0&&md.x>0||Bs.x>0&&md.x<0)&&h.clone(Bs,md),(Bs.x<0&&pd.x>0||Bs.x>0&&pd.x<0)&&h.clone(Bs,pd));let A=T?2:0,S=C?2:4;for(let w=A;w<S;++w)Gn.writeElements(Bs,a,p),Gn.writeElements(md,a,p+6),Gn.writeElements(pd,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Fh=Nh;function A0(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 Zu({batchTable:e.batchTable}),this._labelCollection=new ep({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(A0.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 nZe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ae.packedLength+te.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ae.pack(n,s,a),a+=ae.packedLength,te.pack(t,s,a),s}var iZe=new di("createVectorTilePoints",5),oZe=new h;function rZe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=nZe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=iZe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let _=0;_<p;++_){let m=d[_],y=h.unpack(n,_*3,oZe),b=c.add();b.position=y,b._batchIndex=m;let x=u.add();x.text=" ",x.position=y,x._batchIndex=m;let T=f.add();T.positions=[h.clone(y),h.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}A0.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),d=o.get(a);t[c]=new ng(e,c,u,f,d)}};A0.prototype.applyDebugSettings=function(e,t){e?(H.clone(t,this._billboardCollection._highlightColor),H.clone(t,this._labelCollection._highlightColor),H.clone(t,this._polylineCollection._highlightColor)):(H.clone(H.WHITE,this._billboardCollection._highlightColor),H.clone(H.WHITE,this._labelCollection._highlightColor),H.clone(H.WHITE,this._polylineCollection._highlightColor))};function sZe(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=ng.defaultPointSize,s.color=ng.defaultColor,s.pointOutlineColor=ng.defaultPointOutlineColor,s.pointOutlineWidth=ng.defaultPointOutlineWidth,s.labelColor=H.WHITE,s.labelOutlineColor=H.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=$o.FILL,s.labelText=void 0,s.backgroundColor=new H(.165,.165,.165,.8),s.backgroundPadding=new V(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=H.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Ci.CENTER,s.verticalOrigin=Fn.CENTER,s.labelHorizontalOrigin=Ci.RIGHT,s.labelVerticalOrigin=Fn.BASELINE}}var aZe=new H,cZe=new H,lZe=new H,uZe=new H,fZe=new H,dZe=new H,_N=new Vt,gN=new Vt,Lq=new Rt;A0.prototype.applyStyle=function(e,t){if(!l(e)){sZe(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,aZe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,cZe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,lZe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,uZe)),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,fZe)),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)?(_N.near=a.x,_N.nearValue=a.y,_N.far=a.z,_N.farValue=a.w,s.scaleByDistance=_N):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(gN.near=a.x,gN.nearValue=a.y,gN.far=a.z,gN.farValue=a.w,s.translucencyByDistance=gN):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Lq.near=a.x,Lq.far=a.y,s.distanceDisplayCondition=Lq):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,dZe)),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))}};A0.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=rZe(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)};A0.prototype.isDestroyed=function(){return!1};A0.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(),ce(this)};var yN=A0;function rg(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.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=zn.BOTH}Object.defineProperties(rg.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 hZe(e){let t=new Float64Array(3+h.packedLength+te.packedLength+ae.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ae.pack(e._rectangle,t,n),t}function mZe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=In.unpack(t,n),n+=In.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=H.unpack(t,n);n+=H.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let _=0;_<d;++_)p[_]=t[n++];s[a]=new Hm({color:c,offset:u,count:f,batchIds:p})}}var pZe=new di("createVectorTilePolygons",5),_Ze=new H;function gZe(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(ae.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let _=e._batchTable,m=s.length;for(let y=0;y<m;++y){let b=_.getColor(y,_Ze);s[y]=b.toRgba()}a=e._packedBuffer=hZe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=pZe.scheduleTask(u,c);if(l(p))return p.then(_=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(_.packedBuffer),y=m[0];mZe(e,m),e._indices=ke.getSizeInBytes(y)===2?new Uint16Array(_.indices):new Uint32Array(_.indices),e._indexOffsets=new Uint32Array(_.indexOffsets),e._indexCounts=new Uint32Array(_.indexCounts),e._batchedPositions=new Float32Array(_.positions),e._vertexBatchIds=new Uint16Array(_.batchIds),yZe(e),e._ready=!0}).catch(_=>{e.isDestroyed()||(e._error=_)})}function yZe(e){l(e._primitive)||(e._primitive=new Xx({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)}rg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};rg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};rg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};rg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};rg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=gZe(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)};rg.prototype.isDestroyed=function(){return!1};rg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var bN=rg;var xN=`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 Bh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Bh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function bZe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+te.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,te.pack(o,a,c),c+=te.packedLength,h.pack(r,a,c),a}var xZe=new di("createVectorTilePolylines",5),TS={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function TZe(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=bZe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=xZe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===ke.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),CZe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function CZe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=st.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),f=st.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),d=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),p=st.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),_=st.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),m=st.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),y=[{index:TS.previousPosition,vertexBuffer:u,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:TS.currentPosition,vertexBuffer:f,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:TS.nextPosition,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:TS.expandAndWidth,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:2},{index:TS.a_batchId,vertexBuffer:_,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new qn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var TN=new M,Ihe=new h;function AZe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,TN),M.multiplyByPoint(TN,e._center,Ihe),M.setTranslation(TN,Ihe,TN),TN},u_highlightColor:function(){return e._highlightColor}})}function EZe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var SZe=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function vZe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xN),o=n.getFragmentShaderCallback(!1,void 0,!1)(SZe),r=new Be({defines:["VECTOR_TILE",Nt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[zu,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:TS})}function wZe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Se.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Bh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(s=0;s<p;++s){let _=(d+s)*3;f[u++]=i[_],f[u++]=i[_+1],f[u++]=i[_+2]}}return f};Bh.prototype.getPositions=function(e){return Bh.getPolylinePositions(this,e)};Bh.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 oa(e,r)}};Bh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function IZe(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=H.WHITE}}var PZe=new H,DZe=H.WHITE,RZe=!0;Bh.prototype.applyStyle=function(e,t){if(!l(e)){IZe(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,PZe):DZe,s.show=l(e.show)?e.show.evaluate(s):RZe}};Bh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=TZe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}AZe(this,t),vZe(this,t),EZe(this);let n=e.passes;(n.render||n.pick)&&wZe(this,e)};Bh.prototype.isDestroyed=function(){return!1};Bh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ce(this)};var IT=Bh;var CN=`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 AN=`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 sg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new V(hi._defaultMinTerrainHeight,hi._defaultMaxTerrainHeight),this._boundingVolume=In.fromRectangle(e.rectangle,hi._defaultMinTerrainHeight,hi._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=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(sg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function OZe(e,t,n){let i=hi.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;In.fromRectangle(c,o,r,n,a)}function MZe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+te.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,te.pack(o,a,c),c+=te.packedLength,h.pack(r,a,c),a}var LZe=new di("createVectorTileClampedPolylines"),E0={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function NZe(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=MZe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=LZe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===ke.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),FZe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function FZe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=st.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=st.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),_=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),m=st.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),y=st.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),b=st.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),x=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW}),T=st.createIndexBuffer({context:t,typedArray:u,usage:Ne.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),C=[{index:E0.startEllipsoidNormal,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:E0.endEllipsoidNormal,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:E0.startPositionAndHeight,vertexBuffer:_,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:E0.endPositionAndHeight,vertexBuffer:m,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:E0.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:E0.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:E0.a_batchId,vertexBuffer:x,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new qn({context:t,attributes:C,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var EN=new M,Phe=new h;function BZe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,EN),M.multiplyByPoint(EN,e._center,Phe),M.setTranslation(EN,Phe,EN),EN},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Dhe(e){return ze.fromCache({cull:{enabled:!0,face:Ai.FRONT},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})}function kZe(e){l(e._rs)||(e._rs=Dhe(!1),e._rs3DTiles=Dhe(!0))}function UZe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(CN),o=n.getFragmentShaderCallback(!1,void 0,!0)(AN),r=new Be({defines:["VECTOR_TILE",Nt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[zu,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:E0})}function zZe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Se.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===zn.TERRAIN||i===zn.BOTH)&&t.commandList.push(n),(i===zn.CESIUM_3D_TILE||i===zn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}sg.prototype.getPositions=function(e){return IT.getPolylinePositions(this,e)};sg.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 oa(e,r)}};sg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function VZe(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=H.WHITE}}var HZe=new H,GZe=H.WHITE,jZe=!0;sg.prototype.applyStyle=function(e,t){if(!l(e)){VZe(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,HZe):GZe,s.show=l(e.show)?e.show.evaluate(s):jZe}};function WZe(e){return hi.initialize().then(function(){OZe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}sg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=WZe(this).then(NZe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}BZe(this,t),UZe(this,t),kZe(this);let n=e.passes;(n.render||n.pick)&&zZe(this,e)};sg.prototype.isDestroyed=function(){return!1};sg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ce(this)};var SN=sg;var Nq=32767,qZe=new fe,YZe=new h;function XZe(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);On.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=s[f],p=a[f],_=c[f],m=D.lerp(t.west,t.east,d/Nq),y=D.lerp(t.south,t.north,p/Nq),b=D.lerp(n,i,_/Nq),x=fe.fromRadians(m,y,b,qZe),T=o.cartographicToCartesian(x,YZe);h.pack(T,u,f*3)}return u}var vN=XZe;function Uh(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,JZe(this,i,o)}Object.defineProperties(Uh.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 KZe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function $Ze(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 u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new se("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 kh=Uint32Array.BYTES_PER_ELEMENT;function ZZe(e){return new IT(e)}function QZe(e){return new SN(e)}function JZe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=kh;let r=o.getUint32(n,!0);if(r!==1)throw new se(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=kh;let s=o.getUint32(n,!0);if(n+=kh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=kh,a===0)throw new se("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=kh;let u=o.getUint32(n,!0);n+=kh;let f=o.getUint32(n,!0);n+=kh;let d=o.getUint32(n,!0);n+=kh;let p=o.getUint32(n,!0);n+=kh;let _=o.getUint32(n,!0);n+=kh;let m=o.getUint32(n,!0);n+=kh;let y=Ho(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let x,T;u>0&&(x=Ho(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let C=y.POLYGONS_LENGTH??0,A=y.POLYLINES_LENGTH??0,S=y.POINTS_LENGTH??0,w=C+A+S,R=new v_(e,w,x,T,KZe(e));if(e._batchTable=R,w===0)return;let P=new Dh(y,b),O=P.getGlobalProperty("REGION");if(!l(O))throw new se("Feature table global property: REGION must be defined");let L=ae.unpack(O),g=O[4],E=O[5],v=e._tile.computedTransform,I=P.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(I)?(I=h.unpack(I),M.multiplyByPoint(v,I,I)):(I=ae.center(L),I.height=D.lerp(g,E,.5),I=te.WGS84.cartographicToCartesian(I));let N=$Ze(y,b);if(n+=(4-n%4)%4,C>0){P.featuresLength=C;let F=P.getPropertyArray("POLYGON_COUNTS",K.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_COUNT",K.UNSIGNED_INT,1);if(!l(F))throw new se("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=P.getPropertyArray("POLYGON_INDEX_COUNTS",K.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_INDEX_COUNT",K.UNSIGNED_INT,1);if(!l(U))throw new se("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=F.reduce(function(Y,ee){return Y+ee*2},0),z=U.reduce(function(Y,ee){return Y+ee},0),B=new Uint32Array(t,n,z);n+=d;let j=new Uint16Array(t,n,k);n+=p;let W,J;l(y.POLYGON_MINIMUM_HEIGHTS)&&l(y.POLYGON_MAXIMUM_HEIGHTS)&&(W=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",K.FLOAT,1),J=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",K.FLOAT,1)),e._polygons=new bN({positions:j,counts:F,indexCounts:U,indices:B,minimumHeight:g,maximumHeight:E,polygonMinimumHeights:W,polygonMaximumHeights:J,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,batchIds:N.polygons,modelMatrix:v})}if(A>0){P.featuresLength=A;let F=P.getPropertyArray("POLYLINE_COUNTS",K.UNSIGNED_INT,1)??P.getPropertyArray("POLYLINE_COUNT",K.UNSIGNED_INT,1);if(!l(F))throw new se("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=P.getPropertyArray("POLYLINE_WIDTHS",K.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(A);for(let J=0;J<A;++J)U[J]=2}let k=F.reduce(function(J,Y){return J+Y*3},0),z=new Uint16Array(t,n,k);n+=_;let B=e._tileset,j=B.examineVectorLinesFunction;if(l(j)){let J=vN(new Uint16Array(z),L,g,E,te.WGS84);eQe(J,F,N.polylines,R,e.url,j)}let W=ZZe;l(B.classificationType)&&(W=QZe),e._polylines=W({positions:z,widths:U,counts:F,batchIds:N.polylines,minimumHeight:g,maximumHeight:E,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,classificationType:B.classificationType,keepDecodedPositions:B.vectorKeepDecodedPositions})}if(S>0){let F=new Uint16Array(t,n,S*3);n+=m,e._points=new yN({positions:F,batchIds:N.points,minimumHeight:g,maximumHeight:E,rectangle:L,batchTable:R})}}function Fq(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}}Uh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Uh.prototype.getFeature=function(e){return l(this._features)||Fq(this),this._features[e]};Uh.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)};Uh.prototype.applyStyle=function(e){l(this._features)||Fq(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)};Uh.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)||Fq(this),this._batchTable.update(e,t),this._ready=!0)};Uh.prototype.pick=function(e,t,n){};Uh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Uh.prototype.isDestroyed=function(){return!1};Uh.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(),ce(this)};function eQe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var wN=Uh;var Rhe={b3dm:function(e,t,n,i,o){return $u.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return $u.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return $u.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return rO.fromTileType(e,t,n,i,o,Rhe)},externalTileset:function(e,t,n,i){return oN.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new cO(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new wN(e,t,n,i,o)},subt:function(e,t,n,i,o){return WE.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return WE.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new se("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return $u.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return $u.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return $u.fromGeoJson(e,t,n,i)}},PT=Rhe;var tQe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Zo=Object.freeze(tQe);var zh={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"};zh.isBinaryFormat=function(e){switch(e){case zh.BATCHED_3D_MODEL:case zh.INSTANCED_3D_MODEL:case zh.COMPOSITE:case zh.POINT_CLOUD:case zh.VECTOR:case zh.GEOMETRY:case zh.IMPLICIT_SUBTREE:case zh.VOXEL_BINARY:case zh.GLTF_BINARY:return!0;default:return!1}};var ks=Object.freeze(zh);var nQe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},_d=Object.freeze(nQe);var la={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},ag=new Array(la.NUMBER_OF_PASSES);ag[la.RENDER]=Object.freeze({pass:la.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});ag[la.PICK]=Object.freeze({pass:la.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});ag[la.SHADOW]=Object.freeze({pass:la.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});ag[la.PRELOAD]=Object.freeze({pass:la.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[la.PRELOAD_FLIGHT]=Object.freeze({pass:la.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[la.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:la.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[la.MOST_DETAILED_PRELOAD]=Object.freeze({pass:la.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[la.MOST_DETAILED_PICK]=Object.freeze({pass:la.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});la.getPassOptions=function(e){return ag[e]};var jo=Object.freeze(la);function np(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(np.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){}}});np.prototype.hasProperty=function(e,t){return!1};np.prototype.getFeature=function(e){};np.prototype.applyDebugSettings=function(e,t){};np.prototype.applyStyle=function(e){};np.prototype.update=function(e,t){};np.prototype.pick=function(e,t,n){};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return ce(this)};var CS=np;function cg(e){e=e??G.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(cg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});cg.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};cg.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};cg.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};cg.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};cg.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};cg.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};cg.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var IN=cg;function Bq(e,t){let n=ai(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Bq._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??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new IN({content:n,class:o})}}Bq._oneTimeWarning=bt;var DT=Bq;function iQe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ai(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 RT=iQe;function lg(e){e=e??G.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(lg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});lg.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};lg.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};lg.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};lg.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};lg.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};lg.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};lg.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var PN=lg;function kq(e,t){let n=ai(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){kq._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??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new PN({tile:n,class:o})}}kq._oneTimeWarning=bt;var DN=kq;function oQe(e){let t=new Uint8Array(e),n=bl(t);if(n==="glTF"&&(n="glb"),ks.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=rQe(t);if(l(i.root))return{contentType:ks.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ks.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ks.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ks.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ks.VOXEL_JSON,jsonPayload:i};throw new se("Invalid tile content.")}function rQe(e){let t;try{t=Ho(e)}catch{throw new se("Invalid tile content.")}return t}var ug=oQe;function gd(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=Wa.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(gd.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 Uq(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Ohe(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)}gd.prototype.requestInnerContents=function(){if(!sQe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Uq(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=aQe(this,n,t,this._tile._contentState);return cQe(this)};function sQe(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)&&!Wa.serverHasOpenSlots(n,t[n]))return!1;return Wa.heapHasOpenSlots(e.length)}function aQe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new tr({throttle:!0,throttleByServer:!0,type:Ts.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Xn.CANCELLED){Ohe(e,i);return}return Uq(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Xn.CANCELLED){Ohe(e,i);return}Uq(e,-1),Mhe(e,t,f)}})}async function cQe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>lQe(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 lQe(e,t,n){if(l(t))try{let i=ug(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===ks.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ks.GEOMETRY||i.contentType===ks.VECTOR;let a,c=PT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=DT(o,u));let f=RT(o,u);return l(f)&&(a.group=new jx({metadata:f})),a}catch(i){Mhe(e,n,i)}}function Mhe(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}`))}gd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};gd.prototype.hasProperty=function(e,t){return!1};gd.prototype.getFeature=function(e){};gd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};gd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};gd.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)};gd.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};gd.prototype.isDestroyed=function(){return!1};gd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var RN=gd;var Lhe=Math.cos,Nhe=Math.sin,uQe=Math.sqrt,zq={};zq.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=Lhe(f),p=Nhe(f),_=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,y=d*Lhe(m),b=d*Nhe(m),x=a.x*y,T=a.y*b,C=uQe(x*y+T*b+_*p);if(r.x=x/C,r.y=T/C,r.z=_/C,n){let A=e.stNwCorner;l(A)?(f=A.latitude-e.stGranYCos*i+o*e.stGranXSin,m=A.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var fQe=new ei,yd=new h,dQe=new fe,a8=new h,ON=new Mi;function Fhe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;ON._ellipsoid=te.default,yd=ON.project(e,yd),yd=h.subtract(yd,a8,yd);let _=ei.fromRotation(t,fQe);yd=ei.multiplyByVector(_,yd,yd),yd=h.add(yd,a8,yd),e=ON.unproject(yd,e),r-=1,s-=1;let m=e.latitude,y=m+r*p,b=m-c*s,x=m-c*s+r*p,T=Math.max(m,y,b,x),C=Math.min(m,y,b,x),A=e.longitude,S=A+r*u,w=A+s*d,R=A+s*d+r*u,P=Math.max(A,S,w,R),O=Math.min(A,S,w,R);return{north:T,south:C,east:P,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}zq.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let _,m=u-f;c>a?_=D.TWO_PI-c+a:_=a-c;let y=Math.ceil(_/t)+1,b=Math.ceil(m/t)+1,x=_/(y-1),T=m/(b-1),C=ae.northwest(e,r),A=ae.center(e,dQe);(n!==0||i!==0)&&(A.longitude<C.longitude&&(A.longitude+=D.TWO_PI),ON._ellipsoid=te.default,a8=ON.project(A,a8));let S=T,w=x,R=0,P=0,O=ae.clone(e,o),L={granYCos:S,granYSin:R,granXCos:w,granXSin:P,nwCorner:C,boundingRectangle:O,width:y,height:b,northCap:d,southCap:p};if(n!==0){let g=Fhe(C,n,x,T,A,y,b);u=g.north,f=g.south,a=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let g=ae.northwest(O,s),E=Fhe(g,n,x,T,A,y,b);L.stGranYCos=E.granYCos,L.stGranXCos=E.granXCos,L.stGranYSin=E.granYSin,L.stGranXSin=E.granXSin,L.stNwCorner=g,L.stWest=E.west,L.stSouth=E.south}return L};var Us=zq;var hQe=new re,mQe=new re,pQe=new h,_Qe=new ae;function Bhe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let d=new Float64Array(u*3),p=0,_=0,m,y=pQe;if(r)Us.computePosition(t,n,!1,_,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<o;m++)Us.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=o-1,_=1;_<i;_++)Us.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(_=i-1,!s)for(m=o-2;m>=0;m--)Us.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,_=i-2;_>0;_--)Us.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let b=d.length/3*2,x=ke.createTypedArray(d.length/3,b),T=0;for(let A=0;A<d.length/3-1;A++)x[T++]=A,x[T++]=A+1;x[T++]=d.length/3-1,x[T++]=0;let C=new lt({attributes:new dn,primitiveType:Le.LINES});return C.attributes.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),C.indices=x,C}function gQe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Bhe(e,t),s=t.height,a=t.width,c=li.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=li.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(d,u),r.attributes.position.values=f;let p=t.northCap,_=t.southCap,m=4;p&&(m-=1),_&&(m-=1);let y=(f.length/3+m)*2,b=ke.createTypedArray(f.length/3,y);u=f.length/6;let x=0;for(let C=0;C<u-1;C++)b[x++]=C,b[x++]=C+1,b[x++]=C+u,b[x++]=C+u+1;b[x++]=u-1,b[x++]=0,b[x++]=u+u-1,b[x++]=u,b[x++]=0,b[x++]=u;let T;if(p)T=s-1;else{let C=a-1;b[x++]=C,b[x++]=C+u,T=a+s-2}if(b[x++]=T,b[x++]=T+u,!_){let C=a+T-1;b[x++]=C,b[x]=C+u}return r.indices=b,r}function ES(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=ae.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"}ES.packedLength=ae.packedLength+te.packedLength+5;ES.pack=function(e,t,n){return n=n??0,ae.pack(e._rectangle,t,n),n+=ae.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var khe=new ae,Uhe=te.clone(te.UNIT_SPHERE),AS={rectangle:khe,ellipsoid:Uhe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};ES.unpack=function(e,t,n){t=t??0;let i=ae.unpack(e,t,khe);t+=ae.packedLength;let o=te.unpack(e,t,Uhe);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(AS.granularity=r,AS.height=s,AS.rotation=a,AS.extrudedHeight=c,AS.offsetAttribute=u===-1?void 0:u,new ES(AS))};var yQe=new fe;ES.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Us.computeOptions(t,e._granularity,e._rotation,0,_Qe,yQe),o,r;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(o=gQe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,_=new Uint8Array(p);e._offsetAttribute===an.TOP?_=_.fill(1,0,p/2):(u=e._offsetAttribute===an.NONE?0:1,_=_.fill(u)),o.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}let f=re.fromRectangle3D(t,n,s,mQe),d=re.fromRectangle3D(t,n,a,hQe);r=re.union(f,d)}else{if(o=Bhe(e,i),o.attributes.position.values=li.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===an.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=re.fromRectangle3D(t,n,s)}return new lt({attributes:o.attributes,indices:o.indices,primitiveType:Le.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var OT=ES;function vS(e){this.rectangle=ae.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??te.WGS84;AQe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(vS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});vS.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=In.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)};var zhe=new h,c8=new h,Vhe=new h,bQe=new h,xQe=new h,TQe=new h,CQe=new h,bd=new fe,Hhe=new en(h.UNIT_X,0),SS=new _n;function AQe(e,t,n){n.cartographicToCartesian(ae.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ae.northeast(t),e.northeastCornerCartesian),bd.longitude=t.west,bd.latitude=(t.south+t.north)*.5,bd.height=0;let i=n.cartographicToCartesian(bd,TQe),o=h.cross(i,h.UNIT_Z,bQe);h.normalize(o,e.westNormal),bd.longitude=t.east;let r=n.cartographicToCartesian(bd,CQe),s=h.cross(h.UNIT_Z,r,zhe);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,zhe);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,xQe),u=t.south,f;if(u>0){bd.longitude=(t.west+t.east)*.5,bd.latitude=u;let y=n.cartographicToCartesian(bd,SS.origin);h.clone(c,SS.direction);let b=en.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Hhe);ti.rayPlane(SS,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,c8)}else f=n.geodeticSurfaceNormalCartographic(ae.southeast(t),c8);let d=h.cross(f,a,Vhe);h.normalize(d,e.southNormal);let p=t.north,_;if(p<0){bd.longitude=(t.west+t.east)*.5,bd.latitude=p;let y=n.cartographicToCartesian(bd,SS.origin);h.negate(c,SS.direction);let b=en.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Hhe);ti.rayPlane(SS,b,e.northeastCornerCartesian),_=n.geodeticSurfaceNormal(y,c8)}else _=n.geodeticSurfaceNormalCartographic(ae.northwest(t),c8);let m=h.cross(a,_,Vhe);h.normalize(m,e.northNormal)}var EQe=new h,SQe=new h,vQe=new h(0,-1,0),wQe=new h(0,0,-1),Ghe=new h;function IQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ae.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,_=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ae.southwest(e.rectangle),EQe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ae.northeast(e.rectangle),SQe),f.z=f.y,f.y=f.x,f.x=0,d=vQe,_=h.UNIT_Y,p=wQe,m=h.UNIT_Z);let y=h.subtract(i,u,Ghe),b=h.dot(y,d),x=h.dot(y,p),T=h.subtract(i,f,Ghe),C=h.dot(T,_),A=h.dot(T,m);b>0?r+=b*b:C>0&&(r+=C*C),x>0?r+=x*x:A>0&&(r+=A*A)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}vS.prototype.distanceToCamera=function(e){let t=IQe(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};vS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};vS.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new OT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new It({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var Ju=vS;var MN={},PQe=new h,jhe=new h,Whe=new h,qhe=new h,Yhe=new In;MN.validOutline=function(e){let n=In.fromPoints(e,Yhe).halfAxes,i=Z.getColumn(n,0,jhe),o=Z.getColumn(n,1,Whe),r=Z.getColumn(n,2,qhe),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};MN.computeProjectTo2DArguments=function(e,t,n,i){let o=In.fromPoints(e,Yhe),r=o.halfAxes,s=Z.getColumn(r,0,jhe),a=Z.getColumn(r,1,Whe),c=Z.getColumn(r,2,qhe),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let _,m;return(p===f||p===d)&&(_=s),p===u?_=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(_,n),h.normalize(m,i),h.clone(o.center,t),!0};function Xhe(e,t,n,i,o){let r=h.subtract(e,t,PQe),s=h.dot(n,r),a=h.dot(i,r);return V.fromElements(s,a,o)}MN.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Xhe(i[r],e,t,n);return o}};MN.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Xhe(i,e,t,n,o)}};var fg=MN;function DQe(e){let t=e.length,n=new Float64Array(t*3),i=ke.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 dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:n})});return new lt({attributes:s,indices:i,primitiveType:Le.LINES})}function MT(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+1}MT.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new MT(t)};MT.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var RQe={polygonHierarchy:{}};MT.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new MT(RQe)),n._polygonHierarchy=i,n.packedLength=o,n};MT.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=So(n,h.equalsEpsilon,!0),n.length<3||!fg.validOutline(n))return;let o=Hn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new It({geometry:DQe(o[c])});r.push(u)}let s=Nn.combineInstances(r)[0],a=re.fromPoints(t.positions);return new lt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var xd=MT;var l8=new fe;function LN(e){let t=P_.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=zQe(t,n,i,o);this._boundingPlanes=r;let s=jQe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Xq(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Xq(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Xq(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();l8=o.cartesianToCartographic(c,l8),l8.height=(i+n)/2,this.center=o.cartographicToCartesian(l8,c),this._boundingSphere=re.fromPoints(s)}var OQe=new h,MQe=new fe,LQe=new h,NQe=new fe,FQe=new h,BQe=new h,kQe=new h,UQe=new h;function zQe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,OQe),a=i.cartesianToCartographic(r,MQe);a.height=n;let c=i.cartographicToCartesian(a,LQe),u=en.fromPointNormal(c,s);o[0]=u;let f=0,d,p=[],_,m;for(d=0;d<4;d++){_=e.getVertex(d),p[d]=_,m=i.cartesianToCartographic(_,NQe),m.height=t;let b=en.getPointDistance(u,i.cartographicToCartesian(m,FQe));b<f&&(f=b)}let y=en.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,o[1]=y,d=0;d<4;d++){_=p[d];let b=p[(d+1)%4],x=i.geodeticSurfaceNormal(_,BQe),T=h.subtract(b,_,UQe),C=h.cross(T,x,kQe);C=h.normalize(C,C),o[2+d]=en.fromPointNormal(_,C)}return o}var LT=new h,NT=new h,FT=new h,Vq=new h,Hq=new h,Gq=new h,VQe=new h,HQe=new h,GQe=new h,jq=new h,Wq=new h,qq=new h,S0=new h,ip=new Z;function Khe(e,t,n){LT=e.normal,NT=t.normal,FT=n.normal,Vq=h.multiplyByScalar(e.normal,-e.distance,Vq),Hq=h.multiplyByScalar(t.normal,-t.distance,Hq),Gq=h.multiplyByScalar(n.normal,-n.distance,Gq),jq=h.multiplyByScalar(h.cross(NT,FT,VQe),h.dot(Vq,LT),jq),Wq=h.multiplyByScalar(h.cross(FT,LT,HQe),h.dot(Hq,NT),Wq),qq=h.multiplyByScalar(h.cross(LT,NT,GQe),h.dot(Gq,FT),qq),ip[0]=LT.x,ip[1]=NT.x,ip[2]=FT.x,ip[3]=LT.y,ip[4]=NT.y,ip[5]=FT.y,ip[6]=LT.z,ip[7]=NT.z,ip[8]=FT.z;let i=Z.determinant(ip);return S0=h.add(jq,Wq,S0),S0=h.add(S0,qq,S0),new h(S0.x/i,S0.y/i,S0.z/i)}function jQe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Khe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Khe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Yq=new h,wS=new h;function Xq(e,t){let n=[];for(let i=0;i<4;i++)Yq=h.subtract(t[(i+1)%4],t[i],Yq),wS=h.cross(e.normal,Yq,wS),wS=h.normalize(wS,wS),n[i]=h.clone(wS);return n}Object.defineProperties(LN.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var Kq=new h;LN.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;en.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):en.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,en.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=$q(en.projectPointOntoPlane(c,t,Kq),i[0],c,o),h.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=$he(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=$q(en.projectPointOntoPlane(c,t,Kq),i[r],c,this._edgeNormals[n[r]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=$q(en.projectPointOntoPlane(this._boundingPlanes[1],t,Kq),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var WQe=new h,qQe=new h;function $he(e,t,n){let i=h.subtract(n,t,WQe),o=h.subtract(e,t,qQe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var YQe=new en(h.UNIT_X,0);function $q(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=en.fromPointNormal(t[c],i[c],YQe);en.getPointDistance(u,e)<0||(a=$he(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}LN.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Ht.INSIDE:n===this._vertices.length?Ht.OUTSIDE:Ht.INTERSECTING};LN.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new xd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=xd.createGeometry(n),o=new It({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new xd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=xd.createGeometry(r),a=new It({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new xd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=xd.createGeometry(f);c[u]=new It({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new Pn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var NN=LN;var XQe=new h(1,1,1),u8=Math.cos,f8=Math.sin;function IS(e){e=e??G.EMPTY_OBJECT;let t=e.radii??XQe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}IS.packedLength=2*h.packedLength+8;IS.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.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 Zhe=new h,Qhe=new h,dg={radii:Zhe,innerRadii:Qhe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};IS.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Zhe);t+=h.packedLength;let o=h.unpack(e,t,Qhe);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(dg.minimumClock=r,dg.maximumClock=s,dg.minimumCone=a,dg.maximumCone=c,dg.stackPartitions=u,dg.slicePartitions=f,dg.subdivisions=d,dg.offsetAttribute=p===-1?void 0:p,new IS(dg))};IS.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-r)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,_=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;_&&(p=2,r>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let b=a*p*(f+u),x=new Float64Array(b*3),T=2*(b+d-(u+f)*p),C=ke.createTypedArray(b,T),A,S,w,R,P=0,O=new Array(f),L=new Array(f);for(A=0;A<f;A++)R=r+A*(s-r)/(f-1),O[A]=f8(R),L[A]=u8(R);let g=new Array(a),E=new Array(a);for(A=0;A<a;A++)w=i+A*(o-i)/(a-1),g[A]=f8(w),E[A]=u8(w);for(A=0;A<f;A++)for(S=0;S<a;S++)x[P++]=t.x*O[A]*E[S],x[P++]=t.y*O[A]*g[S],x[P++]=t.z*L[A];if(_)for(A=0;A<f;A++)for(S=0;S<a;S++)x[P++]=n.x*O[A]*E[S],x[P++]=n.y*O[A]*g[S],x[P++]=n.z*L[A];for(O.length=a,L.length=a,A=0;A<a;A++)R=r+A*(s-r)/(a-1),O[A]=f8(R),L[A]=u8(R);for(g.length=u,E.length=u,A=0;A<u;A++)w=i+A*(o-i)/(u-1),g[A]=f8(w),E[A]=u8(w);for(A=0;A<a;A++)for(S=0;S<u;S++)x[P++]=t.x*O[A]*E[S],x[P++]=t.y*O[A]*g[S],x[P++]=t.z*L[A];if(_)for(A=0;A<a;A++)for(S=0;S<u;S++)x[P++]=n.x*O[A]*E[S],x[P++]=n.y*O[A]*g[S],x[P++]=n.z*L[A];for(P=0,A=0;A<f*p;A++){let N=A*a;for(S=0;S<a-1;S++)C[P++]=N+S,C[P++]=N+S+1}let v=f*a*p;for(A=0;A<u;A++)for(S=0;S<a-1;S++)C[P++]=v+A+S*u,C[P++]=v+A+(S+1)*u;if(_)for(v=f*a*p+u*a,A=0;A<u;A++)for(S=0;S<a-1;S++)C[P++]=v+A+S*u,C[P++]=v+A+(S+1)*u;if(_){let N=f*a*p,F=N+a*u;if(m)for(A=0;A<u;A++)C[P++]=N+A,C[P++]=F+A;if(y)for(N+=a*u-u,F+=a*u-u,A=0;A<u;A++)C[P++]=N+A,C[P++]=F+A}let I=new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x})});if(l(e._offsetAttribute)){let N=x.length,F=e._offsetAttribute===an.NONE?0:1,U=new Uint8Array(N/3).fill(F);I.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new lt({attributes:I,indices:C,primitiveType:Le.LINES,boundingSphere:re.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var ef=IS;function PS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new ef(i),this._workerName="createSphereOutlineGeometry"}PS.packedLength=ef.packedLength;PS.pack=function(e,t,n){return ef.pack(e._ellipsoidGeometry,t,n)};var KQe=new ef,BT={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};PS.unpack=function(e,t,n){let i=ef.unpack(e,t,KQe);return BT.stackPartitions=i._stackPartitions,BT.slicePartitions=i._slicePartitions,BT.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,BT.radii),n._ellipsoidGeometry=new ef(BT),n):(BT.radius=i._radii.x,new PS(BT))};PS.createGeometry=function(e){return ef.createGeometry(e._ellipsoidGeometry)};var hg=PS;function DS(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new re(e,t)}Object.defineProperties(DS.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}}});DS.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};DS.prototype.intersectPlane=function(e){return re.intersectPlane(this._boundingSphere,e)};DS.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};DS.prototype.createDebugVolume=function(e){let t=new hg({radius:this.radius}),n=M.fromTranslation(this.center,new M.clone(M.IDENTITY)),i=new It({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var mg=DS;var $Qe=new h,ZQe=new h,QQe=new h,JQe=new h;function kT(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function Zq(e,t){let n=h.normalize(e,JQe),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return kT(e,i,t)}function Jhe(e){let t=Z.getColumn(e,0,$Qe),n=Z.getColumn(e,1,ZQe),i=Z.getColumn(e,2,QQe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(o&&!r&&!s?t=kT(n,i,t):!o&&r&&!s?n=kT(t,i,n):!o&&!r&&s?i=kT(n,t,i):o?r?s||(t=Zq(i,t),n=kT(i,t,n)):(t=Zq(n,t),i=kT(n,t,i)):(n=Zq(t,n),i=kT(n,t,i)),Z.setColumn(e,0,t,e),Z.setColumn(e,1,n,e),Z.setColumn(e,2,i,e),e)}function RS(e,t){t=Jhe(t),this._orientedBoundingBox=new In(e,t),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(RS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});RS.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};RS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};RS.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Jhe(t),Z.clone(t,this._orientedBoundingBox.halfAxes),re.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};RS.prototype.createDebugVolume=function(e){let t=new fh({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new It({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var fu=RS;function ur(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ai(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=DN(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,ur._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")&&ur._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Ko.REPLACE:Ko.ADD):l(i)?p=i.refine:p=Ko.REPLACE,this.refine=p,this.children=[],this.parent=i;let _,m=!1,y,b,x;if(t=Ee.createIfNeeded(t),r)y=Zo.UNLOADED,b=t.clone();else if(l(s)){let S=s.uri;l(s.url)&&(ur._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=s.url),S===""?(ur._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),_=new CS(e,this),m=!0,y=Zo.READY):(y=Zo.UNLOADED,b=t.getDerivedResource({url:S}),x=Wa.getServerKey(b.getUrlComponent()))}else _=new CS(e,this),m=!0,y=Zo.READY;this._content=_,this._contentResource=b,this._contentState=y,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let T=n.expire,C,A;l(T)&&(C=T.duration,l(T.date)&&(A=$.fromIso8601(T.date))),this.expireDuration=C,this.expireDate=A,this.lastStyleTime=0,this._optimChildrenWithinParent=_d.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=H.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 $,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}ur._deprecationWarning=Po;Object.defineProperties(ur.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 H),H.clone(this._color)},set:function(e){this._color=H.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===Zo.READY}},contentUnloaded:{get:function(){return this._contentState===Zo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Zo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Zo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var v0=new h;function eJe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,v0),c=h.add(s.positionWC,a,v0),u=h.subtract(c,r,v0);if(h.magnitude(u)>o){let A=h.normalize(u,v0),S=h.multiplyByScalar(A,o,v0),w=h.add(r,S,v0),R=h.subtract(w,s.positionWC,v0),P=h.normalize(R,v0);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Ko.REPLACE,_=n.isSkippingLevelOfDetail;if(p&&!_||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&_||n._pass===jo.PRELOAD_FLIGHT||n._pass===jo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let b=m-y,x=D.clamp((e._foveatedFactor-y)/b,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),C=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-T<=C}var ome=new $;ur.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof cn){let _=u.offCenterFrustum;l(_)&&(u=_);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let _=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=s*d/(_*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,x=D.fog(_,y)*b;p-=x}}return p/=e.pixelRatio,p};function tJe(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 nJe(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}ur.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:Es.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!==Es.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=nJe(n,this),this._priorityProgressiveResolution=tJe(n,this),this.priorityDeferred=eJe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ur.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=$.now(ome);$.lessThan(this.expireDate,e)&&(this._contentState=Zo.EXPIRED,this._expiredContent=this._content)}};function iJe(e){if(!l(e.expireDuration))return;let t=$.now(ome);$.addSeconds(t,e.expireDuration,t),l(e.expireDate)?$.lessThan(e.expireDate,t)&&$.clone(t,e.expireDate):e.expireDate=$.clone(t)}function oJe(e){return function(){return e._priority}}ur.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?rJe(this):aJe(this)};function rJe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ai(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new RN(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Zo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Zo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Zo.FAILED,o})}async function sJe(e,t,n,i,o){let r=e._contentState;e._contentState=Zo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Xn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Zo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Xn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await cJe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Zo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Zo.FAILED,a}}function aJe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new tr({throttle:!0,throttleByServer:!0,type:Ts.TILES3D,priorityFunction:oJe(e),serverKey:e._serverKey});e._request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return sJe(e,o,i,n,r)}async function cJe(e,t){let n=ug(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===ks.GEOMETRY||n.contentType===ks.VECTOR,(n.contentType===ks.IMPLICIT_SUBTREE||n.contentType===ks.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===ks.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=PT[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=DT(i,s));let a=RT(i,s);return l(a)&&(o.group=new jx({metadata:a})),o}ur.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ur.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Zo.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 rme=new re;function Jq(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,rme);e._boundingVolume2D=new mg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function lJe(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,rme);e._contentBoundingVolume2D=new mg(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ur.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Jq(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Ht.INSIDE,a===Ht.OUTSIDE)return Es.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Ht.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ur.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Ht.INSIDE;if(this._visibilityPlaneMask===Es.MASK_INSIDE)return Ht.INSIDE;let t=e.cullingVolume,n=lJe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Ht.INSIDE,s===Ht.OUTSIDE)return Ht.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Ht.OUTSIDE,s===Ht.INSIDE)return Ht.OUTSIDE}return t.computeVisibility(n)};ur.prototype.distanceToTile=function(e){return Jq(this,e).distanceToCamera(e)};var uJe=new h;ur.prototype.distanceToTileCenter=function(e){let n=Jq(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,uJe);return h.dot(e.camera.directionWC,i)};ur.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var sme=new Z,ame=new h,fJe=new Z,eY=new h,cme=new ae,lme=new In,Qq=new M;function dJe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],eY),o=Z.fromArray(e,3,fJe);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,sme);return o=Z.multiply(r,o,o),l(n)?(n.update(i,o),n):new fu(i,o)}function eme(e,t,n,i){let o=ae.unpack(e,0,cme),r=e[4],s=e[5],a=In.fromRectangle(o,r,s,te.WGS84,lme),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,Qq),Qq),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,sme);return u=Z.multiply(f,u,u),l(i)&&i instanceof fu?(i.update(c,u),i):new fu(c,u)}function hJe(e,t,n,i){if(!M.equalsEpsilon(t,n,D.EPSILON8))return i instanceof fu?eme(e,t,n,i):eme(e,t,n,void 0);let o=ae.unpack(e,0,cme);return i instanceof Ju?(i.rectangle=ae.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new Ju({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function mJe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],eY),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,ame),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new mg(i,o)}ur.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=cT.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new se("boundingVolume must be defined");if(ai(e,"3DTILES_bounding_volume_S2"))return new NN(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=dJe(r,t,n);return this._verticalExaggeration!==1&&tme(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=hJe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof fu?tme(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Or.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Or.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(a)){let c=mJe(a,t,n);if(this._verticalExaggeration!==1){let u=Or.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,eY),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new se("boundingVolume must contain a sphere, region, or box")};var pJe=h.unpackArray(new Array(8*3).fill(0));function tme(e,t,n){let i=e.boundingVolume.computeCorners(pJe).map(r=>Or.getPosition(r,te.WGS84,t,n,r)),o=In.fromPoints(i,lme);e.update(o.center,o.halfAxes)}ur.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,Qq),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};ur.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,ame),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function _Je(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=H.WHITE:c=H.DARKGRAY:c=H.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Yt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(H.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(H.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=H.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function gJe(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=Zo.FAILED,o}}function yJe(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 bJe(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)}ur.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;yJe(this,e),bJe(this,e),_Je(this,e,t,n),gJe(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===Se.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var nme=[];ur.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(iJe(this),this._selectedFrame=0,this.lastStyleTime=0,$.now(this._loadTimestamp),this._contentState=Zo.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=nme;try{this._content.update(e,t)}catch(i){throw this._contentState=Zo.FAILED,i}nme.length=0,t.commandList=n};function ime(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function d8(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}ur.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,d=r,p=Math.pow(10,f),_=f+d,m=r,y=Math.pow(10,_),b=_+m,x=Math.pow(10,b),T=d8(this._depth,n.depth,i.depth);T=t?1-T:T;let A=!e.isSkippingLevelOfDetail&&this.refine===Ko.REPLACE?d8(this._priorityHolder._distanceToCamera,n.distance,i.distance):d8(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=ime(A,a,s),w=this._priorityProgressiveResolution?0:p,R=d8(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=ime(R,u,c),O=this.priorityDeferred?y:0,L=e._pass===jo.PRELOAD_FLIGHT?0:x;this._priority=T+S+w+P+O+L};ur.prototype.isDestroyed=function(){return!1};ur.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(),ce(this)};var Td=ur;function pg(e){e=e??G.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(pg.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}}});pg.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};pg.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};pg.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};pg.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};pg.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};pg.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};pg.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var OS=pg;function _g(e){e=e??G.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(_g.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_g.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};_g.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};_g.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};_g.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};_g.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};_g.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};_g.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var FN=_g;function ume(e){e=e??G.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new FN({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new OS({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new OS({id:f,group:a[f],class:n.classes[d.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(ume.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 UT=ume;var fme={},xJe=new h;fme.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof fu||i instanceof Ju){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=_d.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof fu||a instanceof Ju)){e._optimChildrenWithinParent=_d.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,o.center,xJe),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=_d.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===_d.USE_OPTIMIZATION};var BN=fme;function kN(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(kN.prototype,{length:{get:function(){return this._length}}});function TJe(e,t,n){this.item=e,this.previous=t,this.next=n}kN.prototype.add=function(e){let t=new TJe(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 dme(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}kN.prototype.remove=function(e){l(e)&&(dme(this,e),--this._length)};kN.prototype.splice=function(e,t){if(e===t)return;dme(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 UN=kN;function zT(){this._list=new UN,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 zN=zT;function h8(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 nY(e,t){let n;return t==="_loadTimestamp"?n=$.toDate(e).getTime():n=e,n}h8.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=nY(e,n),this._referenceMaximum[n]=nY(t,n)};function CJe(e,t){let n=e.tilePropertyName;if(l(n)){let i=nY(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 tY=[new H(.1,.1,.1,1),new H(.153,.278,.878,1),new H(.827,.231,.49,1),new H(.827,.188,.22,1),new H(1,.592,.259,1),new H(1,.843,0,1)];h8.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=CJe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+D.EPSILON7,c=D.clamp(i-o,0,s)/s,u=tY.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),_=f-d,m=tY[d],y=tY[p],b=H.clone(H.WHITE);b.red=D.lerp(m.red,y.red,_),b.green=D.lerp(m.green,y.green,_),b.blue=D.lerp(m.blue,y.blue,_),e._debugColor=b};h8.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 VN=h8;function MS(){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}MS.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};MS.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])}};MS.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof $u))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])}};MS.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof $u))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])}};MS.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 Vh=MS;function HN(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(HN.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});HN.prototype.makeDirty=function(){this._styleDirty=!0};HN.prototype.resetDirty=function(){this._styleDirty=!1};HN.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 GN=HN;function AJe(e,t,n){let i=ai(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)&&!ai(o,"3DTILES_bounding_volume_S2")&&!ai(o,"3DTILES_bounding_volume_cylinder"))throw new se("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 Ee({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=EJe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Fe(a,!0));let c=new Ee({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=SJe(t),this.subdivisionScheme=fs[i.subdivisionScheme],this.branchingFactor=fs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function EJe(e){if(ai(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 SJe(e){let t=Fe(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 VT=AJe;var jN={};function hme(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function iY(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function mme(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 oY(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}jN.encode2D=function(e,t){return(hme(e)|hme(t)<<1)>>>0};jN.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=mme(e),t[1]=mme(e>>1),t};jN.encode3D=function(e,t,n){return iY(e)|iY(t)<<1|iY(n)<<2};jN.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=oY(e),t[1]=oY(e>>1),t[2]=oY(e>>2),t};var w0=jN;function Qo(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===fs.OCTREE&&(this.z=e.z)}Object.defineProperties(Qo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===fs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===fs.OCTREE?w0.encode3D(this.x,this.y,this.z):w0.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===fs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Qo.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===fs.OCTREE){let o=(this.z<<e.level)+e.z;return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Qo.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===fs.OCTREE){let r=Math.floor(this.z/t);return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Qo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===fs.OCTREE){let r=e.z%n;return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Qo.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===fs.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Qo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Qo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Qo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Qo.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===fs.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Qo.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===fs.OCTREE?this.z===e.z:!0)};Qo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Qo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Qo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Qo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===fs.OCTREE&&(e.z=this.z),e};var pme=[0,0,0];Qo.fromMortonIndex=function(e,t,n,i){let o;return e===fs.OCTREE?(o=w0.decode3D(i,pme),new Qo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=w0.decode2D(i,pme),new Qo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Qo.fromTileIndex=function(e,t,n){let i,o,r;return e===fs.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(D.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Qo.fromMortonIndex(e,t,i,r)};var HT=Qo;function gg(){}gg.selectTiles=function(e,t){he.throwInstantiationError()};gg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};gg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};gg.selectTile=function(e,t){if(e.contentVisibility(t)===Ht.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)};gg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};gg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};gg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!vJe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function vJe(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}gg.updateTile=function(e,t){_me(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,PJe(e),e._shouldSelect=!1,e._finalResolution=!0};function _me(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];_me(r,t),e._visible=r._visible;return}if(wJe(e,t)){e._visible=!1;return}let i=e.refine===Ko.REPLACE,o=e._optimChildrenWithinParent===_d.USE_OPTIMIZATION;if(i&&o&&n&&!IJe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function wJe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Ko.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function IJe(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 PJe(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 ua=gg;function gme(){}var WN={stack:new yl,stackMaximumLength:0};gme.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}=ua,s=WN.stack;for(s.push(i);s.length>0;){WN.stackMaximumLength=Math.max(WN.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Ko.ADD,u=a.refine===Ko.REPLACE,f=DJe(a);f&&RJe(a,s,t),(c||u&&!f)&&(OJe(e,a),o(a,t),MJe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return WN.stack.trim(WN.stackMaximumLength),n};function DJe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function RJe(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 OJe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function MJe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Ht.OUTSIDE&&e.tileset._selectedTiles.push(e)}var qN=gme;function yme(){}var YN={stack:new yl,stackMaximumLength:0},XN={stack:new yl,stackMaximumLength:0};yme.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(ua.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;NJe(n,t),YN.stack.trim(YN.stackMaximumLength),XN.stack.trim(XN.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function rY(e,t){e.contentAvailable&&ua.selectTile(e,t)}function LJe(e,t,n){let i=e.refine===Ko.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=ua;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(ua.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,_=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let y=r[m];if(y.isVisible?(t.push(y),y._foveatedFactor<_&&(p=m,_=y._foveatedFactor),d=!0):(u||o.loadSiblings)&&(y._foveatedFactor<_&&(p=m,_=y._foveatedFactor),a(y,n),c(y,n)),u){let b;y._inRequestVolume?y.hasRenderableContent?b=y.contentAvailable:b=FJe(y,n):b=!1,f=f&&b}}if(d||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&_<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=y}return f}function NJe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=ua,a=YN.stack;for(a.push(e);a.length>0;){YN.stackMaximumLength=Math.max(YN.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?LJe(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Ko.ADD?(rY(c,t),o(c,t)):c.refine===Ko.REPLACE&&(o(c,t),d&&rY(c,t)):(n._emptyTiles.push(c),o(c,t),d&&rY(c,t)),r(c,t),s(c,t)}}function FJe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=ua,s=!0,a=XN.stack;for(a.push(e);a.length>0;){XN.stackMaximumLength=Math.max(XN.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let p=0;p<f;++p){let _=u[p];a.push(_)}}return e.hasEmptyContent||s}var KN=yme;function bme(){}var $N={stack:new yl,stackMaximumLength:0},ZN={stack:new yl,stackMaximumLength:0},yg={stack:new yl,stackMaximumLength:0,ancestorStack:new yl,ancestorStackMaximumLength:0},BJe=2;bme.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(ua.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;GJe(n,t),jJe(n,t),$N.stack.trim($N.stackMaximumLength),ZN.stack.trim(ZN.stackMaximumLength),yg.stack.trim(yg.stackMaximumLength),yg.ancestorStack.trim(yg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function kJe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=ua,r=ZN.stack;for(r.push(e);r.length>0;){ZN.stackMaximumLength=Math.max(ZN.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<BJe&&r.push(u))}}}function m8(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:kJe(e,t)}function UJe(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 zJe(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 VJe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=ua;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(ua.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function HJe(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 GJe(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}=ua,c=$N.stack;for(c.push(e);c.length>0;){$N.stackMaximumLength=Math.max($N.stackMaximumLength,c.length);let u=c.pop();UJe(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?VJe(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Ko.ADD?(m8(u,t),r(u,t)):u.refine===Ko.REPLACE&&(HJe(u,i)?(r(u,t),p&&m8(u,t)):p?(m8(u,t),r(u,t)):zJe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&m8(u,t)),s(u,t),a(u,t)}}function jJe(e,t){let{selectTile:n,canTraverse:i}=ua,{stack:o,ancestorStack:r}=yg,s;for(o.push(e);o.length>0||r.length>0;){if(yg.stackMaximumLength=Math.max(yg.stackMaximumLength,o.length),yg.ancestorStackMaximumLength=Math.max(yg.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Ko.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var QN=bme;function fr(e){e=e??G.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new zN,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 yl,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 GN,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Vh,this._statisticsLast=new Vh,this._statisticsPerPass=new Array(jo.NUMBER_OF_PASSES);for(let o=0;o<jo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Vh;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 VN(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??te.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??xn.ENABLED,this.show=e.show??!0,this.colorBlendMode=tu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Km(e.pointCloudShading),this._pointCloudEyeDomeLighting=new G_,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me,this.tileLoad=new me,this.tileUnload=new me,this.tileFailed=new me,this.tileVisible=new me,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Ss.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&vh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Gx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new z_(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??H.BLACK,this.splitDirection=e.splitDirection??Wr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&bt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(fr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ss.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){vh.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 Po("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},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,wme(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}}});fr.fromIonAssetId=async function(e,t){let n=await Hu.fromAssetId(e);return fr.fromUrl(n,t)};fr.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await fr.loadJson(n),r=await WJe(n,o),s=new fr(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,wme(s);let c=l(o.asset.gltfUpAxis)?Vo.fromName(o.asset.gltfUpAxis):Vo.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Vo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,M.IDENTITY).boundingSphere.center,_=s._ellipsoid.cartesianToCartographic(p);return l(_)&&_.height>hi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};fr.loadJson=function(e){return Ee.createIfNeeded(e).fetchJson()};fr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};fr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new se("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new se("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&fr.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=xme(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===Ko.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=xme(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&BN.checkChildrenWithinParent(c)}return s};function xme(e,t,n,i){if(!(l(n.implicitTiling)||ai(n,"3DTILES_implicit_tiling")))return new Td(e,t,n,i);let r=e.schema,s=new VT(t,n,r),a=new HT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Fe(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Td(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function WJe(e,t){let n=ai(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Di.getSchemaLoader({resource:e});else if(l(n.schema))i=Di.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new UT({schema:i.schema,metadataJson:n});return Di.unload(i),o}var Tme=new h,qJe=new fe,YJe=new M,XJe=new h,KJe=new h,$Je=new h,ZJe=new h;function QJe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Ju)n=h.normalize(a.positionWC,Tme),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,YJe),b=t.mapProjection.ellipsoid,x=u.boundingVolume,T=M.multiplyByPoint(y,x.center,XJe);if(h.magnitude(T)>b.minimumRadius){let C=fe.fromCartesian(T,b,qJe);n=h.normalize(a.positionWC,Tme),i=a.directionWC,o=a.positionCartographic.height,r=0,s=C.height*2}else{let C=M.multiplyByPoint(y,a.positionWC,KJe);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,$Je),i=h.normalize(i,i),o=C.z,u instanceof fu){let A=Z.getColumn(x.halfAxes,2,ZJe),S=h.magnitude(A);r=T.z-S,s=T.z+S}else if(u instanceof mg){let A=x.radius;r=T.z-A,s=T.z+A}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,_=D.clamp((o-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-_),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function JJe(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=>{Eme(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?met(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Ame(e,t){return e._priority-t._priority}fr.prototype.postPassesUpdate=function(e){l(this._root)&&(eet(this,e),_et(this,e),this._cache.unloadTiles(this,vme),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};fr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;aet(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=$.clone(e.time)),this._timeSinceLoad=Math.max($.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&QJe(this,e),e.newFrame&&this._cache.reset()};function eet(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!==Zo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function tet(e){let t=e._requestedTiles;t.sort(Ame);for(let n=0;n<t.length;++n)JJe(e,t[n])}function Eme(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 net(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Zo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var iet=new fe,oet=new fe,ret=new h;function set(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=fe.clone(r.positionCartographic,iet),c=fe.fromCartesian(o.center,s,oet);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,ret);h.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function aet(e,t){net(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,Eme(f,e,u)}}e.totalMemoryUsageInBytes<i?uet(e):a&&n.length>0&&cet(e)}function cet(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Ame)}function uet(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var p8=new h,fet={maximumFractionDigits:3};function Cme(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,fet):Math.round(t).toLocaleString()}function sY(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,p8);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=h.normalize(i,p8);r=h.multiplyByScalar(r,.75*n,p8),o=h.add(r,i,p8)}return o}function aY(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: ${Cme(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Cme(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 det(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:sY(e.debugPickedTile),a=aY(e.debugPickedTile,e,s);a.pixelOffset=new V(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];aY(a,e,sY(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&aY(a,e,sY(a))}}e._tileDebugLabels.update(t)}function het(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 oi({stencil:0,pass:Se.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:jt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),set(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let _=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let b=_-1;b>=0;--b)i[d+y+b]=i[d+b];for(let b=0;b<y;++b)i[d+b]=m[b]}_=i.length-r,c.numberOfCommands=_,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new ep),det(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Sme=[];function met(e,t){let n=t,i=Sme;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&&(pet(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function vme(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function pet(e,t){e._cache.unloadTile(e,t,vme),t.destroy()}fr.prototype.trimLoadedTiles=function(){this._cache.trim()};function _et(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Vh.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 get(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 yet(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function bet(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,get(e),yet(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&tet(e),het(e,t,i),Vh.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 wme(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(_t.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 _t(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}fr.prototype.getTraversal=function(e){let{pass:t}=e;return t===jo.MOST_DETAILED_PRELOAD||t===jo.MOST_DETAILED_PICK?qN:this.isSkippingLevelOfDetail?QN:KN};fr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};fr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===jo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===jo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===jo.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=jo.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=bet(this,e,d,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};fr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};fr.prototype.isDestroyed=function(){return!1};fr.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=Sme;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,ce(this)};fr.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};fr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!fr.supportedExtensions[e[t]])throw new se(`Unsupported 3D Tiles Extension: ${e[t]}`)};var xet=new _n,Tet=new h,Cet=new fe;fr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=xet,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,Tet);if(l(r))return n.cartesianToCartographic(r,Cet)?.height};fr.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var Aet=new Xa,Eet=new h;fr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=ti.raySphere(e,u.contentBoundingVolume.boundingSphere,Aet);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=re.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=re.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,Eet);if(l(f))return a=h.clone(f,n),a}};var ws=fr;var vet=new M;function I0(e,t){t.collectionChanged.addEventListener(I0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new wt,this._onCollectionChanged(t,t.values,[],[])}I0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,vet),c=Ee.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],wet(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};I0.prototype.isDestroyed=function(){return!1};I0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(I0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)cY(this,e[i],t,n);return ce(this)};I0.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?(re.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};I0.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):(cY(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],cY(this,r,a,c),s.remove(r.id)};function cY(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function wet(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await ws.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 JN=I0;var Iet=H.WHITE,Pet=H.BLACK,Det=new V(2,2);function LS(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(LS.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});LS.prototype.getType=function(e){return"Checkerboard"};var Ret=new $;LS.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ret)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,Iet,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,Pet,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,Det),t};LS.prototype.equals=function(e){return this===e||e instanceof LS&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var NS=LS;var Ime={id:void 0};function eF(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 Uc(e){this._owner=e,this._entities=new wt,this._addedEntities=new wt,this._removedEntities=new wt,this._changedEntities=new wt,this._suspendCount=0,this._collectionChanged=new me,this._id=Ln(),this._show=!0,this._firing=!1,this._refire=!1}Uc.prototype.suspendEvents=function(){this._suspendCount++};Uc.prototype.resumeEvents=function(){this._suspendCount--,eF(this)};Object.defineProperties(Uc.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}}});Uc.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.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;$.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),$.greaterThan(c,t)&&!c.equals(Ge.MAXIMUM_VALUE)&&(t=c)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new En({start:e,stop:t})};Uc.prototype.add=function(e){e instanceof ar||(e=new ar(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`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(Uc.prototype._onEntityDefinitionChanged,this),eF(this),e};Uc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Uc.prototype.contains=function(e){return this._entities.get(e.id)===e};Uc.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(Uc.prototype._onEntityDefinitionChanged,this),eF(this),!0):!1};Uc.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(Uc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),eF(this)};Uc.prototype.getById=function(e){return this._entities.get(e)};Uc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Ime.id=e,t=new ar(Ime),this.add(t)),t};Uc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),eF(this)};var fa=Uc;var _8={id:void 0},FS=new Array(2);function lY(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 Pme(e,t,n,i){FS[0]=n,FS[1]=i.id,t[JSON.stringify(FS)]=i.definitionChanged.addEventListener(Zr.prototype._onDefinitionChanged,e)}function Dme(e,t,n,i){FS[0]=n,FS[1]=i.id;let o=JSON.stringify(FS);t[o](),t[o]=void 0}function P0(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,d=new fa(e),p=e._eventHash,_;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Zr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--)s=a[c],Dme(e,p,_,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Zr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--){s=a[c],Pme(e,p,_,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?lY(y):(_8.id=s.id,y=new ar(_8)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Zr(e,t){this._owner=t,this._composite=new fa(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Ln(),this._eventHash={},P0(this),this._shouldRecomposite=!1}Object.defineProperties(Zr.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}}});Zr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),P0(this)};Zr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),P0(this),!0):!1};Zr.prototype.removeAllCollections=function(){this._collections.length=0,P0(this)};Zr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Zr.prototype.contains=function(e){return this._composite.contains(e)};Zr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Zr.prototype.getCollection=function(e){return this._collections[e]};Zr.prototype.getCollectionsLength=function(){return this._collections.length};function g8(e,t){return e.indexOf(t)}function Rme(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,P0(e)}Zr.prototype.raiseCollection=function(e){let t=g8(this._collections,e);Rme(this,t,t+1)};Zr.prototype.lowerCollection=function(e){let t=g8(this._collections,e);Rme(this,t,t-1)};Zr.prototype.raiseCollectionToTop=function(e){let t=g8(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),P0(this))};Zr.prototype.lowerCollectionToBottom=function(e){let t=g8(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),P0(this))};Zr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Zr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(P0(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Zr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Zr.prototype.getById=function(e){return this._composite.getById(e)};Zr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Dme(this,d,p,m);let y=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=r.getById(y),lY(u)),u.merge(c));l(u)||r.removeById(y),u=void 0}let _=t.length;for(s=0;s<_;s++){let m=t[s];Pme(this,d,p,m);let y=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=r.getById(y),l(u)?lY(u):(_8.id=y,u=new ar(_8),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Zr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let _=o[p].getById(e.id);if(l(_)){let m=_[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var uY=Zr;function fY(){this._removalFunctions=[]}fY.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)}};fY.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Tr=fY;function mY(e,t){return $.compare(e.start,t.start)}function Qr(e){if(this._intervals=[],this._changedEvent=new me,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Qr.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}}});Qr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Qr))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(!En.equals(n[r],i[r],t))return!1;return!0};Qr.prototype.get=function(e){return this._intervals[e]};Qr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Qr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Qr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Qr.prototype.contains=function(e){return this.indexOf(e)>=0};var dY=new En;Qr.prototype.indexOf=function(e){let t=this._intervals;dY.start=e,dY.stop=e;let n=Uo(t,dY,mY);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&&En.contains(t[n-1],e)?n-1:~n)};Qr.prototype.findInterval=function(e){e=e??G.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]}};Qr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||$.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Uo(n,e,mY);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=$.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)?($.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({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=$.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({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 En({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=$.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 En({start:e.start,stop:$.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:$.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({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)};Qr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Uo(t,e,mY);n<0&&(n=~n);let i=!1;for(n>0&&($.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,($.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 En({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 En({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 En({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&$.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 En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&($.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Qr.prototype.intersect=function(e,t,n){let i=new Qr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if($.lessThan(c.stop,u.start))++o;else if($.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=En.intersect(c,u,new En,n);f.isEmpty||i.addInterval(f,t)}$.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Qr.fromJulianDateArray=function(e,t){l(t)||(t=new Qr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new En({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],_=n[d+1];u=new En({start:p,stop:_,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=_}return c&&(u=new En({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var zc=new Qp,tF=[0,31,28,31,30,31,30,31,31,30,31,30,31];function hY(e,t,n){l(n)||(n=new $),$.toGregorianDate(e,zc);let i=zc.millisecond+t.millisecond,o=zc.second+t.second,r=zc.minute+t.minute,s=zc.hour+t.hour,a=zc.day+t.day,c=zc.month+t.month,u=zc.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),tF[2]=th(u)?29:28;a>tF[c]||c>=13;)a>tF[c]&&(a-=tF[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),tF[2]=th(u)?29:28;return zc.millisecond=i,zc.second=o,zc.minute=r,zc.hour=s,zc.day=a,zc.month=c,zc.year=u,$.fromGregorianDate(zc,n)}var Oet=new $,Met=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Ome(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(Met);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"),$.toGregorianDate($.fromIso8601(e,Oet),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var nF=new Qp;Qr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=$.fromIso8601(n[0]),o=$.fromIso8601(n[1]),r=[];if(!Ome(n[2],nF))r.push(i,o);else{let s=$.clone(i);for(r.push(s);$.compare(s,o)<0;)s=hY(s,nF),$.compare(o,s)<=0&&$.clone(o,s),r.push(s)}return Qr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Qr.fromIso8601DateArray=function(e,t){return Qr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return $.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Qr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let u=0;u<c;++u)(Ome(i[u],nF)||u===0)&&(o&&l(a)?s=hY(a,nF):s=hY(n,nF),r.push(s),a=s);return Qr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Jr=Qr;function Let(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 GT(){this._eventHelper=new Tr,this._definitionChanged=new me,this._intervals=new Jr,this._intervals.changedEvent.addEventListener(GT.prototype._intervalsChanged,this)}Object.defineProperties(GT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Net=new $;GT.prototype.getValue=function(e,t){l(e)||(e=$.now(Net));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};GT.prototype.equals=function(e){return this===e||e instanceof GT&&this._intervals.equals(e._intervals,X.equals)};GT.prototype._intervalsChanged=function(){Let(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Vc=GT;function D0(){this._definitionChanged=new me,this._composite=new Vc,this._composite.definitionChanged.addEventListener(D0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(D0.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});D0.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Fet=new $;D0.prototype.getValue=function(e,t){l(e)||(e=$.now(Fet));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};D0.prototype.equals=function(e){return this===e||e instanceof D0&&this._composite.equals(e._composite,X.equals)};D0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var BS=D0;function R0(e){this._referenceFrame=e??Gi.FIXED,this._definitionChanged=new me,this._composite=new Vc,this._composite.definitionChanged.addEventListener(R0.prototype._raiseDefinitionChanged,this)}Object.defineProperties(R0.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 Bet=new $;R0.prototype.getValue=function(e,t){return l(e)||(e=$.now(Bet)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};R0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};R0.prototype.equals=function(e){return this===e||e instanceof R0&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};R0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Oa=R0;var ket={ROUNDED:0,MITERED:1,BEVELED:2},Bi=Object.freeze(ket);var Ma=[new h,new h],Uet=new h,zet=new h,Vet=new h,Het=new h,Get=new h,jet=new h,Wet=new h,qet=new h,Yet=new h,kS=new h,y8=new h,iF={},pY=new fe;function Xet(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];pY=t.cartesianToCartographic(o,pY),n[i]=pY.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function _Y(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var b8=new h,x8=new h;function Ket(e,t,n,i){let o=new cs(n,i),r=o.projectPointOntoPlane(h.add(n,e,b8),b8),s=o.projectPointOntoPlane(h.add(n,t,x8),x8),a=V.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var $et=new h(-1,0,0),jT=new M,Zet=new M,gY=new Z,Qet=Z.IDENTITY.clone(),Jet=new h,ett=new ie,Mme=new h;function bg(e,t,n,i,o,r,s,a){let c=Jet,u=ett;jT=At.eastNorthUpToFixedFrame(e,o,jT),c=M.multiplyByPointAsVector(jT,$et,c),c=h.normalize(c,c);let f=Ket(c,t,e,o);gY=Z.fromRotationZ(f,gY),Mme.z=r,jT=M.multiplyTransformation(jT,M.fromRotationTranslation(gY,Mme,Zet),jT);let d=Qet;d[0]=s;for(let p=0;p<a;p++)for(let _=0;_<n.length;_+=3)u=h.fromArray(n,_,u),u=Z.multiplyByVector(d,u,u),u=M.multiplyByPoint(jT,u,u),i.push(u.x,u.y,u.z);return i}var ttt=new h;function yY(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,ttt);i=bg(c,t,n,i,o,r[a/3],s,1)}return i}function ntt(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Lme(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 Nme=new Pe,Fme=new h,Bme=new Z;function kme(e,t,n,i,o,r,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,kS),h.subtract(n,e,y8)),d=i===Bi.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;o?p=Z.fromQuaternion(Pe.fromAxisAngle(h.negate(e,kS),f/(d+1),Nme),Bme):p=Z.fromQuaternion(Pe.fromAxisAngle(e,f/(d+1),Nme),Bme);let _,m;if(t=h.clone(t,Fme),d>0){let y=u?2:1;for(let b=0;b<d;b++)t=Z.multiplyByVector(p,t,t),_=h.subtract(t,e,kS),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(t,y8),s=bg(m,_,a,s,r,c,1,y)}else _=h.subtract(t,e,kS),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(t,y8),s=bg(m,_,a,s,r,c,1,1),n=h.clone(n,Fme),_=h.subtract(n,e,kS),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(n,y8),s=bg(m,_,a,s,r,c,1,1);return s}iF.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];V.equals(r,s)||n.push(s)}return n};iF.angleIsGreaterThanPi=function(e,t,n,i){let o=new cs(n,i),r=o.projectPointOntoPlane(h.add(n,e,b8),b8),s=o.projectPointOntoPlane(h.add(n,t,x8),x8);return s.x*r.y-s.y*r.x>=0};var itt=new h,ott=new h;iF.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Xet(e,r),a=i._granularity,c=i._cornerType,u=o?ntt(t,n):Lme(t,n),f=o?Lme(t,n):void 0,d=n.height/2,p=n.width/2,_=e.length,m=[],y=o?[]:void 0,b=Uet,x=zet,T=Vet,C=Het,A=Get,S=jet,w=Wet,R=qet,P=Yet,O=e[0],L=e[1];C=r.geodeticSurfaceNormal(O,C),b=h.subtract(L,O,b),b=h.normalize(b,b),R=h.cross(C,b,R),R=h.normalize(R,R);let g=s[0],E=s[1];o&&(y=bg(O,R,f,y,r,g+d,1,1)),P=h.clone(O,P),O=L,x=h.negate(b,x);let v,I;for(let U=1;U<_-1;U++){let k=o?2:1;if(L=e[U+1],O.equals(L)){bt("Positions are too close and are considered equivalent with rounding error.");continue}b=h.subtract(L,O,b),b=h.normalize(b,b),C=r.geodeticSurfaceNormal(O,C);let z=h.multiplyByScalar(C,h.dot(b,C),itt);h.subtract(b,z,z),h.normalize(z,z);let B=h.multiplyByScalar(C,h.dot(x,C),ott);if(h.subtract(x,B,B),h.normalize(B,B),!D.equalsEpsilon(Math.abs(h.dot(z,B)),1,D.EPSILON7)){T=h.add(b,x,T),T=h.normalize(T,T),T=h.cross(T,C,T),T=h.cross(C,T,T),T=h.normalize(T,T);let W=1/Math.max(.25,h.magnitude(h.cross(T,x,kS))),J=iF.angleIsGreaterThanPi(b,x,O,r);J?(A=h.add(O,h.multiplyByScalar(T,W*p,T),A),S=h.add(A,h.multiplyByScalar(R,p,S),S),Ma[0]=h.clone(P,Ma[0]),Ma[1]=h.clone(S,Ma[1]),v=_Y(Ma,g+d,E+d,a),I=Fi.generateArc({positions:Ma,granularity:a,ellipsoid:r}),m=yY(I,R,u,m,r,v,1),R=h.cross(C,b,R),R=h.normalize(R,R),w=h.add(A,h.multiplyByScalar(R,p,w),w),c===Bi.ROUNDED||c===Bi.BEVELED?kme(A,S,w,c,J,r,m,u,E+d,o):(T=h.negate(T,T),m=bg(O,T,u,m,r,E+d,W,k)),P=h.clone(w,P)):(A=h.add(O,h.multiplyByScalar(T,W*p,T),A),S=h.add(A,h.multiplyByScalar(R,-p,S),S),Ma[0]=h.clone(P,Ma[0]),Ma[1]=h.clone(S,Ma[1]),v=_Y(Ma,g+d,E+d,a),I=Fi.generateArc({positions:Ma,granularity:a,ellipsoid:r}),m=yY(I,R,u,m,r,v,1),R=h.cross(C,b,R),R=h.normalize(R,R),w=h.add(A,h.multiplyByScalar(R,-p,w),w),c===Bi.ROUNDED||c===Bi.BEVELED?kme(A,S,w,c,J,r,m,u,E+d,o):m=bg(O,T,u,m,r,E+d,W,k),P=h.clone(w,P)),x=h.negate(b,x)}else m=bg(P,R,u,m,r,g+d,1,1),P=O;g=E,E=s[U+1],O=L}Ma[0]=h.clone(P,Ma[0]),Ma[1]=h.clone(O,Ma[1]),v=_Y(Ma,g+d,E+d,a),I=Fi.generateArc({positions:Ma,granularity:a,ellipsoid:r}),m=yY(I,R,u,m,r,v,1),o&&(y=bg(O,R,f,y,r,E+d,1,1)),_=m.length;let N=o?_+y.length:_,F=new Float64Array(N);return F.set(m),o&&F.set(y,_),F};var Hh=iF;var xY={},US=new h,Gme=new h,rtt=new h,Ume=new h,wl=[new h,new h],jme=new h,Wme=new h,qme=new h,stt=new h,att=new h,ctt=new h,ltt=new h,utt=new h,ftt=new h,dtt=new h,zme=new Pe,Vme=new Z;function T8(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,US),h.subtract(n,e,Gme)),s=i===Bi.BEVELED?1:Math.ceil(r/D.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=Z.fromQuaternion(Pe.fromAxisAngle(h.negate(e,US),r/s,zme),Vme):u=Z.fromQuaternion(Pe.fromAxisAngle(e,r/s,zme),Vme);let f=0;t=h.clone(t,US);for(let d=0;d<s;d++)t=Z.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function htt(e){let t=jme,n=Wme,i=qme,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=T8(t,n,i,Bi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=T8(t,n,i,Bi.ROUNDED,!1);return[r,c]}function Hme(e,t,n,i){let o=US;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function bY(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,US),a=h.negate(s,Gme),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,rtt),p=h.add(d,a,Ume);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let _=h.add(d,s,Ume);r[u--]=_.z,r[u--]=_.y,r[u--]=_.x}return i.push(o,r),i}xY.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 mtt=new h,ptt=new h;xY.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=jme,c=Wme,u=qme,f=stt,d=att,p=ctt,_=ltt,m=utt,y=ftt,b=dtt,x=[],T=s?[]:void 0,C=s?[]:void 0,A=n[0],S=n[1];c=h.normalize(h.subtract(S,A,c),c),a=i.geodeticSurfaceNormal(A,a),f=h.normalize(h.cross(a,c,f),f),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),_=h.clone(A,_),A=S,u=h.negate(c,u);let w,R=[],P,O=n.length;for(P=1;P<O-1;P++){a=i.geodeticSurfaceNormal(A,a),S=n[P+1],c=h.normalize(h.subtract(S,A,c),c);let g=h.multiplyByScalar(a,h.dot(c,a),mtt);h.subtract(c,g,g),h.normalize(g,g);let E=h.multiplyByScalar(a,h.dot(u,a),ptt);if(h.subtract(u,E,E),h.normalize(E,E),!D.equalsEpsilon(Math.abs(h.dot(g,E)),1,D.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let I=o/Math.max(.25,h.magnitude(h.cross(d,u,US))),N=Hh.angleIsGreaterThanPi(c,u,A,i);d=h.multiplyByScalar(d,I,d),N?(m=h.add(A,d,m),b=h.add(m,h.multiplyByScalar(f,o,b),b),y=h.add(m,h.multiplyByScalar(f,o*2,y),y),wl[0]=h.clone(_,wl[0]),wl[1]=h.clone(b,wl[1]),w=Fi.generateArc({positions:wl,granularity:t,ellipsoid:i}),x=bY(w,f,o,x),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,o*2,y),y),_=h.add(m,h.multiplyByScalar(f,o,_),_),r===Bi.ROUNDED||r===Bi.BEVELED?R.push({leftPositions:T8(m,p,y,r,N)}):R.push({leftPositions:Hme(A,h.negate(d,d),y,N)})):(y=h.add(A,d,y),b=h.add(y,h.negate(h.multiplyByScalar(f,o,b),b),b),m=h.add(y,h.negate(h.multiplyByScalar(f,o*2,m),m),m),wl[0]=h.clone(_,wl[0]),wl[1]=h.clone(b,wl[1]),w=Fi.generateArc({positions:wl,granularity:t,ellipsoid:i}),x=bY(w,f,o,x),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,o*2,m),m),m),_=h.add(y,h.negate(h.multiplyByScalar(f,o,_),_),_),r===Bi.ROUNDED||r===Bi.BEVELED?R.push({rightPositions:T8(y,p,m,r,N)}):R.push({rightPositions:Hme(A,d,m,N)})),u=h.negate(c,u)}A=S}a=i.geodeticSurfaceNormal(A,a),wl[0]=h.clone(_,wl[0]),wl[1]=h.clone(A,wl[1]),w=Fi.generateArc({positions:wl,granularity:t,ellipsoid:i}),x=bY(w,f,o,x),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z));let L;return r===Bi.ROUNDED&&(L=htt(x)),{positions:x,corners:R,lefts:T,normals:C,endPositions:L}};var qi=xY;var Kme=new h,$me=new h,C8=new h,A8=new h,_tt=new h,Zme=new h,O0=new h,zS=new h;function Qme(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Gh(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,O0),O0);r.normal&&qi.addAttribute(s,t,i,o),r.tangent&&qi.addAttribute(a,u,i,o),r.bitangent&&qi.addAttribute(c,n,i,o)}function Jme(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new dn,u,f=0,d=0,p,_=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,_+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,_+=m):(m=o[p].rightPositions.length,d+=m,_+=m)}let y=l(r),b;y&&(b=r[0].length-3,f+=b,d+=b,b/=3,_+=b*6);let x=f+d,T=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,A=t.tangent?new Float32Array(x):void 0,S=t.bitangent?new Float32Array(x):void 0,w={normals:C,tangents:A,bitangents:S},R=0,P=x-1,O,L,g,E,v=Kme,I=$me,N,F,U=b/2,k=ke.createTypedArray(x/3,_),z=0;if(y){F=C8,N=A8;let Q=r[0];for(v=h.fromArray(a,0,v),I=h.fromArray(s,0,I),p=0;p<U;p++)F=h.fromArray(Q,(U-1-p)*3,F),N=h.fromArray(Q,(U+p)*3,N),qi.addAttribute(T,N,R),qi.addAttribute(T,F,void 0,P),Gh(w,v,I,R,P,t),L=R/3,E=L+1,O=(P-2)/3,g=O-1,k[z++]=O,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,P-=3}let B=0,j=0,W=i[B++],J=i[B++];T.set(W,R),T.set(J,P-J.length+1),I=h.fromArray(s,j,I);let Y,ee;for(m=J.length-3,p=0;p<m;p+=3)Y=n.geodeticSurfaceNormal(h.fromArray(W,p,O0),O0),ee=n.geodeticSurfaceNormal(h.fromArray(J,m-p,zS),zS),v=h.normalize(h.add(Y,ee,v),v),Gh(w,v,I,R,P,t),L=R/3,E=L+1,O=(P-2)/3,g=O-1,k[z++]=O,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,P-=3;for(Y=n.geodeticSurfaceNormal(h.fromArray(W,m,O0),O0),ee=n.geodeticSurfaceNormal(h.fromArray(J,m,zS),zS),v=h.normalize(h.add(Y,ee,v),v),j+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,ge=u.rightPositions,le,ye,xe=Zme,Ie=C8,Te=A8;if(v=h.fromArray(a,j,v),l(de)){for(Gh(w,v,I,void 0,P,t),P-=3,le=E,ye=g,Q=0;Q<de.length/3;Q++)xe=h.fromArray(de,Q*3,xe),k[z++]=le,k[z++]=ye-Q-1,k[z++]=ye-Q,qi.addAttribute(T,xe,void 0,P),Ie=h.fromArray(T,(ye-Q-1)*3,Ie),Te=h.fromArray(T,le*3,Te),I=h.normalize(h.subtract(Ie,Te,I),I),Gh(w,v,I,void 0,P,t),P-=3;xe=h.fromArray(T,le*3,xe),Ie=h.subtract(h.fromArray(T,ye*3,Ie),xe,Ie),Te=h.subtract(h.fromArray(T,(ye-Q)*3,Te),xe,Te),I=h.normalize(h.add(Ie,Te,I),I),Gh(w,v,I,R,void 0,t),R+=3}else{for(Gh(w,v,I,R,void 0,t),R+=3,le=g,ye=E,Q=0;Q<ge.length/3;Q++)xe=h.fromArray(ge,Q*3,xe),k[z++]=le,k[z++]=ye+Q,k[z++]=ye+Q+1,qi.addAttribute(T,xe,R),Ie=h.fromArray(T,le*3,Ie),Te=h.fromArray(T,(ye+Q)*3,Te),I=h.normalize(h.subtract(Ie,Te,I),I),Gh(w,v,I,R,void 0,t),R+=3;xe=h.fromArray(T,le*3,xe),Ie=h.subtract(h.fromArray(T,(ye+Q)*3,Ie),xe,Ie),Te=h.subtract(h.fromArray(T,ye*3,Te),xe,Te),I=h.normalize(h.negate(h.add(Te,Ie,I),I),I),Gh(w,v,I,void 0,P,t),P-=3}for(W=i[B++],J=i[B++],W.splice(0,3),J.splice(J.length-3,3),T.set(W,R),T.set(J,P-J.length+1),m=J.length-3,j+=3,I=h.fromArray(s,j,I),Q=0;Q<J.length;Q+=3)Y=n.geodeticSurfaceNormal(h.fromArray(W,Q,O0),O0),ee=n.geodeticSurfaceNormal(h.fromArray(J,m-Q,zS),zS),v=h.normalize(h.add(Y,ee,v),v),Gh(w,v,I,R,P,t),E=R/3,L=E-1,g=(P-2)/3,O=g+1,k[z++]=O,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,P-=3;R-=3,P+=3}if(v=h.fromArray(a,a.length-3,v),Gh(w,v,I,R,P,t),y){R+=3,P-=3,F=C8,N=A8;let Q=r[1];for(p=0;p<U;p++)F=h.fromArray(Q,(b-p-1)*3,F),N=h.fromArray(Q,p*3,N),qi.addAttribute(T,F,void 0,P),qi.addAttribute(T,N,R),Gh(w,v,I,R,P,t),E=R/3,L=E-1,g=(P-2)/3,O=g+1,k[z++]=O,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,P-=3}if(c.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let Q=new Float32Array(x/3*2),de,ge,le=0;if(y){f/=3,d/=3;let ye=Math.PI/(b+1);ge=1/(f-b+1),de=1/(d-b+1);let xe,Ie=b/2;for(p=Ie+1;p<b+1;p++)xe=D.PI_OVER_TWO+ye*p,Q[le++]=de*(1+Math.cos(xe)),Q[le++]=.5*(1+Math.sin(xe));for(p=1;p<d-b+1;p++)Q[le++]=p*de,Q[le++]=0;for(p=b;p>Ie;p--)xe=D.PI_OVER_TWO-p*ye,Q[le++]=1-de*(1+Math.cos(xe)),Q[le++]=.5*(1+Math.sin(xe));for(p=Ie;p>0;p--)xe=D.PI_OVER_TWO-ye*p,Q[le++]=1-ge*(1+Math.cos(xe)),Q[le++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)Q[le++]=p*ge,Q[le++]=1;for(p=1;p<Ie+1;p++)xe=D.PI_OVER_TWO+ye*p,Q[le++]=ge*(1+Math.cos(xe)),Q[le++]=.5*(1+Math.sin(xe))}else{for(f/=3,d/=3,ge=1/(f-1),de=1/(d-1),p=0;p<d;p++)Q[le++]=p*de,Q[le++]=0;for(p=f;p>0;p--)Q[le++]=(p-1)*ge,Q[le++]=1}c.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:k}}function gtt(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,_=Kme,m=$me,y=C8,b=A8,x=_tt,T=Zme,C=c;for(u=0;u<s;u+=3){let A=C+c;_=h.fromArray(n,u,_),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,_,m),y=h.subtract(y,_,y),b=h.normalize(h.cross(m,y,b),b),t.normal&&(qi.addAttribute(f,b,A),qi.addAttribute(f,b,A+3),qi.addAttribute(f,b,C),qi.addAttribute(f,b,C+3)),(t.tangent||t.bitangent)&&(T=h.fromArray(i,u,T),t.bitangent&&(qi.addAttribute(p,T,A),qi.addAttribute(p,T,A+3),qi.addAttribute(p,T,C),qi.addAttribute(p,T,C+3)),t.tangent&&(x=h.normalize(h.cross(T,b,x),x),qi.addAttribute(d,x,A),qi.addAttribute(d,x,A+3),qi.addAttribute(d,x,C),qi.addAttribute(d,x,C+3))),C+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let A=e.tangent.values;d.set(A),d.set(A,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let _=0;_<2;_++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function TY(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 ytt(e,t){let n=new De({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=qi.computePositions(e),r=Jme(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),_=new Float64Array(d);_.set(f);let m=new Float64Array(d*4);f=li.scaleToGeodeticHeight(f,s,i),m=TY(f,0,m),_=li.scaleToGeodeticHeight(_,a,i),m=TY(_,d*2,m),p.set(f),p.set(_,d),p.set(m,d*2),c.position.values=p,c=gtt(c,t);let y,b=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=TY(O,d*4,L),c.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(b*6);if(e.offsetAttribute===an.TOP)O=O.fill(1,0,b).fill(1,b*2,b*4);else{let L=e.offsetAttribute===an.NONE?0:1;O=O.fill(L)}c.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let x=u.length,T=b+b,C=ke.createTypedArray(p.length/3,x*2+T*3);C.set(u);let A=x;for(y=0;y<x;y+=3){let O=u[y],L=u[y+1],g=u[y+2];C[A++]=g+b,C[A++]=L+b,C[A++]=O+b}let S,w,R,P;for(y=0;y<T;y+=2)S=y+T,w=S+T,R=S+1,P=w+1,C[A++]=S,C[A++]=w,C[A++]=R,C[A++]=R,C[A++]=w,C[A++]=P;return{attributes:c,indices:C}}var Yme=new h,oF=new h,Ad=new fe;function Xme(e,t,n,i,o,r){let s=h.subtract(t,e,Yme);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,oF),c=h.cross(s,a,Yme);h.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;h.add(e,c,oF),n.cartesianToCartographic(oF,Ad);let _=Ad.latitude,m=Ad.longitude;u=Math.min(u,_),f=Math.min(f,m),d=Math.max(d,_),p=Math.max(p,m),h.subtract(e,c,oF),n.cartesianToCartographic(oF,Ad),_=Ad.latitude,m=Ad.longitude,u=Math.min(u,_),f=Math.min(f,m),d=Math.max(d,_),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var Cd=new h,rF=new h,du=new fe,hu=new fe;function epe(e,t,n,i,o){e=Qme(e,t);let r=So(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ae;let a=n*.5;du.latitude=Number.POSITIVE_INFINITY,du.longitude=Number.POSITIVE_INFINITY,hu.latitude=Number.NEGATIVE_INFINITY,hu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Bi.ROUNDED){let p=r[0];h.subtract(p,r[1],Cd),h.normalize(Cd,Cd),h.multiplyByScalar(Cd,a,Cd),h.add(p,Cd,rF),t.cartesianToCartographic(rF,Ad),c=Ad.latitude,u=Ad.longitude,du.latitude=Math.min(du.latitude,c),du.longitude=Math.min(du.longitude,u),hu.latitude=Math.max(hu.latitude,c),hu.longitude=Math.max(hu.longitude,u)}for(let p=0;p<s-1;++p)Xme(r[p],r[p+1],t,a,du,hu);let f=r[s-1];h.subtract(f,r[s-2],Cd),h.normalize(Cd,Cd),h.multiplyByScalar(Cd,a,Cd),h.add(f,Cd,rF),Xme(f,rF,t,a,du,hu),i===Bi.ROUNDED&&(t.cartesianToCartographic(rF,Ad),c=Ad.latitude,u=Ad.longitude,du.latitude=Math.min(du.latitude,c),du.longitude=Math.min(du.longitude,u),hu.latitude=Math.max(hu.latitude,c),hu.longitude=Math.max(hu.longitude,u));let d=l(o)?o:new ae;return d.north=hu.latitude,d.south=du.latitude,d.east=hu.longitude,d.west=du.longitude,d}function Tg(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=De.clone(e.vertexFormat??De.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+te.packedLength+De.packedLength+7}Tg.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+=h.packedLength)h.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 tpe=te.clone(te.UNIT_SPHERE),npe=new De,xg={positions:void 0,ellipsoid:tpe,vertexFormat:npe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)o[m]=h.unpack(e,t);let r=te.unpack(e,t,tpe);t+=te.packedLength;let s=De.unpack(e,t,npe);t+=De.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,_=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=De.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=_===-1?void 0:_,n):(xg.positions=o,xg.width=a,xg.height=c,xg.extrudedHeight=u,xg.cornerType=f,xg.granularity=d,xg.shadowVolume=p,xg.offsetAttribute=_===-1?void 0:_,new Tg(xg))};Tg.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??Bi.ROUNDED;return epe(n,o,i,r,t)};Tg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Qme(t,i);let o=So(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(r,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=ytt(u,c);else{let _=qi.computePositions(u);if(f=Jme(_,c,i),f.attributes.position.values=li.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===an.NONE?0:1,y=f.attributes.position.values.length,b=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let d=f.attributes,p=re.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new lt({attributes:d,indices:f.indices,primitiveType:Le.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Tg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=epe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var WT=Tg;var ipe=new h,ope=new h,btt=new h;function xtt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function rpe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new dn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;l(N)?(p=N.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let _=l(r),m;_&&(m=r[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,b=new Float64Array(y),x=0,T=y-1,C,A,S,w,R,P,O=m/2,L=ke.createTypedArray(y/3,d+4),g=0;if(L[g++]=x/3,L[g++]=(T-2)/3,_){n.push(x/3),P=ipe,R=ope;let N=r[0];for(f=0;f<O;f++)P=h.fromArray(N,(O-1-f)*3,P),R=h.fromArray(N,(O+f)*3,R),qi.addAttribute(b,R,x),qi.addAttribute(b,P,void 0,T),A=x/3,w=A+1,C=(T-2)/3,S=C-1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,x+=3,T-=3}let E=0,v=i[E++],I=i[E++];for(b.set(v,x),b.set(I,T-I.length+1),p=I.length-3,n.push(x/3,(T-2)/3),f=0;f<p;f+=3)A=x/3,w=A+1,C=(T-2)/3,S=C-1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,x+=3,T-=3;for(f=0;f<o.length;f++){let N;a=o[f];let F=a.leftPositions,U=a.rightPositions,k,z=btt;if(l(F)){for(T-=3,k=S,n.push(w),N=0;N<F.length/3;N++)z=h.fromArray(F,N*3,z),L[g++]=k-N-1,L[g++]=k-N,qi.addAttribute(b,z,void 0,T),T-=3;n.push(k-Math.floor(F.length/6)),t===Bi.BEVELED&&n.push((T-2)/3+1),x+=3}else{for(x+=3,k=w,n.push(S),N=0;N<U.length/3;N++)z=h.fromArray(U,N*3,z),L[g++]=k+N,L[g++]=k+N+1,qi.addAttribute(b,z,x),x+=3;n.push(k+Math.floor(U.length/6)),t===Bi.BEVELED&&n.push(x/3-1),T-=3}for(v=i[E++],I=i[E++],v.splice(0,3),I.splice(I.length-3,3),b.set(v,x),b.set(I,T-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)w=x/3,A=w-1,S=(T-2)/3,C=S+1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,x+=3,T-=3;x-=3,T+=3,n.push(x/3,(T-2)/3)}if(_){x+=3,T-=3,P=ipe,R=ope;let N=r[1];for(f=0;f<O;f++)P=h.fromArray(N,(m-f-1)*3,P),R=h.fromArray(N,f*3,R),qi.addAttribute(b,P,void 0,T),qi.addAttribute(b,R,x),w=x/3,A=w-1,S=(T-2)/3,C=S+1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,x+=3,T-=3;n.push(x/3)}else n.push(x/3,(T-2)/3);return L[g++]=x/3,L[g++]=(T-2)/3,s.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:L,wallIndices:n}}function Ttt(e){let t=e.ellipsoid,n=qi.computePositions(e),i=rpe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=li.scaleToGeodeticHeight(u,r,t),d=li.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let C=new Uint8Array(f*2);if(e.offsetAttribute===an.TOP)C=C.fill(1,0,f);else{let A=e.offsetAttribute===an.NONE?0:1;C=C.fill(A)}a.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}let _,m=c.length,y=ke.createTypedArray(p.length/3,(m+o.length)*2);y.set(c);let b=m;for(_=0;_<m;_+=2){let C=c[_],A=c[_+1];y[b++]=C+f,y[b++]=A+f}let x,T;for(_=0;_<o.length;_++)x=o[_],T=x+f,y[b++]=x,y[b++]=T;return{attributes:a,indices:y}}function sF(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+te.packedLength+6}sF.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+=h.packedLength)h.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var spe=te.clone(te.UNIT_SPHERE),M0={positions:void 0,ellipsoid:spe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};sF.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=te.unpack(e,t,spe);t+=te.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(M0.positions=o,M0.width=s,M0.height=a,M0.extrudedHeight=c,M0.cornerType=u,M0.granularity=f,M0.offsetAttribute=d===-1?void 0:d,new sF(M0))};sF.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=xtt(t,i);let o=So(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(r,s,0,D.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=Ttt(c);else{let p=qi.computePositions(c);if(u=rpe(p,c.cornerType),u.attributes.position.values=li.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let _=u.attributes.position.values.length,m=e._offsetAttribute===an.NONE?0:1,y=new Uint8Array(_/3).fill(m);u.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=re.fromVertices(f.position.values,void 0,3);return new lt({attributes:f,indices:u.indices,primitiveType:Le.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var aF=sF;var Ctt=new Qn(0);function Il(e){si.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Il.prototype=Object.create(si.prototype),Il.prototype.constructor=Il);Object.defineProperties(Il.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Il.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&cl.isSupported(this._scene)};Il.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Il.prototype._computeCenter=he.throwInstantiationError;Il.prototype._onEntityPropertyChanged=function(e,t,n,i){if(si.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&bt(bt.geometryZIndex),this._zIndex=o.zIndex??Ctt,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 gh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new zx(this._scene,a,r,s)}};Il.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),si.prototype.destroy.call(this)};Il.getGeometryHeight=function(e,t){if(!l(e)){t!==Ke.NONE&&bt(bt.geometryHeightReference);return}return Zf(t)?0:e};Il.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ke.NONE&&bt(bt.geometryExtrudedHeightReference);return}return Zf(t)?Il.CLAMP_TO_GROUND:e};Il.CLAMP_TO_GROUND="clamp";Il.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 an.ALL;if(o===1)return an.TOP};var jn=Il;var ape=new H,cpe=h.ZERO,lpe=new h,upe=new ae;function Att(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 jh(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new Att(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(jh.prototype=Object.create(jn.prototype),jh.prototype.constructor=jh);jh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,ape)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new It({id:t,geometry:new WT(this._options),attributes:i})};jh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,ape),o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new It({id:t,geometry:new aF(this._options),attributes:o})};jh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};jh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||si.prototype._isHidden.call(this,e,t)};jh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};jh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,Ke.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=jn.computeGeometryOffsetAttribute(n,i,o,r),s.height=jn.getGeometryHeight(n,i),o=jn.getGeometryExtrudedHeight(o,r),o===jn.CLAMP_TO_GROUND&&(o=hi.getMinimumMaximumHeights(WT.computeRectangle(s,upe)).minimumTerrainHeight),s.extrudedHeight=o};jh.DynamicGeometryUpdater=VS;function VS(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(VS.prototype=Object.create(ri.prototype),VS.prototype.constructor=VS);VS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ri.prototype._isHidden.call(this,e,t,n)};VS.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,Ke.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(WT.computeRectangle(i,upe)).minimumTerrainHeight),i.extrudedHeight=s};var cF=jh;function E8(){he.throwInstantiationError()}Object.defineProperties(E8.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});E8.prototype.update=function(e){he.throwInstantiationError()};E8.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var es=E8;function op(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(op.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=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var fpe=new h;op.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,fpe);return AY(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};op.prototype.isScaledSpacePointVisible=function(e){return AY(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var Ett=new h;op.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=Ett,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),AY(e,o,i)};op.prototype.computeHorizonCullingPoint=function(e,t,n){return mpe(this._ellipsoid,e,t,n)};var dpe=te.clone(te.UNIT_SPHERE);op.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=hpe(this._ellipsoid,n,dpe);return mpe(o,e,t,i)};op.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return ppe(this._ellipsoid,e,t,n,i,o)};op.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=hpe(this._ellipsoid,o,dpe);return ppe(s,e,t,n,i,r)};var Stt=[];op.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ae.subsample(e,t,0,Stt),o=re.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var vtt=new h;function hpe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,vtt);e=te.fromCartesian3(i,n)}return e}function mpe(e,t,n,i){l(i)||(i=new h);let o=ype(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=_pe(e,c,o);if(u<0)return;r=Math.max(r,u)}return gpe(o,r,i)}var S8=new h;function ppe(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=ype(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){S8.x=n[c]+o.x,S8.y=n[c+1]+o.y,S8.z=n[c+2]+o.z;let f=_pe(e,S8,s);if(f<0)return;a=Math.max(a,f)}return gpe(s,a,r)}function AY(e,t,n){let i=t,o=n,r=h.subtract(e,i,fpe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var wtt=new h,Itt=new h;function _pe(e,t,n){let i=e.transformPositionToScaledSpace(t,wtt),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,Itt);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function gpe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var CY=new h;function ype(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,CY),h.normalize(CY,CY))}var Cg=op;function Fr(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Rt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=H.clone(e.color??H.WHITE),this._outlineColor=H.clone(e.outlineColor??H.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??Wr.NONE}var bpe=Fr.SHOW_INDEX=0,Cpe=Fr.POSITION_INDEX=1,Ptt=Fr.COLOR_INDEX=2,Dtt=Fr.OUTLINE_COLOR_INDEX=3,Rtt=Fr.OUTLINE_WIDTH_INDEX=4,Ott=Fr.PIXEL_SIZE_INDEX=5,Mtt=Fr.SCALE_BY_DISTANCE_INDEX=6,Ltt=Fr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Ntt=Fr.DISTANCE_DISPLAY_CONDITION_INDEX=8,Ftt=Fr.DISABLE_DEPTH_DISTANCE_INDEX=9,Btt=Fr.SPLIT_DIRECTION_INDEX=10;Fr.NUMBER_OF_PROPERTIES=11;function tf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Fr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,tf(this,bpe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),tf(this,Cpe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Vt.equals(t,e)||(this._scaleByDistance=Vt.clone(e,t),tf(this,Mtt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Vt.equals(t,e)||(this._translucencyByDistance=Vt.clone(e,t),tf(this,Ltt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,tf(this,Ott))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),tf(this,Ptt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),tf(this,Dtt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,tf(this,Rtt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Rt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Rt.clone(e,this._distanceDisplayCondition),tf(this,Ntt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,tf(this,Ftt))}},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,tf(this,bpe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,tf(this,Btt))}}});Fr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Fr.prototype._getActualPosition=function(){return this._actualPosition};Fr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),tf(this,Cpe)};var xpe=new ie;Fr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(M.multiplyByPoint(n,e,xpe),ji.computeActualEllipsoidPosition(t,xpe))};var Tpe=new ie;Fr._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,ie.fromElements(t.x,t.y,t.z,1,Tpe),Tpe);return ji.worldToWindowCoordinates(n,o,i)};Fr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new V);let i=n.modelMatrix,o=Fr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Fr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Xe),n.x=r,n.y=s,n.width=a,n.height=c,n};Fr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&H.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&H.equals(this._outlineColor,e._outlineColor)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Fr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var zs=Fr;var L0=`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 lF=`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 ktt=zs.SHOW_INDEX,vY=zs.POSITION_INDEX,Ape=zs.COLOR_INDEX,Utt=zs.OUTLINE_COLOR_INDEX,ztt=zs.OUTLINE_WIDTH_INDEX,Vtt=zs.PIXEL_SIZE_INDEX,Epe=zs.SCALE_BY_DISTANCE_INDEX,Spe=zs.TRANSLUCENCY_BY_DISTANCE_INDEX,vpe=zs.DISTANCE_DISPLAY_CONDITION_INDEX,Htt=zs.DISABLE_DEPTH_DISTANCE_INDEX,Gtt=zs.SPLIT_DIRECTION_INDEX,wY=zs.NUMBER_OF_PROPERTIES,Hc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Ed(e){e=e??G.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(wY),this._maxPixelSize=1,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Ro.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Ed.prototype,{length:{get:function(){return IY(this),this._pointPrimitives.length}}});function wpe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Ed.prototype.add=function(e){let t=new zs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Ed.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Ed.prototype.removeAll=function(){wpe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function IY(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}}Ed.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Ed.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Ed.prototype.get=function(e){return IY(this),this._pointPrimitives[e]};Ed.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<wY;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function jtt(e,t,n){return new l_(e,[{index:Hc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[vY]},{index:Hc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[vY]},{index:Hc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Ape]},{index:Hc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Spe]},{index:Hc.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Epe]},{index:Hc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[vpe]}],t)}var EY=new Gn;function Ipe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(re.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(r,EY);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Hc.positionHighAndSize],u=EY.high;c(o,u.x,u.y,u.z,s);let f=n[Hc.positionLowAndOutline],d=EY.low;f(o,d.x,d.y,d.z,a)}var v8=65536,uF=256;function Ppe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=H.floatToByte(r.red),u=H.floatToByte(r.green),f=H.floatToByte(r.blue),d=c*v8+u*uF+f;c=H.floatToByte(a.red),u=H.floatToByte(a.green),f=H.floatToByte(a.blue);let p=c*v8+u*uF+f;c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue);let _=c*v8+u*uF+f,m=H.floatToByte(r.alpha)*v8+H.floatToByte(a.alpha)*uF+H.floatToByte(s.alpha),y=n[Hc.compressedAttribute0];y(o,d,p,_,m)}function Dpe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*uF+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,_=n[Hc.compressedAttribute1];_(o,d,p,r,a)}function Rpe(e,t,n,i){let o=i._index,r=n[Hc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function Ope(e,t,n,i){let o=i._index,r=n[Hc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),r(o,s,a,u,f)}function Wtt(e,t,n,i){Ipe(e,t,n,i),Ppe(e,t,n,i),Dpe(e,t,n,i),Rpe(e,t,n,i),Ope(e,t,n,i)}function SY(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=zs._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):re.expand(s,d,s))}r&&re.fromPoints(a,s)}function qtt(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&SY(e,i,i.length,t,r,!0)):n===ne.MORPHING?SY(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&SY(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function Ytt(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var Xtt=[];Ed.prototype.update=function(e){if(IY(this),!this.show)return;this._maxTotalPointSize=Lt.maximumAliasedPointSize,qtt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<wY;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=jtt(c,n,this._buffersUsage),a=this._vaf.writers;for(let S=0;S<n;++S){let w=this._pointPrimitives[S];w._dirty=!1,Wtt(this,c,a,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=Xtt;S.length=0,(r[vY]||r[ztt]||r[Vtt])&&S.push(Ipe),(r[Ape]||r[Utt])&&S.push(Ppe),(r[ktt]||r[Spe])&&S.push(Dpe),r[Epe]&&S.push(Rpe),(r[vpe]||r[Htt]||r[Gtt])&&S.push(Ope);let w=S.length;if(a=this._vaf.writers,o/n>.1){for(let R=0;R<o;++R){let P=i[R];P._dirty=!1;for(let O=0;O<w;++O)S[O](this,c,a,P)}this._vaf.commit()}else{for(let R=0;R<o;++R){let P=i[R];P._dirty=!1;for(let O=0;O<w;++O)S[O](this,c,a,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=M.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=re.clone(this._baseVolumeWC,this._boundingVolume)):d=re.clone(this._baseVolume2D,this._boundingVolume),Ytt(this,e,d);let _=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,_&&(this._blendOption===Ro.OPAQUE||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:q.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ro.TRANSLUCENT||this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:q.LEQUAL},depthMask:!1,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(_||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Be({sources:[lF]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT&&(y=new Be({defines:["OPAQUE"],sources:[L0]}),this._sp=Xt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Hc}),y=new Be({defines:["TRANSLUCENT"],sources:[L0]}),this._spTranslucent=Xt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Hc})),this._blendOption===Ro.OPAQUE&&(y=new Be({sources:[L0]}),this._sp=Xt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Hc})),this._blendOption===Ro.TRANSLUCENT&&(y=new Be({sources:[L0]}),this._spTranslucent=Xt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Hc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,x,T,C,A=e.commandList;if(u.render||f){let S=this._colorCommands,w=this._blendOption===Ro.OPAQUE,R=this._blendOption===Ro.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,x=b.length,S.length=x;let P=R?x*2:x;for(C=0;C<P;++C){let O=w||R&&C%2===0;T=S[C],l(T)||(T=S[C]=new qe),T.primitiveType=Le.POINTS,T.pass=O||!R?Se.OPAQUE:Se.TRANSLUCENT,T.owner=this;let L=R?Math.floor(C/2):C;T.boundingVolume=d,T.modelMatrix=p,T.shaderProgram=O?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=b[L].va,T.renderState=O?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",A.push(T)}}};Ed.prototype.isDestroyed=function(){return!1};Ed.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(),wpe(this._pointPrimitives),ce(this)};var HS=Ed;var Mpe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],PY=1,fF=8,hF=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!==PY)throw new Error(`Got v${o} data when expected v${PY}.`);let r=Mpe[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=Mpe.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,fF,t),this.coords=new this.ArrayType(this.data,fF+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(fF+s+a+c),this.ids=new this.IndexArrayType(this.data,fF,t),this.coords=new this.ArrayType(this.data,fF+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(PY<<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 RY(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let x=s[2*b],T=s[2*b+1];x>=t&&x<=i&&T>=n&&T<=o&&u.push(r[b])}continue}let _=p+d>>1,m=s[2*_],y=s[2*_+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[_]),(f===0?t<=m:n<=y)&&(c.push(p),c.push(_-1),c.push(1-f)),(f===0?i>=m:o>=y)&&(c.push(_+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)Lpe(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let _=p+d>>1,m=r[2*_],y=r[2*_+1];Lpe(m,y,t,n)<=u&&c.push(o[_]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(_-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(_+1),a.push(d),a.push(1-f))}return c}};function RY(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Npe(e,t,s,i,o,r),RY(e,t,n,i,s-1,1-r),RY(e,t,n,s+1,o,1-r)}function Npe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),_=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+_)),y=Math.min(o,Math.floor(n+(u-f)*p/u+_));Npe(e,t,n,m,y,r)}let s=t[2*n+r],a=i,c=o;for(dF(e,t,i,n),t[2*o+r]>s&&dF(e,t,i,o);a<c;){for(dF(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?dF(e,t,i,c):(c++,dF(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function dF(e,t,n,i){DY(e,n,i),DY(t,2*n,2*i),DY(t,2*n+1,2*i+1)}function DY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Lpe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Wh(e){e=e??G.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 me,this.show=e.show??!0}function Fpe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Ktt=new Xe;function Bpe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=T0.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=po.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=zs.getScreenSpaceBoundingBox(e,t,o)),Fpe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Upe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=T0.getScreenSpaceBoundingBox(s,t,Ktt);Fpe(a,n),o=Xe.union(o,a,o)}return o}function $tt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Upe(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 kpe(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 Upe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function OY(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===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var Ztt=new Xe,Qtt=new Xe,Jtt=new Xe;function ent(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 ep({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Zu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new HS;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],_=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,b=n.camera.positionWC,x=new Cg(y,b),T=[];e._clusterLabels&&OY(i,T,n,x,e),e._clusterBillboards&&OY(o,T,n,x,e),e._clusterPoints&&OY(r,T,n,x,e);let C,A,S,w,R,P,O,L,g,E,v,I;if(T.length>0){let N=new hF(T.length,64,Uint32Array);for(let F=0;F<T.length;++F)N.add(T[F].coord.x,T[F].coord.y);if(N.finish(),m<_)for(S=d.length,C=0;C<S;++C){let F=d[C];if(!x.isPointVisible(F.position))continue;let U=po._computeScreenSpacePosition(M.IDENTITY,F.position,h.ZERO,V.ZERO,n);if(!l(U))continue;let k=1-m/_,z=F.width=F.width*k,B=F.height=F.height*k;z=Math.max(z,F.minimumWidth),B=Math.max(B,F.minimumHeight);let j=U.x-z*.5,W=U.y-B*.5,J=U.x+z,Y=U.y+B;for(R=N.range(j,W,J,Y),P=R.length,E=0,g=[],A=0;A<P;++A)O=R[A],L=T[O],L.clustered||(++E,v=L.collection,I=L.index,g.push(v.get(I).id));if(E>=f)for(kpe(F.position,E,g,e),p.push(F),A=0;A<P;++A)T[R[A]].clustered=!0}for(S=T.length,C=0;C<S;++C){let F=T[C];if(F.clustered)continue;F.clustered=!0,v=F.collection,I=F.index;let U=v.get(I);w=Bpe(U,F.coord,u,e,Ztt);let k=Xe.clone(w,Qtt);R=N.range(w.x,w.y,w.x+w.width,w.y+w.height),P=R.length;let z=h.clone(U.position);for(E=1,g=[U.id],A=0;A<P;++A)if(O=R[A],L=T[O],!L.clustered){let B=L.collection.get(L.index),j=Bpe(B,L.coord,u,e,Jtt);h.add(B.position,z,z),Xe.union(k,j,k),++E,g.push(B.id)}if(E>=f){let B=h.multiplyByScalar(z,1/E,z);for(kpe(B,E,g,e),p.push({position:B,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),A=0;A<P;++A)T[R[A]].clustered=!0}else $tt(U,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Wh.prototype._initialize=function(e){this._scene=e;let t=ent(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Wh.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 LY(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function NY(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Wh.prototype.getLabel=LY("_labelCollection",ep,"_unusedLabelIndices","labelIndex");Wh.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,NY(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};Wh.prototype.getBillboard=LY("_billboardCollection",Zu,"_unusedBillboardIndices","billboardIndex");Wh.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,NY(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};Wh.prototype.getPoint=LY("_pointCollection",HS,"_unusedPointIndices","pointIndex");Wh.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,NY(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function MY(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function tnt(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,MY(e._labelCollection),MY(e._billboardCollection),MY(e._pointCollection))}Wh.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,tnt(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)};Wh.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 nf=Wh;function FY(e){this._name=e,this._clock=void 0,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new fa(this),this._entityCluster=new nf}Object.defineProperties(FY.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){es.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}}});FY.prototype.update=function(e){return!0};var mF=FY;var zpe={};zpe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,_=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*D.TWO_PI,b=Math.cos(y),x=Math.sin(y),T=b*n,C=x*n,A=b*t,S=x*t;u[p+_]=T,u[p+_+1]=C,u[p+_+2]=s,u[p+m]=A,u[p+m+1]=S,u[p+m+2]=r,p+=3,o&&(u[d++]=T,u[d++]=C,u[d++]=s,u[d++]=A,u[d++]=S,u[d++]=r)}return u};var qT=zpe;var BY=new V,nnt=new h,int=new h,ont=new h,rnt=new h;function Ag(e){e=e??G.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??De.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=De.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Ag.packedLength=De.packedLength+5;Ag.pack=function(e,t,n){return n=n??0,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Vpe=new De,GS={vertexFormat:Vpe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Ag.unpack=function(e,t,n){t=t??0;let i=De.unpack(e,t,Vpe);t+=De.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=De.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(GS.length=o,GS.topRadius=r,GS.bottomRadius=s,GS.slices=a,GS.offsetAttribute=c===-1?void 0:c,new Ag(GS))};Ag.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=qT.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,_=o.bitangent?new Float32Array(c*3):void 0,m,y=o.normal||o.tangent||o.bitangent;if(y){let R=o.tangent||o.bitangent,P=0,O=0,L=0,g=Math.atan2(i-n,t),E=nnt;E.z=Math.sin(g);let v=Math.cos(g),I=ont,N=int;for(m=0;m<r;m++){let F=m/r*D.TWO_PI,U=v*Math.cos(F),k=v*Math.sin(F);y&&(E.x=U,E.y=k,R&&(I=h.normalize(h.cross(h.UNIT_Z,E,I),I)),o.normal&&(d[P++]=E.x,d[P++]=E.y,d[P++]=E.z,d[P++]=E.x,d[P++]=E.y,d[P++]=E.z),o.tangent&&(p[O++]=I.x,p[O++]=I.y,p[O++]=I.z,p[O++]=I.x,p[O++]=I.y,p[O++]=I.z),o.bitangent&&(N=h.normalize(h.cross(E,I,N),N),_[L++]=N.x,_[L++]=N.y,_[L++]=N.z,_[L++]=N.x,_[L++]=N.y,_[L++]=N.z))}for(m=0;m<r;m++)o.normal&&(d[P++]=0,d[P++]=0,d[P++]=-1),o.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),o.bitangent&&(_[L++]=0,_[L++]=-1,_[L++]=0);for(m=0;m<r;m++)o.normal&&(d[P++]=0,d[P++]=0,d[P++]=1),o.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),o.bitangent&&(_[L++]=0,_[L++]=1,_[L++]=0)}let b=12*r-12,x=ke.createTypedArray(c,b),T=0,C=0;for(m=0;m<r-1;m++)x[T++]=C,x[T++]=C+2,x[T++]=C+3,x[T++]=C,x[T++]=C+3,x[T++]=C+1,C+=2;for(x[T++]=s-2,x[T++]=0,x[T++]=1,x[T++]=s-2,x[T++]=1,x[T++]=s-1,m=1;m<r-1;m++)x[T++]=s+m+1,x[T++]=s+m,x[T++]=s;for(m=1;m<r-1;m++)x[T++]=a,x[T++]=a+m,x[T++]=a+m+1;let A=0;if(o.st){let R=Math.max(n,i);for(m=0;m<c;m++){let P=h.fromArray(u,m*3,rnt);f[A++]=(P.x+R)/(2*R),f[A++]=(P.y+R)/(2*R)}}let S=new dn;o.position&&(S.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(S.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(S.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(S.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),BY.x=t*.5,BY.y=Math.max(i,n);let w=new re(h.ZERO,V.magnitude(BY));if(l(e._offsetAttribute)){t=u.length;let R=e._offsetAttribute===an.NONE?0:1,P=new Uint8Array(t/3).fill(R);S.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new lt({attributes:S,indices:x,primitiveType:Le.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var kY;Ag.getUnitCylinder=function(){return l(kY)||(kY=Ag.createGeometry(new Ag({topRadius:1,bottomRadius:1,length:1,vertexFormat:De.POSITION_ONLY}))),kY};var pF=Ag;var UY=new V;function jS(e){e=e??G.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"}jS.packedLength=6;jS.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 YT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};jS.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):(YT.length=i,YT.topRadius=o,YT.bottomRadius=r,YT.slices=s,YT.numberOfVerticalLines=a,YT.offsetAttribute=c===-1?void 0:c,new jS(YT))};jS.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=qT.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let y=Math.min(r,o);u=Math.round(o/y),c+=y}let f=ke.createTypedArray(s,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let _=new dn;_.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:a}),UY.x=t*.5,UY.y=Math.max(i,n);let m=new re(h.ZERO,V.magnitude(UY));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===an.NONE?0:1,b=new Uint8Array(t/3).fill(y);_.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new lt({attributes:_,indices:f,primitiveType:Le.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var _F=jS;var Hpe=h.ZERO,Gpe=new h,snt=new h,jpe=new H;function ant(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 of(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new ant(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(of.prototype=Object.create(si.prototype),of.prototype.constructor=of);Object.defineProperties(of.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});of.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,jpe)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Hpe,Gpe))),new It({id:t,geometry:new pF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};of.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,jpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Hpe,Gpe))),new It({id:t,geometry:new _F(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};of.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};of.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||si.prototype._isHidden.call(this,e,t)};of.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};of.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?an.ALL:void 0};of.prototype._onEntityPropertyChanged=C_;of.DynamicGeometryUpdater=WS;function WS(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(WS.prototype=Object.create(ri.prototype),WS.prototype.constructor=WS);WS.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,snt);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ri.prototype._isHidden.call(this,e,t,n)};WS.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,Ke.NONE),o=this._options;o.length=X.getValueOrUndefined(t.length,n),o.topRadius=X.getValueOrUndefined(t.topRadius,n),o.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),o.slices=X.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ke.NONE?an.ALL:void 0};var gF=of;var cnt={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},ts=Object.freeze(cnt);var lnt={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},bo=Object.freeze(lnt);var unt={NONE:0,HOLD:1,EXTRAPOLATE:2},rf=Object.freeze(unt);var Wpe=er(Ru(),1);function fnt(e){let t=new Wpe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Eg=fnt;var dnt=D.factorial;function zY(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=zY(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var w8={type:"Hermite"};w8.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};w8.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(d);for(p[r]=b,s=0;s<d;s++)b[s]=[]}let _=d,m=new Array(_);for(r=0;r<_;r++)m[r]=r;let y=d-1;for(c=0;c<i;c++){for(s=0;s<_;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<_;r++){let b=!1;for(s=0;s<_-r;s++){let x=t[m[s]],T=t[m[s+r]],C;T-x<=0?(f=m[s]*i+i*r+c,C=n[f],p[c][r].push(C/dnt(r))):(C=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(C/(T-x))),b=b||C!==0}b||(y=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=y;r++){let b=zY(e,m,t,a,r,[]);for(c=0;c<i;c++){let x=p[c][r][0];o[c+a*i]+=x*b}}return o};var hnt=[];w8.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let x=0;x<a;x++)s[x]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let x=0;x<o+1;x++)u[f*(o+1)+x]=f;let d=u.length,p=hnt,_=mnt(p,u,t,n,i,o),m=[],y=d*(d+1)/2,b=Math.min(_,r);for(let x=0;x<=b;x++)for(f=x;f<=_;f++){m.length=0;let T=zY(e,u,t,x,f,m),C=Math.floor(f*(1-f)/2)+d*f;for(let A=0;A<i;A++){let S=Math.floor(A*y),w=p[S+C];s[A+x*i]+=w*T}}return s};function mnt(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+d,e[p+s]=i[a];for(let _=1;_<u;_++){let m=0,y=Math.floor(_*(1-_)/2)+u*_,b=!1;for(s=0;s<u-_;s++){let x=n[t[s]],T=n[t[s+_]],C,A;if(T-x<=0)a=t[s]*o*(r+1)+o*_+d,C=i[a],A=C/D.factorial(_),e[p+y+m]=A,m++;else{let S=Math.floor((_-1)*(2-_)/2)+u*(_-1);C=e[p+S+s+1]-e[p+S+s],A=C/(T-x),e[p+y+m]=A,m++}b=b||C!==0}b&&(c=Math.max(c,_))}}return c}var yF=w8;var VY={type:"Lagrange"};VY.getRequiredDataPoints=function(e){return Math.max(e+1,2)};VY.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var bF=VY;var HY={type:"Linear"};HY.getRequiredDataPoints=function(e){return 2};HY.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var XT=HY;function Gc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Gc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Gc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Gc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Gc(e.clock,e.cone,e.magnitude)};Gc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Gc(e.clock,e.cone,1)};Gc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Gc.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};Gc.prototype.equals=function(e){return Gc.equals(this,e)};Gc.prototype.clone=function(e){return Gc.clone(this,e)};Gc.prototype.equalsEpsilon=function(e,t){return Gc.equalsEpsilon(this,e,t)};Gc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var xF=Gc;var SF=er(Ru(),1);var GY;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?GY=function(){return performance.now()}:GY=function(){return Date.now()};var Si=GY;function jY(e){e=e??G.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=$.clone(t):l(n)?t=$.clone(n):l(i)?t=$.addDays(i,-1,new $):t=$.now(),l(n)?n=$.clone(n):n=$.clone(t),l(i)?i=$.clone(i):i=$.addDays(n,1,new $),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??ts.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new me,this.onStop=new me,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Si(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??bo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(jY.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){$.equals(this._currentTime,e)||(this._clockStep===bo.SYSTEM_CLOCK&&(this._clockStep=bo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===bo.SYSTEM_CLOCK&&(this._clockStep=bo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===bo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=$.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===bo.SYSTEM_CLOCK&&(this._clockStep=bo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});jY.prototype.tick=function(){let e=Si(),t=$.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===bo.SYSTEM_CLOCK)t=$.now(t);else{let i=this._multiplier;if(n===bo.TICK_DEPENDENT)t=$.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=$.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===ts.CLAMPED)$.lessThan(t,r)?t=$.clone(r,t):$.greaterThan(t,s)&&(t=$.clone(s,t),this.onStop.raiseEvent(this));else if(o===ts.LOOP_STOP)for($.lessThan(t,r)&&(t=$.clone(r,t));$.greaterThan(t,s);)t=$.addSeconds(r,$.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var qh=jY;function KT(){this._definitionChanged=new me,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(KT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:fl("startTime"),stopTime:fl("stopTime"),currentTime:fl("currentTime"),clockRange:fl("clockRange"),clockStep:fl("clockStep"),multiplier:fl("multiplier")});KT.prototype.clone=function(e){return l(e)||(e=new KT),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};KT.prototype.equals=function(e){return this===e||l(e)&&$.equals(this.startTime,e.startTime)&&$.equals(this.stopTime,e.stopTime)&&$.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};KT.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};KT.prototype.getValue=function(e){return l(e)||(e=new qh),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 Yh=KT;var pnt=H.WHITE,_nt=.1,gnt=new V(8,8),ynt=new V(0,0),bnt=new V(1,1);function qS(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(qS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),cellAlpha:ue("cellAlpha"),lineCount:ue("lineCount"),lineThickness:ue("lineThickness"),lineOffset:ue("lineOffset")});qS.prototype.getType=function(e){return"Grid"};var xnt=new $;qS.prototype.getValue=function(e,t){return l(e)||(e=$.now(xnt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,pnt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,_nt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,gnt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,bnt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,ynt,t.lineOffset),t};qS.prototype.equals=function(e){return this===e||e instanceof qS&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var YS=qS;function XS(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(XS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});XS.prototype.getType=function(e){return"PolylineArrow"};var Tnt=new $;XS.prototype.getValue=function(e,t){return l(e)||(e=$.now(Tnt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};XS.prototype.equals=function(e){return this===e||e instanceof XS&&X.equals(this._color,e._color)};var KS=XS;var Cnt=H.WHITE,Ant=H.TRANSPARENT,Ent=16,Snt=255;function $S(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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($S.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),gapColor:ue("gapColor"),dashLength:ue("dashLength"),dashPattern:ue("dashPattern")});$S.prototype.getType=function(e){return"PolylineDash"};var vnt=new $;$S.prototype.getValue=function(e,t){return l(e)||(e=$.now(vnt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Cnt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,Ant,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,Ent,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,Snt,t.dashPattern),t};$S.prototype.equals=function(e){return this===e||e instanceof $S&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var ZS=$S;var wnt=H.WHITE,Int=.25,Pnt=1;function QS(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(QS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),glowPower:ue("glowPower"),taperPower:ue("taperPower")});QS.prototype.getType=function(e){return"PolylineGlow"};var Dnt=new $;QS.prototype.getValue=function(e,t){return l(e)||(e=$.now(Dnt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,wnt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,Int,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,Pnt,t.taperPower),t};QS.prototype.equals=function(e){return this===e||e instanceof QS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var JS=QS;var Rnt=H.WHITE,Ont=H.BLACK,Mnt=1;function ev(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(ev.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth")});ev.prototype.getType=function(e){return"PolylineOutline"};var Lnt=new $;ev.prototype.getValue=function(e,t){return l(e)||(e=$.now(Lnt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Rnt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,Ont,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,Mnt),t};ev.prototype.equals=function(e){return this===e||e instanceof ev&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var N0=ev;function Sg(e,t){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new Tr,this._referenceFrame=t??Gi.FIXED,this.setValue(e)}Object.defineProperties(Sg.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Nnt=new $;Sg.prototype.getValue=function(e,t){return l(e)||(e=$.now(Nnt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};Sg.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};Sg.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,Sg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Sg.prototype.equals=function(e){return this===e||e instanceof Sg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Sg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var vg=Sg;function F0(e){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new Tr,this.setValue(e)}Object.defineProperties(F0.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Fnt=new $;F0.prototype.getValue=function(e,t){l(e)||(e=$.now(Fnt));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};F0.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,F0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};F0.prototype.equals=function(e){return this===e||e instanceof F0&&X.arrayEquals(this._value,e._value)};F0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var tv=F0;function $T(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(sf.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function sf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new me,e.collectionChanged.addEventListener(sf.prototype._onCollectionChanged,this)}Object.defineProperties(sf.prototype,{isConstant:{get:function(){return X.isConstant($T(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=$T(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 $T(this)}}});sf.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 sf(e,n,i)};var Bnt=new $;sf.prototype.getValue=function(e,t){let n=$T(this);return l(e)||(e=$.now(Bnt)),l(n)?n.getValue(e,t):void 0};sf.prototype.getValueInReferenceFrame=function(e,t,n){let i=$T(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};sf.prototype.getType=function(e){let t=$T(this);return l(t)?t.getType(e):void 0};sf.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};sf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};sf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(sf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=$T(this),l(i)&&this._definitionChanged.raiseEvent(this))};var wg=sf;var knt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-D.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+D.TWO_PI:o}},Sd=knt;var qpe={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 Ype(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 Xpe(e,t){return e instanceof $?e:typeof e=="string"?$.fromIso8601(e):$.addSeconds(t,e,new $)}var WY=[],qY=[];function I8(e,t,n,i,o){let r=0,s,a,c,u,f,d;for(;r<i.length;){f=Xpe(i[r],e),c=Uo(t,f,$.compare);let p=0,_=0;if(c<0){for(c=~c,u=c*o,a=void 0,d=t[c];r<i.length&&(f=Xpe(i[r],e),!(l(a)&&$.compare(a,f)>=0||l(d)&&$.compare(f,d)>=0));){for(WY[p++]=f,r=r+1,s=0;s<o;s++)qY[_++]=i[r],r=r+1;a=f}p>0&&(qY.length=_,Ype(n,u,qY),WY.length=p,Ype(t,c,WY))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function vd(e,t){let n=e;n===Number&&(n=qpe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=qpe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=XT,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 me,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=rf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=rf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(vd.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 Unt=new $;vd.prototype.getValue=function(e,t){l(e)||(e=$.now(Unt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Uo(n,e,$.compare);if(a<0){if(a=~a,a===0){let A=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===rf.NONE||o!==0&&$.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===rf.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===rf.NONE||o!==0&&$.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===rf.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let A=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);A!==this._numberOfPoints&&(this._numberOfPoints=A,c.length=A,u.length=A*d)}let _=this._numberOfPoints-1;if(_<1)return;let m=0,y=i-1;if(y-m+1>=_+1){let A=a-(_/2|0)-1;A<m&&(A=m);let S=A+_;S>y&&(S=y,A=S-_,A<m&&(A=m)),m=A,y=S}let x=y-m+1;for(let A=0;A<x;++A)c[A]=$.secondsDifference(n[m+A],n[y]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,y,u);else{let A=0,S=this._packedLength,w=m*S,R=(y+1)*S;for(;w<R;)u[A]=s[w],w++,A++}let T=$.secondsDifference(e,n[y]),C;if(p===0||!l(f.interpolate))C=f.interpolateOrderZero(T,c,u,d,this._interpolationResult);else{let A=Math.floor(d/(p+1));C=f.interpolate(T,c,u,A,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(C,s,m,y,t):r.unpack(C,0,t)}return r.unpack(s,a*this._packedLength,t)};vd.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))};vd.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)}I8(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};vd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}I8(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};vd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};vd.prototype.addSamplesPackedArray=function(e,t){I8(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};vd.prototype.removeSample=function(e){let t=Uo(this._times,e,$.compare);return t<0?!1:(Kpe(this,t,1),!0)};function Kpe(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)}vd.prototype.removeSamples=function(e){let t=this._times,n=Uo(t,e.start,$.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Uo(t,e.stop,$.compare);i<0?i=~i:e.isStopIncluded&&++i,Kpe(this,n,i-n)};vd.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(!$.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};vd._mergeNewSamples=I8;var af=vd;function wd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new af(h,n),this._definitionChanged=new me,this._referenceFrame=e??Gi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(wd.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 znt=new $;wd.prototype.getValue=function(e,t){return l(e)||(e=$.now(znt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};wd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return hh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};wd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};wd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};wd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};wd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};wd.prototype.removeSample=function(e){return this._property.removeSample(e)};wd.prototype.removeSamples=function(e){this._property.removeSamples(e)};wd.prototype.equals=function(e){return this===e||e instanceof wd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var La=wd;var Vnt={HORIZONTAL:0,VERTICAL:1},Xh=Object.freeze(Vnt);var Hnt=Xh.HORIZONTAL,Gnt=H.WHITE,jnt=H.BLACK,Wnt=0,qnt=1;function nv(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(nv.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ue("orientation"),evenColor:ue("evenColor"),oddColor:ue("oddColor"),offset:ue("offset"),repeat:ue("repeat")});nv.prototype.getType=function(e){return"Stripe"};var Ynt=new $;nv.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ynt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,Hnt)===Xh.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,Gnt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,jnt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,Wnt),t.repeat=X.getValueOrDefault(this._repeat,e,qnt),t};nv.prototype.equals=function(e){return this===e||e instanceof nv&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var iv=nv;function B0(e){this._definitionChanged=new me,this._intervals=new Jr,this._intervals.changedEvent.addEventListener(B0.prototype._intervalsChanged,this),this._referenceFrame=e??Gi.FIXED}Object.defineProperties(B0.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 Xnt=new $;B0.prototype.getValue=function(e,t){return l(e)||(e=$.now(Xnt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};B0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return hh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};B0.prototype.equals=function(e){return this===e||e instanceof B0&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};B0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ig=B0;function ZT(){this._definitionChanged=new me,this._intervals=new Jr,this._intervals.changedEvent.addEventListener(ZT.prototype._intervalsChanged,this)}Object.defineProperties(ZT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Knt=new $;ZT.prototype.getValue=function(e,t){l(e)||(e=$.now(Knt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};ZT.prototype.equals=function(e){return this===e||e instanceof ZT&&this._intervals.equals(e._intervals,X.equals)};ZT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Pg=ZT;function ov(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new me,this._normalize=t??!0,this.position=e}Object.defineProperties(ov.prototype,{isConstant:{get:function(){return X.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 $nt=new h,$pe=new h,Zpe=new $,Znt=new $,YY=1/60;ov.prototype.getValue=function(e,t){return this._getValue(e,t)};ov.prototype._getValue=function(e,t,n){l(e)||(e=$.now(Znt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,$nt),r=i.getValue($.addSeconds(e,YY,Zpe),$pe);if(!l(o)||!l(r)&&(r=o,o=i.getValue($.addSeconds(e,-YY,Zpe),$pe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,YY,t)};ov.prototype.equals=function(e){return this===e||e instanceof ov&&X.equals(this._position,e._position)};var Dg=ov;function TF(e,t){this._velocityVectorProperty=new Dg(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new me,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(TF.prototype,{isConstant:{get:function(){return X.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 Qpe=new h,Qnt=new h,Jpe=new Z,Jnt=new $;TF.prototype.getValue=function(e,t){l(e)||(e=$.now(Jnt));let n=this._velocityVectorProperty._getValue(e,Qnt,Qpe);if(l(n))return At.rotationMatrixFromPositionVelocity(Qpe,n,this._ellipsoid,Jpe),Pe.fromRotationMatrix(Jpe,t)};TF.prototype.equals=function(e){return this===e||e instanceof TF&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var CF=TF;var Rg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Rg.validate=function(e){return e===Rg.COMPLETE||e===Rg.BELOW_ELLIPSOID_HORIZON||e===Rg.ABOVE_ELLIPSOID_HORIZON};Rg.toString=function(e){switch(e){case Rg.COMPLETE:return"COMPLETE";case Rg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Rg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var rv=Rg;function k0(){}k0.packedLength=h.packedLength;k0.unpack=h.unpack;k0.pack=h.pack;var XY;function AF(e,t){return t[0]==="#"&&(t=XY+t),wg.fromString(e,t)}function e_e(e,t,n){if(l(n.reference))return AF(t,n.reference);if(l(n.velocityReference)){let i=AF(t,n.velocityReference);switch(e){case h:case k0:return new Dg(i,e===k0);case Pe:return new CF(i)}}throw new se(`${JSON.stringify(n)} is not valid CZML.`)}function eit(e,t){return new gh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Yi=new h,Pl=new xF,jc=new fe,QT=new En,P8=new Pe;function tit(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===H.packedLength)return[H.byteToFloat(n[0]),H.byteToFloat(n[1]),H.byteToFloat(n[2]),H.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=H.byteToFloat(n[o+1]),t[o+2]=H.byteToFloat(n[o+2]),t[o+3]=H.byteToFloat(n[o+3]),t[o+4]=H.byteToFloat(n[o+4]);return t}function t_e(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):Ee.createIfNeeded(n)}function nit(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ae.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.toRadians(n[o+1]),t[o+2]=D.toRadians(n[o+2]),t[o+3]=D.toRadians(n[o+3]),t[o+4]=D.toRadians(n[o+4]);return t}function iit(e){let t=e.length;if(Pl.magnitude=1,t===2)return Pl.clock=e[0],Pl.cone=e[1],h.fromSpherical(Pl,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],Pl.clock=e[i+1],Pl.cone=e[i+2],h.fromSpherical(Pl,Yi),n[o+1]=Yi.x,n[o+2]=Yi.y,n[o+3]=Yi.z;return n}function oit(e){let t=e.length;if(t===3)return Pl.clock=e[0],Pl.cone=e[1],Pl.magnitude=e[2],h.fromSpherical(Pl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Pl.clock=e[i+1],Pl.cone=e[i+2],Pl.magnitude=e[i+3],h.fromSpherical(Pl,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function rit(e){let t=e.length;if(t===3)return jc.longitude=e[0],jc.latitude=e[1],jc.height=e[2],te.default.cartographicToCartesian(jc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],jc.longitude=e[i+1],jc.latitude=e[i+2],jc.height=e[i+3],te.default.cartographicToCartesian(jc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function sit(e){let t=e.length;if(t===3)return jc.longitude=D.toRadians(e[0]),jc.latitude=D.toRadians(e[1]),jc.height=e[2],te.default.cartographicToCartesian(jc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],jc.longitude=D.toRadians(e[i+1]),jc.latitude=D.toRadians(e[i+2]),jc.height=e[i+3],te.default.cartographicToCartesian(jc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function KY(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 iit(o);let r=e.spherical;if(l(r))return oit(r);let s=e.cartographicRadians;if(l(s))return rit(s);let a=e.cartographicDegrees;if(l(a))return sit(a);throw new se(`${JSON.stringify(e)} is not a valid CZML interval.`)}function n_e(e,t){h.unpack(e,t,Yi),h.normalize(Yi,Yi),h.pack(Yi,e,t)}function ait(e){let t=KY(e);if(t.length===3)return n_e(t,0),t;for(let n=1;n<t.length;n+=4)n_e(t,n);return t}function i_e(e,t){Pe.unpack(e,t,P8),Pe.normalize(P8,P8),Pe.pack(P8,e,t)}function cit(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return i_e(t,0),t;for(let n=1;n<t.length;n+=5)i_e(t,n)}return t}function o_e(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Xe:e.hasOwnProperty("cartesian2")?V:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?k0:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?H:e.hasOwnProperty("arcType")?tn:e.hasOwnProperty("classificationType")?zn:e.hasOwnProperty("colorBlendMode")?Lc:e.hasOwnProperty("cornerType")?Bi:e.hasOwnProperty("heightReference")?Ke:e.hasOwnProperty("horizontalOrigin")?Ci:e.hasOwnProperty("date")?$:e.hasOwnProperty("labelStyle")?$o:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Vt:e.hasOwnProperty("distanceDisplayCondition")?Rt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Pe:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Xh:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ae:e.hasOwnProperty("uri")?SF.default:e.hasOwnProperty("verticalOrigin")?Fn:Object}function lit(e,t,n){switch(e){case tn:return tn[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Xe:return t.boundingRectangle;case V:return t.cartesian2;case h:return KY(t);case k0:return ait(t);case H:return tit(t);case zn:return zn[t.classificationType??t];case Lc:return Lc[t.colorBlendMode??t];case Bi:return Bi[t.cornerType??t];case Ke:return Ke[t.heightReference??t];case Ci:return Ci[t.horizontalOrigin??t];case Image:return t_e(t,n);case $:return $.fromIso8601(t.date??t);case $o:return $o[t.labelStyle??t];case Number:return t.number??t;case Vt:return t.nearFarScalar;case Rt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Pe:return cit(t);case Sd:return t.number??t;case rv:return rv[t.portionToDisplay??t];case xn:return xn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Xh:return Xh[t.stripeOrientation??t];case ae:return nit(t);case SF.default:return t_e(t,n);case Fn:return Fn[t.verticalOrigin??t];default:throw new se(`Unknown CzmlDataSource interval type: ${e}`)}}var uit={HERMITE:yF,LAGRANGE:bF,LINEAR:XT};function D8(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:uit[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=rf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=rf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var r_e={iso8601:void 0};function Cr(e){if(l(e))return r_e.iso8601=e,En.fromIso8601(r_e)}function $Y(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function s_e(e){let t=new Vc;return t.intervals.addInterval($Y(e)),t}function a_e(e){let t=new Oa(e.referenceFrame);return t.intervals.addInterval($Y(e)),t}function R8(e,t,n,i,o,r,s){let a=Cr(i.interval);l(o)&&(l(a)?a=En.intersect(a,o,QT):a=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return y_e(t[n],a)}let _=!1;if(d){if(u=lit(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,_=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Sd;if(!_&&!p){d?t[n]=new Qn(m?e.unpack(u,0):u):t[n]=e_e(e,s,i);return}let y=t[n],b,x=i.epoch;if(l(x)&&(b=$.fromIso8601(x)),_&&!p){y instanceof af||(t[n]=y=new af(e)),y.addSamplesPackedArray(u,b),D8(i,y);return}let T;if(!_&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=e_e(e,s,i),l(y)||(t[n]=y=d?new Pg:new Vc),d&&y instanceof Pg?y.intervals.addInterval(a):y instanceof Vc?(d&&(a.data=new Qn(a.data)),y.intervals.addInterval(a)):(t[n]=y=s_e(y),d&&(a.data=new Qn(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Vc),y instanceof Vc||(t[n]=y=s_e(y));let C=y.intervals;T=C.findInterval(a),(!l(T)||!(T.data instanceof af))&&(T=a.clone(),T.data=new af(e),C.addInterval(T)),T.data.addSamplesPackedArray(u,b),D8(i,T.data)}function y_e(e,t){if(e instanceof af){e.removeSamples(t);return}else if(e instanceof Pg){e.intervals.removeInterval(t);return}else if(e instanceof Vc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,QT);o.isEmpty||y_e(o.data,t)}n.removeInterval(t);return}}function _e(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)R8(e,t,n,i[a],o,r,s);else R8(e,t,n,i,o,r,s)}function c_e(e,t,n,i,o,r){let s=Cr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,QT):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return b_e(e[t],s)}let _,m=!1;if(d&&(l(n.referenceFrame)&&(_=Gi[n.referenceFrame]),_=_??Gi.FIXED,u=KY(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new ul(h.unpack(u),_):e[t]=AF(r,n.reference);return}let y=e[t],b,x=n.epoch;if(l(x)&&(b=$.fromIso8601(x)),m&&!p){(!(y instanceof La)||l(_)&&y.referenceFrame!==_)&&(e[t]=y=new La(_,a)),y.addSamplesPackedArray(u,b),D8(n,y);return}let T;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=AF(r,n.reference),l(y)||(d?y=new Ig(_):y=new Oa(_),e[t]=y),d&&y instanceof Ig&&l(_)&&y.referenceFrame===_?y.intervals.addInterval(s):y instanceof Oa?(d&&(s.data=new ul(s.data,_)),y.intervals.addInterval(s)):(e[t]=y=a_e(y),d&&(s.data=new ul(s.data,_)),y.intervals.addInterval(s));return}l(y)?y instanceof Oa||(e[t]=y=a_e(y)):e[t]=y=new Oa(_);let C=y.intervals;T=C.findInterval(s),(!l(T)||!(T.data instanceof La)||l(_)&&T.data.referenceFrame!==_)&&(T=s.clone(),T.data=new La(_,a),C.addInterval(T)),T.data.addSamplesPackedArray(u,b),D8(n,T.data)}function b_e(e,t){if(e instanceof La){e.removeSamples(t);return}else if(e instanceof Ig){e.intervals.removeInterval(t);return}else if(e instanceof Oa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,QT);o.isEmpty||b_e(o.data,t)}n.removeInterval(t);return}}function x_e(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)c_e(e,t,n[s],i,o,r);else c_e(e,t,n,i,o,r)}function l_e(e,t,n,i){l(n.references)?O8(e,t,n.references,n.interval,i,tv,Vc):(l(n.cartesian2)?n.array=V.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=V.unpackArray(n.cartesian)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function u_e(e,t,n,i,o,r){let s=Cr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,QT):s=i);let a=e[t],c,u;if(l(s)){a instanceof BS||(a=new BS,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Wt||(c=new Wt),f=n.solidColor,_e(H,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof YS||(c=new YS),f=n.grid,_e(H,c,"color",f.color,void 0,o,r),_e(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),_e(V,c,"lineCount",f.lineCount,void 0,o,r),_e(V,c,"lineThickness",f.lineThickness,void 0,o,r),_e(V,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Vy||(c=new Vy),f=n.image,_e(Image,c,"image",f.image,void 0,o,r),_e(V,c,"repeat",f.repeat,void 0,o,r),_e(H,c,"color",f.color,void 0,o,r),_e(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof iv||(c=new iv),f=n.stripe,_e(Xh,c,"orientation",f.orientation,void 0,o,r),_e(H,c,"evenColor",f.evenColor,void 0,o,r),_e(H,c,"oddColor",f.oddColor,void 0,o,r),_e(Number,c,"offset",f.offset,void 0,o,r),_e(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof N0||(c=new N0),f=n.polylineOutline,_e(H,c,"color",f.color,void 0,o,r),_e(H,c,"outlineColor",f.outlineColor,void 0,o,r),_e(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof JS||(c=new JS),f=n.polylineGlow,_e(H,c,"color",f.color,void 0,o,r),_e(Number,c,"glowPower",f.glowPower,void 0,o,r),_e(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof KS||(c=new KS),f=n.polylineArrow,_e(H,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof ZS||(c=new ZS),f=n.polylineDash,_e(H,c,"color",f.color,void 0,void 0,r),_e(H,c,"gapColor",f.gapColor,void 0,void 0,r),_e(Number,c,"dashLength",f.dashLength,void 0,o,r),_e(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof NS||(c=new NS),f=n.checkerboard,_e(H,c,"evenColor",f.evenColor,void 0,o,r),_e(H,c,"oddColor",f.oddColor,void 0,o,r),_e(V,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function cf(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)u_e(e,t,n[s],i,o,r);else u_e(e,t,n,i,o,r)}function fit(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function dit(e,t,n,i){let o=t.description;l(o)&&_e(String,e,"description",o,void 0,i,n)}function hit(e,t,n,i){let o=t.position;l(o)&&x_e(e,"position",o,void 0,i,n)}function mit(e,t,n,i){let o=t.viewFrom;l(o)&&_e(h,e,"viewFrom",o,void 0,i,n)}function pit(e,t,n,i){let o=t.orientation;l(o)&&_e(Pe,e,"orientation",o,void 0,i,n)}function _it(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new dl);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)R8(o_e(s[a]),e.properties,r,s[a],void 0,i,n);else R8(o_e(s),e.properties,r,s,void 0,i,n)}}}function O8(e,t,n,i,o,r,s){let a=n.map(function(c){return AF(o,c)});if(l(i)){i=Cr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval($Y(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function f_e(e,t,n,i){let o=n.references;l(o)?O8(e,t,o,n.interval,i,tv,Vc):_e(Array,e,t,n,void 0,void 0,i)}function d_e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)f_e(e,t,n[o],i);else f_e(e,t,n,i)}function h_e(e,t,n,i){let o=n.references;l(o)?O8(e,t,o,n.interval,i,vg,Oa):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function vF(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)h_e(e,t,n[o],i);else h_e(e,t,n,i)}function git(e){return h.unpackArray(e)}function yit(e){return h.fromRadiansArrayHeights(e,te.default)}function bit(e){return h.fromDegreesArrayHeights(e,te.default)}function m_e(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return O8(a,"positions",s,n.interval,i,vg,Oa),a.positions});e[t]=new vg(r)}else l(n.cartesian)?n.array=n.cartesian.map(git):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(yit):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(bit)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i)}function xit(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)m_e(e,t,n[o],i);else m_e(e,t,n,i)}function Tit(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)l_e(e,t,n[o],i);else l_e(e,t,n,i)}function Cit(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 Jr),r.addInterval(Cr(o[s]));else r=new Jr,r.addInterval(Cr(o));e.availability=r}function Ait(e,t,n,i,o){l(t)&&_e(k0,e,"alignedAxis",t,n,i,o)}function Eit(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Cr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new vc),_e(Boolean,s,"show",o.show,r,i,n),_e(Image,s,"image",o.image,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(V,s,"pixelOffset",o.pixelOffset,r,i,n),_e(h,s,"eyeOffset",o.eyeOffset,r,i,n),_e(Ci,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(Sd,s,"rotation",o.rotation,r,i,n),Ait(s,o.alignedAxis,r,i,n),_e(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Xe,s,"imageSubRegion",o.imageSubRegion,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Sit(e,t,n,i){let o=t.box;if(!l(o))return;let r=Cr(o.interval),s=e.box;l(s)||(e.box=s=new Dx),_e(Boolean,s,"show",o.show,r,i,n),_e(h,s,"dimensions",o.dimensions,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vit(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Cr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Ox),_e(Boolean,s,"show",o.show,r,i,n),vF(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Bi,s,"cornerType",o.cornerType,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function wit(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Cr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Mx),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"length",o.length,r,i,n),_e(Number,s,"topRadius",o.topRadius,r,i,n),_e(Number,s,"bottomRadius",o.bottomRadius,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Number,s,"slices",o.slices,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Iit(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 se("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new se("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 Pit(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Cr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Lx),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),_e(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Sd,s,"rotation",o.rotation,r,i,n),_e(Sd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Dit(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Cr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Nx),_e(Boolean,s,"show",o.show,r,i,n),_e(h,s,"radii",o.radii,r,i,n),_e(h,s,"innerRadii",o.innerRadii,r,i,n),_e(Number,s,"minimumClock",o.minimumClock,r,i,n),_e(Number,s,"maximumClock",o.maximumClock,r,i,n),_e(Number,s,"minimumCone",o.minimumCone,r,i,n),_e(Number,s,"maximumCone",o.maximumCone,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"stackPartitions",o.stackPartitions,r,i,n),_e(Number,s,"slicePartitions",o.slicePartitions,r,i,n),_e(Number,s,"subdivisions",o.subdivisions,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Rit(e,t,n,i){let o=t.label;if(!l(o))return;let r=Cr(o.interval),s=e.label;l(s)||(e.label=s=new mh),_e(Boolean,s,"show",o.show,r,i,n),_e(String,s,"text",o.text,r,i,n),_e(String,s,"font",o.font,r,i,n),_e($o,s,"style",o.style,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Boolean,s,"showBackground",o.showBackground,r,i,n),_e(H,s,"backgroundColor",o.backgroundColor,r,i,n),_e(V,s,"backgroundPadding",o.backgroundPadding,r,i,n),_e(V,s,"pixelOffset",o.pixelOffset,r,i,n),_e(h,s,"eyeOffset",o.eyeOffset,r,i,n),_e(Ci,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"fillColor",o.fillColor,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Oit(e,t,n,i){let o=t.model;if(!l(o))return;let r=Cr(o.interval),s=e.model;l(s)||(e.model=s=new b_),_e(Boolean,s,"show",o.show,r,i,n),_e(SF.default,s,"uri",o.gltf,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),_e(Number,s,"maximumScale",o.maximumScale,r,i,n),_e(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),_e(Boolean,s,"runAnimations",o.runAnimations,r,i,n),_e(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"silhouetteColor",o.silhouetteColor,r,i,n),_e(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(Lc,s,"colorBlendMode",o.colorBlendMode,r,i,n),_e(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)p_e(s,u[a],r,i,n);else p_e(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)__e(s,f[a],r,i,n);else __e(s,f,r,i,n)}function p_e(e,t,n,i,o){let r=Cr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,QT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new dl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Fx),_e(h,p,"translation",d.translation,r,i,o),_e(Pe,p,"rotation",d.rotation,r,i,o),_e(h,p,"scale",d.scale,r,i,o)}}function __e(e,t,n,i,o){let r=Cr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,QT):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new dl),s.hasProperty(f)||s.addProperty(f),_e(Number,s,f,d,r,i,o))}}function Mit(e,t,n,i){let o=t.path;if(!l(o))return;let r=Cr(o.interval),s=e.path;l(s)||(e.path=s=new x_),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"leadTime",o.leadTime,r,i,n),_e(Number,s,"trailTime",o.trailTime,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"resolution",o.resolution,r,i,n),cf(s,"material",o.material,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Lit(e,t,n,i){let o=t.point;if(!l(o))return;let r=Cr(o.interval),s=e.point;l(s)||(e.point=s=new kx),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"pixelSize",o.pixelSize,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function EF(e){this.polygon=e,this._definitionChanged=new me}Object.defineProperties(EF.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}}});EF.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 Ja(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Ja(n,i)};EF.prototype.equals=function(e){return this===e||e instanceof EF&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function Nit(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Cr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new ph),_e(Boolean,s,"show",o.show,r,i,n),vF(s,"_positions",o.positions,n),xit(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new EF(s)),_e(Number,s,"height",o.height,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Sd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),_e(Boolean,s,"closeTop",o.closeTop,r,i,n),_e(Boolean,s,"closeBottom",o.closeBottom,r,i,n),_e(tn,s,"arcType",o.arcType,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Fit(e){return e?tn.GEODESIC:tn.NONE}function Bit(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Cr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Pc),_e(Boolean,s,"show",o.show,r,i,n),vF(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),cf(s,"material",o.material,r,i,n),cf(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),_e(tn,s,"arcType",o.arcType,r,i,n),_e(Boolean,s,"clampToGround",o.clampToGround,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};_e(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=eit(a.followSurface,Fit)}}function kit(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Cr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Ux),vF(s,"positions",o.positions,n),Tit(s,"shape",o.shape,n),_e(Boolean,s,"show",o.show,r,i,n),_e(Bi,s,"cornerType",o.cornerType,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Uit(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Cr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new _h),_e(Boolean,s,"show",o.show,r,i,n),_e(ae,s,"coordinates",o.coordinates,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ke,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ke,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Sd,s,"rotation",o.rotation,r,i,n),_e(Sd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function zit(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Cr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new Bx),_e(Boolean,s,"show",o.show,r,i,n),_e(SF.default,s,"uri",o.uri,r,i,n),_e(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Vit(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Cr(o.interval),s=e.wall;l(s)||(e.wall=s=new T_),_e(Boolean,s,"show",o.show,r,i,n),vF(s,"positions",o.positions,n),d_e(s,"minimumHeights",o.minimumHeights,n),d_e(s,"maximumHeights",o.maximumHeights,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),cf(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Rt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function g_e(e,t,n,i,o){let r=e.id;if(l(r)||(r=Ln()),XY=r,!l(o._version)&&r!=="document")throw new se("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")Iit(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)}XY=void 0}function Hit(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=$.secondsDifference(s,r),c=Math.round(a/120);return t=new Yh,t.startTime=$.clone(r),t.stopTime=$.clone(s),t.clockRange=ts.LOOP_STOP,t.multiplier=c,t.currentTime=$.clone(r),t.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Yh,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=ts.LOOP_STOP,t.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Cr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=$.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=ts[n.range]??ts.LOOP_STOP),l(n.step)&&(t.clockStep=bo[n.step]??bo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function T_e(e,t,n,i){n=n??G.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new _t(s)),e._credit=s,typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Ee.createIfNeeded(r),es.setLoading(e,!0),Promise.resolve(o).then(function(a){return Git(e,a,r,i)}).catch(function(a){return es.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function Git(e,t,n,i){es.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new C_e,o.removeAll()),Is._processCzml(t,o,n,void 0,e);let r=Hit(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=Eg(n.getUrlComponent()),r=!0),es.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function C_e(){this.name=void 0,this.clock=void 0}function Is(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._clock=void 0,this._documentPacket=new C_e,this._version=void 0,this._entityCollection=new fa(this),this._entityCluster=new nf,this._credit=void 0,this._resourceCredits=[]}Is.load=function(e,t){return new Is().load(e,t)};Object.defineProperties(Is.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}}});Is.updaters=[Eit,Sit,vit,wit,Pit,Dit,Rit,Oit,fit,dit,Mit,Lit,Nit,Bit,kit,_it,Uit,hit,zit,mit,Vit,pit,Cit];Is.registerUpdater=function(e){Is.updaters.includes(e)||Is.updaters.push(e)};Is.unregisterUpdater=function(e){if(Is.updaters.includes(e)){let t=Is.updaters.indexOf(e);Is.updaters.splice(t,1)}};Is.prototype.process=function(e,t){return T_e(this,e,t,!1)};Is.prototype.load=function(e,t){return T_e(this,e,t,!0)};Is.prototype.update=function(e){return!0};Is.processPacketData=_e;Is.processPositionPacketData=x_e;Is.processMaterialPacketData=cf;Is._processCzml=function(e,t,n,i,o){if(i=i??Is.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)g_e(e[r],t,i,n,o);else g_e(e,t,i,n,o)};var wF=Is;function Dl(){this._dataSources=[],this._dataSourceAdded=new me,this._dataSourceRemoved=new me,this._dataSourceMoved=new me}Object.defineProperties(Dl.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}}});Dl.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})};Dl.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};Dl.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=[]};Dl.prototype.contains=function(e){return this.indexOf(e)!==-1};Dl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Dl.prototype.get=function(e){return this._dataSources[e]};Dl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function M8(e,t){return e.indexOf(t)}function A_e(e,t,n){let i=e._dataSources,o=i.length-1;if(t=D.clamp(t,0,o),n=D.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Dl.prototype.raise=function(e){let t=M8(this._dataSources,e);A_e(this,t,t+1)};Dl.prototype.lower=function(e){let t=M8(this._dataSources,e);A_e(this,t,t-1)};Dl.prototype.raiseToTop=function(e){let t=M8(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))};Dl.prototype.lowerToBottom=function(e){let t=M8(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Dl.prototype.isDestroyed=function(){return!1};Dl.prototype.destroy=function(){return this.removeAll(!0),ce(this)};var IF=Dl;function Na(e){e=e??G.EMPTY_OBJECT,this._primitives=[],this._guid=Ln(),this._primitiveAdded=new me,this._primitiveRemoved=new me,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(Na.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Na.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};Na.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};Na.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Na.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=[]};Na.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function L8(e,t){return e._primitives.indexOf(t)}Na.prototype.raise=function(e){if(l(e)){let t=L8(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Na.prototype.raiseToTop=function(e){if(l(e)){let t=L8(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Na.prototype.lower=function(e){if(l(e)){let t=L8(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Na.prototype.lowerToBottom=function(e){if(l(e)){let t=L8(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Na.prototype.get=function(e){return this._primitives[e]};Na.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Na.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)}};Na.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)}};Na.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)}};Na.prototype.isDestroyed=function(){return!1};Na.prototype.destroy=function(){return this.removeAll(),ce(this)};var Rl=Na;function rp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(rp.prototype,{length:{get:function(){return this._length}}});rp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Rl({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};rp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};rp.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};rp.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};rp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};rp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};rp.prototype.isDestroyed=function(){return!1};rp.prototype.destroy=function(){return this.removeAll(),ce(this)};var PF=rp;function sv(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new wt}sv.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};sv.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};sv.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};sv.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};sv.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var JT=sv;var QY={},N8=new h,E_e=new h,S_e=new Pe,v_e=new Z;function av(e,t,n,i,o,r,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),N8),h.multiplyByScalar(n,Math.sin(f),E_e),h.add(N8,E_e,N8);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*d+o*p)/a;return Pe.fromAxisAngle(N8,m,S_e),Z.fromQuaternion(S_e,v_e),Z.multiplyByVector(v_e,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var w_e=new h,I_e=new h,ZY=new h,jit=new h;QY.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,_=h.fromArray(e,f,w_e);i.scaleToGeodeticSurface(_,_);let m=h.clone(_,I_e),y=i.geodeticSurfaceNormal(_,jit),b=h.multiplyByScalar(y,o,ZY);h.add(_,b,_),n&&(h.multiplyByScalar(y,r,b),h.add(m,b,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=_.x,a[d]=_.y,a[p]=_.z}return a};var Wit=new h,qit=new h,Yit=new h;QY.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,d=h.magnitude(s),p=h.normalize(s,Wit),_=h.cross(h.UNIT_Z,s,qit);_=h.normalize(_,_);let m=h.cross(p,_,Yit),y=1+Math.ceil(D.PI_OVER_TWO/a),b=D.PI_OVER_TWO/(y-1),x=D.PI_OVER_TWO-y*b;x<0&&(y-=Math.ceil(Math.abs(x)/b));let T=2*(y*(y+2)),C=t?new Array(T*3):void 0,A=0,S=w_e,w=I_e,R=y*4*3,P=R-1,O=0,L=n?new Array(R):void 0,g,E,v,I,N;for(x=D.PI_OVER_TWO,S=av(x,r,m,_,c,f,u,d,p,S),t&&(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x),x=D.PI_OVER_TWO-b,g=1;g<y+1;++g){if(S=av(x,r,m,_,c,f,u,d,p,S),w=av(Math.PI-x,r,m,_,c,f,u,d,p,w),t){for(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,v=2*g+2,E=1;E<v-1;++E)I=E/(v-1),N=h.lerp(S,w,I,ZY),C[A++]=N.x,C[A++]=N.y,C[A++]=N.z;C[A++]=w.x,C[A++]=w.y,C[A++]=w.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[O++]=w.x,L[O++]=w.y,L[O++]=w.z),x=D.PI_OVER_TWO-(g+1)*b}for(g=y;g>1;--g){if(x=D.PI_OVER_TWO-(g-1)*b,S=av(-x,r,m,_,c,f,u,d,p,S),w=av(x+Math.PI,r,m,_,c,f,u,d,p,w),t){for(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,v=2*(g-1)+2,E=1;E<v-1;++E)I=E/(v-1),N=h.lerp(S,w,I,ZY),C[A++]=N.x,C[A++]=N.y,C[A++]=N.z;C[A++]=w.x,C[A++]=w.y,C[A++]=w.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[O++]=w.x,L[O++]=w.y,L[O++]=w.z)}x=D.PI_OVER_TWO,S=av(-x,r,m,_,c,f,u,d,p,S);let F={};return t&&(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,F.positions=C,F.numPts=y),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,F.outerPositions=L),F};var mu=QY;var cv=new h,JY=new h,eX=new h,P_e=new h,Vs=new V,D_e=new Z,Xit=new Z,tX=new Pe,R_e=new h,O_e=new h,M_e=new h,k8=new fe,L_e=new h,N_e=new V,F_e=new V;function B_e(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,_=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,b=0,x=R_e,T=O_e,C=M_e,A=new Mi(a),S=A.project(a.cartesianToCartographic(o,k8),L_e),w=a.scaleToGeodeticSurface(o,cv);a.geodeticSurfaceNormal(w,w);let R=D_e,P=Xit;if(c!==0){let N=Pe.fromAxisAngle(w,c,tX);R=Z.fromQuaternion(N,R),N=Pe.fromAxisAngle(w,-c,tX),P=Z.fromQuaternion(N,P)}else R=Z.clone(Z.IDENTITY,R),P=Z.clone(Z.IDENTITY,P);let O=V.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,N_e),L=V.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,F_e),g=e.length,E=n?g:0,v=E/3*2;for(let N=0;N<g;N+=3){let F=N+1,U=N+2,k=h.fromArray(e,N,cv);if(i.st){let z=Z.multiplyByVector(R,k,JY),B=A.project(a.cartesianToCartographic(z,k8),eX);h.subtract(B,S,B),Vs.x=(B.x+r)/(2*r),Vs.y=(B.y+s)/(2*s),O.x=Math.min(Vs.x,O.x),O.y=Math.min(Vs.y,O.y),L.x=Math.max(Vs.x,L.x),L.y=Math.max(Vs.y,L.y),n&&(d[b+v]=Vs.x,d[b+1+v]=Vs.y),d[b++]=Vs.x,d[b++]=Vs.y}(i.normal||i.tangent||i.bitangent||f)&&(x=a.geodeticSurfaceNormal(k,x),f&&(y[N+E]=-x.x,y[F+E]=-x.y,y[U+E]=-x.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=h.normalize(h.cross(h.UNIT_Z,x,T),T),Z.multiplyByVector(P,T,T)),i.normal&&(p[N]=x.x,p[F]=x.y,p[U]=x.z,n&&(p[N+E]=-x.x,p[F+E]=-x.y,p[U+E]=-x.z)),i.tangent&&(_[N]=T.x,_[F]=T.y,_[U]=T.z,n&&(_[N+E]=-T.x,_[F+E]=-T.y,_[U+E]=-T.z)),i.bitangent&&(C=h.normalize(h.cross(x,T,C),C),m[N]=C.x,m[F]=C.y,m[U]=C.z,n&&(m[N+E]=C.x,m[F+E]=C.y,m[U+E]=C.z))))}if(i.st){g=d.length;for(let N=0;N<g;N+=2)d[N]=(d[N]-O.x)/(L.x-O.x),d[N+1]=(d[N+1]-O.y)/(L.y-O.y)}let I=new dn;if(i.position){let N=mu.raisePositionsToHeight(e,t,n);I.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),i.bitangent&&(I.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===an.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===an.NONE?0:1;N=N.fill(F)}I.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function k_e(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 eC=new h;function Kit(e){let t=e.center;eC=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,eC),e.height,eC),eC=h.add(t,eC,eC);let n=new re(eC,e.semiMajorAxis),i=mu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=B_e(o,e,!1),a=k_e(r);return a=ke.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function $it(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,_=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,x=b?new Float32Array(f*3):void 0,T=0,C=R_e,A=O_e,S=M_e,w=new Mi(s),R=w.project(s.cartesianToCartographic(i,k8),L_e),P=s.scaleToGeodeticSurface(i,cv);s.geodeticSurfaceNormal(P,P);let O=Pe.fromAxisAngle(P,u,tX),L=Z.fromQuaternion(O,D_e),g=V.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,N_e),E=V.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,F_e),v=e.length,I=v/3*2;for(let F=0;F<v;F+=3){let U=F+1,k=F+2,z=h.fromArray(e,F,cv),B;if(n.st){let W=Z.multiplyByVector(L,z,JY),J=w.project(s.cartesianToCartographic(W,k8),eX);h.subtract(J,R,J),Vs.x=(J.x+o)/(2*o),Vs.y=(J.y+r)/(2*r),g.x=Math.min(Vs.x,g.x),g.y=Math.min(Vs.y,g.y),E.x=Math.max(Vs.x,E.x),E.y=Math.max(Vs.y,E.y),p[T+I]=Vs.x,p[T+1+I]=Vs.y,p[T++]=Vs.x,p[T++]=Vs.y}z=s.scaleToGeodeticSurface(z,z),B=h.clone(z,JY),C=s.geodeticSurfaceNormal(z,C),b&&(x[F+v]=-C.x,x[U+v]=-C.y,x[k+v]=-C.z);let j=h.multiplyByScalar(C,a,P_e);if(z=h.add(z,j,z),j=h.multiplyByScalar(C,c,j),B=h.add(B,j,B),n.position&&(d[F+v]=B.x,d[U+v]=B.y,d[k+v]=B.z,d[F]=z.x,d[U]=z.y,d[k]=z.z),n.normal||n.tangent||n.bitangent){S=h.clone(C,S);let W=h.fromArray(e,(F+3)%v,P_e);h.subtract(W,z,W);let J=h.subtract(B,z,eX);C=h.normalize(h.cross(J,W,C),C),n.normal&&(_[F]=C.x,_[U]=C.y,_[k]=C.z,_[F+v]=C.x,_[U+v]=C.y,_[k+v]=C.z),n.tangent&&(A=h.normalize(h.cross(S,C,A),A),m[F]=A.x,m[U]=A.y,m[k]=A.z,m[F+v]=A.x,m[F+1+v]=A.y,m[F+2+v]=A.z),n.bitangent&&(y[F]=S.x,y[U]=S.y,y[k]=S.z,y[F+v]=S.x,y[U+v]=S.y,y[k+v]=S.z)}}if(n.st){v=p.length;for(let F=0;F<v;F+=2)p[F]=(p[F]-g.x)/(E.x-g.x),p[F+1]=(p[F+1]-g.y)/(E.y-g.y)}let N=new dn;if(n.position&&(N.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(N.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),n.tangent&&(N.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),b&&(N.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===an.TOP)F=F.fill(1,0,f/2);else{let U=t.offsetAttribute===an.NONE?0:1;F=F.fill(U)}N.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function Zit(e){let t=e.length/3,n=ke.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 F8=new re,B8=new re;function Qit(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,cv),e.height,cv);F8.center=h.add(t,o,F8.center),F8.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),B8.center=h.add(t,o,B8.center),B8.radius=i;let r=mu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=re.union(F8,B8),f=B_e(s,e,!0),d=k_e(a),p=d.length;d.length=p*2;let _=s.length/3;for(let A=0;A<p;A+=3)d[A+p]=d[A+2]+_,d[A+1+p]=d[A+1]+_,d[A+2+p]=d[A]+_;let m=ke.createTypedArray(_*2/3,d),y=new lt({attributes:f,indices:m,primitiveType:Le.TRIANGLES}),b=$it(c,e);d=Zit(c);let x=ke.createTypedArray(c.length*2/3,d),T=new lt({attributes:b,indices:x,primitiveType:Le.TRIANGLES}),C=Nn.combineInstances([new It({geometry:y}),new It({geometry:T})]);return{boundingSphere:u,attributes:C[0].attributes,indices:C[0].indices}}function U_e(e,t,n,i,o,r,s){let c=mu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ae.fromCartesianArray(f,r,s);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function ap(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.vertexFormat??De.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=De.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}ap.packedLength=h.packedLength+te.packedLength+De.packedLength+9;ap.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 z_e=new h,V_e=new te,H_e=new De,sp={center:z_e,ellipsoid:V_e,vertexFormat:H_e,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};ap.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,z_e);t+=h.packedLength;let o=te.unpack(e,t,V_e);t+=te.packedLength;let r=De.unpack(e,t,H_e);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],_=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=_,n._offsetAttribute=m===-1?void 0:m,n):(sp.height=f,sp.extrudedHeight=p,sp.granularity=d,sp.stRotation=u,sp.rotation=c,sp.semiMajorAxis=s,sp.semiMinorAxis=a,sp.shadowVolume=_,sp.offsetAttribute=m===-1?void 0:m,new ap(sp))};ap.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??D.RADIANS_PER_DEGREE,a=e.rotation??0;return U_e(n,o,r,a,s,i,t)};ap.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=Qit(o);else if(r=Kit(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:Le.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};ap.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new ap({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};function Jit(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=mu.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]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return lt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(ap.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=U_e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Jit(this)),this._textureCoordinateRotationPoints}}});var Ol=ap;var G_e=new h,tC=new h;function eot(e){let t=e.center;tC=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,tC),e.height,tC),tC=h.add(t,tC,tC);let n=new re(tC,e.semiMajorAxis),i=mu.computeEllipsePositions(e,!1,!0).outerPositions,o=new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:mu.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=ke.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 U8=new re,z8=new re;function tot(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,G_e),e.height,G_e);U8.center=h.add(t,o,U8.center),U8.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),z8.center=h.add(t,o,z8.center),z8.radius=i;let r=mu.computeEllipsePositions(e,!1,!0).outerPositions,s=new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:mu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=re.union(U8,z8),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===an.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===an.NONE?0:1;m=m.fill(y)}s.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=ke.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let _;if(u>0){let m=Math.min(u,c);_=Math.round(c/m);let y=Math.min(_*u,c);for(p=0;p<y;p+=_)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function lv(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}lv.packedLength=h.packedLength+te.packedLength+8;lv.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var j_e=new h,W_e=new te,Og={center:j_e,ellipsoid:W_e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};lv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,j_e);t+=h.packedLength;let o=te.unpack(e,t,W_e);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(Og.height=c,Og.extrudedHeight=f,Og.granularity=u,Og.rotation=a,Og.semiMajorAxis=r,Og.semiMinorAxis=s,Og.numberOfVerticalLines=d,Og.offsetAttribute=p===-1?void 0:p,new lv(Og))};lv.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=tot(o);else if(r=eot(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:Le.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var lf=lv;var q_e=new H,Y_e=h.ZERO,X_e=new h,K_e=new ae;function not(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 Kh(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new not(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Kh.prototype=Object.create(jn.prototype),Kh.prototype.constructor=Kh);Kh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,q_e)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Y_e,X_e))),new It({id:t,geometry:new Ol(this._options),attributes:i})};Kh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,q_e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Y_e,X_e))),new It({id:t,geometry:new lf(this._options),attributes:r})};Kh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Kh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||si.prototype._isHidden.call(this,e,t)};Kh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};Kh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,Ke.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=jn.computeGeometryOffsetAttribute(n,i,o,r),s.height=jn.getGeometryHeight(n,i),o=jn.getGeometryExtrudedHeight(o,r),o===jn.CLAMP_TO_GROUND&&(o=hi.getMinimumMaximumHeights(Ol.computeRectangle(s,K_e)).minimumTerrainHeight),s.extrudedHeight=o};Kh.DynamicGeometryUpdater=uv;function uv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(uv.prototype=Object.create(ri.prototype),uv.prototype.constructor=uv);uv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ri.prototype._isHidden.call(this,e,t,n)};uv.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,Ke.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(Ol.computeRectangle(i,K_e)).minimumTerrainHeight),i.extrudedHeight=s};var DF=Kh;var iot=new h,oot=new h,rot=new h,sot=new h,aot=new h,cot=new h(1,1,1),$_e=Math.cos,Z_e=Math.sin;function Mg(e){e=e??G.EMPTY_OBJECT;let t=e.radii??cot,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??De.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=De.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Mg.packedLength=2*h.packedLength+De.packedLength+7;Mg.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 Q_e=new h,J_e=new h,ege=new De,U0={radii:Q_e,innerRadii:J_e,vertexFormat:ege,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Mg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Q_e);t+=h.packedLength;let o=h.unpack(e,t,J_e);t+=h.packedLength;let r=De.unpack(e,t,ege);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=De.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(U0.minimumClock=s,U0.maximumClock=a,U0.minimumCone=c,U0.maximumCone=u,U0.stackPartitions=f,U0.slicePartitions=d,U0.offsetAttribute=p===-1?void 0:p,new Mg(U0))};Mg.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-r)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,_=[r],m=[i];for(f=0;f<u;f++)_.push(r+f*(s-r)/(u-1));for(_.push(s),d=0;d<c;d++)m.push(i+d*(o-i)/(c-1));m.push(o);let y=_.length,b=m.length,x=0,T=1,C=n.x!==t.x||n.y!==t.y||n.z!==t.z,A=!1,S=!1,w=!1;C&&(T=2,r>0&&(A=!0,x+=c-1),s<Math.PI&&(S=!0,x+=c-1),(o-i)%D.TWO_PI?(w=!0,x+=(u-1)*2+1):x+=1);let R=b*y*T,P=new Float64Array(R*3),O=new Array(R).fill(!1),L=new Array(R).fill(!1),g=c*u*T,E=6*(g+x+1-(c+u)*T),v=ke.createTypedArray(g,E),I=a.normal?new Float32Array(R*3):void 0,N=a.tangent?new Float32Array(R*3):void 0,F=a.bitangent?new Float32Array(R*3):void 0,U=a.st?new Float32Array(R*2):void 0,k=new Array(y),z=new Array(y);for(f=0;f<y;f++)k[f]=Z_e(_[f]),z[f]=$_e(_[f]);let B=new Array(b),j=new Array(b);for(d=0;d<b;d++)j[d]=$_e(m[d]),B[d]=Z_e(m[d]);for(f=0;f<y;f++)for(d=0;d<b;d++)P[p++]=t.x*k[f]*j[d],P[p++]=t.y*k[f]*B[d],P[p++]=t.z*z[f];let W=R/2;if(C)for(f=0;f<y;f++)for(d=0;d<b;d++)P[p++]=n.x*k[f]*j[d],P[p++]=n.y*k[f]*B[d],P[p++]=n.z*z[f],O[W]=!0,f>0&&f!==y-1&&d!==0&&d!==b-1&&(L[W]=!0),W++;p=0;let J,Y;for(f=1;f<y-2;f++)for(J=f*b,Y=(f+1)*b,d=1;d<b-2;d++)v[p++]=Y+d,v[p++]=Y+d+1,v[p++]=J+d+1,v[p++]=Y+d,v[p++]=J+d+1,v[p++]=J+d;if(C){let $e=y*b;for(f=1;f<y-2;f++)for(J=$e+f*b,Y=$e+(f+1)*b,d=1;d<b-2;d++)v[p++]=Y+d,v[p++]=J+d,v[p++]=J+d+1,v[p++]=Y+d,v[p++]=J+d+1,v[p++]=Y+d+1}let ee,Q;if(C){if(A)for(Q=y*b,f=1;f<b-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=Q+f+1,v[p++]=f,v[p++]=Q+f+1,v[p++]=Q+f;if(S)for(ee=y*b-b,Q=y*b*T-b,f=1;f<b-2;f++)v[p++]=ee+f+1,v[p++]=ee+f,v[p++]=Q+f,v[p++]=ee+f+1,v[p++]=Q+f,v[p++]=Q+f+1}if(w){for(f=1;f<y-2;f++)Q=b*y+b*f,ee=b*f,v[p++]=Q,v[p++]=ee+b,v[p++]=ee,v[p++]=Q,v[p++]=Q+b,v[p++]=ee+b;for(f=1;f<y-2;f++)Q=b*y+b*(f+1)-1,ee=b*(f+1)-1,v[p++]=ee+b,v[p++]=Q,v[p++]=ee,v[p++]=ee+b,v[p++]=Q+b,v[p++]=Q}let de=new dn;a.position&&(de.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:P}));let ge=0,le=0,ye=0,xe=0,Ie=R/2,Te,ve=te.fromCartesian3(t),Ve=te.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<R;f++){Te=O[f]?Ve:ve;let $e=h.fromArray(P,f*3,iot),Ct=Te.geodeticSurfaceNormal($e,oot);if(L[f]&&h.negate(Ct,Ct),a.st){let Jt=V.negate(Ct,aot);U[ge++]=Math.atan2(Jt.y,Jt.x)/D.TWO_PI+.5,U[ge++]=Math.asin(Ct.z)/Math.PI+.5}if(a.normal&&(I[le++]=Ct.x,I[le++]=Ct.y,I[le++]=Ct.z),a.tangent||a.bitangent){let Jt=rot,Qe=0,mn;if(O[f]&&(Qe=Ie),!A&&f>=Qe&&f<Qe+b*2?mn=h.UNIT_X:mn=h.UNIT_Z,h.cross(mn,Ct,Jt),h.normalize(Jt,Jt),a.tangent&&(N[ye++]=Jt.x,N[ye++]=Jt.y,N[ye++]=Jt.z),a.bitangent){let Bt=h.cross(Ct,Jt,sot);h.normalize(Bt,Bt),F[xe++]=Bt.x,F[xe++]=Bt.y,F[xe++]=Bt.z}}}a.st&&(de.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(de.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(de.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let $e=P.length,Ct=e._offsetAttribute===an.NONE?0:1,Jt=new Uint8Array($e/3).fill(Ct);de.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:Jt})}return new lt({attributes:de,indices:v,primitiveType:Le.TRIANGLES,boundingSphere:re.fromEllipsoid(ve),offsetAttribute:e._offsetAttribute})};var nX;Mg.getUnitEllipsoid=function(){return l(nX)||(nX=Mg.createGeometry(new Mg({radii:new h(1,1,1),vertexFormat:De.POSITION_ONLY}))),nX};var da=Mg;var lot=new Wt(H.WHITE),iX=h.ZERO,oX=new h,uot=new h,fot=new h,rX=new H,dot=new h(1,1,1);function hot(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function uf(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new hot(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(uf.prototype=Object.create(si.prototype),uf.prototype.constructor=uf);Object.defineProperties(uf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});uf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Un.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,rX)),l(f)||(f=H.WHITE),r=Yt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iX,oX))),new It({id:i,geometry:new da(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};uf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,rX),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:Un.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iX,oX))),new It({id:i,geometry:new ef(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};uf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};uf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||si.prototype._isHidden.call(this,e,t)};uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};uf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==Ke.NONE?an.ALL:void 0};uf.prototype._onEntityPropertyChanged=C_;uf.DynamicGeometryUpdater=RF;function RF(e,t,n){ri.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(RF.prototype=Object.create(ri.prototype),RF.prototype.constructor=RF);RF.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,uot),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=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,H.BLACK,rX),c=sr.getValue(e,n.material??lot,this._material),u=X.getValueOrUndefined(n.innerRadii,e,fot),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),_=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),b=X.getValueOrUndefined(n.subdivisions,e),x=X.getValueOrDefault(n.outlineWidth,e,1),T=X.getValueOrDefault(n.heightReference,e,Ke.NONE),C=T!==Ke.NONE?an.ALL:void 0,A=this._scene.mode,S=A===ne.SCENE3D&&T===Ke.NONE,w=this._options,R=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,iX,oX);if(!S||this._lastSceneMode!==A||!l(this._primitive)||w.stackPartitions!==m||w.slicePartitions!==y||l(u)&&!h.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==d||w.minimumCone!==p||w.maximumCone!==_||w.subdivisions!==b||this._lastOutlineWidth!==x||w.offsetAttribute!==C){let E=this._primitives;E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=A,this._lastOutlineWidth=x,w.stackPartitions=m,w.slicePartitions=y,w.subdivisions=b,w.offsetAttribute=C,w.radii=h.clone(S?dot:i,w.radii),l(u)?S?w.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=h.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=d,w.minimumCone=p,w.maximumCone=_;let v=new ho({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=v.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=E.add(new Pn({geometryInstances:I,appearance:v,asynchronous:!1,shadows:R}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=E.add(new Pn({geometryInstances:N,appearance:new un({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:R})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=H.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,v=this._outlinePrimitive;E.show=!0,v.show=!0,E.appearance.material=c;let I=this._attributes;l(I)||(I=E.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=bn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;l(N)||(N=v.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=bn.toValue(s,N.show),this._lastOutlineShow=s),H.equals(a,this._lastOutlineColor)||(N.color=Yt.toValue(a,N.color),H.clone(a,this._lastOutlineColor)),Rt.equals(O,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Un.toValue(O,I.distanceDisplayCondition),N.distanceDisplayCondition=Un.toValue(O,N.distanceDisplayCondition),Rt.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(I.offset=io.toValue(L,I.offset),N.offset=io.toValue(L,I.offset),h.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=M.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var OF=uf;function fv(e){e=e??G.EMPTY_OBJECT;let t=e.vertexFormat??De.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}fv.packedLength=De.packedLength;fv.pack=function(e,t,n){return n=n??0,De.pack(e._vertexFormat,t,n),t};var tge=new De,mot={vertexFormat:tge};fv.unpack=function(e,t,n){t=t??0;let i=De.unpack(e,t,tge);return l(n)?(n._vertexFormat=De.clone(i,n._vertexFormat),n):new fv(mot)};var V8=new h(-.5,-.5,0),H8=new h(.5,.5,0);fv.createGeometry=function(e){let t=e._vertexFormat,n=new dn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=V8.x,o[1]=V8.y,o[2]=0,o[3]=H8.x,o[4]=V8.y,o[5]=0,o[6]=H8.x,o[7]=H8.y,o[8]=0,o[9]=V8.x,o[10]=H8.y,o[11]=0,n.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new we({componentDatatype:K.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 lt({attributes:n,indices:i,primitiveType:Le.TRIANGLES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var MF=fv;function dv(){this._workerName="createPlaneOutlineGeometry"}dv.packedLength=0;dv.pack=function(e,t){return t};dv.unpack=function(e,t,n){return l(n)?n:new dv};var z0=new h(-.5,-.5,0),G8=new h(.5,.5,0);dv.createGeometry=function(){let e=new dn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=z0.x,n[1]=z0.y,n[2]=z0.z,n[3]=G8.x,n[4]=z0.y,n[5]=z0.z,n[6]=G8.x,n[7]=G8.y,n[8]=z0.z,n[9]=z0.x,n[10]=G8.y,n[11]=z0.z,e.position=new we({componentDatatype:K.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 lt({attributes:e,indices:t,primitiveType:Le.LINES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var LF=dv;var pot=new h,nge=new H;function _ot(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Id(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new _ot(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Id.prototype=Object.create(si.prototype),Id.prototype.constructor=Id);Id.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let _;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(_=this._materialProperty.color.getValue(e,nge)),l(_)||(_=H.WHITE),o=Yt.fromColor(_),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=sX(d,p,f,f),new It({id:t,geometry:new MF(this._options),modelMatrix:f,attributes:i})};Id.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,nge),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(r.plane,e,s.plane),u=X.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=sX(c,u,a,a),new It({id:t,geometry:new LF,modelMatrix:a,attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Id.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||si.prototype._isHidden.call(this,e,t)};Id.prototype._getIsClosed=function(e){return!1};Id.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Id.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};Id.DynamicGeometryUpdater=hv;function hv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(hv.prototype=Object.create(ri.prototype),hv.prototype.constructor=hv);hv.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,pot);return!l(o)||!l(i.plane)||!l(i.dimensions)||ri.prototype._isHidden.call(this,e,t,n)};hv.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var got=new h,yot=new h,bot=new h,xot=new h,Tot=new Z,Cot=new Z,Aot=new M;function sX(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,bot),a=h.clone(h.UNIT_Z,yot);D.equalsEpsilon(Math.abs(h.dot(a,o)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,got);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let u=Tot;Z.setColumn(u,0,c,u),Z.setColumn(u,1,a,u),Z.setColumn(u,2,o,u);let f=h.fromElements(t.x,t.y,1,xot),d=Z.multiplyByScale(u,f,Cot),p=M.fromRotationTranslation(d,s,Aot);return M.multiplyTransformation(n,p,i)}Id.createPrimitiveMatrix=sX;var NF=Id;var Eot=new h,Sot=new Xe,vot=new V,wot=new V,Iot=new h,Pot=new h,Dot=new h,FF=new h,Rot=new h,Oot=new h,ige=new Pe,Mot=new Z,Lot=new Z,Not=new h;function Fot(e,t,n,i,o,r,s,a,c){let u=e.positions,f=li.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=ke.createTypedArray(u.length,f.length);d.set(f);let p=Mot;if(i!==0){let g=Pe.fromAxisAngle(s,i,ige);if(p=Z.fromQuaternion(g,p),t.tangent||t.bitangent){g=Pe.fromAxisAngle(s,-i,ige);let E=Z.fromQuaternion(g,Lot);a=h.normalize(Z.multiplyByVector(E,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=Z.clone(Z.IDENTITY,p);let _=wot;t.st&&(_.x=n.x,_.y=n.y);let m=u.length,y=m*3,b=new Float64Array(y),x=t.normal?new Float32Array(y):void 0,T=t.tangent?new Float32Array(y):void 0,C=t.bitangent?new Float32Array(y):void 0,A=t.st?new Float32Array(m*2):void 0,S=0,w=0,R=0,P=0,O=0;for(let g=0;g<m;g++){let E=u[g];if(b[S++]=E.x,b[S++]=E.y,b[S++]=E.z,t.st)if(l(o)&&o.positions.length===m)A[O++]=o.positions[g].x,A[O++]=o.positions[g].y;else{let v=Z.multiplyByVector(p,E,Eot),I=r(v,vot);V.subtract(I,_,I);let N=D.clamp(I.x/n.width,0,1),F=D.clamp(I.y/n.height,0,1);A[O++]=N,A[O++]=F}t.normal&&(x[w++]=s.x,x[w++]=s.y,x[w++]=s.z),t.tangent&&(T[P++]=a.x,T[P++]=a.y,T[P++]=a.z),t.bitangent&&(C[R++]=c.x,C[R++]=c.y,C[R++]=c.z)}let L=new dn;return t.position&&(L.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(L.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(L.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(L.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:C})),t.st&&(L.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:A})),new lt({attributes:L,indices:d,primitiveType:Le.TRIANGLES})}function nC(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??De.DEFAULT;this._vertexFormat=De.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+De.packedLength+te.packedLength+(l(n)?Hn.computeHierarchyPackedLength(n,V):1)+2}nC.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new nC(t)};nC.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,V):t[n++]=-1,t[n++]=e.packedLength,t};var Bot=te.clone(te.UNIT_SPHERE),kot=new De,Uot={polygonHierarchy:{}};nC.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Bot);t+=te.packedLength;let r=De.unpack(e,t,kot);t+=De.packedLength;let s=e[t++],a=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,V);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new nC(Uot)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};nC.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=So(s,h.equalsEpsilon,!0),s.length<3)return;let a=Iot,c=Pot,u=Dot,f=Rot,d=Oot;if(!fg.computeProjectTo2DArguments(s,FF,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(FF,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(FF,Not);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let _=fg.createProjectPointsTo2DFunction(FF,f,d),m=fg.createProjectPointTo2DFunction(FF,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=Hn.polygonsFromHierarchy(n,r,_,!1),b=y.hierarchy,x=y.polygons,T=function(O){return O},C=r?Hn.polygonsFromHierarchy(o,!0,T,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let A=re.fromPoints(s),S=Hn.computeBoundingRectangle(a,m,s,i,Sot),w=[];for(let O=0;O<x.length;O++){let L=new It({geometry:Fot(x[O],t,S,i,r?C[O]:void 0,m,a,c,u)});w.push(L)}let R=Nn.combineInstances(w)[0];R.attributes.position.values=new Float64Array(R.attributes.position.values),R.indices=ke.createTypedArray(R.attributes.position.values.length/3,R.indices);let P=R.attributes;return t.position||delete P.position,new lt({attributes:P,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:A})};var BF=nC;var oge=[],j8=[];function zot(e,t,n,i,o){let s=cs.fromPoints(t,e).projectPointsOntoPlane(t,oge);li.computeWindingOrder2D(s)===Cs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(o===tn.GEODESIC)for(u=0;u<f;u++)m+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===tn.RHUMB)for(u=0;u<f;u++)m+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;o===tn.GEODESIC?y=Hn.subdivideLine(t[u],t[(u+1)%f],n,j8):o===tn.RHUMB&&(y=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,j8));let b=y.length;for(let x=0;x<b;++x)c[d++]=y[x]}}f=c.length/3;let p=f*2,_=ke.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)_[d++]=u,_[d++]=u+1;return _[d++]=f-1,_[d++]=0,new It({geometry:new lt({attributes:new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Le.LINES})})}function Vot(e,t,n,i,o){let s=cs.fromPoints(t,e).projectPointsOntoPlane(t,oge);li.computeWindingOrder2D(s)===Cs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let b=t[u],x=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=x.x,c[p++]=x.y,c[p++]=x.z}else{let b=0;if(o===tn.GEODESIC)for(u=0;u<f;u++)b+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===tn.RHUMB)for(u=0;u<f;u++)b+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){d[u]=p/3;let x;o===tn.GEODESIC?x=Hn.subdivideLine(t[u],t[(u+1)%f],n,j8):o===tn.RHUMB&&(x=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,j8));let T=x.length;for(let C=0;C<T;++C)c[p++]=x[C]}}f=c.length/(3*2);let _=d.length,m=(f*2+_)*2,y=ke.createTypedArray(f+_,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<_;u++){let b=d[u];y[p++]=b,y[p++]=b+f}return new It({geometry:new lt({attributes:new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Le.LINES})})}function iC(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??tn.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+te.packedLength+8}iC.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var Hot=te.clone(te.UNIT_SPHERE),Got={polygonHierarchy:{}};iC.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Hot);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new iC(Got)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};iC.fromPositions=function(e){e=e??G.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 iC(t)};iC.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Hn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),_,m;if(p)for(m=0;m<s.length;m++){if(a=Vot(t,s[m],u,o,r),a.geometry=Hn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,o),l(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length/3,T=new Uint8Array(x);e._offsetAttribute===an.TOP?T=T.fill(1,0,x/2):(_=e._offsetAttribute===an.NONE?0:1,T=T.fill(_)),a.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(m=0;m<s.length;m++){if(a=zot(t,s[m],u,o,r),a.geometry.attributes.position.values=li.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length;_=e._offsetAttribute===an.NONE?0:1;let T=new Uint8Array(x/3).fill(_);a.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let y=Nn.combineInstances(c)[0],b=re.fromVertices(y.attributes.position.values);return new lt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var kF=iC;var rge="Entity polygons cannot have both height and perPositionHeight. height will be ignored",sge="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",age=new H,cge=h.ZERO,lge=new h,uge=new ae,jot=[],Wot=new V;function qot(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function ff(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new qot(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(ff.prototype=Object.create(jn.prototype),ff.prototype.constructor=ff);ff.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,age)),l(s)||(s=H.WHITE),o.color=Yt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cge,lge)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new BF(i):r=new k_(i),new It({id:t,geometry:r,attributes:o})};ff.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,age),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:Un.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cge,lge)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new xd(i):a=new kF(i),new It({id:t,geometry:a,attributes:s})};ff.prototype._computeCenter=function(e,t){let n=X.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=cs.fromPoints(i,o),s=r.projectPointsOntoPlane(i,jot),a=s.length,c=0,u=a-1,f=new V;for(let p=0;p<a;u=p++){let _=s[p],m=s[u],y=_.x*m.y-m.x*_.y,b=V.add(_,m,Wot);b=V.multiplyByScalar(b,y,b),f=V.add(f,b,f),c+=y}let d=1/(c*3);return f=V.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};ff.prototype._isHidden=function(e,t){return!l(t.hierarchy)||si.prototype._isHidden.call(this,e,t)};ff.prototype._isOnTerrain=function(e,t){let n=jn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};ff.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};ff.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),a=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,Ke.NONE),u=X.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=jn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,bt(rge)),s!==Ke.NONE&&u&&(r=void 0,bt(sge))):(l(a)&&!l(r)&&(r=0),f=jn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,tn.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=jn.getGeometryExtrudedHeight(a,c),a===jn.CLAMP_TO_GROUND){let d=k_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,uge);a=hi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};ff.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};ff.DynamicGeometryUpdater=mv;function mv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(mv.prototype=Object.create(ri.prototype),mv.prototype.constructor=mv);mv.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ri.prototype._isHidden.call(this,e,t,n)};mv.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,Ke.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);o=jn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,bt(rge)),r!==Ke.NONE&&c&&(o=void 0,bt(sge))):(l(a)&&!l(o)&&(o=0),u=jn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,n,tn.GEODESIC),a=jn.getGeometryExtrudedHeight(a,s),a===jn.CLAMP_TO_GROUND){let f=k_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,uge);a=hi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var UF=ff;function Yot(e,t,n,i){let o=new dn;i.position&&(o.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=li.triangulate(t),u=(a-1)*r*6+c.length*2,f=ke.createTypedArray(s,u),d,p,_,m,y,b,x=r*2,T=0;for(d=0;d<a-1;d++){for(p=0;p<r-1;p++)_=p*2+d*r*2,b=_+x,m=_+1,y=m+x,f[T++]=m,f[T++]=_,f[T++]=y,f[T++]=y,f[T++]=_,f[T++]=b;_=r*2-2+d*r*2,m=_+1,y=m+x,b=_+x,f[T++]=m,f[T++]=_,f[T++]=y,f[T++]=y,f[T++]=_,f[T++]=b}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(s*2),w=1/(a-1),R=1/n.height,P=n.height/2,O,L,g=0;for(d=0;d<a;d++){for(O=d*w,L=R*(t[0].y+P),S[g++]=O,S[g++]=L,p=1;p<r;p++)L=R*(t[p].y+P),S[g++]=O,S[g++]=L,S[g++]=O,S[g++]=L;L=R*(t[0].y+P),S[g++]=O,S[g++]=L}for(p=0;p<r;p++)O=0,L=R*(t[p].y+P),S[g++]=O,S[g++]=L;for(p=0;p<r;p++)O=(a-1)*w,L=R*(t[p].y+P),S[g++]=O,S[g++]=L;o.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let C=s-r*2;for(d=0;d<c.length;d+=3){let S=c[d]+C,w=c[d+1]+C,R=c[d+2]+C;f[T++]=S,f[T++]=w,f[T++]=R,f[T++]=R+r,f[T++]=w+r,f[T++]=S+r}let A=new lt({attributes:o,indices:f,boundingSphere:re.fromVertices(e),primitiveType:Le.TRIANGLES});if(i.normal&&(A=Nn.computeNormal(A)),i.tangent||i.bitangent){try{A=Nn.computeTangentAndBitangent(A)}catch{bt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(A.attributes.tangent=void 0),i.bitangent||(A.attributes.bitangent=void 0),i.st||(A.attributes.st=void 0)}return A}function VF(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Bi.ROUNDED,this._vertexFormat=De.clone(e.vertexFormat??De.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*V.packedLength,this.packedLength=i+te.packedLength+De.packedLength+2}VF.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+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=V.packedLength)V.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var fge=te.clone(te.UNIT_SPHERE),dge=new De,zF={polylinePositions:void 0,shapePositions:void 0,ellipsoid:fge,vertexFormat:dge,cornerType:void 0,granularity:void 0};VF.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=V.packedLength)s[i]=V.unpack(e,t);let a=te.unpack(e,t,fge);t+=te.packedLength;let c=De.unpack(e,t,dge);t+=De.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=De.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(zF.polylinePositions=r,zF.shapePositions=s,zF.cornerType=u,zF.granularity=f,new VF(zF))};var Xot=new Xe;VF.createGeometry=function(e){let t=e._positions,n=So(t,h.equalsEpsilon),i=e._shape;if(i=Hh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Cs.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,Xot),r=Hh.computePositions(n,i,o,e,!0);return Yot(r,i,o,e._vertexFormat)};var HF=VF;function Kot(e,t){let n=new dn;n.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=ke.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let _=i*c,m=_+i;for(u=0;u<i;u++)a[f++]=u+_,a[f++]=u+m}return new lt({attributes:n,indices:ke.createTypedArray(o,a),boundingSphere:re.fromVertices(e),primitiveType:Le.LINES})}function jF(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*V.packedLength,this.packedLength=i+te.packedLength+2}jF.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+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=V.packedLength)V.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var hge=te.clone(te.UNIT_SPHERE),GF={polylinePositions:void 0,shapePositions:void 0,ellipsoid:hge,height:void 0,cornerType:void 0,granularity:void 0};jF.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=V.packedLength)s[i]=V.unpack(e,t);let a=te.unpack(e,t,hge);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(GF.polylinePositions=r,GF.shapePositions=s,GF.cornerType=c,GF.granularity=u,new jF(GF))};var $ot=new Xe;jF.createGeometry=function(e){let t=e._positions,n=So(t,h.equalsEpsilon),i=e._shape;if(i=Hh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Cs.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,$ot),r=Hh.computePositions(n,i,o,e,!1);return Kot(r,i)};var WF=jF;var mge=new H;function Zot(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 cp(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new Zot(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(cp.prototype=Object.create(si.prototype),cp.prototype.constructor=cp);cp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,mge)),l(c)||(c=H.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new It({id:t,geometry:new HF(this._options),attributes:i})};cp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,mge),o=this._distanceDisplayConditionProperty.getValue(e);return new It({id:t,geometry:new WF(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};cp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||si.prototype._isHidden.call(this,e,t)};cp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};cp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Wt;o.vertexFormat=r?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};cp.DynamicGeometryUpdater=pv;function pv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(pv.prototype=Object.create(ri.prototype),pv.prototype.constructor=pv);pv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ri.prototype._isHidden.call(this,e,t,n)};pv.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var qF=cp;var aX=new h,gge=new h,yge=new h,bge=new h,xge=new ae,Qot=new V,Jot=new re,ert=new re;function Tge(e,t){let n=new lt({attributes:new dn,primitiveType:Le.TRIANGLES});return n.attributes.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function trt(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=bge,f=yge,d=gge;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let _=h.fromArray(e,p,aX),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(_,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),Z.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[m]=d.y,r[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return Tge(t,{positions:e,normals:r,tangents:s,bitangents:a})}var cX=new h,Cge=new h;function nrt(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=bge,p=yge,_=gge;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,aX),b=h.fromArray(e,(m+6)%i,cX);if(f){let x=h.fromArray(e,(m+3)%i,Cge);h.subtract(b,y,b),h.subtract(x,y,x),_=h.normalize(h.cross(x,b,_),_),f=!1}h.equalsEpsilon(b,y,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,_,p),p))),t.normal&&(o[a++]=_.x,o[a++]=_.y,o[a++]=_.z,o[a++]=_.x,o[a++]=_.y,o[a++]=_.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return Tge(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Age(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,_=n.st?new Float32Array(d*2):void 0,m=0,y=0,b=aX,x=Qot,T=Number.MAX_VALUE,C=Number.MAX_VALUE,A=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let v=0;v<r;++v)Us.computePosition(t,i,n.st,E,v,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[y++]=x.x,_[y++]=x.y,T=Math.min(T,x.x),C=Math.min(C,x.y),A=Math.max(A,x.x),S=Math.max(S,x.y));if(s&&(Us.computePosition(t,i,n.st,0,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[y++]=x.x,_[y++]=x.y,T=x.x,C=x.y,A=x.x,S=x.y)),a&&(Us.computePosition(t,i,n.st,o-1,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(_[y++]=x.x,_[y]=x.y,T=Math.min(T,x.x),C=Math.min(C,x.y),A=Math.max(A,x.x),S=Math.max(S,x.y))),n.st&&(T<0||C<0||A>1||S>1))for(let E=0;E<_.length;E+=2)_[E]=(_[E]-T)/(A-T),_[E+1]=(_[E+1]-C)/(S-C);let w=trt(p,n,i,t.tangentRotationMatrix),R=6*(r-1)*(f-1);s&&(R+=3*(r-1)),a&&(R+=3*(r-1));let P=ke.createTypedArray(d,R),O=0,L=0,g;for(g=0;g<f-1;++g){for(let E=0;E<r-1;++E){let v=O,I=v+r,N=I+1,F=v+1;P[L++]=v,P[L++]=I,P[L++]=F,P[L++]=F,P[L++]=I,P[L++]=N,++O}++O}if(s||a){let E=d-1,v=d-1;s&&a&&(E=d-2);let I,N;if(O=0,s)for(g=0;g<r-1;g++)I=O,N=I+1,P[L++]=E,P[L++]=I,P[L++]=N,++O;if(a)for(O=(f-1)*r,g=0;g<r-1;g++)I=O,N=I+1,P[L++]=I,P[L++]=v,P[L++]=N,++O}return w.indices=P,n.st&&(w.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:_})),w}function _v(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 gv(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 lX=new De;function irt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Qe=De.clone(o,lX);Qe.normal=!0,e._vertexFormat=Qe}let d=Age(e,t);n&&(e._vertexFormat=o);let p=li.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let _=p.length,m=_*2,y=new Float64Array(m);y.set(p);let b=li.scaleToGeodeticHeight(d.attributes.position.values,r,a);y.set(b,_),d.attributes.position.values=y;let x=o.normal?new Float32Array(m):void 0,T=o.tangent?new Float32Array(m):void 0,C=o.bitangent?new Float32Array(m):void 0,A=o.st?new Float32Array(m/3*2):void 0,S,w;if(o.normal){for(w=d.attributes.normal.values,x.set(w),f=0;f<_;f++)w[f]=-w[f];x.set(w,_),d.attributes.normal.values=x}if(n){w=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let Qe=new Float32Array(m);for(f=0;f<_;f++)w[f]=-w[f];Qe.set(w,_),d.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:Qe})}let R,P=l(i);if(P){let Qe=_/3*2,mn=new Uint8Array(Qe);i===an.TOP?mn=mn.fill(1,0,Qe/2):(R=i===an.NONE?0:1,mn=mn.fill(R)),d.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:mn})}if(o.tangent){let Qe=d.attributes.tangent.values;for(T.set(Qe),f=0;f<_;f++)Qe[f]=-Qe[f];T.set(Qe,_),d.attributes.tangent.values=T}if(o.bitangent){let Qe=d.attributes.bitangent.values;C.set(Qe),C.set(Qe,_),d.attributes.bitangent.values=C}o.st&&(S=d.attributes.st.values,A.set(S),A.set(S,_/3*2),d.attributes.st.values=A);let O=d.indices,L=O.length,g=_/3,E=ke.createTypedArray(m/3,L*2);for(E.set(O),f=0;f<L;f+=3)E[f+L]=O[f+2]+g,E[f+1+L]=O[f+1]+g,E[f+2+L]=O[f]+g;d.indices=E;let v=t.northCap,I=t.southCap,N=c,F=2,U=0,k=4,z=4;v&&(F-=1,N-=1,U+=1,k-=2,z-=1),I&&(F-=1,N-=1,U+=1,k-=2,z-=1),U+=F*u+2*N-k;let B=(U+z)*2,j=new Float64Array(B*3),W=n?new Float32Array(B*3):void 0,J=P?new Uint8Array(B):void 0,Y=o.st?new Float32Array(B*2):void 0,ee=i===an.TOP;P&&!ee&&(R=i===an.ALL?1:0,J=J.fill(R));let Q=0,de=0,ge=0,le=0,ye=u*N,xe;for(f=0;f<ye;f+=u)xe=f*3,j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1);if(I){let Qe=v?ye+1:ye;for(xe=Qe*3,f=0;f<2;f++)j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,Qe*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1)}else for(f=ye-u;f<ye;f++)xe=f*3,j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1);for(f=ye-1;f>0;f-=u)xe=f*3,j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1);if(v){let Qe=ye;for(xe=Qe*3,f=0;f<2;f++)j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,Qe*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1)}else for(f=u-1;f>=0;f--)xe=f*3,j=_v(j,Q,xe,p,b),Q+=6,o.st&&(Y=gv(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[xe],W[ge++]=w[xe+1],W[ge++]=w[xe+2]),ee&&(J[le++]=1,le+=1);let Ie=nrt(j,o,a);o.st&&(Ie.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:Y})),n&&(Ie.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:W})),P&&(Ie.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Te=ke.createTypedArray(B,U*6),ve,Ve,$e,Ct;_=j.length/3;let Jt=0;for(f=0;f<_-1;f+=2){ve=f,Ct=(ve+2)%_;let Qe=h.fromArray(j,ve*3,cX),mn=h.fromArray(j,Ct*3,Cge);h.equalsEpsilon(Qe,mn,D.EPSILON10)||(Ve=(ve+1)%_,$e=(Ve+2)%_,Te[Jt++]=ve,Te[Jt++]=Ve,Te[Jt++]=Ct,Te[Jt++]=Ct,Te[Jt++]=Ve,Te[Jt++]=$e)}return Ie.indices=Te,Ie=Nn.combineInstances([new It({geometry:d}),new It({geometry:Ie})]),Ie[0]}var ort=[new h,new h,new h,new h],Ege=new fe,rrt=new fe;function uX(e,t,n,i,o){if(n===0)return ae.clone(e,o);let r=Us.computeOptions(e,t,n,0,xge,Ege),s=r.height,a=r.width,c=ort;return Us.computePosition(r,i,!1,0,0,c[0]),Us.computePosition(r,i,!1,0,a-1,c[1]),Us.computePosition(r,i,!1,s-1,0,c[2]),Us.computePosition(r,i,!1,s-1,a-1,c[3]),ae.fromCartesianArray(c,i,o)}function lp(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ae.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=De.clone(e.vertexFormat??De.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}lp.packedLength=ae.packedLength+te.packedLength+De.packedLength+7;lp.pack=function(e,t,n){return n=n??0,ae.pack(e._rectangle,t,n),n+=ae.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 Sge=new ae,vge=te.clone(te.UNIT_SPHERE),V0={rectangle:Sge,ellipsoid:vge,vertexFormat:lX,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};lp.unpack=function(e,t,n){t=t??0;let i=ae.unpack(e,t,Sge);t+=ae.packedLength;let o=te.unpack(e,t,vge);t+=te.packedLength;let r=De.unpack(e,t,lX);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(V0.granularity=s,V0.height=a,V0.rotation=c,V0.stRotation=u,V0.extrudedHeight=f,V0.shadowVolume=d,V0.offsetAttribute=p===-1?void 0:p,new lp(V0))};lp.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return uX(n,i,r,o,t)};var srt=new Z,pge=new Pe,art=new fe;lp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Us.computeOptions(t,e._granularity,i,o,xge,Ege,rrt),a=srt;if(o!==0||i!==0){let _=ae.center(t,art),m=n.geodeticSurfaceNormalCartographic(_,cX);Pe.fromAxisAngle(m,-o,pge),Z.fromQuaternion(pge,a)}else Z.clone(Z.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=irt(e,s);let _=re.fromRectangle3D(t,n,c,ert),m=re.fromRectangle3D(t,n,u,Jot);p=re.union(_,m)}else{if(d=Age(e,s),d.attributes.position.values=li.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let _=d.attributes.position.values.length,m=e._offsetAttribute===an.NONE?0:1,y=new Uint8Array(_/3).fill(m);d.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=re.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new lt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};lp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new lp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};var _ge=new ae,crt=[new V,new V,new V],lrt=new ei,urt=new fe;function frt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ae.clone(e._rectangle,_ge),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=uX(t,n,o,i,_ge),s=crt;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=ei.fromRotation(e._stRotation,lrt),u=ae.center(a,urt);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,ei.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],_=new Array(6);return V.pack(f,_),V.pack(d,_,2),V.pack(p,_,4),_}Object.defineProperties(lp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=uX(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=frt(this)),this._textureCoordinateRotationPoints}}});var oC=lp;var wge=new H,Ige=h.ZERO,Pge=new h,Dge=new ae,drt=new ae,hrt=new fe;function mrt(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 $h(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new mrt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&($h.prototype=Object.create(jn.prototype),$h.prototype.constructor=$h);$h.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,wge)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Ige,Pge))),new It({id:t,geometry:new oC(this._options),attributes:i})};$h.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,wge),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=io.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Ige,Pge))),new It({id:t,geometry:new OT(this._options),attributes:r})};$h.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,drt);if(!l(n))return;let i=ae.center(n,hrt);return fe.toCartesian(i,te.default,t)};$h.prototype._isHidden=function(e,t){return!l(t.coordinates)||si.prototype._isHidden.call(this,e,t)};$h.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};$h.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,Ke.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,Ke.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=jn.computeGeometryOffsetAttribute(i,o,r,s),a.height=jn.getGeometryHeight(i,o),r=jn.getGeometryExtrudedHeight(r,s),r===jn.CLAMP_TO_GROUND&&(r=hi.getMinimumMaximumHeights(oC.computeRectangle(a,Dge)).minimumTerrainHeight),a.extrudedHeight=r};$h.DynamicGeometryUpdater=yv;function yv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(yv.prototype=Object.create(ri.prototype),yv.prototype.constructor=yv);yv.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ri.prototype._isHidden.call(this,e,t,n)};yv.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,Ke.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,Ke.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(oC.computeRectangle(i,Dge)).minimumTerrainHeight),i.extrudedHeight=s};var YF=$h;var Rge={};function prt(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var _rt=new fe,grt=new fe;function yrt(e,t,n,i){t=So(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,_rt);s&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],_=u[0],m=p===_,y=1;for(let b=1;b<o;++b){let x=t[b],T=e.cartesianToCartographic(x,grt);s&&(T.height=n[b]),m=m&&T.height===0,prt(d,T)?d.height<T.height&&(c[y-1]=T.height):(a[y]=x,c[y]=T.height,r?u[y]=i[b]:u[y]=0,m=m&&c[y]===u[y],fe.clone(T,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var brt=new Array(2),xrt=new Array(2),Trt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Rge.computePositions=function(e,t,n,i,o,r){let s=yrt(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=D.chordLength(o,e.maximumRadius),p=Trt;if(p.minDistance=d,p.ellipsoid=e,r){let _=0,m;for(m=0;m<a-1;m++)_+=Fi.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(_*3),f=new Float64Array(_*3);let y=brt,b=xrt;p.positions=y,p.height=b;let x=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let T=Fi.generateArc(p);u.set(T,x),b[0]=i[m],b[1]=i[m+1],f.set(Fi.generateArc(p),x),x+=T.length}}else p.positions=t,p.height=n,u=new Float64Array(Fi.generateArc(p)),p.height=i,f=new Float64Array(Fi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var rC=Rge;var fX=new h,W8=new h,Crt=new h,Oge=new h,Art=new h,Ert=new h,Srt=new h;function sC(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??De.DEFAULT,r=e.granularity??D.RADIANS_PER_DEGREE,s=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=De.clone(o),this._granularity=r,this._ellipsoid=te.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+De.packedLength+1}sC.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+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n]=e._granularity,t};var Mge=te.clone(te.UNIT_SPHERE),Lge=new De,XF={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Mge,vertexFormat:Lge,granularity:void 0};sC.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=te.unpack(e,t,Mge);t+=te.packedLength;let u=De.unpack(e,t,Lge);t+=De.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=De.clone(u,n._vertexFormat),n._granularity=f,n):(XF.positions=r,XF.minimumHeights=s,XF.maximumHeights=a,XF.granularity=f,new sC(XF))};sC.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new sC(c)};sC.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=rC.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,_=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,x=o.st?new Float32Array(p/3*2):void 0,T=0,C=0,A=0,S=0,w=0,R=Srt,P=Ert,O=Art,L=!0;d/=3;let g,E=0,v=1/(d-f-1);for(g=0;g<d;++g){let k=g*3,z=h.fromArray(u,k,fX),B=h.fromArray(c,k,W8);if(o.position&&(_[T++]=B.x,_[T++]=B.y,_[T++]=B.z,_[T++]=z.x,_[T++]=z.y,_[T++]=z.z),o.st&&(x[w++]=E,x[w++]=0,x[w++]=E,x[w++]=1),o.normal||o.tangent||o.bitangent){let j=h.clone(h.ZERO,Oge),W=h.subtract(z,s.geodeticSurfaceNormal(z,W8),W8);if(g+1<d&&(j=h.fromArray(u,k+3,Oge)),L){let J=h.subtract(j,z,Crt),Y=h.subtract(W,z,fX);R=h.normalize(h.cross(Y,J,R),R),L=!1}h.equalsEpsilon(z,j,D.EPSILON10)?L=!0:(E+=v,o.tangent&&(P=h.normalize(h.subtract(j,z,P),P)),o.bitangent&&(O=h.normalize(h.cross(R,P,O),O))),o.normal&&(m[C++]=R.x,m[C++]=R.y,m[C++]=R.z,m[C++]=R.x,m[C++]=R.y,m[C++]=R.z),o.tangent&&(y[S++]=P.x,y[S++]=P.y,y[S++]=P.z,y[S++]=P.x,y[S++]=P.y,y[S++]=P.z),o.bitangent&&(b[A++]=O.x,b[A++]=O.y,b[A++]=O.z,b[A++]=O.x,b[A++]=O.y,b[A++]=O.z)}}let I=new dn;o.position&&(I.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:_})),o.normal&&(I.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:x}));let N=p/3;p-=6*(f+1);let F=ke.createTypedArray(N,p),U=0;for(g=0;g<N-2;g+=2){let k=g,z=g+2,B=h.fromArray(_,k*3,fX),j=h.fromArray(_,z*3,W8);if(h.equalsEpsilon(B,j,D.EPSILON10))continue;let W=g+1,J=g+3;F[U++]=W,F[U++]=k,F[U++]=J,F[U++]=J,F[U++]=k,F[U++]=z}return new lt({attributes:I,indices:F,primitiveType:Le.TRIANGLES,boundingSphere:new re.fromVertices(_)})};var KF=sC;var Nge=new h,Fge=new h;function aC(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+1}aC.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+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var Bge=te.clone(te.UNIT_SPHERE),$F={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Bge,granularity:void 0};aC.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=te.unpack(e,t,Bge);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):($F.positions=r,$F.minimumHeights=s,$F.maximumHeights=a,$F.granularity=u,new aC($F))};aC.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new aC(c)};aC.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=rC.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let _;for(_=0;_<u;++_){let T=_*3,C=h.fromArray(c,T,Nge),A=h.fromArray(a,T,Fge);d[p++]=A.x,d[p++]=A.y,d[p++]=A.z,d[p++]=C.x,d[p++]=C.y,d[p++]=C.z}let m=new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let b=ke.createTypedArray(y,f),x=0;for(_=0;_<y-2;_+=2){let T=_,C=_+2,A=h.fromArray(d,T*3,Nge),S=h.fromArray(d,C*3,Fge);if(h.equalsEpsilon(A,S,D.EPSILON10))continue;let w=_+1,R=_+3;b[x++]=w,b[x++]=T,b[x++]=w,b[x++]=R,b[x++]=T,b[x++]=C}return b[x++]=y-2,b[x++]=y-1,new lt({attributes:m,indices:b,primitiveType:Le.LINES,boundingSphere:new re.fromVertices(d)})};var ZF=aC;var kge=new H;function vrt(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 Zh(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new vrt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Zh.prototype=Object.create(si.prototype),Zh.prototype.constructor=Zh);Zh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,kge)),l(c)||(c=H.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new It({id:t,geometry:new KF(this._options),attributes:i})};Zh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,kge),o=this._distanceDisplayConditionProperty.getValue(e);return new It({id:t,geometry:new ZF(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Zh.prototype._isHidden=function(e,t){return!l(t.positions)||si.prototype._isHidden.call(this,e,t)};Zh.prototype._getIsClosed=function(e){return!1};Zh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};Zh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Wt,s=this._options;s.vertexFormat=r?un.VERTEX_FORMAT:ho.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};Zh.DynamicGeometryUpdater=bv;function bv(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(bv.prototype=Object.create(ri.prototype),bv.prototype.constructor=bv);bv.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ri.prototype._isHidden.call(this,e,t,n)};bv.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var QF=Zh;var cC=[KR,gF,cF,DF,OF,NF,UF,qF,YF,QF];function lC(e,t){this.entity=e,this.scene=t;let n=new Array(cC.length),i=new me,o=new Tr;for(let r=0;r<n.length;r++){let s=new cC[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(lC.prototype._onEntityPropertyChanged,this)}lC.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)};lC.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};lC.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ce(this)};lC.registerUpdater=function(e){cC.includes(e)||cC.push(e)};lC.unregisterUpdater=function(e){if(cC.includes(e)){let t=cC.indexOf(e);cC.splice(t,1)}};var uC=lC;var Uge=new H,wrt=new Rt,Irt=new Rt,Prt=h.ZERO,Drt=new h;function Qh(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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.subscriptions=new wt,this.showsUpdated=new wt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Qh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Qh.prototype.onMaterialChanged=function(){this.invalidated=!0};Qh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Qh.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};Qh.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};Qh.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=sr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Pn({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 Wt)&&(this.depthFailMaterial=sr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,x=X.getValueOrDefault(b,e,H.WHITE,Uge);H.equals(d._lastColor,x)||(d._lastColor=H.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Wt&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,x=X.getValueOrDefault(b,e,H.WHITE,Uge);H.equals(d._lastDepthFailColor,x)||(d._lastDepthFailColor=H.clone(x,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(x,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,Irt,wrt);Rt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(b,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,Prt,Drt);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=io.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Qh.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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Qh.prototype.contains=function(e){return this.updaters.contains(e.id)};Qh.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)};Qh.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 xv(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}xv.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 Qh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function zge(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}xv.prototype.remove=function(e){zge(this._solidItems,e)||zge(this._translucentItems,e)};function Vge(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function q8(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}xv.prototype.update=function(e){let t=q8(this,this._solidItems,e,!0);t=q8(this,this._translucentItems,e,t)&&t;let n=Vge(this,this._solidItems,e),i=Vge(this,this._translucentItems,e);return(n||i)&&(t=q8(this,this._solidItems,e,t)&&t,t=q8(this,this._translucentItems,e,t)&&t),t};function Hge(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}xv.prototype.getBoundingSphere=function(e,t){let n=Hge(this._solidItems,e,t);return n===ut.FAILED?Hge(this._translucentItems,e,t):n};function Gge(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}xv.prototype.removeAllPrimitives=function(){Gge(this._solidItems),Gge(this._translucentItems)};var Pd=xv;var Rrt=new Rt,Ort=new Rt,Mrt=h.ZERO,Lrt=new h;function Jh(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 wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Jh.prototype.onMaterialChanged,this),this.subscriptions=new wt,this.showsUpdated=new wt}Jh.prototype.onMaterialChanged=function(){this.invalidated=!0};Jh.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};Jh.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.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};Jh.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 Nrt=new H;Jh.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=sr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=sr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Pn({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=sr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Wt)&&(this.depthFailMaterial=sr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Wt&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,x=X.getValueOrDefault(b,e,H.WHITE,Nrt);H.equals(d._lastDepthFailColor,x)||(d._lastDepthFailColor=H.clone(x,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(x,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,Ort,Rrt);Rt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(b,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,Mrt,Lrt);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=io.toValue(b,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Jh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Jh.prototype.contains=function(e){return this.updaters.contains(e.id)};Jh.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)};Jh.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 Tv(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}Tv.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 Jh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};Tv.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}}};Tv.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};Tv.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};Tv.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 Dd=Tv;var Wge=er(jge(),1);function Y8(){this._tree=new Wge.default}function fC(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}fC.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};Y8.prototype.insert=function(e,t){let n=fC.fromRectangleAndId(e,t,new fC);this._tree.insert(n)};function Frt(e,t){return e.id===t.id}var Brt=new fC;Y8.prototype.remove=function(e,t){let n=fC.fromRectangleAndId(e,t,Brt);this._tree.remove(n,Frt)};var krt=new fC;Y8.prototype.collides=function(e){let t=fC.fromRectangleAndId("",e,krt);return this._tree.collides(t)};var dC=Y8;var Urt=new H,zrt=new Rt,Vrt=new Rt;function Lg(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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.subscriptions=new wt,this.showsUpdated=new wt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new dC}Lg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Lg.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||!X.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)}))}};Lg.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};Lg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new cl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,b=X.getValueOrDefault(y,e,H.WHITE,Urt);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Yt.toValue(b,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Vrt,zrt);Rt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Lg.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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Lg.prototype.contains=function(e){return this.updaters.contains(e.id)};Lg.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};Lg.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 Cv(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Cv.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=X.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 Lg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};Cv.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};Cv.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};Cv.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};Cv.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var Av=Cv;var Hrt=new Rt,Grt=new Rt;function Rd(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Rd.prototype.onMaterialChanged,this),this.subscriptions=new wt,this.showsUpdated=new wt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new dC}Rd.prototype.onMaterialChanged=function(){this.invalidated=!0};Rd.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Rd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};Rd.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||!X.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};Rd.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};Rd.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=sr.getValue(e,this.materialProperty,this.material),n=new cl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=sr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Grt,Hrt);Rt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Rd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Rd.prototype.contains=function(e){return this.updaters.contains(e.id)};Rd.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)};Rd.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 Ev(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}Ev.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Uu.shouldUseSphericalCoordinates(o.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new Rd(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};Ev.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}}};Ev.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};Ev.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};Ev.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 JF=Ev;var jrt=new H,Wrt=new Rt,qrt=new Rt,Yrt=h.ZERO,Xrt=new h;function Ng(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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.itemsToRemove=[],this.subscriptions=new wt,this.showsUpdated=new wt}Ng.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};Ng.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};Ng.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 Pn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new un({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,x=X.getValueOrDefault(b,e,H.WHITE,jrt);H.equals(d._lastColor,x)||(d._lastColor=H.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,qrt,Wrt);Rt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(b,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,Yrt,Xrt);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=io.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ng.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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ng.prototype.contains=function(e){return this.updaters.contains(e.id)};Ng.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)};Ng.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 Sv(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new wt,this._translucentBatches=new wt}Sv.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 Ng(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 Ng(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};Sv.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};Sv.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};Sv.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};Sv.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 vv=Sv;var Krt=[];function pu(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 wt,this._removedObjects=new wt,this._changedObjects=new wt;let o=xn.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=ar.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new vv(n,e,s,!1),this._outlineBatches[o+s]=new vv(n,e,s,!0),this._closedColorBatches[s]=new Pd(n,un,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Pd(n,un,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Dd(n,ho,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Dd(n,ho,void 0,!0,s,!1),this._openColorBatches[s]=new Pd(n,un,void 0,!1,s,!0),this._openColorBatches[o+s]=new Pd(n,un,void 0,!1,s,!1),this._openMaterialBatches[s]=new Dd(n,ho,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Dd(n,ho,void 0,!1,s,!1);let a=zn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new JF(i,s,ho)),c[s]=new Av(i,s);else for(s=0;s<a;++s)c[s]=new Av(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new JT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new wt,this._updaterSets=new wt,this._entityCollection=t,t.collectionChanged.addEventListener(pu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Krt)}pu.registerUpdater=function(e){uC.registerUpdater(e)};pu.unregisterUpdater=function(e){uC.unregisterUpdater(e)};pu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new uC(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(pu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,_=this._batches,m=_.length;for(a=0;a<m;a++)p=_[a].update(e)&&p;return p};var $rt=[],Zrt=new re;pu.prototype.getBoundingSphere=function(e,t){let n=$rt,i=Zrt,o=0,r=ut.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(d,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=re.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,re.fromBoundingSpheres(n,t),ut.DONE)};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(pu.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(),ce(this)};pu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};pu.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=xn.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 Wt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Wt?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 Wt?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)};pu._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)};pu.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 e2=pu;var Qrt=1,Jrt="30px sans-serif",est=$o.FILL,tst=H.WHITE,nst=H.BLACK,ist=1,ost=!1,rst=new H(.165,.165,.165,.8),sst=new V(7,5),ast=V.ZERO,cst=h.ZERO,lst=Ke.NONE,ust=Ci.CENTER,fst=Fn.CENTER,dst=new h,hst=new H,mst=new H,pst=new H,_st=new V,gst=new h,yst=new V,bst=new Vt,xst=new Vt,Tst=new Vt,Cst=new Rt;function qge(e){this.entity=e,this.label=void 0,this.index=void 0}function H0(e,t){t.collectionChanged.addEventListener(H0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new wt,this._onCollectionChanged(t,t.values,[],[])}H0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,dst),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){mX(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,_=X.getValueOrDefault(a._heightReference,e,lst);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=h.equals(u.position,d)&&u.heightReference===_),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,Qrt),u.font=X.getValueOrDefault(a._font,e,Jrt),u.style=X.getValueOrDefault(a._style,e,est),u.fillColor=X.getValueOrDefault(a._fillColor,e,tst,hst),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,nst,mst),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,ist),u.showBackground=X.getValueOrDefault(a._showBackground,e,ost),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,rst,pst),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,sst,_st),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,ast,yst),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,cst,gst),u.heightReference=_,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,ust),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,fst),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,bst),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,xst),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Tst),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Cst),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};H0.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=h.clone(i._clampedPosition??i.position,t.center),t.radius=0,ut.DONE};H0.prototype.isDestroyed=function(){return!1};H0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(H0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ce(this)};H0.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 qge(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 qge(r)):(mX(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],mX(s.get(r.id),r,a),s.remove(r.id)};function mX(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var t2=H0;var Ast=1,Est=!0,Sst=0,vst=!0,wst=!0,Ist=xn.ENABLED,Pst=Ke.NONE,Dst=H.RED,Rst=0,Ost=H.WHITE,Mst=Lc.HIGHLIGHT,Lst=.5,Nst=new V(1,1),Yge={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Fst=new M,Bst=new M,Xge=new H,Kge=new Array(4),kst=new h;function G0(e,t){t.collectionChanged.addEventListener(G0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new wt,this._onCollectionChanged(t,t.values,[],[])}async function Ust(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await Mh.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}}G0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,Fst),c=Ee.createIfNeeded(X.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Yge}},n[s.id]=u;let m=X.getValueOrDefault(a._incrementallyLoadTextures,e,vst),y=X.getValueOrDefault(a._environmentMapOptions,e,Yge,u.environmentMapOptionsScratch);Ust(this,s,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(a._scale,e,Ast),p.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,Est),p.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,Sst),p.maximumScale=X.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=M.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(a._shadows,e,Ist),p.heightReference=X.getValueOrDefault(a._heightReference,e,Pst),p.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,Dst,Xge),p.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,Rst),p.color=X.getValueOrDefault(a._color,e,Ost,Xge),p.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,Mst),p.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,Lst),p.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,wst),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,Nst);let _=X.getValueOrUndefined(a._lightColor,e);if(l(_)&&(H.pack(_,Kge,0),_=h.unpack(Kge,0,kst)),p.lightColor=_,p.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:su.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(y)){let T=Object.keys(y);for(let C=0,A=T.length;C<A;++C){let S=T[C],w=y[S];if(!l(w))continue;let R=p.getNode(S);if(!l(R))continue;let P=M.fromTranslationRotationScale(w,Bst);R.matrix=M.multiply(R.originalMatrix,P,P)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let C=0,A=T.length;C<A;++C){let S=T[C],w=x[S];l(w)&&(b=!0,p.setArticulationStage(S,w))}}b&&p.applyArticulations()}}return!0};G0.prototype.isDestroyed=function(){return!1};G0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(G0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)pX(this,e[i],t,n);return ce(this)};var X8=new h,zst=new fe;G0.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??te.default;if(i.heightReference!==Ke.NONE){let a=i.modelMatrix;X8.x=a[12],X8.y=a[13],X8.z=a[14];let c=r.cartesianToCartographic(X8,zst),u=o.getHeight(c,i.heightReference);return l(u)&&(Zf(i.heightReference)?c.height=u:c.height+=u),re.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ut.DONE}return re.clone(i.boundingSphere,t),ut.DONE};G0.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)?(Vst(r,a),s.set(r.id,r)):(pX(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],pX(this,r,a,c),s.remove(r.id)};function pX(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Vst(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var n2=G0;function j0(e){this._definitionChanged=new me,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(j0.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Gi.FIXED}}});var Hst=new $;j0.prototype.getValue=function(e,t){return l(e)||(e=$.now(Hst)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};j0.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))};j0.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};j0.prototype.equals=function(e){return this===e||e instanceof j0&&this._value===e._value};j0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var up=j0;var Gst=60,jst=1,Zge=new En,_X=new En,gX=new En;function $ge(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Wst(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||$.lessThanOrEquals(o,t)||$.greaterThanOrEquals(o,n),p=0,_=i.length,m=i[p],y=n,b=!1,x,T,C;for(;p<_;){if(!d&&$.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),d=!0),$.greaterThan(m,t)&&$.lessThan(m,y)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<_-1){if(s>0&&!b){let A=i[p+1],S=$.secondsDifference(A,m);b=S>s,b&&(x=Math.ceil(S/s),T=0,C=S/Math.max(x,2),x=Math.max(x-1,1))}if(b&&T<x){m=$.addSeconds(m,C,new $),T++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function qst(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=!l(i)||$.lessThanOrEquals(i,t)||$.greaterThanOrEquals(i,n);for(;$.lessThan(d,n);)!p&&$.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=$.addSeconds(t,r*u,new $);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Yst(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=Math.max(r,60),_=!l(i)||$.lessThanOrEquals(i,t)||$.greaterThanOrEquals(i,n);for(;$.lessThan(d,n);)!_&&$.greaterThanOrEquals(d,i)&&(_=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=$.addSeconds(t,p*u,new $);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Xst(e,t,n,i,o,r,s,a){gX.start=t,gX.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,gX,Zge).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=$.addSeconds(d.start,$.secondsDifference(d.stop,d.start)/2,new $));let _=e.getValueInReferenceFrame(p,o,a[c]);l(_)&&(a[c]=_,c++)}}return c}function Kst(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function $st(e,t,n,i,o,r,s,a){_X.start=t,_X.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,_X,Zge).isEmpty){let p=d.start,_=d.stop,m=t;$.greaterThan(p,m)&&(m=p);let y=n;$.lessThan(_,y)&&(y=_),c=Qge(d.data,m,y,i,o,r,c,a)}}return c}function Qge(e,t,n,i,o,r,s,a){for(;e instanceof wg;)e=e.resolvedProperty;if(e instanceof La){let c=e._property._times;s=Wst(e,t,n,c,i,o,r,s,a)}else e instanceof $R?s=qst(e,t,n,i,o,r,s,a):e instanceof Oa?s=$st(e,t,n,i,o,r,s,a):e instanceof Ig?s=Xst(e,t,n,i,o,r,s,a):e instanceof ul||e instanceof up&&X.isConstant(e)?s=Kst(e,t,n,i,o,r,s,a):s=Yst(e,t,n,i,o,r,s,a);return s}function Jge(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Qge(e,t,n,i,o,r,0,s);return s.length=a,s}var Zst=new Z;function i2(e,t){this._unusedIndexes=[],this._polylineCollection=new Fh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}i2.prototype.update=function(e){if(this._referenceFrame===Gi.INERTIAL){let t=At.computeIcrfToCentralBodyFixedMatrix(e,Zst);M.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};i2.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=X.getValueOrUndefined(i._leadTime,e),p=X.getValueOrUndefined(i._trailTime,e),_=n._availability,m=l(_),y=l(d),b=l(p);if(u=m||y&&b,u){if(b&&(r=$.addSeconds(e,-p,new $)),y&&(s=$.addSeconds(e,d,new $)),m){let x=_.start,T=_.stop;(!b||$.greaterThan(x,r))&&(r=x),(!y||$.lessThan(T,s))&&(s=T)}u=$.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let _=d.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,Gst);c.show=!0,c.positions=Jge(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=sr.getValue(e,i._material,c.material),c.width=X.getValueOrDefault(i._width,e,jst),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};i2.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)};i2.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ce(this)};function W0(e,t){t.collectionChanged.addEventListener(W0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new wt,this._onCollectionChanged(t,t.values,[],[])}W0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=Gi.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new i2(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(W0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ce(this)};W0.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 $ge(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 $ge(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))};W0._subSample=Jge;var o2=W0;var eye=H.WHITE,tye=H.BLACK,nye=0,iye=1,oye=0,rye=Wr.NONE,sye=new H,Qst=new h,aye=new H,cye=new Vt,lye=new Vt,uye=new Rt;function fye(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 q0(e,t){t.collectionChanged.addEventListener(q0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new wt,this._onCollectionChanged(t,t.values,[],[])}q0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=X.getValueOrDefault(a._heightReference,e,Ke.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,Qst),d=l(p)),!d){r2(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let _=!1,m=!1;if(f!==Ke.NONE&&!l(u)?(l(c)&&(r2(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,_=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===Ke.NONE&&!l(c)&&(l(u)&&(r2(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,cye),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,lye),c.color=X.getValueOrDefault(a._color,e,eye,sye),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,tye,aye),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,nye),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,iye),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,uye),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,oye),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,rye);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,cye),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,lye),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,uye),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,oye),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,rye),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,eye,sye),b=X.getValueOrDefault(a._outlineColor,e,tye,aye),x=Math.round(X.getValueOrDefault(a._outlineWidth,e,nye)),T=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,iye)));if(x>0?(u.scale=1,_=_||x!==r.outlineWidth||T!==r.pixelSize||!H.equals(y,r.color)||!H.equals(b,r.outlineColor)):(u.scale=T/50,T=50,_=_||x!==r.outlineWidth||!H.equals(y,r.color)||!H.equals(b,r.outlineColor)),_){r.color=H.clone(y,r.color),r.outlineColor=H.clone(b,r.outlineColor),r.pixelSize=T,r.outlineWidth=x;let C=y.alpha,A=y.toCssColorString(),S=b.toCssColorString(),w=JSON.stringify([A,T,S,x]);u.setImage(w,ET(C,A,S,x,T))}m&&u._updateClamping()}}return!0};q0.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=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};q0.prototype.isDestroyed=function(){return!1};q0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(q0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ce(this)};q0.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 fye(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 fye(r)):(r2(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],r2(s.get(r.id),r,a),s.remove(r.id)};function r2(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 s2=q0;var _ye=[];function Jst(e,t,n,i,o){let r=_ye;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,_=i.blue,m=i.alpha;if(H.equals(n,i)){for(s=0;s<o;s++)r[s]=H.clone(n);return r}let y=(d-a)/o,b=(p-c)/o,x=(_-u)/o,T=(m-f)/o;for(s=0;s<o;s++)r[s]=new H(a+s*y,c+s*b,u+s*x,f+s*T);return r}function a2(e){e=e??G.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=De.clone(e.vertexFormat??De.DEFAULT),this._arcType=e.arcType??tn.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*H.packedLength:1,this.packedLength=r+te.packedLength+De.packedLength+4}a2.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+=h.packedLength)h.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+=H.packedLength)H.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var gye=te.clone(te.UNIT_SPHERE),yye=new De,hC={positions:void 0,colors:void 0,ellipsoid:gye,vertexFormat:yye,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};a2.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=te.unpack(e,t,gye);t+=te.packedLength;let c=De.unpack(e,t,yye);t+=De.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=De.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(hC.positions=r,hC.colors=s,hC.width=u,hC.colorsPerVertex=f,hC.arcType=d,hC.granularity=p,new a2(hC))};var dye=new h,hye=new h,mye=new h,pye=new h;a2.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=So(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let N=0,F=d[0];i=i.filter(function(U,k){let z=!1;return o?z=k===F||k===0&&F===1:z=k+1===F,z?(N++,F=d[N],!1):!0})}let _=p.length;if(_<2||t<=0)return;if(r===tn.GEODESIC||r===tn.RHUMB){let N,F;r===tn.GEODESIC?(N=D.chordLength(s,a.maximumRadius),F=Fi.numberOfPoints):(N=s,F=Fi.numberOfPointsRhumbLine);let U=Fi.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c<_-1;++c)k+=F(p[c],p[c+1],N);let z=new Array(k),B=0;for(c=0;c<_-1;++c){let j=p[c],W=p[c+1],J=i[c],Y=F(j,W,N);if(o&&c<k){let ee=i[c+1],Q=Jst(j,W,J,ee,Y),de=Q.length;for(u=0;u<de;++u)z[B++]=Q[u]}else for(u=0;u<Y;++u)z[B++]=H.clone(J)}z[B]=H.clone(i[i.length-1]),i=z,_ye.length=0}r===tn.GEODESIC?p=Fi.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:U}):p=Fi.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:U})}_=p.length;let m=_*4-4,y=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float64Array(m*3),T=new Float32Array(m*2),C=n.st?new Float32Array(m*2):void 0,A=l(i)?new Uint8Array(m*4):void 0,S=0,w=0,R=0,P=0,O;for(u=0;u<_;++u){u===0?(O=dye,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,mye),h.clone(p[u],hye),u===_-1?(O=dye,h.subtract(p[_-1],p[_-2],O),h.add(p[_-1],O,O)):O=p[u+1],h.clone(O,pye);let N,F;l(A)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==_-1&&(F=i[u]));let U=u===0?2:0,k=u===_-1?2:4;for(f=U;f<k;++f){h.pack(hye,y,S),h.pack(mye,b,S),h.pack(pye,x,S),S+=3;let z=f-2<0?-1:1;if(T[w++]=2*(f%2)-1,T[w++]=z*t,n.st&&(C[R++]=u/(_-1),C[R++]=Math.max(T[w-2],0)),l(A)){let B=f<2?N:F;A[P++]=H.floatToByte(B.red),A[P++]=H.floatToByte(B.green),A[P++]=H.floatToByte(B.blue),A[P++]=H.floatToByte(B.alpha)}}}let L=new dn;L.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b}),L.nextPosition=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x}),L.expandAndWidth=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(L.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:C})),l(A)&&(L.color=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));let g=ke.createTypedArray(m,_*6-6),E=0,v=0,I=_-1;for(u=0;u<I;++u)g[v++]=E,g[v++]=E+2,g[v++]=E+1,g[v++]=E+1,g[v++]=E+2,g[v++]=E+3,E+=4;return new lt({attributes:L,indices:g,primitiveType:Le.TRIANGLES,boundingSphere:re.fromPoints(p),geometryType:Gf.POLYLINES})};var Fg=a2;var eat=new Qn(0),K8={},bye=new H,tat=new Wt(H.WHITE),nat=new Qn(!0),iat=new Qn(xn.DISABLED),oat=new Qn(new Rt),rat=new Qn(zn.BOTH);function sat(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function aat(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function em(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(em.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new me,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 sat,this._groundGeometryOptions=new aat,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=ar.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(em.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)&&X.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}}});em.prototype.isOutlineVisible=function(e){return!1};em.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};em.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Wt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,bye)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)),this.clampToGround?new It({id:t,geometry:new vx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Wt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,bye)),l(a)||(a=H.WHITE),s.depthFailColor=Yt.fromColor(a)),new It({id:t,geometry:new Fg(this._geometryOptions),attributes:s}))};em.prototype.createOutlineGeometryInstance=function(e){};em.prototype.isDestroyed=function(){return!1};em.prototype.destroy=function(){this._entitySubscription(),ce(this)};em.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(Ge.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??tat,u=c instanceof Wt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??nat,this._shadowsProperty=o.shadows??iat,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??oat,this._classificationTypeProperty=o.classificationType??rat,this._fillEnabled=!0,this._zIndex=a??eat;let f=o.width,d=o.arcType,p=o.clampToGround,_=o.granularity;if(!r.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(_)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=r.getValue(Ge.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Wt)?b=ls.VERTEX_FORMAT:b=wa.VERTEX_FORMAT,m.vertexFormat=b,m.positions=y,m.width=l(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(Ge.MINIMUM_VALUE):void 0,m.granularity=l(_)?_.getValue(Ge.MINIMUM_VALUE):void 0;let x=this._groundGeometryOptions;x.positions=y,x.width=m.width,x.arcType=m.arcType,x.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&bt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};em.prototype.createDynamicUpdater=function(e,t){return new c2(e,t,this)};var wv={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function c2(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 xye(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=K8[n];!l(i)||i.isDestroyed()?(i=new Fh,K8[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}c2.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=X.getValueOrUndefined(o,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,tn.GEODESIC),t._groundGeometryOptions.granularity=X.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)||!X.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Wt)p=new ls;else{let _=sr.getValue(e,d,this._material);p=new wa({material:_,translucent:_.isTranslucent()}),this._material=_}this._groundPolylinePrimitive=s.add(new dh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=xye(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=tn.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==tn.NONE&&l(u)&&(wv.ellipsoid=f,wv.positions=r,wv.granularity=X.getValueOrUndefined(i._granularity,e),wv.height=Fi.extractHeights(r,f),c===tn.GEODESIC?r=Fi.generateCartesianArc(wv):r=Fi.generateCartesianRhumbArc(wv)),a.show=!0,a.positions=r.slice(),a.material=sr.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};c2.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 re.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=xye(this);if(t.show&&t.positions.length>0)return re.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};c2.prototype.isDestroyed=function(){return!1};c2.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=K8[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete K8[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ce(this)};var l2=em;var cat=new H,lat=new Rt,uat=new Rt;function tm(e,t,n,i,o){let r;n instanceof Wt?r=ls:r=wa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(tm.prototype.onMaterialChanged,this),this.subscriptions=new wt,this.showsUpdated=new wt,this.zIndex=i,this._asynchronous=o}tm.prototype.onMaterialChanged=function(){this.invalidated=!0};tm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};tm.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||!X.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};tm.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};tm.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 dh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===wa&&(this.material=sr.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===wa&&(this.material=sr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,b=X.getValueOrDefault(y,e,H.WHITE,cat);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Yt.toValue(b,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,uat,lat);Rt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Rt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};tm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};tm.prototype.contains=function(e){return this.updaters.contains(e.id)};tm.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)};tm.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 Iv(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}Iv.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=X.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 tm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};Iv.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}}};Iv.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};Iv.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};Iv.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 u2=Iv;var fat=[];function Tye(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Cye(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 Wt?1:2);let r;l(i)&&(r=i+o*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Wt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function fp(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 wt,this._removedObjects=new wt,this._changedObjects=new wt;let o,r=xn.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 Pd(n,ls,void 0,!1,o),this._materialBatches[o]=new Dd(n,wa,void 0,!1,o),this._colorBatches[o+r]=new Pd(n,ls,ls,!1,o),this._materialBatches[o+r]=new Dd(n,wa,ls,!1,o),this._colorBatches[o+r*2]=new Pd(n,ls,wa,!1,o),this._materialBatches[o+r*2]=new Dd(n,wa,wa,!1,o);this._dynamicBatch=new JT(n,i);let s=zn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new u2(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new wt,this._updaters=new wt,this._entityCollection=t,t.collectionChanged.addEventListener(fp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,fat)}fp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Tye(this,f),Cye(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),Tye(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new l2(c,this._scene),this._updaters.set(u,f),Cye(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(fp._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,_=p.length;for(a=0;a<_;a++)d=p[a].update(e)&&d;return d};var dat=[],hat=new re;fp.prototype.getBoundingSphere=function(e,t){let n=dat,i=hat,o=0,r=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=re.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,re.fromBoundingSpheres(n,t),ut.DONE)};fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(fp.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(),ce(this)};fp._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)};fp.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 f2=fp;function _u(e){cl.initializeTerrainHeights(),dh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Tr,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??_u.defaultVisualizersCallback;let i=!1,o=new Rl,r=new Rl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new mF;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var Pv=[];_u.registerVisualizer=function(e){Pv.includes(e)||Pv.push(e)};_u.unregisterVisualizer=function(e){if(Pv.includes(e)){let t=Pv.indexOf(e);Pv.splice(t,1)}};_u.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new B1(t,i),new e2(e,i,n._primitives,n._groundPrimitives),new t2(t,i),new n2(e,i),new JN(e,i),new s2(t,i),new o2(e,i),new f2(e,i,n._primitives,n._groundPrimitives),...Pv.map(o=>new o(e,i))]};Object.defineProperties(_u.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}}});_u.prototype.isDestroyed=function(){return!1};_u.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)),ce(this)};_u.prototype.update=function(e){if(!hi.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};_u.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 mat=[],pat=new re;_u.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 _=p.get(i);if(_.entities.contains(e)){r=_;break}}}if(!l(r))return ut.FAILED;let s=mat,a=pat,c=0,u=ut.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ut.PENDING)return ut.PENDING;u===ut.DONE&&(s[c]=re.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,re.fromBoundingSpheres(s,n),ut.DONE)};_u.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Rl),s=o.add(new PF);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};_u.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};_u.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 d2=_u;function yX(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}yX.clone=function(e,t){if(l(e))return l(t)||(t=new yX),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Od=yX;var Aye=new Z,Eye=new Z,Sye=new Z,_at=new M,$8=new h,vye=new h,bX=new h,xX=new h,wye=new h,Iye=new h,gat=new Pe,yat=new h,bat=new Z,Dv=new $,xat=1.25;function Tat(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,d=o.getValue(c,e._lastCartesian);if(l(d)){let p=!1,_=!1,m,y,b;if(f===ne.SCENE3D){$.addSeconds(c,.001,Dv);let R=o.getValue(Dv,$8);if(l(R)||($.addSeconds(c,-.001,Dv),R=o.getValue(Dv,$8),_=!0),l(R)){let P=At.computeFixedToIcrfMatrix(c,Aye),O=At.computeFixedToIcrfMatrix(Dv,Eye),L;!l(P)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,Sye),P=Z.transpose(L,Aye),O=At.computeTemeToPseudoFixedMatrix(Dv,Eye),Z.transpose(O,O)):L=Z.transpose(P,Sye);let g=Z.multiplyByVector(P,d,wye),E=Z.multiplyByVector(O,R,Iye);h.subtract(g,E,xX);let v=h.magnitude(xX)*1e3,I=D.GRAVITATIONALPARAMETER,N=-I/(v*v-2*I/h.magnitude(g));N<0||N>xat*u.maximumRadius?(m=vye,h.normalize(d,m),h.negate(m,m),b=h.clone(h.UNIT_Z,bX),y=h.cross(b,m,$8),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),b=h.cross(m,y,bX),h.normalize(b,b),p=!0)):h.equalsEpsilon(d,R,D.EPSILON7)||(b=vye,h.normalize(g,b),h.normalize(E,E),y=h.cross(b,E,bX),_&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,b,$8),Z.multiplyByVector(L,m,m),Z.multiplyByVector(L,y,y),Z.multiplyByVector(L,b,b),h.normalize(m,m),h.normalize(y,y),h.normalize(b,b),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let x,T,C;i&&(x=h.clone(t.position,xX),T=h.clone(t.direction,wye),C=h.clone(t.up,Iye));let A=_at,S;l(s)&&(S=s.getValue(c,gat));let w=r.getValue(c,yat);if(a===h_.INERTIAL&&l(S))M.fromTranslationQuaternionRotationScale(d,S,h.ONE,A);else if(a===h_.VELOCITY&&l(w)){let R=At.rotationMatrixFromPositionVelocity(d,w,u,bat);M.fromRotationTranslation(R,d,A)}else a===h_.ENU||!p?At.eastNorthUpToFixedFrame(d,u,A):(A[0]=m.x,A[1]=m.y,A[2]=m.z,A[3]=0,A[4]=y.x,A[5]=y.y,A[6]=y.z,A[7]=0,A[8]=b.x,A[9]=b.y,A[10]=b.z,A[11]=0,A[12]=d.x,A[13]=d.y,A[14]=d.z,A[15]=0);t._setTransform(A),i&&(h.clone(x,t.position),h.clone(T,t.direction),h.clone(C,t.up),h.cross(T,C,t.right))}if(n){let p=f===ne.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function h2(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Dg(e.position,!0),this._offset3D=new h}Object.defineProperties(h2,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});h2.defaultOffset3D=new h(-14e3,3500,3500);var Z8=new Od,Cat=new h;h2.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,d=o!==this._mode,p=n.camera,_=f||d,m=!0;if(f){let y=r.viewFrom,b=l(y);if(!b&&l(t)){Z8.pitch=-D.PI_OVER_FOUR,Z8.range=0;let x=a.getValue(e,Cat);if(l(x)){let T=2-1/Math.max(1,h.magnitude(x)/i.maximumRadius);Z8.pitch*=T}p.viewBoundingSphere(t,Z8),this.boundingSphere=t,_=!1,m=!1}else(!b||!l(y.getValue(e,this._offset3D)))&&h.clone(h2._defaultOffset3D,this._offset3D)}else!d&&this._mode!==ne.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Tat(this,p,_,m,a,c,u,s,e,i)};var m2=h2;function oH(e){return rH(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function rH(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?rH(n):n),[])}var Pye=[0,1,2,3].concat(...oH([[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 Ar(){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,u=e.stat_desc.max_length,f,d,p,_,m,y,b=0;for(_=0;_<=15;_++)o.bl_count[_]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],_=r[r[d*2+1]*2+1]+1,_>u&&(_=u,b++),r[d*2+1]=_,!(d>e.max_code)&&(o.bl_count[_]++,m=0,d>=c&&(m=a[d-c]),y=r[d*2],o.opt_len+=y*(_+m),s&&(o.static_len+=y*(s[d*2+1]+m)));if(b!==0){do{for(_=u-1;o.bl_count[_]===0;)_--;o.bl_count[_]--,o.bl_count[_+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(_=u;_!==0;_--)for(d=o.bl_count[_];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=_&&(o.opt_len+=(_-r[p*2+1])*r[p*2],r[p*2+1]=_),d--)}}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,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=f<2?++f:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,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)}}Ar._length_code=[0,1,2,3,4,5,6,7].concat(...oH([[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]]));Ar.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];Ar.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];Ar.d_code=function(e){return e<256?Pye[e]:Pye[256+(e>>>7)]};Ar.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];Ar.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];Ar.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];Ar.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function oc(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 Aat=[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],Eat=oH([[144,8],[112,9],[24,7],[8,8]]);oc.static_ltree=rH(Aat.map((e,t)=>[e,Eat[t]]));var Sat=[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],vat=oH([[30,5]]);oc.static_dtree=rH(Sat.map((e,t)=>[e,vat[t]]));oc.static_l_desc=new oc(oc.static_ltree,Ar.extra_lbits,257,286,15);oc.static_d_desc=new oc(oc.static_dtree,Ar.extra_dbits,0,30,15);oc.static_bl_desc=new oc(null,Ar.extra_blbits,0,19,7);var wat=9,Iat=8;function dp(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 Rye=0,nH=1,mC=2,nm=[new dp(0,0,0,0,Rye),new dp(4,4,8,4,nH),new dp(4,5,16,8,nH),new dp(4,6,32,32,nH),new dp(4,4,16,16,mC),new dp(8,16,32,32,mC),new dp(8,16,128,128,mC),new dp(8,32,128,256,mC),new dp(32,128,258,1024,mC),new dp(32,258,258,4096,mC)],Q8=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Md=0,J8=1,p2=2,eH=3,Pat=32,TX=42,tH=113,_2=666,CX=8,Dat=0,AX=1,Rat=2,Br=3,iH=258,df=iH+Br+1;function Dye(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Oat(){let e=this,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y,b,x,T,C,A,S,w,R,P,O,L,g,E,v,I,N,F,U,k=new Ar,z=new Ar,B=new Ar;e.depth=[];let j,W,J,Y,ee,Q;e.bl_count=[],e.heap=[],N=[],F=[],U=[];function de(){u=2*r,d[_-1]=0;for(let Ue=0;Ue<_-1;Ue++)d[Ue]=0;L=nm[g].max_lazy,v=nm[g].good_length,I=nm[g].nice_length,O=nm[g].max_chain,S=0,x=0,R=0,T=P=Br-1,A=0,p=0}function ge(){let Ue;for(Ue=0;Ue<286;Ue++)N[Ue*2]=0;for(Ue=0;Ue<30;Ue++)F[Ue*2]=0;for(Ue=0;Ue<19;Ue++)U[Ue*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,W=J=0}function le(){k.dyn_tree=N,k.stat_desc=oc.static_l_desc,z.dyn_tree=F,z.stat_desc=oc.static_d_desc,B.dyn_tree=U,B.stat_desc=oc.static_bl_desc,ee=0,Q=0,Y=8,ge()}e.pqdownheap=function(Ue,ot){let Ye=e.heap,Ze=Ye[ot],pt=ot<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&Dye(Ue,Ye[pt+1],Ye[pt],e.depth)&&pt++,!Dye(Ue,Ze,Ye[pt],e.depth));)Ye[ot]=Ye[pt],ot=pt,pt<<=1;Ye[ot]=Ze};function ye(Ue,ot){let Ye=-1,Ze,pt=Ue[0*2+1],qt=0,An=7,Bo=4;pt===0&&(An=138,Bo=3),Ue[(ot+1)*2+1]=65535;for(let wo=0;wo<=ot;wo++)Ze=pt,pt=Ue[(wo+1)*2+1],!(++qt<An&&Ze==pt)&&(qt<Bo?U[Ze*2]+=qt:Ze!==0?(Ze!=Ye&&U[Ze*2]++,U[16*2]++):qt<=10?U[17*2]++:U[18*2]++,qt=0,Ye=Ze,pt===0?(An=138,Bo=3):Ze==pt?(An=6,Bo=3):(An=7,Bo=4))}function xe(){let Ue;for(ye(N,k.max_code),ye(F,z.max_code),B.build_tree(e),Ue=18;Ue>=3&&U[Ar.bl_order[Ue]*2+1]===0;Ue--);return e.opt_len+=3*(Ue+1)+5+5+4,Ue}function Ie(Ue){e.pending_buf[e.pending++]=Ue}function Te(Ue){Ie(Ue&255),Ie(Ue>>>8&255)}function ve(Ue){Ie(Ue>>8&255),Ie(Ue&255&255)}function Ve(Ue,ot){let Ye,Ze=ot;Q>16-Ze?(Ye=Ue,ee|=Ye<<Q&65535,Te(ee),ee=Ye>>>16-Q,Q+=Ze-16):(ee|=Ue<<Q&65535,Q+=Ze)}function $e(Ue,ot){let Ye=Ue*2;Ve(ot[Ye]&65535,ot[Ye+1]&65535)}function Ct(Ue,ot){let Ye,Ze=-1,pt,qt=Ue[0*2+1],An=0,Bo=7,wo=4;for(qt===0&&(Bo=138,wo=3),Ye=0;Ye<=ot;Ye++)if(pt=qt,qt=Ue[(Ye+1)*2+1],!(++An<Bo&&pt==qt)){if(An<wo)do $e(pt,U);while(--An!==0);else pt!==0?(pt!=Ze&&($e(pt,U),An--),$e(16,U),Ve(An-3,2)):An<=10?($e(17,U),Ve(An-3,3)):($e(18,U),Ve(An-11,7));An=0,Ze=pt,qt===0?(Bo=138,wo=3):pt==qt?(Bo=6,wo=3):(Bo=7,wo=4)}}function Jt(Ue,ot,Ye){let Ze;for(Ve(Ue-257,5),Ve(ot-1,5),Ve(Ye-4,4),Ze=0;Ze<Ye;Ze++)Ve(U[Ar.bl_order[Ze]*2+1],3);Ct(N,Ue-1),Ct(F,ot-1)}function Qe(){Q==16?(Te(ee),ee=0,Q=0):Q>=8&&(Ie(ee&255),ee>>>=8,Q-=8)}function mn(){Ve(AX<<1,3),$e(256,oc.static_ltree),Qe(),1+Y+10-Q<9&&(Ve(AX<<1,3),$e(256,oc.static_ltree),Qe()),Y=7}function Bt(Ue,ot){let Ye,Ze,pt;if(e.dist_buf[W]=Ue,e.lc_buf[W]=ot&255,W++,Ue===0?N[ot*2]++:(J++,Ue--,N[(Ar._length_code[ot]+256+1)*2]++,F[Ar.d_code(Ue)*2]++),(W&8191)===0&&g>2){for(Ye=W*8,Ze=S-x,pt=0;pt<30;pt++)Ye+=F[pt*2]*(5+Ar.extra_dbits[pt]);if(Ye>>>=3,J<Math.floor(W/2)&&Ye<Math.floor(Ze/2))return!0}return W==j-1}function Ot(Ue,ot){let Ye,Ze,pt=0,qt,An;if(W!==0)do Ye=e.dist_buf[pt],Ze=e.lc_buf[pt],pt++,Ye===0?$e(Ze,Ue):(qt=Ar._length_code[Ze],$e(qt+256+1,Ue),An=Ar.extra_lbits[qt],An!==0&&(Ze-=Ar.base_length[qt],Ve(Ze,An)),Ye--,qt=Ar.d_code(Ye),$e(qt,ot),An=Ar.extra_dbits[qt],An!==0&&(Ye-=Ar.base_dist[qt],Ve(Ye,An)));while(pt<W);$e(256,Ue),Y=Ue[256*2+1]}function Jn(){Q>8?Te(ee):Q>0&&Ie(ee&255),ee=0,Q=0}function bi(Ue,ot,Ye){Jn(),Y=8,Ye&&(Te(ot),Te(~ot)),e.pending_buf.set(c.subarray(Ue,Ue+ot),e.pending),e.pending+=ot}function Gt(Ue,ot,Ye){Ve((Dat<<1)+(Ye?1:0),3),bi(Ue,ot,!0)}function Pt(Ue,ot,Ye){let Ze,pt,qt=0;g>0?(k.build_tree(e),z.build_tree(e),qt=xe(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ue!=-1?Gt(Ue,ot,Ye):pt==Ze?(Ve((AX<<1)+(Ye?1:0),3),Ot(oc.static_ltree,oc.static_dtree)):(Ve((Rat<<1)+(Ye?1:0),3),Jt(k.max_code+1,z.max_code+1,qt+1),Ot(N,F)),ge(),Ye&&Jn()}function oo(Ue){Pt(x>=0?x:-1,S-x,Ue),x=S,t.flush_pending()}function xt(){let Ue,ot,Ye,Ze;do{if(Ze=u-R-S,Ze===0&&S===0&&R===0)Ze=r;else if(Ze==-1)Ze--;else if(S>=r+r-df){c.set(c.subarray(r,r+r),0),w-=r,S-=r,x-=r,Ue=_,Ye=Ue;do ot=d[--Ye]&65535,d[Ye]=ot>=r?ot-r:0;while(--Ue!==0);Ue=r,Ye=Ue;do ot=f[--Ye]&65535,f[Ye]=ot>=r?ot-r:0;while(--Ue!==0);Ze+=r}if(t.avail_in===0)return;Ue=t.read_buf(c,S+R,Ze),R+=Ue,R>=Br&&(p=c[S]&255,p=(p<<b^c[S+1]&255)&y)}while(R<df&&t.avail_in!==0)}function Jo(Ue){let ot=65535,Ye;for(ot>i-5&&(ot=i-5);;){if(R<=1){if(xt(),R===0&&Ue==0)return Md;if(R===0)break}if(S+=R,R=0,Ye=x+ot,(S===0||S>=Ye)&&(R=S-Ye,S=Ye,oo(!1),t.avail_out===0)||S-x>=r-df&&(oo(!1),t.avail_out===0))return Md}return oo(Ue==4),t.avail_out===0?Ue==4?p2:Md:Ue==4?eH:J8}function vr(Ue){let ot=O,Ye=S,Ze,pt,qt=P,An=S>r-df?S-(r-df):0,Bo=I,wo=a,pc=S+iH,_c=c[Ye+qt-1],Ii=c[Ye+qt];P>=v&&(ot>>=2),Bo>R&&(Bo=R);do if(Ze=Ue,!(c[Ze+qt]!=Ii||c[Ze+qt-1]!=_c||c[Ze]!=c[Ye]||c[++Ze]!=c[Ye+1])){Ye+=2,Ze++;do;while(c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&Ye<pc);if(pt=iH-(pc-Ye),Ye=pc-iH,pt>qt){if(w=Ue,qt=pt,pt>=Bo)break;_c=c[Ye+qt-1],Ii=c[Ye+qt]}}while((Ue=f[Ue&wo]&65535)>An&&--ot!==0);return qt<=R?qt:R}function mc(Ue){let ot=0,Ye;for(;;){if(R<df){if(xt(),R<df&&Ue==0)return Md;if(R===0)break}if(R>=Br&&(p=(p<<b^c[S+(Br-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S),ot!==0&&(S-ot&65535)<=r-df&&E!=2&&(T=vr(ot)),T>=Br)if(Ye=Bt(S-w,T-Br),R-=T,T<=L&&R>=Br){T--;do S++,p=(p<<b^c[S+(Br-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S;while(--T!==0);S++}else S+=T,T=0,p=c[S]&255,p=(p<<b^c[S+1]&255)&y;else Ye=Bt(0,c[S]&255),R--,S++;if(Ye&&(oo(!1),t.avail_out===0))return Md}return oo(Ue==4),t.avail_out===0?Ue==4?p2:Md:Ue==4?eH:J8}function Ur(Ue){let ot=0,Ye,Ze;for(;;){if(R<df){if(xt(),R<df&&Ue==0)return Md;if(R===0)break}if(R>=Br&&(p=(p<<b^c[S+(Br-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S),P=T,C=w,T=Br-1,ot!==0&&P<L&&(S-ot&65535)<=r-df&&(E!=2&&(T=vr(ot)),T<=5&&(E==1||T==Br&&S-w>4096)&&(T=Br-1)),P>=Br&&T<=P){Ze=S+R-Br,Ye=Bt(S-1-C,P-Br),R-=P-1,P-=2;do++S<=Ze&&(p=(p<<b^c[S+(Br-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S);while(--P!==0);if(A=0,T=Br-1,S++,Ye&&(oo(!1),t.avail_out===0))return Md}else if(A!==0){if(Ye=Bt(0,c[S-1]&255),Ye&&oo(!1),S++,R--,t.avail_out===0)return Md}else A=1,S++,R--}return A!==0&&(Ye=Bt(0,c[S-1]&255),A=0),oo(Ue==4),t.avail_out===0?Ue==4?p2:Md:Ue==4?eH:J8}function Ms(Ue){return Ue.total_in=Ue.total_out=0,Ue.msg=null,e.pending=0,e.pending_out=0,n=tH,o=0,le(),de(),0}e.deflateInit=function(Ue,ot,Ye,Ze,pt,qt){return Ze||(Ze=CX),pt||(pt=Iat),qt||(qt=0),Ue.msg=null,ot==-1&&(ot=6),pt<1||pt>wat||Ze!=CX||Ye<9||Ye>15||ot<0||ot>9||qt<0||qt>2?-2:(Ue.dstate=e,s=Ye,r=1<<s,a=r-1,m=pt+7,_=1<<m,y=_-1,b=Math.floor((m+Br-1)/Br),c=new Uint8Array(r*2),f=[],d=[],j=1<<pt+6,e.pending_buf=new Uint8Array(j*4),i=j*4,e.dist_buf=new Uint16Array(j),e.lc_buf=new Uint8Array(j),g=ot,E=qt,Ms(Ue))},e.deflateEnd=function(){return n!=TX&&n!=tH&&n!=_2?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==tH?-3:0)},e.deflateParams=function(Ue,ot,Ye){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||Ye<0||Ye>2?-2:(nm[g].func!=nm[ot].func&&Ue.total_in!==0&&(Ze=Ue.deflate(1)),g!=ot&&(g=ot,L=nm[g].max_lazy,v=nm[g].good_length,I=nm[g].nice_length,O=nm[g].max_chain),E=Ye,Ze)},e.deflateSetDictionary=function(Ue,ot,Ye){let Ze=Ye,pt,qt=0;if(!ot||n!=TX)return-2;if(Ze<Br)return 0;for(Ze>r-df&&(Ze=r-df,qt=Ye-Ze),c.set(ot.subarray(qt,qt+Ze),0),S=Ze,x=Ze,p=c[0]&255,p=(p<<b^c[1]&255)&y,pt=0;pt<=Ze-Br;pt++)p=(p<<b^c[pt+(Br-1)]&255)&y,f[pt&a]=d[p],d[p]=pt;return 0},e.deflate=function(Ue,ot){let Ye,Ze,pt,qt,An;if(ot>4||ot<0)return-2;if(!Ue.next_out||!Ue.next_in&&Ue.avail_in!==0||n==_2&&ot!=4)return Ue.msg=Q8[4],-2;if(Ue.avail_out===0)return Ue.msg=Q8[7],-5;if(t=Ue,qt=o,o=ot,n==TX&&(Ze=CX+(s-8<<4)<<8,pt=(g-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,S!==0&&(Ze|=Pat),Ze+=31-Ze%31,n=tH,ve(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=qt&&ot!=4)return t.msg=Q8[7],-5;if(n==_2&&t.avail_in!==0)return Ue.msg=Q8[7],-5;if(t.avail_in!==0||R!==0||ot!=0&&n!=_2){switch(An=-1,nm[g].func){case Rye:An=Jo(ot);break;case nH:An=mc(ot);break;case mC:An=Ur(ot);break;default:}if((An==p2||An==eH)&&(n=_2),An==Md||An==p2)return t.avail_out===0&&(o=-1),0;if(An==J8){if(ot==1)mn();else if(Gt(0,0,!1),ot==3)for(Ye=0;Ye<_;Ye++)d[Ye]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function Oye(){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}Oye.prototype={deflateInit(e,t){let n=this;return n.dstate=new Oat,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 Mye(e){let t=this,n=new Oye,i=Mat(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 u,f,d=0,p=0,_=0,m=[];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,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),_+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(_),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,d=[];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&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function Mat(e){return e+5*(Math.floor(e/16383)+1)}var hf=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Jye=1440,Lat=0,Nat=4,Fat=9,Bat=5,kat=[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],Uat=[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],zat=[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],Vat=[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],Hat=[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],Gat=[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],Y0=15;function wX(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,_,m,y,b,x,T,C){let A,S,w,R,P,O,L,g,E,v,I,N,F,U,k;v=0,P=d;do i[u[f+v]]++,v++,P--;while(P!==0);if(i[0]==d)return y[0]=-1,b[0]=0,0;for(g=b[0],O=1;O<=Y0&&i[O]===0;O++);for(L=O,g<O&&(g=O),P=Y0;P!==0&&i[P]===0;P--);for(w=P,g>P&&(g=P),b[0]=g,U=1<<O;O<P;O++,U<<=1)if((U-=i[O])<0)return-3;if((U-=i[P])<0)return-3;for(i[P]+=U,s[1]=O=0,v=1,F=2;--P!==0;)s[F]=O+=i[v],F++,v++;P=0,v=0;do(O=u[f+v])!==0&&(C[s[O]++]=P),v++;while(++P<d);for(d=s[w],s[0]=P=0,v=0,R=-1,N=-g,r[0]=0,I=0,k=0;L<=w;L++)for(A=i[L];A--!==0;){for(;L>N+g;){if(R++,N+=g,k=w-N,k=k>g?g:k,(S=1<<(O=L-N))>A+1&&(S-=A+1,F=L,O<k))for(;++O<k&&!((S<<=1)<=i[++F]);)S-=i[F];if(k=1<<O,T[0]+k>Jye)return-3;r[R]=I=T[0],T[0]+=k,R!==0?(s[R]=P,o[0]=O,o[1]=g,O=P>>>N-g,o[2]=I-r[R-1]-O,x.set(o,(r[R-1]+O)*3)):y[0]=I}for(o[1]=L-N,v>=d?o[0]=192:C[v]<p?(o[0]=C[v]<256?0:96,o[2]=C[v++]):(o[0]=m[C[v]-p]+16+64,o[2]=_[C[v++]-p]),S=1<<L-N,O=P>>>N;O<k;O+=S)x.set(o,(I+O)*3);for(O=1<<L-1;(P&O)!==0;O>>>=1)P^=O;for(P^=O,E=(1<<N)-1;(P&E)!=s[R];)R--,N-=g,E=(1<<N)-1}return U!==0&&w!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(Y0+1),o=[],r=new Int32Array(Y0),s=new Int32Array(Y0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<Y0+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,Y0),0),s.set(i.subarray(0,Y0+1),0)}e.inflate_trees_bits=function(u,f,d,p,_){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,d,f,p,t,n),m==-3?_.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(_.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,d,p,_,m,y,b,x){let T;return c(288),t[0]=0,T=a(d,0,u,257,zat,Vat,m,p,b,t,n),T!=0||p[0]===0?(T==-3?x.msg="oversubscribed literal/length tree":T!=-4&&(x.msg="incomplete literal/length tree",T=-3),T):(c(288),T=a(d,u,f,0,Hat,Gat,y,_,b,t,n),T!=0||_[0]===0&&u>257?(T==-3?x.msg="oversubscribed distance tree":T==-5?(x.msg="incomplete distance tree",T=-3):T!=-4&&(x.msg="empty distance tree with lengths",T=-3),T):0)}}wX.inflate_trees_fixed=function(e,t,n,i){return e[0]=Fat,t[0]=Bat,n[0]=kat,i[0]=Uat,0};var sH=0,Lye=1,Nye=2,Fye=3,Bye=4,kye=5,Uye=6,EX=7,zye=8,aH=9;function jat(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,_,m=0;function y(b,x,T,C,A,S,w,R){let P,O,L,g,E,v,I,N,F,U,k,z,B,j,W,J;I=R.next_in_index,N=R.avail_in,E=w.bitb,v=w.bitk,F=w.write,U=F<w.read?w.read-F-1:w.end-F,k=hf[b],z=hf[x];do{for(;v<20;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;if(P=E&k,O=T,L=C,J=(L+P)*3,(g=O[J])===0){E>>=O[J+1],v-=O[J+1],w.win[F++]=O[J+2],U--;continue}do{if(E>>=O[J+1],v-=O[J+1],(g&16)!==0){for(g&=15,B=O[J+2]+(E&hf[g]),E>>=g,v-=g;v<15;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;P=E&z,O=A,L=S,J=(L+P)*3,g=O[J];do if(E>>=O[J+1],v-=O[J+1],(g&16)!==0){for(g&=15;v<g;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;if(j=O[J+2]+(E&hf[g]),E>>=g,v-=g,U-=B,F>=j)W=F-j,F-W>0&&2>F-W?(w.win[F++]=w.win[W++],w.win[F++]=w.win[W++],B-=2):(w.win.set(w.win.subarray(W,W+2),F),F+=2,W+=2,B-=2);else{W=F-j;do W+=w.end;while(W<0);if(g=w.end-W,B>g){if(B-=g,F-W>0&&g>F-W)do w.win[F++]=w.win[W++];while(--g!==0);else w.win.set(w.win.subarray(W,W+g),F),F+=g,W+=g,g=0;W=0}}if(F-W>0&&B>F-W)do w.win[F++]=w.win[W++];while(--B!==0);else w.win.set(w.win.subarray(W,W+B),F),F+=B,W+=B,B=0;break}else if((g&64)===0)P+=O[J+2],P+=E&hf[g],J=(L+P)*3,g=O[J];else return R.msg="invalid distance code",B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,-3;while(!0);break}if((g&64)===0){if(P+=O[J+2],P+=E&hf[g],J=(L+P)*3,(g=O[J])===0){E>>=O[J+1],v-=O[J+1],w.win[F++]=O[J+2],U--;break}}else return(g&32)!==0?(B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,1):(R.msg="invalid literal/length code",B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,-3)}while(!0)}while(U>=258&&N>=10);return B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,0}e.init=function(b,x,T,C,A,S){t=sH,u=b,f=x,d=T,p=C,_=A,m=S,i=null},e.proc=function(b,x,T){let C,A,S,w=0,R=0,P=0,O,L,g,E;for(P=x.next_in_index,O=x.avail_in,w=b.bitb,R=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L;;)switch(t){case sH:if(g>=258&&O>=10&&(b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,T=y(u,f,d,p,_,m,b,x),P=x.next_in_index,O=x.avail_in,w=b.bitb,R=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L,T!=0)){t=T==1?EX:aH;break}r=u,i=d,o=p,t=Lye;case Lye:for(C=r;R<C;){if(O!==0)T=0;else return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);O--,w|=(x.read_byte(P++)&255)<<R,R+=8}if(A=(o+(w&hf[C]))*3,w>>>=i[A+1],R-=i[A+1],S=i[A],S===0){s=i[A+2],t=Uye;break}if((S&16)!==0){a=S&15,n=i[A+2],t=Nye;break}if((S&64)===0){r=S,o=A/3+i[A+2];break}if((S&32)!==0){t=EX;break}return t=aH,x.msg="invalid literal/length code",T=-3,b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);case Nye:for(C=a;R<C;){if(O!==0)T=0;else return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);O--,w|=(x.read_byte(P++)&255)<<R,R+=8}n+=w&hf[C],w>>=C,R-=C,r=f,i=_,o=m,t=Fye;case Fye:for(C=r;R<C;){if(O!==0)T=0;else return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);O--,w|=(x.read_byte(P++)&255)<<R,R+=8}if(A=(o+(w&hf[C]))*3,w>>=i[A+1],R-=i[A+1],S=i[A],(S&16)!==0){a=S&15,c=i[A+2],t=Bye;break}if((S&64)===0){r=S,o=A/3+i[A+2];break}return t=aH,x.msg="invalid distance code",T=-3,b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);case Bye:for(C=a;R<C;){if(O!==0)T=0;else return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);O--,w|=(x.read_byte(P++)&255)<<R,R+=8}c+=w&hf[C],w>>=C,R-=C,t=kye;case kye:for(E=L-c;E<0;)E+=b.end;for(;n!==0;){if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,T=b.inflate_flush(x,T),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);b.win[L++]=b.win[E++],g--,E==b.end&&(E=0),n--}t=sH;break;case Uye:if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,T=b.inflate_flush(x,T),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);T=0,b.win[L++]=s,g--,t=sH;break;case EX:if(R>7&&(R-=8,O++,P--),b.write=L,T=b.inflate_flush(x,T),L=b.write,g=L<b.read?b.read-L-1:b.end-L,b.read!=b.write)return b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);t=zye;case zye:return T=1,b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);case aH:return T=-3,b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T);default:return T=-2,b.bitb=w,b.bitk=R,x.avail_in=O,x.total_in+=P-x.next_in_index,x.next_in_index=P,b.write=L,b.inflate_flush(x,T)}},e.free=function(){}}var Vye=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Rv=0,SX=1,Hye=2,Gye=3,jye=4,Wye=5,cH=6,lH=7,qye=8,pC=9;function Wat(e,t){let n=this,i=Rv,o=0,r=0,s=0,a,c=[0],u=[0],f=new jat,d=0,p=new Int32Array(Jye*3),_=0,m=new wX;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(y,b){b&&(b[0]=_),i==cH&&f.free(y),i=Rv,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,b){let x,T,C;return T=y.next_out_index,C=n.read,x=(C<=n.write?n.write:n.end)-C,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),T),T+=x,C+=x,C==n.end&&(C=0,n.write==n.end&&(n.write=0),x=n.write-C,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),T),T+=x,C+=x),y.next_out_index=T,n.read=C,b},n.proc=function(y,b){let x,T,C,A,S,w,R,P;for(A=y.next_in_index,S=y.avail_in,T=n.bitb,C=n.bitk,w=n.write,R=w<n.read?n.read-w-1:n.end-w;;){let O,L,g,E,v,I,N,F;switch(i){case Rv:for(;C<3;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}switch(x=T&7,d=x&1,x>>>1){case 0:T>>>=3,C-=3,x=C&7,T>>>=x,C-=x,i=SX;break;case 1:O=[],L=[],g=[[]],E=[[]],wX.inflate_trees_fixed(O,L,g,E),f.init(O[0],L[0],g[0],0,E[0],0),T>>>=3,C-=3,i=cH;break;case 2:T>>>=3,C-=3,i=Gye;break;case 3:return T>>>=3,C-=3,i=pC,y.msg="invalid block type",b=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b)}break;case SX:for(;C<32;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if((~T>>>16&65535)!=(T&65535))return i=pC,y.msg="invalid stored block lengths",b=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);o=T&65535,T=C=0,i=o!==0?Hye:d!==0?lH:Rv;break;case Hye:if(S===0||R===0&&(w==n.end&&n.read!==0&&(w=0,R=w<n.read?n.read-w-1:n.end-w),R===0&&(n.write=w,b=n.inflate_flush(y,b),w=n.write,R=w<n.read?n.read-w-1:n.end-w,w==n.end&&n.read!==0&&(w=0,R=w<n.read?n.read-w-1:n.end-w),R===0)))return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);if(b=0,x=o,x>S&&(x=S),x>R&&(x=R),n.win.set(y.read_buf(A,x),w),A+=x,S-=x,w+=x,R-=x,(o-=x)!==0)break;i=d!==0?lH:Rv;break;case Gye:for(;C<14;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(r=x=T&16383,(x&31)>29||(x>>5&31)>29)return i=pC,y.msg="too many length or distance symbols",b=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);if(x=258+(x&31)+(x>>5&31),!a||a.length<x)a=[];else for(P=0;P<x;P++)a[P]=0;T>>>=14,C-=14,s=0,i=jye;case jye:for(;s<4+(r>>>10);){for(;C<3;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}a[Vye[s++]]=T&7,T>>>=3,C-=3}for(;s<19;)a[Vye[s++]]=0;if(c[0]=7,x=m.inflate_trees_bits(a,c,u,p,y),x!=0)return b=x,b==-3&&(a=null,i=pC),n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);s=0,i=Wye;case Wye:for(;x=r,!(s>=258+(x&31)+(x>>5&31));){let U,k;for(x=c[0];C<x;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(x=p[(u[0]+(T&hf[x]))*3+1],k=p[(u[0]+(T&hf[x]))*3+2],k<16)T>>>=x,C-=x,a[s++]=k;else{for(P=k==18?7:k-14,U=k==18?11:3;C<x+P;){if(S!==0)b=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(T>>>=x,C-=x,U+=T&hf[P],T>>>=P,C-=P,P=s,x=r,P+U>258+(x&31)+(x>>5&31)||k==16&&P<1)return a=null,i=pC,y.msg="invalid bit length repeat",b=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);k=k==16?a[P-1]:0;do a[P++]=k;while(--U!==0);s=P}}if(u[0]=-1,v=[],I=[],N=[],F=[],v[0]=9,I[0]=6,x=r,x=m.inflate_trees_dynamic(257+(x&31),1+(x>>5&31),a,v,I,N,F,p,y),x!=0)return x==-3&&(a=null,i=pC),b=x,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);f.init(v[0],I[0],p,N[0],p,F[0]),i=cH;case cH:if(n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,(b=f.proc(n,y,b))!=1)return n.inflate_flush(y,b);if(b=0,f.free(y),A=y.next_in_index,S=y.avail_in,T=n.bitb,C=n.bitk,w=n.write,R=w<n.read?n.read-w-1:n.end-w,d===0){i=Rv;break}i=lH;case lH:if(n.write=w,b=n.inflate_flush(y,b),w=n.write,R=w<n.read?n.read-w-1:n.end-w,n.read!=n.write)return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);i=qye;case qye:return b=1,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);case pC:return b=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b);default:return b=-2,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,b)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,b,x){n.win.set(y.subarray(b,b+x),0),n.read=n.write=x},n.sync_point=function(){return i==SX?1:0}}var qat=32,Yat=8,Xat=0,Yye=1,Xye=2,Kye=3,$ye=4,Zye=5,vX=6,g2=7,Qye=12,X0=13,Kat=[0,0,255,255];function $at(){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=g2,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 Wat(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==Nat?-5:0,o=-5;;)switch(s.mode){case Xat: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)!=Yat){s.mode=X0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=X0,n.msg="invalid win size",s.marker=5;break}s.mode=Yye;case Yye: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=X0,n.msg="incorrect header check",s.marker=5;break}if((r&qat)===0){s.mode=g2;break}s.mode=Xye;case Xye: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=Kye;case Kye: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=$ye;case $ye: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=Zye;case Zye: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=vX,2);case vX:return s.mode=X0,n.msg="need dictionary",s.marker=0,-2;case g2:if(o=s.blocks.proc(n,o),o==-3){s.mode=X0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Qye;case Qye:return n.avail_in=0,1;case X0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=vX)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=g2,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=X0&&(c.mode=X0,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)==Kat[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=g2,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function e0e(){}e0e.prototype={inflateInit(e){let t=this;return t.istate=new $at,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 t0e(e){let t=this,n=new e0e,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Lat,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,d,p=0,_=0,m=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),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=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 u.length>1?(d=new Uint8Array(m),u.forEach(function(y){d.set(y,_),_+=y.length})):d=u[0]?new Uint8Array(u[0]):new Uint8Array,d}},t.flush=function(){n.inflateEnd()}}var _C="/",IX=new Date(2107,11,31),PX=new Date(1980,0,1),yi=void 0,mf="undefined",Bg="function";var y2=class{constructor(t){return class extends null{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 Zat=64,n0e=2;try{typeof navigator!=mf&&navigator.hardwareConcurrency&&(n0e=navigator.hardwareConcurrency)}catch{}var Qat={chunkSize:512*1024,maxWorkers:n0e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:yi,CompressionStreamNative:typeof CompressionStream!=mf&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=mf&&DecompressionStream},$0=Object.assign({},Qat);function b2(){return $0}function uH(e){return Math.max(e.chunkSize,Zat)}function Ov(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:d}=e;if(K0("baseURL",t),K0("chunkSize",n),K0("maxWorkers",i),K0("terminateWorkerTimeout",o),K0("useCompressionStream",r),K0("useWebWorkers",s),a&&($0.CompressionStream=new y2(a)),c&&($0.DecompressionStream=new y2(c)),K0("CompressionStream",u),K0("DecompressionStream",f),d!==yi){let{deflate:p,inflate:_}=d;if((p||_)&&($0.workerScripts||($0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");$0.workerScripts.deflate=p}if(_){if(!Array.isArray(_))throw new Error("workerScripts.inflate must be an array");$0.workerScripts.inflate=_}}}function K0(e,t){t!==yi&&($0[e]=t)}var i0e=[];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;i0e[e]=t}var kg=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^i0e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var x2=class extends null{constructor(){let t,n=new kg;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function Mv(e){if(typeof TextEncoder==mf){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 Ml={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Ml.getPartial(n);return i===32?e.concat(t):Ml._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+Ml.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]=Ml.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=Ml.getPartial(o);return i.push(Ml.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},T2={bytes:{fromBits(e){let n=Ml.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(Ml.partial(8*(n&3),i)),t}}},o0e={};o0e.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=T2.utf8String.toBits(e));let n=t._buffer=Ml.concat(t._buffer,e),i=t._length,o=t._length=i+Ml.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=Ml.concat(t,[Ml.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var DX={};DX.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,_=o[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=_=_<<24^_>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],_=e[2]^n[2],m=e[t?1:3]^n[3],y=4,b,x,T;for(let C=0;C<i;C++)b=s[d>>>24]^a[p>>16&255]^c[_>>8&255]^u[m&255]^n[y],x=s[p>>>24]^a[_>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],T=s[_>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[_&255]^n[y+3],y+=4,d=b,p=x,_=T;for(let C=0;C<4;C++)o[t?3&-C:C]=f[d>>>24]<<24^f[p>>16&255]<<16^f[_>>8&255]<<8^f[m&255]^n[y++],b=d,d=p,p=_,_=m,m=b;return o}};var r0e={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}},RX={};RX.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=Ml.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 Ml.clamp(t,o)}};var Z0={importKey(e){return new Z0.hmacSha1(T2.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,_=Ml;for(t=T2.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(_.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)d.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};Z0.hmacSha1=class{constructor(e){let t=this,n=t._hash=o0e.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 Jat=typeof crypto!=mf&&typeof crypto.getRandomValues==Bg,Q0="Invalid password",gC="Invalid signature",Ug="zipjs-abort-check-password";function fH(e){return Jat?crypto.getRandomValues(e):r0e.getRandomValues(e)}var Lv=16,ect="raw",c0e={name:"PBKDF2"},tct={name:"HMAC"},nct="SHA-1",ict=Object.assign({hash:tct},c0e),OX=Object.assign({iterations:1e3,hash:{name:nct}},c0e),oct=["deriveBits"],A2=[8,12,16],C2=[16,24,32],J0=10,rct=[0,0,0,0],mH=typeof crypto!=mf,v2=mH&&crypto.subtle,l0e=mH&&typeof v2!=mf,hp=T2.bytes,sct=DX.aes,act=RX.ctrGladman,cct=Z0.hmacSha1,s0e=mH&&l0e&&typeof v2.importKey==Bg,a0e=mH&&l0e&&typeof v2.deriveBits==Bg,dH=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:d0e(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await lct(c,f,u,Ld(s,0,A2[f]+2)),s=Ld(s,A2[f]+2),r?a.error(new Error(Ug)):d()):await p;let _=new Uint8Array(s.length-J0-(s.length-J0)%Lv);a.enqueue(u0e(c,s,_,0,J0,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:d}=this;if(u&&c){await d;let p=Ld(f,0,f.length-J0),_=Ld(f,f.length-J0),m=new Uint8Array;if(p.length){let y=S2(hp,p);u.update(y);let b=c.update(y);m=E2(hp,b)}if(a){let y=Ld(E2(hp,u.digest()),0,J0);for(let b=0;b<J0;b++)if(y[b]!=_[b])throw new Error(gC)}s.enqueue(m)}}})}},hH=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:d0e(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:d}=a,p=new Uint8Array;c?(p=await uct(a,u,c),f()):await d;let _=new Uint8Array(p.length+r.length-r.length%Lv);_.set(p,0),s.enqueue(u0e(a,r,_,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let d=s.update(S2(hp,c));a.update(d),f=E2(hp,d)}o.signature=E2(hp,a.digest()).slice(0,J0),r.enqueue(MX(f,o.signature))}}}),o=this}};function u0e(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=MX(c,t),n=hct(n,u-u%Lv));let f;for(f=0;f<=u-Lv;f+=Lv){let d=S2(hp,Ld(t,f,f+Lv));r&&a.update(d);let p=s.update(d);r||a.update(p),n.set(E2(hp,p),f+i)}return e.pending=Ld(t,f),n}async function lct(e,t,n,i){let o=await f0e(e,t,n,Ld(i,0,A2[t])),r=Ld(i,A2[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Q0)}async function uct(e,t,n){let i=fH(new Uint8Array(A2[t])),o=await f0e(e,t,n,i);return MX(i,o)}async function f0e(e,t,n,i){e.password=null;let o=await fct(ect,n,ict,!1,oct),r=await dct(Object.assign({salt:i},OX),o,8*(C2[t]*2+2)),s=new Uint8Array(r),a=S2(hp,Ld(s,0,C2[t])),c=S2(hp,Ld(s,C2[t],C2[t]*2)),u=Ld(s,C2[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new act(new sct(a),Array.from(rct)),hmac:new cct(c)}),u}async function fct(e,t,n,i,o){if(s0e)try{return await v2.importKey(e,t,n,i,o)}catch{return s0e=!1,Z0.importKey(t)}else return Z0.importKey(t)}async function dct(e,t,n){if(a0e)try{return await v2.deriveBits(e,t,n)}catch{return a0e=!1,Z0.pbkdf2(t,e.salt,OX.iterations,n)}else return Z0.pbkdf2(t,e.salt,OX.iterations,n)}function d0e(e,t){return t===yi?Mv(e):t}function MX(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 hct(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Ld(e,t,n){return e.subarray(t,n)}function E2(e,t){return e.fromBits(t)}function S2(e,t){return e.toBits(t)}var Nv=12,pH=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),_0e(this,t)},transform(o,r){let s=this;if(s.password){let a=h0e(s,o.subarray(0,Nv));if(s.password=null,a[Nv-1]!=s.passwordVerification)throw new Error(Q0);o=o.subarray(Nv)}i?r.error(new Error(Ug)):r.enqueue(h0e(s,o))}})}},_H=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),_0e(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=fH(new Uint8Array(Nv));c[Nv-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(m0e(r,c),0),a=Nv}else s=new Uint8Array(i.length),a=0;s.set(m0e(r,i),a),o.enqueue(s)}})}};function h0e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=g0e(e)^t[i],LX(e,n[i]);return n}function m0e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=g0e(e)^t[i],LX(e,t[i]);return n}function _0e(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new kg(n[0]),crcKey2:new kg(n[2])});for(let i=0;i<t.length;i++)LX(e,t.charCodeAt(i))}function LX(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=p0e(Math.imul(p0e(i+y0e(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function g0e(e){let t=e.keys[2]|2;return y0e(Math.imul(t,t^1)>>>8)}function y0e(e){return e&255}function p0e(e){return e&4294967295}var b0e="deflate-raw",gH=class extends null{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,d=this,p,_,m=x0e(super.readable);(!s||c)&&u&&(p=new x2,m=mp(m,p)),r&&(m=C0e(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=mp(m,new _H(t)):(_=new hH(t),m=mp(m,_))),T0e(d,m,()=>{let y;s&&!c&&(y=_.signature),(!s||c)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),d.signature=y})}},yH=class extends null{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,d,p,_=x0e(super.readable);s&&(r?_=mp(_,new pH(t)):(p=new dH(t),_=mp(_,p))),u&&(_=C0e(_,f,{chunkSize:n},o,i)),(!s||r)&&a&&(d=new x2,_=mp(_,d)),T0e(this,_,()=>{if((!s||r)&&a){let m=new DataView(d.value.buffer);if(c!=m.getUint32(0,!1))throw new Error(gC)}})}};function x0e(e){return mp(e,new null({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function T0e(e,t,n){t=mp(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function C0e(e,t,n,i,o){try{let r=t&&i?i:o;e=mp(e,new r(b0e,n))}catch{if(t)try{e=mp(e,new o(b0e,n))}catch{return e}else return e}return e}function mp(e,t){return e.pipeThrough(t)}var A0e="message",E0e="start",S0e="pull",NX="data",v0e="ack",FX="close",TH="deflate",CH="inflate";var bH=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(TH)?r=gH:o.startsWith(CH)&&(r=yH);let s=0,a=0,c=new r(t,n),u=super.readable,f=new null({transform(p,_){p&&p.length&&(a+=p.length,_.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),d=new null({transform(p,_){p&&p.length&&(s+=p.length,_.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(d)}})}},xH=class extends null{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var P0e=typeof Worker!=mf;var Fv=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:d}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new xH(r.chunkSize)).pipeThrough(new kX(n,s),{signal:d}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:_,busy:m}=t;_?(m?t.resolveTerminated=p:(_.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&P0e?mct:D0e)(t,r)}},kX=class extends null{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await BX(n,o)},async transform(a,c){s+=a.length,i&&await BX(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await BX(r,s)}})}};async function BX(e,...t){try{await e(...t)}catch{}}function D0e(e,t){return{run:()=>pct(e,t)}}function mct(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=yct(e.scripts[0],n,e)}catch{return P0e=!1,D0e(e,t)}Object.assign(e,{worker:o,interface:{run:()=>_ct(e,{chunkSize:i})}})}return e.interface}async function pct({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new bH(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 _ct(e,t){let n,i,o=new Promise((p,_)=>{n=p,i=_});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=gct(e.writable),f=AH({type:E0e,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let d=await o;return f||await c.getWriter().close(),await u,d}function gct(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 w0e=!0,I0e=!0;function yct(e,t,n){let i={type:"module"},o,r;typeof e==Bg&&(e=e());try{o=new URL(e,t)}catch{o=e}if(w0e)try{r=new Worker(o)}catch{w0e=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(A0e,s=>bct(s,n)),r}function AH(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&&I0e?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{I0e=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function bct({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d}=t;try{if(s){let{message:_,stack:m,code:y,name:b}=s,x=new Error(_);Object.assign(x,{stack:m,code:y,name:b}),p(x)}else{if(n==S0e){let{value:_,done:m}=await a.read();AH({type:NX,value:_,done:m,messageId:o},t)}n==NX&&(await c.ready,await c.write(new Uint8Array(i)),AH({type:v0e,messageId:o},t)),n==FX&&p(null,r)}}catch(_){AH({type:FX,messageId:o},t),p(_)}function p(_,m){_?f(_):u(m),c&&c.releaseLock(),d()}}var yC=[],UX=[];var R0e=0;async function EH(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:d,maxWorkers:p}=i;t.transferStreams=o||o===yi;let _=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!_&&(r||r===yi&&i.useWebWorkers),t.scripts=t.useWebWorkers&&d?d[a]:[],n.useCompressionStream=s||s===yi&&i.useCompressionStream,(await m()).run();async function m(){let b=yC.find(x=>!x.busy);if(b)return O0e(b),new Fv(b,e,t,y);if(yC.length<p){let x={indexWorker:R0e};return R0e++,yC.push(x),new Fv(x,e,t,y)}else return new Promise(x=>UX.push({resolve:x,stream:e,workerOptions:t}))}function y(b){if(UX.length){let[{resolve:x,stream:T,workerOptions:C}]=UX.splice(0,1);x(new Fv(b,T,C,y))}else b.worker?(O0e(b),xct(b,t)):yC=yC.filter(x=>x!=b)}}function xct(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{yC=yC.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function O0e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Tct="Writer iterator completed too soon",Cct="Writer not initialized",Act="text/plain";var Ect="Content-Type";var Sct=64*1024,HX="writable",Bv=class{constructor(){this.size=0}init(){this.initialized=!0}},SH=class extends Bv{get readable(){let t=this,{chunkSize:n=Sct}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this,u=s===yi?n:Math.min(n,s-c),f=await rc(t,r+c,u,a);o.enqueue(f),c+n>s||s===yi&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},zX=class extends Bv{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(Cct);return t.writeUint8Array(i)}});Object.defineProperty(t,HX,{get(){return n}})}writeUint8Array(){}};var vH=class extends zX{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)}},zg=class extends SH{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)}},w2=class extends Bv{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([Ect,t]),Object.defineProperty(n,HX,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},wH=class extends zg{constructor(t){super(new Blob([t],{type:Act}))}},IH=class extends w2{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 VX=class extends SH{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 u=r[a],f=u.size;if(c+n<=f)s=await rc(u,c,n);else{let d=f-c;s=new Uint8Array(n),s.set(await rc(u,c,d)),s.set(await o.readUint8Array(t+d,n-d,i),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},PH=class extends Bv{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:d}=i;if(s)f.length>=d?(await c(f.slice(0,d)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(d))):await c(f);else{let{value:p,done:_}=await t.next();if(_&&!p)throw new Error(Tct);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await _p(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,HX,{get(){return a}});async function c(f){let d=f.length;d&&(await s.ready,await s.write(f),o.size+=d,i.size+=d,i.availableSize-=d)}async function u(){r.size=o.size,await s.close()}}};async function _p(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function DH(e){return Array.isArray(e)&&(e=new VX(e)),e instanceof ReadableStream&&(e={readable:e}),e}function RH(e){e.writable===yi&&typeof e.next==Bg&&(e=new PH(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===yi&&(t.size=0),e instanceof PH||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function rc(e,t,n,i){return e.readUint8Array(t,n,i)}var M0e="\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(""),vct=M0e.length==256;function L0e(e){if(vct){let t="";for(let n=0;n<e.length;n++)t+=M0e[e[n]];return t}else return new TextDecoder().decode(e)}function I2(e,t){return t&&t.trim().toLowerCase()=="cp437"?L0e(e):new TextDecoder(t).decode(e)}var GX="filename",jX="rawFilename",WX="comment",qX="rawComment",YX="uncompressedSize",XX="compressedSize",KX="offset",OH="diskNumberStart",kv="lastModDate",MH="rawLastModDate",P2="lastAccessDate",N0e="rawLastAccessDate",D2="creationDate",F0e="rawCreationDate",$X="internalFileAttribute",ZX="internalFileAttributes",QX="externalFileAttribute",JX="externalFileAttributes",eK="msDosCompatible",LH="zip64",tK="encrypted",nK="version",iK="versionMadeBy",oK="zipCrypto",rK="directory",sK="executable",wct=[GX,jX,XX,YX,kv,MH,WX,qX,P2,D2,KX,OH,OH,$X,ZX,QX,JX,eK,LH,tK,nK,iK,oK,rK,sK,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],eb=class{constructor(t){wct.forEach(n=>this[n]=t[n])}};var aK="File format is not recognized",Oct="End of central directory not found",Mct="End of Zip64 central directory locator not found",Lct="Central directory header not found",Nct="Local file header not found",Fct="Zip64 extra field not found",Bct="File contains encrypted entry",kct="Encryption method not supported",B0e="Compression method not supported",k0e="Split zip file",U0e="utf-8",z0e="cp437",Uct=[[YX,4294967295],[XX,4294967295],[KX,4294967295],[OH,65535]],zct={[65535]:{getValue:Ps,bytes:4},[4294967295]:{getValue:NH,bytes:8}},HH=class{constructor(t,n={}){Object.assign(this,{reader:DH(t),options:n,config:b2()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await _p(i),(i.size===yi||!i.readUint8Array)&&(i=new zg(await new Response(i.readable).blob()),await _p(i)),i.size<22)throw new Error(aK);i.chunkSize=uH(o);let r=await Wct(i,101010256,i.size,22,65535*16);if(!r){let L=await rc(i,0,4),g=Ba(L);throw Ps(g)==134695760?new Error(k0e):new Error(Oct)}let s=Ba(r),a=Ps(s,12),c=Ps(s,16),u=r.offset,f=Fa(s,20),d=u+22+f,p=Fa(s,4),_=i.lastDiskNumber||0,m=Fa(s,6),y=Fa(s,8),b=0,x=0;if(c==4294967295||a==4294967295||y==65535||m==65535){let L=await rc(i,r.offset-20,20),g=Ba(L);if(Ps(g,0)==117853008){c=NH(g,8);let E=await rc(i,c,56,-1),v=Ba(E),I=r.offset-20-56;if(Ps(v,0)!=101075792&&c!=I){let N=c;c=I,b=c-N,E=await rc(i,c,56,-1),v=Ba(E)}if(Ps(v,0)!=101075792)throw new Error(Mct);p==65535&&(p=Ps(v,16)),m==65535&&(m=Ps(v,20)),y==65535&&(y=NH(v,32)),a==4294967295&&(a=NH(v,40)),c-=a}}if(c>=i.size&&(b=i.size-c-a-22,c=i.size-a-22),_!=p)throw new Error(k0e);if(c<0)throw new Error(aK);let T=0,C=await rc(i,c,a,m),A=Ba(C);if(a){let L=r.offset-a;if(Ps(A,T)!=33639248&&c!=L){let g=c;c=L,b+=c-g,C=await rc(i,c,a,m),A=Ba(C)}}let S=r.offset-c-(i.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,C=await rc(i,c,a,m),A=Ba(C)),c<0||c>=i.size)throw new Error(aK);let w=Ll(n,t,"filenameEncoding"),R=Ll(n,t,"commentEncoding");for(let L=0;L<y;L++){let g=new lK(i,o,n.options);if(Ps(A,T)!=33639248)throw new Error(Lct);H0e(g,A,T+6);let E=!!g.bitFlag.languageEncodingFlag,v=T+46,I=v+g.filenameLength,N=I+g.extraFieldLength,F=Fa(A,T+4),U=F>>8==0,k=F>>8==3,z=C.subarray(v,I),B=Fa(A,T+32),j=N+B,W=C.subarray(N,j),J=E,Y=E,ee=Ps(A,T+38),Q=U&&(Uv(A,T+38)&16)==16||k&&(ee>>16&61440)==16384||z.length&&z[z.length-1]==_C.charCodeAt(0),de=k&&(ee>>16&73)!=0,ge=Ps(A,T+42)+b;Object.assign(g,{versionMadeBy:F,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:B,directory:Q,offset:ge,diskNumberStart:Fa(A,T+34),internalFileAttributes:Fa(A,T+36),externalFileAttributes:ee,rawFilename:z,filenameUTF8:J,commentUTF8:Y,rawExtraField:C.subarray(I,N),executable:de}),g.internalFileAttribute=g.internalFileAttributes,g.externalFileAttribute=g.externalFileAttributes;let le=Ll(n,t,"decodeText")||I2,ye=J?U0e:w||z0e,xe=Y?U0e:R||z0e,Ie=le(z,ye);Ie===yi&&(Ie=I2(z,ye));let Te=le(W,xe);Te===yi&&(Te=I2(W,xe)),Object.assign(g,{rawComment:W,filename:Ie,comment:Te,directory:Q||Ie.endsWith(_C)}),x=Math.max(ge,x),G0e(g,g,A,T+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let ve=new eb(g);ve.getData=($e,Ct)=>g.getData($e,ve,Ct),T=j;let{onprogress:Ve}=t;if(Ve)try{await Ve(L+1,y,new eb(g))}catch{}yield ve}let P=Ll(n,t,"extractPrependedData"),O=Ll(n,t,"extractAppendedData");return P&&(n.prependedData=x>0?await rc(i,0,x):new Uint8Array),n.comment=f?await rc(i,u+22,f):new Uint8Array,O&&(n.appendedData=d<i.size?await rc(i,d,i.size-d):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var lK=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:u,config:f,bitFlag:d,signature:p,rawLastModDate:_,uncompressedSize:m,compressedSize:y}=o,b=n.localDirectory={},x=await rc(r,s,30,a),T=Ba(x),C=Ll(o,i,"password"),A=Ll(o,i,"rawPassword"),S=Ll(o,i,"passThrough");if(C=C&&C.length&&C,A=A&&A.length&&A,c&&c.originalCompressionMethod!=99)throw new Error(B0e);if(u!=0&&u!=8&&!S)throw new Error(B0e);if(Ps(T,0)!=67324752)throw new Error(Nct);H0e(b,T,4),b.rawExtraField=b.extraFieldLength?await rc(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,G0e(o,b,T,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let w=o.encrypted&&b.encrypted&&!S,R=w&&!c;if(S||(n.zipCrypto=R),w){if(!R&&c.strength===yi)throw new Error(kct);if(!C&&!A)throw new Error(Bct)}let P=s+30+b.filenameLength+b.extraFieldLength,O=y,L=r.readable;Object.assign(L,{diskNumberStart:a,offset:P,size:O});let g=Ll(o,i,"signal"),E=Ll(o,i,"checkPasswordOnly");E&&(t=new WritableStream),t=RH(t),await _p(t,S?y:m);let{writable:v}=t,{onstart:I,onprogress:N,onend:F}=i,U={options:{codecType:CH,password:C,rawPassword:A,zipCrypto:R,encryptionStrength:c&&c.strength,signed:Ll(o,i,"checkSignature")&&!S,passwordVerification:R&&(d.dataDescriptor?_>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!S,encrypted:o.encrypted&&!S,useWebWorkers:Ll(o,i,"useWebWorkers"),useCompressionStream:Ll(o,i,"useCompressionStream"),transferStreams:Ll(o,i,"transferStreams"),checkPasswordOnly:E},config:f,streamOptions:{signal:g,size:O,onstart:I,onprogress:N,onend:F}},k=0;try{({outputSize:k}=await EH({readable:L,writable:v},U))}catch(z){if(!E||z.message!=Ug)throw z}finally{let z=Ll(o,i,"preventClose");v.size+=k,!z&&!v.locked&&await v.getWriter().close()}return E?yi:t.getData?t.getData():v}};function H0e(e,t,n){let i=e.rawBitFlag=Fa(t,n+2),o=(i&1)==1,r=Ps(t,n+6);Object.assign(e,{encrypted:o,version:Fa(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:qct(r),filenameLength:Fa(t,n+22),extraFieldLength:Fa(t,n+24)})}function G0e(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ba(new Uint8Array(r)),c=0;try{for(;c<r.length;){let x=Fa(a,c),T=Fa(a,c+2);s.set(x,{type:x,data:r.slice(c+4,c+4+T)}),c+=4+T}}catch{}let u=Fa(n,i+4);Object.assign(t,{signature:Ps(n,i+10),uncompressedSize:Ps(n,i+18),compressedSize:Ps(n,i+14)});let f=s.get(1);f&&(Vct(f,t),t.extraFieldZip64=f);let d=s.get(28789);d&&(V0e(d,GX,jX,t,e),t.extraFieldUnicodePath=d);let p=s.get(25461);p&&(V0e(p,WX,qX,t,e),t.extraFieldUnicodeComment=p);let _=s.get(39169);_?(Hct(_,t,u),t.extraFieldAES=_):t.compressionMethod=u;let m=s.get(10);m&&(Gct(m,t),t.extraFieldNTFS=m);let y=s.get(21589);y&&(jct(y,t,o),t.extraFieldExtendedTimestamp=y);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Vct(e,t){t.zip64=!0;let n=Ba(e.data),i=Uct.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=zct[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Fct)}}function V0e(e,t,n,i,o){let r=Ba(e.data),s=new kg;s.append(o[n]);let a=Ba(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ps(r,1);Object.assign(e,{version:Uv(r,0),[t]:I2(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Ps(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Hct(e,t,n){let i=Ba(e.data),o=Uv(i,4);Object.assign(e,{vendorVersion:Uv(i,0),vendorId:Uv(i,2),strength:o,originalCompressionMethod:n,compressionMethod:Fa(i,5)}),t.compressionMethod=e.compressionMethod}function Gct(e,t){let n=Ba(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=Fa(n,i),s=Fa(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=Ba(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=cK(s),f=cK(a),d=cK(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function jct(e,t,n){let i=Ba(e.data),o=Uv(i,0),r=[],s=[];n?((o&1)==1&&(r.push(kv),s.push(MH)),(o&2)==2&&(r.push(P2),s.push(N0e)),(o&4)==4&&(r.push(D2),s.push(F0e))):e.data.length>=5&&(r.push(kv),s.push(MH));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ps(i,a);t[c]=e[c]=new Date(f*1e3);let d=s[u];e[d]=f}a+=4})}async function Wct(e,t,n,i,o){let r=new Uint8Array(4),s=Ba(r);Yct(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await rc(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function Ll(e,t,n){return t[n]===yi?e.options[n]:t[n]}function qct(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 cK(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Uv(e,t){return e.getUint8(t)}function Fa(e,t){return e.getUint16(t,!0)}function Ps(e,t){return e.getUint32(t,!0)}function NH(e,t){return Number(e.getBigUint64(t,!0))}function Yct(e,t,n){e.setUint32(t,n,!0)}function Ba(e){return new DataView(e.buffer)}var Zct="File already exists",Qct="Zip file comment exceeds 64KB",Jct="File entry comment exceeds 64KB",elt="File entry name exceeds 64KB",q0e="Version exceeds 65535",tlt="The strength must equal 1, 2, or 3",nlt="Extra field type exceeds 65535",ilt="Extra field data exceeds 64KB",vK="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",olt="Undefined uncompressed size",Y0e=new Uint8Array([7,0,2,0,65,69,3,0,0]),AK=0,X0e=[],qH=class{constructor(t,n={}){t=RH(t);let i=t.availableSize!==yi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==yi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:b2(),files:new Map,filenames:new Set,offset:n.offset===yi?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;AK<s.maxWorkers?AK++:await new Promise(c=>X0e.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Zct);return o.filenames.add(t),a=rlt(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():AK--}}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 mlt(this,t,n),Ji(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function rlt(e,t,n,i){t=t.trim();let o=Ji(e,i,eK),r=Ji(e,i,iK,o?20:768),s=Ji(e,i,sK);if(r>65535)throw new Error(q0e);let a=Ji(e,i,JX,0);a===0&&(a=Ji(e,i,QX,0)),!i.directory&&t.endsWith(_C)&&(i.directory=!0),Ji(e,i,rK)?(t.endsWith(_C)||(t+=_C),a===0&&(a=16,o||(a|=16877<<16))):!o&&a===0&&(s?a=493<<16:a=420<<16);let u=Ji(e,i,"encodeText",Mv),f=u(t);if(f===yi&&(f=Mv(t)),to(f)>65535)throw new Error(elt);let d=i.comment||"",p=u(d);if(p===yi&&(p=Mv(d)),to(p)>65535)throw new Error(Jct);let _=Ji(e,i,nK,20);if(_>65535)throw new Error(q0e);let m=Ji(e,i,kv,new Date),y=Ji(e,i,P2),b=Ji(e,i,D2),x=Ji(e,i,ZX,0);x===0&&(x=Ji(e,i,$X,0));let T=Ji(e,i,"passThrough"),C,A;T||(C=Ji(e,i,"password"),A=Ji(e,i,"rawPassword"));let S=Ji(e,i,"encryptionStrength",3),w=Ji(e,i,oK),R=Ji(e,i,"extendedTimestamp",!0),P=Ji(e,i,"keepOrder",!0),O=Ji(e,i,"level"),L=Ji(e,i,"useWebWorkers"),g=Ji(e,i,"bufferedWrite"),E=Ji(e,i,"dataDescriptorSignature",!1),v=Ji(e,i,"signal"),I=Ji(e,i,"useUnicodeFileNames",!0),N=Ji(e,i,"useCompressionStream"),F=Ji(e,i,"compressionMethod"),U=Ji(e,i,"dataDescriptor",!0),k=Ji(e,i,LH);if(!w&&(C!==yi||A!==yi)&&!(S>=1&&S<=3))throw new Error(tlt);let z=new Uint8Array,{extraField:B}=i;if(B){let Qe=0,mn=0;B.forEach(Bt=>Qe+=4+to(Bt)),z=new Uint8Array(Qe),B.forEach((Bt,Ot)=>{if(Ot>65535)throw new Error(nlt);if(to(Bt)>65535)throw new Error(ilt);Hs(z,new Uint16Array([Ot]),mn),Hs(z,new Uint16Array([to(Bt)]),mn+2),Hs(z,Bt,mn+4),mn+=4+to(Bt)})}let j=0,W=0,J=0;if(T&&({uncompressedSize:J}=i,J===yi))throw new Error(olt);let Y=k===!0;n&&(n=DH(n),await _p(n),T?j=K0e(J):n.size===yi?(U=!0,(k||k===yi)&&(k=!0,J=j=4294967296)):(J=n.size,j=K0e(J)));let{diskOffset:ee,diskNumber:Q,maxSize:de}=e.writer,ge=Y||J>4294967295,le=Y||j>4294967295,ye=Y||e.offset+e.pendingEntriesSize-ee>4294967295,Ie=Ji(e,i,"supportZip64SplitFile",!0)&&Y||Q+Math.ceil(e.pendingEntriesSize/de)>65535;if(ye||ge||le||Ie){if(k===!1||!P)throw new Error(vK);k=!0}k=k||!1;let Te=Ji(e,i,tK),{signature:ve}=i;i=Object.assign({},i,{rawFilename:f,rawComment:p,version:_,versionMadeBy:r,lastModDate:m,lastAccessDate:y,creationDate:b,rawExtraField:z,zip64:k,zip64UncompressedSize:ge,zip64CompressedSize:le,zip64Offset:ye,zip64DiskNumberStart:Ie,password:C,rawPassword:A,level:!N&&e.config.CompressionStream===yi&&e.config.CompressionStreamNative===yi?0:O,useWebWorkers:L,encryptionStrength:S,extendedTimestamp:R,zipCrypto:w,bufferedWrite:g,keepOrder:P,useUnicodeFileNames:I,dataDescriptor:U,dataDescriptorSignature:E,signal:v,msDosCompatible:o,internalFileAttribute:x,internalFileAttributes:x,externalFileAttribute:a,externalFileAttributes:a,useCompressionStream:N,passThrough:T,encrypted:!!(C&&to(C)||A&&to(A))||T&&Te,signature:ve,compressionMethod:F});let Ve=clt(i),$e=ult(i),Ct=to(Ve.localHeaderArray,$e.dataDescriptorArray);W=Ct+j,e.options.usdz&&(W+=W+64),e.pendingEntriesSize+=W;let Jt;try{Jt=await slt(e,t,n,{headerInfo:Ve,dataDescriptorInfo:$e,metadataSize:Ct},i)}finally{e.pendingEntriesSize-=W}return Object.assign(Jt,{name:t,comment:d,extraField:B}),new eb(Jt)}async function slt(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:d}=e.options,p=Array.from(r.values()).pop(),_={},m,y,b,x,T,C,A;r.set(t,_);try{let P;a&&(P=p&&p.lock,S()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!d?(C=new null,A=new Response(C.readable).blob(),C.writable.size=0,m=!0,e.bufferedWrites++,await _p(s)):(C=s,await w()),await _p(C);let{writable:O}=s,{diskOffset:L}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let E=new Uint8Array(4),v=sc(E);eo(v,0,134695760),await gp(O,E),e.offset+=4}d&&llt(i,e.offset-L),m||(await P,await R(O));let{diskNumber:g}=s;if(T=!0,_.diskNumberStart=g,_=await alt(n,C,_,i,e.config,o),T=!1,r.set(t,_),_.filename=t,m){await C.writable.getWriter().close();let E=await A;await P,await w(),x=!0,c||(E=await dlt(_,E,O,o)),await R(O),_.diskNumberStart=s.diskNumber,L=s.diskOffset,await E.stream().pipeTo(O,{preventClose:!0,preventAbort:!0,signal:u}),O.size+=E.size,x=!1}if(_.offset=e.offset-L,_.zip64)hlt(_,o);else if(_.offset>4294967295)throw new Error(vK);return e.offset+=_.size,_}catch(P){if(m&&x||!m&&T){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}m?e.offset+=C.writable.size:e.offset=C.writable.size}throw r.delete(t),P}finally{m&&e.bufferedWrites--,b&&b(),y&&y()}function S(){_.lock=new Promise(P=>b=P)}async function w(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(O=>y=()=>{e.writerLocked=!1,O()}),await P}async function R(P){to(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await gp(P,new Uint8Array))}}async function alt(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:d,lastModDate:p,rawLastModDate:_,encrypted:m,compressed:y,version:b,compressionMethod:x,rawExtraFieldExtendedTimestamp:T,extraFieldExtendedTimestampFlag:C,rawExtraFieldNTFS:A,rawExtraFieldAES:S}=a,{dataDescriptorArray:w}=c,{rawFilename:R,lastAccessDate:P,creationDate:O,password:L,rawPassword:g,level:E,zip64:v,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:F,zip64DiskNumberStart:U,zipCrypto:k,dataDescriptor:z,directory:B,executable:j,versionMadeBy:W,rawComment:J,rawExtraField:Y,useWebWorkers:ee,onstart:Q,onprogress:de,onend:ge,signal:le,encryptionStrength:ye,extendedTimestamp:xe,msDosCompatible:Ie,internalFileAttributes:Te,externalFileAttributes:ve,useCompressionStream:Ve,passThrough:$e}=s,Ct={lock:i,versionMadeBy:W,zip64:v,directory:!!B,executable:!!j,filenameUTF8:!0,rawFilename:R,commentUTF8:!0,rawComment:J,rawExtraFieldExtendedTimestamp:T,rawExtraFieldNTFS:A,rawExtraFieldAES:S,rawExtraField:Y,extendedTimestamp:xe,msDosCompatible:Ie,internalFileAttributes:Te,externalFileAttributes:ve,diskNumberStart:n},{signature:Jt,uncompressedSize:Qe}=s,mn=0;$e||(Qe=0);let{writable:Bt}=t;if(e){e.chunkSize=uH(r),await gp(Bt,f);let Jn=e.readable,bi=Jn.size=e.size,Gt={options:{codecType:TH,level:E,rawPassword:g,password:L,encryptionStrength:ye,zipCrypto:m&&k,passwordVerification:m&&k&&_>>8&255,signed:!$e,compressed:y&&!$e,encrypted:m&&!$e,useWebWorkers:ee,useCompressionStream:Ve,transferStreams:!1},config:r,streamOptions:{signal:le,size:bi,onstart:Q,onprogress:de,onend:ge}},Pt=await EH({readable:Jn,writable:Bt},Gt);mn=Pt.outputSize,$e||(Qe=Pt.inputSize,Jt=Pt.signature),Bt.size+=Qe}else await gp(Bt,f);let Ot;if(v){let Jn=4;I&&(Jn+=8),N&&(Jn+=8),F&&(Jn+=8),U&&(Jn+=4),Ot=new Uint8Array(Jn)}else Ot=new Uint8Array;return flt({signature:Jt,rawExtraFieldZip64:Ot,compressedSize:mn,uncompressedSize:Qe,headerInfo:a,dataDescriptorInfo:c},s),z&&await gp(Bt,w),Object.assign(Ct,{uncompressedSize:Qe,compressedSize:mn,lastModDate:p,rawLastModDate:_,creationDate:O,lastAccessDate:P,encrypted:m,zipCrypto:k,size:u+mn,compressionMethod:x,version:b,headerArray:d,signature:Jt,rawExtraFieldZip64:Ot,extraFieldExtendedTimestampFlag:C,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:F,zip64DiskNumberStart:U}),Ct}function clt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:_,encrypted:m}=e,{version:y,compressionMethod:b}=e,x=!f&&(r>0||r===yi&&b!==0),T;if(m&&!a){T=new Uint8Array(to(Y0e)+2);let F=sc(T);lo(F,0,39169),Hs(T,Y0e,2),SK(F,8,p)}else T=new Uint8Array;let C,A,S;if(_){A=new Uint8Array(9+(i?4:0)+(o?4:0));let F=sc(A);lo(F,0,21589),lo(F,2,to(A)-4),S=1+(i?2:0)+(o?4:0),SK(F,4,S);let U=5;eo(F,U,Math.floor(n.getTime()/1e3)),U+=4,i&&(eo(F,U,Math.floor(i.getTime()/1e3)),U+=4),o&&eo(F,U,Math.floor(o.getTime()/1e3));try{C=new Uint8Array(36);let k=sc(C),z=EK(n);lo(k,0,10),lo(k,2,32),lo(k,8,1),lo(k,10,24),gu(k,12,z),gu(k,20,EK(i)||z),gu(k,28,EK(o)||z)}catch{C=new Uint8Array}}else C=A=new Uint8Array;let w=0;c&&(w=w|2048),u&&(w=w|8),b===yi&&(b=x?8:0),b==8&&(r>=1&&r<3&&(w=w|6),r>=3&&r<5&&(w=w|1),r===9&&(w=w|2)),s&&(y=y>45?y:45),m&&(w=w|1,a||(y=y>51?y:51,T[9]=b,b=99));let R=new Uint8Array(26),P=sc(R);lo(P,0,y),lo(P,2,w),lo(P,4,b);let O=new Uint32Array(1),L=sc(O),g;n<PX?g=PX:n>IX?g=IX:g=n,lo(L,0,(g.getHours()<<6|g.getMinutes())<<5|g.getSeconds()/2),lo(L,2,(g.getFullYear()-1980<<4|g.getMonth()+1)<<5|g.getDate());let E=O[0];eo(P,6,E),lo(P,22,to(t));let v=to(T,A,C,d);lo(P,24,v);let I=new Uint8Array(30+to(t)+v),N=sc(I);return eo(N,0,67324752),Hs(I,R,4),Hs(I,t,30),Hs(I,T,30+to(t)),Hs(I,A,30+to(t,T)),Hs(I,C,30+to(t,T,A)),Hs(I,d,30+to(t,T,A,C)),{localHeaderArray:I,headerArray:R,headerView:P,lastModDate:n,rawLastModDate:E,encrypted:m,compressed:x,version:y,compressionMethod:b,extraFieldExtendedTimestampFlag:S,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:C,rawExtraFieldAES:T,extraFieldLength:v}}function llt(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=sc(i),s=64-(t+to(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=sc(a);lo(c,0,6534),lo(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(to(u)+s),Hs(i,u),Hs(i,a,to(u)),r=sc(i),lo(r,28,o+s),e.metadataSize+=s}function ult(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=sc(o),i&&(s=4,eo(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function flt(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:d}=a,{zip64:p,zip64UncompressedSize:_,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:b}=t;if((!u||y)&&n!==yi&&(eo(c,10,n),b&&eo(f,d,n)),p){let x=sc(i);lo(x,0,1),lo(x,2,to(i)-4);let T=4;_&&(eo(c,18,4294967295),gu(x,T,BigInt(r)),T+=8),m&&(eo(c,14,4294967295),gu(x,T,BigInt(o))),b&&(gu(f,d+4,BigInt(o)),gu(f,d+12,BigInt(r)))}else eo(c,14,o),eo(c,18,r),b&&(eo(f,d+4,o),eo(f,d+8,r))}async function dlt(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)&&eo(r,14,e.signature),e.zip64?(eo(r,18,4294967295),eo(r,22,4294967295)):(eo(r,18,e.compressedSize),eo(r,22,e.uncompressedSize)),await gp(n,new Uint8Array(o)),t.slice(o.byteLength)}function hlt(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=sc(n),f=4;r&&(f+=8),s&&(f+=8),a&&(gu(u,f,BigInt(i)),f+=8),c&&eo(u,f,o)}async function mlt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,d=i.size;for(let[,S]of i){let{rawFilename:w,rawExtraFieldZip64:R,rawExtraFieldAES:P,rawComment:O,rawExtraFieldNTFS:L,rawExtraField:g,extendedTimestamp:E,extraFieldExtendedTimestampFlag:v,lastModDate:I}=S,N;if(E){N=new Uint8Array(9);let F=sc(N);lo(F,0,21589),lo(F,2,5),SK(F,4,v),eo(F,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;S.rawExtraFieldCDExtendedTimestamp=N,u+=46+to(w,O,R,P,L,N,g)}let p=new Uint8Array(u),_=sc(p);await _p(o);let m=0;for(let[S,w]of Array.from(i.values()).entries()){let{offset:R,rawFilename:P,rawExtraFieldZip64:O,rawExtraFieldAES:L,rawExtraFieldCDExtendedTimestamp:g,rawExtraFieldNTFS:E,rawExtraField:v,rawComment:I,versionMadeBy:N,headerArray:F,zip64:U,zip64UncompressedSize:k,zip64CompressedSize:z,zip64DiskNumberStart:B,zip64Offset:j,internalFileAttributes:W,externalFileAttributes:J,diskNumberStart:Y,uncompressedSize:ee,compressedSize:Q}=w,de=to(O,L,g,E,v);eo(_,c,33639248),lo(_,c+4,N);let ge=sc(F);k||eo(ge,18,ee),z||eo(ge,14,Q),Hs(p,F,c+6),lo(_,c+30,de),lo(_,c+32,to(I)),lo(_,c+34,U&&B?65535:Y),lo(_,c+36,W),J&&eo(_,c+38,J),eo(_,c+42,U&&j?4294967295:R),Hs(p,P,c+46),Hs(p,O,c+46+to(P)),Hs(p,L,c+46+to(P,O)),Hs(p,g,c+46+to(P,O,L)),Hs(p,E,c+46+to(P,O,L,g)),Hs(p,v,c+46+to(P,O,L,g,E)),Hs(p,I,c+46+to(P)+de);let le=46+to(P,I)+de;if(c-m>o.availableSize&&(o.availableSize=0,await gp(s,p.slice(m,c)),m=c),c+=le,n.onprogress)try{await n.onprogress(S+1,i.size,new eb(w))}catch{}}await gp(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:b}=o;b<22&&y++;let x=Ji(e,n,LH);if(f>4294967295||u>4294967295||d>65535||y>65535){if(x===!1)throw new Error(vK);x=!0}let T=new Uint8Array(x?98:22),C=sc(T);c=0,x&&(eo(C,0,101075792),gu(C,4,BigInt(44)),lo(C,12,45),lo(C,14,45),eo(C,16,y),eo(C,20,a),gu(C,24,BigInt(d)),gu(C,32,BigInt(d)),gu(C,40,BigInt(u)),gu(C,48,BigInt(f)),eo(C,56,117853008),gu(C,64,BigInt(f)+BigInt(u)),eo(C,72,y+1),Ji(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),d=65535,f=4294967295,u=4294967295,c+=76),eo(C,c,101010256),lo(C,c+4,y),lo(C,c+6,a),lo(C,c+8,d),lo(C,c+10,d),eo(C,c+12,u),eo(C,c+16,f);let A=to(t);if(A)if(A<=65535)lo(C,c+20,A);else throw new Error(Qct);await gp(s,T),A&&await gp(s,t)}async function gp(e,t){let n=e.getWriter();try{await n.ready,e.size+=to(t),await n.write(t)}finally{n.releaseLock()}}function EK(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Ji(e,t,n,i){let o=t[n]===yi?e.options[n]:t[n];return o===yi?i:o}function K0e(e){return e+5*(Math.floor(e/16383)+1)}function SK(e,t,n){e.setUint8(t,n)}function lo(e,t,n){e.setUint16(t,n,!0)}function eo(e,t,n){e.setUint32(t,n,!0)}function gu(e,t,n){e.setBigUint64(t,n,!0)}function Hs(e,t,n){e.set(t,n)}function sc(e){return new DataView(e.buffer)}function to(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}Ov({Deflate:Mye,Inflate:t0e});var wK=32,plt="http://www.opengis.net/kml/2.2",om="http://www.google.com/kml/ext/2.2",_lt="http://www.w3.org/2000/xmlns/";function YH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var glt=/^data:image\/([^,;]+)/;YH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ee){if(e=Ee.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(glt);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 ylt(e,t){return function(n){e._files[t]=n}}YH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new se("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(ylt(this,r))}return o};Object.defineProperties(YH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function XH(e){this._time=e}XH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};XH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return xC(n)};XH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function IK(){this._ids={},this._styles={},this._count=0}IK.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};IK.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 J0e(){this._ids={}}J0e.prototype.get=function(e){if(!l(e))return this.get(Ln());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function PK(e){e=e??G.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=PK._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(_lt,"xmlns:gx",om);let a=r.createElement("Document");s.appendChild(a),tbe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?blt(f,c.files):{kml:f,externalFiles:c.files}})}function blt(e,t){let n=on("ThirdParty/Workers/z-worker-pako.js");Ov({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new w2,o=new qH(i);return o.add("doc.kml",new wH(e)).then(function(){let r=Object.keys(t);return ebe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function ebe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new zg(n[o])).then(function(){return ebe(e,t,n,i+1)})}PK._createState=function(e){let t=e.entities,n=new IK,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new En:$.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&$.addSeconds(r.start,10*s,r.stop);let a=new YH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(plt,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new J0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new XH(o),sampleDuration:s,defaultAvailability:new Jr([r])}};function tbe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],xlt(e,p,u,f),Tlt(e,p.polyline,u,f),Q0e(e,p.rectangle,u,f,c),Q0e(e,p.polygon,u,f,c),Slt(e,p,p.model,u,f);let _,m=p.availability;l(m)&&(_=i.createElement("TimeSpan"),$.equals(m.start,Ge.MINIMUM_VALUE)||_.appendChild(hn(i,"begin",$.toIso8601(m.start))),$.equals(m.stop,Ge.MAXIMUM_VALUE)||_.appendChild(hn(i,"end",$.toIso8601(m.stop))));for(let x=0;x<c.length;++x){let T=c[x];T.setAttribute("id",s.get(p.id)),T.appendChild(hn(i,"name",p.name)),T.appendChild(hn(i,"visibility",p.show)),T.appendChild(hn(i,"description",p.description)),l(_)&&T.appendChild(_),t.appendChild(T)}let y=u.length;if(y>0){let x=i.createElement("Placemark");x.setAttribute("id",s.get(p.id));let T=p.name,C=p.label;if(l(C)){let S=i.createElement("LabelStyle"),w=r.get(C.text);T=l(w)&&w.length>0?w:T;let R=r.getColor(C.fillColor);l(R)&&(S.appendChild(hn(i,"color",R)),S.appendChild(hn(i,"colorMode","normal")));let P=r.get(C.scale);l(P)&&S.appendChild(hn(i,"scale",P)),f.push(S)}x.appendChild(hn(i,"name",T)),x.appendChild(hn(i,"visibility",p.show)),x.appendChild(hn(i,"description",p.description)),l(_)&&x.appendChild(_),t.appendChild(x);let A=f.length;if(A>0){let S=i.createElement("Style");for(let w=0;w<A;++w)S.appendChild(f[w]);x.appendChild(hn(i,"styleUrl",o.get(S)))}if(u.length===1)x.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let w=0;w<y;++w)S.appendChild(u[w]);x.appendChild(S)}}let b=p._children;if(b.length>0){let x=i.createElement("Folder");x.setAttribute("id",s.get(p.id)),x.appendChild(hn(i,"name",p.name)),x.appendChild(hn(i,"visibility",p.show)),x.appendChild(hn(i,"description",p.description)),t.appendChild(x),tbe(e,x,b)}}}var yu=new h,Nl=new fe,im=new $;function xlt(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){nbe(e,t,a,n,i);return}s.get(c,void 0,yu);let u=hn(o,"coordinates",bC(yu,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(TC(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof vc?obe(e,a):ibe(e,a);i.push(p)}function nbe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Oa?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof b_,p,_,m,y=[];for(p=0;p<c.length;++p){let x=c.get(p),T=f?u:x.data,C=r.createElement("altitudeMode");T instanceof up?(T=T._value,C.appendChild(TC(e,Ke.CLAMP_TO_GROUND))):l(n)?C.appendChild(TC(e,n.heightReference)):C.appendChild(TC(e,Ke.NONE));let A=[],S=[];if(T.isConstant){a.get(T,void 0,yu);let R=hn(r,"coordinates",bC(yu,s));A.push($.toIso8601(x.start)),S.push(R),A.push($.toIso8601(x.stop)),S.push(R)}else if(T instanceof La)for(m=T._property._times,_=0;_<m.length;++_)A.push($.toIso8601(m[_])),T.getValueInReferenceFrame(m[_],Gi.FIXED,yu),S.push(bC(yu,s));else if(T instanceof af){m=T._times;let R=T._values;for(_=0;_<m.length;++_)A.push($.toIso8601(m[_])),h.fromArray(R,_*3,yu),S.push(bC(yu,s))}else{let R=e.sampleDuration;x.start.clone(im),x.isStartIncluded||$.addSeconds(im,R,im);let P=x.stop;for(;$.lessThan(im,P);)T.getValue(im,yu),A.push($.toIso8601(im)),S.push(bC(yu,s)),$.addSeconds(im,R,im);x.isStopIncluded&&$.equals(im,P)&&(T.getValue(im,yu),A.push($.toIso8601(im)),S.push(bC(yu,s)))}let w=r.createElementNS(om,"Track");w.appendChild(C);for(let R=0;R<A.length;++R){let P=hn(r,"when",A[R]),O=hn(r,"coord",S[R],om);w.appendChild(P),w.appendChild(O)}d&&w.appendChild(rbe(e,n)),y.push(w)}if(y.length===1)i.push(y[0]);else if(y.length>1){let x=r.createElementNS(om,"MultiTrack");for(p=0;p<y.length;++p)x.appendChild(y[p]);i.push(x)}if(l(n)&&!d){let x=n instanceof vc?obe(e,n):ibe(e,n);o.push(x)}let b=t.path;if(l(b)){let x=a.get(b.width),T=b.material;if(l(T)||l(x)){let C=r.createElement("LineStyle");l(x)&&C.appendChild(hn(r,"width",x)),DK(e,T,C),o.push(C)}}}function ibe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(hn(n,"scale",s/wK)),o}function obe(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(hn(n,"href",s));let _=i.get(t.imageSubRegion);l(_)&&(p.appendChild(hn(n,"x",_.x,om)),p.appendChild(hn(n,"y",_.y,om)),p.appendChild(hn(n,"w",_.width,om)),p.appendChild(hn(n,"h",_.height,om))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(hn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,V.divideByScalar(u,c,u);let p=i.get(t.width,wK),_=i.get(t.height,wK),m=i.get(t.horizontalOrigin,Ci.CENTER);m===Ci.CENTER?u.x-=p*.5:m===Ci.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Fn.CENTER);y===Fn.TOP?u.y+=_:y===Fn.CENTER&&(u.y+=_*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),r.appendChild(hn(n,"heading",f))),r}function Tlt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(hn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),_=hn(o,"coordinates",bC(p,r));a.appendChild(_);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(hn(o,"drawOrder",m,om)),n.push(a);let y=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&y.appendChild(hn(o,"width",b)),DK(e,t.material,y),i.push(y)}function Clt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[ae.northeast,ae.southeast,ae.southwest,ae.northwest];for(let _=0;_<4;++_)u[_](a,Nl),c.push(`${D.toDegrees(Nl.longitude)},${D.toDegrees(Nl.latitude)},${r}`);let f=hn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Z0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,Nl),s.push(`${D.toDegrees(Nl.longitude)},${D.toDegrees(Nl.latitude)},${i?Nl.height:n}`);let c=hn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function Alt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Z0e(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let _=p.length;for(let m=0;m<_;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(Z0e(e,p[m].positions,r,s)),a.push(y)}}return a}function Q0e(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof _h;if(a&&s.getMaterialType(t.material)==="Image"){Elt(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(hn(r,"extrude",!0));let f=a?Clt(e,t,u):Alt(e,t,u),d=f.length;for(let b=0;b<d;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(TC(e,t.heightReference)),c.appendChild(p),n.push(c);let _=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&_.appendChild(hn(r,"fill",m)),DK(e,t.material,_);let y=s.get(t.outline,!1);if(y){_.appendChild(hn(r,"outline",y));let b=r.createElement("LineStyle"),x=s.get(t.outlineWidth,1);b.appendChild(hn(r,"width",x));let T=s.getColor(t.outlineColor,H.BLACK);b.appendChild(hn(r,"color",T)),b.appendChild(hn(r,"colorMode","normal")),i.push(b)}i.push(_)}function Elt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(TC(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(hn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(hn(i,"north",D.toDegrees(u.north))),f.appendChild(hn(i,"south",D.toDegrees(u.south))),f.appendChild(hn(i,"east",D.toDegrees(u.east))),f.appendChild(hn(i,"west",D.toDegrees(u.west))),s.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),_=i.createElement("Icon");_.appendChild(hn(i,"href",p)),s.appendChild(_);let m=d.color;l(m)&&s.appendChild(hn(i,"color",xC(d.color))),n.push(s)}function rbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(hn(n,"x",s)),u.appendChild(hn(n,"y",s)),u.appendChild(hn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(hn(n,"href",c)),r.appendChild(a),r}function Slt(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){nbe(e,t,n,i,o);return}let u=rbe(e,n),f=r.createElement("altitudeMode");f.appendChild(TC(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,yu),fe.fromCartesian(yu,s,Nl);let d=r.createElement("Location");d.appendChild(hn(r,"longitude",D.toDegrees(Nl.longitude))),d.appendChild(hn(r,"latitude",D.toDegrees(Nl.latitude))),d.appendChild(hn(r,"altitude",Nl.height)),u.appendChild(d),i.push(u)}function DK(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=xC(H.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=xC(r.color);break;case"PolylineOutline":s=xC(r.color),c=xC(r.outlineColor),u=r.outlineWidth,n.appendChild(hn(i,"outerColor",c,om)),n.appendChild(hn(i,"outerWidth",u,om));break;case"Stripe":s=xC(r.oddColor);break}l(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function TC(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 bC(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,Nl),i.push(`${D.toDegrees(Nl.longitude)},${D.toDegrees(Nl.latitude)},${Nl.height}`);return i.join(" ")}function hn(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 xC(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 RK=PK;function L2(){this._cache={}}L2.prototype.fromColor=function(e,t){return KH(void 0,void 0,e,t,this._cache)};L2.prototype.fromUrl=function(e,t,n){return KH(e,void 0,t,n,this._cache)};L2.prototype.fromMakiIconId=function(e,t,n){return KH(on(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};L2.prototype.fromText=function(e,t,n){return KH(void 0,e,t,n,this._cache)};var vlt=new H;function wlt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,vlt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function sbe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=H.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=H.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var M2=new Array(4);function KH(e,t,n,i,o){M2[0]=e,M2[1]=t,M2[2]=n,M2[3]=i;let r=JSON.stringify(M2),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(wlt(c,n,i),l(e)){let f=Ee.createIfNeeded(e).fetchImage().then(function(d){return sbe(c,d,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=vT(t,{font:`bold ${i}px sans-serif`});sbe(c,u,i)}return o[r]=a,a}var Vg=L2;var lbe=er(cbe(),1);function ZH(e){return h.fromDegrees(e[0],e[1],e[2])}var OK={"urn:ogc:def:crs:OGC:1.3:CRS84":ZH,"EPSG:4326":ZH,"urn:ogc:def:crs:EPSG::4326":ZH},ube={},fbe={},MK=48,LK,NK=H.ROYALBLUE,FK=H.YELLOW,BK=2,kK=H.fromBytes(255,255,0,100),UK=!1,Ilt={small:24,medium:48,large:64},Plt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function dbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Plt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${dbe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function Dlt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Rlt(e,t){return new gh(Dlt(dbe,e,t),!0)}function QH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Ln();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Qn(c):n(r,s))}return o}function zK(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var hbe={Feature:pbe,FeatureCollection:Olt,GeometryCollection:_be,LineString:Tbe,MultiLineString:Cbe,MultiPoint:bbe,MultiPolygon:Sbe,Point:ybe,Polygon:Ebe,Topology:vbe},mbe={GeometryCollection:_be,LineString:Tbe,MultiLineString:Cbe,MultiPoint:bbe,MultiPolygon:Sbe,Point:ybe,Polygon:Ebe,Topology:vbe};function pbe(e,t,n,i,o){if(t.geometry===null){QH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new se("feature.geometry is required.");let r=t.geometry.type,s=mbe[r];if(!l(s))throw new se(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Olt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)pbe(e,r[s],void 0,i,o)}function _be(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=mbe[u];if(!l(f))throw new se(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function gbe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let _=c["marker-color"];l(_)&&(s=H.fromCssColorString(_)),a=Ilt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new vc;f.verticalOrigin=new Qn(Fn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=Ke.CLAMP_TO_GROUND);let d=QH(t,e._entityCollection,o.describe);d.billboard=f,d.position=new ul(n(i));let p=Promise.resolve(u).then(function(_){f.image=new Qn(_)}).catch(function(){f.image=new Qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function ybe(e,t,n,i,o){gbe(e,t,i,n.coordinates,o)}function bbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)gbe(e,t,i,r[s],o)}function xbe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Qn(f));let d,p=a.stroke;l(p)&&(d=H.fromCssColorString(p));let _=a["stroke-opacity"];l(_)&&_!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=_),l(d)&&(r=new Wt(d))}let c=QH(t,e._entityCollection,o.describe),u=new Pc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Qn(zK(i,n)),u.arcType=tn.RHUMB}function Tbe(e,t,n,i,o){xbe(e,t,i,n.coordinates,o)}function Cbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)xbe(e,t,i,r[s],o)}function Abe(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 _=c["stroke-width"];l(_)&&(a=new Qn(_));let m,y=c.stroke;l(y)&&(m=H.fromCssColorString(y));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=b),l(m)&&(r=new Qn(m));let x,T=c.fill,C=s.color.getValue();l(T)&&(x=H.fromCssColorString(T),x.alpha=C.alpha),b=c["fill-opacity"],l(b)&&b!==C.alpha&&(l(x)||(x=C.clone()),x.alpha=b),l(x)&&(s=new Wt(x))}let u=new ph;u.outline=new Qn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=tn.RHUMB;let f=[];for(let _=1,m=i.length;_<m;_++)f.push(new Ja(zK(i[_],n)));let d=i[0];u.hierarchy=new Qn(new Ja(zK(d,n),f)),d[0].length>2?u.perPositionHeight=new Qn(!0):o.clampToGround||(u.height=0);let p=QH(t,e._entityCollection,o.describe);p.polygon=u}function Ebe(e,t,n,i,o){Abe(e,t,i,n.coordinates,o)}function Sbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Abe(e,t,i,r[s],o)}function vbe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=lbe.feature(n,n.objects[r]),a=hbe[s.type];a(e,s,s,i,o)}}function tb(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new fa(this),this._promises=[],this._pinBuilder=new Vg,this._entityCluster=new nf,this._credit=void 0,this._resourceCredits=[]}tb.load=function(e,t){return new tb().load(e,t)};Object.defineProperties(tb,{markerSize:{get:function(){return MK},set:function(e){MK=e}},markerSymbol:{get:function(){return LK},set:function(e){LK=e}},markerColor:{get:function(){return NK},set:function(e){NK=e}},stroke:{get:function(){return FK},set:function(e){FK=e}},strokeWidth:{get:function(){return BK},set:function(e){BK=e}},fill:{get:function(){return kK},set:function(e){kK=e}},clampToGround:{get:function(){return UK},set:function(e){UK=e}},crsNames:{get:function(){return OK}},crsLinkHrefs:{get:function(){return ube}},crsLinkTypes:{get:function(){return fbe}}});Object.defineProperties(tb.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}}});tb.prototype.load=function(e,t){return wbe(this,e,t,!0)};tb.prototype.process=function(e,t){return wbe(this,e,t,!1)};function wbe(e,t,n,i){es.setLoading(e,!0),n=n??G.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new _t(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??Rlt,markerSize:n.markerSize??MK,markerSymbol:n.markerSymbol??LK,markerColor:n.markerColor??NK,strokeWidthProperty:new Qn(n.strokeWidth??BK),strokeMaterialProperty:new Wt(n.stroke??FK),fillMaterialProperty:new Wt(n.fill??kK),clampToGround:n.clampToGround??UK},Promise.resolve(r).then(function(a){return Mlt(e,a,n,s,i)}).catch(function(a){throw es.setLoading(e,!1),e._error.raiseEvent(e,a),a})}tb.prototype.update=function(e){return!0};function Mlt(e,t,n,i,o){let r;l(i)&&(r=Eg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=hbe[t.type];if(!l(s))throw new se(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?ZH:null;if(l(a)){if(!l(a.properties))throw new se("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=OK[u.name],!l(c))throw new se(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=ube[u.href];if(l(f)||(f=fbe[u.type]),!l(f))throw new se(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=OK[`EPSG:${u.code}`],!l(c))throw new se(`Unknown crs EPSG code: ${u.code}`)}else throw new se(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,es.setLoading(e,!1),e})})}var nb=tb;function Llt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Dn=Llt;var Dxe=er(h$(),1);var Rxe;typeof DOMParser<"u"&&(Rxe=new DOMParser);var Ydt=new Dxe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),yG=32,Cxe=2414016,Axe=1,Exe=16093e3,Sxe=.1,Xdt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Mo={gpx:Xdt};function Kdt(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 m$(e,t){let n=k2(e,"id");return n=l(n)?n:Ln(),t.getOrCreateEntity(n)}function p$(e){let t=vxe(e,"lon"),n=vxe(e,"lat"),i=F2(e,"ele",Mo.gpx);return h.fromDegrees(t,n,i)}function vxe(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 k2(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function rb(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 _$(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 F2(e,t,n){let i=rb(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function bu(e,t,n){let i=rb(e,t,n);if(l(i))return i.textContent.trim()}function Oxe(e){let t=new vc;return t.width=yG,t.height=yG,t.scaleByDistance=new Vt(Cxe,Axe,Exe,Sxe),t.pixelOffsetScaleByDistance=new Vt(Cxe,Axe,Exe,Sxe),t.verticalOrigin=new Qn(Fn.BOTTOM),t.image=e,t}function $dt(){let e=new mh;return e.translucencyByDistance=new Vt(3e6,1,5e6,0),e.pixelOffset=new V(17,0),e.horizontalOrigin=Ci.LEFT,e.font="16px sans-serif",e.style=$o.FILL_AND_OUTLINE,e}function Mxe(e){let t=new Pc;return t.width=4,t.material=new N0,t.material.color=l(e)?e:H.RED,t.material.outlineWidth=2,t.material.outlineColor=H.BLACK,t}var wxe={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"}},B2;typeof document<"u"&&(B2=document.createElement("div"));function g$(e,t){let n,i="",o=Object.keys(wxe),r=o.length;for(n=0;n<r;n++){let f=o[n],d=wxe[f];d.value=bu(e,d.tag,Mo.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=Ydt.link(i),B2.innerHTML=i;let s=B2.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=H.WHITE,c=H.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${B2.innerHTML}</div>`,B2.innerHTML="",u}function Lxe(e,t,n,i){let o=p$(t),r=m$(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,yG);r.billboard=Oxe(s);let a=bu(t,"name",Mo.gpx);r.name=a,r.label=$dt(),r.label.text=a,r.description=g$(t,r),i.clampToGround&&(r.billboard.heightReference=Ke.CLAMP_TO_GROUND,r.label.heightReference=Ke.CLAMP_TO_GROUND)}function Zdt(e,t,n,i){let o=m$(t,n);o.description=g$(t,o);let r=_$(t,"rtept",Mo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)Lxe(e,r[a],n,i),s[a]=p$(r[a]);o.polyline=Mxe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Qdt(e,t,n,i){let o=m$(t,n);o.description=g$(t,o);let r=_$(t,"trkseg",Mo.gpx),s=[],a=[],c,u=!0,f=new La;for(let d=0;d<r.length;d++)c=Jdt(r[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,yG);o.billboard=Oxe(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=Ke.CLAMP_TO_GROUND),o.availability=new Jr,o.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}o.polyline=Mxe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Jdt(e){let t={positions:[],times:[]},n=_$(e,"trkpt",Mo.gpx),i;for(let o=0;o<n.length;o++){let r=p$(n[o]);t.positions.push(r),i=bu(n[o],"time",Mo.gpx),l(i)&&t.times.push($.fromIso8601(i))}return t}function eht(e){let t=rb(e,"metadata",Mo.gpx);if(l(t)){let n={name:bu(t,"name",Mo.gpx),desc:bu(t,"desc",Mo.gpx),author:tht(t),copyright:iht(t),link:Nxe(t),time:bu(t,"time",Mo.gpx),keywords:bu(t,"keywords",Mo.gpx),bounds:oht(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 tht(e){let t=rb(e,"author",Mo.gpx);if(l(t)){let n={name:bu(t,"name",Mo.gpx),email:nht(t),link:Nxe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function nht(e){let t=rb(e,"email",Mo.gpx);if(l(t)){let n=bu(t,"id",Mo.gpx),i=bu(t,"domain",Mo.gpx);return`${n}@${i}`}}function Nxe(e){let t=rb(e,"link",Mo.gpx);if(l(t)){let n={href:k2(t,"href"),text:bu(t,"text",Mo.gpx),mimeType:bu(t,"type",Mo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function iht(e){let t=rb(e,"copyright",Mo.gpx);if(l(t)){let n={author:k2(t,"author"),year:bu(t,"year",Mo.gpx),license:bu(t,"license",Mo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function oht(e){let t=rb(e,"bounds",Mo.gpx);if(l(t)){let n={minLat:F2(t,"minlat",Mo.gpx),maxLat:F2(t,"maxlat",Mo.gpx),minLon:F2(t,"minlon",Mo.gpx),maxLon:F2(t,"maxlon",Mo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Ixe={wpt:Lxe,rte:Zdt,trk:Qdt};function rht(e,t,n,i){let o=Object.keys(Ixe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ixe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Mo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Pxe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=k2(o,"version"),s=k2(o,"creator"),a,c=eht(o);l(c)&&(a=c.name),o.localName==="gpx"?rht(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,_=$.equals(d,Ge.MINIMUM_VALUE),m=$.equals(p,Ge.MAXIMUM_VALUE);if(!_||!m){let b;_&&(b=new Date,b.setHours(0,0,0,0),d=$.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=$.fromDate(b)),u=new Yh,u.startTime=d,u.stopTime=p,u.currentTime=$.clone(d),u.clockRange=ts.LOOP_STOP,u.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max($.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),sht(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),es.setLoading(e,!1),e}function sht(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 aht(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Ee){n=Ee.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?Kdt(r).then(function(s){let a,c;try{a=Rxe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new se(u)}return Pxe(e,a,i)}):Pxe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function qv(){this._changed=new me,this._error=new me,this._loading=new me,this._clock=void 0,this._entityCollection=new fa(this),this._entityCluster=new nf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Vg}qv.load=function(e,t){return new qv().load(e,t)};Object.defineProperties(qv.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}}});qv.prototype.update=function(e){return!0};qv.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=t??G.EMPTY_OBJECT,es.setLoading(this,!0);let n=this._name,i=this;return aht(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=$.equals(s,Ge.MINIMUM_VALUE),u=$.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=$.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=$.fromDate(d)),o=new Yh,o.startTime=s,o.stopTime=a,o.currentTime=$.clone(s),o.clockRange=ts.LOOP_STOP,o.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max($.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),es.setLoading(i,!1),i}).catch(function(o){return es.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var U2=qv;function cht(e,t){this.position=e,this.headingPitchRoll=t}var z2=cht;var Kxe=er(h$(),1),q2=er(Ru(),1);function lht(e,t){this.position=e,this.headingPitchRange=t}var V2=lht;function bG(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new me,this.tourEnd=new me,this.entryStart=new me,this.entryEnd=new me,this._activeEntries=[]}bG.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};bG.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Bxe.call(this,e,t,function(i){n.playlistIndex=0,i||Fxe(n._activeEntries),n.tourEnd.raiseEvent(i)})};bG.prototype.stop=function(){Fxe(this._activeEntries)};function Fxe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Bxe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=uht.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 uht(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++,Bxe.call(this,e,t,n)}}var H2=bG;var ki=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-ki.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?ki.Bounce.In(e*2)*.5:ki.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),G2=function(){return performance.now()},fht=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=G2()),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}(),Yv={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=Yv.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=Yv.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=Yv.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=Yv.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}}},kxe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),y$=new fht,Uxe=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ki.Linear.None,this._interpolationFunction=Yv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=kxe.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=y$,y$.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=G2()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],_=0,m=d.length;_<m;_+=1){var y=this._handleRelativeValue(a,d[_]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var b=a;for(var x in b)n[s][x]=b[x];o[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var T={};for(var x in d)T[x]=d[x];i[s]=d=T}this._setupProperties(b,n[s],d,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=G2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=G2()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=ki.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Yv.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=G2()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),b=s-y*a,x=Math.min(b/i._duration,1);return x===0&&s===i._duration?1:x},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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 _=0,m=this._chainedTweens.length;_<m;_++)this._chainedTweens[_].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var ydi=kxe.nextId,Cp=y$,bdi=Cp.getAll.bind(Cp),xdi=Cp.removeAll.bind(Cp),Tdi=Cp.add.bind(Cp),Cdi=Cp.remove.bind(Cp),Adi=Cp.update.bind(Cp);var dht={LINEAR_NONE:ki.Linear.None,QUADRATIC_IN:ki.Quadratic.In,QUADRATIC_OUT:ki.Quadratic.Out,QUADRATIC_IN_OUT:ki.Quadratic.InOut,CUBIC_IN:ki.Cubic.In,CUBIC_OUT:ki.Cubic.Out,CUBIC_IN_OUT:ki.Cubic.InOut,QUARTIC_IN:ki.Quartic.In,QUARTIC_OUT:ki.Quartic.Out,QUARTIC_IN_OUT:ki.Quartic.InOut,QUINTIC_IN:ki.Quintic.In,QUINTIC_OUT:ki.Quintic.Out,QUINTIC_IN_OUT:ki.Quintic.InOut,SINUSOIDAL_IN:ki.Sinusoidal.In,SINUSOIDAL_OUT:ki.Sinusoidal.Out,SINUSOIDAL_IN_OUT:ki.Sinusoidal.InOut,EXPONENTIAL_IN:ki.Exponential.In,EXPONENTIAL_OUT:ki.Exponential.Out,EXPONENTIAL_IN_OUT:ki.Exponential.InOut,CIRCULAR_IN:ki.Circular.In,CIRCULAR_OUT:ki.Circular.Out,CIRCULAR_IN_OUT:ki.Circular.InOut,ELASTIC_IN:ki.Elastic.In,ELASTIC_OUT:ki.Elastic.Out,ELASTIC_IN_OUT:ki.Elastic.InOut,BACK_IN:ki.Back.In,BACK_OUT:ki.Back.Out,BACK_IN_OUT:ki.Back.InOut,BOUNCE_IN:ki.Bounce.In,BOUNCE_OUT:ki.Bounce.Out,BOUNCE_IN_OUT:ki.Bounce.InOut},os=Object.freeze(dht);function xG(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}xG.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 re(this.view.position);t.flyToBoundingSphere(o,i)}};xG.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};xG.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=os.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=ct(t,e)),t};var j2=xG;function b$(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}b$.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};b$.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var W2=b$;var $xe={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=Xb(t),$xe[t]}},v$;typeof DOMParser<"u"&&(v$=new DOMParser);var hht=new Kxe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),sb=32,zxe=2414016,Vxe=1,Hxe=16093e3,Gxe=.1,jxe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Wxe=["http://www.google.com/kml/ext/2.2"],mht=["http://www.w3.org/2005/Atom"],Me={kml:jxe,gx:Wxe,atom:mht,kmlgx:jxe.concat(Wxe)},w$={Document:sTe,Folder:Mht,Placemark:Lht,NetworkLink:Ght,GroundOverlay:zht,PhotoOverlay:lTe,ScreenOverlay:Uht,Tour:Fht};function Ap(e){this._dataSource=e,this._deferred=Zs(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Ap.prototype,{dataSource:{get:function(){return this._dataSource}}});Ap.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Ap.prototype.addPromise=function(e){this._promises.push(e)};Ap.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Ap.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=yf._getTimestamp()),this._process(e)};Ap.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=yf._getTimestamp(),e._process(!0)},0)};Ap.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]};Ap.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Ap.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=w$[i.localName];if(l(o)&&(Me.kml.indexOf(i.namespaceURI)!==-1||Me.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||yf._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function pht(e){let t=e.slice(0,Math.min(4,e.size)),n=Zs(),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 _ht(e){let t=Zs(),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 Zxe(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 Qxe(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 ght(e,t){return Promise.resolve(e.getData(new IH)).then(function(n){n=Zxe(n),n=Qxe(n),t.kml=v$.parseFromString(n,"application/xml")})}function x$(e,t){let n=$xe.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new vH(n))).then(function(i){t[e.filename]=i})}function _f(e,t,n,i){let o=i.keys,r=new q2.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new q2.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let _=o[p];c.setAttribute(n,i[_]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",_)}}}}function gf(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=I$(a,i);l(c)&&s.setAttribute(n,c.url)}}function Jxe(e,t,n){let i=Gs(e,"id");i=l(i)&&i.length!==0?i:Ln(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Ln(),l(n)&&(i=n+i)),o=t.add(new ar({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Yht),o}function Y2(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function EG(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.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,h.fromDegrees(i,o,r,t)}function TG(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++]=EG(n[s],t);return o}function ab(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 Gs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ui(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 qxe(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 cm(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 ii(e,t,n){let i=Ui(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Rn(e,t,n){let i=Ui(e,t,n);if(l(i))return i.textContent.trim()}function lm(e,t,n){let i=Ui(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function I$(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 Ee({url:o});else{let r=new q2.default(t.getUrlComponent()),s=new q2.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ee({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var xu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function E$(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?(xu.maximumRed=r,xu.red=void 0):(xu.maximumRed=void 0,xu.red=0),o>0?(xu.maximumGreen=o,xu.green=void 0):(xu.maximumGreen=void 0,xu.green=0),i>0?(xu.maximumBlue=i,xu.blue=void 0):(xu.maximumBlue=void 0,xu.blue=0),xu.alpha=n,H.fromRandom(xu)):new H(r,o,i,n)}function wC(e,t,n){let i=Rn(e,t,n);if(l(i))return E$(i,Rn(e,"colorMode",n)==="random")}function yht(e){let t=Ui(e,"TimeStamp",Me.kmlgx),n=Rn(t,"when",Me.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=$.fromIso8601(n),o=new Jr;return o.addInterval(new En({start:i,stop:Ge.MAXIMUM_VALUE})),o}function bht(e){let t=Ui(e,"TimeSpan",Me.kmlgx);if(!l(t))return;let n,i=Ui(t,"begin",Me.kmlgx),o=l(i)?$.fromIso8601(i.textContent):void 0,r=Ui(t,"end",Me.kmlgx),s=l(r)?$.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if($.lessThan(s,o)){let a=o;o=s,s=a}n=new Jr,n.addInterval(new En({start:o,stop:s}))}else l(o)?(n=new Jr,n.addInterval(new En({start:o,stop:Ge.MAXIMUM_VALUE}))):l(s)&&(n=new Jr,n.addInterval(new En({start:Ge.MINIMUM_VALUE,stop:s})));return n}function eTe(){let e=new vc;return e.width=sb,e.height=sb,e.scaleByDistance=new Vt(zxe,Vxe,Hxe,Gxe),e.pixelOffsetScaleByDistance=new Vt(zxe,Vxe,Hxe,Gxe),e}function P$(){let e=new ph;return e.outline=!0,e.outlineColor=H.WHITE,e}function tTe(){let e=new mh;return e.translucencyByDistance=new Vt(3e6,1,5e6,0),e.pixelOffset=new V(17,0),e.horizontalOrigin=Ci.LEFT,e.font="16px sans-serif",e.style=$o.FILL_AND_OUTLINE,e}function D$(e,t,n,i,o){let r=Rn(e,"href",Me.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=ii(e,"x",Me.gx)??0,u=ii(e,"y",Me.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=I$(r,n,i);if(o){let a=Rn(e,"refreshMode",Me.kml),c=Rn(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?bt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&bt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Rn(e,"viewBoundScale",Me.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Rn(e,"viewFormat",Me.kml)??f,p=Rn(e,"httpQuery",Me.kml);l(d)&&s.setQueryParameters(Mu(AG(d))),l(p)&&s.setQueryParameters(Mu(AG(p)));let _=t._ellipsoid;return O$(s,t.camera,t.canvas,u,t._lastCameraView.bbox,_),s}return s}function xht(e,t,n,i,o){let r=ii(t,"scale",Me.kml),s=ii(t,"heading",Me.kml),a=wC(t,"color",Me.kml),c=Ui(t,"Icon",Me.kml),u=D$(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=ii(c,"x",Me.gx),d=ii(c,"y",Me.gx),p=ii(c,"w",Me.gx),_=ii(c,"h",Me.gx),m=Ui(t,"hotSpot",Me.kml),y=ab(m,"x"),b=ab(m,"y"),x=Gs(m,"xunits"),T=Gs(m,"yunits"),C=n.billboard;l(C)||(C=eTe(),n.billboard=C),C.image=u,C.scale=r,C.color=a,(l(f)||l(d)||l(p)||l(_))&&(C.imageSubRegion=new Xe(f,d,p,_)),l(s)&&s!==0&&(C.rotation=D.toRadians(-s),C.alignedAxis=h.UNIT_Z),r=r??1;let A,S;l(y)&&(x==="pixels"?A=-y*r:x==="insetPixels"?A=(y-sb)*r:x==="fraction"&&(A=-y*sb*r),A+=sb*.5*r),l(b)&&(T==="pixels"?S=b*r:T==="insetPixels"?S=(-b+sb)*r:T==="fraction"&&(S=b*sb*r),S-=sb*.5*r),(l(A)||l(S))&&(C.pixelOffset=new V(A,S))}function CG(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")xht(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=tTe(),n.label=c),c.scale=ii(a,"scale",Me.kml)??c.scale,c.fillColor=wC(a,"color",Me.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Pc,n.polyline=c),c.width=ii(a,"width",Me.kml),c.material=wC(a,"color",Me.kml),l(wC(a,"outerColor",Me.gx))&&bt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ii(a,"outerWidth",Me.gx))&&bt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ii(a,"physicalWidth",Me.gx))&&bt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(lm(a,"labelVisibility",Me.gx))&&bt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=P$(),n.polygon=c),c.material=wC(a,"color",Me.kml)??c.material,c.fill=lm(a,"fill",Me.kml)??c.fill,c.outline=lm(a,"outline",Me.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=E$(Rn(a,"bgColor",Me.kml))??H.WHITE,u=E$(Rn(a,"textColor",Me.kml))??H.BLACK,f=Rn(a,"text",Me.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Rn(a,"listItemType",Me.kml);(c==="radioFolder"||c==="checkOffOnly")&&bt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Tht(e,t,n,i,o){let r=new ar,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")CG(e,d,r,i,o);else{let p=cm(d,"Pair",Me.kml);for(let _=0;_<p.length;_++){let m=p[_],y=Rn(m,"key",Me.kml);if(y==="normal"){let b=Rn(m,"styleUrl",Me.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let x=Ui(m,"Style",Me.kml);CG(e,x,r,i,o)}}else bt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Rn(t,"styleUrl",Me.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),_=p[0];d=`${i.getDerivedResource({url:_}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&r.merge(s)}return r}function Cht(e,t,n){return t.fetchXML().then(function(i){return nTe(e,i,n,t,!0)})}function nTe(e,t,n,i,o,r){let s,a,c,u,f=qxe(t,"Style",Me.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Gs(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new ar({id:a}),n.add(c),CG(e,u,c,i,r)))}let d=qxe(t,"StyleMap",Me.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let b=d[s];if(a=Gs(b,"id"),l(a)){let x=cm(b,"Pair",Me.kml);for(let T=0;T<x.length;T++){let C=x[T],A=Rn(C,"key",Me.kml);if(A==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let S=Rn(C,"styleUrl",Me.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let w=n.getById(S);l(w)&&c.merge(w)}else u=Ui(C,"Style",Me.kml),CG(e,u,c,i,r)}}else bt(`kml-styleMap-${A}`,`KML - Unsupported StyleMap key: ${A}`)}}}}let p=[],_=t.getElementsByTagName("styleUrl"),m=_.length;for(s=0;s<m;s++){let y=_[s].textContent;if(y[0]!=="#"){let b=y.split("#");if(b.length===2){let x=b[0],T=i.getDerivedResource({url:x});p.push(Cht(e,T,n))}}}return p}function R$(e,t,n){let i=new wg(e,t.id,["position"]),o=new up(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Pc,t.polyline.positions=new vg([i,o])}function iTe(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"?(bt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ke.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(bt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ke.RELATIVE_TO_GROUND):(l(e)?bt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):bt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ke.CLAMP_TO_GROUND)}function Aht(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new up(e))}function Eht(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function SG(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():tTe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():eTe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(H.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new V(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function oTe(e,t){let n=e.path;l(n)||(n=new x_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Sht(e,t,n,i,o){let r=Rn(n,"coordinates",Me.kml),s=Rn(n,"altitudeMode",Me.kml),a=Rn(n,"altitudeMode",Me.gx),c=lm(n,"extrude",Me.kml),u=e._ellipsoid,f=EG(r,u);return i.position=f,SG(e,i,o,iTe(s,a)),c&&Y2(s,a)&&R$(t,i,o),!0}function Yxe(e,t,n,i,o){let r=Ui(n,"coordinates",Me.kml),s=Rn(n,"altitudeMode",Me.kml),a=Rn(n,"altitudeMode",Me.gx),c=lm(n,"extrude",Me.kml),u=lm(n,"tessellate",Me.kml),f=Y2(s,a),d=ii(n,"drawOrder",Me.gx),p=e._ellipsoid,_=TG(r,p),m=o.polyline;if(f&&c){let y=new T_;i.wall=y,y.positions=_;let b=o.polygon;l(b)&&(y.fill=b.fill,y.material=b.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:H.WHITE,y.outlineWidth=m.width):l(b)&&(y.outlineColor=l(b.material)?b.material.color:H.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Pc;y.clampToGround=!0,i.polyline=y,y.positions=_,l(m)?(y.material=l(m.material)?m.material.color.getValue(Ge.MINIMUM_VALUE):H.WHITE,y.width=m.width??1):(y.material=H.WHITE,y.width=1),y.zIndex=d}else l(d)&&bt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&bt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Pc,i.polyline=m,m.positions=Eht(_,s,a,p),(!u||f)&&(m.arcType=tn.NONE);return!0}function vht(e,t,n,i,o){let r=Ui(n,"outerBoundaryIs",Me.kml),s=Ui(r,"LinearRing",Me.kml),a=Ui(s,"coordinates",Me.kml),c=e._ellipsoid,u=TG(a,c),f=lm(n,"extrude",Me.kml),d=Rn(n,"altitudeMode",Me.kml),p=Rn(n,"altitudeMode",Me.gx),_=Y2(d,p),m=l(o.polygon)?o.polygon.clone():P$(),y=o.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:H.WHITE,m.outlineWidth=y.width),i.polygon=m,_?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let b=new Ja(u),x=cm(n,"innerBoundaryIs",Me.kml);for(let T=0;T<x.length;T++){s=cm(x[T],"LinearRing",Me.kml);for(let C=0;C<s.length;C++)a=Ui(s[C],"coordinates",Me.kml),u=TG(a,c),l(u)&&b.holes.push(new Ja(u))}m.hierarchy=b}return!0}function wht(e,t,n,i,o){let r=Rn(n,"altitudeMode",Me.kml),s=Rn(n,"altitudeMode",Me.gx),a=cm(n,"coord",Me.gx),c=cm(n,"angles",Me.gx),u=cm(n,"when",Me.kml),f=lm(n,"extrude",Me.kml),d=Y2(r,s),p=e._ellipsoid;c.length>0&&bt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let _=Math.min(a.length,u.length),m=[],y=[];for(let x=0;x<_;x++){let T=EG(a[x].textContent,p);m.push(T),y.push($.fromIso8601(u[x].textContent))}let b=new La;return b.addSamples(y,m),i.position=b,SG(e,i,o,iTe(r,s)),oTe(i,o),i.availability=new Jr,u.length>0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),d&&f&&R$(t,i,o),!0}function Xxe(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new La;d.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:Aht(d,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function Iht(e,t,n,i,o){let r=lm(n,"interpolate",Me.gx),s=cm(n,"Track",Me.gx),a,c,u,f=!1,d=new Pg,p=new Jr,_=new Oa,m=e._ellipsoid;for(let y=0,b=s.length;y<b;y++){let x=s[y],T=cm(x,"when",Me.kml),C=cm(x,"coord",Me.gx),A=Rn(x,"altitudeMode",Me.kml),S=Rn(x,"altitudeMode",Me.gx),w=Y2(A,S),R=lm(x,"extrude",Me.kml),P=Math.min(C.length,T.length),O=[];a=[];for(let L=0;L<P;L++){let g=EG(C[L].textContent,m);O.push(g),a.push($.fromIso8601(T[L].textContent))}r&&(l(c)&&Xxe([c,a[0]],[u,O[0]],_,p,d,!1,"absolute",void 0,!1),c=a[P-1],u=O[O.length-1]),Xxe(a,O,_,p,d,w&&R,A,S,!0),f=f||w&&R}return i.availability=p,i.position=_,SG(e,i,o),oTe(i,o),f&&(R$(t,i,o),i.polyline.show=d),!0}var rTe={Point:Sht,LineString:Yxe,LinearRing:Yxe,Polygon:vht,Track:wht,MultiTrack:Iht,MultiGeometry:Pht,Model:Dht};function Pht(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=rTe[f.localName];if(l(d)){let p=Jxe(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(a=!0)}}return a}function Dht(e,t,n,i,o){return bt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Rht(e,t){let n=Ui(e,"ExtendedData",Me.kml);if(!l(n))return;l(Ui(n,"SchemaData",Me.kml))&&bt("kml-schemaData","KML - SchemaData is unsupported"),l(Gs(n,"xmlns:prefix"))&&bt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=cm(n,"Data",Me.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Gs(a,"name");l(c)&&(i[c]={displayName:Rn(a,"displayName",Me.kml),value:Rn(a,"value",Me.kml)})}}t.kml.extendedData=i}var xo;typeof document<"u"&&(xo=document.createElement("div"));function Oht(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Rn(e,"description",Me.kml),d=t.balloonStyle??n.balloonStyle,p=H.WHITE,_=H.BLACK,m=f;l(d)&&(p=d.bgColor??H.WHITE,_=d.textColor??H.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let T=m.match(/\$\[.+?\]/g);if(T!==null)for(r=0;r<T.length;r++){let C=T[r],A=C.substr(2,C.length-3),S=/\/displayName$/.test(A);A=A.replace(/\/displayName$/,""),y=u[A],l(y)&&(y=S?y.displayName:y.value),l(y)&&(m=m.replace(C,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=hht.link(m),xo.innerHTML=m;let b=xo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(_f(xo,"a","href",i),_f(xo,"link","href",i),_f(xo,"area","href",i),_f(xo,"img","src",i),_f(xo,"iframe","src",i),_f(xo,"video","src",i),_f(xo,"audio","src",i),_f(xo,"source","src",i),_f(xo,"track","src",i),_f(xo,"input","src",i),_f(xo,"embed","src",i),_f(xo,"script","src",i),_f(xo,"video","poster",i)),gf(xo,"a","href",o),gf(xo,"link","href",o),gf(xo,"area","href",o),gf(xo,"img","src",o),gf(xo,"iframe","src",o),gf(xo,"video","src",o),gf(xo,"audio","src",o),gf(xo,"source","src",o),gf(xo,"track","src",o),gf(xo,"input","src",o),gf(xo,"embed","src",o),gf(xo,"script","src",o),gf(xo,"video","poster",o);let x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+=`background-color:${p.toCssColorString()};`,x+=`color:${_.toCssColorString()};`,x+='">',x+=`${xo.innerHTML}</div>`,xo.innerHTML="",t.description=x}function vG(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Jxe(t,i,n.context),c=a.kml,u=Tht(e,t,n.styleCollection,r,s),f=Rn(t,"name",Me.kml);a.name=f,a.parent=o;let d=bht(t);l(d)||(d=yht(t)),a.availability=d,L$(a);function p(C){return C?C.show&&p(C.parent):!0}let _=lm(t,"visibility",Me.kml);a.show=p(o)&&(_??!0);let m=Ui(t,"author",Me.atom),y=c.author;y.name=Rn(m,"name",Me.atom),y.uri=Rn(m,"uri",Me.atom),y.email=Rn(m,"email",Me.atom);let b=Ui(t,"link",Me.atom),x=c.link;x.href=Gs(b,"href"),x.hreflang=Gs(b,"hreflang"),x.rel=Gs(b,"rel"),x.type=Gs(b,"type"),x.title=Gs(b,"title"),x.length=Gs(b,"length"),c.address=Rn(t,"address",Me.kml),c.phoneNumber=Rn(t,"phoneNumber",Me.kml),c.snippet=Rn(t,"Snippet",Me.kml),Rht(t,a),Oht(t,a,u,s,r);let T=e._ellipsoid;return cTe(t,a,T),aTe(t,a,T),l(Ui(t,"Region",Me.kml))&&bt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function sTe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Mht(e,t,n,i){let o=vG(e,t,n),r=Fe(n);r.parentEntity=o.entity,sTe(e,t,r,i)}function Lht(e,t,n,i){let o=vG(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=rTe[d.localName];l(p)&&(p(e,n.entityCollection,d,r,s,r.id),a=!0)}a||(r.merge(s),SG(e,r,s))}var Nht={FlyTo:kht,Wait:Bht,SoundCue:T$,AnimatedUpdate:T$,TourControl:T$};function Fht(e,t,n,i){let o=Rn(t,"name",Me.kml),r=Gs(t,"id"),s=new H2(o,r),a=Ui(t,"Playlist",Me.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=Nht[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function T$(e,t){bt(`KML Tour unsupported node ${t.localName}`)}function Bht(e,t){let n=ii(t,"duration",Me.gx);e.addPlaylistEntry(new W2(n))}function kht(e,t,n){let i=ii(t,"duration",Me.gx),o=Rn(t,"flyToMode",Me.gx),r={kml:{}};cTe(t,r,n),aTe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new j2(i,o,s);e.addPlaylistEntry(a)}function aTe(e,t,n){let i=Ui(e,"Camera",Me.kml);if(l(i)){let o=ii(i,"longitude",Me.kml)??0,r=ii(i,"latitude",Me.kml)??0,s=ii(i,"altitude",Me.kml)??0,a=ii(i,"heading",Me.kml)??0,c=ii(i,"tilt",Me.kml)??0,u=ii(i,"roll",Me.kml)??0,f=h.fromDegrees(o,r,s,n),d=qa.fromDegrees(a,c-90,u);t.kml.camera=new z2(f,d)}}function cTe(e,t,n){let i=Ui(e,"LookAt",Me.kml);if(l(i)){let o=ii(i,"longitude",Me.kml)??0,r=ii(i,"latitude",Me.kml)??0,s=ii(i,"altitude",Me.kml)??0,a=ii(i,"heading",Me.kml),c=ii(i,"tilt",Me.kml),u=ii(i,"range",Me.kml)??0;c=D.toRadians(c??0),a=D.toRadians(a??0);let f=new Od(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(o,r,s,n);t.kml.lookAt=new V2(d,f)}}function Uht(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ui(t,"Icon",Me.kml),c=D$(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Ui(t,"screenXY",Me.kml),p=Ui(t,"overlayXY",Me.kml),_=Ui(t,"size",Me.kml),m,y,b,x,T,C;l(_)&&(m=ab(_,"x"),y=ab(_,"y"),b=Gs(_,"xunits"),x=Gs(_,"yunits"),l(m)&&m!==-1&&m!==0&&(b==="fraction"?T=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(T=`width: ${m}px`),f.push(T)),l(y)&&y!==-1&&y!==0&&(x==="fraction"?C=`height: ${Math.floor(y*100)}%`:x==="pixels"&&(C=`height: ${y}px`),f.push(C))),u.style=f.join(";");let A=0,S=u.height;l(p)&&(m=ab(p,"x"),y=ab(p,"y"),b=Gs(p,"xunits"),x=Gs(p,"yunits"),l(m)&&(b==="fraction"?A=m*u.width:(b==="pixels"||b==="insetPixels")&&(A=m)),l(y)&&(x==="fraction"?S=y*u.height:(x==="pixels"||x==="insetPixels")&&(S=y))),l(d)&&(m=ab(d,"x"),y=ab(d,"y"),b=Gs(d,"xunits"),x=Gs(d,"yunits"),l(m)&&(b==="fraction"?T=`left: calc(${Math.floor(m*100)}% - ${A}px)`:b==="pixels"?T=`left: ${m-A}px`:b==="insetPixels"&&(T=`right: ${m-A}px`),f.push(T)),l(y)&&(x==="fraction"?C=`bottom: calc(${Math.floor(y*100)}% - ${S}px)`:x==="pixels"?C=`bottom: ${y-S}px`:x==="insetPixels"&&(C=`top: ${y-S}px`),f.push(C))),u.style=f.join(";")},o.appendChild(u)}function zht(e,t,n,i){let r=vG(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=TG(Ui(t,"LatLonQuad",Me.gx),c),f=ii(t,"drawOrder",Me.kml);if(l(u))s=P$(),s.hierarchy=new Ja(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new _h,s.zIndex=f,r.rectangle=s;let m=Ui(t,"LatLonBox",Me.kml);if(l(m)){let y=ii(m,"west",Me.kml),b=ii(m,"south",Me.kml),x=ii(m,"east",Me.kml),T=ii(m,"north",Me.kml);l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(b)&&(b=D.clampToLatitudeRange(D.toRadians(b))),l(x)&&(x=D.negativePiToPi(D.toRadians(x))),l(T)&&(T=D.clampToLatitudeRange(D.toRadians(T))),s.coordinates=new ae(y,b,x,T);let C=ii(m,"rotation",Me.kml);if(l(C)){let A=D.toRadians(C);s.rotation=A,s.stRotation=A}}}let d=Ui(t,"Icon",Me.kml),p=D$(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&bt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=ii(d,"x",Me.gx),y=ii(d,"y",Me.gx),b=ii(d,"w",Me.gx),x=ii(d,"h",Me.gx);(l(m)||l(y)||l(b)||l(x))&&bt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=wC(t,"color",Me.kml),s.material.transparent=!0}else s.material=wC(t,"color",Me.kml);let _=Rn(t,"altitudeMode",Me.kml);l(_)?_==="absolute"?(s.height=ii(t,"altitude",Me.kml),s.zIndex=void 0):_!=="clampToGround"&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`):(_=Rn(t,"altitudeMode",Me.gx),_==="relativeToSeaFloor"?(bt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ii(t,"altitude",Me.kml),s.zIndex=void 0):_==="clampToSeaFloor"?bt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(_)&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`))}function lTe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),bt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var cb={INTERVAL:0,EXPIRE:1,STOP:2};function AG(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Vht=new ae,Xv=new fe,C$=new V,Hht=new h;function O$(e,t,n,i,o,r){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=Zb(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=o??Vht,l(n)&&(C$.x=n.clientWidth*.5,C$.y=n.clientHeight*.5,u=t.pickEllipsoid(C$,r,Hht)),l(u)?f=r.cartesianToCartographic(u,Xv):(f=ae.center(o,Xv),u=r.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let x=o.width*i*.5,T=o.height*i*.5;o=new ae(a(f.longitude-x),s(f.latitude-T),a(f.longitude+x),s(f.latitude+T))}c=c.replace("[bboxWest]",D.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(o.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,Xv),c=c.replace("[cameraLon]",D.toDegrees(Xv.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(Xv.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(Xv.height).toString());let _=t.frustum,m=_.aspectRatio,y="",b="";if(l(m)){let x=D.toDegrees(_.fov);m>1?(y=x,b=x/m):(b=x,y=x*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",b.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(Mu(c))}function Ght(e,t,n,i){let r=vG(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Ui(t,"Link",Me.kml);if(l(c)||(c=Ui(t,"Url",Me.kml)),l(c)){let u=Rn(c,"href",Me.kml),f,d;if(l(u)){let p=u;if(u=I$(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Rn(c,"viewRefreshMode",Me.kml),f==="onRegion"){bt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Rn(c,"viewBoundScale",Me.kml)??1;let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=Rn(c,"viewFormat",Me.kml)??b,T=Rn(c,"httpQuery",Me.kml);l(x)&&u.setQueryParameters(Mu(AG(x))),l(T)&&u.setQueryParameters(Mu(AG(T)));let C=e._ellipsoid;O$(u,e.camera,e.canvas,d,e._lastCameraView.bbox,C)}let _={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new fa,y=M$(e,m,u,_).then(function(b){let x=e._entityCollection,T=m.values;x.suspendEvents();for(let S=0;S<T.length;S++){let w=T[S];l(w.parent)||(w.parent=r,L$(w)),x.add(w)}x.resumeEvents();let C=Rn(c,"refreshMode",Me.kml),A=ii(c,"refreshInterval",Me.kml)??0;if(C==="onInterval"&&A>0||C==="onExpire"||f==="onStop"){let S=Ui(b,"NetworkLinkControl",Me.kml),w=l(S),R=$.now(),P={id:Ln(),href:u,cookie:{},lastUpdated:R,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:R},O=0;if(w&&(P.cookie=Mu(Rn(S,"cookie",Me.kml)??""),O=ii(S,"minRefreshPeriod",Me.kml)??0),C==="onInterval")w&&(A=Math.max(O,A)),P.refreshMode=cb.INTERVAL,P.time=A;else if(C==="onExpire"){let L;if(w&&(L=Rn(S,"expires",Me.kml)),l(L))try{let g=$.fromIso8601(L),E=$.secondsDifference(g,R);E>0&&E<O&&$.addSeconds(R,O,g),P.refreshMode=cb.EXPIRE,P.time=g}catch{bt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else bt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(P.refreshMode=cb.STOP,P.time=ii(c,"viewRefreshTime",Me.kml)??0):bt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(b){bt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(y)}}}function jht(e,t,n,i){let o=w$[t.localName];return l(o)?o(e,t,n,i):lTe(e,t,n,i)}function S$(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Ui(a,"Document",Me.kml),u=Rn(c,"name",Me.kml);l(u)||(u=Eg(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new yf._DeferredLoading(e),d=new fa(e);return Promise.all(nTe(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let b=m[y];if(l(w$[b.localName])){p=b;break}}}let _={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),jht(e,p,_,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Wht(e,t,n,i,o){let r=on("ThirdParty/Workers/z-worker-pako.js");Ov({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new HH(new zg(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(x$(f,u)),f=p):c.push(x$(p,u)))}return l(f)&&c.push(ght(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new se("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),S$(e,t,u.kml,i,u,o)})})}function M$(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=o??Ee.DEFAULT.clone();return o=Ee.createIfNeeded(o),l(a)&&(a=Dn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?pht(u).then(function(f){return f?Wht(e,t,u,o,a):_ht(u).then(function(d){d=Zxe(d),d=Qxe(d);let p,_;try{p=v$.parseFromString(d,"application/xml")}catch(m){_=m.toString()}if(l(_)||p.body||p.documentElement.tagName==="parsererror"){let m=l(_)?_:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new se(m)}return S$(e,t,p,o,r,a,s)})}):S$(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function yf(e){e=e??G.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new me,this._error=new me,this._loading=new me,this._refresh=new me,this._unsupportedNode=new me,this._clock=void 0,this._entityCollection=new fa(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Vg,this._networkLinks=new wt,this._entityCluster=new nf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ae.clone(ae.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new _t(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}yf.load=function(e,t){return t=t??G.EMPTY_OBJECT,new yf(t).load(e,t)};Object.defineProperties(yf.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}}});yf.prototype.load=function(e,t){t=t??G.EMPTY_OBJECT,es.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return M$(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=$.equals(s,Ge.MINIMUM_VALUE),u=$.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=$.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=$.fromDate(d)),o=new Yh,o.startTime=s,o.stopTime=a,o.currentTime=$.clone(s),o.clockRange=ts.LOOP_STOP,o.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max($.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),es.setLoading(i,!1),i}).catch(function(o){return es.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};yf.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function L$(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 qht(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ui(r,"NetworkLinkControl",Me.kml),c=l(a),u=0;if(c){if(l(Ui(a,"Update",Me.kml))){bt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Mu(Rn(a,"cookie",Me.kml)??""),u=ii(a,"minRefreshPeriod",Me.kml)??0}let f=$.now(),d=t.refreshMode;if(d===cb.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===cb.EXPIRE){let R;if(l(a)&&(R=Rn(a,"expires",Me.kml)),l(R))try{let P=$.fromIso8601(R),O=$.secondsDifference(P,f);O>0&&O<u&&$.addSeconds(f,u,P),t.time=P}catch{bt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else bt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,_=e._entityCollection,m=n.values;function y(R){_.remove(R);let P=R._children,O=P.length;for(let L=0;L<O;++L)y(P[L])}_.suspendEvents();let b=_.values.slice(),x;for(x=0;x<b.length;++x){let R=b[x];R.parent===p&&(R.parent=void 0,y(R))}for(_.resumeEvents(),_.suspendEvents(),x=0;x<m.length;x++){let R=m[x];l(R.parent)||(R.parent=p,L$(R)),_.add(R)}_.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let T=_.computeAvailability(),C=T.start,A=T.stop,S=$.equals(C,Ge.MINIMUM_VALUE),w=$.equals(A,Ge.MAXIMUM_VALUE);if(!S||!w){let R=e._clock;(R.startTime!==C||R.stopTime!==A)&&(R.startTime=C,R.stopTime=A,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var A$=new wt;yf.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=$.now(),i=this;A$.removeAll();function o(f){let d=f._children,p=d.length;for(let _=0;_<p;++_){let m=d[_];A$.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,D.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,D.EPSILON7)&&a.upWC.equalsEpsilon(s.up,D.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new wt,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!A$.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===cb.INTERVAL?$.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===cb.EXPIRE?$.greaterThan(n,f.time)&&(p=!0):f.refreshMode===cb.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&$.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let _=new fa,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??te.default;O$(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),M$(i,_,m,{context:d.id}).then(qht(i,f,_,c,m)).catch(function(b){let x=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Yht(){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}yf._DeferredLoading=Ap;yf._getTimestamp=Si;var IC=yf;function X2(){he.throwInstantiationError()}X2.prototype.update=he.throwInstantiationError;X2.prototype.getBoundingSphere=he.throwInstantiationError;X2.prototype.isDestroyed=he.throwInstantiationError;X2.prototype.destroy=he.throwInstantiationError;var N$=X2;var Xht={NONE:0,LERC:1},Fd=Object.freeze(Xht);var Kht={NONE:0,BITS12:1},ma=Object.freeze(Kht);var PC=new h,$ht=new h,Bd=new V,wG=new M,Zht=new M,Qht=Math.pow(2,12);function qc(e,t,n,i,o,r,s,a,c,u){let f=ma.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let _=t.minimum,m=t.maximum,y=h.subtract(m,_,$ht),b=i-n;Math.max(h.maximumComponent(y),b)<Qht-1?f=ma.BITS12:f=ma.NONE,d=M.inverseTransformation(o,new M);let T=h.negate(_,PC);M.multiply(M.fromTranslation(T,wG),d,d);let C=PC;C.x=1/y.x,C.y=1/y.y,C.z=1/y.z,M.multiply(M.fromScale(C,wG),d,d),p=M.clone(o),M.setTranslation(p,h.ZERO,p),o=M.clone(o,new M);let A=M.fromTranslation(_,wG),S=M.fromScale(y,Zht),w=M.multiply(A,S,wG);M.multiply(o,w,o),M.multiply(p,w,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}qc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===ma.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,PC),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((o-this.minimumHeight)/f,0,1);V.fromElements(n.x,n.y,Bd);let p=On.compressTextureCoordinates(Bd);V.fromElements(n.z,d,Bd);let _=On.compressTextureCoordinates(Bd);V.fromElements(c,u,Bd);let m=On.compressTextureCoordinates(Bd);if(e[t++]=p,e[t++]=_,e[t++]=m,this.hasWebMercatorT){V.fromElements(s,0,Bd);let y=On.compressTextureCoordinates(Bd);e[t++]=y}}else h.subtract(n,this.center,PC),e[t++]=PC.x,e[t++]=PC.y,e[t++]=PC.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=On.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Jht=new h,uTe=new h;qc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*r+f;t[p]=e[d]}let a=this.decodePosition(t,s,Jht),c=n.geodeticSurfaceNormal(a,uTe),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};qc.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]}};qc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===ma.BITS12){let i=On.decompressTextureCoordinates(e[t],Bd);n.x=i.x,n.y=i.y;let o=On.decompressTextureCoordinates(e[t+1],Bd);return n.z=o.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};qc.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,uTe),a=this.decodeHeight(e,t),c=Or.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};qc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new V),t*=this.stride,this.quantization===ma.BITS12?On.decompressTextureCoordinates(e[t+2],n):V.fromElements(e[t+4],e[t+5],n)};qc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===ma.BITS12?On.decompressTextureCoordinates(e[t+1],Bd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};qc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===ma.BITS12?On.decompressTextureCoordinates(e[t+3],Bd).x:e[t+6]};qc.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 V.fromElements(o,r,n)};qc.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};qc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case ma.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var IG={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},PG={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};qc.prototype.getAttributes=function(e){let t=K.FLOAT,n=K.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===ma.NONE){s(IG.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(IG.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(IG.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(PG.compressed0,a?4:3),c&&s(PG.compressed1,1),this.hasGeodeticSurfaceNormals&&s(PG.geodeticSurfaceNormal,3)}return r};qc.prototype.getAttributeLocations=function(){return this.quantization===ma.NONE?IG:PG};qc.clone=function(e,t){if(l(e))return l(t)||(t=new qc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Yc=qc;var Ep={};Ep.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var F$=new h,emt=new M,tmt=new h,nmt=new h;Ep.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,_=e.isGeographic??!0,m=e.ellipsoid??te.default,y=1/m.maximumRadius,b=ae.clone(e.nativeRectangle),x=ae.clone(e.rectangle),T,C,A,S;l(x)?(T=x.west,C=x.south,A=x.east,S=x.north):_?(T=a(b.west),C=a(b.south),A=a(b.east),S=a(b.north)):(T=b.west*y,C=s-2*o(r(-b.south*y)),A=b.east*y,S=s-2*o(r(-b.north*y)));let w=e.relativeToCenter,R=l(w);w=R?w:h.ZERO;let P=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,E=O!==1,v=e.structure??Ep.DEFAULT_STRUCTURE,I=v.heightScale??Ep.DEFAULT_STRUCTURE.heightScale,N=v.heightOffset??Ep.DEFAULT_STRUCTURE.heightOffset,F=v.elementsPerHeight??Ep.DEFAULT_STRUCTURE.elementsPerHeight,U=v.stride??Ep.DEFAULT_STRUCTURE.stride,k=v.elementMultiplier??Ep.DEFAULT_STRUCTURE.elementMultiplier,z=v.isBigEndian??Ep.DEFAULT_STRUCTURE.isBigEndian,B=ae.computeWidth(b),j=ae.computeHeight(b),W=B/(u-1),J=j/(f-1);_||(B*=y,j*=y);let Y=m.radiiSquared,ee=Y.x,Q=Y.y,de=Y.z,ge=65536,le=-65536,ye=At.eastNorthUpToFixedFrame(w,m),xe=M.inverseTransformation(ye,emt),Ie,Te;P&&(Ie=Li.geodeticLatitudeToMercatorAngle(C),Te=1/(Li.geodeticLatitudeToMercatorAngle(S)-Ie));let ve=tmt;ve.x=Number.POSITIVE_INFINITY,ve.y=Number.POSITIVE_INFINITY,ve.z=Number.POSITIVE_INFINITY;let Ve=nmt;Ve.x=Number.NEGATIVE_INFINITY,Ve.y=Number.NEGATIVE_INFINITY,Ve.z=Number.NEGATIVE_INFINITY;let $e=Number.POSITIVE_INFINITY,Ct=u*f,Jt=d>0?u*2+f*2:0,Qe=Ct+Jt,mn=new Array(Qe),Bt=new Array(Qe),Ot=new Array(Qe),Jn=P?new Array(Qe):[],bi=E?new Array(Qe):[],Gt=0,Pt=f,oo=0,xt=u;p&&(--Gt,++Pt,--oo,++xt);let Jo=1e-5;for(let Ze=Gt;Ze<Pt;++Ze){let pt=Ze;pt<0&&(pt=0),pt>=f&&(pt=f-1);let qt=b.north-J*pt;_?qt=a(qt):qt=s-2*o(r(-qt*y));let An=(qt-C)/(S-C);An=D.clamp(An,0,1);let Bo=Ze===Gt,wo=Ze===Pt-1;d>0&&(Bo?qt+=Jo*j:wo&&(qt-=Jo*j));let pc=t(qt),_c=n(qt),Ii=de*_c,xi;P&&(xi=(Li.geodeticLatitudeToMercatorAngle(qt)-Ie)*Te);for(let Ta=oo;Ta<xt;++Ta){let rs=Ta;rs<0&&(rs=0),rs>=u&&(rs=u-1);let jl=pt*(u*U)+rs*U,Ao;if(F===1)Ao=c[jl];else{Ao=0;let Wo;if(z)for(Wo=0;Wo<F;++Wo)Ao=Ao*k+c[jl+Wo];else for(Wo=F-1;Wo>=0;--Wo)Ao=Ao*k+c[jl+Wo]}Ao=Ao*I+N,le=Math.max(le,Ao),ge=Math.min(ge,Ao);let zr=b.west+W*rs;_?zr=a(zr):zr=zr*y;let Yp=(zr-T)/(A-T);Yp=D.clamp(Yp,0,1);let ss=pt*u+rs;if(d>0){let Wo=Ta===oo,ln=Ta===xt-1,Ae=Bo||wo||Wo||ln;if((Bo||wo)&&(Wo||ln))continue;Ae&&(Ao-=d,Wo?(ss=Ct+(f-pt-1),zr-=Jo*B):wo?ss=Ct+f+(u-rs-1):ln?(ss=Ct+f+u+pt,zr+=Jo*B):Bo&&(ss=Ct+f+u+f+rs))}let Wl=pc*t(zr),gc=pc*n(zr),jb=ee*Wl,Ca=Q*gc,tl=1/i(jb*Wl+Ca*gc+Ii*_c),xs=jb*tl,Bf=Ca*tl,kf=Ii*tl,Uf=new h;Uf.x=xs+Wl*Ao,Uf.y=Bf+gc*Ao,Uf.z=kf+_c*Ao,M.multiplyByPoint(xe,Uf,F$),h.minimumByComponent(F$,ve,ve),h.maximumByComponent(F$,Ve,Ve),$e=Math.min($e,Ao),mn[ss]=Uf,Ot[ss]=new V(Yp,An),Bt[ss]=Ao,P&&(Jn[ss]=xi),E&&(bi[ss]=m.geodeticSurfaceNormal(Uf))}}let vr=re.fromPoints(mn),mc;l(x)&&(mc=In.fromRectangle(x,ge,le,m));let Ur;R&&(Ur=new Cg(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,mn,ge));let Ms=new By(ve,Ve,w),Ue=new Yc(w,Ms,$e,le,ye,!1,P,E,O,L),ot=new Float32Array(Qe*Ue.stride),Ye=0;for(let Ze=0;Ze<Qe;++Ze)Ye=Ue.encode(ot,Ye,mn[Ze],Ot[Ze],Bt[Ze],void 0,Jn[Ze],bi[Ze]);return{vertices:ot,maximumHeight:le,minimumHeight:ge,encoding:Ue,boundingSphere3D:vr,orientedBoundingBox:mc,occludeePointInScaledSpace:Ur}};var Kv=Ep;function lb(){he.throwInstantiationError()}Object.defineProperties(lb.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});lb.prototype.interpolateHeight=he.throwInstantiationError;lb.prototype.isChildAvailable=he.throwInstantiationError;lb.prototype.createMesh=he.throwInstantiationError;lb.prototype.upsample=he.throwInstantiationError;lb.prototype.wasCreatedByUpsampling=he.throwInstantiationError;lb.maximumAsynchronousTasks=5;var um=lb;function imt(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=_,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var kd=imt;function Bl(){he.throwInstantiationError()}Object.defineProperties(Bl.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var fTe=[];Bl.getRegularGridIndices=function(e,t){let n=fTe[e];l(n)||(fTe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),pTe(e,t,i,0)),i};var dTe=[];Bl.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=dTe[e];l(n)||(dTe[e]=n=[]);let i=n[t];if(!l(i)){let o=Bl.getRegularGridIndices(e,t),r=mTe(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var hTe=[];Bl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=hTe[e];l(n)||(hTe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=mTe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,_=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=ke.createTypedArray(c,u);pTe(e,t,y,0),Bl.addSkirtIndices(d,p,_,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:_,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};Bl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=DG(e,a,r,s),a+=e.length,s=DG(t,a,r,s),a+=t.length,s=DG(n,a,r,s),a+=n.length,DG(i,a,r,s)};function mTe(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 pTe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function DG(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}Bl.heightmapTerrainQuality=.25;Bl.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Bl.heightmapTerrainQuality/(t*n)};Bl.prototype.requestTileGeometry=he.throwInstantiationError;Bl.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;Bl.prototype.getTileDataAvailable=he.throwInstantiationError;Bl.prototype.loadTileDataAvailability=he.throwInstantiationError;var _s=Bl;function jg(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Fd.NONE;let t=Kv.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===Fd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(jg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var _Te="createVerticesFromHeightmap",omt=new di(_Te),rmt=new di(_Te,um.maximumAsynchronousTasks);jg.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(ae.center(f)),p=this._structure,m=_s.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?rmt:omt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Mi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let x=this;return Promise.resolve(b).then(function(T){let C;x._skirtHeight>0?C=_s.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):C=_s.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let A=T.gridWidth*T.gridHeight;return x._mesh=new kd(d,new Float32Array(T.vertices),C.indices,C.indexCountWithoutSkirts,A,T.minimumHeight,T.maximumHeight,re.clone(T.boundingSphere3D),h.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,In.clone(T.orientedBoundingBox),Yc.clone(T.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),x._buffer=void 0,x._mesh})};jg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ae.center(u)),d=this._structure,_=_s.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(_*4,1e3);let m=Kv.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Mi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=_s.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=_s.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new kd(f,m.vertices,y.indices,y.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};jg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),_=this._encoding===Fd.LERC;if(!p&&_)return;let y;if(p){let b=this._mesh.vertices,x=this._mesh.encoding;y=gTe(b,x,f,d,e,i,o,t,n)}else y=smt(this._buffer,a,c,s,u,e,i,o,t,n),y=y*d+f;return y};jg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),_=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),x=f.heightOffset,T=f.heightScale,C=f.elementsPerHeight,A=f.elementMultiplier,S=f.isBigEndian,w=Math.pow(A,C-1);for(let R=0;R<u;++R){let P=D.lerp(b.north,b.south,R/(u-1));for(let O=0;O<c;++O){let L=D.lerp(b.west,b.east,O/(c-1)),g=gTe(_,m,x,T,y,c,u,L,P);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,amt(p,C,A,w,d,S,R*c+O,g)}}return Promise.resolve(new jg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};jg.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};jg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function smt(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),d=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,_=p+1;_>=s&&(_=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let b=f-p,x=d-m;m=a-1-m,y=a-1-y;let T=RG(e,t,n,i,o,m*s+p),C=RG(e,t,n,i,o,m*s+_),A=RG(e,t,n,i,o,y*s+p),S=RG(e,t,n,i,o,y*s+_);return yTe(b,x,T,C,A,S)}function gTe(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let _=f|0,m=_+1;m>=s&&(m=s-1,_=s-2);let y=u-d,b=f-_;_=s-1-_,m=s-1-m;let x=(t.decodeHeight(e,_*r+d)-n)/i,T=(t.decodeHeight(e,_*r+p)-n)/i,C=(t.decodeHeight(e,m*r+d)-n)/i,A=(t.decodeHeight(e,m*r+p)-n)/i;return yTe(y,b,x,T,C,A)}function yTe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function RG(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 amt(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 ac=jg;function Qv(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var DC=new ae;function cmt(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}Qv.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 _=t;_<=i;++_)cmt(e,_,p,s)||s.push(new $v(r,void 0,0,_,p));r.tileXYToRectangle(t,n,e,DC);let a=DC.west,c=DC.north;r.tileXYToRectangle(i,o,e,DC);let u=DC.east,f=DC.south,d=new hmt(e,a,f,u,c);for(let p=0;p<s.length;++p){let _=s[p];B$(_.extent,d)&&mmt(this._maximumLevel,_,d)}};Qv.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Zv(i.extent,e)){t=i;break}}return l(t)?K2(void 0,t,e):-1};var lmt=[],umt=[],fmt=new ae,dmt=new ae;Qv.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=lmt;t.length=0,e.east<e.west?(t.push(ae.fromRadians(-Math.PI,e.south,e.east,e.north,fmt)),t.push(ae.fromRadians(e.west,e.south,Math.PI,e.north,dmt))):t.push(e);let n=umt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)$2(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 bTe=new fe;Qv.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,DC);return ae.center(i,bTe),this.computeMaximumLevelAtPosition(bTe)>=e};Qv.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 $v(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($v.prototype,{nw:{get:function(){return this._nw||(this._nw=new $v(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new $v(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new $v(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new $v(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function hmt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function B$(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 mmt(e,t,n){for(;t.level<e;)if(OG(t.nw.extent,n))t=t.nw;else if(OG(t.ne.extent,n))t=t.ne;else if(OG(t.sw.extent,n))t=t.sw;else if(OG(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=Uo(t.rectangles,n.level,pmt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function pmt(e,t){return e.level-t}function OG(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Zv(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function K2(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&Zv(t._nw.extent,n),s=t._ne&&Zv(t._ne.extent,n),a=t._sw&&Zv(t._sw.extent,n),c=t._se&&Zv(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,K2(t,t._nw,n))),s&&(i=Math.max(i,K2(t,t._ne,n))),a&&(i=Math.max(i,K2(t,t._sw,n))),c&&(i=Math.max(i,K2(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];Zv(a,n)&&(i=a.level)}t=t.parent}return i}function $2(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||B$(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]=_mt(e[s.level],s)}$2(e,t._nw,n),$2(e,t._ne,n),$2(e,t._sw,n),$2(e,t._se,n)}function _mt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];B$(o,t)?(o.west<t.west&&n.push(new ae(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ae(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ae(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ae(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var fm=Qv;function gmt(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 Sp=gmt;function MG(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}MG.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 MG(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}": ${Sp(i)}`),c};MG.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Lo=MG;function ub(e){if(e=e??G.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Li(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 V(-i,-i),this._rectangleNortheastInMeters=new V(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ae(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(ub.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});ub.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};ub.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};ub.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ae.southwest(e)),o=n.project(ae.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ae(i.x,i.y,o.x,o.y)};ub.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ae(a,d,c,f)};ub.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new V(o.west,o.south)),a=r.unproject(new V(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};ub.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-d.y,m=p/a|0;m>=o&&(m=o-1);let y=_/u|0;return y>=r&&(y=r-1),l(n)?(n.x=m,n.y=y,n):new V(m,y)};var gs=ub;var ymt=15;function xTe(e){this.ellipsoid=e.ellipsoid??te.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}xTe.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 bmt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new _t(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ae.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ei(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new V(r.xmin,r.ymin),s.rectangleNortheastInMeters=new V(r.xmax,r.ymax),e.tilingScheme=new gs(s)}else throw new se("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new se("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Fd.LERC:Fd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new fm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new fm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=_s.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 xmt(e,t,n){try{let i=await t.fetchJson();bmt(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 fb(e){e=e??G.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 me}Object.defineProperties(fb.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}}});fb.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new xTe(t);await xmt(o,i);let r=new fb(t);return o.build(r),r._resource=n,r};fb.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(k$(this,n+1,e*2,t*2))){let d=TTe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new ac({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):ymt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Xn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Xn.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function k$(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}fb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=k$(this,n,e,t);if(l(i))return i;TTe(this,n,e,t)};fb.prototype.loadTileDataAvailability=function(e,t,n){};function Tmt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new V(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,_=d?u.y+1:u.y;if(!f){for(let m=e.y;m<_;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new V(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new V(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function Cmt(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 V(0,0)];for(;a.length>0;){let c=a.pop(),u=Tmt(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function TTe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new tr({throttle:!1,throttleByServer:!0,type:Ts.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let _=Cmt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<_.length;++y){let b=_[y];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return k$(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var U$=fb;var CTe="https://dev.virtualearth.net/REST/v1/Locations";function z$(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ee({url:CTe,queryParameters:n}),this._credit=new _t('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(z$.prototype,{url:{get:function(){return CTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});z$.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ae.fromDegrees(a,s,u,c)}})})};var V$=z$;function H$(){}Object.defineProperties(H$.prototype,{credit:{get:function(){}}});H$.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:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var G$=H$;var Amt=new ie,ATe=new h,Jv=new h;function Emt(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 h);let u=(a-i)*o;return h.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Amt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,ATe),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector($m.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=h.subtract(u,t[r-1],ATe),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector($m.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=M.multiplyByVector(db.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(u,p.y,Jv),h.add(o,Jv,o),h.multiplyByScalar(f,p.z,Jv),h.add(o,Jv,o),h.multiplyByScalar(d,p.w,Jv),h.add(o,Jv,o)}}var Smt=new h,vmt=new h;function db(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Smt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=vmt,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=Emt(this),this._lastTimeIndex=0}Object.defineProperties(db.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}}});db.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);db.prototype.findTimeInterval=Qi.prototype.findTimeInterval;db.prototype.wrapTime=Qi.prototype.wrapTime;db.prototype.clampTime=Qi.prototype.clampTime;db.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var j$=db;var LG={};LG.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,d,p,_,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),_=(e-i)/(n-i),r.push(2),r.push(0),_!==1&&(r.push(-1),r.push(1),r.push(0),r.push(_)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(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)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(_=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(_),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(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(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};LG.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,_=1/(d*u+f*p),m=t-a,y=e-s,b=(d*y+f*m)*_,x=(-p*y+u*m)*_,T=1-b-x;return l(c)?(c.x=b,c.y=x,c.z=T,c):new h(b,x,T)};LG.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,_=f/d;if(p>=0&&p<=1&&_>=0&&_<=1)return l(c)||(c=new V),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Wg=LG;function hb(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=FG(e.westIndices,o,t),this._southIndices=FG(e.southIndices,r,t),this._eastIndices=FG(e.eastIndices,o,t),this._northIndices=FG(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(hb.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 NG=[];function FG(e,t,n){NG.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)NG[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(NG.sort(t),ke.createTypedArray(n,NG)):e}var ETe="createVerticesFromQuantizedTerrainMesh",wmt=new di(ETe),Imt=new di(ETe,um.maximumAsynchronousTasks);hb.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?Imt:wmt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(_){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=ke.createTypedArray(y,_.indices),x=new Float32Array(_.vertices),T=_.center,C=_.minimumHeight,A=_.maximumHeight,S=p._boundingSphere,w=p._orientedBoundingBox,R=h.clone(_.occludeePointInScaledSpace)??p._horizonOcclusionPoint,P=_.vertexStride,O=Yc.clone(_.encoding);return p._mesh=new kd(T,x,b,_.indexCountWithoutSkirts,m,C,A,S,R,P,w,O,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.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 Pmt=new di("upsampleQuantizedTerrainMesh",um.maximumAsynchronousTasks);hb.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=Pmt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let _=Math.min(this._westSkirtHeight,this._eastSkirtHeight);_=Math.min(_,this._southSkirtHeight),_=Math.min(_,this._northSkirtHeight);let m=c?_*.5:this._westSkirtHeight,y=u?_*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:_*.5,x=u?this._northSkirtHeight:_*.5,T=this._credits;return Promise.resolve(p).then(function(C){let A=new Uint16Array(C.vertices),S=ke.createTypedArray(A.length/3,C.indices),w;return l(C.encodedNormals)&&(w=new Uint8Array(C.encodedNormals)),new hb({quantizedVertices:A,indices:S,encodedNormals:w,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,boundingSphere:re.clone(C.boundingSphere),orientedBoundingBox:In.clone(C.orientedBoundingBox),horizonOcclusionPoint:h.clone(C.horizonOcclusionPoint),westIndices:C.westIndices,southIndices:C.southIndices,eastIndices:C.eastIndices,northIndices:C.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:b,northSkirtHeight:x,childTileMask:0,credits:T,createdByUpsampling:!0})})};var W$=32767,STe=new h;hb.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=W$;let o=D.clamp((n-e.south)/e.height,0,1);return o*=W$,l(this._mesh)?Mmt(this,i,o):Lmt(this,i,o)};function vTe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var Dmt=new V,Rmt=new V,Omt=new V;function Mmt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,Dmt),_=r.decodeTextureCoordinates(o,f,Rmt),m=r.decodeTextureCoordinates(o,d,Omt);if(vTe(t,n,p.x,p.y,_.x,_.y,m.x,m.y)){let y=Wg.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,STe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return y.x*b+y.y*x+y.z*T}}}}function Lmt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],_=i[f],m=i[d],y=o[u],b=o[f],x=o[d];if(vTe(t,n,p,y,_,b,m,x)){let T=Wg.computeBarycentricCoordinates(t,n,p,y,_,b,m,x,STe);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let C=T.x*r[u]+T.y*r[f]+T.z*r[d];return D.lerp(e._minimumHeight,e._maximumHeight,C/W$)}}}}hb.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};hb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var RC=hb;function Nmt(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 ITe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}ITe.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 PTe(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 se(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 se(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 se(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ei({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new gs({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 se(y)}if(e.levelZeroMaximumGeometricError=_s.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 se(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,_;if(l(p)&&!l(d)){_=new fm(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let b=p[y],x=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let T=0;T<b.length;++T){let C=b[T],A=x-C.endY-1,S=x-C.startY-1;e.overallAvailability[y].push([C.startX,A,C.endX,S]),_.addAvailableTileRange(y,C.startX,A,C.endX,S)}}}else l(d)&&(f=new fm(e.tilingScheme,u),_=new fm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],_.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 Nmt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:_,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(_)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await X$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Fmt(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 X$(e,n);throw new se(i)}async function Bmt(e,t,n){await PTe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new fm(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 _t(e.attribution);e.tileCredits.push(o)}return!0}async function X$(e,t){try{let n=await e.layerJsonResource.fetchJson();return Bmt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await PTe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Fmt(e,n,t)}}function dm(e){e=e??G.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 me;let t=e.credit;typeof t=="string"&&(t=new _t(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 q$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function wTe(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 kmt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new ac({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 Umt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,_=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,b=y*m,x=new DataView(t),T=new h(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let C=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let A=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=new re(new h(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0)),x.getFloat64(a+f,!0));a+=d;let w=new h(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let R=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,R*3);a+=R*_,R>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,b=y*m);let O=P.subarray(0,R),L=P.subarray(R,2*R),g=P.subarray(R*2,3*R);On.zigZagDeltaDecode(O,L,g),a%y!==0&&(a+=y-a%y);let E=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=ke.createTypedArrayFromArrayBuffer(R,t,a,E*m);a+=E*b;let I=0,N=v.length;for(let le=0;le<N;++le){let ye=v[le];v[le]=I-ye,ye===0&&++I}let F=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=ke.createTypedArrayFromArrayBuffer(R,t,a,F);a+=F*y;let k=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=ke.createTypedArrayFromArrayBuffer(R,t,a,k);a+=k*y;let B=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=ke.createTypedArrayFromArrayBuffer(R,t,a,B);a+=B*y;let W=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=ke.createTypedArrayFromArrayBuffer(R,t,a,W);a+=W*y;let Y,ee;for(;a<x.byteLength;){let le=x.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=x.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,le===q$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)Y=new Uint8Array(t,a,R*2);else if(le===q$.WATER_MASK&&e._requestWaterMask)ee=new Uint8Array(t,a,ye);else if(le===q$.METADATA&&e._requestMetadata){let xe=x.getUint32(a,!0);if(xe>0){let Te=Ho(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Te))for(let ve=0;ve<Te.length;++ve){let Ve=n+ve+1,$e=Te[ve],Ct=e._tilingScheme.getNumberOfYTilesAtLevel(Ve);for(let Jt=0;Jt<$e.length;++Jt){let Qe=$e[Jt],mn=Ct-Qe.endY-1,Bt=Ct-Qe.startY-1;e.availability.addAvailableTileRange(Ve,Qe.startX,mn,Qe.endX,Bt),r.availability.addAvailableTileRange(Ve,Qe.startX,mn,Qe.endX,Bt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),ge=In.fromRectangle(de,C,A,e._tilingScheme.ellipsoid);return new RC({center:T,minimumHeight:C,maximumHeight:A,boundingSphere:S,orientedBoundingBox:ge,horizonOcclusionPoint:w,quantizedVertices:P,encodedNormals:Y,indices:v,westIndices:U,southIndices:z,eastIndices:j,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:ee,credits:e._tileCredits})}dm.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=K$(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):DTe(this,e,t,n,r,i)};function DTe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new se("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=wTe(void 0)):u=wTe(c);let _=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(_))return _.then(function(m){return l(m)?l(e._heightmapStructure)?kmt(e,m,i,t,n):Umt(e,m,i,t,n,o):Promise.reject(new se("Mesh buffer doesn't exist."))})}Object.defineProperties(dm.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}}});dm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};dm.fromIonAssetId=async function(e,t){let n=await Hu.fromAssetId(e);return dm.fromUrl(n,t)};dm.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=new ITe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await X$(i);let o=new dm(t);return i.build(o),o};dm.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(K$(this,e,t,n,i[r],r===0).result)return;return!1};dm.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=K$(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Y$(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 K$(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=Y$(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[s],!l(d))){let p=new tr({throttle:!1,throttleByServer:!0,type:Ts.TERRAIN});d=DTe(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=Y$(o,f.x,f.y,f.level)}return{result:!1}}dm._getAvailabilityTile=Y$;var OC=dm;function qg(e){e=e??G.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 Ol(n),this._workerName="createCircleGeometry"}qg.packedLength=Ol.packedLength;qg.pack=function(e,t,n){return Ol.pack(e._ellipseGeometry,t,n)};var RTe=new Ol({center:new h,semiMajorAxis:1,semiMinorAxis:1}),cc={center:new h,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new De,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};qg.unpack=function(e,t,n){let i=Ol.unpack(e,t,RTe);return cc.center=h.clone(i._center,cc.center),cc.ellipsoid=te.clone(i._ellipsoid,cc.ellipsoid),cc.ellipsoid=te.clone(i._ellipsoid,RTe._ellipsoid),cc.height=i._height,cc.extrudedHeight=i._extrudedHeight,cc.granularity=i._granularity,cc.vertexFormat=De.clone(i._vertexFormat,cc.vertexFormat),cc.stRotation=i._stRotation,cc.shadowVolume=i._shadowVolume,l(n)?(cc.semiMajorAxis=i._semiMajorAxis,cc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ol(cc),n):(cc.radius=i._semiMajorAxis,new qg(cc))};qg.createGeometry=function(e){return Ol.createGeometry(e._ellipseGeometry)};qg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new qg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(qg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var $$=qg;function ew(e){e=e??G.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 lf(n),this._workerName="createCircleOutlineGeometry"}ew.packedLength=lf.packedLength;ew.pack=function(e,t,n){return lf.pack(e._ellipseGeometry,t,n)};var zmt=new lf({center:new h,semiMajorAxis:1,semiMinorAxis:1}),bf={center:new h,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};ew.unpack=function(e,t,n){let i=lf.unpack(e,t,zmt);return bf.center=h.clone(i._center,bf.center),bf.ellipsoid=te.clone(i._ellipsoid,bf.ellipsoid),bf.height=i._height,bf.extrudedHeight=i._extrudedHeight,bf.granularity=i._granularity,bf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(bf.semiMajorAxis=i._semiMajorAxis,bf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new lf(bf),n):(bf.radius=i._semiMajorAxis,new ew(bf))};ew.createGeometry=function(e){return lf.createGeometry(e._ellipseGeometry)};var Z$=ew;function Vmt(e){return e=e??G.EMPTY_OBJECT,OC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Z2=Vmt;function Hmt(e){return e=e??G.EMPTY_OBJECT,OC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var MC=Hmt;function tw(e){e=e??G.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ei({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=_s.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me;let n=e.credit;typeof n=="string"&&(n=new _t(n)),this._credit=n}Object.defineProperties(tw.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}}});tw.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 ac({buffer:c,width:r,height:s})})};tw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};tw.prototype.getTileDataAvailable=function(e,t,n){};tw.prototype.loadTileDataAvailability=function(e,t,n){};var Q$=tw;var Gmt=1953029805,jmt=2917034100;function J$(e,t){if(J$.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new se("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===Gmt||o===jmt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}J$.passThroughDataForTesting=!1;var Q2=J$;function OTe(e){this.proxy=e}OTe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var eZ=OTe;function MTe(e,t){return Po("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(MTe,"EMPTY_OBJECT",{get:function(){return Po("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),G.EMPTY_OBJECT}});var Oe=MTe;function hm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(hm.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}}});hm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new hm({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};hm.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};hm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)LTe(this,t)};hm.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++,LTe(this,i),t};hm.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],NTe(this,0)),this._array[e-1]=void 0,t};hm.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=tZ(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&NTe(this,n)}return this._array[e-1]=void 0,t};hm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};hm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[tZ(this,1,2)?1:2]};function BG(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function J2(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function tZ(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function LTe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=J2(e,t,i);for(o!==n&&(BG(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(J2(e,t,r)!==o)break;BG(e,t,r),t=r}}function NTe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){J2(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;J2(e,f,r)===i&&(r=f)}}if(J2(e,r,t)===i&&(BG(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);tZ(e,r,a)===i&&BG(e,r,a)}t=r}}var LC=hm;function nw(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ei({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=_s.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me}Object.defineProperties(nw.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(){}}});nw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new ac({buffer:new Uint8Array(16*16),width:16,height:16}))};nw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nw.prototype.getTileDataAvailable=function(e,t,n){};nw.prototype.loadTileDataAvailability=function(e,t,n){};var vp=nw;function wp(e){e=e??G.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 Es,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function nZ(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(wp.prototype,{projectionMatrix:{get:function(){return nZ(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return nZ(this),this._infinitePerspective}}});var Wmt=new h,qmt=new h,Ymt=new h,Xmt=new h;wp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,Wmt),d=qmt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=Ymt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let _=Xmt;h.multiplyByScalar(f,a,_),h.add(d,_,_),h.subtract(_,e,_),h.normalize(_,_),h.cross(_,n,_),h.normalize(_,_);let m=i[0];return l(m)||(m=i[0]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(f,s,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(n,_,_),h.normalize(_,_),m=i[1],l(m)||(m=i[1]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(n,r,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(f,_,_),h.normalize(_,_),m=i[2],l(m)||(m=i[2]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(n,o,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(_,f,_),h.normalize(_,_),m=i[3],l(m)||(m=i[3]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),m=i[4],l(m)||(m=i[4]=new ie),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,_),m=i[5],l(m)||(m=i[5]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,p),this._cullingVolume};wp.prototype.getPixelDimensions=function(e,t,n,i,o){nZ(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};wp.prototype.clone=function(e){return l(e)||(e=new wp),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};wp.prototype.equals=function(e){return l(e)&&e instanceof wp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};wp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof wp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var kl=wp;function Tu(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new kl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Tu.packedLength=6;Tu.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};Tu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Tu),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 mm(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(Tu.prototype,{projectionMatrix:{get:function(){return mm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return mm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return mm(this),this._fovy}},sseDenominator:{get:function(){return mm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return mm(this),this._offCenterFrustum}}});Tu.prototype.computeCullingVolume=function(e,t,n){return mm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Tu.prototype.getPixelDimensions=function(e,t,n,i,o){return mm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Tu.prototype.clone=function(e){return l(e)||(e=new Tu),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};Tu.prototype.equals=function(e){return!l(e)||!(e instanceof Tu)?!1:(mm(this),mm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Tu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Tu)?!1:(mm(this),mm(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Oi=Tu;var kG=0,Kmt=1;function NC(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??De.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Oi?(s=kG,a=Oi.packedLength):t instanceof cn&&(s=Kmt,a=cn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Pe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Pe.packedLength+De.packedLength}NC.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===kG?(Oi.pack(o,t,n),n+=Oi.packedLength):(cn.pack(o,t,n),n+=cn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Pe.pack(e._orientation,t,n),n+=Pe.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n]=e._drawNearPlane?1:0,t};var $mt=new Oi,Zmt=new cn,Qmt=new Pe,Jmt=new h,ept=new De;NC.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===kG?(o=Oi.unpack(e,t,$mt),t+=Oi.packedLength):(o=cn.unpack(e,t,Zmt),t+=cn.packedLength);let r=h.unpack(e,t,Jmt);t+=h.packedLength;let s=Pe.unpack(e,t,Qmt);t+=Pe.packedLength;let a=De.unpack(e,t,ept);t+=De.packedLength;let c=e[t]===1;if(!l(n))return new NC({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Pe.clone(s,n._orientation),n._vertexFormat=De.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function iw(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var tpt=new Z,npt=new M,iZ=new M,FTe=new h,BTe=new h,kTe=new h,ipt=new h,opt=new h,rpt=new h,mb=new Array(3),eB=new Array(4);eB[0]=new ie(-1,-1,1,1);eB[1]=new ie(1,-1,1,1);eB[2]=new ie(1,1,1,1);eB[3]=new ie(-1,1,1,1);var UTe=new Array(4);for(let e=0;e<4;++e)UTe[e]=new ie;NC._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=Z.fromQuaternion(t,tpt),u=r??FTe,f=s??BTe,d=a??kTe;u=Z.getColumn(c,0,u),f=Z.getColumn(c,1,f),d=Z.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=M.computeView(e,d,f,u,npt),_,m,y=i.projectionMatrix;if(n===kG){let b=M.multiply(y,p,iZ);m=M.inverse(b,iZ)}else _=M.inverseTransformation(p,iZ);l(m)?(mb[0]=i.near,mb[1]=i.far):(mb[0]=0,mb[1]=i.near,mb[2]=i.far);for(let b=0;b<2;++b)for(let x=0;x<4;++x){let T=ie.clone(eB[x],UTe[x]);if(l(m)){T=M.multiplyByVector(m,T,T);let C=1/T.w;h.multiplyByScalar(T,C,T),h.subtract(T,e,T),h.normalize(T,T);let A=h.dot(d,T);h.multiplyByScalar(T,mb[b]/A,T),h.add(T,e,T)}else{let C=i.offCenterFrustum;l(C)&&(i=C);let A=mb[b],S=mb[b+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(A-S)-A-S)*.5,T.w=1,M.multiplyByVector(_,T,T)}o[12*b+x*3]=T.x,o[12*b+x*3+1]=T.y,o[12*b+x*3+2]=T.z}};NC.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);NC._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new dn({position:new we({componentDatatype:K.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,_=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,y=l(s.st)?new Float32Array(2*4*a):void 0,b=FTe,x=BTe,T=kTe,C=h.negate(b,ipt),A=h.negate(x,opt),S=h.negate(T,rpt);u=0,r&&(iw(u,p,_,m,y,S,b,x),u+=3*4),iw(u,p,_,m,y,T,C,x),u+=3*4,iw(u,p,_,m,y,C,S,x),u+=3*4,iw(u,p,_,m,y,A,S,C),u+=3*4,iw(u,p,_,m,y,b,T,x),u+=3*4,iw(u,p,_,m,y,x,T,C),l(p)&&(f.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),l(_)&&(f.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),l(m)&&(f.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let _=p*6,m=p*4;d[_]=m,d[_+1]=m+1,d[_+2]=m+2,d[_+3]=m,d[_+4]=m+2,d[_+5]=m+3}return new lt({attributes:f,indices:d,primitiveType:Le.TRIANGLES,boundingSphere:re.fromVertices(c)})};var FC=NC;var oZ=0,spt=1;function tB(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Oi?(r=oZ,s=Oi.packedLength):t instanceof cn&&(r=spt,s=cn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Pe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Pe.packedLength}tB.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===oZ?(Oi.pack(o,t,n),n+=Oi.packedLength):(cn.pack(o,t,n),n+=cn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Pe.pack(e._orientation,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var apt=new Oi,cpt=new cn,lpt=new Pe,upt=new h;tB.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===oZ?(o=Oi.unpack(e,t,apt),t+=Oi.packedLength):(o=cn.unpack(e,t,cpt),t+=cn.packedLength);let r=h.unpack(e,t,upt);t+=h.packedLength;let s=Pe.unpack(e,t,lpt);t+=Pe.packedLength;let a=e[t]===1;if(!l(n))return new tB({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=h.clone(r,n._origin),n._orientation=Pe.clone(s,n._orientation),n._drawNearPlane=a,n};tB.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);FC._computeNearFarPlanes(i,o,t,n,s);let a=new dn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new lt({attributes:a,indices:d,primitiveType:Le.LINES,boundingSphere:re.fromVertices(s)})};var nB=tB;function UG(){he.throwInstantiationError()}Object.defineProperties(UG.prototype,{credit:{get:he.throwInstantiationError}});UG.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(_t.getIonCredit)};UG.prototype.geocode=he.throwInstantiationError;var ow=UG;var fpt={SEARCH:0,AUTOCOMPLETE:1},pb=Object.freeze(fpt);function zTe(){he.throwInstantiationError()}zTe.createGeometry=function(e){he.throwInstantiationError()};var rZ=zTe;function dpt(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 iB=dpt;var ypt=er(sZ(),1);function hpt(e,t){return(e&t)!==0}var Xc=hpt;var mpt=[1,2,4,8],VTe=15,ppt=16,_pt=64,gpt=128;function Ip(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}Ip.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 Ip(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Ip.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Ip.prototype.hasSubtree=function(){return Xc(this._bits,ppt)};Ip.prototype.hasImagery=function(){return Xc(this._bits,_pt)};Ip.prototype.hasTerrain=function(){return Xc(this._bits,gpt)};Ip.prototype.hasChildren=function(){return Xc(this._bits,VTe)};Ip.prototype.hasChild=function(e){return Xc(this._bits,mpt[e])};Ip.prototype.getChildBitmask=function(){return this._bits&VTe};var oB=Ip;function bpt(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 xpt=bpt(`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.\xDD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\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function xf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(xf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});xf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ee)&&(t=e.url);let n=Ee.createIfNeeded(t);n.appendForwardSlash();let i=new xf;i._resource=n;try{await Tpt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${GTe(i,"",1).url}: ${o}`;throw new se(r)}return i};xf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Xc(t,r)?Xc(e,r)&&(s|=1):(s|=2,Xc(e,r)||(s|=1)),i+=s}return i};xf.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];Xc(s,2)?Xc(s,1)||(t|=r):(n|=r,Xc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};xf.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 HTe=new di("decodeGoogleEarthEnterprisePacket");xf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=GTe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return HTe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let _=p.length;for(let m=0;m<_;++m){let y=p[m];if(u[y]!==null){let x=oB.clone(u[y]),T=y.length;if(T===d)x.setParent(f);else if(T>1){let C=r[y.substring(0,y.length-1)];x.setParent(C)}r[y]=x}else r[y]=null}})})};xf.prototype.populateSubtree=function(e,t,n,i){let o=xf.tileXYToQuadKey(e,t,n);return lZ(this,o,i)};function lZ(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 tr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),lZ(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new se(`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 tr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),lZ(e,t,s)}).finally(function(){delete a[o]})}xf.prototype.getTileInformation=function(e,t,n){let i=xf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};xf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function GTe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var aZ,cZ;function Tpt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(cZ)){let n=on("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;cZ=$b(n).then(function(){aZ=window.cesiumGoogleEarthDbRootParser(ypt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return cZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=aZ.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 HTe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=aZ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new _t(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=xpt})}var Yg=xf;function BC(e){e=e??G.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(BC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var qTe="createVerticesFromGoogleEarthEnterpriseBuffer",Cpt=new di(qTe),Apt=new di(qTe,um.maximumAsynchronousTasks),jTe=new ae,uZ=new ae;BC.prototype.createMesh=function(e){e=e??G.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,jTe),t.tileXYToRectangle(n,i,o,uZ);let u=c.cartographicToCartesian(ae.center(uZ)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let _=(a?Apt:Cpt).scheduleTask({buffer:this._buffer,nativeRectangle:jTe,rectangle:uZ,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(_))return;let m=this;return _.then(function(y){return m._mesh=new kd(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,re.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,In.clone(y.orientedBoundingBox),Yc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};BC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),o=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Ipt(this,i,o):Rpt(this,i,o,e)};var Ept=new di("upsampleQuantizedTerrainMesh",um.maximumAsynchronousTasks);BC.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=Ept.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let _=this;return p.then(function(m){let y=new Uint16Array(m.vertices),b=ke.createTypedArray(y.length/3,m.indices),x=_._skirtHeight;return new RC({quantizedVertices:y,indices:b,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:re.clone(m.boundingSphere),orientedBoundingBox:In.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:x,southSkirtHeight:x,eastSkirtHeight:x,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0,credits:_._credits})})};BC.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};BC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Spt=new V,vpt=new V,wpt=new V,YTe=new h;function Ipt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,Spt),_=r.decodeTextureCoordinates(o,f,vpt),m=r.decodeTextureCoordinates(o,d,wpt),y=Wg.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,YTe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return y.x*b+y.y*x+y.z*T}}}var Ppt=Uint16Array.BYTES_PER_ELEMENT,WTe=Uint32Array.BYTES_PER_ELEMENT,fZ=Int32Array.BYTES_PER_ELEMENT,Dpt=Float32Array.BYTES_PER_ELEMENT,dZ=Float64Array.BYTES_PER_ELEMENT;function Rpt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=WTe;u+=WTe,u+=2*dZ;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=dZ;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=dZ;let p=i.width/f/2,_=i.height/d/2,m=c.getInt32(u,!0);u+=fZ;let y=c.getInt32(u,!0)*3;u+=fZ,u+=fZ;let b=new Array(m),x=new Array(m),T=new Array(m),C;for(C=0;C<m;++C)b[C]=s+c.getUint8(u++)*p,x[C]=a+c.getUint8(u++)*_,T[C]=c.getFloat32(u,!0)*6371010,u+=Dpt;let A=new Array(y);for(C=0;C<y;++C)A[C]=c.getUint16(u,!0),u+=Ppt;for(C=0;C<y;C+=3){let S=A[C],w=A[C+1],R=A[C+2],P=b[S],O=b[w],L=b[R],g=x[S],E=x[w],v=x[R],I=Wg.computeBarycentricCoordinates(t,n,P,g,O,E,L,v,YTe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*T[S]+I.y*T[w]+I.z*T[R]}}var rw=BC;var Ud={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},zG=new $;function VG(){this._terrainCache={},this._lastTidy=$.now()}VG.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:$.now()}};VG.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};VG.prototype.tidy=function(){if($.now(zG),$.secondsDifference(zG,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];$.secondsDifference(zG,r.timestamp)>10&&delete e[o]}$.clone(zG,this._lastTidy)}};function _b(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=new Ei({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new _t(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new VG,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new me}Object.defineProperties(_b.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(){}}});_b.fromMetadata=function(e,t){if(!e.terrainPresent)throw new se(`The server ${e.url} doesn't have terrain`);let n=new _b(t);return n._metadata=e,n};var Opt=new di("decodeGoogleEarthEnterprisePacket");function XTe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Ud.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}_b.prototype.requestTileGeometry=function(e,t,n,i){let o=Yg.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new se("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Ud.UNKNOWN);let u=r.get(o);if(l(u)){let x=s.providers[a.terrainProvider];return Promise.resolve(new rw({buffer:u,childTileMask:XTe(o,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Ud.NONE)return Promise.reject(new se("Terrain tile doesn't exist"))}else return Promise.resolve(new ac({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=o,p=-1;switch(c){case Ud.SELF:p=a.terrainVersion;break;case Ud.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Ud.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new se("Terrain tile doesn't exist"));let _=this._terrainPromises,m=this._terrainRequests,y,b;if(l(_[d]))y=_[d],b=m[d];else{b=i;let x=Mpt(this,d,p,b).fetchArrayBuffer();if(!l(x))return;y=x.then(function(T){return l(T)?Opt.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(C){let A=s.getTileInformationFromQuadKey(d);A.terrainState=Ud.SELF,r.add(d,C[0]);let S=A.terrainProvider,w=C.length-1;for(let R=0;R<w;++R){let P=d+R.toString(),O=s.getTileInformationFromQuadKey(P);l(O)&&(r.add(P,C[R+1]),O.terrainState=Ud.PARENT,O.terrainProvider===0&&(O.terrainProvider=S))}}):Promise.reject(new se("Failed to load terrain."))}),_[d]=y,m[d]=b,y=y.finally(function(){delete _[d],delete m[d]})}return y.then(function(){let x=r.get(o);if(l(x)){let T=s.providers[a.terrainProvider];return new rw({buffer:x,childTileMask:XTe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new se("Failed to load terrain."))}).catch(function(x){return b.state===Xn.CANCELLED?(i.state=b.state,Promise.reject(x)):(a.terrainState=Ud.NONE,Promise.reject(x))})};_b.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};_b.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=Yg.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===Ud.NONE)return!1;if((!l(s)||s===Ud.UNKNOWN)&&(r.terrainState=Ud.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 tr({throttle:!1,throttleByServer:!0,type:Ts.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};_b.prototype.loadTileDataAvailability=function(e,t,n){};function Mpt(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 hZ=_b;var Lpt="https://maps.googleapis.com/maps/api/geocode/json",KTe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function mZ(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._resource=new Ee({url:Lpt,queryParameters:{key:t}}),this._credit=new _t(KTe,!0)}Object.defineProperties(mZ.prototype,{credit:{get:function(){return this._credit}}});mZ.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 se(`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:ae.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:KTe,collapsible:!1}}})};var pZ=mZ;var HG={};HG.defaultApiKey=void 0;HG.mapTilesApiEndpoint=new Ee({url:"https://tile.googleapis.com/v1/"});HG.getDefaultCredit=function(){return new _t('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var kC=HG;function Npt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var rB=Npt;var lCe={},Fpt=32.184,Bpt=2451545,$Te=-.0529921,ZTe=-.1059842,QTe=13.0120009,JTe=13.3407154,eCe=.9856003,tCe=26.4057084,nCe=13.064993,iCe=.3287146,oCe=1.7484877,rCe=-.1589763,sCe=.0036096,aCe=.1643573,cCe=12.9590088,_Z=new $;lCe.ComputeMoon=function(e,t){l(e)||(e=$.now()),_Z=$.addSeconds(e,Fpt,_Z);let n=$.totalDays(_Z)-Bpt,i=n/Yn.DAYS_PER_JULIAN_CENTURY,o=(125.045+$Te*n)*D.RADIANS_PER_DEGREE,r=(250.089+ZTe*n)*D.RADIANS_PER_DEGREE,s=(260.008+QTe*n)*D.RADIANS_PER_DEGREE,a=(176.625+JTe*n)*D.RADIANS_PER_DEGREE,c=(357.529+eCe*n)*D.RADIANS_PER_DEGREE,u=(311.589+tCe*n)*D.RADIANS_PER_DEGREE,f=(134.963+nCe*n)*D.RADIANS_PER_DEGREE,d=(276.617+iCe*n)*D.RADIANS_PER_DEGREE,p=(34.226+oCe*n)*D.RADIANS_PER_DEGREE,_=(15.134+rCe*n)*D.RADIANS_PER_DEGREE,m=(119.743+sCe*n)*D.RADIANS_PER_DEGREE,y=(239.961+aCe*n)*D.RADIANS_PER_DEGREE,b=(25.053+cCe*n)*D.RADIANS_PER_DEGREE,x=Math.sin(o),T=Math.sin(r),C=Math.sin(s),A=Math.sin(a),S=Math.sin(c),w=Math.sin(u),R=Math.sin(f),P=Math.sin(d),O=Math.sin(p),L=Math.sin(_),g=Math.sin(m),E=Math.sin(y),v=Math.sin(b),I=Math.cos(o),N=Math.cos(r),F=Math.cos(s),U=Math.cos(a),k=Math.cos(c),z=Math.cos(u),B=Math.cos(f),j=Math.cos(d),W=Math.cos(p),J=Math.cos(_),Y=Math.cos(m),ee=Math.cos(y),Q=Math.cos(b),de=(269.9949+.0031*i-3.8787*x-.1204*T+.07*C-.0172*A+.0072*w-.0052*L+.0043*v)*D.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*I+.0239*N-.0278*F+.0068*U-.0029*z+9e-4*B+8e-4*J-9e-4*Q)*D.RADIANS_PER_DEGREE,le=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*T-.0642*C+.0158*A+.0252*S-.0066*w-.0047*R-.0046*P+.0028*O+.0052*L+.004*g+.0019*E-.0044*v)*D.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*$Te+.1208*N*ZTe-.0642*F*QTe+.0158*U*JTe+.0252*k*eCe-.0066*z*tCe-.0047*B*nCe-.0046*j*iCe+.0028*W*oCe+.0052*J*rCe+.004*Y*sCe+.0019*ee*aCe-.0044*Q*cCe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new rB),t.rightAscension=de,t.declination=ge,t.rotation=le,t.rotationRate=ye,t};var sB=lCe;function uCe(e){(!l(e)||typeof e!="function")&&(e=sB.ComputeMoon),this._computeFunction=e}var kpt=new h,Upt=new h,zpt=new h;function Vpt(e,t,n){let i=kpt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=zpt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,Upt);return l(n)||(n=new Z),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 Hpt=new Z,Gpt=new Pe;uCe.prototype.evaluate=function(e,t){l(e)||(e=$.now());let n=this._computeFunction(e),i=Vpt(n.rightAscension,n.declination,t),o=D.zeroToTwoPi(n.rotation),r=Pe.fromAxisAngle(h.UNIT_Z,o,Gpt),s=Z.fromQuaternion(Pe.conjugate(r,r),Hpt);return Z.multiply(s,i,i)};var aB=uCe;var cB={};cB.type=void 0;cB.getRequiredDataPoints=he.throwInstantiationError;cB.interpolateOrderZero=he.throwInstantiationError;cB.interpolate=he.throwInstantiationError;var gZ=cB;var jpt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Xg=Object.freeze(jpt);function yZ(e){this._url=Ee.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(yZ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});yZ.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===pb.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=ae.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var lB=yZ;function Wpt(e){if(!Object.values(Xg).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var fCe=Object.freeze({[Xg.GOOGLE]:"google",[Xg.BING]:"bing",[Xg.DEFAULT]:void 0});function qpt(e){return fCe[e]}function Ypt(e){return Object.entries(fCe).find(t=>t[1]===e)[0]}function bZ(e){e=e??G.EMPTY_OBJECT;let t=e.geocodeProviderType??Xg.DEFAULT,n=e.accessToken??xh.defaultAccessToken,i=Ee.createIfNeeded(e.server??xh.defaultServer);i.appendForwardSlash();let o=xh.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(_t.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 lB(r),this.geocodeProviderType=t}Object.defineProperties(bZ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return Ypt(this._pelias.url.queryParameters.geocoder)},set:function(e){Wpt(e);let t={...this._pelias.url.queryParameters,geocoder:qpt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});bZ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var UC=bZ;var Rs={};Rs.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Rs.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Rs.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Rs.defaultAccessToken=void 0;Rs.defaultShareKey=void 0;Rs._getAuthorizationHeader=function(){return l(Rs.defaultShareKey)?`Basic ${Rs.defaultShareKey}`:`Bearer ${Rs.defaultAccessToken}`};Rs.apiEndpoint=new Ee({url:"https://api.bentley.com"});Rs.getExports=async function(e){let t=new Ee({url:`${Rs.apiEndpoint}mesh-export`,headers:{Authorization:Rs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Rs.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new se("Not allowed, forbidden");if(n.statusCode===422)throw new se(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${n.statusCode}`)}};Rs.getRealityDataMetadata=async function(e,t){let n=new Ee({url:`${Rs.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Rs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new se("Not allowed, forbidden");if(i.statusCode===404)throw new se(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new se(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${i.statusCode}`)}};Rs.getRealityDataURL=async function(e,t,n){let i=new Ee({url:`${Rs.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Rs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new se("Not allowed, forbidden");if(o.statusCode===404)throw new se(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new se(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${o.statusCode}`)}};var js=Rs;var Xpt={SHIFT:0,CTRL:1,ALT:2},pa=Object.freeze(Xpt);var gb={state:!0,maxSize:z9()};gb.GetIndexedDBMaxSize=()=>z9();gb.SetIndexedDBMaxSize=e=>{let t;typeof e!="number"||isNaN(e)||e<1?t=1:t=e,Wne(t)};gb.GetManageIndexexDBState=()=>gb.state;gb.SetManageIndexexDBState=e=>{typeof e=="boolean"?gb.state=e:console.error("\u53C2\u6570\u5FC5\u987B\u4E3Aboolean")};gb.GetIndexedDBCurrentSize=()=>qne();var xZ=gb;function GG(){he.throwInstantiationError()}Object.defineProperties(GG.prototype,{ellipsoid:{get:he.throwInstantiationError}});GG.prototype.project=he.throwInstantiationError;GG.prototype.unproject=he.throwInstantiationError;var TZ=GG;var CZ=[],AZ=[];function Kpt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=CZ,u=AZ,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let _=c[f],m=u[d];f<s&&(d>=a||t(_,m,n)<=0)?(e[p]=_,++f):d<a&&(e[p]=m,++d)}}function EZ(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);EZ(e,t,n,i,r),EZ(e,t,n,r+1,o),Kpt(e,t,n,i,r,o)}function $pt(e,t,n){let i=e.length,o=Math.ceil(i*.5);CZ.length=o,AZ.length=o,EZ(e,t,n,0,i-1),CZ.length=0,AZ.length=0}var Kg=$pt;function sw(e){e=e??G.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(sw.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});sw.prototype.findTimeInterval=Qi.prototype.findTimeInterval;sw.prototype.wrapTime=Qi.prototype.wrapTime;sw.prototype.clampTime=Qi.prototype.clampTime;sw.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 uB=sw;var Zpt={NONE:-1,PARTIAL:0,FULL:1},Er=Object.freeze(Zpt);function Kc(e,t){this._occluderPosition=h.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 jG=new h;Object.defineProperties(Kc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,jG),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,jG);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,jG),jG)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Kc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Kc(e,t)};var hCe=new h;Kc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,hCe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var Qpt=new h;Kc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,Qpt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,hCe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.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 Jpt=new h;Kc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Er.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Jpt),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?Er.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Er.FULL:Er.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Er.PARTIAL:Er.FULL))}}return Er.NONE};var WG=new h;Kc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,WG),WG),c=-h.dot(a,o),u=Kc._anyRotationVector(o,a,c),f=Kc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let _=1;_<s;++_){if(d=Kc._horizonToPlaneNormalDotProduct(e,a,c,u,n[_]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return h.add(o,h.multiplyByScalar(a,p,WG),WG)};var e_t=[];Kc.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ae.subsample(e,t,0,e_t),i=re.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Kc.computeOccludeePoint(new re(o,t.minimumRadius),i.center,n)};var t_t=new h;Kc._anyRotationVector=function(e,t,n){let i=h.abs(t,t_t),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var n_t=new h;Kc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,n_t);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>D.EPSILON13)return h.normalize(s,new h)}return o};var SZ=new h,i_t=new h,qG=new h,dCe=new h;Kc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,SZ),s=h.clone(e.center,i_t),a=e.radius,c=h.subtract(s,r,qG),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),b=p*m*p;c=h.normalize(c,c);let x=h.add(r,h.multiplyByScalar(c,b,dCe),dCe),T=Math.sqrt(d-b*b),C=this._rotationVector(s,t,n,r,i),A=h.fromElements(C.x*C.x*c.x+(C.x*C.y-C.z)*c.y+(C.x*C.z+C.y)*c.z,(C.x*C.y+C.z)*c.x+C.y*C.y*c.y+(C.y*C.z-C.x)*c.z,(C.x*C.z-C.y)*c.x+(C.y*C.z+C.x)*c.y+C.z*C.z*c.z,SZ);A=h.normalize(A,A);let S=h.multiplyByScalar(A,T,SZ);C=h.normalize(h.subtract(h.add(x,S,qG),s,qG),qG);let w=h.dot(t,C);C=h.normalize(h.subtract(h.subtract(x,S,C),s,C),C);let R=h.dot(t,C);return w<R?w:R};var fB=Kc;function vZ(e,t,n){e=Ee.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new _t('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(vZ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});vZ.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:ct(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ae.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var wZ=vZ;var o_t={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},IZ=o_t;var r_t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},PZ=r_t;var s_t=new h;function a_t(e,t,n,i){let o=rx(e,t,n,i,s_t);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var DZ=a_t;function mCe(){he.throwInstantiationError()}mCe.prototype.getURL=he.throwInstantiationError;var RZ=mCe;async function c_t(e,t,n,i){return l(i)||(i=!1),f_t(e,t,n,i)}function l_t(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(_Ce(i)):r=o.then(_Ce(i)).catch(d_t(i)),e.shift(),t.push(r),!0}function u_t(e){return new Promise(function(t){setTimeout(t,e)})}function OZ(e,t,n){return e.length?l_t(e,t,n)?OZ(e,t,n):u_t(100).then(()=>OZ(e,t,n)):Promise.resolve()}function f_t(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[r])}let c=[];return OZ(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function pCe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function _Ce(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(!pCe(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];pCe(s,i,n)}}):Promise.resolve()}}function d_t(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var dB=c_t;var MZ=new V;async function gCe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,MZ);let p=e.loadTileDataAvailability(MZ.x,MZ.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return dB(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await gCe(e,a,n),t}var zC=gCe;var h_t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(h_t);function yb(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function UZ(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function VC(e){if(e.shiftKey)return pa.SHIFT;if(e.ctrlKey)return pa.CTRL;if(e.altKey)return pa.ALT}var Ws={LEFT:0,MIDDLE:1,RIGHT:2};function Tf(e,t,n,i){function o(r){i(e,r)}Nt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function m_t(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Nt.supportsPointerEvents()?(Tf(e,"pointerdown",t,x_t),Tf(e,"pointerup",t,wCe),Tf(e,"pointermove",t,T_t),Tf(e,"pointercancel",t,wCe)):(Tf(e,"mousedown",t,ICe),Tf(e,"mouseup",n,PCe),Tf(e,"mousemove",n,DCe),Tf(e,"touchstart",t,y_t),Tf(e,"touchend",n,CCe),Tf(e,"touchmove",n,b_t),Tf(e,"touchcancel",n,CCe)),Tf(e,"dblclick",t,__t);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Tf(e,i,t,g_t)}function p_t(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var yCe={position:new V};function zZ(e){e._lastSeenTouchEvent=Si()}function VZ(e){return Si()-e._lastSeenTouchEvent>pm.mouseEmulationIgnoreMilliseconds}function kZ(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function ICe(e,t){if(!VZ(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Ws.LEFT)i=Cn.LEFT_DOWN;else if(n===Ws.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===Ws.RIGHT)i=Cn.RIGHT_DOWN;else return;let o=yb(e,t,e._primaryPosition);V.clone(o,e._primaryStartPosition),V.clone(o,e._primaryPreviousPosition);let r=VC(t),s=e.getInputAction(i,r);l(s)&&(V.clone(o,yCe.position),s(yCe),t.preventDefault())}var bCe={position:new V},xCe={position:new V};function LZ(e,t,n,i){let o=VC(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=yb(e,i,e._primaryPosition);if(l(r)&&(V.clone(a,bCe.position),r(bCe)),l(s)){let c=e._primaryStartPosition;kZ(c,a,e._clickPixelTolerance)&&(V.clone(a,xCe.position),s(xCe))}}}function PCe(e,t){if(!VZ(e))return;let n=t.button;n!==Ws.LEFT&&n!==Ws.MIDDLE&&n!==Ws.RIGHT||(e._buttonDown[Ws.LEFT]&&(LZ(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[Ws.LEFT]=!1),e._buttonDown[Ws.MIDDLE]&&(LZ(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[Ws.MIDDLE]=!1),e._buttonDown[Ws.RIGHT]&&(LZ(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[Ws.RIGHT]=!1))}var NZ={startPosition:new V,endPosition:new V};function DCe(e,t){if(!VZ(e))return;let n=VC(t),i=yb(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Cn.MOUSE_MOVE,n);l(r)&&(V.clone(o,NZ.startPosition),V.clone(i,NZ.endPosition),r(NZ)),V.clone(i,o),(e._buttonDown[Ws.LEFT]||e._buttonDown[Ws.MIDDLE]||e._buttonDown[Ws.RIGHT])&&t.preventDefault()}var TCe={position:new V};function __t(e,t){let n=t.button,i;if(n===Ws.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let o=VC(t),r=e.getInputAction(i,o);l(r)&&(yb(e,t,TCe.position),r(TCe))}function g_t(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=VC(t),o=e.getInputAction(Cn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function y_t(e,t){zZ(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,yb(e,r,new V));YG(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,V.clone(a.get(s)))}function CCe(e,t){zZ(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);YG(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var ACe={position:new V},FZ={position1:new V,position2:new V},ECe={position:new V},SCe={position:new V},vCe={position:new V};function YG(e,t){let n=VC(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Ws.LEFT]){if(e._buttonDown[Ws.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Cn.LEFT_UP,n),l(r)&&(V.clone(e._primaryPosition,ECe.position),r(ECe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];kZ(c,u,e._clickPixelTolerance)&&(V.clone(e._primaryPosition,SCe.position),s(SCe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Cn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];V.clone(c,e._primaryPosition),V.clone(c,e._primaryStartPosition),V.clone(c,e._primaryPreviousPosition),e._buttonDown[Ws.LEFT]=!0,r=e.getInputAction(Cn.LEFT_DOWN,n),l(r)&&(V.clone(c,ACe.position),r(ACe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];kZ(u,f,e._holdPixelTolerance)&&(V.clone(e._primaryPosition,vCe.position),s(vCe))}},pm.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Cn.PINCH_START,n),l(r)&&(V.clone(i.values[0],FZ.position1),V.clone(i.values[1],FZ.position2),r(FZ),t.preventDefault()))}function b_t(e,t){zZ(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&yb(e,r,u)}RCe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,V.clone(a.get(s),c.get(s))}var BZ={startPosition:new V,endPosition:new V},hB={distance:{startPosition:new V,endPosition:new V},angleAndHeight:{startPosition:new V,endPosition:new V}};function RCe(e,t){let n=VC(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Ws.LEFT]){let a=i.values[0];V.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),l(s)&&(V.clone(c,BZ.startPosition),V.clone(a,BZ.endPosition),s(BZ)),V.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-a.x,p=c.y-a.y,_=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,b=Math.sqrt(m*m+y*y)*.25,x=(c.y+a.y)*.125,T=(f.y+u.y)*.125,C=Math.atan2(p,d),A=Math.atan2(y,m);V.fromElements(0,b,hB.distance.startPosition),V.fromElements(0,_,hB.distance.endPosition),V.fromElements(A,T,hB.angleAndHeight.startPosition),V.fromElements(C,x,hB.angleAndHeight.endPosition),s(hB)}}function x_t(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,yb(e,t,new V)),YG(e,t),e._previousPositions.set(i,V.clone(n.get(i)))}else ICe(e,t)}function wCe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),YG(e,t),e._previousPositions.remove(i)}else PCe(e,t)}function T_t(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;yb(e,t,o),RCe(e,t);let r=e._previousPositions;V.clone(n.get(i),r.get(i))}else DCe(e,t)}function pm(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-pm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new V,this._primaryPosition=new V,this._primaryPreviousPosition=new V,this._positions=new wt,this._previousPositions=new wt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,m_t(this)}pm.prototype.setInputAction=function(e,t,n){let i=UZ(t,n);this._inputEvents[i]=e};pm.prototype.getInputAction=function(e,t){let n=UZ(e,t);return this._inputEvents[n]};pm.prototype.removeInputAction=function(e,t){let n=UZ(e,t);delete this._inputEvents[n]};pm.prototype.isDestroyed=function(){return!1};pm.prototype.destroy=function(){return p_t(this),ce(this)};pm.mouseEmulationIgnoreMilliseconds=800;pm.touchHoldDelayMilliseconds=1500;var Cf=pm;function C_t(e,t,n,i,o,r,s){let a=Fi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,_=i.red,m=i.green,y=i.blue,b=i.alpha;if(H.equals(n,i)){for(c=0;c<a;c++)r[s++]=H.floatToByte(u),r[s++]=H.floatToByte(f),r[s++]=H.floatToByte(d),r[s++]=H.floatToByte(p);return s}let x=(_-u)/a,T=(m-f)/a,C=(y-d)/a,A=(b-p)/a,S=s;for(c=0;c<a;c++)r[S++]=H.floatToByte(u+c*x),r[S++]=H.floatToByte(f+c*T),r[S++]=H.floatToByte(d+c*C),r[S++]=H.floatToByte(p+c*A);return S}function mB(e){e=e??G.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??tn.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*H.packedLength:1,this.packedLength=o+te.packedLength+3}mB.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+=h.packedLength)h.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+=H.packedLength)H.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};mB.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new mB({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var XG=new Array(2),KG=new Array(2),A_t={positions:XG,height:KG,ellipsoid:void 0,minDistance:void 0,granularity:void 0};mB.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=D.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,_,m,y=0;if(o===tn.GEODESIC||o===tn.RHUMB){let A,S,w;o===tn.GEODESIC?(A=D.chordLength(r,s.maximumRadius),S=Fi.numberOfPoints,w=Fi.generateArc):(A=r,S=Fi.numberOfPointsRhumbLine,w=Fi.generateRhumbArc);let R=Fi.extractHeights(t,s),P=A_t;if(o===tn.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=S(t[u],t[u+1],A)+1;d=new Float64Array(O*3),_=new Uint8Array(O*4),P.positions=XG,P.height=KG;let L=0;for(u=0;u<f-1;++u){XG[0]=t[u],XG[1]=t[u+1],KG[0]=R[u],KG[1]=R[u+1];let g=w(P);if(l(n)){let E=g.length/3;m=n[u];for(let v=0;v<E;++v)_[L++]=H.floatToByte(m.red),_[L++]=H.floatToByte(m.green),_[L++]=H.floatToByte(m.blue),_[L++]=H.floatToByte(m.alpha)}d.set(g,y),y+=g.length}}else if(P.positions=t,P.height=R,d=new Float64Array(w(P)),l(n)){for(_=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],E=n[u],v=n[u+1];y=C_t(L,g,E,v,a,_,y)}let O=n[f-1];_[y++]=H.floatToByte(O.red),_[y++]=H.floatToByte(O.green),_[y++]=H.floatToByte(O.blue),_[y++]=H.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),_=l(n)?new Uint8Array(p*4):void 0;let A=0,S=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(h.pack(w,d,A),A+=3,m=n[u-1],_[S++]=H.floatToByte(m.red),_[S++]=H.floatToByte(m.green),_[S++]=H.floatToByte(m.blue),_[S++]=H.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(w,d,A),A+=3,l(n)&&(m=n[u],_[S++]=H.floatToByte(m.red),_[S++]=H.floatToByte(m.green),_[S++]=H.floatToByte(m.blue),_[S++]=H.floatToByte(m.alpha))}}let b=new dn;b.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:_,normalize:!0})),p=d.length/3;let x=(p-1)*2,T=ke.createTypedArray(p,x),C=0;for(u=0;u<p-1;++u)T[C++]=u,T[C++]=u+1;return new lt({attributes:b,indices:T,primitiveType:Le.LINES,boundingSphere:re.fromPoints(t)})};var HZ=mB;function aw(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new da(i),this._workerName="createSphereGeometry"}aw.packedLength=da.packedLength;aw.pack=function(e,t,n){return da.pack(e._ellipsoidGeometry,t,n)};var E_t=new da,bb={radius:void 0,radii:new h,vertexFormat:new De,stackPartitions:void 0,slicePartitions:void 0};aw.unpack=function(e,t,n){let i=da.unpack(e,t,E_t);return bb.vertexFormat=De.clone(i._vertexFormat,bb.vertexFormat),bb.stackPartitions=i._stackPartitions,bb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,bb.radii),n._ellipsoidGeometry=new da(bb),n):(bb.radius=i._radii.x,new aw(bb))};aw.createGeometry=function(e){return da.createGeometry(e._ellipsoidGeometry)};var GZ=aw;function S_t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var HC=S_t;var v_t={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=v_t;function xb(e){}Object.defineProperties(xb.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});xb.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;xb.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;xb.prototype.rectangleToNativeRectangle=he.throwInstantiationError;xb.prototype.tileXYToNativeRectangle=he.throwInstantiationError;xb.prototype.tileXYToRectangle=he.throwInstantiationError;xb.prototype.positionToTileXY=he.throwInstantiationError;var jZ=xb;function GC(e){e=e??G.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??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(GC.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(GC.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=w_t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});GC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ce(this)};GC.prototype.isDestroyed=function(){return!1};GC.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};GC.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??Ge.MINIMUM_VALUE,s=$.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function w_t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var WZ=GC;function I_t(e,t){this.rectangle=e,this.maxLevel=t}function OCe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}OCe.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 P_t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ei({ellipsoid:e.ellipsoid});else throw new se(`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=_s.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new I_t(new ae(a,c,u,f),d))}}function D_t(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 se(i)}async function R_t(e,t,n){try{let i=await t.fetchXML();P_t(e,i)}catch(i){D_t(t,i,n)}}function Tb(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new me,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 _t(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Tb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Tb.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=new OCe(t),i=Ee.createIfNeeded(e);await R_t(n,i);let o=new Tb(t);return n.build(o),o._resource=i,o};Tb.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 ac({buffer:nh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:O_t(a,e,t,n),structure:a._terrainDataStructure})})};Tb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var MCe=new ae;function O_t(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ae.intersection(f,s,MCe);l(d)&&($G(o,f,t*2,n*2,i+1)&&(a|=4),$G(o,f,t*2+1,n*2,i+1)&&(a|=8),$G(o,f,t*2,n*2+1,i+1)&&(a|=1),$G(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function $G(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ae.intersection(r,t,MCe))}Tb.prototype.getTileDataAvailable=function(e,t,n){};Tb.prototype.loadTileDataAvailability=function(e,t,n){};var qZ=Tb;var M_t={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},YZ=Object.freeze(M_t);function L_t(e){switch(e){case q.FLOAT:return"float";case q.FLOAT_VEC2:return"vec2";case q.FLOAT_VEC3:return"vec3";case q.FLOAT_VEC4:return"vec4";case q.FLOAT_MAT2:return"mat2";case q.FLOAT_MAT3:return"mat3";case q.FLOAT_MAT4:return"mat4";case q.SAMPLER_2D:return"sampler2D";case q.BOOL:return"bool"}}var $g=L_t;function N_t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var pB=N_t;async function XZ(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[ae.center(e),ae.southeast(e),ae.southwest(e),ae.northeast(e),ae.northwest(e)],u=await XZ._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(_,m){return l(m.height)?(f=!0,Math.max(m.height,_)):_},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}XZ._sampleTerrainMostDetailed=zC;var jC=XZ;var _B=`uniform vec4 u_initialColor; - -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; - -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif - -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif - -#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif - -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif - -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif - -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif - -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif - -#ifdef ENABLE_CLIPPING_POLYGONS -uniform highp sampler2D u_clippingDistance; -in vec2 v_clippingPosition; -flat in int v_regionIndex; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif - -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; // 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 - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); -} -#endif - -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ - return - v_textureCoordinates.x > u_translucencyRectangle.x && - v_textureCoordinates.x < u_translucencyRectangle.z && - v_textureCoordinates.y > u_translucencyRectangle.y && - v_textureCoordinates.y < u_translucencyRectangle.w; -} -#endif - -vec4 sampleAndBlend( - vec4 previousColor, - sampler2D textureToSample, - vec2 tileTextureCoordinates, - vec4 textureCoordinateRectangle, - vec4 textureCoordinateTranslationAndScale, - float textureAlpha, - float textureNightAlpha, - float textureDayAlpha, - float textureBrightness, - float textureContrast, - float textureHue, - float textureSaturation, - float textureOneOverGamma, - float split, - vec4 colorToAlpha, - float nightBlend) -{ - // This crazy step stuff sets the alpha to 0.0 if this following condition is true: - // tileTextureCoordinates.s < textureCoordinateRectangle.s || - // tileTextureCoordinates.s > textureCoordinateRectangle.p || - // tileTextureCoordinates.t < textureCoordinateRectangle.t || - // tileTextureCoordinates.t > textureCoordinateRectangle.q - // In other words, the alpha is zero if the fragment is outside the rectangle - // covered by this texture. Would an actual 'if' yield better performance? - vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - - alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif - - vec2 translation = textureCoordinateTranslationAndScale.xy; - vec2 scale = textureCoordinateTranslationAndScale.zw; - vec2 textureCoordinates = tileTextureCoordinates * scale + translation; - vec4 value = texture(textureToSample, textureCoordinates); - vec3 color = value.rgb; - float alpha = value.a; - -#ifdef APPLY_COLOR_TO_ALPHA - vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); - colorDiff.r = czm_maximumComponent(colorDiff); - alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif - -#if !defined(APPLY_GAMMA) - vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); - color = tempColor.rgb; - alpha = tempColor.a; -#else - color = pow(color, vec3(textureOneOverGamma)); -#endif - -#ifdef APPLY_SPLIT - float splitPosition = czm_splitPosition; - // Split to the left - if (split < 0.0 && gl_FragCoord.x > splitPosition) { - alpha = 0.0; - } - // Split to the right - else if (split > 0.0 && gl_FragCoord.x < splitPosition) { - alpha = 0.0; - } -#endif - -#ifdef APPLY_BRIGHTNESS - color = mix(vec3(0.0), color, textureBrightness); -#endif - -#ifdef APPLY_CONTRAST - color = mix(vec3(0.5), color, textureContrast); -#endif - -#ifdef APPLY_HUE - color = czm_hue(color, textureHue); -#endif - -#ifdef APPLY_SATURATION - color = czm_saturation(color, textureSaturation); -#endif - - float sourceAlpha = alpha * textureAlpha; - float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); - outAlpha += sign(outAlpha) - 1.0; - - vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; - - // When rendering imagery for a tile in multiple passes, - // some GPU/WebGL implementation combinations will not blend fragments in - // additional passes correctly if their computation includes an unmasked - // divide-by-zero operation, - // even if it's not in the output or if the output has alpha zero. - // - // For example, without sanitization for outAlpha, - // this renders without artifacts: - // if (outAlpha == 0.0) { outColor = vec3(0.0); } - // - // but using czm_branchFreeTernary will cause portions of the tile that are - // alpha-zero in the additional pass to render as black instead of blending - // with the previous pass: - // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); - // - // So instead, sanitize against divide-by-zero, - // store this state on the sign of outAlpha, and correct on return. - - return vec4(outColor, max(outAlpha, 0.0)); -} - -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); - -const float fExposure = 2.0; - -vec3 computeEllipsoidPosition() -{ - float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); - vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); - xy *= czm_viewport.zw * mpp * 0.5; - - vec3 direction; - if (czm_orthographicIn3D == 1.0) - { - direction = vec3(0.0, 0.0, -1.0); - } - else - { - direction = normalize(vec3(xy, -czm_currentFrustum.x)); - } - - czm_ray ray = czm_ray(vec3(0.0), direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - - vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); - return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; -} - -void main() -{ -#ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) - { - discard; - } -#endif - -#ifdef ENABLE_CLIPPING_PLANES - float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif - -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) - vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates - vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates -#endif - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); -#else - float nightBlend = 0.0; -#endif - - // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 - // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the - // fragments on the edges of tiles even though the vertex shader is outputting - // coordinates strictly in the 0-1 range. - vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); - -#ifdef SHOW_TILE_BOUNDARIES - if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || - v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) - { - color = vec4(1.0, 0.0, 0.0, 1.0); - } -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) - float cameraDist; - if (czm_sceneMode == czm_sceneMode2D) - { - cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; - } - else if (czm_sceneMode == czm_sceneModeColumbusView) - { - cameraDist = -czm_view[3].z; - } - else - { - cameraDist = length(czm_view[3]); - } - float fadeOutDist = u_lightingFadeDistance.x; - float fadeInDist = u_lightingFadeDistance.y; - if (czm_sceneMode != czm_sceneMode3D) { - vec3 radii = czm_ellipsoidRadii; - float maxRadii = max(radii.x, max(radii.y, radii.z)); - fadeOutDist -= maxRadii; - fadeInDist -= maxRadii; - } - float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else - float fade = 0.0; -#endif - -#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) - vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; - vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; - vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; - waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; - - float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; - - #ifdef SHOW_REFLECTIVE_OCEAN - if (mask > 0.0) - { - mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); - - vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); - vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); - - vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); - - color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); - } - #endif -#endif - -#ifdef APPLY_MATERIAL - czm_materialInput materialInput; - materialInput.st = v_textureCoordinates.st; - materialInput.normalEC = normalize(v_normalEC); - materialInput.positionToEyeEC = -v_positionEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); - materialInput.slope = v_slope; - materialInput.height = v_height; - materialInput.aspect = v_aspect; - #ifdef HAS_WATER_MASK - materialInput.waterMask = mask; - #endif - - czm_material material = czm_getMaterial(materialInput); - vec4 materialColor = vec4(material.diffuse, material.alpha); - color = alphaBlend(materialColor, color); -#endif - -#ifdef ENABLE_VERTEX_LIGHTING - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); - diffuseIntensity = mix(1.0, diffuseIntensity, fade); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else - vec4 finalColor = color; -#endif - -#ifdef ENABLE_CLIPPING_PLANES - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; - - if (clipDistance < clippingPlanesEdgeWidth) - { - finalColor = clippingPlanesEdgeColor; - } -#endif - -#ifdef ENABLE_CLIPPING_POLYGONS - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -#endif - -#ifdef HIGHLIGHT_FILL_TILE - finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); -#endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) - if (!czm_backFacing()) - { - bool dynamicLighting = false; - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. - // Otherwise, the scattering is computed in the vertex shader. - #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE - positionWC = computeEllipsoidPosition(); - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - computeAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - #else - positionWC = v_positionMC; - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - #endif - - #ifdef COLOR_CORRECT - const bool ignoreBlackPixels = true; - rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); - mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); - #endif - - vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - // Fog is applied to tiles selected for fog, close to the Earth. - #ifdef FOG - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is lighting, apply that to the fog. - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); - fogColor *= darken; - #endif - - #ifndef HDR - fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a); - - #else - // Apply ground atmosphere. This happens when the camera is far away from the earth. - - // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. - // This value is larger near the "circumference", as it is further away from the camera. We use it to - // brighten up that area of the ground atmosphere. - const float transmittanceModifier = 0.5; - float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); - - vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float fadeInDist = u_nightFadeDistance.x; - float fadeOutDist = u_nightFadeDistance.y; - - float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); - float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); - vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); - - finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); - #endif - - #ifndef HDR - finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); - #else - finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); - #endif - - finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); - #endif - } -#endif - -#ifdef UNDERGROUND_COLOR - if (czm_backFacing()) - { - float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); - float distance = max(v_distance - distanceFromEllipsoid, 0.0); - float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); - vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); - finalColor = alphaBlend(undergroundColor, finalColor); - } -#endif - -#ifdef TRANSLUCENT - if (inTranslucencyRectangle()) - { - vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; - finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); - } -#endif - - out_FragColor = finalColor; -} - - -#ifdef SHOW_REFLECTIVE_OCEAN - -float waveFade(float edge0, float edge1, float x) -{ - float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return pow(1.0 - y, 5.0); -} - -float linearFade(float edge0, float edge1, float x) -{ - return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} - -// Based on water rendering by Jonas Wagner: -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -// low altitude wave settings -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; - -// high altitude wave settings -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; - -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ - vec3 positionToEyeEC = -positionEyeCoordinates; - float positionToEyeECLength = length(positionToEyeEC); - - // The double normalize below works around a bug in Firefox on Android devices. - vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); - - // Fade out the waves as the camera moves far from the surface. - float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); - -#ifdef SHOW_OCEAN_WAVES - // high altitude waves - float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; - vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); - vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); - - // low altitude waves - time = czm_frameNumber * oceanAnimationSpeedLowAltitude; - noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); - vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); - - // blend the 2 wave layers based on distance to surface - float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); - float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); - vec3 normalTangentSpace = - (highAltitudeFade * normalTangentSpaceHighAltitude) + - (lowAltitudeFade * normalTangentSpaceLowAltitude); - normalTangentSpace = normalize(normalTangentSpace); - - // fade out the normal perturbation as we move farther from the water surface - normalTangentSpace.xy *= waveIntensity; - normalTangentSpace = normalize(normalTangentSpace); -#else - vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif - - vec3 normalEC = enuToEye * normalTangentSpace; - - const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); - - // Use diffuse light to highlight the waves - float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; - vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); - -#ifdef SHOW_OCEAN_WAVES - // Where diffuse light is low or non-existent, use wave highlights based solely on - // the wave bumpiness and no particular light direction. - float tsPerturbationRatio = normalTangentSpace.z; - vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else - vec3 nonDiffuseHighlight = vec3(0.0); -#endif - - // Add specular highlights in 3D, and in all modes when zoomed in. - float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); - float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); - float specular = specularIntensity * surfaceReflectance; - -#ifdef HDR - specular *= 1.4; - - float e = 0.2; - float d = 3.3; - float c = 1.7; - - vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); -#else - vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; -#endif - - return vec4(color, imageryColor.a); -} - -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var gB=`#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 - -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 - - 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 cw=`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 F_t=new V;function B_t(e,t){let n=e.unionClippingRegions,i=e.length,o=Ss.useFloatTexture(t),r=Ss.getTextureResolution(e,t,F_t),s=r.x,a=r.y,c=o?z_t(s,a):V_t(s,a);return c+=` -`,c+=n?k_t(i):U_t(i),c}function k_t(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 U_t(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 z_t(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 V_t(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 Zg=B_t;function H_t(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 KZ(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function G_t(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 ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function j_t(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 W_t(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 q_t(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}KZ.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.hasWaterMask,_=e.showReflectiveOcean,m=e.showOceanWaves,y=e.enableLighting,b=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,T=e.showGroundAtmosphere,C=e.perFragmentGroundAtmosphere,A=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,R=e.enableClippingPlanes,P=e.clippingPlanes,O=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,E=e.hasImageryLayerCutout,v=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,F=e.hasGeodeticSurfaceNormals,U=e.hasExaggeration,k=e.showUndergroundColor,z=e.translucent,B=0,j="",J=n.renderedMesh.encoding;J.quantization===ma.BITS12&&(B=1,j="QUANTIZATION_BITS12");let ee=0,Q="";g&&(ee=1,Q="TILE_LIMIT_RECTANGLE");let de=0,ge="";E&&(de=1,ge="APPLY_IMAGERY_CUTOUT");let le=t.mode,ye=le|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|_<<9|m<<10|y<<11|b<<12|x<<13|T<<14|C<<15|A<<16|S<<17|w<<18|B<<19|d<<20|R<<21|O<<22|ee<<23|de<<24|v<<25|I<<26|N<<27|F<<28|U<<29|k<<30|z<<31|f<<32,xe=0;l(P)&&P.length>0&&(xe=R?P.clippingPlanesState:0);let Ie=0;l(L)&&L.length>0&&(Ie=O?L.clippingPolygonsState:0);let Te=n.surfaceShader;if(l(Te)&&Te.numberOfDayTextures===i&&Te.flags===ye&&Te.material===this.material&&Te.clippingShaderState===xe&&Te.clippingPolygonShaderState===Ie)return Te.shaderProgram;let ve=this._shadersByTexturesFlags[i];if(l(ve)||(ve=this._shadersByTexturesFlags[i]=[]),Te=ve[ye],!l(Te)||Te.material!==this.material||Te.clippingShaderState!==xe||Te.clippingPolygonShaderState!==Ie){let Ve=this.baseVertexShaderSource.clone(),$e=this.baseFragmentShaderSource.clone();xe!==0&&$e.sources.unshift(Zg(P,t.context)),Ie!==0&&($e.sources.unshift(j_t(t.context)),Ve.sources.unshift(W_t(t.context))),Ve.defines.push(j),$e.defines.push(`TEXTURE_UNITS ${i}`,Q,ge),o&&$e.defines.push("APPLY_BRIGHTNESS"),r&&$e.defines.push("APPLY_CONTRAST"),s&&$e.defines.push("APPLY_HUE"),a&&$e.defines.push("APPLY_SATURATION"),c&&$e.defines.push("APPLY_GAMMA"),u&&$e.defines.push("APPLY_ALPHA"),f&&$e.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&$e.defines.push("HAS_WATER_MASK"),_&&($e.defines.push("SHOW_REFLECTIVE_OCEAN"),Ve.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&$e.defines.push("SHOW_OCEAN_WAVES"),N&&$e.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(Ve.defines.push("UNDERGROUND_COLOR"),$e.defines.push("UNDERGROUND_COLOR")),z&&(Ve.defines.push("TRANSLUCENT"),$e.defines.push("TRANSLUCENT")),y&&(A?(Ve.defines.push("ENABLE_VERTEX_LIGHTING"),$e.defines.push("ENABLE_VERTEX_LIGHTING")):(Ve.defines.push("ENABLE_DAYNIGHT_SHADING"),$e.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),$e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),$e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Ve.defines.push("GROUND_ATMOSPHERE"),$e.defines.push("GROUND_ATMOSPHERE"),C&&(Ve.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),$e.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ve.defines.push("INCLUDE_WEB_MERCATOR_Y"),$e.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(Ve.defines.push("FOG"),$e.defines.push("FOG")),d&&$e.defines.push("APPLY_SPLIT"),R&&$e.defines.push("ENABLE_CLIPPING_PLANES"),O&&($e.defines.push("ENABLE_CLIPPING_POLYGONS"),Ve.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&$e.defines.push("CLIPPING_INVERSE"),$e.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),Ve.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),v&&$e.defines.push("COLOR_CORRECT"),I&&$e.defines.push("HIGHLIGHT_FILL_TILE"),F&&Ve.defines.push("GEODETIC_SURFACE_NORMALS"),U&&Ve.defines.push("EXAGGERATION");let Ct=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;E&&(Ct+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let Qe=0;Qe<i;++Qe)E?Ct+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Qe}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Ct+=` color = sampleAndBlend( -`,Ct+=` color, - u_dayTextures[${Qe}], - u_dayTextureUseWebMercatorT[${Qe}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${Qe}], - u_dayTextureTranslationAndScale[${Qe}], - ${u?`u_dayTextureAlpha[${Qe}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${Qe}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${Qe}]`:"1.0"}, -${o?`u_dayTextureBrightness[${Qe}]`:"0.0"}, - ${r?`u_dayTextureContrast[${Qe}]`:"0.0"}, - ${s?`u_dayTextureHue[${Qe}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${Qe}]`:"0.0"}, - ${c?`u_dayTextureOneOverGamma[${Qe}]`:"0.0"}, - ${d?`u_dayTextureSplit[${Qe}]`:"0.0"}, - ${N?`u_colorsToAlpha[${Qe}]`:"vec4(0.0)"}, - nightBlend ); -`,E&&(Ct+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Ct+=` return color; - }`,$e.sources.push(Ct),Ve.sources.push(G_t(le)),Ve.sources.push(q_t(S));let Jt=Xt.fromCache({context:t.context,vertexShaderSource:Ve,fragmentShaderSource:$e,attributeLocations:J.getAttributeLocations()});Te=ve[ye]=new H_t(i,ye,this.material,Jt,xe,Ie)}return n.surfaceShader=Te,Te.shaderProgram};KZ.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 ce(this)};var yB=KZ;var Y_t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ui=Object.freeze(Y_t);var X_t={START:0,LOADING:1,DONE:2,FAILED:3},_a=Object.freeze(X_t);var K_t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},go=Object.freeze(K_t);function hr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=go.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new re,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(hr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===go.RECEIVING||e===go.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!==ui.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var $_t=new fe;function $Z(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,$_t);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var Z_t=new h,Q_t=new h,J_t=new h;hr.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,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],_=a[d+1],m=a[d+2],y=$Z(c,t,n,s,p,Z_t),b=$Z(c,t,n,s,_,Q_t),x=$Z(c,t,n,s,m,J_t),T=ti.rayTriangleParametric(e,y,b,x,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?_n.getPoint(e,f,o):void 0};hr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=go.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};hr.prototype.freeVertexArray=function(){hr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,hr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};hr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new hr),e.state===_a.START&&(egt(e,t,n),e.state=_a.LOADING)};hr.processStateMachine=function(e,t,n,i,o,r,s){hr.initialize(e,n,i);let a=e.data;if(e.state===_a.LOADING&&tgt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===go.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let _ in d)d.hasOwnProperty(_)&&(d[_](e)||(p[_]=d[_]));e._loadedCallbacks=p,e.state=_a.DONE}c&&(e.renderable=!0)};hr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===ui.PLACEHOLDER){let _=d.loadingImagery.imageryLayer;if(_.ready){d.freeResources(),c.splice(u,1),_._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===ui.FAILED||d.loadingImagery.state===ui.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function LCe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Yc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Yc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(hr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=hr._createVertexArrayForMesh(i.context,o)):(hr._freeVertexArray(e.vertexArray),e.vertexArray=hr._createVertexArrayForMesh(i.context,o)),hr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}hr.prototype.addGeodeticSurfaceNormals=function(e,t){LCe(this,!0,e,t)};hr.prototype.removeGeodeticSurfaceNormals=function(e){LCe(this,!1,void 0,e)};hr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let _=0;_<p;_++){let m=d[_];m.level=-1}}}};function egt(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=go.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function tgt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===go.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||hr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===go.FAILED&&ngt(s,e,t,n,e.x,e.y,e.level),s.terrainState===go.UNLOADED&&igt(s,n,e.x,e.y,e.level),s.terrainState===go.RECEIVED&&rgt(s,t,n,e.x,e.y,e.level),s.terrainState===go.TRANSFORMED&&(sgt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=go.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)cgt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function ngt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=_a.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=go.RECEIVING,Promise.resolve(p).then(function(_){l(_)&&(e.terrainData=_,e.terrainState=go.RECEIVED)}).catch(function(){e.terrainState=go.FAILED}))}function igt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=go.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=go.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Xn.CANCELLED){e.terrainData=void 0,e.terrainState=go.UNLOADED,e.request=void 0;return}e.terrainState=go.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Lo.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new tr({throttle:!1,throttleByServer:!0,type:Ts.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o);l(u)?(e.terrainState=go.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=go.UNLOADED,e.request=void 0)}a()}var ogt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function rgt(e,t,n,i,o,r){let s=n.tilingScheme,a=ogt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=go.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=go.TRANSFORMED}).catch(function(){e.terrainState=go.FAILED}))}hr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=st.createVertexBuffer({context:e,typedArray:n,usage:Ne.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=st.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new qn({context:e,attributes:o,indexBuffer:s})};hr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function sgt(e,t,n,i,o,r,s){e.vertexArray=hr._createVertexArrayForMesh(t,e.mesh),e.terrainState=go.READY,e.fill=e.fill&&e.fill.destroy(s)}function agt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=dt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function cgt(e,t){let n=t.terrainData.waterMask,i=agt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=dt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ie.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}hr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};hr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,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 zd=hr;var ZZ,NCe="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",lw={};lw.defaultAccessToken=NCe;lw.defaultWorldImageryServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});lw.defaultWorldHillshadeServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});lw.defaultWorldOceanServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});lw.getDefaultTokenCredit=function(e){if(e===NCe){if(!l(ZZ)){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>';ZZ=new _t(t,!0)}return ZZ}};var Af=lw;function QZ(e){e=e??G.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ee.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=nh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],_=p.x*4+p.y*c;s[_+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)}QZ.prototype.isReady=function(){return this._isReady};QZ.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=nh(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var bB=QZ;function JZ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}JZ.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])};JZ.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 _m=JZ;function uw(){he.throwInstantiationError()}Object.defineProperties(uw.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});uw.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};uw.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};uw.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var lgt=/\.ktx2$/i;uw.loadImage=function(e,t){let n=Ee.createIfNeeded(t);return lgt.test(n.url)?Qs(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ul=uw;var ugt={SATELLITE:1,OCEANS:2,HILLSHADE:3},gm=Object.freeze(ugt);function FCe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ei({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new _t(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}FCe.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 bB({missingImageUrl:BCe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new V(0,0),new V(200,20),new V(20,200),new V(80,110),new V(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function fgt(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 gs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ei({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new se(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 Li,o=e.fullExtent,r=i.unproject(new h(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 h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ae(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ae.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 se(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new _t(e.copyrightText)]:t.credit=new _t(e.copyrightText))}function dgt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new se(n)}async function hgt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();fgt(i,t)}catch(i){dgt(e,i)}}function Pp(e){e=e??G.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 Ei({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 _t(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new me}Pp.fromBasemapType=async function(e,t){t=t??G.EMPTY_OBJECT;let n,i,o;switch(e){case gm.SATELLITE:{n=t.token??Af.defaultAccessToken,i=Ee.createIfNeeded(Af.defaultWorldImageryServer),i.appendForwardSlash();let r=Af.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;case gm.OCEANS:{n=t.token??Af.defaultAccessToken,i=Ee.createIfNeeded(Af.defaultWorldOceanServer),i.appendForwardSlash();let r=Af.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;case gm.HILLSHADE:{n=t.token??Af.defaultAccessToken,i=Ee.createIfNeeded(Af.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Af.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;default:}return Pp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function BCe(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 Mi?(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(Pp.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}}});Pp.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Pp(t);i._resource=n;let o=new FCe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await hgt(n,o),o.build(i),i};Pp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Pp.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,BCe(this,e,t,n,i))};Pp.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 Mi)s=D.toDegrees(i),a=D.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let _=[],m=p.results;if(!l(m))return _;for(let y=0;y<m.length;++y){let b=m[y],x=new _m;if(x.data=b,x.name=b.value,x.properties=b.attributes,x.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let T=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)x.position=fe.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(T===102100||T===900913||T===3857){let C=new Li;x.position=C.unproject(new h(b.geometry.x,b.geometry.y,b.geometry.z))}}_.push(x)}return _})};Pp._metadataCache={};var Qg=Pp;var mgt={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"},fw=Object.freeze(mgt);function xB(e){}xB.prototype.isReady=function(){return!0};xB.prototype.shouldDiscardImage=function(e){return xB.EMPTY_IMAGE===e};var ZG;Object.defineProperties(xB,{EMPTY_IMAGE:{get:function(){return l(ZG)||(ZG=new Image,ZG.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),ZG}}});var dw=xB;function kCe(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}kCe.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 _t)break;o.credit=new _t(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new ae(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function pgt(e,t){if(e.resourceSets.length!==1)throw new se("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 _gt(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 se(i)}async function ggt(e,t,n){let i=e.url,o=qs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),qs._metadataCache[i]=o);try{let r=await o;return pgt(r,t)}catch(r){_gt(e,r,n)}}function qs(e){e=e??G.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??fw.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new dw),this._proxy=e.proxy,this._credit=new _t(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${qs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new gs({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 me}Object.defineProperties(qs.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)}}});qs.fromUrl=async function(e,t){t=t??G.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??fw.AERIAL,o=Ee.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 qs(t);a._resource=o;let c=new kCe(t);return await ggt(s,c),c.build(a),a};var ygt=new ae;qs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,ygt);return Tgt(this._attributionList,n,i)};qs.prototype.requestImage=function(e,t,n,i){let o=Ul.loadImage(this,bgt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?dw.EMPTY_IMAGE:Promise.reject(r)})};qs.prototype.pickFeatures=function(e,t,n,i,o){};qs.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};qs.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}};qs._logoUrl=void 0;Object.defineProperties(qs,{logoUrl:{get:function(){return l(qs._logoUrl)||(qs._logoUrl=on("Assets/Images/bing_maps_credit.png")),qs._logoUrl},set:function(e){qs._logoUrl=e}}});function bgt(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:qs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var xgt=new ae;function Tgt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ae.intersection(n,d.bbox,xgt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}qs._metadataCache={};var TB=qs;var UCe=/{[^}]+}/g,zCe={x:Sgt,y:wgt,z:Dgt,s:Rgt,reverseX:vgt,reverseY:Igt,reverseZ:Pgt,westDegrees:Ogt,southDegrees:Mgt,eastDegrees:Lgt,northDegrees:Ngt,westProjected:Fgt,southProjected:Bgt,eastProjected:kgt,northProjected:Ugt,width:zgt,height:Vgt},Cgt=ct(zCe,{i:Hgt,j:Ggt,reverseI:jgt,reverseJ:Wgt,longitudeDegrees:Ygt,latitudeDegrees:Xgt,longitudeProjected:Kgt,latitudeProjected:$gt,format:Qgt});function CB(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new me;let t=Ee.createIfNeeded(e.url),n=Ee.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 gs({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ae.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new _t(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=ct(zCe,r),a=ct(Cgt,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(CB.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}}});CB.prototype.getTileCredits=function(e,t,n){};CB.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,Agt(this,e,t,n,i))};CB.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Egt(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var QG=!1,Ef=new ae,JG=!1,AB=new ae;function Agt(e,t,n,i,o){QG=!1,JG=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(UCe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var eQ=!1,mw=new V,tQ=!1;function Egt(e,t,n,i,o,r,s){QG=!1,JG=!1,eQ=!1,tQ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(UCe);return l(d)&&d.forEach(function(p){let _=p.substring(1,p.length-1);l(u[_])&&(f[_]=u[_](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function pw(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 Sgt(e,t,n,i){return pw(e,"{x}",t)}function vgt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return pw(e,"{reverseX}",o)}function wgt(e,t,n,i){return pw(e,"{y}",n)}function Igt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return pw(e,"{reverseY}",o)}function Pgt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return pw(e,"{reverseZ}",r)}function Dgt(e,t,n,i){return pw(e,"{z}",i)}function Rgt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function e5(e,t,n,i){QG||(e.tilingScheme.tileXYToRectangle(t,n,i,Ef),Ef.west=D.toDegrees(Ef.west),Ef.south=D.toDegrees(Ef.south),Ef.east=D.toDegrees(Ef.east),Ef.north=D.toDegrees(Ef.north),QG=!0)}function Ogt(e,t,n,i){return e5(e,t,n,i),Ef.west}function Mgt(e,t,n,i){return e5(e,t,n,i),Ef.south}function Lgt(e,t,n,i){return e5(e,t,n,i),Ef.east}function Ngt(e,t,n,i){return e5(e,t,n,i),Ef.north}function t5(e,t,n,i){JG||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,AB),JG=!0)}function Fgt(e,t,n,i){return t5(e,t,n,i),AB.west}function Bgt(e,t,n,i){return t5(e,t,n,i),AB.south}function kgt(e,t,n,i){return t5(e,t,n,i),AB.east}function Ugt(e,t,n,i){return t5(e,t,n,i),AB.north}function zgt(e,t,n,i){return e.tileWidth}function Vgt(e,t,n,i){return e.tileHeight}function Hgt(e,t,n,i,o,r,s){return n5(e,t,n,i,o,r),mw.x}function Ggt(e,t,n,i,o,r,s){return n5(e,t,n,i,o,r),mw.y}function jgt(e,t,n,i,o,r,s){return n5(e,t,n,i,o,r),e.tileWidth-mw.x-1}function Wgt(e,t,n,i,o,r,s){return n5(e,t,n,i,o,r),e.tileHeight-mw.y-1}var qgt=new ae,hw=new h;function n5(e,t,n,i,o,r,s){if(eQ)return;nQ(e,t,n,i,o,r);let a=hw,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,qgt);mw.x=e.tileWidth*(a.x-c.west)/c.width|0,mw.y=e.tileHeight*(c.north-a.y)/c.height|0,eQ=!0}function Ygt(e,t,n,i,o,r,s){return D.toDegrees(o)}function Xgt(e,t,n,i,o,r,s){return D.toDegrees(r)}function Kgt(e,t,n,i,o,r,s){return nQ(e,t,n,i,o,r),hw.x}function $gt(e,t,n,i,o,r,s){return nQ(e,t,n,i,o,r),hw.y}var Zgt=new fe;function nQ(e,t,n,i,o,r,s){if(!tQ){if(e.tilingScheme.projection instanceof Mi)hw.x=D.toDegrees(o),hw.y=D.toDegrees(r);else{let a=Zgt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,hw)}tQ=!0}}function Qgt(e,t,n,i,o,r,s){return s}var lc=CB;function Vd(e){lc.call(this,e)}Vd._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Vd._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Im)return Vd._metadataFailure(e,t);throw o}};Vd.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??G.EMPTY_OBJECT;let r=await Vd._requestMetadata(t,i,o);return new Vd(r)};l(Object.create)&&(Vd.prototype=Object.create(lc.prototype),Vd.prototype.constructor=Vd);function VCe(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 HCe(e,t,n){let i=e.positionToTileXY(ae.southwest(t),n),o=e.positionToTileXY(ae.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Vd._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],_=e.childNodes[0].childNodes;for(let P=0;P<_.length;P++)if(r.test(_.item(P).nodeName))u=_.item(P);else if(a.test(_.item(P).nodeName)){d=_.item(P);let O=_.item(P).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(_.item(P).nodeName)&&(f=_.item(P));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Lo.reportError(void 0,o,o.errorEvent,m),new se(m);let y=t.fileExtension??u.getAttribute("extension"),b=t.tileWidth??parseInt(u.getAttribute("width"),10),x=t.tileHeight??parseInt(u.getAttribute("height"),10),T=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),C=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),A=d.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(A==="geodetic"||A==="global-geodetic")S=new Ei({ellipsoid:t.ellipsoid});else if(A==="mercator"||A==="global-mercator")S=new gs({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${A}.`,l(o)&&Lo.reportError(void 0,o,o.errorEvent,m),new se(m);let w=ae.clone(t.rectangle);if(!l(w)){let P,O,L,g;t.flipXY??!1?(L=new V(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new V(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new V(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new V(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let v=A==="geodetic"||A==="mercator";if(S.projection instanceof Mi||v)P=fe.fromDegrees(L.x,L.y),O=fe.fromDegrees(g.x,g.y);else{let I=S.projection;P=I.unproject(L),O=I.unproject(g)}w=new ae(P.longitude,P.latitude,O.longitude,O.latitude)}return w=VCe(w,S),T=HCe(S,w,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:S,rectangle:w,tileWidth:b,tileHeight:x,minimumLevel:T,maximumLevel:C,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Vd._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 gs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=VCe(a,s);let c=HCe(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 Cb=Vd;function GCe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}GCe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Jgt(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 se(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new se(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Ei({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new gs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new se(o)}return!0}function eyt(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 se(i)}async function tyt(e,t,n){try{let i=await e.fetchText();Jgt(i,t)}catch(i){eyt(i,e,n)}}function Cu(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new _t(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Cu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new me}Object.defineProperties(Cu.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Cu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=Ee.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 GCe(n);s.channel=t,await tyt(r,s);let a=new Cu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Cu.prototype.getTileCredits=function(e,t,n){};Cu.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Ul.loadImage(this,o)};Cu.prototype.pickFeatures=function(e,t,n,i,o){};Cu._logoUrl=void 0;Object.defineProperties(Cu,{logoUrl:{get:function(){return l(Cu._logoUrl)||(Cu._logoUrl=on("Assets/Images/google_earth_credit.png")),Cu._logoUrl},set:function(e){Cu._logoUrl=e}}});var EB=Cu;var nyt=/\/$/,jCe=new _t('© <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 _w(e){e=e??G.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=Ee.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();nyt.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 _t(s))):s=jCe,this._resource=i,this._imageryProvider=new lc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(_w.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}}});_w.prototype.getTileCredits=function(e,t,n){};_w.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};_w.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};_w._defaultCredit=jCe;var SB=_w;function WC(e){e=e??G.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??ae.MAX_VALUE,n=new Ei({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 me;let i=e.credit;typeof i=="string"&&(i=new _t(i)),this._credit=i;let o=Ee.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(WC.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 iyt(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 iQ(e,n,r);throw l(n)&&(n._hasError=!0),new se(o)}async function iQ(e,t,n){try{return await Ul.loadImage(null,e)}catch(i){return iyt(e,i,t,n)}}WC.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e),i=await iQ(n);t=t??G.EMPTY_OBJECT;let o=new WC({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};WC.prototype.getTileCredits=function(e,t,n){};WC.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await iQ(this._resource,this);return this._image=o,Lo.reportSuccess(this._errorEvent),o}return this._image};WC.prototype.pickFeatures=function(e,t,n,i,o){};var vB=WC;function oyt(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=ryt:e==="xml"?n=lyt:(e==="html"||e==="text")&&(n=WCe)),this.callback=n}function ryt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new _m;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=fe.fromDegrees(s,a)}t.push(r)}return t}var oQ="http://www.mapinfo.com/mxp",syt="http://www.esri.com/wms",ayt="http://www.opengis.net/wfs",cyt="http://www.opengis.net/gml";function lyt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===oQ)return uyt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===syt)return fyt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===ayt)return dyt(e);if(t.localName==="ServiceExceptionReport")throw new se(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?hyt(e):myt(e)}function uyt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(oQ,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(oQ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new _m;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function fyt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(i5(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(i5(a,i))}}return n}function dyt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(cyt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};rQ(r,s),t.push(i5(r,s))}return t}function hyt(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 se("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={};rQ(s,a),t.push(i5(s,a))}}return t}function rQ(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()&&rQ(o,t)&&(t[o.localName]=o.textContent)}return n}function i5(e,t){let n=new _m;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function myt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new _m;return o.data=e,o.description=n.innerHTML,[o]}var pyt=/<body>\s*<\/body>/im,_yt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,gyt=/<title>([\s\S]*)<\/title>/im;function WCe(e){if(pyt.test(e)||_yt.test(e))return;let t,n=gyt.exec(e);n&&n.length>1&&(t=n[1]);let i=new _m;return i.name=t,i.description=e,i.data=e,[i]}var qC=oyt;function wB(e){e=e??G.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(wB.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)}}});wB.prototype.getFromCache=function(e,t,n,i){let o=qCe(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};wB.prototype.checkApproachingInterval=function(e,t,n,i){let o=qCe(e,t,n),r=this._tilesRequestedForInterval,s=YCe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!XCe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};wB.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=YCe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=XCe(this,c,r),a||s.push(c)}}};function qCe(e,t,n){return`${e}-${t}-${n}`}function yyt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function YCe(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=$.secondsDifference(c.stop,i),++a):(s=$.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function XCe(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=yyt(s),c=new tr({throttle:!1,throttleByServer:!0,type:Ts.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var YC=wB;var byt=[3034,3035,3042,3043,3044],xyt=[4471,4559];function ym(e){if(e=e??G.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new he("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=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(ym.DefaultParameters,!0),n.setQueryParameters(ym.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(KCe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(KCe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new YC({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return $Ce(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"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&&!xyt.includes(a)||byt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"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 lc({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ei({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??ym.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function $Ce(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 Tyt(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(ym.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}}});ym.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};ym.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=$Ce(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};ym.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Tyt(this,e,t,n,i,o,s)};ym.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});ym.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});ym.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new qC("json","application/json")),Object.freeze(new qC("xml","text/xml")),Object.freeze(new qC("text","text/html"))]);function KCe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var IB=ym;var Cyt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function PB(e){e=e??G.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=Ee.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(Cyt),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),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 gs({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 YC({clock:e.clock,times:e.times,requestImageFunction:function(d,p,_,m,y){return ZCe(s,d,p,_,m,y)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ae.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ae.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new me;let f=e.credit;this._credit=typeof f=="string"?new _t(f):f,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 ZCe(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let _={};_.tilematrix=a,_.layer=e._layer,_.style=e._style,_.tilerow=n,_.tilecol=t,_.tilematrixset=e._tileMatrixSetID,_.format=e._format,l(u)&&(_=ct(_,u)),l(f)&&(_=ct(_,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:_,request:o}),d.setTemplateValues(p)}return Ul.loadImage(e,d)}Object.defineProperties(PB.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())}}});PB.prototype.getTileCredits=function(e,t,n){};PB.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=ZCe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};PB.prototype.pickFeatures=function(e,t,n,i,o){};var DB=PB;var Ayt={ARCGIS_MAPSERVER:Qg.fromUrl,BING:async(e,t)=>TB.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,EB.fromUrl(e,n,t)},MAPBOX:(e,t)=>new SB({url:e,...t}),SINGLE_TILE:vB.fromUrl,TMS:Cb.fromUrl,URL_TEMPLATE:(e,t)=>new lc({url:e,...t}),WMS:(e,t)=>new IB({url:e,...t}),WMTS:(e,t)=>new DB({url:e,...t})};function Dp(e){e=e??G.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 me}Object.defineProperties(Dp.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(){}}});Dp.fromAssetId=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Hu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Dp._endpointCache[i];l(o)||(o=n.fetchJson(),Dp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new se(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Cb.fromUrl(new Hu(r,n));else{let u=Ayt[a];if(!l(u))throw new se(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new Dp(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Hu.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Dp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Dp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Dp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Dp._endpointCache={};var Jg=Dp;var Eyt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},ey=Object.freeze(Eyt);function Syt(e){e=e??G.EMPTY_OBJECT;let t=e.style??ey.AERIAL;return Jg.fromAssetId(t)}var ty=Syt;var RB=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var OB=`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)); -} -`;function gw(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=ui.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}gw.createPlaceholder=function(e){let t=new gw(e,0,0,0);return t.addReference(),t.state=ui.PLACEHOLDER,t};gw.prototype.addReference=function(){++this.referenceCount};gw.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(),ce(this),0):this.referenceCount};gw.prototype.processStateMachine=function(e,t,n){this.state===ui.UNLOADED&&!n&&(this.state=ui.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ui.RECEIVED&&(this.state=ui.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ui.READY&&t&&!this.texture;(this.state===ui.TEXTURE_LOADED||i)&&(this.state=ui.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var yw=gw;function sQ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}sQ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};sQ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ui.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!==ui.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ui.FAILED&&r.state!==ui.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===ui.FAILED||i.state===ui.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var bw=sQ;function vi(e,t){this._imageryProvider=e,this._readyEvent=new me,this._errorEvent=new me,t=t??G.EMPTY_OBJECT,e=e??G.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??vi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??vi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??vi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??vi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??vi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??vi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??vi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??vi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ae.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new bw(yw.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??vi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(vi.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}}});vi.DEFAULT_BRIGHTNESS=1;vi.DEFAULT_CONTRAST=1;vi.DEFAULT_HUE=0;vi.DEFAULT_SATURATION=1;vi.DEFAULT_GAMMA=1;vi.DEFAULT_SPLIT=Wr.NONE;vi.DEFAULT_MINIFICATION_FILTER=ft.LINEAR;vi.DEFAULT_MAGNIFICATION_FILTER=Kn.LINEAR;vi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;vi.fromProviderAsync=function(e,t){let n=new vi(void 0,t);return Dyt(n,Promise.resolve(e)),n};vi.fromWorldImagery=function(e){return e=e??G.EMPTY_OBJECT,vi.fromProviderAsync(ty({style:e.style}),e)};vi.prototype.isBaseLayer=function(){return this._isBaseLayer};vi.prototype.isDestroyed=function(){return!1};vi.prototype.destroy=function(){return ce(this)};var eAe=new ae,QCe=new ae,aQ=new ae,tAe=new ae;vi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ae.intersection(e.rectangle,t)};vi.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 Li&&e.rectangle.north<Li.MaximumLatitude&&e.rectangle.south>-Li.MaximumLatitude,s=ae.intersection(o.rectangle,this._rectangle,eAe),a=ae.intersection(e.rectangle,s,QCe);if(!l(a)){if(!this.isBaseLayer())return!1;let v=s,I=e.rectangle;a=QCe,I.south>=v.north?a.north=a.south=v.north:I.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(I.south,v.south),a.north=Math.min(I.north,v.north)),I.west>=v.east?a.west=a.east=v.east:I.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(I.west,v.west),a.east=Math.min(I.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Iyt(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let v=o.minimumLevel;d<v&&(d=v)}let _=o.tilingScheme,m=_.positionToTileXY(ae.northwest(a),d),y=_.positionToTileXY(ae.southeast(a),d),b=e.rectangle.width/512,x=e.rectangle.height/512,T=_.tileXYToRectangle(m.x,m.y,d);Math.abs(T.south-e.rectangle.north)<x&&m.y<y.y&&++m.y,Math.abs(T.east-e.rectangle.west)<b&&m.x<y.x&&++m.x;let C=_.tileXYToRectangle(y.x,y.y,d);Math.abs(C.north-e.rectangle.south)<x&&y.y>m.y&&--y.y,Math.abs(C.west-e.rectangle.east)<b&&y.x>m.x&&--y.x;let A=ae.clone(e.rectangle,tAe),S=_.tileXYToRectangle(m.x,m.y,d),w=ae.intersection(S,s,aQ),R;r?(_.rectangleToNativeRectangle(A,A),_.rectangleToNativeRectangle(S,S),_.rectangleToNativeRectangle(w,w),_.rectangleToNativeRectangle(s,s),R=_.tileXYToNativeRectangle.bind(_),b=A.width/512,x=A.height/512):R=_.tileXYToRectangle.bind(_);let P,O=0,L=1,g;!this.isBaseLayer()&&Math.abs(w.west-A.west)>=b&&(O=Math.min(1,(w.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(w.north-A.north)>=x&&(L=Math.max(0,(w.north-A.south)/A.height));let E=L;for(let v=m.x;v<=y.x;v++)if(P=O,S=R(v,m.y,d),w=ae.simpleIntersection(S,s,aQ),!!l(w)){O=Math.min(1,(w.east-A.west)/A.width),v===y.x&&(this.isBaseLayer()||Math.abs(w.east-A.east)<b)&&(O=1),L=E;for(let I=m.y;I<=y.y;I++){if(g=L,S=R(v,I,d),w=ae.simpleIntersection(S,s,aQ),!l(w))continue;L=Math.max(0,(w.south-A.south)/A.height),I===y.y&&(this.isBaseLayer()||Math.abs(w.south-A.south)<x)&&(L=0);let N=new ie(P,L,O,g),F=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new bw(F,N,r)),++n}}return!0};vi.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,eAe),i=c.rectangleToNativeRectangle(i,tAe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ie(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};vi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ui.RECEIVED,e.request=void 0,Lo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Xn.CANCELLED){e.state=ui.UNLOADED,e.request=void 0;return}e.state=ui.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Lo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new tr({throttle:!1,throttleByServer:!0,type:Ts.IMAGERY});e.request=s,e.state=ui.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level);if(!l(a)){e.state=ui.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};vi.prototype._createTextureWebGL=function(e,t){let n=new zt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?je.RGBA:je.RGB,sampler:n})};vi.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=ui.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ui.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Li?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ui.TEXTURE_LOADED};function JCe(e,t,n){return`${e}:${t}:${n}`}vi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===ft.LINEAR&&i===Kn.LINEAR&&!je.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=ft.LINEAR_MIPMAP_LINEAR;let r=Lt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=JCe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(qf.NICEST),t.sampler=u}else{let r=JCe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};vi.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 Mi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Ea({persists:!0,owner:this,preExecute:function(c){wyt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ui.READY,t.releaseReference()},canceled:function(){t.state=ui.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ui.READY};vi.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};vi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};vi.prototype.getImageryFromCache=function(e,t,n,i){let o=nAe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new yw(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};vi.prototype.removeImageryFromCache=function(e){let t=nAe(e.x,e.y,e.level);delete this._imageryCache[t]};function nAe(e,t,n){return JSON.stringify([e,t,n])}var o5={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new V,texture:void 0},vyt=Nt.supportsTypedArrays()?new Float32Array(2*64):void 0;function wyt(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 b=new Float32Array(2*64*2),x=0;for(let w=0;w<64;++w){let R=w/63;b[x++]=0,b[x++]=R,b[x++]=1,b[x++]=R}let T={position:0,webMercatorT:1},C=_s.getRegularGridIndices(2,64),A=st.createIndexBuffer({context:t,typedArray:C,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});o.vertexArray=new qn({context:t,attributes:[{index:T.position,vertexBuffer:st.createVertexBuffer({context:t,typedArray:b,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:st.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:A});let S=new Be({sources:[OB]});o.shaderProgram=Xt.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:RB,attributeLocations:T}),o.sampler=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;o5.textureDimensions.x=r,o5.textureDimensions.y=s,o5.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new dt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(r)&&D.isPowerOfTwo(s)&&d.generateMipmap(qf.NICEST);let p=i.south,_=i.north,m=vyt,y=0;for(let b=0;b<64;++b){let x=b/63,T=D.lerp(p,_,x);a=Math.sin(T);let A=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=A,m[y++]=A}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=o5,e.vertexArray=o.vertexArray}function Iyt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Mi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Pyt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Dyt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Pyt(e._errorEvent,i)}}var uc=vi;var iAe={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>=iAe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},$n=iAe;function Tw(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie}Tw.prototype.update=function(e,t,n){this.changedThisFrame&&(uAe(e,t,this.tile,n),this.changedThisFrame=!1)};Tw.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};Tw.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):zd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Ryt=new Cl;Tw.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Ryt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);Ys(e,n,c,u,s,yn.EAST,!1,a,i),Ys(e,n,c,f,s,yn.NORTH,!1,a,i),Ys(e,n,c,d,s,yn.WEST,!1,a,i),Ys(e,n,c,p,s,yn.SOUTH,!1,a,i);let _=u.findTileToNorth(r),m=u.findTileToSouth(r),y=d.findTileToNorth(r),b=d.findTileToSouth(r);Ys(e,n,c,_,s,yn.SOUTHEAST,!1,a,i),Ys(e,n,c,y,s,yn.SOUTHWEST,!1,a,i),Ys(e,n,c,m,s,yn.NORTHEAST,!1,a,i),Ys(e,n,c,b,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ys(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||$n.wasKicked(u._lastSelectionResult)||$n.originalResult(u._lastSelectionResult)===$n.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===$n.RENDERED){if(l(u.data.vertexArray))return;Oyt(e,t,n,u,r,o,a,c);return}if($n.originalResult(i._lastSelectionResult)!==$n.CULLED)switch(r){case yn.WEST:Ys(e,t,n,i.northwestChild,o,r,!0,a,c),Ys(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:Ys(e,t,n,i.southeastChild,o,r,!0,a,c),Ys(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:Ys(e,t,n,i.southwestChild,o,r,!0,a,c),Ys(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:Ys(e,t,n,i.northeastChild,o,r,!0,a,c),Ys(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:Ys(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:Ys(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:Ys(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:Ys(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function Oyt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new Tw(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Myt(e,t,n,i,o,a)}function Myt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(uAe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,_,m,y=n.rectangle,b,x=i.rectangle;switch(o){case yn.WEST:for(b=(x.north-x.south)*D.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!D.greaterThan(y.north,m.south,b));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!D.greaterThanOrEquals(y.south,m.north,b));++p);break;case yn.SOUTH:for(b=(x.east-x.west)*D.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!D.lessThan(y.west,m.east,b));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!D.lessThanOrEquals(y.east,m.west,b));++p);break;case yn.EAST:for(b=(x.north-x.south)*D.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!D.lessThan(y.south,m.north,b));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!D.lessThanOrEquals(y.north,m.south,b));++p);break;case yn.NORTH:for(b=(x.east-x.west)*D.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!D.greaterThan(y.east,m.west,b));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!D.greaterThanOrEquals(y.west,m.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var XC=new fe,Lyt=new fe,xw=new h,fQ=new h,cQ=new V,lQ=new V,Sf=new V;function f5(){this.height=0,this.encodedNormal=new V}function r5(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,_=0;l(d)&&(p=d.minimumHeight,_=d.maximumHeight),u=(p+_)*.5}return fAe(e,t,n,i,u,c),c}var Nyt={minimumHeight:0,maximumHeight:0},Fyt=new h,oAe=new f5,rAe=new f5,sAe=new f5,aAe=new f5,Byt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,kyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function uAe(e,t,n,i){zd.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=a5(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,sAe),p=a5(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,oAe),_=a5(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,rAe),m=a5(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,aAe);d=r5(r,f,0,1,d,p,m,_,sAe),p=r5(r,f,0,0,p,d,_,m,oAe),_=r5(r,f,1,1,_,p,m,d,rAe),m=r5(r,f,1,1,m,_,d,p,aAe);let y=p.height,b=_.height,x=d.height,T=m.height,C=Math.min(y,b,x,T),A=Math.max(y,b,x,T),S=(C+A)*.5,w,R,P=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-P,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&A-C<=P){let v=new ac({width:9,height:9,buffer:Byt,structure:{heightOffset:A}}),I=kyt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=v._createMeshSync(I)}else{let v=u,I=ae.center(s,Lyt);I.height=S;let N=f.cartographicToCartesian(I,Fyt),F=new Yc(N,void 0,void 0,void 0,void 0,!0,!0,v,a,c),U=5,k;for(k=r.westMeshes,w=0,R=k.length;w<R;++w)U+=k[w].eastIndicesNorthToSouth.length;for(k=r.southMeshes,w=0,R=k.length;w<R;++w)U+=k[w].northIndicesWestToEast.length;for(k=r.eastMeshes,w=0,R=k.length;w<R;++w)U+=k[w].westIndicesSouthToNorth.length;for(k=r.northMeshes,w=0,R=k.length;w<R;++w)U+=k[w].southIndicesEastToWest.length;let z=Nyt;z.minimumHeight=C,z.maximumHeight=A;let B=F.stride,j=new Float32Array(U*B),W=0,J=W;W=s5(f,s,F,j,W,0,1,d.height,d.encodedNormal,1,z),W=l5(r,f,F,j,W,r.westTiles,r.westMeshes,yn.EAST,z);let Y=W;W=s5(f,s,F,j,W,0,0,p.height,p.encodedNormal,0,z),W=l5(r,f,F,j,W,r.southTiles,r.southMeshes,yn.NORTH,z);let ee=W;W=s5(f,s,F,j,W,1,0,_.height,_.encodedNormal,0,z),W=l5(r,f,F,j,W,r.eastTiles,r.eastMeshes,yn.WEST,z);let Q=W;W=s5(f,s,F,j,W,1,1,m.height,m.encodedNormal,1,z),W=l5(r,f,F,j,W,r.northTiles,r.northMeshes,yn.SOUTH,z),C=z.minimumHeight,A=z.maximumHeight;let de=In.fromRectangle(s,C,A,n.tilingScheme.ellipsoid),ge=Li.geodeticLatitudeToMercatorAngle(s.south),le=1/(Li.geodeticLatitudeToMercatorAngle(s.north)-ge),ye=(Li.geodeticLatitudeToMercatorAngle(I.latitude)-ge)*le,xe=f.geodeticSurfaceNormalCartographic(XC,fQ),Ie=On.octEncode(xe,cQ),Te=W;F.encode(j,W*B,de.center,V.fromElements(.5,.5,Sf),S,Ie,ye,xe),++W;let ve=W,Ve=ve<256?1:2,$e=(ve-1)*3,Ct=$e*Ve,Jt=(j.length-ve*B)*Float32Array.BYTES_PER_ELEMENT,Qe;if(Jt>=Ct){let Gt=ve*B*Float32Array.BYTES_PER_ELEMENT;Qe=ve<256?new Uint8Array(j.buffer,Gt,$e):new Uint16Array(j.buffer,Gt,$e)}else Qe=ve<256?new Uint8Array($e):new Uint16Array($e);j=new Float32Array(j.buffer,0,ve*B);let mn=0;for(w=0;w<ve-2;++w)Qe[mn++]=Te,Qe[mn++]=w,Qe[mn++]=w+1;Qe[mn++]=Te,Qe[mn++]=w,Qe[mn++]=0;let Bt=[];for(w=Y;w>=J;--w)Bt.push(w);let Ot=[];for(w=ee;w>=Y;--w)Ot.push(w);let Jn=[];for(w=Q;w>=ee;--w)Jn.push(w);let bi=[];for(bi.push(0),w=Te-1;w>=Q;--w)bi.push(w);r.mesh=new kd(F.center,j,Qe,$e,ve,C,A,re.fromOrientedBoundingBox(de),Wyt(e,de.center,s,C,A),F.stride,de,F,Bt,Ot,Jn,bi)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=zd._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=o._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(r.waterMaskTexture=v.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,v,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function s5(e,t,n,i,o,r,s,a,c,u,f){let d=XC;d.longitude=D.lerp(t.west,t.east,r),d.latitude=D.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,xw),_;n.hasGeodeticSurfaceNormals&&(_=e.geodeticSurfaceNormal(p,fQ));let m=lQ;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,_),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var u5=new ae;function MB(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=ae.clone(e.rectangle,u5),o.west-=D.TWO_PI,o.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ae.clone(e.rectangle,u5),o.west+=D.TWO_PI,o.east+=D.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),_=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(_)<Math.EPSILON5?_=0:Math.abs(_-1)<Math.EPSILON5&&(_=1),i.x=p,i.y=_,i}var Uyt=new V;function uQ(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 zyt=new V,Vyt=new h;function Hyt(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=MB(t,n,f.decodeTextureCoordinates(d,o,Sf),Sf),_=MB(t,n,f.decodeTextureCoordinates(d,r,lQ),lQ),m;c?m=(s-p.x)/(_.x-p.x):m=(a-p.y)/(_.y-p.y);let y=f.decodeHeight(d,o),b=f.decodeHeight(d,r),x=n.rectangle;XC.longitude=D.lerp(x.west,x.east,s),XC.latitude=D.lerp(x.south,x.north,a),u.height=XC.height=D.lerp(y,b,m);let T;if(f.hasVertexNormals){let C=f.getOctEncodedNormal(d,o,Uyt),A=f.getOctEncodedNormal(d,r,zyt),S=On.octDecode(C.x,C.y,xw),w=On.octDecode(A.x,A.y,Vyt);T=h.lerp(S,w,m,xw),h.normalize(T,T),On.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(XC,xw),On.octEncode(T,u.encodedNormal)}function fAe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(XC,xw);On.octEncode(s,r.encodedNormal)}function a5(e,t,n,i,o,r,s,a,c,u,f){if(lAe(e,t,a,s,!1,n,i,f)||lAe(e,t,u,c,!0,n,i,f))return f;let p;if(dQ(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],uQ(r,p,n,i,f),f;let _;if(n===0?i===0?_=c5(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):_=c5(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?_=c5(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):_=c5(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(_))return fAe(e,t,n,i,_,f),f}function c5(e,t,n,i,o,r,s,a){let c=cAe(e,t,!1,n,s,a),u=cAe(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function l5(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Gyt(e,t,n,i,o,r[u],s[u],a,c);return o}function Gyt(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ae.clone(r.rectangle,u5),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===yn.WEST&&r.x===0&&(u=ae.clone(r.rectangle,u5),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Sf),d=Sf.x,p=Sf.y);let _,m;switch(a){case yn.WEST:_=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:_=s.northIndicesWestToEast,m=!0;break;case yn.EAST:_=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:_=s.southIndicesEastToWest,m=!0;break}let y=r,b=e.tile,x=s.encoding,T=s.vertices,C=n.stride,A,S;x.hasWebMercatorT&&(A=Li.geodeticLatitudeToMercatorAngle(f.south),S=1/(Li.geodeticLatitudeToMercatorAngle(f.north)-A));for(let w=0;w<_.length;++w){let R=_[w],P=x.decodeTextureCoordinates(T,R,Sf);MB(y,b,P,P);let O=P.x,L=P.y,g=m?O:L;if(g<0||g>1||Math.abs(O-d)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let E=Math.abs(O)<D.EPSILON5||Math.abs(O-1)<D.EPSILON5,v=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(E&&v)continue;let I=x.decodePosition(T,R,xw),N=x.decodeHeight(T,R),F;x.hasVertexNormals?F=x.getOctEncodedNormal(T,R,cQ):(F=cQ,F.x=0,F.y=0);let U=L;if(x.hasWebMercatorT){let z=D.lerp(f.south,f.north,L);U=(Li.geodeticLatitudeToMercatorAngle(z)-A)*S}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,fQ)),n.encode(i,o*C,I,P,N,F,U,k),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++o}return o}function cAe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!dQ(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let _=p[n?0:p.length-1];if(l(_))return f.encoding.decodeHeight(f.vertices,_)}}function dQ(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function lAe(e,t,n,i,o,r,s,a){let c,u,f,d,p,_=i[o?0:n.length-1],m=n[o?0:n.length-1];if(dQ(_,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,Sf);let y=MB(_,e.tile,Sf,Sf);if(y.x===r&&y.y===s)return uQ(m,p,r,s,a),!0;if(d=Uo(c,u?r:s,function(b,x){m.encoding.decodeTextureCoordinates(m.vertices,b,Sf);let T=MB(_,e.tile,Sf,Sf);return f?u?T.x-r:T.y-s:u?r-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return Hyt(t,_,e.tile,m,c[d-1],c[d],r,s,u,a),!0}else return uQ(m,c[d],r,s,a),!0}return!1}var jyt=[new h,new h,new h,new h];function Wyt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=jyt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var Cw=Tw;function mr(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=xn.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 me,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(mr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(mr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(mr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(mr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new me,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 H(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ae.clone(ae.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(mr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=ie.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ss.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){vh.setOwner(e,this,"_clippingPolygons")}}});function qyt(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}mr.prototype.update=function(e){this._imageryLayers._update()};function Yyt(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)}}mr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(qyt)})),Yyt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)zd._freeVertexArray(t[i]);t.length=0};mr.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};mr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},blending:fn.ALPHA_BLEND});let s=Fe(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=Fe(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&Cw.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 u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;g0t(this,d,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function _Ae(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)}mr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)_Ae(t[n],e)};mr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};mr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};mr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===$n.CULLED_BUT_NEEDED,o=n.terrainState),zd.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)!==Er.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,zd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Xyt=new re,gAe=new ae,Kyt=new ae,$yt=new fe;function h5(e,t){if(t.west<t.east)return t;let n=ae.clone(t,Kyt);return ae.center(e,$yt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function yAe(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||!ae.equals(e.cartographicLimitRectangle,ae.MAX_VALUE))}mr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=yAe(this,t);if(t.fog.enabled&&!o&&D.fog(i,t.fog.density)>=1)return Er.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Er.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=h5(e.rectangle,this.cartographicLimitRectangle),f=ae.simpleIntersection(u,e.rectangle,gAe);if(!l(f))return Er.NONE;if(ae.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Xyt,re.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=re.union(s.boundingSphere,c,c))),!l(c))return Er.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let b=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=b!==Ht.INSIDE,b===Ht.OUTSIDE)return Er.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Ht.OUTSIDE}let _,m=a.computeVisibility(c);if(m===Ht.OUTSIDE?_=Er.NONE:m===Ht.INTERSECTING?_=Er.PARTIAL:m===Ht.INSIDE&&(_=Er.FULL),_===Er.NONE)return _;let y=t.mode===ne.SCENE3D&&t.camera.frustum instanceof cn;if(t.mode===ne.SCENE3D&&!y&&l(n)&&!o){let b=r.occludeePointInScaledSpace;return!l(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?_:Er.NONE}return _};mr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Zyt=[],Qyt=[];mr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Zyt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===go.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 d=s[a],p=d.loadingImagery,_=!l(p)||p.state===ui.FAILED||p.state===ui.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=_&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=Qyt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:$n.NONE;if(p===$n.RENDERED){let _=d.data;if(!l(_))continue;if(!o&&d.data.terrainState===go.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],b=y.loadingImagery,x=!l(b)||b.state===ui.FAILED||b.state===ui.INVALID,T=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(x&&!i[T])return!1}}else p===$n.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var Jyt=new h;mr.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=h.subtract(i.center,o,Jyt),a=h.magnitude(s);return a<D.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var dAe=new M,d5=new M,e0t=new ie,t0t=new ie,n0t=new ie,i0t=new h,hAe=new h,o0t=new h,r0t=new h;mr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var s0t=[new h,new h,new h,new h];function mAe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=s0t;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}mr.prototype.computeDistanceToTile=function(e,t){a0t(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function a0t(e,t,n){let i=e.data;i===void 0&&(i=e.data=new zd);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Ju({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,d=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(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)r.minimumHeight=d._minimumHeight,r.maximumHeight=d._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let _=p.data;if(_!==void 0){let m=_.mesh,y=_.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,_=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Or.getHeight(r.minimumHeight,p,_),r.maximumHeight=Or.getHeight(r.maximumHeight,p,_)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=In.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=re.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=mAe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=mAe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}mr.prototype.isDestroyed=function(){return!1};mr.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(),ce(this)};function c0t(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}mr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let _=c[a];if((_.readyImagery??_.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=c0t(d,e,n),s.state=_a.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=_a.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==$n.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};mr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};mr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};mr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var l0t=new M,u0t=new M;function pAe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=M.multiplyByPoint(i,this.properties.rtc,hAe);return M.setTranslation(i,o,dAe),dAe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,hAe);return M.setTranslation(i,r,d5),M.multiply(o,d5,d5),d5},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,l0t):M.IDENTITY;return M.inverseTranspose(o,u0t)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new ie(0,0,.5,1),fillHighlightColor:new H(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new V(65e5,9e6),nightFadeDistance:new V(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new M,tileRectangle:new ie,verticalExaggerationAndRelativeHeight:new V(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new V,southMercatorYAndOneOverHeight:new V,waterMask:void 0,waterMaskTranslationAndScale:new ie,minMaxHeight:new V,scaleAndBias:new M,clippingPlanesEdgeColor:H.clone(H.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ie,frontFaceAlphaByDistance:new ie,backFaceAlphaByDistance:new ie,localizedTranslucencyRectangle:new ie,undergroundColor:H.clone(H.TRANSPARENT),undergroundColorAlphaByDistance:new ie,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?ct(n,t.materialUniformMap):n}function f0t(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=d0t(e,r,o),i.wireframeVertexArray.mesh=o}}function d0t(e,t,n){let o={indices:n.indices,primitiveType:Le.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=st.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new qn({context:e,attributes:t._attributes,indexBuffer:s})}var bAe,xAe,m5;(function(){let e=new It({geometry:fh.fromDimensions({dimensions:new h(2,2,2)})}),t=new It({geometry:new hg({radius:1})}),n=new M,i,o;function r(s){return new Pn({geometryInstances:s,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})}bAe=function(s,a){return s===i||(m5(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},xAe=function(s,a){return s===i||(m5(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},m5=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var h0t=new ie(0,0,0,0),m0t={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},p0t=H.TRANSPARENT,_0t=new Vt;function g0t(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new Cw(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Gt=r.credits;for(let Pt=0,oo=Gt.length;Pt<oo;++Pt)o.addCreditToNextFrame(Gt[Pt])}let s=Lt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,_=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??p0t,b=e.undergroundColorAlphaByDistance??_0t,x=yAe(e,n)&&n.mode===ne.SCENE3D&&y.alpha>0&&(b.nearValue>0||b.farValue>0),T=e.lambertDiffuseMultiplier,C=e.vertexShadowDarkness,A=e.hasWaterMask&&l(a),S=A&&e.showWaterEffect,w=e.oceanNormalMap,R=S&&l(w),P=e.terrainProvider,O=l(P)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,g=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=xn.castShadows(e.shadows)&&!d,v=xn.receiveShadows(e.shadows)&&!d,I=e.hueShift,N=e.saturationShift,F=e.brightnessShift,U=!(D.equalsEpsilon(I,0,D.EPSILON7)&&D.equalsEpsilon(N,0,D.EPSILON7)&&D.equalsEpsilon(F,0,D.EPSILON7)),k=!1;if(g){let Gt=h.magnitude(n.camera.positionWC),Pt=e.nightFadeOutDistance;k=Gt>Pt}A&&--s,R&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let z=i.renderedMesh,B=z.center,j=z.encoding,W=i.tileBoundingRegion,J=n.verticalExaggeration,Y=n.verticalExaggerationRelativeHeight,ee=J!==1,Q=j.hasGeodeticSurfaceNormals,de=e0t,ge=0,le=0,ye=0,xe=0,Ie=!1;if(n.mode!==ne.SCENE3D){let Gt=n.mapProjection,Pt=Gt.project(ae.southwest(t.rectangle),o0t),oo=Gt.project(ae.northeast(t.rectangle),r0t);if(de.x=Pt.x,de.y=Pt.y,de.z=oo.x,de.w=oo.y,n.mode!==ne.MORPHING&&(B=i0t,B.x=0,B.y=(de.z+de.x)*.5,B.z=(de.w+de.y)*.5,de.x-=B.y,de.y-=B.z,de.z-=B.y,de.w-=B.z),n.mode===ne.SCENE2D&&j.quantization===ma.BITS12){let xt=1/(Math.pow(2,12)-1)*.5,Jo=(de.z-de.x)*xt,vr=(de.w-de.y)*xt;de.x-=Jo,de.y-=vr,de.z+=Jo,de.w+=vr}Gt instanceof Li&&(ge=t.rectangle.south,le=t.rectangle.north,ye=Li.geodeticLatitudeToMercatorAngle(ge),xe=1/(Li.geodeticLatitudeToMercatorAngle(le)-ye),Ie=!0)}let Te=m0t;Te.frameState=n,Te.surfaceTile=i,Te.hasWaterMask=A,Te.showReflectiveOcean=S,Te.showOceanWaves=R,Te.enableLighting=e.enableLighting,Te.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Te.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Te.showGroundAtmosphere=g,Te.atmosphereLightIntensity=e.atmosphereLightIntensity,Te.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Te.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Te.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Te.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Te.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Te.perFragmentGroundAtmosphere=k,Te.hasVertexNormals=O,Te.useWebMercatorProjection=Ie,Te.clippedByBoundaries=i.clippedByBoundaries,Te.hasGeodeticSurfaceNormals=Q,Te.hasExaggeration=ee;let ve=i.imagery,Ve=0,$e=ve.length,Ct=e.showSkirts&&!u&&!d,Jt=e.backFaceCulling&&!u&&!d,Qe=Jt?e._renderState:e._disableCullingRenderState,mn=Jt?e._blendRenderState:e._disableCullingBlendRenderState,Bt=Qe,Ot=e._firstPassInitialColor,Jn=n.context;if(l(e._debug.boundingSphereTile)||m5(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Gt=e._drawCommands.length;for(let Pt=0;Pt<Gt;++Pt)e._uniformMaps[Pt]=pAe(n,e)}do{let Gt=0,Pt,oo;if(e._drawCommands.length<=e._usedDrawCommands?(Pt=new qe,Pt.owner=t,Pt.cull=!1,Pt.boundingVolume=new re,Pt.orientedBoundingBox=void 0,oo=pAe(n,e),e._drawCommands.push(Pt),e._uniformMaps.push(oo)):(Pt=e._drawCommands[e._usedDrawCommands],oo=e._uniformMaps[e._usedDrawCommands]),Pt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ca=W.boundingVolume,ql=W.boundingSphere;l(Ca)?bAe(Ca,H.RED).update(n):l(ql)&&xAe(ql,H.RED).update(n)}let xt=oo.properties;ie.clone(Ot,xt.initialColor),xt.oceanNormalMap=w,xt.lightingFadeDistance.x=e.lightingFadeOutDistance,xt.lightingFadeDistance.y=e.lightingFadeInDistance,xt.nightFadeDistance.x=e.nightFadeOutDistance,xt.nightFadeDistance.y=e.nightFadeInDistance,xt.atmosphereLightIntensity=e.atmosphereLightIntensity,xt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,xt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,xt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,xt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,xt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,xt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let Jo=u?_:p,vr=u?p:_;l(Jo)&&(ie.fromElements(Jo.near,Jo.nearValue,Jo.far,Jo.farValue,xt.frontFaceAlphaByDistance),ie.fromElements(vr.near,vr.nearValue,vr.far,vr.farValue,xt.backFaceAlphaByDistance)),ie.fromElements(b.near,b.nearValue,b.far,b.farValue,xt.undergroundColorAlphaByDistance),H.clone(y,xt.undergroundColor),xt.lambertDiffuseMultiplier=T,xt.vertexShadowDarkness=C;let mc=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;mc&&H.clone(e.fillHighlightColor,xt.fillHighlightColor),xt.verticalExaggerationAndRelativeHeight.x=J,xt.verticalExaggerationAndRelativeHeight.y=Y,xt.center3D=z.center,h.clone(B,xt.rtc),ie.clone(de,xt.tileRectangle),xt.southAndNorthLatitude.x=ge,xt.southAndNorthLatitude.y=le,xt.southMercatorYAndOneOverHeight.x=ye,xt.southMercatorYAndOneOverHeight.y=xe;let Ur=t0t,Ms=h5(t.rectangle,e.cartographicLimitRectangle),Ue=n0t,ot=h5(t.rectangle,m);h.fromElements(I,N,F,xt.hsbShift);let Ye=t.rectangle,Ze=1/Ye.width,pt=1/Ye.height;Ur.x=(Ms.west-Ye.west)*Ze,Ur.y=(Ms.south-Ye.south)*pt,Ur.z=(Ms.east-Ye.west)*Ze,Ur.w=(Ms.north-Ye.south)*pt,ie.clone(Ur,xt.localizedCartographicLimitRectangle),Ue.x=(ot.west-Ye.west)*Ze,Ue.y=(ot.south-Ye.south)*pt,Ue.z=(ot.east-Ye.west)*Ze,Ue.w=(ot.north-Ye.south)*pt,ie.clone(Ue,xt.localizedTranslucencyRectangle);let qt=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;U=U&&(qt||g);let An=!1,Bo=!1,wo=!1,pc=!1,_c=!1,Ii=!1,xi=!1,Ta=!1,rs=!1,jl=!1;for(;Gt<s&&Ve<$e;){let Ca=ve[Ve],ql=Ca.readyImagery;if(++Ve,!l(ql)||ql.imageryLayer.alpha===0)continue;let tl=Ca.useWebMercatorT?ql.textureWebMercator:ql.texture,xs=ql.imageryLayer;l(Ca.textureTranslationAndScale)||(Ca.textureTranslationAndScale=xs._calculateTextureTranslationAndScale(t,Ca)),xt.dayTextures[Gt]=tl,xt.dayTextureTranslationAndScale[Gt]=Ca.textureTranslationAndScale,xt.dayTextureTexCoordsRectangle[Gt]=Ca.textureCoordinateRectangle,xt.dayTextureUseWebMercatorT[Gt]=Ca.useWebMercatorT,xt.dayTextureAlpha[Gt]=xs.alpha,Ii=Ii||xt.dayTextureAlpha[Gt]!==1,xt.dayTextureNightAlpha[Gt]=xs.nightAlpha,xi=xi||xt.dayTextureNightAlpha[Gt]!==1,xt.dayTextureDayAlpha[Gt]=xs.dayAlpha,xi=xi||xt.dayTextureDayAlpha[Gt]!==1,xt.dayTextureBrightness[Gt]=xs.brightness,An=An||xt.dayTextureBrightness[Gt]!==uc.DEFAULT_BRIGHTNESS,xt.dayTextureContrast[Gt]=xs.contrast,Bo=Bo||xt.dayTextureContrast[Gt]!==uc.DEFAULT_CONTRAST,xt.dayTextureHue[Gt]=xs.hue,wo=wo||xt.dayTextureHue[Gt]!==uc.DEFAULT_HUE,xt.dayTextureSaturation[Gt]=xs.saturation,pc=pc||xt.dayTextureSaturation[Gt]!==uc.DEFAULT_SATURATION,xt.dayTextureOneOverGamma[Gt]=1/xs.gamma,_c=_c||xt.dayTextureOneOverGamma[Gt]!==1/uc.DEFAULT_GAMMA,xt.dayTextureSplit[Gt]=xs.splitDirection,Ta=Ta||xt.dayTextureSplit[Gt]!==0;let Bf=xt.dayTextureCutoutRectangles[Gt];if(l(Bf)||(Bf=xt.dayTextureCutoutRectangles[Gt]=new ie),ie.clone(ie.ZERO,Bf),l(xs.cutoutRectangle)){let Wo=h5(Ye,xs.cutoutRectangle),ln=ae.simpleIntersection(Wo,Ye,gAe);rs=l(ln)||rs,Bf.x=(Wo.west-Ye.west)*Ze,Bf.y=(Wo.south-Ye.south)*pt,Bf.z=(Wo.east-Ye.west)*Ze,Bf.w=(Wo.north-Ye.south)*pt}let kf=xt.colorsToAlpha[Gt];l(kf)||(kf=xt.colorsToAlpha[Gt]=new ie);let Uf=l(xs.colorToAlpha)&&xs.colorToAlphaThreshold>0;if(jl=jl||Uf,Uf){let Wo=xs.colorToAlpha;kf.x=Wo.red,kf.y=Wo.green,kf.z=Wo.blue,kf.w=xs.colorToAlphaThreshold}else kf.w=-1;if(l(ql.credits)){let Wo=ql.credits;for(let ln=0,Ae=Wo.length;ln<Ae;++ln)o.addCreditToNextFrame(Wo[ln])}++Gt}xt.dayTextures.length=Gt,xt.waterMask=a,ie.clone(c,xt.waterMaskTranslationAndScale),xt.minMaxHeight.x=j.minimumHeight,xt.minMaxHeight.y=j.maximumHeight,M.clone(j.matrix,xt.scaleAndBias);let Ao=e._clippingPlanes,zr=l(Ao)&&Ao.enabled&&t.isClipped;zr&&(xt.clippingPlanesEdgeColor=H.clone(Ao.edgeColor,xt.clippingPlanesEdgeColor),xt.clippingPlanesEdgeWidth=Ao.edgeWidth);let Yp=e._clippingPolygons,ss=l(Yp)&&Yp.enabled&&t.isClipped;Te.numberOfDayTextures=Gt,Te.applyBrightness=An,Te.applyContrast=Bo,Te.applyHue=wo,Te.applySaturation=pc,Te.applyGamma=_c,Te.applyAlpha=Ii,Te.applyDayNightAlpha=xi,Te.applySplit=Ta,Te.enableFog=qt,Te.enableClippingPlanes=zr,Te.clippingPlanes=Ao,Te.enableClippingPolygons=ss,Te.clippingPolygons=Yp,Te.hasImageryLayerCutout=rs,Te.colorCorrect=U,Te.highlightFillTile=mc,Te.colorToAlpha=jl,Te.showUndergroundColor=x,Te.translucent=d;let Wl=i.renderedMesh.indices.length;Ct||(Wl=i.renderedMesh.indexCountWithoutSkirts),Pt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Te),Pt.castShadows=E,Pt.receiveShadows=v,Pt.renderState=Bt,Pt.primitiveType=Le.TRIANGLES,Pt.vertexArray=i.vertexArray||i.fill.vertexArray,Pt.count=Wl,Pt.uniformMap=oo,Pt.pass=Se.GLOBE,e._debug.wireframe&&(f0t(Jn,e,t),l(i.wireframeVertexArray)&&(Pt.vertexArray=i.wireframeVertexArray,Pt.primitiveType=Le.LINES,Pt.count=Wl*2));let gc=Pt.boundingVolume,jb=Pt.orientedBoundingBox;n.mode!==ne.SCENE3D?(re.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,W.minimumHeight,W.maximumHeight,gc),h.fromElements(gc.center.z,gc.center.x,gc.center.y,gc.center),n.mode===ne.MORPHING&&(gc=re.union(W.boundingSphere,gc,gc))):(Pt.boundingVolume=re.clone(W.boundingSphere,gc),Pt.orientedBoundingBox=In.clone(W.boundingVolume,jb)),Pt.dirty=!0,d&&f.updateDerivedCommands(Pt,n),_Ae(Pt,n),Bt=mn,Ot=h0t}while(Ve<$e)}var LB=mr;function TAe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ae.clone(ae.MAX_VALUE)}Object.defineProperties(TAe.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=Vt.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=Vt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ae.clone(ae.MAX_VALUE)),ae.clone(e,this._rectangle)}}});var NB=TAe;function Xs(){this._layers=[],this.layerAdded=new me,this.layerRemoved=new me,this.layerMoved=new me,this.layerShownOrHidden=new me}Object.defineProperties(Xs.prototype,{length:{get:function(){return this._layers.length}}});Xs.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()})};Xs.prototype.addImageryProvider=function(e,t){let n=new uc(e);return this.add(n,t),n};Xs.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};Xs.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=[]};Xs.prototype.contains=function(e){return this.indexOf(e)!==-1};Xs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Xs.prototype.get=function(e){return this._layers[e]};function p5(e,t){return e.indexOf(t)}function CAe(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Xs.prototype.raise=function(e){let t=p5(this._layers,e);CAe(this,t,t+1)};Xs.prototype.lower=function(e){let t=p5(this._layers,e);CAe(this,t,t-1)};Xs.prototype.raiseToTop=function(e){let t=p5(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))};Xs.prototype.lowerToBottom=function(e){let t=p5(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 y0t=new ae;function AAe(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];ae.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ae.contains(u.rectangle,t))continue;let d=y0t,p=1/1024;d.west=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ae.contains(d,t)&&i(u)}}Xs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(AAe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Xs.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(AAe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Xs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Xs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Xs.prototype.isDestroyed=function(){return!1};Xs.prototype.destroy=function(){return this.removeAll(!0),ce(this)};Xs.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 FB=Xs;function EAe(e){this._ellipsoid=new Cg(e.ellipsoid,h.ZERO)}Object.defineProperties(EAe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var BB=EAe;var hQ=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()}},b0t=1e3;function ga(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=$n.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new hQ(b0t),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ga.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 ga({tilingScheme:e,x:s,y:r,level:0});return i};var x0t=256;function T0t(e,t,n,i){let o=n.width/x0t*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}ga.prototype._getCacheKey=function(e,t){return T0t(e.longitude,e.latitude,this._rectangle,t)};ga.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};ga.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};ga.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};ga.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],ae.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],ae.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ga.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 ga({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 ga({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 ga({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 ga({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<_a.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});ga.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]};ga.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};ga.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};ga.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};ga.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};ga.prototype.freeResources=function(){this.clearPositionCache(),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),_5(this._southwestChild),this._southwestChild=void 0,_5(this._southeastChild),this._southeastChild=void 0,_5(this._northwestChild),this._northwestChild=void 0,_5(this._northeastChild),this._northeastChild=void 0};function _5(e){l(e)&&e.freeResources()}var kB=ga;function g5(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}g5.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};g5.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(),SAe(this,t)),t=i}};function SAe(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}g5.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))&&SAe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var UB=g5;function Hd(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 UB,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 BB({ellipsoid:n}),this._tileLoadProgressEvent=new me,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Hd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Hd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function C0t(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,wAe(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()}Hd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==_a.START&&e(t),t=t.replacementNext};Hd.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Hd.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};Hd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function wAe(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}Hd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(C0t(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),wAe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Hd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),v0t(this,e),F0t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function A0t(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=me.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))}Hd.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(O0t(this,e),N0t(this,e),A0t(this,e))};Hd.prototype.isDestroyed=function(){return!1};Hd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var VB,vAe=new fe;function E0t(e,t){let n=ae.center(e.rectangle,vAe),i=n.longitude-VB.longitude,o=n.latitude-VB.latitude;n=ae.center(t.rectangle,vAe);let r=n.longitude-VB.longitude,s=n.latitude-VB.latitude;return i*i+o*o-(r*r+s*s)}var S0t=new h,zB=[];function v0t(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 b=r.tilingScheme;e._levelZeroTiles=kB.createLevelZeroTiles(b);let x=e._levelZeroTiles.length;if(zB.length<x)for(zB=new Array(x),o=0;o<x;++o)zB[o]===void 0&&(zB[o]=new HB)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;VB=t.camera.positionCartographic,a.sort(E0t);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let _=t.camera;e._cameraPositionCartographic=_.positionCartographic;let m=M.getTranslation(_.transform,S0t);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?fc(e,s,r,t,c,!1,zB[o]):(ny(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function ny(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function HB(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function IAe(){this.southwest=new HB,this.southeast=new HB,this.northwest=new HB,this.northeast=new HB}IAe.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 pQ=new Array(31);for(let e=0;e<pQ.length;++e)pQ[e]=new IAe;function w0t(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=D0t(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:$n.NONE,_=e.tileProvider;if(s||i){let m=$n.originalResult(p)===$n.RENDERED,y=$n.originalResult(p)===$n.CULLED||p===$n.NONE,b=n.state===_a.DONE,x=m||y||b;if(x||l(_.canRenderWithoutLosingDetail)&&(x=_.canRenderWithoutLosingDetail(n)),x){s&&ny(e,e._tileLoadQueueMedium,n,t),y5(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&ny(e,e._tileLoadQueueHigh,n,t)}if(_.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){y5(e,n),ny(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.REFINED;let y=e._tilesToRender.length,b=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,C=e._tileToUpdateHeights.length;if(I0t(e,a,c,u,f,t,i,o),y!==e._tilesToRender.length){let A=o.allAreRenderable,S=o.anyWereRenderedLastFrame,w=o.notYetRenderableCount,R=!1;if(!A&&!S){let P=e._tilesToRender;for(let L=y;L<P.length;++L){let g=P[L];for(;g!==void 0&&g._lastSelectionResult!==$n.KICKED&&g!==n;)g._lastSelectionResult=$n.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=C,y5(e,n),n._lastSelectionResult=$n.RENDERED;let O=p===$n.RENDERED;!O&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=T,ny(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,R=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!R&&ny(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,y5(e,n),ny(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function I0t(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=pQ[t.level],p=d.southwest,_=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(fc(e,t,u,r,f,s,p),fc(e,n,u,r,f,s,_),fc(e,i,u,r,f,s,m),fc(e,o,u,r,f,s,y)):(fc(e,i,u,r,f,s,m),fc(e,t,u,r,f,s,p),fc(e,o,u,r,f,s,y),fc(e,n,u,r,f,s,_)):c.latitude<t.rectangle.north?(fc(e,n,u,r,f,s,_),fc(e,t,u,r,f,s,p),fc(e,o,u,r,f,s,y),fc(e,i,u,r,f,s,m)):(fc(e,o,u,r,f,s,y),fc(e,i,u,r,f,s,m),fc(e,n,u,r,f,s,_),fc(e,t,u,r,f,s,p)),d.combine(a)}function P0t(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ae.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ae.contains(n,e._cameraReferenceFrameOriginCartographic)}function fc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Er.NONE)return w0t(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,P0t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&ny(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:$n.NONE;c!==$n.CULLED_BUT_NEEDED&&c!==$n.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=$n.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(ny(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=$n.CULLED):t._lastSelectionResult=$n.CULLED;t._lastSelectionResultFrame=i.frameNumber}function D0t(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof cn||t.camera.frustum instanceof jr)return R0t(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=D.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function R0t(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function y5(e,t){e._tilesToRender.push(t)}function O0t(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=Si()+e._loadQueueTimeSlice,s=e._tileProvider,a=mQ(e,t,s,r,n,!1);a=mQ(e,t,s,r,i,a),mQ(e,t,s,r,o,a)}function M0t(e,t){return e._loadPriority-t._loadPriority}function mQ(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(M0t);for(let s=0,a=o.length;s<a&&(Si()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var Aw=new _n,b5=new fe,Ab=new h,L0t=[];function N0t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=L0t;n.length=0;let i=e._tileToUpdateHeights,o=Si(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let y=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:$n.NONE;(y===$n.RENDERED||y===$n.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,_=p.length,m=!1;for(f=e._lastTileIndex;f<_;++f){let y=p[f],b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>y.level&&!x){let T,C=d.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(C))T=C;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=h.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,Aw.direction),S=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,Aw.origin);if(!l(S)){let w=0;l(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(w,-11500),P=h.multiplyByScalar(A,Math.abs(R)+1,Ab);h.subtract(y.positionOnEllipsoidSurface,P,Aw.origin)}}else fe.clone(y.positionCartographic,b5),b5.height=-11500,c.project(b5,Ab),h.fromElements(Ab.z,Ab.x,Ab.y,Ab),h.clone(Ab,Aw.origin),h.clone(h.UNIT_X,Aw.direction);T=d.data.pick(Aw,a,c,!1,Ab),l(T)&&d.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,T)}if(l(T)){if(l(y.callback)){let A=u.cartesianToCartographic(T,b5);y.callback(A)}y.level=d.level}}if(Si()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function F0t(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 GB=Hd;function bm(e){e=e??te.default;let t=new vp({ellipsoid:e}),n=new FB;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new yB,this._material=void 0,this._surface=new GB({tileProvider:new LB({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new me,this._undergroundColor=H.clone(H.BLACK),this._undergroundColorAlphaByDistance=new Vt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new NB,gQ(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ee({url:on("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.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(bm.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=ae.clone(ae.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)&&gQ(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,gQ(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=H.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Vt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function gQ(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[wh,cw];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(_B),e._surfaceShaderSet.baseVertexShaderSource=new Be({sources:[wh,cw,gB],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Be({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function B0t(e){return function(t,n){let i=re.distanceSquaredTo(t.pickBoundingSphere,e),o=re.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var k0t=[],U0t={start:0,stop:0};bm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=k0t;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let _=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=_=re.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,_),h.fromElements(_.center.z,_.center.x,_.center.y,_.center);else if(l(p.renderedMesh))re.clone(p.tileBoundingRegion.boundingSphere,_);else continue;let m=ti.raySphere(e,_,U0t);l(m)&&s.push(p)}s.sort(B0t(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var z0t=new fe;bm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,z0t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var V0t=new h,PAe=new h,H0t=new fe,G0t=new _n;function _Q(e,t){return l(e)&&ae.contains(e.rectangle,t)?e:void 0}bm.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],!ae.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=_Q(n._southwestChild,e)||_Q(n._southeastChild,e)||_Q(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=h.fromRadians(e.longitude,e.latitude,0,a,V0t),u=G0t,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let _;l(n.data.tileBoundingRegion)&&(_=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(_??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,PAe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,PAe);if(l(p))return a.cartesianToCartographic(p,H0t).height};bm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};bm.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.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))};bm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};bm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};bm.prototype.isDestroyed=function(){return!1};bm.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(),ce(this)};var jB=bm;var Ew=`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 Sw=`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 yQ={position:0};function x5(e){e=e??G.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new re,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??$i.fromType($i.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 qe({owner:e._owner??this}),this._pickCommand=new qe({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 j0t(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ka.createGeometry(Ka.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY}));return t=qn.fromGeometry({context:e,geometry:n,attributeLocations:yQ,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}x5.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Ai.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?fn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=j0t(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.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}(!M.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),re.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Be({sources:[Sw]}),p=new Be({sources:[this.material.shaderSource,Ew]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:yQ}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=ct(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let _=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Se.TRANSLUCENT:Se.OPAQUE,_.push(f)),m.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)||u)&&(d=new Be({sources:[Sw]}),p=new Be({sources:[this.material.shaderSource,Ew],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Xt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:yQ}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=ct(ct(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Se.TRANSLUCENT:Se.OPAQUE,_.push(y)}};x5.prototype.isDestroyed=function(){return!1};x5.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(),ce(this)};var WB=x5;function qB(e){e=e??G.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=on("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new WB({radii:this.ellipsoid.radii,material:$i.fromType($i.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new aB}Object.defineProperties(qB.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var T5=new Z,W0t=new Z,q0t=new h,C5=[];qB.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,T5))||At.computeTemeToPseudoFixedMatrix(n,T5);let i=this._axes.evaluate(n,W0t);Z.transpose(i,i),Z.multiply(T5,i,i);let o=My.computeMoonPositionInEarthInertialFrame(n,q0t);Z.multiplyByVector(T5,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=C5,C5.length=0,t.update(e),e.commandList=r,C5.length===1?C5[0]:void 0};qB.prototype.isDestroyed=function(){return!1};qB.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ce(this)};var YB=qB;var XB=`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 KB(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(KB.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Y0t(e,t,n){let i=t.createViewportQuadCommand(XB,{framebuffer:n,renderState:ze.fromCache({viewport:new Xe(0,0,256,256)})});e._drawCommand=i}KB.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new dt({context:t,width:256,height:256,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST});this._colorTexture=n;let i=new Gr({context:t,colorTextures:[n],destroyAttachments:!1});Y0t(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};KB.prototype.isDestroyed=function(){return!1};KB.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ce(this)};var $B=KB;var MAe={};function X0t(e,t,n){let i,o,r;if(e instanceof Oi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof kl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var K0t=new h,DAe=new h;function LAe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-r)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(o){return D.lerp(e,t,o)}}function xQ(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,K0t),_=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),DAe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),DAe));r=Math.min(X0t(d,_,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return D.lerp(n,i,a)}}function ZB(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var NAe=new h;function $0t(e,t,n,i,o,r,s,a){let c=e.camera,u=h.clone(c.position,NAe),f=c.pitch,d=ZB(c.heading,i),p=ZB(c.roll,r),_=xQ(c,n,u.z,n.z,s),m=LAe(f,o,_,a);function y(b){let x=b.time/t;c.setView({orientation:{heading:D.lerp(d,i,x),pitch:m(x),roll:D.lerp(p,r,x)}}),V.lerp(u,n,x,c.position),c.position.z=_(x)}return y}function Z0t(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function Q0t(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var J0t=new fe,ebt=new fe;function tbt(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,_=fe.clone(f.positionCartographic,J0t),m=f.pitch,y=ZB(f.heading,i),b=ZB(f.roll,r),x=p.cartesianToCartographic(n,ebt);_.longitude=D.zeroToTwoPi(_.longitude),x.longitude=D.zeroToTwoPi(x.longitude);let T=!1;if(l(a)){let w=D.zeroToTwoPi(a),R=Math.min(_.longitude,x.longitude),P=Math.max(_.longitude,x.longitude),O=w>=R&&w<=P;if(l(c)){let L=Math.abs(_.longitude-x.longitude),g=D.TWO_PI-L;(O?L:g)<(O?g:L)*c&&!O&&(T=!0)}else O||(T=!0)}T?Z0t(_,x):Q0t(_,x);let C=xQ(f,n,_.height,x.height,s),A=LAe(m,o,C,u);function S(){let w=_.longitude,R=x.longitude,P=_.latitude,O=x.latitude;return function(g){let E=g.time/t,v=h.fromRadians(D.lerp(w,R,E),D.lerp(P,O,E),C(E),p);f.setView({destination:v,orientation:{heading:D.lerp(y,i,E),pitch:A(E),roll:D.lerp(b,r,E)}})}}return S()}function nbt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,NAe),u=ZB(a.heading,i),f=a.frustum.right-a.frustum.left,d=xQ(a,n,f,n.z,s);function p(_){let m=_.time/t;a.setView({orientation:{heading:D.lerp(u,i,m)}}),V.lerp(c,n,m,a.position);let y=d(m),b=a.frustum,x=b.top/b.right,T=(y-(b.right-b.left))*.5;b.right+=T,b.left-=T,b.top=x*b.right,b.bottom=-b.top}return p}var RAe=new fe,ibt=new h;function bQ(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function OAe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}MAe.createTween=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===ne.MORPHING)return bQ();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,RAe),n=r.project(RAe,ibt));let p=e.camera,_=t.endTransform;l(_)&&p._setTransform(_);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,b=t.pitch??-D.PI_OVER_TWO,x=t.roll??0,T=e.screenSpaceCameraController;T.enableInputs=!1;let C=OAe(T,t.complete),A=OAe(T,t.cancel),S=p.frustum,w=e.mode===ne.SCENE2D;if(w=w&&V.equalsEpsilon(p.position,n,D.EPSILON6),w=w&&D.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,D.EPSILON6),w=w||e.mode!==ne.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),w=w&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(x),D.negativePiToPi(p.roll),D.EPSILON10),w)return bQ(C,A);let R=new Array(4);if(R[ne.SCENE2D]=nbt,R[ne.SCENE3D]=tbt,R[ne.COLUMBUS_VIEW]=$0t,m<=0)return bQ(function(){R[i](e,1,n,y,b,x,a,c,u,f)({time:1}),typeof C=="function"&&C()},A);let P=R[i](e,m,n,y,b,x,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=os.CUBIC_OUT:d=os.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:P,complete:C,cancel:A}};var QB=MAe;var obt={ROTATE:0,INFINITE_SCROLL:1},Au=Object.freeze(obt);function nn(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Oi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new me,this._moveEnd=new me,this._changed=new me,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,GAe(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,tEe(this,nn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*nn.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}nn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);nn.TRANSFORM_2D_INVERSE=M.inverseTransformation(nn.TRANSFORM_2D,new M);nn.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-95,-20,-70,90);nn.DEFAULT_VIEW_FACTOR=.5;nn.DEFAULT_OFFSET=new Od(0,-D.PI_OVER_FOUR,0);function GAe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function rbt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Si()):e.timeSinceMoved=Math.max(Si()-e._lastMovedTimestamp,0)/1e3}}nn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};nn.prototype._updateCameraChanged=function(){let e=this;if(rbt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%D.TWO_PI;s=s>D.PI?D.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,_=e._changedPosition,m=e.frustum,y=e._changedFrustum,b=p.x+m.left,x=p.x+m.right,T=_.x+y.left,C=_.x+y.right,A=p.y+m.bottom,S=p.y+m.top,w=_.y+y.bottom,R=_.y+y.top,P=Math.max(b,T),O=Math.min(x,C),L=Math.max(A,w),g=Math.min(S,R),E;if(P>=O||L>=S)E=1;else{let v=y;b<T&&x>C&&A<w&&S>R&&(v=m),E=1-(O-P)*(g-L)/((v.right-v.left)*(v.top-v.bottom))}E>t&&(e._changed.raiseEvent(E),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function sbt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var abt=new fe,cbt=new h,A5=new h,lbt=new ie,ubt=new ie,fbt=new ie,dbt=new ie,hbt=new ie;function mbt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,lbt),o=n.cartesianToCartographic(i,abt),r=t.project(o,cbt),s=ubt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ie.clone(ie.UNIT_X,hbt),c=ie.add(M.getColumn(e._transform,0,A5),i,A5);n.cartesianToCartographic(c,o),t.project(o,r);let u=fbt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=dbt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=ie.add(M.getColumn(e._transform,1,A5),i,A5);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<D.EPSILON10&&(ie.clone(ie.UNIT_Y,u),ie.clone(ie.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var TQ=new h;function Zc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(nn.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?sbt(e):mbt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let _=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(_,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=TQ;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,TQ));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),b=h.dot(c,s)*y,x=h.multiplyByScalar(s,b,TQ);c=h.normalize(h.subtract(c,x,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(_,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=M.multiplyByPointAsVector(_,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=M.multiplyByPointAsVector(_,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&GAe(e)}function jAe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function WAe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function qAe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var v5=new M,w5=new M;Object.defineProperties(nn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Zc(this),this._invTransform}},viewMatrix:{get:function(){return Zc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Zc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Zc(this),this._positionCartographic}},positionWC:{get:function(){return Zc(this),this._positionWC}},directionWC:{get:function(){return Zc(this),this._directionWC}},upWC:{get:function(){return Zc(this),this._upWC}},rightWC:{get:function(){return Zc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,v5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,w5);this._setTransform(n);let i=jAe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,v5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,w5);this._setTransform(n);let i=WAe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,v5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,w5);this._setTransform(n);let i=qAe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});nn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.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===ne.SCENE2D&&$Ae(this,this.position)};var pbt=new h,_bt=new h,gbt=new h;nn.prototype._setTransform=function(e){let t=h.clone(this.positionWC,pbt),n=h.clone(this.upWC,_bt),i=h.clone(this.directionWC,gbt);M.clone(e,this._transform),this._transformChanged=!0,Zc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Zc(this)};var ybt=new V,bbt=new _n,xbt=new h,Tbt=new h;function YAe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=ybt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,bbt);o=n.pickWorldCoordinates(a,t,!0,xbt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Tbt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}nn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof cn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=YAe(this)))};var I5=new h,vQ=new M,Cbt=new M,wQ=new Pe,IQ=new Z,XAe=new fe;function Abt(e,t,n){let i=M.clone(e.transform,vQ),o=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Cbt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,wQ),s=Z.fromQuaternion(r,IQ);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Ebt(e,t,n,i){let o=M.clone(e.transform,vQ);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,XAe);t=a.project(c,I5)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,wQ),s=Z.fromQuaternion(r,IQ);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Sbt(e,t,n,i){let o=M.clone(e.transform,vQ);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,XAe);t=c.project(u,I5)}V.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===Au.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let r=Pe.fromHeadingPitchRoll(n,wQ),s=Z.fromQuaternion(r,IQ);Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var vbt=new h,wbt=new h,Ibt=new h;function KAe(e,t,n,i){let o=h.clone(n.direction,vbt),r=h.clone(n.up,wbt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,v5),u=M.inverseTransformation(c,w5);M.multiplyByPointAsVector(u,o,o),M.multiplyByPointAsVector(u,r,r)}let s=h.cross(o,r,Ibt);return i.heading=jAe(o,r),i.pitch=WAe(o),i.roll=qAe(o,r,s),i}var SQ={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},vw=new qa;nn.prototype.setView=function(e){e=e??G.EMPTY_OBJECT;let t=e.orientation??G.EMPTY_OBJECT,n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,I5);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,I5),i=!1),l(t.direction)&&(t=KAe(this,o,t,SQ.orientation)),vw.heading=t.heading??0,vw.pitch=t.pitch??-D.PI_OVER_TWO,vw.roll=t.roll??0,n===ne.SCENE3D?Abt(this,o,vw):n===ne.SCENE2D?Sbt(this,o,vw,i):Ebt(this,o,vw,i)};var Pbt=new h;nn.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:nn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(nn.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*nn.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,Pbt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};nn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ie),Zc(this),M.multiplyByVector(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};nn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ie),Zc(this),M.multiplyByVector(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPoint(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function $Ae(e,t){let n=e._scene.mapMode2D===Au.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 FAe=new h;nn.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,FAe),h.add(n,FAe,n),this._mode===ne.SCENE2D&&$Ae(this,n),this._adjustOrthographicFrustum(!0)};nn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===ne.SCENE2D?P5(this,e):this.move(this.direction,e)};nn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===ne.SCENE2D?P5(this,-e):this.move(this.direction,-e)};nn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};nn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};nn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};nn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};nn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.up,-e)};nn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.up,e)};nn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.right,-e)};nn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Dbt=new Pe,Rbt=new Z;nn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Pe.fromAxisAngle(e,-n,Dbt),o=Z.fromQuaternion(i,Rbt),r=this.direction,s=this.up,a=this.right;Z.multiplyByVector(o,r,r),Z.multiplyByVector(o,s,s),Z.multiplyByVector(o,a,a)};nn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};nn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var Obt=new Pe,Mbt=new Z;nn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Pe.fromAxisAngle(e,-n,Obt),o=Z.fromQuaternion(i,Mbt);Z.multiplyByVector(o,this.position,this.position),Z.multiplyByVector(o,this.direction,this.direction),Z.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};nn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,ZAe(this,e)};nn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,ZAe(this,-e)};var Lbt=new h,Nbt=new h,Fbt=new h,BAe=new h;function ZAe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,Lbt),o=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,BAe),D.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,Nbt),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,BAe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,Fbt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}nn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,QAe(this,-e)};nn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,QAe(this,e)};function QAe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function P5(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===Au.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===Au.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 JAe(e,t){e.move(e.direction,t)}nn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===ne.SCENE2D?P5(this,e):JAe(this,e)};nn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===ne.SCENE2D?P5(this,-e):JAe(this,-e)};nn.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return h.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Bbt=new M;nn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=At.eastNorthUpToFixedFrame(e,i,Bbt);this.lookAtTransform(o,t)};var kbt=new h,Ubt=new Pe,zbt=new Pe,Vbt=new Z;function eEe(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Pe.fromAxisAngle(h.UNIT_Y,-t,Ubt),o=Pe.fromAxisAngle(h.UNIT_Z,-e,zbt),r=Pe.multiply(o,i,o),s=Z.fromQuaternion(r,Vbt),a=h.clone(h.UNIT_X,kbt);return Z.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}nn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=eEe(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){V.clone(V.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(M.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<D.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var JB=new fe,Hbt=new fe,Gbt=new h,jbt=new h,Wbt=new h,qbt=new h,Ybt=new h,Xbt=new h,Kbt=new h,CQ=new h,$bt={direction:new h,right:new h,up:new h},kAe;function $c(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function tEe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:$bt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let O=JB;O.longitude=f,O.latitude=s,O.height=0;let L=Hbt;L.longitude=f,L.latitude=a,L.height=0;let g=kAe;(!l(g)||g.ellipsoid!==o)&&(kAe=g=new m_(void 0,void 0,o)),g.setEndPoints(O,L),d=g.interpolateUsingFraction(.5,JB).latitude}let p=JB;p.longitude=f,p.latitude=d,p.height=0;let _=o.cartographicToCartesian(p,Kbt),m=JB;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,Gbt);m.longitude=c;let b=o.cartographicToCartesian(m,Wbt);m.longitude=f;let x=o.cartographicToCartesian(m,Ybt);m.latitude=a;let T=o.cartographicToCartesian(m,Xbt);m.longitude=u;let C=o.cartographicToCartesian(m,qbt);m.longitude=c;let A=o.cartographicToCartesian(m,jbt);h.subtract(b,_,b),h.subtract(C,_,C),h.subtract(y,_,y),h.subtract(A,_,A),h.subtract(x,_,x),h.subtract(T,_,T);let S=o.geodeticSurfaceNormal(_,r.direction);h.negate(S,S);let w=h.cross(S,h.UNIT_Z,r.right);h.normalize(w,w);let R=h.cross(w,S,r.up),P;if(e.frustum instanceof cn){let O=Math.max(h.distance(y,b),h.distance(C,A)),L=Math.max(h.distance(y,C),h.distance(b,A)),g,E,v=e.frustum._offCenterFrustum,I=v.right/v.top,N=L*I;O>N?(g=O,E=g/I):(E=L,g=N),P=Math.max(g,E)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(P=Math.max($c(S,R,b,O),$c(S,R,C,O),$c(S,R,y,O),$c(S,R,A,O),$c(S,R,x,O),$c(S,R,T,O),$c(S,w,b,L),$c(S,w,C,L),$c(S,w,y,L),$c(S,w,A,L),$c(S,w,x,L),$c(S,w,T,L)),a<0&&s>0){let g=JB;g.longitude=c,g.latitude=0,g.height=0;let E=o.cartographicToCartesian(g,CQ);h.subtract(E,_,E),P=Math.max(P,$c(S,R,E,O),$c(S,w,E,L)),g.longitude=u,E=o.cartographicToCartesian(g,CQ),h.subtract(E,_,E),P=Math.max(P,$c(S,R,E,O),$c(S,w,E,L))}}return h.add(_,h.multiplyByScalar(S,-P,CQ),n)}var Zbt=new fe,Qbt=new h,Jbt=new h;function ext(e,t,n){let i=e._projection;t.west>t.east&&(t=ae.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Zbt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Qbt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Jbt);if(M.multiplyByPoint(o,c,c),M.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var txt=new fe,nxt=new h,ixt=new h;function oxt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Au.INFINITE_SCROLL?o+=D.TWO_PI:(t=ae.MAX_VALUE,o=t.east));let r=txt;r.longitude=o,r.latitude=t.north;let s=i.project(r,nxt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,ixt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,_=u*p;return c>_?(f=c,d=f/p):(d=u,f=_),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}nn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ne.SCENE3D)return tEe(this,e,t);if(n===ne.COLUMBUS_VIEW)return ext(this,e,t);if(n===ne.SCENE2D)return oxt(this,e,t)};var rxt=new _n;function sxt(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,rxt),r=ti.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return _n.getPoint(o,s,i)}var axt=new _n;function cxt(e,t,n,i){let r=e.getPickRay(t,axt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var lxt=new _n;function uxt(e,t,n,i){let o=e.getPickRay(t,lxt),r=-o.origin.x/o.direction.x;_n.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}nn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??te.default,this._mode===ne.SCENE3D)n=sxt(this,e,t,n);else if(this._mode===ne.SCENE2D)n=cxt(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=uxt(this,e,this._projection,n);else return;return n}};var fxt=new h,dxt=new h,hxt=new h;function mxt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,fxt);h.add(d,p,p);let _=h.multiplyByScalar(e.rightWC,u*c*a,dxt),m=h.multiplyByScalar(e.upWC,f*c*s,hxt),y=h.add(p,_,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var E5=new h;function pxt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,E5),h.add(E5,f,f),h.multiplyByScalar(e.upWC,u,E5),h.add(E5,f,f),h.clone(e.directionWC,n.direction),n}nn.prototype.getPickRay=function(e,t){l(t)||(t=new _n);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)?mxt(this,e,t):pxt(this,e,t)};var _xt=new h,gxt=new h;nn.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,_xt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),gxt);return Math.max(0,h.magnitude(n)-e.radius)};var yxt=new V;nn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,yxt);return Math.max(o.x,o.y)};function bxt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:os.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var xxt=new h,UAe=new h,Txt=new h,Cxt=new h;function Axt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,xxt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,UAe),UAe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Txt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,Cxt)),f=c*u,d=a*u,p=e._maxCoord.x,_=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-_,_);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let b=s.y<-m||s.y>m,x=s.z<-y||s.z>y;if(b||x)return bxt(e,n,s,m,y,t)}}nn.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Axt(this,e)};var Ext=new h,ya={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};nn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};nn.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=ya.destination,e.orientation.heading=ya.heading,e.orientation.pitch=ya.pitch,e.orientation.roll=ya.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};nn.prototype.flyTo=function(e){e=e??G.EMPTY_OBJECT;let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ae;i&&(t=this.getRectangleCameraCoordinates(t,Ext));let o=e.orientation??G.EMPTY_OBJECT;if(l(o.direction)&&(o=KAe(this,t,o,SQ.orientation)),l(e.duration)&&e.duration<=0){let f=SQ;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;ya.destination=t,ya.heading=o.heading,ya.pitch=o.pitch,ya.roll=o.roll,ya.duration=e.duration,ya.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ya.cancel=e.cancel,ya.endTransform=e.endTransform,ya.convert=i?!1:e.convert,ya.maximumHeight=e.maximumHeight,ya.pitchAdjustHeight=e.pitchAdjustHeight,ya.flyOverLongitude=e.flyOverLongitude,ya.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ya.easingFunction=e.easingFunction;let a=this._scene,c=QB.createTween(a,ya);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=nn.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Sxt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function vxt(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 wxt=100;function nEe(e,t,n){n=Od.clone(l(n)?n:nn.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=wxt:e.frustum instanceof cn||e._mode===ne.SCENE2D?n.range=vxt(e,s):n.range=Sxt(e,s),n.range=D.clamp(n.range,i,o)}return n}nn.prototype.viewBoundingSphere=function(e,t){t=nEe(this,e,t),this.lookAt(e.center,t)};var Ixt=new M,Pxt=new h,Dxt=new h,Rxt=new h,Oxt=new h,Mxt=new ie,Lxt=new Pe,Nxt=new Z;nn.prototype.flyToBoundingSphere=function(e,t){t=t??G.EMPTY_OBJECT;let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=nEe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,Pxt):o=eEe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??te.default,a=At.eastNorthUpToFixedFrame(e.center,s,Ixt);M.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=h.subtract(e.center,o,Dxt),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,Rxt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Pe.fromAxisAngle(c,i.heading,Lxt),p=Z.fromQuaternion(d,Nxt);h.fromCartesian4(M.getColumn(a,1,Mxt),u),Z.multiplyByVector(p,u,u)}let f=h.cross(c,u,Oxt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var zAe=new h,VAe=new h,AQ=new h,HAe=new h,e3=[new h,new h,new h,new h];function Fxt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,zAe),r=h.magnitude(o),s=h.normalize(o,VAe),a,c;h.equalsEpsilon(s,h.UNIT_Z,D.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,AQ),AQ),c=h.normalize(h.cross(s,a,HAe),HAe));let u=Math.sqrt(h.magnitudeSquared(o)-1),f=h.multiplyByScalar(s,1/r,zAe),d=u/r,p=h.multiplyByScalar(a,d,VAe),_=h.multiplyByScalar(c,d,AQ),m=h.add(f,_,e3[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,_,e3[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let b=h.subtract(f,_,e3[2]);h.add(b,p,b),h.multiplyComponents(n,b,b);let x=h.add(f,_,e3[3]);return h.add(x,p,x),h.multiplyComponents(n,x,x),e3}var EQ=new V,Bxt=new h,Eb=[new fe,new fe,new fe,new fe];function S5(e,t,n,i,o,r){EQ.x=e,EQ.y=t;let s=i.pickEllipsoid(EQ,o,Bxt);return l(s)?(Eb[n]=o.cartesianToCartographic(s,Eb[n]),1):(Eb[n]=o.cartesianToCartographic(r[n],Eb[n]),0)}nn.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new re(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Ht.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=Fxt(this,e);if(c+=S5(0,0,0,this,e,u),c+=S5(0,a,1,this,e,u),c+=S5(s,a,2,this,e,u),c+=S5(s,0,3,this,e,u),c<2)return ae.MAX_VALUE;t=ae.fromCartographicArray(Eb,t);let f=0,d=Eb[3].longitude;for(let p=0;p<4;++p){let _=Eb[p].longitude,m=Math.abs(_-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=_}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,Eb[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};nn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Oi)return;let e=this._scene;this.frustum=new Oi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};nn.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof cn)return;let e=YAe(this),t=this._scene;this.frustum=new cn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};nn.clone=function(e,t){return l(t)||(t=new nn(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var uo=nn;function kxt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Gd=kxt;var aEe=er(Ru(),1),iEe=576,Uxt=100,t3="#ffffff",D5="#48b";function cEe(e,t){this.credit=e,this.count=t??1}function zxt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(_t.equals(o,t))return!0}return!1}function Vxt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;_t.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var lEe="cesium-credit-delimiter";function oEe(e){let t=document.createElement("span");return t.textContent=e,t.className=lEe,t}function rEe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function sEe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(oEe(n));else{let f=o[u];f.className!==lEe&&e.replaceChild(oEe(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(rEe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(rEe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Hxt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<iEe?(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>=iEe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Gxt(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: ${t3}; - position: relative; - min-height: ${Uxt}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: ${t3}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${D5}; -} -.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: ${t3}; -} -.cesium-credit-lightbox-close:hover { - color: ${D5}; -} -.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: ${t3}; -} -.cesium-credit-expand-link:hover { - color: ${D5}; -} - -.cesium-credit-text { - color: ${t3}; -} - -.cesium-credit-delimiter { - padding: 0 5px; -} - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; -} - -.cesium-credit-textContainer a:hover { - color: ${D5} -} - -.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 Sr(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(m){r.contains(m.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 u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Gxt(e);let _=_t.clone(Sr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=_,this._previousCesiumCredit=void 0,this._currentCesiumCredit=_,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new wt,lightboxCredits:new wt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function uEe(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 cEe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Sr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=_t.clone(fEe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,uEe(this,t,e)};Sr.prototype.addStaticCredit=function(e){let t=this._staticCredits;zxt(t,e)||t.push(e)};Sr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Sr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Sr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Sr.prototype.update=function(){this._expanded&&Hxt(this)};Sr.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()&&_t.equals(Sr.cesiumCredit,this._cesiumCredit)||uEe(this,s,r,Number.MAX_VALUE)}_t.equals(Sr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=_t.clone(Sr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Sr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;sEe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",sEe(this._creditList,t,void 0,"li"),Vxt(this)};Sr.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),ce(this)};Sr.prototype.isDestroyed=function(){return!1};Sr._cesiumCredit=void 0;Sr._cesiumCreditInitialized=!1;var R5;function fEe(){if(!l(R5)){let e=on("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new aEe.default(e).path()),R5=new _t(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Sr._cesiumCreditInitialized||(Sr._cesiumCredit=R5,Sr._cesiumCreditInitialized=!0),R5}Object.defineProperties(Sr,{cesiumCredit:{get:function(){return fEe(),Sr._cesiumCredit},set:function(e){Sr._cesiumCredit=e,Sr._cesiumCreditInitialized=!0}}});Sr.CreditDisplayElement=cEe;var n3=Sr;function O5(e){e=e??G.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??H.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var jxt=new h,Wxt=new Z,qxt=new Pe,Yxt=new Oi,Xxt=new kl,Kxt=new cn,$xt=new jr,Zxt=new H,Qxt=[1,1e5];O5.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 Oi?a=Yxt:s instanceof kl?a=Xxt:s instanceof cn?a=Kxt:a=$xt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Qxt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,_=r.rightWC;_=h.negate(_,jxt);let m=Wxt;Z.setColumn(m,0,_,m),Z.setColumn(m,1,p,m),Z.setColumn(m,2,d,m);let y=Pe.fromRotationMatrix(m,qxt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Pn({geometryInstances:new It({geometry:new FC({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(H.fromAlpha(this._color,.1,Zxt))},id:this.id,pickPrimitive:this}),appearance:new un({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Pn({geometryInstances:new It({geometry:new nB({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};O5.prototype.isDestroyed=function(){return!1};O5.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 ce(this)};var Rp=O5;var i3=`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 o3=`in vec4 position; - -out vec4 positionEC; - -void main() -{ - positionEC = czm_modelView * position; - gl_Position = czm_projection * positionEC; - - czm_vertexLogDepth(); -} -`;function s3(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 r3=Nt.supportsTypedArrays()?new Float32Array(12):[],dEe=new h,hEe=new h,PQ=new h,mEe=new h,M5=new h;function Jxt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof cn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,dEe),_=h.normalize(p,hEe),m=h.normalize(h.cross(h.UNIT_Z,p,PQ),PQ),y=h.normalize(h.cross(_,m,mEe),mEe),b=h.magnitude(p),x=Math.sqrt(b*b-1);o=h.multiplyByScalar(_,1/b,dEe);let T=x/b;r=h.multiplyByScalar(m,T,hEe),s=h.multiplyByScalar(y,T,PQ)}let a=h.add(o,s,M5);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,r3,0);let c=h.subtract(o,s,M5);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,r3,3);let u=h.add(o,s,M5);h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,r3,6);let f=h.subtract(o,s,M5);return h.add(f,r,f),h.multiplyComponents(n,f,f),h.pack(f,r3,9),r3}s3.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new qe({renderState:this._rs,boundingVolume:new re(h.ZERO,i.maximumRadius),pass:Se.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Be({sources:[o3]}),a=new Be({sources:[i3]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Xt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Jxt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new lt({attributes:{position:new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Le.TRIANGLES});this._va=qn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};s3.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};s3.prototype.isDestroyed=function(){return!1};s3.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var a3=s3;function Iw(){}var eTt=/\bgl_FragDepth\b/,tTt=/\bdiscard\b/;function nTt(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(eTt.test(r[a])||tTt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() -{ - out_FragColor = vec4(1.0); -} -`;i=new Be({sources:[a]})}else if(!o&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new Be({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function iTt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}Iw.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=qe.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=nTt(n,t.shaderProgram),i.depthOnlyCommand.renderState=iTt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var oTt=/\s+czm_writeLogDepth\(/,rTt=/\s+czm_vertexLogDepth\(/;function sTt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(rTt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Be.replaceMain(c[d],"czm_log_depth_main");c.push(` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)oTt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Be.replaceMain(c[f],"czm_log_depth_main");u=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}Iw.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=sTt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function aTt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(_=>_.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () -{ - czm_non_pick_main(); - if (${c}.a == 0.0) { - discard; - } - ${c} = ${n}; -} `,f=r.length,d=new Array(f+1);for(let _=0;_<f;++_)d[_]=Be.replaceMain(r[_],"czm_non_pick_main");d[f]=u;let p=new Be({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function pEe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}Iw.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=qe.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=aTt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=pEe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function ww(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 _Ee(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function cTt(e){let t=_Ee(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function gEe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function yEe(e,t){let n=Ft.getMaximum(t);return`(${e}) / float(${n})`}function lTt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=gEe(n,i,o)}return e.normalized||(n=yEe(n,e.componentType)),n}function uTt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=gEe(o,r,s)}return e.normalized||(o=yEe(o,e.componentType)),o}function fTt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=cTt(u),d=["0.0","0.0","0.0","0.0"],p=_Ee(u);if(p===1)d[0]=lTt(u,c);else{let b=["x","y","z","w"];for(let x=0;x<p;x++)d[x]=uTt(u,c,b[x])}let _=t.fragmentShaderSource.defines.slice();_.push(Xu.METADATA_PICKING_ENABLED),ww(_,Xu.METADATA_PICKING_VALUE_TYPE,f),ww(_,Xu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),ww(_,Xu.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),ww(_,Xu.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),ww(_,Xu.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),ww(_,Xu.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Be({sources:t.fragmentShaderSource.sources,defines:_});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}Iw.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=fTt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=pEe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function dTt(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})}Iw.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=dTt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Op=Iw;function L5(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(o),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var hTt=new Pe,bEe=new Pe,mTt=new Z;function pTt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Pe.fromAxisAngle(o,n,bEe),c=Pe.fromAxisAngle(r,i,hTt),u=Pe.multiply(c,a,c),f=Pe.fromAxisAngle(s,t,bEe);Pe.multiply(f,u,u);let d=Z.fromQuaternion(u,mTt);Z.multiplyByVector(d,r,r),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,o,o)}L5.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;pTt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};L5.prototype.isDestroyed=function(){return!1};L5.prototype.destroy=function(){return this._removeListener(),ce(this)};var c3=L5;function DQ(){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(DQ.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var _Tt=new h;DQ.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!==ne.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,_Tt),a=Math.abs(h.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 l3=DQ;function gTt(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=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.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 u3=gTt;var ka={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},KC=ka.DERIVED_COMMANDS_MAXIMUM_LENGTH,PEe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function $C(){this._frontFaceAlphaByDistance=new Vt(0,1,0,1),this._backFaceAlphaByDistance=new Vt(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=ae.clone(ae.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(KC),this._derivedBlendCommandTypes=new Array(KC),this._derivedPickCommandTypes=new Array(KC),this._derivedCommandTypesToUpdate=new Array(KC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties($C.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}}});$C.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=xEe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=xEe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=TEe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=TEe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=TTt(this,e,t),this._sunVisibleThroughGlobe=yTt(this,e),this._environmentVisible=bTt(this,e),this._useDepthPlane=xTt(this,e),this._numberOfTextureUniforms=CTt(this),this._rectangle=ae.clone(t.translucency.rectangle,this._rectangle),ATt(this,e)};function xEe(e,t,n,i){return e?l(n)?(Vt.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 TEe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function yTt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function bTt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function xTt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function TTt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function CTt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function ATt(e,t){e._derivedCommandsLength=RQ(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=RQ(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=RQ(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<KC;++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=kTt())}function RQ(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ka.PICK_FRONT_FACE:u?ka.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ka.TRANSLUCENT_FRONT_FACE,d=i?ka.PICK_BACK_FACE:u?ka.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ka.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=ka.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ka.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=ka.DEPTH_ONLY_BACK_FACE),o[r++]=ka.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=ka.DEPTH_ONLY_FRONT_FACE),o[r++]=ka.OPAQUE_BACK_FACE,o[r++]=f),r)}function jd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function CEe(e,t){return e.indexOf(t)>-1}function ETt(e,t){jd(e.defines,"TRANSLUCENT"),jd(t.defines,"TRANSLUCENT")}function STt(e,t){jd(e.defines,"GROUND_ATMOSPHERE"),jd(t.defines,"GROUND_ATMOSPHERE"),jd(e.defines,"FOG"),jd(t.defines,"FOG"),jd(e.defines,"TRANSLUCENT"),jd(t.defines,"TRANSLUCENT")}function OQ(e,t){if(CEe(t.defines,"TILE_LIMIT_RECTANGLE")||CEe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function MQ(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Be.replaceMain(n[r],"czm_globe_translucency_main");n.push(` - -uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; -#ifdef MANUAL_DEPTH_TEST - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - if (logDepthOrDepth != 0.0) - { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } - } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) - { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; - } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`)}function DEe(e,t){MQ(e,t),jd(e.defines,"GROUND_ATMOSPHERE"),jd(t.defines,"GROUND_ATMOSPHERE"),jd(e.defines,"FOG"),jd(t.defines,"FOG")}function vTt(e,t){MQ(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function wTt(e,t){DEe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function AEe(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 ITt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function PTt(e){e.cull.face=Ai.BACK,e.cull.enabled=!0}function DTt(e){e.cull.face=Ai.FRONT,e.cull.enabled=!0}function RTt(e){e.cull.face=Ai.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function OTt(e){e.cull.face=Ai.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function MTt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function EEe(e){e.cull.face=Ai.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function SEe(e){e.cull.face=Ai.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function LTt(e){e.cull.face=Ai.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function NTt(e){e.cull.face=Ai.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function FTt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function Pw(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function BTt(e,t,n,i,o){return l(o)?!i&&l(n)?n:ct(t,o(e),!1):t}function xm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function kTt(){return[new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:ETt,getRenderStateFunction:PTt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:STt,getRenderStateFunction:DTt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:OQ,getRenderStateFunction:RTt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:OQ,getRenderStateFunction:OTt,getUniformMapFunction:void 0}),new xm({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:OQ,getRenderStateFunction:MTt,getUniformMapFunction:void 0}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:MQ,getRenderStateFunction:EEe,getUniformMapFunction:Pw}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:DEe,getRenderStateFunction:SEe,getUniformMapFunction:Pw}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vTt,getRenderStateFunction:EEe,getUniformMapFunction:Pw}),new xm({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wTt,getRenderStateFunction:SEe,getUniformMapFunction:Pw}),new xm({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:AEe,getRenderStateFunction:LTt,getUniformMapFunction:Pw}),new xm({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:AEe,getRenderStateFunction:NTt,getUniformMapFunction:Pw})]}var vEe=new Array(KC),wEe=new Array(KC);$C.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)wEe[o]=this._derivedCommandPacks[n[o]],vEe[o]=PEe[n[o]];UTt(this,e,i,n,vEe,wEe,t)}};function UTt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,_=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;_&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let x=r[b],T=i[b],C=o[b],A=a[C],S,w,R;l(A)?(S=A.uniformMap,w=A.shaderProgram,R=A.renderState):(S=void 0,w=void 0,R=void 0),A=qe.shallowClone(t,A),a[C]=A;let P=A.derivedCommands.uniformMapDirtyFrame??0,O=A.derivedCommands.shaderProgramDirtyFrame??0,L=A.derivedCommands.renderStateDirtyFrame??0,g=_||P<f,E=m||O<d,v=y||L<p;g&&(A.derivedCommands.uniformMapDirtyFrame=u),E&&(A.derivedCommands.shaderProgramDirtyFrame=u),v&&(A.derivedCommands.renderStateDirtyFrame=u),A.derivedCommands.type=T,A.pass=x.pass,A.pickOnly=x.pickOnly,A.uniformMap=BTt(e,t.uniformMap,S,g,x.getUniformMapFunction),A.shaderProgram=ITt(s.context,t.shaderProgram,w,E,x.getShaderProgramFunction,C),A.renderState=FTt(t.renderState,R,v,x.getRenderStateFunction,x.renderStateCache)}}}$C.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=PEe[o[a]];n.commandList.push(s[c])}};function REe(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 IEe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var zTt=[ka.OPAQUE_FRONT_FACE,ka.OPAQUE_BACK_FACE],VTt=[ka.DEPTH_ONLY_FRONT_FACE,ka.DEPTH_ONLY_BACK_FACE,ka.DEPTH_ONLY_FRONT_AND_BACK_FACE];$C.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),REe(s,a,t,i,o,zTt))};$C.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Se.GLOBE],c=e.indices[Se.GLOBE],u=e.commands[Se.TERRAIN_CLASSIFICATION],f=e.indices[Se.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&IEe(u,f,t,i,o),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let _=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,REe(a,c,t,i,o,VTt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}IEe(u,f,t,i,o),s.globeDepthTexture=_,o.framebuffer=m};var f3=$C;var Eu=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;function Mp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new _i({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new _i({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 oi({color:new H(0,0,0,0),owner:this}),this._clearCommand=new oi({color:new H(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(Mp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Mp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var HTt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:0,mask:jt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},GTt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:0,mask:jt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},jTt={depthMask:!0,depthTest:{enabled:!0},stencilTest:jt.setCesium3DTileBit(),stencilMask:jt.CESIUM_3D_TILE_MASK,blending:fn.ALPHA_BLEND},WTt=`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; -} -`,qTt=`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 -} -`;Mp.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 dt({context:e,width:s,height:a,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Fu({context:e,width:s,height:a,format:rl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(HTt),this._rsClassified=ze.fromCache(GTt),this._rsDefault=ze.fromCache(jTt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?qTt:WTt,f=new Be({defines:["UNCLASSIFIED"],sources:[u]}),d=new Be({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{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(Eu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Mp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Mp.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))};Mp.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)};Mp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Mp.prototype.isDestroyed=function(){return!1};Mp.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()),ce(this)};var Dw=Mp;function N5(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(N5.prototype,{total:{get:function(){return this._total}}});function Sb(e){let t=new Array(tc.NUMBER_OF_JOB_TYPES);t[tc.TEXTURE]=new N5(l(e)?e[tc.TEXTURE]:10),t[tc.PROGRAM]=new N5(l(e)?e[tc.PROGRAM]:10),t[tc.BUFFER]=new N5(l(e)?e[tc.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}Sb.getTimestamp=Si;Object.defineProperties(Sb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Sb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Sb.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};Sb.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Sb.getTimestamp();e.execute();let a=Sb.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var d3=Sb;function F5(e){e=e??G.EMPTY_OBJECT;let t=Dn(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=Si(),this._lastMsSampleTime=Si(),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(F5.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});F5.prototype.update=function(e){let t=Si(),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}};F5.prototype.destroy=function(){return ce(this)};var iy=F5;var Ua={};Ua.decodeRawMetadataValue=function(e,t,n){switch(e){case Ft.INT8:return t.getInt8(n);case Ft.UINT8:return t.getUint8(n);case Ft.INT16:return t.getInt16(n,!0);case Ft.UINT16:return t.getUint16(n,!0);case Ft.INT32:return t.getInt32(n,!0);case Ft.UINT32:return t.getUint32(n,!0);case Ft.INT64:return t.getBigInt64(n,!0);case Ft.UINT64:return t.getBigUint64(n,!0);case Ft.FLOAT32:return t.getFloat32(n,!0);case Ft.FLOAT64:return t.getFloat64(n,!0)}throw new se(`Invalid component type: ${e}`)};Ua.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Ua.decodeRawMetadataValue(i,t,n);return e.normalized?Ft.normalize(o,i):o};Ua.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Ft.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*o,_=Ua.decodeRawMetadataValueComponent(e,t,p);f[d]=_}return f}let c=n*a;return Ua.decodeRawMetadataValueComponent(e,t,c)};Ua.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=Ua.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Ua.decodeRawMetadataValueElement(e,n,0)};Ua.convertToObjectType=function(e,t){if(!l(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return V.unpack(n,0,new V);case at.VEC3:return h.unpack(n,0,new h);case at.VEC4:return ie.unpack(n,0,new ie);case at.MAT2:return ei.unpack(n,0,new ei);case at.MAT3:return Z.unpack(n,0,new Z);case at.MAT4:return M.unpack(n,0,new M)}throw new se(`Invalid metadata object type: ${e}`)};Ua.convertFromObjectType=function(e,t){if(!l(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return V.pack(t,Array(2));case at.VEC3:return h.pack(t,Array(3));case at.VEC4:return ie.pack(t,Array(4));case at.MAT2:return ei.pack(t,Array(4));case at.MAT3:return Z.pack(t,Array(9));case at.MAT4:return M.pack(t,Array(16))}throw new se(`Invalid metadata object type: ${e}`)};Ua.decodeMetadataValues=function(e,t,n){let i=Ua.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Ua.convertFromObjectType(e.type,t.offset),s=Ua.convertFromObjectType(e.type,t.scale);i=jm.valueTransformInPlace(i,r,s,Ft.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=Ua.convertToObjectType(e.type,c);s[a]=u}return s}return Ua.convertToObjectType(e.type,i)};var h3=Object.freeze(Ua);function ZC(){this._framebuffer=new _i,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(ZC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function YTt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function XTt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates); - float globeDepth = czm_unpackDepth(globeDepthPacked); - float depth = texture(colorTexture, v_textureCoordinates).r; - out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, - czm_packDepth(depth), globeDepthPacked); -} -`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}ZC.prototype.update=function(e,t){YTt(this,e,t),XTt(this,e,t)};var KTt=new ie,$Tt=new ie(1,1/255,1/65025,1/16581375);ZC.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ie.unpack(i,0,KTt);return ie.divideByScalar(o,255,o),ie.dot(o,$Tt)};ZC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};ZC.prototype.isDestroyed=function(){return!1};ZC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ce(this)};var m3=ZC;function ZTt(e,t){this.near=e??0,this.far=t??0;let n=Se.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 p3=ZTt;var vb=`uniform highp sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function Lp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new _i({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new _i({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new _i,this._tempCopyDepthFramebuffer=new _i,this._updateDepthFramebuffer=new _i({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Xe,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Lp.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 OEe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Xe.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!Xe.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(vb,{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(Eu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(vb,{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(Eu,{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 oi({color:new H(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Lp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.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),OEe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};Lp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Lp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Lp.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),OEe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Lp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Lp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(H.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Lp.prototype.isDestroyed=function(){return!1};Lp.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()),ce(this)};var _3=Lp;function QC(){this._framebuffer=new _i({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new _i,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Xe,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(QC.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 QTt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function JTt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function eCt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Xe.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Xe.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(vb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new oi({color:new H(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}QC.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;JTt(this,n,o,r,e),eCt(this,n,o,r,i),this._useHdr=e};QC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};QC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};QC.prototype.isDestroyed=function(){return!1};QC.prototype.destroy=function(){return QTt(this),ce(this)};var g3=QC;var Rw=`#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 y3=`/** - * 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 oy(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 _i({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new _i({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new _i({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new _i({createColorAttachments:!1}),this._opaqueClearCommand=new oi({color:new H(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new oi({color:new H(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new oi({color:new H(0,0,0,0),owner:this}),this._alphaClearCommand=new oi({color:new H(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Xe,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function MEe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function LQ(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function LEe(e){MEe(e),LQ(e)}function tCt(e,t,n,i){MEe(e),e._accumulationTexture=new dt({context:t,width:n,height:i,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT}),e._revealageTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,width:n,height:i,flipY:!1})}function nCt(e,t){LQ(e);let n=q.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)&&(LQ(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(LEe(e),e._translucentMultipassSupport=!1,i=!1)}return i}oy.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,tCt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!nCt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Be({sources:[y3]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Be({defines:["MRT"],sources:[Rw]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Be({sources:[Rw]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let _=!Xe.equals(this._viewport,t.viewport),m=_!==this._useScissorTest;this._useScissorTest=_,Xe.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Xe.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!Xe.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var iCt={enabled:!0,color:new H(0,0,0,0),equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.ONE,functionDestinationRgb:Io.ONE,functionSourceAlpha:Io.ZERO,functionDestinationAlpha:Io.ONE_MINUS_SOURCE_ALPHA},oCt={enabled:!0,color:new H(0,0,0,0),equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.ONE,functionDestinationRgb:Io.ONE,functionSourceAlpha:Io.ONE,functionDestinationAlpha:Io.ONE},rCt={enabled:!0,color:new H(0,0,0,0),equationRgb:Za.ADD,equationAlpha:Za.ADD,functionSourceRgb:Io.ZERO,functionDestinationRgb:Io.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Io.ZERO,functionDestinationAlpha:Io.ONE_MINUS_SOURCE_ALPHA};function NQ(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function sCt(e,t,n){return NQ(t,iCt,e._translucentRenderStateCache,n)}function aCt(e,t,n){return NQ(t,oCt,e._translucentRenderStateCache,n)}function cCt(e,t,n){return NQ(t,rCt,e._alphaRenderStateCache,n)}var lCt=` 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); -`,uCt=` 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; -`,fCt=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function FQ(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Be.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; -bool czm_discard = false; -`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; -${u}`}return a.sources.push(u),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; - } -${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function dCt(e,t){return FQ(e,t,"translucentMRT",lCt)}function hCt(e,t){return FQ(e,t,"translucentMultipass",uCt)}function mCt(e,t){return FQ(e,t,"alphaMultipass",fCt)}oy.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=qe.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=dCt(t,e.shaderProgram),n.translucentCommand.renderState=sCt(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=qe.shallowClone(e,n.translucentCommand),n.alphaCommand=qe.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hCt(t,e.shaderProgram),n.translucentCommand.renderState=aCt(this,t,e.renderState),n.alphaCommand.shaderProgram=mCt(t,e.shaderProgram),n.alphaCommand.renderState=cCt(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 pCt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,_)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,_)}i.framebuffer=d}function _Ct(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,_)}i.framebuffer=d}oy.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_Ct(this,e,t,n,i,o);return}pCt(this,e,t,n,i,o)};oy.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};oy.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,H.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};oy.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){return LEe(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()),ce(this)};var b3=oy;function x3(){this._framebuffer=new _i({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(x3.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function gCt(e){e._framebuffer.destroy()}function yCt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Sc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Xe},o.viewport=new Xe,e._passState=o}x3.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&yCt(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};x3.prototype.isDestroyed=function(){return!1};x3.prototype.destroy=function(){return gCt(this),ce(this)};var T3=x3;function Ow(e){let t=new Sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Xe},t.viewport=new Xe,this._context=e,this._fb=new _i({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}Ow.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Xe.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var C3=new H;Ow.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),u=0,f=0,d=0,p=-1;for(let _=0;_<s;++_){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);C3.red=H.byteToFloat(o[m]),C3.green=H.byteToFloat(o[m+1]),C3.blue=H.byteToFloat(o[m+2]),C3.alpha=H.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(C3);if(l(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=d;d=-p,p=m}u+=d,f+=p}};Ow.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)};Ow.prototype.isDestroyed=function(){return!1};Ow.prototype.destroy=function(){return this._fb.destroy(),ce(this)};var A3=Ow;function ry(){this._numSamples=1,this._colorFramebuffer=new _i({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new _i({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new H(0,0,0,0),this._clearCommand=new oi({color:new H(0,0,0,0),depth:1,owner:this})}function bCt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(ry.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});ry.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};ry.prototype.clear=function(e,t,n){H.clone(n,this._clearCommand.color),H.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};ry.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};ry.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};ry.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};ry.prototype.isDestroyed=function(){return!1};ry.prototype.destroy=function(){return bCt(this),ce(this)};var JC=ry;function eA(){}eA.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};eA.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Be.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Be.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Be({defines:i,sources:o})};eA.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Be.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=Be.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,r.push(u),new Be({defines:o,sources:r})};eA.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${f}${t}${n}${i}`};eA.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Be({defines:i,sources:o})};eA.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Be.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Be.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,_=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,b=d?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),T=e.sources.slice(0),C=T.length;for(let w=0;w<C;++w)T[w]=Be.replaceMain(T[w],"czm_shadow_receive_main");d?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&x.push("USE_SOFT_SHADOWS"),_&&n&&i&&(s?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(x.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let A="";d?A+=`uniform samplerCube shadowMap_textureCube; -`:A+=`uniform sampler2D shadowMap_texture; -`;let S;return c?S=` return vec4(${a}, 1.0); -`:S=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,A+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${S}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,A+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,A+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?A+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(A+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),d?A+=` 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?A+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:_?A+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${m?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:A+=` 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); -`,A+=` out_FragColor.rgb *= visibility; -} -`,T.push(A),new Be({defines:x,sources:T})};var Np=eA;function Fp(e){e=e??G.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;(Nt.isInternetExplorer()||Nt.isEdge()||(Nt.isChrome()||Nt.isFirefox())&&Nt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ie,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new B5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new re,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 V,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new jr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ie,new ie],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new ie;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new xCt(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,kQ(this),this._clearCommand=new oi({depth:1,color:new H}),this._clearPassState=new Sc(t),this._size=e.size??2048,this.size=this._size}Fp.MAXIMUM_DISTANCE=2e4;function xCt(e){this.camera=new B5,this.passState=new Sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function BQ(e,t){return ze.fromCache({cull:{enabled:!0,face:Ai.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 kQ(e){let t=!e._usesDepthTexture;e._primitiveRenderState=BQ(t,e._primitiveBias),e._terrainRenderState=BQ(t,e._terrainBias),e._pointRenderState=BQ(t,e._pointBias)}Fp.prototype.debugCreateRenderStates=function(){kQ(this)};Object.defineProperties(Fp.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){vCt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function UQ(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function TCt(e,t){let n=new Fu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:rl.DEPTH_COMPONENT16}),i=new dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST}),o=new Gr({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 CCt(e,t){let n=new dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),i=new Gr({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 ACt(e,t){let n=new Fu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:rl.DEPTH_COMPONENT16}),i=new or({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Gr({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 BEe(e,t){e._isPointLight?ACt(e,t):e._usesDepthTexture?CCt(e,t):TCt(e,t)}function ECt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==q.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,kQ(e),UQ(e),BEe(e,t))}function SCt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(UQ(e),BEe(e,t),ECt(e,t),kEe(e,t))}function kEe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function vCt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Lt.maximumCubeMapSize>=t?t:Lt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Xe(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Lt.maximumTextureSize>=t?t:Lt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Xe(0,0,t,t)):i===4&&(t=Lt.maximumTextureSize>=t*2?t:Lt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Xe(0,0,t,t),n[1].passState.viewport=new Xe(t,0,t,t),n[2].passState.viewport=new Xe(0,t,t,t),n[3].passState.viewport=new Xe(t,t,t,t));e._clearPassState.viewport=new Xe(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new M(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var wCt=new Xe;function ICt(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=Se.OVERLAY,i}function PCt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=wCt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=ICt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Xe.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Xe.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Bp=new Array(8);Bp[0]=new ie(-1,-1,-1,1);Bp[1]=new ie(1,-1,-1,1);Bp[2]=new ie(1,1,-1,1);Bp[3]=new ie(-1,1,-1,1);Bp[4]=new ie(-1,-1,1,1);Bp[5]=new ie(1,-1,1,1);Bp[6]=new ie(1,1,1,1);Bp[7]=new ie(-1,1,1,1);var wb=new M,zQ=new Array(8);for(let e=0;e<8;++e)zQ[e]=new ie;function DCt(e,t){let n=new It({geometry:new fh({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new It({geometry:new hg({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new Pn({geometryInstances:[n,i],appearance:new un({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var RCt=[H.RED,H.GREEN,H.BLUE,H.MAGENTA],OCt=new h;function MCt(e,t){PCt(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 Rp({camera:e._sceneCamera,color:H.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Rp({camera:e._shadowMapCamera,color:H.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 Rp({camera:e._passes[i].camera,color:RCt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Pe.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,OCt),a=M.fromTranslationQuaternionRotationScale(i,o,s,wb);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=DCt(a,H.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Rp({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function B5(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new M}B5.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var LCt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(LCt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var NCt=new Array(5),FCt=new Oi,BCt=new Array(4),UEe=new h,zEe=new h;function kCt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=BCt,_=NCt;for(_[0]=o,_[s]=r,a=0;a<s;++a){let L=(a+1)/s,g=o*Math.pow(u,L),E=o+c*L,v=D.lerp(E,g,f);_[a+1]=v,p[a]=v-_[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=_[0];for(a=0;a<s-1;++a)L+=p[a],_[a+1]=L}ie.unpack(_,0,e._cascadeSplits[0]),ie.unpack(_,1,e._cascadeSplits[1]),ie.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,b=m.right,x=m.bottom,T=m.top,C=m.near,A=m.far,S=n.positionWC,w=n.directionWC,R=n.upWC,P=i.frustum.clone(FCt),O=n.getViewProjection();for(a=0;a<s;++a){P.near=_[a],P.far=_[a+1];let L=M.multiply(P.projectionMatrix,i.viewMatrix,wb),g=M.inverse(L,wb),E=M.multiply(O,g,wb),v=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,UEe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,zEe);for(let z=0;z<8;++z){let B=ie.clone(Bp[z],zQ[z]);M.multiplyByVector(E,B,B),h.divideByScalar(B,B.w,B),h.minimumByComponent(B,v,v),h.maximumByComponent(B,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],F=N.camera;F.clone(n);let U=F.frustum;U.left=y+v.x*(b-y),U.right=y+I.x*(b-y),U.bottom=x+v.y*(T-x),U.top=x+I.y*(T-x),U.near=C+v.z*(A-C),U.far=C+I.z*(A-C),N.cullingVolume=F.frustum.computeCullingVolume(S,w,R);let k=e._cascadeMatrices[a];M.multiply(F.getViewProjection(),i.inverseViewMatrix,k),M.multiply(N.textureOffsets,k,k)}}var UCt=new M,zCt=new h,VCt=new h,NEe=new h;function HCt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,wb),r=M.inverse(o,wb),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,zCt);a=h.cross(c,s,VCt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,NEe),f=M.computeView(u,s,a,c,UCt),d=M.multiply(f,r,wb),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,UEe),_=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,zEe);for(let A=0;A<8;++A){let S=ie.clone(Bp[A],zQ[A]);M.multiplyByVector(d,S,S),h.divideByScalar(S,S.w,S),h.minimumByComponent(S,p,p),h.maximumByComponent(S,_,_)}_.z+=1e3,p.z-=10;let m=NEe;m.x=-(.5*(p.x+_.x)),m.y=-(.5*(p.y+_.y)),m.z=-_.z;let y=M.fromTranslation(m,wb);f=M.multiply(y,f,f);let b=.5*(_.x-p.x),x=.5*(_.y-p.y),T=_.z-p.z,C=n.frustum;C.left=-b,C.right=b,C.bottom=-x,C.top=x,C.near=.01,C.far=T,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var GCt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],jCt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],WCt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function qCt(e,t){let n=new Oi;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=GCt[i],o.upWC=jCt[i],o.rightWC=WCt[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var YCt=new h,XCt=new h,VEe=new re,FEe=VEe.center;function KCt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=VEe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,YCt),s=h.negate(i.directionWC,XCt),a=h.dot(r,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),re.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,FEe),FEe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),re.clone(o,e._boundingSphere)}}function $Ct(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=uo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,KCt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Fp.prototype.update=function(e){if($Ct(this,e),this._needsUpdate)if(SCt(this,e.context),this._isPointLight&&qCt(this,e),this._cascadesEnabled&&(HCt(this,e),this._numberOfCascades>1&&kCt(this,e)),this._isPointLight)this._shadowMapCullingVolume=Es.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&MCt(this,e)};Fp.prototype.updatePass=function(e,t){kEe(this,e,t)};var ZCt=new V;function HEe(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=ZCt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ie.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ie.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ie,combinedUniforms2:new ie};return ct(t,o,!1)}function QCt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Se.GLOBE,d=n.pass!==Se.TRANSLUCENT,p=e._isPointLight,_=e._usesDepthTexture,m=Np.getShadowCastShaderKeyword(p,f,_,d);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let b=u.vertexShaderSource,x=u.fragmentShaderSource,T=Np.createShadowCastVertexShader(b,p,f),C=Np.createShadowCastFragmentShader(x,p,_,d);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Fe(a,!1),a.cull=Fe(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=HEe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Fp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Se.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let _=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||_){let y=Np.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let b=Np.createShadowReceiveVertexShader(a,u,f),x=Np.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:s._attributeLocations})}p=HEe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Fp.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]=QCt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){UQ(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ce(this)};var sy=Fp;var E3=`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 tA=`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 JCt=!1;function Ib(e){this._drawClassificationFBO=new _i({createDepthAttachments:!1}),this._accumulationFBO=new _i({createDepthAttachments:!1}),this._packFBO=new _i,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 oi({color:new H(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new oi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Xe,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Ib.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function GEe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function jEe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function eAt(e,t,n,i){GEe(e),e._translucentDepthStencilTexture=new dt({context:t,width:n,height:i,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST})}function tAt(e,t,n,i){jEe(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 nAt(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)&&(eAt(e,t,o,r),tAt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Be({sources:[E3]}),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 Be({sources:[tA]}),a={colorTexture:function(){return e._textureToComposite}},JCt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Be({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),_=qe.shallowClone(f);_.shaderProgram=p,f.derivedCommands.pick=_}l(e._copyCommand)||(s=new Be({sources:[tA]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Be({sources:[tA]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Xe.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Xe.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Xe.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Xe.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Xe.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:jt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Xe.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Ib.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){nAt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Ib.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(Se.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Se.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Ib.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),iAt(this,e,t)};function iAt(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}Ib.prototype.isSupported=function(){return this._supported};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){return GEe(this),jEe(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()),ce(this)};var S3=Ib;function oAt(){this.command=void 0,this.near=void 0,this.far=void 0}function k5(e,t,n){let i=e.context,o;i.depthTexture&&(o=new _3);let r;e._useOIT&&i.depthTexture&&(r=new b3(i));let s=new Sc(i);s.viewport=Xe.clone(n),this.camera=t,this._cameraClone=uo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new A3(i),this.pickDepthFramebuffer=new T3,this.sceneFramebuffer=new JC,this.globeDepth=o,this.globeTranslucencyFramebuffer=new g3,this.oit=r,this.translucentTileClassification=new S3(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var VQ=new h,HQ=new h;function rAt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,VQ)),h.maximumComponent(h.abs(t.position,HQ))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,VQ),h.multiplyByScalar(t.position,o,HQ),h.equalsEpsilon(VQ,HQ,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}k5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return rAt(t,n,D.EPSILON15)?(this._cameraStartFired&&Si()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Si(),uo.clone(t,n),!0)};function sAt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let _,m;c?(_=Math.min(i-u,n+p*u),m=Math.min(i,_+u)):(_=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*_));let y=d[p];l(y)?(y.near=_,y.far=m):y=d[p]=new p3(_,m)}}function aAt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var WEe=new Es,cAt=new Xa;k5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Se.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,_=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:b}=o,x=+Number.MAX_VALUE,T=-Number.MAX_VALUE,C=Number.MAX_VALUE,A=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,w=WEe.planes;for(let O=0;O<5;++O)w[O]=S.planes[O];S=WEe;for(let O=0;O<i.length;++O){let L=i[O],{pass:g,boundingVolume:E}=L;if(g===Se.COMPUTE)c.push(L);else if(g===Se.OVERLAY)u.push(L);else{let v,I;if(l(E)){if(!e.isVisible(S,L,A))continue;let F=E.computePlaneDistances(r,s,cAt);if(v=F.start,I=F.stop,m=Math.min(m,v),y=Math.max(y,I),b&&L.receiveShadows&&v<sy.MAXIMUM_DISTANCE&&!(g===Se.GLOBE&&v<-100&&I>100)){let U=I-v;g!==Se.GLOBE&&v<100&&(C=Math.min(C,U)),x=Math.min(x,v),T=Math.max(T,I)}}else L instanceof oi?(v=a.near,I=a.far):(v=a.near,I=a.far,m=Math.min(m,v),y=Math.max(y,I));let N=d[_];l(N)||(N=d[_]=new oAt),N.command=L,N.near=v,N.far=I,_++}}b&&(x=Math.min(Math.max(x,a.near),a.far),T=Math.max(Math.min(T,a.far),x),o.nearPlane=x,o.farPlane=T,o.closestObjectSize=C),sAt(this,e,m,y);for(let O=0;O<_;O++)aAt(this,e,d[O]);if(_<p)for(let O=_;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}let R=f.length,{frustumSplits:P}=t;P.length=R+1;for(let O=0;O<R;++O)P[O]=f[O].near,O===R-1&&(P[O+1]=f[O].far)};k5.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.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 nA=k5;var YEe=.1,lAt=new Gd({pass:jo.MOST_DETAILED_PRELOAD}),uAt=new Gd({pass:jo.MOST_DETAILED_PICK}),v3=new Gd({pass:jo.PICK});function ba(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Xe(0,0,1,1),n=new uo(e);n.frustum=new cn({width:YEe,aspectRatio:1,near:.1}),this._pickOffscreenView=new nA(e,n,t)}ba.prototype.update=function(){this._pickPositionCacheDirty=!0};ba.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new m3,n[t]=i),i};var fAt=new jr,dAt=new h,U5=new h,hAt=new V,mAt=new M;function pAt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=M.clone(r.transform,mAt);r._setTransform(M.IDENTITY);let d=h.clone(r.position,dAt);h.multiplyByScalar(r.right,c,U5),h.add(U5,d,d),h.multiplyByScalar(r.up,u,U5),h.add(U5,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,hAt),_=fAt;return _.right=p.x*.5,_.left=-_.right,_.top=p.y*.5,_.bottom=-_.top,_.near=s.near,_.far=s.far,_.computeCullingVolume(d,r.directionWC,r.upWC)}var _At=new kl,gAt=new V;function yAt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,_=d*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,gAt),y=m.x*n*.5,b=m.y*i*.5,x=_At;return x.top=_+b,x.bottom=_-b,x.right=p+y,x.left=p-y,x.near=a,x.far=s.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function z5(e,t,n,i,o){let r=e.camera.frustum;return r instanceof cn||r instanceof jr?pAt(e,t,n,i,o):yAt(e,t,n,i,o)}var V5=new Xe(0,0,3,3),H5=new V,w3=new H(0,0,0,0);function GQ(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}ba.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 u=s.passState;u.viewport=Xe.clone(a,u.viewport);let f=ji.transformWindowToDrawingBuffer(e,t,H5),d=GQ(o.drawingBufferHeight,f,n,i,V5);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=z5(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=v3,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,w3),e.resolveFramebuffers(u);let p=c.end(d);return o.endFrame(),p};ba.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Xe.clone(a,u.viewport);let f=ji.transformWindowToDrawingBuffer(e,t,H5),d=GQ(o.drawingBufferHeight,f,n,i,V5);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=z5(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=v3,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,w3),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return o.endFrame(),p};ba.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=Xe.clone(s,c.viewport);let u=ji.transformWindowToDrawingBuffer(e,t,H5),f=GQ(i.drawingBufferHeight,u,1,1,V5);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=z5(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=v3,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,w3);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,h3.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function bAt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Xe.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=z5(e,t,1,1,s),o.tilesetPassState=v3,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,w3),e.resolveFramebuffers(c),i.endFrame()}var xAt=new Oi,TAt=new kl,CAt=new cn,AAt=new jr;ba.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 h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=ji.transformWindowToDrawingBuffer(e,t,H5);e.pickTranslucentDepth?bAt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(xAt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(TAt):l(s.frustum.width)?f=s.frustum.clone(CAt):f=s.frustum.clone(AAt);let{frustumCommandsList:d}=a,p=d.length;for(let _=0;_<p;++_){let y=this.getPickDepth(e,_).getDepth(o,u.x,u.y);if(l(y)&&y>0&&y<1){let b=d[_],x;return e.mode===ne.SCENE2D?(x=s.position.z,s.position.z=x-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=b.near*(_!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,c.updateFrustum(f)),n=ji.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===ne.SCENE2D&&(s.position.z=x,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var EAt=new fe;ba.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,EAt);o.cartographicToCartesian(r,n)}return n};function XEe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,_=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(_=!0,i.show=bn.toValue(!1,i.show),s.push(i))),u instanceof oa&&(_=!0,u.show=!1,a.push(u)),_||(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=bn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}ba.prototype.drillPick=function(e,t,n,i,o){let r=this;return XEe(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 qEe=new h,SAt=new h;function vAt(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 KEe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,qEe),s=h.cross(o,r,qEe),a=h.cross(o,s,SAt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??YEe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function wAt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=KEe(e,o,r,a),u=lAt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let _=s[p];_.show&&t.primitives.contains(_)&&(_.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}ba.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)wAt(this,e,t[n])&&t.splice(n--,1)};function $Ee(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 Rl&&$Ee(o,t,n))}}function G5(e,t,n,i,o,r){let s=[];if($Ee(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new vAt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function IAt(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 PAt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,KEe(e,n,o,f.camera);let d=Xe.clone(f.viewport,V5),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=uAt:c.tilesetPassState=v3,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,w3),t.resolveFramebuffers(p);let _,m=f.pickFramebuffer.end(d);if(t.context.depthTexture){let{frustumCommandsList:y}=f,b=y.length;for(let x=0;x<b;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let A=y[x],S=A.near*(x!==0?t.opaqueFrustumNearOffset:1),w=A.far,R=S+C*(w-S);_=_n.getPoint(n,R);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(_))return{object:m,position:_,exclude:!l(_)&&r||IAt(m,i)}}function ZEe(e,t,n,i,o,r,s,a){return XEe(i,function(){return PAt(e,t,n,o,r,s,a)})}function Mw(e,t,n,i,o,r,s){let a=ZEe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function QEe(e,t,n,i,o,r,s,a){return ZEe(e,t,n,i,o,r,s,a)}function j5(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)})})}ba.prototype.pickFromRay=function(e,t,n,i){return Mw(this,e,t,n,i,!1,!1)};ba.prototype.drillPickFromRay=function(e,t,n,i,o){return QEe(this,e,t,n,i,o,!1,!1)};ba.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=_n.clone(t),n=l(n)?n.slice():n,j5(e,G5(o,e,t,n,i,function(){return Mw(o,e,t,n,i,!1,!0)}))};ba.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=_n.clone(t),i=l(i)?i.slice():i,j5(e,G5(r,e,t,i,o,function(){return QEe(r,e,t,n,i,o,!1,!0)}))};var DAt=new h,RAt=new h,OAt=new _n,JEe=new fe;function jQ(e,t){let n=e.ellipsoid,i=hi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,RAt),r=fe.toCartesian(t,n,DAt),s=OAt;s.origin=r,s.direction=o;let a=new _n;return _n.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function eSe(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,JEe);return jQ(e,i)}function tSe(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,JEe).height}function MAt(e,t,n,i,o){let r=jQ(t,n);return G5(e,t,r,i,o,function(){let s=Mw(e,t,r,i,o,!0,!0);if(l(s))return tSe(t,s.position)})}function LAt(e,t,n,i,o,r){let s=eSe(t,n);return G5(e,t,s,i,o,function(){let a=Mw(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}ba.prototype.sampleHeight=function(e,t,n,i){let o=jQ(e,t),r=Mw(this,e,o,n,i,!0,!1);if(l(r))return tSe(e,r.position)};ba.prototype.clampToHeight=function(e,t,n,i,o){let r=eSe(e,t),s=Mw(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};ba.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]=MAt(this,e,t[s],n,i);return j5(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}))};ba.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]=LAt(this,e,t[s],n,i,t[s]);return j5(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};ba.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var I3=ba;var P3=`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 D3=`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 R3=`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 O3=`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 M3=`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 L3=`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 N3=`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 F3=`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 B3=`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 k3=`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 U3=`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 z3=`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 V3=`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 Pb=`#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 H3=`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 G3=`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 j3=`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 W3=`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 q3=`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); -} -`;/** - * @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 Y3=`/** - * @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); -} -`;function iA(){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 _i,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new V,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(iA.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 nSe(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 NAt(e,t){nSe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),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 _i,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 iSe(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 FAt(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 BAt(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 kAt(e,t){iSe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(BAt(r,i),{framebuffer:n[r].framebuffer,uniformMap:FAt(e,r)});e._commands=o}iA.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new oi({color:new H(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};iA.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,NAt(this,e),kAt(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};iA.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)};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return nSe(this),iSe(this),ce(this)};var X3=iA;var UAt={NEAREST:0,LINEAR:1},vf=UAt;function oA(e){e=e??G.EMPTY_OBJECT;let{name:t=Ln(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=vf.NEAREST,pixelFormat:a=je.RGBA,pixelDatatype:c=He.UNSIGNED_BYTE,clearColor:u=H.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new Sc;d.scissorTest={enabled:!0,rectangle:l(f)?Xe.clone(f):new Xe},this._passState=d,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(oA.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 zAt=/uniform\s+sampler2D\s+depthTexture/g;oA.prototype._isSupported=function(e){return!zAt.test(this._fragmentShader)||e.depthTexture};function VAt(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 dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof dt&&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 HAt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function GAt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function jAt(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]=HAt(e,r),n[r]=VAt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=GAt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=ct(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 WAt(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 qAt(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=WAt(n,o)}let i=new Be({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function YAt(e){let t=e._sampleMode,n,i;t===vf.LINEAR?(n=ft.LINEAR,i=Kn.LINEAR):(n=ft.NEAREST,i=Kn.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function XAt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function KAt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function $At(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new dt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=KAt(e,u);else if(typeof u=="string"){let d=new Ee({url:u});s.push(d.fetchImage().then(XAt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function oSe(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 dt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function ZAt(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 QAt(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 dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:zt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;r[o]=H.floatToByte(d.red),r[o+1]=H.floatToByte(d.green),r[o+2]=H.floatToByte(d.blue),r[o+3]=H.floatToByte(d.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=H.floatToByte(c.red),r[o+1]=H.floatToByte(c.green),r[o+2]=H.floatToByte(c.blue),r[o+3]=H.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:zt.NEAREST})}oA.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&oSe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=ZAt(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,QAt(this,e),jAt(this),$At(this,e),qAt(this,e),YAt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Xe(0,0,i.width,i.height)}))),this._command.renderState=o};oA.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,zt.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)};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){return oSe(this),ce(this)};var yo=oA;function rA(e){e=e??G.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Ln()),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(rA.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}}});rA.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};rA.prototype.get=function(e){return this._stages[e]};function JAt(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}rA.prototype.update=function(e,t){this._selectedDirty=JAt(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)}};rA.prototype.isDestroyed=function(){return!1};rA.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var Su=rA;var kr={};function WQ(e){let o=`#define USE_STEP_SIZE -${Pb}`,r=new yo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:vf.LINEAR}),s=new yo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:vf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Su({name:e,stages:[r,s],uniforms:a})}kr.createBlurStage=function(){return WQ("czm_blur")};kr.createDepthOfFieldStage=function(){let e=WQ("czm_depth_of_field_blur"),t=new yo({name:"czm_depth_of_field_composite",fragmentShader:F3,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 Su({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};kr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};kr.createEdgeDetectionStage=function(){let e=Ln();return new yo({name:`czm_edge_detection_${e}`,fragmentShader:k3,uniforms:{length:.25,color:H.clone(H.BLACK)}})};kr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function eEt(e){if(!l(e))return kr.createEdgeDetectionStage();let t=new Su({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 yo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Su({name:"czm_edge_detection_composite",stages:[t,s]})}kr.createSilhouetteStage=function(e){let t=eEt(e),n=new yo({name:"czm_silhouette_color_edges",fragmentShader:q3,uniforms:{silhouetteTexture:t.name}});return new Su({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};kr.isSilhouetteSupported=function(e){return e.context.depthTexture};kr.createBloomStage=function(){let e=new yo({name:"czm_bloom_contrast_bias",fragmentShader:N3,uniforms:{contrast:128,brightness:-.3}}),t=WQ("czm_bloom_blur"),n=new Su({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new yo({name:"czm_bloom_generate_composite",fragmentShader:M3,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 Su({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};kr.createAmbientOcclusionStage=function(){let e=new yo({name:"czm_ambient_occlusion_generate",fragmentShader:D3,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new yo({name:"czm_ambient_occlusion_composite",fragmentShader:R3,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 Su({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};kr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var tEt=`#define FXAA_QUALITY_PRESET 39 -${Y3} -${V3}`;kr.createFXAAStage=function(){return new yo({name:"czm_FXAA",fragmentShader:tEt,sampleMode:vf.LINEAR})};kr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=P3,new yo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};kr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=U3,new yo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};kr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=z3,new yo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};kr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=W3,new yo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};kr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=G3,new yo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:H.WHITE,autoExposure:void 0,exposure:1}})};kr.createAutoExposureStage=function(){return new X3};kr.createBlackAndWhiteStage=function(){return new yo({name:"czm_black_and_white",fragmentShader:O3,uniforms:{gradations:5}})};kr.createBrightnessStage=function(){return new yo({name:"czm_brightness",fragmentShader:L3,uniforms:{brightness:.5}})};kr.createNightVisionStage=function(){return new yo({name:"czm_night_vision",fragmentShader:j3})};kr.createDepthViewStage=function(){return new yo({name:"czm_depth_view",fragmentShader:B3})};kr.createLensFlareStage=function(){return new yo({name:"czm_lens_flare",fragmentShader:H3,uniforms:{dirtTexture:on("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:on("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var wf=kr;function ay(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function $3(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function qQ(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[$3(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[$3(d)]=!0)}}}return i.name}function K3(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 d=0;d<c;++d){let p=i.get(d);l(p.length)?a=K3(e,t,n,p,o):a=qQ(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=$3(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=$3(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[$3(i.get(p))]=!0}return a}function nEt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=K3(e,t,n,i,void 0);a=K3(e,t,n,o,a),a=qQ(e,t,n,r,a),a=K3(e,t,n,e,a),qQ(e,t,n,s,a)}else K3(e,t,n,e,void 0);return n}function iEt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,_=p.length;for(f=0;f<_;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!H.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,b=!1;for(let x=0;x<y;++x)if(n[m[x]]){b=!0;break}if(!b)break}return l(d)&&f<_?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new _i({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function oEt(e,t){let n=nEt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=iEt(e,i,n[i]))}function YQ(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function rEt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new oi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}ay.prototype.updateDependencies=function(){this._updateDependencies=!0};ay.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)&&(YQ(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&oEt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,YQ(this),rEt(this,e))};ay.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ay.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ay.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ay.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){return YQ(this),ce(this)};var sA=ay;var sEt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var cy=Object.freeze(sEt);var XQ=[];function zl(){let e=wf.createFXAAStage(),t=wf.createAmbientOcclusionStage(),n=wf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=wf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=cy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new sA(this),r={},s=XQ;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(zl.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 KQ(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 cy.REINHARD:n=wf.createReinhardTonemappingStage(t);break;case cy.MODIFIED_REINHARD:n=wf.createModifiedReinhardTonemappingStage(t);break;case cy.FILMIC:n=wf.createFilmicTonemappingStage(t);break;case cy.PBR_NEUTRAL:n=wf.createPbrNeutralTonemappingStage(t);break;default:n=wf.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 KQ(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}zl.prototype.add=function(e){let t=this._stageNames,n=XQ;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};zl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=XQ;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};zl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};zl.prototype.get=function(e){return KQ(this),this._stages[e]};zl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};zl.prototype.getStageByName=function(e){return this._stageNames[e]};zl.prototype.update=function(e,t,n){KQ(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 x=0;x<r.length;++x){let T=r[x];T.ready&&T.enabled&&T._isSupported(e)&&(o[s++]=T)}o.length=s;let a=s!==i.length;if(!a){for(let x=0;x<s;++x)if(o[x]!==i[x]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let _=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||_!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=b,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){let T=new Uint8Array(196608);for(let C=0;C<196608;C+=3)T[C]=Math.floor(Math.random()*255);this._randomTexture=new dt({context:e,pixelFormat:je.RGB,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:T,width:256,height:256},sampler:new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);s=0;for(let x=0;x<r.length;++x){let T=r[x];T.ready&&T.enabled&&T._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};zl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function aA(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}zl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return aA(t)};function kp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){kp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)kp(e.get(r),t,aA(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)kp(e.get(r),t,n,i,o)}zl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),_=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&r===0)return;let b=t;d&&a.ready&&(kp(a,e,b,n,i),b=aA(a)),p&&c.ready&&(kp(c,e,b,n,i),b=aA(c)),_&&u.ready&&kp(u,e,b,n,i),m&&f.ready&&(kp(f,e,b,n,i),b=aA(f));let x=b;if(r>0){kp(o[0],e,b,n,i);for(let T=1;T<r;++T)kp(o[T],e,aA(o[T-1]),n,i);x=aA(o[r-1])}y&&s.ready&&kp(s,e,x,n,i)};zl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Eu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};zl.prototype.isDestroyed=function(){return!1};zl.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(),ce(this)};var Z3=zl;function cA(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}cA.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};cA.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof cn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?UEt(this,e):qEt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var aEt=new h,cEt=new h,lEt=new h,uEt=new h,fEt=new h,dEt=new h,hEt=new h,mEt=new fe,pEt=new M,_Et=new Oi,gEt=new cn,yEt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};cA.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=aEt,o=cEt,r=lEt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(u.positionWC,i),h.clone(u.directionWC,o),h.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,hEt),d=At.eastNorthUpToFixedFrame(f,t,pEt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,mEt),i),M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=gEt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=_Et,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=yEt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=XEt(a);Q3(this,c),this._previousMode===ne.SCENE2D?YEt(this,e,a,c):(a.position2D=M.multiplyByPoint(uo.TRANSFORM_2D,i,uEt),a.direction2D=M.multiplyByPointAsVector(uo.TRANSFORM_2D,o,fEt),a.up2D=M.multiplyByPointAsVector(uo.TRANSFORM_2D,r,dEt),n._mode=ne.MORPHING,pSe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var QQ={position:new h,direction:new h,up:new h,frustum:void 0},sSe=new Oi;cA.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===ne.SCENE2D)PEt(this,e,t);else{let i;e>0?(i=QQ,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=aSe(this,t);let o,r=n.camera;r.frustum instanceof cn?o=r.frustum.clone():(o=sSe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=D.toRadians(60)),i.frustum=o;let s=gSe(i);Q3(this,s),ZQ(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};cA.prototype.isDestroyed=function(){return!1};cA.prototype.destroy=function(){return W5(this),ce(this)};function Q3(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Cf(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function W5(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 bEt=new fe,xEt=new h,TEt=new M;function aSe(e,t){let n=e._scene,i=n.camera,o=QQ,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,bEt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,xEt),f=At.eastNorthUpToFixedFrame(u,t,TEt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),o}var CEt=new h,AEt=new h,EEt=new h,SEt=new h,vEt=new h,wEt=new h;function ZQ(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,CEt),a=h.clone(r.direction,AEt),c=h.clone(r.up,EEt),u=M.multiplyByPoint(uo.TRANSFORM_2D_INVERSE,n.position,SEt),f=M.multiplyByPointAsVector(uo.TRANSFORM_2D_INVERSE,n.direction,vEt),d=M.multiplyByPointAsVector(uo.TRANSFORM_2D_INVERSE,n.up,wEt);function p(m){Wd(s,u,m.time,r.position),Wd(a,f,m.time,r.direction),Wd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let _=o.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){_Se(e,o,0,1,t,i)}});e._currentTweens.push(_)}var IEt=new cn,cSe=new h,lSe=new h,uSe=new h,JQ=new h,fSe=new h,dSe=new h;function PEt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=QQ,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=aSe(e,n));let s;e._morphToOrthographic?(s=IEt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=sSe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),r.frustum=s;let a=gSe(r);Q3(e,a);let c;e._morphToOrthographic?c=function(){ZQ(e,t,r,a)}:c=function(){mSe(e,t,r,function(){ZQ(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,JQ),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Wd(e,t,n,i){return h.lerp(e,t,n,i)}function hSe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof cn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=D.lerp(a,c,p.time);let _=u/Math.tan(s.frustum.fov*.5);i(s,_)}let d=r.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var DEt=new h,REt=new h,OEt=new h,$Q=new h,MEt=new h,LEt=new h,NEt=new jr,FEt=new _n,BEt=new h,kEt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function UEt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,DEt),r=h.clone(i.direction,REt),s=h.clone(i.up,OEt),a=h.negate(h.UNIT_Z,MEt),c=h.clone(h.UNIT_Y,LEt),u=$Q;if(t>0)h.clone(h.ZERO,$Q),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,$Q);let b=FEt;M.multiplyByPoint(uo.TRANSFORM_2D,o,b.origin),M.multiplyByPointAsVector(uo.TRANSFORM_2D,r,b.direction);let x=n.globe;if(l(x)){let T=x.pickWorldCoordinates(b,n,!0,BEt);l(T)&&(M.multiplyByPoint(uo.TRANSFORM_2D_INVERSE,T,u),u.z+=h.distance(o,u))}}let f=NEt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=kEt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=ySe(d);Q3(e,p);function _(b){Wd(o,u,b.time,i.position),Wd(r,a,b.time,i.direction),Wd(s,c,b.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,x){b.position.z=x}let y=n.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){hSe(e,t,d,m,p)}});e._currentTweens.push(y)}var rSe=new fe,zEt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new jr},VEt={position:new h,direction:new h,up:new h,frustum:void 0},HEt=new h,GEt=new _n,jEt=new M,WEt=new h;function qEt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=zEt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,rSe),i.mapProjection.project(rSe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let d=GEt;h.clone(r.position2D,d.origin);let p=h.clone(o.directionWC,d.direction),_=n.scaleToGeodeticSurface(o.positionWC,WEt),m=At.eastNorthUpToFixedFrame(_,n,jEt);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(uo.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let b=y.pickWorldCoordinates(d,i,!0,HEt);if(l(b)){let x=h.distance(r.position2D,b);b.x+=x,h.clone(b,r.position2D)}}}function s(d,p){d.position.x=p}M.multiplyByPoint(uo.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(uo.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(uo.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=VEt;M.multiplyByPoint(uo.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let u=ySe(c);Q3(e,u);function f(){hSe(e,t,r,s,u)}pSe(e,t,r,f)}function mSe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=D.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function YEt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,JQ),a=h.clone(n.direction,fSe),c=h.clone(n.up,dSe);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=h.clone(r.position,cSe),d=h.clone(r.direction,lSe),p=h.clone(r.up,uSe);f.z=s.z;function _(y){Wd(f,s,y.time,r.position),Wd(d,a,y.time,r.direction),Wd(p,c,y.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():mSe(e,0,n,u)}function pSe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,cSe),a=h.clone(r.direction,lSe),c=h.clone(r.up,uSe),u=h.clone(n.position2D,JQ),f=h.clone(n.direction2D,fSe),d=h.clone(n.up2D,dSe);function p(m){Wd(s,u,m.time,r.position),Wd(a,f,m.time,r.direction),Wd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let _=o.tweens.add({duration:t,easingFunction:os.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){_Se(e,o,1,0,t,i)}});e._currentTweens.push(_)}function _Se(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:os.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function gSe(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),W5(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.SCENE3D,r)}}function ySe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),W5(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.SCENE2D,o)}}function XEt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),W5(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.COLUMBUS_VIEW,r)}}var J3=cA;var KEt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},zi=Object.freeze(KEt);function xa(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function $Et(e,t){V.clone(e.distance.startPosition,t.distance.startPosition),V.clone(e.distance.endPosition,t.distance.endPosition),V.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),V.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function bSe(e,t,n){let i=xa(zi.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 V;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new V,endPosition:new V},u.angleAndHeight={startPosition:new V,endPosition:new V},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,V.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?($Et(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(V.clone(f.distance.endPosition,u.distance.endPosition),V.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,_=Math.PI*2;for(;d>=p+Math.PI;)d-=_;for(;d<p-Math.PI;)d+=_;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function xSe(e,t){let n=xa(zi.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 V,endPosition:new V,valid:!1}),s.startPosition=new V,V.clone(V.ZERO,s.startPosition),s.endPosition=new V,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,V.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Cn.WHEEL,t)}function Lw(e,t,n){let i=xa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new V;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new V,endPosition:new V,valid:!1});let c,u;n===zi.LEFT_DRAG?(c=Cn.LEFT_DOWN,u=Cn.LEFT_UP):n===zi.RIGHT_DRAG?(c=Cn.RIGHT_DOWN,u=Cn.RIGHT_UP):n===zi.MIDDLE_DRAG&&(c=Cn.MIDDLE_DOWN,u=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,V.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){eJ(xa(n,void 0),e);for(let f of Object.values(pa)){let d=xa(n,f);eJ(d,e)}},u,t)}function eJ(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 TSe(e,t){V.clone(e.startPosition,t.startPosition),V.clone(e.endPosition,t.endPosition)}function ZEt(e,t,n){let i=n._isDown,o=!1,r=xa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,eJ(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new V,endPosition:new V,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function CSe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in zi)if(zi.hasOwnProperty(s)){let a=zi[s];if(l(a)){let c=xa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new V,endPosition:new V,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new V,endPosition:new V})}}e._eventHandler.setInputAction(function(s){for(let a in zi)if(zi.hasOwnProperty(a)){let c=zi[a];if(l(c)){let u=xa(c,t);ZEt(c,t,e),r[u]&&(n[u]?(TSe(i[u],o[u]),o[u].valid=!0,TSe(s,i[u]),n[u]=!1):V.clone(s.endPosition,i[u].endPosition))}}V.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function qd(e){this._eventHandler=new Cf(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new V,xSe(this,void 0),bSe(this,void 0,e),Lw(this,void 0,zi.LEFT_DRAG),Lw(this,void 0,zi.RIGHT_DRAG),Lw(this,void 0,zi.MIDDLE_DRAG),CSe(this,void 0);for(let t in pa)if(pa.hasOwnProperty(t)){let n=pa[t];l(n)&&(xSe(this,n),bSe(this,n,e),Lw(this,n,zi.LEFT_DRAG),Lw(this,n,zi.RIGHT_DRAG),Lw(this,n,zi.MIDDLE_DRAG),CSe(this,n))}}Object.defineProperties(qd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[xa(zi.WHEEL)]||!this._update[xa(zi.WHEEL,pa.SHIFT)]||!this._update[xa(zi.WHEEL,pa.CTRL)]||!this._update[xa(zi.WHEEL,pa.ALT)];return this._buttonsDown>0||e}}});qd.prototype.isMoving=function(e,t){let n=xa(e,t);return!this._update[n]};qd.prototype.getMovement=function(e,t){let n=xa(e,t);return this._movement[n]};qd.prototype.getLastMovement=function(e,t){let n=xa(e,t),i=this._lastMovement[n];if(i.valid)return i};qd.prototype.isButtonDown=function(e,t){let n=xa(e,t);return this._isDown[n]};qd.prototype.getStartMousePosition=function(e,t){if(e===zi.WHEEL)return this._currentMousePosition;let n=xa(e,t);return this._eventStartPosition[n]};qd.prototype.getButtonPressTime=function(e,t){let n=xa(e,t);return this._pressTime[n]};qd.prototype.getButtonReleaseTime=function(e,t){let n=xa(e,t);return this._releaseTime[n]};qd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};qd.prototype.isDestroyed=function(){return!1};qd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ce(this)};var ek=qd;function q5(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Fe(n),this._stopObject=Fe(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(q5.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}}});q5.prototype.cancelTween=function(){this._tweens.remove(this)};function Tm(){this._tweens=[]}Object.defineProperties(Tm.prototype,{length:{get:function(){return this._tweens.length}}});Tm.prototype.add=function(e){if(e=e??G.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new q5(this);let t=e.duration/Yn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Yn.SECONDS_PER_MILLISECOND,o=e.easingFunction??os.LINEAR_NONE,r=e.startObject,s=new Uxe(r);s.to(Fe(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 q5(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Tm.prototype.addProperty=function(e){e=e??G.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})};Tm.prototype.addAlpha=function(e){e=e??G.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})};Tm.prototype.addOffsetIncrement=function(e){e=e??G.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})};Tm.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};Tm.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};Tm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Tm.prototype.get=function(e){return this._tweens[e]};Tm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Yn.SECONDS_PER_MILLISECOND:Si();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 lA=Tm;function nk(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=zi.LEFT_DRAG,this.zoomEventTypes=[zi.RIGHT_DRAG,zi.WHEEL,zi.PINCH],this.rotateEventTypes=zi.LEFT_DRAG,this.tiltEventTypes=[zi.MIDDLE_DRAG,zi.PINCH,{eventType:zi.LEFT_DRAG,modifier:pa.CTRL},{eventType:zi.RIGHT_DRAG,modifier:pa.CTRL}],this.lookEventTypes={eventType:zi.LEFT_DRAG,modifier:pa.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new ek(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 lA,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new V(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new V(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new V,this._strafeEndMousePosition=new V,this._zoomMouseStart=new V(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new V,this._panLastWorldPosition=new h,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 fe(Math.PI,D.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function QEt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function JEt(e){return V.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var eSt=.4;function tSt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new V,endPosition:new V,motion:new V,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<eSt){let _=QEt(p,i),m=e.getLastMovement(t,n);if(!l(m)||JEt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=V.clone(m.startPosition,a.startPosition),a.endPosition=V.multiplyByScalar(a.motion,_,a.endPosition),a.endPosition=V.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||V.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function nSt(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 ASe=[];function Vl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(ASe[0]=n,n=ASe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),_=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,_,p),nSt(e,r)):o<1&&tSt(s,f,d,o,i,e,r))}}var Y5=new _n,iSt=new h,oSt=new V,rSt=new h,sSt=new V,aSt=new h,cSt=new h,lSt=new h,uSt=new h,NSe=new h,fSt=new h,dSt=new h,hSt=new h,mSt=new h,pSt=new h,_St=new h,gSt=new h,ySt=new h,bSt=new h,xSt=new h,uA=new h,ESe=new h,SSe=new h,tJ={orientation:new qa};function lJ(e,t,n,i,o,r){let s=1;l(r)&&(s=D.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let _=a/e._scene.canvas.clientHeight;_=Math.min(_,e.maximumMovementRatio);let m=p*_;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let y=e._scene,b=y.camera,x=y.mode,T=tJ.orientation;T.heading=b.heading,T.pitch=b.pitch,T.roll=b.roll;let C=n.inertiaEnabled??V.equals(t,e._zoomMouseStart),A=e._zoomingOnVector,S=e._rotatingZoom,w;if(C||(e._zoomMouseStart=V.clone(t,e._zoomMouseStart),l(e._globe)&&x===ne.SCENE2D?(w=b.getPickRay(t,Y5).origin,w=h.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=ly(e,t,iSt)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,A=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let R=x===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(S=!0),!C||S){if(x===ne.SCENE2D){let P=e._zoomWorldPosition,O=b.position;if(!h.equals(P,O)&&b.positionCartographic.height<e._maxCoord.x*2){let L=b.position.x,g=h.subtract(P,O,rSt);h.normalize(g,g);let E=h.distance(P,O)*m/(b.getMagnitude()*.5);b.move(g,E*.5),(b.position.x<0&&L>0||b.position.x>0&&L<0)&&(w=b.getPickRay(t,Y5).origin,w=h.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition))}}else if(x===ne.SCENE3D){let P=h.normalize(b.position,NSe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(h.dot(b.direction,P))<.6)R=!0;else{let O=y.canvas,L=sSt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let g=ly(e,L,aSt);if(!l(g))R=!0;else if(b.positionCartographic.height<1e6)if(h.dot(b.direction,P)>=-.5)R=!0;else{let E=dSt;h.clone(b.position,E);let v=e._zoomWorldPosition,I=fSt;if(I=h.normalize(v,I),h.dot(I,P)<0)return;let N=xSt,F=pSt;h.clone(b.direction,F),h.add(E,h.multiplyByScalar(F,1e3,uA),N);let U=_St,k=gSt;h.subtract(v,E,U),h.normalize(U,k);let z=h.dot(P,k);if(z>=0){e._zoomMouseStart.x=-1;return}let B=Math.acos(-z),j=h.magnitude(E),W=h.magnitude(v),J=j-m,Y=h.magnitude(U),ee=Math.asin(D.clamp(Y/W*Math.sin(B),-1,1)),Q=Math.asin(D.clamp(J/W*Math.sin(B),-1,1)),de=ee-Q+B,ge=hSt;h.normalize(E,ge);let le=mSt;le=h.cross(k,ge,le),le=h.normalize(le,le),h.normalize(h.cross(ge,le,uA),F),h.multiplyByScalar(h.normalize(N,uA),h.magnitude(N)-m,N),h.normalize(E,E),h.multiplyByScalar(E,J,E);let ye=ySt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(de)-1,ESe),h.multiplyByScalar(F,Math.sin(de),SSe),uA),J,ye),h.add(E,ye,E),h.normalize(N,ge),h.normalize(h.cross(ge,le,uA),F);let xe=bSt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(de)-1,ESe),h.multiplyByScalar(F,Math.sin(de),SSe),uA),h.magnitude(N),xe),h.add(N,xe,N),h.clone(E,b.position),h.normalize(h.subtract(N,E,uA),b.direction),h.clone(b.direction,b.direction),h.cross(b.direction,b.up,b.right),h.cross(b.right,b.direction,b.up),b.setView(tJ);return}else{let E=h.normalize(g,cSt),v=h.normalize(e._zoomWorldPosition,lSt),I=h.dot(v,E);if(I>0&&I<1){let N=D.acosClamped(I),F=h.cross(v,E,uSt),U=Math.abs(N)>D.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,k=m/U;b.rotate(F,N*k)}}}}e._rotatingZoom=!R}if(!C&&R||A){let P,O=ji.worldToWindowCoordinates(y,e._zoomWorldPosition,oSt);x!==ne.COLUMBUS_VIEW&&V.equals(t,e._zoomMouseStart)&&l(O)?P=b.getPickRay(O,Y5):P=b.getPickRay(t,Y5);let L=P.direction;(x===ne.COLUMBUS_VIEW||x===ne.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),b.move(L,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(tJ)}var TSt=new _n,CSt=new _n,ASt=new h;function ESt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,TSt).origin,s=o.getPickRay(n.endPosition,CSt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,ASt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function vSe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;lJ(e,t,n,e.zoomFactor,o.getMagnitude())}var SSt=new V,vSt=new V;function wSe(e,t,n){if(l(n.angleAndHeight)){wSt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=SSt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=V.normalize(c,c);let u=vSt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=V.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;o.twistRight(p)}function wSt(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 ISt(e){let t=e._scene.mapMode2D===Au.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Vl(e,e.enableTranslate,e.translateEventTypes,ESt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Vl(e,e.enableZoom,e.zoomEventTypes,vSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Vl(e,e.enableRotate,e.tiltEventTypes,wSe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Vl(e,e.enableZoom,e.zoomEventTypes,vSe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Vl(e,e.enableRotate,e.translateEventTypes,wSe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var FSe=new _n,PSt=new h,DSt=new h;function ly(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,PSt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,FSe),u=o.pickWorldCoordinates(c,i,a,DSt),f=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var RSt=new fe;function e6(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,RSt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var OSt=new h;function BSe(e,t){let n=t.origin,i=t.direction,o=e6(e),r=h.normalize(n,OSt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function kSe(e,t,n,i){let o=h.distance(t.origin,n),r=e6(e),s=D.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),_n.getPoint(t,o,i)}function USe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=e6(e))):o=e6(e),_n.getPoint(t,o,i)}var MSt=new V;function zSe(e,t){let n=t.endPosition,i=V.subtract(t.endPosition,t.startPosition,MSt),o=e._strafeEndMousePosition;V.add(o,i,o),t.endPosition=o,uJ(e,t,e._strafeStartPosition),t.endPosition=n}var ISe=new _n,LSt=new _n,nJ=new h,NSt=new h,FSt=new h,BSt=new h,kSt=new en(h.UNIT_X,0),USt=new V,zSt=new V;function VSt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Pf(e,t,n);return}if(e._strafing){zSe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=V.clone(n.startPosition,USt),a=V.clone(n.endPosition,zSt),c=o.getPickRay(s,ISe),u=h.clone(h.ZERO,BSt),f=h.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=ly(e,s,nJ),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let C=d;r&&(C=USe(e,c,d,nJ)),V.clone(t,e._strafeMousePosition),V.clone(t,e._strafeEndMousePosition),h.clone(C,e._strafeStartPosition),e._strafing=!0,uJ(e,n,e._strafeStartPosition);return}let p=en.fromPointNormal(u,f,kSt);c=o.getPickRay(s,ISe);let _=ti.rayPlane(c,p,nJ),m=o.getPickRay(a,LSt),y=ti.rayPlane(m,p,NSt);if(!l(_)||!l(y)){e._looking=!0,Pf(e,t,n),V.clone(t,e._translateMousePosition);return}let b=h.subtract(_,y,FSt),x=b.x;b.x=b.y,b.y=b.z,b.z=x;let T=h.magnitude(b);T>D.EPSILON6&&(h.normalize(b,b),o.move(b,T))}var VSe=new V,$5=new _n,Z5=new h,HSt=new h,HSe=new M,GSt=new M,jSt=new h,WSt=new en(h.UNIT_X,0),iJ=new h,sJ=new fe,GSe=new M,qSt=new Pe,YSt=new Z,Q5=new h;function XSt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),V.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Pf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,KSt(e,t,n)):$St(e,t,n)}function KSt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=VSe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,$5),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Pf(e,t,n),V.clone(t,e._tiltCenterMousePosition);return}let _=h.multiplyByScalar(f,d,Z5);h.add(u,_,_);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(_.y,_.z,_.x,_);let b=m.unproject(_,sJ);y.cartographicToCartesian(b,_);let x=At.eastNorthUpToFixedFrame(_,y,HSe),T=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=M.clone(o.transform,GSe);o._setTransform(x),If(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=T,e._ellipsoid=C;let S=C.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function $St(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(V.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,Z5);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=ly(e,t,Z5)),!l(s)){a=o.getPickRay(t,$5);let g=a.origin,E=a.direction,v,I=h.dot(c,E);if(Math.abs(I)>D.EPSILON6&&(v=-h.dot(c,g)/I),!l(v)||v<=0){e._looking=!0,Pf(e,t,n),V.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(E,v,Z5),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,$5)),kSe(e,a,s,s)),V.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=VSe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,$5);let d=h.clone(h.ZERO,jSt);d.x=s.x;let p=en.fromPointNormal(d,c,WSt),_=ti.rayPlane(a,p,HSt),m=o._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,sJ);y.cartographicToCartesian(b,s);let x=At.eastNorthUpToFixedFrame(s,y,HSe),T;l(_)?(h.fromElements(_.y,_.z,_.x,_),b=m.unproject(_,sJ),y.cartographicToCartesian(b,_),T=At.eastNorthUpToFixedFrame(_,y,GSt)):T=x;let C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=M.clone(o.transform,GSe);o._setTransform(x);let R=h.cross(h.UNIT_Z,h.normalize(o.position,iJ),iJ),P=h.dot(o.right,R);if(If(e,t,n,S,!1,!0),o._setTransform(T),P<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(S=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,If(e,t,n,S,!0,!1),o.constrainedAxis=E}else If(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,Q5);h.equalsEpsilon(g,h.ZERO,D.EPSILON6)||(h.dot(g,o.right)<0&&h.negate(g,g),h.cross(g,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(w),e._globe=C,e._ellipsoid=A;let O=A.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,iJ);if(e.enableCollisionDetection&&hJ(e,!0),!h.equals(o.positionWC,L)){o._setTransform(T),o.worldToCameraCoordinatesPoint(L,L);let g=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>g&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(g),o.position));let E=h.angleBetween(L,o.position),v=h.cross(L,o.position,L);h.normalize(v,v);let I=Pe.fromAxisAngle(v,E,qSt),N=Z.fromQuaternion(I,YSt);Z.multiplyByVector(N,o.direction,o.direction),Z.multiplyByVector(N,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(w)}}var jSe=new V,WSe=new _n,qSe=new h;function ZSt(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=jSe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,WSe),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=ly(e,a,qSe));let _;if(l(p)&&(_=h.distance(u,p)),s){let m=BSe(e,c,d);l(_)?_=Math.min(_,m):_=m}if(!l(_)){let m=h.UNIT_X;_=-h.dot(m,u)/h.dot(m,f)}lJ(e,t,n,e.zoomFactor,_)}function QSt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Vl(e,e.enableRotate,e.rotateEventTypes,If,e.inertiaSpin,"_lastInertiaSpinMovement"),Vl(e,e.enableZoom,e.zoomEventTypes,XSe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Vl(e,e.enableTilt,e.tiltEventTypes,XSt,e.inertiaSpin,"_lastInertiaTiltMovement"),Vl(e,e.enableTranslate,e.translateEventTypes,VSt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Vl(e,e.enableZoom,e.zoomEventTypes,ZSt,e.inertiaZoom,"_lastInertiaZoomMovement"),Vl(e,e.enableLook,e.lookEventTypes,Pf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var JSt=new _n,evt=new en(h.UNIT_X,0),tvt=new h,nvt=new h;function uJ(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,JSt),s=h.clone(o.direction,nvt);i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=en.fromPointNormal(n,s,evt),c=ti.rayPlane(r,a,tvt);l(c)&&(s=h.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var PSe=new h,YSe=new fe,aJ=new h,cJ=new te,ivt=new h,ovt=new h,rvt=new h;function svt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){If(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,ivt);if(V.equals(t,e._rotateMousePosition)){if(e._looking)Pf(e,t,n,u);else if(e._rotating)If(e,t,n);else if(e._strafing)zSe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=aJ,c.x=c.y=c.z=a,s=te.fromCartesian3(c,cJ),rJ(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,YSe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=ly(e,n.startPosition,rvt);if(l(p)){let _=!1,m=o.getPickRay(n.startPosition,FSe);if(r)_=!0,USe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,ovt);Math.abs(h.dot(m.direction,y))<.05?_=!0:_=h.magnitude(o.position)<h.magnitude(p)}_?(V.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,uJ(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=aJ,c.x=c.y=c.z=a,s=te.fromCartesian3(c,cJ),rJ(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Pf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,PSe))?(rJ(e,t,n,e._ellipsoid),h.clone(PSe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,If(e,t,n)):(e._looking=!0,Pf(e,t,n,u));V.clone(t,e._rotateMousePosition)}function If(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,_=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*_*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let b=e.maximumTiltAngle,x=h.dot(a.direction,i),T=Math.PI-Math.acos(x)+y;T>b&&(y-=T-b)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var oJ=ie.clone(ie.UNIT_W),DSe=ie.clone(ie.UNIT_W),X5=new h,Nw=new h,K5=new h,RSe=new h,avt=new V,cvt=new V,lvt=new V,uvt=new V,fvt=new _n;function rJ(e,t,n,i){let o=e._scene,r=o.camera,s=V.clone(n.startPosition,avt),a=V.clone(n.endPosition,cvt),c=i.cartesianToCartographic(r.positionWC,YSe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,oJ),!l(e._globe)&&!V.equalsEpsilon(s,e._panLastMousePosition)&&(u=ly(e,s,oJ)),!l(e._globe)&&l(u))){let d=h.subtract(u,r.positionWC,Nw),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,d),Nw),_=h.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,_,o.pixelRatio,uvt),y=V.subtract(a,s,lvt),b=h.multiplyByScalar(r.rightWC,y.x*m.x,Nw),x=h.normalize(r.positionWC,NSe),T=r.getPickRay(a,fvt).direction,C=h.subtract(T,h.projectVector(T,r.rightWC,K5),K5),A=h.angleBetween(C,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(A),.1));let w=Math.abs(h.dot(r.directionWC,x)),R=-y.y*m.y*2/Math.sqrt(S)*(1-w),P=h.multiplyByScalar(T,R,K5);w=Math.abs(h.dot(r.upWC,x));let O=h.multiplyByScalar(r.upWC,-y.y*(1-w)*m.y,RSe);f=h.add(u,b,DSe),f=h.add(f,P,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),V.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,oJ),f=r.pickEllipsoid(a,i,DSe)),!l(u)||!l(f)){e._rotating=!0,If(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=h.mostOrthogonalAxis(d,X5);h.cross(p,d,p),h.normalize(p,p);let _=h.cross(d,p,Nw),m=h.magnitude(u),y=h.dot(d,u),b=Math.acos(y/m),x=h.multiplyByScalar(d,y,K5);h.subtract(u,x,x),h.normalize(x,x);let T=h.magnitude(f),C=h.dot(d,f),A=Math.acos(C/T),S=h.multiplyByScalar(d,C,RSe);h.subtract(f,S,S),h.normalize(S,S);let w=Math.acos(h.dot(x,p));h.dot(x,_)<0&&(w=D.TWO_PI-w);let R=Math.acos(h.dot(S,p));h.dot(S,_)<0&&(R=D.TWO_PI-R);let P=w-R,O;h.equalsEpsilon(d,r.position,D.EPSILON2)?O=r.right:O=h.cross(d,r.position,X5);let L=h.cross(d,O,X5),g=h.dot(L,h.subtract(u,d,Nw)),E=h.dot(L,h.subtract(f,d,Nw)),v;g>0&&E>0?v=A-b:g>0&&E<=0?h.dot(r.position,d)>0?v=-b-A:v=b+A:v=b-A,r.rotateRight(P),r.rotateUp(v)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,X5);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let _=Math.acos(d);r.rotate(p,_)}}}var dvt=new h,hvt=new fe,OSe=0;function XSe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=jSe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,WSe),d,p=o.cartesianToCartographic(s.position,hvt).height,_=Math.abs(OSe)<e.minimumPickingTerrainDistanceWithInertia;(i?_:p<e._minimumPickingTerrainHeight)&&(d=ly(e,u,qSe));let y;if(l(d)&&(y=h.distance(f.origin,d),OSe=y),c){let x=BSe(e,f,p);l(y)?y=Math.min(y,x):y=x}l(y)||(y=p);let b=h.normalize(s.position,dvt);lJ(e,t,n,e.zoomFactor,y,h.dot(b,s.direction))}var KSe=new V,J5=new _n,tk=new h,mvt=new h,$Se=new M,pvt=new M,ZSe=new M,_vt=new Pe,gvt=new Z,fJ=new fe,dJ=new h;function yvt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),V.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,dJ);Pf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,fJ);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,xvt(e,t,n)):Tvt(e,t,n)}var bvt=new fe;function xvt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,bvt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=KSe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,J5),d,p=ti.rayEllipsoid(f,i);if(l(p))d=_n.getPoint(f,p.start,tk);else if(a>e._minimumTrackBallHeight){let T=ti.grazingAltitudeLocation(f,i);if(!l(T))return;let C=i.cartesianToCartographic(T,fJ);C.height=0,d=i.cartographicToCartesian(C,tk)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(r.position,dJ);Pf(e,t,n,T),V.clone(t,e._tiltCenterMousePosition);return}let _=At.eastNorthUpToFixedFrame(d,i,$Se),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=M.clone(r.transform,ZSe);r._setTransform(_),If(e,t,n,h.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=y;let x=y.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Tvt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(V.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,tk);else{if(a=ly(e,t,tk),!l(a)){if(c=r.getPickRay(t,J5),u=ti.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,fJ).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,dJ);Pf(e,t,n,E),V.clone(t,e._tiltCenterMousePosition)}return}a=_n.getPoint(c,u.start,tk)}s&&(l(c)||(c=r.getPickRay(t,J5)),kSe(e,c,a,a)),V.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=o.canvas,d=KSe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,J5);let p=h.magnitude(a),_=h.fromElements(p,p,p,aJ),m=te.fromCartesian3(_,cJ);if(u=ti.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,b=_n.getPoint(c,y,mvt),x=At.eastNorthUpToFixedFrame(a,i,$Se),T=At.eastNorthUpToFixedFrame(b,m,pvt),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=M.clone(r.transform,ZSe);r._setTransform(T);let R=h.cross(b,r.positionWC,Q5);if(h.dot(r.rightWC,R)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(S=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,If(e,t,n,S,!0,!1),r.constrainedAxis=E}else If(e,t,n,S,!0,!1);if(r._setTransform(x),If(e,t,n,S,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,Q5);h.equalsEpsilon(g,h.ZERO,D.EPSILON6)||(h.dot(g,r.right)<0&&h.negate(g,g),h.cross(g,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(w),e._globe=C,e._ellipsoid=A;let O=A.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,Q5);if(e.enableCollisionDetection&&hJ(e,!0),!h.equals(r.positionWC,L)){r._setTransform(T),r.worldToCameraCoordinatesPoint(L,L);let g=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>g&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(g),r.position));let E=h.angleBetween(L,r.position),v=h.cross(L,r.position,L);h.normalize(v,v);let I=Pe.fromAxisAngle(v,E,_vt),N=Z.fromQuaternion(I,gvt);Z.multiplyByVector(N,r.direction,r.direction),Z.multiplyByVector(N,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(w)}}var Cvt=new V,Avt=new V,MSe=new _n,LSe=new _n,Evt=new h,Svt=new h;function Pf(e,t,n,i){let r=e._scene.camera,s=Cvt;s.x=n.startPosition.x,s.y=0;let a=Avt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,MSe),u=r.getPickRay(a,LSe),f=0,d,p;r.frustum instanceof cn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let _=h.dot(d,p);_<1&&(f=Math.acos(_)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,MSe),u=r.getPickRay(a,LSe),f=0,r.frustum instanceof cn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),_=h.dot(d,p),_<1&&(f=Math.acos(_)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=r.direction,b=h.negate(i,Evt),x=h.equalsEpsilon(y,i,D.EPSILON2),T=h.equalsEpsilon(y,b,D.EPSILON2);if(!x&&!T){_=h.dot(y,i);let C=D.acosClamped(_);f>0&&f>C&&(f=C-D.EPSILON4),_=h.dot(y,b),C=D.acosClamped(_),f<0&&-f>C&&(f=-C+D.EPSILON4);let A=h.cross(i,y,Svt);r.look(A,f)}else(x&&f<0||T&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function vvt(e){Vl(e,e.enableRotate,e.rotateEventTypes,svt,e.inertiaSpin,"_lastInertiaSpinMovement"),Vl(e,e.enableZoom,e.zoomEventTypes,XSe,e.inertiaZoom,"_lastInertiaZoomMovement"),Vl(e,e.enableTilt,e.tiltEventTypes,yvt,e.inertiaSpin,"_lastInertiaTiltMovement"),Vl(e,e.enableLook,e.lookEventTypes,Pf)}var wvt=new M,Ivt=new fe;function hJ(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=n.ellipsoid??te.WGS84,s=n.mapProjection,a,c;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,wvt),c=h.magnitude(o.position),o._setTransform(M.IDENTITY));let u=Ivt;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,_=d-e._lastGlobeHeight,m=_/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=_*.1}}l(a)&&(o._setTransform(a),f&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}nk.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Pvt=new h,Dvt=new h;nk.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Or.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Or.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Or.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=h.clone(t.positionWC,Pvt),c=h.clone(t.directionWC,Dvt);if(i===ne.SCENE2D?ISt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,QSt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,vvt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);hJ(this,u)}this._aggregator.reset()};nk.prototype.isDestroyed=function(){return!1};nk.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ce(this)};var ik=nk;var ok=`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 rk=`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 uy(){this._sceneFramebuffer=new JC;let e=.125,t=new Array(6);t[0]=new yo({fragmentShader:Eu,textureScale:e,forcePowerOfTwo:!0,sampleMode:vf.LINEAR});let n=t[1]=new yo({fragmentShader:rk,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new V,t[2]=new yo({fragmentShader:Pb,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 yo({fragmentShader:Pb,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 yo({fragmentShader:Eu,sampleMode:vf.LINEAR}),this._uCenter=new V,this._uRadius=void 0,t[5]=new yo({fragmentShader:ok,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Su({stages:t});let o=new sA(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}uy.prototype.get=function(e){return this._stages.get(e)};uy.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 Rvt=new ie,QSe=new V,Ovt=new V,JSe=new M;function Mvt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,JSe),u=M.multiplyByPoint(r,o,Rvt),f=At.pointToGLWindowCoordinates(s,c,o,QSe);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=V.magnitude(V.subtract(d,f,d))*30*2,_=Ovt;_.x=p,_.y=p,e._uCenter=V.clone(f,e._uCenter),e._uRadius=Math.max(_.x,_.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,b=e._stages,x=b.get(0),T=x.outputTexture.width,C=x.outputTexture.height,A=new Xe;A.width=T,A.height=C,c=M.computeViewportTransformation(A,0,1,JSe),f=At.pointToGLWindowCoordinates(s,c,o,QSe),_.x*=T/m,_.y*=C/y;let S=x.scissorRectangle;S.x=Math.max(f.x-_.x*.5,0),S.y=Math.max(f.y-_.y*.5,0),S.width=Math.min(_.x,m),S.height=Math.min(_.y,y);for(let w=1;w<4;++w)Xe.clone(S,b.get(w).scissorRectangle)}uy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};uy.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),Mvt(this,t,n),o};uy.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)};uy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Eu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};uy.prototype.isDestroyed=function(){return!1};uy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ce(this)};var sk=uy;function eve(){this._cachedShowFrustumsShaders={}}function Lvt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Nvt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Be.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=Lvt(i);return Xt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var ak=new H;function Fvt(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=H.fromRandom()),t._debugColor):H.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(ak.red=t.debugOverlappingFrustums&1?1:0,ak.green=t.debugOverlappingFrustums&2?1:0,ak.blue=t.debugOverlappingFrustums&4?1:0,ak.alpha=1,ak):H.WHITE}),n}var Bvt=new qe;eve.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Nvt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=qe.shallowClone(t,Bvt);r.shaderProgram=o,r.uniformMap=Fvt(e,t),r.execute(e.context,n)};var ck=eve;function fA(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new In}fA.fromKeyframeNode=function(e,t,n,i){let o=new fA(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=kvt(e,s,n),o._orientedBoundingBox=zvt(e,r,n,o._orientedBoundingBox),o};function kvt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[c]=f}return s}var tve=new h,Uvt=new h;function zvt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=h.fromElements(u,c,s,tve),d=h.divideComponents(h.subtract(f,e._paddingBefore,tve),e.dimensions,Uvt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(fA.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()}}});fA.prototype.hasProperty=function(e){return l(this._metadata[e])};fA.prototype.getNames=function(){return Object.keys(this._metadata)};fA.prototype.getProperty=function(e){return this._metadata[e]};var lk=fA;var uk=`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 fk=`// 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 dk=`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 hk=`/* 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 mk=`// 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 pk=`// 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 Fw=`// 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 _k=`// 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 gk=`// 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 yk=`// 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 dA=`// 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 bk=`/* 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 xk=`/* 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 Tk=`/* 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 Ck=`// 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 Ak=`// 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 Vvt={Z_UP:0,Y_UP:1},Yd=Object.freeze(Vvt);function Hvt(e){let t=new px;this.shaderBuilder=t;let n=e._customShader,i=ct(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let _=o[p];t.addUniform(_.type,p,pe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",pe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([dk]),e.provider.metadataOrder===Yd.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,pe.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,pe.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,pe.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,pe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",Ck,uk,hk,Ak]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,pe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,pe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,pe.FRAGMENT),t.addFragmentLines([pk])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,pe.FRAGMENT),t.addFragmentLines([mk])),a==="BOX"?t.addFragmentLines([bk,_k,dA]):a==="CYLINDER"?t.addFragmentLines([xk,Fw,gk,dA]):a==="ELLIPSOID"&&t.addFragmentLines([Tk,Fw,yk,dA]),t.addFragmentLines([fk]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let _=u[p];l(_)&&(_=_===!0?void 0:_,t.addDefine(p,_,pe.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,pe.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,pe.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,pe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,pe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,pe.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,pe.FRAGMENT)}var Ek=Hvt;function Gvt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,pe.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,pe.FRAGMENT);for(let P=0;P<c;P++){let O=i[P],L=o[P],g=`PropertyStatistics_${O}`,E=`PropertyStatistics_${O}`;n.addStruct(g,E,pe.FRAGMENT);let v=t6(L);n.addStructField(g,v,"min"),n.addStructField(g,v,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,pe.FRAGMENT);for(let P=0;P<c;P++){let O=i[P],L=`PropertyStatistics_${O}`,g=O;n.addStructField(f,L,g)}let _="Metadata",m="Metadata",y="metadata";n.addStruct(_,m,pe.FRAGMENT),n.addStructField(_,d,p);for(let P=0;P<c;P++){let O=i[P],L=o[P],g=t6(L);n.addStructField(_,g,O)}for(let P=0;P<c;P++){let O=i[P],L=o[P],g=Wvt(L),E=`VoxelProperty_${O}`,v=`VoxelProperty_${O}`;n.addStruct(E,v,pe.FRAGMENT),n.addStructField(E,g,"partialDerivativeLocal"),n.addStructField(E,g,"partialDerivativeWorld"),n.addStructField(E,g,"partialDerivativeView"),n.addStructField(E,g,"partialDerivativeValid")}let b="Voxel",x="Voxel",T="voxel";n.addStruct(b,x,pe.FRAGMENT);for(let P=0;P<c;P++){let O=i[P],L=`VoxelProperty_${O}`;n.addStructField(b,L,O)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let C="FragmentInput";n.addStruct(C,"FragmentInput",pe.FRAGMENT),n.addStructField(C,m,y),n.addStructField(C,x,T);let S="Properties",w="Properties",R="properties";n.addStruct(S,w,pe.FRAGMENT);for(let P=0;P<c;P++){let O=i[P],L=o[P],g=t6(L);n.addStructField(S,g,O)}{let P="clearProperties";n.addFunction(P,`${w} clearProperties()`,pe.FRAGMENT),n.addFunctionLines(P,[`${w} ${R};`]);for(let O=0;O<c;O++){let L=i[O],g=o[O],E=r[O],v=t6(g,E);n.addFunctionLines(P,[`${R}.${L} = ${v}(0.0);`])}n.addFunctionLines(P,[`return ${R};`])}{let P="sumProperties";n.addFunction(P,`${w} sumProperties(${w} propertiesA, ${w} propertiesB)`,pe.FRAGMENT),n.addFunctionLines(P,[`${w} ${R};`]);for(let O=0;O<c;O++){let L=i[O];n.addFunctionLines(P,[`${R}.${L} = propertiesA.${L} + propertiesB.${L};`])}n.addFunctionLines(P,[`return ${R};`])}{let P="scaleProperties";n.addFunction(P,`${w} scaleProperties(${w} ${R}, float scale)`,pe.FRAGMENT),n.addFunctionLines(P,[`${w} scaledProperties = ${R};`]);for(let O=0;O<c;O++){let L=i[O];n.addFunctionLines(P,[`scaledProperties.${L} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${w} mixProperties(${w} propertiesA, ${w} propertiesB, float mixFactor)`,pe.FRAGMENT),n.addFunctionLines(P,[`${w} ${R};`]);for(let O=0;O<c;O++){let L=i[O];n.addFunctionLines(P,[`${R}.${L} = mix(propertiesA.${L}, propertiesB.${L}, mixFactor);`])}n.addFunctionLines(P,[`return ${R};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${w} ${R}, inout ${m} ${y})`,pe.FRAGMENT);for(let O=0;O<c;O++){let L=i[O];n.addFunctionLines(P,[`${y}.${L} = ${R}.${L};`])}}if(u){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${d} ${p})`,pe.FRAGMENT);for(let O=0;O<c;O++){let L=i[O],g=o[O],E=at.getComponentCount(g);for(let v=0;v<E;v++){let I=qvt(g,v),N=s[O][v],F=a[O][v];!l(N)||!l(F)||n.addFunctionLines(P,[`${p}.${L}.min${I} = ${nve(N)};`,`${p}.${L}.max${I} = ${nve(F)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${w} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,pe.FRAGMENT),n.addFunctionLines(P,[`${w} ${R};`]);for(let O=0;O<c;O++){let L=i[O],g=o[O],E=r[O],v=jvt(g,E);n.addFunctionLines(P,[`properties.${L} = texture(u_megatextureTextures[${O}], texcoord)${v};`])}n.addFunctionLines(P,[`return ${R};`])}}function t6(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function jvt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function Wvt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function nve(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function qvt(e,t){return e===at.SCALAR?"":`[${t}]`}var Sk=Gvt;function Yvt(e,t){let n=new Ek(e);Sk(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let x="getClippingPlane",T=Zg(o,t),C=0,A=T.indexOf(")")+1,S=T.indexOf("{",A)+1,w=T.indexOf("}",S),R=T.slice(C,A),P=T.slice(S,w);i.addFunction(x,R,pe.FRAGMENT),i.addFunctionLines(x,[P])}let s=i.clone();s.addDefine("PICKING",void 0,pe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,pe.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),d=ze.fromCache({cull:{enabled:!0,face:Ai.BACK},depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),_=e._depthTest,m=new qe({vertexArray:p,primitiveType:Le.TRIANGLES,renderState:d,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Se.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),y=qe.shallowClone(m,new qe);y.shaderProgram=u,y.pickOnly=!0;let b=qe.shallowClone(m,new qe);if(b.shaderProgram=f,b.pickOnly=!0,l(e._drawCommand)){let x=e._drawCommand;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(l(e._drawCommandPick)){let x=e._drawCommandPick;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let x=e._drawCommandPickVoxel;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=b}var vk=Yvt;var Xvt={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"},Bw=Object.freeze(Xvt);function kw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}kw.prototype.getTexture=function(e){return this._textures[e]};function Kvt(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})}kw.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Kvt(this,e,t)};function $vt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?n6(o,r,n):Zvt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function n6(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?ove(e,n):new dt({context:n,source:t,sampler:o});return ive(o)&&r.generateMipmap(),r}function Zvt(e,t,n){let{typedArray:i,sampler:o}=e,r=ive(o),s=o.wrapS===sn.REPEAT||o.wrapS===sn.MIRRORED_REPEAT||o.wrapT===sn.REPEAT||o.wrapT===sn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===He.UNSIGNED_BYTE){let d=iB(i,a,c),p=n0(d);return n6({sampler:o},p,n)}}else{let d=n0(t);return n6(e,d,n)}else return n6(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."),ove(e,n)}function ive(e){return[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function ove(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}kw.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];$vt(this,o,t)}n.length=0};kw.prototype.isDestroyed=function(){return!1};kw.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 ce(this)};var wk=kw;function Ik(e){e=e??G.EMPTY_OBJECT,this.mode=e.mode??Q_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??G.EMPTY_OBJECT,this.varyings=e.varyings??G.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??_0.INHERIT,this._textureManager=new wk,this._defaultTexture=void 0,this.uniformMap=Qvt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},twt(this),nwt(this)}function Qvt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===Bw.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Jvt(e,i)):n[i]=ewt(e,i)}return n}function Jvt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function ewt(e,t){return function(){return e.uniforms[t].value}}function hA(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function twt(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,hA(r,t,o),o=e.usedVariablesVertex.featureIdSet,hA(r,n,o),o=e.usedVariablesVertex.metadataSet,hA(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,hA(s,t,o),o=e.usedVariablesFragment.featureIdSet,hA(s,n,o),o=e.usedVariablesFragment.metadataSet,hA(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;hA(s,a,c)}}function rve(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 Qc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${rve(t)} is not available in the ${i} shader. Did you mean ${rve(n)} instead?`;throw new he(o)}}function nwt(e){let t=e.usedVariablesVertex.attributeSet;Qc(t,"position","positionMC","vertex"),Qc(t,"normal","normalMC","vertex"),Qc(t,"tangent","tangentMC","vertex"),Qc(t,"bitangent","bitangentMC","vertex"),Qc(t,"positionWC","positionMC","vertex"),Qc(t,"positionEC","positionMC","vertex"),Qc(t,"normalEC","normalMC","vertex"),Qc(t,"tangentEC","tangentMC","vertex"),Qc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Qc(n,"position","positionEC","fragment"),Qc(n,"normal","normalEC","fragment"),Qc(n,"tangent","tangentEC","fragment"),Qc(n,"bitangent","bitangentEC","fragment"),Qc(n,"normalMC","normalEC","fragment"),Qc(n,"tangentMC","tangentEC","fragment"),Qc(n,"bitangentMC","bitangentEC","fragment")}Ik.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Bw.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};Ik.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};Ik.prototype.isDestroyed=function(){return!1};Ik.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ce(this)};var mA=Ik;function fy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(fy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});fy.fromMetadataArray=function(e){return new fy({metadata:e})};fy.fromGltf=async function(e){let t=new Ph({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new fy({loader:t})};fy.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=iwt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function iwt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let d=c[o[f]].attribute,p=e.find(b=>b.name===d);if(!l(p))continue;let _=Ft.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=K.createArrayBufferView(_,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ce(this)};var pA=fy;function Up(){this.orientedBoundingBox=new In,this.boundingSphere=new re,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=Up.DefaultMinBounds.clone(),this._maxBounds=Up.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var owt=new h,mJ=new h,rwt=new Z,swt=new h,awt=new h,cwt=new h,lwt=new h,sve=M.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new h(.5,.5,.5),new M);Up.prototype.update=function(e,t,n,i,o){i=i??t.clone(swt),o=o??n.clone(awt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,cwt),s=h.clamp(n,i,o,lwt),a=M.getScale(e,mJ);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=_J(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:c,shaderDefines:u}=this;for(let _ in u)u.hasOwnProperty(_)&&(u[_]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,c.renderMinBounds=M.multiplyByPoint(sve,r,c.renderMinBounds),c.renderMaxBounds=M.multiplyByPoint(sve,s,c.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let d=t,p=n;return c.boxUvToShapeUvScale=h.fromElements(2/(d.x===p.x?1:p.x-d.x),2/(d.y===p.y?1:p.y-d.y),2/(d.z===p.z?1:p.z-d.z),c.boxUvToShapeUvScale),c.boxUvToShapeUvTranslate=h.fromElements(-c.boxUvToShapeUvScale.x*(d.x*.5+.5),-c.boxUvToShapeUvScale.y*(d.y*.5+.5),-c.boxUvToShapeUvScale.z*(d.z*.5+.5),c.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var i6=new h,pJ=new h;Up.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(r.x,s.x,a*t),D.lerp(r.y,s.y,a*n),D.lerp(r.z,s.z,a*i),i6),u=h.fromElements(D.lerp(r.x,s.x,a*(t+1)),D.lerp(r.y,s.y,a*(n+1)),D.lerp(r.z,s.z,a*(i+1)),pJ);return _J(c,u,this.shapeTransform,o)};var ave=new h;Up.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,ave),s=h.multiplyByScalar(r,o,ave),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,i6),o,i6),c=h.add(a,s,pJ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),i6),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),pJ);return _J(d,p,this.shapeTransform,i)};Up.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Up.DefaultMaxBounds=Object.freeze(new h(1,1,1));function _J(e,t,n,i){let o=Up.DefaultMinBounds,r=Up.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,mJ),c=h.midpoint(e,t,owt);i.center=M.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),mJ);let u=M.getRotation(n,rwt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var _A=Up;function dy(){this.orientedBoundingBox=new In,this.boundingSphere=new re,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=dy.DefaultMinBounds.clone(),this._maxBounds=dy.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new V,cylinderRenderAngleMinMax:new V,cylinderRenderHeightMinMax:new V,cylinderUvToShapeUvRadius:new V,cylinderUvToShapeUvAngle:new V,cylinderUvToShapeUvHeight:new V,cylinderShapeUvAngleMinMax:new V,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 uve=new h,uwt=new h,fwt=new h,dwt=new h,hwt=new h;dy.prototype.update=function(e,t,n,i,o){i=i??t.clone(uwt),o=o??n.clone(fwt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=dy,a=s.y-r.y,c=.5*a,u=D.EPSILON10,f=D.EPSILON3,d=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),o.y=D.negativePiToPi(o.y);let p=h.maximumByComponent(t,i,dwt),_=h.minimumByComponent(n,o,hwt),m=M.getScale(e,uve);if(_.x===0||p.x>_.x||p.z>_.z||D.equalsEpsilon(m.x,0,void 0,u)||D.equalsEpsilon(m.y,0,void 0,u)||D.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=bJ(p,_,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,b=n.y<t.y,x=n.y-t.y+b*a,T=x>c+d&&x<a-d,C=x<c-d,A=x>=c-d&&x<=c+d,S=T||C||A,w=D.equalsEpsilon(t.y,r.y,void 0,f),R=D.equalsEpsilon(n.y,s.y,void 0,f),P=t.z===r.z&&n.z===s.z,O=p.x===r.x,L=_.y<p.y,g=_.y-p.y+L*a,E=g>=c-d&&g<a-d,v=g>d&&g<c-d,I=g<=d,N=E||v||I,{shaderUniforms:F,shaderDefines:U}=this;for(let z in U)U.hasOwnProperty(z)&&(U[z]=void 0);let k=0;if(U.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=k,k+=1,O||(U.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,U.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=k,k+=1),F.cylinderRenderRadiusMinMax=V.fromElements(p.x,_.x,F.cylinderRenderRadiusMinMax),p.x===_.x&&(U.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){U.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let z=n.x-t.x,B=0,j=1;z!==0&&(B=1/z,j=-t.x/z),F.cylinderUvToShapeUvRadius=V.fromElements(B,j,F.cylinderUvToShapeUvRadius)}if(!P){U.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let z=n.z-t.z,B=0,j=1;z!==0&&(B=2/z,j=-(t.z+1)/z),F.cylinderUvToShapeUvHeight=V.fromElements(B,j,F.cylinderUvToShapeUvHeight)}if(F.cylinderRenderHeightMinMax=V.fromElements(p.z,_.z,F.cylinderRenderHeightMinMax),b&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,U.CYLINDER_INTERSECTION_INDEX_ANGLE=k,E?(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,k+=1):v?(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,k+=2):I&&(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,k+=2),F.cylinderRenderAngleMinMax=V.fromElements(p.y,_.y,F.cylinderRenderAngleMinMax)),S){U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,w&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),R&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let z=(t.y-r.y)/a,B=(n.y-r.y)/a,j=1-x/a;if(F.cylinderShapeUvAngleMinMax=V.fromElements(z,B,F.cylinderShapeUvAngleMinMax),F.cylinderShapeUvAngleRangeZeroMid=(B+.5*j)%1,x<=d)F.cylinderUvToShapeUvAngle=V.fromElements(0,1,F.cylinderUvToShapeUvAngle);else{let W=a/x,J=-(t.y-r.y)/x;F.cylinderUvToShapeUvAngle=V.fromElements(W,J,F.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=k,!0};var o6=new h,yJ=new h;dy.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(r.x,s.x,t*a),D.lerp(r.y,s.y,n*a),D.lerp(r.z,s.z,i*a),o6),u=h.fromElements(D.lerp(r.x,s.x,(t+1)*a),D.lerp(r.y,s.y,(n+1)*a),D.lerp(r.z,s.z,(i+1)*a),yJ);return bJ(c,u,this.shapeTransform,o)};var cve=new h;dy.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,cve),s=h.multiplyByScalar(r,o,cve),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,o6),o,o6),c=h.add(a,s,yJ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),o6),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),yJ);return bJ(d,p,this.shapeTransform,i)};dy.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));dy.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var mwt=5,pwt=new Array(mwt),_wt=new h,gwt=new Z,ywt=new M,bwt=new M,xwt=new M,gJ=new M,Twt=new h,Cwt=new h,Awt=new h,fve=new Array(8);for(let e=0;e<8;e++)fve[e]=new h;function lve(e,t,n){return Math.abs(ie.dot(e,t))<n}function Ewt(e){let t=M.getColumn(e,0,Twt),n=M.getColumn(e,1,Cwt),i=M.getColumn(e,2,Awt),o=D.EPSILON4;return lve(t,n,o)&&lve(n,i,o)}function Swt(e,t){let n=fve;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return In.fromPoints(n,t)}function bJ(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=pwt,_=0;p[_++]=s,p[_++]=a,p[_++]=d,f>D.PI&&(p[_++]=d-D.PI_OVER_TWO,p[_++]=d+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let F=0;F<_;++F){let U=p[F]-d,k=Math.cos(U),z=Math.sin(U),B=k*o,j=z*o,W=k*r,J=z*r;m=Math.min(m,B,W),y=Math.min(y,j,J),b=Math.max(b,B,W),x=Math.max(x,j,J)}let T=b-m,C=x-y,A=u-c,S=(m+b)*.5,w=(y+x)*.5,R=(c+u)*.5,P=h.fromElements(S,w,R,_wt),O=Z.fromRotationZ(d,gwt),L=h.fromElements(T,C,A,uve),g=M.fromScale(L,xwt),E=M.fromRotation(O,bwt),v=M.fromTranslation(P,ywt),I=M.multiplyTransformation(E,M.multiplyTransformation(v,g,gJ),gJ),N=M.multiplyTransformation(n,I,gJ);return Ewt(N)?In.fromTransformation(N,i):Swt(N,i)}var gA=dy;function hy(){this.orientedBoundingBox=new In,this.boundingSphere=new re,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new ae,this._minimumHeight=hy.DefaultMinBounds.z,this._maximumHeight=hy.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new h,this._rotation=new Z,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new V,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new V,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new V,ellipsoidUvToShapeUvLatitude:new V,ellipsoidRenderLatitudeSinMinMax:new V,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new V},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 vwt=new h,wwt=new h,Iwt=new h,Pwt=new h,Dwt=new h,Rwt=new h,Owt=new h,Mwt=new h,Lwt=new Z,dve=new h,hve=new h,Nwt=new ae;hy.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=hy;i=i??r,o=o??s;let a=D.EPSILON10,c=D.EPSILON3,u=D.EPSILON10,f=D.EPSILON10,d=D.EPSILON3,p=M.getScale(e,Mwt),_=h.clone(r,vwt);_.z=-h.minimumComponent(p);let m=h.clamp(t,_,s,wwt),y=h.clamp(n,_,s,Iwt),b=h.clamp(i,_,s,Pwt),x=h.clamp(o,_,s,Dwt),T=h.maximumByComponent(m,b,Rwt),C=h.minimumByComponent(y,x,Owt),A=h.add(p,h.fromElements(y.z,y.z,y.z,dve),dve),S=h.maximumComponent(A),w=h.add(p,h.fromElements(C.z,C.z,C.z,hve),hve);if(T.y>C.y||T.y===s.y||C.y===r.y||T.z>C.z||D.equalsEpsilon(w,h.ZERO,void 0,a))return!1;this._rectangle=ae.fromRadians(m.x,m.y,y.x,y.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let R=ae.fromRadians(T.x,T.y,C.x,C.y,Nwt);this.orientedBoundingBox=xJ(R,T.z,C.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation(Z.setScale(this._rotation,A,Lwt),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,O=.5*P,L=C.x<T.x,g=C.x-T.x+L*P,E=g<=u,v=g>=O-u&&g<P-u,I=g>u&&g<O-u,N=E||v||I,F=y.x<m.x,U=y.x-m.x+F*P,k=U>O+u&&U<P-u,z=U>=O-u&&U<=O+u,B=U<O-u,j=k||z||B,W=C.y<-d,J=C.y>=-d&&C.y<=+d,Y=C.y>+d&&C.y<s.y-f,ee=W||J||Y,Q=T.y>r.y+f&&T.y<-d,de=T.y>=-d&&T.y<=+d,ge=T.y>+d,le=Q||de||ge,ye=ee||le,xe=y.y-m.y,Ie=y.y<-d,Te=y.y>=-d&&y.y<=+d,ve=y.y>+d&&y.y<s.y-f,Ve=Ie||Te||ve,$e=m.y>r.y+f&&m.y<-d,Ct=m.y>=-d&&m.y<=+d,Jt=m.y>+d,mn=Ve||($e||Ct||Jt),{shaderUniforms:Bt,shaderDefines:Ot}=this;for(let xt in Ot)Ot.hasOwnProperty(xt)&&(Ot[xt]=void 0);Bt.ellipsoidRadiiUv=h.divideByScalar(A,S,Bt.ellipsoidRadiiUv);let{x:Jn,z:bi}=Bt.ellipsoidRadiiUv,Gt=bi/Jn;Bt.eccentricitySquared=1-Gt*Gt,Bt.evoluteScale=V.fromElements((Jn*Jn-bi*bi)/Jn,(bi*bi-Jn*Jn)/bi,Bt.evoluteScale),Bt.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(Bt.ellipsoidRadiiUv,Bt.ellipsoidRadiiUv,Bt.ellipsoidInverseRadiiSquaredUv),Bt.ellipsoidInverseRadiiSquaredUv);let Pt=0;Ot.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Pt,Pt+=1,Ot.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Pt,Pt+=1,Bt.clipMinMaxHeight=V.fromElements((T.z-y.z)/S,(C.z-y.z)/S,Bt.clipMinMaxHeight);let oo=(y.z-m.z)/S;if(Bt.ellipsoidInverseHeightDifferenceUv=1/oo,m.z===y.z&&(Bt.ellipsoidInverseHeightDifferenceUv=0),N&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ot.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Pt,v?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Pt+=1):I?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Pt+=2):E&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Pt+=2),Bt.ellipsoidRenderLongitudeMinMax=V.fromElements(T.x,C.x,Bt.ellipsoidRenderLongitudeMinMax)),j)if(Ot.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Ot.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),U<=u)Bt.ellipsoidUvToShapeUvLongitude=V.fromElements(0,1,Bt.ellipsoidUvToShapeUvLongitude);else{let Jo=P/U,vr=-(m.x-r.x)/U;Bt.ellipsoidUvToShapeUvLongitude=V.fromElements(Jo,vr,Bt.ellipsoidUvToShapeUvLongitude)}if(N){let xt=D.equalsEpsilon(T.x,r.x,void 0,c),Jo=D.equalsEpsilon(C.x,s.x,void 0,c);xt&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Jo&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let vr=(m.x-r.x)/P,mc=(y.x-r.x)/P,Ur=(C.x-r.x)/P,Ms=1-g/P,Ue=(Ur+.5*Ms)%1;Bt.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(vr,mc,Ue,Bt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(le&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ot.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Pt,Q?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Pt+=1):de?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Pt+=1):ge&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Pt+=2)),ee&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ot.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Pt,W?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Pt+=2):J?(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Pt+=1):Y&&(Ot.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Pt+=1)),Bt.ellipsoidRenderLatitudeSinMinMax=V.fromElements(Math.sin(T.y),Math.sin(C.y),Bt.ellipsoidRenderLatitudeSinMinMax)),mn)if(Ot.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,xe<f)Bt.ellipsoidUvToShapeUvLatitude=V.fromElements(0,1,Bt.ellipsoidUvToShapeUvLatitude);else{let Jo=(s.y-r.y)/xe,vr=(r.y-m.y)/xe;Bt.ellipsoidUvToShapeUvLatitude=V.fromElements(Jo,vr,Bt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Pt,!0};var _ve=new ae;hy.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=ae.subsection(this._rectangle,s,c,a,u,_ve),_=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return xJ(p,_,m,this._ellipsoid,this._translation,this._rotation,o)};var mve=new h,pve=new h,Fwt=new h;hy.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,mve),s=h.multiplyByScalar(r,o,mve),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,pve),o,pve),c=h.add(a,s,Fwt),u=ae.subsection(this._rectangle,a.x,a.y,c.x,c.y,_ve),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return xJ(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function xJ(e,t,n,i,o,r,s){return s=In.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=Z.multiply(s.halfAxes,r,s.halfAxes),s}hy.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));hy.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var yA=hy;var Df={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Df.getMinBounds=function(e){switch(e){case Df.BOX:return _A.DefaultMinBounds;case Df.ELLIPSOID:return yA.DefaultMinBounds;case Df.CYLINDER:return gA.DefaultMinBounds}};Df.getMaxBounds=function(e){switch(e){case Df.BOX:return _A.DefaultMaxBounds;case Df.ELLIPSOID:return yA.DefaultMaxBounds;case Df.CYLINDER:return gA.DefaultMaxBounds}};Df.getShapeConstructor=function(e){switch(e){case Df.BOX:return _A;case Df.ELLIPSOID:return yA;case Df.CYLINDER:return gA}};var za=Object.freeze(Df);var TJ=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Pk(e,t){this.spatialNode=e,this.keyframe=t,this.state=TJ.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Pk.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=TJ.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Pk.priorityComparator=function(e,t){return e.priority-t.priority};Pk.searchComparator=function(e,t){return e.keyframe-t.keyframe};Pk.LoadState=TJ;var To=Pk;function Db(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Ft.UNSIGNED_SHORT&&(i=Ft.FLOAT32),i===Ft.FLOAT32&&!e.floatingPointTexture)throw new se("Floating point texture not supported");let s=Bwt(i),a=kwt(n,e.webgl2),c=Ft.getSizeInBytes(i),u=Uwt(o,n,c),f=Math.ceil(Math.sqrt(t.x)),d=Math.ceil(t.z/f),p=f*t.x,_=d*t.y,m=Math.floor(u/p),y=Math.floor(u/_);if(m===0||y===0)throw new se("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*n*u**2,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new V(m,y),this.voxelCountPerRegion=new V(p,_),this.sliceCountPerRegion=new V(f,d),this.voxelSizeUv=new V(1/u,1/u),this.sliceSizeUv=new V(t.x/u,t.y/u),this.regionSizeUv=new V(p/u,_/u),this.texture=new dt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})});let b=Ft.toComponentDatatype(i);this.tileVoxelDataTemp=K.createTypedArray(b,p*_*n),this.nodes=new Array(this.maximumTileCount);for(let x=0;x<this.maximumTileCount;x++)this.nodes[x]=new zwt(x);for(let x=0;x<this.maximumTileCount;x++){let T=this.nodes[x];T.previousNode=x>0?this.nodes[x-1]:void 0,T.nextNode=x<this.maximumTileCount-1?this.nodes[x+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Bwt(e){if(e===Ft.FLOAT32||e===Ft.FLOAT64)return He.FLOAT;if(e===Ft.UINT8)return He.UNSIGNED_BYTE}function kwt(e,t){if(e===1)return t?je.RED:je.LUMINANCE;if(e===2)return t?je.RG:je.LUMINANCE_ALPHA;if(e===3)return je.RGB;if(e===4)return je.RGBA}function Uwt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(Lt.maximumTextureSize,D.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function zwt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Db.prototype.add=function(e){if(this.isFull())throw new he("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};Db.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("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--};Db.prototype.isFull=function(){return this.emptyList===void 0};Db.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Ft.UNSIGNED_SHORT&&(i=Ft.FLOAT32);let o=Ft.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=D.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),_=Math.floor(f/u);if(p*_>=e)break;f*=2}return f*f*n*o};Db.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 _=0;_<o.z;_++){let m=_%r.x*o.x,y=Math.floor(_/r.x)*o.y;for(let b=0;b<o.y;b++){let x=Vwt(o,b,_),T=(y+b)*s.x+m;for(let C=0;C<o.x;C++){let A=x+C,S=T+C;for(let w=0;w<a;w++)i[S*a+w]=n[A*a+w]}}}let u=e%c.x*s.x,f=Math.floor(e/c.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function Vwt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Db.prototype.isDestroyed=function(){return!1};Db.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ce(this)};var Uw=Db;function Xd(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=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new In,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var Hwt=new h;Xd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=Z.getScale(this.orientedBoundingBox.halfAxes,Hwt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Xd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,d=t+1,p=[[d,r,s,a],[d,u,s,a],[d,r,c,a],[d,u,c,a],[d,r,s,f],[d,u,s,f],[d,r,c,f],[d,u,c,f]];this.children=p.map(([_,m,y,b])=>new Xd(_,m,y,b,this,e,this.dimensions))};Xd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Xd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var gve={keyframe:0};function Dk(e,t){return gve.keyframe=e,Uo(t,gve,To.searchComparator)}Xd.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:d}=t;if(d.length>=1){let p=Gwt(i,d),_=d[p],m=o===i||i<_.keyframe?p:Math.min(p+1,d.length-1),y=d[m],b=i-_.keyframe,x=yve(n-t.level,b);x<a&&(a=x,r=_);let T=y.keyframe-o,C=yve(n-t.level,T);if(C<c&&(c=C,s=y),b===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function Gwt(e,t){let n=Dk(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function yve(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Xd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Xd.prototype.createKeyframeNode=function(e){let t=Dk(e,this.keyframeNodes);if(t<0){t=~t;let n=new To(this,e);this.keyframeNodes.splice(t,0,n)}};Xd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=Dk(n,this.keyframeNodes);if(i<0)throw new he("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=Dk(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Xd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new he("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=Dk(e.keyframe,i);if(o>=0)throw new he("Keyframe already renderable");o=~o,i.splice(o,0,e)};Xd.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 Rk=Xd;function Rb(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:c,componentTypes:u,metadataOrder:f}=o,d=h.add(r,s,new h);if(h.add(d,a,d),f===Yd.Y_UP){let C=d.y;d.y=d.z,d.z=C}!l(i)&&l(o.maximumTileCount)&&(i=nIt(o.maximumTileCount,d,c,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(c.length);for(let C=0;C<c.length;C++){let A=c[C],S=at.getComponentCount(A),w=u[C];this.megatextures[C]=new Uw(t,d,S,w,i),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let _=e._shape;this.rootNode=new Rk(0,0,0,0,void 0,_,r),this._priorityQueue=new LC({maximumLength:p,comparator:To.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 m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,CJ(m,1,n-2,0);let y=9,b=2048,x=Math.floor(b/y),T=Math.ceil(p/x);this.internalNodeTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:b,height:T,sampler:new zt({minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),this.internalNodeTilesPerRow=x,this.internalNodeTexelSizeUv=new V(1/b,1/T),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new V}Rb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function CJ(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,CJ(e,t,o-1,i+1),CJ(e,o+1,n,i+1)}Rb.simultaneousRequestCountMaximum=50;Rb.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new dt({context:r,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new zt({minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),this.leafNodeTexelSizeUv=V.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&bve(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let _=Si();qwt(this,e),Ywt(this,e);let m=Si();Qwt(this,d,c);let y=Si(),b=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||b){let x=m-_,T=y-m,C=y-_;Zwt(this,e,x,T,C)}};Rb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Rb.prototype.isDestroyed=function(){return!1};Rb.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(),ce(this)};function bve(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];bve(e,i)}}function jwt(e,t){if(e._simultaneousRequestCount>=Rb.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?To.LoadState.PROCESSING:To.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=To.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=To.LoadState.RECEIVING,u.then(s).catch(a))}function Wwt(e){return e/(1+e)}function qwt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),xve(e.rootNode,Es.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 Ywt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(Xwt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===To.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===To.LoadState.UNLOADED&&jwt(e,f),f.state===To.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!Kwt(d.metadata,e)){f.content=void 0,f.state=To.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let _=o[p];e._primitive.tileUnload.raiseEvent(),_.spatialNode.destroyKeyframeNode(_,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=To.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function Xwt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function Kwt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:u}=r,f=a*c*u,d=e[o],p=f*s;if(d.length!==p)return!1}return!0}function xve(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=o,d=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===Es.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,_=p._shape,m=p.screenSpaceError,y=n._priorityQueue,b=n._keyframeCount,x=D.clamp(Math.floor(n._keyframeLocation),0,b-2),T=x+1;if(b===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==b)for(let R=0;R<b;R++)e.createKeyframeNode(R);let{screenSpaceError:C,keyframeNodes:A}=e,S=Wwt(C),w=!1;for(let R=0;R<A.length;R++){let P=A[R];P.priority=10*S+$wt(x,P.keyframe,T,n),P.state!==To.LoadState.UNAVAILABLE&&P.state!==To.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&y.insert(P),P.state===To.LoadState.LOADED&&(w=!0)}if(C<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(_);for(let R=0;R<8;R++){let P=e.children[R];xve(P,t,n,i)}}function $wt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(a,s,.15+.85*s)}function Zwt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(To.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let w=0;w<a;w++){let R=new Array(r).fill(0);c[w]=R,u[w]=0}function d(w){let R=w.keyframeNodes;for(let P=0;P<R.length;P++){let O=R[P],L=O.keyframe,g=O.state;c[g][L]+=1,u[g]+=1,f++}if(l(w.children))for(let P=0;P<8;P++){let O=w.children[P];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[To.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[To.LoadState.RECEIVING],_=u[To.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||_!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,_),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=_,m&&(p===0&&_===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 b=`KEYFRAMES: ${c[To.LoadState.LOADED]}`,x=`UNLOADED: ${u[To.LoadState.UNLOADED]} | RECEIVING: ${u[To.LoadState.RECEIVING]} | PROCESSING: ${u[To.LoadState.PROCESSING]} | LOADED: ${u[To.LoadState.LOADED]} | FAILED: ${u[To.LoadState.FAILED]} | UNAVAILABLE: ${u[To.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,T=Math.round(n*100)/100,C=Math.round(i*100)/100,A=Math.round(o*100)/100,S=`LOAD: ${T} | OCT: ${C} | ALL: ${A}`;console.log(`${b} || ${x} || ${S}`)}var r6={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Qwt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(_,m,y,b,x){let T=!1;if(l(_.children))for(let C=0;C<8;C++){let A=_.children[C];A.computeSurroundingRenderableKeyframeNodes(o),A.isRenderable(r)&&(T=!0)}if(T){u[x]=r6.INTERNAL<<16|m,u[y]=b,a++,b=m,x=b*9+1;for(let C=0;C<8;C++){let A=_.children[C];m=a,y=m*9+0,d(A,m,y,b,x+C)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let C=c*5,A=_.renderableKeyframeNodePrevious,S=_.level-A.spatialNode.level,w=A.spatialNode.parent,R=l(w)?w.renderableKeyframeNodePrevious:A,P=Jwt(_,i,n),O=S,L=1,g=A.megatextureIndex,E=R.megatextureIndex;f[C+0]=P,f[C+1]=O,f[C+2]=L,f[C+3]=g,f[C+4]=E,u[x]=r6.LEAF<<16|c}else{let C=_.renderableKeyframeNodePrevious,S=_.level-C.spatialNode.level===0?r6.LEAF:r6.PACKED_LEAF_FROM_PARENT;u[x]=S<<16|C.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),eIt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&tIt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Jwt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return D.clamp(s,0,1)}function eIt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],_=d*o;for(let m=0;m<o;m++)c[_+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function tIt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let _=e[p*r+0],m=e[p*r+1],y=e[p*r+2],b=e[p*r+3],x=e[p*r+4],T=D.clamp(Math.floor(65536*_),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}function nIt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=at.getComponentCount(a);o+=Uw.getApproximateTextureMemoryByteLength(e,t,u,c)}return o}var Ok=Rb;function zp(e){e=e??G.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??zp.DefaultProvider,this._traversal=void 0,this._statistics=new Vh,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new h,this._inputDimensions=new h,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=e.customShader??zp.DefaultCustomShader,this._customShaderCompilationEvent=new me,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,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 V,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new V,megatextureTextures:[],megatextureSliceDimensions:new V,megatextureTileDimensions:new V,megatextureVoxelSizeUv:new V,megatextureSliceSizeUv:new V,megatextureTileSizeUv:new V,dimensions:new h,inputDimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new M,transformPositionUvToView:new M,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new ie,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new H},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 me,this.tileVisible=new me,this.tileFailed=new me,this.tileUnload=new me,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me;let i=this._provider;iIt(this,i)}function iIt(e,t){let{shape:n,minBounds:i=za.getMinBounds(n),maxBounds:o=za.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),Cve(e,t);let r=za.getShapeConstructor(n);e._shape=new r,e._shapeVisible=Ave(e,e._shape,t)}Object.defineProperties(zp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ss.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=zp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var oIt=new ie,rIt=new ie,sIt=new h,aIt=new h,cIt=new Z,lIt=new Z,uIt=new M,fIt=new M,dIt=new M,hIt=M.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new h(.5,.5,.5),new M),mIt=M.fromRotationTranslation(Z.fromUniformScale(2,new Z),new h(-1,-1,-1),new M);zp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){xIt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}yIt(this,e);let i=Cve(this,t),o=this._shape;if(i&&(this._shapeVisible=Ave(this,o,t),CIt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=AIt(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&&RIt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),EIt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=V.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(vk(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,_=wIt(p,d,rIt);if(_.x===1||_.y===1||_.z===-1||_.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=ie.clone(_,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=M.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let x=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,x,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let C=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;C.boundingVolume=o.boundingSphere,e.commandList.push(C)};var pIt=new h,AJ=new h,_It=new fe,gIt=new h;function yIt(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===za.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=h.fromElements(1,1,t.verticalExaggeration,pIt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,bIt(e,t),e._exaggeratedModelMatrix)}}function bIt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,AJ),r=M.multiplyByPoint(e._modelMatrix,o,AJ),s=M.multiplyByPoint(i,r,AJ),c=te.WGS84.cartesianToCartographic(s,_It),u=0;l(c)&&(u=c.height);let f=Or.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(f-u)/t.verticalExaggeration,gIt)}function xIt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=H.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Fe(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let u=`u_${c}`;s[u]=function(){return r[c]}}if(e._dimensions=h.clone(t.dimensions,e._dimensions),i.dimensions=h.clone(e._dimensions,i.dimensions),e._paddingBefore=h.clone(t.paddingBefore??h.ZERO,e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(t.paddingAfter??h.ZERO,e._paddingAfter),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=h.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=h.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===Yd.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=h.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new Ok(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,TIt(e._traversal,i)}function Cve(e,t){let n=t.shapeTransform??M.IDENTITY,i=t.globalTransform??M.IDENTITY;return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),bA(e,"_compoundModelMatrix","_compoundModelMatrixOld")+bA(e,"_minBounds","_minBoundsOld")+bA(e,"_maxBounds","_maxBoundsOld")+bA(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+bA(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+bA(e,"_minClippingBounds","_minClippingBoundsOld")+bA(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function bA(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Ave(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,uIt),s=M.getRotation(o,cIt),a=M.getScale(o,sIt),c=h.maximumComponent(a),u=h.divideByScalar(a,c,aIt),f=Z.multiplyByScale(s,u,lIt);return e._transformPositionWorldToUv=M.multiplyTransformation(hIt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,mIt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function TIt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=V.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=V.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=V.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=V.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=V.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=V.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function CIt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Fe(n,!0)),i}function AIt(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=$.secondsDifference(i.stop,i.start),a=$.secondsDifference(n,i.start)/r;return o+a}function EIt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}zp.prototype.isDestroyed=function(){return!1};zp.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(),ce(this)};var Tve=new Array(new ie(-1,-1,-1,1),new ie(1,-1,-1,1),new ie(-1,1,-1,1),new ie(1,1,-1,1),new ie(-1,-1,1,1),new ie(1,-1,1,1),new ie(-1,1,1,1),new ie(1,1,1,1)),SIt=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),vIt=new Array(new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie);function wIt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,fIt),o=M.multiply(t,i,dIt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=vIt,d=Tve.length;for(u=0;u<d;u++)M.multiplyByVector(o,Tve[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let _=p.x/p.w,m=p.y/p.w;r=Math.min(r,_),s=Math.max(s,_),a=Math.min(a,m),c=Math.max(c,m)}else for(let _=0;_<3;_++){let m=SIt[u*3+_],y=f[m];if(y.z>=-y.w){let b=p.z+p.w,x=y.z+y.w,T=b/(b-x),C=ie.lerp(p,y,T,oIt),A=C.x/C.w,S=C.y/C.w;r=Math.min(r,A),s=Math.max(s,A),a=Math.min(a,S),c=Math.max(c,S)}}}return r=D.clamp(r,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=ie.fromElements(r,a,s,c,n),n}var EJ=3e7,IIt=new h(EJ,0,0),PIt=new h(0,EJ,0),DIt=new h(0,0,EJ);function RIt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:$i.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),_=[H.RED,H.LIME,H.BLUE][u%3];if(r(c.orientedBoundingBox,_,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,H.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,IIt,H.RED,a),o(h.ZERO,PIt,H.LIME,a),o(h.ZERO,DIt,H.BLUE,a),i.update(t)}zp.DefaultCustomShader=new mA({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) -{ - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function Eve(){this.ready=!0,this.shape=za.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[Ft.FLOAT32],this.maximumTileCount=1}Eve.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new pA({metadata:[new Float32Array(1)]});return Promise.resolve(n)};zp.DefaultProvider=new Eve;var Ob=zp;function OIt(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 Mk=OIt;function MIt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var Lk=MIt;function LIt(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 Nk=LIt;var a6=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function fi(e){e=e??G.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Fe(e.contextOptions),r=l(n),s=new P1(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=Ln(),this._jobScheduler=new d3,this._frameState=new u3(s,new n3(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 FI(s),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new f3,this._primitives=new Rl,this._groundPrimitives=new Rl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=fi.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new lA,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new a3(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new oi({color:new H,stencil:0,owner:this}),this._depthClearCommand=new oi({depth:1,owner:this}),this._stencilClearCommand=new oi({stencil:0}),this._classificationStencilClearCommand=new oi({stencil:0,renderState:ze.fromCache({stencilMask:jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new J3(this),this._preUpdate=new me,this._postUpdate=new me,this._renderError=new me,this._preRender=new me,this._postRender=new me,this._minimumDisableDepthTestDistance=0,this._debugInspector=new ck,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new me,this.morphComplete=new me,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=H.clone(H.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Mi(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 hT,this.fog=new l3,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(uo.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new uo(this),this.shadowMap=new sy({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=H.clone(H.WHITE),this._actualInvertClassificationColor=H.clone(this._invertClassificationColor),this._invertClassification=new Dw,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new Z3,this._brdfLutGenerator=new $B,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ik(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Au.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=Wa.requestCompletedEvent.addEventListener(a6(this)),this._removeTaskProcessorListenerCallback=di.taskCompletedEvent.addEventListener(a6(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Xe(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new uo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new uo(this),this.preloadFlightCullingVolume=void 0,this._picking=new I3(this),this._defaultView=new nA(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 c_,Pve(this,0,$.now()),this.updateFrameState(),this.initializeFrame()}fi.defaultLogDepthBuffer=!0;function NIt(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(a6(e))),n.push(t.terrainProviderChanged.addEventListener(a6(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(fi.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 Lt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Lt.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 bh.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,NIt(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===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.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 uo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new c3(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,Lt.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}}});fi.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 FIt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function Sve(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=Op.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Op.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Op.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Op.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=sy.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Se.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))}fi.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=o&&!u,_=c&&!f,m=(!o||!c)&&!d,y=n.pickingMetadata&&FIt(e,n);if(e.dirty=e.dirty||p||_||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=sy.createCastDerivedCommand(x,e,s,r,t.shadows)),(u||p)&&(t.logDepth=Op.createLogDepthCommand(e,r,t.logDepth),Sve(this,t.logDepth.command,s)),(d||m)&&Sve(this,e,s)};var BIt=new Gd({pass:jo.RENDER}),SJ=new Gd({pass:jo.PRELOAD}),vJ=new Gd({pass:jo.PRELOAD_FLIGHT}),kIt=new Gd({pass:jo.REQUEST_RENDER_MODE_DEFER_CHECK}),vve=new re,wJ;function UIt(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return vve.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,wJ=fB.fromBoundingSphere(vve,e.camera.positionWC,wJ),wJ}fi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function Pve(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=$.clone(n,i.time)}fi.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=UIt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof cn||this.camera.frustum instanceof jr),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=H.clone(this.invertClassificationColor,this._actualInvertClassificationColor),Dw.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};fi.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Ht.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var s6=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);s6=M.inverseTransformation(s6,s6);function zIt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==ne.SCENE3D){a=M.multiplyByPoint(s6,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=da.createGeometry(new da({radii:new h(f,f,f),vertexFormat:un.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=Ka.createGeometry(Ka.fromDimensions({dimensions:new h(2,2,2),vertexFormat:un.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Pn({geometryInstances:new It({geometry:Nn.toWireframe(c),modelMatrix:u,attributes:{color:new Yt(1,0,0,1)}}),appearance:new un({flat:!0,translucent:!1}),asynchronous:!1});let d=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=Op.createLogDepthCommand(e,r).command);let _;l(i)&&(_=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(_)&&(n.framebuffer=_),o.commandList=d}function Vp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof oi){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&zIt(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 wve(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 Dve(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function VIt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function HIt(e,t,n,i,o){Kg(i,Dve,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function GIt(e,t,n,i,o){Kg(i,VIt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function jIt(e,t,n){e.context.uniformState.updatePass(Se.VOXELS);let i=n.commands[Se.VOXELS];i.length=n.indices[Se.VOXELS],Kg(i,Dve,e.camera.positionWC);for(let o=0;o<i.length;++o)Vp(i[o],e,t)}var WIt=new Oi,qIt=new kl,YIt=new cn,XIt=new jr;function KIt(e){let{frustum:t}=e;return l(t.fov)?t.clone(WIt):l(t.infiniteProjectionMatrix)?t.clone(qIt):l(t.width)?t.clone(YIt):t.clone(XIt)}function $It(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?HIt:GIt}function ZIt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=$It(e);o.uniformState.updatePass(Se.TRANSLUCENT);let f=n.commands[Se.TRANSLUCENT];f.length=n.indices[Se.TRANSLUCENT],u(e,Vp,t,f,c)}function QIt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Se.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Se.TRANSLUCENT];i.executeTranslucentCommands(e,Vp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Vp,t,n)}function PJ(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=KIt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||JIt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:_,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:b,sceneFramebuffer:x,frustumCommandsList:T}=e._view,C=T.length,A=e._globeTranslucencyState,S=e._depthClearCommand,w=e._stencilClearCommand,R=e._classificationStencilClearCommand,P=e._depthPlane,O=n.position.z;function L(E,v){r.updatePass(v);let I=E.commands[v],N=E.indices[v];for(let F=0;F<N;++F)Vp(I[F],e,t);return N}function g(E,v){r.updatePass(v);let I=E.commands[v],N=E.indices[v];for(let F=0;F<N;++F)wve(I[F],e,t)}for(let E=0;E<C;++E){let v=C-E-1,I=T[v];e.mode===ne.SCENE2D?(n.position.z=O-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),S.execute(i,t),i.stencilBuffer&&w.execute(i,t),A.translucent?(r.updatePass(Se.GLOBE),A.executeGlobeCommands(I,Vp,b,e,t)):L(I,Se.GLOBE),p&&y.executeCopyDepth(i,t),f||(A.translucent?(r.updatePass(Se.TERRAIN_CLASSIFICATION),A.executeGlobeClassificationCommands(I,Vp,b,e,t)):L(I,Se.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),d&&P.execute(i,t));let N;if(!_||c||f)N=L(I,Se.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let U=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=L(I,Se.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=U,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&R.execute(i,t),N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&w.execute(i,t),jIt(e,t,I),L(I,Se.OPAQUE),v!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),ZIt(e,t,I),QIt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let U=e._picking.getPickDepth(e,v);U.update(i,y.depthStencilTexture),U.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),A.translucent?(r.updatePass(Se.GLOBE),A.executeGlobeCommands(I,wve,b,e,t)):g(I,Se.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&d&&P.execute(i,t),g(I,Se.CESIUM_3D_TILE),g(I,Se.OPAQUE),g(I,Se.TRANSLUCENT),t.framebuffer=F}}function JIt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Se.ENVIRONMENT),l(i.skyBoxCommand)&&Vp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Vp(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 Rve(e){e.context.uniformState.updatePass(Se.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function ePt(e,t){e.context.uniformState.updatePass(Se.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function tPt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Se.GLOBE,Se.CESIUM_3D_TILE,Se.OPAQUE,Se.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(p,u))r[d].commandList.push(u),f=!0;else if(f)break}}}}function Ove(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;tPt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:_}=d;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<_.length;++m){let y=_[m];s.updatePass(y.pass);let b=y.derivedCommands.shadows.castCommands[a];Vp(b,e,d.passState)}}}}var nPt=new h;fi.prototype.updateAndExecuteCommands=function(e,t){pPt(this,e,t),this._environmentState.useWebVR?iPt(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===Au.ROTATE?Mb(!0,this,e):dPt(this,e)};function iPt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;Mve(e),n.createPotentiallyVisibleSet(e),Rve(e),r||Ove(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=uo.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,nPt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,PJ(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,PJ(e,t),uo.clone(a,i)}var oPt=new fe(Math.PI,D.PI_OVER_TWO),rPt=new h,sPt=new h,aPt=new M,cPt=new M,lPt=new h,uPt=new h,fPt=new Xe;function dPt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Xe.clone(r,fPt);t.viewport=s;let a=oPt,c=rPt;e.mapProjection.project(a,c);let f=h.clone(i.position,sPt),d=M.clone(i.transform,cPt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let _=M.computeViewportTransformation(s,0,1,aPt),m=i.frustum.projectionMatrix,y=i.positionWC.y,b=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,lPt),x=At.pointToGLWindowCoordinates(m,_,b,uPt);x.x=Math.floor(x.x);let T=s.x,C=s.width;if(y===0||x.x<=T||x.x>=T+C)Mb(!0,e,t);else if(Math.abs(T+C*.5-x.x)<1)s.width=x.x-s.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Mb(!0,e,t),s.x=x.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),Mb(!1,e,t);else if(x.x>T+C*.5){s.width=x.x-T;let A=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Mb(!0,e,t),s.x=x.x,s.width=T+C-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=A-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Mb(!1,e,t)}else{s.x=x.x,s.width=T+C-x.x;let A=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Mb(!0,e,t),s.x=T,s.width=x.x-T,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=A-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Mb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function Mb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),Mve(t),i.createPotentiallyVisibleSet(t),e&&(Rve(t),o||Ove(t)),PJ(t,n)}var Ive=new Es;fi.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!==ne.SCENE2D&&t.camera.frustum instanceof cn||!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(U_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;s.setDynamicLighting(x),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 b=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(b)?b.drawCommand:void 0,n.sunComputeCommand=l(b)?b.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let d=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,_=Ive.planes;for(let b=0;b<5;++b)_[b]=p.planes[b];p=Ive,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new bh(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function hPt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Rp({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 mPt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.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 Mve(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),hPt(e),mPt(e),e._globe&&e._globe.render(t)}function pPt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new sk:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;H.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,_=r.useOIT=!c&&l(p)&&p.isSupported();_&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let x;if(o.invertClassificationColor.alpha===1&&d&&(x=s.globeDepth.framebuffer),l(x)||i.depthTexture){if(e._invertClassification.previousFramebuffer=x,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&_){let T=e._invertClassification.unclassifiedCommand,C=T.derivedCommands;C.oit=p.createDerivedCommands(T,i,C.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}fi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let _=d;a&&!s&&(_=f);let m=this.postProcessStages,y=_.getColorTexture(0),b=p.getColorTexture(0),x=(f??d).getDepthStencilTexture();m.execute(t,y,x,b),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function _Pt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function gPt(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function Lve(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Rl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=Lve(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}fi.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=Lve(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 IJ=new fe;fi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=_=>{fe.clone(e,IJ);let m;l(_)&&(m=_.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(IJ.height=m,t(IJ))},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={},u=_=>{if(r||_.isDestroyed()||!_.isCesium3DTileset)return;let m=_.updateHeight(e,o,i);c[_.id]=m};if(!r){let _=this.primitives.length;for(let m=0;m<_;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(_=>{_.isDestroyed()||!_.isCesium3DTileset||(l(c[_.id])&&c[_.id](),delete c[_.id])});return()=>{a=a&&a(),Object.values(c).forEach(_=>_()),c={},f(),d()}};function yPt(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===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}fi.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=gPt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=yPt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function bPt(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 iy({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 xPt(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 TPt(e){e.primitives.postPassesUpdate(e._frameState),Wa.update()}var CPt=new H;function APt(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=BIt;let r=e.backgroundColor??H.BLACK;e._hdr&&(r=H.clone(r,CPt),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 c_?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Xe.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,ePt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function xA(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function EPt(e){return e._picking.updateMostDetailedRayPicks(e)}fi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=$.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs($.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=$.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=D.incrementWrap(t.frameNumber,15e6,1);Pve(this,o,e),t.newFrame=!0}xA(this,xPt),this.primitives.show&&(xA(this,EPt),xA(this,SPt),xA(this,vPt),i||xA(this,wPt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),xA(this,APt)),bPt(this,i),xA(this,TPt),_Pt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};fi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};fi.prototype.requestRender=function(){this._renderRequested=!0};fi.prototype.clampLineWidth=function(e){return Math.max(Lt.minimumAliasedLineWidth,Math.min(e,Lt.maximumAliasedLineWidth))};fi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};fi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Ob))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 lk.fromKeyframeNode(o,s,c,a)};fi.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=Mk(s,t,n,i);if(!l(a))return;let c=Nk(r,n,i);if(!l(c))return;let u=new Lk(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};fi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};fi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};fi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};fi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function SPt(e){let t=e._frameState;SJ.camera=t.camera,SJ.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,SJ)}function vPt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;vJ.camera=e.preloadFlightCamera,vJ.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,vJ)}function wPt(e){e.primitives.updateForPass(e._frameState,kIt)}fi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};fi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};fi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};fi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};fi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};fi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};fi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};fi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};fi.prototype.cartesianToCanvasCoordinates=function(e,t){return ji.worldToWindowCoordinates(this,e,t)};fi.prototype.completeMorph=function(){this._transitioner.completeMorph()};fi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};fi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};fi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function IPt(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()})}fi.prototype.setTerrain=function(e){return IPt(this,e),e};fi.prototype.isDestroyed=function(){return!1};fi.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),ce(this)};var Fk=fi;var zw=`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 Bk=`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 kk=`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 Vw(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new qe({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;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(Vw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Vw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var DJ=new M;Vw.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,DJ),o=M.multiplyTransformation(i,Vo.Y_UP_TO_Z_UP,DJ),r=M.multiply(this._scaleMatrix,o,DJ);M.clone(r,this._modelMatrix);let s=e.context,a=PPt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=da.createGeometry(new da({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:De.POSITION_ONLY}));f.vertexArray=qn.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:Ai.FRONT},blending:fn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let _=new Be({defines:p,sources:[wh,zw,kk]}),m=new Be({defines:p,sources:[wh,zw,Bk]});this._spSkyAtmosphere=Xt.fromCache({context:s,vertexShaderSource:_,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function PPt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}Vw.prototype.isDestroyed=function(){return!1};Vw.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ce(this)};var Uk=Vw;var zk=`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 Vk=`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 Gw(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new qe({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Gw.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.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"?O1(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 or({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ka.createGeometry(Ka.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY})),c=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=qn.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Ne.STATIC_DRAW}),s.renderState=ze.fromCache({blending:fn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Be({defines:[t?"HDR":""],sources:[zk]});s.shaderProgram=Xt.fromCache({context:r,vertexShaderSource:Vk,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};Gw.prototype.isDestroyed=function(){return!1};Gw.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(),ce(this)};function Hw(e){return on(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Gw.createEarthSkyBox=function(){return new Gw({sources:{positiveX:Hw("px"),negativeX:Hw("mx"),positiveY:Hw("py"),negativeY:Hw("my"),positiveZ:Hw("pz"),negativeZ:Hw("mz")}})};var Hk=Gw;var Gk=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); -} -`;var jk=`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 Wk=`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 Yk(){this.show=!0,this._drawCommand=new qe({primitiveType:Le.TRIANGLES,boundingVolume:new re,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new re,this._boundingVolume2D=new re,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(Yk.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var DPt=new V,RPt=new V,OPt=new ie,qk=new ie;Yk.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.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 A=Math.max(r,s);A=Math.pow(2,Math.ceil(Math.log(A)/Math.log(2))-2),A=Math.max(1,A);let S=n?o.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._texture=new dt({context:o,width:A,height:A,pixelFormat:je.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,R={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new Ea({fragmentShaderSource:jk,outputTexture:this._texture,uniformMap:R,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let A={direction:0},S=new Uint8Array(4*2);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let w=st.createVertexBuffer({context:o,typedArray:S,usage:Ne.STATIC_DRAW}),R=[{index:A.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:K.UNSIGNED_BYTE}],P=st.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});a.vertexArray=new qn({context:o,attributes:R,indexBuffer:P}),a.shaderProgram=Xt.fromCache({context:o,vertexShaderSource:Wk,fragmentShaderSource:Gk,attributeLocations:A}),a.renderState=ze.fromCache({blending:fn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?re.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&re.clone(d,a.boundingVolume);let p=ji.computeActualEllipsoidPosition(e,c,qk),_=h.magnitude(h.subtract(p,e.camera.position,qk)),m=o.uniformState.projection,y=OPt;y.x=0,y.y=0,y.z=-_,y.w=1;let b=M.multiplyByVector(m,y,qk),x=ji.clipToGLWindowCoordinates(t.viewport,b,DPt);y.x=D.SOLAR_RADIUS;let T=M.multiplyByVector(m,y,qk),C=ji.clipToGLWindowCoordinates(t.viewport,T,RPt);return this._size=V.magnitude(V.subtract(C,x,qk)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};Yk.prototype.isDestroyed=function(){return!1};Yk.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(),ce(this)};var Xk=Yk;var Bve=er(Vz(),1);function MPt(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 Kk=MPt;var LPt={modifyFragmentShader:function(t){return t=Be.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},jw=LPt;var TA={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function $k(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=H.clone(H.DARKGRAY),this._highlightColor=H.clone(H.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=TA.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??Se.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=xn.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??Wr.NONE,this._splittingEnabled=!1,this._error=void 0,NPt(this,e)}Object.defineProperties($k.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return H.clone(this._highlightColor)},set:function(e){this._highlightColor=H.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=re.clone(e,this._boundingSphere)}}});function NPt(e,t){let n=CT.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=v_.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=TA.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=H.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 FPt=new h,BPt=new h,kPt=new h,Nve,c6;function UPt(e){if(!l(c6)){Nve=new Bve.default(0),c6=new Array(e);for(let t=0;t<e;++t)c6[t]=Nve.random()}return c6}function zPt(e){let n=e.length/3,i=Math.min(n,20),o=UPt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,FPt),c=h.fromElements(s,s,s,BPt);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=h.unpack(e,d*3,kPt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=re.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function Fve(e,t){let n=K.fromTypedArray(e);return n===K.INT||n===K.UNSIGNED_INT||n===K.DOUBLE?(bt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var VPt=new ie,HPt=new ie,GPt=new H,kve=0,l6=1,NJ=2,Uve=3,jPt=4,RJ=new M,WPt=new M;function qPt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,_=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,b=e._octEncodedRange,x=e._isRGB565,T=e._isTranslucent,C=e._hasColors,A=e._hasNormals,S=e._hasBatchIds,w,R,P=[],O={};if(e._styleableShaderAttributes=O,f){let k=jPt;for(let z in u)if(u.hasOwnProperty(z)){let B=u[z],j=Fve(B.typedArray,z);w=B.componentCount,R=K.fromTypedArray(j);let W=st.createVertexBuffer({context:n,typedArray:j,usage:Ne.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let J={index:k,vertexBuffer:W,componentsPerAttribute:w,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(J),O[z]={location:k,componentCount:w},++k}}let L=st.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;C&&(g=st.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let E;A&&(E=st.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let v;S&&(c.typedArray=Fve(c.typedArray,"batchIds"),v=st.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?R=K.UNSIGNED_SHORT:p?R=y<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT:R=K.FLOAT,I.push({index:kve,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=re.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=zPt(r.typedArray)),C)if(x)I.push({index:l6,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=T?4:3;I.push({index:l6,vertexBuffer:g,componentsPerAttribute:k,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}A&&(_?(w=2,R=K.UNSIGNED_BYTE):m?(w=2,R=b<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT):(w=3,R=K.FLOAT),I.push({index:NJ,vertexBuffer:E,componentsPerAttribute:w,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&I.push({index:Uve,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:K.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(P));let N=new qn({context:n,attributes:I}),F={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:fn.ALPHA_BLEND};e._opaquePass===Se.CESIUM_3D_TILE&&(F.stencilTest=jt.setCesium3DTileBit(),F.stencilMask=jt.CESIUM_3D_TILE_MASK,U.stencilTest=jt.setCesium3DTileBit(),U.stencilMask=jt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(F),e._translucentRenderState=ze.fromCache(U),e._drawCommand=new qe({boundingVolume:new re,cull:e._cull,modelMatrix:new M,primitiveType:Le.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Se.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function YPt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=VPt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof cn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return H.TRANSPARENT;let c=H.clone(a.edgeColor,GPt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,RJ);let u=M.multiply(RJ,a.modelMatrix,RJ);return M.inverseTranspose(u,WPt)}};jw.addUniforms(e,s),(i||o||r)&&(s=ct(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=HPt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function OJ(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 MJ(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 LJ(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 XPt={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 KPt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,_=e._isTranslucent,m=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,x=e._backFaceCulling,T=e._normalShading,C=e._drawCommand.vertexArray,A=e.clippingPlanes,S=e._attenuation,w,R,P,O=_,L=Fe(XPt),g={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let le={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";w=n.getColorShaderFunction(`getColorFromStyle${ye}`,L,le),R=n.getShowShaderFunction(`getShowFromStyle${ye}`,L,le),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,L,le),l(w)&&le.translucent&&(O=!0)}e._styleTranslucent=O;let v=l(w),I=l(R),N=l(P),F=e.isClipped,U=[],k=[];v&&(OJ(w,U),MJ(w,k)),I&&(OJ(R,U),MJ(R,k)),N&&(OJ(P,U),MJ(P,k));let z=k.indexOf("COLOR")>=0,B=k.indexOf("NORMAL")>=0;if(B&&!y)throw new se("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let le=U.indexOf(r.location)>=0,ye=LJ(C,r.location);ye.enabled=le}let j=m&&(!v||z);if(m){let le=LJ(C,l6);le.enabled=j}let W=y&&(T||x||B);if(y){let le=LJ(C,NJ);le.enabled=W}let J={a_position:kve};j&&(J.a_color=l6),W&&(J.a_normal=NJ),b&&(J.a_batchId=Uve);let Y="",ee=U.length;for(i=0;i<ee;++i){let le=U[i];r=g[le];let ye=r.componentCount,xe=`czm_3dtiles_property_${le}`,Ie;ye===1?Ie="float":Ie=`vec${ye}`,Y+=`in ${Ie} ${xe}; -`,J[xe]=r.location}YPt(e,t);let Q=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;Q+=`float u_pointSize; -float tiles3d_tileset_time; -`,S&&(Q+=`float u_geometricError; -float u_depthMultiplier; -`),Q+=Y,j&&(_?Q+=`in vec4 a_color; -`:p?Q+=`in float a_color; -const float SHIFT_RIGHT_11 = 1.0 / 2048.0; -const float SHIFT_RIGHT_5 = 1.0 / 32.0; -const float SHIFT_LEFT_11 = 2048.0; -const float SHIFT_LEFT_5 = 32.0; -const float NORMALIZE_6 = 1.0 / 64.0; -const float NORMALIZE_5 = 1.0 / 32.0; -`:Q+=`in vec3 a_color; -`),W&&(f||d?Q+=`in vec2 a_normal; -`:Q+=`in vec3 a_normal; -`),b&&(Q+=`in float a_batchId; -`),(c||u||d)&&(Q+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),v&&(Q+=w),I&&(Q+=R),N&&(Q+=P),Q+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,S&&(Q+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),j?_?Q+=` vec4 color = a_color; -`:p?Q+=` float compressed = a_color; - float r = floor(compressed * SHIFT_RIGHT_11); - compressed -= r * SHIFT_LEFT_11; - float g = floor(compressed * SHIFT_RIGHT_5); - compressed -= g * SHIFT_LEFT_5; - float b = compressed; - vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); - vec4 color = vec4(rgb, 1.0); -`:Q+=` vec4 color = vec4(a_color, 1.0); -`:Q+=` vec4 color = u_constantColor; -`,c||u?Q+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:Q+=` vec3 position = a_position; -`,Q+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,W?(f?Q+=` vec3 normal = czm_octDecode(a_normal); -`:d?Q+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:Q+=` vec3 normal = a_normal; -`,Q+=` vec3 normalEC = czm_normal * normal; -`):Q+=` vec3 normal = vec3(1.0); -`,v&&(Q+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(Q+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),N?Q+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:S?Q+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:Q+=` gl_PointSize = u_pointSize; -`,Q+=` color = color * u_highlightColor; -`,W&&T&&(Q+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),Q+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,W&&x&&(Q+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(Q+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),Q+=`} -`;let de=`in vec4 v_color; -`;F&&(de+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,de+=` -`,de+=Zg(A,s),de+=` -`),de+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,F&&(de+=Kk("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} -`,e.splitDirection!==Wr.NONE&&(de=jw.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=Xt.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{ge.shaderProgram._bind()}catch{throw new se("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function $Pt(e,t){if(e._decodingState===TA.READY)return!1;if(e._decodingState===TA.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=M_.decodePointCloud(i,t);l(o)&&(e._decodingState=TA.DECODING,o.then(function(r){e._decodingState=TA.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let b=r.POSITION.data.quantization,x=b.range;e._quantizedVolumeScale=h.fromElements(x,x,x),e._quantizedVolumeOffset=h.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let _=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let x=r[b];l(_)||(_={}),_[b]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=_}).catch(function(r){e._decodingState=TA.FAILED,e._error=r}))}return!0}var ZPt=new ie,QPt=new h;$k.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if($Pt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(qPt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=M.getColumn(u,3,ZPt);ie.equals(p,ie.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(re.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,QPt);f.radius*=h.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!==Wr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&KPt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.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?Se.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};$k.prototype.isDestroyed=function(){return!1};$k.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ce(this)};var Zk=$k;function AA(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??xn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Km(e.shading),this.style=e.style,this.frameFailed=new me,this.frameChanged=new me,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new G_,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(AA.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ss.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function JPt(e){return`uniform vec4 czm_pickColor; -${e}`}function eDt(e){return function(t){return ct(t,{czm_pickColor:function(){return e._pickId.color}})}}function tDt(){return"czm_pickColor"}AA.prototype.makeStyleDirty=function(){this._styleDirty=!0};AA.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var nDt=new $;function BJ(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function CA(e,t){return e._intervals.indexOf(t.start)}function iDt(e,t){let n=e._intervals,i=e._clock,o=BJ(e);if(o===0)return;let r=e._getAverageLoadTime(),s=$.addSeconds(i.currentTime,r*o,nDt),a=n.indexOf(s),c=CA(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function oDt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function rDt(e,t,n){let i=BJ(e),o=CA(e,t),r=CA(e,n);return i>=0?o>=r:o<=r}function Vve(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 sDt(e,t,n){let i=CA(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Si(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ee.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new Zk({arrayBuffer:u,cull:!0,fragmentShaderLoaded:JPt,uniformMapLoaded:eDt(e),pickIdLoaded:tDt})}).catch(Vve(e,c))}return r}function aDt(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 cDt(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(Hve(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Si()-t.timestamp)/1e3;aDt(e,a)}}t.touchedFrameNumber=i.frameNumber}var lDt=new M;function uDt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function fDt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var dDt=new Km;function Hve(e,t,n,i){let o=e.shading??dDt,r=t.pointCloud,s=t.transform??M.IDENTITY;r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,lDt),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=uDt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=fDt(e);try{r.update(i)}catch(a){Vve(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function FJ(e,t,n,i){let o=sDt(e,t,i);cDt(e,o,n,i)}function hDt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Gve(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 mDt(e,t){let n=CA(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function zve(e,t,n,i,o){return l(n)?n.ready?!0:(FJ(e,t,i,o),n.ready):!1}function pDt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=CA(e,n),d=CA(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],zve(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],zve(e,s,a,i,o))return s;return t}function _Dt(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 Ww={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};AA.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=$.clone(e.time));let t=Math.max($.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)&&_Dt(this,o,s),Ww.timeSinceLoad=t,Ww.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,_=oDt(this);if(!l(_))return;let m=!1,y=BJ(this),b=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||b)&&(d=_),(!l(p)||m||rDt(this,_,p))&&(p=iDt(this,_)),d=pDt(this,d,_,Ww,e);let x=mDt(this,d);l(x)||(FJ(this,d,Ww,e),x=this._lastRenderedFrame),l(x)&&Hve(this,x,Ww,e),l(p)&&FJ(this,p,Ww,e);let T=this;l(x)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(x)&&x!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=x;let C=this._totalMemoryUsageInBytes,A=this.maximumMemoryUsage*1024*1024;C>A&&Gve(this,hDt(e));let w=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&w>0&&c.update(e,f,a,this.boundingSphere)};AA.prototype.isDestroyed=function(){return!1};AA.prototype.destroy=function(){return Gve(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ce(this)};var qw=AA;function qve(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function gDt(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 Yve(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Xve(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=Yve(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 Kve(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 No(e,t){e=Dn(e),t=t??G.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Nt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Nt.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)?Dn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Dn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 me,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new qh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),Xve(this);try{let p=t.ellipsoid??te.default,_=new Fk({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=_,_.camera.constrainedAxis=h.UNIT_Z,Yve(this),Kve(this);let m=t.globe;l(m)||(m=new jB(p)),m!==!1&&(_.globe=m,_.globe.shadows=t.terrainShadows??xn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&te.WGS84.equals(p)&&(y=Hk.createEarthSkyBox()),y!==!1&&(_.skyBox=y,_.sun=new Xk,te.WGS84.equals(p)&&(_.moon=new YB));let b=t.skyAtmosphere;!l(b)&&te.WGS84.equals(p)&&(b=new Uk(p),b.show=t.globe!==!1&&m.show),b!==!1&&(_.skyAtmosphere=b);let x=t.baseLayer;t.globe!==!1&&x!==!1&&(l(x)||(x=uc.fromWorldImagery()),_.imageryLayers.add(x)),l(t.terrainProvider)&&t.globe!==!1&&(_.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&_.setTerrain(t.terrain),this._screenSpaceEventHandler=new Cf(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(P,O){T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors&&T.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},_.renderError.addEventListener(this._onRenderError);let C=t.dataSources,A=!1;l(C)||(C=new IF,A=!0);let S=new d2({scene:_,dataSourceCollection:C}),w=new Tr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=C,this._destroyDataSourceCollection=A,this._dataSourceDisplay=S,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,No.prototype._onTick,this),w.add(_.morphStart,No.prototype._clearTrackedObject,this),w.add(C.dataSourceAdded,No.prototype._onDataSourceAdded,this),w.add(C.dataSourceRemoved,No.prototype._onDataSourceRemoved,this),w.add(_.postRender,No.prototype._postRender,this);let R=C.length;for(let P=0;P<R;P++)this._dataSourceAdded(C,C.get(P));this._dataSourceAdded(void 0,S.defaultDataSource),w.add(C.dataSourceAdded,No.prototype._dataSourceAdded,this),w.add(C.dataSourceRemoved,No.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(No.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&&gDt(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,kJ(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,qve(this.clock,e))}}});No.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let _=document.createElement("div");if(_.className="cesium-widget-errorPanel-message",a.appendChild(_),f){let m=Sp(n);u||(typeof n=="string"&&(n=new Error(n)),t=Sp({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),y.appendChild(b),y.onclick=function(x){y.removeChild(b),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}_.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);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)},d.appendChild(p),i.appendChild(o)};No.prototype.isDestroyed=function(){return!1};No.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()),ce(this)};No.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Xve(this),Kve(this),this._scene.requestRender())};No.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};No.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(No.prototype._onEntityCollectionChanged,this)};No.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(No.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};No.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var yDt=new re;No.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??yDt)===ut.DONE&&i.update(t)}};No.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)}};No.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};No.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&qve(this.clock,e)};No.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,No.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};No.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}};No.prototype.zoomTo=function(e,t){return $ve(this,e,{offset:t},!1)};No.prototype.flyTo=function(e,t){return $ve(this,e,t,!0)};function $ve(e,t,n,i){kJ(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 uc){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 jC(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof ws||r instanceof qw||r instanceof Ob){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 Qk(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function kJ(e){let t=e._zoomPromise;l(t)&&(Qk(e),e._completeZoom(!1))}No.prototype._postRender=function(){bDt(this),xDt(this)};var jve=new re;function bDt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new Od(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),Qk(e)}if(t instanceof qw){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof ws||t instanceof Ob){s(t.boundingSphere);return}if(t instanceof fe){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)),Qk(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,jve);if(p===ut.PENDING)return;p!==ut.FAILED&&c.push(re.clone(jve))}if(c.length===0){kJ(e);return}e.trackedEntity=void 0;let u=re.fromBoundingSpheres(c);e._zoomIsFlight?(Qk(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),Qk(e),e._completeZoom(!0))}var Wve=new re;function xDt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Wve);if(r===ut.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?Wve:void 0;e._entityView=new m2(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var Jk=No;var eU=`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 tU=`#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 nU=`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 iU=`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 oU=`in vec2 v_textureCoordinates; - -uniform float originalSize; -uniform sampler2D texture0; -uniform sampler2D texture1; -uniform sampler2D texture2; -uniform sampler2D texture3; -uniform sampler2D texture4; -uniform sampler2D texture5; - -const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); -const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); -const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); -const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); - -void main() -{ - vec2 uv = v_textureCoordinates; - vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); - vec2 pixel = 1.0 / textureSize; - - float mipLevel = 0.0; - - if (uv.x - pixel.x > (textureSize.y / textureSize.x)) - { - mipLevel = 1.0; - if (uv.y - pixel.y > yMipLevel1) - { - mipLevel = 2.0; - if (uv.y - pixel.y * 3.0 > yMipLevel2) - { - mipLevel = 3.0; - if (uv.y - pixel.y * 5.0 > yMipLevel3) - { - mipLevel = 4.0; - if (uv.y - pixel.y * 7.0 > yMipLevel4) - { - mipLevel = 5.0; - } - } - } - } - } - - if (mipLevel > 0.0) - { - float scale = pow(2.0, mipLevel); - - uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); - uv.x *= ((textureSize.x - 2.0) / textureSize.y); - - uv.x -= 1.0 + pixel.x; - uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); - uv *= scale; - } - else - { - uv.x *= (textureSize.x / textureSize.y); - } - - if(mipLevel == 0.0) - { - out_FragColor = texture(texture0, uv); - } - else if(mipLevel == 1.0) - { - out_FragColor = texture(texture1, uv); - } - else if(mipLevel == 2.0) - { - out_FragColor = texture(texture2, uv); - } - else if(mipLevel == 3.0) - { - out_FragColor = texture(texture3, uv); - } - else if(mipLevel == 4.0) - { - out_FragColor = texture(texture4, uv); - } - else if(mipLevel == 5.0) - { - out_FragColor = texture(texture5, uv); - } - else - { - out_FragColor = vec4(0.0); - } -} -`;var rU=`in vec3 v_cubeMapCoordinates; -uniform samplerCube cubeMap; - -void main() -{ - vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); - #ifdef RGBA_NORMALIZED - out_FragColor = vec4(rgba.rgb, 1.0); - #else - float m = rgba.a * 16.0; - vec3 r = rgba.rgb * m; - out_FragColor = vec4(r * r, 1.0); - #endif -} -`;var sU=`in vec4 position; -in vec3 cubeMapCoordinates; - -out vec3 v_cubeMapCoordinates; - -void main() -{ - gl_Position = position; - v_cubeMapCoordinates = cubeMapCoordinates; -} -`;var aU=` -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 TDt=new h(1,1,1);function UJ(e){e=e??TDt,this._dimensions=h.clone(e)}Object.defineProperties(UJ.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var CDt=new h;UJ.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,CDt),i=D.randomBetween(-n.x,n.x),o=D.randomBetween(-n.y,n.y),r=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var zJ=UJ;function Hp(){this.featurePropertiesDirty=!1}Object.defineProperties(Hp.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});Hp.prototype.hasProperty=function(e,t){he.throwInstantiationError()};Hp.prototype.getFeature=function(e){he.throwInstantiationError()};Hp.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};Hp.prototype.applyStyle=function(e){he.throwInstantiationError()};Hp.prototype.update=function(e,t){he.throwInstantiationError()};Hp.prototype.pick=function(e,t,n){he.throwInstantiationError()};Hp.prototype.isDestroyed=function(){he.throwInstantiationError()};Hp.prototype.destroy=function(){he.throwInstantiationError()};var VJ=Hp;function Yw(e,t){this._conditionsExpression=Fe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,EDt(this,t)}Object.defineProperties(Yw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function ADt(e,t){this.condition=e,this.expression=t}function EDt(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 ADt(new id(a,t),new id(c,t)))}e._runtimeConditions=n}Yw.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)}};Yw.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)}};Yw.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) - { - return ${f}; - } -`}return r=`${i} ${e} -{ -${r} return ${i}(1.0); -} -`,r};Yw.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 cU=Yw;function Lb(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,SDt(this,e)}function SDt(e,t){t=Fe(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??G.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new id(o[r],i))}e._meta=n,e._ready=!0}function pr(e,t){let n=(e._style??G.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new id(String(t));if(typeof t=="string")return new id(t,n);if(l(t.conditions))return new cU(t,n)}else return;return t}function _r(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Fe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Lb.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=pr(this,e),this._style.show=_r(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=pr(this,e),this._style.color=_r(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=pr(this,e),this._style.pointSize=_r(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=pr(this,e),this._style.pointOutlineColor=_r(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=pr(this,e),this._style.pointOutlineWidth=_r(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=pr(this,e),this._style.labelColor=_r(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=pr(this,e),this._style.labelOutlineColor=_r(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=pr(this,e),this._style.labelOutlineWidth=_r(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=pr(this,e),this._style.font=_r(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=pr(this,e),this._style.labelStyle=_r(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=pr(this,e),this._style.labelText=_r(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=pr(this,e),this._style.backgroundColor=_r(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=pr(this,e),this._style.backgroundPadding=_r(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=pr(this,e),this._style.backgroundEnabled=_r(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=pr(this,e),this._style.scaleByDistance=_r(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=pr(this,e),this._style.translucencyByDistance=_r(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=pr(this,e),this._style.distanceDisplayCondition=_r(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=pr(this,e),this._style.heightOffset=_r(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=pr(this,e),this._style.anchorLineEnabled=_r(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=pr(this,e),this._style.anchorLineColor=_r(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=pr(this,e),this._style.image=_r(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=pr(this,e),this._style.disableDepthTestDistance=_r(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=pr(this,e),this._style.horizontalOrigin=_r(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=pr(this,e),this._style.verticalOrigin=_r(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=pr(this,e),this._style.labelHorizontalOrigin=_r(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=pr(this,e),this._style.labelVerticalOrigin=_r(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Lb.fromUrl=function(e){return Ee.createIfNeeded(e).fetchJson(e).then(function(n){return new Lb(n)})};Lb.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)};Lb.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)};Lb.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)};Lb.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 EA=Lb;function lU(e){e=e??G.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new LC({comparator:lU.comparator})}lU.prototype.addSubtree=function(e){let t=new vDt(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()};lU.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}};lU.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 vDt(e,t){this.subtree=e,this.stamp=t}var uU=lU;function fU(e){e=e??G.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:_,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=d,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===za.ELLIPSOID?Yd.Z_UP:Yd.Y_UP,this._minimumValues=_,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new uU}Object.defineProperties(fU.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}}});fU.fromUrl=async function(e){let t=Ee.createIfNeeded(e),n=await t.fetchJson();IDt(n);let i=NDt(n,t);await i.load();let{root:o}=n,r=ai(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new UT({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,u=FDt(s,c);Object.assign(u,PDt(o)),l(o.transform)?u.globalTransform=M.unpack(o.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=wDt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new fU(u),d=new VT(t,o,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Di.unload(i),f};function wDt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(aT.TILESET_TILE_COUNT)}function IDt(e){let t=e.root;if(!l(t.content))throw new se("Root must have content");if(!ai(t.content,"3DTILES_content_voxels"))throw new se("Root tile content must have 3DTILES_content_voxels extension");if(!ai(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new se("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ai(e,"3DTILES_metadata"))throw new se("Tileset must have a metadata schema")}function PDt(e){let t=e.boundingVolume;if(l(t.box))return MDt(t.box);if(l(t.region))return DDt(t.region);if(ai(t,"3DTILES_bounding_volume_cylinder"))return LDt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new se("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function DDt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(te.WGS84.radii),c=new h(t,n,r),u=new h(i,o,s);return{shape:za.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var RDt=new h,ODt=new Z;function MDt(e){let t=In.unpack(e),n=Z.getScale(t.halfAxes,RDt),i=Z.getRotation(t.halfAxes,ODt);return{shape:za.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function LDt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-D.PI,maxAngle:r=D.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=M.fromTranslationQuaternionRotationScale(h.unpack(s),Pe.unpack(a),h.ONE);return{shape:za.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,u),shapeTransform:f}}function NDt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Di.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Di.getSchemaLoader({schema:i})}function FDt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([_,m])=>{let{type:y,componentType:b}=m,x=o?.properties[_].min,T=o?.properties[_].max,C=at.getComponentCount(y),A=Zve(x,C),S=Zve(T,C);return{id:_,type:y,componentType:b,minValue:A,maxValue:S}}),a=s.map(_=>_.id),c=s.map(_=>_.type),u=s.map(_=>_.componentType),f=s.map(_=>_.minValue),d=s.map(_=>_.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function Zve(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function BDt(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=ug(a);return o=await sT.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}fU.prototype.requestData=async function(e){e=e??G.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 HT({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await BDt(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:y}=s,b=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),x=y.getDerivedResource({url:b.url});return pA.fromGltf(x)};var HJ=fU;function GJ(e){e=e??1,this._radius=e??1}Object.defineProperties(GJ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});GJ.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var dU=GJ;var jJ={CUMULUS:0};jJ.validate=function(e){return e===jJ.CUMULUS};var Xw=Object.freeze(jJ);function Cm(e,t){if(e=e??G.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new V(this._maximumSize.x,this._maximumSize.y);else{this._scale=V.clone(e.scale??new V(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=H.clone(e.color??H.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var kDt=Cm.SHOW_INDEX=0,UDt=Cm.POSITION_INDEX=1,zDt=Cm.SCALE_INDEX=2,VDt=Cm.MAXIMUM_SIZE_INDEX=3,HDt=Cm.SLICE_INDEX=4,GDt=Cm.BRIGHTNESS_INDEX=5,jDt=Cm.COLOR_INDEX=6;Cm.NUMBER_OF_PROPERTIES=7;function SA(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Cm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,SA(this,kDt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),SA(this,UDt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;V.equals(t,e)||(V.clone(e,t),SA(this,zDt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),SA(this,VDt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),SA(this,jDt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,SA(this,HDt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,SA(this,GDt))}}});Cm.prototype._destroy=function(){this._cloudCollection=void 0};var Rf=Cm;var Of,u6=new h,WDt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},qDt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},YDt=Rf.SHOW_INDEX,XDt=Rf.POSITION_INDEX,KDt=Rf.SCALE_INDEX,$Dt=Rf.MAXIMUM_SIZE_INDEX,ZDt=Rf.SLICE_INDEX,QDt=Rf.BRIGHTNESS_INDEX,JDt=Rf.NUMBER_OF_PROPERTIES,e1t=Rf.COLOR_INDEX;function Am(e){e=e??G.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(JDt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:Qve(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 Qve(e){return function(){return u6.x=e._textureSliceWidth,u6.y=e._noiseTextureRows,u6.z=1/e._noiseTextureRows,u6}}Object.defineProperties(Am.prototype,{length:{get:function(){return qJ(this),this._clouds.length}}});function Jve(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Am.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let t=e.cloudType??Xw.CUMULUS,n;return t===Xw.CUMULUS&&(n=new Rf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Am.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Am.prototype.removeAll=function(){Jve(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function qJ(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}}Am.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Am.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Am.prototype.get=function(e){return qJ(this),this._clouds[e]};var t1t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),n1t=new Uint16Array([0,1,2,0,2,3]);function i1t(e){let t=st.createVertexBuffer({context:e,typedArray:t1t,usage:Ne.STATIC_DRAW}),n=st.createIndexBuffer({context:e,typedArray:n1t,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT}];return new qn({context:e,attributes:i,indexBuffer:n})}var YJ;function o1t(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=st.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function r1t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=st.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function s1t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=st.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function a1t(e,t,n){let i=[{index:Of.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Of.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Of.packedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Of.packedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:Of.color,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:Of.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:s1t(e)});let o=n?t:4*t;return new l_(e,i,o,n)}var WJ=new Gn;function ewe(e,t,n,i){let o,r=n[Of.positionHighAndScaleX],s=n[Of.positionLowAndScaleY],a=i.position;Gn.fromCartesian(a,WJ);let c=i.scale,u=WJ.high,f=WJ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function twe(e,t,n,i){let o,r=n[Of.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 nwe(e,t,n,i){let o,r=n[Of.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 iwe(e,t,n,i){let o,r=n[Of.color],s=i.color,a=H.floatToByte(s.red),c=H.floatToByte(s.green),u=H.floatToByte(s.blue),f=H.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function c1t(e,t,n,i){ewe(e,t,n,i),twe(e,t,n,i),nwe(e,t,n,i),iwe(e,t,n,i)}function l1t(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=i1t(a),o._spNoise=Xt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new dt({context:a,width:r*r/s,height:r*s,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA,sampler:new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})});let f=new Ea({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:Qve(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function u1t(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=a1t(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];c1t(e,t,s,c)}n._vaf.commit(YJ(i))}}var f1t=[];function d1t(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=f1t;u.length=0,(c[XDt]||c[KDt])&&u.push(ewe),(c[YDt]||c[QDt])&&u.push(twe),(c[$Dt]||c[ZDt])&&u.push(nwe),c[e1t]&&u.push(iwe);let f=u.length,d=i._vaf.writers,p,_,m;if(a/r>.1){for(p=0;p<a;++p)for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,d,_);i._vaf.commit(YJ(n))}else{for(p=0;p<a;++p){for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,d,_);i._instanced?i._vaf.subCommit(_._index,1):i._vaf.subCommit(_._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function h1t(e,t,n,i){let o=t.context,r=e,s=new Be({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Be({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Xt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Of}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:q.LESS},depthMask:!1,blending:fn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function m1t(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new qe),f.pass=Se.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Am.prototype.update=function(e){if(qJ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&l1t(this,e,iU,nU),this._instanced=e.context.instancedArrays,Of=this._instanced?qDt:WDt,YJ=this._instanced?r1t:o1t;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?u1t(this,e):r>0&&d1t(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)&&h1t(this,e,tU,eU),m1t(this,e))};Am.prototype.isDestroyed=function(){return!1};Am.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(),Jve(this._clouds),ce(this)};var XJ=Am;var p1t=D.toRadians(30);function KJ(e){this._angle=e??p1t}Object.defineProperties(KJ.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});KJ.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var $J=KJ;var _1t=new H,g1t=new H,y1t=new H,b1t=new H,owe=new ie,hU=new Uint8Array(4);function rwe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return H.lerp(t.color,n.color,o,i)}function f6(e,t){return{height:e,color:H.clone(t)}}function swe(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?H.equals(t.color,i[n-1].color):!1,a=r?H.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?H.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function x1t(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 _=s[n],m=D.clamp(_.height,vu._minimumHeight,vu._maximumHeight),y=H.clone(_.color,_1t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(f6(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let _=c[n+0],m=c[n+1];u=u&&_.height<=m.height,f=f&&_.height>=m.height}f?c=c.reverse():u||Kg(c,function(_,m){return D.sign(_.height-m.height)});let d=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,f6(vu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,f6(vu._maximumHeight,c[c.length-1].color)),c=swe(c),i.push(c)}return i}function T1t(e){let t=x1t(e),n=[],i=[],o;function r(u,f){n.push(f6(u,f))}function s(u,f,d){let p=H.multiplyByScalar(d,1-f.alpha,b1t);p=H.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,_=i.length;for(;f<p||d<_;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,x=d<_?i[d]:void 0,T=d>0?i[d-1]:void 0,C=d<_-1?i[d+1]:void 0;if(l(m)&&l(x)&&m.height===x.height){let A=l(C)&&x.height===C.height,S=!l(T),w=!l(C),R=l(b)&&m.height===b.height,P=!l(y),O=!l(b);A?R?(s(m.height,m.color,x.color),s(m.height,b.color,C.color)):P?(r(m.height,x.color),s(m.height,m.color,C.color)):O?(s(m.height,m.color,x.color),r(m.height,C.color)):(s(m.height,m.color,x.color),s(m.height,m.color,C.color)):S?R?(r(m.height,m.color),s(m.height,b.color,x.color)):O?(r(m.height,m.color),r(m.height,x.color)):(P||r(m.height,m.color),s(m.height,m.color,x.color)):w?R?(s(m.height,m.color,x.color),r(m.height,b.color)):P?(r(m.height,x.color),r(m.height,m.color)):O?s(m.height,m.color,x.color):(s(m.height,m.color,x.color),r(m.height,m.color)):R?(s(m.height,m.color,x.color),s(m.height,b.color,x.color)):P?(r(m.height,x.color),s(m.height,m.color,x.color)):O?(s(m.height,m.color,x.color),r(m.height,x.color)):s(m.height,m.color,x.color),f+=R?2:1,d+=A?2:1}else if(l(m)&&l(x)&&l(T)&&m.height<x.height){let A=rwe(m.height,T,x,y1t);l(y)?l(b)?s(m.height,m.color,A):(s(m.height,m.color,A),r(m.height,A)):(r(m.height,A),s(m.height,m.color,A)),f++}else if(l(x)&&l(m)&&l(y)&&x.height<m.height){let A=rwe(x.height,y,m,g1t);l(T)?l(C)?s(x.height,A,x.color):(s(x.height,A,x.color),r(x.height,A)):(r(x.height,A),s(x.height,A,x.color)),d++}else l(m)&&(!l(x)||m.height<x.height)?(l(x)&&!l(T)&&!l(b)?(r(m.height,m.color),r(m.height,vu._emptyColor),r(x.height,vu._emptyColor)):(!l(x)&&l(T)&&!l(y)&&(r(T.height,vu._emptyColor),r(m.height,vu._emptyColor)),r(m.height,m.color)),f++):l(x)&&(!l(m)||x.height<m.height)&&(r(x.height,x.color),d++)}}return swe(n)}function vu(e){let{scene:t,layers:n}=e??G.EMPTY_OBJECT,{context:i}=t,o=T1t(n),r=o.length,s,a,c;if(!vu._useFloatTexture(i)){a=He.UNSIGNED_BYTE,c=je.RGBA,s=new Uint8Array(r*4);for(let _=0;_<r;_++)ie.packFloat(o[_].height,owe),ie.pack(owe,s,_*4)}else{a=He.FLOAT,c=i.webgl2?je.RED:je.LUMINANCE,s=new Float32Array(r);for(let _=0;_<r;_++)s[_]=o[_].height}let f=dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),d=new Uint8Array(r*4);for(let _=0;_<r;_++)o[_].color.toBytes(hU),d[_*4+0]=hU[0],d[_*4+1]=hU[1],d[_*4+2]=hU[2],d[_*4+3]=hU[3];let p=dt.create({context:i,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})});return $i.fromType("ElevationBand",{heights:f,colors:p})}vu._useFloatTexture=function(e){return e.floatingPointTexture};vu._maximumHeight=5906376425472;vu._minimumHeight=-5906376425472;vu._emptyColor=new H(0,0,0,0);var ZJ=vu;async function C1t(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??G.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||bt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??kC.defaultApiKey;if(!l(n))return A1t(t);let i,o=kC.getDefaultCredit();l(o)&&(i=[o]);let r=new Ee({url:`${kC.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return ws.fromUrl(r,t)}var awe={};async function A1t(e){let i=awe[2275207];l(i)||(i=Hu.fromAssetId(2275207),awe[2275207]=i);let o=await i;return ws.fromUrl(o,e)}var QJ=C1t;async function E1t(e){let t=await ws.fromIonAssetId(96188,e);e=e??G.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??H.WHITE).toCssColorString();n=new EA({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var JJ=E1t;function S1t(e){e=e??G.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(e.modelMatrix??M.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new It({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new It({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new It({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Pn({asynchronous:!1,geometryInstances:t,appearance:new un({flat:!0,translucent:!1})})}var eee=S1t;function mU(e){e=e??G.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } -`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } -`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } -`;break;case"vec4":r=`vec4 getColor() { return ${o}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${o}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${o} = czm_batchTable_${t}(batchId); -`:`${o} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${o}; -${r} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=co.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(mU.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}}});mU.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;mU.prototype.isTranslucent=co.prototype.isTranslucent;mU.prototype.getRenderState=co.prototype.getRenderState;var tee=mU;function d6(e){e=e??G.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}d6.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new It({geometry:new Fg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:ls.VERTEX_FORMAT,colors:[H.RED,H.RED],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new It({geometry:new Fg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:ls.VERTEX_FORMAT,colors:[H.GREEN,H.GREEN],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new It({geometry:new Fg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:ls.VERTEX_FORMAT,colors:[H.BLUE,H.BLUE],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Pn({geometryInstances:[t,n,i],appearance:new ls,asynchronous:!1})}this._primitive.update(e)}};d6.prototype.isDestroyed=function(){return!1};d6.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var pU=d6;function v1t(e){this.direction=h.clone(e.direction),this.color=H.clone(e.color??H.WHITE),this.intensity=e.intensity??1}var nee=v1t;var _U=`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 gU=`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 vA(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:$i.fromType($i.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??gU,this._fragmentShaderSource=e.fragmentShaderSource??_U,this._renderState=co.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(vA.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 vA.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});vA.VERTEX_FORMAT=De.POSITION_AND_ST;vA.prototype.getFragmentShaderSource=co.prototype.getFragmentShaderSource;vA.prototype.isTranslucent=co.prototype.isTranslucent;vA.prototype.getRenderState=co.prototype.getRenderState;var iee=vA;function wu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??wu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??wu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??wu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??wu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??wu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new me,this._nominalFrameRate=new me,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){w1t(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(){I1t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}wu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};wu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new wu({scene:e})),e._frameRateMonitor};Object.defineProperties(wu.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}}});wu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};wu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};wu.prototype.isDestroyed=function(){return!1};wu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ce(this)};function w1t(e,t){if(e._pauseCount>0)return;let n=Si();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Yn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Yn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Yn.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 I1t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var yU=wu;var cwe=er(sZ(),1);function oee(){this._image=new Image}oee.prototype.isReady=function(){return!0};oee.prototype.shouldDiscardImage=function(e){return e===this._image};function wA(e){e=e??G.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 Ei({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new _t(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oee),this._errorEvent=new me}Object.defineProperties(wA.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}}});wA.fromMetadata=function(e,t){if(!e.imageryPresent)throw new se(`The server ${e.url} doesn't have imagery`);let n=new wA(t);return n._metadata=e,n};wA.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]}};wA.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=Yg.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new tr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=P1t(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){Q2(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=D1t(f)),!l(d)&&(!l(p)||p)){let _=R1t(f);d=_.imageType,f=_.imageData}return!l(d)||!l(f)?o:L_({uint8Array:f,format:d,flipY:!0})})};wA.prototype.pickFeatures=function(e,t,n,i,o){};function P1t(e,t,n,i,o,r){let s=Yg.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 D1t(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 R1t(e){let t=cwe.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 se("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var ree=wA;var O1t=new H(1,1,1,.4),M1t=new H(0,1,0,.05),L1t=new H(0,.5,0,.2);function IA(e){e=e??G.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 Ei({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??O1t,this._glowColor=e.glowColor??M1t,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??L1t,this._errorEvent=new me,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(IA.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}}});IA.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()};IA.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};IA.prototype.getTileCredits=function(e,t,n){};IA.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};IA.prototype.pickFeatures=function(e,t,n,i,o){};var see=IA;function Em(){}Em._maxDecodingConcurrency=Math.max(Nt.hardwareConcurrency-1,1);Em._decodeTaskProcessor=new di("decodeI3S",Em._maxDecodingConcurrency);Em._promise=void 0;async function N1t(){if(await Em._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Em._decodeTaskProcessor;throw new se("I3S decoder could not be initialized.")}Em.decode=async function(e,t,n,i,o){return l(Em._promise)||(Em._promise=N1t()),Em._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=Z.fromRotationX(-D.PI_OVER_TWO),p=new Z;Z.multiply(d,a,p);let _=fe.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(_),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:_,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var bU=Em;function aee(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(aee.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aee.prototype.load=async function(){return this._data=await Sm.loadJson(this._resource),this._data};var xU=aee;function my(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(my.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 h6(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 F1t(e){return e==="String"?1:h6(e)}async function B1t(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)}my.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=B1t(this).catch(function(e){console.error(e)}),this._loadPromise)};my.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}};my.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};my.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};my.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=h6(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=h6(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};my.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=F1t(i.valueType)}if(e.byteLength<t)throw new se(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};my.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new se(`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=h6(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new se(`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 se(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new se(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var TU=my;function CU(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(CU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});CU.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var k1t=new h,U1t=new h,z1t=new h,V1t=new h,H1t=new h;function cee(e,t,n,i){let o=h.subtract(i,n,k1t),r=h.cross(o,h.subtract(e,n,U1t),V1t),s=h.cross(o,h.subtract(t,n,z1t),H1t);return h.dot(r,s)>=0}var G1t=new h,j1t=new h,W1t=new h,q1t=new h,Y1t=new h,X1t=new h,K1t=new h,$1t=new h,Z1t=new h,Q1t=new h;CU.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let _,m,y;l(f)?(_=f[p],m=f[p+1],y=f[p+2]):(_=p*3,m=p*3+1,y=p*3+2);let b=h.fromElements(u[_*3],u[_*3+1],u[_*3+2],G1t),x=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],j1t),T=new h(u[y*3],u[y*3+1],u[y*3+2],W1t);if(!cee(i,b,x,T)||!cee(i,x,b,T)||!cee(i,T,b,x))continue;let C=h.subtract(x,b,q1t),A=h.subtract(T,b,Y1t),S=h.cross(C,A,X1t);if(h.magnitude(S)===0)continue;let w=h.normalize(S,K1t),R=h.subtract(i,b,$1t),P=Math.abs(h.dot(R,w));if(P<o){o=P,r=p;let O=h.magnitudeSquared(h.subtract(i,b,R)),L=h.magnitudeSquared(h.subtract(i,x,Z1t)),g=h.magnitudeSquared(h.subtract(i,T,Q1t));O<L&&O<g?(a=_,c=b,s=O):L<g?(a=m,c=x,s=L):(a=y,c=T,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function lwe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(HC(e[i])):t.push(e[i]);return t}CU.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let C=this._parent._data.mesh.material.definition;if(C>=0&&C<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[C],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let A="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let w=this._layer._data.textureSetDefinitions[S];for(let R=0;R<w.formats.length;R++){let P=w.formats[R];if(P.format==="jpg"){A=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${A}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=lwe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=lwe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=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=[],_=[],m=[];u&&(p=[{sampler:0,source:0}],_=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],b=n.length;for(let T=0;T<b;T++){let C=n[T].primitives,A=C.length;for(let S=0;S<A;S++){let w=C[S];if(l(w.material)){for(;w.material>=y.length;){let P=Fe(c,!0);y.push(P)}let R=y[w.material];l(w.extra)&&w.extra.isTransparent?l(R.alphaMode)||(R.alphaMode="BLEND"):R.alphaMode==="BLEND"&&(R.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:_,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Kw=CU;function Jc(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(Jc.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}}});Jc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Td(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Sm.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 uwe(e,t){let n=new TU(e,t);return e._fields[t.name]=n,n.load()}Jc.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(uwe(this,i))}return Promise.all(t)};Jc.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 uwe(this,o)}return Promise.resolve()};Jc.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)};Jc.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};Jc.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 Jc(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};Jc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Kw(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 Kw(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Jc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new xU(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Jc.prototype._clearGeometryData=function(){this._geometryData=[]};Jc.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=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let T=this._dataProvider._geoidDataList[x],C=T.projection.project(n);if(C.x>T.nativeExtent.west&&C.x<T.nativeExtent.east&&C.y>T.nativeExtent.south&&C.y<T.nativeExtent.north){n.height+=nRt(C.x,C.y,T);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;s=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[x].maxError);s===1/0&&(s=1e5);let a=s*16,c=new qa(0,0,0),u=At.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Pe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),_=M.inverse(p,new M),m=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=_,this._inverseRotationMatrix=d;let y=[];for(let x=0;x<this._children.length;x++)y.push(this._children[x]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Jc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Jc.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 bU.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 J1t(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 eRt(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 fwe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await J1t(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(!eRt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Jc.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=fwe(this,t);e.push(n)}return Promise.all(e)};Td.prototype._hookedRequestContent=Td.prototype.requestContent;Td.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 Ee({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(()=>{fwe(e._i3sNode,n)})),e._isLoading=!1,t})}};function tRt(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 m6(e,t,n,i){let o=e+t*n;return i[o]}function nRt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=m6(s,a,n.width,n.buffer),d=m6(c,a,n.width,n.buffer),p=m6(s,u,n.width,n.buffer),_=m6(c,u,n.width,n.buffer),m=tRt(o,r,f,d,p,_);return m=m*n.scale+n.offset,m}Object.defineProperties(Td.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var $w=Jc;function p6(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(p6.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lee(e,t){let n=[];for(let i=0;i<e.length;i++){let o=H.byteToFloat(e[i]);i<3?n.push(HC(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Zw(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=lee(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=lee(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=lee(a.color,a.transparency)))}break}}return n}function iRt(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=Zw(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=Zw(o.symbol,t)}return n}}function oRt(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(Zw(r.symbol,t)))}return i.symbols.push(void 0),i}}p6.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=Zw(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Zw(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=iRt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Zw(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=oRt(i,n))}};function dwe(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?dwe(s,t,n,i):s}}function rRt(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 sRt(e,t,n){let i=t[n],o=rRt(e.ranges,i);return e.symbols[o]}p6.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=>dwe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>sRt(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 AU=p6;function Iu(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 Ee({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(Iu.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}}});Iu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new se(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new AU(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()};Iu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Iu.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]}}};Iu.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 $w(this,t,!0)}else this._rootNode=new $w(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Iu.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]})};Iu._fetchJson=function(e){return e.fetchJson()};Iu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Iu._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]};Iu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ae.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ae.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Iu.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)?Fe(e):{},e.outlineColor=H.fromCartesian4(ie.fromArray(o))),this._tileset=await ws.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()})};Iu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Iu.prototype.filterByAttributes=function(e){this._filters=l(e)?Fe(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var PA=Iu;function _6(e,t){this._dataProvider=e,this._resource=new Ee({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(_6.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}}});_6.prototype.load=async function(){return this._data=await Sm.loadJson(this._resource),this._data};_6.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 EU=_6;function SU(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(SU.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}}});SU._fromData=async function(e,t,n,i){let o=new SU(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=SU._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ee({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Sm.loadJson(o._resource),c=new PA(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 vU=SU;var pwe=er(hwe(),1);function Os(e){e=e??G.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??G.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(Os.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}}});Os.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ce(this)};Os.prototype.isDestroyed=function(){return!1};Os.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Os.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Os.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Os.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 aRt(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 mwe(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=aRt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=vU._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 EU(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ae.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 PA(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.`)}Os.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Os.loadJson(n),o=new Os(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=mwe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await mwe(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};Os._fetchJson=function(e){return e.fetchJson()};Os.loadJson=async function(e){let t=await Os._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 se(t.error)}return t};Os.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 se(`Failed to load binary: ${e.url}`);return t};Os.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 cRt=new V;function lRt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let _=V.fromElements(d,p,cRt),m=_.toString();if(!o.hasOwnProperty(m)){let y={x:_.x,y:_.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],_=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(_)}return Promise.all(f).then(function(d){let p=[];for(let _=0;_<d.length;_++){let m={tilingScheme:n,x:i[_].x,y:i[_].y,level:i[_].level},y=d[_],b="Geographic";n._projection instanceof Li&&(b="WebMercator");let x={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===Fd.LERC){let T=pwe.default.decode(y._buffer);x.buffer=T.pixels[0]}else x.buffer=y._buffer;p.push(x)}return p})}async function uRt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await lRt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Os.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=uRt(this),this._geoidDataPromise)};Os.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ae.union(e,n,e):e=ae.clone(n)}this._extent=e};Os.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Os.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[]};Os.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 Sm=Os;var wU={};wU.createTilesetFromIModelId=async function(e,t){let{exports:n}=await js.getExports(e);if(n.length>0&&n.every(a=>a.status===js.ExportStatus.Invalid))throw new se(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===js.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 Ee({url:r});return ws.fromUrl(s,t)};wU.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await js.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![js.RealityDataType.Cesium3DTiles,js.RealityDataType.PNTS,js.RealityDataType.RealityMesh3DTiles,js.RealityDataType.Terrain3DTiles].includes(n))throw new se(`Reality data type is not a mesh type: ${n}`);let r=await js.getRealityDataURL(e,t,i);return ws.fromUrl(r,{maximumScreenSpaceError:4})};wU.createDataSourceForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await js.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![js.RealityDataType.KML,js.RealityDataType.GeoJSON].includes(n))throw new se(`Reality data type is not a data source type: ${n}`);let r=await js.getRealityDataURL(e,t,i);return n===js.RealityDataType.GeoJSON?nb.load(r):IC.load(r)};wU.loadGeospatialFeatures=async function(e,t,n){let i=n??1e4,o=`${js.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ee({url:o,headers:{Authorization:js._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return nb.load(r)};var uee=wU;function _we(){}Object.defineProperties(_we.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var fee=_we;var fRt=/\/$/,gwe=new _t('© <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 Qw(e){e=e??G.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=Ee.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();fRt.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 _t(c))):c=gwe,this._resource=i,this._imageryProvider=new lc({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(Qw.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}}});Qw.prototype.getTileCredits=function(e,t,n){};Qw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Qw.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Qw._defaultCredit=gwe;var dee=Qw;function hee(e){}hee.prototype.isReady=function(){return!0};hee.prototype.shouldDiscardImage=function(e){return!1};var mee=hee;var dRt=new _t("MapQuest, Open Street Map and contributors, CC-BY-SA");function y6(e){e=e??G.EMPTY_OBJECT;let t=Ee.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new gs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ae.southwest(a),r),u=n.positionToTileXY(ae.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??dRt;typeof d=="string"&&(d=new _t(d)),lc.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(y6.prototype=Object.create(lc.prototype),y6.prototype.constructor=y6);var py=y6;var hRt=new V(1,1);function pee(e){e=e??G.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=H.clone(e.startColor??H.WHITE),this.endColor=H.clone(e.endColor??H.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=V.clone(e.imageSize??hRt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pee.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var ywe=new h;pee.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,ywe),h.add(this.position,ywe,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 Jw=pee;function bwe(e){e=e??G.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(bwe.prototype,{complete:{get:function(){return this._complete}}});var _ee=bwe;function xwe(e){}xwe.prototype.emit=function(e){he.throwInstantiationError()};var gee=xwe;var Twe=new V(1,1);function IU(e){e=e??G.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 dU(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=H.clone(e.color??e.startColor??H.WHITE),this._endColor=H.clone(e.color??e.endColor??H.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=V.clone(e.imageSize??e.minimumImageSize??Twe),this._maximumImageSize=V.clone(e.imageSize??e.maximumImageSize??Twe),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 me,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(IU.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){H.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){H.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 mRt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new Jw;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function pRt(e){let t=e._particlePool.pop();return l(t)||(t=new Jw),t}function _Rt(e,t){e._particlePool.push(t)}function gRt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function yRt(e){l(e._billboard)&&(e._billboard.show=!1)}function Cwe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new H(i,o,r,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function bRt(e,t){t.startColor=H.clone(e._startColor,t.startColor),t.endColor=H.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function xRt(e,t){if(e._isComplete)return 0;t=D.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var b6=new h;IU.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Zu),this._updateParticlePool&&(mRt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=$.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)?Cwe(this,s):(yRt(s),_Rt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=xRt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=pRt(this),this._emitter.emit(s),h.add(s.position,s.velocity,b6),M.multiplyByPoint(u,b6,b6),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(b6,s.position,s.velocity),h.normalize(s.velocity,s.velocity),bRt(this,s),Cwe(this,s)}if(this._billboardCollection.update(e),this._previousTime=$.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&gRt(this)};IU.prototype.isDestroyed=function(){return!1};IU.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ce(this)};var yee=IU;function Mf(){he.throwInstantiationError()}Mf.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Mf.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});Mf.prototype.update=he.throwInstantiationError;Mf.prototype.beginUpdate=he.throwInstantiationError;Mf.prototype.endUpdate=he.throwInstantiationError;Mf.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;Mf.prototype.loadTile=he.throwInstantiationError;Mf.prototype.computeTileVisibility=he.throwInstantiationError;Mf.prototype.showTileThisFrame=he.throwInstantiationError;Mf.prototype.computeDistanceToTile=he.throwInstantiationError;Mf.prototype.isDestroyed=he.throwInstantiationError;Mf.prototype.destroy=he.throwInstantiationError;var bee=Mf;function xee(e){e=e??1,this._radius=e??1}Object.defineProperties(xee.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});xee.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Tee=xee;function PU(){}PU.prototype.evaluate=function(e,t){he.throwInstantiationError()};PU.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};PU.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};PU.prototype.getVariables=function(){he.throwInstantiationError()};var Cee=PU;function eI(e){this._ready=!1,this._provider=void 0,this._errorEvent=new me,this._readyEvent=new me,CRt(this,e)}Object.defineProperties(eI.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}}});eI.fromWorldTerrain=function(e){return new eI(MC(e))};eI.fromWorldBathymetry=function(e){return new eI(Z2(e))};function TRt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function CRt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){TRt(e._errorEvent,i)}}var DU=eI;function tI(){}tI.prototype.boundingVolume=void 0;tI.prototype.boundingSphere=void 0;tI.prototype.distanceToCamera=function(e){he.throwInstantiationError()};tI.prototype.intersectPlane=function(e){he.throwInstantiationError()};tI.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var Aee=tI;function RU(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ei({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(RU.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}}});RU.prototype.getTileCredits=function(e,t,n){};RU.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)};RU.prototype.pickFeatures=function(e,t,n,i,o){};var OU=RU;function MU(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ei({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(MU.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}}});MU.prototype.getTileCredits=function(e,t,n){};MU.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n),c=Cesium.Cartesian3.fromDegrees(a.west,a.south),u=Cesium.Cartesian3.fromDegrees(a.east,a.south),f=Cesium.Cartesian3.fromDegrees(a.west,a.north),d=Number(Cesium.Cartesian3.distance(c,u).toFixed(2)),p=Number(Cesium.Cartesian3.distance(c,f).toFixed(2)),_="m",m="m";return d>=1e3&&(d=Number((d/1e3).toFixed(2)),_="\u339E"),p>=1e3&&(p=Number((p/1e3).toFixed(2)),m="\u339E"),r.fillText(`${d} ${_}`,124,246),r.textAlign="left",r.fillText(`${p} ${m}`,14,136),Promise.resolve(o)};MU.prototype.pickFeatures=function(e,t,n,i,o){};var Eee=MU;function LU(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ei({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(LU.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}}});LU.prototype.getTileCredits=function(e,t,n){};LU.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n);return e%2&&t%2&&r.fillText(`${a.south<0?"S":"N"} ${Math.abs(Number(a.south.toFixed(1)))}\xB0`,124,246),!(e%2)&&!(t%2)&&(r.textAlign="left",r.fillText(`${a.west<0?"W":"E"} ${Math.abs(Number(a.west.toFixed(1)))}\xB0`,14,136)),Promise.resolve(o)};LU.prototype.pickFeatures=function(e,t,n,i,o){};var See=LU;function vee(e){he.throwInstantiationError()}vee.prototype.isReady=he.throwInstantiationError;vee.prototype.shouldDiscardImage=he.throwInstantiationError;var wee=vee;var ARt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Iee=Object.freeze(ARt);function x6(e,t){this.show=!0,l(e)||(e=new Xe),this.rectangle=Xe.clone(e),l(t)||(t=$i.fromType($i.ColorType,{color:new H(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}x6.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Xe.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending: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 Be({sources:[this._material.shaderSource,aU]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Se.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};x6.prototype.isDestroyed=function(){return!1};x6.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ce(this)};var Pee=x6;function Dee(){he.throwInstantiationError()}Object.defineProperties(Dee.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},availableLevels:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});Dee.prototype.requestData=function(e){he.throwInstantiationError()};var Ree=Dee;function DA(){he.throwInstantiationError()}Object.defineProperties(DA.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});DA.prototype.update=he.throwInstantiationError;DA.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;DA.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;DA.DefaultMinBounds=he.throwInstantiationError;DA.DefaultMaxBounds=he.throwInstantiationError;var Oee=DA;var Mee=`uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates)); - z_window = czm_reverseLogDepth(z_window); - float n_range = czm_depthRange.near; - float f_range = czm_depthRange.far; - float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); - float scale = pow(z_ndc * 0.5 + 0.5, 8.0); - out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); -} -`;function ERt(e){e=e??G.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??je.RGBA,this.pixelDatatype=e.pixelDatatype??He.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=Ee.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?sn.REPEAT:sn.CLAMP_TO_EDGE;this.sampler=new zt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Lee=ERt;var SRt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},Nee=Object.freeze(SRt);var vRt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},Fee=Object.freeze(vRt);function wRt(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: ${Sp(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 Bee=wRt;function RA(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoadFromCache=o=>{kee(this),this._texture=o,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,n()},t._failLoad=o=>{i(o)},t._completeLoad=()=>{this._ready=!0,n()}})}Object.defineProperties(RA.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});RA.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var IRt=new h(1,0,0),PRt=new h(0,0,1),DRt=new h(-1,0,0),RRt=new h(0,0,-1),T6=new h(0,1,0),ORt=new h(0,-1,0),Swe=[T6,DRt,PRt,ORt,IRt,T6,RRt,T6,T6],vwe=Swe.length,wwe=new Float32Array(vwe*3),Awe=0;for(let e=0;e<vwe;++e,Awe+=3)h.pack(Swe[e],wwe,Awe);var MRt=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),LRt=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function NRt(e){let t=st.createVertexBuffer({context:e,typedArray:MRt,usage:Ne.STATIC_DRAW}),n=st.createVertexBuffer({context:e,typedArray:wwe,usage:Ne.STATIC_DRAW}),i=st.createIndexBuffer({context:e,typedArray:LRt,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:K.FLOAT}];return new qn({context:e,attributes:o,indexBuffer:i})}function Ewe(e){return function(){return e}}function kee(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(l(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}RA.prototype.update=function(e){let t=e.context;if(!RA.isSupported(t)||(l(this._texture)&&l(this._va)&&kee(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let _=e.context.textureCache.getTexture(this._url);l(_)&&this._completeLoadFromCache(_)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let _=this;Qs(this._url).then(function(m){_._cubeMapBuffers=m,_._loading=!1}).catch(function(m){_._failLoad(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;l(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT;let r=je.RGBA,s=new Be({defines:i,sources:[rU]});this._va=NRt(t),this._sp=Xt.fromCache({context:t,vertexShaderSource:sU,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let _=0;_<a;++_){let m=n[_].positiveY;n[_].positiveY=n[_].negativeY,n[_].negativeY=m;let y=c[_]=new or({context:t,source:n[_],pixelDatatype:o}),b=c[_].width*2,x=u[_]=new dt({context:t,width:b,height:b,pixelDatatype:o,pixelFormat:r}),T=new Ea({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:Ewe(y)},outputTexture:x,persists:!0,owner:this});e.commandList.push(T),d[`texture${_}`]=Ewe(x)}this._texture=new dt({context:t,width:f*1.5+2,height:f,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Ea({fragmentShaderSource:oU,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._completeLoad()};RA.prototype.isDestroyed=function(){return!1};RA.prototype.destroy=function(){return kee(this),this._texture=this._texture&&this._texture.destroy(),ce(this)};var nI=RA;function NU(e){e=Oe(e,Oe.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?V.clone(e.imageBasedLightingFactor):new V(1,1);this._imageBasedLightingFactor=t;let n=Oe(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=V.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i}Object.defineProperties(NU.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=V.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},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._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||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}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function FRt(e,t){if(nI.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new nI(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,n.readyPromise.then(function(){e._specularEnvironmentMapLoaded=!0}).catch(function(i){console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}NU.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;V.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=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),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._specularEnvironmentMapAtlasDirty&&(FRt(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);let o=!l(this._specularEnvironmentMapAtlas)&&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._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};NU.prototype.isDestroyed=function(){return!1};NU.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),ce(this)};var C6=NU;function BRt(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Co=BRt;function $t(){}$t.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}}};$t.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}}};$t.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?$t.objectLegacy(i,n):$t.object(i,n)};$t.accessor=function(e,t){return $t.topLevel(e,"accessors",t)};$t.accessorWithSemantic=function(e,t,n){let i={};return $t.mesh(e,function(o){return $t.meshPrimitive(o,function(r){let s=$t.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:$t.meshPrimitiveTarget(r,function(a){return $t.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};$t.accessorContainingVertexAttributeData=function(e,t){let n={};return $t.mesh(e,function(i){return $t.meshPrimitive(i,function(o){let r=$t.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:$t.meshPrimitiveTarget(o,function(s){return $t.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};$t.accessorContainingIndexData=function(e,t){let n={};return $t.mesh(e,function(i){return $t.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}})})};$t.animation=function(e,t){return $t.topLevel(e,"animations",t)};$t.animationChannel=function(e,t){let n=e.channels;return $t.object(n,t)};$t.animationSampler=function(e,t){let n=e.samplers;return $t.object(n,t)};$t.buffer=function(e,t){return $t.topLevel(e,"buffers",t)};$t.bufferView=function(e,t){return $t.topLevel(e,"bufferViews",t)};$t.camera=function(e,t){return $t.topLevel(e,"cameras",t)};$t.image=function(e,t){return $t.topLevel(e,"images",t)};$t.material=function(e,t){return $t.topLevel(e,"materials",t)};$t.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}};$t.mesh=function(e,t){return $t.topLevel(e,"meshes",t)};$t.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}}};$t.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}};$t.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}}};$t.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}};$t.node=function(e,t){return $t.topLevel(e,"nodes",t)};$t.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=$t.nodeInTree(e,u,n),l(c)))return c}}}};$t.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return $t.nodeInTree(e,i,n)};$t.program=function(e,t){return Co(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.programs,t):$t.topLevel(e,"programs",t)};$t.sampler=function(e,t){return $t.topLevel(e,"samplers",t)};$t.scene=function(e,t){return $t.topLevel(e,"scenes",t)};$t.shader=function(e,t){return Co(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.shaders,t):$t.topLevel(e,"shaders",t)};$t.skin=function(e,t){return $t.topLevel(e,"skins",t)};$t.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}}};$t.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}};$t.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}};$t.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}};$t.technique=function(e,t){return Co(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.techniques,t):$t.topLevel(e,"techniques",t)};$t.texture=function(e,t){return $t.topLevel(e,"textures",t)};var Ce=$t;function kRt(e,t,n){if(n=Oe(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Fo=kRt;function URt(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 Pu=URt;function zRt(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 K.getSizeInBytes(t.componentType)*Pu(t.type)}var Lf=zRt;function VRt(e){Ce.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=Oe(n.byteOffset,0))}),Ce.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=Oe(n.byteOffset,0))}),Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){if(i.mode=Oe(i.mode,q.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Fo(e.materials,o)}})}),Ce.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=Oe(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Lf(e,i),r.target=q.ARRAY_BUFFER}}),Ce.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=q.ELEMENT_ARRAY_BUFFER}}),Ce.material(e,function(n){let i=Oe(n.extensions,Oe.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=Oe(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=Oe(u.shininess,0))),o.transparent=Oe(o.transparent,!1),o.doubleSided=Oe(o.doubleSided,!1);return}n.emissiveFactor=Oe(n.emissiveFactor,[0,0,0]),n.alphaMode=Oe(n.alphaMode,"OPAQUE"),n.doubleSided=Oe(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=Oe(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Ce.materialValue(n,function(c){l(c.index)&&OA(c)}),OA(n.emissiveTexture),OA(n.normalTexture),OA(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=Oe(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=Oe(s.metallicFactor,1),s.roughnessFactor=Oe(s.roughnessFactor,1),OA(s.baseColorTexture),OA(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=Oe(a.diffuseFactor,[1,1,1,1]),a.specularFactor=Oe(a.specularFactor,[1,1,1]),a.glossinessFactor=Oe(a.glossinessFactor,1),OA(a.specularGlossinessTexture))}),Ce.animation(e,function(n){Ce.animationSampler(n,function(i){i.interpolation=Oe(i.interpolation,"LINEAR")})});let t=HRt(e);return Ce.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=Oe(n.translation,[0,0,0]),n.rotation=Oe(n.rotation,[0,0,0,1]),n.scale=Oe(n.scale,[1,1,1])):n.matrix=Oe(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Ce.sampler(e,function(n){n.wrapS=Oe(n.wrapS,q.REPEAT),n.wrapT=Oe(n.wrapT,q.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function HRt(e){let t={};return Ce.animation(e,function(n){Ce.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 OA(e){l(e)&&(e.texCoord=Oe(e.texCoord,0))}var Iwe=VRt;function GRt(e){return Ce.shader(e,function(t){A6(t)}),Ce.buffer(e,function(t){A6(t)}),Ce.image(e,function(t){A6(t)}),A6(e),e}function A6(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var FU=GRt;function jRt(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 Pwe=jRt;function WRt(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),Pwe(e,t),n.length===0&&delete e.extensionsUsed}}var E6=WRt;var qRt=4;function YRt(e){if(bl(e)!=="glTF")throw new se("File is not valid binary glTF");let n=Dwe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new se("Binary glTF version is not 1 or 2");return i===1?XRt(e,n):KRt(e,n)}function Dwe(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*qRt,!0);return o}function XRt(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new se("Binary glTF scene format is not JSON");let r=20,s=r+i,a=ia(e,r,i),c=JSON.parse(a);FU(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=Oe(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return E6(c,"KHR_binary_glTF"),c}function KRt(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Dwe(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=ia(u);o=JSON.parse(f),FU(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var Uee=YRt;function $Rt(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Fo(n,t,!0)}var _y=$Rt;function ZRt(e){switch(e){case K.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case K.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case K.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case K.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 K.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case K.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 K.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case K.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var S6=ZRt;function QRt(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Pu(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,_=Lf(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,b=K.getSizeInBytes(y),x=new DataView(d.buffer),T=new Array(r),C=S6(y);for(let A=0;A<p;A++){C(x,m,r,b,T);for(let S=0;S<r;S++){let w=T[S];s[S]=Math.min(s[S],w),a[S]=Math.max(a[S],w)}m+=_}return{min:s,max:a}}var v6=QRt;var JRt=[q.FUNC_ADD,q.FUNC_ADD],eOt=[q.ONE,q.ZERO,q.ONE,q.ZERO];function Rwe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var tOt=[q.ZERO,q.ONE,q.SRC_COLOR,q.ONE_MINUS_SRC_COLOR,q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA,q.DST_ALPHA,q.ONE_MINUS_DST_ALPHA,q.DST_COLOR,q.ONE_MINUS_DST_COLOR];function nOt(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(tOt.indexOf(e[n])===-1)return t;return e}function iOt(e){let t={},n={},i=e.techniques;return l(i)&&(Ce.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Rwe(s,q.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:Oe(c.blendEquationSeparate,JRt),blendFactors:nOt(c.blendFuncSeparate,eOt)})}Rwe(s,q.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),_y(e,"KHR_blend")),Ce.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Ce.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 Owe=iOt;function oOt(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Fo(n,t,!0),_y(e,t)}var Mwe=oOt;function rOt(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ce.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ce.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ce.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[d.fragmentShader];p.fragmentShader=Fo(r.shaders,_,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Fo(r.shaders,m,!0),u.program=Fo(r.programs,p),o[a.program]=u.program}i[c]=Fo(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,_y(e,"KHR_techniques_webgl"),Mwe(e,"KHR_techniques_webgl"))}return Ce.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Ce.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var Lwe=rOt;function sOt(e,t){ro.typeOf.object("material",e),ro.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,u=r.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Ce.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var zee=sOt;var Nwe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function aOt(e,t){return t=Oe(t,Nwe),Nwe.forEach(function(n){t.indexOf(n)>-1&&lOt(e,n)}),e}var cOt={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function lOt(e,t){let n=cOt[t],i=e[n];if(l(i)){let o=0,r=jp[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Gp[t](e,a-o),o++)}}function Gp(){}Gp.accessor=function(e,t){e.accessors.splice(t,1),Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){Ce.meshPrimitiveAttribute(o,function(s,a){s>t&&o.attributes[a]--}),Ce.meshPrimitiveTarget(o,function(s){Ce.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let r=o.indices;l(r)&&r>t&&o.indices--})}),Ce.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ce.animation(e,function(i){Ce.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Gp.buffer=function(e,t){e.buffers.splice(t,1),Ce.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--})};Gp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ce.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ce.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ce.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Co(e,"KHR_draco_mesh_compression")&&Ce.mesh(e,function(i){Ce.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--})}),Co(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Co(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Gp.image=function(e,t){e.images.splice(t,1),Ce.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})};Gp.mesh=function(e,t){e.meshes.splice(t,1),Ce.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Gp.node=function(e,t){e.nodes.splice(t,1),Ce.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})}),Ce.animation(e,function(i){Ce.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Ce.technique(e,function(i){Ce.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Ce.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}))}),Ce.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Gp.material=function(e,t){e.materials.splice(t,1),Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Gp.sampler=function(e,t){e.samplers.splice(t,1),Ce.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Gp.texture=function(e,t){if(e.textures.splice(t,1),Ce.material(e,function(i){zee(i,function(o,r){r.index>t&&--r.index})}),Co(e,"EXT_feature_metadata")){Ce.mesh(e,function(r){Ce.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let _=u[d].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Co(e,"EXT_mesh_features")&&Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Co(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function jp(){}jp.accessor=function(e){let t={};return Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){Ce.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Ce.meshPrimitiveTarget(i,function(r){Ce.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Ce.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ce.animation(e,function(n){Ce.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Co(e,"EXT_mesh_gpu_instancing")&&Ce.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})}),t};jp.buffer=function(e){let t={};return Ce.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};jp.bufferView=function(e){let t={};if(Ce.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ce.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ce.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Co(e,"KHR_draco_mesh_compression")&&Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Co(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(Co(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};jp.image=function(e){let t={};return Ce.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};jp.mesh=function(e){let t={};return Ce.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 Fwe(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!Fwe(e,o,n)}).length===0}jp.node=function(e){let t={};return Ce.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ce.skinJoint(n,function(i){t[i]=!0})}),Ce.animation(e,function(n){Ce.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ce.technique(e,function(n){Ce.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ce.node(e,function(n,i){Fwe(e,i,t)||(t[i]=!0)}),t};jp.material=function(e){let t={};return Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};jp.texture=function(e){let t={};if(Ce.material(e,function(n){zee(n,function(i){t[i]=!0})}),Co(e,"EXT_feature_metadata")){Ce.mesh(e,function(o){Ce.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Co(e,"EXT_mesh_features")&&Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Co(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};jp.sampler=function(e){let t={};return Ce.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var Bwe=aOt;function uOt(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Fo(e.buffers,n),byteOffset:0,byteLength:t.length};return Fo(e.bufferViews,o)}var kwe=uOt;function fOt(e,t){let n=Lf(e,t),i=K.getSizeInBytes(t.componentType),o=Pu(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=S6(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,d);for(let m=0;m<o;++m)s[_*o+m]=d[m];u+=n}return s}var Uwe=fOt;function dOt(e){let t;return Ce.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?w6(e,i,K.UNSIGNED_BYTE):t!==q.UNSIGNED_BYTE&&t!==q.UNSIGNED_SHORT&&w6(e,i,K.UNSIGNED_SHORT)}),Ce.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?w6(e,i,K.UNSIGNED_BYTE):t===q.SHORT&&w6(e,i,K.UNSIGNED_SHORT)}),e}function w6(e,t,n){let i=K.createTypedArray(n,Uwe(e,t)),o=new Uint8Array(i.buffer);t.bufferView=kwe(e,o),t.componentType=n,t.byteOffset=0}var zwe=dOt;function hOt(e,t){return E6(e,t),t==="CESIUM_RTC"&&mOt(e),Vee(e,t)}function mOt(e){Ce.technique(e,function(t){Ce.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Vee(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Vee(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)&&Vee(e[o],t);return i}}var I6=hOt;var P6={.8:xOt,"1.0":VOt,"2.0":void 0};function pOt(e,t){t=Oe(t,Oe.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=Oe(e.asset,{version:"1.0"}),e.asset.version=Oe(e.asset.version,"1.0"),i=Oe(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(P6,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(P6,i)||(i="1.0"));let o=P6[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=P6[i];return t.keepLegacyExtensions||(jOt(e),WOt(e)),e}function Hwe(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 _Ot(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=Oe(a.primitive,q.TRIANGLES);a.mode=Oe(a.mode,c),delete a.primitive}}}}function gOt(e){let t=e.nodes,n=new h,i=new Pe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Pe.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 yOt(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Pe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let y=f[m];if(y.target.path==="rotation"){let b=d[p[y.sampler].output];if(l(r[b]))continue;r[b]=!0;let x=n[b],T=i[x.bufferView],A=o[T.buffer].extras._pipeline.source,S=A.byteOffset+T.byteOffset+x.byteOffset,w=x.componentType,R=x.count,P=Pu(x.type),O=x.count*P,L=K.createArrayBufferView(w,A.buffer,S,O);for(let g=0;g<R;g++){let E=g*P;h.unpack(L,E,s);let v=L[E+3];Pe.fromAxisAngle(s,v,a),Pe.pack(a,L,E)}}}}}}function bOt(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=Oe(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=Oe(i.attributes,a.attributes),i.program=Oe(i.program,a.program),i.uniforms=Oe(i.uniforms,a.uniforms),i.states=Oe(i.states,s.states)}delete i.passes,delete i.pass}}}function xOt(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,Hwe(e),_Ot(e),gOt(e),yOt(e),bOt(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=Oe(e.extensions,{});e.extensions=n;let i=Oe(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,_y(e,"KHR_materials_common")}}function TOt(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 Vwe(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 COt(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]=Vwe(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]),Ce.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ce.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ce.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}}),Ce.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ce.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ce.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]})})}),Ce.mesh(e,function(s){Ce.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ce.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ce.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Fo(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ce.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Ce.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]]}}),Ce.animation(e,function(s){let a={};s.samplers=Vwe(s.samplers,a),Ce.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ce.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ce.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ce.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ce.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ce.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}}),Ce.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function AOt(e){Ce.animation(e,function(t){Ce.animationSampler(t,function(n){delete n.name})})}function EOt(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]}Ce.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function SOt(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var vOt={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function wOt(e){let t=e.extensionsUsed;if(e.extensionsRequired=Oe(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(vOt[o])&&e.extensionsRequired.push(o)}}}function IOt(e){Ce.buffer(e,function(t){delete t.type})}function POt(e){Ce.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function DOt(e){Ce.mesh(e,function(t){Ce.meshPrimitive(t,function(n){Ce.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})}),Ce.technique(e,function(t){Ce.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var ROt={POSITION:!0,NORMAL:!0,TANGENT:!0},OOt={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function MOt(e){let t={};Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){Ce.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=OOt[a];l(f)?(u=f+c,t[r]=u):l(ROt[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Ce.technique(e,function(n){Ce.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function LOt(e){Ce.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 Hee(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Lf(e,t)}function NOt(e){Ce.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ce.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=Hee(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(Oe(i.byteLength,0),r)}})}function FOt(e){let t,n,i,o=e.bufferViews,r={};Ce.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Ce.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=Oe(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,_){return p.byteOffset-_.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],_=Hee(e,p),m=p.byteOffset,y=p.count*_;delete p.byteStride;let b=t<d-1,x=b?Hee(e,c[t+1]):void 0;if(_!==x){let T=Fe(i,!0);r[a]&&(T.byteStride=_),T.byteOffset+=u,T.byteLength=m+y-u;let C=Fo(o,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=C,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}Bwe(e,["accessor","bufferView","buffer"])}function BOt(e){Ce.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=v6(e,n);n.min=i.min,n.max=i.max}})}function Gwe(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function jwe(e,t){Ce.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}}}),Ce.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Gwe(n)&&jwe(e,i))}}),delete e.nodes[t]}function kOt(e){return Ce.node(e,function(t,n){Gwe(t)&&jwe(e,n)}),e}function UOt(e){Ce.animation(e,function(t){Ce.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=v6(e,i);i.min=o.min,i.max=o.max}})})}function zOt(e){Ce.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=v6(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function VOt(e){e.asset=Oe(e.asset,{}),e.asset.version="2.0",Hwe(e),TOt(e),kOt(e),COt(e),AOt(e),SOt(e),wOt(e),NOt(e),FOt(e),BOt(e),UOt(e),zOt(e),IOt(e),POt(e),DOt(e),MOt(e),zwe(e),LOt(e),Owe(e),Lwe(e),EOt(e)}var HOt=["u_tex","u_diffuse","u_emission"],GOt=["u_diffuse"];function Gee(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function D6(e){return l(e.index)}function R6(e){return Array.isArray(e)&&e.length===4}function Wwe(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 jOt(e){Ce.material(e,function(t){Ce.materialValue(t,function(n,i){HOt.indexOf(i)!==-1&&D6(n)?(Gee(t),t.pbrMetallicRoughness.baseColorTexture=n):GOt.indexOf(i)!==-1&&R6(n)&&(Gee(t),t.pbrMetallicRoughness.baseColorFactor=Wwe(n))})}),I6(e,"KHR_techniques_webgl"),I6(e,"KHR_blend")}function WOt(e){Ce.material(e,function(t){let n=Oe(t.extensions,Oe.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(_y(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,u=n.doubleSided,f=n.transparent;Gee(t),l(r)&&(R6(r)?t.emissiveFactor=r.slice(0,3):D6(r)&&(t.emissiveTexture=r)),l(s)&&(R6(s)?t.pbrMetallicRoughness.baseColorFactor=Wwe(s):D6(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(R6(a)?t.emissiveFactor=a.slice(0,3):D6(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),I6(e,"KHR_materials_common")}var qwe=pOt;var gy={X:0,Y:1,Z:2};gy.Y_UP_TO_Z_UP=M.fromRotationTranslation(Z.fromRotationX(D.PI_OVER_TWO));gy.Z_UP_TO_Y_UP=M.fromRotationTranslation(Z.fromRotationX(-D.PI_OVER_TWO));gy.X_UP_TO_Z_UP=M.fromRotationTranslation(Z.fromRotationY(-D.PI_OVER_TWO));gy.Z_UP_TO_X_UP=M.fromRotationTranslation(Z.fromRotationY(D.PI_OVER_TWO));gy.X_UP_TO_Y_UP=M.fromRotationTranslation(Z.fromRotationZ(D.PI_OVER_TWO));gy.Y_UP_TO_X_UP=M.fromRotationTranslation(Z.fromRotationZ(-D.PI_OVER_TWO));gy.fromName=function(e){return gy[e]};var dc=Object.freeze(gy);var qOt={ADD:q.FUNC_ADD,SUBTRACT:q.FUNC_SUBTRACT,REVERSE_SUBTRACT:q.FUNC_REVERSE_SUBTRACT,MIN:q.MIN,MAX:q.MAX},MA=Object.freeze(qOt);var YOt={ZERO:q.ZERO,ONE:q.ONE,SOURCE_COLOR:q.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:q.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:q.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:q.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:q.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:q.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:q.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:q.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:q.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:q.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:q.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:q.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:q.SRC_ALPHA_SATURATE},Nf=Object.freeze(YOt);var XOt={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:MA.ADD,equationAlpha:MA.ADD,functionSourceRgb:Nf.SOURCE_ALPHA,functionSourceAlpha:Nf.ONE,functionDestinationRgb:Nf.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Nf.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:MA.ADD,equationAlpha:MA.ADD,functionSourceRgb:Nf.ONE,functionSourceAlpha:Nf.ONE,functionDestinationRgb:Nf.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Nf.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:MA.ADD,equationAlpha:MA.ADD,functionSourceRgb:Nf.SOURCE_ALPHA,functionSourceAlpha:Nf.ONE,functionDestinationRgb:Nf.ONE,functionDestinationAlpha:Nf.ONE})},jee=Object.freeze(XOt);function iI(e,t){this._distance=t,this._normal=new Ywe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(iI.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});iI.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new iI(e.normal,e.distance),t};iI.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new iI(e.normal,e.distance)};function Ywe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Ywe.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 O6=iI;function el(e){e=Oe(e,Oe.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=Oe(e.enabled,!0),this.modelMatrix=M.clone(Oe(e.modelMatrix,M.IDENTITY)),this.edgeColor=H.clone(Oe(e.edgeColor,H.WHITE)),this.edgeWidth=Oe(e.edgeWidth,0),this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=Oe(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Qwe:Jwe,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 Qwe(e){return e===Ht.OUTSIDE}function Jwe(e){return e===Ht.INSIDE}Object.defineProperties(el.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?Qwe:Jwe)}},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 Xwe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}el.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Xwe(n,i)},e.index=t,Xwe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};el.prototype.get=function(e){return this._planes[e]};function eIe(e,t){let n=e.length;for(let i=0;i<n;++i)if(en.equals(e[i],t))return i;return-1}el.prototype.contains=function(e){return eIe(this._planes,e)!==-1};el.prototype.remove=function(e){let t=this._planes,n=eIe(t,e);if(n===-1)return!1;e instanceof O6&&(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 O6&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};el.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof O6&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var KOt=new ie,$Ot=new ie;function Kwe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=On.octEncodeToCartesian4(a.normal,$Ot);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(a.distance,KOt);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function $we(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 tIe(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var ZOt=new V;el.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=el.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=tIe(o,ZOt);s.y*=2,i?(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.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?($we(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Kwe(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),$we(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),Kwe(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 QOt=new M,Zwe=new en(h.UNIT_X,0);el.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=M.multiply(t,o,QOt));let r=Ht.INSIDE;!this.unionClippingRegions&&i>0&&(r=Ht.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];en.transform(a,o,Zwe);let c=e.intersectPlane(Zwe);if(c===Ht.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};el.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};el.useFloatTexture=function(e){return e.floatingPointTexture};el.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=el.useFloatTexture(t)?e.length:e.length*2,r=tIe(o,n);return r.y*=2,r};el.prototype.isDestroyed=function(){return!1};el.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ce(this)};var BU=el;var kU={HIGHLIGHT:0,REPLACE:1,MIX:2};kU.getColorBlend=function(e,t){if(e===kU.HIGHLIGHT)return 0;if(e===kU.REPLACE)return 1;if(e===kU.MIX)return D.clamp(t,D.EPSILON4,1)};var M6=Object.freeze(kU);var JOt={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},nIe=Object.freeze(JOt);function Vi(){}Vi._maxDecodingConcurrency=Math.max(Nt.hardwareConcurrency-1,1);Vi._decoderTaskProcessor=void 0;Vi._taskProcessorReady=!1;Vi._getDecoderTaskProcessor=function(){if(!l(Vi._decoderTaskProcessor)){let e=new di("decodeDraco",Vi._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Vi._taskProcessorReady=!0}),Vi._decoderTaskProcessor=e}return Vi._decoderTaskProcessor};Vi.hasExtension=function(e){return l(e.extensionsRequired.KHR_draco_mesh_compression)||l(e.extensionsUsed.KHR_draco_mesh_compression)};function oIe(e,t){let n=`runtime.${Object.keys(e.createdBufferViews).length}`,i=e.buffers,o=Object.keys(i).length;return i[o]=t,e.createdBufferViews[n]={buffer:o,byteOffset:0,byteLength:t.byteLength},n}function eMt(e,t,n){let i=t._loadResources,o=oIe(i,e);return i.vertexBuffersToCreate.enqueue(o),o}function tMt(e,t,n){let i=e.typedArray,o=t._loadResources,r=oIe(o,i);return o.indexBuffersToCreate.enqueue({id:r,componentType:K.fromTypedArray(i)}),{bufferViewId:r,numberOfIndices:e.numberOfIndices}}function iIe(e,t,n,i){if(!Vi._taskProcessorReady)return;let o=n.primitivesToDecode.peek();if(!l(o))return;let r=e.scheduleTask(o,[o.array.buffer]);if(l(r))return n.activeDecodingTasks++,n.primitivesToDecode.dequeue(),r.then(function(s){n.activeDecodingTasks--;let a=tMt(s.indexArray,t,i),c={},u=s.attributeData;for(let f in u)if(u.hasOwnProperty(f)){let d=u[f],p=d.array,_=eMt(p,t,i),m=d.data;m.bufferView=_,c[f]=m}t._decodedData[`${o.mesh}.primitive.${o.primitive}`]={bufferView:a.bufferViewId,numberOfIndices:a.numberOfIndices,attributes:c}})}Vi._decodedModelResourceCache=void 0;Vi.parse=function(e,t){if(!Vi.hasExtension(e))return;let n=e._loadResources,i=e.cacheKey;if(l(i)){l(Vi._decodedModelResourceCache)||(l(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),Vi._decodedModelResourceCache=t.cache.modelDecodingCache);let s=Vi._decodedModelResourceCache[i];if(l(s)){s.count++,n.pendingDecodingCache=!0;return}}let o=e._dequantizeInShader,r=e.gltfInternal;Ce.mesh(r,function(s,a){Ce.meshPrimitive(s,function(c,u){if(!l(c.extensions))return;let f=c.extensions.KHR_draco_mesh_compression;if(!l(f))return;let d=r.bufferViews[f.bufferView],_=r.buffers[d.buffer].extras._pipeline.source.slice(d.byteOffset,d.byteOffset+d.byteLength);n.primitivesToDecode.enqueue({mesh:a,primitive:u,array:_,bufferView:d,compressedAttributes:f.attributes,dequantizeInShader:o})})})};Vi.decodeModel=function(e,t){if(!Vi.hasExtension(e))return Promise.resolve();let n=e._loadResources,i=e.cacheKey;if(l(i)&&l(Vi._decodedModelResourceCache)){let a=Vi._decodedModelResourceCache[i];if(l(a)&&n.pendingDecodingCache)return Promise.resolve(a.ready).then(function(){e._decodedData=a.data,n.pendingDecodingCache=!1});Vi._decodedModelResourceCache[i]={ready:!1,count:1,data:void 0}}if(n.primitivesToDecode.length===0)return Promise.resolve();let o=Vi._getDecoderTaskProcessor(),r=[],s=iIe(o,e,n,t);for(;l(s);)r.push(s),s=iIe(o,e,n,t);return Promise.all(r)};Vi.decodePointCloud=function(e){let t=Vi._getDecoderTaskProcessor();if(Vi._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Vi.decodeBufferView=function(e){let t=Vi._getDecoderTaskProcessor();if(Vi._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};Vi.cacheDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Vi._decodedModelResourceCache)){let n=Vi._decodedModelResourceCache[t];l(n)&&(n.ready=!0,n.data=e._decodedData)}};Vi.destroyCachedDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Vi._decodedModelResourceCache)){let n=Vi._decodedModelResourceCache[t];l(n)&&--n.count===0&&delete Vi._decodedModelResourceCache[t]}};var oI=Vi;function nMt(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) - { - gl_FragColor = clippingPlanesEdgeColor; - } -`}var rIe=nMt;var iMt=new V;function oMt(e,t){let n=e.unionClippingRegions,i=e.length,o=BU.useFloatTexture(t),r=BU.getTextureResolution(e,t,iMt),s=r.x,a=r.y,c=o?aMt(s,a):cMt(s,a);return c+=` -`,c+=n?rMt(i):sMt(i),c}function rMt(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 sMt(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 aMt(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 = texture2D(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -`}function cMt(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 = texture2D(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(texture2D(packedClippingPlanes, vec2(u + ${o}, v))); - return czm_transformPlane(plane, transform); -} -`}var sIe=oMt;var lMt={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},rI=Object.freeze(lMt);var uMt={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},UU=Object.freeze(uMt);var fo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};fo.getMathType=function(e){switch(e){case fo.SCALAR:return Number;case fo.VEC2:return V;case fo.VEC3:return h;case fo.VEC4:return ie;case fo.MAT2:return ei;case fo.MAT3:return Z;case fo.MAT4:return M}};fo.getNumberOfComponents=function(e){switch(e){case fo.SCALAR:return 1;case fo.VEC2:return 2;case fo.VEC3:return 3;case fo.VEC4:case fo.MAT2:return 4;case fo.MAT3:return 9;case fo.MAT4:return 16}};fo.getAttributeLocationCount=function(e){switch(e){case fo.SCALAR:case fo.VEC2:case fo.VEC3:case fo.VEC4:return 1;case fo.MAT2:return 2;case fo.MAT3:return 3;case fo.MAT4:return 4}};fo.getGlslType=function(e){switch(e){case fo.SCALAR:return"float";case fo.VEC2:return"vec2";case fo.VEC3:return"vec3";case fo.VEC4:return"vec4";case fo.MAT2:return"mat2";case fo.MAT3:return"mat3";case fo.MAT4:return"mat4"}};var LA=Object.freeze(fo);function L6(){}var fMt=/^data\:/i;function uIe(e,t){let n=e.gltfInternal,i=n.buffers,r=n.bufferViews[t.bufferView],s=i[r.buffer],a=r.byteOffset+t.byteOffset,c=t.count*Pu(t.type),u=fMt.test(s.uri)?"":s.uri;return`${e.cacheKey}//${u}/${a}/${c}`}var aIe={};L6.getAnimationParameterValues=function(e,t){let n=uIe(e,t),i=aIe[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,a=o.bufferViews[t.bufferView],c=a.buffer,f=r[c].extras._pipeline.source,d=t.componentType,p=t.type,_=Pu(p),m=t.count,y=Lf(o,t);i=new Array(m);let b=Oe(t.byteOffset,0),x=a.byteOffset+b;for(let T=0;T<m;T++){let C=K.createArrayBufferView(d,f.buffer,f.byteOffset+x,_);p==="SCALAR"?i[T]=C[0]:p==="VEC3"?i[T]=h.fromArray(C):p==="VEC4"&&(i[T]=Pe.unpack(C)),x+=y}l(e.cacheKey)&&(aIe[n]=i)}return i};var cIe={};function dMt(e,t,n){return`${e.cacheKey}//${t}/${n}`}function sI(e){this._spline=e,this._lastTimeIndex=0}sI.prototype.findTimeInterval=Qi.prototype.findTimeInterval;sI.prototype.evaluate=function(e,t){let n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),i=this._spline.times,o=e>=i[n+1]?i[n+1]:i[n];return this._spline.evaluate(o,t)};Object.defineProperties(sI.prototype,{times:{get:function(){return this._spline.times}}});sI.prototype.wrapTime=function(e){return this._spline.wrapTime(e)};sI.prototype.clampTime=function(e){return this._spline.clampTime(e)};L6.getAnimationSpline=function(e,t,n,i,o,r,s,a){let c=dMt(e,t,i),u=cIe[c];if(!l(u)){let f=r,d=a;f.length===1&&d.length===1?u=new K_(d[0]):(o.interpolation==="LINEAR"||o.interpolation==="STEP")&&(s==="translation"||s==="scale"?u=new cd({times:f,points:d}):s==="rotation"?u=new $_({times:f,points:d}):s==="weights"&&(u=new uB({times:f,weights:d})),l(u)&&o.interpolation==="STEP"&&(u=new sI(u))),l(e.cacheKey)&&(cIe[c]=u)}return u};var lIe={};L6.getSkinInverseBindMatrices=function(e,t){let n=uIe(e,t),i=lIe[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,s=o.bufferViews,a=t.bufferView,c=s[a],u=c.buffer,d=r[u].extras._pipeline.source,p=t.componentType,_=t.type,m=t.count,y=Lf(o,t),b=c.byteOffset+t.byteOffset,x=Pu(_);if(i=new Array(m),p===q.FLOAT&&_===LA.MAT4)for(let T=0;T<m;++T){let C=K.createArrayBufferView(p,d.buffer,d.byteOffset+b,x);i[T]=M.fromArray(C),b+=y}lIe[n]=i}return i};var zU=L6;var hMt={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},NA=Object.freeze(hMt);var mMt={STOPPED:0,ANIMATING:1},Nb=Object.freeze(mMt);var pMt={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},fIe=Object.freeze(pMt);var gr={};function _Mt(){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 gMt(){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 yMt(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function bMt(){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 xMt(){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 TMt(){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 CMt(){this.attributes=[]}function AMt(){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 EMt(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function SMt(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function vMt(){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 wMt(){this.nodes=[]}var IMt={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function PMt(){this.input=[],this.interpolation=void 0,this.output=[]}function DMt(){this.node=void 0,this.path=void 0}function RMt(){this.sampler=void 0,this.target=void 0}function OMt(){this.name=void 0,this.samplers=[],this.channels=[]}function MMt(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function LMt(){this.name=void 0,this.stages=[]}function dIe(){this.credits=[]}function NMt(){this.asset=new dIe,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=M.clone(M.IDENTITY)}function FMt(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.channels=void 0}function Fb(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(Fb.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Fb.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Fb.DEFAULT_ROUGHNESS_FACTOR}Fb.DEFAULT_BASE_COLOR_FACTOR=ie.ONE;Fb.DEFAULT_METALLIC_FACTOR=1;Fb.DEFAULT_ROUGHNESS_FACTOR=1;function FA(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(FA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(FA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=FA.DEFAULT_GLOSSINESS_FACTOR}FA.DEFAULT_DIFFUSE_FACTOR=ie.ONE;FA.DEFAULT_SPECULAR_FACTOR=h.ONE;FA.DEFAULT_GLOSSINESS_FACTOR=1;function Wee(){this.metallicRoughness=new Fb,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(Wee.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=fIe.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}Wee.DEFAULT_EMISSIVE_FACTOR=h.ZERO;gr.Quantization=_Mt;gr.Attribute=gMt;gr.Indices=yMt;gr.FeatureIdAttribute=bMt;gr.FeatureIdTexture=TMt;gr.FeatureIdImplicitRange=xMt;gr.MorphTarget=CMt;gr.Primitive=AMt;gr.Instances=EMt;gr.Skin=SMt;gr.Node=vMt;gr.Scene=wMt;gr.AnimatedPropertyType=Object.freeze(IMt);gr.AnimationSampler=PMt;gr.AnimationTarget=DMt;gr.AnimationChannel=RMt;gr.Animation=OMt;gr.ArticulationStage=MMt;gr.Articulation=LMt;gr.Asset=dIe;gr.Components=NMt;gr.TextureReader=FMt;gr.MetallicRoughness=Fb;gr.SpecularGlossiness=FA;gr.Material=Wee;var hIe=gr;var BA=hIe.AnimatedPropertyType;function Yee(e){e=Oe(e,Oe.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,UMt(this)}Object.defineProperties(Yee.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 BMt(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 $m({times:e,points:n,inTangents:i,outTangents:o})}function mIe(e,t,n,i){if(e.length===1&&t.length===1)return new K_(t[0]);switch(n){case Fc.STEP:return new yT({times:e,points:t});case Fc.CUBICSPLINE:return BMt(e,t);case Fc.LINEAR:return i===BA.ROTATION?new $_({times:e,points:t}):new cd({times:e,points:t})}}function kMt(e,t,n,i,o){let r=[];if(i===BA.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===Fc.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(mIe(e,f,n,i))}}else r.push(mIe(e,t,n,i));return r}var qee;function UMt(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=kMt(i,o,r,a,u);switch(e._splines=f,e._path=a,a){case BA.TRANSLATION:case BA.SCALE:qee=new h;break;case BA.ROTATION:qee=new Pe;break;case BA.WEIGHTS:break}}Yee.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===BA.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);o[n]=r.evaluate(s,qee)}}};var pIe=Yee;function Xee(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=$.clone(n.startTime),this._delay=Oe(n.delay,0),this._stopTime=$.clone(n.stopTime),this.removeOnStop=Oe(n.removeOnStop,!1),this._multiplier=Oe(n.multiplier,1),this._reverse=Oe(n.reverse,!1),this._loop=Oe(n.loop,NA.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=Nb.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,zMt(this)}Object.defineProperties(Xee.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 zMt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],_=new pIe({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}Xee.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var _Ie=Xee;function yy(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(yy.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function Kee(e,t,n){let i=e._model,o=new _Ie(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}yy.prototype.add=function(e){e=Oe(e,Oe.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return Kee(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 Kee(this,n[i],e)};yy.prototype.addAll=function(e){e=Oe(e,Oe.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=Kee(this,n[r],e);i.push(s)}return i};yy.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};yy.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])};yy.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};yy.prototype.get=function(e){return this._runtimeAnimations[e]};var N6=[];function VMt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}yy.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&$.equals(e.time,this._previousTime))return!1;this._previousTime=$.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=$.addSeconds(Oe(a.startTime,o),a.delay,new $)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=$.lessThanOrEquals(c,o),p=l(f)&&$.greaterThan(o,f),_=0;if(u!==0){let b=$.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===NA.REPEAT||a.loop===NA.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let b=a._state===Nb.STOPPED;if(y!==b)continue}if(a._prevAnimationDelta=_,y||a._state===Nb.ANIMATING){if(y&&a._state===Nb.STOPPED&&(a._state=Nb.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===NA.REPEAT)_=_-Math.floor(_);else if(a.loop===NA.MIRRORED_REPEAT){let x=Math.floor(_),T=_-x;_=x%2===1?1-T:T}a.reverse&&(_=1-_);let b=_*u*a.multiplier;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Nb.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&N6.push(a))}}n=N6.length;for(let s=0;s<n;++s){let a=N6[s];t.splice(t.indexOf(a),1),e.afterRender.push(VMt(this,r,a))}return N6.length=0,i};var gIe=yy;function by(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new Cl,this.indexBuffersToCreate=new Cl,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new Cl,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new Cl,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new Cl,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new Cl,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function HMt(e,t,n){return e.subarray(t,t+n)}by.prototype.getBuffer=function(e){return HMt(this.buffers[e.buffer],e.byteOffset,e.byteLength)};by.prototype.finishedPendingBufferLoads=function(){return this.pendingBufferLoads===0};by.prototype.finishedBuffersCreation=function(){return this.pendingBufferLoads===0&&this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0};by.prototype.finishedProgramCreation=function(){return this.pendingShaderLoads===0&&this.programsToCreate.length===0};by.prototype.finishedTextureCreation=function(){let e=this.pendingTextureLoads===0,t=this.texturesToCreate.length===0&&this.texturesToCreateFromBufferView.length===0;return e&&t};by.prototype.finishedEverythingButTextureCreation=function(){let e=this.pendingBufferLoads===0&&this.pendingShaderLoads===0,t=this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0&&this.programsToCreate.length===0&&this.pendingBufferViewToImage===0;return this.finishedDecoding()&&e&&t};by.prototype.finishedDecoding=function(){return this.primitivesToDecode.length===0&&this.activeDecodingTasks===0&&!this.pendingDecodingCache};by.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var yIe=by;function F6(e,t,n){this._name=t.name,this._id=n,this._uniformMap=e._uniformMaps[n],this._technique=void 0,this._program=void 0,this._values=void 0}Object.defineProperties(F6.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}});F6.prototype.setValue=function(e,t){let n=`u_${e}`,i=this._uniformMap.values[n];i.value=i.clone(t,i.value)};F6.prototype.getValue=function(e){let t=`u_${e}`,n=this._uniformMap.values[t];if(l(n))return n.value};var bIe=F6;function xIe(e,t,n){let i=[],o=e.primitives,r=o.length;for(let s=0;s<r;++s){let a=o[s];i[s]=t[a.material]}this._name=e.name,this._materials=i,this._id=n}Object.defineProperties(xIe.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}});var TIe=xIe;function $ee(e,t,n,i,o){this._model=e,this._runtimeNode=n,this._name=t.name,this._id=i,this.useMatrix=!1,this._show=!0,this._matrix=M.clone(o),this._originalMatrix=M.clone(o)}Object.defineProperties($ee.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=M.clone(e,this._matrix),this.useMatrix=!0;let t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}});$ee.prototype.setMatrix=function(e){M.clone(e,this._matrix)};var CIe=$ee;var GMt=65534;function VU(){}VU.hasExtension=function(e){return l(e.extensionsRequired.CESIUM_primitive_outline)||l(e.extensionsUsed.CESIUM_primitive_outline)};VU.outlinePrimitives=function(e){if(!VU.hasExtension(e))return;let t=e.gltfInternal,n=[];Ce.mesh(t,function(i,o){Ce.meshPrimitive(i,function(r,s){if(!l(r.extensions))return;let a=r.extensions.CESIUM_primitive_outline;if(!l(a))return;let c=XMt(e,r);c!==void 0&&(n.indexOf(c)<0&&n.push(c),jMt(e,o,s,a.indices,c))})});for(let i=0;i<n.length;++i)WMt(e,n[i].bufferViews);qMt(e)};VU.createTexture=function(e,t){let n=t.cache.modelOutliningCache;if(l(n)||(n=t.cache.modelOutliningCache={}),l(n.outlineTexture))return n.outlineTexture;let i=Math.min(4096,Lt.maximumTextureSize),o=i,r=EIe(o),s=[];for(;o>1;)o>>=1,s.push(EIe(o));let a=new dt({context:t,source:{arrayBufferView:r,mipLevels:s},width:i,height:1,pixelFormat:je.LUMINANCE,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:Kn.LINEAR})});return n.outlineTexture=a,a};function jMt(e,t,n,i,o){let r=o.vertexCopies,s=o.extraVertices,a=o.outlineCoordinates,c=e.gltfInternal,f=c.meshes[t].primitives[n],d=c.accessors,p=c.bufferViews,_;for(let L in f.attributes)if(f.attributes.hasOwnProperty(L)){let g=f.attributes[L],E=d[g];if(l(E)){_=E.count;break}}if(!l(_))return;let m=d[f.indices],y=p[m.bufferView],b=d[i],x=p[b.bufferView],T=e._loadResources,C=T.getBuffer(y),A=T.getBuffer(x),S=m.componentType===5123?new Uint16Array(C.buffer,C.byteOffset+m.byteOffset,m.count):new Uint32Array(C.buffer,C.byteOffset+m.byteOffset,m.count),w=b.componentType===5123?new Uint16Array(A.buffer,A.byteOffset+b.byteOffset,b.count):new Uint32Array(A.buffer,A.byteOffset+b.byteOffset,b.count),R=_,P=[R],O;for(O=0;O<w.length;O+=2){let L=w[O],g=w[O+1],E=Math.min(L,g),v=Math.max(L,g);P[E*R+v]=1}for(O=0;O<S.length;O+=3){let L=S[O],g=S[O+1],E=S[O+2],v=!1,I=v||Jee(P,L,g),N=v||Jee(P,g,E),F=v||Jee(P,E,L),U=AIe(a,L,g,E,I,N,F);for(;U>=0;){let k;if(U===L?k=r[L]:U===g?k=r[g]:k=r[E],k===void 0){k=_+s.length;let z=U;for(;z>=_;)z=s[z-_];s.push(z),r[U]=k}k>GMt&&S instanceof Uint16Array&&(S=new Uint32Array(S),m.componentType=5125,y.buffer=c.buffers.push({byteLength:S.byteLength,extras:{_pipeline:{source:S.buffer}}})-1,y.byteLength=S.byteLength,y.byteOffset=0,e._loadResources.buffers[y.buffer]=new Uint8Array(S.buffer,0,S.byteLength),T.indexBuffersToCreate._array.forEach(function(z){l(z)&&z.id===m.bufferView&&(z.componentType=m.componentType)})),U===L?(L=k,S[O]=k):U===g?(g=k,S[O+1]=k):(E=k,S[O+2]=k),l(m.max)&&(m.max[0]=Math.max(m.max[0],k)),U=AIe(a,L,g,E,I,N,F)}}}function Zee(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return s===void 0?63:((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)}function Qee(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function AIe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=Zee(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,_=r?1:0,m=Zee(e,n,d,p,_);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,T=Zee(e,i,y,b,x);if(T===0)return i;let C=f&m&T,A,S,w;if(C&1)A=0,S=1,w=2;else if(C&2)A=0,w=1,S=2;else if(C&4)S=0,A=1,w=2;else if(C&8)S=0,w=1,A=2;else if(C&16)w=0,A=1,S=2;else if(C&32)w=0,S=1,A=2;else{let L=Qee(f),g=Qee(m),E=Qee(T);return L<g&&L<E?t:g<E?n:i}let R=t*3;e[R+A]=a,e[R+S]=c,e[R+w]=u;let P=n*3;e[P+A]=d,e[P+S]=p,e[P+w]=_;let O=i*3;return e[O+A]=y,e[O+S]=b,e[O+w]=x,-1}function Jee(e,t,n){let i=e[0],o=Math.min(t,n)*i+Math.max(t,n);return e[o]===1}function EIe(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 WMt(e,t){let n=e.gltfInternal,i=e._loadResources,o,r;for(o=0;o<t.length;++o){let s=t[o],a=s.extras._pipeline.vertexNumberingScope;s.extras._pipeline.vertexNumberingScope=void 0;let c=a.extraVertices,u=i.getBuffer(s),f=s.byteStride||4,d=c.length,p=new Uint8Array(u.byteLength+d*f);for(p.set(u),r=0;r<d;++r){let y=c[r]*f,b=u.length+r*f;for(let x=0;x<f;++x)p[b+x]=p[y+x]}s.byteOffset=0,s.byteLength=p.byteLength;let _=n.buffers.push({byteLength:p.byteLength,extras:{_pipeline:{source:p.buffer}}})-1;s.buffer=_,i.buffers[_]=p;let m=a.accessors;for(r=0;r<m.length;++r){let y=m[r];n.accessors[y].count+=d}if(!a.createdOutlines){let y=a.outlineCoordinates,b=new Float32Array(y),x=e.gltfInternal.buffers.push({byteLength:b.byteLength,extras:{_pipeline:{source:b.buffer}}})-1;i.buffers[x]=new Uint8Array(b.buffer,0,b.byteLength);let T=e.gltfInternal.bufferViews.push({buffer:x,byteLength:b.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,C=e.gltfInternal.accessors.push({bufferView:T,byteOffset:0,componentType:5126,count:b.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,A=a.primitives;for(r=0;r<A.length;++r)A[r].attributes._OUTLINE_COORDINATES=C;i.vertexBuffersToCreate.enqueue(T),a.createdOutlines=!0}}}function qMt(e){let t=e.gltfInternal,n=e._loadResources,i;for(i=0;i<t.buffers.length;++i){let o=t.buffers[i],r=t.bufferViews.filter(YMt.bind(void 0,i)),s=r.reduce(function(u,f){return u+f.byteLength},0);if(s===o.byteLength)continue;let a=new Uint8Array(s),c=0;for(let u=0;u<r.length;++u){let f=r[u],d=n.getBuffer(f);a.set(d,c),f.byteOffset=c,c+=d.byteLength}n.buffers[i]=a,o.extras._pipeline.source=a.buffer,o.byteLength=s}}function YMt(e,t){return t.buffer===e}function XMt(e,t){let n=t.attributes;if(n===void 0)return;let i=e.gltfInternal,o;for(let r in n){if(!n.hasOwnProperty(r))continue;let s=n[r],c=i.accessors[s].bufferView,u=i.bufferViews[c];if(l(u.extras)||(u.extras={}),l(u.extras._pipeline)||(u.extras._pipeline={}),!l(u.extras._pipeline.vertexNumberingScope))u.extras._pipeline.vertexNumberingScope=o||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};else if(o!==void 0&&u.extras._pipeline.vertexNumberingScope!==o)return;o=u.extras._pipeline.vertexNumberingScope,o.bufferViews.indexOf(u)<0&&o.bufferViews.push(u),o.accessors.indexOf(s)<0&&o.accessors.push(s)}return o.primitives.push(t),o}var ete=VU;var Xi={};Xi.updateForwardAxis=function(e){let t=e.gltfInternal.extras.sourceVersion;(l(t)&&t!=="2.0"||Xi.getAssetVersion(e.gltfInternal)!=="2.0")&&(e._gltfForwardAxis=dc.X)};Xi.getAssetVersion=function(e){return!l(e.asset)||!l(e.asset.version)?"1.0":e.asset.version};Xi.splitIncompatibleMaterials=function(e){let t=e.accessors,n=e.materials,i={};return Ce.mesh(e,function(o){Ce.meshPrimitive(o,function(r){let s=r.material,a=n[s],c=r.attributes.JOINTS_0,u,f;if(l(c)){let A=t[c];u=A.componentType,f=A.type}let d=l(c)&&f==="VEC4",p=l(r.attributes.COLOR_0),_=l(r.targets),m=l(r.attributes.NORMAL),y=l(r.attributes.TANGENT),b=l(r.attributes.TEXCOORD_0),x=b&&l(r.attributes.TEXCOORD_1),T=l(r.extensions)&&l(r.extensions.CESIUM_primitive_outline),C=i[s];if(!l(C))i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:_,hasNormals:m,hasTangents:y,hasTexCoords:b,hasTexCoord1:x,hasOutline:T};else if(C.skinning.skinned!==d||C.hasVertexColors!==p||C.hasMorphTargets!==_||C.hasNormals!==m||C.hasTangents!==y||C.hasTexCoords!==b||C.hasTexCoord1!==x||C.hasOutline!==T){let A=Fe(a,!0);s=Fo(n,A),r.material=s,i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:_,hasNormals:m,hasTangents:y,hasTexCoords:b,hasTexCoord1:x,hasOutline:T}}})}),i};Xi.getShaderVariable=function(e){return e==="SCALAR"?"float":e.toLowerCase()};Xi.ModelState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};Xi.getFailedLoadFunction=function(e,t,n){return function(i){e._state=Xi.ModelState.FAILED;let o=`Failed to load ${t}: ${n}`;l(i)&&(o+=` -${i.message}`),e._readyPromise.reject(new se(o))}};Xi.parseBuffers=function(e,t){let n=e._loadResources;Ce.buffer(e.gltfInternal,function(i,o){if(l(i.extras._pipeline.source))n.buffers[o]=i.extras._pipeline.source;else if(l(t)){let r=e._resource.getDerivedResource({url:i.uri});++n.pendingBufferLoads,r.fetchArrayBuffer().then(t(e,o)).catch(Xi.getFailedLoadFunction(e,"buffer",r.url))}})};var KMt=new h,$Mt=new h;Xi.computeBoundingSphere=function(e){let t=e.gltfInternal,n=t.nodes,i=t.meshes,o=t.scenes[t.scene].nodes,r=o.length,s=[],a=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let f=0;f<r;++f){let d=n[o[f]];for(d._transformToRoot=Xi.getTransform(d),s.push(d);s.length>0;){d=s.pop();let p=d._transformToRoot,_=d.mesh;if(l(_)){let b=i[_].primitives,x=b.length;for(let T=0;T<x;++T){let C=b[T].attributes.POSITION;if(l(C)){let A=Xi.getAccessorMinMax(t,C);if(l(A.min)&&l(A.max)){let S=h.fromArray(A.min,0,KMt),w=h.fromArray(A.max,0,$Mt);M.multiplyByPoint(p,S,S),M.multiplyByPoint(p,w,w),h.minimumByComponent(a,S,a),h.maximumByComponent(c,w,c)}}}}let m=d.children;if(l(m)){let y=m.length;for(let b=0;b<y;++b){let x=n[m[b]];x._transformToRoot=Xi.getTransform(x),M.multiplyTransformation(p,x._transformToRoot,x._transformToRoot),s.push(x)}}delete d._transformToRoot}}let u=re.fromCornerPoints(a,c);return e.forwardAxis===dc.Z&&re.transformWithoutScale(u,dc.Z_UP_TO_X_UP,u),e._upAxis===dc.Y?re.transformWithoutScale(u,dc.Y_UP_TO_Z_UP,u):e._upAxis===dc.X&&re.transformWithoutScale(u,dc.X_UP_TO_Z_UP,u),u};function ZMt(e,t){return Ce.techniqueAttribute(e,function(n,i){if(n.semantic===t)return i})}function QMt(e,t){let n=e.accessors,i=e.materials,o=e.extensions.KHR_techniques_webgl,r=o.techniques,s=o.programs,a=o.shaders,c=t.targets,u=t.attributes;for(let m in c)if(c.hasOwnProperty(m)){let y=c[m];for(let b in y)b!=="extras"&&(u[`${b}_${m}`]=y[b])}let f=i[t.material],d=r[f.extensions.KHR_techniques_webgl.technique],p=s[d.program],_=a[p.vertexShader];for(let m in u)if(u.hasOwnProperty(m)&&!l(ZMt(d,m))){let y=u[m],b=n[y],x=m.toLowerCase();x.charAt(0)==="_"&&(x=x.slice(1));let T=`a_${x}`;d.attributes[T]={semantic:m,type:b.componentType};let C=_.extras._pipeline,A=C.source;A=`attribute ${Xi.getShaderVariable(b.type)} ${T}; -${A}`,C.source=A}}Xi.ensureSemanticExistence=function(e){return Ce.mesh(e,function(t){Ce.meshPrimitive(t,function(n){QMt(e,n)})}),e};Xi.createAttributeLocations=function(e,t){let n={},i=!1,o=1;if(Ce.techniqueAttribute(e,function(r,s){/pos/i.test(s)&&!i?(n[s]=0,i=!0):n[s]=o++}),l(t))for(let r in t)t.hasOwnProperty(r)&&(n[r]=o++);return n};Xi.getAccessorMinMax=function(e,t){let n=e.accessors[t],i=n.extensions,o=n.min,r=n.max;if(l(i)){let s=i.WEB3D_quantized_attributes;l(s)&&(o=s.decodedMin,r=s.decodedMax)}return{min:o,max:r}};function SIe(e,t,n,i){return Co(e,"KHR_techniques_webgl")?function(o,r){if(o.semantic===n&&(!i||!l(o.node)))return r}:function(o,r){let s=t.parameters[o];if(s.semantic===n&&(!i||!l(s.node)))return r}}Xi.getAttributeOrUniformBySemantic=function(e,t,n,i){return Ce.technique(e,function(o){if(l(n)&&o.program!==n)return;let r=Ce.techniqueAttribute(o,SIe(e,o,t,i));return l(r)?r:Ce.techniqueUniform(o,SIe(e,o,t,i))})};Xi.getDiffuseAttributeOrUniform=function(e,t){let n=Xi.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return l(n)||(n=Xi.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),n};var JMt=new h,eLt=new Pe,tLt=new h;Xi.getTransform=function(e,t){return l(e.matrix)?M.fromColumnMajorArray(e.matrix,t):M.fromTranslationQuaternionRotationScale(h.fromArray(e.translation,0,JMt),Pe.unpack(e.rotation,0,eLt),h.fromArray(e.scale,0,tLt),t)};Xi.getUsedExtensions=function(e){let t=e.extensionsUsed,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};Xi.getRequiredExtensions=function(e){let t=e.extensionsRequired,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};Xi.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_texture_basisu:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Xi.checkSupportedExtensions=function(e,t){for(let n in e)if(e.hasOwnProperty(n)){if(!Xi.supportedExtensions[n])throw new se(`Unsupported glTF Extension: ${n}`);if(n==="EXT_texture_webp"&&t===!1)throw new se("Loaded model requires WebP but browser does not support it.")}};Xi.checkSupportedGlExtensions=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(o!=="OES_element_index_uint")throw new se(`Unsupported WebGL Extension: ${o}`);if(!t.elementIndexUint)throw new se("OES_element_index_uint WebGL extension is not enabled.")}}};function tte(e,t,n){t+="(?!\\w)",t=new RegExp(t,"g");let i=e.search(t);return e.replace(t,function(o,r){return i===r?o:n})}function nLt(e,t){let i=e.accessors[t].extensions;if(l(i))return i.WEB3D_quantized_attributes}function vIe(e,t,n){let i=t.material,o=e.materials[i];if(!Co(e,"KHR_techniques_webgl")||!l(o.extensions)||!l(o.extensions.KHR_techniques_webgl))return;let r=o.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[r];return Ce.techniqueAttribute(a,function(c,u){if(c.semantic===n)return u})}Xi.modifyShaderForDracoQuantizedAttributes=function(e,t,n,i){let o={};for(let r in i)if(i.hasOwnProperty(r)){let s=i[r],a=s.quantization;if(!l(a))continue;let c=vIe(e,t,r);r.charAt(0)==="_"&&(r=r.substring(1));let u=`gltf_u_dec_${r.toLowerCase()}`;if(!l(o[u])){let f=`gltf_decoded_${r}`,d=c.replace("a_","gltf_a_dec_"),p=s.componentsPerAttribute;n=tte(n,c,d);let _;a.octEncoded?_="vec3":p>1?_=`vec${p}`:_="float",n=`${_} ${d}; -${n}`;let m=p===3&&r==="COLOR_0";m&&(n=tte(n,d,`vec4(${d}, 1.0)`));let y="";if(a.octEncoded){let b=`${u}_rangeConstant`;n=`uniform float ${b}; -${n}`,y=` -void main() { - ${d} = czm_octDecode(${c}.xy, ${b}).zxy; - ${f}(); -} -`}else{let b=`${u}_normConstant`,x=`${u}_min`;n=`uniform float ${b}; -uniform ${_} ${x}; -${n}`,y=` -void main() { - ${d} = ${x} + ${c}${m?".xyz":""} * ${b}; - ${f}(); -} -`}n=Be.replaceMain(n,f),n+=y}}return{shader:n}};Xi.modifyShaderForQuantizedAttributes=function(e,t,n){let i={},o=t.attributes;for(let r in o)if(o.hasOwnProperty(r)){let s=vIe(e,t,r),a=t.attributes[r];r.charAt(0)==="_"&&(r=r.substring(1));let c=`gltf_u_dec_${r.toLowerCase()}`,u=`${c}_scale`,f=`${c}_translate`;if(!l(i[c])&&!l(i[u])){let d=nLt(e,a);if(l(d)){let p=d.decodeMatrix,_=`gltf_decoded_${r}`,m=s.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(p.length));n=tte(n,s,m);let b;y>2?b=`vec${y-1}`:b="float",n=`${b} ${m}; -${n}`;let x="";y===5?(n=`uniform mat4 ${u}; -${n}`,n=`uniform vec4 ${f}; -${n}`,x=` -void main() { - ${m} = ${u} * ${s} + ${f}; - ${_}(); -} -`,i[u]={mat:4},i[f]={vec:4}):(n=`uniform mat${y} ${c}; -${n}`,x=` -void main() { - ${m} = ${b}(${c} * vec${y}(${s},1.0)); - ${_}(); -} -`,i[c]={mat:y}),n=Be.replaceMain(n,_),n+=x}}}return{shader:n,uniforms:i}};function cI(e){let t={value:e,clone:function(n,i){return n},func:function(){return t.value}};return t}function k6(e){let t={value:V.fromArray(e),clone:V.clone,func:function(){return t.value}};return t}function U6(e){let t={value:h.fromArray(e),clone:h.clone,func:function(){return t.value}};return t}function lI(e){let t={value:ie.fromArray(e),clone:ie.clone,func:function(){return t.value}};return t}function nte(e){let t={value:ei.fromColumnMajorArray(e),clone:ei.clone,func:function(){return t.value}};return t}function ite(e){let t={value:Z.fromColumnMajorArray(e),clone:Z.clone,func:function(){return t.value}};return t}function B6(e){let t={value:M.fromColumnMajorArray(e),clone:M.clone,func:function(){return t.value}};return t}function z6(e,t,n){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=n}Object.defineProperties(z6.prototype,{value:{get:function(){if(!l(this._value)){let e=this._textures[this._textureId];if(l(e))this._value=e;else return this._defaultTexture}return this._value},set:function(e){this._value=e}}});z6.prototype.clone=function(e){return e};z6.prototype.func=void 0;function iLt(e,t,n){let i=new z6(e,t,n);return i.func=function(){return i.value},i}var hc={};hc[q.FLOAT]=cI;hc[q.FLOAT_VEC2]=k6;hc[q.FLOAT_VEC3]=U6;hc[q.FLOAT_VEC4]=lI;hc[q.INT]=cI;hc[q.INT_VEC2]=k6;hc[q.INT_VEC3]=U6;hc[q.INT_VEC4]=lI;hc[q.BOOL]=cI;hc[q.BOOL_VEC2]=k6;hc[q.BOOL_VEC3]=U6;hc[q.BOOL_VEC4]=lI;hc[q.FLOAT_MAT2]=nte;hc[q.FLOAT_MAT3]=ite;hc[q.FLOAT_MAT4]=B6;hc[q.SAMPLER_2D]=iLt;Xi.createUniformFunction=function(e,t,n,i){return hc[e](t,n,i)};function oLt(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function rLt(e){return[e[20],e[21],e[22],e[23]]}Xi.createUniformsForDracoQuantizedAttributes=function(e){let t={};for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.quantization;if(!l(o))continue;n.charAt(0)==="_"&&(n=n.substring(1));let r=`gltf_u_dec_${n.toLowerCase()}`;if(o.octEncoded){let u=`${r}_rangeConstant`,f=(1<<o.quantizationBits)-1;t[u]=cI(f).func;continue}let s=`${r}_normConstant`,a=o.range/(1<<o.quantizationBits);t[s]=cI(a).func;let c=`${r}_min`;switch(i.componentsPerAttribute){case 1:t[c]=cI(o.minValues).func;break;case 2:t[c]=k6(o.minValues).func;break;case 3:t[c]=U6(o.minValues).func;break;case 4:t[c]=lI(o.minValues).func;break}}return t};Xi.createUniformsForQuantizedAttributes=function(e,t,n){let i=e.accessors,o={},r={},s=t.attributes;for(let a in s)if(s.hasOwnProperty(a)){let c=s[a],u=i[c],f=u.extensions;if(a.charAt(0)==="_"&&(a=a.substring(1)),l(f)){let d=f.WEB3D_quantized_attributes;if(l(d)){let p=d.decodeMatrix,_=`gltf_u_dec_${a.toLowerCase()}`,m,y;switch(u.type){case LA.SCALAR:r[_]=nte(p).func,o[_]=!0;break;case LA.VEC2:r[_]=ite(p).func,o[_]=!0;break;case LA.VEC3:r[_]=B6(p).func,o[_]=!0;break;case LA.VEC4:m=`${_}_scale`,y=`${_}_translate`,r[m]=B6(oLt(p)).func,r[y]=lI(rLt(p)).func,o[m]=!0,o[y]=!0;break}}}}for(let a in n)if(n.hasOwnProperty(a)&&!o[a]){let c=n[a];l(c.mat)&&(c.mat===2?r[a]=nte(ei.IDENTITY).func:c.mat===3?r[a]=ite(Z.IDENTITY).func:c.mat===4&&(r[a]=B6(M.IDENTITY).func)),l(c.vec)&&c.vec===4&&(r[a]=lI([0,0,0,0]).func)}return r};var aI=new h,sLt={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){let n=new M;return function(){return l(t._rtcCenter)?(M.getTranslation(e.model,aI),h.add(aI,t._rtcCenter,aI),M.multiplyByPoint(e.view,aI,aI),M.setTranslation(e.modelView,aI,n)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};Xi.getGltfSemanticUniforms=function(){return sLt};var wi=Xi;function aLt(e,t){if(t=Oe(t,Oe.EMPTY_OBJECT),!l(e)||!Co(e,"KHR_materials_common"))return;Co(e,"KHR_techniques_webgl")||(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));let n=e.extensions.KHR_techniques_webgl;fLt(e);let i=cLt(e),o=wi.splitIncompatibleMaterials(e),r={},s=!1;return Ce.material(e,function(a,c){if(l(a.extensions)&&l(a.extensions.KHR_materials_common)){let u=a.extensions.KHR_materials_common,f=o[c],d=uLt(u,f),p=r[d];l(p)||(p=lLt(e,n,f,u,i,t.addBatchIdToGeneratedShaders),r[d]=p,s=!0);let _={},m=u.values,y;for(let b in m)m.hasOwnProperty(b)&&b!=="transparent"&&b!=="doubleSided"&&(y=`u_${b.toLowerCase()}`,_[y]=m[b]);a.extensions.KHR_techniques_webgl={technique:p,values:_},a.alphaMode="OPAQUE",u.transparent&&(a.alphaMode="BLEND"),u.doubleSided&&(a.doubleSided=!0)}}),s&&wi.ensureSemanticExistence(e),e}function cLt(e){let t={},n;if(l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(n=e.extensions.KHR_materials_common.lights),l(n)){let i=e.nodes;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r];if(l(s.extensions)&&l(s.extensions.KHR_materials_common)){let a=s.extensions.KHR_materials_common.light;l(a)&&l(n[a])&&(n[a].node=r),delete s.extensions.KHR_materials_common}}let o=0;for(let r in n)if(n.hasOwnProperty(r)){let s=n[r],a=s.type;if(a!=="ambient"&&!l(s.node)){delete n[r];continue}let c=`light${o.toString()}`;s.baseName=c;let u,f,d,p;switch(a){case"ambient":u=s.ambient,t[`${c}Color`]={type:q.FLOAT_VEC3,value:u.color};break;case"directional":f=s.directional,t[`${c}Color`]={type:q.FLOAT_VEC3,value:f.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4});break;case"point":d=s.point,t[`${c}Color`]={type:q.FLOAT_VEC3,value:d.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4}),t[`${c}Attenuation`]={type:q.FLOAT_VEC3,value:[d.constantAttenuation,d.linearAttenuation,d.quadraticAttenuation]};break;case"spot":p=s.spot,t[`${c}Color`]={type:q.FLOAT_VEC3,value:p.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4},t[`${c}InverseTransform`]={node:s.node,semantic:"MODELVIEWINVERSE",type:q.FLOAT_MAT4,useInFragment:!0}),t[`${c}Attenuation`]={type:q.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]},t[`${c}FallOff`]={type:q.FLOAT_VEC2,value:[p.fallOffAngle,p.fallOffExponent]};break}++o}}return t}function lLt(e,t,n,i,o,r){l(i)||(i={}),r=Oe(r,!1);let s=t.techniques,a=t.shaders,c=t.programs,u=i.technique.toUpperCase(),f;l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(f=e.extensions.KHR_materials_common.lights);let d=i.values,p=Oe(i.jointCount,0),_,m=!1,y=!1;l(n)&&(_=n.skinning,m=_.skinned,y=n.hasVertexColors);let b=`precision highp float; -`,x=`precision highp float; -`,T=u!=="CONSTANT",C={u_modelViewMatrix:{semantic:Co(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:q.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:q.FLOAT_MAT4}};T&&(C.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:q.FLOAT_MAT3}),m&&(C.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:q.FLOAT_MAT4});let A,S=!1;for(let z in d)if(d.hasOwnProperty(z)&&z!=="transparent"&&z!=="doubleSided"){let B=wIe(z,d[z]);A=`u_${z.toLowerCase()}`,!S&&B===q.SAMPLER_2D&&(S=!0),C[A]={type:B}}if(l(C.u_diffuse)&&(C.u_diffuse.semantic="_3DTILESDIFFUSE"),l(o))for(let z in o)o.hasOwnProperty(z)&&(A=`u_${z}`,C[A]=o[z]);for(A in C)if(C.hasOwnProperty(A)){let z=C[A],B=l(z.count)?`[${z.count}]`:"";z.type!==q.FLOAT_MAT3&&z.type!==q.FLOAT_MAT4||z.useInFragment?(x+=`uniform ${$g(z.type)} ${A}${B}; -`,delete z.useInFragment):b+=`uniform ${$g(z.type)} ${A}${B}; -`}let w="";m&&(w+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let R={a_position:{semantic:"POSITION"}};b+=`attribute vec3 a_position; -`,b+=`out vec3 v_positionEC; -`,m?w+=` vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0); -`:w+=` vec4 pos = u_modelViewMatrix * vec4(a_position,1.0); -`,w+=` v_positionEC = pos.xyz; -`,w+=` gl_Position = u_projectionMatrix * pos; -`,x+=`in vec3 v_positionEC; -`,T&&(R.a_normal={semantic:"NORMAL"},b+=`attribute vec3 a_normal; -`,b+=`out vec3 v_normal; -`,m?w+=` v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal; -`:w+=` v_normal = u_normalMatrix * a_normal; -`,x+=`in vec3 v_normal; -`);let P;S&&(R.a_texcoord_0={semantic:"TEXCOORD_0"},P="v_texcoord_0",b+=`attribute vec2 a_texcoord_0; -`,b+=`out vec2 ${P}; -`,w+=` ${P} = a_texcoord_0; -`,x+=`in vec2 ${P}; -`),m&&(R.a_joint={semantic:"JOINTS_0"},R.a_weight={semantic:"WEIGHTS_0"},b+=`attribute vec4 a_joint; -`,b+=`attribute vec4 a_weight; -`),y&&(R.a_vertexColor={semantic:"COLOR_0"},b+=`attribute vec4 a_vertexColor; -`,b+=`out vec4 v_vertexColor; -`,w+=` v_vertexColor = a_vertexColor; -`,x+=`in vec4 v_vertexColor; -`),r&&(R.a_batchId={semantic:"_BATCHID"},b+=`attribute float a_batchId; -`);let O=T&&(u==="BLINN"||u==="PHONG")&&l(C.u_specular)&&l(C.u_shininess)&&C.u_shininess>0,L=!1,g=!1,E="";for(let z in f)if(f.hasOwnProperty(z)){let B=f[z],j=B.type.toLowerCase(),W=B.baseName;E+=` { -`;let J=`u_${W}Color`;if(j==="ambient")g=!0,E+=` ambientLight += ${J}; -`;else if(T){L=!0;let Y=`v_${W}Direction`,ee=`v_${W}Position`;j!=="point"&&(b+=`out vec3 ${Y}; -`,x+=`in vec3 ${Y}; -`,w+=` ${Y} = mat3(u_${W}Transform) * vec3(0.,0.,1.); -`,j==="directional"&&(E+=` vec3 l = normalize(${Y}); -`)),j!=="directional"?(b+=`out vec3 ${ee}; -`,x+=`in vec3 ${ee}; -`,w+=` ${ee} = u_${W}Transform[3].xyz; -`,E+=` vec3 VP = ${ee} - v_positionEC; -`,E+=` vec3 l = normalize(VP); -`,E+=` float range = length(VP); -`,E+=` float attenuation = 1.0 / (u_${W}Attenuation.x + `,E+=`(u_${W}Attenuation.y * range) + `,E+=`(u_${W}Attenuation.z * range * range)); -`):E+=` float attenuation = 1.0; -`,j==="spot"&&(E+=` float spotDot = dot(l, normalize(${Y})); -`,E+=` if (spotDot < cos(u_${W}FallOff.x * 0.5)) -`,E+=` { -`,E+=` attenuation = 0.0; -`,E+=` } -`,E+=` else -`,E+=` { -`,E+=` attenuation *= max(0.0, pow(spotDot, u_${W}FallOff.y)); -`,E+=` } -`),E+=` diffuseLight += ${J}* max(dot(normal,l), 0.) * attenuation; -`,O&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir); -`,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation; -`):(E+=` vec3 reflectDir = reflect(-l, normal); -`,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation; -`),E+=` specularLight += ${J} * specularIntensity; -`)}E+=` } -`}g||(E+=` ambientLight += vec3(0.2, 0.2, 0.2); -`),!L&&u!=="CONSTANT"&&(x+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,x+=`uniform vec3 gltf_lightColor; -`,x+=`#endif -`,E+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,E+=` vec3 lightColor = czm_lightColor; -`,E+=`#else -`,E+=` vec3 lightColor = gltf_lightColor; -`,E+=`#endif -`,E+=` vec3 l = normalize(czm_lightDirectionEC); -`,E+=` diffuseLight += lightColor * max(dot(normal,l), 0.2); -`,O&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir); -`,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)); -`):(E+=` vec3 reflectDir = reflect(-l, normal); -`,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)); -`),E+=` specularLight += lightColor * specularIntensity; -`)),b+=`void main(void) { -`,b+=w,b+=`} -`,x+=`void main(void) { -`;let v=` vec3 color = vec3(0.0, 0.0, 0.0); -`;T&&(x+=` vec3 normal = normalize(v_normal); -`,i.doubleSided&&(x+=` if (czm_backFacing()) -`,x+=` { -`,x+=` normal = -normal; -`,x+=` } -`));let I;u!=="CONSTANT"?(l(C.u_diffuse)&&(C.u_diffuse.type===q.SAMPLER_2D?x+=` vec4 diffuse = texture(u_diffuse, ${P}); -`:x+=` vec4 diffuse = u_diffuse; -`,x+=` vec3 diffuseLight = vec3(0.0, 0.0, 0.0); -`,v+=` color += diffuse.rgb * diffuseLight; -`),O&&(C.u_specular.type===q.SAMPLER_2D?x+=` vec3 specular = texture(u_specular, ${P}).rgb; -`:x+=` vec3 specular = u_specular.rgb; -`,x+=` vec3 specularLight = vec3(0.0, 0.0, 0.0); -`,v+=` color += specular * specularLight; -`),l(C.u_transparency)?I=` gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency); -`:I=` gl_FragColor = vec4(color * diffuse.a, diffuse.a); -`):l(C.u_transparency)?I=` gl_FragColor = vec4(color * u_transparency, u_transparency); -`:I=` gl_FragColor = vec4(color, 1.0); -`,y&&(v+=` color *= v_vertexColor.rgb; -`),l(C.u_emission)&&(C.u_emission.type===q.SAMPLER_2D?x+=` vec3 emission = texture(u_emission, ${P}).rgb; -`:x+=` vec3 emission = u_emission.rgb; -`,v+=` color += emission; -`),(l(C.u_ambient)||u!=="CONSTANT")&&(l(C.u_ambient)?C.u_ambient.type===q.SAMPLER_2D?x+=` vec3 ambient = texture(u_ambient, ${P}).rgb; -`:x+=` vec3 ambient = u_ambient.rgb; -`:x+=` vec3 ambient = diffuse.rgb; -`,v+=` color += ambient * ambientLight; -`),x+=` vec3 viewDir = -normalize(v_positionEC); -`,x+=` vec3 ambientLight = vec3(0.0, 0.0, 0.0); -`,x+=E,x+=v,x+=I,x+=`} -`;let N=Fo(a,{type:q.VERTEX_SHADER,extras:{_pipeline:{source:b,extension:".glsl"}}}),F=Fo(a,{type:q.FRAGMENT_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),U=Fo(c,{fragmentShader:F,vertexShader:N});return Fo(s,{attributes:R,program:U,uniforms:C})}function wIe(e,t){let n;switch(l(t.value)?n=t.value:l(t.index)?n=[t.index]:n=t,e){case"ambient":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"diffuse":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"emission":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"specular":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"shininess":return q.FLOAT;case"transparency":return q.FLOAT;case"transparent":return q.BOOL;case"doubleSided":return q.BOOL}}function uLt(e,t){let n="";n+=`technique:${e.technique};`;let i=e.values,o=Object.keys(i).sort(),r=o.length;for(let a=0;a<r;++a){let c=o[a];i.hasOwnProperty(c)&&(n+=`${c}:${wIe(c,i[c])}`,n+=";")}let s=Oe(e.jointCount,0);if(n+=`${s.toString()};`,l(t)){let a=t.skinning;s>0&&(n+=`${a.type};`),n+=t.hasVertexColors}return n}function fLt(e){let t=e.extensions.KHR_materials_common;if(!l(t)||!l(t.lights))return;let n=t.lights,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.type==="ambient"){l(r.ambient)||(r.ambient={});let s=r.ambient;l(s.color)||(s.color=[1,1,1])}else if(r.type==="directional"){l(r.directional)||(r.directional={});let s=r.directional;l(s.color)||(s.color=[1,1,1])}else if(r.type==="point"){l(r.point)||(r.point={});let s=r.point;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=Oe(s.constantAttenuation,1),s.linearAttenuation=Oe(s.linearAttenuation,0),s.quadraticAttenuation=Oe(s.quadraticAttenuation,0)}else if(r.type==="spot"){l(r.spot)||(r.spot={});let s=r.spot;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=Oe(s.constantAttenuation,1),s.fallOffAngle=Oe(s.fallOffAngle,3.14159265),s.fallOffExponent=Oe(s.fallOffExponent,0),s.linearAttenuation=Oe(s.linearAttenuation,0),s.quadraticAttenuation=Oe(s.quadraticAttenuation,0)}}}var IIe=aLt;function dLt(e,t){if(t=Oe(t,Oe.EMPTY_OBJECT),Co(e,"KHR_techniques_webgl")||!l(e.materials)||e.materials.length===0)return e;l(e.extensions)||(e.extensions={}),l(e.extensionsUsed)||(e.extensionsUsed=[]),l(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");let n=wi.splitIncompatibleMaterials(e);return Ce.material(e,function(i,o){let r={},s=gLt(e,i,o,r,n,t);l(i.extensions)||(i.extensions={}),i.extensions.KHR_techniques_webgl={values:r,technique:s}}),wi.ensureSemanticExistence(e),e}function hLt(e){return l(e.extensions)&&l(e.extensions.KHR_materials_pbrSpecularGlossiness)}function kA(e,t,n,i,o){let r,s=n[t];return l(s)&&l(s.texCoord)&&s.texCoord===1&&(i=i.replace("0","1")),l(n[`${t}Offset`])?(r=`${t}Coord`,o.fragmentShaderMain+=` vec2 ${r} = computeTexCoord(${i}, ${t}Offset, ${t}Rotation, ${t}Scale); -`):r=i,r}var mLt=[0,0],pLt=[0],_Lt=[1,1];function ote(e,t,n){if(e.indexOf("Texture")===-1||!l(t.extensions)||!l(t.extensions.KHR_texture_transform))return;let i=`u_${e}`,o=t.extensions.KHR_texture_transform;n[`${i}Offset`]=Oe(o.offset,mLt),n[`${i}Rotation`]=Oe(o.rotation,pLt),n[`${i}Scale`]=Oe(o.scale,_Lt),l(t.texCoord)&&l(o.texCoord)&&(n[i].texCoord=o.texCoord)}function gLt(e,t,n,i,o,r){let s=Oe(r.addBatchIdToGeneratedShaders,!1),a=e.extensions.KHR_techniques_webgl,c=a.techniques,u=a.shaders,f=a.programs,d=hLt(t),p,_,m;if(!d){let ve=t.pbrMetallicRoughness;if(l(ve))for(_ in ve)ve.hasOwnProperty(_)&&(m=ve[_],p=`u_${_}`,i[p]=m,ote(_,m,i));else i.u_baseColorFactor=[1,1,1,1]}if(d){let ve=t.extensions.KHR_materials_pbrSpecularGlossiness;for(_ in ve)ve.hasOwnProperty(_)&&(m=ve[_],p=`u_${_}`,i[p]=m,ote(_,m,i))}for(let ve in t)t.hasOwnProperty(ve)&&(ve.indexOf("Texture")>=0||ve.indexOf("Factor")>=0)&&(m=t[ve],p=`u_${ve}`,i[p]=m,ote(ve,m,i));let y=`precision highp float; -`,b=`precision highp float; -`,x;l(e.skins)&&(x=e.skins[0]);let T=l(x)?x.joints:[],C=T.length,A=o[n],S,w=!1,R=!1,P=!1,O=!1,L=!1,g=!1,E=!1,v=!1,I=!1;l(A)&&(S=A.skinning,w=S.skinned&&T.length>0,R=A.hasVertexColors,P=A.hasMorphTargets,O=A.hasNormals,L=A.hasTangents,g=A.hasTexCoords,E=A.hasTexCoord1,v=A.hasOutline);let N;P&&Ce.mesh(e,function(ve){Ce.meshPrimitive(ve,function(Ve){if(Ve.material===n){let $e=Ve.targets;l($e)&&(N=$e)}})});let F={u_modelViewMatrix:{semantic:Co(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:q.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:q.FLOAT_MAT4}};l(t.extensions)&&l(t.extensions.KHR_materials_unlit)&&(I=!0),O&&(F.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:q.FLOAT_MAT3}),w&&(F.u_jointMatrix={count:C,semantic:"JOINTMATRIX",type:q.FLOAT_MAT4}),P&&(F.u_morphWeights={count:N.length,semantic:"MORPHWEIGHTS",type:q.FLOAT});let U=t.alphaMode;l(U)&&U==="MASK"&&(F.u_alphaCutoff={semantic:"ALPHACUTOFF",type:q.FLOAT});for(p in i)i.hasOwnProperty(p)&&(F[p]={type:yLt(p)});let k=Oe(F.u_baseColorTexture,F.u_baseColorFactor);l(k)&&(k.semantic="_3DTILESDIFFUSE");for(p in F)if(F.hasOwnProperty(p)){let ve=F[p],Ve=l(ve.count)?`[${ve.count}]`:"";ve.type!==q.FLOAT_MAT3&&ve.type!==q.FLOAT_MAT4&&p!=="u_morphWeights"||ve.useInFragment?(b+=`uniform ${$g(ve.type)} ${p}${Ve}; -`,delete ve.useInFragment):y+=`uniform ${$g(ve.type)} ${p}${Ve}; -`}v&&(b+=`uniform sampler2D u_outlineTexture; -`);let z="";w&&(z+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let B={a_position:{semantic:"POSITION"}};if(v&&(B.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"}),y+=`attribute vec3 a_position; -`,O&&(y+=`out vec3 v_positionEC; -`),v&&(y+=`attribute vec3 a_outlineCoordinates; -`,y+=`out vec3 v_outlineCoordinates; -`),z+=` vec3 weightedPosition = a_position; -`,O&&(z+=` vec3 weightedNormal = a_normal; -`),L&&(z+=` vec4 weightedTangent = a_tangent; -`),P)for(let ve=0;ve<N.length;ve++){let Ve=N[ve];for(let $e in Ve)if(Ve.hasOwnProperty($e)&&$e!=="extras"){let Ct=`a_${$e}_${ve}`;B[Ct]={semantic:`${$e}_${ve}`},y+=`attribute vec3 ${Ct}; -`,$e==="POSITION"?z+=` weightedPosition += u_morphWeights[${ve}] * ${Ct}; -`:$e==="NORMAL"?z+=` weightedNormal += u_morphWeights[${ve}] * ${Ct}; -`:L&&$e==="TANGENT"&&(z+=` weightedTangent.xyz += u_morphWeights[${ve}] * ${Ct}; -`)}}w?z+=` vec4 position = skinMatrix * vec4(weightedPosition, 1.0); -`:z+=` vec4 position = vec4(weightedPosition, 1.0); -`,z+=` position = u_modelViewMatrix * position; -`,O&&(z+=` v_positionEC = position.xyz; -`),z+=` gl_Position = u_projectionMatrix * position; -`,v&&(z+=` v_outlineCoordinates = a_outlineCoordinates; -`),O&&(B.a_normal={semantic:"NORMAL"},y+=`attribute vec3 a_normal; -`,I||(y+=`out vec3 v_normal; -`,w?z+=` v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal; -`:z+=` v_normal = u_normalMatrix * weightedNormal; -`,b+=`in vec3 v_normal; -`),b+=`in vec3 v_positionEC; -`),L&&(B.a_tangent={semantic:"TANGENT"},y+=`attribute vec4 a_tangent; -`,y+=`out vec4 v_tangent; -`,z+=` v_tangent.xyz = u_normalMatrix * weightedTangent.xyz; -`,z+=` v_tangent.w = weightedTangent.w; -`,b+=`in vec4 v_tangent; -`),v&&(b+=`in vec3 v_outlineCoordinates; -`);let j="",W,J,Y,ee,Q,de,ge,le;if(g){if(B.a_texcoord_0={semantic:"TEXCOORD_0"},W="v_texcoord_0",y+=`attribute vec2 a_texcoord_0; -`,y+=`out vec2 ${W}; -`,z+=` ${W} = a_texcoord_0; -`,b+=`in vec2 ${W}; -`,E){B.a_texcoord_1={semantic:"TEXCOORD_1"};let Ve=W.replace("0","1");y+=`attribute vec2 a_texcoord_1; -`,y+=`out vec2 ${Ve}; -`,z+=` ${Ve} = a_texcoord_1; -`,b+=`out vec2 ${Ve}; -`}let ve={fragmentShaderMain:j};J=kA(e,"u_normalTexture",i,W,ve),Y=kA(e,"u_baseColorTexture",i,W,ve),ee=kA(e,"u_specularGlossinessTexture",i,W,ve),Q=kA(e,"u_diffuseTexture",i,W,ve),de=kA(e,"u_metallicRoughnessTexture",i,W,ve),ge=kA(e,"u_occlusionTexture",i,W,ve),le=kA(e,"u_emissiveTexture",i,W,ve),j=ve.fragmentShaderMain}w&&(B.a_joint={semantic:"JOINTS_0"},B.a_weight={semantic:"WEIGHTS_0"},y+=`attribute vec4 a_joint; -`,y+=`attribute vec4 a_weight; -`),R&&(B.a_vertexColor={semantic:"COLOR_0"},y+=`attribute vec4 a_vertexColor; -`,y+=`out vec4 v_vertexColor; -`,z+=` v_vertexColor = a_vertexColor; -`,b+=`out vec4 v_vertexColor; -`),s&&(B.a_batchId={semantic:"_BATCHID"},y+=`attribute float a_batchId; -`),y+=`void main(void) -{ -`,y+=z,y+=`} -`,O&&!I&&(b+=`const float M_PI = 3.141592653589793; -`,b+=`vec3 lambertianDiffuse(vec3 diffuseColor) -{ - return diffuseColor / M_PI; -} - -`,b+=`vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - -`,b+=`vec3 fresnelSchlick(float metalness, float VdotH) -{ - return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0); -} - -`,b+=`float smithVisibilityG1(float NdotV, float roughness) -{ - float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; - return NdotV / (NdotV * (1.0 - k) + k); -} - -`,b+=`float smithVisibilityGGX(float roughness, float NdotL, float NdotV) -{ - return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness); -} - -`,b+=`float GGX(float roughness, float NdotH) -{ - float roughnessSquared = roughness * roughness; - float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; - return roughnessSquared / (M_PI * f * f); -} - -`),b+=`vec3 SRGBtoLINEAR3(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -`,b+=`vec4 SRGBtoLINEAR4(vec4 srgbIn) -{ - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} - -`,b+=`vec3 applyTonemapping(vec3 linearIn) -{ -#ifndef HDR - return czm_acesTonemapping(linearIn); -#else - return linearIn; -#endif -} - -`,b+=`vec3 LINEARtoSRGB(vec3 linearIn) -{ -#ifndef HDR - return pow(linearIn, vec3(1.0/2.2)); -#else - return linearIn; -#endif -} - -`,b+=`vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) -{ - rotation = -rotation; - mat3 transform = mat3( - cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, - -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, - offset.x, offset.y, 1.0); - vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; - return transformedTexCoords; -} - -`,b+=`#ifdef USE_IBL_LIGHTING -`,b+=`uniform vec2 gltf_iblFactor; -`,b+=`#endif -`,b+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,b+=`uniform vec3 gltf_lightColor; -`,b+=`#endif -`,b+=`out vec4 fragColor; -`,b+=`void main(void) -{ -`,b+=j,O&&!I&&(b+=` vec3 ng = normalize(v_normal); -`,b+=` vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0)); -`,l(i.u_normalTexture)?L?(b+=` vec3 t = normalize(v_tangent.xyz); -`,b+=` vec3 b = normalize(cross(ng, t) * v_tangent.w); -`,b+=` mat3 tbn = mat3(t, b, ng); -`,b+=` vec3 n = texture(u_normalTexture, ${J}).rgb; -`,b+=` n = normalize(tbn * (2.0 * n - 1.0)); -`):(b=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -${b}`,b+=`#ifdef GL_OES_standard_derivatives -`,b+=` vec3 pos_dx = dFdx(v_positionEC); -`,b+=` vec3 pos_dy = dFdy(v_positionEC); -`,b+=` vec3 tex_dx = dFdx(vec3(${J},0.0)); -`,b+=` vec3 tex_dy = dFdy(vec3(${J},0.0)); -`,b+=` vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); -`,b+=` t = normalize(t - ng * dot(ng, t)); -`,b+=` vec3 b = normalize(cross(ng, t)); -`,b+=` mat3 tbn = mat3(t, b, ng); -`,b+=` vec3 n = texture(u_normalTexture, ${J}).rgb; -`,b+=` n = normalize(tbn * (2.0 * n - 1.0)); -`,b+=`#else -`,b+=` vec3 n = ng; -`,b+=`#endif -`):b+=` vec3 n = ng; -`,t.doubleSided&&(b+=` if (czm_backFacing()) -`,b+=` { -`,b+=` n = -n; -`,b+=` } -`)),l(i.u_baseColorTexture)?(b+=` vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture(u_baseColorTexture, ${Y})); -`,l(i.u_baseColorFactor)&&(b+=` baseColorWithAlpha *= u_baseColorFactor; -`)):l(i.u_baseColorFactor)?b+=` vec4 baseColorWithAlpha = u_baseColorFactor; -`:b+=` vec4 baseColorWithAlpha = vec4(1.0); -`,R&&(b+=` baseColorWithAlpha *= v_vertexColor; -`),b+=` vec3 baseColor = baseColorWithAlpha.rgb; -`,O&&!I?(d?(l(i.u_specularGlossinessTexture)?(b+=` vec4 specularGlossiness = SRGBtoLINEAR4(texture(u_specularGlossinessTexture, ${ee})); -`,b+=` vec3 specular = specularGlossiness.rgb; -`,b+=` float glossiness = specularGlossiness.a; -`,l(i.u_specularFactor)&&(b+=` specular *= u_specularFactor; -`),l(i.u_glossinessFactor)&&(b+=` glossiness *= u_glossinessFactor; -`)):(l(i.u_specularFactor)?b+=` vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); -`:b+=` vec3 specular = vec3(1.0); -`,l(i.u_glossinessFactor)?b+=` float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -`:b+=` float glossiness = 1.0; -`),l(i.u_diffuseTexture)?(b+=` vec4 diffuse = SRGBtoLINEAR4(texture(u_diffuseTexture, ${Q})); -`,l(i.u_diffuseFactor)&&(b+=` diffuse *= u_diffuseFactor; -`)):l(i.u_diffuseFactor)?b+=` vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -`:b+=` vec4 diffuse = vec4(1.0); -`,b+=` baseColorWithAlpha.a = diffuse.a; -`):l(i.u_metallicRoughnessTexture)?(b+=` vec3 metallicRoughness = texture(u_metallicRoughnessTexture, ${de}).rgb; -`,b+=` float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -`,b+=` float roughness = clamp(metallicRoughness.g, 0.04, 1.0); -`,l(i.u_metallicFactor)&&(b+=` metalness *= u_metallicFactor; -`),l(i.u_roughnessFactor)&&(b+=` roughness *= u_roughnessFactor; -`)):(l(i.u_metallicFactor)?b+=` float metalness = clamp(u_metallicFactor, 0.0, 1.0); -`:b+=` float metalness = 1.0; -`,l(i.u_roughnessFactor)?b+=` float roughness = clamp(u_roughnessFactor, 0.04, 1.0); -`:b+=` float roughness = 1.0; -`),b+=` vec3 v = -normalize(v_positionEC); -`,b+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,b+=` vec3 lightColorHdr = czm_lightColorHdr; -`,b+=`#else -`,b+=` vec3 lightColorHdr = gltf_lightColor; -`,b+=`#endif -`,b+=` vec3 l = normalize(czm_lightDirectionEC); -`,b+=` vec3 h = normalize(v + l); -`,b+=` float NdotL = clamp(dot(n, l), 0.001, 1.0); -`,b+=` float NdotV = abs(dot(n, v)) + 0.001; -`,b+=` float NdotH = clamp(dot(n, h), 0.0, 1.0); -`,b+=` float LdotH = clamp(dot(l, h), 0.0, 1.0); -`,b+=` float VdotH = clamp(dot(v, h), 0.0, 1.0); -`,b+=` vec3 f0 = vec3(0.04); -`,d?(b+=` float roughness = 1.0 - glossiness; -`,b+=` vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b)); -`,b+=` vec3 specularColor = specular; -`):(b+=` vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0); -`,b+=` vec3 specularColor = mix(f0, baseColor, metalness); -`),b+=` float alpha = roughness * roughness; -`,b+=` float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); -`,b+=` vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -`,b+=` vec3 r0 = specularColor.rgb; -`,b+=` vec3 F = fresnelSchlick2(r0, r90, VdotH); -`,b+=` float G = smithVisibilityGGX(alpha, NdotL, NdotV); -`,b+=` float D = GGX(alpha, NdotH); -`,b+=` vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); -`,b+=` vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); -`,b+=` vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution); -`,b+=`#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) -`,b+=` vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); -`,b+=` float vertexRadius = length(positionWC); -`,b+=` float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); -`,b+=` float reflectionDotNadir = dot(r, normalize(positionWC)); -`,b+=` r.x = -r.x; -`,b+=` r = -normalize(czm_temeToPseudoFixed * r); -`,b+=` r.x = -r.x; -`,b+=` float inverseRoughness = 1.04 - roughness; -`,b+=` inverseRoughness *= inverseRoughness; -`,b+=` vec3 sceneSkyBox = texture(czm_environmentMap, r).rgb * inverseRoughness; -`,b+=` float atmosphereHeight = 0.05; -`,b+=` float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); -`,b+=` float blendRegionOffset = roughness * -1.0; -`,b+=` float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); -`,b+=` float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); -`,b+=` float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); -`,b+=` float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); -`,b+=` vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); -`,b+=` vec3 nadirColor = belowHorizonColor * 0.5; -`,b+=` vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); -`,b+=` vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); -`,b+=` vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); -`,b+=` vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); -`,b+=` float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; -`,b+=` float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); -`,b+=` vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); -`,b+=` float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); -`,b+=` vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); -`,b+=` specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); -`,b+=` specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -`,b+=`#ifdef USE_SUN_LUMINANCE -`,b+=` float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0); -`,b+=` float S = acos(LdotZenith); -`,b+=` float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0); -`,b+=` float gamma = acos(NdotL); -`,b+=` float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); -`,b+=` float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); -`,b+=` float luminance = gltf_luminanceAtZenith * (numerator / denominator); -`,b+=`#endif -`,b+=` vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,b+=` vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y); -`,b+=` float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); -`,b+=` vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); -`,b+=` IBLColor *= lightColor; -`,b+=`#ifdef USE_SUN_LUMINANCE -`,b+=` color += IBLColor * luminance; -`,b+=`#else -`,b+=` color += IBLColor; -`,b+=`#endif -`,b+=`#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -`,b+=` const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); -`,b+=` vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n))); -`,b+=`#ifdef DIFFUSE_IBL -`,b+=`#ifdef CUSTOM_SPHERICAL_HARMONICS -`,b+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); -`,b+=`#else -`,b+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); -`,b+=`#endif -`,b+=`#else -`,b+=` vec3 diffuseIrradiance = vec3(0.0); -`,b+=`#endif -`,b+=`#ifdef SPECULAR_IBL -`,b+=` vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,b+=`#ifdef CUSTOM_SPECULAR_IBL -`,b+=` vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD); -`,b+=`#else -`,b+=` vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); -`,b+=`#endif -`,b+=` specularIBL *= F * brdfLut.x + brdfLut.y; -`,b+=`#else -`,b+=` vec3 specularIBL = vec3(0.0); -`,b+=`#endif -`,b+=` color += diffuseIrradiance * diffuseColor + specularColor * specularIBL; -`,b+=`#endif -`):b+=` vec3 color = baseColor; -`,I||(l(i.u_occlusionTexture)&&(b+=` color *= texture(u_occlusionTexture, ${ge}).r; -`),l(i.u_emissiveTexture)?(b+=` vec3 emissive = SRGBtoLINEAR3(texture(u_emissiveTexture, ${le}).rgb); -`,l(i.u_emissiveFactor)&&(b+=` emissive *= u_emissiveFactor; -`),b+=` color += emissive; -`):l(i.u_emissiveFactor)&&(b+=` color += u_emissiveFactor; -`)),I||(b+=` color = applyTonemapping(color); -`),b+=` color = LINEARtoSRGB(color); -`,v&&(b+=` float outlineness = max( -`,b+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r, -`,b+=` max( -`,b+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r, -`,b+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r)); -`,b+=` color = mix(color, vec3(0.0, 0.0, 0.0), outlineness); -`),l(U)?U==="MASK"?(b+=` if (baseColorWithAlpha.a < u_alphaCutoff) { -`,b+=` discard; -`,b+=` } -`,b+=` fragColor = vec4(color, 1.0); -`):U==="BLEND"?b+=` fragColor = vec4(color, baseColorWithAlpha.a); -`:b+=` fragColor = vec4(color, 1.0); -`:b+=` fragColor = vec4(color, 1.0); -`,b+=`} -`;let ye=Fo(u,{type:q.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),xe=Fo(u,{type:q.FRAGMENT_SHADER,extras:{_pipeline:{source:b,extension:".glsl"}}}),Ie=Fo(f,{fragmentShader:xe,vertexShader:ye});return Fo(c,{attributes:B,program:Ie,uniforms:F})}function yLt(e){if(e.indexOf("Offset")!==-1)return q.FLOAT_VEC2;if(e.indexOf("Rotation")!==-1)return q.FLOAT;if(e.indexOf("Scale")!==-1)return q.FLOAT_VEC2;if(e.indexOf("Texture")!==-1)return q.SAMPLER_2D;switch(e){case"u_baseColorFactor":return q.FLOAT_VEC4;case"u_metallicFactor":return q.FLOAT;case"u_roughnessFactor":return q.FLOAT;case"u_emissiveFactor":return q.FLOAT_VEC3;case"u_diffuseFactor":return q.FLOAT_VEC4;case"u_specularFactor":return q.FLOAT_VEC3;case"u_glossinessFactor":return q.FLOAT}}var PIe=dLt;var V6={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};V6.getMorphTime=function(e){return e===V6.SCENE3D?1:e===V6.MORPHING?void 0:0};var Kd=Object.freeze(V6);var Ff={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Ff.NUMBER_OF_SHADOW_MODES=4;Ff.castShadows=function(e){return e===Ff.ENABLED||e===Ff.CAST_ONLY};Ff.receiveShadows=function(e){return e===Ff.ENABLED||e===Ff.RECEIVE_ONLY};Ff.fromCastReceive=function(e,t){return e&&t?Ff.ENABLED:e?Ff.CAST_ONLY:t?Ff.RECEIVE_ONLY:Ff.DISABLED};var Wp=Object.freeze(Ff);var bLt={LEFT:-1,NONE:0,RIGHT:1},UA=Object.freeze(bLt);var xLt={modifyFragmentShader:function(t){return t=Be.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},rte=xLt;var TLt={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},ste=Object.freeze(TLt);var CLt={ZERO:q.ZERO,KEEP:q.KEEP,REPLACE:q.REPLACE,INCREMENT:q.INCR,DECREMENT:q.DECR,INVERT:q.INVERT,INCREMENT_WRAP:q.INCR_WRAP,DECREMENT_WRAP:q.DECR_WRAP},zA=Object.freeze(CLt);var H6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};H6.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ste.ALWAYS,frontOperation:{fail:zA.KEEP,zFail:zA.KEEP,zPass:zA.REPLACE},backFunction:ste.ALWAYS,backOperation:{fail:zA.KEEP,zFail:zA.KEEP,zPass:zA.REPLACE},reference:H6.CESIUM_3D_TILE_MASK,mask:H6.CESIUM_3D_TILE_MASK}};var ate=Object.freeze(H6);var ALt=new h,Bb=wi.ModelState,ELt="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",SLt=D.EPSILON16;function mte(e,t){e._cachedGltf=t}function GU(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(GU.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}});GU.prototype.makeReady=function(e){this.gltf=e;let t=this.modelsToLoad,n=t.length;for(let i=0;i<n;++i){let o=t[i];o.isDestroyed()||mte(o,this)}this.modelsToLoad=void 0,this.ready=!0};var Ub={},DIe={};function Ha(e){e=Oe(e,Oe.EMPTY_OBJECT);let t=e.cacheKey;this._cacheKey=t,this._cachedGltf=void 0,this._releaseGltfJson=Oe(e.releaseGltfJson,!1);let n;if(l(t)&&l(Ub[t])&&Ub[t].ready)n=Ub[t],++n.count;else{let s=e.gltf;if(l(s)){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),s instanceof Uint8Array){let a=Uee(s);n=new GU({gltf:a,ready:!0})}else n=new GU({gltf:e.gltf,ready:!0});n.count=1,l(t)&&(Ub[t]=n)}}mte(this,n);let i=Oe(e.basePath,"");this._resource=Ee.createIfNeeded(i);let o=e.credit;typeof o=="string"&&(o=new _t(o)),this._credit=o,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=Oe(e.showCreditsOnScreen,!1),this.show=Oe(e.show,!0),this.silhouetteColor=Oe(e.silhouetteColor,H.RED),this._silhouetteColor=new H,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=Oe(e.silhouetteSize,0),this.modelMatrix=M.clone(Oe(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=Oe(e.scale,1),this._scale=this.scale,this.minimumPixelSize=Oe(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=Oe(e.heightReference,rI.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;let r=e.scene;this._scene=r,l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=Oe(e.allowPicking,!0),this._ready=!1,this._readyPromise=Zs(),this.activeAnimations=new gIe(this),this.clampAnimations=Oe(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=Oe(e.incrementallyLoadTextures,!0),this._asynchronous=Oe(e.asynchronous,!0),this.shadows=Oe(e.shadows,Wp.ENABLED),this._shadows=this.shadows,this.color=H.clone(Oe(e.color,H.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=Oe(e.colorBlendMode,M6.HIGHLIGHT),this.colorBlendAmount=Oe(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=Oe(e.backFaceCulling,!0),this.showOutline=Oe(e.showOutline,!0),this.splitDirection=Oe(e.splitDirection,UA.NONE),this._splittingEnabled=!1,this.debugShowBoundingVolume=Oe(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Oe(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=Oe(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=Oe(e.upAxis,dc.Y),this._gltfForwardAxis=dc.Z,this._forwardAxis=e.forwardAxis,this.cull=Oe(e.cull,!0),this.opaquePass=Oe(e.opaquePass,Se.OPAQUE),this._computedModelMatrix=new M,this._clippingPlanesMatrix=M.clone(M.IDENTITY),this._iblReferenceFrameMatrix=Z.clone(Z.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new re,this._state=Bb.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,e.dequantizeInShader&&Po("Model.dequantizeInShader","The Model dequantizeInShader constructor parameter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this._dequantizeInShader=Oe(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._pointsLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._lightColor=h.clone(e.lightColor),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new C6,this._shouldDestroyImageBasedLighting=!0),this._shouldRegenerateShaders=!1}Object.defineProperties(Ha.prototype,{gltf:{get:function(){return Po("Model.gltf","Model.gltf getter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this.gltfInternal}},gltfInternal:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return Po("model.basePath","Model.basePath getter is deprecated in CesiumJS 1.94. It will be removed in CesiumJS 1.97"),this.basePathInternal}},basePathInternal:{get:function(){return this._resource.url}},boundingSphere:{get:function(){let e=this.modelMatrix;this.heightReference!==rI.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,n=re.clone(this._boundingSphere,this._scaledBoundingSphere);return n.radius*=t,re.transform(n,e,n),l(this._rtcCenter)&&h.add(this._rtcCenter,n.center,n.center),n}},boundingSphereInternal:{get:function(){let e=this.modelMatrix;this.heightReference!==rI.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=M.getScale(e,ALt),n=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;h.multiplyByScalar(t,n,t);let i=this._scaledBoundingSphere;return i.center=h.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=h.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&h.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return Po("Model.pendingTextureLoads","The Model.pendingTextureLoads getter was deprecated in CesiumJS 1.94 and will be removed in CesiumJS 1.97"),this.pendingTextureLoadsInternal}},pendingTextureLoadsInternal:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Rt.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=wi.getUsedExtensions(this.gltfInternal)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=wi.getRequiredExtensions(this.gltfInternal)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return l(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&BU.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},lightColor:{get:function(){return this._lightColor},set:function(e){let t=this._lightColor;e===t||h.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(t)&&!l(e)||l(e)&&!l(t),this._lightColor=h.clone(e,t))}},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._shouldRegenerateShaders=!0)}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){if(this._showCreditsOnScreen!==e){l(this._credit)&&(this._credit.showOnScreen=e);let t=this._resourceCredits.length;for(let i=0;i<t;i++)this._resourceCredits[i].showOnScreen=e;let n=this._gltfCredits.length;for(let i=0;i<n;i++)this._gltfCredits[i].showOnScreen=e}this._showCreditsOnScreen=e}}});function HIe(e){return e.stencilBuffer}function pte(e){return!H.equals(e.color,H.WHITE)||e.colorBlendMode!==M6.HIGHLIGHT}function _te(e){let t=e._clippingPlanes;return l(t)&&t.enabled&&t.length!==0}Ha.silhouetteSupported=function(e){return HIe(e.context)};function vLt(e){return bl(e)==="glTF"}Ha.fromGltf=function(e){let t=e.url;e=Fe(e);let n=Ee.createIfNeeded(t),i=Oe(e.basePath,n.clone()),o=Ee.createIfNeeded(i),r=Oe(e.cacheKey,DIe[Ou(n.url)]);l(r)||(r=Ln(),DIe[Ou(n.url)]=r),l(e.basePath)&&!l(e.cacheKey)&&(r+=o.url),e.cacheKey=r,e.basePath=o;let s=new Ha(e),a=Ub[r];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(s)):(a=new GU({ready:!1}),a.count=1,a.modelsToLoad.push(s),mte(s,a),Ub[r]=a,l(n.headers.Accept)||(n.headers.Accept=ELt),n.fetchArrayBuffer().then(function(c){let u=new Uint8Array(c);if(vLt(u)){let p=Uee(u);a.makeReady(p)}else{let p=Ho(u);a.makeReady(p)}let f=s._resourceCredits,d=n.credits;if(l(d)){let p=d.length;for(let _=0;_<p;_++)f.push(d[_])}}).catch(wi.getFailedLoadFunction(s,"model",n.url))),s};Ha._gltfCache=Ub;function jU(e,t,n){return e._runtime[t][n]}Ha.prototype.getNode=function(e){let t=jU(this,"nodesByName",e);return l(t)?t.publicNode:void 0};Ha.prototype.getMesh=function(e){return jU(this,"meshesByName",e)};Ha.prototype.getMaterial=function(e){return jU(this,"materialsByName",e)};Ha.prototype.setArticulationStage=function(e,t){let n=jU(this,"stagesByKey",e),i=jU(this,"articulationsByStageKey",e);l(n)&&l(i)&&(t=D.clamp(t,n.minimumValue,n.maximumValue),D.equalsEpsilon(n.currentValue,t,SLt)||(n.currentValue=t,i.isDirty=!0))};var wLt=new h,cte=new Z;function GIe(e,t){let n=e.currentValue,i=wLt,o;switch(e.type){case"xRotate":o=Z.fromRotationX(D.toRadians(n),cte),M.multiplyByMatrix3(t,o,t);break;case"yRotate":o=Z.fromRotationY(D.toRadians(n),cte),M.multiplyByMatrix3(t,o,t);break;case"zRotate":o=Z.fromRotationZ(D.toRadians(n),cte),M.multiplyByMatrix3(t,o,t);break;case"xTranslate":i.x=n,i.y=0,i.z=0,M.multiplyByTranslation(t,i,t);break;case"yTranslate":i.x=0,i.y=n,i.z=0,M.multiplyByTranslation(t,i,t);break;case"zTranslate":i.x=0,i.y=0,i.z=n,M.multiplyByTranslation(t,i,t);break;case"xScale":i.x=n,i.y=1,i.z=1,M.multiplyByScale(t,i,t);break;case"yScale":i.x=1,i.y=n,i.z=1,M.multiplyByScale(t,i,t);break;case"zScale":i.x=1,i.y=1,i.z=n,M.multiplyByScale(t,i,t);break;case"uniformScale":M.multiplyByUniformScale(t,n,t);break;default:break}return t}var ILt=new M;Ha.prototype.applyArticulations=function(){let e=this._runtime.articulationsByName;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];if(n.isDirty){n.isDirty=!1;let i=n.nodes.length;for(let o=0;o<i;++o){let r=n.nodes[o],s=M.clone(r.originalMatrix,ILt),a=n.stages.length;for(let c=0;c<a;++c){let u=n.stages[c];s=GIe(u,s)}r.matrix=s}}}};function PLt(e){let t=e.gltfInternal,n=e._loadResources;Ce.buffer(t,function(i,o){n.buffers[o]=i.extras._pipeline.source})}function DLt(e,t){return function(n){let i=e._loadResources,o=new Uint8Array(n);--i.pendingBufferLoads,e.gltfInternal.buffers[t].extras._pipeline.source=o}}function RLt(e){let t=e.gltfInternal.bufferViews,n=e._loadResources.vertexBuffersToCreate;Ce.bufferView(e.gltfInternal,function(r,s){r.target===q.ARRAY_BUFFER&&n.enqueue(s)});let i=e._loadResources.indexBuffersToCreate,o={};Ce.accessor(e.gltfInternal,function(r){let s=r.bufferView;if(!l(s))return;t[s].target===q.ELEMENT_ARRAY_BUFFER&&!l(o[s])&&(o[s]=!0,i.enqueue({id:s,componentType:r.componentType}))})}function OLt(e){let t=e.gltfInternal;if(!Co(t,"KHR_techniques_webgl"))return;let n=e._sourcePrograms,i=e._sourceTechniques,o=t.extensions.KHR_techniques_webgl.programs;Ce.technique(t,function(r,s){i[s]=Fe(r);let a=r.program;l(n[a])||(n[a]=Fe(o[a]))})}function MLt(e,t,n){return function(i){let o=e._loadResources;o.shaders[n]={source:i,type:t,bufferView:void 0},--o.pendingShaderLoads,e._rendererResources.sourceShaders[n]=i}}function LLt(e){let t=e.gltfInternal,n=t.buffers,i=t.bufferViews,o=e._rendererResources.sourceShaders;Ce.shader(t,function(r,s){if(l(r.bufferView)){let a=r.bufferView,c=i[a],u=c.buffer,f=n[u],d=ia(f.extras._pipeline.source,c.byteOffset,c.byteLength);o[s]=d}else if(l(r.extras._pipeline.source))o[s]=r.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;let a=e._resource.getDerivedResource({url:r.uri});a.fetchText().then(MLt(e,r.type,s)).catch(wi.getFailedLoadFunction(e,"shader",a.url))}})}function NLt(e){let t=e._sourceTechniques;for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:n})}}function FLt(e){let t={},n={},i={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=n,e._runtime.stagesByKey=i;let o=e.gltfInternal;if(!Co(o,"AGI_articulations")||!l(o.extensions)||!l(o.extensions.AGI_articulations))return;let r=o.extensions.AGI_articulations.articulations;if(!l(r))return;let s=r.length;for(let a=0;a<s;++a){let c=Fe(r[a]);c.nodes=[],c.isDirty=!0,t[c.name]=c;let u=c.stages.length;for(let f=0;f<u;++f){let d=c.stages[f];d.currentValue=d.initialValue;let p=`${c.name} ${d.name}`;n[p]=c,i[p]=d}}}function jIe(e,t){return function(n){let i=e._loadResources;--i.pendingTextureLoads;let o;Array.isArray(n)&&(o=n.slice(1,n.length).map(function(r){return r.bufferView}),n=n[0]),i.texturesToCreate.enqueue({id:t,image:n,bufferView:n.bufferView,width:n.width,height:n.height,internalFormat:n.internalFormat,mipLevels:o})}}var BLt=/(^data:image\/ktx2)|(\.ktx2$)/i;function kLt(e,t,n){let i=e.gltfInternal,o=i.images,r;Ce.texture(i,function(s,a){let c=s.source;l(s.extensions)&&l(s.extensions.EXT_texture_webp)&&n?c=s.extensions.EXT_texture_webp.source:l(s.extensions)&&l(s.extensions.KHR_texture_basisu)&&t.supportsBasis&&(c=s.extensions.KHR_texture_basisu.source);let u=o[c],f=u.bufferView,d=u.mimeType;if(r=u.uri,l(f))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:f,mimeType:d});else{++e._loadResources.pendingTextureLoads;let p=e._resource.getDerivedResource({url:r}),_;BLt.test(r)?_=Qs(p):_=p.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0}),_.then(jIe(e,a,c)).catch(wi.getFailedLoadFunction(e,"image",p.url))}})}var ULt=new M;function zLt(e){let t={},n={},i=[],o=e._loadResources.skinnedNodesIds,r=e._runtime.articulationsByName;Ce.node(e.gltfInternal,function(s,a){let c={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new M,computedMatrix:new M,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(c.publicNode=new CIe(e,s,c,a,wi.getTransform(s)),t[a]=c,n[s.name]=c,l(s.skin)&&(o.push(a),i.push(c)),l(s.extensions)&&l(s.extensions.AGI_articulations)){let u=s.extensions.AGI_articulations.articulationName;if(l(u)){let f=M.clone(c.publicNode.originalMatrix,ULt),d=r[u];d.nodes.push(c.publicNode);let p=d.stages.length;for(let _=0;_<p;++_){let m=d.stages[_];f=GIe(m,f)}c.publicNode.matrix=f}}}),e._runtime.nodes=t,e._runtime.nodesByName=n,e._runtime.skinnedNodes=i}function VLt(e){let t=e.gltfInternal,n=e._sourceTechniques,i={},o={},r=e._uniformMaps;Ce.material(t,function(s,a){r[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};let c=new bIe(e,s,a);if(l(s.extensions)&&l(s.extensions.KHR_techniques_webgl)){let u=s.extensions.KHR_techniques_webgl.technique;c._technique=u,c._program=n[u].program,Ce.materialValue(s,function(f,d){l(c._values)||(c._values={}),c._values[d]=Fe(f)})}i[s.name]=c,o[a]=c}),e._runtime.materialsByName=i,e._runtime.materialsById=o}function HLt(e){let t={},n=e._runtime.materialsById;Ce.mesh(e.gltfInternal,function(i,o){t[i.name]=new TIe(i,n,o),(l(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&Ce.meshPrimitive(i,function(r,s){let a=bte(e,r),c=e._programPrimitives[a];l(c)||(c={},e._programPrimitives[a]=c),c[`${o}.primitive.${s}`]=r})}),e._runtime.meshesByName=t}function GLt(e){let n=e.gltfInternal.asset.copyright;if(!l(n))return;let i=e._showCreditsOnScreen,o=n.split(";").map(function(r){return new _t(r.trim(),i)});e._gltfCredits=o}var gte=function(){this.id=void 0,this.model=void 0,this.context=void 0};gte.prototype.set=function(e,t,n){this.id=e,this.model=t,this.context=n};gte.prototype.execute=function(){WIe(this.id,this.model,this.context)};function WIe(e,t,n){let i=t._loadResources,r=t.gltfInternal.bufferViews[e];l(r)||(r=i.createdBufferViews[e]);let s=st.createVertexBuffer({context:n,typedArray:i.getBuffer(r),usage:Ne.STATIC_DRAW});s.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=s,t._geometryByteLength+=s.sizeInBytes}var yte=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};yte.prototype.set=function(e,t,n,i){this.id=e,this.componentType=t,this.model=n,this.context=i};yte.prototype.execute=function(){qIe(this.id,this.componentType,this.model,this.context)};function qIe(e,t,n,i){let o=n._loadResources,s=n.gltfInternal.bufferViews[e];l(s)||(s=o.createdBufferViews[e]);let a=st.createIndexBuffer({context:i,typedArray:o.getBuffer(s),usage:Ne.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,n._rendererResources.buffers[e]=a,n._geometryByteLength+=a.sizeInBytes}var RIe=new gte,OIe=new yte;function jLt(e,t){let n=e._loadResources;if(n.pendingBufferLoads!==0)return;let i=t.context,o=n.vertexBuffersToCreate,r=n.indexBuffersToCreate,s;if(e.asynchronous){for(;o.length>0&&(RIe.set(o.peek(),e,i),!!t.jobScheduler.execute(RIe,UU.BUFFER));)o.dequeue();for(;r.length>0&&(s=r.peek(),OIe.set(s.id,s.componentType,e,i),!!t.jobScheduler.execute(OIe,UU.BUFFER));)r.dequeue()}else{for(;o.length>0;)WIe(o.dequeue(),e,i);for(;r.length>0;)s=r.dequeue(),qIe(s.id,s.componentType,e,i)}}function bte(e,t){let n=e._runtime.materialsById[t.material];if(l(n))return n._program}function YIe(e,t,n){let i,o=n._programPrimitives[t];if(!l(o))return e;let r;for(r in o)if(o.hasOwnProperty(r)&&(i=o[r],bte(n,i)===t))break;n._programPrimitives[t]=void 0;let s;if(n.extensionsUsed.WEB3D_quantized_attributes)s=wi.modifyShaderForQuantizedAttributes(n.gltfInternal,i,e),n._quantizedUniforms[t]=s.uniforms;else{let a=n._decodedData[r];if(l(a))s=wi.modifyShaderForDracoQuantizedAttributes(n.gltfInternal,i,e,a.attributes);else return e}return s.shader}function WLt(e){return e=Be.replaceMain(e,"gltf_blend_main"),e+=`uniform vec4 gltf_color; -uniform float gltf_colorBlend; -out vec4 fragColor; -void main() -{ - gltf_blend_main(); - fragColor.rgb = mix(fragColor.rgb, gltf_color.rgb, gltf_colorBlend); - float highlight = ceil(gltf_colorBlend); - fragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); - fragColor.a *= gltf_color.a; -} -`,e}function WU(e,t,n){return l(n)&&(e=n(e,t)),e}var xte=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};xte.prototype.set=function(e,t,n){this.programToCreate=e,this.model=t,this.context=n};xte.prototype.execute=function(){XIe(this.programToCreate,this.model,this.context)};function XIe(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=s[r.vertexShader],c=s[r.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){let m=u[i];l(m)||(m=YIe(a,i,t),u[i]=m),a=m}let f=WU(a,i,t._vertexShaderLoaded),d=WU(c,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(d=`uniform vec4 czm_pickColor; -${d}`);let p=t._imageBasedLighting,_=p.enabled;if(_&&(d=`#define USE_IBL_LIGHTING - -${d}`),l(t._lightColor)&&(d=`#define USE_CUSTOM_LIGHT_COLOR - -${d}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(d=Be.replaceMain(d,"non_gamma_corrected_main"),d=`${d} -out vec4 fragColor; -void main() { - non_gamma_corrected_main(); - fragColor = czm_gammaCorrect(fragColor); -} -`),nI.isSupported(n)){let m=p.useSphericalHarmonicCoefficients,y=p.useSpecularEnvironmentMaps;(m||y||_)&&(d=`uniform mat3 gltf_iblReferenceFrameMatrix; -${d}`),l(p.sphericalHarmonicCoefficients)?d=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${d}`:p.useDefaultSphericalHarmonics&&(d=`#define DIFFUSE_IBL -${d}`),l(p.specularEnvironmentMapAtlas)&&p.specularEnvironmentMapAtlas.ready?d=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${d}`:p.useDefaultSpecularMaps&&(d=`#define SPECULAR_IBL -${d}`)}l(p.luminanceAtZenith)&&(d=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${d}`),KIe(i,o,d,f,t,n)}function qLt(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=t._quantizedVertexShaders,c=t.clippingPlanes,u=_te(t),f=s[r.vertexShader],d=s[r.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(f=a[i]);let p=d;pte(t)&&(p=Ha._modifyShaderForColor(p)),u&&(p=KNt(p,c,n)),t.splitDirection!==UA.NONE&&(p=rte.modifyFragmentShader(p));let _=WU(f,i,t._vertexShaderLoaded),m=WU(p,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(m=`uniform vec4 czm_pickColor; -${m}`);let y=t._imageBasedLighting,b=y.enabled;if(b&&(m=`#define USE_IBL_LIGHTING - -${m}`),l(t._lightColor)&&(m=`#define USE_CUSTOM_LIGHT_COLOR - -${m}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(m=Be.replaceMain(m,"non_gamma_corrected_main"),m=`${m} -out vec4 fragColor; -void main() { - non_gamma_corrected_main(); - fragColor = czm_gammaCorrect(fragColor); -} -`),nI.isSupported(n)){let x=y.useSphericalHarmonicCoefficients,T=y.useSpecularEnvironmentMaps;(x||T||b)&&(m=`uniform mat3 gltf_iblReferenceFrameMatrix; -${m}`),l(y.sphericalHarmonicCoefficients)?m=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${m}`:y.useDefaultSphericalHarmonics&&(m=`#define DIFFUSE_IBL -${m}`),l(y.specularEnvironmentMapAtlas)&&y.specularEnvironmentMapAtlas.ready?m=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${m}`:y.useDefaultSpecularMaps&&(m=`#define SPECULAR_IBL -${m}`)}l(y.luminanceAtZenith)&&(m=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${m}`),KIe(i,o,m,_,t,n)}function KIe(e,t,n,i,o,r){let s=o._sourceTechniques[t],a=wi.createAttributeLocations(s,o._precreatedAttributes);o._rendererResources.programs[e]=Xt.fromCache({context:r,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:a})}var MIe=new xte;function YLt(e,t){let n=e._loadResources,i=n.programsToCreate;if(n.pendingShaderLoads!==0||n.pendingBufferLoads!==0)return;let o=t.context;if(e.asynchronous)for(;i.length>0&&(MIe.set(i.peek(),e,o),!!t.jobScheduler.execute(MIe,UU.PROGRAM));)i.dequeue();else for(;i.length>0;)XIe(i.dequeue(),e,o)}function XLt(e,t){return function(n){e.texturesToCreate.enqueue({id:t.id,image:n,bufferView:void 0}),--e.pendingBufferViewToImage}}function KLt(e){let t=e._loadResources;if(t.pendingBufferLoads===0)for(;t.texturesToCreateFromBufferView.length>0;){let n=t.texturesToCreateFromBufferView.dequeue(),i=e.gltfInternal,o=i.bufferViews[n.bufferView],r=i.textures[n.id].source,s=wi.getFailedLoadFunction(e,"image",`id: ${n.id}, bufferView: ${n.bufferView}`);if(n.mimeType==="image/ktx2"){let a=new Uint8Array(t.getBuffer(o));Qs(a).then(jIe(e,n.id,r)).catch(s),++e._loadResources.pendingTextureLoads}else{let a=XLt(t,n);L_({uint8Array:t.getBuffer(o),format:n.mimeType,flipY:!1,skipColorSpaceConversion:!0}).then(a).catch(s),++t.pendingBufferViewToImage}}}function $Lt(e){let t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;let n=e._rendererResources.samplers;Ce.sampler(e.gltfInternal,function(i,o){n[o]=new zt({wrapS:i.wrapS,wrapT:i.wrapT,minificationFilter:i.minFilter,magnificationFilter:i.magFilter})})}}var Tte=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};Tte.prototype.set=function(e,t,n){this.gltfTexture=e,this.model=t,this.context=n};Tte.prototype.execute=function(){$Ie(this.gltfTexture,this.model,this.context)};function $Ie(e,t,n){let o=t.gltfInternal.textures[e.id],s=t._rendererResources.samplers[o.sampler];l(s)||(s=new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT}));let a=!1,c=t.gltfInternal.materials,u=c.length;for(let C=0;C<u;++C){let A=c[C];if(l(A.extensions)&&l(A.extensions.KHR_techniques_webgl)){let S=A.extensions.KHR_techniques_webgl.values;for(let w in S)if(S.hasOwnProperty(w)&&w.indexOf("Texture")!==-1){let R=S[w];if(R.index===e.id&&l(R.extensions)&&l(R.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}let f=s.wrapS,d=s.wrapT,p=s.minificationFilter;a&&p!==ft.LINEAR&&p!==ft.NEAREST&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR?p=ft.NEAREST:p=ft.LINEAR,s=new zt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:p,magnificationFilter:s.magnificationFilter}));let _=e.internalFormat,m=!(l(_)&&je.isCompressedFormat(_))&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR||p===ft.LINEAR_MIPMAP_NEAREST||p===ft.LINEAR_MIPMAP_LINEAR),y=m||f===sn.REPEAT||f===sn.MIRRORED_REPEAT||d===sn.REPEAT||d===sn.MIRRORED_REPEAT,b,x,T=e.image;if(l(_)){b=!D.isPowerOfTwo(e.width)||!D.isPowerOfTwo(e.height),!n.webgl2&&je.isCompressedFormat(_)&&b&&y&&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. See the Model.js constructor documentation for more information.");let C=s.minificationFilter;!l(e.mipLevels)&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR)?C=ft.NEAREST:!l(e.mipLevels)&&(p===ft.LINEAR_MIPMAP_NEAREST||p===ft.LINEAR_MIPMAP_LINEAR)&&(C=ft.LINEAR),s=new zt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:C,magnificationFilter:s.magnificationFilter}),x=new dt({context:n,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:_,sampler:s})}else if(l(T)){if(b=!D.isPowerOfTwo(T.width)||!D.isPowerOfTwo(T.height),y&&b){let C=document.createElement("canvas");C.width=D.nextPowerOfTwo(T.width),C.height=D.nextPowerOfTwo(T.height),C.getContext("2d").drawImage(T,0,0,T.width,T.height,0,0,C.width,C.height),T=C}x=new dt({context:n,source:T,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1,skipColorSpaceConversion:!0}),m&&x.generateMipmap()}l(x)&&(t._rendererResources.textures[e.id]=x,t._texturesByteLength+=x.sizeInBytes)}var LIe=new Tte;function ZLt(e,t){let n=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(LIe.set(i.peek(),e,n),!!t.jobScheduler.execute(LIe,UU.TEXTURE));)i.dequeue();else for(;i.length>0;)$Ie(i.dequeue(),e,n)}function QLt(e,t){let n=e._sourceTechniques,i={},o,r,s=e._runtime.materialsById[t.material];if(!l(s))return i;let a=n[s._technique];if(!l(a))return i;let c=a.attributes,f=e._rendererResources.programs[a.program]._attributeLocations;for(o in f)if(f.hasOwnProperty(o)){let p=c[o];l(p)&&(r=f[o],i[p.semantic]=r)}let d=e._precreatedAttributes;if(l(d))for(o in d)d.hasOwnProperty(o)&&(r=f[o],i[o]=r);return i}function JLt(e,t){let n=e.gltfInternal,i=n.skins,o=n.nodes,r=e._runtime.nodes,s=e._loadResources.skinnedNodesIds,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=r[u],d=o[u],p=t[d.skin];f.inverseBindMatrices=p.inverseBindMatrices,f.bindShapeMatrix=p.bindShapeMatrix;let _=i[d.skin].joints,m=_.length;for(let y=0;y<m;++y){let b=_[y],x=r[b];f.joints.push(x)}}}function eNt(e){let t=e._loadResources;if(t.pendingBufferLoads!==0||!t.createSkins)return;t.createSkins=!1;let n=e.gltfInternal,i=n.accessors,o={};Ce.skin(n,function(r,s){let a=i[r.inverseBindMatrices],c;M.equals(r.bindShapeMatrix,M.IDENTITY)||(c=M.clone(r.bindShapeMatrix)),o[s]={inverseBindMatrices:zU.getSkinInverseBindMatrices(e,a),bindShapeMatrix:c}}),JLt(e,o)}function tNt(e,t,n,i){return function(o){l(i)&&(o=e.clampAnimations?i.clampTime(o):i.wrapTime(o),t[n]=i.evaluate(o,t[n]),t.dirtyNumber=e._maxDirtyNumber)}}function nNt(e){let t=e._loadResources;if(!t.finishedPendingBufferLoads()||!t.createRuntimeAnimations)return;t.createRuntimeAnimations=!1,e._runtime.animations=[];let n=e._runtime.nodes,i=e.gltfInternal.accessors;Ce.animation(e.gltfInternal,function(o,r){let s=o.channels,a=o.samplers,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=s.length,d=new Array(f);for(let p=0;p<f;++p){let _=s[p],m=_.target,y=m.path,b=a[_.sampler],x=zU.getAnimationParameterValues(e,i[b.input]),T=zU.getAnimationParameterValues(e,i[b.output]);c=Math.min(c,x[0]),u=Math.max(u,x[x.length-1]);let C=zU.getAnimationSpline(e,r,o,_.sampler,b,x,y,T);d[p]=tNt(e,n[m.node],m.path,C)}e._runtime.animations[r]={name:o.name,startTime:c,stopTime:u,channelEvaluators:d}})}function NIe(e,t){let n=e._loadResources;if(!n.finishedBuffersCreation()||!n.finishedProgramCreation()||!n.createVertexArrays)return;n.createVertexArrays=!1;let i=e._rendererResources.buffers,o=e._rendererResources.vertexArrays,r=e.gltfInternal,s=r.accessors;Ce.mesh(r,function(a,c){Ce.meshPrimitive(a,function(u,f){let d=[],p,_=QLt(e,u),m=e._decodedData[`${c}.primitive.${f}`];Ce.meshPrimitiveAttribute(u,function(C,A){if(p=_[A],l(p)){if(l(m)){let R=m.attributes;if(R.hasOwnProperty(A)){let P=R[A];d.push({index:p,vertexBuffer:i[P.bufferView],componentsPerAttribute:P.componentsPerAttribute,componentDatatype:P.componentDatatype,normalize:P.normalized,offsetInBytes:P.byteOffset,strideInBytes:P.byteStride});return}}let S=s[C],w=l(S.normalized)&&S.normalized;d.push({index:p,vertexBuffer:i[S.bufferView],componentsPerAttribute:Pu(S.type),componentDatatype:S.componentType,normalize:w,offsetInBytes:S.byteOffset,strideInBytes:Lf(r,S)})}});let y,b,x=e._precreatedAttributes;if(l(x))for(b in x)x.hasOwnProperty(b)&&(p=_[b],l(p)&&(y=x[b],y.index=p,d.push(y)));let T;if(l(u.indices)){let A=s[u.indices].bufferView;l(m)&&(A=m.bufferView),T=i[A]}o[`${c}.primitive.${f}`]=new qn({context:t,attributes:d,indexBuffer:T})})})}function iNt(e){let t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,Ce.material(e.gltfInternal,function(n,i){oNt(e,n,i)}))}function oNt(e,t,n){let i=e._rendererResources.renderStates,o=[q.FUNC_ADD,q.FUNC_ADD],r=[q.ONE,q.ONE_MINUS_SRC_ALPHA,q.ONE,q.ONE_MINUS_SRC_ALPHA];l(t.extensions)&&l(t.extensions.KHR_blend)&&(o=t.extensions.KHR_blend.blendEquation,r=t.extensions.KHR_blend.blendFactors);let s=!t.doubleSided,a=t.alphaMode==="BLEND";i[n]=ze.fromCache({cull:{enabled:s},depthTest:{enabled:!0,func:nIe.LESS_OR_EQUAL},depthMask:!a,blending:{enabled:a,equationRgb:o[0],equationAlpha:o[1],functionSourceRgb:r[0],functionDestinationRgb:r[1],functionSourceAlpha:r[2],functionDestinationAlpha:r[3]}})}var rNt={MODEL:function(e,t,n){return function(){return n.computedMatrix}},VIEW:function(e,t,n){return function(){return e.view}},PROJECTION:function(e,t,n){return function(){return e.projection}},MODELVIEW:function(e,t,n){let i=new M;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,n){let i=new M;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i),M.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,n){let i=new M;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i),M.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,n){let i=new M;return function(){return M.inverse(n.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,n){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,n){let i=new M,o=new M;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i),M.inverse(i,o)}},MODELVIEWPROJECTIONINVERSE:function(e,t,n){let i=new M,o=new M;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i),M.multiply(e._projection,i,i),M.inverse(i,o)}},MODELINVERSETRANSPOSE:function(e,t,n){let i=new M,o=new Z;return function(){return M.inverse(n.computedMatrix,i),M.getMatrix3(i,o),Z.transpose(o,o)}},MODELVIEWINVERSETRANSPOSE:function(e,t,n){let i=new M,o=new M,r=new Z;return function(){return M.multiplyTransformation(e.view,n.computedMatrix,i),M.inverse(i,o),M.getMatrix3(o,r),Z.transpose(r,r)}},VIEWPORT:function(e,t,n){return function(){return e.viewportCartesian4}}};function sNt(e,t,n,i){let o=t._runtime.nodes[e];return rNt[n](i,t,o)}function aNt(e,t,n,i,o,r,s){let a={},c={},u,f;return Ce.techniqueUniform(n,function(d,p){let _;if(l(i)&&l(i[p]))_=wi.createUniformFunction(d.type,i[p],r,s),a[p]=_.func,c[p]=_;else if(l(d.node))a[p]=sNt(d.node,e,d.semantic,o.uniformState);else if(l(d.semantic))if(d.semantic==="JOINTMATRIX")u=p;else if(d.semantic==="MORPHWEIGHTS")f=p;else if(d.semantic==="ALPHACUTOFF"){let m=t.alphaMode;if(l(m)&&m==="MASK"){let y=Oe(t.alphaCutoff,.5);_=wi.createUniformFunction(d.type,y,r,s),a[p]=_.func,c[p]=_}}else a[p]=wi.getGltfSemanticUniforms()[d.semantic](o.uniformState,e);else if(l(d.value)){let m=wi.createUniformFunction(d.type,d.value,r,s);a[p]=m.func,c[p]=m}}),{map:a,values:c,jointMatrixUniformName:u,morphWeightsUniformName:f}}function cNt(e,t){let n=e._loadResources;if(!n.finishedProgramCreation()||!n.createUniformMaps)return;n.createUniformMaps=!1;let i=e.gltfInternal,o=e._sourceTechniques,r=e._uniformMaps,s=e._rendererResources.textures,a=e._defaultTexture;Ce.material(i,function(c,u){let f=e._runtime.materialsById[u],d=o[f._technique],p=f._values,_=aNt(e,c,d,p,t,s,a),m=r[u];if(m.uniformMap=_.map,m.values=_.values,m.jointMatrixUniformName=_.jointMatrixUniformName,m.morphWeightsUniformName=_.morphWeightsUniformName,l(d.attributes.a_outlineCoordinates)){let y=ete.createTexture(e,t);m.uniformMap.u_outlineTexture=function(){return y}}})}function lNt(e){return wi.createUniformsForDracoQuantizedAttributes(e.attributes)}function uNt(e,t){let n=bte(e,t),i=e._quantizedUniforms[n];return wi.createUniformsForQuantizedAttributes(e.gltfInternal,t,i)}function fNt(e){return function(){return e}}function dNt(e){return function(){return e.computedJointMatrices}}function hNt(e){return function(){return e.weights}}function mNt(e){return function(){return e.silhouetteColor}}function pNt(e){return function(){return e.silhouetteSize}}function _Nt(e){return function(){return e.color}}function gNt(e){return function(){return e._clippingPlanesMatrix}}function yNt(e){return function(){return e._iblReferenceFrameMatrix}}function bNt(e){return function(){let t=e.clippingPlanes;return!l(t)||!t.enabled?e._defaultTexture:t.texture}}function xNt(e){return function(){let t=e.clippingPlanes;if(!l(t))return H.WHITE.withAlpha(0);let n=H.clone(t.edgeColor);return n.alpha=t.edgeWidth,n}}function TNt(e){return function(){return M6.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function CNt(e){return function(){return e._imageBasedLighting.imageBasedLightingFactor}}function ANt(e){return function(){return e._lightColor}}function ENt(e){return function(){return e._imageBasedLighting.luminanceAtZenith}}function SNt(e){return function(){return e._imageBasedLighting.sphericalHarmonicCoefficients}}function vNt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture}}function wNt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions}}function INt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel}}function PNt(e,t){switch(e.mode){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function DNt(e,t,n,i,o){let r=e._nodeCommands,s=e._pickIds,a=e.allowPicking,c=e._runtime.meshesByName,u=e._rendererResources,f=u.vertexArrays,d=u.programs,p=u.renderStates,_=e._uniformMaps,m=e.gltfInternal,y=m.accessors,b=m.meshes,x=t.mesh,T=b[x],C=T.primitives,A=C.length;for(let S=0;S<A;++S){let w=C[S],R=y[w.indices],O=e._runtime.materialsById[w.material]._program,L=e._decodedData[`${x}.primitive.${S}`],g,E=w.attributes.POSITION;if(l(E)){let ge=wi.getAccessorMinMax(m,E);g=re.fromCornerPoints(h.fromArray(ge.min),h.fromArray(ge.max))}let v=f[`${x}.primitive.${S}`],I,N;l(L)?(N=L.numberOfIndices,I=0):l(R)?(N=R.count,I=R.byteOffset/ke.getSizeInBytes(R.componentType)):(N=y[w.attributes.POSITION].count,I=0),e._trianglesLength+=PNt(w,N),w.mode===Le.POINTS&&(e._pointsLength+=N);let F=_[w.material],U=F.uniformMap;if(l(F.jointMatrixUniformName)){let ge={};ge[F.jointMatrixUniformName]=dNt(n),U=ct(U,ge)}if(l(F.morphWeightsUniformName)){let ge={};ge[F.morphWeightsUniformName]=hNt(n),U=ct(U,ge)}U=ct(U,{gltf_color:_Nt(e),gltf_colorBlend:TNt(e),gltf_clippingPlanes:bNt(e),gltf_clippingPlanesEdgeStyle:xNt(e),gltf_clippingPlanesMatrix:gNt(e),gltf_iblReferenceFrameMatrix:yNt(e),gltf_iblFactor:CNt(e),gltf_lightColor:ANt(e),gltf_sphericalHarmonicCoefficients:SNt(e),gltf_specularMap:vNt(e),gltf_specularMapSize:wNt(e),gltf_maxSpecularLOD:INt(e),gltf_luminanceAtZenith:ENt(e)}),rte.addUniforms(e,U),l(e._uniformMapLoaded)&&(U=e._uniformMapLoaded(U,O,n));let k={};e.extensionsUsed.WEB3D_quantized_attributes?k=uNt(e,w):e._dequantizeInShader&&l(L)&&(k=lNt(L)),U=ct(U,k);let z=p[w.material],B=z.blending.enabled,j=e._pickObject;l(j)||(j={primitive:e,id:e.id,node:n.publicNode,mesh:c[T.name]});let W=Wp.castShadows(e._shadows),J=Wp.receiveShadows(e._shadows),Y;if(a&&!l(e._uniformMapLoaded)){Y=i.createPickId(j),s.push(Y);let ge={czm_pickColor:fNt(Y.color)};U=ct(U,ge)}a&&(l(e._pickIdLoaded)&&l(e._uniformMapLoaded)?Y=e._pickIdLoaded():Y="czm_pickColor");let ee=new qe({boundingVolume:new re,cull:e.cull,modelMatrix:new M,primitiveType:w.mode,vertexArray:v,count:N,offset:I,shaderProgram:d[O],castShadows:W,receiveShadows:J,uniformMap:U,renderState:z,owner:j,pass:B?Se.TRANSLUCENT:e.opaquePass,pickId:Y}),Q;o||(Q=qe.shallowClone(ee),Q.boundingVolume=new re,Q.modelMatrix=new M);let de={show:!0,boundingSphere:g,command:ee,command2D:Q,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:O};n.commands.push(de),r.push(de)}}function RNt(e,t,n){let i=e._loadResources;if(!i.finishedEverythingButTextureCreation()||!i.createRuntimeNodes)return;i.createRuntimeNodes=!1;let o=[],r=e._runtime.nodes,s=e.gltfInternal,a=s.nodes,u=s.scenes[s.scene].nodes,f=u.length,d=[],p={};for(let _=0;_<f;++_)for(d.push({parentRuntimeNode:void 0,gltfNode:a[u[_]],id:u[_]});d.length>0;){let m=d.pop();p[m.id]=!0;let y=m.parentRuntimeNode,b=m.gltfNode,x=r[m.id];if(x.parents.length===0)if(l(b.matrix))x.matrix=M.fromColumnMajorArray(b.matrix);else{let C=b.rotation;x.translation=h.fromArray(b.translation),x.rotation=Pe.unpack(C),x.scale=h.fromArray(b.scale)}l(y)?(y.children.push(x),x.parents.push(y)):o.push(x),l(b.mesh)&&DNt(e,b,x,t,n);let T=b.children;if(l(T)){let C=T.length;for(let A=0;A<C;A++){let S=T[A];p[S]||d.push({parentRuntimeNode:x,gltfNode:a[S],id:T[A]})}}}e._runtime.rootNodes=o,e._runtime.nodes=r}function ONt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function MNt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function FIe(e,t){let n=t.context,i=t.scene3DOnly,o=e._quantizedVertexShaders,r=e._sourceTechniques,s=e._sourcePrograms,a=e._rendererResources,c=a.sourceShaders;e._loadRendererResourcesFromCache&&(c=a.sourceShaders=e._cachedRendererResources.sourceShaders);for(let u in r)if(r.hasOwnProperty(u)){let f=r[u].program,d=s[f],p=c[d.vertexShader];if(wi.checkSupportedGlExtensions(d.glExtensions,n),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){let _=o[f];l(_)||(_=YIe(p,f,e),o[f]=_),p=_}p=WU(p,f,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){let u=e._cachedRendererResources;a.buffers=u.buffers,a.vertexArrays=u.vertexArrays,a.programs=u.programs,a.silhouettePrograms=u.silhouettePrograms,a.textures=u.textures,a.samplers=u.samplers,a.renderStates=u.renderStates,l(e._precreatedAttributes)&&NIe(e,n),e._cachedGeometryByteLength+=ONt(u.buffers),e._cachedTexturesByteLength+=MNt(u.textures)}else jLt(e,t),YLt(e,t),$Lt(e,n),KLt(e),ZLt(e,t);eNt(e),nNt(e),e._loadRendererResourcesFromCache||(NIe(e,n),iNt(e)),cNt(e,n),RNt(e,n,i)}function BIe(e,t){let n=e.publicNode,i=n.matrix;n.useMatrix&&l(i)?M.clone(i,t):l(e.matrix)?M.clone(e.matrix,t):(M.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),n.setMatrix(t))}var ZIe=[],LNt=new ie,lte=new M;function NNt(e,t,n,i){let o=e._maxDirtyNumber,r=e._runtime.rootNodes,s=r.length,a=ZIe,c=e._computedModelMatrix;if(e._mode!==Kd.SCENE3D&&!e._ignoreCommands){let u=M.getColumn(c,3,LNt);if(!ie.equals(u,ie.UNIT_W))c=At.basisTo2D(i,c,lte),e._rtcCenter=e._rtcCenter3D;else{let f=e.boundingSphereInternal.center,d=At.wgs84To2DModelMatrix(i,f,lte);c=M.multiply(d,c,lte),l(e._rtcCenter)&&(M.setTranslation(c,ie.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)}}for(let u=0;u<s;++u){let f=r[u];for(BIe(f,f.transformToRoot),a.push(f);a.length>0;){f=a.pop();let d=f.transformToRoot,p=f.commands;if(f.dirtyNumber===o||t||n){let m=M.multiplyTransformation(c,d,f.computedMatrix),y=p.length;if(y>0)for(let b=0;b<y;++b){let x=p[b],T=x.command;M.clone(m,T.modelMatrix),re.transform(x.boundingSphere,T.modelMatrix,T.boundingVolume),l(e._rtcCenter)&&h.add(e._rtcCenter,T.boundingVolume.center,T.boundingVolume.center),T=x.command2D,l(T)&&e._mode===Kd.SCENE2D&&(M.clone(m,T.modelMatrix),T.modelMatrix[13]-=D.sign(T.modelMatrix[13])*2*D.PI*i.ellipsoid.maximumRadius,re.transform(x.boundingSphere,T.modelMatrix,T.boundingVolume))}}let _=f.children;if(l(_)){let m=_.length;for(let y=0;y<m;++y){let b=_[y];b.dirtyNumber=Math.max(b.dirtyNumber,f.dirtyNumber),(b.dirtyNumber===o||n)&&(BIe(b,b.transformToRoot),M.multiplyTransformation(d,b.transformToRoot,b.transformToRoot)),a.push(b)}}}}++e._maxDirtyNumber}var ute=new M;function FNt(e){let t=e._runtime.skinnedNodes,n=t.length;for(let i=0;i<n;++i){let o=t[i];ute=M.inverseTransformation(o.transformToRoot,ute);let r=o.computedJointMatrices,s=o.joints,a=o.bindShapeMatrix,c=o.inverseBindMatrices,u=c.length;for(let f=0;f<u;++f)l(r[f])||(r[f]=new M),r[f]=M.multiplyTransformation(ute,s[f].transformToRoot,r[f]),r[f]=M.multiplyTransformation(r[f],c[f],r[f]),l(a)&&(r[f]=M.multiplyTransformation(r[f],a,r[f]))}}function BNt(e){let t=e._runtime.rootNodes,n=t.length,i=ZIe;for(let o=0;o<n;++o){let r=t[o];for(r.computedShow=r.publicNode.show,i.push(r);i.length>0;){r=i.pop();let s=r.computedShow,a=r.commands,c=a.length;for(let f=0;f<c;++f)a[f].show=s;let u=r.children;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d];p.computedShow=s&&p.publicNode.show,i.push(p)}}}}}function kNt(e,t){let n=e.id;if(e._id!==n){e._id=n;let i=e._pickIds,o=i.length;for(let r=0;r<o;++r)i[r].object.id=n}}function UNt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;let t=e.debugWireframe?Le.LINES:Le.TRIANGLES,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.primitiveType=t}}function zNt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let t=e.debugShowBoundingVolume,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.debugShowBoundingVolume=t}}function VNt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;let t=Wp.castShadows(e.shadows),n=Wp.receiveShadows(e.shadows),i=e._nodeCommands,o=i.length;for(let r=0;r<o;r++){let s=i[r];s.command.castShadows=t,s.command.receiveShadows=n}}}function HNt(e,t){let n=Fe(t,!0);return n.cull.enabled=!1,n.depthTest.enabled=!0,n.depthMask=!1,n.blending=jee.ALPHA_BLEND,e.opaquePass===Se.CESIUM_3D_TILE&&(n.stencilTest=ate.setCesium3DTileBit(),n.stencilMask=ate.CESIUM_3D_TILE_MASK),ze.fromCache(n)}function kIe(e,t){let n=qe.shallowClone(t);return n.pass=Se.TRANSLUCENT,n.renderState=HNt(e,t.renderState),n}function QIe(e,t,n){let i=t.scene3DOnly,o=e.color.alpha;if(o>0&&o<1){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].translucentCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.translucentCommand=kIe(e,u),!i){let f=c.command2D;c.translucentCommand2D=kIe(e,f)}}}}function GNt(e){let t=Fe(e,!0);return t.cull.enabled=!1,ze.fromCache(t)}function UIe(e){let t=qe.shallowClone(e);return t.renderState=GNt(e.renderState),t}function JIe(e,t,n){let i=t.scene3DOnly;if(!e.backFaceCulling){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].disableCullingCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.disableCullingCommand=UIe(u),!i){let f=c.command2D;c.disableCullingCommand2D=UIe(f)}}}}function jNt(e,t){let n=e._rendererResources.programs;for(let i in n)if(n.hasOwnProperty(i)&&n[i]===t)return i}function WNt(e,t,n){let i=t.vertexShaderSource.sources[0],o=t._attributeLocations,r=e._normalAttributeName;return i=Be.replaceMain(i,"gltf_silhouette_main"),i+=`uniform float gltf_silhouetteSize; -void main() -{ - gltf_silhouette_main(); - vec3 n = normalize(czm_normal3D * ${r}); - n.x *= czm_projection[0][0]; - n.y *= czm_projection[1][1]; - vec4 clip = gl_Position; - clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; - gl_Position = clip; -}`,Xt.fromCache({context:n.context,vertexShaderSource:i,fragmentShaderSource:`uniform vec4 gltf_silhouetteColor; -out vec4 fragColor; -void main() -{ - fragColor = czm_gammaCorrect(gltf_silhouetteColor); -}`,attributeLocations:o})}function ePe(e,t){return HIe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&l(e._normalAttributeName)}function qNt(e){let t=e._nodeCommands,n=t.length;for(let i=0;i<n;++i)if(t[i].command.pass===Se.TRANSLUCENT)return!0;return!1}function dte(e){return e.color.alpha>0&&e.color.alpha<1}function tPe(e){return e.color.alpha===0}function zIe(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var YNt=0;function XNt(e,t){let n=++YNt%255,i=qNt(e)||dte(e)||e.silhouetteColor.alpha<1,o=e._rendererResources.silhouettePrograms,r=t.scene3DOnly,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=u.command,d=dte(e)?u.translucentCommand:f,p=qe.shallowClone(d),_=Fe(d.renderState);_.stencilTest={enabled:!0,frontFunction:q.ALWAYS,backFunction:q.ALWAYS,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE}},tPe(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=ze.fromCache(_),p.renderState=_,u.silhouetteModelCommand=p;let m=qe.shallowClone(f);_=Fe(f.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,i&&(m.pass=Se.TRANSLUCENT,_.depthMask=!1,_.blending=jee.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:q.NOTEQUAL,backFunction:q.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP}},_=ze.fromCache(_);let y=f.shaderProgram,b=jNt(e,y),x=o[b];l(x)||(x=WNt(e,y,t),o[b]=x);let T=ct(f.uniformMap,{gltf_silhouetteColor:mNt(e),gltf_silhouetteSize:pNt(e)});if(m.renderState=_,m.shaderProgram=x,m.uniformMap=T,m.castShadows=!1,m.receiveShadows=!1,u.silhouetteColorCommand=m,!r){let C=u.command2D,A=qe.shallowClone(p);A.boundingVolume=C.boundingVolume,A.modelMatrix=C.modelMatrix,u.silhouetteModelCommand2D=A;let S=qe.shallowClone(m);A.boundingVolume=C.boundingVolume,A.modelMatrix=C.modelMatrix,u.silhouetteColorCommand2D=S}}}function KNt(e,t,n){return e=Be.replaceMain(e,"gltf_clip_main"),e+=`${Ha._getClippingFunction(t,n)} -`,e+=`uniform highp sampler2D gltf_clippingPlanes; -uniform mat4 gltf_clippingPlanesMatrix; -uniform vec4 gltf_clippingPlanesEdgeStyle; -void main() -{ - gltf_clip_main(); -${rIe("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")}} -`,e}function nPe(e,t,n){if(!ePe(e,t))return;let i=e._nodeCommands,o=i.length>0&&(zIe(e.color.alpha,e._colorPreviousAlpha)||zIe(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!l(i[0].silhouetteModelCommand));e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(o||n)&&XNt(e,t)}function $Nt(e,t){let n=e._clippingPlanes;l(n)&&n.owner===e&&n.enabled&&n.update(t)}var fte=new re;function ZNt(e,t,n){return fte.center=e,fte.radius=t,n.camera.getPixelSize(fte,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Va=new h,HU=new fe;function QNt(e,t){let n=e.scale;if(e.minimumPixelSize!==0){let i=t.context,o=Math.max(i.drawingBufferWidth,i.drawingBufferHeight),r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Va.x=r[12],Va.y=r[13],Va.z=r[14],l(e._rtcCenter)&&h.add(e._rtcCenter,Va,Va),e._mode!==Kd.SCENE3D){let f=t.mapProjection,d=f.ellipsoid.cartesianToCartographic(Va,HU);f.project(d,Va),h.fromElements(Va.z,Va.x,Va.y,Va)}let s=e.boundingSphereInternal.radius,a=ZNt(Va,s,t),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(n=e.minimumPixelSize*a/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,n):n}function iPe(e){l(e._cacheKey)&&l(e._cachedGltf)&&--e._cachedGltf.count===0&&delete Ub[e._cacheKey],e._cachedGltf=void 0}function hte(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function kb(e){for(let t in e)e.hasOwnProperty(t)&&e[t].destroy()}function JNt(e){kb(e.buffers),kb(e.vertexArrays),kb(e.programs),kb(e.silhouettePrograms),kb(e.textures)}hte.prototype.release=function(){if(--this.count===0)return l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],JNt(this),ce(this)};function VIe(e,t,n){return function(i){if(e.heightReference===rI.RELATIVE_TO_GROUND){let r=t.cartesianToCartographic(i,HU);r.height+=n.height,t.cartographicToCartesian(r,i)}let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function eFt(e){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===rI.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,o=e.modelMatrix;Va.x=o[12],Va.y=o[13],Va.z=o[14];let r=i.cartesianToCartographic(Va);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(o,new M));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(r,VIe(e,i,r));let a=n.getHeight(r);if(l(a)){let c=VIe(e,i,r);fe.clone(r,HU),HU.height=a,i.cartographicToCartesian(HU,Va),c(Va)}}var tFt=new h,nFt=new fe;function iFt(e,t){let n,i=e.distanceDisplayCondition,o=i.near*i.near,r=i.far*i.far;if(t.mode===Kd.SCENE2D)n=(t.camera.frustum.right-t.camera.frustum.left)*.5,n=n*n;else{let s=M.getTranslation(e.modelMatrix,tFt);if(t.mode===Kd.COLUMBUS_VIEW){let a=t.mapProjection,u=a.ellipsoid.cartesianToCartographic(s,nFt);s=a.project(u,s),h.fromElements(s.z,s.x,s.y,s)}n=h.distanceSquared(s,t.camera.positionWC)}return n>=o&&n<=r}var oFt=new M,rFt=new Z,sFt=new M;Ha.prototype.update=function(e){if(e.mode===Kd.MORPHING)return;if(!Nt.supportsWebP.initialized){Nt.supportsWebP.initialize();return}let t=e.context;this._defaultTexture=t.defaultTexture;let n=Nt.supportsWebP();if(this._state===Bb.NEEDS_LOAD&&l(this.gltfInternal)){let x,T=this.cacheKey;if(l(T)){t.cache.modelRendererResourceCache=Oe(t.cache.modelRendererResourceCache,{});let C=t.cache.modelRendererResourceCache;if(x=C[this.cacheKey],l(x)){if(!x.ready)return;++x.count,this._loadRendererResourcesFromCache=!0}else x=new hte(t,T),x.count=1,C[this.cacheKey]=x;this._cachedRendererResources=x}else x=new hte(t),x.count=1,this._cachedRendererResources=x;if(this._state=Bb.LOADING,this._state!==Bb.FAILED){let C=this.gltfInternal.extensions;if(l(C)&&l(C.CESIUM_RTC)){let A=h.fromArray(C.CESIUM_RTC.center);if(!h.equals(A,h.ZERO)){this._rtcCenter3D=A;let S=e.mapProjection,R=S.ellipsoid.cartesianToCartographic(this._rtcCenter3D),P=S.project(R);h.fromElements(P.z,P.x,P.y,P),this._rtcCenter2D=P,this._rtcCenterEye=new h,this._rtcCenter=this._rtcCenter3D}}FU(this.gltfInternal),this._loadResources=new yIe,this._loadRendererResourcesFromCache||wi.parseBuffers(this,DLt)}}let i=this._loadResources,o=this._incrementallyLoadTextures,r=!1;if(this._state===Bb.LOADING){if(i.pendingBufferLoads===0){if(!i.initialized){if(e.brdfLutGenerator.update(e),wi.checkSupportedExtensions(this.extensionsRequired,n),wi.updateForwardAxis(this),!l(this.gltfInternal.extras.sourceVersion)){let x=this.gltfInternal,T=wi.getAssetVersion(x),C=l(wi.getUsedExtensions(x).KHR_techniques_webgl);T!=="2.0"&&Po("gltf-1.0","glTF 1.0 assets were deprecated in CesiumJS 1.94. They will be removed in 1.97. Please convert any glTF 1.0 assets to glTF 2.0."),C&&Po("KHR_techniques_webgl","Support for glTF 1.0 techniques and the KHR_techniques_webgl glTF extension were deprecated in CesiumJS 1.94. It will be removed in 1.97. If custom GLSL shaders are needed, use CustomShader instead."),x.extras.sourceVersion=T,x.extras.sourceKHRTechniquesWebGL=C,this._sourceVersion=T,this._sourceKHRTechniquesWebGL=C,qwe(x),Iwe(x);let A={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};IIe(x,A),PIe(x,A)}this._sourceVersion=this.gltfInternal.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltfInternal.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&oI.hasExtension(this),PLt(this),FLt(this),OLt(this),this._loadRendererResourcesFromCache||(RLt(this),LLt(this),NLt(this),kLt(this,t,n)),VLt(this),HLt(this),zLt(this),GLt(this),oI.parse(this,t),i.initialized=!0}i.finishedDecoding()||oI.decodeModel(this,t).catch(wi.getFailedLoadFunction(this,"model",this.basePathInternal)),i.finishedDecoding()&&!i.resourcesParsed&&(this._boundingSphere=wi.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,oI.cacheDataForModel(this),i.resourcesParsed=!0),i.resourcesParsed&&i.pendingShaderLoads===0&&(this.showOutline&&ete.outlinePrimitives(this),FIe(this,e))}(i.finished()||o&&i.finishedEverythingButTextureCreation())&&(this._state=Bb.LOADED,r=!0)}if(l(i)&&this._state===Bb.LOADED&&(o&&!r&&FIe(this,e),i.finished())){this._loadResources=void 0;let x=this._rendererResources,T=this._cachedRendererResources;T.buffers=x.buffers,T.vertexArrays=x.vertexArrays,T.programs=x.programs,T.sourceShaders=x.sourceShaders,T.silhouettePrograms=x.silhouettePrograms,T.textures=x.textures,T.samplers=x.samplers,T.renderStates=x.renderStates,T.ready=!0,this._normalAttributeName=wi.getAttributeOrUniformBySemantic(this.gltfInternal,"NORMAL"),l(this._precreatedAttributes)&&(T.vertexArrays={}),this.releaseGltfJson&&iPe(this)}let s=ePe(this,e),a=dte(this),c=tPe(this),u=this.backFaceCulling,f=l(this.distanceDisplayCondition)?iFt(this,e):!0,d=this.show&&f&&this.scale!==0&&(!c||s);if(this._imageBasedLighting.update(e),d&&this._state===Bb.LOADED||r){let x=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;let T=this.modelMatrix,C=e.mode!==this._mode;this._mode=e.mode;let A=!M.equals(this._modelMatrix,T)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||this.minimumPixelSize!==0||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||C;if(A||r){M.clone(T,this._modelMatrix),eFt(this),l(this._clampedModelMatrix)&&(T=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;let L=QNt(this,e),g=this._computedModelMatrix;M.multiplyByUniformScale(T,L,g),this._upAxis===dc.Y?M.multiplyTransformation(g,dc.Y_UP_TO_Z_UP,g):this._upAxis===dc.X&&M.multiplyTransformation(g,dc.X_UP_TO_Z_UP,g),this.forwardAxis===dc.Z&&M.multiplyTransformation(g,dc.Z_UP_TO_X_UP,g)}(x||A||r)&&(NNt(this,A,r,e.mapProjection),this._dirty=!0,(x||r)&&FNt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,BNt(this)),kNt(this,t),UNt(this),zNt(this),VNt(this),$Nt(this,e);let S=this._clippingPlanes,w=0,R=Oe(this.referenceMatrix,T);if(this._imageBasedLighting.useSphericalHarmonicCoefficients||this._imageBasedLighting.useSpecularEnvironmentMaps){let L=rFt,g=oFt;g=M.multiply(t.uniformState.view3D,R,g),L=M.getMatrix3(g,L),L=Z.getRotation(L,L),this._iblReferenceFrameMatrix=Z.transpose(L,this._iblReferenceFrameMatrix)}if(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLighting.shouldRegenerateShaders,_te(this)){let L=sFt;L=M.multiply(t.uniformState.view3D,R,L),L=M.multiply(L,S.modelMatrix,L),this._clippingPlanesMatrix=M.inverseTranspose(L,this._clippingPlanesMatrix),w=S.clippingPlanesState}this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._clippingPlanesState!==w,this._clippingPlanesState=w;let P=pte(this);P!==this._colorShadingEnabled&&(this._colorShadingEnabled=P,this._shouldRegenerateShaders=!0);let O=this.splitDirection!==UA.NONE;this._splittingEnabled!==O&&(this._splittingEnabled=O,this._shouldRegenerateShaders=!0),this._shouldRegenerateShaders?aFt(this,e):(QIe(this,e,!1),JIe(this,e,!1),nPe(this,e,!1))}if(r){let x=this;e.afterRender.push(function(){x._ready=!0,x._readyPromise.resolve(x)});return}if(d&&!this._ignoreCommands){let x=e.commandList,T=e.passes,C=this._nodeCommands,A=C.length,S,w,R=e.mapProjection.ellipsoid.maximumRadius*D.PI,P;if(T.render||T.pick&&this.allowPicking){for(S=0;S<A;++S)if(w=C[S],w.show){let O=w.command;s?O=w.silhouetteModelCommand:a?O=w.translucentCommand:u||(O=w.disableCullingCommand),x.push(O),P=w.command.boundingVolume;let L=P.center.y-P.radius,g=P.center.y+P.radius,E=L<R&&g>R||L<-R&&g>-R;if(e.mode===Kd.SCENE2D&&E){let v=w.command2D;s?v=w.silhouetteModelCommand2D:a?v=w.translucentCommand2D:u||(v=w.disableCullingCommand2D),x.push(v)}}if(s&&!T.pick){for(S=0;S<A;++S)if(w=C[S],w.show){x.push(w.silhouetteColorCommand),P=w.command.boundingVolume;let O=P.center.y-P.radius,L=P.center.y+P.radius,g=O<R&&L>R||O<-R&&L>-R;e.mode===Kd.SCENE2D&&g&&x.push(w.silhouetteColorCommand2D)}}}}let p=this._credit;l(p)&&e.creditDisplay.addCredit(p);let _=this._resourceCredits,m=_.length;for(let x=0;x<m;x++)e.creditDisplay.addCredit(_[x]);let y=this._gltfCredits,b=y.length;for(let x=0;x<b;x++)e.creditDisplay.addCredit(y[x])};function oPe(e,t){e.programs!==t.programs&&kb(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&kb(e.silhouettePrograms)}function aFt(e,t){let n=e._rendererResources,i=e._cachedRendererResources;oPe(n,i);let o;if(_te(e)||pte(e)||e.splitDirection!==UA.NONE||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,n.programs={},n.silhouettePrograms={};let c={},u=e._sourceTechniques,f;for(let d in u)u.hasOwnProperty(d)&&(f=u[d],o=f.program,c[o]||(c[o]=!0,qLt({programId:o,techniqueId:d},e,t.context)))}else n.programs=i.programs,n.silhouettePrograms=i.silhouettePrograms;let r=n.programs,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c];o=u.programId;let f=r[o];u.command.shaderProgram=f,l(u.command2D)&&(u.command2D.shaderProgram=f)}QIe(e,t,!0),JIe(e,t,!0),nPe(e,t,!0)}Ha.prototype.isDestroyed=function(){return!1};Ha.prototype.destroy=function(){l(this._precreatedAttributes)&&kb(this._rendererResources.vertexArrays),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),l(this._cachedRendererResources)&&oPe(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),oI.destroyCachedDataForModel(this);let e=this._pickIds,t=e.length;for(let i=0;i<t;++i)e[i].destroy();iPe(this),this._quantizedVertexShaders=void 0;let n=this._clippingPlanes;return l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ce(this)};Ha._getClippingFunction=sIe;Ha._modifyShaderForColor=WLt;var Cte=Ha;function rPe(e,t,n){this.primitive=e,this._modelMatrix=M.clone(t),this._instanceId=n}Object.defineProperties(rPe.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return M.clone(this._modelMatrix)},set:function(e){M.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var sPe=rPe;var VA={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function uI(e){e=Oe(e,Oe.EMPTY_OBJECT),this.show=Oe(e.show,!0),this._instancingSupported=!1,this._dynamic=Oe(e.dynamic,!1),this._allowPicking=Oe(e.allowPicking,!0),this._ready=!1,this._readyPromise=Zs(),this._state=VA.NEEDS_LOAD,this._dirty=!1,this._cull=Oe(e.cull,!0),this._opaquePass=Oe(e.opaquePass,Se.OPAQUE),this._instances=cFt(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=lFt(this),this._center=h.clone(this._boundingSphere.center),this._rtcTransform=new M,this._rtcModelView=new M,this._mode=void 0,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._url=Ee.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=Ee.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=Oe(e.shadows,Wp.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.splitDirection=Oe(e.splitDirection,UA.NONE),this.debugShowBoundingVolume=Oe(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Oe(e.debugWireframe,!1),this._debugWireframe=!1,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new C6,this._shouldDestroyImageBasedLighting=!0),this.backFaceCulling=Oe(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling,this.showCreditsOnScreen=Oe(e.showCreditsOnScreen,!1)}Object.defineProperties(uI.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},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)}}});function cFt(e,t){t=Oe(t,[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let r=t[o],s=r.modelMatrix,a=Oe(r.batchId,o);i[o]=new sPe(e,s,a)}return i}function lFt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=M.getTranslation(e._instances[i]._modelMatrix,new h);return re.fromPoints(n)}var uFt=new h,Ate=new M;uI.prototype.expandBoundingSphere=function(e){let t=M.getTranslation(e,uFt);re.expand(this._boundingSphere,t,this._boundingSphere)};function fFt(e,t,n,i){return function(o,r){let s=o.semantic;if(l(s)&&e.indexOf(s)>-1)if(t.indexOf(s)>-1)i[r]=s;else throw new se(`Shader program cannot be optimized for instancing. Uniform "${r}" in program "${n}" uses unsupported semantic "${s}"`)}}function cPe(e,t){if(l(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];let n={};e._instancedUniformsByProgram=n;let i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],o=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],r=e._model._sourceTechniques;for(let s in r)if(r.hasOwnProperty(s)){let a=r[s],c=a.program;if(!l(n[c])){let u={};n[c]=u,Ce.techniqueUniform(a,fFt(i,o,t,u))}}return n[t]}function dFt(e){return function(t,n){let i=cPe(e,n),o=l(e._batchTable),r=Be.replaceMain(t,"czm_instancing_main"),s="",a="";for(let _ in i)if(i.hasOwnProperty(_)){let m=i[_],y;m==="MODELVIEW"||m==="CESIUM_RTC_MODELVIEW"?y="czm_instanced_modelView":m==="MODELVIEWPROJECTION"?(y="czm_instanced_modelViewProjection",s+=`mat4 czm_instanced_modelViewProjection; -`,a+=`czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView; -`):m==="MODELVIEWINVERSETRANSPOSE"&&(y="czm_instanced_modelViewInverseTranspose",s+=`mat3 czm_instanced_modelViewInverseTranspose; -`,a+=`czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView); -`);let b=new RegExp(`uniform.*${_}.*`);r=r.replace(b,""),b=new RegExp(`${_}\\b`,"g"),r=r.replace(b,y)}let c=`uniform mat4 czm_instanced_modifiedModelView; -uniform mat4 czm_instanced_nodeTransform; -`,u,f,d;o?(u=`attribute float a_batchId; -`,f="",d=""):(u="",f=`in vec4 pickColor; -out vec4 v_pickColor; -`,d=` v_pickColor = pickColor; -`);let p=`${c+s}mat4 czm_instanced_modelView; -in vec4 czm_modelMatrixRow0; -in vec4 czm_modelMatrixRow1; -in vec4 czm_modelMatrixRow2; -${u}${f}${r}void main() -{ - mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0); - czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform; -${a} czm_instancing_main(); -${d}} -`;if(o){let _=e._model.gltfInternal,m=wi.getDiffuseAttributeOrUniform(_,n);p=e._batchTable.getVertexShaderCallback(!0,"a_batchId",m)(p)}return p}}function hFt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=wi.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`out vec4 v_pickColor; -${t}`;return t}}function mFt(e,t){return function(){return M.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function pFt(e){return function(){return e.computedMatrix}}function _Ft(e,t){return function(n,i,o){n=Fe(n),n.czm_instanced_modifiedModelView=mFt(e,t),n.czm_instanced_nodeTransform=pFt(o);let r=cPe(e,i);for(let s in r)r.hasOwnProperty(s)&&delete n[s];return l(e._batchTable)&&(n=e._batchTable.getUniformMapCallback()(n)),n}}function gFt(e){return function(t,n){if(l(e._batchTable)){let i=e._model.gltfInternal,o=wi.getDiffuseAttributeOrUniform(i,n);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",o)(t),t=`uniform float a_batchId -;${t}`}return t}}function yFt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=wi.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`uniform vec4 czm_pickColor; -${t}`;return t}}function bFt(e){return function(t){return l(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function lPe(e){let t=e._instances,n=e.length,i=e._center,o=12,r=e._vertexBufferTypedArray;l(r)||(r=new Float32Array(n*o)),e._dynamic&&(e._vertexBufferTypedArray=r);for(let s=0;s<n;++s){let a=t[s]._modelMatrix,c=M.clone(a,Ate);c[12]-=i.x,c[13]-=i.y,c[14]-=i.z;let u=s*o;r[u+0]=c[0],r[u+1]=c[4],r[u+2]=c[8],r[u+3]=c[12],r[u+4]=c[1],r[u+5]=c[5],r[u+6]=c[9],r[u+7]=c[13],r[u+8]=c[2],r[u+9]=c[6],r[u+10]=c[10],r[u+11]=c[14]}return r}function xFt(e,t){let n,i=e._instances,o=e.length,r=e._dynamic,s=l(e._batchTable);if(s){let c=new Uint16Array(o);for(n=0;n<o;++n)c[n]=i[n]._instanceId;e._batchIdBuffer=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}if(!s){let c=new Uint8Array(o*4);for(n=0;n<o;++n){let f=e._pickIds[n].color,d=n*4;c[d]=H.floatToByte(f.red),c[d+1]=H.floatToByte(f.green),c[d+2]=H.floatToByte(f.blue),c[d+3]=H.floatToByte(f.alpha)}e._pickIdBuffer=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}let a=lPe(e);e._vertexBuffer=st.createVertexBuffer({context:t,typedArray:a,usage:r?Ne.STREAM_DRAW:Ne.STATIC_DRAW})}function TFt(e){let t=lPe(e);e._vertexBuffer.copyFromArrayView(t)}function CFt(e,t){let n=e._instances,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createPickId(n[r]);return o}function AFt(e,t){let n=e._instancingSupported;n||Po("cpuModelInstancing","Support for rendering instanced models on the CPU has been deprecated and will be removed in CesiumJS 1.97.");let i=l(e._batchTable),o=e._allowPicking,r={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:o,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLighting:e._imageBasedLighting,showOutline:e.showOutline,showCreditsOnScreen:e.showCreditsOnScreen};if(i||(e._pickIds=CFt(e,t)),n){xFt(e,t);let s=12,a=K.getSizeInBytes(K.FLOAT),c={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*4,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*8,strideInBytes:a*s,instanceDivisor:1}};i&&(c.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),i||(c.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r.precreatedAttributes=c,r.vertexShaderLoaded=dFt(e),r.fragmentShaderLoaded=hFt(e),r.uniformMapLoaded=_Ft(e,t),l(e._url)&&(r.cacheKey=`${e._url.getUrlComponent()}#instanced`)}else r.vertexShaderLoaded=gFt(e),r.fragmentShaderLoaded=yFt(e),r.uniformMapLoaded=bFt(e,t);l(e._url)?e._model=Cte.fromGltf(r):e._model=new Cte(r)}function EFt(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;let n=e.debugWireframe?Le.LINES:Le.TRIANGLES,i=e._drawCommands,o=i.length;for(let r=0;r<o;++r)i[r].primitiveType=n}}function SFt(e){let t=Fe(e,!0);return t.cull.enabled=!1,ze.fromCache(t)}function vFt(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;let n=e._drawCommands,i=n.length,o;if(!l(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(i),e._renderStates=new Array(i),o=0;o<i;++o){let r=n[o].renderState,s=SFt(r);e._disableCullingRenderStates[o]=s,e._renderStates[o]=r}for(o=0;o<i;++o)n[o].renderState=e._backFaceCulling?e._renderStates[o]:e._disableCullingRenderStates[o]}}function wFt(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let n=e._drawCommands,i=n.length;for(let o=0;o<i;++o)n[o].debugShowBoundingVolume=e.debugShowBoundingVolume}}function IFt(e,t){let n=t.length,i=e.length,o=e._boundingSphere,r=e._cull;for(let s=0;s<n;++s){let a=qe.shallowClone(t[s]);a.instanceCount=i,a.boundingVolume=o,a.cull=r,l(e._batchTable)?a.pickId=e._batchTable.getPickId():a.pickId="v_pickColor",e._drawCommands.push(a)}}function PFt(e){return function(){return e}}function DFt(e){return function(){return e}}function RFt(e,t){let n=e._instances,i=t.length,o=e.length,r=e._batchTable,s=l(r),a=e._cull;for(let c=0;c<i;++c)for(let u=0;u<o;++u){let f=qe.shallowClone(t[c]);if(f.modelMatrix=new M,f.boundingVolume=new re,f.cull=a,f.uniformMap=Fe(f.uniformMap),s)f.uniformMap.a_batchId=PFt(n[u]._instanceId);else{let d=e._pickIds[u];f.uniformMap.czm_pickColor=DFt(d.color)}e._drawCommands.push(f)}}function uPe(e){let t=e._modelCommands,n=t.length,i=e.length,o=e._rtcTransform,r=e._center;for(let s=0;s<n;++s){let a=t[s];for(let c=0;c<i;++c){let u=s*i+c,f=e._drawCommands[u],d=M.clone(e._instances[c]._modelMatrix,Ate);d[12]-=r.x,d[13]-=r.y,d[14]-=r.z,d=M.multiply(o,d,Ate);let p=a.modelMatrix,_=f.modelMatrix;M.multiply(d,p,_);let m=a.boundingVolume,y=f.boundingVolume;re.transform(m,d,y)}}}function fPe(e){let t=e._nodeCommands,n=t.length,i=[];for(let o=0;o<n;++o){let r=t[o];r.show&&i.push(r.command)}return i}function OFt(e){let t=e._nodeCommands,n=t.length,i=!1;for(let o=0;o<n;o++){let r=t[o];r.command.dirty&&(r.command.dirty=!1,i=!0)}return i}function aPe(e,t){e._drawCommands=[];let n=fPe(e._model);t?IFt(e,n):(RFt(e,n),uPe(e))}function MFt(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;let n=Wp.castShadows(e.shadows),i=Wp.receiveShadows(e.shadows),o=e._drawCommands,r=o.length;for(let s=0;s<r;++s){let a=o[s];a.castShadows=n,a.receiveShadows=i}}}uI.prototype.update=function(e){if(e.mode===Kd.MORPHING||!this.show||this.length===0)return;let t=e.context;if(this._state===VA.NEEDS_LOAD){this._state=VA.LOADING,this._instancingSupported=t.instancedArrays,AFt(this,t);let p=this;this._model.readyPromise.catch(function(_){p._state=VA.FAILED,p._readyPromise.reject(_)})}let n=this._instancingSupported,i=this._model;if(i.imageBasedLighting=this._imageBasedLighting,i.showCreditsOnScreen=this.showCreditsOnScreen,i.splitDirection=this.splitDirection,i.update(e),i.ready&&this._state===VA.LOADING){this._state=VA.LOADED,this._ready=!0;let p=i.boundingSphereInternal.radius+h.magnitude(i.boundingSphereInternal.center);this._boundingSphere.radius+=p,this._modelCommands=fPe(i),aPe(this,n),this._readyPromise.resolve(this);return}if(this._state!==VA.LOADED)return;let o=e.mode!==this._mode,r=this.modelMatrix,s=!M.equals(this._modelMatrix,r);if(o||s){this._mode=e.mode,M.clone(r,this._modelMatrix);let p=M.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==Kd.SCENE3D&&(p=At.basisTo2D(e.mapProjection,p,p)),M.getTranslation(p,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,TFt(this));let a=OFt(i);a&&aPe(this,n),!n&&(i.dirty||this._dirty||o||s)&&uPe(this),MFt(this,a),EFt(this,a),vFt(this,a),wFt(this,a);let c=e.passes;if(!c.render&&!c.pick)return;let u=e.commandList,f=this._drawCommands,d=f.length;for(let p=0;p<d;++p)u.push(f[p])};uI.prototype.isDestroyed=function(){return!1};uI.prototype.destroy=function(){this._model=this._model&&this._model.destroy();let e=this._pickIds;if(l(e)){let t=e.length;for(let n=0;n<t;++n)e[n].destroy()}return this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ce(this)};var Ete=uI;globalThis.CESIUM_VERSION="1.129";var qU;typeof ko<"u"&&(qU=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(g,E){return g===null||typeof g in y?g===E:!1}function u(g,E){var v;return function(){v||(v=m.a.setTimeout(function(){v=e,g()},E))}}function f(g,E){var v;return function(){clearTimeout(v),v=m.a.setTimeout(g,E)}}function d(g,E){E&&E!=="change"?E==="beforeChange"?this.pc(g):this.gb(g,E):this.qc(g)}function p(g,E){E!==null&&E.s&&E.s()}function _(g,E){var v=this.qd,I=v[A];I.ra||(this.Qb&&this.mb[E]?(v.uc(E,g,this.mb[E]),this.mb[E]=null,--this.Qb):I.I[E]||v.uc(E,g,I.J?{da:g}:v.$c(g)),g.Ja&&g.gd())}var m=typeof s<"u"?s:{};m.b=function(g,E){for(var v=g.split("."),I=m,N=0;N<v.length-1;N++)I=I[v[N]];I[v[v.length-1]]=E},m.L=function(g,E,v){g[E]=v},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function g(Y,ee){for(var Q in Y)N.call(Y,Q)&&ee(Q,Y[Q])}function E(Y,ee){if(ee)for(var Q in ee)N.call(ee,Q)&&(Y[Q]=ee[Q]);return Y}function v(Y,ee){return Y.__proto__=ee,Y}function I(Y,ee,Q,de){var ge=Y[ee].match(W)||[];m.a.D(Q.match(W),function(le){m.a.Na(ge,le,de)}),Y[ee]=ge.join(" ")}var N=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,U=typeof Symbol=="function",k={},z={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(k,function(Y,ee){if(ee.length)for(var Q=0,de=ee.length;Q<de;Q++)z[ee[Q]]=Y});var B={propertychange:!0},j=n&&function(){for(var Y=3,ee=n.createElement("div"),Q=ee.getElementsByTagName("i");ee.innerHTML="<!--[if gt IE "+ ++Y+"]><i></i><![endif]-->",Q[0];);return 4<Y?Y:e}(),W=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(Y,ee,Q){for(var de=0,ge=Y.length;de<ge;de++)ee.call(Q,Y[de],de,Y)},A:typeof Array.prototype.indexOf=="function"?function(Y,ee){return Array.prototype.indexOf.call(Y,ee)}:function(Y,ee){for(var Q=0,de=Y.length;Q<de;Q++)if(Y[Q]===ee)return Q;return-1},Lb:function(Y,ee,Q){for(var de=0,ge=Y.length;de<ge;de++)if(ee.call(Q,Y[de],de,Y))return Y[de];return e},Pa:function(Y,ee){var Q=m.a.A(Y,ee);0<Q?Y.splice(Q,1):Q===0&&Y.shift()},wc:function(Y){var ee=[];return Y&&m.a.D(Y,function(Q){0>m.a.A(ee,Q)&&ee.push(Q)}),ee},Mb:function(Y,ee,Q){var de=[];if(Y)for(var ge=0,le=Y.length;ge<le;ge++)de.push(ee.call(Q,Y[ge],ge));return de},jb:function(Y,ee,Q){var de=[];if(Y)for(var ge=0,le=Y.length;ge<le;ge++)ee.call(Q,Y[ge],ge)&&de.push(Y[ge]);return de},Nb:function(Y,ee){if(ee instanceof Array)Y.push.apply(Y,ee);else for(var Q=0,de=ee.length;Q<de;Q++)Y.push(ee[Q]);return Y},Na:function(Y,ee,Q){var de=m.a.A(m.a.bc(Y),ee);0>de?Q&&Y.push(ee):Q||Y.splice(de,1)},Ba:F,extend:E,setPrototypeOf:v,Ab:F?v:E,P:g,Ga:function(Y,ee,Q){if(!Y)return Y;var de={},ge;for(ge in Y)N.call(Y,ge)&&(de[ge]=ee.call(Q,Y[ge],ge,Y));return de},Tb:function(Y){for(;Y.firstChild;)m.removeNode(Y.firstChild)},Yb:function(Y){Y=m.a.la(Y);for(var ee=(Y[0]&&Y[0].ownerDocument||n).createElement("div"),Q=0,de=Y.length;Q<de;Q++)ee.appendChild(m.oa(Y[Q]));return ee},Ca:function(Y,ee){for(var Q=0,de=Y.length,ge=[];Q<de;Q++){var le=Y[Q].cloneNode(!0);ge.push(ee?m.oa(le):le)}return ge},va:function(Y,ee){if(m.a.Tb(Y),ee)for(var Q=0,de=ee.length;Q<de;Q++)Y.appendChild(ee[Q])},Xc:function(Y,ee){var Q=Y.nodeType?[Y]:Y;if(0<Q.length){for(var de=Q[0],ge=de.parentNode,le=0,ye=ee.length;le<ye;le++)ge.insertBefore(ee[le],de);for(le=0,ye=Q.length;le<ye;le++)m.removeNode(Q[le])}},Ua:function(Y,ee){if(Y.length){for(ee=ee.nodeType===8&&ee.parentNode||ee;Y.length&&Y[0].parentNode!==ee;)Y.splice(0,1);for(;1<Y.length&&Y[Y.length-1].parentNode!==ee;)Y.length--;if(1<Y.length){var Q=Y[0],de=Y[Y.length-1];for(Y.length=0;Q!==de;)Y.push(Q),Q=Q.nextSibling;Y.push(de)}}return Y},Zc:function(Y,ee){7>j?Y.setAttribute("selected",ee):Y.selected=ee},Db:function(Y){return Y===null||Y===e?"":Y.trim?Y.trim():Y.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(Y,ee){return Y=Y||"",ee.length>Y.length?!1:Y.substring(0,ee.length)===ee},vd:function(Y,ee){if(Y===ee)return!0;if(Y.nodeType===11)return!1;if(ee.contains)return ee.contains(Y.nodeType!==1?Y.parentNode:Y);if(ee.compareDocumentPosition)return(ee.compareDocumentPosition(Y)&16)==16;for(;Y&&Y!=ee;)Y=Y.parentNode;return!!Y},Sb:function(Y){return m.a.vd(Y,Y.ownerDocument.documentElement)},kd:function(Y){return!!m.a.Lb(Y,m.a.Sb)},R:function(Y){return Y&&Y.tagName&&Y.tagName.toLowerCase()},Ac:function(Y){return m.onError?function(){try{return Y.apply(this,arguments)}catch(ee){throw m.onError&&m.onError(ee),ee}}:Y},setTimeout:function(Y,ee){return setTimeout(m.a.Ac(Y),ee)},Gc:function(Y){setTimeout(function(){throw m.onError&&m.onError(Y),Y},0)},B:function(Y,ee,Q){var de=m.a.Ac(Q);if(Q=B[ee],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof Y.addEventListener!="function")if(typeof Y.attachEvent<"u"){var ge=function(ye){de.call(Y,ye)},le="on"+ee;Y.attachEvent(le,ge),m.a.K.za(Y,function(){Y.detachEvent(le,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else Y.addEventListener(ee,de,!1);else J||(J=typeof o(Y).on=="function"?"on":"bind"),o(Y)[J](ee,de)},Fb:function(Y,ee){if(!Y||!Y.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(Y)==="input"&&Y.type&&ee.toLowerCase()=="click"?(Q=Y.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof Y.dispatchEvent=="function")Q=n.createEvent(z[ee]||"HTMLEvents"),Q.initEvent(ee,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,Y),Y.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&Y.click)Y.click();else if(typeof Y.fireEvent<"u")Y.fireEvent("on"+ee);else throw Error("Browser doesn't support triggering events");else o(Y).trigger(ee)},f:function(Y){return m.O(Y)?Y():Y},bc:function(Y){return m.O(Y)?Y.v():Y},Eb:function(Y,ee,Q){var de;ee&&(typeof Y.classList=="object"?(de=Y.classList[Q?"add":"remove"],m.a.D(ee.match(W),function(ge){de.call(Y.classList,ge)})):typeof Y.className.baseVal=="string"?I(Y.className,"baseVal",ee,Q):I(Y,"className",ee,Q))},Bb:function(Y,ee){var Q=m.a.f(ee);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(Y);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(Y,[Y.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(Y)},Yc:function(Y,ee){if(Y.name=ee,7>=j)try{var Q=Y.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});Y.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(Y){9<=j&&(Y=Y.nodeType==1?Y:Y.parentNode,Y.style&&(Y.style.zoom=Y.style.zoom))},wd:function(Y){if(j){var ee=Y.style.width;Y.style.width=0,Y.style.width=ee}},Pd:function(Y,ee){Y=m.a.f(Y),ee=m.a.f(ee);for(var Q=[],de=Y;de<=ee;de++)Q.push(de);return Q},la:function(Y){for(var ee=[],Q=0,de=Y.length;Q<de;Q++)ee.push(Y[Q]);return ee},Da:function(Y){return U?Symbol(Y):Y},Zd:j===6,$d:j===7,W:j,Lc:function(Y,ee){for(var Q=m.a.la(Y.getElementsByTagName("input")).concat(m.a.la(Y.getElementsByTagName("textarea"))),de=typeof ee=="string"?function(ye){return ye.name===ee}:function(ye){return ee.test(ye.name)},ge=[],le=Q.length-1;0<=le;le--)de(Q[le])&&ge.push(Q[le]);return ge},Nd:function(Y){return typeof Y=="string"&&(Y=m.a.Db(Y))?r&&r.parse?r.parse(Y):new Function("return "+Y)():null},hc:function(Y,ee,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(Y),ee,Q)},Od:function(Y,ee,Q){Q=Q||{};var de=Q.params||{},ge=Q.includeFields||this.Jc,le=Y;if(typeof Y=="object"&&m.a.R(Y)==="form")for(var le=Y.action,ye=ge.length-1;0<=ye;ye--)for(var xe=m.a.Lc(Y,ge[ye]),Ie=xe.length-1;0<=Ie;Ie--)de[xe[Ie].name]=xe[Ie].value;ee=m.a.f(ee);var Te=n.createElement("form");Te.style.display="none",Te.action=le,Te.method="post";for(var ve in ee)Y=n.createElement("input"),Y.type="hidden",Y.name=ve,Y.value=m.a.hc(m.a.f(ee[ve])),Te.appendChild(Y);g(de,function(Ve,$e){var Ct=n.createElement("input");Ct.type="hidden",Ct.name=Ve,Ct.value=$e,Te.appendChild(Ct)}),n.body.appendChild(Te),Q.submitter?Q.submitter(Te):Te.submit(),setTimeout(function(){Te.parentNode.removeChild(Te)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var E=this;if(arguments.length===1)return function(){return E.apply(g,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),E.apply(g,I)}}),m.a.g=new function(){var g=0,E="__ko__"+new Date().getTime(),v={},I,N;return m.a.W?(I=function(F,U){var k=F[E];if(!k||k==="null"||!v[k]){if(!U)return e;k=F[E]="ko"+g++,v[k]={}}return v[k]},N=function(F){var U=F[E];return U?(delete v[U],F[E]=null,!0):!1}):(I=function(F,U){var k=F[E];return!k&&U&&(k=F[E]={}),k},N=function(F){return F[E]?(delete F[E],!0):!1}),{get:function(F,U){var k=I(F,!1);return k&&k[U]},set:function(F,U,k){(F=I(F,k!==e))&&(F[U]=k)},Ub:function(F,U,k){return F=I(F,!0),F[U]||(F[U]=k)},clear:N,Z:function(){return g+++E}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(U,k){var z=m.a.g.get(U,I);return z===e&&k&&(z=[],m.a.g.set(U,I,z)),z}function E(U){var k=g(U,!1);if(k)for(var k=k.slice(0),z=0;z<k.length;z++)k[z](U);m.a.g.clear(U),m.a.K.cleanExternalData(U),F[U.nodeType]&&v(U.childNodes,!0)}function v(U,k){for(var z=[],B,j=0;j<U.length;j++)if((!k||U[j].nodeType===8)&&(E(z[z.length]=B=U[j]),U[j]!==B))for(;j--&&m.a.A(z,U[j])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(U,k){if(typeof k!="function")throw Error("Callback must be a function");g(U,!0).push(k)},yb:function(U,k){var z=g(U,!1);z&&(m.a.Pa(z,k),z.length==0&&m.a.g.set(U,I,e))},oa:function(U){return m.u.G(function(){N[U.nodeType]&&(E(U),F[U.nodeType]&&v(U.getElementsByTagName("*")))}),U},removeNode:function(U){m.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){o&&typeof o.cleanData=="function"&&o.cleanData([U])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var g=[0,"",""],E=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},F=8>=m.a.W;m.a.ua=function(U,k){var z;if(o){if(o.parseHTML)z=o.parseHTML(U,k)||[];else if((z=o.clean([U],k))&&z[0]){for(var B=z[0];B.parentNode&&B.parentNode.nodeType!==11;)B=B.parentNode;B.parentNode&&B.parentNode.removeChild(B)}}else{(z=k)||(z=n);var B=z.parentWindow||z.defaultView||t,j=m.a.Db(U).toLowerCase(),W=z.createElement("div"),J;for(J=(j=j.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[j[1]]||g,j=J[0],J="ignored<div>"+J[1]+U+J[2]+"</div>",typeof B.innerShiv=="function"?W.appendChild(B.innerShiv(J)):(F&&z.body.appendChild(W),W.innerHTML=J,F&&W.parentNode.removeChild(W));j--;)W=W.lastChild;z=m.a.la(W.lastChild.childNodes)}return z},m.a.Md=function(U,k){var z=m.a.ua(U,k);return z.length&&z[0].parentElement||m.a.Yb(z)},m.a.fc=function(U,k){if(m.a.Tb(U),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(U).html(k);else for(var z=m.a.ua(k,U.ownerDocument),B=0;B<z.length;B++)U.appendChild(z[B])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function g(v,I){if(v){if(v.nodeType==8){var N=m.aa.Uc(v.nodeValue);N!=null&&I.push({ud:v,Kd:N})}else if(v.nodeType==1)for(var N=0,F=v.childNodes,U=F.length;N<U;N++)g(F[N],I)}}var E={};return{Xb:function(v){if(typeof v!="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 E[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var N=E[v];if(N===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete E[v]}},cd:function(v,I){var N=[];g(v,N);for(var F=0,U=N.length;F<U;F++){var k=N[F].ud,z=[k];I&&m.a.Nb(z,I),m.aa.bd(N[F].Kd,z),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function g(){if(N){for(var k=N,z=0,B;U<N;)if(B=I[U++]){if(U>k){if(5e3<=++z){U=N,m.a.Gc(Error("'Too much recursion' after processing "+z+" task groups."));break}k=N}try{B()}catch(j){m.a.Gc(j)}}}}function E(){g(),U=N=I.length=0}var v,I=[],N=0,F=1,U=0;return t.MutationObserver?v=function(k){var z=n.createElement("div");return new MutationObserver(k).observe(z,{attributes:!0}),function(){z.classList.toggle("foo")}}(E):v=n&&"onreadystatechange"in n.createElement("script")?function(k){var z=n.createElement("script");z.onreadystatechange=function(){z.onreadystatechange=null,n.documentElement.removeChild(z),z=null,k()},n.documentElement.appendChild(z)}:function(k){setTimeout(k,0)},{scheduler:v,zb:function(k){return N||m.na.scheduler(E),I[N++]=k,F++},cancel:function(k){k=k-(F-N),k>=U&&k<N&&(I[k]=null)},resetForTesting:function(){var k=N-U;return U=N=I.length=0,k},Sd:g}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,E){g.throttleEvaluation=E;var v=null;return m.$({read:g,write:function(I){clearTimeout(v),v=m.a.setTimeout(function(){g(I)},E)}})},rateLimit:function(g,E){var v,I,N;typeof E=="number"?v=E:(v=E.timeout,I=E.method),g.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,g.ub(function(F){return N(F,v,E)})},deferred:function(g,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(v){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(v);try{N=!0,g.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(g,E){g.equalityComparer=E=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,E,v){this.da=g,this.lc=E,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,E,v){var I=this;v=v||"change";var N=new m.ic(I,E?g.bind(E):g,function(){m.a.Pa(I.U[v],N),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(N),N},notifySubscribers:function(g,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var v=E==="change"&&this.ed||this.U[E].slice(0);try{m.u.xc();for(var I=0,N;N=v[I];++I)N.Ib||N.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var E=this,v=m.O(E),I,N,F,U,k;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var z=g(function(){E.Ja=!1,v&&U===E&&(U=E.nc?E.nc():E());var B=N||k&&E.sb(F,U);k=N=I=!1,B&&E.gb(F=U)});E.qc=function(B,j){j&&E.Ja||(k=!j),E.ed=E.U.change.slice(0),E.Ja=I=!0,U=B,z()},E.pc=function(B){I||(F=B,E.gb(B,"beforeChange"))},E.rc=function(){k=!0},E.gd=function(){E.sb(F,E.v(!0))&&(N=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var E=0;return m.a.P(this.U,function(v,I){v!=="dirty"&&(E+=I.length)}),E},sb:function(g,E){return!this.equalityComparer||!this.equalityComparer(g,E)},toString:function(){return"[object Object]"},extend:function(g){var E=this;return g&&m.a.P(g,function(v,I){var N=m.Ta[v];typeof N=="function"&&(E=N(E,I)||E)}),E}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function g(F){v.push(I),I=F}function E(){I=v.pop()}var v=[],I,N=0;return{xc:g,end:E,cc:function(F){if(I){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++N))}},G:function(F,U,k){try{return g(),F.apply(U,k||[])}finally{E()}},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}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var x=m.a.Da("_latestValue");m.ta=function(g){function E(){return 0<arguments.length?(E.sb(E[x],arguments[0])&&(E.ya(),E[x]=arguments[0],E.xa()),this):(m.u.cc(E),E[x])}return E[x]=g,m.a.Ba||m.a.extend(E,m.T.fn),m.T.fn.qb(E),m.a.Ab(E,T),m.options.deferUpdates&&m.Ta.deferred(E,!0),E};var T={equalityComparer:c,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(T,m.T.fn);var C=m.ta.Ma="__ko_proto__";T[C]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[C])&&g!==T[C]&&g!==m.o.fn[C])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[C]===T[C]||g[C]===m.o.fn[C]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",T),m.L(T,"peek",T.v),m.L(T,"valueHasMutated",T.xa),m.L(T,"valueWillMutate",T.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var E=this.v(),v=[],I=typeof g!="function"||m.O(g)?function(U){return U===g}:g,N=0;N<E.length;N++){var F=E[N];if(I(F)){if(v.length===0&&this.ya(),E[N]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),E.splice(N,1),N--}}return v.length&&this.xa(),v},removeAll:function(g){if(g===e){var E=this.v(),v=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),v}return g?this.remove(function(I){return 0<=m.a.A(g,I)}):[]},destroy:function(g){var E=this.v(),v=typeof g!="function"||m.O(g)?function(F){return F===g}:g;this.ya();for(var I=E.length-1;0<=I;I--){var N=E[I];v(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(E){return 0<=m.a.A(g,E)}):[]},indexOf:function(g){var E=this();return m.a.A(E,g)},replace:function(g,E){var v=this.indexOf(g);0<=v&&(this.ya(),this.v()[v]=E,this.xa())},sorted:function(g){var E=this().slice(0);return g?E.sort(g):E.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var E=this.v();this.ya(),this.zc(E,g,arguments);var v=E[g].apply(E,arguments);return this.xa(),v===E?this:v}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var E=this();return E[g].apply(E,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,E){function v(){function W(){if(k){var J=[].concat(g.v()||[]),Y;g.Wa("arrayChange")&&((!N||1<k)&&(N=m.a.Pb(z,J,g.Ob)),Y=N),z=J,N=null,k=0,Y&&Y.length&&g.notifySubscribers(Y,"arrayChange")}}I?W():(I=!0,U=g.subscribe(function(){++k},null,"spectate"),z=[].concat(g.v()||[]),N=null,F=g.subscribe(W))}if(g.Ob={},E&&typeof E=="object"&&m.a.extend(g.Ob,E),g.Ob.sparse=!0,!g.zc){var I=!1,N=null,F,U,k=0,z,B=g.Qa,j=g.hb;g.Qa=function(W){B&&B.call(g,W),W==="arrayChange"&&v()},g.hb=function(W){j&&j.call(g,W),W!=="arrayChange"||g.Wa("arrayChange")||(F&&F.s(),U&&U.s(),U=F=null,I=!1,z=e)},g.zc=function(W,J,Y){function ee(Te,ve,Ve){return Q[Q.length]={status:Te,value:ve,index:Ve}}if(I&&!k){var Q=[],de=W.length,ge=Y.length,le=0;switch(J){case"push":le=de;case"unshift":for(J=0;J<ge;J++)ee("added",Y[J],le+J);break;case"pop":le=de-1;case"shift":de&&ee("deleted",W[le],le);break;case"splice":J=Math.min(Math.max(0,0>Y[0]?de+Y[0]:Y[0]),de);for(var de=ge===1?de:Math.min(J+(Y[1]||0),de),ge=J+ge-2,le=Math.max(de,ge),ye=[],xe=[],Ie=2;J<le;++J,++Ie)J<de&&xe.push(ee("deleted",W[J],J)),J<ge&&ye.push(ee("added",Y[Ie],J));m.a.Kc(xe,ye);break;default:return}N=Q}}}};var A=m.a.Da("_state");m.o=m.$=function(g,E,v){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(F.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 F.ra||m.u.cc(I),(F.ka||F.J&&I.Xa())&&I.ha(),F.X}if(typeof g=="object"?v=g:(v=v||{},g&&(v.read=g)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:E||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[A]=F,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,S),v.pure?(F.wb=!0,F.J=!0,m.a.extend(I,w)):v.deferEvaluation&&m.a.extend(I,R),m.options.deferUpdates&&m.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||I.ha(),F.l&&I.ja()&&m.a.K.za(F.l,F.Rb=function(){I.s()}),I};var S={equalityComparer:c,qa:function(){return this[A].V},Va:function(){var g=[];return m.a.P(this[A].I,function(E,v){g[v.Ka]=v.da}),g},Vb:function(g){if(!this[A].V)return!1;var E=this.Va();return m.a.A(E,g)!==-1?!0:!!m.a.Lb(E,function(v){return v.Vb&&v.Vb(g)})},uc:function(g,E,v){if(this[A].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[A].I[g]=v,v.Ka=this[A].V++,v.La=E.ob()},Xa:function(){var g,E,v=this[A].I;for(g in v)if(Object.prototype.hasOwnProperty.call(v,g)&&(E=v[g],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[A].rb&&this.Ia(!1)},ja:function(){var g=this[A];return g.ka||0<g.V},Rd:function(){this.Ja?this[A].ka&&(this[A].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var E=g.subscribe(this.Jd,this,"dirty"),v=g.subscribe(this.Rd,this);return{da:g,s:function(){E.s(),v.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,E=g.throttleEvaluation;E&&0<=E?(clearTimeout(this[A].Ic),this[A].Ic=m.a.setTimeout(function(){g.ha(!0)},E)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var E=this[A],v=E.Sa,I=!1;if(!E.rb&&!E.ra){if(E.l&&!m.a.Sb(E.l)||v&&v()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{I=this.zd(g)}finally{E.rb=!1}return I}},zd:function(g){var E=this[A],I=!1,v=E.wb?e:!E.V,I={qd:this,mb:E.I,Qb:E.V};m.u.xc({pd:I,od:_,o:this,Ya:v}),E.I={},E.V=0;var N=this.yd(E,I);return E.V?I=this.sb(E.X,N):(this.s(),I=!0),I&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=N,this.notifySubscribers(E.X,"spectate"),!E.J&&g&&this.notifySubscribers(E.X),this.rc&&this.rc()),v&&this.notifySubscribers(E.X,"awake"),I},yd:function(g,E){try{var v=g.Wc;return g.nb?v.call(g.nb):v()}finally{m.u.end(),E.Qb&&!g.J&&m.a.P(E.mb,p),g.sa=g.ka=!1}},v:function(g){var E=this[A];return(E.ka&&(g||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[A].J||(this[A].sa?this.ha():this[A].ka=!1),this[A].X},this.Ia=function(E){this.pc(this[A].X),this[A].ka=!0,E&&(this[A].sa=!0),this.qc(this,!E)}},s:function(){var g=this[A];!g.J&&g.I&&m.a.P(g.I,function(E,v){v.s&&v.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},w={Qa:function(g){var E=this,v=E[A];if(!v.ra&&v.J&&g=="change"){if(v.J=!1,v.sa||E.Xa())v.I=null,v.V=0,E.ha()&&E.Gb();else{var I=[];m.a.P(v.I,function(N,F){I[F.Ka]=N}),m.a.D(I,function(N,F){var U=v.I[N],k=E.$c(U.da);k.Ka=F,k.La=U.La,v.I[N]=k}),E.Xa()&&E.ha()&&E.Gb()}v.ra||E.notifySubscribers(v.X,"awake")}},hb:function(g){var E=this[A];E.ra||g!="change"||this.Wa("change")||(m.a.P(E.I,function(v,I){I.s&&(E.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[A];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},R={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(S,m.T.fn);var P=m.ta.Ma;S[P]=m.o,m.Oc=function(g){return typeof g=="function"&&g[P]===S[P]},m.Fd=function(g){return m.Oc(g)&&g[A]&&g[A].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",S),m.L(S,"peek",S.v),m.L(S,"dispose",S.s),m.L(S,"isActive",S.ja),m.L(S,"getDependenciesCount",S.qa),m.L(S,"getDependencies",S.Va),m.xb=function(g,E){return typeof g=="function"?m.o(g,E,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,E))},m.b("pureComputed",m.xb),function(){function g(I,N,F){if(F=F||new v,I=N(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 U=I instanceof Array?[]:{};return F.save(I,U),E(I,function(k){var z=N(I[k]);switch(typeof z){case"boolean":case"number":case"string":case"function":U[k]=z;break;case"object":case"undefined":var B=F.get(z);U[k]=B!==e?B:g(z,N,F)}}),U}function E(I,N){if(I instanceof Array){for(var F=0;F<I.length;F++)N(F);typeof I.toJSON=="function"&&N("toJSON")}else for(F in I)N(F)}function v(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(I,function(N){for(var F=0;m.O(N)&&10>F;F++)N=N();return N})},m.toJSON=function(I,N,F){return I=m.ad(I),m.a.hc(I,N,F)},v.prototype={constructor:v,save:function(I,N){var F=m.a.A(this.keys,I);0<=F?this.values[F]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,E,v){function I(N){var F=m.xb(g,v).extend({ma:"always"}),U=F.subscribe(function(k){k&&(U.s(),N(k))});return F.notifySubscribers(F.v()),U}return typeof Promise!="function"||E?I(E.bind(v)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,E,v){switch(m.a.R(g)){case"option":typeof E=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=E):(m.a.g.set(g,m.c.options.$b,E),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var I=-1,N=0,F=g.options.length,U;N<F;++N)if(U=m.w.M(g.options[N]),U==E||U===""&&E===e){I=N;break}(v||0<=I||E===e&&1<g.size)&&(g.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=I},0));break;default:(E===null||E===e)&&(E=""),g.value=E}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function g(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=` -,`;var z=[],B=k.match(I),j,W=[],J=0;if(1<B.length){for(var Y=0,ee;ee=B[Y];++Y){var Q=ee.charCodeAt(0);if(Q===44){if(0>=J){z.push(j&&W.length?{key:j,value:W.join("")}:{unknown:j||W.join("")}),j=J=0,W=[];continue}}else if(Q===58){if(!J&&!j&&W.length===1){j=W.pop();continue}}else{if(Q===47&&1<ee.length&&(ee.charCodeAt(1)===47||ee.charCodeAt(1)===42))continue;Q===47&&Y&&1<ee.length?(Q=B[Y-1].match(N))&&!F[Q[0]]&&(k=k.substr(k.indexOf(ee)+1),B=k.match(I),Y=-1,ee="/"):Q===40||Q===123||Q===91?++J:Q===41||Q===125||Q===93?--J:j||W.length||Q!==34&&Q!==39||(ee=ee.slice(1,-1))}W.push(ee)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return z}var E=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:g,vb:function(k,z){function B(Q,de){var ge;if(!Y){var le=m.getBindingHandler(Q);if(le&&le.preprocess&&!(de=le.preprocess(de,Q,B)))return;(le=U[Q])&&(ge=de,0<=m.a.A(E,ge)?ge=!1:(le=ge.match(v),ge=le===null?!1:le[1]?"Object("+le[1]+")"+le[2]:ge),le=ge),le&&W.push("'"+(typeof U[Q]=="string"?U[Q]:Q)+"':function(_z){"+ge+"=_z}")}J&&(de="function(){return "+de+" }"),j.push("'"+Q+"':"+de)}z=z||{};var j=[],W=[],J=z.valueAccessors,Y=z.bindingParams,ee=typeof k=="string"?g(k):k;return m.a.D(ee,function(Q){B(Q.key||Q.unknown,Q.value)}),W.length&&B("_ko_property_writers","{"+W.join(",")+" }"),j.join(",")},Id:function(k,z){for(var B=0;B<k.length;B++)if(k[B].key==z)return!0;return!1},eb:function(k,z,B,j,W){k&&m.O(k)?!m.Za(k)||W&&k.v()===j||k(j):(k=z.get("_ko_property_writers"))&&k[B]&&k[B](j)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function g(B){return B.nodeType==8&&F.test(N?B.text:B.nodeValue)}function E(B){return B.nodeType==8&&U.test(N?B.text:B.nodeValue)}function v(B,j){for(var W=B,J=1,Y=[];W=W.nextSibling;){if(E(W)&&(m.a.g.set(W,z,!0),J--,J===0))return Y;Y.push(W),g(W)&&J++}if(!j)throw Error("Cannot find closing comment tag to match: "+B.nodeValue);return null}function I(B,j){var W=v(B,j);return W?0<W.length?W[W.length-1].nextSibling:B.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",F=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},z="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(B){return g(B)?v(B):B.childNodes},Ea:function(B){if(g(B)){B=m.h.childNodes(B);for(var j=0,W=B.length;j<W;j++)m.removeNode(B[j])}else m.a.Tb(B)},va:function(B,j){if(g(B)){m.h.Ea(B);for(var W=B.nextSibling,J=0,Y=j.length;J<Y;J++)W.parentNode.insertBefore(j[J],W)}else m.a.va(B,j)},Vc:function(B,j){var W;g(B)?(W=B.nextSibling,B=B.parentNode):W=B.firstChild,W?j!==W&&B.insertBefore(j,W):B.appendChild(j)},Wb:function(B,j,W){W?(W=W.nextSibling,g(B)&&(B=B.parentNode),W?j!==W&&B.insertBefore(j,W):B.appendChild(j)):m.h.Vc(B,j)},firstChild:function(B){if(g(B))return!B.nextSibling||E(B.nextSibling)?null:B.nextSibling;if(B.firstChild&&E(B.firstChild))throw Error("Found invalid end comment, as the first child of "+B);return B.firstChild},nextSibling:function(B){if(g(B)&&(B=I(B)),B.nextSibling&&E(B.nextSibling)){var j=B.nextSibling;if(E(j)&&!m.a.g.get(j,z))throw Error("Found end comment without a matching opening comment, as child of "+B);return null}return B.nextSibling},Cd:g,Vd:function(B){return(B=(N?B.text:B.nodeValue).match(F))?B[1]:null},Sc:function(B){if(k[m.a.R(B)]){var j=B.firstChild;if(j)do if(j.nodeType===1){var W;W=j.firstChild;var J=null;if(W)do if(J)J.push(W);else if(g(W)){var Y=I(W,!0);Y?W=Y:J=[W]}else E(W)&&(J=[W]);while(W=W.nextSibling);if(W=J)for(J=j.nextSibling,Y=0;Y<W.length;Y++)J?B.insertBefore(W[Y],J):B.appendChild(W[Y])}while(j=j.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,E){var v=this.getBindingsString(g,E),v=v?this.parseBindingsString(v,E,g):null;return m.j.tc(v,g,E,!1)},getBindingAccessors:function(g,E){var v=this.getBindingsString(g,E),v=v?this.parseBindingsString(v,E,g,{valueAccessors:!0}):null;return m.j.tc(v,g,E,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,E,v,I){try{var N=this.nd,F=g+(I&&I.valueAccessors||""),U;if(!(U=N[F])){var k,z="with($context){with($data||{}){return{"+m.m.vb(g,I)+"}}}";k=new Function("$context","$element",z),U=N[F]=k}return U(E,v)}catch(B){throw B.message=`Unable to parse bindings. -Bindings value: `+g+` -Message: `+B.message,B}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function g(le){var ye=(le=m.a.g.get(le,ge))&&le.N;ye&&(le.N=null,ye.Tc())}function E(le,ye,xe){this.node=le,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(le,g),xe&&xe.N&&(xe.N.kb.push(le),this.Kb=xe)}function v(le){return function(){return le}}function I(le){return le()}function N(le){return m.a.Ga(m.u.G(le),function(ye,xe){return function(){return le()[xe]}})}function F(le,ye,xe){return typeof le=="function"?N(le.bind(null,ye,xe)):m.a.Ga(le,v)}function U(le,ye){return N(this.getBindings.bind(this,le,ye))}function k(le,ye){var xe=m.h.firstChild(ye);if(xe){var Ie,Te=m.ga.instance,ve=Te.preprocessNode;if(ve){for(;Ie=xe;)xe=m.h.nextSibling(Ie),ve.call(Te,Ie);xe=m.h.firstChild(ye)}for(;Ie=xe;)xe=m.h.nextSibling(Ie),z(le,Ie)}m.i.ma(ye,m.i.H)}function z(le,ye){var xe=le,Ie=ye.nodeType===1;Ie&&m.h.Sc(ye),(Ie||m.ga.instance.nodeHasBindings(ye))&&(xe=j(ye,null,le).bindingContextForDescendants),xe&&!Q[m.a.R(ye)]&&k(xe,ye)}function B(le){var ye=[],xe={},Ie=[];return m.a.P(le,function Te(ve){if(!xe[ve]){var Ve=m.getBindingHandler(ve);Ve&&(Ve.after&&(Ie.push(ve),m.a.D(Ve.after,function($e){if(le[$e]){if(m.a.A(Ie,$e)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Te($e)}}),Ie.length--),ye.push({key:ve,Mc:Ve})),xe[ve]=!0}}),ye}function j(le,ye,xe){var Ie=m.a.g.Ub(le,ge,{}),Te=Ie.hd;if(!ye){if(Te)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Te||(Ie.context=xe),Ie.Zb||(Ie.Zb={});var ve;if(ye&&typeof ye!="function")ve=ye;else{var Ve=m.ga.instance,$e=Ve.getBindingAccessors||U,Ct=m.$(function(){return(ve=ye?ye(xe,le):$e.call(Ve,le,xe))&&(xe[J]&&xe[J](),xe[ee]&&xe[ee]()),ve},null,{l:le});ve&&Ct.ja()||(Ct=null)}var Jt=xe,Qe;if(ve){var mn=function(){return m.a.Ga(Ct?Ct():ve,I)},Bt=Ct?function(Ot){return function(){return I(Ct()[Ot])}}:function(Ot){return ve[Ot]};mn.get=function(Ot){return ve[Ot]&&I(Bt(Ot))},mn.has=function(Ot){return Ot in ve},m.i.H in ve&&m.i.subscribe(le,m.i.H,function(){var Ot=(0,ve[m.i.H])();if(Ot){var Jn=m.h.childNodes(le);Jn.length&&Ot(Jn,m.Ec(Jn[0]))}}),m.i.pa in ve&&(Jt=m.i.Cb(le,xe),m.i.subscribe(le,m.i.pa,function(){var Ot=(0,ve[m.i.pa])();Ot&&m.h.firstChild(le)&&Ot(le)})),Ie=B(ve),m.a.D(Ie,function(Ot){var Jn=Ot.Mc.init,bi=Ot.Mc.update,Gt=Ot.key;if(le.nodeType===8&&!m.h.ea[Gt])throw Error("The binding '"+Gt+"' cannot be used with virtual elements");try{typeof Jn=="function"&&m.u.G(function(){var Pt=Jn(le,Bt(Gt),mn,Jt.$data,Jt);if(Pt&&Pt.controlsDescendantBindings){if(Qe!==e)throw Error("Multiple bindings ("+Qe+" and "+Gt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Qe=Gt}}),typeof bi=="function"&&m.$(function(){bi(le,Bt(Gt),mn,Jt.$data,Jt)},null,{l:le})}catch(Pt){throw Pt.message='Unable to process binding "'+Gt+": "+ve[Gt]+`" -Message: `+Pt.message,Pt}})}return Ie=Qe===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Jt}}function W(le,ye){return le&&le instanceof m.fa?le:new m.fa(le,e,e,ye)}var J=m.a.Da("_subscribable"),Y=m.a.Da("_ancestorBindingInfo"),ee=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(le){return m.c[le]};var de={};m.fa=function(le,ye,xe,Ie,Te){function ve(){var Bt=Jt?Ct():Ct,Ot=m.a.f(Bt);return ye?(m.a.extend(Ve,ye),Y in ye&&(Ve[Y]=ye[Y])):(Ve.$parents=[],Ve.$root=Ot,Ve.ko=m),Ve[J]=Qe,$e?Ot=Ve.$data:(Ve.$rawData=Bt,Ve.$data=Ot),xe&&(Ve[xe]=Ot),Ie&&Ie(Ve,ye,Ot),ye&&ye[J]&&!m.S.o().Vb(ye[J])&&ye[J](),mn&&(Ve[ee]=mn),Ve.$data}var Ve=this,$e=le===de,Ct=$e?e:le,Jt=typeof Ct=="function"&&!m.O(Ct),Qe,mn=Te&&Te.dataDependency;Te&&Te.exportDependencies?ve():(Qe=m.xb(ve),Qe.v(),Qe.ja()?Qe.equalityComparer=null:Ve[J]=e)},m.fa.prototype.createChildContext=function(le,ye,xe,Ie){if(!Ie&&ye&&typeof ye=="object"&&(Ie=ye,ye=Ie.as,xe=Ie.extend),ye&&Ie&&Ie.noChildContext){var Te=typeof le=="function"&&!m.O(le);return new m.fa(de,this,null,function(ve){xe&&xe(ve),ve[ye]=Te?le():le},Ie)}return new m.fa(le,this,ye,function(ve,Ve){ve.$parentContext=Ve,ve.$parent=Ve.$data,ve.$parents=(Ve.$parents||[]).slice(0),ve.$parents.unshift(ve.$parent),xe&&xe(ve)},Ie)},m.fa.prototype.extend=function(le,ye){return new m.fa(de,this,null,function(xe){m.a.extend(xe,typeof le=="function"?le(xe):le)},ye)};var ge=m.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(le){m.a.Pa(this.kb,le),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(le,ye,xe,Ie,Te){var ve=m.a.g.Ub(le,ge,{});return ve.Fa||(ve.Fa=new m.T),Te&&Te.notifyImmediately&&ve.Zb[ye]&&m.u.G(xe,Ie,[le]),ve.Fa.subscribe(xe,Ie,ye)},ma:function(le,ye){var xe=m.a.g.get(le,ge);if(xe&&(xe.Zb[ye]=!0,xe.Fa&&xe.Fa.notifySubscribers(le,ye),ye==m.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(le,ye){var xe=m.a.g.Ub(le,ge,{});return xe.N||(xe.N=new E(le,xe,ye[Y])),ye[Y]==xe?ye:ye.extend(function(Ie){Ie[Y]=xe})}},m.Td=function(le){return(le=m.a.g.get(le,ge))&&le.context},m.ib=function(le,ye,xe){return le.nodeType===1&&m.h.Sc(le),j(le,ye,W(xe))},m.ld=function(le,ye,xe){return xe=W(xe),m.ib(le,F(ye,xe,le),xe)},m.Oa=function(le,ye){ye.nodeType!==1&&ye.nodeType!==8||k(W(le),ye)},m.vc=function(le,ye,xe){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");z(W(le,xe),ye)},m.Dc=function(le){return!le||le.nodeType!==1&&le.nodeType!==8?e:m.Td(le)},m.Ec=function(le){return(le=m.Dc(le))?le.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(g){function E(U,k){var z=Object.prototype.hasOwnProperty.call(N,U)?N[U]:g,B;z?z.subscribe(k):(z=N[U]=new m.T,z.subscribe(k),v(U,function(j,W){var J=!(!W||!W.synchronous);F[U]={definition:j,Gd:J},delete N[U],B||J?z.notifySubscribers(j):m.na.zb(function(){z.notifySubscribers(j)})}),B=!0)}function v(U,k){I("getConfig",[U],function(z){z?I("loadComponent",[U,z],function(B){k(B,z)}):k(null,null)})}function I(U,k,z,B){B||(B=m.j.loaders.slice(0));var j=B.shift();if(j){var W=j[U];if(W){var J=!1;if(W.apply(j,k.concat(function(Y){J?z(null):Y!==null?z(Y):I(U,k,z,B)}))!==g&&(J=!0,!j.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(U,k,z,B)}else z(null)}var N={},F={};m.j={get:function(U,k){var z=Object.prototype.hasOwnProperty.call(F,U)?F[U]:g;z?z.Gd?m.u.G(function(){k(z.definition)}):m.na.zb(function(){k(z.definition)}):E(U,k)},Bc:function(U){delete F[U]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function g(z,B,j,W){function J(){--ee===0&&W(Y)}var Y={},ee=2,Q=j.template;j=j.viewModel,Q?N(B,Q,function(de){m.j.oc("loadTemplate",[z,de],function(ge){Y.template=ge,J()})}):J(),j?N(B,j,function(de){m.j.oc("loadViewModel",[z,de],function(ge){Y[k]=ge,J()})}):J()}function E(z,B,j){if(typeof B=="function")j(function(J){return new B(J)});else if(typeof B[k]=="function")j(B[k]);else if("instance"in B){var W=B.instance;j(function(){return W})}else"viewModel"in B?E(z,B.viewModel,j):z("Unknown viewModel value: "+B)}function v(z){switch(m.a.R(z)){case"script":return m.a.ua(z.text);case"textarea":return m.a.ua(z.value);case"template":if(I(z.content))return m.a.Ca(z.content.childNodes)}return m.a.Ca(z.childNodes)}function I(z){return t.DocumentFragment?z instanceof DocumentFragment:z&&z.nodeType===11}function N(z,B,j){typeof B.require=="string"?a||t.require?(a||t.require)([B.require],function(W){W&&typeof W=="object"&&W.Xd&&W.default&&(W=W.default),j(W)}):z("Uses require, but no AMD loader is present"):j(B)}function F(z){return function(B){throw Error("Component '"+z+"': "+B)}}var U={};m.j.register=function(z,B){if(!B)throw Error("Invalid configuration for "+z);if(m.j.tb(z))throw Error("Component "+z+" is already registered");U[z]=B},m.j.tb=function(z){return Object.prototype.hasOwnProperty.call(U,z)},m.j.unregister=function(z){delete U[z],m.j.Bc(z)},m.j.Fc={getConfig:function(z,B){B(m.j.tb(z)?U[z]:null)},loadComponent:function(z,B,j){var W=F(z);N(W,B,function(J){g(z,W,J,j)})},loadTemplate:function(z,B,j){if(z=F(z),typeof B=="string")j(m.a.ua(B));else if(B instanceof Array)j(B);else if(I(B))j(m.a.la(B.childNodes));else if(B.element)if(B=B.element,t.HTMLElement?B instanceof HTMLElement:B&&B.tagName&&B.nodeType===1)j(v(B));else if(typeof B=="string"){var W=n.getElementById(B);W?j(v(W)):z("Cannot find element with ID "+B)}else z("Unknown element type: "+B);else z("Unknown template value: "+B)},loadViewModel:function(z,B,j){E(F(z),B,j)}};var k="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=U}(),function(){function g(v,I){var N=v.getAttribute("params");if(N){var N=E.parseBindingsString(N,I,v,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(k){return m.o(k,null,{l:v})}),F=m.a.Ga(N,function(k){var z=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(z)&&function(B){k()(B)},l:v}):z});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=N),F}return{$raw:{}}}m.j.getComponentNameForNode=function(v){var I=m.a.R(v);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=m.a.W&&v.tagName===I))return I},m.j.tc=function(v,I,N,F){if(I.nodeType===1){var U=m.j.getComponentNameForNode(I);if(U){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:U,params:g(I,N)};v.component=F?function(){return k}:k}}return v};var E=new m.ga;9>m.a.W&&(m.j.register=function(v){return function(I){return v.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(v){return function(){var I=v(),N=m.j.dd,F;for(F in N);return I}}(n.createDocumentFragment))}(),function(){function g(I,N,F){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(F,I)}function E(I,N,F){var U=I.createViewModel;return U?U.call(I,N,F):N}var v=0;m.c.component={init:function(I,N,F,U,k){function z(){var Y=B&&B.dispose;typeof Y=="function"&&Y.call(B),W&&W.s(),j=B=W=null}var B,j,W,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,z),m.o(function(){var Y=m.a.f(N()),ee,Q;if(typeof Y=="string"?ee=Y:(ee=m.a.f(Y.name),Q=m.a.f(Y.params)),!ee)throw Error("No component name specified");var de=m.i.Cb(I,k),ge=j=++v;m.j.get(ee,function(le){if(j===ge){if(z(),!le)throw Error("Unknown component '"+ee+"'");g(ee,le,I);var ye=E(le,Q,{element:I,templateNodes:J});le=de.createChildContext(ye,{extend:function(xe){xe.$component=ye,xe.$componentTemplateNodes=J}}),ye&&ye.koDescendantsComplete&&(W=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),B=ye,m.Oa(le,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(g,E){var v=m.a.f(E())||{};m.a.P(v,function(I,N){N=m.a.f(N);var F=I.indexOf(":"),F="lookupNamespaceURI"in g&&0<F&&g.lookupNamespaceURI(I.substr(0,F)),U=N===!1||N===null||N===e;U?F?g.removeAttributeNS(F,I):g.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in O?(I=O[I],U?g.removeAttribute(I):g[I]=N):U||(F?g.setAttributeNS(F,I,N):g.setAttribute(I,N)),I==="name"&&m.a.Yc(g,U?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(g,E,v){function I(){var Y=g.checked,ee=F();if(!m.S.Ya()&&(Y||!k&&!m.S.qa())){var Q=m.u.G(E);if(B){var de=j?Q.v():Q,ge=J;J=ee,ge!==ee?Y&&(m.a.Na(de,ee,!0),m.a.Na(de,ge,!1)):m.a.Na(de,ee,Y),j&&m.Za(Q)&&Q(de)}else U&&(ee===e?ee=Y:Y||(ee=e)),m.m.eb(Q,v,"checked",ee,!0)}}function N(){var Y=m.a.f(E()),ee=F();B?(g.checked=0<=m.a.A(Y,ee),J=ee):g.checked=U&&ee===e?!!Y:F()===Y}var F=m.xb(function(){if(v.has("checkedValue"))return m.a.f(v.get("checkedValue"));if(W)return v.has("value")?m.a.f(v.get("value")):g.value}),U=g.type=="checkbox",k=g.type=="radio";if(U||k){var z=E(),B=U&&m.a.f(z)instanceof Array,j=!(B&&z.push&&z.splice),W=k||B,J=B?F():e;k&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(I,null,{l:g}),m.a.B(g,"click",I),m.o(N,null,{l:g}),z=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,E){g.value=m.a.f(E())}}}(),m.c.class={update:function(g,E){var v=m.a.Db(m.a.f(E()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=v,m.a.Eb(g,v,!0)}},m.c.css={update:function(g,E){var v=m.a.f(E());v!==null&&typeof v=="object"?m.a.P(v,function(I,N){N=m.a.f(N),m.a.Eb(g,I,N)}):m.c.class.update(g,E)}},m.c.enable={update:function(g,E){var v=m.a.f(E());v&&g.disabled?g.removeAttribute("disabled"):v||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,E){m.c.enable.update(g,function(){return!m.a.f(E())})}},m.c.event={init:function(g,E,v,I,N){var F=E()||{};m.a.P(F,function(U){typeof U=="string"&&m.a.B(g,U,function(k){var z,B=E()[U];if(B){try{var j=m.a.la(arguments);I=N.$data,j.unshift(I),z=B.apply(I,j)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}v.get(U+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var E=g(),v=m.a.bc(E);return!v||typeof v.length=="number"?{foreach:E,templateEngine:m.ba.Ma}:(m.a.f(E),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:m.ba.Ma})}},init:function(g,E){return m.c.template.init(g,m.c.foreach.Rc(E))},update:function(g,E,v,I,N){return m.c.template.update(g,m.c.foreach.Rc(E),v,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,E,v){function I(U){g.__ko_hasfocusUpdating=!0;var k=g.ownerDocument;if("activeElement"in k){var z;try{z=k.activeElement}catch{z=k.body}U=z===g}k=E(),m.m.eb(k,v,"hasfocus",U,!0),g.__ko_hasfocusLastValue=U,g.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),F=I.bind(null,!1);m.a.B(g,"focus",N),m.a.B(g,"focusin",N),m.a.B(g,"blur",F),m.a.B(g,"focusout",F),g.__ko_hasfocusLastValue=!1},update:function(g,E){var v=!!m.a.f(E());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===v||(v?g.focus():g.blur(),!v&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,v?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.fc(g,E())}},function(){function g(E,v,I){m.c[E]={init:function(N,F,U,k,z){var B,j,W={},J,Y,ee;if(v){k=U.get("as");var Q=U.get("noChildContext");ee=!(k&&Q),W={as:k,noChildContext:Q,exportDependencies:ee}}return Y=(J=U.get("completeOn")=="render")||U.has(m.i.pa),m.o(function(){var de=m.a.f(F()),ge=!I!=!de,le=!j,ye;(ee||ge!==B)&&(Y&&(z=m.i.Cb(N,z)),ge&&((!v||ee)&&(W.dataDependency=m.S.o()),ye=v?z.createChildContext(typeof de=="function"?de:F,W):m.S.qa()?z.extend(null,W):z),le&&m.S.qa()&&(j=m.a.Ca(m.h.childNodes(N),!0)),ge?(le||m.h.va(N,m.a.Ca(j)),m.Oa(ye,N)):(m.h.Ea(N),J||m.i.ma(N,m.i.H)),B=ge)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[E]=!1,m.h.ea[E]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)}(),m.c.let={init:function(g,E,v,I,N){return E=N.extend(E),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,E,v){function I(){return m.a.jb(g.options,function(Q){return Q.selected})}function N(Q,de,ge){var le=typeof de;return le=="function"?de(Q):le=="string"?Q[de]:ge}function F(Q,de){if(Y&&B)m.i.ma(g,m.i.H);else if(J.length){var ge=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],ge),Y&&!ge&&m.u.G(m.a.Fb,null,[g,"change"])}}var U=g.multiple,k=g.length!=0&&U?g.scrollTop:null,z=m.a.f(E()),B=v.get("valueAllowUnset")&&v.has("value"),j=v.get("optionsIncludeDestroyed");E={};var W,J=[];B||(U?J=m.a.Mb(I(),m.w.M):0<=g.selectedIndex&&J.push(m.w.M(g.options[g.selectedIndex]))),z&&(typeof z.length>"u"&&(z=[z]),W=m.a.jb(z,function(Q){return j||Q===e||Q===null||!m.a.f(Q._destroy)}),v.has("optionsCaption")&&(z=m.a.f(v.get("optionsCaption")),z!==null&&z!==e&&W.unshift(L)));var Y=!1;if(E.beforeRemove=function(Q){g.removeChild(Q)},z=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(z=function(Q,de){F(0,de),m.u.G(v.get("optionsAfterRender"),null,[de[0],Q!==L?Q:e])}),m.a.ec(g,W,function(Q,de,ge){return ge.length&&(J=!B&&ge[0].selected?[m.w.M(ge[0])]:[],Y=!0),de=g.ownerDocument.createElement("option"),Q===L?(m.a.Bb(de,v.get("optionsCaption")),m.w.cb(de,e)):(ge=N(Q,v.get("optionsValue"),Q),m.w.cb(de,m.a.f(ge)),Q=N(Q,v.get("optionsText"),ge),m.a.Bb(de,Q)),[de]},E,z),!B){var ee;U?ee=J.length&&I().length<J.length:ee=J.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==J[0]:J.length||0<=g.selectedIndex,ee&&m.u.G(m.a.Fb,null,[g,"change"])}(B||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),k&&20<Math.abs(k-g.scrollTop)&&(g.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,E,v){function I(){var U=E(),k=[];m.a.D(g.getElementsByTagName("option"),function(z){z.selected&&k.push(m.w.M(z))}),m.m.eb(U,v,"selectedOptions",k)}function N(){var U=m.a.f(E()),k=g.scrollTop;U&&typeof U.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(z){var B=0<=m.a.A(U,m.w.M(z));z.selected!=B&&m.a.Zc(z,B)}),g.scrollTop=k}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(g,m.i.H,function(){F?I():(m.a.B(g,"change",I),F=m.o(N,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,E){var v=m.a.f(E()||{});m.a.P(v,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(g).css(I,N);else if(/^--/.test(I))g.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(U,k){return k.toUpperCase()});var F=g.style[I];g.style[I]=N,N===F||g.style[I]!=F||isNaN(N)||(g.style[I]=N+"px")}})}},m.c.submit={init:function(g,E,v,I,N){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(F){var U,k=E();try{U=k.call(N.$data,g)}finally{U!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.Bb(g,E())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var g=function(W){if(W)return parseFloat(W[1])},E=t.navigator.userAgent,v,I,N,F,U;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=g(E.match(/Edge\/([^ ]+)$/)))||g(E.match(/Chrome\/([^ ]+)/))||(I=g(E.match(/Version\/([^ ]+) Safari/)))||(N=g(E.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||g(E.match(/MSIE ([^ ]+)/)))||(F=g(E.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var k=m.a.g.Z(),z=m.a.g.Z(),B=function(W){var J=this.activeElement;(J=J&&m.a.g.get(J,z))&&J(W)},j=function(W,J){var Y=W.ownerDocument;m.a.g.get(Y,k)||(m.a.g.set(Y,k,!0),m.a.B(Y,"selectionchange",B)),m.a.g.set(W,z,J)};m.c.textInput={init:function(W,J,Y){function ee(ve,Ve){m.a.B(W,ve,Ve)}function Q(){var ve=m.a.f(J());(ve===null||ve===e)&&(ve=""),xe!==e&&ve===xe?m.a.setTimeout(Q,4):W.value!==ve&&(Te=!0,W.value=ve,Te=!1,le=W.value)}function de(){ye||(xe=W.value,ye=m.a.setTimeout(ge,4))}function ge(){clearTimeout(ye),xe=ye=e;var ve=W.value;le!==ve&&(le=ve,m.m.eb(J(),Y,"textInput",ve))}var le=W.value,ye,xe,Ie=m.a.W==9?de:ge,Te=!1;F&&ee("keypress",ge),11>F&&ee("propertychange",function(ve){Te||ve.propertyName!=="value"||Ie(ve)}),F==8&&(ee("keyup",ge),ee("keydown",ge)),j&&(j(W,Ie),ee("dragend",de)),(!F||9<=F)&&ee("input",Ie),5>I&&m.a.R(W)==="textarea"?(ee("keydown",de),ee("paste",de),ee("cut",de)):11>v?ee("keydown",de):4>N?(ee("DOMAutoComplete",ge),ee("dragdrop",ge),ee("drop",ge)):U&&W.type==="number"&&ee("keydown",de),ee("change",ge),ee("blur",ge),m.o(Q,null,{l:W})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(W,J,Y){Y("textInput",W)}}}(),m.c.uniqueName={init:function(g,E){if(E()){var v="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,v)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,E,v,I,N){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),E=N.createChildContext(E,F),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,E,v){var I=m.a.R(g),N=I=="input";if(!N||g.type!="checkbox"&&g.type!="radio"){var F=[],U=v.get("valueUpdate"),k=!1,z=null;U&&(typeof U=="string"?F=[U]:F=m.a.wc(U),m.a.Pa(F,"change"));var B=function(){z=null,k=!1;var J=E(),Y=m.w.M(g);m.m.eb(J,v,"value",Y)};!m.a.W||!N||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){k=!0}),m.a.B(g,"focus",function(){k=!1}),m.a.B(g,"blur",function(){k&&B()})),m.a.D(F,function(J){var Y=B;m.a.Ud(J,"after")&&(Y=function(){z=m.w.M(g),m.a.setTimeout(B,0)},J=J.substring(5)),m.a.B(g,J,Y)});var j;if(j=N&&g.type=="file"?function(){var J=m.a.f(E());J===null||J===e||J===""?g.value="":m.u.G(B)}:function(){var J=m.a.f(E()),Y=m.w.M(g);z!==null&&J===z?m.a.setTimeout(j,0):(J!==Y||Y===e)&&(I==="select"?(Y=v.get("valueAllowUnset"),m.w.cb(g,J,Y),Y||J===m.w.M(g)||m.u.G(B)):m.w.cb(g,J))},I==="select"){var W;m.i.subscribe(g,m.i.H,function(){W?v.get("valueAllowUnset")?j():B():(m.a.B(g,"change",B),W=m.o(j,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",B),m.o(j,null,{l:g})}else m.ib(g,{checkedValue:E})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,E){var v=m.a.f(E()),I=g.style.display!="none";v&&!I?g.style.display="":!v&&I&&(g.style.display="none")}},m.c.hidden={update:function(g,E){m.c.visible.update(g,function(){return!m.a.f(E())})}},function(g){m.c[g]={init:function(E,v,I,N,F){return m.c.event.init.call(this,E,function(){var U={};return U[g]=v(),U},I,N,F)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,E){if(typeof g=="string"){E=E||n;var v=E.getElementById(g);if(!v)throw Error("Cannot find template with ID "+g);return new m.C.F(v)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,E,v,I){return g=this.makeTemplateSource(g,I),this.renderTemplateSource(g,E,v,I)},m.ca.prototype.isTemplateRewritten=function(g,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,E).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,E,v){g=this.makeTemplateSource(g,v),E=E(g.text()),g.text(E),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function g(I,N,F,U){I=m.m.ac(I);for(var k=m.m.Ra,z=0;z<I.length;z++){var B=I[z].key;if(Object.prototype.hasOwnProperty.call(k,B)){var j=k[B];if(typeof j=="function"){if(B=j(I[z].value))throw Error(B)}else if(!j)throw Error("This template engine does not support the '"+B+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(F)+N}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,F){N.isTemplateRewritten(I,F)||N.rewriteTemplate(I,function(U){return m.kc.Ld(U,N)},F)},Ld:function(I,N){return I.replace(E,function(F,U,k,z,B){return g(B,U,k,N)}).replace(v,function(F,U){return g(U,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(F,U){var k=F.nextSibling;k&&k.nodeName.toLowerCase()===N&&m.ib(k,I,U)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(v){if(this.F=v){var I=m.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?m.a.fc(this.F,I):this.F[v]=I};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(v){if(arguments.length===1)return m.a.g.get(this.F,g+v);m.a.g.set(this.F,g+v,arguments[1])};var E=m.a.g.Z();m.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=m.a.g.get(v,E)||{},N=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!N||I.jd){var F=this.text();F&&F!==I.bb&&(N=m.a.Md(F,v.ownerDocument),m.a.g.set(v,E,{lb:N,bb:F,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(v,E,{lb:I})},m.C.ia=function(v){this.F=v},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var v=m.a.g.get(this.F,E)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}m.a.g.set(this.F,E,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function g(z,B,j){var W;for(B=m.h.nextSibling(B);z&&(W=z)!==B;)z=m.h.nextSibling(W),j(W,z)}function E(z,B){if(z.length){var j=z[0],W=z[z.length-1],J=j.parentNode,Y=m.ga.instance,ee=Y.preprocessNode;if(ee){if(g(j,W,function(Q,de){var ge=Q.previousSibling,le=ee.call(Y,Q);le&&(Q===j&&(j=le[0]||de),Q===W&&(W=le[le.length-1]||ge))}),z.length=0,!j)return;j===W?z.push(j):(z.push(j,W),m.a.Ua(z,J))}g(j,W,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(B,Q)}),g(j,W,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[B])}),m.a.Ua(z,J)}}function v(z){return z.nodeType?z:0<z.length?z[0]:null}function I(z,B,j,W,J){J=J||{};var Y=(z&&v(z)||j||{}).ownerDocument,ee=J.templateEngine||F;if(m.kc.xd(j,ee,Y),j=ee.renderTemplate(j,W,J,Y),typeof j.length!="number"||0<j.length&&typeof j[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(Y=!1,B){case"replaceChildren":m.h.va(z,j),Y=!0;break;case"replaceNode":m.a.Xc(z,j),Y=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+B)}return Y&&(E(j,W),J.afterRender&&m.u.G(J.afterRender,null,[j,W[J.as||"$data"]]),B=="replaceChildren"&&m.i.ma(z,m.i.H)),j}function N(z,B,j){return m.O(z)?z():typeof z=="function"?z(B,j):z}var F;m.gc=function(z){if(z!=e&&!(z instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=z},m.dc=function(z,B,j,W,J){if(j=j||{},(j.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",W){var Y=v(W);return m.$(function(){var Q=B&&B instanceof m.fa?B:new m.fa(B,null,null,null,{exportDependencies:!0}),ee=N(z,Q.$data,Q),Q=I(W,J,ee,Q,j);J=="replaceNode"&&(W=Q,Y=v(W))},null,{Sa:function(){return!Y||!m.a.Sb(Y)},l:Y&&J=="replaceNode"?Y.parentNode:Y})}return m.aa.Xb(function(ee){m.dc(z,B,j,ee,"replaceNode")})},m.Qd=function(z,B,j,W,J){function Y(xe,Ie){m.u.G(m.a.ec,null,[W,xe,Q,j,ee,Ie]),m.i.ma(W,m.i.H)}function ee(xe,Ie){E(Ie,de),j.afterRender&&j.afterRender(Ie,xe),de=null}function Q(xe,Ie){de=J.createChildContext(xe,{as:ge,noChildContext:j.noChildContext,extend:function(ve){ve.$index=Ie,ge&&(ve[ge+"Index"]=Ie)}});var Te=N(z,xe,de);return I(W,"ignoreTargetNode",Te,de,j)}var de,ge=j.as,le=j.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!j.includeDestroyed;if(le||j.beforeRemove||!m.Pc(B))return m.$(function(){var xe=m.a.f(B)||[];typeof xe.length>"u"&&(xe=[xe]),le&&(xe=m.a.jb(xe,function(Ie){return Ie===e||Ie===null||!m.a.f(Ie._destroy)})),Y(xe)},null,{l:W});Y(B.v());var ye=B.subscribe(function(xe){Y(B(),xe)},null,"arrayChange");return ye.l(W),ye};var U=m.a.g.Z(),k=m.a.g.Z();m.c.template={init:function(z,B){var j=m.a.f(B());if(typeof j=="string"||"name"in j)m.h.Ea(z);else if("nodes"in j){if(j=j.nodes||[],m.O(j))throw Error('The "nodes" option must be a plain, non-observable array.');var W=j[0]&&j[0].parentNode;W&&m.a.g.get(W,k)||(W=m.a.Yb(j),m.a.g.set(W,k,!0)),new m.C.ia(z).nodes(W)}else if(j=m.h.childNodes(z),0<j.length)W=m.a.Yb(j),new m.C.ia(z).nodes(W);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(z,B,j,W,J){var Y=B();B=m.a.f(Y),j=!0,W=null,typeof B=="string"?B={}:(Y="name"in B?B.name:z,"if"in B&&(j=m.a.f(B.if)),j&&"ifnot"in B&&(j=!m.a.f(B.ifnot)),j&&!Y&&(j=!1)),"foreach"in B?W=m.Qd(Y,j&&B.foreach||[],B,z,J):j?(j=J,"data"in B&&(j=J.createChildContext(B.data,{as:B.as,noChildContext:B.noChildContext,exportDependencies:!0})),W=m.dc(Y,j,B,z)):m.h.Ea(z),J=W,(B=m.a.g.get(z,U))&&typeof B.s=="function"&&B.s(),m.a.g.set(z,U,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(z){return z=m.m.ac(z),z.length==1&&z[0].unknown||m.m.Id(z,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,E,v){if(g.length&&E.length){var I,N,F,U,k;for(I=N=0;(!v||I<v)&&(U=g[N]);++N){for(F=0;k=E[F];++F)if(U.value===k.value){U.moved=k.index,k.moved=U.index,E.splice(F,1),I=F=0;break}I+=F}}},m.a.Pb=function(){function g(E,v,I,N,F){var U=Math.min,k=Math.max,z=[],B,j=E.length,W,J=v.length,Y=J-j||1,ee=j+J+1,Q,de,ge;for(B=0;B<=j;B++)for(de=Q,z.push(Q=[]),ge=U(J,B+Y),W=k(0,B-1);W<=ge;W++)Q[W]=W?B?E[B-1]===v[W-1]?de[W-1]:U(de[W]||ee,Q[W-1]||ee)+1:W+1:B+1;for(U=[],k=[],Y=[],B=j,W=J;B||W;)J=z[B][W]-1,W&&J===z[B][W-1]?k.push(U[U.length]={status:I,value:v[--W],index:W}):B&&J===z[B-1][W]?Y.push(U[U.length]={status:N,value:E[--B],index:B}):(--W,--B,F.sparse||U.push({status:"retained",value:v[W]}));return m.a.Kc(Y,k,!F.dontLimitMoves&&10*j),U.reverse()}return function(E,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},E=E||[],v=v||[],E.length<v.length?g(E,v,"added","deleted",I):g(v,E,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function g(I,N,F,U,k){var z=[],B=m.$(function(){var j=N(F,k,m.a.Ua(z,I))||[];0<z.length&&(m.a.Xc(z,j),U&&m.u.G(U,null,[F,j,k])),z.length=0,m.a.Nb(z,j)},null,{l:I,Sa:function(){return!m.a.kd(z)}});return{Y:z,$:B.ja()?B:e}}var E=m.a.g.Z(),v=m.a.g.Z();m.a.ec=function(I,N,F,U,k,z){function B(Ot){Te={Aa:Ot,pb:m.ta(de++)},ee.push(Te),Y||Ie.push(Te)}function j(Ot){Te=J[Ot],de!==Te.pb.v()&&xe.push(Te),Te.pb(de++),m.a.Ua(Te.Y,I),ee.push(Te)}function W(Ot,Jn){if(Ot)for(var bi=0,Gt=Jn.length;bi<Gt;bi++)m.a.D(Jn[bi].Y,function(Pt){Ot(Pt,bi,Jn[bi].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),U=U||{};var J=m.a.g.get(I,E),Y=!J,ee=[],Q=0,de=0,ge=[],le=[],ye=[],xe=[],Ie=[],Te,ve=0;if(Y)m.a.D(N,B);else{if(!z||J&&J._countWaitingForRemove){var Ve=m.a.Mb(J,function(Ot){return Ot.Aa});z=m.a.Pb(Ve,N,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var Ve=0,$e,Ct,Jt;$e=z[Ve];Ve++)switch(Ct=$e.moved,Jt=$e.index,$e.status){case"deleted":for(;Q<Jt;)j(Q++);Ct===e&&(Te=J[Q],Te.$&&(Te.$.s(),Te.$=e),m.a.Ua(Te.Y,I).length&&(U.beforeRemove&&(ee.push(Te),ve++,Te.Aa===v?Te=null:ye.push(Te)),Te&&ge.push.apply(ge,Te.Y))),Q++;break;case"added":for(;de<Jt;)j(Q++);Ct!==e?(le.push(ee.length),j(Ct)):B($e.value)}for(;de<N.length;)j(Q++);ee._countWaitingForRemove=ve}m.a.g.set(I,E,ee),W(U.beforeMove,xe),m.a.D(ge,U.beforeRemove?m.oa:m.removeNode);var Qe,mn,Bt;try{Bt=I.ownerDocument.activeElement}catch{}if(le.length)for(;(Ve=le.shift())!=e;){for(Te=ee[Ve],Qe=e;Ve;)if((mn=ee[--Ve].Y)&&mn.length){Qe=mn[mn.length-1];break}for(N=0;Q=Te.Y[N];Qe=Q,N++)m.h.Wb(I,Q,Qe)}for(Ve=0;Te=ee[Ve];Ve++){for(Te.Y||m.a.extend(Te,g(I,F,Te.Aa,k,Te.pb)),N=0;Q=Te.Y[N];Qe=Q,N++)m.h.Wb(I,Q,Qe);!Te.Ed&&k&&(k(Te.Aa,Te.Y,Te.pb),Te.Ed=!0,Qe=Te.Y[Te.Y.length-1])}for(Bt&&I.ownerDocument.activeElement!=Bt&&Bt.focus(),W(U.beforeRemove,ye),Ve=0;Ve<ye.length;++Ve)ye[Ve].Aa=v;W(U.afterMove,xe),W(U.afterAdd,Ie)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,E,v,I){return(E=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(E.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var E=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(v,I,N,F){if(F=F||n,N=N||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=v.data("precompiled");return U||(U=v.text()||"",U=o.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),v.data("precompiled",U)),v=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(U,v,I),I.appendTo(F.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"</script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var LFt=ko;typeof window<"u"?(ko=window.ko,typeof qU<"u"?window.ko=qU:delete window.ko):(ko=global.ko,typeof qU<"u"?global.ko=qU:delete global.ko);var HA=LFt;/** - * @license - * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 - * Copyright (c) Steve Sanderson - * MIT license - */var Ste="__knockoutObservables",vte="__knockoutSubscribable";function dPe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=hPe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Ste||o===vte)&&!(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&&FFt(n,a)}}),e}function hPe(e,t){var n=e[Ste];return!n&&t&&(n={},Object.defineProperty(e,Ste,{value:n})),n}function NFt(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),dPe.call(i,e,[t]),e}function FFt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=BFt(e,t,i))})}function BFt(e,t,n){var i=kFt(e,n);return i.subscribe(t)}function kFt(e,t){var n=t[vte];if(!n){n=new e.subscribable,Object.defineProperty(t,vte,{value:n});var i={};UFt(t,n,i),zFt(e,t,n,i)}return n}function UFt(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 zFt(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 mPe(e,t){if(!e)return null;var n=hPe(e,!1);return n&&n[t]||null}function VFt(e,t){var n=mPe(e,t);n&&n.valueHasMutated()}function HFt(e){e.track=dPe,e.getObservable=mPe,e.valueHasMutated=VFt,e.defineProperty=NFt}var YU={attachToKo:HFt};var pPe="http://www.w3.org/2000/svg",_Pe="cesium-svgPath-svg",GFt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(pPe,"svg:svg");i.setAttribute("class",_Pe);let o=document.createElementNS(pPe,"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",`${_Pe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},XU=GFt;YU.attachToKo(HA);XU.register(HA);var be=HA;function KU(e){l(e)||(e=new qh),this._clock=e,this._eventHelper=new Tr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=be.observable($.now()),this.systemTime.equalityComparer=$.equals,this.startTime=be.observable(e.startTime),this.startTime.equalityComparer=$.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=be.observable(e.stopTime),this.stopTime.equalityComparer=$.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=be.observable(e.currentTime),this.currentTime.equalityComparer=$.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=be.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=be.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=be.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=be.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=be.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),be.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(KU.prototype,{clock:{get:function(){return this._clock}}});KU.prototype.synchronize=function(){let e=this._clock;this.systemTime=$.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};KU.prototype.isDestroyed=function(){return!1};KU.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var $U=KU;function jFt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var wte=jFt;function WFt(e,t){t=t??!0;let n=new me,i=new me;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,be.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Sn=WFt;var fI={};fI.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};fI.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};fI.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};fI.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};fI.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 Du=fI;function qFt(e,t,n,i,o){return n.call(i,e[t]),be.getObservable(e,t).subscribe(n,i,o)}var Ga=qFt;function gPe(e,t){this._command=e,t=t??G.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",be.track(this,["toggled","tooltip"])}Object.defineProperties(gPe.prototype,{command:{get:function(){return this._command}}});var zb=gPe;var GA="http://www.w3.org/2000/svg",xPe="http://www.w3.org/1999/xlink",G6,ZU=H.fromCssColorString("rgba(247,250,255,0.384)"),j6=H.fromCssColorString("rgba(143,191,255,0.216)"),Ite=H.fromCssColorString("rgba(153,197,255,0.098)"),W6=H.fromCssColorString("rgba(255,255,255,0.086)"),YFt=H.fromCssColorString("rgba(255,255,255,0.267)"),XFt=H.fromCssColorString("rgba(255,255,255,0)"),yPe=H.fromCssColorString("rgba(66,67,68,0.3)"),bPe=H.fromCssColorString("rgba(0,0,0,0.5)");function Vb(e){return H.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var QU={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 vm(e){let t=document.createElementNS(GA,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(vm(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(xPe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Pte(e,t,n){let i=document.createElementNS(GA,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(GA,"tspan");return o.textContent=n,i.appendChild(o),i}function KFt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var q6=new H;function ys(e,t){let n=t.alpha,i=1-n;return q6.red=e.red*i+t.red*n,q6.green=e.green*i+t.green*n,q6.blue=e.blue*i+t.blue*n,q6.toCssColorString()}function Dte(e,t,n){let i=QU[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 vm(o)}function $Ft(e,t,n){let i=QU[n],o=QU.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 vm(r)}function ZFt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&G6!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,_=Math.atan2(p,d)*180/Math.PI+90;_>180&&(_-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(G6=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=_):_<m?n.slower():_>m&&n.faster(),t.preventDefault()}else e===G6&&(G6=void 0),n.shuttleRingDragging=!1}function xy(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=[Ga(t,"toggled",this.setToggled,this),Ga(t,"tooltip",this.setTooltip,this),Ga(t.command,"canExecute",this.setEnabled,this)]}xy.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();ce(this)};xy.prototype.isDestroyed=function(){return!1};xy.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")}};xy.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")))};xy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function dI(e,t){e=Dn(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(GA,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",xPe);let s=document.createElementNS(GA,"g");this._topG=s,this._realtimeSVG=new xy($Ft(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new xy(Dte(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new xy(Dte(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new xy(Dte(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(GA,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=vm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=QU.animation_pathSwooshFX,f=QU.animation_pathPointer,d=vm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=vm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=vm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=vm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let _=61,m=vm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:_});this._knobDate=Pte(0,-24,""),this._knobTime=Pte(0,-7,""),this._knobStatus=Pte(0,-41,"");let y=vm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:_}),b=document.createElementNS(GA,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let x=this;function T(R){ZFt(x,R)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let C=this._knobTime.childNodes[0],A=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],w;this._subscriptions=[Ga(t.pauseViewModel,"toggled",function(R){w!==R&&(w=R,w?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ga(t,"shuttleRingAngle",function(R){KFt(x._shuttleRingPointer,x._knobOuter,R)}),Ga(t,"dateLabel",function(R){A.textContent!==R&&(A.textContent=R)}),Ga(t,"timeLabel",function(R){C.textContent!==R&&(C.textContent=R)}),Ga(t,"multiplierLabel",function(R){S.textContent!==R&&(S.textContent=R)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(dI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dI.prototype.isDestroyed=function(){return!1};dI.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 ce(this)};dI.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};dI.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Vb(this._themeNormal),n=Vb(this._themeHover),i=Vb(this._themeSelect),o=Vb(this._themeDisabled),r=Vb(this._themeKnob),s=Vb(this._themePointer),a=Vb(this._themeSwoosh),c=Vb(this._themeSwooshHover),u=vm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ys(t,ZU)},{tagName:"stop",offset:"12%","stop-color":ys(t,j6)},{tagName:"stop",offset:"46%","stop-color":ys(t,Ite)},{tagName:"stop",offset:"81%","stop-color":ys(t,W6)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ys(n,ZU)},{tagName:"stop",offset:"12%","stop-color":ys(n,j6)},{tagName:"stop",offset:"46%","stop-color":ys(n,Ite)},{tagName:"stop",offset:"81%","stop-color":ys(n,W6)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ys(i,ZU)},{tagName:"stop",offset:"12%","stop-color":ys(i,j6)},{tagName:"stop",offset:"46%","stop-color":ys(i,Ite)},{tagName:"stop",offset:"81%","stop-color":ys(i,W6)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ys(o,YFt)},{tagName:"stop",offset:"75%","stop-color":ys(o,XFt)}]},{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":ys(s,bPe)},{tagName:"stop",offset:"100%","stop-color":ys(s,bPe)}]},{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":ys(r,ZU)},{tagName:"stop",offset:"60%","stop-color":ys(r,yPe)},{tagName:"stop",offset:"85%","stop-color":ys(r,j6)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ys(r,yPe)},{tagName:"stop",offset:"60%","stop-color":ys(r,ZU)},{tagName:"stop",offset:"85%","stop-color":ys(r,W6)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var JU=dI;var QFt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Hb=15,hI=105;function TPe(e,t){return e-t}function Rte(e,t){let n=Uo(t,e,TPe);return n<0?~n:n}function JFt(e,t){if(Math.abs(e)<=Hb)return e/Hb;let n=Hb,i=hI,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 e2t(e,t,n){if(n.clockStep===bo.SYSTEM_CLOCK)return Hb;if(Math.abs(e)<=1)return e*Hb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Hb,r=hI,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 $d(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=$d.defaultDateFormatter,this._timeFormatter=$d.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,be.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks($d.defaultTicks),this.timeLabel=void 0,be.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,be.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,be.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===bo.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,be.defineProperty(this,"shuttleRingAngle",{get:function(){return e2t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,hI),-hI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=bo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===hI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=JFt(s,a);if(t.snapToTicks)u=a[Rte(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Hb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,be.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===ts.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===ts.LOOP_STOP)d=$.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=$.greaterThan(u,f)&&$.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,be.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===ts.UNBOUNDED)return!0;let c=s.systemTime;return $.greaterThanOrEquals(c,s.startTime)&&$.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,be.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new zb(n,{toggled:be.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new zb(i,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new zb(o,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==bo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Sn(function(){t._clockViewModel.clockStep=bo.SYSTEM_CLOCK},be.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new zb(r,{toggled:be.computed(function(){return e.clockStep===bo.SYSTEM_CLOCK}),tooltip:be.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Rte(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Rte(c,a)+1;u<a.length&&(s.multiplier=a[u])})}$d.defaultDateFormatter=function(e,t){let n=$.toGregorianDate(e);return`${QFt[n.month-1]} ${n.day} ${n.year}`};$d.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];$d.defaultTimeFormatter=function(e,t){let n=$.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`};$d.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};$d.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(TPe);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($d.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}}});$d._maxShuttleRingAngle=hI;$d._realtimeShuttleRingAngle=Hb;var ez=$d;function CPe(e){e=e??G.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??G.EMPTY_ARRAY,i=e.terrainProviderViewModels??G.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,be.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=be.getObservable(this,"imageryProviderViewModels"),r=be.pureComputed(function(){let d=o(),p={},_;for(_=0;_<d.length;_++){let b=d[_],x=b.category;l(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(_=0;_<m.length;_++){let b=m[_];y.push({name:b,providers:p[b]})}return y});this._imageryProviders=r;let s=be.getObservable(this,"terrainProviderViewModels"),a=be.pureComputed(function(){let d=s(),p={},_;for(_=0;_<d.length;_++){let b=d[_],x=b.category;l(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(_=0;_<m.length;_++){let b=m[_];y.push({name:b,providers:p[b]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,be.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,_=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(_)&&l(m)?`${_} -${m}`:l(_)?_:m}),this.buttonImageUrl=void 0,be.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=be.observable();this._currentImageryLayers=[],be.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,_=this._currentImageryLayers,m=_.length,y=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let x=y.length;for(let T=0;T<x;T++){let C=y.get(T);if(C===_[p]){y.remove(C),b=!0;break}}}if(l(d)){let x=d.creationCommand();if(Array.isArray(x)){let T=x.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let C=uc.fromProviderAsync(x[p]);y.add(C,0),this._currentImageryLayers.push(C)}}else{this._currentImageryLayers=[];let T=uc.fromProviderAsync(x);if(T.name=d.name,b)y.add(T,0);else{let C=y.get(0);l(C)&&y.remove(C),y.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=be.observable();be.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof vp),this._globe.terrainProvider=p;else if(l(p)){let _=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{_=!0,m()}),b=new DU(p).readyEvent.addEventListener(x=>{_||(this._globe.depthTestAgainstTerrain=!(x instanceof vp),this._globe.terrainProvider=x,b())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(CPe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var tz=CPe;function Y6(e,t){e=Dn(e);let n=new tz(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let _=document.createElement("div");_.className="cesium-baseLayerPicker-itemLabel",_.setAttribute("data-bind","text: name"),d.appendChild(_);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",y.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),b.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),b.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-item",C.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(C);let A=document.createElement("img");A.className="cesium-baseLayerPicker-itemIcon",A.setAttribute("data-bind","attr: { src: iconUrl }"),A.setAttribute("draggable","false"),C.appendChild(A);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),C.appendChild(S),be.applyBindings(n,i),be.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(w){i.contains(w.target)||r.contains(w.target)||(n.dropDownVisible=!1)},Nt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Y6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Y6.prototype.isDestroyed=function(){return!1};Y6.prototype.destroy=function(){return Nt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._element),be.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ce(this)};var nz=Y6;function APe(e){let t=e.creationFunction;l(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",be.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(APe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var bs=APe;function t2t(){let e=[],t=devicePixelRatio>=2;return e.push(new bs({name:"Bing Maps Aerial",iconUrl:on("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ty({style:ey.AERIAL})}})),e.push(new bs({name:"Bing Maps Aerial with Labels",iconUrl:on("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ty({style:ey.AERIAL_WITH_LABELS})}})),e.push(new bs({name:"Bing Maps Roads",iconUrl:on("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ty({style:ey.ROAD})}})),e.push(new bs({name:"ArcGIS World Imagery",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(gm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new bs({name:"ArcGIS World Hillshade",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(gm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new bs({name:"Esri World Ocean",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(gm.OCEANS,{enablePickFeatures:!1})}})),e.push(new bs({name:"Open\xADStreet\xADMap",iconUrl:on("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new py({url:"https://tile.openstreetmap.org/"})}})),e.push(new bs({name:"Stadia x Stamen Watercolor",iconUrl:on("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new py({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 bs({name:"Stadia x Stamen Toner",iconUrl:on("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. -https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new py({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 bs({name:"Stadia Alidade Smooth",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new py({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 bs({name:"Stadia Alidade Smooth Dark",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new py({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 bs({name:"Sentinel-2",iconUrl:on("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Jg.fromAssetId(3954)}})),e.push(new bs({name:"Blue Marble",iconUrl:on("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Jg.fromAssetId(3845)}})),e.push(new bs({name:"Earth at night",iconUrl:on("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Jg.fromAssetId(3812)}})),e.push(new bs({name:"Natural Earth\xA0II",iconUrl:on("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Cb.fromUrl(on("Assets/Textures/NaturalEarthII"))}})),e}var iz=t2t;function n2t(){let e=[];return e.push(new bs({name:"WGS84 Ellipsoid",iconUrl:on("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new vp({ellipsoid:te.WGS84})}})),e.push(new bs({name:"Cesium World Terrain",iconUrl:on("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return MC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var oz=n2t;function i2t(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 Ote(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var o2t=new _n,r2t=new h;function rz(e,t){let n=this,i=e.canvas,o=new Cf(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="",be.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=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=be.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=be.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=be.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new iy({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=be.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new pU({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=be.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=be.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=be.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=be.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Ote(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Ote(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=be.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new OU({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=be.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=be.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Sn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(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=be.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=be.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,o2t),_=r.pick(p,n._scene,r2t);if(l(_)){let m=d.cartesianToCartographic(_),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<y.length;++b){let x=y[b];if(l(x))for(let T=0;!f&&T<x.length;++T){let C=x[T];ae.contains(C.rectangle,m)&&(f=C)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=be.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(rz.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 Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(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}}});rz.prototype._update=function(){this.frustums&&(this.frustumStatisticText=i2t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Ote(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}`};rz.prototype.isDestroyed=function(){return!1};rz.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(),ce(this)};var sz=rz;function X6(e,t){e=Dn(e);let n=document.createElement("div"),i=new sz(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=Du.createSection,c=Du.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let _=document.createElement("div");u.appendChild(_);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),_.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),_.appendChild(y);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),_.appendChild(b);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),_.appendChild(x);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),C=document.createElement("div");C.className="cesium-cesiumInspector-pickSection",T.appendChild(C);let A=document.createElement("input");A.type="button",A.value="Pick a primitive",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(A),C.appendChild(S),C.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),C.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),C.appendChild(this._primitiveOnly);let w=a(s,"Terrain","terrainVisible","toggleTerrain"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",w.appendChild(R);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),S=document.createElement("div"),S.appendChild(P),S.className="cesium-cesiumInspector-center",R.appendChild(S);let O=document.createElement("div");R.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.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 N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(N),O.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let U=document.createElement("table"),k=document.createElement("tr"),z=document.createElement("tr"),B=document.createElement("td");B.appendChild(L);let j=document.createElement("td");j.appendChild(g);let W=document.createElement("td");W.appendChild(E),k.appendChild(B),k.appendChild(j),k.appendChild(W);let J=document.createElement("td"),Y=document.createElement("td");Y.appendChild(v);let ee=document.createElement("td");ee.appendChild(I),z.appendChild(J),z.appendChild(Y),z.appendChild(ee),U.appendChild(k),U.appendChild(z),O.appendChild(U),R.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),R.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),be.applyBindings(i,this._element)}Object.defineProperties(X6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});X6.prototype.isDestroyed=function(){return!1};X6.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};var az=X6;function s2t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof ws&&(e.tileset=n.primitive),e.pickActive=!1}}function SPe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof ws&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var a2t={maximumFractionDigits:3};function cz(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,a2t):Math.round(t).toLocaleString()}function lz(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[jo.PICK]:e._statisticsPerPass[jo.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>${cz(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${cz(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${cz(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function vPe(){let e=Di.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${cz(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${cz(e.texturesByteLength)}</li> - </ul> - `}var c2t=[{text:"Highlight",value:tu.HIGHLIGHT},{text:"Replace",value:tu.REPLACE},{text:"Mix",value:tu.MIX}],EPe=new H(1,1,0,.4),l2t=new H,K6=new H;function ja(e,t){let n=this,i=e.canvas;this._eventHandler=new Cf(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new iy({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,be.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=be.observable({}),this.properties=[],be.defineProperty(this,"properties",function(){let B=[],j=n._properties();for(let W in j)j.hasOwnProperty(W)&&B.push(W);return B});let o=be.observable();be.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(B){o(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=B)}}),this.dynamicScreenSpaceError=!1;let r=be.observable();be.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(B){r(B),l(n._tileset)&&(n._tileset.colorBlendMode=B,n._scene.requestRender())}}),this.colorBlendMode=tu.HIGHLIGHT;let s=be.observable(),a=be.observable();be.defineProperty(this,"picking",{get:function(){return a()},set:function(B){a(B),B?n._eventHandler.setInputAction(function(j){let W=e.pick(j.endPosition);if(W instanceof oa?(n.feature=W,n.tile=W.content.tile):l(W)&&l(W.content)?(n.feature=void 0,n.tile=W.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(W)&&l(W.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(j.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=W.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let c=be.observable();be.defineProperty(this,"colorize",{get:function(){return c()},set:function(B){c(B),l(n._tileset)&&(n._tileset.debugColorizeTiles=B,n._scene.requestRender())}}),this.colorize=!1;let u=be.observable();be.defineProperty(this,"wireframe",{get:function(){return u()},set:function(B){u(B),l(n._tileset)&&(n._tileset.debugWireframe=B,n._scene.requestRender())}}),this.wireframe=!1;let f=be.observable();be.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(B){f(B),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=B,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=be.observable();be.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(B){d(B),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=B,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=be.observable();be.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(B){p(B),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=B,n._scene.requestRender())}}),this.showRequestVolumes=!1;let _=be.observable();be.defineProperty(this,"freezeFrame",{get:function(){return _()},set:function(B){_(B),l(n._tileset)&&(n._tileset.debugFreezeFrame=B,n._scene.debugShowFrustumPlanes=B,n._scene.requestRender())}}),this.freezeFrame=!1,be.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(B){s(B),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=B,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=be.observable();be.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(B){m(B),l(n._tileset)&&(n._tileset.debugShowGeometricError=B,n._scene.requestRender())}}),this.showGeometricError=!1;let y=be.observable();be.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(B){y(B),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=B,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=be.observable();be.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(B){b(B),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=B,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=be.observable();be.defineProperty(this,"showUrl",{get:function(){return x()},set:function(B){x(B),l(n._tileset)&&(n._tileset.debugShowUrl=B,n._scene.requestRender())}}),this.showUrl=!1;let T=be.observable();be.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(B){B=Number(B),isNaN(B)||(T(B),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=B))}}),this.maximumScreenSpaceError=16;let C=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(B){B=Number(B),isNaN(B)||(C(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=B))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,be.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(B){let j=Math.pow(B,6);C(j),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=j)}});let A=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return A()},set:function(B){B=Number(B),isNaN(B)||(A(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=B))}}),this.dynamicScreenSpaceErrorFactor=24;let S=s2t(this),w=be.observable();be.defineProperty(this,"pickActive",{get:function(){return w()},set:function(B){w(B),B?n._eventHandler.setInputAction(S,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let R=be.observable();be.defineProperty(this,"pointCloudShading",{get:function(){return R()},set:function(B){R(B),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=B)}}),this.pointCloudShading=!1;let P=be.observable();be.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(B){B=Number(B),isNaN(B)||(P(B),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=B))}}),this.geometricErrorScale=1;let O=be.observable();be.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(B){B=Number(B),isNaN(B)||(O(B),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=B===0?void 0:B))}}),this.maximumAttenuation=0;let L=be.observable();be.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(B){B=Number(B),isNaN(B)||(L(B),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=B===0?void 0:B))}}),this.baseResolution=0;let g=be.observable();be.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(B){g(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=B)}}),this.eyeDomeLighting=!1;let E=be.observable();be.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(B){B=Number(B),isNaN(B)||(E(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=B))}}),this.eyeDomeLightingStrength=1;let v=be.observable();be.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(B){B=Number(B),isNaN(B)||(v(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=B))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=be.observable();be.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(B){I(B),l(n._tileset)&&(n._tileset.skipLevelOfDetail=B)}}),this.skipLevelOfDetail=!0;let N=be.observable();be.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(B){B=Number(B),isNaN(B)||(N(B),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=B))}}),this.skipScreenSpaceErrorFactor=16;let F=be.observable();be.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(B){B=Number(B),isNaN(B)||(F(B),l(n._tileset)&&(n._tileset.baseScreenSpaceError=B))}}),this.baseScreenSpaceError=1024;let U=be.observable();be.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(B){B=Number(B),isNaN(B)||(U(B),l(n._tileset)&&(n._tileset.skipLevels=B))}}),this.skipLevels=1;let k=be.observable();be.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(B){k(B),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=B)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let z=be.observable();be.defineProperty(this,"loadSiblings",{get:function(){return z()},set:function(B){z(B),l(n._tileset)&&(n._tileset.loadSiblings=B)}}),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)||SPe(this,!0)}Object.defineProperties(ja.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 c2t}},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=lz(e,!1),this._pickStatisticsText=lz(e,!0),this._resourceCacheStatisticsText=vPe(),SPe(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,l2t):H.WHITE:t.color=K6,this._scene.requestRender()),l(e)&&(H.clone(e.color,K6),e.color=EPe,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()&&!Mte(t.content)&&(t.color=K6,this._scene.requestRender()),l(e)&&!Mte(e.content)&&(H.clone(e.color,K6),e.color=EPe,this._scene.requestRender()),this._tile=e}}});function Mte(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(!Mte(t[i]))return!1;return!0}return!1}ja.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ja.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ja.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ja.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ja.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ja.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ja.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ja.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ja.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ja.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ja.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 EA(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ja.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ja.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=lz(e,!1),this._pickStatisticsText=lz(e,!0),this._resourceCacheStatisticsText=vPe())};ja.prototype.isDestroyed=function(){return!1};ja.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ce(this)};ja.getStatistics=lz;var uz=ja;function $6(e,t){e=Dn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new uz(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=Du.createSection,c=Du.createCheckbox,u=Du.createRangeInput,f=Du.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),_=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let C=document.createElement("label");C.className="field-label",C.appendChild(document.createTextNode("Properties: "));let A=document.createElement("div");A.setAttribute("data-bind","text: properties"),T.appendChild(C),T.appendChild(A),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let S=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(w),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let R=document.createElement("div");R.setAttribute("data-bind","visible: pointCloudShading"),R.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),R.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),R.appendChild(u("Base Resolution","baseResolution",0,1,.01)),R.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(R);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),R.appendChild(P),_.appendChild(c("Freeze Frame","freezeFrame")),_.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),_.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),_.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(E),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(v);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let U=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(U);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")),x.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let z=document.createElement("div");z.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(z);let B=document.createElement("div");B.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(B);let j=document.createElement("div");j.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(j),x.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(c("Load siblings of visible tiles","loadSiblings")),be.applyBindings(o,n)}Object.defineProperties($6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$6.prototype.isDestroyed=function(){return!1};$6.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};var fz=$6;function Z6(e,t){l(t)||(t=document.body),t=Dn(t);let n=this,i=be.observable(Ir.fullscreen),o=be.observable(Ir.enabled),r=t.ownerDocument;this.isFullscreen=void 0,be.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,be.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Ir.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){Ir.fullscreen?Ir.exitFullscreen():Ir.requestFullscreen(n._fullscreenElement)},be.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Dn(e)??r.body,this._callback=function(){i(Ir.fullscreen)},r.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(Z6.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});Z6.prototype.isDestroyed=function(){return!1};Z6.prototype.destroy=function(){document.removeEventListener(Ir.changeEventName,this._callback),ce(this)};var dz=Z6;var u2t="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",f2t="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 Q6(e,t){e=Dn(e);let n=new dz(t,e);n._exitFullScreenPath=f2t,n._enterFullScreenPath=u2t;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),be.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(Q6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Q6.prototype.isDestroyed=function(){return!1};Q6.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var hz=Q6;function wPe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",be.track(this,["tooltip"])}Object.defineProperties(wPe.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 mz=wPe;function J6(e,t,n){e=Dn(e);let i=new mz(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),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(J6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});J6.prototype.isDestroyed=function(){return!1};J6.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var pz=J6;var IPe=1e3;function Zd(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new UC({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 me,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=DPe,this._handleArrowUp=PPe;let t=this;this._suggestionsVisible=be.pureComputed(function(){let o=be.getObservable(t,"_suggestions")().length>0,r=be.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Sn(function(i){if(i=i??pb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)g2t(t);else return p2t(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?PPe(t):r?DPe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;MPe(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??Zd.flyToDestination,this._focusTextbox=!1,be.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=be.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Zd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,be.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,be.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,be.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Zd.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}}});Zd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function PPe(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],Zd._adjustSuggestionsScroll(e,n)}function DPe(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],Zd._adjustSuggestionsScroll(e,i)}function d2t(e,t){let n=l(t)?t.availability:void 0;return l(n)?zC(t,[e]).then(function(i){return e=i[0],e.height+=IPe,e}):(e.height+=IPe,Promise.resolve(e))}function h2t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ae?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ae.center(t):a=jC(t,n):t=i.cartesianToCartographic(t),l(a)||(a=d2t(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function m2t(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 p2t(e,t,n){let i=e._searchText;if(OPe(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 m2t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Nte(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=RPe(e,ow.getCreditsFromResult(s[0]));l(a)||Lte(e,t[o].credit);return}e._searchText=`${i} (not found)`}function Lte(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function RPe(e,t){return l(t)&&t.forEach(n=>Lte(e,n)),t}function Nte(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function _2t(e,t){let n=Dn(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 g2t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function OPe(e){return/^\s*$/.test(e)}function MPe(e){be.getObservable(e,"_suggestions").removeAll()}async function y2t(e){if(!e.autoComplete)return;let t=e._searchText;if(MPe(e),Nte(e),!OPe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,pb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=ow.getCreditsFromResult(r);o=o&&!l(s),RPe(e,s)}),o&&Lte(e,n.credit)}if(e._suggestions.length>=5)return}}Zd.flyToDestination=h2t;Zd._updateSearchSuggestions=y2t;Zd._adjustSuggestionsScroll=_2t;Zd.prototype.isDestroyed=function(){return!1};Zd.prototype.destroy=function(){return Nte(this),ce(this)};var _z=Zd;var b2t="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",x2t="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 e9(e){let t=Dn(e.container),n=new _z(e);n._startSearchPath=b2t,n._stopSearchPath=x2t;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),be.applyBindings(n,i),be.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Nt.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(e9.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});e9.prototype.isDestroyed=function(){return!1};e9.prototype.destroy=function(){let e=this._container;return Nt.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(),be.cleanNode(this._form),be.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ce(this)};var gz=e9;function T2t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function NPe(e,t){be.track(e);for(let n=0;n<e.sublayers.length;n++)NPe(e.sublayers[n],t)}function t9(e){return e.modelName==="FullModel"}function FPe(e){return e.modelName==="Overview"}function BPe(e){return FPe(e)||t9(e)}function LPe(e,t){if(BPe(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:be.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function C2t(e,t){if(BPe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");t9(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function A2t(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 E2t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:be.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:be.observable(!0),index:-1}],currentLayer:be.observable(),expandClickHandler:T2t,setOptionDisable:function(i,o){be.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){C2t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){NPe(n[i],this.viewModel);let o=LPe(n[i],this.viewModel);l(o)&&(FPe(o)||!l(this.viewModel.defaultLayer)&&t9(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=LPe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=t9(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return A2t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var yz=E2t;function S2t(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 yz(t);be.track(o),be.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var Fte=S2t;var v2t="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",w2t="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 Bte(){this._cameraClicked=new me,this._closeClicked=new me,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",be.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,be.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?w2t:v2t}}),be.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Bte.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Bte.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var bz=Bte;function n9(e){e=Dn(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 bz;be.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=on("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Ga(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,_=f.firstElementChild;if(_!==null&&f.childNodes.length===1){let y=window.getComputedStyle(_);if(y!==null){let b=y["background-color"],x=H.fromCssColorString(b);l(x)&&x.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(n9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});n9.prototype.isDestroyed=function(){return!1};n9.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ce(this)};var xz=n9;function kPe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",be.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(kPe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var Tz=kPe;function i9(e){let t=Dn(e.container),n=new Tz,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=on("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=on("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),be.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(_){o.contains(_.target)||(n.showInstructions=!1)},Nt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(i9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});i9.prototype.isDestroyed=function(){return!1};i9.prototype.destroy=function(){return Nt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var Cz=i9;function kte(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,be.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=yU.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(kte.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});kte.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ce(this)};var Az=kte;function o9(e){let t=Dn(e.container),n=new Az(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),be.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(o9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});o9.prototype.isDestroyed=function(){return!1};o9.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var Ez=o9;function r9(e){this._scene=e,this._orthographic=e.camera.frustum instanceof cn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,be.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;be.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Sn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Tr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof cn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(r9.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}}});r9.prototype.isDestroyed=function(){return!1};r9.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var Sz=r9;var I2t="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",P2t="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 s9(e,t){e=Dn(e);let n=new Sz(t);n._perspectivePath=I2t,n._orthographicPath=P2t;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),be.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Nt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(s9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s9.prototype.isDestroyed=function(){return!1};s9.prototype.destroy=function(){return this._viewModel.destroy(),Nt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var vz=s9;function a9(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Tr,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",be.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,be.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(a9.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}}});a9.prototype.isDestroyed=function(){return!1};a9.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var wz=a9;var D2t="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",R2t="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",O2t="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 c9(e,t,n){e=Dn(e);let i=new wz(t,n);i._globePath=D2t,i._flatMapPath=R2t,i._columbusViewPath=O2t;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),be.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Nt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(c9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c9.prototype.isDestroyed=function(){return!1};c9.prototype.destroy=function(){return this._viewModel.destroy(),Nt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var Iz=c9;var M2t=new V,l9="-1000px";function Pz(e,t,n){this._scene=e,this._screenPositionX=l9,this._screenPositionY=l9,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,be.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,be.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),be.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return ji.worldToWindowCoordinates(e,i,o)}}Pz.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,M2t);if(!l(e))this._screenPositionX=l9,this._screenPositionY=l9;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`}}};Pz.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:os.EXPONENTIAL_OUT})};Pz.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:os.EXPONENTIAL_OUT})};Object.defineProperties(Pz.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Dz=Pz;function u9(e,t){e=Dn(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 Dz(t,this._element,this._container);this._viewModel=c,be.applyBindings(this._viewModel,this._element)}Object.defineProperties(u9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});u9.prototype.isDestroyed=function(){return!1};u9.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),ce(this)};var Rz=u9;function jA(e,t,n){this._color=e,this._height=t,this._base=n??0}jA.prototype.getHeight=function(){return this._height};jA.prototype.getBase=function(){return this._base};jA.prototype.getStartTime=function(){return this._start};jA.prototype.getStopTime=function(){return this._stop};jA.prototype.setRange=function(e,t){this._start=e,this._stop=t};jA.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=$.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=$.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 Oz=jA;function UPe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new H(.5,.5,.5,1),this.backgroundColor=i||new H(0,0,0,0)}UPe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=$.addSeconds(t.startJulian,t.duration,new $);if($.lessThan(n,o)&&$.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if($.lessThanOrEquals(n,r)&&$.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=$.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new $);!l(a)&&$.greaterThanOrEquals(u,n)?a=s:!l(c)&&$.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var Mz=UPe;var Ute=1e12,Qd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Hl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Gb=[.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],L2t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gl(e,t){e=Dn(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=Qd.none,this._touchMode=Hl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=N2t(this),this._onMouseUp=F2t(this),this._onMouseMove=B2t(this),this._onMouseWheel=k2t(this),this._onTouchStart=U2t(this),this._onTouchMove=V2t(this),this._onTouchEnd=z2t(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Gl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Gl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ce(this)};Gl.prototype.addHighlightRange=function(e,t,n){let i=new Oz(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Gl.prototype.addTrack=function(e,t,n,i){let o=new Mz(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Gl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=$.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ts.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=$.secondsDifference(o,i),s=$.secondsDifference(i,this._startJulian),a=$.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=$.addSeconds(this._endJulian,s,new $),this._startJulian=i,this._timeBarSecondsSpan=$.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=$.addSeconds(this._startJulian,a,new $),this._endJulian=o,this._timeBarSecondsSpan=$.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Gl.prototype.zoomFrom=function(e){let t=$.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($.addSeconds(this._startJulian,t-t*e,new $),$.addSeconds(this._endJulian,n*e-n,new $))};function zte(e){return e<10?`0${e.toString()}`:e.toString()}Gl.prototype.makeLabel=function(e){let t=$.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`${L2t[t.month-1]} ${t.day} ${t.year} ${zte(t.hour)}:${zte(t.minute)}:${zte(t.second)}${i}`};Gl.prototype.smallestTicInPixels=7;Gl.prototype._makeTics=function(){let e=this._timeBarEle,t=$.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=$.addSeconds(this._startJulian,a,new $)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=$.addSeconds(this._startJulian,c,new $));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let _=this._startJulian,m=Math.min(d/p*1e-5,.4),y,b=$.toGregorianDate(_);d>31536e4?y=$.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?y=$.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?y=$.fromDate(new Date(Date.UTC(b.year,0))):y=$.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let x=$.secondsDifference(this._startJulian,$.addSeconds(y,m,new $)),T=x+d;this._epochJulian=y;function C(B){return Math.floor(x/B)*B}function A(B,j){return Math.ceil(B/j+.5)*j}function S(B){return(B-x)/d}function w(B,j){return B-j*Math.round(B/j)}this._rulerEle.innerHTML=this.makeLabel($.addSeconds(this._endJulian,-a,new $));let R=this._rulerEle.offsetWidth+20;R<30&&(R=180);let P=f;f-=u;let O={startTime:x,startJulian:_,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:S};this._highlightRanges.forEach(function(B){s+=B.render(O)});let L=0,g=0,E=0,v=R/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,N=-1,F=Gb.length,U;for(U=0;U<F;++U){let B=Gb[U];if(++I,L=B,B>v&&B>f)break;N<0&&p*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(w(L,Gb[I]))<1e-5){Gb[I]>=f&&(g=Gb[I]);break}if(N>=0)for(;N<I;){if(Math.abs(w(g,Gb[N]))<1e-5&&Gb[N]>=f){E=Gb[N];break}++N}}f=P,f>u&&E<1e-5&&Math.abs(f-L)>u&&(E=f,f<=L+u&&(g=0));let k=-999999,z;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=C(E);o<=T;o=A(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=C(g);o<=T;o=A(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,T+=L,o=C(L);let B=$.computeTaiMinusUtc(y);for(;o<=T;){let j=$.addSeconds(_,o-x,new $);if(L>2.1){let ee=$.computeTaiMinusUtc(j);Math.abs(ee-B)>.1&&(o+=ee-B,j=$.addSeconds(_,o-x,new $))}let W=Math.round(p*S(o)),J=this.makeLabel(j);this._rulerEle.innerHTML=J,z=this._rulerEle.offsetWidth,z<10&&(z=R);let Y=W-(z/2-1);Y>k?(k=Y+z+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${W.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${Y.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${W.toString()}px;"></span>`,o=A(o,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),O.y=0,this._trackList.forEach(function(B){B.render(r._context,O),O.y+=B.height})};Gl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=$.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($.addSeconds(this._startJulian,this._timelineDrag,new $),$.addSeconds(this._endJulian,this._timelineDrag,new $)))};Gl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=$.addSeconds(this._startJulian,t,new $),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 N2t(e){return function(t){e._mouseMode!==Qd.touchOnly&&(t.button===0?(e._mouseMode=Qd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Qd.zoom:e._mouseMode=Qd.slide)),t.preventDefault()}}function F2t(e){return function(t){e._mouseMode=Qd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function B2t(e){return function(t){let n;if(e._mouseMode===Qd.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===Qd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo($.addSeconds(e._startJulian,i,new $),$.addSeconds(e._endJulian,i,new $))}}else e._mouseMode===Qd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function k2t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Ute=Math.max(Math.min(Math.abs(n),Ute),1),n/=Ute,e.zoomFrom(Math.pow(1.05,-n))}}function U2t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Qd.touchOnly,n===1?(i=$.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Hl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Hl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Hl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Hl.ignore}}function z2t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Hl.singleTap?(e._touchMode=Hl.scrub,e._onTouchMove(t)):e._touchMode===Hl.scrub&&e._onTouchMove(t),e._mouseMode=Qd.touchOnly,n!==1?e._touchMode=n>0?Hl.ignore:Hl.none:e._touchMode===Hl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function V2t(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Hl.singleTap&&(e._touchMode=Hl.slideZoom),e._mouseMode=Qd.touchOnly,e._touchMode===Hl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Hl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=$.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new $)):(n=e._touchState.centerX-r,a=$.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new $)),e.zoomTo(a,$.addSeconds(a,e._timeBarSecondsSpan*c,new $)),e._touchState.centerX=r,e._touchState.spanX=s))}}Gl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var Lz=Gl;var VPe=er(zPe(),1);function H2t(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 HPe(){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 G2t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(HPe(),e._locked=!1),e._noSleep.disable(),Ir.exitFullscreen(),n(!1)):(Ir.fullscreen||Ir.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=H2t("landscape")),t.useWebVR=!0,n(!0)))}function f9(e,t){let n=this,i=be.observable(Ir.enabled),o=be.observable(!1);this.isVRMode=void 0,be.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,be.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Ir.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=be.observable(!1);this._isOrthographic=void 0,be.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Tr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof cn)}),this._locked=!1,this._noSleep=new VPe.default,this._command=Sn(function(){G2t(n,e,o,r)},be.getObservable(this,"isVREnabled")),this._vrElement=Dn(t)??document.body,this._callback=function(){!Ir.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(HPe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(f9.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});f9.prototype.isDestroyed=function(){return!1};f9.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Ir.changeEventName,this._callback),ce(this)};var Fz=f9;var j2t="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",W2t="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 d9(e,t,n){e=Dn(e);let i=new Fz(t,n);i._exitVRPath=W2t,i._enterVRPath=j2t;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),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(d9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d9.prototype.isDestroyed=function(){return!1};d9.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var Bz=d9;var GPe=new re;function qPe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function q2t(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 Y2t(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 jPe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof ar)return i;if(n instanceof oa)return new ar({name:Y2t(n),description:q2t(n),feature:n})}if(l(e.scene.globe))return $2t(e,t.position)}var X2t=new $;function Hte(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;$.equals(i,o)&&(o=$.addSeconds(i,D.EPSILON2,X2t)),e.updateFromClock(),e.zoomTo(i,o)}}}var K2t=new h;function $2t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new ar({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=WPe();return}let a=s[0],c=new ar({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,K2t);c.position=new ul(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=WPe())}),r}function WPe(){return new ar({id:"None",description:"No features found."})}function Z2t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=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(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let _=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${_}px`,e.forceResize()}}function no(e,t){e=Dn(e),t=t??G.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new qh,u=new $U(c),f=!0);let d=new Jk(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=d.scene,_=new Tr;_.add(c.onTick,no.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(j),m=new Rz(j,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",o.appendChild(j),y=new xz(j);let W=y.viewModel;_.add(W.cameraClicked,no.prototype._onInfoBoxCameraClicked,this),_.add(W.closeClicked,no.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let x;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",b.appendChild(j);let W;typeof t.geocoder=="string"?W=[new UC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(W=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new gz({container:j,geocoderServices:W,scene:p}),_.add(x.viewModel.search.beforeExecute,no.prototype._clearObjects,this)}let T;(!l(t.homeButton)||t.homeButton!==!1)&&(T=new pz(b,p),l(x)&&_.add(T.viewModel.command.afterExecute,function(){let j=x.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),_.add(T.viewModel.command.beforeExecute,no.prototype._clearTrackedObject,this));let C;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(C=new Iz(b,p));let A;t.projectionPicker&&(A=new vz(b,p));let S,w;if(n){let j=t.imageryProviderViewModels??iz(),W=t.terrainProviderViewModels??oz();S=new nz(b,{globe:p.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:W,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let R;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let W=window.localStorage.getItem("cesium-hasSeenNavHelp");l(W)&&W?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}R=new Cz({container:b,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??j})}let P;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",o.appendChild(j),P=new JU(j,new ez(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",o.appendChild(j),O=new Lz(j,c),O.addEventListener("settime",qPe,!1),O.zoomTo(c.startTime,c.stopTime)}let L,g,E;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(E=document.createElement("div"),E.className="cesium-viewer-fullscreenContainer",o.appendChild(E),L=new hz(E,t.fullscreenElement),g=Ga(L.viewModel,"isFullscreenEnabled",function(j){E.style.display=j?"block":"none",l(O)&&(O.container.style.right=`${E.clientWidth}px`,O.resize())}));let v,I,N;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",o.appendChild(j),v=new Bz(j,p,t.fullScreenElement),I=Ga(v.viewModel,"isVREnabled",function(W){j.style.display=W?"block":"none",l(L)&&(j.style.right=`${E.clientWidth}px`),l(O)&&(O.container.style.right=`${j.clientWidth}px`,O.resize())}),N=Ga(v.viewModel,"isVRMode",function(W){Z2t(i,W)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=g,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=T,this._sceneModePicker=C,this._projectionPicker=A,this._baseLayerPicker=S,this._navigationHelpButton=R,this._animation=P,this._timeline=O,this._fullscreenButton=L,this._vrButton=v,this._geocoder=x,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new me;let F=this._cesiumWidget.dataSources,U=this._cesiumWidget.dataSourceDisplay;_.add(F.dataSourceAdded,no.prototype._onDataSourceAdded,this),_.add(F.dataSourceRemoved,no.prototype._onDataSourceRemoved,this),_.add(p.postUpdate,no.prototype.resize,this);let k=F.length;for(let j=0;j<k;j++)this._dataSourceAdded(F,F.get(j));this._dataSourceAdded(void 0,U.defaultDataSource),_.add(F.dataSourceAdded,no.prototype._dataSourceAdded,this),_.add(F.dataSourceRemoved,no.prototype._dataSourceRemoved,this);function z(j){let W=jPe(i,j);l(W)?X.getValueOrUndefined(W.position,i.clock.currentTime)?i.trackedEntity=W:i.zoomTo(W):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function B(j){i.selectedEntity=jPe(i,j)}d.screenSpaceEventHandler.setInputAction(B,Cn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(z,Cn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(no.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,Hte(this._timeline,e))}}});no.prototype.extend=function(e,t){e(this,t)};no.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 m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,_=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,b=c.container,x=b.style;p=b.clientHeight+3,x.left=`${f}px`;let T=0;l(m)&&(T+=m.container.clientWidth),l(y)&&(T+=y.container.clientWidth),x.right=`${T}px`,c.resize()}!r&&l(this._fullscreenButton)&&(_=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${_}px`,this._lastWidth=n,this._lastHeight=i};no.prototype.forceResize=function(){this._lastWidth=0,this.resize()};no.prototype.render=function(){this._cesiumWidget.render()};no.prototype.isDestroyed=function(){return!1};no.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.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",qPe,!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(),ce(this)};no.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(no.prototype._onEntityCollectionChanged,this)};no.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(no.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};no.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};no.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,GPe)!==ut.FAILED?n=GPe.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=h.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=X.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};no.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)}};no.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)}};no.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};no.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};no.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};no.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Hte(this.timeline,e)};no.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Hte(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,no.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};no.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};no.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};no.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Gte=no;function Q2t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new fz(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var jte=Q2t;function J2t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new az(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Wte=J2t;function eBt(e,t){t=t??G.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new me,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Dn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){YPe(s,u),s=f,qte(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?qte(s,u):YPe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){WA(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let _=0;_<p;_++){let m=d[_],y=new FileReader;y.onload=tBt(e,m,c,a),y.onerror=nBt(e,m),y.readAsText(m)}}qte(s,u),e.destroy=pB(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function WA(e){e.stopPropagation(),e.preventDefault()}function YPe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",WA,!1),n.removeEventListener("dragover",WA,!1),n.removeEventListener("dragexit",WA,!1))}function qte(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",WA,!1),e.addEventListener("dragover",WA,!1),e.addEventListener("dragexit",WA,!1)}function tBt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=wF.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=nb.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=IC.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=U2.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 nBt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Yte=eBt;function iBt(e,t){t=t??G.EMPTY_OBJECT;let n=new Ez({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Xte=iBt;function XPe(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 Jd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=be.observable();return be.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XPe(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===za.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===za.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===za.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&qp(t)}})}var oBt=new h,rBt=new h,sBt=new qa,aBt=new Z;function qp(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,oBt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,rBt),i=sBt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=Z.fromHeadingPitchRoll(i,aBt),r=Z.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Jd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XPe(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,qp(t)}}});Jd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Jd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Jd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Jd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Jd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Jd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Jd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new mA({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Jd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Jd.prototype.isDestroyed=function(){return!1};Jd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ce(this)};var kz=Jd;function h9(e,t){e=Dn(e);let n=document.createElement("div"),i=new kz(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=Du,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),_=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,b=D.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-b,+b)),d.appendChild(c("Pitch","angleY",-b,+b)),d.appendChild(c("Roll","angleZ",-b,+b)),Kte("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Kte("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Kte("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");_.appendChild(x);let T=document.createElement("textarea");T.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(T);let C=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(C);let A=document.createElement("label");A.style.display="block",A.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(A),be.applyBindings(i,n)}Object.defineProperties(h9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});h9.prototype.isDestroyed=function(){return!1};h9.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};function Kte(e,t,n,i,o,r,s,a,c,u,f,d,p,_){let m=Du.createRangeInputWithDynamicMinMax,y=_.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,d))}var Uz=h9;function cBt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new Uz(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var $te=cBt;globalThis.CESIUM_VERSION="1.129";var lBt="1.129";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManageIndexedDB,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelInstanceCollection,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileCoordinatesImageryProviderFlw,TileCoordinatesImageryProviderJww,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctahedralProjectionAtlasFS,_shadersOctahedralProjectionFS,_shadersOctahedralProjectionVS,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); diff --git a/src/renderer/public/sdk/Cesium/index.js b/src/renderer/public/sdk/Cesium/index.js deleted file mode 100644 index fb8b7c8..0000000 --- a/src/renderer/public/sdk/Cesium/index.js +++ /dev/null @@ -1,16851 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -var zIe=Object.create;var HJ=Object.defineProperty;var VIe=Object.getOwnPropertyDescriptor;var HIe=Object.getOwnPropertyNames;var GIe=Object.getPrototypeOf,jIe=Object.prototype.hasOwnProperty;var wR=(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 df=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var WIe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of HIe(t))!jIe.call(e,o)&&o!==n&&HJ(e,o,{get:()=>t[o],enumerable:!(i=VIe(t,o))||i.enumerable});return e};var $r=(e,t,n)=>(n=e!=null?zIe(GIe(e)):{},WIe(t||!e||!e.__esModule?HJ(n,"default",{value:e,enumerable:!0}):n,e));var IR=df((kNt,GJ)=>{var Dp=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)};Dp.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}};Dp.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};Dp.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};Dp.prototype.random_int31=function(){return this.random_int()>>>1};Dp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Dp.prototype.random=function(){return this.random_int()*(1/4294967296)};Dp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Dp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};GJ.exports=Dp});var mee=df((cC,lC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cC=="object"&&cC&&!cC.nodeType&&cC,n=typeof lC=="object"&&lC&&!lC.nodeType&&lC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,_="-",m=/^xn--/,y=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=s-a,C=Math.floor,A=String.fromCharCode,S;function w(k){throw new RangeError(b[k])}function R(k,z){for(var B=k.length,j=[];B--;)j[B]=z(k[B]);return j}function D(k,z){var B=k.split("@"),j="";B.length>1&&(j=B[0]+"@",k=B[1]),k=k.replace(x,".");var W=k.split("."),J=R(W,z).join(".");return j+J}function M(k){for(var z=[],B=0,j=k.length,W,J;B<j;)W=k.charCodeAt(B++),W>=55296&&W<=56319&&B<j?(J=k.charCodeAt(B++),(J&64512)==56320?z.push(((W&1023)<<10)+(J&1023)+65536):(z.push(W),B--)):z.push(W);return z}function L(k){return R(k,function(z){var B="";return z>65535&&(z-=65536,B+=A(z>>>10&1023|55296),z=56320|z&1023),B+=A(z),B}).join("")}function g(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function E(k,z){return k+22+75*(k<26)-((z!=0)<<5)}function v(k,z,B){var j=0;for(k=B?C(k/f):k>>1,k+=C(k/z);k>T*c>>1;j+=s)k=C(k/T);return C(j+(T+1)*k/(k+u))}function I(k){var z=[],B=k.length,j,W=0,J=p,Y=d,ee,Q,de,ge,le,ye,be,Ie,Te;for(ee=k.lastIndexOf(_),ee<0&&(ee=0),Q=0;Q<ee;++Q)k.charCodeAt(Q)>=128&&w("not-basic"),z.push(k.charCodeAt(Q));for(de=ee>0?ee+1:0;de<B;){for(ge=W,le=1,ye=s;de>=B&&w("invalid-input"),be=g(k.charCodeAt(de++)),(be>=s||be>C((r-W)/le))&&w("overflow"),W+=be*le,Ie=ye<=Y?a:ye>=Y+c?c:ye-Y,!(be<Ie);ye+=s)Te=s-Ie,le>C(r/Te)&&w("overflow"),le*=Te;j=z.length+1,Y=v(W-ge,j,ge==0),C(W/j)>r-J&&w("overflow"),J+=C(W/j),W%=j,z.splice(W++,0,J)}return L(z)}function N(k){var z,B,j,W,J,Y,ee,Q,de,ge,le,ye=[],be,Ie,Te,ve;for(k=M(k),be=k.length,z=p,B=0,J=d,Y=0;Y<be;++Y)le=k[Y],le<128&&ye.push(A(le));for(j=W=ye.length,W&&ye.push(_);j<be;){for(ee=r,Y=0;Y<be;++Y)le=k[Y],le>=z&&le<ee&&(ee=le);for(Ie=j+1,ee-z>C((r-B)/Ie)&&w("overflow"),B+=(ee-z)*Ie,z=ee,Y=0;Y<be;++Y)if(le=k[Y],le<z&&++B>r&&w("overflow"),le==z){for(Q=B,de=s;ge=de<=J?a:de>=J+c?c:de-J,!(Q<ge);de+=s)ve=Q-ge,Te=s-ge,ye.push(A(E(ge+ve%Te,0))),Q=C(ve/Te);ye.push(A(E(Q,0))),J=v(B,Ie,j==W),B=0,++j}++B,++z}return ye.join("")}function F(k){return D(k,function(z){return m.test(z)?I(z.slice(4).toLowerCase()):z})}function U(k){return D(k,function(z){return y.test(z)?"xn--"+N(z):z})}if(o={version:"1.3.2",ucs2:{decode:M,encode:L},decode:I,encode:N,toASCII:U,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(lC.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(cC)});var _ee=df((pee,XR)=>{/*! - * 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 XR=="object"&&XR.exports?XR.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(pee,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var _=-1,m=0,y=0,x=-1,b=!1;for(d=0;d<c;d++)b?s[d]==="0"?y+=1:(b=!1,y>m&&(_=x,m=y)):s[d]==="0"&&(b=!0,x=d,y=1);y>m&&(_=x,m=y),m>1&&s.splice(_,m,""),a=s.length;var T="";for(s[0]===""&&(T=":"),d=0;d<a&&(T+=s[d],d!==a-1);d++)T+=":";return s[a-1]===""&&(T+=":"),T}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var yee=df((gee,KR)=>{/*! - * 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 KR=="object"&&KR.exports?KR.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(gee,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 pu=df((xee,$R)=>{/*! - * 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 $R=="object"&&$R.exports?$R.exports=t(mee(),_ee(),yee()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(xee,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,v){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(E,v):new r(E):new r;if(E===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(E),v!==void 0?this.absoluteTo(v):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function d(E){return f(E)==="Array"}function p(E,v){var I={},N,F;if(f(v)==="RegExp")I=null;else if(d(v))for(N=0,F=v.length;N<F;N++)I[v[N]]=!0;else I[v]=!0;for(N=0,F=E.length;N<F;N++){var U=I&&I[E[N]]!==void 0||!I&&v.test(E[N]);U&&(E.splice(N,1),F--,N--)}return E}function _(E,v){var I,N;if(d(v)){for(I=0,N=v.length;I<N;I++)if(!_(E,v[I]))return!1;return!0}var F=f(v);for(I=0,N=E.length;I<N;I++)if(F==="RegExp"){if(typeof E[I]=="string"&&E[I].match(v))return!0}else if(E[I]===v)return!0;return!1}function m(E,v){if(!d(E)||!d(v)||E.length!==v.length)return!1;E.sort(),v.sort();for(var I=0,N=E.length;I<N;I++)if(E[I]!==v[I])return!1;return!0}function y(E){var v=/^\/+|\/+$/g;return E.replace(v,"")}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=/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\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(E){if(!(!E||!E.nodeName)){var v=E.nodeName.toLowerCase();if(!(v==="input"&&E.type!=="image"))return r.domAttributes[v]}};function x(E){return escape(E)}function b(E){return encodeURIComponent(E).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}r.encode=b,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=b,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(E,v){var I=r.encode(E+"");return v===void 0&&(v=r.escapeQuerySpace),v?I.replace(/%20/g,"+"):I},r.decodeQuery=function(E,v){E+="",v===void 0&&(v=r.escapeQuerySpace);try{return r.decode(v?E.replace(/\+/g,"%20"):E)}catch{return E}};var T={encode:"encode",decode:"decode"},C,A=function(E,v){return function(I){try{return r[v](I+"").replace(r.characters[E][v].expression,function(N){return r.characters[E][v].map[N]})}catch{return I}}};for(C in T)r[C+"PathSegment"]=A("pathname",T[C]),r[C+"UrnPathSegment"]=A("urnpath",T[C]);var S=function(E,v,I){return function(N){var F;I?F=function(B){return r[v](r[I](B))}:F=r[v];for(var U=(N+"").split(E),k=0,z=U.length;k<z;k++)U[k]=F(U[k]);return U.join(E)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=A("reserved","encode"),r.parse=function(E,v){var I;return v||(v={preventInvalidHostname:r.preventInvalidHostname}),E=E.replace(r.leading_whitespace_expression,""),E=E.replace(r.ascii_tab_whitespace,""),I=E.indexOf("#"),I>-1&&(v.fragment=E.substring(I+1)||null,E=E.substring(0,I)),I=E.indexOf("?"),I>-1&&(v.query=E.substring(I+1)||null,E=E.substring(0,I)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(v.protocol=null,E=E.substring(2),E=r.parseAuthority(E,v)):(I=E.indexOf(":"),I>-1&&(v.protocol=E.substring(0,I)||null,v.protocol&&!v.protocol.match(r.protocol_expression)?v.protocol=void 0:E.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(E=E.substring(I+3),E=r.parseAuthority(E,v)):(E=E.substring(I+1),v.urn=!0))),v.path=E,v},r.parseHost=function(E,v){E||(E=""),E=E.replace(/\\/g,"/");var I=E.indexOf("/"),N,F;if(I===-1&&(I=E.length),E.charAt(0)==="[")N=E.indexOf("]"),v.hostname=E.substring(1,N)||null,v.port=E.substring(N+2,I)||null,v.port==="/"&&(v.port=null);else{var U=E.indexOf(":"),k=E.indexOf("/"),z=E.indexOf(":",U+1);z!==-1&&(k===-1||z<k)?(v.hostname=E.substring(0,I)||null,v.port=null):(F=E.substring(0,I).split(":"),v.hostname=F[0]||null,v.port=F[1]||null)}return v.hostname&&E.substring(I).charAt(0)!=="/"&&(I++,E="/"+E),v.preventInvalidHostname&&r.ensureValidHostname(v.hostname,v.protocol),v.port&&r.ensureValidPort(v.port),E.substring(I)||"/"},r.parseAuthority=function(E,v){return E=r.parseUserinfo(E,v),r.parseHost(E,v)},r.parseUserinfo=function(E,v){var I=E,N=E.indexOf("\\");N!==-1&&(E=E.replace(/\\/g,"/"));var F=E.indexOf("/"),U=E.lastIndexOf("@",F>-1?F:E.length-1),k;return U>-1&&(F===-1||U<F)?(k=E.substring(0,U).split(":"),v.username=k[0]?r.decode(k[0]):null,k.shift(),v.password=k[0]?r.decode(k.join(":")):null,E=I.substring(U+1)):(v.username=null,v.password=null),E},r.parseQuery=function(E,v){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var I={},N=E.split("&"),F=N.length,U,k,z,B=0;B<F;B++)U=N[B].split("="),k=r.decodeQuery(U.shift(),v),z=U.length?r.decodeQuery(U.join("="),v):null,k!=="__proto__"&&(c.call(I,k)?((typeof I[k]=="string"||I[k]===null)&&(I[k]=[I[k]]),I[k].push(z)):I[k]=z);return I},r.build=function(E){var v="",I=!1;return E.protocol&&(v+=E.protocol+":"),!E.urn&&(v||E.hostname)&&(v+="//",I=!0),v+=r.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&I&&(v+="/"),v+=E.path),typeof E.query=="string"&&E.query&&(v+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(v+="#"+E.fragment),v},r.buildHost=function(E){var v="";if(E.hostname)r.ip6_expression.test(E.hostname)?v+="["+E.hostname+"]":v+=E.hostname;else return"";return E.port&&(v+=":"+E.port),v},r.buildAuthority=function(E){return r.buildUserinfo(E)+r.buildHost(E)},r.buildUserinfo=function(E){var v="";return E.username&&(v+=r.encode(E.username)),E.password&&(v+=":"+r.encode(E.password)),v&&(v+="@"),v},r.buildQuery=function(E,v,I){var N="",F,U,k,z;for(U in E)if(U!=="__proto__"&&c.call(E,U))if(d(E[U]))for(F={},k=0,z=E[U].length;k<z;k++)E[U][k]!==void 0&&F[E[U][k]+""]===void 0&&(N+="&"+r.buildQueryParameter(U,E[U][k],I),v!==!0&&(F[E[U][k]+""]=!0));else E[U]!==void 0&&(N+="&"+r.buildQueryParameter(U,E[U],I));return N.substring(1)},r.buildQueryParameter=function(E,v,I){return r.encodeQuery(E,I)+(v!==null?"="+r.encodeQuery(v,I):"")},r.addQuery=function(E,v,I){if(typeof v=="object")for(var N in v)c.call(v,N)&&r.addQuery(E,N,v[N]);else if(typeof v=="string"){if(E[v]===void 0){E[v]=I;return}else typeof E[v]=="string"&&(E[v]=[E[v]]);d(I)||(I=[I]),E[v]=(E[v]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(E,v,I){if(typeof v=="object")for(var N in v)c.call(v,N)&&r.setQuery(E,N,v[N]);else if(typeof v=="string")E[v]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(E,v,I){var N,F,U;if(d(v))for(N=0,F=v.length;N<F;N++)E[v[N]]=void 0;else if(f(v)==="RegExp")for(U in E)v.test(U)&&(E[U]=void 0);else if(typeof v=="object")for(U in v)c.call(v,U)&&r.removeQuery(E,U,v[U]);else if(typeof v=="string")I!==void 0?f(I)==="RegExp"?!d(E[v])&&I.test(E[v])?E[v]=void 0:E[v]=p(E[v],I):E[v]===String(I)&&(!d(I)||I.length===1)?E[v]=void 0:d(E[v])&&(E[v]=p(E[v],I)):E[v]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(E,v,I,N){switch(f(v)){case"String":break;case"RegExp":for(var F in E)if(c.call(E,F)&&v.test(F)&&(I===void 0||r.hasQuery(E,F,I)))return!0;return!1;case"Object":for(var U in v)if(c.call(v,U)&&!r.hasQuery(E,U,v[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return v in E;case"Boolean":var k=!!(d(E[v])?E[v].length:E[v]);return I===k;case"Function":return!!I(E[v],v,E);case"Array":if(!d(E[v]))return!1;var z=N?_:m;return z(E[v],I);case"RegExp":return d(E[v])?N?_(E[v],I):!1:!!(E[v]&&E[v].match(I));case"Number":I=String(I);case"String":return d(E[v])?N?_(E[v],I):!1:E[v]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var E=[],v=[],I=0,N=0;N<arguments.length;N++){var F=new r(arguments[N]);E.push(F);for(var U=F.segment(),k=0;k<U.length;k++)typeof U[k]=="string"&&v.push(U[k]),U[k]&&I++}if(!v.length||!I)return new r("");var z=new r("").segment(v);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(E,v){var I=Math.min(E.length,v.length),N;for(N=0;N<I;N++)if(E.charAt(N)!==v.charAt(N)){N--;break}return N<1?E.charAt(0)===v.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(N)!=="/"||v.charAt(N)!=="/")&&(N=E.substring(0,N).lastIndexOf("/")),E.substring(0,N+1))},r.withinString=function(E,v,I){I||(I={});var N=I.start||r.findUri.start,F=I.end||r.findUri.end,U=I.trim||r.findUri.trim,k=I.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var B=N.exec(E);if(!B)break;var j=B.index;if(I.ignoreHtml){var W=E.slice(Math.max(j-3,0),j);if(W&&z.test(W))continue}for(var J=j+E.slice(j).search(F),Y=E.slice(j,J),ee=-1;;){var Q=k.exec(Y);if(!Q)break;var de=Q.index+Q[0].length;ee=Math.max(ee,de)}if(ee>-1?Y=Y.slice(0,ee)+Y.slice(ee).replace(U,""):Y=Y.replace(U,""),!(Y.length<=B[0].length)&&!(I.ignore&&I.ignore.test(Y))){J=j+Y.length;var ge=v(Y,j,J,E);if(ge===void 0){N.lastIndex=J;continue}ge=String(ge),E=E.slice(0,j)+ge+E.slice(J),N.lastIndex=j+ge.length}}return N.lastIndex=0,E},r.ensureValidHostname=function(E,v){var I=!!E,N=!!v,F=!1;if(N&&(F=_(r.hostProtocols,v)),F&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var v=Number(E);if(!(s(v)&&v>0&&v<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function w(E){return function(v,I){return v===void 0?this._parts[E]||"":(this._parts[E]=v||null,this.build(!I),this)}}function R(E,v){return function(I,N){return I===void 0?this._parts[E]||"":(I!==null&&(I=I+"",I.charAt(0)===v&&(I=I.substring(1))),this._parts[E]=I,this.build(!N),this)}}a.protocol=w("protocol"),a.username=w("username"),a.password=w("password"),a.hostname=w("hostname"),a.port=w("port"),a.query=R("query","?"),a.fragment=R("fragment","#"),a.search=function(E,v){var I=this.query(E,v);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(E,v){var I=this.fragment(E,v);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(E,v){if(E===void 0||E===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!v),this},a.path=a.pathname,a.href=function(E,v){var I;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var N=E instanceof r,F=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var U=r.getDomAttribute(E);E=E[U]||"",F=!1}if(!N&&F&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(N||F){var k=N?E._parts:E;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(!v),this},a.is=function(E){var v=!1,I=!1,N=!1,F=!1,U=!1,k=!1,z=!1,B=!this._parts.urn;switch(this._parts.hostname&&(B=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),v=I||N,F=!v,U=F&&n&&n.has(this._parts.hostname),k=F&&r.idn_expression.test(this._parts.hostname),z=F&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return B;case"absolute":return!B;case"domain":case"name":return F;case"sld":return U;case"ip":return v;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var D=a.protocol,M=a.port,L=a.hostname;a.protocol=function(E,v){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return D.call(this,E,v)},a.scheme=a.protocol,a.port=function(E,v){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),M.call(this,E,v))},a.hostname=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(E,I);if(N!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return L.call(this,E,v)},a.origin=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var F=r(E);return this.protocol(F.protocol()).authority(F.authority()).build(!v),this}},a.host=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.authority=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},a.userinfo=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!v),this},a.resource=function(E,v){var I;return E===void 0?this.path()+this.search()+this.hash():(I=r.parse(E),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!v),this)},a.subdomain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===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 N=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,N),U=new RegExp("^"+u(F));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,E),this.build(!v),this}},a.domain=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===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 N=this._parts.hostname.length-this.tld(v).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,E)}return this.build(!v),this}},a.tld=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(v=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return v!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var F;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E);else throw new TypeError('TLD "'+E+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,E)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},a.directory=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return E?r.decodePath(N):N}else{var F=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,F),k=new RegExp("^"+u(U));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(k,E),this.build(!v),this}},a.filename=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return E?r.decodePathSegment(N):N}else{var F=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(F=!0);var U=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(U,E),F?this.normalizePath(v):this.build(!v),this}},a.suffix=function(E,v){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),F,U;return N===-1?"":(F=I.substring(N+1),U=/^[a-z0-9%]+$/i.test(F)?F:"",E?r.decodePathSegment(U):U)}else{E.charAt(0)==="."&&(E=E.substring(1));var k=this.suffix(),z;if(k)E?z=new RegExp(u(k)+"$"):z=new RegExp(u("."+k)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return z&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(z,E)),this.build(!v),this}},a.segment=function(E,v,I){var N=this._parts.urn?":":"/",F=this.path(),U=F.substring(0,1)==="/",k=F.split(N);if(E!==void 0&&typeof E!="number"&&(I=v,v=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(U&&k.shift(),E<0&&(E=Math.max(k.length+E,0)),v===void 0)return E===void 0?k:k[E];if(E===null||k[E]===void 0)if(d(v)){k=[];for(var z=0,B=v.length;z<B;z++)!v[z].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(y(v[z])))}else(v||typeof v=="string")&&(v=y(v),k[k.length-1]===""?k[k.length-1]=v:k.push(v));else v?k[E]=y(v):k.splice(E,1);return U&&k.unshift(""),this.path(k.join(N),I)},a.segmentCoded=function(E,v,I){var N,F,U;if(typeof E!="number"&&(I=v,v=E,E=void 0),v===void 0){if(N=this.segment(E,v,I),!d(N))N=N!==void 0?r.decode(N):void 0;else for(F=0,U=N.length;F<U;F++)N[F]=r.decode(N[F]);return N}if(!d(v))v=typeof v=="string"||v instanceof String?r.encode(v):v;else for(F=0,U=v.length;F<U;F++)v[F]=r.encode(v[F]);return this.segment(E,v,I)};var g=a.query;return a.query=function(E,v){if(E===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=E.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=r.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!v),this):g.call(this,E,v)},a.setQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)N[E]=v!==void 0?v:null;else if(typeof E=="object")for(var F in E)c.call(E,F)&&(N[F]=E[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.addQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,E,v===void 0?null:v),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.removeQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,E,v),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=v),this.build(!I),this},a.hasQuery=function(E,v,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,E,v,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(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){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(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var v=this._parts.path;if(!v)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;v=r.recodePath(v);var I,N="",F,U;for(v.charAt(0)!=="/"&&(I=!0,v="/"+v),(v.slice(-3)==="/.."||v.slice(-2)==="/.")&&(v+="/"),v=v.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=v.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));F=v.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){v=v.substring(3);continue}U=v.substring(0,F).lastIndexOf("/"),U===-1&&(U=F),v=v.substring(0,U)+v.substring(F+3)}return I&&this.is("relative")&&(v=N+v.substring(1)),this._parts.path=v,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){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(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=r.encode,v=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=E,r.decode=v}return this},a.unicode=function(){var E=r.encode,v=r.decode;r.encode=b,r.decode=unescape;try{this.normalize()}finally{r.encode=E,r.decode=v}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var v="";if(E._parts.protocol&&(v+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(v+=e.toUnicode(E._parts.hostname),E._parts.port&&(v+=":"+E._parts.port)):v+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(v+="/"),v+=E.path(!0),E._parts.query){for(var I="",N=0,F=E._parts.query.split("&"),U=F.length;N<U;N++){var k=(F[N]||"").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"))}v+="?"+I.substring(1)}return v+=r.decodeQuery(E.hash(),!0),v},a.absoluteTo=function(E){var v=this.clone(),I=["protocol","username","password","hostname","port"],N,F,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof r||(E=new r(E)),v._parts.protocol||(v._parts.protocol=E._parts.protocol,this._parts.hostname))return v;for(F=0;U=I[F];F++)v._parts[U]=E._parts[U];return v._parts.path?(v._parts.path.substring(-2)===".."&&(v._parts.path+="/"),v.path().charAt(0)!=="/"&&(N=E.directory(),N=N||(E.path().indexOf("/")===0?"/":""),v._parts.path=(N?N+"/":"")+v._parts.path,v.normalizePath())):(v._parts.path=E._parts.path,v._parts.query||(v._parts.query=E._parts.query)),v.build(),v},a.relativeTo=function(E){var v=this.clone().normalize(),I,N,F,U,k;if(v._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new r(E).normalize(),I=v._parts,N=E._parts,U=v.path(),k=E.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return v.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return v.build();if(U===k)return I.path="",v.build();if(F=r.commonPath(U,k),!F)return v.build();var z=N.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=z+I.path.substring(F.length)||"./",v.build()},a.equals=function(E){var v=this.clone(),I=new r(E),N={},F={},U={},k,z,B;if(v.normalize(),I.normalize(),v.toString()===I.toString())return!0;if(k=v.query(),z=I.query(),v.query(""),I.query(""),v.toString()!==I.toString()||k.length!==z.length)return!1;N=r.parseQuery(k,this._parts.escapeQuerySpace),F=r.parseQuery(z,this._parts.escapeQuerySpace);for(B in N)if(c.call(N,B)){if(d(N[B])){if(!m(N[B],F[B]))return!1}else if(N[B]!==F[B])return!1;U[B]=!0}for(B in F)if(c.call(F,B)&&!U[B])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},r})});var Lue=df((rNn,Mue)=>{"use strict";Mue.exports=VXe;var tP=1e20;function VXe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,_,m,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?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,_=d.getImageData(0,0,r,s),c=_.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,_=d.getImageData(0,0,r,s),c=_.data,f=4):window.ImageData&&e instanceof window.ImageData&&(_=e,r=e.width,s=e.height,c=_.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var x=Array(r*s),b=Array(r*s),T=Array(a),C=Array(a),A=Array(a+1),S=Array(a);for(m=0,y=r*s;m<y;m++){var w=c[m];x[m]=w===1?0:w===0?tP:Math.pow(Math.max(0,.5-w),2),b[m]=w===1?tP:w===0?0:Math.pow(Math.max(0,w-.5),2)}Rue(x,r,s,T,C,S,A),Rue(b,r,s,T,C,S,A);var R=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,y=r*s;m<y;m++)R[m]=Math.min(Math.max(1-((x[m]-b[m])/i+n),0),1);return R}function Rue(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(Oue(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(Oue(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Oue(e,t,n,i,o){n[0]=0,i[0]=-tP,i[1]=+tP;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]=+tP}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 Uue=df((CNn,W3)=>{function QXe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,_=13,m=14,y=15,x=16,b=17,T=0,C=1,A=2,S=3,w=4;function R(g,E){return 55296<=g.charCodeAt(E)&&g.charCodeAt(E)<=56319&&56320<=g.charCodeAt(E+1)&&g.charCodeAt(E+1)<=57343}function D(g,E){E===void 0&&(E=0);var v=g.charCodeAt(E);if(55296<=v&&v<=56319&&E<g.length-1){var I=v,N=g.charCodeAt(E+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=v&&v<=57343&&E>=1){var I=g.charCodeAt(E-1),N=v;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return v}function M(g,E,v){var I=[g].concat(E).concat([v]),N=I[I.length-2],F=v,U=I.lastIndexOf(m);if(U>1&&I.slice(1,U).every(function(B){return B==i})&&[i,_,b].indexOf(g)==-1)return A;var k=I.lastIndexOf(o);if(k>0&&I.slice(1,k).every(function(B){return B==o})&&[p,o].indexOf(N)==-1)return I.filter(function(B){return B==o}).length%2==1?S:w;if(N==e&&F==t)return T;if(N==n||N==e||N==t)return F==m&&E.every(function(B){return B==i})?A:C;if(F==n||F==e||F==t)return C;if(N==s&&(F==s||F==a||F==u||F==f))return T;if((N==u||N==a)&&(F==a||F==c))return T;if((N==f||N==c)&&F==c)return T;if(F==i||F==y)return T;if(F==r)return T;if(N==p)return T;var z=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[_,b].indexOf(I[z])!=-1&&I.slice(z+1,-1).every(function(B){return B==i})&&F==m||N==y&&[x,b].indexOf(F)!=-1?T:E.indexOf(o)!=-1?A:N==o&&F==o?T:C}this.nextBreak=function(g,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=g.length-1)return g.length;for(var v=L(D(g,E)),I=[],N=E+1;N<g.length;N++)if(!R(g,N-1)){var F=L(D(g,N));if(M(v,I,F))return N;I.push(F)}return g.length},this.splitGraphemes=function(g){for(var E=[],v=0,I;(I=this.nextBreak(g,v))<g.length;)E.push(g.slice(v,I)),v=I;return v<g.length&&E.push(g.slice(v)),E},this.iterateGraphemes=function(g){var E=0,v={next:function(){var I,N;return(N=this.nextBreak(g,E))<g.length?(I=g.slice(E,N),E=N,{value:I,done:!1}):E<g.length?(I=g.slice(E),E=g.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(g){for(var E=0,v=0,I;(I=this.nextBreak(g,v))<g.length;)v=I,E++;return v<g.length&&E++,E};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?s:4448<=g&&g<=4519||55216<=g&&g<=55238?a:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?_:127995<=g&&g<=127999?m:g==8205?y:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?x:128102<=g&&g<=128105?b:d}return this}typeof W3<"u"&&W3.exports&&(W3.exports=QXe)});var Ipe=df((wY,IY)=>{(function(e,t){typeof wY=="object"&&typeof IY<"u"?IY.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(wY,function(){"use strict";function e(x,b,T,C,A){(function S(w,R,D,M,L){for(;M>D;){if(M-D>600){var g=M-D+1,E=R-D+1,v=Math.log(g),I=.5*Math.exp(2*v/3),N=.5*Math.sqrt(v*I*(g-I)/g)*(E-g/2<0?-1:1),F=Math.max(D,Math.floor(R-E*I/g+N)),U=Math.min(M,Math.floor(R+(g-E)*I/g+N));S(w,R,F,U,L)}var k=w[R],z=D,B=M;for(t(w,D,R),L(w[M],k)>0&&t(w,D,M);z<B;){for(t(w,z,B),z++,B--;L(w[z],k)<0;)z++;for(;L(w[B],k)>0;)B--}L(w[D],k)===0?t(w,D,B):t(w,++B,M),B<=R&&(D=B+1),R<=B&&(M=B-1)}})(x,b,T||0,C||x.length-1,A||n)}function t(x,b,T){var C=x[b];x[b]=x[T],x[T]=C}function n(x,b){return x<b?-1:x>b?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,b,T){if(!T)return b.indexOf(x);for(var C=0;C<b.length;C++)if(T(x,b[C]))return C;return-1}function r(x,b){s(x,0,x.children.length,b,x)}function s(x,b,T,C,A){A||(A=m(null)),A.minX=1/0,A.minY=1/0,A.maxX=-1/0,A.maxY=-1/0;for(var S=b;S<T;S++){var w=x.children[S];a(A,x.leaf?C(w):w)}return A}function a(x,b){return x.minX=Math.min(x.minX,b.minX),x.minY=Math.min(x.minY,b.minY),x.maxX=Math.max(x.maxX,b.maxX),x.maxY=Math.max(x.maxY,b.maxY),x}function c(x,b){return x.minX-b.minX}function u(x,b){return x.minY-b.minY}function f(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function d(x){return x.maxX-x.minX+(x.maxY-x.minY)}function p(x,b){return x.minX<=b.minX&&x.minY<=b.minY&&b.maxX<=x.maxX&&b.maxY<=x.maxY}function _(x,b){return b.minX<=x.maxX&&b.minY<=x.maxY&&b.maxX>=x.minX&&b.maxY>=x.minY}function m(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(x,b,T,C,A){for(var S=[b,T];S.length;)if(!((T=S.pop())-(b=S.pop())<=C)){var w=b+Math.ceil((T-b)/C/2)*C;e(x,w,b,T,A),S.push(b,w,w,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var b=this.data,T=[];if(!_(x,b))return T;for(var C=this.toBBox,A=[];b;){for(var S=0;S<b.children.length;S++){var w=b.children[S],R=b.leaf?C(w):w;_(x,R)&&(b.leaf?T.push(w):p(x,R)?this._all(w,T):A.push(w))}b=A.pop()}return T},i.prototype.collides=function(x){var b=this.data;if(!_(x,b))return!1;for(var T=[];b;){for(var C=0;C<b.children.length;C++){var A=b.children[C],S=b.leaf?this.toBBox(A):A;if(_(x,S)){if(b.leaf||p(x,S))return!0;T.push(A)}}b=T.pop()}return!1},i.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var b=0;b<x.length;b++)this.insert(x[b]);return this}var T=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var C=this.data;this.data=T,T=C}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(x,b){if(!x)return this;for(var T,C,A,S=this.data,w=this.toBBox(x),R=[],D=[];S||R.length;){if(S||(S=R.pop(),C=R[R.length-1],T=D.pop(),A=!0),S.leaf){var M=o(x,S.children,b);if(M!==-1)return S.children.splice(M,1),R.push(S),this._condense(R),this}A||S.leaf||!p(S,w)?C?(T++,S=C.children[T],A=!1):S=null:(R.push(S),D.push(T),T=0,C=S,S=S.children[0])}return this},i.prototype.toBBox=function(x){return x},i.prototype.compareMinX=function(x,b){return x.minX-b.minX},i.prototype.compareMinY=function(x,b){return x.minY-b.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(x){return this.data=x,this},i.prototype._all=function(x,b){for(var T=[];x;)x.leaf?b.push.apply(b,x.children):T.push.apply(T,x.children),x=T.pop();return b},i.prototype._build=function(x,b,T,C){var A,S=T-b+1,w=this._maxEntries;if(S<=w)return r(A=m(x.slice(b,T+1)),this.toBBox),A;C||(C=Math.ceil(Math.log(S)/Math.log(w)),w=Math.ceil(S/Math.pow(w,C-1))),(A=m([])).leaf=!1,A.height=C;var R=Math.ceil(S/w),D=R*Math.ceil(Math.sqrt(w));y(x,b,T,D,this.compareMinX);for(var M=b;M<=T;M+=D){var L=Math.min(M+D-1,T);y(x,M,L,R,this.compareMinY);for(var g=M;g<=L;g+=R){var E=Math.min(g+R-1,L);A.children.push(this._build(x,g,E,C-1))}}return r(A,this.toBBox),A},i.prototype._chooseSubtree=function(x,b,T,C){for(;C.push(b),!b.leaf&&C.length-1!==T;){for(var A=1/0,S=1/0,w=void 0,R=0;R<b.children.length;R++){var D=b.children[R],M=f(D),L=(g=x,E=D,(Math.max(E.maxX,g.maxX)-Math.min(E.minX,g.minX))*(Math.max(E.maxY,g.maxY)-Math.min(E.minY,g.minY))-M);L<S?(S=L,A=M<A?M:A,w=D):L===S&&M<A&&(A=M,w=D)}b=w||b.children[0]}var g,E;return b},i.prototype._insert=function(x,b,T){var C=T?x:this.toBBox(x),A=[],S=this._chooseSubtree(C,this.data,b,A);for(S.children.push(x),a(S,C);b>=0&&A[b].children.length>this._maxEntries;)this._split(A,b),b--;this._adjustParentBBoxes(C,A,b)},i.prototype._split=function(x,b){var T=x[b],C=T.children.length,A=this._minEntries;this._chooseSplitAxis(T,A,C);var S=this._chooseSplitIndex(T,A,C),w=m(T.children.splice(S,T.children.length-S));w.height=T.height,w.leaf=T.leaf,r(T,this.toBBox),r(w,this.toBBox),b?x[b-1].children.push(w):this._splitRoot(T,w)},i.prototype._splitRoot=function(x,b){this.data=m([x,b]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,b,T){for(var C,A,S,w,R,D,M,L=1/0,g=1/0,E=b;E<=T-b;E++){var v=s(x,0,E,this.toBBox),I=s(x,E,T,this.toBBox),N=(A=v,S=I,w=void 0,R=void 0,D=void 0,M=void 0,w=Math.max(A.minX,S.minX),R=Math.max(A.minY,S.minY),D=Math.min(A.maxX,S.maxX),M=Math.min(A.maxY,S.maxY),Math.max(0,D-w)*Math.max(0,M-R)),F=f(v)+f(I);N<L?(L=N,C=E,g=F<g?F:g):N===L&&F<g&&(g=F,C=E)}return C||T-b},i.prototype._chooseSplitAxis=function(x,b,T){var C=x.leaf?this.compareMinX:c,A=x.leaf?this.compareMinY:u;this._allDistMargin(x,b,T,C)<this._allDistMargin(x,b,T,A)&&x.children.sort(C)},i.prototype._allDistMargin=function(x,b,T,C){x.children.sort(C);for(var A=this.toBBox,S=s(x,0,b,A),w=s(x,T-b,T,A),R=d(S)+d(w),D=b;D<T-b;D++){var M=x.children[D];a(S,x.leaf?A(M):M),R+=d(S)}for(var L=T-b-1;L>=b;L--){var g=x.children[L];a(w,x.leaf?A(g):g),R+=d(w)}return R},i.prototype._adjustParentBBoxes=function(x,b,T){for(var C=T;C>=0;C--)a(b[C],x)},i.prototype._condense=function(x){for(var b=x.length-1,T=void 0;b>=0;b--)x[b].children.length===0?b>0?(T=x[b-1].children).splice(T.indexOf(x[b]),1):this.clear():r(x[b],this.toBBox)},i})});var t$=df((exports,module)=>{/*! - * 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,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var y=new Array(arguments.length-1),x=0;x<y.length;)y[x++]=arguments[x];d.apply(null,y)}};try{o.apply(r||null,s)}catch(_){u&&(u=!1,p(_))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,_=[],m=0,y=0,x;f<d;){var b=u[f++];switch(y){case 0:_[m++]=o[b>>2],x=(b&3)<<4,y=1;break;case 1:_[m++]=o[x|b>>4],x=(b&15)<<2,y=2;break;case 2:_[m++]=o[x|b>>6],_[m++]=o[b&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,_)),m=0)}return y&&(_[m++]=o[x],_[m++]=61,y===1&&(_[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,_.slice(0,m))),p.join("")):String.fromCharCode.apply(String,_.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,_=0,m,y=0;y<u.length;){var x=u.charCodeAt(y++);if(x===61&&_>1)break;if((x=r[x])===undefined)throw Error(a);switch(_){case 0:m=x,_=1;break;case 1:f[d++]=m<<2|(x&48)>>4,m=x,_=2;break;case 2:f[d++]=(m&15)<<4|(x&60)>>2,m=x,_=3;break;case 3:f[d++]=(m&3)<<6|x,_=0;break}}if(_===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(x,b,T){u[0]=x,b[T]=f[0],b[T+1]=f[1],b[T+2]=f[2],b[T+3]=f[3]}function _(x,b,T){u[0]=x,b[T]=f[3],b[T+1]=f[2],b[T+2]=f[1],b[T+3]=f[0]}c.writeFloatLE=d?p:_,c.writeFloatBE=d?_:p;function m(x,b){return f[0]=x[b],f[1]=x[b+1],f[2]=x[b+2],f[3]=x[b+3],u[0]}function y(x,b){return f[3]=x[b],f[2]=x[b+1],f[1]=x[b+2],f[0]=x[b+3],u[0]}c.readFloatLE=d?m:y,c.readFloatBE=d?y:m}():function(){function u(d,p,_,m){var y=p<0?1:0;if(y&&(p=-p),p===0)d(1/p>0?0:2147483648,_,m);else if(isNaN(p))d(2143289344,_,m);else if(p>34028234663852886e22)d((y<<31|2139095040)>>>0,_,m);else if(p<11754943508222875e-54)d((y<<31|Math.round(p/1401298464324817e-60))>>>0,_,m);else{var x=Math.floor(Math.log(p)/Math.LN2),b=Math.round(p*Math.pow(2,-x)*8388608)&8388607;d((y<<31|x+127<<23|b)>>>0,_,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,_){var m=d(p,_),y=(m>>31)*2+1,x=m>>>23&255,b=m&8388607;return x===255?b?NaN:y*(1/0):x===0?y*1401298464324817e-60*b:y*Math.pow(2,x-150)*(b+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(x,b,T){u[0]=x,b[T]=f[0],b[T+1]=f[1],b[T+2]=f[2],b[T+3]=f[3],b[T+4]=f[4],b[T+5]=f[5],b[T+6]=f[6],b[T+7]=f[7]}function _(x,b,T){u[0]=x,b[T]=f[7],b[T+1]=f[6],b[T+2]=f[5],b[T+3]=f[4],b[T+4]=f[3],b[T+5]=f[2],b[T+6]=f[1],b[T+7]=f[0]}c.writeDoubleLE=d?p:_,c.writeDoubleBE=d?_:p;function m(x,b){return f[0]=x[b],f[1]=x[b+1],f[2]=x[b+2],f[3]=x[b+3],f[4]=x[b+4],f[5]=x[b+5],f[6]=x[b+6],f[7]=x[b+7],u[0]}function y(x,b){return f[7]=x[b],f[6]=x[b+1],f[5]=x[b+2],f[4]=x[b+3],f[3]=x[b+4],f[2]=x[b+5],f[1]=x[b+6],f[0]=x[b+7],u[0]}c.readDoubleLE=d?m:y,c.readDoubleBE=d?y:m}():function(){function u(d,p,_,m,y,x){var b=m<0?1:0;if(b&&(m=-m),m===0)d(0,y,x+p),d(1/m>0?0:2147483648,y,x+_);else if(isNaN(m))d(0,y,x+p),d(2146959360,y,x+_);else if(m>17976931348623157e292)d(0,y,x+p),d((b<<31|2146435072)>>>0,y,x+_);else{var T;if(m<22250738585072014e-324)T=m/5e-324,d(T>>>0,y,x+p),d((b<<31|T/4294967296)>>>0,y,x+_);else{var C=Math.floor(Math.log(m)/Math.LN2);C===1024&&(C=1023),T=m*Math.pow(2,-C),d(T*4503599627370496>>>0,y,x+p),d((b<<31|C+1023<<20|T*1048576&1048575)>>>0,y,x+_)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,_,m,y){var x=d(m,y+p),b=d(m,y+_),T=(b>>31)*2+1,C=b>>>20&2047,A=4294967296*(b&1048575)+x;return C===2047?A?NaN:T*(1/0):C===0?T*5e-324*A:T*Math.pow(2,C-1075)*(A+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var _=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),_}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=r[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(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,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d<r.length;++d)u=r.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=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")},f=function(){return i.Buffer?function(x){return(c.create=function(T){return i.Buffer.isBuffer(T)?new o(T):u(T)})(x)}:u};c.create=f(),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 d(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[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 _(){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,b=this.pos+y;if(b>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(x,b);if(x===b){var T=i.Buffer;return T?T.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,x,b)},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(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[y](!1)},uint64:function(){return d.call(this)[y](!0)},sint64:function(){return d.call(this).zzDecode()[y](!1)},fixed64:function(){return _.call(this)[y](!0)},sfixed64:function(){return _.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,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(_,m){if(_)return d.emit("error",_,s),f(_);if(m===null)return d.end(!0),undefined;if(!(m instanceof c))try{m=c[d.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return d.emit("error",y,s),f(y)}return d.emit("data",m,s),f(null,m)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(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,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(C,A,S){this.fn=C,this.len=A,this.next=undefined,this.val=S}function u(){}function f(C){this.head=C.head,this.tail=C.tail,this.len=C.len,this.next=C.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new o})()}:function(){return new d}};d.create=p(),d.alloc=function(A){return new i.Array(A)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(A,S,w){return this.tail=this.tail.next=new c(A,S,w),this.len+=S,this};function _(C,A,S){A[S]=C&255}function m(C,A,S){for(;C>127;)A[S++]=C&127|128,C>>>=7;A[S]=C}function y(C,A){this.len=C,this.next=undefined,this.val=A}y.prototype=Object.create(c.prototype),y.prototype.fn=m,d.prototype.uint32=function(A){return this.len+=(this.tail=this.tail.next=new y((A=A>>>0)<128?1:A<16384?2:A<2097152?3:A<268435456?4:5,A)).len,this},d.prototype.int32=function(A){return A<0?this._push(x,10,r.fromNumber(A)):this.uint32(A)},d.prototype.sint32=function(A){return this.uint32((A<<1^A>>31)>>>0)};function x(C,A,S){for(;C.hi;)A[S++]=C.lo&127|128,C.lo=(C.lo>>>7|C.hi<<25)>>>0,C.hi>>>=7;for(;C.lo>127;)A[S++]=C.lo&127|128,C.lo=C.lo>>>7;A[S++]=C.lo}d.prototype.uint64=function(A){var S=r.from(A);return this._push(x,S.length(),S)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(A){var S=r.from(A).zzEncode();return this._push(x,S.length(),S)},d.prototype.bool=function(A){return this._push(_,1,A?1:0)};function b(C,A,S){A[S]=C&255,A[S+1]=C>>>8&255,A[S+2]=C>>>16&255,A[S+3]=C>>>24}d.prototype.fixed32=function(A){return this._push(b,4,A>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(A){var S=r.from(A);return this._push(b,4,S.lo)._push(b,4,S.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(A){return this._push(i.float.writeFloatLE,4,A)},d.prototype.double=function(A){return this._push(i.float.writeDoubleLE,8,A)};var T=i.Array.prototype.set?function(A,S,w){S.set(A,w)}:function(A,S,w){for(var R=0;R<A.length;++R)S[w+R]=A[R]};d.prototype.bytes=function(A){var S=A.length>>>0;if(!S)return this._push(_,1,0);if(i.isString(A)){var w=d.alloc(S=s.length(A));s.decode(A,w,0),A=w}return this.uint32(S)._push(T,S,A)},d.prototype.string=function(A){var S=a.length(A);return S?this.uint32(S)._push(a.write,S,A):this._push(_,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var A=this.head,S=this.tail,w=this.len;return this.reset().uint32(w),w&&(this.tail.next=A.next,this.tail=S,this.len+=w),this},d.prototype.finish=function(){for(var A=this.head.next,S=this.constructor.alloc(this.len),w=0;A;)A.fn(A.val,S,w),w+=A.len,A=A.next;return S},d._configure=function(C){o=C,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var ASe=df((hji,QG)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,_=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,y=r(_,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),x={width:_.width,height:_.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:_.pixels.maxValue,noDataValue:m};return y.resultMask&&(x.maskData=y.resultMask),d.returnEncodedMask&&_.mask&&(x.encodedMaskData=_.mask.bitset?_.mask.bitset:null),d.returnFileInfo&&(x.fileInfo=s(_),d.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(_))),x};var r=function(f,d,p,_,m){var y=0,x=f.pixels.numBlocksX,b=f.pixels.numBlocksY,T=Math.floor(f.width/x),C=Math.floor(f.height/b),A=2*f.maxZError,S=Number.MAX_VALUE,w;p=p||(f.mask?f.mask.bitset:null);var R,D;R=new d(f.width*f.height),m&&p&&(D=new Uint8Array(f.width*f.height));for(var M=new Float32Array(T*C),L,g,E=0;E<=b;E++){var v=E!==b?C:f.height%b;if(v!==0)for(var I=0;I<=x;I++){var N=I!==x?T:f.width%x;if(N!==0){var F=E*f.width*C+I*T,U=f.width-N,k=f.pixels.blocks[y],z,B,j;k.encoding<2?(k.encoding===0?z=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,A,M,f.pixels.maxValue),z=M),B=0):k.encoding===2?j=0:j=k.offset;var W;if(p)for(g=0;g<v;g++){for(F&7&&(W=p[F>>3],W<<=F&7),L=0;L<N;L++)F&7||(W=p[F>>3]),W&128?(D&&(D[F]=1),w=k.encoding<2?z[B++]:j,S=S>w?w:S,R[F++]=w):(D&&(D[F]=0),R[F++]=_),W<<=1;F+=U}else if(k.encoding<2)for(g=0;g<v;g++){for(L=0;L<N;L++)w=z[B++],S=S>w?w:S,R[F++]=w;F+=U}else for(S=S>j?j:S,g=0;g<v;g++){for(L=0;L<N;L++)R[F++]=j;F+=U}if(k.encoding===1&&B!==k.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:R,resultMask:D,minValue:S}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},_=0;_<d;_++){var m=f.pixels.blocks[_];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var _={},m=new Uint8Array(f,d,10);if(_.fileIdentifierString=String.fromCharCode.apply(null,m),_.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+_.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(_.fileVersion=y.getInt32(0,!0),_.imageType=y.getInt32(4,!0),_.height=y.getUint32(8,!0),_.width=y.getUint32(12,!0),_.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),_.mask={},_.mask.numBlocksY=y.getUint32(0,!0),_.mask.numBlocksX=y.getUint32(4,!0),_.mask.numBytes=y.getUint32(8,!0),_.mask.maxValue=y.getFloat32(12,!0),d+=16,_.mask.numBytes>0){var x=new Uint8Array(Math.ceil(_.width*_.height/8));y=new DataView(f,d,_.mask.numBytes);var b=y.getInt16(0,!0),T=2,C=0;do{if(b>0)for(;b--;)x[C++]=y.getUint8(T++);else{var A=y.getUint8(T++);for(b=-b;b--;)x[C++]=A}b=y.getInt16(T,!0),T+=2}while(T<_.mask.numBytes);if(b!==-32768||C<x.length)throw"Unexpected end of mask RLE encoding";_.mask.bitset=x,d+=_.mask.numBytes}else(_.mask.numBytes|_.mask.numBlocksY|_.mask.maxValue)===0&&(_.mask.bitset=new Uint8Array(Math.ceil(_.width*_.height/8)));y=new DataView(f,d,16),_.pixels={},_.pixels.numBlocksY=y.getUint32(0,!0),_.pixels.numBlocksX=y.getUint32(4,!0),_.pixels.numBytes=y.getUint32(8,!0),_.pixels.maxValue=y.getFloat32(12,!0),d+=16;var S=_.pixels.numBlocksX,w=_.pixels.numBlocksY,R=S+(_.width%S>0?1:0),D=w+(_.height%w>0?1:0);_.pixels.blocks=new Array(R*D);for(var M=0,L=0;L<D;L++)for(var g=0;g<R;g++){var E=0,v=f.byteLength-d;y=new DataView(f,d,Math.min(10,v));var I={};_.pixels.blocks[M++]=I;var N=y.getUint8(0);if(E++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),E++;else if(N===1)I.offset=y.getInt16(1,!0),E+=2;else if(N===0)I.offset=y.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(E),E++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(E),E++;else if(N===1)I.numValidPixels=y.getUint16(E,!0),E+=2;else if(N===0)I.numValidPixels=y.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(d+=E,I.encoding!==3){var F,U;if(I.encoding===0){var k=(_.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";F=new ArrayBuffer(k*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,k*4));var z=new Float32Array(F);I.rawData=z,d+=k*4}else if(I.encoding===1){var B=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),j=Math.ceil(B/4);F=new ArrayBuffer(j*4),U=new Uint8Array(F),U.set(new Uint8Array(f,d,B)),I.stuffedData=new Uint32Array(F),d+=B}}}return _.eofOffset=d,_},u=function(f,d,p,_,m,y,x){var b=(1<<d)-1,T=0,C,A=0,S,w,R=Math.ceil((x-_)/m),D=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*D,C=0;C<p;C++){if(A===0&&(w=f[T++],A=32),A>=d)S=w>>>A-d&b,A-=d;else{var M=d-A;S=(w&b)<<M&b,w=f[T++],A=32-M,S+=w>>>A}y[C]=S<R?_+S*m:x}return y};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,d,p,_,m,y){var x=(1<<f)-1,b=0,T,C=0,A,S,w,R,D=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*D,p)for(T=0;T<d;T++)C===0&&(S=c[b++],C=32),C>=f?(A=S>>>C-f&x,C-=f):(w=f-C,A=(S&x)<<w&x,S=c[b++],C=32-w,A+=S>>>C),u[T]=p[A];else for(R=Math.ceil((y-_)/m),T=0;T<d;T++)C===0&&(S=c[b++],C=32),C>=f?(A=S>>>C-f&x,C-=f):(w=f-C,A=(S&x)<<w&x,S=c[b++],C=32-w,A+=S>>>C),u[T]=A<R?_+A*m:y},unstuffLUT:function(c,u,f,d,p,_){var m=(1<<u)-1,y=0,x=0,b=0,T=0,C=0,A,S=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var R=Math.ceil((_-d)/p);for(x=0;x<f;x++)T===0&&(A=c[y++],T=32),T>=u?(C=A>>>T-u&m,T-=u):(b=u-T,C=(A&m)<<b&m,A=c[y++],T=32-b,C+=A>>>T),S[x]=C<R?d+C*p:_;return S.unshift(d),S},unstuff2:function(c,u,f,d,p,_,m,y){var x=(1<<f)-1,b=0,T,C=0,A=0,S,w,R;if(p)for(T=0;T<d;T++)C===0&&(w=c[b++],C=32,A=0),C>=f?(S=w>>>A&x,C-=f,A+=f):(R=f-C,S=w>>>A&x,w=c[b++],C=32-R,S|=(w&(1<<R)-1)<<f-R,A=R),u[T]=p[S];else{var D=Math.ceil((y-_)/m);for(T=0;T<d;T++)C===0&&(w=c[b++],C=32,A=0),C>=f?(S=w>>>A&x,C-=f,A+=f):(R=f-C,S=w>>>A&x,w=c[b++],C=32-R,S|=(w&(1<<R)-1)<<f-R,A=R),u[T]=S<D?_+S*m:y}return u},unstuffLUT2:function(c,u,f,d,p,_){var m=(1<<u)-1,y=0,x=0,b=0,T=0,C=0,A=0,S,w=[],R=Math.ceil((_-d)/p);for(x=0;x<f;x++)T===0&&(S=c[y++],T=32,A=0),T>=u?(C=S>>>A&m,T-=u,A+=u):(b=u-T,C=S>>>A&m,S=c[y++],T=32-b,C|=(S&(1<<b)-1)<<u-b,A=b),w[x]=C<R?d+C*p:_;return w.unshift(d),w},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,_=0,m,y=0,x,b,T,C=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*C,m=0;m<d;m++)y===0&&(b=c[_++],y=32),y>=f?(x=b>>>y-f&p,y-=f):(T=f-y,x=(b&p)<<T&p,b=c[_++],y=32-T,x+=b>>>y),u[m]=x;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,_=0,m,y=0,x=0,b,T,C;for(m=0;m<d;m++)y===0&&(T=c[_++],y=32,x=0),y>=f?(b=T>>>x&p,y-=f,x+=f):(C=f-y,b=T>>>x&p,T=c[_++],y=32-C,b|=(T&(1<<C)-1)<<f-C,x=C),u[m]=b;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),_=0;p;){var m=p>=359?359:p;p-=m;do u+=c[_++]<<8,f+=u+=c[_++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[_]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var _=new DataView(c,f,8),m=_.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=_.getUint32(4,!0),f+=4),_=new DataView(c,f,12),p.height=_.getUint32(0,!0),p.width=_.getUint32(4,!0),f+=8,m>=4?(p.numDims=_.getUint32(8,!0),f+=4):p.numDims=1,_=new DataView(c,f,40),p.numValidPixel=_.getUint32(0,!0),p.microBlockSize=_.getInt32(4,!0),p.blobSize=_.getInt32(8,!0),p.imageType=_.getInt32(12,!0),p.maxZError=_.getFloat64(16,!0),p.zMin=_.getFloat64(24,!0),p.zMax=_.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,x;if(m>=3&&(x=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-x,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),_=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,x=!0;for(y=0;y<f.numDims;y++)if(_[y]!==m[y]){x=!1;break}return f.minValues=_,f.maxValues=m,x},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var _=new ArrayBuffer(d),m=new Uint8Array(_);m.set(new Uint8Array(c,u,d)),p=new f(_)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,_=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(_===0||p===_)&&y.numBytes!==0)throw"invalid mask";var x,b;if(_===0)x=new Uint8Array(Math.ceil(p/8)),y.bitset=x,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){x=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var T=m.getInt16(0,!0),C=2,A=0,S=0;do{if(T>0)for(;T--;)x[A++]=m.getUint8(C++);else for(S=m.getUint8(C++),T=-T;T--;)x[A++]=S;T=m.getInt16(C,!0),C+=2}while(C<y.numBytes);if(T!==-32768||A<x.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var w=0,R=0;for(R=0;R<p;R++)R&7?(w=x[R>>3],w<<=R&7):w=x[R>>3],w&128&&(b[R]=1);u.pixels.resultMask=b,y.bitset=x,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,_=p.numDims,m=p.width*p.height,y=p.imageType,x=p.numValidPixel*r.getDataTypeSize(y)*_,b,T=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,x);else{var C=new ArrayBuffer(x),A=new Uint8Array(C);A.set(new Uint8Array(c,d,x)),b=new f(C)}if(b.length===m*_)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*_);var S=0,w=0,R=0,D=0;if(_>1)for(R=0;R<_;R++)for(D=R*m,w=0;w<m;w++)T[w]&&(u.pixels.resultPixels[D+w]=b[S++]);else for(w=0;w<m;w++)T[w]&&(u.pixels.resultPixels[w]=b[S++])}return d+=x,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var _=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var x=new Uint32Array(y-m);r.decodeBits(c,u,x);var b=[],T,C,A,S;for(T=m;T<y;T++)C=T-(T<_?0:_),b[C]={first:x[T-m],second:null};var w=c.byteLength-u.ptr,R=Math.ceil(w/4),D=new ArrayBuffer(R*4),M=new Uint8Array(D);M.set(new Uint8Array(c,u.ptr,w));var L=new Uint32Array(D),g=0,E,v=0;for(E=L[0],T=m;T<y;T++)C=T-(T<_?0:_),S=b[C].first,S>0&&(b[C].second=E<<g>>>32-S,32-g>=S?(g+=S,g===32&&(g=0,v++,E=L[v])):(g+=S-32,v++,E=L[v],b[C].second|=E>>>32-g));var I=0,N=0,F=new s;for(T=0;T<b.length;T++)b[T]!==void 0&&(I=Math.max(I,b[T].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var U=[],k,z,B,j,W,J;for(T=m;T<y;T++)if(C=T-(T<_?0:_),S=b[C].first,S>0)if(k=[S,C],S<=N)for(z=b[C].second<<N-S,B=1<<N-S,A=0;A<B;A++)U[z|A]=k;else for(z=b[C].second,J=F,j=S-1;j>=0;j--)W=z>>>j&1,W?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),j===0&&!J.val&&(J.val=k[1]);return{decodeLut:U,numBitsLUTQick:N,numBitsLUT:I,tree:F,stuffedData:L,srcPtr:v,bitPos:g}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,_=u.headerInfo.height,m=u.headerInfo.width,y=m*_,x=this.readHuffmanTree(c,u),b=x.decodeLut,T=x.tree,C=x.stuffedData,A=x.srcPtr,S=x.bitPos,w=x.numBitsLUTQick,R=x.numBitsLUT,D=u.headerInfo.imageType===0?128:0,M,L,g,E=u.pixels.resultMask,v,I,N,F,U,k,z,B=0;S>0&&(A++,S=0);var j=C[A],W=u.encodeMode===1,J=new f(y*p),Y=J,ee;for(ee=0;ee<d.numDims;ee++){if(p>1&&(Y=new f(J.buffer,y*ee,y),B=0),u.headerInfo.numValidPixel===m*_)for(k=0,F=0;F<_;F++)for(U=0;U<m;U++,k++){if(L=0,v=j<<S>>>32-w,I=v,32-S<w&&(v|=C[A+1]>>>64-S-w,I=v),b[I])L=b[I][1],S+=b[I][0];else for(v=j<<S>>>32-R,I=v,32-S<R&&(v|=C[A+1]>>>64-S-R,I=v),M=T,z=0;z<R;z++)if(N=v>>>R-z-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,S=S+z+1;break}S>=32&&(S-=32,A++,j=C[A]),g=L-D,W?(U>0?g+=B:F>0?g+=Y[k-m]:g+=B,g&=255,Y[k]=g,B=g):Y[k]=g}else for(k=0,F=0;F<_;F++)for(U=0;U<m;U++,k++)if(E[k]){if(L=0,v=j<<S>>>32-w,I=v,32-S<w&&(v|=C[A+1]>>>64-S-w,I=v),b[I])L=b[I][1],S+=b[I][0];else for(v=j<<S>>>32-R,I=v,32-S<R&&(v|=C[A+1]>>>64-S-R,I=v),M=T,z=0;z<R;z++)if(N=v>>>R-z-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,S=S+z+1;break}S>=32&&(S-=32,A++,j=C[A]),g=L-D,W?(U>0&&E[k-1]?g+=B:F>0&&E[k-m]?g+=Y[k-m]:g+=B,g&=255,Y[k]=g,B=g):Y[k]=g}u.ptr=u.ptr+(A+1)*4+(S>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var _=u.headerInfo,m=_.fileVersion,y=0,x=new DataView(c,u.ptr,5),b=x.getUint8(0);y++;var T=b>>6,C=T===0?4:3-T,A=(b&32)>0,S=b&31,w=0;if(C===1)w=x.getUint8(y),y++;else if(C===2)w=x.getUint16(y,!0),y+=2;else if(C===4)w=x.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var R=2*_.maxZError,D,M,L,g,E,v,I,N,F,U,k=_.numDims>1?_.maxValues[p]:_.zMax;if(A){for(u.counter.lut++,N=x.getUint8(y),F=S,y++,g=Math.ceil((N-1)*S/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,g)),I=new Uint32Array(M),u.ptr+=g,U=0;N-1>>>U;)U++;g=Math.ceil(w*U/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),D=new Uint32Array(M),u.ptr+=g,m>=3?v=o.unstuffLUT2(I,S,N-1,d,R,k):v=o.unstuffLUT(I,S,N-1,d,R,k),m>=3?o.unstuff2(D,f,U,w,v):o.unstuff(D,f,U,w,v)}else u.counter.bitstuffer++,U=S,u.ptr+=y,U>0&&(g=Math.ceil(w*U/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),D=new Uint32Array(M),u.ptr+=g,m>=3?d==null?o.originalUnstuff2(D,f,U,w):o.unstuff2(D,f,U,w,!1,d,R,k):d==null?o.originalUnstuff(D,f,U,w):o.unstuff(D,f,U,w,!1,d,R,k))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,_=d.height,m=d.microBlockSize,y=d.imageType,x=r.getDataTypeSize(y),b=Math.ceil(p/m),T=Math.ceil(_/m);u.pixels.numBlocksY=T,u.pixels.numBlocksX=b,u.pixels.ptr=0;var C=0,A=0,S=0,w=0,R=0,D=0,M=0,L=0,g=0,E=0,v=0,I=0,N=0,F=0,U=0,k=0,z,B,j,W,J,Y,ee=new f(m*m),Q=_%m||m,de=p%m||m,ge,le,ye=d.numDims,be,Ie=u.pixels.resultMask,Te=u.pixels.resultPixels;for(S=0;S<T;S++)for(R=S!==T-1?m:Q,w=0;w<b;w++)for(D=w!==b-1?m:de,v=S*p*m+w*m,I=p-D,be=0;be<ye;be++){if(ye>1&&(Te=new f(u.pixels.resultPixels.buffer,p*_*be*x,p*_)),M=c.byteLength-u.ptr,z=new DataView(c,u.ptr,Math.min(10,M)),B={},k=0,L=z.getUint8(0),k++,g=L>>6&255,E=L>>2&15,E!==(w*m>>3&15))throw"integrity issue";if(Y=L&3,Y>3)throw u.ptr+=k,"Invalid block encoding ("+Y+")";if(Y===2){u.counter.constant++,u.ptr+=k;continue}else if(Y===0){if(u.counter.uncompressed++,u.ptr+=k,N=R*D*x,F=c.byteLength-u.ptr,N=N<F?N:F,j=new ArrayBuffer(N%x===0?N:N+x-N%x),W=new Uint8Array(j),W.set(new Uint8Array(c,u.ptr,N)),J=new f(j),U=0,Ie)for(C=0;C<R;C++){for(A=0;A<D;A++)Ie[v]&&(Te[v]=J[U++]),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<D;A++)Te[v++]=J[U++];v+=I}u.ptr+=U*x}else if(ge=r.getDataTypeUsed(y,g),le=r.getOnePixel(B,k,ge,z),k+=r.getDataTypeSize(ge),Y===3)if(u.ptr+=k,u.counter.constantoffset++,Ie)for(C=0;C<R;C++){for(A=0;A<D;A++)Ie[v]&&(Te[v]=le),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<D;A++)Te[v++]=le;v+=I}else if(u.ptr+=k,r.decodeBits(c,u,ee,le,be),k=0,Ie)for(C=0;C<R;C++){for(A=0;A<D;A++)Ie[v]&&(Te[v]=ee[k++]),v++;v+=I}else for(C=0;C<R;C++){for(A=0;A<D;A++)Te[v++]=ee[k++];v+=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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,_=0,m=0,y=0,x=c.pixels.resultMask;if(x)if(f>1)for(_=0;_<f;_++)for(y=_*d,m=0;m<d;m++)x[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)x[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var _=p.headerInfo,m=_.fileVersion,y=r.getDataTypeArray(_.imageType);r.readMask(c,p),_.numValidPixel!==_.width*_.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var x=_.width*_.height;if(p.pixels.resultPixels=new y(x*_.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},_.numValidPixel!==0)if(_.zMax===_.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),T=b.getUint8(0);if(p.ptr++,T)r.readDataOneSweep(c,p,y);else if(m>1&&_.imageType<=1&&Math.abs(_.maxZError-.5)<1e-5){var C=b.getUint8(1);if(p.ptr++,p.encodeMode=C,C>2||m<4&&C>1)throw"Invalid Huffman flag "+C;C?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var A;u.inputOffset?(A=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(A)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(A=p.headerInfo.blobSize-p.ptr,Math.abs(A)>=1&&(p.eofOffset=p.headerInfo.blobSize));var S={width:_.width,height:_.height,pixelData:p.pixels.resultPixels,minValue:_.zMin,maxValue:_.zMax,validPixelCount:_.numValidPixel,dimCount:_.numDims,dimStats:{minValues:_.minValues,maxValues:_.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(_.imageType,f)){var w=p.pixels.resultMask;for(d=0;d<x;d++)w[d]||(S.pixelData[d]=f);S.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(p)),S}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,_,m=[],y,x,b={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var T=u.decode(o,{inputOffset:s,encodedMaskData:_,maskData:x,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=T.fileInfo.eofOffset,d===0&&(_=T.encodedMaskData,x=T.maskData,b.width=T.width,b.height=T.height,b.dimCount=T.dimCount||1,b.pixelType=T.pixelType||T.fileInfo.pixelType,b.mask=T.maskData),f>1&&T.fileInfo.mask&&T.fileInfo.mask.numBytes>0&&m.push(T.maskData),d++,b.pixels.push(T.pixelData),b.statistics.push({minValue:T.minValue,maxValue:T.maxValue,noDataValue:T.noDataValue,dimStats:T.dimStats})}var C,A,S;if(f>1&&m.length>1){for(S=b.width*b.height,b.bandMasks=m,x=new Uint8Array(S),x.set(m[0]),C=1;C<m.length;C++)for(y=m[C],A=0;A<S;A++)x[A]=x[A]&y[A];b.maskData=x}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof QG<"u"&&QG.exports?QG.exports=i:this.Lerc=i})()});var AIe=df((aEo,CIe)=>{CIe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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CAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBT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QAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var SIe=df((cEo,EIe)=>{var{webm:cNt,mp4:lNt}=AIe(),LJ=()=>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,NJ=()=>"wakeLock"in navigator,FJ=class{constructor(){if(this.enabled=!1,NJ()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else LJ()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",cNt),this._addSourceToVideo(this.noSleepVideo,"mp4",lNt),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 NJ()?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}):LJ()?(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(){NJ()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):LJ()?this.noSleepTimer&&(console.warn(` - NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};EIe.exports=FJ});function qIe(e){return e!=null}var l=qIe;function px(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(px.prototype=Object.create(Error.prototype),px.prototype.constructor=px);px.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};px.throwInstantiationError=function(){throw new px("This function defines an interface and should not be called directly.")};var he=px;var ws={};ws.typeOf={};function YIe(e){return`${e} is required, actual value was undefined`}function tC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ws.defined=function(e,t){if(!l(t))throw new he(YIe(e))};ws.typeOf.func=function(e,t){if(typeof t!="function")throw new he(tC(typeof t,"function",e))};ws.typeOf.string=function(e,t){if(typeof t!="string")throw new he(tC(typeof t,"string",e))};ws.typeOf.number=function(e,t){if(typeof t!="number")throw new he(tC(typeof t,"number",e))};ws.typeOf.number.lessThan=function(e,t,n){if(ws.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ws.typeOf.number.lessThanOrEquals=function(e,t,n){if(ws.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ws.typeOf.number.greaterThan=function(e,t,n){if(ws.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ws.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ws.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ws.typeOf.object=function(e,t){if(typeof t!="object")throw new he(tC(typeof t,"object",e))};ws.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(tC(typeof t,"boolean",e))};ws.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(tC(typeof t,"bigint",e))};ws.typeOf.number.equals=function(e,t,n,i){if(ws.typeOf.number(e,n),ws.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var co=ws;var B6=$r(IR(),1);var rt={};rt.EPSILON1=.1;rt.EPSILON2=.01;rt.EPSILON3=.001;rt.EPSILON4=1e-4;rt.EPSILON5=1e-5;rt.EPSILON6=1e-6;rt.EPSILON7=1e-7;rt.EPSILON8=1e-8;rt.EPSILON9=1e-9;rt.EPSILON10=1e-10;rt.EPSILON11=1e-11;rt.EPSILON12=1e-12;rt.EPSILON13=1e-13;rt.EPSILON14=1e-14;rt.EPSILON15=1e-15;rt.EPSILON16=1e-16;rt.EPSILON17=1e-17;rt.EPSILON18=1e-18;rt.EPSILON19=1e-19;rt.EPSILON20=1e-20;rt.EPSILON21=1e-21;rt.GRAVITATIONALPARAMETER=3986004418e5;rt.SOLAR_RADIUS=6955e5;rt.LUNAR_RADIUS=1737400;rt.SIXTY_FOUR_KILOBYTES=64*1024;rt.FOUR_GIGABYTES=4*1024*1024*1024;rt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};rt.signNotZero=function(e){return e<0?-1:1};rt.toSNorm=function(e,t){return t=t??255,Math.round((rt.clamp(e,-1,1)*.5+.5)*t)};rt.fromSNorm=function(e,t){return t=t??255,rt.clamp(e,0,t)/t*2-1};rt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:rt.clamp((e-t)/n,0,1)};rt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};rt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};rt.lerp=function(e,t,n){return(1-n)*e+n*t};rt.PI=Math.PI;rt.ONE_OVER_PI=1/Math.PI;rt.PI_OVER_TWO=Math.PI/2;rt.PI_OVER_THREE=Math.PI/3;rt.PI_OVER_FOUR=Math.PI/4;rt.PI_OVER_SIX=Math.PI/6;rt.THREE_PI_OVER_TWO=3*Math.PI/2;rt.TWO_PI=2*Math.PI;rt.ONE_OVER_TWO_PI=1/(2*Math.PI);rt.RADIANS_PER_DEGREE=Math.PI/180;rt.DEGREES_PER_RADIAN=180/Math.PI;rt.RADIANS_PER_ARCSECOND=rt.RADIANS_PER_DEGREE/3600;rt.toRadians=function(e){return e*rt.RADIANS_PER_DEGREE};rt.toDegrees=function(e){return e*rt.DEGREES_PER_RADIAN};rt.convertLongitudeRange=function(e){let t=rt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};rt.clampToLatitudeRange=function(e){return rt.clamp(e,-1*rt.PI_OVER_TWO,rt.PI_OVER_TWO)};rt.negativePiToPi=function(e){return e>=-rt.PI&&e<=rt.PI?e:rt.zeroToTwoPi(e+rt.PI)-rt.PI};rt.zeroToTwoPi=function(e){if(e>=0&&e<=rt.TWO_PI)return e;let t=rt.mod(e,rt.TWO_PI);return Math.abs(t)<rt.EPSILON14&&Math.abs(e)>rt.EPSILON14?rt.TWO_PI:t};rt.mod=function(e,t){return rt.sign(e)===rt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};rt.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))};rt.lessThan=function(e,t,n){return e-t<-n};rt.lessThanOrEquals=function(e,t,n){return e-t<n};rt.greaterThan=function(e,t,n){return e-t>n};rt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var PR=[1];rt.factorial=function(e){let t=PR.length;if(e>=t){let n=PR[t-1];for(let i=t;i<=e;i++){let o=n*i;PR.push(o),n=o}}return PR[e]};rt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};rt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};rt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};rt.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};rt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var jJ=new B6.default;rt.setRandomNumberSeed=function(e){jJ=new B6.default(e)};rt.nextRandomNumber=function(){return jJ.random()};rt.randomBetween=function(e,t){return rt.nextRandomNumber()*(t-e)+e};rt.acosClamped=function(e){return Math.acos(rt.clamp(e,-1,1))};rt.asinClamped=function(e){return Math.asin(rt.clamp(e,-1,1))};rt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};rt.logBase=function(e,t){return Math.log(e)/Math.log(t)};rt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};rt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};rt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};rt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};rt.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=rt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?rt.PI_OVER_TWO-i:i,i=e<0?rt.PI-i:i,i=t<0?-i:i,i};var P=rt;function Je(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Je.fromSpherical=function(e,t){l(t)||(t=new Je);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};Je.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Je(e,t,n)};Je.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Je(e.x,e.y,e.z)};Je.fromCartesian4=Je.clone;Je.packedLength=3;Je.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Je.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Je),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Je.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)Je.pack(e[o],t,o*3);return t};Je.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]=Je.unpack(e,i,t[o])}return t};Je.fromArray=Je.unpack;Je.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Je.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Je.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};Je.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};Je.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Je.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Je.magnitude=function(e){return Math.sqrt(Je.magnitudeSquared(e))};var RR=new Je;Je.distance=function(e,t){return Je.subtract(e,t,RR),Je.magnitude(RR)};Je.distanceSquared=function(e,t){return Je.subtract(e,t,RR),Je.magnitudeSquared(RR)};Je.normalize=function(e,t){let n=Je.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Je.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Je.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};Je.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};Je.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};Je.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};Je.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Je.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Je.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Je.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 WJ=new Je;Je.lerp=function(e,t,n,i){return Je.multiplyByScalar(t,n,WJ),i=Je.multiplyByScalar(e,1-n,i),Je.add(WJ,i,i)};var DR=new Je,k6=new Je;Je.angleBetween=function(e,t){Je.normalize(e,DR),Je.normalize(t,k6);let n=Je.dot(DR,k6),i=Je.magnitude(Je.cross(DR,k6,DR));return Math.atan2(i,n)};var XIe=new Je;Je.mostOrthogonalAxis=function(e,t){let n=Je.normalize(e,XIe);return Je.abs(n,n),n.x<=n.y?n.x<=n.z?t=Je.clone(Je.UNIT_X,t):t=Je.clone(Je.UNIT_Z,t):n.y<=n.z?t=Je.clone(Je.UNIT_Y,t):t=Je.clone(Je.UNIT_Z,t),t};Je.projectVector=function(e,t,n){let i=Je.dot(e,t)/Je.dot(t,t);return Je.multiplyByScalar(t,i,n)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Je.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Je.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};Je.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,d=i*a-o*s;return n.x=u,n.y=f,n.z=d,n};Je.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};Je.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),Je.fromRadians(e,t,n,i,o)};var hf=new Je,nC=new Je;Je._ellipsoidRadiiSquared=new Je(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Je.fromRadians=function(e,t,n,i,o){n=n??0;let r=l(i)?i.radiiSquared:Je._ellipsoidRadiiSquared,s=Math.cos(t);hf.x=s*Math.cos(e),hf.y=s*Math.sin(e),hf.z=Math.sin(t),hf=Je.normalize(hf,hf),Je.multiplyComponents(r,hf,nC);let a=Math.sqrt(Je.dot(hf,nC));return nC=Je.divideByScalar(nC,a,nC),hf=Je.multiplyByScalar(hf,n,hf),l(o)||(o=new Je),Je.add(nC,hf,o)};Je.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]=Je.fromDegrees(r,s,0,t,n[a])}return n};Je.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]=Je.fromRadians(r,s,0,t,n[a])}return n};Je.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]=Je.fromDegrees(r,s,a,t,n[c])}return n};Je.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]=Je.fromRadians(r,s,a,t,n[c])}return n};Je.ZERO=Object.freeze(new Je(0,0,0));Je.ONE=Object.freeze(new Je(1,1,1));Je.UNIT_X=Object.freeze(new Je(1,0,0));Je.UNIT_Y=Object.freeze(new Je(0,1,0));Je.UNIT_Z=Object.freeze(new Je(0,0,1));Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.prototype.equalsEpsilon=function(e,t,n){return Je.equalsEpsilon(this,e,t,n)};Je.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=Je;function bt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}bt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new bt(e,t,n,i)};bt.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 bt(e.red,e.green,e.blue,e.alpha)};bt.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 bt(e.x,e.y,e.z,e.w)};bt.packedLength=4;bt.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};bt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new bt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};bt.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)bt.pack(e[o],t,o*4);return t};bt.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]=bt.unpack(e,i,t[o])}return t};bt.fromArray=bt.unpack;bt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};bt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};bt.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};bt.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};bt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};bt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};bt.magnitude=function(e){return Math.sqrt(bt.magnitudeSquared(e))};var OR=new bt;bt.distance=function(e,t){return bt.subtract(e,t,OR),bt.magnitude(OR)};bt.distanceSquared=function(e,t){return bt.subtract(e,t,OR),bt.magnitudeSquared(OR)};bt.normalize=function(e,t){let n=bt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};bt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};bt.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};bt.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};bt.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};bt.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};bt.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};bt.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};bt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};bt.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 qJ=new bt;bt.lerp=function(e,t,n,i){return bt.multiplyByScalar(t,n,qJ),i=bt.multiplyByScalar(e,1-n,i),bt.add(qJ,i,i)};var KIe=new bt;bt.mostOrthogonalAxis=function(e,t){let n=bt.normalize(e,KIe);return bt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=bt.clone(bt.UNIT_X,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=bt.clone(bt.UNIT_Y,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t),t};bt.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};bt.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]};bt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};bt.ZERO=Object.freeze(new bt(0,0,0,0));bt.ONE=Object.freeze(new bt(1,1,1,1));bt.UNIT_X=Object.freeze(new bt(1,0,0,0));bt.UNIT_Y=Object.freeze(new bt(0,1,0,0));bt.UNIT_Z=Object.freeze(new bt(0,0,1,0));bt.UNIT_W=Object.freeze(new bt(0,0,0,1));bt.prototype.clone=function(e){return bt.clone(this,e)};bt.prototype.equals=function(e){return bt.equals(this,e)};bt.prototype.equalsEpsilon=function(e,t,n){return bt.equalsEpsilon(this,e,t,n)};bt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var U6=new Float32Array(1),sc=new Uint8Array(U6.buffer),$Ie=new Uint32Array([287454020]),ZIe=new Uint8Array($Ie.buffer),YJ=ZIe[0]===68;bt.packFloat=function(e,t){return l(t)||(t=new bt),U6[0]=e,YJ?(t.x=sc[0],t.y=sc[1],t.z=sc[2],t.w=sc[3]):(t.x=sc[3],t.y=sc[2],t.z=sc[1],t.w=sc[0]),t};bt.unpackFloat=function(e){return YJ?(sc[0]=e.x,sc[1]=e.y,sc[2]=e.z,sc[3]=e.w):(sc[0]=e.w,sc[1]=e.z,sc[2]=e.y,sc[3]=e.x),U6[0]};var ie=bt;var z6={};z6.EMPTY_OBJECT=Object.freeze({});z6.EMPTY_ARRAY=Object.freeze([]);var G=z6;function tt(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}tt.packedLength=9;tt.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};tt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new tt),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};tt.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)tt.pack(e[o],t,o*9);return t};tt.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]=tt.unpack(e,i,t[o])}return t};tt.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 tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.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 tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,_=2*(i-f),m=2*(o+c),y=2*(i+f),x=-n+s-u+d,b=2*(a-r),T=2*(o-c),C=2*(a+r),A=-n-s+u+d;return l(t)?(t[0]=p,t[1]=y,t[2]=T,t[3]=_,t[4]=x,t[5]=C,t[6]=m,t[7]=b,t[8]=A,t):new tt(p,_,m,y,x,b,T,C,A)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,d=n*s,p=o*i+a*r*s,_=-a*i+o*r*s,m=-r,y=a*n,x=o*n;return l(t)?(t[0]=c,t[1]=d,t[2]=m,t[3]=u,t[4]=p,t[5]=y,t[6]=f,t[7]=_,t[8]=x,t):new tt(c,u,f,d,p,_,m,y,x)};tt.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 tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.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 tt(e,0,0,0,e,0,0,0,e)};tt.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 tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.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 tt(1,0,0,0,n,-i,0,i,n)};tt.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 tt(n,0,i,0,1,0,-i,0,n)};tt.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 tt(n,-i,0,i,n,0,0,0,1)};tt.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]]};tt.getElementIndex=function(e,t){return e*3+t};tt.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};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.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};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var QIe=new h;tt.setScale=function(e,t,n){let i=tt.getScale(e,QIe),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 JIe=new h;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,JIe),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 V6=new h;tt.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],V6)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],V6)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],V6)),t};var XJ=new h;tt.getMaximumScale=function(e){return tt.getScale(e,XJ),h.maximumComponent(XJ)};var ePe=new h;tt.setRotation=function(e,t,n){let i=tt.getScale(e,ePe);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 tPe=new h;tt.getRotation=function(e,t){let n=tt.getScale(e,tPe);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};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};tt.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};tt.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};tt.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};tt.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};tt.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};tt.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};tt.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};tt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function nPe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var H6=[1,0,0],G6=[2,2,1];function iPe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(G6[n],H6[n])];t+=2*i*i}return Math.sqrt(t)}function oPe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(G6[u],H6[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=H6[o],c=G6[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let u=e[tt.getElementIndex(c,c)],f=e[tt.getElementIndex(a,a)],d=e[tt.getElementIndex(c,a)],p=(u-f)/2/d,_;p<0?_=-1/(-p+Math.sqrt(1+p*p)):_=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+_*_),s=_*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var MR=new tt,KJ=new tt;tt.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*nPe(a);for(;r<i&&iPe(a)>c;)oPe(a,MR),tt.transpose(MR,KJ),tt.multiply(a,MR,a),tt.multiply(KJ,a,a),tt.multiply(s,MR,s),++o>2&&(++r,o=0);return t};tt.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};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=tt.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return tt.multiplyByScalar(t,p,t)};var rPe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,rPe),t)};tt.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]};tt.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};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.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]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) -(${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var Z=tt;function Xv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Xv.prototype=Object.create(Error.prototype),Xv.prototype.constructor=Xv);Xv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var se=Xv;function et(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,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]=u??0,this[7]=_??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=d??0,this[15]=y??0}et.packedLength=16;et.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};et.unpack=function(e,t,n){return t=t??0,l(n)||(n=new et),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};et.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)et.pack(e[o],t,o*16);return t};et.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]=et.unpack(e,i,t[o])}return t};et.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 et(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])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return et.clone(e,t)};et.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 et(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])};et.fromRotationTranslation=function(e,t,n){return t=t??h.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 et(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)};et.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new et);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,_=t.y*t.w,m=t.z*t.z,y=t.z*t.w,x=t.w*t.w,b=a-d-m+x,T=2*(c-y),C=2*(u+_),A=2*(c+y),S=-a+d-m+x,w=2*(p-f),R=2*(u-_),D=2*(p+f),M=-a-d+m+x;return i[0]=b*o,i[1]=A*o,i[2]=R*o,i[3]=0,i[4]=T*r,i[5]=S*r,i[6]=D*r,i[7]=0,i[8]=C*s,i[9]=w*s,i[10]=M*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};et.fromTranslationRotationScale=function(e,t){return et.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};et.fromTranslation=function(e,t){return et.fromRotationTranslation(Z.IDENTITY,e,t)};et.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 et(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};et.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 et(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};et.fromRotation=function(e,t){return l(t)||(t=new et),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 iC=new h,oC=new h,Kv=new h;et.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,iC),h.normalize(h.cross(iC,o,oC),oC),h.normalize(h.cross(oC,iC,Kv),Kv);let r=oC.x,s=oC.y,a=oC.z,c=iC.x,u=iC.y,f=iC.z,d=Kv.x,p=Kv.y,_=Kv.z,m=n.x,y=n.y,x=n.z,b=r*-m+s*-y+a*-x,T=d*-m+p*-y+_*-x,C=c*m+u*y+f*x;return l(t)?(t[0]=r,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=_,t[10]=-f,t[11]=0,t[12]=b,t[13]=T,t[14]=C,t[15]=1,t):new et(r,s,a,b,d,p,_,T,-c,-u,-f,C,0,0,0,1)};et.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};et.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,d=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};et.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(r+o)/(r-o),p=-1,_=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=_,s[15]=0,s};et.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-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]=u,r[10]=f,r[11]=d,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};et.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new et),e=e??G.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,_=f,m=o+c,y=r+u,x=t+f,b=1;return i[0]=d,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]=_,i[11]=0,i[12]=m,i[13]=y,i[14]=x,i[15]=b,i};et.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]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};et.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]]};et.getElementIndex=function(e,t){return e*4+t};et.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};et.setColumn=function(e,t,n,i){i=et.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};et.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};et.setRow=function(e,t,n,i){return i=et.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};et.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 sPe=new h;et.setScale=function(e,t,n){let i=et.getScale(e,sPe),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 aPe=new h;et.setUniformScale=function(e,t,n){let i=et.getScale(e,aPe),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 j6=new h;et.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],j6)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],j6)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],j6)),t};var $J=new h;et.getMaximumScale=function(e){return et.getScale(e,$J),h.maximumComponent($J)};var cPe=new h;et.setRotation=function(e,t,n){let i=et.getScale(e,cPe);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 lPe=new h;et.getRotation=function(e,t){let n=et.getScale(e,lPe);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};et.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],_=e[10],m=e[11],y=e[12],x=e[13],b=e[14],T=e[15],C=t[0],A=t[1],S=t[2],w=t[3],R=t[4],D=t[5],M=t[6],L=t[7],g=t[8],E=t[9],v=t[10],I=t[11],N=t[12],F=t[13],U=t[14],k=t[15],z=i*C+a*A+d*S+y*w,B=o*C+c*A+p*S+x*w,j=r*C+u*A+_*S+b*w,W=s*C+f*A+m*S+T*w,J=i*R+a*D+d*M+y*L,Y=o*R+c*D+p*M+x*L,ee=r*R+u*D+_*M+b*L,Q=s*R+f*D+m*M+T*L,de=i*g+a*E+d*v+y*I,ge=o*g+c*E+p*v+x*I,le=r*g+u*E+_*v+b*I,ye=s*g+f*E+m*v+T*I,be=i*N+a*F+d*U+y*k,Ie=o*N+c*F+p*U+x*k,Te=r*N+u*F+_*U+b*k,ve=s*N+f*F+m*U+T*k;return n[0]=z,n[1]=B,n[2]=j,n[3]=W,n[4]=J,n[5]=Y,n[6]=ee,n[7]=Q,n[8]=de,n[9]=ge,n[10]=le,n[11]=ye,n[12]=be,n[13]=Ie,n[14]=Te,n[15]=ve,n};et.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};et.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};et.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],_=e[13],m=e[14],y=t[0],x=t[1],b=t[2],T=t[4],C=t[5],A=t[6],S=t[8],w=t[9],R=t[10],D=t[12],M=t[13],L=t[14],g=i*y+s*x+u*b,E=o*y+a*x+f*b,v=r*y+c*x+d*b,I=i*T+s*C+u*A,N=o*T+a*C+f*A,F=r*T+c*C+d*A,U=i*S+s*w+u*R,k=o*S+a*w+f*R,z=r*S+c*w+d*R,B=i*D+s*M+u*L+p,j=o*D+a*M+f*L+_,W=r*D+c*M+d*L+m;return n[0]=g,n[1]=E,n[2]=v,n[3]=0,n[4]=I,n[5]=N,n[6]=F,n[7]=0,n[8]=U,n[9]=k,n[10]=z,n[11]=0,n[12]=B,n[13]=j,n[14]=W,n[15]=1,n};et.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],_=t[1],m=t[2],y=t[3],x=t[4],b=t[5],T=t[6],C=t[7],A=t[8],S=i*p+s*_+u*m,w=o*p+a*_+f*m,R=r*p+c*_+d*m,D=i*y+s*x+u*b,M=o*y+a*x+f*b,L=r*y+c*x+d*b,g=i*T+s*C+u*A,E=o*T+a*C+f*A,v=r*T+c*C+d*A;return n[0]=S,n[1]=w,n[2]=R,n[3]=0,n[4]=D,n[5]=M,n[6]=L,n[7]=0,n[8]=g,n[9]=E,n[10]=v,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.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};et.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?et.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)};et.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};et.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};et.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};et.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};et.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};et.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};et.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};et.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};et.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]};et.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};et.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};et.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 uPe=new Z,fPe=new Z,dPe=new ie,hPe=new ie(0,0,0,1);et.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],_=e[14],m=e[3],y=e[7],x=e[11],b=e[15],T=p*b,C=_*x,A=d*b,S=_*y,w=d*x,R=p*y,D=f*b,M=_*m,L=f*x,g=p*m,E=f*y,v=d*m,I=T*a+S*c+w*u-(C*a+A*c+R*u),N=C*s+D*c+g*u-(T*s+M*c+L*u),F=A*s+M*a+E*u-(S*s+D*a+v*u),U=R*s+L*a+v*c-(w*s+g*a+E*c),k=C*i+A*o+R*r-(T*i+S*o+w*r),z=T*n+M*o+L*r-(C*n+D*o+g*r),B=S*n+D*i+v*r-(A*n+M*i+E*r),j=w*n+g*i+E*o-(R*n+L*i+v*o);T=o*u,C=r*c,A=i*u,S=r*a,w=i*c,R=o*a,D=n*u,M=r*s,L=n*c,g=o*s,E=n*a,v=i*s;let W=T*y+S*x+w*b-(C*y+A*x+R*b),J=C*m+D*x+g*b-(T*m+M*x+L*b),Y=A*m+M*y+E*b-(S*m+D*y+v*b),ee=R*m+L*y+v*x-(w*m+g*y+E*x),Q=A*p+R*_+C*d-(w*_+T*d+S*p),de=L*_+T*f+M*p-(D*p+g*_+C*f),ge=D*d+v*_+S*f-(E*_+A*f+M*d),le=E*p+w*f+g*d-(L*d+v*p+R*f),ye=n*I+i*N+o*F+r*U;if(Math.abs(ye)<P.EPSILON21){if(Z.equalsEpsilon(et.getMatrix3(e,uPe),fPe,P.EPSILON7)&&ie.equals(et.getRow(e,3,dPe),hPe))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 se("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=I*ye,t[1]=N*ye,t[2]=F*ye,t[3]=U*ye,t[4]=k*ye,t[5]=z*ye,t[6]=B*ye,t[7]=j*ye,t[8]=W*ye,t[9]=J*ye,t[10]=Y*ye,t[11]=ee*ye,t[12]=Q*ye,t[13]=de*ye,t[14]=ge*ye,t[15]=le*ye,t};et.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],_=e[14],m=-n*d-i*p-o*_,y=-r*d-s*p-a*_,x=-c*d-u*p-f*_;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=x,t[15]=1,t};var mPe=new et;et.inverseTranspose=function(e,t){return et.inverse(et.transpose(e,mPe),t)};et.IDENTITY=Object.freeze(new et(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN0ROW3=3;et.COLUMN1ROW0=4;et.COLUMN1ROW1=5;et.COLUMN1ROW2=6;et.COLUMN1ROW3=7;et.COLUMN2ROW0=8;et.COLUMN2ROW1=9;et.COLUMN2ROW2=10;et.COLUMN2ROW3=11;et.COLUMN3ROW0=12;et.COLUMN3ROW1=13;et.COLUMN3ROW2=14;et.COLUMN3ROW3=15;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.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]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.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 O=et;var pPe={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},q=Object.freeze(pPe);var _Pe=new h;function Dt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ca={};ca[q.FLOAT]="float";ca[q.FLOAT_VEC2]="vec2";ca[q.FLOAT_VEC3]="vec3";ca[q.FLOAT_VEC4]="vec4";ca[q.INT]="int";ca[q.INT_VEC2]="ivec2";ca[q.INT_VEC3]="ivec3";ca[q.INT_VEC4]="ivec4";ca[q.BOOL]="bool";ca[q.BOOL_VEC2]="bvec2";ca[q.BOOL_VEC3]="bvec3";ca[q.BOOL_VEC4]="bvec4";ca[q.FLOAT_MAT2]="mat2";ca[q.FLOAT_MAT3]="mat3";ca[q.FLOAT_MAT4]="mat4";ca[q.SAMPLER_2D]="sampler2D";ca[q.SAMPLER_CUBE]="samplerCube";Dt.prototype.getDeclaration=function(e){let t=`uniform ${ca[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var gPe={czm_viewport:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Dt({size:1,datatype:q.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Dt({size:1,datatype:q.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Dt({size:1,datatype:q.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return O.getTranslation(e.inverseView,_Pe)}}),czm_frameNumber:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Dt({size:1,datatype:q.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Dt({size:1,datatype:q.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Dt({size:1,datatype:q.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Dt({size:9,datatype:q.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Dt({size:1,datatype:q.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Dt({size:1,datatype:q.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Dt({size:1,datatype:q.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Dt({size:1,datatype:q.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},mg=gPe;function yPe(){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 Nn=yPe;function xPe(){return!0}function bPe(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=xPe}var ce=bPe;var Gs={UNSIGNED_BYTE:q.UNSIGNED_BYTE,UNSIGNED_SHORT:q.UNSIGNED_SHORT,UNSIGNED_INT:q.UNSIGNED_INT};Gs.getSizeInBytes=function(e){switch(e){case Gs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Gs.fromSizeInBytes=function(e){switch(e){case 2:return Gs.UNSIGNED_SHORT;case 4:return Gs.UNSIGNED_INT;case 1:return Gs.UNSIGNED_BYTE}};Gs.validate=function(e){return l(e)&&(e===Gs.UNSIGNED_BYTE||e===Gs.UNSIGNED_SHORT||e===Gs.UNSIGNED_INT)};Gs.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Gs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Gs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Gs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Gs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Gs.UNSIGNED_INT};var ke=Object.freeze(Gs);var LR={STREAM_DRAW:q.STREAM_DRAW,STATIC_DRAW:q.STATIC_DRAW,DYNAMIC_DRAW:q.DYNAMIC_DRAW,validate:function(e){return e===LR.STREAM_DRAW||e===LR.STATIC_DRAW||e===LR.DYNAMIC_DRAW}},Ne=Object.freeze(LR);function mf(e){e=e??G.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=Nn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}mf.createVertexBuffer=function(e){return new mf({context:e.context,bufferTarget:q.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};mf.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=ke.getSizeInBytes(n),o=new mf({context:t,bufferTarget:q.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(mf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});mf.prototype._getBuffer=function(){return this._buffer};mf.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)};mf.prototype.copyFromBuffer=function(e,t,n,i){let o=q.COPY_READ_BUFFER,r=q.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)};mf.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=q.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};mf.prototype.isDestroyed=function(){return!1};mf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ce(this)};var st=mf;var pg,Lr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Il={};Object.defineProperties(Il,{element:{get:function(){if(Il.supportsFullscreen())return document[Lr.fullscreenElement]}},changeEventName:{get:function(){if(Il.supportsFullscreen())return Lr.fullscreenchange}},errorEventName:{get:function(){if(Il.supportsFullscreen())return Lr.fullscreenerror}},enabled:{get:function(){if(Il.supportsFullscreen())return document[Lr.fullscreenEnabled]}},fullscreen:{get:function(){if(Il.supportsFullscreen())return Il.element!==null}}});Il.supportsFullscreen=function(){if(l(pg))return pg;pg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Lr.requestFullscreen="requestFullscreen",Lr.exitFullscreen="exitFullscreen",Lr.fullscreenEnabled="fullscreenEnabled",Lr.fullscreenElement="fullscreenElement",Lr.fullscreenchange="fullscreenchange",Lr.fullscreenerror="fullscreenerror",pg=!0,pg;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"?(Lr.requestFullscreen=n,pg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Lr.requestFullscreen=n,pg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Lr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Lr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Lr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Lr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Lr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Lr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Lr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Lr.fullscreenerror=n)}return pg};Il.requestFullscreen=function(e,t){Il.supportsFullscreen()&&e[Lr.requestFullscreen]({vrDisplay:t})};Il.exitFullscreen=function(){Il.supportsFullscreen()&&document[Lr.exitFullscreen]()};Il._names=Lr;var Nr=Il;var ac;typeof navigator<"u"?ac=navigator:ac={};function _x(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var NR,ZJ;function $6(){if(!l(NR)&&(NR=!1,!VR())){let e=/ Chrome\/([\.0-9]+)/.exec(ac.userAgent);e!==null&&(NR=!0,ZJ=_x(e[1]))}return NR}function TPe(){return $6()&&ZJ}var FR,QJ;function JJ(){if(!l(FR)&&(FR=!1,!$6()&&!VR()&&/ Safari\/[\.0-9]+/.test(ac.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(ac.userAgent);e!==null&&(FR=!0,QJ=_x(e[1]))}return FR}function CPe(){return JJ()&&QJ}var BR,X6;function eee(){if(!l(BR)){BR=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ac.userAgent);e!==null&&(BR=!0,X6=_x(e[1]),X6.isNightly=!!e[2])}return BR}function APe(){return eee()&&X6}var $v,K6;function tee(){if(!l($v)){$v=!1;let e;ac.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ac.userAgent),e!==null&&($v=!0,K6=_x(e[1]))):ac.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ac.userAgent),e!==null&&($v=!0,K6=_x(e[1])))}return $v}function EPe(){return tee()&&K6}var kR,nee;function VR(){if(!l(kR)){kR=!1;let e=/ Edg\/([\.0-9]+)/.exec(ac.userAgent);e!==null&&(kR=!0,nee=_x(e[1]))}return kR}function SPe(){return VR()&&nee}var UR,Z6;function HR(){if(!l(UR)){UR=!1;let e=/Firefox\/([\.0-9]+)/.exec(ac.userAgent);e!==null&&(UR=!0,Z6=_x(e[1]))}return UR}var W6;function vPe(){return l(W6)||(W6=/Windows/i.test(ac.appVersion)),W6}var q6;function wPe(){return l(q6)||(q6=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),q6}function IPe(){return HR()&&Z6}var Y6;function PPe(){return l(Y6)||(Y6=!HR()&&typeof PointerEvent<"u"&&(!l(ac.pointerEnabled)||ac.pointerEnabled)),Y6}var iee,zR;function oee(){if(!l(zR)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;zR=l(t)&&t!=="",zR&&(iee=t)}return zR}function DPe(){return oee()?iee:void 0}function zc(){return zc._result}zc._promise=void 0;zc._result=void 0;zc.initialize=function(){return l(zc._promise)||(zc._promise=new Promise(e=>{let t=new Image;t.onload=function(){zc._result=t.width>0&&t.height>0,e(zc._result)},t.onerror=function(){zc._result=!1,e(zc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),zc._promise};Object.defineProperties(zc,{initialized:{get:function(){return l(zc._result)}}});var rC=[];typeof ArrayBuffer<"u"&&(rC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&rC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&rC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&rC.push(BigInt64Array),typeof BigUint64Array<"u"&&rC.push(BigUint64Array));var pf={isChrome:$6,chromeVersion:TPe,isSafari:JJ,safariVersion:CPe,isWebkit:eee,webkitVersion:APe,isInternetExplorer:tee,internetExplorerVersion:EPe,isEdge:VR,edgeVersion:SPe,isFirefox:HR,firefoxVersion:IPe,isWindows:vPe,isIPadOrIOS:wPe,hardwareConcurrency:ac.hardwareConcurrency??3,supportsPointerEvents:PPe,supportsImageRenderingPixelated:oee,supportsWebP:zc,imageRenderingValue:DPe,typedArrayTypes:rC};pf.supportsBasis=function(e){return pf.supportsWebAssembly()&&e.context.supportsBasis};pf.supportsFullscreen=function(){return Nr.supportsFullscreen()};pf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};pf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};pf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};pf.supportsBigInt=function(){return typeof BigInt<"u"};pf.supportsWebWorkers=function(){return typeof Worker<"u"};pf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};pf.supportsWebgl2=function(e){return e.context.webgl2};pf.supportsEsmWebWorkers=function(){return!HR()||parseInt(Z6)>=114};var Ft=pf;function Q6(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 oe(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}oe.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 oe(e.x,e.y,e.z,e.w)};oe.fromBytes=function(e,t,n,i,o){return e=oe.byteToFloat(e??255),t=oe.byteToFloat(t??255),n=oe.byteToFloat(n??255),i=oe.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new oe(e,t,n,i)};oe.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 oe(e.red,e.green,e.blue,t)};var J6,e9,Rp;Ft.supportsTypedArrays()&&(J6=new ArrayBuffer(4),e9=new Uint32Array(J6),Rp=new Uint8Array(J6));oe.fromRgba=function(e,t){return e9[0]=e,oe.fromBytes(Rp[0],Rp[1],Rp[2],Rp[3],t)};oe.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=Q6(u,c,e+1/3),s=Q6(u,c,e),a=Q6(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new oe(r,s,a,i)};oe.fromRandom=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.red;if(!l(n)){let s=e.minimumRed??0,a=e.maximumRed??1;n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new oe(n,i,o,r)};var RPe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,OPe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,MPe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,LPe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;oe.fromCssColorString=function(e,t){l(t)||(t=new oe),e=e.trim();let n=oe[e.toUpperCase()];if(l(n))return oe.clone(n,t),t;let i=RPe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(i[4]??"f",16)/15,t):(i=OPe.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=MPe.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=LPe.exec(e),i!==null?oe.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};oe.packedLength=4;oe.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};oe.unpack=function(e,t,n){return t=t??0,l(n)||(n=new oe),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};oe.byteToFloat=function(e){return e/255};oe.floatToByte=function(e){return e===1?255:e*256|0};oe.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 oe(e.red,e.green,e.blue,e.alpha)};oe.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};oe.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]};oe.prototype.clone=function(e){return oe.clone(this,e)};oe.prototype.equals=function(e){return oe.equals(this,e)};oe.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};oe.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};oe.prototype.toCssColorString=function(){let e=oe.floatToByte(this.red),t=oe.floatToByte(this.green),n=oe.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};oe.prototype.toCssHexString=function(){let e=oe.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=oe.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=oe.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=oe.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};oe.prototype.toBytes=function(e){let t=oe.floatToByte(this.red),n=oe.floatToByte(this.green),i=oe.floatToByte(this.blue),o=oe.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};oe.prototype.toRgba=function(){return Rp[0]=oe.floatToByte(this.red),Rp[1]=oe.floatToByte(this.green),Rp[2]=oe.floatToByte(this.blue),Rp[3]=oe.floatToByte(this.alpha),e9[0]};oe.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};oe.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};oe.prototype.withAlpha=function(e,t){return oe.fromAlpha(this,e,t)};oe.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};oe.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};oe.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};oe.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};oe.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};oe.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};oe.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};oe.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};oe.ALICEBLUE=Object.freeze(oe.fromCssColorString("#F0F8FF"));oe.ANTIQUEWHITE=Object.freeze(oe.fromCssColorString("#FAEBD7"));oe.AQUA=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.AQUAMARINE=Object.freeze(oe.fromCssColorString("#7FFFD4"));oe.AZURE=Object.freeze(oe.fromCssColorString("#F0FFFF"));oe.BEIGE=Object.freeze(oe.fromCssColorString("#F5F5DC"));oe.BISQUE=Object.freeze(oe.fromCssColorString("#FFE4C4"));oe.BLACK=Object.freeze(oe.fromCssColorString("#000000"));oe.BLANCHEDALMOND=Object.freeze(oe.fromCssColorString("#FFEBCD"));oe.BLUE=Object.freeze(oe.fromCssColorString("#0000FF"));oe.BLUEVIOLET=Object.freeze(oe.fromCssColorString("#8A2BE2"));oe.BROWN=Object.freeze(oe.fromCssColorString("#A52A2A"));oe.BURLYWOOD=Object.freeze(oe.fromCssColorString("#DEB887"));oe.CADETBLUE=Object.freeze(oe.fromCssColorString("#5F9EA0"));oe.CHARTREUSE=Object.freeze(oe.fromCssColorString("#7FFF00"));oe.CHOCOLATE=Object.freeze(oe.fromCssColorString("#D2691E"));oe.CORAL=Object.freeze(oe.fromCssColorString("#FF7F50"));oe.CORNFLOWERBLUE=Object.freeze(oe.fromCssColorString("#6495ED"));oe.CORNSILK=Object.freeze(oe.fromCssColorString("#FFF8DC"));oe.CRIMSON=Object.freeze(oe.fromCssColorString("#DC143C"));oe.CYAN=Object.freeze(oe.fromCssColorString("#00FFFF"));oe.DARKBLUE=Object.freeze(oe.fromCssColorString("#00008B"));oe.DARKCYAN=Object.freeze(oe.fromCssColorString("#008B8B"));oe.DARKGOLDENROD=Object.freeze(oe.fromCssColorString("#B8860B"));oe.DARKGRAY=Object.freeze(oe.fromCssColorString("#A9A9A9"));oe.DARKGREEN=Object.freeze(oe.fromCssColorString("#006400"));oe.DARKGREY=oe.DARKGRAY;oe.DARKKHAKI=Object.freeze(oe.fromCssColorString("#BDB76B"));oe.DARKMAGENTA=Object.freeze(oe.fromCssColorString("#8B008B"));oe.DARKOLIVEGREEN=Object.freeze(oe.fromCssColorString("#556B2F"));oe.DARKORANGE=Object.freeze(oe.fromCssColorString("#FF8C00"));oe.DARKORCHID=Object.freeze(oe.fromCssColorString("#9932CC"));oe.DARKRED=Object.freeze(oe.fromCssColorString("#8B0000"));oe.DARKSALMON=Object.freeze(oe.fromCssColorString("#E9967A"));oe.DARKSEAGREEN=Object.freeze(oe.fromCssColorString("#8FBC8F"));oe.DARKSLATEBLUE=Object.freeze(oe.fromCssColorString("#483D8B"));oe.DARKSLATEGRAY=Object.freeze(oe.fromCssColorString("#2F4F4F"));oe.DARKSLATEGREY=oe.DARKSLATEGRAY;oe.DARKTURQUOISE=Object.freeze(oe.fromCssColorString("#00CED1"));oe.DARKVIOLET=Object.freeze(oe.fromCssColorString("#9400D3"));oe.DEEPPINK=Object.freeze(oe.fromCssColorString("#FF1493"));oe.DEEPSKYBLUE=Object.freeze(oe.fromCssColorString("#00BFFF"));oe.DIMGRAY=Object.freeze(oe.fromCssColorString("#696969"));oe.DIMGREY=oe.DIMGRAY;oe.DODGERBLUE=Object.freeze(oe.fromCssColorString("#1E90FF"));oe.FIREBRICK=Object.freeze(oe.fromCssColorString("#B22222"));oe.FLORALWHITE=Object.freeze(oe.fromCssColorString("#FFFAF0"));oe.FORESTGREEN=Object.freeze(oe.fromCssColorString("#228B22"));oe.FUCHSIA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.GAINSBORO=Object.freeze(oe.fromCssColorString("#DCDCDC"));oe.GHOSTWHITE=Object.freeze(oe.fromCssColorString("#F8F8FF"));oe.GOLD=Object.freeze(oe.fromCssColorString("#FFD700"));oe.GOLDENROD=Object.freeze(oe.fromCssColorString("#DAA520"));oe.GRAY=Object.freeze(oe.fromCssColorString("#808080"));oe.GREEN=Object.freeze(oe.fromCssColorString("#008000"));oe.GREENYELLOW=Object.freeze(oe.fromCssColorString("#ADFF2F"));oe.GREY=oe.GRAY;oe.HONEYDEW=Object.freeze(oe.fromCssColorString("#F0FFF0"));oe.HOTPINK=Object.freeze(oe.fromCssColorString("#FF69B4"));oe.INDIANRED=Object.freeze(oe.fromCssColorString("#CD5C5C"));oe.INDIGO=Object.freeze(oe.fromCssColorString("#4B0082"));oe.IVORY=Object.freeze(oe.fromCssColorString("#FFFFF0"));oe.KHAKI=Object.freeze(oe.fromCssColorString("#F0E68C"));oe.LAVENDER=Object.freeze(oe.fromCssColorString("#E6E6FA"));oe.LAVENDAR_BLUSH=Object.freeze(oe.fromCssColorString("#FFF0F5"));oe.LAWNGREEN=Object.freeze(oe.fromCssColorString("#7CFC00"));oe.LEMONCHIFFON=Object.freeze(oe.fromCssColorString("#FFFACD"));oe.LIGHTBLUE=Object.freeze(oe.fromCssColorString("#ADD8E6"));oe.LIGHTCORAL=Object.freeze(oe.fromCssColorString("#F08080"));oe.LIGHTCYAN=Object.freeze(oe.fromCssColorString("#E0FFFF"));oe.LIGHTGOLDENRODYELLOW=Object.freeze(oe.fromCssColorString("#FAFAD2"));oe.LIGHTGRAY=Object.freeze(oe.fromCssColorString("#D3D3D3"));oe.LIGHTGREEN=Object.freeze(oe.fromCssColorString("#90EE90"));oe.LIGHTGREY=oe.LIGHTGRAY;oe.LIGHTPINK=Object.freeze(oe.fromCssColorString("#FFB6C1"));oe.LIGHTSEAGREEN=Object.freeze(oe.fromCssColorString("#20B2AA"));oe.LIGHTSKYBLUE=Object.freeze(oe.fromCssColorString("#87CEFA"));oe.LIGHTSLATEGRAY=Object.freeze(oe.fromCssColorString("#778899"));oe.LIGHTSLATEGREY=oe.LIGHTSLATEGRAY;oe.LIGHTSTEELBLUE=Object.freeze(oe.fromCssColorString("#B0C4DE"));oe.LIGHTYELLOW=Object.freeze(oe.fromCssColorString("#FFFFE0"));oe.LIME=Object.freeze(oe.fromCssColorString("#00FF00"));oe.LIMEGREEN=Object.freeze(oe.fromCssColorString("#32CD32"));oe.LINEN=Object.freeze(oe.fromCssColorString("#FAF0E6"));oe.MAGENTA=Object.freeze(oe.fromCssColorString("#FF00FF"));oe.MAROON=Object.freeze(oe.fromCssColorString("#800000"));oe.MEDIUMAQUAMARINE=Object.freeze(oe.fromCssColorString("#66CDAA"));oe.MEDIUMBLUE=Object.freeze(oe.fromCssColorString("#0000CD"));oe.MEDIUMORCHID=Object.freeze(oe.fromCssColorString("#BA55D3"));oe.MEDIUMPURPLE=Object.freeze(oe.fromCssColorString("#9370DB"));oe.MEDIUMSEAGREEN=Object.freeze(oe.fromCssColorString("#3CB371"));oe.MEDIUMSLATEBLUE=Object.freeze(oe.fromCssColorString("#7B68EE"));oe.MEDIUMSPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FA9A"));oe.MEDIUMTURQUOISE=Object.freeze(oe.fromCssColorString("#48D1CC"));oe.MEDIUMVIOLETRED=Object.freeze(oe.fromCssColorString("#C71585"));oe.MIDNIGHTBLUE=Object.freeze(oe.fromCssColorString("#191970"));oe.MINTCREAM=Object.freeze(oe.fromCssColorString("#F5FFFA"));oe.MISTYROSE=Object.freeze(oe.fromCssColorString("#FFE4E1"));oe.MOCCASIN=Object.freeze(oe.fromCssColorString("#FFE4B5"));oe.NAVAJOWHITE=Object.freeze(oe.fromCssColorString("#FFDEAD"));oe.NAVY=Object.freeze(oe.fromCssColorString("#000080"));oe.OLDLACE=Object.freeze(oe.fromCssColorString("#FDF5E6"));oe.OLIVE=Object.freeze(oe.fromCssColorString("#808000"));oe.OLIVEDRAB=Object.freeze(oe.fromCssColorString("#6B8E23"));oe.ORANGE=Object.freeze(oe.fromCssColorString("#FFA500"));oe.ORANGERED=Object.freeze(oe.fromCssColorString("#FF4500"));oe.ORCHID=Object.freeze(oe.fromCssColorString("#DA70D6"));oe.PALEGOLDENROD=Object.freeze(oe.fromCssColorString("#EEE8AA"));oe.PALEGREEN=Object.freeze(oe.fromCssColorString("#98FB98"));oe.PALETURQUOISE=Object.freeze(oe.fromCssColorString("#AFEEEE"));oe.PALEVIOLETRED=Object.freeze(oe.fromCssColorString("#DB7093"));oe.PAPAYAWHIP=Object.freeze(oe.fromCssColorString("#FFEFD5"));oe.PEACHPUFF=Object.freeze(oe.fromCssColorString("#FFDAB9"));oe.PERU=Object.freeze(oe.fromCssColorString("#CD853F"));oe.PINK=Object.freeze(oe.fromCssColorString("#FFC0CB"));oe.PLUM=Object.freeze(oe.fromCssColorString("#DDA0DD"));oe.POWDERBLUE=Object.freeze(oe.fromCssColorString("#B0E0E6"));oe.PURPLE=Object.freeze(oe.fromCssColorString("#800080"));oe.RED=Object.freeze(oe.fromCssColorString("#FF0000"));oe.ROSYBROWN=Object.freeze(oe.fromCssColorString("#BC8F8F"));oe.ROYALBLUE=Object.freeze(oe.fromCssColorString("#4169E1"));oe.SADDLEBROWN=Object.freeze(oe.fromCssColorString("#8B4513"));oe.SALMON=Object.freeze(oe.fromCssColorString("#FA8072"));oe.SANDYBROWN=Object.freeze(oe.fromCssColorString("#F4A460"));oe.SEAGREEN=Object.freeze(oe.fromCssColorString("#2E8B57"));oe.SEASHELL=Object.freeze(oe.fromCssColorString("#FFF5EE"));oe.SIENNA=Object.freeze(oe.fromCssColorString("#A0522D"));oe.SILVER=Object.freeze(oe.fromCssColorString("#C0C0C0"));oe.SKYBLUE=Object.freeze(oe.fromCssColorString("#87CEEB"));oe.SLATEBLUE=Object.freeze(oe.fromCssColorString("#6A5ACD"));oe.SLATEGRAY=Object.freeze(oe.fromCssColorString("#708090"));oe.SLATEGREY=oe.SLATEGRAY;oe.SNOW=Object.freeze(oe.fromCssColorString("#FFFAFA"));oe.SPRINGGREEN=Object.freeze(oe.fromCssColorString("#00FF7F"));oe.STEELBLUE=Object.freeze(oe.fromCssColorString("#4682B4"));oe.TAN=Object.freeze(oe.fromCssColorString("#D2B48C"));oe.TEAL=Object.freeze(oe.fromCssColorString("#008080"));oe.THISTLE=Object.freeze(oe.fromCssColorString("#D8BFD8"));oe.TOMATO=Object.freeze(oe.fromCssColorString("#FF6347"));oe.TURQUOISE=Object.freeze(oe.fromCssColorString("#40E0D0"));oe.VIOLET=Object.freeze(oe.fromCssColorString("#EE82EE"));oe.WHEAT=Object.freeze(oe.fromCssColorString("#F5DEB3"));oe.WHITE=Object.freeze(oe.fromCssColorString("#FFFFFF"));oe.WHITESMOKE=Object.freeze(oe.fromCssColorString("#F5F5F5"));oe.YELLOW=Object.freeze(oe.fromCssColorString("#FFFF00"));oe.YELLOWGREEN=Object.freeze(oe.fromCssColorString("#9ACD32"));oe.TRANSPARENT=Object.freeze(new oe(0,0,0,0));var H=oe;function GR(e){e=e??G.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}GR.ALL=Object.freeze(new GR({color:new H(0,0,0,0),depth:1,stencil:0}));GR.prototype.execute=function(e,t){e.clear(this,t)};var ri=GR;var NPe={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},Se=Object.freeze(NPe);function ree(e){e=e??G.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=Se.COMPUTE,this.owner=e.owner}ree.prototype.execute=function(e){e.execute(this)};var Fa=ree;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=P.clamp(e.x,t.x,n.x),r=P.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 jR=new Ut;Ut.distance=function(e,t){return Ut.subtract(e,t,jR),Ut.magnitude(jR)};Ut.distanceSquared=function(e,t){return Ut.subtract(e,t,jR),Ut.magnitudeSquared(jR)};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 see=new Ut;Ut.lerp=function(e,t,n,i){return Ut.multiplyByScalar(t,n,see),i=Ut.multiplyByScalar(e,1-n,i),Ut.add(see,i,i)};var aee=new Ut,cee=new Ut;Ut.angleBetween=function(e,t){return Ut.normalize(e,aee),Ut.normalize(t,cee),P.acosClamped(Ut.dot(aee,cee))};var FPe=new Ut;Ut.mostOrthogonalAxis=function(e,t){let n=Ut.normalize(e,FPe);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)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.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 V=Ut;var BPe=new h,kPe=new h;function UPe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=s*s*u*u,_=a*a*f*f,m=d+p+_,y=Math.sqrt(1/m),x=h.multiplyByScalar(e,y,BPe);if(m<i)return isFinite(y)?h.clone(x,o):void 0;let b=n.x,T=n.y,C=n.z,A=kPe;A.x=x.x*b*2,A.y=x.y*T*2,A.z=x.z*C*2;let S=(1-y)*h.magnitude(e)/(.5*h.magnitude(A)),w=0,R,D,M,L,g,E,v,I,N,F,U;do{S-=w,M=1/(1+S*b),L=1/(1+S*T),g=1/(1+S*C),E=M*M,v=L*L,I=g*g,N=E*M,F=v*L,U=I*g,R=d*E+p*v+_*I-1,D=d*N*b+p*F*T+_*U*C;let k=-2*D;w=R/k}while(Math.abs(R)>P.EPSILON12);return l(o)?(o.x=r*M,o.y=s*L,o.z=a*g,o):new h(r*M,s*L,a*g)}var sC=UPe;function Uo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Uo.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Uo(e,t,n)};Uo.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Uo.fromRadians(e,t,n,i)};var zPe=new h,VPe=new h,HPe=new h;Uo._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);Uo._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Uo._ellipsoidCenterToleranceSquared=P.EPSILON1;Uo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Uo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Uo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Uo._ellipsoidCenterToleranceSquared,s=sC(e,i,o,r,VPe);if(!l(s))return;let a=h.multiplyComponents(s,o,zPe);a=h.normalize(a,a);let c=h.subtract(e,s,HPe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Uo(u,f,d)};Uo.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};Uo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Uo(e.longitude,e.latitude,e.height)};Uo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Uo.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};Uo.ZERO=Object.freeze(new Uo(0,0,0));Uo.prototype.clone=function(e){return Uo.clone(this,e)};Uo.prototype.equals=function(e){return Uo.equals(this,e)};Uo.prototype.equalsEpsilon=function(e,t){return Uo.equalsEpsilon(this,e,t)};Uo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=Uo;function uee(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(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=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function xi(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,uee(this,e,t,n)}Object.defineProperties(xi.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}}});xi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new xi(n.x,n.y,n.z)};xi.fromCartesian3=function(e,t){return l(t)||(t=new xi),l(e)&&uee(t,e.x,e.y,e.z),t};xi.WGS84=Object.freeze(new xi(6378137,6378137,6356752314245179e-9));xi.UNIT_SPHERE=Object.freeze(new xi(1,1,1));xi.MOON=Object.freeze(new xi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));xi._default=xi.WGS84;Object.defineProperties(xi,{default:{get:function(){return xi._default},set:function(e){xi._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});xi.prototype.clone=function(e){return xi.clone(this,e)};xi.packedLength=h.packedLength;xi.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),t};xi.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t);return xi.fromCartesian3(i,n)};xi.prototype.geocentricSurfaceNormal=h.normalize;xi.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 h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};xi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,P.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var GPe=new h,jPe=new h;xi.prototype.cartographicToCartesian=function(e,t){let n=GPe,i=jPe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};xi.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 WPe=new h,qPe=new h,YPe=new h;xi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,qPe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,WPe),o=h.subtract(e,n,YPe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};xi.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};xi.prototype.scaleToGeodeticSurface=function(e,t){return sC(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};xi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);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 h.multiplyByScalar(e,s,t)};xi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};xi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};xi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};xi.prototype.toString=function(){return this._radii.toString()};xi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var XPe=new h;xi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new V);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,XPe),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return V.fromElements(1/i,1/r,t)};var KPe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],$Pe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function lee(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*KPe[s];r+=$Pe[s]*(n(i+a)+n(i-a))}return r*=o,r}xi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return lee(i,o,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*lee(t,n,function(_){let m=Math.cos(_),y=Math.sin(_);return Math.sqrt(u*p*p+c*(a*m*m+s*y*y)*d*d)})})};var te=xi;function WR(e){this._ellipsoid=e??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(WR.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});WR.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 h(i,o,r)};WR.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 fe(i,o,r)};var Fi=WR;var ZPe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Gt=Object.freeze(ZPe);function QPe(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 zo=QPe;function JPe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var gx=JPe;function eDe(e){return e%4===0&&e%100!==0||e%400===0}var Wh=eDe;var fee=[31,28,31,30,31,30,31,31,30,31,30,31];function tDe(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(){co.typeOf.number.greaterThanOrEquals("Year",e,1),co.typeOf.number.lessThanOrEquals("Year",e,9999),co.typeOf.number.greaterThanOrEquals("Month",t,1),co.typeOf.number.lessThanOrEquals("Month",t,12),co.typeOf.number.greaterThanOrEquals("Day",n,1),co.typeOf.number.lessThanOrEquals("Day",n,31),co.typeOf.number.greaterThanOrEquals("Hour",i,0),co.typeOf.number.lessThanOrEquals("Hour",i,23),co.typeOf.number.greaterThanOrEquals("Minute",o,0),co.typeOf.number.lessThanOrEquals("Minute",o,59),co.typeOf.bool("IsLeapSecond",a),co.typeOf.number.greaterThanOrEquals("Second",r,0),co.typeOf.number.lessThanOrEquals("Second",r,a?60:59),co.typeOf.number.greaterThanOrEquals("Millisecond",s,0),co.typeOf.number.lessThan("Millisecond",s,1e3)}function x(){let b=t===2&&Wh(e)?fee[t-1]+1:fee[t-1];if(n>b)throw new he("Month and Day represents invalid date")}}var _g=tDe;function nDe(e,t){this.julianDate=e,this.offset=t}var Qi=nDe;var iDe={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},Yn=Object.freeze(iDe);var oDe={UTC:0,TAI:1},Wn=Object.freeze(oDe);var hee=new _g,t9=[31,28,31,30,31,30,31,31,30,31,30,31],n9=29;function i9(e,t){return Ot.compare(e.julianDate,t.julianDate)}var aC=new Qi;function YR(e){aC.julianDate=e;let t=Ot.leapSeconds,n=zo(t,aC,i9);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Ot.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Ot.addSeconds(e,i,e)}function dee(e,t){aC.julianDate=e;let n=Ot.leapSeconds,i=zo(n,aC,i9);if(i<0&&(i=~i),i===0)return Ot.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Ot.addSeconds(e,-n[i-1].offset,t);let o=Ot.secondsDifference(n[i].julianDate,e);if(o===0)return Ot.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Ot.addSeconds(e,-n[--i].offset,t)}function gg(e,t,n){let i=t/Yn.SECONDS_PER_DAY|0;return e+=i,t-=Yn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Yn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function o9(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*Yn.SECONDS_PER_HOUR+o*Yn.SECONDS_PER_MINUTE+s*Yn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var rDe=/^(\d{4})$/,sDe=/^(\d{4})-(\d{2})$/,aDe=/^(\d{4})-?(\d{3})$/,cDe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,lDe=/^(\d{4})-?(\d{2})-?(\d{2})$/,r9=/([Z+\-])?(\d{2})?:?(\d{2})?$/,uDe=/^(\d{2})(\.\d+)?/.source+r9.source,fDe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+r9.source,dDe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+r9.source;function Ot(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*Yn.SECONDS_PER_DAY,gg(i,t,this),n===Wn.UTC&&YR(this)}Ot.fromGregorianDate=function(e,t){let n=o9(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(gg(n[0],n[1],t),YR(t),t):new Ot(n[0],n[1],Wn.UTC)};Ot.fromDate=function(e,t){let n=o9(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(gg(n[0],n[1],t),YR(t),t):new Ot(n[0],n[1],Wn.UTC)};Ot.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,_;if(n=f.match(lDe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(sDe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(rDe),n!==null)i=+n[1];else{let b;if(n=f.match(aDe),n!==null)i=+n[1],b=+n[2],_=Wh(i);else if(n=f.match(cDe),n!==null){i=+n[1];let T=+n[2],C=+n[3]||0,A=new Date(Date.UTC(i,0,4));b=T*7+C-A.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(b),o=p.getUTCMonth()+1,r=p.getUTCDate()}_=Wh(i);let m;if(l(d)){n=d.match(dDe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=d.match(fDe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=d.match(uDe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let b=n[m],T=+n[m+1],C=+(n[m+2]||0);switch(b){case"+":s=s-T,a=a-C;break;case"-":s=s+T,a=a+C;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=_&&o===2?n9:t9[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=_&&o===2?n9:t9[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=_&&o===2?n9:t9[o-1],r+=p;let x=o9(i,o,r,s,a,c,u);return l(t)?(gg(x[0],x[1],t),YR(t)):t=new Ot(x[0],x[1],Wn.UTC),y&&Ot.addSeconds(t,1,t),t};Ot.now=function(e){return Ot.fromDate(new Date,e)};var qR=new Ot(0,0,Wn.TAI);Ot.toGregorianDate=function(e,t){let n=!1,i=dee(e,qR);l(i)||(Ot.addSeconds(e,-1,qR),i=dee(qR,qR),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,_=r/Yn.SECONDS_PER_HOUR|0,m=r-_*Yn.SECONDS_PER_HOUR,y=m/Yn.SECONDS_PER_MINUTE|0;m=m-y*Yn.SECONDS_PER_MINUTE;let x=m|0,b=(m-x)/Yn.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(x+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=_,t.minute=y,t.second=x,t.millisecond=b,t.isLeapSecond=n,t):new _g(p,d,f,_,y,x,b,n)};Ot.toDate=function(e){let t=Ot.toGregorianDate(e,hee),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Ot.toIso8601=function(e,t){let n=Ot.toGregorianDate(e,hee),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!l(t)&&u!==0){let d=u*.01;return f=d<1e-6?d.toFixed(20).replace(".","").replace(/0+$/,""):d.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Ot(e.dayNumber,e.secondsOfDay,Wn.TAI)};Ot.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Ot.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(Ot.secondsDifference(e,t))<=n};Ot.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Yn.SECONDS_PER_DAY};Ot.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Yn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Ot.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Yn.SECONDS_PER_DAY;return n+i};Ot.computeTaiMinusUtc=function(e){aC.julianDate=e;let t=Ot.leapSeconds,n=zo(t,aC,i9);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Ot.addSeconds=function(e,t,n){return gg(e.dayNumber,e.secondsOfDay+t,n)};Ot.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_MINUTE;return gg(e.dayNumber,i,n)};Ot.addHours=function(e,t,n){let i=e.secondsOfDay+t*Yn.SECONDS_PER_HOUR;return gg(e.dayNumber,i,n)};Ot.addDays=function(e,t,n){let i=e.dayNumber+t;return gg(i,e.secondsOfDay,n)};Ot.lessThan=function(e,t){return Ot.compare(e,t)<0};Ot.lessThanOrEquals=function(e,t){return Ot.compare(e,t)<=0};Ot.greaterThan=function(e,t){return Ot.compare(e,t)>0};Ot.greaterThanOrEquals=function(e,t){return Ot.compare(e,t)>=0};Ot.prototype.clone=function(e){return Ot.clone(this,e)};Ot.prototype.equals=function(e){return Ot.equals(this,e)};Ot.prototype.equalsEpsilon=function(e,t){return Ot.equalsEpsilon(this,e,t)};Ot.prototype.toString=function(){return Ot.toIso8601(this)};Ot.leapSeconds=[new Qi(new Ot(2441317,43210,Wn.TAI),10),new Qi(new Ot(2441499,43211,Wn.TAI),11),new Qi(new Ot(2441683,43212,Wn.TAI),12),new Qi(new Ot(2442048,43213,Wn.TAI),13),new Qi(new Ot(2442413,43214,Wn.TAI),14),new Qi(new Ot(2442778,43215,Wn.TAI),15),new Qi(new Ot(2443144,43216,Wn.TAI),16),new Qi(new Ot(2443509,43217,Wn.TAI),17),new Qi(new Ot(2443874,43218,Wn.TAI),18),new Qi(new Ot(2444239,43219,Wn.TAI),19),new Qi(new Ot(2444786,43220,Wn.TAI),20),new Qi(new Ot(2445151,43221,Wn.TAI),21),new Qi(new Ot(2445516,43222,Wn.TAI),22),new Qi(new Ot(2446247,43223,Wn.TAI),23),new Qi(new Ot(2447161,43224,Wn.TAI),24),new Qi(new Ot(2447892,43225,Wn.TAI),25),new Qi(new Ot(2448257,43226,Wn.TAI),26),new Qi(new Ot(2448804,43227,Wn.TAI),27),new Qi(new Ot(2449169,43228,Wn.TAI),28),new Qi(new Ot(2449534,43229,Wn.TAI),29),new Qi(new Ot(2450083,43230,Wn.TAI),30),new Qi(new Ot(2450630,43231,Wn.TAI),31),new Qi(new Ot(2451179,43232,Wn.TAI),32),new Qi(new Ot(2453736,43233,Wn.TAI),33),new Qi(new Ot(2454832,43234,Wn.TAI),34),new Qi(new Ot(2456109,43235,Wn.TAI),35),new Qi(new Ot(2457204,43236,Wn.TAI),36),new Qi(new Ot(2457754,43237,Wn.TAI),37)];var $=Ot;var Fee=$r(pu(),1);function hDe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var ZR=hDe;function bee(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=bee(o,t)),n[i]=o}return n}var Fe=bee;function Tee(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]=Tee(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 ct=Tee;function mDe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var la=mDe;var Cee=$r(pu(),1);function s9(e,t){let n;return typeof document<"u"&&(n=document),s9._implementation(e,t,n)}s9._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Cee.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var _f=s9;var Aee=$r(pu(),1);function pDe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Aee.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var QR=pDe;var Eee=$r(pu(),1);function _De(e){let t=new Eee.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 uC=_De;var See={};function gDe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=See[t];l(i)||(i={},See[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 qh=gDe;var yDe=/^blob:/i;function xDe(e){return yDe.test(e)}var fC=xDe;var Yh;function bDe(e){l(Yh)||(Yh=document.createElement("a")),Yh.href=window.location.href;let t=Yh.host,n=Yh.protocol;return Yh.href=e,Yh.href=Yh.href,n!==Yh.protocol||t!==Yh.host}var yx=bDe;var TDe=/^data:/i;function CDe(e){return TDe.test(e)}var yg=CDe;function ADe(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 dC=ADe;function EDe(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 hC=EDe;function SDe(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 gf=SDe;var vDe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Xn=Object.freeze(vDe);var wDe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Is=Object.freeze(wDe);function JR(e){e=e??G.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??Is.OTHER,this.serverKey=e.serverKey,this.state=Xn.UNISSUED,this.deferred=void 0,this.cancelled=!1}JR.prototype.cancel=function(){this.cancelled=!0};JR.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=Xn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new JR(this)};var ur=JR;function IDe(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 eO=IDe;function vee(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=eO(this.responseHeaders))}vee.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Op=vee;var nO=$r(pu(),1);function Zv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Zv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});Zv.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};Zv.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 PDe(e,t){return t-e}Zv.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(PDe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var me=Zv;function xx(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(xx.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 a9(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}xx.prototype.reserve=function(e){e=e??this._length,this._array.length=e};xx.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?(a9(i,o,e),e=o):r=!1}};xx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};xx.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)a9(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};xx.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return a9(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var tO=xx;function DDe(e,t){return e.priority-t.priority}var io={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},mC=20,cc=new tO({comparator:DDe});cc.maximumLength=mC;cc.reserve(mC);var Xh=[],Mp={},RDe=typeof document<"u"?new nO.default(document.location.href):new nO.default,iO=new me;function Ko(){}Ko.maximumRequests=50;Ko.maximumRequestsPerServer=18;Ko.requestsByServer={};Ko.throttleRequests=!0;Ko.debugShowStatistics=!1;Ko.requestCompletedEvent=iO;Object.defineProperties(Ko,{statistics:{get:function(){return io}},priorityHeapLength:{get:function(){return mC},set:function(e){if(e<mC)for(;cc.length>e;){let t=cc.pop();bx(t)}mC=e,cc.maximumLength=e,cc.reserve(e)}}});function wee(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ko.serverHasOpenSlots=function(e,t){t=t??1;let n=Ko.requestsByServer[e]??Ko.maximumRequestsPerServer;return Mp[e]+t<=n};Ko.heapHasOpenSlots=function(e){return cc.length+e<=mC};function Iee(e){return e.state===Xn.UNISSUED&&(e.state=Xn.ISSUED,e.deferred=la()),e.deferred.promise}function ODe(e){return function(t){if(e.state===Xn.CANCELLED)return;let n=e.deferred;--io.numberOfActiveRequests,--Mp[e.serverKey],iO.raiseEvent(),e.state=Xn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function MDe(e){return function(t){e.state!==Xn.CANCELLED&&(++io.numberOfFailedRequests,--io.numberOfActiveRequests,--Mp[e.serverKey],iO.raiseEvent(t),e.state=Xn.FAILED,e.deferred.reject(t))}}function Pee(e){let t=Iee(e);return e.state=Xn.ACTIVE,Xh.push(e),++io.numberOfActiveRequests,++io.numberOfActiveRequestsEver,++Mp[e.serverKey],e.requestFunction().then(ODe(e)).catch(MDe(e)),t}function bx(e){let t=e.state===Xn.ACTIVE;if(e.state=Xn.CANCELLED,++io.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--io.numberOfActiveRequests,--Mp[e.serverKey],++io.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ko.update=function(){let e,t,n=0,i=Xh.length;for(e=0;e<i;++e){if(t=Xh[e],t.cancelled&&bx(t),t.state!==Xn.ACTIVE){++n;continue}n>0&&(Xh[e-n]=t)}Xh.length-=n;let o=cc.internalArray,r=cc.length;for(e=0;e<r;++e)wee(o[e]);cc.resort();let s=Math.max(Ko.maximumRequests-Xh.length,0),a=0;for(;a<s&&cc.length>0;){if(t=cc.pop(),t.cancelled){bx(t);continue}if(t.throttleByServer&&!Ko.serverHasOpenSlots(t.serverKey)){bx(t);continue}Pee(t),++a}LDe()};Ko.getServerKey=function(e){let t=new nO.default(e);t.scheme()===""&&(t=t.absoluteTo(RDe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Mp[n];return l(i)||(Mp[n]=0),n};Ko.request=function(e){if(yg(e.url)||fC(e.url))return iO.raiseEvent(),e.state=Xn.RECEIVED,e.requestFunction();if(++io.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 Pee(e);if(Xh.length>=Ko.maximumRequests)return;wee(e);let t=cc.insert(e);if(l(t)){if(t===e)return;bx(t)}return Iee(e)};function LDe(){Ko.debugShowStatistics&&(io.numberOfActiveRequests===0&&io.lastNumberOfActiveRequests>0&&(io.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${io.numberOfAttemptedRequests}`),io.numberOfAttemptedRequests=0),io.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${io.numberOfCancelledRequests}`),io.numberOfCancelledRequests=0),io.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${io.numberOfCancelledActiveRequests}`),io.numberOfCancelledActiveRequests=0),io.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${io.numberOfFailedRequests}`),io.numberOfFailedRequests=0)),io.lastNumberOfActiveRequests=io.numberOfActiveRequests)}Ko.clearForSpecs=function(){for(;cc.length>0;){let t=cc.pop();bx(t)}let e=Xh.length;for(let t=0;t<e;++t)bx(Xh[t]);Xh.length=0,Mp={},io.numberOfAttemptedRequests=0,io.numberOfActiveRequests=0,io.numberOfCancelledRequests=0,io.numberOfCancelledActiveRequests=0,io.numberOfFailedRequests=0,io.numberOfActiveRequestsEver=0,io.lastNumberOfActiveRequests=0};Ko.numberOfActiveRequestsByServer=function(e){return Mp[e]};Ko.requestHeap=cc;var lc=Ko;var Dee=$r(pu(),1);var Qv={},pC={};Qv.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(pC[n])||(pC[n]=!0)};Qv.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(pC[n])&&delete pC[n]};function NDe(e){let t=new Dee.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}}Qv.contains=function(e){let t=NDe(e);return!!(l(t)&&l(pC[t]))};Qv.clear=function(){pC={}};var Jv=Qv;var FDe="mapDatabase",Kh="mapStore",Lp,ew;var tw=3221225472;try{ew=window.indexedDB.open(FDe,1),ew.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains(Kh)||t.createObjectStore(Kh,{keyPath:"url"})},ew.onsuccess=function(e){Lp=e.target.result},ew.onerror=function(e){console.error("IndexedDB open error:",e.target.error)}}catch{}function Ree(e,t){if(!Lp)return;let i=Lp.transaction([Kh],"readwrite").objectStore(Kh),o={url:e,content:t,timestamp:Date.now()};if(t.nodeType){let s=new XMLSerializer().serializeToString(t);o.content=s,o.type="xml"}i.add(o)}function Oee(e){return new Promise(async(t,n)=>{if(!Lp)n();else{let r=Lp.transaction([Kh],"readonly").objectStore(Kh).get(e);r.onsuccess=function(s){let a=s.target.result;a?t(a):n()},ew.onerror=s=>{n()}}})}function BDe(){if(!Lp)return;let t=Lp.transaction([Kh],"readonly").objectStore(Kh),n=t.getAll();n.onsuccess=function(i){let o=i.target.result,r=0;o.forEach(s=>{r+=JSON.stringify(s).length}),r>tw&&(o.sort((a,c)=>a.timestamp-c.timestamp),o.slice(0,Math.ceil(r/tw)).forEach(a=>{let c=t.delete(a.url);c.onsuccess=function(){},c.onerror=function(){}}))}}function c9(){return tw}function Mee(e){typeof e!="number"||isNaN(e)||e<1073741824?tw=1073741824:tw=e,BDe()}function Lee(){return new Promise(async(e,t)=>{if(!Lp)t();else{let o=Lp.transaction([Kh],"readonly").objectStore(Kh).getAll();o.onsuccess=function(r){let s=r.target.result,a=0;s.forEach(c=>{a+=JSON.stringify(c).length}),e(a)}}})}var Bee=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function vt(e){e=e??G.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=$h(e.templateValues,{}),this._queryParameters=$h(e.queryParameters,{}),this.headers=$h(e.headers,{}),this.request=e.request??new ur,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 $h(e,t){return l(e)?Fe(e):t}vt.createIfNeeded=function(e){return e instanceof vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new vt({url:e})};var _C;vt.supportsImageBitmapOptions=function(){return l(_C)?_C:typeof createImageBitmap!="function"?(_C=Promise.resolve(!1),_C):(_C=vt.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=qh(t[0]),i=qh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),_C)};Object.defineProperties(vt,{isBlobSupported:{get:function(){return Bee}}});Object.defineProperties(vt.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 uC(this._url)}},isDataUri:{get:function(){return yg(this._url)}},isBlobUri:{get:function(){return fC(this._url)}},isCrossOriginUrl:{get:function(){return yx(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new Fee.default(e),r=kDe(o.query());this._queryParameters=t?rO(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(_f(i))),this._url=o.toString()};function kDe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:gf(e)}function rO(e,t,n){if(!n)return ct(e,t);let i=Fe(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}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${UDe(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 UDe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${hC(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=rO(this._queryParameters,e,!1):this._queryParameters=rO(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=rO(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=ct(this._templateValues,e):this._templateValues=ct(e,this._templateValues)};vt.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=ct(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=ct(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=ct(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};vt.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})};vt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Fe(this._queryParameters),e._templateValues=Fe(this._templateValues),e.headers=Fe(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new vt({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})};vt.prototype.getBaseUri=function(e){return QR(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=ZR(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??G.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(sO(this.request),!Bee||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return l9({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new vt({url:d}),l9({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function l9(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=la();return vt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=lc.request(r);if(l(s))return s.catch(function(a){return r.state!==Xn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Xn.UNISSUED,r.deferred=void 0,l9({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.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)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",sO(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return kee(this,e,t)};function kee(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=la();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=lc.request(o);if(l(s))return s.catch(function(a){return o.state!==Xn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Xn.UNISSUED,o.deferred=void 0,kee(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest2=function(e){let t=this;sO(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=ct(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=la(),d=vt._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=lc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Xn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Xn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};vt.prototype._makeRequest=function(e){let t=this,n=t.request;n.url=t.url;try{return Cesium.ManageIndexedDB.GetManageIndexexDBState()?Oee(n.url).then(o=>{let r=o.content;return o.type==="xml"&&(r=new DOMParser().parseFromString(o.content,"application/xml")),r}).catch(o=>i()):i()}catch{return i()}function i(){sO(t.request),n.requestFunction=function(){let r=e.responseType,s=ct(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=la(),d=vt._Implementations.loadWithXhr(t.url,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=lc.request(n);if(l(o))return o.then(function(r){try{Cesium.ManageIndexedDB.GetManageIndexexDBState()&&Ree(n.url,r)}catch{}return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Xn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Xn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})}};function sO(e){if(e.state===Xn.ISSUED||e.state===Xn.ACTIVE)throw new se("The Resource is already being fetched.");e.state=Xn.UNISSUED,e.deferred=void 0}var zDe=/^data:(.*?)(;base64)?,(.*)$/;function oO(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Nee(e,t){let n=oO(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 VDe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return oO(i,o);case"arraybuffer":return Nee(i,o);case"blob":return r=Nee(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(oO(i,o),n);case"json":return JSON.parse(oO(i,o));default:}}vt.prototype.fetch=function(e){return e=$h(e,{}),e.method="GET",this._makeRequest(e)};vt.fetch=function(e){return new vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.delete=function(e){return e=$h(e,{}),e.method="DELETE",this._makeRequest(e)};vt.delete=function(e){return new vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};vt.prototype.head=function(e){return e=$h(e,{}),e.method="HEAD",this._makeRequest(e)};vt.head=function(e){return new vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.options=function(e){return e=$h(e,{}),e.method="OPTIONS",this._makeRequest(e)};vt.options=function(e){return new vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.post=function(e,t){return co.defined("data",e),t=$h(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};vt.post=function(e){return new vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.put=function(e,t){return co.defined("data",e),t=$h(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};vt.put=function(e){return new vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.patch=function(e,t){return co.defined("data",e),t=$h(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};vt.patch=function(e){return new vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt._Implementations={};vt._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&&(Jv.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){vt._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=la(),d=vt._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new se(`Successfully retrieved ${s} but it contained no content.`));return}return vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};vt.createImageBitmapFromBlob=function(e,t){return co.defined("options",t),co.typeOf.bool("options.flipY",t.flipY),co.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),co.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function HDe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new Op(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 Op)})}var GDe=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=zDe.exec(e);if(a!==null){r.resolve(VDe(a,t));return}if(GDe){HDe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(Jv.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new Op(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let _=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};_.forEach(function(y){let x=y.split(": "),b=x.shift();m[b]=x.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new se("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new Op)},c.send(i),c};vt._Implementations.loadAndExecuteScript=function(e,t,n){return dC(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ee=vt;function iw(e){e=e??G.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)?Uee(this,e.data):Uee(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}iw.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new iw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};iw.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 gx(0,0,0,0,0),t}});iw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new gx(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=$.lessThanOrEquals(a,e),f=!l(c),d=f||$.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,Vee(this,n,this._samples,e,o,r,t),t}let s=zo(n,e,$.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,Vee(this,n,this._samples,e,o,r,t),t};function jDe(e,t){return $.compare(e.julianDate,t)}function Uee(e,t){if(!l(t.columnNames))throw new se("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new se("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 se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let _=0,m=u.length;_<m;_+=e._columnCount){let y=u[_+n],x=u[_+c],b=y+Yn.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new $(b,x,Wn.TAI);if(f.push(T),p){if(x!==d&&l(d)){let C=$.leapSeconds,A=zo(C,T,jDe);if(A<0){let S=new Qi(T,x);C.splice(~A,0,S)}}d=x}}}function zee(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 nw(e,t,n){return t+e*(n-t)}function Vee(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return zee(e,n,o,a,s),s;if(i.equals(u))return zee(e,n,r,a,s),s;let f=$.secondsDifference(i,c)/$.secondsDifference(u,c),d=o*a,p=r*a,_=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-_;if(y>.5||y<-.5){let x=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];x!==b&&(u.equals(i)?_=m:m-=b-x)}return s.xPoleWander=nw(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=nw(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=nw(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=nw(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=nw(f,_,m),s}var aO=iw;function uc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}uc.fromQuaternion=function(e,t){l(t)||(t=new uc);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=-P.asinClamped(n),t};uc.fromDegrees=function(e,t,n,i){return l(i)||(i=new uc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};uc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new uc(e.heading,e.pitch,e.roll)};uc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};uc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};uc.prototype.clone=function(e){return uc.clone(this,e)};uc.prototype.equals=function(e){return uc.equals(this,e)};uc.prototype.equalsEpsilon=function(e,t,n){return uc.equalsEpsilon(this,e,t,n)};uc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var fc=uc;var Hee=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function WDe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=Hee.exec(i);if(o!==null)return o[1]}}var cO;function Gee(e){return typeof document>"u"?e:(l(cO)||(cO=document.createElement("a")),cO.href=e,cO.href)}var Tx;function jee(){if(l(Tx))return Tx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=_f(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(wR.toUrl)?e=_f("..",Cx("Core/buildModuleUrl.js")):e=WDe(),Tx=new Ee({url:Gee(e)}),Tx.appendForwardSlash(),Tx}function qDe(e){return Gee(wR.toUrl(`../${e}`))}function Wee(e){return jee().getDerivedResource({url:e}).url}var lO;function Cx(e){return l(lO)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(wR.toUrl)?lO=qDe:lO=Wee),lO(e)}Cx._cesiumScriptRegex=Hee;Cx._buildModuleUrlFromBaseUrl=Wee;Cx._clearBaseResource=function(){Tx=void 0};Cx.setBaseUrl=function(e){Tx=Ee.DEFAULT.getDerivedResource({url:e})};Cx.getCesiumBaseUrl=jee;var on=Cx;function YDe(e,t,n){this.x=e,this.y=t,this.s=n}var gC=YDe;function d9(e){e=e??G.EMPTY_OBJECT,this._xysFileUrlTemplate=Ee.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new $(this._sampleZeroJulianEphemerisDate,0,Wn.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 XDe=new $(0,0,Wn.TAI);function u9(e,t,n){let i=XDe;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}d9.prototype.preload=function(e,t,n,i){let o=u9(this,e,t),r=u9(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(f9(this,d));return Promise.all(f)};d9.prototype.computeXysRadians=function(e,t,n){let i=u9(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(f9(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(f9(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new gC(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,_=this._coef,m=this._xTable,y,x;for(y=0;y<=r;++y)d[y]=f-m[y];for(y=0;y<=r;++y){for(_[y]=1,x=0;x<=r;++x)x!==y&&(_[y]*=d[x]);_[y]*=p[y];let b=(s+y)*3;n.x+=_[y]*u[b++],n.y+=_[y]*u[b++],n.s+=_[y]*u[b]}return n};function f9(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 Ee({url:on(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var uO=d9;function it(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var ow=new h;it.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);ow=h.normalize(e,ow);let r=ow.x*o,s=ow.y*o,a=ow.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new it(r,s,a,c)};var KDe=[1,2,0],$De=new Array(3);it.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[Z.COLUMN0ROW0],c=e[Z.COLUMN1ROW1],u=e[Z.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[Z.COLUMN1ROW2]-e[Z.COLUMN2ROW1])*n,o=(e[Z.COLUMN2ROW0]-e[Z.COLUMN0ROW2])*n,r=(e[Z.COLUMN0ROW1]-e[Z.COLUMN1ROW0])*n;else{let d=KDe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let _=d[p],m=d[_];n=Math.sqrt(e[Z.getElementIndex(p,p)]-e[Z.getElementIndex(_,_)]-e[Z.getElementIndex(m,m)]+1);let y=$De;y[p]=.5*n,n=.5/n,s=(e[Z.getElementIndex(m,_)]-e[Z.getElementIndex(_,m)])*n,y[_]=(e[Z.getElementIndex(_,p)]+e[Z.getElementIndex(p,_)])*n,y[m]=(e[Z.getElementIndex(m,p)]+e[Z.getElementIndex(p,m)])*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 it(i,o,r,s)};var qee=new it,Yee=new it,h9=new it,Xee=new it;it.fromHeadingPitchRoll=function(e,t){return Xee=it.fromAxisAngle(h.UNIT_X,e.roll,qee),h9=it.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=it.multiply(h9,Xee,h9),Yee=it.fromAxisAngle(h.UNIT_Z,-e.heading,qee),it.multiply(Yee,t,t)};var fO=new h,m9=new h,Dd=new it,Kee=new it,dO=new it;it.packedLength=4;it.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};it.unpack=function(e,t,n){return t=t??0,l(n)||(n=new it),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};it.packedInterpolationLength=3;it.convertPackedArrayForInterpolation=function(e,t,n,i){it.unpack(e,n*4,dO),it.conjugate(dO,dO);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;it.unpack(e,(t+o)*4,Dd),it.multiply(Dd,dO,Dd),Dd.w<0&&it.negate(Dd,Dd),it.computeAxis(Dd,fO);let a=it.computeAngle(Dd);l(i)||(i=[]),i[s]=fO.x*a,i[s+1]=fO.y*a,i[s+2]=fO.z*a}};it.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new it),h.fromArray(e,0,m9);let r=h.magnitude(m9);return it.unpack(t,i*4,Kee),r===0?it.clone(it.IDENTITY,Dd):it.fromAxisAngle(m9,r,Dd),it.multiply(Dd,Kee,o)};it.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 it(e.x,e.y,e.z,e.w)};it.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};it.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};it.magnitude=function(e){return Math.sqrt(it.magnitudeSquared(e))};it.normalize=function(e,t){let n=1/it.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};it.inverse=function(e,t){let n=it.magnitudeSquared(e);return t=it.conjugate(e,t),it.multiplyByScalar(t,1/n,t)};it.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};it.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};it.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};it.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};it.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,_=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=d,n.y=p,n.z=_,n.w=m,n};it.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};it.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};it.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.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};it.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var p9=new it;it.lerp=function(e,t,n,i){return p9=it.multiplyByScalar(t,n,p9),i=it.multiplyByScalar(e,1-n,i),it.add(p9,i,i)};var $ee=new it,_9=new it,g9=new it;it.slerp=function(e,t,n,i){let o=it.dot(e,t),r=t;if(o<0&&(o=-o,r=$ee=it.negate(t,$ee)),1-o<P.EPSILON6)return it.lerp(e,r,n,i);let s=Math.acos(o);return _9=it.multiplyByScalar(e,Math.sin((1-n)*s),_9),g9=it.multiplyByScalar(r,Math.sin(n*s),g9),i=it.add(_9,g9,i),it.multiplyByScalar(i,1/Math.sin(s),i)};it.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};it.exp=function(e,t){let n=h.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 ZDe=new h,QDe=new h,rw=new it,yC=new it;it.computeInnerQuadrangle=function(e,t,n,i){let o=it.conjugate(t,rw);it.multiply(o,n,yC);let r=it.log(yC,ZDe);it.multiply(o,e,yC);let s=it.log(yC,QDe);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),it.exp(r,rw),it.multiply(t,rw,i)};it.squad=function(e,t,n,i,o,r){let s=it.slerp(e,t,o,rw),a=it.slerp(n,i,o,yC);return it.slerp(s,a,2*o*(1-o),r)};var JDe=new it,Zee=1.9011074535173003,hO=Ft.supportsTypedArrays()?new Float32Array(8):[],mO=Ft.supportsTypedArrays()?new Float32Array(8):[],Np=Ft.supportsTypedArrays()?new Float32Array(8):[],Fp=Ft.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;hO[e]=1/(t*n),mO[e]=t/n}hO[7]=Zee/(8*17);mO[7]=Zee*8/17;it.fastSlerp=function(e,t,n,i){let o=it.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let _=7;_>=0;--_)Np[_]=(hO[_]*c-mO[_])*s,Fp[_]=(hO[_]*u-mO[_])*s;let f=r*n*(1+Np[0]*(1+Np[1]*(1+Np[2]*(1+Np[3]*(1+Np[4]*(1+Np[5]*(1+Np[6]*(1+Np[7])))))))),d=a*(1+Fp[0]*(1+Fp[1]*(1+Fp[2]*(1+Fp[3]*(1+Fp[4]*(1+Fp[5]*(1+Fp[6]*(1+Fp[7])))))))),p=it.multiplyByScalar(e,d,JDe);return it.multiplyByScalar(t,f,i),it.add(p,i,i)};it.fastSquad=function(e,t,n,i,o,r){let s=it.fastSlerp(e,t,o,rw),a=it.fastSlerp(n,i,o,yC);return it.fastSlerp(s,a,2*o*(1-o),r)};it.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};it.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};it.ZERO=Object.freeze(new it(0,0,0,0));it.IDENTITY=Object.freeze(new it(0,0,0,1));it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Pe=it;var fi={},y9={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"}},xC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},x9={},Pl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},xg=new h,bg=new h,Tg=new h;fi.localFrameToFixedFrameGenerator=function(e,t){if(!y9.hasOwnProperty(e)||!y9[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=y9[e][t],i,o=e+t;return l(x9[o])?i=x9[o]:(i=function(r,s,a){if(l(a)||(a=new O),h.equalsEpsilon(r,h.ZERO,P.EPSILON14))h.unpack(xC[e],0,xg),h.unpack(xC[t],0,bg),h.unpack(xC[n],0,Tg);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);h.unpack(xC[e],0,xg),e!=="east"&&e!=="west"&&h.multiplyByScalar(xg,c,xg),h.unpack(xC[t],0,bg),t!=="east"&&t!=="west"&&h.multiplyByScalar(bg,c,bg),h.unpack(xC[n],0,Tg),n!=="east"&&n!=="west"&&h.multiplyByScalar(Tg,c,Tg)}else{s=s??te.default,s.geodeticSurfaceNormal(r,Pl.up);let c=Pl.up,u=Pl.east;u.x=-r.y,u.y=r.x,u.z=0,h.normalize(u,Pl.east),h.cross(c,u,Pl.north),h.multiplyByScalar(Pl.up,-1,Pl.down),h.multiplyByScalar(Pl.east,-1,Pl.west),h.multiplyByScalar(Pl.north,-1,Pl.south),xg=Pl[e],bg=Pl[t],Tg=Pl[n]}return a[0]=xg.x,a[1]=xg.y,a[2]=xg.z,a[3]=0,a[4]=bg.x,a[5]=bg.y,a[6]=bg.z,a[7]=0,a[8]=Tg.x,a[9]=Tg.y,a[10]=Tg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},x9[o]=i),i};fi.eastNorthUpToFixedFrame=fi.localFrameToFixedFrameGenerator("east","north");fi.northEastDownToFixedFrame=fi.localFrameToFixedFrameGenerator("north","east");fi.northUpEastToFixedFrame=fi.localFrameToFixedFrameGenerator("north","up");fi.northWestUpToFixedFrame=fi.localFrameToFixedFrameGenerator("north","west");var e1e=new Pe,t1e=new h(1,1,1),n1e=new O;fi.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??fi.eastNorthUpToFixedFrame;let r=Pe.fromHeadingPitchRoll(t,e1e),s=O.fromTranslationQuaternionRotationScale(h.ZERO,r,t1e,n1e);return o=i(e,n,o),O.multiply(o,s,o)};var i1e=new O,o1e=new Z;fi.headingPitchRollQuaternion=function(e,t,n,i,o){let r=fi.headingPitchRollToFixedFrame(e,t,n,i,i1e),s=O.getMatrix3(r,o1e);return Pe.fromRotationMatrix(s,o)};var r1e=new h(1,1,1),s1e=new h,Qee=new O,a1e=new O,c1e=new Z,l1e=new Pe;fi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??fi.eastNorthUpToFixedFrame,l(i)||(i=new fc);let o=O.getTranslation(e,s1e);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=O.inverseTransformation(n(o,t,Qee),Qee),s=O.setScale(e,r1e,a1e);s=O.setTranslation(s,h.ZERO,s),r=O.multiply(r,s,r);let a=Pe.fromRotationMatrix(O.getMatrix3(r,c1e),l1e);return a=Pe.normalize(a,a),fc.fromQuaternion(a,i)};var u1e=6*3600+41*60+50.54841,f1e=8640184812866e-6,d1e=.093104,h1e=-62e-7,m1e=11772758384668e-32,p1e=72921158553e-15,_1e=P.TWO_PI/86400,pO=new $;fi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=fi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=fi.computeTemeToPseudoFixedMatrix(e,t)),n};fi.computeTemeToPseudoFixedMatrix=function(e,t){pO=$.addSeconds(e,-$.computeTaiMinusUtc(e),pO);let n=pO.dayNumber,i=pO.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Yn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Yn.DAYS_PER_JULIAN_CENTURY;let a=(u1e+o*(f1e+o*(d1e+o*h1e)))*_1e%P.TWO_PI,c=p1e+m1e*(n-24515455e-1),u=(i+Yn.SECONDS_PER_DAY*.5)%Yn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Z(d,p,0,-p,d,0,0,0,1)};fi.iau2006XysData=new uO;fi.earthOrientationParameters=aO.NONE;var C9=32.184,g1e=2451545;fi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+C9,i=e.stop.dayNumber,o=e.stop.secondsOfDay+C9;return fi.iau2006XysData.preload(t,n,i,o)};fi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new Z);let n=fi.computeFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var y1e=32.184,x1e=2451545,_O=new fc,b1e=new Z,T1e=new $;fi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=$.addSeconds(e,y1e,T1e),i=$.totalDays(n)-x1e,o=P.toRadians(12.112)-P.toRadians(.052992)*i,r=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return _O.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(o)-P.toRadians(.12)*Math.sin(r)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),_O.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(o)+P.toRadians(.24)*Math.cos(r)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),_O.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(o)+P.toRadians(.121)*Math.sin(r)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),Z.fromHeadingPitchRoll(_O,b1e)};fi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new Z);let n=fi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return Z.transpose(n,t)};var C1e=new gC(0,0,0),A1e=new gx(0,0,0,0,0,0),b9=new Z,T9=new Z;fi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new Z);let n=fi.earthOrientationParameters.compute(e,A1e);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+C9,r=fi.iau2006XysData.computeXysRadians(i,o,C1e);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=b9;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=Z.fromRotationZ(-r.s,T9),d=Z.multiply(u,f,b9),p=e.dayNumber,_=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=_/Yn.SECONDS_PER_DAY,x=.779057273264+y+.00273781191135448*(m+y);x=x%1*P.TWO_PI;let b=Z.fromRotationZ(x,T9),T=Z.multiply(d,b,b9),C=Math.cos(n.xPoleWander),A=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),R=i-g1e+o/Yn.SECONDS_PER_DAY;R/=36525;let D=-47e-6*R*P.RADIANS_PER_DEGREE/3600,M=Math.cos(D),L=Math.sin(D),g=T9;return g[0]=C*M,g[1]=C*L,g[2]=S,g[3]=-A*L+w*S*M,g[4]=A*M+w*S*L,g[5]=-w*C,g[6]=-w*L-A*S*M,g[7]=w*M-A*S*L,g[8]=A*C,Z.multiply(T,g,t)};var E1e=new ie;fi.pointToWindowCoordinates=function(e,t,n,i){return i=fi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};fi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new V);let o=E1e;return O.multiplyByVector(e,ie.fromElements(n.x,n.y,n.z,1,o),o),ie.multiplyByScalar(o,1/o.w,o),O.multiplyByVector(t,o,o),V.fromCartesian4(o,i)};var S1e=new h,v1e=new h,w1e=new h;fi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,S1e),r=h.cross(t,o,v1e);h.equalsEpsilon(r,h.ZERO,P.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,w1e);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new Z),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 Jee=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),ete=new fe,A9=new h,I1e=new h,P1e=new Z,E9=new O,tte=new O;fi.basisTo2D=function(e,t,n){let i=O.getTranslation(t,I1e),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,A9);else{let f=o.cartesianToCartographic(i,ete);r=e.project(f,A9),h.fromElements(r.z,r.x,r.y,r)}let s=fi.eastNorthUpToFixedFrame(i,o,E9),a=O.inverseTransformation(s,tte),c=O.getMatrix3(t,P1e),u=O.multiplyByMatrix3(a,c,n);return O.multiply(Jee,u,n),O.setTranslation(n,r,n),n};fi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=fi.eastNorthUpToFixedFrame(t,i,E9),r=O.inverseTransformation(o,tte),s=i.cartesianToCartographic(t,ete),a=e.project(s,A9);h.fromElements(a.z,a.x,a.y,a);let c=O.fromTranslation(a,E9);return O.multiply(Jee,r,n),O.multiply(c,n,n),n};var Et=fi;function wn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(wn.prototype,{width:{get:function(){return wn.computeWidth(this)}},height:{get:function(){return wn.computeHeight(this)}}});wn.packedLength=4;wn.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};wn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};wn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};wn.computeHeight=function(e){return e.north-e.south};wn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e??0),t=P.toRadians(t??0),n=P.toRadians(n??0),i=P.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new wn(e,t,n,i)};wn.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 wn(e,t,n,i)};wn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new wn(n,s,i,a)};wn.fromCartesianArray=function(e,t,n){t=t??te.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new wn(i,a,o,c)};var D1e=new h,R1e=new h,O1e=new h,M1e=new h,L1e=new h,S9=new Array(5);for(let e=0;e<S9.length;++e)S9[e]=new h;wn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=te.default),l(n)||(n=new wn),h.equals(i,h.ZERO))return wn.clone(wn.MAX_VALUE,n),n;let r=Et.eastNorthUpToFixedFrame(i,t,D1e),s=O.multiplyByPointAsVector(r,h.UNIT_X,R1e);h.normalize(s,s);let a=O.multiplyByPointAsVector(r,h.UNIT_Y,O1e);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,L1e),u=h.negate(s,M1e),f=S9,d=f[0];return h.add(i,a,d),d=f[1],h.add(i,u,d),d=f[2],h.add(i,c,d),d=f[3],h.add(i,s,d),f[4]=i,wn.fromCartesianArray(f,t,n)};wn.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 wn(e.west,e.south,e.east,e.north)};wn.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};wn.prototype.clone=function(e){return wn.clone(this,e)};wn.prototype.equals=function(e){return wn.equals(this,e)};wn.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};wn.prototype.equalsEpsilon=function(e,t){return wn.equalsEpsilon(this,e,t)};wn._validate=function(e){};wn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};wn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};wn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};wn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};wn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};wn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new wn(a,u,c,f)};wn.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 wn(i,o,r,s)};wn.union=function(e,t,n){l(n)||(n=new wn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.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};wn.expand=function(e,t,n){return l(n)||(n=new wn),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};wn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var N1e=new fe;wn.subsample=function(e,t,n,i){t=t??te.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=N1e;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,wn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};wn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new wn),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=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.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};wn.MAX_VALUE=Object.freeze(new wn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ae=wn;function Fr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}Fr.packedLength=4;Fr.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};Fr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Fr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Fr.fromPoints=function(e,t){if(l(t)||(t=new Fr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var nte=new Fi,F1e=new fe,B1e=new fe;Fr.fromRectangle=function(e,t,n){if(l(n)||(n=new Fr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;nte._ellipsoid=te.default,t=t??nte;let i=t.project(ae.southwest(e,F1e)),o=t.project(ae.northeast(e,B1e));return V.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Fr.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 Fr(e.x,e.y,e.width,e.height)};Fr.union=function(e,t,n){l(n)||(n=new Fr);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};Fr.expand=function(e,t,n){n=Fr.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};Fr.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?Gt.OUTSIDE:Gt.INTERSECTING};Fr.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};Fr.prototype.clone=function(e){return Fr.clone(this,e)};Fr.prototype.intersect=function(e){return Fr.intersect(this,e)};Fr.prototype.equals=function(e){return Fr.equals(this,e)};var Xe=Fr;var Ba={POINTS:q.POINTS,LINES:q.LINES,LINE_LOOP:q.LINE_LOOP,LINE_STRIP:q.LINE_STRIP,TRIANGLES:q.TRIANGLES,TRIANGLE_STRIP:q.TRIANGLE_STRIP,TRIANGLE_FAN:q.TRIANGLE_FAN};Ba.isLines=function(e){return e===Ba.LINES||e===Ba.LINE_LOOP||e===Ba.LINE_STRIP};Ba.isTriangles=function(e){return e===Ba.TRIANGLES||e===Ba.TRIANGLE_STRIP||e===Ba.TRIANGLE_FAN};Ba.validate=function(e){return e===Ba.POINTS||e===Ba.LINES||e===Ba.LINE_LOOP||e===Ba.LINE_STRIP||e===Ba.TRIANGLES||e===Ba.TRIANGLE_STRIP||e===Ba.TRIANGLE_FAN};var Le=Object.freeze(Ba);var bC=`in vec4 position; -in vec2 textureCoordinates; - -out vec2 v_textureCoordinates; - -void main() -{ - gl_Position = position; - v_textureCoordinates = textureCoordinates; -} -`;var br={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 sw(e){e=e??G.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Le.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 dc(e,t){return(e._flags&t)===t}function Cg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(sw.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 dc(this,br.CULL)},set:function(e){dc(this,br.CULL)!==e&&(Cg(this,br.CULL,e),this.dirty=!0)}},occlude:{get:function(){return dc(this,br.OCCLUDE)},set:function(e){dc(this,br.OCCLUDE)!==e&&(Cg(this,br.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 dc(this,br.CAST_SHADOWS)},set:function(e){dc(this,br.CAST_SHADOWS)!==e&&(Cg(this,br.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return dc(this,br.RECEIVE_SHADOWS)},set:function(e){dc(this,br.RECEIVE_SHADOWS)!==e&&(Cg(this,br.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 dc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){dc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Cg(this,br.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 dc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){dc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Cg(this,br.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 dc(this,br.PICK_ONLY)},set:function(e){dc(this,br.PICK_ONLY)!==e&&(Cg(this,br.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return dc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){dc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Cg(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});sw.shallowClone=function(e,t){if(l(e))return l(t)||(t=new sw),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};sw.prototype.execute=function(e,t){e.draw(this,t)};var qe=sw;var di={UNSIGNED_BYTE:q.UNSIGNED_BYTE,UNSIGNED_SHORT:q.UNSIGNED_SHORT,UNSIGNED_INT:q.UNSIGNED_INT,FLOAT:q.FLOAT,HALF_FLOAT:q.HALF_FLOAT_OES,UNSIGNED_INT_24_8:q.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:q.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:q.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:q.UNSIGNED_SHORT_5_6_5};di.toWebGLConstant=function(e,t){switch(e){case di.UNSIGNED_BYTE:return q.UNSIGNED_BYTE;case di.UNSIGNED_SHORT:return q.UNSIGNED_SHORT;case di.UNSIGNED_INT:return q.UNSIGNED_INT;case di.FLOAT:return q.FLOAT;case di.HALF_FLOAT:return t.webgl2?q.HALF_FLOAT:q.HALF_FLOAT_OES;case di.UNSIGNED_INT_24_8:return q.UNSIGNED_INT_24_8;case di.UNSIGNED_SHORT_4_4_4_4:return q.UNSIGNED_SHORT_4_4_4_4;case di.UNSIGNED_SHORT_5_5_5_1:return q.UNSIGNED_SHORT_5_5_5_1;case di.UNSIGNED_SHORT_5_6_5:return di.UNSIGNED_SHORT_5_6_5}};di.isPacked=function(e){return e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.sizeInBytes=function(e){switch(e){case di.UNSIGNED_BYTE:return 1;case di.UNSIGNED_SHORT:case di.UNSIGNED_SHORT_4_4_4_4:case di.UNSIGNED_SHORT_5_5_5_1:case di.UNSIGNED_SHORT_5_6_5:case di.HALF_FLOAT:return 2;case di.UNSIGNED_INT:case di.FLOAT:case di.UNSIGNED_INT_24_8:return 4}};di.validate=function(e){return e===di.UNSIGNED_BYTE||e===di.UNSIGNED_SHORT||e===di.UNSIGNED_INT||e===di.FLOAT||e===di.HALF_FLOAT||e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.getTypedArrayConstructor=function(e){let t=di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===di.FLOAT?Float32Array:Uint32Array};var He=Object.freeze(di);var nt={DEPTH_COMPONENT:q.DEPTH_COMPONENT,DEPTH_STENCIL:q.DEPTH_STENCIL,ALPHA:q.ALPHA,RED:q.RED,RG:q.RG,RGB:q.RGB,RGBA:q.RGBA,LUMINANCE:q.LUMINANCE,LUMINANCE_ALPHA:q.LUMINANCE_ALPHA,RGB_DXT1:q.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:q.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:q.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:q.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:q.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:q.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:q.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:q.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:q.COMPRESSED_RGBA_BPTC_UNORM};nt.componentsLength=function(e){switch(e){case nt.RGB:return 3;case nt.RGBA:return 4;case nt.LUMINANCE_ALPHA:case nt.RG:return 2;case nt.ALPHA:case nt.RED:case nt.LUMINANCE:return 1;default:return 1}};nt.validate=function(e){return e===nt.DEPTH_COMPONENT||e===nt.DEPTH_STENCIL||e===nt.ALPHA||e===nt.RED||e===nt.RG||e===nt.RGB||e===nt.RGBA||e===nt.LUMINANCE||e===nt.LUMINANCE_ALPHA||e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5||e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1||e===nt.RGBA_ASTC||e===nt.RGB_ETC1||e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC||e===nt.RGBA_BC7};nt.isColorFormat=function(e){return e===nt.RED||e===nt.ALPHA||e===nt.RGB||e===nt.RGBA||e===nt.LUMINANCE||e===nt.LUMINANCE_ALPHA};nt.isDepthFormat=function(e){return e===nt.DEPTH_COMPONENT||e===nt.DEPTH_STENCIL};nt.isCompressedFormat=function(e){return e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5||e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1||e===nt.RGBA_ASTC||e===nt.RGB_ETC1||e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC||e===nt.RGBA_BC7};nt.isDXTFormat=function(e){return e===nt.RGB_DXT1||e===nt.RGBA_DXT1||e===nt.RGBA_DXT3||e===nt.RGBA_DXT5};nt.isPVRTCFormat=function(e){return e===nt.RGB_PVRTC_4BPPV1||e===nt.RGB_PVRTC_2BPPV1||e===nt.RGBA_PVRTC_4BPPV1||e===nt.RGBA_PVRTC_2BPPV1};nt.isASTCFormat=function(e){return e===nt.RGBA_ASTC};nt.isETC1Format=function(e){return e===nt.RGB_ETC1};nt.isETC2Format=function(e){return e===nt.RGB8_ETC2||e===nt.RGBA8_ETC2_EAC};nt.isBC7Format=function(e){return e===nt.RGBA_BC7};nt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case nt.RGB_DXT1:case nt.RGBA_DXT1:case nt.RGB_ETC1:case nt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case nt.RGBA_DXT3:case nt.RGBA_DXT5:case nt.RGBA_ASTC:case nt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case nt.RGB_PVRTC_4BPPV1:case nt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case nt.RGB_PVRTC_2BPPV1:case nt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case nt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};nt.textureSizeInBytes=function(e,t,n,i){let o=nt.componentsLength(e);return He.isPacked(t)&&(o=1),o*He.sizeInBytes(t)*n*i};nt.texture3DSizeInBytes=function(e,t,n,i,o){let r=nt.componentsLength(e);return He.isPacked(t)&&(r=1),r*He.sizeInBytes(t)*n*i*o};nt.alignmentInBytes=function(e,t,n){let i=nt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};nt.createTypedArray=function(e,t,n,i){let o=He.getTypedArrayConstructor(t),r=nt.componentsLength(e)*n*i;return new o(r)};nt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=nt.createTypedArray(t,n,i,o),s=nt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let d=0;d<a;++d)r[f+d]=e[u+d]}return r};nt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===nt.DEPTH_STENCIL)return q.DEPTH24_STENCIL8;if(e===nt.DEPTH_COMPONENT){if(t===He.UNSIGNED_SHORT)return q.DEPTH_COMPONENT16;if(t===He.UNSIGNED_INT)return q.DEPTH_COMPONENT24}if(t===He.FLOAT)switch(e){case nt.RGBA:return q.RGBA32F;case nt.RGB:return q.RGB32F;case nt.RG:return q.RG32F;case nt.RED:return q.R32F}if(t===He.HALF_FLOAT)switch(e){case nt.RGBA:return q.RGBA16F;case nt.RGB:return q.RGB16F;case nt.RG:return q.RG16F;case nt.RED:return q.R16F}if(t===He.UNSIGNED_BYTE)switch(e){case nt.RGBA:return q.RGBA8;case nt.RGB:return q.RGB8;case nt.RG:return q.RG8;case nt.RED:return q.R8}return e};var je=Object.freeze(nt);var Tr={_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(Tr,{maximumCombinedTextureImageUnits:{get:function(){return Tr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Tr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Tr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Tr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Tr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Tr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Tr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Tr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Tr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Tr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Tr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Tr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Tr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Tr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Tr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Tr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Tr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Tr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Tr._maximumColorAttachments}},maximumSamples:{get:function(){return Tr._maximumSamples}},highpFloatSupported:{get:function(){return Tr._highpFloatSupported}},highpIntSupported:{get:function(){return Tr._highpIntSupported}}});var Lt=Tr;function v9(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function gO(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Rd(e){e=e??G.EMPTY_OBJECT;let n=e.context._gl,i=Lt.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;v9(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;gO(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;v9(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;gO(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;gO(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;v9(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;gO(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Rd.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)}}});Rd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Rd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Rd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Rd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Rd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Rd.prototype.getColorTexture=function(e){return this._colorTextures[e]};Rd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Rd.prototype.isDestroyed=function(){return!1};Rd.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),ce(this)};var Zr=Rd;var yO={CLOCKWISE:q.CW,COUNTER_CLOCKWISE:q.CCW};yO.validate=function(e){return e===yO.CLOCKWISE||e===yO.COUNTER_CLOCKWISE};var Ps=Object.freeze(yO);function ite(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]=ite(e[t]));return Object.freeze(e)}var ote=ite;function Qh(e){let t=e??G.EMPTY_OBJECT,n=t.cull??G.EMPTY_OBJECT,i=t.polygonOffset??G.EMPTY_OBJECT,o=t.scissorTest??G.EMPTY_OBJECT,r=o.rectangle??G.EMPTY_OBJECT,s=t.depthRange??G.EMPTY_OBJECT,a=t.depthTest??G.EMPTY_OBJECT,c=t.colorMask??G.EMPTY_OBJECT,u=t.blending??G.EMPTY_OBJECT,f=u.color??G.EMPTY_OBJECT,d=t.stencilTest??G.EMPTY_OBJECT,p=d.frontOperation??G.EMPTY_OBJECT,_=d.backOperation??G.EMPTY_OBJECT,m=t.sampleCoverage??G.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??Ps.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??q.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Xe.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??q.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new H(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??q.FUNC_ADD,equationAlpha:u.equationAlpha??q.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??q.ONE,functionSourceAlpha:u.functionSourceAlpha??q.ONE,functionDestinationRgb:u.functionDestinationRgb??q.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??q.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??q.ALWAYS,backFunction:d.backFunction??q.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??q.KEEP,zFail:p.zFail??q.KEEP,zPass:p.zPass??q.KEEP},backOperation:{fail:_.fail??q.KEEP,zFail:_.zFail??q.KEEP,zPass:_.zPass??q.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new Xe(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var k1e=0,Zh={};Qh.fromCache=function(e){let t=JSON.stringify(e),n=Zh[t];if(l(n))return++n.referenceCount,n.state;let i=new Qh(e),o=JSON.stringify(i);return n=Zh[o],l(n)||(i.id=k1e++,n={referenceCount:0,state:i},Zh[o]=n),++n.referenceCount,Zh[t]={referenceCount:1,state:n.state},n.state};Qh.removeFromCache=function(e){let t=new Qh(e),n=JSON.stringify(t),i=Zh[n],o=JSON.stringify(e),r=Zh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Zh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Zh[n]};Qh.getCache=function(){return Zh};Qh.clearCache=function(){Zh={}};function Ax(e,t,n){n?e.enable(t):e.disable(t)}function rte(e,t){e.frontFace(t.frontFace)}function ste(e,t){let n=t.cull,i=n.enabled;Ax(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function ate(e,t){e.lineWidth(t.lineWidth)}function cte(e,t){let n=t.polygonOffset,i=n.enabled;Ax(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function lte(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Ax(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 ute(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function fte(e,t){let n=t.depthTest,i=n.enabled;Ax(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function dte(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function hte(e,t){e.depthMask(t.depthMask)}function mte(e,t){e.stencilMask(t.stencilMask)}function U1e(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function pte(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Ax(e,e.BLEND,o),o&&(U1e(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function _te(e,t){let n=t.stencilTest,i=n.enabled;if(Ax(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,_=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,_,m,y)}}function gte(e,t){let n=t.sampleCoverage,i=n.enabled;Ax(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var z1e=new Xe;function yte(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=z1e,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)}Qh.apply=function(e,t,n){rte(e,t),ste(e,t),ate(e,t),cte(e,t),ute(e,t),fte(e,t),dte(e,t),hte(e,t),mte(e,t),_te(e,t),gte(e,t),lte(e,t,n),pte(e,t,n),yte(e,t,n)};function V1e(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(rte),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(ste),e.lineWidth!==t.lineWidth&&n.push(ate),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(cte),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(ute),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(fte),(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(dte),e.depthMask!==t.depthMask&&n.push(hte),e.stencilMask!==t.stencilMask&&n.push(mte),(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(_te),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(gte),n}Qh.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=V1e(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&<e(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&pte(e,n,o),(t!==n||i!==o||i.context!==o.context)&&yte(e,n,o)};Qh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Xe.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:H.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Xe.clone(e.viewport):void 0}};var ze=Qh;function Zt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}Zt.packedLength=4;Zt.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};Zt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Zt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Zt.pack(e[o],t,o*4);return t};Zt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Zt.unpack(e,i,t[o])}return t};Zt.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 Zt(e[0],e[2],e[1],e[3])};Zt.fromArray=Zt.unpack;Zt.fromColumnMajorArray=function(e,t){return Zt.clone(e,t)};Zt.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 Zt(e[0],e[1],e[2],e[3])};Zt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Zt(e.x,0,0,e.y)};Zt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Zt(e,0,0,e)};Zt.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 Zt(n,-i,i,n)};Zt.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]]};Zt.getElementIndex=function(e,t){return e*2+t};Zt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Zt.setColumn=function(e,t,n,i){i=Zt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Zt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Zt.setRow=function(e,t,n,i){return i=Zt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var H1e=new V;Zt.setScale=function(e,t,n){let i=Zt.getScale(e,H1e),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 G1e=new V;Zt.setUniformScale=function(e,t,n){let i=Zt.getScale(e,G1e),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 xte=new V;Zt.getScale=function(e,t){return t.x=V.magnitude(V.fromElements(e[0],e[1],xte)),t.y=V.magnitude(V.fromElements(e[2],e[3],xte)),t};var bte=new V;Zt.getMaximumScale=function(e){return Zt.getScale(e,bte),V.maximumComponent(bte)};var j1e=new V;Zt.setRotation=function(e,t,n){let i=Zt.getScale(e,j1e);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 W1e=new V;Zt.getRotation=function(e,t){let n=Zt.getScale(e,W1e);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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.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};Zt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Zt.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};Zt.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};Zt.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]};Zt.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]};Zt.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};Zt.IDENTITY=Object.freeze(new Zt(1,0,0,1));Zt.ZERO=Object.freeze(new Zt(0,0,0,0));Zt.COLUMN0ROW0=0;Zt.COLUMN0ROW1=1;Zt.COLUMN1ROW0=2;Zt.COLUMN1ROW1=3;Object.defineProperties(Zt.prototype,{length:{get:function(){return Zt.packedLength}}});Zt.prototype.clone=function(e){return Zt.clone(this,e)};Zt.prototype.equals=function(e){return Zt.equals(this,e)};Zt.prototype.equalsEpsilon=function(e,t){return Zt.equalsEpsilon(this,e,t)};Zt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var ti=Zt;function q1e(e,t,n,i){switch(t.type){case e.FLOAT:return new Tte(e,t,n,i);case e.FLOAT_VEC2:return new Cte(e,t,n,i);case e.FLOAT_VEC3:return new Ate(e,t,n,i);case e.FLOAT_VEC4:return new Ete(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new w9(e,t,n,i);case e.INT:case e.BOOL:return new Ste(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new vte(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new wte(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Ite(e,t,n,i);case e.FLOAT_MAT2:return new Pte(e,t,n,i);case e.FLOAT_MAT3:return new Dte(e,t,n,i);case e.FLOAT_MAT4:return new Rte(e,t,n,i);default:throw new se(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Tte(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Tte.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Cte(e,t,n,i){this.name=n,this.value=void 0,this._value=new V,this._gl=e,this._location=i}Cte.prototype.set=function(){let e=this.value;V.equals(e,this._value)||(V.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Ate(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Ate.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function Ete(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Ete.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(ie.equals(e,this._value)||(this._value=ie.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function w9(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}w9.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};w9.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Ste(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Ste.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function vte(e,t,n,i){this.name=n,this.value=void 0,this._value=new V,this._gl=e,this._location=i}vte.prototype.set=function(){let e=this.value;V.equals(e,this._value)||(V.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function wte(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}wte.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Ite(e,t,n,i){this.name=n,this.value=void 0,this._value=new ie,this._gl=e,this._location=i}Ite.prototype.set=function(){let e=this.value;ie.equals(e,this._value)||(ie.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Y1e=new Float32Array(4);function Pte(e,t,n,i){this.name=n,this.value=void 0,this._value=new ti,this._gl=e,this._location=i}Pte.prototype.set=function(){if(!ti.equalsArray(this.value,this._value,0)){ti.clone(this.value,this._value);let e=ti.toArray(this.value,Y1e);this._gl.uniformMatrix2fv(this._location,!1,e)}};var X1e=new Float32Array(9);function Dte(e,t,n,i){this.name=n,this.value=void 0,this._value=new Z,this._gl=e,this._location=i}Dte.prototype.set=function(){if(!Z.equalsArray(this.value,this._value,0)){Z.clone(this.value,this._value);let e=Z.toArray(this.value,X1e);this._gl.uniformMatrix3fv(this._location,!1,e)}};var K1e=new Float32Array(16);function Rte(e,t,n,i){this.name=n,this.value=void 0,this._value=new O,this._gl=e,this._location=i}Rte.prototype.set=function(){if(!O.equalsArray(this.value,this._value,0)){O.clone(this.value,this._value);let e=O.toArray(this.value,K1e);this._gl.uniformMatrix4fv(this._location,!1,e)}};var xO=q1e;function $1e(e,t,n,i){switch(t.type){case e.FLOAT:return new Ote(e,t,n,i);case e.FLOAT_VEC2:return new Mte(e,t,n,i);case e.FLOAT_VEC3:return new Lte(e,t,n,i);case e.FLOAT_VEC4:return new Nte(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new I9(e,t,n,i);case e.INT:case e.BOOL:return new Fte(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Bte(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new kte(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Ute(e,t,n,i);case e.FLOAT_MAT2:return new zte(e,t,n,i);case e.FLOAT_MAT3:return new Vte(e,t,n,i);case e.FLOAT_MAT4:return new Hte(e,t,n,i);default:throw new se(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Ote(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]}Ote.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 Mte(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]}Mte.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];V.equalsArray(s,n,o)||(V.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function Lte(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]}Lte.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)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Nte(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]}Nte.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)?H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0):l(s.x)&&(ie.equalsArray(s,n,o)||(ie.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function I9(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}I9.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};I9.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 Fte(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]}Fte.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 Bte(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]}Bte.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];V.equalsArray(s,n,o)||(V.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function kte(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]}kte.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];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function Ute(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]}Ute.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];ie.equalsArray(s,n,o)||(ie.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function zte(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]}zte.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];ti.equalsArray(s,n,o)||(ti.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Vte(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]}Vte.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];Z.equalsArray(s,n,o)||(Z.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function Hte(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]}Hte.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];O.equalsArray(s,n,o)||(O.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var bO=$1e;var Z1e=0;function Bp(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=Q1e(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=Z1e++}Bp.fromCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};Bp.replaceCache=function(e){return e=e??G.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Bp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return TO(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return TO(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return TO(this),this._uniformsByName}}});function Gte(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 Q1e(e,t){let n={};if(!Lt.highpFloatSupported||!Lt.highpIntSupported){let i,o,r,s,a=Gte(e),c=Gte(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Jh="[Cesium WebGL] ";function J1e(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(`${Jh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Jh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Jh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Jh}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Jh}Vertex shader compile log: ${c}`),console.error(`${Jh} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Jh}Fragment shader compile log: ${c}`),console.error(`${Jh} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new se(u);function d(p,_){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Jh}${_} shader translation failed.`);return}console.error(`${Jh}Translated ${_} shaderSource: -${m}`)}}function eRe(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 tRe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=xO(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,_,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,_=e.getUniformLocation(t,u),_!==null&&(d.push(_),p.push(e.getUniform(t,_))))}else{d=[];for(let y=0;y<a.size;++y)_=e.getUniformLocation(t,`${u}[${y}]`),_!==null&&d.push(_);f=bO(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function nRe(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=mg[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function iRe(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 TO(e){l(e._program)||jte(e)}function jte(e){let t=e._program,n=e._gl,i=J1e(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=tRe(n,i),s=nRe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=eRe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=iRe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,_=/ ! = /g;e._vertexShaderText=a.replace(_," != "),e._fragmentShaderText=c.replace(_," != ");try{jte(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let x=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(x?x[1]:m.message)}})}Bp.prototype._bind=function(){TO(this),this._gl.useProgram(this._program)};Bp.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)}};Bp.prototype.isDestroyed=function(){return!1};Bp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Bp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ce(this)};var Xt=Bp;function CO(e){this._context=e}var aw,oRe=new qe({primitiveType:Le.TRIANGLES}),rRe=new ri({color:new H(0,0,0,0)});function sRe(e,t){return new Zr({context:e,colorTextures:[t],destroyAttachments:!1})}function aRe(e,t){return Xt.fromCache({context:e,vertexShaderSource:bC,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function cRe(e,t){return(!l(aw)||aw.viewport.width!==e||aw.viewport.height!==t)&&(aw=ze.fromCache({viewport:new Xe(0,0,e,t)})),aw}CO.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:aRe(o,e.fragmentShaderSource),a=sRe(o,t),c=cRe(n,i),u=e.uniformMap,f=rRe;f.framebuffer=a,f.renderState=c,f.execute(o);let d=oRe;d.vertexArray=r,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};CO.prototype.isDestroyed=function(){return!1};CO.prototype.destroy=function(){return ce(this)};var AO=CO;var En={BYTE:q.BYTE,UNSIGNED_BYTE:q.UNSIGNED_BYTE,SHORT:q.SHORT,UNSIGNED_SHORT:q.UNSIGNED_SHORT,INT:q.INT,UNSIGNED_INT:q.UNSIGNED_INT,FLOAT:q.FLOAT,DOUBLE:q.DOUBLE};En.getSizeInBytes=function(e){switch(e){case En.BYTE:return Int8Array.BYTES_PER_ELEMENT;case En.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case En.SHORT:return Int16Array.BYTES_PER_ELEMENT;case En.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case En.INT:return Int32Array.BYTES_PER_ELEMENT;case En.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case En.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case En.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};En.fromTypedArray=function(e){if(e instanceof Int8Array)return En.BYTE;if(e instanceof Uint8Array)return En.UNSIGNED_BYTE;if(e instanceof Int16Array)return En.SHORT;if(e instanceof Uint16Array)return En.UNSIGNED_SHORT;if(e instanceof Int32Array)return En.INT;if(e instanceof Uint32Array)return En.UNSIGNED_INT;if(e instanceof Float32Array)return En.FLOAT;if(e instanceof Float64Array)return En.DOUBLE};En.validate=function(e){return l(e)&&(e===En.BYTE||e===En.UNSIGNED_BYTE||e===En.SHORT||e===En.UNSIGNED_SHORT||e===En.INT||e===En.UNSIGNED_INT||e===En.FLOAT||e===En.DOUBLE)};En.createTypedArray=function(e,t){switch(e){case En.BYTE:return new Int8Array(t);case En.UNSIGNED_BYTE:return new Uint8Array(t);case En.SHORT:return new Int16Array(t);case En.UNSIGNED_SHORT:return new Uint16Array(t);case En.INT:return new Int32Array(t);case En.UNSIGNED_INT:return new Uint32Array(t);case En.FLOAT:return new Float32Array(t);case En.DOUBLE:return new Float64Array(t)}};En.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/En.getSizeInBytes(e),e){case En.BYTE:return new Int8Array(t,n,i);case En.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case En.SHORT:return new Int16Array(t,n,i);case En.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case En.INT:return new Int32Array(t,n,i);case En.UNSIGNED_INT:return new Uint32Array(t,n,i);case En.FLOAT:return new Float32Array(t,n,i);case En.DOUBLE:return new Float64Array(t,n,i)}};En.fromName=function(e){switch(e){case"BYTE":return En.BYTE;case"UNSIGNED_BYTE":return En.UNSIGNED_BYTE;case"SHORT":return En.SHORT;case"UNSIGNED_SHORT":return En.UNSIGNED_SHORT;case"INT":return En.INT;case"UNSIGNED_INT":return En.UNSIGNED_INT;case"FLOAT":return En.FLOAT;case"DOUBLE":return En.DOUBLE}};var K=Object.freeze(En);var lRe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Od=Object.freeze(lRe);function P9(e){e=e??G.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Le.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??Od.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}P9.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 uRe=new fe,fRe=new h,Wte=new O,dRe=[new fe,new fe,new fe],hRe=[new V,new V,new V],mRe=[new V,new V,new V],pRe=new h,_Re=new Pe,gRe=new O,yRe=new ti;P9._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ae.center(i,uRe),s=fe.toCartesian(r,n,fRe),a=Et.eastNorthUpToFixedFrame(s,n,Wte),c=O.inverse(a,Wte),u=hRe,f=dRe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=pRe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,d),d=O.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Pe.fromAxisAngle(h.UNIT_Z,-t,_Re),_=Z.fromQuaternion(p,gRe),m=e.length,y=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)d=O.multiplyByPointAsVector(c,e[o],d),d=Z.multiplyByVector(_,d,d),y=Math.min(y,d.x),x=Math.min(x,d.y),b=Math.max(b,d.x),T=Math.max(T,d.y);let C=ti.fromRotation(t,yRe),A=mRe;A[0].x=y,A[0].y=x,A[1].x=y,A[1].y=T,A[2].x=b,A[2].y=x;let S=u[0],w=u[2].x-S.x,R=u[1].y-S.y;for(o=0;o<3;o++){let E=A[o];ti.multiplyByVector(C,E,E),E.x=(E.x-S.x)/w,E.y=(E.y-S.y)/R}let D=A[0],M=A[1],L=A[2],g=new Array(6);return V.pack(D,g),V.pack(M,g,2),V.pack(L,g,4),g};var lt=P9;function xRe(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var we=xRe;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 EO=TC;var qte=$r(pu(),1);function Yte(){if(!l(ua._canTransferArrayBuffer)){let e=O9("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ua._canTransferArrayBuffer=!1,ua._canTransferArrayBuffer}ua._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),ua._canTransferArrayBuffer=s}})}return ua._canTransferArrayBuffer}var R9=new me;function D9(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 O9(e){let t=new qte.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(yx(e))s=e;else if(!n){let a=on(`${ua._workerModulePrefix}/${i}.js`);yx(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=D9(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${D9(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return r=D9(a),new Worker(r,o)}if(r=e,n||(r=on(`${ua._workerModulePrefix+i}.js`)),!Ft.supportsEsmWebWorkers())throw new se("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function bRe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ft.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new se(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=on(t.fallbackModulePath),n}n.wasmBinaryFile=on(t.wasmBinaryFile);let i=await Ee.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function ua(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var TRe=(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 se(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),R9.raiseEvent(s),i(s)}else R9.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},CRe=[];async function ARe(e,t,n){let i=await Promise.resolve(Yte());l(n)?i||(n.length=0):n=CRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",TRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:on.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function ERe(e,t,n){++e._activeTasks;try{let i=await ARe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ua.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=O9(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return ERe(this,e,t)};ua.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=O9(this._workerPath),i=await bRe(this,e),o=await Promise.resolve(Yte()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new se("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};ua.prototype.isDestroyed=function(){return!1};ua.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ce(this)};ua.taskCompletedEvent=R9;ua._defaultWorkerModulePrefix="Workers/";ua._workerModulePrefix=ua._defaultWorkerModulePrefix;ua._canTransferArrayBuffer=void 0;var hi=ua;function kp(){}kp._transcodeTaskProcessor=new hi("transcodeKTX2",Number.POSITIVE_INFINITY);kp._readyPromise=void 0;function SRe(){let e=kp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return kp._transcodeTaskProcessor;throw new se("KTX2 transcoder could not be initialized.")});kp._readyPromise=e}kp.transcode=function(e,t){return l(kp._readyPromise)||SRe(),kp._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 EO(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 SO=kp;var Xte;Kte.setKTX2SupportedFormats=function(e,t,n,i,o,r){Xte={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Kte(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ee.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return SO.transcode(n,Xte)})}var fa=Kte;function vRe(e,t){this.start=e??0,this.stop=t??0}var hc=vRe;function mn(e,t){this.center=h.clone(e??h.ZERO),this.radius=t??0}var N9=new h,F9=new h,B9=new h,k9=new h,U9=new h,z9=new h,V9=new h,da=new h,H9=new h,G9=new h,j9=new h,W9=new h,wRe=4/3*P.PI;mn.fromPoints=function(e,t){if(l(t)||(t=new mn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],V9),i=h.clone(n,N9),o=h.clone(n,F9),r=h.clone(n,B9),s=h.clone(n,k9),a=h.clone(n,U9),c=h.clone(n,z9),u=e.length,f;for(f=1;f<u;f++){h.clone(e[f],n);let D=n.x,M=n.y,L=n.z;D<i.x&&h.clone(n,i),D>s.x&&h.clone(n,s),M<o.y&&h.clone(n,o),M>a.y&&h.clone(n,a),L<r.z&&h.clone(n,r),L>c.z&&h.clone(n,c)}let d=h.magnitudeSquared(h.subtract(s,i,da)),p=h.magnitudeSquared(h.subtract(a,o,da)),_=h.magnitudeSquared(h.subtract(c,r,da)),m=i,y=s,x=d;p>x&&(x=p,m=o,y=a),_>x&&(x=_,m=r,y=c);let b=H9;b.x=(m.x+y.x)*.5,b.y=(m.y+y.y)*.5,b.z=(m.z+y.z)*.5;let T=h.magnitudeSquared(h.subtract(y,b,da)),C=Math.sqrt(T),A=G9;A.x=i.x,A.y=o.y,A.z=r.z;let S=j9;S.x=s.x,S.y=a.y,S.z=c.z;let w=h.midpoint(A,S,W9),R=0;for(f=0;f<u;f++){h.clone(e[f],n);let D=h.magnitude(h.subtract(n,w,da));D>R&&(R=D);let M=h.magnitudeSquared(h.subtract(n,b,da));if(M>T){let L=Math.sqrt(M);C=(C+L)*.5,T=C*C;let g=L-C;b.x=(C*b.x+g*n.x)/L,b.y=(C*b.y+g*n.y)/L,b.z=(C*b.z+g*n.z)/L}}return C<R?(h.clone(b,t.center),t.radius=C):(h.clone(w,t.center),t.radius=R),t};var $te=new Fi,IRe=new h,PRe=new h,M9=new fe,L9=new fe;mn.fromRectangle2D=function(e,t,n){return mn.fromRectangleWithHeights2D(e,t,0,0,n)};mn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new mn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;$te._ellipsoid=te.default,t=t??$te,ae.southwest(e,M9),M9.height=n,ae.northeast(e,L9),L9.height=i;let r=t.project(M9,IRe),s=t.project(L9,PRe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var DRe=[];mn.fromRectangle3D=function(e,t,n,i){if(t=t??te.default,n=n??0,l(i)||(i=new mn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=ae.subsample(e,t,n,DRe);return mn.fromPoints(o,i)};mn.fromVertices=function(e,t,n,i){if(l(i)||(i=new mn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=t??h.ZERO,n=n??3;let o=V9;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,N9),s=h.clone(o,F9),a=h.clone(o,B9),c=h.clone(o,k9),u=h.clone(o,U9),f=h.clone(o,z9),d=e.length,p;for(p=0;p<d;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,E=e[p+2]+t.z;o.x=L,o.y=g,o.z=E,L<r.x&&h.clone(o,r),L>c.x&&h.clone(o,c),g<s.y&&h.clone(o,s),g>u.y&&h.clone(o,u),E<a.z&&h.clone(o,a),E>f.z&&h.clone(o,f)}let _=h.magnitudeSquared(h.subtract(c,r,da)),m=h.magnitudeSquared(h.subtract(u,s,da)),y=h.magnitudeSquared(h.subtract(f,a,da)),x=r,b=c,T=_;m>T&&(T=m,x=s,b=u),y>T&&(T=y,x=a,b=f);let C=H9;C.x=(x.x+b.x)*.5,C.y=(x.y+b.y)*.5,C.z=(x.z+b.z)*.5;let A=h.magnitudeSquared(h.subtract(b,C,da)),S=Math.sqrt(A),w=G9;w.x=r.x,w.y=s.y,w.z=a.z;let R=j9;R.x=c.x,R.y=u.y,R.z=f.z;let D=h.midpoint(w,R,W9),M=0;for(p=0;p<d;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=h.magnitude(h.subtract(o,D,da));L>M&&(M=L);let g=h.magnitudeSquared(h.subtract(o,C,da));if(g>A){let E=Math.sqrt(g);S=(S+E)*.5,A=S*S;let v=E-S;C.x=(S*C.x+v*o.x)/E,C.y=(S*C.y+v*o.y)/E,C.z=(S*C.z+v*o.z)/E}}return S<M?(h.clone(C,i.center),i.radius=S):(h.clone(D,i.center),i.radius=M),i};mn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new mn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=V9;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,N9),r=h.clone(i,F9),s=h.clone(i,B9),a=h.clone(i,k9),c=h.clone(i,U9),u=h.clone(i,z9),f=e.length,d;for(d=0;d<f;d+=3){let M=e[d]+t[d],L=e[d+1]+t[d+1],g=e[d+2]+t[d+2];i.x=M,i.y=L,i.z=g,M<o.x&&h.clone(i,o),M>a.x&&h.clone(i,a),L<r.y&&h.clone(i,r),L>c.y&&h.clone(i,c),g<s.z&&h.clone(i,s),g>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,o,da)),_=h.magnitudeSquared(h.subtract(c,r,da)),m=h.magnitudeSquared(h.subtract(u,s,da)),y=o,x=a,b=p;_>b&&(b=_,y=r,x=c),m>b&&(b=m,y=s,x=u);let T=H9;T.x=(y.x+x.x)*.5,T.y=(y.y+x.y)*.5,T.z=(y.z+x.z)*.5;let C=h.magnitudeSquared(h.subtract(x,T,da)),A=Math.sqrt(C),S=G9;S.x=o.x,S.y=r.y,S.z=s.z;let w=j9;w.x=a.x,w.y=c.y,w.z=u.z;let R=h.midpoint(S,w,W9),D=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let M=h.magnitude(h.subtract(i,R,da));M>D&&(D=M);let L=h.magnitudeSquared(h.subtract(i,T,da));if(L>C){let g=Math.sqrt(L);A=(A+g)*.5,C=A*A;let E=g-A;T.x=(A*T.x+E*i.x)/g,T.y=(A*T.y+E*i.y)/g,T.z=(A*T.z+E*i.z)/g}}return A<D?(h.clone(T,n.center),n.radius=A):(h.clone(R,n.center),n.radius=D),n};mn.fromCornerPoints=function(e,t,n){l(n)||(n=new mn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};mn.fromEllipsoid=function(e,t){return l(t)||(t=new mn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var RRe=new h;mn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new mn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return mn.clone(e[0],t);if(n===2)return mn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=mn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,RRe)+a.radius)}return t.radius=s,t};var ORe=new h,MRe=new h,LRe=new h;mn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new mn);let n=e.halfAxes,i=Z.getColumn(n,0,ORe),o=Z.getColumn(n,1,MRe),r=Z.getColumn(n,2,LRe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var NRe=new h,FRe=new h;mn.fromTransformation=function(e,t){l(t)||(t=new mn);let n=O.getTranslation(e,NRe),i=O.getScale(e,FRe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};mn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new mn(e.center,e.radius)};mn.packedLength=4;mn.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};mn.unpack=function(e,t,n){t=t??0,l(n)||(n=new mn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var BRe=new h,kRe=new h;mn.union=function(e,t,n){l(n)||(n=new mn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,BRe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=h.multiplyByScalar(a,(-o+u)/c,kRe);return h.add(f,i,f),h.clone(f,n.center),n.radius=u,n};var URe=new h;mn.expand=function(e,t,n){n=mn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,URe));return i>n.radius&&(n.radius=i),n};mn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?Gt.OUTSIDE:r<i?Gt.INTERSECTING:Gt.INSIDE};mn.transform=function(e,t,n){return l(n)||(n=new mn),n.center=O.multiplyByPoint(t,e.center,n.center),n.radius=O.getMaximumScale(t)*e.radius,n};var zRe=new h;mn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,zRe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};mn.transformWithoutScale=function(e,t,n){return l(n)||(n=new mn),n.center=O.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var VRe=new h;mn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new hc);let o=h.subtract(e.center,t,VRe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Zte=new h,HRe=new h,GRe=new h,jRe=new h,WRe=new h,qRe=new fe,Jte=new Array(8);for(let e=0;e<8;++e)Jte[e]=new h;var Qte=new Fi;mn.projectTo2D=function(e,t,n){Qte._ellipsoid=te.default,t=t??Qte;let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,Zte):s=i.geodeticSurfaceNormal(o,Zte);let a=h.cross(h.UNIT_Z,s,HRe);h.normalize(a,a);let c=h.cross(s,a,GRe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let u=h.negate(c,WRe),f=h.negate(a,jRe),d=Jte,p=d[0];h.add(s,c,p),h.add(p,a,p),p=d[1],h.add(s,c,p),h.add(p,f,p),p=d[2],h.add(s,u,p),h.add(p,f,p),p=d[3],h.add(s,u,p),h.add(p,a,p),h.negate(s,s),p=d[4],h.add(s,c,p),h.add(p,a,p),p=d[5],h.add(s,c,p),h.add(p,f,p),p=d[6],h.add(s,u,p),h.add(p,f,p),p=d[7],h.add(s,u,p),h.add(p,a,p);let _=d.length;for(let b=0;b<_;++b){let T=d[b];h.add(o,T,T);let C=i.cartesianToCartographic(T,qRe);t.project(C,T)}n=mn.fromPoints(d,n),o=n.center;let m=o.x,y=o.y,x=o.z;return o.x=x,o.y=m,o.z=y,n};mn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};mn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};mn.prototype.intersectPlane=function(e){return mn.intersectPlane(this,e)};mn.prototype.distanceSquaredTo=function(e){return mn.distanceSquaredTo(this,e)};mn.prototype.computePlaneDistances=function(e,t,n){return mn.computePlaneDistances(this,e,t,n)};mn.prototype.isOccluded=function(e){return mn.isOccluded(this,e)};mn.prototype.equals=function(e){return mn.equals(this,e)};mn.prototype.clone=function(e){return mn.clone(this,e)};mn.prototype.volume=function(){let e=this.radius;return wRe*e*e*e};var re=mn;function YRe(e){e=e??G.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=YRe;var XRe={NONE:0,TOP:1,ALL:2},cn=Object.freeze(XRe);function us(e){e=e??G.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}us.POSITION_ONLY=Object.freeze(new us({position:!0}));us.POSITION_AND_NORMAL=Object.freeze(new us({position:!0,normal:!0}));us.POSITION_NORMAL_AND_ST=Object.freeze(new us({position:!0,normal:!0,st:!0}));us.POSITION_AND_ST=Object.freeze(new us({position:!0,st:!0}));us.POSITION_AND_COLOR=Object.freeze(new us({position:!0,color:!0}));us.ALL=Object.freeze(new us({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));us.DEFAULT=us.POSITION_NORMAL_AND_ST;us.packedLength=6;us.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};us.unpack=function(e,t,n){return t=t??0,l(n)||(n=new us),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};us.clone=function(e,t){if(l(e))return l(t)||(t=new us),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var De=us;var KRe=new h;function _u(e){e=e??G.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??De.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}_u.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new _u({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};_u.fromAxisAlignedBoundingBox=function(e){return new _u({minimum:e.minimum,maximum:e.maximum})};_u.packedLength=2*h.packedLength+De.packedLength+1;_u.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),De.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+De.packedLength]=e._offsetAttribute??-1,t};var tne=new h,nne=new h,ine=new De,ene={minimum:tne,maximum:nne,vertexFormat:ine,offsetAttribute:void 0};_u.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,tne),o=h.unpack(e,t+h.packedLength,nne),r=De.unpack(e,t+2*h.packedLength,ine),s=e[t+2*h.packedLength+De.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=De.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(ene.offsetAttribute=s===-1?void 0:s,new _u(ene))};_u.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.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 we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:u})}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 we({componentDatatype:K.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=h.subtract(n,t,KRe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===cn.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new lt({attributes:o,indices:r,primitiveType:Le.TRIANGLES,boundingSphere:new re(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var q9;_u.getUnitBox=function(){return l(q9)||(q9=_u.createGeometry(_u.fromDimensions({dimensions:new h(1,1,1),vertexFormat:De.POSITION_ONLY}))),q9};var mc=_u;var oo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};oo.getMathType=function(e){switch(e){case oo.SCALAR:return Number;case oo.VEC2:return V;case oo.VEC3:return h;case oo.VEC4:return ie;case oo.MAT2:return ti;case oo.MAT3:return Z;case oo.MAT4:return O}};oo.getNumberOfComponents=function(e){switch(e){case oo.SCALAR:return 1;case oo.VEC2:return 2;case oo.VEC3:return 3;case oo.VEC4:case oo.MAT2:return 4;case oo.MAT3:return 9;case oo.MAT4:return 16}};oo.getAttributeLocationCount=function(e){switch(e){case oo.SCALAR:case oo.VEC2:case oo.VEC3:case oo.VEC4:return 1;case oo.MAT2:return 2;case oo.MAT3:return 3;case oo.MAT4:return 4}};oo.getGlslType=function(e){switch(e){case oo.SCALAR:return"float";case oo.VEC2:return"vec2";case oo.VEC3:return"vec3";case oo.VEC4:return"vec4";case oo.MAT2:return"mat2";case oo.MAT3:return"mat3";case oo.MAT4:return"mat4"}};var rn=Object.freeze(oo);var one=1/256,rne=256,To={};To.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))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};To.octEncode=function(e,t){return To.octEncodeInRange(e,255,t)};var cw=new V,sne=new Uint8Array(1);function vO(e){return sne[0]=e,sne[0]}To.octEncodeToCartesian4=function(e,t){return To.octEncodeInRange(e,65535,cw),t.x=vO(cw.x*one),t.y=vO(cw.x),t.z=vO(cw.y*one),t.w=vO(cw.y),t};To.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.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))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return h.normalize(i,i)};To.octDecode=function(e,t,n){return To.octDecodeInRange(e,t,255,n)};To.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*rne+i,a=o*rne+r;return To.octDecodeInRange(s,a,65535,t)};To.octPackFloat=function(e){return 256*e.x+e.y};var X9=new V;To.octEncodeFloat=function(e){return To.octEncode(e,X9),To.octPackFloat(X9)};To.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return To.octDecode(i,o,t)};To.octPack=function(e,t,n,i){let o=To.octEncodeFloat(e),r=To.octEncodeFloat(t),s=To.octEncode(n,X9);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};To.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;To.octDecodeFloat(s,t),To.octDecodeFloat(c,n),To.octDecode(r,a,i)};To.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};To.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 Y9(e){return e>>1^-(e&1)}To.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=Y9(e[a]),r+=Y9(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=Y9(n[a]),n[a]=s)};To.dequantize=function(e,t,n,i){let o=rn.getNumberOfComponents(n),r;switch(t){case K.BYTE:r=127;break;case K.UNSIGNED_BYTE:r=255;break;case K.SHORT:r=32767;break;case K.UNSIGNED_SHORT:r=65535;break;case K.INT:r=2147483647;break;case K.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};To.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var Mn=To;var ane=new h,cne=new h,lne=new h;function $Re(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,ane),s=h.subtract(i,t,cne),a=h.subtract(e,t,lne),c=h.dot(r,r),u=h.dot(r,s),f=h.dot(r,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(V.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(V.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(V.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=V.subtract(n,t,ane),s=V.subtract(i,t,cne),a=V.subtract(e,t,lne),c=V.dot(r,r),u=V.dot(r,s),f=V.dot(r,a),d=V.dot(s,s),p=V.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let _=c*d-u*u;if(_!==0)return o.y/=_,o.z/=_,o.x=1-o.y-o.z,o}var CC=$Re;function em(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}em.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 Up={high:0,low:0};em.fromCartesian=function(e,t){l(t)||(t=new em);let n=t.high,i=t.low;return em.encode(e.x,Up),n.x=Up.high,i.x=Up.low,em.encode(e.y,Up),n.y=Up.high,i.y=Up.low,em.encode(e.z,Up),n.z=Up.high,i.z=Up.low,t};var K9=new em;em.writeElements=function(e,t,n){em.fromCartesian(e,K9);let i=K9.high,o=K9.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 Gn=em;var $9={};$9.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function une(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}$9.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=une(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*une(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Dl=$9;var Q9={};Q9.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 Z9(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,_=o*a-r*s,m=r*a-d,y=4*p*m-_*_,x,b;if(y<0){let j,W,J;f*u>=c*d?(j=o,W=p,J=-2*r*p+o*_):(j=a,W=m,J=-a*_+2*s*m);let ee=-(J<0?-1:1)*Math.abs(j)*Math.sqrt(-y);b=-J+ee;let Q=b/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),ge=b===ee?-de:-W/de;return x=W<=0?de+ge:-J/(de*de+ge*ge+W),f*u>=c*d?[(x-r)/o]:[-a/(x+s)]}let T=p,C=-2*r*p+o*_,A=m,S=-a*_+2*s*m,w=Math.sqrt(y),R=Math.sqrt(3)/2,D=Math.abs(Math.atan2(o*w,-C)/3);x=2*Math.sqrt(-T);let M=Math.cos(D);b=x*M;let L=x*(-M/2-R*Math.sin(D)),g=b+L>2*r?b-r:L-r,E=o,v=g/E;D=Math.abs(Math.atan2(a*w,-S)/3),x=2*Math.sqrt(-A),M=Math.cos(D),b=x*M,L=x*(-M/2-R*Math.sin(D));let I=-a,N=b+L<2*s?b+s:L+s,F=I/N,U=E*N,k=-g*N-E*I,z=g*I,B=(s*k-r*z)/(-r*k+s*U);return v<=B?v<=F?B<=F?[v,B,F]:[v,F,B]:[F,v,B]:v<=F?[B,v,F]:B<=F?[B,F,v]:[F,B,v]}Q9.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Dl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Dl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Z9(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Z9(e,t,0,i);if(i===0)return o=Dl.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Z9(e,t,n,i)};var AC=Q9;var J9={};J9.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,_=o*o,m=_*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+_*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Md(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=AC.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=Dl.computeRealRoots(1,r,a);if(d.length===2){let p=d[0],_=d[1],m;if(p>=0&&_>=0){let y=Math.sqrt(p),x=Math.sqrt(_);return[u-x,u-y,u+y,u+x]}else{if(p>=0&&_<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&_>=0)return m=Math.sqrt(_),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,_=(r+f+s/d)/2,m=Dl.computeRealRoots(1,d,p),y=Dl.computeRealRoots(1,-d,_);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function lw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=AC.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,_=p*p,m=e/2,y=p/2,x=_-4*i,b=_+4*Math.abs(i),T=s-4*d,C=s+4*Math.abs(d),A,S;if(d<0||x*C<T*b){let E=Math.sqrt(T);A=E/2,S=E===0?0:(e*y-n)/E}else{let E=Math.sqrt(x);A=E===0?0:(e*y-n)/E,S=E/2}let w,R;m===0&&A===0?(w=0,R=0):P.sign(m)===P.sign(A)?(w=m+A,R=d/w):(R=m-A,w=d/R);let D,M;y===0&&S===0?(D=0,M=0):P.sign(y)===P.sign(S)?(D=y+S,M=i/D):(M=y-S,D=i/M);let L=Dl.computeRealRoots(1,w,D),g=Dl.computeRealRoots(1,R,M);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}J9.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return AC.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return Md(r,s,a,c);case 1:return lw(r,s,a,c);case 2:return lw(r,s,a,c);case 3:return Md(r,s,a,c);case 4:return Md(r,s,a,c);case 5:return lw(r,s,a,c);case 6:return Md(r,s,a,c);case 7:return Md(r,s,a,c);case 8:return lw(r,s,a,c);case 9:return Md(r,s,a,c);case 10:return Md(r,s,a,c);case 11:return lw(r,s,a,c);case 12:return Md(r,s,a,c);case 13:return Md(r,s,a,c);case 14:return Md(r,s,a,c);case 15:return Md(r,s,a,c);default:return}};var wO=J9;function IO(e,t){t=h.clone(t??h.ZERO),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(e??h.ZERO),this.direction=t}IO.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new IO(e.origin,e.direction)};IO.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var gn=IO;var Vo={};Vo.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var ZRe=new h,QRe=new h,yne=new h,fne=new h,dne=new h;Vo.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,s=e.direction,a=h.subtract(n,t,ZRe),c=h.subtract(i,t,QRe),u=h.cross(s,c,yne),f=h.dot(a,u),d,p,_,m,y;if(o){if(f<P.EPSILON6||(d=h.subtract(r,t,fne),_=h.dot(d,u),_<0||_>f)||(p=h.cross(d,a,dne),m=h.dot(s,p),m<0||_+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let x=1/f;if(d=h.subtract(r,t,fne),_=h.dot(d,u)*x,_<0||_>1||(p=h.cross(d,a,dne),m=h.dot(s,p)*x,m<0||_+m>1))return;y=h.dot(c,p)*x}return y};Vo.rayTriangle=function(e,t,n,i,o,r){let s=Vo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var JRe=new gn;Vo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=JRe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Vo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function eOe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var tOe={root0:0,root1:0};function xne(e,t,n){l(n)||(n=new hc);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,yne),c=h.dot(o,o),u=2*h.dot(o,a),f=h.magnitudeSquared(a)-s,d=eOe(c,u,f,tOe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Vo.raySphere=function(e,t,n){if(n=xne(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var nOe=new gn;Vo.lineSegmentSphere=function(e,t,n,i){let o=nOe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=xne(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 iOe=new h,oOe=new h;Vo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,iOe),o=h.multiplyComponents(n,e.direction,oOe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new hc(m,y):{start:y,stop:m}}let _=Math.sqrt(a/c);return new hc(_,_)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new hc(0,d/c);if(s<0)return c=h.magnitudeSquared(o),new hc(0,-s/c)};function Ex(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Vo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[Z.COLUMN1ROW1]-e[Z.COLUMN2ROW2])*s,c=o*(i*Ex(e[Z.COLUMN1ROW0],e[Z.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[Z.COLUMN0ROW0]*r+e[Z.COLUMN2ROW2]*s+i*t.x+n,f=s*Ex(e[Z.COLUMN2ROW1],e[Z.COLUMN1ROW2],P.EPSILON15),d=o*(i*Ex(e[Z.COLUMN2ROW0],e[Z.COLUMN0ROW2])+t.z),p,_=[];if(d===0&&f===0){if(p=Dl.computeRealRoots(a,c,u),p.length===0)return _;let D=p[0],M=Math.sqrt(Math.max(1-D*D,0));if(_.push(new h(i,o*D,o*-M)),_.push(new h(i,o*D,o*M)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));_.push(new h(i,o*L,o*-g)),_.push(new h(i,o*L,o*g))}return _}let m=d*d,y=f*f,x=a*a,b=d*f,T=x+y,C=2*(c*a+b),A=2*u*a+c*c-y+m,S=2*(u*c-b),w=u*u-m;if(T===0&&C===0&&A===0&&S===0)return _;p=wO.computeRealRoots(T,C,A,S,w);let R=p.length;if(R===0)return _;for(let D=0;D<R;++D){let M=p[D],L=M*M,g=Math.max(1-L,0),E=Math.sqrt(g),v;P.sign(a)===P.sign(u)?v=Ex(a*L+u,c*M,P.EPSILON12):P.sign(u)===P.sign(c*M)?v=Ex(a*L,c*M+u,P.EPSILON12):v=Ex(a*L+c*M,u,P.EPSILON12);let I=Ex(f*M,d,P.EPSILON15),N=v*I;N<0?_.push(new h(i,o*M,o*E)):N>0?_.push(new h(i,o*M,o*-E)):E!==0?(_.push(new h(i,o*M,o*-E)),_.push(new h(i,o*M,o*E)),++D):_.push(new h(i,o*M,o*E))}return _};var ej=new h,hne=new h,mne=new h,PO=new h,rOe=new h,sOe=new Z,aOe=new Z,cOe=new Z,lOe=new Z,uOe=new Z,pne=new Z,_ne=new Z,gne=new h,fOe=new h,dOe=new fe;Vo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let w=t.geodeticSurfaceNormal(n,ej);if(h.dot(i,w)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,ej),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,PO),c=h.normalize(h.cross(a,s,hne),hne),u=h.normalize(h.cross(s,c,mne),mne),f=sOe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=Z.transpose(f,aOe),p=Z.fromScale(t.radii,cOe),_=Z.fromScale(t.oneOverRadii,lOe),m=uOe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=Z.multiply(Z.multiply(d,_,pne),m,pne),x=Z.multiply(Z.multiply(y,p,_ne),f,_ne),b=Z.multiplyByVector(y,n,rOe),T=Vo.quadraticVectorExpression(x,h.negate(b,ej),0,0,1),C,A,S=T.length;if(S>0){let w=h.clone(h.ZERO,fOe),R=Number.NEGATIVE_INFINITY;for(let M=0;M<S;++M){C=Z.multiplyByVector(p,Z.multiplyByVector(f,T[M],gne),gne);let L=h.normalize(h.subtract(C,n,PO),PO),g=h.dot(L,i);g>R&&(R=g,w=h.clone(C,w))}let D=t.cartesianToCartographic(w,dOe);return R=P.clamp(R,0,1),A=h.magnitude(h.subtract(w,n,PO))*Math.sqrt(1-R*R),A=o?-A:A,D.height=A,t.cartographicToCartesian(D,new h)}};var hOe=new h;Vo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,hOe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Vo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Vo.lineSegmentPlane(e,t,i,f),Vo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Vo.lineSegmentPlane(t,n,i,f),Vo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Vo.lineSegmentPlane(n,e,i,f),Vo.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Vo.lineSegmentPlane(e,n,i,f),Vo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Vo.lineSegmentPlane(n,t,i,f),Vo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Vo.lineSegmentPlane(t,e,i,f),Vo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var ni=Vo;function js(e,t){this.normal=h.clone(e),this.distance=t}js.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new js(t,i)};var mOe=new h;js.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,mOe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new js(n,i)};js.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var pOe=new h;js.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=js.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,pOe);return h.subtract(t,o,n)};var _Oe=new O,gOe=new ie,yOe=new h;js.transform=function(e,t,n){let i=e.normal,o=e.distance,r=O.inverseTranspose(t,_Oe),s=ie.fromElements(i.x,i.y,i.z,o,gOe);s=O.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,yOe);return s=ie.divideByScalar(s,h.magnitude(a),s),js.fromCartesian4(s,n)};js.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new js(e.normal,e.distance)};js.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};js.ORIGIN_XY_PLANE=Object.freeze(new js(h.UNIT_Z,0));js.ORIGIN_YZ_PLANE=Object.freeze(new js(h.UNIT_X,0));js.ORIGIN_ZX_PLANE=Object.freeze(new js(h.UNIT_Y,0));var en=js;var tj={};tj.calculateACMR=function(e){e=e??G.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)};tj.tipsify=function(e){e=e??G.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,E,v,I){for(;E.length>=1;){let N=E[E.length-1];if(E.splice(E.length-1,1),g[N].numLiveTriangles>0)return N}for(;o<I;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(g,E,v,I,N,F,U){let k=-1,z,B=-1,j=0;for(;j<v.length;){let W=v[j];I[W].numLiveTriangles&&(z=0,N-I[W].timeStamp+2*I[W].numLiveTriangles<=E&&(z=N-I[W].timeStamp),(z>B||B===-1)&&(B=z,k=W)),++j}return k===-1?r(I,F,g,U):k}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],_;for(_=0;_<c;_++)p[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,x=i+1;o=1;let b=[],T=[],C,A,S=0,w=[],R=a/3,D=[];for(_=0;_<R;_++)D[_]=!1;let M,L;for(;y!==-1;){b=[],A=p[y],L=A.vertexTriangles.length;for(let g=0;g<L;++g)if(m=A.vertexTriangles[g],!D[m]){D[m]=!0,u=m+m+m;for(let E=0;E<3;++E)M=t[u],b.push(M),T.push(M),w[S]=M,++S,C=p[M],--C.numLiveTriangles,x-C.timeStamp>i&&(C.timeStamp=x,++x),++u}y=s(t,i,b,p,x,T,c)}return w};var DO=tj;var Vc={};function BO(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function xOe(e){let t=e.length,n=t/3*6,i=ke.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)BO(i,o,e[r],e[r+1],e[r+2]);return i}function bOe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=ke.createTypedArray(t,n);BO(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)BO(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function TOe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=ke.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)BO(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Vc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Le.TRIANGLES:e.indices=xOe(t);break;case Le.TRIANGLE_STRIP:e.indices=bOe(t);break;case Le.TRIANGLE_FAN:e.indices=TOe(t);break}e.primitiveType=Le.LINES}return e};Vc.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new re(u.center,u.radius+n)),new lt({attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Le.LINES,boundingSphere:c})};Vc.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};Vc.reorderForPreVertexCache=function(e){let t=lt.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=ke.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let _=d[p],m=_.values,y=0,x=_.componentsPerAttribute,b=K.createTypedArray(_.componentDatatype,u*x);for(;y<t;){let T=i[y];if(T!==-1)for(let C=0;C<x;C++)b[x*T+C]=m[x*y+C];++y}_.values=b}}return e};Vc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Le.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=DO.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function bne(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new we({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function COe(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])}}Vc.fitToUnsignedShortIndices=function(e){let t=[],n=lt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=bne(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Le.TRIANGLES?u=3:e.primitiveType===Le.LINES?u=2:e.primitiveType===Le.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],_=i[p];l(_)||(_=r++,i[p]=_,COe(s,e.attributes,p)),o.push(_)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=bne(e.attributes))}o.length!==0&&t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Tne=new h,AOe=new fe;Vc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Fi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,Tne),p=s.cartesianToCartographic(d,AOe),_=o.project(p,Tne);c[u++]=_.x,c[u++]=_.y,c[u++]=_.z}return e.attributes[n]=r,e.attributes[i]=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var nj={high:0,low:0};Vc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Gn.encode(r[f],nj),a[f]=nj.high,c[f]=nj.low;let u=o.componentsPerAttribute;return e.attributes[n]=new we({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new we({componentDatatype:K.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Nd=new h;function ij(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Nd),O.multiplyByPoint(e,Nd,Nd),h.pack(Nd,n,o)}}function oj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Nd),Z.multiplyByVector(e,Nd,Nd),Nd=h.normalize(Nd,Nd),h.pack(Nd,n,o)}}var RO=new O,OO=new Z;Vc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(O.equals(t,O.IDENTITY))return e;let n=e.geometry.attributes;ij(t,n.position),ij(t,n.prevPosition),ij(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(O.inverse(t,RO),O.transpose(RO,RO),O.getMatrix3(RO,OO),oj(OO,n.normal),oj(OO,n.tangent),oj(OO,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=re.transform(i,t,i)),e.modelMatrix=O.clone(O.IDENTITY),e};function EOe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new we({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:K.createTypedArray(s.componentDatatype,a)}))}return i}var SOe=new h;function rj(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=EOe(e,t),d,p,_;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,_=p.length,r=0;r<_;++r)d[s++]=p[r];let m;if(c){let T=0;for(o=0;o<n;++o)T+=e[o][t].indices.length;let C=lt.computeNumberOfVertices(new lt({attributes:f,primitiveType:Le.POINTS})),A=ke.createTypedArray(C,T),S=0,w=0;for(o=0;o<n;++o){let R=e[o][t].indices,D=R.length;for(s=0;s<D;++s)A[S++]=w+R[s];w+=lt.computeNumberOfVertices(e[o][t])}m=A}let y=new h,x=0,b;for(o=0;o<n;++o){if(b=e[o][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),o=0;o<n;++o){b=e[o][t].boundingSphere;let T=h.magnitude(h.subtract(b.center,y,SOe))+b.radius;T>x&&(x=T)}return new lt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new re(y,x):void 0})}Vc.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(rj(t,"geometry")),n.length>0&&(o.push(rj(n,"westHemisphereGeometry")),o.push(rj(n,"eastHemisphereGeometry"))),o};var yf=new h,uw=new h,EC=new h,SC=new h;Vc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],y=t[u+1],x=t[u+2],b=m*3,T=y*3,C=x*3;uw.x=i[b],uw.y=i[b+1],uw.z=i[b+2],EC.x=i[T],EC.y=i[T+1],EC.z=i[T+2],SC.x=i[C],SC.y=i[C+1],SC.z=i[C+2],s[m].count++,s[y].count++,s[x].count++,h.subtract(EC,uw,EC),h.subtract(SC,uw,SC),a[f]=h.cross(EC,SC,new h),f++}let d=0;for(u=0;u<o;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let _=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,yf),p.count>0){for(f=0;f<p.count;f++)h.add(yf,a[c[p.indexOffset+f]],yf);h.equalsEpsilon(h.ZERO,yf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],yf)}h.equalsEpsilon(h.ZERO,yf,P.EPSILON10)&&(yf.z=1),h.normalize(yf,yf),_[m]=yf.x,_[m+1]=yf.y,_[m+2]=yf.z}return e.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_}),e};var vOe=new h,Cne=new h,wOe=new h;Vc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],x=n[u+1],b=n[u+2];f=y*3,d=x*3,p=b*3;let T=y*2,C=x*2,A=b*2,S=i[f],w=i[f+1],R=i[f+2],D=r[T],M=r[T+1],L=r[C+1]-M,g=r[A+1]-M,E=1/((r[C]-D)*g-(r[A]-D)*L),v=(g*(i[d]-S)-L*(i[p]-S))*E,I=(g*(i[d+1]-w)-L*(i[p+1]-w))*E,N=(g*(i[d+2]-R)-L*(i[p+2]-R))*E;c[f]+=v,c[f+1]+=I,c[f+2]+=N,c[d]+=v,c[d+1]+=I,c[d+2]+=N,c[p]+=v,c[p+1]+=I,c[p+2]+=N}let _=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(o,f,vOe),x=h.fromArray(c,f,wOe),b=h.dot(y,x);h.multiplyByScalar(y,b,Cne),h.normalize(h.subtract(x,Cne,x),x),_[f]=x.x,_[d]=x.y,_[p]=x.z,h.normalize(h.cross(y,x,x),x),m[f]=x.x,m[d]=x.y,m[p]=x.z}return e.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m}),e};var fw=new V,Ld=new h,Ane=new h,Ene=new h,MO=new V;Vc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let R=new Float32Array(i*2),D=0;for(n=0;n<i;++n){if(h.fromArray(w,n*3,Ld),h.equals(Ld,h.ZERO)){D+=2;continue}MO=Mn.octEncodeInRange(Ld,65535,MO),R[D++]=MO.x,R[D++]=MO.y}return e.attributes.compressedAttributes=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:R}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,_,m,y;s&&(p=o.values),a&&(_=r.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:_.length)/(s?3:2);let T=i,C=a&&s?2:1;C+=f||d?1:0,T*=C;let A=new Float32Array(T),S=0;for(n=0;n<i;++n){a&&(V.fromArray(_,n*2,fw),A[S++]=Mn.compressTextureCoordinates(fw));let w=n*3;s&&l(m)&&l(y)?(h.fromArray(p,w,Ld),h.fromArray(m,w,Ane),h.fromArray(y,w,Ene),Mn.octPack(Ld,Ane,Ene,fw),A[S++]=fw.x,A[S++]=fw.y):(s&&(h.fromArray(p,w,Ld),A[S++]=Mn.octEncodeFloat(Ld)),f&&(h.fromArray(m,w,Ld),A[S++]=Mn.octEncodeFloat(Ld)),d&&(h.fromArray(y,w,Ld),A[S++]=Mn.octEncodeFloat(Ld)))}return e.attributes.compressedAttributes=new we({componentDatatype:K.FLOAT,componentsPerAttribute:C,values:A}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function IOe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=ke.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function POe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.TRIANGLES,e}function DOe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.TRIANGLES,e}function ROe(e){if(l(e.indices))return e;let t=lt.computeNumberOfVertices(e),n=ke.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function OOe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.LINES,e}function MOe(e){let t=lt.computeNumberOfVertices(e),n=ke.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=Le.LINES,e}function LOe(e){switch(e.primitiveType){case Le.TRIANGLE_FAN:return POe(e);case Le.TRIANGLE_STRIP:return DOe(e);case Le.TRIANGLES:return IOe(e);case Le.LINE_STRIP:return OOe(e);case Le.LINE_LOOP:return MOe(e);case Le.LINES:return ROe(e)}return e}function Ag(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function NOe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ag(e,e.y<0),Ag(t,t.y<0),Ag(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=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;Ag(e,a),Ag(t,a),Ag(n,a)}var Sne=new h;function xf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Sne),e.y/(e.y-t.y),Sne),n),h.clone(n,i),Ag(n,!0),Ag(i,!1)}var Sx=new h,vx=new h,wx=new h,Ix=new h,sj={positions:new Array(7),indices:new Array(3*3)};function FOe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;NOe(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=sj.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(xf(e,t,Sx,wx),xf(e,n,vx,Ix),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(xf(t,n,Sx,wx),xf(t,e,vx,Ix),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(xf(n,e,Sx,wx),xf(n,t,vx,Ix),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||(xf(n,e,Sx,wx),xf(n,t,vx,Ix),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(xf(t,n,Sx,wx),xf(t,e,vx,Ix),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(xf(e,t,Sx,wx),xf(e,n,vx,Ix),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=sj.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Sx,c[4]=vx,c[5]=wx,c[6]=Ix,c.length=7),sj}function vne(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=K.createTypedArray(r.componentDatatype,r.values)}let i=lt.computeNumberOfVertices(e);return e.indices=ke.createTypedArray(i,e.indices),t&&(e.boundingSphere=re.fromVertices(n.position.values)),e}function wC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new we({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new lt({attributes:n,indices:[],primitiveType:e.primitiveType})}function uj(e,t,n){let i=l(e.geometry.boundingSphere);t=vne(t,i),n=vne(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 fj(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let _=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(_,c.x,_),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let x=e.add(_,m,_);e.add(x,y,x),p&&e.normalize(x,x),e.pack(x,f,d*t)}}var BOe=fj(ie,4),FO=fj(h,3),One=fj(V,2),kOe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},dw=new h,aj=new h,cj=new h,UOe=new h;function LO(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&_===0)return;let x=h.fromArray(o,e*3,dw),b=h.fromArray(o,t*3,aj),T=h.fromArray(o,n*3,cj),C=CC(i,x,b,T,UOe);if(l(C)){if(l(r)&&FO(e,t,n,C,r,d.normal.values,y,!0),l(u)){let A=h.fromArray(u,e*3,dw),S=h.fromArray(u,t*3,aj),w=h.fromArray(u,n*3,cj);h.multiplyByScalar(A,C.x,A),h.multiplyByScalar(S,C.y,S),h.multiplyByScalar(w,C.z,w);let R;!h.equals(A,h.ZERO)||!h.equals(S,h.ZERO)||!h.equals(w,h.ZERO)?(R=h.add(A,S,A),h.add(R,w,R),h.normalize(R,R)):(R=dw,R.x=0,R.y=0,R.z=0),h.pack(R,d.extrudeDirection.values,y*3)}if(l(f)&&kOe(e,t,n,C,f,d.applyOffset.values,y),l(s)&&FO(e,t,n,C,s,d.tangent.values,y,!0),l(a)&&FO(e,t,n,C,a,d.bitangent.values,y,!0),l(c)&&One(e,t,n,C,c,d.st.values,y),_>0)for(let A=0;A<_;A++){let S=p[A];zOe(e,t,n,C,y,m[S],d[S])}}}function zOe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:BOe(e,t,n,i,c,u,o,!1);break;case 3:FO(e,t,n,i,c,u,o,!1);break;case 2:One(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function tm(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 VOe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function wne(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let R in n)n.hasOwnProperty(R)&&!VOe[R]&&l(n[R])&&d.push(R);let p=d.length,_=wC(t),m=wC(t),y,x,b,T,C,A=[];A.length=i.length/3;let S=[];for(S.length=i.length/3,C=0;C<A.length;++C)A[C]=-1,S[C]=-1;let w=f.length;for(C=0;C<w;C+=3){let R=f[C],D=f[C+1],M=f[C+2],L=h.fromArray(i,R*3),g=h.fromArray(i,D*3),E=h.fromArray(i,M*3),v=FOe(L,g,E);if(l(v)&&v.positions.length>3){let I=v.positions,N=v.indices,F=N.length;for(let U=0;U<F;++U){let k=N[U],z=I[k];z.y<0?(y=m.attributes,x=m.indices,b=A):(y=_.attributes,x=_.indices,b=S),T=tm(y,x,b,f,k<3?C+k:-1,z),LO(R,D,M,z,i,o,s,r,a,c,u,y,d,p,n,T)}}else l(v)&&(L=v.positions[0],g=v.positions[1],E=v.positions[2]),L.y<0?(y=m.attributes,x=m.indices,b=A):(y=_.attributes,x=_.indices,b=S),T=tm(y,x,b,f,C,L),LO(R,D,M,L,i,o,s,r,a,c,u,y,d,p,n,T),T=tm(y,x,b,f,C+1,g),LO(R,D,M,g,i,o,s,r,a,c,u,y,d,p,n,T),T=tm(y,x,b,f,C+2,E),LO(R,D,M,E,i,o,s,r,a,c,u,y,d,p,n,T)}uj(e,m,_)}var Mne=en.fromPointNormal(h.ZERO,h.UNIT_Y),HOe=new h,GOe=new h;function vC(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,dw);h.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function Ine(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=wC(t),a=wC(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],_=r[c+1],m=h.fromArray(i,p*3,dw),y=h.fromArray(i,_*3,aj),x;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(y.y)<P.EPSILON6&&(y.y<0?y.y=-P.EPSILON6:y.y=P.EPSILON6);let b=s.attributes,T=s.indices,C=d,A=a.attributes,S=a.indices,w=f,R=ni.lineSegmentPlane(m,y,Mne,cj);if(l(R)){let D=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,HOe);m.y<0&&(h.negate(D,D),b=a.attributes,T=a.indices,C=f,A=s.attributes,S=s.indices,w=d);let M=h.add(R,D,GOe);x=tm(b,T,C,r,c,m),vC(p,_,m,i,x,b,o),x=tm(b,T,C,r,-1,M),vC(p,_,M,i,x,b,o),h.negate(D,D),h.add(R,D,M),x=tm(A,S,w,r,-1,M),vC(p,_,M,i,x,A,o),x=tm(A,S,w,r,c+1,y),vC(p,_,y,i,x,A,o)}else{let D,M,L;m.y<0?(D=a.attributes,M=a.indices,L=f):(D=s.attributes,M=s.indices,L=d),x=tm(D,M,L,r,c,m),vC(p,_,m,i,x,D,o),x=tm(D,M,L,r,c+1,y),vC(p,_,y,i,x,D,o)}}uj(e,a,s)}var Pne=new V,jOe=new V,Lne=new h,Nne=new h,lj=new h,WOe=new h,qOe=new h,YOe=new h,Dne=new ie;function Rne(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=h.unpack(n,s,Lne);if(a.x>0)continue;let c=h.unpack(i,s,Nne);(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]):h.pack(a,i,s));let u=h.unpack(o,s,lj);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var XOe=5*P.EPSILON9,NO=P.EPSILON6;function KOe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=wC(t),f=wC(t),d,p,_,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let x=d,b=d+2,T=h.fromArray(i,x*3,Lne),C=h.fromArray(i,b*3,Nne);if(Math.abs(T.y)<NO)for(T.y=NO*(C.y<0?-1:1),i[d*3+1]=T.y,i[(d+1)*3+1]=T.y,p=x*3;p<x*3+4*3;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(C.y)<NO)for(C.y=NO*(T.y<0?-1:1),i[(d+2)*3+1]=C.y,i[(d+3)*3+1]=C.y,p=x*3;p<x*3+4*3;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let A=u.attributes,S=u.indices,w=f.attributes,R=f.indices,D=ni.lineSegmentPlane(T,C,Mne,WOe);if(l(D)){m=!0;let M=h.multiplyByScalar(h.UNIT_Y,XOe,qOe);T.y<0&&(h.negate(M,M),A=f.attributes,S=f.indices,w=u.attributes,R=u.indices);let L=h.add(D,M,YOe);A.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.position.values.push(L.x,L.y,L.z),A.position.values.push(L.x,L.y,L.z),A.prevPosition.values.push(o[x*3],o[x*3+1],o[x*3+2]),A.prevPosition.values.push(o[x*3+3],o[x*3+4],o[x*3+5]),A.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),A.nextPosition.values.push(L.x,L.y,L.z),h.negate(M,M),h.add(D,M,L),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.nextPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),w.nextPosition.values.push(r[b*3],r[b*3+1],r[b*3+2]),w.nextPosition.values.push(r[b*3+3],r[b*3+4],r[b*3+5]);let g=V.fromArray(s,x*2,Pne),E=Math.abs(g.y);A.expandAndWidth.values.push(-1,E,1,E),A.expandAndWidth.values.push(-1,-E,1,-E),w.expandAndWidth.values.push(-1,E,1,E),w.expandAndWidth.values.push(-1,-E,1,-E);let v=h.magnitudeSquared(h.subtract(D,T,lj));if(v/=h.magnitudeSquared(h.subtract(C,T,lj)),l(c)){let I=ie.fromArray(c,x*4,Dne),N=ie.fromArray(c,b*4,Dne),F=P.lerp(I.x,N.x,v),U=P.lerp(I.y,N.y,v),k=P.lerp(I.z,N.z,v),z=P.lerp(I.w,N.w,v);for(p=x*4;p<x*4+2*4;++p)A.color.values.push(c[p]);for(A.color.values.push(F,U,k,z),A.color.values.push(F,U,k,z),w.color.values.push(F,U,k,z),w.color.values.push(F,U,k,z),p=b*4;p<b*4+2*4;++p)w.color.values.push(c[p])}if(l(a)){let I=V.fromArray(a,x*2,Pne),N=V.fromArray(a,(d+3)*2,jOe),F=P.lerp(I.x,N.x,v);for(p=x*2;p<x*2+2*2;++p)A.st.values.push(a[p]);for(A.st.values.push(F,I.y),A.st.values.push(F,N.y),w.st.values.push(F,I.y),w.st.values.push(F,N.y),p=b*2;p<b*2+2*2;++p)w.st.values.push(a[p])}_=A.position.values.length/3-4,S.push(_,_+2,_+1),S.push(_+1,_+2,_+3),_=w.position.values.length/3-4,R.push(_,_+2,_+1),R.push(_+1,_+2,_+3)}else{let M,L;for(T.y<0?(M=f.attributes,L=f.indices):(M=u.attributes,L=u.indices),M.position.values.push(T.x,T.y,T.z),M.position.values.push(T.x,T.y,T.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),p=d*3;p<d*3+4*3;++p)M.prevPosition.values.push(o[p]),M.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+4*2;++p)M.expandAndWidth.values.push(s[p]),l(a)&&M.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)M.color.values.push(c[p]);_=M.position.values.length/3-4,L.push(_,_+2,_+1),L.push(_+1,_+2,_+3)}}m&&(Rne(f),Rne(u)),uj(e,f,u)}Vc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||re.intersectPlane(n,en.ORIGIN_ZX_PLANE)!==Gt.INTERSECTING))return e;if(t.geometryType!==Od.NONE)switch(t.geometryType){case Od.POLYLINES:KOe(e);break;case Od.TRIANGLES:wne(e);break;case Od.LINES:Ine(e);break}else LOe(t),t.primitiveType===Le.TRIANGLES?wne(e):t.primitiveType===Le.LINES&&Ine(e);return e};var Fn=Vc;function hw(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(hw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});hw.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,_=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,x=this._flipY,b=4;l(f)&&(b=je.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let T=!1;if(!this._initialized){let C;t===0&&n===0&&r===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(f=je.flipY(f,p,m,d,d)),C=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),C=i),T=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C=je.createTypedArray(p,m,d,d)),a.texImage2D(u,0,_,d,d,0,p,He.toWebGLConstant(m,this._context),C),this._initialized=!0}T||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(f=je.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,He.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),a.texSubImage2D(u,0,t,n,p,He.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};hw.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};hw.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 kO=hw;var UO={DONT_CARE:q.DONT_CARE,FASTEST:q.FASTEST,NICEST:q.NICEST,validate:function(e){return e===UO.DONT_CARE||e===UO.FASTEST||e===UO.NICEST}},Fd=Object.freeze(UO);var zO={NEAREST:q.NEAREST,LINEAR:q.LINEAR};zO.validate=function(e){return e===zO.NEAREST||e===zO.LINEAR};var Kn=Object.freeze(zO);var Eg={NEAREST:q.NEAREST,LINEAR:q.LINEAR,NEAREST_MIPMAP_NEAREST:q.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:q.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:q.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:q.LINEAR_MIPMAP_LINEAR};Eg.validate=function(e){return e===Eg.NEAREST||e===Eg.LINEAR||e===Eg.NEAREST_MIPMAP_NEAREST||e===Eg.LINEAR_MIPMAP_NEAREST||e===Eg.NEAREST_MIPMAP_LINEAR||e===Eg.LINEAR_MIPMAP_LINEAR};var ft=Object.freeze(Eg);var VO={CLAMP_TO_EDGE:q.CLAMP_TO_EDGE,REPEAT:q.REPEAT,MIRRORED_REPEAT:q.MIRRORED_REPEAT,validate:function(e){return e===VO.CLAMP_TO_EDGE||e===VO.REPEAT||e===VO.MIRRORED_REPEAT}},sn=Object.freeze(VO);function mw(e){e=e??G.EMPTY_OBJECT;let{wrapS:t=sn.CLAMP_TO_EDGE,wrapT:n=sn.CLAMP_TO_EDGE,minificationFilter:i=ft.LINEAR,magnificationFilter:o=Kn.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(mw.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}}});mw.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};mw.NEAREST=Object.freeze(new mw({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST}));var zt=mw;function $Oe(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??K.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Bne(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 zp(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)$Oe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let _=p.strideInBytes||p.componentsPerAttribute*K.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/_;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Bne(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function Fne(e){return e.values.length/e.componentsPerAttribute}function ZOe(e){return K.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function QOe(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===K.DOUBLE&&(e[n].componentDatatype=K.FLOAT,e[n].values=K.createTypedArray(K.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Fne(e[o[0]]),t=1;t<s;++t){let u=Fne(e[o[t]]);if(u!==r)throw new se(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return K.getSizeInBytes(e[f].componentDatatype)-K.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=ZOe(i);if(a>0){let u=K.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),_={};for(t=0;t<s;++t){n=o[t];let m=K.getSizeInBytes(e[n].componentDatatype);_[n]={pointer:K.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let y=i.values,x=_[n],b=x.pointer,T=i.componentsPerAttribute;for(let C=0;C<T;++C)b[x.index+C]=y[t*T+C];x.index+=x.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}zp.fromGeometry=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=e.geometry??G.EMPTY_OBJECT,i=e.bufferUsage??Ne.DYNAMIC_DRAW,o=e.attributeLocations??G.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(r){let m=QOe(d);if(l(m)){u=st.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,x=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:x}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===K.DOUBLE&&(m=K.FLOAT),u=void 0,l(c.values)&&(u=st.createVertexBuffer({context:t,typedArray:K.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,_=n.indices;return l(_)&&(lt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=st.createIndexBuffer({context:t,typedArray:new Uint32Array(_),usage:i,indexDatatype:ke.UNSIGNED_INT}):p=st.createIndexBuffer({context:t,typedArray:new Uint16Array(_),usage:i,indexDatatype:ke.UNSIGNED_SHORT})),new zp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(zp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});zp.prototype.getAttribute=function(e){return this._attributes[e]};function JOe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Lt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function eMe(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)}}zp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&JOe(this),this._hasConstantAttributes&&eMe(this,this._gl)):Bne(this._gl,this._attributes,this._indexBuffer)};zp.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)}};zp.prototype.isDestroyed=function(){return!1};zp.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),ce(this)};var qn=zp;function $o(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e,c=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=je.textureSizeInBytes(i,o,d,d)*6,_=je.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,x=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=x,this._pixelFormat=i,this._pixelDatatype=o,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let b=l(n);function T(C){return new kO(t,x,y,C,_,i,o,d,c,r,b)}this._positiveX=T(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=T(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=T(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=T(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=T(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=T(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,kne(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,x),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let C of $o.faceNames())dj(this[C],n?.[C],0);m.bindTexture(y,null)}$o.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Zr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};$o.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*tMe(){yield $o.FaceName.POSITIVEX,yield $o.FaceName.NEGATIVEX,yield $o.FaceName.POSITIVEY,yield $o.FaceName.NEGATIVEY,yield $o.FaceName.POSITIVEZ,yield $o.FaceName.NEGATIVEZ}$o.faceNames=function(){return tMe()};function dj(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,o,o,0,r,He.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,_=4;l(p)&&(_=je.alignmentInBytes(r,s,o)),d.pixelStorei(d.UNPACK_ALIGNMENT,_),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=je.flipY(p,r,s,o,o)),d.texImage2D(i,n,a,o,o,0,r,He.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,r,He.toWebGLConstant(s,f),t))}$o.loadFace=dj;Object.defineProperties($o.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){kne(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}}});$o.getDirection=function(e,t){switch(e){case $o.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case $o.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case $o.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case $o.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case $o.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case $o.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function kne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.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)}$o.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 $o.faceNames())dj(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};$o.prototype.generateMipmap=function(e){e=e??Fd.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)};$o.createVertexArray=function(e){let t=mc.createGeometry(mc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY})),n=this._attributeLocations=Fn.createAttributeLocations(t);return qn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW})};$o.prototype.isDestroyed=function(){return!1};$o.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ce(this._positiveX),this._negativeX=ce(this._negativeX),this._positiveY=ce(this._positiveY),this._negativeY=ce(this._negativeY),this._positiveZ=ce(this._positiveZ),this._negativeZ=ce(this._negativeZ),ce(this)};var fr=$o;function nMe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Hc=nMe;var HO=`/** - * 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 GO=`/** - * 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 jO=`/** - * 0.1 - * - * @name czm_epsilon1 - * @glslConstant - */ -const float czm_epsilon1 = 0.1; -`;var WO=`/** - * 0.01 - * - * @name czm_epsilon2 - * @glslConstant - */ -const float czm_epsilon2 = 0.01; -`;var qO=`/** - * 0.001 - * - * @name czm_epsilon3 - * @glslConstant - */ -const float czm_epsilon3 = 0.001; -`;var YO=`/** - * 0.0001 - * - * @name czm_epsilon4 - * @glslConstant - */ -const float czm_epsilon4 = 0.0001; -`;var XO=`/** - * 0.00001 - * - * @name czm_epsilon5 - * @glslConstant - */ -const float czm_epsilon5 = 0.00001; -`;var KO=`/** - * 0.000001 - * - * @name czm_epsilon6 - * @glslConstant - */ -const float czm_epsilon6 = 0.000001; -`;var $O=`/** - * 0.0000001 - * - * @name czm_epsilon7 - * @glslConstant - */ -const float czm_epsilon7 = 0.0000001; -`;var ZO=`/** - * 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 QO=`/** - * 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 JO=`/** - * 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 eM=`/** - * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} - * - * @name czm_passCesium3DTile - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCesium3DTile = 4.0; -`;var tM=`/** - * 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 nM=`/** - * 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 iM=`/** - * The automatic GLSL constant for {@link Pass#CLASSIFICATION} - * - * @name czm_passClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passClassification = 7.0; -`;var oM=`/** - * The automatic GLSL constant for {@link Pass#COMPUTE} - * - * @name czm_passCompute - * @glslConstant - * - * @see czm_pass - */ -const float czm_passCompute = 1.0; -`;var rM=`/** - * The automatic GLSL constant for {@link Pass#ENVIRONMENT} - * - * @name czm_passEnvironment - * @glslConstant - * - * @see czm_pass - */ -const float czm_passEnvironment = 0.0; -`;var sM=`/** - * The automatic GLSL constant for {@link Pass#GLOBE} - * - * @name czm_passGlobe - * @glslConstant - * - * @see czm_pass - */ -const float czm_passGlobe = 2.0; -`;var aM=`/** - * The automatic GLSL constant for {@link Pass#OPAQUE} - * - * @name czm_passOpaque - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOpaque = 7.0; -`;var cM=`/** - * The automatic GLSL constant for {@link Pass#OVERLAY} - * - * @name czm_passOverlay - * @glslConstant - * - * @see czm_pass - */ -const float czm_passOverlay = 10.0; -`;var lM=`/** - * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} - * - * @name czm_passTerrainClassification - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTerrainClassification = 3.0; -`;var uM=`/** - * The automatic GLSL constant for {@link Pass#TRANSLUCENT} - * - * @name czm_passTranslucent - * @glslConstant - * - * @see czm_pass - */ -const float czm_passTranslucent = 8.0; -`;var fM=`/** - * The automatic GLSL constant for {@link Pass#VOXELS} - * - * @name czm_passVoxels - * @glslConstant - * - * @see czm_pass - */ -const float czm_passVoxels = 9.0; -`;var dM=`/** - * 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 hM=`/** - * 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 mM=`/** - * 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 pM=`/** - * 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 _M=`/** - * 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 gM=`/** - * 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 yM=`/** - * 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 xM=`/** - * 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 bM=`/** - * 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 TM=`/** - * 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 CM=`/** - * 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 AM=`/** - * 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 EM=`/** - * 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 SM=`/** - * 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 vM=`/** - * @name czm_depthRangeStruct - * @glslStruct - */ -struct czm_depthRangeStruct -{ - float near; - float far; -}; -`;var wM=`/** - * 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 IM=`/** - * 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 PM=`/** - * 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 DM=`/** - * 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 RM=`/** - * DOC_TBA - * - * @name czm_ray - * @glslStruct - */ -struct czm_ray -{ - vec3 origin; - vec3 direction; -}; -`;var OM=`/** - * 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 MM=`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 LM=`// 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 NM=`/** - * @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 FM=`/** - * 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 BM=`/** - * 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 kM=`/** - * 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 UM=`/** - * 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 zM=`/** - * 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 VM=`/** - * 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 HM=` -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 GM=` -uniform vec4 shadowMap_cascadeDistances; - -float czm_cascadeDistance(vec4 weights) -{ - return dot(shadowMap_cascadeDistances, weights); -} -`;var jM=` -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 WM=` -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 qM=`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 YM=`/** - * 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 XM=`/** - * 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 KM=`/** - * 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 $M=`/** - * 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 ZM=`/** - * 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 QM=`/** - * @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 JM=`/** - * 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 eL=`// 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 tL=`/** - * 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 nL=`/** - * 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 iL=`/** - * 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 oL=`/** - * 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 rL=`/** - * 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 sL=`/** - * 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 aL=`/** - * 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 cL=`/** - * 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 lL=`/** - * 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 uL=`/** - * 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 fL=`/** - * 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 dL=`/** - * 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 hL=`/** - * 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 mL=`/** - * 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 pL=`/** - * @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 _L=`/** - * 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 gL=`/** - * 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 yL=`/** - * 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 xL=`/** - * 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 bL=`/** - * 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 TL=`/** - * 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 CL=`/** - * 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 AL=`/** - * 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 EL=`/** - * 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 SL=`/** - * 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 vL=`/** - * 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 wL=`/** - * 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 IL=`/** - * 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 PL=`/** - * 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 DL=`/** - * 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 RL=` /** - * 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 OL=`/** - * 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 ML=`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 LL=`// 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 NL=`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 FL=`/** - * 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 BL=`/** - * 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 kL=`/** - * 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 UL=`/** - * 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 zL=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) -{ - return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var VL=`/** - * 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 HL=`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 GL=`/** - * 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 jL=`/** - * 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 WL=`/** - * 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 qL=`/** - * 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 YL=`/** - * 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 XL=` -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 KL=` -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 $L=`/** - * 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 ZL=`/** - * 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 QL=`/** - * 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 JL=`/** - * 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 eN=`/** - * 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 tN=`/** - * 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 nN=`/** - * 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 iN=`/** - * @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 oN=`/** - * 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 rN=`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 sN=`/** - * 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 aN=`/** - * 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 cN=`/** - * 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 lN=`/** - * 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 uN=`#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 fN=`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 dN=`// 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 hN=`#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 mN=`/** - * 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 pN=`/** - * 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 IC={czm_degreesPerRadian:HO,czm_depthRange:GO,czm_epsilon1:jO,czm_epsilon2:WO,czm_epsilon3:qO,czm_epsilon4:YO,czm_epsilon5:XO,czm_epsilon6:KO,czm_epsilon7:$O,czm_infinity:ZO,czm_oneOverPi:QO,czm_oneOverTwoPi:JO,czm_passCesium3DTile:eM,czm_passCesium3DTileClassification:tM,czm_passCesium3DTileClassificationIgnoreShow:nM,czm_passClassification:iM,czm_passCompute:oM,czm_passEnvironment:rM,czm_passGlobe:sM,czm_passOpaque:aM,czm_passOverlay:cM,czm_passTerrainClassification:lM,czm_passTranslucent:uM,czm_passVoxels:fM,czm_pi:dM,czm_piOverFour:hM,czm_piOverSix:mM,czm_piOverThree:pM,czm_piOverTwo:_M,czm_radiansPerDegree:gM,czm_sceneMode2D:yM,czm_sceneMode3D:xM,czm_sceneModeColumbusView:bM,czm_sceneModeMorphing:TM,czm_solarRadius:CM,czm_threePiOver2:AM,czm_twoPi:EM,czm_webMercatorMaxLatitude:SM,czm_depthRangeStruct:vM,czm_material:wM,czm_materialInput:IM,czm_modelMaterial:PM,czm_modelVertexOutput:DM,czm_ray:RM,czm_raySegment:OM,czm_shadowParameters:MM,czm_acesTonemapping:LM,czm_alphaWeight:NM,czm_antialias:FM,czm_applyHSBShift:BM,czm_approximateSphericalCoordinates:kM,czm_approximateTanh:UM,czm_backFacing:zM,czm_branchFreeTernary:VM,czm_cascadeColor:HM,czm_cascadeDistance:GM,czm_cascadeMatrix:jM,czm_cascadeWeights:WM,czm_clipPolygons:qM,czm_columbusViewMorph:YM,czm_computeAtmosphereColor:XM,czm_computeGroundAtmosphereScattering:KM,czm_computePosition:$M,czm_computeScattering:ZM,czm_cosineAndSine:QM,czm_decompressTextureCoordinates:JM,czm_depthClamp:eL,czm_eastNorthUpToEyeCoordinates:tL,czm_ellipsoidContainsPoint:nL,czm_ellipsoidTextureCoordinates:iL,czm_equalsEpsilon:oL,czm_eyeOffset:rL,czm_eyeToWindowCoordinates:sL,czm_fastApproximateAtan:aL,czm_fog:cL,czm_gammaCorrect:lL,czm_geodeticSurfaceNormal:uL,czm_getDefaultMaterial:fL,czm_getDynamicAtmosphereLightDirection:dL,czm_getLambertDiffuse:hL,czm_getSpecular:mL,czm_getWaterNoise:pL,czm_HSBToRGB:_L,czm_HSLToRGB:gL,czm_hue:yL,czm_inverseGamma:xL,czm_isEmpty:bL,czm_isFull:TL,czm_latitudeToWebMercatorFraction:CL,czm_linearToSrgb:AL,czm_lineDistance:EL,czm_luminance:SL,czm_maximumComponent:vL,czm_metersPerPixel:wL,czm_modelToWindowCoordinates:IL,czm_multiplyWithColorBalance:PL,czm_nearFarScalar:DL,czm_octDecode:RL,czm_packDepth:OL,czm_pbrLighting:ML,czm_pbrNeutralTonemapping:LL,czm_phong:NL,czm_planeDistance:FL,czm_pointAlongRay:BL,czm_rayEllipsoidIntersectionInterval:kL,czm_raySphereIntersectionInterval:UL,czm_readDepth:zL,czm_readNonPerspective:VL,czm_reverseLogDepth:HL,czm_RGBToHSB:GL,czm_RGBToHSL:jL,czm_RGBToXYZ:WL,czm_round:qL,czm_saturation:YL,czm_shadowDepthCompare:XL,czm_shadowVisibility:KL,czm_signNotZero:$L,czm_sphericalHarmonics:ZL,czm_srgbToLinear:QL,czm_tangentToEyeSpaceMatrix:JL,czm_textureCube:eN,czm_transformPlane:tN,czm_translateRelativeToEye:nN,czm_translucentPhong:iN,czm_transpose:oN,czm_unpackClippingExtents:rN,czm_unpackDepth:sN,czm_unpackFloat:aN,czm_unpackUint:cN,czm_valueTransform:lN,czm_vertexLogDepth:uN,czm_windowToEyeCoordinates:fN,czm_writeDepthClamp:dN,czm_writeLogDepth:hN,czm_writeNonPerspective:mN,czm_XYZToRGB:pN};function iMe(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 _N=iMe;function Une(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 zne(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=Une(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Vne(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&&Ws._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=zne(i,Ws._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),Vne(o,t)}}))}function oMe(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 rMe(e){let t=[],n=zne("main",e,t);Vne(n,t),oMe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function Hne(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=Une(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 u=e.pickColorQualifier;l(u)&&(r=Ws.createPickFragmentShaderSource(r,u));let f="",d=c.length;for(i=0;i<d;i++)f+=c[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH - precision highp float; - precision highp int; -#else - precision mediump float; - precision mediump int; - #define highp mediump -#endif - -`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(f+=`#define ${y} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear - -`),n.floatingPointTexture&&(f+=`#define OES_texture_float - -`);let _="";e.includeBuiltIns&&(_=rMe(r)),f+=` -#line 0 -`;let m=_+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; - -`),f+=_,f+=r,n.webgl2?f=`#version 300 es -${f}`:f=_N(f,t),f}function Ws(e){e=e??G.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}Ws.prototype.clone=function(){return new Ws({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ws.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ws.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}`};Ws.prototype.createCombinedVertexShader=function(e){return Hne(this,!1,e)};Ws.prototype.createCombinedFragmentShader=function(e){return Hne(this,!0,e)};Ws._czmBuiltinsAndUniforms={};for(let e in IC)IC.hasOwnProperty(e)&&(Ws._czmBuiltinsAndUniforms[e]=IC[e]);for(let e in mg)if(mg.hasOwnProperty(e)){let t=mg[e];typeof t.getDeclaration=="function"&&(Ws._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ws.createPickVertexShaderSource=function(e){return`${Ws.replaceMain(e,"czm_old_main")} -in vec4 pickColor; -out vec4 czm_pickColor; -void main() -{ - czm_old_main(); - czm_pickColor = pickColor; -}`};Ws.createPickFragmentShaderSource=function(e,t){let n=Ws.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 sMe(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 Gne(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 jne(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(Gne(e,o))return o}}var aMe=["v_normalEC","v_normal"];Ws.findNormalVarying=function(e){return Gne(e,"#ifdef HAS_NORMALS")?sMe(e,"HAS_NORMALS")?"v_normalEC":void 0:jne(e,aMe)};var cMe=["v_positionEC"];Ws.findPositionVarying=function(e){return jne(e,cMe)};var Be=Ws;function Bd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Bd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Bd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function lMe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Bd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Be({sources:[t]})),typeof n=="string"&&(n=new Be({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?lMe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Xt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,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};Bd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){hj(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Bd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Bd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Be({sources:[r]})),typeof s=="string"&&(s=new Be({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Xt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function hj(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];hj(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Bd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];hj(this,n),--this._numberOfShaders}this._shadersToRelease={}};Bd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ce(this)};var gN=Bd;function kd(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,d=je.toInternalFormat(i,o,t),p=je.isCompressedFormat(d),_=t._gl,m=p?je.compressedTextureSizeInBytes(i,c,u):je.textureSizeInBytes(i,o,c,u);this._id=e.id??Nn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_.TEXTURE_2D,this._texture=_.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new V(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Xne(this,a),_.activeTexture(_.TEXTURE0),_.bindTexture(this._textureTarget,this._texture),l(n)?(s?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?je.isCompressedFormat(d)?uMe(this,n):Wne(this,n):l(n.framebuffer)?dMe(this,n):qne(this,n),this._initialized=!0):Yne(this),_.bindTexture(this._textureTarget,null)}function uMe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=yN(c),u=yN(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function Wne(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=je.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=je.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,He.toWebGLConstant(u,n),p),l(t.mipLevels)){let _=s,m=a;for(let y=0;y<t.mipLevels.length;++y)_=yN(_),m=yN(m),i.texImage2D(o,y+1,r,_,m,0,c,He.toWebGLConstant(u,n),t.mipLevels[y])}}function fMe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=je.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=je.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,He.toWebGLConstant(u,s),t)}function dMe(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 qne(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,He.toWebGLConstant(e.pixelDatatype,n),t)}function hMe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,He.toWebGLConstant(e.pixelDatatype,o),t)}function yN(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Yne(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}kd.create=function(e){return new kd(e)};kd.fromFramebuffer=function(e){e=e??G.EMPTY_OBJECT;let t=e.context,n=t._gl,{pixelFormat:i=je.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new kd({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(kd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Xne(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 Xne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.NEAREST),r.webgl2&&je.isDepthFormat(s)&&(n=ft.NEAREST,i=Kn.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}kd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Wne(this,i):qne(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Yne(this)),this._initialized=!0),f||(l(i.arrayBufferView)?fMe(this,i.arrayBufferView,t,n,c,u):hMe(this,i,t,n)),s.bindTexture(a,null)};kd.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};kd.prototype.generateMipmap=function(e){e=e??Fd.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)};kd.prototype.isDestroyed=function(){return!1};kd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ce(this)};var dt=kd;function Px(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Px.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Px.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Px.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};Px.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={}};Px.prototype.isDestroyed=function(){return!1};Px.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ce(this)};var xN=Px;function bf(e){this.planes=e??[]}var pw=[new h,new h,new h];h.clone(h.UNIT_X,pw[0]);h.clone(h.UNIT_Y,pw[1]);h.clone(h.UNIT_Z,pw[2]);var Sg=new h,mMe=new h,Kne=new en(new h(1,0,0),0);bf.fromBoundingSphere=function(e,t){l(t)||(t=new bf);let n=pw.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=pw[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new ie),l(f)||(f=i[s+1]=new ie),h.multiplyByScalar(c,-r,Sg),h.add(o,Sg,Sg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Sg),h.multiplyByScalar(c,r,Sg),h.add(o,Sg,Sg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,mMe),Sg),s+=2}return t};bf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(en.fromCartesian4(t[i],Kne));if(r===Gt.OUTSIDE)return Gt.OUTSIDE;r===Gt.INTERSECTING&&(n=!0)}return n?Gt.INTERSECTING:Gt.INSIDE};bf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===bf.MASK_OUTSIDE||t===bf.MASK_INSIDE)return t;let n=bf.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(en.fromCartesian4(i[o],Kne));if(a===Gt.OUTSIDE)return bf.MASK_OUTSIDE;a===Gt.INTERSECTING&&(n|=s)}return n};bf.MASK_OUTSIDE=4294967295;bf.MASK_INSIDE=0;bf.MASK_INDETERMINATE=2147483647;var Ds=bf;function nm(e){e=e??G.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 Ds,this._orthographicMatrix=new O}function $ne(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=O.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(nm.prototype,{projectionMatrix:{get:function(){return $ne(this),this._orthographicMatrix}}});var pMe=new h,_Me=new h,gMe=new h,mj=new h;nm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,pMe);h.normalize(f,f);let d=_Me;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=gMe;h.multiplyByScalar(f,a,p),h.add(d,p,p);let _=i[0];return l(_)||(_=i[0]=new ie),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),_=i[1],l(_)||(_=i[1]=new ie),_.x=-f.x,_.y=-f.y,_.z=-f.z,_.w=-h.dot(h.negate(f,mj),p),h.multiplyByScalar(n,r,p),h.add(d,p,p),_=i[2],l(_)||(_=i[2]=new ie),_.x=n.x,_.y=n.y,_.z=n.z,_.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(d,p,p),_=i[3],l(_)||(_=i[3]=new ie),_.x=-n.x,_.y=-n.y,_.z=-n.z,_.w=-h.dot(h.negate(n,mj),p),_=i[4],l(_)||(_=i[4]=new ie),_.x=t.x,_.y=t.y,_.z=t.z,_.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),_=i[5],l(_)||(_=i[5]=new ie),_.x=-t.x,_.y=-t.y,_.z=-t.z,_.w=-h.dot(h.negate(t,mj),p),this._cullingVolume};nm.prototype.getPixelDimensions=function(e,t,n,i,o){$ne(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};nm.prototype.clone=function(e){return l(e)||(e=new nm),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};nm.prototype.equals=function(e){return l(e)&&e instanceof nm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};nm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof nm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Qr=nm;function Rl(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new Qr,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 vg(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 vg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return vg(this),this._offCenterFrustum}}});Rl.prototype.computeCullingVolume=function(e,t,n){return vg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Rl.prototype.getPixelDimensions=function(e,t,n,i,o){return vg(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:(vg(this),vg(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:(vg(this),vg(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var ln=Rl;var pj={};function yMe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var xMe=32.184,bMe=2451545;function pie(e,t){t=$.addSeconds(e,xMe,t);let n=$.totalDays(t)-bMe;return t=$.addSeconds(t,yMe(n),t),t}var bN=new $(2451545,0,Wn.TAI),TMe=1e3,Tf=P.RADIANS_PER_DEGREE,gu=P.RADIANS_PER_ARCSECOND,ka=14959787e4,Zne=new Z;function _ie(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=AMe(r-i,t),d=CMe(t,0);IMe(c,n,u,Zne);let p=a*(1+t),_=Math.cos(f),m=Math.sin(f),y=1+t*_,x=p/y;return l(s)?(s.x=x*_,s.y=x*m,s.z=0):s=new h(x*_,x*m,0),Z.multiplyByVector(Zne,s,s)}function CMe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function AMe(e,t){let n=vMe(e,t);return wMe(n,t)}var EMe=50,SMe=P.EPSILON8;function vMe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.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<EMe&&Math.abs(o-i)>SMe;++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*P.TWO_PI,o}function wMe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function IMe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new Z(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var PMe=1.0000010178*ka,DMe=100.46645683*Tf,RMe=129597742283429e-5*gu,Qne=16002,Jne=21863,eie=32004,tie=10931,nie=14529,iie=16368,oie=15318,rie=32794,OMe=64*1e-7*ka,MMe=-152*1e-7*ka,LMe=62*1e-7*ka,NMe=-8*1e-7*ka,FMe=32*1e-7*ka,BMe=-41*1e-7*ka,kMe=19*1e-7*ka,UMe=-11*1e-7*ka,zMe=-150*1e-7*ka,VMe=-46*1e-7*ka,HMe=68*1e-7*ka,GMe=54*1e-7*ka,jMe=14*1e-7*ka,WMe=24*1e-7*ka,qMe=-28*1e-7*ka,YMe=22*1e-7*ka,sie=10,aie=16002,cie=21863,lie=10931,uie=1473,fie=32004,die=4387,hie=73,XMe=-325*1e-7,KMe=-322*1e-7,$Me=-79*1e-7,ZMe=232*1e-7,QMe=-52*1e-7,JMe=97*1e-7,eLe=55*1e-7,tLe=-41*1e-7,nLe=-105*1e-7,iLe=-137*1e-7,oLe=258*1e-7,rLe=35*1e-7,sLe=-116*1e-7,aLe=-88*1e-7,cLe=-112*1e-7,lLe=-80*1e-7,PC=new $(0,0,Wn.TAI);function uLe(e,t){pie(e,PC);let i=(PC.dayNumber-bN.dayNumber+(PC.secondsOfDay-bN.secondsOfDay)/Yn.SECONDS_PER_DAY)/(Yn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=PMe+OMe*Math.cos(Qne*o)+zMe*Math.sin(Qne*o)+MMe*Math.cos(Jne*o)+VMe*Math.sin(Jne*o)+LMe*Math.cos(eie*o)+HMe*Math.sin(eie*o)+NMe*Math.cos(tie*o)+GMe*Math.sin(tie*o)+FMe*Math.cos(nie*o)+jMe*Math.sin(nie*o)+BMe*Math.cos(iie*o)+WMe*Math.sin(iie*o)+kMe*Math.cos(oie*o)+qMe*Math.sin(oie*o)+UMe*Math.cos(rie*o)+YMe*Math.sin(rie*o),s=DMe+RMe*i+XMe*Math.cos(sie*o)+nLe*Math.sin(sie*o)+KMe*Math.cos(aie*o)+iLe*Math.sin(aie*o)+$Me*Math.cos(cie*o)+oLe*Math.sin(cie*o)+ZMe*Math.cos(lie*o)+rLe*Math.sin(lie*o)+QMe*Math.cos(uie*o)+sLe*Math.sin(uie*o)+JMe*Math.cos(fie*o)+aLe*Math.sin(fie*o)+eLe*Math.cos(die*o)+cLe*Math.sin(die*o)+tLe*Math.cos(hie*o)+lLe*Math.sin(hie*o),a=.0167086342-.0004203654*i,c=102.93734808*Tf+11612.3529*gu*i,u=469.97289*gu*i,f=174.87317577*Tf-8679.27034*gu*i;return _ie(r,a,u,c,f,s,t)}function gie(e,t){pie(e,PC);let i=(PC.dayNumber-bN.dayNumber+(PC.secondsOfDay-bN.secondsOfDay)/Yn.SECONDS_PER_DAY)/Yn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Tf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Tf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,_=125.04455501*Tf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Tf,x=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,b=297.85019547*Tf+gu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),T=93.27209062*Tf+gu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),C=134.96340251*Tf+gu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),A=357.52910918*Tf+gu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),S=310.17137918*Tf-gu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),w=2*b,R=4*b,D=6*b,M=2*C,L=3*C,g=4*C,E=2*T;a+=3400.4*Math.cos(w)-635.6*Math.cos(w-C)-235.6*Math.cos(C)+218.1*Math.cos(w-A)+181*Math.cos(w+C),c+=.014216*Math.cos(w-C)+.008551*Math.cos(w-M)-.001383*Math.cos(C)+.001356*Math.cos(w+C)-.001147*Math.cos(R-L)-914e-6*Math.cos(R-M)+869e-6*Math.cos(w-A-C)-627e-6*Math.cos(w)-394e-6*Math.cos(R-g)+282e-6*Math.cos(w-A-M)-279e-6*Math.cos(b-C)-236e-6*Math.cos(M)+231e-6*Math.cos(R)+229e-6*Math.cos(D-g)-201e-6*Math.cos(M-E),f+=486.26*Math.cos(w-E)-40.13*Math.cos(w)+37.51*Math.cos(E)+25.73*Math.cos(M-E)+19.97*Math.cos(w-A-E),p+=-55609*Math.sin(w-C)-34711*Math.sin(w-M)-9792*Math.sin(C)+9385*Math.sin(R-L)+7505*Math.sin(R-M)+5318*Math.sin(w+C)+3484*Math.sin(R-g)-3417*Math.sin(w-A-C)-2530*Math.sin(D-g)-2376*Math.sin(w)-2075*Math.sin(w-L)-1883*Math.sin(M)-1736*Math.sin(D-5*C)+1626*Math.sin(A)-1370*Math.sin(D-L),m+=-5392*Math.sin(w-E)-540*Math.sin(A)-441*Math.sin(w)+423*Math.sin(E)-288*Math.sin(M-E),x+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-C)-662.5*Math.sin(A)+396.3*Math.sin(C)-218*Math.sin(w-A);let v=2*S,I=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(w-E+S)*i+.614*Math.cos(w-E-S)*i-.0297*Math.cos(v)*o-.0335*Math.cos(S)*o+.0012*Math.cos(w-E+v)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(v)*r;let N=2.116*Math.sin(S)*i-.111*Math.sin(w-E-S)*i-.0015*Math.sin(S)*o;p+=N,x+=N,m+=-520.77*Math.sin(S)*i+13.66*Math.sin(w-E+S)*i+1.12*Math.sin(w-S)*i-1.06*Math.sin(E-S)*i+.66*Math.sin(v)*o+.371*Math.sin(S)*o-.035*Math.sin(w-E+v)*o-.015*Math.sin(w-E+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(v)*r,a*=TMe;let F=u+f*gu,U=d+p*gu,k=y+x*gu,z=_+m*gu;return _ie(a,c,F,U,z,k,t)}var mie=.012300034,fLe=mie/(mie+1)*-1;function dLe(e,t){return t=gie(e,t),h.multiplyByScalar(t,fLe,t)}var yie=new Z(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),_w=new h;pj.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=$.now()),l(t)||(t=new h),_w=uLe(e,_w),t=h.negate(_w,t),dLe(e,_w),h.subtract(t,_w,t),Z.multiplyByVector(yie,t,t),t};pj.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=$.now()),t=gie(e,t),Z.multiplyByVector(yie,t,t),t};var Dx=pj;var TN={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};TN.getMorphTime=function(e){return e===TN.SCENE3D?1:e===TN.MORPHING?void 0:0};var ne=Object.freeze(TN);function hLe(e){e=e??G.EMPTY_OBJECT,this.color=H.clone(e.color??H.WHITE),this.intensity=e.intensity??2}var wg=hLe;function DC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Xe,this._viewportCartesian4=new ie,this._viewportDirty=!1,this._viewportOrthographicMatrix=O.clone(O.IDENTITY),this._viewportTransformation=O.clone(O.IDENTITY),this._model=O.clone(O.IDENTITY),this._view=O.clone(O.IDENTITY),this._inverseView=O.clone(O.IDENTITY),this._projection=O.clone(O.IDENTITY),this._infiniteProjection=O.clone(O.IDENTITY),this._entireFrustum=new V,this._currentFrustum=new V,this._frustumPlanes=new ie,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Z.clone(O.IDENTITY),this._view3DDirty=!0,this._view3D=new O,this._inverseView3DDirty=!0,this._inverseView3D=new O,this._inverseModelDirty=!0,this._inverseModel=new O,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Z,this._viewRotation=new Z,this._inverseViewRotation=new Z,this._viewRotation3D=new Z,this._inverseViewRotation3D=new Z,this._inverseProjectionDirty=!0,this._inverseProjection=new O,this._modelViewDirty=!0,this._modelView=new O,this._modelView3DDirty=!0,this._modelView3D=new O,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new O,this._inverseModelViewDirty=!0,this._inverseModelView=new O,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new O,this._viewProjectionDirty=!0,this._viewProjection=new O,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new O,this._modelViewProjectionDirty=!0,this._modelViewProjection=new O,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new O,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new O,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new O,this._normalDirty=!0,this._normal=new Z,this._normal3DDirty=!0,this._normal3D=new Z,this._inverseNormalDirty=!0,this._inverseNormal=new Z,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Z,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Gn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new V,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new V,this._modelToEnu=new O,this._enuToModel=new O,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new H,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(DC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Xe.equals(e,this._viewport)){Xe.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return bie(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return bie(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){O.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,O.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,O.getMatrix3(this.inverseModel,e),Z.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return gj(this),this._view3D}},viewRotation:{get:function(){return gj(this),this._viewRotation}},viewRotation3D:{get:function(){return gj(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Aie(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Aie(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return ELe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return SLe(this),this._modelView}},modelView3D:{get:function(){return vLe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return OLe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return wLe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return ILe(this),this._inverseModelView3D}},viewProjection:{get:function(){return PLe(this),this._viewProjection}},inverseViewProjection:{get:function(){return DLe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return RLe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return MLe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return LLe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return NLe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return FLe(this),this._normal}},normal3D:{get:function(){return BLe(this),this._normal3D}},inverseNormal:{get:function(){return kLe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return ULe(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 Cie(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Cie(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??te.default}}});function mLe(e,t){O.clone(t,e._view),O.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 pLe(e,t){O.clone(t,e._inverseView),O.getMatrix3(t,e._inverseViewRotation)}function _Le(e,t){O.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function gLe(e,t){O.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var xie=new h,yLe=new O;function xLe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.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=h.fromRadians(o.longitude,o.latitude,0,n,xie)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,xie)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=Z.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Et.eastNorthUpToFixedFrame(i,n,yLe);e._enuToModel=O.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=O.inverseTransformation(e._enuToModel,e._modelToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var _j=new Z,bLe=new fe;function TLe(e,t){Et.computeIcrfToCentralBodyFixedMatrix(t.time,_j);let n=Dx.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Z.multiplyByVector(_j,n,n),h.normalize(n,e._sunDirectionWC),n=Z.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Dx.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Z.multiplyByVector(_j,n,n),Z.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,bLe);i.project(r,e._sunPositionColumbusView)}DC.prototype.updateCamera=function(e){mLe(this,e.viewMatrix),pLe(this,e.inverseViewMatrix),xLe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof ln};DC.prototype.updateFrustum=function(e){_Le(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&gLe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.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};DC.prototype.updatePass=function(e){this._pass=e};var CLe=[],ALe=new wg;DC.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===ne.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),TLe(this,e);let n=e.light??ALe;n instanceof wg?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Z.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.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??CLe,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=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.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=Et.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,H.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function bie(e){if(e._viewportDirty){let t=e._viewport;O.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),O.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function ELe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?O.inverse(e._projection,e._inverseProjection):O.clone(O.ZERO,e._inverseProjection))}function SLe(e){e._modelViewDirty&&(e._modelViewDirty=!1,O.multiplyTransformation(e._view,e._model,e._modelView))}function vLe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,O.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function wLe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,O.inverse(e.modelView,e._inverseModelView))}function ILe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,O.inverse(e.modelView3D,e._inverseModelView3D))}function PLe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,O.multiply(e._projection,e._view,e._viewProjection))}function DLe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,O.inverse(e.viewProjection,e._inverseViewProjection))}function RLe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,O.multiply(e._projection,e.modelView,e._modelViewProjection))}function OLe(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 MLe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,O.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function LLe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,O.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function NLe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,O.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function FLe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;O.getMatrix3(e.inverseModelView,t),Z.transpose(t,t)}}function BLe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;O.getMatrix3(e.inverseModelView3D,t),Z.transpose(t,t)}}function kLe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;O.getMatrix3(e.modelView,t),Z.transpose(t,t)}}function ULe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;O.getMatrix3(e.modelView3D,t),Z.transpose(t,t)}}var Tie=new h;function Cie(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,O.multiplyByPoint(e.inverseModel,e._cameraPosition,Tie),Gn.fromCartesian(Tie,e._encodedCameraPositionMC))}var zLe=new h,VLe=new h,HLe=new h,GLe=new h,jLe=new fe,WLe=new h,qLe=new O;function YLe(e,t,n,i,o,r,s,a){let c=zLe;c.x=e.y,c.y=e.z,c.z=e.x;let u=VLe;u.x=n.y,u.y=n.z,u.z=n.x;let f=HLe;f.x=i.y,f.y=i.z,f.z=i.x;let d=GLe;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,jLe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let _=s.ellipsoid,m=_.cartographicToCartesian(p,WLe),y=Et.eastNorthUpToFixedFrame(m,_,qLe);return O.multiplyByPointAsVector(y,u,u),O.multiplyByPointAsVector(y,f,f),O.multiplyByPointAsVector(y,d,d),l(a)||(a=new O),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function gj(e){e._view3DDirty&&(e._mode===ne.SCENE3D?O.clone(e._view,e._view3D):YLe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),O.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Aie(e){e._inverseView3DDirty&&(O.inverseTransformation(e.view3D,e._inverseView3D),O.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var CN=DC;function Cf(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):XLe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Nn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new gN(this),this._textureCache=new xN;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Lt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Lt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Lt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Lt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Lt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Lt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Lt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Lt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Lt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Lt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Lt._minimumAliasedLineWidth=f[0],Lt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Lt._minimumAliasedPointSize=d[0],Lt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Lt._maximumViewportWidth=p[0],Lt._maximumViewportHeight=p[1];let _=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Lt._highpFloatSupported=_.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Lt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Cr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Cr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Cr(u,["OES_element_index_uint"]),this._depthTexture=!!Cr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Cr(u,["EXT_frag_depth"]),this._debugShaders=Cr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Cr(u,["OES_texture_float"]),this._textureHalfFloat=!!Cr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Cr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Cr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Cr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Cr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Cr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Cr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Cr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Cr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Cr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Cr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Cr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Cr(u,["EXT_texture_compression_bptc"]),fa.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?Cr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,Lt._maximumTextureFilterAnisotropy=l(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,b,T,C,A,S,w,R,D,M;if(c){let v=this;x=function(){return v._gl.createVertexArray()},b=function(I){v._gl.bindVertexArray(I)},T=function(I){v._gl.deleteVertexArray(I)},C=function(I,N,F,U,k){u.drawElementsInstanced(I,N,F,U,k)},A=function(I,N,F,U){u.drawArraysInstanced(I,N,F,U)},S=function(I,N){u.vertexAttribDivisor(I,N)},w=function(I){u.drawBuffers(I)}}else R=Cr(u,["OES_vertex_array_object"]),l(R)&&(x=function(){return R.createVertexArrayOES()},b=function(v){R.bindVertexArrayOES(v)},T=function(v){R.deleteVertexArrayOES(v)}),D=Cr(u,["ANGLE_instanced_arrays"]),l(D)&&(C=function(v,I,N,F,U){D.drawElementsInstancedANGLE(v,I,N,F,U)},A=function(v,I,N,F){D.drawArraysInstancedANGLE(v,I,N,F)},S=function(v,I){D.vertexAttribDivisorANGLE(v,I)}),M=Cr(u,["WEBGL_draw_buffers"]),l(M)&&(w=function(v){M.drawBuffersWEBGL(v)});this.glCreateVertexArray=x,this.glBindVertexArray=b,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=A,this.glVertexAttribDivisor=S,this.glDrawBuffers=w,this._vertexArrayObject=!!R,this._instancedArrays=!!D,this._drawBuffers=!!M,Lt._maximumDrawBuffers=this.drawBuffers?u.getParameter(q.MAX_DRAW_BUFFERS):1,Lt._maximumColorAttachments=this.drawBuffers?u.getParameter(q.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new H(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new CN,g=new Hc(this),E=ze.fromCache();this._defaultPassState=g,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=E,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<Lt._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ze.apply(u,E,g)}function XLe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new se("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 se("The browser supports WebGL, but initialization failed.");return r}function KLe(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 $Le(e,t,n,i){let o=`${KLe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function ZLe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new se($Le(e,t,n,i))}function QLe(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 JLe(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,QLe(e,o,t))}return i}function Cr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var eNe={};Object.defineProperties(Cf.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=JLe(this._originalGLContext,e?ZLe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new dt({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 dt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new dt({context:this,pixelFormat:je.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new fr({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 eNe}}});function Eie(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var yj;typeof WebGLRenderingContext<"u"&&(yj=[q.BACK]);function xj(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=yj;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var tNe=new ri;Cf.prototype.clear=function(e,t){e=e??tNe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(H.equals(this._clearColor,o)||(H.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;Eie(this,a,t,!0);let c=e.framebuffer??t.framebuffer;xj(this,c),n.clear(i)};function nNe(e,t,n,i,o){xj(e,t),Eie(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function iNe(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??O.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Cf.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,nNe(this,o,t,n,r),iNe(this,e,n,i)};Cf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=yj;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)};Cf.prototype.readPixels=function(e){let t=this._gl;e=e??G.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=He.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=je.createTypedArray(je.RGBA,a,o,r);return xj(this,s),t.readPixels(n,i,o,r,je.RGBA,He.toWebGLConstant(a,this),c),c};var Sie={position:0,textureCoordinates:1};Cf.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new lt({attributes:{position:new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Le.TRIANGLES});e=qn.fromGeometry({context:this,geometry:t,attributeLocations:Sie,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Cf.prototype.createViewportQuadCommand=function(e,t){return t=t??G.EMPTY_OBJECT,new qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Le.TRIANGLES,renderState:t.renderState,shaderProgram:Xt.fromCache({context:this,vertexShaderSource:bC,fragmentShaderSource:e,attributeLocations:Sie}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Cf.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function bj(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(bj.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});bj.prototype.destroy=function(){delete this._pickObjects[this.key]};Cf.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new se("Out of unique Pick IDs.");return this._pickObjects[t]=e,new bj(this._pickObjects,t,H.fromRgba(t))};Cf.prototype.isDestroyed=function(){return!1};Cf.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(),ce(this)};var AN=Cf;function RC(e){e=e??G.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 he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Zr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Zr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}RC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};RC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};RC.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)};RC.prototype.isDestroyed=function(){return!1};RC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ce(this)};var EN=RC;var Ol={RGBA4:q.RGBA4,RGBA8:q.RGBA8,RGBA16F:q.RGBA16F,RGBA32F:q.RGBA32F,RGB5_A1:q.RGB5_A1,RGB565:q.RGB565,DEPTH_COMPONENT16:q.DEPTH_COMPONENT16,STENCIL_INDEX8:q.STENCIL_INDEX8,DEPTH_STENCIL:q.DEPTH_STENCIL,DEPTH24_STENCIL8:q.DEPTH24_STENCIL8,validate:function(e){return e===Ol.RGBA4||e===Ol.RGBA8||e===Ol.RGBA16F||e===Ol.RGBA32F||e===Ol.RGB5_A1||e===Ol.RGB565||e===Ol.DEPTH_COMPONENT16||e===Ol.STENCIL_INDEX8||e===Ol.DEPTH_STENCIL||e===Ol.DEPTH24_STENCIL8},getColorFormat:function(e){return e===q.FLOAT?Ol.RGBA32F:e===q.HALF_FLOAT_OES?Ol.RGBA16F:Ol.RGBA8}},Ml=Object.freeze(Ol);function gw(e){e=e??G.EMPTY_OBJECT;let n=e.context._gl,i=Lt.maximumRenderbufferSize,o=e.format??Ml.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(gw.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});gw.prototype._getRenderbuffer=function(){return this._renderbuffer};gw.prototype.isDestroyed=function(){return!1};gw.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ce(this)};var Af=gw;function Rs(e){e=e??G.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(Rs.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}}});Rs.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])};Rs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??He.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??je.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new dt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:zt.NEAREST}),this._numSamples>1){let a=Ml.getColorFormat(o);this._colorRenderbuffers[s]=new Af({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new dt({context:e,width:t,height:n,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Af({context:e,width:t,height:n,format:Ml.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Af({context:e,width:t,height:n,format:Ml.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new dt({context:e,width:t,height:n,pixelFormat:je.DEPTH_COMPONENT,pixelDatatype:He.UNSIGNED_INT,sampler:zt.NEAREST}):this._depthRenderbuffer=new Af({context:e,width:t,height:n,format:Ml.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new EN({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 Zr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Rs.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};Rs.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Rs.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};Rs.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Rs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Rs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Rs.prototype.getDepthTexture=function(){return this._depthTexture};Rs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Rs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Rs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Rs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Rs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Rs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Rs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Rs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Rs.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var bi=Rs;function oNe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ee.createIfNeeded(t.positiveX).fetchImage(i),Ee.createIfNeeded(t.negativeX).fetchImage(i),Ee.createIfNeeded(t.positiveY).fetchImage(i),Ee.createIfNeeded(t.negativeY).fetchImage(i),Ee.createIfNeeded(t.positiveZ).fetchImage(i),Ee.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new fr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var SN=oNe;var Rx={VERTEX:0,FRAGMENT:1,BOTH:2};Rx.includesVertexShader=function(e){return e===Rx.VERTEX||e===Rx.BOTH};Rx.includesFragmentShader=function(e){return e===Rx.FRAGMENT||e===Rx.BOTH};var pe=Object.freeze(Rx);function Tj(e){this.name=e,this.fields=[]}Tj.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};Tj.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var vN=Tj;function Cj(e){this.signature=e,this.body=[]}Cj.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}`)};Cj.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var wN=Cj;function Gc(){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(Gc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Gc.prototype.addDefine=function(e,t,n){n=n??pe.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),pe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Gc.prototype.addStruct=function(e,t,n){this._structs[e]=new vN(t),pe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Gc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Gc.prototype.addFunction=function(e,t,n){this._functions[e]=new wN(t),pe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Gc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Gc.prototype.addUniform=function(e,t,n){n=n??pe.BOTH;let i=`uniform ${e} ${t};`;pe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Gc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Gc.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+=sNe(e),i};Gc.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}`)};Gc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Gc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Gc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=rNe(this),i=aNe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),r=new Be({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Be({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Xt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Gc.prototype.clone=function(){return Fe(this,!0)};function rNe(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 sNe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function aNe(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 OC=Gc;function Ox(e){e=e??G.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=je.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new zt}=e;if(!t.webgl2)throw new he("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===je.RGB||i===je.LUMINANCE,p=je.toInternalFormat(i,o,t),_=je.isCompressedFormat(p),m=t._gl,y=je.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??Nn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,vie(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new he("For Texture3D, options.source.arrayBufferView must be defined");cNe(this,n),this._initialized=!0}else lNe(this);m.bindTexture(this._textureTarget,null)}function cNe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=je.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:_}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(o,m,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,u,He.toWebGLConstant(f,n),_),m>1){let y=s,x=a,b=c;for(let T=0;T<t.mipLevels.length;++T)y=Aj(y),x=Aj(x),b=Aj(b),i.texSubImage3D(o,T+1,0,0,0,y,x,b,u,He.toWebGLConstant(f,n),t.mipLevels[T])}}function Aj(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function lNe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}Ox.create=function(e){return new Ox(e)};Object.defineProperties(Ox.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){vie(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function vie(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?ft.NEAREST_MIPMAP_NEAREST:ft.NEAREST,i=Kn.NEAREST),je.isDepthFormat(s)&&(n=ft.NEAREST,i=Kn.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Ox.prototype.generateMipmap=function(e){e=e??Fd.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)};Ox.prototype.isDestroyed=function(){return!1};Ox.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ce(this)};var wie=Ox;function yw({x:e,y:t,width:n,height:i}){this.rectangle=new Xe(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function Ej({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new yw({x:n,y:n,width:e-2*n,height:t-2*n})}Ej.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};Ej.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 yw({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new yw({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new yw({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new yw({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 xw=Ej;var Iie=16;function Ll(e){e=e??G.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new V(Iie,Iie);this._pixelFormat=e.pixelFormat??je.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Nn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Ll.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}}});Ll.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new Xe),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/o,t.y=u/r,t.width=s/o,t.height=a/r,t};Ll.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new dt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,u=this._texture,f=new Zr({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let _=0;_<d.length;++_){let m=i[_],y=d[_];if(!l(m)||!l(y)||l(p.get(_)))continue;let{x,y:b,width:T,height:C}=m;a.copyTexSubImage2D(c,0,x,b,y.x,y.y,T,C)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};Ll.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,c=this._subRegions,u=i.map((T,C)=>new Pie({index:C,image:T})).filter((T,C)=>l(T.image)&&!l(c.get(C))),f=0,d=0,p=0;for(let T=t;T<o.length;++T){let{width:C,height:A}=o[T].image;f=Math.max(f,C),d=Math.max(d,A),p+=C*A,u.push(o[T])}s=Math.max(f,s),a=Math.max(d,a),e.webgl2||(s=P.nextPowerOfTwo(s),a=P.nextPowerOfTwo(a));let _=p,m=1;for(;_/s/a>=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:T},{image:C})=>C.height*C.width-T.height*T.width);let y=new Array(this._nextIndex);for(let T of this._subRegions.keys())l(c.get(T))&&(y[T]=i[T]);let x,b=!1;for(;!b;){x=new xw({height:a,width:s,borderPadding:n});let T;for(T=0;T<u.length;++T){let{index:C,image:A}=u[T];if(!l(A))continue;let S=x.pack(C,A);if(!l(S)){s>a?a*=2:s*=2;break}y[C]=S.rectangle}b=T===u.length}this._texturePacker=x,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=Nn()};Ll.prototype.getImageIndex=function(e){return this._indexById.get(e)};Ll.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 Pie({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Ll.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Pie({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Ll.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};Ll.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 dt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new xw({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function uNe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Ee)&&(e=Ee.createIfNeeded(e).fetchImage()),e}Ll.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 uNe(t,e),this.isDestroyed()||!l(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Ll.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new se(`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})};Ll.prototype.isDestroyed=function(){return!1};Ll.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ce(this)};var MC=Ll;function qs(e,t,n,i){let o=qs._verifyAttributes(t);n=n??0;let r=[],s={},a,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return K.getSizeInBytes(p.componentDatatype)-K.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=qs._vertexSizeInBytes(a),p=a[0].usage,_={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:qs._createArrayViews(a,d)};this._allBuffers.push(_)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}qs._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??K.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Ne.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};qs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*K.getSizeInBytes(a.componentDatatype)}let i=n>0?K.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};qs._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/K.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*K.getSizeInBytes(a)}return n};qs.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];qs._resize(o,this._size),qs._appendWriters(this.writers,o)}Sj(this)};qs._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=K.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var fNe=[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}}];qs._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]=fNe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};qs.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=dNe(this,i)||t;if(t||!l(this.va)){Sj(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*a);qs._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new qn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function dNe(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=st.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}qs._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})}};qs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)hNe(n[i],e,t)};function hNe(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)}}qs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Sj(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}qs.prototype.isDestroyed=function(){return!1};qs.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 Sj(this),ce(this)};var Ig=qs;function Pg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new me,this.setValue(e)}Object.defineProperties(Pg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Pg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Pg.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))}};Pg.prototype.equals=function(e){return this===e||e instanceof Pg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Pg.prototype.valueOf=function(){return this._value};Pg.prototype.toString=function(){return String(this._value)};var Qn=Pg;function mNe(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 pNe(e){return new Qn(e)}function _Ne(e,t,n){return mNe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??pNe)}var ue=_Ne;function bw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(bw.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")});bw.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 bw(this)};bw.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 jc=bw;function Mx(){this._array=[],this._hash={}}Object.defineProperties(Mx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Mx.prototype.contains=function(e){return l(this._hash[e])};Mx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Mx.prototype.get=function(e){return this._hash[e]};Mx.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};Mx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var It=Mx;function yu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(yu.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}}});yu.packedLength=2;yu.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};yu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new yu),n.near=e[t++],n.far=e[t],n};yu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};yu.clone=function(e,t){if(l(e))return l(t)||(t=new yu),t.near=e.near,t.far=e.far,t};yu.prototype.clone=function(e){return yu.clone(this,e)};yu.prototype.equals=function(e){return yu.equals(this,e)};var Mt=yu;function Ef(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Ef.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 Ef(e.near,e.nearValue,e.far,e.farValue)};Ef.packedLength=4;Ef.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};Ef.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ef),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Ef.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};Ef.prototype.clone=function(e){return Ef.clone(this,e)};Ef.prototype.equals=function(e){return Ef.equals(this,e)};var Vt=Ef;var Lx={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},$e=Object.freeze(Lx);function Sf(e){return e===Lx.CLAMP_TO_GROUND||e===Lx.CLAMP_TO_3D_TILE||e===Lx.CLAMP_TO_TERRAIN}function LC(e){return e===Lx.RELATIVE_TO_GROUND||e===Lx.RELATIVE_TO_3D_TILE||e===Lx.RELATIVE_TO_TERRAIN}var gNe={CENTER:0,LEFT:1,RIGHT:-1},Ei=Object.freeze(gNe);var yNe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Bn=Object.freeze(yNe);var xNe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),ut=xNe;function Ud(){he.throwInstantiationError()}Object.defineProperties(Ud.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});Ud.prototype.getValue=he.throwInstantiationError;Ud.prototype.equals=he.throwInstantiationError;Ud.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Ud.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(!Ud.equals(e[i],t[i]))return!1;return!0};Ud.isConstant=function(e){return!l(e)||e.isConstant};Ud.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Ud.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Ud.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var X=Ud;var bNe={LEFT:-1,NONE:0,RIGHT:1},Jr=Object.freeze(bNe);var TNe=H.WHITE,CNe=h.ZERO,ANe=$e.NONE,ENe=V.ZERO,SNe=1,vNe=0,wNe=h.ZERO,INe=Ei.CENTER,PNe=Bn.CENTER,DNe=!1,RNe=Jr.NONE,ONe=new h,MNe=new H,LNe=new h,NNe=new V,FNe=new Vt,BNe=new Vt,kNe=new Vt,UNe=new Xe,zNe=new Mt;function Die(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Dg(e,t){t.collectionChanged.addEventListener(Dg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}Dg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,ONe),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){vj(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,r.textureValue!==c&&(u.image=c,r.textureValue=c),u.position=d,u.color=X.getValueOrDefault(a._color,e,TNe,MNe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,CNe,LNe),u.heightReference=X.getValueOrDefault(a._heightReference,e,ANe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,ENe,NNe),u.scale=X.getValueOrDefault(a._scale,e,SNe),u.rotation=X.getValueOrDefault(a._rotation,e,vNe),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,wNe),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,INe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,PNe),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,FNe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,BNe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,kNe),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,DNe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,zNe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,RNe);let p=X.getValueOrUndefined(a._imageSubRegion,e,UNe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};Dg.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===$e.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};Dg.prototype.isDestroyed=function(){return!1};Dg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ce(this)};Dg.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 Die(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 Die(r)):(vj(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],vj(s.get(r.id),r,a),s.remove(r.id)};function vj(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var IN=Dg;var VNe=new h;function im(e){e=e??G.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}im.fromDimensions=function(e){e=e??G.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new im({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};im.fromAxisAlignedBoundingBox=function(e){return new im({minimum:e.minimum,maximum:e.maximum})};im.packedLength=2*h.packedLength+1;im.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Oie=new h,Mie=new h,Rie={minimum:Oie,maximum:Mie,offsetAttribute:void 0};im.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Oie),o=h.unpack(e,t+h.packedLength,Mie),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Rie.offsetAttribute=r===-1?void 0:r,new im(Rie))};im.createGeometry=function(e){let t=e._min,n=e._max;if(h.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 we({componentDatatype:K.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=h.subtract(n,t,VNe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===cn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new lt({attributes:i,indices:o,primitiveType:Le.LINES,boundingSphere:new re(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var om=im;function NC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([H.floatToByte(e),H.floatToByte(t),H.floatToByte(n),H.floatToByte(i)])}Object.defineProperties(NC.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});NC.fromColor=function(e){return new NC(e.red,e.green,e.blue,e.alpha)};NC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};NC.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 Yt=NC;function Tw(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(Tw.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});Tw.fromDistanceDisplayCondition=function(e){return new Tw(e.near,e.far)};Tw.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Un=Tw;function HNe(e){e=e??G.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Pt=HNe;function Zo(e){e=e??G.EMPTY_OBJECT,this.start=l(e.start)?$.clone(e.start):new $,this.stop=l(e.stop)?$.clone(e.stop):new $,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Zo.prototype,{isEmpty:{get:function(){let e=$.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var FC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Zo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=$.fromIso8601(n[0]),o=$.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):(FC.start=i,FC.stop=o,FC.isStartIncluded=r,FC.isStopIncluded=s,FC.data=a,new Zo(FC))};Zo.toIso8601=function(e,t){return`${$.toIso8601(e.start,t)}/${$.toIso8601(e.stop,t)}`};Zo.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 Zo(e)};Zo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equals(e.start,t.start)&&$.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Zo.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&&$.equalsEpsilon(e.start,t.start,n)&&$.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Zo.intersect=function(e,t,n,i){if(!l(t))return Zo.clone(Zo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=$.greaterThanOrEquals(s,o)&&$.greaterThanOrEquals(r,s),u=!c&&$.lessThanOrEquals(s,o)&&$.lessThanOrEquals(o,a);if(!c&&!u)return Zo.clone(Zo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,_=t.isStopIncluded,m=$.lessThan(r,a);return l(n)||(n=new Zo),n.start=c?s:o,n.isStartIncluded=f&&p||!$.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?d:d&&_||!$.equals(a,r)&&_,n.data=l(i)?i(e.data,t.data):e.data,n};Zo.contains=function(e,t){if(e.isEmpty)return!1;let n=$.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=$.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Zo.prototype.clone=function(e){return Zo.clone(this,e)};Zo.prototype.equals=function(e,t){return Zo.equals(this,e,t)};Zo.prototype.equalsEpsilon=function(e,t,n){return Zo.equalsEpsilon(this,e,t,n)};Zo.prototype.toString=function(){return Zo.toIso8601(this)};Zo.EMPTY=Object.freeze(new Zo({start:new $,stop:new $,isStartIncluded:!1,isStopIncluded:!1}));var Sn=Zo;var Lie=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),Nie=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),GNe=Object.freeze(new Sn({start:Lie,stop:Nie})),jNe={MINIMUM_VALUE:Lie,MAXIMUM_VALUE:Nie,MAXIMUM_INTERVAL:GNe},Ge=jNe;function Cw(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(Cw.prototype,{componentDatatype:{get:function(){return K.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});Cw.fromCartesian3=function(e){return new Cw(e.x,e.y,e.z)};Cw.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 ro=Cw;function PN(e){e=e??!0,this.value=PN.toValue(e)}Object.defineProperties(PN.prototype,{componentDatatype:{get:function(){return K.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});PN.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var bn=PN;var DN=`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 RN=`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 ON=`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 MN=`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 LN=`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 NN=`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 WNe={ADD:q.FUNC_ADD,SUBTRACT:q.FUNC_SUBTRACT,REVERSE_SUBTRACT:q.FUNC_REVERSE_SUBTRACT,MIN:q.MIN,MAX:q.MAX},pc=Object.freeze(WNe);var qNe={ZERO:q.ZERO,ONE:q.ONE,SOURCE_COLOR:q.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:q.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:q.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:q.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:q.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:q.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:q.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:q.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:q.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:q.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:q.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:q.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:q.SRC_ALPHA_SATURATE},Oo=Object.freeze(qNe);var YNe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.SOURCE_ALPHA,functionSourceAlpha:Oo.ONE,functionDestinationRgb:Oo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Oo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.ONE,functionSourceAlpha:Oo.ONE,functionDestinationRgb:Oo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Oo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.SOURCE_ALPHA,functionSourceAlpha:Oo.ONE,functionDestinationRgb:Oo.ONE,functionDestinationAlpha:Oo.ONE})},fn=Object.freeze(YNe);var XNe={FRONT:q.FRONT,BACK:q.BACK,FRONT_AND_BACK:q.FRONT_AND_BACK},Si=Object.freeze(XNe);function BC(e){e=e??G.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(BC.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}}});BC.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(` -`)};BC.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};BC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Fe(this.renderState,!1);return e?(t.depthMask=!1,t.blending=fn.ALPHA_BLEND):t.depthMask=!0,t};BC.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:Si.BACK}),l(n)&&(i=ct(n,i,!0)),i};var lo=BC;var FN=`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 BN=`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 kN=`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 UN=`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 zN=`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 VN=`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 HN=`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 GN=`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 jN=`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 WN=`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 qN=`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 YN=`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 XN=`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 KN=`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 $N=`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 ZN=`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 QN=`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 JN=`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 eF=`// 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 We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??ft.LINEAR,this._magnificationFilter=e.magnificationFilter??Kn.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,KNe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.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};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new dt({context:e,source:u,sampler:d});let _=this._textures[n];l(_)&&_!==this._defaultTexture&&_.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];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 u=c.images,f=new fr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.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 ce(this)};function KNe(e,t){e=e??G.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Fe(e.fabric??G.EMPTY_OBJECT),t._template.uniforms=Fe(t._template.uniforms??G.EMPTY_OBJECT),t._template.materials=Fe(t._template.materials??G.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Nn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Fe(i.fabric,!0);t._template=ct(t._template,r,!0),n=i.translucent}JNe(t),l(i)||We._materialCache.addMaterial(t.type,t),tFe(t),rFe(t),aFe(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 wj(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 Fie(e,t){}function $Ne(e,t){}var ZNe=["type","materials","uniforms","components","source"],QNe=["diffuse","specular","shininess","normal","emission","alpha"];function JNe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;wj(t,ZNe,Fie,!0),wj(o,QNe,Fie,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);wj(n,r,$Ne,!1)}function eFe(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 tFe(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&&eFe(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 Bie={mat2:ti,mat3:Z,mat4:O},nFe=/\.ktx2$/i;function iFe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new zt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new dt({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 dt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof Ee;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:Ee.createIfNeeded(r),_;nFe.test(p.url)?_=fa(p.url):_=p.fetchImage(),Promise.resolve(_).then(function(m){n._loadedImages.push({id:e,image:m})}).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 oFe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof fr){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===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ee.createIfNeeded(i.positiveX).fetchImage(),Ee.createIfNeeded(i.negativeX).fetchImage(),Ee.createIfNeeded(i.positiveY).fetchImage(),Ee.createIfNeeded(i.negativeY).fetchImage(),Ee.createIfNeeded(i.positiveZ).fetchImage(),Ee.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function rFe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&kie(e,n)}function kie(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=sFe(o),s;if(r==="channels")s=Aw(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;cFe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},kie(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=Aw(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(iFe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(oFe(t));else if(r.indexOf("mat")!==-1){let u=new Bie[r];e._uniforms[c]=function(){return Bie[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function sFe(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 Ee||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.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 aFe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=ct(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;Aw(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=Aw(e,i,a)}}function Aw(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function cFe(e,t,n){return Aw(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new H(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new V(1,1),color:new H(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}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new V(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new V(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new V(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new V(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new V(1,1)},source:BN},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new V(1,1)},source:WN},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new H(0,1,0,1),cellAlpha:.1,lineCount:new V(8,8),lineThickness:new V(1,1),lineOffset:new V(0,0)},source:jN},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new H(1,1,1,.5),oddColor:new H(0,0,1,.5),offset:0,repeat:5},source:QN},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new H(1,1,1,.5),darkColor:new H(0,0,0,.5),repeat:new V(5,5)},source:kN},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new H(1,1,0,.75),darkColor:new H(0,1,1,.75),repeat:new V(5,5)},source:UN},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new H(.2,.3,.6,1),blendColor:new H(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:eF},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new H(1,0,0,.7),rimColor:new H(1,1,1,.4),width:.3},source:$N},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new H(1,0,0,1),fadeOutColor:new H(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new V(.5,.5)},source:GN},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new H(1,1,1,1)},source:qN},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new H(1,0,1,1),gapColor:new H(0,0,0,0),dashLength:16,dashPattern:255},source:YN},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new H(0,.5,1,1),glowPower:.25,taperPower:1},source:XN},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new H(1,1,1,1),outlineColor:new H(1,0,0,1),outlineWidth:1},source:KN},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new H(1,0,0,1),width:1},source:VN},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:HN},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:ZN},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:FN},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:zN},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:JN,uniforms:{waterColor:new H(1,1,1,1),landColor:new H(0,0,0,0)}},translucent:!1});var Ji=We;function Nx(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Nx.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=lo.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(Nx.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}}});Nx.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;Nx.prototype.isTranslucent=lo.prototype.isTranslucent;Nx.prototype.getRenderState=lo.prototype.getRenderState;Nx.MaterialSupport={BASIC:Object.freeze({vertexFormat:De.POSITION_AND_NORMAL,vertexShaderSource:MN,fragmentShaderSource:ON}),TEXTURED:Object.freeze({vertexFormat:De.POSITION_NORMAL_AND_ST,vertexShaderSource:NN,fragmentShaderSource:LN}),ALL:Object.freeze({vertexFormat:De.ALL,vertexShaderSource:RN,fragmentShaderSource:DN})};var mo=Nx;var tF=`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 nF=`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 kC=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var iF=`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 Vp(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?iF:nF,r=i?kC:tF,s=i?Vp.FLAT_VERTEX_FORMAT:Vp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=lo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Vp.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}}});Vp.VERTEX_FORMAT=De.POSITION_AND_NORMAL;Vp.FLAT_VERTEX_FORMAT=De.POSITION_ONLY;Vp.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;Vp.prototype.isTranslucent=lo.prototype.isTranslucent;Vp.prototype.getRenderState=lo.prototype.getRenderState;var un=Vp;function UC(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(UC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});UC.prototype.getType=function(e){return"Color"};var lFe=new $;UC.prototype.getValue=function(e,t){return l(e)||(e=$.now(lFe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};UC.prototype.equals=function(e){return this===e||e instanceof UC&&X.equals(this._color,e._color)};var Wt=UC;function Rg(e){e=e??G.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._rectangle=e.rectangle??ae.MAX_VALUE,this._projection=new Fi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Rg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Rg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Rg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Rg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ae(n,i,o,r)};Rg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};Rg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,d=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new ae(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};Rg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.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+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new V(u,f)};var vi=Rg;var Uie=new h,zie=new h,Vie=new fe,Ij=new h,uFe=new h,Hie=new re,fFe=new vi,Ew=[new fe,new fe,new fe,new fe],Sw=new V,es={};es.initialize=function(){let e=es._initPromise;return l(e)||(e=Ee.fetchJson(on("Assets/approximateTerrainHeights.json")).then(function(t){es._terrainHeights=t}),es._initPromise=e),e};es.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=Gie(e),i=es._defaultMinTerrainHeight,o=es._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=es._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ae.northeast(e,Vie),Uie),t.cartographicToCartesian(ae.southwest(e,Vie),zie),h.midpoint(zie,Uie,Ij);let a=t.scaleToGeodeticSurface(Ij,uFe);if(l(a)){let c=h.distance(Ij,a);i=Math.min(i,-c)}else i=es._defaultMinTerrainHeight}return i=Math.max(es._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};es.getBoundingSphere=function(e,t){t=t??te.default;let n=Gie(e),i=es._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=es._terrainHeights[r];l(s)&&(i=s[1])}let o=re.fromRectangle3D(e,t,0);return re.fromRectangle3D(e,t,i,Hie),re.union(o,Hie,o)};function Gie(e){fe.fromRadians(e.east,e.north,0,Ew[0]),fe.fromRadians(e.west,e.north,0,Ew[1]),fe.fromRadians(e.east,e.south,0,Ew[2]),fe.fromRadians(e.west,e.south,0,Ew[3]);let t=0,n=0,i=0,o=0,r=es._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=Ew[c];if(fFe.positionToTileXY(u,s,Sw),c===0)i=Sw.x,o=Sw.y;else if(i!==Sw.x||o!==Sw.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}}es._terrainHeightsMaxLevel=6;es._defaultMaxTerrainHeight=9e3;es._defaultMinTerrainHeight=-1e5;es._terrainHeights=void 0;es._initPromise=void 0;Object.defineProperties(es,{initialized:{get:function(){return l(es._terrainHeights)}}});var mi=es;function Wc(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Wc.fromCorners=function(e,t,n){return l(n)||(n=new Wc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Wc.fromPoints=function(e,t){if(l(t)||(t=new Wc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.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 d=1;d<c;d++){let p=e[d],_=p.x,m=p.y,y=p.z;n=Math.min(_,n),r=Math.max(_,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Wc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Wc(e.minimum,e.maximum,e.center)};Wc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var oF=new h;Wc.intersectPlane=function(e,t){oF=h.subtract(e.maximum,e.minimum,oF);let n=h.multiplyByScalar(oF,.5,oF),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?Gt.INSIDE:r+o<0?Gt.OUTSIDE:Gt.INTERSECTING};Wc.prototype.clone=function(e){return Wc.clone(this,e)};Wc.prototype.intersectPlane=function(e){return Wc.intersectPlane(this,e)};Wc.prototype.equals=function(e){return Wc.equals(this,e)};var Fx=Wc;var Pj=new ie;function rm(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=Et.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(O.getColumn(n,0,Pj)),this._yAxis=h.fromCartesian4(O.getColumn(n,1,Pj));let i=h.fromCartesian4(O.getColumn(n,2,Pj));this._plane=en.fromPointNormal(e,i)}Object.defineProperties(rm.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 dFe=new Fx;rm.fromPoints=function(e,t){let n=Fx.fromPoints(e,dFe);return new rm(n.center,t)};var jie=new gn,rF=new h;rm.prototype.projectPointOntoPlane=function(e,t){let n=jie;n.origin=e,h.normalize(e,n.direction);let i=ni.rayPlane(n,this._plane,rF);if(l(i)||(h.negate(n.direction,n.direction),i=ni.rayPlane(n,this._plane,rF)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new V(r,s)}};rm.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};rm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new V);let n=jie;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ni.rayPlane(n,this._plane,rF);l(i)||(h.negate(n.direction,n.direction),i=ni.rayPlane(n,this._plane,rF));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};rm.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 hFe=new h;rm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=hFe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};rm.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 fs=rm;function Bi(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=Z.clone(t??Z.ZERO)}Bi.packedLength=h.packedLength+Z.packedLength;Bi.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),Z.pack(e.halfAxes,t,n+h.packedLength),t};Bi.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Bi),h.unpack(e,t,n.center),Z.unpack(e,t+h.packedLength,n.halfAxes),n};var mFe=new h,pFe=new h,_Fe=new h,gFe=new h,yFe=new h,xFe=new h,bFe=new Z,TFe={unitary:new Z,diagonal:new Z};Bi.fromPoints=function(e,t){if(l(t)||(t=new Bi),!l(e)||e.length===0)return t.halfAxes=Z.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],mFe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,pFe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,d*=r;let _=bFe;_[0]=s,_[1]=a,_[2]=c,_[3]=a,_[4]=u,_[5]=f,_[6]=c,_[7]=f,_[8]=d;let m=Z.computeEigenDecomposition(_,TFe),y=Z.clone(m.unitary,t.halfAxes),x=Z.getColumn(y,0,gFe),b=Z.getColumn(y,1,yFe),T=Z.getColumn(y,2,xFe),C=-Number.MAX_VALUE,A=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=Number.MAX_VALUE,R=Number.MAX_VALUE,D=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],C=Math.max(h.dot(x,p),C),A=Math.max(h.dot(b,p),A),S=Math.max(h.dot(T,p),S),w=Math.min(h.dot(x,p),w),R=Math.min(h.dot(b,p),R),D=Math.min(h.dot(T,p),D);x=h.multiplyByScalar(x,.5*(w+C),x),b=h.multiplyByScalar(b,.5*(R+A),b),T=h.multiplyByScalar(T,.5*(D+S),T);let M=h.add(x,b,t.center);h.add(M,T,M);let L=_Fe;return L.x=C-w,L.y=A-R,L.z=S-D,h.multiplyByScalar(L,.5,L),Z.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var $ie=new h,CFe=new h;function Wie(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Bi);let d=f.halfAxes;Z.setColumn(d,0,t,d),Z.setColumn(d,1,n,d),Z.setColumn(d,2,i,d);let p=$ie;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let _=CFe;_.x=(r-o)/2,_.y=(a-s)/2,_.z=(u-c)/2;let m=f.center;return p=Z.multiplyByVector(d,p,p),h.add(e,p,m),Z.multiplyByScale(d,_,d),f}var qie=new fe,AFe=new h,EFe=new fe,SFe=new fe,vFe=new fe,wFe=new fe,IFe=new fe,PFe=new h,Yie=new h,DFe=new h,Xie=new h,RFe=new h,OFe=new V,MFe=new V,LFe=new V,NFe=new V,FFe=new V,BFe=new h,kFe=new h,UFe=new h,zFe=new h,VFe=new V,HFe=new h,GFe=new h,jFe=new h,WFe=new en(h.UNIT_X,0);Bi.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,s,a,c,u,f,d;if(e.width<=P.PI){let R=ae.center(e,qie),D=i.cartographicToCartesian(R,AFe),M=new fs(D,i);d=M.plane;let L=R.longitude,g=e.south<0&&e.north>0?0:R.latitude,E=fe.fromRadians(L,e.north,n,EFe),v=fe.fromRadians(e.west,e.north,n,SFe),I=fe.fromRadians(e.west,g,n,vFe),N=fe.fromRadians(e.west,e.south,n,wFe),F=fe.fromRadians(L,e.south,n,IFe),U=i.cartographicToCartesian(E,PFe),k=i.cartographicToCartesian(v,Yie),z=i.cartographicToCartesian(I,DFe),B=i.cartographicToCartesian(N,Xie),j=i.cartographicToCartesian(F,RFe),W=M.projectPointToNearestOnPlane(U,OFe),J=M.projectPointToNearestOnPlane(k,MFe),Y=M.projectPointToNearestOnPlane(z,LFe),ee=M.projectPointToNearestOnPlane(B,NFe),Q=M.projectPointToNearestOnPlane(j,FFe);return r=Math.min(J.x,Y.x,ee.x),s=-r,c=Math.max(J.y,W.y),a=Math.min(ee.y,Q.y),v.height=N.height=t,k=i.cartographicToCartesian(v,Yie),B=i.cartographicToCartesian(N,Xie),u=Math.min(en.getPointDistance(d,k),en.getPointDistance(d,B)),f=n,Wie(M.origin,M.xAxis,M.yAxis,M.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,_=e.north<0,m=p?e.south:_?e.north:0,y=ae.center(e,qie).longitude,x=h.fromRadians(y,m,n,i,BFe);x.z=0;let T=Math.abs(x.x)<P.EPSILON10&&Math.abs(x.y)<P.EPSILON10?h.UNIT_X:h.normalize(x,kFe),C=h.UNIT_Z,A=h.cross(T,C,UFe);d=en.fromPointNormal(x,T,WFe);let S=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,zFe);s=h.dot(en.projectPointOntoPlane(d,S,VFe),A),r=-s,c=h.fromRadians(0,e.north,_?t:n,i,HFe).z,a=h.fromRadians(0,e.south,p?t:n,i,GFe).z;let w=h.fromRadians(e.east,m,n,i,jFe);return u=en.getPointDistance(d,w),f=0,Wie(x,A,C,T,r,s,a,c,u,f,o)};Bi.fromTransformation=function(e,t){return l(t)||(t=new Bi),t.center=O.getTranslation(e,t.center),t.halfAxes=O.getMatrix3(e,t.halfAxes),t.halfAxes=Z.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Bi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),Z.clone(e.halfAxes,t.halfAxes),t):new Bi(e.center,e.halfAxes)};Bi.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[Z.COLUMN0ROW0]+s*o[Z.COLUMN0ROW1]+a*o[Z.COLUMN0ROW2])+Math.abs(r*o[Z.COLUMN1ROW0]+s*o[Z.COLUMN1ROW1]+a*o[Z.COLUMN1ROW2])+Math.abs(r*o[Z.COLUMN2ROW0]+s*o[Z.COLUMN2ROW1]+a*o[Z.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?Gt.OUTSIDE:u>=c?Gt.INSIDE:Gt.INTERSECTING};var Zie=new h,Qie=new h,Jie=new h,qFe=new h,Kie=new h,YFe=new h;Bi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,$ie),i=e.halfAxes,o=Z.getColumn(i,0,Zie),r=Z.getColumn(i,1,Qie),s=Z.getColumn(i,2,Jie),a=h.magnitude(o),c=h.magnitude(r),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(o,a,o):f=!1,c>0?h.divideByScalar(r,c,r):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let _=!f+!d+!p,m,y,x;if(_===1){let A=o;m=r,y=s,d?p||(A=s,y=o):(A=r,m=o),x=h.cross(m,y,Kie),A===o?o=x:A===r?r=x:A===s&&(s=x)}else if(_===2){m=o,d?m=r:p&&(m=s);let A=h.UNIT_Y;A.equalsEpsilon(m,P.EPSILON3)&&(A=h.UNIT_X),y=h.cross(m,A,qFe),h.normalize(y,y),x=h.cross(m,y,Kie),h.normalize(x,x),m===o?(r=y,s=x):m===r?(s=y,o=x):m===s&&(o=y,r=x)}else _===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let b=YFe;b.x=h.dot(n,o),b.y=h.dot(n,r),b.z=h.dot(n,s);let T=0,C;return b.x<-a?(C=b.x+a,T+=C*C):b.x>a&&(C=b.x-a,T+=C*C),b.y<-c?(C=b.y+c,T+=C*C):b.y>c&&(C=b.y-c,T+=C*C),b.z<-u?(C=b.z+u,T+=C*C):b.z>u&&(C=b.z-u,T+=C*C),T};var XFe=new h,KFe=new h;Bi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new hc);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=Z.getColumn(a,0,Zie),u=Z.getColumn(a,1,Qie),f=Z.getColumn(a,2,Jie),d=h.add(c,u,XFe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,KFe),_=h.dot(n,p);return o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),_=h.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),i.start=o,i.stop=r,i};var $Fe=new h,ZFe=new h,QFe=new h;Bi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=Z.getColumn(i,0,$Fe),r=Z.getColumn(i,1,ZFe),s=Z.getColumn(i,2,QFe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var JFe=new Z;Bi.computeTransformation=function(e,t){l(t)||(t=new O);let n=e.center,i=Z.multiplyByUniformScale(e.halfAxes,2,JFe);return O.fromRotationTranslation(i,n,t)};var e2e=new re;Bi.isOccluded=function(e,t){let n=re.fromOrientedBoundingBox(e,e2e);return!t.isBoundingSphereVisible(n)};Bi.prototype.intersectPlane=function(e){return Bi.intersectPlane(this,e)};Bi.prototype.distanceSquaredTo=function(e){return Bi.distanceSquaredTo(this,e)};Bi.prototype.computePlaneDistances=function(e,t,n){return Bi.computePlaneDistances(this,e,t,n)};Bi.prototype.computeCorners=function(e){return Bi.computeCorners(this,e)};Bi.prototype.computeTransformation=function(e){return Bi.computeTransformation(this,e)};Bi.prototype.isOccluded=function(e){return Bi.isOccluded(this,e)};Bi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&Z.equals(e.halfAxes,t.halfAxes)};Bi.prototype.clone=function(e){return Bi.clone(this,e)};Bi.prototype.equals=function(e){return Bi.equals(this,e)};var Pn=Bi;var sF={};sF.getHeight=function(e,t,n){return(e-n)*t+n};var t2e=new fe;sF.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,t2e);if(!l(r))return h.clone(e,o);let s=sF.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Br=sF;var aF=`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 Bx=`#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 eoe={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};eoe.NUMBER_OF_CLASSIFICATION_TYPES=3;var zn=Object.freeze(eoe);var n2e={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},qc=Object.freeze(n2e);function i2e(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 cF=i2e;function Hp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=o2e(t),o=e.floatingPointTexture,r=i===He.FLOAT&&!o,s=r2e(t,r),a=s2e(s,t,r),c=Math.floor(Lt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,_=p*.5,m=1/d,y=m*.5;this._textureDimensions=new V(f,d),this._textureStep=new ie(p,_,m,y),this._pixelDatatype=r?He.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let x=4*f*d;this._batchValues=i===He.FLOAT&&!r?new Float32Array(x):new Uint8Array(x),this._batchValuesDirty=!1}Object.defineProperties(Hp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function o2e(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==K.UNSIGNED_BYTE){t=!0;break}return t?He.FLOAT:He.UNSIGNED_BYTE}function noe(e,t){let n=e[t].componentsPerAttribute;return n===2?V:n===3?h:n===4?ie:Number}function r2e(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!==K.UNSIGNED_BYTE&&t?i+=4:++i}return n}function s2e(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==K.UNSIGNED_BYTE&&n?o+4:o+1}var vw=new ie;function a2e(e,t,n){let i=ie.unpack(e,t,vw),o=ie.unpackFloat(i);i=ie.unpack(e,t+4,vw);let r=ie.unpackFloat(i);i=ie.unpack(e,t+8,vw);let s=ie.unpackFloat(i);i=ie.unpack(e,t+12,vw);let a=ie.unpackFloat(i);return ie.fromElements(o,r,s,a,n)}function c2e(e,t,n){let i=ie.packFloat(e.x,vw);ie.pack(i,t,n),i=ie.packFloat(e.y,i),ie.pack(i,t,n+4),i=ie.packFloat(e.z,i),ie.pack(i,t,n+8),i=ie.packFloat(e.w,i),ie.pack(i,t,n+12)}var toe=new ie;Hp.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!==He.UNSIGNED_BYTE?a=a2e(this._batchValues,s,toe):a=ie.unpack(this._batchValues,s,toe);let c=noe(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var l2e=[void 0,void 0,new V,new h,new ie],u2e=new ie;Hp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=l2e[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=noe(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=u2e;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?c2e(c,this._batchValues,d):ie.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function f2e(e,t){let n=e._textureDimensions;e._texture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:zt.NEAREST,flipY:!1})}function d2e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Hp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||f2e(this,e.context),d2e(this))};Hp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:ct(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function h2e(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 m2e(e){return e===1?"float":`vec${e}`}function p2e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function _2e(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=m2e(o),a=p2e(o),c=e._offsets[t],u=`${s} ${r}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==He.UNSIGNED_BYTE?u+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:u+=` vec4 textureValue = texture(batchTexture, st); -`,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===He.UNSIGNED_BYTE&&i.componentDatatype===K.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===He.FLOAT&&i.componentDatatype===K.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; -`),u+=` return value; -} -`,u}Hp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${h2e(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=_2e(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} -${t} -${s}`}};Hp.prototype.isDestroyed=function(){return!1};Hp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ce(this)};var zC=Hp;function Nl(e){this._ellipsoid=e??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Nl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Nl.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Nl.geodeticLatitudeToMercatorAngle=function(e){e>Nl.MaximumLatitude?e=Nl.MaximumLatitude:e<-Nl.MaximumLatitude&&(e=-Nl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Nl.MaximumLatitude=Nl.mercatorAngleToGeodeticLatitude(Math.PI);Nl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Nl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};Nl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Nl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var ki=Nl;function g2e(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(!O.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Fn.transformToWorldCoordinates(e[r]);else O.multiplyTransformation(t,e[0].modelMatrix,t)}function Dj(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new we({componentDatatype:K.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function y2e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?Dj(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(Dj(i.westHemisphereGeometry,n),Dj(i.eastHemisphereGeometry,n))}}function x2e(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(g2e(t,a,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&Fn.splitLongitude(t[c]);if(y2e(t),r)for(c=0;c<d;++c){let _=t[c];l(_.geometry)?(Fn.reorderForPostVertexCache(_.geometry),Fn.reorderForPreVertexCache(_.geometry)):l(_.westHemisphereGeometry)&&l(_.eastHemisphereGeometry)&&(Fn.reorderForPostVertexCache(_.westHemisphereGeometry),Fn.reorderForPreVertexCache(_.westHemisphereGeometry),Fn.reorderForPostVertexCache(_.eastHemisphereGeometry),Fn.reorderForPreVertexCache(_.eastHemisphereGeometry))}let p=Fn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let _=u.attributes;if(o)for(let m in _)_.hasOwnProperty(m)&&_[m].componentDatatype===K.DOUBLE&&Fn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in _)if(_.hasOwnProperty(m)&&_[m].componentDatatype===K.DOUBLE){let y=`${m}3D`,x=`${m}2D`;Fn.projectTo2D(u,m,y,x,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=re.fromVertices(u.attributes.position2D.values)),Fn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Fn.encodeAttribute(u,x,`${x}High`,`${x}Low`)}s&&Fn.compressVertices(u)}if(!i){let _=[];for(d=p.length,c=0;c<d;++c)u=p[c],_=_.concat(Fn.fitToUnsignedShortIndices(u));p=_}return p}function Rj(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function b2e(e,t){let n=[];return Rj(e,"geometry",t,n),Rj(e,"westHemisphereGeometry",t,n),Rj(e,"eastHemisphereGeometry",t,n),n}var Gp={};Gp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=x2e(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=b2e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let _=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(_)&&l(m)&&(l(_.boundingSphere)&&l(m.boundingSphere)&&(c[f]=re.union(_.boundingSphere,m.boundingSphere)),l(_.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=re.union(_.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function T2e(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 C2e(e,t){let n=e.length;for(let i=0;i<n;++i)T2e(e[i],t)}function A2e(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*re.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}Gp.packCreateGeometryResults=function(e,t){let n=new Float64Array(A2e(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&re.pack(c.boundingSphere,n,s),s+=re.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&re.pack(c.boundingSphereCV,n,s),s+=re.packedLength;let p=c.attributes,_=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(_.push(y),l(o[y])||(o[y]=i.length,i.push(y)));n[s++]=_.length;for(let y=0;y<_.length;y++){let x=_[y],b=p[x];n[s++]=o[x],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Gp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=re.unpack(n,s)),s+=re.packedLength,n[s++]===1&&(p=re.unpack(n,s)),s+=re.packedLength;let y,x,b,T=new pn,C=n[s++];for(i=0;i<C;i++){let S=t[n[s++]],w=n[s++];b=n[s++];let R=n[s++]!==0;y=n[s++],x=K.createTypedArray(w,y);for(let D=0;D<y;D++)x[D]=n[s++];T[S]=new we({componentDatatype:w,componentsPerAttribute:b,normalize:R,values:x})}let A;if(y=n[s++],y>0){let S=x.length/b;for(A=ke.createTypedArray(S,y),i=0;i<y;i++)A[i]=n[s++]}o[r++]=new lt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:A,attributes:T,offsetAttribute:f})}return o};function E2e(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(O.pack(s.modelMatrix,i,o),o+=O.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 S2e(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=O.unpack(t,o),s;o+=O.packedLength,l(t[o])&&(s={offset:new ro(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Gp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:E2e(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Fi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Gp.unpackCombineGeometryParameters=function(e){let t=S2e(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Gp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=te.clone(e.ellipsoid),s=e.isGeographic?new Fi(r):new ki(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:O.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function ioe(e){let t=e.length,n=1+(re.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,re.pack(e[r],i,o)):i[o++]=0,o+=re.packedLength}return i}function ooe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=re.unpack(e,i)),++n,i+=re.packedLength;return t}Gp.packCombineGeometryResults=function(e,t){l(e.geometries)&&C2e(e.geometries,t);let n=ioe(e.boundingSpheres),i=ioe(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}};Gp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:ooe(e.boundingSpheres),boundingSpheresCV:ooe(e.boundingSpheresCV)}};var VC=Gp;var v2e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},kr=Object.freeze(v2e);var xu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};xu.NUMBER_OF_SHADOW_MODES=4;xu.castShadows=function(e){return e===xu.ENABLED||e===xu.CAST_ONLY};xu.receiveShadows=function(e){return e===xu.ENABLED||e===xu.RECEIVE_ONLY};xu.fromCastReceive=function(e,t){return e&&t?xu.ENABLED:e?xu.CAST_ONLY:t?xu.RECEIVE_ONLY:xu.DISABLED};var Tn=Object.freeze(xu);function Ar(e){e=e??G.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=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Tn.DISABLED,this._translucent=void 0,this._state=kr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Ar.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 w2e(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 I2e=new V,P2e=new h,hoe=new ie;function moe(e){let t=e.length;if(t===1)return e[0];if(t===2)return V.unpack(e,0,I2e);if(t===3)return h.unpack(e,0,P2e);if(t===4)return ie.unpack(e,0,hoe)}function D2e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=w2e(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,_,m,y;for(_=0;_<s;++_)m=r[_],y=p[m],c[m]=_,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:K.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:K.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let x=a.length,b=new zC(t,a,o);for(_=0;_<o;++_){let T=i[_];p=T.attributes;for(let R=0;R<s;++R){m=r[R],y=p[m];let D=moe(y.value),M=c[m];b.setBatchedAttribute(_,M,D)}let C={primitive:T.pickPrimitive??e};l(T.id)&&(C.id=T.id);let A=t.createPickId(C);e._pickIds.push(A);let S=A.color,w=hoe;w.x=H.floatToByte(S.red),w.y=H.floatToByte(S.green),w.z=H.floatToByte(S.blue),w.w=H.floatToByte(S.alpha),b.setBatchedAttribute(_,x-1,w)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function R2e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new we({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function O2e(e){let t=e.attributes,n=new pn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=R2e(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 lt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:re.clone(e.boundingSphere)})}function M2e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:O.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var L2e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Ar._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=L2e.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(` -`)};Ar._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Be.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};Ar._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 roe(e){return`${Be.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function soe(e){return`in vec4 v_pickColor; -${e}`}Ar._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};Ar._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};Ar._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Be.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function aoe(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,d+=` 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=Be.replaceMain(p,"czm_non_compressed_main");let _=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,_].join(` -`)}function N2e(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function F2e(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function coe(e,t){let n=e.vertexAttributes}function B2e(e,t){return function(){return e[t]}}var Oj=Math.max(Ft.hardwareConcurrency-1,1),lF,k2e=new hi("combineGeometry");function U2e(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===kr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(lF))for(lF=new Array(Oj),o=0;o<Oj;o++)lF[o]=new hi("createGeometry");let f;for(u=cF(u,Oj),o=0;o<u.length;o++){let d=0,p=u[o],_=p.length;for(r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(lF[o].scheduleTask({subTasks:u[o]},m))}e._state=kr.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=kr.CREATED}).catch(function(d){Iw(e,t,kr.FAILED,d)})}else if(e._state===kr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=k2e.scheduleTask(VC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=kr.COMBINING,Promise.resolve(f).then(function(d){let p=VC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=O.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=kr.COMBINED):Iw(e,t,kr.FAILED,void 0)}).catch(function(d){Iw(e,t,kr.FAILED,d)})}}function z2e(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,_;l(p.attributes)&&l(p.primitiveType)?_=O2e(p):_=p.constructor.createGeometry(p),o[c++]=M2e(s,_),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=VC.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=O.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=kr.COMBINED):Iw(e,t,kr.FAILED,void 0)}function V2e(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 re;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],x=e._batchTable.getBatchedAttribute(i,n,new h);y=r[i].clone(y),yoe(y,x,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||re.intersectPlane(y,en.ORIGIN_ZX_PLANE)!==Gt.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],_=u[0];for(i=1;i<c.length;i++)d=re.union(d,c[i]);for(i=1;i<f.length;i++)p=re.union(p,f[i]);for(i=1;i<u.length;i++)_=re.union(_,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(_)&&m.push(_),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=re.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Ar._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var loe=new Gn,poe=new fe,_oe=new h,goe=new re;function H2e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,_=p.length;for(let m=0;m<_;++m){let y=p[m];if(!l(y))continue;let x=e.modelMatrix;l(x)&&(y=re.transform(y,x,goe));let b=y.center,T=y.radius,C=Gn.fromCartesian(b,loe);if(d.setBatchedAttribute(m,o,C.high),d.setBatchedAttribute(m,r,C.low),!t.scene3DOnly){let A=f.cartesianToCartographic(b,poe),S=u.project(A,_oe);C=Gn.fromCartesian(S,loe),d.setBatchedAttribute(m,s,C.high),d.setBatchedAttribute(m,a,C.low)}d.setBatchedAttribute(m,c,T)}e._batchTableBoundingSpheresUpdated=!0}var Mj=new h,G2e=new h;function uoe(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=re.transform(f,p,goe));let _=f.center;_=r.scaleToGeodeticSurface(_,G2e);let m=r.cartesianToCartographic(_,poe),y=o.project(m,_oe),x=h.add(d,_,Mj);m=r.cartesianToCartographic(x,m);let b=o.project(m,Mj),T=h.subtract(b,y,Mj),C=T.x;T.x=T.z,T.z=T.y,T.y=C,s.setBatchedAttribute(u,i,T)}e._batchTableOffsetsUpdated=!0}function j2e(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(qn.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(re.clone(u.boundingSphere)),e._boundingSphereWC.push(new re),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,_=f.z;f.x=_,f.y=d,f.z=p,e._boundingSphereCV.push(re.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new re),e._boundingSphereMorph.push(new re)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Iw(e,t,kr.COMPLETE,void 0)}function W2e(e,t,n,i){let o=n.getRenderState(),r;i?(r=Fe(o,!1),r.cull={enabled:!0,face:Si.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=Si.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Fe(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Fe(o,!1),r.depthTest.func=qc.GREATER,i?(r.cull={enabled:!0,face:Si.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=Si.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function q2e(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Ar._appendOffsetToShader(e,r),r=Ar._appendShowToShader(e,r),r=Ar._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=roe(r),r=Ar._updateColorAttribute(e,r,!1),r=aoe(e,r),r=Ar._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=soe(s),e._sp=Xt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),coe(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Ar._appendShowToShader(e,r),r=Ar._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=roe(r),r=Ar._updateColorAttribute(e,r,!0),r=aoe(e,r),r=Ar._modifyShaderPosition(e,r,t.scene3DOnly),r=N2e(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=soe(s),s=F2e(s),e._spDepthFail=Xt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),coe(e._spDepthFail,o))}var ww=new O,foe=new h;function doe(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]=B2e(s,c));let a=ct(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return O.multiply(c,e._modelMatrix,ww),O.multiplyByPoint(ww,e.rtcCenter,foe),O.setTranslation(ww,foe,ww),ww}),a}function Y2e(e,t,n,i,o,r,s,a){let c=doe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=doe(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Se.TRANSLUCENT:Se.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,_=0;for(let m=0;m<p;++m){let y;o&&(y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(o&&(++m,y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=r[m],l(y)||(y=r[m]=new qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[_],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++_}}Ar._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!O.equals(n,e._modelMatrix))for(O.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=re.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=re.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=re.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function X2e(e,t,n,i,o,r,s,a){Ar._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Tn.castShadows(e.shadows),_=Tn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let x=0;x<m;++x){let b=Math.floor(x/y),T=n[x];T.modelMatrix=o,T.boundingVolume=c[b],T.cull=r,T.debugShowBoundingVolume=s,T.castShadows=p,T.receiveShadows=_,d?T.pickId="v_pickColor":T.pickId=void 0,u.push(T)}}}Ar.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!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===kr.FAILED)return;let t=e.context;if(l(this._batchTable)||D2e(this,t),this._batchTable.attributes.length>0){if(Lt.maximumVertexTextureImageUnits===0)throw new se("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==kr.COMPLETE&&this._state!==kr.COMBINED&&(this.asynchronous?U2e(this,e):z2e(this,e)),this._state===kr.COMBINED&&(H2e(this,e),uoe(this,e),j2e(this,e)),!this.show||this._state!==kr.COMPLETE)return;this._batchTableOffsetsUpdated||uoe(this,e),this._recomputeBoundingSpheres&&V2e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&(this._createRenderStatesFunction??W2e)(this,t,n,u),r&&(this._createShaderProgramFunction??q2e)(this,e,n),(o||r)&&(this._createCommandsFunction??Y2e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??X2e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var K2e=new re,$2e=new re;function yoe(e,t,n){if(n===cn.TOP){let i=re.clone(e,K2e),o=re.clone(e,$2e);o.center=h.add(o.center,t,o.center),e=re.union(i,o,e)}else n===cn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function Z2e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=K.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function Q2e(e,t,n,i,o){return function(r){let s=moe(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var J2e=new h;function eBe(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)&&yoe(i,h.fromArray(r.get(),0,J2e),e._offsetInstanceExtend[n]),l(o)&&(i=re.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function tBe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Ar.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:Z2e(s,n,f),set:Q2e(s,n,f,this,u)}}return eBe(this,c,n),tBe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Ar.prototype.isDestroyed=function(){return!1};Ar.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,ce(this)};function Iw(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===kr.COMPLETE||e._state===kr.FAILED})}var Dn=Ar;function nBe(e){e=e??G.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Yc=nBe;var Pw=`#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 vf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new Lj;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new Lj;if(o.requiresTextureCoordinates=e,n instanceof un)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}vf.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 un&&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 un||(o=t.material.shaderSource),new Be({defines:i,sources:[o,Pw]})};vf.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 Be({defines:n,sources:[Pw],pickColorQualifier:"in"})};vf.prototype.createVertexShader=function(e,t,n,i){return voe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};vf.prototype.createPickVertexShader=function(e,t,n,i){return voe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var xoe=new h,boe=new fe,Toe={high:0,low:0};function voe(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=boe;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,xoe),d=Gn.encode(f.x,Toe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=boe;p.longitude=-P.PI,p.latitude=0,p.height=0;let _=s.project(p,xoe);d=Gn.encode(_.x,Toe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.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 un&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Be({defines:c,sources:[o]})}function Lj(){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(Lj.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 Coe(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)/V.distance(t,e)}var iBe=[new V,new V,new V,new V];function woe(e,t){let n=iBe,i=V.unpack(t,0,n[0]),o=V.unpack(t,2,n[1]),r=V.unpack(t,4,n[2]);e.uMaxVmax=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Coe(i,o,r),a=1/Coe(i,r,o);e.uvMinAndExtents=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Ioe=new fe,Poe=new h,oBe=new h,rBe=new h,uF={high:0,low:0};function Doe(e,t,n){let i=Ioe;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Poe);i.latitude=e.north;let r=t.project(i,oBe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,rBe),a=[0,0,0,0],c=[0,0,0,0],u=Gn.encode(o.x,uF);a[0]=u.high,c[0]=u.low,u=Gn.encode(o.y,uF),a[1]=u.high,c[1]=u.low,u=Gn.encode(r.y,uF),a[2]=u.high,c[2]=u.low,u=Gn.encode(s.x,uF),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var sBe=new O,aBe=new O,Aoe=new h,cBe=new fe,lBe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function uBe(e,t,n,i,o,r){let s=ae.center(e,cBe);s.height=n;let a=fe.toCartesian(s,t,Aoe),c=Et.eastNorthUpToFixedFrame(a,t,sBe),u=O.inverse(c,aBe),f=e.west,d=e.east,p=e.north,_=e.south,m=lBe;m[0].latitude=_,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=_,m[3].longitude=d;let y=(f+d)*.5,x=(p+_)*.5;m[4].latitude=_,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=x,m[6].longitude=f,m[7].latitude=x,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(let D=0;D<8;D++){m[D].height=n;let M=fe.toCartesian(m[D],t,Aoe);O.multiplyByPoint(u,M,M),M.z=0,b=Math.min(b,M.x),T=Math.max(T,M.x),C=Math.min(C,M.y),A=Math.max(A,M.y)}let S=i;S.x=b,S.y=C,S.z=0,O.multiplyByPoint(c,S,S);let w=o;w.x=T,w.y=C,w.z=0,O.multiplyByPoint(c,w,w),h.subtract(w,S,o);let R=r;R.x=b,R.y=A,R.z=0,O.multiplyByPoint(c,R,R),h.subtract(R,S,r)}var fBe=new h,dBe=new h,hBe=new Gn;vf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Poe,s=fBe,a=dBe;uBe(e,n,o??0,r,s,a);let c={};woe(c,t);let u=Gn.fromCartesian(r,hBe);return c.southWest_HIGH=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Doe(e,i,c),c};var mBe=new h;function Eoe(e,t,n,i){let o=Ioe;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,mBe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Soe=new V;vf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Eoe(e.south,e.west,n,Soe),r=o.x,s=o.y,a=Eoe(e.north,e.east,n,Soe),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),_={sphericalExtents:new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new Yc({componentDatatype:K.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return woe(_,t),Doe(e,i,_),_};vf.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)};vf.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 pBe(e){return Math.max(e.width,e.height)>vf.MAX_WIDTH_FOR_PLANAR_EXTENTS}vf.shouldUseSphericalCoordinates=function(e){return pBe(e)};vf.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var wf=vf;var _Be={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},Vn=Object.freeze(_Be);var gBe={ZERO:q.ZERO,KEEP:q.KEEP,REPLACE:q.REPLACE,INCREMENT:q.INCR,DECREMENT:q.DECR,INVERT:q.INVERT,INCREMENT_WRAP:q.INCR_WRAP,DECREMENT_WRAP:q.DECR_WRAP},ht=Object.freeze(gBe);var fF={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};fF.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.REPLACE},reference:fF.CESIUM_3D_TILE_MASK,mask:fF.CESIUM_3D_TILE_MASK}};var jt=Object.freeze(fF);function kx(e){e=e??G.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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(kx.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}}});kx.isSupported=function(e){return e.context.stencilBuffer};function HC(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:n,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qc.LESS_OR_EQUAL},depthMask:!1}}function Fj(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}}var yBe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function xBe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(HC(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(HC(o,!0)),e._rsColorPass=ze.fromCache(Fj(o,!1)),e._rsPickPass=ze.fromCache(yBe)}function bBe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Be.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function TBe(e,t){let n=t.context,i=e._primitive,o=aF;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Dn._appendDistanceDisplayConditionToShader(i,o),o=Dn._modifyShaderPosition(e,o,t.scene3DOnly),o=Dn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=bBe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Be({defines:[a],sources:[o]}),u=new Be({sources:[Bx]}),f=e._primitive._attributeLocations,d=new wf(s,r,e.appearance);if(e._spStencil=Xt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Be.createPickVertexShaderSource(o);m=Dn._appendShowToShader(i,m),m=Dn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),x=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Xt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let T=d.createPickFragmentShader(!0),C=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Xt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Dn._appendShowToShader(i,o),c=new Be({defines:[a],sources:[o]}),e._sp=Xt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),_=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Xt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:_,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),x=d.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function CBe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let _=n._va[a++];r=t[o],l(r)||(r=t[o]=new qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Se.TERRAIN_CLASSIFICATION,s=qe.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Se.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=ct(c,y._uniforms)),r.uniformMap=c,s=qe.shallowClone(r,r.derivedCommands.tileset),s.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let x=qe.shallowClone(r,r.derivedCommands.appearance2D);x.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=x,x=qe.shallowClone(s,s.derivedCommands.appearance2D),x.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=x}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let _=0;_<i;++_){let m=f[_]=qe.shallowClone(t[p],f[_]);m.shaderProgram=d,m.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function ABe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),_=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[d++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=qe.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Se.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=qe.shallowClone(u,u.derivedCommands.tileset),f.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,_){let y=qe.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=qe.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function EBe(e,t,n,i,o,r,s){CBe(e,r),ABe(e,s)}function Roe(e,t){return Math.floor(e%t/2)}function Nj(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Ooe(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function SBe(e,t,n,i,o,r,s,a){let c=e._primitive;Dn._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN,_=t.passes,m,y,x;if(_.render){let b=n.length;for(m=0;m<b;++m)y=u[Roe(m,b)],d&&(x=n[m],Nj(x,t,o,r,y,s)),p&&(x=n[m].derivedCommands.tileset,Nj(x,t,o,r,y,s));if(t.invertClassification){let T=e._commandsIgnoreShow,C=T.length;for(m=0;m<C;++m)y=u[m],x=T[m],Nj(x,t,o,r,y,s)}}if(_.pick){let b=i.length,T=c._pickOffsets;for(m=0;m<b;++m){let C=T[Roe(m,b)];y=u[C.index],d&&(x=i[m],Ooe(x,t,o,r,y)),p&&(x=i[m].derivedCommands.tileset,Ooe(x,t,o,r,y))}}}kx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,d,p=!1,_=!1;for(r>0&&(c=o[0].attributes,p=wf.hasAttributesForSphericalExtents(c),_=wf.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Yt.equals(d,y)}if(!f&&!p&&!_)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new un({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!_,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=_,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new Pt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,x){n._createBoundingVolumeFunction(y,x)}),i._createRenderStatesFunction=function(y,x,b,T){xBe(n,x)},i._createShaderProgramFunction=function(y,x,b){TBe(n,x)},i._createCommandsFunction=function(y,x,b,T,C,A,S){EBe(n,void 0,void 0,!0,!1,A,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,x,b,T,C,A,S,w){n._updateAndQueueCommandsFunction(y,x,b,T,C,A,S,w)}:i._updateAndQueueCommandsFunction=function(y,x,b,T,C,A,S,w){SBe(n,x,b,T,C,A,S,w)},this._primitive=new Dn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(HC(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(HC(!1,!0)),this._rsColorPass=ze.fromCache(Fj(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(HC(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(HC(!0,!0)),this._rsColorPass=ze.fromCache(Fj(!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))})};kx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};kx.prototype.isDestroyed=function(){return!1};kx.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,ce(this)};var Dw=kx;var vBe={u_globeMinimumAltitude:function(){return 55e3}};function Fl(e){e=e??G.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 un({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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=mi._defaultMaxTerrainHeight,this._minTerrainHeight=mi._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:vBe}}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=Dw.isSupported;function Moe(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Loe(e){return function(t,n){return e._minHeight}}var wBe=new h,IBe=new h,PBe=new h,DBe=new fe,RBe=new ae;function dF(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=h.unpack(i,d,wBe),_=h.unpack(o,d,IBe),m=h.add(p,_,PBe),y=n.cartesianToCartographic(m,DBe),x=y.latitude,b=y.longitude;s=Math.min(s,x),a=Math.min(a,b),c=Math.max(c,x),u=Math.max(u,b)}let f=RBe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function OBe(e,t,n){let i=mi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function MBe(e,t,n){let i=t.mapProjection.ellipsoid,o=dF(t,n),r=Pn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=re.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function Bj(e,t){return Math.floor(e%t/2)}function kj(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.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 Noe(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.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 LBe(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==zn.CESIUM_3D_TILE,d=u!==zn.TERRAIN,p=t.passes,_=e._primitive,m,y,x;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[Bj(m,b)],f&&(x=n[m],kj(e,x,t,o,r,y,s)),d&&(x=n[m].derivedCommands.tileset,kj(e,x,t,o,r,y,s));if(t.invertClassification){let T=_._commandsIgnoreShow,C=T.length;for(m=0;m<C;++m)y=c[m],x=T[m],kj(e,x,t,o,r,y,s)}}if(p.pick){let b=i.length,T;for(e._useFragmentCulling||(T=_._primitive._pickOffsets),m=0;m<b;++m){if(y=c[Bj(m,b)],!e._useFragmentCulling){let C=T[Bj(m,b)];y=c[C.index]}f&&(x=i[m],Noe(e,x,t,o,r,y)),d&&(x=i[m].derivedCommands.tileset,Noe(e,x,t,o,r,y))}}}Fl.initializeTerrainHeights=function(){return mi.initialize()};Fl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!mi.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,u=new Array(c),f,d;for(f=0;f<c;++f){o=a[f],r=o.geometry;let y=dF(e,r);l(d)?l(y)&&ae.union(d,y,d):d=ae.clone(y);let x=o.id;if(l(x)&&l(y)){let b=mi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(x),this._boundingSpheres.push(b)}s=r.constructor,!l(s)||l(s.createShadowVolume)}OBe(this,d,i);let p=e.verticalExaggeration,_=e.verticalExaggerationRelativeHeight;this._minHeight=Br.getHeight(this._minTerrainHeight,p,_),this._maxHeight=Br.getHeight(this._maxTerrainHeight,p,_);let m=Fl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,x=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,d=dF(e,r),wf.shouldUseSphericalCoordinates(d)){x=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let b=dF(e,r),T=r.textureCoordinateRotationPoints;x?y=wf.getPlanarTextureCoordinateAttributes(b,T,i,e.mapProjection,this._maxHeight):y=wf.getSphericalExtentGeometryInstanceAttributes(b,T,i,e.mapProjection);let C=o.attributes;for(let A in C)C.hasOwnProperty(A)&&(y[A]=C[A]);u[f]=new Pt({geometry:s.createShadowVolume(r,Loe(this),Moe(this)),attributes:y,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new Pt({geometry:s.createShadowVolume(r,Loe(this),Moe(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,x){MBe(t,y,x)},n._updateAndQueueCommandsFunction=function(y,x,b,T,C,A,S,w){LBe(t,x,b,T,C,A,S,w)},this._primitive=new Dw(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(),ce(this)};Fl._supportsMaterials=function(e){return e.depthTexture};Fl.supportsMaterials=function(e){return Fl._supportsMaterials(e.frameState.context)};var Bl=Fl;function GC(){he.throwInstantiationError()}Object.defineProperties(GC.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});GC.prototype.getType=he.throwInstantiationError;GC.prototype.getValue=he.throwInstantiationError;GC.prototype.equals=he.throwInstantiationError;var NBe=new $;GC.getValue=function(e,t,n){let i;return l(e)||(e=$.now(NBe)),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)),H.clone(H.WHITE,n.uniforms.color),n)};var dr=GC;function Ux(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}Ux.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Ux.prototype._setOptions=he.throwInstantiationError;Ux.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Wt,d,p=t._getIsClosed(c);if(f)d=new un({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let _=dr.getValue(e,u,this._material);this._material=_,d=new mo({material:_,translucent:_.isTranslucent(),closed:p})}if(n)c.vertexFormat=un.VERTEX_FORMAT,this._primitive=o.add(new Bl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let _=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=_.attributes.color.value[3]!==255),this._primitive=i.add(new Dn({geometryInstances:_,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Dn({geometryInstances:u,appearance:new un({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Ux.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))?(re.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(re.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};Ux.prototype.isDestroyed=function(){return!1};Ux.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),ce(this)};var si=Ux;var Foe={};function Rw(e,t){l(Foe[e])||(Foe[e]=!0,console.warn(t??e))}Rw.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.";Rw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Rw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Rw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Tt=Rw;var FBe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Og=Object.freeze(FBe);var BBe={NONE:0,GEODESIC:1,RHUMB:2},nn=Object.freeze(BBe);var Boe=P.EPSILON10;function kBe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Boe)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(d=i.length)),a=c);return n&&t(e[0],e[r-1],Boe)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var vo=kBe;function UBe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),d=c*s,p=d*d,_=1-p,m=Math.sqrt(_),y=t/4,x=y*y,b=x*y,T=x*x,C=1+y-3*x/4+5*b/4-175*T/64,A=1-y+15*x/8-35*b/8,S=1-3*y+35*x/4,w=1-5*y,R=C*f-A*Math.sin(2*f)*y/2-S*Math.sin(4*f)*x/16-w*Math.sin(6*f)*b/48-Math.sin(8*f)*5*T/512,D=e._constants;D.a=n,D.b=i,D.f=o,D.cosineHeading=r,D.sineHeading=s,D.tanU=a,D.cosineU=c,D.sineU=u,D.sigma=f,D.sineAlpha=d,D.sineSquaredAlpha=p,D.cosineSquaredAlpha=_,D.cosineAlpha=m,D.u2Over4=y,D.u4Over16=x,D.u6Over64=b,D.u8Over256=T,D.a0=C,D.a1=A,D.a2=S,D.a3=w,D.distanceRatio=R}function zBe(e,t){return e*t*(4+e*(4-3*t))/16}function koe(e,t,n,i,o,r,s){let a=zBe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function VBe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),_=Math.cos(f),m=Math.sin(f),y=d*_,x=d*m,b=p*m,T=p*_,C=c,A=P.TWO_PI,S=Math.cos(C),w=Math.sin(C),R,D,M,L,g;do{S=Math.cos(C),w=Math.sin(C);let B=x-T*S;M=Math.sqrt(_*_*w*w+B*B),D=b+y*S,R=Math.atan2(M,D);let j;M===0?(j=0,L=1):(j=y*w/M,L=1-j*j),A=C,g=D-2*b/L,isFinite(g)||(g=0),C=c+koe(a,j,L,R,M,D,g)}while(Math.abs(C-A)>P.EPSILON12);let E=L*(t*t-n*n)/(n*n),v=1+E*(4096+E*(E*(320-175*E)-768))/16384,I=E*(256+E*(E*(74-47*E)-128))/1024,N=g*g,F=I*M*(g+I*(D*(2*N-1)-I*g*(4*M*M-3)*(4*N-3)/6)/4),U=n*v*(R-F),k=Math.atan2(_*w,x-T*S),z=Math.atan2(d*w,x*S-T);e._distance=U,e._startHeading=k,e._endHeading=z,e._uSquared=E}var HBe=new h,Uj=new h;function Uoe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,Uj),HBe),r=h.normalize(i.cartographicToCartesian(n,Uj),Uj);VBe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,UBe(e)}function Ow(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Uoe(this,e,t,i)}Object.defineProperties(Ow.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}}});Ow.prototype.setEndPoints=function(e,t){Uoe(this,e,t,this._ellipsoid)};Ow.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};Ow.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,_=n.u8Over256,m=n.u2Over4,y=n.u6Over64,x=n.u4Over16,b=2*p*_*o/3+i*(1-m+7*x/4-15*y/4+579*_/64-(x-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*r-29*_*s/16)+(m/2-x+71*y/32-85*_/16)*a+(5*x/16-5*y/4+383*_/96)*c-d*((y-11*_/2)*a+5*_*c/2)+(29*y/96-29*_/16)*u+539*_*f/1536,T=Math.asin(Math.sin(b)*n.cosineAlpha),C=Math.atan(n.a/n.b*Math.tan(T));b=b-n.sigma;let A=Math.cos(2*n.sigma+b),S=Math.sin(b),w=Math.cos(b),R=n.cosineU*w,D=n.sineU*S,L=Math.atan2(S*n.sineHeading,R-D*n.cosineHeading)-koe(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,S,w,A);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=C,t.height=0,t):new fe(this._start.longitude+L,C,0)};var Mg=Ow;function Vj(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),_=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*_-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function GBe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,_=p*c,m=Math.sin(2*i),y=Math.cos(2*i),x=Math.sin(4*i),b=Math.cos(4*i),T=Math.sin(6*i),C=Math.cos(6*i),A=Math.sin(8*i),S=Math.cos(8*i),w=Math.sin(10*i),R=Math.cos(10*i),D=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*_/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*_/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*_/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*_/16384-453*r*_/32768)*C+(1097*i*p/65536+42783*i*_/1048576)*S+8011*i*_/1048576*R+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*_/1048576-471*o*_/8192+9*s*_/4096)*m+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*_/16777216-12517*o*_/131072+7*s*_/2048)*x+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*_/786432-8607*o*_/131072)*T+(1097*d/131072+1097*p/65536+225797*_/10485760-1097*o*_/65536)*A+(8011*p/2621440+8011*_/1048576)*w+293393*_/251658240*D}function jC(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function jBe(e,t,n,i,o){let r=jC(e._ellipticity,n),s=jC(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function WBe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=Vj(e._ellipticity,t,o);u=(Vj(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var qBe=new h,zj=new h;function zoe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,zj),qBe),r=h.normalize(i.cartographicToCartesian(n,zj),zj),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=jBe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=WBe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Voe(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=Vj(o,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=GBe(p,o,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let _=jC(o,e.latitude),m=jC(o,c);u=Math.tan(t)*(m-_),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function jp(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&zoe(this,e,t,i)}Object.defineProperties(jp.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}}});jp.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Voe(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new jp(e,d,r):(o.setEndPoints(e,d),o)};jp.prototype.setEndPoints=function(e,t){zoe(this,e,t,this._ellipsoid)};jp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};jp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Voe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};jp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),_=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(_/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};jp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=jC(n,o.latitude),s=jC(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var _c=jp;var Kj=[Fi,ki],YBe=Kj.length,are=Math.cos(P.toRadians(30)),Hoe=Math.cos(P.toRadians(150)),cre=0,lre=1e3;function Ng(e){e=e??G.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??nn.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Ng.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});Ng.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<YBe;i++)if(t instanceof Kj[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var XBe=new h,Goe=new h,joe=new h;function Xj(e,t,n,i,o){let r=Xc(i,e,0,XBe),s=Xc(i,e,n,Goe),a=Xc(i,t,0,joe),c=Wp(s,r,Goe),u=Wp(a,r,joe);return h.cross(u,c,o),h.normalize(o,o)}var KBe=new fe,$Be=new h,ZBe=new h,QBe=new h;function Hj(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let d;r===nn.GEODESIC?d=new Mg(e,t,s):r===nn.RHUMB&&(d=new _c(e,t,s));let p=d.surfaceDistance;if(p<o)return;let _=Xj(e,t,i,s,QBe),m=Math.ceil(p/o),y=p/m,x=y,b=m-1,T=a.length;for(let C=0;C<b;C++){let A=d.interpolateUsingSurfaceDistance(x,KBe),S=Xc(s,A,n,$Be),w=Xc(s,A,i,ZBe);h.pack(_,a,T),h.pack(S,c,T),h.pack(w,u,T),f.push(A.latitude),f.push(A.longitude),T+=3,x+=y}}var Gj=new fe;function Xc(e,t,n,i){return fe.clone(t,Gj),Gj.height=n,fe.toCartesian(Gj,e,i)}Ng.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];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};Ng.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]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new Ng({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function Wp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Woe(e,t,n,i){return i=Wp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var JBe=new h,e3e=new h,t3e=new h,ure=new h,n3e=0,i3e=-1;function jj(e,t,n,i,o){let r=Wp(n,t,ure),s=Woe(e,t,r,JBe),a=Woe(i,t,r,e3e);if(P.equalsEpsilon(h.dot(s,a),i3e,P.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,t3e);return h.dot(a,c)<n3e&&(o=h.negate(o,o)),o}var _F=en.fromPointNormal(h.ZERO,h.UNIT_Y),o3e=new h,r3e=new h,s3e=new h,a3e=new h,c3e=new h,hF=new h,mF=new fe,qoe=new fe,Yoe=new fe;Ng.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new Kj[e._projectionIndex](i),a=cre,c=lre,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let _,m,y,x,b=new _c(void 0,void 0,i),T,C,A,S=[d[0]];for(f=0;f<p-1;f++)_=d[f],m=d[f+1],T=ni.lineSegmentPlane(_,m,_F,hF),l(T)&&!h.equalsEpsilon(T,_,P.EPSILON7)&&!h.equalsEpsilon(T,m,P.EPSILON7)&&(e.arcType===nn.GEODESIC?S.push(h.clone(T)):e.arcType===nn.RHUMB&&(A=i.cartesianToCartographic(T,mF).longitude,y=i.cartesianToCartographic(_,mF),x=i.cartesianToCartographic(m,qoe),b.setEndPoints(y,x),C=b.findIntersectionWithLongitude(A,Yoe),T=i.cartographicToCartesian(C,hF),l(T)&&!h.equalsEpsilon(T,_,P.EPSILON7)&&!h.equalsEpsilon(T,m,P.EPSILON7)&&S.push(h.clone(T)))),S.push(m);n&&(_=d[p-1],m=d[0],T=ni.lineSegmentPlane(_,m,_F,hF),l(T)&&!h.equalsEpsilon(T,_,P.EPSILON7)&&!h.equalsEpsilon(T,m,P.EPSILON7)&&(e.arcType===nn.GEODESIC?S.push(h.clone(T)):e.arcType===nn.RHUMB&&(A=i.cartesianToCartographic(T,mF).longitude,y=i.cartesianToCartographic(_,mF),x=i.cartesianToCartographic(m,qoe),b.setEndPoints(y,x),C=b.findIntersectionWithLongitude(A,Yoe),T=i.cartographicToCartesian(C,hF),l(T)&&!h.equalsEpsilon(T,_,P.EPSILON7)&&!h.equalsEpsilon(T,m,P.EPSILON7)&&S.push(h.clone(T)))));let w=S.length,R=new Array(w);for(f=0;f<w;f++){let W=fe.fromCartesian(S[f],i);W.height=0,R[f]=W}if(R=vo(R,fe.equalsEpsilon),w=R.length,w<2)return;let D=[],M=[],L=[],g=[],E=o3e,v=r3e,I=s3e,N=a3e,F=c3e,U=R[0],k=R[1],z=R[w-1];for(E=Xc(i,z,a,E),N=Xc(i,k,a,N),v=Xc(i,U,a,v),I=Xc(i,U,c,I),n?F=jj(E,v,I,N,F):F=Xj(U,k,c,i,F),h.pack(F,M,0),h.pack(v,L,0),h.pack(I,g,0),D.push(U.latitude),D.push(U.longitude),Hj(U,k,a,c,o,r,i,M,L,g,D),f=1;f<w-1;++f){E=h.clone(v,E),v=h.clone(N,v);let W=R[f];Xc(i,W,c,I),Xc(i,R[f+1],a,N),jj(E,v,I,N,F),u=M.length,h.pack(F,M,u),h.pack(v,L,u),h.pack(I,g,u),D.push(W.latitude),D.push(W.longitude),Hj(R[f],R[f+1],a,c,o,r,i,M,L,g,D)}let B=R[w-1],j=R[w-2];if(v=Xc(i,B,a,v),I=Xc(i,B,c,I),n){let W=R[0];E=Xc(i,j,a,E),N=Xc(i,W,a,N),F=jj(E,v,I,N,F)}else F=Xj(j,B,c,i,F);if(u=M.length,h.pack(F,M,u),h.pack(v,L,u),h.pack(I,g,u),D.push(B.latitude),D.push(B.longitude),n){for(Hj(B,U,a,c,o,r,i,M,L,g,D),u=M.length,f=0;f<3;++f)M[u+f]=M[f],L[u+f]=L[f],g[u+f]=g[f];D.push(U.latitude),D.push(U.longitude)}return L3e(n,s,L,g,M,D,t)};var l3e=new h,u3e=new Z,f3e=new Pe;function Xoe(e,t,n,i){let o=Wp(n,t,l3e),r=h.dot(o,e);if(r>are||r<Hoe){let s=Wp(i,n,ure),a=r<Hoe?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Pe.fromAxisAngle(s,a,f3e),u=Z.fromQuaternion(c,u3e);return Z.multiplyByVector(u,e,e),!0}return!1}var Koe=new fe,d3e=new h,$oe=new h;function Mw(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,d3e),s=h.add(r,n,$oe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Koe);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,$oe),u=c.cartesianToCartographic(s,Koe)),u.height=0;let f=e.project(u,o);return o=h.subtract(f,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var h3e=new h,Zoe=new h;function Qoe(e,t,n,i,o,r){let s=h.subtract(t,e,h3e);h.normalize(s,s);let a=n-cre,c=h.multiplyByScalar(s,a,Zoe);h.add(e,c,o);let u=i-lre;c=h.multiplyByScalar(s,u,Zoe),h.add(t,c,r)}var m3e=new h;function pF(e,t){let n=en.getPointDistance(_F,e),i=en.getPointDistance(_F,t),o=m3e;P.equalsEpsilon(n,0,P.EPSILON2)?(o=Wp(t,e,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=Wp(e,t,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(t,o,t))}function p3e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var fre=new fe,dre=new fe,Joe=new h,Wj=new h,ere=new h,tre=new h,_3e=new h,nre=new h,g3e=[fre,dre],y3e=new ae,x3e=new h,b3e=new h,T3e=new h,C3e=new h,A3e=new h,E3e=new h,qj=new h,Yj=new h,S3e=new h,v3e=new h,w3e=new h,ire=new h,I3e=new h,P3e=new h,D3e=new Gn,R3e=new Gn,ore=new h,O3e=new h,rre=new h,M3e=[new re,new re],hre=[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],sre=hre.length;function L3e(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,_=f*36,m=d>65535?new Uint32Array(_):new Uint16Array(_),y=new Float64Array(d*3),x=new Float32Array(p),b=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),S,w,R,D;s&&(S=new Float32Array(p),w=new Float32Array(p),R=new Float32Array(p),D=new Float32Array(d*2));let M=r.length/2,L=0,g=fre;g.height=0;let E=dre;E.height=0;let v=Joe,I=Wj;if(s)for(c=0,a=1;a<M;a++)g.latitude=r[c],g.longitude=r[c+1],E.latitude=r[c+2],E.longitude=r[c+3],v=t.project(g,v),I=t.project(E,I),L+=h.distance(v,I),c+=2;let N=i.length/3;I=h.unpack(i,0,I);let F=0;for(c=3,a=1;a<N;a++)v=h.clone(I,v),I=h.unpack(i,c,I),F+=h.distance(v,I),c+=3;let U;c=3;let k=0,z=0,B=0,j=0,W=!1,J=h.unpack(n,0,tre),Y=h.unpack(i,0,Wj),ee=h.unpack(o,0,nre);if(e){let Te=h.unpack(n,n.length-6,ere);Xoe(ee,Te,J,Y)&&(ee=h.negate(ee,ee))}let Q=0,de=0,ge=0;for(a=0;a<f;a++){let Te=h.clone(J,ere),ve=h.clone(Y,Joe),Ve=h.clone(ee,_3e);W&&(Ve=h.negate(Ve,Ve)),J=h.unpack(n,c,tre),Y=h.unpack(i,c,Wj),ee=h.unpack(o,c,nre),W=Xoe(ee,Te,J,Y),g.latitude=r[k],g.longitude=r[k+1],E.latitude=r[k+2],E.longitude=r[k+3];let Ke,Ct,Qt,Qe;if(s){let yi=p3e(g,E);Ke=t.project(g,A3e),Ct=t.project(E,E3e);let sa=Wp(Ct,Ke,ore);sa.y=Math.abs(sa.y),Qt=qj,Qe=Yj,yi===0||h.dot(sa,h.UNIT_Y)>are?(Qt=Mw(t,g,Ve,Ke,qj),Qe=Mw(t,E,ee,Ct,Yj)):yi===1?(Qe=Mw(t,E,ee,Ct,Yj),Qt.x=0,Qt.y=P.sign(g.longitude-Math.abs(E.longitude)),Qt.z=0):(Qt=Mw(t,g,Ve,Ke,qj),Qe.x=0,Qe.y=P.sign(g.longitude-E.longitude),Qe.z=0)}let hn=h.distance(ve,Y),Nt=Gn.fromCartesian(Te,D3e),Rt=h.subtract(J,Te,S3e),Zn=h.normalize(Rt,ire),gi=h.subtract(ve,Te,v3e);gi=h.normalize(gi,gi);let Ht=h.cross(Zn,gi,ire);Ht=h.normalize(Ht,Ht);let wt=h.cross(gi,Ve,I3e);wt=h.normalize(wt,wt);let no=h.subtract(Y,J,w3e);no=h.normalize(no,no);let xt=h.cross(ee,no,P3e);xt=h.normalize(xt,xt);let Xo=hn/F,yr=Q/F,ec=0,Or,vs,Ue,ot=0,Ye=0;if(s){ec=h.distance(Ke,Ct),Or=Gn.fromCartesian(Ke,R3e),vs=h.subtract(Ct,Ke,ore),Ue=h.normalize(vs,O3e);let yi=Ue.x;Ue.x=Ue.y,Ue.y=-yi,ot=ec/L,Ye=de/L}for(U=0;U<8;U++){let yi=j+U*4,sa=z+U*2,Xr=yi+3,El=U<4?1:-1,bo=U===2||U===3||U===6||U===7?1:-1;h.pack(Nt.high,x,yi),x[Xr]=Rt.x,h.pack(Nt.low,b,yi),b[Xr]=Rt.y,h.pack(wt,T,yi),T[Xr]=Rt.z,h.pack(xt,C,yi),C[Xr]=Xo*El,h.pack(Ht,A,yi);let Mr=yr*bo;Mr===0&&bo<0&&(Mr=9),A[Xr]=Mr,s&&(S[yi]=Or.high.x,S[yi+1]=Or.high.y,S[yi+2]=Or.low.x,S[yi+3]=Or.low.y,R[yi]=-Qt.y,R[yi+1]=Qt.x,R[yi+2]=Qe.y,R[yi+3]=-Qe.x,w[yi]=vs.x,w[yi+1]=vs.y,w[yi+2]=Ue.x,w[yi+3]=Ue.y,D[sa]=ot*El,Mr=Ye*bo,Mr===0&&bo<0&&(Mr=9),D[sa+1]=Mr)}let Ze=T3e,pt=C3e,qt=x3e,xn=b3e,Ro=ae.fromCartographicArray(g3e,y3e),So=mi.getMinimumMaximumHeights(Ro,u),tc=So.minimumTerrainHeight,nc=So.maximumTerrainHeight;ge+=Math.abs(tc),ge+=Math.abs(nc),Qoe(Te,ve,tc,nc,Ze,qt),Qoe(J,Y,tc,nc,pt,xn);let Ai=h.multiplyByScalar(Ht,P.EPSILON5,rre);h.add(Ze,Ai,Ze),h.add(pt,Ai,pt),h.add(qt,Ai,qt),h.add(xn,Ai,xn),pF(Ze,pt),pF(qt,xn),h.pack(Ze,y,B),h.pack(pt,y,B+3),h.pack(xn,y,B+6),h.pack(qt,y,B+9),Ai=h.multiplyByScalar(Ht,-2*P.EPSILON5,rre),h.add(Ze,Ai,Ze),h.add(pt,Ai,pt),h.add(qt,Ai,qt),h.add(xn,Ai,xn),pF(Ze,pt),pF(qt,xn),h.pack(Ze,y,B+12),h.pack(pt,y,B+15),h.pack(xn,y,B+18),h.pack(qt,y,B+21),k+=2,c+=3,z+=16,B+=24,j+=32,Q+=hn,de+=ec}c=0;let le=0;for(a=0;a<f;a++){for(U=0;U<sre;U++)m[c+U]=hre[U]+le;le+=8,c+=sre}let ye=M3e;re.fromVertices(n,h.ZERO,3,ye[0]),re.fromVertices(i,h.ZERO,3,ye[1]);let be=re.fromBoundingSpheres(ye);be.radius+=ge/(f*2);let Ie={position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Lg(x),startLoAndForwardOffsetY:Lg(b),startNormalAndForwardOffsetZ:Lg(T),endNormalAndTextureCoordinateNormalizationX:Lg(C),rightNormalAndTextureCoordinateNormalizationY:Lg(A)};return s&&(Ie.startHiLo2D=Lg(S),Ie.offsetAndRight2D=Lg(w),Ie.startEndNormals2D=Lg(R),Ie.texcoordNormalization2D=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,normalize:!1,values:D})),new lt({attributes:Ie,indices:m,boundingSphere:be})}function Lg(e){return new we({componentDatatype:K.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Ng._projectNormal=Mw;var WC=Ng;var gF=`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 yF=`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 xF=`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 bF=`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 TF=`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 If=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var $j=`${If} -${TF}`,N3e=kC;Ft.isInternetExplorer()||($j=`#define CLIP_POLYLINE -${$j}`);function zx(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=zx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??$j,this._fragmentShaderSource=e.fragmentShaderSource??N3e,this._renderState=lo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(zx.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}}});zx.VERTEX_FORMAT=De.POSITION_ONLY;zx.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;zx.prototype.isTranslucent=lo.prototype.isTranslucent;zx.prototype.getRenderState=lo.prototype.getRenderState;var ds=zx;var CF=`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 qC=`#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 Zj=`${If} -${CF}`,F3e=qC;Ft.isInternetExplorer()||(Zj=`#define CLIP_POLYLINE -${Zj}`);function Vx(e){e=e??G.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Vx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Ji.fromType(Ji.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??Zj,this._fragmentShaderSource=e.fragmentShaderSource??F3e,this._renderState=lo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Vx.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}}});Vx.VERTEX_FORMAT=De.POSITION_AND_ST;Vx.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;Vx.prototype.isTranslucent=lo.prototype.isTranslucent;Vx.prototype.getRenderState=lo.prototype.getRenderState;var Ua=Vx;function qp(e){e=e??G.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ua),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??zn.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=mre(!1),this._renderState3DTiles=mre(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Si.FRONT},depthTest:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(qp.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}}});qp.initializeTerrainHeights=function(){return mi.initialize()};function B3e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(bF);s=Dn._appendShowToShader(o,s),s=Dn._appendDistanceDisplayConditionToShader(o,s),s=Dn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(xF);a=Dn._appendShowToShader(o,a),a=Dn._appendDistanceDisplayConditionToShader(o,a),a=Dn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(gF),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],_=new Be({defines:u,sources:[s]}),m=new Be({defines:p,sources:[d,c]});e._sp=Xt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Be({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(x)){let b=new Be({defines:u.concat([`MAX_TERRAIN_HEIGHT ${mi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(yF);let T=new Be({defines:p,sources:[d,c]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:r})}e._spMorph=x}function mre(e){return ze.fromCache({cull:{enabled:!0},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})}function k3e(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof ds?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],_=o[d];l(_)||(_=o[d]=new qe({owner:e,primitiveType:s._primitiveType})),_.vertexArray=p,_.renderState=e._renderState,_.shaderProgram=e._sp,_.uniformMap=f,_.pass=Se.TERRAIN_CLASSIFICATION,_.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=qe.shallowClone(_,_.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=m;let y=qe.shallowClone(_,_.derivedCommands.color2D);y.shaderProgram=e._sp2D,_.derivedCommands.color2D=y;let x=qe.shallowClone(m,m.derivedCommands.color2D);x.shaderProgram=e._sp2D,m.derivedCommands.color2D=x;let b=qe.shallowClone(_,_.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",_.derivedCommands.colorMorph=b}}function pre(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function U3e(e,t,n,i,o,r,s){let a=e._primitive;Dn._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==zn.CESIUM_3D_TILE,p=f!==zn.TERRAIN&&!u,_,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let x=0;x<y;++x){let b=c[x];d&&(_=n[x],pre(e,_,t,o,r,b,s)),p&&(_=n[x].derivedCommands.tileset,pre(e,_,t,o,r,b,s))}}}qp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!mi.initialized){qp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Yc({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,WC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Pt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){B3e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,_,m){k3e(n,u,f,d,_,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,_,m,y){U3e(n,u,f,d,p,_,m)},this._primitive=new Dn(i)}if(this.appearance instanceof ds&&!this._hasPerInstanceColors)throw new he("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))})};qp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};qp.isSupported=function(e){return e.frameState.context.depthTexture};qp.prototype.isDestroyed=function(){return!1};qp.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,ce(this)};var sm=qp;var z3e=new V(1,1),V3e=!1,H3e=H.WHITE;function YC(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(YC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});YC.prototype.getType=function(e){return"Image"};var G3e=new $;YC.prototype.getValue=function(e,t){return l(e)||(e=$.now(G3e)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,z3e,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,H3e,t.color),X.getValueOrDefault(this._transparent,e,V3e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};YC.prototype.equals=function(e){return this===e||e instanceof YC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Hx=YC;function j3e(e){if(e instanceof H)return new Wt(e);if(typeof e=="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Hx;return t.image=e,t}}function W3e(e,t){return ue(e,t,j3e)}var Ho=W3e;function Lw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Lw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});Lw.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 Lw(this)};Lw.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 XC=Lw;var q3e={FIXED:0,INERTIAL:1},Wi=Object.freeze(q3e);function KC(){he.throwInstantiationError()}Object.defineProperties(KC.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});KC.prototype.getValue=he.throwInstantiationError;KC.prototype.getValueInReferenceFrame=he.throwInstantiationError;KC.prototype.equals=he.throwInstantiationError;var _re=new Z;KC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=Et.computeIcrfToCentralBodyFixedMatrix(e,_re);if(n===Wi.INERTIAL)return Z.multiplyByVector(r,t,o);if(n===Wi.FIXED)return Z.multiplyByVector(Z.transpose(r,_re),t,o)};var am=KC;function Gx(e,t){this._definitionChanged=new me,this._value=h.clone(e),this._referenceFrame=t??Wi.FIXED}Object.defineProperties(Gx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Wi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Y3e=new $;Gx.prototype.getValue=function(e,t){return l(e)||(e=$.now(Y3e)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Gx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Gx.prototype.getValueInReferenceFrame=function(e,t,n){return am.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Gx.prototype.equals=function(e){return this===e||e instanceof Gx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var kl=Gx;function Nw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Nw.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:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});Nw.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 Nw(this)};Nw.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 $C=Nw;function X3e(e){return e}function K3e(e,t){return ue(e,t,X3e)}var Ul=K3e;function Fw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Fw.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:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});Fw.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 Fw(this)};Fw.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 ZC=Fw;function Bw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Bw.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:Ho("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")});Bw.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 Bw(this)};Bw.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 QC=Bw;function kw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(kw.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:Ho("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")});kw.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 kw(this)};kw.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 JC=kw;function Uw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Uw.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")});Uw.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 Uw(this)};Uw.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 cm=Uw;var $3e=new h(1,1,1),Z3e=h.ZERO,Q3e=Pe.IDENTITY;function gre(e,t,n){this.translation=h.clone(e??Z3e),this.rotation=Pe.clone(t??Q3e),this.scale=h.clone(n??$3e)}gre.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Pe.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var jx=gre;var Qj=new jx;function zw(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(zw.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var J3e=new $;zw.prototype.getValue=function(e,t){return l(e)||(e=$.now(J3e)),l(t)||(t=new jx),t.translation=X.getValueOrClonedDefault(this._translation,e,Qj.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,Qj.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,Qj.scale,t.scale),t};zw.prototype.equals=function(e){return this===e||e instanceof zw&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var eA=zw;function Yp(e,t){this._propertyNames=[],this._definitionChanged=new me,l(e)&&this.merge(e,t)}Object.defineProperties(Yp.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Yp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function eke(e){return new Qn(e)}Yp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ue(e,!0,n??eke)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Yp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var tke=new $;Yp.prototype.getValue=function(e,t){l(e)||(e=$.now(tke)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=X.getValueOrUndefined(this[r],e,t[r])}return t};Yp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function nke(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}Yp.prototype.equals=function(e){return this===e||e instanceof Yp&&nke(this,e)};var zl=Yp;function yre(e){return new eA(e)}function ike(e){return new zl(e,yre)}function oke(e){return new zl(e)}function rke(e){return new zl(e)}function Vw(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??G.EMPTY_OBJECT)}Object.defineProperties(Vw.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,rke),lightColor:ue("lightColor"),distanceDisplayCondition:ue("distanceDisplayCondition"),nodeTransformations:ue("nodeTransformations",void 0,ike),articulations:ue("articulations",void 0,oke),clippingPlanes:ue("clippingPlanes"),customShader:ue("customShader")});Vw.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 Vw(this)};Vw.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 zl(t,yre)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new zl(n)}};var Fg=Vw;function Hw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Hw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),maximumScreenSpaceError:ue("maximumScreenSpaceError")});Hw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Hw(this)};Hw.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var tA=Hw;function Gw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Gw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),leadTime:ue("leadTime"),trailTime:ue("trailTime"),width:ue("width"),resolution:ue("resolution"),material:Ho("material"),distanceDisplayCondition:ue("distanceDisplayCondition")});Gw.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 Gw(this)};Gw.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 Bg=Gw;function jw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(jw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),plane:ue("plane"),dimensions:ue("dimensions"),fill:ue("fill"),material:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});jw.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 jw(this)};jw.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 AF=jw;function Ww(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Ww.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")});Ww.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 Ww(this)};Ww.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 nA=Ww;function ske(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var gc=ske;function ake(e){return Array.isArray(e)&&(e=new gc(e)),new Qn(e)}function qw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(qw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),hierarchy:ue("hierarchy",void 0,ake),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Ho("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")});qw.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 qw(this)};qw.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 lm=qw;function Yw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Yw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),granularity:ue("granularity"),material:Ho("material"),depthFailMaterial:Ho("depthFailMaterial"),arcType:ue("arcType"),clampToGround:ue("clampToGround"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});Yw.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 Yw(this)};Yw.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 Kc=Yw;function Xw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Xw.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:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});Xw.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 Xw(this)};Xw.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 iA=Xw;function Kw(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties(Kw.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:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});Kw.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 Kw(this)};Kw.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 um=Kw;function $w(e){this._definitionChanged=new me,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??G.EMPTY_OBJECT)}Object.defineProperties($w.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:Ho("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});$w.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 $w(this)};$w.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 kg=$w;var cke=new fe,Jj=[];function lke(e){return new kl(e)}function uke(e){return ue(e,void 0,lke)}function Ys(e,t){return ue(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Pf(e){e=e??G.EMPTY_OBJECT;let t=e.id;l(t)||(t=Nn()),this._availability=void 0,this._id=t,this._definitionChanged=new me,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Og.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",...Jj],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 eW(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)&&eW(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Pf.prototype,{availability:Ul("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Ul("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&&eW(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Ul("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&&eW(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ys("billboard",jc),box:Ys("box",XC),corridor:Ys("corridor",$C),cylinder:Ys("cylinder",ZC),description:ue("description"),ellipse:Ys("ellipse",QC),ellipsoid:Ys("ellipsoid",JC),label:Ys("label",cm),model:Ys("model",Fg),tileset:Ys("tileset",tA),orientation:ue("orientation"),path:Ys("path",Bg),plane:Ys("plane",AF),point:Ys("point",nA),polygon:Ys("polygon",lm),polyline:Ys("polyline",Kc),polylineVolume:Ys("polylineVolume",iA),properties:Ys("properties",zl),position:uke("position"),rectangle:Ys("rectangle",um),viewFrom:ue("viewFrom"),wall:Ys("wall",kg)});Pf.registerEntityType=function(e,t){Object.defineProperties(Pf.prototype,{[e]:Ys(e,t)}),Jj.includes(e)||Jj.push(e)};Pf.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Pf.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Ul(e,!0))};Pf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Pf.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 xre=new Z,bre=new h,Tre=new Pe;Pf.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,bre);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,Tre);return l(i)?t=O.fromRotationTranslation(Z.fromQuaternion(i,xre),n,t):t=Et.eastNorthUpToFixedFrame(n,void 0,t),t};Pf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=X.getValueOrDefault(t,e,$e.NONE),s=X.getValueOrUndefined(this._position,e,bre);if(r===$e.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,cke);Sf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,Tre);return l(c)?o=O.fromRotationTranslation(Z.fromQuaternion(c,xre),s,o):o=Et.eastNorthUpToFixedFrame(s,void 0,o),o};Pf.supportsMaterialsforEntitiesOnTerrain=function(e){return Bl.supportsMaterials(e)};Pf.supportsPolylinesOnTerrain=function(e){return sm.isSupported(e)};var hr=Pf;var fke=new Wt(H.WHITE),dke=new Qn(!0),hke=new Qn(!0),mke=new Qn(!1),pke=new Qn(H.BLACK),_ke=new Qn(Tn.DISABLED),gke=new Qn(new Mt),yke=new Qn(zn.BOTH);function $c(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 me,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=hr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties($c.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)&&X.isConstant(this._showProperty)&&X.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)&&X.isConstant(this._showProperty)&&X.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}}});$c.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};$c.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};$c.prototype.createFillGeometryInstance=he.throwInstantiationError;$c.prototype.createOutlineGeometryInstance=he.throwInstantiationError;$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){ce(this)};$c.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};$c.prototype._isOnTerrain=function(e,t){return!1};$c.prototype._getIsClosed=function(e){return!0};$c.prototype._isDynamic=he.throwInstantiationError;$c.prototype._setStaticOptions=he.throwInstantiationError;$c.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(Ge.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Ge.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??fke,this._fillProperty=r??hke,this._showProperty=u??dke,this._showOutlineProperty=o.outline??mke,this._outlineColorProperty=c?o.outlineColor??pke:void 0,this._shadowsProperty=o.shadows??_ke,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??gke,this._classificationTypeProperty=o.classificationType??yke,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Wt);if(c&&f&&(Tt(Tt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};$c.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ai=$c;function oA(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(oA.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var xke=new $;oA.prototype.getValue=function(e,t){return l(e)||(e=$.now(xke)),this._callback(e,t)};oA.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};oA.prototype.equals=function(e){return this===e||e instanceof oA&&this._callback===e._callback&&this._isConstant===e._isConstant};var fm=oA;var Cre=new h;function rA(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new fe,this._normal=new h,this._definitionChanged=new me,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(Ge.MINIMUM_VALUE,Cre);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(rA.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});rA.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.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 bke=new $;rA.prototype.getValue=function(e,t){l(e)||(e=$.now(bke));let n=X.getValueOrDefault(this._heightReference,e,$e.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,$e.NONE);if(n===$e.NONE&&!LC(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Cre);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,P.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};rA.prototype.isDestroyed=function(){return!1};rA.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ce(this)};var sA=rA;function Tke(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 fm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new sA(this._scene,s,r)}}var Ug=Tke;var Are=h.ZERO,Ere=new h,Cke=new h,Sre=new H;function Ake(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function bu(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Ake(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(bu.prototype=Object.create(ai.prototype),bu.prototype.constructor=bu);Object.defineProperties(bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Sre)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Are,Ere))),new Pt({id:t,geometry:mc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Sre),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Are,Ere))),new Pt({id:t,geometry:om.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};bu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};bu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ai.prototype._isHidden.call(this,e,t)};bu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};bu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==$e.NONE?cn.ALL:void 0};bu.prototype._onEntityPropertyChanged=Ug;bu.DynamicGeometryUpdater=aA;function aA(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(aA.prototype=Object.create(si.prototype),aA.prototype.constructor=aA);aA.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,Cke),o=this._options.dimensions;return!l(i)||!l(o)||si.prototype._isHidden.call(this,e,t,n)};aA.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,$e.NONE),o=this._options;o.dimensions=X.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==$e.NONE?cn.ALL:void 0};var EF=bu;function Wx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Wi.FIXED,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(Wx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Eke=new $;Wx.prototype.getValue=function(e,t){return l(e)||(e=$.now(Eke)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Wx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Wx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return am.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Wx.prototype.equals=function(e){return this===e||e instanceof Wx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var SF=Wx;/*! @license DOMPurify 3.2.6 | (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.6/LICENSE */var{entries:Nre,setPrototypeOf:vre,isFrozen:Ske,getPrototypeOf:vke,getOwnPropertyDescriptor:wke}=Object,{freeze:Qc,seal:Df,create:Fre}=Object,{apply:sW,construct:aW}=typeof Reflect<"u"&&Reflect;Qc||(Qc=function(t){return t});Df||(Df=function(t){return t});sW||(sW=function(t,n,i){return t.apply(n,i)});aW||(aW=function(t,n){return new t(...n)});var vF=Jc(Array.prototype.forEach),Ike=Jc(Array.prototype.lastIndexOf),wre=Jc(Array.prototype.pop),Zw=Jc(Array.prototype.push),Pke=Jc(Array.prototype.splice),IF=Jc(String.prototype.toLowerCase),tW=Jc(String.prototype.toString),Ire=Jc(String.prototype.match),Qw=Jc(String.prototype.replace),Dke=Jc(String.prototype.indexOf),Rke=Jc(String.prototype.trim),zd=Jc(Object.prototype.hasOwnProperty),Zc=Jc(RegExp.prototype.test),Jw=Oke(TypeError);function Jc(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return sW(e,t,i)}}function Oke(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return aW(e,n)}}function Di(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IF;vre&&vre(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(Ske(t)||(t[i]=r),o=r)}e[o]=!0}return e}function Mke(e){for(let t=0;t<e.length;t++)zd(e,t)||(e[t]=null);return e}function Xp(e){let t=Fre(null);for(let[n,i]of Nre(e))zd(e,n)&&(Array.isArray(i)?t[n]=Mke(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Xp(i):t[n]=i);return t}function eI(e,t){for(;e!==null;){let i=wke(e,t);if(i){if(i.get)return Jc(i.get);if(typeof i.value=="function")return Jc(i.value)}e=vke(e)}function n(){return null}return n}var Pre=Qc(["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"]),nW=Qc(["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"]),iW=Qc(["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"]),Lke=Qc(["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"]),oW=Qc(["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"]),Nke=Qc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dre=Qc(["#text"]),Rre=Qc(["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"]),rW=Qc(["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"]),Ore=Qc(["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"]),wF=Qc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fke=Df(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bke=Df(/<%[\w\W]*|[\w\W]*%>/gm),kke=Df(/\$\{[\w\W]*/gm),Uke=Df(/^data-[\-\w.\u00B7-\uFFFF]+$/),zke=Df(/^aria-[\-\w]+$/),Bre=Df(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vke=Df(/^(?:\w+script|data):/i),Hke=Df(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kre=Df(/^html$/i),Gke=Df(/^[a-z][.\w]*(-[.\w]+)+$/i),Mre=Object.freeze({__proto__:null,ARIA_ATTR:zke,ATTR_WHITESPACE:Hke,CUSTOM_ELEMENT:Gke,DATA_ATTR:Uke,DOCTYPE_NAME:kre,ERB_EXPR:Bke,IS_ALLOWED_URI:Bre,IS_SCRIPT_OR_DATA:Vke,MUSTACHE_EXPR:Fke,TMPLIT_EXPR:kke}),tI={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},jke=function(){return typeof window>"u"?null:window},Wke=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}},Lre=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ure(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jke(),t=an=>Ure(an);if(t.version="3.2.6",t.removed=[],!e||!e.document||e.document.nodeType!==tI.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:_}=e,m=c.prototype,y=eI(m,"cloneNode"),x=eI(m,"remove"),b=eI(m,"nextSibling"),T=eI(m,"childNodes"),C=eI(m,"parentNode");if(typeof s=="function"){let an=n.createElement("template");an.content&&an.content.ownerDocument&&(n=an.content.ownerDocument)}let A,S="",{implementation:w,createNodeIterator:R,createDocumentFragment:D,getElementsByTagName:M}=n,{importNode:L}=i,g=Lre();t.isSupported=typeof Nre=="function"&&typeof C=="function"&&w&&w.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:E,ERB_EXPR:v,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:z}=Mre,{IS_ALLOWED_URI:B}=Mre,j=null,W=Di({},[...Pre,...nW,...iW,...oW,...Dre]),J=null,Y=Di({},[...Rre,...rW,...Ore,...wF]),ee=Object.seal(Fre(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,ge=!0,le=!0,ye=!1,be=!0,Ie=!1,Te=!0,ve=!1,Ve=!1,Ke=!1,Ct=!1,Qt=!1,Qe=!1,hn=!0,Nt=!1,Rt="user-content-",Zn=!0,gi=!1,Ht={},wt=null,no=Di({},["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"]),xt=null,Xo=Di({},["audio","video","img","source","image","track"]),yr=null,ec=Di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Or="http://www.w3.org/1998/Math/MathML",vs="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml",ot=Ue,Ye=!1,Ze=null,pt=Di({},[Or,vs,Ue],tW),qt=Di({},["mi","mo","mn","ms","mtext"]),xn=Di({},["annotation-xml"]),Ro=Di({},["title","style","font","a","script"]),So=null,tc=["application/xhtml+xml","text/html"],nc="text/html",Ai=null,yi=null,sa=n.createElement("form"),Xr=function(Ae){return Ae instanceof RegExp||Ae instanceof Function},El=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(yi&&yi===Ae)){if((!Ae||typeof Ae!="object")&&(Ae={}),Ae=Xp(Ae),So=tc.indexOf(Ae.PARSER_MEDIA_TYPE)===-1?nc:Ae.PARSER_MEDIA_TYPE,Ai=So==="application/xhtml+xml"?tW:IF,j=zd(Ae,"ALLOWED_TAGS")?Di({},Ae.ALLOWED_TAGS,Ai):W,J=zd(Ae,"ALLOWED_ATTR")?Di({},Ae.ALLOWED_ATTR,Ai):Y,Ze=zd(Ae,"ALLOWED_NAMESPACES")?Di({},Ae.ALLOWED_NAMESPACES,tW):pt,yr=zd(Ae,"ADD_URI_SAFE_ATTR")?Di(Xp(ec),Ae.ADD_URI_SAFE_ATTR,Ai):ec,xt=zd(Ae,"ADD_DATA_URI_TAGS")?Di(Xp(Xo),Ae.ADD_DATA_URI_TAGS,Ai):Xo,wt=zd(Ae,"FORBID_CONTENTS")?Di({},Ae.FORBID_CONTENTS,Ai):no,Q=zd(Ae,"FORBID_TAGS")?Di({},Ae.FORBID_TAGS,Ai):Xp({}),de=zd(Ae,"FORBID_ATTR")?Di({},Ae.FORBID_ATTR,Ai):Xp({}),Ht=zd(Ae,"USE_PROFILES")?Ae.USE_PROFILES:!1,ge=Ae.ALLOW_ARIA_ATTR!==!1,le=Ae.ALLOW_DATA_ATTR!==!1,ye=Ae.ALLOW_UNKNOWN_PROTOCOLS||!1,be=Ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Ae.SAFE_FOR_TEMPLATES||!1,Te=Ae.SAFE_FOR_XML!==!1,ve=Ae.WHOLE_DOCUMENT||!1,Ct=Ae.RETURN_DOM||!1,Qt=Ae.RETURN_DOM_FRAGMENT||!1,Qe=Ae.RETURN_TRUSTED_TYPE||!1,Ke=Ae.FORCE_BODY||!1,hn=Ae.SANITIZE_DOM!==!1,Nt=Ae.SANITIZE_NAMED_PROPS||!1,Zn=Ae.KEEP_CONTENT!==!1,gi=Ae.IN_PLACE||!1,B=Ae.ALLOWED_URI_REGEXP||Bre,ot=Ae.NAMESPACE||Ue,qt=Ae.MATHML_TEXT_INTEGRATION_POINTS||qt,xn=Ae.HTML_INTEGRATION_POINTS||xn,ee=Ae.CUSTOM_ELEMENT_HANDLING||{},Ae.CUSTOM_ELEMENT_HANDLING&&Xr(Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&Xr(Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=Ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ae.CUSTOM_ELEMENT_HANDLING&&typeof Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=Ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(le=!1),Qt&&(Ct=!0),Ht&&(j=Di({},Dre),J=[],Ht.html===!0&&(Di(j,Pre),Di(J,Rre)),Ht.svg===!0&&(Di(j,nW),Di(J,rW),Di(J,wF)),Ht.svgFilters===!0&&(Di(j,iW),Di(J,rW),Di(J,wF)),Ht.mathMl===!0&&(Di(j,oW),Di(J,Ore),Di(J,wF))),Ae.ADD_TAGS&&(j===W&&(j=Xp(j)),Di(j,Ae.ADD_TAGS,Ai)),Ae.ADD_ATTR&&(J===Y&&(J=Xp(J)),Di(J,Ae.ADD_ATTR,Ai)),Ae.ADD_URI_SAFE_ATTR&&Di(yr,Ae.ADD_URI_SAFE_ATTR,Ai),Ae.FORBID_CONTENTS&&(wt===no&&(wt=Xp(wt)),Di(wt,Ae.FORBID_CONTENTS,Ai)),Zn&&(j["#text"]=!0),ve&&Di(j,["html","head","body"]),j.table&&(Di(j,["tbody"]),delete Q.tbody),Ae.TRUSTED_TYPES_POLICY){if(typeof Ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw Jw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Jw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=Ae.TRUSTED_TYPES_POLICY,S=A.createHTML("")}else A===void 0&&(A=Wke(_,o)),A!==null&&typeof S=="string"&&(S=A.createHTML(""));Qc&&Qc(Ae),yi=Ae}},bo=Di({},[...nW,...iW,...Lke]),Mr=Di({},[...oW,...Nke]),Ip=function(Ae){let St=C(Ae);(!St||!St.tagName)&&(St={namespaceURI:ot,tagName:"template"});let _n=IF(Ae.tagName),xr=IF(St.tagName);return Ze[Ae.namespaceURI]?Ae.namespaceURI===vs?St.namespaceURI===Ue?_n==="svg":St.namespaceURI===Or?_n==="svg"&&(xr==="annotation-xml"||qt[xr]):!!bo[_n]:Ae.namespaceURI===Or?St.namespaceURI===Ue?_n==="math":St.namespaceURI===vs?_n==="math"&&xn[xr]:!!Mr[_n]:Ae.namespaceURI===Ue?St.namespaceURI===vs&&!xn[xr]||St.namespaceURI===Or&&!qt[xr]?!1:!Mr[_n]&&(Ro[_n]||!bo[_n]):!!(So==="application/xhtml+xml"&&Ze[Ae.namespaceURI]):!1},Kr=function(Ae){Zw(t.removed,{element:Ae});try{C(Ae).removeChild(Ae)}catch{x(Ae)}},Sl=function(Ae,St){try{Zw(t.removed,{attribute:St.getAttributeNode(Ae),from:St})}catch{Zw(t.removed,{attribute:null,from:St})}if(St.removeAttribute(Ae),Ae==="is")if(Ct||Qt)try{Kr(St)}catch{}else try{St.setAttribute(Ae,"")}catch{}},ic=function(Ae){let St=null,_n=null;if(Ke)Ae="<remove></remove>"+Ae;else{let Hs=Ire(Ae,/^[\r\n\t ]+/);_n=Hs&&Hs[0]}So==="application/xhtml+xml"&&ot===Ue&&(Ae='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ae+"</body></html>");let xr=A?A.createHTML(Ae):Ae;if(ot===Ue)try{St=new p().parseFromString(xr,So)}catch{}if(!St||!St.documentElement){St=w.createDocument(ot,"template",null);try{St.documentElement.innerHTML=Ye?S:xr}catch{}}let oc=St.body||St.documentElement;return Ae&&_n&&oc.insertBefore(n.createTextNode(_n),oc.childNodes[0]||null),ot===Ue?M.call(St,ve?"html":"body")[0]:ve?St.documentElement:oc},mx=function(Ae){return R.call(Ae.ownerDocument||Ae,Ae,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},aa=function(Ae){return Ae instanceof d&&(typeof Ae.nodeName!="string"||typeof Ae.textContent!="string"||typeof Ae.removeChild!="function"||!(Ae.attributes instanceof f)||typeof Ae.removeAttribute!="function"||typeof Ae.setAttribute!="function"||typeof Ae.namespaceURI!="string"||typeof Ae.insertBefore!="function"||typeof Ae.hasChildNodes!="function")},vl=function(Ae){return typeof a=="function"&&Ae instanceof a};function Uc(an,Ae,St){vF(an,_n=>{_n.call(t,Ae,St,yi)})}let ls=function(Ae){let St=null;if(Uc(g.beforeSanitizeElements,Ae,null),aa(Ae))return Kr(Ae),!0;let _n=Ai(Ae.nodeName);if(Uc(g.uponSanitizeElement,Ae,{tagName:_n,allowedTags:j}),Te&&Ae.hasChildNodes()&&!vl(Ae.firstElementChild)&&Zc(/<[/\w!]/g,Ae.innerHTML)&&Zc(/<[/\w!]/g,Ae.textContent)||Ae.nodeType===tI.progressingInstruction||Te&&Ae.nodeType===tI.comment&&Zc(/<[/\w]/g,Ae.data))return Kr(Ae),!0;if(!j[_n]||Q[_n]){if(!Q[_n]&&uf(_n)&&(ee.tagNameCheck instanceof RegExp&&Zc(ee.tagNameCheck,_n)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(_n)))return!1;if(Zn&&!wt[_n]){let xr=C(Ae)||Ae.parentNode,oc=T(Ae)||Ae.childNodes;if(oc&&xr){let Hs=oc.length;for(let wl=Hs-1;wl>=0;--wl){let Pp=y(oc[wl],!0);Pp.__removalCount=(Ae.__removalCount||0)+1,xr.insertBefore(Pp,b(Ae))}}}return Kr(Ae),!0}return Ae instanceof c&&!Ip(Ae)||(_n==="noscript"||_n==="noembed"||_n==="noframes")&&Zc(/<\/no(script|embed|frames)/i,Ae.innerHTML)?(Kr(Ae),!0):(Ie&&Ae.nodeType===tI.text&&(St=Ae.textContent,vF([E,v,I],xr=>{St=Qw(St,xr," ")}),Ae.textContent!==St&&(Zw(t.removed,{element:Ae.cloneNode()}),Ae.textContent=St)),Uc(g.afterSanitizeElements,Ae,null),!1)},lf=function(Ae,St,_n){if(hn&&(St==="id"||St==="name")&&(_n in n||_n in sa))return!1;if(!(le&&!de[St]&&Zc(N,St))){if(!(ge&&Zc(F,St))){if(!J[St]||de[St]){if(!(uf(Ae)&&(ee.tagNameCheck instanceof RegExp&&Zc(ee.tagNameCheck,Ae)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(Ae))&&(ee.attributeNameCheck instanceof RegExp&&Zc(ee.attributeNameCheck,St)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(St))||St==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Zc(ee.tagNameCheck,_n)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(_n))))return!1}else if(!yr[St]){if(!Zc(B,Qw(_n,k,""))){if(!((St==="src"||St==="xlink:href"||St==="href")&&Ae!=="script"&&Dke(_n,"data:")===0&&xt[Ae])){if(!(ye&&!Zc(U,Qw(_n,k,"")))){if(_n)return!1}}}}}}return!0},uf=function(Ae){return Ae!=="annotation-xml"&&Ire(Ae,z)},ff=function(Ae){Uc(g.beforeSanitizeAttributes,Ae,null);let{attributes:St}=Ae;if(!St||aa(Ae))return;let _n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},xr=St.length;for(;xr--;){let oc=St[xr],{name:Hs,namespaceURI:wl,value:Pp}=oc,Yv=Ai(Hs),F6=Pp,rc=Hs==="value"?F6:Rke(F6);if(_n.attrName=Yv,_n.attrValue=rc,_n.keepAttr=!0,_n.forceKeepAttr=void 0,Uc(g.uponSanitizeAttribute,Ae,_n),rc=_n.attrValue,Nt&&(Yv==="id"||Yv==="name")&&(Sl(Hs,Ae),rc=Rt+rc),Te&&Zc(/((--!?|])>)|<\/(style|title)/i,rc)){Sl(Hs,Ae);continue}if(_n.forceKeepAttr)continue;if(!_n.keepAttr){Sl(Hs,Ae);continue}if(!be&&Zc(/\/>/i,rc)){Sl(Hs,Ae);continue}Ie&&vF([E,v,I],VJ=>{rc=Qw(rc,VJ," ")});let zJ=Ai(Ae.nodeName);if(!lf(zJ,Yv,rc)){Sl(Hs,Ae);continue}if(A&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!wl)switch(_.getAttributeType(zJ,Yv)){case"TrustedHTML":{rc=A.createHTML(rc);break}case"TrustedScriptURL":{rc=A.createScriptURL(rc);break}}if(rc!==F6)try{wl?Ae.setAttributeNS(wl,Hs,rc):Ae.setAttribute(Hs,rc),aa(Ae)?Kr(Ae):wre(t.removed)}catch{Sl(Hs,Ae)}}Uc(g.afterSanitizeAttributes,Ae,null)},Bo=function an(Ae){let St=null,_n=mx(Ae);for(Uc(g.beforeSanitizeShadowDOM,Ae,null);St=_n.nextNode();)Uc(g.uponSanitizeShadowNode,St,null),ls(St),ff(St),St.content instanceof r&&an(St.content);Uc(g.afterSanitizeShadowDOM,Ae,null)};return t.sanitize=function(an){let Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},St=null,_n=null,xr=null,oc=null;if(Ye=!an,Ye&&(an="<!-->"),typeof an!="string"&&!vl(an))if(typeof an.toString=="function"){if(an=an.toString(),typeof an!="string")throw Jw("dirty is not a string, aborting")}else throw Jw("toString is not a function");if(!t.isSupported)return an;if(Ve||El(Ae),t.removed=[],typeof an=="string"&&(gi=!1),gi){if(an.nodeName){let Pp=Ai(an.nodeName);if(!j[Pp]||Q[Pp])throw Jw("root node is forbidden and cannot be sanitized in-place")}}else if(an instanceof a)St=ic("<!---->"),_n=St.ownerDocument.importNode(an,!0),_n.nodeType===tI.element&&_n.nodeName==="BODY"||_n.nodeName==="HTML"?St=_n:St.appendChild(_n);else{if(!Ct&&!Ie&&!ve&&an.indexOf("<")===-1)return A&&Qe?A.createHTML(an):an;if(St=ic(an),!St)return Ct?null:Qe?S:""}St&&Ke&&Kr(St.firstChild);let Hs=mx(gi?an:St);for(;xr=Hs.nextNode();)ls(xr),ff(xr),xr.content instanceof r&&Bo(xr.content);if(gi)return an;if(Ct){if(Qt)for(oc=D.call(St.ownerDocument);St.firstChild;)oc.appendChild(St.firstChild);else oc=St;return(J.shadowroot||J.shadowrootmode)&&(oc=L.call(i,oc,!0)),oc}let wl=ve?St.outerHTML:St.innerHTML;return ve&&j["!doctype"]&&St.ownerDocument&&St.ownerDocument.doctype&&St.ownerDocument.doctype.name&&Zc(kre,St.ownerDocument.doctype.name)&&(wl="<!DOCTYPE "+St.ownerDocument.doctype.name+`> -`+wl),Ie&&vF([E,v,I],Pp=>{wl=Qw(wl,Pp," ")}),A&&Qe?A.createHTML(wl):wl},t.setConfig=function(){let an=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(an),Ve=!0},t.clearConfig=function(){yi=null,Ve=!1},t.isValidAttribute=function(an,Ae,St){yi||El({});let _n=Ai(an),xr=Ai(Ae);return lf(_n,xr,St)},t.addHook=function(an,Ae){typeof Ae=="function"&&Zw(g[an],Ae)},t.removeHook=function(an,Ae){if(Ae!==void 0){let St=Ike(g[an],Ae);return St===-1?void 0:Pke(g[an],St,1)[0]}return wre(g[an])},t.removeHooks=function(an){g[an]=[]},t.removeAllHooks=function(){g=Lre()},t}var zre=Ure();var qke=0,cW={};function dm(e,t){let n,i=e;l(cW[i])?n=cW[i]:(n=qke++,cW[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(dm.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=zre.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}}});dm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};dm.prototype.equals=function(e){return dm.equals(this,e)};dm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};dm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new dm(e.html,t)};dm.clone=function(e){if(l(e))return new dm(e.html,e.showOnScreen)};var _t=dm;function Yke(e,t){Tt(e,t)}var Mo=Yke;function qx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new me}Object.defineProperties(qx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});qx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function lW(e){e._cubeMapBuffers=void 0}qx.prototype.update=function(e){let{context:t}=e;if(!qx.isSupported(t))return;if(l(this._texture)){lW(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(lW(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;fa(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT);let o=je.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(fr.FaceName).forEach(d=>{f[d]=void 0});for(let d=r;d<a;d++)n.push(f)}let c=new zt({minificationFilter:ft.LINEAR_MIPMAP_LINEAR}),u=new fr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};qx.prototype.isDestroyed=function(){return!1};qx.prototype.destroy=function(){return lW(this),this._texture=this._texture&&this._texture.destroy(),ce(this)};var hm=qx;function nI(e){e=e??G.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?V.clone(e.imageBasedLightingFactor):new V(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=V.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(nI.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=V.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 Xke(e,t){if(hm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new hm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}nI.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;V.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=V.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&&(Xke(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)};nI.prototype.isDestroyed=function(){return!1};nI.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ce(this)};var cA=nI;var fW=$r(pu(),1);var uW,Vre="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",PF={};PF.defaultAccessToken=Vre;PF.defaultServer=new Ee({url:"https://api.cesium.com/"});PF.getDefaultTokenCredit=function(e){if(e===Vre){if(!l(uW)){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>`;uW=new _t(t,!0)}return uW}};var mm=PF;function el(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Kke};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new se("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ee.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new fW.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)&&(el.prototype=Object.create(Ee.prototype),el.prototype.constructor=el);el.fromAssetId=function(e,t){let n=el._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new el(i,n)})};Object.defineProperties(el.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=el.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});el.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(_t.getIonCredit),i=mm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(_t.clone(i)),n};el.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new el(t._ionEndpoint,t._ionEndpointResource)),e=Ee.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};el.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ee.prototype.fetchImage.call(this,e)};el.prototype._makeRequest=function(e){return this._isExternal||new fW.default(this.url).authority()!==this._ionEndpointDomain?Ee.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),Ee.prototype._makeRequest.call(this,e))};el._createEndpointResource=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.server??mm.defaultServer,i=t.accessToken??mm.defaultAccessToken;n=Ee.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function Kke(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 Rf=el;function pm(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(pm.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}}});pm.prototype.get=function(e){return this._array[e]};pm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};pm.prototype.peek=function(){return this._array[this._length-1]};pm.prototype.push=function(e){let t=this.length++;this._array[t]=e};pm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};pm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};pm.prototype.resize=function(e){this.length=e};pm.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Vl=pm;var Kp={X:0,Y:1,Z:2};Kp.Y_UP_TO_Z_UP=O.fromRotationTranslation(Z.fromArray([1,0,0,0,0,1,0,-1,0]));Kp.Z_UP_TO_Y_UP=O.fromRotationTranslation(Z.fromArray([1,0,0,0,0,-1,0,1,0]));Kp.X_UP_TO_Z_UP=O.fromRotationTranslation(Z.fromArray([0,0,1,0,1,0,-1,0,0]));Kp.Z_UP_TO_X_UP=O.fromRotationTranslation(Z.fromArray([0,0,-1,0,1,0,1,0,0]));Kp.X_UP_TO_Y_UP=O.fromRotationTranslation(Z.fromArray([0,1,0,-1,0,0,0,0,1]));Kp.Y_UP_TO_X_UP=O.fromRotationTranslation(Z.fromArray([0,-1,0,1,0,0,0,0,1]));Kp.fromName=function(e){return Kp[e]};var Go=Object.freeze(Kp);function Hre(e){e=e??G.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Hre.prototype,{metadata:{get:function(){return this._metadata}}});var lA=Hre;function zg(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),zg.decode(e)}zg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};zg.decodeWithFromCharCode=function(e){let t="",n=$ke(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 iI(e,t,n){return t<=e&&e<=n}function $ke(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(iI(u,0,127)){s.push(u);continue}if(iI(u,194,223)){i=1,t=u&31;continue}if(iI(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(iI(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new se("String decoding failed.")}if(!iI(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?zg.decode=zg.decodeWithTextDecoder:zg.decode=zg.decodeWithFromCharCode;var ha=zg;function Zke(e,t){return t=t??0,ha(e,t,Math.min(4,e.length))}var Hl=Zke;function Of(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(Of.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 oI=Uint32Array.BYTES_PER_ELEMENT;Of.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=oI;let c=a.getUint32(o,!0);if(c!==1)throw new se(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=oI,o+=oI;let u=a.getUint32(o,!0);o+=oI;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let m=0;m<u;++m){let y=Hl(s,o),x=a.getUint32(o+oI*2,!0),b=r[y],T=`${f}${m}`,C=n.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(b))d[m]=Promise.resolve(b(e,t,C,i,o));else throw new se(`Unknown tile content type, ${y}, inside Composite tile`);o+=x}let p=await Promise.all(d);return new Of(e,t,n,p)};Of.prototype.hasProperty=function(e,t){return!1};Of.prototype.getFeature=function(e){};Of.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Of.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Of.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)};Of.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Of.prototype.isDestroyed=function(){return!1};Of.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var DF=Of;function Qke(e,t,n){return JSON.parse(ha(e,t,n))}var jo=Qke;function yc(e){this._id=Nn();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,Lt.maximumTextureSize),r=Math.ceil(t/Lt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new V(o,r),i=new ie(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(yc.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}}});yc.DEFAULT_COLOR_VALUE=H.WHITE;yc.DEFAULT_SHOW_VALUE=!0;function Gre(e){let t=e._textureDimensions;return t.x*t.y*4}function jre(e){if(!l(e._batchValues)){let t=Gre(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Wre(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}yc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Wre(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=jre(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};yc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};yc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Jke=new Array(4);yc.prototype.setColor=function(e,t){if(H.equals(t,yc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Jke),i=n[3],o=jre(this),r=e*4,s=Wre(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};yc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};yc.prototype.getColor=function(e,t){if(!l(this._batchValues))return H.clone(yc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return H.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};yc.prototype.getPickColor=function(e){return this._pickIds[e]};function qre(e,t,n){let i=e._textureDimensions;return new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:zt.NEAREST})}function eUe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Gre(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=H.floatToByte(f.red),r[d+1]=H.floatToByte(f.green),r[d+2]=H.floatToByte(f.blue),r[d+3]=H.floatToByte(f.alpha)}e._pickTexture=qre(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function tUe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}yc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&eUe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=qre(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),tUe(this))};yc.prototype.isDestroyed=function(){return!1};yc.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 ce(this)};var Gl=yc;var nUe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},iUe={SCALAR:void 0,VEC2:V,VEC3:h,VEC4:ie,MAT2:ti,MAT3:Z,MAT4:O};function oUe(e){let t=e.componentType,n;typeof t=="string"?n=K.fromName(t):n=t;let i=nUe[e.type],o=iUe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return K.createArrayBufferView(n,r,s,i*a)}}}var Mf=oUe;function $p(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,rUe(this,e.extension,e.binaryBody)}Object.defineProperties($p.prototype,{byteLength:{get:function(){return this._byteLength}}});function rUe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??K.UNSIGNED_SHORT,c.type=rn.SCALAR,r=Mf(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let _;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??K.UNSIGNED_SHORT,u.type=rn.SCALAR,r=Mf(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),_=new Uint16Array(s),d=0,i=0;i<s;++i)_[i]=d,d+=u[i];p+=_.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??K.UNSIGNED_SHORT,f.type=rn.SCALAR,r=Mf(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,T=a[i].instances,C=sUe(b,T,n);p+=aUe(C),a[i].instances=ct(C,T)}let y=new Array(m).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=u,e._parentIndexes=_,e._parentIds=f,e._byteLength=p}function sUe(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 se("componentType is required.");if(!l(c))throw new se("type is required.");if(!l(n))throw new se(`Property ${o} requires a batch table binary.`);let u=Mf(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function aUe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var cUe=[],lUe=[],uUe=0;function fUe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=cUe;c.length=Math.max(c.length,a);let u=++uUe,f=lUe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],_=s[t];for(let m=0;m<p;++m){let y=r[_+m];y!==t&&f.push(y)}}}function dUe(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 rI(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return fUe(e,t,n)}else return n(e,t);return dUe(e,t,n)}$p.prototype.hasProperty=function(e,t){let n=rI(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};$p.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};$p.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,rI(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};$p.prototype.getProperty=function(e,t){return rI(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)?hUe(a,s):Fe(a[s],!0)})};function hUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}$p.prototype.setProperty=function(e,t,n){let i=rI(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?mUe(u,c,n):u[c]=Fe(n,!0),!0});return l(i)};function mUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}$p.prototype.isClass=function(e,t){let n=rI(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};$p.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var uA=$p;var pUe={HIGHLIGHT:0,REPLACE:1,MIX:2},Tu=Object.freeze(pUe);var dW=Gl.DEFAULT_COLOR_VALUE,hW=Gl.DEFAULT_SHOW_VALUE;function Co(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let s=_Ue(n);this._properties=s,this._batchTableHierarchy=gUe(this,n,i);let a=Xre(t,s,i);this._binaryPropertiesByteLength=yUe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Gl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Co._deprecationWarning=Mo;Object.defineProperties(Co.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function _Ue(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Fe(e[n],!0));return t}function gUe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Co._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 uA({extension:i,binaryBody:n})}function Xre(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 se("componentType is required.");if(!l(c))throw new se("type is required.");if(!l(n))throw new se(`Property ${o} requires a batch table binary.`);let u=Mf(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function yUe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Co.getBinaryProperties=function(e,t,n){return Xre(e,t,n)};Co.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Co.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Co.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Co.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Co.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Co.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Co.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var xUe=new H;Co.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(dW),this.setAllShow(hW);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?e.color.evaluateColor(o,xUe)??dW:dW,s=l(e.show)?e.show.evaluate(o)??hW:hW;this.setColor(i,r),this.setShow(i,s)}};function bUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function TUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Co.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Co.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Co.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Co.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Co.prototype.hasPropertyBySemantic=function(){return!1};Co.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};Co.prototype.getPropertyBySemantic=function(e,t){};Co.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return bUe(i,e)}let n=this._properties[t];if(l(n))return Fe(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Co.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){TUe(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]=Fe(n,!0)};function CUe(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)); -} -`}Co.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Kre(o,n,!1),s;return Lt.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} -${CUe(i)}${s}`}};function Yre(e,t){return e=Be.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function AUe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Kre(e,t,n){if(!l(t))return Yre(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Yre(e,n);let r=o[0],s=o[2];e=Be.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=AUe(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${r} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}Co.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Kre(i,t,!0),Lt.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 EUe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Tu.HIGHLIGHT)return 0;if(n===Tu.REPLACE)return 1;if(n===Tu.MIX)return P.clamp(i,P.EPSILON4,1)}Co.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return ct(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 EUe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Co.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Vg={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Co.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=SUe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Se.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=vUe(f),f.dirty=!1);let p=d.originalCommand;c!==Vg.ALL_OPAQUE&&f.pass!==Se.TRANSLUCENT&&(l(d.translucent)||(d.translucent=wUe(p))),c!==Vg.ALL_TRANSLUCENT&&f.pass!==Se.TRANSLUCENT&&(l(d.opaque)||(d.opaque=IUe(p)),a&&(r||(l(d.zback)||(d.zback=DUe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==OUe(d.stencil))&&(f.renderState.depthMask?d.stencil=RUe(p,o._selectionDepth):d.stencil=d.opaque)));let _=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Se.TRANSLUCENT?(c===Vg.ALL_OPAQUE&&(n[u]=_),c===Vg.ALL_TRANSLUCENT&&(n[u]=m),c===Vg.OPAQUE_AND_TRANSLUCENT&&(n[u]=_,n.push(m))):n[u]=p}};function SUe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Vg.ALL_OPAQUE:t===e.featuresLength?Vg.ALL_TRANSLUCENT:Vg.OPAQUE_AND_TRANSLUCENT}function vUe(e){let t=qe.shallowClone(e),n=t.pass===Se.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function wUe(e){let t=qe.shallowClone(e);return t.pass=Se.TRANSLUCENT,t.renderState=MUe(e.renderState),t}function IUe(e){let t=qe.shallowClone(e);return t.renderState=LUe(e.renderState),t}function PUe(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 DUe(e,t){let n=qe.shallowClone(t),i=Fe(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Si.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=jt.setCesium3DTileBit(),i.stencilMask=jt.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Fe(t.uniformMap);let o=new V(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=PUe(e,t.shaderProgram),n}function RUe(e,t){let n=qe.shallowClone(e),i=Fe(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=jt.SKIP_LOD_MASK,i.stencilTest.reference=jt.CESIUM_3D_TILE_MASK|t<<jt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ht.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ht.REPLACE,i.stencilMask=jt.CESIUM_3D_TILE_MASK|jt.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function OUe(e){return(e.renderState.stencilTest.reference&jt.SKIP_LOD_MASK)>>>jt.SKIP_LOD_BIT_SHIFT}function MUe(e){let t=Fe(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=fn.ALPHA_BLEND,t.stencilTest=jt.setCesium3DTileBit(),t.stencilMask=jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function LUe(e){let t=Fe(e,!0);return t.stencilTest=jt.setCesium3DTileBit(),t.stencilMask=jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}Co.prototype.update=function(e,t){this._batchTexture.update(e,t)};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ce(this)};var Hg=Co;function NUe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Zp=NUe;var sI=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;function Lf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Lf.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 H),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)}}});Lf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Lf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Lf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Lf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Lf.prototype.getPropertyInherited=function(e){return Lf.getPropertyInherited(this._content,this._batchId,e)};Lf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Lf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Lf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Lf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ma=Lf;var mW=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)})}},pW=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)})}},jl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},FUe=new mW;Object.assign(jl,{hooks:FUe,plugins:new pW(jl),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"});jl.max_unop_len=jl.getMaxKeyLen(jl.unary_ops);jl.max_binop_len=jl.getMaxKeyLen(jl.binary_ops);var Gg=e=>new jl(e).parse(),BUe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(jl).filter(e=>!BUe.includes(e)&&Gg[e]===void 0).forEach(e=>{Gg[e]=jl[e]});Gg.Jsep=jl;var kUe="ConditionalExpression",UUe={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:kUe,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 :")}})}};Gg.plugins.register(UUe);var zUe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(zUe);function Vd(e,t){this._expression=e,e=JUe(e,t),e=tze(eze(e)),Gg.addBinaryOp("=~",0),Gg.addBinaryOp("!~",0);let n;try{n=Gg(e)}catch(i){throw new se(i)}this._runtimeAst=wi(this,n)}Object.defineProperties(Vd.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new V],cartesian3Array:[new h],cartesian4Array:[new ie],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new V),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ie),this.cartesian4Array[this.cartesian4Index++]}};Vd.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof H&&n instanceof ie?H.fromCartesian4(n,t):n instanceof V||n instanceof h||n instanceof ie?n.clone(t):n};Vd.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return H.fromCartesian4(n,t)};Vd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Vd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Vd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var VUe=["!","-","+"],$re=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],aI=/\${(.*?)}/g,HUe=/\\/g,GUe="@#%",jUe=/@#%/g,MF=new H,LF={abs:Xs(Math.abs),sqrt:Xs(Math.sqrt),cos:Xs(Math.cos),sin:Xs(Math.sin),tan:Xs(Math.tan),acos:Xs(Math.acos),asin:Xs(Math.asin),atan:Xs(Math.atan),radians:Xs(P.toRadians),degrees:Xs(P.toDegrees),sign:Xs(P.sign),floor:Xs(Math.floor),ceil:Xs(Math.ceil),round:Xs(Math.round),exp:Xs(Math.exp),exp2:Xs(qUe),log:Xs(Math.log),log2:Xs(YUe),fract:Xs(WUe),length:XUe,normalize:KUe},NF={atan2:RF(Math.atan2,!1),pow:RF(Math.pow,!1),min:RF(Math.min,!0),max:RF(Math.max,!0),distance:$Ue,dot:ZUe,cross:QUe},yW={clamp:Zre(P.clamp,!0),mix:Zre(P.lerp,!0)};function WUe(e){return e-Math.floor(e)}function qUe(e){return Math.pow(2,e)}function YUe(e){return P.log2(e)}function Xs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof V)return V.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof ie)return ie.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new se(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function RF(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof V)return V.fromElements(e(i.x,o),e(i.y,o),Rn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Rn.getCartesian3());if(i instanceof ie)return ie.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof V&&o instanceof V)return V.fromElements(e(i.x,o.x),e(i.y,o.y),Rn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Rn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Rn.getCartesian4());throw new se(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Zre(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 V&&o instanceof V)return V.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Rn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Rn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof V&&o instanceof V&&r instanceof V)return V.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Rn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Rn.getCartesian3());if(i instanceof ie&&o instanceof ie&&r instanceof ie)return ie.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Rn.getCartesian4());throw new se(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function XUe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof V)return V.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ie)return ie.magnitude(t);throw new se(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function KUe(e,t){if(typeof t=="number")return 1;if(t instanceof V)return V.normalize(t,Rn.getCartesian2());if(t instanceof h)return h.normalize(t,Rn.getCartesian3());if(t instanceof ie)return ie.normalize(t,Rn.getCartesian4());throw new se(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function $Ue(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof V&&n instanceof V)return V.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ie&&n instanceof ie)return ie.distance(t,n);throw new se(`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 V&&n instanceof V)return V.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ie&&n instanceof ie)return ie.dot(t,n);throw new se(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function QUe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Rn.getCartesian3());throw new se(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function At(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,fze(this)}function JUe(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 eze(e){return e.replace(HUe,GUe)}function gW(e){return e.replace(jUe,"\\")}function tze(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 se("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function nze(e){let t=typeof e.value;if(e.value===null)return new At(gt.LITERAL_NULL,null);if(t==="boolean")return new At(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new At(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new At(gt.VARIABLE_IN_STRING,e.value):new At(gt.LITERAL_STRING,gW(e.value))}function ize(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 se(`${o} is not a function.`);return i===0?o==="test"?new At(gt.LITERAL_BOOLEAN,!1):new At(gt.LITERAL_NULL,null):(s=wi(e,c),a=wi(e,n[0]),new At(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=wi(e,c),new At(gt.FUNCTION_CALL,o,r);throw new se(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new At(gt.LITERAL_COLOR,o);if(r=wi(e,n[0]),l(n[1])){let c=wi(e,n[1]);return new At(gt.LITERAL_COLOR,o,[r,c])}return new At(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new se(`${o} requires three arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2])],new At(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new se(`${o} requires four arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2]),wi(e,n[3])],new At(gt.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]=wi(e,n[c]);return new At(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new At(gt.LITERAL_BOOLEAN,!0):new At(gt.LITERAL_BOOLEAN,!1):(r=wi(e,n[0]),new At(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new se(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new se(`${o} does not take any argument.`);return new At(gt.UNARY,o)}else if(l(LF[o])){if(i!==1)throw new se(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(gt.UNARY,o,r)}else if(l(NF[o])){if(i!==2)throw new se(`${o} requires exactly two arguments.`);return s=wi(e,n[0]),a=wi(e,n[1]),new At(gt.BINARY,o,s,a)}else if(l(yW[o])){if(i!==3)throw new se(`${o} requires exactly three arguments.`);s=wi(e,n[0]),a=wi(e,n[1]);let c=wi(e,n[2]);return new At(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new At(gt.LITERAL_BOOLEAN,!1):(r=wi(e,n[0]),new At(gt.UNARY,o,r));if(o==="Number")return i===0?new At(gt.LITERAL_NUMBER,0):(r=wi(e,n[0]),new At(gt.UNARY,o,r));if(o==="String")return i===0?new At(gt.LITERAL_STRING,""):(r=wi(e,n[0]),new At(gt.UNARY,o,r));if(o==="regExp")return oze(e,t)}}throw new se(`Unexpected function call "${o}".`)}function oze(e,t){let n=t.arguments;if(n.length===0)return new At(gt.LITERAL_REGEX,new RegExp);let i=wi(e,n[0]),o;if(n.length>1){let r=wi(e,n[1]);if(_W(i)&&_W(r)){try{o=new RegExp(gW(String(i._value)),r._value)}catch(s){throw new se(s)}return new At(gt.LITERAL_REGEX,o)}return new At(gt.REGEX,i,r)}if(_W(i)){try{o=new RegExp(gW(String(i._value)))}catch(r){throw new se(r)}return new At(gt.LITERAL_REGEX,o)}return new At(gt.REGEX,i)}function rze(e){if(lze(e.name)){let t=uze(e.name);return t.substr(0,8)==="tiles3d_"?new At(gt.BUILTIN_VARIABLE,t):new At(gt.VARIABLE,t)}else{if(e.name==="NaN")return new At(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new At(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new At(gt.LITERAL_UNDEFINED,void 0)}throw new se(`${e.name} is not defined.`)}function sze(e){let t=e.property.name;if(t==="PI")return new At(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new At(gt.LITERAL_NUMBER,Math.E)}function aze(e){if(e.property.name==="POSITIVE_INFINITY")return new At(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function cze(e,t){if(t.object.name==="Math")return sze(t);if(t.object.name==="Number")return aze(t);let n,i=wi(e,t.object);return t.computed?(n=wi(e,t.property),new At(gt.MEMBER,"brackets",i,n)):(n=new At(gt.LITERAL_STRING,t.property.name),new At(gt.MEMBER,"dot",i,n))}function _W(e){return e._type>=gt.LITERAL_NULL}function lze(e){return e.substr(0,4)==="czm_"}function uze(e){return e.substr(4)}function wi(e,t){let n,i,o,r;if(t.type==="Literal")n=nze(t);else if(t.type==="CallExpression")n=ize(e,t);else if(t.type==="Identifier")n=rze(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=wi(e,t.argument);if(VUe.indexOf(i)>-1)n=new At(gt.UNARY,i,s);else throw new se(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=wi(e,t.left),r=wi(e,t.right),$re.indexOf(i)>-1)n=new At(gt.BINARY,i,o,r);else throw new se(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=wi(e,t.left),r=wi(e,t.right),$re.indexOf(i)>-1&&(n=new At(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=wi(e,t.test);o=wi(e,t.consequent),r=wi(e,t.alternate),n=new At(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=cze(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=wi(e,t.elements[a]);n=new At(gt.ARRAY,s)}else throw t.type==="Compound"?new se("Provide exactly one expression."):new se("Cannot parse expression.");return n}function fze(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(LF[e._value])&&(e.evaluate=hze(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(NF[e._value])&&(e.evaluate=mze(e._value)):e._type===gt.TERNARY?e.evaluate=pze(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=dze):e.evaluate=e._evaluateLiteral}function dze(e){return l(e)?e.content.tileset.timeSinceLoad:0}function hze(e){let t=LF[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function mze(e){let t=NF[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function pze(e){let t=yW[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 FF(e,t){if(l(e))return e.getPropertyInherited(t)}At.prototype._evaluateLiteral=function(){return this._value};At.prototype._evaluateLiteralColor=function(e){let t=MF,n=this._left;if(this._value==="color")l(n)?n.length>1?(H.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):H.fromCssColorString(n[0].evaluate(e),t):H.fromBytes(255,255,255,255,t);else if(this._value==="rgb")H.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;H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ie.fromColor(t,Rn.getCartesian4())};At.prototype._evaluateLiteralVector=function(e){let t=Rn.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 V)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof ie)t.push(c.x,c.y,c.z,c.w);else throw new se(`${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 se(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new se(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new se(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return V.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return ie.fromArray(t,0,Rn.getCartesian4())};At.prototype._evaluateLiteralString=function(){return this._value};At.prototype._evaluateVariableString=function(e){let t=this._value,n=aI.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=FF(e,o);l(r)||(r=""),t=t.replace(i,r),aI.lastIndex+=r.length-i.length,n=aI.exec(t)}return t};At.prototype._evaluateVariable=function(e){return FF(e,this._value)};function Yx(e){return e._value==="feature"}At.prototype._evaluateMemberDot=function(e){if(Yx(this._left))return FF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof V||t instanceof h||t instanceof ie){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};At.prototype._evaluateMemberBrackets=function(e){if(Yx(this._left))return FF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof V||t instanceof h||t instanceof ie){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};At.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};At.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new se(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};At.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof V)return V.negate(t,Rn.getCartesian2());if(t instanceof h)return h.negate(t,Rn.getCartesian3());if(t instanceof ie)return ie.negate(t,Rn.getCartesian4());if(typeof t=="number")return-t;throw new se(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};At.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof V||t instanceof h||t instanceof ie||typeof t=="number"))throw new se(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};At.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new se(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};At.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new se(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};At.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new se(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};At.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new se(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};At.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new se(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new se(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};At.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new se(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new se(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};At.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof V&&t instanceof V)return V.add(t,n,Rn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Rn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.add(t,n,Rn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new se(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof V&&t instanceof V)return V.subtract(t,n,Rn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Rn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.subtract(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new se(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof V&&t instanceof V)return V.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof V&&typeof t=="number")return V.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof V&&typeof n=="number")return V.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof ie&&typeof t=="number")return ie.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.multiplyByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new se(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof V&&t instanceof V)return V.divideComponents(t,n,Rn.getCartesian2());if(t instanceof V&&typeof n=="number")return V.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Rn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.divideComponents(t,n,Rn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.divideByScalar(t,n,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new se(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof V&&t instanceof V)return V.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Rn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new se(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};At.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof V&&t instanceof V||n instanceof h&&t instanceof h||n instanceof ie&&t instanceof ie?t.equals(n):t===n};At.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof V&&t instanceof V||n instanceof h&&t instanceof h||n instanceof ie&&t instanceof ie?!t.equals(n):t!==n};At.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new se(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};At.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};At.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};At.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};At.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};At.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};At.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};At.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};At.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};At.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 se(o)}return i};At.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new se(`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)};At.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 se(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.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 se(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};At.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new se(`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};At.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof V||t instanceof h||t instanceof ie)return String(t);throw new se(`Unexpected function call "${this._value}".`)};function Qre(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return H.fromHsl(i,o,r,s,MF)}function Jre(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=MF;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 jg(e){return e%1===0?e.toFixed(1):e.toString()}function _ze(e){let t=jg(e.red),n=jg(e.green),i=jg(e.blue);return`vec3(${t}, ${n}, ${i})`}function OF(e){let t=jg(e.red),n=jg(e.green),i=jg(e.blue),o=jg(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function ese(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 tse(e,t){return l(t[e])?t[e]:Vd.NULL_SENTINEL}Vd.NULL_SENTINEL="czm_infinity";At.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=ese(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=ese(this._value,e,t,this));let u,f,d;switch(a){case gt.VARIABLE:return Yx(this)?void 0:tse(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(LF[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 se(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(NF[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(yW[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return Yx(this._left)?tse(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case gt.FUNCTION_CALL:throw new se(`Error generating style shader: "${c}" is not supported.`);case gt.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 se("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new se("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new se("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return Vd.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return jg(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Yx(n._left)))return c;if(i=H.fromCssColorString(c,MF),l(i))return _ze(i);throw new se("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],_=u[1];return _!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${_})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Jre(this),l(i)?OF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Jre(this),l(i)?OF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Qre(this),l(i)?OF(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Qre(this),l(i)?(i.alpha!==1&&(t.translucent=!0),OF(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case gt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case gt.LITERAL_REGEX:throw new se("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return Vd.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};At.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 gt.VARIABLE:Yx(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=aI.exec(s);a!==null;)e.push(a[1]),a=aI.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&Yx(t._left)&&e.push(s);break}};var Hd=Vd;function Qp(e){e=e??G.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??h.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=H.clone(H.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??zn.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(Qp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var gze={position:0,a_batchId:1};function yze(e,t){if(l(e._va))return;let n=st.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=st.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),o=st.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:K.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:K.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new qn({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new qn({context:t,attributes:r,indexBuffer:st.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function xze(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??gze,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Be.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`,e._spPick=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(sI),c=n.getFragmentShaderCallback(!1,void 0,!0)(Bx);o=n.getPickId();let u=new Be({sources:[a]}),f=new Be({defines:["VECTOR_TILE"],sources:[c]});e._sp=Xt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Be({sources:[sI]}),f=new Be({defines:["VECTOR_TILE"],sources:[Bx]}),e._spStencil=Xt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Be.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`;let d=new Be({sources:[a]}),p=new Be({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Xt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function nse(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:t,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qc.LESS_OR_EQUAL},depthMask:!1}}var bze={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},Tze={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Cze(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(nse(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(nse(!0)),e._rsColorPass=ze.fromCache(bze),e._rsPickPass=ze.fromCache(Tze))}var Xx=new O,ise=new h;function Aze(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return O.clone(i,Xx),O.multiplyByPoint(Xx,e._center,ise),O.setTranslation(Xx,ise,Xx),O.multiply(o,Xx,Xx),Xx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function xW(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],_=o[d],m=new e.constructor(e.buffer,a*p,_);t.set(m,n),i[d]=n,n+=_}return n}function Eze(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=xW(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(H.equals(f.color,a.color))u=xW(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=xW(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function bW(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],_=o[d];t.copyFromBuffer(e,p*a,n*a,_*a),i[d]=n,n+=_}return n}function Sze(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=bW(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(H.equals(d.color,r.color))u=bW(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=bW(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function vze(e,t){return t.color.toRgba()-e.color.toRgba()}function wze(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(vze),t.webgl2?Sze(e,n):Eze(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Ize(e,t){let n=wze(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??O.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let _=o[p].offset,m=o[p].count,y=i[p*2];l(y)||(y=i[p*2]=new qe({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=_,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Se.TERRAIN_CLASSIFICATION;let x=qe.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._rsStencilDepthPass3DTiles,x.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=x;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new qe({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=_,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Se.TERRAIN_CLASSIFICATION;let T=qe.shallowClone(b,b.derivedCommands.tileset);T.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=T}e._commandsDirty=!0}function Pze(e,t){if(e.classificationType===zn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=qe.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function Dze(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??O.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new qe({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=d,p.pass=Se.TERRAIN_CLASSIFICATION;let _=qe.shallowClone(p,p.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=_;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new qe({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=d,m.pass=Se.TERRAIN_CLASSIFICATION;let y=qe.shallowClone(m,m.derivedCommands.tileset);y.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}Qp.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 ma(e,r)}};Qp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Rze(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=H.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=H.clone(H.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Oze=new H,Mze=H.WHITE,Lze=!0,Nze=/\$/;Qp.prototype.applyStyle=function(e,t){if(!l(e)){Rze(this,t);return}let n=e.color,i=n instanceof Hd&&!Nze.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,Oze):Mze,c.show=l(e.show)?e.show.evaluate(c):Lze}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=H.clone(H.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Qp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,x=c[f].count;if(s>=y&&s<y+x)break}c.push(new Zp({color:H.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],_=c[f].batchIds,m=_.length;for(let y=0;y<m;++y){let x=_[y];if(x===e)continue;let b=n[x];o[b]<s?d.push(x):p.push(x)}p.length!==0&&c.push(new Zp({color:H.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function ose(e,t,n,i){let o=e.classificationType,r=o!==zn.CESIUM_3D_TILE,s=o!==zn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Se.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function Fze(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Se.OPAQUE,n.push(r)}}function Bze(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Le.LINES):(n=e._rsColorPass,i=Le.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}Qp.prototype.update=function(e){let t=e.context;yze(this,t),xze(this,t),Cze(this),Aze(this,t);let n=e.passes;n.render&&(Ize(this,t),Pze(this,e),Bze(this),this._debugWireframe?Fze(e,this._commands):ose(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(Dze(this),ose(this,e,this._pickCommands))};Qp.prototype.isDestroyed=function(){return!1};Qp.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(),ce(this)};var fA=Qp;function Cu(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=h.clone(this._boundingVolume.center):this._center=h.clone(h.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=zn.BOTH}Object.defineProperties(Cu.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}}});Cu.packedBoxLength=O.packedLength+h.packedLength;Cu.packedCylinderLength=O.packedLength+2;Cu.packedEllipsoidLength=O.packedLength+h.packedLength;Cu.packedSphereLength=h.packedLength+1;function kze(e){let t=new Float64Array(O.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,O.pack(e._modelMatrix,t,n),t}function Uze(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]=re.unpack(t,n),n+=re.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=H.unpack(t,n);n+=H.packedLength;let f=t[n++],d=t[n++],p=t[n++],_=new Array(p);for(let m=0;m<p;++m)_[m]=t[n++];a[c]=new Zp({color:u,offset:f,count:d,batchIds:_})}return i}var zze=new hi("createVectorTileGeometries",5),Vze=new H;function Hze(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let x=0;x<m;++x){let b=y.getColor(x,Vze);u[x]=b.toRgba()}f=e._packedBuffer=kze(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},_=e._verticesPromise=zze.scheduleTask(p,d);return l(_)?_.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Uze(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),Gze(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Gze(e){l(e._primitive)||(e._primitive=new fA({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)}Cu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Cu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Cu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Cu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Cu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Hze(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)};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var Wg=Cu;function _m(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,qze(this,i,o)}Object.defineProperties(_m.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 jze(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function Wze(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new se("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var Kx=Uint32Array.BYTES_PER_ELEMENT;function qze(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Kx;let r=o.getUint32(n,!0);if(r!==1)throw new se(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=Kx;let s=o.getUint32(n,!0);if(n+=Kx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Kx,a===0)throw new se("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Kx;let u=o.getUint32(n,!0);n+=Kx;let f=o.getUint32(n,!0);n+=Kx;let d=jo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let _,m;u>0&&(_=jo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,x=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,T=d.SPHERES_LENGTH??0,C=y+x+b+T,A=new Hg(e,C,_,m,jze(e));if(e._batchTable=A,C===0)return;let S=e.tile.computedTransform,w;l(d.RTC_CENTER)&&(w=h.unpack(d.RTC_CENTER),O.multiplyByPoint(S,w,w));let R=Wze(d,p);if(y>0||x>0||b>0||T>0){let D,M,L,g;if(y>0){let E=p.byteOffset+d.BOXES.byteOffset;D=new Float32Array(p.buffer,E,Wg.packedBoxLength*y)}if(x>0){let E=p.byteOffset+d.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,E,Wg.packedCylinderLength*x)}if(b>0){let E=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,E,Wg.packedEllipsoidLength*b)}if(T>0){let E=p.byteOffset+d.SPHERES.byteOffset;g=new Float32Array(p.buffer,E,Wg.packedSphereLength*T)}return e._geometries=new Wg({boxes:D,boxBatchIds:R.boxes,cylinders:M,cylinderBatchIds:R.cylinders,ellipsoids:L,ellipsoidBatchIds:R.ellipsoids,spheres:g,sphereBatchIds:R.spheres,center:w,modelMatrix:S,batchTable:A,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function rse(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}}_m.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};_m.prototype.getFeature=function(e){return rse(this),this._features[e]};_m.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};_m.prototype.applyStyle=function(e){rse(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};_m.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)};_m.prototype.pick=function(e,t,n){};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ce(this)};var BF=_m;var TW={};TW.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),sse(i,o,r,s);return c};TW.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)),sse(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function sse(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 cI=TW;var $x=30,Yze=1<<$x,Xze=1<<$x+1>>>0,CW=2*$x+1,qg=4,lse=[],use=[],Kze=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Yg=1,dA=2,kF=[Yg,0,0,Yg|dA];function ts(e){if(!Ft.supportsBigInt())throw new se("S2 required BigInt support");this._cellId=e,this._level=ts.getLevel(e)}ts.fromToken=function(e){return new ts(ts.getIdFromToken(e))};ts.isValidId=function(e){return!(e<=0||e>>BigInt(CW)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ts.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ts.isValidId(ts.getIdFromToken(e)):!1};ts.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ts.getTokenFromId=function(e){let t=Math.floor(rVe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ts.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return $x-(t>>1)};ts.prototype.getChild=function(e){let t=hse(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ts(n)};ts.prototype.getParent=function(){let e=hse(this._cellId)<<BigInt(2);return new ts(this._cellId&~e+BigInt(1)|e)};ts.prototype.getParentAtLevel=function(e){let t=iVe(e);return new ts(this._cellId&-t|t)};ts.prototype.getCenter=function(e){e=e??te.WGS84;let t=$ze(this._cellId,this._level);t=h.normalize(t,t);let n=new fe.fromCartesian(t,te.UNIT_SPHERE);return fe.toCartesian(n,e,new h)};ts.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=Zze(this._cellId,this._level,e);n=h.normalize(n,n);let i=new fe.fromCartesian(n,te.UNIT_SPHERE);return fe.toCartesian(i,t,new h)};ts.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(CW-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ts(a)};function $ze(e,t){let n=Qze(e,t);return Jze(n[0],n[1],n[2])}function Zze(e,t,n){let i=fse(e,t),o=eVe([i[1],i[2]],t),r=n>>1&1;return dse(i[0],o[0][r^n&1],o[1][r])}function Qze(e,t){let n=fse(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function fse(e){lse.length===0&&nVe();let t=Number(e>>BigInt(CW)),n=t&Yg,i=(1<<qg)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?$x-7*qg:qg))-1;n+=Number(e>>BigInt(s*2*qg+1)&BigInt(c))<<2,n=use[n];let u=s*qg;o+=n>>qg+2<<u,r+=(n>>2&i)<<u,n&=Yg|dA}return[t,o,r]}function Jze(e,t,n){let i=ase(t),o=ase(n),r=UF(i),s=UF(o);return dse(e,r,s)}function dse(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function UF(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ase(e){return 1/Xze*e}function eVe(e,t){let n=[[],[]],i=tVe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=UF(cse(r)),n[o][1]=UF(cse(s))}return n}function tVe(e){return 1<<$x-e>>>0}function cse(e){return 1/Yze*e}function Xg(e,t,n,i,o,r){if(e===qg){let s=(t<<qg)+n;lse[(s<<2)+i]=(o<<2)+r,use[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=Kze[r];Xg(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^kF[0]),Xg(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^kF[1]),Xg(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^kF[2]),Xg(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^kF[3])}}function nVe(){Xg(0,0,0,0,0,0),Xg(0,0,0,Yg,0,Yg),Xg(0,0,0,dA,0,dA),Xg(0,0,0,Yg|dA,0,Yg|dA)}function hse(e){return e&~e+BigInt(1)}function iVe(e){return BigInt(1)<<BigInt(2*($x-e))}var oVe=[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 rVe(e){return oVe[(-e&e)%BigInt(67)]}var Kg=ts;function sVe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ci=sVe;function AW(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 se(`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=aVe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function aVe(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(AW.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});AW.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 lI=AW;function Jp(e){e=e??G.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(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var uI=Jp;var zF={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};zF.getBranchingFactor=function(e){switch(e){case zF.OCTREE:return 8;case zF.QUADTREE:return 4}};var hs=Object.freeze(zF);function pa(){}Object.defineProperties(pa.prototype,{class:{get:function(){he.throwInstantiationError()}}});pa.prototype.hasProperty=function(e){he.throwInstantiationError()};pa.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};pa.prototype.getPropertyIds=function(e){he.throwInstantiationError()};pa.prototype.getProperty=function(e){he.throwInstantiationError()};pa.prototype.setProperty=function(e,t){he.throwInstantiationError()};pa.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};pa.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};pa.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))};pa.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};pa.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};pa.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=Fe(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};pa.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};pa.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return pa.getProperty(o.id,t,n)};pa.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?pa.setProperty(r.id,t,n,i):!1};var kn=pa;function e_(e){e=e??G.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(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var VF=e_;var Bt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Bt.getMinimum=function(e){switch(e){case Bt.INT8:return-128;case Bt.UINT8:return 0;case Bt.INT16:return-32768;case Bt.UINT16:return 0;case Bt.INT32:return-2147483648;case Bt.UINT32:return 0;case Bt.INT64:return Ft.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Bt.UINT64:return Ft.supportsBigInt()?BigInt(0):0;case Bt.FLOAT32:return-34028234663852886e22;case Bt.FLOAT64:return-Number.MAX_VALUE}};Bt.getMaximum=function(e){switch(e){case Bt.INT8:return 127;case Bt.UINT8:return 255;case Bt.INT16:return 32767;case Bt.UINT16:return 65535;case Bt.INT32:return 2147483647;case Bt.UINT32:return 4294967295;case Bt.INT64:return Ft.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Bt.UINT64:return Ft.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Bt.FLOAT32:return 34028234663852886e22;case Bt.FLOAT64:return Number.MAX_VALUE}};Bt.isIntegerType=function(e){switch(e){case Bt.INT8:case Bt.UINT8:case Bt.INT16:case Bt.UINT16:case Bt.INT32:case Bt.UINT32:case Bt.INT64:case Bt.UINT64:return!0;default:return!1}};Bt.isUnsignedIntegerType=function(e){switch(e){case Bt.UINT8:case Bt.UINT16:case Bt.UINT32:case Bt.UINT64:return!0;default:return!1}};Bt.isVectorCompatible=function(e){switch(e){case Bt.INT8:case Bt.UINT8:case Bt.INT16:case Bt.UINT16:case Bt.INT32:case Bt.UINT32:case Bt.FLOAT32:case Bt.FLOAT64:return!0;default:return!1}};Bt.normalize=function(e,t){return Math.max(Number(e)/Number(Bt.getMaximum(t)),-1)};Bt.unnormalize=function(e,t){let n=Bt.getMaximum(t),i=Bt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Bt.INT64||t===Bt.UINT64)&&Ft.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Bt.applyValueTransform=function(e,t,n){return n*e+t};Bt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Bt.getSizeInBytes=function(e){switch(e){case Bt.INT8:case Bt.UINT8:return 1;case Bt.INT16:case Bt.UINT16:return 2;case Bt.INT32:case Bt.UINT32:return 4;case Bt.INT64:case Bt.UINT64:return 8;case Bt.FLOAT32:return 4;case Bt.FLOAT64:return 8}};Bt.fromComponentDatatype=function(e){switch(e){case K.BYTE:return Bt.INT8;case K.UNSIGNED_BYTE:return Bt.UINT8;case K.SHORT:return Bt.INT16;case K.UNSIGNED_SHORT:return Bt.UINT16;case K.INT:return Bt.INT32;case K.UNSIGNED_INT:return Bt.UINT32;case K.FLOAT:return Bt.FLOAT32;case K.DOUBLE:return Bt.FLOAT64}};Bt.toComponentDatatype=function(e){switch(e){case Bt.INT8:return K.BYTE;case Bt.UINT8:return K.UNSIGNED_BYTE;case Bt.INT16:return K.SHORT;case Bt.UINT16:return K.UNSIGNED_SHORT;case Bt.INT32:return K.INT;case Bt.UINT32:return K.UNSIGNED_INT;case Bt.FLOAT32:return K.FLOAT;case Bt.FLOAT64:return K.DOUBLE}};var kt=Object.freeze(Bt);var Wo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Wo.isVectorType=function(e){switch(e){case Wo.VEC2:case Wo.VEC3:case Wo.VEC4:return!0;default:return!1}};Wo.isMatrixType=function(e){switch(e){case Wo.MAT2:case Wo.MAT3:case Wo.MAT4:return!0;default:return!1}};Wo.getComponentCount=function(e){switch(e){case Wo.SCALAR:case Wo.STRING:case Wo.ENUM:case Wo.BOOLEAN:return 1;case Wo.VEC2:return 2;case Wo.VEC3:return 3;case Wo.VEC4:return 4;case Wo.MAT2:return 4;case Wo.MAT3:return 9;case Wo.MAT4:return 16}};Wo.getMathType=function(e){switch(e){case Wo.VEC2:return V;case Wo.VEC3:return h;case Wo.VEC4:return ie;case Wo.MAT2:return ti;case Wo.MAT3:return Z;case Wo.MAT4:return O;default:return}};var at=Object.freeze(Wo);function za(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&kt.isIntegerType(i)&&(e.normalized??!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Fe(e.min,!0),this._max=Fe(e.max,!0),this._normalized=r;let s=Fe(e.offset,!0),a=Fe(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Fe(e.noData,!0),this._default=Fe(e.default,!0),this._required=e.required??!0,this._extras=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}za.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.property,i=cVe(n),o=lVe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new za({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(za.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 cVe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===at.SCALAR||at.isMatrixType(t)||at.isVectorType(t))return!1;if(l(kt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function lVe(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===at.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===at.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.SCALAR||at.isMatrixType(n)||at.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.BOOLEAN||n===at.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===at.BOOLEAN||i===at.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(kt[i]))return{type:at.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(kt[n]))return{type:at.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}za.prototype.normalize=function(e){return this._normalized?EW(e,this._valueType,kt.normalize):e};za.prototype.unnormalize=function(e){return this._normalized?EW(e,this._valueType,kt.unnormalize):e};za.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:za.valueTransformInPlace(e,this._offset,this._scale,kt.applyValueTransform)};za.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:za.valueTransformInPlace(e,this._offset,this._scale,kt.unapplyValueTransform)};za.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=at.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)};za.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!gse(e,t))return e};function gse(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(!gse(e[n],t[n]))return!1;return!0}za.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.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};za.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.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};za.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?uVe(this,e):yse(this,e)};function uVe(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=yse(e,t[i]);if(l(o))return o}}function yse(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return at.isVectorType(n)?fVe(t,n,i):at.isMatrixType(n)?dVe(t,n,i):n===at.STRING?hVe(t):n===at.BOOLEAN?mVe(t):n===at.ENUM?pVe(t,o):_Ve(t,i,r)}function fVe(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===at.VEC2&&!(e instanceof V))return`vector value ${e} must be a Cartesian2`;if(t===at.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===at.VEC4&&!(e instanceof ie))return`vector value ${e} must be a Cartesian4`}function dVe(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===at.MAT2&&!(e instanceof ti))return`matrix value ${e} must be a Matrix2`;if(t===at.MAT3&&!(e instanceof Z))return`matrix value ${e} must be a Matrix3`;if(t===at.MAT4&&!(e instanceof O))return`matrix value ${e} must be a Matrix4`}function hVe(e){if(typeof e!="string")return HF(e,at.STRING)}function mVe(e){if(typeof e!="boolean")return HF(e,at.BOOLEAN)}function pVe(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 _Ve(e,t,n){let i=typeof e;switch(t){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.FLOAT32:case kt.FLOAT64:return i!=="number"?HF(e,t):isFinite(e)?pse(e,t,n):_se(e,t);case kt.INT64:case kt.UINT64:return i!=="number"&&i!=="bigint"?HF(e,t):i==="number"&&!isFinite(e)?_se(e,t):pse(e,t,n)}}function HF(e,t){return`value ${e} does not match type ${t}`}function mse(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function pse(e,t,n){if(n){let i=kt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?mse(e,t,n):void 0}if(e<kt.getMinimum(t)||e>kt.getMaximum(t))return mse(e,t,n)}function _se(e,t){return`value ${e} of type ${t} must be finite`}function EW(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=EW(e[i],t,n);return e}za.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]=za.valueTransformInPlace(e[o],t[o],n[o],i);return e};var t_=za;function fI(e){e=e??G.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===at.STRING,d=r===at.BOOLEAN,p=0,_;if(a){let g=n.arrayOffsetType??n.offsetType;g=kt[g]??kt.UINT32;let E=n.arrayOffsets??n.arrayOffsetBufferView;_=new SW(o[E],g,t+1),p+=_.typedArray.byteLength}let m=at.getComponentCount(r),y;a?y=_.get(t)-_.get(0):s?y=t*i.arrayLength:y=t;let x=m*y,b;if(f){let g=n.stringOffsetType??n.offsetType;g=kt[g]??kt.UINT32;let E=n.stringOffsets??n.stringOffsetBufferView;b=new SW(o[E],g,x+1),p+=b.typedArray.byteLength}(f||d)&&(c=kt.UINT8);let T;f?T=b.get(x)-b.get(0):d?T=Math.ceil(x/8):T=x;let C=n.values??n.bufferView,A=new SW(o[C],c,T);p+=A.typedArray.byteLength;let S=n.offset,w=n.scale,R=i.hasValueTransform||l(S)||l(w);S=S??i.offset,w=w??i.scale,S=xse(S),w=xse(w);let D,M,L=this;f?D=function(g){return xVe(g,L._values,L._stringOffsets)}:d?(D=function(g){return bVe(g,L._values)},M=function(g,E){TVe(g,L._values,E)}):l(u)?(D=function(g){let E=L._values.get(g);return u.namesByValue[E]},M=function(g,E){let v=u.valuesByName[E];L._values.set(g,v)}):(D=function(g){return L._values.get(g)},M=function(g,E){L._values.set(g,E)}),this._arrayOffsets=_,this._stringOffsets=b,this._values=A,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=S,this._scale=w,this._hasValueTransform=R,this._getValue=D,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(fI.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}}});fI.prototype.get=function(e){let t=gVe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=PVe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};fI.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=DVe(this,t),t=n.unnormalize(t),yVe(this,e,t)};fI.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function xse(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 gVe(e,t){Tse(e)&&Cse(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Fe(s,!0):s}return!i&&r===1?e._getValue(t):bse(e,n,t)}function bse(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.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 yVe(e,t,n){wVe(e,t,n)&&Cse(e);let i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Fe(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function xVe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return ha(t.typedArray,i,o)}function bVe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function TVe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function CVe(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 AVe(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 EVe(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 SVe(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 vVe(e){switch(e){case kt.INT8:return K.BYTE;case kt.UINT8:return K.UNSIGNED_BYTE;case kt.INT16:return K.SHORT;case kt.UINT16:return K.UNSIGNED_SHORT;case kt.INT32:return K.INT;case kt.UINT32:return K.UNSIGNED_INT;case kt.FLOAT32:return K.FLOAT;case kt.FLOAT64:return K.DOUBLE}}function Tse(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===at.STRING||i===kt.INT64&&!Ft.supportsBigInt64Array()||i===kt.UINT64&&!Ft.supportsBigUint64Array()}function wVe(e,t,n){if(Tse(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 Cse(e){e._unpackedValues=IVe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function IVe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=at.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]=bse(e,i,a);return n}function PVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:t_.valueTransformInPlace(t,e._offset,e._scale,kt.applyValueTransform)}function DVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:t_.valueTransformInPlace(t,e._offset,e._scale,kt.unapplyValueTransform)}function SW(e,t,n){let i=this,o,r,s;if(t===kt.INT64)Ft.supportsBigInt()?Ft.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 AVe(a,i)}):(Tt("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 CVe(a,i)});else if(t===kt.UINT64)Ft.supportsBigInt()?Ft.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 SVe(a,i)}):(Tt("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 EVe(a,i)});else{let a=vVe(t);o=K.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var GF=fI;function Gd(e){e=e??G.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 GF({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(Gd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Gd.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};Gd.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};Gd.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};Gd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=RVe(this._class,t),i};Gd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Gd.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)};Gd.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};Gd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Gd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function RVe(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=Fe(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var jd=Gd;function $g(){}Object.defineProperties($g.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});$g.prototype.load=function(){he.throwInstantiationError()};$g.prototype.unload=function(){};$g.prototype.process=function(e){return!1};$g.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` -${t.message}`);let n=new se(e);return l(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};$g.prototype.isDestroyed=function(){return!1};$g.prototype.destroy=function(){return this.unload(),ce(this)};var eo=$g;var OVe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},yt=Object.freeze(OVe);function n_(e){e=e??G.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(n_.prototype=Object.create(eo.prototype),n_.prototype.constructor=n_);Object.defineProperties(n_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});n_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=MVe(this),this._promise)};async function MVe(e){let t=e._resource;e._state=yt.LOADING;try{let n=await n_._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}n_._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};n_.prototype.unload=function(){this._typedArray=void 0};var hA=n_;var run=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:vjjjbgOaAfhYdndna8Lmbamhrxekdna8KaY9RcK9pmbam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RgQz: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(_){n=_.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(_){for(var m=new Uint8Array(_.length),y=0;y<_.length;++y){var x=_.charCodeAt(y);m[y]=x>96?x-97:x>64?x-39:x+4}for(var b=0,y=0;y<_.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function r(_){if(!_)throw new Error("Assertion failed")}function s(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}function a(_,m,y,x){var b=n.exports.sbrk,T=b(m.length*4),C=b(y*4),A=new Uint8Array(n.exports.memory.buffer),S=s(m);A.set(S,T),x&&x(T,T,m.length,y);var w=_(C,T,m.length,y);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(y);new Uint8Array(R.buffer).set(A.subarray(C,C+y*4)),S.set(A.subarray(T,T+m.length*4)),b(T-b(0));for(var D=0;D<m.length;++D)m[D]=R[m[D]];return[R,w]}function c(_,m,y,x){var b=n.exports.sbrk,T=b(y*4),C=b(y*x),A=new Uint8Array(n.exports.memory.buffer);A.set(s(m),C),_(T,C,y,x),A=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(y);return new Uint8Array(S.buffer).set(A.subarray(T,T+y*4)),b(T-b(0)),S}function u(_,m,y,x,b){var T=n.exports.sbrk,C=T(m),A=T(x*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(y),A);var w=_(C,m,A,x,b),R=new Uint8Array(w);return R.set(S.subarray(C,C+w)),T(C-T(0)),R}function f(_){for(var m=0,y=0;y<_.length;++y){var x=_[y];m=m<x?x:m}return m}function d(_,m){if(r(m==2||m==4),m==4)return new Uint32Array(_.buffer,_.byteOffset,_.byteLength/4);var y=new Uint16Array(_.buffer,_.byteOffset,_.byteLength/2);return new Uint32Array(y)}function p(_,m,y,x,b,T,C){var A=n.exports.sbrk,S=A(y*x),w=A(y*T),R=new Uint8Array(n.exports.memory.buffer);R.set(s(m),w),_(S,y,x,b,w,C);var D=new Uint8Array(y*x);return D.set(R.subarray(S,S+y*x)),A(S-A(0)),D}return{ready:i,supported:!0,reorderMesh:function(_,m,y){var x=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,_,f(_)+1,x)},reorderPoints:function(_,m){return r(_ instanceof Float32Array),r(_.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,_,_.length/m,m*4)},encodeVertexBuffer:function(_,m,y){r(y>0&&y<=256),r(y%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,x,_,m,y)},encodeIndexBuffer:function(_,m,y){r(y==2||y==4),r(m%3==0);var x=d(_,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(x)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,x,m,4)},encodeIndexSequence:function(_,m,y){r(y==2||y==4);var x=d(_,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(x)+1);return u(n.exports.meshopt_encodeIndexSequence,b,x,m,4)},encodeGltfBuffer:function(_,m,y,x){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(b[x]),b[x](_,m,y)},encodeFilterOct:function(_,m,y,x){return r(y==4||y==8),r(x>=1&&x<=16),p(n.exports.meshopt_encodeFilterOct,_,m,y,x,16)},encodeFilterQuat:function(_,m,y,x){return r(y==8),r(x>=4&&x<=16),p(n.exports.meshopt_encodeFilterQuat,_,m,y,x,16)},encodeFilterExp:function(_,m,y,x,b){r(y>0&&y%4==0),r(x>=1&&x<=24);var T={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,_,m,y,x,y,b?T[b]:1)}}}();var Ase=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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abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9: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(b){r=b.instance,r.exports.__wasm_call_ctors()});function a(b){for(var T=new Uint8Array(b.length),C=0;C<b.length;++C){var A=b.charCodeAt(C);T[C]=A>96?A-97:A>64?A-39:A+4}for(var S=0,C=0;C<b.length;++C)T[S++]=T[C]<60?i[T[C]]:(T[C]-60)*64+T[++C];return T.buffer.slice(0,S)}function c(b,T,C,A,S,w,R){var D=b.exports.sbrk,M=A+3&-4,L=D(M*S),g=D(w.length),E=new Uint8Array(b.exports.memory.buffer);E.set(w,g);var v=T(L,A,S,g,w.length);if(v==0&&R&&R(L,M,S),C.set(E.subarray(L,L+A*S)),D(L-D(0)),v!=0)throw new Error("Malformed buffer data: "+v)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function _(b){var T={object:new Worker(b),pending:0,requests:{}};return T.object.onmessage=function(C){var A=C.data;T.pending-=A.count,T.requests[A.id][A.action](A.value),delete T.requests[A.id]},T}function m(b){for(var T="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+x.name+";"+c.toString()+x.toString(),C=new Blob([T],{type:"text/javascript"}),A=URL.createObjectURL(C),S=d.length;S<b;++S)d[S]=_(A);for(var S=b;S<d.length;++S)d[S].object.postMessage({});d.length=b,URL.revokeObjectURL(A)}function y(b,T,C,A,S){for(var w=d[0],R=1;R<d.length;++R)d[R].pending<w.pending&&(w=d[R]);return new Promise(function(D,M){var L=new Uint8Array(C),g=++p;w.pending+=b,w.requests[g]={resolve:D,reject:M},w.object.postMessage({id:g,count:b,size:T,source:L,mode:A,filter:S},[L.buffer])})}function x(b){var T=b.data;if(!T.id)return self.close();self.ready.then(function(C){try{var A=new Uint8Array(T.count*T.size);c(C,C.exports[T.mode],A,T.count,T.size,T.source,C.exports[T.filter]),self.postMessage({id:T.id,count:T.count,action:"resolve",value:A},[A.buffer])}catch(S){self.postMessage({id:T.id,count:T.count,action:"reject",value:S})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,T,C,A,S){c(r,r.exports.meshopt_decodeVertexBuffer,b,T,C,A,r.exports[u[S]])},decodeIndexBuffer:function(b,T,C,A){c(r,r.exports.meshopt_decodeIndexBuffer,b,T,C,A)},decodeIndexSequence:function(b,T,C,A){c(r,r.exports.meshopt_decodeIndexSequence,b,T,C,A)},decodeGltfBuffer:function(b,T,C,A,S,w){c(r,r.exports[f[S]],b,T,C,A,r.exports[u[w]])},decodeGltfBufferAsync:function(b,T,C,A,S){return d.length>0?y(b,T,C,f[A],u[S]):s.then(function(){var w=new Uint8Array(b*T);return c(r,r.exports[f[A]],w,b,T,C,r.exports[u[S]]),w})}}}();var cun=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;WbfheaXhHa8JhOinaHaAaeydbcdtgCfIdbawaCfI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HcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaKhHalhQcbhOincbaeydbgXaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaXhAaQcufgQmbkaOce4h3kcuada39RcifgTcx2aTc;v:Q;v:Qe0Ecbyd:m:jjjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd:m:jjjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd:m:jjjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd:m:jjjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaLz:cjjjbabh3cbhEcbh5inaba5cdtfhwcbheindnaLa3aefydbgOcdtg8FfydbgQaLawaec;q1jjbfydbcdtfydbgHcdtg8LfydbgXSmbaKaHfRbbgYcv2aKaOfRbbgAfc;G1jjbfRbbg8AaAcv2aYfgic;G1jjbfRbbg8KVcFeGTmbdnaXaQ9nmbaic:G1jjbfRbbcFeGmekaAcufhQdnaAaY9hmbaQcFeGce0mbaha8FfydbaH9hmekdndnaAclSmbaYcl9hmekdnaQcFeGce0mbaha8FfydbaH9hmdkaYcufcFeGce0mbaga8LfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgQEBdlaAaOaHaQEBdbaAaQa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba3cxfh3aEcifaT9nmekkaETmdcbhYinaqaLaDaYcx2fgAydbgQcdtg3fydbc8S2fgeIdwaaaAydlgXcx2fgHIdwg8VNaeIdzaHIdbgRNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8PNaeIdCa8VNaeId3Mg8Sa8SMMa8PNaeIdbaRNaeIdxa8PNaeIdKMg8Sa8SMMaRNaeId8KMMM:lh8SJbbbbJbbjZaeIdygI:vaIJbb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IdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hYarhHa8JhAinaHaYfgeaHaXfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkawmbJbbbbJbbjZaqa8LfgeIdyg8S:va8SJbbbb9BEaeIdwaaa3cx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaXa9ifhXa8Fcefg8Fal9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhAabhecbhQindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgXSmbaOaXSmbabaAcdtfgYaHBdbaYcwfaXBdbaYclfaOBdbaAcifhAkaecxfheaQcifgQad6mbkdndna9cTmbaAak9nmba8UaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgQaOBdbaQclfaeclfydbBdbaQcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaA6mbkJFFuuh8UaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8UaOEh8UaeclfheaHcufgHmbxdkkaAhdkadak0mbxdkkasclfabadalaLz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),x=0;x<m.length;++x){var b=m.charCodeAt(x);y[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<m.length;++x)y[T++]=y[x]<60?t[y[x]]:(y[x]-60)*64+y[++x];return y.buffer.slice(0,T)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,y,x){var b=n.exports.sbrk,T=b(y.length*4),C=b(x*4),A=new Uint8Array(n.exports.memory.buffer),S=s(y);A.set(S,T);var w=m(C,T,y.length,x);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(x);new Uint8Array(R.buffer).set(A.subarray(C,C+x*4)),S.set(A.subarray(T,T+y.length*4)),b(T-b(0));for(var D=0;D<y.length;++D)y[D]=R[y[D]];return[R,w]}function c(m){for(var y=0,x=0;x<m.length;++x){var b=m[x];y=y<b?b:y}return y}function u(m,y,x,b,T,C,A,S,w){var R=n.exports.sbrk,D=R(4),M=R(x*4),L=R(T*C),g=R(x*4),E=new Uint8Array(n.exports.memory.buffer);E.set(s(b),L),E.set(s(y),g);var v=m(M,g,x,L,T,C,A,S,w,D);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(v);s(I).set(E.subarray(M,M+v*4));var N=new Float32Array(1);return s(N).set(E.subarray(D,D+4)),R(D-R(0)),[I,N[0]]}function f(m,y,x,b,T,C,A,S,w,R,D,M,L){var g=n.exports.sbrk,E=g(4),v=g(x*4),I=g(T*C),N=g(T*S),F=g(w.length*4),U=g(x*4),k=R?g(T):0,z=new Uint8Array(n.exports.memory.buffer);z.set(s(b),I),z.set(s(A),N),z.set(s(w),F),z.set(s(y),U),R&&z.set(s(R),k);var B=m(v,U,x,I,T,C,N,S,F,w.length,k,D,M,L,E);z=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(z.subarray(v,v+B*4));var W=new Float32Array(1);return s(W).set(z.subarray(E,E+4)),g(E-g(0)),[j,W[0]]}function d(m,y,x,b){var T=n.exports.sbrk,C=T(x*b),A=new Uint8Array(n.exports.memory.buffer);A.set(s(y),C);var S=m(C,x,b);return T(C-T(0)),S}function p(m,y,x,b,T,C,A,S){var w=n.exports.sbrk,R=w(S*4),D=w(x*b),M=w(x*C),L=new Uint8Array(n.exports.memory.buffer);L.set(s(y),D),T&&L.set(s(T),M);var g=m(R,D,x,b,M,C,A,S);L=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(g);return s(E).set(L.subarray(R,R+g*4)),w(R-w(0)),E}var _={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var y=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,c(m)+1)},simplify:function(m,y,x,b,T,C){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b>=0&&b<=m.length),r(b%3==0),r(T>=0);for(var A=0,S=0;S<(C?C.length:0);++S)r(C[S]in _),A|=_[C[S]];var w=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),R=u(n.exports.meshopt_simplify,w,m.length,y,y.length/x,x*4,b,T,A);return R[0]=m instanceof Uint32Array?R[0]:new m.constructor(R[0]),R},simplifyWithAttributes:function(m,y,x,b,T,C,A,S,w,R){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b instanceof Float32Array),r(b.length%T==0),r(T>=0),r(A==null||A instanceof Uint8Array),r(A==null||A.length==y.length/x),r(S>=0&&S<=m.length),r(S%3==0),r(w>=0),r(Array.isArray(C)),r(T>=C.length),r(C.length<=32);for(var D=0;D<C.length;++D)r(C[D]>=0);for(var M=0,D=0;D<(R?R.length:0);++D)r(R[D]in _),M|=_[R[D]];var L=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),g=f(n.exports.meshopt_simplifyWithAttributes,L,m.length,y,y.length/x,x*4,b,T*4,new Float32Array(C),A?new Uint8Array(A):null,S,w,M);return g[0]=m instanceof Uint32Array?g[0]:new m.constructor(g[0]),g},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),d(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,x,b,T,C){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(x>=0&&x<=m.length/y),b?(r(b instanceof Float32Array),r(b.length%T==0),r(T>=3),r(m.length/y==b.length/T),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,b,T*4,C,x)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,x)}}}();var uun=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:njjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd:e1jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:njjjbhYamcuaLcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd:WwamcoBd;8waEaq:ZNhEdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaE:rhhcuh8PamcuaLcltalcFFFFd0Ecbyd:e1jjbHjjjjbbgIBd:0wamcrBd;8wcbaIa8AaCaLz:djjjb8AJFFuuhyJFFuuh8RJFFuuh8Sdnalci6gXmbJFFuuh8Sa8AhsaLhAJFFuuh8RJFFuuhyinascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),x=0;x<m.length;++x){var b=m.charCodeAt(x);y[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<m.length;++x)y[T++]=y[x]<60?t[y[x]]:(y[x]-60)*64+y[++x];return y.buffer.slice(0,T)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,y){var x=m.meshlets[y*4+0],b=m.meshlets[y*4+1],T=m.meshlets[y*4+2],C=m.meshlets[y*4+3];return{vertices:m.vertices.subarray(x,x+T),triangles:m.triangles.subarray(b,b+C*3)}}function f(m,y,x,b,T,C,A){var S=n.exports.sbrk,w=n.exports.meshopt_buildMeshletsBound(m.length,T,C),R=S(w*c),D=S(w*T*4),M=S(w*C*3),L=S(m.byteLength),g=S(y.byteLength),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),L),E.set(s(y),g);var v=n.exports.meshopt_buildMeshlets(R,D,M,L,m.length,g,x,b,T,C,A);E=new Uint8Array(n.exports.memory.buffer);for(var I=E.subarray(R,R+v*c),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),F=0;F<v;++F){var U=N[F*4+0],k=N[F*4+1],x=N[F*4+2],z=N[F*4+3];n.exports.meshopt_optimizeMeshlet(D+U*4,M+k,z,x)}var B=N[(v-1)*4+0],j=N[(v-1)*4+1],W=N[(v-1)*4+2],J=N[(v-1)*4+3],Y=B+W,ee=j+(J*3+3&-4),Q={meshlets:N,vertices:new Uint32Array(E.buffer,D,Y).slice(),triangles:new Uint8Array(E.buffer,M,ee*3).slice(),meshletCount:v};return S(R-S(0)),Q}function d(m){var y=new Float32Array(n.exports.memory.buffer,m,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(m,y,x,b){var T=n.exports.sbrk,C=[],A=T(y.byteLength),S=T(m.vertices.byteLength),w=T(m.triangles.byteLength),R=T(a),D=new Uint8Array(n.exports.memory.buffer);D.set(s(y),A),D.set(s(m.vertices),S),D.set(s(m.triangles),w);for(var M=0;M<m.meshletCount;++M){var L=m.meshlets[M*4+0],g=m.meshlets[M*4+0+1],E=m.meshlets[M*4+0+3];n.exports.meshopt_computeMeshletBounds(R,S+L*4,w+g,E,A,x,b),C.push(d(R))}return T(A-T(0)),C}function _(m,y,x,b){var T=n.exports.sbrk,C=T(a),A=T(m.byteLength),S=T(y.byteLength),w=new Uint8Array(n.exports.memory.buffer);w.set(s(m),A),w.set(s(y),S),n.exports.meshopt_computeClusterBounds(C,A,m.length,S,x,b);var R=d(C);return T(C-T(0)),R}return{ready:i,supported:!0,buildMeshlets:function(m,y,x,b,T,C){r(m.length%3==0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),r(b<=256||b>0),r(T<=512),r(T%4==0),C=C||0;var A=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(A,y,y.length/x,x*4,b,T,C)},computeClusterBounds:function(m,y,x){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3);var b=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return _(b,y,y.length/x,x*4)},computeMeshletBounds:function(m,y,x){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%x==0),r(x>=3),p(m,y,y.length/x,x*4)},extractMeshlet:function(m,y){return r(y>=0&&y<m.meshletCount),u(m,y)}}}();function Zx(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,_,m,y;if(ci(a,"EXT_meshopt_compression")){let b=a.extensions.EXT_meshopt_compression;c=b.buffer,u=b.byteOffset??0,f=b.byteLength,d=!0,p=b.byteStride,_=b.count,m=b.mode,y=b.filter??"NONE"}let x=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=_,this._meshoptMode=m,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=x,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Zx.prototype=Object.create(eo.prototype),Zx.prototype.constructor=Zx);Object.defineProperties(Zx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function LVe(e){try{let t=NVe(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);Ase.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=yt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load buffer view",t)}}Zx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=LVe(this),this._promise)};function NVe(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})}Zx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var dI=Zx;function Ur(){}Ur._maxDecodingConcurrency=Math.max(Ft.hardwareConcurrency-1,1);Ur._decoderTaskProcessor=void 0;Ur._taskProcessorReady=!1;Ur._error=void 0;Ur._getDecoderTaskProcessor=function(){if(!l(Ur._decoderTaskProcessor)){let e=new hi("decodeDraco",Ur._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Ur._taskProcessorReady=!0:Ur._error=new se("Draco decoder could not be initialized.")}).catch(t=>{Ur._error=t}),Ur._decoderTaskProcessor=e}return Ur._decoderTaskProcessor};Ur.decodePointCloud=function(e){let t=Ur._getDecoderTaskProcessor();if(l(Ur._error))throw Ur._error;if(Ur._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ur.decodeBufferView=function(e){let t=Ur._getDecoderTaskProcessor();if(l(Ur._error))throw Ur._error;if(Ur._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Zg=Ur;var ii={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function FVe(e){switch(e){case ii.POSITION:return"positionMC";case ii.NORMAL:return"normalMC";case ii.TANGENT:return"tangentMC";case ii.TEXCOORD:return"texCoord";case ii.COLOR:return"color";case ii.JOINTS:return"joints";case ii.WEIGHTS:return"weights";case ii.FEATURE_ID:return"featureId"}}ii.hasSetIndex=function(e){switch(e){case ii.POSITION:case ii.NORMAL:case ii.TANGENT:return!1;case ii.TEXCOORD:case ii.COLOR:case ii.JOINTS:case ii.WEIGHTS:case ii.FEATURE_ID:return!0}};ii.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ii.POSITION;case"NORMAL":return ii.NORMAL;case"TANGENT":return ii.TANGENT;case"TEXCOORD":return ii.TEXCOORD;case"COLOR":return ii.COLOR;case"JOINTS":return ii.JOINTS;case"WEIGHTS":return ii.WEIGHTS;case"_FEATURE_ID":return ii.FEATURE_ID}};ii.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ii.POSITION;case"RGBA":case"RGB":case"RGB565":return ii.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ii.NORMAL;case"BATCH_ID":return ii.FEATURE_ID}};ii.getGlslType=function(e){switch(e){case ii.POSITION:case ii.NORMAL:case ii.TANGENT:return"vec3";case ii.TEXCOORD:return"vec2";case ii.COLOR:return"vec4";case ii.JOINTS:return"ivec4";case ii.WEIGHTS:return"vec4";case ii.FEATURE_ID:return"int"}};ii.getVariableName=function(e,t){let n=FVe(e);return l(t)&&(n+=`_${t}`),n};var mt=Object.freeze(ii);function Qg(e){e=e??G.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=yt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Qg.prototype=Object.create(eo.prototype),Qg.prototype.constructor=Qg);Object.defineProperties(Qg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function BVe(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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Ese(e,n)}}Qg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=BVe(this),this._promise)};function Ese(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load Draco",t)}async function kVe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var Qx={};Qx[mt.POSITION]="POSITION";Qx[mt.NORMAL]="NORMAL";Qx[mt.COLOR]="COLOR";Qx[mt.TEXCOORD]="TEX_COORD";function UVe(e){for(let t in Qx)if(Qx.hasOwnProperty(t)&&e.startsWith(t))return Qx[t]}Qg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._dracoError)&&Ese(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 d in n.attributes)if(n.attributes.hasOwnProperty(d)){let p=UVe(d);l(p)&&i.accessors[n.attributes[d]].componentType===K.FLOAT&&(c.includes(p)||c.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:c},f=Zg.decodeBufferView(u);if(!l(f))return!1;this._decodePromise=kVe(this,f)};Qg.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 hI=Qg;function zVe(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 Ee.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ee.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ee({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 Jg=zVe;function i_(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(i_.prototype=Object.create(eo.prototype),i_.prototype.constructor=i_);Object.defineProperties(i_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});i_.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=VVe(this),this._promise):(this._promise=HVe(this),this._promise)};function Sse(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 VVe(e){e._state=yt.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 jVe(i);if(e.isDestroyed())return;let r=Sse(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(n){return e.isDestroyed()?void 0:vse(e,n,"Failed to load embedded image")}}async function HVe(e){e._state=yt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await qVe(i);if(e.isDestroyed())return;let r=Sse(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(o){return e.isDestroyed()?void 0:vse(e,o,`Failed to load image: ${n}`)}}function vse(e,t,n){return e.unload(),e._state=yt.FAILED,Promise.reject(e.getError(n,t))}function GVe(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 se("Image format is not recognized")}async function jVe(e){let t=GVe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return fa(n)}return i_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var WVe=/(^data:image\/ktx2)|(\.ktx2$)/i;function qVe(e){let t=e.getUrlComponent(!1,!0);return WVe.test(t)?fa(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}i_.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};i_._loadImageFromTypedArray=Jg;var mI=i_;var YVe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},xc=Object.freeze(YVe);function ey(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,c=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,d=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=u,this._loadBuffer=f,this._loadTypedArray=d,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ey.prototype=Object.create(eo.prototype),ey.prototype.constructor=ey);Object.defineProperties(ey.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 XVe=new wW;ey.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=KVe(this),this._promise):(this._promise=$Ve(this),this._promise)};async function KVe(e){e._state=yt.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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;vW(e,n)}}async function $Ve(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=yt.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=ZVe(e,a),e._state=yt.PROCESSING,e}catch(s){if(e.isDestroyed())return;vW(e,s)}}function ZVe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=ke.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Mo("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===ke.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===ke.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===ke.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function vW(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load index buffer",t)}function wW(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}wW.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};wW.prototype.execute=function(){this.buffer=wse(this.typedArray,this.indexDatatype,this.context)};function wse(e,t,n){let i=st.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}ey.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.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=K.fromTypedArray(t),this._indexDatatype=n)}catch(o){vW(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=XVe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,xc.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=wse(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};ey.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 pI=ey;function QVe(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 Ks=QVe;function JVe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Er=JVe;function Kt(){}Kt.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}}};Kt.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}}};Kt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Kt.objectLegacy(i,n):Kt.object(i,n)};Kt.accessor=function(e,t){return Kt.topLevel(e,"accessors",t)};Kt.accessorWithSemantic=function(e,t,n){let i={};return Kt.mesh(e,function(o){return Kt.meshPrimitive(o,function(r){let s=Kt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:Kt.meshPrimitiveTarget(r,function(a){return Kt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};Kt.accessorContainingVertexAttributeData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=Kt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Kt.meshPrimitiveTarget(o,function(s){return Kt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Kt.accessorContainingIndexData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.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}})})};Kt.animation=function(e,t){return Kt.topLevel(e,"animations",t)};Kt.animationChannel=function(e,t){let n=e.channels;return Kt.object(n,t)};Kt.animationSampler=function(e,t){let n=e.samplers;return Kt.object(n,t)};Kt.buffer=function(e,t){return Kt.topLevel(e,"buffers",t)};Kt.bufferView=function(e,t){return Kt.topLevel(e,"bufferViews",t)};Kt.camera=function(e,t){return Kt.topLevel(e,"cameras",t)};Kt.image=function(e,t){return Kt.topLevel(e,"images",t)};Kt.material=function(e,t){return Kt.topLevel(e,"materials",t)};Kt.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}};Kt.mesh=function(e,t){return Kt.topLevel(e,"meshes",t)};Kt.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}}};Kt.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}};Kt.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}}};Kt.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}};Kt.node=function(e,t){return Kt.topLevel(e,"nodes",t)};Kt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=Kt.nodeInTree(e,u,n),l(c)))return c}}}};Kt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Kt.nodeInTree(e,i,n)};Kt.program=function(e,t){return Er(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.programs,t):Kt.topLevel(e,"programs",t)};Kt.sampler=function(e,t){return Kt.topLevel(e,"samplers",t)};Kt.scene=function(e,t){return Kt.topLevel(e,"scenes",t)};Kt.shader=function(e,t){return Er(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.shaders,t):Kt.topLevel(e,"shaders",t)};Kt.skin=function(e,t){return Kt.topLevel(e,"skins",t)};Kt.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}}};Kt.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}};Kt.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}};Kt.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}};Kt.technique=function(e,t){return Er(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.techniques,t):Kt.topLevel(e,"techniques",t)};Kt.texture=function(e,t){return Kt.topLevel(e,"textures",t)};var Re=Kt;function e4e(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 Nf=e4e;function t4e(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 K.getSizeInBytes(t.componentType)*Nf(t.type)}var Au=t4e;function n4e(e){Re.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Re.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){if(i.mode=i.mode??q.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Ks(e.materials,o)}})}),Re.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=Au(e,i),r.target=q.ARRAY_BUFFER}}),Re.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=q.ELEMENT_ARRAY_BUFFER}}),Re.material(e,function(n){let i=n.extensions??G.EMPTY_OBJECT,o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&Re.materialValue(n,function(c){l(c.index)&&Jx(c)}),Jx(n.emissiveTexture),Jx(n.normalTexture),Jx(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,Jx(s.baseColorTexture),Jx(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,Jx(a.specularGlossinessTexture))}),Re.animation(e,function(n){Re.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=i4e(e);return Re.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]}),Re.sampler(e,function(n){n.wrapS=n.wrapS??q.REPEAT,n.wrapT=n.wrapT??q.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function i4e(e){let t={};return Re.animation(e,function(n){Re.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 Jx(e){l(e)&&(e.texCoord=e.texCoord??0)}var jF=n4e;function o4e(e){return Re.shader(e,function(t){WF(t)}),Re.buffer(e,function(t){WF(t)}),Re.image(e,function(t){WF(t)}),WF(e),e}function WF(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var eb=o4e;function r4e(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 qF=r4e;function s4e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),qF(e,t),n.length===0&&delete e.extensionsUsed}}var mA=s4e;var a4e=4;function c4e(e){if(Hl(e)!=="glTF")throw new se("File is not valid binary glTF");let n=Ise(e,0,5),i=n[1];if(i!==1&&i!==2)throw new se("Binary glTF version is not 1 or 2");return i===1?l4e(e,n):u4e(e,n)}function Ise(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*a4e,!0);return o}function l4e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new se("Binary glTF scene format is not JSON");let r=20,s=r+i,a=ha(e,r,i),c=JSON.parse(a);eb(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return mA(c,"KHR_binary_glTF"),c}function u4e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Ise(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=ha(u);o=JSON.parse(f),eb(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var YF=c4e;function f4e(e){return Re.shader(e,function(t){XF(t)}),Re.buffer(e,function(t){XF(t)}),Re.image(e,function(t){XF(t)}),XF(e),e}function XF(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var KF=f4e;function d4e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ks(n,t,!0)}var Wd=d4e;function h4e(e){switch(e){case K.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case K.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case K.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case K.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 K.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case K.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 K.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case K.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var ty=h4e;function m4e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Nf(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,_=Au(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,x=K.getSizeInBytes(y),b=new DataView(d.buffer),T=new Array(r),C=ty(y);for(let A=0;A<p;A++){C(b,m,r,x,T);for(let S=0;S<r;S++){let w=T[S];s[S]=Math.min(s[S],w),a[S]=Math.max(a[S],w)}m+=_}return{min:s,max:a}}var pA=m4e;var p4e=[q.FUNC_ADD,q.FUNC_ADD],_4e=[q.ONE,q.ZERO,q.ONE,q.ZERO];function Pse(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var g4e=[q.ZERO,q.ONE,q.SRC_COLOR,q.ONE_MINUS_SRC_COLOR,q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA,q.DST_ALPHA,q.ONE_MINUS_DST_ALPHA,q.DST_COLOR,q.ONE_MINUS_DST_COLOR];function y4e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(g4e.indexOf(e[n])===-1)return t;return e}function x4e(e){let t={},n={},i=e.techniques;return l(i)&&(Re.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Pse(s,q.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??p4e,blendFactors:y4e(c.blendFuncSeparate,_4e)})}Pse(s,q.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Wd(e,"KHR_blend")),Re.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Re.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 $F=x4e;function b4e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ks(n,t,!0),Wd(e,t)}var ZF=b4e;function T4e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Re.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Re.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Re.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[d.fragmentShader];p.fragmentShader=Ks(r.shaders,_,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ks(r.shaders,m,!0),u.program=Ks(r.programs,p),o[a.program]=u.program}i[c]=Ks(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Wd(e,"KHR_techniques_webgl"),ZF(e,"KHR_techniques_webgl"))}return Re.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Re.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var QF=T4e;function C4e(e,t){co.typeOf.object("material",e),co.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:d}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}}}let o=Re.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 _I=C4e;var Dse=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function A4e(e,t){return t=t??Dse,Dse.forEach(function(n){t.indexOf(n)>-1&&S4e(e,n)}),e}var E4e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function S4e(e,t){let n=E4e[t],i=e[n];if(l(i)){let o=0,r=ym[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(gm[t](e,a-o),o++)}}function gm(){}gm.accessor=function(e,t){e.accessors.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){Re.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Re.meshPrimitiveTarget(o,function(a){Re.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Re.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Re.animation(e,function(i){Re.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};gm.buffer=function(e,t){e.buffers.splice(t,1),Re.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};gm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Re.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Re.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Er(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(i){Re.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--})}),Er(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Er(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};gm.image=function(e,t){e.images.splice(t,1),Re.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};gm.mesh=function(e,t){e.meshes.splice(t,1),Re.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};gm.node=function(e,t){e.nodes.splice(t,1),Re.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})}),Re.animation(e,function(i){Re.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Re.technique(e,function(i){Re.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Re.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}))}),Re.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};gm.material=function(e,t){e.materials.splice(t,1),Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};gm.sampler=function(e,t){e.samplers.splice(t,1),Re.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};gm.texture=function(e,t){if(e.textures.splice(t,1),Re.material(e,function(i){_I(i,function(o,r){r.index>t&&--r.index})}),Er(e,"EXT_feature_metadata")){Re.mesh(e,function(r){Re.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let _=u[d].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Er(e,"EXT_mesh_features")&&Re.mesh(e,function(i){Re.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Er(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function ym(){}ym.accessor=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Re.meshPrimitiveTarget(i,function(r){Re.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Re.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Re.animation(e,function(n){Re.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Er(e,"EXT_mesh_gpu_instancing")&&Re.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})}),Er(e,"CESIUM_primitive_outline")&&Re.mesh(e,function(n){Re.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};ym.buffer=function(e){let t={};return Re.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};ym.bufferView=function(e){let t={};if(Re.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Re.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Er(e,"KHR_draco_mesh_compression")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Er(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(Er(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};ym.image=function(e){let t={};return Re.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};ym.mesh=function(e){let t={};return Re.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 Rse(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!Rse(e,o,n)}).length===0}ym.node=function(e){let t={};return Re.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Re.skinJoint(n,function(i){t[i]=!0})}),Re.animation(e,function(n){Re.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Re.technique(e,function(n){Re.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Re.node(e,function(n,i){Rse(e,i,t)||(t[i]=!0)}),t};ym.material=function(e){let t={};return Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};ym.texture=function(e){let t={};if(Re.material(e,function(n){_I(n,function(i){t[i]=!0})}),Er(e,"EXT_feature_metadata")){Re.mesh(e,function(o){Re.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Er(e,"EXT_mesh_features")&&Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Er(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};ym.sampler=function(e){let t={};return Re.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var JF=A4e;function v4e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Ks(e.buffers,n),byteOffset:0,byteLength:t.length};return Ks(e.bufferViews,o)}var e2=v4e;function w4e(e,t){let n=Au(e,t),i=K.getSizeInBytes(t.componentType),o=Nf(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=ty(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,d);for(let m=0;m<o;++m)s[_*o+m]=d[m];u+=n}return s}var t2=w4e;function I4e(e){let t;return Re.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?n2(e,i,K.UNSIGNED_BYTE):t!==q.UNSIGNED_BYTE&&t!==q.UNSIGNED_SHORT&&n2(e,i,K.UNSIGNED_SHORT)}),Re.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?n2(e,i,K.UNSIGNED_BYTE):t===q.SHORT&&n2(e,i,K.UNSIGNED_SHORT)}),e}function n2(e,t,n){let i=K.createTypedArray(n,t2(e,t)),o=new Uint8Array(i.buffer);t.bufferView=e2(e,o),t.componentType=n,t.byteOffset=0}var i2=I4e;function P4e(e,t){return mA(e,t),t==="CESIUM_RTC"&&D4e(e),IW(e,t)}function D4e(e){Re.technique(e,function(t){Re.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function IW(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)IW(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)&&IW(e[o],t);return i}}var _A=P4e;var o2={.8:F4e,"1.0":i8e,"2.0":void 0};function R4e(e,t){t=t??G.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(o2,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(o2,i)||(i="1.0"));let o=o2[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=o2[i];return t.keepLegacyExtensions||(s8e(e,t),a8e(e)),e}function Lse(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 O4e(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??q.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function M4e(e){let t=e.nodes,n=new h,i=new Pe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Pe.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 L4e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Pe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let y=f[m];if(y.target.path==="rotation"){let x=d[p[y.sampler].output];if(l(r[x]))continue;r[x]=!0;let b=n[x],T=i[b.bufferView],A=o[T.buffer].extras._pipeline.source,S=A.byteOffset+T.byteOffset+b.byteOffset,w=b.componentType,R=b.count,D=Nf(b.type),M=b.count*D,L=K.createArrayBufferView(w,A.buffer,S,M);for(let g=0;g<R;g++){let E=g*D;h.unpack(L,E,s);let v=L[E+3];Pe.fromAxisAngle(s,v,a),Pe.pack(a,L,E)}}}}}}function N4e(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 F4e(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,Lse(e),O4e(e),M4e(e),L4e(e),N4e(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,Wd(e,"KHR_materials_common")}}function B4e(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 Ose(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 k4e(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]=Ose(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]),Re.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Re.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Re.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}}),Re.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Re.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Re.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]})})}),Re.mesh(e,function(s){Re.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Re.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Re.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Ks(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Re.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Re.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]]}}),Re.animation(e,function(s){let a={};s.samplers=Ose(s.samplers,a),Re.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Re.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Re.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Re.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Re.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Re.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}}),Re.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function U4e(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){delete n.name})})}function z4e(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]}Re.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function V4e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var H4e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function G4e(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(H4e[o])&&e.extensionsRequired.push(o)}}}function j4e(e){Re.buffer(e,function(t){delete t.type})}function W4e(e){Re.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function q4e(e){Re.mesh(e,function(t){Re.meshPrimitive(t,function(n){Re.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})}),Re.technique(e,function(t){Re.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Y4e={POSITION:!0,NORMAL:!0,TANGENT:!0},X4e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function K4e(e){let t={};Re.mesh(e,function(n){Re.meshPrimitive(n,function(i){Re.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=X4e[a];l(f)?(u=f+c,t[r]=u):l(Y4e[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Re.technique(e,function(n){Re.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function $4e(e){Re.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 DW(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Au(e,t)}function Z4e(e){Re.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Re.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=DW(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function Q4e(e){let t,n,i,o=e.bufferViews,r={};Re.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Re.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,_){return p.byteOffset-_.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],_=DW(e,p),m=p.byteOffset,y=p.count*_;delete p.byteStride;let x=t<d-1,b=x?DW(e,c[t+1]):void 0;if(_!==b){let T=Fe(i,!0);r[a]&&(T.byteStride=_),T.byteOffset+=u,T.byteLength=m+y-u;let C=Ks(o,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=C,p.byteOffset=p.byteOffset-u;u=x?c[t+1].byteOffset:void 0,f=t+1}}}JF(e,["accessor","bufferView","buffer"])}function J4e(e){Re.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=pA(e,n);n.min=i.min,n.max=i.max}})}function Nse(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||O.fromColumnMajorArray(e.matrix).equals(O.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Fse(e,t){Re.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}}}),Re.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Nse(n)&&Fse(e,i))}}),delete e.nodes[t]}function e8e(e){return Re.node(e,function(t,n){Nse(t)&&Fse(e,n)}),e}function t8e(e){Re.animation(e,function(t){Re.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=pA(e,i);i.min=o.min,i.max=o.max}})})}function n8e(e){Re.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=pA(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function i8e(e){e.asset=e.asset??{},e.asset.version="2.0",Lse(e),B4e(e),e8e(e),k4e(e),U4e(e),V4e(e),G4e(e),Z4e(e),Q4e(e),J4e(e),t8e(e),n8e(e),j4e(e),W4e(e),q4e(e),K4e(e),i2(e),$4e(e),$F(e),QF(e),z4e(e)}var o8e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],r8e=["u_diffuse","u_diffuse_mat"];function RW(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function OW(e){return l(e.index)}function MW(e){return Array.isArray(e)&&e.length===4}function Bse(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 s8e(e,t){t=t??G.EMPTY_OBJECT;let n=t.baseColorTextureNames??o8e,i=t.baseColorFactorNames??r8e;Re.material(e,function(o){Re.materialValue(o,function(r,s){n.indexOf(s)!==-1&&OW(r)?(RW(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&MW(r)&&(RW(o),o.pbrMetallicRoughness.baseColorFactor=Bse(r))})}),_A(e,"KHR_techniques_webgl"),_A(e,"KHR_blend")}function PW(e,t){l(t)&&(MW(t)?e.pbrMetallicRoughness.baseColorFactor=Bse(t):OW(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Mse(e,t){l(t)&&(MW(t)?e.emissiveFactor=t.slice(0,3):OW(t)&&(e.emissiveTexture=t))}function a8e(e){Re.material(e,function(t){let n=(t.extensions??G.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,u=n.transparent;RW(t),n.technique==="CONSTANT"?(Wd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},PW(t,s),PW(t,o)):(PW(t,r),Mse(t,o),Mse(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),_A(e,"KHR_materials_common")}var r2=R4e;function bc(){}bc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let o=new se(i);return l(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};bc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:O.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Pe.IDENTITY,l(e.scale)?e.scale:h.ONE)};bc.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}};bc.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}};bc.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}};bc.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};bc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=mt.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=rn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":rn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var c8e=new h,l8e=new h;bc.getPositionMinMax=function(e,t,n){let i=bc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,l8e),o=h.add(o,n,c8e)),{min:r,max:o}};bc.getAxisCorrectionMatrix=function(e,t,n){return n=O.clone(O.IDENTITY,n),e===Go.Y?n=O.clone(Go.Y_UP_TO_Z_UP,n):e===Go.X&&(n=O.clone(Go.X_UP_TO_Z_UP,n)),t===Go.Z&&(n=O.multiplyTransformation(n,Go.Z_UP_TO_X_UP,n)),n};var u8e=new Z;bc.getCullFace=function(e,t){if(!Le.isTriangles(t))return Si.BACK;let n=O.getMatrix3(e,u8e);return Z.determinant(n)<0?Si.FRONT:Si.BACK};bc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};bc.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};bc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!bc.supportedExtensions[i])throw new se(`Unsupported glTF Extension: ${i}`)}};var Jt=bc;function ny(e){e=e??G.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=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ny.prototype=Object.create(eo.prototype),ny.prototype.constructor=ny);Object.defineProperties(ny.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});ny.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,l(this._gltfJson)?(this._promise=kse(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Use(this,this._typedArray),this._promise):(this._promise=f8e(this),this._promise))};async function f8e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;LW(e,n)}return Use(e,t)}function LW(e,t){e.unload(),e._state=yt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function d8e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Er(t,"KHR_techniques_webgl")&&!Er(t,"KHR_materials_common"))return Promise.resolve();let n=[];Re.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),r2(t)}function h8e(e){let t=[];return Re.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&yg(i)&&(delete n.uri,t.push(Ee.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function m8e(e,t){let n=[];return Re.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 kse(e,t){try{eb(t),await h8e(t),await d8e(e,t),jF(t),await m8e(e,t),KF(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new se(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Jt.checkSupportedExtensions(i),e._gltf=t,e._state=yt.READY,e}catch(n){if(e.isDestroyed())return;LW(e,n)}}async function Use(e,t){let n;try{Hl(t)==="glTF"?n=YF(t):n=jo(t)}catch(i){if(e.isDestroyed())return;LW(e,i)}return kse(e,n)}ny.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};ny.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var gI=ny;var p8e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},o_=Object.freeze(p8e);var wo={};function _8e(){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 g8e(){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 y8e(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function x8e(){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 b8e(){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 T8e(){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 C8e(){this.attributes=[]}function A8e(){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 E8e(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function S8e(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function v8e(){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 w8e(){this.nodes=[]}var I8e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function P8e(){this.input=[],this.interpolation=void 0,this.output=[]}function D8e(){this.node=void 0,this.path=void 0}function R8e(){this.sampler=void 0,this.target=void 0}function O8e(){this.name=void 0,this.samplers=[],this.channels=[]}function M8e(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function L8e(){this.name=void 0,this.stages=[]}function zse(){this.credits=[]}function N8e(){this.asset=new zse,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=O.clone(O.IDENTITY),this.extensions={}}function F8e(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.scale=1,this.channels=void 0}function iy(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(iy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=iy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=iy.DEFAULT_ROUGHNESS_FACTOR}iy.DEFAULT_BASE_COLOR_FACTOR=ie.ONE;iy.DEFAULT_METALLIC_FACTOR=1;iy.DEFAULT_ROUGHNESS_FACTOR=1;function tb(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(tb.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(tb.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=tb.DEFAULT_GLOSSINESS_FACTOR}tb.DEFAULT_DIFFUSE_FACTOR=ie.ONE;tb.DEFAULT_SPECULAR_FACTOR=h.ONE;tb.DEFAULT_GLOSSINESS_FACTOR=1;function yI(){this.specularFactor=yI.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(yI.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}yI.DEFAULT_SPECULAR_FACTOR=1;yI.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function xI(){this.anisotropyStrength=xI.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=xI.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}xI.DEFAULT_ANISOTROPY_STRENGTH=0;xI.DEFAULT_ANISOTROPY_ROTATION=0;function bI(){this.clearcoatFactor=bI.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=bI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}bI.DEFAULT_CLEARCOAT_FACTOR=0;bI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function NW(){this.metallicRoughness=new iy,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=h.clone(NW.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=o_.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}NW.DEFAULT_EMISSIVE_FACTOR=h.ZERO;wo.Quantization=_8e;wo.Attribute=g8e;wo.Indices=y8e;wo.FeatureIdAttribute=x8e;wo.FeatureIdTexture=T8e;wo.FeatureIdImplicitRange=b8e;wo.MorphTarget=C8e;wo.Primitive=A8e;wo.Instances=E8e;wo.Skin=S8e;wo.Node=v8e;wo.Scene=w8e;wo.AnimatedPropertyType=Object.freeze(I8e);wo.AnimationSampler=P8e;wo.AnimationTarget=D8e;wo.AnimationChannel=R8e;wo.Animation=O8e;wo.ArticulationStage=M8e;wo.Articulation=L8e;wo.Asset=zse;wo.Components=N8e;wo.TextureReader=F8e;wo.MetallicRoughness=iy;wo.SpecularGlossiness=tb;wo.Specular=yI;wo.Anisotropy=xI;wo.Clearcoat=bI;wo.Material=NW;var Cn=wo;var s2={};s2.getImageIdFromTexture=function(e){e=e??G.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};s2.createSampler=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=sn.REPEAT,r=sn.REPEAT,s=ft.LINEAR,a=Kn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];o=d.wrapS??o,r=d.wrapT??r,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==ft.LINEAR&&s!==ft.NEAREST&&(s===ft.NEAREST_MIPMAP_NEAREST||s===ft.NEAREST_MIPMAP_LINEAR?s=ft.NEAREST:s=ft.LINEAR),new zt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var B8e=new V(1,1);s2.createModelTextureReader=function(e){e=e??G.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)?V.unpack(s.offset):V.ZERO,u=s.rotation??0,f=l(s.scale)?V.unpack(s.scale):B8e;u=-u,r=new Z(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new Cn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Eu=s2;function k8e(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var nb=k8e;function oy(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=e.asynchronous??!0,u=i.index,f=Eu.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(oy.prototype=Object.create(eo.prototype),oy.prototype.constructor=oy);Object.defineProperties(oy.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var U8e=new FW;async function z8e(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=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load texture",n)}}oy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=z8e(this),this._promise)};function FW(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}FW.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};FW.prototype.execute=function(){this.texture=Vse(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Vse(e,t,n,i,o,r){let s=i.internalFormat,a=!1;je.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=Eu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===ft.NEAREST_MIPMAP_NEAREST||u===ft.NEAREST_MIPMAP_LINEAR||u===ft.LINEAR_MIPMAP_NEAREST||u===ft.LINEAR_MIPMAP_LINEAR,_=!l(s)&&p,m=_||f===sn.REPEAT||f===sn.MIRRORED_REPEAT||d===sn.REPEAT||d===sn.MIRRORED_REPEAT,y=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),x=m&&y,b;return l(s)?(!r.webgl2&&je.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=dt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(x&&(i=nb(i)),b=dt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),_&&b.generateMipmap(),b}oy.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=yt.PROCESSING;let t;if(this._asynchronous){let n=U8e;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,xc.TEXTURE))return;t=n.texture}else t=Vse(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=yt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};oy.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 TI=oy;function ry(e){e=e??G.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,c=e.attributeSemantic,u=e.accessorId,f=e.cacheKey,d=e.asynchronous??!0,p=e.loadBuffer??!1,_=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=u,this._cacheKey=f,this._asynchronous=d,this._loadBuffer=p,this._loadTypedArray=_,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ry.prototype=Object.create(eo.prototype),ry.prototype.constructor=ry);Object.defineProperties(ry.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 V8e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}ry.prototype.load=async function(){return l(this._promise)?this._promise:V8e(this._draco,this._attributeSemantic)?(this._promise=G8e(this),this._promise):(this._promise=W8e(this),this._promise)};function H8e(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Cn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=rn.VEC2,a.normalizationRange=r;else{let c=rn.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function G8e(e){e._state=yt.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=yt.LOADED,e)}catch{if(e.isDestroyed())return;BW(e)}}function j8e(e){e._state=yt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=H8e(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function W8e(e){e._state=yt.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=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;BW(e,n)}}function BW(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load vertex buffer",t)}function kW(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}kW.prototype.set=function(e,t){this.typedArray=e,this.context=t};kW.prototype.execute=function(){this.buffer=Hse(this.typedArray,this.context)};function Hse(e,t){let n=st.createVertexBuffer({typedArray:e,context:t,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var q8e=new kW;ry.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){BW(this,i)}j8e(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=q8e;if(i.set(n,e.context),!e.jobScheduler.execute(i,xc.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Hse(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};ry.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 CI=ry;function AI(e){e=e??G.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=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}AI.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=t_.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new AI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(AI.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}}});AI.BATCH_TABLE_CLASS_NAME="_batchTable";var xm=AI;function a2(e){e=e??G.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}a2.fromJson=function(e){return new a2({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(a2.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 c2=a2;function l2(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=e.valueType??kt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}l2.fromJson=function(e){e=e??G.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return c2.fromJson(o)});return new l2({id:t,values:i,valueType:kt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(l2.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 u2=l2;function f2(e){e=e??G.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=Fe(e.extras,!0),this._extensions=Fe(e.extensions,!0)}f2.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=u2.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]=xm.fromJson({id:i,class:e.classes[i],enums:t}));return new f2({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(f2.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 Ff=f2;function ib(e){e=e??G.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Ff.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ib.prototype=Object.create(eo.prototype),ib.prototype.constructor=ib);Object.defineProperties(ib.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});ib.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Y8e(this),this._promise)};async function Y8e(e){let t=e._resource;e._state=yt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Ff.fromJson(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}ib.prototype.unload=function(){this._schema=void 0};var EI=ib;var qd={};function gA(e){return _f(e.url)}function d2(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 X8e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Gse(e,t){return`${gA(e)}-buffer-id-${t}`}function SI(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return gA(o)}return Gse(n,t)}function UW(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=SI(a,s,n,i),u=d2(r);return`${c}-range-${u}`}function jse(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 gA(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=SI(u,c,n,i),d=d2(a);return`${f}-range-${d}`}function K8e(e,t){let n=Eu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}qd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${gA(n)}`};qd.getExternalBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${gA(t)}`};qd.getEmbeddedBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Gse(t,n)}`};qd.getGltfCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${gA(t)}`};qd.getBufferViewCacheKey=function(e){e=e??G.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=SI(a,s,i,o),u=d2(r);return`buffer-view:${c}-range-${u}`};qd.getDracoCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${UW(t,n,i,o)}`};qd.getVertexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${o.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${UW(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[r],_=p.buffer,m=t.buffers[_],y=SI(m,_,n,i),x=d2(p);return`vertex-buffer:${y}-range-${x}${d}`};qd.getIndexBufferCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${UW(t,s,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],_=p.buffer,m=t.buffers[_],y=SI(m,_,i,o),x=X8e(f,p);return`index-buffer:${y}-accessor-${x}${u}`};qd.getImageCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${jse(t,n,i,o)}`};qd.getTextureCacheKey=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=Eu.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=jse(t,c,i,o),f=K8e(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Su=qd;function vI(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}vI.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};vI.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};vI.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};vI.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 h2=vI;function Ln(){}Ln.cacheEntries={};Ln.statistics=new h2;function $8e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Ln.get=function(e){let t=Ln.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Ln.add=function(e){let t=e.cacheKey;return Ln.cacheEntries[t]=new $8e(e),e};Ln.unload=function(e){let t=e.cacheKey,n=Ln.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Ln.statistics.removeLoader(e),e.destroy(),delete Ln.cacheEntries[t])};Ln.getSchemaLoader=function(e){e=e??G.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Su.getSchemaCacheKey({schema:t,resource:n}),o=Ln.get(i);return l(o)?o:(o=new EI({schema:t,resource:n,cacheKey:i}),Ln.add(o))};Ln.getEmbeddedBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=Su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Ln.get(o);return l(r)?r:(r=new hA({typedArray:i,cacheKey:o}),Ln.add(r))};Ln.getExternalBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{resource:t}=e,n=Su.getExternalBufferCacheKey({resource:t}),i=Ln.get(n);return l(i)?i:(i=new hA({resource:t,cacheKey:n}),Ln.add(i))};Ln.getGltfJsonLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Su.getGltfCacheKey({gltfResource:t}),s=Ln.get(r);return l(s)?s:(s=new gI({resourceCache:Ln,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Ln.add(s))};Ln.getBufferViewLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Ln.get(r);return l(s)?s:(s=new dI({resourceCache:Ln,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Ln.add(s))};Ln.getDracoLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,s=Su.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Ln.get(s);return l(a)?a:(a=new hI({resourceCache:Ln,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Ln.add(a))};Ln.getVertexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:u,asynchronous:f=!0,dequantize:d=!1,loadBuffer:p=!1,loadTypedArray:_=!1}=e,m=Su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:c,dequantize:d,loadBuffer:p,loadTypedArray:_}),y=Ln.get(m);return l(y)?y:(y=new CI({resourceCache:Ln,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:c,accessorId:u,cacheKey:m,asynchronous:f,dequantize:d,loadBuffer:p,loadTypedArray:_}),Ln.add(y))};Ln.getIndexBufferLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=Su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),p=Ln.get(d);return l(p)?p:(p=new pI({resourceCache:Ln,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Ln.add(p))};Ln.getImageLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Ln.get(r);return l(s)?s:(s=new mI({resourceCache:Ln,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Ln.add(s))};Ln.getTextureLoader=function(e){e=e??G.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Ln.get(c);return l(u)?u:(u=new TI({resourceCache:Ln,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Ln.add(u))};Ln.clearForSpecs=function(){let e=[CI,pI,hI,TI,mI,dI,hA,EI,gI],t,n=Ln.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])}Ln.statistics.clear()};var Ri=Ln;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===hs.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=Z8e(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 T=a.tileMetadata;c=a.propertyTables[T]}let u=[];if(l(a.contentMetadata)){let T=a.contentMetadata.length;for(let C=0;C<T;C++){let A=a.contentMetadata[C];u.push(a.propertyTables[A])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let T=p.class,C=d.classes[T];f=new VF({subtreeMetadata:p,class:C})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let _={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??_);let m=Q8e(a.buffers),y=J8e(a.bufferViews,m);eHe(a,y),l(c)&&Wse(c,y);for(let T=0;T<u.length;T++){let C=u[T];Wse(C,y)}let x=await tHe(r,m,s.binary),b=iHe(y,x);return oHe(r,a,i,b),l(c)&&(rHe(r,i,b),aHe(r)),sHe(r,i,b),cHe(r),r._ready=!0,r};function Z8e(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=jo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Q8e(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 J8e(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 eHe(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 Wse(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 tHe(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=nHe(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 nHe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ri.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function iHe(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 oHe(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"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=zW(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let _=zW(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(_)}e._childSubtreeAvailability=zW(t.childSubtreeAvailability,i,a)}function zW(e,t,n,i){if(l(e.constant))return new lI({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 lI({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function rHe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new jd({class:a,count:o,properties:i.properties,bufferViews:n})}function sHe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,d=c.class,p=r.classes[d],_=new jd({class:p,count:f,properties:c.properties,bufferViews:n});s.push(_)}}function qse(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 aHe(e){let t=qse(e._tileAvailability);e._tileJumpBuffer=t}function cHe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=qse(o);t.push(r)}}_a.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new se("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 se("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function lHe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function uHe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}_a.prototype.getTileMetadataView=function(e){let t=lHe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new uI({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};_a.prototype.getContentMetadataView=function(e,t){let n=uHe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new uI({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)&&Ri.unload(this._bufferLoader),ce(this)};var yA=_a;var fHe={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"},xA=Object.freeze(fHe);var Yd={};Yd.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Yd.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Yd._parseMinimumHeight("TILE",e),maximumHeight:Yd._parseMaximumHeight("TILE",e)},content:{boundingVolume:Yd.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Yd._parseMinimumHeight("CONTENT",e),maximumHeight:Yd._parseMaximumHeight("CONTENT",e)}}};Yd.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}};Yd._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Yd._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var bA=Yd;function tl(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(tl.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}}});tl.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await yA.fromSubtreeJson(n,i,s,a,c),f=new tl(e,t,n);return f._implicitSubtree=u,dHe(f,u),f._ready=!0,f};function dHe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=mHe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=hHe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=AHe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function hHe(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 mHe(e,t,n,i){let s=Yse(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),_=f.branchingFactor*c.length;for(let m=0;m<_;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let x=t.getParentMortonIndex(m),b=c[x],T=m%f.branchingFactor,C=Yse(e,t,b,T,y);b.children.push(C),a.numberOfTilesTotal++,u.push(C)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Xse(e,t,n){let i=xA.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Yse(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let w=bA.parseAllBoundingVolumeSemantics(c);u=w.tile,f=w.content}let p=t.contentPropertyTableJsons.length,_=!1;for(let w=0;w<p;w++)if(t.contentIsAvailableAtCoordinates(a,w)){_=!0;break}let m=gHe(s,a,i,r,n,u),y=[];for(let w=0;w<s.contentCount;w++){if(!t.contentIsAvailableAtIndex(o,w))continue;let M={uri:s.contentUriTemplates[w].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=yHe(m,f);l(L)&&(M.boundingVolume=L),y.push(ct(M,s.contentHeaders[w]))}let x=Xse(c,s,a),b={boundingVolume:m,geometricError:x,refine:s.refine,contents:y},T=!0,C=Fe(s.tileHeader,T);delete C.boundingVolume,delete C.transform,delete C.metadata;let A=ct(b,C,T),S=Jse(e,s.baseResource,A,n);return S.implicitCoordinates=a,S.implicitSubtree=t,S.metadata=c,S.hasImplicitContentMetadata=_,S}function m2(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ci(e,"3DTILES_bounding_volume_S2")||l(e.region))}function HW(e,t){l(t)&&(ci(e,"3DTILES_bounding_volume_S2")?_He(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&pHe(e.region,t.minimumHeight,t.maximumHeight))}function pHe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function _He(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function gHe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!m2(r.boundingVolume,r)&&m2(e.boundingVolume,r)?s=Kse(e,t,n,i??!1,o):s=r.boundingVolume,HW(s,r),s}function yHe(e,t){let n;return l(t)&&(n=t.boundingVolume),m2(n,t)?HW(n,t):m2(e,t)&&(n=Fe(e,!0),HW(n,t)),n}function Kse(e,t,n,i,o){let r=e.boundingVolume;return ci(r,"3DTILES_bounding_volume_S2")?$se(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:Qse(r.region,t.level,t.x,t.y,t.z)}:{box:Zse(r.box,t.level,t.x,t.y,t.z)}}function $se(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Kg.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?cI.encode2D(i,o,r):cI.encode2D(i,r,o),f=Kg.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let _=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:_,p=n<4?_:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Kg.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var xHe=new h,bHe=new h,VW=new h,THe=new Z;function Zse(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,bHe),s=Z.unpack(e,3,THe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,xHe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=h.fromElements(c,u,f,VW);p=Z.multiplyByVector(s,p,VW),p=h.add(p,r,VW);let _=Z.clone(s);_=Z.multiplyByScale(_,d,_);let m=new Array(12);return h.pack(p,m),Z.pack(_,m,3),m}var CHe=new ae;function Qse(e,t,n,i,o){if(t===0)return e.slice();let r=ae.unpack(e,0,CHe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),d=P.negativePiToPi(f+u),p=c*r.height,_=P.negativePiToPi(r.south+i*p),m=P.negativePiToPi(_+p),y=s,x=a;if(l(o)){let b=c*(a-s);y+=o*b,x=y+b}return[f,_,d,m,y,x]}function AHe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Kse(i,o,n,!1,t),s=Xse(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Jse(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Jse(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}tl.prototype.hasProperty=function(e,t){return!1};tl.prototype.getFeature=function(e){};tl.prototype.applyDebugSettings=function(e,t){};tl.prototype.applyStyle=function(e){};tl.prototype.update=function(e,t){};tl.prototype.pick=function(e,t,n){};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ce(this)};tl._deriveBoundingBox=Zse;tl._deriveBoundingRegion=Qse;tl._deriveBoundingVolumeS2=$se;var wI=tl;var EHe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},vu=Object.freeze(EHe);function TA(e,t){this._distance=t,this._normal=new eae(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(TA.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});TA.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new TA(e.normal,e.distance),t};TA.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new TA(e.normal,e.distance)};function eae(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(eae.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 CA=TA;function Tc(e){e=e??G.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.edgeColor=H.clone(e.edgeColor??H.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?rae:sae,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 rae(e){return e===Gt.OUTSIDE}function sae(e){return e===Gt.INSIDE}Object.defineProperties(Tc.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?rae:sae)}},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 tae(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Tc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){tae(n,i)},e.index=t,tae(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Tc.prototype.get=function(e){return this._planes[e]};function aae(e,t){let n=e.length;for(let i=0;i<n;++i)if(en.equals(e[i],t))return i;return-1}Tc.prototype.contains=function(e){return aae(this._planes,e)!==-1};Tc.prototype.remove=function(e){let t=this._planes,n=aae(t,e);if(n===-1)return!1;e instanceof CA&&(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 CA&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Tc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof CA&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var SHe=new ie,vHe=new ie;function nae(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Mn.octEncodeToCartesian4(a.normal,vHe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(a.distance,SHe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function iae(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 cae(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var wHe=new V;Tc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Tc.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=cae(o,wHe);s.y*=2,i?(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.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?(iae(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(nae(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),iae(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),nae(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 IHe=new O,oae=new en(h.UNIT_X,0);Tc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=O.multiply(t,o,IHe));let r=Gt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Gt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];en.transform(a,o,oae);let c=e.intersectPlane(oae);if(c===Gt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Tc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Tc.useFloatTexture=function(e){return e.floatingPointTexture};Tc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Tc.useFloatTexture(t)?e.length:e.length*2,r=cae(o,n);return r.y*=2,r};Tc.prototype.isDestroyed=function(){return!1};Tc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ce(this)};var Os=Tc;function WW(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=uae(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=MHe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,d=-1/0;for(let p=n;p<o;p+=n){let _=e[p],m=e[p+1];_<a&&(a=_),m<c&&(c=m),_>f&&(f=_),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return PI(r,s,n,a,c,u,0),s}function uae(e,t,n,i,o){let r;if(o===jHe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=lae(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=lae(s/i|0,e[s],e[s+1],r);return r&&AA(r,r.next)&&(RI(r),r=r.next),r}function ob(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(AA(n,n.next)||zr(n.prev,n,n.next)===0)){if(RI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function PI(e,t,n,i,o,r,s){if(!e)return;!s&&r&&kHe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?DHe(e,i,o,r):PHe(e)){t.push(c.i,e.i,u.i),RI(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=RHe(ob(e),t),PI(e,t,n,i,o,r,2)):s===2&&OHe(e,t,n,i,o,r):PI(ob(e),t,n,i,o,r,1);break}}}function PHe(e){let t=e.prev,n=e,i=e.next;if(zr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(o,r,s),d=Math.min(a,c,u),p=Math.max(o,r,s),_=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=_&&II(o,a,r,c,s,u,m.x,m.y)&&zr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function DHe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(zr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,_=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),x=Math.max(f,d,p),b=GW(_,m,t,n,i),T=GW(y,x,t,n,i),C=e.prevZ,A=e.nextZ;for(;C&&C.z>=b&&A&&A.z<=T;){if(C.x>=_&&C.x<=y&&C.y>=m&&C.y<=x&&C!==o&&C!==s&&II(a,f,c,d,u,p,C.x,C.y)&&zr(C.prev,C,C.next)>=0||(C=C.prevZ,A.x>=_&&A.x<=y&&A.y>=m&&A.y<=x&&A!==o&&A!==s&&II(a,f,c,d,u,p,A.x,A.y)&&zr(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;C&&C.z>=b;){if(C.x>=_&&C.x<=y&&C.y>=m&&C.y<=x&&C!==o&&C!==s&&II(a,f,c,d,u,p,C.x,C.y)&&zr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;A&&A.z<=T;){if(A.x>=_&&A.x<=y&&A.y>=m&&A.y<=x&&A!==o&&A!==s&&II(a,f,c,d,u,p,A.x,A.y)&&zr(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function RHe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!AA(i,o)&&dae(i,n,n.next,o)&&DI(i,o)&&DI(o,i)&&(t.push(i.i,n.i,o.i),RI(n),RI(n.next),n=e=o),n=n.next}while(n!==e);return ob(n)}function OHe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&VHe(s,a)){let c=hae(s,a);s=ob(s,s.next),c=ob(c,c.next),PI(s,t,n,i,o,r,0),PI(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function MHe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=uae(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(zHe(u))}o.sort(LHe);for(let r=0;r<o.length;r++)n=NHe(o[r],n);return n}function LHe(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 NHe(e,t){let n=FHe(e,t);if(!n)return t;let i=hae(n,e);return ob(i,i.next),ob(n,n.next)}function FHe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(AA(e,n))return n;do{if(AA(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let d=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>r&&(r=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&fae(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let d=Math.abs(o-n.y)/(i-n.x);DI(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&BHe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function BHe(e,t){return zr(e.prev,e,t.prev)<0&&zr(t.next,e,e.next)<0}function kHe(e,t,n,i){let o=e;do o.z===0&&(o.z=GW(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,UHe(o)}function UHe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function GW(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 zHe(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 fae(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 II(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&fae(e,t,n,i,o,r,s,a)}function VHe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!HHe(e,t)&&(DI(e,t)&&DI(t,e)&&GHe(e,t)&&(zr(e.prev,e,t.prev)||zr(e,t.prev,t))||AA(e,t)&&zr(e.prev,e,e.next)>0&&zr(t.prev,t,t.next)>0)}function zr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function AA(e,t){return e.x===t.x&&e.y===t.y}function dae(e,t,n,i){let o=_2(zr(e,t,n)),r=_2(zr(e,t,i)),s=_2(zr(n,i,e)),a=_2(zr(n,i,t));return!!(o!==r&&s!==a||o===0&&p2(e,n,t)||r===0&&p2(e,i,t)||s===0&&p2(n,e,i)||a===0&&p2(n,t,i))}function p2(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 _2(e){return e>0?1:e<0?-1:0}function HHe(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&&dae(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function DI(e,t){return zr(e.prev,e,e.next)<0?zr(e,t,e.next)>=0&&zr(e,e.prev,t)>=0:zr(e,t,e.prev)<0||zr(e,e.next,t)<0}function GHe(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 hae(e,t){let n=jW(e.i,e.x,e.y),i=jW(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 lae(e,t,n,i){let o=jW(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 RI(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 jW(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function jHe(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 WHe=new h,qHe=new h,sy={};sy.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};sy.computeWindingOrder2D=function(e){return sy.computeArea2D(e)>0?Ps.COUNTER_CLOCKWISE:Ps.CLOCKWISE};sy.triangulate=function(e,t){let n=V.packArray(e);return WW(n,t,2)};var gae=new h,yae=new h,xae=new h,mae=new h,pae=new h,_ae=new h,r_=new h,bae=new V,Tae=new V,Cae=new V,EA=new V;sy.computeSubdivision=function(e,t,n,i,o){o=o??P.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let C=t[a];if(u[d++]=C.x,u[d++]=C.y,u[d++]=C.z,r){let A=i[a];f[p++]=A.x,f[p++]=A.y}}let _=[],m={},y=e.maximumRadius,x=P.chordLength(o,y),b=x*x;for(;s.length>0;){let C=s.pop(),A=s.pop(),S=s.pop(),w=h.fromArray(u,S*3,gae),R=h.fromArray(u,A*3,yae),D=h.fromArray(u,C*3,xae),M,L,g;r&&(M=V.fromArray(f,S*2,bae),L=V.fromArray(f,A*2,Tae),g=V.fromArray(f,C*2,Cae));let E=h.multiplyByScalar(h.normalize(w,mae),y,mae),v=h.multiplyByScalar(h.normalize(R,pae),y,pae),I=h.multiplyByScalar(h.normalize(D,_ae),y,_ae),N=h.magnitudeSquared(h.subtract(E,v,r_)),F=h.magnitudeSquared(h.subtract(v,I,r_)),U=h.magnitudeSquared(h.subtract(I,E,r_)),k=Math.max(N,F,U),z,B,j;k>b?N===k?(z=`${Math.min(S,A)} ${Math.max(S,A)}`,a=m[z],l(a)||(B=h.add(w,R,r_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(M,L,EA),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(S,a,C),s.push(a,A,C)):F===k?(z=`${Math.min(A,C)} ${Math.max(A,C)}`,a=m[z],l(a)||(B=h.add(R,D,r_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(L,g,EA),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(A,a,S),s.push(a,C,S)):U===k&&(z=`${Math.min(C,S)} ${Math.max(C,S)}`,a=m[z],l(a)||(B=h.add(D,w,r_),h.multiplyByScalar(B,.5,B),u.push(B.x,B.y,B.z),a=u.length/3-1,m[z]=a,r&&(j=V.add(g,M,EA),V.multiplyByScalar(j,.5,j),f.push(j.x,j.y))),s.push(C,a,A),s.push(a,S,A)):(_.push(S),_.push(A),_.push(C))}let T={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Le.TRIANGLES};return r&&(T.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new lt(T)};var YHe=new fe,XHe=new fe,KHe=new fe,qW=new fe;sy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??P.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let S=t[a];if(u[d++]=S.x,u[d++]=S.y,u[d++]=S.z,r){let w=i[a];f[p++]=w.x,f[p++]=w.y}}let _=[],m={},y=e.maximumRadius,x=P.chordLength(o,y),b=new _c(void 0,void 0,e),T=new _c(void 0,void 0,e),C=new _c(void 0,void 0,e);for(;s.length>0;){let S=s.pop(),w=s.pop(),R=s.pop(),D=h.fromArray(u,R*3,gae),M=h.fromArray(u,w*3,yae),L=h.fromArray(u,S*3,xae),g,E,v;r&&(g=V.fromArray(f,R*2,bae),E=V.fromArray(f,w*2,Tae),v=V.fromArray(f,S*2,Cae));let I=e.cartesianToCartographic(D,YHe),N=e.cartesianToCartographic(M,XHe),F=e.cartesianToCartographic(L,KHe);b.setEndPoints(I,N);let U=b.surfaceDistance;T.setEndPoints(N,F);let k=T.surfaceDistance;C.setEndPoints(F,I);let z=C.surfaceDistance,B=Math.max(U,k,z),j,W,J,Y,ee;B>x?U===B?(j=`${Math.min(R,w)} ${Math.max(R,w)}`,a=m[j],l(a)||(W=b.interpolateUsingFraction(.5,qW),J=(I.height+N.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,r_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(g,E,EA),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(R,a,S),s.push(a,w,S)):k===B?(j=`${Math.min(w,S)} ${Math.max(w,S)}`,a=m[j],l(a)||(W=T.interpolateUsingFraction(.5,qW),J=(N.height+F.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,r_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(E,v,EA),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(w,a,R),s.push(a,S,R)):z===B&&(j=`${Math.min(S,R)} ${Math.max(S,R)}`,a=m[j],l(a)||(W=C.interpolateUsingFraction(.5,qW),J=(F.height+I.height)*.5,Y=h.fromRadians(W.longitude,W.latitude,J,e,r_),u.push(Y.x,Y.y,Y.z),a=u.length/3-1,m[j]=a,r&&(ee=V.add(v,g,EA),V.multiplyByScalar(ee,.5,ee),f.push(ee.x,ee.y))),s.push(S,a,w),s.push(a,R,w)):(_.push(R),_.push(w),_.push(S))}let A={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Le.TRIANGLES};return r&&(A.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),new lt(A)};sy.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=WHe,r=qHe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var li=sy;function ay(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(ay.prototype,{length:{get:function(){return this._length}}});ay.prototype.enqueue=function(e){this._array.push(e),this._length++};ay.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};ay.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ay.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ay.prototype.clear=function(){this._array.length=this._offset=this._length=0};ay.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Wl=ay;var Qo={};Qo.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};Qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};Qo.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]=Qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var rb=new V;function Sae(e,t,n,i){return V.subtract(t,e,rb),V.multiplyByScalar(rb,n/i,rb),V.add(e,rb,rb),[rb.x,rb.y]}var cy=new h;function $He(e,t,n,i){return h.subtract(t,e,cy),h.multiplyByScalar(cy,n/i,cy),h.add(e,cy,cy),[cy.x,cy.y,cy.z]}Qo.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var y2=new fe,x2=new fe,ZHe=new fe,QHe=new h,g2=new _c;Qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,y2),r=e.cartesianToCartographic(n,x2),a=new _c(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};Qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=Qo.subdivideLineCount(n,i,o),a=V.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Sae(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Qo.subdivideLine=function(e,t,n,i){let o=Qo.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=$He(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,y2),c=n.cartesianToCartographic(o,x2);g2.setEndPoints(a,c);let u=g2.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=V.distance(e,t),_=p/d,m=s;m.length=d*2;let y=0;for(let x=0;x<d;x++){let b=Sae(e,t,x*_,p);m[y++]=b[0],m[y++]=b[1]}return m};Qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,y2),s=e.cartesianToCartographic(n,x2),a=new _c(r,s,e);if(l(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=o;p.length=f*3;let _=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,ZHe),x=e.cartographicToCartesian(y,QHe);p[_++]=x.x,p[_++]=x.y,p[_++]=x.z}return p};var JHe=new h,eGe=new h,tGe=new h,nGe=new h;Qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=JHe,s=eGe,a=tGe,c=nGe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};Qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new Wl;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=vo(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=vo(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let _=0;for(l(d.holes)&&(_=d.holes.length),s=0;s<_;s++)o.enqueue(d.holes[s])}i.push(u)}return i};var iGe=new fe;function oGe(e,t,n){let i=n.cartesianToCartographic(e,y2),o=n.cartesianToCartographic(t,x2);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;g2.setEndPoints(i,o);let r=g2.findIntersectionWithLatitude(0,iGe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function rGe(e,t,n,i){if(i===nn.RHUMB)return oGe(e,t,n);let o=ni.lineSegmentPlane(e,t,en.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var sGe=new fe;function aGe(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=P.sign(o.z),a=P.sign(r.z);let f=d=>t.cartesianToCartographic(d,sGe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=rGe(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function vae(e,t,n,i,o,r,s){let a=[],c=r,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),_=i[p];if(!l(_)){++c;continue}let{visited:m,type:y,next:x}=_;if(_.visited=!0,y===0){if(x===0){let A=i[p-(s?1:-1)];if(A?.position===c+1)A.visited=!0;else{++c;continue}}if(!m&&s&&x>0||r===c&&!s&&x<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let T=p+(s?1:-1),C=i[T];if(!l(C)){++c;continue}c=C.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let d of f)t=vae(e,++t,n,i,0,d,!s);return t}Qo.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=aGe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=vae(i,o,s,a,1,0,c)}return i};Qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new Wl;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,_,m;if(i)for(m=d.length,_=0;_<m;_++)o.scaleToGeodeticSurface(d[_],d[_]);if(t||(d=vo(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let x=[],b=li.computeWindingOrder2D(y);if(b===Ps.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let w=[d];if(w=r(w,w),w.length>1){for(let R of w)c.enqueue(new gc(R,p));continue}}let T=d.slice(),C=l(p)?p.length:0,A=[],S;for(_=0;_<C;_++){let w=p[_],R=w.positions;if(i)for(m=R.length,S=0;S<m;++S)o.scaleToGeodeticSurface(R[S],R[S]);if(t||(R=vo(R,h.equalsEpsilon,!0)),R.length<3)continue;let D=n(R);if(!l(D))continue;b=li.computeWindingOrder2D(D),b===Ps.CLOCKWISE&&(D.reverse(),R=R.slice().reverse()),A.push(R),x.push(T.length),T=T.concat(R),y=y.concat(D);let M=0;for(l(w.holes)&&(M=w.holes.length),S=0;S<M;S++)c.enqueue(w.holes[S])}s.push({outerRing:d,holes:A}),a.push({positions:T,positions2D:y,holes:x})}return{hierarchy:s,polygons:a}};var cGe=new V,lGe=new h,uGe=new Pe,fGe=new Z;Qo.computeBoundingRectangle=function(e,t,n,i,o){let r=Pe.fromAxisAngle(e,i,uGe),s=Z.fromQuaternion(r,fGe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let _=h.clone(n[p],lGe);Z.multiplyByVector(s,_,_);let m=t(_,cGe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};Qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=li.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),_=0;for(let x=0;x<d;x++){let b=c[x];p[_++]=b.x,p[_++]=b.y,p[_++]=b.z}let m={attributes:{position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Le.TRIANGLES};u&&(m.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:V.packArray(f)}));let y=new lt(m);return r.normal?Fn.computeNormal(y):y}if(s===nn.GEODESIC)return li.computeSubdivision(e,c,a,f,i);if(s===nn.RHUMB)return li.computeRhumbLineSubdivision(e,c,a,f,i)};var Aae=[],Eae=[],dGe=new h,hGe=new h;Qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,d,p,_,m,y=e.length,x=0,b=0,T=l(t),C=T?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),T&&(m=y*2*2,_=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[x]=s[x+a]=u.x,++x,s[x]=s[x+a]=u.y,++x,s[x]=s[x+a]=u.z,++x,s[x]=s[x+a]=f.x,++x,s[x]=s[x+a]=f.y,++x,s[x]=s[x+a]=f.z,++x,T&&(d=C[c],p=C[(c+1)%y],_[b]=_[b+m]=d.x,++b,_[b]=_[b+m]=d.y,++b,_[b]=_[b+m]=p.x,++b,_[b]=_[b+m]=p.y,++b);else{let D=P.chordLength(i,n.maximumRadius),M=0;if(r===nn.GEODESIC)for(c=0;c<y;c++)M+=Qo.subdivideLineCount(e[c],e[(c+1)%y],D);else if(r===nn.RHUMB)for(c=0;c<y;c++)M+=Qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],D);for(a=(M+y)*3,s=new Array(a*2),T&&(m=(M+y)*2,_=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,g;T&&(d=C[c],p=C[(c+1)%y]),r===nn.GEODESIC?(L=Qo.subdivideLine(u,f,D,Eae),T&&(g=Qo.subdivideTexcoordLine(d,p,u,f,D,Aae))):r===nn.RHUMB&&(L=Qo.subdivideRhumbLine(n,u,f,D,Eae),T&&(g=Qo.subdivideTexcoordRhumbLine(d,p,n,u,f,D,Aae)));let E=L.length;for(let v=0;v<E;++v,++x)s[x]=L[v],s[x+a]=L[v];if(s[x]=f.x,s[x+a]=f.x,++x,s[x]=f.y,s[x+a]=f.y,++x,s[x]=f.z,s[x+a]=f.z,++x,T){let v=g.length;for(let I=0;I<v;++I,++b)_[b]=g[I],_[b+m]=g[I];_[b]=p.x,_[b+m]=p.x,++b,_[b]=p.y,_[b+m]=p.y,++b}}}y=s.length;let A=ke.createTypedArray(y/3,y-e.length*6),S=0;for(y/=6,c=0;c<y;c++){let D=c,M=D+1,L=D+y,g=L+1;u=h.fromArray(s,D*3,dGe),f=h.fromArray(s,M*3,hGe),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(A[S++]=D,A[S++]=L,A[S++]=M,A[S++]=M,A[S++]=L,A[S++]=g)}let w={attributes:new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),indices:A,primitiveType:Le.TRIANGLES};return T&&(w.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:_})),new lt(w)};var Hn=Qo;function Vr(e,t){this.position=e,l(this.position)||(this.position=new V),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Vr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Vr.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=V.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var SA=new fe,mGe=new h;Vr.prototype.getLatitude=function(e){l(e)||(e=te.default),SA.latitude=this.conformalLatitude,SA.longitude=this.longitude,SA.height=0;let t=this.ellipsoid.cartographicToCartesian(SA,mGe);return e.cartesianToCartographic(t,SA),SA.latitude};var pGe=new gn,_Ge=new h,gGe=new h;Vr.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=Vr.NORTH_POLE_TANGENT_PLANE,o=Vr.SOUTH_POLE;n<0&&(i=Vr.SOUTH_POLE_TANGENT_PLANE,o=Vr.NORTH_POLE);let r=pGe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,_Ge),h.normalize(r.direction,r.direction);let s=ni.rayPlane(r,i.plane,gGe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new V(c,u),t.tangentPlane=i,t):new Vr(new V(c,u),i)};Vr.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]=Vr.fromCartesian(e[i],t[i]);return t};Vr.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Vr(e.position,e.tangentPlane)};Vr.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));Vr.NORTH_POLE=Object.freeze(new h(0,0,.5));Vr.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Vr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new fs(Vr.NORTH_POLE,Vr.HALF_UNIT_SPHERE));Vr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new fs(Vr.SOUTH_POLE,Vr.HALF_UNIT_SPHERE));var nl=Vr;var yGe=new fe,wae=new fe;function xGe(e,t,n,i){let r=i.cartesianToCartographic(e,yGe).height,s=i.cartesianToCartographic(t,wae);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,wae);a.height=r-100,i.cartographicToCartesian(a,n)}var Iae=new Xe,bGe=new h,TGe=new h,CGe=new h,AGe=new h,EGe=new h,SGe=new h,b2=new h,bm=new h,vA=new h,vGe=new V,wGe=new V,IGe=new h,Pae=new Pe,PGe=new Z,DGe=new Z;function YW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,_=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,x=vGe;x.x=f.x,x.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,T;t.normal&&(y&&c&&!a?T=n.attributes.normal.values:T=new Float32Array(s));let C=t.tangent?new Float32Array(s):void 0,A=t.bitangent?new Float32Array(s):void 0,S=i?new Float32Array(s):void 0,w=0,R=0,D=TGe,M=CGe,L=AGe,g=!0,E=PGe,v=DGe;if(m!==0){let F=Pe.fromAxisAngle(d,m,Pae);E=Z.fromQuaternion(F,E),F=Pe.fromAxisAngle(d,-m,Pae),v=Z.fromQuaternion(F,v)}else E=Z.clone(Z.IDENTITY,E),v=Z.clone(Z.IDENTITY,v);let I=0,N=0;c&&u&&(I=s/2,N=s/3,s/=2);for(let F=0;F<s;F+=3){let U=h.fromArray(o,F,IGe);if(t.st&&!l(r)){let k=Z.multiplyByVector(E,U,bGe);k=_.scaleToGeodeticSurface(k,k);let z=p([k],wGe)[0];V.subtract(z,x,z);let B=P.clamp(z.x/f.width,0,1),j=P.clamp(z.y/f.height,0,1);u&&(b[w+N]=B,b[w+1+N]=j),c&&(b[w]=B,b[w+1]=j),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=R+1,z=R+2;if(a){if(F+3<s){let B=h.fromArray(o,F+3,EGe);if(g){let j=h.fromArray(o,F+s,SGe);y&&xGe(U,B,j,_),h.subtract(B,U,B),h.subtract(j,U,j),D=h.normalize(h.cross(j,B,D),D),g=!1}h.equalsEpsilon(B,U,P.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=_.geodeticSurfaceNormal(U,L),t.tangent&&(M=h.normalize(h.cross(L,D,M),M)))}else D=_.geodeticSurfaceNormal(U,D),(t.tangent||t.bitangent)&&(y&&(b2=h.fromArray(T,R,b2),bm=h.cross(h.UNIT_Z,b2,bm),bm=h.normalize(Z.multiplyByVector(v,bm,bm),bm),t.bitangent&&(vA=h.normalize(h.cross(b2,bm,vA),vA))),M=h.cross(h.UNIT_Z,D,M),M=h.normalize(Z.multiplyByVector(v,M,M),M),t.bitangent&&(L=h.normalize(h.cross(D,M,L),L)));t.normal&&(e.wall?(T[R+I]=D.x,T[k+I]=D.y,T[z+I]=D.z):u&&(T[R+I]=-D.x,T[k+I]=-D.y,T[z+I]=-D.z),(c&&!y||a)&&(T[R]=D.x,T[k]=D.y,T[z]=D.z)),i&&(a&&(D=_.geodeticSurfaceNormal(U,D)),S[R+I]=-D.x,S[k+I]=-D.y,S[z+I]=-D.z),t.tangent&&(e.wall?(C[R+I]=M.x,C[k+I]=M.y,C[z+I]=M.z):u&&(C[R+I]=-M.x,C[k+I]=-M.y,C[z+I]=-M.z),c&&(y?(C[R]=bm.x,C[k]=bm.y,C[z]=bm.z):(C[R]=M.x,C[k]=M.y,C[z]=M.z))),t.bitangent&&(u&&(A[R+I]=L.x,A[k+I]=L.y,A[z+I]=L.z),c&&(y?(A[R]=vA.x,A[k]=vA.y,A[z]=vA.z):(A[R]=L.x,A[k]=L.y,A[z]=L.z))),R+=3}}t.st&&!l(r)&&(n.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(n.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(n.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:A})),i&&(n.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===cn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===cn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Dae=[];function RGe(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let T=Hn.createGeometryFromPositions(e,t,n,i,r,c,u),C=T.attributes.position.values,A=T.indices,S,w;if(s&&a){let R=C.concat(C);S=R.length/3,w=ke.createTypedArray(S,A.length*2),w.set(A);let D=A.length,M=S/2;for(d=0;d<D;d+=3){let L=w[d]+M,g=w[d+1]+M,E=w[d+2]+M;w[d+D]=E,w[d+1+D]=g,w[d+2+D]=L}if(T.attributes.position.values=R,r&&c.normal){let L=T.attributes.normal.values;T.attributes.normal.values=new Float32Array(R.length),T.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=T.attributes.st.values;T.attributes.st.values=new Float32Array(S*2),T.attributes.st.values=L.concat(L)}T.indices=w}else if(a){for(S=C.length/3,w=ke.createTypedArray(S,A.length),d=0;d<A.length;d+=3)w[d]=A[d+2],w[d+1]=A[d+1],w[d+2]=A[d];T.indices=w}f.topAndBottom=new Pt({geometry:T})}let p=o.outerRing,_=fs.fromPoints(p,e),m=_.projectPointsOntoPlane(p,Dae),y=li.computeWindingOrder2D(m);y===Ps.CLOCKWISE&&(p=p.slice().reverse());let x=Hn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new Pt({geometry:x}));let b=o.holes;for(d=0;d<b.length;d++){let T=b[d];m=_.projectPointsOntoPlane(T,Dae),y=li.computeWindingOrder2D(m),y===Ps.COUNTER_CLOCKWISE&&(T=T.slice().reverse()),x=Hn.computeWallGeometry(T,n,e,i,r,u),f.walls.push(new Pt({geometry:x}))}return f}function kf(e){let t=e.polygonHierarchy,n=e.vertexFormat??De.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??P.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=De.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??nn.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+te.packedLength+De.packedLength+(s?Hn.computeHierarchyPackedLength(s,V):1)+12}kf.fromPositions=function(e){e=e??G.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 kf(t)};kf.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,V):t[n++]=-1,t[n++]=e.packedLength,t};var OGe=te.clone(te.UNIT_SPHERE),MGe=new De,LGe={polygonHierarchy:{}};kf.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,OGe);t+=te.packedLength;let r=De.unpack(e,t,MGe);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,_=e[t++]===1,m=e[t++]===1,y=e[t++],x=e[t++],b=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,V);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let T=e[t++];return l(n)||(n=new kf(LGe)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=_,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=x,n._textureCoordinates=b,n.packedLength=T,n};var NGe=new V,FGe=new V,BGe=new nl;function Rae(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==nn.RHUMB){let p=V.subtract(t.position,e.position,NGe),_=V.dot(t.position,p)/V.dot(p,p);if(_>0&&_<1){let m=V.add(t.position,V.multiplyByScalar(p,-_,p),FGe),y=nl.clone(t,BGe);y.position=m;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)&&(u=x)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=V.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=d),u<=0&&(o.southAngle+=d)}var Oae=new nl,kGe=new nl,Bf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};kf.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ae),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,Bf.northAngle=0,Bf.southAngle=0,Bf.westOverIdl=Number.POSITIVE_INFINITY,Bf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=nl.fromCartesian(e[0],kGe);for(let s=1;s<o;s++){let a=nl.fromCartesian(e[s],Oae);Rae(a,r,t,n,Bf,i),r=nl.clone(a,r)}return Rae(nl.fromCartesian(e[0],Oae),r,t,n,Bf,i),i.east-i.west>Bf.eastOverIdl-Bf.westOverIdl&&(i.west=Bf.westOverIdl,i.east=Bf.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(Bf.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(Bf.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var UGe=new nl;function zGe(e,t,n){return e.height>=P.PI||e.width>=P.PI?nl.fromCartesian(t[0],UGe).tangentPlane:fs.fromPoints(t,n)}var Mae=new fe;function VGe(e,t,n){return(i,o)=>{if(e.height>=P.PI||e.width>=P.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],Mae);o[s]=new V(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return o.length=i.length,o}return nl.fromCartesianArray(i,o)}return fs.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function HGe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Mae);return l(r)||(r=new V),r.x=s.longitude/P.PI,r.y=s.latitude/P.PI_OVER_TWO,r}return nl.fromCartesian(o,r)};let i=fs.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function GGe(e,t,n,i){return(o,r)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?Hn.splitPolygonsOnEquator(o,t,n,r):o}function jGe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return Xe.fromRectangle(t,void 0,Iae);let o=e,r=fs.fromPoints(o,n);return Hn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Iae)}kf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let _=e.rectangle,m=Hn.polygonsFromHierarchy(r,d,VGe(_,p,n),!s,n,GGe(_,n,u,s)),y=m.hierarchy,x=m.polygons,b=function(I){return I},T=d?Hn.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let C=y[0].outerRing,A=jGe(C,_,n,o),S=[],w=e._height,R=e._extrudedHeight,D=e._perPositionHeightExtrude||!P.equalsEpsilon(w,R,0,P.EPSILON2),M={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:zGe(_,C,n).plane.normal,projectTo2d:HGe(_,C,n),boundingRectangle:A,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(D)for(M.extrude=!0,M.top=a,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,L=0;L<x.length;L++){let I=RGe(n,x[L],d?T[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=I.topAndBottom,M.geometry=Hn.scaleToGeodeticHeightExtruded(N.geometry,w,R,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=li.scaleToGeodeticHeight(N.geometry.attributes.position.values,w,n,!s),M.geometry=N.geometry):c&&(N=I.topAndBottom,N.geometry.attributes.position.values=li.scaleToGeodeticHeight(N.geometry.attributes.position.values,R,n,!0),M.geometry=N.geometry),(a||c)&&(M.wall=!1,N.geometry=YW(M),S.push(N));let F=I.walls;M.wall=!0;for(let U=0;U<F.length;U++){let k=F[U];M.geometry=Hn.scaleToGeodeticHeightExtruded(k.geometry,w,R,n,s),k.geometry=YW(M),S.push(k)}}else for(L=0;L<x.length;L++){let I=new Pt({geometry:Hn.createGeometryFromPositions(n,x[L],d?T[L]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=li.scaleToGeodeticHeight(I.geometry.attributes.position.values,w,n,!s),M.geometry=I.geometry,I.geometry=YW(M),l(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,F=e._offsetAttribute===cn.NONE?0:1,U=new Uint8Array(N/3).fill(F);I.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}S.push(I)}let g=Fn.combineInstances(S)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=ke.createTypedArray(g.attributes.position.values.length/3,g.indices);let E=g.attributes,v=re.fromVertices(E.position.values);return t.position||delete E.position,new lt({attributes:E,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:v,offsetAttribute:e._offsetAttribute})};kf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new kf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function WGe(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 lt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(kf.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=kf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=WGe(this)),this._textureCoordinateRotationPoints}}});var ly=kf;function sb(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=[...e.positions]}Object.defineProperties(sb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});sb.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new sb({positions:e.positions,ellipsoid:e.ellipsoid})};sb.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};sb.prototype.computeRectangle=function(e){return ly.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var qGe=new ae,Lae=new h;sb.prototype.computeSphericalExtents=function(e){l(e)||(e=new ae);let t=this.computeRectangle(qGe),n=fe.toCartesian(ae.southwest(t),this.ellipsoid,Lae),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(ae.northeast(t),this.ellipsoid,Lae),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var OI=sb;var T2=`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 ns(e){e=e??G.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new me,this.polygonRemoved=new me,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(ns.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}}});ns.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};ns.prototype.get=function(e){return this._polygons[e]};ns.prototype.contains=function(e){return this._polygons.some(t=>OI.equals(t,e))};ns.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>OI.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var YGe=new ae;function XGe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ae.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let d=[r];for(let p=0;p<t.length;++p){let _=t[p];if(l(_)&&l(ae.simpleIntersection(_,f))&&!ae.equals(_,f)){let m=n[p];d.push(...m),m.reduce((y,x)=>ae.union(e[x].computeSphericalExtents(YGe),y,y),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ae.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(d)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}ns.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 KGe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=XGe(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let d=0;d<f;++d){let p=u.positions[d],_=Math.hypot(p.x,p.y),m=P.fastApproximateAtan2(_,p.z),y=P.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=y}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var XW=new V;ns.prototype.update=function(e){let t=e.context;if(!ns.isSupported(e))throw new se("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=ns.getTextureResolution(i,this.pixelsNeededForPolygonPositions,XW);i=new dt({context:t,width:s.x,height:s.y,pixelFormat:je.RG,pixelDatatype:He.FLOAT,sampler:zt.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=ns.getTextureResolution(o,this.pixelsNeededForExtents,XW);o=new dt({context:t,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(KGe(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=ns.getClippingDistanceTextureResolution(this,XW);r=new dt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?je.RED:je.LUMINANCE,pixelDatatype:He.FLOAT,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=$Ge(this)};ns.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function $Ge(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Fa({fragmentShaderSource:T2,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 Nae=new ae,ZGe=new ae;ns.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Gt.OUTSIDE;this.inverse&&(o=Gt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=ae.fromCartesianArray(f,t,Nae)}l(c)||(c=ae.fromBoundingSphere(e.boundingSphere,t,Nae));let u=ae.simpleIntersection(c,a,ZGe);l(u)&&(o=Gt.INTERSECTING)}return o};ns.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ns.isSupported=function(e){return e?.context.webgl2};ns.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Lt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};ns.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Lt.maximumTextureSize,4096),t.y=Math.min(Lt.maximumTextureSize,4096),t)};ns.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):ns.getTextureResolution(n,e.pixelsNeededForExtents,t)};ns.prototype.isDestroyed=function(){return!1};ns.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(),ce(this)};var Tm=ns;var MI={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};MI.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?MI.SUNLIGHT:MI.SCENE_LIGHT:MI.NONE};var uy=Object.freeze(MI);function Fae(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(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=uy.NONE}Fae.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var wA=Fae;var Cm=`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 C2=`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 A2=`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 E2=`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 S2=`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 Jn(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??G.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(Lt.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=Jn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new $;let n=Math.pow(2,t-1);this._textureDimensions=new V(n,n),this._radiiAndDynamicAtmosphereColor=new h,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??Jn.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Jn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.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}}});Jn._maximumComputeCommandCount=8;Jn._activeComputeCommandCount=0;Jn._nextFrameCommandQueue=[];Jn._queueCommand=(e,t)=>{if(Jn._activeComputeCommandCount>=Jn._maximumComputeCommandCount){Jn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Jn._activeComputeCommandCount++};Jn._updateCommandQueue=e=>{if(Jn._maximumComputeCommandCount=Math.log2(Lt.maximumCubeMapSize),Jn._nextFrameCommandQueue.length>0&&Jn._activeComputeCommandCount<Jn._maximumComputeCommandCount){let t=Jn._nextFrameCommandQueue.shift();for(;l(t)&&Jn._activeComputeCommandCount<Jn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Jn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Jn._activeComputeCommandCount++,t=Jn._nextFrameCommandQueue.shift()}l(t)&&Jn._nextFrameCommandQueue.push(t)}};Jn.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Jn.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 QGe=new h,JGe=new h;function e5e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,JGe),s=1.025,a=QGe,c=l(r)?h.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Bae=new h,t5e=new O,n5e=new ie,i5e=new H;function o5e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new fr({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Be({sources:[Cm,A2]}),e._radianceMapFS=o),wA.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Et.eastNorthUpToFixedFrame(r,a,t5e),u=n5e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of fr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new dt({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA}),e._radianceMapTextures[f]=p;let _=f,m=new Fa({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>fr.getDirection(d,Bae),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,i5e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Jn._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[_]=void 0;let x=new Zr({context:n,colorTextures:[e._radianceMapTextures[_]]});x._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),x._unBind(),x.destroy(),Jn._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Jn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function r5e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(d,p,_,m,y)=>()=>{if(e.isDestroyed()||d.canceled){Jn._activeComputeCommandCount--;return}let x=e._convolutionComputeCommands;x[p]=void 0,n.copyFace(t,_,m,y),c++,Jn._activeComputeCommandCount--,_.destroy(),e._specularMapTextures[p]=void 0;let b=e._specularMapTextures.length;c>=b&&(e._irradianceCommandDirty=!0,n.sampler=new zt({minificationFilter:ft.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let d=1;d<i;++d){for(let p of fr.faceNames()){l(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let _=e._specularMapTextures[f]=new dt({context:a,width:r,height:s,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA}),m=e._va;l(m)||(m=fr.createVertexArray(a,p),e._va=m);let y=e._convolveSP;l(y)||(y=Xt.fromCache({context:a,vertexShaderSource:S2,fragmentShaderSource:E2,attributeLocations:{positions:0}}),e._convolveSP=y);let x=new Fa({shaderProgram:y,vertexArray:m,outputTexture:_,persists:!0,owner:e,uniformMap:{u_roughness:()=>d/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>fr.getDirection(p,Bae)}});x.postExecute=u(x,f,_,p,d),e._convolutionComputeCommands[f]=x,Jn._queueCommand(x,t),++f}r/=2,s/=2}}var kae=new V(3,3);function s5e(e,t){let n=t.context,i=kae,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new dt({context:n,width:i.x,height:i.y,pixelDatatype:He.FLOAT,pixelFormat:je.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Be({sources:[C2]}),e._irradianceMapFS=r);let s=new Fa({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Jn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Jn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Jn._queueCommand(s,t),e._irradianceTextureDirty=!0}function a5e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Zr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=kae,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]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Jn.prototype.update=function(e){let t=e.mode;if(!Jn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}Jn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=e5e(this,e)||i===uy.SUNLIGHT&&!$.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=$.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(o5e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(r5e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(s5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){a5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Jn.prototype.isDestroyed=function(){return!1};Jn.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(),ce(this)};Jn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Jn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(H.fromCssColorString("#717145"));Jn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var fy=Jn;var LI={HIGHLIGHT:0,REPLACE:1,MIX:2};LI.getColorBlend=function(e,t){if(e===LI.HIGHLIGHT)return 0;if(e===LI.REPLACE)return 1;if(e===LI.MIX)return P.clamp(t,P.EPSILON4,1)};var il=Object.freeze(LI);var c5e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},ol=Object.freeze(c5e);var l5e={STEP:0,LINEAR:1,CUBICSPLINE:2},rl=Object.freeze(l5e);var Uae={};function NI(e){this._count=e.count,this._properties=Fe(e.properties,!0)}NI.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,Uae)};NI.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,Uae,e)};NI.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Fe(n[e],!0)};NI.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Fe(n,!0)};var dy=NI;function Cc(e){e=e??G.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(Cc.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}}});Cc.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))};Cc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Cc.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))};Cc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var KW=[];Cc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(KW)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,KW)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(KW)),t};Cc.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};Cc.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 dy({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Cc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Cc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Cc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Cc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Cc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Cc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Cc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var ql=Cc;function FI(e){e=e??G.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Eu.createModelTextureReader({textureInfo:r,channels:d5e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(FI.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}}});FI.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(Tt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(Tt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(Tt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==kt.UINT8?(Tt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==kt.UINT8?(Tt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(Tt(`Property texture property ${e.id} has an unsupported type`),!1)};var u5e=[void 0,"float","vec2","vec3","vec4"],f5e=[void 0,"int","ivec2","ivec3","ivec4"];FI.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?u5e[t]:f5e[t]};FI.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function d5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var v2=FI;function $W(e){e=e??G.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 v2({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($W.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}}});$W.prototype.getProperty=function(e){return this._properties[e]};var hy=$W;function zae(e){e=e??G.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(zae.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 w2=zae;function ZW(e){e=e??G.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 w2({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(ZW.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}}});ZW.prototype.getProperty=function(e){return this._properties[e]};var IA=ZW;function BI(e){e=e??G.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(BI.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}}});BI.prototype.getPropertyTable=function(e){return this._propertyTables[e]};BI.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};BI.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var ga=BI;function h5e(e){e=e??G.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new jd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new ql({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new hy({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 IA({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new ga({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var I2=h5e;function m5e(e){e=e??G.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new jd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new ql({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new hy({id:a,propertyTexture:p5e(c),class:n.classes[c.class],textures:e.textures}))}return new ga({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function p5e(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:_5e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=ct(o.texture,r,!0)}return t}function _5e(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 P2=m5e;function my(e){e=e??G.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(my.prototype=Object.create(eo.prototype),my.prototype.constructor=my);Object.defineProperties(my.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function g5e(e){try{let t=C5e(e),n=w5e(e),i=I5e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=yt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load structural metadata",t)}}my.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=g5e(this),this._promise)};function y5e(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 x5e(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 b5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];y5e(o.properties,n)}return n}function T5e(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)&&x5e(r,n)}}return n}async function C5e(e){let t;l(e._extension)?t=b5e(e._extension):t=T5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ri.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function A5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&E5e(r,t)}return t}function E5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function S5e(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)&&v5e(r,t)}}return t}function v5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function w5e(e){let t;l(e._extension)?t=A5e(e._extension):t=S5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Ri.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function I5e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ri.getSchemaLoader({resource:i})}else n=Ri.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}my.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=I2({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=P2({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Vae(this),this._state=yt.READY,!0};function Vae(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function P5e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}my.prototype.unload=function(){Vae(this),P5e(this),l(this._schemaLoader)&&Ri.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var D2=my;var PA={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};PA.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return PA.TRANSLATION;case"ROTATION":return PA.ROTATION;case"SCALE":return PA.SCALE;case"_FEATURE_ID":return PA.FEATURE_ID}};var ms=Object.freeze(PA);var D5e=65534,R5e=255;function R2(e){e=e??G.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new jae(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],O5e(this)}Object.defineProperties(R2.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function O5e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),_=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=Hae(i,c,u,f,p,_,m);for(;l(y);){let x=s[y];if(!l(x)){x=r+o.length;let b=y;for(;b>=r;)b=o[b-r];o.push(b),s[y]=x}x>D5e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>R5e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=x,t[a]=x):y===u?(u=x,t[a+1]=x):(f=x,t[a+2]=x),y=Hae(i,c,u,f,p,_,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Hae(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=QW(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,_=r?1:0,m=QW(e,n,d,p,_);if(m===0)return n;let y=s?1:0,x=0,b=r?1:0,T=QW(e,i,y,x,b);if(T===0)return i;let C=f&m&T,A,S,w;if(C&1)A=0,S=1,w=2;else if(C&2)A=0,w=1,S=2;else if(C&4)S=0,A=1,w=2;else if(C&8)S=0,w=1,A=2;else if(C&16)w=0,A=1,S=2;else if(C&32)w=0,S=1,A=2;else{let L=JW(f),g=JW(m),E=JW(T);return L<g&&L<E?t:g<E?n:i}let R=t*3;e[R+A]=a,e[R+S]=c,e[R+w]=u;let D=n*3;e[D+A]=d,e[D+S]=p,e[D+w]=_;let M=i*3;e[M+A]=y,e[M+S]=x,e[M+w]=b}function QW(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 JW(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}R2.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};R2.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,Lt.maximumTextureSize),i=n,o=Gae(i),r=[];for(;i>1;)i>>=1,r.push(Gae(i));let s=new dt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:je.LUMINANCE,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:Kn.LINEAR})});return t.outlineTexture=s,s};function Gae(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 jae(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)}}jae.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 DA=R2;function Wae(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function M5e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function O2(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}O2.prototype.postProcess=function(e){this.needsOutlines&&(L5e(this),F5e(this,e))};function L5e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new DA({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=ke.fromTypedArray(n.typedArray);let r=N5e(o.outlineCoordinates),s=new Wae(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function N5e(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=K.FLOAT,t.type=rn.VEC3,t.normalized=!1,t.count=e.length/3,t}function F5e(e,t){B5e(e.attributePlans,t),l(e.indicesPlan)&&k5e(e.indicesPlan,t)}function B5e(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=st.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function k5e(e,t){let n=e.indices;if(e.loadBuffer){let i=st.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}O2.AttributeLoadPlan=Wae;O2.IndicesLoadPlan=M5e;var RA=O2;function U5e(e){e=e??G.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var M2=U5e;function qae(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(qae.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var L2=qae;function Yae(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Yae.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var N2=Yae;function Xae(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Xae.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var F2=Xae;var z5e={Direct:"Direct",Indirect:"Indirect"},ab=Object.freeze(z5e);function Kae(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Kae.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 kI=Kae;function $ae(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties($ae.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 B2=$ae;function OA(){}function Zae(e){return new Z(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function V5e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new L2({position:t,adjustmentParams:n})}function H5e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Zae(e.covarianceMatrix);return new N2({position:t,adjustmentParams:n,covarianceMatrix:i})}function G5e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new B2({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new F2({groupFlags:t,rotationThetas:n,params:i})}OA.load=function(e){let t=e.storageType;if(t===ab.Direct)return OA.loadDirect(e);if(t===ab.Indirect)return OA.loadIndirect(e);throw new se(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};OA.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=V5e(r);t.push(s)}let i=Zae(e.covarianceDirectUpperTriangle);return new kI({storageType:ab.Direct,anchorPointsDirect:t,covarianceDirect:i})};OA.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=H5e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=G5e(s);o.push(a)}return new kI({storageType:ab.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var k2=OA;function Qae(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(Qae.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 U2=Qae;function Jae(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Jae.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var z2=Jae;function ece(e){this._ppeTextures=e}Object.defineProperties(ece.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var V2=ece;function Sr(e){e=e??G.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=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Sr.prototype=Object.create(eo.prototype),Sr.prototype.constructor=Sr);Object.defineProperties(Sr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Sr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=yt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=yt.FAILED,this.getError("Failed to load GPM data",e)}};Sr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=this._loadResources(this),this._promise)};function j5e(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}Sr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=j5e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Ri.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};Sr.ppeTexturesMetadataSchemaCache=new Map;Sr._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}}}};Sr._obtainPpeTexturesMetadataSchema=function(e){let n=Sr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Sr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Sr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Sr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=Ff.fromJson(r),Sr.ppeTexturesMetadataSchemaCache.set(n,i),i};Sr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Sr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Sr._convertToStructuralMetadata=function(e,t){let n=[],i=Sr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new hy({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new ga({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Sr.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(o[f]=d.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new z2({min:d.min,max:d.max,source:d.source}),_=new U2({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(_)}}let a=new V2(r);this._meshPrimitiveGpmLocal=a;let c=Sr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=yt.READY,!0};Sr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ri.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Sr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var H2=Sr;var{Attribute:W5e,Indices:q5e,FeatureIdAttribute:tce,FeatureIdTexture:nce,FeatureIdImplicitRange:ice,MorphTarget:Y5e,Primitive:X5e,Instances:K5e,Skin:$5e,Node:Z5e,AnimatedPropertyType:Q5e,AnimationSampler:J5e,AnimationTarget:e6e,AnimationChannel:t6e,Animation:n6e,ArticulationStage:i6e,Articulation:o6e,Asset:r6e,Scene:s6e,Components:a6e,MetallicRoughness:c6e,SpecularGlossiness:l6e,Specular:u6e,Anisotropy:e7,Clearcoat:t7,Material:f6e}=Cn,Lo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Xd(e){e=e??G.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Go.Y,forwardAxis:a=Go.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:d=!1,loadPrimitiveOutline:p=!0,loadForClassification:_=!1,renameBatchIdSemantic:m=!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=u,this._enablePick=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=_,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Lo.NOT_LOADED,this._textureState=Lo.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)&&(Xd.prototype=Object.create(eo.prototype),Xd.prototype.constructor=Xd);Object.defineProperties(Xd.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 d6e(e){e._state=Lo.LOADING,e._textureState=Lo.LOADING;try{let t=Ri.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Lo.LOADED,e._textureState=Lo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Lo.FAILED,e._textureState=Lo.FAILED,G2(e,t)}}async function h6e(e,t){Ft.supportsWebP.initialized||await Ft.supportsWebP.initialize(),e._supportedImageFormats=new M2({webp:Ft.supportsWebP(),basis:t.context.supportsBasis});let n=_9e(e,t);return e._state=Lo.PROCESSING,e._textureState=Lo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ri.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Xd.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=d6e(this),this._promise)};function G2(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function m6e(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)&&Tt("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=Lo.POST_PROCESSING)}function p6e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&_6e(e,o)}}function _6e(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)}Xd.prototype._process=function(e){return this._state===Lo.READY?!0:(this._state===Lo.PROCESSING&&m6e(this,e),this._resourcesLoaded&&this._state===Lo.POST_PROCESSING&&(p6e(this,e.context),this._state=Lo.PROCESSED),this._resourcesLoaded&&this._state===Lo.PROCESSED?(dce(this),this._typedArray=void 0,this._state=Lo.READY,!0):!1)};Xd.prototype._processTextures=function(e){if(this._textureState===Lo.READY)return!0;if(this._textureState!==Lo.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=Lo.READY,this._texturesLoaded=!0,!0):!1};Xd.prototype.process=function(e){if(this._state===Lo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=h6e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Lo.FAILED;let o=this._processError;this._processError=void 0,G2(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===Lo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Lo.FAILED,G2(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Lo.FAILED,G2(this,o)}return this._incrementallyLoadTextures?n:n&&i};function g6e(e,t,n,i,o,r,s,a){let c=e.gltfJson,f=c.accessors[t].bufferView;return Ri.getVertexBufferLoader({gltf:c,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function y6e(e,t,n,i,o,r,s){return Ri.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function x6e(e,t){let n=Ri.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function oce(e,t,n){let i=t.byteOffset,o=Au(e,t),r=t.count,s=Nf(t.type),a=t.componentType,c=K.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),K.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=K.createTypedArray(a,f),p=new DataView(n.buffer),_=new Array(s),m=ty(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){m(p,i,s,c,_);for(let x=0;x<s;++x)d[y*s+x]=_[x];i+=o}return d}function b6e(e,t){let n=e.type;if(n===rn.SCALAR)return t.fill(0);let i=rn.getMathType(n);return t.fill(i.clone(i.ZERO))}function T6e(e,t,n,i){let o=e.type,r=e.count;if(o===rn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===rn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Pe.unpack(t,s*4);else{let s=rn.getMathType(o),a=rn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function C6e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=oce(r,n,t.typedArray);i=i??!1,T6e(n,s,o,i)}function j2(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=x6e(e,o),s=C6e(e,r,t,n,i);return e._loaderPromises.push(s),i}return b6e(t,i)}function wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function A6e(e){return e===Number?0:new e}function E6e(e){switch(e){case K.BYTE:return 127;case K.UNSIGNED_BYTE:return 255;case K.SHORT:return 32767;case K.UNSIGNED_SHORT:return 65535;default:return 1}}var S6e={VEC2:new V(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ie(-1,-1,-1,-1)};function v6e(e,t){let n=E6e(e.componentDatatype),i=S6e[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 w6e(e,t,n){let i=e.decodeMatrix,o=wu(n,e.decodedMin),r=wu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Cn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new V(i[6],i[7]),s.quantizedVolumeStepSize=new V(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ie(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ie(i[0],i[6],i[12],i[18])),t.quantization=s}function I6e(e,t,n,i,o){let r=e.accessors[t],s=rn.getMathType(r.type),a=r.normalized??!1,c=new W5e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=A6e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=wu(s,r.min),c.max=wu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Au(e,r),ci(r,"WEB3D_quantized_attributes")&&w6e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===mt.POSITION||c.semantic===mt.NORMAL||c.semantic===mt.TANGENT||c.semantic===mt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&v6e(c,s),c}function rce(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var P6e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function n7(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=P6e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function D6e(e){let t=e===mt.POSITION,n=e===mt.FEATURE_ID,i=e===mt.TEXCOORD;return t||n||i}function R6e(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=K.createArrayBufferView(o,t.typedArray.buffer)}}function O6e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=oce(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function sce(e,t,n,i,o,r,s,a){let c=e.gltfJson,u=c.accessors[t],f=u.bufferView,d=n.gltfSemantic,p=n.renamedSemantic,_=n.modelSemantic,m=l(_)?rce(p):void 0,x=I6e(c,t,d,_,m);if(!l(o)&&!l(f))return x;let b=g6e(e,t,d,i,o,r,s,a),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let C=b.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[d])?R6e(x,b,r,s):O6e(c,u,x,b,r,s)},x}function ace(e,t,n,i,o,r,s,a){let c=n.modelSemantic,u=c===mt.POSITION,f=c===mt.FEATURE_ID,d=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,_=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,x=m||d||p||_,C=sce(e,t,n,i,o,s?!1:y,s?!0:x,a),A=new RA.AttributeLoadPlan(C);return A.loadBuffer=y,A.loadTypedArray=x,A}function M6e(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=n7(e,ms,i),u=c.modelSemantic,f=u===ms.TRANSLATION||u===ms.ROTATION||u===ms.SCALE,d=u===ms.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,_=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return sce(e,t,c,void 0,void 0,m,p||d&&(!a||y||_),o)}function L6e(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],c=a.bufferView;if(!l(i)&&!l(c))return;let u=new q5e;u.count=a.count;let f=e._loadAttributesAsTypedArray,d=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||d||p,T=y6e(e,t,n,i,r?!1:m,r?!0:y,s),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{u.indexDatatype=T.indexDatatype,u.buffer=T.buffer,u.typedArray=T.typedArray};let S=new RA.IndicesLoadPlan(u);return S.loadBuffer=m,S.loadTypedArray=y,S}function sl(e,t,n,i){let o=e.gltfJson,r=Eu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ri.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Eu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Lo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function N6e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new l6e;return l(i)&&(c.diffuseTexture=sl(e,i,n)),l(o)&&(c.specularGlossinessTexture=sl(e,o,n)),c.diffuseFactor=wu(ie,r),c.specularFactor=wu(h,s),c.glossinessFactor=a,c}function F6e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new c6e;return l(i)&&(c.baseColorTexture=sl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=sl(e,o,n)),c.baseColorFactor=wu(ie,r),c.metallicFactor=s,c.roughnessFactor=a,c}function B6e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new u6e;return l(o)&&(a.specularTexture=sl(e,o,n)),l(s)&&(a.specularColorTexture=sl(e,s,n)),a.specularFactor=i,a.specularColorFactor=wu(h,r),a}function k6e(e,t,n){let{anisotropyStrength:i=e7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=e7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new e7;return l(r)&&(s.anisotropyTexture=sl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function U6e(e,t,n){let{clearcoatFactor:i=t7.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=t7.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new t7;return l(o)&&(c.clearcoatTexture=sl(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=sl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=sl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function z6e(e,t,n){let i=new f6e,o=t.extensions??G.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=N6e(e,r,n):(l(u)&&(i.metallicRoughness=F6e(e,u,n)),l(s)&&!i.unlit&&(i.specular=B6e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=k6e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=U6e(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=sl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=sl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=sl(e,t.occlusionTexture,n)),i.emissiveFactor=wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function cce(e,t){let n=new tce;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 lce(e,t,n,i){let o=new tce,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=rce(r.attribute),o.positionalLabel=i,o}function uce(e,t){let n=new ice;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 fce(e,t,n,i){let o=new ice,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 V6e(e,t,n,i){let o=new nce;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=sl(e,r,n,zt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function H6e(e,t,n,i,o,r){let s=new nce,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=sl(e,c,i,zt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function G6e(e,t,n,i,o){let r=new Y5e,s=void 0,a=void 0,c=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],d=n7(e,mt,u),p=ace(e,f,d,s,a,c,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function j6e(e,t,n,i){let o=new X5e,r=new RA(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=z6e(e,e.gltfJson.materials[s],i));let a=t.extensions??G.EMPTY_OBJECT,c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=W6e(e,u,r));let f=e._loadForClassification,d=a.KHR_draco_mesh_compression,p=!1,_=t.attributes;if(l(_))for(let S in _){if(!_.hasOwnProperty(S))continue;let w=_[S],R=n7(e,mt,S),D=R.modelSemantic;if(f&&!D6e(D))continue;D===mt.FEATURE_ID&&(p=!0);let M=ace(e,w,R,t,d,n,c,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}let m=t.targets;if(l(m)&&!f)for(let S=0;S<m.length;++S)o.morphTargets.push(G6e(e,m[S],c,r,i));let y=t.indices;if(l(y)){let S=L6e(e,y,t,d,p,c,i);l(S)&&(r.indicesPlan=S,o.indices=S.indices)}let x=a.EXT_structural_metadata,b=a.EXT_mesh_features,T=a.EXT_feature_metadata,C=l(T);l(b)?q6e(e,o,b,i):C&&Y6e(e,o,T,i),l(x)?X6e(o,x):C&&K6e(e,o,T);let A=t.mode;if(f&&A!==Le.TRIANGLES)throw new se("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function W6e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return j2(e,i,!1)}function q6e(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=V6e(e,s,i,a):l(s.attribute)?c=cce(s,a):c=uce(s,a),t.featureIds.push(c)}}function Y6e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=lce(u,d,p,_):m=fce(u,d,p,_),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m=H6e(e,u,d,i,p,_);t.featureIds.push(m)}}function X6e(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function K6e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function $6e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new K5e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(M6e(e,f,r,u,n))}let s=i.extensions??G.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?Z6e(o,a):l(c)&&Q6e(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function Z6e(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=cce(o,r):s=uce(o,r),e.featureIds.push(s)}}function Q6e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=lce(a,u,f,d):p=fce(a,u,f,d),t.featureIds.push(p)}}function J6e(e,t,n){let i=new Z5e;i.name=t.name,i.matrix=wu(O,t.matrix),i.translation=wu(h,t.translation),i.rotation=wu(Pe,t.rotation),i.scale=wu(h,t.scale);let o=t.extensions??G.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new se("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=$6e(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(j6e(e,u[p],l(i.instances),n));let f=t.weights??c.weights,d=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(d.length).fill(0)}return i}function e9e(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=J6e(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 t9e(e,t,n){let i=new $5e,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=j2(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(O.IDENTITY);return i}function n9e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=t9e(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 i9e(e,t,n,i){let o=new D2({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 o9e(e,t,n,i){let o=new H2({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 r9e(e,t){let n=new J5e,i=e.gltfJson.accessors,o=i[t.input];n.input=j2(e,o);let r=t.interpolation;n.interpolation=rl[r]??rl.LINEAR;let s=i[t.output];return n.output=j2(e,s,!0),n}function s9e(e,t){let n=new e6e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=Q5e[o],n}function a9e(e,t,n){let i=new t6e,o=e.sampler;return i.sampler=t[o],i.target=s9e(e.target,n),i}function c9e(e,t,n){let i=new n6e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=r9e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return a9e(s,o,n)});return i.samplers=o,i.channels=r,i}function l9e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=c9e(e,o,t);return s.index=r,s})}function u9e(e){let t=new i6e;t.name=e.name;let n=e.type.toUpperCase();return t.type=ol[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function f9e(e){let t=new o6e;return t.name=e.name,t.stages=e.stages.map(u9e),t}function d9e(e){let n=(e.extensions??G.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(f9e):[]}function h9e(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 m9e(e,t){let n=new s6e,i=h9e(e);return n.nodes=i.map(function(o){return t[o]}),n}var p9e=new h;function _9e(e,t){let n=e.gltfJson,i=n.extensions??G.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let T=r.featureTables,C=r.featureTextures,A=l(T)?T:[],S=l(C)?C:[];e._sortedPropertyTableIds=Object.keys(A).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let a=e9e(e,t),c=n9e(e,a),u=l9e(e,a),f=d9e(n),d=m9e(n,a),p=new a6e,_=new r6e,m=n.asset.copyright;if(l(m)){let T=m.split(";").map(function(C){return new _t(C.trim())});_.credits=T}if(p.asset=_,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let T=h.fromArray(s.center,0,p9e);p.transform=O.fromTranslation(T,p.transform)}if(e._components=p,l(o)||l(r)){let T=i9e(e,o,r,t);e._loaderPromises.push(T)}let y=i.NGA_gpm_local;if(l(y)){let T=k2.load(y);e._components.extensions.NGA_gpm_local=T}let x=n.meshes;if(l(x))for(let T of x){let C=T.primitives;if(l(C))for(let A of C){let S=A.extensions;if(l(S)){let w=S.NGA_gpm_local;if(l(w)){let R=o9e(e,n,w,t);e._loaderPromises.push(R)}}}}let b=[];return b.push.apply(b,e._loaderPromises),e._incrementallyLoadTextures||b.push.apply(b,e._texturesPromises),Promise.all(b)}function g9e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._textureLoaders.length=0}function dce(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._bufferViewLoaders.length=0}function y9e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._geometryLoaders.length=0}function x9e(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 b9e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function T9e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Xd.prototype.isUnloaded=function(){return this._state===Lo.UNLOADED};Xd.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ri.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,g9e(this),dce(this),y9e(this),x9e(this),b9e(this),T9e(this),this._components=void 0,this._typedArray=void 0,this._state=Lo.UNLOADED};var Am=Xd;var W2=`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 MA(){this._framebuffer=new bi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(MA.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 C9e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var i7=new V;function A9e(e,t){let n=new Be({defines:["LOG_DEPTH_WRITE"],sources:[W2]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return i7.x=e._radius,i7.y=e._strength,i7}},o=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:jt.setCesium3DTileBit(),stencilMask:jt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Se.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ri({framebuffer:e.framebuffer,color:new H(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Se.CESIUM_3D_TILE,owner:e})}function E9e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),A9e(e,t)}function hce(e){return e.drawBuffers&&e.fragmentDepth}MA.isSupported=hce;function S9e(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=Be.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}MA.prototype.update=function(e,t,n,i){if(!hce(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,E9e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Le.POINTS||u.pass===Se.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=qe.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=S9e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};MA.prototype.isDestroyed=function(){return!1};MA.prototype.destroy=function(){return C9e(this),ce(this)};var py=MA;function mce(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}mce.isSupported=function(e){return py.isSupported(e.context)};var s_=mce;var Va={},v9e=new ie(0,0,0,1),Ac=new ie,w9e=new Xe,o7=new V,r7=new V;Va.worldToWindowCoordinates=function(e,t,n){return Va.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var pce=new ie,_ce=new h;function UI(e,t,n,i){let o=n.viewMatrix,r=O.multiplyByVector(o,ie.fromElements(e.x,e.y,e.z,1,pce),pce),s=h.multiplyComponents(t,h.normalize(r,_ce),_ce);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,O.multiplyByVector(n.frustum.projectionMatrix,r,i)}var I9e=new fe(Math.PI,P.PI_OVER_TWO),P9e=new h,D9e=new h;Va.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Va.computeActualEllipsoidPosition(o,t,v9e);if(!l(r))return;let s=e.canvas,a=w9e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,d=I9e,p=f.project(d,P9e),_=h.clone(c.position,D9e),m=c.frustum.clone(),y=O.computeViewportTransformation(a,0,1,new O),x=c.frustum.projectionMatrix,b=c.positionWC.y,T=h.fromElements(P.sign(b)*p.x-b,0,-c.positionWC.x),C=Et.pointToGLWindowCoordinates(x,y,T);if(b===0||C.x<=0||C.x>=s.clientWidth)u=!0;else{if(C.x>s.clientWidth*.5){a.width=C.x,c.frustum.right=p.x-b,Ac=UI(r,n,c,Ac),Va.clipToGLWindowCoordinates(a,Ac,o7),a.x+=C.x,c.position.x=-c.position.x;let A=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-A,Ac=UI(r,n,c,Ac),Va.clipToGLWindowCoordinates(a,Ac,r7)}else{a.x+=C.x,a.width-=C.x,c.frustum.left=-p.x-b,Ac=UI(r,n,c,Ac),Va.clipToGLWindowCoordinates(a,Ac,o7),a.x=a.x-a.width,c.position.x=-c.position.x;let A=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-A,Ac=UI(r,n,c,Ac),Va.clipToGLWindowCoordinates(a,Ac,r7)}h.clone(_,c.position),c.frustum=m.clone(),i=V.clone(o7,i),(i.x<0||i.x>s.clientWidth)&&(i.x=r7.x)}}if(o.mode!==ne.SCENE2D||u){if(Ac=UI(r,n,c,Ac),Ac.z<0&&!(c.frustum instanceof ln)&&!(c.frustum instanceof Qr))return;i=Va.clipToGLWindowCoordinates(a,Ac,i)}return i.y=s.clientHeight-i.y,i};Va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Va.worldToWindowCoordinates(e,t,n),!!l(n))return Va.transformWindowToDrawingBuffer(e,n,n)};var a_=new h,R9e=new fe;Va.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,R9e);if(!l(r))return;if(o.project(r,a_),i===ne.COLUMBUS_VIEW)return h.fromElements(a_.z,a_.x,a_.y,n);if(i===ne.SCENE2D)return h.fromElements(0,a_.x,a_.y,n);let s=e.morphTime;return h.fromElements(P.lerp(a_.z,t.x,s),P.lerp(a_.x,t.y,s),P.lerp(a_.y,t.z,s),n)};var gce=new h,yce=new h,xce=new O;Va.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,gce),O.computeViewportTransformation(e,0,1,xce),O.multiplyByPoint(xce,gce,yce),V.fromCartesian3(yce,n)};Va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return V.fromElements(t.x*o,t.y*r,n)};var O9e=new ie,bce=new ie;Va.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 _=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,_)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=ie.clone(ie.UNIT_W,O9e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=O.multiplyByVector(r.inverseViewProjection,f,bce);let _=1/d.w;h.multiplyByScalar(d,_,d)}else{let _=p.offCenterFrustum;l(_)&&(p=_),d=bce,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=O.multiplyByVector(r.inverseView,d,d)}return h.fromCartesian4(d,i)};var qi=Va;var LA={};LA._deprecationWarning=Mo;var c_=Uint32Array.BYTES_PER_ELEMENT;LA.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=c_;let r=o.getUint32(t,!0);if(r!==1)throw new se(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=c_;let s=o.getUint32(t,!0);t+=c_;let a=o.getUint32(t,!0);t+=c_;let c=o.getUint32(t,!0);t+=c_;let u=o.getUint32(t,!0);t+=c_;let f=o.getUint32(t,!0);t+=c_;let d;u>=570425344?(t-=c_*2,d=a,u=c,f=0,a=0,c=0,LA._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=c_,d=u,u=a,f=c,a=0,c=0,LA._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:d??0}:(p=jo(i,t,a),t+=a);let _=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=jo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let x=n+s-t;if(x===0)throw new se("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,x):(LA._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+x))),{batchLength:d,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:y,gltf:b}};var q2=LA;function zI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Tce(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=K.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function M9e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=K.createTypedArray(n,i),o[t]=r),r}zI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??K.UNSIGNED_INT,n=n??1,Tce(this,e,t,n,1,i.byteOffset)):i};zI.prototype.hasProperty=function(e){return l(this.json[e])};zI.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=K.fromName(i.componentType)),Tce(this,e,t,n,this.featuresLength,i.byteOffset)):M9e(this,e,t,i)};zI.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 Em=zI;function VI(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=L9e(n),a;l(s.jsonProperties)&&(a=new dy({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new uA({extension:s.hierarchy,binaryBody:i}));let u=xm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,_;if(o){let x=F9e(t,u,f,i,r);_=x.transcodedSchema,p=[new IA({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=N9e(t,u,f,i);_=x.transcodedSchema;let b=x.featureTableJson;d=new jd({count:b.count,properties:b.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let x=new ql({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(x)}let y={schema:_,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new ga(y)}function L9e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(VI._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 N9e(e,t,n,i){let o={},r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new se(`Property ${d} requires a batch table binary.`);let p=n[d],_=Mf(p);r[d]={bufferView:a},o[d]=Cce(p),s[a]=_.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=Ff.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function F9e(e,t,n,i,o){let r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new se(`Property ${d} requires a batch table binary.`);let _=Jt.sanitizeGlslIdentifier(d);(_===""||r.hasOwnProperty(_))&&(_=`property_${a}`,a++);let m=Cce(p);m.name=d,r[_]=m;let y=_.toUpperCase();y.startsWith("_")||(y=`_${y}`);let x=p.typedArray;l(x)||(x=Mf(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Cn.Attribute;b.name=y,b.count=e,b.type=p.type;let T=K.fromTypedArray(x);(T===K.INT||T===K.UNSIGNED_INT||T===K.DOUBLE)&&(VI._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)),b.componentDatatype=K.fromTypedArray(x),b.typedArray=x,o.push(b),s[_]={attribute:y}}let c={classes:{}};c.classes[t]={properties:r};let u=Ff.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Cce(e){let t=B9e(e.componentType);return{type:e.type,componentType:t}}function B9e(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"}}VI._deprecationWarning=Mo;VI._oneTimeWarning=Tt;var _y=VI;var cb={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},k9e=Cn.FeatureIdAttribute;function gy(e){e=e??G.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??Go.Y,u=e.forwardAxis??Go.X,f=e.loadAttributesAsTypedArray??!1,d=e.loadAttributesFor2D??!1,p=e.enablePick??!1,_=e.loadIndicesForWireframe??!1,m=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=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._enablePick=p,this._loadIndicesForWireframe=_,this._loadPrimitiveOutline=m,this._loadForClassification=y,this._state=cb.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=O.IDENTITY}l(Object.create)&&(gy.prototype=Object.create(eo.prototype),gy.prototype.constructor=gy);Object.defineProperties(gy.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});gy.prototype.load=function(){if(l(this._promise))return this._promise;let e=q2.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Em(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(a)&&(this._transform=O.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new Am({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=cb.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=cb.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return U9e(u,f)}),this._promise};function U9e(e,t){return e.unload(),e._state=cb.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}gy.prototype.process=function(e){if(this._state===cb.READY)return!0;if(this._state!==cb.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=O.multiplyTransformation(this._transform,n.transform,n.transform),z9e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=cb.READY,!0};function z9e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=_y({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new ql({name:xm.BATCH_TABLE_CLASS_NAME,count:i});o=new ga({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Ace(r[a]);t.structuralMetadata=o}function Ace(e){let t=e.children.length;for(let i=0;i<t;i++)Ace(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Jt.getAttributeBySemantic(o,mt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new k9e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}gy.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var Y2=gy;function yy(e){e=e??G.EMPTY_OBJECT,this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(yy.prototype=Object.create(eo.prototype),yy.prototype.constructor=yy);Object.defineProperties(yy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});yy.prototype.load=function(){return Promise.resolve(this)};yy.prototype.process=function(e){return l(this._components)||(this._components=J9e(this._geoJson,e),this._geoJson=void 0),!0};function V9e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function H9e(){this.features=[]}function s7(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function a7(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=s7(e[o]);return[n]}function G9e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=a7(e[i])[0];return n}function Ece(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=a7(e[i])[0];return n}function j9e(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Ece(e[i]));return n}function W9e(e){return[s7(e)]}function q9e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=s7(e[i]);return n}var Y9e={LineString:a7,MultiLineString:G9e,MultiPolygon:j9e,Polygon:Ece,MultiPoint:q9e,Point:W9e},X9e={LineString:Le.LINES,MultiLineString:Le.LINES,MultiPolygon:Le.LINES,Polygon:Le.LINES,MultiPoint:Le.POINTS,Point:Le.POINTS};function Sce(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Y9e[n],o=X9e[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new V9e;o===Le.LINES?s.lines=i(r):o===Le.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function K9e(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Sce(n[o],t)}var $9e={FeatureCollection:K9e,Feature:Sce},X2=new h;function Z9e(e,t,n){let i=0,o=0,r=e.length;for(let M=0;M<r;M++){let L=e[M];if(l(L.lines)){let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E];i+=v.length,o+=(v.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=ke.createTypedArray(i,o),u=ke.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,_=0;for(let M=0;M<r;M++){let L=e[M];if(!l(L.lines))continue;let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E],I=v.length;for(let N=0;N<I;N++){let F=v[N],U=h.fromDegrees(F.x,F.y,F.z,te.WGS84,X2),k=O.multiplyByPoint(t,U,X2);h.minimumByComponent(f,k,f),h.maximumByComponent(d,k,d),h.pack(k,s,p*3),a[p]=M,N<I-1&&(c[_*2]=p,c[_*2+1]=p+1,_++),p++}}}let m=st.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=st.createVertexBuffer({typedArray:a,context:n.context,usage:Ne.STATIC_DRAW});y.vertexArrayDestroyable=!1;let x=st.createIndexBuffer({typedArray:c,context:n.context,usage:Ne.STATIC_DRAW,indexDatatype:u});x.vertexArrayDestroyable=!1;let b=new Cn.Attribute;b.semantic=mt.POSITION,b.componentDatatype=K.FLOAT,b.type=rn.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let T=new Cn.Attribute;T.semantic=mt.FEATURE_ID,T.setIndex=0,T.componentDatatype=K.FLOAT,T.type=rn.SCALAR,T.count=i,T.buffer=y;let C=[b,T],A=new Cn.Material;A.unlit=!0;let S=new Cn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=x;let w=new Cn.FeatureIdAttribute;w.featureCount=r,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let R=[w],D=new Cn.Primitive;return D.attributes=C,D.indices=S,D.featureIds=R,D.primitiveType=Le.LINES,D.material=A,D}function Q9e(e,t,n){let i=0,o=e.length;for(let C=0;C<o;C++){let A=e[C];l(A.points)&&(i+=A.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let C=0;C<o;C++){let A=e[C];if(!l(A.points))continue;let S=A.points.length;for(let w=0;w<S;w++){let R=A.points[w],D=h.fromDegrees(R.x,R.y,R.z,te.WGS84,X2),M=O.multiplyByPoint(t,D,X2);h.minimumByComponent(a,M,a),h.maximumByComponent(c,M,c),h.pack(M,r,u*3),s[u]=C,u++}}let f=st.createVertexBuffer({typedArray:r,context:n.context,usage:Ne.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=st.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=mt.POSITION,p.componentDatatype=K.FLOAT,p.type=rn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let _=new Cn.Attribute;_.semantic=mt.FEATURE_ID,_.setIndex=0,_.componentDatatype=K.FLOAT,_.type=rn.SCALAR,_.count=i,_.buffer=d;let m=[p,_],y=new Cn.Material;y.unlit=!0;let x=new Cn.FeatureIdAttribute;x.featureCount=o,x.propertyTableId=0,x.setIndex=0,x.positionalLabel="featureId_0";let b=[x],T=new Cn.Primitive;return T.attributes=m,T.featureIds=b,T.primitiveType=Le.POINTS,T.material=y,T}function J9e(e,t){let n=new H9e,i=$9e[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new se("GeoJSON must have at least one feature");let s={};for(let M=0;M<r;M++){let g=o[M].properties??G.EMPTY_OBJECT;for(let E in g)g.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(r)))}for(let M=0;M<r;M++){let L=o[M];for(let g in s)if(s.hasOwnProperty(g)){let E=L.properties[g]??"";s[g][M]=E}}let a=new dy({count:r,properties:s}),u=[new ql({id:0,count:r,jsonMetadataTable:a})],f=Ff.fromJson({}),d=new ga({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),_=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let M=0;M<r;M++){let L=o[M];if(l(L.lines)){m=!0;let g=L.lines.length;for(let E=0;E<g;E++){let v=L.lines[E],I=v.length;for(let N=0;N<I;N++)h.minimumByComponent(p,v[N],p),h.maximumByComponent(_,v[N],_)}}if(l(L.points)){y=!0;let g=L.points.length;for(let E=0;E<g;E++){let v=L.points[E];h.minimumByComponent(p,v,p),h.maximumByComponent(_,v,_)}}}let x=h.midpoint(p,_,new h),b=h.fromDegrees(x.x,x.y,x.z,te.WGS84,new h),T=Et.eastNorthUpToFixedFrame(b,te.WGS84,new O),C=O.inverseTransformation(T,new O),A=[];m&&A.push(Z9e(o,C,t)),y&&A.push(Q9e(o,C,t));let S=new Cn.Node;S.index=0,S.primitives=A;let w=[S],R=new Cn.Scene;R.nodes=w;let D=new Cn.Components;return D.scene=R,D.nodes=w,D.transform=T,D.structuralMetadata=d,D}yy.prototype.unload=function(){this._components=void 0};var K2=yy;var $2={};$2._deprecationWarning=Mo;var xy=Uint32Array.BYTES_PER_ELEMENT;$2.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=xy;let r=o.getUint32(t,!0);if(r!==1)throw new se(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=xy;let s=o.getUint32(t,!0);t+=xy;let a=o.getUint32(t,!0);if(a===0)throw new se("featureTableJsonByteLength is zero, the feature table must be defined.");t+=xy;let c=o.getUint32(t,!0);t+=xy;let u=o.getUint32(t,!0);t+=xy;let f=o.getUint32(t,!0);t+=xy;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new se(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=xy;let p=jo(i,t,a);t+=a;let _=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=jo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let x=n+s-t;if(x===0)throw new se("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,x):($2._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:d,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:y,gltf:b}};var Z2=$2;var l_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Q2=Cn.Attribute,eje=Cn.FeatureIdAttribute,wce=Cn.Instances;function u_(e){e=e??G.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??Go.Y,u=e.forwardAxis??Go.X,f=e.loadAttributesAsTypedArray??!1,d=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,_=e.enablePick??!1;i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._enablePick=_,this._state=l_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=O.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(u_.prototype=Object.create(eo.prototype),u_.prototype.constructor=u_);Object.defineProperties(u_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});u_.prototype.load=function(){if(l(this._promise))return this._promise;let e=Z2.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Em(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new se("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(c)&&(this._transform=O.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=ha(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new Am(u);return this._gltfLoader=f,this._state=l_.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=l_.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw tje(this,d)}),this._promise};function tje(e,t){return e.unload(),e._state=l_.FAILED,e.getError("Failed to load i3dm",t)}u_.prototype.process=function(e){if(this._state===l_.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===l_.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=O.multiplyTransformation(this._transform,i.transform,i.transform),oje(this,i,e),nje(this,i),this._components=i,this._arrayBuffer=void 0,this._state=l_.READY,!0};function nje(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=_y({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new ql({name:xm.BATCH_TABLE_CLASS_NAME,count:i});o=new ga({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var J2=new h,c7=new Array(4),ije=new O;function oje(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",K.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=sje(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let _=new Float32Array(r),m=h.unpackArray(f),y=new h,x=new h,b=new h,T=new h,C=new Z,A=new Pe,S=new Array(4),w=new h,R=new Array(3),D=new O;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let k=re.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],k.center,J2),f[3*i+0]=J2.x,f[3*i+1]=J2.y,f[3*i+2]=J2.z;let z=O.fromTranslation(k.center,ije);t.transform=O.multiplyTransformation(z,t.transform,t.transform)}for(i=0;i<r;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(aje(o,a,i,A,y,b,x,T,C,D),Pe.pack(A,S,0),d[4*i+0]=S[0],d[4*i+1]=S[1],d[4*i+2]=S[2],d[4*i+3]=S[3]),u&&(cje(o,i,w),h.pack(w,R,0),p[3*i+0]=R[0],p[3*i+1]=R[1],p[3*i+2]=R[2]);let k=o.getProperty("BATCH_ID",K.UNSIGNED_SHORT,1,i);l(k)||(k=i),_[i]=k}let M=new wce;M.transformInWorldSpace=!0;let L=e._buffers,g=new Q2;if(g.name="Instance Translation",g.semantic=ms.TRANSLATION,g.componentDatatype=K.FLOAT,g.type=rn.VEC3,g.count=r,g.typedArray=f,!c){let k=st.createVertexBuffer({context:n.context,typedArray:f,usage:Ne.STATIC_DRAW});k.vertexArrayDestroyable=!1,L.push(k),g.buffer=k}if(M.attributes.push(g),c){let k=new Q2;k.name="Instance Rotation",k.semantic=ms.ROTATION,k.componentDatatype=K.FLOAT,k.type=rn.VEC4,k.count=r,k.typedArray=d,M.attributes.push(k)}if(u){let k=new Q2;if(k.name="Instance Scale",k.semantic=ms.SCALE,k.componentDatatype=K.FLOAT,k.type=rn.VEC3,k.count=r,c)k.typedArray=p;else{let z=st.createVertexBuffer({context:n.context,typedArray:p,usage:Ne.STATIC_DRAW});z.vertexArrayDestroyable=!1,L.push(z),k.buffer=z}M.attributes.push(k)}let E=new Q2;E.name="Instance Feature ID",E.setIndex=0,E.semantic=ms.FEATURE_ID,E.componentDatatype=K.FLOAT,E.type=rn.SCALAR,E.count=r;let v=st.createVertexBuffer({context:n.context,typedArray:_,usage:Ne.STATIC_DRAW});v.vertexArrayDestroyable=!1,L.push(v),E.buffer=v,M.attributes.push(E);let I=new eje;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",M.featureIds.push(I);let N=t.nodes,F=N.length,U=!1;for(i=0;i<F;i++){let k=N[i];k.primitives.length>0&&(k.instances=U?rje(M):M,U=!0)}}function rje(e){let t=new wce;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Fe(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function sje(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",K.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(i))throw new se("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(o))throw new se("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 se("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var vce=new Array(4);function aje(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",K.FLOAT,3,n,c7),d=e.getProperty("NORMAL_RIGHT",K.FLOAT,3,n,vce),p=!1;if(l(f)){if(!l(d))throw new se("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,r),h.unpack(d,0,s),p=!0}else{let _=e.getProperty("NORMAL_UP_OCT32P",K.UNSIGNED_SHORT,2,n,c7),m=e.getProperty("NORMAL_RIGHT_OCT32P",K.UNSIGNED_SHORT,2,n,vce);if(l(_)){if(!l(m))throw new se("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Mn.octDecodeInRange(_[0],_[1],65535,r),Mn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Et.eastNorthUpToFixedFrame(o,te.WGS84,u),O.getMatrix3(u,c)):Z.clone(Z.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),Z.setColumn(c,0,s,c),Z.setColumn(c,1,r,c),Z.setColumn(c,2,a,c)),Pe.fromRotationMatrix(c,i)}function cje(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",K.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",K.FLOAT,3,t,c7);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function lje(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}u_.prototype.isUnloaded=function(){return this._state===l_.UNLOADED};u_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),lje(this),this._components=void 0,this._arrayBuffer=void 0,this._state=l_.UNLOADED};var eB=u_;var uje={STOPPED:0,ANIMATING:1},Sm=Object.freeze(uje);function NA(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}NA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Pe)return Pe};NA.prototype.evaluate=he.throwInstantiationError;NA.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};NA.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};NA.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var to=NA;function FA(e){this._value=e,this._valueType=to.getPointType(e)}Object.defineProperties(FA.prototype,{value:{get:function(){return this._value}}});FA.prototype.findTimeInterval=function(e){};FA.prototype.wrapTime=function(e){return 0};FA.prototype.clampTime=function(e){return 0};FA.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var by=FA;function BA(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(BA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});BA.prototype.findTimeInterval=to.prototype.findTimeInterval;BA.prototype.wrapTime=to.prototype.wrapTime;BA.prototype.clampTime=to.prototype.clampTime;BA.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 h),h.lerp(n[o],n[o+1],r,t))};var Kd=BA;var Ice={};Ice.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 h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.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]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var HI=Ice;var Pce=[],Dce=[],Rce=[],Oce=[];function fje(e,t,n){let i=Pce,o=Rce,r=Dce,s=Oce;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 h),h.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 h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),HI.solve(i,r,o,s)}function dje(e){let t=Pce,n=Rce,i=Dce,o=Oce;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 h),h.subtract(e[1],e[0],s),h.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 h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),HI.solve(t,i,n,o)}function Yl(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Yl.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}}});Yl.createC1=function(e){e=e??G.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 Yl({times:t,points:n,inTangents:r,outTangents:o})};Yl.createNaturalCubic=function(e){e=e??G.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new Kd({points:n,times:t});let i=dje(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Yl({times:t,points:n,inTangents:r,outTangents:o})};Yl.createClampedCubic=function(e){e=e??G.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=to.getPointType(n[0]);if(n.length<3)return new Kd({points:n,times:t});let s=fje(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Yl({times:t,points:n,inTangents:c,outTangents:a})};Yl.hermiteCoefficientMatrix=new O(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Yl.prototype.findTimeInterval=to.prototype.findTimeInterval;var hje=new ie,kA=new h;Yl.prototype.wrapTime=to.prototype.wrapTime;Yl.prototype.clampTime=to.prototype.clampTime;Yl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=hje;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=O.multiplyByVector(Yl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,kA),d.add(t,kA,t),d.multiplyByScalar(r[s],f.z,kA),d.add(t,kA,t),d.multiplyByScalar(o[s],f.w,kA),d.add(t,kA,t))};var f_=Yl;function UA(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(UA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});UA.prototype.findTimeInterval=to.prototype.findTimeInterval;UA.prototype.wrapTime=to.prototype.wrapTime;UA.prototype.clampTime=to.prototype.clampTime;UA.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 zA=UA;function mje(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Pe);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 Pe.fastSlerp(a,c,s,o)}}function VA(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=mje(this),this._lastTimeIndex=0}Object.defineProperties(VA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});VA.prototype.findTimeInterval=to.prototype.findTimeInterval;VA.prototype.wrapTime=to.prototype.wrapTime;VA.prototype.clampTime=to.prototype.clampTime;VA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Ty=VA;var HA=Cn.AnimatedPropertyType;function l7(e){e=e??G.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,xje(this)}Object.defineProperties(l7.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 pje(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 f_({times:e,points:n,inTangents:i,outTangents:o})}function Mce(e,t,n,i){if(e.length===1&&t.length===1)return new by(t[0]);switch(n){case rl.STEP:return new zA({times:e,points:t});case rl.CUBICSPLINE:return pje(e,t);case rl.LINEAR:return i===HA.ROTATION?new Ty({times:e,points:t}):new Kd({times:e,points:t})}}function _je(e,t,n,i,o){let r=[];if(i===HA.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===rl.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(Mce(e,f,n,i))}}else r.push(Mce(e,t,n,i));return r}var gje=new h,yje=new Pe;function xje(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=_je(i,o,r,a,u);e._splines=f,e._path=a}l7.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===HA.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===HA.TRANSLATION||n===HA.SCALE?o[n]=r.evaluate(s,gje):n===HA.ROTATION&&(o[n]=r.evaluate(s,yje))}}};var tB=l7;function u7(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=$.clone(n.startTime),this._delay=n.delay??0,this._stopTime=$.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??vu.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=Sm.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,bje(this)}Object.defineProperties(u7.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 bje(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],_=new tB({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}u7.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var nB=u7;function d_(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(d_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function f7(e,t,n){let i=e._model,o=new nB(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}d_.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return f7(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 f7(this,n[i],e)};d_.prototype.addAll=function(e){e=e??G.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=f7(this,n[r],e);i.push(s)}return i};d_.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};d_.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])};d_.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};d_.prototype.get=function(e){return this._runtimeAnimations[e]};var iB=[];function Tje(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}d_.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&$.equals(e.time,this._previousTime))return!1;this._previousTime=$.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=$.addSeconds(a.startTime??o,a.delay,new $)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=$.lessThanOrEquals(c,o),p=l(f)&&$.greaterThan(o,f),_=0;if(u!==0){let x=$.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,x):x/u}let m=a.loop===vu.REPEAT||a.loop===vu.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let x=a._state===Sm.STOPPED;if(y!==x)continue}if(a._prevAnimationDelta=_,y||a._state===Sm.ANIMATING){if(y&&a._state===Sm.STOPPED&&(a._state=Sm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===vu.REPEAT)_=_-Math.floor(_);else if(a.loop===vu.MIRRORED_REPEAT){let b=Math.floor(_),T=_-b;_=b%2===1?1-T:T}a.reverse&&(_=1-_);let x=_*u*a.multiplier;x=P.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=Sm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&iB.push(a))}}n=iB.length;for(let s=0;s<n;++s){let a=iB[s];t.splice(t.indexOf(a),1),e.afterRender.push(Tje(this,r,a))}return iB.length=0,i};var oB=d_;function lb(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(lb.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 H),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}}});lb.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};lb.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};lb.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};lb.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};lb.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var rB=lb;var GI={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};GI.getStyleCommandsNeeded=function(e,t){return t===0?GI.ALL_OPAQUE:t===e?GI.ALL_TRANSLUCENT:GI.OPAQUE_AND_TRANSLUCENT};var vm=Object.freeze(GI);var Cy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Cy.is3DTiles=function(e){switch(e){case Cy.TILE_GLTF:case Cy.TILE_B3DM:case Cy.TILE_I3DM:case Cy.TILE_PNTS:case Cy.TILE_GEOJSON:return!0;case Cy.GLTF:return!1}};var vr=Object.freeze(Cy);function Hr(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=vm.ALL_OPAQUE,Cje(this)}Object.defineProperties(Hr.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 Cje(e){let t=e._model,n=vr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new ma(s,o)}else for(o=0;o<i;o++)r[o]=new rB({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Gl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Hr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=vm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Hr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Hr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Hr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Hr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Hr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Hr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Hr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Hr.prototype.getFeature=function(e){return this._features[e]};Hr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Hr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Hr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Hr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Hr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Hr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Hr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Hr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Hr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Aje=new H;Hr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Gl.DEFAULT_COLOR_VALUE),this.setAllShow(Gl.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,Aje)??Gl.DEFAULT_COLOR_VALUE:Gl.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??Gl.DEFAULT_SHOW_VALUE:Gl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ce(this)};var sB=Hr;var Lce={name:"TilesetPipelineStage"};Lce.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,pe.FRAGMENT);let r={u_polygonOffset:function(){return V.ZERO}};e.uniformMap=ct(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=jt.setCesium3DTileBit(),i.stencilMask=jt.CESIUM_3D_TILE_MASK};var aB=Lce;var cB=`// 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 lB=`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 Nce={name:"AtmospherePipelineStage"};Nce.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,pe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([lB]),i.addFragmentLines([cB]),i.addUniform("bool","u_isInFog",pe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(o,n.fog.density)>P.EPSILON3}};var uB=Nce;var fB=`#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 Fce={name:"ImageBasedLightingPipelineStage"},Eje=new V;Fce.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,pe.FRAGMENT),r.addUniform("vec2","model_iblFactor",pe.FRAGMENT),hm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",pe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,pe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",pe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,pe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",pe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",pe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT)),r.addFragmentLines(fB);let c={model_iblFactor:function(){return V.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,Eje)},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=ct(c,e.uniformMap)};var dB=Fce;var Sje=P.EPSILON16;function h7(e){e=e??G.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(h7.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=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,Sje)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var vje=new h,d7=new Z;h7.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=vje,o;switch(t){case ol.XROTATE:o=Z.fromRotationX(P.toRadians(n),d7),e=O.multiplyByMatrix3(e,o,e);break;case ol.YROTATE:o=Z.fromRotationY(P.toRadians(n),d7),e=O.multiplyByMatrix3(e,o,e);break;case ol.ZROTATE:o=Z.fromRotationZ(P.toRadians(n),d7),e=O.multiplyByMatrix3(e,o,e);break;case ol.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=O.multiplyByTranslation(e,i,e);break;case ol.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=O.multiplyByTranslation(e,i,e);break;case ol.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=O.multiplyByTranslation(e,i,e);break;case ol.XSCALE:i.x=n,i.y=1,i.z=1,e=O.multiplyByScale(e,i,e);break;case ol.YSCALE:i.x=1,i.y=n,i.z=1,e=O.multiplyByScale(e,i,e);break;case ol.ZSCALE:i.x=1,i.y=1,i.z=n,e=O.multiplyByScale(e,i,e);break;case ol.UNIFORMSCALE:e=O.multiplyByUniformScale(e,n,e);break;default:break}return e};var hB=h7;function mB(e){e=e??G.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,wje(this)}Object.defineProperties(mB.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 wje(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 hB({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}mB.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Ije=new O,Pje=new O;mB.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=O.clone(O.IDENTITY,Ije),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=O.multiplyTransformation(s.originalTransform,e,Pje);s.transform=a}};var pB=mB;var _B=`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 GA={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};GA.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,pe.FRAGMENT),i.addFragmentLines(_B);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=Se.TRANSLUCENT),i.addUniform("vec4",GA.COLOR_UNIFORM_NAME,pe.FRAGMENT),o[GA.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",GA.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),o[GA.COLOR_BLEND_UNIFORM_NAME]=function(){return il.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=ct(o,e.uniformMap)};var ub=GA;var gB=`#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 Bce={name:"ModelClippingPlanesPipelineStage"},Dje=new V;Bce.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,pe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,pe.FRAGMENT),Os.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,pe.FRAGMENT);let s=Os.getTextureResolution(i,o,Dje);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,pe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",pe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",pe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",pe.FRAGMENT),r.addFragmentLines(gB);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=H.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=ct(a,e.uniformMap)};var yB=Bce;var xB=`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 bB=`void modelClippingPolygonsStage() -{ - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var kce={name:"ModelClippingPolygonsPipelineStage"};kce.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,pe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,pe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,pe.BOTH),o.addUniform("sampler2D","model_clippingDistance",pe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",pe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(xB),o.addFragmentLines(bB);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=ct(r,e.uniformMap)};var TB=kce;function Uce(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Uce.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 CB=Uce;var AB=`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 EB=`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 SB=`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 vB=new O,Rje=new O,Oje=new O,Vce={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:qce,_transformsToTypedArray:p7};Vce.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(AB);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];Yje(e,n,i,d,u,f),$je(e,n,i,d);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",pe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",pe.VERTEX),p.u_instance_modifiedModelView=function(){let _=O.multiplyTransformation(s.modelMatrix,a.components.transform,vB);return u?O.multiplyTransformation(n.context.uniformState.view3D,_,vB):(n.mode!==ne.SCENE3D&&(_=Et.basisTo2D(n.mapProjection,_,vB)),O.multiplyTransformation(n.context.uniformState.view,_,vB))},p.u_instance_nodeTransform=function(){return O.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Rje)},r.addVertexLines(SB)):r.addVertexLines(EB),u){r.addDefine("USE_2D_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_modelView2D",pe.VERTEX);let _=n.context,m=O.fromTranslation(c.instancingReferencePoint2D,new O);p.u_modelView2D=function(){return O.multiplyTransformation(_.uniformState.view,m,Oje)}}e.uniformMap=ct(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,d)};var jI=new O,Mje=new h;function Lje(e,t,n,i,o){let r=O.multiplyTransformation(t,e,jI);return r=O.multiplyTransformation(r,n,jI),o=Et.basisTo2D(i.mapProjection,r,o),o}function Nje(e,t,n,i,o){let r=O.fromTranslation(e,jI),s=O.multiplyTransformation(t,r,jI);s=O.multiplyTransformation(s,n,jI);let a=O.getTranslation(s,Mje);return o=qi.computeActualEllipsoidPosition(i,a,o),o}function Hce(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=O.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=O.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=O.clone(o.computedModelMatrix,t),t=O.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=O.clone(O.IDENTITY,n))}var Gce=new O,jce=new O,Fje=new O,Bje=new h;function kje(e,t,n,i){let o=Gce,r=jce;Hce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Lje(f,o,r,n,Fje),p=O.getTranslation(d,Bje),_=h.subtract(p,a,p);i[u]=O.setTranslation(d,_,i[u])}return i}function Uje(e,t,n,i){let o=Gce,r=jce;Hce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Nje(f,o,r,n,f);i[u]=h.subtract(d,a,i[u])}return i}var zje=new h,Vje=new h;function Wce(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=O.multiplyByPoint(i,n.instancingTranslationMin,zje),r=qi.computeActualEllipsoidPosition(t,o,o),s=O.multiplyByPoint(i,n.instancingTranslationMax,Vje),a=qi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function p7(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 Hje(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 Gje=new h,jje=new Pe,Wje=new h;function qce(e,t,n){let i=new Array(t),o=Jt.getAttributeBySemantic(e,ms.TRANSLATION),r=Jt.getAttributeBySemantic(e,ms.ROTATION),s=Jt.getAttributeBySemantic(e,ms.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(s),p=u?o.typedArray:new Float32Array(t*3),_=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(_=Mn.dequantize(_,r.componentDatatype,r.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let x=0;x<t;x++){let b=new h(p[x*3],p[x*3+1],p[x*3+2],Gje);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let T=new Pe(_[x*4],_[x*4+1],_[x*4+2],f?_[x*4+3]:1,jje),C=new h(m[x*3],m[x*3+1],m[x*3+2],Wje),A=O.fromTranslationQuaternionRotationScale(b,T,C,new O);i[x]=A}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(s.typedArray=void 0),i}function qje(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,h.minimumByComponent(r,u,r),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function _7(e,t){let n=st.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Yje(e,t,n,i,o,r){let s=Jt.getAttributeBySemantic(n,ms.ROTATION);l(s)?Xje(e,n,i,t,o,r):Kje(e,n,i,t,o)}function Xje(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=qce(t,a,e);let x=p7(d);p=_7(x,i),c._modelResources.push(p),r&&(u.transformsTypedArray=x),u.instancingTransformsBuffer=p}if(zce(e,p,n,f),!o)return;let _=Fe(i);_.mode=ne.COLUMBUS_VIEW,Wce(e,_);let m=u.instancingTransformsBuffer2D;if(!l(m)){let x=kje(d,e,_,d),b=p7(x);m=_7(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}zce(e,m,n,"Transform2D")}function Kje(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Jt.getAttributeBySemantic(t,ms.TRANSLATION),u=Jt.getAttributeBySemantic(t,ms.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),m7(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=qje(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),m7(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let _=Fe(i);_.mode=ne.COLUMBUS_VIEW,Wce(e,_);let m=a.instancingTranslationBuffer2D;if(!l(m)){let T=Uje(f,e,_,f),C=Hje(T);r&&(a.transformsTypedArray=C),m=_7(C,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;m7(e,m,0,void 0,n,"Translation2D")}function zce(e,t,n,i){let r=K.getSizeInBytes(K.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:K.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 m7(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function $je(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===ms.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:rn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var wB=Vce;var g7={};g7.name="ModelMatrixUpdateStage";g7.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Yce(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Zje(e,t,n){e.modelMatrix=O.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Jt.getCullFace(e.modelMatrix,e.primitiveType)}function Yce(e,t,n,i){let o;i=O.multiplyTransformation(i,e.transform,new O),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];Zje(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=O.clone(i,a._transformToRoot),Yce(a,t,n,i),a._transformDirty=!1}}var IB=g7;var Xce={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Kce,_countGeneratedBuffers:$ce};Xce.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Kce(i,o),$ce(i,r)};function Kce(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 $ce(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 PB=Xce;function jA(e){e=e??G.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=O.clone(n,this._originalTransform),this._transform=O.clone(n,this._transform),this._transformToRoot=O.clone(i,this._transformToRoot),this._computedTransform=new O,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,Qje(this)}Object.defineProperties(jA.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=O.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;h.equals(n,e)||(t.translation=h.clone(e,t.translation),y7(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Pe.equals(n,e)||(t.rotation=Pe.clone(e,t.rotation),y7(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),y7(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 Qje(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=O.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new jx(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 y7(e,t){e._transformDirty=!0,e._transform=O.fromTranslationRotationScale(t,e._transform)}jA.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};jA.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(wB),t.push(PB),n.push(IB)};jA.prototype.updateComputedTransform=function(){this._computedTransform=O.multiply(this._transformToRoot,this._transform,this._computedTransform)};jA.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 O);let r=O.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=O.inverseTransformation(r,t[o]);t[o]=O.multiplyTransformation(s,n[o],t[o])}};var DB=jA;var Zce={name:"AlphaPipelineStage"};Zce.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Se.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,pe.FRAGMENT),s.addUniform("float","u_alphaCutoff",pe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var RB=Zce;var Qce={name:"BatchTexturePipelineStage"};Qce.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=ct(o,e.uniformMap)};var OB=Qce;var Jce={name:"ClassificationPipelineStage"};Jce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,pe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Jje(t,o)};function Jje(e,t){let n=Jt.getAttributeBySemantic(e,mt.POSITION);if(!l(n))throw new se("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=Jt.getAttributeBySemantic(e,mt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],_=0;for(let y=1;y<s;y++){let x=r?i[y]:y,b=c[x];if(b!==p){let T=y-_,C=y;u.push(T),f.push(C),_=C,p=b}}let m=s-_;u.push(m),t.batchLengths=u,t.batchOffsets=f}var MB=Jce;var LB=`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 NB=`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 ele={name:"CPUStylingPipelineStage"};ele.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(LB),o.addFragmentLines(NB),o.addDefine("USE_CPU_STYLING",void 0,pe.BOTH),l(i.color)||(o.addUniform("float",ub.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),e.uniformMap[ub.COLOR_BLEND_UNIFORM_NAME]=function(){return il.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",pe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Se.TRANSLUCENT}};var FB=ele;var tle={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};tle.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var Ay=Object.freeze(tle);var BB=`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 kB=`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 UB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var zB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Ui={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()"};Ui.process=function(e,t,n){let i=e.shaderBuilder;eWe(i);let o=e.runtimeNode.node.instances;l(o)&&tWe(e,o,n),nWe(e,t,n),i.addVertexLines(zB),i.addFragmentLines(UB)};function eWe(e){e.addStruct(Ui.STRUCT_ID_FEATURE_IDS_VS,Ui.STRUCT_NAME_FEATURE_IDS,pe.VERTEX),e.addStruct(Ui.STRUCT_ID_FEATURE_IDS_FS,Ui.STRUCT_NAME_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.VERTEX),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.VERTEX),e.addFunction(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ui.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.FRAGMENT),e.addFunction(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ui.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,pe.VERTEX)}function tWe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Cn.FeatureIdAttribute?iWe(e,s,a):nle(e,s,a,o,1,n);let c=s.label;l(c)&&ile(e,a,c,pe.BOTH)}}function nWe(e,t,n){let i=t.featureIds,r=Jt.getAttributeBySemantic(t,mt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=pe.BOTH;a instanceof Cn.FeatureIdAttribute?oWe(e,a,c):a instanceof Cn.FeatureIdImplicitRange?nle(e,a,c,r,void 0,n):(rWe(e,a,c,s,n),u=pe.FRAGMENT);let f=a.label;l(f)&&ile(e,c,f,u)}}function iWe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function oWe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ui.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(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function nle(e,t,n,i,o,r){sWe(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(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ui.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function rWe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,pe.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,_=a.transform;if(l(_)&&!Z.equals(_,Z.IDENTITY)){let x=`${r}Transform`;u.addUniform("mat3",x,pe.FRAGMENT),s[x]=function(){return _},p=`vec2(${x} * vec3(${d}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function ile(e,t,n,i){let o=e.shaderBuilder,r=pe.includesVertexShader(i);r&&o.addStructField(Ui.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Ui.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Ui.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function sWe(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=aWe(t,n);s=st.createVertexBuffer({context:o.context,typedArray:u,usage:Ne.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:K.FLOAT,strideInBytes:K.getSizeInBytes(K.FLOAT),offsetInBytes:0};e.attributes.push(c)}function aWe(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 fb=Ui;var VB=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); -} -`;var HB=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); - setMetadataVaryings(); -} -`;var Ii={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"}]};Ii.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=cWe(r.propertyAttributes,t,a),u=uWe(r.propertyTextures,a),f=c.concat(u);dWe(i,f),pWe(i),i.addVertexLines(HB),i.addFragmentLines(VB);for(let d=0;d<c.length;d++){let p=c[d];_We(e,p)}for(let d=0;d<u.length;d++){let p=u[d];yWe(e,p)}};function cWe(e,t,n){return l(e)?e.flatMap(i=>lWe(i,t,n)):[]}function lWe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Jt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],_=i(t,p.attribute),{glslType:m,variableName:y}=o(_);u[f]={metadataVariable:r(d),property:p,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:pe.BOTH}}return u}function uWe(e,t){return l(e)?e.flatMap(n=>fWe(n,t)):[]}function fWe(e,t){let{sanitizeGlslIdentifier:n}=Jt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:pe.FRAGMENT}}return s}function dWe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==at.ENUM&&i.add(u)}let o=Ii.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Ii.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,pe.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?mWe(c):c;e.addStructField(a,p,d)}}}var hWe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function mWe(e){let t=hWe[e];return l(t)?t:e}function pWe(e){e.addStruct(Ii.STRUCT_ID_METADATA_VS,Ii.STRUCT_NAME_METADATA,pe.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_FS,Ii.STRUCT_NAME_METADATA,pe.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_VS,Ii.STRUCT_NAME_METADATA_CLASS,pe.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_FS,Ii.STRUCT_NAME_METADATA_CLASS,pe.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_VS,Ii.STRUCT_NAME_METADATA_STATISTICS,pe.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_FS,Ii.STRUCT_NAME_METADATA_STATISTICS,pe.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.VERTEX),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_SET_METADATA_VARYINGS,Ii.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,pe.VERTEX)}function _We(e,t){gWe(e,t),ole(e.shaderBuilder,t),rle(e.shaderBuilder,t)}function gWe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=ale({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:pe.BOTH,property:o});n.addStructField(Ii.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ii.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function yWe(e,t){xWe(e,t),ole(e.shaderBuilder,t),rle(e.shaderBuilder,t)}function xWe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:d}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,pe.FRAGMENT),i[p]=()=>f),n.addStructField(Ii.STRUCT_ID_METADATA_FS,r,o);let _=`attributes.texCoord_${a}`,m=_;if(l(d)&&!Z.equals(d,Z.IDENTITY)){let C=`${p}Transform`;n.addUniform("mat3",C,pe.FRAGMENT),i[C]=function(){return d},m=`vec2(${C} * vec3(${_}, 1.0))`}let y=`texture(${p}, ${m}).${c}`,x=s.unpackInShader(y),b=ale({valueExpression:x,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:pe.FRAGMENT,property:s}),T=`metadata.${o} = ${b};`;n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,[T])}function ole(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=sle(Ii.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,s),pe.includesVertexShader(r)&&(e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function rle(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Ii.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=sle(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,c),pe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function sle(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 ale(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var $d=Ii;var bWe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},db=Object.freeze(bWe);var ya={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:Tt};ya.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===db.TRANSLUCENT?r.pass=Se.TRANSLUCENT:c===db.OPAQUE&&(r.pass=void 0);let u=IWe(s,t);if(!u.customShaderEnabled)return;if(OWe(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,pe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,pe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,pe.FRAGMENT);let p=Ay.getDefineName(s.mode);i.addDefine(p,void 0,pe.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let _=f[p];i.addUniform(_.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let _=d[p];i.addVarying(_,p)}e.uniformMap=ct(e.uniformMap,s.uniformMap)};function TWe(e){let t={};for(let n=0;n<e.length;n++){let i=Jt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var CWe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},AWe={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 cle(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=CWe[t],i=AWe[t];if(l(n))return{attributeField:[n,e],value:i}}function EWe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=lle(t,n,!1),o=ule(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=cle(u);if(!l(f))return ya._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function SWe(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 vWe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=lle(t,n,!0),o=ule(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let d=[i[u].glslType,u];s.push(d),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],d=cle(f);if(!l(d))return ya._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(d.attributeField),r=`fsInput.attributes.${f} = ${d.value};`,a.push(r)}let c=SWe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var wWe={positionWC:!0,positionEC:!0};function lle(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 ule(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||wWe.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 IWe(e,t){let n=TWe(t.attributes),i=EWe(e,n),o=vWe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function PWe(e,t){let n=ya.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ya.STRUCT_NAME_ATTRIBUTES,pe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ya.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ya.STRUCT_NAME_VERTEX_INPUT,pe.VERTEX),e.addStructField(n,ya.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,fb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,$d.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,$d.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,$d.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ya.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ya.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,pe.VERTEX),e.addFunctionLines(r,o)}function DWe(e,t){let n=ya.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ya.STRUCT_NAME_ATTRIBUTES,pe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ya.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ya.STRUCT_NAME_FRAGMENT_INPUT,pe.FRAGMENT),e.addStructField(n,ya.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,fb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,$d.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,$d.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,$d.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ya.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ya.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,pe.FRAGMENT),e.addFunctionLines(r,o)}var RWe=[];function OWe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=RWe;i.enabled&&(PWe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,BB),e.addVertexLines(r)),o.enabled&&(DWe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,kB),e.addFragmentLines(r))}var GB=ya;var WI={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};WI.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,pe.VERTEX),i.addFunction(WI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,WI.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,pe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===mt.POSITION,d=c.semantic===mt.TEXCOORD;if(r&&!f&&!d)continue;let p=Jt.getAttributeInfo(c);LWe(i,p),MWe(e,p)}};function MWe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,pe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,pe.VERTEX),n.addUniform(c,a,pe.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=fle(u,0),f=fle(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function fle(e,t){return e instanceof ie?e:new ie(e.x,e.y,e.z,t)}function LWe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=NWe(n,i):o=FWe(n),e.addFunctionLines(WI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function NWe(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 FWe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var jB=WI;var WB=`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 qB=`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 qI=`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 YI={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};YI.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=BWe(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),kWe(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===pe.BOTH&&i.addVertexLines(qI),i.addFragmentLines(qI)};function dle(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function hle(e){return e instanceof Cn.FeatureIdTexture?pe.FRAGMENT:pe.BOTH}function BWe(e,t,n){let i,o;return l(t.instances)&&(o=Jt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:hle(o),featureIdDefine:dle(o)}):(o=Jt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:hle(o),featureIdDefine:dle(o)})}function kWe(e){e.addStructField(YI.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(YI.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(YI.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var hb=YI;var $s={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)"};$s.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct($s.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",pe.VERTEX),i.addStruct($s.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",pe.FRAGMENT),i.addStruct(hb.STRUCT_ID_SELECTED_FEATURE,hb.STRUCT_NAME_SELECTED_FEATURE,pe.BOTH),i.addFunction($s.FUNCTION_ID_INITIALIZE_ATTRIBUTES,$s.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,pe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField($s.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField($s.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction($s.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,$s.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.VERTEX),i.addFunction($s.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,$s.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.FRAGMENT),o.type===vr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,pe.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=rn.getAttributeLocationCount(f.type),p=f.semantic===mt.POSITION,_;d>1?(_=e.attributeIndex,e.attributeIndex+=d):p&&!a?_=0:_=e.attributeIndex++,UWe(e,f,_,d,r,s)}XWe(i,t.attributes),t.primitiveType===Le.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(qB),i.addFragmentLines(WB)};function UWe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Jt.getAttributeInfo(t),c=o&&!r;i>1?HWe(e,t,n,i):VWe(e,t,n,c),jWe(s,a,c),GWe(s,a),l(t.semantic)&&zWe(s,t),WWe(s,a,o),qWe(s,a,c),YWe(s,a)}function zWe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case mt.NORMAL:e.addDefine("HAS_NORMALS");break;case mt.TANGENT:e.addDefine("HAS_TANGENTS");break;case mt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case mt.TEXCOORD:case mt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function VWe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===mt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===mt.POSITION,f=u?0:n,d=rn.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let _=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:_,count:t.count,componentsPerAttribute:d,componentDatatype:K.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function HWe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=rn.getNumberOfComponents(s)/i,f=K.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let _=0;_<i;_++){let m=t.byteOffset+_*d,y={index:n+_,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(y)}}function GWe(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 jWe(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===mt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function WWe(e,t,n){let i=$s.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=$s.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 qWe(e,t,n){let i=$s.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 YWe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=$s.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=$s.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function XWe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===mt.NORMAL?n=!0:r.semantic===mt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField($s.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField($s.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var YB=$s;var XB=`#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 KWe={UNLIT:0,PBR:1},h_=Object.freeze(KWe);var mle={name:"LightingPipelineStage"};mle.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,pe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",pe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===h_.PBR?o.addDefine("LIGHTING_PBR",void 0,pe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,pe.FRAGMENT),o.addFragmentLines(XB)};var KB=mle;var $B=`// 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:$We,MetallicRoughness:x7,SpecularGlossiness:b7,Specular:ple,Clearcoat:_le}=Cn,gle={name:"MaterialPipelineStage",_processTexture:Xl,_processTextureTransform:yle};gle.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;QWe(i,r,s,u,f,d,c),l(i.specularGlossiness)?JWe(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Jt.supportedExtensions.KHR_materials_specular&&e7e(i.specular,r,s,u,c),l(i.anisotropy)&&Jt.supportedExtensions.KHR_materials_anisotropy&&n7e(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Jt.supportedExtensions.KHR_materials_clearcoat&&i7e(i.clearcoat,r,s,u,c),o7e(i.metallicRoughness,r,s,u,c));let p=Jt.getAttributeBySemantic(t,mt.NORMAL),_=e.lightingOptions;i.unlit||!p||a?_.lightingModel=h_.UNLIT:_.lightingModel=h_.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let y=e.alphaOptions;i.alphaMode===o_.BLEND?y.pass=Se.TRANSLUCENT:i.alphaMode===o_.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines($B),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,pe.BOTH)};function yle(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,pe.FRAGMENT),t[s]=function(){return n.transform}}function ZWe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,pe.FRAGMENT),t[s]=function(){return n.scale}}function Xl(e,t,n,i,o,r){e.addUniform("sampler2D",i,pe.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,pe.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,pe.FRAGMENT);let f=n.transform;l(f)&&!Z.equals(f,Z.IDENTITY)&&yle(e,t,n,i,o);let{scale:d}=n;l(d)&&d!==1&&ZWe(e,t,n,i,o)}function QWe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!h.equals(a,$We.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",pe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,pe.FRAGMENT),l(c)&&!s&&Xl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&Xl(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&Xl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function JWe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,pe.FRAGMENT),l(r)&&!o&&Xl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!ie.equals(s,b7.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",pe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Xl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,b7.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",pe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(u)&&u!==b7.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",pe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,pe.FRAGMENT))}function e7e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,pe.FRAGMENT),l(r)&&!o&&Xl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==ple.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",pe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Xl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,ple.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",pe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,pe.FRAGMENT))}var t7e=new h;function n7e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,pe.FRAGMENT),l(a)&&!o&&Xl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",pe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,r,t7e)}}function i7e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,pe.FRAGMENT),l(r)&&r!==_le.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",pe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,pe.FRAGMENT)),l(s)&&!o&&Xl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==_le.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",pe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT)),l(c)&&!o&&Xl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Xl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function o7e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,pe.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Xl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!ie.equals(s,x7.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",pe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,pe.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Xl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==x7.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",pe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,pe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==x7.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",pe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT))}var ZB=gle;var al={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"};al.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(al.METADATA_PICKING_VALUE_TYPE,"float",pe.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_STRING,"0.0",pe.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",pe.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",pe.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",pe.FRAGMENT),i.addDefine(al.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",pe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",pe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${al.METADATA_PICKING_VALUE_TYPE} value = ${al.METADATA_PICKING_VALUE_TYPE}(${al.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${al.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${al.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${al.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${al.METADATA_PICKING_VALUE_COMPONENT_W};`],pe.FRAGMENT)};var Uf=al;var QB=`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 Ha={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)"};Ha.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,pe.VERTEX),u7e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==mt.POSITION&&p!==mt.NORMAL&&p!==mt.TANGENT||(s7e(e,d,e.attributeIndex,a),e.attributeIndex++)}}f7e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,pe.VERTEX),n.addVertexLines(QB);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=ct(s,e.uniformMap)};var r7e={attributeString:void 0,functionId:void 0};function s7e(e,t,n,i){let o=e.shaderBuilder;a7e(e,t,n);let r=c7e(t,r7e);l7e(o,r,i)}function a7e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:rn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function c7e(e,t){switch(e.semantic){case mt.POSITION:t.attributeString="Position",t.functionId=Ha.FUNCTION_ID_GET_MORPHED_POSITION;break;case mt.NORMAL:t.attributeString="Normal",t.functionId=Ha.FUNCTION_ID_GET_MORPHED_NORMAL;break;case mt.TANGENT:t.attributeString="Tangent",t.functionId=Ha.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function l7e(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 u7e(e){e.addFunction(Ha.FUNCTION_ID_GET_MORPHED_POSITION,Ha.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,pe.VERTEX),e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ha.FUNCTION_ID_GET_MORPHED_NORMAL,Ha.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,pe.VERTEX),e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ha.FUNCTION_ID_GET_MORPHED_TANGENT,Ha.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,pe.VERTEX),e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function f7e(e){e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ha.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var JB=Ha;var xle={name:"PickingPipelineStage"};xle.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)d7e(e,t,a,i);else if(l(a))h7e(e,i);else{let c=ble(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",pe.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function ble(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(vr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function d7e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Jt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Jt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",pe.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function h7e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let d=0;d<n;d++){let p=ble(e,d),_=t.createPickId(p);s.push(_),i[d]=_;let m=_.color;o[d*4+0]=H.floatToByte(m.red),o[d*4+1]=H.floatToByte(m.green),o[d*4+2]=H.floatToByte(m.blue),o[d*4+3]=H.floatToByte(m.alpha)}r._pickIds=i;let a=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,pe.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var e3=xle;var m7e={ADD:0,REPLACE:1},Jo=Object.freeze(m7e);var t3=`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 p7e=new ie,Cle={name:"PointCloudStylingPipelineStage"};Cle.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let y=x7e(a),x=b7e(r,y);T7e(i,x);let T=C7e(x).indexOf("normalMC")>=0,C=Jt.getAttributeBySemantic(t,mt.NORMAL);if(T&&!C)throw new se("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,pe.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Se.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,pe.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,pe.VERTEX);let d,p,_;vr.is3DTiles(o.type)&&(p=!0,d=o.content,_=d.tile.refine===Jo.ADD),i.addUniform("vec4","model_pointCloudParameters",pe.VERTEX),i.addVertexLines(t3);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=p7e,x=1;p&&(x=_?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??x,y.x*=n.pixelRatio;let b=_7e(e,t,f,d);y.y=b*f.geometricErrorScale;let T=n.context,C=n.camera.frustum,A;return n.mode===ne.SCENE2D||C instanceof ln?A=Number.POSITIVE_INFINITY:A=T.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=A,p&&(y.w=d.tileset.timeSinceLoad),y}};var Tle=new h;function _7e(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Jt.getAttributeBySemantic(t,mt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,Tle);a=O.multiplyByPointAsVector(s,a,Tle);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var g7e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},y7e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function x7e(e){let t=Fe(y7e);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 T7="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function b7e(e,t){let n=g7e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${T7})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${T7})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${T7})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function T7e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,pe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,pe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,pe.VERTEX),e.addVertexLines(o))}function C7(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 C7e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&C7(t,o),l(n)&&C7(n,o),l(i)&&C7(i,o),o}var n3=Cle;var i3=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var o3=`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 Ale={name:"PrimitiveOutlinePipelineStage"};Ale.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,pe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:rn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",pe.FRAGMENT);let a=DA.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",pe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",pe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(i3),i.addFragmentLines(o3)};var r3=Ale;var Ele={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Sle,_count2DPositions:vle,_countMorphTargetAttributes:wle,_countMaterialTextures:Ile,_countFeatureIdTextures:Ple,_countBinaryMetadata:Dle};Ele.process=function(e,t,n){let i=e.model,o=i.statistics;Sle(o,t),vle(o,e.runtimePrimitive),wle(o,t),Ile(o,t.material),Ple(o,t.featureIds),Dle(o,i)};function Sle(e,t){let n=l(t.indices)?t.indices.count:Jt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Le.POINTS?e.pointsLength+=n:Le.isTriangles(i)&&(e.trianglesLength+=A7e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function A7e(e,t){switch(e){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function vle(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function wle(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Ile(e,t){let n=E7e(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 E7e(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 Ple(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Cn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Dle(e,t){let n=t.structuralMetadata;l(n)&&(S7e(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 S7e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var s3=Ele;var v7e=new O,w7e=new O,Rle={name:"SceneMode2DPipelineStage"};Rle.process=function(e,t,n){let i=Jt.getAttributeBySemantic(t,mt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=O.multiplyTransformation(s,a,v7e),u=D7e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=M7e(i,c,u,n);f.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,pe.VERTEX),o.addUniform("mat4","u_modelView2D",pe.VERTEX);let p=O.fromTranslation(u.center,new O),_=n.context,m={u_modelView2D:function(){return O.multiplyTransformation(_.uniformState.view,p,w7e)}};e.uniformMap=ct(m,e.uniformMap)};var I7e=new h,P7e=new h;function D7e(e,t,n){let i=O.multiplyByPoint(t,e.positionMin,I7e),o=qi.computeActualEllipsoidPosition(n,i,i),r=O.multiplyByPoint(t,e.positionMax,P7e),s=qi.computeActualEllipsoidPosition(n,r,r);return re.fromCornerPoints(o,s,new re)}var Ole=new h;function R7e(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=h.fromArray(e,s,Ole),c=h.multiplyComponents(a,r,a),u=h.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function O7e(e,t,n,i){let o;l(e.quantization)?o=R7e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=h.fromArray(o,c,Ole);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=O.multiplyByPoint(t,u,u),d=qi.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function M7e(e,t,n,i){let o=Fe(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=O7e(e,t,r,o),a=st.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var a3=Rle;var c3=`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 mb={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};mb.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,pe.VERTEX),N7e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,pe.VERTEX),n.addVertexLines(c3);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=ct(r,e.uniformMap)};function L7e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===mt.JOINTS||r.semantic===mt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function N7e(e,t){e.addFunction(mb.FUNCTION_ID_GET_SKINNING_MATRIX,mb.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,pe.VERTEX),e.addFunctionLines(mb.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=L7e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(mb.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(mb.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var l3=mb;var u3=`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 Mle={name:"VerticalExaggerationPipelineStage"},F7e=new V;Mle.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(u3),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,pe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",pe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return V.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,F7e)}};var f3=Mle;var A7={};function B7e(e){let t=ke.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 k7e(e,t){let n=t.length,i=ke.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 U7e(e){let t=e-2,n=2+t*4,i=ke.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 z7e(e,t){let i=t.length-2,o=2+i*4,r=ke.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function V7e(e){let t=e-2,n=2+t*4,i=ke.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 H7e(e,t){let i=t.length-2,o=2+i*4,r=ke.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}A7.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Le.TRIANGLES)return i?k7e(t,n):B7e(t);if(e===Le.TRIANGLE_STRIP)return i?z7e(t,n):U7e(t);if(e===Le.TRIANGLE_FAN)return i?H7e(t,n):V7e(t)};A7.getWireframeIndicesCount=function(e,t){return e===Le.TRIANGLES?t*2:e===Le.TRIANGLE_STRIP||e===Le.TRIANGLE_FAN?2+(t-2)*4:t};var XI=A7;var Lle={name:"WireframePipelineStage"};Lle.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,pe.FRAGMENT);let o=e.model,r=G7e(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=Le.LINES,e.count=XI.getWireframeIndicesCount(a,c)};function G7e(e,t,n){let o=Jt.getAttributeBySemantic(e,mt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(s=f.sizeInBytes===d?new Uint8Array(d):ke.createTypedArray(o,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=XI.createWireframeIndices(a,o,s),u=ke.fromSizeInBytes(c.BYTES_PER_ELEMENT);return st.createIndexBuffer({context:n.context,typedArray:c,usage:Ne.STATIC_DRAW,indexDatatype:u})}var d3=Lle;function Nle(e){e=e??G.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=[]}Nle.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),_=l(r),y=!(_&&l(r.fragmentShaderText))||r.mode!==Ay.REPLACE_MATERIAL,x=Jt.hasQuantizedAttributes(n.attributes),b=o.debugWireframe&&Le.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),T=o.pointCloudShading,C=l(T)&&T.attenuation,A=l(T)&&T.backFaceCulling,S=n.primitiveType===Le.POINTS&&(l(s)||C||A),w=o._enableShowOutline&&l(n.outlineCoordinates),R=j7e(o,i,n),D=l(o.classificationType);u&&t.push(a3),t.push(YB),b&&t.push(d3),D&&t.push(MB),d&&t.push(JB),p&&t.push(l3),S&&t.push(n3),x&&t.push(jB),y&&t.push(ZB),t.push(fb),t.push($d),t.push(Uf),R.hasPropertyTable&&(t.push(hb),t.push(OB),t.push(FB)),f&&t.push(f3),_&&t.push(GB),t.push(KB),o.allowPicking&&t.push(e3),w&&t.push(r3),t.push(RB),t.push(s3)};function j7e(e,t,n){let i;return l(t.instances)&&(i=Jt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Jt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var h3=Nle;function E7(e){e=e??G.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],W7e(this)}Object.defineProperties(E7.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 W7e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let d=n[c],p=Fle(f,d,new O);a.push(p)}}function Fle(e,t,n){let i=O.multiplyTransformation(e.transformToRoot,e.transform,n);return n=O.multiplyTransformation(i,t,n),n}E7.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]=Fle(i,o,e[n])}};var m3=E7;function q7e(){this.pass=void 0,this.alphaCutoff=void 0}var p3=q7e;function Y7e(e){this.shaderBuilder=new OC,this.model=e,this.uniformMap={},this.alphaOptions=new p3,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:qc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var _3=Y7e;var g3=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var y3=`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 x3={name:"ModelSilhouettePipelineStage"};x3.silhouettesLength=0;x3.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++x3.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,pe.BOTH),i.addVertexLines(y3),i.addFragmentLines(g3),i.addUniform("vec4","model_silhouetteColor",pe.FRAGMENT),i.addUniform("float","model_silhouetteSize",pe.VERTEX),i.addUniform("bool","model_silhouettePass",pe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=ct(o,e.uniformMap),e.hasSilhouette=!0};var b3=x3;var T3=`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 C3={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};C3.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,pe.FRAGMENT),i.addFragmentLines(T3);let o={};i.addUniform("float",C3.SPLIT_DIRECTION_UNIFORM_NAME,pe.FRAGMENT),o[C3.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=ct(o,e.uniformMap)};var A3=C3;function X7e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Fe(e.uniformMap),this.alphaOptions=Fe(e.alphaOptions),this.renderStateOptions=Fe(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 E3=X7e;function K7e(e){e=e??G.EMPTY_OBJECT,this.lightingModel=e.lightingModel??h_.UNLIT}var S3=K7e;function $7e(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=Fe(e.uniformMap),this.alphaOptions=Fe(e.alphaOptions),this.renderStateOptions=Fe(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:Jt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Jt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=re.fromCornerPoints(this.positionMin,this.positionMax,new re),this.lightingOptions=new S3,this.pickId=void 0}var v3=$7e;function v7(e){e=e??G.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!==zn.CESIUM_3D_TILE,this._classifies3DTiles=o!==zn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],eqe(this)}function Z7e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ht.KEEP,zFail:ht.DECREMENT_WRAP,zPass:ht.KEEP},backFunction:e,backOperation:{fail:ht.KEEP,zFail:ht.INCREMENT_WRAP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:qc.LESS_OR_EQUAL},depthMask:!1}}var Q7e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND},J7e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ht.ZERO,zFail:ht.ZERO,zPass:ht.ZERO},reference:0,mask:jt.CLASSIFICATION_MASK},stencilMask:jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Ule=[];function eqe(e){let t=e._command,n=Ule;if(e._useDebugWireframe){t.pass=Se.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=KI(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=Se.TERRAIN_CLASSIFICATION,s=S7(t,r),a=Ble(t,r);n.length=0,n.push(s,a),e._commandListTerrain=KI(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=kle(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Se.CESIUM_3D_TILE_CLASSIFICATION,s=S7(t,r),a=Ble(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=KI(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=kle(e,n,e._commandList3DTilesPicking))}}function KI(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let d=0;d<a;d++){let p=t[d],_=qe.shallowClone(p);_.count=u,_.offset=f,n.push(_)}}return n}function S7(e,t){let n=qe.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Se.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=Z7e(i);return n.renderState=ze.fromCache(o),n}function Ble(e,t){let n=qe.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(Q7e),n}var tqe=[];function kle(e,t,n){let i=ze.fromCache(J7e),o=t[0],r=t[1],s=qe.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=qe.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=tqe;return c.length=0,c.push(s,a),KI(e,c,n)}Object.defineProperties(v7.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=O.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=re.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});v7.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=Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=S7(this._command,o),s=Ule;s.length=0,s.push(r),this._commandListIgnoreShow=KI(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 w3=v7;function I3(e){e=e??G.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===Se.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c;this._command=t,this._modelMatrix=O.clone(t.modelMatrix),this._boundingVolume=re.clone(t.boundingVolume),this._modelMatrix2D=new O,this._boundingVolume2D=new re,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,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,nqe(this)}function m_(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}m_.clone=function(e){return new m_({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function nqe(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 m_({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new m_({command:lqe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new m_({command:pqe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new m_({command:_qe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new m_({command:uqe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new m_({command:fqe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(I3.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=O.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=re.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,oqe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,rqe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,sqe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,aqe(this))}}});function iqe(e,t){let n=e._modelMatrix;e._modelMatrix2D=O.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=re.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function oqe(e){let t=e.shadows,n=Tn.castShadows(t),i=Tn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function rqe(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=Fe(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function sqe(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=Fe(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function aqe(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}}}I3.prototype.pushCommands=function(e,t){let n=zle(this,e);n&&!this._has2DCommands&&(cqe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(iqe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==vm.ALL_OPAQUE&&qA(t,this._translucentCommand,n),i===vm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||qA(o._backfaceCommands,this._skipLodBackfaceCommand,n),dqe(this,r,n),qA(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){qA(t,this._silhouetteModelCommand,n);return}return qA(t,this._originalCommand,n),t}};I3.prototype.pushSilhouetteCommands=function(e,t){let n=zle(this,e);return qA(t,this._silhouetteColorCommand,n),t};function qA(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function zle(e,t){if(t.mode!==ne.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*P.PI;return o<s&&r>s||o<-s&&r>-s}function WA(e,t){if(!l(t))return;let n=m_.clone(t),i=qe.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 cqe(e){WA(e,e._originalCommand),WA(e,e._translucentCommand),WA(e,e._skipLodBackfaceCommand),WA(e,e._skipLodStencilCommand),WA(e,e._silhouetteModelCommand),WA(e,e._silhouetteColorCommand)}function lqe(e){let t=qe.shallowClone(e);t.pass=Se.TRANSLUCENT;let n=Fe(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=fn.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function uqe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Fe(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:q.ALWAYS,backFunction:q.ALWAYS,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function fqe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Fe(e.renderState,!0);o.cull.enabled=!1,(e.pass===Se.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Se.TRANSLUCENT,o.depthMask=!1,o.blending=fn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:q.NOTEQUAL,backFunction:q.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP}};let s=Fe(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function dqe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=hqe(o);if(r!==s){let a=mqe(r),c=Fe(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function hqe(e){return(e.renderState.stencilTest.reference&jt.SKIP_LOD_MASK)>>>jt.SKIP_LOD_BIT_SHIFT}function mqe(e){return jt.CESIUM_3D_TILE_MASK|e<<jt.SKIP_LOD_BIT_SHIFT}function pqe(e){let t=qe.shallowClone(e),n=Fe(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Si.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Fe(t.uniformMap),o=new V(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function _qe(e){let t=qe.shallowClone(e),n=Fe(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=jt.SKIP_LOD_MASK,i.reference=jt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ht.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ht.REPLACE,n.stencilMask=jt.CESIUM_3D_TILE_MASK|jt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var P3=I3;var D3=`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 R3=` -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 Vle(){}Vle.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=gqe(e,n,t),o=yqe(e,i,t),r=e.model;return l(r.classificationType)?new w3({primitiveRenderResources:e,command:o}):new P3({primitiveRenderResources:e,command:o})};function gqe(e,t,n){t.addVertexLines(D3),t.addFragmentLines(R3);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function yqe(e,t,n){let i=xqe(e),o=new qn({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===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=O.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new O),f=e.runtimePrimitive.boundingSphere2D;else{let b=c?a._computedModelMatrix:a._computedModelMatrix2D;u=O.multiplyTransformation(b,e.runtimeNode.computedTransform,new O),f=re.transform(e.boundingSphere,u)}let d=Fe(ze.fromCache(e.renderStateOptions),!0);d.cull.face=Jt.getCullFace(u,e.primitiveType),d=ze.fromCache(d);let p=l(r.classificationType),_=p?!1:Tn.castShadows(r.shadows),m=p?!1:Tn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new qe({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,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:_,receiveShadows:m})}function xqe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var O3=Vle;function Iu(e){e=e??G.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=O.clone(O.IDENTITY),this._computedModelMatrix2D=O.clone(O.IDENTITY),this._axisCorrectionMatrix=Jt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new O),this._runtimeArticulations={},bqe(this)}Object.defineProperties(Iu.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 bqe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Hle(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let T=0;T<s;T++){let C=r[T],A=new pB({articulation:C,sceneGraph:e}),S=A.name;a[S]=A}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=O.IDENTITY;for(let T=0;T<d;T++){let C=n.nodes[T],A=Gle(e,C,p);e._rootNodes.push(A)}let _=t.skins,m=e._runtimeSkins,y=_.length;for(let T=0;T<y;T++){let C=_[T];m.push(new m3({skin:C,sceneGraph:e}))}let x=e._skinnedNodes,b=x.length;for(let T=0;T<b;T++){let C=x[T],A=e._runtimeNodes[C],w=c[C].skin.index;A._runtimeSkin=m[w],A.updateJointMatrices()}e.applyArticulations()}function Hle(e,t){let n=e._components,i=e._model;e._computedModelMatrix=O.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=O.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=O.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var Tqe=new h;function Cqe(e,t){let n=e._computedModelMatrix,i=O.getTranslation(n,Tqe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=Et.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Et.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=O.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=re.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Gle(e,t,n){let i=[],o=Jt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=O.multiplyTransformation(n,o,new O),_=Gle(e,d,p);i.push(_)}let s=new DB({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new h3({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new CB(f,s);f._nodesByName[u]=d}return c}var Aqe=new h,Eqe=new h,Sqe=new h,vqe=new h;Iu.prototype.buildDrawCommands=function(e){let t=this._model,n=new _3(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=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Aqe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Eqe);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new E3(n,u);for(r=0;r<f.length;r++)f[r].process(d,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let _=u.runtimePrimitives[r];_.configurePipeline(e);let m=_.pipelineStages,y=new v3(d,_);for(s=0;s<m.length;s++)m[s].process(y,_.primitive,e);_.boundingSphere=re.clone(y.boundingSphere,new re);let x=O.multiplyByPoint(p,y.positionMin,Sqe),b=O.multiplyByPoint(p,y.positionMax,vqe);h.minimumByComponent(a,x,a),h.maximumByComponent(c,b,c);let T=O3.buildModelDrawCommand(y,e);_.drawCommand=T}}this._boundingSphere=re.fromCornerPoints(a,c,new re),this._boundingSphere=re.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=re.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=re.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Iu.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(ub),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(dB),n.isClippingEnabled()&&t.push(yB),n.isClippingPolygonsEnabled()&&t.push(TB),n.hasSilhouette(e)&&t.push(b3),l(n.splitDirection)&&n.splitDirection!==Jr.NONE&&t.push(A3),vr.is3DTiles(n.type)&&t.push(aB),i&&t.push(uB))};Iu.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!==ne.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)}}};Iu.prototype.updateModelMatrix=function(e,t){Hle(this,e),t.mode!==ne.SCENE3D&&Cqe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Iu.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 jle(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);jle(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function M3(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];jle(e,c,t,n,i)}}var wqe={backFaceCulling:void 0};Iu.prototype.updateBackFaceCulling=function(e){let t=wqe;t.backFaceCulling=e,M3(this,!1,Iqe,t)};function Iqe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Pqe={shadowMode:void 0};Iu.prototype.updateShadows=function(e){let t=Pqe;t.shadowMode=e,M3(this,!1,Dqe,t)};function Dqe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Rqe={debugShowBoundingVolume:void 0};Iu.prototype.updateShowBoundingVolume=function(e){let t=Rqe;t.debugShowBoundingVolume=e,M3(this,!1,Oqe,t)};function Oqe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Wle=[],Mqe={frameState:void 0,hasSilhouette:void 0};Iu.prototype.pushDrawCommands=function(e){let t=Wle;t.length=0;let n=Mqe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,M3(this,!0,Lqe,n),e.commandList.push.apply(e.commandList,t)};function Lqe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Wle,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Iu.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)};Iu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var L3=Iu;function Ey(){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(Ey.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}}});Ey.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()};Ey.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};Ey.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Ey.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Ey.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Ey.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var N3=Ey;var Kle=$r(IR(),1);var qle={},pb=Uint32Array.BYTES_PER_ELEMENT;qle.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=pb;let o=i.getUint32(t,!0);if(o!==1)throw new se(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=pb,t+=pb;let r=i.getUint32(t,!0);if(r===0)throw new se("Feature table must have a byte length greater than zero");t+=pb;let s=i.getUint32(t,!0);t+=pb;let a=i.getUint32(t,!0);t+=pb;let c=i.getUint32(t,!0);t+=pb;let u=jo(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=jo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let _=new Em(u,f),m=_.getGlobalProperty("POINTS_LENGTH");if(_.featuresLength=m,!l(m))throw new se("Feature table global property: POINTS_LENGTH must be defined");let y=_.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(y)&&(y=h.unpack(y));let x=Nqe(_,d);if(x.rtcCenter=y,x.pointsLength=m,!x.hasPositions){let b=Fqe(_);x.positions=b,x.hasPositions=x.hasPositions||l(b)}if(!x.hasPositions)throw new se("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let b=kqe(_);x.normals=b,x.hasNormals=x.hasNormals||l(b)}if(!x.hasColors){let b=Bqe(_);x.colors=b,x.hasColors=x.hasColors||l(b),x.hasConstantColor=l(x.constantColor),x.isTranslucent=l(b)&&b.isTranslucent}if(!x.hasBatchIds){let b=Uqe(_);x.batchIds=b,x.hasBatchIds=x.hasBatchIds||l(b)}if(x.hasBatchIds){let b=_.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new se("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=b}return l(p)&&(p=new Uint8Array(p),x.batchTableJson=d,x.batchTableBinary=p),x};function Nqe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(o)||!l(m)||!l(y))throw new se("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let _;return l(i)&&(_={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:ct(o,r),dequantizeInShader:!0}),{draco:_,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function Fqe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",K.FLOAT,3),{name:mt.POSITION,semantic:mt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:K.FLOAT,type:rn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",K.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",K.FLOAT,3);if(!l(i))throw new se("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",K.FLOAT,3);if(!l(r))throw new se("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:mt.POSITION,semantic:mt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:K.FLOAT,type:rn.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:K.UNSIGNED_SHORT,quantizedType:rn.VEC3}}}function Bqe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",K.UNSIGNED_BYTE,4),{name:mt.COLOR,semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",K.UNSIGNED_BYTE,3),{name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",K.UNSIGNED_SHORT,1),{name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n,componentDatatype:K.FLOAT,type:rn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",K.UNSIGNED_BYTE,4),o=i[3],r=H.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:mt.COLOR,semantic:mt.COLOR,setIndex:0,constantColor:r,componentDatatype:K.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:s}}}function kqe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",K.FLOAT,3),{name:mt.NORMAL,semantic:mt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:K.FLOAT,type:rn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",K.UNSIGNED_BYTE,2),{name:mt.NORMAL,semantic:mt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:rn.VEC2,quantizedComponentDatatype:K.UNSIGNED_BYTE,componentDatatype:K.FLOAT,type:rn.VEC3}}function Uqe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",K.UNSIGNED_SHORT,1);return{name:mt.FEATURE_ID,semantic:mt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:K.fromTypedArray(n),type:rn.SCALAR}}}var YA=qle;var zqe=Cn.Components,Vqe=Cn.Scene,Hqe=Cn.Node,Gqe=Cn.Primitive,jqe=Cn.Attribute,Yle=Cn.Quantization,Wqe=Cn.FeatureIdAttribute,qqe=Cn.Material,Yqe=Cn.MetallicRoughness;function Sy(e){e=e??G.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=yt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=O.IDENTITY}l(Object.create)&&(Sy.prototype=Object.create(eo.prototype),Sy.prototype.constructor=Sy);Object.defineProperties(Sy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Sy.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=YA.parse(this._arrayBuffer,this._byteOffset),this._state=yt.PROCESSING,this._promise=Promise.resolve(this)};Sy.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===yt.READY)return!0;if(this._state===yt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Xqe(this,e.context)}return!1};function Xqe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Zg.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&Kqe(e,i,r),sYe(e,t),e._state=yt.READY,e}).catch(function(r){e.unload(),e._state=yt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function Kqe(e,t,n){e._state=yt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:mt.POSITION,typedArray:n.POSITION.array,componentDatatype:K.FLOAT,type:rn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT,o.quantizedType=rn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:mt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:K.FLOAT,type:rn.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=K.UNSIGNED_BYTE,o.quantizedType=rn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:mt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:K.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:mt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:K.fromTypedArray(a),type:rn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:$qe(u.componentsPerAttribute),componentType:Zqe(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function $qe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Zqe(e){switch(e){case q.BYTE:return"BYTE";case q.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case q.SHORT:return"SHORT";case q.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case q.INT:return"INT";case q.UNSIGNED_INT:return"UNSIGNED_INT";case q.DOUBLE:return"DOUBLE";case q.FLOAT:return"FLOAT"}}function $I(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Yle,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Yle;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new jqe;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=Mn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=H.pack(t.constantColor,a)}else{let a=st.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===mt.POSITION&&s&&(r.typedArray=i),r}var Xle,F3;function Qqe(e){if(!l(F3)){Xle=new Kle.default(0),F3=new Array(e);for(let t=0;t<e;++t)F3[t]=Xle.random()}return F3}var Jqe=new h,eYe=new h,tYe=new h;function nYe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=Qqe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Jqe),u=h.fromElements(a,a,a,eYe),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=h.unpack(t,d*3,tYe),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var iYe={name:mt.COLOR,semantic:mt.COLOR,setIndex:0,constantColor:H.DARKGRAY,componentDatatype:K.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:!1};function oYe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(nYe(r),o=$I(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=$I(e,t.normals,n),i.push(o)),l(t.colors)?(o=$I(e,t.colors,n),i.push(o)):(o=$I(e,iYe,n),i.push(o)),l(t.batchIds)&&(o=$I(e,t.batchIds,n),i.push(o)),i}function rYe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);return l(o)||e.hasDracoBatchTable?_y({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new ga({schema:{},propertyTables:[]})}function sYe(e,t){let n=e._parsedContent,i=new Yqe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new qqe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=o_.BLEND);let s=!l(n.normals);o.unlit=s;let a=new Gqe;if(a.attributes=oYe(e,n,t),a.primitiveType=Le.POINTS,a.material=o,l(n.batchIds)){let _=new Wqe;_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0",a.featureIds.push(_)}let c=new Hqe;c.index=0,c.primitives=[a];let u=new Vqe;u.nodes=[c],u.upAxis=Go.Z,u.forwardAxis=Go.X;let f=new zqe;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=rYe(n,d),d.length>0&&aYe(e,a,d,t),l(n.rtcCenter)&&(f.transform=O.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=O.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function aYe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=st.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Sy.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 B3=Sy;var cYe=new h,lYe=new h,uYe=new h,fYe=new O,dYe=new O,hYe=new O,mYe=new fe,pYe=new re;function ZI(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let d=u[f],p=d.node,_=O.clone(d.computedTransform,fYe),m=O.clone(c.computedModelMatrix,dYe),y=p.instances;l(y)&&y.transformInWorldSpace&&(m=O.multiplyTransformation(e.modelMatrix,c.components.transform,m),_=O.multiplyTransformation(c.axisCorrectionMatrix,d.computedTransform,_));let x=O.multiplyTransformation(m,_,hYe);n.mode!==ne.SCENE3D&&(x=Et.basisTo2D(n.mapProjection,x,x));let b=[];if(l(y)){let C=y.attributes[0].count,A=y.attributes[0].componentDatatype,S=12,w=d.transformsTypedArray;if(!l(w)){let R=d.instancingTransformsBuffer;l(R)&&n.context.webgl2&&(w=K.createTypedArray(A,C*S),R.getBufferData(w))}if(l(w))for(let R=0;R<C;R++){let D=R*S,M=new O(w[D],w[D+1],w[D+2],w[D+3],w[D+4],w[D+5],w[D+6],w[D+7],w[D+8],w[D+9],w[D+10],w[D+11],0,0,0,1);y.transformInWorldSpace?(O.multiplyTransformation(M,_,M),O.multiplyTransformation(m,M,M)):O.multiplyTransformation(M,x,M),b.push(M)}}b.length===0&&b.push(x);let T=d.runtimePrimitives.length;for(let C=0;C<T;C++){let A=d.runtimePrimitives[C],S=A.primitive;if(l(A.boundingSphere)&&!l(y)){let W=re.transform(A.boundingSphere,x,pYe),J=ni.raySphere(t,W);if(!l(J))continue}let w=Jt.getAttributeBySemantic(S,mt.POSITION),R=w.byteOffset,D=w.byteStride,M=w.count;if(!l(S.indices))continue;let L=S.indices.typedArray;if(!l(L)){let W=S.indices.buffer,J=S.indices.count,Y=S.indices.indexDatatype;l(W)&&n.context.webgl2&&(Y===ke.UNSIGNED_BYTE?L=new Uint8Array(J):Y===ke.UNSIGNED_SHORT?L=new Uint16Array(J):Y===ke.UNSIGNED_INT&&(L=new Uint32Array(J)),W.getBufferData(L))}let g=w.typedArray,E=w.componentDatatype,v=w.type,I=w.quantization;l(I)&&(E=w.quantization.componentDatatype,v=w.quantization.type);let N=rn.getNumberOfComponents(v),F=K.getSizeInBytes(E),U=!l(g)&&l(D)&&D!==N*F,k=N,z=0;U&&(k=D/F,z=R/F);let B=M*k;if(!l(g)){let W=w.buffer;l(W)&&n.context.webgl2&&(g=K.createTypedArray(E,B),W.getBufferData(g,U?0:R,0,B)),I&&w.normalized&&(g=Mn.dequantize(g,E,v,M))}if(!l(L)||!l(g))return;r=r??te.default,i=i??1,o=o??0;let j=L.length;for(let W=0;W<j;W+=3){let J=L[W],Y=L[W+1],ee=L[W+2];for(let Q of b){let de=w7(g,J,z,k,I,Q,i,o,r,cYe),ge=w7(g,Y,z,k,I,Q,i,o,r,lYe),le=w7(g,ee,z,k,I,Q,i,o,r,uYe),ye=ni.rayTriangleParametric(t,de,ge,le,e.backFaceCulling??!0);l(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==ne.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,d=f.ellipsoid,p=f.unproject(s,mYe);d.cartographicToCartesian(p,s)}return s}}function w7(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=Mn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let d=u.x;u.x=u.z,u.z=u.y,u.y=d}}else u=h.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=h.add(u,o.quantizedVolumeOffset,u);return u=O.multiplyByPoint(r,u,u),s!==1&&Br.getPosition(u,c,s,a,u),u}function uo(e){e=e??G.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??vr.GLTF,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.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=Z.clone(Z.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 oB(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=H.clone(e.color),this._colorBlendMode=e.colorBlendMode??il.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??H.RED;this._silhouetteColor=H.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Se.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 re,this._initialRadius=void 0,this._heightReference=e.heightReference??$e.NONE,this._heightDirty=this._heightReference!==$e.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new s_(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Os.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=O.clone(O.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Tm.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new cA,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new fy(e.environmentMapOptions);fy.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Tn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===vr.GLTF&&Tt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new _t(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Jr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??H.BLACK,this._classificationType=e.classificationType,this._statistics=new N3,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 me,this._readyEvent=new me,this._texturesReadyEvent=new me,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function I7(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function _Ye(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 sB({model:e,propertyTable:s});n.push(a)}return n}function gYe(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=Jt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=Jt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function R7(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(uo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){R7(e,this._color)&&this.resetDrawCommands(),this._color=H.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(!H.equals(e,this._silhouetteColor)){let t=R7(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=H.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 Qle(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===vr.GLTF&&Tt("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&&(Os.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Tm.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=h.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&&(fy.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}}});uo.prototype.getNode=function(e){return this._nodesByName[e]};uo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};uo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};uo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};uo.prototype.makeStyleDirty=function(){this._styleDirty=!0};uo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var yYe=new O,xYe=new Z,bYe=new O;uo.prototype.update=function(e){let t=!1;try{t=TYe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")I7(this,n);else{let i=Jt.getError("model",this._resource,n);I7(this,i)}}if(CYe(this,e),AYe(this,e),EYe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Jt.getError("model",this._resource,new se("Failed to load model."));I7(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&_Ye(this,i);let o=new L3({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(SYe(this),vYe(this),wYe(this,e),IYe(this),PYe(this,e),DYe(this,e),RYe(this,e),OYe(this,e),MYe(this,e),LYe(this,e),NYe(this,e),this._defaultTexture=e.context.defaultTexture,FYe(this,e),BYe(this,e),kYe(this),UYe(this,e),GYe(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)),VYe(this),jYe(this,e),WYe(this),qYe(this,e)}};function TYe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function CYe(e,t){l(e._customShader)&&e._customShader.update(t)}function AYe(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 EYe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function SYe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=gYe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function vYe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function wYe(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&&Zle(e)}function Zle(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=vm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function IYe(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 PYe(e,t){e._silhouetteDirty&&(Jle(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function DYe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function RYe(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 OYe(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 MYe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function LYe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function NYe(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 FYe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function BYe(e,t){O.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=O.clone(e.modelMatrix,e._modelMatrix))}var vy=new h,P7=new fe;function kYe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===$e.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;vy.x=i[12],vy.y=i[13],vy.z=i[14];let o=n.cartesianToCartographic(vy);l(e._clampedModelMatrix)||(e._clampedModelMatrix=O.clone(i,new O)),e._removeUpdateHeightCallback=t.updateHeight(o,$le(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=$le(e,n,o);fe.clone(o,P7),P7.height=r,s(P7)}e._heightDirty=!1,e._updateModelMatrix=!0}function UYe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Qle(e,n),zYe(e,n,t)}function Qle(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=re.transform(e._boundingSphere,t,e._boundingSphere)}function zYe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);O.getTranslation(t,vy),e._sceneMode!==ne.SCENE3D&&qi.computeActualEllipsoidPosition(n,vy,vy);let s=e._boundingSphere.radius,a=YYe(vy,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 VYe(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 HYe=new Z(1,0,0,0,0,1,0,-1,0);function GYe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=xYe,s=yYe;if(s=O.multiply(o.uniformState.view3D,i,s),r=O.getRotation(s,r),r=Z.transpose(r,r),e._iblReferenceFrameMatrix=Z.multiply(HYe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=bYe;a=O.multiply(o.uniformState.view3D,i,a),a=O.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=O.inverseTranspose(a,e._clippingPlanesMatrix)}}function jYe(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 WYe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=_t.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=_t.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=_t.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function qYe(e,t){let n=KYe(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&&($Ye(e,t),e._sceneGraph.pushDrawCommands(t))}var D7=new re;function YYe(e,t,n){return D7.center=e,D7.radius=t,n.camera.getPixelSize(D7,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var k3=new h;function $le(e,t,n){return function(i){LC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,k3);let o=e._clampedModelMatrix;O.clone(e.modelMatrix,o),o[12]=k3.x,o[13]=k3.y,o[14]=k3.z,e._heightDirty=!0}}var XYe=new h;function KYe(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===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=O.getTranslation(e.modelMatrix,XYe);qi.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function $Ye(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}uo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};uo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Jle(e){return e.context.stencilBuffer}uo.prototype.hasSilhouette=function(e){return Jle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};uo.prototype.hasSkipLevelOfDetail=function(e){if(!vr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};uo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};uo.prototype.pick=function(e,t,n,i,o){return ZI(this,e,t,n,i,o)};uo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};uo.prototype.isDestroyed=function(){return!1};uo.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,ce(this)};uo.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};uo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};uo.fromGltfAsync=async function(e){e=e??G.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=Ee.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=Ee.createIfNeeded(t);let r=new Am(n),a=l(e.content)?vr.TILE_GLTF:vr.GLTF,c=n.gltfResource,u=QI(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(_){throw r.destroy(),Jt.getError("model",c,_)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new uo(u),p=d._resource.credits;if(l(p)){let _=p.length;for(let m=0;m<_;m++)d._resourceCredits.push(_t.clone(p[m]))}return d};uo.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 Y2(t);try{await n.load();let i=QI(n,vr.TILE_B3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new B3(t);try{await n.load();let i=QI(n,vr.TILE_PNTS,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.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 eB(t);try{await n.load();let i=QI(n,vr.TILE_I3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new K2(t),i=QI(n,vr.TILE_GEOJSON,e);return new uo(i)};var ZYe=new H;uo.prototype.applyColorAndShow=function(e){let t=H.clone(this._color,ZYe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):H.clone(H.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,R7(t,this._color)&&this.resetDrawCommands()};uo.prototype.applyStyle=function(e){let t=this.type===vr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Zle(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function QI(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var wm=uo;function Gr(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(Gr.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}}});Gr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Gr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Gr.prototype.getExtension=function(e){return this._model.getExtension(e)};Gr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Gr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Gr.prototype.applyDebugSettings=function(e,t){t=e?t:H.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Gr.prototype.applyStyle=function(e){this._model.style=e};Gr.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:vu.REPEAT}),this._ready=!0)};Gr.prototype.isDestroyed=function(){return!1};Gr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ce(this)};Gr.fromGltf=async function(e,t,n,i){let o=new Gr(e,t,n),s=JI(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await wm.fromGltfAsync(s);return o._model=c,o};Gr.fromB3dm=async function(e,t,n,i,o){let r=new Gr(e,t,n),a=JI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await wm.fromB3dm(a);return r._model=u,r};Gr.fromI3dm=async function(e,t,n,i,o){let r=new Gr(e,t,n),a=JI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await wm.fromI3dm(a);return r._model=c,r};Gr.fromPnts=async function(e,t,n,i,o){let r=new Gr(e,t,n),a=JI(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await wm.fromPnts(a);return r._model=c,r};Gr.fromGeoJson=async function(e,t,n,i){let o=new Gr(e,t,n),s=JI(e,t,o,{geoJson:i,resource:n}),a=await wm.fromGeoJson(s);return o._model=a,o};Gr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,te.WGS84,n)};function JI(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Se.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return ct(i,o)}var zf=Gr;function Vf(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(Vf.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}}});Vf.fromJson=function(e,t,n,i){let o=new Vf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Vf.prototype.hasProperty=function(e,t){return!1};Vf.prototype.getFeature=function(e){};Vf.prototype.applyDebugSettings=function(e,t){};Vf.prototype.applyStyle=function(e){};Vf.prototype.update=function(e,t){};Vf.prototype.pick=function(e,t,n){};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return ce(this)};var U3=Vf;var z3=`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 V3=`#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 QYe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ps=QYe;function p_(e){this._billboardCollection=e,this._id=void 0,this._loadState=ps.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(p_.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ps.LOADED}},hasImage:{get:function(){return this._loadState!==ps.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});p_.prototype.unload=async function(){this._loadState!==ps.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ps.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};p_.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===ps.LOADING||t.loadState===ps.LOADED){p_.clone(o,this);return}l(o)||(o=new p_(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ps.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=ps.ERROR,o._loadError=c,this._id!==e)return;this._loadState=ps.ERROR,this._loadError=c;return}if(!l(r)||r===-1){if(o._loadState=ps.FAILED,o._index=-1,this._id!==e)return;this._loadState=ps.FAILED,this._index=-1;return}o._index=r,o._loadState=ps.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ps.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};p_.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ps.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=ps.ERROR,this._loadError=o;return}if(!l(n)||n===-1){this._loadState=ps.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=ps.LOADED,this.dirty=!0};p_.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};p_.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 wy=p_;function pi(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Vt.clone(o)),l(r)&&(r=Mt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=V.clone(e.pixelOffset??V.ZERO),this._translate=new V(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??$e.NONE,this._verticalOrigin=e.verticalOrigin??Bn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Ei.CENTER,this._scale=e.scale??1,this._color=H.clone(e.color??H.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.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 wy(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=Nn()),this._imageTexture.loadImage(a,s)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=H.clone(e.outlineColor??H.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Jr.NONE}var eue=pi.SHOW_INDEX=0,G3=pi.POSITION_INDEX=1,rue=pi.PIXEL_OFFSET_INDEX=2,JYe=pi.EYE_OFFSET_INDEX=3,eXe=pi.HORIZONTAL_ORIGIN_INDEX=4,tXe=pi.VERTICAL_ORIGIN_INDEX=5,nXe=pi.SCALE_INDEX=6,tue=pi.IMAGE_INDEX_INDEX=7,nue=pi.COLOR_INDEX=8,iXe=pi.ROTATION_INDEX=9,oXe=pi.ALIGNED_AXIS_INDEX=10,rXe=pi.SCALE_BY_DISTANCE_INDEX=11,sXe=pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,aXe=pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,cXe=pi.DISTANCE_DISPLAY_CONDITION=14,lXe=pi.DISABLE_DEPTH_DISTANCE=15;pi.TEXTURE_COORDINATE_BOUNDS=16;var iue=pi.SDF_INDEX=17,uXe=pi.SPLIT_DIRECTION_INDEX=18;pi.NUMBER_OF_PROPERTIES=19;function er(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(pi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,er(this,eue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),er(this,G3))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),er(this,G3))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;V.equals(t,e)||(V.clone(e,t),er(this,rue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Vt.equals(t,e)||(this._scaleByDistance=Vt.clone(e,t),er(this,rXe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Vt.equals(t,e)||(this._translucencyByDistance=Vt.clone(e,t),er(this,sXe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Vt.equals(t,e)||(this._pixelOffsetScaleByDistance=Vt.clone(e,t),er(this,aXe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),er(this,JYe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,er(this,eXe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,er(this,tXe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,er(this,nXe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),er(this,nue))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,er(this,iXe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),er(this,oXe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,er(this,tue))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,er(this,tue))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,er(this,nue))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),er(this,cXe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,er(this,lXe))}},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 Ee?t=e._url:l(e.src)?t=e.src:t=Nn(),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=h.clone(e,this._actualClampedPosition),er(this,G3)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,er(this,eue))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),er(this,iue))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,er(this,iue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,er(this,uXe))}}});pi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};pi.prototype._updateClamping=function(){pi._updateClamping(this._billboardCollection,this)};var j3=new fe;pi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===$e.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===$e.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);LC(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,j3);let c=n.getHeight(s,t._heightReference);l(c)&&(j3.height=c),a(j3)};pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};pi.prototype.setImage=function(e,t){this._imageTexture.loadImage(e,t)};pi.prototype.setImageTexture=function(e){wy.clone(e,this._imageTexture)};pi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};pi.prototype._setTranslate=function(e){let t=this._translate;V.equals(t,e)||(V.clone(e,t),er(this,rue))};pi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};pi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),er(this,G3)};var oue=new ie;pi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(O.multiplyByPoint(i,t,oue),qi.computeActualEllipsoidPosition(n,oue))};var sue=new h;pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=O.multiplyByPoint(e,t,sue),a=qi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return V.add(a,i,a),a};var H3=new V(0,0);pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new V),V.clone(this._pixelOffset,H3),V.add(H3,this._translate,H3);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,j3);o=a.cartographicToCartesian(c,sue),i=O.IDENTITY}return pi._computeScreenSpacePosition(i,o,this._eyeOffset,H3,e,t)};pi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===Ei.RIGHT?s-=i:e.horizontalOrigin===Ei.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?a-=o:e.verticalOrigin===Bn.CENTER&&(a-=o*.5),l(n)||(n=new Xe),n.x=s,n.y=a,n.width=i,n.height=o,n};pi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&H.equals(this._color,e._color)&&V.equals(this._pixelOffset,e._pixelOffset)&&V.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};pi.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 po=pi;var fXe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},No=Object.freeze(fXe);var dXe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},xa=Object.freeze(dXe);var hXe=po.SHOW_INDEX,eP=po.POSITION_INDEX,aue=po.PIXEL_OFFSET_INDEX,cue=po.EYE_OFFSET_INDEX,mXe=po.HORIZONTAL_ORIGIN_INDEX,pXe=po.VERTICAL_ORIGIN_INDEX,_Xe=po.SCALE_INDEX,_b=po.IMAGE_INDEX_INDEX,lue=po.COLOR_INDEX,gXe=po.ROTATION_INDEX,yXe=po.ALIGNED_AXIS_INDEX,uue=po.SCALE_BY_DISTANCE_INDEX,fue=po.TRANSLUCENCY_BY_DISTANCE_INDEX,due=po.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,hue=po.DISTANCE_DISPLAY_CONDITION,xXe=po.DISABLE_DEPTH_DISTANCE,bXe=po.TEXTURE_COORDINATE_BOUNDS,mue=po.SDF_INDEX,pue=po.SPLIT_DIRECTION_INDEX,k7=po.NUMBER_OF_PROPERTIES,fo,TXe={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},CXe={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 Gf(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new MC),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(k7),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??No.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=H.clone(H.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(Gf.prototype,{length:{get:function(){return U7(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 _ue(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Gf.prototype.add=function(e){let t=new po(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Gf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Gf.prototype.removeAll=function(){_ue(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function U7(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}}Gf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Gf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Gf.prototype.get=function(e){return U7(this),this._billboards[e]};var O7;function AXe(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=st.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function EXe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=st.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function SXe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=st.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Gf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<k7;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function vXe(e,t,n,i,o,r){let s=[{index:fo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[eP]},{index:fo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[eP]},{index:fo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[aue]},{index:fo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[fue]},{index:fo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[lue]},{index:fo.eyeOffset,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[cue]},{index:fo.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[uue]},{index:fo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[due]},{index:fo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[hue]},{index:fo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[bXe]},{index:fo.splitDirection,componentsPerAttribute:1,componentDatatype:K.FLOAT,usage:n[pue]}];i&&s.push({index:fo.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:SXe(e)}),l(o)&&s.push({index:fo.a_batchId,componentsPerAttribute:1,componentDatatype:K.FLOAT,bufferUsage:Ne.STATIC_DRAW}),r&&s.push({index:fo.sdf,componentsPerAttribute:2,componentDatatype:K.FLOAT,usage:n[mue]});let a=i?t:4*t;return new Ig(e,s,a,i)}var M7=new Gn;function gue(e,t,n,i){let o,r=n[fo.positionHighAndScale],s=n[fo.positionLowAndRotation],a=i._getActualPosition();e._mode===ne.SCENE3D&&(re.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(a,M7);let c=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);let f=M7.high,d=M7.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,c),s(o,d.x,d.y,d.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,c),r(o+1,f.x,f.y,f.z,c),r(o+2,f.x,f.y,f.z,c),r(o+3,f.x,f.y,f.z,c),s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u))}var Kl=new V,Hf=32768,XA=65536,L7=4096,Im=256,wXe=128,IXe=32,PXe=8,yue=4,DXe=1/256,xue=0,bue=2,Tue=3,Cue=1,z7=new Xe;function Aue(e,t,n,i){let o,r=n[fo.compressedAttribute0],s=i.pixelOffset,a=s.x,c=s.y,u=i._translate,f=u.x,d=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-c+d));let p=i.horizontalOrigin,_=i._verticalOrigin,m=i.show&&i.clusterShow;i.color.alpha===0&&(m=!1),_===Bn.BASELINE&&(_=Bn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===Ei.CENTER,e._allVerticalCenter=e._allVerticalCenter&&_===Bn.CENTER;let y=0,x=0,b=0,T=0;if(i.ready){let N=i.computeTextureCoordinates(z7);y=N.x,x=N.y,b=N.width,T=N.height}let C=y+b,A=x+T,S=Math.floor(P.clamp(a,-Hf,Hf)+Hf)*wXe;S+=(p+1)*IXe,S+=(_+1)*PXe,S+=(m?1:0)*yue;let w=Math.floor(P.clamp(c,-Hf,Hf)+Hf)*Im,R=Math.floor(P.clamp(f,-Hf,Hf)+Hf)*Im,D=(P.clamp(d,-Hf,Hf)+Hf)*DXe,M=Math.floor(D),L=Math.floor((D-M)*Im);w+=M,R+=L,Kl.x=y,Kl.y=x;let g=Mn.compressTextureCoordinates(Kl);Kl.x=C;let E=Mn.compressTextureCoordinates(Kl);Kl.y=A;let v=Mn.compressTextureCoordinates(Kl);Kl.x=y;let I=Mn.compressTextureCoordinates(Kl);e._instanced?(o=i._index,r(o,S,w,R,g)):(o=i._index*4,r(o+0,S+xue,w,R,g),r(o+1,S+bue,w,R,E),r(o+2,S+Tue,w,R,v),r(o+3,S+Cue,w,R,I))}function Eue(e,t,n,i){let o,r=n[fo.compressedAttribute1],s=i.alignedAxis;h.equals(s,h.ZERO)||(e._shaderAlignedAxis=!0);let a=0,c=1,u=1,f=1,d=i.translucencyByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let _=P.clamp(p,0,XA),m=0;Math.abs(h.magnitudeSquared(s)-1)<P.EPSILON6&&(m=Mn.octEncodeFloat(s)),c=P.clamp(c,0,1),c=c===1?255:c*255|0,_=_*Im+c,f=P.clamp(f,0,1),f=f===1?255:f*255|0,m=m*Im+f,e._instanced?(o=i._index,r(o,_,m,a,u)):(o=i._index*4,r(o+0,_,m,a,u),r(o+1,_,m,a,u),r(o+2,_,m,a,u),r(o+3,_,m,a,u))}function F7(e,t,n,i){let o,r=n[fo.compressedAttribute2],s=i.color,a=l(e._batchTable)?H.WHITE:i.getPickId(t.context).color,c=i.sizeInMeters?1:0,u=Math.abs(h.magnitudeSquared(i.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&c===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let d=i._labelHorizontalOrigin??-2;d+=2;let p=f*yue+d,_=H.floatToByte(s.red),m=H.floatToByte(s.green),y=H.floatToByte(s.blue),x=_*XA+m*Im+y;_=H.floatToByte(a.red),m=H.floatToByte(a.green),y=H.floatToByte(a.blue);let b=_*XA+m*Im+y,T=H.floatToByte(s.alpha)*XA+H.floatToByte(a.alpha)*Im;T+=c*2+u,e._instanced?(o=i._index,r(o,x,b,T,p)):(o=i._index*4,r(o+0,x,b,T,p),r(o+1,x,b,T,p),r(o+2,x,b,T,p),r(o+3,x,b,T,p))}function B7(e,t,n,i){let o,r=n[fo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==$e.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(Kl.x=0,Kl.y=0,i.ready){let u=i.computeTextureCoordinates(z7);Kl.x=u.width,Kl.y=u.height}let c=Mn.compressTextureCoordinates(Kl);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 Sue(e,t,n,i){let o,r=n[fo.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function vue(e,t,n,i){let o,r=n[fo.pixelOffsetScaleByDistance],s=0,a=1,c=1,u=1,f=i.pixelOffsetScaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,c,u)):(o=i._index*4,r(o+0,s,a,c,u),r(o+1,s,a,c,u),r(o+2,s,a,c,u),r(o+3,s,a,c,u))}function wue(e,t,n,i){let o,r=n[fo.compressedAttribute3],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance,f=Sf(i.heightReference)&&t.context.depthTexture;l(u)||(u=f?5e3:0),u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d,p;l(i._labelDimensions)?(p=i._labelDimensions.x,d=i._labelDimensions.y):(p=i.width??0,d=i.height??0);let _=Math.floor(P.clamp(p,0,L7)),m=Math.floor(P.clamp(d,0,L7)),y=_*L7+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function Iue(e,t,n,i){if(Sf(i.heightReference)){let p=e._scene,_=t.context,m=t.globeTranslucencyState.translucent,y=l(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=_.depthTexture&&!m&&y}let o,r=n[fo.textureCoordinateBoundsOrLabelTranslate];if(Lt.maximumVertexTextureImageUnits>0){let p=0,_=0;l(i._labelTranslate)&&(p=i._labelTranslate.x,_=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,_,0,0)):(o=i._index*4,r(o+0,p,_,0,0),r(o+1,p,_,0,0),r(o+2,p,_,0,0),r(o+3,p,_,0,0));return}let s=0,a=0,c=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(z7);s=p.x,a=p.y,c=p.width,u=p.height}let f=s+c,d=a+u;e._instanced?(o=i._index,r(o,s,a,f,d)):(o=i._index*4,r(o+0,s,a,f,d),r(o+1,s,a,f,d),r(o+2,s,a,f,d),r(o+3,s,a,f,d))}function RXe(e,t,n,i){if(!l(e._batchTable))return;let o=n[fo.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 Pue(e,t,n,i){if(!e._sdf)return;let o,r=n[fo.sdf],s=i.outlineColor,a=i.outlineWidth,c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue),d=c*XA+u*Im+f,p=a/xa.RADIUS,_=H.floatToByte(s.alpha)*XA+H.floatToByte(p)*Im;e._instanced?(o=i._index,r(o,d,_)):(o=i._index*4,r(o+0,d+xue,_),r(o+1,d+bue,_),r(o+2,d+Tue,_),r(o+3,d+Cue,_))}function Due(e,t,n,i){let o=n[fo.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 OXe(e,t,n,i){gue(e,t,n,i),Aue(e,t,n,i),Eue(e,t,n,i),F7(e,t,n,i),B7(e,t,n,i),Sue(e,t,n,i),vue(e,t,n,i),wue(e,t,n,i),Iue(e,t,n,i),RXe(e,t,n,i),Pue(e,t,n,i),Due(e,t,n,i)}function N7(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=po._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):re.expand(s,d,s))}r&&re.fromPoints(a,s)}function MXe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!O.equals(r,e.modelMatrix)?(e._mode=n,O.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&N7(e,i,i.length,t,r,!0)):n===ne.MORPHING?N7(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&N7(e,o,e._billboardsToUpdateIndex,t,r,!1)}function LXe(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 NXe(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=Se.OVERLAY,i}var FXe=[];Gf.prototype.update=function(e){if(U7(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,fo=this._instanced?CXe:TXe,O7=this._instanced?EXe:AXe;let n=this._billboards,i=n.length,o=!0;for(let D=0;D<i;++D){let M=n[D];l(M.loadError)&&(console.error(`Error loading image for billboard: ${M.loadError}`),M.image=void 0),M.textureDirty&&this._updateBillboard(M,_b),M.show&&(o=o&&M.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;MXe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,_=p.pick;if(f||!_&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let D=0;D<k7;++D)c[D]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=vXe(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let D=0;D<i;++D){let M=this._billboards[D];M._dirty=!1,M.textureDirty=!1,OXe(this,e,d,M)}this._vaf.commit(O7(t))}this._billboardsToUpdateIndex=0}else if(a>0){let D=FXe;D.length=0,(c[eP]||c[gXe]||c[_Xe])&&D.push(gue),(c[_b]||c[aue]||c[mXe]||c[pXe]||c[hXe])&&(D.push(Aue),this._instanced&&D.push(B7)),(c[_b]||c[yXe]||c[fue])&&(D.push(Eue),D.push(F7)),(c[_b]||c[lue])&&D.push(F7),(c[_b]||c[cue])&&D.push(B7),c[uue]&&D.push(Sue),c[due]&&D.push(vue),(c[hue]||c[xXe]||c[_b]||c[eP])&&D.push(wue),(c[_b]||c[eP])&&D.push(Iue),c[mue]&&D.push(Pue),c[pue]&&D.push(Due);let M=D.length;if(d=this._vaf.writers,a/i>.1){for(let L=0;L<a;++L){let g=s[L];g._dirty=!1,g.textureDirty=!1;for(let E=0;E<M;++E)D[E](this,e,d,g)}this._vaf.commit(O7(t))}else{for(let L=0;L<a;++L){let g=s[L];g._dirty=!1,g.textureDirty=!1;for(let E=0;E<M;++E)D[E](this,e,d,g);this._instanced?this._vaf.subCommit(g._index,1):this._vaf.subCommit(g._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,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=O.IDENTITY;e.mode===ne.SCENE3D?(y=this.modelMatrix,m=re.clone(this._baseVolumeWC,this._boundingVolume)):m=re.clone(this._baseVolume2D,this._boundingVolume),LXe(this,e,m);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===No.OPAQUE||this._blendOption===No.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:q.LESS},depthMask:!0}):this._rsOpaque=void 0;let D=this._blendOption===No.TRANSLUCENT;this._blendOption===No.TRANSLUCENT||this._blendOption===No.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:D?q.LEQUAL:q.LESS},depthMask:D,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,T,C,A,S,w=Lt.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){b=V3,T=z3,S=[],l(this._batchTable)&&(S.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),T=this._batchTable.getFragmentShaderCallback(!1,void 0)(T)),C=new Be({defines:S,sources:[b]}),this._instanced&&C.defines.push("INSTANCED"),this._shaderRotation&&C.defines.push("ROTATION"),this._shaderAlignedAxis&&C.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&C.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&C.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&C.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&C.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&C.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(w?C.defines.push("VERTEX_DEPTH_CHECK"):C.defines.push("FRAGMENT_DEPTH_CHECK"));let D=1-xa.CUTOFF;this._sdf&&C.defines.push("SDF");let M=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===No.OPAQUE_AND_TRANSLUCENT&&(A=new Be({defines:["OPAQUE",M],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${D}`)),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:fo}),A=new Be({defines:["TRANSLUCENT",M],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${D}`)),this._spTranslucent=Xt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:fo})),this._blendOption===No.OPAQUE&&(A=new Be({defines:[M],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${D}`)),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:fo})),this._blendOption===No.TRANSLUCENT&&(A=new Be({defines:[M],sources:[T]}),this._shaderClampToGround&&(w?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(A.defines.push("SDF"),A.defines.push(`SDF_EDGE ${D}`)),this._spTranslucent=Xt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:fo})),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 R=e.commandList;if(p.render||p.pick){let D=this._colorCommands,M=this._blendOption===No.OPAQUE,L=this._blendOption===No.OPAQUE_AND_TRANSLUCENT,g=this._vaf.va,E=g.length,v=this._uniforms,I;l(this._batchTable)?(v=this._batchTable.getUniformMapCallback()(v),I=this._batchTable.getPickId()):I="v_pickColor",D.length=E;let N=L?E*2:E;for(let F=0;F<N;++F){let U=D[F];l(U)||(U=D[F]=new qe);let k=M||L&&F%2===0;U.pass=k||!L?Se.OPAQUE:Se.TRANSLUCENT,U.owner=this;let z=L?Math.floor(F/2):F;U.boundingVolume=m,U.modelMatrix=y,U.count=g[z].indicesCount,U.shaderProgram=k?this._sp:this._spTranslucent,U.uniformMap=v,U.vertexArray=g[z].va,U.renderState=k?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=I,this._instanced&&(U.count=6,U.instanceCount=i),R.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=NXe(this,e.context)),R.push(this.debugCommand))}this._allBillboardsReady=o};Gf.prototype.isDestroyed=function(){return!1};Gf.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(),_ue(this._billboards),ce(this)};var jf=Gf;function BXe(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 KA=BXe;function ba(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),$A(this)}var kXe=new fe;Object.defineProperties(ba.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=H.clone(e,this._color),$A(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,$A(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=H.clone(e,this._pointOutlineColor),$A(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,$A(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,kXe);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=H.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&&$A(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ba.defaultColor=H.WHITE;ba.defaultPointOutlineColor=H.BLACK;ba.defaultPointOutlineWidth=0;ba.defaultPointSize=8;function $A(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??ba.defaultColor,i=e._pointOutlineColor??ba.defaultPointOutlineColor,o=e._pointOutlineWidth??ba.defaultPointOutlineWidth,r=e._pointSize??ba.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(H.equals(n,s)&&H.equals(i,a)&&o===c&&r===u)return;e._billboardColor=H.clone(n,e._billboardColor),e._billboardOutlineColor=H.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),_=JSON.stringify([d,r,p,o]);t.setImage(_,KA(f,d,p,o,r))}ba.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ba.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ba.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ba.prototype.getPropertyInherited=function(e){return ma.getPropertyInherited(this._content,this._batchId,e)};ba.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ba.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ba.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ba.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Iy=ba;function UXe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let _=c.getContext("2d");_.font=n,_.fillStyle="white",_.fillRect(0,0,c.width+1,c.height+1),i&&(_.strokeStyle="black",_.lineWidth=e.lineWidth,_.strokeText(t,u/2,p)),o&&(_.fillStyle="black",_.fillText(t,u/2,p));let m=_.getImageData(0,0,f,d).data,y=m.length,x=f*4,b,T,C,A;for(b=0;b<y;++b)if(m[b]!==255){C=b/x|0;break}for(b=y-1;b>=0;--b)if(m[b]!==255){A=b/x|0;break}let S=-1;for(b=0;b<f&&S===-1;++b)for(T=0;T<d;++T){let w=b*4+T*x;if(m[w]!==255||m[w+1]!==255||m[w+2]!==255||m[w+3]!==255){S=b;break}}return{width:r.width,height:A-C,ascent:p-C,descent:A-p,minx:S-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var gb;function zXe(e,t){if(e==="")return;t=t??G.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??H.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(gb)||(l(f.imageSmoothingEnabled)?gb="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?gb="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?gb="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(gb="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[gb]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=UXe(f,e,n,i,o);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,_=Math.ceil(d.width)+p+c,m=d.height+c,y=m-d.ascent+a,x=m-y+c;if(u.width=_,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[gb]=!1,s!==H.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let b=t.strokeColor??H.BLACK;f.strokeStyle=b.toCssColorString(),f.strokeText(e,p+a,x)}if(o){let b=t.fillColor??H.WHITE;f.fillStyle=b.toCssColorString(),f.fillText(e,p+a,x)}return u}var ZA=zXe;var Hue=$r(Lue(),1);var HXe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},tr=Object.freeze(HXe);var Nue={},Fue=0,GXe=256,jXe=new H(.165,.165,.165,.8),WXe=new V(7,5),_s=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function yb(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function nP(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function iP(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function kue(e){let t=Nue[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(iP(n,"line-height"));isNaN(i)&&(i=void 0),t={family:iP(n,"font-family"),size:iP(n,"font-size").replace("px",""),style:iP(n,"font-style"),weight:iP(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Fue<GXe&&(Nue[e._font]=t,Fue++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Zd(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Vt.clone(o)),l(r)&&(r=Mt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=H.clone(e.fillColor??H.WHITE),this._outlineColor=H.clone(e.outlineColor??H.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=H.clone(e.backgroundColor??jXe),this._backgroundPadding=V.clone(e.backgroundPadding??WXe),this._style=e.style??tr.FILL,this._verticalOrigin=e.verticalOrigin??Bn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Ei.LEFT,this._pixelOffset=V.clone(e.pixelOffset??V.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??$e.NONE,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,kue(this),this._updateClamping()}Object.defineProperties(Zd.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(!h.equals(t,e)){h.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),nP(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Zd.filterUnsupportedCharacters(e);this._renderedText=Zd.enableRightToLeftDetection?ZXe(t):t,yb(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,yb(this),kue(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;H.equals(t,e)||(H.clone(e,t),yb(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),yb(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,yb(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,yb(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!H.equals(t,e)){H.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;V.equals(t,e)||(V.clone(e,t),nP(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,yb(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!V.equals(t,e)){V.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(!Vt.equals(t,e)){this._translucencyByDistance=Vt.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(!Vt.equals(t,e)){this._pixelOffsetScaleByDistance=Vt.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(!Vt.equals(t,e)){this._scaleByDistance=Vt.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(!h.equals(t,e)){h.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,nP(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),nP(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),nP(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.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)}}}});Zd.prototype._updateClamping=function(){po._updateClamping(this._labelCollection,this)};Zd.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new V);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return po._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Zd.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===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?o-=s:e.verticalOrigin===Bn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let _=0;_<p;++_){let m=d[_],y=m.billboard;if(!l(y))continue;let x=t.x+y._translate.x,b=t.y-y._translate.y,T=m.dimensions.width*a,C=m.dimensions.height*a;e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?b-=C:e.verticalOrigin===Bn.CENTER&&(b-=C*.5),e._verticalOrigin===Bn.TOP?b+=xa.PADDING*a:(e._verticalOrigin===Bn.BOTTOM||e._verticalOrigin===Bn.BASELINE)&&(b-=xa.PADDING*a),i=Math.min(i,x),o=Math.min(o,b),u=Math.max(u,x+T),f=Math.max(f,b+C)}r=u-i,s=f-o}return l(n)||(n=new Xe),n.x=i,n.y=o,n.width=r,n.height=s,n};Zd.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Zd.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&&h.equals(this._position,e._position)&&H.equals(this._fillColor,e._fillColor)&&H.equals(this._outlineColor,e._outlineColor)&&H.equals(this._backgroundColor,e._backgroundColor)&&V.equals(this._backgroundPadding,e._backgroundPadding)&&V.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Zd.prototype.isDestroyed=function(){return!1};Zd.enableRightToLeftDetection=!1;function qXe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=_s.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=_s.RTL:n.test(f)?a=_s.LTR:i.test(f)?a=_s.BRACKETS:a=_s.WEAK,u===0&&(s=a),s===a&&a!==_s.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function YXe(e){return e.split("").reverse().join("")}function oP(e,t,n){return e.slice(0,t)+n+e.slice(t)}function XXe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var KXe="\u05D0-\u05EA",$Xe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Bue=new RegExp(`[${KXe}${$Xe}]`);function ZXe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Bue.test(o.charAt(0)),s=qXe(o,Bue),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===_s.BRACKETS?XXe(f.Word):YXe(f.Word);r?f.Type===_s.RTL?(c=d+c,a=0):f.Type===_s.LTR?(c=oP(c,a,f.Word),a+=f.Word.length):(f.Type===_s.WEAK||f.Type===_s.BRACKETS)&&(f.Type===_s.WEAK&&s[u-1].Type===_s.BRACKETS?c=d+c:s[u-1].Type===_s.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===_s.RTL?(c=d+c,a=0):(c=oP(c,a,f.Word),a+=f.Word.length):c=oP(c,0,d)):f.Type===_s.RTL?c=oP(c,a,d):f.Type===_s.LTR?(c+=f.Word,a=c.length):(f.Type===_s.WEAK||f.Type===_s.BRACKETS)&&(u>0&&s[u-1].Type===_s.RTL?s.length>u+1?s[u+1].Type===_s.RTL?c=oP(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var xb=Zd;var Gue=$r(Uue(),1);function JXe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var eKe=1.2,zue="ID_WHITE_PIXEL",V7=new V(4,4),tKe=new Xe(1,1,1,1);function nKe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=V7.x,o.height=V7.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(zue,o),n.addImageSubRegion(zue,tKe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var __={};function iKe(e,t,n,i,o,r){return __.font=t,__.fillColor=n,__.strokeColor=i,__.strokeWidth=o,__.padding=xa.PADDING,__.fill=r===tr.FILL||r===tr.FILL_AND_OUTLINE,__.stroke=r===tr.OUTLINE||r===tr.FILL_AND_OUTLINE,__.backgroundColor=H.BLACK,ZA(e,__)}function H7(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 oKe=new Gue.default,rKe=/\s/;function sKe(e,t){let n=t._renderedText,i=oKe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/xa.FONT_SIZE,o<s)for(let _=o;_<s;++_)H7(e,r[_]);r.length=o;let a=t.show&&t._showBackground&&n.split(` -`).join("").length>0,c=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(l(c)||(c=nKe(u,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=Ei.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)&&(u.remove(c),t._backgroundBillboard=c=void 0);let f=e._glyphBillboardCollection,d=f.billboardTextureCache,p=e._textDimensionsCache;for(let _=0;_<o;++_){let m=i[_],y=t._verticalOrigin,x=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+y]),b=p[x],T=d.get(x);if(!l(T)||!l(b)){T=new wy(f),d.set(x,T);let w=`${t._fontStyle} ${t._fontWeight} ${xa.FONT_SIZE}px ${t._fontFamily}`,R=iKe(m,w,H.WHITE,H.WHITE,0,tr.FILL);if(b=R.dimensions,p[x]=b,R.width>0&&R.height>0&&!rKe.test(m)){let D=(0,Hue.default)(R,{cutoff:xa.CUTOFF,radius:xa.RADIUS}),M=R.getContext("2d"),L=R.width,g=R.height,E=M.getImageData(0,0,L,g);for(let v=0;v<L;v++)for(let I=0;I<g;I++){let N=I*L+v,F=D[N]*255,U=N*4;E.data[U+0]=F,E.data[U+1]=F,E.data[U+2]=F,E.data[U+3]=F}M.putImageData(E,0,0),T.loadImage(x,R)}}let C=r[_];if(l(C)||(C=new JXe,C.dimensions=b,C.billboardTexture=T,r[_]=C),C.billboardTexture.id!==x&&(C.billboardTexture=T,C.dimensions=b),!T.hasImage){H7(e,C);continue}let A=C.billboard,S=e._spareBillboards;l(A)||(S.length>0?A=S.pop():(A=f.add({collection:e}),A._labelDimensions=new V,A._labelTranslate=new V),C.billboard=A),A.setImageTexture(T),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=Ei.LEFT,A.verticalOrigin=t._verticalOrigin,A.heightReference=t._heightReference,A.scale=t.totalScale,A.pickPrimitive=t,A.id=t._id,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,A.scaleByDistance=t._scaleByDistance,A.distanceDisplayCondition=t._distanceDisplayCondition,A.disableDepthTestDistance=t._disableDepthTestDistance,A._batchIndex=t._batchIndex,A.outlineColor=t.outlineColor,t.style===tr.FILL_AND_OUTLINE?(A.color=t._fillColor,A.outlineWidth=t.outlineWidth):t.style===tr.FILL?(A.color=t._fillColor,A.outlineWidth=0):t.style===tr.OUTLINE&&(A.color=H.TRANSPARENT,A.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Vue(e,t,n){return t===Ei.CENTER?-e/2:t===Ei.RIGHT?-(e+n.x):n.x}var mr=new V,aKe=new V;function cKe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=V.clone(l(f)?e._backgroundPadding:V.ZERO,aKe);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let M=0;M<u;++M){if(n.charAt(M)===` -`){r.push(i),++c,i=0;continue}let g=t[M].dimensions;l(g)&&(a=Math.max(a,g.height-g.descent),s=Math.max(s,g.descent),i+=g.width-g.minx,M<u-1&&(i+=t[M+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,_=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,x=0,b=r[x],T=Vue(b,m,d),C=(l(e._lineHeight)?e._lineHeight:eKe*e._fontSize)/e._relativeSize,A=C*(c-1),S=o,w=p+A;l(f)&&(S+=d.x*2,w+=d.y*2,f._labelHorizontalOrigin=m),mr.x=T*_,mr.y=0;let R=!0,D=0;for(let M=0;M<u;++M){if(n.charAt(M)===` -`){++x,D+=C,b=r[x],T=Vue(b,m,d),mr.x=T*_,R=!0;continue}let L=t[M],g=L.dimensions;if(l(g)&&(y===Bn.TOP?(mr.y=g.height-a-d.y,mr.y+=xa.PADDING):y===Bn.CENTER?mr.y=(A+g.height-a)/2:y===Bn.BASELINE?(mr.y=A,mr.y-=xa.PADDING):(mr.y=A+s+d.y,mr.y-=xa.PADDING),mr.y=(mr.y-g.descent-D)*_,R&&(mr.x-=xa.PADDING*_,R=!1),l(L.billboard)&&(L.billboard._setTranslate(mr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=w,L.billboard._labelHorizontalOrigin=m),M<u-1)){let E=t[M+1];mr.x+=(g.width-g.minx+E.dimensions.minx)*_}}if(l(f)&&n.split(` -`).join("").length>0&&(m===Ei.CENTER?T=-o/2-d.x:m===Ei.RIGHT?T=-(o+d.x*2):T=0,mr.x=T*_,y===Bn.TOP?mr.y=p-a-s:y===Bn.CENTER?mr.y=(p-a)/2-s:y===Bn.BASELINE?mr.y=-d.y-s:mr.y=0,mr.y=mr.y*_,f.width=S,f.height=w,f._setTranslate(mr),f._labelTranslate=V.clone(mr,f._labelTranslate)),Sf(e.heightReference))for(let M=0;M<u;++M){let g=t[M].billboard;l(g)&&(g._labelTranslate=V.clone(mr,g._labelTranslate))}}function jue(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)H7(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ce(t)}function Pm(e){e=e??G.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new jf({scene:this._scene,textureAtlas:new MC({initialSize:V7})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new wy(t),this._glyphBillboardCollection=new jf({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=H.clone(H.WHITE),this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??No.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Pm.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}}});Pm.prototype.add=function(e){let t=new xb(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Pm.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),jue(this,e),!0}return!1};Pm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)jue(this,e[t]);e.length=0};Pm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Pm.prototype.get=function(e){return this._labels[e]};Pm.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&&(sKe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(cKe(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?No.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)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ce(this)};var g_=Pm;var q3=`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 cl={};cl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};cl.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 lKe=new fe;cl.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,lKe).height}return i};var uKe=new O,fKe=new h,Wue=new h,dKe=new en(h.UNIT_X,0),que=new h,hKe=new en(h.UNIT_X,0),mKe=new h,pKe=new h,j7=[];function Xue(e,t,n){let i=j7;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 X3=new fe,Y3=new fe,Py=new h,W7=new h,_Ke=new h,G7=new Mg,rP=new _c;function gKe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,W7),u=i.scaleToGeodeticSurface(t,_Ke),f=cl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,X3),p=i.cartesianToCartographic(u,Y3),_=Xue(f,o,r);G7.setEndPoints(d,p);let m=G7.surfaceDistance/f,y=a;d.height=o;let x=i.cartographicToCartesian(d,Py);h.pack(x,s,y),y+=3;for(let b=1;b<f;b++){let T=G7.interpolateUsingSurfaceDistance(b*m,Y3);T.height=_[b],x=i.cartographicToCartesian(T,Py),h.pack(x,s,y),y+=3}return y}function yKe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,X3),u=i.cartesianToCartographic(t,Y3),f=cl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Xue(f,o,r);rP.ellipsoid.equals(i)||(rP=new _c(void 0,void 0,i)),rP.setEndPoints(c,u);let p=rP.surfaceDistance/f,_=a;c.height=o;let m=i.cartographicToCartesian(c,Py);h.pack(m,s,_),_+=3;for(let y=1;y<f;y++){let x=rP.interpolateUsingSurfaceDistance(y*p,Y3);x.height=d[y],m=i.cartographicToCartesian(x,Py),h.pack(m,s,_),_+=3}return _}cl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??O.IDENTITY;let o=O.inverseTransformation(t,uKe),r=O.multiplyByPoint(o,h.ZERO,fKe),s=h.normalize(O.multiplyByPointAsVector(o,h.UNIT_Y,Wue),Wue),a=en.fromPointNormal(r,s,dKe),c=h.normalize(O.multiplyByPointAsVector(o,h.UNIT_X,que),que),u=en.fromPointNormal(r,c,hKe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let _=1;_<p;++_){let m=e[_];if(en.getPointDistance(u,d)<0||en.getPointDistance(u,m)<0){let y=ni.lineSegmentPlane(d,m,a,mKe);if(l(y)){let x=h.multiplyByScalar(s,5e-9,pKe);en.getPointDistance(a,d)<0&&h.negate(x,x),n.push(h.add(y,x,new h)),i.push(f+1),h.negate(x,x),n.push(h.add(y,x,new h)),f=1}}n.push(h.clone(e[_])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};cl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],W7);if(o=r?o[0]:o,o!==0){let x=i.geodeticSurfaceNormal(y,Py);h.multiplyByScalar(x,o,x),h.add(y,x,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??P.RADIANS_PER_DEGREE;s=P.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=cl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],x=t[c+1],b=r?o[c]:o,T=r?o[c+1]:o;d=gKe(y,x,s,i,b,T,f,d)}j7.length=0;let p=t[n-1],_=i.cartesianToCartographic(p,X3);_.height=r?o[n-1]:o;let m=i.cartographicToCartesian(_,Py);return h.pack(m,f,u-3),f};var Yue=new fe,xKe=new fe;cl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],W7);if(o=r?o[0]:o,o!==0){let T=i.geodeticSurfaceNormal(b,Py);h.multiplyByScalar(T,o,T),h.add(b,T,b)}return[b.x,b.y,b.z]}let s=e.granularity??P.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],Yue),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],xKe),a+=cl.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,Yue);let d=(a+1)*3,p=new Array(d),_=0;for(c=0;c<n-1;c++){let b=t[c],T=t[c+1],C=r?o[c]:o,A=r?o[c+1]:o;_=yKe(b,T,s,i,C,A,p,_)}j7.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,X3);y.height=r?o[n-1]:o;let x=i.cartographicToCartesian(y,Py);return h.pack(x,p,d-3),p};cl.generateCartesianArc=function(e){let t=cl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};cl.generateCartesianRhumbArc=function(e){let t=cl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var zi=cl;function Pu(e,t){e=e??G.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 H(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=vo(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=O.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=zi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array($ue),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=re.fromPoints(this._actualPositions),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new re}var Kue=Pu.POSITION_INDEX=0,bKe=Pu.SHOW_INDEX=1,TKe=Pu.WIDTH_INDEX=2,CKe=Pu.MATERIAL_INDEX=3,sP=Pu.POSITION_SIZE_INDEX=4,AKe=Pu.DISTANCE_DISPLAY_CONDITION=5,$ue=Pu.NUMBER_OF_PROPERTIES=6;function y_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Pu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,y_(this,bKe))}},positions:{get:function(){return this._positions},set:function(e){let t=vo(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&y_(this,sP),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=re.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=re.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),y_(this,Kue),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,y_(this,CKe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,y_(this,TKe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,y_(this,sP)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),y_(this,AKe))}}});Pu.prototype.update=function(){let e=O.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Kue]>0||this._propertiesChanged[sP]>0;if((!O.equals(e,this._modelMatrix)||i)&&(this._segments=zi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=re.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=O.clone(e,this._modelMatrix),this._segments.positions.length!==t)y_(this,sP);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){y_(this,sP);break}}};Pu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Pu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<$ue-1;++t)e[t]=0};Pu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Qd=Pu;var EKe=Qd.SHOW_INDEX,SKe=Qd.WIDTH_INDEX,Y7=Qd.POSITION_INDEX,vKe=Qd.MATERIAL_INDEX,Zue=Qd.POSITION_SIZE_INDEX,wKe=Qd.DISTANCE_DISPLAY_CONDITION,ofe=Qd.NUMBER_OF_PROPERTIES,$l={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 Jd(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.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(ofe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=H.clone(H.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Jd.prototype,{length:{get:function(){return X7(this),this._polylines.length}}});Jd.prototype.add=function(e){let t=new Qd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Jd.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};Jd.prototype.removeAll=function(){K7(this),lfe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Jd.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Jd.prototype.get=function(e){return X7(this),this._polylines[e]};function IKe(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:K.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:K.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:K.FLOAT,componentsPerAttribute:2}];e._batchTable=new zC(t,n,e._polylines.length)}var rfe=new Gn,sfe=new ie,afe=new V;Jd.prototype.update=function(e){if(X7(this),this._polylines.length===0||!this.show)return;LKe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Lt.maximumVertexTextureImageUnits===0)throw new se("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");IKe(this,t),this._createBatchTable=!1}if(this._createVertexArray||DKe(this))efe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[Zue]||o[vKe])efe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,_=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[Y7]&&p.writeUpdate(_,i,this._positionBuffer,n);break}_+=f[m].lengthOfPositions}if((o[EKe]||o[SKe])&&this._batchTable.setBatchedAttribute(i._index,0,new V(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Y7]||o[Zue]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Gn.fromCartesian(m.center,rfe),x=ie.fromElements(y.low.x,y.low.y,y.low.z,m.radius,sfe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(o[wKe]){let m=afe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<ofe;++c)o[c]=0;let r=O.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;PKe(this,e,c,r)}};var aP=new re,Que=new re;function PKe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),_=u.length;for(let m=0;m<_;++m){let y=u[m],x=y.buckets,b=x.length;for(let T=0;T<b;++T){let C=x[T],A=C.offset,S=C.bucket.shaderProgram,w=C.bucket.polylines,R=w.length,D,M,L=0,g,E;for(let v=0;v<R;++v){let I=w[v],N=OKe(I._material);if(N!==D){if(l(D)&&L>0){let z=M.isTranslucent();a>=s?(g=new qe({owner:e}),n.push(g)):g=n[a],++a,E=ct(p(M._uniforms),e._uniformMap),g.boundingVolume=re.clone(aP,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=y.va,g.renderState=z?e._translucentRS:e._opaqueRS,g.pass=z?Se.TRANSLUCENT:Se.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=A,A+=L,L=0,c=!0,r.push(g)}M=I._material,M.update(o),D=N}let F=I._locatorBuckets,U=F.length;for(let z=0;z<U;++z){let B=F[z];B.locator===C&&(L+=B.count)}let k;t.mode===ne.SCENE3D?k=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?k=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(k=re.clone(I._boundingVolume2D,Que),k.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(k=re.union(I._boundingVolumeWC,I._boundingVolume2D,Que)),c?(c=!1,re.clone(k,aP)):re.union(k,aP,aP)}l(D)&&L>0&&(a>=s?(g=new qe({owner:e}),n.push(g)):g=n[a],++a,E=ct(p(M._uniforms),e._uniformMap),g.boundingVolume=re.clone(aP,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=y.va,g.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=M.isTranslucent()?Se.TRANSLUCENT:Se.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=A,c=!0,r.push(g)),D=void 0}}n.length=a}Jd.prototype.isDestroyed=function(){return!1};Jd.prototype.destroy=function(){return cfe(this),K7(this),lfe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ce(this)};function DKe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Y7]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Jue=[0,0,0];function efe(e,t,n){e._createVertexArray=!1,K7(e),cfe(e),MKe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,_;for(p in d)d.hasOwnProperty(p)&&(_=d[p],_.updateShader(t,r,s),f+=_.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),x=new Float32Array(f*4),b,T=0,C=0,A=0;for(p in d)if(d.hasOwnProperty(p)){_=d[p],_.write(y,x,T,C,A,r,t,n),m===ne.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),_.writeForMorph(b,T));let E=_.lengthOfPositions;T+=6*E*3,C+=E*4,A+=E*4,c=_.updateIndices(i,a,u,c)}let S=e._positionBufferUsage.bufferUsage,w=Ne.STATIC_DRAW;e._positionBuffer=st.createVertexBuffer({context:t,typedArray:y,usage:S});let R;l(b)&&(R=st.createVertexBuffer({context:t,typedArray:b,usage:S})),e._texCoordExpandAndBatchIndexBuffer=st.createVertexBuffer({context:t,typedArray:x,usage:w});let D=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let E=0;E<g;++E)if(o=i[E],o.length>0){let v=new Uint16Array(o),I=st.createIndexBuffer({context:t,typedArray:v,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});L+=a[E];let N=6*(E*(D*P.SIXTY_FOUR_KILOBYTES)-L*D),F=D+N,U=D+F,k=D+U,z=D+k,B=D+z,j=E*(M*P.SIXTY_FOUR_KILOBYTES)-L*M,W=[{index:$l.position3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:N,strideInBytes:6*D},{index:$l.position3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*D},{index:$l.position2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:N,strideInBytes:6*D},{index:$l.position2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:F,strideInBytes:6*D},{index:$l.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*D},{index:$l.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*D},{index:$l.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:U,strideInBytes:6*D},{index:$l.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:k,strideInBytes:6*D},{index:$l.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:z,strideInBytes:6*D},{index:$l.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:B,strideInBytes:6*D},{index:$l.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:z,strideInBytes:6*D},{index:$l.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:K.FLOAT,offsetInBytes:B,strideInBytes:6*D},{index:$l.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:K.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:j}],J,Y,ee,Q;m===ne.SCENE3D?(Y=e._positionBuffer,J="vertexBuffer",ee=Jue,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(Y=Jue,J="value",ee=e._positionBuffer,Q="vertexBuffer"):(Y=R,J="vertexBuffer",ee=e._positionBuffer,Q="vertexBuffer"),W[0][J]=Y,W[1][J]=Y,W[2][Q]=ee,W[3][Q]=ee,W[4][J]=Y,W[5][J]=Y,W[6][Q]=ee,W[7][Q]=ee,W[8][J]=Y,W[9][J]=Y,W[10][Q]=ee,W[11][Q]=ee;let de=new qn({context:t,attributes:W,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[E]})}}}function RKe(e,t){return t instanceof dt?t.id:t}var K3=[];function OKe(e){let t=Ji._uniformList[e.type],n=t.length;K3.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];K3[i]=r,K3[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(K3,RKe)}`}function MKe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Dm(c,t,n)),u.addPolyline(a)}}}function LKe(e,t){let n=t.mode;(e._mode!==n||!O.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=O.clone(e.modelMatrix),e._createVertexArray=!0)}function X7(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 K7(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 cfe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Jd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function lfe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function q7(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Dm(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Dm.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Dm.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"),Ft.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Be({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,qC]}),r=t.getVertexShaderCallback()(q3),s=new Be({defines:i,sources:[If,r]});this.shaderProgram=Xt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:$l})};function ufe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(en.ORIGIN_ZX_PLANE)===Gt.INTERSECTING}Dm.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!ufe(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 Ms=new h,Wf=new h,qf=new h,$3=new h,NKe=new ie,FKe=new V;Dm.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let _=f[p],m=_.width,y=_.show&&m>0,x=_._index,b=this.getSegments(_,a),T=b.positions,C=b.lengths,A=T.length,S=_.getPickId(s).color,w=0,R=0,D;for(let U=0;U<A;++U){U===0?_._loop?D=T[A-2]:(D=$3,h.subtract(T[0],T[1],D),h.add(T[0],D,D)):D=T[U-1],h.clone(D,Wf),h.clone(T[U],Ms),U===A-1?_._loop?D=T[1]:(D=$3,h.subtract(T[A-1],T[A-2],D),h.add(T[A-1],D,D)):D=T[U+1],h.clone(D,qf);let k=C[w];U===R+k&&(R+=k,++w);let z=U-R===0,B=U===R+C[w]-1;c===ne.SCENE2D&&(Wf.z=0,Ms.z=0,qf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(z||B)&&u-Math.abs(Ms.x)<1&&((Ms.x<0&&Wf.x>0||Ms.x>0&&Wf.x<0)&&h.clone(Ms,Wf),(Ms.x<0&&qf.x>0||Ms.x>0&&qf.x<0)&&h.clone(Ms,qf));let j=z?2:0,W=B?2:4;for(let J=j;J<W;++J){Gn.writeElements(Ms,e,n),Gn.writeElements(Wf,e,n+6),Gn.writeElements(qf,e,n+12);let Y=J-2<0?-1:1;t[o]=U/(A-1),t[o+1]=2*(J%2)-1,t[o+2]=Y,t[o+3]=x,n+=6*3,o+=4}}let M=NKe;M.x=H.floatToByte(S.red),M.y=H.floatToByte(S.green),M.z=H.floatToByte(S.blue),M.w=H.floatToByte(S.alpha);let L=FKe;L.x=m,L.y=y?1:0;let g=c===ne.SCENE2D?_._boundingVolume2D:_._boundingVolumeWC,E=Gn.fromCartesian(g.center,rfe),v=E.high,I=ie.fromElements(E.low.x,E.low.y,E.low.z,g.radius,sfe),N=afe;N.x=0,N.y=Number.MAX_VALUE;let F=_.distanceDisplayCondition;l(F)&&(N.x=F.near,N.y=F.far),r.setBatchedAttribute(x,0,L),r.setBatchedAttribute(x,1,M),r.attributes.length>2&&(r.setBatchedAttribute(x,2,v),r.setBatchedAttribute(x,3,I),r.setBatchedAttribute(x,4,N))}};var BKe=new h,kKe=new h,UKe=new h,tfe=new h;Dm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let _;p===0?s._loop?_=a[u-2]:(_=tfe,h.subtract(a[0],a[1],_),h.add(a[0],_,_)):_=a[p-1],_=O.multiplyByPoint(n,_,kKe);let m=O.multiplyByPoint(n,a[p],BKe),y;p===u-1?s._loop?y=a[1]:(y=tfe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=O.multiplyByPoint(n,y,UKe);let x=c[f];p===d+x&&(d+=x,++f);let b=p-d===0,T=p===d+c[f]-1,C=b?2:0,A=T?2:4;for(let S=C;S<A;++S)Gn.writeElements(m,e,t),Gn.writeElements(_,e,t+6),Gn.writeElements(y,e,t+12),t+=6*3}}};var zKe=new Array(1);Dm.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new q7(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let _;if(this.mode===ne.SCENE3D){_=zKe;let y=p._actualPositions.length;if(y>0)_[0]=y;else continue}else _=p._segments.lengths;let m=_.length;if(m>0){let y=0;for(let x=0;x<m;++x){let b=_[x]-1;for(let T=0;T<b;++T)c+4>P.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 q7(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>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new q7(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Dm.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 QA={positions:void 0,lengths:void 0},nfe=new Array(1),VKe=new h,HKe=new fe;Dm.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return nfe[0]=n.length,QA.positions=n,QA.lengths=nfe,QA;ufe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=VKe;for(let u=0;u<s;++u)a=n[u],c=O.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,HKe)));if(o.length>0){e._boundingVolume2D=re.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return QA.positions=o,QA.lengths=e._segments.lengths,QA};var ife;Dm.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=ife,c=6*s*3;!l(a)||a.length<c?a=ife=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,_=0,m=0,y;s=f.length;for(let x=0;x<s;++x){x===0?t._loop?y=f[s-2]:(y=$3,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[x-1],h.clone(y,Wf),h.clone(f[x],Ms),x===s-1?t._loop?y=f[1]:(y=$3,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[x+1],h.clone(y,qf);let b=d[_];x===m+b&&(m+=b,++_);let T=x-m===0,C=x===m+d[_]-1;o===ne.SCENE2D&&(Wf.z=0,Ms.z=0,qf.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(T||C)&&r-Math.abs(Ms.x)<1&&((Ms.x<0&&Wf.x>0||Ms.x>0&&Wf.x<0)&&h.clone(Ms,Wf),(Ms.x<0&&qf.x>0||Ms.x>0&&qf.x<0)&&h.clone(Ms,qf));let A=T?2:0,S=C?2:4;for(let w=A;w<S;++w)Gn.writeElements(Ms,a,p),Gn.writeElements(Wf,a,p+6),Gn.writeElements(qf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Rm=Jd;function Dy(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 jf({batchTable:e.batchTable}),this._labelCollection=new g_({batchTable:e.batchTable}),this._polylineCollection=new Rm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Dy.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 GKe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ae.packedLength+te.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ae.pack(n,s,a),a+=ae.packedLength,te.pack(t,s,a),s}var jKe=new hi("createVectorTilePoints",5),WKe=new h;function qKe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=GKe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=jKe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let _=0;_<p;++_){let m=d[_],y=h.unpack(n,_*3,WKe),x=c.add();x.position=y,x._batchIndex=m;let b=u.add();b.text=" ",b.position=y,b._batchIndex=m;let T=f.add();T.positions=[h.clone(y),h.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Dy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),d=o.get(a);t[c]=new Iy(e,c,u,f,d)}};Dy.prototype.applyDebugSettings=function(e,t){e?(H.clone(t,this._billboardCollection._highlightColor),H.clone(t,this._labelCollection._highlightColor),H.clone(t,this._polylineCollection._highlightColor)):(H.clone(H.WHITE,this._billboardCollection._highlightColor),H.clone(H.WHITE,this._labelCollection._highlightColor),H.clone(H.WHITE,this._polylineCollection._highlightColor))};function YKe(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=Iy.defaultPointSize,s.color=Iy.defaultColor,s.pointOutlineColor=Iy.defaultPointOutlineColor,s.pointOutlineWidth=Iy.defaultPointOutlineWidth,s.labelColor=H.WHITE,s.labelOutlineColor=H.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=tr.FILL,s.labelText=void 0,s.backgroundColor=new H(.165,.165,.165,.8),s.backgroundPadding=new V(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=H.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Ei.CENTER,s.verticalOrigin=Bn.CENTER,s.labelHorizontalOrigin=Ei.RIGHT,s.labelVerticalOrigin=Bn.BASELINE}}var XKe=new H,KKe=new H,$Ke=new H,ZKe=new H,QKe=new H,JKe=new H,cP=new Vt,lP=new Vt,$7=new Mt;Dy.prototype.applyStyle=function(e,t){if(!l(e)){YKe(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,XKe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,KKe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,$Ke)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,ZKe)),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,QKe)),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)?(cP.near=a.x,cP.nearValue=a.y,cP.far=a.z,cP.farValue=a.w,s.scaleByDistance=cP):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(lP.near=a.x,lP.nearValue=a.y,lP.far=a.z,lP.farValue=a.w,s.translucencyByDistance=lP):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?($7.near=a.x,$7.far=a.y,s.distanceDisplayCondition=$7):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,JKe)),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))}};Dy.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=qKe(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)};Dy.prototype.isDestroyed=function(){return!1};Dy.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(),ce(this)};var Z3=Dy;function x_(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.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=zn.BOTH}Object.defineProperties(x_.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 e$e(e){let t=new Float64Array(3+h.packedLength+te.packedLength+ae.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ae.pack(e._rectangle,t,n),t}function t$e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Pn.unpack(t,n),n+=Pn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=H.unpack(t,n);n+=H.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let _=0;_<d;++_)p[_]=t[n++];s[a]=new Zp({color:c,offset:u,count:f,batchIds:p})}}var n$e=new hi("createVectorTilePolygons",5),i$e=new H;function o$e(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ae.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let _=e._batchTable,m=s.length;for(let y=0;y<m;++y){let x=_.getColor(y,i$e);s[y]=x.toRgba()}a=e._packedBuffer=e$e(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=n$e.scheduleTask(u,c);if(l(p))return p.then(_=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(_.packedBuffer),y=m[0];t$e(e,m),e._indices=ke.getSizeInBytes(y)===2?new Uint16Array(_.indices):new Uint32Array(_.indices),e._indexOffsets=new Uint32Array(_.indexOffsets),e._indexCounts=new Uint32Array(_.indexCounts),e._batchedPositions=new Float32Array(_.positions),e._vertexBatchIds=new Uint16Array(_.batchIds),r$e(e),e._ready=!0}).catch(_=>{e.isDestroyed()||(e._error=_)})}function r$e(e){l(e._primitive)||(e._primitive=new fA({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)}x_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};x_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};x_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};x_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};x_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=o$e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};x_.prototype.isDestroyed=function(){return!1};x_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var Q3=x_;var J3=`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 eh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(eh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function s$e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+te.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,te.pack(o,a,c),c+=te.packedLength,h.pack(r,a,c),a}var a$e=new hi("createVectorTilePolylines",5),JA={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function c$e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=s$e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=a$e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===ke.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),l$e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function l$e(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=st.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),f=st.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),d=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),p=st.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),_=st.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),m=st.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),y=[{index:JA.previousPosition,vertexBuffer:u,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:JA.currentPosition,vertexBuffer:f,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:JA.nextPosition,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:JA.expandAndWidth,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:2},{index:JA.a_batchId,vertexBuffer:_,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new qn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var uP=new O,ffe=new h;function u$e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return O.clone(n,uP),O.multiplyByPoint(uP,e._center,ffe),O.setTranslation(uP,ffe,uP),uP},u_highlightColor:function(){return e._highlightColor}})}function f$e(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:fn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var d$e=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function h$e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(J3),o=n.getFragmentShaderCallback(!1,void 0,!1)(d$e),r=new Be({defines:["VECTOR_TILE",Ft.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[If,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:JA})}function m$e(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Se.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}eh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(s=0;s<p;++s){let _=(d+s)*3;f[u++]=i[_],f[u++]=i[_+1],f[u++]=i[_+2]}}return f};eh.prototype.getPositions=function(e){return eh.getPolylinePositions(this,e)};eh.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 ma(e,r)}};eh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function p$e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var _$e=new H,g$e=H.WHITE,y$e=!0;eh.prototype.applyStyle=function(e,t){if(!l(e)){p$e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,_$e):g$e,s.show=l(e.show)?e.show.evaluate(s):y$e}};eh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=c$e(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}u$e(this,t),h$e(this,t),f$e(this);let n=e.passes;(n.render||n.pick)&&m$e(this,e)};eh.prototype.isDestroyed=function(){return!1};eh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ce(this)};var eE=eh;var ek=`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 tk=`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 b_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new V(mi._defaultMinTerrainHeight,mi._defaultMaxTerrainHeight),this._boundingVolume=Pn.fromRectangle(e.rectangle,mi._defaultMinTerrainHeight,mi._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=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(b_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function x$e(e,t,n){let i=mi.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;Pn.fromRectangle(c,o,r,n,a)}function b$e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+te.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,te.pack(o,a,c),c+=te.packedLength,h.pack(r,a,c),a}var T$e=new hi("createVectorTileClampedPolylines"),Ry={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function C$e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=b$e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=T$e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===ke.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),A$e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function A$e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=st.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=st.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),_=st.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),m=st.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),y=st.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),x=st.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),b=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW}),T=st.createIndexBuffer({context:t,typedArray:u,usage:Ne.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?ke.UNSIGNED_SHORT:ke.UNSIGNED_INT}),C=[{index:Ry.startEllipsoidNormal,vertexBuffer:d,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:Ry.endEllipsoidNormal,vertexBuffer:p,componentDatatype:K.FLOAT,componentsPerAttribute:3},{index:Ry.startPositionAndHeight,vertexBuffer:_,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:Ry.endPositionAndHeight,vertexBuffer:m,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:Ry.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:Ry.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:K.FLOAT,componentsPerAttribute:4},{index:Ry.a_batchId,vertexBuffer:b,componentDatatype:K.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new qn({context:t,attributes:C,indexBuffer:T}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var fP=new O,dfe=new h;function E$e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return O.clone(n,fP),O.multiplyByPoint(fP,e._center,dfe),O.setTranslation(fP,dfe,fP),fP},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function hfe(e){return ze.fromCache({cull:{enabled:!0,face:Si.FRONT},blending:fn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})}function S$e(e){l(e._rs)||(e._rs=hfe(!1),e._rs3DTiles=hfe(!0))}function v$e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ek),o=n.getFragmentShaderCallback(!1,void 0,!0)(tk),r=new Be({defines:["VECTOR_TILE",Ft.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[If,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=Xt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ry})}function w$e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Se.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Se.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===zn.TERRAIN||i===zn.BOTH)&&t.commandList.push(n),(i===zn.CESIUM_3D_TILE||i===zn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}b_.prototype.getPositions=function(e){return eE.getPolylinePositions(this,e)};b_.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 ma(e,r)}};b_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function I$e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var P$e=new H,D$e=H.WHITE,R$e=!0;b_.prototype.applyStyle=function(e,t){if(!l(e)){I$e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,P$e):D$e,s.show=l(e.show)?e.show.evaluate(s):R$e}};function O$e(e){return mi.initialize().then(function(){x$e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}b_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=O$e(this).then(C$e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}E$e(this,t),v$e(this,t),S$e(this);let n=e.passes;(n.render||n.pick)&&w$e(this,e)};b_.prototype.isDestroyed=function(){return!1};b_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ce(this)};var nk=b_;var Z7=32767,M$e=new fe,L$e=new h;function N$e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Mn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=s[f],p=a[f],_=c[f],m=P.lerp(t.west,t.east,d/Z7),y=P.lerp(t.south,t.north,p/Z7),x=P.lerp(n,i,_/Z7),b=fe.fromRadians(m,y,x,M$e),T=o.cartographicToCartesian(b,L$e);h.pack(T,u,f*3)}return u}var ik=N$e;function nh(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,z$e(this,i,o)}Object.defineProperties(nh.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 F$e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function B$e(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let 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 u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new se("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 th=Uint32Array.BYTES_PER_ELEMENT;function k$e(e){return new eE(e)}function U$e(e){return new nk(e)}function z$e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=th;let r=o.getUint32(n,!0);if(r!==1)throw new se(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=th;let s=o.getUint32(n,!0);if(n+=th,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=th,a===0)throw new se("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=th;let u=o.getUint32(n,!0);n+=th;let f=o.getUint32(n,!0);n+=th;let d=o.getUint32(n,!0);n+=th;let p=o.getUint32(n,!0);n+=th;let _=o.getUint32(n,!0);n+=th;let m=o.getUint32(n,!0);n+=th;let y=jo(i,n,a);n+=a;let x=new Uint8Array(t,n,c);n+=c;let b,T;u>0&&(b=jo(i,n,u),n+=u,f>0&&(T=new Uint8Array(t,n,f),T=new Uint8Array(T),n+=f));let C=y.POLYGONS_LENGTH??0,A=y.POLYLINES_LENGTH??0,S=y.POINTS_LENGTH??0,w=C+A+S,R=new Hg(e,w,b,T,F$e(e));if(e._batchTable=R,w===0)return;let D=new Em(y,x),M=D.getGlobalProperty("REGION");if(!l(M))throw new se("Feature table global property: REGION must be defined");let L=ae.unpack(M),g=M[4],E=M[5],v=e._tile.computedTransform,I=D.getGlobalProperty("RTC_CENTER",K.FLOAT,3);l(I)?(I=h.unpack(I),O.multiplyByPoint(v,I,I)):(I=ae.center(L),I.height=P.lerp(g,E,.5),I=te.WGS84.cartographicToCartesian(I));let N=B$e(y,x);if(n+=(4-n%4)%4,C>0){D.featuresLength=C;let F=D.getPropertyArray("POLYGON_COUNTS",K.UNSIGNED_INT,1)??D.getPropertyArray("POLYGON_COUNT",K.UNSIGNED_INT,1);if(!l(F))throw new se("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=D.getPropertyArray("POLYGON_INDEX_COUNTS",K.UNSIGNED_INT,1)??D.getPropertyArray("POLYGON_INDEX_COUNT",K.UNSIGNED_INT,1);if(!l(U))throw new se("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=F.reduce(function(Y,ee){return Y+ee*2},0),z=U.reduce(function(Y,ee){return Y+ee},0),B=new Uint32Array(t,n,z);n+=d;let j=new Uint16Array(t,n,k);n+=p;let W,J;l(y.POLYGON_MINIMUM_HEIGHTS)&&l(y.POLYGON_MAXIMUM_HEIGHTS)&&(W=D.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",K.FLOAT,1),J=D.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",K.FLOAT,1)),e._polygons=new Q3({positions:j,counts:F,indexCounts:U,indices:B,minimumHeight:g,maximumHeight:E,polygonMinimumHeights:W,polygonMaximumHeights:J,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,batchIds:N.polygons,modelMatrix:v})}if(A>0){D.featuresLength=A;let F=D.getPropertyArray("POLYLINE_COUNTS",K.UNSIGNED_INT,1)??D.getPropertyArray("POLYLINE_COUNT",K.UNSIGNED_INT,1);if(!l(F))throw new se("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=D.getPropertyArray("POLYLINE_WIDTHS",K.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(A);for(let J=0;J<A;++J)U[J]=2}let k=F.reduce(function(J,Y){return J+Y*3},0),z=new Uint16Array(t,n,k);n+=_;let B=e._tileset,j=B.examineVectorLinesFunction;if(l(j)){let J=ik(new Uint16Array(z),L,g,E,te.WGS84);V$e(J,F,N.polylines,R,e.url,j)}let W=k$e;l(B.classificationType)&&(W=U$e),e._polylines=W({positions:z,widths:U,counts:F,batchIds:N.polylines,minimumHeight:g,maximumHeight:E,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:R,classificationType:B.classificationType,keepDecodedPositions:B.vectorKeepDecodedPositions})}if(S>0){let F=new Uint16Array(t,n,S*3);n+=m,e._points=new Z3({positions:F,batchIds:N.points,minimumHeight:g,maximumHeight:E,rectangle:L,batchTable:R})}}function Q7(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}}nh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};nh.prototype.getFeature=function(e){return l(this._features)||Q7(this),this._features[e]};nh.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)};nh.prototype.applyStyle=function(e){l(this._features)||Q7(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)};nh.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)||Q7(this),this._batchTable.update(e,t),this._ready=!0)};nh.prototype.pick=function(e,t,n){};nh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};nh.prototype.isDestroyed=function(){return!1};nh.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(),ce(this)};function V$e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var ok=nh;var mfe={b3dm:function(e,t,n,i,o){return zf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return zf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return zf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return DF.fromTileType(e,t,n,i,o,mfe)},externalTileset:function(e,t,n,i){return U3.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new BF(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new ok(e,t,n,i,o)},subt:function(e,t,n,i,o){return wI.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return wI.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new se("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return zf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return zf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return zf.fromGeoJson(e,t,n,i)}},tE=mfe;var H$e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},nr=Object.freeze(H$e);var ih={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"};ih.isBinaryFormat=function(e){switch(e){case ih.BATCHED_3D_MODEL:case ih.INSTANCED_3D_MODEL:case ih.COMPOSITE:case ih.POINT_CLOUD:case ih.VECTOR:case ih.GEOMETRY:case ih.IMPLICIT_SUBTREE:case ih.VOXEL_BINARY:case ih.GLTF_BINARY:return!0;default:return!1}};var Zs=Object.freeze(ih);var G$e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},oh=Object.freeze(G$e);var Qs={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},T_=new Array(Qs.NUMBER_OF_PASSES);T_[Qs.RENDER]=Object.freeze({pass:Qs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});T_[Qs.PICK]=Object.freeze({pass:Qs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});T_[Qs.SHADOW]=Object.freeze({pass:Qs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});T_[Qs.PRELOAD]=Object.freeze({pass:Qs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Qs.PRELOAD_FLIGHT]=Object.freeze({pass:Qs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Qs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Qs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Qs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Qs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Qs.MOST_DETAILED_PICK]=Object.freeze({pass:Qs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Qs.getPassOptions=function(e){return T_[e]};var qo=Object.freeze(Qs);function Om(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Om.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){}}});Om.prototype.hasProperty=function(e,t){return!1};Om.prototype.getFeature=function(e){};Om.prototype.applyDebugSettings=function(e,t){};Om.prototype.applyStyle=function(e){};Om.prototype.update=function(e,t){};Om.prototype.pick=function(e,t,n){};Om.prototype.isDestroyed=function(){return!1};Om.prototype.destroy=function(){return ce(this)};var dP=Om;function C_(e){e=e??G.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(C_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});C_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};C_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};C_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};C_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};C_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};C_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};C_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var rk=C_;function J7(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){J7._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??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new rk({content:n,class:o})}}J7._oneTimeWarning=Tt;var nE=J7;function j$e(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 iE=j$e;function A_(e){e=e??G.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(A_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});A_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};A_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};A_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};A_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};A_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};A_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};A_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var sk=A_;function eq(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){eq._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??G.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new sk({tile:n,class:o})}}eq._oneTimeWarning=Tt;var ak=eq;function W$e(e){let t=new Uint8Array(e),n=Hl(t);if(n==="glTF"&&(n="glb"),Zs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=q$e(t);if(l(i.root))return{contentType:Zs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Zs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Zs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Zs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Zs.VOXEL_JSON,jsonPayload:i};throw new se("Invalid tile content.")}function q$e(e){let t;try{t=jo(e)}catch{throw new se("Invalid tile content.")}return t}var Oy=W$e;function Yf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=lc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Yf.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 tq(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function pfe(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)}Yf.prototype.requestInnerContents=function(){if(!Y$e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;tq(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=X$e(this,n,t,this._tile._contentState);return K$e(this)};function Y$e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!lc.serverHasOpenSlots(n,t[n]))return!1;return lc.heapHasOpenSlots(e.length)}function X$e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new ur({throttle:!0,throttleByServer:!0,type:Is.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Xn.CANCELLED){pfe(e,i);return}return tq(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Xn.CANCELLED){pfe(e,i);return}tq(e,-1),_fe(e,t,f)}})}async function K$e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>$$e(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 $$e(e,t,n){if(l(t))try{let i=Oy(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Zs.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Zs.GEOMETRY||i.contentType===Zs.VECTOR;let a,c=tE[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=nE(o,u));let f=iE(o,u);return l(f)&&(a.group=new lA({metadata:f})),a}catch(i){_fe(e,n,i)}}function _fe(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}`))}Yf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Yf.prototype.hasProperty=function(e,t){return!1};Yf.prototype.getFeature=function(e){};Yf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Yf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Yf.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)};Yf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var ck=Yf;var gfe=Math.cos,yfe=Math.sin,Z$e=Math.sqrt,nq={};nq.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=gfe(f),p=yfe(f),_=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,y=d*gfe(m),x=d*yfe(m),b=a.x*y,T=a.y*x,C=Z$e(b*y+T*x+_*p);if(r.x=b/C,r.y=T/C,r.z=_/C,n){let A=e.stNwCorner;l(A)?(f=A.latitude-e.stGranYCos*i+o*e.stGranXSin,m=A.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var Q$e=new ti,Xf=new h,J$e=new fe,lk=new h,hP=new Fi;function xfe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;hP._ellipsoid=te.default,Xf=hP.project(e,Xf),Xf=h.subtract(Xf,lk,Xf);let _=ti.fromRotation(t,Q$e);Xf=ti.multiplyByVector(_,Xf,Xf),Xf=h.add(Xf,lk,Xf),e=hP.unproject(Xf,e),r-=1,s-=1;let m=e.latitude,y=m+r*p,x=m-c*s,b=m-c*s+r*p,T=Math.max(m,y,x,b),C=Math.min(m,y,x,b),A=e.longitude,S=A+r*u,w=A+s*d,R=A+s*d+r*u,D=Math.max(A,S,w,R),M=Math.min(A,S,w,R);return{north:T,south:C,east:D,west:M,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}nq.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let _,m=u-f;c>a?_=P.TWO_PI-c+a:_=a-c;let y=Math.ceil(_/t)+1,x=Math.ceil(m/t)+1,b=_/(y-1),T=m/(x-1),C=ae.northwest(e,r),A=ae.center(e,J$e);(n!==0||i!==0)&&(A.longitude<C.longitude&&(A.longitude+=P.TWO_PI),hP._ellipsoid=te.default,lk=hP.project(A,lk));let S=T,w=b,R=0,D=0,M=ae.clone(e,o),L={granYCos:S,granYSin:R,granXCos:w,granXSin:D,nwCorner:C,boundingRectangle:M,width:y,height:x,northCap:d,southCap:p};if(n!==0){let g=xfe(C,n,b,T,A,y,x);u=g.north,f=g.south,a=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,M.north=u,M.south=f,M.east=a,M.west=c}if(i!==0){n=n-i;let g=ae.northwest(M,s),E=xfe(g,n,b,T,A,y,x);L.stGranYCos=E.granYCos,L.stGranXCos=E.granXCos,L.stGranYSin=E.granYSin,L.stGranXSin=E.granXSin,L.stNwCorner=g,L.stWest=E.west,L.stSouth=E.south}return L};var Js=nq;var eZe=new re,tZe=new re,nZe=new h,iZe=new ae;function bfe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let d=new Float64Array(u*3),p=0,_=0,m,y=nZe;if(r)Js.computePosition(t,n,!1,_,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<o;m++)Js.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=o-1,_=1;_<i;_++)Js.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(_=i-1,!s)for(m=o-2;m>=0;m--)Js.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,_=i-2;_>0;_--)Js.computePosition(t,n,!1,_,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let x=d.length/3*2,b=ke.createTypedArray(d.length/3,x),T=0;for(let A=0;A<d.length/3-1;A++)b[T++]=A,b[T++]=A+1;b[T++]=d.length/3-1,b[T++]=0;let C=new lt({attributes:new pn,primitiveType:Le.LINES});return C.attributes.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),C.indices=b,C}function oZe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=bfe(e,t),s=t.height,a=t.width,c=li.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=li.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(d,u),r.attributes.position.values=f;let p=t.northCap,_=t.southCap,m=4;p&&(m-=1),_&&(m-=1);let y=(f.length/3+m)*2,x=ke.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let C=0;C<u-1;C++)x[b++]=C,x[b++]=C+1,x[b++]=C+u,x[b++]=C+u+1;x[b++]=u-1,x[b++]=0,x[b++]=u+u-1,x[b++]=u,x[b++]=0,x[b++]=u;let T;if(p)T=s-1;else{let C=a-1;x[b++]=C,x[b++]=C+u,T=a+s-2}if(x[b++]=T,x[b++]=T+u,!_){let C=a+T-1;x[b++]=C,x[b]=C+u}return r.indices=x,r}function rE(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??P.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=ae.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"}rE.packedLength=ae.packedLength+te.packedLength+5;rE.pack=function(e,t,n){return n=n??0,ae.pack(e._rectangle,t,n),n+=ae.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Tfe=new ae,Cfe=te.clone(te.UNIT_SPHERE),oE={rectangle:Tfe,ellipsoid:Cfe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};rE.unpack=function(e,t,n){t=t??0;let i=ae.unpack(e,t,Tfe);t+=ae.packedLength;let o=te.unpack(e,t,Cfe);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(oE.granularity=r,oE.height=s,oE.rotation=a,oE.extrudedHeight=c,oE.offsetAttribute=u===-1?void 0:u,new rE(oE))};var rZe=new fe;rE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Js.computeOptions(t,e._granularity,e._rotation,0,iZe,rZe),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=oZe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,_=new Uint8Array(p);e._offsetAttribute===cn.TOP?_=_.fill(1,0,p/2):(u=e._offsetAttribute===cn.NONE?0:1,_=_.fill(u)),o.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}let f=re.fromRectangle3D(t,n,s,tZe),d=re.fromRectangle3D(t,n,a,eZe);r=re.union(f,d)}else{if(o=bfe(e,i),o.attributes.position.values=li.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===cn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=re.fromRectangle3D(t,n,s)}return new lt({attributes:o.attributes,indices:o.indices,primitiveType:Le.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var sE=rE;function cE(e){this.rectangle=ae.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??te.WGS84;uZe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(cE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});cE.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Pn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)};var Afe=new h,uk=new h,Efe=new h,sZe=new h,aZe=new h,cZe=new h,lZe=new h,Kf=new fe,Sfe=new en(h.UNIT_X,0),aE=new gn;function uZe(e,t,n){n.cartographicToCartesian(ae.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ae.northeast(t),e.northeastCornerCartesian),Kf.longitude=t.west,Kf.latitude=(t.south+t.north)*.5,Kf.height=0;let i=n.cartographicToCartesian(Kf,cZe),o=h.cross(i,h.UNIT_Z,sZe);h.normalize(o,e.westNormal),Kf.longitude=t.east;let r=n.cartographicToCartesian(Kf,lZe),s=h.cross(h.UNIT_Z,r,Afe);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,Afe);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,aZe),u=t.south,f;if(u>0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=u;let y=n.cartographicToCartesian(Kf,aE.origin);h.clone(c,aE.direction);let x=en.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Sfe);ni.rayPlane(aE,x,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,uk)}else f=n.geodeticSurfaceNormalCartographic(ae.southeast(t),uk);let d=h.cross(f,a,Efe);h.normalize(d,e.southNormal);let p=t.north,_;if(p<0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=p;let y=n.cartographicToCartesian(Kf,aE.origin);h.negate(c,aE.direction);let x=en.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Sfe);ni.rayPlane(aE,x,e.northeastCornerCartesian),_=n.geodeticSurfaceNormal(y,uk)}else _=n.geodeticSurfaceNormalCartographic(ae.northwest(t),uk);let m=h.cross(a,_,Efe);h.normalize(m,e.northNormal)}var fZe=new h,dZe=new h,hZe=new h(0,-1,0),mZe=new h(0,0,-1),vfe=new h;function pZe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ae.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,_=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(ae.southwest(e.rectangle),fZe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ae.northeast(e.rectangle),dZe),f.z=f.y,f.y=f.x,f.x=0,d=hZe,_=h.UNIT_Y,p=mZe,m=h.UNIT_Z);let y=h.subtract(i,u,vfe),x=h.dot(y,d),b=h.dot(y,p),T=h.subtract(i,f,vfe),C=h.dot(T,_),A=h.dot(T,m);x>0?r+=x*x:C>0&&(r+=C*C),b>0?r+=b*b:A>0&&(r+=A*A)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}cE.prototype.distanceToCamera=function(e){let t=pZe(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};cE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};cE.prototype.createDebugVolume=function(e){let t=new O.clone(O.IDENTITY),n=new sE({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Pt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var $f=cE;var mP={},_Ze=new h,wfe=new h,Ife=new h,Pfe=new h,Dfe=new Pn;mP.validOutline=function(e){let n=Pn.fromPoints(e,Dfe).halfAxes,i=Z.getColumn(n,0,wfe),o=Z.getColumn(n,1,Ife),r=Z.getColumn(n,2,Pfe),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};mP.computeProjectTo2DArguments=function(e,t,n,i){let o=Pn.fromPoints(e,Dfe),r=o.halfAxes,s=Z.getColumn(r,0,wfe),a=Z.getColumn(r,1,Ife),c=Z.getColumn(r,2,Pfe),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let _,m;return(p===f||p===d)&&(_=s),p===u?_=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(_,n),h.normalize(m,i),h.clone(o.center,t),!0};function Rfe(e,t,n,i,o){let r=h.subtract(e,t,_Ze),s=h.dot(n,r),a=h.dot(i,r);return V.fromElements(s,a,o)}mP.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Rfe(i[r],e,t,n);return o}};mP.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Rfe(i,e,t,n,o)}};var My=mP;function gZe(e){let t=e.length,n=new Float64Array(t*3),i=ke.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 we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:n})});return new lt({attributes:s,indices:i,primitiveType:Le.LINES})}function bb(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+1}bb.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new bb(t)};bb.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var yZe={polygonHierarchy:{}};bb.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new bb(yZe)),n._polygonHierarchy=i,n.packedLength=o,n};bb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=vo(n,h.equalsEpsilon,!0),n.length<3||!My.validOutline(n))return;let o=Hn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Pt({geometry:gZe(o[c])});r.push(u)}let s=Fn.combineInstances(r)[0],a=re.fromPoints(t.positions);return new lt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var rh=bb;var fk=new fe;function pP(e){let t=Kg.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=wZe(t,n,i,o);this._boundingPlanes=r;let s=RZe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=uq(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=uq(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=uq(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();fk=o.cartesianToCartographic(c,fk),fk.height=(i+n)/2,this.center=o.cartographicToCartesian(fk,c),this._boundingSphere=re.fromPoints(s)}var xZe=new h,bZe=new fe,TZe=new h,CZe=new fe,AZe=new h,EZe=new h,SZe=new h,vZe=new h;function wZe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,xZe),a=i.cartesianToCartographic(r,bZe);a.height=n;let c=i.cartographicToCartesian(a,TZe),u=en.fromPointNormal(c,s);o[0]=u;let f=0,d,p=[],_,m;for(d=0;d<4;d++){_=e.getVertex(d),p[d]=_,m=i.cartesianToCartographic(_,CZe),m.height=t;let x=en.getPointDistance(u,i.cartographicToCartesian(m,AZe));x<f&&(f=x)}let y=en.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,o[1]=y,d=0;d<4;d++){_=p[d];let x=p[(d+1)%4],b=i.geodeticSurfaceNormal(_,EZe),T=h.subtract(x,_,vZe),C=h.cross(T,b,SZe);C=h.normalize(C,C),o[2+d]=en.fromPointNormal(_,C)}return o}var Tb=new h,Cb=new h,Ab=new h,iq=new h,oq=new h,rq=new h,IZe=new h,PZe=new h,DZe=new h,sq=new h,aq=new h,cq=new h,Ly=new h,Mm=new Z;function Ofe(e,t,n){Tb=e.normal,Cb=t.normal,Ab=n.normal,iq=h.multiplyByScalar(e.normal,-e.distance,iq),oq=h.multiplyByScalar(t.normal,-t.distance,oq),rq=h.multiplyByScalar(n.normal,-n.distance,rq),sq=h.multiplyByScalar(h.cross(Cb,Ab,IZe),h.dot(iq,Tb),sq),aq=h.multiplyByScalar(h.cross(Ab,Tb,PZe),h.dot(oq,Cb),aq),cq=h.multiplyByScalar(h.cross(Tb,Cb,DZe),h.dot(rq,Ab),cq),Mm[0]=Tb.x,Mm[1]=Cb.x,Mm[2]=Ab.x,Mm[3]=Tb.y,Mm[4]=Cb.y,Mm[5]=Ab.y,Mm[6]=Tb.z,Mm[7]=Cb.z,Mm[8]=Ab.z;let i=Z.determinant(Mm);return Ly=h.add(sq,aq,Ly),Ly=h.add(Ly,cq,Ly),new h(Ly.x/i,Ly.y/i,Ly.z/i)}function RZe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Ofe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Ofe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var lq=new h,lE=new h;function uq(e,t){let n=[];for(let i=0;i<4;i++)lq=h.subtract(t[(i+1)%4],t[i],lq),lE=h.cross(e.normal,lq,lE),lE=h.normalize(lE,lE),n[i]=h.clone(lE);return n}Object.defineProperties(pP.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var fq=new h;pP.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;en.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):en.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,en.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=dq(en.projectPointOntoPlane(c,t,fq),i[0],c,o),h.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=Mfe(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=dq(en.projectPointOntoPlane(c,t,fq),i[r],c,this._edgeNormals[n[r]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=dq(en.projectPointOntoPlane(this._boundingPlanes[1],t,fq),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var OZe=new h,MZe=new h;function Mfe(e,t,n){let i=h.subtract(n,t,OZe),o=h.subtract(e,t,MZe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var LZe=new en(h.UNIT_X,0);function dq(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=en.fromPointNormal(t[c],i[c],LZe);en.getPointDistance(u,e)<0||(a=Mfe(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}pP.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Gt.INSIDE:n===this._vertices.length?Gt.OUTSIDE:Gt.INTERSECTING};pP.prototype.createDebugVolume=function(e){let t=new O.clone(O.IDENTITY),n=new rh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=rh.createGeometry(n),o=new Pt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new rh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=rh.createGeometry(r),a=new Pt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new rh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=rh.createGeometry(f);c[u]=new Pt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new Dn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var dk=pP;var NZe=new h(1,1,1),hk=Math.cos,mk=Math.sin;function uE(e){e=e??G.EMPTY_OBJECT;let t=e.radii??NZe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??P.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}uE.packedLength=2*h.packedLength+8;uE.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.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 Lfe=new h,Nfe=new h,E_={radii:Lfe,innerRadii:Nfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};uE.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Lfe);t+=h.packedLength;let o=h.unpack(e,t,Nfe);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(E_.minimumClock=r,E_.maximumClock=s,E_.minimumCone=a,E_.maximumCone=c,E_.stackPartitions=u,E_.slicePartitions=f,E_.subdivisions=d,E_.offsetAttribute=p===-1?void 0:p,new uE(E_))};uE.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,_=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;_&&(p=2,r>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let x=a*p*(f+u),b=new Float64Array(x*3),T=2*(x+d-(u+f)*p),C=ke.createTypedArray(x,T),A,S,w,R,D=0,M=new Array(f),L=new Array(f);for(A=0;A<f;A++)R=r+A*(s-r)/(f-1),M[A]=mk(R),L[A]=hk(R);let g=new Array(a),E=new Array(a);for(A=0;A<a;A++)w=i+A*(o-i)/(a-1),g[A]=mk(w),E[A]=hk(w);for(A=0;A<f;A++)for(S=0;S<a;S++)b[D++]=t.x*M[A]*E[S],b[D++]=t.y*M[A]*g[S],b[D++]=t.z*L[A];if(_)for(A=0;A<f;A++)for(S=0;S<a;S++)b[D++]=n.x*M[A]*E[S],b[D++]=n.y*M[A]*g[S],b[D++]=n.z*L[A];for(M.length=a,L.length=a,A=0;A<a;A++)R=r+A*(s-r)/(a-1),M[A]=mk(R),L[A]=hk(R);for(g.length=u,E.length=u,A=0;A<u;A++)w=i+A*(o-i)/(u-1),g[A]=mk(w),E[A]=hk(w);for(A=0;A<a;A++)for(S=0;S<u;S++)b[D++]=t.x*M[A]*E[S],b[D++]=t.y*M[A]*g[S],b[D++]=t.z*L[A];if(_)for(A=0;A<a;A++)for(S=0;S<u;S++)b[D++]=n.x*M[A]*E[S],b[D++]=n.y*M[A]*g[S],b[D++]=n.z*L[A];for(D=0,A=0;A<f*p;A++){let N=A*a;for(S=0;S<a-1;S++)C[D++]=N+S,C[D++]=N+S+1}let v=f*a*p;for(A=0;A<u;A++)for(S=0;S<a-1;S++)C[D++]=v+A+S*u,C[D++]=v+A+(S+1)*u;if(_)for(v=f*a*p+u*a,A=0;A<u;A++)for(S=0;S<a-1;S++)C[D++]=v+A+S*u,C[D++]=v+A+(S+1)*u;if(_){let N=f*a*p,F=N+a*u;if(m)for(A=0;A<u;A++)C[D++]=N+A,C[D++]=F+A;if(y)for(N+=a*u-u,F+=a*u-u,A=0;A<u;A++)C[D++]=N+A,C[D++]=F+A}let I=new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let N=b.length,F=e._offsetAttribute===cn.NONE?0:1,U=new Uint8Array(N/3).fill(F);I.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new lt({attributes:I,indices:C,primitiveType:Le.LINES,boundingSphere:re.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Zf=uE;function fE(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Zf(i),this._workerName="createSphereOutlineGeometry"}fE.packedLength=Zf.packedLength;fE.pack=function(e,t,n){return Zf.pack(e._ellipsoidGeometry,t,n)};var FZe=new Zf,Eb={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};fE.unpack=function(e,t,n){let i=Zf.unpack(e,t,FZe);return Eb.stackPartitions=i._stackPartitions,Eb.slicePartitions=i._slicePartitions,Eb.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Eb.radii),n._ellipsoidGeometry=new Zf(Eb),n):(Eb.radius=i._radii.x,new fE(Eb))};fE.createGeometry=function(e){return Zf.createGeometry(e._ellipsoidGeometry)};var Ny=fE;function dE(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new re(e,t)}Object.defineProperties(dE.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}}});dE.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};dE.prototype.intersectPlane=function(e){return re.intersectPlane(this._boundingSphere,e)};dE.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};dE.prototype.createDebugVolume=function(e){let t=new Ny({radius:this.radius}),n=O.fromTranslation(this.center,new O.clone(O.IDENTITY)),i=new Pt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var Fy=dE;var BZe=new h,kZe=new h,UZe=new h,zZe=new h;function Sb(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function hq(e,t){let n=h.normalize(e,zZe),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Sb(e,i,t)}function Ffe(e){let t=Z.getColumn(e,0,BZe),n=Z.getColumn(e,1,kZe),i=Z.getColumn(e,2,UZe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=Sb(n,i,t):!o&&r&&!s?n=Sb(t,i,n):!o&&!r&&s?i=Sb(n,t,i):o?r?s||(t=hq(i,t),n=Sb(i,t,n)):(t=hq(n,t),i=Sb(n,t,i)):(n=hq(t,n),i=Sb(n,t,i)),Z.setColumn(e,0,t,e),Z.setColumn(e,1,n,e),Z.setColumn(e,2,i,e),e)}function hE(e,t){t=Ffe(t),this._orientedBoundingBox=new Pn(e,t),this._boundingSphere=re.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(hE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});hE.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};hE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};hE.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Ffe(t),Z.clone(t,this._orientedBoundingBox.halfAxes),re.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};hE.prototype.createDebugVolume=function(e){let t=new om({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=O.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Pt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})};var Du=hE;function ir(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)?O.unpack(n.transform):O.clone(O.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=O.multiply(a,this.transform,new O),u=l(i)?i._initialTransform:O.IDENTITY;this._initialTransform=O.multiply(u,this.transform,new O),this.computedTransform=c,this.metadata=ak(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,ir._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")&&ir._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Jo.REPLACE:Jo.ADD):l(i)?p=i.refine:p=Jo.REPLACE,this.refine=p,this.children=[],this.parent=i;let _,m=!1,y,x,b;if(t=Ee.createIfNeeded(t),r)y=nr.UNLOADED,x=t.clone();else if(l(s)){let S=s.uri;l(s.url)&&(ir._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=s.url),S===""?(ir._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),_=new dP(e,this),m=!0,y=nr.READY):(y=nr.UNLOADED,x=t.getDerivedResource({url:S}),b=lc.getServerKey(x.getUrlComponent()))}else _=new dP(e,this),m=!0,y=nr.READY;this._content=_,this._contentResource=x,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let T=n.expire,C,A;l(T)&&(C=T.duration,l(T.date)&&(A=$.fromIso8601(T.date))),this.expireDuration=C,this.expireDate=A,this.lastStyleTime=0,this._optimChildrenWithinParent=oh.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=H.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 $,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}ir._deprecationWarning=Mo;Object.defineProperties(ir.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 H),H.clone(this._color)},set:function(e){this._color=H.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===nr.READY}},contentUnloaded:{get:function(){return this._contentState===nr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===nr.EXPIRED}},contentFailed:{get:function(){return this._contentState===nr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var By=new h;function VZe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,By),c=h.add(s.positionWC,a,By),u=h.subtract(c,r,By);if(h.magnitude(u)>o){let A=h.normalize(u,By),S=h.multiplyByScalar(A,o,By),w=h.add(r,S,By),R=h.subtract(w,s.positionWC,By),D=h.normalize(R,By);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,D))}else e._foveatedFactor=0;let p=e.refine===Jo.REPLACE,_=n.isSkippingLevelOfDetail;if(p&&!_||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&_||n._pass===qo.PRELOAD_FLIGHT||n._pass===qo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let x=m-y,b=P.clamp((e._foveatedFactor-y)/x,0,1),T=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),C=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-T<=C}var Vfe=new $;ir.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof ln){let _=u.offCenterFrustum;l(_)&&(u=_);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let _=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(_*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,b=P.fog(_,y)*x;p-=b}}return p/=e.pixelRatio,p};function HZe(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 GZe(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}ir.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:Ds.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!==Ds.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=GZe(n,this),this._priorityProgressiveResolution=HZe(n,this),this.priorityDeferred=VZe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ir.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=$.now(Vfe);$.lessThan(this.expireDate,e)&&(this._contentState=nr.EXPIRED,this._expiredContent=this._content)}};function jZe(e){if(!l(e.expireDuration))return;let t=$.now(Vfe);$.addSeconds(t,e.expireDuration,t),l(e.expireDate)?$.lessThan(e.expireDate,t)&&$.clone(t,e.expireDate):e.expireDate=$.clone(t)}function WZe(e){return function(){return e._priority}}ir.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?qZe(this):XZe(this)};function qZe(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 ck(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=nr.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=nr.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=nr.FAILED,o})}async function YZe(e,t,n,i,o){let r=e._contentState;e._contentState=nr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Xn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=nr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Xn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await KZe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=nr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=nr.FAILED,a}}function XZe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new ur({throttle:!0,throttleByServer:!0,type:Is.TILES3D,priorityFunction:WZe(e),serverKey:e._serverKey});e._request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return YZe(e,o,i,n,r)}async function KZe(e,t){let n=Oy(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Zs.GEOMETRY||n.contentType===Zs.VECTOR,(n.contentType===Zs.IMPLICIT_SUBTREE||n.contentType===Zs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Zs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=tE[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=nE(i,s));let a=iE(i,s);return l(a)&&(o.group=new lA({metadata:a})),o}ir.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ir.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=nr.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 Hfe=new re;function pq(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,Hfe);e._boundingVolume2D=new Fy(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function $Ze(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=re.projectTo2D(n,t.mapProjection,Hfe);e._contentBoundingVolume2D=new Fy(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ir.prototype.visibility=function(e,t){let n=e.cullingVolume,i=pq(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Gt.INSIDE,a===Gt.OUTSIDE)return Ds.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Gt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ir.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Gt.INSIDE;if(this._visibilityPlaneMask===Ds.MASK_INSIDE)return Gt.INSIDE;let t=e.cullingVolume,n=$Ze(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Gt.INSIDE,s===Gt.OUTSIDE)return Gt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Gt.OUTSIDE,s===Gt.INSIDE)return Gt.OUTSIDE}return t.computeVisibility(n)};ir.prototype.distanceToTile=function(e){return pq(this,e).distanceToCamera(e)};var ZZe=new h;ir.prototype.distanceToTileCenter=function(e){let n=pq(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,ZZe);return h.dot(e.camera.directionWC,i)};ir.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Gfe=new Z,jfe=new h,QZe=new Z,_q=new h,Wfe=new ae,qfe=new Pn,mq=new O;function JZe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_q),o=Z.fromArray(e,3,QZe);i=O.multiplyByPoint(t,i,i);let r=O.getMatrix3(t,Gfe);return o=Z.multiply(r,o,o),l(n)?(n.update(i,o),n):new Du(i,o)}function Bfe(e,t,n,i){let o=ae.unpack(e,0,Wfe),r=e[4],s=e[5],a=Pn.fromRectangle(o,r,s,te.WGS84,qfe),c=a.center,u=a.halfAxes;t=O.multiplyTransformation(t,O.inverseTransformation(n,mq),mq),c=O.multiplyByPoint(t,c,c);let f=O.getMatrix3(t,Gfe);return u=Z.multiply(f,u,u),l(i)&&i instanceof Du?(i.update(c,u),i):new Du(c,u)}function eQe(e,t,n,i){if(!O.equalsEpsilon(t,n,P.EPSILON8))return i instanceof Du?Bfe(e,t,n,i):Bfe(e,t,n,void 0);let o=ae.unpack(e,0,Wfe);return i instanceof $f?(i.rectangle=ae.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new $f({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function tQe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_q),o=e[3];i=O.multiplyByPoint(t,i,i);let r=O.getScale(t,jfe),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Fy(i,o)}ir.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=bA.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new se("boundingVolume must be defined");if(ci(e,"3DTILES_bounding_volume_S2"))return new dk(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=JZe(r,t,n);return this._verticalExaggeration!==1&&kfe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=eQe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Du?kfe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Br.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Br.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(a)){let c=tQe(a,t,n);if(this._verticalExaggeration!==1){let u=Br.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,_q),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new se("boundingVolume must contain a sphere, region, or box")};var nQe=h.unpackArray(new Array(8*3).fill(0));function kfe(e,t,n){let i=e.boundingVolume.computeCorners(nQe).map(r=>Br.getPosition(r,te.WGS84,t,n,r)),o=Pn.fromPoints(i,qfe);e.update(o.center,o.halfAxes)}ir.prototype.updateTransform=function(e,t){e=e??O.IDENTITY;let n=O.multiplyTransformation(e,this.transform,mq),i=!O.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&O.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()};ir.prototype.updateGeometricErrorScale=function(){let e=O.getScale(this.computedTransform,jfe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function iQe(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=H.WHITE:c=H.DARKGRAY:c=H.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Yt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(H.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(H.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=H.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function oQe(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=nr.FAILED,o}}function rQe(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 sQe(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)}ir.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;rQe(this,e),sQe(this,e),iQe(this,e,t,n),oQe(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===Se.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Ufe=[];ir.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(jZe(this),this._selectedFrame=0,this.lastStyleTime=0,$.now(this._loadTimestamp),this._contentState=nr.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=Ufe;try{this._content.update(e,t)}catch(i){throw this._contentState=nr.FAILED,i}Ufe.length=0,t.commandList=n};function zfe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function pk(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}ir.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,d=r,p=Math.pow(10,f),_=f+d,m=r,y=Math.pow(10,_),x=_+m,b=Math.pow(10,x),T=pk(this._depth,n.depth,i.depth);T=t?1-T:T;let A=!e.isSkippingLevelOfDetail&&this.refine===Jo.REPLACE?pk(this._priorityHolder._distanceToCamera,n.distance,i.distance):pk(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=zfe(A,a,s),w=this._priorityProgressiveResolution?0:p,R=pk(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),D=zfe(R,u,c),M=this.priorityDeferred?y:0,L=e._pass===qo.PRELOAD_FLIGHT?0:b;this._priority=T+S+w+D+M+L};ir.prototype.isDestroyed=function(){return!1};ir.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(),ce(this)};var sh=ir;function S_(e){e=e??G.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(S_.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}}});S_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};S_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};S_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};S_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};S_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};S_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};S_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var _P=S_;function v_(e){e=e??G.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(v_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});v_.prototype.hasProperty=function(e){return kn.hasProperty(e,this._properties,this._class)};v_.prototype.hasPropertyBySemantic=function(e){return kn.hasPropertyBySemantic(e,this._properties,this._class)};v_.prototype.getPropertyIds=function(e){return kn.getPropertyIds(this._properties,this._class,e)};v_.prototype.getProperty=function(e){return kn.getProperty(e,this._properties,this._class)};v_.prototype.setProperty=function(e,t){return kn.setProperty(e,t,this._properties,this._class)};v_.prototype.getPropertyBySemantic=function(e){return kn.getPropertyBySemantic(e,this._properties,this._class)};v_.prototype.setPropertyBySemantic=function(e,t){return kn.setPropertyBySemantic(e,t,this._properties,this._class)};var _k=v_;function Yfe(e){e=e??G.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new _k({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new _P({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new _P({id:f,group:a[f],class:n.classes[d.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(Yfe.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 mE=Yfe;var Xfe={},aQe=new h;Xfe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Du||i instanceof $f){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=oh.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Du||a instanceof $f)){e._optimChildrenWithinParent=oh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,o.center,aQe),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=oh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===oh.USE_OPTIMIZATION};var gk=Xfe;function gP(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(gP.prototype,{length:{get:function(){return this._length}}});function cQe(e,t,n){this.item=e,this.previous=t,this.next=n}gP.prototype.add=function(e){let t=new cQe(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 Kfe(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}gP.prototype.remove=function(e){l(e)&&(Kfe(this,e),--this._length)};gP.prototype.splice=function(e,t){if(e===t)return;Kfe(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 yk=gP;function vb(){this._list=new yk,this._sentinel=this._list.add(),this._trimTiles=!1}vb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};vb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};vb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};vb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};vb.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)}};vb.prototype.trim=function(){this._trimTiles=!0};var xk=vb;function bk(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 yq(e,t){let n;return t==="_loadTimestamp"?n=$.toDate(e).getTime():n=e,n}bk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=yq(e,n),this._referenceMaximum[n]=yq(t,n)};function lQe(e,t){let n=e.tilePropertyName;if(l(n)){let i=yq(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 gq=[new H(.1,.1,.1,1),new H(.153,.278,.878,1),new H(.827,.231,.49,1),new H(.827,.188,.22,1),new H(1,.592,.259,1),new H(1,.843,0,1)];bk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=lQe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=gq.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),_=f-d,m=gq[d],y=gq[p],x=H.clone(H.WHITE);x.red=P.lerp(m.red,y.red,_),x.green=P.lerp(m.green,y.green,_),x.blue=P.lerp(m.blue,y.blue,_),e._debugColor=x};bk.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 Tk=bk;function pE(){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}pE.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};pE.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])}};pE.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof zf))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])}};pE.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof zf))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])}};pE.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 Lm=pE;function yP(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(yP.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});yP.prototype.makeDirty=function(){this._styleDirty=!0};yP.prototype.resetDirty=function(){this._styleDirty=!1};yP.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 Ck=yP;function uQe(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 se("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 Ee({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=fQe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Fe(a,!0));let c=new Ee({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=dQe(t),this.subdivisionScheme=hs[i.subdivisionScheme],this.branchingFactor=hs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function fQe(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 dQe(e){let t=Fe(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 _E=uQe;var xP={};function $fe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function xq(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Zfe(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 bq(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}xP.encode2D=function(e,t){return($fe(e)|$fe(t)<<1)>>>0};xP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Zfe(e),t[1]=Zfe(e>>1),t};xP.encode3D=function(e,t,n){return xq(e)|xq(t)<<1|xq(n)<<2};xP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=bq(e),t[1]=bq(e>>1),t[2]=bq(e>>2),t};var wb=xP;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===hs.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===hs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===hs.OCTREE?wb.encode3D(this.x,this.y,this.z):wb.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===hs.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===hs.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===hs.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===hs.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===hs.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===hs.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===hs.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===hs.OCTREE&&(e.z=this.z),e};var Qfe=[0,0,0];Yo.fromMortonIndex=function(e,t,n,i){let o;return e===hs.OCTREE?(o=wb.decode3D(i,Qfe),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=wb.decode2D(i,Qfe),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===hs.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Yo.fromMortonIndex(e,t,i,r)};var gE=Yo;function w_(){}w_.selectTiles=function(e,t){he.throwInstantiationError()};w_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};w_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};w_.selectTile=function(e,t){if(e.contentVisibility(t)===Gt.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)};w_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};w_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};w_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!hQe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function hQe(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}w_.updateTile=function(e,t){Jfe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,_Qe(e),e._shouldSelect=!1,e._finalResolution=!0};function Jfe(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];Jfe(r,t),e._visible=r._visible;return}if(mQe(e,t)){e._visible=!1;return}let i=e.refine===Jo.REPLACE,o=e._optimChildrenWithinParent===oh.USE_OPTIMIZATION;if(i&&o&&n&&!pQe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function mQe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Jo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function pQe(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 _Qe(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 Ta=w_;function ede(){}var bP={stack:new Vl,stackMaximumLength:0};ede.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}=Ta,s=bP.stack;for(s.push(i);s.length>0;){bP.stackMaximumLength=Math.max(bP.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Jo.ADD,u=a.refine===Jo.REPLACE,f=gQe(a);f&&yQe(a,s,t),(c||u&&!f)&&(xQe(e,a),o(a,t),bQe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return bP.stack.trim(bP.stackMaximumLength),n};function gQe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function yQe(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 xQe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function bQe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Gt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var Ak=ede;function tde(){}var TP={stack:new Vl,stackMaximumLength:0},CP={stack:new Vl,stackMaximumLength:0};tde.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(Ta.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;CQe(n,t),TP.stack.trim(TP.stackMaximumLength),CP.stack.trim(CP.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Tq(e,t){e.contentAvailable&&Ta.selectTile(e,t)}function TQe(e,t,n){let i=e.refine===Jo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ta;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(Ta.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,_=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let y=r[m];if(y.isVisible?(t.push(y),y._foveatedFactor<_&&(p=m,_=y._foveatedFactor),d=!0):(u||o.loadSiblings)&&(y._foveatedFactor<_&&(p=m,_=y._foveatedFactor),a(y,n),c(y,n)),u){let x;y._inRequestVolume?y.hasRenderableContent?x=y.contentAvailable:x=AQe(y,n):x=!1,f=f&&x}}if(d||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&_<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let x=0;x<r.length;++x)r[x]._priorityHolder=y}return f}function CQe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ta,a=TP.stack;for(a.push(e);a.length>0;){TP.stackMaximumLength=Math.max(TP.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?TQe(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Jo.ADD?(Tq(c,t),o(c,t)):c.refine===Jo.REPLACE&&(o(c,t),d&&Tq(c,t)):(n._emptyTiles.push(c),o(c,t),d&&Tq(c,t)),r(c,t),s(c,t)}}function AQe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ta,s=!0,a=CP.stack;for(a.push(e);a.length>0;){CP.stackMaximumLength=Math.max(CP.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let p=0;p<f;++p){let _=u[p];a.push(_)}}return e.hasEmptyContent||s}var Ek=tde;function nde(){}var AP={stack:new Vl,stackMaximumLength:0},EP={stack:new Vl,stackMaximumLength:0},I_={stack:new Vl,stackMaximumLength:0,ancestorStack:new Vl,ancestorStackMaximumLength:0},EQe=2;nde.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(Ta.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;DQe(n,t),RQe(n,t),AP.stack.trim(AP.stackMaximumLength),EP.stack.trim(EP.stackMaximumLength),I_.stack.trim(I_.stackMaximumLength),I_.ancestorStack.trim(I_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function SQe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ta,r=EP.stack;for(r.push(e);r.length>0;){EP.stackMaximumLength=Math.max(EP.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<EQe&&r.push(u))}}}function Sk(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:SQe(e,t)}function vQe(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 wQe(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 IQe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ta;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Ta.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function PQe(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 DQe(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}=Ta,c=AP.stack;for(c.push(e);c.length>0;){AP.stackMaximumLength=Math.max(AP.stackMaximumLength,c.length);let u=c.pop();vQe(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?IQe(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Jo.ADD?(Sk(u,t),r(u,t)):u.refine===Jo.REPLACE&&(PQe(u,i)?(r(u,t),p&&Sk(u,t)):p?(Sk(u,t),r(u,t)):wQe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&Sk(u,t)),s(u,t),a(u,t)}}function RQe(e,t){let{selectTile:n,canTraverse:i}=Ta,{stack:o,ancestorStack:r}=I_,s;for(o.push(e);o.length>0||r.length>0;){if(I_.stackMaximumLength=Math.max(I_.stackMaximumLength,o.length),I_.ancestorStackMaximumLength=Math.max(I_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Jo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var vk=nde;function or(e){e=e??G.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new xk,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 Vl,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 Ck,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?O.clone(e.modelMatrix):O.clone(O.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Lm,this._statisticsLast=new Lm,this._statisticsPerPass=new Array(qo.NUMBER_OF_PASSES);for(let o=0;o<qo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Lm;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 Tk(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=P.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??te.WGS84,this._initialClippingPlanesOriginMatrix=O.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??P.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Tn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Tu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new s_(e.pointCloudShading),this._pointCloudEyeDomeLighting=new py,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me,this.tileLoad=new me,this.tileUnload=new me,this.tileFailed=new me,this.tileVisible=new me,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)&&Os.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Tm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new cA,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new fy(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??H.BLACK,this.splitDirection=e.splitDirection??Jr.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&&Tt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(or.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){Os.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Tm.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 Mo("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=O.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&&(O.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):O.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,ude(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}}});or.fromIonAssetId=async function(e,t){let n=await Rf.fromAssetId(e);return or.fromUrl(n,t)};or.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await or.loadJson(n),r=await OQe(n,o),s=new or(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,ude(s);let c=l(o.asset.gltfUpAxis)?Go.fromName(o.asset.gltfUpAxis):Go.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Go.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,O.IDENTITY).boundingSphere.center,_=s._ellipsoid.cartesianToCartographic(p);return l(_)&&_.height>mi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Et.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=O.clone(s._initialClippingPlanesOriginMatrix),s};or.loadJson=function(e){return Ee.createIfNeeded(e).fetchJson()};or.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};or.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new se("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new se("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&or.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=ide(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===Jo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=ide(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&gk.checkChildrenWithinParent(c)}return s};function ide(e,t,n,i){if(!(l(n.implicitTiling)||ci(n,"3DTILES_implicit_tiling")))return new sh(e,t,n,i);let r=e.schema,s=new _E(t,n,r),a=new gE({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Fe(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new sh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function OQe(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=Ri.getSchemaLoader({resource:e});else if(l(n.schema))i=Ri.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new mE({schema:i.schema,metadataJson:n});return Ri.unload(i),o}var ode=new h,MQe=new fe,LQe=new O,NQe=new h,FQe=new h,BQe=new h,kQe=new h;function UQe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof $f)n=h.normalize(a.positionWC,ode),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let y=O.inverseTransformation(c.computedTransform,LQe),x=t.mapProjection.ellipsoid,b=u.boundingVolume,T=O.multiplyByPoint(y,b.center,NQe);if(h.magnitude(T)>x.minimumRadius){let C=fe.fromCartesian(T,x,MQe);n=h.normalize(a.positionWC,ode),i=a.directionWC,o=a.positionCartographic.height,r=0,s=C.height*2}else{let C=O.multiplyByPoint(y,a.positionWC,FQe);if(n=h.UNIT_Z,i=O.multiplyByPointAsVector(y,a.directionWC,BQe),i=h.normalize(i,i),o=C.z,u instanceof Du){let A=Z.getColumn(b.halfAxes,2,kQe),S=h.magnitude(A);r=T.z-S,s=T.z+S}else if(u instanceof Fy){let A=b.radius;r=T.z-A,s=T.z+A}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,_=P.clamp((o-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-_),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function zQe(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=>{ade(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?eJe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function sde(e,t){return e._priority-t._priority}or.prototype.postPassesUpdate=function(e){l(this._root)&&(VQe(this,e),nJe(this,e),this._cache.unloadTiles(this,lde),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};or.prototype.prePassesUpdate=function(e){if(!l(this._root))return;XQe(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=$.clone(e.time)),this._timeSinceLoad=Math.max($.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&UQe(this,e),e.newFrame&&this._cache.reset()};function VQe(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!==nr.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function HQe(e){let t=e._requestedTiles;t.sort(sde);for(let n=0;n<t.length;++n)zQe(e,t[n])}function ade(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 GQe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==nr.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var jQe=new fe,WQe=new fe,qQe=new h;function YQe(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=fe.clone(r.positionCartographic,jQe),c=fe.fromCartesian(o.center,s,WQe);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,qQe);h.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function XQe(e,t){GQe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,ade(f,e,u)}}e.totalMemoryUsageInBytes<i?$Qe(e):a&&n.length>0&&KQe(e)}function KQe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(sde)}function $Qe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var wk=new h,ZQe={maximumFractionDigits:3};function rde(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,ZQe):Math.round(t).toLocaleString()}function Cq(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,wk);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=h.normalize(i,wk);r=h.multiplyByScalar(r,.75*n,wk),o=h.add(r,i,wk)}return o}function Aq(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: ${rde(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${rde(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 QQe(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:Cq(e.debugPickedTile),a=Aq(e.debugPickedTile,e,s);a.pixelOffset=new V(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];Aq(a,e,Cq(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&Aq(a,e,Cq(a))}}e._tileDebugLabels.update(t)}function JQe(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 ri({stencil:0,pass:Se.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:jt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),YQe(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let _=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let x=_-1;x>=0;--x)i[d+y+x]=i[d+x];for(let x=0;x<y;++x)i[d+x]=m[x]}_=i.length-r,c.numberOfCommands=_,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new g_),QQe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var cde=[];function eJe(e,t){let n=t,i=cde;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&&(tJe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function lde(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function tJe(e,t){e._cache.unloadTile(e,t,lde),t.destroy()}or.prototype.trimLoadedTiles=function(){this._cache.trim()};function nJe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Lm.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 iJe(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 oJe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!O.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=O.clone(e.modelMatrix,e._previousModelMatrix)))}function rJe(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,iJe(e),oJe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&HQe(e),JQe(e,t,i),Lm.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 ude(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(_t.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 _t(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}or.prototype.getTraversal=function(e){let{pass:t}=e;return t===qo.MOST_DETAILED_PRELOAD||t===qo.MOST_DETAILED_PICK?Ak:this.isSkippingLevelOfDetail?vk:Ek};or.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};or.prototype.updateForPass=function(e,t){let n=t.pass;if(n===qo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===qo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===qo.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=qo.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=rJe(this,e,d,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};or.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};or.prototype.isDestroyed=function(){return!1};or.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=cde;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,ce(this)};or.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};or.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!or.supportedExtensions[e[t]])throw new se(`Unsupported 3D Tiles Extension: ${e[t]}`)};var sJe=new gn,aJe=new h,cJe=new fe;or.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=sJe,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,aJe);if(l(r))return n.cartesianToCartographic(r,cJe)?.height};or.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var lJe=new hc,uJe=new h;or.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=ni.raySphere(e,u.contentBoundingVolume.boundingSphere,lJe);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=re.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=re.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,uJe);if(l(f))return a=h.clone(f,n),a}};var Ls=or;var fJe=new O;function ky(e,t){t.collectionChanged.addEventListener(ky.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new It,this._onCollectionChanged(t,t.values,[],[])}ky.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,fJe),c=Ee.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],dJe(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};ky.prototype.isDestroyed=function(){return!1};ky.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ky.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Eq(this,e[i],t,n);return ce(this)};ky.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?(re.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};ky.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):(Eq(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Eq(this,r,a,c),s.remove(r.id)};function Eq(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function dJe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Ls.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 Ik=ky;var hJe=H.WHITE,mJe=H.BLACK,pJe=new V(2,2);function yE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(yE.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});yE.prototype.getType=function(e){return"Checkerboard"};var _Je=new $;yE.prototype.getValue=function(e,t){return l(e)||(e=$.now(_Je)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,hJe,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,mJe,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,pJe),t};yE.prototype.equals=function(e){return this===e||e instanceof yE&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var SP=yE;var fde={id:void 0};function vP(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function Ec(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 me,this._id=Nn(),this._show=!0,this._firing=!1,this._refire=!1}Ec.prototype.suspendEvents=function(){this._suspendCount++};Ec.prototype.resumeEvents=function(){this._suspendCount--,vP(this)};Object.defineProperties(Ec.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}}});Ec.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.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;$.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),$.greaterThan(c,t)&&!c.equals(Ge.MAXIMUM_VALUE)&&(t=c)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new Sn({start:e,stop:t})};Ec.prototype.add=function(e){e instanceof hr||(e=new hr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`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(Ec.prototype._onEntityDefinitionChanged,this),vP(this),e};Ec.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Ec.prototype.contains=function(e){return this._entities.get(e.id)===e};Ec.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(Ec.prototype._onEntityDefinitionChanged,this),vP(this),!0):!1};Ec.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(Ec.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),vP(this)};Ec.prototype.getById=function(e){return this._entities.get(e)};Ec.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(fde.id=e,t=new hr(fde),this.add(t)),t};Ec.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),vP(this)};var Ca=Ec;var Pk={id:void 0},xE=new Array(2);function Sq(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 dde(e,t,n,i){xE[0]=n,xE[1]=i.id,t[JSON.stringify(xE)]=i.definitionChanged.addEventListener(jr.prototype._onDefinitionChanged,e)}function hde(e,t,n,i){xE[0]=n,xE[1]=i.id;let o=JSON.stringify(xE);t[o](),t[o]=void 0}function Uy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,d=new Ca(e),p=e._eventHash,_;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(jr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--)s=a[c],hde(e,p,_,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(jr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--){s=a[c],dde(e,p,_,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?Sq(y):(Pk.id=s.id,y=new hr(Pk)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function jr(e,t){this._owner=t,this._composite=new Ca(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Nn(),this._eventHash={},Uy(this),this._shouldRecomposite=!1}Object.defineProperties(jr.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}}});jr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Uy(this)};jr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Uy(this),!0):!1};jr.prototype.removeAllCollections=function(){this._collections.length=0,Uy(this)};jr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};jr.prototype.contains=function(e){return this._composite.contains(e)};jr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};jr.prototype.getCollection=function(e){return this._collections[e]};jr.prototype.getCollectionsLength=function(){return this._collections.length};function Dk(e,t){return e.indexOf(t)}function mde(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Uy(e)}jr.prototype.raiseCollection=function(e){let t=Dk(this._collections,e);mde(this,t,t+1)};jr.prototype.lowerCollection=function(e){let t=Dk(this._collections,e);mde(this,t,t-1)};jr.prototype.raiseCollectionToTop=function(e){let t=Dk(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Uy(this))};jr.prototype.lowerCollectionToBottom=function(e){let t=Dk(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Uy(this))};jr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};jr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Uy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};jr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};jr.prototype.getById=function(e){return this._composite.getById(e)};jr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];hde(this,d,p,m);let y=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=r.getById(y),Sq(u)),u.merge(c));l(u)||r.removeById(y),u=void 0}let _=t.length;for(s=0;s<_;s++){let m=t[s];dde(this,d,p,m);let y=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=r.getById(y),l(u)?Sq(u):(Pk.id=y,u=new hr(Pk),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};jr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let _=o[p].getById(e.id);if(l(_)){let m=_[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var pde=jr;function vq(){this._removalFunctions=[]}vq.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)}};vq.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var wr=vq;function Pq(e,t){return $.compare(e.start,t.start)}function Wr(e){if(this._intervals=[],this._changedEvent=new me,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Wr.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}}});Wr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Wr))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(!Sn.equals(n[r],i[r],t))return!1;return!0};Wr.prototype.get=function(e){return this._intervals[e]};Wr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Wr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Wr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Wr.prototype.contains=function(e){return this.indexOf(e)>=0};var wq=new Sn;Wr.prototype.indexOf=function(e){let t=this._intervals;wq.start=e,wq.stop=e;let n=zo(t,wq,Pq);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&&Sn.contains(t[n-1],e)?n-1:~n)};Wr.prototype.findInterval=function(e){e=e??G.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]}};Wr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||$.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=zo(n,e,Pq);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=$.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)?($.greaterThan(e.stop,n[i-1].stop)?e=new Sn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Sn({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=$.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Sn({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 Sn({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=$.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 Sn({start:e.start,stop:$.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:$.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Sn({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)};Wr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=zo(t,e,Pq);n<0&&(n=~n);let i=!1;for(n>0&&($.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,($.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 Sn({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 Sn({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 Sn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&$.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 Sn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Sn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&($.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Sn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Wr.prototype.intersect=function(e,t,n){let i=new Wr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if($.lessThan(c.stop,u.start))++o;else if($.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Sn.intersect(c,u,new Sn,n);f.isEmpty||i.addInterval(f,t)}$.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Wr.fromJulianDateArray=function(e,t){l(t)||(t=new Wr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Sn({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],_=n[d+1];u=new Sn({start:p,stop:_,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=_}return c&&(u=new Sn({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var Sc=new _g,wP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Iq(e,t,n){l(n)||(n=new $),$.toGregorianDate(e,Sc);let i=Sc.millisecond+t.millisecond,o=Sc.second+t.second,r=Sc.minute+t.minute,s=Sc.hour+t.hour,a=Sc.day+t.day,c=Sc.month+t.month,u=Sc.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),wP[2]=Wh(u)?29:28;a>wP[c]||c>=13;)a>wP[c]&&(a-=wP[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),wP[2]=Wh(u)?29:28;return Sc.millisecond=i,Sc.second=o,Sc.minute=r,Sc.hour=s,Sc.day=a,Sc.month=c,Sc.year=u,$.fromGregorianDate(Sc,n)}var gJe=new $,yJe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function _de(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(yJe);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"),$.toGregorianDate($.fromIso8601(e,gJe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var IP=new _g;Wr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=$.fromIso8601(n[0]),o=$.fromIso8601(n[1]),r=[];if(!_de(n[2],IP))r.push(i,o);else{let s=$.clone(i);for(r.push(s);$.compare(s,o)<0;)s=Iq(s,IP),$.compare(o,s)<=0&&$.clone(o,s),r.push(s)}return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DateArray=function(e,t){return Wr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return $.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let u=0;u<c;++u)(_de(i[u],IP)||u===0)&&(o&&l(a)?s=Iq(a,IP):s=Iq(n,IP),r.push(s),a=s);return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var is=Wr;function xJe(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 Ib(){this._eventHelper=new wr,this._definitionChanged=new me,this._intervals=new is,this._intervals.changedEvent.addEventListener(Ib.prototype._intervalsChanged,this)}Object.defineProperties(Ib.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var bJe=new $;Ib.prototype.getValue=function(e,t){l(e)||(e=$.now(bJe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ib.prototype.equals=function(e){return this===e||e instanceof Ib&&this._intervals.equals(e._intervals,X.equals)};Ib.prototype._intervalsChanged=function(){xJe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var ll=Ib;function zy(){this._definitionChanged=new me,this._composite=new ll,this._composite.definitionChanged.addEventListener(zy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(zy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});zy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var TJe=new $;zy.prototype.getValue=function(e,t){l(e)||(e=$.now(TJe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};zy.prototype.equals=function(e){return this===e||e instanceof zy&&this._composite.equals(e._composite,X.equals)};zy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var PP=zy;function Vy(e){this._referenceFrame=e??Wi.FIXED,this._definitionChanged=new me,this._composite=new ll,this._composite.definitionChanged.addEventListener(Vy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Vy.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 CJe=new $;Vy.prototype.getValue=function(e,t){return l(e)||(e=$.now(CJe)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Vy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Vy.prototype.equals=function(e){return this===e||e instanceof Vy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};Vy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ga=Vy;var AJe={ROUNDED:0,MITERED:1,BEVELED:2},Vi=Object.freeze(AJe);var Aa=[new h,new h],EJe=new h,SJe=new h,vJe=new h,wJe=new h,IJe=new h,PJe=new h,DJe=new h,RJe=new h,OJe=new h,bE=new h,Rk=new h,DP={},Dq=new fe;function MJe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Dq=t.cartesianToCartographic(o,Dq),n[i]=Dq.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Rq(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var Ok=new h,Mk=new h;function LJe(e,t,n,i){let o=new fs(n,i),r=o.projectPointOntoPlane(h.add(n,e,Ok),Ok),s=o.projectPointOntoPlane(h.add(n,t,Mk),Mk),a=V.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var NJe=new h(-1,0,0),Pb=new O,FJe=new O,Oq=new Z,BJe=Z.IDENTITY.clone(),kJe=new h,UJe=new ie,gde=new h;function P_(e,t,n,i,o,r,s,a){let c=kJe,u=UJe;Pb=Et.eastNorthUpToFixedFrame(e,o,Pb),c=O.multiplyByPointAsVector(Pb,NJe,c),c=h.normalize(c,c);let f=LJe(c,t,e,o);Oq=Z.fromRotationZ(f,Oq),gde.z=r,Pb=O.multiplyTransformation(Pb,O.fromRotationTranslation(Oq,gde,FJe),Pb);let d=BJe;d[0]=s;for(let p=0;p<a;p++)for(let _=0;_<n.length;_+=3)u=h.fromArray(n,_,u),u=Z.multiplyByVector(d,u,u),u=O.multiplyByPoint(Pb,u,u),i.push(u.x,u.y,u.z);return i}var zJe=new h;function Mq(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,zJe);i=P_(c,t,n,i,o,r[a/3],s,1)}return i}function VJe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function yde(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 xde=new Pe,bde=new h,Tde=new Z;function Cde(e,t,n,i,o,r,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,bE),h.subtract(n,e,Rk)),d=i===Vi.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=Z.fromQuaternion(Pe.fromAxisAngle(h.negate(e,bE),f/(d+1),xde),Tde):p=Z.fromQuaternion(Pe.fromAxisAngle(e,f/(d+1),xde),Tde);let _,m;if(t=h.clone(t,bde),d>0){let y=u?2:1;for(let x=0;x<d;x++)t=Z.multiplyByVector(p,t,t),_=h.subtract(t,e,bE),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(t,Rk),s=P_(m,_,a,s,r,c,1,y)}else _=h.subtract(t,e,bE),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(t,Rk),s=P_(m,_,a,s,r,c,1,1),n=h.clone(n,bde),_=h.subtract(n,e,bE),_=h.normalize(_,_),o||(_=h.negate(_,_)),m=r.scaleToGeodeticSurface(n,Rk),s=P_(m,_,a,s,r,c,1,1);return s}DP.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];V.equals(r,s)||n.push(s)}return n};DP.angleIsGreaterThanPi=function(e,t,n,i){let o=new fs(n,i),r=o.projectPointOntoPlane(h.add(n,e,Ok),Ok),s=o.projectPointOntoPlane(h.add(n,t,Mk),Mk);return s.x*r.y-s.y*r.x>=0};var HJe=new h,GJe=new h;DP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=MJe(e,r),a=i._granularity,c=i._cornerType,u=o?VJe(t,n):yde(t,n),f=o?yde(t,n):void 0,d=n.height/2,p=n.width/2,_=e.length,m=[],y=o?[]:void 0,x=EJe,b=SJe,T=vJe,C=wJe,A=IJe,S=PJe,w=DJe,R=RJe,D=OJe,M=e[0],L=e[1];C=r.geodeticSurfaceNormal(M,C),x=h.subtract(L,M,x),x=h.normalize(x,x),R=h.cross(C,x,R),R=h.normalize(R,R);let g=s[0],E=s[1];o&&(y=P_(M,R,f,y,r,g+d,1,1)),D=h.clone(M,D),M=L,b=h.negate(x,b);let v,I;for(let U=1;U<_-1;U++){let k=o?2:1;if(L=e[U+1],M.equals(L)){Tt("Positions are too close and are considered equivalent with rounding error.");continue}x=h.subtract(L,M,x),x=h.normalize(x,x),C=r.geodeticSurfaceNormal(M,C);let z=h.multiplyByScalar(C,h.dot(x,C),HJe);h.subtract(x,z,z),h.normalize(z,z);let B=h.multiplyByScalar(C,h.dot(b,C),GJe);if(h.subtract(b,B,B),h.normalize(B,B),!P.equalsEpsilon(Math.abs(h.dot(z,B)),1,P.EPSILON7)){T=h.add(x,b,T),T=h.normalize(T,T),T=h.cross(T,C,T),T=h.cross(C,T,T),T=h.normalize(T,T);let W=1/Math.max(.25,h.magnitude(h.cross(T,b,bE))),J=DP.angleIsGreaterThanPi(x,b,M,r);J?(A=h.add(M,h.multiplyByScalar(T,W*p,T),A),S=h.add(A,h.multiplyByScalar(R,p,S),S),Aa[0]=h.clone(D,Aa[0]),Aa[1]=h.clone(S,Aa[1]),v=Rq(Aa,g+d,E+d,a),I=zi.generateArc({positions:Aa,granularity:a,ellipsoid:r}),m=Mq(I,R,u,m,r,v,1),R=h.cross(C,x,R),R=h.normalize(R,R),w=h.add(A,h.multiplyByScalar(R,p,w),w),c===Vi.ROUNDED||c===Vi.BEVELED?Cde(A,S,w,c,J,r,m,u,E+d,o):(T=h.negate(T,T),m=P_(M,T,u,m,r,E+d,W,k)),D=h.clone(w,D)):(A=h.add(M,h.multiplyByScalar(T,W*p,T),A),S=h.add(A,h.multiplyByScalar(R,-p,S),S),Aa[0]=h.clone(D,Aa[0]),Aa[1]=h.clone(S,Aa[1]),v=Rq(Aa,g+d,E+d,a),I=zi.generateArc({positions:Aa,granularity:a,ellipsoid:r}),m=Mq(I,R,u,m,r,v,1),R=h.cross(C,x,R),R=h.normalize(R,R),w=h.add(A,h.multiplyByScalar(R,-p,w),w),c===Vi.ROUNDED||c===Vi.BEVELED?Cde(A,S,w,c,J,r,m,u,E+d,o):m=P_(M,T,u,m,r,E+d,W,k),D=h.clone(w,D)),b=h.negate(x,b)}else m=P_(D,R,u,m,r,g+d,1,1),D=M;g=E,E=s[U+1],M=L}Aa[0]=h.clone(D,Aa[0]),Aa[1]=h.clone(M,Aa[1]),v=Rq(Aa,g+d,E+d,a),I=zi.generateArc({positions:Aa,granularity:a,ellipsoid:r}),m=Mq(I,R,u,m,r,v,1),o&&(y=P_(M,R,f,y,r,E+d,1,1)),_=m.length;let N=o?_+y.length:_,F=new Float64Array(N);return F.set(m),o&&F.set(y,_),F};var Nm=DP;var Nq={},TE=new h,wde=new h,jJe=new h,Ade=new h,ul=[new h,new h],Ide=new h,Pde=new h,Dde=new h,WJe=new h,qJe=new h,YJe=new h,XJe=new h,KJe=new h,$Je=new h,ZJe=new h,Ede=new Pe,Sde=new Z;function Lk(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,TE),h.subtract(n,e,wde)),s=i===Vi.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=Z.fromQuaternion(Pe.fromAxisAngle(h.negate(e,TE),r/s,Ede),Sde):u=Z.fromQuaternion(Pe.fromAxisAngle(e,r/s,Ede),Sde);let f=0;t=h.clone(t,TE);for(let d=0;d<s;d++)t=Z.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function QJe(e){let t=Ide,n=Pde,i=Dde,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=Lk(t,n,i,Vi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=Lk(t,n,i,Vi.ROUNDED,!1);return[r,c]}function vde(e,t,n,i){let o=TE;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function Lq(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,TE),a=h.negate(s,wde),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,jJe),p=h.add(d,a,Ade);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let _=h.add(d,s,Ade);r[u--]=_.z,r[u--]=_.y,r[u--]=_.x}return i.push(o,r),i}Nq.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 JJe=new h,eet=new h;Nq.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Ide,c=Pde,u=Dde,f=WJe,d=qJe,p=YJe,_=XJe,m=KJe,y=$Je,x=ZJe,b=[],T=s?[]:void 0,C=s?[]:void 0,A=n[0],S=n[1];c=h.normalize(h.subtract(S,A,c),c),a=i.geodeticSurfaceNormal(A,a),f=h.normalize(h.cross(a,c,f),f),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),_=h.clone(A,_),A=S,u=h.negate(c,u);let w,R=[],D,M=n.length;for(D=1;D<M-1;D++){a=i.geodeticSurfaceNormal(A,a),S=n[D+1],c=h.normalize(h.subtract(S,A,c),c);let g=h.multiplyByScalar(a,h.dot(c,a),JJe);h.subtract(c,g,g),h.normalize(g,g);let E=h.multiplyByScalar(a,h.dot(u,a),eet);if(h.subtract(u,E,E),h.normalize(E,E),!P.equalsEpsilon(Math.abs(h.dot(g,E)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let I=o/Math.max(.25,h.magnitude(h.cross(d,u,TE))),N=Nm.angleIsGreaterThanPi(c,u,A,i);d=h.multiplyByScalar(d,I,d),N?(m=h.add(A,d,m),x=h.add(m,h.multiplyByScalar(f,o,x),x),y=h.add(m,h.multiplyByScalar(f,o*2,y),y),ul[0]=h.clone(_,ul[0]),ul[1]=h.clone(x,ul[1]),w=zi.generateArc({positions:ul,granularity:t,ellipsoid:i}),b=Lq(w,f,o,b),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,o*2,y),y),_=h.add(m,h.multiplyByScalar(f,o,_),_),r===Vi.ROUNDED||r===Vi.BEVELED?R.push({leftPositions:Lk(m,p,y,r,N)}):R.push({leftPositions:vde(A,h.negate(d,d),y,N)})):(y=h.add(A,d,y),x=h.add(y,h.negate(h.multiplyByScalar(f,o,x),x),x),m=h.add(y,h.negate(h.multiplyByScalar(f,o*2,m),m),m),ul[0]=h.clone(_,ul[0]),ul[1]=h.clone(x,ul[1]),w=zi.generateArc({positions:ul,granularity:t,ellipsoid:i}),b=Lq(w,f,o,b),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,o*2,m),m),m),_=h.add(y,h.negate(h.multiplyByScalar(f,o,_),_),_),r===Vi.ROUNDED||r===Vi.BEVELED?R.push({rightPositions:Lk(y,p,m,r,N)}):R.push({rightPositions:vde(A,d,m,N)})),u=h.negate(c,u)}A=S}a=i.geodeticSurfaceNormal(A,a),ul[0]=h.clone(_,ul[0]),ul[1]=h.clone(A,ul[1]),w=zi.generateArc({positions:ul,granularity:t,ellipsoid:i}),b=Lq(w,f,o,b),s&&(T.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z));let L;return r===Vi.ROUNDED&&(L=QJe(b)),{positions:b,corners:R,lefts:T,normals:C,endPositions:L}};var Yi=Nq;var Mde=new h,Lde=new h,Nk=new h,Fk=new h,tet=new h,Nde=new h,Hy=new h,CE=new h;function Fde(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function ah(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,Hy),Hy);r.normal&&Yi.addAttribute(s,t,i,o),r.tangent&&Yi.addAttribute(a,u,i,o),r.bitangent&&Yi.addAttribute(c,n,i,o)}function Bde(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new pn,u,f=0,d=0,p,_=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,_+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,_+=m):(m=o[p].rightPositions.length,d+=m,_+=m)}let y=l(r),x;y&&(x=r[0].length-3,f+=x,d+=x,x/=3,_+=x*6);let b=f+d,T=new Float64Array(b),C=t.normal?new Float32Array(b):void 0,A=t.tangent?new Float32Array(b):void 0,S=t.bitangent?new Float32Array(b):void 0,w={normals:C,tangents:A,bitangents:S},R=0,D=b-1,M,L,g,E,v=Mde,I=Lde,N,F,U=x/2,k=ke.createTypedArray(b/3,_),z=0;if(y){F=Nk,N=Fk;let Q=r[0];for(v=h.fromArray(a,0,v),I=h.fromArray(s,0,I),p=0;p<U;p++)F=h.fromArray(Q,(U-1-p)*3,F),N=h.fromArray(Q,(U+p)*3,N),Yi.addAttribute(T,N,R),Yi.addAttribute(T,F,void 0,D),ah(w,v,I,R,D,t),L=R/3,E=L+1,M=(D-2)/3,g=M-1,k[z++]=M,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,D-=3}let B=0,j=0,W=i[B++],J=i[B++];T.set(W,R),T.set(J,D-J.length+1),I=h.fromArray(s,j,I);let Y,ee;for(m=J.length-3,p=0;p<m;p+=3)Y=n.geodeticSurfaceNormal(h.fromArray(W,p,Hy),Hy),ee=n.geodeticSurfaceNormal(h.fromArray(J,m-p,CE),CE),v=h.normalize(h.add(Y,ee,v),v),ah(w,v,I,R,D,t),L=R/3,E=L+1,M=(D-2)/3,g=M-1,k[z++]=M,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,D-=3;for(Y=n.geodeticSurfaceNormal(h.fromArray(W,m,Hy),Hy),ee=n.geodeticSurfaceNormal(h.fromArray(J,m,CE),CE),v=h.normalize(h.add(Y,ee,v),v),j+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,ge=u.rightPositions,le,ye,be=Nde,Ie=Nk,Te=Fk;if(v=h.fromArray(a,j,v),l(de)){for(ah(w,v,I,void 0,D,t),D-=3,le=E,ye=g,Q=0;Q<de.length/3;Q++)be=h.fromArray(de,Q*3,be),k[z++]=le,k[z++]=ye-Q-1,k[z++]=ye-Q,Yi.addAttribute(T,be,void 0,D),Ie=h.fromArray(T,(ye-Q-1)*3,Ie),Te=h.fromArray(T,le*3,Te),I=h.normalize(h.subtract(Ie,Te,I),I),ah(w,v,I,void 0,D,t),D-=3;be=h.fromArray(T,le*3,be),Ie=h.subtract(h.fromArray(T,ye*3,Ie),be,Ie),Te=h.subtract(h.fromArray(T,(ye-Q)*3,Te),be,Te),I=h.normalize(h.add(Ie,Te,I),I),ah(w,v,I,R,void 0,t),R+=3}else{for(ah(w,v,I,R,void 0,t),R+=3,le=g,ye=E,Q=0;Q<ge.length/3;Q++)be=h.fromArray(ge,Q*3,be),k[z++]=le,k[z++]=ye+Q,k[z++]=ye+Q+1,Yi.addAttribute(T,be,R),Ie=h.fromArray(T,le*3,Ie),Te=h.fromArray(T,(ye+Q)*3,Te),I=h.normalize(h.subtract(Ie,Te,I),I),ah(w,v,I,R,void 0,t),R+=3;be=h.fromArray(T,le*3,be),Ie=h.subtract(h.fromArray(T,(ye+Q)*3,Ie),be,Ie),Te=h.subtract(h.fromArray(T,ye*3,Te),be,Te),I=h.normalize(h.negate(h.add(Te,Ie,I),I),I),ah(w,v,I,void 0,D,t),D-=3}for(W=i[B++],J=i[B++],W.splice(0,3),J.splice(J.length-3,3),T.set(W,R),T.set(J,D-J.length+1),m=J.length-3,j+=3,I=h.fromArray(s,j,I),Q=0;Q<J.length;Q+=3)Y=n.geodeticSurfaceNormal(h.fromArray(W,Q,Hy),Hy),ee=n.geodeticSurfaceNormal(h.fromArray(J,m-Q,CE),CE),v=h.normalize(h.add(Y,ee,v),v),ah(w,v,I,R,D,t),E=R/3,L=E-1,g=(D-2)/3,M=g+1,k[z++]=M,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,D-=3;R-=3,D+=3}if(v=h.fromArray(a,a.length-3,v),ah(w,v,I,R,D,t),y){R+=3,D-=3,F=Nk,N=Fk;let Q=r[1];for(p=0;p<U;p++)F=h.fromArray(Q,(x-p-1)*3,F),N=h.fromArray(Q,p*3,N),Yi.addAttribute(T,F,void 0,D),Yi.addAttribute(T,N,R),ah(w,v,I,R,D,t),E=R/3,L=E-1,g=(D-2)/3,M=g+1,k[z++]=M,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=E,R+=3,D-=3}if(c.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:T}),t.st){let Q=new Float32Array(b/3*2),de,ge,le=0;if(y){f/=3,d/=3;let ye=Math.PI/(x+1);ge=1/(f-x+1),de=1/(d-x+1);let be,Ie=x/2;for(p=Ie+1;p<x+1;p++)be=P.PI_OVER_TWO+ye*p,Q[le++]=de*(1+Math.cos(be)),Q[le++]=.5*(1+Math.sin(be));for(p=1;p<d-x+1;p++)Q[le++]=p*de,Q[le++]=0;for(p=x;p>Ie;p--)be=P.PI_OVER_TWO-p*ye,Q[le++]=1-de*(1+Math.cos(be)),Q[le++]=.5*(1+Math.sin(be));for(p=Ie;p>0;p--)be=P.PI_OVER_TWO-ye*p,Q[le++]=1-ge*(1+Math.cos(be)),Q[le++]=.5*(1+Math.sin(be));for(p=f-x;p>0;p--)Q[le++]=p*ge,Q[le++]=1;for(p=1;p<Ie+1;p++)be=P.PI_OVER_TWO+ye*p,Q[le++]=ge*(1+Math.cos(be)),Q[le++]=.5*(1+Math.sin(be))}else{for(f/=3,d/=3,ge=1/(f-1),de=1/(d-1),p=0;p<d;p++)Q[le++]=p*de,Q[le++]=0;for(p=f;p>0;p--)Q[le++]=(p-1)*ge,Q[le++]=1}c.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:k}}function net(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,_=Mde,m=Lde,y=Nk,x=Fk,b=tet,T=Nde,C=c;for(u=0;u<s;u+=3){let A=C+c;_=h.fromArray(n,u,_),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,_,m),y=h.subtract(y,_,y),x=h.normalize(h.cross(m,y,x),x),t.normal&&(Yi.addAttribute(f,x,A),Yi.addAttribute(f,x,A+3),Yi.addAttribute(f,x,C),Yi.addAttribute(f,x,C+3)),(t.tangent||t.bitangent)&&(T=h.fromArray(i,u,T),t.bitangent&&(Yi.addAttribute(p,T,A),Yi.addAttribute(p,T,A+3),Yi.addAttribute(p,T,C),Yi.addAttribute(p,T,C+3)),t.tangent&&(b=h.normalize(h.cross(T,x,b),b),Yi.addAttribute(d,b,A),Yi.addAttribute(d,b,A+3),Yi.addAttribute(d,b,C),Yi.addAttribute(d,b,C+3))),C+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let A=e.tangent.values;d.set(A),d.set(A,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let _=0;_<2;_++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function Fq(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 iet(e,t){let n=new De({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=Yi.computePositions(e),r=Bde(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),_=new Float64Array(d);_.set(f);let m=new Float64Array(d*4);f=li.scaleToGeodeticHeight(f,s,i),m=Fq(f,0,m),_=li.scaleToGeodeticHeight(_,a,i),m=Fq(_,d*2,m),p.set(f),p.set(_,d),p.set(m,d*2),c.position.values=p,c=net(c,t);let y,x=d/3;if(e.shadowVolume){let M=c.normal.values;d=M.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)M[y]=-M[y];L.set(M,d),L=Fq(M,d*4,L),c.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(x*6);if(e.offsetAttribute===cn.TOP)M=M.fill(1,0,x).fill(1,x*2,x*4);else{let L=e.offsetAttribute===cn.NONE?0:1;M=M.fill(L)}c.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let b=u.length,T=x+x,C=ke.createTypedArray(p.length/3,b*2+T*3);C.set(u);let A=b;for(y=0;y<b;y+=3){let M=u[y],L=u[y+1],g=u[y+2];C[A++]=g+x,C[A++]=L+x,C[A++]=M+x}let S,w,R,D;for(y=0;y<T;y+=2)S=y+T,w=S+T,R=S+1,D=w+1,C[A++]=S,C[A++]=w,C[A++]=R,C[A++]=R,C[A++]=w,C[A++]=D;return{attributes:c,indices:C}}var Rde=new h,RP=new h,Jf=new fe;function Ode(e,t,n,i,o,r){let s=h.subtract(t,e,Rde);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,RP),c=h.cross(s,a,Rde);h.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;h.add(e,c,RP),n.cartesianToCartographic(RP,Jf);let _=Jf.latitude,m=Jf.longitude;u=Math.min(u,_),f=Math.min(f,m),d=Math.max(d,_),p=Math.max(p,m),h.subtract(e,c,RP),n.cartesianToCartographic(RP,Jf),_=Jf.latitude,m=Jf.longitude,u=Math.min(u,_),f=Math.min(f,m),d=Math.max(d,_),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var Qf=new h,OP=new h,Zl=new fe,Ql=new fe;function kde(e,t,n,i,o){e=Fde(e,t);let r=vo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ae;let a=n*.5;Zl.latitude=Number.POSITIVE_INFINITY,Zl.longitude=Number.POSITIVE_INFINITY,Ql.latitude=Number.NEGATIVE_INFINITY,Ql.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Vi.ROUNDED){let p=r[0];h.subtract(p,r[1],Qf),h.normalize(Qf,Qf),h.multiplyByScalar(Qf,a,Qf),h.add(p,Qf,OP),t.cartesianToCartographic(OP,Jf),c=Jf.latitude,u=Jf.longitude,Zl.latitude=Math.min(Zl.latitude,c),Zl.longitude=Math.min(Zl.longitude,u),Ql.latitude=Math.max(Ql.latitude,c),Ql.longitude=Math.max(Ql.longitude,u)}for(let p=0;p<s-1;++p)Ode(r[p],r[p+1],t,a,Zl,Ql);let f=r[s-1];h.subtract(f,r[s-2],Qf),h.normalize(Qf,Qf),h.multiplyByScalar(Qf,a,Qf),h.add(f,Qf,OP),Ode(f,OP,t,a,Zl,Ql),i===Vi.ROUNDED&&(t.cartesianToCartographic(OP,Jf),c=Jf.latitude,u=Jf.longitude,Zl.latitude=Math.min(Zl.latitude,c),Zl.longitude=Math.min(Zl.longitude,u),Ql.latitude=Math.max(Ql.latitude,c),Ql.longitude=Math.max(Ql.longitude,u));let d=l(o)?o:new ae;return d.north=Ql.latitude,d.south=Zl.latitude,d.east=Ql.longitude,d.west=Zl.longitude,d}function R_(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=De.clone(e.vertexFormat??De.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??P.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+te.packedLength+De.packedLength+7}R_.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+=h.packedLength)h.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 Ude=te.clone(te.UNIT_SPHERE),zde=new De,D_={positions:void 0,ellipsoid:Ude,vertexFormat:zde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};R_.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)o[m]=h.unpack(e,t);let r=te.unpack(e,t,Ude);t+=te.packedLength;let s=De.unpack(e,t,zde);t+=De.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,_=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=De.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=_===-1?void 0:_,n):(D_.positions=o,D_.width=a,D_.height=c,D_.extrudedHeight=u,D_.cornerType=f,D_.granularity=d,D_.shadowVolume=p,D_.offsetAttribute=_===-1?void 0:_,new R_(D_))};R_.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??Vi.ROUNDED;return kde(n,o,i,r,t)};R_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Fde(t,i);let o=vo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=iet(u,c);else{let _=Yi.computePositions(u);if(f=Bde(_,c,i),f.attributes.position.values=li.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===cn.NONE?0:1,y=f.attributes.position.values.length,x=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let d=f.attributes,p=re.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new lt({attributes:d,indices:f.indices,primitiveType:Le.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};R_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new R_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=kde(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var AE=R_;var Vde=new h,Hde=new h,oet=new h;function ret(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Gde(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new pn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;l(N)?(p=N.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let _=l(r),m;_&&(m=r[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,x=new Float64Array(y),b=0,T=y-1,C,A,S,w,R,D,M=m/2,L=ke.createTypedArray(y/3,d+4),g=0;if(L[g++]=b/3,L[g++]=(T-2)/3,_){n.push(b/3),D=Vde,R=Hde;let N=r[0];for(f=0;f<M;f++)D=h.fromArray(N,(M-1-f)*3,D),R=h.fromArray(N,(M+f)*3,R),Yi.addAttribute(x,R,b),Yi.addAttribute(x,D,void 0,T),A=b/3,w=A+1,C=(T-2)/3,S=C-1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,b+=3,T-=3}let E=0,v=i[E++],I=i[E++];for(x.set(v,b),x.set(I,T-I.length+1),p=I.length-3,n.push(b/3,(T-2)/3),f=0;f<p;f+=3)A=b/3,w=A+1,C=(T-2)/3,S=C-1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,b+=3,T-=3;for(f=0;f<o.length;f++){let N;a=o[f];let F=a.leftPositions,U=a.rightPositions,k,z=oet;if(l(F)){for(T-=3,k=S,n.push(w),N=0;N<F.length/3;N++)z=h.fromArray(F,N*3,z),L[g++]=k-N-1,L[g++]=k-N,Yi.addAttribute(x,z,void 0,T),T-=3;n.push(k-Math.floor(F.length/6)),t===Vi.BEVELED&&n.push((T-2)/3+1),b+=3}else{for(b+=3,k=w,n.push(S),N=0;N<U.length/3;N++)z=h.fromArray(U,N*3,z),L[g++]=k+N,L[g++]=k+N+1,Yi.addAttribute(x,z,b),b+=3;n.push(k+Math.floor(U.length/6)),t===Vi.BEVELED&&n.push(b/3-1),T-=3}for(v=i[E++],I=i[E++],v.splice(0,3),I.splice(I.length-3,3),x.set(v,b),x.set(I,T-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)w=b/3,A=w-1,S=(T-2)/3,C=S+1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,b+=3,T-=3;b-=3,T+=3,n.push(b/3,(T-2)/3)}if(_){b+=3,T-=3,D=Vde,R=Hde;let N=r[1];for(f=0;f<M;f++)D=h.fromArray(N,(m-f-1)*3,D),R=h.fromArray(N,f*3,R),Yi.addAttribute(x,D,void 0,T),Yi.addAttribute(x,R,b),w=b/3,A=w-1,S=(T-2)/3,C=S+1,L[g++]=C,L[g++]=S,L[g++]=A,L[g++]=w,b+=3,T-=3;n.push(b/3)}else n.push(b/3,(T-2)/3);return L[g++]=b/3,L[g++]=(T-2)/3,s.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:L,wallIndices:n}}function set(e){let t=e.ellipsoid,n=Yi.computePositions(e),i=Gde(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=li.scaleToGeodeticHeight(u,r,t),d=li.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let C=new Uint8Array(f*2);if(e.offsetAttribute===cn.TOP)C=C.fill(1,0,f);else{let A=e.offsetAttribute===cn.NONE?0:1;C=C.fill(A)}a.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}let _,m=c.length,y=ke.createTypedArray(p.length/3,(m+o.length)*2);y.set(c);let x=m;for(_=0;_<m;_+=2){let C=c[_],A=c[_+1];y[x++]=C+f,y[x++]=A+f}let b,T;for(_=0;_<o.length;_++)b=o[_],T=b+f,y[x++]=b,y[x++]=T;return{attributes:a,indices:y}}function MP(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Vi.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+te.packedLength+6}MP.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+=h.packedLength)h.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var jde=te.clone(te.UNIT_SPHERE),Gy={positions:void 0,ellipsoid:jde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};MP.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=te.unpack(e,t,jde);t+=te.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(Gy.positions=o,Gy.width=s,Gy.height=a,Gy.extrudedHeight=c,Gy.cornerType=u,Gy.granularity=f,Gy.offsetAttribute=d===-1?void 0:d,new MP(Gy))};MP.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=ret(t,i);let o=vo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=set(c);else{let p=Yi.computePositions(c);if(u=Gde(p,c.cornerType),u.attributes.position.values=li.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let _=u.attributes.position.values.length,m=e._offsetAttribute===cn.NONE?0:1,y=new Uint8Array(_/3).fill(m);u.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=re.fromVertices(f.position.values,void 0,3);return new lt({attributes:f,indices:u.indices,primitiveType:Le.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var Bk=MP;var aet=new Qn(0);function fl(e){ai.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(fl.prototype=Object.create(ai.prototype),fl.prototype.constructor=fl);Object.defineProperties(fl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});fl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Bl.isSupported(this._scene)};fl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};fl.prototype._computeCenter=he.throwInstantiationError;fl.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))&&Tt(Tt.geometryZIndex),this._zIndex=o.zIndex??aet,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 fm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new sA(this._scene,a,r,s)}};fl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ai.prototype.destroy.call(this)};fl.getGeometryHeight=function(e,t){if(!l(e)){t!==$e.NONE&&Tt(Tt.geometryHeightReference);return}return Sf(t)?0:e};fl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==$e.NONE&&Tt(Tt.geometryExtrudedHeightReference);return}return Sf(t)?fl.CLAMP_TO_GROUND:e};fl.CLAMP_TO_GROUND="clamp";fl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=$e.NONE),(!l(n)||!l(i))&&(i=$e.NONE);let o=0;if(t!==$e.NONE&&o++,i===$e.RELATIVE_TO_GROUND&&o++,o===2)return cn.ALL;if(o===1)return cn.TOP};var jn=fl;var Wde=new H,qde=h.ZERO,Yde=new h,Xde=new ae;function cet(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 ch(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new cet(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(ch.prototype=Object.create(jn.prototype),ch.prototype.constructor=ch);ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Wde)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qde,Yde))),new Pt({id:t,geometry:new AE(this._options),attributes:i})};ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Wde),o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qde,Yde))),new Pt({id:t,geometry:new Bk(this._options),attributes:o})};ch.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};ch.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ai.prototype._isHidden.call(this,e,t)};ch.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};ch.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,$e.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=jn.computeGeometryOffsetAttribute(n,i,o,r),s.height=jn.getGeometryHeight(n,i),o=jn.getGeometryExtrudedHeight(o,r),o===jn.CLAMP_TO_GROUND&&(o=mi.getMinimumMaximumHeights(AE.computeRectangle(s,Xde)).minimumTerrainHeight),s.extrudedHeight=o};ch.DynamicGeometryUpdater=EE;function EE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(EE.prototype=Object.create(si.prototype),EE.prototype.constructor=EE);EE.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)};EE.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,$e.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=mi.getMinimumMaximumHeights(AE.computeRectangle(i,Xde)).minimumTerrainHeight),i.extrudedHeight=s};var kk=ch;function Uk(){he.throwInstantiationError()}Object.defineProperties(Uk.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});Uk.prototype.update=function(e){he.throwInstantiationError()};Uk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var os=Uk;function Fm(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Fm.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=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Kde=new h;Fm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Kde);return kq(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Fm.prototype.isScaledSpacePointVisible=function(e){return kq(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var uet=new h;Fm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=uet,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),kq(e,o,i)};Fm.prototype.computeHorizonCullingPoint=function(e,t,n){return Qde(this._ellipsoid,e,t,n)};var $de=te.clone(te.UNIT_SPHERE);Fm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Zde(this._ellipsoid,n,$de);return Qde(o,e,t,i)};Fm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Jde(this._ellipsoid,e,t,n,i,o)};Fm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Zde(this._ellipsoid,o,$de);return Jde(s,e,t,n,i,r)};var fet=[];Fm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ae.subsample(e,t,0,fet),o=re.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var det=new h;function Zde(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,det);e=te.fromCartesian3(i,n)}return e}function Qde(e,t,n,i){l(i)||(i=new h);let o=nhe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=ehe(e,c,o);if(u<0)return;r=Math.max(r,u)}return the(o,r,i)}var zk=new h;function Jde(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=nhe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){zk.x=n[c]+o.x,zk.y=n[c+1]+o.y,zk.z=n[c+2]+o.z;let f=ehe(e,zk,s);if(f<0)return;a=Math.max(a,f)}return the(s,a,r)}function kq(e,t,n){let i=t,o=n,r=h.subtract(e,i,Kde),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var het=new h,met=new h;function ehe(e,t,n){let i=e.transformPositionToScaledSpace(t,het),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,met);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function the(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var Bq=new h;function nhe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,Bq),h.normalize(Bq,Bq))}var jy=Fm;function Ir(e,t){e=e??G.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Vt.clone(n)),l(i)&&(i=Vt.clone(i)),l(o)&&(o=Mt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=H.clone(e.color??H.WHITE),this._outlineColor=H.clone(e.outlineColor??H.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??Jr.NONE}var ihe=Ir.SHOW_INDEX=0,she=Ir.POSITION_INDEX=1,pet=Ir.COLOR_INDEX=2,_et=Ir.OUTLINE_COLOR_INDEX=3,get=Ir.OUTLINE_WIDTH_INDEX=4,yet=Ir.PIXEL_SIZE_INDEX=5,xet=Ir.SCALE_BY_DISTANCE_INDEX=6,bet=Ir.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Tet=Ir.DISTANCE_DISPLAY_CONDITION_INDEX=8,Cet=Ir.DISABLE_DEPTH_DISTANCE_INDEX=9,Aet=Ir.SPLIT_DIRECTION_INDEX=10;Ir.NUMBER_OF_PROPERTIES=11;function Ru(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Ir.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ru(this,ihe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Ru(this,she))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Vt.equals(t,e)||(this._scaleByDistance=Vt.clone(e,t),Ru(this,xet))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Vt.equals(t,e)||(this._translucencyByDistance=Vt.clone(e,t),Ru(this,bet))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Ru(this,yet))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),Ru(this,pet))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Ru(this,_et))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ru(this,get))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Ru(this,Tet))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ru(this,Cet))}},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,Ru(this,ihe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ru(this,Aet))}}});Ir.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Ir.prototype._getActualPosition=function(){return this._actualPosition};Ir.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Ru(this,she)};var ohe=new ie;Ir._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(O.multiplyByPoint(n,e,ohe),qi.computeActualEllipsoidPosition(t,ohe))};var rhe=new ie;Ir._computeScreenSpacePosition=function(e,t,n,i){let o=O.multiplyByVector(e,ie.fromElements(t.x,t.y,t.z,1,rhe),rhe);return qi.worldToWindowCoordinates(n,o,i)};Ir.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new V);let i=n.modelMatrix,o=Ir._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Ir.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Xe),n.x=r,n.y=s,n.width=a,n.height=c,n};Ir.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&H.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&H.equals(this._outlineColor,e._outlineColor)&&Vt.equals(this._scaleByDistance,e._scaleByDistance)&&Vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ir.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var ea=Ir;var Db=`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 Vk=`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 Eet=ea.SHOW_INDEX,Vq=ea.POSITION_INDEX,ahe=ea.COLOR_INDEX,vet=ea.OUTLINE_COLOR_INDEX,wet=ea.OUTLINE_WIDTH_INDEX,Iet=ea.PIXEL_SIZE_INDEX,che=ea.SCALE_BY_DISTANCE_INDEX,lhe=ea.TRANSLUCENCY_BY_DISTANCE_INDEX,uhe=ea.DISTANCE_DISPLAY_CONDITION_INDEX,Pet=ea.DISABLE_DEPTH_DISTANCE_INDEX,Det=ea.SPLIT_DIRECTION_INDEX,Hq=ea.NUMBER_OF_PROPERTIES,vc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ed(e){e=e??G.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(Hq),this._maxPixelSize=1,this._baseVolume=new re,this._baseVolumeWC=new re,this._baseVolume2D=new re,this._boundingVolume=new re,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??No.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ed.prototype,{length:{get:function(){return Gq(this),this._pointPrimitives.length}}});function fhe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ed.prototype.add=function(e){let t=new ea(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ed.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ed.prototype.removeAll=function(){fhe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Gq(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}}ed.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ed.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};ed.prototype.get=function(e){return Gq(this),this._pointPrimitives[e]};ed.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Hq;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Ret(e,t,n){return new Ig(e,[{index:vc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Vq]},{index:vc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[Vq]},{index:vc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[ahe]},{index:vc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[lhe]},{index:vc.scaleByDistance,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[che]},{index:vc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:n[uhe]}],t)}var Uq=new Gn;function dhe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(re.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(r,Uq);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[vc.positionHighAndSize],u=Uq.high;c(o,u.x,u.y,u.z,s);let f=n[vc.positionLowAndOutline],d=Uq.low;f(o,d.x,d.y,d.z,a)}var Hk=65536,LP=256;function hhe(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=H.floatToByte(r.red),u=H.floatToByte(r.green),f=H.floatToByte(r.blue),d=c*Hk+u*LP+f;c=H.floatToByte(a.red),u=H.floatToByte(a.green),f=H.floatToByte(a.blue);let p=c*Hk+u*LP+f;c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue);let _=c*Hk+u*LP+f,m=H.floatToByte(r.alpha)*Hk+H.floatToByte(a.alpha)*LP+H.floatToByte(s.alpha),y=n[vc.compressedAttribute0];y(o,d,p,_,m)}function mhe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*LP+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,_=n[vc.compressedAttribute1];_(o,d,p,r,a)}function phe(e,t,n,i){let o=i._index,r=n[vc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function _he(e,t,n,i){let o=i._index,r=n[vc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),r(o,s,a,u,f)}function Oet(e,t,n,i){dhe(e,t,n,i),hhe(e,t,n,i),mhe(e,t,n,i),phe(e,t,n,i),_he(e,t,n,i)}function zq(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=ea._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):re.expand(s,d,s))}r&&re.fromPoints(a,s)}function Met(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!O.equals(r,e.modelMatrix)?(e._mode=n,O.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&zq(e,i,i.length,t,r,!0)):n===ne.MORPHING?zq(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&zq(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function Let(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var Net=[];ed.prototype.update=function(e){if(Gq(this),!this.show)return;this._maxTotalPointSize=Lt.maximumAliasedPointSize,Met(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<Hq;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Ret(c,n,this._buffersUsage),a=this._vaf.writers;for(let S=0;S<n;++S){let w=this._pointPrimitives[S];w._dirty=!1,Oet(this,c,a,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=Net;S.length=0,(r[Vq]||r[wet]||r[Iet])&&S.push(dhe),(r[ahe]||r[vet])&&S.push(hhe),(r[Eet]||r[lhe])&&S.push(mhe),r[che]&&S.push(phe),(r[uhe]||r[Pet]||r[Det])&&S.push(_he);let w=S.length;if(a=this._vaf.writers,o/n>.1){for(let R=0;R<o;++R){let D=i[R];D._dirty=!1;for(let M=0;M<w;++M)S[M](this,c,a,D)}this._vaf.commit()}else{for(let R=0;R<o;++R){let D=i[R];D._dirty=!1;for(let M=0;M<w;++M)S[M](this,c,a,D);this._vaf.subCommit(D._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,re.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=O.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=re.clone(this._baseVolumeWC,this._boundingVolume)):d=re.clone(this._baseVolume2D,this._boundingVolume),Let(this,e,d);let _=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,_&&(this._blendOption===No.OPAQUE||this._blendOption===No.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:q.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===No.TRANSLUCENT||this._blendOption===No.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:q.LEQUAL},depthMask:!1,blending:fn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(_||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Be({sources:[Vk]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===No.OPAQUE_AND_TRANSLUCENT&&(y=new Be({defines:["OPAQUE"],sources:[Db]}),this._sp=Xt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vc}),y=new Be({defines:["TRANSLUCENT"],sources:[Db]}),this._spTranslucent=Xt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vc})),this._blendOption===No.OPAQUE&&(y=new Be({sources:[Db]}),this._sp=Xt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vc})),this._blendOption===No.TRANSLUCENT&&(y=new Be({sources:[Db]}),this._spTranslucent=Xt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,b,T,C,A=e.commandList;if(u.render||f){let S=this._colorCommands,w=this._blendOption===No.OPAQUE,R=this._blendOption===No.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,b=x.length,S.length=b;let D=R?b*2:b;for(C=0;C<D;++C){let M=w||R&&C%2===0;T=S[C],l(T)||(T=S[C]=new qe),T.primitiveType=Le.POINTS,T.pass=M||!R?Se.OPAQUE:Se.TRANSLUCENT,T.owner=this;let L=R?Math.floor(C/2):C;T.boundingVolume=d,T.modelMatrix=p,T.shaderProgram=M?this._sp:this._spTranslucent,T.uniformMap=this._uniforms,T.vertexArray=x[L].va,T.renderState=M?this._rsOpaque:this._rsTranslucent,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.pickId="v_pickColor",A.push(T)}}};ed.prototype.isDestroyed=function(){return!1};ed.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(),fhe(this._pointPrimitives),ce(this)};var NP=ed;var ghe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],jq=1,FP=8,kP=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==jq)throw new Error(`Got v${o} data when expected v${jq}.`);let r=ghe[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=ghe.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,FP,t),this.coords=new this.ArrayType(this.data,FP+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(FP+s+a+c),this.ids=new this.IndexArrayType(this.data,FP,t),this.coords=new this.ArrayType(this.data,FP+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(jq<<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 qq(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let x=p;x<=d;x++){let b=s[2*x],T=s[2*x+1];b>=t&&b<=i&&T>=n&&T<=o&&u.push(r[x])}continue}let _=p+d>>1,m=s[2*_],y=s[2*_+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[_]),(f===0?t<=m:n<=y)&&(c.push(p),c.push(_-1),c.push(1-f)),(f===0?i>=m:o>=y)&&(c.push(_+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let x=p;x<=d;x++)yhe(r[2*x],r[2*x+1],t,n)<=u&&c.push(o[x]);continue}let _=p+d>>1,m=r[2*_],y=r[2*_+1];yhe(m,y,t,n)<=u&&c.push(o[_]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(_-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(_+1),a.push(d),a.push(1-f))}return c}};function qq(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;xhe(e,t,s,i,o,r),qq(e,t,n,i,s-1,1-r),qq(e,t,n,s+1,o,1-r)}function xhe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),_=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+_)),y=Math.min(o,Math.floor(n+(u-f)*p/u+_));xhe(e,t,n,m,y,r)}let s=t[2*n+r],a=i,c=o;for(BP(e,t,i,n),t[2*o+r]>s&&BP(e,t,i,o);a<c;){for(BP(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?BP(e,t,i,c):(c++,BP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function BP(e,t,n,i){Wq(e,n,i),Wq(t,2*n,2*i),Wq(t,2*n+1,2*i+1)}function Wq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function yhe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function lh(e){e=e??G.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 me,this.show=e.show??!0}function bhe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Fet=new Xe;function The(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=xb.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=po.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ea.getScreenSpaceBoundingBox(e,t,o)),bhe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Ahe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=xb.getScreenSpaceBoundingBox(s,t,Fet);bhe(a,n),o=Xe.union(o,a,o)}return o}function Bet(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Ahe(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 Che(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 Ahe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Yq(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===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var ket=new Xe,Uet=new Xe,zet=new Xe;function Vet(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 g_({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new jf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new NP;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],_=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,x=n.camera.positionWC,b=new jy(y,x),T=[];e._clusterLabels&&Yq(i,T,n,b,e),e._clusterBillboards&&Yq(o,T,n,b,e),e._clusterPoints&&Yq(r,T,n,b,e);let C,A,S,w,R,D,M,L,g,E,v,I;if(T.length>0){let N=new kP(T.length,64,Uint32Array);for(let F=0;F<T.length;++F)N.add(T[F].coord.x,T[F].coord.y);if(N.finish(),m<_)for(S=d.length,C=0;C<S;++C){let F=d[C];if(!b.isPointVisible(F.position))continue;let U=po._computeScreenSpacePosition(O.IDENTITY,F.position,h.ZERO,V.ZERO,n);if(!l(U))continue;let k=1-m/_,z=F.width=F.width*k,B=F.height=F.height*k;z=Math.max(z,F.minimumWidth),B=Math.max(B,F.minimumHeight);let j=U.x-z*.5,W=U.y-B*.5,J=U.x+z,Y=U.y+B;for(R=N.range(j,W,J,Y),D=R.length,E=0,g=[],A=0;A<D;++A)M=R[A],L=T[M],L.clustered||(++E,v=L.collection,I=L.index,g.push(v.get(I).id));if(E>=f)for(Che(F.position,E,g,e),p.push(F),A=0;A<D;++A)T[R[A]].clustered=!0}for(S=T.length,C=0;C<S;++C){let F=T[C];if(F.clustered)continue;F.clustered=!0,v=F.collection,I=F.index;let U=v.get(I);w=The(U,F.coord,u,e,ket);let k=Xe.clone(w,Uet);R=N.range(w.x,w.y,w.x+w.width,w.y+w.height),D=R.length;let z=h.clone(U.position);for(E=1,g=[U.id],A=0;A<D;++A)if(M=R[A],L=T[M],!L.clustered){let B=L.collection.get(L.index),j=The(B,L.coord,u,e,zet);h.add(B.position,z,z),Xe.union(k,j,k),++E,g.push(B.id)}if(E>=f){let B=h.multiplyByScalar(z,1/E,z);for(Che(B,E,g,e),p.push({position:B,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),A=0;A<D;++A)T[R[A]].clustered=!0}else Bet(U,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}lh.prototype._initialize=function(e){this._scene=e;let t=Vet(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(lh.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 Kq(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function $q(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}lh.prototype.getLabel=Kq("_labelCollection",g_,"_unusedLabelIndices","labelIndex");lh.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,$q(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};lh.prototype.getBillboard=Kq("_billboardCollection",jf,"_unusedBillboardIndices","billboardIndex");lh.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,$q(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};lh.prototype.getPoint=Kq("_pointCollection",NP,"_unusedPointIndices","pointIndex");lh.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,$q(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Xq(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Het(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,Xq(e._labelCollection),Xq(e._billboardCollection),Xq(e._pointCollection))}lh.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,Het(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)};lh.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 td=lh;function Zq(e){this._name=e,this._clock=void 0,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new Ca(this),this._entityCluster=new td}Object.defineProperties(Zq.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){os.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}}});Zq.prototype.update=function(e){return!0};var Gk=Zq;var Ehe={};Ehe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,_=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*P.TWO_PI,x=Math.cos(y),b=Math.sin(y),T=x*n,C=b*n,A=x*t,S=b*t;u[p+_]=T,u[p+_+1]=C,u[p+_+2]=s,u[p+m]=A,u[p+m+1]=S,u[p+m+2]=r,p+=3,o&&(u[d++]=T,u[d++]=C,u[d++]=s,u[d++]=A,u[d++]=S,u[d++]=r)}return u};var SE=Ehe;var Qq=new V,Get=new h,jet=new h,Wet=new h,qet=new h;function O_(e){e=e??G.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??De.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=De.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}O_.packedLength=De.packedLength+5;O_.pack=function(e,t,n){return n=n??0,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var She=new De,vE={vertexFormat:She,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O_.unpack=function(e,t,n){t=t??0;let i=De.unpack(e,t,She);t+=De.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=De.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(vE.length=o,vE.topRadius=r,vE.bottomRadius=s,vE.slices=a,vE.offsetAttribute=c===-1?void 0:c,new O_(vE))};O_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=SE.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,_=o.bitangent?new Float32Array(c*3):void 0,m,y=o.normal||o.tangent||o.bitangent;if(y){let R=o.tangent||o.bitangent,D=0,M=0,L=0,g=Math.atan2(i-n,t),E=Get;E.z=Math.sin(g);let v=Math.cos(g),I=Wet,N=jet;for(m=0;m<r;m++){let F=m/r*P.TWO_PI,U=v*Math.cos(F),k=v*Math.sin(F);y&&(E.x=U,E.y=k,R&&(I=h.normalize(h.cross(h.UNIT_Z,E,I),I)),o.normal&&(d[D++]=E.x,d[D++]=E.y,d[D++]=E.z,d[D++]=E.x,d[D++]=E.y,d[D++]=E.z),o.tangent&&(p[M++]=I.x,p[M++]=I.y,p[M++]=I.z,p[M++]=I.x,p[M++]=I.y,p[M++]=I.z),o.bitangent&&(N=h.normalize(h.cross(E,I,N),N),_[L++]=N.x,_[L++]=N.y,_[L++]=N.z,_[L++]=N.x,_[L++]=N.y,_[L++]=N.z))}for(m=0;m<r;m++)o.normal&&(d[D++]=0,d[D++]=0,d[D++]=-1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=-1,_[L++]=0);for(m=0;m<r;m++)o.normal&&(d[D++]=0,d[D++]=0,d[D++]=1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=1,_[L++]=0)}let x=12*r-12,b=ke.createTypedArray(c,x),T=0,C=0;for(m=0;m<r-1;m++)b[T++]=C,b[T++]=C+2,b[T++]=C+3,b[T++]=C,b[T++]=C+3,b[T++]=C+1,C+=2;for(b[T++]=s-2,b[T++]=0,b[T++]=1,b[T++]=s-2,b[T++]=1,b[T++]=s-1,m=1;m<r-1;m++)b[T++]=s+m+1,b[T++]=s+m,b[T++]=s;for(m=1;m<r-1;m++)b[T++]=a,b[T++]=a+m,b[T++]=a+m+1;let A=0;if(o.st){let R=Math.max(n,i);for(m=0;m<c;m++){let D=h.fromArray(u,m*3,qet);f[A++]=(D.x+R)/(2*R),f[A++]=(D.y+R)/(2*R)}}let S=new pn;o.position&&(S.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(S.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(S.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(S.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:f})),Qq.x=t*.5,Qq.y=Math.max(i,n);let w=new re(h.ZERO,V.magnitude(Qq));if(l(e._offsetAttribute)){t=u.length;let R=e._offsetAttribute===cn.NONE?0:1,D=new Uint8Array(t/3).fill(R);S.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}return new lt({attributes:S,indices:b,primitiveType:Le.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var Jq;O_.getUnitCylinder=function(){return l(Jq)||(Jq=O_.createGeometry(new O_({topRadius:1,bottomRadius:1,length:1,vertexFormat:De.POSITION_ONLY}))),Jq};var jk=O_;var eY=new V;function wE(e){e=e??G.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"}wE.packedLength=6;wE.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 Rb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};wE.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):(Rb.length=i,Rb.topRadius=o,Rb.bottomRadius=r,Rb.slices=s,Rb.numberOfVerticalLines=a,Rb.offsetAttribute=c===-1?void 0:c,new wE(Rb))};wE.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=SE.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let y=Math.min(r,o);u=Math.round(o/y),c+=y}let f=ke.createTypedArray(s,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let _=new pn;_.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:a}),eY.x=t*.5,eY.y=Math.max(i,n);let m=new re(h.ZERO,V.magnitude(eY));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===cn.NONE?0:1,x=new Uint8Array(t/3).fill(y);_.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new lt({attributes:_,indices:f,primitiveType:Le.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var Wk=wE;var vhe=h.ZERO,whe=new h,Yet=new h,Ihe=new H;function Xet(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 Ou(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new Xet(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Ou.prototype=Object.create(ai.prototype),Ou.prototype.constructor=Ou);Object.defineProperties(Ou.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ou.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Ihe)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,vhe,whe))),new Pt({id:t,geometry:new jk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Ou.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Ihe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,vhe,whe))),new Pt({id:t,geometry:new Wk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Ou.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Ou.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)};Ou.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};Ou.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==$e.NONE?cn.ALL:void 0};Ou.prototype._onEntityPropertyChanged=Ug;Ou.DynamicGeometryUpdater=IE;function IE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(IE.prototype=Object.create(si.prototype),IE.prototype.constructor=IE);IE.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,Yet);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||si.prototype._isHidden.call(this,e,t,n)};IE.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,$e.NONE),o=this._options;o.length=X.getValueOrUndefined(t.length,n),o.topRadius=X.getValueOrUndefined(t.topRadius,n),o.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),o.slices=X.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==$e.NONE?cn.ALL:void 0};var qk=Ou;var Ket={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},rs=Object.freeze(Ket);var $et={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},Ao=Object.freeze($et);var Zet={NONE:0,HOLD:1,EXTRAPOLATE:2},nd=Object.freeze(Zet);var Phe=$r(pu(),1);function Qet(e){let t=new Phe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Wy=Qet;var Jet=P.factorial;function tY(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=tY(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var Yk={type:"Hermite"};Yk.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};Yk.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let x=new Array(d);for(p[r]=x,s=0;s<d;s++)x[s]=[]}let _=d,m=new Array(_);for(r=0;r<_;r++)m[r]=r;let y=d-1;for(c=0;c<i;c++){for(s=0;s<_;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<_;r++){let x=!1;for(s=0;s<_-r;s++){let b=t[m[s]],T=t[m[s+r]],C;T-b<=0?(f=m[s]*i+i*r+c,C=n[f],p[c][r].push(C/Jet(r))):(C=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(C/(T-b))),x=x||C!==0}x||(y=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=y;r++){let x=tY(e,m,t,a,r,[]);for(c=0;c<i;c++){let b=p[c][r][0];o[c+a*i]+=b*x}}return o};var ett=[];Yk.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let b=0;b<a;b++)s[b]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let b=0;b<o+1;b++)u[f*(o+1)+b]=f;let d=u.length,p=ett,_=ttt(p,u,t,n,i,o),m=[],y=d*(d+1)/2,x=Math.min(_,r);for(let b=0;b<=x;b++)for(f=b;f<=_;f++){m.length=0;let T=tY(e,u,t,b,f,m),C=Math.floor(f*(1-f)/2)+d*f;for(let A=0;A<i;A++){let S=Math.floor(A*y),w=p[S+C];s[A+b*i]+=w*T}}return s};function ttt(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+d,e[p+s]=i[a];for(let _=1;_<u;_++){let m=0,y=Math.floor(_*(1-_)/2)+u*_,x=!1;for(s=0;s<u-_;s++){let b=n[t[s]],T=n[t[s+_]],C,A;if(T-b<=0)a=t[s]*o*(r+1)+o*_+d,C=i[a],A=C/P.factorial(_),e[p+y+m]=A,m++;else{let S=Math.floor((_-1)*(2-_)/2)+u*(_-1);C=e[p+S+s+1]-e[p+S+s],A=C/(T-b),e[p+y+m]=A,m++}x=x||C!==0}x&&(c=Math.max(c,_))}}return c}var Xk=Yk;var nY={type:"Lagrange"};nY.getRequiredDataPoints=function(e){return Math.max(e+1,2)};nY.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var Kk=nY;var iY={type:"Linear"};iY.getRequiredDataPoints=function(e){return 2};iY.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var PE=iY;function wc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}wc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new wc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};wc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new wc(e.clock,e.cone,e.magnitude)};wc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new wc(e.clock,e.cone,1)};wc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};wc.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};wc.prototype.equals=function(e){return wc.equals(this,e)};wc.prototype.clone=function(e){return wc.clone(this,e)};wc.prototype.equalsEpsilon=function(e,t){return wc.equalsEpsilon(this,e,t)};wc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var $k=wc;var KP=$r(pu(),1);var oY;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?oY=function(){return performance.now()}:oY=function(){return Date.now()};var Pi=oY;function rY(e){e=e??G.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=$.clone(t):l(n)?t=$.clone(n):l(i)?t=$.addDays(i,-1,new $):t=$.now(),l(n)?n=$.clone(n):n=$.clone(t),l(i)?i=$.clone(i):i=$.addDays(n,1,new $),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??rs.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new me,this.onStop=new me,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Pi(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Ao.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(rY.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){$.equals(this._currentTime,e)||(this._clockStep===Ao.SYSTEM_CLOCK&&(this._clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Ao.SYSTEM_CLOCK&&(this._clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Ao.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=$.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Ao.SYSTEM_CLOCK&&(this._clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});rY.prototype.tick=function(){let e=Pi(),t=$.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Ao.SYSTEM_CLOCK)t=$.now(t);else{let i=this._multiplier;if(n===Ao.TICK_DEPENDENT)t=$.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=$.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===rs.CLAMPED)$.lessThan(t,r)?t=$.clone(r,t):$.greaterThan(t,s)&&(t=$.clone(s,t),this.onStop.raiseEvent(this));else if(o===rs.LOOP_STOP)for($.lessThan(t,r)&&(t=$.clone(r,t));$.greaterThan(t,s);)t=$.addSeconds(r,$.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Bm=rY;function Ob(){this._definitionChanged=new me,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(Ob.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Ul("startTime"),stopTime:Ul("stopTime"),currentTime:Ul("currentTime"),clockRange:Ul("clockRange"),clockStep:Ul("clockStep"),multiplier:Ul("multiplier")});Ob.prototype.clone=function(e){return l(e)||(e=new Ob),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};Ob.prototype.equals=function(e){return this===e||l(e)&&$.equals(this.startTime,e.startTime)&&$.equals(this.stopTime,e.stopTime)&&$.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Ob.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};Ob.prototype.getValue=function(e){return l(e)||(e=new Bm),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 km=Ob;var ntt=H.WHITE,itt=.1,ott=new V(8,8),rtt=new V(0,0),stt=new V(1,1);function DE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(DE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),cellAlpha:ue("cellAlpha"),lineCount:ue("lineCount"),lineThickness:ue("lineThickness"),lineOffset:ue("lineOffset")});DE.prototype.getType=function(e){return"Grid"};var att=new $;DE.prototype.getValue=function(e,t){return l(e)||(e=$.now(att)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ntt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,itt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,ott,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,stt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,rtt,t.lineOffset),t};DE.prototype.equals=function(e){return this===e||e instanceof DE&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var UP=DE;function RE(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(RE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});RE.prototype.getType=function(e){return"PolylineArrow"};var ctt=new $;RE.prototype.getValue=function(e,t){return l(e)||(e=$.now(ctt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};RE.prototype.equals=function(e){return this===e||e instanceof RE&&X.equals(this._color,e._color)};var zP=RE;var ltt=H.WHITE,utt=H.TRANSPARENT,ftt=16,dtt=255;function OE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(OE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),gapColor:ue("gapColor"),dashLength:ue("dashLength"),dashPattern:ue("dashPattern")});OE.prototype.getType=function(e){return"PolylineDash"};var htt=new $;OE.prototype.getValue=function(e,t){return l(e)||(e=$.now(htt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ltt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,utt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,ftt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,dtt,t.dashPattern),t};OE.prototype.equals=function(e){return this===e||e instanceof OE&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var VP=OE;var mtt=H.WHITE,ptt=.25,_tt=1;function ME(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(ME.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),glowPower:ue("glowPower"),taperPower:ue("taperPower")});ME.prototype.getType=function(e){return"PolylineGlow"};var gtt=new $;ME.prototype.getValue=function(e,t){return l(e)||(e=$.now(gtt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,mtt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,ptt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,_tt,t.taperPower),t};ME.prototype.equals=function(e){return this===e||e instanceof ME&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var HP=ME;var ytt=H.WHITE,xtt=H.BLACK,btt=1;function LE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(LE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth")});LE.prototype.getType=function(e){return"PolylineOutline"};var Ttt=new $;LE.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ttt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ytt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,xtt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,btt),t};LE.prototype.equals=function(e){return this===e||e instanceof LE&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Mb=LE;function M_(e,t){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new wr,this._referenceFrame=t??Wi.FIXED,this.setValue(e)}Object.defineProperties(M_.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Ctt=new $;M_.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ctt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};M_.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};M_.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,M_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};M_.prototype.equals=function(e){return this===e||e instanceof M_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};M_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var qy=M_;function Yy(e){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new wr,this.setValue(e)}Object.defineProperties(Yy.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Att=new $;Yy.prototype.getValue=function(e,t){l(e)||(e=$.now(Att));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};Yy.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,Yy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Yy.prototype.equals=function(e){return this===e||e instanceof Yy&&X.arrayEquals(this._value,e._value)};Yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var GP=Yy;function Lb(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(Mu.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 Mu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new me,e.collectionChanged.addEventListener(Mu.prototype._onCollectionChanged,this)}Object.defineProperties(Mu.prototype,{isConstant:{get:function(){return X.isConstant(Lb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Lb(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 Lb(this)}}});Mu.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 Mu(e,n,i)};var Ett=new $;Mu.prototype.getValue=function(e,t){let n=Lb(this);return l(e)||(e=$.now(Ett)),l(n)?n.getValue(e,t):void 0};Mu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Lb(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Mu.prototype.getType=function(e){let t=Lb(this);return l(t)?t.getType(e):void 0};Mu.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};Mu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Mu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Mu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Lb(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Xy=Mu;var Stt={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-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},uh=Stt;var Dhe={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 Rhe(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 Ohe(e,t){return e instanceof $?e:typeof e=="string"?$.fromIso8601(e):$.addSeconds(t,e,new $)}var sY=[],aY=[];function Zk(e,t,n,i,o){let r=0,s,a,c,u,f,d;for(;r<i.length;){f=Ohe(i[r],e),c=zo(t,f,$.compare);let p=0,_=0;if(c<0){for(c=~c,u=c*o,a=void 0,d=t[c];r<i.length&&(f=Ohe(i[r],e),!(l(a)&&$.compare(a,f)>=0||l(d)&&$.compare(f,d)>=0));){for(sY[p++]=f,r=r+1,s=0;s<o;s++)aY[_++]=i[r],r=r+1;a=f}p>0&&(aY.length=_,Rhe(n,u,aY),sY.length=p,Rhe(t,c,sY))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function id(e,t){let n=e;n===Number&&(n=Dhe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=Dhe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=PE,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 me,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=nd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=nd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(id.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 vtt=new $;id.prototype.getValue=function(e,t){l(e)||(e=$.now(vtt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=zo(n,e,$.compare);if(a<0){if(a=~a,a===0){let A=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===nd.NONE||o!==0&&$.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===nd.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===nd.NONE||o!==0&&$.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===nd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let A=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);A!==this._numberOfPoints&&(this._numberOfPoints=A,c.length=A,u.length=A*d)}let _=this._numberOfPoints-1;if(_<1)return;let m=0,y=i-1;if(y-m+1>=_+1){let A=a-(_/2|0)-1;A<m&&(A=m);let S=A+_;S>y&&(S=y,A=S-_,A<m&&(A=m)),m=A,y=S}let b=y-m+1;for(let A=0;A<b;++A)c[A]=$.secondsDifference(n[m+A],n[y]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,y,u);else{let A=0,S=this._packedLength,w=m*S,R=(y+1)*S;for(;w<R;)u[A]=s[w],w++,A++}let T=$.secondsDifference(e,n[y]),C;if(p===0||!l(f.interpolate))C=f.interpolateOrderZero(T,c,u,d,this._interpolationResult);else{let A=Math.floor(d/(p+1));C=f.interpolate(T,c,u,A,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(C,s,m,y,t):r.unpack(C,0,t)}return r.unpack(s,a*this._packedLength,t)};id.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))};id.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)}Zk(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}Zk(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};id.prototype.addSamplesPackedArray=function(e,t){Zk(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.removeSample=function(e){let t=zo(this._times,e,$.compare);return t<0?!1:(Mhe(this,t,1),!0)};function Mhe(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)}id.prototype.removeSamples=function(e){let t=this._times,n=zo(t,e.start,$.compare);n<0?n=~n:e.isStartIncluded||++n;let i=zo(t,e.stop,$.compare);i<0?i=~i:e.isStopIncluded&&++i,Mhe(this,n,i-n)};id.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(!$.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};id._mergeNewSamples=Zk;var od=id;function rd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new od(h,n),this._definitionChanged=new me,this._referenceFrame=e??Wi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(rd.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 wtt=new $;rd.prototype.getValue=function(e,t){return l(e)||(e=$.now(wtt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};rd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return am.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};rd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};rd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};rd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};rd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};rd.prototype.removeSample=function(e){return this._property.removeSample(e)};rd.prototype.removeSamples=function(e){this._property.removeSamples(e)};rd.prototype.equals=function(e){return this===e||e instanceof rd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ja=rd;var Itt={HORIZONTAL:0,VERTICAL:1},Um=Object.freeze(Itt);var Ptt=Um.HORIZONTAL,Dtt=H.WHITE,Rtt=H.BLACK,Ott=0,Mtt=1;function NE(e){e=e??G.EMPTY_OBJECT,this._definitionChanged=new me,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(NE.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ue("orientation"),evenColor:ue("evenColor"),oddColor:ue("oddColor"),offset:ue("offset"),repeat:ue("repeat")});NE.prototype.getType=function(e){return"Stripe"};var Ltt=new $;NE.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ltt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,Ptt)===Um.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,Dtt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,Rtt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,Ott),t.repeat=X.getValueOrDefault(this._repeat,e,Mtt),t};NE.prototype.equals=function(e){return this===e||e instanceof NE&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var jP=NE;function Ky(e){this._definitionChanged=new me,this._intervals=new is,this._intervals.changedEvent.addEventListener(Ky.prototype._intervalsChanged,this),this._referenceFrame=e??Wi.FIXED}Object.defineProperties(Ky.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 Ntt=new $;Ky.prototype.getValue=function(e,t){return l(e)||(e=$.now(Ntt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Ky.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return am.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ky.prototype.equals=function(e){return this===e||e instanceof Ky&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};Ky.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var $y=Ky;function Nb(){this._definitionChanged=new me,this._intervals=new is,this._intervals.changedEvent.addEventListener(Nb.prototype._intervalsChanged,this)}Object.defineProperties(Nb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Ftt=new $;Nb.prototype.getValue=function(e,t){l(e)||(e=$.now(Ftt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};Nb.prototype.equals=function(e){return this===e||e instanceof Nb&&this._intervals.equals(e._intervals,X.equals)};Nb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Zy=Nb;function FE(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new me,this._normalize=t??!0,this.position=e}Object.defineProperties(FE.prototype,{isConstant:{get:function(){return X.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 Btt=new h,Lhe=new h,Nhe=new $,ktt=new $,cY=1/60;FE.prototype.getValue=function(e,t){return this._getValue(e,t)};FE.prototype._getValue=function(e,t,n){l(e)||(e=$.now(ktt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,Btt),r=i.getValue($.addSeconds(e,cY,Nhe),Lhe);if(!l(o)||!l(r)&&(r=o,o=i.getValue($.addSeconds(e,-cY,Nhe),Lhe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,cY,t)};FE.prototype.equals=function(e){return this===e||e instanceof FE&&X.equals(this._position,e._position)};var Qy=FE;function WP(e,t){this._velocityVectorProperty=new Qy(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new me,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(WP.prototype,{isConstant:{get:function(){return X.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 Fhe=new h,Utt=new h,Bhe=new Z,ztt=new $;WP.prototype.getValue=function(e,t){l(e)||(e=$.now(ztt));let n=this._velocityVectorProperty._getValue(e,Utt,Fhe);if(l(n))return Et.rotationMatrixFromPositionVelocity(Fhe,n,this._ellipsoid,Bhe),Pe.fromRotationMatrix(Bhe,t)};WP.prototype.equals=function(e){return this===e||e instanceof WP&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var Qk=WP;var L_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};L_.validate=function(e){return e===L_.COMPLETE||e===L_.BELOW_ELLIPSOID_HORIZON||e===L_.ABOVE_ELLIPSOID_HORIZON};L_.toString=function(e){switch(e){case L_.COMPLETE:return"COMPLETE";case L_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case L_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var qP=L_;function Jy(){}Jy.packedLength=h.packedLength;Jy.unpack=h.unpack;Jy.pack=h.pack;var lY;function YP(e,t){return t[0]==="#"&&(t=lY+t),Xy.fromString(e,t)}function khe(e,t,n){if(l(n.reference))return YP(t,n.reference);if(l(n.velocityReference)){let i=YP(t,n.velocityReference);switch(e){case h:case Jy:return new Qy(i,e===Jy);case Pe:return new Qk(i)}}throw new se(`${JSON.stringify(n)} is not valid CZML.`)}function Vtt(e,t){return new fm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Hi=new h,dl=new $k,Ic=new fe,Fb=new Sn,Jk=new Pe;function Htt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===H.packedLength)return[H.byteToFloat(n[0]),H.byteToFloat(n[1]),H.byteToFloat(n[2]),H.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=H.byteToFloat(n[o+1]),t[o+2]=H.byteToFloat(n[o+2]),t[o+3]=H.byteToFloat(n[o+3]),t[o+4]=H.byteToFloat(n[o+4]);return t}function Uhe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):Ee.createIfNeeded(n)}function Gtt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ae.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function jtt(e){let t=e.length;if(dl.magnitude=1,t===2)return dl.clock=e[0],dl.cone=e[1],h.fromSpherical(dl,Hi),[Hi.x,Hi.y,Hi.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],h.fromSpherical(dl,Hi),n[o+1]=Hi.x,n[o+2]=Hi.y,n[o+3]=Hi.z;return n}function Wtt(e){let t=e.length;if(t===3)return dl.clock=e[0],dl.cone=e[1],dl.magnitude=e[2],h.fromSpherical(dl,Hi),[Hi.x,Hi.y,Hi.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],h.fromSpherical(dl,Hi),n[i+1]=Hi.x,n[i+2]=Hi.y,n[i+3]=Hi.z;return n}function qtt(e){let t=e.length;if(t===3)return Ic.longitude=e[0],Ic.latitude=e[1],Ic.height=e[2],te.default.cartographicToCartesian(Ic,Hi),[Hi.x,Hi.y,Hi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ic.longitude=e[i+1],Ic.latitude=e[i+2],Ic.height=e[i+3],te.default.cartographicToCartesian(Ic,Hi),n[i+1]=Hi.x,n[i+2]=Hi.y,n[i+3]=Hi.z;return n}function Ytt(e){let t=e.length;if(t===3)return Ic.longitude=P.toRadians(e[0]),Ic.latitude=P.toRadians(e[1]),Ic.height=e[2],te.default.cartographicToCartesian(Ic,Hi),[Hi.x,Hi.y,Hi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ic.longitude=P.toRadians(e[i+1]),Ic.latitude=P.toRadians(e[i+2]),Ic.height=e[i+3],te.default.cartographicToCartesian(Ic,Hi),n[i+1]=Hi.x,n[i+2]=Hi.y,n[i+3]=Hi.z;return n}function uY(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 jtt(o);let r=e.spherical;if(l(r))return Wtt(r);let s=e.cartographicRadians;if(l(s))return qtt(s);let a=e.cartographicDegrees;if(l(a))return Ytt(a);throw new se(`${JSON.stringify(e)} is not a valid CZML interval.`)}function zhe(e,t){h.unpack(e,t,Hi),h.normalize(Hi,Hi),h.pack(Hi,e,t)}function Xtt(e){let t=uY(e);if(t.length===3)return zhe(t,0),t;for(let n=1;n<t.length;n+=4)zhe(t,n);return t}function Vhe(e,t){Pe.unpack(e,t,Jk),Pe.normalize(Jk,Jk),Pe.pack(Jk,e,t)}function Ktt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Vhe(t,0),t;for(let n=1;n<t.length;n+=5)Vhe(t,n)}return t}function Hhe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Xe:e.hasOwnProperty("cartesian2")?V:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Jy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?H:e.hasOwnProperty("arcType")?nn:e.hasOwnProperty("classificationType")?zn:e.hasOwnProperty("colorBlendMode")?il:e.hasOwnProperty("cornerType")?Vi:e.hasOwnProperty("heightReference")?$e:e.hasOwnProperty("horizontalOrigin")?Ei:e.hasOwnProperty("date")?$:e.hasOwnProperty("labelStyle")?tr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Vt:e.hasOwnProperty("distanceDisplayCondition")?Mt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Pe:e.hasOwnProperty("shadowMode")?Tn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Um:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ae:e.hasOwnProperty("uri")?KP.default:e.hasOwnProperty("verticalOrigin")?Bn:Object}function $tt(e,t,n){switch(e){case nn:return nn[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Xe:return t.boundingRectangle;case V:return t.cartesian2;case h:return uY(t);case Jy:return Xtt(t);case H:return Htt(t);case zn:return zn[t.classificationType??t];case il:return il[t.colorBlendMode??t];case Vi:return Vi[t.cornerType??t];case $e:return $e[t.heightReference??t];case Ei:return Ei[t.horizontalOrigin??t];case Image:return Uhe(t,n);case $:return $.fromIso8601(t.date??t);case tr:return tr[t.labelStyle??t];case Number:return t.number??t;case Vt:return t.nearFarScalar;case Mt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Pe:return Ktt(t);case uh:return t.number??t;case qP:return qP[t.portionToDisplay??t];case Tn:return Tn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Um:return Um[t.stripeOrientation??t];case ae:return Gtt(t);case KP.default:return Uhe(t,n);case Bn:return Bn[t.verticalOrigin??t];default:throw new se(`Unknown CzmlDataSource interval type: ${e}`)}}var Ztt={HERMITE:Xk,LAGRANGE:Kk,LINEAR:PE};function eU(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Ztt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=nd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=nd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Ghe={iso8601:void 0};function pr(e){if(l(e))return Ghe.iso8601=e,Sn.fromIso8601(Ghe)}function fY(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function jhe(e){let t=new ll;return t.intervals.addInterval(fY(e)),t}function Whe(e){let t=new Ga(e.referenceFrame);return t.intervals.addInterval(fY(e)),t}function tU(e,t,n,i,o,r,s){let a=pr(i.interval);l(o)&&(l(a)?a=Sn.intersect(a,o,Fb):a=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return nme(t[n],a)}let _=!1;if(d){if(u=$tt(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,_=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==uh;if(!_&&!p){d?t[n]=new Qn(m?e.unpack(u,0):u):t[n]=khe(e,s,i);return}let y=t[n],x,b=i.epoch;if(l(b)&&(x=$.fromIso8601(b)),_&&!p){y instanceof od||(t[n]=y=new od(e)),y.addSamplesPackedArray(u,x),eU(i,y);return}let T;if(!_&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=khe(e,s,i),l(y)||(t[n]=y=d?new Zy:new ll),d&&y instanceof Zy?y.intervals.addInterval(a):y instanceof ll?(d&&(a.data=new Qn(a.data)),y.intervals.addInterval(a)):(t[n]=y=jhe(y),d&&(a.data=new Qn(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new ll),y instanceof ll||(t[n]=y=jhe(y));let C=y.intervals;T=C.findInterval(a),(!l(T)||!(T.data instanceof od))&&(T=a.clone(),T.data=new od(e),C.addInterval(T)),T.data.addSamplesPackedArray(u,x),eU(i,T.data)}function nme(e,t){if(e instanceof od){e.removeSamples(t);return}else if(e instanceof Zy){e.intervals.removeInterval(t);return}else if(e instanceof ll){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Fb);o.isEmpty||nme(o.data,t)}n.removeInterval(t);return}}function _e(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)tU(e,t,n,i[a],o,r,s);else tU(e,t,n,i,o,r,s)}function qhe(e,t,n,i,o,r){let s=pr(n.interval);l(i)&&(l(s)?s=Sn.intersect(s,i,Fb):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return ime(e[t],s)}let _,m=!1;if(d&&(l(n.referenceFrame)&&(_=Wi[n.referenceFrame]),_=_??Wi.FIXED,u=uY(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new kl(h.unpack(u),_):e[t]=YP(r,n.reference);return}let y=e[t],x,b=n.epoch;if(l(b)&&(x=$.fromIso8601(b)),m&&!p){(!(y instanceof ja)||l(_)&&y.referenceFrame!==_)&&(e[t]=y=new ja(_,a)),y.addSamplesPackedArray(u,x),eU(n,y);return}let T;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=YP(r,n.reference),l(y)||(d?y=new $y(_):y=new Ga(_),e[t]=y),d&&y instanceof $y&&l(_)&&y.referenceFrame===_?y.intervals.addInterval(s):y instanceof Ga?(d&&(s.data=new kl(s.data,_)),y.intervals.addInterval(s)):(e[t]=y=Whe(y),d&&(s.data=new kl(s.data,_)),y.intervals.addInterval(s));return}l(y)?y instanceof Ga||(e[t]=y=Whe(y)):e[t]=y=new Ga(_);let C=y.intervals;T=C.findInterval(s),(!l(T)||!(T.data instanceof ja)||l(_)&&T.data.referenceFrame!==_)&&(T=s.clone(),T.data=new ja(_,a),C.addInterval(T)),T.data.addSamplesPackedArray(u,x),eU(n,T.data)}function ime(e,t){if(e instanceof ja){e.removeSamples(t);return}else if(e instanceof $y){e.intervals.removeInterval(t);return}else if(e instanceof Ga){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Fb);o.isEmpty||ime(o.data,t)}n.removeInterval(t);return}}function ome(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)qhe(e,t,n[s],i,o,r);else qhe(e,t,n,i,o,r)}function Yhe(e,t,n,i){l(n.references)?nU(e,t,n.references,n.interval,i,GP,ll):(l(n.cartesian2)?n.array=V.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=V.unpackArray(n.cartesian)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function Xhe(e,t,n,i,o,r){let s=pr(n.interval);l(i)&&(l(s)?s=Sn.intersect(s,i,Fb):s=i);let a=e[t],c,u;if(l(s)){a instanceof PP||(a=new PP,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Wt||(c=new Wt),f=n.solidColor,_e(H,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof UP||(c=new UP),f=n.grid,_e(H,c,"color",f.color,void 0,o,r),_e(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),_e(V,c,"lineCount",f.lineCount,void 0,o,r),_e(V,c,"lineThickness",f.lineThickness,void 0,o,r),_e(V,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Hx||(c=new Hx),f=n.image,_e(Image,c,"image",f.image,void 0,o,r),_e(V,c,"repeat",f.repeat,void 0,o,r),_e(H,c,"color",f.color,void 0,o,r),_e(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof jP||(c=new jP),f=n.stripe,_e(Um,c,"orientation",f.orientation,void 0,o,r),_e(H,c,"evenColor",f.evenColor,void 0,o,r),_e(H,c,"oddColor",f.oddColor,void 0,o,r),_e(Number,c,"offset",f.offset,void 0,o,r),_e(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof Mb||(c=new Mb),f=n.polylineOutline,_e(H,c,"color",f.color,void 0,o,r),_e(H,c,"outlineColor",f.outlineColor,void 0,o,r),_e(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof HP||(c=new HP),f=n.polylineGlow,_e(H,c,"color",f.color,void 0,o,r),_e(Number,c,"glowPower",f.glowPower,void 0,o,r),_e(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof zP||(c=new zP),f=n.polylineArrow,_e(H,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof VP||(c=new VP),f=n.polylineDash,_e(H,c,"color",f.color,void 0,void 0,r),_e(H,c,"gapColor",f.gapColor,void 0,void 0,r),_e(Number,c,"dashLength",f.dashLength,void 0,o,r),_e(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof SP||(c=new SP),f=n.checkerboard,_e(H,c,"evenColor",f.evenColor,void 0,o,r),_e(H,c,"oddColor",f.oddColor,void 0,o,r),_e(V,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function Lu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Xhe(e,t,n[s],i,o,r);else Xhe(e,t,n,i,o,r)}function Qtt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Jtt(e,t,n,i){let o=t.description;l(o)&&_e(String,e,"description",o,void 0,i,n)}function ent(e,t,n,i){let o=t.position;l(o)&&ome(e,"position",o,void 0,i,n)}function tnt(e,t,n,i){let o=t.viewFrom;l(o)&&_e(h,e,"viewFrom",o,void 0,i,n)}function nnt(e,t,n,i){let o=t.orientation;l(o)&&_e(Pe,e,"orientation",o,void 0,i,n)}function int(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new zl);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)tU(Hhe(s[a]),e.properties,r,s[a],void 0,i,n);else tU(Hhe(s),e.properties,r,s,void 0,i,n)}}}function nU(e,t,n,i,o,r,s){let a=n.map(function(c){return YP(o,c)});if(l(i)){i=pr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(fY(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Khe(e,t,n,i){let o=n.references;l(o)?nU(e,t,o,n.interval,i,GP,ll):_e(Array,e,t,n,void 0,void 0,i)}function $he(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Khe(e,t,n[o],i);else Khe(e,t,n,i)}function Zhe(e,t,n,i){let o=n.references;l(o)?nU(e,t,o,n.interval,i,qy,Ga):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function $P(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Zhe(e,t,n[o],i);else Zhe(e,t,n,i)}function ont(e){return h.unpackArray(e)}function rnt(e){return h.fromRadiansArrayHeights(e,te.default)}function snt(e){return h.fromDegreesArrayHeights(e,te.default)}function Qhe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return nU(a,"positions",s,n.interval,i,qy,Ga),a.positions});e[t]=new qy(r)}else l(n.cartesian)?n.array=n.cartesian.map(ont):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(rnt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(snt)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i)}function ant(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Qhe(e,t,n[o],i);else Qhe(e,t,n,i)}function cnt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Yhe(e,t,n[o],i);else Yhe(e,t,n,i)}function lnt(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 is),r.addInterval(pr(o[s]));else r=new is,r.addInterval(pr(o));e.availability=r}function unt(e,t,n,i,o){l(t)&&_e(Jy,e,"alignedAxis",t,n,i,o)}function fnt(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 jc),_e(Boolean,s,"show",o.show,r,i,n),_e(Image,s,"image",o.image,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(V,s,"pixelOffset",o.pixelOffset,r,i,n),_e(h,s,"eyeOffset",o.eyeOffset,r,i,n),_e(Ei,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(Bn,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(uh,s,"rotation",o.rotation,r,i,n),unt(s,o.alignedAxis,r,i,n),_e(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Xe,s,"imageSubRegion",o.imageSubRegion,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function dnt(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 XC),_e(Boolean,s,"show",o.show,r,i,n),_e(h,s,"dimensions",o.dimensions,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function hnt(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 $C),_e(Boolean,s,"show",o.show,r,i,n),$P(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Vi,s,"cornerType",o.cornerType,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function mnt(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 ZC),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"length",o.length,r,i,n),_e(Number,s,"topRadius",o.topRadius,r,i,n),_e(Number,s,"bottomRadius",o.bottomRadius,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Number,s,"slices",o.slices,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function pnt(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 se("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new se("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 _nt(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 QC),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),_e(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(uh,s,"rotation",o.rotation,r,i,n),_e(uh,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function gnt(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 JC),_e(Boolean,s,"show",o.show,r,i,n),_e(h,s,"radii",o.radii,r,i,n),_e(h,s,"innerRadii",o.innerRadii,r,i,n),_e(Number,s,"minimumClock",o.minimumClock,r,i,n),_e(Number,s,"maximumClock",o.maximumClock,r,i,n),_e(Number,s,"minimumCone",o.minimumCone,r,i,n),_e(Number,s,"maximumCone",o.maximumCone,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"stackPartitions",o.stackPartitions,r,i,n),_e(Number,s,"slicePartitions",o.slicePartitions,r,i,n),_e(Number,s,"subdivisions",o.subdivisions,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ynt(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 cm),_e(Boolean,s,"show",o.show,r,i,n),_e(String,s,"text",o.text,r,i,n),_e(String,s,"font",o.font,r,i,n),_e(tr,s,"style",o.style,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Boolean,s,"showBackground",o.showBackground,r,i,n),_e(H,s,"backgroundColor",o.backgroundColor,r,i,n),_e(V,s,"backgroundPadding",o.backgroundPadding,r,i,n),_e(V,s,"pixelOffset",o.pixelOffset,r,i,n),_e(h,s,"eyeOffset",o.eyeOffset,r,i,n),_e(Ei,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(Bn,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"fillColor",o.fillColor,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function xnt(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 Fg),_e(Boolean,s,"show",o.show,r,i,n),_e(KP.default,s,"uri",o.gltf,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),_e(Number,s,"maximumScale",o.maximumScale,r,i,n),_e(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),_e(Boolean,s,"runAnimations",o.runAnimations,r,i,n),_e(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"silhouetteColor",o.silhouetteColor,r,i,n),_e(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(il,s,"colorBlendMode",o.colorBlendMode,r,i,n),_e(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Jhe(s,u[a],r,i,n);else Jhe(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)eme(s,f[a],r,i,n);else eme(s,f,r,i,n)}function Jhe(e,t,n,i,o){let r=pr(t.interval);l(n)&&(l(r)?r=Sn.intersect(r,n,Fb):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new zl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new eA),_e(h,p,"translation",d.translation,r,i,o),_e(Pe,p,"rotation",d.rotation,r,i,o),_e(h,p,"scale",d.scale,r,i,o)}}function eme(e,t,n,i,o){let r=pr(t.interval);l(n)&&(l(r)?r=Sn.intersect(r,n,Fb):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new zl),s.hasProperty(f)||s.addProperty(f),_e(Number,s,f,d,r,i,o))}}function bnt(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 Bg),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"leadTime",o.leadTime,r,i,n),_e(Number,s,"trailTime",o.trailTime,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"resolution",o.resolution,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Tnt(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 nA),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"pixelSize",o.pixelSize,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(H,s,"color",o.color,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function XP(e){this.polygon=e,this._definitionChanged=new me}Object.defineProperties(XP.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}}});XP.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new gc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new gc(n,i)};XP.prototype.equals=function(e){return this===e||e instanceof XP&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function Cnt(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 lm),_e(Boolean,s,"show",o.show,r,i,n),$P(s,"_positions",o.positions,n),ant(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new XP(s)),_e(Number,s,"height",o.height,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(uh,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),_e(Boolean,s,"closeTop",o.closeTop,r,i,n),_e(Boolean,s,"closeBottom",o.closeBottom,r,i,n),_e(nn,s,"arcType",o.arcType,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function Ant(e){return e?nn.GEODESIC:nn.NONE}function Ent(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 Kc),_e(Boolean,s,"show",o.show,r,i,n),$P(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),Lu(s,"material",o.material,r,i,n),Lu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),_e(nn,s,"arcType",o.arcType,r,i,n),_e(Boolean,s,"clampToGround",o.clampToGround,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};_e(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Vtt(a.followSurface,Ant)}}function Snt(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 iA),$P(s,"positions",o.positions,n),cnt(s,"shape",o.shape,n),_e(Boolean,s,"show",o.show,r,i,n),_e(Vi,s,"cornerType",o.cornerType,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vnt(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 um),_e(Boolean,s,"show",o.show,r,i,n),_e(ae,s,"coordinates",o.coordinates,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e($e,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e($e,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(uh,s,"rotation",o.rotation,r,i,n),_e(uh,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(zn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function wnt(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 tA),_e(Boolean,s,"show",o.show,r,i,n),_e(KP.default,s,"uri",o.uri,r,i,n),_e(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Int(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 kg),_e(Boolean,s,"show",o.show,r,i,n),$P(s,"positions",o.positions,n),$he(s,"minimumHeights",o.minimumHeights,n),$he(s,"maximumHeights",o.maximumHeights,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Lu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(H,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Tn,s,"shadows",o.shadows,r,i,n),_e(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function tme(e,t,n,i,o){let r=e.id;if(l(r)||(r=Nn()),lY=r,!l(o._version)&&r!=="document")throw new se("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")pnt(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)}lY=void 0}function Pnt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=$.secondsDifference(s,r),c=Math.round(a/120);return t=new km,t.startTime=$.clone(r),t.stopTime=$.clone(s),t.clockRange=rs.LOOP_STOP,t.multiplier=c,t.currentTime=$.clone(r),t.clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new km,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=rs.LOOP_STOP,t.clockStep=Ao.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=$.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=rs[n.range]??rs.LOOP_STOP),l(n.step)&&(t.clockStep=Ao[n.step]??Ao.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function rme(e,t,n,i){n=n??G.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new _t(s)),e._credit=s,typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Ee.createIfNeeded(r),os.setLoading(e,!0),Promise.resolve(o).then(function(a){return Dnt(e,a,r,i)}).catch(function(a){return os.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function Dnt(e,t,n,i){os.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new sme,o.removeAll()),gs._processCzml(t,o,n,void 0,e);let r=Pnt(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=Wy(n.getUrlComponent()),r=!0),os.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function sme(){this.name=void 0,this.clock=void 0}function gs(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._clock=void 0,this._documentPacket=new sme,this._version=void 0,this._entityCollection=new Ca(this),this._entityCluster=new td,this._credit=void 0,this._resourceCredits=[]}gs.load=function(e,t){return new gs().load(e,t)};Object.defineProperties(gs.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}}});gs.updaters=[fnt,dnt,hnt,mnt,_nt,gnt,ynt,xnt,Qtt,Jtt,bnt,Tnt,Cnt,Ent,Snt,int,vnt,ent,wnt,tnt,Int,nnt,lnt];gs.registerUpdater=function(e){gs.updaters.includes(e)||gs.updaters.push(e)};gs.unregisterUpdater=function(e){if(gs.updaters.includes(e)){let t=gs.updaters.indexOf(e);gs.updaters.splice(t,1)}};gs.prototype.process=function(e,t){return rme(this,e,t,!1)};gs.prototype.load=function(e,t){return rme(this,e,t,!0)};gs.prototype.update=function(e){return!0};gs.processPacketData=_e;gs.processPositionPacketData=ome;gs.processMaterialPacketData=Lu;gs._processCzml=function(e,t,n,i,o){if(i=i??gs.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)tme(e[r],t,i,n,o);else tme(e,t,i,n,o)};var iU=gs;function hl(){this._dataSources=[],this._dataSourceAdded=new me,this._dataSourceRemoved=new me,this._dataSourceMoved=new me}Object.defineProperties(hl.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}}});hl.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})};hl.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};hl.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=[]};hl.prototype.contains=function(e){return this.indexOf(e)!==-1};hl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};hl.prototype.get=function(e){return this._dataSources[e]};hl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function oU(e,t){return e.indexOf(t)}function ame(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}hl.prototype.raise=function(e){let t=oU(this._dataSources,e);ame(this,t,t+1)};hl.prototype.lower=function(e){let t=oU(this._dataSources,e);ame(this,t,t-1)};hl.prototype.raiseToTop=function(e){let t=oU(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))};hl.prototype.lowerToBottom=function(e){let t=oU(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};hl.prototype.isDestroyed=function(){return!1};hl.prototype.destroy=function(){return this.removeAll(!0),ce(this)};var rU=hl;function Ea(e){e=e??G.EMPTY_OBJECT,this._primitives=[],this._guid=Nn(),this._primitiveAdded=new me,this._primitiveRemoved=new me,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(Ea.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Ea.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};Ea.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};Ea.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Ea.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=[]};Ea.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function sU(e,t){return e._primitives.indexOf(t)}Ea.prototype.raise=function(e){if(l(e)){let t=sU(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Ea.prototype.raiseToTop=function(e){if(l(e)){let t=sU(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Ea.prototype.lower=function(e){if(l(e)){let t=sU(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Ea.prototype.lowerToBottom=function(e){if(l(e)){let t=sU(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Ea.prototype.get=function(e){return this._primitives[e]};Ea.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Ea.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)}};Ea.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)}};Ea.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)}};Ea.prototype.isDestroyed=function(){return!1};Ea.prototype.destroy=function(){return this.removeAll(),ce(this)};var Jl=Ea;function zm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(zm.prototype,{length:{get:function(){return this._length}}});zm.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Jl({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};zm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};zm.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};zm.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};zm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};zm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};zm.prototype.isDestroyed=function(){return!1};zm.prototype.destroy=function(){return this.removeAll(),ce(this)};var aU=zm;function BE(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new It}BE.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};BE.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};BE.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};BE.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};BE.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var kE=BE;var hY={},cU=new h,cme=new h,lme=new Pe,ume=new Z;function UE(e,t,n,i,o,r,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),cU),h.multiplyByScalar(n,Math.sin(f),cme),h.add(cU,cme,cU);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*d+o*p)/a;return Pe.fromAxisAngle(cU,m,lme),Z.fromQuaternion(lme,ume),Z.multiplyByVector(ume,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var fme=new h,dme=new h,dY=new h,Rnt=new h;hY.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,_=h.fromArray(e,f,fme);i.scaleToGeodeticSurface(_,_);let m=h.clone(_,dme),y=i.geodeticSurfaceNormal(_,Rnt),x=h.multiplyByScalar(y,o,dY);h.add(_,x,_),n&&(h.multiplyByScalar(y,r,x),h.add(m,x,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=_.x,a[d]=_.y,a[p]=_.z}return a};var Ont=new h,Mnt=new h,Lnt=new h;hY.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,d=h.magnitude(s),p=h.normalize(s,Ont),_=h.cross(h.UNIT_Z,s,Mnt);_=h.normalize(_,_);let m=h.cross(p,_,Lnt),y=1+Math.ceil(P.PI_OVER_TWO/a),x=P.PI_OVER_TWO/(y-1),b=P.PI_OVER_TWO-y*x;b<0&&(y-=Math.ceil(Math.abs(b)/x));let T=2*(y*(y+2)),C=t?new Array(T*3):void 0,A=0,S=fme,w=dme,R=y*4*3,D=R-1,M=0,L=n?new Array(R):void 0,g,E,v,I,N;for(b=P.PI_OVER_TWO,S=UE(b,r,m,_,c,f,u,d,p,S),t&&(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z),n&&(L[D--]=S.z,L[D--]=S.y,L[D--]=S.x),b=P.PI_OVER_TWO-x,g=1;g<y+1;++g){if(S=UE(b,r,m,_,c,f,u,d,p,S),w=UE(Math.PI-b,r,m,_,c,f,u,d,p,w),t){for(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,v=2*g+2,E=1;E<v-1;++E)I=E/(v-1),N=h.lerp(S,w,I,dY),C[A++]=N.x,C[A++]=N.y,C[A++]=N.z;C[A++]=w.x,C[A++]=w.y,C[A++]=w.z}n&&(L[D--]=S.z,L[D--]=S.y,L[D--]=S.x,L[M++]=w.x,L[M++]=w.y,L[M++]=w.z),b=P.PI_OVER_TWO-(g+1)*x}for(g=y;g>1;--g){if(b=P.PI_OVER_TWO-(g-1)*x,S=UE(-b,r,m,_,c,f,u,d,p,S),w=UE(b+Math.PI,r,m,_,c,f,u,d,p,w),t){for(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,v=2*(g-1)+2,E=1;E<v-1;++E)I=E/(v-1),N=h.lerp(S,w,I,dY),C[A++]=N.x,C[A++]=N.y,C[A++]=N.z;C[A++]=w.x,C[A++]=w.y,C[A++]=w.z}n&&(L[D--]=S.z,L[D--]=S.y,L[D--]=S.x,L[M++]=w.x,L[M++]=w.y,L[M++]=w.z)}b=P.PI_OVER_TWO,S=UE(-b,r,m,_,c,f,u,d,p,S);let F={};return t&&(C[A++]=S.x,C[A++]=S.y,C[A++]=S.z,F.positions=C,F.numPts=y),n&&(L[D--]=S.z,L[D--]=S.y,L[D--]=S.x,F.outerPositions=L),F};var Nu=hY;var zE=new h,mY=new h,pY=new h,hme=new h,Ns=new V,mme=new Z,Nnt=new Z,_Y=new Pe,pme=new h,_me=new h,gme=new h,fU=new fe,yme=new h,xme=new V,bme=new V;function Tme(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,_=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,x=0,b=pme,T=_me,C=gme,A=new Fi(a),S=A.project(a.cartesianToCartographic(o,fU),yme),w=a.scaleToGeodeticSurface(o,zE);a.geodeticSurfaceNormal(w,w);let R=mme,D=Nnt;if(c!==0){let N=Pe.fromAxisAngle(w,c,_Y);R=Z.fromQuaternion(N,R),N=Pe.fromAxisAngle(w,-c,_Y),D=Z.fromQuaternion(N,D)}else R=Z.clone(Z.IDENTITY,R),D=Z.clone(Z.IDENTITY,D);let M=V.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,xme),L=V.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,bme),g=e.length,E=n?g:0,v=E/3*2;for(let N=0;N<g;N+=3){let F=N+1,U=N+2,k=h.fromArray(e,N,zE);if(i.st){let z=Z.multiplyByVector(R,k,mY),B=A.project(a.cartesianToCartographic(z,fU),pY);h.subtract(B,S,B),Ns.x=(B.x+r)/(2*r),Ns.y=(B.y+s)/(2*s),M.x=Math.min(Ns.x,M.x),M.y=Math.min(Ns.y,M.y),L.x=Math.max(Ns.x,L.x),L.y=Math.max(Ns.y,L.y),n&&(d[x+v]=Ns.x,d[x+1+v]=Ns.y),d[x++]=Ns.x,d[x++]=Ns.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(k,b),f&&(y[N+E]=-b.x,y[F+E]=-b.y,y[U+E]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(T=h.normalize(h.cross(h.UNIT_Z,b,T),T),Z.multiplyByVector(D,T,T)),i.normal&&(p[N]=b.x,p[F]=b.y,p[U]=b.z,n&&(p[N+E]=-b.x,p[F+E]=-b.y,p[U+E]=-b.z)),i.tangent&&(_[N]=T.x,_[F]=T.y,_[U]=T.z,n&&(_[N+E]=-T.x,_[F+E]=-T.y,_[U+E]=-T.z)),i.bitangent&&(C=h.normalize(h.cross(b,T,C),C),m[N]=C.x,m[F]=C.y,m[U]=C.z,n&&(m[N+E]=C.x,m[F+E]=C.y,m[U+E]=C.z))))}if(i.st){g=d.length;for(let N=0;N<g;N+=2)d[N]=(d[N]-M.x)/(L.x-M.x),d[N+1]=(d[N+1]-M.y)/(L.y-M.y)}let I=new pn;if(i.position){let N=Nu.raisePositionsToHeight(e,t,n);I.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),i.bitangent&&(I.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===cn.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===cn.NONE?0:1;N=N.fill(F)}I.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function Cme(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 Bb=new h;function Fnt(e){let t=e.center;Bb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Bb),e.height,Bb),Bb=h.add(t,Bb,Bb);let n=new re(Bb,e.semiMajorAxis),i=Nu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Tme(o,e,!1),a=Cme(r);return a=ke.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function Bnt(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,_=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,x=t.shadowVolume,b=x?new Float32Array(f*3):void 0,T=0,C=pme,A=_me,S=gme,w=new Fi(s),R=w.project(s.cartesianToCartographic(i,fU),yme),D=s.scaleToGeodeticSurface(i,zE);s.geodeticSurfaceNormal(D,D);let M=Pe.fromAxisAngle(D,u,_Y),L=Z.fromQuaternion(M,mme),g=V.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,xme),E=V.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,bme),v=e.length,I=v/3*2;for(let F=0;F<v;F+=3){let U=F+1,k=F+2,z=h.fromArray(e,F,zE),B;if(n.st){let W=Z.multiplyByVector(L,z,mY),J=w.project(s.cartesianToCartographic(W,fU),pY);h.subtract(J,R,J),Ns.x=(J.x+o)/(2*o),Ns.y=(J.y+r)/(2*r),g.x=Math.min(Ns.x,g.x),g.y=Math.min(Ns.y,g.y),E.x=Math.max(Ns.x,E.x),E.y=Math.max(Ns.y,E.y),p[T+I]=Ns.x,p[T+1+I]=Ns.y,p[T++]=Ns.x,p[T++]=Ns.y}z=s.scaleToGeodeticSurface(z,z),B=h.clone(z,mY),C=s.geodeticSurfaceNormal(z,C),x&&(b[F+v]=-C.x,b[U+v]=-C.y,b[k+v]=-C.z);let j=h.multiplyByScalar(C,a,hme);if(z=h.add(z,j,z),j=h.multiplyByScalar(C,c,j),B=h.add(B,j,B),n.position&&(d[F+v]=B.x,d[U+v]=B.y,d[k+v]=B.z,d[F]=z.x,d[U]=z.y,d[k]=z.z),n.normal||n.tangent||n.bitangent){S=h.clone(C,S);let W=h.fromArray(e,(F+3)%v,hme);h.subtract(W,z,W);let J=h.subtract(B,z,pY);C=h.normalize(h.cross(J,W,C),C),n.normal&&(_[F]=C.x,_[U]=C.y,_[k]=C.z,_[F+v]=C.x,_[U+v]=C.y,_[k+v]=C.z),n.tangent&&(A=h.normalize(h.cross(S,C,A),A),m[F]=A.x,m[U]=A.y,m[k]=A.z,m[F+v]=A.x,m[F+1+v]=A.y,m[F+2+v]=A.z),n.bitangent&&(y[F]=S.x,y[U]=S.y,y[k]=S.z,y[F+v]=S.x,y[U+v]=S.y,y[k+v]=S.z)}}if(n.st){v=p.length;for(let F=0;F<v;F+=2)p[F]=(p[F]-g.x)/(E.x-g.x),p[F+1]=(p[F+1]-g.y)/(E.y-g.y)}let N=new pn;if(n.position&&(N.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(N.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),n.tangent&&(N.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),x&&(N.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===cn.TOP)F=F.fill(1,0,f/2);else{let U=t.offsetAttribute===cn.NONE?0:1;F=F.fill(U)}N.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function knt(e){let t=e.length/3,n=ke.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 lU=new re,uU=new re;function Unt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,zE),e.height,zE);lU.center=h.add(t,o,lU.center),lU.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),uU.center=h.add(t,o,uU.center),uU.radius=i;let r=Nu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=re.union(lU,uU),f=Tme(s,e,!0),d=Cme(a),p=d.length;d.length=p*2;let _=s.length/3;for(let A=0;A<p;A+=3)d[A+p]=d[A+2]+_,d[A+1+p]=d[A+1]+_,d[A+2+p]=d[A]+_;let m=ke.createTypedArray(_*2/3,d),y=new lt({attributes:f,indices:m,primitiveType:Le.TRIANGLES}),x=Bnt(c,e);d=knt(c);let b=ke.createTypedArray(c.length*2/3,d),T=new lt({attributes:x,indices:b,primitiveType:Le.TRIANGLES}),C=Fn.combineInstances([new Pt({geometry:y}),new Pt({geometry:T})]);return{boundingSphere:u,attributes:C[0].attributes,indices:C[0].indices}}function Ame(e,t,n,i,o,r,s){let c=Nu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ae.fromCartesianArray(f,r,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function Hm(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??P.RADIANS_PER_DEGREE,s=e.vertexFormat??De.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=De.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}Hm.packedLength=h.packedLength+te.packedLength+De.packedLength+9;Hm.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 Eme=new h,Sme=new te,vme=new De,Vm={center:Eme,ellipsoid:Sme,vertexFormat:vme,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};Hm.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Eme);t+=h.packedLength;let o=te.unpack(e,t,Sme);t+=te.packedLength;let r=De.unpack(e,t,vme);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],_=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=_,n._offsetAttribute=m===-1?void 0:m,n):(Vm.height=f,Vm.extrudedHeight=p,Vm.granularity=d,Vm.stRotation=u,Vm.rotation=c,Vm.semiMajorAxis=s,Vm.semiMinorAxis=a,Vm.shadowVolume=_,Vm.offsetAttribute=m===-1?void 0:m,new Hm(Vm))};Hm.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??P.RADIANS_PER_DEGREE,a=e.rotation??0;return Ame(n,o,r,a,s,i,t)};Hm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.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=Unt(o);else if(r=Fnt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===cn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:Le.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Hm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Hm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};function znt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Nu.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]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return lt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Hm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ame(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=znt(this)),this._textureCoordinateRotationPoints}}});var eu=Hm;var wme=new h,kb=new h;function Vnt(e){let t=e.center;kb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,kb),e.height,kb),kb=h.add(t,kb,kb);let n=new re(kb,e.semiMajorAxis),i=Nu.computeEllipsePositions(e,!1,!0).outerPositions,o=new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:Nu.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=ke.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 dU=new re,hU=new re;function Hnt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,wme),e.height,wme);dU.center=h.add(t,o,dU.center),dU.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),hU.center=h.add(t,o,hU.center),hU.radius=i;let r=Nu.computeEllipsePositions(e,!1,!0).outerPositions,s=new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:Nu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=re.union(dU,hU),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===cn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===cn.NONE?0:1;m=m.fill(y)}s.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=P.clamp(u,0,c/2);let f=ke.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let _;if(u>0){let m=Math.min(u,c);_=Math.round(c/m);let y=Math.min(_*u,c);for(p=0;p<y;p+=_)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function VE(e){e=e??G.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??P.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}VE.packedLength=h.packedLength+te.packedLength+8;VE.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Ime=new h,Pme=new te,N_={center:Ime,ellipsoid:Pme,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};VE.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Ime);t+=h.packedLength;let o=te.unpack(e,t,Pme);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(N_.height=c,N_.extrudedHeight=f,N_.granularity=u,N_.rotation=a,N_.semiMajorAxis=r,N_.semiMinorAxis=s,N_.numberOfVerticalLines=d,N_.offsetAttribute=p===-1?void 0:p,new VE(N_))};VE.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.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=Hnt(o);else if(r=Vnt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===cn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:Le.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var sd=VE;var Dme=new H,Rme=h.ZERO,Ome=new h,Mme=new ae;function Gnt(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 fh(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new Gnt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(fh.prototype=Object.create(jn.prototype),fh.prototype.constructor=fh);fh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Dme)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Rme,Ome))),new Pt({id:t,geometry:new eu(this._options),attributes:i})};fh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Dme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Rme,Ome))),new Pt({id:t,geometry:new sd(this._options),attributes:r})};fh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};fh.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)};fh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};fh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,$e.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=jn.computeGeometryOffsetAttribute(n,i,o,r),s.height=jn.getGeometryHeight(n,i),o=jn.getGeometryExtrudedHeight(o,r),o===jn.CLAMP_TO_GROUND&&(o=mi.getMinimumMaximumHeights(eu.computeRectangle(s,Mme)).minimumTerrainHeight),s.extrudedHeight=o};fh.DynamicGeometryUpdater=HE;function HE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(HE.prototype=Object.create(si.prototype),HE.prototype.constructor=HE);HE.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)};HE.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,$e.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=mi.getMinimumMaximumHeights(eu.computeRectangle(i,Mme)).minimumTerrainHeight),i.extrudedHeight=s};var mU=fh;var jnt=new h,Wnt=new h,qnt=new h,Ynt=new h,Xnt=new h,Knt=new h(1,1,1),Lme=Math.cos,Nme=Math.sin;function F_(e){e=e??G.EMPTY_OBJECT;let t=e.radii??Knt,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??P.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??De.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=De.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}F_.packedLength=2*h.packedLength+De.packedLength+7;F_.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 Fme=new h,Bme=new h,kme=new De,e0={radii:Fme,innerRadii:Bme,vertexFormat:kme,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};F_.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Fme);t+=h.packedLength;let o=h.unpack(e,t,Bme);t+=h.packedLength;let r=De.unpack(e,t,kme);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=De.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(e0.minimumClock=s,e0.maximumClock=a,e0.minimumCone=c,e0.maximumCone=u,e0.stackPartitions=f,e0.slicePartitions=d,e0.offsetAttribute=p===-1?void 0:p,new F_(e0))};F_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,_=[r],m=[i];for(f=0;f<u;f++)_.push(r+f*(s-r)/(u-1));for(_.push(s),d=0;d<c;d++)m.push(i+d*(o-i)/(c-1));m.push(o);let y=_.length,x=m.length,b=0,T=1,C=n.x!==t.x||n.y!==t.y||n.z!==t.z,A=!1,S=!1,w=!1;C&&(T=2,r>0&&(A=!0,b+=c-1),s<Math.PI&&(S=!0,b+=c-1),(o-i)%P.TWO_PI?(w=!0,b+=(u-1)*2+1):b+=1);let R=x*y*T,D=new Float64Array(R*3),M=new Array(R).fill(!1),L=new Array(R).fill(!1),g=c*u*T,E=6*(g+b+1-(c+u)*T),v=ke.createTypedArray(g,E),I=a.normal?new Float32Array(R*3):void 0,N=a.tangent?new Float32Array(R*3):void 0,F=a.bitangent?new Float32Array(R*3):void 0,U=a.st?new Float32Array(R*2):void 0,k=new Array(y),z=new Array(y);for(f=0;f<y;f++)k[f]=Nme(_[f]),z[f]=Lme(_[f]);let B=new Array(x),j=new Array(x);for(d=0;d<x;d++)j[d]=Lme(m[d]),B[d]=Nme(m[d]);for(f=0;f<y;f++)for(d=0;d<x;d++)D[p++]=t.x*k[f]*j[d],D[p++]=t.y*k[f]*B[d],D[p++]=t.z*z[f];let W=R/2;if(C)for(f=0;f<y;f++)for(d=0;d<x;d++)D[p++]=n.x*k[f]*j[d],D[p++]=n.y*k[f]*B[d],D[p++]=n.z*z[f],M[W]=!0,f>0&&f!==y-1&&d!==0&&d!==x-1&&(L[W]=!0),W++;p=0;let J,Y;for(f=1;f<y-2;f++)for(J=f*x,Y=(f+1)*x,d=1;d<x-2;d++)v[p++]=Y+d,v[p++]=Y+d+1,v[p++]=J+d+1,v[p++]=Y+d,v[p++]=J+d+1,v[p++]=J+d;if(C){let Ke=y*x;for(f=1;f<y-2;f++)for(J=Ke+f*x,Y=Ke+(f+1)*x,d=1;d<x-2;d++)v[p++]=Y+d,v[p++]=J+d,v[p++]=J+d+1,v[p++]=Y+d,v[p++]=J+d+1,v[p++]=Y+d+1}let ee,Q;if(C){if(A)for(Q=y*x,f=1;f<x-2;f++)v[p++]=f,v[p++]=f+1,v[p++]=Q+f+1,v[p++]=f,v[p++]=Q+f+1,v[p++]=Q+f;if(S)for(ee=y*x-x,Q=y*x*T-x,f=1;f<x-2;f++)v[p++]=ee+f+1,v[p++]=ee+f,v[p++]=Q+f,v[p++]=ee+f+1,v[p++]=Q+f,v[p++]=Q+f+1}if(w){for(f=1;f<y-2;f++)Q=x*y+x*f,ee=x*f,v[p++]=Q,v[p++]=ee+x,v[p++]=ee,v[p++]=Q,v[p++]=Q+x,v[p++]=ee+x;for(f=1;f<y-2;f++)Q=x*y+x*(f+1)-1,ee=x*(f+1)-1,v[p++]=ee+x,v[p++]=Q,v[p++]=ee,v[p++]=ee+x,v[p++]=Q+x,v[p++]=Q}let de=new pn;a.position&&(de.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:D}));let ge=0,le=0,ye=0,be=0,Ie=R/2,Te,ve=te.fromCartesian3(t),Ve=te.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<R;f++){Te=M[f]?Ve:ve;let Ke=h.fromArray(D,f*3,jnt),Ct=Te.geodeticSurfaceNormal(Ke,Wnt);if(L[f]&&h.negate(Ct,Ct),a.st){let Qt=V.negate(Ct,Xnt);U[ge++]=Math.atan2(Qt.y,Qt.x)/P.TWO_PI+.5,U[ge++]=Math.asin(Ct.z)/Math.PI+.5}if(a.normal&&(I[le++]=Ct.x,I[le++]=Ct.y,I[le++]=Ct.z),a.tangent||a.bitangent){let Qt=qnt,Qe=0,hn;if(M[f]&&(Qe=Ie),!A&&f>=Qe&&f<Qe+x*2?hn=h.UNIT_X:hn=h.UNIT_Z,h.cross(hn,Ct,Qt),h.normalize(Qt,Qt),a.tangent&&(N[ye++]=Qt.x,N[ye++]=Qt.y,N[ye++]=Qt.z),a.bitangent){let Nt=h.cross(Ct,Qt,Ynt);h.normalize(Nt,Nt),F[be++]=Nt.x,F[be++]=Nt.y,F[be++]=Nt.z}}}a.st&&(de.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(de.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(de.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let Ke=D.length,Ct=e._offsetAttribute===cn.NONE?0:1,Qt=new Uint8Array(Ke/3).fill(Ct);de.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:Qt})}return new lt({attributes:de,indices:v,primitiveType:Le.TRIANGLES,boundingSphere:re.fromEllipsoid(ve),offsetAttribute:e._offsetAttribute})};var gY;F_.getUnitEllipsoid=function(){return l(gY)||(gY=F_.createGeometry(new F_({radii:new h(1,1,1),vertexFormat:De.POSITION_ONLY}))),gY};var Sa=F_;var $nt=new Wt(H.WHITE),yY=h.ZERO,xY=new h,Znt=new h,Qnt=new h,bY=new H,Jnt=new h(1,1,1);function eit(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 Fu(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new eit(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Fu.prototype=Object.create(ai.prototype),Fu.prototype.constructor=Fu);Object.defineProperties(Fu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Fu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Un.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Wt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,bY)),l(f)||(f=H.WHITE),r=Yt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,yY,xY))),new Pt({id:i,geometry:new Sa(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Fu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,bY),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:Un.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,yY,xY))),new Pt({id:i,geometry:new Zf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Fu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Fu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ai.prototype._isHidden.call(this,e,t)};Fu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};Fu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Wt?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==$e.NONE?cn.ALL:void 0};Fu.prototype._onEntityPropertyChanged=Ug;Fu.DynamicGeometryUpdater=ZP;function ZP(e,t,n){si.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new O,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 h,this._material={}}l(Object.create)&&(ZP.prototype=Object.create(si.prototype),ZP.prototype.constructor=ZP);ZP.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,Znt),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=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,H.BLACK,bY),c=dr.getValue(e,n.material??$nt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,Qnt),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),_=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),x=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),T=X.getValueOrDefault(n.heightReference,e,$e.NONE),C=T!==$e.NONE?cn.ALL:void 0,A=this._scene.mode,S=A===ne.SCENE3D&&T===$e.NONE,w=this._options,R=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,yY,xY);if(!S||this._lastSceneMode!==A||!l(this._primitive)||w.stackPartitions!==m||w.slicePartitions!==y||l(u)&&!h.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==d||w.minimumCone!==p||w.maximumCone!==_||w.subdivisions!==x||this._lastOutlineWidth!==b||w.offsetAttribute!==C){let E=this._primitives;E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=A,this._lastOutlineWidth=b,w.stackPartitions=m,w.slicePartitions=y,w.subdivisions=x,w.offsetAttribute=C,w.radii=h.clone(S?Jnt:i,w.radii),l(u)?S?w.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=h.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=d,w.minimumCone=p,w.maximumCone=_;let v=new mo({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=v.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=E.add(new Dn({geometryInstances:I,appearance:v,asynchronous:!1,shadows:R}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=E.add(new Dn({geometryInstances:N,appearance:new un({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:R})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=H.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,v=this._outlinePrimitive;E.show=!0,v.show=!0,E.appearance.material=c;let I=this._attributes;l(I)||(I=E.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=bn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;l(N)||(N=v.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=bn.toValue(s,N.show),this._lastOutlineShow=s),H.equals(a,this._lastOutlineColor)||(N.color=Yt.toValue(a,N.color),H.clone(a,this._lastOutlineColor)),Mt.equals(M,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Un.toValue(M,I.distanceDisplayCondition),N.distanceDisplayCondition=Un.toValue(M,N.distanceDisplayCondition),Mt.clone(M,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(I.offset=ro.toValue(L,I.offset),N.offset=ro.toValue(L,I.offset),h.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=O.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var pU=Fu;function GE(e){e=e??G.EMPTY_OBJECT;let t=e.vertexFormat??De.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}GE.packedLength=De.packedLength;GE.pack=function(e,t,n){return n=n??0,De.pack(e._vertexFormat,t,n),t};var Ume=new De,tit={vertexFormat:Ume};GE.unpack=function(e,t,n){t=t??0;let i=De.unpack(e,t,Ume);return l(n)?(n._vertexFormat=De.clone(i,n._vertexFormat),n):new GE(tit)};var _U=new h(-.5,-.5,0),gU=new h(.5,.5,0);GE.createGeometry=function(e){let t=e._vertexFormat,n=new pn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=_U.x,o[1]=_U.y,o[2]=0,o[3]=gU.x,o[4]=_U.y,o[5]=0,o[6]=gU.x,o[7]=gU.y,o[8]=0,o[9]=_U.x,o[10]=gU.y,o[11]=0,n.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new we({componentDatatype:K.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 lt({attributes:n,indices:i,primitiveType:Le.TRIANGLES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var yU=GE;function jE(){this._workerName="createPlaneOutlineGeometry"}jE.packedLength=0;jE.pack=function(e,t){return t};jE.unpack=function(e,t,n){return l(n)?n:new jE};var t0=new h(-.5,-.5,0),xU=new h(.5,.5,0);jE.createGeometry=function(){let e=new pn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=t0.x,n[1]=t0.y,n[2]=t0.z,n[3]=xU.x,n[4]=t0.y,n[5]=t0.z,n[6]=xU.x,n[7]=xU.y,n[8]=t0.z,n[9]=t0.x,n[10]=xU.y,n[11]=t0.z,e.position=new we({componentDatatype:K.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 lt({attributes:e,indices:t,primitiveType:Le.LINES,boundingSphere:new re(h.ZERO,Math.sqrt(2))})};var bU=jE;var nit=new h,zme=new H;function iit(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function ad(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new iit(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(ad.prototype=Object.create(ai.prototype),ad.prototype.constructor=ad);ad.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let _;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(_=this._materialProperty.color.getValue(e,zme)),l(_)||(_=H.WHITE),o=Yt.fromColor(_),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=TY(d,p,f,f),new Pt({id:t,geometry:new yU(this._options),modelMatrix:f,attributes:i})};ad.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,zme),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(r.plane,e,s.plane),u=X.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=TY(c,u,a,a),new Pt({id:t,geometry:new bU,modelMatrix:a,attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};ad.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ai.prototype._isHidden.call(this,e,t)};ad.prototype._getIsClosed=function(e){return!1};ad.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};ad.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};ad.DynamicGeometryUpdater=WE;function WE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(WE.prototype=Object.create(si.prototype),WE.prototype.constructor=WE);WE.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,nit);return!l(o)||!l(i.plane)||!l(i.dimensions)||si.prototype._isHidden.call(this,e,t,n)};WE.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var oit=new h,rit=new h,sit=new h,ait=new h,cit=new Z,lit=new Z,uit=new O;function TY(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,sit),a=h.clone(h.UNIT_Z,rit);P.equalsEpsilon(Math.abs(h.dot(a,o)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,oit);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let u=cit;Z.setColumn(u,0,c,u),Z.setColumn(u,1,a,u),Z.setColumn(u,2,o,u);let f=h.fromElements(t.x,t.y,1,ait),d=Z.multiplyByScale(u,f,lit),p=O.fromRotationTranslation(d,s,uit);return O.multiplyTransformation(n,p,i)}ad.createPrimitiveMatrix=TY;var TU=ad;var fit=new h,dit=new Xe,hit=new V,mit=new V,pit=new h,_it=new h,git=new h,QP=new h,yit=new h,xit=new h,Vme=new Pe,bit=new Z,Tit=new Z,Cit=new h;function Ait(e,t,n,i,o,r,s,a,c){let u=e.positions,f=li.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=ke.createTypedArray(u.length,f.length);d.set(f);let p=bit;if(i!==0){let g=Pe.fromAxisAngle(s,i,Vme);if(p=Z.fromQuaternion(g,p),t.tangent||t.bitangent){g=Pe.fromAxisAngle(s,-i,Vme);let E=Z.fromQuaternion(g,Tit);a=h.normalize(Z.multiplyByVector(E,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=Z.clone(Z.IDENTITY,p);let _=mit;t.st&&(_.x=n.x,_.y=n.y);let m=u.length,y=m*3,x=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,T=t.tangent?new Float32Array(y):void 0,C=t.bitangent?new Float32Array(y):void 0,A=t.st?new Float32Array(m*2):void 0,S=0,w=0,R=0,D=0,M=0;for(let g=0;g<m;g++){let E=u[g];if(x[S++]=E.x,x[S++]=E.y,x[S++]=E.z,t.st)if(l(o)&&o.positions.length===m)A[M++]=o.positions[g].x,A[M++]=o.positions[g].y;else{let v=Z.multiplyByVector(p,E,fit),I=r(v,hit);V.subtract(I,_,I);let N=P.clamp(I.x/n.width,0,1),F=P.clamp(I.y/n.height,0,1);A[M++]=N,A[M++]=F}t.normal&&(b[w++]=s.x,b[w++]=s.y,b[w++]=s.z),t.tangent&&(T[D++]=a.x,T[D++]=a.y,T[D++]=a.z),t.bitangent&&(C[R++]=c.x,C[R++]=c.y,C[R++]=c.z)}let L=new pn;return t.position&&(L.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(L.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(L.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:C})),t.st&&(L.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:A})),new lt({attributes:L,indices:d,primitiveType:Le.TRIANGLES})}function Ub(e){e=e??G.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??De.DEFAULT;this._vertexFormat=De.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Hn.computeHierarchyPackedLength(t,h)+De.packedLength+te.packedLength+(l(n)?Hn.computeHierarchyPackedLength(n,V):1)+2}Ub.fromPositions=function(e){e=e??G.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Ub(t)};Ub.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Hn.packPolygonHierarchy(e._textureCoordinates,t,n,V):t[n++]=-1,t[n++]=e.packedLength,t};var Eit=te.clone(te.UNIT_SPHERE),Sit=new De,vit={polygonHierarchy:{}};Ub.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Eit);t+=te.packedLength;let r=De.unpack(e,t,Sit);t+=De.packedLength;let s=e[t++],a=e[t]===-1?void 0:Hn.unpackPolygonHierarchy(e,t,V);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Ub(vit)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Ub.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=vo(s,h.equalsEpsilon,!0),s.length<3)return;let a=pit,c=_it,u=git,f=yit,d=xit;if(!My.computeProjectTo2DArguments(s,QP,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(QP,h.ZERO,P.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(QP,Cit);h.dot(a,M)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let _=My.createProjectPointsTo2DFunction(QP,f,d),m=My.createProjectPointTo2DFunction(QP,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=Hn.polygonsFromHierarchy(n,r,_,!1),x=y.hierarchy,b=y.polygons,T=function(M){return M},C=r?Hn.polygonsFromHierarchy(o,!0,T,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let A=re.fromPoints(s),S=Hn.computeBoundingRectangle(a,m,s,i,dit),w=[];for(let M=0;M<b.length;M++){let L=new Pt({geometry:Ait(b[M],t,S,i,r?C[M]:void 0,m,a,c,u)});w.push(L)}let R=Fn.combineInstances(w)[0];R.attributes.position.values=new Float64Array(R.attributes.position.values),R.indices=ke.createTypedArray(R.attributes.position.values.length/3,R.indices);let D=R.attributes;return t.position||delete D.position,new lt({attributes:D,indices:R.indices,primitiveType:R.primitiveType,boundingSphere:A})};var CU=Ub;var Hme=[],AU=[];function wit(e,t,n,i,o){let s=fs.fromPoints(t,e).projectPointsOntoPlane(t,Hme);li.computeWindingOrder2D(s)===Ps.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(o===nn.GEODESIC)for(u=0;u<f;u++)m+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===nn.RHUMB)for(u=0;u<f;u++)m+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;o===nn.GEODESIC?y=Hn.subdivideLine(t[u],t[(u+1)%f],n,AU):o===nn.RHUMB&&(y=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,AU));let x=y.length;for(let b=0;b<x;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,_=ke.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)_[d++]=u,_[d++]=u+1;return _[d++]=f-1,_[d++]=0,new Pt({geometry:new lt({attributes:new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Le.LINES})})}function Iit(e,t,n,i,o){let s=fs.fromPoints(t,e).projectPointsOntoPlane(t,Hme);li.computeWindingOrder2D(s)===Ps.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let x=t[u],b=t[(u+1)%f];c[p++]=x.x,c[p++]=x.y,c[p++]=x.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let x=0;if(o===nn.GEODESIC)for(u=0;u<f;u++)x+=Hn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===nn.RHUMB)for(u=0;u<f;u++)x+=Hn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(x*3*2),u=0;u<f;++u){d[u]=p/3;let b;o===nn.GEODESIC?b=Hn.subdivideLine(t[u],t[(u+1)%f],n,AU):o===nn.RHUMB&&(b=Hn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,AU));let T=b.length;for(let C=0;C<T;++C)c[p++]=b[C]}}f=c.length/(3*2);let _=d.length,m=(f*2+_)*2,y=ke.createTypedArray(f+_,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<_;u++){let x=d[u];y[p++]=x,y[p++]=x+f}return new Pt({geometry:new lt({attributes:new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Le.LINES})})}function zb(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??P.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??nn.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Hn.computeHierarchyPackedLength(t,h)+te.packedLength+8}zb.pack=function(e,t,n){return n=n??0,n=Hn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var Pit=te.clone(te.UNIT_SPHERE),Dit={polygonHierarchy:{}};zb.unpack=function(e,t,n){t=t??0;let i=Hn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Pit);t+=te.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new zb(Dit)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};zb.fromPositions=function(e){e=e??G.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 zb(t)};zb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Hn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),_,m;if(p)for(m=0;m<s.length;m++){if(a=Iit(t,s[m],u,o,r),a.geometry=Hn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,o),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,T=new Uint8Array(b);e._offsetAttribute===cn.TOP?T=T.fill(1,0,b/2):(_=e._offsetAttribute===cn.NONE?0:1,T=T.fill(_)),a.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}else for(m=0;m<s.length;m++){if(a=wit(t,s[m],u,o,r),a.geometry.attributes.position.values=li.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;_=e._offsetAttribute===cn.NONE?0:1;let T=new Uint8Array(b/3).fill(_);a.geometry.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}c.push(a)}let y=Fn.combineInstances(c)[0],x=re.fromVertices(y.attributes.position.values);return new lt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var EU=zb;var Gme="Entity polygons cannot have both height and perPositionHeight. height will be ignored",jme="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Wme=new H,qme=h.ZERO,Yme=new h,Xme=new ae,Rit=[],Oit=new V;function Mit(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 Bu(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new Mit(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Bu.prototype=Object.create(jn.prototype),Bu.prototype.constructor=Bu);Bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Wme)),l(s)||(s=H.WHITE),o.color=Yt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qme,Yme)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new CU(i):r=new ly(i),new Pt({id:t,geometry:r,attributes:o})};Bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Wme),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:Un.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qme,Yme)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new rh(i):a=new EU(i),new Pt({id:t,geometry:a,attributes:s})};Bu.prototype._computeCenter=function(e,t){let n=X.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=fs.fromPoints(i,o),s=r.projectPointsOntoPlane(i,Rit),a=s.length,c=0,u=a-1,f=new V;for(let p=0;p<a;u=p++){let _=s[p],m=s[u],y=_.x*m.y-m.x*_.y,x=V.add(_,m,Oit);x=V.multiplyByScalar(x,y,x),f=V.add(f,x,f),c+=y}let d=1/(c*3);return f=V.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};Bu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ai.prototype._isHidden.call(this,e,t)};Bu.prototype._isOnTerrain=function(e,t){let n=jn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};Bu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};Bu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=this._options;i.vertexFormat=n?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),a=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,$e.NONE),u=X.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=jn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,Tt(Gme)),s!==$e.NONE&&u&&(r=void 0,Tt(jme))):(l(a)&&!l(r)&&(r=0),f=jn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,nn.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=jn.getGeometryExtrudedHeight(a,c),a===jn.CLAMP_TO_GROUND){let d=ly.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Xme);a=mi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Bu.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)};Bu.DynamicGeometryUpdater=qE;function qE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(qE.prototype=Object.create(si.prototype),qE.prototype.constructor=qE);qE.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||si.prototype._isHidden.call(this,e,t,n)};qE.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,$e.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);o=jn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,Tt(Gme)),r!==$e.NONE&&c&&(o=void 0,Tt(jme))):(l(a)&&!l(o)&&(o=0),u=jn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,n,nn.GEODESIC),a=jn.getGeometryExtrudedHeight(a,s),a===jn.CLAMP_TO_GROUND){let f=ly.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Xme);a=mi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var SU=Bu;function Lit(e,t,n,i){let o=new pn;i.position&&(o.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=li.triangulate(t),u=(a-1)*r*6+c.length*2,f=ke.createTypedArray(s,u),d,p,_,m,y,x,b=r*2,T=0;for(d=0;d<a-1;d++){for(p=0;p<r-1;p++)_=p*2+d*r*2,x=_+b,m=_+1,y=m+b,f[T++]=m,f[T++]=_,f[T++]=y,f[T++]=y,f[T++]=_,f[T++]=x;_=r*2-2+d*r*2,m=_+1,y=m+b,x=_+b,f[T++]=m,f[T++]=_,f[T++]=y,f[T++]=y,f[T++]=_,f[T++]=x}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(s*2),w=1/(a-1),R=1/n.height,D=n.height/2,M,L,g=0;for(d=0;d<a;d++){for(M=d*w,L=R*(t[0].y+D),S[g++]=M,S[g++]=L,p=1;p<r;p++)L=R*(t[p].y+D),S[g++]=M,S[g++]=L,S[g++]=M,S[g++]=L;L=R*(t[0].y+D),S[g++]=M,S[g++]=L}for(p=0;p<r;p++)M=0,L=R*(t[p].y+D),S[g++]=M,S[g++]=L;for(p=0;p<r;p++)M=(a-1)*w,L=R*(t[p].y+D),S[g++]=M,S[g++]=L;o.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let C=s-r*2;for(d=0;d<c.length;d+=3){let S=c[d]+C,w=c[d+1]+C,R=c[d+2]+C;f[T++]=S,f[T++]=w,f[T++]=R,f[T++]=R+r,f[T++]=w+r,f[T++]=S+r}let A=new lt({attributes:o,indices:f,boundingSphere:re.fromVertices(e),primitiveType:Le.TRIANGLES});if(i.normal&&(A=Fn.computeNormal(A)),i.tangent||i.bitangent){try{A=Fn.computeTangentAndBitangent(A)}catch{Tt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(A.attributes.tangent=void 0),i.bitangent||(A.attributes.bitangent=void 0),i.st||(A.attributes.st=void 0)}return A}function eD(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Vi.ROUNDED,this._vertexFormat=De.clone(e.vertexFormat??De.DEFAULT),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*V.packedLength,this.packedLength=i+te.packedLength+De.packedLength+2}eD.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+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=V.packedLength)V.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Kme=te.clone(te.UNIT_SPHERE),$me=new De,JP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Kme,vertexFormat:$me,cornerType:void 0,granularity:void 0};eD.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=V.packedLength)s[i]=V.unpack(e,t);let a=te.unpack(e,t,Kme);t+=te.packedLength;let c=De.unpack(e,t,$me);t+=De.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=De.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(JP.polylinePositions=r,JP.shapePositions=s,JP.cornerType=u,JP.granularity=f,new eD(JP))};var Nit=new Xe;eD.createGeometry=function(e){let t=e._positions,n=vo(t,h.equalsEpsilon),i=e._shape;if(i=Nm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Ps.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,Nit),r=Nm.computePositions(n,i,o,e,!0);return Lit(r,i,o,e._vertexFormat)};var vU=eD;function Fit(e,t){let n=new pn;n.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=ke.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let _=i*c,m=_+i;for(u=0;u<i;u++)a[f++]=u+_,a[f++]=u+m}return new lt({attributes:n,indices:ke.createTypedArray(o,a),boundingSphere:re.fromVertices(e),primitiveType:Le.LINES})}function nD(e){e=e??G.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Vi.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*V.packedLength,this.packedLength=i+te.packedLength+2}nD.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+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=V.packedLength)V.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Zme=te.clone(te.UNIT_SPHERE),tD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Zme,height:void 0,cornerType:void 0,granularity:void 0};nD.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=V.packedLength)s[i]=V.unpack(e,t);let a=te.unpack(e,t,Zme);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(tD.polylinePositions=r,tD.shapePositions=s,tD.cornerType=c,tD.granularity=u,new nD(tD))};var Bit=new Xe;nD.createGeometry=function(e){let t=e._positions,n=vo(t,h.equalsEpsilon),i=e._shape;if(i=Nm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;li.computeWindingOrder2D(i)===Ps.CLOCKWISE&&i.reverse();let o=Xe.fromPoints(i,Bit),r=Nm.computePositions(n,i,o,e,!1);return Fit(r,i)};var wU=nD;var Qme=new H;function kit(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 Gm(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new kit(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Gm.prototype=Object.create(ai.prototype),Gm.prototype.constructor=Gm);Gm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Qme)),l(c)||(c=H.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Pt({id:t,geometry:new vU(this._options),attributes:i})};Gm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Qme),o=this._distanceDisplayConditionProperty.getValue(e);return new Pt({id:t,geometry:new wU(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};Gm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ai.prototype._isHidden.call(this,e,t)};Gm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Gm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Wt;o.vertexFormat=r?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};Gm.DynamicGeometryUpdater=YE;function YE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(YE.prototype=Object.create(si.prototype),YE.prototype.constructor=YE);YE.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)};YE.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var IU=Gm;var CY=new h,tpe=new h,npe=new h,ipe=new h,ope=new ae,Uit=new V,zit=new re,Vit=new re;function rpe(e,t){let n=new lt({attributes:new pn,primitiveType:Le.TRIANGLES});return n.attributes.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Hit(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=ipe,f=npe,d=tpe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let _=h.fromArray(e,p,CY),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(_,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),Z.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[m]=d.y,r[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return rpe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var AY=new h,spe=new h;function Git(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=ipe,p=npe,_=tpe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,CY),x=h.fromArray(e,(m+6)%i,AY);if(f){let b=h.fromArray(e,(m+3)%i,spe);h.subtract(x,y,x),h.subtract(b,y,b),_=h.normalize(h.cross(b,x,_),_),f=!1}h.equalsEpsilon(x,y,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,_,p),p))),t.normal&&(o[a++]=_.x,o[a++]=_.y,o[a++]=_.z,o[a++]=_.x,o[a++]=_.y,o[a++]=_.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return rpe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function ape(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,_=n.st?new Float32Array(d*2):void 0,m=0,y=0,x=CY,b=Uit,T=Number.MAX_VALUE,C=Number.MAX_VALUE,A=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let v=0;v<r;++v)Js.computePosition(t,i,n.st,E,v,x,b),p[m++]=x.x,p[m++]=x.y,p[m++]=x.z,n.st&&(_[y++]=b.x,_[y++]=b.y,T=Math.min(T,b.x),C=Math.min(C,b.y),A=Math.max(A,b.x),S=Math.max(S,b.y));if(s&&(Js.computePosition(t,i,n.st,0,0,x,b),p[m++]=x.x,p[m++]=x.y,p[m++]=x.z,n.st&&(_[y++]=b.x,_[y++]=b.y,T=b.x,C=b.y,A=b.x,S=b.y)),a&&(Js.computePosition(t,i,n.st,o-1,0,x,b),p[m++]=x.x,p[m++]=x.y,p[m]=x.z,n.st&&(_[y++]=b.x,_[y]=b.y,T=Math.min(T,b.x),C=Math.min(C,b.y),A=Math.max(A,b.x),S=Math.max(S,b.y))),n.st&&(T<0||C<0||A>1||S>1))for(let E=0;E<_.length;E+=2)_[E]=(_[E]-T)/(A-T),_[E+1]=(_[E+1]-C)/(S-C);let w=Hit(p,n,i,t.tangentRotationMatrix),R=6*(r-1)*(f-1);s&&(R+=3*(r-1)),a&&(R+=3*(r-1));let D=ke.createTypedArray(d,R),M=0,L=0,g;for(g=0;g<f-1;++g){for(let E=0;E<r-1;++E){let v=M,I=v+r,N=I+1,F=v+1;D[L++]=v,D[L++]=I,D[L++]=F,D[L++]=F,D[L++]=I,D[L++]=N,++M}++M}if(s||a){let E=d-1,v=d-1;s&&a&&(E=d-2);let I,N;if(M=0,s)for(g=0;g<r-1;g++)I=M,N=I+1,D[L++]=E,D[L++]=I,D[L++]=N,++M;if(a)for(M=(f-1)*r,g=0;g<r-1;g++)I=M,N=I+1,D[L++]=I,D[L++]=v,D[L++]=N,++M}return w.indices=D,n.st&&(w.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:_})),w}function XE(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 KE(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 EY=new De;function jit(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Qe=De.clone(o,EY);Qe.normal=!0,e._vertexFormat=Qe}let d=ape(e,t);n&&(e._vertexFormat=o);let p=li.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let _=p.length,m=_*2,y=new Float64Array(m);y.set(p);let x=li.scaleToGeodeticHeight(d.attributes.position.values,r,a);y.set(x,_),d.attributes.position.values=y;let b=o.normal?new Float32Array(m):void 0,T=o.tangent?new Float32Array(m):void 0,C=o.bitangent?new Float32Array(m):void 0,A=o.st?new Float32Array(m/3*2):void 0,S,w;if(o.normal){for(w=d.attributes.normal.values,b.set(w),f=0;f<_;f++)w[f]=-w[f];b.set(w,_),d.attributes.normal.values=b}if(n){w=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let Qe=new Float32Array(m);for(f=0;f<_;f++)w[f]=-w[f];Qe.set(w,_),d.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:Qe})}let R,D=l(i);if(D){let Qe=_/3*2,hn=new Uint8Array(Qe);i===cn.TOP?hn=hn.fill(1,0,Qe/2):(R=i===cn.NONE?0:1,hn=hn.fill(R)),d.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:hn})}if(o.tangent){let Qe=d.attributes.tangent.values;for(T.set(Qe),f=0;f<_;f++)Qe[f]=-Qe[f];T.set(Qe,_),d.attributes.tangent.values=T}if(o.bitangent){let Qe=d.attributes.bitangent.values;C.set(Qe),C.set(Qe,_),d.attributes.bitangent.values=C}o.st&&(S=d.attributes.st.values,A.set(S),A.set(S,_/3*2),d.attributes.st.values=A);let M=d.indices,L=M.length,g=_/3,E=ke.createTypedArray(m/3,L*2);for(E.set(M),f=0;f<L;f+=3)E[f+L]=M[f+2]+g,E[f+1+L]=M[f+1]+g,E[f+2+L]=M[f]+g;d.indices=E;let v=t.northCap,I=t.southCap,N=c,F=2,U=0,k=4,z=4;v&&(F-=1,N-=1,U+=1,k-=2,z-=1),I&&(F-=1,N-=1,U+=1,k-=2,z-=1),U+=F*u+2*N-k;let B=(U+z)*2,j=new Float64Array(B*3),W=n?new Float32Array(B*3):void 0,J=D?new Uint8Array(B):void 0,Y=o.st?new Float32Array(B*2):void 0,ee=i===cn.TOP;D&&!ee&&(R=i===cn.ALL?1:0,J=J.fill(R));let Q=0,de=0,ge=0,le=0,ye=u*N,be;for(f=0;f<ye;f+=u)be=f*3,j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1);if(I){let Qe=v?ye+1:ye;for(be=Qe*3,f=0;f<2;f++)j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,Qe*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1)}else for(f=ye-u;f<ye;f++)be=f*3,j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1);for(f=ye-1;f>0;f-=u)be=f*3,j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1);if(v){let Qe=ye;for(be=Qe*3,f=0;f<2;f++)j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,Qe*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1)}else for(f=u-1;f>=0;f--)be=f*3,j=XE(j,Q,be,p,x),Q+=6,o.st&&(Y=KE(Y,de,f*2,S),de+=4),n&&(ge+=3,W[ge++]=w[be],W[ge++]=w[be+1],W[ge++]=w[be+2]),ee&&(J[le++]=1,le+=1);let Ie=Git(j,o,a);o.st&&(Ie.attributes.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:Y})),n&&(Ie.attributes.extrudeDirection=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:W})),D&&(Ie.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Te=ke.createTypedArray(B,U*6),ve,Ve,Ke,Ct;_=j.length/3;let Qt=0;for(f=0;f<_-1;f+=2){ve=f,Ct=(ve+2)%_;let Qe=h.fromArray(j,ve*3,AY),hn=h.fromArray(j,Ct*3,spe);h.equalsEpsilon(Qe,hn,P.EPSILON10)||(Ve=(ve+1)%_,Ke=(Ve+2)%_,Te[Qt++]=ve,Te[Qt++]=Ve,Te[Qt++]=Ct,Te[Qt++]=Ct,Te[Qt++]=Ve,Te[Qt++]=Ke)}return Ie.indices=Te,Ie=Fn.combineInstances([new Pt({geometry:d}),new Pt({geometry:Ie})]),Ie[0]}var Wit=[new h,new h,new h,new h],cpe=new fe,qit=new fe;function SY(e,t,n,i,o){if(n===0)return ae.clone(e,o);let r=Js.computeOptions(e,t,n,0,ope,cpe),s=r.height,a=r.width,c=Wit;return Js.computePosition(r,i,!1,0,0,c[0]),Js.computePosition(r,i,!1,0,a-1,c[1]),Js.computePosition(r,i,!1,s-1,0,c[2]),Js.computePosition(r,i,!1,s-1,a-1,c[3]),ae.fromCartesianArray(c,i,o)}function jm(e){e=e??G.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ae.clone(t),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=De.clone(e.vertexFormat??De.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}jm.packedLength=ae.packedLength+te.packedLength+De.packedLength+7;jm.pack=function(e,t,n){return n=n??0,ae.pack(e._rectangle,t,n),n+=ae.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.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 lpe=new ae,upe=te.clone(te.UNIT_SPHERE),n0={rectangle:lpe,ellipsoid:upe,vertexFormat:EY,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};jm.unpack=function(e,t,n){t=t??0;let i=ae.unpack(e,t,lpe);t+=ae.packedLength;let o=te.unpack(e,t,upe);t+=te.packedLength;let r=De.unpack(e,t,EY);t+=De.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=De.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(n0.granularity=s,n0.height=a,n0.rotation=c,n0.stRotation=u,n0.extrudedHeight=f,n0.shadowVolume=d,n0.offsetAttribute=p===-1?void 0:p,new jm(n0))};jm.computeRectangle=function(e,t){e=e??G.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??P.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return SY(n,i,r,o,t)};var Yit=new Z,Jme=new Pe,Xit=new fe;jm.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Js.computeOptions(t,e._granularity,i,o,ope,cpe,qit),a=Yit;if(o!==0||i!==0){let _=ae.center(t,Xit),m=n.geodeticSurfaceNormalCartographic(_,AY);Pe.fromAxisAngle(m,-o,Jme),Z.fromQuaternion(Jme,a)}else Z.clone(Z.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=jit(e,s);let _=re.fromRectangle3D(t,n,c,Vit),m=re.fromRectangle3D(t,n,u,zit);p=re.union(_,m)}else{if(d=ape(e,s),d.attributes.position.values=li.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let _=d.attributes.position.values.length,m=e._offsetAttribute===cn.NONE?0:1,y=new Uint8Array(_/3).fill(m);d.attributes.applyOffset=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=re.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new lt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};jm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new jm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};var epe=new ae,Kit=[new V,new V,new V],$it=new ti,Zit=new fe;function Qit(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ae.clone(e._rectangle,epe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=SY(t,n,o,i,epe),s=Kit;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=ti.fromRotation(e._stRotation,$it),u=ae.center(a,Zit);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,ti.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],_=new Array(6);return V.pack(f,_),V.pack(d,_,2),V.pack(p,_,4),_}Object.defineProperties(jm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=SY(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Qit(this)),this._textureCoordinateRotationPoints}}});var $E=jm;var fpe=new H,dpe=h.ZERO,hpe=new h,mpe=new ae,Jit=new ae,eot=new fe;function tot(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 dh(e,t){jn.call(this,{entity:e,scene:t,geometryOptions:new tot(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(dh.prototype=Object.create(jn.prototype),dh.prototype.constructor=dh);dh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Un.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Wt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,fpe)),l(o)||(o=H.WHITE),i.color=Yt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,dpe,hpe))),new Pt({id:t,geometry:new $E(this._options),attributes:i})};dh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,fpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=ro.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,dpe,hpe))),new Pt({id:t,geometry:new sE(this._options),attributes:r})};dh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Jit);if(!l(n))return;let i=ae.center(n,eot);return fe.toCartesian(i,te.default,t)};dh.prototype._isHidden=function(e,t){return!l(t.coordinates)||ai.prototype._isHidden.call(this,e,t)};dh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Wt)};dh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Wt,i=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,$e.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,$e.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=jn.computeGeometryOffsetAttribute(i,o,r,s),a.height=jn.getGeometryHeight(i,o),r=jn.getGeometryExtrudedHeight(r,s),r===jn.CLAMP_TO_GROUND&&(r=mi.getMinimumMaximumHeights($E.computeRectangle(a,mpe)).minimumTerrainHeight),a.extrudedHeight=r};dh.DynamicGeometryUpdater=ZE;function ZE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(ZE.prototype=Object.create(si.prototype),ZE.prototype.constructor=ZE);ZE.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||si.prototype._isHidden.call(this,e,t,n)};ZE.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,$e.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,$e.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=jn.computeGeometryOffsetAttribute(o,r,s,a),i.height=jn.getGeometryHeight(o,r),s=jn.getGeometryExtrudedHeight(s,a),s===jn.CLAMP_TO_GROUND&&(s=mi.getMinimumMaximumHeights($E.computeRectangle(i,mpe)).minimumTerrainHeight),i.extrudedHeight=s};var PU=dh;var ppe={};function not(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var iot=new fe,oot=new fe;function rot(e,t,n,i){t=vo(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,iot);s&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],_=u[0],m=p===_,y=1;for(let x=1;x<o;++x){let b=t[x],T=e.cartesianToCartographic(b,oot);s&&(T.height=n[x]),m=m&&T.height===0,not(d,T)?d.height<T.height&&(c[y-1]=T.height):(a[y]=b,c[y]=T.height,r?u[y]=i[x]:u[y]=0,m=m&&c[y]===u[y],fe.clone(T,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var sot=new Array(2),aot=new Array(2),cot={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ppe.computePositions=function(e,t,n,i,o,r){let s=rot(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(o,e.maximumRadius),p=cot;if(p.minDistance=d,p.ellipsoid=e,r){let _=0,m;for(m=0;m<a-1;m++)_+=zi.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(_*3),f=new Float64Array(_*3);let y=sot,x=aot;p.positions=y,p.height=x;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],x[0]=n[m],x[1]=n[m+1];let T=zi.generateArc(p);u.set(T,b),x[0]=i[m],x[1]=i[m+1],f.set(zi.generateArc(p),b),b+=T.length}}else p.positions=t,p.height=n,u=new Float64Array(zi.generateArc(p)),p.height=i,f=new Float64Array(zi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var QE=ppe;var vY=new h,DU=new h,lot=new h,_pe=new h,uot=new h,fot=new h,dot=new h;function Vb(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??De.DEFAULT,r=e.granularity??P.RADIANS_PER_DEGREE,s=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=De.clone(o),this._granularity=r,this._ellipsoid=te.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+De.packedLength+1}Vb.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+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n]=e._granularity,t};var gpe=te.clone(te.UNIT_SPHERE),ype=new De,iD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:gpe,vertexFormat:ype,granularity:void 0};Vb.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=te.unpack(e,t,gpe);t+=te.packedLength;let u=De.unpack(e,t,ype);t+=De.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=De.clone(u,n._vertexFormat),n._granularity=f,n):(iD.positions=r,iD.minimumHeights=s,iD.maximumHeights=a,iD.granularity=f,new Vb(iD))};Vb.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Vb(c)};Vb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=QE.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,_=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,x=o.bitangent?new Float32Array(p):void 0,b=o.st?new Float32Array(p/3*2):void 0,T=0,C=0,A=0,S=0,w=0,R=dot,D=fot,M=uot,L=!0;d/=3;let g,E=0,v=1/(d-f-1);for(g=0;g<d;++g){let k=g*3,z=h.fromArray(u,k,vY),B=h.fromArray(c,k,DU);if(o.position&&(_[T++]=B.x,_[T++]=B.y,_[T++]=B.z,_[T++]=z.x,_[T++]=z.y,_[T++]=z.z),o.st&&(b[w++]=E,b[w++]=0,b[w++]=E,b[w++]=1),o.normal||o.tangent||o.bitangent){let j=h.clone(h.ZERO,_pe),W=h.subtract(z,s.geodeticSurfaceNormal(z,DU),DU);if(g+1<d&&(j=h.fromArray(u,k+3,_pe)),L){let J=h.subtract(j,z,lot),Y=h.subtract(W,z,vY);R=h.normalize(h.cross(Y,J,R),R),L=!1}h.equalsEpsilon(z,j,P.EPSILON10)?L=!0:(E+=v,o.tangent&&(D=h.normalize(h.subtract(j,z,D),D)),o.bitangent&&(M=h.normalize(h.cross(R,D,M),M))),o.normal&&(m[C++]=R.x,m[C++]=R.y,m[C++]=R.z,m[C++]=R.x,m[C++]=R.y,m[C++]=R.z),o.tangent&&(y[S++]=D.x,y[S++]=D.y,y[S++]=D.z,y[S++]=D.x,y[S++]=D.y,y[S++]=D.z),o.bitangent&&(x[A++]=M.x,x[A++]=M.y,x[A++]=M.z,x[A++]=M.x,x[A++]=M.y,x[A++]=M.z)}}let I=new pn;o.position&&(I.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:_})),o.normal&&(I.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:x})),o.st&&(I.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:b}));let N=p/3;p-=6*(f+1);let F=ke.createTypedArray(N,p),U=0;for(g=0;g<N-2;g+=2){let k=g,z=g+2,B=h.fromArray(_,k*3,vY),j=h.fromArray(_,z*3,DU);if(h.equalsEpsilon(B,j,P.EPSILON10))continue;let W=g+1,J=g+3;F[U++]=W,F[U++]=k,F[U++]=J,F[U++]=J,F[U++]=k,F[U++]=z}return new lt({attributes:I,indices:F,primitiveType:Le.TRIANGLES,boundingSphere:new re.fromVertices(_)})};var RU=Vb;var xpe=new h,bpe=new h;function Hb(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??P.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+1}Hb.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+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var Tpe=te.clone(te.UNIT_SPHERE),oD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Tpe,granularity:void 0};Hb.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=te.unpack(e,t,Tpe);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):(oD.positions=r,oD.minimumHeights=s,oD.maximumHeights=a,oD.granularity=u,new Hb(oD))};Hb.fromConstantHeights=function(e){e=e??G.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Hb(c)};Hb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=QE.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let _;for(_=0;_<u;++_){let T=_*3,C=h.fromArray(c,T,xpe),A=h.fromArray(a,T,bpe);d[p++]=A.x,d[p++]=A.y,d[p++]=A.z,d[p++]=C.x,d[p++]=C.y,d[p++]=C.z}let m=new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let x=ke.createTypedArray(y,f),b=0;for(_=0;_<y-2;_+=2){let T=_,C=_+2,A=h.fromArray(d,T*3,xpe),S=h.fromArray(d,C*3,bpe);if(h.equalsEpsilon(A,S,P.EPSILON10))continue;let w=_+1,R=_+3;x[b++]=w,x[b++]=T,x[b++]=w,x[b++]=R,x[b++]=T,x[b++]=C}return x[b++]=y-2,x[b++]=y-1,new lt({attributes:m,indices:x,primitiveType:Le.LINES,boundingSphere:new re.fromVertices(d)})};var OU=Hb;var Cpe=new H;function hot(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 hh(e,t){ai.call(this,{entity:e,scene:t,geometryOptions:new hot(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(hh.prototype=Object.create(ai.prototype),hh.prototype.constructor=hh);hh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Un.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Wt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Cpe)),l(c)||(c=H.WHITE),o=Yt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Pt({id:t,geometry:new RU(this._options),attributes:i})};hh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Cpe),o=this._distanceDisplayConditionProperty.getValue(e);return new Pt({id:t,geometry:new OU(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Un.fromDistanceDisplayCondition(o)}})};hh.prototype._isHidden=function(e,t){return!l(t.positions)||ai.prototype._isHidden.call(this,e,t)};hh.prototype._getIsClosed=function(e){return!1};hh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};hh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Wt,s=this._options;s.vertexFormat=r?un.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};hh.DynamicGeometryUpdater=JE;function JE(e,t,n){si.call(this,e,t,n)}l(Object.create)&&(JE.prototype=Object.create(si.prototype),JE.prototype.constructor=JE);JE.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||si.prototype._isHidden.call(this,e,t,n)};JE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var MU=hh;var Gb=[EF,qk,kk,mU,pU,TU,SU,IU,PU,MU];function jb(e,t){this.entity=e,this.scene=t;let n=new Array(Gb.length),i=new me,o=new wr;for(let r=0;r<n.length;r++){let s=new Gb[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(jb.prototype._onEntityPropertyChanged,this)}jb.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)};jb.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};jb.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ce(this)};jb.registerUpdater=function(e){Gb.includes(e)||Gb.push(e)};jb.unregisterUpdater=function(e){if(Gb.includes(e)){let t=Gb.indexOf(e);Gb.splice(t,1)}};var eS=jb;var Ape=new H,mot=new Mt,pot=new Mt,_ot=h.ZERO,got=new h;function mh(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(mh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}mh.prototype.onMaterialChanged=function(){this.invalidated=!0};mh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};mh.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};mh.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};mh.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=dr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Dn({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 Wt)&&(this.depthFailMaterial=dr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=X.getValueOrDefault(x,e,H.WHITE,Ape);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Yt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Wt&&(!u.depthFailMaterialProperty.isConstant||c)){let x=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(x,e,H.WHITE,Ape);H.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=H.clone(b,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let x=X.getValueOrDefault(m,e,pot,mot);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(x,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let x=X.getValueOrDefault(y,e,_ot,got);h.equals(x,d._lastOffset)||(d._lastOffset=h.clone(x,d._lastOffset),d.offset=ro.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};mh.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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};mh.prototype.contains=function(e){return this.updaters.contains(e.id)};mh.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)};mh.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 tS(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}tS.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 mh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Epe(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}tS.prototype.remove=function(e){Epe(this._solidItems,e)||Epe(this._translucentItems,e)};function Spe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function LU(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}tS.prototype.update=function(e){let t=LU(this,this._solidItems,e,!0);t=LU(this,this._translucentItems,e,t)&&t;let n=Spe(this,this._solidItems,e),i=Spe(this,this._translucentItems,e);return(n||i)&&(t=LU(this,this._solidItems,e,t)&&t,t=LU(this,this._translucentItems,e,t)&&t),t};function vpe(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}tS.prototype.getBoundingSphere=function(e,t){let n=vpe(this._solidItems,e,t);return n===ut.FAILED?vpe(this._translucentItems,e,t):n};function wpe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}tS.prototype.removeAllPrimitives=function(){wpe(this._solidItems),wpe(this._translucentItems)};var ph=tS;var yot=new Mt,xot=new Mt,bot=h.ZERO,Tot=new h;function _h(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(_h.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It}_h.prototype.onMaterialChanged=function(){this.invalidated=!0};_h.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};_h.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.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};_h.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 Cot=new H;_h.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=dr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=dr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Dn({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=dr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Wt)&&(this.depthFailMaterial=dr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Wt&&!c.depthFailMaterialProperty.isConstant){let x=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(x,e,H.WHITE,Cot);H.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=H.clone(b,d._lastDepthFailColor),d.depthFailColor=Yt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let x=X.getValueOrDefault(m,e,xot,yot);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(x,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let x=X.getValueOrDefault(y,e,bot,Tot);h.equals(x,d._lastOffset)||(d._lastOffset=h.clone(x,d._lastOffset),d.offset=ro.toValue(x,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};_h.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};_h.prototype.contains=function(e){return this.updaters.contains(e.id)};_h.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)};_h.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 nS(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}nS.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 _h(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};nS.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}}};nS.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};nS.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};nS.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 gh=nS;var Ppe=$r(Ipe(),1);function NU(){this._tree=new Ppe.default}function Wb(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Wb.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};NU.prototype.insert=function(e,t){let n=Wb.fromRectangleAndId(e,t,new Wb);this._tree.insert(n)};function Aot(e,t){return e.id===t.id}var Eot=new Wb;NU.prototype.remove=function(e,t){let n=Wb.fromRectangleAndId(e,t,Eot);this._tree.remove(n,Aot)};var Sot=new Wb;NU.prototype.collides=function(e){let t=Wb.fromRectangleAndId("",e,Sot);return this._tree.collides(t)};var iS=NU;var vot=new H,wot=new Mt,Iot=new Mt;function B_(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 iS}B_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};B_.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||!X.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)}))}};B_.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};B_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Bl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,x=X.getValueOrDefault(y,e,H.WHITE,vot);H.equals(d._lastColor,x)||(d._lastColor=H.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Iot,wot);Mt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};B_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};B_.prototype.contains=function(e){return this.updaters.contains(e.id)};B_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ut.DONE):ut.FAILED};B_.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 oS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}oS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=X.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 B_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};oS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};oS.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};oS.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};oS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var rD=oS;var Pot=new Mt,Dot=new Mt;function cd(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(cd.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new iS}cd.prototype.onMaterialChanged=function(){this.invalidated=!0};cd.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};cd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};cd.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||!X.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};cd.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};cd.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=dr.getValue(e,this.materialProperty,this.material),n=new Bl({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=dr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Dot,Pot);Mt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};cd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};cd.prototype.contains=function(e){return this.updaters.contains(e.id)};cd.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)};cd.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 rS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}rS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=wf.shouldUseSphericalCoordinates(o.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new cd(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};rS.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}}};rS.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};rS.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};rS.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 FU=rS;var Rot=new H,Oot=new Mt,Mot=new Mt,Lot=h.ZERO,Not=new h;function k_(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}k_.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};k_.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};k_.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 Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new un({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let x=u.outlineColorProperty,b=X.getValueOrDefault(x,e,H.WHITE,Rot);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Yt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let x=X.getValueOrDefault(m,e,Mot,Oot);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(x,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let x=X.getValueOrDefault(y,e,Lot,Not);h.equals(x,d._lastOffset)||(d._lastOffset=h.clone(x,d._lastOffset),d.offset=ro.toValue(x,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};k_.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=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};k_.prototype.contains=function(e){return this.updaters.contains(e.id)};k_.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)};k_.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 sS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new It,this._translucentBatches=new It}sS.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 k_(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 k_(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};sS.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};sS.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};sS.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};sS.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 sD=sS;var Fot=[];function tu(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=Tn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=hr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new sD(n,e,s,!1),this._outlineBatches[o+s]=new sD(n,e,s,!0),this._closedColorBatches[s]=new ph(n,un,void 0,!0,s,!0),this._closedColorBatches[o+s]=new ph(n,un,void 0,!0,s,!1),this._closedMaterialBatches[s]=new gh(n,mo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new gh(n,mo,void 0,!0,s,!1),this._openColorBatches[s]=new ph(n,un,void 0,!1,s,!0),this._openColorBatches[o+s]=new ph(n,un,void 0,!1,s,!1),this._openMaterialBatches[s]=new gh(n,mo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new gh(n,mo,void 0,!1,s,!1);let a=zn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new FU(i,s,mo)),c[s]=new rD(i,s);else for(s=0;s<a;++s)c[s]=new rD(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new kE(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(tu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Fot)}tu.registerUpdater=function(e){eS.registerUpdater(e)};tu.unregisterUpdater=function(e){eS.unregisterUpdater(e)};tu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new eS(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(tu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,_=this._batches,m=_.length;for(a=0;a<m;a++)p=_[a].update(e)&&p;return p};var Bot=[],kot=new re;tu.prototype.getBoundingSphere=function(e,t){let n=Bot,i=kot,o=0,r=ut.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(d,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=re.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,re.fromBoundingSpheres(n,t),ut.DONE)};tu.prototype.isDestroyed=function(){return!1};tu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(tu.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(),ce(this)};tu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};tu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Tn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Wt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Wt?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 Wt?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)};tu._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)};tu.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 BU=tu;var Uot=1,zot="30px sans-serif",Vot=tr.FILL,Hot=H.WHITE,Got=H.BLACK,jot=1,Wot=!1,qot=new H(.165,.165,.165,.8),Yot=new V(7,5),Xot=V.ZERO,Kot=h.ZERO,$ot=$e.NONE,Zot=Ei.CENTER,Qot=Bn.CENTER,Jot=new h,ert=new H,trt=new H,nrt=new H,irt=new V,ort=new h,rrt=new V,srt=new Vt,art=new Vt,crt=new Vt,lrt=new Mt;function Dpe(e){this.entity=e,this.label=void 0,this.index=void 0}function i0(e,t){t.collectionChanged.addEventListener(i0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}i0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,Jot),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){PY(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,_=X.getValueOrDefault(a._heightReference,e,$ot);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=h.equals(u.position,d)&&u.heightReference===_),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,Uot),u.font=X.getValueOrDefault(a._font,e,zot),u.style=X.getValueOrDefault(a._style,e,Vot),u.fillColor=X.getValueOrDefault(a._fillColor,e,Hot,ert),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,Got,trt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,jot),u.showBackground=X.getValueOrDefault(a._showBackground,e,Wot),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,qot,nrt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,Yot,irt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Xot,rrt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Kot,ort),u.heightReference=_,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Zot),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Qot),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,srt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,art),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,crt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,lrt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};i0.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=h.clone(i._clampedPosition??i.position,t.center),t.radius=0,ut.DONE};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(i0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ce(this)};i0.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 Dpe(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 Dpe(r)):(PY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],PY(s.get(r.id),r,a),s.remove(r.id)};function PY(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var kU=i0;var urt=1,frt=!0,drt=0,hrt=!0,mrt=!0,prt=Tn.ENABLED,_rt=$e.NONE,grt=H.RED,yrt=0,xrt=H.WHITE,brt=il.HIGHLIGHT,Trt=.5,Crt=new V(1,1),Rpe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Art=new O,Ert=new O,Ope=new H,Mpe=new Array(4),Srt=new h;function o0(e,t){t.collectionChanged.addEventListener(o0.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 vrt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await wm.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}}o0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,Art),c=Ee.createIfNeeded(X.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Rpe}},n[s.id]=u;let m=X.getValueOrDefault(a._incrementallyLoadTextures,e,hrt),y=X.getValueOrDefault(a._environmentMapOptions,e,Rpe,u.environmentMapOptionsScratch);vrt(this,s,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(a._scale,e,urt),p.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,frt),p.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,drt),p.maximumScale=X.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=O.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(a._shadows,e,prt),p.heightReference=X.getValueOrDefault(a._heightReference,e,_rt),p.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,grt,Ope),p.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,yrt),p.color=X.getValueOrDefault(a._color,e,xrt,Ope),p.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,brt),p.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,Trt),p.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,mrt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,Crt);let _=X.getValueOrUndefined(a._lightColor,e);if(l(_)&&(H.pack(_,Mpe,0),_=h.unpack(Mpe,0,Srt)),p.lightColor=_,p.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:vu.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(y)){let T=Object.keys(y);for(let C=0,A=T.length;C<A;++C){let S=T[C],w=y[S];if(!l(w))continue;let R=p.getNode(S);if(!l(R))continue;let D=O.fromTranslationRotationScale(w,Ert);R.matrix=O.multiply(R.originalMatrix,D,D)}}let x=!1,b=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(b)){let T=Object.keys(b);for(let C=0,A=T.length;C<A;++C){let S=T[C],w=b[S];l(w)&&(x=!0,p.setArticulationStage(S,w))}}x&&p.applyArticulations()}}return!0};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(o0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)DY(this,e[i],t,n);return ce(this)};var UU=new h,wrt=new fe;o0.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??te.default;if(i.heightReference!==$e.NONE){let a=i.modelMatrix;UU.x=a[12],UU.y=a[13],UU.z=a[14];let c=r.cartesianToCartographic(UU,wrt),u=o.getHeight(c,i.heightReference);return l(u)&&(Sf(i.heightReference)?c.height=u:c.height+=u),re.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ut.DONE}return re.clone(i.boundingSphere,t),ut.DONE};o0.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)?(Irt(r,a),s.set(r.id,r)):(DY(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],DY(this,r,a,c),s.remove(r.id)};function DY(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Irt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var zU=o0;function r0(e){this._definitionChanged=new me,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(r0.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Wi.FIXED}}});var Prt=new $;r0.prototype.getValue=function(e,t){return l(e)||(e=$.now(Prt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};r0.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))};r0.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};r0.prototype.equals=function(e){return this===e||e instanceof r0&&this._value===e._value};r0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var U_=r0;var Drt=60,Rrt=1,Npe=new Sn,RY=new Sn,OY=new Sn;function Lpe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Ort(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||$.lessThanOrEquals(o,t)||$.greaterThanOrEquals(o,n),p=0,_=i.length,m=i[p],y=n,x=!1,b,T,C;for(;p<_;){if(!d&&$.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),d=!0),$.greaterThan(m,t)&&$.lessThan(m,y)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<_-1){if(s>0&&!x){let A=i[p+1],S=$.secondsDifference(A,m);x=S>s,x&&(b=Math.ceil(S/s),T=0,C=S/Math.max(b,2),b=Math.max(b-1,1))}if(x&&T<b){m=$.addSeconds(m,C,new $),T++;continue}}x=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function Mrt(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=!l(i)||$.lessThanOrEquals(i,t)||$.greaterThanOrEquals(i,n);for(;$.lessThan(d,n);)!p&&$.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=$.addSeconds(t,r*u,new $);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Lrt(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=Math.max(r,60),_=!l(i)||$.lessThanOrEquals(i,t)||$.greaterThanOrEquals(i,n);for(;$.lessThan(d,n);)!_&&$.greaterThanOrEquals(d,i)&&(_=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=$.addSeconds(t,p*u,new $);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Nrt(e,t,n,i,o,r,s,a){OY.start=t,OY.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Sn.intersect(d,OY,Npe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=$.addSeconds(d.start,$.secondsDifference(d.stop,d.start)/2,new $));let _=e.getValueInReferenceFrame(p,o,a[c]);l(_)&&(a[c]=_,c++)}}return c}function Frt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Brt(e,t,n,i,o,r,s,a){RY.start=t,RY.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Sn.intersect(d,RY,Npe).isEmpty){let p=d.start,_=d.stop,m=t;$.greaterThan(p,m)&&(m=p);let y=n;$.lessThan(_,y)&&(y=_),c=Fpe(d.data,m,y,i,o,r,c,a)}}return c}function Fpe(e,t,n,i,o,r,s,a){for(;e instanceof Xy;)e=e.resolvedProperty;if(e instanceof ja){let c=e._property._times;s=Ort(e,t,n,c,i,o,r,s,a)}else e instanceof SF?s=Mrt(e,t,n,i,o,r,s,a):e instanceof Ga?s=Brt(e,t,n,i,o,r,s,a):e instanceof $y?s=Nrt(e,t,n,i,o,r,s,a):e instanceof kl||e instanceof U_&&X.isConstant(e)?s=Frt(e,t,n,i,o,r,s,a):s=Lrt(e,t,n,i,o,r,s,a);return s}function Bpe(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Fpe(e,t,n,i,o,r,0,s);return s.length=a,s}var krt=new Z;function aD(e,t){this._unusedIndexes=[],this._polylineCollection=new Rm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}aD.prototype.update=function(e){if(this._referenceFrame===Wi.INERTIAL){let t=Et.computeIcrfToCentralBodyFixedMatrix(e,krt);O.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};aD.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=X.getValueOrUndefined(i._leadTime,e),p=X.getValueOrUndefined(i._trailTime,e),_=n._availability,m=l(_),y=l(d),x=l(p);if(u=m||y&&x,u){if(x&&(r=$.addSeconds(e,-p,new $)),y&&(s=$.addSeconds(e,d,new $)),m){let b=_.start,T=_.stop;(!x||$.greaterThan(b,r))&&(r=b),(!y||$.lessThan(T,s))&&(s=T)}u=$.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let _=d.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,Drt);c.show=!0,c.positions=Bpe(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=dr.getValue(e,i._material,c.material),c.width=X.getValueOrDefault(i._width,e,Rrt),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};aD.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)};aD.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ce(this)};function s0(e,t){t.collectionChanged.addEventListener(s0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}s0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=Wi.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new aD(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};s0.prototype.isDestroyed=function(){return!1};s0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(s0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ce(this)};s0.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 Lpe(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 Lpe(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))};s0._subSample=Bpe;var VU=s0;var kpe=H.WHITE,Upe=H.BLACK,zpe=0,Vpe=1,Hpe=0,Gpe=Jr.NONE,jpe=new H,Urt=new h,Wpe=new H,qpe=new Vt,Ype=new Vt,Xpe=new Mt;function Kpe(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 a0(e,t){t.collectionChanged.addEventListener(a0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new It,this._onCollectionChanged(t,t.values,[],[])}a0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=X.getValueOrDefault(a._heightReference,e,$e.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,Urt),d=l(p)),!d){cD(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let _=!1,m=!1;if(f!==$e.NONE&&!l(u)?(l(c)&&(cD(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,_=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===$e.NONE&&!l(c)&&(l(u)&&(cD(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,qpe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ype),c.color=X.getValueOrDefault(a._color,e,kpe,jpe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,Upe,Wpe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,zpe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,Vpe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Xpe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Hpe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,Gpe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,qpe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ype),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Xpe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Hpe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,Gpe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,kpe,jpe),x=X.getValueOrDefault(a._outlineColor,e,Upe,Wpe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,zpe)),T=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,Vpe)));if(b>0?(u.scale=1,_=_||b!==r.outlineWidth||T!==r.pixelSize||!H.equals(y,r.color)||!H.equals(x,r.outlineColor)):(u.scale=T/50,T=50,_=_||b!==r.outlineWidth||!H.equals(y,r.color)||!H.equals(x,r.outlineColor)),_){r.color=H.clone(y,r.color),r.outlineColor=H.clone(x,r.outlineColor),r.pixelSize=T,r.outlineWidth=b;let C=y.alpha,A=y.toCssColorString(),S=x.toCssColorString(),w=JSON.stringify([A,T,S,b]);u.setImage(w,KA(C,A,S,b,T))}m&&u._updateClamping()}}return!0};a0.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=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(a0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ce(this)};a0.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 Kpe(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 Kpe(r)):(cD(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],cD(s.get(r.id),r,a),s.remove(r.id)};function cD(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 HU=a0;var e_e=[];function zrt(e,t,n,i,o){let r=e_e;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,_=i.blue,m=i.alpha;if(H.equals(n,i)){for(s=0;s<o;s++)r[s]=H.clone(n);return r}let y=(d-a)/o,x=(p-c)/o,b=(_-u)/o,T=(m-f)/o;for(s=0;s<o;s++)r[s]=new H(a+s*y,c+s*x,u+s*b,f+s*T);return r}function lD(e){e=e??G.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=De.clone(e.vertexFormat??De.DEFAULT),this._arcType=e.arcType??nn.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*H.packedLength:1,this.packedLength=r+te.packedLength+De.packedLength+4}lD.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+=h.packedLength)h.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+=H.packedLength)H.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var t_e=te.clone(te.UNIT_SPHERE),n_e=new De,qb={positions:void 0,colors:void 0,ellipsoid:t_e,vertexFormat:n_e,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};lD.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=te.unpack(e,t,t_e);t+=te.packedLength;let c=De.unpack(e,t,n_e);t+=De.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=te.clone(a,n._ellipsoid),n._vertexFormat=De.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(qb.positions=r,qb.colors=s,qb.width=u,qb.colorsPerVertex=f,qb.arcType=d,qb.granularity=p,new lD(qb))};var $pe=new h,Zpe=new h,Qpe=new h,Jpe=new h;lD.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=vo(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let N=0,F=d[0];i=i.filter(function(U,k){let z=!1;return o?z=k===F||k===0&&F===1:z=k+1===F,z?(N++,F=d[N],!1):!0})}let _=p.length;if(_<2||t<=0)return;if(r===nn.GEODESIC||r===nn.RHUMB){let N,F;r===nn.GEODESIC?(N=P.chordLength(s,a.maximumRadius),F=zi.numberOfPoints):(N=s,F=zi.numberOfPointsRhumbLine);let U=zi.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c<_-1;++c)k+=F(p[c],p[c+1],N);let z=new Array(k),B=0;for(c=0;c<_-1;++c){let j=p[c],W=p[c+1],J=i[c],Y=F(j,W,N);if(o&&c<k){let ee=i[c+1],Q=zrt(j,W,J,ee,Y),de=Q.length;for(u=0;u<de;++u)z[B++]=Q[u]}else for(u=0;u<Y;++u)z[B++]=H.clone(J)}z[B]=H.clone(i[i.length-1]),i=z,e_e.length=0}r===nn.GEODESIC?p=zi.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:U}):p=zi.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:U})}_=p.length;let m=_*4-4,y=new Float64Array(m*3),x=new Float64Array(m*3),b=new Float64Array(m*3),T=new Float32Array(m*2),C=n.st?new Float32Array(m*2):void 0,A=l(i)?new Uint8Array(m*4):void 0,S=0,w=0,R=0,D=0,M;for(u=0;u<_;++u){u===0?(M=$pe,h.subtract(p[0],p[1],M),h.add(p[0],M,M)):M=p[u-1],h.clone(M,Qpe),h.clone(p[u],Zpe),u===_-1?(M=$pe,h.subtract(p[_-1],p[_-2],M),h.add(p[_-1],M,M)):M=p[u+1],h.clone(M,Jpe);let N,F;l(A)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==_-1&&(F=i[u]));let U=u===0?2:0,k=u===_-1?2:4;for(f=U;f<k;++f){h.pack(Zpe,y,S),h.pack(Qpe,x,S),h.pack(Jpe,b,S),S+=3;let z=f-2<0?-1:1;if(T[w++]=2*(f%2)-1,T[w++]=z*t,n.st&&(C[R++]=u/(_-1),C[R++]=Math.max(T[w-2],0)),l(A)){let B=f<2?N:F;A[D++]=H.floatToByte(B.red),A[D++]=H.floatToByte(B.green),A[D++]=H.floatToByte(B.blue),A[D++]=H.floatToByte(B.alpha)}}}let L=new pn;L.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:x}),L.nextPosition=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:T}),n.st&&(L.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:C})),l(A)&&(L.color=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));let g=ke.createTypedArray(m,_*6-6),E=0,v=0,I=_-1;for(u=0;u<I;++u)g[v++]=E,g[v++]=E+2,g[v++]=E+1,g[v++]=E+1,g[v++]=E+2,g[v++]=E+3,E+=4;return new lt({attributes:L,indices:g,primitiveType:Le.TRIANGLES,boundingSphere:re.fromPoints(p),geometryType:Od.POLYLINES})};var c0=lD;var Vrt=new Qn(0),GU={},i_e=new H,Hrt=new Wt(H.WHITE),Grt=new Qn(!0),jrt=new Qn(Tn.DISABLED),Wrt=new Qn(new Mt),qrt=new Qn(zn.BOTH);function Yrt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Xrt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function yh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(yh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new me,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 Yrt,this._groundGeometryOptions=new Xrt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=hr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(yh.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)&&X.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}}});yh.prototype.isOutlineVisible=function(e){return!1};yh.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};yh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Un.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Wt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,i_e)),l(a)||(a=H.WHITE),s.color=Yt.fromColor(a)),this.clampToGround?new Pt({id:t,geometry:new WC(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Wt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,i_e)),l(a)||(a=H.WHITE),s.depthFailColor=Yt.fromColor(a)),new Pt({id:t,geometry:new c0(this._geometryOptions),attributes:s}))};yh.prototype.createOutlineGeometryInstance=function(e){};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){this._entitySubscription(),ce(this)};yh.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(Ge.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??Hrt,u=c instanceof Wt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??Grt,this._shadowsProperty=o.shadows??jrt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Wrt,this._classificationTypeProperty=o.classificationType??qrt,this._fillEnabled=!0,this._zIndex=a??Vrt;let f=o.width,d=o.arcType,p=o.clampToGround,_=o.granularity;if(!r.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(_)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=r.getValue(Ge.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Wt)?x=ds.VERTEX_FORMAT:x=Ua.VERTEX_FORMAT,m.vertexFormat=x,m.positions=y,m.width=l(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(Ge.MINIMUM_VALUE):void 0,m.granularity=l(_)?_.getValue(Ge.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Tt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};yh.prototype.createDynamicUpdater=function(e,t){return new uD(e,t,this)};var aS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function uD(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 o_e(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=GU[n];!l(i)||i.isDestroyed()?(i=new Rm,GU[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}uD.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=X.getValueOrUndefined(o,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,nn.GEODESIC),t._groundGeometryOptions.granularity=X.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)||!X.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Wt)p=new ds;else{let _=dr.getValue(e,d,this._material);p=new Ua({material:_,translucent:_.isTranslucent()}),this._material=_}this._groundPolylinePrimitive=s.add(new sm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=o_e(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=nn.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==nn.NONE&&l(u)&&(aS.ellipsoid=f,aS.positions=r,aS.granularity=X.getValueOrUndefined(i._granularity,e),aS.height=zi.extractHeights(r,f),c===nn.GEODESIC?r=zi.generateCartesianArc(aS):r=zi.generateCartesianRhumbArc(aS)),a.show=!0,a.positions=r.slice(),a.material=dr.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};uD.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 re.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=o_e(this);if(t.show&&t.positions.length>0)return re.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};uD.prototype.isDestroyed=function(){return!1};uD.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=GU[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete GU[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ce(this)};var jU=yh;var Krt=new H,$rt=new Mt,Zrt=new Mt;function xh(e,t,n,i,o){let r;n instanceof Wt?r=ds:r=Ua,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(xh.prototype.onMaterialChanged,this),this.subscriptions=new It,this.showsUpdated=new It,this.zIndex=i,this._asynchronous=o}xh.prototype.onMaterialChanged=function(){this.invalidated=!0};xh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Wt&&t instanceof Wt?!0:l(t)&&t.equals(n)};xh.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||!X.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};xh.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};xh.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 sm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ua&&(this.material=dr.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===Ua&&(this.material=dr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,x=X.getValueOrDefault(y,e,H.WHITE,Krt);H.equals(d._lastColor,x)||(d._lastColor=H.clone(x,d._lastColor),d.color=Yt.toValue(x,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=d.show[0]===1;p!==_&&(d.show=bn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Zrt,$rt);Mt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Un.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};xh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=bn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};xh.prototype.contains=function(e){return this.updaters.contains(e.id)};xh.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)};xh.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 cS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}cS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=X.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 xh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};cS.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}}};cS.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};cS.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};cS.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 WU=cS;var Qrt=[];function r_e(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function s_e(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 Wt?1:2);let r;l(i)&&(r=i+o*Tn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Wt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Wm(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=Tn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new ph(n,ds,void 0,!1,o),this._materialBatches[o]=new gh(n,Ua,void 0,!1,o),this._colorBatches[o+r]=new ph(n,ds,ds,!1,o),this._materialBatches[o+r]=new gh(n,Ua,ds,!1,o),this._colorBatches[o+r*2]=new ph(n,ds,Ua,!1,o),this._materialBatches[o+r*2]=new gh(n,Ua,Ua,!1,o);this._dynamicBatch=new kE(n,i);let s=zn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new WU(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(Wm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Qrt)}Wm.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(r_e(this,f),s_e(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),r_e(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new jU(c,this._scene),this._updaters.set(u,f),s_e(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Wm._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,_=p.length;for(a=0;a<_;a++)d=p[a].update(e)&&d;return d};var Jrt=[],est=new re;Wm.prototype.getBoundingSphere=function(e,t){let n=Jrt,i=est,o=0,r=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=re.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,re.fromBoundingSpheres(n,t),ut.DONE)};Wm.prototype.isDestroyed=function(){return!1};Wm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Wm.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(),ce(this)};Wm._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)};Wm.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 qU=Wm;function nu(e){Bl.initializeTerrainHeights(),sm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new wr,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??nu.defaultVisualizersCallback;let i=!1,o=new Jl,r=new Jl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new Gk;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var lS=[];nu.registerVisualizer=function(e){lS.includes(e)||lS.push(e)};nu.unregisterVisualizer=function(e){if(lS.includes(e)){let t=lS.indexOf(e);lS.splice(t,1)}};nu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new IN(t,i),new BU(e,i,n._primitives,n._groundPrimitives),new kU(t,i),new zU(e,i),new Ik(e,i),new HU(t,i),new VU(e,i),new qU(e,i,n._primitives,n._groundPrimitives),...lS.map(o=>new o(e,i))]};Object.defineProperties(nu.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}}});nu.prototype.isDestroyed=function(){return!1};nu.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)),ce(this)};nu.prototype.update=function(e){if(!mi.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};nu.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 tst=[],nst=new re;nu.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 _=p.get(i);if(_.entities.contains(e)){r=_;break}}}if(!l(r))return ut.FAILED;let s=tst,a=nst,c=0,u=ut.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ut.PENDING)return ut.PENDING;u===ut.DONE&&(s[c]=re.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,re.fromBoundingSpheres(s,n),ut.DONE)};nu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Jl),s=o.add(new aU);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};nu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};nu.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 YU=nu;function MY(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}MY.clone=function(e,t){if(l(e))return l(t)||(t=new MY),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var bh=MY;var a_e=new Z,c_e=new Z,l_e=new Z,ist=new O,XU=new h,u_e=new h,LY=new h,NY=new h,f_e=new h,d_e=new h,ost=new Pe,rst=new h,sst=new Z,uS=new $,ast=1.25;function cst(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,d=o.getValue(c,e._lastCartesian);if(l(d)){let p=!1,_=!1,m,y,x;if(f===ne.SCENE3D){$.addSeconds(c,.001,uS);let R=o.getValue(uS,XU);if(l(R)||($.addSeconds(c,-.001,uS),R=o.getValue(uS,XU),_=!0),l(R)){let D=Et.computeFixedToIcrfMatrix(c,a_e),M=Et.computeFixedToIcrfMatrix(uS,c_e),L;!l(D)||!l(M)?(L=Et.computeTemeToPseudoFixedMatrix(c,l_e),D=Z.transpose(L,a_e),M=Et.computeTemeToPseudoFixedMatrix(uS,c_e),Z.transpose(M,M)):L=Z.transpose(D,l_e);let g=Z.multiplyByVector(D,d,f_e),E=Z.multiplyByVector(M,R,d_e);h.subtract(g,E,NY);let v=h.magnitude(NY)*1e3,I=P.GRAVITATIONALPARAMETER,N=-I/(v*v-2*I/h.magnitude(g));N<0||N>ast*u.maximumRadius?(m=u_e,h.normalize(d,m),h.negate(m,m),x=h.clone(h.UNIT_Z,LY),y=h.cross(x,m,XU),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),x=h.cross(m,y,LY),h.normalize(x,x),p=!0)):h.equalsEpsilon(d,R,P.EPSILON7)||(x=u_e,h.normalize(g,x),h.normalize(E,E),y=h.cross(x,E,LY),_&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,x,XU),Z.multiplyByVector(L,m,m),Z.multiplyByVector(L,y,y),Z.multiplyByVector(L,x,x),h.normalize(m,m),h.normalize(y,y),h.normalize(x,x),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,T,C;i&&(b=h.clone(t.position,NY),T=h.clone(t.direction,f_e),C=h.clone(t.up,d_e));let A=ist,S;l(s)&&(S=s.getValue(c,ost));let w=r.getValue(c,rst);if(a===Og.INERTIAL&&l(S))O.fromTranslationQuaternionRotationScale(d,S,h.ONE,A);else if(a===Og.VELOCITY&&l(w)){let R=Et.rotationMatrixFromPositionVelocity(d,w,u,sst);O.fromRotationTranslation(R,d,A)}else a===Og.ENU||!p?Et.eastNorthUpToFixedFrame(d,u,A):(A[0]=m.x,A[1]=m.y,A[2]=m.z,A[3]=0,A[4]=y.x,A[5]=y.y,A[6]=y.z,A[7]=0,A[8]=x.x,A[9]=x.y,A[10]=x.z,A[11]=0,A[12]=d.x,A[13]=d.y,A[14]=d.z,A[15]=0);t._setTransform(A),i&&(h.clone(b,t.position),h.clone(T,t.direction),h.clone(C,t.up),h.cross(T,C,t.right))}if(n){let p=f===ne.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function fD(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Qy(e.position,!0),this._offset3D=new h}Object.defineProperties(fD,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});fD.defaultOffset3D=new h(-14e3,3500,3500);var KU=new bh,lst=new h;fD.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,d=o!==this._mode,p=n.camera,_=f||d,m=!0;if(f){let y=r.viewFrom,x=l(y);if(!x&&l(t)){KU.pitch=-P.PI_OVER_FOUR,KU.range=0;let b=a.getValue(e,lst);if(l(b)){let T=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);KU.pitch*=T}p.viewBoundingSphere(t,KU),this.boundingSphere=t,_=!1,m=!1}else(!x||!l(y.getValue(e,this._offset3D)))&&h.clone(fD._defaultOffset3D,this._offset3D)}else!d&&this._mode!==ne.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,cst(this,p,_,m,a,c,u,s,e,i)};var $U=fD;function iz(e){return oz(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function oz(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?oz(n):n),[])}var h_e=[0,1,2,3].concat(...iz([[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 _r(){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,u=e.stat_desc.max_length,f,d,p,_,m,y,x=0;for(_=0;_<=15;_++)o.bl_count[_]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],_=r[r[d*2+1]*2+1]+1,_>u&&(_=u,x++),r[d*2+1]=_,!(d>e.max_code)&&(o.bl_count[_]++,m=0,d>=c&&(m=a[d-c]),y=r[d*2],o.opt_len+=y*(_+m),s&&(o.static_len+=y*(s[d*2+1]+m)));if(x!==0){do{for(_=u-1;o.bl_count[_]===0;)_--;o.bl_count[_]--,o.bl_count[_+1]+=2,o.bl_count[u]--,x-=2}while(x>0);for(_=u;_!==0;_--)for(d=o.bl_count[_];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=_&&(o.opt_len+=(_-r[p*2+1])*r[p*2],r[p*2+1]=_),d--)}}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,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=f<2?++f:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,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)}}_r._length_code=[0,1,2,3,4,5,6,7].concat(...iz([[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]]));_r.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];_r.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];_r.d_code=function(e){return e<256?h_e[e]:h_e[256+(e>>>7)]};_r.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];_r.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];_r.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];_r.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Wa(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 ust=[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],fst=iz([[144,8],[112,9],[24,7],[8,8]]);Wa.static_ltree=oz(ust.map((e,t)=>[e,fst[t]]));var dst=[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],hst=iz([[30,5]]);Wa.static_dtree=oz(dst.map((e,t)=>[e,hst[t]]));Wa.static_l_desc=new Wa(Wa.static_ltree,_r.extra_lbits,257,286,15);Wa.static_d_desc=new Wa(Wa.static_dtree,_r.extra_dbits,0,30,15);Wa.static_bl_desc=new Wa(null,_r.extra_blbits,0,19,7);var mst=9,pst=8;function qm(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 p_e=0,tz=1,Yb=2,Th=[new qm(0,0,0,0,p_e),new qm(4,4,8,4,tz),new qm(4,5,16,8,tz),new qm(4,6,32,32,tz),new qm(4,4,16,16,Yb),new qm(8,16,32,32,Yb),new qm(8,16,128,128,Yb),new qm(8,32,128,256,Yb),new qm(32,128,258,1024,Yb),new qm(32,258,258,4096,Yb)],ZU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ld=0,QU=1,dD=2,JU=3,_st=32,FY=42,ez=113,hD=666,BY=8,gst=0,kY=1,yst=2,Pr=3,nz=258,ku=nz+Pr+1;function m_e(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function xst(){let e=this,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y,x,b,T,C,A,S,w,R,D,M,L,g,E,v,I,N,F,U,k=new _r,z=new _r,B=new _r;e.depth=[];let j,W,J,Y,ee,Q;e.bl_count=[],e.heap=[],N=[],F=[],U=[];function de(){u=2*r,d[_-1]=0;for(let Ue=0;Ue<_-1;Ue++)d[Ue]=0;L=Th[g].max_lazy,v=Th[g].good_length,I=Th[g].nice_length,M=Th[g].max_chain,S=0,b=0,R=0,T=D=Pr-1,A=0,p=0}function ge(){let Ue;for(Ue=0;Ue<286;Ue++)N[Ue*2]=0;for(Ue=0;Ue<30;Ue++)F[Ue*2]=0;for(Ue=0;Ue<19;Ue++)U[Ue*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,W=J=0}function le(){k.dyn_tree=N,k.stat_desc=Wa.static_l_desc,z.dyn_tree=F,z.stat_desc=Wa.static_d_desc,B.dyn_tree=U,B.stat_desc=Wa.static_bl_desc,ee=0,Q=0,Y=8,ge()}e.pqdownheap=function(Ue,ot){let Ye=e.heap,Ze=Ye[ot],pt=ot<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&m_e(Ue,Ye[pt+1],Ye[pt],e.depth)&&pt++,!m_e(Ue,Ze,Ye[pt],e.depth));)Ye[ot]=Ye[pt],ot=pt,pt<<=1;Ye[ot]=Ze};function ye(Ue,ot){let Ye=-1,Ze,pt=Ue[0*2+1],qt=0,xn=7,Ro=4;pt===0&&(xn=138,Ro=3),Ue[(ot+1)*2+1]=65535;for(let So=0;So<=ot;So++)Ze=pt,pt=Ue[(So+1)*2+1],!(++qt<xn&&Ze==pt)&&(qt<Ro?U[Ze*2]+=qt:Ze!==0?(Ze!=Ye&&U[Ze*2]++,U[16*2]++):qt<=10?U[17*2]++:U[18*2]++,qt=0,Ye=Ze,pt===0?(xn=138,Ro=3):Ze==pt?(xn=6,Ro=3):(xn=7,Ro=4))}function be(){let Ue;for(ye(N,k.max_code),ye(F,z.max_code),B.build_tree(e),Ue=18;Ue>=3&&U[_r.bl_order[Ue]*2+1]===0;Ue--);return e.opt_len+=3*(Ue+1)+5+5+4,Ue}function Ie(Ue){e.pending_buf[e.pending++]=Ue}function Te(Ue){Ie(Ue&255),Ie(Ue>>>8&255)}function ve(Ue){Ie(Ue>>8&255),Ie(Ue&255&255)}function Ve(Ue,ot){let Ye,Ze=ot;Q>16-Ze?(Ye=Ue,ee|=Ye<<Q&65535,Te(ee),ee=Ye>>>16-Q,Q+=Ze-16):(ee|=Ue<<Q&65535,Q+=Ze)}function Ke(Ue,ot){let Ye=Ue*2;Ve(ot[Ye]&65535,ot[Ye+1]&65535)}function Ct(Ue,ot){let Ye,Ze=-1,pt,qt=Ue[0*2+1],xn=0,Ro=7,So=4;for(qt===0&&(Ro=138,So=3),Ye=0;Ye<=ot;Ye++)if(pt=qt,qt=Ue[(Ye+1)*2+1],!(++xn<Ro&&pt==qt)){if(xn<So)do Ke(pt,U);while(--xn!==0);else pt!==0?(pt!=Ze&&(Ke(pt,U),xn--),Ke(16,U),Ve(xn-3,2)):xn<=10?(Ke(17,U),Ve(xn-3,3)):(Ke(18,U),Ve(xn-11,7));xn=0,Ze=pt,qt===0?(Ro=138,So=3):pt==qt?(Ro=6,So=3):(Ro=7,So=4)}}function Qt(Ue,ot,Ye){let Ze;for(Ve(Ue-257,5),Ve(ot-1,5),Ve(Ye-4,4),Ze=0;Ze<Ye;Ze++)Ve(U[_r.bl_order[Ze]*2+1],3);Ct(N,Ue-1),Ct(F,ot-1)}function Qe(){Q==16?(Te(ee),ee=0,Q=0):Q>=8&&(Ie(ee&255),ee>>>=8,Q-=8)}function hn(){Ve(kY<<1,3),Ke(256,Wa.static_ltree),Qe(),1+Y+10-Q<9&&(Ve(kY<<1,3),Ke(256,Wa.static_ltree),Qe()),Y=7}function Nt(Ue,ot){let Ye,Ze,pt;if(e.dist_buf[W]=Ue,e.lc_buf[W]=ot&255,W++,Ue===0?N[ot*2]++:(J++,Ue--,N[(_r._length_code[ot]+256+1)*2]++,F[_r.d_code(Ue)*2]++),(W&8191)===0&&g>2){for(Ye=W*8,Ze=S-b,pt=0;pt<30;pt++)Ye+=F[pt*2]*(5+_r.extra_dbits[pt]);if(Ye>>>=3,J<Math.floor(W/2)&&Ye<Math.floor(Ze/2))return!0}return W==j-1}function Rt(Ue,ot){let Ye,Ze,pt=0,qt,xn;if(W!==0)do Ye=e.dist_buf[pt],Ze=e.lc_buf[pt],pt++,Ye===0?Ke(Ze,Ue):(qt=_r._length_code[Ze],Ke(qt+256+1,Ue),xn=_r.extra_lbits[qt],xn!==0&&(Ze-=_r.base_length[qt],Ve(Ze,xn)),Ye--,qt=_r.d_code(Ye),Ke(qt,ot),xn=_r.extra_dbits[qt],xn!==0&&(Ye-=_r.base_dist[qt],Ve(Ye,xn)));while(pt<W);Ke(256,Ue),Y=Ue[256*2+1]}function Zn(){Q>8?Te(ee):Q>0&&Ie(ee&255),ee=0,Q=0}function gi(Ue,ot,Ye){Zn(),Y=8,Ye&&(Te(ot),Te(~ot)),e.pending_buf.set(c.subarray(Ue,Ue+ot),e.pending),e.pending+=ot}function Ht(Ue,ot,Ye){Ve((gst<<1)+(Ye?1:0),3),gi(Ue,ot,!0)}function wt(Ue,ot,Ye){let Ze,pt,qt=0;g>0?(k.build_tree(e),z.build_tree(e),qt=be(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ue!=-1?Ht(Ue,ot,Ye):pt==Ze?(Ve((kY<<1)+(Ye?1:0),3),Rt(Wa.static_ltree,Wa.static_dtree)):(Ve((yst<<1)+(Ye?1:0),3),Qt(k.max_code+1,z.max_code+1,qt+1),Rt(N,F)),ge(),Ye&&Zn()}function no(Ue){wt(b>=0?b:-1,S-b,Ue),b=S,t.flush_pending()}function xt(){let Ue,ot,Ye,Ze;do{if(Ze=u-R-S,Ze===0&&S===0&&R===0)Ze=r;else if(Ze==-1)Ze--;else if(S>=r+r-ku){c.set(c.subarray(r,r+r),0),w-=r,S-=r,b-=r,Ue=_,Ye=Ue;do ot=d[--Ye]&65535,d[Ye]=ot>=r?ot-r:0;while(--Ue!==0);Ue=r,Ye=Ue;do ot=f[--Ye]&65535,f[Ye]=ot>=r?ot-r:0;while(--Ue!==0);Ze+=r}if(t.avail_in===0)return;Ue=t.read_buf(c,S+R,Ze),R+=Ue,R>=Pr&&(p=c[S]&255,p=(p<<x^c[S+1]&255)&y)}while(R<ku&&t.avail_in!==0)}function Xo(Ue){let ot=65535,Ye;for(ot>i-5&&(ot=i-5);;){if(R<=1){if(xt(),R===0&&Ue==0)return ld;if(R===0)break}if(S+=R,R=0,Ye=b+ot,(S===0||S>=Ye)&&(R=S-Ye,S=Ye,no(!1),t.avail_out===0)||S-b>=r-ku&&(no(!1),t.avail_out===0))return ld}return no(Ue==4),t.avail_out===0?Ue==4?dD:ld:Ue==4?JU:QU}function yr(Ue){let ot=M,Ye=S,Ze,pt,qt=D,xn=S>r-ku?S-(r-ku):0,Ro=I,So=a,tc=S+nz,nc=c[Ye+qt-1],Ai=c[Ye+qt];D>=v&&(ot>>=2),Ro>R&&(Ro=R);do if(Ze=Ue,!(c[Ze+qt]!=Ai||c[Ze+qt-1]!=nc||c[Ze]!=c[Ye]||c[++Ze]!=c[Ye+1])){Ye+=2,Ze++;do;while(c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&c[++Ye]==c[++Ze]&&Ye<tc);if(pt=nz-(tc-Ye),Ye=tc-nz,pt>qt){if(w=Ue,qt=pt,pt>=Ro)break;nc=c[Ye+qt-1],Ai=c[Ye+qt]}}while((Ue=f[Ue&So]&65535)>xn&&--ot!==0);return qt<=R?qt:R}function ec(Ue){let ot=0,Ye;for(;;){if(R<ku){if(xt(),R<ku&&Ue==0)return ld;if(R===0)break}if(R>=Pr&&(p=(p<<x^c[S+(Pr-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S),ot!==0&&(S-ot&65535)<=r-ku&&E!=2&&(T=yr(ot)),T>=Pr)if(Ye=Nt(S-w,T-Pr),R-=T,T<=L&&R>=Pr){T--;do S++,p=(p<<x^c[S+(Pr-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S;while(--T!==0);S++}else S+=T,T=0,p=c[S]&255,p=(p<<x^c[S+1]&255)&y;else Ye=Nt(0,c[S]&255),R--,S++;if(Ye&&(no(!1),t.avail_out===0))return ld}return no(Ue==4),t.avail_out===0?Ue==4?dD:ld:Ue==4?JU:QU}function Or(Ue){let ot=0,Ye,Ze;for(;;){if(R<ku){if(xt(),R<ku&&Ue==0)return ld;if(R===0)break}if(R>=Pr&&(p=(p<<x^c[S+(Pr-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S),D=T,C=w,T=Pr-1,ot!==0&&D<L&&(S-ot&65535)<=r-ku&&(E!=2&&(T=yr(ot)),T<=5&&(E==1||T==Pr&&S-w>4096)&&(T=Pr-1)),D>=Pr&&T<=D){Ze=S+R-Pr,Ye=Nt(S-1-C,D-Pr),R-=D-1,D-=2;do++S<=Ze&&(p=(p<<x^c[S+(Pr-1)]&255)&y,ot=d[p]&65535,f[S&a]=d[p],d[p]=S);while(--D!==0);if(A=0,T=Pr-1,S++,Ye&&(no(!1),t.avail_out===0))return ld}else if(A!==0){if(Ye=Nt(0,c[S-1]&255),Ye&&no(!1),S++,R--,t.avail_out===0)return ld}else A=1,S++,R--}return A!==0&&(Ye=Nt(0,c[S-1]&255),A=0),no(Ue==4),t.avail_out===0?Ue==4?dD:ld:Ue==4?JU:QU}function vs(Ue){return Ue.total_in=Ue.total_out=0,Ue.msg=null,e.pending=0,e.pending_out=0,n=ez,o=0,le(),de(),0}e.deflateInit=function(Ue,ot,Ye,Ze,pt,qt){return Ze||(Ze=BY),pt||(pt=pst),qt||(qt=0),Ue.msg=null,ot==-1&&(ot=6),pt<1||pt>mst||Ze!=BY||Ye<9||Ye>15||ot<0||ot>9||qt<0||qt>2?-2:(Ue.dstate=e,s=Ye,r=1<<s,a=r-1,m=pt+7,_=1<<m,y=_-1,x=Math.floor((m+Pr-1)/Pr),c=new Uint8Array(r*2),f=[],d=[],j=1<<pt+6,e.pending_buf=new Uint8Array(j*4),i=j*4,e.dist_buf=new Uint16Array(j),e.lc_buf=new Uint8Array(j),g=ot,E=qt,vs(Ue))},e.deflateEnd=function(){return n!=FY&&n!=ez&&n!=hD?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==ez?-3:0)},e.deflateParams=function(Ue,ot,Ye){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||Ye<0||Ye>2?-2:(Th[g].func!=Th[ot].func&&Ue.total_in!==0&&(Ze=Ue.deflate(1)),g!=ot&&(g=ot,L=Th[g].max_lazy,v=Th[g].good_length,I=Th[g].nice_length,M=Th[g].max_chain),E=Ye,Ze)},e.deflateSetDictionary=function(Ue,ot,Ye){let Ze=Ye,pt,qt=0;if(!ot||n!=FY)return-2;if(Ze<Pr)return 0;for(Ze>r-ku&&(Ze=r-ku,qt=Ye-Ze),c.set(ot.subarray(qt,qt+Ze),0),S=Ze,b=Ze,p=c[0]&255,p=(p<<x^c[1]&255)&y,pt=0;pt<=Ze-Pr;pt++)p=(p<<x^c[pt+(Pr-1)]&255)&y,f[pt&a]=d[p],d[p]=pt;return 0},e.deflate=function(Ue,ot){let Ye,Ze,pt,qt,xn;if(ot>4||ot<0)return-2;if(!Ue.next_out||!Ue.next_in&&Ue.avail_in!==0||n==hD&&ot!=4)return Ue.msg=ZU[4],-2;if(Ue.avail_out===0)return Ue.msg=ZU[7],-5;if(t=Ue,qt=o,o=ot,n==FY&&(Ze=BY+(s-8<<4)<<8,pt=(g-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,S!==0&&(Ze|=_st),Ze+=31-Ze%31,n=ez,ve(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=qt&&ot!=4)return t.msg=ZU[7],-5;if(n==hD&&t.avail_in!==0)return Ue.msg=ZU[7],-5;if(t.avail_in!==0||R!==0||ot!=0&&n!=hD){switch(xn=-1,Th[g].func){case p_e:xn=Xo(ot);break;case tz:xn=ec(ot);break;case Yb:xn=Or(ot);break;default:}if((xn==dD||xn==JU)&&(n=hD),xn==ld||xn==dD)return t.avail_out===0&&(o=-1),0;if(xn==QU){if(ot==1)hn();else if(Ht(0,0,!1),ot==3)for(Ye=0;Ye<_;Ye++)d[Ye]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function __e(){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}__e.prototype={deflateInit(e,t){let n=this;return n.dstate=new xst,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 g_e(e){let t=this,n=new __e,i=bst(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 u,f,d=0,p=0,_=0,m=[];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,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),_+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(_),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,d=[];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&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function bst(e){return e+5*(Math.floor(e/16383)+1)}var Uu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B_e=1440,Tst=0,Cst=4,Ast=9,Est=5,Sst=[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],vst=[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],wst=[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],Ist=[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],Pst=[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],Dst=[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],l0=15;function HY(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,_,m,y,x,b,T,C){let A,S,w,R,D,M,L,g,E,v,I,N,F,U,k;v=0,D=d;do i[u[f+v]]++,v++,D--;while(D!==0);if(i[0]==d)return y[0]=-1,x[0]=0,0;for(g=x[0],M=1;M<=l0&&i[M]===0;M++);for(L=M,g<M&&(g=M),D=l0;D!==0&&i[D]===0;D--);for(w=D,g>D&&(g=D),x[0]=g,U=1<<M;M<D;M++,U<<=1)if((U-=i[M])<0)return-3;if((U-=i[D])<0)return-3;for(i[D]+=U,s[1]=M=0,v=1,F=2;--D!==0;)s[F]=M+=i[v],F++,v++;D=0,v=0;do(M=u[f+v])!==0&&(C[s[M]++]=D),v++;while(++D<d);for(d=s[w],s[0]=D=0,v=0,R=-1,N=-g,r[0]=0,I=0,k=0;L<=w;L++)for(A=i[L];A--!==0;){for(;L>N+g;){if(R++,N+=g,k=w-N,k=k>g?g:k,(S=1<<(M=L-N))>A+1&&(S-=A+1,F=L,M<k))for(;++M<k&&!((S<<=1)<=i[++F]);)S-=i[F];if(k=1<<M,T[0]+k>B_e)return-3;r[R]=I=T[0],T[0]+=k,R!==0?(s[R]=D,o[0]=M,o[1]=g,M=D>>>N-g,o[2]=I-r[R-1]-M,b.set(o,(r[R-1]+M)*3)):y[0]=I}for(o[1]=L-N,v>=d?o[0]=192:C[v]<p?(o[0]=C[v]<256?0:96,o[2]=C[v++]):(o[0]=m[C[v]-p]+16+64,o[2]=_[C[v++]-p]),S=1<<L-N,M=D>>>N;M<k;M+=S)b.set(o,(I+M)*3);for(M=1<<L-1;(D&M)!==0;M>>>=1)D^=M;for(D^=M,E=(1<<N)-1;(D&E)!=s[R];)R--,N-=g,E=(1<<N)-1}return U!==0&&w!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(l0+1),o=[],r=new Int32Array(l0),s=new Int32Array(l0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<l0+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,l0),0),s.set(i.subarray(0,l0+1),0)}e.inflate_trees_bits=function(u,f,d,p,_){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,d,f,p,t,n),m==-3?_.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(_.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,d,p,_,m,y,x,b){let T;return c(288),t[0]=0,T=a(d,0,u,257,wst,Ist,m,p,x,t,n),T!=0||p[0]===0?(T==-3?b.msg="oversubscribed literal/length tree":T!=-4&&(b.msg="incomplete literal/length tree",T=-3),T):(c(288),T=a(d,u,f,0,Pst,Dst,y,_,x,t,n),T!=0||_[0]===0&&u>257?(T==-3?b.msg="oversubscribed distance tree":T==-5?(b.msg="incomplete distance tree",T=-3):T!=-4&&(b.msg="empty distance tree with lengths",T=-3),T):0)}}HY.inflate_trees_fixed=function(e,t,n,i){return e[0]=Ast,t[0]=Est,n[0]=Sst,i[0]=vst,0};var rz=0,y_e=1,x_e=2,b_e=3,T_e=4,C_e=5,A_e=6,UY=7,E_e=8,sz=9;function Rst(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,_,m=0;function y(x,b,T,C,A,S,w,R){let D,M,L,g,E,v,I,N,F,U,k,z,B,j,W,J;I=R.next_in_index,N=R.avail_in,E=w.bitb,v=w.bitk,F=w.write,U=F<w.read?w.read-F-1:w.end-F,k=Uu[x],z=Uu[b];do{for(;v<20;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;if(D=E&k,M=T,L=C,J=(L+D)*3,(g=M[J])===0){E>>=M[J+1],v-=M[J+1],w.win[F++]=M[J+2],U--;continue}do{if(E>>=M[J+1],v-=M[J+1],(g&16)!==0){for(g&=15,B=M[J+2]+(E&Uu[g]),E>>=g,v-=g;v<15;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;D=E&z,M=A,L=S,J=(L+D)*3,g=M[J];do if(E>>=M[J+1],v-=M[J+1],(g&16)!==0){for(g&=15;v<g;)N--,E|=(R.read_byte(I++)&255)<<v,v+=8;if(j=M[J+2]+(E&Uu[g]),E>>=g,v-=g,U-=B,F>=j)W=F-j,F-W>0&&2>F-W?(w.win[F++]=w.win[W++],w.win[F++]=w.win[W++],B-=2):(w.win.set(w.win.subarray(W,W+2),F),F+=2,W+=2,B-=2);else{W=F-j;do W+=w.end;while(W<0);if(g=w.end-W,B>g){if(B-=g,F-W>0&&g>F-W)do w.win[F++]=w.win[W++];while(--g!==0);else w.win.set(w.win.subarray(W,W+g),F),F+=g,W+=g,g=0;W=0}}if(F-W>0&&B>F-W)do w.win[F++]=w.win[W++];while(--B!==0);else w.win.set(w.win.subarray(W,W+B),F),F+=B,W+=B,B=0;break}else if((g&64)===0)D+=M[J+2],D+=E&Uu[g],J=(L+D)*3,g=M[J];else return R.msg="invalid distance code",B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,-3;while(!0);break}if((g&64)===0){if(D+=M[J+2],D+=E&Uu[g],J=(L+D)*3,(g=M[J])===0){E>>=M[J+1],v-=M[J+1],w.win[F++]=M[J+2],U--;break}}else return(g&32)!==0?(B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,1):(R.msg="invalid literal/length code",B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,-3)}while(!0)}while(U>=258&&N>=10);return B=R.avail_in-N,B=v>>3<B?v>>3:B,N+=B,I-=B,v-=B<<3,w.bitb=E,w.bitk=v,R.avail_in=N,R.total_in+=I-R.next_in_index,R.next_in_index=I,w.write=F,0}e.init=function(x,b,T,C,A,S){t=rz,u=x,f=b,d=T,p=C,_=A,m=S,i=null},e.proc=function(x,b,T){let C,A,S,w=0,R=0,D=0,M,L,g,E;for(D=b.next_in_index,M=b.avail_in,w=x.bitb,R=x.bitk,L=x.write,g=L<x.read?x.read-L-1:x.end-L;;)switch(t){case rz:if(g>=258&&M>=10&&(x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,T=y(u,f,d,p,_,m,x,b),D=b.next_in_index,M=b.avail_in,w=x.bitb,R=x.bitk,L=x.write,g=L<x.read?x.read-L-1:x.end-L,T!=0)){t=T==1?UY:sz;break}r=u,i=d,o=p,t=y_e;case y_e:for(C=r;R<C;){if(M!==0)T=0;else return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);M--,w|=(b.read_byte(D++)&255)<<R,R+=8}if(A=(o+(w&Uu[C]))*3,w>>>=i[A+1],R-=i[A+1],S=i[A],S===0){s=i[A+2],t=A_e;break}if((S&16)!==0){a=S&15,n=i[A+2],t=x_e;break}if((S&64)===0){r=S,o=A/3+i[A+2];break}if((S&32)!==0){t=UY;break}return t=sz,b.msg="invalid literal/length code",T=-3,x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);case x_e:for(C=a;R<C;){if(M!==0)T=0;else return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);M--,w|=(b.read_byte(D++)&255)<<R,R+=8}n+=w&Uu[C],w>>=C,R-=C,r=f,i=_,o=m,t=b_e;case b_e:for(C=r;R<C;){if(M!==0)T=0;else return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);M--,w|=(b.read_byte(D++)&255)<<R,R+=8}if(A=(o+(w&Uu[C]))*3,w>>=i[A+1],R-=i[A+1],S=i[A],(S&16)!==0){a=S&15,c=i[A+2],t=T_e;break}if((S&64)===0){r=S,o=A/3+i[A+2];break}return t=sz,b.msg="invalid distance code",T=-3,x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);case T_e:for(C=a;R<C;){if(M!==0)T=0;else return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);M--,w|=(b.read_byte(D++)&255)<<R,R+=8}c+=w&Uu[C],w>>=C,R-=C,t=C_e;case C_e:for(E=L-c;E<0;)E+=x.end;for(;n!==0;){if(g===0&&(L==x.end&&x.read!==0&&(L=0,g=L<x.read?x.read-L-1:x.end-L),g===0&&(x.write=L,T=x.inflate_flush(b,T),L=x.write,g=L<x.read?x.read-L-1:x.end-L,L==x.end&&x.read!==0&&(L=0,g=L<x.read?x.read-L-1:x.end-L),g===0)))return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);x.win[L++]=x.win[E++],g--,E==x.end&&(E=0),n--}t=rz;break;case A_e:if(g===0&&(L==x.end&&x.read!==0&&(L=0,g=L<x.read?x.read-L-1:x.end-L),g===0&&(x.write=L,T=x.inflate_flush(b,T),L=x.write,g=L<x.read?x.read-L-1:x.end-L,L==x.end&&x.read!==0&&(L=0,g=L<x.read?x.read-L-1:x.end-L),g===0)))return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);T=0,x.win[L++]=s,g--,t=rz;break;case UY:if(R>7&&(R-=8,M++,D--),x.write=L,T=x.inflate_flush(b,T),L=x.write,g=L<x.read?x.read-L-1:x.end-L,x.read!=x.write)return x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);t=E_e;case E_e:return T=1,x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);case sz:return T=-3,x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T);default:return T=-2,x.bitb=w,x.bitk=R,b.avail_in=M,b.total_in+=D-b.next_in_index,b.next_in_index=D,x.write=L,x.inflate_flush(b,T)}},e.free=function(){}}var S_e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fS=0,zY=1,v_e=2,w_e=3,I_e=4,P_e=5,az=6,cz=7,D_e=8,Xb=9;function Ost(e,t){let n=this,i=fS,o=0,r=0,s=0,a,c=[0],u=[0],f=new Rst,d=0,p=new Int32Array(B_e*3),_=0,m=new HY;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]=_),i==az&&f.free(y),i=fS,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,x){let b,T,C;return T=y.next_out_index,C=n.read,b=(C<=n.write?n.write:n.end)-C,b>y.avail_out&&(b=y.avail_out),b!==0&&x==-5&&(x=0),y.avail_out-=b,y.total_out+=b,y.next_out.set(n.win.subarray(C,C+b),T),T+=b,C+=b,C==n.end&&(C=0,n.write==n.end&&(n.write=0),b=n.write-C,b>y.avail_out&&(b=y.avail_out),b!==0&&x==-5&&(x=0),y.avail_out-=b,y.total_out+=b,y.next_out.set(n.win.subarray(C,C+b),T),T+=b,C+=b),y.next_out_index=T,n.read=C,x},n.proc=function(y,x){let b,T,C,A,S,w,R,D;for(A=y.next_in_index,S=y.avail_in,T=n.bitb,C=n.bitk,w=n.write,R=w<n.read?n.read-w-1:n.end-w;;){let M,L,g,E,v,I,N,F;switch(i){case fS:for(;C<3;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}switch(b=T&7,d=b&1,b>>>1){case 0:T>>>=3,C-=3,b=C&7,T>>>=b,C-=b,i=zY;break;case 1:M=[],L=[],g=[[]],E=[[]],HY.inflate_trees_fixed(M,L,g,E),f.init(M[0],L[0],g[0],0,E[0],0),T>>>=3,C-=3,i=az;break;case 2:T>>>=3,C-=3,i=w_e;break;case 3:return T>>>=3,C-=3,i=Xb,y.msg="invalid block type",x=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x)}break;case zY:for(;C<32;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if((~T>>>16&65535)!=(T&65535))return i=Xb,y.msg="invalid stored block lengths",x=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);o=T&65535,T=C=0,i=o!==0?v_e:d!==0?cz:fS;break;case v_e:if(S===0||R===0&&(w==n.end&&n.read!==0&&(w=0,R=w<n.read?n.read-w-1:n.end-w),R===0&&(n.write=w,x=n.inflate_flush(y,x),w=n.write,R=w<n.read?n.read-w-1:n.end-w,w==n.end&&n.read!==0&&(w=0,R=w<n.read?n.read-w-1:n.end-w),R===0)))return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);if(x=0,b=o,b>S&&(b=S),b>R&&(b=R),n.win.set(y.read_buf(A,b),w),A+=b,S-=b,w+=b,R-=b,(o-=b)!==0)break;i=d!==0?cz:fS;break;case w_e:for(;C<14;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(r=b=T&16383,(b&31)>29||(b>>5&31)>29)return i=Xb,y.msg="too many length or distance symbols",x=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);if(b=258+(b&31)+(b>>5&31),!a||a.length<b)a=[];else for(D=0;D<b;D++)a[D]=0;T>>>=14,C-=14,s=0,i=I_e;case I_e:for(;s<4+(r>>>10);){for(;C<3;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}a[S_e[s++]]=T&7,T>>>=3,C-=3}for(;s<19;)a[S_e[s++]]=0;if(c[0]=7,b=m.inflate_trees_bits(a,c,u,p,y),b!=0)return x=b,x==-3&&(a=null,i=Xb),n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);s=0,i=P_e;case P_e:for(;b=r,!(s>=258+(b&31)+(b>>5&31));){let U,k;for(b=c[0];C<b;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(b=p[(u[0]+(T&Uu[b]))*3+1],k=p[(u[0]+(T&Uu[b]))*3+2],k<16)T>>>=b,C-=b,a[s++]=k;else{for(D=k==18?7:k-14,U=k==18?11:3;C<b+D;){if(S!==0)x=0;else return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);S--,T|=(y.read_byte(A++)&255)<<C,C+=8}if(T>>>=b,C-=b,U+=T&Uu[D],T>>>=D,C-=D,D=s,b=r,D+U>258+(b&31)+(b>>5&31)||k==16&&D<1)return a=null,i=Xb,y.msg="invalid bit length repeat",x=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);k=k==16?a[D-1]:0;do a[D++]=k;while(--U!==0);s=D}}if(u[0]=-1,v=[],I=[],N=[],F=[],v[0]=9,I[0]=6,b=r,b=m.inflate_trees_dynamic(257+(b&31),1+(b>>5&31),a,v,I,N,F,p,y),b!=0)return b==-3&&(a=null,i=Xb),x=b,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);f.init(v[0],I[0],p,N[0],p,F[0]),i=az;case az:if(n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,(x=f.proc(n,y,x))!=1)return n.inflate_flush(y,x);if(x=0,f.free(y),A=y.next_in_index,S=y.avail_in,T=n.bitb,C=n.bitk,w=n.write,R=w<n.read?n.read-w-1:n.end-w,d===0){i=fS;break}i=cz;case cz:if(n.write=w,x=n.inflate_flush(y,x),w=n.write,R=w<n.read?n.read-w-1:n.end-w,n.read!=n.write)return n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);i=D_e;case D_e:return x=1,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);case Xb:return x=-3,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x);default:return x=-2,n.bitb=T,n.bitk=C,y.avail_in=S,y.total_in+=A-y.next_in_index,y.next_in_index=A,n.write=w,n.inflate_flush(y,x)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,x,b){n.win.set(y.subarray(x,x+b),0),n.read=n.write=b},n.sync_point=function(){return i==zY?1:0}}var Mst=32,Lst=8,Nst=0,R_e=1,O_e=2,M_e=3,L_e=4,N_e=5,VY=6,mD=7,F_e=12,u0=13,Fst=[0,0,255,255];function Bst(){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=mD,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 Ost(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==Cst?-5:0,o=-5;;)switch(s.mode){case Nst: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)!=Lst){s.mode=u0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=u0,n.msg="invalid win size",s.marker=5;break}s.mode=R_e;case R_e: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=u0,n.msg="incorrect header check",s.marker=5;break}if((r&Mst)===0){s.mode=mD;break}s.mode=O_e;case O_e: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=M_e;case M_e: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=L_e;case L_e: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=N_e;case N_e: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=VY,2);case VY:return s.mode=u0,n.msg="need dictionary",s.marker=0,-2;case mD:if(o=s.blocks.proc(n,o),o==-3){s.mode=u0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=F_e;case F_e:return n.avail_in=0,1;case u0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=VY)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=mD,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=u0&&(c.mode=u0,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)==Fst[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=mD,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function k_e(){}k_e.prototype={inflateInit(e){let t=this;return t.istate=new Bst,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 U_e(e){let t=this,n=new k_e,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Tst,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,d,p=0,_=0,m=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),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=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 u.length>1?(d=new Uint8Array(m),u.forEach(function(y){d.set(y,_),_+=y.length})):d=u[0]?new Uint8Array(u[0]):new Uint8Array,d}},t.flush=function(){n.inflateEnd()}}var Kb="/",GY=new Date(2107,11,31),jY=new Date(1980,0,1),_i=void 0,zu="undefined",z_="function";var pD=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 kst=64,z_e=2;try{typeof navigator!=zu&&navigator.hardwareConcurrency&&(z_e=navigator.hardwareConcurrency)}catch{}var Ust={chunkSize:512*1024,maxWorkers:z_e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:_i,CompressionStreamNative:typeof CompressionStream!=zu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=zu&&DecompressionStream},d0=Object.assign({},Ust);function _D(){return d0}function lz(e){return Math.max(e.chunkSize,kst)}function dS(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:d}=e;if(f0("baseURL",t),f0("chunkSize",n),f0("maxWorkers",i),f0("terminateWorkerTimeout",o),f0("useCompressionStream",r),f0("useWebWorkers",s),a&&(d0.CompressionStream=new pD(a)),c&&(d0.DecompressionStream=new pD(c)),f0("CompressionStream",u),f0("DecompressionStream",f),d!==_i){let{deflate:p,inflate:_}=d;if((p||_)&&(d0.workerScripts||(d0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");d0.workerScripts.deflate=p}if(_){if(!Array.isArray(_))throw new Error("workerScripts.inflate must be an array");d0.workerScripts.inflate=_}}}function f0(e,t){t!==_i&&(d0[e]=t)}var V_e=[];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;V_e[e]=t}var V_=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^V_e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var gD=class extends TransformStream{constructor(){let t,n=new V_;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function hS(e){if(typeof TextEncoder==zu){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 ml={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ml.getPartial(n);return i===32?e.concat(t):ml._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+ml.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]=ml.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=ml.getPartial(o);return i.push(ml.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},yD={bytes:{fromBits(e){let n=ml.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(ml.partial(8*(n&3),i)),t}}},H_e={};H_e.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=yD.utf8String.toBits(e));let n=t._buffer=ml.concat(t._buffer,e),i=t._length,o=t._length=i+ml.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=ml.concat(t,[ml.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var WY={};WY.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,_=o[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=_=_<<24^_>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],_=e[2]^n[2],m=e[t?1:3]^n[3],y=4,x,b,T;for(let C=0;C<i;C++)x=s[d>>>24]^a[p>>16&255]^c[_>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[_>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],T=s[_>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[_&255]^n[y+3],y+=4,d=x,p=b,_=T;for(let C=0;C<4;C++)o[t?3&-C:C]=f[d>>>24]<<24^f[p>>16&255]<<16^f[_>>8&255]<<8^f[m&255]^n[y++],x=d,d=p,p=_,_=m,m=x;return o}};var G_e={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}},qY={};qY.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=ml.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 ml.clamp(t,o)}};var h0={importKey(e){return new h0.hmacSha1(yD.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,_=ml;for(t=yD.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(_.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)d.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};h0.hmacSha1=class{constructor(e){let t=this,n=t._hash=H_e.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 zst=typeof crypto!=zu&&typeof crypto.getRandomValues==z_,m0="Invalid password",$b="Invalid signature",H_="zipjs-abort-check-password";function uz(e){return zst?crypto.getRandomValues(e):G_e.getRandomValues(e)}var mS=16,Vst="raw",q_e={name:"PBKDF2"},Hst={name:"HMAC"},Gst="SHA-1",jst=Object.assign({hash:Hst},q_e),YY=Object.assign({iterations:1e3,hash:{name:Gst}},q_e),Wst=["deriveBits"],bD=[8,12,16],xD=[16,24,32],p0=10,qst=[0,0,0,0],hz=typeof crypto!=zu,AD=hz&&crypto.subtle,Y_e=hz&&typeof AD!=zu,Ym=yD.bytes,Yst=WY.aes,Xst=qY.ctrGladman,Kst=h0.hmacSha1,j_e=hz&&Y_e&&typeof AD.importKey==z_,W_e=hz&&Y_e&&typeof AD.deriveBits==z_,fz=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:$_e(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await $st(c,f,u,ud(s,0,bD[f]+2)),s=ud(s,bD[f]+2),r?a.error(new Error(H_)):d()):await p;let _=new Uint8Array(s.length-p0-(s.length-p0)%mS);a.enqueue(X_e(c,s,_,0,p0,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:d}=this;if(u&&c){await d;let p=ud(f,0,f.length-p0),_=ud(f,f.length-p0),m=new Uint8Array;if(p.length){let y=CD(Ym,p);u.update(y);let x=c.update(y);m=TD(Ym,x)}if(a){let y=ud(TD(Ym,u.digest()),0,p0);for(let x=0;x<p0;x++)if(y[x]!=_[x])throw new Error($b)}s.enqueue(m)}}})}},dz=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:$_e(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:d}=a,p=new Uint8Array;c?(p=await Zst(a,u,c),f()):await d;let _=new Uint8Array(p.length+r.length-r.length%mS);_.set(p,0),s.enqueue(X_e(a,r,_,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let d=s.update(CD(Ym,c));a.update(d),f=TD(Ym,d)}o.signature=TD(Ym,a.digest()).slice(0,p0),r.enqueue(XY(f,o.signature))}}}),o=this}};function X_e(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=XY(c,t),n=eat(n,u-u%mS));let f;for(f=0;f<=u-mS;f+=mS){let d=CD(Ym,ud(t,f,f+mS));r&&a.update(d);let p=s.update(d);r||a.update(p),n.set(TD(Ym,p),f+i)}return e.pending=ud(t,f),n}async function $st(e,t,n,i){let o=await K_e(e,t,n,ud(i,0,bD[t])),r=ud(i,bD[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(m0)}async function Zst(e,t,n){let i=uz(new Uint8Array(bD[t])),o=await K_e(e,t,n,i);return XY(i,o)}async function K_e(e,t,n,i){e.password=null;let o=await Qst(Vst,n,jst,!1,Wst),r=await Jst(Object.assign({salt:i},YY),o,8*(xD[t]*2+2)),s=new Uint8Array(r),a=CD(Ym,ud(s,0,xD[t])),c=CD(Ym,ud(s,xD[t],xD[t]*2)),u=ud(s,xD[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Xst(new Yst(a),Array.from(qst)),hmac:new Kst(c)}),u}async function Qst(e,t,n,i,o){if(j_e)try{return await AD.importKey(e,t,n,i,o)}catch{return j_e=!1,h0.importKey(t)}else return h0.importKey(t)}async function Jst(e,t,n){if(W_e)try{return await AD.deriveBits(e,t,n)}catch{return W_e=!1,h0.pbkdf2(t,e.salt,YY.iterations,n)}else return h0.pbkdf2(t,e.salt,YY.iterations,n)}function $_e(e,t){return t===_i?hS(e):t}function XY(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 eat(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function ud(e,t,n){return e.subarray(t,n)}function TD(e,t){return e.fromBits(t)}function CD(e,t){return e.toBits(t)}var pS=12,mz=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),ege(this,t)},transform(o,r){let s=this;if(s.password){let a=Z_e(s,o.subarray(0,pS));if(s.password=null,a[pS-1]!=s.passwordVerification)throw new Error(m0);o=o.subarray(pS)}i?r.error(new Error(H_)):r.enqueue(Z_e(s,o))}})}},pz=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),ege(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=uz(new Uint8Array(pS));c[pS-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Q_e(r,c),0),a=pS}else s=new Uint8Array(i.length),a=0;s.set(Q_e(r,i),a),o.enqueue(s)}})}};function Z_e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=tge(e)^t[i],KY(e,n[i]);return n}function Q_e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=tge(e)^t[i],KY(e,t[i]);return n}function ege(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new V_(n[0]),crcKey2:new V_(n[2])});for(let i=0;i<t.length;i++)KY(e,t.charCodeAt(i))}function KY(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=J_e(Math.imul(J_e(i+nge(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function tge(e){let t=e.keys[2]|2;return nge(Math.imul(t,t^1)>>>8)}function nge(e){return e&255}function J_e(e){return e&4294967295}var ige="deflate-raw",_z=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,d=this,p,_,m=oge(super.readable);(!s||c)&&u&&(p=new gD,m=Xm(m,p)),r&&(m=sge(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=Xm(m,new pz(t)):(_=new dz(t),m=Xm(m,_))),rge(d,m,()=>{let y;s&&!c&&(y=_.signature),(!s||c)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),d.signature=y})}},gz=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,d,p,_=oge(super.readable);s&&(r?_=Xm(_,new mz(t)):(p=new fz(t),_=Xm(_,p))),u&&(_=sge(_,f,{chunkSize:n},o,i)),(!s||r)&&a&&(d=new gD,_=Xm(_,d)),rge(this,_,()=>{if((!s||r)&&a){let m=new DataView(d.value.buffer);if(c!=m.getUint32(0,!1))throw new Error($b)}})}};function oge(e){return Xm(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function rge(e,t,n){t=Xm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function sge(e,t,n,i,o){try{let r=t&&i?i:o;e=Xm(e,new r(ige,n))}catch{if(t)try{e=Xm(e,new o(ige,n))}catch{return e}else return e}return e}function Xm(e,t){return e.pipeThrough(t)}var age="message",cge="start",lge="pull",$Y="data",uge="ack",ZY="close",bz="deflate",Tz="inflate";var yz=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(bz)?r=_z:o.startsWith(Tz)&&(r=gz);let s=0,a=0,c=new r(t,n),u=super.readable,f=new TransformStream({transform(p,_){p&&p.length&&(a+=p.length,_.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),d=new TransformStream({transform(p,_){p&&p.length&&(s+=p.length,_.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(d)}})}},xz=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 hge=typeof Worker!=zu;var _S=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:d}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new xz(r.chunkSize)).pipeThrough(new JY(n,s),{signal:d}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:_,busy:m}=t;_?(m?t.resolveTerminated=p:(_.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&hge?tat:mge)(t,r)}},JY=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await QY(n,o)},async transform(a,c){s+=a.length,i&&await QY(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await QY(r,s)}})}};async function QY(e,...t){try{await e(...t)}catch{}}function mge(e,t){return{run:()=>nat(e,t)}}function tat(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=rat(e.scripts[0],n,e)}catch{return hge=!1,mge(e,t)}Object.assign(e,{worker:o,interface:{run:()=>iat(e,{chunkSize:i})}})}return e.interface}async function nat({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new yz(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 iat(e,t){let n,i,o=new Promise((p,_)=>{n=p,i=_});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=oat(e.writable),f=Cz({type:cge,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let d=await o;return f||await c.getWriter().close(),await u,d}function oat(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 fge=!0,dge=!0;function rat(e,t,n){let i={type:"module"},o,r;typeof e==z_&&(e=e());try{o=new URL(e,t)}catch{o=e}if(fge)try{r=new Worker(o)}catch{fge=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(age,s=>sat(s,n)),r}function Cz(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&&dge?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{dge=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function sat({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d}=t;try{if(s){let{message:_,stack:m,code:y,name:x}=s,b=new Error(_);Object.assign(b,{stack:m,code:y,name:x}),p(b)}else{if(n==lge){let{value:_,done:m}=await a.read();Cz({type:$Y,value:_,done:m,messageId:o},t)}n==$Y&&(await c.ready,await c.write(new Uint8Array(i)),Cz({type:uge,messageId:o},t)),n==ZY&&p(null,r)}}catch(_){Cz({type:ZY,messageId:o},t),p(_)}function p(_,m){_?f(_):u(m),c&&c.releaseLock(),d()}}var Zb=[],eX=[];var pge=0;async function Az(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:d,maxWorkers:p}=i;t.transferStreams=o||o===_i;let _=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!_&&(r||r===_i&&i.useWebWorkers),t.scripts=t.useWebWorkers&&d?d[a]:[],n.useCompressionStream=s||s===_i&&i.useCompressionStream,(await m()).run();async function m(){let x=Zb.find(b=>!b.busy);if(x)return _ge(x),new _S(x,e,t,y);if(Zb.length<p){let b={indexWorker:pge};return pge++,Zb.push(b),new _S(b,e,t,y)}else return new Promise(b=>eX.push({resolve:b,stream:e,workerOptions:t}))}function y(x){if(eX.length){let[{resolve:b,stream:T,workerOptions:C}]=eX.splice(0,1);b(new _S(x,T,C,y))}else x.worker?(_ge(x),aat(x,t)):Zb=Zb.filter(b=>b!=x)}}function aat(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{Zb=Zb.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function _ge(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var cat="Writer iterator completed too soon",lat="Writer not initialized",uat="text/plain";var fat="Content-Type";var dat=64*1024,iX="writable",gS=class{constructor(){this.size=0}init(){this.initialized=!0}},Ez=class extends gS{get readable(){let t=this,{chunkSize:n=dat}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this,u=s===_i?n:Math.min(n,s-c),f=await qa(t,r+c,u,a);o.enqueue(f),c+n>s||s===_i&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},tX=class extends gS{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(lat);return t.writeUint8Array(i)}});Object.defineProperty(t,iX,{get(){return n}})}writeUint8Array(){}};var Sz=class extends tX{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)}},G_=class extends Ez{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)}},ED=class extends gS{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([fat,t]),Object.defineProperty(n,iX,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},vz=class extends G_{constructor(t){super(new Blob([t],{type:uat}))}},wz=class extends ED{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 nX=class extends Ez{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 u=r[a],f=u.size;if(c+n<=f)s=await qa(u,c,n);else{let d=f-c;s=new Uint8Array(n),s.set(await qa(u,c,d)),s.set(await o.readUint8Array(t+d,n-d,i),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},Iz=class extends gS{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:d}=i;if(s)f.length>=d?(await c(f.slice(0,d)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(d))):await c(f);else{let{value:p,done:_}=await t.next();if(_&&!p)throw new Error(cat);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await $m(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,iX,{get(){return a}});async function c(f){let d=f.length;d&&(await s.ready,await s.write(f),o.size+=d,i.size+=d,i.availableSize-=d)}async function u(){r.size=o.size,await s.close()}}};async function $m(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function Pz(e){return Array.isArray(e)&&(e=new nX(e)),e instanceof ReadableStream&&(e={readable:e}),e}function Dz(e){e.writable===_i&&typeof e.next==z_&&(e=new Iz(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===_i&&(t.size=0),e instanceof Iz||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function qa(e,t,n,i){return e.readUint8Array(t,n,i)}var gge="\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(""),hat=gge.length==256;function yge(e){if(hat){let t="";for(let n=0;n<e.length;n++)t+=gge[e[n]];return t}else return new TextDecoder().decode(e)}function SD(e,t){return t&&t.trim().toLowerCase()=="cp437"?yge(e):new TextDecoder(t).decode(e)}var oX="filename",rX="rawFilename",sX="comment",aX="rawComment",cX="uncompressedSize",lX="compressedSize",uX="offset",Rz="diskNumberStart",yS="lastModDate",Oz="rawLastModDate",vD="lastAccessDate",xge="rawLastAccessDate",wD="creationDate",bge="rawCreationDate",fX="internalFileAttribute",dX="internalFileAttributes",hX="externalFileAttribute",mX="externalFileAttributes",pX="msDosCompatible",Mz="zip64",_X="encrypted",gX="version",yX="versionMadeBy",xX="zipCrypto",bX="directory",TX="executable",mat=[oX,rX,lX,cX,yS,Oz,sX,aX,vD,wD,uX,Rz,Rz,fX,dX,hX,mX,pX,Mz,_X,gX,yX,xX,bX,TX,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],_0=class{constructor(t){mat.forEach(n=>this[n]=t[n])}};var CX="File format is not recognized",xat="End of central directory not found",bat="End of Zip64 central directory locator not found",Tat="Central directory header not found",Cat="Local file header not found",Aat="Zip64 extra field not found",Eat="File contains encrypted entry",Sat="Encryption method not supported",Tge="Compression method not supported",Cge="Split zip file",Age="utf-8",Ege="cp437",vat=[[cX,4294967295],[lX,4294967295],[uX,4294967295],[Rz,65535]],wat={[65535]:{getValue:ys,bytes:4},[4294967295]:{getValue:Lz,bytes:8}},Vz=class{constructor(t,n={}){Object.assign(this,{reader:Pz(t),options:n,config:_D()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await $m(i),(i.size===_i||!i.readUint8Array)&&(i=new G_(await new Response(i.readable).blob()),await $m(i)),i.size<22)throw new Error(CX);i.chunkSize=lz(o);let r=await Oat(i,101010256,i.size,22,65535*16);if(!r){let L=await qa(i,0,4),g=wa(L);throw ys(g)==134695760?new Error(Cge):new Error(xat)}let s=wa(r),a=ys(s,12),c=ys(s,16),u=r.offset,f=va(s,20),d=u+22+f,p=va(s,4),_=i.lastDiskNumber||0,m=va(s,6),y=va(s,8),x=0,b=0;if(c==4294967295||a==4294967295||y==65535||m==65535){let L=await qa(i,r.offset-20,20),g=wa(L);if(ys(g,0)==117853008){c=Lz(g,8);let E=await qa(i,c,56,-1),v=wa(E),I=r.offset-20-56;if(ys(v,0)!=101075792&&c!=I){let N=c;c=I,x=c-N,E=await qa(i,c,56,-1),v=wa(E)}if(ys(v,0)!=101075792)throw new Error(bat);p==65535&&(p=ys(v,16)),m==65535&&(m=ys(v,20)),y==65535&&(y=Lz(v,32)),a==4294967295&&(a=Lz(v,40)),c-=a}}if(c>=i.size&&(x=i.size-c-a-22,c=i.size-a-22),_!=p)throw new Error(Cge);if(c<0)throw new Error(CX);let T=0,C=await qa(i,c,a,m),A=wa(C);if(a){let L=r.offset-a;if(ys(A,T)!=33639248&&c!=L){let g=c;c=L,x+=c-g,C=await qa(i,c,a,m),A=wa(C)}}let S=r.offset-c-(i.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,C=await qa(i,c,a,m),A=wa(C)),c<0||c>=i.size)throw new Error(CX);let w=pl(n,t,"filenameEncoding"),R=pl(n,t,"commentEncoding");for(let L=0;L<y;L++){let g=new EX(i,o,n.options);if(ys(A,T)!=33639248)throw new Error(Tat);vge(g,A,T+6);let E=!!g.bitFlag.languageEncodingFlag,v=T+46,I=v+g.filenameLength,N=I+g.extraFieldLength,F=va(A,T+4),U=F>>8==0,k=F>>8==3,z=C.subarray(v,I),B=va(A,T+32),j=N+B,W=C.subarray(N,j),J=E,Y=E,ee=ys(A,T+38),Q=U&&(xS(A,T+38)&16)==16||k&&(ee>>16&61440)==16384||z.length&&z[z.length-1]==Kb.charCodeAt(0),de=k&&(ee>>16&73)!=0,ge=ys(A,T+42)+x;Object.assign(g,{versionMadeBy:F,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:B,directory:Q,offset:ge,diskNumberStart:va(A,T+34),internalFileAttributes:va(A,T+36),externalFileAttributes:ee,rawFilename:z,filenameUTF8:J,commentUTF8:Y,rawExtraField:C.subarray(I,N),executable:de}),g.internalFileAttribute=g.internalFileAttributes,g.externalFileAttribute=g.externalFileAttributes;let le=pl(n,t,"decodeText")||SD,ye=J?Age:w||Ege,be=Y?Age:R||Ege,Ie=le(z,ye);Ie===_i&&(Ie=SD(z,ye));let Te=le(W,be);Te===_i&&(Te=SD(W,be)),Object.assign(g,{rawComment:W,filename:Ie,comment:Te,directory:Q||Ie.endsWith(Kb)}),b=Math.max(ge,b),wge(g,g,A,T+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let ve=new _0(g);ve.getData=(Ke,Ct)=>g.getData(Ke,ve,Ct),T=j;let{onprogress:Ve}=t;if(Ve)try{await Ve(L+1,y,new _0(g))}catch{}yield ve}let D=pl(n,t,"extractPrependedData"),M=pl(n,t,"extractAppendedData");return D&&(n.prependedData=b>0?await qa(i,0,b):new Uint8Array),n.comment=f?await qa(i,u+22,f):new Uint8Array,M&&(n.appendedData=d<i.size?await qa(i,d,i.size-d):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var EX=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:u,config:f,bitFlag:d,signature:p,rawLastModDate:_,uncompressedSize:m,compressedSize:y}=o,x=n.localDirectory={},b=await qa(r,s,30,a),T=wa(b),C=pl(o,i,"password"),A=pl(o,i,"rawPassword"),S=pl(o,i,"passThrough");if(C=C&&C.length&&C,A=A&&A.length&&A,c&&c.originalCompressionMethod!=99)throw new Error(Tge);if(u!=0&&u!=8&&!S)throw new Error(Tge);if(ys(T,0)!=67324752)throw new Error(Cat);vge(x,T,4),x.rawExtraField=x.extraFieldLength?await qa(r,s+30+x.filenameLength,x.extraFieldLength,a):new Uint8Array,wge(o,x,T,4,!0),Object.assign(n,{lastAccessDate:x.lastAccessDate,creationDate:x.creationDate});let w=o.encrypted&&x.encrypted&&!S,R=w&&!c;if(S||(n.zipCrypto=R),w){if(!R&&c.strength===_i)throw new Error(Sat);if(!C&&!A)throw new Error(Eat)}let D=s+30+x.filenameLength+x.extraFieldLength,M=y,L=r.readable;Object.assign(L,{diskNumberStart:a,offset:D,size:M});let g=pl(o,i,"signal"),E=pl(o,i,"checkPasswordOnly");E&&(t=new WritableStream),t=Dz(t),await $m(t,S?y:m);let{writable:v}=t,{onstart:I,onprogress:N,onend:F}=i,U={options:{codecType:Tz,password:C,rawPassword:A,zipCrypto:R,encryptionStrength:c&&c.strength,signed:pl(o,i,"checkSignature")&&!S,passwordVerification:R&&(d.dataDescriptor?_>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!S,encrypted:o.encrypted&&!S,useWebWorkers:pl(o,i,"useWebWorkers"),useCompressionStream:pl(o,i,"useCompressionStream"),transferStreams:pl(o,i,"transferStreams"),checkPasswordOnly:E},config:f,streamOptions:{signal:g,size:M,onstart:I,onprogress:N,onend:F}},k=0;try{({outputSize:k}=await Az({readable:L,writable:v},U))}catch(z){if(!E||z.message!=H_)throw z}finally{let z=pl(o,i,"preventClose");v.size+=k,!z&&!v.locked&&await v.getWriter().close()}return E?_i:t.getData?t.getData():v}};function vge(e,t,n){let i=e.rawBitFlag=va(t,n+2),o=(i&1)==1,r=ys(t,n+6);Object.assign(e,{encrypted:o,version:va(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Mat(r),filenameLength:va(t,n+22),extraFieldLength:va(t,n+24)})}function wge(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=wa(new Uint8Array(r)),c=0;try{for(;c<r.length;){let b=va(a,c),T=va(a,c+2);s.set(b,{type:b,data:r.slice(c+4,c+4+T)}),c+=4+T}}catch{}let u=va(n,i+4);Object.assign(t,{signature:ys(n,i+10),uncompressedSize:ys(n,i+18),compressedSize:ys(n,i+14)});let f=s.get(1);f&&(Iat(f,t),t.extraFieldZip64=f);let d=s.get(28789);d&&(Sge(d,oX,rX,t,e),t.extraFieldUnicodePath=d);let p=s.get(25461);p&&(Sge(p,sX,aX,t,e),t.extraFieldUnicodeComment=p);let _=s.get(39169);_?(Pat(_,t,u),t.extraFieldAES=_):t.compressionMethod=u;let m=s.get(10);m&&(Dat(m,t),t.extraFieldNTFS=m);let y=s.get(21589);y&&(Rat(y,t,o),t.extraFieldExtendedTimestamp=y);let x=s.get(6534);x&&(t.extraFieldUSDZ=x)}function Iat(e,t){t.zip64=!0;let n=wa(e.data),i=vat.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=wat[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Aat)}}function Sge(e,t,n,i,o){let r=wa(e.data),s=new V_;s.append(o[n]);let a=wa(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=ys(r,1);Object.assign(e,{version:xS(r,0),[t]:SD(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==ys(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Pat(e,t,n){let i=wa(e.data),o=xS(i,4);Object.assign(e,{vendorVersion:xS(i,0),vendorId:xS(i,2),strength:o,originalCompressionMethod:n,compressionMethod:va(i,5)}),t.compressionMethod=e.compressionMethod}function Dat(e,t){let n=wa(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=va(n,i),s=va(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=wa(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=AX(s),f=AX(a),d=AX(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Rat(e,t,n){let i=wa(e.data),o=xS(i,0),r=[],s=[];n?((o&1)==1&&(r.push(yS),s.push(Oz)),(o&2)==2&&(r.push(vD),s.push(xge)),(o&4)==4&&(r.push(wD),s.push(bge))):e.data.length>=5&&(r.push(yS),s.push(Oz));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=ys(i,a);t[c]=e[c]=new Date(f*1e3);let d=s[u];e[d]=f}a+=4})}async function Oat(e,t,n,i,o){let r=new Uint8Array(4),s=wa(r);Lat(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await qa(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function pl(e,t,n){return t[n]===_i?e.options[n]:t[n]}function Mat(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 AX(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function xS(e,t){return e.getUint8(t)}function va(e,t){return e.getUint16(t,!0)}function ys(e,t){return e.getUint32(t,!0)}function Lz(e,t){return Number(e.getBigUint64(t,!0))}function Lat(e,t,n){e.setUint32(t,n,!0)}function wa(e){return new DataView(e.buffer)}var kat="File already exists",Uat="Zip file comment exceeds 64KB",zat="File entry comment exceeds 64KB",Vat="File entry name exceeds 64KB",Dge="Version exceeds 65535",Hat="The strength must equal 1, 2, or 3",Gat="Extra field type exceeds 65535",jat="Extra field data exceeds 64KB",VX="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Wat="Undefined uncompressed size",Rge=new Uint8Array([7,0,2,0,65,69,3,0,0]),kX=0,Oge=[],Wz=class{constructor(t,n={}){t=Dz(t);let i=t.availableSize!==_i&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==_i&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:_D(),files:new Map,filenames:new Set,offset:n.offset===_i?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;kX<s.maxWorkers?kX++:await new Promise(c=>Oge.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(kat);return o.filenames.add(t),a=qat(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Oge.shift();c?c():kX--}}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 tct(this,t,n),Xi(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function qat(e,t,n,i){t=t.trim();let o=Xi(e,i,pX),r=Xi(e,i,yX,o?20:768),s=Xi(e,i,TX);if(r>65535)throw new Error(Dge);let a=Xi(e,i,mX,0);a===0&&(a=Xi(e,i,hX,0)),!i.directory&&t.endsWith(Kb)&&(i.directory=!0),Xi(e,i,bX)?(t.endsWith(Kb)||(t+=Kb),a===0&&(a=16,o||(a|=16877<<16))):!o&&a===0&&(s?a=493<<16:a=420<<16);let u=Xi(e,i,"encodeText",hS),f=u(t);if(f===_i&&(f=hS(t)),$i(f)>65535)throw new Error(Vat);let d=i.comment||"",p=u(d);if(p===_i&&(p=hS(d)),$i(p)>65535)throw new Error(zat);let _=Xi(e,i,gX,20);if(_>65535)throw new Error(Dge);let m=Xi(e,i,yS,new Date),y=Xi(e,i,vD),x=Xi(e,i,wD),b=Xi(e,i,dX,0);b===0&&(b=Xi(e,i,fX,0));let T=Xi(e,i,"passThrough"),C,A;T||(C=Xi(e,i,"password"),A=Xi(e,i,"rawPassword"));let S=Xi(e,i,"encryptionStrength",3),w=Xi(e,i,xX),R=Xi(e,i,"extendedTimestamp",!0),D=Xi(e,i,"keepOrder",!0),M=Xi(e,i,"level"),L=Xi(e,i,"useWebWorkers"),g=Xi(e,i,"bufferedWrite"),E=Xi(e,i,"dataDescriptorSignature",!1),v=Xi(e,i,"signal"),I=Xi(e,i,"useUnicodeFileNames",!0),N=Xi(e,i,"useCompressionStream"),F=Xi(e,i,"compressionMethod"),U=Xi(e,i,"dataDescriptor",!0),k=Xi(e,i,Mz);if(!w&&(C!==_i||A!==_i)&&!(S>=1&&S<=3))throw new Error(Hat);let z=new Uint8Array,{extraField:B}=i;if(B){let Qe=0,hn=0;B.forEach(Nt=>Qe+=4+$i(Nt)),z=new Uint8Array(Qe),B.forEach((Nt,Rt)=>{if(Rt>65535)throw new Error(Gat);if($i(Nt)>65535)throw new Error(jat);Fs(z,new Uint16Array([Rt]),hn),Fs(z,new Uint16Array([$i(Nt)]),hn+2),Fs(z,Nt,hn+4),hn+=4+$i(Nt)})}let j=0,W=0,J=0;if(T&&({uncompressedSize:J}=i,J===_i))throw new Error(Wat);let Y=k===!0;n&&(n=Pz(n),await $m(n),T?j=Mge(J):n.size===_i?(U=!0,(k||k===_i)&&(k=!0,J=j=4294967296)):(J=n.size,j=Mge(J)));let{diskOffset:ee,diskNumber:Q,maxSize:de}=e.writer,ge=Y||J>4294967295,le=Y||j>4294967295,ye=Y||e.offset+e.pendingEntriesSize-ee>4294967295,Ie=Xi(e,i,"supportZip64SplitFile",!0)&&Y||Q+Math.ceil(e.pendingEntriesSize/de)>65535;if(ye||ge||le||Ie){if(k===!1||!D)throw new Error(VX);k=!0}k=k||!1;let Te=Xi(e,i,_X),{signature:ve}=i;i=Object.assign({},i,{rawFilename:f,rawComment:p,version:_,versionMadeBy:r,lastModDate:m,lastAccessDate:y,creationDate:x,rawExtraField:z,zip64:k,zip64UncompressedSize:ge,zip64CompressedSize:le,zip64Offset:ye,zip64DiskNumberStart:Ie,password:C,rawPassword:A,level:!N&&e.config.CompressionStream===_i&&e.config.CompressionStreamNative===_i?0:M,useWebWorkers:L,encryptionStrength:S,extendedTimestamp:R,zipCrypto:w,bufferedWrite:g,keepOrder:D,useUnicodeFileNames:I,dataDescriptor:U,dataDescriptorSignature:E,signal:v,msDosCompatible:o,internalFileAttribute:b,internalFileAttributes:b,externalFileAttribute:a,externalFileAttributes:a,useCompressionStream:N,passThrough:T,encrypted:!!(C&&$i(C)||A&&$i(A))||T&&Te,signature:ve,compressionMethod:F});let Ve=Kat(i),Ke=Zat(i),Ct=$i(Ve.localHeaderArray,Ke.dataDescriptorArray);W=Ct+j,e.options.usdz&&(W+=W+64),e.pendingEntriesSize+=W;let Qt;try{Qt=await Yat(e,t,n,{headerInfo:Ve,dataDescriptorInfo:Ke,metadataSize:Ct},i)}finally{e.pendingEntriesSize-=W}return Object.assign(Qt,{name:t,comment:d,extraField:B}),new _0(Qt)}async function Yat(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:d}=e.options,p=Array.from(r.values()).pop(),_={},m,y,x,b,T,C,A;r.set(t,_);try{let D;a&&(D=p&&p.lock,S()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!d?(C=new TransformStream,A=new Response(C.readable).blob(),C.writable.size=0,m=!0,e.bufferedWrites++,await $m(s)):(C=s,await w()),await $m(C);let{writable:M}=s,{diskOffset:L}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let E=new Uint8Array(4),v=Ya(E);Ki(v,0,134695760),await Zm(M,E),e.offset+=4}d&&$at(i,e.offset-L),m||(await D,await R(M));let{diskNumber:g}=s;if(T=!0,_.diskNumberStart=g,_=await Xat(n,C,_,i,e.config,o),T=!1,r.set(t,_),_.filename=t,m){await C.writable.getWriter().close();let E=await A;await D,await w(),b=!0,c||(E=await Jat(_,E,M,o)),await R(M),_.diskNumberStart=s.diskNumber,L=s.diskOffset,await E.stream().pipeTo(M,{preventClose:!0,preventAbort:!0,signal:u}),M.size+=E.size,b=!1}if(_.offset=e.offset-L,_.zip64)ect(_,o);else if(_.offset>4294967295)throw new Error(VX);return e.offset+=_.size,_}catch(D){if(m&&b||!m&&T){if(e.hasCorruptedEntries=!0,D)try{D.corruptedEntry=!0}catch{}m?e.offset+=C.writable.size:e.offset=C.writable.size}throw r.delete(t),D}finally{m&&e.bufferedWrites--,x&&x(),y&&y()}function S(){_.lock=new Promise(D=>x=D)}async function w(){e.writerLocked=!0;let{lockWriter:D}=e;e.lockWriter=new Promise(M=>y=()=>{e.writerLocked=!1,M()}),await D}async function R(D){$i(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Zm(D,new Uint8Array))}}async function Xat(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:d,lastModDate:p,rawLastModDate:_,encrypted:m,compressed:y,version:x,compressionMethod:b,rawExtraFieldExtendedTimestamp:T,extraFieldExtendedTimestampFlag:C,rawExtraFieldNTFS:A,rawExtraFieldAES:S}=a,{dataDescriptorArray:w}=c,{rawFilename:R,lastAccessDate:D,creationDate:M,password:L,rawPassword:g,level:E,zip64:v,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:F,zip64DiskNumberStart:U,zipCrypto:k,dataDescriptor:z,directory:B,executable:j,versionMadeBy:W,rawComment:J,rawExtraField:Y,useWebWorkers:ee,onstart:Q,onprogress:de,onend:ge,signal:le,encryptionStrength:ye,extendedTimestamp:be,msDosCompatible:Ie,internalFileAttributes:Te,externalFileAttributes:ve,useCompressionStream:Ve,passThrough:Ke}=s,Ct={lock:i,versionMadeBy:W,zip64:v,directory:!!B,executable:!!j,filenameUTF8:!0,rawFilename:R,commentUTF8:!0,rawComment:J,rawExtraFieldExtendedTimestamp:T,rawExtraFieldNTFS:A,rawExtraFieldAES:S,rawExtraField:Y,extendedTimestamp:be,msDosCompatible:Ie,internalFileAttributes:Te,externalFileAttributes:ve,diskNumberStart:n},{signature:Qt,uncompressedSize:Qe}=s,hn=0;Ke||(Qe=0);let{writable:Nt}=t;if(e){e.chunkSize=lz(r),await Zm(Nt,f);let Zn=e.readable,gi=Zn.size=e.size,Ht={options:{codecType:bz,level:E,rawPassword:g,password:L,encryptionStrength:ye,zipCrypto:m&&k,passwordVerification:m&&k&&_>>8&255,signed:!Ke,compressed:y&&!Ke,encrypted:m&&!Ke,useWebWorkers:ee,useCompressionStream:Ve,transferStreams:!1},config:r,streamOptions:{signal:le,size:gi,onstart:Q,onprogress:de,onend:ge}},wt=await Az({readable:Zn,writable:Nt},Ht);hn=wt.outputSize,Ke||(Qe=wt.inputSize,Qt=wt.signature),Nt.size+=Qe}else await Zm(Nt,f);let Rt;if(v){let Zn=4;I&&(Zn+=8),N&&(Zn+=8),F&&(Zn+=8),U&&(Zn+=4),Rt=new Uint8Array(Zn)}else Rt=new Uint8Array;return Qat({signature:Qt,rawExtraFieldZip64:Rt,compressedSize:hn,uncompressedSize:Qe,headerInfo:a,dataDescriptorInfo:c},s),z&&await Zm(Nt,w),Object.assign(Ct,{uncompressedSize:Qe,compressedSize:hn,lastModDate:p,rawLastModDate:_,creationDate:M,lastAccessDate:D,encrypted:m,zipCrypto:k,size:u+hn,compressionMethod:b,version:x,headerArray:d,signature:Qt,rawExtraFieldZip64:Rt,extraFieldExtendedTimestampFlag:C,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:F,zip64DiskNumberStart:U}),Ct}function Kat(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:_,encrypted:m}=e,{version:y,compressionMethod:x}=e,b=!f&&(r>0||r===_i&&x!==0),T;if(m&&!a){T=new Uint8Array($i(Rge)+2);let F=Ya(T);so(F,0,39169),Fs(T,Rge,2),zX(F,8,p)}else T=new Uint8Array;let C,A,S;if(_){A=new Uint8Array(9+(i?4:0)+(o?4:0));let F=Ya(A);so(F,0,21589),so(F,2,$i(A)-4),S=1+(i?2:0)+(o?4:0),zX(F,4,S);let U=5;Ki(F,U,Math.floor(n.getTime()/1e3)),U+=4,i&&(Ki(F,U,Math.floor(i.getTime()/1e3)),U+=4),o&&Ki(F,U,Math.floor(o.getTime()/1e3));try{C=new Uint8Array(36);let k=Ya(C),z=UX(n);so(k,0,10),so(k,2,32),so(k,8,1),so(k,10,24),iu(k,12,z),iu(k,20,UX(i)||z),iu(k,28,UX(o)||z)}catch{C=new Uint8Array}}else C=A=new Uint8Array;let w=0;c&&(w=w|2048),u&&(w=w|8),x===_i&&(x=b?8:0),x==8&&(r>=1&&r<3&&(w=w|6),r>=3&&r<5&&(w=w|1),r===9&&(w=w|2)),s&&(y=y>45?y:45),m&&(w=w|1,a||(y=y>51?y:51,T[9]=x,x=99));let R=new Uint8Array(26),D=Ya(R);so(D,0,y),so(D,2,w),so(D,4,x);let M=new Uint32Array(1),L=Ya(M),g;n<jY?g=jY:n>GY?g=GY:g=n,so(L,0,(g.getHours()<<6|g.getMinutes())<<5|g.getSeconds()/2),so(L,2,(g.getFullYear()-1980<<4|g.getMonth()+1)<<5|g.getDate());let E=M[0];Ki(D,6,E),so(D,22,$i(t));let v=$i(T,A,C,d);so(D,24,v);let I=new Uint8Array(30+$i(t)+v),N=Ya(I);return Ki(N,0,67324752),Fs(I,R,4),Fs(I,t,30),Fs(I,T,30+$i(t)),Fs(I,A,30+$i(t,T)),Fs(I,C,30+$i(t,T,A)),Fs(I,d,30+$i(t,T,A,C)),{localHeaderArray:I,headerArray:R,headerView:D,lastModDate:n,rawLastModDate:E,encrypted:m,compressed:b,version:y,compressionMethod:x,extraFieldExtendedTimestampFlag:S,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:C,rawExtraFieldAES:T,extraFieldLength:v}}function $at(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ya(i),s=64-(t+$i(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ya(a);so(c,0,6534),so(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array($i(u)+s),Fs(i,u),Fs(i,a,$i(u)),r=Ya(i),so(r,28,o+s),e.metadataSize+=s}function Zat(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=Ya(o),i&&(s=4,Ki(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Qat(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:d}=a,{zip64:p,zip64UncompressedSize:_,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:x}=t;if((!u||y)&&n!==_i&&(Ki(c,10,n),x&&Ki(f,d,n)),p){let b=Ya(i);so(b,0,1),so(b,2,$i(i)-4);let T=4;_&&(Ki(c,18,4294967295),iu(b,T,BigInt(r)),T+=8),m&&(Ki(c,14,4294967295),iu(b,T,BigInt(o))),x&&(iu(f,d+4,BigInt(o)),iu(f,d+12,BigInt(r)))}else Ki(c,14,o),Ki(c,18,r),x&&(Ki(f,d+4,o),Ki(f,d+8,r))}async function Jat(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)&&Ki(r,14,e.signature),e.zip64?(Ki(r,18,4294967295),Ki(r,22,4294967295)):(Ki(r,18,e.compressedSize),Ki(r,22,e.uncompressedSize)),await Zm(n,new Uint8Array(o)),t.slice(o.byteLength)}function ect(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=Ya(n),f=4;r&&(f+=8),s&&(f+=8),a&&(iu(u,f,BigInt(i)),f+=8),c&&Ki(u,f,o)}async function tct(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,d=i.size;for(let[,S]of i){let{rawFilename:w,rawExtraFieldZip64:R,rawExtraFieldAES:D,rawComment:M,rawExtraFieldNTFS:L,rawExtraField:g,extendedTimestamp:E,extraFieldExtendedTimestampFlag:v,lastModDate:I}=S,N;if(E){N=new Uint8Array(9);let F=Ya(N);so(F,0,21589),so(F,2,5),zX(F,4,v),Ki(F,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;S.rawExtraFieldCDExtendedTimestamp=N,u+=46+$i(w,M,R,D,L,N,g)}let p=new Uint8Array(u),_=Ya(p);await $m(o);let m=0;for(let[S,w]of Array.from(i.values()).entries()){let{offset:R,rawFilename:D,rawExtraFieldZip64:M,rawExtraFieldAES:L,rawExtraFieldCDExtendedTimestamp:g,rawExtraFieldNTFS:E,rawExtraField:v,rawComment:I,versionMadeBy:N,headerArray:F,zip64:U,zip64UncompressedSize:k,zip64CompressedSize:z,zip64DiskNumberStart:B,zip64Offset:j,internalFileAttributes:W,externalFileAttributes:J,diskNumberStart:Y,uncompressedSize:ee,compressedSize:Q}=w,de=$i(M,L,g,E,v);Ki(_,c,33639248),so(_,c+4,N);let ge=Ya(F);k||Ki(ge,18,ee),z||Ki(ge,14,Q),Fs(p,F,c+6),so(_,c+30,de),so(_,c+32,$i(I)),so(_,c+34,U&&B?65535:Y),so(_,c+36,W),J&&Ki(_,c+38,J),Ki(_,c+42,U&&j?4294967295:R),Fs(p,D,c+46),Fs(p,M,c+46+$i(D)),Fs(p,L,c+46+$i(D,M)),Fs(p,g,c+46+$i(D,M,L)),Fs(p,E,c+46+$i(D,M,L,g)),Fs(p,v,c+46+$i(D,M,L,g,E)),Fs(p,I,c+46+$i(D)+de);let le=46+$i(D,I)+de;if(c-m>o.availableSize&&(o.availableSize=0,await Zm(s,p.slice(m,c)),m=c),c+=le,n.onprogress)try{await n.onprogress(S+1,i.size,new _0(w))}catch{}}await Zm(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:x}=o;x<22&&y++;let b=Xi(e,n,Mz);if(f>4294967295||u>4294967295||d>65535||y>65535){if(b===!1)throw new Error(VX);b=!0}let T=new Uint8Array(b?98:22),C=Ya(T);c=0,b&&(Ki(C,0,101075792),iu(C,4,BigInt(44)),so(C,12,45),so(C,14,45),Ki(C,16,y),Ki(C,20,a),iu(C,24,BigInt(d)),iu(C,32,BigInt(d)),iu(C,40,BigInt(u)),iu(C,48,BigInt(f)),Ki(C,56,117853008),iu(C,64,BigInt(f)+BigInt(u)),Ki(C,72,y+1),Xi(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),d=65535,f=4294967295,u=4294967295,c+=76),Ki(C,c,101010256),so(C,c+4,y),so(C,c+6,a),so(C,c+8,d),so(C,c+10,d),Ki(C,c+12,u),Ki(C,c+16,f);let A=$i(t);if(A)if(A<=65535)so(C,c+20,A);else throw new Error(Uat);await Zm(s,T),A&&await Zm(s,t)}async function Zm(e,t){let n=e.getWriter();try{await n.ready,e.size+=$i(t),await n.write(t)}finally{n.releaseLock()}}function UX(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function Xi(e,t,n,i){let o=t[n]===_i?e.options[n]:t[n];return o===_i?i:o}function Mge(e){return e+5*(Math.floor(e/16383)+1)}function zX(e,t,n){e.setUint8(t,n)}function so(e,t,n){e.setUint16(t,n,!0)}function Ki(e,t,n){e.setUint32(t,n,!0)}function iu(e,t,n){e.setBigUint64(t,n,!0)}function Fs(e,t,n){e.set(t,n)}function Ya(e){return new DataView(e.buffer)}function $i(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}dS({Deflate:g_e,Inflate:U_e});var HX=32,nct="http://www.opengis.net/kml/2.2",Ah="http://www.google.com/kml/ext/2.2",ict="http://www.w3.org/2000/xmlns/";function qz(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var oct=/^data:image\/([^,;]+)/;qz.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ee){if(e=Ee.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(oct);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 rct(e,t){return function(n){e._files[t]=n}}qz.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new se("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(rct(this,r))}return o};Object.defineProperties(qz.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function Yz(e){this._time=e}Yz.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};Yz.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return Jb(n)};Yz.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function GX(){this._ids={},this._styles={},this._count=0}GX.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};GX.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 Bge(){this._ids={}}Bge.prototype.get=function(e){if(!l(e))return this.get(Nn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function jX(e){e=e??G.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=jX._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(ict,"xmlns:gx",Ah);let a=r.createElement("Document");s.appendChild(a),Uge(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?sct(f,c.files):{kml:f,externalFiles:c.files}})}function sct(e,t){let n=on("ThirdParty/Workers/z-worker-pako.js");dS({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new ED,o=new Wz(i);return o.add("doc.kml",new vz(e)).then(function(){let r=Object.keys(t);return kge(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function kge(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new G_(n[o])).then(function(){return kge(e,t,n,i+1)})}jX._createState=function(e){let t=e.entities,n=new GX,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new Sn:$.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&$.addSeconds(r.start,10*s,r.stop);let a=new qz(e.modelCallback);return{kmlDoc:document.implementation.createDocument(nct,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new Bge,styleCache:n,externalFileHandler:a,time:o,valueGetter:new Yz(o),sampleDuration:s,defaultAvailability:new is([r])}};function Uge(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],act(e,p,u,f),cct(e,p.polyline,u,f),Fge(e,p.rectangle,u,f,c),Fge(e,p.polygon,u,f,c),dct(e,p,p.model,u,f);let _,m=p.availability;l(m)&&(_=i.createElement("TimeSpan"),$.equals(m.start,Ge.MINIMUM_VALUE)||_.appendChild(dn(i,"begin",$.toIso8601(m.start))),$.equals(m.stop,Ge.MAXIMUM_VALUE)||_.appendChild(dn(i,"end",$.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let T=c[b];T.setAttribute("id",s.get(p.id)),T.appendChild(dn(i,"name",p.name)),T.appendChild(dn(i,"visibility",p.show)),T.appendChild(dn(i,"description",p.description)),l(_)&&T.appendChild(_),t.appendChild(T)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let T=p.name,C=p.label;if(l(C)){let S=i.createElement("LabelStyle"),w=r.get(C.text);T=l(w)&&w.length>0?w:T;let R=r.getColor(C.fillColor);l(R)&&(S.appendChild(dn(i,"color",R)),S.appendChild(dn(i,"colorMode","normal")));let D=r.get(C.scale);l(D)&&S.appendChild(dn(i,"scale",D)),f.push(S)}b.appendChild(dn(i,"name",T)),b.appendChild(dn(i,"visibility",p.show)),b.appendChild(dn(i,"description",p.description)),l(_)&&b.appendChild(_),t.appendChild(b);let A=f.length;if(A>0){let S=i.createElement("Style");for(let w=0;w<A;++w)S.appendChild(f[w]);b.appendChild(dn(i,"styleUrl",o.get(S)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let w=0;w<y;++w)S.appendChild(u[w]);b.appendChild(S)}}let x=p._children;if(x.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(dn(i,"name",p.name)),b.appendChild(dn(i,"visibility",p.show)),b.appendChild(dn(i,"description",p.description)),t.appendChild(b),Uge(e,b,x)}}}var ou=new h,_l=new fe,Ch=new $;function act(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){zge(e,t,a,n,i);return}s.get(c,void 0,ou);let u=dn(o,"coordinates",Qb(ou,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(eT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof jc?Hge(e,a):Vge(e,a);i.push(p)}function zge(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Ga?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Fg,p,_,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),T=f?u:b.data,C=r.createElement("altitudeMode");T instanceof U_?(T=T._value,C.appendChild(eT(e,$e.CLAMP_TO_GROUND))):l(n)?C.appendChild(eT(e,n.heightReference)):C.appendChild(eT(e,$e.NONE));let A=[],S=[];if(T.isConstant){a.get(T,void 0,ou);let R=dn(r,"coordinates",Qb(ou,s));A.push($.toIso8601(b.start)),S.push(R),A.push($.toIso8601(b.stop)),S.push(R)}else if(T instanceof ja)for(m=T._property._times,_=0;_<m.length;++_)A.push($.toIso8601(m[_])),T.getValueInReferenceFrame(m[_],Wi.FIXED,ou),S.push(Qb(ou,s));else if(T instanceof od){m=T._times;let R=T._values;for(_=0;_<m.length;++_)A.push($.toIso8601(m[_])),h.fromArray(R,_*3,ou),S.push(Qb(ou,s))}else{let R=e.sampleDuration;b.start.clone(Ch),b.isStartIncluded||$.addSeconds(Ch,R,Ch);let D=b.stop;for(;$.lessThan(Ch,D);)T.getValue(Ch,ou),A.push($.toIso8601(Ch)),S.push(Qb(ou,s)),$.addSeconds(Ch,R,Ch);b.isStopIncluded&&$.equals(Ch,D)&&(T.getValue(Ch,ou),A.push($.toIso8601(Ch)),S.push(Qb(ou,s)))}let w=r.createElementNS(Ah,"Track");w.appendChild(C);for(let R=0;R<A.length;++R){let D=dn(r,"when",A[R]),M=dn(r,"coord",S[R],Ah);w.appendChild(D),w.appendChild(M)}d&&w.appendChild(Gge(e,n)),y.push(w)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=r.createElementNS(Ah,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof jc?Hge(e,n):Vge(e,n);o.push(b)}let x=t.path;if(l(x)){let b=a.get(x.width),T=x.material;if(l(T)||l(b)){let C=r.createElement("LineStyle");l(b)&&C.appendChild(dn(r,"width",b)),WX(e,T,C),o.push(C)}}}function Vge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(dn(n,"color",r)),o.appendChild(dn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(dn(n,"scale",s/HX)),o}function Hge(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(dn(n,"href",s));let _=i.get(t.imageSubRegion);l(_)&&(p.appendChild(dn(n,"x",_.x,Ah)),p.appendChild(dn(n,"y",_.y,Ah)),p.appendChild(dn(n,"w",_.width,Ah)),p.appendChild(dn(n,"h",_.height,Ah))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(dn(n,"color",a)),r.appendChild(dn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(dn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,V.divideByScalar(u,c,u);let p=i.get(t.width,HX),_=i.get(t.height,HX),m=i.get(t.horizontalOrigin,Ei.CENTER);m===Ei.CENTER?u.x-=p*.5:m===Ei.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Bn.CENTER);y===Bn.TOP?u.y+=_:y===Bn.CENTER&&(u.y+=_*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-u.x),x.setAttribute("y",u.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),r.appendChild(x)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(dn(n,"heading",f))),r}function cct(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(dn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),_=dn(o,"coordinates",Qb(p,r));a.appendChild(_);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(dn(o,"drawOrder",m,Ah)),n.push(a);let y=o.createElement("LineStyle"),x=s.get(t.width);l(x)&&y.appendChild(dn(o,"width",x)),WX(e,t.material,y),i.push(y)}function lct(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[ae.northeast,ae.southeast,ae.southwest,ae.northwest];for(let _=0;_<4;++_)u[_](a,_l),c.push(`${P.toDegrees(_l.longitude)},${P.toDegrees(_l.latitude)},${r}`);let f=dn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Nge(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,_l),s.push(`${P.toDegrees(_l.longitude)},${P.toDegrees(_l.latitude)},${i?_l.height:n}`);let c=dn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function uct(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Nge(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let _=p.length;for(let m=0;m<_;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(Nge(e,p[m].positions,r,s)),a.push(y)}}return a}function Fge(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof um;if(a&&s.getMaterialType(t.material)==="Image"){fct(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(dn(r,"extrude",!0));let f=a?lct(e,t,u):uct(e,t,u),d=f.length;for(let x=0;x<d;++x)c.appendChild(f[x]);let p=r.createElement("altitudeMode");p.appendChild(eT(e,t.heightReference)),c.appendChild(p),n.push(c);let _=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&_.appendChild(dn(r,"fill",m)),WX(e,t.material,_);let y=s.get(t.outline,!1);if(y){_.appendChild(dn(r,"outline",y));let x=r.createElement("LineStyle"),b=s.get(t.outlineWidth,1);x.appendChild(dn(r,"width",b));let T=s.getColor(t.outlineColor,H.BLACK);x.appendChild(dn(r,"color",T)),x.appendChild(dn(r,"colorMode","normal")),i.push(x)}i.push(_)}function fct(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(eT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(dn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(dn(i,"north",P.toDegrees(u.north))),f.appendChild(dn(i,"south",P.toDegrees(u.south))),f.appendChild(dn(i,"east",P.toDegrees(u.east))),f.appendChild(dn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),_=i.createElement("Icon");_.appendChild(dn(i,"href",p)),s.appendChild(_);let m=d.color;l(m)&&s.appendChild(dn(i,"color",Jb(d.color))),n.push(s)}function Gge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(dn(n,"x",s)),u.appendChild(dn(n,"y",s)),u.appendChild(dn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(dn(n,"href",c)),r.appendChild(a),r}function dct(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){zge(e,t,n,i,o);return}let u=Gge(e,n),f=r.createElement("altitudeMode");f.appendChild(eT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,ou),fe.fromCartesian(ou,s,_l);let d=r.createElement("Location");d.appendChild(dn(r,"longitude",P.toDegrees(_l.longitude))),d.appendChild(dn(r,"latitude",P.toDegrees(_l.latitude))),d.appendChild(dn(r,"altitude",_l.height)),u.appendChild(d),i.push(u)}function WX(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=Jb(H.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=Jb(r.color);break;case"PolylineOutline":s=Jb(r.color),c=Jb(r.outlineColor),u=r.outlineWidth,n.appendChild(dn(i,"outerColor",c,Ah)),n.appendChild(dn(i,"outerWidth",u,Ah));break;case"Stripe":s=Jb(r.oddColor);break}l(s)&&(n.appendChild(dn(i,"color",s)),n.appendChild(dn(i,"colorMode","normal")))}function eT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,$e.NONE),r;switch(o){case $e.NONE:r=n.createTextNode("absolute");break;case $e.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case $e.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function Qb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,_l),i.push(`${P.toDegrees(_l.longitude)},${P.toDegrees(_l.latitude)},${_l.height}`);return i.join(" ")}function dn(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 Jb(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 jge=jX;function RD(){this._cache={}}RD.prototype.fromColor=function(e,t){return Xz(void 0,void 0,e,t,this._cache)};RD.prototype.fromUrl=function(e,t,n){return Xz(e,void 0,t,n,this._cache)};RD.prototype.fromMakiIconId=function(e,t,n){return Xz(on(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};RD.prototype.fromText=function(e,t,n){return Xz(void 0,e,t,n,this._cache)};var hct=new H;function mct(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,hct).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Wge(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=H.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=H.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var DD=new Array(4);function Xz(e,t,n,i,o){DD[0]=e,DD[1]=t,DD[2]=n,DD[3]=i;let r=JSON.stringify(DD),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(mct(c,n,i),l(e)){let f=Ee.createIfNeeded(e).fetchImage().then(function(d){return Wge(c,d,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=ZA(t,{font:`bold ${i}px sans-serif`});Wge(c,u,i)}return o[r]=a,a}var g0=RD;function qX(e){return e}function Kz(e){if(e==null)return qX;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 u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+r,d[1]=(n+=a[1])*o+s;u<f;)d[u]=a[u],++u;return d}}function qge(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function YX(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Yge(e,n)})}:Yge(e,t)}function Yge(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=XX(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 XX(e,t){var n=Kz(e.transform),i=e.arcs;function o(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],_=0,m=p.length;_<m;++_)d.push(n(p[_],_));f<0&&qge(d,m)}function r(f){return n(f)}function s(f){for(var d=[],p=0,_=f.length;p<_;++p)o(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function $z(e){return h.fromDegrees(e[0],e[1],e[2])}var KX={"urn:ogc:def:crs:OGC:1.3:CRS84":$z,"EPSG:4326":$z,"urn:ogc:def:crs:EPSG::4326":$z},Xge={},Kge={},$X=48,ZX,QX=H.ROYALBLUE,JX=H.YELLOW,eK=2,tK=H.fromBytes(255,255,0,100),nK=!1,xct={small:24,medium:48,large:64},bct=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function $ge(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||bct.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${$ge(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 Tct(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Cct(e,t){return new fm(Tct($ge,e,t),!0)}function Zz(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Nn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Qn(c):n(r,s))}return o}function iK(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Zge={Feature:Jge,FeatureCollection:Act,GeometryCollection:eye,LineString:rye,MultiLineString:sye,MultiPoint:iye,MultiPolygon:lye,Point:nye,Polygon:cye,Topology:uye},Qge={GeometryCollection:eye,LineString:rye,MultiLineString:sye,MultiPoint:iye,MultiPolygon:lye,Point:nye,Polygon:cye,Topology:uye};function Jge(e,t,n,i,o){if(t.geometry===null){Zz(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new se("feature.geometry is required.");let r=t.geometry.type,s=Qge[r];if(!l(s))throw new se(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Act(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Jge(e,r[s],void 0,i,o)}function eye(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=Qge[u];if(!l(f))throw new se(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function tye(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let _=c["marker-color"];l(_)&&(s=H.fromCssColorString(_)),a=xct[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new jc;f.verticalOrigin=new Qn(Bn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=$e.CLAMP_TO_GROUND);let d=Zz(t,e._entityCollection,o.describe);d.billboard=f,d.position=new kl(n(i));let p=Promise.resolve(u).then(function(_){f.image=new Qn(_)}).catch(function(){f.image=new Qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function nye(e,t,n,i,o){tye(e,t,i,n.coordinates,o)}function iye(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)tye(e,t,i,r[s],o)}function oye(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Qn(f));let d,p=a.stroke;l(p)&&(d=H.fromCssColorString(p));let _=a["stroke-opacity"];l(_)&&_!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=_),l(d)&&(r=new Wt(d))}let c=Zz(t,e._entityCollection,o.describe),u=new Kc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Qn(iK(i,n)),u.arcType=nn.RHUMB}function rye(e,t,n,i,o){oye(e,t,i,n.coordinates,o)}function sye(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)oye(e,t,i,r[s],o)}function aye(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 _=c["stroke-width"];l(_)&&(a=new Qn(_));let m,y=c.stroke;l(y)&&(m=H.fromCssColorString(y));let x=c["stroke-opacity"];l(x)&&x!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=x),l(m)&&(r=new Qn(m));let b,T=c.fill,C=s.color.getValue();l(T)&&(b=H.fromCssColorString(T),b.alpha=C.alpha),x=c["fill-opacity"],l(x)&&x!==C.alpha&&(l(b)||(b=C.clone()),b.alpha=x),l(b)&&(s=new Wt(b))}let u=new lm;u.outline=new Qn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=nn.RHUMB;let f=[];for(let _=1,m=i.length;_<m;_++)f.push(new gc(iK(i[_],n)));let d=i[0];u.hierarchy=new Qn(new gc(iK(d,n),f)),d[0].length>2?u.perPositionHeight=new Qn(!0):o.clampToGround||(u.height=0);let p=Zz(t,e._entityCollection,o.describe);p.polygon=u}function cye(e,t,n,i,o){aye(e,t,i,n.coordinates,o)}function lye(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)aye(e,t,i,r[s],o)}function uye(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=YX(n,n.objects[r]),a=Zge[s.type];a(e,s,s,i,o)}}function y0(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new Ca(this),this._promises=[],this._pinBuilder=new g0,this._entityCluster=new td,this._credit=void 0,this._resourceCredits=[]}y0.load=function(e,t){return new y0().load(e,t)};Object.defineProperties(y0,{markerSize:{get:function(){return $X},set:function(e){$X=e}},markerSymbol:{get:function(){return ZX},set:function(e){ZX=e}},markerColor:{get:function(){return QX},set:function(e){QX=e}},stroke:{get:function(){return JX},set:function(e){JX=e}},strokeWidth:{get:function(){return eK},set:function(e){eK=e}},fill:{get:function(){return tK},set:function(e){tK=e}},clampToGround:{get:function(){return nK},set:function(e){nK=e}},crsNames:{get:function(){return KX}},crsLinkHrefs:{get:function(){return Xge}},crsLinkTypes:{get:function(){return Kge}}});Object.defineProperties(y0.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}}});y0.prototype.load=function(e,t){return fye(this,e,t,!0)};y0.prototype.process=function(e,t){return fye(this,e,t,!1)};function fye(e,t,n,i){os.setLoading(e,!0),n=n??G.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new _t(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??Cct,markerSize:n.markerSize??$X,markerSymbol:n.markerSymbol??ZX,markerColor:n.markerColor??QX,strokeWidthProperty:new Qn(n.strokeWidth??eK),strokeMaterialProperty:new Wt(n.stroke??JX),fillMaterialProperty:new Wt(n.fill??tK),clampToGround:n.clampToGround??nK},Promise.resolve(r).then(function(a){return Ect(e,a,n,s,i)}).catch(function(a){throw os.setLoading(e,!1),e._error.raiseEvent(e,a),a})}y0.prototype.update=function(e){return!0};function Ect(e,t,n,i,o){let r;l(i)&&(r=Wy(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Zge[t.type];if(!l(s))throw new se(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?$z:null;if(l(a)){if(!l(a.properties))throw new se("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=KX[u.name],!l(c))throw new se(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Xge[u.href];if(l(f)||(f=Kge[u.type]),!l(f))throw new se(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=KX[`EPSG:${u.code}`],!l(c))throw new se(`Unknown crs EPSG code: ${u.code}`)}else throw new se(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,os.setLoading(e,!1),e})})}var tT=y0;function Sct(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var On=Sct;var oK=function(e,t){return oK=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])},oK(e,t)};function Qm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");oK(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var xs=function(){return xs=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},xs.apply(this,arguments)};function dye(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function hye(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var mye="4.1.5";var pye=Object.prototype.hasOwnProperty;function Vu(e){return typeof e=="boolean"}function _ye(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 x0(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Eh(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Qz=/\s+/,Jz=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Qz):[],o=t.split(Qz),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(Qz):[],o=t.split(Qz),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)pye.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function yye(e,t,n){var i,o;if(n==null?(n="…",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=vct(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=gye(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=gye(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):rK(c,r,n).substr(0,r+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=r){if((c+u).length==t)return(c+u).substr(0,t);var f=r-c.length;return(c+rK(u,f,n)).substr(0,r+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var p=r-c.length;return(c+rK(d,p,n)).substr(0,r+i)}else c+=d}if(s.scheme&&s.host){var _=s.scheme+"://";if((c+_).length<r)return(_+c).substr(0,t)}if(c.length<=t)return c;var m="";return r>0&&(m=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+m).substr(0,r+i)}function vct(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function gye(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function rK(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}function xye(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)}function bye(e,t,n){return _ye(e,t,n)}var Tye=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 Jz({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,o=n.location;return o==="smart"?yye(t,i):o==="middle"?xye(t,i):bye(t,i)},e}();var Jm=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}();function Cye(e){return e>=0&&e<=31||e==127}function j_(e){return e>=65&&e<=90||e>=97&&e<=122}function bs(e){return e>=48&&e<=57}function eV(e){return e==34||e==39}function b0(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function Sh(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function Aye(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function Eye(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function tV(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function Sye(e){return e<91?e==40:e==91||e==123}function sK(e){return e<93?e==41:e==93||e==125}var vye=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var aK=/https?:\/\//i,wye=new RegExp("^"+aK.source,"i"),wct=/^(javascript|vbscript):/i,Ict=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,Pct=/^(?:\/\/)?([^/#?:]+)/,bS=j_;function cK(e){return j_(e)||bs(e)||e===43||e===45||e===46}var W_=Sh;function nV(e){return e===95||W_(e)}function lK(e){return Sh(e)||Eye(e)||tV(e)}function iV(e){return e===47||e===63||e===35}function uK(e){return vye.test(e.toLowerCase())}function Iye(e){if(wct.test(e))return!1;var t=e.match(Ict);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function Pye(e){var t=e.match(Pct);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!uK(o)}var Dct=/^(?:(?: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]?)$/,Rct=/[:/?#]/;function Dye(e){var t=e.split(Rct,1)[0];return Dct.test(t)}var Oct=/^(https?:\/\/)?(?:www\.)?/i,Mct=/^\/\//,Rye=function(e){Qm(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=Fct(n)),this.stripPrefix.scheme&&(n=Lct(n)),this.stripPrefix.www&&(n=Nct(n)),this.stripTrailingSlash&&(n=Bct(n)),this.decodePercentEncoding&&(n=kct(n)),n},t}(Jm);function Lct(e){return e.replace(wye,"")}function Nct(e){return e.includes("www.")?e.replace(Oct,"$1"):e}function Fct(e){return e.replace(Mct,"")}function Bct(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function kct(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var Oye=/^mailto:/i,fK=Sh;function oV(e){return fK(e)||Aye(e)}function Mye(e){var t=e.split(".").pop();return uK(t)}var Lye=function(e){Qm(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}(Jm);function dK(e){return e===95||Sh(e)}function Nye(e){return e.length<=140}var Fye=["twitter","facebook","instagram","tiktok","youtube"];var Bye=function(e){Qm(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:Eh(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}(Jm);var Uct={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function hK(e){return e===45||e===46||e===95||j_(e)||bs(e)}function kye(e,t){var n=Uct[t];return n.test(e)}var Uye=["twitter","instagram","soundcloud","tiktok","youtube"];var zye=function(e){Qm(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:Eh(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}(Jm);var zct=/[-. ()]/,Vct=/(?:(?:(?:(\+)?\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]+#?)*/,Hct=/(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})/,Gct=new RegExp("^".concat(Vct.source,"|").concat(Hct.source,"$"));function mK(e){return e===45||e===46||e===32}function rV(e){return e===44||e===59}function Vye(e){var t=e.charAt(0)==="+"||zct.test(e);return t&&Gct.test(e)}var Hye=function(e){Qm(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}(Jm);var jct=function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),jye(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),jye(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e}();function Wye(e,t){for(var n=new jct(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)sV(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:$ct(n,s,o);break;case 12:Zct(n,s,o);break;case 0:Wct(n,s,o);break;case 1:qct(n,s,o);break;case 2:Yct(n,s,o);break;case 3:Xct(n,s,o);break;case 4:Kct(n,s,i,o);break;case 5:Qct(n,s,o);break;case 6:Jct(n,s,i,o);break;case 7:elt(n,s,i,o);break;case 13:tlt(n,s,o);break;case 14:nlt(n,s,o);break;case 8:ilt(n,s,o);break;case 9:olt(n,s,o);break;case 10:rlt(n,s,o);break;case 15:slt(n,s,i,o);break;case 16:alt(n,s,i,o);break;case 17:clt(n,s,i,o);break;case 18:llt(n,s,i,o);break;case 19:ult(n,s,i,o);break;case 20:flt(n,s,o);break;case 21:dlt(n,s,o);break;case 22:nT(n,s,o);break;case 23:hlt(n,s,o);break;case 24:mlt(n,s,o);break;case 25:plt(n,s,o);break;case 26:_lt(n,s,o);break;case 27:glt(n,s,o);break;case 28:ylt(n,s,o);break;case 29:xlt(n,s,o);break;case 30:blt(n,s,o);break;case 31:Tlt(n,s,o);break;case 32:Alt(n,s,i,o);break;case 33:Elt(n,s,o);break;case 34:Slt(n,s,o);break;case 35:vlt(n,s,o);break;case 36:wlt(n,s,i,o);break;case 37:Clt(n,s,i,o);break;case 38:Ilt(n,s,i,o);break;case 39:Plt(n,s,i,o);break;case 40:Dlt(n,s,o);break;case 41:Rlt(n,s,o);break;default:Eh(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&bS(o)){var a=n.text.charCodeAt(n.charIdx-1);bS(a)||n.addMachine(aV(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Yr(n,u)});return n.matches}function sV(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(Flt(i,28));else if(n===64)e.addMachine(Blt(i,30));else if(n===47)e.addMachine(_K(i,11));else if(n===43)e.addMachine(pK(i,37));else if(n===40)e.addMachine(pK(i,32));else{if(bs(n)&&(e.addMachine(pK(i,38)),e.addMachine(Llt(i,13))),fK(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(Nlt(i,o))}bS(n)&&e.addMachine(aV(i,0)),Sh(n)&&e.addMachine(_K(i,5))}}function Wct(e,t,n){n===58?t.state=2:n===45?t.state=1:cK(n)||e.removeMachine(t)}function qct(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(_K(i,11))):cK(n)?t.state=0:e.removeMachine(t))}function Yct(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):W_(n)?(t.state=5,bS(n)&&e.addMachine(aV(i,0))):e.removeMachine(t)}function Xct(e,t,n){n===47?t.state=4:lK(n)?(t.state=10,t.acceptStateReached=!0):Yr(e,t)}function Kct(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):W_(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function $ct(e,t,n){n===47?t.state=12:e.removeMachine(t)}function Zct(e,t,n){W_(n)?t.state=5:e.removeMachine(t)}function Qct(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:iV(n)?t.state=10:nV(n)||Yr(e,t)}function Jct(e,t,n,i){i===45||(i===46?Yr(e,t):W_(i)?t.state=5:Yr(e,t))}function elt(e,t,n,i){i===46?Yr(e,t):W_(i)?(t.state=5,t.acceptStateReached=!0):Yr(e,t)}function tlt(e,t,n){n===46?t.state=14:n===58?t.state=8:bs(n)||(iV(n)?t.state=10:Sh(n)?e.removeMachine(t):Yr(e,t))}function nlt(e,t,n){bs(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Yr(e,t)}function ilt(e,t,n){bs(n)?t.state=9:Yr(e,t)}function olt(e,t,n){bs(n)||(iV(n)?t.state=10:Yr(e,t))}function rlt(e,t,n){lK(n)||Yr(e,t)}function slt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:nT(e,t,i)}function alt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:nT(e,t,i)}function clt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:nT(e,t,i)}function llt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:nT(e,t,i)}function ult(e,t,n,i){n.toLowerCase()==="o"?t.state=20:nT(e,t,i)}function flt(e,t,n){n===58?t.state=21:nT(e,t,n)}function dlt(e,t,n){oV(n)?t.state=22:e.removeMachine(t)}function nT(e,t,n){n===46?t.state=23:n===64?t.state=24:oV(n)?t.state=22:e.removeMachine(t)}function hlt(e,t,n){n===46||n===64?e.removeMachine(t):oV(n)?t.state=22:e.removeMachine(t)}function mlt(e,t,n){W_(n)?t.state=25:e.removeMachine(t)}function plt(e,t,n){n===46?t.state=27:n===45?t.state=26:nV(n)||Yr(e,t)}function _lt(e,t,n){n===45||n===46?Yr(e,t):nV(n)?t.state=25:Yr(e,t)}function glt(e,t,n){n===46||n===45?Yr(e,t):W_(n)?(t.state=25,t.acceptStateReached=!0):Yr(e,t)}function ylt(e,t,n){dK(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function xlt(e,t,n){dK(n)||Yr(e,t)}function blt(e,t,n){hK(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function Tlt(e,t,n){hK(n)||(Sh(n)?e.removeMachine(t):Yr(e,t))}function Clt(e,t,n,i){bs(i)?t.state=38:(e.removeMachine(t),sV(e,n,i))}function Alt(e,t,n,i){bs(i)?t.state=33:e.removeMachine(t),sV(e,n,i)}function Elt(e,t,n){bs(n)?t.state=34:e.removeMachine(t)}function Slt(e,t,n){bs(n)?t.state=35:e.removeMachine(t)}function vlt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function wlt(e,t,n,i){bs(i)?t.state=38:mK(i)?t.state=39:e.removeMachine(t)}function Ilt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,rV(i)?t.state=40:i===35?t.state=41:bs(i)||(i===40?t.state=32:mK(i)?t.state=39:(Yr(e,t),bS(i)&&e.addMachine(aV(o,0))))}function Plt(e,t,n,i){bs(i)?t.state=38:i===40?t.state=32:(Yr(e,t),sV(e,n,i))}function Dlt(e,t,n){rV(n)||(n===35?t.state=41:bs(n)?t.state=38:Yr(e,t))}function Rlt(e,t,n){rV(n)?t.state=40:bs(n)?e.removeMachine(t):Yr(e,t)}function Yr(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,o);switch(p=Mlt(p),t.type){case 0:{var _=i.charCodeAt(t.startIdx-1);if(_===64)return;switch(t.matchType){case 0:{var m=aK.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!Iye(p))return;break}case 1:{if(!Pye(p))return;break}case 2:{if(!Dye(p))return;break}default:Eh(t)}n.push(new Rye({tagBuilder:r,matchedText:p,offset:d,urlMatchType:Olt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{Mye(p)&&n.push(new Lye({tagBuilder:r,matchedText:p,offset:d,email:p.replace(Oye,"")}));break}case 2:{Nye(p)&&n.push(new Bye({tagBuilder:r,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{kye(p,f)&&n.push(new zye({tagBuilder:r,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),Vye(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new Hye({tagBuilder:r,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:Eh(t)}}}function Olt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:Eh(e)}}var Gye={")":"(","}":"{","]":"["};function Mlt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);Sye(o)?t[i]++:sK(o)&&t[Gye[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(sK(o)){var s=Gye[i];if(t[s]<0)t[s]++,r--;else break}else if(tV(o))r--;else break}return e.slice(0,r+1)}function aV(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function _K(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function Llt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function Nlt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function Flt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function Blt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function pK(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function jye(e){return e.type===0&&e.matchType===0}var ep=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}(),yK=new ep,klt=function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=yK,this.html=t,this.callbacks=n}return e}();function qye(e,t){for(var n=new klt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:Ult(n,o);break;case 1:zlt(n,o,r);break;case 2:Hlt(n,o,r);break;case 3:Vlt(n,o,r);break;case 4:Glt(n,o,r);break;case 5:jlt(n,o,r);break;case 6:Wlt(n,o,r);break;case 7:qlt(n,o,r);break;case 8:Ylt(n,o);break;case 9:Xlt(n,o);break;case 10:Klt(n,o,r);break;case 11:$lt(n,o,r);break;case 12:Zlt(n,o);break;case 13:Qlt(n);break;case 14:Jlt(n,o);break;case 15:eut(n,o);break;case 16:tut(n,o);break;case 17:nut(n,o);break;case 18:iut(n,o);break;case 19:out(n,o);break;case 20:rut(n,o);break;default:Eh(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&sut(n)}function Ult(e,t){t==="<"&&tp(e)}function zlt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new ep(xs(xs({},e.currentTag),{isClosing:!0}))):t==="<"?tp(e):j_(n)?(e.state=3,e.currentTag=new ep(xs(xs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=yK)}function Vlt(e,t,n){b0(n)?(e.currentTag=new ep(xs(xs({},e.currentTag),{name:gK(e)})),e.state=4):t==="<"?tp(e):t==="/"?(e.currentTag=new ep(xs(xs({},e.currentTag),{name:gK(e)})),e.state=12):t===">"?(e.currentTag=new ep(xs(xs({},e.currentTag),{name:gK(e)})),np(e)):!j_(n)&&!bs(n)&&t!==":"&&fd(e)}function Hlt(e,t,n){t===">"?fd(e):j_(n)?e.state=3:fd(e)}function Glt(e,t,n){b0(n)||(t==="/"?e.state=12:t===">"?np(e):t==="<"?tp(e):t==="="||eV(n)||Cye(n)?fd(e):e.state=5)}function jlt(e,t,n){b0(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?np(e):t==="<"?tp(e):eV(n)&&fd(e)}function Wlt(e,t,n){b0(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?np(e):t==="<"?tp(e):eV(n)?fd(e):e.state=5)}function qlt(e,t,n){b0(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?fd(e):t==="<"?tp(e):e.state=10)}function Ylt(e,t){t==='"'&&(e.state=11)}function Xlt(e,t){t==="'"&&(e.state=11)}function Klt(e,t,n){b0(n)?e.state=4:t===">"?np(e):t==="<"&&tp(e)}function $lt(e,t,n){b0(n)?e.state=4:t==="/"?e.state=12:t===">"?np(e):t==="<"?tp(e):(e.state=4,aut(e))}function Zlt(e,t){t===">"?(e.currentTag=new ep(xs(xs({},e.currentTag),{isClosing:!0})),np(e)):fd(e)}function Qlt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new ep(xs(xs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new ep(xs(xs({},e.currentTag),{type:"doctype"})),e.state=20):fd(e)}function Jlt(e,t){t==="-"?e.state=15:t===">"?fd(e):e.state=16}function eut(e,t){t==="-"?e.state=18:t===">"?fd(e):e.state=16}function tut(e,t){t==="-"&&(e.state=17)}function nut(e,t){t==="-"?e.state=18:e.state=16}function iut(e,t){t===">"?np(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function out(e,t){t==="-"?e.state=17:t===">"?np(e):e.state=16}function rut(e,t){t===">"?np(e):t==="<"&&tp(e)}function fd(e){e.state=0,e.currentTag=yK}function tp(e){e.state=1,e.currentTag=new ep({idx:e.charIdx})}function np(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),fd(e),e.currentDataIdx=e.charIdx+1}function sut(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function gK(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function aut(e){e.charIdx--}var cut=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=lut(t.urls),this.email=Vu(t.email)?t.email:this.email,this.phone=Vu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Vu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=uut(t.stripPrefix),this.stripTrailingSlash=Vu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Vu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Uye.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Fye.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=fut(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 qye(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var _=n.parseText(d,f);r.push.apply(r,hye([],dye(_),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(dut);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||x0(t,function(n){return n.getType()==="hashtag"}),this.email||x0(t,function(n){return n.getType()==="email"}),this.phone||x0(t,function(n){return n.getType()==="phone"}),this.mention||x0(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||x0(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||x0(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||x0(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=Wye(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=new Array(n.length*2+1),o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof Jz)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Tye({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=mye,e}(),Yye=cut;function lut(e){return e==null&&(e=!0),Vu(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Vu(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Vu(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Vu(e.ipV4Matches)?e.ipV4Matches:!0}}function uut(e){return e==null&&(e=!0),Vu(e)?{scheme:e,www:e}:{scheme:Vu(e.scheme)?e.scheme:!0,www:Vu(e.www)?e.www:!0}}function fut(e){return typeof e=="number"?{length:e,location:"end"}:xs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function dut(e,t){return e.getOffset()-t.getOffset()}var cV=Yye;var n0e;typeof DOMParser<"u"&&(n0e=new DOMParser);var hut=new cV({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),lV=32,Xye=2414016,Kye=1,$ye=16093e3,Zye=.1,mut=[null,void 0,"http://www.topografix.com/GPX/1/1"],Io={gpx:mut};function put(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 xK(e,t){let n=LD(e,"id");return n=l(n)?n:Nn(),t.getOrCreateEntity(n)}function bK(e){let t=Qye(e,"lon"),n=Qye(e,"lat"),i=OD(e,"ele",Io.gpx);return h.fromDegrees(t,n,i)}function Qye(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 LD(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function T0(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 TK(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 OD(e,t,n){let i=T0(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function ru(e,t,n){let i=T0(e,t,n);if(l(i))return i.textContent.trim()}function i0e(e){let t=new jc;return t.width=lV,t.height=lV,t.scaleByDistance=new Vt(Xye,Kye,$ye,Zye),t.pixelOffsetScaleByDistance=new Vt(Xye,Kye,$ye,Zye),t.verticalOrigin=new Qn(Bn.BOTTOM),t.image=e,t}function _ut(){let e=new cm;return e.translucencyByDistance=new Vt(3e6,1,5e6,0),e.pixelOffset=new V(17,0),e.horizontalOrigin=Ei.LEFT,e.font="16px sans-serif",e.style=tr.FILL_AND_OUTLINE,e}function o0e(e){let t=new Kc;return t.width=4,t.material=new Mb,t.material.color=l(e)?e:H.RED,t.material.outlineWidth=2,t.material.outlineColor=H.BLACK,t}var Jye={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"}},MD;typeof document<"u"&&(MD=document.createElement("div"));function CK(e,t){let n,i="",o=Object.keys(Jye),r=o.length;for(n=0;n<r;n++){let f=o[n],d=Jye[f];d.value=ru(e,d.tag,Io.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=hut.link(i),MD.innerHTML=i;let s=MD.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=H.WHITE,c=H.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${MD.innerHTML}</div>`,MD.innerHTML="",u}function r0e(e,t,n,i){let o=bK(t),r=xK(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,lV);r.billboard=i0e(s);let a=ru(t,"name",Io.gpx);r.name=a,r.label=_ut(),r.label.text=a,r.description=CK(t,r),i.clampToGround&&(r.billboard.heightReference=$e.CLAMP_TO_GROUND,r.label.heightReference=$e.CLAMP_TO_GROUND)}function gut(e,t,n,i){let o=xK(t,n);o.description=CK(t,o);let r=TK(t,"rtept",Io.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)r0e(e,r[a],n,i),s[a]=bK(r[a]);o.polyline=o0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function yut(e,t,n,i){let o=xK(t,n);o.description=CK(t,o);let r=TK(t,"trkseg",Io.gpx),s=[],a=[],c,u=!0,f=new ja;for(let d=0;d<r.length;d++)c=xut(r[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,lV);o.billboard=i0e(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=$e.CLAMP_TO_GROUND),o.availability=new is,o.availability.addInterval(new Sn({start:a[0],stop:a[a.length-1]}))}o.polyline=o0e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function xut(e){let t={positions:[],times:[]},n=TK(e,"trkpt",Io.gpx),i;for(let o=0;o<n.length;o++){let r=bK(n[o]);t.positions.push(r),i=ru(n[o],"time",Io.gpx),l(i)&&t.times.push($.fromIso8601(i))}return t}function but(e){let t=T0(e,"metadata",Io.gpx);if(l(t)){let n={name:ru(t,"name",Io.gpx),desc:ru(t,"desc",Io.gpx),author:Tut(t),copyright:Aut(t),link:s0e(t),time:ru(t,"time",Io.gpx),keywords:ru(t,"keywords",Io.gpx),bounds:Eut(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 Tut(e){let t=T0(e,"author",Io.gpx);if(l(t)){let n={name:ru(t,"name",Io.gpx),email:Cut(t),link:s0e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Cut(e){let t=T0(e,"email",Io.gpx);if(l(t)){let n=ru(t,"id",Io.gpx),i=ru(t,"domain",Io.gpx);return`${n}@${i}`}}function s0e(e){let t=T0(e,"link",Io.gpx);if(l(t)){let n={href:LD(t,"href"),text:ru(t,"text",Io.gpx),mimeType:ru(t,"type",Io.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Aut(e){let t=T0(e,"copyright",Io.gpx);if(l(t)){let n={author:LD(t,"author"),year:ru(t,"year",Io.gpx),license:ru(t,"license",Io.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Eut(e){let t=T0(e,"bounds",Io.gpx);if(l(t)){let n={minLat:OD(t,"minlat",Io.gpx),maxLat:OD(t,"maxlat",Io.gpx),minLon:OD(t,"minlon",Io.gpx),maxLon:OD(t,"maxlon",Io.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var e0e={wpt:r0e,rte:gut,trk:yut};function Sut(e,t,n,i){let o=Object.keys(e0e),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e0e[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Io.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function t0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=LD(o,"version"),s=LD(o,"creator"),a,c=but(o);l(c)&&(a=c.name),o.localName==="gpx"?Sut(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,_=$.equals(d,Ge.MINIMUM_VALUE),m=$.equals(p,Ge.MAXIMUM_VALUE);if(!_||!m){let x;_&&(x=new Date,x.setHours(0,0,0,0),d=$.fromDate(x)),m&&(x=new Date,x.setHours(24,0,0,0),p=$.fromDate(x)),u=new km,u.startTime=d,u.stopTime=p,u.currentTime=$.clone(d),u.clockRange=rs.LOOP_STOP,u.clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max($.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),vut(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),os.setLoading(e,!1),e}function vut(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 wut(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Ee){n=Ee.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?put(r).then(function(s){let a,c;try{a=n0e.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new se(u)}return t0e(e,a,i)}):t0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function TS(){this._changed=new me,this._error=new me,this._loading=new me,this._clock=void 0,this._entityCollection=new Ca(this),this._entityCluster=new td,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new g0}TS.load=function(e,t){return new TS().load(e,t)};Object.defineProperties(TS.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}}});TS.prototype.update=function(e){return!0};TS.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=t??G.EMPTY_OBJECT,os.setLoading(this,!0);let n=this._name,i=this;return wut(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=$.equals(s,Ge.MINIMUM_VALUE),u=$.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=$.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=$.fromDate(d)),o=new km,o.startTime=s,o.stopTime=a,o.currentTime=$.clone(s),o.clockRange=rs.LOOP_STOP,o.clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max($.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),os.setLoading(i,!1),i}).catch(function(o){return os.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var uV=TS;function Iut(e,t){this.position=e,this.headingPitchRoll=t}var fV=Iut;var FD=$r(pu(),1);function Put(e,t){this.position=e,this.headingPitchRange=t}var dV=Put;function hV(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new me,this.tourEnd=new me,this.entryStart=new me,this.entryEnd=new me,this._activeEntries=[]}hV.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};hV.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;c0e.call(this,e,t,function(i){n.playlistIndex=0,i||a0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};hV.prototype.stop=function(){a0e(this._activeEntries)};function a0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function c0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Dut.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 Dut(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++,c0e.call(this,e,t,n)}}var mV=hV;var Oi=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-Oi.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?Oi.Bounce.In(e*2)*.5:Oi.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}}}}),ND=function(){return performance.now()},Rut=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=ND()),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}(),CS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=CS.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=CS.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=CS.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=CS.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}}},l0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),AK=new Rut,u0e=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=Oi.Linear.None,this._interpolationFunction=CS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=l0e.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=AK,AK.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=ND()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],_=0,m=d.length;_<m;_+=1){var y=this._handleRelativeValue(a,d[_]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var x=a;for(var b in x)n[s][b]=x[b];o[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var T={};for(var b in d)T[b]=d[b];i[s]=d=T}this._setupProperties(x,n[s],d,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=ND()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=ND()),!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=Oi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=CS.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=ND()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),x=s-y*a,b=Math.min(x/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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 _=0,m=this._chainedTweens.length;_<m;_++)this._chainedTweens[_].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Yfi=l0e.nextId,ip=AK,Xfi=ip.getAll.bind(ip),Kfi=ip.removeAll.bind(ip),$fi=ip.add.bind(ip),Zfi=ip.remove.bind(ip),Qfi=ip.update.bind(ip);var Out={LINEAR_NONE:Oi.Linear.None,QUADRATIC_IN:Oi.Quadratic.In,QUADRATIC_OUT:Oi.Quadratic.Out,QUADRATIC_IN_OUT:Oi.Quadratic.InOut,CUBIC_IN:Oi.Cubic.In,CUBIC_OUT:Oi.Cubic.Out,CUBIC_IN_OUT:Oi.Cubic.InOut,QUARTIC_IN:Oi.Quartic.In,QUARTIC_OUT:Oi.Quartic.Out,QUARTIC_IN_OUT:Oi.Quartic.InOut,QUINTIC_IN:Oi.Quintic.In,QUINTIC_OUT:Oi.Quintic.Out,QUINTIC_IN_OUT:Oi.Quintic.InOut,SINUSOIDAL_IN:Oi.Sinusoidal.In,SINUSOIDAL_OUT:Oi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Oi.Sinusoidal.InOut,EXPONENTIAL_IN:Oi.Exponential.In,EXPONENTIAL_OUT:Oi.Exponential.Out,EXPONENTIAL_IN_OUT:Oi.Exponential.InOut,CIRCULAR_IN:Oi.Circular.In,CIRCULAR_OUT:Oi.Circular.Out,CIRCULAR_IN_OUT:Oi.Circular.InOut,ELASTIC_IN:Oi.Elastic.In,ELASTIC_OUT:Oi.Elastic.Out,ELASTIC_IN_OUT:Oi.Elastic.InOut,BACK_IN:Oi.Back.In,BACK_OUT:Oi.Back.Out,BACK_IN_OUT:Oi.Back.InOut,BOUNCE_IN:Oi.Bounce.In,BOUNCE_OUT:Oi.Bounce.Out,BOUNCE_IN_OUT:Oi.Bounce.InOut},as=Object.freeze(Out);function pV(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}pV.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 re(this.view.position);t.flyToBoundingSphere(o,i)}};pV.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};pV.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=as.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=ct(t,e)),t};var _V=pV;function EK(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}EK.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};EK.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var gV=EK;var b0e={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=uC(t),b0e[t]}},RK;typeof DOMParser<"u"&&(RK=new DOMParser);var Mut=new cV({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),C0=32,f0e=2414016,d0e=1,h0e=16093e3,m0e=.1,p0e=[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"],_0e=["http://www.google.com/kml/ext/2.2"],Lut=["http://www.w3.org/2005/Atom"],Me={kml:p0e,gx:_0e,atom:Lut,kmlgx:p0e.concat(_0e)},OK={Document:D0e,Folder:Jut,Placemark:eft,NetworkLink:lft,GroundOverlay:sft,PhotoOverlay:M0e,ScreenOverlay:rft,Tour:nft};function op(e){this._dataSource=e,this._deferred=la(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(op.prototype,{dataSource:{get:function(){return this._dataSource}}});op.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};op.prototype.addPromise=function(e){this._promises.push(e)};op.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};op.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=ju._getTimestamp()),this._process(e)};op.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=ju._getTimestamp(),e._process(!0)},0)};op.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]};op.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};op.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=OK[i.localName];if(l(o)&&(Me.kml.indexOf(i.namespaceURI)!==-1||Me.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||ju._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Nut(e){let t=e.slice(0,Math.min(4,e.size)),n=la(),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 Fut(e){let t=la(),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 T0e(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 C0e(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 But(e,t){return Promise.resolve(e.getData(new wz)).then(function(n){n=T0e(n),n=C0e(n),t.kml=RK.parseFromString(n,"application/xml")})}function SK(e,t){let n=b0e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new Sz(n))).then(function(i){t[e.filename]=i})}function Hu(e,t,n,i){let o=i.keys,r=new FD.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new FD.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let _=o[p];c.setAttribute(n,i[_]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",_)}}}}function Gu(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=MK(a,i);l(c)&&s.setAttribute(n,c.url)}}function A0e(e,t,n){let i=Bs(e,"id");i=l(i)&&i.length!==0?i:Nn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Nn(),l(n)&&(i=n+i)),o=t.add(new hr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new hft),o}function BD(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function TV(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.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,h.fromDegrees(i,o,r,t)}function yV(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++]=TV(n[s],t);return o}function A0(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 Bs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Mi(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 g0e(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 vh(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 ei(e,t,n){let i=Mi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function In(e,t,n){let i=Mi(e,t,n);if(l(i))return i.textContent.trim()}function wh(e,t,n){let i=Mi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function MK(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 Ee({url:o});else{let r=new FD.default(t.getUrlComponent()),s=new FD.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ee({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var su={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function PK(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?(su.maximumRed=r,su.red=void 0):(su.maximumRed=void 0,su.red=0),o>0?(su.maximumGreen=o,su.green=void 0):(su.maximumGreen=void 0,su.green=0),i>0?(su.maximumBlue=i,su.blue=void 0):(su.maximumBlue=void 0,su.blue=0),su.alpha=n,H.fromRandom(su)):new H(r,o,i,n)}function iT(e,t,n){let i=In(e,t,n);if(l(i))return PK(i,In(e,"colorMode",n)==="random")}function kut(e){let t=Mi(e,"TimeStamp",Me.kmlgx),n=In(t,"when",Me.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=$.fromIso8601(n),o=new is;return o.addInterval(new Sn({start:i,stop:Ge.MAXIMUM_VALUE})),o}function Uut(e){let t=Mi(e,"TimeSpan",Me.kmlgx);if(!l(t))return;let n,i=Mi(t,"begin",Me.kmlgx),o=l(i)?$.fromIso8601(i.textContent):void 0,r=Mi(t,"end",Me.kmlgx),s=l(r)?$.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if($.lessThan(s,o)){let a=o;o=s,s=a}n=new is,n.addInterval(new Sn({start:o,stop:s}))}else l(o)?(n=new is,n.addInterval(new Sn({start:o,stop:Ge.MAXIMUM_VALUE}))):l(s)&&(n=new is,n.addInterval(new Sn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function E0e(){let e=new jc;return e.width=C0,e.height=C0,e.scaleByDistance=new Vt(f0e,d0e,h0e,m0e),e.pixelOffsetScaleByDistance=new Vt(f0e,d0e,h0e,m0e),e}function LK(){let e=new lm;return e.outline=!0,e.outlineColor=H.WHITE,e}function S0e(){let e=new cm;return e.translucencyByDistance=new Vt(3e6,1,5e6,0),e.pixelOffset=new V(17,0),e.horizontalOrigin=Ei.LEFT,e.font="16px sans-serif",e.style=tr.FILL_AND_OUTLINE,e}function NK(e,t,n,i,o){let r=In(e,"href",Me.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=ei(e,"x",Me.gx)??0,u=ei(e,"y",Me.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=MK(r,n,i);if(o){let a=In(e,"refreshMode",Me.kml),c=In(e,"viewRefreshMode",Me.kml);a==="onInterval"||a==="onExpire"?Tt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Tt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=In(e,"viewBoundScale",Me.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=In(e,"viewFormat",Me.kml)??f,p=In(e,"httpQuery",Me.kml);l(d)&&s.setQueryParameters(gf(bV(d))),l(p)&&s.setQueryParameters(gf(bV(p)));let _=t._ellipsoid;return BK(s,t.camera,t.canvas,u,t._lastCameraView.bbox,_),s}return s}function zut(e,t,n,i,o){let r=ei(t,"scale",Me.kml),s=ei(t,"heading",Me.kml),a=iT(t,"color",Me.kml),c=Mi(t,"Icon",Me.kml),u=NK(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=ei(c,"x",Me.gx),d=ei(c,"y",Me.gx),p=ei(c,"w",Me.gx),_=ei(c,"h",Me.gx),m=Mi(t,"hotSpot",Me.kml),y=A0(m,"x"),x=A0(m,"y"),b=Bs(m,"xunits"),T=Bs(m,"yunits"),C=n.billboard;l(C)||(C=E0e(),n.billboard=C),C.image=u,C.scale=r,C.color=a,(l(f)||l(d)||l(p)||l(_))&&(C.imageSubRegion=new Xe(f,d,p,_)),l(s)&&s!==0&&(C.rotation=P.toRadians(-s),C.alignedAxis=h.UNIT_Z),r=r??1;let A,S;l(y)&&(b==="pixels"?A=-y*r:b==="insetPixels"?A=(y-C0)*r:b==="fraction"&&(A=-y*C0*r),A+=C0*.5*r),l(x)&&(T==="pixels"?S=x*r:T==="insetPixels"?S=(-x+C0)*r:T==="fraction"&&(S=x*C0*r),S-=C0*.5*r),(l(A)||l(S))&&(C.pixelOffset=new V(A,S))}function xV(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")zut(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=S0e(),n.label=c),c.scale=ei(a,"scale",Me.kml)??c.scale,c.fillColor=iT(a,"color",Me.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Kc,n.polyline=c),c.width=ei(a,"width",Me.kml),c.material=iT(a,"color",Me.kml),l(iT(a,"outerColor",Me.gx))&&Tt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ei(a,"outerWidth",Me.gx))&&Tt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ei(a,"physicalWidth",Me.gx))&&Tt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(wh(a,"labelVisibility",Me.gx))&&Tt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=LK(),n.polygon=c),c.material=iT(a,"color",Me.kml)??c.material,c.fill=wh(a,"fill",Me.kml)??c.fill,c.outline=wh(a,"outline",Me.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=PK(In(a,"bgColor",Me.kml))??H.WHITE,u=PK(In(a,"textColor",Me.kml))??H.BLACK,f=In(a,"text",Me.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=In(a,"listItemType",Me.kml);(c==="radioFolder"||c==="checkOffOnly")&&Tt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Vut(e,t,n,i,o){let r=new hr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")xV(e,d,r,i,o);else{let p=vh(d,"Pair",Me.kml);for(let _=0;_<p.length;_++){let m=p[_],y=In(m,"key",Me.kml);if(y==="normal"){let x=In(m,"styleUrl",Me.kml);if(l(x))s=n.getById(x),l(s)||(s=n.getById(`#${x}`)),l(s)&&r.merge(s);else{let b=Mi(m,"Style",Me.kml);xV(e,b,r,i,o)}}else Tt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=In(t,"styleUrl",Me.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),_=p[0];d=`${i.getDerivedResource({url:_}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&r.merge(s)}return r}function Hut(e,t,n){return t.fetchXML().then(function(i){return v0e(e,i,n,t,!0)})}function v0e(e,t,n,i,o,r){let s,a,c,u,f=g0e(t,"Style",Me.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Bs(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new hr({id:a}),n.add(c),xV(e,u,c,i,r)))}let d=g0e(t,"StyleMap",Me.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let x=d[s];if(a=Bs(x,"id"),l(a)){let b=vh(x,"Pair",Me.kml);for(let T=0;T<b.length;T++){let C=b[T],A=In(C,"key",Me.kml);if(A==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let S=In(C,"styleUrl",Me.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let w=n.getById(S);l(w)&&c.merge(w)}else u=Mi(C,"Style",Me.kml),xV(e,u,c,i,r)}}else Tt(`kml-styleMap-${A}`,`KML - Unsupported StyleMap key: ${A}`)}}}}let p=[],_=t.getElementsByTagName("styleUrl"),m=_.length;for(s=0;s<m;s++){let y=_[s].textContent;if(y[0]!=="#"){let x=y.split("#");if(x.length===2){let b=x[0],T=i.getDerivedResource({url:b});p.push(Hut(e,T,n))}}}return p}function FK(e,t,n){let i=new Xy(e,t.id,["position"]),o=new U_(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Kc,t.polyline.positions=new qy([i,o])}function w0e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?$e.CLAMP_TO_GROUND:e==="relativeToGround"?$e.RELATIVE_TO_GROUND:e==="absolute"?$e.NONE:t==="clampToSeaFloor"?(Tt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),$e.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Tt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),$e.RELATIVE_TO_GROUND):(l(e)?Tt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Tt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),$e.CLAMP_TO_GROUND)}function Gut(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Tt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new U_(e))}function jut(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")&&Tt("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 CV(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():S0e(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():E0e(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(H.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new V(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function I0e(e,t){let n=e.path;l(n)||(n=new Bg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Wut(e,t,n,i,o){let r=In(n,"coordinates",Me.kml),s=In(n,"altitudeMode",Me.kml),a=In(n,"altitudeMode",Me.gx),c=wh(n,"extrude",Me.kml),u=e._ellipsoid,f=TV(r,u);return i.position=f,CV(e,i,o,w0e(s,a)),c&&BD(s,a)&&FK(t,i,o),!0}function y0e(e,t,n,i,o){let r=Mi(n,"coordinates",Me.kml),s=In(n,"altitudeMode",Me.kml),a=In(n,"altitudeMode",Me.gx),c=wh(n,"extrude",Me.kml),u=wh(n,"tessellate",Me.kml),f=BD(s,a),d=ei(n,"drawOrder",Me.gx),p=e._ellipsoid,_=yV(r,p),m=o.polyline;if(f&&c){let y=new kg;i.wall=y,y.positions=_;let x=o.polygon;l(x)&&(y.fill=x.fill,y.material=x.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:H.WHITE,y.outlineWidth=m.width):l(x)&&(y.outlineColor=l(x.material)?x.material.color:H.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Kc;y.clampToGround=!0,i.polyline=y,y.positions=_,l(m)?(y.material=l(m.material)?m.material.color.getValue(Ge.MINIMUM_VALUE):H.WHITE,y.width=m.width??1):(y.material=H.WHITE,y.width=1),y.zIndex=d}else l(d)&&Tt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&Tt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Kc,i.polyline=m,m.positions=jut(_,s,a,p),(!u||f)&&(m.arcType=nn.NONE);return!0}function qut(e,t,n,i,o){let r=Mi(n,"outerBoundaryIs",Me.kml),s=Mi(r,"LinearRing",Me.kml),a=Mi(s,"coordinates",Me.kml),c=e._ellipsoid,u=yV(a,c),f=wh(n,"extrude",Me.kml),d=In(n,"altitudeMode",Me.kml),p=In(n,"altitudeMode",Me.gx),_=BD(d,p),m=l(o.polygon)?o.polygon.clone():LK(),y=o.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:H.WHITE,m.outlineWidth=y.width),i.polygon=m,_?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let x=new gc(u),b=vh(n,"innerBoundaryIs",Me.kml);for(let T=0;T<b.length;T++){s=vh(b[T],"LinearRing",Me.kml);for(let C=0;C<s.length;C++)a=Mi(s[C],"coordinates",Me.kml),u=yV(a,c),l(u)&&x.holes.push(new gc(u))}m.hierarchy=x}return!0}function Yut(e,t,n,i,o){let r=In(n,"altitudeMode",Me.kml),s=In(n,"altitudeMode",Me.gx),a=vh(n,"coord",Me.gx),c=vh(n,"angles",Me.gx),u=vh(n,"when",Me.kml),f=wh(n,"extrude",Me.kml),d=BD(r,s),p=e._ellipsoid;c.length>0&&Tt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let _=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<_;b++){let T=TV(a[b].textContent,p);m.push(T),y.push($.fromIso8601(u[b].textContent))}let x=new ja;return x.addSamples(y,m),i.position=x,CV(e,i,o,w0e(r,s)),I0e(i,o),i.availability=new is,u.length>0&&i.availability.addInterval(new Sn({start:y[0],stop:y[y.length-1]})),d&&f&&FK(t,i,o),!0}function x0e(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new ja;d.addSamples(e,t),n.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:Gut(d,s,a)})),i.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function Xut(e,t,n,i,o){let r=wh(n,"interpolate",Me.gx),s=vh(n,"Track",Me.gx),a,c,u,f=!1,d=new Zy,p=new is,_=new Ga,m=e._ellipsoid;for(let y=0,x=s.length;y<x;y++){let b=s[y],T=vh(b,"when",Me.kml),C=vh(b,"coord",Me.gx),A=In(b,"altitudeMode",Me.kml),S=In(b,"altitudeMode",Me.gx),w=BD(A,S),R=wh(b,"extrude",Me.kml),D=Math.min(C.length,T.length),M=[];a=[];for(let L=0;L<D;L++){let g=TV(C[L].textContent,m);M.push(g),a.push($.fromIso8601(T[L].textContent))}r&&(l(c)&&x0e([c,a[0]],[u,M[0]],_,p,d,!1,"absolute",void 0,!1),c=a[D-1],u=M[M.length-1]),x0e(a,M,_,p,d,w&&R,A,S,!0),f=f||w&&R}return i.availability=p,i.position=_,CV(e,i,o),I0e(i,o),f&&(FK(t,i,o),i.polyline.show=d),!0}var P0e={Point:Wut,LineString:y0e,LinearRing:y0e,Polygon:qut,Track:Yut,MultiTrack:Xut,MultiGeometry:Kut,Model:$ut};function Kut(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=P0e[f.localName];if(l(d)){let p=A0e(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(a=!0)}}return a}function $ut(e,t,n,i,o){return Tt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Zut(e,t){let n=Mi(e,"ExtendedData",Me.kml);if(!l(n))return;l(Mi(n,"SchemaData",Me.kml))&&Tt("kml-schemaData","KML - SchemaData is unsupported"),l(Bs(n,"xmlns:prefix"))&&Tt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=vh(n,"Data",Me.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Bs(a,"name");l(c)&&(i[c]={displayName:In(a,"displayName",Me.kml),value:In(a,"value",Me.kml)})}}t.kml.extendedData=i}var _o;typeof document<"u"&&(_o=document.createElement("div"));function Qut(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=In(e,"description",Me.kml),d=t.balloonStyle??n.balloonStyle,p=H.WHITE,_=H.BLACK,m=f;l(d)&&(p=d.bgColor??H.WHITE,_=d.textColor??H.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let T=m.match(/\$\[.+?\]/g);if(T!==null)for(r=0;r<T.length;r++){let C=T[r],A=C.substr(2,C.length-3),S=/\/displayName$/.test(A);A=A.replace(/\/displayName$/,""),y=u[A],l(y)&&(y=S?y.displayName:y.value),l(y)&&(m=m.replace(C,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=Mut.link(m),_o.innerHTML=m;let x=_o.querySelectorAll("a");for(r=0;r<x.length;r++)x[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Hu(_o,"a","href",i),Hu(_o,"link","href",i),Hu(_o,"area","href",i),Hu(_o,"img","src",i),Hu(_o,"iframe","src",i),Hu(_o,"video","src",i),Hu(_o,"audio","src",i),Hu(_o,"source","src",i),Hu(_o,"track","src",i),Hu(_o,"input","src",i),Hu(_o,"embed","src",i),Hu(_o,"script","src",i),Hu(_o,"video","poster",i)),Gu(_o,"a","href",o),Gu(_o,"link","href",o),Gu(_o,"area","href",o),Gu(_o,"img","src",o),Gu(_o,"iframe","src",o),Gu(_o,"video","src",o),Gu(_o,"audio","src",o),Gu(_o,"source","src",o),Gu(_o,"track","src",o),Gu(_o,"input","src",o),Gu(_o,"embed","src",o),Gu(_o,"script","src",o),Gu(_o,"video","poster",o);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${_.toCssColorString()};`,b+='">',b+=`${_o.innerHTML}</div>`,_o.innerHTML="",t.description=b}function AV(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=A0e(t,i,n.context),c=a.kml,u=Vut(e,t,n.styleCollection,r,s),f=In(t,"name",Me.kml);a.name=f,a.parent=o;let d=Uut(t);l(d)||(d=kut(t)),a.availability=d,UK(a);function p(C){return C?C.show&&p(C.parent):!0}let _=wh(t,"visibility",Me.kml);a.show=p(o)&&(_??!0);let m=Mi(t,"author",Me.atom),y=c.author;y.name=In(m,"name",Me.atom),y.uri=In(m,"uri",Me.atom),y.email=In(m,"email",Me.atom);let x=Mi(t,"link",Me.atom),b=c.link;b.href=Bs(x,"href"),b.hreflang=Bs(x,"hreflang"),b.rel=Bs(x,"rel"),b.type=Bs(x,"type"),b.title=Bs(x,"title"),b.length=Bs(x,"length"),c.address=In(t,"address",Me.kml),c.phoneNumber=In(t,"phoneNumber",Me.kml),c.snippet=In(t,"Snippet",Me.kml),Zut(t,a),Qut(t,a,u,s,r);let T=e._ellipsoid;return O0e(t,a,T),R0e(t,a,T),l(Mi(t,"Region",Me.kml))&&Tt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function D0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Jut(e,t,n,i){let o=AV(e,t,n),r=Fe(n);r.parentEntity=o.entity,D0e(e,t,r,i)}function eft(e,t,n,i){let o=AV(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=P0e[d.localName];l(p)&&(p(e,n.entityCollection,d,r,s,r.id),a=!0)}a||(r.merge(s),CV(e,r,s))}var tft={FlyTo:oft,Wait:ift,SoundCue:vK,AnimatedUpdate:vK,TourControl:vK};function nft(e,t,n,i){let o=In(t,"name",Me.kml),r=Bs(t,"id"),s=new mV(o,r),a=Mi(t,"Playlist",Me.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=tft[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function vK(e,t){Tt(`KML Tour unsupported node ${t.localName}`)}function ift(e,t){let n=ei(t,"duration",Me.gx);e.addPlaylistEntry(new gV(n))}function oft(e,t,n){let i=ei(t,"duration",Me.gx),o=In(t,"flyToMode",Me.gx),r={kml:{}};O0e(t,r,n),R0e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new _V(i,o,s);e.addPlaylistEntry(a)}function R0e(e,t,n){let i=Mi(e,"Camera",Me.kml);if(l(i)){let o=ei(i,"longitude",Me.kml)??0,r=ei(i,"latitude",Me.kml)??0,s=ei(i,"altitude",Me.kml)??0,a=ei(i,"heading",Me.kml)??0,c=ei(i,"tilt",Me.kml)??0,u=ei(i,"roll",Me.kml)??0,f=h.fromDegrees(o,r,s,n),d=fc.fromDegrees(a,c-90,u);t.kml.camera=new fV(f,d)}}function O0e(e,t,n){let i=Mi(e,"LookAt",Me.kml);if(l(i)){let o=ei(i,"longitude",Me.kml)??0,r=ei(i,"latitude",Me.kml)??0,s=ei(i,"altitude",Me.kml)??0,a=ei(i,"heading",Me.kml),c=ei(i,"tilt",Me.kml),u=ei(i,"range",Me.kml)??0;c=P.toRadians(c??0),a=P.toRadians(a??0);let f=new bh(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(o,r,s,n);t.kml.lookAt=new dV(d,f)}}function rft(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Mi(t,"Icon",Me.kml),c=NK(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Mi(t,"screenXY",Me.kml),p=Mi(t,"overlayXY",Me.kml),_=Mi(t,"size",Me.kml),m,y,x,b,T,C;l(_)&&(m=A0(_,"x"),y=A0(_,"y"),x=Bs(_,"xunits"),b=Bs(_,"yunits"),l(m)&&m!==-1&&m!==0&&(x==="fraction"?T=`width: ${Math.floor(m*100)}%`:x==="pixels"&&(T=`width: ${m}px`),f.push(T)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?C=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(C=`height: ${y}px`),f.push(C))),u.style=f.join(";");let A=0,S=u.height;l(p)&&(m=A0(p,"x"),y=A0(p,"y"),x=Bs(p,"xunits"),b=Bs(p,"yunits"),l(m)&&(x==="fraction"?A=m*u.width:(x==="pixels"||x==="insetPixels")&&(A=m)),l(y)&&(b==="fraction"?S=y*u.height:(b==="pixels"||b==="insetPixels")&&(S=y))),l(d)&&(m=A0(d,"x"),y=A0(d,"y"),x=Bs(d,"xunits"),b=Bs(d,"yunits"),l(m)&&(x==="fraction"?T=`left: calc(${Math.floor(m*100)}% - ${A}px)`:x==="pixels"?T=`left: ${m-A}px`:x==="insetPixels"&&(T=`right: ${m-A}px`),f.push(T)),l(y)&&(b==="fraction"?C=`bottom: calc(${Math.floor(y*100)}% - ${S}px)`:b==="pixels"?C=`bottom: ${y-S}px`:b==="insetPixels"&&(C=`top: ${y-S}px`),f.push(C))),u.style=f.join(";")},o.appendChild(u)}function sft(e,t,n,i){let r=AV(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=yV(Mi(t,"LatLonQuad",Me.gx),c),f=ei(t,"drawOrder",Me.kml);if(l(u))s=LK(),s.hierarchy=new gc(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new um,s.zIndex=f,r.rectangle=s;let m=Mi(t,"LatLonBox",Me.kml);if(l(m)){let y=ei(m,"west",Me.kml),x=ei(m,"south",Me.kml),b=ei(m,"east",Me.kml),T=ei(m,"north",Me.kml);l(y)&&(y=P.negativePiToPi(P.toRadians(y))),l(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),l(b)&&(b=P.negativePiToPi(P.toRadians(b))),l(T)&&(T=P.clampToLatitudeRange(P.toRadians(T))),s.coordinates=new ae(y,x,b,T);let C=ei(m,"rotation",Me.kml);if(l(C)){let A=P.toRadians(C);s.rotation=A,s.stRotation=A}}}let d=Mi(t,"Icon",Me.kml),p=NK(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Tt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=ei(d,"x",Me.gx),y=ei(d,"y",Me.gx),x=ei(d,"w",Me.gx),b=ei(d,"h",Me.gx);(l(m)||l(y)||l(x)||l(b))&&Tt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=iT(t,"color",Me.kml),s.material.transparent=!0}else s.material=iT(t,"color",Me.kml);let _=In(t,"altitudeMode",Me.kml);l(_)?_==="absolute"?(s.height=ei(t,"altitude",Me.kml),s.zIndex=void 0):_!=="clampToGround"&&Tt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`):(_=In(t,"altitudeMode",Me.gx),_==="relativeToSeaFloor"?(Tt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Me.kml),s.zIndex=void 0):_==="clampToSeaFloor"?Tt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(_)&&Tt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`))}function M0e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Tt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var E0={INTERVAL:0,EXPIRE:1,STOP:2};function bV(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var aft=new ae,AS=new fe,wK=new V,cft=new h;function BK(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=hC(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=o??aft,l(n)&&(wK.x=n.clientWidth*.5,wK.y=n.clientHeight*.5,u=t.pickEllipsoid(wK,r,cft)),l(u)?f=r.cartesianToCartographic(u,AS):(f=ae.center(o,AS),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let b=o.width*i*.5,T=o.height*i*.5;o=new ae(a(f.longitude-b),s(f.latitude-T),a(f.longitude+b),s(f.latitude+T))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,AS),c=c.replace("[cameraLon]",P.toDegrees(AS.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(AS.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(AS.height).toString());let _=t.frustum,m=_.aspectRatio,y="",x="";if(l(m)){let b=P.toDegrees(_.fov);m>1?(y=b,x=b/m):(x=b,y=b*m)}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(gf(c))}function lft(e,t,n,i){let r=AV(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Mi(t,"Link",Me.kml);if(l(c)||(c=Mi(t,"Url",Me.kml)),l(c)){let u=In(c,"href",Me.kml),f,d;if(l(u)){let p=u;if(u=MK(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=In(c,"viewRefreshMode",Me.kml),f==="onRegion"){Tt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=In(c,"viewBoundScale",Me.kml)??1;let x=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=In(c,"viewFormat",Me.kml)??x,T=In(c,"httpQuery",Me.kml);l(b)&&u.setQueryParameters(gf(bV(b))),l(T)&&u.setQueryParameters(gf(bV(T)));let C=e._ellipsoid;BK(u,e.camera,e.canvas,d,e._lastCameraView.bbox,C)}let _={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ca,y=kK(e,m,u,_).then(function(x){let b=e._entityCollection,T=m.values;b.suspendEvents();for(let S=0;S<T.length;S++){let w=T[S];l(w.parent)||(w.parent=r,UK(w)),b.add(w)}b.resumeEvents();let C=In(c,"refreshMode",Me.kml),A=ei(c,"refreshInterval",Me.kml)??0;if(C==="onInterval"&&A>0||C==="onExpire"||f==="onStop"){let S=Mi(x,"NetworkLinkControl",Me.kml),w=l(S),R=$.now(),D={id:Nn(),href:u,cookie:{},lastUpdated:R,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:R},M=0;if(w&&(D.cookie=gf(In(S,"cookie",Me.kml)??""),M=ei(S,"minRefreshPeriod",Me.kml)??0),C==="onInterval")w&&(A=Math.max(M,A)),D.refreshMode=E0.INTERVAL,D.time=A;else if(C==="onExpire"){let L;if(w&&(L=In(S,"expires",Me.kml)),l(L))try{let g=$.fromIso8601(L),E=$.secondsDifference(g,R);E>0&&E<M&&$.addSeconds(R,M,g),D.refreshMode=E0.EXPIRE,D.time=g}catch{Tt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Tt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(D.refreshMode=E0.STOP,D.time=ei(c,"viewRefreshTime",Me.kml)??0):Tt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(D.refreshMode)&&e._networkLinks.set(D.id,D)}}).catch(function(x){Tt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,x)});i.addPromise(y)}}}function uft(e,t,n,i){let o=OK[t.localName];return l(o)?o(e,t,n,i):M0e(e,t,n,i)}function DK(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Mi(a,"Document",Me.kml),u=In(c,"name",Me.kml);l(u)||(u=Wy(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new ju._DeferredLoading(e),d=new Ca(e);return Promise.all(v0e(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let x=m[y];if(l(OK[x.localName])){p=x;break}}}let _={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),uft(e,p,_,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function fft(e,t,n,i,o){let r=on("ThirdParty/Workers/z-worker-pako.js");dS({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new Vz(new G_(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(SK(f,u)),f=p):c.push(SK(p,u)))}return l(f)&&c.push(But(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new se("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),DK(e,t,u.kml,i,u,o)})})}function kK(e,t,n,i){i=i??G.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=o??Ee.DEFAULT.clone();return o=Ee.createIfNeeded(o),l(a)&&(a=On(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?Nut(u).then(function(f){return f?fft(e,t,u,o,a):Fut(u).then(function(d){d=T0e(d),d=C0e(d);let p,_;try{p=RK.parseFromString(d,"application/xml")}catch(m){_=m.toString()}if(l(_)||p.body||p.documentElement.tagName==="parsererror"){let m=l(_)?_:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new se(m)}return DK(e,t,p,o,r,a,s)})}):DK(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function ju(e){e=e??G.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new me,this._error=new me,this._loading=new me,this._refresh=new me,this._unsupportedNode=new me,this._clock=void 0,this._entityCollection=new Ca(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new g0,this._networkLinks=new It,this._entityCluster=new td,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ae.clone(ae.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new _t(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}ju.load=function(e,t){return t=t??G.EMPTY_OBJECT,new ju(t).load(e,t)};Object.defineProperties(ju.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}}});ju.prototype.load=function(e,t){t=t??G.EMPTY_OBJECT,os.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return kK(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=$.equals(s,Ge.MINIMUM_VALUE),u=$.equals(a,Ge.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=$.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=$.fromDate(d)),o=new km,o.startTime=s,o.stopTime=a,o.currentTime=$.clone(s),o.clockRange=rs.LOOP_STOP,o.clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max($.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),os.setLoading(i,!1),i}).catch(function(o){return os.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};ju.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function UK(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 dft(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Mi(r,"NetworkLinkControl",Me.kml),c=l(a),u=0;if(c){if(l(Mi(a,"Update",Me.kml))){Tt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=gf(In(a,"cookie",Me.kml)??""),u=ei(a,"minRefreshPeriod",Me.kml)??0}let f=$.now(),d=t.refreshMode;if(d===E0.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===E0.EXPIRE){let R;if(l(a)&&(R=In(a,"expires",Me.kml)),l(R))try{let D=$.fromIso8601(R),M=$.secondsDifference(D,f);M>0&&M<u&&$.addSeconds(f,u,D),t.time=D}catch{Tt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Tt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,_=e._entityCollection,m=n.values;function y(R){_.remove(R);let D=R._children,M=D.length;for(let L=0;L<M;++L)y(D[L])}_.suspendEvents();let x=_.values.slice(),b;for(b=0;b<x.length;++b){let R=x[b];R.parent===p&&(R.parent=void 0,y(R))}for(_.resumeEvents(),_.suspendEvents(),b=0;b<m.length;b++){let R=m[b];l(R.parent)||(R.parent=p,UK(R)),_.add(R)}_.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let T=_.computeAvailability(),C=T.start,A=T.stop,S=$.equals(C,Ge.MINIMUM_VALUE),w=$.equals(A,Ge.MAXIMUM_VALUE);if(!S||!w){let R=e._clock;(R.startTime!==C||R.stopTime!==A)&&(R.startTime=C,R.stopTime=A,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var IK=new It;ju.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=$.now(),i=this;IK.removeAll();function o(f){let d=f._children,p=d.length;for(let _=0;_<p;++_){let m=d[_];IK.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new It,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!IK.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===E0.INTERVAL?$.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===E0.EXPIRE?$.greaterThan(n,f.time)&&(p=!0):f.refreshMode===E0.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&$.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let _=new Ca,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??te.default;BK(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),kK(i,_,m,{context:d.id}).then(dft(i,f,_,c,m)).catch(function(x){let b=`NetworkLink ${f.href} refresh failed: ${x}`;console.log(b),i._error.raiseEvent(i,b)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function hft(){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}ju._DeferredLoading=op;ju._getTimestamp=Pi;var ES=ju;function kD(){he.throwInstantiationError()}kD.prototype.update=he.throwInstantiationError;kD.prototype.getBoundingSphere=he.throwInstantiationError;kD.prototype.isDestroyed=he.throwInstantiationError;kD.prototype.destroy=he.throwInstantiationError;var L0e=kD;var mft={NONE:0,LERC:1},Ih=Object.freeze(mft);var pft={NONE:0,BITS12:1},Ia=Object.freeze(pft);var oT=new h,_ft=new h,dd=new V,EV=new O,gft=new O,yft=Math.pow(2,12);function Pc(e,t,n,i,o,r,s,a,c,u){let f=Ia.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let _=t.minimum,m=t.maximum,y=h.subtract(m,_,_ft),x=i-n;Math.max(h.maximumComponent(y),x)<yft-1?f=Ia.BITS12:f=Ia.NONE,d=O.inverseTransformation(o,new O);let T=h.negate(_,oT);O.multiply(O.fromTranslation(T,EV),d,d);let C=oT;C.x=1/y.x,C.y=1/y.y,C.z=1/y.z,O.multiply(O.fromScale(C,EV),d,d),p=O.clone(o),O.setTranslation(p,h.ZERO,p),o=O.clone(o,new O);let A=O.fromTranslation(_,EV),S=O.fromScale(y,gft),w=O.multiply(A,S,EV);O.multiply(o,w,o),O.multiply(p,w,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Pc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===Ia.BITS12){n=O.multiplyByPoint(this.toScaledENU,n,oT),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((o-this.minimumHeight)/f,0,1);V.fromElements(n.x,n.y,dd);let p=Mn.compressTextureCoordinates(dd);V.fromElements(n.z,d,dd);let _=Mn.compressTextureCoordinates(dd);V.fromElements(c,u,dd);let m=Mn.compressTextureCoordinates(dd);if(e[t++]=p,e[t++]=_,e[t++]=m,this.hasWebMercatorT){V.fromElements(s,0,dd);let y=Mn.compressTextureCoordinates(dd);e[t++]=y}}else h.subtract(n,this.center,oT),e[t++]=oT.x,e[t++]=oT.y,e[t++]=oT.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Mn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var xft=new h,N0e=new h;Pc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*r+f;t[p]=e[d]}let a=this.decodePosition(t,s,xft),c=n.geodeticSurfaceNormal(a,N0e),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Pc.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]}};Pc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ia.BITS12){let i=Mn.decompressTextureCoordinates(e[t],dd);n.x=i.x,n.y=i.y;let o=Mn.decompressTextureCoordinates(e[t+1],dd);return n.z=o.x,O.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Pc.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,N0e),a=this.decodeHeight(e,t),c=Br.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Pc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new V),t*=this.stride,this.quantization===Ia.BITS12?Mn.decompressTextureCoordinates(e[t+2],n):V.fromElements(e[t+4],e[t+5],n)};Pc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ia.BITS12?Mn.decompressTextureCoordinates(e[t+1],dd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Pc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ia.BITS12?Mn.decompressTextureCoordinates(e[t+3],dd).x:e[t+6]};Pc.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 V.fromElements(o,r,n)};Pc.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};Pc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Ia.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 SV={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},vV={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Pc.prototype.getAttributes=function(e){let t=K.FLOAT,n=K.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===Ia.NONE){s(SV.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(SV.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(SV.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(vV.compressed0,a?4:3),c&&s(vV.compressed1,1),this.hasGeodeticSurfaceNormals&&s(vV.geodeticSurfaceNormal,3)}return r};Pc.prototype.getAttributeLocations=function(){return this.quantization===Ia.NONE?SV:vV};Pc.clone=function(e,t){if(l(e))return l(t)||(t=new Pc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=O.clone(e.toScaledENU),t.fromScaledENU=O.clone(e.fromScaledENU),t.matrix=O.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 gl=Pc;var rp={};rp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var zK=new h,bft=new O,Tft=new h,Cft=new h;rp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,_=e.isGeographic??!0,m=e.ellipsoid??te.default,y=1/m.maximumRadius,x=ae.clone(e.nativeRectangle),b=ae.clone(e.rectangle),T,C,A,S;l(b)?(T=b.west,C=b.south,A=b.east,S=b.north):_?(T=a(x.west),C=a(x.south),A=a(x.east),S=a(x.north)):(T=x.west*y,C=s-2*o(r(-x.south*y)),A=x.east*y,S=s-2*o(r(-x.north*y)));let w=e.relativeToCenter,R=l(w);w=R?w:h.ZERO;let D=e.includeWebMercatorT??!1,M=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,E=M!==1,v=e.structure??rp.DEFAULT_STRUCTURE,I=v.heightScale??rp.DEFAULT_STRUCTURE.heightScale,N=v.heightOffset??rp.DEFAULT_STRUCTURE.heightOffset,F=v.elementsPerHeight??rp.DEFAULT_STRUCTURE.elementsPerHeight,U=v.stride??rp.DEFAULT_STRUCTURE.stride,k=v.elementMultiplier??rp.DEFAULT_STRUCTURE.elementMultiplier,z=v.isBigEndian??rp.DEFAULT_STRUCTURE.isBigEndian,B=ae.computeWidth(x),j=ae.computeHeight(x),W=B/(u-1),J=j/(f-1);_||(B*=y,j*=y);let Y=m.radiiSquared,ee=Y.x,Q=Y.y,de=Y.z,ge=65536,le=-65536,ye=Et.eastNorthUpToFixedFrame(w,m),be=O.inverseTransformation(ye,bft),Ie,Te;D&&(Ie=ki.geodeticLatitudeToMercatorAngle(C),Te=1/(ki.geodeticLatitudeToMercatorAngle(S)-Ie));let ve=Tft;ve.x=Number.POSITIVE_INFINITY,ve.y=Number.POSITIVE_INFINITY,ve.z=Number.POSITIVE_INFINITY;let Ve=Cft;Ve.x=Number.NEGATIVE_INFINITY,Ve.y=Number.NEGATIVE_INFINITY,Ve.z=Number.NEGATIVE_INFINITY;let Ke=Number.POSITIVE_INFINITY,Ct=u*f,Qt=d>0?u*2+f*2:0,Qe=Ct+Qt,hn=new Array(Qe),Nt=new Array(Qe),Rt=new Array(Qe),Zn=D?new Array(Qe):[],gi=E?new Array(Qe):[],Ht=0,wt=f,no=0,xt=u;p&&(--Ht,++wt,--no,++xt);let Xo=1e-5;for(let Ze=Ht;Ze<wt;++Ze){let pt=Ze;pt<0&&(pt=0),pt>=f&&(pt=f-1);let qt=x.north-J*pt;_?qt=a(qt):qt=s-2*o(r(-qt*y));let xn=(qt-C)/(S-C);xn=P.clamp(xn,0,1);let Ro=Ze===Ht,So=Ze===wt-1;d>0&&(Ro?qt+=Xo*j:So&&(qt-=Xo*j));let tc=t(qt),nc=n(qt),Ai=de*nc,yi;D&&(yi=(ki.geodeticLatitudeToMercatorAngle(qt)-Ie)*Te);for(let sa=no;sa<xt;++sa){let Xr=sa;Xr<0&&(Xr=0),Xr>=u&&(Xr=u-1);let El=pt*(u*U)+Xr*U,bo;if(F===1)bo=c[El];else{bo=0;let Bo;if(z)for(Bo=0;Bo<F;++Bo)bo=bo*k+c[El+Bo];else for(Bo=F-1;Bo>=0;--Bo)bo=bo*k+c[El+Bo]}bo=bo*I+N,le=Math.max(le,bo),ge=Math.min(ge,bo);let Mr=x.west+W*Xr;_?Mr=a(Mr):Mr=Mr*y;let Ip=(Mr-T)/(A-T);Ip=P.clamp(Ip,0,1);let Kr=pt*u+Xr;if(d>0){let Bo=sa===no,an=sa===xt-1,Ae=Ro||So||Bo||an;if((Ro||So)&&(Bo||an))continue;Ae&&(bo-=d,Bo?(Kr=Ct+(f-pt-1),Mr-=Xo*B):So?Kr=Ct+f+(u-Xr-1):an?(Kr=Ct+f+u+pt,Mr+=Xo*B):Ro&&(Kr=Ct+f+u+f+Xr))}let Sl=tc*t(Mr),ic=tc*n(Mr),mx=ee*Sl,aa=Q*ic,Uc=1/i(mx*Sl+aa*ic+Ai*nc),ls=mx*Uc,lf=aa*Uc,uf=Ai*Uc,ff=new h;ff.x=ls+Sl*bo,ff.y=lf+ic*bo,ff.z=uf+nc*bo,O.multiplyByPoint(be,ff,zK),h.minimumByComponent(zK,ve,ve),h.maximumByComponent(zK,Ve,Ve),Ke=Math.min(Ke,bo),hn[Kr]=ff,Rt[Kr]=new V(Ip,xn),Nt[Kr]=bo,D&&(Zn[Kr]=yi),E&&(gi[Kr]=m.geodeticSurfaceNormal(ff))}}let yr=re.fromPoints(hn),ec;l(b)&&(ec=Pn.fromRectangle(b,ge,le,m));let Or;R&&(Or=new jy(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,hn,ge));let vs=new Fx(ve,Ve,w),Ue=new gl(w,vs,Ke,le,ye,!1,D,E,M,L),ot=new Float32Array(Qe*Ue.stride),Ye=0;for(let Ze=0;Ze<Qe;++Ze)Ye=Ue.encode(ot,Ye,hn[Ze],Rt[Ze],Nt[Ze],void 0,Zn[Ze],gi[Ze]);return{vertices:ot,maximumHeight:le,minimumHeight:ge,encoding:Ue,boundingSphere3D:yr,orientedBoundingBox:ec,occludeePointInScaledSpace:Or}};var UD=rp;function S0(){he.throwInstantiationError()}Object.defineProperties(S0.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});S0.prototype.interpolateHeight=he.throwInstantiationError;S0.prototype.isChildAvailable=he.throwInstantiationError;S0.prototype.createMesh=he.throwInstantiationError;S0.prototype.upsample=he.throwInstantiationError;S0.prototype.wasCreatedByUpsampling=he.throwInstantiationError;S0.maximumAsynchronousTasks=5;var sp=S0;function Aft(e,t,n,i,o,r,s,a,c,u,f,d,p,_,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=_,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var Ph=Aft;function yl(){he.throwInstantiationError()}Object.defineProperties(yl.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var F0e=[];yl.getRegularGridIndices=function(e,t){let n=F0e[e];l(n)||(F0e[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),z0e(e,t,i,0)),i};var B0e=[];yl.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=B0e[e];l(n)||(B0e[e]=n=[]);let i=n[t];if(!l(i)){let o=yl.getRegularGridIndices(e,t),r=U0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var k0e=[];yl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=k0e[e];l(n)||(k0e[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=U0e(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,_=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=ke.createTypedArray(c,u);z0e(e,t,y,0),yl.addSkirtIndices(d,p,_,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:_,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};yl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=wV(e,a,r,s),a+=e.length,s=wV(t,a,r,s),a+=t.length,s=wV(n,a,r,s),a+=n.length,wV(i,a,r,s)};function U0e(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 z0e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function wV(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}yl.heightmapTerrainQuality=.25;yl.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*yl.heightmapTerrainQuality/(t*n)};yl.prototype.requestTileGeometry=he.throwInstantiationError;yl.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;yl.prototype.getTileDataAvailable=he.throwInstantiationError;yl.prototype.loadTileDataAvailability=he.throwInstantiationError;var Ts=yl;function q_(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Ih.NONE;let t=UD.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===Ih.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(q_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var V0e="createVerticesFromHeightmap",Eft=new hi(V0e),Sft=new hi(V0e,sp.maximumAsynchronousTasks);q_.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(ae.center(f)),p=this._structure,m=Ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let x=(a?Sft:Eft).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Fi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(x))return;let b=this;return Promise.resolve(x).then(function(T){let C;b._skirtHeight>0?C=Ts.getRegularGridAndSkirtIndicesAndEdgeIndices(T.gridWidth,T.gridHeight):C=Ts.getRegularGridIndicesAndEdgeIndices(T.gridWidth,T.gridHeight);let A=T.gridWidth*T.gridHeight;return b._mesh=new Ph(d,new Float32Array(T.vertices),C.indices,C.indexCountWithoutSkirts,A,T.minimumHeight,T.maximumHeight,re.clone(T.boundingSphere3D),h.clone(T.occludeePointInScaledSpace),T.numberOfAttributes,Pn.clone(T.orientedBoundingBox),gl.clone(T.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),b._buffer=void 0,b._mesh})};q_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ae.center(u)),d=this._structure,_=Ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(_*4,1e3);let m=UD.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Fi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Ts.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Ts.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=m.gridWidth*m.gridHeight;return this._mesh=new Ph(f,m.vertices,y.indices,y.indexCountWithoutSkirts,x,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};q_.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),_=this._encoding===Ih.LERC;if(!p&&_)return;let y;if(p){let x=this._mesh.vertices,b=this._mesh.encoding;y=H0e(x,b,f,d,e,i,o,t,n)}else y=vft(this._buffer,a,c,s,u,e,i,o,t,n),y=y*d+f;return y};q_.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),_=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),b=f.heightOffset,T=f.heightScale,C=f.elementsPerHeight,A=f.elementMultiplier,S=f.isBigEndian,w=Math.pow(A,C-1);for(let R=0;R<u;++R){let D=P.lerp(x.north,x.south,R/(u-1));for(let M=0;M<c;++M){let L=P.lerp(x.west,x.east,M/(c-1)),g=H0e(_,m,b,T,y,c,u,L,D);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,wft(p,C,A,w,d,S,R*c+M,g)}}return Promise.resolve(new q_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};q_.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};q_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function vft(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),d=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,_=p+1;_>=s&&(_=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let x=f-p,b=d-m;m=a-1-m,y=a-1-y;let T=IV(e,t,n,i,o,m*s+p),C=IV(e,t,n,i,o,m*s+_),A=IV(e,t,n,i,o,y*s+p),S=IV(e,t,n,i,o,y*s+_);return G0e(x,b,T,C,A,S)}function H0e(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let _=f|0,m=_+1;m>=s&&(m=s-1,_=s-2);let y=u-d,x=f-_;_=s-1-_,m=s-1-m;let b=(t.decodeHeight(e,_*r+d)-n)/i,T=(t.decodeHeight(e,_*r+p)-n)/i,C=(t.decodeHeight(e,m*r+d)-n)/i,A=(t.decodeHeight(e,m*r+p)-n)/i;return G0e(y,x,b,T,C,A)}function G0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function IV(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 wft(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 Dc=q_;function wS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var rT=new ae;function Ift(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}wS.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 _=t;_<=i;++_)Ift(e,_,p,s)||s.push(new SS(r,void 0,0,_,p));r.tileXYToRectangle(t,n,e,rT);let a=rT.west,c=rT.north;r.tileXYToRectangle(i,o,e,rT);let u=rT.east,f=rT.south,d=new Mft(e,a,f,u,c);for(let p=0;p<s.length;++p){let _=s[p];VK(_.extent,d)&&Lft(this._maximumLevel,_,d)}};wS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(vS(i.extent,e)){t=i;break}}return l(t)?zD(void 0,t,e):-1};var Pft=[],Dft=[],Rft=new ae,Oft=new ae;wS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Pft;t.length=0,e.east<e.west?(t.push(ae.fromRadians(-Math.PI,e.south,e.east,e.north,Rft)),t.push(ae.fromRadians(e.west,e.south,Math.PI,e.north,Oft))):t.push(e);let n=Dft;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)VD(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 j0e=new fe;wS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,rT);return ae.center(i,j0e),this.computeMaximumLevelAtPosition(j0e)>=e};wS.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function SS(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(SS.prototype,{nw:{get:function(){return this._nw||(this._nw=new SS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new SS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new SS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new SS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Mft(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function VK(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 Lft(e,t,n){for(;t.level<e;)if(PV(t.nw.extent,n))t=t.nw;else if(PV(t.ne.extent,n))t=t.ne;else if(PV(t.sw.extent,n))t=t.sw;else if(PV(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=zo(t.rectangles,n.level,Nft);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Nft(e,t){return e.level-t}function PV(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function vS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function zD(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&vS(t._nw.extent,n),s=t._ne&&vS(t._ne.extent,n),a=t._sw&&vS(t._sw.extent,n),c=t._se&&vS(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,zD(t,t._nw,n))),s&&(i=Math.max(i,zD(t,t._ne,n))),a&&(i=Math.max(i,zD(t,t._sw,n))),c&&(i=Math.max(i,zD(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];vS(a,n)&&(i=a.level)}t=t.parent}return i}function VD(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||VK(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]=Fft(e[s.level],s)}VD(e,t._nw,n),VD(e,t._ne,n),VD(e,t._sw,n),VD(e,t._se,n)}function Fft(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];VK(o,t)?(o.west<t.west&&n.push(new ae(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ae(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ae(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ae(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var ap=wS;function Bft(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 Y_=Bft;function DV(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}DV.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 DV(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}": ${Y_(i)}`),c};DV.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Fo=DV;function v0(e){if(e=e??G.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new ki(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 V(-i,-i),this._rectangleNortheastInMeters=new V(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ae(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(v0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});v0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};v0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};v0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ae.southwest(e)),o=n.project(ae.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ae(i.x,i.y,o.x,o.y)};v0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new ae(a,d,c,f)};v0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new V(o.west,o.south)),a=r.unproject(new V(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};v0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-d.y,m=p/a|0;m>=o&&(m=o-1);let y=_/u|0;return y>=r&&(y=r-1),l(n)?(n.x=m,n.y=y,n):new V(m,y)};var Cs=v0;var kft=15;function W0e(e){this.ellipsoid=e.ellipsoid??te.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}W0e.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Uft(e,t){let n=t.copyrightText;l(n)&&(e.credit=new _t(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ae.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new vi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new V(r.xmin,r.ymin),s.rectangleNortheastInMeters=new V(r.xmax,r.ymax),e.tilingScheme=new Cs(s)}else throw new se("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new se("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Ih.LERC:Ih.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new ap(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new ap(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Ts.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 zft(e,t,n){try{let i=await t.fetchJson();Uft(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Fo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function w0(e){e=e??G.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 me}Object.defineProperties(w0.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}}});w0.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new W0e(t);await zft(o,i);let r=new w0(t);return o.build(r),r._resource=n,r};w0.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(HK(this,n+1,e*2,t*2))){let d=q0e(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Dc({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):kft,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Xn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Xn.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function HK(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}w0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};w0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=HK(this,n,e,t);if(l(i))return i;q0e(this,n,e,t)};w0.prototype.loadTileDataAvailability=function(e,t,n){};function Vft(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new V(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,_=d?u.y+1:u.y;if(!f){for(let m=e.y;m<_;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new V(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new V(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function Hft(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 V(0,0)];for(;a.length>0;){let c=a.pop(),u=Vft(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function q0e(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new ur({throttle:!1,throttleByServer:!0,type:Is.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let _=Hft(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<_.length;++y){let x=_[y];m.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return HK(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var Y0e=w0;var X0e="https://dev.virtualearth.net/REST/v1/Locations";function GK(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ee({url:X0e,queryParameters:n}),this._credit=new _t('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(GK.prototype,{url:{get:function(){return X0e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});GK.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ae.fromDegrees(a,s,u,c)}})})};var K0e=GK;function jK(){}Object.defineProperties(jK.prototype,{credit:{get:function(){}}});jK.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:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var $0e=jK;var Gft=new ie,Z0e=new h,IS=new h;function jft(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 h);let u=(a-i)*o;return h.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Gft;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,Z0e),h.multiplyByScalar(d,.5,d),p=O.multiplyByVector(f_.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=h.subtract(u,t[r-1],Z0e),h.multiplyByScalar(f,.5,f),p=O.multiplyByVector(f_.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=O.multiplyByVector(I0.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(u,p.y,IS),h.add(o,IS,o),h.multiplyByScalar(f,p.z,IS),h.add(o,IS,o),h.multiplyByScalar(d,p.w,IS),h.add(o,IS,o)}}var Wft=new h,qft=new h;function I0(e){e=e??G.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Wft,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=qft,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=jft(this),this._lastTimeIndex=0}Object.defineProperties(I0.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}}});I0.catmullRomCoefficientMatrix=new O(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);I0.prototype.findTimeInterval=to.prototype.findTimeInterval;I0.prototype.wrapTime=to.prototype.wrapTime;I0.prototype.clampTime=to.prototype.clampTime;I0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Q0e=I0;var RV={};RV.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,d,p,_,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),_=(e-i)/(n-i),r.push(2),r.push(0),_!==1&&(r.push(-1),r.push(1),r.push(0),r.push(_)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(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)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(_=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(_),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(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(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};RV.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,_=1/(d*u+f*p),m=t-a,y=e-s,x=(d*y+f*m)*_,b=(-p*y+u*m)*_,T=1-x-b;return l(c)?(c.x=x,c.y=b,c.z=T,c):new h(x,b,T)};RV.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,_=f/d;if(p>=0&&p<=1&&_>=0&&_<=1)return l(c)||(c=new V),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var P0=RV;function D0(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=MV(e.westIndices,o,t),this._southIndices=MV(e.southIndices,r,t),this._eastIndices=MV(e.eastIndices,o,t),this._northIndices=MV(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(D0.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 OV=[];function MV(e,t,n){OV.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)OV[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(OV.sort(t),ke.createTypedArray(n,OV)):e}var J0e="createVerticesFromQuantizedTerrainMesh",Yft=new hi(J0e),Xft=new hi(J0e,sp.maximumAsynchronousTasks);D0.prototype.createMesh=function(e){e=e??G.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?Xft:Yft).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(_){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=ke.createTypedArray(y,_.indices),b=new Float32Array(_.vertices),T=_.center,C=_.minimumHeight,A=_.maximumHeight,S=p._boundingSphere,w=p._orientedBoundingBox,R=h.clone(_.occludeePointInScaledSpace)??p._horizonOcclusionPoint,D=_.vertexStride,M=gl.clone(_.encoding);return p._mesh=new Ph(T,b,x,_.indexCountWithoutSkirts,m,C,A,S,R,D,w,M,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.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 Kft=new hi("upsampleQuantizedTerrainMesh",sp.maximumAsynchronousTasks);D0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=Kft.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let _=Math.min(this._westSkirtHeight,this._eastSkirtHeight);_=Math.min(_,this._southSkirtHeight),_=Math.min(_,this._northSkirtHeight);let m=c?_*.5:this._westSkirtHeight,y=u?_*.5:this._southSkirtHeight,x=c?this._eastSkirtHeight:_*.5,b=u?this._northSkirtHeight:_*.5,T=this._credits;return Promise.resolve(p).then(function(C){let A=new Uint16Array(C.vertices),S=ke.createTypedArray(A.length/3,C.indices),w;return l(C.encodedNormals)&&(w=new Uint8Array(C.encodedNormals)),new D0({quantizedVertices:A,indices:S,encodedNormals:w,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,boundingSphere:re.clone(C.boundingSphere),orientedBoundingBox:Pn.clone(C.orientedBoundingBox),horizonOcclusionPoint:h.clone(C.horizonOcclusionPoint),westIndices:C.westIndices,southIndices:C.southIndices,eastIndices:C.eastIndices,northIndices:C.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:x,northSkirtHeight:b,childTileMask:0,credits:T,createdByUpsampling:!0})})};var WK=32767,exe=new h;D0.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=WK;let o=P.clamp((n-e.south)/e.height,0,1);return o*=WK,l(this._mesh)?Jft(this,i,o):edt(this,i,o)};function txe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var $ft=new V,Zft=new V,Qft=new V;function Jft(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,$ft),_=r.decodeTextureCoordinates(o,f,Zft),m=r.decodeTextureCoordinates(o,d,Qft);if(txe(t,n,p.x,p.y,_.x,_.y,m.x,m.y)){let y=P0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,exe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let x=r.decodeHeight(o,u),b=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return y.x*x+y.y*b+y.z*T}}}}function edt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],_=i[f],m=i[d],y=o[u],x=o[f],b=o[d];if(txe(t,n,p,y,_,x,m,b)){let T=P0.computeBarycentricCoordinates(t,n,p,y,_,x,m,b,exe);if(T.x>=-1e-15&&T.y>=-1e-15&&T.z>=-1e-15){let C=T.x*r[u]+T.y*r[f]+T.z*r[d];return P.lerp(e._minimumHeight,e._maximumHeight,C/WK)}}}}D0.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};D0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var PS=D0;function tdt(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 ixe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}ixe.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 oxe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new se(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new se(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=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new se(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Cs({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new se(y)}if(e.levelZeroMaximumGeometricError=Ts.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=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new se(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,_;if(l(p)&&!l(d)){_=new ap(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let x=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let T=0;T<x.length;++T){let C=x[T],A=b-C.endY-1,S=b-C.startY-1;e.overallAvailability[y].push([C.startX,A,C.endX,S]),_.addAvailableTileRange(y,C.startX,A,C.endX,S)}}}else l(d)&&(f=new ap(e.tilingScheme,u),_=new ap(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],_.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 tdt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:_,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(_)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await XK(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function ndt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Fo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return XK(e,n);throw new se(i)}async function idt(e,t,n){await oxe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new ap(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 _t(e.attribution);e.tileCredits.push(o)}return!0}async function XK(e,t){try{let n=await e.layerJsonResource.fetchJson();return idt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await oxe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):ndt(e,n,t)}}function Dh(e){e=e??G.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 me;let t=e.credit;typeof t=="string"&&(t=new _t(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 qK={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function nxe(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 odt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Dc({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 rdt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,_=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,x=y*m,b=new DataView(t),T=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let C=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let A=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=new re(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let w=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let R=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=new Uint16Array(t,a,R*3);a+=R*_,R>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,x=y*m);let M=D.subarray(0,R),L=D.subarray(R,2*R),g=D.subarray(R*2,3*R);Mn.zigZagDeltaDecode(M,L,g),a%y!==0&&(a+=y-a%y);let E=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=ke.createTypedArrayFromArrayBuffer(R,t,a,E*m);a+=E*x;let I=0,N=v.length;for(let le=0;le<N;++le){let ye=v[le];v[le]=I-ye,ye===0&&++I}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=ke.createTypedArrayFromArrayBuffer(R,t,a,F);a+=F*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=ke.createTypedArrayFromArrayBuffer(R,t,a,k);a+=k*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=ke.createTypedArrayFromArrayBuffer(R,t,a,B);a+=B*y;let W=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=ke.createTypedArrayFromArrayBuffer(R,t,a,W);a+=W*y;let Y,ee;for(;a<b.byteLength;){let le=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,le===qK.OCT_VERTEX_NORMALS&&e._requestVertexNormals)Y=new Uint8Array(t,a,R*2);else if(le===qK.WATER_MASK&&e._requestWaterMask)ee=new Uint8Array(t,a,ye);else if(le===qK.METADATA&&e._requestMetadata){let be=b.getUint32(a,!0);if(be>0){let Te=jo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,be).available;if(l(Te))for(let ve=0;ve<Te.length;++ve){let Ve=n+ve+1,Ke=Te[ve],Ct=e._tilingScheme.getNumberOfYTilesAtLevel(Ve);for(let Qt=0;Qt<Ke.length;++Qt){let Qe=Ke[Qt],hn=Ct-Qe.endY-1,Nt=Ct-Qe.startY-1;e.availability.addAvailableTileRange(Ve,Qe.startX,hn,Qe.endX,Nt),r.availability.addAvailableTileRange(Ve,Qe.startX,hn,Qe.endX,Nt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),ge=Pn.fromRectangle(de,C,A,e._tilingScheme.ellipsoid);return new PS({center:T,minimumHeight:C,maximumHeight:A,boundingSphere:S,orientedBoundingBox:ge,horizonOcclusionPoint:w,quantizedVertices:D,encodedNormals:Y,indices:v,westIndices:U,southIndices:z,eastIndices:j,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:ee,credits:e._tileCredits})}Dh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=KK(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):rxe(this,e,t,n,r,i)};function rxe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new se("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=nxe(void 0)):u=nxe(c);let _=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(_))return _.then(function(m){return l(m)?l(e._heightmapStructure)?odt(e,m,i,t,n):rdt(e,m,i,t,n,o):Promise.reject(new se("Mesh buffer doesn't exist."))})}Object.defineProperties(Dh.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}}});Dh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Dh.fromIonAssetId=async function(e,t){let n=await Rf.fromAssetId(e);return Dh.fromUrl(n,t)};Dh.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=new ixe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await XK(i);let o=new Dh(t);return i.build(o),o};Dh.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(KK(this,e,t,n,i[r],r===0).result)return;return!1};Dh.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=KK(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function YK(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 KK(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=YK(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[s],!l(d))){let p=new ur({throttle:!1,throttleByServer:!0,type:Is.TERRAIN});d=rxe(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=YK(o,f.x,f.y,f.level)}return{result:!1}}Dh._getAvailabilityTile=YK;var DS=Dh;function X_(e){e=e??G.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 eu(n),this._workerName="createCircleGeometry"}X_.packedLength=eu.packedLength;X_.pack=function(e,t,n){return eu.pack(e._ellipseGeometry,t,n)};var sxe=new eu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Xa={center:new h,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new De,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};X_.unpack=function(e,t,n){let i=eu.unpack(e,t,sxe);return Xa.center=h.clone(i._center,Xa.center),Xa.ellipsoid=te.clone(i._ellipsoid,Xa.ellipsoid),Xa.ellipsoid=te.clone(i._ellipsoid,sxe._ellipsoid),Xa.height=i._height,Xa.extrudedHeight=i._extrudedHeight,Xa.granularity=i._granularity,Xa.vertexFormat=De.clone(i._vertexFormat,Xa.vertexFormat),Xa.stRotation=i._stRotation,Xa.shadowVolume=i._shadowVolume,l(n)?(Xa.semiMajorAxis=i._semiMajorAxis,Xa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new eu(Xa),n):(Xa.radius=i._semiMajorAxis,new X_(Xa))};X_.createGeometry=function(e){return eu.createGeometry(e._ellipseGeometry)};X_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new X_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:De.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(X_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var axe=X_;function RS(e){e=e??G.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 sd(n),this._workerName="createCircleOutlineGeometry"}RS.packedLength=sd.packedLength;RS.pack=function(e,t,n){return sd.pack(e._ellipseGeometry,t,n)};var sdt=new sd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Wu={center:new h,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};RS.unpack=function(e,t,n){let i=sd.unpack(e,t,sdt);return Wu.center=h.clone(i._center,Wu.center),Wu.ellipsoid=te.clone(i._ellipsoid,Wu.ellipsoid),Wu.height=i._height,Wu.extrudedHeight=i._extrudedHeight,Wu.granularity=i._granularity,Wu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Wu.semiMajorAxis=i._semiMajorAxis,Wu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new sd(Wu),n):(Wu.radius=i._semiMajorAxis,new RS(Wu))};RS.createGeometry=function(e){return sd.createGeometry(e._ellipseGeometry)};var cxe=RS;function adt(e){return e=e??G.EMPTY_OBJECT,DS.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var LV=adt;function cdt(e){return e=e??G.EMPTY_OBJECT,DS.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var OS=cdt;function MS(e){e=e??G.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new vi({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me;let n=e.credit;typeof n=="string"&&(n=new _t(n)),this._credit=n}Object.defineProperties(MS.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}}});MS.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 Dc({buffer:c,width:r,height:s})})};MS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};MS.prototype.getTileDataAvailable=function(e,t,n){};MS.prototype.loadTileDataAvailability=function(e,t,n){};var lxe=MS;var ldt=1953029805,udt=2917034100;function $K(e,t){if($K.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new se("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===ldt||o===udt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}$K.passThroughDataForTesting=!1;var NV=$K;function uxe(e){this.proxy=e}uxe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var fxe=uxe;function dxe(e,t){return Mo("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(dxe,"EMPTY_OBJECT",{get:function(){return Mo("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),G.EMPTY_OBJECT}});var Oe=dxe;function Rh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Rh.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}}});Rh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Rh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Rh.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};Rh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)hxe(this,t)};Rh.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++,hxe(this,i),t};Rh.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],mxe(this,0)),this._array[e-1]=void 0,t};Rh.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=ZK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&mxe(this,n)}return this._array[e-1]=void 0,t};Rh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Rh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[ZK(this,1,2)?1:2]};function FV(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function HD(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function ZK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function hxe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=HD(e,t,i);for(o!==n&&(FV(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(HD(e,t,r)!==o)break;FV(e,t,r),t=r}}function mxe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){HD(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;HD(e,f,r)===i&&(r=f)}}if(HD(e,r,t)===i&&(FV(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);ZK(e,r,a)===i&&FV(e,r,a)}t=r}}var LS=Rh;function NS(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new vi({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=Ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me}Object.defineProperties(NS.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(){}}});NS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Dc({buffer:new Uint8Array(16*16),width:16,height:16}))};NS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};NS.prototype.getTileDataAvailable=function(e,t,n){};NS.prototype.loadTileDataAvailability=function(e,t,n){};var K_=NS;function cp(e){e=e??G.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 Ds,this._perspectiveMatrix=new O,this._infinitePerspective=new O}function QK(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=O.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=O.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(cp.prototype,{projectionMatrix:{get:function(){return QK(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return QK(this),this._infinitePerspective}}});var fdt=new h,ddt=new h,hdt=new h,mdt=new h;cp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,fdt),d=ddt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=hdt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let _=mdt;h.multiplyByScalar(f,a,_),h.add(d,_,_),h.subtract(_,e,_),h.normalize(_,_),h.cross(_,n,_),h.normalize(_,_);let m=i[0];return l(m)||(m=i[0]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(f,s,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(n,_,_),h.normalize(_,_),m=i[1],l(m)||(m=i[1]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(n,r,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(f,_,_),h.normalize(_,_),m=i[2],l(m)||(m=i[2]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),h.multiplyByScalar(n,o,_),h.add(d,_,_),h.subtract(_,e,_),h.cross(_,f,_),h.normalize(_,_),m=i[3],l(m)||(m=i[3]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,e),m=i[4],l(m)||(m=i[4]=new ie),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,_),m=i[5],l(m)||(m=i[5]=new ie),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-h.dot(_,p),this._cullingVolume};cp.prototype.getPixelDimensions=function(e,t,n,i,o){QK(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};cp.prototype.clone=function(e){return l(e)||(e=new cp),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};cp.prototype.equals=function(e){return l(e)&&e instanceof cp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};cp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof cp&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var au=cp;function cu(e){e=e??G.EMPTY_OBJECT,this._offCenterFrustum=new au,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}cu.packedLength=6;cu.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};cu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new cu),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 Oh(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(cu.prototype,{projectionMatrix:{get:function(){return Oh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Oh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Oh(this),this._fovy}},sseDenominator:{get:function(){return Oh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Oh(this),this._offCenterFrustum}}});cu.prototype.computeCullingVolume=function(e,t,n){return Oh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};cu.prototype.getPixelDimensions=function(e,t,n,i,o){return Oh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};cu.prototype.clone=function(e){return l(e)||(e=new cu),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};cu.prototype.equals=function(e){return!l(e)||!(e instanceof cu)?!1:(Oh(this),Oh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};cu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof cu)?!1:(Oh(this),Oh(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Li=cu;var BV=0,pdt=1;function sT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??De.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Li?(s=BV,a=Li.packedLength):t instanceof ln&&(s=pdt,a=ln.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Pe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Pe.packedLength+De.packedLength}sT.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===BV?(Li.pack(o,t,n),n+=Li.packedLength):(ln.pack(o,t,n),n+=ln.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Pe.pack(e._orientation,t,n),n+=Pe.packedLength,De.pack(e._vertexFormat,t,n),n+=De.packedLength,t[n]=e._drawNearPlane?1:0,t};var _dt=new Li,gdt=new ln,ydt=new Pe,xdt=new h,bdt=new De;sT.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===BV?(o=Li.unpack(e,t,_dt),t+=Li.packedLength):(o=ln.unpack(e,t,gdt),t+=ln.packedLength);let r=h.unpack(e,t,xdt);t+=h.packedLength;let s=Pe.unpack(e,t,ydt);t+=Pe.packedLength;let a=De.unpack(e,t,bdt);t+=De.packedLength;let c=e[t]===1;if(!l(n))return new sT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Pe.clone(s,n._orientation),n._vertexFormat=De.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function FS(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Tdt=new Z,Cdt=new O,JK=new O,pxe=new h,_xe=new h,gxe=new h,Adt=new h,Edt=new h,Sdt=new h,R0=new Array(3),GD=new Array(4);GD[0]=new ie(-1,-1,1,1);GD[1]=new ie(1,-1,1,1);GD[2]=new ie(1,1,1,1);GD[3]=new ie(-1,1,1,1);var yxe=new Array(4);for(let e=0;e<4;++e)yxe[e]=new ie;sT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=Z.fromQuaternion(t,Tdt),u=r??pxe,f=s??_xe,d=a??gxe;u=Z.getColumn(c,0,u),f=Z.getColumn(c,1,f),d=Z.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=O.computeView(e,d,f,u,Cdt),_,m,y=i.projectionMatrix;if(n===BV){let x=O.multiply(y,p,JK);m=O.inverse(x,JK)}else _=O.inverseTransformation(p,JK);l(m)?(R0[0]=i.near,R0[1]=i.far):(R0[0]=0,R0[1]=i.near,R0[2]=i.far);for(let x=0;x<2;++x)for(let b=0;b<4;++b){let T=ie.clone(GD[b],yxe[b]);if(l(m)){T=O.multiplyByVector(m,T,T);let C=1/T.w;h.multiplyByScalar(T,C,T),h.subtract(T,e,T),h.normalize(T,T);let A=h.dot(d,T);h.multiplyByScalar(T,R0[x]/A,T),h.add(T,e,T)}else{let C=i.offCenterFrustum;l(C)&&(i=C);let A=R0[x],S=R0[x+1];T.x=(T.x*(i.right-i.left)+i.left+i.right)*.5,T.y=(T.y*(i.top-i.bottom)+i.bottom+i.top)*.5,T.z=(T.z*(A-S)-A-S)*.5,T.w=1,O.multiplyByVector(_,T,T)}o[12*x+b*3]=T.x,o[12*x+b*3+1]=T.y,o[12*x+b*3+2]=T.z}};sT.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);sT._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new pn({position:new we({componentDatatype:K.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,_=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,y=l(s.st)?new Float32Array(2*4*a):void 0,x=pxe,b=_xe,T=gxe,C=h.negate(x,Adt),A=h.negate(b,Edt),S=h.negate(T,Sdt);u=0,r&&(FS(u,p,_,m,y,S,x,b),u+=3*4),FS(u,p,_,m,y,T,C,b),u+=3*4,FS(u,p,_,m,y,C,S,b),u+=3*4,FS(u,p,_,m,y,A,S,C),u+=3*4,FS(u,p,_,m,y,x,T,b),u+=3*4,FS(u,p,_,m,y,b,T,C),l(p)&&(f.normal=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:p})),l(_)&&(f.tangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:_})),l(m)&&(f.bitangent=new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new we({componentDatatype:K.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let _=p*6,m=p*4;d[_]=m,d[_+1]=m+1,d[_+2]=m+2,d[_+3]=m,d[_+4]=m+2,d[_+5]=m+3}return new lt({attributes:f,indices:d,primitiveType:Le.TRIANGLES,boundingSphere:re.fromVertices(c)})};var BS=sT;var e$=0,vdt=1;function jD(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Li?(r=e$,s=Li.packedLength):t instanceof ln&&(r=vdt,s=ln.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Pe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Pe.packedLength}jD.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===e$?(Li.pack(o,t,n),n+=Li.packedLength):(ln.pack(o,t,n),n+=ln.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Pe.pack(e._orientation,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var wdt=new Li,Idt=new ln,Pdt=new Pe,Ddt=new h;jD.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===e$?(o=Li.unpack(e,t,wdt),t+=Li.packedLength):(o=ln.unpack(e,t,Idt),t+=ln.packedLength);let r=h.unpack(e,t,Ddt);t+=h.packedLength;let s=Pe.unpack(e,t,Pdt);t+=Pe.packedLength;let a=e[t]===1;if(!l(n))return new jD({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=h.clone(r,n._origin),n._orientation=Pe.clone(s,n._orientation),n._drawNearPlane=a,n};jD.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);BS._computeNearFarPlanes(i,o,t,n,s);let a=new pn({position:new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new lt({attributes:a,indices:d,primitiveType:Le.LINES,boundingSphere:re.fromVertices(s)})};var kV=jD;function UV(){he.throwInstantiationError()}Object.defineProperties(UV.prototype,{credit:{get:he.throwInstantiationError}});UV.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(_t.getIonCredit)};UV.prototype.geocode=he.throwInstantiationError;var WD=UV;var Rdt={SEARCH:0,AUTOCOMPLETE:1},aT=Object.freeze(Rdt);function xxe(){he.throwInstantiationError()}xxe.createGeometry=function(e){he.throwInstantiationError()};var bxe=xxe;function Odt(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 zV=Odt;var kdt=$r(t$(),1);function Mdt(e,t){return(e&t)!==0}var xl=Mdt;var Ldt=[1,2,4,8],Txe=15,Ndt=16,Fdt=64,Bdt=128;function lp(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}lp.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 lp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};lp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};lp.prototype.hasSubtree=function(){return xl(this._bits,Ndt)};lp.prototype.hasImagery=function(){return xl(this._bits,Fdt)};lp.prototype.hasTerrain=function(){return xl(this._bits,Bdt)};lp.prototype.hasChildren=function(){return xl(this._bits,Txe)};lp.prototype.hasChild=function(e){return xl(this._bits,Ldt[e])};lp.prototype.getChildBitmask=function(){return this._bits&Txe};var VV=lp;function Udt(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 zdt=Udt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u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BD8{\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 qu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(qu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});qu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ee)&&(t=e.url);let n=Ee.createIfNeeded(t);n.appendForwardSlash();let i=new qu;i._resource=n;try{await Vdt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Axe(i,"",1).url}: ${o}`;throw new se(r)}return i};qu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;xl(t,r)?xl(e,r)&&(s|=1):(s|=2,xl(e,r)||(s|=1)),i+=s}return i};qu.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];xl(s,2)?xl(s,1)||(t|=r):(n|=r,xl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};qu.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 Cxe=new hi("decodeGoogleEarthEnterprisePacket");qu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=Axe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Cxe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let _=p.length;for(let m=0;m<_;++m){let y=p[m];if(u[y]!==null){let b=VV.clone(u[y]),T=y.length;if(T===d)b.setParent(f);else if(T>1){let C=r[y.substring(0,y.length-1)];b.setParent(C)}r[y]=b}else r[y]=null}})})};qu.prototype.populateSubtree=function(e,t,n,i){let o=qu.tileXYToQuadKey(e,t,n);return o$(this,o,i)};function o$(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 ur({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),o$(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new se(`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 ur({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),o$(e,t,s)}).finally(function(){delete a[o]})}qu.prototype.getTileInformation=function(e,t,n){let i=qu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};qu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Axe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var n$,i$;function Vdt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(i$)){let n=on("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;i$=dC(n).then(function(){n$=window.cesiumGoogleEarthDbRootParser(kdt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return i$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=n$.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 Cxe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=n$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new _t(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=zdt})}var O0=qu;function cT(e){e=e??G.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(cT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var vxe="createVerticesFromGoogleEarthEnterpriseBuffer",Hdt=new hi(vxe),Gdt=new hi(vxe,sp.maximumAsynchronousTasks),Exe=new ae,r$=new ae;cT.prototype.createMesh=function(e){e=e??G.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,Exe),t.tileXYToRectangle(n,i,o,r$);let u=c.cartographicToCartesian(ae.center(r$)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let _=(a?Gdt:Hdt).scheduleTask({buffer:this._buffer,nativeRectangle:Exe,rectangle:r$,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(_))return;let m=this;return _.then(function(y){return m._mesh=new Ph(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,re.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Pn.clone(y.orientedBoundingBox),gl.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};cT.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Xdt(this,i,o):Zdt(this,i,o,e)};var jdt=new hi("upsampleQuantizedTerrainMesh",sp.maximumAsynchronousTasks);cT.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=jdt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let _=this;return p.then(function(m){let y=new Uint16Array(m.vertices),x=ke.createTypedArray(y.length/3,m.indices),b=_._skirtHeight;return new PS({quantizedVertices:y,indices:x,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:re.clone(m.boundingSphere),orientedBoundingBox:Pn.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:_._credits})})};cT.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};cT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Wdt=new V,qdt=new V,Ydt=new V,wxe=new h;function Xdt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,Wdt),_=r.decodeTextureCoordinates(o,f,qdt),m=r.decodeTextureCoordinates(o,d,Ydt),y=P0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,wxe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let x=r.decodeHeight(o,u),b=r.decodeHeight(o,f),T=r.decodeHeight(o,d);return y.x*x+y.y*b+y.z*T}}}var Kdt=Uint16Array.BYTES_PER_ELEMENT,Sxe=Uint32Array.BYTES_PER_ELEMENT,s$=Int32Array.BYTES_PER_ELEMENT,$dt=Float32Array.BYTES_PER_ELEMENT,a$=Float64Array.BYTES_PER_ELEMENT;function Zdt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=Sxe;u+=Sxe,u+=2*a$;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=a$;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=a$;let p=i.width/f/2,_=i.height/d/2,m=c.getInt32(u,!0);u+=s$;let y=c.getInt32(u,!0)*3;u+=s$,u+=s$;let x=new Array(m),b=new Array(m),T=new Array(m),C;for(C=0;C<m;++C)x[C]=s+c.getUint8(u++)*p,b[C]=a+c.getUint8(u++)*_,T[C]=c.getFloat32(u,!0)*6371010,u+=$dt;let A=new Array(y);for(C=0;C<y;++C)A[C]=c.getUint16(u,!0),u+=Kdt;for(C=0;C<y;C+=3){let S=A[C],w=A[C+1],R=A[C+2],D=x[S],M=x[w],L=x[R],g=b[S],E=b[w],v=b[R],I=P0.computeBarycentricCoordinates(t,n,D,g,M,E,L,v,wxe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*T[S]+I.y*T[w]+I.z*T[R]}}var qD=cT;var hd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},HV=new $;function GV(){this._terrainCache={},this._lastTidy=$.now()}GV.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:$.now()}};GV.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};GV.prototype.tidy=function(){if($.now(HV),$.secondsDifference(HV,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];$.secondsDifference(HV,r.timestamp)>10&&delete e[o]}$.clone(HV,this._lastTidy)}};function M0(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=new vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new _t(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new GV,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new me}Object.defineProperties(M0.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(){}}});M0.fromMetadata=function(e,t){if(!e.terrainPresent)throw new se(`The server ${e.url} doesn't have terrain`);let n=new M0(t);return n._metadata=e,n};var Qdt=new hi("decodeGoogleEarthEnterprisePacket");function Ixe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===hd.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}M0.prototype.requestTileGeometry=function(e,t,n,i){let o=O0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new se("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=hd.UNKNOWN);let u=r.get(o);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new qD({buffer:u,childTileMask:Ixe(o,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===hd.NONE)return Promise.reject(new se("Terrain tile doesn't exist"))}else return Promise.resolve(new Dc({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=o,p=-1;switch(c){case hd.SELF:p=a.terrainVersion;break;case hd.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case hd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new se("Terrain tile doesn't exist"));let _=this._terrainPromises,m=this._terrainRequests,y,x;if(l(_[d]))y=_[d],x=m[d];else{x=i;let b=Jdt(this,d,p,x).fetchArrayBuffer();if(!l(b))return;y=b.then(function(T){return l(T)?Qdt.scheduleTask({buffer:T,type:"Terrain",key:s.key},[T]).then(function(C){let A=s.getTileInformationFromQuadKey(d);A.terrainState=hd.SELF,r.add(d,C[0]);let S=A.terrainProvider,w=C.length-1;for(let R=0;R<w;++R){let D=d+R.toString(),M=s.getTileInformationFromQuadKey(D);l(M)&&(r.add(D,C[R+1]),M.terrainState=hd.PARENT,M.terrainProvider===0&&(M.terrainProvider=S))}}):Promise.reject(new se("Failed to load terrain."))}),_[d]=y,m[d]=x,y=y.finally(function(){delete _[d],delete m[d]})}return y.then(function(){let b=r.get(o);if(l(b)){let T=s.providers[a.terrainProvider];return new qD({buffer:b,childTileMask:Ixe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new se("Failed to load terrain."))}).catch(function(b){return x.state===Xn.CANCELLED?(i.state=x.state,Promise.reject(b)):(a.terrainState=hd.NONE,Promise.reject(b))})};M0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};M0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=O0.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===hd.NONE)return!1;if((!l(s)||s===hd.UNKNOWN)&&(r.terrainState=hd.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 ur({throttle:!1,throttleByServer:!0,type:Is.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};M0.prototype.loadTileDataAvailability=function(e,t,n){};function Jdt(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 Pxe=M0;var eht="https://maps.googleapis.com/maps/api/geocode/json",Dxe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function c$(e){e=e??G.EMPTY_OBJECT;let t=e.key;this._resource=new Ee({url:eht,queryParameters:{key:t}}),this._credit=new _t(Dxe,!0)}Object.defineProperties(c$.prototype,{credit:{get:function(){return this._credit}}});c$.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 se(`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:ae.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:Dxe,collapsible:!1}}})};var Rxe=c$;var jV={};jV.defaultApiKey=void 0;jV.mapTilesApiEndpoint=new Ee({url:"https://tile.googleapis.com/v1/"});jV.getDefaultCredit=function(){return new _t('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var kS=jV;function tht(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var WV=tht;var Wxe={},nht=32.184,iht=2451545,Oxe=-.0529921,Mxe=-.1059842,Lxe=13.0120009,Nxe=13.3407154,Fxe=.9856003,Bxe=26.4057084,kxe=13.064993,Uxe=.3287146,zxe=1.7484877,Vxe=-.1589763,Hxe=.0036096,Gxe=.1643573,jxe=12.9590088,l$=new $;Wxe.ComputeMoon=function(e,t){l(e)||(e=$.now()),l$=$.addSeconds(e,nht,l$);let n=$.totalDays(l$)-iht,i=n/Yn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Oxe*n)*P.RADIANS_PER_DEGREE,r=(250.089+Mxe*n)*P.RADIANS_PER_DEGREE,s=(260.008+Lxe*n)*P.RADIANS_PER_DEGREE,a=(176.625+Nxe*n)*P.RADIANS_PER_DEGREE,c=(357.529+Fxe*n)*P.RADIANS_PER_DEGREE,u=(311.589+Bxe*n)*P.RADIANS_PER_DEGREE,f=(134.963+kxe*n)*P.RADIANS_PER_DEGREE,d=(276.617+Uxe*n)*P.RADIANS_PER_DEGREE,p=(34.226+zxe*n)*P.RADIANS_PER_DEGREE,_=(15.134+Vxe*n)*P.RADIANS_PER_DEGREE,m=(119.743+Hxe*n)*P.RADIANS_PER_DEGREE,y=(239.961+Gxe*n)*P.RADIANS_PER_DEGREE,x=(25.053+jxe*n)*P.RADIANS_PER_DEGREE,b=Math.sin(o),T=Math.sin(r),C=Math.sin(s),A=Math.sin(a),S=Math.sin(c),w=Math.sin(u),R=Math.sin(f),D=Math.sin(d),M=Math.sin(p),L=Math.sin(_),g=Math.sin(m),E=Math.sin(y),v=Math.sin(x),I=Math.cos(o),N=Math.cos(r),F=Math.cos(s),U=Math.cos(a),k=Math.cos(c),z=Math.cos(u),B=Math.cos(f),j=Math.cos(d),W=Math.cos(p),J=Math.cos(_),Y=Math.cos(m),ee=Math.cos(y),Q=Math.cos(x),de=(269.9949+.0031*i-3.8787*b-.1204*T+.07*C-.0172*A+.0072*w-.0052*L+.0043*v)*P.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*I+.0239*N-.0278*F+.0068*U-.0029*z+9e-4*B+8e-4*J-9e-4*Q)*P.RADIANS_PER_DEGREE,le=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*T-.0642*C+.0158*A+.0252*S-.0066*w-.0047*R-.0046*D+.0028*M+.0052*L+.004*g+.0019*E-.0044*v)*P.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*Oxe+.1208*N*Mxe-.0642*F*Lxe+.0158*U*Nxe+.0252*k*Fxe-.0066*z*Bxe-.0047*B*kxe-.0046*j*Uxe+.0028*W*zxe+.0052*J*Vxe+.004*Y*Hxe+.0019*ee*Gxe-.0044*Q*jxe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new WV),t.rightAscension=de,t.declination=ge,t.rotation=le,t.rotationRate=ye,t};var qV=Wxe;function qxe(e){(!l(e)||typeof e!="function")&&(e=qV.ComputeMoon),this._computeFunction=e}var oht=new h,rht=new h,sht=new h;function aht(e,t,n){let i=oht;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=sht;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,rht);return l(n)||(n=new Z),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 cht=new Z,lht=new Pe;qxe.prototype.evaluate=function(e,t){l(e)||(e=$.now());let n=this._computeFunction(e),i=aht(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Pe.fromAxisAngle(h.UNIT_Z,o,lht),s=Z.fromQuaternion(Pe.conjugate(r,r),cht);return Z.multiply(s,i,i)};var YV=qxe;var YD={};YD.type=void 0;YD.getRequiredDataPoints=he.throwInstantiationError;YD.interpolateOrderZero=he.throwInstantiationError;YD.interpolate=he.throwInstantiationError;var Yxe=YD;var uht={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},L0=Object.freeze(uht);function u$(e){this._url=Ee.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(u$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});u$.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===aT.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=ae.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var XV=u$;function fht(e){if(!Object.values(L0).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var Xxe=Object.freeze({[L0.GOOGLE]:"google",[L0.BING]:"bing",[L0.DEFAULT]:void 0});function dht(e){return Xxe[e]}function hht(e){return Object.entries(Xxe).find(t=>t[1]===e)[0]}function f$(e){e=e??G.EMPTY_OBJECT;let t=e.geocodeProviderType??L0.DEFAULT,n=e.accessToken??mm.defaultAccessToken,i=Ee.createIfNeeded(e.server??mm.defaultServer);i.appendForwardSlash();let o=mm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(_t.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 XV(r),this.geocodeProviderType=t}Object.defineProperties(f$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return hht(this._pelias.url.queryParameters.geocoder)},set:function(e){fht(e);let t={...this._pelias.url.queryParameters,geocoder:dht(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});f$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var US=f$;var As={};As.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});As.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});As.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});As.defaultAccessToken=void 0;As.defaultShareKey=void 0;As._getAuthorizationHeader=function(){return l(As.defaultShareKey)?`Basic ${As.defaultShareKey}`:`Bearer ${As.defaultAccessToken}`};As.apiEndpoint=new Ee({url:"https://api.bentley.com"});As.getExports=async function(e){let t=new Ee({url:`${As.apiEndpoint}mesh-export`,headers:{Authorization:As._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:As.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new se("Not allowed, forbidden");if(n.statusCode===422)throw new se(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${n.statusCode}`)}};As.getRealityDataMetadata=async function(e,t){let n=new Ee({url:`${As.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:As._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new se("Not allowed, forbidden");if(i.statusCode===404)throw new se(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new se(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${i.statusCode}`)}};As.getRealityDataURL=async function(e,t,n){let i=new Ee({url:`${As.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:As._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new se(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new se("Not allowed, forbidden");if(o.statusCode===404)throw new se(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new se(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new se("Too many requests")}throw new se(`Unknown request failure ${o.statusCode}`)}};var ta=As;var mht={SHIFT:0,CTRL:1,ALT:2},Pa=Object.freeze(mht);var N0={state:!0,maxSize:c9()};N0.GetIndexedDBMaxSize=()=>c9();N0.SetIndexedDBMaxSize=e=>{let t;typeof e!="number"||isNaN(e)||e<1?t=1:t=e,Mee(t)};N0.GetManageIndexexDBState=()=>N0.state;N0.SetManageIndexexDBState=e=>{typeof e=="boolean"?N0.state=e:console.error("\u53C2\u6570\u5FC5\u987B\u4E3Aboolean")};N0.GetIndexedDBCurrentSize=()=>Lee();var Kxe=N0;function KV(){he.throwInstantiationError()}Object.defineProperties(KV.prototype,{ellipsoid:{get:he.throwInstantiationError}});KV.prototype.project=he.throwInstantiationError;KV.prototype.unproject=he.throwInstantiationError;var $xe=KV;var d$=[],h$=[];function pht(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=d$,u=h$,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let _=c[f],m=u[d];f<s&&(d>=a||t(_,m,n)<=0)?(e[p]=_,++f):d<a&&(e[p]=m,++d)}}function m$(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);m$(e,t,n,i,r),m$(e,t,n,r+1,o),pht(e,t,n,i,r,o)}function _ht(e,t,n){let i=e.length,o=Math.ceil(i*.5);d$.length=o,h$.length=o,m$(e,t,n,0,i-1),d$.length=0,h$.length=0}var F0=_ht;function zS(e){e=e??G.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(zS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});zS.prototype.findTimeInterval=to.prototype.findTimeInterval;zS.prototype.wrapTime=to.prototype.wrapTime;zS.prototype.clampTime=to.prototype.clampTime;zS.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 $V=zS;var ght={NONE:-1,PARTIAL:0,FULL:1},Dr=Object.freeze(ght);function Rc(e,t){this._occluderPosition=h.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 ZV=new h;Object.defineProperties(Rc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,ZV),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,ZV);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,ZV),ZV)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Rc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Rc(e,t)};var Qxe=new h;Rc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,Qxe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var yht=new h;Rc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,yht),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Qxe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.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 xht=new h;Rc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Dr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,xht),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?Dr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Dr.FULL:Dr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Dr.PARTIAL:Dr.FULL))}}return Dr.NONE};var QV=new h;Rc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,QV),QV),c=-h.dot(a,o),u=Rc._anyRotationVector(o,a,c),f=Rc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let _=1;_<s;++_){if(d=Rc._horizonToPlaneNormalDotProduct(e,a,c,u,n[_]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return h.add(o,h.multiplyByScalar(a,p,QV),QV)};var bht=[];Rc.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ae.subsample(e,t,0,bht),i=re.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Rc.computeOccludeePoint(new re(o,t.minimumRadius),i.center,n)};var Tht=new h;Rc._anyRotationVector=function(e,t,n){let i=h.abs(t,Tht),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var Cht=new h;Rc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,Cht);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return o};var p$=new h,Aht=new h,JV=new h,Zxe=new h;Rc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,p$),s=h.clone(e.center,Aht),a=e.radius,c=h.subtract(s,r,JV),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),x=p*m*p;c=h.normalize(c,c);let b=h.add(r,h.multiplyByScalar(c,x,Zxe),Zxe),T=Math.sqrt(d-x*x),C=this._rotationVector(s,t,n,r,i),A=h.fromElements(C.x*C.x*c.x+(C.x*C.y-C.z)*c.y+(C.x*C.z+C.y)*c.z,(C.x*C.y+C.z)*c.x+C.y*C.y*c.y+(C.y*C.z-C.x)*c.z,(C.x*C.z-C.y)*c.x+(C.y*C.z+C.x)*c.y+C.z*C.z*c.z,p$);A=h.normalize(A,A);let S=h.multiplyByScalar(A,T,p$);C=h.normalize(h.subtract(h.add(b,S,JV),s,JV),JV);let w=h.dot(t,C);C=h.normalize(h.subtract(h.subtract(b,S,C),s,C),C);let R=h.dot(t,C);return w<R?w:R};var e4=Rc;function _$(e,t,n){e=Ee.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new _t('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(_$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});_$.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:ct(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ae.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var Jxe=_$;var Eht={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},ebe=Eht;var Sht={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},tbe=Sht;var vht=new h;function wht(e,t,n,i){let o=CC(e,t,n,i,vht);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var nbe=wht;function ibe(){he.throwInstantiationError()}ibe.prototype.getURL=he.throwInstantiationError;var obe=ibe;async function Iht(e,t,n,i){return l(i)||(i=!1),Rht(e,t,n,i)}function Pht(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(sbe(i)):r=o.then(sbe(i)).catch(Oht(i)),e.shift(),t.push(r),!0}function Dht(e){return new Promise(function(t){setTimeout(t,e)})}function g$(e,t,n){return e.length?Pht(e,t,n)?g$(e,t,n):Dht(100).then(()=>g$(e,t,n)):Promise.resolve()}function Rht(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[r])}let c=[];return g$(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function rbe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function sbe(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(!rbe(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];rbe(s,i,n)}}):Promise.resolve()}}function Oht(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var t4=Iht;var y$=new V;async function abe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,y$);let p=e.loadTileDataAvailability(y$.x,y$.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return t4(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await abe(e,a,n),t}var VS=abe;var Mht={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},An=Object.freeze(Mht);function B0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function E$(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function lT(e){if(e.shiftKey)return Pa.SHIFT;if(e.ctrlKey)return Pa.CTRL;if(e.altKey)return Pa.ALT}var ks={LEFT:0,MIDDLE:1,RIGHT:2};function Yu(e,t,n,i){function o(r){i(e,r)}Ft.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Lht(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ft.supportsPointerEvents()?(Yu(e,"pointerdown",t,zht),Yu(e,"pointerup",t,gbe),Yu(e,"pointermove",t,Vht),Yu(e,"pointercancel",t,gbe)):(Yu(e,"mousedown",t,ybe),Yu(e,"mouseup",n,xbe),Yu(e,"mousemove",n,bbe),Yu(e,"touchstart",t,kht),Yu(e,"touchend",n,dbe),Yu(e,"touchmove",n,Uht),Yu(e,"touchcancel",n,dbe)),Yu(e,"dblclick",t,Fht);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Yu(e,i,t,Bht)}function Nht(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var cbe={position:new V};function S$(e){e._lastSeenTouchEvent=Pi()}function v$(e){return Pi()-e._lastSeenTouchEvent>Mh.mouseEmulationIgnoreMilliseconds}function A$(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function ybe(e,t){if(!v$(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ks.LEFT)i=An.LEFT_DOWN;else if(n===ks.MIDDLE)i=An.MIDDLE_DOWN;else if(n===ks.RIGHT)i=An.RIGHT_DOWN;else return;let o=B0(e,t,e._primaryPosition);V.clone(o,e._primaryStartPosition),V.clone(o,e._primaryPreviousPosition);let r=lT(t),s=e.getInputAction(i,r);l(s)&&(V.clone(o,cbe.position),s(cbe),t.preventDefault())}var lbe={position:new V},ube={position:new V};function x$(e,t,n,i){let o=lT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=B0(e,i,e._primaryPosition);if(l(r)&&(V.clone(a,lbe.position),r(lbe)),l(s)){let c=e._primaryStartPosition;A$(c,a,e._clickPixelTolerance)&&(V.clone(a,ube.position),s(ube))}}}function xbe(e,t){if(!v$(e))return;let n=t.button;n!==ks.LEFT&&n!==ks.MIDDLE&&n!==ks.RIGHT||(e._buttonDown[ks.LEFT]&&(x$(e,An.LEFT_UP,An.LEFT_CLICK,t),e._buttonDown[ks.LEFT]=!1),e._buttonDown[ks.MIDDLE]&&(x$(e,An.MIDDLE_UP,An.MIDDLE_CLICK,t),e._buttonDown[ks.MIDDLE]=!1),e._buttonDown[ks.RIGHT]&&(x$(e,An.RIGHT_UP,An.RIGHT_CLICK,t),e._buttonDown[ks.RIGHT]=!1))}var b$={startPosition:new V,endPosition:new V};function bbe(e,t){if(!v$(e))return;let n=lT(t),i=B0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(An.MOUSE_MOVE,n);l(r)&&(V.clone(o,b$.startPosition),V.clone(i,b$.endPosition),r(b$)),V.clone(i,o),(e._buttonDown[ks.LEFT]||e._buttonDown[ks.MIDDLE]||e._buttonDown[ks.RIGHT])&&t.preventDefault()}var fbe={position:new V};function Fht(e,t){let n=t.button,i;if(n===ks.LEFT)i=An.LEFT_DOUBLE_CLICK;else return;let o=lT(t),r=e.getInputAction(i,o);l(r)&&(B0(e,t,fbe.position),r(fbe))}function Bht(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=lT(t),o=e.getInputAction(An.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function kht(e,t){S$(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,B0(e,r,new V));n4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,V.clone(a.get(s)))}function dbe(e,t){S$(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);n4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var hbe={position:new V},T$={position1:new V,position2:new V},mbe={position:new V},pbe={position:new V},_be={position:new V};function n4(e,t){let n=lT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[ks.LEFT]){if(e._buttonDown[ks.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(An.LEFT_UP,n),l(r)&&(V.clone(e._primaryPosition,mbe.position),r(mbe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(An.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];A$(c,u,e._clickPixelTolerance)&&(V.clone(e._primaryPosition,pbe.position),s(pbe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(An.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];V.clone(c,e._primaryPosition),V.clone(c,e._primaryStartPosition),V.clone(c,e._primaryPreviousPosition),e._buttonDown[ks.LEFT]=!0,r=e.getInputAction(An.LEFT_DOWN,n),l(r)&&(V.clone(c,hbe.position),r(hbe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(An.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];A$(u,f,e._holdPixelTolerance)&&(V.clone(e._primaryPosition,_be.position),s(_be))}},Mh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(An.PINCH_START,n),l(r)&&(V.clone(i.values[0],T$.position1),V.clone(i.values[1],T$.position2),r(T$),t.preventDefault()))}function Uht(e,t){S$(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&B0(e,r,u)}Tbe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,V.clone(a.get(s),c.get(s))}var C$={startPosition:new V,endPosition:new V},XD={distance:{startPosition:new V,endPosition:new V},angleAndHeight:{startPosition:new V,endPosition:new V}};function Tbe(e,t){let n=lT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[ks.LEFT]){let a=i.values[0];V.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(An.MOUSE_MOVE,n),l(s)&&(V.clone(c,C$.startPosition),V.clone(a,C$.endPosition),s(C$)),V.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(An.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-a.x,p=c.y-a.y,_=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,x=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,T=(f.y+u.y)*.125,C=Math.atan2(p,d),A=Math.atan2(y,m);V.fromElements(0,x,XD.distance.startPosition),V.fromElements(0,_,XD.distance.endPosition),V.fromElements(A,T,XD.angleAndHeight.startPosition),V.fromElements(C,b,XD.angleAndHeight.endPosition),s(XD)}}function zht(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,B0(e,t,new V)),n4(e,t),e._previousPositions.set(i,V.clone(n.get(i)))}else ybe(e,t)}function gbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),n4(e,t),e._previousPositions.remove(i)}else xbe(e,t)}function Vht(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;B0(e,t,o),Tbe(e,t);let r=e._previousPositions;V.clone(n.get(i),r.get(i))}else bbe(e,t)}function Mh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Mh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new V,this._primaryPosition=new V,this._primaryPreviousPosition=new V,this._positions=new It,this._previousPositions=new It,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,Lht(this)}Mh.prototype.setInputAction=function(e,t,n){let i=E$(t,n);this._inputEvents[i]=e};Mh.prototype.getInputAction=function(e,t){let n=E$(e,t);return this._inputEvents[n]};Mh.prototype.removeInputAction=function(e,t){let n=E$(e,t);delete this._inputEvents[n]};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){return Nht(this),ce(this)};Mh.mouseEmulationIgnoreMilliseconds=800;Mh.touchHoldDelayMilliseconds=1500;var md=Mh;function Hht(e,t,n,i,o,r,s){let a=zi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,_=i.red,m=i.green,y=i.blue,x=i.alpha;if(H.equals(n,i)){for(c=0;c<a;c++)r[s++]=H.floatToByte(u),r[s++]=H.floatToByte(f),r[s++]=H.floatToByte(d),r[s++]=H.floatToByte(p);return s}let b=(_-u)/a,T=(m-f)/a,C=(y-d)/a,A=(x-p)/a,S=s;for(c=0;c<a;c++)r[S++]=H.floatToByte(u+c*b),r[S++]=H.floatToByte(f+c*T),r[S++]=H.floatToByte(d+c*C),r[S++]=H.floatToByte(p+c*A);return S}function KD(e){e=e??G.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??nn.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*H.packedLength:1,this.packedLength=o+te.packedLength+3}KD.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+=h.packedLength)h.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+=H.packedLength)H.pack(s[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};KD.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new KD({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var i4=new Array(2),o4=new Array(2),Ght={positions:i4,height:o4,ellipsoid:void 0,minDistance:void 0,granularity:void 0};KD.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,_,m,y=0;if(o===nn.GEODESIC||o===nn.RHUMB){let A,S,w;o===nn.GEODESIC?(A=P.chordLength(r,s.maximumRadius),S=zi.numberOfPoints,w=zi.generateArc):(A=r,S=zi.numberOfPointsRhumbLine,w=zi.generateRhumbArc);let R=zi.extractHeights(t,s),D=Ght;if(o===nn.GEODESIC?D.minDistance=a:D.granularity=r,D.ellipsoid=s,c){let M=0;for(u=0;u<f-1;u++)M+=S(t[u],t[u+1],A)+1;d=new Float64Array(M*3),_=new Uint8Array(M*4),D.positions=i4,D.height=o4;let L=0;for(u=0;u<f-1;++u){i4[0]=t[u],i4[1]=t[u+1],o4[0]=R[u],o4[1]=R[u+1];let g=w(D);if(l(n)){let E=g.length/3;m=n[u];for(let v=0;v<E;++v)_[L++]=H.floatToByte(m.red),_[L++]=H.floatToByte(m.green),_[L++]=H.floatToByte(m.blue),_[L++]=H.floatToByte(m.alpha)}d.set(g,y),y+=g.length}}else if(D.positions=t,D.height=R,d=new Float64Array(w(D)),l(n)){for(_=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],E=n[u],v=n[u+1];y=Hht(L,g,E,v,a,_,y)}let M=n[f-1];_[y++]=H.floatToByte(M.red),_[y++]=H.floatToByte(M.green),_[y++]=H.floatToByte(M.blue),_[y++]=H.floatToByte(M.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),_=l(n)?new Uint8Array(p*4):void 0;let A=0,S=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(h.pack(w,d,A),A+=3,m=n[u-1],_[S++]=H.floatToByte(m.red),_[S++]=H.floatToByte(m.green),_[S++]=H.floatToByte(m.blue),_[S++]=H.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(w,d,A),A+=3,l(n)&&(m=n[u],_[S++]=H.floatToByte(m.red),_[S++]=H.floatToByte(m.green),_[S++]=H.floatToByte(m.blue),_[S++]=H.floatToByte(m.alpha))}}let x=new pn;x.position=new we({componentDatatype:K.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(x.color=new we({componentDatatype:K.UNSIGNED_BYTE,componentsPerAttribute:4,values:_,normalize:!0})),p=d.length/3;let b=(p-1)*2,T=ke.createTypedArray(p,b),C=0;for(u=0;u<p-1;++u)T[C++]=u,T[C++]=u+1;return new lt({attributes:x,indices:T,primitiveType:Le.LINES,boundingSphere:re.fromPoints(t)})};var Cbe=KD;function HS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Sa(i),this._workerName="createSphereGeometry"}HS.packedLength=Sa.packedLength;HS.pack=function(e,t,n){return Sa.pack(e._ellipsoidGeometry,t,n)};var jht=new Sa,k0={radius:void 0,radii:new h,vertexFormat:new De,stackPartitions:void 0,slicePartitions:void 0};HS.unpack=function(e,t,n){let i=Sa.unpack(e,t,jht);return k0.vertexFormat=De.clone(i._vertexFormat,k0.vertexFormat),k0.stackPartitions=i._stackPartitions,k0.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,k0.radii),n._ellipsoidGeometry=new Sa(k0),n):(k0.radius=i._radii.x,new HS(k0))};HS.createGeometry=function(e){return Sa.createGeometry(e._ellipsoidGeometry)};var Abe=HS;function Wht(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var GS=Wht;var qht={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=qht;function U0(e){}Object.defineProperties(U0.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});U0.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;U0.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;U0.prototype.rectangleToNativeRectangle=he.throwInstantiationError;U0.prototype.tileXYToNativeRectangle=he.throwInstantiationError;U0.prototype.tileXYToRectangle=he.throwInstantiationError;U0.prototype.positionToTileXY=he.throwInstantiationError;var Ebe=U0;function uT(e){e=e??G.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??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(uT.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(uT.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=Yht(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});uT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ce(this)};uT.prototype.isDestroyed=function(){return!1};uT.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};uT.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??Ge.MINIMUM_VALUE,s=$.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Yht(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Sbe=uT;function Xht(e,t){this.rectangle=e,this.maxLevel=t}function vbe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}vbe.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 Kht(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new vi({ellipsoid:e.ellipsoid});else throw new se(`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=Ts.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=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Xht(new ae(a,c,u,f),d))}}function $ht(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Fo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new se(i)}async function Zht(e,t,n){try{let i=await t.fetchXML();Kht(e,i)}catch(i){$ht(t,i,n)}}function z0(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new me,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 _t(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(z0.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(){}}});z0.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=new vbe(t),i=Ee.createIfNeeded(e);await Zht(n,i);let o=new z0(t);return n.build(o),o._resource=i,o};z0.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 Dc({buffer:qh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Qht(a,e,t,n),structure:a._terrainDataStructure})})};z0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var wbe=new ae;function Qht(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ae.intersection(f,s,wbe);l(d)&&(r4(o,f,t*2,n*2,i+1)&&(a|=4),r4(o,f,t*2+1,n*2,i+1)&&(a|=8),r4(o,f,t*2,n*2+1,i+1)&&(a|=1),r4(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function r4(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ae.intersection(r,t,wbe))}z0.prototype.getTileDataAvailable=function(e,t,n){};z0.prototype.loadTileDataAvailability=function(e,t,n){};var Ibe=z0;var Jht={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},Pbe=Object.freeze(Jht);function emt(e){switch(e){case q.FLOAT:return"float";case q.FLOAT_VEC2:return"vec2";case q.FLOAT_VEC3:return"vec3";case q.FLOAT_VEC4:return"vec4";case q.FLOAT_MAT2:return"mat2";case q.FLOAT_MAT3:return"mat3";case q.FLOAT_MAT4:return"mat4";case q.SAMPLER_2D:return"sampler2D";case q.BOOL:return"bool"}}var V0=emt;function tmt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var s4=tmt;async function w$(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[ae.center(e),ae.southeast(e),ae.southwest(e),ae.northeast(e),ae.northwest(e)],u=await w$._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(_,m){return l(m.height)?(f=!0,Math.max(m.height,_)):_},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}w$._sampleTerrainMostDetailed=VS;var jS=w$;var a4=`uniform vec4 u_initialColor; - -#if TEXTURE_UNITS > 0 -uniform sampler2D u_dayTextures[TEXTURE_UNITS]; -uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; -uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; - -#ifdef APPLY_ALPHA -uniform float u_dayTextureAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_DAY_NIGHT_ALPHA -uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; -uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SPLIT -uniform float u_dayTextureSplit[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_BRIGHTNESS -uniform float u_dayTextureBrightness[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_CONTRAST -uniform float u_dayTextureContrast[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_HUE -uniform float u_dayTextureHue[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_SATURATION -uniform float u_dayTextureSaturation[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_GAMMA -uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_IMAGERY_CUTOUT -uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; -#endif - -#ifdef APPLY_COLOR_TO_ALPHA -uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; -#endif - -uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; -#endif - -#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) -uniform sampler2D u_waterMask; -uniform vec4 u_waterMaskTranslationAndScale; -uniform float u_zoomedOutOceanSpecularIntensity; -#endif - -#ifdef SHOW_OCEAN_WAVES -uniform sampler2D u_oceanNormalMap; -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) -uniform vec2 u_lightingFadeDistance; -#endif - -#ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_cartographicLimitRectangle; -#endif - -#ifdef GROUND_ATMOSPHERE -uniform vec2 u_nightFadeDistance; -#endif - -#ifdef ENABLE_CLIPPING_PLANES -uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -#endif - -#ifdef ENABLE_CLIPPING_POLYGONS -uniform highp sampler2D u_clippingDistance; -in vec2 v_clippingPosition; -flat in int v_regionIndex; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) -uniform float u_minimumBrightness; -#endif - -#ifdef COLOR_CORRECT -uniform vec3 u_hsbShift; // 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 - -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -in float v_distance; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -in vec3 v_atmosphereRayleighColor; -in vec3 v_atmosphereMieColor; -in float v_atmosphereOpacity; -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} -#endif - -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) -{ - return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); -} -#endif - -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() -{ - return - v_textureCoordinates.x > u_translucencyRectangle.x && - v_textureCoordinates.x < u_translucencyRectangle.z && - v_textureCoordinates.y > u_translucencyRectangle.y && - v_textureCoordinates.y < u_translucencyRectangle.w; -} -#endif - -vec4 sampleAndBlend( - vec4 previousColor, - sampler2D textureToSample, - vec2 tileTextureCoordinates, - vec4 textureCoordinateRectangle, - vec4 textureCoordinateTranslationAndScale, - float textureAlpha, - float textureNightAlpha, - float textureDayAlpha, - float textureBrightness, - float textureContrast, - float textureHue, - float textureSaturation, - float textureOneOverGamma, - float split, - vec4 colorToAlpha, - float nightBlend) -{ - // This crazy step stuff sets the alpha to 0.0 if this following condition is true: - // tileTextureCoordinates.s < textureCoordinateRectangle.s || - // tileTextureCoordinates.s > textureCoordinateRectangle.p || - // tileTextureCoordinates.t < textureCoordinateRectangle.t || - // tileTextureCoordinates.t > textureCoordinateRectangle.q - // In other words, the alpha is zero if the fragment is outside the rectangle - // covered by this texture. Would an actual 'if' yield better performance? - vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - - alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); - textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); -#endif - - vec2 translation = textureCoordinateTranslationAndScale.xy; - vec2 scale = textureCoordinateTranslationAndScale.zw; - vec2 textureCoordinates = tileTextureCoordinates * scale + translation; - vec4 value = texture(textureToSample, textureCoordinates); - vec3 color = value.rgb; - float alpha = value.a; - -#ifdef APPLY_COLOR_TO_ALPHA - vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); - colorDiff.r = czm_maximumComponent(colorDiff); - alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); -#endif - -#if !defined(APPLY_GAMMA) - vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); - color = tempColor.rgb; - alpha = tempColor.a; -#else - color = pow(color, vec3(textureOneOverGamma)); -#endif - -#ifdef APPLY_SPLIT - float splitPosition = czm_splitPosition; - // Split to the left - if (split < 0.0 && gl_FragCoord.x > splitPosition) { - alpha = 0.0; - } - // Split to the right - else if (split > 0.0 && gl_FragCoord.x < splitPosition) { - alpha = 0.0; - } -#endif - -#ifdef APPLY_BRIGHTNESS - color = mix(vec3(0.0), color, textureBrightness); -#endif - -#ifdef APPLY_CONTRAST - color = mix(vec3(0.5), color, textureContrast); -#endif - -#ifdef APPLY_HUE - color = czm_hue(color, textureHue); -#endif - -#ifdef APPLY_SATURATION - color = czm_saturation(color, textureSaturation); -#endif - - float sourceAlpha = alpha * textureAlpha; - float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); - outAlpha += sign(outAlpha) - 1.0; - - vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; - - // When rendering imagery for a tile in multiple passes, - // some GPU/WebGL implementation combinations will not blend fragments in - // additional passes correctly if their computation includes an unmasked - // divide-by-zero operation, - // even if it's not in the output or if the output has alpha zero. - // - // For example, without sanitization for outAlpha, - // this renders without artifacts: - // if (outAlpha == 0.0) { outColor = vec3(0.0); } - // - // but using czm_branchFreeTernary will cause portions of the tile that are - // alpha-zero in the additional pass to render as black instead of blending - // with the previous pass: - // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); - // - // So instead, sanitize against divide-by-zero, - // store this state on the sign of outAlpha, and correct on return. - - return vec4(outColor, max(outAlpha, 0.0)); -} - -vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); - -const float fExposure = 2.0; - -vec3 computeEllipsoidPosition() -{ - float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); - vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); - xy *= czm_viewport.zw * mpp * 0.5; - - vec3 direction; - if (czm_orthographicIn3D == 1.0) - { - direction = vec3(0.0, 0.0, -1.0); - } - else - { - direction = normalize(vec3(xy, -czm_currentFrustum.x)); - } - - czm_ray ray = czm_ray(vec3(0.0), direction); - - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - - vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); - return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; -} - -void main() -{ -#ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) - { - discard; - } -#endif - -#ifdef ENABLE_CLIPPING_PLANES - float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); -#endif - -#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) - vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates - vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates -#endif - -#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) - float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); -#else - float nightBlend = 0.0; -#endif - - // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 - // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the - // fragments on the edges of tiles even though the vertex shader is outputting - // coordinates strictly in the 0-1 range. - vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); - -#ifdef SHOW_TILE_BOUNDARIES - if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || - v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) - { - color = vec4(1.0, 0.0, 0.0, 1.0); - } -#endif - -#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) - float cameraDist; - if (czm_sceneMode == czm_sceneMode2D) - { - cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; - } - else if (czm_sceneMode == czm_sceneModeColumbusView) - { - cameraDist = -czm_view[3].z; - } - else - { - cameraDist = length(czm_view[3]); - } - float fadeOutDist = u_lightingFadeDistance.x; - float fadeInDist = u_lightingFadeDistance.y; - if (czm_sceneMode != czm_sceneMode3D) { - vec3 radii = czm_ellipsoidRadii; - float maxRadii = max(radii.x, max(radii.y, radii.z)); - fadeOutDist -= maxRadii; - fadeInDist -= maxRadii; - } - float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); -#else - float fade = 0.0; -#endif - -#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL)) - vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; - vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; - vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; - waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; - - float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; - - #ifdef SHOW_REFLECTIVE_OCEAN - if (mask > 0.0) - { - mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); - - vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); - vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); - - vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); - - color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); - } - #endif -#endif - -#ifdef APPLY_MATERIAL - czm_materialInput materialInput; - materialInput.st = v_textureCoordinates.st; - materialInput.normalEC = normalize(v_normalEC); - materialInput.positionToEyeEC = -v_positionEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC)); - materialInput.slope = v_slope; - materialInput.height = v_height; - materialInput.aspect = v_aspect; - #ifdef HAS_WATER_MASK - materialInput.waterMask = mask; - #endif - - czm_material material = czm_getMaterial(materialInput); - vec4 materialColor = vec4(material.diffuse, material.alpha); - color = alphaBlend(materialColor, color); -#endif - -#ifdef ENABLE_VERTEX_LIGHTING - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#elif defined(ENABLE_DAYNIGHT_SHADING) - float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); - diffuseIntensity = mix(1.0, diffuseIntensity, fade); - vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); -#else - vec4 finalColor = color; -#endif - -#ifdef ENABLE_CLIPPING_PLANES - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; - - if (clipDistance < clippingPlanesEdgeWidth) - { - finalColor = clippingPlanesEdgeColor; - } -#endif - -#ifdef ENABLE_CLIPPING_POLYGONS - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -#endif - -#ifdef HIGHLIGHT_FILL_TILE - finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); -#endif - -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) - vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else - vec3 atmosphereLightDirection = czm_lightDirectionWC; -#endif - -#if defined(GROUND_ATMOSPHERE) || defined(FOG) - if (!czm_backFacing()) - { - bool dynamicLighting = false; - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) - dynamicLighting = true; - #endif - - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. - // Otherwise, the scattering is computed in the vertex shader. - #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE - positionWC = computeEllipsoidPosition(); - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - computeAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - #else - positionWC = v_positionMC; - lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - #endif - - #ifdef COLOR_CORRECT - const bool ignoreBlackPixels = true; - rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); - mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); - #endif - - vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - // Fog is applied to tiles selected for fog, close to the Earth. - #ifdef FOG - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is lighting, apply that to the fog. - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); - fogColor *= darken; - #endif - - #ifndef HDR - fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a); - - #else - // Apply ground atmosphere. This happens when the camera is far away from the earth. - - // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. - // This value is larger near the "circumference", as it is further away from the camera. We use it to - // brighten up that area of the ground atmosphere. - const float transmittanceModifier = 0.5; - float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); - - vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; - - #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) - float fadeInDist = u_nightFadeDistance.x; - float fadeOutDist = u_nightFadeDistance.y; - - float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); - float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); - vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); - - finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); - #endif - - #ifndef HDR - finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); - #else - finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); - #endif - - finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); - #endif - } -#endif - -#ifdef UNDERGROUND_COLOR - if (czm_backFacing()) - { - float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); - float distance = max(v_distance - distanceFromEllipsoid, 0.0); - float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); - vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); - finalColor = alphaBlend(undergroundColor, finalColor); - } -#endif - -#ifdef TRANSLUCENT - if (inTranslucencyRectangle()) - { - vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; - finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); - } -#endif - - out_FragColor = finalColor; -} - - -#ifdef SHOW_REFLECTIVE_OCEAN - -float waveFade(float edge0, float edge1, float x) -{ - float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return pow(1.0 - y, 5.0); -} - -float linearFade(float edge0, float edge1, float x) -{ - return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -} - -// Based on water rendering by Jonas Wagner: -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -// low altitude wave settings -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; - -// high altitude wave settings -const float oceanFrequencyHighAltitude = 125000.0; -const float oceanAnimationSpeedHighAltitude = 0.008; -const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; - -vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) -{ - vec3 positionToEyeEC = -positionEyeCoordinates; - float positionToEyeECLength = length(positionToEyeEC); - - // The double normalize below works around a bug in Firefox on Android devices. - vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); - - // Fade out the waves as the camera moves far from the surface. - float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); - -#ifdef SHOW_OCEAN_WAVES - // high altitude waves - float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; - vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); - vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); - - // low altitude waves - time = czm_frameNumber * oceanAnimationSpeedLowAltitude; - noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); - vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); - - // blend the 2 wave layers based on distance to surface - float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); - float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); - vec3 normalTangentSpace = - (highAltitudeFade * normalTangentSpaceHighAltitude) + - (lowAltitudeFade * normalTangentSpaceLowAltitude); - normalTangentSpace = normalize(normalTangentSpace); - - // fade out the normal perturbation as we move farther from the water surface - normalTangentSpace.xy *= waveIntensity; - normalTangentSpace = normalize(normalTangentSpace); -#else - vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); -#endif - - vec3 normalEC = enuToEye * normalTangentSpace; - - const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); - - // Use diffuse light to highlight the waves - float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; - vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); - -#ifdef SHOW_OCEAN_WAVES - // Where diffuse light is low or non-existent, use wave highlights based solely on - // the wave bumpiness and no particular light direction. - float tsPerturbationRatio = normalTangentSpace.z; - vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else - vec3 nonDiffuseHighlight = vec3(0.0); -#endif - - // Add specular highlights in 3D, and in all modes when zoomed in. - float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); - float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); - float specular = specularIntensity * surfaceReflectance; - -#ifdef HDR - specular *= 1.4; - - float e = 0.2; - float d = 3.3; - float c = 1.7; - - vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); -#else - vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; -#endif - - return vec4(color, imageryColor.a); -} - -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var c4=`#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 - -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 - - 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 $D=`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 nmt=new V;function imt(e,t){let n=e.unionClippingRegions,i=e.length,o=Os.useFloatTexture(t),r=Os.getTextureResolution(e,t,nmt),s=r.x,a=r.y,c=o?smt(s,a):amt(s,a);return c+=` -`,c+=n?omt(i):rmt(i),c}function omt(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 rmt(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 smt(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 amt(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 H0=imt;function cmt(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 I$(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function lmt(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 ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function umt(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 fmt(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 dmt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}I$.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.hasWaterMask,_=e.showReflectiveOcean,m=e.showOceanWaves,y=e.enableLighting,x=e.dynamicAtmosphereLighting,b=e.dynamicAtmosphereLightingFromSun,T=e.showGroundAtmosphere,C=e.perFragmentGroundAtmosphere,A=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,R=e.enableClippingPlanes,D=e.clippingPlanes,M=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,E=e.hasImageryLayerCutout,v=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,F=e.hasGeodeticSurfaceNormals,U=e.hasExaggeration,k=e.showUndergroundColor,z=e.translucent,B=0,j="",J=n.renderedMesh.encoding;J.quantization===Ia.BITS12&&(B=1,j="QUANTIZATION_BITS12");let ee=0,Q="";g&&(ee=1,Q="TILE_LIMIT_RECTANGLE");let de=0,ge="";E&&(de=1,ge="APPLY_IMAGERY_CUTOUT");let le=t.mode,ye=le|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|_<<9|m<<10|y<<11|x<<12|b<<13|T<<14|C<<15|A<<16|S<<17|w<<18|B<<19|d<<20|R<<21|M<<22|ee<<23|de<<24|v<<25|I<<26|N<<27|F<<28|U<<29|k<<30|z<<31|f<<32,be=0;l(D)&&D.length>0&&(be=R?D.clippingPlanesState:0);let Ie=0;l(L)&&L.length>0&&(Ie=M?L.clippingPolygonsState:0);let Te=n.surfaceShader;if(l(Te)&&Te.numberOfDayTextures===i&&Te.flags===ye&&Te.material===this.material&&Te.clippingShaderState===be&&Te.clippingPolygonShaderState===Ie)return Te.shaderProgram;let ve=this._shadersByTexturesFlags[i];if(l(ve)||(ve=this._shadersByTexturesFlags[i]=[]),Te=ve[ye],!l(Te)||Te.material!==this.material||Te.clippingShaderState!==be||Te.clippingPolygonShaderState!==Ie){let Ve=this.baseVertexShaderSource.clone(),Ke=this.baseFragmentShaderSource.clone();be!==0&&Ke.sources.unshift(H0(D,t.context)),Ie!==0&&(Ke.sources.unshift(umt(t.context)),Ve.sources.unshift(fmt(t.context))),Ve.defines.push(j),Ke.defines.push(`TEXTURE_UNITS ${i}`,Q,ge),o&&Ke.defines.push("APPLY_BRIGHTNESS"),r&&Ke.defines.push("APPLY_CONTRAST"),s&&Ke.defines.push("APPLY_HUE"),a&&Ke.defines.push("APPLY_SATURATION"),c&&Ke.defines.push("APPLY_GAMMA"),u&&Ke.defines.push("APPLY_ALPHA"),f&&Ke.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&Ke.defines.push("HAS_WATER_MASK"),_&&(Ke.defines.push("SHOW_REFLECTIVE_OCEAN"),Ve.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&Ke.defines.push("SHOW_OCEAN_WAVES"),N&&Ke.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(Ve.defines.push("UNDERGROUND_COLOR"),Ke.defines.push("UNDERGROUND_COLOR")),z&&(Ve.defines.push("TRANSLUCENT"),Ke.defines.push("TRANSLUCENT")),y&&(A?(Ve.defines.push("ENABLE_VERTEX_LIGHTING"),Ke.defines.push("ENABLE_VERTEX_LIGHTING")):(Ve.defines.push("ENABLE_DAYNIGHT_SHADING"),Ke.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),b&&(Ve.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Ve.defines.push("GROUND_ATMOSPHERE"),Ke.defines.push("GROUND_ATMOSPHERE"),C&&(Ve.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ve.defines.push("INCLUDE_WEB_MERCATOR_Y"),Ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(Ve.defines.push("FOG"),Ke.defines.push("FOG")),d&&Ke.defines.push("APPLY_SPLIT"),R&&Ke.defines.push("ENABLE_CLIPPING_PLANES"),M&&(Ke.defines.push("ENABLE_CLIPPING_POLYGONS"),Ve.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&Ke.defines.push("CLIPPING_INVERSE"),Ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),Ve.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),v&&Ke.defines.push("COLOR_CORRECT"),I&&Ke.defines.push("HIGHLIGHT_FILL_TILE"),F&&Ve.defines.push("GEODETIC_SURFACE_NORMALS"),U&&Ve.defines.push("EXAGGERATION");let Ct=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;E&&(Ct+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let Qe=0;Qe<i;++Qe)E?Ct+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Qe}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Ct+=` color = sampleAndBlend( -`,Ct+=` color, - u_dayTextures[${Qe}], - u_dayTextureUseWebMercatorT[${Qe}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${Qe}], - u_dayTextureTranslationAndScale[${Qe}], - ${u?`u_dayTextureAlpha[${Qe}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${Qe}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${Qe}]`:"1.0"}, -${o?`u_dayTextureBrightness[${Qe}]`:"0.0"}, - ${r?`u_dayTextureContrast[${Qe}]`:"0.0"}, - ${s?`u_dayTextureHue[${Qe}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${Qe}]`:"0.0"}, - ${c?`u_dayTextureOneOverGamma[${Qe}]`:"0.0"}, - ${d?`u_dayTextureSplit[${Qe}]`:"0.0"}, - ${N?`u_colorsToAlpha[${Qe}]`:"vec4(0.0)"}, - nightBlend ); -`,E&&(Ct+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Ct+=` return color; - }`,Ke.sources.push(Ct),Ve.sources.push(lmt(le)),Ve.sources.push(dmt(S));let Qt=Xt.fromCache({context:t.context,vertexShaderSource:Ve,fragmentShaderSource:Ke,attributeLocations:J.getAttributeLocations()});Te=ve[ye]=new cmt(i,ye,this.material,Qt,be,Ie)}return n.surfaceShader=Te,Te.shaderProgram};I$.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 ce(this)};var l4=I$;var hmt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ui=Object.freeze(hmt);var mmt={START:0,LOADING:1,DONE:2,FAILED:3},Da=Object.freeze(mmt);var pmt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},go=Object.freeze(pmt);function rr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=go.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new re,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(rr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===go.RECEIVING||e===go.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!==ui.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var _mt=new fe;function P$(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,_mt);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var gmt=new h,ymt=new h,xmt=new h;rr.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,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],_=a[d+1],m=a[d+2],y=P$(c,t,n,s,p,gmt),x=P$(c,t,n,s,_,ymt),b=P$(c,t,n,s,m,xmt),T=ni.rayTriangleParametric(e,y,x,b,i);l(T)&&T<f&&T>=0&&(f=T)}return f!==Number.MAX_VALUE?gn.getPoint(e,f,o):void 0};rr.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=go.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()};rr.prototype.freeVertexArray=function(){rr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,rr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};rr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new rr),e.state===Da.START&&(bmt(e,t,n),e.state=Da.LOADING)};rr.processStateMachine=function(e,t,n,i,o,r,s){rr.initialize(e,n,i);let a=e.data;if(e.state===Da.LOADING&&Tmt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===go.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let _ in d)d.hasOwnProperty(_)&&(d[_](e)||(p[_]=d[_]));e._loadedCallbacks=p,e.state=Da.DONE}c&&(e.renderable=!0)};rr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===ui.PLACEHOLDER){let _=d.loadingImagery.imageryLayer;if(_.ready){d.freeResources(),c.splice(u,1),_._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===ui.FAILED||d.loadingImagery.state===ui.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Dbe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=gl.clone(s);c.hasGeodeticSurfaceNormals=t,c=gl.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(rr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=rr._createVertexArrayForMesh(i.context,o)):(rr._freeVertexArray(e.vertexArray),e.vertexArray=rr._createVertexArrayForMesh(i.context,o)),rr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}rr.prototype.addGeodeticSurfaceNormals=function(e,t){Dbe(this,!0,e,t)};rr.prototype.removeGeodeticSurfaceNormals=function(e){Dbe(this,!1,void 0,e)};rr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let _=0;_<p;_++){let m=d[_];m.level=-1}}}};function bmt(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=go.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Tmt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===go.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||rr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===go.FAILED&&Cmt(s,e,t,n,e.x,e.y,e.level),s.terrainState===go.UNLOADED&&Amt(s,n,e.x,e.y,e.level),s.terrainState===go.RECEIVED&&Smt(s,t,n,e.x,e.y,e.level),s.terrainState===go.TRANSFORMED&&(vmt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=go.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Imt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Cmt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Da.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=go.RECEIVING,Promise.resolve(p).then(function(_){l(_)&&(e.terrainData=_,e.terrainState=go.RECEIVED)}).catch(function(){e.terrainState=go.FAILED}))}function Amt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=go.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=go.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Xn.CANCELLED){e.terrainData=void 0,e.terrainState=go.UNLOADED,e.request=void 0;return}e.terrainState=go.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Fo.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new ur({throttle:!1,throttleByServer:!0,type:Is.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o);l(u)?(e.terrainState=go.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=go.UNLOADED,e.request=void 0)}a()}var Emt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Smt(e,t,n,i,o,r){let s=n.tilingScheme,a=Emt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=go.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=go.TRANSFORMED}).catch(function(){e.terrainState=go.FAILED}))}rr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=st.createVertexBuffer({context:e,typedArray:n,usage:Ne.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=st.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new qn({context:e,attributes:o,indexBuffer:s})};rr._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 vmt(e,t,n,i,o,r,s){e.vertexArray=rr._createVertexArrayForMesh(t,e.mesh),e.terrainState=go.READY,e.fill=e.fill&&e.fill.destroy(s)}function wmt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=dt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Imt(e,t){let n=t.terrainData.waterMask,i=wmt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=dt.create({context:e,pixelFormat:je.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ie.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}rr.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};rr.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 Lh=rr;var D$,Rbe="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",WS={};WS.defaultAccessToken=Rbe;WS.defaultWorldImageryServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});WS.defaultWorldHillshadeServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});WS.defaultWorldOceanServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});WS.getDefaultTokenCredit=function(e){if(e===Rbe){if(!l(D$)){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>';D$=new _t(t,!0)}return D$}};var pd=WS;function R$(e){e=e??G.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ee.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=qh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],_=p.x*4+p.y*c;s[_+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)}R$.prototype.isReady=function(){return this._isReady};R$.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=qh(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var u4=R$;function O$(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}O$.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])};O$.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 up=O$;function qS(){he.throwInstantiationError()}Object.defineProperties(qS.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});qS.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};qS.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};qS.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var Pmt=/\.ktx2$/i;qS.loadImage=function(e,t){let n=Ee.createIfNeeded(t);return Pmt.test(n.url)?fa(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var lu=qS;var Dmt={SATELLITE:1,OCEANS:2,HILLSHADE:3},fp=Object.freeze(Dmt);function Obe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new vi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new _t(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}Obe.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 u4({missingImageUrl:Mbe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new V(0,0),new V(200,20),new V(20,200),new V(80,110),new V(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Rmt(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 Cs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new vi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new se(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 ki,o=e.fullExtent,r=i.unproject(new h(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 h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ae(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ae.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 se(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new _t(e.copyrightText)]:t.credit=new _t(e.copyrightText))}function Omt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new se(n)}async function Mmt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Rmt(i,t)}catch(i){Omt(e,i)}}function dp(e){e=e??G.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new vi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new _t(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new me}dp.fromBasemapType=async function(e,t){t=t??G.EMPTY_OBJECT;let n,i,o;switch(e){case fp.SATELLITE:{n=t.token??pd.defaultAccessToken,i=Ee.createIfNeeded(pd.defaultWorldImageryServer),i.appendForwardSlash();let r=pd.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;case fp.OCEANS:{n=t.token??pd.defaultAccessToken,i=Ee.createIfNeeded(pd.defaultWorldOceanServer),i.appendForwardSlash();let r=pd.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;case fp.HILLSHADE:{n=t.token??pd.defaultAccessToken,i=Ee.createIfNeeded(pd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=pd.getDefaultTokenCredit(n);l(r)&&(o=_t.clone(r))}break;default:}return dp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Mbe(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 Fi?(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(dp.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}}});dp.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new dp(t);i._resource=n;let o=new Obe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Mmt(n,o),o.build(i),i};dp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};dp.prototype.requestImage=function(e,t,n,i){return lu.loadImage(this,Mbe(this,e,t,n,i))};dp.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 Fi)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let _=[],m=p.results;if(!l(m))return _;for(let y=0;y<m.length;++y){let x=m[y],b=new up;if(b.data=x,b.name=x.value,b.properties=x.attributes,b.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let T=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(T===4326||T===4283)b.position=fe.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(T===102100||T===900913||T===3857){let C=new ki;b.position=C.unproject(new h(x.geometry.x,x.geometry.y,x.geometry.z))}}_.push(b)}return _})};dp._metadataCache={};var G0=dp;var Lmt={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"},ZD=Object.freeze(Lmt);function QD(e){}QD.prototype.isReady=function(){return!0};QD.prototype.shouldDiscardImage=function(e){return QD.EMPTY_IMAGE===e};var f4;Object.defineProperties(QD,{EMPTY_IMAGE:{get:function(){return l(f4)||(f4=new Image,f4.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),f4}}});var JD=QD;function Lbe(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}Lbe.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 _t)break;o.credit=new _t(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new ae(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function Nmt(e,t){if(e.resourceSets.length!==1)throw new se("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 Fmt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Fo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new se(i)}async function Bmt(e,t,n){let i=e.url,o=Us._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Us._metadataCache[i]=o);try{let r=await o;return Nmt(r,t)}catch(r){Fmt(e,r,n)}}function Us(e){e=e??G.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??ZD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new JD),this._proxy=e.proxy,this._credit=new _t(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Us.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Cs({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 me}Object.defineProperties(Us.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)}}});Us.fromUrl=async function(e,t){t=t??G.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??ZD.AERIAL,o=Ee.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 Us(t);a._resource=o;let c=new Lbe(t);return await Bmt(s,c),c.build(a),a};var kmt=new ae;Us.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,kmt);return Vmt(this._attributionList,n,i)};Us.prototype.requestImage=function(e,t,n,i){let o=lu.loadImage(this,Umt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?JD.EMPTY_IMAGE:Promise.reject(r)})};Us.prototype.pickFeatures=function(e,t,n,i,o){};Us.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};Us.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}};Us._logoUrl=void 0;Object.defineProperties(Us,{logoUrl:{get:function(){return l(Us._logoUrl)||(Us._logoUrl=on("Assets/Images/bing_maps_credit.png")),Us._logoUrl},set:function(e){Us._logoUrl=e}}});function Umt(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:Us.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var zmt=new ae;function Vmt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ae.intersection(n,d.bbox,zmt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Us._metadataCache={};var d4=Us;var Nbe=/{[^}]+}/g,Fbe={x:Wmt,y:Ymt,z:$mt,s:Zmt,reverseX:qmt,reverseY:Xmt,reverseZ:Kmt,westDegrees:Qmt,southDegrees:Jmt,eastDegrees:ept,northDegrees:tpt,westProjected:npt,southProjected:ipt,eastProjected:opt,northProjected:rpt,width:spt,height:apt},Hmt=ct(Fbe,{i:cpt,j:lpt,reverseI:upt,reverseJ:fpt,longitudeDegrees:hpt,latitudeDegrees:mpt,longitudeProjected:ppt,latitudeProjected:_pt,format:ypt});function e1(e){e=e??G.EMPTY_OBJECT,this._errorEvent=new me;let t=Ee.createIfNeeded(e.url),n=Ee.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 Cs({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ae.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new _t(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=ct(Fbe,r),a=ct(Hmt,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(e1.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}}});e1.prototype.getTileCredits=function(e,t,n){};e1.prototype.requestImage=function(e,t,n,i){return lu.loadImage(this,Gmt(this,e,t,n,i))};e1.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=jmt(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var h4=!1,Xu=new ae,m4=!1,t1=new ae;function Gmt(e,t,n,i,o){h4=!1,m4=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(Nbe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var M$=!1,XS=new V,L$=!1;function jmt(e,t,n,i,o,r,s){h4=!1,m4=!1,M$=!1,L$=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Nbe);return l(d)&&d.forEach(function(p){let _=p.substring(1,p.length-1);l(u[_])&&(f[_]=u[_](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function KS(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 Wmt(e,t,n,i){return KS(e,"{x}",t)}function qmt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return KS(e,"{reverseX}",o)}function Ymt(e,t,n,i){return KS(e,"{y}",n)}function Xmt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return KS(e,"{reverseY}",o)}function Kmt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return KS(e,"{reverseZ}",r)}function $mt(e,t,n,i){return KS(e,"{z}",i)}function Zmt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function p4(e,t,n,i){h4||(e.tilingScheme.tileXYToRectangle(t,n,i,Xu),Xu.west=P.toDegrees(Xu.west),Xu.south=P.toDegrees(Xu.south),Xu.east=P.toDegrees(Xu.east),Xu.north=P.toDegrees(Xu.north),h4=!0)}function Qmt(e,t,n,i){return p4(e,t,n,i),Xu.west}function Jmt(e,t,n,i){return p4(e,t,n,i),Xu.south}function ept(e,t,n,i){return p4(e,t,n,i),Xu.east}function tpt(e,t,n,i){return p4(e,t,n,i),Xu.north}function _4(e,t,n,i){m4||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,t1),m4=!0)}function npt(e,t,n,i){return _4(e,t,n,i),t1.west}function ipt(e,t,n,i){return _4(e,t,n,i),t1.south}function opt(e,t,n,i){return _4(e,t,n,i),t1.east}function rpt(e,t,n,i){return _4(e,t,n,i),t1.north}function spt(e,t,n,i){return e.tileWidth}function apt(e,t,n,i){return e.tileHeight}function cpt(e,t,n,i,o,r,s){return g4(e,t,n,i,o,r),XS.x}function lpt(e,t,n,i,o,r,s){return g4(e,t,n,i,o,r),XS.y}function upt(e,t,n,i,o,r,s){return g4(e,t,n,i,o,r),e.tileWidth-XS.x-1}function fpt(e,t,n,i,o,r,s){return g4(e,t,n,i,o,r),e.tileHeight-XS.y-1}var dpt=new ae,YS=new h;function g4(e,t,n,i,o,r,s){if(M$)return;N$(e,t,n,i,o,r);let a=YS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,dpt);XS.x=e.tileWidth*(a.x-c.west)/c.width|0,XS.y=e.tileHeight*(c.north-a.y)/c.height|0,M$=!0}function hpt(e,t,n,i,o,r,s){return P.toDegrees(o)}function mpt(e,t,n,i,o,r,s){return P.toDegrees(r)}function ppt(e,t,n,i,o,r,s){return N$(e,t,n,i,o,r),YS.x}function _pt(e,t,n,i,o,r,s){return N$(e,t,n,i,o,r),YS.y}var gpt=new fe;function N$(e,t,n,i,o,r,s){if(!L$){if(e.tilingScheme.projection instanceof Fi)YS.x=P.toDegrees(o),YS.y=P.toDegrees(r);else{let a=gpt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,YS)}L$=!0}}function ypt(e,t,n,i,o,r,s){return s}var Oc=e1;function _d(e){Oc.call(this,e)}_d._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return _d._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Op)return _d._metadataFailure(e,t);throw o}};_d.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??G.EMPTY_OBJECT;let r=await _d._requestMetadata(t,i,o);return new _d(r)};l(Object.create)&&(_d.prototype=Object.create(Oc.prototype),_d.prototype.constructor=_d);function Bbe(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 kbe(e,t,n){let i=e.positionToTileXY(ae.southwest(t),n),o=e.positionToTileXY(ae.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}_d._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],_=e.childNodes[0].childNodes;for(let D=0;D<_.length;D++)if(r.test(_.item(D).nodeName))u=_.item(D);else if(a.test(_.item(D).nodeName)){d=_.item(D);let M=_.item(D).childNodes;for(let L=0;L<M.length;L++)s.test(M.item(L).nodeName)&&p.push(M.item(L))}else c.test(_.item(D).nodeName)&&(f=_.item(D));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Fo.reportError(void 0,o,o.errorEvent,m),new se(m);let y=t.fileExtension??u.getAttribute("extension"),x=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),T=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),C=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),A=d.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(A==="geodetic"||A==="global-geodetic")S=new vi({ellipsoid:t.ellipsoid});else if(A==="mercator"||A==="global-mercator")S=new Cs({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${A}.`,l(o)&&Fo.reportError(void 0,o,o.errorEvent,m),new se(m);let w=ae.clone(t.rectangle);if(!l(w)){let D,M,L,g;t.flipXY??!1?(L=new V(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new V(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new V(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new V(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let v=A==="geodetic"||A==="mercator";if(S.projection instanceof Fi||v)D=fe.fromDegrees(L.x,L.y),M=fe.fromDegrees(g.x,g.y);else{let I=S.projection;D=I.unproject(L),M=I.unproject(g)}w=new ae(D.longitude,D.latitude,M.longitude,M.latitude)}return w=Bbe(w,S),T=kbe(S,w,T),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:S,rectangle:w,tileWidth:x,tileHeight:b,minimumLevel:T,maximumLevel:C,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};_d._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 Cs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Bbe(a,s);let c=kbe(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 fT=_d;function Ube(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Ube.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function xpt(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 se(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new se(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Cs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new se(o)}return!0}function bpt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Fo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new se(i)}async function Tpt(e,t,n){try{let i=await e.fetchText();xpt(i,t)}catch(i){bpt(i,e,n)}}function uu(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 _t(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${uu.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 me}Object.defineProperties(uu.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}}});uu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=Ee.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 Ube(n);s.channel=t,await Tpt(r,s);let a=new uu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};uu.prototype.getTileCredits=function(e,t,n){};uu.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 lu.loadImage(this,o)};uu.prototype.pickFeatures=function(e,t,n,i,o){};uu._logoUrl=void 0;Object.defineProperties(uu,{logoUrl:{get:function(){return l(uu._logoUrl)||(uu._logoUrl=on("Assets/Images/google_earth_credit.png")),uu._logoUrl},set:function(e){uu._logoUrl=e}}});var y4=uu;var Cpt=/\/$/,zbe=new _t('© <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 $S(e){e=e??G.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=Ee.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();Cpt.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 _t(s))):s=zbe,this._resource=i,this._imageryProvider=new Oc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties($S.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}}});$S.prototype.getTileCredits=function(e,t,n){};$S.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};$S.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};$S._defaultCredit=zbe;var x4=$S;function dT(e){e=e??G.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??ae.MAX_VALUE,n=new vi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new me;let i=e.credit;typeof i=="string"&&(i=new _t(i)),this._credit=i;let o=Ee.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(dT.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 Apt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Fo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return F$(e,n,r);throw l(n)&&(n._hasError=!0),new se(o)}async function F$(e,t,n){try{return await lu.loadImage(null,e)}catch(i){return Apt(e,i,t,n)}}dT.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e),i=await F$(n);t=t??G.EMPTY_OBJECT;let o=new dT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};dT.prototype.getTileCredits=function(e,t,n){};dT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await F$(this._resource,this);return this._image=o,Fo.reportSuccess(this._errorEvent),o}return this._image};dT.prototype.pickFeatures=function(e,t,n,i,o){};var b4=dT;function Ept(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=Spt:e==="xml"?n=Ppt:(e==="html"||e==="text")&&(n=Vbe)),this.callback=n}function Spt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new up;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=fe.fromDegrees(s,a)}t.push(r)}return t}var B$="http://www.mapinfo.com/mxp",vpt="http://www.esri.com/wms",wpt="http://www.opengis.net/wfs",Ipt="http://www.opengis.net/gml";function Ppt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===B$)return Dpt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===vpt)return Rpt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===wpt)return Opt(e);if(t.localName==="ServiceExceptionReport")throw new se(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Mpt(e):Lpt(e)}function Dpt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(B$,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(B$,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new up;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Rpt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(T4(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(T4(a,i))}}return n}function Opt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Ipt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};k$(r,s),t.push(T4(r,s))}return t}function Mpt(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 se("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={};k$(s,a),t.push(T4(s,a))}}return t}function k$(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()&&k$(o,t)&&(t[o.localName]=o.textContent)}return n}function T4(e,t){let n=new up;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Lpt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new up;return o.data=e,o.description=n.innerHTML,[o]}var Npt=/<body>\s*<\/body>/im,Fpt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Bpt=/<title>([\s\S]*)<\/title>/im;function Vbe(e){if(Npt.test(e)||Fpt.test(e))return;let t,n=Bpt.exec(e);n&&n.length>1&&(t=n[1]);let i=new up;return i.name=t,i.description=e,i.data=e,[i]}var ZS=Ept;function n1(e){e=e??G.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(n1.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)}}});n1.prototype.getFromCache=function(e,t,n,i){let o=Hbe(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};n1.prototype.checkApproachingInterval=function(e,t,n,i){let o=Hbe(e,t,n),r=this._tilesRequestedForInterval,s=Gbe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!jbe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};n1.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=Gbe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=jbe(this,c,r),a||s.push(c)}}};function Hbe(e,t,n){return`${e}-${t}-${n}`}function kpt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Gbe(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=$.secondsDifference(c.stop,i),++a):(s=$.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function jbe(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=kpt(s),c=new ur({throttle:!1,throttleByServer:!0,type:Is.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var QS=n1;var Upt=[3034,3035,3042,3043,3044],zpt=[4471,4559];function Nh(e){if(e=e??G.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new he("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=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Nh.DefaultParameters,!0),n.setQueryParameters(Nh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Wbe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Wbe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new QS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return qbe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof ki?"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&&!zpt.includes(a)||Upt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof ki?"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 Oc({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new vi({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Nh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function qbe(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 Vpt(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=qbe(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 Vpt(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 ZS("json","application/json")),Object.freeze(new ZS("xml","text/xml")),Object.freeze(new ZS("text","text/html"))]);function Wbe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var C4=Nh;var Hpt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function i1(e){e=e??G.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=Ee.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(Hpt),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),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 Cs({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 QS({clock:e.clock,times:e.times,requestImageFunction:function(d,p,_,m,y){return Ybe(s,d,p,_,m,y)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ae.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ae.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new me;let f=e.credit;this._credit=typeof f=="string"?new _t(f):f,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 Ybe(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let _={};_.tilematrix=a,_.layer=e._layer,_.style=e._style,_.tilerow=n,_.tilecol=t,_.tilematrixset=e._tileMatrixSetID,_.format=e._format,l(u)&&(_=ct(_,u)),l(f)&&(_=ct(_,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:_,request:o}),d.setTemplateValues(p)}return lu.loadImage(e,d)}Object.defineProperties(i1.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())}}});i1.prototype.getTileCredits=function(e,t,n){};i1.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=Ybe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};i1.prototype.pickFeatures=function(e,t,n,i,o){};var A4=i1;var Gpt={ARCGIS_MAPSERVER:G0.fromUrl,BING:async(e,t)=>d4.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,y4.fromUrl(e,n,t)},MAPBOX:(e,t)=>new x4({url:e,...t}),SINGLE_TILE:b4.fromUrl,TMS:fT.fromUrl,URL_TEMPLATE:(e,t)=>new Oc({url:e,...t}),WMS:(e,t)=>new C4({url:e,...t}),WMTS:(e,t)=>new A4({url:e,...t})};function hp(e){e=e??G.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 me}Object.defineProperties(hp.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(){}}});hp.fromAssetId=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Rf._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=hp._endpointCache[i];l(o)||(o=n.fetchJson(),hp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new se(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await fT.fromUrl(new Rf(r,n));else{let u=Gpt[a];if(!l(u))throw new se(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new hp(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Rf.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};hp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};hp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hp._endpointCache={};var j0=hp;var jpt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},W0=Object.freeze(jpt);function Wpt(e){e=e??G.EMPTY_OBJECT;let t=e.style??W0.AERIAL;return j0.fromAssetId(t)}var q0=Wpt;var E4=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var S4=`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)); -} -`;function JS(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=ui.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}JS.createPlaceholder=function(e){let t=new JS(e,0,0,0);return t.addReference(),t.state=ui.PLACEHOLDER,t};JS.prototype.addReference=function(){++this.referenceCount};JS.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(),ce(this),0):this.referenceCount};JS.prototype.processStateMachine=function(e,t,n){this.state===ui.UNLOADED&&!n&&(this.state=ui.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ui.RECEIVED&&(this.state=ui.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ui.READY&&t&&!this.texture;(this.state===ui.TEXTURE_LOADED||i)&&(this.state=ui.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var o1=JS;function U$(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}U$.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};U$.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ui.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!==ui.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ui.FAILED&&r.state!==ui.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===ui.FAILED||i.state===ui.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var r1=U$;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new me,this._errorEvent=new me,t=t??G.EMPTY_OBJECT,e=e??G.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??Ti.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ti.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ti.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ti.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ti.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ti.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ti.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ti.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ae.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new r1(o1.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??Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ti.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}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=Jr.NONE;Ti.DEFAULT_MINIFICATION_FILTER=ft.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=Kn.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return $pt(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=e??G.EMPTY_OBJECT,Ti.fromProviderAsync(q0({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return ce(this)};var $be=new ae,Xbe=new ae,z$=new ae,Zbe=new ae;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ae.intersection(e.rectangle,t)};Ti.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 ki&&e.rectangle.north<ki.MaximumLatitude&&e.rectangle.south>-ki.MaximumLatitude,s=ae.intersection(o.rectangle,this._rectangle,$be),a=ae.intersection(e.rectangle,s,Xbe);if(!l(a)){if(!this.isBaseLayer())return!1;let v=s,I=e.rectangle;a=Xbe,I.south>=v.north?a.north=a.south=v.north:I.north<=v.south?a.north=a.south=v.south:(a.south=Math.max(I.south,v.south),a.north=Math.min(I.north,v.north)),I.west>=v.east?a.west=a.east=v.east:I.east<=v.west?a.west=a.east=v.west:(a.west=Math.max(I.west,v.west),a.east=Math.min(I.east,v.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Xpt(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let v=o.minimumLevel;d<v&&(d=v)}let _=o.tilingScheme,m=_.positionToTileXY(ae.northwest(a),d),y=_.positionToTileXY(ae.southeast(a),d),x=e.rectangle.width/512,b=e.rectangle.height/512,T=_.tileXYToRectangle(m.x,m.y,d);Math.abs(T.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(T.east-e.rectangle.west)<x&&m.x<y.x&&++m.x;let C=_.tileXYToRectangle(y.x,y.y,d);Math.abs(C.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(C.west-e.rectangle.east)<x&&y.x>m.x&&--y.x;let A=ae.clone(e.rectangle,Zbe),S=_.tileXYToRectangle(m.x,m.y,d),w=ae.intersection(S,s,z$),R;r?(_.rectangleToNativeRectangle(A,A),_.rectangleToNativeRectangle(S,S),_.rectangleToNativeRectangle(w,w),_.rectangleToNativeRectangle(s,s),R=_.tileXYToNativeRectangle.bind(_),x=A.width/512,b=A.height/512):R=_.tileXYToRectangle.bind(_);let D,M=0,L=1,g;!this.isBaseLayer()&&Math.abs(w.west-A.west)>=x&&(M=Math.min(1,(w.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(w.north-A.north)>=b&&(L=Math.max(0,(w.north-A.south)/A.height));let E=L;for(let v=m.x;v<=y.x;v++)if(D=M,S=R(v,m.y,d),w=ae.simpleIntersection(S,s,z$),!!l(w)){M=Math.min(1,(w.east-A.west)/A.width),v===y.x&&(this.isBaseLayer()||Math.abs(w.east-A.east)<x)&&(M=1),L=E;for(let I=m.y;I<=y.y;I++){if(g=L,S=R(v,I,d),w=ae.simpleIntersection(S,s,z$),!l(w))continue;L=Math.max(0,(w.south-A.south)/A.height),I===y.y&&(this.isBaseLayer()||Math.abs(w.south-A.south)<b)&&(L=0);let N=new ie(D,L,M,g),F=this.getImageryFromCache(v,I,d);i.imagery.splice(n,0,new r1(F,N,r)),++n}}return!0};Ti.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,$be),i=c.rectangleToNativeRectangle(i,Zbe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ie(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ui.RECEIVED,e.request=void 0,Fo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Xn.CANCELLED){e.state=ui.UNLOADED,e.request=void 0;return}e.state=ui.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Fo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new ur({throttle:!1,throttleByServer:!0,type:Is.IMAGERY});e.request=s,e.state=ui.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level);if(!l(a)){e.state=ui.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new zt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?je.RGBA:je.RGB,sampler:n})};Ti.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=ui.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ui.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof ki?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ui.TEXTURE_LOADED};function Kbe(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===ft.LINEAR&&i===Kn.LINEAR&&!je.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=ft.LINEAR_MIPMAP_LINEAR;let r=Lt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Kbe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Fd.NICEST),t.sampler=u}else{let r=Kbe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.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 Fi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Fa({persists:!0,owner:this,preExecute:function(c){Ypt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ui.READY,t.releaseReference()},canceled:function(){t.state=ui.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ui.READY};Ti.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};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=Qbe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new o1(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=Qbe(e.x,e.y,e.level);delete this._imageryCache[t]};function Qbe(e,t,n){return JSON.stringify([e,t,n])}var v4={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new V,texture:void 0},qpt=Ft.supportsTypedArrays()?new Float32Array(2*64):void 0;function Ypt(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),b=0;for(let w=0;w<64;++w){let R=w/63;x[b++]=0,x[b++]=R,x[b++]=1,x[b++]=R}let T={position:0,webMercatorT:1},C=Ts.getRegularGridIndices(2,64),A=st.createIndexBuffer({context:t,typedArray:C,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});o.vertexArray=new qn({context:t,attributes:[{index:T.position,vertexBuffer:st.createVertexBuffer({context:t,typedArray:x,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:T.webMercatorT,vertexBuffer:st.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:A});let S=new Be({sources:[S4]});o.shaderProgram=Xt.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:E4,attributeLocations:T}),o.sampler=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;v4.textureDimensions.x=r,v4.textureDimensions.y=s,v4.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new dt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&d.generateMipmap(Fd.NICEST);let p=i.south,_=i.north,m=qpt,y=0;for(let x=0;x<64;++x){let b=x/63,T=P.lerp(p,_,b);a=Math.sin(T);let A=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=A,m[y++]=A}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=v4,e.vertexArray=o.vertexArray}function Xpt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Fi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Kpt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function $pt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Kpt(e._errorEvent,i)}}var Mc=Ti;var Jbe={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>=Jbe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},$n=Jbe;function tv(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie}tv.prototype.update=function(e,t,n){this.changedThisFrame&&(sTe(e,t,this.tile,n),this.changedThisFrame=!1)};tv.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};tv.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Lh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Zpt=new Wl;tv.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Zpt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);zs(e,n,c,u,s,yn.EAST,!1,a,i),zs(e,n,c,f,s,yn.NORTH,!1,a,i),zs(e,n,c,d,s,yn.WEST,!1,a,i),zs(e,n,c,p,s,yn.SOUTH,!1,a,i);let _=u.findTileToNorth(r),m=u.findTileToSouth(r),y=d.findTileToNorth(r),x=d.findTileToSouth(r);zs(e,n,c,_,s,yn.SOUTHEAST,!1,a,i),zs(e,n,c,y,s,yn.SOUTHWEST,!1,a,i),zs(e,n,c,m,s,yn.NORTHEAST,!1,a,i),zs(e,n,c,x,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function zs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||$n.wasKicked(u._lastSelectionResult)||$n.originalResult(u._lastSelectionResult)===$n.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===$n.RENDERED){if(l(u.data.vertexArray))return;Qpt(e,t,n,u,r,o,a,c);return}if($n.originalResult(i._lastSelectionResult)!==$n.CULLED)switch(r){case yn.WEST:zs(e,t,n,i.northwestChild,o,r,!0,a,c),zs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:zs(e,t,n,i.southeastChild,o,r,!0,a,c),zs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:zs(e,t,n,i.southwestChild,o,r,!0,a,c),zs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:zs(e,t,n,i.northeastChild,o,r,!0,a,c),zs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:zs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:zs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:zs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:zs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function Qpt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new tv(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Jpt(e,t,n,i,o,a)}function Jpt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(sTe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,_,m,y=n.rectangle,x,b=i.rectangle;switch(o){case yn.WEST:for(x=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!P.greaterThan(y.north,m.south,x));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(y.south,m.north,x));++p);break;case yn.SOUTH:for(x=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!P.lessThan(y.west,m.east,x));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(y.east,m.west,x));++p);break;case yn.EAST:for(x=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!P.lessThan(y.south,m.north,x));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(y.north,m.south,x));++p);break;case yn.NORTH:for(x=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(_=f[d],m=_.rectangle,!P.greaterThan(y.east,m.west,x));++d);for(p=d;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(y.west,m.east,x));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var hT=new fe,e_t=new fe,ev=new h,j$=new h,V$=new V,H$=new V,Ku=new V;function M4(){this.height=0,this.encodedNormal=new V}function w4(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,_=0;l(d)&&(p=d.minimumHeight,_=d.maximumHeight),u=(p+_)*.5}return aTe(e,t,n,i,u,c),c}var t_t={minimumHeight:0,maximumHeight:0},n_t=new h,eTe=new M4,tTe=new M4,nTe=new M4,iTe=new M4,i_t=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,o_t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function sTe(e,t,n,i){Lh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=P4(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,nTe),p=P4(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,eTe),_=P4(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,tTe),m=P4(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,iTe);d=w4(r,f,0,1,d,p,m,_,nTe),p=w4(r,f,0,0,p,d,_,m,eTe),_=w4(r,f,1,1,_,p,m,d,tTe),m=w4(r,f,1,1,m,_,d,p,iTe);let y=p.height,x=_.height,b=d.height,T=m.height,C=Math.min(y,x,b,T),A=Math.max(y,x,b,T),S=(C+A)*.5,w,R,D=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-D,L=Math.acos(M/f.maximumRadius)*4;if(L*=1.5,s.width>L&&A-C<=D){let v=new Dc({width:9,height:9,buffer:i_t,structure:{heightOffset:A}}),I=o_t;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=v._createMeshSync(I)}else{let v=u,I=ae.center(s,e_t);I.height=S;let N=f.cartographicToCartesian(I,n_t),F=new gl(N,void 0,void 0,void 0,void 0,!0,!0,v,a,c),U=5,k;for(k=r.westMeshes,w=0,R=k.length;w<R;++w)U+=k[w].eastIndicesNorthToSouth.length;for(k=r.southMeshes,w=0,R=k.length;w<R;++w)U+=k[w].northIndicesWestToEast.length;for(k=r.eastMeshes,w=0,R=k.length;w<R;++w)U+=k[w].westIndicesSouthToNorth.length;for(k=r.northMeshes,w=0,R=k.length;w<R;++w)U+=k[w].southIndicesEastToWest.length;let z=t_t;z.minimumHeight=C,z.maximumHeight=A;let B=F.stride,j=new Float32Array(U*B),W=0,J=W;W=I4(f,s,F,j,W,0,1,d.height,d.encodedNormal,1,z),W=R4(r,f,F,j,W,r.westTiles,r.westMeshes,yn.EAST,z);let Y=W;W=I4(f,s,F,j,W,0,0,p.height,p.encodedNormal,0,z),W=R4(r,f,F,j,W,r.southTiles,r.southMeshes,yn.NORTH,z);let ee=W;W=I4(f,s,F,j,W,1,0,_.height,_.encodedNormal,0,z),W=R4(r,f,F,j,W,r.eastTiles,r.eastMeshes,yn.WEST,z);let Q=W;W=I4(f,s,F,j,W,1,1,m.height,m.encodedNormal,1,z),W=R4(r,f,F,j,W,r.northTiles,r.northMeshes,yn.SOUTH,z),C=z.minimumHeight,A=z.maximumHeight;let de=Pn.fromRectangle(s,C,A,n.tilingScheme.ellipsoid),ge=ki.geodeticLatitudeToMercatorAngle(s.south),le=1/(ki.geodeticLatitudeToMercatorAngle(s.north)-ge),ye=(ki.geodeticLatitudeToMercatorAngle(I.latitude)-ge)*le,be=f.geodeticSurfaceNormalCartographic(hT,j$),Ie=Mn.octEncode(be,V$),Te=W;F.encode(j,W*B,de.center,V.fromElements(.5,.5,Ku),S,Ie,ye,be),++W;let ve=W,Ve=ve<256?1:2,Ke=(ve-1)*3,Ct=Ke*Ve,Qt=(j.length-ve*B)*Float32Array.BYTES_PER_ELEMENT,Qe;if(Qt>=Ct){let Ht=ve*B*Float32Array.BYTES_PER_ELEMENT;Qe=ve<256?new Uint8Array(j.buffer,Ht,Ke):new Uint16Array(j.buffer,Ht,Ke)}else Qe=ve<256?new Uint8Array(Ke):new Uint16Array(Ke);j=new Float32Array(j.buffer,0,ve*B);let hn=0;for(w=0;w<ve-2;++w)Qe[hn++]=Te,Qe[hn++]=w,Qe[hn++]=w+1;Qe[hn++]=Te,Qe[hn++]=w,Qe[hn++]=0;let Nt=[];for(w=Y;w>=J;--w)Nt.push(w);let Rt=[];for(w=ee;w>=Y;--w)Rt.push(w);let Zn=[];for(w=Q;w>=ee;--w)Zn.push(w);let gi=[];for(gi.push(0),w=Te-1;w>=Q;--w)gi.push(w);r.mesh=new Ph(F.center,j,Qe,Ke,ve,C,A,re.fromOrientedBoundingBox(de),f_t(e,de.center,s,C,A),F.stride,de,F,Nt,Rt,Zn,gi)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=Lh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let v=o._findAncestorTileWithTerrainData(n);l(v)&&l(v.data.waterMaskTexture)&&(r.waterMaskTexture=v.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,v,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function I4(e,t,n,i,o,r,s,a,c,u,f){let d=hT;d.longitude=P.lerp(t.west,t.east,r),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,ev),_;n.hasGeodeticSurfaceNormals&&(_=e.geodeticSurfaceNormal(p,j$));let m=H$;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,_),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var O4=new ae;function s1(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=ae.clone(e.rectangle,O4),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ae.clone(e.rectangle,O4),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),_=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(_)<Math.EPSILON5?_=0:Math.abs(_-1)<Math.EPSILON5&&(_=1),i.x=p,i.y=_,i}var r_t=new V;function G$(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 s_t=new V,a_t=new h;function c_t(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=s1(t,n,f.decodeTextureCoordinates(d,o,Ku),Ku),_=s1(t,n,f.decodeTextureCoordinates(d,r,H$),H$),m;c?m=(s-p.x)/(_.x-p.x):m=(a-p.y)/(_.y-p.y);let y=f.decodeHeight(d,o),x=f.decodeHeight(d,r),b=n.rectangle;hT.longitude=P.lerp(b.west,b.east,s),hT.latitude=P.lerp(b.south,b.north,a),u.height=hT.height=P.lerp(y,x,m);let T;if(f.hasVertexNormals){let C=f.getOctEncodedNormal(d,o,r_t),A=f.getOctEncodedNormal(d,r,s_t),S=Mn.octDecode(C.x,C.y,ev),w=Mn.octDecode(A.x,A.y,a_t);T=h.lerp(S,w,m,ev),h.normalize(T,T),Mn.octEncode(T,u.encodedNormal)}else T=e.geodeticSurfaceNormalCartographic(hT,ev),Mn.octEncode(T,u.encodedNormal)}function aTe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(hT,ev);Mn.octEncode(s,r.encodedNormal)}function P4(e,t,n,i,o,r,s,a,c,u,f){if(rTe(e,t,a,s,!1,n,i,f)||rTe(e,t,u,c,!0,n,i,f))return f;let p;if(W$(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],G$(r,p,n,i,f),f;let _;if(n===0?i===0?_=D4(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):_=D4(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?_=D4(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):_=D4(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(_))return aTe(e,t,n,i,_,f),f}function D4(e,t,n,i,o,r,s,a){let c=oTe(e,t,!1,n,s,a),u=oTe(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function R4(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=l_t(e,t,n,i,o,r[u],s[u],a,c);return o}function l_t(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ae.clone(r.rectangle,O4),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===yn.WEST&&r.x===0&&(u=ae.clone(r.rectangle,O4),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Ku),d=Ku.x,p=Ku.y);let _,m;switch(a){case yn.WEST:_=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:_=s.northIndicesWestToEast,m=!0;break;case yn.EAST:_=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:_=s.southIndicesEastToWest,m=!0;break}let y=r,x=e.tile,b=s.encoding,T=s.vertices,C=n.stride,A,S;b.hasWebMercatorT&&(A=ki.geodeticLatitudeToMercatorAngle(f.south),S=1/(ki.geodeticLatitudeToMercatorAngle(f.north)-A));for(let w=0;w<_.length;++w){let R=_[w],D=b.decodeTextureCoordinates(T,R,Ku);s1(y,x,D,D);let M=D.x,L=D.y,g=m?M:L;if(g<0||g>1||Math.abs(M-d)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let E=Math.abs(M)<P.EPSILON5||Math.abs(M-1)<P.EPSILON5,v=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(E&&v)continue;let I=b.decodePosition(T,R,ev),N=b.decodeHeight(T,R),F;b.hasVertexNormals?F=b.getOctEncodedNormal(T,R,V$):(F=V$,F.x=0,F.y=0);let U=L;if(b.hasWebMercatorT){let z=P.lerp(f.south,f.north,L);U=(ki.geodeticLatitudeToMercatorAngle(z)-A)*S}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(I,j$)),n.encode(i,o*C,I,D,N,F,U,k),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++o}return o}function oTe(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!W$(d,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let _=p[n?0:p.length-1];if(l(_))return f.encoding.decodeHeight(f.vertices,_)}}function W$(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function rTe(e,t,n,i,o,r,s,a){let c,u,f,d,p,_=i[o?0:n.length-1],m=n[o?0:n.length-1];if(W$(_,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,Ku);let y=s1(_,e.tile,Ku,Ku);if(y.x===r&&y.y===s)return G$(m,p,r,s,a),!0;if(d=zo(c,u?r:s,function(x,b){m.encoding.decodeTextureCoordinates(m.vertices,x,Ku);let T=s1(_,e.tile,Ku,Ku);return f?u?T.x-r:T.y-s:u?r-T.x:s-T.y}),d<0){if(d=~d,d>0&&d<c.length)return c_t(t,_,e.tile,m,c[d-1],c[d],r,s,u,a),!0}else return G$(m,c[d],r,s,a),!0}return!1}var u_t=[new h,new h,new h,new h];function f_t(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=u_t;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var a1=tv;function sr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Tn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new me,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(sr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(sr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(sr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(sr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new me,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 H(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ae.clone(ae.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(sr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=ie.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Os.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Tm.setOwner(e,this,"_clippingPolygons")}}});function d_t(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}sr.prototype.update=function(e){this._imageryLayers._update()};function h_t(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)}}sr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(d_t)})),h_t(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)Lh._freeVertexArray(t[i]);t.length=0};sr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let 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};sr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:qc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:qc.LESS_OR_EQUAL},blending:fn.ALPHA_BLEND});let s=Fe(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=Fe(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&a1.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 u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;B_t(this,d,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function dTe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}sr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)dTe(t[n],e)};sr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};sr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};sr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===$n.CULLED_BUT_NEEDED,o=n.terrainState),Lh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Dr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,Lh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var m_t=new re,hTe=new ae,p_t=new ae,__t=new fe;function N4(e,t){if(t.west<t.east)return t;let n=ae.clone(t,p_t);return ae.center(e,__t).longitude>0?n.east=P.PI:n.west=-P.PI,n}function mTe(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||!ae.equals(e.cartographicLimitRectangle,ae.MAX_VALUE))}sr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=mTe(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return Dr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Dr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=N4(e.rectangle,this.cartographicLimitRectangle),f=ae.simpleIntersection(u,e.rectangle,hTe);if(!l(f))return Dr.NONE;if(ae.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=m_t,re.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=re.union(s.boundingSphere,c,c))),!l(c))return Dr.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let x=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==Gt.INSIDE,x===Gt.OUTSIDE)return Dr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let x=p.computeIntersectionWithBoundingVolume(s);e.isClipped=x!==Gt.OUTSIDE}let _,m=a.computeVisibility(c);if(m===Gt.OUTSIDE?_=Dr.NONE:m===Gt.INTERSECTING?_=Dr.PARTIAL:m===Gt.INSIDE&&(_=Dr.FULL),_===Dr.NONE)return _;let y=t.mode===ne.SCENE3D&&t.camera.frustum instanceof ln;if(t.mode===ne.SCENE3D&&!y&&l(n)&&!o){let x=r.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?_:Dr.NONE}return _};sr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var g_t=[],y_t=[];sr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=g_t;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===go.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 d=s[a],p=d.loadingImagery,_=!l(p)||p.state===ui.FAILED||p.state===ui.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=_&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=y_t;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:$n.NONE;if(p===$n.RENDERED){let _=d.data;if(!l(_))continue;if(!o&&d.data.terrainState===go.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],x=y.loadingImagery,b=!l(x)||x.state===ui.FAILED||x.state===ui.INVALID,T=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[T])return!1}}else p===$n.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var x_t=new h;sr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,x_t),a=h.magnitude(s);return a<P.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var cTe=new O,L4=new O,b_t=new ie,T_t=new ie,C_t=new ie,A_t=new h,lTe=new h,E_t=new h,S_t=new h;sr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var v_t=[new h,new h,new h,new h];function uTe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=v_t;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}sr.prototype.computeDistanceToTile=function(e,t){w_t(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function w_t(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Lh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new $f({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,d=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(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)r.minimumHeight=d._minimumHeight,r.maximumHeight=d._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let _=p.data;if(_!==void 0){let m=_.mesh,y=_.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,_=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Br.getHeight(r.minimumHeight,p,_),r.maximumHeight=Br.getHeight(r.maximumHeight,p,_)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Pn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=re.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=uTe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=uTe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}sr.prototype.isDestroyed=function(){return!1};sr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ce(this)};function I_t(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}sr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let _=c[a];if((_.readyImagery??_.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=I_t(d,e,n),s.state=Da.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Da.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==$n.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};sr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};sr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};sr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var P_t=new O,D_t=new O;function fTe(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=O.multiplyByPoint(i,this.properties.rtc,lTe);return O.setTranslation(i,o,cTe),cTe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=O.multiplyByPoint(i,this.properties.rtc,lTe);return O.setTranslation(i,r,L4),O.multiply(o,L4,L4),L4},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)?O.multiply(e.context.uniformState.view,i.modelMatrix,P_t):O.IDENTITY;return O.inverseTranspose(o,D_t)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new ie(0,0,.5,1),fillHighlightColor:new H(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new V(65e5,9e6),nightFadeDistance:new V(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new O,tileRectangle:new ie,verticalExaggerationAndRelativeHeight:new V(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new V,southMercatorYAndOneOverHeight:new V,waterMask:void 0,waterMaskTranslationAndScale:new ie,minMaxHeight:new V,scaleAndBias:new O,clippingPlanesEdgeColor:H.clone(H.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ie,frontFaceAlphaByDistance:new ie,backFaceAlphaByDistance:new ie,localizedTranslucencyRectangle:new ie,undergroundColor:H.clone(H.TRANSPARENT),undergroundColorAlphaByDistance:new ie,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?ct(n,t.materialUniformMap):n}function R_t(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=O_t(e,r,o),i.wireframeVertexArray.mesh=o}}function O_t(e,t,n){let o={indices:n.indices,primitiveType:Le.TRIANGLES};Fn.toWireframe(o);let r=o.indices,s=st.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:ke.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new qn({context:e,attributes:t._attributes,indexBuffer:s})}var pTe,_Te,F4;(function(){let e=new Pt({geometry:om.fromDimensions({dimensions:new h(2,2,2)})}),t=new Pt({geometry:new Ny({radius:1})}),n=new O,i,o;function r(s){return new Dn({geometryInstances:s,appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})}pTe=function(s,a){return s===i||(F4(),i=s,n=O.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},_Te=function(s,a){return s===i||(F4(),i=s,n=O.fromTranslation(s.center,n),n=O.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},F4=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var M_t=new ie(0,0,0,0),L_t={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},N_t=H.TRANSPARENT,F_t=new Vt;function B_t(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new a1(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Ht=r.credits;for(let wt=0,no=Ht.length;wt<no;++wt)o.addCreditToNextFrame(Ht[wt])}let s=Lt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,_=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??N_t,x=e.undergroundColorAlphaByDistance??F_t,b=mTe(e,n)&&n.mode===ne.SCENE3D&&y.alpha>0&&(x.nearValue>0||x.farValue>0),T=e.lambertDiffuseMultiplier,C=e.vertexShadowDarkness,A=e.hasWaterMask&&l(a),S=A&&e.showWaterEffect,w=e.oceanNormalMap,R=S&&l(w),D=e.terrainProvider,M=l(D)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,g=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=Tn.castShadows(e.shadows)&&!d,v=Tn.receiveShadows(e.shadows)&&!d,I=e.hueShift,N=e.saturationShift,F=e.brightnessShift,U=!(P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(F,0,P.EPSILON7)),k=!1;if(g){let Ht=h.magnitude(n.camera.positionWC),wt=e.nightFadeOutDistance;k=Ht>wt}A&&--s,R&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let z=i.renderedMesh,B=z.center,j=z.encoding,W=i.tileBoundingRegion,J=n.verticalExaggeration,Y=n.verticalExaggerationRelativeHeight,ee=J!==1,Q=j.hasGeodeticSurfaceNormals,de=b_t,ge=0,le=0,ye=0,be=0,Ie=!1;if(n.mode!==ne.SCENE3D){let Ht=n.mapProjection,wt=Ht.project(ae.southwest(t.rectangle),E_t),no=Ht.project(ae.northeast(t.rectangle),S_t);if(de.x=wt.x,de.y=wt.y,de.z=no.x,de.w=no.y,n.mode!==ne.MORPHING&&(B=A_t,B.x=0,B.y=(de.z+de.x)*.5,B.z=(de.w+de.y)*.5,de.x-=B.y,de.y-=B.z,de.z-=B.y,de.w-=B.z),n.mode===ne.SCENE2D&&j.quantization===Ia.BITS12){let xt=1/(Math.pow(2,12)-1)*.5,Xo=(de.z-de.x)*xt,yr=(de.w-de.y)*xt;de.x-=Xo,de.y-=yr,de.z+=Xo,de.w+=yr}Ht instanceof ki&&(ge=t.rectangle.south,le=t.rectangle.north,ye=ki.geodeticLatitudeToMercatorAngle(ge),be=1/(ki.geodeticLatitudeToMercatorAngle(le)-ye),Ie=!0)}let Te=L_t;Te.frameState=n,Te.surfaceTile=i,Te.hasWaterMask=A,Te.showReflectiveOcean=S,Te.showOceanWaves=R,Te.enableLighting=e.enableLighting,Te.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Te.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Te.showGroundAtmosphere=g,Te.atmosphereLightIntensity=e.atmosphereLightIntensity,Te.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Te.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Te.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Te.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Te.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Te.perFragmentGroundAtmosphere=k,Te.hasVertexNormals=M,Te.useWebMercatorProjection=Ie,Te.clippedByBoundaries=i.clippedByBoundaries,Te.hasGeodeticSurfaceNormals=Q,Te.hasExaggeration=ee;let ve=i.imagery,Ve=0,Ke=ve.length,Ct=e.showSkirts&&!u&&!d,Qt=e.backFaceCulling&&!u&&!d,Qe=Qt?e._renderState:e._disableCullingRenderState,hn=Qt?e._blendRenderState:e._disableCullingBlendRenderState,Nt=Qe,Rt=e._firstPassInitialColor,Zn=n.context;if(l(e._debug.boundingSphereTile)||F4(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ht=e._drawCommands.length;for(let wt=0;wt<Ht;++wt)e._uniformMaps[wt]=fTe(n,e)}do{let Ht=0,wt,no;if(e._drawCommands.length<=e._usedDrawCommands?(wt=new qe,wt.owner=t,wt.cull=!1,wt.boundingVolume=new re,wt.orientedBoundingBox=void 0,no=fTe(n,e),e._drawCommands.push(wt),e._uniformMaps.push(no)):(wt=e._drawCommands[e._usedDrawCommands],no=e._uniformMaps[e._usedDrawCommands]),wt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let aa=W.boundingVolume,vl=W.boundingSphere;l(aa)?pTe(aa,H.RED).update(n):l(vl)&&_Te(vl,H.RED).update(n)}let xt=no.properties;ie.clone(Rt,xt.initialColor),xt.oceanNormalMap=w,xt.lightingFadeDistance.x=e.lightingFadeOutDistance,xt.lightingFadeDistance.y=e.lightingFadeInDistance,xt.nightFadeDistance.x=e.nightFadeOutDistance,xt.nightFadeDistance.y=e.nightFadeInDistance,xt.atmosphereLightIntensity=e.atmosphereLightIntensity,xt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,xt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,xt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,xt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,xt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,xt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let Xo=u?_:p,yr=u?p:_;l(Xo)&&(ie.fromElements(Xo.near,Xo.nearValue,Xo.far,Xo.farValue,xt.frontFaceAlphaByDistance),ie.fromElements(yr.near,yr.nearValue,yr.far,yr.farValue,xt.backFaceAlphaByDistance)),ie.fromElements(x.near,x.nearValue,x.far,x.farValue,xt.undergroundColorAlphaByDistance),H.clone(y,xt.undergroundColor),xt.lambertDiffuseMultiplier=T,xt.vertexShadowDarkness=C;let ec=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ec&&H.clone(e.fillHighlightColor,xt.fillHighlightColor),xt.verticalExaggerationAndRelativeHeight.x=J,xt.verticalExaggerationAndRelativeHeight.y=Y,xt.center3D=z.center,h.clone(B,xt.rtc),ie.clone(de,xt.tileRectangle),xt.southAndNorthLatitude.x=ge,xt.southAndNorthLatitude.y=le,xt.southMercatorYAndOneOverHeight.x=ye,xt.southMercatorYAndOneOverHeight.y=be;let Or=T_t,vs=N4(t.rectangle,e.cartographicLimitRectangle),Ue=C_t,ot=N4(t.rectangle,m);h.fromElements(I,N,F,xt.hsbShift);let Ye=t.rectangle,Ze=1/Ye.width,pt=1/Ye.height;Or.x=(vs.west-Ye.west)*Ze,Or.y=(vs.south-Ye.south)*pt,Or.z=(vs.east-Ye.west)*Ze,Or.w=(vs.north-Ye.south)*pt,ie.clone(Or,xt.localizedCartographicLimitRectangle),Ue.x=(ot.west-Ye.west)*Ze,Ue.y=(ot.south-Ye.south)*pt,Ue.z=(ot.east-Ye.west)*Ze,Ue.w=(ot.north-Ye.south)*pt,ie.clone(Ue,xt.localizedTranslucencyRectangle);let qt=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;U=U&&(qt||g);let xn=!1,Ro=!1,So=!1,tc=!1,nc=!1,Ai=!1,yi=!1,sa=!1,Xr=!1,El=!1;for(;Ht<s&&Ve<Ke;){let aa=ve[Ve],vl=aa.readyImagery;if(++Ve,!l(vl)||vl.imageryLayer.alpha===0)continue;let Uc=aa.useWebMercatorT?vl.textureWebMercator:vl.texture,ls=vl.imageryLayer;l(aa.textureTranslationAndScale)||(aa.textureTranslationAndScale=ls._calculateTextureTranslationAndScale(t,aa)),xt.dayTextures[Ht]=Uc,xt.dayTextureTranslationAndScale[Ht]=aa.textureTranslationAndScale,xt.dayTextureTexCoordsRectangle[Ht]=aa.textureCoordinateRectangle,xt.dayTextureUseWebMercatorT[Ht]=aa.useWebMercatorT,xt.dayTextureAlpha[Ht]=ls.alpha,Ai=Ai||xt.dayTextureAlpha[Ht]!==1,xt.dayTextureNightAlpha[Ht]=ls.nightAlpha,yi=yi||xt.dayTextureNightAlpha[Ht]!==1,xt.dayTextureDayAlpha[Ht]=ls.dayAlpha,yi=yi||xt.dayTextureDayAlpha[Ht]!==1,xt.dayTextureBrightness[Ht]=ls.brightness,xn=xn||xt.dayTextureBrightness[Ht]!==Mc.DEFAULT_BRIGHTNESS,xt.dayTextureContrast[Ht]=ls.contrast,Ro=Ro||xt.dayTextureContrast[Ht]!==Mc.DEFAULT_CONTRAST,xt.dayTextureHue[Ht]=ls.hue,So=So||xt.dayTextureHue[Ht]!==Mc.DEFAULT_HUE,xt.dayTextureSaturation[Ht]=ls.saturation,tc=tc||xt.dayTextureSaturation[Ht]!==Mc.DEFAULT_SATURATION,xt.dayTextureOneOverGamma[Ht]=1/ls.gamma,nc=nc||xt.dayTextureOneOverGamma[Ht]!==1/Mc.DEFAULT_GAMMA,xt.dayTextureSplit[Ht]=ls.splitDirection,sa=sa||xt.dayTextureSplit[Ht]!==0;let lf=xt.dayTextureCutoutRectangles[Ht];if(l(lf)||(lf=xt.dayTextureCutoutRectangles[Ht]=new ie),ie.clone(ie.ZERO,lf),l(ls.cutoutRectangle)){let Bo=N4(Ye,ls.cutoutRectangle),an=ae.simpleIntersection(Bo,Ye,hTe);Xr=l(an)||Xr,lf.x=(Bo.west-Ye.west)*Ze,lf.y=(Bo.south-Ye.south)*pt,lf.z=(Bo.east-Ye.west)*Ze,lf.w=(Bo.north-Ye.south)*pt}let uf=xt.colorsToAlpha[Ht];l(uf)||(uf=xt.colorsToAlpha[Ht]=new ie);let ff=l(ls.colorToAlpha)&&ls.colorToAlphaThreshold>0;if(El=El||ff,ff){let Bo=ls.colorToAlpha;uf.x=Bo.red,uf.y=Bo.green,uf.z=Bo.blue,uf.w=ls.colorToAlphaThreshold}else uf.w=-1;if(l(vl.credits)){let Bo=vl.credits;for(let an=0,Ae=Bo.length;an<Ae;++an)o.addCreditToNextFrame(Bo[an])}++Ht}xt.dayTextures.length=Ht,xt.waterMask=a,ie.clone(c,xt.waterMaskTranslationAndScale),xt.minMaxHeight.x=j.minimumHeight,xt.minMaxHeight.y=j.maximumHeight,O.clone(j.matrix,xt.scaleAndBias);let bo=e._clippingPlanes,Mr=l(bo)&&bo.enabled&&t.isClipped;Mr&&(xt.clippingPlanesEdgeColor=H.clone(bo.edgeColor,xt.clippingPlanesEdgeColor),xt.clippingPlanesEdgeWidth=bo.edgeWidth);let Ip=e._clippingPolygons,Kr=l(Ip)&&Ip.enabled&&t.isClipped;Te.numberOfDayTextures=Ht,Te.applyBrightness=xn,Te.applyContrast=Ro,Te.applyHue=So,Te.applySaturation=tc,Te.applyGamma=nc,Te.applyAlpha=Ai,Te.applyDayNightAlpha=yi,Te.applySplit=sa,Te.enableFog=qt,Te.enableClippingPlanes=Mr,Te.clippingPlanes=bo,Te.enableClippingPolygons=Kr,Te.clippingPolygons=Ip,Te.hasImageryLayerCutout=Xr,Te.colorCorrect=U,Te.highlightFillTile=ec,Te.colorToAlpha=El,Te.showUndergroundColor=b,Te.translucent=d;let Sl=i.renderedMesh.indices.length;Ct||(Sl=i.renderedMesh.indexCountWithoutSkirts),wt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Te),wt.castShadows=E,wt.receiveShadows=v,wt.renderState=Nt,wt.primitiveType=Le.TRIANGLES,wt.vertexArray=i.vertexArray||i.fill.vertexArray,wt.count=Sl,wt.uniformMap=no,wt.pass=Se.GLOBE,e._debug.wireframe&&(R_t(Zn,e,t),l(i.wireframeVertexArray)&&(wt.vertexArray=i.wireframeVertexArray,wt.primitiveType=Le.LINES,wt.count=Sl*2));let ic=wt.boundingVolume,mx=wt.orientedBoundingBox;n.mode!==ne.SCENE3D?(re.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,W.minimumHeight,W.maximumHeight,ic),h.fromElements(ic.center.z,ic.center.x,ic.center.y,ic.center),n.mode===ne.MORPHING&&(ic=re.union(W.boundingSphere,ic,ic))):(wt.boundingVolume=re.clone(W.boundingSphere,ic),wt.orientedBoundingBox=Pn.clone(W.boundingVolume,mx)),wt.dirty=!0,d&&f.updateDerivedCommands(wt,n),dTe(wt,n),Nt=hn,Rt=M_t}while(Ve<Ke)}var B4=sr;function gTe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ae.clone(ae.MAX_VALUE)}Object.defineProperties(gTe.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=Vt.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=Vt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ae.clone(ae.MAX_VALUE)),ae.clone(e,this._rectangle)}}});var k4=gTe;function Vs(){this._layers=[],this.layerAdded=new me,this.layerRemoved=new me,this.layerMoved=new me,this.layerShownOrHidden=new me}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 Mc(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 U4(e,t){return e.indexOf(t)}function yTe(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.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=U4(this._layers,e);yTe(this,t,t+1)};Vs.prototype.lower=function(e){let t=U4(this._layers,e);yTe(this,t,t-1)};Vs.prototype.raiseToTop=function(e){let t=U4(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=U4(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 k_t=new ae;function xTe(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];ae.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ae.contains(u.rectangle,t))continue;let d=k_t,p=1/1024;d.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ae.contains(d,t)&&i(u)}}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(xTe(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(xTe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,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),ce(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 z4=Vs;function bTe(e){this._ellipsoid=new jy(e.ellipsoid,h.ZERO)}Object.defineProperties(bTe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var V4=bTe;var q$=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()}},U_t=1e3;function na(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=$n.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new q$(U_t),this.state=Da.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}na.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 na({tilingScheme:e,x:s,y:r,level:0});return i};var z_t=256;function V_t(e,t,n,i){let o=n.width/z_t*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}na.prototype._getCacheKey=function(e,t){return V_t(e.longitude,e.latitude,this._rectangle,t)};na.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};na.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};na.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};na.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],ae.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],ae.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(na.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 na({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 na({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 na({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 na({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<Da.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});na.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]};na.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};na.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};na.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};na.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};na.prototype.freeResources=function(){this.clearPositionCache(),this.state=Da.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),H4(this._southwestChild),this._southwestChild=void 0,H4(this._southeastChild),this._southeastChild=void 0,H4(this._northwestChild),this._northwestChild=void 0,H4(this._northeastChild),this._northeastChild=void 0};function H4(e){l(e)&&e.freeResources()}var G4=na;function j4(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}j4.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};j4.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(),TTe(this,t)),t=i}};function TTe(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}j4.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))&&TTe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var W4=j4;function gd(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 W4,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 V4({ellipsoid:n}),this._tileLoadProgressEvent=new me,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(gd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});gd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function H_t(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,ATe(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()}gd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Da.START&&e(t),t=t.replacementNext};gd.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};gd.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};gd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function ATe(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}gd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(H_t(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),ATe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};gd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),q_t(this,e),ngt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function G_t(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=me.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))}gd.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Q_t(this,e),tgt(this,e),G_t(this,e))};gd.prototype.isDestroyed=function(){return!1};gd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var l1,CTe=new fe;function j_t(e,t){let n=ae.center(e.rectangle,CTe),i=n.longitude-l1.longitude,o=n.latitude-l1.latitude;n=ae.center(t.rectangle,CTe);let r=n.longitude-l1.longitude,s=n.latitude-l1.latitude;return i*i+o*o-(r*r+s*s)}var W_t=new h,c1=[];function q_t(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=G4.createLevelZeroTiles(x);let b=e._levelZeroTiles.length;if(c1.length<b)for(c1=new Array(b),o=0;o<b;++o)c1[o]===void 0&&(c1[o]=new u1)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;l1=t.camera.positionCartographic,a.sort(j_t);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let _=t.camera;e._cameraPositionCartographic=_.positionCartographic;let m=O.getTranslation(_.transform,W_t);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ka(e,s,r,t,c,!1,c1[o]):($_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function $_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function u1(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function ETe(){this.southwest=new u1,this.southeast=new u1,this.northwest=new u1,this.northeast=new u1}ETe.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 X$=new Array(31);for(let e=0;e<X$.length;++e)X$[e]=new ETe;function Y_t(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=$_t(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:$n.NONE,_=e.tileProvider;if(s||i){let m=$n.originalResult(p)===$n.RENDERED,y=$n.originalResult(p)===$n.CULLED||p===$n.NONE,x=n.state===Da.DONE,b=m||y||x;if(b||l(_.canRenderWithoutLosingDetail)&&(b=_.canRenderWithoutLosingDetail(n)),b){s&&$_(e,e._tileLoadQueueMedium,n,t),q4(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&$_(e,e._tileLoadQueueHigh,n,t)}if(_.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){q4(e,n),$_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.REFINED;let y=e._tilesToRender.length,x=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,T=e._tileLoadQueueHigh.length,C=e._tileToUpdateHeights.length;if(X_t(e,a,c,u,f,t,i,o),y!==e._tilesToRender.length){let A=o.allAreRenderable,S=o.anyWereRenderedLastFrame,w=o.notYetRenderableCount,R=!1;if(!A&&!S){let D=e._tilesToRender;for(let L=y;L<D.length;++L){let g=D[L];for(;g!==void 0&&g._lastSelectionResult!==$n.KICKED&&g!==n;)g._lastSelectionResult=$n.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=C,q4(e,n),n._lastSelectionResult=$n.RENDERED;let M=p===$n.RENDERED;!M&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=T,$_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,R=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!R&&$_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,q4(e,n),$_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function X_t(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=X$[t.level],p=d.southwest,_=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ka(e,t,u,r,f,s,p),Ka(e,n,u,r,f,s,_),Ka(e,i,u,r,f,s,m),Ka(e,o,u,r,f,s,y)):(Ka(e,i,u,r,f,s,m),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,n,u,r,f,s,_)):c.latitude<t.rectangle.north?(Ka(e,n,u,r,f,s,_),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m)):(Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m),Ka(e,n,u,r,f,s,_),Ka(e,t,u,r,f,s,p)),d.combine(a)}function K_t(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ae.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ae.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ka(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Dr.NONE)return Y_t(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,K_t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&$_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:$n.NONE;c!==$n.CULLED_BUT_NEEDED&&c!==$n.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=$n.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?($_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=$n.CULLED):t._lastSelectionResult=$n.CULLED;t._lastSelectionResultFrame=i.frameNumber}function $_t(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof ln||t.camera.frustum instanceof Qr)return Z_t(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-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Z_t(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function q4(e,t){e._tilesToRender.push(t)}function Q_t(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=Pi()+e._loadQueueTimeSlice,s=e._tileProvider,a=Y$(e,t,s,r,n,!1);a=Y$(e,t,s,r,i,a),Y$(e,t,s,r,o,a)}function J_t(e,t){return e._loadPriority-t._loadPriority}function Y$(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(J_t);for(let s=0,a=o.length;s<a&&(Pi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var nv=new gn,Y4=new fe,Y0=new h,egt=[];function tgt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=egt;n.length=0;let i=e._tileToUpdateHeights,o=Pi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let y=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:$n.NONE;(y===$n.RENDERED||y===$n.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,_=p.length,m=!1;for(f=e._lastTileIndex;f<_;++f){let y=p[f],x=d.data.terrainData,b=l(x)&&x.wasCreatedByUpsampling();if(d.level>y.level&&!b){let T,C=d.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(C))T=C;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=h.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,nv.direction),S=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,nv.origin);if(!l(S)){let w=0;l(d.data.tileBoundingRegion)&&(w=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(w,-11500),D=h.multiplyByScalar(A,Math.abs(R)+1,Y0);h.subtract(y.positionOnEllipsoidSurface,D,nv.origin)}}else fe.clone(y.positionCartographic,Y4),Y4.height=-11500,c.project(Y4,Y0),h.fromElements(Y0.z,Y0.x,Y0.y,Y0),h.clone(Y0,nv.origin),h.clone(h.UNIT_X,nv.direction);T=d.data.pick(nv,a,c,!1,Y0),l(T)&&d.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,T)}if(l(T)){if(l(y.callback)){let A=u.cartesianToCartographic(T,Y4);y.callback(A)}y.level=d.level}}if(Pi()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function ngt(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 X4=gd;function Fh(e){e=e??te.default;let t=new K_({ellipsoid:e}),n=new z4;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new l4,this._material=void 0,this._surface=new X4({tileProvider:new B4({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new me,this._undergroundColor=H.clone(H.BLACK),this._undergroundColorAlphaByDistance=new Vt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new k4,$$(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ee({url:on("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Tn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Fh.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=ae.clone(ae.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)&&$$(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,$$(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=H.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Vt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function $$(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Cm,$D];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(a4),e._surfaceShaderSet.baseVertexShaderSource=new Be({sources:[Cm,$D,c4],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Be({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function igt(e){return function(t,n){let i=re.distanceSquaredTo(t.pickBoundingSphere,e),o=re.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var ogt=[],rgt={start:0,stop:0};Fh.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=ogt;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let _=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=_=re.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,_),h.fromElements(_.center.z,_.center.x,_.center.y,_.center);else if(l(p.renderedMesh))re.clone(p.tileBoundingRegion.boundingSphere,_);else continue;let m=ni.raySphere(e,_,rgt);l(m)&&s.push(p)}s.sort(igt(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var sgt=new fe;Fh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,sgt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var agt=new h,STe=new h,cgt=new fe,lgt=new gn;function K$(e,t){return l(e)&&ae.contains(e.rectangle,t)?e:void 0}Fh.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],!ae.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=K$(n._southwestChild,e)||K$(n._southeastChild,e)||K$(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=h.fromRadians(e.longitude,e.latitude,0,a,agt),u=lgt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let _;l(n.data.tileBoundingRegion)&&(_=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(_??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,STe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,STe);if(l(p))return a.cartesianToCartographic(p,cgt).height};Fh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Fh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.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))};Fh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Fh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Fh.prototype.isDestroyed=function(){return!1};Fh.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(),ce(this)};var K4=Fh;var f1=`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 d1=`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 Z$={position:0};function $4(e){e=e??G.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new re,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this._computedModelMatrix=new O,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 qe({owner:e._owner??this}),this._pickCommand=new qe({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 ugt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=mc.createGeometry(mc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY}));return t=qn.fromGeometry({context:e,geometry:n,attributeLocations:Z$,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}$4.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Si.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?fn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=ugt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.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}(!O.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(O.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),O.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),re.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Be({sources:[d1]}),p=new Be({sources:[this.material.shaderSource,f1]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Xt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Z$}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=ct(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let _=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Se.TRANSLUCENT:Se.OPAQUE,_.push(f)),m.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)||u)&&(d=new Be({sources:[d1]}),p=new Be({sources:[this.material.shaderSource,f1],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Xt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Z$}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=ct(ct(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Se.TRANSLUCENT:Se.OPAQUE,_.push(y)}};$4.prototype.isDestroyed=function(){return!1};$4.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(),ce(this)};var Z4=$4;function h1(e){e=e??G.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=on("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Z4({radii:this.ellipsoid.radii,material:Ji.fromType(Ji.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new YV}Object.defineProperties(h1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Q4=new Z,fgt=new Z,dgt=new h,J4=[];h1.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(Et.computeIcrfToFixedMatrix(n,Q4))||Et.computeTemeToPseudoFixedMatrix(n,Q4);let i=this._axes.evaluate(n,fgt);Z.transpose(i,i),Z.multiply(Q4,i,i);let o=Dx.computeMoonPositionInEarthInertialFrame(n,dgt);Z.multiplyByVector(Q4,o,o),O.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=J4,J4.length=0,t.update(e),e.commandList=r,J4.length===1?J4[0]:void 0};h1.prototype.isDestroyed=function(){return!1};h1.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ce(this)};var e8=h1;var t8=`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 m1(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(m1.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function hgt(e,t,n){let i=t.createViewportQuadCommand(t8,{framebuffer:n,renderState:ze.fromCache({viewport:new Xe(0,0,256,256)})});e._drawCommand=i}m1.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new dt({context:t,width:256,height:256,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST});this._colorTexture=n;let i=new Zr({context:t,colorTextures:[n],destroyAttachments:!1});hgt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};m1.prototype.isDestroyed=function(){return!1};m1.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ce(this)};var n8=m1;var PTe={};function mgt(e,t,n){let i,o,r;if(e instanceof Li){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 au)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var pgt=new h,vTe=new h;function DTe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(o){return P.lerp(e,t,o)}}function J$(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,pgt),_=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),vTe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),vTe));r=Math.min(mgt(d,_,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function p1(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var RTe=new h;function _gt(e,t,n,i,o,r,s,a){let c=e.camera,u=h.clone(c.position,RTe),f=c.pitch,d=p1(c.heading,i),p=p1(c.roll,r),_=J$(c,n,u.z,n.z,s),m=DTe(f,o,_,a);function y(x){let b=x.time/t;c.setView({orientation:{heading:P.lerp(d,i,b),pitch:m(b),roll:P.lerp(p,r,b)}}),V.lerp(u,n,b,c.position),c.position.z=_(b)}return y}function ggt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function ygt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var xgt=new fe,bgt=new fe;function Tgt(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,_=fe.clone(f.positionCartographic,xgt),m=f.pitch,y=p1(f.heading,i),x=p1(f.roll,r),b=p.cartesianToCartographic(n,bgt);_.longitude=P.zeroToTwoPi(_.longitude),b.longitude=P.zeroToTwoPi(b.longitude);let T=!1;if(l(a)){let w=P.zeroToTwoPi(a),R=Math.min(_.longitude,b.longitude),D=Math.max(_.longitude,b.longitude),M=w>=R&&w<=D;if(l(c)){let L=Math.abs(_.longitude-b.longitude),g=P.TWO_PI-L;(M?L:g)<(M?g:L)*c&&!M&&(T=!0)}else M||(T=!0)}T?ggt(_,b):ygt(_,b);let C=J$(f,n,_.height,b.height,s),A=DTe(m,o,C,u);function S(){let w=_.longitude,R=b.longitude,D=_.latitude,M=b.latitude;return function(g){let E=g.time/t,v=h.fromRadians(P.lerp(w,R,E),P.lerp(D,M,E),C(E),p);f.setView({destination:v,orientation:{heading:P.lerp(y,i,E),pitch:A(E),roll:P.lerp(x,r,E)}})}}return S()}function Cgt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,RTe),u=p1(a.heading,i),f=a.frustum.right-a.frustum.left,d=J$(a,n,f,n.z,s);function p(_){let m=_.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),V.lerp(c,n,m,a.position);let y=d(m),x=a.frustum,b=x.top/x.right,T=(y-(x.right-x.left))*.5;x.right+=T,x.left-=T,x.top=b*x.right,x.bottom=-x.top}return p}var wTe=new fe,Agt=new h;function Q$(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function ITe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}PTe.createTween=function(e,t){t=t??G.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===ne.MORPHING)return Q$();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,wTe),n=r.project(wTe,Agt));let p=e.camera,_=t.endTransform;l(_)&&p._setTransform(_);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,x=t.pitch??-P.PI_OVER_TWO,b=t.roll??0,T=e.screenSpaceCameraController;T.enableInputs=!1;let C=ITe(T,t.complete),A=ITe(T,t.cancel),S=p.frustum,w=e.mode===ne.SCENE2D;if(w=w&&V.equalsEpsilon(p.position,n,P.EPSILON6),w=w&&P.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,P.EPSILON6),w=w||e.mode!==ne.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),w=w&&P.equalsEpsilon(P.negativePiToPi(y),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.roll),P.EPSILON10),w)return Q$(C,A);let R=new Array(4);if(R[ne.SCENE2D]=Cgt,R[ne.SCENE3D]=Tgt,R[ne.COLUMBUS_VIEW]=_gt,m<=0)return Q$(function(){R[i](e,1,n,y,x,b,a,c,u,f)({time:1}),typeof C=="function"&&C()},A);let D=R[i](e,m,n,y,x,b,a,c,u,f);if(!l(d)){let M=p.positionCartographic.height,L=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;M>L&&M>11500?d=as.CUBIC_OUT:d=as.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:D,complete:C,cancel:A}};var i8=PTe;var Egt={ROTATE:0,INFINITE_SCROLL:1},$u=Object.freeze(Egt);function tn(e){this._scene=e,this._transform=O.clone(O.IDENTITY),this._invTransform=O.clone(O.IDENTITY),this._actualTransform=O.clone(O.IDENTITY),this._actualInvTransform=O.clone(O.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.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 me,this._moveEnd=new me,this._changed=new me,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 O,this._invViewMatrix=new O,UTe(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,ZTe(this,tn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*tn.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}tn.TRANSFORM_2D=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);tn.TRANSFORM_2D_INVERSE=O.inverseTransformation(tn.TRANSFORM_2D,new O);tn.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-95,-20,-70,90);tn.DEFAULT_VIEW_FACTOR=.5;tn.DEFAULT_OFFSET=new bh(0,-P.PI_OVER_FOUR,0);function UTe(e){O.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),O.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),O.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Sgt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Pi()):e.timeSinceMoved=Math.max(Pi()-e._lastMovedTimestamp,0)/1e3}}tn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};tn.prototype._updateCameraChanged=function(){let e=this;if(Sgt(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)%P.TWO_PI;i=i>P.PI?P.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)%P.TWO_PI;s=s>P.PI?P.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===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,_=e._changedPosition,m=e.frustum,y=e._changedFrustum,x=p.x+m.left,b=p.x+m.right,T=_.x+y.left,C=_.x+y.right,A=p.y+m.bottom,S=p.y+m.top,w=_.y+y.bottom,R=_.y+y.top,D=Math.max(x,T),M=Math.min(b,C),L=Math.max(A,w),g=Math.min(S,R),E;if(D>=M||L>=S)E=1;else{let v=y;x<T&&b>C&&A<w&&S>R&&(v=m),E=1-(M-D)*(g-L)/((v.right-v.left)*(v.top-v.bottom))}E>t&&(e._changed.raiseEvent(E),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function vgt(e){Et.basisTo2D(e._projection,e._transform,e._actualTransform)}var wgt=new fe,Igt=new h,o8=new h,Pgt=new ie,Dgt=new ie,Rgt=new ie,Ogt=new ie,Mgt=new ie;function Lgt(e){let t=e._projection,n=t.ellipsoid,i=O.getColumn(e._transform,3,Pgt),o=n.cartesianToCartographic(i,wgt),r=t.project(o,Igt),s=Dgt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ie.clone(ie.UNIT_X,Mgt),c=ie.add(O.getColumn(e._transform,0,o8),i,o8);n.cartesianToCartographic(c,o),t.project(o,r);let u=Rgt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=Ogt;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=ie.add(O.getColumn(e._transform,1,o8),i,o8);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(ie.clone(ie.UNIT_Y,u),ie.clone(ie.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),O.setColumn(e._actualTransform,0,u,e._actualTransform),O.setColumn(e._actualTransform,1,f,e._actualTransform),O.setColumn(e._actualTransform,2,a,e._actualTransform),O.setColumn(e._actualTransform,3,s,e._actualTransform)}var eZ=new h;function Nc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(O.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?O.equals(O.IDENTITY,e._transform)?O.clone(tn.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?vgt(e):Lgt(e):O.clone(e._transform,e._actualTransform),O.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let _=e._actualTransform;if(r||p)if(e._positionWC=O.multiplyByPoint(_,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=eZ;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,eZ));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),x=h.dot(c,s)*y,b=h.multiplyByScalar(s,x,eZ);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=O.multiplyByPointAsVector(_,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=O.multiplyByPointAsVector(_,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=O.multiplyByPointAsVector(_,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&UTe(e)}function zTe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function VTe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function HTe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var a8=new O,c8=new O;Object.defineProperties(tn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Nc(this),this._invTransform}},viewMatrix:{get:function(){return Nc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Nc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Nc(this),this._positionCartographic}},positionWC:{get:function(){return Nc(this),this._positionWC}},directionWC:{get:function(){return Nc(this),this._directionWC}},upWC:{get:function(){return Nc(this),this._upWC}},rightWC:{get:function(){return Nc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,a8),n=Et.eastNorthUpToFixedFrame(this.positionWC,e,c8);this._setTransform(n);let i=zTe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,a8),n=Et.eastNorthUpToFixedFrame(this.positionWC,e,c8);this._setTransform(n);let i=VTe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=O.clone(this._transform,a8),n=Et.eastNorthUpToFixedFrame(this.positionWC,e,c8);this._setTransform(n);let i=HTe(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}}});tn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.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===ne.SCENE2D&&qTe(this,this.position)};var Ngt=new h,Fgt=new h,Bgt=new h;tn.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Ngt),n=h.clone(this.upWC,Fgt),i=h.clone(this.directionWC,Bgt);O.clone(e,this._transform),this._transformChanged=!0,Nc(this);let o=this._actualInvTransform;O.multiplyByPoint(o,t,this.position),O.multiplyByPointAsVector(o,i,this.direction),O.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Nc(this)};var kgt=new V,Ugt=new gn,zgt=new h,Vgt=new h;function GTe(e){if(!O.equals(O.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=kgt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,Ugt);o=n.pickWorldCoordinates(a,t,!0,zgt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Vgt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}tn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof ln&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=GTe(this)))};var l8=new h,rZ=new O,Hgt=new O,sZ=new Pe,aZ=new Z,jTe=new fe;function Ggt(e,t,n){let i=O.clone(e.transform,rZ),o=Et.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Hgt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,sZ),s=Z.fromQuaternion(r,aZ);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function jgt(e,t,n,i){let o=O.clone(e.transform,rZ);if(e._setTransform(O.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,jTe);t=a.project(c,l8)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Pe.fromHeadingPitchRoll(n,sZ),s=Z.fromQuaternion(r,aZ);Z.getColumn(s,0,e.direction),Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Wgt(e,t,n,i){let o=O.clone(e.transform,rZ);if(e._setTransform(O.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,jTe);t=c.project(u,l8)}V.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===$u.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Pe.fromHeadingPitchRoll(n,sZ),s=Z.fromQuaternion(r,aZ);Z.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var qgt=new h,Ygt=new h,Xgt=new h;function WTe(e,t,n,i){let o=h.clone(n.direction,qgt),r=h.clone(n.up,Ygt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Et.eastNorthUpToFixedFrame(t,a,a8),u=O.inverseTransformation(c,c8);O.multiplyByPointAsVector(u,o,o),O.multiplyByPointAsVector(u,r,r)}let s=h.cross(o,r,Xgt);return i.heading=zTe(o,r),i.pitch=VTe(o),i.roll=HTe(o,r,s),i}var oZ={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},iv=new fc;tn.prototype.setView=function(e){e=e??G.EMPTY_OBJECT;let t=e.orientation??G.EMPTY_OBJECT,n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,l8);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,l8),i=!1),l(t.direction)&&(t=WTe(this,o,t,oZ.orientation)),iv.heading=t.heading??0,iv.pitch=t.pitch??-P.PI_OVER_TWO,iv.roll=t.roll??0,n===ne.SCENE3D?Ggt(this,o,iv):n===ne.SCENE2D?Wgt(this,o,iv,i):jgt(this,o,iv,i)};var Kgt=new h;tn.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:tn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:O.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(tn.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*tn.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:O.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,Kgt).z),roll:0},endTransform:O.IDENTITY,convert:!1})}};tn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ie),Nc(this),O.multiplyByVector(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Nc(this),O.multiplyByPoint(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Nc(this),O.multiplyByPointAsVector(this._actualInvTransform,e,t)};tn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ie),Nc(this),O.multiplyByVector(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Nc(this),O.multiplyByPoint(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Nc(this),O.multiplyByPointAsVector(this._actualTransform,e,t)};function qTe(e,t){let n=e._scene.mapMode2D===$u.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 OTe=new h;tn.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,OTe),h.add(n,OTe,n),this._mode===ne.SCENE2D&&qTe(this,n),this._adjustOrthographicFrustum(!0)};tn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===ne.SCENE2D?u8(this,e):this.move(this.direction,e)};tn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===ne.SCENE2D?u8(this,-e):this.move(this.direction,-e)};tn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};tn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};tn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};tn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};tn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.up,-e)};tn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.up,e)};tn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.right,-e)};tn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==ne.SCENE2D&&this.look(this.right,e)};var $gt=new Pe,Zgt=new Z;tn.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Pe.fromAxisAngle(e,-n,$gt),o=Z.fromQuaternion(i,Zgt),r=this.direction,s=this.up,a=this.right;Z.multiplyByVector(o,r,r),Z.multiplyByVector(o,s,s),Z.multiplyByVector(o,a,a)};tn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};tn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var Qgt=new Pe,Jgt=new Z;tn.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Pe.fromAxisAngle(e,-n,Qgt),o=Z.fromQuaternion(i,Jgt);Z.multiplyByVector(o,this.position,this.position),Z.multiplyByVector(o,this.direction,this.direction),Z.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};tn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,YTe(this,e)};tn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,YTe(this,-e)};var eyt=new h,tyt=new h,nyt=new h,MTe=new h;function YTe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,eyt),o=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,MTe),P.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,tyt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,MTe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,nyt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}tn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,XTe(this,-e)};tn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,XTe(this,e)};function XTe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function u8(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===$u.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===$u.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 KTe(e,t){e.move(e.direction,t)}tn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===ne.SCENE2D?u8(this,e):KTe(this,e)};tn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===ne.SCENE2D?u8(this,-e):KTe(this,-e)};tn.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return h.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var iyt=new O;tn.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=Et.eastNorthUpToFixedFrame(e,i,iyt);this.lookAtTransform(o,t)};var oyt=new h,ryt=new Pe,syt=new Pe,ayt=new Z;function $Te(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Pe.fromAxisAngle(h.UNIT_Y,-t,ryt),o=Pe.fromAxisAngle(h.UNIT_Z,-e,syt),r=Pe.multiply(o,i,o),s=Z.fromQuaternion(r,ayt),a=h.clone(h.UNIT_X,oyt);return Z.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}tn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=$Te(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){V.clone(V.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(O.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var _1=new fe,cyt=new fe,lyt=new h,uyt=new h,fyt=new h,dyt=new h,hyt=new h,myt=new h,pyt=new h,tZ=new h,_yt={direction:new h,right:new h,up:new h},LTe;function Lc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function ZTe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:_yt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let M=_1;M.longitude=f,M.latitude=s,M.height=0;let L=cyt;L.longitude=f,L.latitude=a,L.height=0;let g=LTe;(!l(g)||g.ellipsoid!==o)&&(LTe=g=new Mg(void 0,void 0,o)),g.setEndPoints(M,L),d=g.interpolateUsingFraction(.5,_1).latitude}let p=_1;p.longitude=f,p.latitude=d,p.height=0;let _=o.cartographicToCartesian(p,pyt),m=_1;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,lyt);m.longitude=c;let x=o.cartographicToCartesian(m,fyt);m.longitude=f;let b=o.cartographicToCartesian(m,hyt);m.latitude=a;let T=o.cartographicToCartesian(m,myt);m.longitude=u;let C=o.cartographicToCartesian(m,dyt);m.longitude=c;let A=o.cartographicToCartesian(m,uyt);h.subtract(x,_,x),h.subtract(C,_,C),h.subtract(y,_,y),h.subtract(A,_,A),h.subtract(b,_,b),h.subtract(T,_,T);let S=o.geodeticSurfaceNormal(_,r.direction);h.negate(S,S);let w=h.cross(S,h.UNIT_Z,r.right);h.normalize(w,w);let R=h.cross(w,S,r.up),D;if(e.frustum instanceof ln){let M=Math.max(h.distance(y,x),h.distance(C,A)),L=Math.max(h.distance(y,C),h.distance(x,A)),g,E,v=e.frustum._offCenterFrustum,I=v.right/v.top,N=L*I;M>N?(g=M,E=g/I):(E=L,g=N),D=Math.max(g,E)}else{let M=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*M;if(D=Math.max(Lc(S,R,x,M),Lc(S,R,C,M),Lc(S,R,y,M),Lc(S,R,A,M),Lc(S,R,b,M),Lc(S,R,T,M),Lc(S,w,x,L),Lc(S,w,C,L),Lc(S,w,y,L),Lc(S,w,A,L),Lc(S,w,b,L),Lc(S,w,T,L)),a<0&&s>0){let g=_1;g.longitude=c,g.latitude=0,g.height=0;let E=o.cartographicToCartesian(g,tZ);h.subtract(E,_,E),D=Math.max(D,Lc(S,R,E,M),Lc(S,w,E,L)),g.longitude=u,E=o.cartographicToCartesian(g,tZ),h.subtract(E,_,E),D=Math.max(D,Lc(S,R,E,M),Lc(S,w,E,L))}}return h.add(_,h.multiplyByScalar(S,-D,tZ),n)}var gyt=new fe,yyt=new h,xyt=new h;function byt(e,t,n){let i=e._projection;t.west>t.east&&(t=ae.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=gyt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,yyt);O.multiplyByPoint(o,a,a),O.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,xyt);if(O.multiplyByPoint(o,c,c),O.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var Tyt=new fe,Cyt=new h,Ayt=new h;function Eyt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===$u.INFINITE_SCROLL?o+=P.TWO_PI:(t=ae.MAX_VALUE,o=t.east));let r=Tyt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Cyt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Ayt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,_=u*p;return c>_?(f=c,d=f/p):(d=u,f=_),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}tn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ne.SCENE3D)return ZTe(this,e,t);if(n===ne.COLUMBUS_VIEW)return byt(this,e,t);if(n===ne.SCENE2D)return Eyt(this,e,t)};var Syt=new gn;function vyt(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,Syt),r=ni.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var wyt=new gn;function Iyt(e,t,n,i){let r=e.getPickRay(t,wyt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Pyt=new gn;function Dyt(e,t,n,i){let o=e.getPickRay(t,Pyt),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}tn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??te.default,this._mode===ne.SCENE3D)n=vyt(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Iyt(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=Dyt(this,e,this._projection,n);else return;return n}};var Ryt=new h,Oyt=new h,Myt=new h;function Lyt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Ryt);h.add(d,p,p);let _=h.multiplyByScalar(e.rightWC,u*c*a,Oyt),m=h.multiplyByScalar(e.upWC,f*c*s,Myt),y=h.add(p,_,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var r8=new h;function Nyt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,r8),h.add(r8,f,f),h.multiplyByScalar(e.upWC,u,r8),h.add(r8,f,f),h.clone(e.directionWC,n.direction),n}tn.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Lyt(this,e,t):Nyt(this,e,t)};var Fyt=new h,Byt=new h;tn.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Fyt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Byt);return Math.max(0,h.magnitude(n)-e.radius)};var kyt=new V;tn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,kyt);return Math.max(o.x,o.y)};function Uyt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:as.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var zyt=new h,NTe=new h,Vyt=new h,Hyt=new h;function Gyt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,zyt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,NTe),NTe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Vyt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,Hyt)),f=c*u,d=a*u,p=e._maxCoord.x,_=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-_,_);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let x=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(x||b)return Uyt(e,n,s,m,y,t)}}tn.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Gyt(this,e)};var jyt=new h,ia={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};tn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};tn.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=ia.destination,e.orientation.heading=ia.heading,e.orientation.pitch=ia.pitch,e.orientation.roll=ia.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};tn.prototype.flyTo=function(e){e=e??G.EMPTY_OBJECT;let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof ae;i&&(t=this.getRectangleCameraCoordinates(t,jyt));let o=e.orientation??G.EMPTY_OBJECT;if(l(o.direction)&&(o=WTe(this,t,o,oZ.orientation)),l(e.duration)&&e.duration<=0){let f=oZ;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;ia.destination=t,ia.heading=o.heading,ia.pitch=o.pitch,ia.roll=o.roll,ia.duration=e.duration,ia.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ia.cancel=e.cancel,ia.endTransform=e.endTransform,ia.convert=i?!1:e.convert,ia.maximumHeight=e.maximumHeight,ia.pitchAdjustHeight=e.pitchAdjustHeight,ia.flyOverLongitude=e.flyOverLongitude,ia.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ia.easingFunction=e.easingFunction;let a=this._scene,c=i8.createTween(a,ia);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=tn.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Wyt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function qyt(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 Yyt=100;function QTe(e,t,n){n=bh.clone(l(n)?n:tn.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=Yyt:e.frustum instanceof ln||e._mode===ne.SCENE2D?n.range=qyt(e,s):n.range=Wyt(e,s),n.range=P.clamp(n.range,i,o)}return n}tn.prototype.viewBoundingSphere=function(e,t){t=QTe(this,e,t),this.lookAt(e.center,t)};var Xyt=new O,Kyt=new h,$yt=new h,Zyt=new h,Qyt=new h,Jyt=new ie,e0t=new Pe,t0t=new Z;tn.prototype.flyToBoundingSphere=function(e,t){t=t??G.EMPTY_OBJECT;let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(O.IDENTITY);let i=QTe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,Kyt):o=$Te(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??te.default,a=Et.eastNorthUpToFixedFrame(e.center,s,Xyt);O.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=h.subtract(e.center,o,$yt),h.normalize(c,c),u=O.multiplyByPointAsVector(a,h.UNIT_Z,Zyt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Pe.fromAxisAngle(c,i.heading,e0t),p=Z.fromQuaternion(d,t0t);h.fromCartesian4(O.getColumn(a,1,Jyt),u),Z.multiplyByVector(p,u,u)}let f=h.cross(c,u,Qyt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var FTe=new h,BTe=new h,nZ=new h,kTe=new h,g1=[new h,new h,new h,new h];function n0t(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,FTe),r=h.magnitude(o),s=h.normalize(o,BTe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,nZ),nZ),c=h.normalize(h.cross(s,a,kTe),kTe));let u=Math.sqrt(h.magnitudeSquared(o)-1),f=h.multiplyByScalar(s,1/r,FTe),d=u/r,p=h.multiplyByScalar(a,d,BTe),_=h.multiplyByScalar(c,d,nZ),m=h.add(f,_,g1[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,_,g1[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let x=h.subtract(f,_,g1[2]);h.add(x,p,x),h.multiplyComponents(n,x,x);let b=h.add(f,_,g1[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),g1}var iZ=new V,i0t=new h,X0=[new fe,new fe,new fe,new fe];function s8(e,t,n,i,o,r){iZ.x=e,iZ.y=t;let s=i.pickEllipsoid(iZ,o,i0t);return l(s)?(X0[n]=o.cartesianToCartographic(s,X0[n]),1):(X0[n]=o.cartesianToCartographic(r[n],X0[n]),0)}tn.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new re(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Gt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=n0t(this,e);if(c+=s8(0,0,0,this,e,u),c+=s8(0,a,1,this,e,u),c+=s8(s,a,2,this,e,u),c+=s8(s,0,3,this,e,u),c<2)return ae.MAX_VALUE;t=ae.fromCartographicArray(X0,t);let f=0,d=X0[3].longitude;for(let p=0;p<4;++p){let _=X0[p].longitude,m=Math.abs(_-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=_}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,X0[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};tn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Li)return;let e=this._scene;this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};tn.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof ln)return;let e=GTe(this),t=this._scene;this.frustum=new ln,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};tn.clone=function(e,t){return l(t)||(t=new tn(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),O.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ho=tn;function o0t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Bh=o0t;var iCe=$r(pu(),1),JTe=576,r0t=100,y1="#ffffff",f8="#48b";function oCe(e,t){this.credit=e,this.count=t??1}function s0t(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(_t.equals(o,t))return!0}return!1}function a0t(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;_t.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var rCe="cesium-credit-delimiter";function eCe(e){let t=document.createElement("span");return t.textContent=e,t.className=rCe,t}function tCe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function nCe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(eCe(n));else{let f=o[u];f.className!==rCe&&e.replaceChild(eCe(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(tCe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(tCe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function c0t(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<JTe?(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>=JTe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function l0t(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: ${y1}; - position: relative; - min-height: ${r0t}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: ${y1}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${f8}; -} -.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: ${y1}; -} -.cesium-credit-lightbox-close:hover { - color: ${f8}; -} -.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: ${y1}; -} -.cesium-credit-expand-link:hover { - color: ${f8}; -} - -.cesium-credit-text { - color: ${y1}; -} - -.cesium-credit-delimiter { - padding: 0 5px; -} - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; -} - -.cesium-credit-textContainer a:hover { - color: ${f8} -} - -.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(m){r.contains(m.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 u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),l0t(e);let _=_t.clone(gr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=_,this._previousCesiumCredit=void 0,this._currentCesiumCredit=_,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new It,lightboxCredits:new It},this._defaultCredit=void 0,this.viewport=n,this.container=e}function sCe(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 oCe(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=_t.clone(aCe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,sCe(this,t,e)};gr.prototype.addStaticCredit=function(e){let t=this._staticCredits;s0t(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&&c0t(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()&&_t.equals(gr.cesiumCredit,this._cesiumCredit)||sCe(this,s,r,Number.MAX_VALUE)}_t.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=_t.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;nCe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",nCe(this._creditList,t,void 0,"li"),a0t(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),ce(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var d8;function aCe(){if(!l(d8)){let e=on("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new iCe.default(e).path()),d8=new _t(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=d8,gr._cesiumCreditInitialized=!0),d8}Object.defineProperties(gr,{cesiumCredit:{get:function(){return aCe(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=oCe;var h8=gr;function m8(e){e=e??G.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??H.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var u0t=new h,f0t=new Z,d0t=new Pe,h0t=new Li,m0t=new au,p0t=new ln,_0t=new Qr,g0t=new H,y0t=[1,1e5];m8.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 Li?a=h0t:s instanceof au?a=m0t:s instanceof ln?a=p0t:a=_0t,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=y0t,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,_=r.rightWC;_=h.negate(_,u0t);let m=f0t;Z.setColumn(m,0,_,m),Z.setColumn(m,1,p,m),Z.setColumn(m,2,d,m);let y=Pe.fromRotationMatrix(m,d0t);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Dn({geometryInstances:new Pt({geometry:new BS({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(H.fromAlpha(this._color,.1,g0t))},id:this.id,pickPrimitive:this}),appearance:new un({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Dn({geometryInstances:new Pt({geometry:new kV({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new un({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};m8.prototype.isDestroyed=function(){return!1};m8.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 ce(this)};var Z_=m8;var p8=`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 _8=`in vec4 position; - -out vec4 positionEC; - -void main() -{ - positionEC = czm_modelView * position; - gl_Position = czm_projection * positionEC; - - czm_vertexLogDepth(); -} -`;function b1(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 x1=Ft.supportsTypedArrays()?new Float32Array(12):[],cCe=new h,lCe=new h,cZ=new h,uCe=new h,g8=new h;function x0t(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof ln)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,cCe),_=h.normalize(p,lCe),m=h.normalize(h.cross(h.UNIT_Z,p,cZ),cZ),y=h.normalize(h.cross(_,m,uCe),uCe),x=h.magnitude(p),b=Math.sqrt(x*x-1);o=h.multiplyByScalar(_,1/x,cCe);let T=b/x;r=h.multiplyByScalar(m,T,lCe),s=h.multiplyByScalar(y,T,cZ)}let a=h.add(o,s,g8);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,x1,0);let c=h.subtract(o,s,g8);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,x1,3);let u=h.add(o,s,g8);h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,x1,6);let f=h.subtract(o,s,g8);return h.add(f,r,f),h.multiplyComponents(n,f,f),h.pack(f,x1,9),x1}b1.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new qe({renderState:this._rs,boundingVolume:new re(h.ZERO,i.maximumRadius),pass:Se.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Be({sources:[_8]}),a=new Be({sources:[p8]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Xt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=x0t(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new lt({attributes:{position:new we({componentDatatype:K.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Le.TRIANGLES});this._va=qn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};b1.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};b1.prototype.isDestroyed=function(){return!1};b1.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var y8=b1;function rv(){}var b0t=/\bgl_FragDepth\b/,T0t=/\bdiscard\b/;function C0t(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(b0t.test(r[a])||T0t.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() -{ - out_FragColor = vec4(1.0); -} -`;i=new Be({sources:[a]})}else if(!o&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new Be({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function A0t(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}rv.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=qe.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=C0t(n,t.shaderProgram),i.depthOnlyCommand.renderState=A0t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var E0t=/\s+czm_writeLogDepth\(/,S0t=/\s+czm_vertexLogDepth\(/;function v0t(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(S0t.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Be.replaceMain(c[d],"czm_log_depth_main");c.push(` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)E0t.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Be.replaceMain(c[f],"czm_log_depth_main");u=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}rv.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=v0t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function w0t(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(_=>_.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () -{ - czm_non_pick_main(); - if (${c}.a == 0.0) { - discard; - } - ${c} = ${n}; -} `,f=r.length,d=new Array(f+1);for(let _=0;_<f;++_)d[_]=Be.replaceMain(r[_],"czm_non_pick_main");d[f]=u;let p=new Be({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function fCe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}rv.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=qe.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=w0t(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=fCe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function ov(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 dCe(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function I0t(e){let t=dCe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function hCe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function mCe(e,t){let n=kt.getMaximum(t);return`(${e}) / float(${n})`}function P0t(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=hCe(n,i,o)}return e.normalized||(n=mCe(n,e.componentType)),n}function D0t(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=hCe(o,r,s)}return e.normalized||(o=mCe(o,e.componentType)),o}function R0t(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=I0t(u),d=["0.0","0.0","0.0","0.0"],p=dCe(u);if(p===1)d[0]=P0t(u,c);else{let x=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=D0t(u,c,x[b])}let _=t.fragmentShaderSource.defines.slice();_.push(Uf.METADATA_PICKING_ENABLED),ov(_,Uf.METADATA_PICKING_VALUE_TYPE,f),ov(_,Uf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),ov(_,Uf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),ov(_,Uf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),ov(_,Uf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),ov(_,Uf.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Be({sources:t.fragmentShaderSource.sources,defines:_});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}rv.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=R0t(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=fCe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function O0t(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})}rv.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=O0t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Q_=rv;function x8(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=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var M0t=new Pe,pCe=new Pe,L0t=new Z;function N0t(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Pe.fromAxisAngle(o,n,pCe),c=Pe.fromAxisAngle(r,i,M0t),u=Pe.multiply(c,a,c),f=Pe.fromAxisAngle(s,t,pCe);Pe.multiply(f,u,u);let d=Z.fromQuaternion(u,L0t);Z.multiplyByVector(d,r,r),Z.multiplyByVector(d,s,s),Z.multiplyByVector(d,o,o)}x8.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;N0t(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};x8.prototype.isDestroyed=function(){return!1};x8.prototype.destroy=function(){return this._removeListener(),ce(this)};var b8=x8;function lZ(){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(lZ.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var F0t=new h;lZ.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!==ne.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,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,F0t),a=Math.abs(h.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 T8=lZ;function B0t(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=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.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 C8=B0t;var Ra={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},mT=Ra.DERIVED_COMMANDS_MAXIMUM_LENGTH,SCe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function pT(){this._frontFaceAlphaByDistance=new Vt(0,1,0,1),this._backFaceAlphaByDistance=new Vt(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=ae.clone(ae.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(mT),this._derivedBlendCommandTypes=new Array(mT),this._derivedPickCommandTypes=new Array(mT),this._derivedCommandTypesToUpdate=new Array(mT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(pT.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}}});pT.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=_Ce(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=_Ce(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=gCe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=gCe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=V0t(this,e,t),this._sunVisibleThroughGlobe=k0t(this,e),this._environmentVisible=U0t(this,e),this._useDepthPlane=z0t(this,e),this._numberOfTextureUniforms=H0t(this),this._rectangle=ae.clone(t.translucency.rectangle,this._rectangle),G0t(this,e)};function _Ce(e,t,n,i){return e?l(n)?(Vt.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 gCe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function k0t(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function U0t(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function z0t(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function V0t(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function H0t(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function G0t(e,t){e._derivedCommandsLength=uZ(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=uZ(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=uZ(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<mT;++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=oxt())}function uZ(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?Ra.PICK_FRONT_FACE:u?Ra.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ra.TRANSLUCENT_FRONT_FACE,d=i?Ra.PICK_BACK_FACE:u?Ra.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ra.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=Ra.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=Ra.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=Ra.DEPTH_ONLY_BACK_FACE),o[r++]=Ra.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=Ra.DEPTH_ONLY_FRONT_FACE),o[r++]=Ra.OPAQUE_BACK_FACE,o[r++]=f),r)}function yd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function yCe(e,t){return e.indexOf(t)>-1}function j0t(e,t){yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function W0t(e,t){yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG"),yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function fZ(e,t){if(yCe(t.defines,"TILE_LIMIT_RECTANGLE")||yCe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function dZ(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Be.replaceMain(n[r],"czm_globe_translucency_main");n.push(` - -uniform sampler2D u_classificationTexture; -void main() -{ - vec2 st = gl_FragCoord.xy / czm_viewport.zw; -#ifdef MANUAL_DEPTH_TEST - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); - if (logDepthOrDepth != 0.0) - { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } - } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) - { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; - } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`)}function vCe(e,t){dZ(e,t),yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG")}function q0t(e,t){dZ(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Y0t(e,t){vCe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function xCe(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 X0t(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function K0t(e){e.cull.face=Si.BACK,e.cull.enabled=!0}function $0t(e){e.cull.face=Si.FRONT,e.cull.enabled=!0}function Z0t(e){e.cull.face=Si.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Q0t(e){e.cull.face=Si.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function J0t(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function bCe(e){e.cull.face=Si.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function TCe(e){e.cull.face=Si.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=fn.ALPHA_BLEND}function ext(e){e.cull.face=Si.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function txt(e){e.cull.face=Si.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function nxt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function sv(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function ixt(e,t,n,i,o){return l(o)?!i&&l(n)?n:ct(t,o(e),!1):t}function kh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function oxt(){return[new kh({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:j0t,getRenderStateFunction:K0t,getUniformMapFunction:void 0}),new kh({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:W0t,getRenderStateFunction:$0t,getUniformMapFunction:void 0}),new kh({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:fZ,getRenderStateFunction:Z0t,getUniformMapFunction:void 0}),new kh({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:fZ,getRenderStateFunction:Q0t,getUniformMapFunction:void 0}),new kh({pass:Se.GLOBE,pickOnly:!1,getShaderProgramFunction:fZ,getRenderStateFunction:J0t,getUniformMapFunction:void 0}),new kh({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:dZ,getRenderStateFunction:bCe,getUniformMapFunction:sv}),new kh({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vCe,getRenderStateFunction:TCe,getUniformMapFunction:sv}),new kh({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:q0t,getRenderStateFunction:bCe,getUniformMapFunction:sv}),new kh({pass:Se.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Y0t,getRenderStateFunction:TCe,getUniformMapFunction:sv}),new kh({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:xCe,getRenderStateFunction:ext,getUniformMapFunction:sv}),new kh({pass:Se.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:xCe,getRenderStateFunction:txt,getUniformMapFunction:sv})]}var CCe=new Array(mT),ACe=new Array(mT);pT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)ACe[o]=this._derivedCommandPacks[n[o]],CCe[o]=SCe[n[o]];rxt(this,e,i,n,CCe,ACe,t)}};function rxt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,_=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;_&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let b=r[x],T=i[x],C=o[x],A=a[C],S,w,R;l(A)?(S=A.uniformMap,w=A.shaderProgram,R=A.renderState):(S=void 0,w=void 0,R=void 0),A=qe.shallowClone(t,A),a[C]=A;let D=A.derivedCommands.uniformMapDirtyFrame??0,M=A.derivedCommands.shaderProgramDirtyFrame??0,L=A.derivedCommands.renderStateDirtyFrame??0,g=_||D<f,E=m||M<d,v=y||L<p;g&&(A.derivedCommands.uniformMapDirtyFrame=u),E&&(A.derivedCommands.shaderProgramDirtyFrame=u),v&&(A.derivedCommands.renderStateDirtyFrame=u),A.derivedCommands.type=T,A.pass=b.pass,A.pickOnly=b.pickOnly,A.uniformMap=ixt(e,t.uniformMap,S,g,b.getUniformMapFunction),A.shaderProgram=X0t(s.context,t.shaderProgram,w,E,b.getShaderProgramFunction,C),A.renderState=nxt(t.renderState,R,v,b.getRenderStateFunction,b.renderStateCache)}}}pT.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=SCe[o[a]];n.commandList.push(s[c])}};function wCe(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 ECe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var sxt=[Ra.OPAQUE_FRONT_FACE,Ra.OPAQUE_BACK_FACE],axt=[Ra.DEPTH_ONLY_FRONT_FACE,Ra.DEPTH_ONLY_BACK_FACE,Ra.DEPTH_ONLY_FRONT_AND_BACK_FACE];pT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Se.GLOBE],a=e.indices[Se.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),wCe(s,a,t,i,o,sxt))};pT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Se.GLOBE],c=e.indices[Se.GLOBE],u=e.commands[Se.TERRAIN_CLASSIFICATION],f=e.indices[Se.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&ECe(u,f,t,i,o),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let _=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,wCe(a,c,t,i,o,axt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}ECe(u,f,t,i,o),s.globeDepthTexture=_,o.framebuffer=m};var A8=pT;var Zu=`uniform sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;function mp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new bi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new bi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ri({color:new H(0,0,0,0),owner:this}),this._clearCommand=new ri({color:new H(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(mp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});mp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var cxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:0,mask:jt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},lxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:0,mask:jt.CLASSIFICATION_MASK},blending:fn.ALPHA_BLEND},uxt={depthMask:!0,depthTest:{enabled:!0},stencilTest:jt.setCesium3DTileBit(),stencilMask:jt.CESIUM_3D_TILE_MASK,blending:fn.ALPHA_BLEND},fxt=`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; -} -`,dxt=`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 -} -`;mp.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 dt({context:e,width:s,height:a,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Af({context:e,width:s,height:a,format:Ml.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(cxt),this._rsClassified=ze.fromCache(lxt),this._rsDefault=ze.fromCache(uxt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?dxt:fxt,f=new Be({defines:["UNCLASSIFIED"],sources:[u]}),d=new Be({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{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(Zu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};mp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};mp.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))};mp.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)};mp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};mp.prototype.isDestroyed=function(){return!1};mp.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()),ce(this)};var T1=mp;function E8(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(E8.prototype,{total:{get:function(){return this._total}}});function K0(e){let t=new Array(xc.NUMBER_OF_JOB_TYPES);t[xc.TEXTURE]=new E8(l(e)?e[xc.TEXTURE]:10),t[xc.PROGRAM]=new E8(l(e)?e[xc.PROGRAM]:10),t[xc.BUFFER]=new E8(l(e)?e[xc.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}K0.getTimestamp=Pi;Object.defineProperties(K0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});K0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};K0.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};K0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=K0.getTimestamp();e.execute();let a=K0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var S8=K0;function v8(e){e=e??G.EMPTY_OBJECT;let t=On(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Pi(),this._lastMsSampleTime=Pi(),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(v8.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});v8.prototype.update=function(e){let t=Pi(),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}};v8.prototype.destroy=function(){return ce(this)};var $0=v8;var Oa={};Oa.decodeRawMetadataValue=function(e,t,n){switch(e){case kt.INT8:return t.getInt8(n);case kt.UINT8:return t.getUint8(n);case kt.INT16:return t.getInt16(n,!0);case kt.UINT16:return t.getUint16(n,!0);case kt.INT32:return t.getInt32(n,!0);case kt.UINT32:return t.getUint32(n,!0);case kt.INT64:return t.getBigInt64(n,!0);case kt.UINT64:return t.getBigUint64(n,!0);case kt.FLOAT32:return t.getFloat32(n,!0);case kt.FLOAT64:return t.getFloat64(n,!0)}throw new se(`Invalid component type: ${e}`)};Oa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Oa.decodeRawMetadataValue(i,t,n);return e.normalized?kt.normalize(o,i):o};Oa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=kt.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*o,_=Oa.decodeRawMetadataValueComponent(e,t,p);f[d]=_}return f}let c=n*a;return Oa.decodeRawMetadataValueComponent(e,t,c)};Oa.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=Oa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Oa.decodeRawMetadataValueElement(e,n,0)};Oa.convertToObjectType=function(e,t){if(!l(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return V.unpack(n,0,new V);case at.VEC3:return h.unpack(n,0,new h);case at.VEC4:return ie.unpack(n,0,new ie);case at.MAT2:return ti.unpack(n,0,new ti);case at.MAT3:return Z.unpack(n,0,new Z);case at.MAT4:return O.unpack(n,0,new O)}throw new se(`Invalid metadata object type: ${e}`)};Oa.convertFromObjectType=function(e,t){if(!l(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return V.pack(t,Array(2));case at.VEC3:return h.pack(t,Array(3));case at.VEC4:return ie.pack(t,Array(4));case at.MAT2:return ti.pack(t,Array(4));case at.MAT3:return Z.pack(t,Array(9));case at.MAT4:return O.pack(t,Array(16))}throw new se(`Invalid metadata object type: ${e}`)};Oa.decodeMetadataValues=function(e,t,n){let i=Oa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Oa.convertFromObjectType(e.type,t.offset),s=Oa.convertFromObjectType(e.type,t.scale);i=t_.valueTransformInPlace(i,r,s,kt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=Oa.convertToObjectType(e.type,c);s[a]=u}return s}return Oa.convertToObjectType(e.type,i)};var w8=Object.freeze(Oa);function _T(){this._framebuffer=new bi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(_T.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function hxt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function mxt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates); - float globeDepth = czm_unpackDepth(globeDepthPacked); - float depth = texture(colorTexture, v_textureCoordinates).r; - out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, - czm_packDepth(depth), globeDepthPacked); -} -`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}_T.prototype.update=function(e,t){hxt(this,e,t),mxt(this,e,t)};var pxt=new ie,_xt=new ie(1,1/255,1/65025,1/16581375);_T.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ie.unpack(i,0,pxt);return ie.divideByScalar(o,255,o),ie.dot(o,_xt)};_T.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};_T.prototype.isDestroyed=function(){return!1};_T.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ce(this)};var I8=_T;function gxt(e,t){this.near=e??0,this.far=t??0;let n=Se.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 P8=gxt;var gT=`uniform highp sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function pp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new bi,this._tempCopyDepthFramebuffer=new bi,this._updateDepthFramebuffer=new bi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Xe,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(pp.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 ICe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Xe.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!Xe.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ht.KEEP,zFail:ht.KEEP,zPass:ht.KEEP},backFunction:Vn.NEVER,reference:jt.CESIUM_3D_TILE_MASK,mask:jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(gT,{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(Zu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(gT,{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(Zu,{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 ri({color:new H(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}pp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.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),ICe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};pp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};pp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};pp.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),ICe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};pp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};pp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(H.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};pp.prototype.isDestroyed=function(){return!1};pp.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()),ce(this)};var D8=pp;function yT(){this._framebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new bi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Xe,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(yT.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 yxt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function xxt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function bxt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Xe.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Xe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Xe.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Xe.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(gT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ri({color:new H(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}yT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;xxt(this,n,o,r,e),bxt(this,n,o,r,i),this._useHdr=e};yT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};yT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};yT.prototype.isDestroyed=function(){return!1};yT.prototype.destroy=function(){return yxt(this),ce(this)};var R8=yT;var C1=`#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 O8=`/** - * 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 J_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new bi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new bi({createColorAttachments:!1}),this._opaqueClearCommand=new ri({color:new H(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ri({color:new H(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ri({color:new H(0,0,0,0),owner:this}),this._alphaClearCommand=new ri({color:new H(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Xe,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function PCe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function hZ(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function DCe(e){PCe(e),hZ(e)}function Txt(e,t,n,i){PCe(e),e._accumulationTexture=new dt({context:t,width:n,height:i,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT}),e._revealageTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,width:n,height:i,flipY:!1})}function Cxt(e,t){hZ(e);let n=q.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)&&(hZ(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(DCe(e),e._translucentMultipassSupport=!1,i=!1)}return i}J_.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,Txt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Cxt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Be({sources:[O8]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Be({defines:["MRT"],sources:[C1]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Be({sources:[C1]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let _=!Xe.equals(this._viewport,t.viewport),m=_!==this._useScissorTest;this._useScissorTest=_,Xe.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Xe.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!Xe.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Axt={enabled:!0,color:new H(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.ONE,functionDestinationRgb:Oo.ONE,functionSourceAlpha:Oo.ZERO,functionDestinationAlpha:Oo.ONE_MINUS_SOURCE_ALPHA},Ext={enabled:!0,color:new H(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.ONE,functionDestinationRgb:Oo.ONE,functionSourceAlpha:Oo.ONE,functionDestinationAlpha:Oo.ONE},Sxt={enabled:!0,color:new H(0,0,0,0),equationRgb:pc.ADD,equationAlpha:pc.ADD,functionSourceRgb:Oo.ZERO,functionDestinationRgb:Oo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Oo.ZERO,functionDestinationAlpha:Oo.ONE_MINUS_SOURCE_ALPHA};function mZ(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function vxt(e,t,n){return mZ(t,Axt,e._translucentRenderStateCache,n)}function wxt(e,t,n){return mZ(t,Ext,e._translucentRenderStateCache,n)}function Ixt(e,t,n){return mZ(t,Sxt,e._alphaRenderStateCache,n)}var Pxt=` 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); -`,Dxt=` 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; -`,Rxt=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function pZ(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Be.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; -bool czm_discard = false; -`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; -${u}`}return a.sources.push(u),a.sources.push(`void main() -{ - czm_translucent_main(); - if (czm_discard) - { - discard; - } -${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Oxt(e,t){return pZ(e,t,"translucentMRT",Pxt)}function Mxt(e,t){return pZ(e,t,"translucentMultipass",Dxt)}function Lxt(e,t){return pZ(e,t,"alphaMultipass",Rxt)}J_.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=qe.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Oxt(t,e.shaderProgram),n.translucentCommand.renderState=vxt(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=qe.shallowClone(e,n.translucentCommand),n.alphaCommand=qe.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Mxt(t,e.shaderProgram),n.translucentCommand.renderState=wxt(this,t,e.renderState),n.alphaCommand.shaderProgram=Lxt(t,e.shaderProgram),n.alphaCommand.renderState=Ixt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Nxt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(x,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,_)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(x,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,_)}i.framebuffer=d}function Fxt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let x=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(x,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,_)}i.framebuffer=d}J_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Fxt(this,e,t,n,i,o);return}Nxt(this,e,t,n,i,o)};J_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};J_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,H.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};J_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};J_.prototype.isDestroyed=function(){return!1};J_.prototype.destroy=function(){return DCe(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()),ce(this)};var M8=J_;function A1(){this._framebuffer=new bi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(A1.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Bxt(e){e._framebuffer.destroy()}function kxt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Hc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Xe},o.viewport=new Xe,e._passState=o}A1.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&kxt(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};A1.prototype.isDestroyed=function(){return!1};A1.prototype.destroy=function(){return Bxt(this),ce(this)};var L8=A1;function av(e){let t=new Hc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Xe},t.viewport=new Xe,this._context=e,this._fb=new bi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}av.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Xe.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var E1=new H;av.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),u=0,f=0,d=0,p=-1;for(let _=0;_<s;++_){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);E1.red=H.byteToFloat(o[m]),E1.green=H.byteToFloat(o[m+1]),E1.blue=H.byteToFloat(o[m+2]),E1.alpha=H.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(E1);if(l(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=d;d=-p,p=m}u+=d,f+=p}};av.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)};av.prototype.isDestroyed=function(){return!1};av.prototype.destroy=function(){return this._fb.destroy(),ce(this)};var N8=av;function eg(){this._numSamples=1,this._colorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new H(0,0,0,0),this._clearCommand=new ri({color:new H(0,0,0,0),depth:1,owner:this})}function Uxt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(eg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});eg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};eg.prototype.clear=function(e,t,n){H.clone(n,this._clearCommand.color),H.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};eg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};eg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};eg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};eg.prototype.isDestroyed=function(){return!1};eg.prototype.destroy=function(){return Uxt(this),ce(this)};var cv=eg;function xT(){}xT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};xT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Be.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Be.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; -void main() -{ - czm_shadow_cast_main(); - v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Be({defines:i,sources:o})};xT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Be.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=Be.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,r.push(u),new Be({defines:o,sources:r})};xT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${u}${f}${t}${n}${i}`};xT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Be({defines:i,sources:o})};xT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Be.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Be.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,_=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,x=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),T=e.sources.slice(0),C=T.length;for(let w=0;w<C;++w)T[w]=Be.replaceMain(T[w],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),_&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let A="";d?A+=`uniform samplerCube shadowMap_textureCube; -`:A+=`uniform sampler2D shadowMap_texture; -`;let S;return c?S=` return vec4(${a}, 1.0); -`:S=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,A+=`uniform mat4 shadowMap_matrix; -uniform vec3 shadowMap_lightDirectionEC; -uniform vec4 shadowMap_lightPositionEC; -uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; -uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; -#ifdef LOG_DEPTH -in vec3 v_logPositionEC; -#endif -vec4 getPositionEC() -{ -${S}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${x.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,A+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,A+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?A+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(A+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),d?A+=` 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?A+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); - float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - vec4 shadowPosition = shadowMap_matrix * positionEC; - // Spot light uses a perspective projection, so perform the perspective divide - shadowPosition /= shadowPosition.w; - // Stop early if the fragment is not in the shadow bounds - if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) - { - return; - } - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:_?A+=` float maxDepth = shadowMap_cascadeSplits[1].w; - // Stop early if the eye depth exceeds the last cascade - if (depth > maxDepth) - { - return; - } - // Get the cascade based on the eye-space depth - vec4 weights = czm_cascadeWeights(depth); - // Apply normal offset - float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); - applyNormalOffset(positionEC, normalEC, nDotL); - // Transform position into the cascade - vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; - // Get visibility - shadowParameters.texCoords = shadowPosition.xy; - shadowParameters.depth = shadowPosition.z; - shadowParameters.nDotL = nDotL; - float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); - // Fade out shadows that are far away - float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; - float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); - visibility = mix(visibility, 1.0, fade); -${m?` // Draw cascade colors for debugging - out_FragColor *= czm_cascadeColor(weights); -`:""}`:A+=` 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); -`,A+=` out_FragColor.rgb *= visibility; -} -`,T.push(A),new Be({defines:b,sources:T})};var tg=xT;function _p(e){e=e??G.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;(Ft.isInternetExplorer()||Ft.isEdge()||(Ft.isChrome()||Ft.isFirefox())&&Ft.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new O,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ie,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new F8,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new re,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 V,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Qr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ie,new ie],this._cascadeMatrices=[new O,new O,new O,new O],this._cascadeDistances=new ie;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new zxt(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,gZ(this),this._clearCommand=new ri({depth:1,color:new H}),this._clearPassState=new Hc(t),this._size=e.size??2048,this.size=this._size}_p.MAXIMUM_DISTANCE=2e4;function zxt(e){this.camera=new F8,this.passState=new Hc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function _Z(e,t){return ze.fromCache({cull:{enabled:!0,face:Si.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 gZ(e){let t=!e._usesDepthTexture;e._primitiveRenderState=_Z(t,e._primitiveBias),e._terrainRenderState=_Z(t,e._terrainBias),e._pointRenderState=_Z(t,e._pointBias)}_p.prototype.debugCreateRenderStates=function(){gZ(this)};Object.defineProperties(_p.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){qxt(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 yZ(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 Vxt(e,t){let n=new Af({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST}),o=new Zr({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 Hxt(e,t){let n=new dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST}),i=new Zr({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 Gxt(e,t){let n=new Af({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new fr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Zr({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 MCe(e,t){e._isPointLight?Gxt(e,t):e._usesDepthTexture?Hxt(e,t):Vxt(e,t)}function jxt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==q.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,gZ(e),yZ(e),MCe(e,t))}function Wxt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(yZ(e),MCe(e,t),jxt(e,t),LCe(e,t))}function LCe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function qxt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Lt.maximumCubeMapSize>=t?t:Lt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Xe(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Lt.maximumTextureSize>=t?t:Lt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Xe(0,0,t,t)):i===4&&(t=Lt.maximumTextureSize>=t*2?t:Lt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Xe(0,0,t,t),n[1].passState.viewport=new Xe(t,0,t,t),n[2].passState.viewport=new Xe(0,t,t,t),n[3].passState.viewport=new Xe(t,t,t,t));e._clearPassState.viewport=new Xe(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new O(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var Yxt=new Xe;function Xxt(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=Se.OVERLAY,i}function Kxt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Yxt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Xxt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Xe.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Xe.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var gp=new Array(8);gp[0]=new ie(-1,-1,-1,1);gp[1]=new ie(1,-1,-1,1);gp[2]=new ie(1,1,-1,1);gp[3]=new ie(-1,1,-1,1);gp[4]=new ie(-1,-1,1,1);gp[5]=new ie(1,-1,1,1);gp[6]=new ie(1,1,1,1);gp[7]=new ie(-1,1,1,1);var Z0=new O,xZ=new Array(8);for(let e=0;e<8;++e)xZ[e]=new ie;function $xt(e,t){let n=new Pt({geometry:new om({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Pt({geometry:new Ny({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new Dn({geometryInstances:[n,i],appearance:new un({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Zxt=[H.RED,H.GREEN,H.BLUE,H.MAGENTA],Qxt=new h;function Jxt(e,t){Kxt(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 Z_({camera:e._sceneCamera,color:H.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Z_({camera:e._shadowMapCamera,color:H.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 Z_({camera:e._passes[i].camera,color:Zxt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Pe.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,Qxt),a=O.fromTranslationQuaternionRotationScale(i,o,s,Z0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=$xt(a,H.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Z_({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function F8(){this.viewMatrix=new O,this.inverseViewMatrix=new O,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new O}F8.prototype.clone=function(e){O.clone(e.viewMatrix,this.viewMatrix),O.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var ebt=new O(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);F8.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return O.multiply(t,e,this.viewProjectionMatrix),O.multiply(ebt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var tbt=new Array(5),nbt=new Li,ibt=new Array(4),NCe=new h,FCe=new h;function obt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=ibt,_=tbt;for(_[0]=o,_[s]=r,a=0;a<s;++a){let L=(a+1)/s,g=o*Math.pow(u,L),E=o+c*L,v=P.lerp(E,g,f);_[a+1]=v,p[a]=v-_[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=_[0];for(a=0;a<s-1;++a)L+=p[a],_[a+1]=L}ie.unpack(_,0,e._cascadeSplits[0]),ie.unpack(_,1,e._cascadeSplits[1]),ie.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,x=m.right,b=m.bottom,T=m.top,C=m.near,A=m.far,S=n.positionWC,w=n.directionWC,R=n.upWC,D=i.frustum.clone(nbt),M=n.getViewProjection();for(a=0;a<s;++a){D.near=_[a],D.far=_[a+1];let L=O.multiply(D.projectionMatrix,i.viewMatrix,Z0),g=O.inverse(L,Z0),E=O.multiply(M,g,Z0),v=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,NCe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,FCe);for(let z=0;z<8;++z){let B=ie.clone(gp[z],xZ[z]);O.multiplyByVector(E,B,B),h.divideByScalar(B,B.w,B),h.minimumByComponent(B,v,v),h.maximumByComponent(B,I,I)}v.x=Math.max(v.x,0),v.y=Math.max(v.y,0),v.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],F=N.camera;F.clone(n);let U=F.frustum;U.left=y+v.x*(x-y),U.right=y+I.x*(x-y),U.bottom=b+v.y*(T-b),U.top=b+I.y*(T-b),U.near=C+v.z*(A-C),U.far=C+I.z*(A-C),N.cullingVolume=F.frustum.computeCullingVolume(S,w,R);let k=e._cascadeMatrices[a];O.multiply(F.getViewProjection(),i.inverseViewMatrix,k),O.multiply(N.textureOffsets,k,k)}}var rbt=new O,sbt=new h,abt=new h,RCe=new h;function cbt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=O.multiply(i.frustum.projectionMatrix,i.viewMatrix,Z0),r=O.inverse(o,Z0),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,sbt);a=h.cross(c,s,abt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,RCe),f=O.computeView(u,s,a,c,rbt),d=O.multiply(f,r,Z0),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,NCe),_=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,FCe);for(let A=0;A<8;++A){let S=ie.clone(gp[A],xZ[A]);O.multiplyByVector(d,S,S),h.divideByScalar(S,S.w,S),h.minimumByComponent(S,p,p),h.maximumByComponent(S,_,_)}_.z+=1e3,p.z-=10;let m=RCe;m.x=-(.5*(p.x+_.x)),m.y=-(.5*(p.y+_.y)),m.z=-_.z;let y=O.fromTranslation(m,Z0);f=O.multiply(y,f,f);let x=.5*(_.x-p.x),b=.5*(_.y-p.y),T=_.z-p.z,C=n.frustum;C.left=-x,C.right=x,C.bottom=-b,C.top=b,C.near=.01,C.far=T,O.clone(f,n.viewMatrix),O.inverse(f,n.inverseViewMatrix),O.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var lbt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],ubt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],fbt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function dbt(e,t){let n=new Li;n.fov=P.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=lbt[i],o.upWC=ubt[i],o.rightWC=fbt[i],O.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),O.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var hbt=new h,mbt=new h,BCe=new re,OCe=BCe.center;function pbt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=BCe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,hbt),s=h.negate(i.directionWC,mbt),a=h.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.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)===Gt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),re.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,OCe),OCe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Gt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),re.clone(o,e._boundingSphere)}}function _bt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;O.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),O.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=ho.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,pbt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}_p.prototype.update=function(e){if(_bt(this,e),this._needsUpdate)if(Wxt(this,e.context),this._isPointLight&&dbt(this,e),this._cascadesEnabled&&(cbt(this,e),this._numberOfCascades>1&&obt(this,e)),this._isPointLight)this._shadowMapCullingVolume=Ds.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;O.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Jxt(this,e)};_p.prototype.updatePass=function(e,t){LCe(this,e,t)};var gbt=new V;function kCe(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=gbt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ie.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ie.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ie,combinedUniforms2:new ie};return ct(t,o,!1)}function ybt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Se.GLOBE,d=n.pass!==Se.TRANSLUCENT,p=e._isPointLight,_=e._usesDepthTexture,m=tg.getShadowCastShaderKeyword(p,f,_,d);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let x=u.vertexShaderSource,b=u.fragmentShaderSource,T=tg.createShadowCastVertexShader(x,p,f),C=tg.createShadowCastFragmentShader(b,p,_,d);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Fe(a,!1),a.cull=Fe(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=kCe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}_p.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Se.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let _=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||_){let y=tg.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let x=tg.createShadowReceiveVertexShader(a,u,f),b=tg.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:x,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=kCe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};_p.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=ybt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};_p.prototype.isDestroyed=function(){return!1};_p.prototype.destroy=function(){yZ(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 ce(this)};var Q0=_p;var B8=`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 lv=`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 xbt=!1;function J0(e){this._drawClassificationFBO=new bi({createDepthAttachments:!1}),this._accumulationFBO=new bi({createDepthAttachments:!1}),this._packFBO=new bi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ri({color:new H(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ri({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Xe,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(J0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function UCe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function zCe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function bbt(e,t,n,i){UCe(e),e._translucentDepthStencilTexture=new dt({context:t,width:n,height:i,pixelFormat:je.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:zt.NEAREST})}function Tbt(e,t,n,i){zCe(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 Cbt(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)&&(bbt(e,t,o,r),Tbt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Be({sources:[B8]}),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 Be({sources:[lv]}),a={colorTexture:function(){return e._textureToComposite}},xbt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Be({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),_=qe.shallowClone(f);_.shaderProgram=p,f.derivedCommands.pick=_}l(e._copyCommand)||(s=new Be({sources:[lv]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Be({sources:[lv]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Xe.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,Xe.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Xe.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!Xe.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Xe.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:jt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Xe.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:fn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}J0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Cbt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};J0.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(Se.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Se.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Se.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};J0.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),Abt(this,e,t)};function Abt(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}J0.prototype.isSupported=function(){return this._supported};J0.prototype.isDestroyed=function(){return!1};J0.prototype.destroy=function(){return UCe(this),zCe(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()),ce(this)};var k8=J0;function Ebt(){this.command=void 0,this.near=void 0,this.far=void 0}function U8(e,t,n){let i=e.context,o;i.depthTexture&&(o=new D8);let r;e._useOIT&&i.depthTexture&&(r=new M8(i));let s=new Hc(i);s.viewport=Xe.clone(n),this.camera=t,this._cameraClone=ho.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new N8(i),this.pickDepthFramebuffer=new L8,this.sceneFramebuffer=new cv,this.globeDepth=o,this.globeTranslucencyFramebuffer=new R8,this.oit=r,this.translucentTileClassification=new k8(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var bZ=new h,TZ=new h;function Sbt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,bZ)),h.maximumComponent(h.abs(t.position,TZ))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,bZ),h.multiplyByScalar(t.position,o,TZ),h.equalsEpsilon(bZ,TZ,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&O.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}U8.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Sbt(t,n,P.EPSILON15)?(this._cameraStartFired&&Pi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Pi(),ho.clone(t,n),!0)};function vbt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let _,m;c?(_=Math.min(i-u,n+p*u),m=Math.min(i,_+u)):(_=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*_));let y=d[p];l(y)?(y.near=_,y.far=m):y=d[p]=new P8(_,m)}}function wbt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var VCe=new Ds,Ibt=new hc;U8.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let L=0;L<Se.NUMBER_OF_PASSES;++L)f[M].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,_=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:x}=o,b=+Number.MAX_VALUE,T=-Number.MAX_VALUE,C=Number.MAX_VALUE,A=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,w=VCe.planes;for(let M=0;M<5;++M)w[M]=S.planes[M];S=VCe;for(let M=0;M<i.length;++M){let L=i[M],{pass:g,boundingVolume:E}=L;if(g===Se.COMPUTE)c.push(L);else if(g===Se.OVERLAY)u.push(L);else{let v,I;if(l(E)){if(!e.isVisible(S,L,A))continue;let F=E.computePlaneDistances(r,s,Ibt);if(v=F.start,I=F.stop,m=Math.min(m,v),y=Math.max(y,I),x&&L.receiveShadows&&v<Q0.MAXIMUM_DISTANCE&&!(g===Se.GLOBE&&v<-100&&I>100)){let U=I-v;g!==Se.GLOBE&&v<100&&(C=Math.min(C,U)),b=Math.min(b,v),T=Math.max(T,I)}}else L instanceof ri?(v=a.near,I=a.far):(v=a.near,I=a.far,m=Math.min(m,v),y=Math.max(y,I));let N=d[_];l(N)||(N=d[_]=new Ebt),N.command=L,N.near=v,N.far=I,_++}}x&&(b=Math.min(Math.max(b,a.near),a.far),T=Math.max(Math.min(T,a.far),b),o.nearPlane=b,o.farPlane=T,o.closestObjectSize=C),vbt(this,e,m,y);for(let M=0;M<_;M++)wbt(this,e,d[M]);if(_<p)for(let M=_;M<p;M++){let L=d[M];if(!l(L.command))break;L.command=void 0}let R=f.length,{frustumSplits:D}=t;D.length=R+1;for(let M=0;M<R;++M)D[M]=f[M].near,M===R-1&&(D[M+1]=f[M].far)};U8.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 uv=U8;var GCe=.1,Pbt=new Bh({pass:qo.MOST_DETAILED_PRELOAD}),Dbt=new Bh({pass:qo.MOST_DETAILED_PICK}),S1=new Bh({pass:qo.PICK});function oa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Xe(0,0,1,1),n=new ho(e);n.frustum=new ln({width:GCe,aspectRatio:1,near:.1}),this._pickOffscreenView=new uv(e,n,t)}oa.prototype.update=function(){this._pickPositionCacheDirty=!0};oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new I8,n[t]=i),i};var Rbt=new Qr,Obt=new h,z8=new h,Mbt=new V,Lbt=new O;function Nbt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=O.clone(r.transform,Lbt);r._setTransform(O.IDENTITY);let d=h.clone(r.position,Obt);h.multiplyByScalar(r.right,c,z8),h.add(z8,d,d),h.multiplyByScalar(r.up,u,z8),h.add(z8,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,Mbt),_=Rbt;return _.right=p.x*.5,_.left=-_.right,_.top=p.y*.5,_.bottom=-_.top,_.near=s.near,_.far=s.far,_.computeCullingVolume(d,r.directionWC,r.upWC)}var Fbt=new au,Bbt=new V;function kbt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,_=d*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,Bbt),y=m.x*n*.5,x=m.y*i*.5,b=Fbt;return b.top=_+x,b.bottom=_-x,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function V8(e,t,n,i,o){let r=e.camera.frustum;return r instanceof ln||r instanceof Qr?Nbt(e,t,n,i,o):kbt(e,t,n,i,o)}var H8=new Xe(0,0,3,3),G8=new V,v1=new H(0,0,0,0);function CZ(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}oa.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 u=s.passState;u.viewport=Xe.clone(a,u.viewport);let f=qi.transformWindowToDrawingBuffer(e,t,G8),d=CZ(o.drawingBufferHeight,f,n,i,H8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=V8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=S1,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,v1),e.resolveFramebuffers(u);let p=c.end(d);return o.endFrame(),p};oa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Xe.clone(a,u.viewport);let f=qi.transformWindowToDrawingBuffer(e,t,G8),d=CZ(o.drawingBufferHeight,f,n,i,H8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=V8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=S1,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,v1),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return o.endFrame(),p};oa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=Xe.clone(s,c.viewport);let u=qi.transformWindowToDrawingBuffer(e,t,G8),f=CZ(i.drawingBufferHeight,u,1,1,H8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=V8(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=S1,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,v1);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,w8.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Ubt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Xe.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=V8(e,t,1,1,s),o.tilesetPassState=S1,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,v1),e.resolveFramebuffers(c),i.endFrame()}var zbt=new Li,Vbt=new au,Hbt=new ln,Gbt=new Qr;oa.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 h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=qi.transformWindowToDrawingBuffer(e,t,G8);e.pickTranslucentDepth?Ubt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(zbt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Vbt):l(s.frustum.width)?f=s.frustum.clone(Hbt):f=s.frustum.clone(Gbt);let{frustumCommandsList:d}=a,p=d.length;for(let _=0;_<p;++_){let y=this.getPickDepth(e,_).getDepth(o,u.x,u.y);if(l(y)&&y>0&&y<1){let x=d[_],b;return e.mode===ne.SCENE2D?(b=s.position.z,s.position.z=b-x.near+1,f.far=Math.max(1,x.far-x.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=x.near*(_!==0?e.opaqueFrustumNearOffset:1),f.far=x.far,c.updateFrustum(f)),n=qi.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===ne.SCENE2D&&(s.position.z=b,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var jbt=new fe;oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,jbt);o.cartographicToCartesian(r,n)}return n};function jCe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,_=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(_=!0,i.show=bn.toValue(!1,i.show),s.push(i))),u instanceof ma&&(_=!0,u.show=!1,a.push(u)),_||(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=bn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}oa.prototype.drillPick=function(e,t,n,i,o){let r=this;return jCe(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 HCe=new h,Wbt=new h;function qbt(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 WCe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,HCe),s=h.cross(o,r,HCe),a=h.cross(o,s,Wbt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??GCe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Ybt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=WCe(e,o,r,a),u=Pbt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let _=s[p];_.show&&t.primitives.contains(_)&&(_.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Ybt(this,e,t[n])&&t.splice(n--,1)};function qCe(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 Jl&&qCe(o,t,n))}}function j8(e,t,n,i,o,r){let s=[];if(qCe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new qbt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Xbt(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 Kbt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,WCe(e,n,o,f.camera);let d=Xe.clone(f.viewport,H8),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Dbt:c.tilesetPassState=S1,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,v1),t.resolveFramebuffers(p);let _,m=f.pickFramebuffer.end(d);if(t.context.depthTexture){let{frustumCommandsList:y}=f,x=y.length;for(let b=0;b<x;++b){let C=e.getPickDepth(t,b).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let A=y[b],S=A.near*(b!==0?t.opaqueFrustumNearOffset:1),w=A.far,R=S+C*(w-S);_=gn.getPoint(n,R);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(_))return{object:m,position:_,exclude:!l(_)&&r||Xbt(m,i)}}function YCe(e,t,n,i,o,r,s,a){return jCe(i,function(){return Kbt(e,t,n,o,r,s,a)})}function fv(e,t,n,i,o,r,s){let a=YCe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function XCe(e,t,n,i,o,r,s,a){return YCe(e,t,n,i,o,r,s,a)}function W8(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)})})}oa.prototype.pickFromRay=function(e,t,n,i){return fv(this,e,t,n,i,!1,!1)};oa.prototype.drillPickFromRay=function(e,t,n,i,o){return XCe(this,e,t,n,i,o,!1,!1)};oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,W8(e,j8(o,e,t,n,i,function(){return fv(o,e,t,n,i,!1,!0)}))};oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,W8(e,j8(r,e,t,i,o,function(){return XCe(r,e,t,n,i,o,!1,!0)}))};var $bt=new h,Zbt=new h,Qbt=new gn,KCe=new fe;function AZ(e,t){let n=e.ellipsoid,i=mi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Zbt),r=fe.toCartesian(t,n,$bt),s=Qbt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function $Ce(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,KCe);return AZ(e,i)}function ZCe(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,KCe).height}function Jbt(e,t,n,i,o){let r=AZ(t,n);return j8(e,t,r,i,o,function(){let s=fv(e,t,r,i,o,!0,!0);if(l(s))return ZCe(t,s.position)})}function eTt(e,t,n,i,o,r){let s=$Ce(t,n);return j8(e,t,s,i,o,function(){let a=fv(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}oa.prototype.sampleHeight=function(e,t,n,i){let o=AZ(e,t),r=fv(this,e,o,n,i,!0,!1);if(l(r))return ZCe(e,r.position)};oa.prototype.clampToHeight=function(e,t,n,i,o){let r=$Ce(e,t),s=fv(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};oa.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]=Jbt(this,e,t[s],n,i);return W8(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}))};oa.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]=eTt(this,e,t[s],n,i,t[s]);return W8(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var q8=oa;var Y8=`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 X8=`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 K8=`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 $8=`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 Z8=`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 Q8=`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 J8=`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 eH=`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 tH=`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 nH=`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 iH=`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 oH=`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 rH=`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 bT=`#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 sH=`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 aH=`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 cH=`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 lH=`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 uH=`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); -} -`;/** - * @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 fH=`/** - * @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); -} -`;function TT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new bi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new V,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(TT.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 QCe(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 tTt(e,t){QCe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),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 bi,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 JCe(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 nTt(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 iTt(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 oTt(e,t){JCe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(iTt(r,i),{framebuffer:n[r].framebuffer,uniformMap:nTt(e,r)});e._commands=o}TT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ri({color:new H(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};TT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,tTt(this,e),oTt(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};TT.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)};TT.prototype.isDestroyed=function(){return!1};TT.prototype.destroy=function(){return QCe(this),JCe(this),ce(this)};var dH=TT;var rTt={NEAREST:0,LINEAR:1},xd=rTt;function CT(e){e=e??G.EMPTY_OBJECT;let{name:t=Nn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=xd.NEAREST,pixelFormat:a=je.RGBA,pixelDatatype:c=He.UNSIGNED_BYTE,clearColor:u=H.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new Hc;d.scissorTest={enabled:!0,rectangle:l(f)?Xe.clone(f):new Xe},this._passState=d,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(CT.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 sTt=/uniform\s+sampler2D\s+depthTexture/g;CT.prototype._isSupported=function(e){return!sTt.test(this._fragmentShader)||e.depthTexture};function aTt(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 dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof dt&&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 cTt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function lTt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function uTt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=cTt(e,r),n[r]=aTt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=lTt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=ct(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 fTt(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 dTt(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=fTt(n,o)}let i=new Be({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function hTt(e){let t=e._sampleMode,n,i;t===xd.LINEAR?(n=ft.LINEAR,i=Kn.LINEAR):(n=ft.NEAREST,i=Kn.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function mTt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function pTt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function _Tt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new dt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=pTt(e,u);else if(typeof u=="string"){let d=new Ee({url:u});s.push(d.fetchImage().then(mTt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function eAe(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 dt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function gTt(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 yTt(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 dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:zt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;r[o]=H.floatToByte(d.red),r[o+1]=H.floatToByte(d.green),r[o+2]=H.floatToByte(d.blue),r[o+3]=H.floatToByte(d.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=H.floatToByte(c.red),r[o+1]=H.floatToByte(c.green),r[o+2]=H.floatToByte(c.blue),r[o+3]=H.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:zt.NEAREST})}CT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&eAe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=gTt(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,yTt(this,e),uTt(this),_Tt(this,e),dTt(this,e),hTt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Xe(0,0,i.width,i.height)}))),this._command.renderState=o};CT.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,zt.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)};CT.prototype.isDestroyed=function(){return!1};CT.prototype.destroy=function(){return eAe(this),ce(this)};var yo=CT;function AT(e){e=e??G.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Nn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(AT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});AT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};AT.prototype.get=function(e){return this._stages[e]};function xTt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}AT.prototype.update=function(e,t){this._selectedDirty=xTt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ce(this)};var Qu=AT;var Rr={};function EZ(e){let o=`#define USE_STEP_SIZE -${bT}`,r=new yo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:xd.LINEAR}),s=new yo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:xd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Qu({name:e,stages:[r,s],uniforms:a})}Rr.createBlurStage=function(){return EZ("czm_blur")};Rr.createDepthOfFieldStage=function(){let e=EZ("czm_depth_of_field_blur"),t=new yo({name:"czm_depth_of_field_composite",fragmentShader:eH,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 Qu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Rr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Rr.createEdgeDetectionStage=function(){let e=Nn();return new yo({name:`czm_edge_detection_${e}`,fragmentShader:nH,uniforms:{length:.25,color:H.clone(H.BLACK)}})};Rr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function bTt(e){if(!l(e))return Rr.createEdgeDetectionStage();let t=new Qu({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 yo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Qu({name:"czm_edge_detection_composite",stages:[t,s]})}Rr.createSilhouetteStage=function(e){let t=bTt(e),n=new yo({name:"czm_silhouette_color_edges",fragmentShader:uH,uniforms:{silhouetteTexture:t.name}});return new Qu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Rr.isSilhouetteSupported=function(e){return e.context.depthTexture};Rr.createBloomStage=function(){let e=new yo({name:"czm_bloom_contrast_bias",fragmentShader:J8,uniforms:{contrast:128,brightness:-.3}}),t=EZ("czm_bloom_blur"),n=new Qu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new yo({name:"czm_bloom_generate_composite",fragmentShader:Z8,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 Qu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Rr.createAmbientOcclusionStage=function(){let e=new yo({name:"czm_ambient_occlusion_generate",fragmentShader:X8,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new yo({name:"czm_ambient_occlusion_composite",fragmentShader:K8,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 Qu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Rr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var TTt=`#define FXAA_QUALITY_PRESET 39 -${fH} -${rH}`;Rr.createFXAAStage=function(){return new yo({name:"czm_FXAA",fragmentShader:TTt,sampleMode:xd.LINEAR})};Rr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Y8,new yo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=iH,new yo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=oH,new yo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=lH,new yo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=aH,new yo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:H.WHITE,autoExposure:void 0,exposure:1}})};Rr.createAutoExposureStage=function(){return new dH};Rr.createBlackAndWhiteStage=function(){return new yo({name:"czm_black_and_white",fragmentShader:$8,uniforms:{gradations:5}})};Rr.createBrightnessStage=function(){return new yo({name:"czm_brightness",fragmentShader:Q8,uniforms:{brightness:.5}})};Rr.createNightVisionStage=function(){return new yo({name:"czm_night_vision",fragmentShader:cH})};Rr.createDepthViewStage=function(){return new yo({name:"czm_depth_view",fragmentShader:tH})};Rr.createLensFlareStage=function(){return new yo({name:"czm_lens_flare",fragmentShader:sH,uniforms:{dirtTexture:on("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:on("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var bd=Rr;function ng(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function I1(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function SZ(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[I1(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[I1(d)]=!0)}}}return i.name}function w1(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 d=0;d<c;++d){let p=i.get(d);l(p.length)?a=w1(e,t,n,p,o):a=SZ(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=I1(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=I1(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[I1(i.get(p))]=!0}return a}function CTt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=w1(e,t,n,i,void 0);a=w1(e,t,n,o,a),a=SZ(e,t,n,r,a),a=w1(e,t,n,e,a),SZ(e,t,n,s,a)}else w1(e,t,n,e,void 0);return n}function ATt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,_=p.length;for(f=0;f<_;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!H.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,x=!1;for(let b=0;b<y;++b)if(n[m[b]]){x=!0;break}if(!x)break}return l(d)&&f<_?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new bi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function ETt(e,t){let n=CTt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=ATt(e,i,n[i]))}function vZ(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function STt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new ri({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}ng.prototype.updateDependencies=function(){this._updateDependencies=!0};ng.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)&&(vZ(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&ETt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,vZ(this),STt(this,e))};ng.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ng.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ng.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ng.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ng.prototype.isDestroyed=function(){return!1};ng.prototype.destroy=function(){return vZ(this),ce(this)};var dv=ng;var vTt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var ex=Object.freeze(vTt);var wZ=[];function bl(){let e=bd.createFXAAStage(),t=bd.createAmbientOcclusionStage(),n=bd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=bd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=ex.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new dv(this),r={},s=wZ;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(bl.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 IZ(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 ex.REINHARD:n=bd.createReinhardTonemappingStage(t);break;case ex.MODIFIED_REINHARD:n=bd.createModifiedReinhardTonemappingStage(t);break;case ex.FILMIC:n=bd.createFilmicTonemappingStage(t);break;case ex.PBR_NEUTRAL:n=bd.createPbrNeutralTonemappingStage(t);break;default:n=bd.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 IZ(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}bl.prototype.add=function(e){let t=this._stageNames,n=wZ;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};bl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=wZ;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};bl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};bl.prototype.get=function(e){return IZ(this),this._stages[e]};bl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};bl.prototype.getStageByName=function(e){return this._stageNames[e]};bl.prototype.update=function(e,t,n){IZ(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 b=0;b<r.length;++b){let T=r[b];T.ready&&T.enabled&&T._isSupported(e)&&(o[s++]=T)}o.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(o[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let _=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),x=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||_!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||x!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=x,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){let T=new Uint8Array(196608);for(let C=0;C<196608;C+=3)T[C]=Math.floor(Math.random()*255);this._randomTexture=new dt({context:e,pixelFormat:je.RGB,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:T,width:256,height:256},sampler:new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<r.length;++b)r[b].update(e,t);s=0;for(let b=0;b<r.length;++b){let T=r[b];T.ready&&T.enabled&&T._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};bl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function ET(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}bl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return ET(t)};function yp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){yp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)yp(e.get(r),t,ET(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)yp(e.get(r),t,n,i,o)}bl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),_=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&r===0)return;let x=t;d&&a.ready&&(yp(a,e,x,n,i),x=ET(a)),p&&c.ready&&(yp(c,e,x,n,i),x=ET(c)),_&&u.ready&&yp(u,e,x,n,i),m&&f.ready&&(yp(f,e,x,n,i),x=ET(f));let b=x;if(r>0){yp(o[0],e,x,n,i);for(let T=1;T<r;++T)yp(o[T],e,ET(o[T-1]),n,i);b=ET(o[r-1])}y&&s.ready&&yp(s,e,b,n,i)};bl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Zu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bl.prototype.isDestroyed=function(){return!1};bl.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(),ce(this)};var hH=bl;function ST(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}ST.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};ST.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof ln,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(O.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?rCt(this,e):dCt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var wTt=new h,ITt=new h,PTt=new h,DTt=new h,RTt=new h,OTt=new h,MTt=new h,LTt=new fe,NTt=new O,FTt=new Li,BTt=new ln,kTt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};ST.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(O.IDENTITY);let i=wTt,o=ITt,r=PTt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(u.positionWC,i),h.clone(u.directionWC,o),h.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,MTt),d=Et.eastNorthUpToFixedFrame(f,t,NTt);O.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,LTt),i),O.multiplyByPointAsVector(d,o,o),O.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=BTt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=FTt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=kTt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=mCt(a);P1(this,c),this._previousMode===ne.SCENE2D?hCt(this,e,a,c):(a.position2D=O.multiplyByPoint(ho.TRANSFORM_2D,i,DTt),a.direction2D=O.multiplyByPointAsVector(ho.TRANSFORM_2D,o,RTt),a.up2D=O.multiplyByPointAsVector(ho.TRANSFORM_2D,r,OTt),n._mode=ne.MORPHING,fAe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var RZ={position:new h,direction:new h,up:new h,frustum:void 0},nAe=new Li;ST.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(O.IDENTITY),this._previousMode===ne.SCENE2D)KTt(this,e,t);else{let i;e>0?(i=RZ,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=iAe(this,t);let o,r=n.camera;r.frustum instanceof ln?o=r.frustum.clone():(o=nAe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=hAe(i);P1(this,s),DZ(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return mH(this),ce(this)};function P1(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new md(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,An.LEFT_DOWN),e._morphHandler.setInputAction(n,An.MIDDLE_DOWN),e._morphHandler.setInputAction(n,An.RIGHT_DOWN),e._morphHandler.setInputAction(n,An.WHEEL)}}function mH(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 UTt=new fe,zTt=new h,VTt=new O;function iAe(e,t){let n=e._scene,i=n.camera,o=RZ,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,UTt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,zTt),f=Et.eastNorthUpToFixedFrame(u,t,VTt);return O.multiplyByPointAsVector(f,i.direction,s),O.multiplyByPointAsVector(f,i.up,a),o}var HTt=new h,GTt=new h,jTt=new h,WTt=new h,qTt=new h,YTt=new h;function DZ(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,HTt),a=h.clone(r.direction,GTt),c=h.clone(r.up,jTt),u=O.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,n.position,WTt),f=O.multiplyByPointAsVector(ho.TRANSFORM_2D_INVERSE,n.direction,qTt),d=O.multiplyByPointAsVector(ho.TRANSFORM_2D_INVERSE,n.up,YTt);function p(m){Td(s,u,m.time,r.position),Td(a,f,m.time,r.direction),Td(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let _=o.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dAe(e,o,0,1,t,i)}});e._currentTweens.push(_)}var XTt=new ln,oAe=new h,rAe=new h,sAe=new h,OZ=new h,aAe=new h,cAe=new h;function KTt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=RZ,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=iAe(e,n));let s;e._morphToOrthographic?(s=XTt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=nAe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=hAe(r);P1(e,a);let c;e._morphToOrthographic?c=function(){DZ(e,t,r,a)}:c=function(){uAe(e,t,r,function(){DZ(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,OZ),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Td(e,t,n,i){return h.lerp(e,t,n,i)}function lAe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof ln)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let _=u/Math.tan(s.frustum.fov*.5);i(s,_)}let d=r.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var $Tt=new h,ZTt=new h,QTt=new h,PZ=new h,JTt=new h,eCt=new h,tCt=new Qr,nCt=new gn,iCt=new h,oCt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function rCt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,$Tt),r=h.clone(i.direction,ZTt),s=h.clone(i.up,QTt),a=h.negate(h.UNIT_Z,JTt),c=h.clone(h.UNIT_Y,eCt),u=PZ;if(t>0)h.clone(h.ZERO,PZ),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,PZ);let x=nCt;O.multiplyByPoint(ho.TRANSFORM_2D,o,x.origin),O.multiplyByPointAsVector(ho.TRANSFORM_2D,r,x.direction);let b=n.globe;if(l(b)){let T=b.pickWorldCoordinates(x,n,!0,iCt);l(T)&&(O.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,T,u),u.z+=h.distance(o,u))}}let f=tCt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=oCt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=mAe(d);P1(e,p);function _(x){Td(o,u,x.time,i.position),Td(r,a,x.time,i.direction),Td(s,c,x.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(x,b){x.position.z=b}let y=n.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){lAe(e,t,d,m,p)}});e._currentTweens.push(y)}var tAe=new fe,sCt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Qr},aCt={position:new h,direction:new h,up:new h,frustum:void 0},cCt=new h,lCt=new gn,uCt=new O,fCt=new h;function dCt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=sCt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,tAe),i.mapProjection.project(tAe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let d=lCt;h.clone(r.position2D,d.origin);let p=h.clone(o.directionWC,d.direction),_=n.scaleToGeodeticSurface(o.positionWC,fCt),m=Et.eastNorthUpToFixedFrame(_,n,uCt);O.inverseTransformation(m,m),O.multiplyByPointAsVector(m,p,p),O.multiplyByPointAsVector(ho.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let x=y.pickWorldCoordinates(d,i,!0,cCt);if(l(x)){let b=h.distance(r.position2D,x);x.x+=b,h.clone(x,r.position2D)}}}function s(d,p){d.position.x=p}O.multiplyByPoint(ho.TRANSFORM_2D,r.position,r.position2D),O.multiplyByPointAsVector(ho.TRANSFORM_2D,r.direction,r.direction2D),O.multiplyByPointAsVector(ho.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=aCt;O.multiplyByPoint(ho.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let u=mAe(c);P1(e,u);function f(){lAe(e,t,r,s,u)}fAe(e,t,r,f)}function uAe(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=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function hCt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,OZ),a=h.clone(n.direction,aAe),c=h.clone(n.up,cAe);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=h.clone(r.position,oAe),d=h.clone(r.direction,rAe),p=h.clone(r.up,sAe);f.z=s.z;function _(y){Td(f,s,y.time,r.position),Td(d,a,y.time,r.direction),Td(p,c,y.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():uAe(e,0,n,u)}function fAe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,oAe),a=h.clone(r.direction,rAe),c=h.clone(r.up,sAe),u=h.clone(n.position2D,OZ),f=h.clone(n.direction2D,aAe),d=h.clone(n.up2D,cAe);function p(m){Td(s,u,m.time,r.position),Td(a,f,m.time,r.direction),Td(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let _=o.tweens.add({duration:t,easingFunction:as.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dAe(e,o,1,0,t,i)}});e._currentTweens.push(_)}function dAe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:as.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function hAe(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),mH(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.SCENE3D,r)}}function mAe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),mH(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.SCENE2D,o)}}function mCt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),mH(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,ne.COLUMBUS_VIEW,r)}}var pH=ST;var pCt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Gi=Object.freeze(pCt);function ra(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function _Ct(e,t){V.clone(e.distance.startPosition,t.distance.startPosition),V.clone(e.distance.endPosition,t.distance.endPosition),V.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),V.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function pAe(e,t,n){let i=ra(Gi.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 V;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new V,endPosition:new V},u.angleAndHeight={startPosition:new V,endPosition:new V},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,V.lerp(f.position1,f.position2,.5,s[i])},An.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},An.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(_Ct(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(V.clone(f.distance.endPosition,u.distance.endPosition),V.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,_=Math.PI*2;for(;d>=p+Math.PI;)d-=_;for(;d<p-Math.PI;)d+=_;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},An.PINCH_MOVE,t)}function _Ae(e,t){let n=ra(Gi.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 V,endPosition:new V,valid:!1}),s.startPosition=new V,V.clone(V.ZERO,s.startPosition),s.endPosition=new V,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,V.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},An.WHEEL,t)}function hv(e,t,n){let i=ra(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new V;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new V,endPosition:new V,valid:!1});let c,u;n===Gi.LEFT_DRAG?(c=An.LEFT_DOWN,u=An.LEFT_UP):n===Gi.RIGHT_DRAG?(c=An.RIGHT_DOWN,u=An.RIGHT_UP):n===Gi.MIDDLE_DRAG&&(c=An.MIDDLE_DOWN,u=An.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,V.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){MZ(ra(n,void 0),e);for(let f of Object.values(Pa)){let d=ra(n,f);MZ(d,e)}},u,t)}function MZ(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 gAe(e,t){V.clone(e.startPosition,t.startPosition),V.clone(e.endPosition,t.endPosition)}function gCt(e,t,n){let i=n._isDown,o=!1,r=ra(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,MZ(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new V,endPosition:new V,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function yAe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Gi)if(Gi.hasOwnProperty(s)){let a=Gi[s];if(l(a)){let c=ra(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new V,endPosition:new V,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new V,endPosition:new V})}}e._eventHandler.setInputAction(function(s){for(let a in Gi)if(Gi.hasOwnProperty(a)){let c=Gi[a];if(l(c)){let u=ra(c,t);gCt(c,t,e),r[u]&&(n[u]?(gAe(i[u],o[u]),o[u].valid=!0,gAe(s,i[u]),n[u]=!1):V.clone(s.endPosition,i[u].endPosition))}}V.clone(s.endPosition,e._currentMousePosition)},An.MOUSE_MOVE,t)}function Cd(e){this._eventHandler=new md(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new V,_Ae(this,void 0),pAe(this,void 0,e),hv(this,void 0,Gi.LEFT_DRAG),hv(this,void 0,Gi.RIGHT_DRAG),hv(this,void 0,Gi.MIDDLE_DRAG),yAe(this,void 0);for(let t in Pa)if(Pa.hasOwnProperty(t)){let n=Pa[t];l(n)&&(_Ae(this,n),pAe(this,n,e),hv(this,n,Gi.LEFT_DRAG),hv(this,n,Gi.RIGHT_DRAG),hv(this,n,Gi.MIDDLE_DRAG),yAe(this,n))}}Object.defineProperties(Cd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ra(Gi.WHEEL)]||!this._update[ra(Gi.WHEEL,Pa.SHIFT)]||!this._update[ra(Gi.WHEEL,Pa.CTRL)]||!this._update[ra(Gi.WHEEL,Pa.ALT)];return this._buttonsDown>0||e}}});Cd.prototype.isMoving=function(e,t){let n=ra(e,t);return!this._update[n]};Cd.prototype.getMovement=function(e,t){let n=ra(e,t);return this._movement[n]};Cd.prototype.getLastMovement=function(e,t){let n=ra(e,t),i=this._lastMovement[n];if(i.valid)return i};Cd.prototype.isButtonDown=function(e,t){let n=ra(e,t);return this._isDown[n]};Cd.prototype.getStartMousePosition=function(e,t){if(e===Gi.WHEEL)return this._currentMousePosition;let n=ra(e,t);return this._eventStartPosition[n]};Cd.prototype.getButtonPressTime=function(e,t){let n=ra(e,t);return this._pressTime[n]};Cd.prototype.getButtonReleaseTime=function(e,t){let n=ra(e,t);return this._releaseTime[n]};Cd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Cd.prototype.isDestroyed=function(){return!1};Cd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ce(this)};var _H=Cd;function gH(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Fe(n),this._stopObject=Fe(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(gH.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}}});gH.prototype.cancelTween=function(){this._tweens.remove(this)};function Uh(){this._tweens=[]}Object.defineProperties(Uh.prototype,{length:{get:function(){return this._tweens.length}}});Uh.prototype.add=function(e){if(e=e??G.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new gH(this);let t=e.duration/Yn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Yn.SECONDS_PER_MILLISECOND,o=e.easingFunction??as.LINEAR_NONE,r=e.startObject,s=new u0e(r);s.to(Fe(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 gH(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Uh.prototype.addProperty=function(e){e=e??G.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})};Uh.prototype.addAlpha=function(e){e=e??G.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})};Uh.prototype.addOffsetIncrement=function(e){e=e??G.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})};Uh.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};Uh.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};Uh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Uh.prototype.get=function(e){return this._tweens[e]};Uh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Yn.SECONDS_PER_MILLISECOND:Pi();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 mv=Uh;function R1(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=Gi.LEFT_DRAG,this.zoomEventTypes=[Gi.RIGHT_DRAG,Gi.WHEEL,Gi.PINCH],this.rotateEventTypes=Gi.LEFT_DRAG,this.tiltEventTypes=[Gi.MIDDLE_DRAG,Gi.PINCH,{eventType:Gi.LEFT_DRAG,modifier:Pa.CTRL},{eventType:Gi.RIGHT_DRAG,modifier:Pa.CTRL}],this.lookEventTypes={eventType:Gi.LEFT_DRAG,modifier:Pa.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new _H(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 mv,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new V(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new V(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new V,this._strafeEndMousePosition=new V,this._zoomMouseStart=new V(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new V,this._panLastWorldPosition=new h,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 fe(Math.PI,P.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 yCt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function xCt(e){return V.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var bCt=.4;function TCt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new V,endPosition:new V,motion:new V,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<bCt){let _=yCt(p,i),m=e.getLastMovement(t,n);if(!l(m)||xCt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=V.clone(m.startPosition,a.startPosition),a.endPosition=V.multiplyByScalar(a.motion,_,a.endPosition),a.endPosition=V.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||V.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function CCt(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 xAe=[];function Tl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(xAe[0]=n,n=xAe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),_=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,_,p),CCt(e,r)):o<1&&TCt(s,f,d,o,i,e,r))}}var yH=new gn,ACt=new h,ECt=new V,SCt=new h,vCt=new V,wCt=new h,ICt=new h,PCt=new h,DCt=new h,RAe=new h,RCt=new h,OCt=new h,MCt=new h,LCt=new h,NCt=new h,FCt=new h,BCt=new h,kCt=new h,UCt=new h,zCt=new h,vT=new h,bAe=new h,TAe=new h,LZ={orientation:new fc};function HZ(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let _=a/e._scene.canvas.clientHeight;_=Math.min(_,e.maximumMovementRatio);let m=p*_;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let y=e._scene,x=y.camera,b=y.mode,T=LZ.orientation;T.heading=x.heading,T.pitch=x.pitch,T.roll=x.roll;let C=n.inertiaEnabled??V.equals(t,e._zoomMouseStart),A=e._zoomingOnVector,S=e._rotatingZoom,w;if(C||(e._zoomMouseStart=V.clone(t,e._zoomMouseStart),l(e._globe)&&b===ne.SCENE2D?(w=x.getPickRay(t,yH).origin,w=h.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=ig(e,t,ACt)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,A=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(m);return}let R=b===ne.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(S=!0),!C||S){if(b===ne.SCENE2D){let D=e._zoomWorldPosition,M=x.position;if(!h.equals(D,M)&&x.positionCartographic.height<e._maxCoord.x*2){let L=x.position.x,g=h.subtract(D,M,SCt);h.normalize(g,g);let E=h.distance(D,M)*m/(x.getMagnitude()*.5);x.move(g,E*.5),(x.position.x<0&&L>0||x.position.x>0&&L<0)&&(w=x.getPickRay(t,yH).origin,w=h.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=h.clone(w,e._zoomWorldPosition))}}else if(b===ne.SCENE3D){let D=h.normalize(x.position,RAe);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(h.dot(x.direction,D))<.6)R=!0;else{let M=y.canvas,L=vCt;L.x=M.clientWidth/2,L.y=M.clientHeight/2;let g=ig(e,L,wCt);if(!l(g))R=!0;else if(x.positionCartographic.height<1e6)if(h.dot(x.direction,D)>=-.5)R=!0;else{let E=OCt;h.clone(x.position,E);let v=e._zoomWorldPosition,I=RCt;if(I=h.normalize(v,I),h.dot(I,D)<0)return;let N=zCt,F=NCt;h.clone(x.direction,F),h.add(E,h.multiplyByScalar(F,1e3,vT),N);let U=FCt,k=BCt;h.subtract(v,E,U),h.normalize(U,k);let z=h.dot(D,k);if(z>=0){e._zoomMouseStart.x=-1;return}let B=Math.acos(-z),j=h.magnitude(E),W=h.magnitude(v),J=j-m,Y=h.magnitude(U),ee=Math.asin(P.clamp(Y/W*Math.sin(B),-1,1)),Q=Math.asin(P.clamp(J/W*Math.sin(B),-1,1)),de=ee-Q+B,ge=MCt;h.normalize(E,ge);let le=LCt;le=h.cross(k,ge,le),le=h.normalize(le,le),h.normalize(h.cross(ge,le,vT),F),h.multiplyByScalar(h.normalize(N,vT),h.magnitude(N)-m,N),h.normalize(E,E),h.multiplyByScalar(E,J,E);let ye=kCt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(de)-1,bAe),h.multiplyByScalar(F,Math.sin(de),TAe),vT),J,ye),h.add(E,ye,E),h.normalize(N,ge),h.normalize(h.cross(ge,le,vT),F);let be=UCt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(de)-1,bAe),h.multiplyByScalar(F,Math.sin(de),TAe),vT),h.magnitude(N),be),h.add(N,be,N),h.clone(E,x.position),h.normalize(h.subtract(N,E,vT),x.direction),h.clone(x.direction,x.direction),h.cross(x.direction,x.up,x.right),h.cross(x.right,x.direction,x.up),x.setView(LZ);return}else{let E=h.normalize(g,ICt),v=h.normalize(e._zoomWorldPosition,PCt),I=h.dot(v,E);if(I>0&&I<1){let N=P.acosClamped(I),F=h.cross(v,E,DCt),U=Math.abs(N)>P.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-m,k=m/U;x.rotate(F,N*k)}}}}e._rotatingZoom=!R}if(!C&&R||A){let D,M=qi.worldToWindowCoordinates(y,e._zoomWorldPosition,ECt);b!==ne.COLUMBUS_VIEW&&V.equals(t,e._zoomMouseStart)&&l(M)?D=x.getPickRay(M,yH):D=x.getPickRay(t,yH);let L=D.direction;(b===ne.COLUMBUS_VIEW||b===ne.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),x.move(L,m),e._zoomingOnVector=!0}else x.zoomIn(m);e._cameraUnderground||x.setView(LZ)}var VCt=new gn,HCt=new gn,GCt=new h;function jCt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,VCt).origin,s=o.getPickRay(n.endPosition,HCt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,GCt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function CAe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;HZ(e,t,n,e.zoomFactor,o.getMagnitude())}var WCt=new V,qCt=new V;function AAe(e,t,n){if(l(n.angleAndHeight)){YCt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=WCt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=V.normalize(c,c);let u=qCt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=V.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;o.twistRight(p)}function YCt(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 XCt(e){let t=e._scene.mapMode2D===$u.ROTATE;O.equals(O.IDENTITY,e._scene.camera.transform)?(Tl(e,e.enableTranslate,e.translateEventTypes,jCt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,CAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.tiltEventTypes,AAe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Tl(e,e.enableZoom,e.zoomEventTypes,CAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.translateEventTypes,AAe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var OAe=new gn,KCt=new h,$Ct=new h;function ig(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,KCt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,OAe),u=o.pickWorldCoordinates(c,i,a,$Ct),f=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var ZCt=new fe;function SH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,ZCt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var QCt=new h;function MAe(e,t){let n=t.origin,i=t.direction,o=SH(e),r=h.normalize(n,QCt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function LAe(e,t,n,i){let o=h.distance(t.origin,n),r=SH(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function NAe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=SH(e))):o=SH(e),gn.getPoint(t,o,i)}var JCt=new V;function FAe(e,t){let n=t.endPosition,i=V.subtract(t.endPosition,t.startPosition,JCt),o=e._strafeEndMousePosition;V.add(o,i,o),t.endPosition=o,GZ(e,t,e._strafeStartPosition),t.endPosition=n}var EAe=new gn,eAt=new gn,NZ=new h,tAt=new h,nAt=new h,iAt=new h,oAt=new en(h.UNIT_X,0),rAt=new V,sAt=new V;function aAt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){ef(e,t,n);return}if(e._strafing){FAe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=V.clone(n.startPosition,rAt),a=V.clone(n.endPosition,sAt),c=o.getPickRay(s,EAe),u=h.clone(h.ZERO,iAt),f=h.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=ig(e,s,NZ),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let C=d;r&&(C=NAe(e,c,d,NZ)),V.clone(t,e._strafeMousePosition),V.clone(t,e._strafeEndMousePosition),h.clone(C,e._strafeStartPosition),e._strafing=!0,GZ(e,n,e._strafeStartPosition);return}let p=en.fromPointNormal(u,f,oAt);c=o.getPickRay(s,EAe);let _=ni.rayPlane(c,p,NZ),m=o.getPickRay(a,eAt),y=ni.rayPlane(m,p,tAt);if(!l(_)||!l(y)){e._looking=!0,ef(e,t,n),V.clone(t,e._translateMousePosition);return}let x=h.subtract(_,y,nAt),b=x.x;x.x=x.y,x.y=x.z,x.z=b;let T=h.magnitude(x);T>P.EPSILON6&&(h.normalize(x,x),o.move(x,T))}var BAe=new V,TH=new gn,CH=new h,cAt=new h,kAe=new O,lAt=new O,uAt=new h,fAt=new en(h.UNIT_X,0),FZ=new h,UZ=new fe,UAe=new O,dAt=new Pe,hAt=new Z,AH=new h;function mAt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),V.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){ef(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,pAt(e,t,n)):_At(e,t,n)}function pAt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=BAe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,TH),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,ef(e,t,n),V.clone(t,e._tiltCenterMousePosition);return}let _=h.multiplyByScalar(f,d,CH);h.add(u,_,_);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(_.y,_.z,_.x,_);let x=m.unproject(_,UZ);y.cartographicToCartesian(x,_);let b=Et.eastNorthUpToFixedFrame(_,y,kAe),T=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=O.clone(o.transform,UAe);o._setTransform(b),Ju(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=T,e._ellipsoid=C;let S=C.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function _At(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(V.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,CH);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=ig(e,t,CH)),!l(s)){a=o.getPickRay(t,TH);let g=a.origin,E=a.direction,v,I=h.dot(c,E);if(Math.abs(I)>P.EPSILON6&&(v=-h.dot(c,g)/I),!l(v)||v<=0){e._looking=!0,ef(e,t,n),V.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(E,v,CH),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,TH)),LAe(e,a,s,s)),V.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=BAe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,TH);let d=h.clone(h.ZERO,uAt);d.x=s.x;let p=en.fromPointNormal(d,c,fAt),_=ni.rayPlane(a,p,cAt),m=o._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let x=m.unproject(s,UZ);y.cartographicToCartesian(x,s);let b=Et.eastNorthUpToFixedFrame(s,y,kAe),T;l(_)?(h.fromElements(_.y,_.z,_.x,_),x=m.unproject(_,UZ),y.cartographicToCartesian(x,_),T=Et.eastNorthUpToFixedFrame(_,y,lAt)):T=b;let C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=O.clone(o.transform,UAe);o._setTransform(b);let R=h.cross(h.UNIT_Z,h.normalize(o.position,FZ),FZ),D=h.dot(o.right,R);if(Ju(e,t,n,S,!1,!0),o._setTransform(T),D<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(S=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Ju(e,t,n,S,!0,!1),o.constrainedAxis=E}else Ju(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,AH);h.equalsEpsilon(g,h.ZERO,P.EPSILON6)||(h.dot(g,o.right)<0&&h.negate(g,g),h.cross(g,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(w),e._globe=C,e._ellipsoid=A;let M=A.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=h.clone(o.positionWC,FZ);if(e.enableCollisionDetection&&qZ(e,!0),!h.equals(o.positionWC,L)){o._setTransform(T),o.worldToCameraCoordinatesPoint(L,L);let g=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>g&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(g),o.position));let E=h.angleBetween(L,o.position),v=h.cross(L,o.position,L);h.normalize(v,v);let I=Pe.fromAxisAngle(v,E,dAt),N=Z.fromQuaternion(I,hAt);Z.multiplyByVector(N,o.direction,o.direction),Z.multiplyByVector(N,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(w)}}var zAe=new V,VAe=new gn,HAe=new h;function gAt(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=zAe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,VAe),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=ig(e,a,HAe));let _;if(l(p)&&(_=h.distance(u,p)),s){let m=MAe(e,c,d);l(_)?_=Math.min(_,m):_=m}if(!l(_)){let m=h.UNIT_X;_=-h.dot(m,u)/h.dot(m,f)}HZ(e,t,n,e.zoomFactor,_)}function yAt(e){let n=e._scene.camera;if(!O.equals(O.IDENTITY,n.transform))Tl(e,e.enableRotate,e.rotateEventTypes,Ju,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,jAe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Tl(e,e.enableTilt,e.tiltEventTypes,mAt,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableTranslate,e.translateEventTypes,aAt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,gAt,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableLook,e.lookEventTypes,ef),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var xAt=new gn,bAt=new en(h.UNIT_X,0),TAt=new h,CAt=new h;function GZ(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,xAt),s=h.clone(o.direction,CAt);i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=en.fromPointNormal(n,s,bAt),c=ni.rayPlane(r,a,TAt);l(c)&&(s=h.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var SAe=new h,GAe=new fe,zZ=new h,VZ=new te,AAt=new h,EAt=new h,SAt=new h;function vAt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!O.equals(o.transform,O.IDENTITY)){Ju(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,AAt);if(V.equals(t,e._rotateMousePosition)){if(e._looking)ef(e,t,n,u);else if(e._rotating)Ju(e,t,n);else if(e._strafing)FAe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=zZ,c.x=c.y=c.z=a,s=te.fromCartesian3(c,VZ),kZ(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,GAe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=ig(e,n.startPosition,SAt);if(l(p)){let _=!1,m=o.getPickRay(n.startPosition,OAe);if(r)_=!0,NAe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,EAt);Math.abs(h.dot(m.direction,y))<.05?_=!0:_=h.magnitude(o.position)<h.magnitude(p)}_?(V.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,GZ(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=zZ,c.x=c.y=c.z=a,s=te.fromCartesian3(c,VZ),kZ(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,ef(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,SAe))?(kZ(e,t,n,e._ellipsoid),h.clone(SAe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Ju(e,t,n)):(e._looking=!0,ef(e,t,n,u));V.clone(t,e._rotateMousePosition)}function Ju(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,_=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*_*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let x=e.maximumTiltAngle,b=h.dot(a.direction,i),T=Math.PI-Math.acos(b)+y;T>x&&(y-=T-x)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var BZ=ie.clone(ie.UNIT_W),vAe=ie.clone(ie.UNIT_W),xH=new h,pv=new h,bH=new h,wAe=new h,wAt=new V,IAt=new V,PAt=new V,DAt=new V,RAt=new gn;function kZ(e,t,n,i){let o=e._scene,r=o.camera,s=V.clone(n.startPosition,wAt),a=V.clone(n.endPosition,IAt),c=i.cartesianToCartographic(r.positionWC,GAe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,BZ),!l(e._globe)&&!V.equalsEpsilon(s,e._panLastMousePosition)&&(u=ig(e,s,BZ)),!l(e._globe)&&l(u))){let d=h.subtract(u,r.positionWC,pv),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,d),pv),_=h.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,_,o.pixelRatio,DAt),y=V.subtract(a,s,PAt),x=h.multiplyByScalar(r.rightWC,y.x*m.x,pv),b=h.normalize(r.positionWC,RAe),T=r.getPickRay(a,RAt).direction,C=h.subtract(T,h.projectVector(T,r.rightWC,bH),bH),A=h.angleBetween(C,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(A),.1));let w=Math.abs(h.dot(r.directionWC,b)),R=-y.y*m.y*2/Math.sqrt(S)*(1-w),D=h.multiplyByScalar(T,R,bH);w=Math.abs(h.dot(r.upWC,b));let M=h.multiplyByScalar(r.upWC,-y.y*(1-w)*m.y,wAe);f=h.add(u,x,vAe),f=h.add(f,D,f),f=h.add(f,M,f),h.clone(f,e._panLastWorldPosition),V.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,BZ),f=r.pickEllipsoid(a,i,vAe)),!l(u)||!l(f)){e._rotating=!0,Ju(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=h.mostOrthogonalAxis(d,xH);h.cross(p,d,p),h.normalize(p,p);let _=h.cross(d,p,pv),m=h.magnitude(u),y=h.dot(d,u),x=Math.acos(y/m),b=h.multiplyByScalar(d,y,bH);h.subtract(u,b,b),h.normalize(b,b);let T=h.magnitude(f),C=h.dot(d,f),A=Math.acos(C/T),S=h.multiplyByScalar(d,C,wAe);h.subtract(f,S,S),h.normalize(S,S);let w=Math.acos(h.dot(b,p));h.dot(b,_)<0&&(w=P.TWO_PI-w);let R=Math.acos(h.dot(S,p));h.dot(S,_)<0&&(R=P.TWO_PI-R);let D=w-R,M;h.equalsEpsilon(d,r.position,P.EPSILON2)?M=r.right:M=h.cross(d,r.position,xH);let L=h.cross(d,M,xH),g=h.dot(L,h.subtract(u,d,pv)),E=h.dot(L,h.subtract(f,d,pv)),v;g>0&&E>0?v=A-x:g>0&&E<=0?h.dot(r.position,d)>0?v=-x-A:v=x+A:v=x-A,r.rotateRight(D),r.rotateUp(v)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,xH);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let _=Math.acos(d);r.rotate(p,_)}}}var OAt=new h,MAt=new fe,IAe=0;function jAe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=zAe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,VAe),d,p=o.cartesianToCartographic(s.position,MAt).height,_=Math.abs(IAe)<e.minimumPickingTerrainDistanceWithInertia;(i?_:p<e._minimumPickingTerrainHeight)&&(d=ig(e,u,HAe));let y;if(l(d)&&(y=h.distance(f.origin,d),IAe=y),c){let b=MAe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let x=h.normalize(s.position,OAt);HZ(e,t,n,e.zoomFactor,y,h.dot(x,s.direction))}var WAe=new V,EH=new gn,D1=new h,LAt=new h,qAe=new O,NAt=new O,YAe=new O,FAt=new Pe,BAt=new Z,jZ=new fe,WZ=new h;function kAt(e,t,n){let o=e._scene.camera;if(!O.equals(o.transform,O.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),V.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,WZ);ef(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,jZ);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,zAt(e,t,n)):VAt(e,t,n)}var UAt=new fe;function zAt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,UAt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=WAe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,EH),d,p=ni.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,D1);else if(a>e._minimumTrackBallHeight){let T=ni.grazingAltitudeLocation(f,i);if(!l(T))return;let C=i.cartesianToCartographic(T,jZ);C.height=0,d=i.cartographicToCartesian(C,D1)}else{e._looking=!0;let T=e._ellipsoid.geodeticSurfaceNormal(r.position,WZ);ef(e,t,n,T),V.clone(t,e._tiltCenterMousePosition);return}let _=Et.eastNorthUpToFixedFrame(d,i,qAe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=O.clone(r.transform,YAe);r._setTransform(_),Ju(e,t,n,h.UNIT_Z),r._setTransform(x),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function VAt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(V.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,D1);else{if(a=ig(e,t,D1),!l(a)){if(c=r.getPickRay(t,EH),u=ni.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,jZ).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,WZ);ef(e,t,n,E),V.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,D1)}s&&(l(c)||(c=r.getPickRay(t,EH)),LAe(e,c,a,a)),V.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=o.canvas,d=WAe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,EH);let p=h.magnitude(a),_=h.fromElements(p,p,p,zZ),m=te.fromCartesian3(_,VZ);if(u=ni.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,x=gn.getPoint(c,y,LAt),b=Et.eastNorthUpToFixedFrame(a,i,qAe),T=Et.eastNorthUpToFixedFrame(x,m,NAt),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=h.UNIT_Z,w=O.clone(r.transform,YAe);r._setTransform(T);let R=h.cross(x,r.positionWC,AH);if(h.dot(r.rightWC,R)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(S=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Ju(e,t,n,S,!0,!1),r.constrainedAxis=E}else Ju(e,t,n,S,!0,!1);if(r._setTransform(b),Ju(e,t,n,S,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,AH);h.equalsEpsilon(g,h.ZERO,P.EPSILON6)||(h.dot(g,r.right)<0&&h.negate(g,g),h.cross(g,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(w),e._globe=C,e._ellipsoid=A;let M=A.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=h.clone(r.positionWC,AH);if(e.enableCollisionDetection&&qZ(e,!0),!h.equals(r.positionWC,L)){r._setTransform(T),r.worldToCameraCoordinatesPoint(L,L);let g=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>g&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(g),r.position));let E=h.angleBetween(L,r.position),v=h.cross(L,r.position,L);h.normalize(v,v);let I=Pe.fromAxisAngle(v,E,FAt),N=Z.fromQuaternion(I,BAt);Z.multiplyByVector(N,r.direction,r.direction),Z.multiplyByVector(N,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(w)}}var HAt=new V,GAt=new V,PAe=new gn,DAe=new gn,jAt=new h,WAt=new h;function ef(e,t,n,i){let r=e._scene.camera,s=HAt;s.x=n.startPosition.x,s.y=0;let a=GAt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,PAe),u=r.getPickRay(a,DAe),f=0,d,p;r.frustum instanceof ln?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let _=h.dot(d,p);_<1&&(f=Math.acos(_)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,PAe),u=r.getPickRay(a,DAe),f=0,r.frustum instanceof ln?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),_=h.dot(d,p),_<1&&(f=Math.acos(_)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=r.direction,x=h.negate(i,jAt),b=h.equalsEpsilon(y,i,P.EPSILON2),T=h.equalsEpsilon(y,x,P.EPSILON2);if(!b&&!T){_=h.dot(y,i);let C=P.acosClamped(_);f>0&&f>C&&(f=C-P.EPSILON4),_=h.dot(y,x),C=P.acosClamped(_),f<0&&-f>C&&(f=-C+P.EPSILON4);let A=h.cross(i,y,WAt);r.look(A,f)}else(b&&f<0||T&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function qAt(e){Tl(e,e.enableRotate,e.rotateEventTypes,vAt,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,jAe,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableTilt,e.tiltEventTypes,kAt,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableLook,e.lookEventTypes,ef)}var YAt=new O,XAt=new fe;function qZ(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=n.ellipsoid??te.WGS84,s=n.mapProjection,a,c;O.equals(o.transform,O.IDENTITY)||(a=O.clone(o.transform,YAt),c=h.magnitude(o.position),o._setTransform(O.IDENTITY));let u=XAt;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,_=d-e._lastGlobeHeight,m=_/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=_*.1}}l(a)&&(o._setTransform(a),f&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}R1.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var KAt=new h,$At=new h;R1.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;O.equals(t.transform,O.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Br.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Br.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Br.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=h.clone(t.positionWC,KAt),c=h.clone(t.directionWC,$At);if(i===ne.SCENE2D?XCt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,yAt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,qAt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);qZ(this,u)}this._aggregator.reset()};R1.prototype.isDestroyed=function(){return!1};R1.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ce(this)};var vH=R1;var wH=`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 IH=`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 og(){this._sceneFramebuffer=new cv;let e=.125,t=new Array(6);t[0]=new yo({fragmentShader:Zu,textureScale:e,forcePowerOfTwo:!0,sampleMode:xd.LINEAR});let n=t[1]=new yo({fragmentShader:IH,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new V,t[2]=new yo({fragmentShader:bT,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 yo({fragmentShader:bT,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 yo({fragmentShader:Zu,sampleMode:xd.LINEAR}),this._uCenter=new V,this._uRadius=void 0,t[5]=new yo({fragmentShader:wH,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Qu({stages:t});let o=new dv(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}og.prototype.get=function(e){return this._stages.get(e)};og.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 ZAt=new ie,XAe=new V,QAt=new V,KAe=new O;function JAt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=O.computeViewportTransformation(n,0,1,KAe),u=O.multiplyByPoint(r,o,ZAt),f=Et.pointToGLWindowCoordinates(s,c,o,XAe);u.x+=P.SOLAR_RADIUS;let d=Et.pointToGLWindowCoordinates(a,c,u,u),p=V.magnitude(V.subtract(d,f,d))*30*2,_=QAt;_.x=p,_.y=p,e._uCenter=V.clone(f,e._uCenter),e._uRadius=Math.max(_.x,_.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,x=e._stages,b=x.get(0),T=b.outputTexture.width,C=b.outputTexture.height,A=new Xe;A.width=T,A.height=C,c=O.computeViewportTransformation(A,0,1,KAe),f=Et.pointToGLWindowCoordinates(s,c,o,XAe),_.x*=T/m,_.y*=C/y;let S=b.scissorRectangle;S.x=Math.max(f.x-_.x*.5,0),S.y=Math.max(f.y-_.y*.5,0),S.width=Math.min(_.x,m),S.height=Math.min(_.y,y);for(let w=1;w<4;++w)Xe.clone(S,x.get(w).scissorRectangle)}og.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};og.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),JAt(this,t,n),o};og.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)};og.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Zu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};og.prototype.isDestroyed=function(){return!1};og.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ce(this)};var PH=og;function $Ae(){this._cachedShowFrustumsShaders={}}function eEt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function tEt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Be.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; -`,a+=`uniform vec3 debugShowFrustumsColor; -`,a+=`void main() -{ - czm_Debug_main(); -`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=eEt(i);return Xt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var O1=new H;function nEt(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=H.fromRandom()),t._debugColor):H.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(O1.red=t.debugOverlappingFrustums&1?1:0,O1.green=t.debugOverlappingFrustums&2?1:0,O1.blue=t.debugOverlappingFrustums&4?1:0,O1.alpha=1,O1):H.WHITE}),n}var iEt=new qe;$Ae.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=tEt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=qe.shallowClone(t,iEt);r.shaderProgram=o,r.uniformMap=nEt(e,t),r.execute(e.context,n)};var DH=$Ae;function wT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Pn}wT.fromKeyframeNode=function(e,t,n,i){let o=new wT(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=oEt(e,s,n),o._orientedBoundingBox=sEt(e,r,n,o._orientedBoundingBox),o};function oEt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[c]=f}return s}var ZAe=new h,rEt=new h;function sEt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=h.fromElements(u,c,s,ZAe),d=h.divideComponents(h.subtract(f,e._paddingBefore,ZAe),e.dimensions,rEt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(wT.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()}}});wT.prototype.hasProperty=function(e){return l(this._metadata[e])};wT.prototype.getNames=function(){return Object.keys(this._metadata)};wT.prototype.getProperty=function(e){return this._metadata[e]};var RH=wT;var OH=`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 MH=`// 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 LH=`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 NH=`/* 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 FH=`// 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 BH=`// 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 M1=`// 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 kH=`// 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 UH=`// 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 zH=`// 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 _v=`// 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 VH=`/* 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 HH=`/* 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 GH=`/* 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 jH=`// 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 WH=`// 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 aEt={Z_UP:0,Y_UP:1},zh=Object.freeze(aEt);function cEt(e){let t=new OC;this.shaderBuilder=t;let n=e._customShader,i=ct(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let _=o[p];t.addUniform(_.type,p,pe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",pe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([LH]),e.provider.metadataOrder===zh.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,pe.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,pe.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,pe.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,pe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",jH,OH,NH,WH]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,pe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,pe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,pe.FRAGMENT),t.addFragmentLines([BH])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,pe.FRAGMENT),t.addFragmentLines([FH])),a==="BOX"?t.addFragmentLines([VH,kH,_v]):a==="CYLINDER"?t.addFragmentLines([HH,M1,UH,_v]):a==="ELLIPSOID"&&t.addFragmentLines([GH,M1,zH,_v]),t.addFragmentLines([MH]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let _=u[p];l(_)&&(_=_===!0?void 0:_,t.addDefine(p,_,pe.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,pe.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,pe.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,pe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,pe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,pe.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,pe.FRAGMENT)}var qH=cEt;function lEt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,pe.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,pe.FRAGMENT);for(let D=0;D<c;D++){let M=i[D],L=o[D],g=`PropertyStatistics_${M}`,E=`PropertyStatistics_${M}`;n.addStruct(g,E,pe.FRAGMENT);let v=YH(L);n.addStructField(g,v,"min"),n.addStructField(g,v,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,pe.FRAGMENT);for(let D=0;D<c;D++){let M=i[D],L=`PropertyStatistics_${M}`,g=M;n.addStructField(f,L,g)}let _="Metadata",m="Metadata",y="metadata";n.addStruct(_,m,pe.FRAGMENT),n.addStructField(_,d,p);for(let D=0;D<c;D++){let M=i[D],L=o[D],g=YH(L);n.addStructField(_,g,M)}for(let D=0;D<c;D++){let M=i[D],L=o[D],g=fEt(L),E=`VoxelProperty_${M}`,v=`VoxelProperty_${M}`;n.addStruct(E,v,pe.FRAGMENT),n.addStructField(E,g,"partialDerivativeLocal"),n.addStructField(E,g,"partialDerivativeWorld"),n.addStructField(E,g,"partialDerivativeView"),n.addStructField(E,g,"partialDerivativeValid")}let x="Voxel",b="Voxel",T="voxel";n.addStruct(x,b,pe.FRAGMENT);for(let D=0;D<c;D++){let M=i[D],L=`VoxelProperty_${M}`;n.addStructField(x,L,M)}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 C="FragmentInput";n.addStruct(C,"FragmentInput",pe.FRAGMENT),n.addStructField(C,m,y),n.addStructField(C,b,T);let S="Properties",w="Properties",R="properties";n.addStruct(S,w,pe.FRAGMENT);for(let D=0;D<c;D++){let M=i[D],L=o[D],g=YH(L);n.addStructField(S,g,M)}{let D="clearProperties";n.addFunction(D,`${w} clearProperties()`,pe.FRAGMENT),n.addFunctionLines(D,[`${w} ${R};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],v=YH(g,E);n.addFunctionLines(D,[`${R}.${L} = ${v}(0.0);`])}n.addFunctionLines(D,[`return ${R};`])}{let D="sumProperties";n.addFunction(D,`${w} sumProperties(${w} propertiesA, ${w} propertiesB)`,pe.FRAGMENT),n.addFunctionLines(D,[`${w} ${R};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(D,[`${R}.${L} = propertiesA.${L} + propertiesB.${L};`])}n.addFunctionLines(D,[`return ${R};`])}{let D="scaleProperties";n.addFunction(D,`${w} scaleProperties(${w} ${R}, float scale)`,pe.FRAGMENT),n.addFunctionLines(D,[`${w} scaledProperties = ${R};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(D,[`scaledProperties.${L} *= scale;`])}n.addFunctionLines(D,["return scaledProperties;"])}{let D="mixProperties";n.addFunction(D,`${w} mixProperties(${w} propertiesA, ${w} propertiesB, float mixFactor)`,pe.FRAGMENT),n.addFunctionLines(D,[`${w} ${R};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(D,[`${R}.${L} = mix(propertiesA.${L}, propertiesB.${L}, mixFactor);`])}n.addFunctionLines(D,[`return ${R};`])}{let D="copyPropertiesToMetadata";n.addFunction(D,`void copyPropertiesToMetadata(in ${w} ${R}, inout ${m} ${y})`,pe.FRAGMENT);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(D,[`${y}.${L} = ${R}.${L};`])}}if(u){let D="setStatistics";n.addFunction(D,`void setStatistics(inout ${d} ${p})`,pe.FRAGMENT);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=at.getComponentCount(g);for(let v=0;v<E;v++){let I=dEt(g,v),N=s[M][v],F=a[M][v];!l(N)||!l(F)||n.addFunctionLines(D,[`${p}.${L}.min${I} = ${QAe(N)};`,`${p}.${L}.max${I} = ${QAe(F)};`])}}}{let D="getPropertiesFromMegatextureAtUv";n.addFunction(D,`${w} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,pe.FRAGMENT),n.addFunctionLines(D,[`${w} ${R};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],v=uEt(g,E);n.addFunctionLines(D,[`properties.${L} = texture(u_megatextureTextures[${M}], texcoord)${v};`])}n.addFunctionLines(D,[`return ${R};`])}}function YH(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function uEt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function fEt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function QAe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function dEt(e,t){return e===at.SCALAR?"":`[${t}]`}var XH=lEt;function hEt(e,t){let n=new qH(e);XH(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let b="getClippingPlane",T=H0(o,t),C=0,A=T.indexOf(")")+1,S=T.indexOf("{",A)+1,w=T.indexOf("}",S),R=T.slice(C,A),D=T.slice(S,w);i.addFunction(b,R,pe.FRAGMENT),i.addFunctionLines(b,[D])}let s=i.clone();s.addDefine("PICKING",void 0,pe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,pe.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),d=ze.fromCache({cull:{enabled:!0,face:Si.BACK},depthTest:{enabled:!1},depthMask:!1,blending:fn.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),_=e._depthTest,m=new qe({vertexArray:p,primitiveType:Le.TRIANGLES,renderState:d,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Se.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),y=qe.shallowClone(m,new qe);y.shaderProgram=u,y.pickOnly=!0;let x=qe.shallowClone(m,new qe);if(x.shaderProgram=f,x.pickOnly=!0,l(e._drawCommand)){let b=e._drawCommand;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}if(l(e._drawCommandPick)){let b=e._drawCommandPick;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let b=e._drawCommandPickVoxel;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=x}var KH=hEt;var mEt={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"},L1=Object.freeze(mEt);function gv(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}gv.prototype.getTexture=function(e){return this._textures[e]};function pEt(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})}gv.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):pEt(this,e,t)};function _Et(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?$H(o,r,n):gEt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function $H(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?eEe(e,n):new dt({context:n,source:t,sampler:o});return JAe(o)&&r.generateMipmap(),r}function gEt(e,t,n){let{typedArray:i,sampler:o}=e,r=JAe(o),s=o.wrapS===sn.REPEAT||o.wrapS===sn.MIRRORED_REPEAT||o.wrapT===sn.REPEAT||o.wrapT===sn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===He.UNSIGNED_BYTE){let d=zV(i,a,c),p=nb(d);return $H({sampler:o},p,n)}}else{let d=nb(t);return $H(e,d,n)}else return $H(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."),eEe(e,n)}function JAe(e){return[ft.NEAREST_MIPMAP_NEAREST,ft.NEAREST_MIPMAP_LINEAR,ft.LINEAR_MIPMAP_NEAREST,ft.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function eEe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}gv.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];_Et(this,o,t)}n.length=0};gv.prototype.isDestroyed=function(){return!1};gv.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 ce(this)};var ZH=gv;function N1(e){e=e??G.EMPTY_OBJECT,this.mode=e.mode??Ay.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??G.EMPTY_OBJECT,this.varyings=e.varyings??G.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??db.INHERIT,this._textureManager=new ZH,this._defaultTexture=void 0,this.uniformMap=yEt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},TEt(this),CEt(this)}function yEt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===L1.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=xEt(e,i)):n[i]=bEt(e,i)}return n}function xEt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function bEt(e,t){return function(){return e.uniforms[t].value}}function IT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function TEt(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,IT(r,t,o),o=e.usedVariablesVertex.featureIdSet,IT(r,n,o),o=e.usedVariablesVertex.metadataSet,IT(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,IT(s,t,o),o=e.usedVariablesFragment.featureIdSet,IT(s,n,o),o=e.usedVariablesFragment.metadataSet,IT(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;IT(s,a,c)}}function tEe(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 Fc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${tEe(t)} is not available in the ${i} shader. Did you mean ${tEe(n)} instead?`;throw new he(o)}}function CEt(e){let t=e.usedVariablesVertex.attributeSet;Fc(t,"position","positionMC","vertex"),Fc(t,"normal","normalMC","vertex"),Fc(t,"tangent","tangentMC","vertex"),Fc(t,"bitangent","bitangentMC","vertex"),Fc(t,"positionWC","positionMC","vertex"),Fc(t,"positionEC","positionMC","vertex"),Fc(t,"normalEC","normalMC","vertex"),Fc(t,"tangentEC","tangentMC","vertex"),Fc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Fc(n,"position","positionEC","fragment"),Fc(n,"normal","normalEC","fragment"),Fc(n,"tangent","tangentEC","fragment"),Fc(n,"bitangent","bitangentEC","fragment"),Fc(n,"normalMC","normalEC","fragment"),Fc(n,"tangentMC","tangentEC","fragment"),Fc(n,"bitangentMC","bitangentEC","fragment")}N1.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===L1.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};N1.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};N1.prototype.isDestroyed=function(){return!1};N1.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ce(this)};var yv=N1;function rg(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(rg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});rg.fromMetadataArray=function(e){return new rg({metadata:e})};rg.fromGltf=async function(e){let t=new Am({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new rg({loader:t})};rg.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=AEt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function AEt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let d=c[o[f]].attribute,p=e.find(x=>x.name===d);if(!l(p))continue;let _=kt.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=K.createArrayBufferView(_,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}rg.prototype.isDestroyed=function(){return!1};rg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ce(this)};var xv=rg;function xp(){this.orientedBoundingBox=new Pn,this.boundingSphere=new re,this.boundTransform=new O,this.shapeTransform=new O,this._minBounds=xp.DefaultMinBounds.clone(),this._maxBounds=xp.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var EEt=new h,YZ=new h,SEt=new Z,vEt=new h,wEt=new h,IEt=new h,PEt=new h,nEe=O.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new h(.5,.5,.5),new O);xp.prototype.update=function(e,t,n,i,o){i=i??t.clone(vEt),o=o??n.clone(wEt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,IEt),s=h.clamp(n,i,o,PEt),a=O.getScale(e,YZ);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=O.clone(e,this.shapeTransform),this.orientedBoundingBox=KZ(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=O.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:c,shaderDefines:u}=this;for(let _ in u)u.hasOwnProperty(_)&&(u[_]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,c.renderMinBounds=O.multiplyByPoint(nEe,r,c.renderMinBounds),c.renderMaxBounds=O.multiplyByPoint(nEe,s,c.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let d=t,p=n;return c.boxUvToShapeUvScale=h.fromElements(2/(d.x===p.x?1:p.x-d.x),2/(d.y===p.y?1:p.y-d.y),2/(d.z===p.z?1:p.z-d.z),c.boxUvToShapeUvScale),c.boxUvToShapeUvTranslate=h.fromElements(-c.boxUvToShapeUvScale.x*(d.x*.5+.5),-c.boxUvToShapeUvScale.y*(d.y*.5+.5),-c.boxUvToShapeUvScale.z*(d.z*.5+.5),c.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var QH=new h,XZ=new h;xp.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),QH),u=h.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),XZ);return KZ(c,u,this.shapeTransform,o)};var iEe=new h;xp.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,iEe),s=h.multiplyByScalar(r,o,iEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,QH),o,QH),c=h.add(a,s,XZ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),QH),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),XZ);return KZ(d,p,this.shapeTransform,i)};xp.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));xp.DefaultMaxBounds=Object.freeze(new h(1,1,1));function KZ(e,t,n,i){let o=xp.DefaultMinBounds,r=xp.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=O.getTranslation(n,i.center),i.halfAxes=O.getMatrix3(n,i.halfAxes);else{let a=O.getScale(n,YZ),c=h.midpoint(e,t,EEt);i.center=O.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),YZ);let u=O.getRotation(n,SEt);i.halfAxes=Z.setScale(u,a,i.halfAxes)}return i}var bv=xp;function sg(){this.orientedBoundingBox=new Pn,this.boundingSphere=new re,this.boundTransform=new O,this.shapeTransform=new O,this._minBounds=sg.DefaultMinBounds.clone(),this._maxBounds=sg.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new V,cylinderRenderAngleMinMax:new V,cylinderRenderHeightMinMax:new V,cylinderUvToShapeUvRadius:new V,cylinderUvToShapeUvAngle:new V,cylinderUvToShapeUvHeight:new V,cylinderShapeUvAngleMinMax:new V,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 sEe=new h,DEt=new h,REt=new h,OEt=new h,MEt=new h;sg.prototype.update=function(e,t,n,i,o){i=i??t.clone(DEt),o=o??n.clone(REt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=sg,a=s.y-r.y,c=.5*a,u=P.EPSILON10,f=P.EPSILON3,d=P.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=P.negativePiToPi(t.y),n.y=P.negativePiToPi(n.y),i.y=P.negativePiToPi(i.y),o.y=P.negativePiToPi(o.y);let p=h.maximumByComponent(t,i,OEt),_=h.minimumByComponent(n,o,MEt),m=O.getScale(e,sEe);if(_.x===0||p.x>_.x||p.z>_.z||P.equalsEpsilon(m.x,0,void 0,u)||P.equalsEpsilon(m.y,0,void 0,u)||P.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=O.clone(e,this.shapeTransform),this.orientedBoundingBox=QZ(p,_,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=O.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,x=n.y<t.y,b=n.y-t.y+x*a,T=b>c+d&&b<a-d,C=b<c-d,A=b>=c-d&&b<=c+d,S=T||C||A,w=P.equalsEpsilon(t.y,r.y,void 0,f),R=P.equalsEpsilon(n.y,s.y,void 0,f),D=t.z===r.z&&n.z===s.z,M=p.x===r.x,L=_.y<p.y,g=_.y-p.y+L*a,E=g>=c-d&&g<a-d,v=g>d&&g<c-d,I=g<=d,N=E||v||I,{shaderUniforms:F,shaderDefines:U}=this;for(let z in U)U.hasOwnProperty(z)&&(U[z]=void 0);let k=0;if(U.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=k,k+=1,M||(U.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,U.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=k,k+=1),F.cylinderRenderRadiusMinMax=V.fromElements(p.x,_.x,F.cylinderRenderRadiusMinMax),p.x===_.x&&(U.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){U.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let z=n.x-t.x,B=0,j=1;z!==0&&(B=1/z,j=-t.x/z),F.cylinderUvToShapeUvRadius=V.fromElements(B,j,F.cylinderUvToShapeUvRadius)}if(!D){U.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let z=n.z-t.z,B=0,j=1;z!==0&&(B=2/z,j=-(t.z+1)/z),F.cylinderUvToShapeUvHeight=V.fromElements(B,j,F.cylinderUvToShapeUvHeight)}if(F.cylinderRenderHeightMinMax=V.fromElements(p.z,_.z,F.cylinderRenderHeightMinMax),x&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,U.CYLINDER_INTERSECTION_INDEX_ANGLE=k,E?(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,k+=1):v?(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,k+=2):I&&(U.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,k+=2),F.cylinderRenderAngleMinMax=V.fromElements(p.y,_.y,F.cylinderRenderAngleMinMax)),S){U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,w&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),R&&(U.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let z=(t.y-r.y)/a,B=(n.y-r.y)/a,j=1-b/a;if(F.cylinderShapeUvAngleMinMax=V.fromElements(z,B,F.cylinderShapeUvAngleMinMax),F.cylinderShapeUvAngleRangeZeroMid=(B+.5*j)%1,b<=d)F.cylinderUvToShapeUvAngle=V.fromElements(0,1,F.cylinderUvToShapeUvAngle);else{let W=a/b,J=-(t.y-r.y)/b;F.cylinderUvToShapeUvAngle=V.fromElements(W,J,F.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=k,!0};var JH=new h,ZZ=new h;sg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(r.x,s.x,t*a),P.lerp(r.y,s.y,n*a),P.lerp(r.z,s.z,i*a),JH),u=h.fromElements(P.lerp(r.x,s.x,(t+1)*a),P.lerp(r.y,s.y,(n+1)*a),P.lerp(r.z,s.z,(i+1)*a),ZZ);return QZ(c,u,this.shapeTransform,o)};var oEe=new h;sg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,oEe),s=h.multiplyByScalar(r,o,oEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,JH),o,JH),c=h.add(a,s,ZZ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),JH),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),ZZ);return QZ(d,p,this.shapeTransform,i)};sg.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));sg.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var LEt=5,NEt=new Array(LEt),FEt=new h,BEt=new Z,kEt=new O,UEt=new O,zEt=new O,$Z=new O,VEt=new h,HEt=new h,GEt=new h,aEe=new Array(8);for(let e=0;e<8;e++)aEe[e]=new h;function rEe(e,t,n){return Math.abs(ie.dot(e,t))<n}function jEt(e){let t=O.getColumn(e,0,VEt),n=O.getColumn(e,1,HEt),i=O.getColumn(e,2,GEt),o=P.EPSILON4;return rEe(t,n,o)&&rEe(n,i,o)}function WEt(e,t){let n=aEe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)O.multiplyByPoint(e,n[i],n[i]);return Pn.fromPoints(n,t)}function QZ(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+P.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=NEt,_=0;p[_++]=s,p[_++]=a,p[_++]=d,f>P.PI&&(p[_++]=d-P.PI_OVER_TWO,p[_++]=d+P.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<_;++F){let U=p[F]-d,k=Math.cos(U),z=Math.sin(U),B=k*o,j=z*o,W=k*r,J=z*r;m=Math.min(m,B,W),y=Math.min(y,j,J),x=Math.max(x,B,W),b=Math.max(b,j,J)}let T=x-m,C=b-y,A=u-c,S=(m+x)*.5,w=(y+b)*.5,R=(c+u)*.5,D=h.fromElements(S,w,R,FEt),M=Z.fromRotationZ(d,BEt),L=h.fromElements(T,C,A,sEe),g=O.fromScale(L,zEt),E=O.fromRotation(M,UEt),v=O.fromTranslation(D,kEt),I=O.multiplyTransformation(E,O.multiplyTransformation(v,g,$Z),$Z),N=O.multiplyTransformation(n,I,$Z);return jEt(N)?Pn.fromTransformation(N,i):WEt(N,i)}var Tv=sg;function ag(){this.orientedBoundingBox=new Pn,this.boundingSphere=new re,this.boundTransform=new O,this.shapeTransform=new O,this._rectangle=new ae,this._minimumHeight=ag.DefaultMinBounds.z,this._maximumHeight=ag.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new h,this._rotation=new Z,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new V,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new V,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new V,ellipsoidUvToShapeUvLatitude:new V,ellipsoidRenderLatitudeSinMinMax:new V,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new V},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 qEt=new h,YEt=new h,XEt=new h,KEt=new h,$Et=new h,ZEt=new h,QEt=new h,JEt=new h,eSt=new Z,cEe=new h,lEe=new h,tSt=new ae;ag.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=ag;i=i??r,o=o??s;let a=P.EPSILON10,c=P.EPSILON3,u=P.EPSILON10,f=P.EPSILON10,d=P.EPSILON3,p=O.getScale(e,JEt),_=h.clone(r,qEt);_.z=-h.minimumComponent(p);let m=h.clamp(t,_,s,YEt),y=h.clamp(n,_,s,XEt),x=h.clamp(i,_,s,KEt),b=h.clamp(o,_,s,$Et),T=h.maximumByComponent(m,x,ZEt),C=h.minimumByComponent(y,b,QEt),A=h.add(p,h.fromElements(y.z,y.z,y.z,cEe),cEe),S=h.maximumComponent(A),w=h.add(p,h.fromElements(C.z,C.z,C.z,lEe),lEe);if(T.y>C.y||T.y===s.y||C.y===r.y||T.z>C.z||P.equalsEpsilon(w,h.ZERO,void 0,a))return!1;this._rectangle=ae.fromRadians(m.x,m.y,y.x,y.y),this._translation=O.getTranslation(e,this._translation),this._rotation=O.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let R=ae.fromRadians(T.x,T.y,C.x,C.y,tSt);this.orientedBoundingBox=JZ(R,T.z,C.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=O.fromRotationTranslation(Z.setScale(this._rotation,A,eSt),this._translation,this.shapeTransform),this.boundTransform=O.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=re.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let D=s.x-r.x,M=.5*D,L=C.x<T.x,g=C.x-T.x+L*D,E=g<=u,v=g>=M-u&&g<D-u,I=g>u&&g<M-u,N=E||v||I,F=y.x<m.x,U=y.x-m.x+F*D,k=U>M+u&&U<D-u,z=U>=M-u&&U<=M+u,B=U<M-u,j=k||z||B,W=C.y<-d,J=C.y>=-d&&C.y<=+d,Y=C.y>+d&&C.y<s.y-f,ee=W||J||Y,Q=T.y>r.y+f&&T.y<-d,de=T.y>=-d&&T.y<=+d,ge=T.y>+d,le=Q||de||ge,ye=ee||le,be=y.y-m.y,Ie=y.y<-d,Te=y.y>=-d&&y.y<=+d,ve=y.y>+d&&y.y<s.y-f,Ve=Ie||Te||ve,Ke=m.y>r.y+f&&m.y<-d,Ct=m.y>=-d&&m.y<=+d,Qt=m.y>+d,hn=Ve||(Ke||Ct||Qt),{shaderUniforms:Nt,shaderDefines:Rt}=this;for(let xt in Rt)Rt.hasOwnProperty(xt)&&(Rt[xt]=void 0);Nt.ellipsoidRadiiUv=h.divideByScalar(A,S,Nt.ellipsoidRadiiUv);let{x:Zn,z:gi}=Nt.ellipsoidRadiiUv,Ht=gi/Zn;Nt.eccentricitySquared=1-Ht*Ht,Nt.evoluteScale=V.fromElements((Zn*Zn-gi*gi)/Zn,(gi*gi-Zn*Zn)/gi,Nt.evoluteScale),Nt.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(Nt.ellipsoidRadiiUv,Nt.ellipsoidRadiiUv,Nt.ellipsoidInverseRadiiSquaredUv),Nt.ellipsoidInverseRadiiSquaredUv);let wt=0;Rt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=wt,wt+=1,Rt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=wt,wt+=1,Nt.clipMinMaxHeight=V.fromElements((T.z-y.z)/S,(C.z-y.z)/S,Nt.clipMinMaxHeight);let no=(y.z-m.z)/S;if(Nt.ellipsoidInverseHeightDifferenceUv=1/no,m.z===y.z&&(Nt.ellipsoidInverseHeightDifferenceUv=0),N&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Rt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=wt,v?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,wt+=1):I?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,wt+=2):E&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,wt+=2),Nt.ellipsoidRenderLongitudeMinMax=V.fromElements(T.x,C.x,Nt.ellipsoidRenderLongitudeMinMax)),j)if(Rt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Rt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),U<=u)Nt.ellipsoidUvToShapeUvLongitude=V.fromElements(0,1,Nt.ellipsoidUvToShapeUvLongitude);else{let Xo=D/U,yr=-(m.x-r.x)/U;Nt.ellipsoidUvToShapeUvLongitude=V.fromElements(Xo,yr,Nt.ellipsoidUvToShapeUvLongitude)}if(N){let xt=P.equalsEpsilon(T.x,r.x,void 0,c),Xo=P.equalsEpsilon(C.x,s.x,void 0,c);xt&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Xo&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let yr=(m.x-r.x)/D,ec=(y.x-r.x)/D,Or=(C.x-r.x)/D,vs=1-g/D,Ue=(Or+.5*vs)%1;Nt.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(yr,ec,Ue,Nt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(le&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Rt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=wt,Q?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,wt+=1):de?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,wt+=1):ge&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,wt+=2)),ee&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Rt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=wt,W?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,wt+=2):J?(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,wt+=1):Y&&(Rt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,wt+=1)),Nt.ellipsoidRenderLatitudeSinMinMax=V.fromElements(Math.sin(T.y),Math.sin(C.y),Nt.ellipsoidRenderLatitudeSinMinMax)),hn)if(Rt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,be<f)Nt.ellipsoidUvToShapeUvLatitude=V.fromElements(0,1,Nt.ellipsoidUvToShapeUvLatitude);else{let Xo=(s.y-r.y)/be,yr=(r.y-m.y)/be;Nt.ellipsoidUvToShapeUvLatitude=V.fromElements(Xo,yr,Nt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=wt,!0};var dEe=new ae;ag.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=ae.subsection(this._rectangle,s,c,a,u,dEe),_=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return JZ(p,_,m,this._ellipsoid,this._translation,this._rotation,o)};var uEe=new h,fEe=new h,nSt=new h;ag.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,uEe),s=h.multiplyByScalar(r,o,uEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,fEe),o,fEe),c=h.add(a,s,nSt),u=ae.subsection(this._rectangle,a.x,a.y,c.x,c.y,dEe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return JZ(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function JZ(e,t,n,i,o,r,s){return s=Pn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=Z.multiply(s.halfAxes,r,s.halfAxes),s}ag.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-te.WGS84.minimumRadius));ag.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*te.WGS84.maximumRadius));var Cv=ag;var tf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};tf.getMinBounds=function(e){switch(e){case tf.BOX:return bv.DefaultMinBounds;case tf.ELLIPSOID:return Cv.DefaultMinBounds;case tf.CYLINDER:return Tv.DefaultMinBounds}};tf.getMaxBounds=function(e){switch(e){case tf.BOX:return bv.DefaultMaxBounds;case tf.ELLIPSOID:return Cv.DefaultMaxBounds;case tf.CYLINDER:return Tv.DefaultMaxBounds}};tf.getShapeConstructor=function(e){switch(e){case tf.BOX:return bv;case tf.ELLIPSOID:return Cv;case tf.CYLINDER:return Tv}};var $a=Object.freeze(tf);var eQ=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function F1(e,t){this.spatialNode=e,this.keyframe=t,this.state=eQ.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}F1.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=eQ.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};F1.priorityComparator=function(e,t){return e.priority-t.priority};F1.searchComparator=function(e,t){return e.keyframe-t.keyframe};F1.LoadState=eQ;var Eo=F1;function tx(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32),i===kt.FLOAT32&&!e.floatingPointTexture)throw new se("Floating point texture not supported");let s=iSt(i),a=oSt(n,e.webgl2),c=kt.getSizeInBytes(i),u=rSt(o,n,c),f=Math.ceil(Math.sqrt(t.x)),d=Math.ceil(t.z/f),p=f*t.x,_=d*t.y,m=Math.floor(u/p),y=Math.floor(u/_);if(m===0||y===0)throw new se("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*n*u**2,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new V(m,y),this.voxelCountPerRegion=new V(p,_),this.sliceCountPerRegion=new V(f,d),this.voxelSizeUv=new V(1/u,1/u),this.sliceSizeUv=new V(t.x/u,t.y/u),this.regionSizeUv=new V(p/u,_/u),this.texture=new dt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})});let x=kt.toComponentDatatype(i);this.tileVoxelDataTemp=K.createTypedArray(x,p*_*n),this.nodes=new Array(this.maximumTileCount);for(let b=0;b<this.maximumTileCount;b++)this.nodes[b]=new sSt(b);for(let b=0;b<this.maximumTileCount;b++){let T=this.nodes[b];T.previousNode=b>0?this.nodes[b-1]:void 0,T.nextNode=b<this.maximumTileCount-1?this.nodes[b+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function iSt(e){if(e===kt.FLOAT32||e===kt.FLOAT64)return He.FLOAT;if(e===kt.UINT8)return He.UNSIGNED_BYTE}function oSt(e,t){if(e===1)return t?je.RED:je.LUMINANCE;if(e===2)return t?je.RG:je.LUMINANCE_ALPHA;if(e===3)return je.RGB;if(e===4)return je.RGBA}function rSt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(Lt.maximumTextureSize,P.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function sSt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}tx.prototype.add=function(e){if(this.isFull())throw new he("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};tx.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("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--};tx.prototype.isFull=function(){return this.emptyList===void 0};tx.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let o=kt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),_=Math.floor(f/u);if(p*_>=e)break;f*=2}return f*f*n*o};tx.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 _=0;_<o.z;_++){let m=_%r.x*o.x,y=Math.floor(_/r.x)*o.y;for(let x=0;x<o.y;x++){let b=aSt(o,x,_),T=(y+x)*s.x+m;for(let C=0;C<o.x;C++){let A=b+C,S=T+C;for(let w=0;w<a;w++)i[S*a+w]=n[A*a+w]}}}let u=e%c.x*s.x,f=Math.floor(e/c.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function aSt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}tx.prototype.isDestroyed=function(){return!1};tx.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ce(this)};var B1=tx;function Ad(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=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Pn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var cSt=new h;Ad.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=Z.getScale(this.orientedBoundingBox.halfAxes,cSt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Ad.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,d=t+1,p=[[d,r,s,a],[d,u,s,a],[d,r,c,a],[d,u,c,a],[d,r,s,f],[d,u,s,f],[d,r,c,f],[d,u,c,f]];this.children=p.map(([_,m,y,x])=>new Ad(_,m,y,x,this,e,this.dimensions))};Ad.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ad.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var hEe={keyframe:0};function k1(e,t){return hEe.keyframe=e,zo(t,hEe,Eo.searchComparator)}Ad.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:d}=t;if(d.length>=1){let p=lSt(i,d),_=d[p],m=o===i||i<_.keyframe?p:Math.min(p+1,d.length-1),y=d[m],x=i-_.keyframe,b=mEe(n-t.level,x);b<a&&(a=b,r=_);let T=y.keyframe-o,C=mEe(n-t.level,T);if(C<c&&(c=C,s=y),x===0&&T===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function lSt(e,t){let n=k1(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function mEe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ad.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ad.prototype.createKeyframeNode=function(e){let t=k1(e,this.keyframeNodes);if(t<0){t=~t;let n=new Eo(this,e);this.keyframeNodes.splice(t,0,n)}};Ad.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=k1(n,this.keyframeNodes);if(i<0)throw new he("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=k1(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Ad.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new he("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=k1(e.keyframe,i);if(o>=0)throw new he("Keyframe already renderable");o=~o,i.splice(o,0,e)};Ad.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 eG=Ad;function nx(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:c,componentTypes:u,metadataOrder:f}=o,d=h.add(r,s,new h);if(h.add(d,a,d),f===zh.Y_UP){let C=d.y;d.y=d.z,d.z=C}!l(i)&&l(o.maximumTileCount)&&(i=CSt(o.maximumTileCount,d,c,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(c.length);for(let C=0;C<c.length;C++){let A=c[C],S=at.getComponentCount(A),w=u[C];this.megatextures[C]=new B1(t,d,S,w,i),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let _=e._shape;this.rootNode=new eG(0,0,0,0,void 0,_,r),this._priorityQueue=new LS({maximumLength:p,comparator:Eo.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 m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,tQ(m,1,n-2,0);let y=9,x=2048,b=Math.floor(x/y),T=Math.ceil(p/b);this.internalNodeTexture=new dt({context:t,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:x,height:T,sampler:new zt({minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),this.internalNodeTilesPerRow=b,this.internalNodeTexelSizeUv=new V(1/x,1/T),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new V}nx.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function tQ(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,tQ(e,t,o-1,i+1),tQ(e,o+1,n,i+1)}nx.simultaneousRequestCountMaximum=50;nx.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new dt({context:r,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new zt({minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),this.leafNodeTexelSizeUv=V.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&pEe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let _=Pi();dSt(this,e),hSt(this,e);let m=Pi();ySt(this,d,c);let y=Pi(),x=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||x){let b=m-_,T=y-m,C=y-_;gSt(this,e,b,T,C)}};nx.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};nx.prototype.isDestroyed=function(){return!1};nx.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(),ce(this)};function pEe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];pEe(e,i)}}function uSt(e,t){if(e._simultaneousRequestCount>=nx.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Eo.LoadState.PROCESSING:Eo.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Eo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Eo.LoadState.RECEIVING,u.then(s).catch(a))}function fSt(e){return e/(1+e)}function dSt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),_Ee(e.rootNode,Ds.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 hSt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(mSt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===Eo.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Eo.LoadState.UNLOADED&&uSt(e,f),f.state===Eo.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!pSt(d.metadata,e)){f.content=void 0,f.state=Eo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let _=o[p];e._primitive.tileUnload.raiseEvent(),_.spatialNode.destroyKeyframeNode(_,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Eo.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function mSt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function pSt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:u}=r,f=a*c*u,d=e[o],p=f*s;if(d.length!==p)return!1}return!0}function _Ee(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=o,d=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===Ds.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,_=p._shape,m=p.screenSpaceError,y=n._priorityQueue,x=n._keyframeCount,b=P.clamp(Math.floor(n._keyframeLocation),0,x-2),T=b+1;if(x===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==x)for(let R=0;R<x;R++)e.createKeyframeNode(R);let{screenSpaceError:C,keyframeNodes:A}=e,S=fSt(C),w=!1;for(let R=0;R<A.length;R++){let D=A[R];D.priority=10*S+_St(b,D.keyframe,T,n),D.state!==Eo.LoadState.UNAVAILABLE&&D.state!==Eo.LoadState.FAILED&&D.priority!==-Number.MAX_VALUE&&y.insert(D),D.state===Eo.LoadState.LOADED&&(w=!0)}if(C<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(_);for(let R=0;R<8;R++){let D=e.children[R];_Ee(D,t,n,i)}}function _St(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 P.lerp(a,s,.15+.85*s)}function gSt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(Eo.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let w=0;w<a;w++){let R=new Array(r).fill(0);c[w]=R,u[w]=0}function d(w){let R=w.keyframeNodes;for(let D=0;D<R.length;D++){let M=R[D],L=M.keyframe,g=M.state;c[g][L]+=1,u[g]+=1,f++}if(l(w.children))for(let D=0;D<8;D++){let M=w.children[D];d(M)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Eo.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Eo.LoadState.RECEIVING],_=u[Eo.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||_!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,_),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=_,m&&(p===0&&_===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[Eo.LoadState.LOADED]}`,b=`UNLOADED: ${u[Eo.LoadState.UNLOADED]} | RECEIVING: ${u[Eo.LoadState.RECEIVING]} | PROCESSING: ${u[Eo.LoadState.PROCESSING]} | LOADED: ${u[Eo.LoadState.LOADED]} | FAILED: ${u[Eo.LoadState.FAILED]} | UNAVAILABLE: ${u[Eo.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,T=Math.round(n*100)/100,C=Math.round(i*100)/100,A=Math.round(o*100)/100,S=`LOAD: ${T} | OCT: ${C} | ALL: ${A}`;console.log(`${x} || ${b} || ${S}`)}var tG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function ySt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(_,m,y,x,b){let T=!1;if(l(_.children))for(let C=0;C<8;C++){let A=_.children[C];A.computeSurroundingRenderableKeyframeNodes(o),A.isRenderable(r)&&(T=!0)}if(T){u[b]=tG.INTERNAL<<16|m,u[y]=x,a++,x=m,b=x*9+1;for(let C=0;C<8;C++){let A=_.children[C];m=a,y=m*9+0,d(A,m,y,x,b+C)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let C=c*5,A=_.renderableKeyframeNodePrevious,S=_.level-A.spatialNode.level,w=A.spatialNode.parent,R=l(w)?w.renderableKeyframeNodePrevious:A,D=xSt(_,i,n),M=S,L=1,g=A.megatextureIndex,E=R.megatextureIndex;f[C+0]=D,f[C+1]=M,f[C+2]=L,f[C+3]=g,f[C+4]=E,u[b]=tG.LEAF<<16|c}else{let C=_.renderableKeyframeNodePrevious,S=_.level-C.spatialNode.level===0?tG.LEAF:tG.PACKED_LEAF_FROM_PARENT;u[b]=S<<16|C.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),bSt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&TSt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function xSt(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 P.clamp(s,0,1)}function bSt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],_=d*o;for(let m=0;m<o;m++)c[_+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function TSt(e,t,n,i){let o=je.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let _=e[p*r+0],m=e[p*r+1],y=e[p*r+2],x=e[p*r+3],b=e[p*r+4],T=P.clamp(Math.floor(65536*_),0,65535);u[p*8+0]=T>>>0&255,u[p*8+1]=T>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=x>>>0&255,u[p*8+5]=x>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}function CSt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=at.getComponentCount(a);o+=B1.getApproximateTextureMemoryByteLength(e,t,u,c)}return o}var nG=nx;function bp(e){e=e??G.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??bp.DefaultProvider,this._traversal=void 0,this._statistics=new Lm,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new h,this._inputDimensions=new h,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._exaggeratedModelMatrix=O.clone(this._modelMatrix),this._compoundModelMatrix=new O,this._compoundModelMatrixOld=new O,this._customShader=e.customShader??bp.DefaultCustomShader,this._customShaderCompilationEvent=new me,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new O,this._transformPositionUvToWorld=new O,this._transformDirectionWorldToLocal=new Z,this._transformNormalLocalToWorld=new Z,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Rm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new V,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new V,megatextureTextures:[],megatextureSliceDimensions:new V,megatextureTileDimensions:new V,megatextureVoxelSizeUv:new V,megatextureSliceSizeUv:new V,megatextureTileSizeUv:new V,dimensions:new h,inputDimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new O,transformPositionUvToView:new O,transformDirectionViewToLocal:new Z,transformNormalLocalToWorld:new Z,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new ie,clippingPlanesTexture:void 0,clippingPlanesMatrix:new O,stepSize:0,pickColor:new H},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 me,this.tileVisible=new me,this.tileFailed=new me,this.tileUnload=new me,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me;let i=this._provider;ASt(this,i)}function ASt(e,t){let{shape:n,minBounds:i=$a.getMinBounds(n),maxBounds:o=$a.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=O.clone(e._modelMatrix,e._exaggeratedModelMatrix),yEe(e,t);let r=$a.getShapeConstructor(n);e._shape=new r,e._shapeVisible=xEe(e,e._shape,t)}Object.defineProperties(bp.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=O.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=P.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=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Os.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=bp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ESt=new ie,SSt=new ie,vSt=new h,wSt=new h,ISt=new Z,PSt=new Z,DSt=new O,RSt=new O,OSt=new O,MSt=O.fromRotationTranslation(Z.fromUniformScale(.5,new Z),new h(.5,.5,.5),new O),LSt=O.fromRotationTranslation(Z.fromUniformScale(2,new Z),new h(-1,-1,-1),new O);bp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){zSt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}kSt(this,e);let i=yEe(this,t),o=this._shape;if(i&&(this._shapeVisible=xEe(this,o,t),HSt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=GSt(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&&ZSt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),jSt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=V.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(KH(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,_=YSt(p,d,SSt);if(_.x===1||_.y===1||_.z===-1||_.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=ie.clone(_,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=O.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let x=n.uniformState.view;f.transformPositionUvToView=O.multiplyTransformation(x,this._transformPositionUvToWorld,f.transformPositionUvToView);let b=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=Z.multiply(this._transformDirectionWorldToLocal,b,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=Z.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let T=e.camera.positionWC;f.cameraPositionUv=O.multiplyByPoint(this._transformPositionWorldToUv,T,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let C=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;C.boundingVolume=o.boundingSphere,e.commandList.push(C)};var NSt=new h,nQ=new h,FSt=new fe,BSt=new h;function kSt(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===$a.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=h.fromElements(1,1,t.verticalExaggeration,NSt);e._exaggeratedModelMatrix=O.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=O.multiplyByTranslation(e._exaggeratedModelMatrix,USt(e,t),e._exaggeratedModelMatrix)}}function USt(e,t){let{shapeTransform:n=O.IDENTITY,globalTransform:i=O.IDENTITY}=e._provider,o=O.getTranslation(n,nQ),r=O.multiplyByPoint(e._modelMatrix,o,nQ),s=O.multiplyByPoint(i,r,nQ),c=te.WGS84.cartesianToCartographic(s,FSt),u=0;l(c)&&(u=c.height);let f=Br.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(f-u)/t.verticalExaggeration,BSt)}function zSt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=H.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Fe(o,!0);let s=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let u=`u_${c}`;s[u]=function(){return r[c]}}if(e._dimensions=h.clone(t.dimensions,e._dimensions),i.dimensions=h.clone(e._dimensions,i.dimensions),e._paddingBefore=h.clone(t.paddingBefore??h.ZERO,e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(t.paddingAfter??h.ZERO,e._paddingAfter),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=h.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=h.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===zh.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=h.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new nG(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,VSt(e._traversal,i)}function yEe(e,t){let n=t.shapeTransform??O.IDENTITY,i=t.globalTransform??O.IDENTITY;return O.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),O.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),PT(e,"_compoundModelMatrix","_compoundModelMatrixOld")+PT(e,"_minBounds","_minBoundsOld")+PT(e,"_maxBounds","_maxBoundsOld")+PT(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+PT(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+PT(e,"_minClippingBounds","_minClippingBoundsOld")+PT(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function PT(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function xEe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=O.inverse(o,DSt),s=O.getRotation(o,ISt),a=O.getScale(o,vSt),c=h.maximumComponent(a),u=h.divideByScalar(a,c,wSt),f=Z.multiplyByScale(s,u,PSt);return e._transformPositionWorldToUv=O.multiplyTransformation(MSt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=O.multiplyTransformation(o,LSt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=O.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=Z.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function VSt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=V.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=V.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=V.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=V.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=V.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=V.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function HSt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Fe(n,!0)),i}function GSt(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=$.secondsDifference(i.stop,i.start),a=$.secondsDifference(n,i.start)/r;return o+a}function jSt(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=O.transpose(O.multiplyTransformation(O.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)}bp.prototype.isDestroyed=function(){return!1};bp.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(),ce(this)};var gEe=new Array(new ie(-1,-1,-1,1),new ie(1,-1,-1,1),new ie(-1,1,-1,1),new ie(1,1,-1,1),new ie(-1,-1,1,1),new ie(1,-1,1,1),new ie(-1,1,1,1),new ie(1,1,1,1)),WSt=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),qSt=new Array(new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie);function YSt(e,t,n){let i=O.fromRotationTranslation(e.halfAxes,e.center,RSt),o=O.multiply(t,i,OSt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=qSt,d=gEe.length;for(u=0;u<d;u++)O.multiplyByVector(o,gEe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let _=p.x/p.w,m=p.y/p.w;r=Math.min(r,_),s=Math.max(s,_),a=Math.min(a,m),c=Math.max(c,m)}else for(let _=0;_<3;_++){let m=WSt[u*3+_],y=f[m];if(y.z>=-y.w){let x=p.z+p.w,b=y.z+y.w,T=x/(x-b),C=ie.lerp(p,y,T,ESt),A=C.x/C.w,S=C.y/C.w;r=Math.min(r,A),s=Math.max(s,A),a=Math.min(a,S),c=Math.max(c,S)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=ie.fromElements(r,a,s,c,n),n}var iQ=3e7,XSt=new h(iQ,0,0),KSt=new h(0,iQ,0),$St=new h(0,0,iQ);function ZSt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:Ji.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),_=[H.RED,H.LIME,H.BLUE][u%3];if(r(c.orientedBoundingBox,_,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,H.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,XSt,H.RED,a),o(h.ZERO,KSt,H.LIME,a),o(h.ZERO,$St,H.BLUE,a),i.update(t)}bp.DefaultCustomShader=new yv({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) -{ - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function bEe(){this.ready=!0,this.shape=$a.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[kt.FLOAT32],this.maximumTileCount=1}bEe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new xv({metadata:[new Float32Array(1)]});return Promise.resolve(n)};bp.DefaultProvider=new bEe;var DT=bp;function QSt(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 iG=QSt;function JSt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var oG=JSt;function evt(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 rG=evt;var aG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function oi(e){e=e??G.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Fe(e.contextOptions),r=l(n),s=new AN(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=Nn(),this._jobScheduler=new S8,this._frameState=new C8(s,new h8(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 AO(s),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new A8,this._primitives=new Jl,this._groundPrimitives=new Jl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=oi.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new mv,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new y8(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ri({color:new H,stencil:0,owner:this}),this._depthClearCommand=new ri({depth:1,owner:this}),this._stencilClearCommand=new ri({stencil:0}),this._classificationStencilClearCommand=new ri({stencil:0,renderState:ze.fromCache({stencilMask:jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new pH(this),this._preUpdate=new me,this._postUpdate=new me,this._renderError=new me,this._preRender=new me,this._postRender=new me,this._minimumDisableDepthTestDistance=0,this._debugInspector=new DH,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new me,this.morphComplete=new me,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=H.clone(H.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Fi(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 wA,this.fog=new T8,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(ho.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ho(this),this.shadowMap=new Q0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=H.clone(H.WHITE),this._actualInvertClassificationColor=H.clone(this._invertClassificationColor),this._invertClassification=new T1,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new hH,this._brdfLutGenerator=new n8,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new vH(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??$u.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=lc.requestCompletedEvent.addEventListener(aG(this)),this._removeTaskProcessorListenerCallback=hi.taskCompletedEvent.addEventListener(aG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Xe(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ho(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ho(this),this.preloadFlightCullingVolume=void 0,this._picking=new q8(this),this._defaultView=new uv(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 wg,SEe(this,0,$.now()),this.updateFrameState(),this.initializeFrame()}oi.defaultLogDepthBuffer=!0;function tvt(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(aG(e))),n.push(t.terrainProviderChanged.addEventListener(aG(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(oi.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 Lt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Lt.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 hm.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,tvt(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===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.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 ho(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new b8(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,Lt.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}}});oi.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 nvt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function TEe(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=Q_.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Q_.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Q_.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Q_.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Q0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Se.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))}oi.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=o&&!u,_=c&&!f,m=(!o||!c)&&!d,y=n.pickingMetadata&&nvt(e,n);if(e.dirty=e.dirty||p||_||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:x,shadowMaps:b}=i;x&&e.castShadows&&(t.shadows=Q0.createCastDerivedCommand(b,e,s,r,t.shadows)),(u||p)&&(t.logDepth=Q_.createLogDepthCommand(e,r,t.logDepth),TEe(this,t.logDepth.command,s)),(d||m)&&TEe(this,e,s)};var ivt=new Bh({pass:qo.RENDER}),oQ=new Bh({pass:qo.PRELOAD}),rQ=new Bh({pass:qo.PRELOAD_FLIGHT}),ovt=new Bh({pass:qo.REQUEST_RENDER_MODE_DEFER_CHECK}),CEe=new re,sQ;function rvt(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return CEe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,sQ=e4.fromBoundingSphere(CEe,e.camera.positionWC,sQ),sQ}oi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function SEe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=$.clone(n,i.time)}oi.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=rvt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof ln||this.camera.frustum instanceof Qr),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=H.clone(this.invertClassificationColor,this._actualInvertClassificationColor),T1.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};oi.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Gt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var sG=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);sG=O.inverseTransformation(sG,sG);function svt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==ne.SCENE3D){a=O.multiplyByPoint(sG,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Sa.createGeometry(new Sa({radii:new h(f,f,f),vertexFormat:un.FLAT_VERTEX_FORMAT})),u=O.fromTranslation(a)):(c=mc.createGeometry(mc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:un.FLAT_VERTEX_FORMAT})),u=O.fromRotationTranslation(s.halfAxes,a,new O)),t._debugVolume=new Dn({geometryInstances:new Pt({geometry:Fn.toWireframe(c),modelMatrix:u,attributes:{color:new Yt(1,0,0,1)}}),appearance:new un({flat:!0,translucent:!1}),asynchronous:!1});let d=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=Q_.createLogDepthCommand(e,r).command);let _;l(i)&&(_=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(_)&&(n.framebuffer=_),o.commandList=d}function Tp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ri){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&svt(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 AEe(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 vEe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function avt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function cvt(e,t,n,i,o){F0(i,vEe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function lvt(e,t,n,i,o){F0(i,avt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function uvt(e,t,n){e.context.uniformState.updatePass(Se.VOXELS);let i=n.commands[Se.VOXELS];i.length=n.indices[Se.VOXELS],F0(i,vEe,e.camera.positionWC);for(let o=0;o<i.length;++o)Tp(i[o],e,t)}var fvt=new Li,dvt=new au,hvt=new ln,mvt=new Qr;function pvt(e){let{frustum:t}=e;return l(t.fov)?t.clone(fvt):l(t.infiniteProjectionMatrix)?t.clone(dvt):l(t.width)?t.clone(hvt):t.clone(mvt)}function _vt(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?cvt:lvt}function gvt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=_vt(e);o.uniformState.updatePass(Se.TRANSLUCENT);let f=n.commands[Se.TRANSLUCENT];f.length=n.indices[Se.TRANSLUCENT],u(e,Tp,t,f,c)}function yvt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Se.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Se.TRANSLUCENT];i.executeTranslucentCommands(e,Tp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Tp,t,n)}function cQ(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=pvt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||xvt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:_,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:x,sceneFramebuffer:b,frustumCommandsList:T}=e._view,C=T.length,A=e._globeTranslucencyState,S=e._depthClearCommand,w=e._stencilClearCommand,R=e._classificationStencilClearCommand,D=e._depthPlane,M=n.position.z;function L(E,v){r.updatePass(v);let I=E.commands[v],N=E.indices[v];for(let F=0;F<N;++F)Tp(I[F],e,t);return N}function g(E,v){r.updatePass(v);let I=E.commands[v],N=E.indices[v];for(let F=0;F<N;++F)AEe(I[F],e,t)}for(let E=0;E<C;++E){let v=C-E-1,I=T[v];e.mode===ne.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),S.execute(i,t),i.stencilBuffer&&w.execute(i,t),A.translucent?(r.updatePass(Se.GLOBE),A.executeGlobeCommands(I,Tp,x,e,t)):L(I,Se.GLOBE),p&&y.executeCopyDepth(i,t),f||(A.translucent?(r.updatePass(Se.TERRAIN_CLASSIFICATION),A.executeGlobeClassificationCommands(I,Tp,x,e,t)):L(I,Se.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),d&&D.execute(i,t));let N;if(!_||c||f)N=L(I,Se.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let U=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=L(I,Se.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=U,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&R.execute(i,t),N=L(I,Se.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&w.execute(i,t),uvt(e,t,I),L(I,Se.OPAQUE),v!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),gvt(e,t,I),yvt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let U=e._picking.getPickDepth(e,v);U.update(i,y.depthStencilTexture),U.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=v!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),A.translucent?(r.updatePass(Se.GLOBE),A.executeGlobeCommands(I,AEe,x,e,t)):g(I,Se.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&d&&D.execute(i,t),g(I,Se.CESIUM_3D_TILE),g(I,Se.OPAQUE),g(I,Se.TRANSLUCENT),t.framebuffer=F}}function xvt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Se.ENVIRONMENT),l(i.skyBoxCommand)&&Tp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Tp(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 wEe(e){e.context.uniformState.updatePass(Se.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function bvt(e,t){e.context.uniformState.updatePass(Se.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function Tvt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Se.GLOBE,Se.CESIUM_3D_TILE,Se.OPAQUE,Se.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(p,u))r[d].commandList.push(u),f=!0;else if(f)break}}}}function IEe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;Tvt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:_}=d;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<_.length;++m){let y=_[m];s.updatePass(y.pass);let x=y.derivedCommands.shadows.castCommands[a];Tp(x,e,d.passState)}}}}var Cvt=new h;oi.prototype.updateAndExecuteCommands=function(e,t){Nvt(this,e,t),this._environmentState.useWebVR?Avt(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===$u.ROTATE?ix(!0,this,e):Ovt(this,e)};function Avt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;PEe(e),n.createPotentiallyVisibleSet(e),wEe(e),r||IEe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ho.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,Cvt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,cQ(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,cQ(e,t),ho.clone(a,i)}var Evt=new fe(Math.PI,P.PI_OVER_TWO),Svt=new h,vvt=new h,wvt=new O,Ivt=new O,Pvt=new h,Dvt=new h,Rvt=new Xe;function Ovt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Xe.clone(r,Rvt);t.viewport=s;let a=Evt,c=Svt;e.mapProjection.project(a,c);let f=h.clone(i.position,vvt),d=O.clone(i.transform,Ivt),p=i.frustum.clone();i._setTransform(O.IDENTITY);let _=O.computeViewportTransformation(s,0,1,wvt),m=i.frustum.projectionMatrix,y=i.positionWC.y,x=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,Pvt),b=Et.pointToGLWindowCoordinates(m,_,x,Dvt);b.x=Math.floor(b.x);let T=s.x,C=s.width;if(y===0||b.x<=T||b.x>=T+C)ix(!0,e,t);else if(Math.abs(T+C*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),ix(!0,e,t),s.x=b.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),ix(!1,e,t);else if(b.x>T+C*.5){s.width=b.x-T;let A=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),ix(!0,e,t),s.x=b.x,s.width=T+C-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=A-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),ix(!1,e,t)}else{s.x=b.x,s.width=T+C-b.x;let A=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),ix(!0,e,t),s.x=T,s.width=b.x-T,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=A-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),ix(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function ix(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),PEe(t),i.createPotentiallyVisibleSet(t),e&&(wEe(t),o||IEe(t)),cQ(t,n)}var EEe=new Ds;oi.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!==ne.SCENE2D&&t.camera.frustum instanceof ln||!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(uy.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=r.dynamicLighting;s.setDynamicLighting(b),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 u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let d=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,_=EEe.planes;for(let x=0;x<5;++x)_[x]=p.planes[x];p=EEe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new hm(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Mvt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Z_({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 Lvt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.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 PEe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Mvt(e),Lvt(e),e._globe&&e._globe.render(t)}function Nvt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new PH:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;H.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,_=r.useOIT=!c&&l(p)&&p.isSupported();_&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let b;if(o.invertClassificationColor.alpha===1&&d&&(b=s.globeDepth.framebuffer),l(b)||i.depthTexture){if(e._invertClassification.previousFramebuffer=b,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&_){let T=e._invertClassification.unclassifiedCommand,C=T.derivedCommands;C.oit=p.createDerivedCommands(T,i,C.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}oi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let _=d;a&&!s&&(_=f);let m=this.postProcessStages,y=_.getColorTexture(0),x=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,x),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function Fvt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Bvt(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function DEe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Jl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=DEe(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}oi.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===$e.CLAMP_TO_TERRAIN||t===$e.RELATIVE_TO_TERRAIN,i=t===$e.CLAMP_TO_3D_TILE||t===$e.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=DEe(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 aQ=new fe;oi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=_=>{fe.clone(e,aQ);let m;l(_)&&(m=_.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(aQ.height=m,t(aQ))},r=n===$e.CLAMP_TO_TERRAIN||n===$e.RELATIVE_TO_TERRAIN,s=n===$e.CLAMP_TO_3D_TILE||n===$e.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},u=_=>{if(r||_.isDestroyed()||!_.isCesium3DTileset)return;let m=_.updateHeight(e,o,i);c[_.id]=m};if(!r){let _=this.primitives.length;for(let m=0;m<_;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(_=>{_.isDestroyed()||!_.isCesium3DTileset||(l(c[_.id])&&c[_.id](),delete c[_.id])});return()=>{a=a&&a(),Object.values(c).forEach(_=>_()),c={},f(),d()}};function kvt(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===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}oi.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=Bvt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=kvt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Uvt(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 $0({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 zvt(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 Vvt(e){e.primitives.postPassesUpdate(e._frameState),lc.update()}var Hvt=new H;function Gvt(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=ivt;let r=e.backgroundColor??H.BLACK;e._hdr&&(r=H.clone(r,Hvt),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 wg?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Xe.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,bvt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function RT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function jvt(e){return e._picking.updateMostDetailedRayPicks(e)}oi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=$.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs($.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=$.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);SEe(this,o,e),t.newFrame=!0}RT(this,zvt),this.primitives.show&&(RT(this,jvt),RT(this,Wvt),RT(this,qvt),i||RT(this,Yvt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),RT(this,Gvt)),Uvt(this,i),RT(this,Vvt),Fvt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};oi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};oi.prototype.requestRender=function(){this._renderRequested=!0};oi.prototype.clampLineWidth=function(e){return Math.max(Lt.minimumAliasedLineWidth,Math.min(e,Lt.maximumAliasedLineWidth))};oi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};oi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof DT))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 RH.fromKeyframeNode(o,s,c,a)};oi.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=iG(s,t,n,i);if(!l(a))return;let c=rG(r,n,i);if(!l(c))return;let u=new oG(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};oi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};oi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};oi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};oi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Wvt(e){let t=e._frameState;oQ.camera=t.camera,oQ.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,oQ)}function qvt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;rQ.camera=e.preloadFlightCamera,rQ.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,rQ)}function Yvt(e){e.primitives.updateForPass(e._frameState,ovt)}oi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};oi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};oi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};oi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};oi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};oi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};oi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};oi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};oi.prototype.cartesianToCanvasCoordinates=function(e,t){return qi.worldToWindowCoordinates(this,e,t)};oi.prototype.completeMorph=function(){this._transitioner.completeMorph()};oi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};oi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};oi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function Xvt(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()})}oi.prototype.setTerrain=function(e){return Xvt(this,e),e};oi.prototype.isDestroyed=function(){return!1};oi.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),ce(this)};var cG=oi;var U1=`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 lG=`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 uG=`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 Av(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=O.fromScale(n),this._modelMatrix=new O,this._command=new qe({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;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(Av.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Av.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var lQ=new O;Av.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=O.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,lQ),o=O.multiplyTransformation(i,Go.Y_UP_TO_Z_UP,lQ),r=O.multiply(this._scaleMatrix,o,lQ);O.clone(r,this._modelMatrix);let s=e.context,a=Kvt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Sa.createGeometry(new Sa({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:De.POSITION_ONLY}));f.vertexArray=qn.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:Si.FRONT},blending:fn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let _=new Be({defines:p,sources:[Cm,U1,uG]}),m=new Be({defines:p,sources:[Cm,U1,lG]});this._spSkyAtmosphere=Xt.fromCache({context:s,vertexShaderSource:_,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function Kvt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}Av.prototype.isDestroyed=function(){return!1};Av.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ce(this)};var fG=Av;var dG=`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 hG=`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 Sv(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new qe({modelMatrix:O.clone(O.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Sv.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.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"?SN(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 fr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=mc.createGeometry(mc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:De.POSITION_ONLY})),c=this._attributeLocations=Fn.createAttributeLocations(a);s.vertexArray=qn.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Ne.STATIC_DRAW}),s.renderState=ze.fromCache({blending:fn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Be({defines:[t?"HDR":""],sources:[dG]});s.shaderProgram=Xt.fromCache({context:r,vertexShaderSource:hG,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};Sv.prototype.isDestroyed=function(){return!1};Sv.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(),ce(this)};function Ev(e){return on(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Sv.createEarthSkyBox=function(){return new Sv({sources:{positiveX:Ev("px"),negativeX:Ev("mx"),positiveY:Ev("py"),negativeY:Ev("my"),positiveZ:Ev("pz"),negativeZ:Ev("mz")}})};var mG=Sv;var pG=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); -} -`;var _G=`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 gG=`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 V1(){this.show=!0,this._drawCommand=new qe({primitiveType:Le.TRIANGLES,boundingVolume:new re,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new re,this._boundingVolume2D=new re,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(V1.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var $vt=new V,Zvt=new V,Qvt=new ie,z1=new ie;V1.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.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 A=Math.max(r,s);A=Math.pow(2,Math.ceil(Math.log(A)/Math.log(2))-2),A=Math.max(1,A);let S=n?o.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._texture=new dt({context:o,width:A,height:A,pixelFormat:je.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,R={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new Fa({fragmentShaderSource:_G,outputTexture:this._texture,uniformMap:R,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let A={direction:0},S=new Uint8Array(4*2);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let w=st.createVertexBuffer({context:o,typedArray:S,usage:Ne.STATIC_DRAW}),R=[{index:A.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:K.UNSIGNED_BYTE}],D=st.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT});a.vertexArray=new qn({context:o,attributes:R,indexBuffer:D}),a.shaderProgram=Xt.fromCache({context:o,vertexShaderSource:gG,fragmentShaderSource:pG,attributeLocations:A}),a.renderState=ze.fromCache({blending:fn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?re.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&re.clone(d,a.boundingVolume);let p=qi.computeActualEllipsoidPosition(e,c,z1),_=h.magnitude(h.subtract(p,e.camera.position,z1)),m=o.uniformState.projection,y=Qvt;y.x=0,y.y=0,y.z=-_,y.w=1;let x=O.multiplyByVector(m,y,z1),b=qi.clipToGLWindowCoordinates(t.viewport,x,$vt);y.x=P.SOLAR_RADIUS;let T=O.multiplyByVector(m,y,z1),C=qi.clipToGLWindowCoordinates(t.viewport,T,Zvt);return this._size=V.magnitude(V.subtract(C,b,z1)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};V1.prototype.isDestroyed=function(){return!1};V1.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(),ce(this)};var yG=V1;var MEe=$r(IR(),1);function Jvt(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 xG=Jvt;var ewt={modifyFragmentShader:function(t){return t=Be.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},H1=ewt;var OT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function G1(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=H.clone(H.DARKGRAY),this._highlightColor=H.clone(H.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=OT.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??Se.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=O.clone(O.IDENTITY),this._modelMatrix=O.clone(O.IDENTITY),this.time=0,this.shadows=Tn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Jr.NONE,this._splittingEnabled=!1,this._error=void 0,twt(this,e)}Object.defineProperties(G1.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return H.clone(this._highlightColor)},set:function(e){this._highlightColor=H.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=re.clone(e,this._boundingSphere)}}});function twt(e,t){let n=YA.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=Hg.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=OT.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=H.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 nwt=new h,iwt=new h,owt=new h,REe,bG;function rwt(e){if(!l(bG)){REe=new MEe.default(0),bG=new Array(e);for(let t=0;t<e;++t)bG[t]=REe.random()}return bG}function swt(e){let n=e.length/3,i=Math.min(n,20),o=rwt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,nwt),c=h.fromElements(s,s,s,iwt);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=h.unpack(e,d*3,owt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=re.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function OEe(e,t){let n=K.fromTypedArray(e);return n===K.INT||n===K.UNSIGNED_INT||n===K.DOUBLE?(Tt("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 awt=new ie,cwt=new ie,lwt=new H,LEe=0,TG=1,mQ=2,NEe=3,uwt=4,uQ=new O,fwt=new O;function dwt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,_=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,x=e._octEncodedRange,b=e._isRGB565,T=e._isTranslucent,C=e._hasColors,A=e._hasNormals,S=e._hasBatchIds,w,R,D=[],M={};if(e._styleableShaderAttributes=M,f){let k=uwt;for(let z in u)if(u.hasOwnProperty(z)){let B=u[z],j=OEe(B.typedArray,z);w=B.componentCount,R=K.fromTypedArray(j);let W=st.createVertexBuffer({context:n,typedArray:j,usage:Ne.STATIC_DRAW});e._geometryByteLength+=W.sizeInBytes;let J={index:k,vertexBuffer:W,componentsPerAttribute:w,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0};D.push(J),M[z]={location:k,componentCount:w},++k}}let L=st.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;C&&(g=st.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let E;A&&(E=st.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let v;S&&(c.typedArray=OEe(c.typedArray,"batchIds"),v=st.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=v.sizeInBytes);let I=[];if(d?R=K.UNSIGNED_SHORT:p?R=y<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT:R=K.FLOAT,I.push({index:LEe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=re.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=swt(r.typedArray)),C)if(b)I.push({index:TG,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=T?4:3;I.push({index:TG,vertexBuffer:g,componentsPerAttribute:k,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}A&&(_?(w=2,R=K.UNSIGNED_BYTE):m?(w=2,R=x<=255?K.UNSIGNED_BYTE:K.UNSIGNED_SHORT):(w=3,R=K.FLOAT),I.push({index:mQ,vertexBuffer:E,componentsPerAttribute:w,componentDatatype:R,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&I.push({index:NEe,vertexBuffer:v,componentsPerAttribute:1,componentDatatype:K.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(D));let N=new qn({context:n,attributes:I}),F={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:fn.ALPHA_BLEND};e._opaquePass===Se.CESIUM_3D_TILE&&(F.stencilTest=jt.setCesium3DTileBit(),F.stencilMask=jt.CESIUM_3D_TILE_MASK,U.stencilTest=jt.setCesium3DTileBit(),U.stencilMask=jt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(F),e._translucentRenderState=ze.fromCache(U),e._drawCommand=new qe({boundingVolume:new re,cull:e._cull,modelMatrix:new O,primitiveType:Le.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?Se.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function hwt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=awt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof ln?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return H.TRANSPARENT;let c=H.clone(a.edgeColor,lwt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return O.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;O.multiply(n.uniformState.view3D,c,uQ);let u=O.multiply(uQ,a.modelMatrix,uQ);return O.inverseTranspose(u,fwt)}};H1.addUniforms(e,s),(i||o||r)&&(s=ct(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=cwt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function fQ(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 dQ(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 hQ(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 mwt={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 pwt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,_=e._isTranslucent,m=e._hasColors,y=e._hasNormals,x=e._hasBatchIds,b=e._backFaceCulling,T=e._normalShading,C=e._drawCommand.vertexArray,A=e.clippingPlanes,S=e._attenuation,w,R,D,M=_,L=Fe(mwt),g={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let le={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";w=n.getColorShaderFunction(`getColorFromStyle${ye}`,L,le),R=n.getShowShaderFunction(`getShowFromStyle${ye}`,L,le),D=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,L,le),l(w)&&le.translucent&&(M=!0)}e._styleTranslucent=M;let v=l(w),I=l(R),N=l(D),F=e.isClipped,U=[],k=[];v&&(fQ(w,U),dQ(w,k)),I&&(fQ(R,U),dQ(R,k)),N&&(fQ(D,U),dQ(D,k));let z=k.indexOf("COLOR")>=0,B=k.indexOf("NORMAL")>=0;if(B&&!y)throw new se("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let le=U.indexOf(r.location)>=0,ye=hQ(C,r.location);ye.enabled=le}let j=m&&(!v||z);if(m){let le=hQ(C,TG);le.enabled=j}let W=y&&(T||b||B);if(y){let le=hQ(C,mQ);le.enabled=W}let J={a_position:LEe};j&&(J.a_color=TG),W&&(J.a_normal=mQ),x&&(J.a_batchId=NEe);let Y="",ee=U.length;for(i=0;i<ee;++i){let le=U[i];r=g[le];let ye=r.componentCount,be=`czm_3dtiles_property_${le}`,Ie;ye===1?Ie="float":Ie=`vec${ye}`,Y+=`in ${Ie} ${be}; -`,J[be]=r.location}hwt(e,t);let Q=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;Q+=`float u_pointSize; -float tiles3d_tileset_time; -`,S&&(Q+=`float u_geometricError; -float u_depthMultiplier; -`),Q+=Y,j&&(_?Q+=`in vec4 a_color; -`:p?Q+=`in float a_color; -const float SHIFT_RIGHT_11 = 1.0 / 2048.0; -const float SHIFT_RIGHT_5 = 1.0 / 32.0; -const float SHIFT_LEFT_11 = 2048.0; -const float SHIFT_LEFT_5 = 32.0; -const float NORMALIZE_6 = 1.0 / 64.0; -const float NORMALIZE_5 = 1.0 / 32.0; -`:Q+=`in vec3 a_color; -`),W&&(f||d?Q+=`in vec2 a_normal; -`:Q+=`in vec3 a_normal; -`),x&&(Q+=`in float a_batchId; -`),(c||u||d)&&(Q+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),v&&(Q+=w),I&&(Q+=R),N&&(Q+=D),Q+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,S&&(Q+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),j?_?Q+=` vec4 color = a_color; -`:p?Q+=` float compressed = a_color; - float r = floor(compressed * SHIFT_RIGHT_11); - compressed -= r * SHIFT_LEFT_11; - float g = floor(compressed * SHIFT_RIGHT_5); - compressed -= g * SHIFT_LEFT_5; - float b = compressed; - vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); - vec4 color = vec4(rgb, 1.0); -`:Q+=` vec4 color = vec4(a_color, 1.0); -`:Q+=` vec4 color = u_constantColor; -`,c||u?Q+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:Q+=` vec3 position = a_position; -`,Q+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,W?(f?Q+=` vec3 normal = czm_octDecode(a_normal); -`:d?Q+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:Q+=` vec3 normal = a_normal; -`,Q+=` vec3 normalEC = czm_normal * normal; -`):Q+=` vec3 normal = vec3(1.0); -`,v&&(Q+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(Q+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),N?Q+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:S?Q+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:Q+=` gl_PointSize = u_pointSize; -`,Q+=` color = color * u_highlightColor; -`,W&&T&&(Q+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),Q+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,W&&b&&(Q+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(Q+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),Q+=`} -`;let de=`in vec4 v_color; -`;F&&(de+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,de+=` -`,de+=H0(A,s),de+=` -`),de+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,F&&(de+=xG("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} -`,e.splitDirection!==Jr.NONE&&(de=H1.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=Xt.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{ge.shaderProgram._bind()}catch{throw new se("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function _wt(e,t){if(e._decodingState===OT.READY)return!1;if(e._decodingState===OT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Zg.decodePointCloud(i,t);l(o)&&(e._decodingState=OT.DECODING,o.then(function(r){e._decodingState=OT.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let x=r.POSITION.data.quantization,b=x.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.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 _=n.styleableProperties,m=i.batchTableProperties;for(let x in m)if(m.hasOwnProperty(x)){let b=r[x];l(_)||(_={}),_[x]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=_}).catch(function(r){e._decodingState=OT.FAILED,e._error=r}))}return!0}var gwt=new ie,ywt=new h;G1.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(_wt(this,t))return;let i=!1,o=!O.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(dwt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){O.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(O.clone(this._modelMatrix,u),l(this._rtcCenter)&&O.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&O.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=O.getColumn(u,3,gwt);ie.equals(p,ie.UNIT_W)||Et.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(re.clone(this._boundingSphere,f),this._cull){let d=f.center;O.multiplyByPoint(u,d,d);let p=O.getScale(u,ywt);f.radius*=h.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!==Jr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&pwt(this,e,this._style),this._drawCommand.castShadows=Tn.castShadows(this.shadows),this._drawCommand.receiveShadows=Tn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Se.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};G1.prototype.isDestroyed=function(){return!1};G1.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ce(this)};var CG=G1;function LT(e){e=e??G.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this.shadows=e.shadows??Tn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new s_(e.shading),this.style=e.style,this.frameFailed=new me,this.frameChanged=new me,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new py,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(LT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Os.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function xwt(e){return`uniform vec4 czm_pickColor; -${e}`}function bwt(e){return function(t){return ct(t,{czm_pickColor:function(){return e._pickId.color}})}}function Twt(){return"czm_pickColor"}LT.prototype.makeStyleDirty=function(){this._styleDirty=!0};LT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Cwt=new $;function _Q(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function MT(e,t){return e._intervals.indexOf(t.start)}function Awt(e,t){let n=e._intervals,i=e._clock,o=_Q(e);if(o===0)return;let r=e._getAverageLoadTime(),s=$.addSeconds(i.currentTime,r*o,Cwt),a=n.indexOf(s),c=MT(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function Ewt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function Swt(e,t,n){let i=_Q(e),o=MT(e,t),r=MT(e,n);return i>=0?o>=r:o<=r}function BEe(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 vwt(e,t,n){let i=MT(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?O.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Pi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ee.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new CG({arrayBuffer:u,cull:!0,fragmentShaderLoaded:xwt,uniformMapLoaded:bwt(e),pickIdLoaded:Twt})}).catch(BEe(e,c))}return r}function wwt(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 Iwt(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(kEe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Pi()-t.timestamp)/1e3;wwt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Pwt=new O;function Dwt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Rwt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Owt=new s_;function kEe(e,t,n,i){let o=e.shading??Owt,r=t.pointCloud,s=t.transform??O.IDENTITY;r.modelMatrix=O.multiplyTransformation(e.modelMatrix,s,Pwt),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=Dwt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Rwt(e);try{r.update(i)}catch(a){BEe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function pQ(e,t,n,i){let o=vwt(e,t,i);Iwt(e,o,n,i)}function Mwt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function UEe(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 Lwt(e,t){let n=MT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function FEe(e,t,n,i,o){return l(n)?n.ready?!0:(pQ(e,t,i,o),n.ready):!1}function Nwt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=MT(e,n),d=MT(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],FEe(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],FEe(e,s,a,i,o))return s;return t}function Fwt(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 vv={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};LT.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=$.clone(e.time));let t=Math.max($.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)&&Fwt(this,o,s),vv.timeSinceLoad=t,vv.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,_=Ewt(this);if(!l(_))return;let m=!1,y=_Q(this),x=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||x)&&(d=_),(!l(p)||m||Swt(this,_,p))&&(p=Awt(this,_)),d=Nwt(this,d,_,vv,e);let b=Lwt(this,d);l(b)||(pQ(this,d,vv,e),b=this._lastRenderedFrame),l(b)&&kEe(this,b,vv,e),l(p)&&pQ(this,p,vv,e);let T=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&T.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return T.frameChanged.raiseEvent(T),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let C=this._totalMemoryUsageInBytes,A=this.maximumMemoryUsage*1024*1024;C>A&&UEe(this,Mwt(e));let w=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&w>0&&c.update(e,f,a,this.boundingSphere)};LT.prototype.isDestroyed=function(){return!1};LT.prototype.destroy=function(){return UEe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ce(this)};var j1=LT;function HEe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Bwt(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 GEe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function jEe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=GEe(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 WEe(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 Po(e,t){e=On(e),t=t??G.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ft.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ft.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?On(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?On(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 me,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Bm,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),jEe(this);try{let p=t.ellipsoid??te.default,_=new cG({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=_,_.camera.constrainedAxis=h.UNIT_Z,GEe(this),WEe(this);let m=t.globe;l(m)||(m=new K4(p)),m!==!1&&(_.globe=m,_.globe.shadows=t.terrainShadows??Tn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&te.WGS84.equals(p)&&(y=mG.createEarthSkyBox()),y!==!1&&(_.skyBox=y,_.sun=new yG,te.WGS84.equals(p)&&(_.moon=new e8));let x=t.skyAtmosphere;!l(x)&&te.WGS84.equals(p)&&(x=new fG(p),x.show=t.globe!==!1&&m.show),x!==!1&&(_.skyAtmosphere=x);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Mc.fromWorldImagery()),_.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(_.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&_.setTerrain(t.terrain),this._screenSpaceEventHandler=new md(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let T=this;this._onRenderError=function(D,M){T._useDefaultRenderLoop=!1,T._renderLoopRunning=!1,T._showRenderLoopErrors&&T.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},_.renderError.addEventListener(this._onRenderError);let C=t.dataSources,A=!1;l(C)||(C=new rU,A=!0);let S=new YU({scene:_,dataSourceCollection:C}),w=new wr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=C,this._destroyDataSourceCollection=A,this._dataSourceDisplay=S,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,Po.prototype._onTick,this),w.add(_.morphStart,Po.prototype._clearTrackedObject,this),w.add(C.dataSourceAdded,Po.prototype._onDataSourceAdded,this),w.add(C.dataSourceRemoved,Po.prototype._onDataSourceRemoved,this),w.add(_.postRender,Po.prototype._postRender,this);let R=C.length;for(let D=0;D<R;D++)this._dataSourceAdded(C,C.get(D));this._dataSourceAdded(void 0,S.defaultDataSource),w.add(C.dataSourceAdded,Po.prototype._dataSourceAdded,this),w.add(C.dataSourceRemoved,Po.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Po.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&&Bwt(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,gQ(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(O.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,HEe(this.clock,e))}}});Po.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let _=document.createElement("div");if(_.className="cesium-widget-errorPanel-message",a.appendChild(_),f){let m=Y_(n);u||(typeof n=="string"&&(n=new Error(n)),t=Y_({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${m}`);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(b){y.removeChild(x),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}_.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);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)},d.appendChild(p),i.appendChild(o)};Po.prototype.isDestroyed=function(){return!1};Po.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()),ce(this)};Po.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,jEe(this),WEe(this),this._scene.requestRender())};Po.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Po.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Po.prototype._onEntityCollectionChanged,this)};Po.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Po.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Po.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var kwt=new re;Po.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??kwt)===ut.DONE&&i.update(t)}};Po.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)}};Po.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Po.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&HEe(this.clock,e)};Po.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Po.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Po.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}};Po.prototype.zoomTo=function(e,t){return qEe(this,e,{offset:t},!1)};Po.prototype.flyTo=function(e,t){return qEe(this,e,t,!0)};function qEe(e,t,n,i){gQ(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 Mc){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 jS(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Ls||r instanceof j1||r instanceof DT){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 W1(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function gQ(e){let t=e._zoomPromise;l(t)&&(W1(e),e._completeZoom(!1))}Po.prototype._postRender=function(){Uwt(this),zwt(this)};var zEe=new re;function Uwt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new bh(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(O.IDENTITY),e._completeZoom(!0)),W1(e)}if(t instanceof j1){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Ls||t instanceof DT){s(t.boundingSphere);return}if(t instanceof fe){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)),W1(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,zEe);if(p===ut.PENDING)return;p!==ut.FAILED&&c.push(re.clone(zEe))}if(c.length===0){gQ(e);return}e.trackedEntity=void 0;let u=re.fromBoundingSpheres(c);e._zoomIsFlight?(W1(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(O.IDENTITY),W1(e),e._completeZoom(!0))}var VEe=new re;function zwt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,VEe);if(r===ut.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?VEe:void 0;e._entityView=new $U(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var AG=Po;var EG=`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 SG=`#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 vG=`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 wG=`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 IG=`in vec2 v_textureCoordinates; - -uniform float originalSize; -uniform sampler2D texture0; -uniform sampler2D texture1; -uniform sampler2D texture2; -uniform sampler2D texture3; -uniform sampler2D texture4; -uniform sampler2D texture5; - -const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); -const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); -const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); -const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); - -void main() -{ - vec2 uv = v_textureCoordinates; - vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); - vec2 pixel = 1.0 / textureSize; - - float mipLevel = 0.0; - - if (uv.x - pixel.x > (textureSize.y / textureSize.x)) - { - mipLevel = 1.0; - if (uv.y - pixel.y > yMipLevel1) - { - mipLevel = 2.0; - if (uv.y - pixel.y * 3.0 > yMipLevel2) - { - mipLevel = 3.0; - if (uv.y - pixel.y * 5.0 > yMipLevel3) - { - mipLevel = 4.0; - if (uv.y - pixel.y * 7.0 > yMipLevel4) - { - mipLevel = 5.0; - } - } - } - } - } - - if (mipLevel > 0.0) - { - float scale = pow(2.0, mipLevel); - - uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); - uv.x *= ((textureSize.x - 2.0) / textureSize.y); - - uv.x -= 1.0 + pixel.x; - uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); - uv *= scale; - } - else - { - uv.x *= (textureSize.x / textureSize.y); - } - - if(mipLevel == 0.0) - { - out_FragColor = texture(texture0, uv); - } - else if(mipLevel == 1.0) - { - out_FragColor = texture(texture1, uv); - } - else if(mipLevel == 2.0) - { - out_FragColor = texture(texture2, uv); - } - else if(mipLevel == 3.0) - { - out_FragColor = texture(texture3, uv); - } - else if(mipLevel == 4.0) - { - out_FragColor = texture(texture4, uv); - } - else if(mipLevel == 5.0) - { - out_FragColor = texture(texture5, uv); - } - else - { - out_FragColor = vec4(0.0); - } -} -`;var PG=`in vec3 v_cubeMapCoordinates; -uniform samplerCube cubeMap; - -void main() -{ - vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); - #ifdef RGBA_NORMALIZED - out_FragColor = vec4(rgba.rgb, 1.0); - #else - float m = rgba.a * 16.0; - vec3 r = rgba.rgb * m; - out_FragColor = vec4(r * r, 1.0); - #endif -} -`;var DG=`in vec4 position; -in vec3 cubeMapCoordinates; - -out vec3 v_cubeMapCoordinates; - -void main() -{ - gl_Position = position; - v_cubeMapCoordinates = cubeMapCoordinates; -} -`;var RG=` -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 Vwt=new h(1,1,1);function yQ(e){e=e??Vwt,this._dimensions=h.clone(e)}Object.defineProperties(yQ.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var Hwt=new h;yQ.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,Hwt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var YEe=yQ;function Cp(){this.featurePropertiesDirty=!1}Object.defineProperties(Cp.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});Cp.prototype.hasProperty=function(e,t){he.throwInstantiationError()};Cp.prototype.getFeature=function(e){he.throwInstantiationError()};Cp.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};Cp.prototype.applyStyle=function(e){he.throwInstantiationError()};Cp.prototype.update=function(e,t){he.throwInstantiationError()};Cp.prototype.pick=function(e,t,n){he.throwInstantiationError()};Cp.prototype.isDestroyed=function(){he.throwInstantiationError()};Cp.prototype.destroy=function(){he.throwInstantiationError()};var XEe=Cp;function wv(e,t){this._conditionsExpression=Fe(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,jwt(this,t)}Object.defineProperties(wv.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Gwt(e,t){this.condition=e,this.expression=t}function jwt(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 Gwt(new Hd(a,t),new Hd(c,t)))}e._runtimeConditions=n}wv.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)}};wv.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)}};wv.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) - { - return ${f}; - } -`}return r=`${i} ${e} -{ -${r} return ${i}(1.0); -} -`,r};wv.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 OG=wv;function ox(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,Wwt(this,e)}function Wwt(e,t){t=Fe(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??G.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Hd(o[r],i))}e._meta=n,e._ready=!0}function ar(e,t){let n=(e._style??G.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Hd(String(t));if(typeof t=="string")return new Hd(t,n);if(l(t.conditions))return new OG(t,n)}else return;return t}function cr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Fe(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(ox.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ar(this,e),this._style.show=cr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ar(this,e),this._style.color=cr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ar(this,e),this._style.pointSize=cr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ar(this,e),this._style.pointOutlineColor=cr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ar(this,e),this._style.pointOutlineWidth=cr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ar(this,e),this._style.labelColor=cr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ar(this,e),this._style.labelOutlineColor=cr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ar(this,e),this._style.labelOutlineWidth=cr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ar(this,e),this._style.font=cr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ar(this,e),this._style.labelStyle=cr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ar(this,e),this._style.labelText=cr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ar(this,e),this._style.backgroundColor=cr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ar(this,e),this._style.backgroundPadding=cr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ar(this,e),this._style.backgroundEnabled=cr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ar(this,e),this._style.scaleByDistance=cr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ar(this,e),this._style.translucencyByDistance=cr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ar(this,e),this._style.distanceDisplayCondition=cr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ar(this,e),this._style.heightOffset=cr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ar(this,e),this._style.anchorLineEnabled=cr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ar(this,e),this._style.anchorLineColor=cr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ar(this,e),this._style.image=cr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ar(this,e),this._style.disableDepthTestDistance=cr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ar(this,e),this._style.horizontalOrigin=cr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ar(this,e),this._style.verticalOrigin=cr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ar(this,e),this._style.labelHorizontalOrigin=cr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ar(this,e),this._style.labelVerticalOrigin=cr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});ox.fromUrl=function(e){return Ee.createIfNeeded(e).fetchJson(e).then(function(n){return new ox(n)})};ox.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)};ox.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)};ox.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)};ox.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 Iv=ox;function q1(e){e=e??G.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new LS({comparator:q1.comparator})}q1.prototype.addSubtree=function(e){let t=new qwt(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()};q1.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}};q1.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 qwt(e,t){this.subtree=e,this.stamp=t}var MG=q1;function Y1(e){e=e??G.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=O.IDENTITY.clone(),shapeTransform:f=O.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:_,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=d,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===$a.ELLIPSOID?zh.Z_UP:zh.Y_UP,this._minimumValues=_,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new MG}Object.defineProperties(Y1.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}}});Y1.fromUrl=async function(e){let t=Ee.createIfNeeded(e),n=await t.fetchJson();Xwt(n);let i=tIt(n,t);await i.load();let{root:o}=n,r=ci(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new mE({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,u=nIt(s,c);Object.assign(u,Kwt(o)),l(o.transform)?u.globalTransform=O.unpack(o.transform):u.globalTransform=O.clone(O.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=Ywt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new Y1(u),d=new _E(t,o,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Ri.unload(i),f};function Ywt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(xA.TILESET_TILE_COUNT)}function Xwt(e){let t=e.root;if(!l(t.content))throw new se("Root must have content");if(!ci(t.content,"3DTILES_content_voxels"))throw new se("Root tile content must have 3DTILES_content_voxels extension");if(!ci(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new se("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ci(e,"3DTILES_metadata"))throw new se("Tileset must have a metadata schema")}function Kwt(e){let t=e.boundingVolume;if(l(t.box))return Jwt(t.box);if(l(t.region))return $wt(t.region);if(ci(t,"3DTILES_bounding_volume_cylinder"))return eIt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new se("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function $wt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=O.fromScale(te.WGS84.radii),c=new h(t,n,r),u=new h(i,o,s);return{shape:$a.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var Zwt=new h,Qwt=new Z;function Jwt(e){let t=Pn.unpack(e),n=Z.getScale(t.halfAxes,Zwt),i=Z.getRotation(t.halfAxes,Qwt);return{shape:$a.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:O.fromRotationTranslation(i,t.center)}}function eIt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-P.PI,maxAngle:r=P.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=O.fromTranslationQuaternionRotationScale(h.unpack(s),Pe.unpack(a),h.ONE);return{shape:$a.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,u),shapeTransform:f}}function tIt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ri.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ri.getSchemaLoader({schema:i})}function nIt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([_,m])=>{let{type:y,componentType:x}=m,b=o?.properties[_].min,T=o?.properties[_].max,C=at.getComponentCount(y),A=KEe(b,C),S=KEe(T,C);return{id:_,type:y,componentType:x,minValue:A,maxValue:S}}),a=s.map(_=>_.id),c=s.map(_=>_.type),u=s.map(_=>_.componentType),f=s.map(_=>_.minValue),d=s.map(_=>_.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function KEe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function iIt(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=Oy(a);return o=await yA.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}Y1.prototype.requestData=async function(e){e=e??G.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 gE({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await iIt(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:y}=s,x=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:x.url});return xv.fromGltf(b)};var $Ee=Y1;function xQ(e){e=e??1,this._radius=e??1}Object.defineProperties(xQ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});xQ.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var LG=xQ;var bQ={CUMULUS:0};bQ.validate=function(e){return e===bQ.CUMULUS};var X1=Object.freeze(bQ);function Vh(e,t){if(e=e??G.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new V(this._maximumSize.x,this._maximumSize.y);else{this._scale=V.clone(e.scale??new V(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=H.clone(e.color??H.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var oIt=Vh.SHOW_INDEX=0,rIt=Vh.POSITION_INDEX=1,sIt=Vh.SCALE_INDEX=2,aIt=Vh.MAXIMUM_SIZE_INDEX=3,cIt=Vh.SLICE_INDEX=4,lIt=Vh.BRIGHTNESS_INDEX=5,uIt=Vh.COLOR_INDEX=6;Vh.NUMBER_OF_PROPERTIES=7;function NT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Vh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,NT(this,oIt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),NT(this,rIt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;V.equals(t,e)||(V.clone(e,t),NT(this,sIt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),NT(this,aIt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),NT(this,uIt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,NT(this,cIt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,NT(this,lIt))}}});Vh.prototype._destroy=function(){this._cloudCollection=void 0};var Ed=Vh;var nf,NG=new h,fIt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},dIt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},hIt=Ed.SHOW_INDEX,mIt=Ed.POSITION_INDEX,pIt=Ed.SCALE_INDEX,_It=Ed.MAXIMUM_SIZE_INDEX,gIt=Ed.SLICE_INDEX,yIt=Ed.BRIGHTNESS_INDEX,xIt=Ed.NUMBER_OF_PROPERTIES,bIt=Ed.COLOR_INDEX;function Hh(e){e=e??G.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(xIt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:ZEe(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 ZEe(e){return function(){return NG.x=e._textureSliceWidth,NG.y=e._noiseTextureRows,NG.z=1/e._noiseTextureRows,NG}}Object.defineProperties(Hh.prototype,{length:{get:function(){return CQ(this),this._clouds.length}}});function QEe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Hh.prototype.add=function(e){e=e??G.EMPTY_OBJECT;let t=e.cloudType??X1.CUMULUS,n;return t===X1.CUMULUS&&(n=new Ed(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Hh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Hh.prototype.removeAll=function(){QEe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function CQ(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}}Hh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Hh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Hh.prototype.get=function(e){return CQ(this),this._clouds[e]};var TIt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),CIt=new Uint16Array([0,1,2,0,2,3]);function AIt(e){let t=st.createVertexBuffer({context:e,typedArray:TIt,usage:Ne.STATIC_DRAW}),n=st.createIndexBuffer({context:e,typedArray:CIt,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT}];return new qn({context:e,attributes:i,indexBuffer:n})}var AQ;function EIt(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=st.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function SIt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=st.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function vIt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=st.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function wIt(e,t,n){let i=[{index:nf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:nf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:nf.packedAttribute0,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:nf.packedAttribute1,componentsPerAttribute:4,componentDatatype:K.FLOAT,usage:Ne.STATIC_DRAW},{index:nf.color,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:nf.direction,componentsPerAttribute:2,componentDatatype:K.FLOAT,vertexBuffer:vIt(e)});let o=n?t:4*t;return new Ig(e,i,o,n)}var TQ=new Gn;function JEe(e,t,n,i){let o,r=n[nf.positionHighAndScaleX],s=n[nf.positionLowAndScaleY],a=i.position;Gn.fromCartesian(a,TQ);let c=i.scale,u=TQ.high,f=TQ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function eSe(e,t,n,i){let o,r=n[nf.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 tSe(e,t,n,i){let o,r=n[nf.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 nSe(e,t,n,i){let o,r=n[nf.color],s=i.color,a=H.floatToByte(s.red),c=H.floatToByte(s.green),u=H.floatToByte(s.blue),f=H.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function IIt(e,t,n,i){JEe(e,t,n,i),eSe(e,t,n,i),tSe(e,t,n,i),nSe(e,t,n,i)}function PIt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=AIt(a),o._spNoise=Xt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new dt({context:a,width:r*r/s,height:r*s,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:je.RGBA,sampler:new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})});let f=new Fa({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:ZEe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function DIt(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=wIt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];IIt(e,t,s,c)}n._vaf.commit(AQ(i))}}var RIt=[];function OIt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=RIt;u.length=0,(c[mIt]||c[pIt])&&u.push(JEe),(c[hIt]||c[yIt])&&u.push(eSe),(c[_It]||c[gIt])&&u.push(tSe),c[bIt]&&u.push(nSe);let f=u.length,d=i._vaf.writers,p,_,m;if(a/r>.1){for(p=0;p<a;++p)for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,d,_);i._vaf.commit(AQ(n))}else{for(p=0;p<a;++p){for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,d,_);i._instanced?i._vaf.subCommit(_._index,1):i._vaf.subCommit(_._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function MIt(e,t,n,i){let o=t.context,r=e,s=new Be({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Be({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Xt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:nf}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:q.LESS},depthMask:!1,blending:fn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function LIt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new qe),f.pass=Se.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Hh.prototype.update=function(e){if(CQ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&PIt(this,e,wG,vG),this._instanced=e.context.instancedArrays,nf=this._instanced?dIt:fIt,AQ=this._instanced?SIt:EIt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?DIt(this,e):r>0&&OIt(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)&&MIt(this,e,SG,EG),LIt(this,e))};Hh.prototype.isDestroyed=function(){return!1};Hh.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(),QEe(this._clouds),ce(this)};var iSe=Hh;var NIt=P.toRadians(30);function EQ(e){this._angle=e??NIt}Object.defineProperties(EQ.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});EQ.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var oSe=EQ;var FIt=new H,BIt=new H,kIt=new H,UIt=new H,rSe=new ie,K1=new Uint8Array(4);function sSe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return H.lerp(t.color,n.color,o,i)}function FG(e,t){return{height:e,color:H.clone(t)}}function aSe(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?H.equals(t.color,i[n-1].color):!1,a=r?H.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?H.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function zIt(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 _=s[n],m=P.clamp(_.height,fu._minimumHeight,fu._maximumHeight),y=H.clone(_.color,FIt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(FG(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let _=c[n+0],m=c[n+1];u=u&&_.height<=m.height,f=f&&_.height>=m.height}f?c=c.reverse():u||F0(c,function(_,m){return P.sign(_.height-m.height)});let d=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,FG(fu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,FG(fu._maximumHeight,c[c.length-1].color)),c=aSe(c),i.push(c)}return i}function VIt(e){let t=zIt(e),n=[],i=[],o;function r(u,f){n.push(FG(u,f))}function s(u,f,d){let p=H.multiplyByScalar(d,1-f.alpha,UIt);p=H.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,_=i.length;for(;f<p||d<_;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,x=f<p-1?u[f+1]:void 0,b=d<_?i[d]:void 0,T=d>0?i[d-1]:void 0,C=d<_-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let A=l(C)&&b.height===C.height,S=!l(T),w=!l(C),R=l(x)&&m.height===x.height,D=!l(y),M=!l(x);A?R?(s(m.height,m.color,b.color),s(m.height,x.color,C.color)):D?(r(m.height,b.color),s(m.height,m.color,C.color)):M?(s(m.height,m.color,b.color),r(m.height,C.color)):(s(m.height,m.color,b.color),s(m.height,m.color,C.color)):S?R?(r(m.height,m.color),s(m.height,x.color,b.color)):M?(r(m.height,m.color),r(m.height,b.color)):(D||r(m.height,m.color),s(m.height,m.color,b.color)):w?R?(s(m.height,m.color,b.color),r(m.height,x.color)):D?(r(m.height,b.color),r(m.height,m.color)):M?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),r(m.height,m.color)):R?(s(m.height,m.color,b.color),s(m.height,x.color,b.color)):D?(r(m.height,b.color),s(m.height,m.color,b.color)):M?(s(m.height,m.color,b.color),r(m.height,b.color)):s(m.height,m.color,b.color),f+=R?2:1,d+=A?2:1}else if(l(m)&&l(b)&&l(T)&&m.height<b.height){let A=sSe(m.height,T,b,kIt);l(y)?l(x)?s(m.height,m.color,A):(s(m.height,m.color,A),r(m.height,A)):(r(m.height,A),s(m.height,m.color,A)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let A=sSe(b.height,y,m,BIt);l(T)?l(C)?s(b.height,A,b.color):(s(b.height,A,b.color),r(b.height,A)):(r(b.height,A),s(b.height,A,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(T)&&!l(x)?(r(m.height,m.color),r(m.height,fu._emptyColor),r(b.height,fu._emptyColor)):(!l(b)&&l(T)&&!l(y)&&(r(T.height,fu._emptyColor),r(m.height,fu._emptyColor)),r(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(r(b.height,b.color),d++)}}return aSe(n)}function fu(e){let{scene:t,layers:n}=e??G.EMPTY_OBJECT,{context:i}=t,o=VIt(n),r=o.length,s,a,c;if(!fu._useFloatTexture(i)){a=He.UNSIGNED_BYTE,c=je.RGBA,s=new Uint8Array(r*4);for(let _=0;_<r;_++)ie.packFloat(o[_].height,rSe),ie.pack(rSe,s,_*4)}else{a=He.FLOAT,c=i.webgl2?je.RED:je.LUMINANCE,s=new Float32Array(r);for(let _=0;_<r;_++)s[_]=o[_].height}let f=dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.NEAREST,magnificationFilter:Kn.NEAREST})}),d=new Uint8Array(r*4);for(let _=0;_<r;_++)o[_].color.toBytes(K1),d[_*4+0]=K1[0],d[_*4+1]=K1[1],d[_*4+2]=K1[2],d[_*4+3]=K1[3];let p=dt.create({context:i,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR,magnificationFilter:Kn.LINEAR})});return Ji.fromType("ElevationBand",{heights:f,colors:p})}fu._useFloatTexture=function(e){return e.floatingPointTexture};fu._maximumHeight=5906376425472;fu._minimumHeight=-5906376425472;fu._emptyColor=new H(0,0,0,0);var cSe=fu;async function HIt(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??G.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||Tt("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??kS.defaultApiKey;if(!l(n))return GIt(t);let i,o=kS.getDefaultCredit();l(o)&&(i=[o]);let r=new Ee({url:`${kS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return Ls.fromUrl(r,t)}var lSe={};async function GIt(e){let i=lSe[2275207];l(i)||(i=Rf.fromAssetId(2275207),lSe[2275207]=i);let o=await i;return Ls.fromUrl(o,e)}var uSe=HIt;async function jIt(e){let t=await Ls.fromIonAssetId(96188,e);e=e??G.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??H.WHITE).toCssColorString();n=new Iv({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var fSe=jIt;function WIt(e){e=e??G.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=O.clone(e.modelMatrix??O.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Pt({geometry:Fn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Pt({geometry:Fn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Pt({geometry:Fn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Dn({asynchronous:!1,geometryInstances:t,appearance:new un({flat:!0,translucent:!1})})}var dSe=WIt;function $1(e){e=e??G.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=lo.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties($1.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}}});$1.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;$1.prototype.isTranslucent=lo.prototype.isTranslucent;$1.prototype.getRenderState=lo.prototype.getRenderState;var hSe=$1;function BG(e){e=e??G.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=O.clone(e.modelMatrix??O.IDENTITY),this._modelMatrix=new O,this.id=e.id,this._id=void 0,this._primitive=void 0}BG.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!O.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=O.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 Pt({geometry:new c0({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:ds.VERTEX_FORMAT,colors:[H.RED,H.RED],arcType:nn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this}),n=new Pt({geometry:new c0({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:ds.VERTEX_FORMAT,colors:[H.GREEN,H.GREEN],arcType:nn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this}),i=new Pt({geometry:new c0({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:ds.VERTEX_FORMAT,colors:[H.BLUE,H.BLUE],arcType:nn.NONE}),modelMatrix:O.multiplyByUniformScale(this.modelMatrix,this.length,new O),id:this.id,pickPrimitive:this});this._primitive=new Dn({geometryInstances:[t,n,i],appearance:new ds,asynchronous:!1})}this._primitive.update(e)}};BG.prototype.isDestroyed=function(){return!1};BG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ce(this)};var kG=BG;function qIt(e){this.direction=h.clone(e.direction),this.color=H.clone(e.color??H.WHITE),this.intensity=e.intensity??1}var mSe=qIt;var UG=`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 zG=`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 FT(e){e=e??G.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??zG,this._fragmentShaderSource=e.fragmentShaderSource??UG,this._renderState=lo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(FT.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 FT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});FT.VERTEX_FORMAT=De.POSITION_AND_ST;FT.prototype.getFragmentShaderSource=lo.prototype.getFragmentShaderSource;FT.prototype.isTranslucent=lo.prototype.isTranslucent;FT.prototype.getRenderState=lo.prototype.getRenderState;var pSe=FT;function du(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??du.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??du.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??du.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??du.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??du.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new me,this._nominalFrameRate=new me,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){YIt(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(){XIt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}du.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};du.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new du({scene:e})),e._frameRateMonitor};Object.defineProperties(du.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}}});du.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};du.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};du.prototype.isDestroyed=function(){return!1};du.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ce(this)};function YIt(e,t){if(e._pauseCount>0)return;let n=Pi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Yn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Yn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Yn.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 XIt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var VG=du;var _Se=$r(t$(),1);function SQ(){this._image=new Image}SQ.prototype.isReady=function(){return!0};SQ.prototype.shouldDiscardImage=function(e){return e===this._image};function BT(e){e=e??G.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new vi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new _t(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new SQ),this._errorEvent=new me}Object.defineProperties(BT.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}}});BT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new se(`The server ${e.url} doesn't have imagery`);let n=new BT(t);return n._metadata=e,n};BT.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]}};BT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=O0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new ur({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=KIt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){NV(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=$It(f)),!l(d)&&(!l(p)||p)){let _=ZIt(f);d=_.imageType,f=_.imageData}return!l(d)||!l(f)?o:Jg({uint8Array:f,format:d,flipY:!0})})};BT.prototype.pickFeatures=function(e,t,n,i,o){};function KIt(e,t,n,i,o,r){let s=O0.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 $It(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 ZIt(e){let t=_Se.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 se("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 gSe=BT;var QIt=new H(1,1,1,.4),JIt=new H(0,1,0,.05),ePt=new H(0,.5,0,.2);function kT(e){e=e??G.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new vi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??QIt,this._glowColor=e.glowColor??JIt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??ePt,this._errorEvent=new me,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(kT.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}}});kT.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()};kT.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};kT.prototype.getTileCredits=function(e,t,n){};kT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};kT.prototype.pickFeatures=function(e,t,n,i,o){};var ySe=kT;function Gh(){}Gh._maxDecodingConcurrency=Math.max(Ft.hardwareConcurrency-1,1);Gh._decodeTaskProcessor=new hi("decodeI3S",Gh._maxDecodingConcurrency);Gh._promise=void 0;async function tPt(){if(await Gh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Gh._decodeTaskProcessor;throw new se("I3S decoder could not be initialized.")}Gh.decode=async function(e,t,n,i,o){return l(Gh._promise)||(Gh._promise=tPt()),Gh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=Z.fromRotationX(-P.PI_OVER_TWO),p=new Z;Z.multiply(d,a,p);let _=fe.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(_),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:_,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var HG=Gh;function vQ(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(vQ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});vQ.prototype.load=async function(){return this._data=await Ap.loadJson(this._resource),this._data};var GG=vQ;function cg(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(cg.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 jG(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 nPt(e){return e==="String"?1:jG(e)}async function iPt(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)}cg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=iPt(this).catch(function(e){console.error(e)}),this._loadPromise)};cg.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}};cg.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};cg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};cg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=jG(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=jG(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};cg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=nPt(i.valueType)}if(e.byteLength<t)throw new se(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};cg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new se(`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=jG(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new se(`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 se(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new se(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var WG=cg;function Z1(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(Z1.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});Z1.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var oPt=new h,rPt=new h,sPt=new h,aPt=new h,cPt=new h;function wQ(e,t,n,i){let o=h.subtract(i,n,oPt),r=h.cross(o,h.subtract(e,n,rPt),aPt),s=h.cross(o,h.subtract(t,n,sPt),cPt);return h.dot(r,s)>=0}var lPt=new h,uPt=new h,fPt=new h,dPt=new h,hPt=new h,mPt=new h,pPt=new h,_Pt=new h,gPt=new h,yPt=new h;Z1.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,Z.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let _,m,y;l(f)?(_=f[p],m=f[p+1],y=f[p+2]):(_=p*3,m=p*3+1,y=p*3+2);let x=h.fromElements(u[_*3],u[_*3+1],u[_*3+2],lPt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],uPt),T=new h(u[y*3],u[y*3+1],u[y*3+2],fPt);if(!wQ(i,x,b,T)||!wQ(i,b,x,T)||!wQ(i,T,x,b))continue;let C=h.subtract(b,x,dPt),A=h.subtract(T,x,hPt),S=h.cross(C,A,mPt);if(h.magnitude(S)===0)continue;let w=h.normalize(S,pPt),R=h.subtract(i,x,_Pt),D=Math.abs(h.dot(R,w));if(D<o){o=D,r=p;let M=h.magnitudeSquared(h.subtract(i,x,R)),L=h.magnitudeSquared(h.subtract(i,b,gPt)),g=h.magnitudeSquared(h.subtract(i,T,yPt));M<L&&M<g?(a=_,c=x,s=M):L<g?(a=m,c=b,s=L):(a=y,c=T,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function xSe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(GS(e[i])):t.push(e[i]);return t}Z1.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let C=this._parent._data.mesh.material.definition;if(C>=0&&C<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[C],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let A="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let w=this._layer._data.textureSetDefinitions[S];for(let R=0;R<w.formats.length;R++){let D=w.formats[R];if(D.format==="jpg"){A=D.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${A}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=xSe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=xSe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=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=[],_=[],m=[];u&&(p=[{sampler:0,source:0}],_=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],x=n.length;for(let T=0;T<x;T++){let C=n[T].primitives,A=C.length;for(let S=0;S<A;S++){let w=C[S];if(l(w.material)){for(;w.material>=y.length;){let D=Fe(c,!0);y.push(D)}let R=y[w.material];l(w.extra)&&w.extra.isTransparent?l(R.alphaMode)||(R.alphaMode="BLEND"):R.alphaMode==="BLEND"&&(R.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:_,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Q1=Z1;function Bc(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(Bc.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}}});Bc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new sh(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Ap.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 bSe(e,t){let n=new WG(e,t);return e._fields[t.name]=n,n.load()}Bc.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(bSe(this,i))}return Promise.all(t)};Bc.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 bSe(this,o)}return Promise.resolve()};Bc.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)};Bc.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};Bc.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 Bc(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};Bc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Q1(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 Q1(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Bc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new GG(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Bc.prototype._clearGeometryData=function(){this._geometryData=[]};Bc.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=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let T=this._dataProvider._geoidDataList[b],C=T.projection.project(n);if(C.x>T.nativeExtent.west&&C.x<T.nativeExtent.east&&C.y>T.nativeExtent.south&&C.y<T.nativeExtent.north){n.height+=CPt(C.x,C.y,T);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=r/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new fc(0,0,0),u=Et.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Pe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=Z.fromQuaternion(u),d=Z.inverse(f,new Z),p=new O(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),_=O.inverse(p,new O),m=O.clone(p);l(this._parent._globalTransform)&&O.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=_,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Bc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Bc.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 HG.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 xPt(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 bPt(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 TSe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await xPt(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(!bPt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Bc.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=TSe(this,t);e.push(n)}return Promise.all(e)};sh.prototype._hookedRequestContent=sh.prototype.requestContent;sh.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 Ee({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(()=>{TSe(e._i3sNode,n)})),e._isLoading=!1,t})}};function TPt(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 qG(e,t,n,i){let o=e+t*n;return i[o]}function CPt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=qG(s,a,n.width,n.buffer),d=qG(c,a,n.width,n.buffer),p=qG(s,u,n.width,n.buffer),_=qG(c,u,n.width,n.buffer),m=TPt(o,r,f,d,p,_);return m=m*n.scale+n.offset,m}Object.defineProperties(sh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var J1=Bc;function YG(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(YG.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function IQ(e,t){let n=[];for(let i=0;i<e.length;i++){let o=H.byteToFloat(e[i]);i<3?n.push(GS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Pv(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=IQ(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=IQ(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=IQ(a.color,a.transparency)))}break}}return n}function APt(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=Pv(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=Pv(o.symbol,t)}return n}}function EPt(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(Pv(r.symbol,t)))}return i.symbols.push(void 0),i}}YG.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=Pv(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Pv(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=APt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Pv(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=EPt(i,n))}};function CSe(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?CSe(s,t,n,i):s}}function SPt(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 vPt(e,t,n){let i=t[n],o=SPt(e.ranges,i);return e.symbols[o]}YG.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=>CSe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>vPt(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 XG=YG;function hu(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 Ee({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(hu.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}}});hu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new se(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new XG(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()};hu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};hu.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]}}};hu.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 J1(this,t,!0)}else this._rootNode=new J1(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};hu.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]})};hu._fetchJson=function(e){return e.fetchJson()};hu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=hu._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]};hu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ae.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ae.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};hu.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)?Fe(e):{},e.outlineColor=H.fromCartesian4(ie.fromArray(o))),this._tileset=await Ls.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()})};hu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};hu.prototype.filterByAttributes=function(e){this._filters=l(e)?Fe(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var Dv=hu;function KG(e,t){this._dataProvider=e,this._resource=new Ee({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(KG.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}}});KG.prototype.load=async function(){return this._data=await Ap.loadJson(this._resource),this._data};KG.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 $G=KG;function eR(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(eR.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}}});eR._fromData=async function(e,t,n,i){let o=new eR(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=eR._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ee({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Ap.loadJson(o._resource),c=new Dv(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 ZG=eR;var SSe=$r(ASe(),1);function Es(e){e=e??G.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??G.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(Es.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}}});Es.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ce(this)};Es.prototype.isDestroyed=function(){return!1};Es.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Es.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Es.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Es.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 wPt(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 ESe(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=wPt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=ZG._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 $G(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ae.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 Dv(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.`)}Es.fromUrl=async function(e,t){t=t??G.EMPTY_OBJECT;let n=Ee.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Es.loadJson(n),o=new Es(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=ESe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await ESe(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};Es._fetchJson=function(e){return e.fetchJson()};Es.loadJson=async function(e){let t=await Es._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 se(t.error)}return t};Es.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 se(`Failed to load binary: ${e.url}`);return t};Es.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 IPt=new V;function PPt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let _=V.fromElements(d,p,IPt),m=_.toString();if(!o.hasOwnProperty(m)){let y={x:_.x,y:_.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],_=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(_)}return Promise.all(f).then(function(d){let p=[];for(let _=0;_<d.length;_++){let m={tilingScheme:n,x:i[_].x,y:i[_].y,level:i[_].level},y=d[_],x="Geographic";n._projection instanceof ki&&(x="WebMercator");let b={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===Ih.LERC){let T=SSe.default.decode(y._buffer);b.buffer=T.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function DPt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await PPt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Es.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=DPt(this),this._geoidDataPromise)};Es.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ae.union(e,n,e):e=ae.clone(n)}this._extent=e};Es.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Es.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[]};Es.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 Ap=Es;var tR={};tR.createTilesetFromIModelId=async function(e,t){let{exports:n}=await ta.getExports(e);if(n.length>0&&n.every(a=>a.status===ta.ExportStatus.Invalid))throw new se(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===ta.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 Ee({url:r});return Ls.fromUrl(s,t)};tR.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await ta.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ta.RealityDataType.Cesium3DTiles,ta.RealityDataType.PNTS,ta.RealityDataType.RealityMesh3DTiles,ta.RealityDataType.Terrain3DTiles].includes(n))throw new se(`Reality data type is not a mesh type: ${n}`);let r=await ta.getRealityDataURL(e,t,i);return Ls.fromUrl(r,{maximumScreenSpaceError:4})};tR.createDataSourceForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await ta.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ta.RealityDataType.KML,ta.RealityDataType.GeoJSON].includes(n))throw new se(`Reality data type is not a data source type: ${n}`);let r=await ta.getRealityDataURL(e,t,i);return n===ta.RealityDataType.GeoJSON?tT.load(r):ES.load(r)};tR.loadGeospatialFeatures=async function(e,t,n){let i=n??1e4,o=`${ta.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ee({url:o,headers:{Authorization:ta._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return tT.load(r)};var vSe=tR;function wSe(){}Object.defineProperties(wSe.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var ISe=wSe;var RPt=/\/$/,PSe=new _t('© <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 Rv(e){e=e??G.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=Ee.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();RPt.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 _t(c))):c=PSe,this._resource=i,this._imageryProvider=new Oc({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(Rv.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}}});Rv.prototype.getTileCredits=function(e,t,n){};Rv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Rv.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Rv._defaultCredit=PSe;var DSe=Rv;function PQ(e){}PQ.prototype.isReady=function(){return!0};PQ.prototype.shouldDiscardImage=function(e){return!1};var RSe=PQ;var OPt=new _t("MapQuest, Open Street Map and contributors, CC-BY-SA");function JG(e){e=e??G.EMPTY_OBJECT;let t=Ee.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Cs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ae.southwest(a),r),u=n.positionToTileXY(ae.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??OPt;typeof d=="string"&&(d=new _t(d)),Oc.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(JG.prototype=Object.create(Oc.prototype),JG.prototype.constructor=JG);var rx=JG;var MPt=new V(1,1);function DQ(e){e=e??G.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=H.clone(e.startColor??H.WHITE),this.endColor=H.clone(e.endColor??H.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=V.clone(e.imageSize??MPt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(DQ.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var OSe=new h;DQ.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,OSe),h.add(this.position,OSe,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 nR=DQ;function MSe(e){e=e??G.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(MSe.prototype,{complete:{get:function(){return this._complete}}});var LSe=MSe;function NSe(e){}NSe.prototype.emit=function(e){he.throwInstantiationError()};var FSe=NSe;var BSe=new V(1,1);function iR(e){e=e??G.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 LG(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=O.clone(e.modelMatrix??O.IDENTITY),this._emitterModelMatrix=O.clone(e.emitterModelMatrix??O.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new O,this._startColor=H.clone(e.color??e.startColor??H.WHITE),this._endColor=H.clone(e.color??e.endColor??H.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=V.clone(e.imageSize??e.minimumImageSize??BSe),this._maximumImageSize=V.clone(e.imageSize??e.maximumImageSize??BSe),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 me,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(iR.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||!O.equals(this._modelMatrix,e),O.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!O.equals(this._emitterModelMatrix,e),O.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){H.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){H.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 LPt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new nR;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function NPt(e){let t=e._particlePool.pop();return l(t)||(t=new nR),t}function FPt(e,t){e._particlePool.push(t)}function BPt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function kPt(e){l(e._billboard)&&(e._billboard.show=!1)}function kSe(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=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new H(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function UPt(e,t){t.startColor=H.clone(e._startColor,t.startColor),t.endColor=H.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function zPt(e,t){if(e._isComplete)return 0;t=P.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+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var e5=new h;iR.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new jf),this._updateParticlePool&&(LPt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=$.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)?kSe(this,s):(kPt(s),FPt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=zPt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=O.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=NPt(this),this._emitter.emit(s),h.add(s.position,s.velocity,e5),O.multiplyByPoint(u,e5,e5),s.position=O.multiplyByPoint(u,s.position,s.position),h.subtract(e5,s.position,s.velocity),h.normalize(s.velocity,s.velocity),UPt(this,s),kSe(this,s)}if(this._billboardCollection.update(e),this._previousTime=$.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&BPt(this)};iR.prototype.isDestroyed=function(){return!1};iR.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ce(this)};var USe=iR;function of(){he.throwInstantiationError()}of.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(of.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});of.prototype.update=he.throwInstantiationError;of.prototype.beginUpdate=he.throwInstantiationError;of.prototype.endUpdate=he.throwInstantiationError;of.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;of.prototype.loadTile=he.throwInstantiationError;of.prototype.computeTileVisibility=he.throwInstantiationError;of.prototype.showTileThisFrame=he.throwInstantiationError;of.prototype.computeDistanceToTile=he.throwInstantiationError;of.prototype.isDestroyed=he.throwInstantiationError;of.prototype.destroy=he.throwInstantiationError;var zSe=of;function RQ(e){e=e??1,this._radius=e??1}Object.defineProperties(RQ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});RQ.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.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=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var VSe=RQ;function oR(){}oR.prototype.evaluate=function(e,t){he.throwInstantiationError()};oR.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};oR.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};oR.prototype.getVariables=function(){he.throwInstantiationError()};var HSe=oR;function Ov(e){this._ready=!1,this._provider=void 0,this._errorEvent=new me,this._readyEvent=new me,HPt(this,e)}Object.defineProperties(Ov.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}}});Ov.fromWorldTerrain=function(e){return new Ov(OS(e))};Ov.fromWorldBathymetry=function(e){return new Ov(LV(e))};function VPt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function HPt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){VPt(e._errorEvent,i)}}var t5=Ov;function Mv(){}Mv.prototype.boundingVolume=void 0;Mv.prototype.boundingSphere=void 0;Mv.prototype.distanceToCamera=function(e){he.throwInstantiationError()};Mv.prototype.intersectPlane=function(e){he.throwInstantiationError()};Mv.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var GSe=Mv;function rR(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new vi({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(rR.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}}});rR.prototype.getTileCredits=function(e,t,n){};rR.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)};rR.prototype.pickFeatures=function(e,t,n,i,o){};var n5=rR;function sR(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new vi({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(sR.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}}});sR.prototype.getTileCredits=function(e,t,n){};sR.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n),c=Cesium.Cartesian3.fromDegrees(a.west,a.south),u=Cesium.Cartesian3.fromDegrees(a.east,a.south),f=Cesium.Cartesian3.fromDegrees(a.west,a.north),d=Number(Cesium.Cartesian3.distance(c,u).toFixed(2)),p=Number(Cesium.Cartesian3.distance(c,f).toFixed(2)),_="m",m="m";return d>=1e3&&(d=Number((d/1e3).toFixed(2)),_="\u339E"),p>=1e3&&(p=Number((p/1e3).toFixed(2)),m="\u339E"),r.fillText(`${d} ${_}`,124,246),r.textAlign="left",r.fillText(`${p} ${m}`,14,136),Promise.resolve(o)};sR.prototype.pickFeatures=function(e,t,n,i,o){};var jSe=sR;function aR(e){e=e??G.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new vi({ellipsoid:e.ellipsoid}),this._color=e.color??H.YELLOW,this._errorEvent=new me,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(aR.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}}});aR.prototype.getTileCredits=function(e,t,n){};aR.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();r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="24px Arial",r.textAlign="center",r.fillStyle=s;let a=this._tilingScheme.tileXYToNativeRectangle(e,t,n);return e%2&&t%2&&r.fillText(`${a.south<0?"S":"N"} ${Math.abs(Number(a.south.toFixed(1)))}\xB0`,124,246),!(e%2)&&!(t%2)&&(r.textAlign="left",r.fillText(`${a.west<0?"W":"E"} ${Math.abs(Number(a.west.toFixed(1)))}\xB0`,14,136)),Promise.resolve(o)};aR.prototype.pickFeatures=function(e,t,n,i,o){};var WSe=aR;function OQ(e){he.throwInstantiationError()}OQ.prototype.isReady=he.throwInstantiationError;OQ.prototype.shouldDiscardImage=he.throwInstantiationError;var qSe=OQ;var GPt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},YSe=Object.freeze(GPt);function i5(e,t){this.show=!0,l(e)||(e=new Xe),this.rectangle=Xe.clone(e),l(t)||(t=Ji.fromType(Ji.ColorType,{color:new H(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}i5.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Xe.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending: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 Be({sources:[this._material.shaderSource,RG]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Se.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};i5.prototype.isDestroyed=function(){return!1};i5.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ce(this)};var XSe=i5;function MQ(){he.throwInstantiationError()}Object.defineProperties(MQ.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},availableLevels:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});MQ.prototype.requestData=function(e){he.throwInstantiationError()};var KSe=MQ;function UT(){he.throwInstantiationError()}Object.defineProperties(UT.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});UT.prototype.update=he.throwInstantiationError;UT.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;UT.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;UT.DefaultMinBounds=he.throwInstantiationError;UT.DefaultMaxBounds=he.throwInstantiationError;var $Se=UT;var ZSe=`uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates)); - z_window = czm_reverseLogDepth(z_window); - float n_range = czm_depthRange.near; - float f_range = czm_depthRange.far; - float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); - float scale = pow(z_ndc * 0.5 + 0.5, 8.0); - out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); -} -`;function jPt(e){e=e??G.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??je.RGBA,this.pixelDatatype=e.pixelDatatype??He.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=Ee.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?sn.REPEAT:sn.CLAMP_TO_EDGE;this.sampler=new zt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var QSe=jPt;var WPt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},JSe=Object.freeze(WPt);var qPt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},eve=Object.freeze(qPt);function YPt(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: ${Y_(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 tve=YPt;function zT(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1;let t=this;this._readyPromise=new Promise((n,i)=>{t._completeLoadFromCache=o=>{LQ(this),this._texture=o,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,n()},t._failLoad=o=>{i(o)},t._completeLoad=()=>{this._ready=!0,n()}})}Object.defineProperties(zT.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});zT.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var XPt=new h(1,0,0),KPt=new h(0,0,1),$Pt=new h(-1,0,0),ZPt=new h(0,0,-1),o5=new h(0,1,0),QPt=new h(0,-1,0),ove=[o5,$Pt,KPt,QPt,XPt,o5,ZPt,o5,o5],rve=ove.length,sve=new Float32Array(rve*3),nve=0;for(let e=0;e<rve;++e,nve+=3)h.pack(ove[e],sve,nve);var JPt=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),eDt=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function tDt(e){let t=st.createVertexBuffer({context:e,typedArray:JPt,usage:Ne.STATIC_DRAW}),n=st.createVertexBuffer({context:e,typedArray:sve,usage:Ne.STATIC_DRAW}),i=st.createIndexBuffer({context:e,typedArray:eDt,usage:Ne.STATIC_DRAW,indexDatatype:ke.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:K.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:K.FLOAT}];return new qn({context:e,attributes:o,indexBuffer:i})}function ive(e){return function(){return e}}function LQ(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(l(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}zT.prototype.update=function(e){let t=e.context;if(!zT.isSupported(t)||(l(this._texture)&&l(this._va)&&LQ(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let _=e.context.textureCache.getTexture(this._url);l(_)&&this._completeLoadFromCache(_)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let _=this;fa(this._url).then(function(m){_._cubeMapBuffers=m,_._loading=!1}).catch(function(m){_._failLoad(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;l(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT;let r=je.RGBA,s=new Be({defines:i,sources:[PG]});this._va=tDt(t),this._sp=Xt.fromCache({context:t,vertexShaderSource:DG,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),u=this._mipTextures=new Array(a),f=n[0].positiveX.width*2,d={originalSize:function(){return f}};for(let _=0;_<a;++_){let m=n[_].positiveY;n[_].positiveY=n[_].negativeY,n[_].negativeY=m;let y=c[_]=new fr({context:t,source:n[_],pixelDatatype:o}),x=c[_].width*2,b=u[_]=new dt({context:t,width:x,height:x,pixelDatatype:o,pixelFormat:r}),T=new Fa({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:ive(y)},outputTexture:b,persists:!0,owner:this});e.commandList.push(T),d[`texture${_}`]=ive(b)}this._texture=new dt({context:t,width:f*1.5+2,height:f,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new Fa({fragmentShaderSource:IG,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._completeLoad()};zT.prototype.isDestroyed=function(){return!1};zT.prototype.destroy=function(){return LQ(this),this._texture=this._texture&&this._texture.destroy(),ce(this)};var Lv=zT;function cR(e){e=Oe(e,Oe.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?V.clone(e.imageBasedLightingFactor):new V(1,1);this._imageBasedLightingFactor=t;let n=Oe(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=V.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i}Object.defineProperties(cR.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=V.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},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._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||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}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function nDt(e,t){if(Lv.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new Lv(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,n.readyPromise.then(function(){e._specularEnvironmentMapLoaded=!0}).catch(function(i){console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}cR.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;V.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=V.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),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._specularEnvironmentMapAtlasDirty&&(nDt(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);let o=!l(this._specularEnvironmentMapAtlas)&&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._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};cR.prototype.isDestroyed=function(){return!1};cR.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),ce(this)};var r5=cR;function iDt(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var xo=iDt;function $t(){}$t.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}}};$t.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}}};$t.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?$t.objectLegacy(i,n):$t.object(i,n)};$t.accessor=function(e,t){return $t.topLevel(e,"accessors",t)};$t.accessorWithSemantic=function(e,t,n){let i={};return $t.mesh(e,function(o){return $t.meshPrimitive(o,function(r){let s=$t.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:$t.meshPrimitiveTarget(r,function(a){return $t.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};$t.accessorContainingVertexAttributeData=function(e,t){let n={};return $t.mesh(e,function(i){return $t.meshPrimitive(i,function(o){let r=$t.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:$t.meshPrimitiveTarget(o,function(s){return $t.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};$t.accessorContainingIndexData=function(e,t){let n={};return $t.mesh(e,function(i){return $t.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}})})};$t.animation=function(e,t){return $t.topLevel(e,"animations",t)};$t.animationChannel=function(e,t){let n=e.channels;return $t.object(n,t)};$t.animationSampler=function(e,t){let n=e.samplers;return $t.object(n,t)};$t.buffer=function(e,t){return $t.topLevel(e,"buffers",t)};$t.bufferView=function(e,t){return $t.topLevel(e,"bufferViews",t)};$t.camera=function(e,t){return $t.topLevel(e,"cameras",t)};$t.image=function(e,t){return $t.topLevel(e,"images",t)};$t.material=function(e,t){return $t.topLevel(e,"materials",t)};$t.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}};$t.mesh=function(e,t){return $t.topLevel(e,"meshes",t)};$t.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}}};$t.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}};$t.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}}};$t.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}};$t.node=function(e,t){return $t.topLevel(e,"nodes",t)};$t.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=$t.nodeInTree(e,u,n),l(c)))return c}}}};$t.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return $t.nodeInTree(e,i,n)};$t.program=function(e,t){return xo(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.programs,t):$t.topLevel(e,"programs",t)};$t.sampler=function(e,t){return $t.topLevel(e,"samplers",t)};$t.scene=function(e,t){return $t.topLevel(e,"scenes",t)};$t.shader=function(e,t){return xo(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.shaders,t):$t.topLevel(e,"shaders",t)};$t.skin=function(e,t){return $t.topLevel(e,"skins",t)};$t.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}}};$t.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}};$t.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}};$t.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}};$t.technique=function(e,t){return xo(e,"KHR_techniques_webgl")?$t.object(e.extensions.KHR_techniques_webgl.techniques,t):$t.topLevel(e,"techniques",t)};$t.texture=function(e,t){return $t.topLevel(e,"textures",t)};var Ce=$t;function oDt(e,t,n){if(n=Oe(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Do=oDt;function rDt(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 mu=rDt;function sDt(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 K.getSizeInBytes(t.componentType)*mu(t.type)}var rf=sDt;function aDt(e){Ce.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=Oe(n.byteOffset,0))}),Ce.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=Oe(n.byteOffset,0))}),Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){if(i.mode=Oe(i.mode,q.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Do(e.materials,o)}})}),Ce.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=Oe(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=rf(e,i),r.target=q.ARRAY_BUFFER}}),Ce.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=q.ELEMENT_ARRAY_BUFFER}}),Ce.material(e,function(n){let i=Oe(n.extensions,Oe.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=Oe(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=Oe(u.shininess,0))),o.transparent=Oe(o.transparent,!1),o.doubleSided=Oe(o.doubleSided,!1);return}n.emissiveFactor=Oe(n.emissiveFactor,[0,0,0]),n.alphaMode=Oe(n.alphaMode,"OPAQUE"),n.doubleSided=Oe(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=Oe(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Ce.materialValue(n,function(c){l(c.index)&&VT(c)}),VT(n.emissiveTexture),VT(n.normalTexture),VT(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=Oe(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=Oe(s.metallicFactor,1),s.roughnessFactor=Oe(s.roughnessFactor,1),VT(s.baseColorTexture),VT(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=Oe(a.diffuseFactor,[1,1,1,1]),a.specularFactor=Oe(a.specularFactor,[1,1,1]),a.glossinessFactor=Oe(a.glossinessFactor,1),VT(a.specularGlossinessTexture))}),Ce.animation(e,function(n){Ce.animationSampler(n,function(i){i.interpolation=Oe(i.interpolation,"LINEAR")})});let t=cDt(e);return Ce.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=Oe(n.translation,[0,0,0]),n.rotation=Oe(n.rotation,[0,0,0,1]),n.scale=Oe(n.scale,[1,1,1])):n.matrix=Oe(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Ce.sampler(e,function(n){n.wrapS=Oe(n.wrapS,q.REPEAT),n.wrapT=Oe(n.wrapT,q.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function cDt(e){let t={};return Ce.animation(e,function(n){Ce.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 VT(e){l(e)&&(e.texCoord=Oe(e.texCoord,0))}var ave=aDt;function lDt(e){return Ce.shader(e,function(t){s5(t)}),Ce.buffer(e,function(t){s5(t)}),Ce.image(e,function(t){s5(t)}),s5(e),e}function s5(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var lR=lDt;function uDt(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 cve=uDt;function fDt(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),cve(e,t),n.length===0&&delete e.extensionsUsed}}var a5=fDt;var dDt=4;function hDt(e){if(Hl(e)!=="glTF")throw new se("File is not valid binary glTF");let n=lve(e,0,5),i=n[1];if(i!==1&&i!==2)throw new se("Binary glTF version is not 1 or 2");return i===1?mDt(e,n):pDt(e,n)}function lve(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*dDt,!0);return o}function mDt(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new se("Binary glTF scene format is not JSON");let r=20,s=r+i,a=ha(e,r,i),c=JSON.parse(a);lR(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=Oe(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return a5(c,"KHR_binary_glTF"),c}function pDt(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=lve(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=ha(u);o=JSON.parse(f),lR(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var NQ=hDt;function _Dt(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Do(n,t,!0)}var lg=_Dt;function gDt(e){switch(e){case K.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case K.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case K.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case K.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 K.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case K.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 K.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case K.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var c5=gDt;function yDt(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=mu(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,_=rf(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,x=K.getSizeInBytes(y),b=new DataView(d.buffer),T=new Array(r),C=c5(y);for(let A=0;A<p;A++){C(b,m,r,x,T);for(let S=0;S<r;S++){let w=T[S];s[S]=Math.min(s[S],w),a[S]=Math.max(a[S],w)}m+=_}return{min:s,max:a}}var l5=yDt;var xDt=[q.FUNC_ADD,q.FUNC_ADD],bDt=[q.ONE,q.ZERO,q.ONE,q.ZERO];function uve(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var TDt=[q.ZERO,q.ONE,q.SRC_COLOR,q.ONE_MINUS_SRC_COLOR,q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA,q.DST_ALPHA,q.ONE_MINUS_DST_ALPHA,q.DST_COLOR,q.ONE_MINUS_DST_COLOR];function CDt(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(TDt.indexOf(e[n])===-1)return t;return e}function ADt(e){let t={},n={},i=e.techniques;return l(i)&&(Ce.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(uve(s,q.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:Oe(c.blendEquationSeparate,xDt),blendFactors:CDt(c.blendFuncSeparate,bDt)})}uve(s,q.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),lg(e,"KHR_blend")),Ce.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Ce.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 fve=ADt;function EDt(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Do(n,t,!0),lg(e,t)}var dve=EDt;function SDt(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ce.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ce.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ce.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[d.fragmentShader];p.fragmentShader=Do(r.shaders,_,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Do(r.shaders,m,!0),u.program=Do(r.programs,p),o[a.program]=u.program}i[c]=Do(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,lg(e,"KHR_techniques_webgl"),dve(e,"KHR_techniques_webgl"))}return Ce.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Ce.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var hve=SDt;function vDt(e,t){co.typeOf.object("material",e),co.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,u=r.values.specular;if(l(s)&&l(s.index)){let f=t(s.index,s);if(l(f))return f}if(l(a)&&l(a.index)){let f=t(a.index,a);if(l(f))return f}if(l(c)&&l(c.index)){let f=t(c.index,c);if(l(f))return f}if(l(u)&&l(u.index)){let f=t(u.index,u);if(l(f))return f}}}let i=Ce.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var FQ=vDt;var mve=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function wDt(e,t){return t=Oe(t,mve),mve.forEach(function(n){t.indexOf(n)>-1&&PDt(e,n)}),e}var IDt={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function PDt(e,t){let n=IDt[t],i=e[n];if(l(i)){let o=0,r=Sp[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Ep[t](e,a-o),o++)}}function Ep(){}Ep.accessor=function(e,t){e.accessors.splice(t,1),Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){Ce.meshPrimitiveAttribute(o,function(s,a){s>t&&o.attributes[a]--}),Ce.meshPrimitiveTarget(o,function(s){Ce.meshPrimitiveTargetAttribute(s,function(a,c){a>t&&s[c]--})});let r=o.indices;l(r)&&r>t&&o.indices--})}),Ce.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ce.animation(e,function(i){Ce.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Ep.buffer=function(e,t){e.buffers.splice(t,1),Ce.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--})};Ep.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ce.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ce.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ce.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),xo(e,"KHR_draco_mesh_compression")&&Ce.mesh(e,function(i){Ce.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--})}),xo(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(xo(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Ep.image=function(e,t){e.images.splice(t,1),Ce.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})};Ep.mesh=function(e,t){e.meshes.splice(t,1),Ce.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Ep.node=function(e,t){e.nodes.splice(t,1),Ce.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})}),Ce.animation(e,function(i){Ce.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Ce.technique(e,function(i){Ce.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Ce.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}))}),Ce.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Ep.material=function(e,t){e.materials.splice(t,1),Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Ep.sampler=function(e,t){e.samplers.splice(t,1),Ce.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Ep.texture=function(e,t){if(e.textures.splice(t,1),Ce.material(e,function(i){FQ(i,function(o,r){r.index>t&&--r.index})}),xo(e,"EXT_feature_metadata")){Ce.mesh(e,function(r){Ce.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let _=u[d].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(xo(e,"EXT_mesh_features")&&Ce.mesh(e,function(i){Ce.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),xo(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Sp(){}Sp.accessor=function(e){let t={};return Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){Ce.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Ce.meshPrimitiveTarget(i,function(r){Ce.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Ce.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ce.animation(e,function(n){Ce.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),xo(e,"EXT_mesh_gpu_instancing")&&Ce.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})}),t};Sp.buffer=function(e){let t={};return Ce.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};Sp.bufferView=function(e){let t={};if(Ce.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ce.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ce.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),xo(e,"KHR_draco_mesh_compression")&&Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),xo(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(xo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Sp.image=function(e){let t={};return Ce.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};Sp.mesh=function(e){let t={};return Ce.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 pve(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!pve(e,o,n)}).length===0}Sp.node=function(e){let t={};return Ce.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ce.skinJoint(n,function(i){t[i]=!0})}),Ce.animation(e,function(n){Ce.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ce.technique(e,function(n){Ce.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ce.node(e,function(n,i){pve(e,i,t)||(t[i]=!0)}),t};Sp.material=function(e){let t={};return Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Sp.texture=function(e){let t={};if(Ce.material(e,function(n){FQ(n,function(i){t[i]=!0})}),xo(e,"EXT_feature_metadata")){Ce.mesh(e,function(o){Ce.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(xo(e,"EXT_mesh_features")&&Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),xo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Sp.sampler=function(e){let t={};return Ce.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var _ve=wDt;function DDt(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Do(e.buffers,n),byteOffset:0,byteLength:t.length};return Do(e.bufferViews,o)}var gve=DDt;function RDt(e,t){let n=rf(e,t),i=K.getSizeInBytes(t.componentType),o=mu(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=c5(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,d);for(let m=0;m<o;++m)s[_*o+m]=d[m];u+=n}return s}var yve=RDt;function ODt(e){let t;return Ce.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?u5(e,i,K.UNSIGNED_BYTE):t!==q.UNSIGNED_BYTE&&t!==q.UNSIGNED_SHORT&&u5(e,i,K.UNSIGNED_SHORT)}),Ce.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===q.BYTE?u5(e,i,K.UNSIGNED_BYTE):t===q.SHORT&&u5(e,i,K.UNSIGNED_SHORT)}),e}function u5(e,t,n){let i=K.createTypedArray(n,yve(e,t)),o=new Uint8Array(i.buffer);t.bufferView=gve(e,o),t.componentType=n,t.byteOffset=0}var xve=ODt;function MDt(e,t){return a5(e,t),t==="CESIUM_RTC"&&LDt(e),BQ(e,t)}function LDt(e){Ce.technique(e,function(t){Ce.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function BQ(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)BQ(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)&&BQ(e[o],t);return i}}var f5=MDt;var d5={.8:zDt,"1.0":a1t,"2.0":void 0};function NDt(e,t){t=Oe(t,Oe.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=Oe(e.asset,{version:"1.0"}),e.asset.version=Oe(e.asset.version,"1.0"),i=Oe(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(d5,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(d5,i)||(i="1.0"));let o=d5[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=d5[i];return t.keepLegacyExtensions||(u1t(e),f1t(e)),e}function Tve(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 FDt(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=Oe(a.primitive,q.TRIANGLES);a.mode=Oe(a.mode,c),delete a.primitive}}}}function BDt(e){let t=e.nodes,n=new h,i=new Pe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Pe.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 kDt(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Pe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let y=f[m];if(y.target.path==="rotation"){let x=d[p[y.sampler].output];if(l(r[x]))continue;r[x]=!0;let b=n[x],T=i[b.bufferView],A=o[T.buffer].extras._pipeline.source,S=A.byteOffset+T.byteOffset+b.byteOffset,w=b.componentType,R=b.count,D=mu(b.type),M=b.count*D,L=K.createArrayBufferView(w,A.buffer,S,M);for(let g=0;g<R;g++){let E=g*D;h.unpack(L,E,s);let v=L[E+3];Pe.fromAxisAngle(s,v,a),Pe.pack(a,L,E)}}}}}}function UDt(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=Oe(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=Oe(i.attributes,a.attributes),i.program=Oe(i.program,a.program),i.uniforms=Oe(i.uniforms,a.uniforms),i.states=Oe(i.states,s.states)}delete i.passes,delete i.pass}}}function zDt(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,Tve(e),FDt(e),BDt(e),kDt(e),UDt(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=Oe(e.extensions,{});e.extensions=n;let i=Oe(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,lg(e,"KHR_materials_common")}}function VDt(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 bve(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 HDt(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]=bve(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]),Ce.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ce.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ce.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}}),Ce.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ce.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ce.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]})})}),Ce.mesh(e,function(s){Ce.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ce.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ce.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Do(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ce.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Ce.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]]}}),Ce.animation(e,function(s){let a={};s.samplers=bve(s.samplers,a),Ce.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ce.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ce.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ce.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ce.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ce.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}}),Ce.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function GDt(e){Ce.animation(e,function(t){Ce.animationSampler(t,function(n){delete n.name})})}function jDt(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]}Ce.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function WDt(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var qDt={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function YDt(e){let t=e.extensionsUsed;if(e.extensionsRequired=Oe(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(qDt[o])&&e.extensionsRequired.push(o)}}}function XDt(e){Ce.buffer(e,function(t){delete t.type})}function KDt(e){Ce.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function $Dt(e){Ce.mesh(e,function(t){Ce.meshPrimitive(t,function(n){Ce.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})}),Ce.technique(e,function(t){Ce.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var ZDt={POSITION:!0,NORMAL:!0,TANGENT:!0},QDt={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function JDt(e){let t={};Ce.mesh(e,function(n){Ce.meshPrimitive(n,function(i){Ce.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=QDt[a];l(f)?(u=f+c,t[r]=u):l(ZDt[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Ce.technique(e,function(n){Ce.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function e1t(e){Ce.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 kQ(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:rf(e,t)}function t1t(e){Ce.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ce.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=kQ(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(Oe(i.byteLength,0),r)}})}function n1t(e){let t,n,i,o=e.bufferViews,r={};Ce.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Ce.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=Oe(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,_){return p.byteOffset-_.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],_=kQ(e,p),m=p.byteOffset,y=p.count*_;delete p.byteStride;let x=t<d-1,b=x?kQ(e,c[t+1]):void 0;if(_!==b){let T=Fe(i,!0);r[a]&&(T.byteStride=_),T.byteOffset+=u,T.byteLength=m+y-u;let C=Do(o,T);for(n=f;n<=t;++n)p=c[n],p.bufferView=C,p.byteOffset=p.byteOffset-u;u=x?c[t+1].byteOffset:void 0,f=t+1}}}_ve(e,["accessor","bufferView","buffer"])}function i1t(e){Ce.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=l5(e,n);n.min=i.min,n.max=i.max}})}function Cve(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||O.fromColumnMajorArray(e.matrix).equals(O.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Ave(e,t){Ce.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}}}),Ce.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Cve(n)&&Ave(e,i))}}),delete e.nodes[t]}function o1t(e){return Ce.node(e,function(t,n){Cve(t)&&Ave(e,n)}),e}function r1t(e){Ce.animation(e,function(t){Ce.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=l5(e,i);i.min=o.min,i.max=o.max}})})}function s1t(e){Ce.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=l5(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function a1t(e){e.asset=Oe(e.asset,{}),e.asset.version="2.0",Tve(e),VDt(e),o1t(e),HDt(e),GDt(e),WDt(e),YDt(e),t1t(e),n1t(e),i1t(e),r1t(e),s1t(e),XDt(e),KDt(e),$Dt(e),JDt(e),xve(e),e1t(e),fve(e),hve(e),jDt(e)}var c1t=["u_tex","u_diffuse","u_emission"],l1t=["u_diffuse"];function UQ(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function h5(e){return l(e.index)}function m5(e){return Array.isArray(e)&&e.length===4}function Eve(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 u1t(e){Ce.material(e,function(t){Ce.materialValue(t,function(n,i){c1t.indexOf(i)!==-1&&h5(n)?(UQ(t),t.pbrMetallicRoughness.baseColorTexture=n):l1t.indexOf(i)!==-1&&m5(n)&&(UQ(t),t.pbrMetallicRoughness.baseColorFactor=Eve(n))})}),f5(e,"KHR_techniques_webgl"),f5(e,"KHR_blend")}function f1t(e){Ce.material(e,function(t){let n=Oe(t.extensions,Oe.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(lg(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,u=n.doubleSided,f=n.transparent;UQ(t),l(r)&&(m5(r)?t.emissiveFactor=r.slice(0,3):h5(r)&&(t.emissiveTexture=r)),l(s)&&(m5(s)?t.pbrMetallicRoughness.baseColorFactor=Eve(s):h5(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(u)&&(t.doubleSided=u),l(a)&&(m5(a)?t.emissiveFactor=a.slice(0,3):h5(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(f)&&(t.alphaMode=f?"BLEND":"OPAQUE")}}),f5(e,"KHR_materials_common")}var Sve=NDt;var ug={X:0,Y:1,Z:2};ug.Y_UP_TO_Z_UP=O.fromRotationTranslation(Z.fromRotationX(P.PI_OVER_TWO));ug.Z_UP_TO_Y_UP=O.fromRotationTranslation(Z.fromRotationX(-P.PI_OVER_TWO));ug.X_UP_TO_Z_UP=O.fromRotationTranslation(Z.fromRotationY(-P.PI_OVER_TWO));ug.Z_UP_TO_X_UP=O.fromRotationTranslation(Z.fromRotationY(P.PI_OVER_TWO));ug.X_UP_TO_Y_UP=O.fromRotationTranslation(Z.fromRotationZ(P.PI_OVER_TWO));ug.Y_UP_TO_X_UP=O.fromRotationTranslation(Z.fromRotationZ(-P.PI_OVER_TWO));ug.fromName=function(e){return ug[e]};var Za=Object.freeze(ug);var d1t={ADD:q.FUNC_ADD,SUBTRACT:q.FUNC_SUBTRACT,REVERSE_SUBTRACT:q.FUNC_REVERSE_SUBTRACT,MIN:q.MIN,MAX:q.MAX},HT=Object.freeze(d1t);var h1t={ZERO:q.ZERO,ONE:q.ONE,SOURCE_COLOR:q.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:q.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:q.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:q.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:q.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:q.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:q.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:q.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:q.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:q.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:q.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:q.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:q.SRC_ALPHA_SATURATE},sf=Object.freeze(h1t);var m1t={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:HT.ADD,equationAlpha:HT.ADD,functionSourceRgb:sf.SOURCE_ALPHA,functionSourceAlpha:sf.ONE,functionDestinationRgb:sf.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:sf.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:HT.ADD,equationAlpha:HT.ADD,functionSourceRgb:sf.ONE,functionSourceAlpha:sf.ONE,functionDestinationRgb:sf.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:sf.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:HT.ADD,equationAlpha:HT.ADD,functionSourceRgb:sf.SOURCE_ALPHA,functionSourceAlpha:sf.ONE,functionDestinationRgb:sf.ONE,functionDestinationAlpha:sf.ONE})},zQ=Object.freeze(m1t);function Nv(e,t){this._distance=t,this._normal=new vve(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(Nv.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});Nv.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new Nv(e.normal,e.distance),t};Nv.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new Nv(e.normal,e.distance)};function vve(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(vve.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 p5=Nv;function kc(e){e=Oe(e,Oe.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=Oe(e.enabled,!0),this.modelMatrix=O.clone(Oe(e.modelMatrix,O.IDENTITY)),this.edgeColor=H.clone(Oe(e.edgeColor,H.WHITE)),this.edgeWidth=Oe(e.edgeWidth,0),this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=Oe(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Rve:Ove,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 Rve(e){return e===Gt.OUTSIDE}function Ove(e){return e===Gt.INSIDE}Object.defineProperties(kc.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?Rve:Ove)}},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 wve(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}kc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){wve(n,i)},e.index=t,wve(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};kc.prototype.get=function(e){return this._planes[e]};function Mve(e,t){let n=e.length;for(let i=0;i<n;++i)if(en.equals(e[i],t))return i;return-1}kc.prototype.contains=function(e){return Mve(this._planes,e)!==-1};kc.prototype.remove=function(e){let t=this._planes,n=Mve(t,e);if(n===-1)return!1;e instanceof p5&&(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 p5&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};kc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof p5&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var p1t=new ie,_1t=new ie;function Ive(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Mn.octEncodeToCartesian4(a.normal,_1t);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(a.distance,p1t);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function Pve(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 Lve(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var g1t=new V;kc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=kc.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=Lve(o,g1t);s.y*=2,i?(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.FLOAT,sampler:zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new dt({context:n,width:s.x,height:s.y,pixelFormat:je.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:zt.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?(Pve(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Ive(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),Pve(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),Ive(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 y1t=new O,Dve=new en(h.UNIT_X,0);kc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=O.multiply(t,o,y1t));let r=Gt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Gt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];en.transform(a,o,Dve);let c=e.intersectPlane(Dve);if(c===Gt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};kc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};kc.useFloatTexture=function(e){return e.floatingPointTexture};kc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=kc.useFloatTexture(t)?e.length:e.length*2,r=Lve(o,n);return r.y*=2,r};kc.prototype.isDestroyed=function(){return!1};kc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ce(this)};var uR=kc;var fR={HIGHLIGHT:0,REPLACE:1,MIX:2};fR.getColorBlend=function(e,t){if(e===fR.HIGHLIGHT)return 0;if(e===fR.REPLACE)return 1;if(e===fR.MIX)return P.clamp(t,P.EPSILON4,1)};var _5=Object.freeze(fR);var x1t={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},Nve=Object.freeze(x1t);function Ni(){}Ni._maxDecodingConcurrency=Math.max(Ft.hardwareConcurrency-1,1);Ni._decoderTaskProcessor=void 0;Ni._taskProcessorReady=!1;Ni._getDecoderTaskProcessor=function(){if(!l(Ni._decoderTaskProcessor)){let e=new hi("decodeDraco",Ni._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Ni._taskProcessorReady=!0}),Ni._decoderTaskProcessor=e}return Ni._decoderTaskProcessor};Ni.hasExtension=function(e){return l(e.extensionsRequired.KHR_draco_mesh_compression)||l(e.extensionsUsed.KHR_draco_mesh_compression)};function Bve(e,t){let n=`runtime.${Object.keys(e.createdBufferViews).length}`,i=e.buffers,o=Object.keys(i).length;return i[o]=t,e.createdBufferViews[n]={buffer:o,byteOffset:0,byteLength:t.byteLength},n}function b1t(e,t,n){let i=t._loadResources,o=Bve(i,e);return i.vertexBuffersToCreate.enqueue(o),o}function T1t(e,t,n){let i=e.typedArray,o=t._loadResources,r=Bve(o,i);return o.indexBuffersToCreate.enqueue({id:r,componentType:K.fromTypedArray(i)}),{bufferViewId:r,numberOfIndices:e.numberOfIndices}}function Fve(e,t,n,i){if(!Ni._taskProcessorReady)return;let o=n.primitivesToDecode.peek();if(!l(o))return;let r=e.scheduleTask(o,[o.array.buffer]);if(l(r))return n.activeDecodingTasks++,n.primitivesToDecode.dequeue(),r.then(function(s){n.activeDecodingTasks--;let a=T1t(s.indexArray,t,i),c={},u=s.attributeData;for(let f in u)if(u.hasOwnProperty(f)){let d=u[f],p=d.array,_=b1t(p,t,i),m=d.data;m.bufferView=_,c[f]=m}t._decodedData[`${o.mesh}.primitive.${o.primitive}`]={bufferView:a.bufferViewId,numberOfIndices:a.numberOfIndices,attributes:c}})}Ni._decodedModelResourceCache=void 0;Ni.parse=function(e,t){if(!Ni.hasExtension(e))return;let n=e._loadResources,i=e.cacheKey;if(l(i)){l(Ni._decodedModelResourceCache)||(l(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),Ni._decodedModelResourceCache=t.cache.modelDecodingCache);let s=Ni._decodedModelResourceCache[i];if(l(s)){s.count++,n.pendingDecodingCache=!0;return}}let o=e._dequantizeInShader,r=e.gltfInternal;Ce.mesh(r,function(s,a){Ce.meshPrimitive(s,function(c,u){if(!l(c.extensions))return;let f=c.extensions.KHR_draco_mesh_compression;if(!l(f))return;let d=r.bufferViews[f.bufferView],_=r.buffers[d.buffer].extras._pipeline.source.slice(d.byteOffset,d.byteOffset+d.byteLength);n.primitivesToDecode.enqueue({mesh:a,primitive:u,array:_,bufferView:d,compressedAttributes:f.attributes,dequantizeInShader:o})})})};Ni.decodeModel=function(e,t){if(!Ni.hasExtension(e))return Promise.resolve();let n=e._loadResources,i=e.cacheKey;if(l(i)&&l(Ni._decodedModelResourceCache)){let a=Ni._decodedModelResourceCache[i];if(l(a)&&n.pendingDecodingCache)return Promise.resolve(a.ready).then(function(){e._decodedData=a.data,n.pendingDecodingCache=!1});Ni._decodedModelResourceCache[i]={ready:!1,count:1,data:void 0}}if(n.primitivesToDecode.length===0)return Promise.resolve();let o=Ni._getDecoderTaskProcessor(),r=[],s=Fve(o,e,n,t);for(;l(s);)r.push(s),s=Fve(o,e,n,t);return Promise.all(r)};Ni.decodePointCloud=function(e){let t=Ni._getDecoderTaskProcessor();if(Ni._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Ni.decodeBufferView=function(e){let t=Ni._getDecoderTaskProcessor();if(Ni._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};Ni.cacheDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Ni._decodedModelResourceCache)){let n=Ni._decodedModelResourceCache[t];l(n)&&(n.ready=!0,n.data=e._decodedData)}};Ni.destroyCachedDataForModel=function(e){let t=e.cacheKey;if(l(t)&&l(Ni._decodedModelResourceCache)){let n=Ni._decodedModelResourceCache[t];l(n)&&--n.count===0&&delete Ni._decodedModelResourceCache[t]}};var Fv=Ni;function C1t(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) - { - gl_FragColor = clippingPlanesEdgeColor; - } -`}var kve=C1t;var A1t=new V;function E1t(e,t){let n=e.unionClippingRegions,i=e.length,o=uR.useFloatTexture(t),r=uR.getTextureResolution(e,t,A1t),s=r.x,a=r.y,c=o?w1t(s,a):I1t(s,a);return c+=` -`,c+=n?S1t(i):v1t(i),c}function S1t(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 v1t(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 w1t(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 = texture2D(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -`}function I1t(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 = texture2D(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(texture2D(packedClippingPlanes, vec2(u + ${o}, v))); - return czm_transformPlane(plane, transform); -} -`}var Uve=E1t;var P1t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},Bv=Object.freeze(P1t);var D1t={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},dR=Object.freeze(D1t);var ao={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};ao.getMathType=function(e){switch(e){case ao.SCALAR:return Number;case ao.VEC2:return V;case ao.VEC3:return h;case ao.VEC4:return ie;case ao.MAT2:return ti;case ao.MAT3:return Z;case ao.MAT4:return O}};ao.getNumberOfComponents=function(e){switch(e){case ao.SCALAR:return 1;case ao.VEC2:return 2;case ao.VEC3:return 3;case ao.VEC4:case ao.MAT2:return 4;case ao.MAT3:return 9;case ao.MAT4:return 16}};ao.getAttributeLocationCount=function(e){switch(e){case ao.SCALAR:case ao.VEC2:case ao.VEC3:case ao.VEC4:return 1;case ao.MAT2:return 2;case ao.MAT3:return 3;case ao.MAT4:return 4}};ao.getGlslType=function(e){switch(e){case ao.SCALAR:return"float";case ao.VEC2:return"vec2";case ao.VEC3:return"vec3";case ao.VEC4:return"vec4";case ao.MAT2:return"mat2";case ao.MAT3:return"mat3";case ao.MAT4:return"mat4"}};var GT=Object.freeze(ao);function g5(){}var R1t=/^data\:/i;function Gve(e,t){let n=e.gltfInternal,i=n.buffers,r=n.bufferViews[t.bufferView],s=i[r.buffer],a=r.byteOffset+t.byteOffset,c=t.count*mu(t.type),u=R1t.test(s.uri)?"":s.uri;return`${e.cacheKey}//${u}/${a}/${c}`}var zve={};g5.getAnimationParameterValues=function(e,t){let n=Gve(e,t),i=zve[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,a=o.bufferViews[t.bufferView],c=a.buffer,f=r[c].extras._pipeline.source,d=t.componentType,p=t.type,_=mu(p),m=t.count,y=rf(o,t);i=new Array(m);let x=Oe(t.byteOffset,0),b=a.byteOffset+x;for(let T=0;T<m;T++){let C=K.createArrayBufferView(d,f.buffer,f.byteOffset+b,_);p==="SCALAR"?i[T]=C[0]:p==="VEC3"?i[T]=h.fromArray(C):p==="VEC4"&&(i[T]=Pe.unpack(C)),b+=y}l(e.cacheKey)&&(zve[n]=i)}return i};var Vve={};function O1t(e,t,n){return`${e.cacheKey}//${t}/${n}`}function kv(e){this._spline=e,this._lastTimeIndex=0}kv.prototype.findTimeInterval=to.prototype.findTimeInterval;kv.prototype.evaluate=function(e,t){let n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),i=this._spline.times,o=e>=i[n+1]?i[n+1]:i[n];return this._spline.evaluate(o,t)};Object.defineProperties(kv.prototype,{times:{get:function(){return this._spline.times}}});kv.prototype.wrapTime=function(e){return this._spline.wrapTime(e)};kv.prototype.clampTime=function(e){return this._spline.clampTime(e)};g5.getAnimationSpline=function(e,t,n,i,o,r,s,a){let c=O1t(e,t,i),u=Vve[c];if(!l(u)){let f=r,d=a;f.length===1&&d.length===1?u=new by(d[0]):(o.interpolation==="LINEAR"||o.interpolation==="STEP")&&(s==="translation"||s==="scale"?u=new Kd({times:f,points:d}):s==="rotation"?u=new Ty({times:f,points:d}):s==="weights"&&(u=new $V({times:f,weights:d})),l(u)&&o.interpolation==="STEP"&&(u=new kv(u))),l(e.cacheKey)&&(Vve[c]=u)}return u};var Hve={};g5.getSkinInverseBindMatrices=function(e,t){let n=Gve(e,t),i=Hve[n];if(!l(i)){let o=e.gltfInternal,r=o.buffers,s=o.bufferViews,a=t.bufferView,c=s[a],u=c.buffer,d=r[u].extras._pipeline.source,p=t.componentType,_=t.type,m=t.count,y=rf(o,t),x=c.byteOffset+t.byteOffset,b=mu(_);if(i=new Array(m),p===q.FLOAT&&_===GT.MAT4)for(let T=0;T<m;++T){let C=K.createArrayBufferView(p,d.buffer,d.byteOffset+x,b);i[T]=O.fromArray(C),x+=y}Hve[n]=i}return i};var hR=g5;var M1t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},jT=Object.freeze(M1t);var L1t={STOPPED:0,ANIMATING:1},sx=Object.freeze(L1t);var N1t={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},jve=Object.freeze(N1t);var lr={};function F1t(){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 B1t(){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 k1t(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function U1t(){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 z1t(){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 V1t(){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 H1t(){this.attributes=[]}function G1t(){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 j1t(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function W1t(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function q1t(){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 Y1t(){this.nodes=[]}var X1t={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function K1t(){this.input=[],this.interpolation=void 0,this.output=[]}function $1t(){this.node=void 0,this.path=void 0}function Z1t(){this.sampler=void 0,this.target=void 0}function Q1t(){this.name=void 0,this.samplers=[],this.channels=[]}function J1t(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function eRt(){this.name=void 0,this.stages=[]}function Wve(){this.credits=[]}function tRt(){this.asset=new Wve,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=O.clone(O.IDENTITY)}function nRt(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=Z.clone(Z.IDENTITY),this.channels=void 0}function ax(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(ax.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=ax.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=ax.DEFAULT_ROUGHNESS_FACTOR}ax.DEFAULT_BASE_COLOR_FACTOR=ie.ONE;ax.DEFAULT_METALLIC_FACTOR=1;ax.DEFAULT_ROUGHNESS_FACTOR=1;function WT(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(WT.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(WT.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=WT.DEFAULT_GLOSSINESS_FACTOR}WT.DEFAULT_DIFFUSE_FACTOR=ie.ONE;WT.DEFAULT_SPECULAR_FACTOR=h.ONE;WT.DEFAULT_GLOSSINESS_FACTOR=1;function VQ(){this.metallicRoughness=new ax,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(VQ.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=jve.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}VQ.DEFAULT_EMISSIVE_FACTOR=h.ZERO;lr.Quantization=F1t;lr.Attribute=B1t;lr.Indices=k1t;lr.FeatureIdAttribute=U1t;lr.FeatureIdTexture=V1t;lr.FeatureIdImplicitRange=z1t;lr.MorphTarget=H1t;lr.Primitive=G1t;lr.Instances=j1t;lr.Skin=W1t;lr.Node=q1t;lr.Scene=Y1t;lr.AnimatedPropertyType=Object.freeze(X1t);lr.AnimationSampler=K1t;lr.AnimationTarget=$1t;lr.AnimationChannel=Z1t;lr.Animation=Q1t;lr.ArticulationStage=J1t;lr.Articulation=eRt;lr.Asset=Wve;lr.Components=tRt;lr.TextureReader=nRt;lr.MetallicRoughness=ax;lr.SpecularGlossiness=WT;lr.Material=VQ;var qve=lr;var qT=qve.AnimatedPropertyType;function GQ(e){e=Oe(e,Oe.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,rRt(this)}Object.defineProperties(GQ.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 iRt(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 f_({times:e,points:n,inTangents:i,outTangents:o})}function Yve(e,t,n,i){if(e.length===1&&t.length===1)return new by(t[0]);switch(n){case rl.STEP:return new zA({times:e,points:t});case rl.CUBICSPLINE:return iRt(e,t);case rl.LINEAR:return i===qT.ROTATION?new Ty({times:e,points:t}):new Kd({times:e,points:t})}}function oRt(e,t,n,i,o){let r=[];if(i===qT.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===rl.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(Yve(e,f,n,i))}}else r.push(Yve(e,t,n,i));return r}var HQ;function rRt(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=oRt(i,o,r,a,u);switch(e._splines=f,e._path=a,a){case qT.TRANSLATION:case qT.SCALE:HQ=new h;break;case qT.ROTATION:HQ=new Pe;break;case qT.WEIGHTS:break}}GQ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===qT.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);o[n]=r.evaluate(s,HQ)}}};var Xve=GQ;function jQ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=$.clone(n.startTime),this._delay=Oe(n.delay,0),this._stopTime=$.clone(n.stopTime),this.removeOnStop=Oe(n.removeOnStop,!1),this._multiplier=Oe(n.multiplier,1),this._reverse=Oe(n.reverse,!1),this._loop=Oe(n.loop,jT.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=sx.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,sRt(this)}Object.defineProperties(jQ.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 sRt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],_=new Xve({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}jQ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var Kve=jQ;function fg(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(fg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function WQ(e,t,n){let i=e._model,o=new Kve(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}fg.prototype.add=function(e){e=Oe(e,Oe.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return WQ(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 WQ(this,n[i],e)};fg.prototype.addAll=function(e){e=Oe(e,Oe.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=WQ(this,n[r],e);i.push(s)}return i};fg.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};fg.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};fg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};fg.prototype.get=function(e){return this._runtimeAnimations[e]};var y5=[];function aRt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}fg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&$.equals(e.time,this._previousTime))return!1;this._previousTime=$.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=$.addSeconds(Oe(a.startTime,o),a.delay,new $)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=$.lessThanOrEquals(c,o),p=l(f)&&$.greaterThan(o,f),_=0;if(u!==0){let x=$.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,x):x/u}let m=a.loop===jT.REPEAT||a.loop===jT.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let x=a._state===sx.STOPPED;if(y!==x)continue}if(a._prevAnimationDelta=_,y||a._state===sx.ANIMATING){if(y&&a._state===sx.STOPPED&&(a._state=sx.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===jT.REPEAT)_=_-Math.floor(_);else if(a.loop===jT.MIRRORED_REPEAT){let b=Math.floor(_),T=_-b;_=b%2===1?1-T:T}a.reverse&&(_=1-_);let x=_*u*a.multiplier;x=P.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=sx.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&y5.push(a))}}n=y5.length;for(let s=0;s<n;++s){let a=y5[s];t.splice(t.indexOf(a),1),e.afterRender.push(aRt(this,r,a))}return y5.length=0,i};var $ve=fg;function dg(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new Wl,this.indexBuffersToCreate=new Wl,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new Wl,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new Wl,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new Wl,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new Wl,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function cRt(e,t,n){return e.subarray(t,t+n)}dg.prototype.getBuffer=function(e){return cRt(this.buffers[e.buffer],e.byteOffset,e.byteLength)};dg.prototype.finishedPendingBufferLoads=function(){return this.pendingBufferLoads===0};dg.prototype.finishedBuffersCreation=function(){return this.pendingBufferLoads===0&&this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0};dg.prototype.finishedProgramCreation=function(){return this.pendingShaderLoads===0&&this.programsToCreate.length===0};dg.prototype.finishedTextureCreation=function(){let e=this.pendingTextureLoads===0,t=this.texturesToCreate.length===0&&this.texturesToCreateFromBufferView.length===0;return e&&t};dg.prototype.finishedEverythingButTextureCreation=function(){let e=this.pendingBufferLoads===0&&this.pendingShaderLoads===0,t=this.vertexBuffersToCreate.length===0&&this.indexBuffersToCreate.length===0&&this.programsToCreate.length===0&&this.pendingBufferViewToImage===0;return this.finishedDecoding()&&e&&t};dg.prototype.finishedDecoding=function(){return this.primitivesToDecode.length===0&&this.activeDecodingTasks===0&&!this.pendingDecodingCache};dg.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var Zve=dg;function x5(e,t,n){this._name=t.name,this._id=n,this._uniformMap=e._uniformMaps[n],this._technique=void 0,this._program=void 0,this._values=void 0}Object.defineProperties(x5.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}});x5.prototype.setValue=function(e,t){let n=`u_${e}`,i=this._uniformMap.values[n];i.value=i.clone(t,i.value)};x5.prototype.getValue=function(e){let t=`u_${e}`,n=this._uniformMap.values[t];if(l(n))return n.value};var Qve=x5;function Jve(e,t,n){let i=[],o=e.primitives,r=o.length;for(let s=0;s<r;++s){let a=o[s];i[s]=t[a.material]}this._name=e.name,this._materials=i,this._id=n}Object.defineProperties(Jve.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}});var ewe=Jve;function qQ(e,t,n,i,o){this._model=e,this._runtimeNode=n,this._name=t.name,this._id=i,this.useMatrix=!1,this._show=!0,this._matrix=O.clone(o),this._originalMatrix=O.clone(o)}Object.defineProperties(qQ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=O.clone(e,this._matrix),this.useMatrix=!0;let t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}});qQ.prototype.setMatrix=function(e){O.clone(e,this._matrix)};var twe=qQ;var lRt=65534;function mR(){}mR.hasExtension=function(e){return l(e.extensionsRequired.CESIUM_primitive_outline)||l(e.extensionsUsed.CESIUM_primitive_outline)};mR.outlinePrimitives=function(e){if(!mR.hasExtension(e))return;let t=e.gltfInternal,n=[];Ce.mesh(t,function(i,o){Ce.meshPrimitive(i,function(r,s){if(!l(r.extensions))return;let a=r.extensions.CESIUM_primitive_outline;if(!l(a))return;let c=mRt(e,r);c!==void 0&&(n.indexOf(c)<0&&n.push(c),uRt(e,o,s,a.indices,c))})});for(let i=0;i<n.length;++i)fRt(e,n[i].bufferViews);dRt(e)};mR.createTexture=function(e,t){let n=t.cache.modelOutliningCache;if(l(n)||(n=t.cache.modelOutliningCache={}),l(n.outlineTexture))return n.outlineTexture;let i=Math.min(4096,Lt.maximumTextureSize),o=i,r=iwe(o),s=[];for(;o>1;)o>>=1,s.push(iwe(o));let a=new dt({context:t,source:{arrayBufferView:r,mipLevels:s},width:i,height:1,pixelFormat:je.LUMINANCE,sampler:new zt({wrapS:sn.CLAMP_TO_EDGE,wrapT:sn.CLAMP_TO_EDGE,minificationFilter:ft.LINEAR_MIPMAP_LINEAR,magnificationFilter:Kn.LINEAR})});return n.outlineTexture=a,a};function uRt(e,t,n,i,o){let r=o.vertexCopies,s=o.extraVertices,a=o.outlineCoordinates,c=e.gltfInternal,f=c.meshes[t].primitives[n],d=c.accessors,p=c.bufferViews,_;for(let L in f.attributes)if(f.attributes.hasOwnProperty(L)){let g=f.attributes[L],E=d[g];if(l(E)){_=E.count;break}}if(!l(_))return;let m=d[f.indices],y=p[m.bufferView],x=d[i],b=p[x.bufferView],T=e._loadResources,C=T.getBuffer(y),A=T.getBuffer(b),S=m.componentType===5123?new Uint16Array(C.buffer,C.byteOffset+m.byteOffset,m.count):new Uint32Array(C.buffer,C.byteOffset+m.byteOffset,m.count),w=x.componentType===5123?new Uint16Array(A.buffer,A.byteOffset+x.byteOffset,x.count):new Uint32Array(A.buffer,A.byteOffset+x.byteOffset,x.count),R=_,D=[R],M;for(M=0;M<w.length;M+=2){let L=w[M],g=w[M+1],E=Math.min(L,g),v=Math.max(L,g);D[E*R+v]=1}for(M=0;M<S.length;M+=3){let L=S[M],g=S[M+1],E=S[M+2],v=!1,I=v||KQ(D,L,g),N=v||KQ(D,g,E),F=v||KQ(D,E,L),U=nwe(a,L,g,E,I,N,F);for(;U>=0;){let k;if(U===L?k=r[L]:U===g?k=r[g]:k=r[E],k===void 0){k=_+s.length;let z=U;for(;z>=_;)z=s[z-_];s.push(z),r[U]=k}k>lRt&&S instanceof Uint16Array&&(S=new Uint32Array(S),m.componentType=5125,y.buffer=c.buffers.push({byteLength:S.byteLength,extras:{_pipeline:{source:S.buffer}}})-1,y.byteLength=S.byteLength,y.byteOffset=0,e._loadResources.buffers[y.buffer]=new Uint8Array(S.buffer,0,S.byteLength),T.indexBuffersToCreate._array.forEach(function(z){l(z)&&z.id===m.bufferView&&(z.componentType=m.componentType)})),U===L?(L=k,S[M]=k):U===g?(g=k,S[M+1]=k):(E=k,S[M+2]=k),l(m.max)&&(m.max[0]=Math.max(m.max[0],k)),U=nwe(a,L,g,E,I,N,F)}}}function YQ(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return s===void 0?63:((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)}function XQ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function nwe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=YQ(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,_=r?1:0,m=YQ(e,n,d,p,_);if(m===0)return n;let y=s?1:0,x=0,b=r?1:0,T=YQ(e,i,y,x,b);if(T===0)return i;let C=f&m&T,A,S,w;if(C&1)A=0,S=1,w=2;else if(C&2)A=0,w=1,S=2;else if(C&4)S=0,A=1,w=2;else if(C&8)S=0,w=1,A=2;else if(C&16)w=0,A=1,S=2;else if(C&32)w=0,S=1,A=2;else{let L=XQ(f),g=XQ(m),E=XQ(T);return L<g&&L<E?t:g<E?n:i}let R=t*3;e[R+A]=a,e[R+S]=c,e[R+w]=u;let D=n*3;e[D+A]=d,e[D+S]=p,e[D+w]=_;let M=i*3;return e[M+A]=y,e[M+S]=x,e[M+w]=b,-1}function KQ(e,t,n){let i=e[0],o=Math.min(t,n)*i+Math.max(t,n);return e[o]===1}function iwe(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 fRt(e,t){let n=e.gltfInternal,i=e._loadResources,o,r;for(o=0;o<t.length;++o){let s=t[o],a=s.extras._pipeline.vertexNumberingScope;s.extras._pipeline.vertexNumberingScope=void 0;let c=a.extraVertices,u=i.getBuffer(s),f=s.byteStride||4,d=c.length,p=new Uint8Array(u.byteLength+d*f);for(p.set(u),r=0;r<d;++r){let y=c[r]*f,x=u.length+r*f;for(let b=0;b<f;++b)p[x+b]=p[y+b]}s.byteOffset=0,s.byteLength=p.byteLength;let _=n.buffers.push({byteLength:p.byteLength,extras:{_pipeline:{source:p.buffer}}})-1;s.buffer=_,i.buffers[_]=p;let m=a.accessors;for(r=0;r<m.length;++r){let y=m[r];n.accessors[y].count+=d}if(!a.createdOutlines){let y=a.outlineCoordinates,x=new Float32Array(y),b=e.gltfInternal.buffers.push({byteLength:x.byteLength,extras:{_pipeline:{source:x.buffer}}})-1;i.buffers[b]=new Uint8Array(x.buffer,0,x.byteLength);let T=e.gltfInternal.bufferViews.push({buffer:b,byteLength:x.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,C=e.gltfInternal.accessors.push({bufferView:T,byteOffset:0,componentType:5126,count:x.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,A=a.primitives;for(r=0;r<A.length;++r)A[r].attributes._OUTLINE_COORDINATES=C;i.vertexBuffersToCreate.enqueue(T),a.createdOutlines=!0}}}function dRt(e){let t=e.gltfInternal,n=e._loadResources,i;for(i=0;i<t.buffers.length;++i){let o=t.buffers[i],r=t.bufferViews.filter(hRt.bind(void 0,i)),s=r.reduce(function(u,f){return u+f.byteLength},0);if(s===o.byteLength)continue;let a=new Uint8Array(s),c=0;for(let u=0;u<r.length;++u){let f=r[u],d=n.getBuffer(f);a.set(d,c),f.byteOffset=c,c+=d.byteLength}n.buffers[i]=a,o.extras._pipeline.source=a.buffer,o.byteLength=s}}function hRt(e,t){return t.buffer===e}function mRt(e,t){let n=t.attributes;if(n===void 0)return;let i=e.gltfInternal,o;for(let r in n){if(!n.hasOwnProperty(r))continue;let s=n[r],c=i.accessors[s].bufferView,u=i.bufferViews[c];if(l(u.extras)||(u.extras={}),l(u.extras._pipeline)||(u.extras._pipeline={}),!l(u.extras._pipeline.vertexNumberingScope))u.extras._pipeline.vertexNumberingScope=o||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};else if(o!==void 0&&u.extras._pipeline.vertexNumberingScope!==o)return;o=u.extras._pipeline.vertexNumberingScope,o.bufferViews.indexOf(u)<0&&o.bufferViews.push(u),o.accessors.indexOf(s)<0&&o.accessors.push(s)}return o.primitives.push(t),o}var $Q=mR;var ji={};ji.updateForwardAxis=function(e){let t=e.gltfInternal.extras.sourceVersion;(l(t)&&t!=="2.0"||ji.getAssetVersion(e.gltfInternal)!=="2.0")&&(e._gltfForwardAxis=Za.X)};ji.getAssetVersion=function(e){return!l(e.asset)||!l(e.asset.version)?"1.0":e.asset.version};ji.splitIncompatibleMaterials=function(e){let t=e.accessors,n=e.materials,i={};return Ce.mesh(e,function(o){Ce.meshPrimitive(o,function(r){let s=r.material,a=n[s],c=r.attributes.JOINTS_0,u,f;if(l(c)){let A=t[c];u=A.componentType,f=A.type}let d=l(c)&&f==="VEC4",p=l(r.attributes.COLOR_0),_=l(r.targets),m=l(r.attributes.NORMAL),y=l(r.attributes.TANGENT),x=l(r.attributes.TEXCOORD_0),b=x&&l(r.attributes.TEXCOORD_1),T=l(r.extensions)&&l(r.extensions.CESIUM_primitive_outline),C=i[s];if(!l(C))i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:_,hasNormals:m,hasTangents:y,hasTexCoords:x,hasTexCoord1:b,hasOutline:T};else if(C.skinning.skinned!==d||C.hasVertexColors!==p||C.hasMorphTargets!==_||C.hasNormals!==m||C.hasTangents!==y||C.hasTexCoords!==x||C.hasTexCoord1!==b||C.hasOutline!==T){let A=Fe(a,!0);s=Do(n,A),r.material=s,i[s]={skinning:{skinned:d,componentType:u},hasVertexColors:p,hasMorphTargets:_,hasNormals:m,hasTangents:y,hasTexCoords:x,hasTexCoord1:b,hasOutline:T}}})}),i};ji.getShaderVariable=function(e){return e==="SCALAR"?"float":e.toLowerCase()};ji.ModelState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};ji.getFailedLoadFunction=function(e,t,n){return function(i){e._state=ji.ModelState.FAILED;let o=`Failed to load ${t}: ${n}`;l(i)&&(o+=` -${i.message}`),e._readyPromise.reject(new se(o))}};ji.parseBuffers=function(e,t){let n=e._loadResources;Ce.buffer(e.gltfInternal,function(i,o){if(l(i.extras._pipeline.source))n.buffers[o]=i.extras._pipeline.source;else if(l(t)){let r=e._resource.getDerivedResource({url:i.uri});++n.pendingBufferLoads,r.fetchArrayBuffer().then(t(e,o)).catch(ji.getFailedLoadFunction(e,"buffer",r.url))}})};var pRt=new h,_Rt=new h;ji.computeBoundingSphere=function(e){let t=e.gltfInternal,n=t.nodes,i=t.meshes,o=t.scenes[t.scene].nodes,r=o.length,s=[],a=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let f=0;f<r;++f){let d=n[o[f]];for(d._transformToRoot=ji.getTransform(d),s.push(d);s.length>0;){d=s.pop();let p=d._transformToRoot,_=d.mesh;if(l(_)){let x=i[_].primitives,b=x.length;for(let T=0;T<b;++T){let C=x[T].attributes.POSITION;if(l(C)){let A=ji.getAccessorMinMax(t,C);if(l(A.min)&&l(A.max)){let S=h.fromArray(A.min,0,pRt),w=h.fromArray(A.max,0,_Rt);O.multiplyByPoint(p,S,S),O.multiplyByPoint(p,w,w),h.minimumByComponent(a,S,a),h.maximumByComponent(c,w,c)}}}}let m=d.children;if(l(m)){let y=m.length;for(let x=0;x<y;++x){let b=n[m[x]];b._transformToRoot=ji.getTransform(b),O.multiplyTransformation(p,b._transformToRoot,b._transformToRoot),s.push(b)}}delete d._transformToRoot}}let u=re.fromCornerPoints(a,c);return e.forwardAxis===Za.Z&&re.transformWithoutScale(u,Za.Z_UP_TO_X_UP,u),e._upAxis===Za.Y?re.transformWithoutScale(u,Za.Y_UP_TO_Z_UP,u):e._upAxis===Za.X&&re.transformWithoutScale(u,Za.X_UP_TO_Z_UP,u),u};function gRt(e,t){return Ce.techniqueAttribute(e,function(n,i){if(n.semantic===t)return i})}function yRt(e,t){let n=e.accessors,i=e.materials,o=e.extensions.KHR_techniques_webgl,r=o.techniques,s=o.programs,a=o.shaders,c=t.targets,u=t.attributes;for(let m in c)if(c.hasOwnProperty(m)){let y=c[m];for(let x in y)x!=="extras"&&(u[`${x}_${m}`]=y[x])}let f=i[t.material],d=r[f.extensions.KHR_techniques_webgl.technique],p=s[d.program],_=a[p.vertexShader];for(let m in u)if(u.hasOwnProperty(m)&&!l(gRt(d,m))){let y=u[m],x=n[y],b=m.toLowerCase();b.charAt(0)==="_"&&(b=b.slice(1));let T=`a_${b}`;d.attributes[T]={semantic:m,type:x.componentType};let C=_.extras._pipeline,A=C.source;A=`attribute ${ji.getShaderVariable(x.type)} ${T}; -${A}`,C.source=A}}ji.ensureSemanticExistence=function(e){return Ce.mesh(e,function(t){Ce.meshPrimitive(t,function(n){yRt(e,n)})}),e};ji.createAttributeLocations=function(e,t){let n={},i=!1,o=1;if(Ce.techniqueAttribute(e,function(r,s){/pos/i.test(s)&&!i?(n[s]=0,i=!0):n[s]=o++}),l(t))for(let r in t)t.hasOwnProperty(r)&&(n[r]=o++);return n};ji.getAccessorMinMax=function(e,t){let n=e.accessors[t],i=n.extensions,o=n.min,r=n.max;if(l(i)){let s=i.WEB3D_quantized_attributes;l(s)&&(o=s.decodedMin,r=s.decodedMax)}return{min:o,max:r}};function owe(e,t,n,i){return xo(e,"KHR_techniques_webgl")?function(o,r){if(o.semantic===n&&(!i||!l(o.node)))return r}:function(o,r){let s=t.parameters[o];if(s.semantic===n&&(!i||!l(s.node)))return r}}ji.getAttributeOrUniformBySemantic=function(e,t,n,i){return Ce.technique(e,function(o){if(l(n)&&o.program!==n)return;let r=Ce.techniqueAttribute(o,owe(e,o,t,i));return l(r)?r:Ce.techniqueUniform(o,owe(e,o,t,i))})};ji.getDiffuseAttributeOrUniform=function(e,t){let n=ji.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return l(n)||(n=ji.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),n};var xRt=new h,bRt=new Pe,TRt=new h;ji.getTransform=function(e,t){return l(e.matrix)?O.fromColumnMajorArray(e.matrix,t):O.fromTranslationQuaternionRotationScale(h.fromArray(e.translation,0,xRt),Pe.unpack(e.rotation,0,bRt),h.fromArray(e.scale,0,TRt),t)};ji.getUsedExtensions=function(e){let t=e.extensionsUsed,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};ji.getRequiredExtensions=function(e){let t=e.extensionsRequired,n={};if(l(t)){let i=t.length;for(let o=0;o<i;o++){let r=t[o];n[r]=!0}}return n};ji.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_texture_basisu:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};ji.checkSupportedExtensions=function(e,t){for(let n in e)if(e.hasOwnProperty(n)){if(!ji.supportedExtensions[n])throw new se(`Unsupported glTF Extension: ${n}`);if(n==="EXT_texture_webp"&&t===!1)throw new se("Loaded model requires WebP but browser does not support it.")}};ji.checkSupportedGlExtensions=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(o!=="OES_element_index_uint")throw new se(`Unsupported WebGL Extension: ${o}`);if(!t.elementIndexUint)throw new se("OES_element_index_uint WebGL extension is not enabled.")}}};function ZQ(e,t,n){t+="(?!\\w)",t=new RegExp(t,"g");let i=e.search(t);return e.replace(t,function(o,r){return i===r?o:n})}function CRt(e,t){let i=e.accessors[t].extensions;if(l(i))return i.WEB3D_quantized_attributes}function rwe(e,t,n){let i=t.material,o=e.materials[i];if(!xo(e,"KHR_techniques_webgl")||!l(o.extensions)||!l(o.extensions.KHR_techniques_webgl))return;let r=o.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[r];return Ce.techniqueAttribute(a,function(c,u){if(c.semantic===n)return u})}ji.modifyShaderForDracoQuantizedAttributes=function(e,t,n,i){let o={};for(let r in i)if(i.hasOwnProperty(r)){let s=i[r],a=s.quantization;if(!l(a))continue;let c=rwe(e,t,r);r.charAt(0)==="_"&&(r=r.substring(1));let u=`gltf_u_dec_${r.toLowerCase()}`;if(!l(o[u])){let f=`gltf_decoded_${r}`,d=c.replace("a_","gltf_a_dec_"),p=s.componentsPerAttribute;n=ZQ(n,c,d);let _;a.octEncoded?_="vec3":p>1?_=`vec${p}`:_="float",n=`${_} ${d}; -${n}`;let m=p===3&&r==="COLOR_0";m&&(n=ZQ(n,d,`vec4(${d}, 1.0)`));let y="";if(a.octEncoded){let x=`${u}_rangeConstant`;n=`uniform float ${x}; -${n}`,y=` -void main() { - ${d} = czm_octDecode(${c}.xy, ${x}).zxy; - ${f}(); -} -`}else{let x=`${u}_normConstant`,b=`${u}_min`;n=`uniform float ${x}; -uniform ${_} ${b}; -${n}`,y=` -void main() { - ${d} = ${b} + ${c}${m?".xyz":""} * ${x}; - ${f}(); -} -`}n=Be.replaceMain(n,f),n+=y}}return{shader:n}};ji.modifyShaderForQuantizedAttributes=function(e,t,n){let i={},o=t.attributes;for(let r in o)if(o.hasOwnProperty(r)){let s=rwe(e,t,r),a=t.attributes[r];r.charAt(0)==="_"&&(r=r.substring(1));let c=`gltf_u_dec_${r.toLowerCase()}`,u=`${c}_scale`,f=`${c}_translate`;if(!l(i[c])&&!l(i[u])){let d=CRt(e,a);if(l(d)){let p=d.decodeMatrix,_=`gltf_decoded_${r}`,m=s.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(p.length));n=ZQ(n,s,m);let x;y>2?x=`vec${y-1}`:x="float",n=`${x} ${m}; -${n}`;let b="";y===5?(n=`uniform mat4 ${u}; -${n}`,n=`uniform vec4 ${f}; -${n}`,b=` -void main() { - ${m} = ${u} * ${s} + ${f}; - ${_}(); -} -`,i[u]={mat:4},i[f]={vec:4}):(n=`uniform mat${y} ${c}; -${n}`,b=` -void main() { - ${m} = ${x}(${c} * vec${y}(${s},1.0)); - ${_}(); -} -`,i[c]={mat:y}),n=Be.replaceMain(n,_),n+=b}}}return{shader:n,uniforms:i}};function zv(e){let t={value:e,clone:function(n,i){return n},func:function(){return t.value}};return t}function T5(e){let t={value:V.fromArray(e),clone:V.clone,func:function(){return t.value}};return t}function C5(e){let t={value:h.fromArray(e),clone:h.clone,func:function(){return t.value}};return t}function Vv(e){let t={value:ie.fromArray(e),clone:ie.clone,func:function(){return t.value}};return t}function QQ(e){let t={value:ti.fromColumnMajorArray(e),clone:ti.clone,func:function(){return t.value}};return t}function JQ(e){let t={value:Z.fromColumnMajorArray(e),clone:Z.clone,func:function(){return t.value}};return t}function b5(e){let t={value:O.fromColumnMajorArray(e),clone:O.clone,func:function(){return t.value}};return t}function A5(e,t,n){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=n}Object.defineProperties(A5.prototype,{value:{get:function(){if(!l(this._value)){let e=this._textures[this._textureId];if(l(e))this._value=e;else return this._defaultTexture}return this._value},set:function(e){this._value=e}}});A5.prototype.clone=function(e){return e};A5.prototype.func=void 0;function ARt(e,t,n){let i=new A5(e,t,n);return i.func=function(){return i.value},i}var Qa={};Qa[q.FLOAT]=zv;Qa[q.FLOAT_VEC2]=T5;Qa[q.FLOAT_VEC3]=C5;Qa[q.FLOAT_VEC4]=Vv;Qa[q.INT]=zv;Qa[q.INT_VEC2]=T5;Qa[q.INT_VEC3]=C5;Qa[q.INT_VEC4]=Vv;Qa[q.BOOL]=zv;Qa[q.BOOL_VEC2]=T5;Qa[q.BOOL_VEC3]=C5;Qa[q.BOOL_VEC4]=Vv;Qa[q.FLOAT_MAT2]=QQ;Qa[q.FLOAT_MAT3]=JQ;Qa[q.FLOAT_MAT4]=b5;Qa[q.SAMPLER_2D]=ARt;ji.createUniformFunction=function(e,t,n,i){return Qa[e](t,n,i)};function ERt(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function SRt(e){return[e[20],e[21],e[22],e[23]]}ji.createUniformsForDracoQuantizedAttributes=function(e){let t={};for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.quantization;if(!l(o))continue;n.charAt(0)==="_"&&(n=n.substring(1));let r=`gltf_u_dec_${n.toLowerCase()}`;if(o.octEncoded){let u=`${r}_rangeConstant`,f=(1<<o.quantizationBits)-1;t[u]=zv(f).func;continue}let s=`${r}_normConstant`,a=o.range/(1<<o.quantizationBits);t[s]=zv(a).func;let c=`${r}_min`;switch(i.componentsPerAttribute){case 1:t[c]=zv(o.minValues).func;break;case 2:t[c]=T5(o.minValues).func;break;case 3:t[c]=C5(o.minValues).func;break;case 4:t[c]=Vv(o.minValues).func;break}}return t};ji.createUniformsForQuantizedAttributes=function(e,t,n){let i=e.accessors,o={},r={},s=t.attributes;for(let a in s)if(s.hasOwnProperty(a)){let c=s[a],u=i[c],f=u.extensions;if(a.charAt(0)==="_"&&(a=a.substring(1)),l(f)){let d=f.WEB3D_quantized_attributes;if(l(d)){let p=d.decodeMatrix,_=`gltf_u_dec_${a.toLowerCase()}`,m,y;switch(u.type){case GT.SCALAR:r[_]=QQ(p).func,o[_]=!0;break;case GT.VEC2:r[_]=JQ(p).func,o[_]=!0;break;case GT.VEC3:r[_]=b5(p).func,o[_]=!0;break;case GT.VEC4:m=`${_}_scale`,y=`${_}_translate`,r[m]=b5(ERt(p)).func,r[y]=Vv(SRt(p)).func,o[m]=!0,o[y]=!0;break}}}}for(let a in n)if(n.hasOwnProperty(a)&&!o[a]){let c=n[a];l(c.mat)&&(c.mat===2?r[a]=QQ(ti.IDENTITY).func:c.mat===3?r[a]=JQ(Z.IDENTITY).func:c.mat===4&&(r[a]=b5(O.IDENTITY).func)),l(c.vec)&&c.vec===4&&(r[a]=Vv([0,0,0,0]).func)}return r};var Uv=new h,vRt={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){let n=new O;return function(){return l(t._rtcCenter)?(O.getTranslation(e.model,Uv),h.add(Uv,t._rtcCenter,Uv),O.multiplyByPoint(e.view,Uv,Uv),O.setTranslation(e.modelView,Uv,n)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};ji.getGltfSemanticUniforms=function(){return vRt};var Ci=ji;function wRt(e,t){if(t=Oe(t,Oe.EMPTY_OBJECT),!l(e)||!xo(e,"KHR_materials_common"))return;xo(e,"KHR_techniques_webgl")||(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));let n=e.extensions.KHR_techniques_webgl;RRt(e);let i=IRt(e),o=Ci.splitIncompatibleMaterials(e),r={},s=!1;return Ce.material(e,function(a,c){if(l(a.extensions)&&l(a.extensions.KHR_materials_common)){let u=a.extensions.KHR_materials_common,f=o[c],d=DRt(u,f),p=r[d];l(p)||(p=PRt(e,n,f,u,i,t.addBatchIdToGeneratedShaders),r[d]=p,s=!0);let _={},m=u.values,y;for(let x in m)m.hasOwnProperty(x)&&x!=="transparent"&&x!=="doubleSided"&&(y=`u_${x.toLowerCase()}`,_[y]=m[x]);a.extensions.KHR_techniques_webgl={technique:p,values:_},a.alphaMode="OPAQUE",u.transparent&&(a.alphaMode="BLEND"),u.doubleSided&&(a.doubleSided=!0)}}),s&&Ci.ensureSemanticExistence(e),e}function IRt(e){let t={},n;if(l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(n=e.extensions.KHR_materials_common.lights),l(n)){let i=e.nodes;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r];if(l(s.extensions)&&l(s.extensions.KHR_materials_common)){let a=s.extensions.KHR_materials_common.light;l(a)&&l(n[a])&&(n[a].node=r),delete s.extensions.KHR_materials_common}}let o=0;for(let r in n)if(n.hasOwnProperty(r)){let s=n[r],a=s.type;if(a!=="ambient"&&!l(s.node)){delete n[r];continue}let c=`light${o.toString()}`;s.baseName=c;let u,f,d,p;switch(a){case"ambient":u=s.ambient,t[`${c}Color`]={type:q.FLOAT_VEC3,value:u.color};break;case"directional":f=s.directional,t[`${c}Color`]={type:q.FLOAT_VEC3,value:f.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4});break;case"point":d=s.point,t[`${c}Color`]={type:q.FLOAT_VEC3,value:d.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4}),t[`${c}Attenuation`]={type:q.FLOAT_VEC3,value:[d.constantAttenuation,d.linearAttenuation,d.quadraticAttenuation]};break;case"spot":p=s.spot,t[`${c}Color`]={type:q.FLOAT_VEC3,value:p.color},l(s.node)&&(t[`${c}Transform`]={node:s.node,semantic:"MODELVIEW",type:q.FLOAT_MAT4},t[`${c}InverseTransform`]={node:s.node,semantic:"MODELVIEWINVERSE",type:q.FLOAT_MAT4,useInFragment:!0}),t[`${c}Attenuation`]={type:q.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]},t[`${c}FallOff`]={type:q.FLOAT_VEC2,value:[p.fallOffAngle,p.fallOffExponent]};break}++o}}return t}function PRt(e,t,n,i,o,r){l(i)||(i={}),r=Oe(r,!1);let s=t.techniques,a=t.shaders,c=t.programs,u=i.technique.toUpperCase(),f;l(e.extensions)&&l(e.extensions.KHR_materials_common)&&(f=e.extensions.KHR_materials_common.lights);let d=i.values,p=Oe(i.jointCount,0),_,m=!1,y=!1;l(n)&&(_=n.skinning,m=_.skinned,y=n.hasVertexColors);let x=`precision highp float; -`,b=`precision highp float; -`,T=u!=="CONSTANT",C={u_modelViewMatrix:{semantic:xo(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:q.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:q.FLOAT_MAT4}};T&&(C.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:q.FLOAT_MAT3}),m&&(C.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:q.FLOAT_MAT4});let A,S=!1;for(let z in d)if(d.hasOwnProperty(z)&&z!=="transparent"&&z!=="doubleSided"){let B=swe(z,d[z]);A=`u_${z.toLowerCase()}`,!S&&B===q.SAMPLER_2D&&(S=!0),C[A]={type:B}}if(l(C.u_diffuse)&&(C.u_diffuse.semantic="_3DTILESDIFFUSE"),l(o))for(let z in o)o.hasOwnProperty(z)&&(A=`u_${z}`,C[A]=o[z]);for(A in C)if(C.hasOwnProperty(A)){let z=C[A],B=l(z.count)?`[${z.count}]`:"";z.type!==q.FLOAT_MAT3&&z.type!==q.FLOAT_MAT4||z.useInFragment?(b+=`uniform ${V0(z.type)} ${A}${B}; -`,delete z.useInFragment):x+=`uniform ${V0(z.type)} ${A}${B}; -`}let w="";m&&(w+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let R={a_position:{semantic:"POSITION"}};x+=`attribute vec3 a_position; -`,x+=`out vec3 v_positionEC; -`,m?w+=` vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0); -`:w+=` vec4 pos = u_modelViewMatrix * vec4(a_position,1.0); -`,w+=` v_positionEC = pos.xyz; -`,w+=` gl_Position = u_projectionMatrix * pos; -`,b+=`in vec3 v_positionEC; -`,T&&(R.a_normal={semantic:"NORMAL"},x+=`attribute vec3 a_normal; -`,x+=`out vec3 v_normal; -`,m?w+=` v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal; -`:w+=` v_normal = u_normalMatrix * a_normal; -`,b+=`in vec3 v_normal; -`);let D;S&&(R.a_texcoord_0={semantic:"TEXCOORD_0"},D="v_texcoord_0",x+=`attribute vec2 a_texcoord_0; -`,x+=`out vec2 ${D}; -`,w+=` ${D} = a_texcoord_0; -`,b+=`in vec2 ${D}; -`),m&&(R.a_joint={semantic:"JOINTS_0"},R.a_weight={semantic:"WEIGHTS_0"},x+=`attribute vec4 a_joint; -`,x+=`attribute vec4 a_weight; -`),y&&(R.a_vertexColor={semantic:"COLOR_0"},x+=`attribute vec4 a_vertexColor; -`,x+=`out vec4 v_vertexColor; -`,w+=` v_vertexColor = a_vertexColor; -`,b+=`in vec4 v_vertexColor; -`),r&&(R.a_batchId={semantic:"_BATCHID"},x+=`attribute float a_batchId; -`);let M=T&&(u==="BLINN"||u==="PHONG")&&l(C.u_specular)&&l(C.u_shininess)&&C.u_shininess>0,L=!1,g=!1,E="";for(let z in f)if(f.hasOwnProperty(z)){let B=f[z],j=B.type.toLowerCase(),W=B.baseName;E+=` { -`;let J=`u_${W}Color`;if(j==="ambient")g=!0,E+=` ambientLight += ${J}; -`;else if(T){L=!0;let Y=`v_${W}Direction`,ee=`v_${W}Position`;j!=="point"&&(x+=`out vec3 ${Y}; -`,b+=`in vec3 ${Y}; -`,w+=` ${Y} = mat3(u_${W}Transform) * vec3(0.,0.,1.); -`,j==="directional"&&(E+=` vec3 l = normalize(${Y}); -`)),j!=="directional"?(x+=`out vec3 ${ee}; -`,b+=`in vec3 ${ee}; -`,w+=` ${ee} = u_${W}Transform[3].xyz; -`,E+=` vec3 VP = ${ee} - v_positionEC; -`,E+=` vec3 l = normalize(VP); -`,E+=` float range = length(VP); -`,E+=` float attenuation = 1.0 / (u_${W}Attenuation.x + `,E+=`(u_${W}Attenuation.y * range) + `,E+=`(u_${W}Attenuation.z * range * range)); -`):E+=` float attenuation = 1.0; -`,j==="spot"&&(E+=` float spotDot = dot(l, normalize(${Y})); -`,E+=` if (spotDot < cos(u_${W}FallOff.x * 0.5)) -`,E+=` { -`,E+=` attenuation = 0.0; -`,E+=` } -`,E+=` else -`,E+=` { -`,E+=` attenuation *= max(0.0, pow(spotDot, u_${W}FallOff.y)); -`,E+=` } -`),E+=` diffuseLight += ${J}* max(dot(normal,l), 0.) * attenuation; -`,M&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir); -`,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation; -`):(E+=` vec3 reflectDir = reflect(-l, normal); -`,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation; -`),E+=` specularLight += ${J} * specularIntensity; -`)}E+=` } -`}g||(E+=` ambientLight += vec3(0.2, 0.2, 0.2); -`),!L&&u!=="CONSTANT"&&(b+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,b+=`uniform vec3 gltf_lightColor; -`,b+=`#endif -`,E+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,E+=` vec3 lightColor = czm_lightColor; -`,E+=`#else -`,E+=` vec3 lightColor = gltf_lightColor; -`,E+=`#endif -`,E+=` vec3 l = normalize(czm_lightDirectionEC); -`,E+=` diffuseLight += lightColor * max(dot(normal,l), 0.2); -`,M&&(u==="BLINN"?(E+=` vec3 h = normalize(l + viewDir); -`,E+=` float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)); -`):(E+=` vec3 reflectDir = reflect(-l, normal); -`,E+=` float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)); -`),E+=` specularLight += lightColor * specularIntensity; -`)),x+=`void main(void) { -`,x+=w,x+=`} -`,b+=`void main(void) { -`;let v=` vec3 color = vec3(0.0, 0.0, 0.0); -`;T&&(b+=` vec3 normal = normalize(v_normal); -`,i.doubleSided&&(b+=` if (czm_backFacing()) -`,b+=` { -`,b+=` normal = -normal; -`,b+=` } -`));let I;u!=="CONSTANT"?(l(C.u_diffuse)&&(C.u_diffuse.type===q.SAMPLER_2D?b+=` vec4 diffuse = texture(u_diffuse, ${D}); -`:b+=` vec4 diffuse = u_diffuse; -`,b+=` vec3 diffuseLight = vec3(0.0, 0.0, 0.0); -`,v+=` color += diffuse.rgb * diffuseLight; -`),M&&(C.u_specular.type===q.SAMPLER_2D?b+=` vec3 specular = texture(u_specular, ${D}).rgb; -`:b+=` vec3 specular = u_specular.rgb; -`,b+=` vec3 specularLight = vec3(0.0, 0.0, 0.0); -`,v+=` color += specular * specularLight; -`),l(C.u_transparency)?I=` gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency); -`:I=` gl_FragColor = vec4(color * diffuse.a, diffuse.a); -`):l(C.u_transparency)?I=` gl_FragColor = vec4(color * u_transparency, u_transparency); -`:I=` gl_FragColor = vec4(color, 1.0); -`,y&&(v+=` color *= v_vertexColor.rgb; -`),l(C.u_emission)&&(C.u_emission.type===q.SAMPLER_2D?b+=` vec3 emission = texture(u_emission, ${D}).rgb; -`:b+=` vec3 emission = u_emission.rgb; -`,v+=` color += emission; -`),(l(C.u_ambient)||u!=="CONSTANT")&&(l(C.u_ambient)?C.u_ambient.type===q.SAMPLER_2D?b+=` vec3 ambient = texture(u_ambient, ${D}).rgb; -`:b+=` vec3 ambient = u_ambient.rgb; -`:b+=` vec3 ambient = diffuse.rgb; -`,v+=` color += ambient * ambientLight; -`),b+=` vec3 viewDir = -normalize(v_positionEC); -`,b+=` vec3 ambientLight = vec3(0.0, 0.0, 0.0); -`,b+=E,b+=v,b+=I,b+=`} -`;let N=Do(a,{type:q.VERTEX_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),F=Do(a,{type:q.FRAGMENT_SHADER,extras:{_pipeline:{source:b,extension:".glsl"}}}),U=Do(c,{fragmentShader:F,vertexShader:N});return Do(s,{attributes:R,program:U,uniforms:C})}function swe(e,t){let n;switch(l(t.value)?n=t.value:l(t.index)?n=[t.index]:n=t,e){case"ambient":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"diffuse":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"emission":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"specular":return n.length===1?q.SAMPLER_2D:q.FLOAT_VEC4;case"shininess":return q.FLOAT;case"transparency":return q.FLOAT;case"transparent":return q.BOOL;case"doubleSided":return q.BOOL}}function DRt(e,t){let n="";n+=`technique:${e.technique};`;let i=e.values,o=Object.keys(i).sort(),r=o.length;for(let a=0;a<r;++a){let c=o[a];i.hasOwnProperty(c)&&(n+=`${c}:${swe(c,i[c])}`,n+=";")}let s=Oe(e.jointCount,0);if(n+=`${s.toString()};`,l(t)){let a=t.skinning;s>0&&(n+=`${a.type};`),n+=t.hasVertexColors}return n}function RRt(e){let t=e.extensions.KHR_materials_common;if(!l(t)||!l(t.lights))return;let n=t.lights,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.type==="ambient"){l(r.ambient)||(r.ambient={});let s=r.ambient;l(s.color)||(s.color=[1,1,1])}else if(r.type==="directional"){l(r.directional)||(r.directional={});let s=r.directional;l(s.color)||(s.color=[1,1,1])}else if(r.type==="point"){l(r.point)||(r.point={});let s=r.point;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=Oe(s.constantAttenuation,1),s.linearAttenuation=Oe(s.linearAttenuation,0),s.quadraticAttenuation=Oe(s.quadraticAttenuation,0)}else if(r.type==="spot"){l(r.spot)||(r.spot={});let s=r.spot;l(s.color)||(s.color=[1,1,1]),s.constantAttenuation=Oe(s.constantAttenuation,1),s.fallOffAngle=Oe(s.fallOffAngle,3.14159265),s.fallOffExponent=Oe(s.fallOffExponent,0),s.linearAttenuation=Oe(s.linearAttenuation,0),s.quadraticAttenuation=Oe(s.quadraticAttenuation,0)}}}var awe=wRt;function ORt(e,t){if(t=Oe(t,Oe.EMPTY_OBJECT),xo(e,"KHR_techniques_webgl")||!l(e.materials)||e.materials.length===0)return e;l(e.extensions)||(e.extensions={}),l(e.extensionsUsed)||(e.extensionsUsed=[]),l(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");let n=Ci.splitIncompatibleMaterials(e);return Ce.material(e,function(i,o){let r={},s=BRt(e,i,o,r,n,t);l(i.extensions)||(i.extensions={}),i.extensions.KHR_techniques_webgl={values:r,technique:s}}),Ci.ensureSemanticExistence(e),e}function MRt(e){return l(e.extensions)&&l(e.extensions.KHR_materials_pbrSpecularGlossiness)}function YT(e,t,n,i,o){let r,s=n[t];return l(s)&&l(s.texCoord)&&s.texCoord===1&&(i=i.replace("0","1")),l(n[`${t}Offset`])?(r=`${t}Coord`,o.fragmentShaderMain+=` vec2 ${r} = computeTexCoord(${i}, ${t}Offset, ${t}Rotation, ${t}Scale); -`):r=i,r}var LRt=[0,0],NRt=[0],FRt=[1,1];function eJ(e,t,n){if(e.indexOf("Texture")===-1||!l(t.extensions)||!l(t.extensions.KHR_texture_transform))return;let i=`u_${e}`,o=t.extensions.KHR_texture_transform;n[`${i}Offset`]=Oe(o.offset,LRt),n[`${i}Rotation`]=Oe(o.rotation,NRt),n[`${i}Scale`]=Oe(o.scale,FRt),l(t.texCoord)&&l(o.texCoord)&&(n[i].texCoord=o.texCoord)}function BRt(e,t,n,i,o,r){let s=Oe(r.addBatchIdToGeneratedShaders,!1),a=e.extensions.KHR_techniques_webgl,c=a.techniques,u=a.shaders,f=a.programs,d=MRt(t),p,_,m;if(!d){let ve=t.pbrMetallicRoughness;if(l(ve))for(_ in ve)ve.hasOwnProperty(_)&&(m=ve[_],p=`u_${_}`,i[p]=m,eJ(_,m,i));else i.u_baseColorFactor=[1,1,1,1]}if(d){let ve=t.extensions.KHR_materials_pbrSpecularGlossiness;for(_ in ve)ve.hasOwnProperty(_)&&(m=ve[_],p=`u_${_}`,i[p]=m,eJ(_,m,i))}for(let ve in t)t.hasOwnProperty(ve)&&(ve.indexOf("Texture")>=0||ve.indexOf("Factor")>=0)&&(m=t[ve],p=`u_${ve}`,i[p]=m,eJ(ve,m,i));let y=`precision highp float; -`,x=`precision highp float; -`,b;l(e.skins)&&(b=e.skins[0]);let T=l(b)?b.joints:[],C=T.length,A=o[n],S,w=!1,R=!1,D=!1,M=!1,L=!1,g=!1,E=!1,v=!1,I=!1;l(A)&&(S=A.skinning,w=S.skinned&&T.length>0,R=A.hasVertexColors,D=A.hasMorphTargets,M=A.hasNormals,L=A.hasTangents,g=A.hasTexCoords,E=A.hasTexCoord1,v=A.hasOutline);let N;D&&Ce.mesh(e,function(ve){Ce.meshPrimitive(ve,function(Ve){if(Ve.material===n){let Ke=Ve.targets;l(Ke)&&(N=Ke)}})});let F={u_modelViewMatrix:{semantic:xo(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:q.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:q.FLOAT_MAT4}};l(t.extensions)&&l(t.extensions.KHR_materials_unlit)&&(I=!0),M&&(F.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:q.FLOAT_MAT3}),w&&(F.u_jointMatrix={count:C,semantic:"JOINTMATRIX",type:q.FLOAT_MAT4}),D&&(F.u_morphWeights={count:N.length,semantic:"MORPHWEIGHTS",type:q.FLOAT});let U=t.alphaMode;l(U)&&U==="MASK"&&(F.u_alphaCutoff={semantic:"ALPHACUTOFF",type:q.FLOAT});for(p in i)i.hasOwnProperty(p)&&(F[p]={type:kRt(p)});let k=Oe(F.u_baseColorTexture,F.u_baseColorFactor);l(k)&&(k.semantic="_3DTILESDIFFUSE");for(p in F)if(F.hasOwnProperty(p)){let ve=F[p],Ve=l(ve.count)?`[${ve.count}]`:"";ve.type!==q.FLOAT_MAT3&&ve.type!==q.FLOAT_MAT4&&p!=="u_morphWeights"||ve.useInFragment?(x+=`uniform ${V0(ve.type)} ${p}${Ve}; -`,delete ve.useInFragment):y+=`uniform ${V0(ve.type)} ${p}${Ve}; -`}v&&(x+=`uniform sampler2D u_outlineTexture; -`);let z="";w&&(z+=` mat4 skinMatrix = - a_weight.x * u_jointMatrix[int(a_joint.x)] + - a_weight.y * u_jointMatrix[int(a_joint.y)] + - a_weight.z * u_jointMatrix[int(a_joint.z)] + - a_weight.w * u_jointMatrix[int(a_joint.w)]; -`);let B={a_position:{semantic:"POSITION"}};if(v&&(B.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"}),y+=`attribute vec3 a_position; -`,M&&(y+=`out vec3 v_positionEC; -`),v&&(y+=`attribute vec3 a_outlineCoordinates; -`,y+=`out vec3 v_outlineCoordinates; -`),z+=` vec3 weightedPosition = a_position; -`,M&&(z+=` vec3 weightedNormal = a_normal; -`),L&&(z+=` vec4 weightedTangent = a_tangent; -`),D)for(let ve=0;ve<N.length;ve++){let Ve=N[ve];for(let Ke in Ve)if(Ve.hasOwnProperty(Ke)&&Ke!=="extras"){let Ct=`a_${Ke}_${ve}`;B[Ct]={semantic:`${Ke}_${ve}`},y+=`attribute vec3 ${Ct}; -`,Ke==="POSITION"?z+=` weightedPosition += u_morphWeights[${ve}] * ${Ct}; -`:Ke==="NORMAL"?z+=` weightedNormal += u_morphWeights[${ve}] * ${Ct}; -`:L&&Ke==="TANGENT"&&(z+=` weightedTangent.xyz += u_morphWeights[${ve}] * ${Ct}; -`)}}w?z+=` vec4 position = skinMatrix * vec4(weightedPosition, 1.0); -`:z+=` vec4 position = vec4(weightedPosition, 1.0); -`,z+=` position = u_modelViewMatrix * position; -`,M&&(z+=` v_positionEC = position.xyz; -`),z+=` gl_Position = u_projectionMatrix * position; -`,v&&(z+=` v_outlineCoordinates = a_outlineCoordinates; -`),M&&(B.a_normal={semantic:"NORMAL"},y+=`attribute vec3 a_normal; -`,I||(y+=`out vec3 v_normal; -`,w?z+=` v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal; -`:z+=` v_normal = u_normalMatrix * weightedNormal; -`,x+=`in vec3 v_normal; -`),x+=`in vec3 v_positionEC; -`),L&&(B.a_tangent={semantic:"TANGENT"},y+=`attribute vec4 a_tangent; -`,y+=`out vec4 v_tangent; -`,z+=` v_tangent.xyz = u_normalMatrix * weightedTangent.xyz; -`,z+=` v_tangent.w = weightedTangent.w; -`,x+=`in vec4 v_tangent; -`),v&&(x+=`in vec3 v_outlineCoordinates; -`);let j="",W,J,Y,ee,Q,de,ge,le;if(g){if(B.a_texcoord_0={semantic:"TEXCOORD_0"},W="v_texcoord_0",y+=`attribute vec2 a_texcoord_0; -`,y+=`out vec2 ${W}; -`,z+=` ${W} = a_texcoord_0; -`,x+=`in vec2 ${W}; -`,E){B.a_texcoord_1={semantic:"TEXCOORD_1"};let Ve=W.replace("0","1");y+=`attribute vec2 a_texcoord_1; -`,y+=`out vec2 ${Ve}; -`,z+=` ${Ve} = a_texcoord_1; -`,x+=`out vec2 ${Ve}; -`}let ve={fragmentShaderMain:j};J=YT(e,"u_normalTexture",i,W,ve),Y=YT(e,"u_baseColorTexture",i,W,ve),ee=YT(e,"u_specularGlossinessTexture",i,W,ve),Q=YT(e,"u_diffuseTexture",i,W,ve),de=YT(e,"u_metallicRoughnessTexture",i,W,ve),ge=YT(e,"u_occlusionTexture",i,W,ve),le=YT(e,"u_emissiveTexture",i,W,ve),j=ve.fragmentShaderMain}w&&(B.a_joint={semantic:"JOINTS_0"},B.a_weight={semantic:"WEIGHTS_0"},y+=`attribute vec4 a_joint; -`,y+=`attribute vec4 a_weight; -`),R&&(B.a_vertexColor={semantic:"COLOR_0"},y+=`attribute vec4 a_vertexColor; -`,y+=`out vec4 v_vertexColor; -`,z+=` v_vertexColor = a_vertexColor; -`,x+=`out vec4 v_vertexColor; -`),s&&(B.a_batchId={semantic:"_BATCHID"},y+=`attribute float a_batchId; -`),y+=`void main(void) -{ -`,y+=z,y+=`} -`,M&&!I&&(x+=`const float M_PI = 3.141592653589793; -`,x+=`vec3 lambertianDiffuse(vec3 diffuseColor) -{ - return diffuseColor / M_PI; -} - -`,x+=`vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) -{ - return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); -} - -`,x+=`vec3 fresnelSchlick(float metalness, float VdotH) -{ - return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0); -} - -`,x+=`float smithVisibilityG1(float NdotV, float roughness) -{ - float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; - return NdotV / (NdotV * (1.0 - k) + k); -} - -`,x+=`float smithVisibilityGGX(float roughness, float NdotL, float NdotV) -{ - return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness); -} - -`,x+=`float GGX(float roughness, float NdotH) -{ - float roughnessSquared = roughness * roughness; - float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; - return roughnessSquared / (M_PI * f * f); -} - -`),x+=`vec3 SRGBtoLINEAR3(vec3 srgbIn) -{ - return pow(srgbIn, vec3(2.2)); -} - -`,x+=`vec4 SRGBtoLINEAR4(vec4 srgbIn) -{ - vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); - return vec4(linearOut, srgbIn.a); -} - -`,x+=`vec3 applyTonemapping(vec3 linearIn) -{ -#ifndef HDR - return czm_acesTonemapping(linearIn); -#else - return linearIn; -#endif -} - -`,x+=`vec3 LINEARtoSRGB(vec3 linearIn) -{ -#ifndef HDR - return pow(linearIn, vec3(1.0/2.2)); -#else - return linearIn; -#endif -} - -`,x+=`vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) -{ - rotation = -rotation; - mat3 transform = mat3( - cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, - -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, - offset.x, offset.y, 1.0); - vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; - return transformedTexCoords; -} - -`,x+=`#ifdef USE_IBL_LIGHTING -`,x+=`uniform vec2 gltf_iblFactor; -`,x+=`#endif -`,x+=`#ifdef USE_CUSTOM_LIGHT_COLOR -`,x+=`uniform vec3 gltf_lightColor; -`,x+=`#endif -`,x+=`out vec4 fragColor; -`,x+=`void main(void) -{ -`,x+=j,M&&!I&&(x+=` vec3 ng = normalize(v_normal); -`,x+=` vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0)); -`,l(i.u_normalTexture)?L?(x+=` vec3 t = normalize(v_tangent.xyz); -`,x+=` vec3 b = normalize(cross(ng, t) * v_tangent.w); -`,x+=` mat3 tbn = mat3(t, b, ng); -`,x+=` vec3 n = texture(u_normalTexture, ${J}).rgb; -`,x+=` n = normalize(tbn * (2.0 * n - 1.0)); -`):(x=`#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -#endif -${x}`,x+=`#ifdef GL_OES_standard_derivatives -`,x+=` vec3 pos_dx = dFdx(v_positionEC); -`,x+=` vec3 pos_dy = dFdy(v_positionEC); -`,x+=` vec3 tex_dx = dFdx(vec3(${J},0.0)); -`,x+=` vec3 tex_dy = dFdy(vec3(${J},0.0)); -`,x+=` vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); -`,x+=` t = normalize(t - ng * dot(ng, t)); -`,x+=` vec3 b = normalize(cross(ng, t)); -`,x+=` mat3 tbn = mat3(t, b, ng); -`,x+=` vec3 n = texture(u_normalTexture, ${J}).rgb; -`,x+=` n = normalize(tbn * (2.0 * n - 1.0)); -`,x+=`#else -`,x+=` vec3 n = ng; -`,x+=`#endif -`):x+=` vec3 n = ng; -`,t.doubleSided&&(x+=` if (czm_backFacing()) -`,x+=` { -`,x+=` n = -n; -`,x+=` } -`)),l(i.u_baseColorTexture)?(x+=` vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture(u_baseColorTexture, ${Y})); -`,l(i.u_baseColorFactor)&&(x+=` baseColorWithAlpha *= u_baseColorFactor; -`)):l(i.u_baseColorFactor)?x+=` vec4 baseColorWithAlpha = u_baseColorFactor; -`:x+=` vec4 baseColorWithAlpha = vec4(1.0); -`,R&&(x+=` baseColorWithAlpha *= v_vertexColor; -`),x+=` vec3 baseColor = baseColorWithAlpha.rgb; -`,M&&!I?(d?(l(i.u_specularGlossinessTexture)?(x+=` vec4 specularGlossiness = SRGBtoLINEAR4(texture(u_specularGlossinessTexture, ${ee})); -`,x+=` vec3 specular = specularGlossiness.rgb; -`,x+=` float glossiness = specularGlossiness.a; -`,l(i.u_specularFactor)&&(x+=` specular *= u_specularFactor; -`),l(i.u_glossinessFactor)&&(x+=` glossiness *= u_glossinessFactor; -`)):(l(i.u_specularFactor)?x+=` vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0)); -`:x+=` vec3 specular = vec3(1.0); -`,l(i.u_glossinessFactor)?x+=` float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -`:x+=` float glossiness = 1.0; -`),l(i.u_diffuseTexture)?(x+=` vec4 diffuse = SRGBtoLINEAR4(texture(u_diffuseTexture, ${Q})); -`,l(i.u_diffuseFactor)&&(x+=` diffuse *= u_diffuseFactor; -`)):l(i.u_diffuseFactor)?x+=` vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -`:x+=` vec4 diffuse = vec4(1.0); -`,x+=` baseColorWithAlpha.a = diffuse.a; -`):l(i.u_metallicRoughnessTexture)?(x+=` vec3 metallicRoughness = texture(u_metallicRoughnessTexture, ${de}).rgb; -`,x+=` float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -`,x+=` float roughness = clamp(metallicRoughness.g, 0.04, 1.0); -`,l(i.u_metallicFactor)&&(x+=` metalness *= u_metallicFactor; -`),l(i.u_roughnessFactor)&&(x+=` roughness *= u_roughnessFactor; -`)):(l(i.u_metallicFactor)?x+=` float metalness = clamp(u_metallicFactor, 0.0, 1.0); -`:x+=` float metalness = 1.0; -`,l(i.u_roughnessFactor)?x+=` float roughness = clamp(u_roughnessFactor, 0.04, 1.0); -`:x+=` float roughness = 1.0; -`),x+=` vec3 v = -normalize(v_positionEC); -`,x+=`#ifndef USE_CUSTOM_LIGHT_COLOR -`,x+=` vec3 lightColorHdr = czm_lightColorHdr; -`,x+=`#else -`,x+=` vec3 lightColorHdr = gltf_lightColor; -`,x+=`#endif -`,x+=` vec3 l = normalize(czm_lightDirectionEC); -`,x+=` vec3 h = normalize(v + l); -`,x+=` float NdotL = clamp(dot(n, l), 0.001, 1.0); -`,x+=` float NdotV = abs(dot(n, v)) + 0.001; -`,x+=` float NdotH = clamp(dot(n, h), 0.0, 1.0); -`,x+=` float LdotH = clamp(dot(l, h), 0.0, 1.0); -`,x+=` float VdotH = clamp(dot(v, h), 0.0, 1.0); -`,x+=` vec3 f0 = vec3(0.04); -`,d?(x+=` float roughness = 1.0 - glossiness; -`,x+=` vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b)); -`,x+=` vec3 specularColor = specular; -`):(x+=` vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0); -`,x+=` vec3 specularColor = mix(f0, baseColor, metalness); -`),x+=` float alpha = roughness * roughness; -`,x+=` float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b); -`,x+=` vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -`,x+=` vec3 r0 = specularColor.rgb; -`,x+=` vec3 F = fresnelSchlick2(r0, r90, VdotH); -`,x+=` float G = smithVisibilityGGX(alpha, NdotL, NdotV); -`,x+=` float D = GGX(alpha, NdotH); -`,x+=` vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); -`,x+=` vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); -`,x+=` vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution); -`,x+=`#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) -`,x+=` vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); -`,x+=` float vertexRadius = length(positionWC); -`,x+=` float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); -`,x+=` float reflectionDotNadir = dot(r, normalize(positionWC)); -`,x+=` r.x = -r.x; -`,x+=` r = -normalize(czm_temeToPseudoFixed * r); -`,x+=` r.x = -r.x; -`,x+=` float inverseRoughness = 1.04 - roughness; -`,x+=` inverseRoughness *= inverseRoughness; -`,x+=` vec3 sceneSkyBox = texture(czm_environmentMap, r).rgb * inverseRoughness; -`,x+=` float atmosphereHeight = 0.05; -`,x+=` float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); -`,x+=` float blendRegionOffset = roughness * -1.0; -`,x+=` float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); -`,x+=` float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); -`,x+=` float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); -`,x+=` float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); -`,x+=` vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); -`,x+=` vec3 nadirColor = belowHorizonColor * 0.5; -`,x+=` vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); -`,x+=` vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); -`,x+=` vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); -`,x+=` vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); -`,x+=` float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; -`,x+=` float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); -`,x+=` vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); -`,x+=` float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); -`,x+=` vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); -`,x+=` specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); -`,x+=` specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); -`,x+=`#ifdef USE_SUN_LUMINANCE -`,x+=` float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0); -`,x+=` float S = acos(LdotZenith); -`,x+=` float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0); -`,x+=` float gamma = acos(NdotL); -`,x+=` float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); -`,x+=` float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); -`,x+=` float luminance = gltf_luminanceAtZenith * (numerator / denominator); -`,x+=`#endif -`,x+=` vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,x+=` vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y); -`,x+=` float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); -`,x+=` vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); -`,x+=` IBLColor *= lightColor; -`,x+=`#ifdef USE_SUN_LUMINANCE -`,x+=` color += IBLColor * luminance; -`,x+=`#else -`,x+=` color += IBLColor; -`,x+=`#endif -`,x+=`#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -`,x+=` const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); -`,x+=` vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n))); -`,x+=`#ifdef DIFFUSE_IBL -`,x+=`#ifdef CUSTOM_SPHERICAL_HARMONICS -`,x+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); -`,x+=`#else -`,x+=` vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); -`,x+=`#endif -`,x+=`#else -`,x+=` vec3 diffuseIrradiance = vec3(0.0); -`,x+=`#endif -`,x+=`#ifdef SPECULAR_IBL -`,x+=` vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -`,x+=`#ifdef CUSTOM_SPECULAR_IBL -`,x+=` vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD); -`,x+=`#else -`,x+=` vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); -`,x+=`#endif -`,x+=` specularIBL *= F * brdfLut.x + brdfLut.y; -`,x+=`#else -`,x+=` vec3 specularIBL = vec3(0.0); -`,x+=`#endif -`,x+=` color += diffuseIrradiance * diffuseColor + specularColor * specularIBL; -`,x+=`#endif -`):x+=` vec3 color = baseColor; -`,I||(l(i.u_occlusionTexture)&&(x+=` color *= texture(u_occlusionTexture, ${ge}).r; -`),l(i.u_emissiveTexture)?(x+=` vec3 emissive = SRGBtoLINEAR3(texture(u_emissiveTexture, ${le}).rgb); -`,l(i.u_emissiveFactor)&&(x+=` emissive *= u_emissiveFactor; -`),x+=` color += emissive; -`):l(i.u_emissiveFactor)&&(x+=` color += u_emissiveFactor; -`)),I||(x+=` color = applyTonemapping(color); -`),x+=` color = LINEARtoSRGB(color); -`,v&&(x+=` float outlineness = max( -`,x+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r, -`,x+=` max( -`,x+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r, -`,x+=` texture(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r)); -`,x+=` color = mix(color, vec3(0.0, 0.0, 0.0), outlineness); -`),l(U)?U==="MASK"?(x+=` if (baseColorWithAlpha.a < u_alphaCutoff) { -`,x+=` discard; -`,x+=` } -`,x+=` fragColor = vec4(color, 1.0); -`):U==="BLEND"?x+=` fragColor = vec4(color, baseColorWithAlpha.a); -`:x+=` fragColor = vec4(color, 1.0); -`:x+=` fragColor = vec4(color, 1.0); -`,x+=`} -`;let ye=Do(u,{type:q.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),be=Do(u,{type:q.FRAGMENT_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),Ie=Do(f,{fragmentShader:be,vertexShader:ye});return Do(c,{attributes:B,program:Ie,uniforms:F})}function kRt(e){if(e.indexOf("Offset")!==-1)return q.FLOAT_VEC2;if(e.indexOf("Rotation")!==-1)return q.FLOAT;if(e.indexOf("Scale")!==-1)return q.FLOAT_VEC2;if(e.indexOf("Texture")!==-1)return q.SAMPLER_2D;switch(e){case"u_baseColorFactor":return q.FLOAT_VEC4;case"u_metallicFactor":return q.FLOAT;case"u_roughnessFactor":return q.FLOAT;case"u_emissiveFactor":return q.FLOAT_VEC3;case"u_diffuseFactor":return q.FLOAT_VEC4;case"u_specularFactor":return q.FLOAT_VEC3;case"u_glossinessFactor":return q.FLOAT}}var cwe=ORt;var E5={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};E5.getMorphTime=function(e){return e===E5.SCENE3D?1:e===E5.MORPHING?void 0:0};var Sd=Object.freeze(E5);var af={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};af.NUMBER_OF_SHADOW_MODES=4;af.castShadows=function(e){return e===af.ENABLED||e===af.CAST_ONLY};af.receiveShadows=function(e){return e===af.ENABLED||e===af.RECEIVE_ONLY};af.fromCastReceive=function(e,t){return e&&t?af.ENABLED:e?af.CAST_ONLY:t?af.RECEIVE_ONLY:af.DISABLED};var vp=Object.freeze(af);var URt={LEFT:-1,NONE:0,RIGHT:1},XT=Object.freeze(URt);var zRt={modifyFragmentShader:function(t){return t=Be.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; -void main() -{ -#ifndef SHADOW_MAP - if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif - czm_splitter_main(); -} -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},tJ=zRt;var VRt={NEVER:q.NEVER,LESS:q.LESS,EQUAL:q.EQUAL,LESS_OR_EQUAL:q.LEQUAL,GREATER:q.GREATER,NOT_EQUAL:q.NOTEQUAL,GREATER_OR_EQUAL:q.GEQUAL,ALWAYS:q.ALWAYS},nJ=Object.freeze(VRt);var HRt={ZERO:q.ZERO,KEEP:q.KEEP,REPLACE:q.REPLACE,INCREMENT:q.INCR,DECREMENT:q.DECR,INVERT:q.INVERT,INCREMENT_WRAP:q.INCR_WRAP,DECREMENT_WRAP:q.DECR_WRAP},KT=Object.freeze(HRt);var S5={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};S5.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:nJ.ALWAYS,frontOperation:{fail:KT.KEEP,zFail:KT.KEEP,zPass:KT.REPLACE},backFunction:nJ.ALWAYS,backOperation:{fail:KT.KEEP,zFail:KT.KEEP,zPass:KT.REPLACE},reference:S5.CESIUM_3D_TILE_MASK,mask:S5.CESIUM_3D_TILE_MASK}};var iJ=Object.freeze(S5);var GRt=new h,cx=Ci.ModelState,jRt="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",WRt=P.EPSILON16;function uJ(e,t){e._cachedGltf=t}function _R(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(_R.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}});_R.prototype.makeReady=function(e){this.gltf=e;let t=this.modelsToLoad,n=t.length;for(let i=0;i<n;++i){let o=t[i];o.isDestroyed()||uJ(o,this)}this.modelsToLoad=void 0,this.ready=!0};var ux={},lwe={};function La(e){e=Oe(e,Oe.EMPTY_OBJECT);let t=e.cacheKey;this._cacheKey=t,this._cachedGltf=void 0,this._releaseGltfJson=Oe(e.releaseGltfJson,!1);let n;if(l(t)&&l(ux[t])&&ux[t].ready)n=ux[t],++n.count;else{let s=e.gltf;if(l(s)){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),s instanceof Uint8Array){let a=NQ(s);n=new _R({gltf:a,ready:!0})}else n=new _R({gltf:e.gltf,ready:!0});n.count=1,l(t)&&(ux[t]=n)}}uJ(this,n);let i=Oe(e.basePath,"");this._resource=Ee.createIfNeeded(i);let o=e.credit;typeof o=="string"&&(o=new _t(o)),this._credit=o,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=Oe(e.showCreditsOnScreen,!1),this.show=Oe(e.show,!0),this.silhouetteColor=Oe(e.silhouetteColor,H.RED),this._silhouetteColor=new H,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=Oe(e.silhouetteSize,0),this.modelMatrix=O.clone(Oe(e.modelMatrix,O.IDENTITY)),this._modelMatrix=O.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=Oe(e.scale,1),this._scale=this.scale,this.minimumPixelSize=Oe(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=Oe(e.heightReference,Bv.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;let r=e.scene;this._scene=r,l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=Oe(e.allowPicking,!0),this._ready=!1,this._readyPromise=la(),this.activeAnimations=new $ve(this),this.clampAnimations=Oe(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=Oe(e.incrementallyLoadTextures,!0),this._asynchronous=Oe(e.asynchronous,!0),this.shadows=Oe(e.shadows,vp.ENABLED),this._shadows=this.shadows,this.color=H.clone(Oe(e.color,H.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=Oe(e.colorBlendMode,_5.HIGHLIGHT),this.colorBlendAmount=Oe(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=Oe(e.backFaceCulling,!0),this.showOutline=Oe(e.showOutline,!0),this.splitDirection=Oe(e.splitDirection,XT.NONE),this._splittingEnabled=!1,this.debugShowBoundingVolume=Oe(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Oe(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=Oe(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=Oe(e.upAxis,Za.Y),this._gltfForwardAxis=Za.Z,this._forwardAxis=e.forwardAxis,this.cull=Oe(e.cull,!0),this.opaquePass=Oe(e.opaquePass,Se.OPAQUE),this._computedModelMatrix=new O,this._clippingPlanesMatrix=O.clone(O.IDENTITY),this._iblReferenceFrameMatrix=Z.clone(Z.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new re,this._state=cx.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,e.dequantizeInShader&&Mo("Model.dequantizeInShader","The Model dequantizeInShader constructor parameter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this._dequantizeInShader=Oe(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._pointsLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._lightColor=h.clone(e.lightColor),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new r5,this._shouldDestroyImageBasedLighting=!0),this._shouldRegenerateShaders=!1}Object.defineProperties(La.prototype,{gltf:{get:function(){return Mo("Model.gltf","Model.gltf getter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this.gltfInternal}},gltfInternal:{get:function(){return l(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return Mo("model.basePath","Model.basePath getter is deprecated in CesiumJS 1.94. It will be removed in CesiumJS 1.97"),this.basePathInternal}},basePathInternal:{get:function(){return this._resource.url}},boundingSphere:{get:function(){let e=this.modelMatrix;this.heightReference!==Bv.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,n=re.clone(this._boundingSphere,this._scaledBoundingSphere);return n.radius*=t,re.transform(n,e,n),l(this._rtcCenter)&&h.add(this._rtcCenter,n.center,n.center),n}},boundingSphereInternal:{get:function(){let e=this.modelMatrix;this.heightReference!==Bv.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);let t=O.getScale(e,GRt),n=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;h.multiplyByScalar(t,n,t);let i=this._scaledBoundingSphere;return i.center=h.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=h.maximumComponent(t)*this._initialRadius,l(this._rtcCenter)&&h.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return Mo("Model.pendingTextureLoads","The Model.pendingTextureLoads getter was deprecated in CesiumJS 1.94 and will be removed in CesiumJS 1.97"),this.pendingTextureLoadsInternal}},pendingTextureLoadsInternal:{get:function(){return l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return l(this._extensionsUsed)||(this._extensionsUsed=Ci.getUsedExtensions(this.gltfInternal)),this._extensionsUsed}},extensionsRequired:{get:function(){return l(this._extensionsRequired)||(this._extensionsRequired=Ci.getRequiredExtensions(this.gltfInternal)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return l(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&uR.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},lightColor:{get:function(){return this._lightColor},set:function(e){let t=this._lightColor;e===t||h.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(t)&&!l(e)||l(e)&&!l(t),this._lightColor=h.clone(e,t))}},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._shouldRegenerateShaders=!0)}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){if(this._showCreditsOnScreen!==e){l(this._credit)&&(this._credit.showOnScreen=e);let t=this._resourceCredits.length;for(let i=0;i<t;i++)this._resourceCredits[i].showOnScreen=e;let n=this._gltfCredits.length;for(let i=0;i<n;i++)this._gltfCredits[i].showOnScreen=e}this._showCreditsOnScreen=e}}});function Twe(e){return e.stencilBuffer}function fJ(e){return!H.equals(e.color,H.WHITE)||e.colorBlendMode!==_5.HIGHLIGHT}function dJ(e){let t=e._clippingPlanes;return l(t)&&t.enabled&&t.length!==0}La.silhouetteSupported=function(e){return Twe(e.context)};function qRt(e){return Hl(e)==="glTF"}La.fromGltf=function(e){let t=e.url;e=Fe(e);let n=Ee.createIfNeeded(t),i=Oe(e.basePath,n.clone()),o=Ee.createIfNeeded(i),r=Oe(e.cacheKey,lwe[_f(n.url)]);l(r)||(r=Nn(),lwe[_f(n.url)]=r),l(e.basePath)&&!l(e.cacheKey)&&(r+=o.url),e.cacheKey=r,e.basePath=o;let s=new La(e),a=ux[r];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(s)):(a=new _R({ready:!1}),a.count=1,a.modelsToLoad.push(s),uJ(s,a),ux[r]=a,l(n.headers.Accept)||(n.headers.Accept=jRt),n.fetchArrayBuffer().then(function(c){let u=new Uint8Array(c);if(qRt(u)){let p=NQ(u);a.makeReady(p)}else{let p=jo(u);a.makeReady(p)}let f=s._resourceCredits,d=n.credits;if(l(d)){let p=d.length;for(let _=0;_<p;_++)f.push(d[_])}}).catch(Ci.getFailedLoadFunction(s,"model",n.url))),s};La._gltfCache=ux;function gR(e,t,n){return e._runtime[t][n]}La.prototype.getNode=function(e){let t=gR(this,"nodesByName",e);return l(t)?t.publicNode:void 0};La.prototype.getMesh=function(e){return gR(this,"meshesByName",e)};La.prototype.getMaterial=function(e){return gR(this,"materialsByName",e)};La.prototype.setArticulationStage=function(e,t){let n=gR(this,"stagesByKey",e),i=gR(this,"articulationsByStageKey",e);l(n)&&l(i)&&(t=P.clamp(t,n.minimumValue,n.maximumValue),P.equalsEpsilon(n.currentValue,t,WRt)||(n.currentValue=t,i.isDirty=!0))};var YRt=new h,oJ=new Z;function Cwe(e,t){let n=e.currentValue,i=YRt,o;switch(e.type){case"xRotate":o=Z.fromRotationX(P.toRadians(n),oJ),O.multiplyByMatrix3(t,o,t);break;case"yRotate":o=Z.fromRotationY(P.toRadians(n),oJ),O.multiplyByMatrix3(t,o,t);break;case"zRotate":o=Z.fromRotationZ(P.toRadians(n),oJ),O.multiplyByMatrix3(t,o,t);break;case"xTranslate":i.x=n,i.y=0,i.z=0,O.multiplyByTranslation(t,i,t);break;case"yTranslate":i.x=0,i.y=n,i.z=0,O.multiplyByTranslation(t,i,t);break;case"zTranslate":i.x=0,i.y=0,i.z=n,O.multiplyByTranslation(t,i,t);break;case"xScale":i.x=n,i.y=1,i.z=1,O.multiplyByScale(t,i,t);break;case"yScale":i.x=1,i.y=n,i.z=1,O.multiplyByScale(t,i,t);break;case"zScale":i.x=1,i.y=1,i.z=n,O.multiplyByScale(t,i,t);break;case"uniformScale":O.multiplyByUniformScale(t,n,t);break;default:break}return t}var XRt=new O;La.prototype.applyArticulations=function(){let e=this._runtime.articulationsByName;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];if(n.isDirty){n.isDirty=!1;let i=n.nodes.length;for(let o=0;o<i;++o){let r=n.nodes[o],s=O.clone(r.originalMatrix,XRt),a=n.stages.length;for(let c=0;c<a;++c){let u=n.stages[c];s=Cwe(u,s)}r.matrix=s}}}};function KRt(e){let t=e.gltfInternal,n=e._loadResources;Ce.buffer(t,function(i,o){n.buffers[o]=i.extras._pipeline.source})}function $Rt(e,t){return function(n){let i=e._loadResources,o=new Uint8Array(n);--i.pendingBufferLoads,e.gltfInternal.buffers[t].extras._pipeline.source=o}}function ZRt(e){let t=e.gltfInternal.bufferViews,n=e._loadResources.vertexBuffersToCreate;Ce.bufferView(e.gltfInternal,function(r,s){r.target===q.ARRAY_BUFFER&&n.enqueue(s)});let i=e._loadResources.indexBuffersToCreate,o={};Ce.accessor(e.gltfInternal,function(r){let s=r.bufferView;if(!l(s))return;t[s].target===q.ELEMENT_ARRAY_BUFFER&&!l(o[s])&&(o[s]=!0,i.enqueue({id:s,componentType:r.componentType}))})}function QRt(e){let t=e.gltfInternal;if(!xo(t,"KHR_techniques_webgl"))return;let n=e._sourcePrograms,i=e._sourceTechniques,o=t.extensions.KHR_techniques_webgl.programs;Ce.technique(t,function(r,s){i[s]=Fe(r);let a=r.program;l(n[a])||(n[a]=Fe(o[a]))})}function JRt(e,t,n){return function(i){let o=e._loadResources;o.shaders[n]={source:i,type:t,bufferView:void 0},--o.pendingShaderLoads,e._rendererResources.sourceShaders[n]=i}}function eOt(e){let t=e.gltfInternal,n=t.buffers,i=t.bufferViews,o=e._rendererResources.sourceShaders;Ce.shader(t,function(r,s){if(l(r.bufferView)){let a=r.bufferView,c=i[a],u=c.buffer,f=n[u],d=ha(f.extras._pipeline.source,c.byteOffset,c.byteLength);o[s]=d}else if(l(r.extras._pipeline.source))o[s]=r.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;let a=e._resource.getDerivedResource({url:r.uri});a.fetchText().then(JRt(e,r.type,s)).catch(Ci.getFailedLoadFunction(e,"shader",a.url))}})}function tOt(e){let t=e._sourceTechniques;for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:n})}}function nOt(e){let t={},n={},i={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=n,e._runtime.stagesByKey=i;let o=e.gltfInternal;if(!xo(o,"AGI_articulations")||!l(o.extensions)||!l(o.extensions.AGI_articulations))return;let r=o.extensions.AGI_articulations.articulations;if(!l(r))return;let s=r.length;for(let a=0;a<s;++a){let c=Fe(r[a]);c.nodes=[],c.isDirty=!0,t[c.name]=c;let u=c.stages.length;for(let f=0;f<u;++f){let d=c.stages[f];d.currentValue=d.initialValue;let p=`${c.name} ${d.name}`;n[p]=c,i[p]=d}}}function Awe(e,t){return function(n){let i=e._loadResources;--i.pendingTextureLoads;let o;Array.isArray(n)&&(o=n.slice(1,n.length).map(function(r){return r.bufferView}),n=n[0]),i.texturesToCreate.enqueue({id:t,image:n,bufferView:n.bufferView,width:n.width,height:n.height,internalFormat:n.internalFormat,mipLevels:o})}}var iOt=/(^data:image\/ktx2)|(\.ktx2$)/i;function oOt(e,t,n){let i=e.gltfInternal,o=i.images,r;Ce.texture(i,function(s,a){let c=s.source;l(s.extensions)&&l(s.extensions.EXT_texture_webp)&&n?c=s.extensions.EXT_texture_webp.source:l(s.extensions)&&l(s.extensions.KHR_texture_basisu)&&t.supportsBasis&&(c=s.extensions.KHR_texture_basisu.source);let u=o[c],f=u.bufferView,d=u.mimeType;if(r=u.uri,l(f))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:f,mimeType:d});else{++e._loadResources.pendingTextureLoads;let p=e._resource.getDerivedResource({url:r}),_;iOt.test(r)?_=fa(p):_=p.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0}),_.then(Awe(e,a,c)).catch(Ci.getFailedLoadFunction(e,"image",p.url))}})}var rOt=new O;function sOt(e){let t={},n={},i=[],o=e._loadResources.skinnedNodesIds,r=e._runtime.articulationsByName;Ce.node(e.gltfInternal,function(s,a){let c={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new O,computedMatrix:new O,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(c.publicNode=new twe(e,s,c,a,Ci.getTransform(s)),t[a]=c,n[s.name]=c,l(s.skin)&&(o.push(a),i.push(c)),l(s.extensions)&&l(s.extensions.AGI_articulations)){let u=s.extensions.AGI_articulations.articulationName;if(l(u)){let f=O.clone(c.publicNode.originalMatrix,rOt),d=r[u];d.nodes.push(c.publicNode);let p=d.stages.length;for(let _=0;_<p;++_){let m=d.stages[_];f=Cwe(m,f)}c.publicNode.matrix=f}}}),e._runtime.nodes=t,e._runtime.nodesByName=n,e._runtime.skinnedNodes=i}function aOt(e){let t=e.gltfInternal,n=e._sourceTechniques,i={},o={},r=e._uniformMaps;Ce.material(t,function(s,a){r[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};let c=new Qve(e,s,a);if(l(s.extensions)&&l(s.extensions.KHR_techniques_webgl)){let u=s.extensions.KHR_techniques_webgl.technique;c._technique=u,c._program=n[u].program,Ce.materialValue(s,function(f,d){l(c._values)||(c._values={}),c._values[d]=Fe(f)})}i[s.name]=c,o[a]=c}),e._runtime.materialsByName=i,e._runtime.materialsById=o}function cOt(e){let t={},n=e._runtime.materialsById;Ce.mesh(e.gltfInternal,function(i,o){t[i.name]=new ewe(i,n,o),(l(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&Ce.meshPrimitive(i,function(r,s){let a=pJ(e,r),c=e._programPrimitives[a];l(c)||(c={},e._programPrimitives[a]=c),c[`${o}.primitive.${s}`]=r})}),e._runtime.meshesByName=t}function lOt(e){let n=e.gltfInternal.asset.copyright;if(!l(n))return;let i=e._showCreditsOnScreen,o=n.split(";").map(function(r){return new _t(r.trim(),i)});e._gltfCredits=o}var hJ=function(){this.id=void 0,this.model=void 0,this.context=void 0};hJ.prototype.set=function(e,t,n){this.id=e,this.model=t,this.context=n};hJ.prototype.execute=function(){Ewe(this.id,this.model,this.context)};function Ewe(e,t,n){let i=t._loadResources,r=t.gltfInternal.bufferViews[e];l(r)||(r=i.createdBufferViews[e]);let s=st.createVertexBuffer({context:n,typedArray:i.getBuffer(r),usage:Ne.STATIC_DRAW});s.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=s,t._geometryByteLength+=s.sizeInBytes}var mJ=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};mJ.prototype.set=function(e,t,n,i){this.id=e,this.componentType=t,this.model=n,this.context=i};mJ.prototype.execute=function(){Swe(this.id,this.componentType,this.model,this.context)};function Swe(e,t,n,i){let o=n._loadResources,s=n.gltfInternal.bufferViews[e];l(s)||(s=o.createdBufferViews[e]);let a=st.createIndexBuffer({context:i,typedArray:o.getBuffer(s),usage:Ne.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,n._rendererResources.buffers[e]=a,n._geometryByteLength+=a.sizeInBytes}var uwe=new hJ,fwe=new mJ;function uOt(e,t){let n=e._loadResources;if(n.pendingBufferLoads!==0)return;let i=t.context,o=n.vertexBuffersToCreate,r=n.indexBuffersToCreate,s;if(e.asynchronous){for(;o.length>0&&(uwe.set(o.peek(),e,i),!!t.jobScheduler.execute(uwe,dR.BUFFER));)o.dequeue();for(;r.length>0&&(s=r.peek(),fwe.set(s.id,s.componentType,e,i),!!t.jobScheduler.execute(fwe,dR.BUFFER));)r.dequeue()}else{for(;o.length>0;)Ewe(o.dequeue(),e,i);for(;r.length>0;)s=r.dequeue(),Swe(s.id,s.componentType,e,i)}}function pJ(e,t){let n=e._runtime.materialsById[t.material];if(l(n))return n._program}function vwe(e,t,n){let i,o=n._programPrimitives[t];if(!l(o))return e;let r;for(r in o)if(o.hasOwnProperty(r)&&(i=o[r],pJ(n,i)===t))break;n._programPrimitives[t]=void 0;let s;if(n.extensionsUsed.WEB3D_quantized_attributes)s=Ci.modifyShaderForQuantizedAttributes(n.gltfInternal,i,e),n._quantizedUniforms[t]=s.uniforms;else{let a=n._decodedData[r];if(l(a))s=Ci.modifyShaderForDracoQuantizedAttributes(n.gltfInternal,i,e,a.attributes);else return e}return s.shader}function fOt(e){return e=Be.replaceMain(e,"gltf_blend_main"),e+=`uniform vec4 gltf_color; -uniform float gltf_colorBlend; -out vec4 fragColor; -void main() -{ - gltf_blend_main(); - fragColor.rgb = mix(fragColor.rgb, gltf_color.rgb, gltf_colorBlend); - float highlight = ceil(gltf_colorBlend); - fragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); - fragColor.a *= gltf_color.a; -} -`,e}function yR(e,t,n){return l(n)&&(e=n(e,t)),e}var _J=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};_J.prototype.set=function(e,t,n){this.programToCreate=e,this.model=t,this.context=n};_J.prototype.execute=function(){wwe(this.programToCreate,this.model,this.context)};function wwe(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=s[r.vertexShader],c=s[r.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){let m=u[i];l(m)||(m=vwe(a,i,t),u[i]=m),a=m}let f=yR(a,i,t._vertexShaderLoaded),d=yR(c,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(d=`uniform vec4 czm_pickColor; -${d}`);let p=t._imageBasedLighting,_=p.enabled;if(_&&(d=`#define USE_IBL_LIGHTING - -${d}`),l(t._lightColor)&&(d=`#define USE_CUSTOM_LIGHT_COLOR - -${d}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(d=Be.replaceMain(d,"non_gamma_corrected_main"),d=`${d} -out vec4 fragColor; -void main() { - non_gamma_corrected_main(); - fragColor = czm_gammaCorrect(fragColor); -} -`),Lv.isSupported(n)){let m=p.useSphericalHarmonicCoefficients,y=p.useSpecularEnvironmentMaps;(m||y||_)&&(d=`uniform mat3 gltf_iblReferenceFrameMatrix; -${d}`),l(p.sphericalHarmonicCoefficients)?d=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${d}`:p.useDefaultSphericalHarmonics&&(d=`#define DIFFUSE_IBL -${d}`),l(p.specularEnvironmentMapAtlas)&&p.specularEnvironmentMapAtlas.ready?d=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${d}`:p.useDefaultSpecularMaps&&(d=`#define SPECULAR_IBL -${d}`)}l(p.luminanceAtZenith)&&(d=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${d}`),Iwe(i,o,d,f,t,n)}function dOt(e,t,n){let i=e.programId,o=e.techniqueId,r=t._sourcePrograms[i],s=t._rendererResources.sourceShaders,a=t._quantizedVertexShaders,c=t.clippingPlanes,u=dJ(t),f=s[r.vertexShader],d=s[r.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(f=a[i]);let p=d;fJ(t)&&(p=La._modifyShaderForColor(p)),u&&(p=pMt(p,c,n)),t.splitDirection!==XT.NONE&&(p=tJ.modifyFragmentShader(p));let _=yR(f,i,t._vertexShaderLoaded),m=yR(p,i,t._fragmentShaderLoaded);l(t._uniformMapLoaded)||(m=`uniform vec4 czm_pickColor; -${m}`);let y=t._imageBasedLighting,x=y.enabled;if(x&&(m=`#define USE_IBL_LIGHTING - -${m}`),l(t._lightColor)&&(m=`#define USE_CUSTOM_LIGHT_COLOR - -${m}`),(t._sourceVersion!=="2.0"||t._sourceKHRTechniquesWebGL)&&(m=Be.replaceMain(m,"non_gamma_corrected_main"),m=`${m} -out vec4 fragColor; -void main() { - non_gamma_corrected_main(); - fragColor = czm_gammaCorrect(fragColor); -} -`),Lv.isSupported(n)){let b=y.useSphericalHarmonicCoefficients,T=y.useSpecularEnvironmentMaps;(b||T||x)&&(m=`uniform mat3 gltf_iblReferenceFrameMatrix; -${m}`),l(y.sphericalHarmonicCoefficients)?m=`#define DIFFUSE_IBL -#define CUSTOM_SPHERICAL_HARMONICS -uniform vec3 gltf_sphericalHarmonicCoefficients[9]; -${m}`:y.useDefaultSphericalHarmonics&&(m=`#define DIFFUSE_IBL -${m}`),l(y.specularEnvironmentMapAtlas)&&y.specularEnvironmentMapAtlas.ready?m=`#define SPECULAR_IBL -#define CUSTOM_SPECULAR_IBL -uniform sampler2D gltf_specularMap; -uniform vec2 gltf_specularMapSize; -uniform float gltf_maxSpecularLOD; -${m}`:y.useDefaultSpecularMaps&&(m=`#define SPECULAR_IBL -${m}`)}l(y.luminanceAtZenith)&&(m=`#define USE_SUN_LUMINANCE -uniform float gltf_luminanceAtZenith; -${m}`),Iwe(i,o,m,_,t,n)}function Iwe(e,t,n,i,o,r){let s=o._sourceTechniques[t],a=Ci.createAttributeLocations(s,o._precreatedAttributes);o._rendererResources.programs[e]=Xt.fromCache({context:r,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:a})}var dwe=new _J;function hOt(e,t){let n=e._loadResources,i=n.programsToCreate;if(n.pendingShaderLoads!==0||n.pendingBufferLoads!==0)return;let o=t.context;if(e.asynchronous)for(;i.length>0&&(dwe.set(i.peek(),e,o),!!t.jobScheduler.execute(dwe,dR.PROGRAM));)i.dequeue();else for(;i.length>0;)wwe(i.dequeue(),e,o)}function mOt(e,t){return function(n){e.texturesToCreate.enqueue({id:t.id,image:n,bufferView:void 0}),--e.pendingBufferViewToImage}}function pOt(e){let t=e._loadResources;if(t.pendingBufferLoads===0)for(;t.texturesToCreateFromBufferView.length>0;){let n=t.texturesToCreateFromBufferView.dequeue(),i=e.gltfInternal,o=i.bufferViews[n.bufferView],r=i.textures[n.id].source,s=Ci.getFailedLoadFunction(e,"image",`id: ${n.id}, bufferView: ${n.bufferView}`);if(n.mimeType==="image/ktx2"){let a=new Uint8Array(t.getBuffer(o));fa(a).then(Awe(e,n.id,r)).catch(s),++e._loadResources.pendingTextureLoads}else{let a=mOt(t,n);Jg({uint8Array:t.getBuffer(o),format:n.mimeType,flipY:!1,skipColorSpaceConversion:!0}).then(a).catch(s),++t.pendingBufferViewToImage}}}function _Ot(e){let t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;let n=e._rendererResources.samplers;Ce.sampler(e.gltfInternal,function(i,o){n[o]=new zt({wrapS:i.wrapS,wrapT:i.wrapT,minificationFilter:i.minFilter,magnificationFilter:i.magFilter})})}}var gJ=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};gJ.prototype.set=function(e,t,n){this.gltfTexture=e,this.model=t,this.context=n};gJ.prototype.execute=function(){Pwe(this.gltfTexture,this.model,this.context)};function Pwe(e,t,n){let o=t.gltfInternal.textures[e.id],s=t._rendererResources.samplers[o.sampler];l(s)||(s=new zt({wrapS:sn.REPEAT,wrapT:sn.REPEAT}));let a=!1,c=t.gltfInternal.materials,u=c.length;for(let C=0;C<u;++C){let A=c[C];if(l(A.extensions)&&l(A.extensions.KHR_techniques_webgl)){let S=A.extensions.KHR_techniques_webgl.values;for(let w in S)if(S.hasOwnProperty(w)&&w.indexOf("Texture")!==-1){let R=S[w];if(R.index===e.id&&l(R.extensions)&&l(R.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}let f=s.wrapS,d=s.wrapT,p=s.minificationFilter;a&&p!==ft.LINEAR&&p!==ft.NEAREST&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR?p=ft.NEAREST:p=ft.LINEAR,s=new zt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:p,magnificationFilter:s.magnificationFilter}));let _=e.internalFormat,m=!(l(_)&&je.isCompressedFormat(_))&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR||p===ft.LINEAR_MIPMAP_NEAREST||p===ft.LINEAR_MIPMAP_LINEAR),y=m||f===sn.REPEAT||f===sn.MIRRORED_REPEAT||d===sn.REPEAT||d===sn.MIRRORED_REPEAT,x,b,T=e.image;if(l(_)){x=!P.isPowerOfTwo(e.width)||!P.isPowerOfTwo(e.height),!n.webgl2&&je.isCompressedFormat(_)&&x&&y&&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. See the Model.js constructor documentation for more information.");let C=s.minificationFilter;!l(e.mipLevels)&&(p===ft.NEAREST_MIPMAP_NEAREST||p===ft.NEAREST_MIPMAP_LINEAR)?C=ft.NEAREST:!l(e.mipLevels)&&(p===ft.LINEAR_MIPMAP_NEAREST||p===ft.LINEAR_MIPMAP_LINEAR)&&(C=ft.LINEAR),s=new zt({wrapS:s.wrapS,wrapT:s.wrapT,minificationFilter:C,magnificationFilter:s.magnificationFilter}),b=new dt({context:n,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:_,sampler:s})}else if(l(T)){if(x=!P.isPowerOfTwo(T.width)||!P.isPowerOfTwo(T.height),y&&x){let C=document.createElement("canvas");C.width=P.nextPowerOfTwo(T.width),C.height=P.nextPowerOfTwo(T.height),C.getContext("2d").drawImage(T,0,0,T.width,T.height,0,0,C.width,C.height),T=C}b=new dt({context:n,source:T,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1,skipColorSpaceConversion:!0}),m&&b.generateMipmap()}l(b)&&(t._rendererResources.textures[e.id]=b,t._texturesByteLength+=b.sizeInBytes)}var hwe=new gJ;function gOt(e,t){let n=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(hwe.set(i.peek(),e,n),!!t.jobScheduler.execute(hwe,dR.TEXTURE));)i.dequeue();else for(;i.length>0;)Pwe(i.dequeue(),e,n)}function yOt(e,t){let n=e._sourceTechniques,i={},o,r,s=e._runtime.materialsById[t.material];if(!l(s))return i;let a=n[s._technique];if(!l(a))return i;let c=a.attributes,f=e._rendererResources.programs[a.program]._attributeLocations;for(o in f)if(f.hasOwnProperty(o)){let p=c[o];l(p)&&(r=f[o],i[p.semantic]=r)}let d=e._precreatedAttributes;if(l(d))for(o in d)d.hasOwnProperty(o)&&(r=f[o],i[o]=r);return i}function xOt(e,t){let n=e.gltfInternal,i=n.skins,o=n.nodes,r=e._runtime.nodes,s=e._loadResources.skinnedNodesIds,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=r[u],d=o[u],p=t[d.skin];f.inverseBindMatrices=p.inverseBindMatrices,f.bindShapeMatrix=p.bindShapeMatrix;let _=i[d.skin].joints,m=_.length;for(let y=0;y<m;++y){let x=_[y],b=r[x];f.joints.push(b)}}}function bOt(e){let t=e._loadResources;if(t.pendingBufferLoads!==0||!t.createSkins)return;t.createSkins=!1;let n=e.gltfInternal,i=n.accessors,o={};Ce.skin(n,function(r,s){let a=i[r.inverseBindMatrices],c;O.equals(r.bindShapeMatrix,O.IDENTITY)||(c=O.clone(r.bindShapeMatrix)),o[s]={inverseBindMatrices:hR.getSkinInverseBindMatrices(e,a),bindShapeMatrix:c}}),xOt(e,o)}function TOt(e,t,n,i){return function(o){l(i)&&(o=e.clampAnimations?i.clampTime(o):i.wrapTime(o),t[n]=i.evaluate(o,t[n]),t.dirtyNumber=e._maxDirtyNumber)}}function COt(e){let t=e._loadResources;if(!t.finishedPendingBufferLoads()||!t.createRuntimeAnimations)return;t.createRuntimeAnimations=!1,e._runtime.animations=[];let n=e._runtime.nodes,i=e.gltfInternal.accessors;Ce.animation(e.gltfInternal,function(o,r){let s=o.channels,a=o.samplers,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=s.length,d=new Array(f);for(let p=0;p<f;++p){let _=s[p],m=_.target,y=m.path,x=a[_.sampler],b=hR.getAnimationParameterValues(e,i[x.input]),T=hR.getAnimationParameterValues(e,i[x.output]);c=Math.min(c,b[0]),u=Math.max(u,b[b.length-1]);let C=hR.getAnimationSpline(e,r,o,_.sampler,x,b,y,T);d[p]=TOt(e,n[m.node],m.path,C)}e._runtime.animations[r]={name:o.name,startTime:c,stopTime:u,channelEvaluators:d}})}function mwe(e,t){let n=e._loadResources;if(!n.finishedBuffersCreation()||!n.finishedProgramCreation()||!n.createVertexArrays)return;n.createVertexArrays=!1;let i=e._rendererResources.buffers,o=e._rendererResources.vertexArrays,r=e.gltfInternal,s=r.accessors;Ce.mesh(r,function(a,c){Ce.meshPrimitive(a,function(u,f){let d=[],p,_=yOt(e,u),m=e._decodedData[`${c}.primitive.${f}`];Ce.meshPrimitiveAttribute(u,function(C,A){if(p=_[A],l(p)){if(l(m)){let R=m.attributes;if(R.hasOwnProperty(A)){let D=R[A];d.push({index:p,vertexBuffer:i[D.bufferView],componentsPerAttribute:D.componentsPerAttribute,componentDatatype:D.componentDatatype,normalize:D.normalized,offsetInBytes:D.byteOffset,strideInBytes:D.byteStride});return}}let S=s[C],w=l(S.normalized)&&S.normalized;d.push({index:p,vertexBuffer:i[S.bufferView],componentsPerAttribute:mu(S.type),componentDatatype:S.componentType,normalize:w,offsetInBytes:S.byteOffset,strideInBytes:rf(r,S)})}});let y,x,b=e._precreatedAttributes;if(l(b))for(x in b)b.hasOwnProperty(x)&&(p=_[x],l(p)&&(y=b[x],y.index=p,d.push(y)));let T;if(l(u.indices)){let A=s[u.indices].bufferView;l(m)&&(A=m.bufferView),T=i[A]}o[`${c}.primitive.${f}`]=new qn({context:t,attributes:d,indexBuffer:T})})})}function AOt(e){let t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,Ce.material(e.gltfInternal,function(n,i){EOt(e,n,i)}))}function EOt(e,t,n){let i=e._rendererResources.renderStates,o=[q.FUNC_ADD,q.FUNC_ADD],r=[q.ONE,q.ONE_MINUS_SRC_ALPHA,q.ONE,q.ONE_MINUS_SRC_ALPHA];l(t.extensions)&&l(t.extensions.KHR_blend)&&(o=t.extensions.KHR_blend.blendEquation,r=t.extensions.KHR_blend.blendFactors);let s=!t.doubleSided,a=t.alphaMode==="BLEND";i[n]=ze.fromCache({cull:{enabled:s},depthTest:{enabled:!0,func:Nve.LESS_OR_EQUAL},depthMask:!a,blending:{enabled:a,equationRgb:o[0],equationAlpha:o[1],functionSourceRgb:r[0],functionDestinationRgb:r[1],functionSourceAlpha:r[2],functionDestinationAlpha:r[3]}})}var SOt={MODEL:function(e,t,n){return function(){return n.computedMatrix}},VIEW:function(e,t,n){return function(){return e.view}},PROJECTION:function(e,t,n){return function(){return e.projection}},MODELVIEW:function(e,t,n){let i=new O;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,n){let i=new O;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i),O.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,n){let i=new O;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i),O.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,n){let i=new O;return function(){return O.inverse(n.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,n){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,n){let i=new O,o=new O;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i),O.inverse(i,o)}},MODELVIEWPROJECTIONINVERSE:function(e,t,n){let i=new O,o=new O;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i),O.multiply(e._projection,i,i),O.inverse(i,o)}},MODELINVERSETRANSPOSE:function(e,t,n){let i=new O,o=new Z;return function(){return O.inverse(n.computedMatrix,i),O.getMatrix3(i,o),Z.transpose(o,o)}},MODELVIEWINVERSETRANSPOSE:function(e,t,n){let i=new O,o=new O,r=new Z;return function(){return O.multiplyTransformation(e.view,n.computedMatrix,i),O.inverse(i,o),O.getMatrix3(o,r),Z.transpose(r,r)}},VIEWPORT:function(e,t,n){return function(){return e.viewportCartesian4}}};function vOt(e,t,n,i){let o=t._runtime.nodes[e];return SOt[n](i,t,o)}function wOt(e,t,n,i,o,r,s){let a={},c={},u,f;return Ce.techniqueUniform(n,function(d,p){let _;if(l(i)&&l(i[p]))_=Ci.createUniformFunction(d.type,i[p],r,s),a[p]=_.func,c[p]=_;else if(l(d.node))a[p]=vOt(d.node,e,d.semantic,o.uniformState);else if(l(d.semantic))if(d.semantic==="JOINTMATRIX")u=p;else if(d.semantic==="MORPHWEIGHTS")f=p;else if(d.semantic==="ALPHACUTOFF"){let m=t.alphaMode;if(l(m)&&m==="MASK"){let y=Oe(t.alphaCutoff,.5);_=Ci.createUniformFunction(d.type,y,r,s),a[p]=_.func,c[p]=_}}else a[p]=Ci.getGltfSemanticUniforms()[d.semantic](o.uniformState,e);else if(l(d.value)){let m=Ci.createUniformFunction(d.type,d.value,r,s);a[p]=m.func,c[p]=m}}),{map:a,values:c,jointMatrixUniformName:u,morphWeightsUniformName:f}}function IOt(e,t){let n=e._loadResources;if(!n.finishedProgramCreation()||!n.createUniformMaps)return;n.createUniformMaps=!1;let i=e.gltfInternal,o=e._sourceTechniques,r=e._uniformMaps,s=e._rendererResources.textures,a=e._defaultTexture;Ce.material(i,function(c,u){let f=e._runtime.materialsById[u],d=o[f._technique],p=f._values,_=wOt(e,c,d,p,t,s,a),m=r[u];if(m.uniformMap=_.map,m.values=_.values,m.jointMatrixUniformName=_.jointMatrixUniformName,m.morphWeightsUniformName=_.morphWeightsUniformName,l(d.attributes.a_outlineCoordinates)){let y=$Q.createTexture(e,t);m.uniformMap.u_outlineTexture=function(){return y}}})}function POt(e){return Ci.createUniformsForDracoQuantizedAttributes(e.attributes)}function DOt(e,t){let n=pJ(e,t),i=e._quantizedUniforms[n];return Ci.createUniformsForQuantizedAttributes(e.gltfInternal,t,i)}function ROt(e){return function(){return e}}function OOt(e){return function(){return e.computedJointMatrices}}function MOt(e){return function(){return e.weights}}function LOt(e){return function(){return e.silhouetteColor}}function NOt(e){return function(){return e.silhouetteSize}}function FOt(e){return function(){return e.color}}function BOt(e){return function(){return e._clippingPlanesMatrix}}function kOt(e){return function(){return e._iblReferenceFrameMatrix}}function UOt(e){return function(){let t=e.clippingPlanes;return!l(t)||!t.enabled?e._defaultTexture:t.texture}}function zOt(e){return function(){let t=e.clippingPlanes;if(!l(t))return H.WHITE.withAlpha(0);let n=H.clone(t.edgeColor);return n.alpha=t.edgeWidth,n}}function VOt(e){return function(){return _5.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function HOt(e){return function(){return e._imageBasedLighting.imageBasedLightingFactor}}function GOt(e){return function(){return e._lightColor}}function jOt(e){return function(){return e._imageBasedLighting.luminanceAtZenith}}function WOt(e){return function(){return e._imageBasedLighting.sphericalHarmonicCoefficients}}function qOt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture}}function YOt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions}}function XOt(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel}}function KOt(e,t){switch(e.mode){case Le.TRIANGLES:return t/3;case Le.TRIANGLE_STRIP:case Le.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function $Ot(e,t,n,i,o){let r=e._nodeCommands,s=e._pickIds,a=e.allowPicking,c=e._runtime.meshesByName,u=e._rendererResources,f=u.vertexArrays,d=u.programs,p=u.renderStates,_=e._uniformMaps,m=e.gltfInternal,y=m.accessors,x=m.meshes,b=t.mesh,T=x[b],C=T.primitives,A=C.length;for(let S=0;S<A;++S){let w=C[S],R=y[w.indices],M=e._runtime.materialsById[w.material]._program,L=e._decodedData[`${b}.primitive.${S}`],g,E=w.attributes.POSITION;if(l(E)){let ge=Ci.getAccessorMinMax(m,E);g=re.fromCornerPoints(h.fromArray(ge.min),h.fromArray(ge.max))}let v=f[`${b}.primitive.${S}`],I,N;l(L)?(N=L.numberOfIndices,I=0):l(R)?(N=R.count,I=R.byteOffset/ke.getSizeInBytes(R.componentType)):(N=y[w.attributes.POSITION].count,I=0),e._trianglesLength+=KOt(w,N),w.mode===Le.POINTS&&(e._pointsLength+=N);let F=_[w.material],U=F.uniformMap;if(l(F.jointMatrixUniformName)){let ge={};ge[F.jointMatrixUniformName]=OOt(n),U=ct(U,ge)}if(l(F.morphWeightsUniformName)){let ge={};ge[F.morphWeightsUniformName]=MOt(n),U=ct(U,ge)}U=ct(U,{gltf_color:FOt(e),gltf_colorBlend:VOt(e),gltf_clippingPlanes:UOt(e),gltf_clippingPlanesEdgeStyle:zOt(e),gltf_clippingPlanesMatrix:BOt(e),gltf_iblReferenceFrameMatrix:kOt(e),gltf_iblFactor:HOt(e),gltf_lightColor:GOt(e),gltf_sphericalHarmonicCoefficients:WOt(e),gltf_specularMap:qOt(e),gltf_specularMapSize:YOt(e),gltf_maxSpecularLOD:XOt(e),gltf_luminanceAtZenith:jOt(e)}),tJ.addUniforms(e,U),l(e._uniformMapLoaded)&&(U=e._uniformMapLoaded(U,M,n));let k={};e.extensionsUsed.WEB3D_quantized_attributes?k=DOt(e,w):e._dequantizeInShader&&l(L)&&(k=POt(L)),U=ct(U,k);let z=p[w.material],B=z.blending.enabled,j=e._pickObject;l(j)||(j={primitive:e,id:e.id,node:n.publicNode,mesh:c[T.name]});let W=vp.castShadows(e._shadows),J=vp.receiveShadows(e._shadows),Y;if(a&&!l(e._uniformMapLoaded)){Y=i.createPickId(j),s.push(Y);let ge={czm_pickColor:ROt(Y.color)};U=ct(U,ge)}a&&(l(e._pickIdLoaded)&&l(e._uniformMapLoaded)?Y=e._pickIdLoaded():Y="czm_pickColor");let ee=new qe({boundingVolume:new re,cull:e.cull,modelMatrix:new O,primitiveType:w.mode,vertexArray:v,count:N,offset:I,shaderProgram:d[M],castShadows:W,receiveShadows:J,uniformMap:U,renderState:z,owner:j,pass:B?Se.TRANSLUCENT:e.opaquePass,pickId:Y}),Q;o||(Q=qe.shallowClone(ee),Q.boundingVolume=new re,Q.modelMatrix=new O);let de={show:!0,boundingSphere:g,command:ee,command2D:Q,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:M};n.commands.push(de),r.push(de)}}function ZOt(e,t,n){let i=e._loadResources;if(!i.finishedEverythingButTextureCreation()||!i.createRuntimeNodes)return;i.createRuntimeNodes=!1;let o=[],r=e._runtime.nodes,s=e.gltfInternal,a=s.nodes,u=s.scenes[s.scene].nodes,f=u.length,d=[],p={};for(let _=0;_<f;++_)for(d.push({parentRuntimeNode:void 0,gltfNode:a[u[_]],id:u[_]});d.length>0;){let m=d.pop();p[m.id]=!0;let y=m.parentRuntimeNode,x=m.gltfNode,b=r[m.id];if(b.parents.length===0)if(l(x.matrix))b.matrix=O.fromColumnMajorArray(x.matrix);else{let C=x.rotation;b.translation=h.fromArray(x.translation),b.rotation=Pe.unpack(C),b.scale=h.fromArray(x.scale)}l(y)?(y.children.push(b),b.parents.push(y)):o.push(b),l(x.mesh)&&$Ot(e,x,b,t,n);let T=x.children;if(l(T)){let C=T.length;for(let A=0;A<C;A++){let S=T[A];p[S]||d.push({parentRuntimeNode:b,gltfNode:a[S],id:T[A]})}}}e._runtime.rootNodes=o,e._runtime.nodes=r}function QOt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function JOt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}function pwe(e,t){let n=t.context,i=t.scene3DOnly,o=e._quantizedVertexShaders,r=e._sourceTechniques,s=e._sourcePrograms,a=e._rendererResources,c=a.sourceShaders;e._loadRendererResourcesFromCache&&(c=a.sourceShaders=e._cachedRendererResources.sourceShaders);for(let u in r)if(r.hasOwnProperty(u)){let f=r[u].program,d=s[f],p=c[d.vertexShader];if(Ci.checkSupportedGlExtensions(d.glExtensions,n),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){let _=o[f];l(_)||(_=vwe(p,f,e),o[f]=_),p=_}p=yR(p,f,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){let u=e._cachedRendererResources;a.buffers=u.buffers,a.vertexArrays=u.vertexArrays,a.programs=u.programs,a.silhouettePrograms=u.silhouettePrograms,a.textures=u.textures,a.samplers=u.samplers,a.renderStates=u.renderStates,l(e._precreatedAttributes)&&mwe(e,n),e._cachedGeometryByteLength+=QOt(u.buffers),e._cachedTexturesByteLength+=JOt(u.textures)}else uOt(e,t),hOt(e,t),_Ot(e,n),pOt(e),gOt(e,t);bOt(e),COt(e),e._loadRendererResourcesFromCache||(mwe(e,n),AOt(e)),IOt(e,n),ZOt(e,n,i)}function _we(e,t){let n=e.publicNode,i=n.matrix;n.useMatrix&&l(i)?O.clone(i,t):l(e.matrix)?O.clone(e.matrix,t):(O.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),n.setMatrix(t))}var Dwe=[],eMt=new ie,rJ=new O;function tMt(e,t,n,i){let o=e._maxDirtyNumber,r=e._runtime.rootNodes,s=r.length,a=Dwe,c=e._computedModelMatrix;if(e._mode!==Sd.SCENE3D&&!e._ignoreCommands){let u=O.getColumn(c,3,eMt);if(!ie.equals(u,ie.UNIT_W))c=Et.basisTo2D(i,c,rJ),e._rtcCenter=e._rtcCenter3D;else{let f=e.boundingSphereInternal.center,d=Et.wgs84To2DModelMatrix(i,f,rJ);c=O.multiply(d,c,rJ),l(e._rtcCenter)&&(O.setTranslation(c,ie.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)}}for(let u=0;u<s;++u){let f=r[u];for(_we(f,f.transformToRoot),a.push(f);a.length>0;){f=a.pop();let d=f.transformToRoot,p=f.commands;if(f.dirtyNumber===o||t||n){let m=O.multiplyTransformation(c,d,f.computedMatrix),y=p.length;if(y>0)for(let x=0;x<y;++x){let b=p[x],T=b.command;O.clone(m,T.modelMatrix),re.transform(b.boundingSphere,T.modelMatrix,T.boundingVolume),l(e._rtcCenter)&&h.add(e._rtcCenter,T.boundingVolume.center,T.boundingVolume.center),T=b.command2D,l(T)&&e._mode===Sd.SCENE2D&&(O.clone(m,T.modelMatrix),T.modelMatrix[13]-=P.sign(T.modelMatrix[13])*2*P.PI*i.ellipsoid.maximumRadius,re.transform(b.boundingSphere,T.modelMatrix,T.boundingVolume))}}let _=f.children;if(l(_)){let m=_.length;for(let y=0;y<m;++y){let x=_[y];x.dirtyNumber=Math.max(x.dirtyNumber,f.dirtyNumber),(x.dirtyNumber===o||n)&&(_we(x,x.transformToRoot),O.multiplyTransformation(d,x.transformToRoot,x.transformToRoot)),a.push(x)}}}}++e._maxDirtyNumber}var sJ=new O;function nMt(e){let t=e._runtime.skinnedNodes,n=t.length;for(let i=0;i<n;++i){let o=t[i];sJ=O.inverseTransformation(o.transformToRoot,sJ);let r=o.computedJointMatrices,s=o.joints,a=o.bindShapeMatrix,c=o.inverseBindMatrices,u=c.length;for(let f=0;f<u;++f)l(r[f])||(r[f]=new O),r[f]=O.multiplyTransformation(sJ,s[f].transformToRoot,r[f]),r[f]=O.multiplyTransformation(r[f],c[f],r[f]),l(a)&&(r[f]=O.multiplyTransformation(r[f],a,r[f]))}}function iMt(e){let t=e._runtime.rootNodes,n=t.length,i=Dwe;for(let o=0;o<n;++o){let r=t[o];for(r.computedShow=r.publicNode.show,i.push(r);i.length>0;){r=i.pop();let s=r.computedShow,a=r.commands,c=a.length;for(let f=0;f<c;++f)a[f].show=s;let u=r.children;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let p=u[d];p.computedShow=s&&p.publicNode.show,i.push(p)}}}}}function oMt(e,t){let n=e.id;if(e._id!==n){e._id=n;let i=e._pickIds,o=i.length;for(let r=0;r<o;++r)i[r].object.id=n}}function rMt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;let t=e.debugWireframe?Le.LINES:Le.TRIANGLES,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.primitiveType=t}}function sMt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let t=e.debugShowBoundingVolume,n=e._nodeCommands,i=n.length;for(let o=0;o<i;++o)n[o].command.debugShowBoundingVolume=t}}function aMt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;let t=vp.castShadows(e.shadows),n=vp.receiveShadows(e.shadows),i=e._nodeCommands,o=i.length;for(let r=0;r<o;r++){let s=i[r];s.command.castShadows=t,s.command.receiveShadows=n}}}function cMt(e,t){let n=Fe(t,!0);return n.cull.enabled=!1,n.depthTest.enabled=!0,n.depthMask=!1,n.blending=zQ.ALPHA_BLEND,e.opaquePass===Se.CESIUM_3D_TILE&&(n.stencilTest=iJ.setCesium3DTileBit(),n.stencilMask=iJ.CESIUM_3D_TILE_MASK),ze.fromCache(n)}function gwe(e,t){let n=qe.shallowClone(t);return n.pass=Se.TRANSLUCENT,n.renderState=cMt(e,t.renderState),n}function Rwe(e,t,n){let i=t.scene3DOnly,o=e.color.alpha;if(o>0&&o<1){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].translucentCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.translucentCommand=gwe(e,u),!i){let f=c.command2D;c.translucentCommand2D=gwe(e,f)}}}}function lMt(e){let t=Fe(e,!0);return t.cull.enabled=!1,ze.fromCache(t)}function ywe(e){let t=qe.shallowClone(e);return t.renderState=lMt(e.renderState),t}function Owe(e,t,n){let i=t.scene3DOnly;if(!e.backFaceCulling){let r=e._nodeCommands,s=r.length;if(s>0&&(!l(r[0].disableCullingCommand)||n))for(let a=0;a<s;++a){let c=r[a],u=c.command;if(c.disableCullingCommand=ywe(u),!i){let f=c.command2D;c.disableCullingCommand2D=ywe(f)}}}}function uMt(e,t){let n=e._rendererResources.programs;for(let i in n)if(n.hasOwnProperty(i)&&n[i]===t)return i}function fMt(e,t,n){let i=t.vertexShaderSource.sources[0],o=t._attributeLocations,r=e._normalAttributeName;return i=Be.replaceMain(i,"gltf_silhouette_main"),i+=`uniform float gltf_silhouetteSize; -void main() -{ - gltf_silhouette_main(); - vec3 n = normalize(czm_normal3D * ${r}); - n.x *= czm_projection[0][0]; - n.y *= czm_projection[1][1]; - vec4 clip = gl_Position; - clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; - gl_Position = clip; -}`,Xt.fromCache({context:n.context,vertexShaderSource:i,fragmentShaderSource:`uniform vec4 gltf_silhouetteColor; -out vec4 fragColor; -void main() -{ - fragColor = czm_gammaCorrect(gltf_silhouetteColor); -}`,attributeLocations:o})}function Mwe(e,t){return Twe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&l(e._normalAttributeName)}function dMt(e){let t=e._nodeCommands,n=t.length;for(let i=0;i<n;++i)if(t[i].command.pass===Se.TRANSLUCENT)return!0;return!1}function cJ(e){return e.color.alpha>0&&e.color.alpha<1}function Lwe(e){return e.color.alpha===0}function xwe(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var hMt=0;function mMt(e,t){let n=++hMt%255,i=dMt(e)||cJ(e)||e.silhouetteColor.alpha<1,o=e._rendererResources.silhouettePrograms,r=t.scene3DOnly,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c],f=u.command,d=cJ(e)?u.translucentCommand:f,p=qe.shallowClone(d),_=Fe(d.renderState);_.stencilTest={enabled:!0,frontFunction:q.ALWAYS,backFunction:q.ALWAYS,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.REPLACE}},Lwe(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=ze.fromCache(_),p.renderState=_,u.silhouetteModelCommand=p;let m=qe.shallowClone(f);_=Fe(f.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,i&&(m.pass=Se.TRANSLUCENT,_.depthMask=!1,_.blending=zQ.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:q.NOTEQUAL,backFunction:q.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP},backOperation:{fail:q.KEEP,zFail:q.KEEP,zPass:q.KEEP}},_=ze.fromCache(_);let y=f.shaderProgram,x=uMt(e,y),b=o[x];l(b)||(b=fMt(e,y,t),o[x]=b);let T=ct(f.uniformMap,{gltf_silhouetteColor:LOt(e),gltf_silhouetteSize:NOt(e)});if(m.renderState=_,m.shaderProgram=b,m.uniformMap=T,m.castShadows=!1,m.receiveShadows=!1,u.silhouetteColorCommand=m,!r){let C=u.command2D,A=qe.shallowClone(p);A.boundingVolume=C.boundingVolume,A.modelMatrix=C.modelMatrix,u.silhouetteModelCommand2D=A;let S=qe.shallowClone(m);A.boundingVolume=C.boundingVolume,A.modelMatrix=C.modelMatrix,u.silhouetteColorCommand2D=S}}}function pMt(e,t,n){return e=Be.replaceMain(e,"gltf_clip_main"),e+=`${La._getClippingFunction(t,n)} -`,e+=`uniform highp sampler2D gltf_clippingPlanes; -uniform mat4 gltf_clippingPlanesMatrix; -uniform vec4 gltf_clippingPlanesEdgeStyle; -void main() -{ - gltf_clip_main(); -${kve("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")}} -`,e}function Nwe(e,t,n){if(!Mwe(e,t))return;let i=e._nodeCommands,o=i.length>0&&(xwe(e.color.alpha,e._colorPreviousAlpha)||xwe(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!l(i[0].silhouetteModelCommand));e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(o||n)&&mMt(e,t)}function _Mt(e,t){let n=e._clippingPlanes;l(n)&&n.owner===e&&n.enabled&&n.update(t)}var aJ=new re;function gMt(e,t,n){return aJ.center=e,aJ.radius=t,n.camera.getPixelSize(aJ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Ma=new h,pR=new fe;function yMt(e,t){let n=e.scale;if(e.minimumPixelSize!==0){let i=t.context,o=Math.max(i.drawingBufferWidth,i.drawingBufferHeight),r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Ma.x=r[12],Ma.y=r[13],Ma.z=r[14],l(e._rtcCenter)&&h.add(e._rtcCenter,Ma,Ma),e._mode!==Sd.SCENE3D){let f=t.mapProjection,d=f.ellipsoid.cartesianToCartographic(Ma,pR);f.project(d,Ma),h.fromElements(Ma.z,Ma.x,Ma.y,Ma)}let s=e.boundingSphereInternal.radius,a=gMt(Ma,s,t),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(n=e.minimumPixelSize*a/(2*e._initialRadius))}return l(e.maximumScale)?Math.min(e.maximumScale,n):n}function Fwe(e){l(e._cacheKey)&&l(e._cachedGltf)&&--e._cachedGltf.count===0&&delete ux[e._cacheKey],e._cachedGltf=void 0}function lJ(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function lx(e){for(let t in e)e.hasOwnProperty(t)&&e[t].destroy()}function xMt(e){lx(e.buffers),lx(e.vertexArrays),lx(e.programs),lx(e.silhouettePrograms),lx(e.textures)}lJ.prototype.release=function(){if(--this.count===0)return l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],xMt(this),ce(this)};function bwe(e,t,n){return function(i){if(e.heightReference===Bv.RELATIVE_TO_GROUND){let r=t.cartesianToCartographic(i,pR);r.height+=n.height,t.cartographicToCartesian(r,i)}let o=e._clampedModelMatrix;O.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function bMt(e){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||!l(t.globe)||e.heightReference===Bv.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=n.ellipsoid,o=e.modelMatrix;Ma.x=o[12],Ma.y=o[13],Ma.z=o[14];let r=i.cartesianToCartographic(Ma);l(e._clampedModelMatrix)||(e._clampedModelMatrix=O.clone(o,new O));let s=n._surface;e._removeUpdateHeightCallback=s.updateHeight(r,bwe(e,i,r));let a=n.getHeight(r);if(l(a)){let c=bwe(e,i,r);fe.clone(r,pR),pR.height=a,i.cartographicToCartesian(pR,Ma),c(Ma)}}var TMt=new h,CMt=new fe;function AMt(e,t){let n,i=e.distanceDisplayCondition,o=i.near*i.near,r=i.far*i.far;if(t.mode===Sd.SCENE2D)n=(t.camera.frustum.right-t.camera.frustum.left)*.5,n=n*n;else{let s=O.getTranslation(e.modelMatrix,TMt);if(t.mode===Sd.COLUMBUS_VIEW){let a=t.mapProjection,u=a.ellipsoid.cartesianToCartographic(s,CMt);s=a.project(u,s),h.fromElements(s.z,s.x,s.y,s)}n=h.distanceSquared(s,t.camera.positionWC)}return n>=o&&n<=r}var EMt=new O,SMt=new Z,vMt=new O;La.prototype.update=function(e){if(e.mode===Sd.MORPHING)return;if(!Ft.supportsWebP.initialized){Ft.supportsWebP.initialize();return}let t=e.context;this._defaultTexture=t.defaultTexture;let n=Ft.supportsWebP();if(this._state===cx.NEEDS_LOAD&&l(this.gltfInternal)){let b,T=this.cacheKey;if(l(T)){t.cache.modelRendererResourceCache=Oe(t.cache.modelRendererResourceCache,{});let C=t.cache.modelRendererResourceCache;if(b=C[this.cacheKey],l(b)){if(!b.ready)return;++b.count,this._loadRendererResourcesFromCache=!0}else b=new lJ(t,T),b.count=1,C[this.cacheKey]=b;this._cachedRendererResources=b}else b=new lJ(t),b.count=1,this._cachedRendererResources=b;if(this._state=cx.LOADING,this._state!==cx.FAILED){let C=this.gltfInternal.extensions;if(l(C)&&l(C.CESIUM_RTC)){let A=h.fromArray(C.CESIUM_RTC.center);if(!h.equals(A,h.ZERO)){this._rtcCenter3D=A;let S=e.mapProjection,R=S.ellipsoid.cartesianToCartographic(this._rtcCenter3D),D=S.project(R);h.fromElements(D.z,D.x,D.y,D),this._rtcCenter2D=D,this._rtcCenterEye=new h,this._rtcCenter=this._rtcCenter3D}}lR(this.gltfInternal),this._loadResources=new Zve,this._loadRendererResourcesFromCache||Ci.parseBuffers(this,$Rt)}}let i=this._loadResources,o=this._incrementallyLoadTextures,r=!1;if(this._state===cx.LOADING){if(i.pendingBufferLoads===0){if(!i.initialized){if(e.brdfLutGenerator.update(e),Ci.checkSupportedExtensions(this.extensionsRequired,n),Ci.updateForwardAxis(this),!l(this.gltfInternal.extras.sourceVersion)){let b=this.gltfInternal,T=Ci.getAssetVersion(b),C=l(Ci.getUsedExtensions(b).KHR_techniques_webgl);T!=="2.0"&&Mo("gltf-1.0","glTF 1.0 assets were deprecated in CesiumJS 1.94. They will be removed in 1.97. Please convert any glTF 1.0 assets to glTF 2.0."),C&&Mo("KHR_techniques_webgl","Support for glTF 1.0 techniques and the KHR_techniques_webgl glTF extension were deprecated in CesiumJS 1.94. It will be removed in 1.97. If custom GLSL shaders are needed, use CustomShader instead."),b.extras.sourceVersion=T,b.extras.sourceKHRTechniquesWebGL=C,this._sourceVersion=T,this._sourceKHRTechniquesWebGL=C,Sve(b),ave(b);let A={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};awe(b,A),cwe(b,A)}this._sourceVersion=this.gltfInternal.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltfInternal.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&Fv.hasExtension(this),KRt(this),nOt(this),QRt(this),this._loadRendererResourcesFromCache||(ZRt(this),eOt(this),tOt(this),oOt(this,t,n)),aOt(this),cOt(this),sOt(this),lOt(this),Fv.parse(this,t),i.initialized=!0}i.finishedDecoding()||Fv.decodeModel(this,t).catch(Ci.getFailedLoadFunction(this,"model",this.basePathInternal)),i.finishedDecoding()&&!i.resourcesParsed&&(this._boundingSphere=Ci.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,Fv.cacheDataForModel(this),i.resourcesParsed=!0),i.resourcesParsed&&i.pendingShaderLoads===0&&(this.showOutline&&$Q.outlinePrimitives(this),pwe(this,e))}(i.finished()||o&&i.finishedEverythingButTextureCreation())&&(this._state=cx.LOADED,r=!0)}if(l(i)&&this._state===cx.LOADED&&(o&&!r&&pwe(this,e),i.finished())){this._loadResources=void 0;let b=this._rendererResources,T=this._cachedRendererResources;T.buffers=b.buffers,T.vertexArrays=b.vertexArrays,T.programs=b.programs,T.sourceShaders=b.sourceShaders,T.silhouettePrograms=b.silhouettePrograms,T.textures=b.textures,T.samplers=b.samplers,T.renderStates=b.renderStates,T.ready=!0,this._normalAttributeName=Ci.getAttributeOrUniformBySemantic(this.gltfInternal,"NORMAL"),l(this._precreatedAttributes)&&(T.vertexArrays={}),this.releaseGltfJson&&Fwe(this)}let s=Mwe(this,e),a=cJ(this),c=Lwe(this),u=this.backFaceCulling,f=l(this.distanceDisplayCondition)?AMt(this,e):!0,d=this.show&&f&&this.scale!==0&&(!c||s);if(this._imageBasedLighting.update(e),d&&this._state===cx.LOADED||r){let b=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;let T=this.modelMatrix,C=e.mode!==this._mode;this._mode=e.mode;let A=!O.equals(this._modelMatrix,T)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||this.minimumPixelSize!==0||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||C;if(A||r){O.clone(T,this._modelMatrix),bMt(this),l(this._clampedModelMatrix)&&(T=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;let L=yMt(this,e),g=this._computedModelMatrix;O.multiplyByUniformScale(T,L,g),this._upAxis===Za.Y?O.multiplyTransformation(g,Za.Y_UP_TO_Z_UP,g):this._upAxis===Za.X&&O.multiplyTransformation(g,Za.X_UP_TO_Z_UP,g),this.forwardAxis===Za.Z&&O.multiplyTransformation(g,Za.Z_UP_TO_X_UP,g)}(b||A||r)&&(tMt(this,A,r,e.mapProjection),this._dirty=!0,(b||r)&&nMt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,iMt(this)),oMt(this,t),rMt(this),sMt(this),aMt(this),_Mt(this,e);let S=this._clippingPlanes,w=0,R=Oe(this.referenceMatrix,T);if(this._imageBasedLighting.useSphericalHarmonicCoefficients||this._imageBasedLighting.useSpecularEnvironmentMaps){let L=SMt,g=EMt;g=O.multiply(t.uniformState.view3D,R,g),L=O.getMatrix3(g,L),L=Z.getRotation(L,L),this._iblReferenceFrameMatrix=Z.transpose(L,this._iblReferenceFrameMatrix)}if(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLighting.shouldRegenerateShaders,dJ(this)){let L=vMt;L=O.multiply(t.uniformState.view3D,R,L),L=O.multiply(L,S.modelMatrix,L),this._clippingPlanesMatrix=O.inverseTranspose(L,this._clippingPlanesMatrix),w=S.clippingPlanesState}this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._clippingPlanesState!==w,this._clippingPlanesState=w;let D=fJ(this);D!==this._colorShadingEnabled&&(this._colorShadingEnabled=D,this._shouldRegenerateShaders=!0);let M=this.splitDirection!==XT.NONE;this._splittingEnabled!==M&&(this._splittingEnabled=M,this._shouldRegenerateShaders=!0),this._shouldRegenerateShaders?wMt(this,e):(Rwe(this,e,!1),Owe(this,e,!1),Nwe(this,e,!1))}if(r){let b=this;e.afterRender.push(function(){b._ready=!0,b._readyPromise.resolve(b)});return}if(d&&!this._ignoreCommands){let b=e.commandList,T=e.passes,C=this._nodeCommands,A=C.length,S,w,R=e.mapProjection.ellipsoid.maximumRadius*P.PI,D;if(T.render||T.pick&&this.allowPicking){for(S=0;S<A;++S)if(w=C[S],w.show){let M=w.command;s?M=w.silhouetteModelCommand:a?M=w.translucentCommand:u||(M=w.disableCullingCommand),b.push(M),D=w.command.boundingVolume;let L=D.center.y-D.radius,g=D.center.y+D.radius,E=L<R&&g>R||L<-R&&g>-R;if(e.mode===Sd.SCENE2D&&E){let v=w.command2D;s?v=w.silhouetteModelCommand2D:a?v=w.translucentCommand2D:u||(v=w.disableCullingCommand2D),b.push(v)}}if(s&&!T.pick){for(S=0;S<A;++S)if(w=C[S],w.show){b.push(w.silhouetteColorCommand),D=w.command.boundingVolume;let M=D.center.y-D.radius,L=D.center.y+D.radius,g=M<R&&L>R||M<-R&&L>-R;e.mode===Sd.SCENE2D&&g&&b.push(w.silhouetteColorCommand2D)}}}}let p=this._credit;l(p)&&e.creditDisplay.addCredit(p);let _=this._resourceCredits,m=_.length;for(let b=0;b<m;b++)e.creditDisplay.addCredit(_[b]);let y=this._gltfCredits,x=y.length;for(let b=0;b<x;b++)e.creditDisplay.addCredit(y[b])};function Bwe(e,t){e.programs!==t.programs&&lx(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&lx(e.silhouettePrograms)}function wMt(e,t){let n=e._rendererResources,i=e._cachedRendererResources;Bwe(n,i);let o;if(dJ(e)||fJ(e)||e.splitDirection!==XT.NONE||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,n.programs={},n.silhouettePrograms={};let c={},u=e._sourceTechniques,f;for(let d in u)u.hasOwnProperty(d)&&(f=u[d],o=f.program,c[o]||(c[o]=!0,dOt({programId:o,techniqueId:d},e,t.context)))}else n.programs=i.programs,n.silhouettePrograms=i.silhouettePrograms;let r=n.programs,s=e._nodeCommands,a=s.length;for(let c=0;c<a;++c){let u=s[c];o=u.programId;let f=r[o];u.command.shaderProgram=f,l(u.command2D)&&(u.command2D.shaderProgram=f)}Rwe(e,t,!0),Owe(e,t,!0),Nwe(e,t,!0)}La.prototype.isDestroyed=function(){return!1};La.prototype.destroy=function(){l(this._precreatedAttributes)&&lx(this._rendererResources.vertexArrays),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),l(this._cachedRendererResources)&&Bwe(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),Fv.destroyCachedDataForModel(this);let e=this._pickIds,t=e.length;for(let i=0;i<t;++i)e[i].destroy();Fwe(this),this._quantizedVertexShaders=void 0;let n=this._clippingPlanes;return l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ce(this)};La._getClippingFunction=Uve;La._modifyShaderForColor=fOt;var yJ=La;function kwe(e,t,n){this.primitive=e,this._modelMatrix=O.clone(t),this._instanceId=n}Object.defineProperties(kwe.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return O.clone(this._modelMatrix)},set:function(e){O.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var Uwe=kwe;var $T={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function Hv(e){e=Oe(e,Oe.EMPTY_OBJECT),this.show=Oe(e.show,!0),this._instancingSupported=!1,this._dynamic=Oe(e.dynamic,!1),this._allowPicking=Oe(e.allowPicking,!0),this._ready=!1,this._readyPromise=la(),this._state=$T.NEEDS_LOAD,this._dirty=!1,this._cull=Oe(e.cull,!0),this._opaquePass=Oe(e.opaquePass,Se.OPAQUE),this._instances=IMt(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=PMt(this),this._center=h.clone(this._boundingSphere.center),this._rtcTransform=new O,this._rtcModelView=new O,this._mode=void 0,this.modelMatrix=O.clone(O.IDENTITY),this._modelMatrix=O.clone(this.modelMatrix),this._url=Ee.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=Ee.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=Oe(e.shadows,vp.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.splitDirection=Oe(e.splitDirection,XT.NONE),this.debugShowBoundingVolume=Oe(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Oe(e.debugWireframe,!1),this._debugWireframe=!1,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new r5,this._shouldDestroyImageBasedLighting=!0),this.backFaceCulling=Oe(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling,this.showCreditsOnScreen=Oe(e.showCreditsOnScreen,!1)}Object.defineProperties(Hv.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},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)}}});function IMt(e,t){t=Oe(t,[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let r=t[o],s=r.modelMatrix,a=Oe(r.batchId,o);i[o]=new Uwe(e,s,a)}return i}function PMt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=O.getTranslation(e._instances[i]._modelMatrix,new h);return re.fromPoints(n)}var DMt=new h,xJ=new O;Hv.prototype.expandBoundingSphere=function(e){let t=O.getTranslation(e,DMt);re.expand(this._boundingSphere,t,this._boundingSphere)};function RMt(e,t,n,i){return function(o,r){let s=o.semantic;if(l(s)&&e.indexOf(s)>-1)if(t.indexOf(s)>-1)i[r]=s;else throw new se(`Shader program cannot be optimized for instancing. Uniform "${r}" in program "${n}" uses unsupported semantic "${s}"`)}}function Vwe(e,t){if(l(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];let n={};e._instancedUniformsByProgram=n;let i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],o=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],r=e._model._sourceTechniques;for(let s in r)if(r.hasOwnProperty(s)){let a=r[s],c=a.program;if(!l(n[c])){let u={};n[c]=u,Ce.techniqueUniform(a,RMt(i,o,t,u))}}return n[t]}function OMt(e){return function(t,n){let i=Vwe(e,n),o=l(e._batchTable),r=Be.replaceMain(t,"czm_instancing_main"),s="",a="";for(let _ in i)if(i.hasOwnProperty(_)){let m=i[_],y;m==="MODELVIEW"||m==="CESIUM_RTC_MODELVIEW"?y="czm_instanced_modelView":m==="MODELVIEWPROJECTION"?(y="czm_instanced_modelViewProjection",s+=`mat4 czm_instanced_modelViewProjection; -`,a+=`czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView; -`):m==="MODELVIEWINVERSETRANSPOSE"&&(y="czm_instanced_modelViewInverseTranspose",s+=`mat3 czm_instanced_modelViewInverseTranspose; -`,a+=`czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView); -`);let x=new RegExp(`uniform.*${_}.*`);r=r.replace(x,""),x=new RegExp(`${_}\\b`,"g"),r=r.replace(x,y)}let c=`uniform mat4 czm_instanced_modifiedModelView; -uniform mat4 czm_instanced_nodeTransform; -`,u,f,d;o?(u=`attribute float a_batchId; -`,f="",d=""):(u="",f=`in vec4 pickColor; -out vec4 v_pickColor; -`,d=` v_pickColor = pickColor; -`);let p=`${c+s}mat4 czm_instanced_modelView; -in vec4 czm_modelMatrixRow0; -in vec4 czm_modelMatrixRow1; -in vec4 czm_modelMatrixRow2; -${u}${f}${r}void main() -{ - mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0); - czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform; -${a} czm_instancing_main(); -${d}} -`;if(o){let _=e._model.gltfInternal,m=Ci.getDiffuseAttributeOrUniform(_,n);p=e._batchTable.getVertexShaderCallback(!0,"a_batchId",m)(p)}return p}}function MMt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=Ci.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`out vec4 v_pickColor; -${t}`;return t}}function LMt(e,t){return function(){return O.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function NMt(e){return function(){return e.computedMatrix}}function FMt(e,t){return function(n,i,o){n=Fe(n),n.czm_instanced_modifiedModelView=LMt(e,t),n.czm_instanced_nodeTransform=NMt(o);let r=Vwe(e,i);for(let s in r)r.hasOwnProperty(s)&&delete n[s];return l(e._batchTable)&&(n=e._batchTable.getUniformMapCallback()(n)),n}}function BMt(e){return function(t,n){if(l(e._batchTable)){let i=e._model.gltfInternal,o=Ci.getDiffuseAttributeOrUniform(i,n);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",o)(t),t=`uniform float a_batchId -;${t}`}return t}}function kMt(e){return function(t,n){let i=e._batchTable;if(l(i)){let o=e._model.gltfInternal,r=Ci.getDiffuseAttributeOrUniform(o,n);t=i.getFragmentShaderCallback(!0,r,!1)(t)}else t=`uniform vec4 czm_pickColor; -${t}`;return t}}function UMt(e){return function(t){return l(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function Hwe(e){let t=e._instances,n=e.length,i=e._center,o=12,r=e._vertexBufferTypedArray;l(r)||(r=new Float32Array(n*o)),e._dynamic&&(e._vertexBufferTypedArray=r);for(let s=0;s<n;++s){let a=t[s]._modelMatrix,c=O.clone(a,xJ);c[12]-=i.x,c[13]-=i.y,c[14]-=i.z;let u=s*o;r[u+0]=c[0],r[u+1]=c[4],r[u+2]=c[8],r[u+3]=c[12],r[u+4]=c[1],r[u+5]=c[5],r[u+6]=c[9],r[u+7]=c[13],r[u+8]=c[2],r[u+9]=c[6],r[u+10]=c[10],r[u+11]=c[14]}return r}function zMt(e,t){let n,i=e._instances,o=e.length,r=e._dynamic,s=l(e._batchTable);if(s){let c=new Uint16Array(o);for(n=0;n<o;++n)c[n]=i[n]._instanceId;e._batchIdBuffer=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}if(!s){let c=new Uint8Array(o*4);for(n=0;n<o;++n){let f=e._pickIds[n].color,d=n*4;c[d]=H.floatToByte(f.red),c[d+1]=H.floatToByte(f.green),c[d+2]=H.floatToByte(f.blue),c[d+3]=H.floatToByte(f.alpha)}e._pickIdBuffer=st.createVertexBuffer({context:t,typedArray:c,usage:Ne.STATIC_DRAW})}let a=Hwe(e);e._vertexBuffer=st.createVertexBuffer({context:t,typedArray:a,usage:r?Ne.STREAM_DRAW:Ne.STATIC_DRAW})}function VMt(e){let t=Hwe(e);e._vertexBuffer.copyFromArrayView(t)}function HMt(e,t){let n=e._instances,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createPickId(n[r]);return o}function GMt(e,t){let n=e._instancingSupported;n||Mo("cpuModelInstancing","Support for rendering instanced models on the CPU has been deprecated and will be removed in CesiumJS 1.97.");let i=l(e._batchTable),o=e._allowPicking,r={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:o,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLighting:e._imageBasedLighting,showOutline:e.showOutline,showCreditsOnScreen:e.showCreditsOnScreen};if(i||(e._pickIds=HMt(e,t)),n){zMt(e,t);let s=12,a=K.getSizeInBytes(K.FLOAT),c={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*4,strideInBytes:a*s,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:K.FLOAT,normalize:!1,offsetInBytes:a*8,strideInBytes:a*s,instanceDivisor:1}};i&&(c.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:K.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),i||(c.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:K.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r.precreatedAttributes=c,r.vertexShaderLoaded=OMt(e),r.fragmentShaderLoaded=MMt(e),r.uniformMapLoaded=FMt(e,t),l(e._url)&&(r.cacheKey=`${e._url.getUrlComponent()}#instanced`)}else r.vertexShaderLoaded=BMt(e),r.fragmentShaderLoaded=kMt(e),r.uniformMapLoaded=UMt(e,t);l(e._url)?e._model=yJ.fromGltf(r):e._model=new yJ(r)}function jMt(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;let n=e.debugWireframe?Le.LINES:Le.TRIANGLES,i=e._drawCommands,o=i.length;for(let r=0;r<o;++r)i[r].primitiveType=n}}function WMt(e){let t=Fe(e,!0);return t.cull.enabled=!1,ze.fromCache(t)}function qMt(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;let n=e._drawCommands,i=n.length,o;if(!l(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(i),e._renderStates=new Array(i),o=0;o<i;++o){let r=n[o].renderState,s=WMt(r);e._disableCullingRenderStates[o]=s,e._renderStates[o]=r}for(o=0;o<i;++o)n[o].renderState=e._backFaceCulling?e._renderStates[o]:e._disableCullingRenderStates[o]}}function YMt(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;let n=e._drawCommands,i=n.length;for(let o=0;o<i;++o)n[o].debugShowBoundingVolume=e.debugShowBoundingVolume}}function XMt(e,t){let n=t.length,i=e.length,o=e._boundingSphere,r=e._cull;for(let s=0;s<n;++s){let a=qe.shallowClone(t[s]);a.instanceCount=i,a.boundingVolume=o,a.cull=r,l(e._batchTable)?a.pickId=e._batchTable.getPickId():a.pickId="v_pickColor",e._drawCommands.push(a)}}function KMt(e){return function(){return e}}function $Mt(e){return function(){return e}}function ZMt(e,t){let n=e._instances,i=t.length,o=e.length,r=e._batchTable,s=l(r),a=e._cull;for(let c=0;c<i;++c)for(let u=0;u<o;++u){let f=qe.shallowClone(t[c]);if(f.modelMatrix=new O,f.boundingVolume=new re,f.cull=a,f.uniformMap=Fe(f.uniformMap),s)f.uniformMap.a_batchId=KMt(n[u]._instanceId);else{let d=e._pickIds[u];f.uniformMap.czm_pickColor=$Mt(d.color)}e._drawCommands.push(f)}}function Gwe(e){let t=e._modelCommands,n=t.length,i=e.length,o=e._rtcTransform,r=e._center;for(let s=0;s<n;++s){let a=t[s];for(let c=0;c<i;++c){let u=s*i+c,f=e._drawCommands[u],d=O.clone(e._instances[c]._modelMatrix,xJ);d[12]-=r.x,d[13]-=r.y,d[14]-=r.z,d=O.multiply(o,d,xJ);let p=a.modelMatrix,_=f.modelMatrix;O.multiply(d,p,_);let m=a.boundingVolume,y=f.boundingVolume;re.transform(m,d,y)}}}function jwe(e){let t=e._nodeCommands,n=t.length,i=[];for(let o=0;o<n;++o){let r=t[o];r.show&&i.push(r.command)}return i}function QMt(e){let t=e._nodeCommands,n=t.length,i=!1;for(let o=0;o<n;o++){let r=t[o];r.command.dirty&&(r.command.dirty=!1,i=!0)}return i}function zwe(e,t){e._drawCommands=[];let n=jwe(e._model);t?XMt(e,n):(ZMt(e,n),Gwe(e))}function JMt(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;let n=vp.castShadows(e.shadows),i=vp.receiveShadows(e.shadows),o=e._drawCommands,r=o.length;for(let s=0;s<r;++s){let a=o[s];a.castShadows=n,a.receiveShadows=i}}}Hv.prototype.update=function(e){if(e.mode===Sd.MORPHING||!this.show||this.length===0)return;let t=e.context;if(this._state===$T.NEEDS_LOAD){this._state=$T.LOADING,this._instancingSupported=t.instancedArrays,GMt(this,t);let p=this;this._model.readyPromise.catch(function(_){p._state=$T.FAILED,p._readyPromise.reject(_)})}let n=this._instancingSupported,i=this._model;if(i.imageBasedLighting=this._imageBasedLighting,i.showCreditsOnScreen=this.showCreditsOnScreen,i.splitDirection=this.splitDirection,i.update(e),i.ready&&this._state===$T.LOADING){this._state=$T.LOADED,this._ready=!0;let p=i.boundingSphereInternal.radius+h.magnitude(i.boundingSphereInternal.center);this._boundingSphere.radius+=p,this._modelCommands=jwe(i),zwe(this,n),this._readyPromise.resolve(this);return}if(this._state!==$T.LOADED)return;let o=e.mode!==this._mode,r=this.modelMatrix,s=!O.equals(this._modelMatrix,r);if(o||s){this._mode=e.mode,O.clone(r,this._modelMatrix);let p=O.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==Sd.SCENE3D&&(p=Et.basisTo2D(e.mapProjection,p,p)),O.getTranslation(p,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,VMt(this));let a=QMt(i);a&&zwe(this,n),!n&&(i.dirty||this._dirty||o||s)&&Gwe(this),JMt(this,a),jMt(this,a),qMt(this,a),YMt(this,a);let c=e.passes;if(!c.render&&!c.pick)return;let u=e.commandList,f=this._drawCommands,d=f.length;for(let p=0;p<d;++p)u.push(f[p])};Hv.prototype.isDestroyed=function(){return!1};Hv.prototype.destroy=function(){this._model=this._model&&this._model.destroy();let e=this._pickIds;if(l(e)){let t=e.length;for(let n=0;n<t;++n)e[n].destroy()}return this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ce(this)};var Wwe=Hv;globalThis.CESIUM_VERSION="1.129";var xR;typeof ko<"u"&&(xR=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(g,E){return g===null||typeof g in y?g===E:!1}function u(g,E){var v;return function(){v||(v=m.a.setTimeout(function(){v=e,g()},E))}}function f(g,E){var v;return function(){clearTimeout(v),v=m.a.setTimeout(g,E)}}function d(g,E){E&&E!=="change"?E==="beforeChange"?this.pc(g):this.gb(g,E):this.qc(g)}function p(g,E){E!==null&&E.s&&E.s()}function _(g,E){var v=this.qd,I=v[A];I.ra||(this.Qb&&this.mb[E]?(v.uc(E,g,this.mb[E]),this.mb[E]=null,--this.Qb):I.I[E]||v.uc(E,g,I.J?{da:g}:v.$c(g)),g.Ja&&g.gd())}var m=typeof s<"u"?s:{};m.b=function(g,E){for(var v=g.split("."),I=m,N=0;N<v.length-1;N++)I=I[v[N]];I[v[v.length-1]]=E},m.L=function(g,E,v){g[E]=v},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function g(Y,ee){for(var Q in Y)N.call(Y,Q)&&ee(Q,Y[Q])}function E(Y,ee){if(ee)for(var Q in ee)N.call(ee,Q)&&(Y[Q]=ee[Q]);return Y}function v(Y,ee){return Y.__proto__=ee,Y}function I(Y,ee,Q,de){var ge=Y[ee].match(W)||[];m.a.D(Q.match(W),function(le){m.a.Na(ge,le,de)}),Y[ee]=ge.join(" ")}var N=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,U=typeof Symbol=="function",k={},z={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(k,function(Y,ee){if(ee.length)for(var Q=0,de=ee.length;Q<de;Q++)z[ee[Q]]=Y});var B={propertychange:!0},j=n&&function(){for(var Y=3,ee=n.createElement("div"),Q=ee.getElementsByTagName("i");ee.innerHTML="<!--[if gt IE "+ ++Y+"]><i></i><![endif]-->",Q[0];);return 4<Y?Y:e}(),W=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(Y,ee,Q){for(var de=0,ge=Y.length;de<ge;de++)ee.call(Q,Y[de],de,Y)},A:typeof Array.prototype.indexOf=="function"?function(Y,ee){return Array.prototype.indexOf.call(Y,ee)}:function(Y,ee){for(var Q=0,de=Y.length;Q<de;Q++)if(Y[Q]===ee)return Q;return-1},Lb:function(Y,ee,Q){for(var de=0,ge=Y.length;de<ge;de++)if(ee.call(Q,Y[de],de,Y))return Y[de];return e},Pa:function(Y,ee){var Q=m.a.A(Y,ee);0<Q?Y.splice(Q,1):Q===0&&Y.shift()},wc:function(Y){var ee=[];return Y&&m.a.D(Y,function(Q){0>m.a.A(ee,Q)&&ee.push(Q)}),ee},Mb:function(Y,ee,Q){var de=[];if(Y)for(var ge=0,le=Y.length;ge<le;ge++)de.push(ee.call(Q,Y[ge],ge));return de},jb:function(Y,ee,Q){var de=[];if(Y)for(var ge=0,le=Y.length;ge<le;ge++)ee.call(Q,Y[ge],ge)&&de.push(Y[ge]);return de},Nb:function(Y,ee){if(ee instanceof Array)Y.push.apply(Y,ee);else for(var Q=0,de=ee.length;Q<de;Q++)Y.push(ee[Q]);return Y},Na:function(Y,ee,Q){var de=m.a.A(m.a.bc(Y),ee);0>de?Q&&Y.push(ee):Q||Y.splice(de,1)},Ba:F,extend:E,setPrototypeOf:v,Ab:F?v:E,P:g,Ga:function(Y,ee,Q){if(!Y)return Y;var de={},ge;for(ge in Y)N.call(Y,ge)&&(de[ge]=ee.call(Q,Y[ge],ge,Y));return de},Tb:function(Y){for(;Y.firstChild;)m.removeNode(Y.firstChild)},Yb:function(Y){Y=m.a.la(Y);for(var ee=(Y[0]&&Y[0].ownerDocument||n).createElement("div"),Q=0,de=Y.length;Q<de;Q++)ee.appendChild(m.oa(Y[Q]));return ee},Ca:function(Y,ee){for(var Q=0,de=Y.length,ge=[];Q<de;Q++){var le=Y[Q].cloneNode(!0);ge.push(ee?m.oa(le):le)}return ge},va:function(Y,ee){if(m.a.Tb(Y),ee)for(var Q=0,de=ee.length;Q<de;Q++)Y.appendChild(ee[Q])},Xc:function(Y,ee){var Q=Y.nodeType?[Y]:Y;if(0<Q.length){for(var de=Q[0],ge=de.parentNode,le=0,ye=ee.length;le<ye;le++)ge.insertBefore(ee[le],de);for(le=0,ye=Q.length;le<ye;le++)m.removeNode(Q[le])}},Ua:function(Y,ee){if(Y.length){for(ee=ee.nodeType===8&&ee.parentNode||ee;Y.length&&Y[0].parentNode!==ee;)Y.splice(0,1);for(;1<Y.length&&Y[Y.length-1].parentNode!==ee;)Y.length--;if(1<Y.length){var Q=Y[0],de=Y[Y.length-1];for(Y.length=0;Q!==de;)Y.push(Q),Q=Q.nextSibling;Y.push(de)}}return Y},Zc:function(Y,ee){7>j?Y.setAttribute("selected",ee):Y.selected=ee},Db:function(Y){return Y===null||Y===e?"":Y.trim?Y.trim():Y.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(Y,ee){return Y=Y||"",ee.length>Y.length?!1:Y.substring(0,ee.length)===ee},vd:function(Y,ee){if(Y===ee)return!0;if(Y.nodeType===11)return!1;if(ee.contains)return ee.contains(Y.nodeType!==1?Y.parentNode:Y);if(ee.compareDocumentPosition)return(ee.compareDocumentPosition(Y)&16)==16;for(;Y&&Y!=ee;)Y=Y.parentNode;return!!Y},Sb:function(Y){return m.a.vd(Y,Y.ownerDocument.documentElement)},kd:function(Y){return!!m.a.Lb(Y,m.a.Sb)},R:function(Y){return Y&&Y.tagName&&Y.tagName.toLowerCase()},Ac:function(Y){return m.onError?function(){try{return Y.apply(this,arguments)}catch(ee){throw m.onError&&m.onError(ee),ee}}:Y},setTimeout:function(Y,ee){return setTimeout(m.a.Ac(Y),ee)},Gc:function(Y){setTimeout(function(){throw m.onError&&m.onError(Y),Y},0)},B:function(Y,ee,Q){var de=m.a.Ac(Q);if(Q=B[ee],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof Y.addEventListener!="function")if(typeof Y.attachEvent<"u"){var ge=function(ye){de.call(Y,ye)},le="on"+ee;Y.attachEvent(le,ge),m.a.K.za(Y,function(){Y.detachEvent(le,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else Y.addEventListener(ee,de,!1);else J||(J=typeof o(Y).on=="function"?"on":"bind"),o(Y)[J](ee,de)},Fb:function(Y,ee){if(!Y||!Y.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(Y)==="input"&&Y.type&&ee.toLowerCase()=="click"?(Q=Y.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof Y.dispatchEvent=="function")Q=n.createEvent(z[ee]||"HTMLEvents"),Q.initEvent(ee,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,Y),Y.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&Y.click)Y.click();else if(typeof Y.fireEvent<"u")Y.fireEvent("on"+ee);else throw Error("Browser doesn't support triggering events");else o(Y).trigger(ee)},f:function(Y){return m.O(Y)?Y():Y},bc:function(Y){return m.O(Y)?Y.v():Y},Eb:function(Y,ee,Q){var de;ee&&(typeof Y.classList=="object"?(de=Y.classList[Q?"add":"remove"],m.a.D(ee.match(W),function(ge){de.call(Y.classList,ge)})):typeof Y.className.baseVal=="string"?I(Y.className,"baseVal",ee,Q):I(Y,"className",ee,Q))},Bb:function(Y,ee){var Q=m.a.f(ee);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(Y);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(Y,[Y.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(Y)},Yc:function(Y,ee){if(Y.name=ee,7>=j)try{var Q=Y.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});Y.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(Y){9<=j&&(Y=Y.nodeType==1?Y:Y.parentNode,Y.style&&(Y.style.zoom=Y.style.zoom))},wd:function(Y){if(j){var ee=Y.style.width;Y.style.width=0,Y.style.width=ee}},Pd:function(Y,ee){Y=m.a.f(Y),ee=m.a.f(ee);for(var Q=[],de=Y;de<=ee;de++)Q.push(de);return Q},la:function(Y){for(var ee=[],Q=0,de=Y.length;Q<de;Q++)ee.push(Y[Q]);return ee},Da:function(Y){return U?Symbol(Y):Y},Zd:j===6,$d:j===7,W:j,Lc:function(Y,ee){for(var Q=m.a.la(Y.getElementsByTagName("input")).concat(m.a.la(Y.getElementsByTagName("textarea"))),de=typeof ee=="string"?function(ye){return ye.name===ee}:function(ye){return ee.test(ye.name)},ge=[],le=Q.length-1;0<=le;le--)de(Q[le])&&ge.push(Q[le]);return ge},Nd:function(Y){return typeof Y=="string"&&(Y=m.a.Db(Y))?r&&r.parse?r.parse(Y):new Function("return "+Y)():null},hc:function(Y,ee,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(Y),ee,Q)},Od:function(Y,ee,Q){Q=Q||{};var de=Q.params||{},ge=Q.includeFields||this.Jc,le=Y;if(typeof Y=="object"&&m.a.R(Y)==="form")for(var le=Y.action,ye=ge.length-1;0<=ye;ye--)for(var be=m.a.Lc(Y,ge[ye]),Ie=be.length-1;0<=Ie;Ie--)de[be[Ie].name]=be[Ie].value;ee=m.a.f(ee);var Te=n.createElement("form");Te.style.display="none",Te.action=le,Te.method="post";for(var ve in ee)Y=n.createElement("input"),Y.type="hidden",Y.name=ve,Y.value=m.a.hc(m.a.f(ee[ve])),Te.appendChild(Y);g(de,function(Ve,Ke){var Ct=n.createElement("input");Ct.type="hidden",Ct.name=Ve,Ct.value=Ke,Te.appendChild(Ct)}),n.body.appendChild(Te),Q.submitter?Q.submitter(Te):Te.submit(),setTimeout(function(){Te.parentNode.removeChild(Te)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var E=this;if(arguments.length===1)return function(){return E.apply(g,arguments)};var v=Array.prototype.slice.call(arguments,1);return function(){var I=v.slice(0);return I.push.apply(I,arguments),E.apply(g,I)}}),m.a.g=new function(){var g=0,E="__ko__"+new Date().getTime(),v={},I,N;return m.a.W?(I=function(F,U){var k=F[E];if(!k||k==="null"||!v[k]){if(!U)return e;k=F[E]="ko"+g++,v[k]={}}return v[k]},N=function(F){var U=F[E];return U?(delete v[U],F[E]=null,!0):!1}):(I=function(F,U){var k=F[E];return!k&&U&&(k=F[E]={}),k},N=function(F){return F[E]?(delete F[E],!0):!1}),{get:function(F,U){var k=I(F,!1);return k&&k[U]},set:function(F,U,k){(F=I(F,k!==e))&&(F[U]=k)},Ub:function(F,U,k){return F=I(F,!0),F[U]||(F[U]=k)},clear:N,Z:function(){return g+++E}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(U,k){var z=m.a.g.get(U,I);return z===e&&k&&(z=[],m.a.g.set(U,I,z)),z}function E(U){var k=g(U,!1);if(k)for(var k=k.slice(0),z=0;z<k.length;z++)k[z](U);m.a.g.clear(U),m.a.K.cleanExternalData(U),F[U.nodeType]&&v(U.childNodes,!0)}function v(U,k){for(var z=[],B,j=0;j<U.length;j++)if((!k||U[j].nodeType===8)&&(E(z[z.length]=B=U[j]),U[j]!==B))for(;j--&&m.a.A(z,U[j])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(U,k){if(typeof k!="function")throw Error("Callback must be a function");g(U,!0).push(k)},yb:function(U,k){var z=g(U,!1);z&&(m.a.Pa(z,k),z.length==0&&m.a.g.set(U,I,e))},oa:function(U){return m.u.G(function(){N[U.nodeType]&&(E(U),F[U.nodeType]&&v(U.getElementsByTagName("*")))}),U},removeNode:function(U){m.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){o&&typeof o.cleanData=="function"&&o.cleanData([U])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var g=[0,"",""],E=[1,"<table>","</table>"],v=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:v,th:v,option:I,optgroup:I},F=8>=m.a.W;m.a.ua=function(U,k){var z;if(o){if(o.parseHTML)z=o.parseHTML(U,k)||[];else if((z=o.clean([U],k))&&z[0]){for(var B=z[0];B.parentNode&&B.parentNode.nodeType!==11;)B=B.parentNode;B.parentNode&&B.parentNode.removeChild(B)}}else{(z=k)||(z=n);var B=z.parentWindow||z.defaultView||t,j=m.a.Db(U).toLowerCase(),W=z.createElement("div"),J;for(J=(j=j.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[j[1]]||g,j=J[0],J="ignored<div>"+J[1]+U+J[2]+"</div>",typeof B.innerShiv=="function"?W.appendChild(B.innerShiv(J)):(F&&z.body.appendChild(W),W.innerHTML=J,F&&W.parentNode.removeChild(W));j--;)W=W.lastChild;z=m.a.la(W.lastChild.childNodes)}return z},m.a.Md=function(U,k){var z=m.a.ua(U,k);return z.length&&z[0].parentElement||m.a.Yb(z)},m.a.fc=function(U,k){if(m.a.Tb(U),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(U).html(k);else for(var z=m.a.ua(k,U.ownerDocument),B=0;B<z.length;B++)U.appendChild(z[B])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function g(v,I){if(v){if(v.nodeType==8){var N=m.aa.Uc(v.nodeValue);N!=null&&I.push({ud:v,Kd:N})}else if(v.nodeType==1)for(var N=0,F=v.childNodes,U=F.length;N<U;N++)g(F[N],I)}}var E={};return{Xb:function(v){if(typeof v!="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 E[I]=v,"<!--[ko_memo:"+I+"]-->"},bd:function(v,I){var N=E[v];if(N===e)throw Error("Couldn't find any memo with ID "+v+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete E[v]}},cd:function(v,I){var N=[];g(v,N);for(var F=0,U=N.length;F<U;F++){var k=N[F].ud,z=[k];I&&m.a.Nb(z,I),m.aa.bd(N[F].Kd,z),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(v){return(v=v.match(/^\[ko_memo\:(.*?)\]$/))?v[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function g(){if(N){for(var k=N,z=0,B;U<N;)if(B=I[U++]){if(U>k){if(5e3<=++z){U=N,m.a.Gc(Error("'Too much recursion' after processing "+z+" task groups."));break}k=N}try{B()}catch(j){m.a.Gc(j)}}}}function E(){g(),U=N=I.length=0}var v,I=[],N=0,F=1,U=0;return t.MutationObserver?v=function(k){var z=n.createElement("div");return new MutationObserver(k).observe(z,{attributes:!0}),function(){z.classList.toggle("foo")}}(E):v=n&&"onreadystatechange"in n.createElement("script")?function(k){var z=n.createElement("script");z.onreadystatechange=function(){z.onreadystatechange=null,n.documentElement.removeChild(z),z=null,k()},n.documentElement.appendChild(z)}:function(k){setTimeout(k,0)},{scheduler:v,zb:function(k){return N||m.na.scheduler(E),I[N++]=k,F++},cancel:function(k){k=k-(F-N),k>=U&&k<N&&(I[k]=null)},resetForTesting:function(){var k=N-U;return U=N=I.length=0,k},Sd:g}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,E){g.throttleEvaluation=E;var v=null;return m.$({read:g,write:function(I){clearTimeout(v),v=m.a.setTimeout(function(){g(I)},E)}})},rateLimit:function(g,E){var v,I,N;typeof E=="number"?v=E:(v=E.timeout,I=E.method),g.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,g.ub(function(F){return N(F,v,E)})},deferred:function(g,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(v){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(v);try{N=!0,g.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(g,E){g.equalityComparer=E=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,E,v){this.da=g,this.lc=E,this.mc=v,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,x),x.qb(this)};var x={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,E,v){var I=this;v=v||"change";var N=new m.ic(I,E?g.bind(E):g,function(){m.a.Pa(I.U[v],N),I.hb&&I.hb(v)});return I.Qa&&I.Qa(v),I.U[v]||(I.U[v]=[]),I.U[v].push(N),N},notifySubscribers:function(g,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var v=E==="change"&&this.ed||this.U[E].slice(0);try{m.u.xc();for(var I=0,N;N=v[I];++I)N.Ib||N.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var E=this,v=m.O(E),I,N,F,U,k;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=d);var z=g(function(){E.Ja=!1,v&&U===E&&(U=E.nc?E.nc():E());var B=N||k&&E.sb(F,U);k=N=I=!1,B&&E.gb(F=U)});E.qc=function(B,j){j&&E.Ja||(k=!j),E.ed=E.U.change.slice(0),E.Ja=I=!0,U=B,z()},E.pc=function(B){I||(F=B,E.gb(B,"beforeChange"))},E.rc=function(){k=!0},E.gd=function(){E.sb(F,E.v(!0))&&(N=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var E=0;return m.a.P(this.U,function(v,I){v!=="dirty"&&(E+=I.length)}),E},sb:function(g,E){return!this.equalityComparer||!this.equalityComparer(g,E)},toString:function(){return"[object Object]"},extend:function(g){var E=this;return g&&m.a.P(g,function(v,I){var N=m.Ta[v];typeof N=="function"&&(E=N(E,I)||E)}),E}};m.L(x,"init",x.qb),m.L(x,"subscribe",x.subscribe),m.L(x,"extend",x.extend),m.L(x,"getSubscriptionsCount",x.Bd),m.a.Ba&&m.a.setPrototypeOf(x,Function.prototype),m.T.fn=x,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function g(F){v.push(I),I=F}function E(){I=v.pop()}var v=[],I,N=0;return{xc:g,end:E,cc:function(F){if(I){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,F,F.fd||(F.fd=++N))}},G:function(F,U,k){try{return g(),F.apply(U,k||[])}finally{E()}},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}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var b=m.a.Da("_latestValue");m.ta=function(g){function E(){return 0<arguments.length?(E.sb(E[b],arguments[0])&&(E.ya(),E[b]=arguments[0],E.xa()),this):(m.u.cc(E),E[b])}return E[b]=g,m.a.Ba||m.a.extend(E,m.T.fn),m.T.fn.qb(E),m.a.Ab(E,T),m.options.deferUpdates&&m.Ta.deferred(E,!0),E};var T={equalityComparer:c,v:function(){return this[b]},xa:function(){this.notifySubscribers(this[b],"spectate"),this.notifySubscribers(this[b])},ya:function(){this.notifySubscribers(this[b],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(T,m.T.fn);var C=m.ta.Ma="__ko_proto__";T[C]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[C])&&g!==T[C]&&g!==m.o.fn[C])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[C]===T[C]||g[C]===m.o.fn[C]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",T),m.L(T,"peek",T.v),m.L(T,"valueHasMutated",T.xa),m.L(T,"valueWillMutate",T.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var E=this.v(),v=[],I=typeof g!="function"||m.O(g)?function(U){return U===g}:g,N=0;N<E.length;N++){var F=E[N];if(I(F)){if(v.length===0&&this.ya(),E[N]!==F)throw Error("Array modified during remove; cannot remove item");v.push(F),E.splice(N,1),N--}}return v.length&&this.xa(),v},removeAll:function(g){if(g===e){var E=this.v(),v=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),v}return g?this.remove(function(I){return 0<=m.a.A(g,I)}):[]},destroy:function(g){var E=this.v(),v=typeof g!="function"||m.O(g)?function(F){return F===g}:g;this.ya();for(var I=E.length-1;0<=I;I--){var N=E[I];v(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(E){return 0<=m.a.A(g,E)}):[]},indexOf:function(g){var E=this();return m.a.A(E,g)},replace:function(g,E){var v=this.indexOf(g);0<=v&&(this.ya(),this.v()[v]=E,this.xa())},sorted:function(g){var E=this().slice(0);return g?E.sort(g):E.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var E=this.v();this.ya(),this.zc(E,g,arguments);var v=E[g].apply(E,arguments);return this.xa(),v===E?this:v}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var E=this();return E[g].apply(E,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,E){function v(){function W(){if(k){var J=[].concat(g.v()||[]),Y;g.Wa("arrayChange")&&((!N||1<k)&&(N=m.a.Pb(z,J,g.Ob)),Y=N),z=J,N=null,k=0,Y&&Y.length&&g.notifySubscribers(Y,"arrayChange")}}I?W():(I=!0,U=g.subscribe(function(){++k},null,"spectate"),z=[].concat(g.v()||[]),N=null,F=g.subscribe(W))}if(g.Ob={},E&&typeof E=="object"&&m.a.extend(g.Ob,E),g.Ob.sparse=!0,!g.zc){var I=!1,N=null,F,U,k=0,z,B=g.Qa,j=g.hb;g.Qa=function(W){B&&B.call(g,W),W==="arrayChange"&&v()},g.hb=function(W){j&&j.call(g,W),W!=="arrayChange"||g.Wa("arrayChange")||(F&&F.s(),U&&U.s(),U=F=null,I=!1,z=e)},g.zc=function(W,J,Y){function ee(Te,ve,Ve){return Q[Q.length]={status:Te,value:ve,index:Ve}}if(I&&!k){var Q=[],de=W.length,ge=Y.length,le=0;switch(J){case"push":le=de;case"unshift":for(J=0;J<ge;J++)ee("added",Y[J],le+J);break;case"pop":le=de-1;case"shift":de&&ee("deleted",W[le],le);break;case"splice":J=Math.min(Math.max(0,0>Y[0]?de+Y[0]:Y[0]),de);for(var de=ge===1?de:Math.min(J+(Y[1]||0),de),ge=J+ge-2,le=Math.max(de,ge),ye=[],be=[],Ie=2;J<le;++J,++Ie)J<de&&be.push(ee("deleted",W[J],J)),J<ge&&ye.push(ee("added",Y[Ie],J));m.a.Kc(be,ye);break;default:return}N=Q}}}};var A=m.a.Da("_state");m.o=m.$=function(g,E,v){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(F.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 F.ra||m.u.cc(I),(F.ka||F.J&&I.Xa())&&I.ha(),F.X}if(typeof g=="object"?v=g:(v=v||{},g&&(v.read=g)),typeof v.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=v.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:v.read,nb:E||v.owner,l:v.disposeWhenNodeIsRemoved||v.l||null,Sa:v.disposeWhen||v.Sa,Rb:null,I:{},V:0,Ic:null};return I[A]=F,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,S),v.pure?(F.wb=!0,F.J=!0,m.a.extend(I,w)):v.deferEvaluation&&m.a.extend(I,R),m.options.deferUpdates&&m.Ta.deferred(I,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||v.deferEvaluation||I.ha(),F.l&&I.ja()&&m.a.K.za(F.l,F.Rb=function(){I.s()}),I};var S={equalityComparer:c,qa:function(){return this[A].V},Va:function(){var g=[];return m.a.P(this[A].I,function(E,v){g[v.Ka]=v.da}),g},Vb:function(g){if(!this[A].V)return!1;var E=this.Va();return m.a.A(E,g)!==-1?!0:!!m.a.Lb(E,function(v){return v.Vb&&v.Vb(g)})},uc:function(g,E,v){if(this[A].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[A].I[g]=v,v.Ka=this[A].V++,v.La=E.ob()},Xa:function(){var g,E,v=this[A].I;for(g in v)if(Object.prototype.hasOwnProperty.call(v,g)&&(E=v[g],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[A].rb&&this.Ia(!1)},ja:function(){var g=this[A];return g.ka||0<g.V},Rd:function(){this.Ja?this[A].ka&&(this[A].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var E=g.subscribe(this.Jd,this,"dirty"),v=g.subscribe(this.Rd,this);return{da:g,s:function(){E.s(),v.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,E=g.throttleEvaluation;E&&0<=E?(clearTimeout(this[A].Ic),this[A].Ic=m.a.setTimeout(function(){g.ha(!0)},E)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var E=this[A],v=E.Sa,I=!1;if(!E.rb&&!E.ra){if(E.l&&!m.a.Sb(E.l)||v&&v()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{I=this.zd(g)}finally{E.rb=!1}return I}},zd:function(g){var E=this[A],I=!1,v=E.wb?e:!E.V,I={qd:this,mb:E.I,Qb:E.V};m.u.xc({pd:I,od:_,o:this,Ya:v}),E.I={},E.V=0;var N=this.yd(E,I);return E.V?I=this.sb(E.X,N):(this.s(),I=!0),I&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=N,this.notifySubscribers(E.X,"spectate"),!E.J&&g&&this.notifySubscribers(E.X),this.rc&&this.rc()),v&&this.notifySubscribers(E.X,"awake"),I},yd:function(g,E){try{var v=g.Wc;return g.nb?v.call(g.nb):v()}finally{m.u.end(),E.Qb&&!g.J&&m.a.P(E.mb,p),g.sa=g.ka=!1}},v:function(g){var E=this[A];return(E.ka&&(g||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[A].J||(this[A].sa?this.ha():this[A].ka=!1),this[A].X},this.Ia=function(E){this.pc(this[A].X),this[A].ka=!0,E&&(this[A].sa=!0),this.qc(this,!E)}},s:function(){var g=this[A];!g.J&&g.I&&m.a.P(g.I,function(E,v){v.s&&v.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},w={Qa:function(g){var E=this,v=E[A];if(!v.ra&&v.J&&g=="change"){if(v.J=!1,v.sa||E.Xa())v.I=null,v.V=0,E.ha()&&E.Gb();else{var I=[];m.a.P(v.I,function(N,F){I[F.Ka]=N}),m.a.D(I,function(N,F){var U=v.I[N],k=E.$c(U.da);k.Ka=F,k.La=U.La,v.I[N]=k}),E.Xa()&&E.ha()&&E.Gb()}v.ra||E.notifySubscribers(v.X,"awake")}},hb:function(g){var E=this[A];E.ra||g!="change"||this.Wa("change")||(m.a.P(E.I,function(v,I){I.s&&(E.I[v]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[A];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},R={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(S,m.T.fn);var D=m.ta.Ma;S[D]=m.o,m.Oc=function(g){return typeof g=="function"&&g[D]===S[D]},m.Fd=function(g){return m.Oc(g)&&g[A]&&g[A].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",S),m.L(S,"peek",S.v),m.L(S,"dispose",S.s),m.L(S,"isActive",S.ja),m.L(S,"getDependenciesCount",S.qa),m.L(S,"getDependencies",S.Va),m.xb=function(g,E){return typeof g=="function"?m.o(g,E,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,E))},m.b("pureComputed",m.xb),function(){function g(I,N,F){if(F=F||new v,I=N(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 U=I instanceof Array?[]:{};return F.save(I,U),E(I,function(k){var z=N(I[k]);switch(typeof z){case"boolean":case"number":case"string":case"function":U[k]=z;break;case"object":case"undefined":var B=F.get(z);U[k]=B!==e?B:g(z,N,F)}}),U}function E(I,N){if(I instanceof Array){for(var F=0;F<I.length;F++)N(F);typeof I.toJSON=="function"&&N("toJSON")}else for(F in I)N(F)}function v(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(I,function(N){for(var F=0;m.O(N)&&10>F;F++)N=N();return N})},m.toJSON=function(I,N,F){return I=m.ad(I),m.a.hc(I,N,F)},v.prototype={constructor:v,save:function(I,N){var F=m.a.A(this.keys,I);0<=F?this.values[F]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,E,v){function I(N){var F=m.xb(g,v).extend({ma:"always"}),U=F.subscribe(function(k){k&&(U.s(),N(k))});return F.notifySubscribers(F.v()),U}return typeof Promise!="function"||E?I(E.bind(v)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,E,v){switch(m.a.R(g)){case"option":typeof E=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=E):(m.a.g.set(g,m.c.options.$b,E),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var I=-1,N=0,F=g.options.length,U;N<F;++N)if(U=m.w.M(g.options[N]),U==E||U===""&&E===e){I=N;break}(v||0<=I||E===e&&1<g.size)&&(g.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=I},0));break;default:(E===null||E===e)&&(E=""),g.value=E}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function g(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=` -,`;var z=[],B=k.match(I),j,W=[],J=0;if(1<B.length){for(var Y=0,ee;ee=B[Y];++Y){var Q=ee.charCodeAt(0);if(Q===44){if(0>=J){z.push(j&&W.length?{key:j,value:W.join("")}:{unknown:j||W.join("")}),j=J=0,W=[];continue}}else if(Q===58){if(!J&&!j&&W.length===1){j=W.pop();continue}}else{if(Q===47&&1<ee.length&&(ee.charCodeAt(1)===47||ee.charCodeAt(1)===42))continue;Q===47&&Y&&1<ee.length?(Q=B[Y-1].match(N))&&!F[Q[0]]&&(k=k.substr(k.indexOf(ee)+1),B=k.match(I),Y=-1,ee="/"):Q===40||Q===123||Q===91?++J:Q===41||Q===125||Q===93?--J:j||W.length||Q!==34&&Q!==39||(ee=ee.slice(1,-1))}W.push(ee)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return z}var E=["true","false","null","undefined"],v=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:g,vb:function(k,z){function B(Q,de){var ge;if(!Y){var le=m.getBindingHandler(Q);if(le&&le.preprocess&&!(de=le.preprocess(de,Q,B)))return;(le=U[Q])&&(ge=de,0<=m.a.A(E,ge)?ge=!1:(le=ge.match(v),ge=le===null?!1:le[1]?"Object("+le[1]+")"+le[2]:ge),le=ge),le&&W.push("'"+(typeof U[Q]=="string"?U[Q]:Q)+"':function(_z){"+ge+"=_z}")}J&&(de="function(){return "+de+" }"),j.push("'"+Q+"':"+de)}z=z||{};var j=[],W=[],J=z.valueAccessors,Y=z.bindingParams,ee=typeof k=="string"?g(k):k;return m.a.D(ee,function(Q){B(Q.key||Q.unknown,Q.value)}),W.length&&B("_ko_property_writers","{"+W.join(",")+" }"),j.join(",")},Id:function(k,z){for(var B=0;B<k.length;B++)if(k[B].key==z)return!0;return!1},eb:function(k,z,B,j,W){k&&m.O(k)?!m.Za(k)||W&&k.v()===j||k(j):(k=z.get("_ko_property_writers"))&&k[B]&&k[B](j)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function g(B){return B.nodeType==8&&F.test(N?B.text:B.nodeValue)}function E(B){return B.nodeType==8&&U.test(N?B.text:B.nodeValue)}function v(B,j){for(var W=B,J=1,Y=[];W=W.nextSibling;){if(E(W)&&(m.a.g.set(W,z,!0),J--,J===0))return Y;Y.push(W),g(W)&&J++}if(!j)throw Error("Cannot find closing comment tag to match: "+B.nodeValue);return null}function I(B,j){var W=v(B,j);return W?0<W.length?W[W.length-1].nextSibling:B.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",F=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},z="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(B){return g(B)?v(B):B.childNodes},Ea:function(B){if(g(B)){B=m.h.childNodes(B);for(var j=0,W=B.length;j<W;j++)m.removeNode(B[j])}else m.a.Tb(B)},va:function(B,j){if(g(B)){m.h.Ea(B);for(var W=B.nextSibling,J=0,Y=j.length;J<Y;J++)W.parentNode.insertBefore(j[J],W)}else m.a.va(B,j)},Vc:function(B,j){var W;g(B)?(W=B.nextSibling,B=B.parentNode):W=B.firstChild,W?j!==W&&B.insertBefore(j,W):B.appendChild(j)},Wb:function(B,j,W){W?(W=W.nextSibling,g(B)&&(B=B.parentNode),W?j!==W&&B.insertBefore(j,W):B.appendChild(j)):m.h.Vc(B,j)},firstChild:function(B){if(g(B))return!B.nextSibling||E(B.nextSibling)?null:B.nextSibling;if(B.firstChild&&E(B.firstChild))throw Error("Found invalid end comment, as the first child of "+B);return B.firstChild},nextSibling:function(B){if(g(B)&&(B=I(B)),B.nextSibling&&E(B.nextSibling)){var j=B.nextSibling;if(E(j)&&!m.a.g.get(j,z))throw Error("Found end comment without a matching opening comment, as child of "+B);return null}return B.nextSibling},Cd:g,Vd:function(B){return(B=(N?B.text:B.nodeValue).match(F))?B[1]:null},Sc:function(B){if(k[m.a.R(B)]){var j=B.firstChild;if(j)do if(j.nodeType===1){var W;W=j.firstChild;var J=null;if(W)do if(J)J.push(W);else if(g(W)){var Y=I(W,!0);Y?W=Y:J=[W]}else E(W)&&(J=[W]);while(W=W.nextSibling);if(W=J)for(J=j.nextSibling,Y=0;Y<W.length;Y++)J?B.insertBefore(W[Y],J):B.appendChild(W[Y])}while(j=j.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,E){var v=this.getBindingsString(g,E),v=v?this.parseBindingsString(v,E,g):null;return m.j.tc(v,g,E,!1)},getBindingAccessors:function(g,E){var v=this.getBindingsString(g,E),v=v?this.parseBindingsString(v,E,g,{valueAccessors:!0}):null;return m.j.tc(v,g,E,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,E,v,I){try{var N=this.nd,F=g+(I&&I.valueAccessors||""),U;if(!(U=N[F])){var k,z="with($context){with($data||{}){return{"+m.m.vb(g,I)+"}}}";k=new Function("$context","$element",z),U=N[F]=k}return U(E,v)}catch(B){throw B.message=`Unable to parse bindings. -Bindings value: `+g+` -Message: `+B.message,B}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function g(le){var ye=(le=m.a.g.get(le,ge))&&le.N;ye&&(le.N=null,ye.Tc())}function E(le,ye,be){this.node=le,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(le,g),be&&be.N&&(be.N.kb.push(le),this.Kb=be)}function v(le){return function(){return le}}function I(le){return le()}function N(le){return m.a.Ga(m.u.G(le),function(ye,be){return function(){return le()[be]}})}function F(le,ye,be){return typeof le=="function"?N(le.bind(null,ye,be)):m.a.Ga(le,v)}function U(le,ye){return N(this.getBindings.bind(this,le,ye))}function k(le,ye){var be=m.h.firstChild(ye);if(be){var Ie,Te=m.ga.instance,ve=Te.preprocessNode;if(ve){for(;Ie=be;)be=m.h.nextSibling(Ie),ve.call(Te,Ie);be=m.h.firstChild(ye)}for(;Ie=be;)be=m.h.nextSibling(Ie),z(le,Ie)}m.i.ma(ye,m.i.H)}function z(le,ye){var be=le,Ie=ye.nodeType===1;Ie&&m.h.Sc(ye),(Ie||m.ga.instance.nodeHasBindings(ye))&&(be=j(ye,null,le).bindingContextForDescendants),be&&!Q[m.a.R(ye)]&&k(be,ye)}function B(le){var ye=[],be={},Ie=[];return m.a.P(le,function Te(ve){if(!be[ve]){var Ve=m.getBindingHandler(ve);Ve&&(Ve.after&&(Ie.push(ve),m.a.D(Ve.after,function(Ke){if(le[Ke]){if(m.a.A(Ie,Ke)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Te(Ke)}}),Ie.length--),ye.push({key:ve,Mc:Ve})),be[ve]=!0}}),ye}function j(le,ye,be){var Ie=m.a.g.Ub(le,ge,{}),Te=Ie.hd;if(!ye){if(Te)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Te||(Ie.context=be),Ie.Zb||(Ie.Zb={});var ve;if(ye&&typeof ye!="function")ve=ye;else{var Ve=m.ga.instance,Ke=Ve.getBindingAccessors||U,Ct=m.$(function(){return(ve=ye?ye(be,le):Ke.call(Ve,le,be))&&(be[J]&&be[J](),be[ee]&&be[ee]()),ve},null,{l:le});ve&&Ct.ja()||(Ct=null)}var Qt=be,Qe;if(ve){var hn=function(){return m.a.Ga(Ct?Ct():ve,I)},Nt=Ct?function(Rt){return function(){return I(Ct()[Rt])}}:function(Rt){return ve[Rt]};hn.get=function(Rt){return ve[Rt]&&I(Nt(Rt))},hn.has=function(Rt){return Rt in ve},m.i.H in ve&&m.i.subscribe(le,m.i.H,function(){var Rt=(0,ve[m.i.H])();if(Rt){var Zn=m.h.childNodes(le);Zn.length&&Rt(Zn,m.Ec(Zn[0]))}}),m.i.pa in ve&&(Qt=m.i.Cb(le,be),m.i.subscribe(le,m.i.pa,function(){var Rt=(0,ve[m.i.pa])();Rt&&m.h.firstChild(le)&&Rt(le)})),Ie=B(ve),m.a.D(Ie,function(Rt){var Zn=Rt.Mc.init,gi=Rt.Mc.update,Ht=Rt.key;if(le.nodeType===8&&!m.h.ea[Ht])throw Error("The binding '"+Ht+"' cannot be used with virtual elements");try{typeof Zn=="function"&&m.u.G(function(){var wt=Zn(le,Nt(Ht),hn,Qt.$data,Qt);if(wt&&wt.controlsDescendantBindings){if(Qe!==e)throw Error("Multiple bindings ("+Qe+" and "+Ht+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Qe=Ht}}),typeof gi=="function"&&m.$(function(){gi(le,Nt(Ht),hn,Qt.$data,Qt)},null,{l:le})}catch(wt){throw wt.message='Unable to process binding "'+Ht+": "+ve[Ht]+`" -Message: `+wt.message,wt}})}return Ie=Qe===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Qt}}function W(le,ye){return le&&le instanceof m.fa?le:new m.fa(le,e,e,ye)}var J=m.a.Da("_subscribable"),Y=m.a.Da("_ancestorBindingInfo"),ee=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(le){return m.c[le]};var de={};m.fa=function(le,ye,be,Ie,Te){function ve(){var Nt=Qt?Ct():Ct,Rt=m.a.f(Nt);return ye?(m.a.extend(Ve,ye),Y in ye&&(Ve[Y]=ye[Y])):(Ve.$parents=[],Ve.$root=Rt,Ve.ko=m),Ve[J]=Qe,Ke?Rt=Ve.$data:(Ve.$rawData=Nt,Ve.$data=Rt),be&&(Ve[be]=Rt),Ie&&Ie(Ve,ye,Rt),ye&&ye[J]&&!m.S.o().Vb(ye[J])&&ye[J](),hn&&(Ve[ee]=hn),Ve.$data}var Ve=this,Ke=le===de,Ct=Ke?e:le,Qt=typeof Ct=="function"&&!m.O(Ct),Qe,hn=Te&&Te.dataDependency;Te&&Te.exportDependencies?ve():(Qe=m.xb(ve),Qe.v(),Qe.ja()?Qe.equalityComparer=null:Ve[J]=e)},m.fa.prototype.createChildContext=function(le,ye,be,Ie){if(!Ie&&ye&&typeof ye=="object"&&(Ie=ye,ye=Ie.as,be=Ie.extend),ye&&Ie&&Ie.noChildContext){var Te=typeof le=="function"&&!m.O(le);return new m.fa(de,this,null,function(ve){be&&be(ve),ve[ye]=Te?le():le},Ie)}return new m.fa(le,this,ye,function(ve,Ve){ve.$parentContext=Ve,ve.$parent=Ve.$data,ve.$parents=(Ve.$parents||[]).slice(0),ve.$parents.unshift(ve.$parent),be&&be(ve)},Ie)},m.fa.prototype.extend=function(le,ye){return new m.fa(de,this,null,function(be){m.a.extend(be,typeof le=="function"?le(be):le)},ye)};var ge=m.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(le){m.a.Pa(this.kb,le),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(le,ye,be,Ie,Te){var ve=m.a.g.Ub(le,ge,{});return ve.Fa||(ve.Fa=new m.T),Te&&Te.notifyImmediately&&ve.Zb[ye]&&m.u.G(be,Ie,[le]),ve.Fa.subscribe(be,Ie,ye)},ma:function(le,ye){var be=m.a.g.get(le,ge);if(be&&(be.Zb[ye]=!0,be.Fa&&be.Fa.notifySubscribers(le,ye),ye==m.i.H)){if(be.N)be.N.Cc();else if(be.N===e&&be.Fa&&be.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(le,ye){var be=m.a.g.Ub(le,ge,{});return be.N||(be.N=new E(le,be,ye[Y])),ye[Y]==be?ye:ye.extend(function(Ie){Ie[Y]=be})}},m.Td=function(le){return(le=m.a.g.get(le,ge))&&le.context},m.ib=function(le,ye,be){return le.nodeType===1&&m.h.Sc(le),j(le,ye,W(be))},m.ld=function(le,ye,be){return be=W(be),m.ib(le,F(ye,be,le),be)},m.Oa=function(le,ye){ye.nodeType!==1&&ye.nodeType!==8||k(W(le),ye)},m.vc=function(le,ye,be){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");z(W(le,be),ye)},m.Dc=function(le){return!le||le.nodeType!==1&&le.nodeType!==8?e:m.Td(le)},m.Ec=function(le){return(le=m.Dc(le))?le.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(g){function E(U,k){var z=Object.prototype.hasOwnProperty.call(N,U)?N[U]:g,B;z?z.subscribe(k):(z=N[U]=new m.T,z.subscribe(k),v(U,function(j,W){var J=!(!W||!W.synchronous);F[U]={definition:j,Gd:J},delete N[U],B||J?z.notifySubscribers(j):m.na.zb(function(){z.notifySubscribers(j)})}),B=!0)}function v(U,k){I("getConfig",[U],function(z){z?I("loadComponent",[U,z],function(B){k(B,z)}):k(null,null)})}function I(U,k,z,B){B||(B=m.j.loaders.slice(0));var j=B.shift();if(j){var W=j[U];if(W){var J=!1;if(W.apply(j,k.concat(function(Y){J?z(null):Y!==null?z(Y):I(U,k,z,B)}))!==g&&(J=!0,!j.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(U,k,z,B)}else z(null)}var N={},F={};m.j={get:function(U,k){var z=Object.prototype.hasOwnProperty.call(F,U)?F[U]:g;z?z.Gd?m.u.G(function(){k(z.definition)}):m.na.zb(function(){k(z.definition)}):E(U,k)},Bc:function(U){delete F[U]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function g(z,B,j,W){function J(){--ee===0&&W(Y)}var Y={},ee=2,Q=j.template;j=j.viewModel,Q?N(B,Q,function(de){m.j.oc("loadTemplate",[z,de],function(ge){Y.template=ge,J()})}):J(),j?N(B,j,function(de){m.j.oc("loadViewModel",[z,de],function(ge){Y[k]=ge,J()})}):J()}function E(z,B,j){if(typeof B=="function")j(function(J){return new B(J)});else if(typeof B[k]=="function")j(B[k]);else if("instance"in B){var W=B.instance;j(function(){return W})}else"viewModel"in B?E(z,B.viewModel,j):z("Unknown viewModel value: "+B)}function v(z){switch(m.a.R(z)){case"script":return m.a.ua(z.text);case"textarea":return m.a.ua(z.value);case"template":if(I(z.content))return m.a.Ca(z.content.childNodes)}return m.a.Ca(z.childNodes)}function I(z){return t.DocumentFragment?z instanceof DocumentFragment:z&&z.nodeType===11}function N(z,B,j){typeof B.require=="string"?a||t.require?(a||t.require)([B.require],function(W){W&&typeof W=="object"&&W.Xd&&W.default&&(W=W.default),j(W)}):z("Uses require, but no AMD loader is present"):j(B)}function F(z){return function(B){throw Error("Component '"+z+"': "+B)}}var U={};m.j.register=function(z,B){if(!B)throw Error("Invalid configuration for "+z);if(m.j.tb(z))throw Error("Component "+z+" is already registered");U[z]=B},m.j.tb=function(z){return Object.prototype.hasOwnProperty.call(U,z)},m.j.unregister=function(z){delete U[z],m.j.Bc(z)},m.j.Fc={getConfig:function(z,B){B(m.j.tb(z)?U[z]:null)},loadComponent:function(z,B,j){var W=F(z);N(W,B,function(J){g(z,W,J,j)})},loadTemplate:function(z,B,j){if(z=F(z),typeof B=="string")j(m.a.ua(B));else if(B instanceof Array)j(B);else if(I(B))j(m.a.la(B.childNodes));else if(B.element)if(B=B.element,t.HTMLElement?B instanceof HTMLElement:B&&B.tagName&&B.nodeType===1)j(v(B));else if(typeof B=="string"){var W=n.getElementById(B);W?j(v(W)):z("Cannot find element with ID "+B)}else z("Unknown element type: "+B);else z("Unknown template value: "+B)},loadViewModel:function(z,B,j){E(F(z),B,j)}};var k="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=U}(),function(){function g(v,I){var N=v.getAttribute("params");if(N){var N=E.parseBindingsString(N,I,v,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(k){return m.o(k,null,{l:v})}),F=m.a.Ga(N,function(k){var z=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(z)&&function(B){k()(B)},l:v}):z});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=N),F}return{$raw:{}}}m.j.getComponentNameForNode=function(v){var I=m.a.R(v);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+v=="[object HTMLUnknownElement]"||8>=m.a.W&&v.tagName===I))return I},m.j.tc=function(v,I,N,F){if(I.nodeType===1){var U=m.j.getComponentNameForNode(I);if(U){if(v=v||{},v.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:U,params:g(I,N)};v.component=F?function(){return k}:k}}return v};var E=new m.ga;9>m.a.W&&(m.j.register=function(v){return function(I){return v.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(v){return function(){var I=v(),N=m.j.dd,F;for(F in N);return I}}(n.createDocumentFragment))}(),function(){function g(I,N,F){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(F,I)}function E(I,N,F){var U=I.createViewModel;return U?U.call(I,N,F):N}var v=0;m.c.component={init:function(I,N,F,U,k){function z(){var Y=B&&B.dispose;typeof Y=="function"&&Y.call(B),W&&W.s(),j=B=W=null}var B,j,W,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,z),m.o(function(){var Y=m.a.f(N()),ee,Q;if(typeof Y=="string"?ee=Y:(ee=m.a.f(Y.name),Q=m.a.f(Y.params)),!ee)throw Error("No component name specified");var de=m.i.Cb(I,k),ge=j=++v;m.j.get(ee,function(le){if(j===ge){if(z(),!le)throw Error("Unknown component '"+ee+"'");g(ee,le,I);var ye=E(le,Q,{element:I,templateNodes:J});le=de.createChildContext(ye,{extend:function(be){be.$component=ye,be.$componentTemplateNodes=J}}),ye&&ye.koDescendantsComplete&&(W=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),B=ye,m.Oa(le,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(g,E){var v=m.a.f(E())||{};m.a.P(v,function(I,N){N=m.a.f(N);var F=I.indexOf(":"),F="lookupNamespaceURI"in g&&0<F&&g.lookupNamespaceURI(I.substr(0,F)),U=N===!1||N===null||N===e;U?F?g.removeAttributeNS(F,I):g.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in M?(I=M[I],U?g.removeAttribute(I):g[I]=N):U||(F?g.setAttributeNS(F,I,N):g.setAttribute(I,N)),I==="name"&&m.a.Yc(g,U?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(g,E,v){function I(){var Y=g.checked,ee=F();if(!m.S.Ya()&&(Y||!k&&!m.S.qa())){var Q=m.u.G(E);if(B){var de=j?Q.v():Q,ge=J;J=ee,ge!==ee?Y&&(m.a.Na(de,ee,!0),m.a.Na(de,ge,!1)):m.a.Na(de,ee,Y),j&&m.Za(Q)&&Q(de)}else U&&(ee===e?ee=Y:Y||(ee=e)),m.m.eb(Q,v,"checked",ee,!0)}}function N(){var Y=m.a.f(E()),ee=F();B?(g.checked=0<=m.a.A(Y,ee),J=ee):g.checked=U&&ee===e?!!Y:F()===Y}var F=m.xb(function(){if(v.has("checkedValue"))return m.a.f(v.get("checkedValue"));if(W)return v.has("value")?m.a.f(v.get("value")):g.value}),U=g.type=="checkbox",k=g.type=="radio";if(U||k){var z=E(),B=U&&m.a.f(z)instanceof Array,j=!(B&&z.push&&z.splice),W=k||B,J=B?F():e;k&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(I,null,{l:g}),m.a.B(g,"click",I),m.o(N,null,{l:g}),z=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,E){g.value=m.a.f(E())}}}(),m.c.class={update:function(g,E){var v=m.a.Db(m.a.f(E()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=v,m.a.Eb(g,v,!0)}},m.c.css={update:function(g,E){var v=m.a.f(E());v!==null&&typeof v=="object"?m.a.P(v,function(I,N){N=m.a.f(N),m.a.Eb(g,I,N)}):m.c.class.update(g,E)}},m.c.enable={update:function(g,E){var v=m.a.f(E());v&&g.disabled?g.removeAttribute("disabled"):v||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,E){m.c.enable.update(g,function(){return!m.a.f(E())})}},m.c.event={init:function(g,E,v,I,N){var F=E()||{};m.a.P(F,function(U){typeof U=="string"&&m.a.B(g,U,function(k){var z,B=E()[U];if(B){try{var j=m.a.la(arguments);I=N.$data,j.unshift(I),z=B.apply(I,j)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}v.get(U+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var E=g(),v=m.a.bc(E);return!v||typeof v.length=="number"?{foreach:E,templateEngine:m.ba.Ma}:(m.a.f(E),{foreach:v.data,as:v.as,noChildContext:v.noChildContext,includeDestroyed:v.includeDestroyed,afterAdd:v.afterAdd,beforeRemove:v.beforeRemove,afterRender:v.afterRender,beforeMove:v.beforeMove,afterMove:v.afterMove,templateEngine:m.ba.Ma})}},init:function(g,E){return m.c.template.init(g,m.c.foreach.Rc(E))},update:function(g,E,v,I,N){return m.c.template.update(g,m.c.foreach.Rc(E),v,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,E,v){function I(U){g.__ko_hasfocusUpdating=!0;var k=g.ownerDocument;if("activeElement"in k){var z;try{z=k.activeElement}catch{z=k.body}U=z===g}k=E(),m.m.eb(k,v,"hasfocus",U,!0),g.__ko_hasfocusLastValue=U,g.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),F=I.bind(null,!1);m.a.B(g,"focus",N),m.a.B(g,"focusin",N),m.a.B(g,"blur",F),m.a.B(g,"focusout",F),g.__ko_hasfocusLastValue=!1},update:function(g,E){var v=!!m.a.f(E());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===v||(v?g.focus():g.blur(),!v&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,v?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.fc(g,E())}},function(){function g(E,v,I){m.c[E]={init:function(N,F,U,k,z){var B,j,W={},J,Y,ee;if(v){k=U.get("as");var Q=U.get("noChildContext");ee=!(k&&Q),W={as:k,noChildContext:Q,exportDependencies:ee}}return Y=(J=U.get("completeOn")=="render")||U.has(m.i.pa),m.o(function(){var de=m.a.f(F()),ge=!I!=!de,le=!j,ye;(ee||ge!==B)&&(Y&&(z=m.i.Cb(N,z)),ge&&((!v||ee)&&(W.dataDependency=m.S.o()),ye=v?z.createChildContext(typeof de=="function"?de:F,W):m.S.qa()?z.extend(null,W):z),le&&m.S.qa()&&(j=m.a.Ca(m.h.childNodes(N),!0)),ge?(le||m.h.va(N,m.a.Ca(j)),m.Oa(ye,N)):(m.h.Ea(N),J||m.i.ma(N,m.i.H)),B=ge)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[E]=!1,m.h.ea[E]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)}(),m.c.let={init:function(g,E,v,I,N){return E=N.extend(E),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,E,v){function I(){return m.a.jb(g.options,function(Q){return Q.selected})}function N(Q,de,ge){var le=typeof de;return le=="function"?de(Q):le=="string"?Q[de]:ge}function F(Q,de){if(Y&&B)m.i.ma(g,m.i.H);else if(J.length){var ge=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],ge),Y&&!ge&&m.u.G(m.a.Fb,null,[g,"change"])}}var U=g.multiple,k=g.length!=0&&U?g.scrollTop:null,z=m.a.f(E()),B=v.get("valueAllowUnset")&&v.has("value"),j=v.get("optionsIncludeDestroyed");E={};var W,J=[];B||(U?J=m.a.Mb(I(),m.w.M):0<=g.selectedIndex&&J.push(m.w.M(g.options[g.selectedIndex]))),z&&(typeof z.length>"u"&&(z=[z]),W=m.a.jb(z,function(Q){return j||Q===e||Q===null||!m.a.f(Q._destroy)}),v.has("optionsCaption")&&(z=m.a.f(v.get("optionsCaption")),z!==null&&z!==e&&W.unshift(L)));var Y=!1;if(E.beforeRemove=function(Q){g.removeChild(Q)},z=F,v.has("optionsAfterRender")&&typeof v.get("optionsAfterRender")=="function"&&(z=function(Q,de){F(0,de),m.u.G(v.get("optionsAfterRender"),null,[de[0],Q!==L?Q:e])}),m.a.ec(g,W,function(Q,de,ge){return ge.length&&(J=!B&&ge[0].selected?[m.w.M(ge[0])]:[],Y=!0),de=g.ownerDocument.createElement("option"),Q===L?(m.a.Bb(de,v.get("optionsCaption")),m.w.cb(de,e)):(ge=N(Q,v.get("optionsValue"),Q),m.w.cb(de,m.a.f(ge)),Q=N(Q,v.get("optionsText"),ge),m.a.Bb(de,Q)),[de]},E,z),!B){var ee;U?ee=J.length&&I().length<J.length:ee=J.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==J[0]:J.length||0<=g.selectedIndex,ee&&m.u.G(m.a.Fb,null,[g,"change"])}(B||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),k&&20<Math.abs(k-g.scrollTop)&&(g.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,E,v){function I(){var U=E(),k=[];m.a.D(g.getElementsByTagName("option"),function(z){z.selected&&k.push(m.w.M(z))}),m.m.eb(U,v,"selectedOptions",k)}function N(){var U=m.a.f(E()),k=g.scrollTop;U&&typeof U.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(z){var B=0<=m.a.A(U,m.w.M(z));z.selected!=B&&m.a.Zc(z,B)}),g.scrollTop=k}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(g,m.i.H,function(){F?I():(m.a.B(g,"change",I),F=m.o(N,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,E){var v=m.a.f(E()||{});m.a.P(v,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(g).css(I,N);else if(/^--/.test(I))g.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(U,k){return k.toUpperCase()});var F=g.style[I];g.style[I]=N,N===F||g.style[I]!=F||isNaN(N)||(g.style[I]=N+"px")}})}},m.c.submit={init:function(g,E,v,I,N){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(F){var U,k=E();try{U=k.call(N.$data,g)}finally{U!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.Bb(g,E())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var g=function(W){if(W)return parseFloat(W[1])},E=t.navigator.userAgent,v,I,N,F,U;(v=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=g(E.match(/Edge\/([^ ]+)$/)))||g(E.match(/Chrome\/([^ ]+)/))||(I=g(E.match(/Version\/([^ ]+) Safari/)))||(N=g(E.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||g(E.match(/MSIE ([^ ]+)/)))||(F=g(E.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var k=m.a.g.Z(),z=m.a.g.Z(),B=function(W){var J=this.activeElement;(J=J&&m.a.g.get(J,z))&&J(W)},j=function(W,J){var Y=W.ownerDocument;m.a.g.get(Y,k)||(m.a.g.set(Y,k,!0),m.a.B(Y,"selectionchange",B)),m.a.g.set(W,z,J)};m.c.textInput={init:function(W,J,Y){function ee(ve,Ve){m.a.B(W,ve,Ve)}function Q(){var ve=m.a.f(J());(ve===null||ve===e)&&(ve=""),be!==e&&ve===be?m.a.setTimeout(Q,4):W.value!==ve&&(Te=!0,W.value=ve,Te=!1,le=W.value)}function de(){ye||(be=W.value,ye=m.a.setTimeout(ge,4))}function ge(){clearTimeout(ye),be=ye=e;var ve=W.value;le!==ve&&(le=ve,m.m.eb(J(),Y,"textInput",ve))}var le=W.value,ye,be,Ie=m.a.W==9?de:ge,Te=!1;F&&ee("keypress",ge),11>F&&ee("propertychange",function(ve){Te||ve.propertyName!=="value"||Ie(ve)}),F==8&&(ee("keyup",ge),ee("keydown",ge)),j&&(j(W,Ie),ee("dragend",de)),(!F||9<=F)&&ee("input",Ie),5>I&&m.a.R(W)==="textarea"?(ee("keydown",de),ee("paste",de),ee("cut",de)):11>v?ee("keydown",de):4>N?(ee("DOMAutoComplete",ge),ee("dragdrop",ge),ee("drop",ge)):U&&W.type==="number"&&ee("keydown",de),ee("change",ge),ee("blur",ge),m.o(Q,null,{l:W})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(W,J,Y){Y("textInput",W)}}}(),m.c.uniqueName={init:function(g,E){if(E()){var v="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,v)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,E,v,I,N){var F;return v.has("as")&&(F={as:v.get("as"),noChildContext:v.get("noChildContext")}),E=N.createChildContext(E,F),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,E,v){var I=m.a.R(g),N=I=="input";if(!N||g.type!="checkbox"&&g.type!="radio"){var F=[],U=v.get("valueUpdate"),k=!1,z=null;U&&(typeof U=="string"?F=[U]:F=m.a.wc(U),m.a.Pa(F,"change"));var B=function(){z=null,k=!1;var J=E(),Y=m.w.M(g);m.m.eb(J,v,"value",Y)};!m.a.W||!N||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){k=!0}),m.a.B(g,"focus",function(){k=!1}),m.a.B(g,"blur",function(){k&&B()})),m.a.D(F,function(J){var Y=B;m.a.Ud(J,"after")&&(Y=function(){z=m.w.M(g),m.a.setTimeout(B,0)},J=J.substring(5)),m.a.B(g,J,Y)});var j;if(j=N&&g.type=="file"?function(){var J=m.a.f(E());J===null||J===e||J===""?g.value="":m.u.G(B)}:function(){var J=m.a.f(E()),Y=m.w.M(g);z!==null&&J===z?m.a.setTimeout(j,0):(J!==Y||Y===e)&&(I==="select"?(Y=v.get("valueAllowUnset"),m.w.cb(g,J,Y),Y||J===m.w.M(g)||m.u.G(B)):m.w.cb(g,J))},I==="select"){var W;m.i.subscribe(g,m.i.H,function(){W?v.get("valueAllowUnset")?j():B():(m.a.B(g,"change",B),W=m.o(j,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",B),m.o(j,null,{l:g})}else m.ib(g,{checkedValue:E})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,E){var v=m.a.f(E()),I=g.style.display!="none";v&&!I?g.style.display="":!v&&I&&(g.style.display="none")}},m.c.hidden={update:function(g,E){m.c.visible.update(g,function(){return!m.a.f(E())})}},function(g){m.c[g]={init:function(E,v,I,N,F){return m.c.event.init.call(this,E,function(){var U={};return U[g]=v(),U},I,N,F)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,E){if(typeof g=="string"){E=E||n;var v=E.getElementById(g);if(!v)throw Error("Cannot find template with ID "+g);return new m.C.F(v)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,E,v,I){return g=this.makeTemplateSource(g,I),this.renderTemplateSource(g,E,v,I)},m.ca.prototype.isTemplateRewritten=function(g,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,E).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,E,v){g=this.makeTemplateSource(g,v),E=E(g.text()),g.text(E),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function g(I,N,F,U){I=m.m.ac(I);for(var k=m.m.Ra,z=0;z<I.length;z++){var B=I[z].key;if(Object.prototype.hasOwnProperty.call(k,B)){var j=k[B];if(typeof j=="function"){if(B=j(I[z].value))throw Error(B)}else if(!j)throw Error("This template engine does not support the '"+B+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(F)+N}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,v=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,F){N.isTemplateRewritten(I,F)||N.rewriteTemplate(I,function(U){return m.kc.Ld(U,N)},F)},Ld:function(I,N){return I.replace(E,function(F,U,k,z,B){return g(B,U,k,N)}).replace(v,function(F,U){return g(U,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(F,U){var k=F.nextSibling;k&&k.nodeName.toLowerCase()===N&&m.ib(k,I,U)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(v){if(this.F=v){var I=m.a.R(v);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&v.content&&v.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var v=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[v];var I=arguments[0];v==="innerHTML"?m.a.fc(this.F,I):this.F[v]=I};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(v){if(arguments.length===1)return m.a.g.get(this.F,g+v);m.a.g.set(this.F,g+v,arguments[1])};var E=m.a.g.Z();m.C.F.prototype.nodes=function(){var v=this.F;if(arguments.length==0){var I=m.a.g.get(v,E)||{},N=I.lb||(this.ab===3?v.content:this.ab===4?v:e);if(!N||I.jd){var F=this.text();F&&F!==I.bb&&(N=m.a.Md(F,v.ownerDocument),m.a.g.set(v,E,{lb:N,bb:F,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(v,E,{lb:I})},m.C.ia=function(v){this.F=v},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var v=m.a.g.get(this.F,E)||{};return v.bb===e&&v.lb&&(v.bb=v.lb.innerHTML),v.bb}m.a.g.set(this.F,E,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function g(z,B,j){var W;for(B=m.h.nextSibling(B);z&&(W=z)!==B;)z=m.h.nextSibling(W),j(W,z)}function E(z,B){if(z.length){var j=z[0],W=z[z.length-1],J=j.parentNode,Y=m.ga.instance,ee=Y.preprocessNode;if(ee){if(g(j,W,function(Q,de){var ge=Q.previousSibling,le=ee.call(Y,Q);le&&(Q===j&&(j=le[0]||de),Q===W&&(W=le[le.length-1]||ge))}),z.length=0,!j)return;j===W?z.push(j):(z.push(j,W),m.a.Ua(z,J))}g(j,W,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(B,Q)}),g(j,W,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[B])}),m.a.Ua(z,J)}}function v(z){return z.nodeType?z:0<z.length?z[0]:null}function I(z,B,j,W,J){J=J||{};var Y=(z&&v(z)||j||{}).ownerDocument,ee=J.templateEngine||F;if(m.kc.xd(j,ee,Y),j=ee.renderTemplate(j,W,J,Y),typeof j.length!="number"||0<j.length&&typeof j[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(Y=!1,B){case"replaceChildren":m.h.va(z,j),Y=!0;break;case"replaceNode":m.a.Xc(z,j),Y=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+B)}return Y&&(E(j,W),J.afterRender&&m.u.G(J.afterRender,null,[j,W[J.as||"$data"]]),B=="replaceChildren"&&m.i.ma(z,m.i.H)),j}function N(z,B,j){return m.O(z)?z():typeof z=="function"?z(B,j):z}var F;m.gc=function(z){if(z!=e&&!(z instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=z},m.dc=function(z,B,j,W,J){if(j=j||{},(j.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",W){var Y=v(W);return m.$(function(){var Q=B&&B instanceof m.fa?B:new m.fa(B,null,null,null,{exportDependencies:!0}),ee=N(z,Q.$data,Q),Q=I(W,J,ee,Q,j);J=="replaceNode"&&(W=Q,Y=v(W))},null,{Sa:function(){return!Y||!m.a.Sb(Y)},l:Y&&J=="replaceNode"?Y.parentNode:Y})}return m.aa.Xb(function(ee){m.dc(z,B,j,ee,"replaceNode")})},m.Qd=function(z,B,j,W,J){function Y(be,Ie){m.u.G(m.a.ec,null,[W,be,Q,j,ee,Ie]),m.i.ma(W,m.i.H)}function ee(be,Ie){E(Ie,de),j.afterRender&&j.afterRender(Ie,be),de=null}function Q(be,Ie){de=J.createChildContext(be,{as:ge,noChildContext:j.noChildContext,extend:function(ve){ve.$index=Ie,ge&&(ve[ge+"Index"]=Ie)}});var Te=N(z,be,de);return I(W,"ignoreTargetNode",Te,de,j)}var de,ge=j.as,le=j.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!j.includeDestroyed;if(le||j.beforeRemove||!m.Pc(B))return m.$(function(){var be=m.a.f(B)||[];typeof be.length>"u"&&(be=[be]),le&&(be=m.a.jb(be,function(Ie){return Ie===e||Ie===null||!m.a.f(Ie._destroy)})),Y(be)},null,{l:W});Y(B.v());var ye=B.subscribe(function(be){Y(B(),be)},null,"arrayChange");return ye.l(W),ye};var U=m.a.g.Z(),k=m.a.g.Z();m.c.template={init:function(z,B){var j=m.a.f(B());if(typeof j=="string"||"name"in j)m.h.Ea(z);else if("nodes"in j){if(j=j.nodes||[],m.O(j))throw Error('The "nodes" option must be a plain, non-observable array.');var W=j[0]&&j[0].parentNode;W&&m.a.g.get(W,k)||(W=m.a.Yb(j),m.a.g.set(W,k,!0)),new m.C.ia(z).nodes(W)}else if(j=m.h.childNodes(z),0<j.length)W=m.a.Yb(j),new m.C.ia(z).nodes(W);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(z,B,j,W,J){var Y=B();B=m.a.f(Y),j=!0,W=null,typeof B=="string"?B={}:(Y="name"in B?B.name:z,"if"in B&&(j=m.a.f(B.if)),j&&"ifnot"in B&&(j=!m.a.f(B.ifnot)),j&&!Y&&(j=!1)),"foreach"in B?W=m.Qd(Y,j&&B.foreach||[],B,z,J):j?(j=J,"data"in B&&(j=J.createChildContext(B.data,{as:B.as,noChildContext:B.noChildContext,exportDependencies:!0})),W=m.dc(Y,j,B,z)):m.h.Ea(z),J=W,(B=m.a.g.get(z,U))&&typeof B.s=="function"&&B.s(),m.a.g.set(z,U,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(z){return z=m.m.ac(z),z.length==1&&z[0].unknown||m.m.Id(z,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,E,v){if(g.length&&E.length){var I,N,F,U,k;for(I=N=0;(!v||I<v)&&(U=g[N]);++N){for(F=0;k=E[F];++F)if(U.value===k.value){U.moved=k.index,k.moved=U.index,E.splice(F,1),I=F=0;break}I+=F}}},m.a.Pb=function(){function g(E,v,I,N,F){var U=Math.min,k=Math.max,z=[],B,j=E.length,W,J=v.length,Y=J-j||1,ee=j+J+1,Q,de,ge;for(B=0;B<=j;B++)for(de=Q,z.push(Q=[]),ge=U(J,B+Y),W=k(0,B-1);W<=ge;W++)Q[W]=W?B?E[B-1]===v[W-1]?de[W-1]:U(de[W]||ee,Q[W-1]||ee)+1:W+1:B+1;for(U=[],k=[],Y=[],B=j,W=J;B||W;)J=z[B][W]-1,W&&J===z[B][W-1]?k.push(U[U.length]={status:I,value:v[--W],index:W}):B&&J===z[B-1][W]?Y.push(U[U.length]={status:N,value:E[--B],index:B}):(--W,--B,F.sparse||U.push({status:"retained",value:v[W]}));return m.a.Kc(Y,k,!F.dontLimitMoves&&10*j),U.reverse()}return function(E,v,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},E=E||[],v=v||[],E.length<v.length?g(E,v,"added","deleted",I):g(v,E,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function g(I,N,F,U,k){var z=[],B=m.$(function(){var j=N(F,k,m.a.Ua(z,I))||[];0<z.length&&(m.a.Xc(z,j),U&&m.u.G(U,null,[F,j,k])),z.length=0,m.a.Nb(z,j)},null,{l:I,Sa:function(){return!m.a.kd(z)}});return{Y:z,$:B.ja()?B:e}}var E=m.a.g.Z(),v=m.a.g.Z();m.a.ec=function(I,N,F,U,k,z){function B(Rt){Te={Aa:Rt,pb:m.ta(de++)},ee.push(Te),Y||Ie.push(Te)}function j(Rt){Te=J[Rt],de!==Te.pb.v()&&be.push(Te),Te.pb(de++),m.a.Ua(Te.Y,I),ee.push(Te)}function W(Rt,Zn){if(Rt)for(var gi=0,Ht=Zn.length;gi<Ht;gi++)m.a.D(Zn[gi].Y,function(wt){Rt(wt,gi,Zn[gi].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),U=U||{};var J=m.a.g.get(I,E),Y=!J,ee=[],Q=0,de=0,ge=[],le=[],ye=[],be=[],Ie=[],Te,ve=0;if(Y)m.a.D(N,B);else{if(!z||J&&J._countWaitingForRemove){var Ve=m.a.Mb(J,function(Rt){return Rt.Aa});z=m.a.Pb(Ve,N,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var Ve=0,Ke,Ct,Qt;Ke=z[Ve];Ve++)switch(Ct=Ke.moved,Qt=Ke.index,Ke.status){case"deleted":for(;Q<Qt;)j(Q++);Ct===e&&(Te=J[Q],Te.$&&(Te.$.s(),Te.$=e),m.a.Ua(Te.Y,I).length&&(U.beforeRemove&&(ee.push(Te),ve++,Te.Aa===v?Te=null:ye.push(Te)),Te&&ge.push.apply(ge,Te.Y))),Q++;break;case"added":for(;de<Qt;)j(Q++);Ct!==e?(le.push(ee.length),j(Ct)):B(Ke.value)}for(;de<N.length;)j(Q++);ee._countWaitingForRemove=ve}m.a.g.set(I,E,ee),W(U.beforeMove,be),m.a.D(ge,U.beforeRemove?m.oa:m.removeNode);var Qe,hn,Nt;try{Nt=I.ownerDocument.activeElement}catch{}if(le.length)for(;(Ve=le.shift())!=e;){for(Te=ee[Ve],Qe=e;Ve;)if((hn=ee[--Ve].Y)&&hn.length){Qe=hn[hn.length-1];break}for(N=0;Q=Te.Y[N];Qe=Q,N++)m.h.Wb(I,Q,Qe)}for(Ve=0;Te=ee[Ve];Ve++){for(Te.Y||m.a.extend(Te,g(I,F,Te.Aa,k,Te.pb)),N=0;Q=Te.Y[N];Qe=Q,N++)m.h.Wb(I,Q,Qe);!Te.Ed&&k&&(k(Te.Aa,Te.Y,Te.pb),Te.Ed=!0,Qe=Te.Y[Te.Y.length-1])}for(Nt&&I.ownerDocument.activeElement!=Nt&&Nt.focus(),W(U.beforeRemove,ye),Ve=0;Ve<ye.length;++Ve)ye[Ve].Aa=v;W(U.afterMove,be),W(U.afterAdd,Ie)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,E,v,I){return(E=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(E.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var E=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(v,I,N,F){if(F=F||n,N=N||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=v.data("precompiled");return U||(U=v.text()||"",U=o.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),v.data("precompiled",U)),v=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(U,v,I),I.appendTo(F.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(v){return"{{ko_code ((function() { return "+v+" })()) }}"},this.addTemplate=function(v,I){n.write("<script type='text/html' id='"+v+"'>"+I+"<\/script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var eLt=ko;typeof window<"u"?(ko=window.ko,typeof xR<"u"?window.ko=xR:delete window.ko):(ko=global.ko,typeof xR<"u"?global.ko=xR:delete global.ko);var Gv=eLt;/** - * @license - * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 - * Copyright (c) Steve Sanderson - * MIT license - */var bJ="__knockoutObservables",TJ="__knockoutSubscribable";function qwe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Ywe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===bJ||o===TJ)&&!(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&&nLt(n,a)}}),e}function Ywe(e,t){var n=e[bJ];return!n&&t&&(n={},Object.defineProperty(e,bJ,{value:n})),n}function tLt(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),qwe.call(i,e,[t]),e}function nLt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=iLt(e,t,i))})}function iLt(e,t,n){var i=oLt(e,n);return i.subscribe(t)}function oLt(e,t){var n=t[TJ];if(!n){n=new e.subscribable,Object.defineProperty(t,TJ,{value:n});var i={};rLt(t,n,i),sLt(e,t,n,i)}return n}function rLt(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 sLt(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 Xwe(e,t){if(!e)return null;var n=Ywe(e,!1);return n&&n[t]||null}function aLt(e,t){var n=Xwe(e,t);n&&n.valueHasMutated()}function cLt(e){e.track=qwe,e.getObservable=Xwe,e.valueHasMutated=aLt,e.defineProperty=tLt}var v5={attachToKo:cLt};var Kwe="http://www.w3.org/2000/svg",$we="cesium-svgPath-svg",lLt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Kwe,"svg:svg");i.setAttribute("class",$we);let o=document.createElementNS(Kwe,"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",`${$we} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},w5=lLt;v5.attachToKo(Gv);w5.register(Gv);var xe=Gv;function bR(e){l(e)||(e=new Bm),this._clock=e,this._eventHelper=new wr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable($.now()),this.systemTime.equalityComparer=$.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=$.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=$.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=$.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(bR.prototype,{clock:{get:function(){return this._clock}}});bR.prototype.synchronize=function(){let e=this._clock;this.systemTime=$.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};bR.prototype.isDestroyed=function(){return!1};bR.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var I5=bR;function uLt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var Zwe=uLt;function fLt(e,t){t=t??!0;let n=new me,i=new me;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var vn=fLt;var jv={};jv.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};jv.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};jv.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};jv.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};jv.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 cf=jv;function dLt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var Ja=dLt;function Qwe(e,t){this._command=e,t=t??G.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(Qwe.prototype,{command:{get:function(){return this._command}}});var ZT=Qwe;var QT="http://www.w3.org/2000/svg",tIe="http://www.w3.org/1999/xlink",P5,TR=H.fromCssColorString("rgba(247,250,255,0.384)"),D5=H.fromCssColorString("rgba(143,191,255,0.216)"),CJ=H.fromCssColorString("rgba(153,197,255,0.098)"),R5=H.fromCssColorString("rgba(255,255,255,0.086)"),hLt=H.fromCssColorString("rgba(255,255,255,0.267)"),mLt=H.fromCssColorString("rgba(255,255,255,0)"),Jwe=H.fromCssColorString("rgba(66,67,68,0.3)"),eIe=H.fromCssColorString("rgba(0,0,0,0.5)");function fx(e){return H.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var CR={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 jh(e){let t=document.createElementNS(QT,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(jh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(tIe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function AJ(e,t,n){let i=document.createElementNS(QT,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(QT,"tspan");return o.textContent=n,i.appendChild(o),i}function pLt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var O5=new H;function cs(e,t){let n=t.alpha,i=1-n;return O5.red=e.red*i+t.red*n,O5.green=e.green*i+t.green*n,O5.blue=e.blue*i+t.blue*n,O5.toCssColorString()}function EJ(e,t,n){let i=CR[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 jh(o)}function _Lt(e,t,n){let i=CR[n],o=CR.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 jh(r)}function gLt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&P5!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,_=Math.atan2(p,d)*180/Math.PI+90;_>180&&(_-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(P5=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=_):_<m?n.slower():_>m&&n.faster(),t.preventDefault()}else e===P5&&(P5=void 0),n.shuttleRingDragging=!1}function hg(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=[Ja(t,"toggled",this.setToggled,this),Ja(t,"tooltip",this.setTooltip,this),Ja(t.command,"canExecute",this.setEnabled,this)]}hg.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();ce(this)};hg.prototype.isDestroyed=function(){return!1};hg.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")}};hg.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")))};hg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function Wv(e,t){e=On(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(QT,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",tIe);let s=document.createElementNS(QT,"g");this._topG=s,this._realtimeSVG=new hg(_Lt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new hg(EJ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new hg(EJ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new hg(EJ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(QT,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=jh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=CR.animation_pathSwooshFX,f=CR.animation_pathPointer,d=jh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=jh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=jh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=jh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let _=61,m=jh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:_});this._knobDate=AJ(0,-24,""),this._knobTime=AJ(0,-7,""),this._knobStatus=AJ(0,-41,"");let y=jh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:_}),x=document.createElementNS(QT,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let b=this;function T(R){gLt(b,R)}this._mouseCallback=T,c.addEventListener("mousedown",T,!0),c.addEventListener("touchstart",T,!0),d.addEventListener("mousedown",T,!0),d.addEventListener("touchstart",T,!0),n.addEventListener("mousemove",T,!0),n.addEventListener("touchmove",T,!0),n.addEventListener("mouseup",T,!0),n.addEventListener("touchend",T,!0),n.addEventListener("touchcancel",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);let C=this._knobTime.childNodes[0],A=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],w;this._subscriptions=[Ja(t.pauseViewModel,"toggled",function(R){w!==R&&(w=R,w?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ja(t,"shuttleRingAngle",function(R){pLt(b._shuttleRingPointer,b._knobOuter,R)}),Ja(t,"dateLabel",function(R){A.textContent!==R&&(A.textContent=R)}),Ja(t,"timeLabel",function(R){C.textContent!==R&&(C.textContent=R)}),Ja(t,"multiplierLabel",function(R){S.textContent!==R&&(S.textContent=R)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(Wv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Wv.prototype.isDestroyed=function(){return!1};Wv.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 ce(this)};Wv.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};Wv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=fx(this._themeNormal),n=fx(this._themeHover),i=fx(this._themeSelect),o=fx(this._themeDisabled),r=fx(this._themeKnob),s=fx(this._themePointer),a=fx(this._themeSwoosh),c=fx(this._themeSwooshHover),u=jh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(t,TR)},{tagName:"stop",offset:"12%","stop-color":cs(t,D5)},{tagName:"stop",offset:"46%","stop-color":cs(t,CJ)},{tagName:"stop",offset:"81%","stop-color":cs(t,R5)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(n,TR)},{tagName:"stop",offset:"12%","stop-color":cs(n,D5)},{tagName:"stop",offset:"46%","stop-color":cs(n,CJ)},{tagName:"stop",offset:"81%","stop-color":cs(n,R5)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(i,TR)},{tagName:"stop",offset:"12%","stop-color":cs(i,D5)},{tagName:"stop",offset:"46%","stop-color":cs(i,CJ)},{tagName:"stop",offset:"81%","stop-color":cs(i,R5)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(o,hLt)},{tagName:"stop",offset:"75%","stop-color":cs(o,mLt)}]},{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":cs(s,eIe)},{tagName:"stop",offset:"100%","stop-color":cs(s,eIe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,TR)},{tagName:"stop",offset:"60%","stop-color":cs(r,Jwe)},{tagName:"stop",offset:"85%","stop-color":cs(r,D5)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,Jwe)},{tagName:"stop",offset:"60%","stop-color":cs(r,TR)},{tagName:"stop",offset:"85%","stop-color":cs(r,R5)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var M5=Wv;var yLt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dx=15,qv=105;function nIe(e,t){return e-t}function SJ(e,t){let n=zo(t,e,nIe);return n<0?~n:n}function xLt(e,t){if(Math.abs(e)<=dx)return e/dx;let n=dx,i=qv,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 bLt(e,t,n){if(n.clockStep===Ao.SYSTEM_CLOCK)return dx;if(Math.abs(e)<=1)return e*dx;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=dx,r=qv,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 vd(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=vd.defaultDateFormatter,this._timeFormatter=vd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(vd.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Ao.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return bLt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,qv),-qv);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Ao.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===qv){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=xLt(s,a);if(t.snapToTicks)u=a[SJ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>dx?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===rs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===rs.LOOP_STOP)d=$.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=$.greaterThan(u,f)&&$.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===rs.UNBOUNDED)return!0;let c=s.systemTime;return $.greaterThanOrEquals(c,s.startTime)&&$.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=vn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new ZT(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=vn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new ZT(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=vn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new ZT(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Ao.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=vn(function(){t._clockViewModel.clockStep=Ao.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new ZT(r,{toggled:xe.computed(function(){return e.clockStep===Ao.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=vn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=SJ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=vn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=SJ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}vd.defaultDateFormatter=function(e,t){let n=$.toGregorianDate(e);return`${yLt[n.month-1]} ${n.day} ${n.year}`};vd.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];vd.defaultTimeFormatter=function(e,t){let n=$.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`};vd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};vd.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(nIe);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(vd.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}}});vd._maxShuttleRingAngle=qv;vd._realtimeShuttleRingAngle=dx;var L5=vd;function iIe(e){e=e??G.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??G.EMPTY_ARRAY,i=e.terrainProviderViewModels??G.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=xe.getObservable(this,"imageryProviderViewModels"),r=xe.pureComputed(function(){let d=o(),p={},_;for(_=0;_<d.length;_++){let x=d[_],b=x.category;l(p[b])?p[b].push(x):p[b]=[x]}let m=Object.keys(p),y=[];for(_=0;_<m.length;_++){let x=m[_];y.push({name:x,providers:p[x]})}return y});this._imageryProviders=r;let s=xe.getObservable(this,"terrainProviderViewModels"),a=xe.pureComputed(function(){let d=s(),p={},_;for(_=0;_<d.length;_++){let x=d[_],b=x.category;l(p[b])?p[b].push(x):p[b]=[x]}let m=Object.keys(p),y=[];for(_=0;_<m.length;_++){let x=m[_];y.push({name:x,providers:p[x]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,_=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(_)&&l(m)?`${_} -${m}`:l(_)?_:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=xe.observable();this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,_=this._currentImageryLayers,m=_.length,y=this._globe.imageryLayers,x=!1;for(p=0;p<m;p++){let b=y.length;for(let T=0;T<b;T++){let C=y.get(T);if(C===_[p]){y.remove(C),x=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let T=b.length;for(this._currentImageryLayers=[],p=T-1;p>=0;p--){let C=Mc.fromProviderAsync(b[p]);y.add(C,0),this._currentImageryLayers.push(C)}}else{this._currentImageryLayers=[];let T=Mc.fromProviderAsync(b);if(T.name=d.name,x)y.add(T,0);else{let C=y.get(0);l(C)&&y.remove(C),y.add(T,0)}this._currentImageryLayers.push(T)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof K_),this._globe.terrainProvider=p;else if(l(p)){let _=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{_=!0,m()}),x=new t5(p).readyEvent.addEventListener(b=>{_||(this._globe.depthTestAgainstTerrain=!(b instanceof K_),this._globe.terrainProvider=b,x())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=vn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(iIe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var N5=iIe;function F5(e,t){e=On(e);let n=new N5(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let _=document.createElement("div");_.className="cesium-baseLayerPicker-itemLabel",_.setAttribute("data-bind","text: name"),d.appendChild(_);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let 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 b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),x.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),x.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-item",C.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),T.appendChild(C);let A=document.createElement("img");A.className="cesium-baseLayerPicker-itemIcon",A.setAttribute("data-bind","attr: { src: iconUrl }"),A.setAttribute("draggable","false"),C.appendChild(A);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),C.appendChild(S),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(w){i.contains(w.target)||r.contains(w.target)||(n.dropDownVisible=!1)},Ft.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(F5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});F5.prototype.isDestroyed=function(){return!1};F5.prototype.destroy=function(){return Ft.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ce(this)};var B5=F5;function oIe(e){let t=e.creationFunction;l(t.canExecute)||(t=vn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(oIe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var Ss=oIe;function TLt(){let e=[],t=devicePixelRatio>=2;return e.push(new Ss({name:"Bing Maps Aerial",iconUrl:on("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return q0({style:W0.AERIAL})}})),e.push(new Ss({name:"Bing Maps Aerial with Labels",iconUrl:on("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return q0({style:W0.AERIAL_WITH_LABELS})}})),e.push(new Ss({name:"Bing Maps Roads",iconUrl:on("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return q0({style:W0.ROAD})}})),e.push(new Ss({name:"ArcGIS World Imagery",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return G0.fromBasemapType(fp.SATELLITE,{enablePickFeatures:!1})}})),e.push(new Ss({name:"ArcGIS World Hillshade",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return G0.fromBasemapType(fp.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new Ss({name:"Esri World Ocean",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return G0.fromBasemapType(fp.OCEANS,{enablePickFeatures:!1})}})),e.push(new Ss({name:"Open\xADStreet\xADMap",iconUrl:on("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new rx({url:"https://tile.openstreetmap.org/"})}})),e.push(new Ss({name:"Stadia x Stamen Watercolor",iconUrl:on("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new rx({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 Ss({name:"Stadia x Stamen Toner",iconUrl:on("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. -https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new rx({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 Ss({name:"Stadia Alidade Smooth",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new rx({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 Ss({name:"Stadia Alidade Smooth Dark",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new rx({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 Ss({name:"Sentinel-2",iconUrl:on("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return j0.fromAssetId(3954)}})),e.push(new Ss({name:"Blue Marble",iconUrl:on("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return j0.fromAssetId(3845)}})),e.push(new Ss({name:"Earth at night",iconUrl:on("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return j0.fromAssetId(3812)}})),e.push(new Ss({name:"Natural Earth\xA0II",iconUrl:on("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return fT.fromUrl(on("Assets/Textures/NaturalEarthII"))}})),e}var k5=TLt;function CLt(){let e=[];return e.push(new Ss({name:"WGS84 Ellipsoid",iconUrl:on("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new K_({ellipsoid:te.WGS84})}})),e.push(new Ss({name:"Cesium World Terrain",iconUrl:on("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return OS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var U5=CLt;function ALt(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 vJ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var ELt=new gn,SLt=new h;function AR(e,t){let n=this,i=e.canvas,o=new md(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",xe.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=vn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=vn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=vn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=vn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new $0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=vn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=vn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new kG({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=vn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=vn(function(){let u=n.depthFrustum+1;return n.depthFrustum=vJ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=vn(function(){let u=n.depthFrustum-1;return n.depthFrustum=vJ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=vn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new n5({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=vn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=vn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=vn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,ELt),_=r.pick(p,n._scene,SLt);if(l(_)){let m=d.cartesianToCartographic(_),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!f&&x<y.length;++x){let b=y[x];if(l(b))for(let T=0;!f&&T<b.length;++T){let C=b[T];ae.contains(C.rectangle,m)&&(f=C)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=vn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(AR.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 vn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return vn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return vn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return vn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return vn(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}}});AR.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ALt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=vJ(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}`};AR.prototype.isDestroyed=function(){return!1};AR.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(),ce(this)};var z5=AR;function V5(e,t){e=On(e);let n=document.createElement("div"),i=new z5(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=cf.createSection,c=cf.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let _=document.createElement("div");u.appendChild(_);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),_.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),_.appendChild(y);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),_.appendChild(x);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),_.appendChild(b);let T=a(s,"Primitives","primitivesVisible","togglePrimitives"),C=document.createElement("div");C.className="cesium-cesiumInspector-pickSection",T.appendChild(C);let A=document.createElement("input");A.type="button",A.value="Pick a primitive",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(A),C.appendChild(S),C.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),C.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),C.appendChild(this._primitiveOnly);let w=a(s,"Terrain","terrainVisible","toggleTerrain"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",w.appendChild(R);let D=document.createElement("input");D.type="button",D.value="Pick a tile",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),S=document.createElement("div"),S.appendChild(D),S.className="cesium-cesiumInspector-center",R.appendChild(S);let M=document.createElement("div");R.appendChild(M);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let v=document.createElement("input");v.type="button",v.value="SW",v.className="cesium-cesiumInspector-pickButton",v.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 N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(N),M.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",M.appendChild(F);let U=document.createElement("table"),k=document.createElement("tr"),z=document.createElement("tr"),B=document.createElement("td");B.appendChild(L);let j=document.createElement("td");j.appendChild(g);let W=document.createElement("td");W.appendChild(E),k.appendChild(B),k.appendChild(j),k.appendChild(W);let J=document.createElement("td"),Y=document.createElement("td");Y.appendChild(v);let ee=document.createElement("td");ee.appendChild(I),z.appendChild(J),z.appendChild(Y),z.appendChild(ee),U.appendChild(k),U.appendChild(z),M.appendChild(U),R.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),R.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(V5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});V5.prototype.isDestroyed=function(){return!1};V5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};var H5=V5;function vLt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ls&&(e.tileset=n.primitive),e.pickActive=!1}}function sIe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ls&&(e.tileset=i.primitive)},An.MOUSE_MOVE):(e._eventHandler.removeInputAction(An.MOUSE_MOVE),e.picking=e.picking)}var wLt={maximumFractionDigits:3};function ER(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,wLt):Math.round(t).toLocaleString()}function SR(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[qo.PICK]:e._statisticsPerPass[qo.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>${ER(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${ER(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${ER(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function aIe(){let e=Ri.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${ER(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${ER(e.texturesByteLength)}</li> - </ul> - `}var ILt=[{text:"Highlight",value:Tu.HIGHLIGHT},{text:"Replace",value:Tu.REPLACE},{text:"Mix",value:Tu.MIX}],rIe=new H(1,1,0,.4),PLt=new H,G5=new H;function Na(e,t){let n=this,i=e.canvas;this._eventHandler=new md(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new $0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,xe.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let B=[],j=n._properties();for(let W in j)j.hasOwnProperty(W)&&B.push(W);return B});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(B){o(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=B)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(B){r(B),l(n._tileset)&&(n._tileset.colorBlendMode=B,n._scene.requestRender())}}),this.colorBlendMode=Tu.HIGHLIGHT;let s=xe.observable(),a=xe.observable();xe.defineProperty(this,"picking",{get:function(){return a()},set:function(B){a(B),B?n._eventHandler.setInputAction(function(j){let W=e.pick(j.endPosition);if(W instanceof ma?(n.feature=W,n.tile=W.content.tile):l(W)&&l(W.content)?(n.feature=void 0,n.tile=W.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(W)&&l(W.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(j.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=W.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},An.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(An.MOUSE_MOVE))}}),this.picking=!0;let c=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return c()},set:function(B){c(B),l(n._tileset)&&(n._tileset.debugColorizeTiles=B,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(B){u(B),l(n._tileset)&&(n._tileset.debugWireframe=B,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(B){f(B),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=B,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(B){d(B),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=B,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(B){p(B),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=B,n._scene.requestRender())}}),this.showRequestVolumes=!1;let _=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return _()},set:function(B){_(B),l(n._tileset)&&(n._tileset.debugFreezeFrame=B,n._scene.debugShowFrustumPlanes=B,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(B){s(B),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=B,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(B){m(B),l(n._tileset)&&(n._tileset.debugShowGeometricError=B,n._scene.requestRender())}}),this.showGeometricError=!1;let y=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(B){y(B),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=B,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(B){x(B),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=B,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return b()},set:function(B){b(B),l(n._tileset)&&(n._tileset.debugShowUrl=B,n._scene.requestRender())}}),this.showUrl=!1;let T=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return T()},set:function(B){B=Number(B),isNaN(B)||(T(B),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=B))}}),this.maximumScreenSpaceError=16;let C=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(B){B=Number(B),isNaN(B)||(C(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=B))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(B){let j=Math.pow(B,6);C(j),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=j)}});let A=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return A()},set:function(B){B=Number(B),isNaN(B)||(A(B),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=B))}}),this.dynamicScreenSpaceErrorFactor=24;let S=vLt(this),w=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return w()},set:function(B){w(B),B?n._eventHandler.setInputAction(S,An.LEFT_CLICK):n._eventHandler.removeInputAction(An.LEFT_CLICK)}});let R=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return R()},set:function(B){R(B),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=B)}}),this.pointCloudShading=!1;let D=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return D()},set:function(B){B=Number(B),isNaN(B)||(D(B),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=B))}}),this.geometricErrorScale=1;let M=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(B){B=Number(B),isNaN(B)||(M(B),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=B===0?void 0:B))}}),this.maximumAttenuation=0;let L=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(B){B=Number(B),isNaN(B)||(L(B),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=B===0?void 0:B))}}),this.baseResolution=0;let g=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(B){g(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=B)}}),this.eyeDomeLighting=!1;let E=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(B){B=Number(B),isNaN(B)||(E(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=B))}}),this.eyeDomeLightingStrength=1;let v=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return v()},set:function(B){B=Number(B),isNaN(B)||(v(B),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=B))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(B){I(B),l(n._tileset)&&(n._tileset.skipLevelOfDetail=B)}}),this.skipLevelOfDetail=!0;let N=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(B){B=Number(B),isNaN(B)||(N(B),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=B))}}),this.skipScreenSpaceErrorFactor=16;let F=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(B){B=Number(B),isNaN(B)||(F(B),l(n._tileset)&&(n._tileset.baseScreenSpaceError=B))}}),this.baseScreenSpaceError=1024;let U=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(B){B=Number(B),isNaN(B)||(U(B),l(n._tileset)&&(n._tileset.skipLevels=B))}}),this.skipLevels=1;let k=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(B){k(B),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=B)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let z=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return z()},set:function(B){z(B),l(n._tileset)&&(n._tileset.loadSiblings=B)}}),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)||sIe(this,!0)}Object.defineProperties(Na.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 ILt}},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=SR(e,!1),this._pickStatisticsText=SR(e,!0),this._resourceCacheStatisticsText=aIe(),sIe(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,PLt):H.WHITE:t.color=G5,this._scene.requestRender()),l(e)&&(H.clone(e.color,G5),e.color=rIe,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()&&!wJ(t.content)&&(t.color=G5,this._scene.requestRender()),l(e)&&!wJ(e.content)&&(H.clone(e.color,G5),e.color=rIe,this._scene.requestRender()),this._tile=e}}});function wJ(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(!wJ(t[i]))return!1;return!0}return!1}Na.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Na.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Na.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Na.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Na.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Na.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Na.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Na.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Na.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Na.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Na.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 Iv(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Na.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Na.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=SR(e,!1),this._pickStatisticsText=SR(e,!0),this._resourceCacheStatisticsText=aIe())};Na.prototype.isDestroyed=function(){return!1};Na.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),ce(this)};Na.getStatistics=SR;var j5=Na;function W5(e,t){e=On(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new j5(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=cf.createSection,c=cf.createCheckbox,u=cf.createRangeInput,f=cf.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),_=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),T=document.createElement("div");T.className="field-group";let C=document.createElement("label");C.className="field-label",C.appendChild(document.createTextNode("Properties: "));let A=document.createElement("div");A.setAttribute("data-bind","text: properties"),T.appendChild(C),T.appendChild(A),d.appendChild(T),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let S=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(w),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let R=document.createElement("div");R.setAttribute("data-bind","visible: pointCloudShading"),R.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),R.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),R.appendChild(u("Base Resolution","baseResolution",0,1,.01)),R.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(R);let D=document.createElement("div");D.setAttribute("data-bind","visible: eyeDomeLighting"),D.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),D.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),R.appendChild(D),_.appendChild(c("Freeze Frame","freezeFrame")),_.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),_.appendChild(M);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),_.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(E),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let v=document.createElement("div");v.className="cesium-3dTilesInspector-statistics",v.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(v);let I=document.createElement("div");x.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(F);let U=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(U);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")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let z=document.createElement("div");z.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(z);let B=document.createElement("div");B.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(B);let j=document.createElement("div");j.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(j),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties(W5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});W5.prototype.isDestroyed=function(){return!1};W5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};var q5=W5;function Y5(e,t){l(t)||(t=document.body),t=On(t);let n=this,i=xe.observable(Nr.fullscreen),o=xe.observable(Nr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Nr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=vn(function(){Nr.fullscreen?Nr.exitFullscreen():Nr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=On(e)??r.body,this._callback=function(){i(Nr.fullscreen)},r.addEventListener(Nr.changeEventName,this._callback)}Object.defineProperties(Y5.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});Y5.prototype.isDestroyed=function(){return!1};Y5.prototype.destroy=function(){document.removeEventListener(Nr.changeEventName,this._callback),ce(this)};var X5=Y5;var DLt="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",RLt="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 K5(e,t){e=On(e);let n=new X5(t,e);n._exitFullScreenPath=RLt,n._enterFullScreenPath=DLt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(K5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});K5.prototype.isDestroyed=function(){return!1};K5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var $5=K5;function cIe(e,t){this._scene=e,this._duration=t;let n=this;this._command=vn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(cIe.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 Z5=cIe;function Q5(e,t,n){e=On(e);let i=new Z5(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(Q5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Q5.prototype.isDestroyed=function(){return!1};Q5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var J5=Q5;var lIe=1e3;function wd(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new US({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 me,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=fIe,this._handleArrowUp=uIe;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let o=xe.getObservable(t,"_suggestions")().length>0,r=xe.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=vn(function(i){if(i=i??aT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)BLt(t);else return NLt(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?uIe(t):r?fIe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;mIe(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??wd.flyToDestination,this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){wd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(wd.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}}});wd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function uIe(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],wd._adjustSuggestionsScroll(e,n)}function fIe(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],wd._adjustSuggestionsScroll(e,i)}function OLt(e,t){let n=l(t)?t.availability:void 0;return l(n)?VS(t,[e]).then(function(i){return e=i[0],e.height+=lIe,e}):(e.height+=lIe,Promise.resolve(e))}function MLt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ae?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ae.center(t):a=jS(t,n):t=i.cartesianToCartographic(t),l(a)||(a=OLt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:O.IDENTITY})})}async function LLt(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 NLt(e,t,n){let i=e._searchText;if(hIe(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 LLt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,PJ(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=dIe(e,WD.getCreditsFromResult(s[0]));l(a)||IJ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function IJ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function dIe(e,t){return l(t)&&t.forEach(n=>IJ(e,n)),t}function PJ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function FLt(e,t){let n=On(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function BLt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function hIe(e){return/^\s*$/.test(e)}function mIe(e){xe.getObservable(e,"_suggestions").removeAll()}async function kLt(e){if(!e.autoComplete)return;let t=e._searchText;if(mIe(e),PJ(e),!hIe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,aT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=WD.getCreditsFromResult(r);o=o&&!l(s),dIe(e,s)}),o&&IJ(e,n.credit)}if(e._suggestions.length>=5)return}}wd.flyToDestination=MLt;wd._updateSearchSuggestions=kLt;wd._adjustSuggestionsScroll=FLt;wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){return PJ(this),ce(this)};var e6=wd;var ULt="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",zLt="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 t6(e){let t=On(e.container),n=new e6(e);n._startSearchPath=ULt,n._stopSearchPath=zLt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),xe.applyBindings(n,i),xe.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Ft.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(t6.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});t6.prototype.isDestroyed=function(){return!1};t6.prototype.destroy=function(){let e=this._container;return Ft.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ce(this)};var n6=t6;function VLt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function _Ie(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)_Ie(e.sublayers[n],t)}function i6(e){return e.modelName==="FullModel"}function gIe(e){return e.modelName==="Overview"}function yIe(e){return gIe(e)||i6(e)}function pIe(e,t){if(yIe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:xe.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function HLt(e,t){if(yIe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");i6(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function GLt(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 jLt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:xe.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:xe.observable(!0),index:-1}],currentLayer:xe.observable(),expandClickHandler:VLt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){HLt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){_Ie(n[i],this.viewModel);let o=pIe(n[i],this.viewModel);l(o)&&(gIe(o)||!l(this.viewModel.defaultLayer)&&i6(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=pIe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=i6(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return GLt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var o6=jLt;function WLt(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 o6(t);xe.track(o),xe.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var xIe=WLt;var qLt="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",YLt="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 DJ(){this._cameraClicked=new me,this._closeClicked=new me,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?YLt:qLt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}DJ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(DJ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var r6=DJ;function s6(e){e=On(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",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 r6;xe.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=on("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Ja(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,_=f.firstElementChild;if(_!==null&&f.childNodes.length===1){let y=window.getComputedStyle(_);if(y!==null){let x=y["background-color"],b=H.fromCssColorString(x);l(b)&&b.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(s6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});s6.prototype.isDestroyed=function(){return!1};s6.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ce(this)};var a6=s6;function bIe(){this.showInstructions=!1;let e=this;this._command=vn(function(){e.showInstructions=!e.showInstructions}),this._showClick=vn(function(){e._touch=!1}),this._showTouch=vn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(bIe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var c6=bIe;function l6(e){let t=On(e.container),n=new c6,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=on("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=on("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${on("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(_){o.contains(_.target)||(n.showInstructions=!1)},Ft.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(l6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});l6.prototype.isDestroyed=function(){return!1};l6.prototype.destroy=function(){return Ft.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var u6=l6;function RJ(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=vn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=VG.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(RJ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});RJ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ce(this)};var f6=RJ;function d6(e){let t=On(e.container),n=new f6(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(d6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d6.prototype.isDestroyed=function(){return!1};d6.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var h6=d6;function m6(e){this._scene=e,this._orthographic=e.camera.frustum instanceof ln,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=vn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new wr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof ln}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=vn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=vn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(m6.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}}});m6.prototype.isDestroyed=function(){return!1};m6.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var p6=m6;var XLt="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",KLt="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 _6(e,t){e=On(e);let n=new p6(t);n._perspectivePath=XLt,n._orthographicPath=KLt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ft.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(_6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_6.prototype.isDestroyed=function(){return!1};_6.prototype.destroy=function(){return this._viewModel.destroy(),Ft.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var g6=_6;function y6(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new wr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=vn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=vn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=vn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=vn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(y6.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}}});y6.prototype.isDestroyed=function(){return!1};y6.prototype.destroy=function(){this._eventHelper.removeAll(),ce(this)};var x6=y6;var $Lt="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",ZLt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",QLt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function b6(e,t,n){e=On(e);let i=new x6(t,n);i._globePath=$Lt,i._flatMapPath=ZLt,i._columbusViewPath=QLt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Ft.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(b6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b6.prototype.isDestroyed=function(){return!1};b6.prototype.destroy=function(){return this._viewModel.destroy(),Ft.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ce(this)};var T6=b6;var JLt=new V,C6="-1000px";function vR(e,t,n){this._scene=e,this._screenPositionX=C6,this._screenPositionY=C6,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return qi.worldToWindowCoordinates(e,i,o)}}vR.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,JLt);if(!l(e))this._screenPositionX=C6,this._screenPositionY=C6;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`}}};vR.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:as.EXPONENTIAL_OUT})};vR.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:as.EXPONENTIAL_OUT})};Object.defineProperties(vR.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var A6=vR;function E6(e,t){e=On(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new A6(t,this._element,this._container);this._viewModel=c,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(E6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E6.prototype.isDestroyed=function(){return!1};E6.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),ce(this)};var S6=E6;function JT(e,t,n){this._color=e,this._height=t,this._base=n??0}JT.prototype.getHeight=function(){return this._height};JT.prototype.getBase=function(){return this._base};JT.prototype.getStartTime=function(){return this._start};JT.prototype.getStopTime=function(){return this._stop};JT.prototype.setRange=function(e,t){this._start=e,this._stop=t};JT.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=$.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=$.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 v6=JT;function TIe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new H(.5,.5,.5,1),this.backgroundColor=i||new H(0,0,0,0)}TIe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=$.addSeconds(t.startJulian,t.duration,new $);if($.lessThan(n,o)&&$.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if($.lessThanOrEquals(n,r)&&$.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=$.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new $);!l(a)&&$.greaterThanOrEquals(u,n)?a=s:!l(c)&&$.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var w6=TIe;var OJ=1e12,Id={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Cl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},hx=[.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],eNt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Al(e,t){e=On(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Id.none,this._touchMode=Cl.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=tNt(this),this._onMouseUp=nNt(this),this._onMouseMove=iNt(this),this._onMouseWheel=oNt(this),this._onTouchStart=rNt(this),this._onTouchMove=aNt(this),this._onTouchEnd=sNt(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()}Al.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Al.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Al.prototype.isDestroyed=function(){return!1};Al.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),ce(this)};Al.prototype.addHighlightRange=function(e,t,n){let i=new v6(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Al.prototype.addTrack=function(e,t,n,i){let o=new w6(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Al.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=$.secondsDifference(t,e),this._clock&&this._clock.clockRange!==rs.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=$.secondsDifference(o,i),s=$.secondsDifference(i,this._startJulian),a=$.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=$.addSeconds(this._endJulian,s,new $),this._startJulian=i,this._timeBarSecondsSpan=$.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=$.addSeconds(this._startJulian,a,new $),this._endJulian=o,this._timeBarSecondsSpan=$.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)};Al.prototype.zoomFrom=function(e){let t=$.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($.addSeconds(this._startJulian,t-t*e,new $),$.addSeconds(this._endJulian,n*e-n,new $))};function MJ(e){return e<10?`0${e.toString()}`:e.toString()}Al.prototype.makeLabel=function(e){let t=$.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`${eNt[t.month-1]} ${t.day} ${t.year} ${MJ(t.hour)}:${MJ(t.minute)}:${MJ(t.second)}${i}`};Al.prototype.smallestTicInPixels=7;Al.prototype._makeTics=function(){let e=this._timeBarEle,t=$.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=$.addSeconds(this._startJulian,a,new $)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=$.addSeconds(this._startJulian,c,new $));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let _=this._startJulian,m=Math.min(d/p*1e-5,.4),y,x=$.toGregorianDate(_);d>31536e4?y=$.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):d>31536e3?y=$.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):d>86400?y=$.fromDate(new Date(Date.UTC(x.year,0))):y=$.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let b=$.secondsDifference(this._startJulian,$.addSeconds(y,m,new $)),T=b+d;this._epochJulian=y;function C(B){return Math.floor(b/B)*B}function A(B,j){return Math.ceil(B/j+.5)*j}function S(B){return(B-b)/d}function w(B,j){return B-j*Math.round(B/j)}this._rulerEle.innerHTML=this.makeLabel($.addSeconds(this._endJulian,-a,new $));let R=this._rulerEle.offsetWidth+20;R<30&&(R=180);let D=f;f-=u;let M={startTime:b,startJulian:_,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:S};this._highlightRanges.forEach(function(B){s+=B.render(M)});let L=0,g=0,E=0,v=R/p;v>1&&(v=1),v*=this._timeBarSecondsSpan;let I=-1,N=-1,F=hx.length,U;for(U=0;U<F;++U){let B=hx[U];if(++I,L=B,B>v&&B>f)break;N<0&&p*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(w(L,hx[I]))<1e-5){hx[I]>=f&&(g=hx[I]);break}if(N>=0)for(;N<I;){if(Math.abs(w(g,hx[N]))<1e-5&&hx[N]>=f){E=hx[N];break}++N}}f=D,f>u&&E<1e-5&&Math.abs(f-L)>u&&(E=f,f<=L+u&&(g=0));let k=-999999,z;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=C(E);o<=T;o=A(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=C(g);o<=T;o=A(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,T+=L,o=C(L);let B=$.computeTaiMinusUtc(y);for(;o<=T;){let j=$.addSeconds(_,o-b,new $);if(L>2.1){let ee=$.computeTaiMinusUtc(j);Math.abs(ee-B)>.1&&(o+=ee-B,j=$.addSeconds(_,o-b,new $))}let W=Math.round(p*S(o)),J=this.makeLabel(j);this._rulerEle.innerHTML=J,z=this._rulerEle.offsetWidth,z<10&&(z=R);let Y=W-(z/2-1);Y>k?(k=Y+z+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${W.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${Y.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${W.toString()}px;"></span>`,o=A(o,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(B){B.render(r._context,M),M.y+=B.height})};Al.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=$.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($.addSeconds(this._startJulian,this._timelineDrag,new $),$.addSeconds(this._endJulian,this._timelineDrag,new $)))};Al.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=$.addSeconds(this._startJulian,t,new $),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 tNt(e){return function(t){e._mouseMode!==Id.touchOnly&&(t.button===0?(e._mouseMode=Id.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Id.zoom:e._mouseMode=Id.slide)),t.preventDefault()}}function nNt(e){return function(t){e._mouseMode=Id.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function iNt(e){return function(t){let n;if(e._mouseMode===Id.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===Id.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo($.addSeconds(e._startJulian,i,new $),$.addSeconds(e._endJulian,i,new $))}}else e._mouseMode===Id.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function oNt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;OJ=Math.max(Math.min(Math.abs(n),OJ),1),n/=OJ,e.zoomFrom(Math.pow(1.05,-n))}}function rNt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Id.touchOnly,n===1?(i=$.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=Cl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Cl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Cl.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=Cl.ignore}}function sNt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Cl.singleTap?(e._touchMode=Cl.scrub,e._onTouchMove(t)):e._touchMode===Cl.scrub&&e._onTouchMove(t),e._mouseMode=Id.touchOnly,n!==1?e._touchMode=n>0?Cl.ignore:Cl.none:e._touchMode===Cl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function aNt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Cl.singleTap&&(e._touchMode=Cl.slideZoom),e._mouseMode=Id.touchOnly,e._touchMode===Cl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Cl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=$.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new $)):(n=e._touchState.centerX-r,a=$.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new $)),e.zoomTo(a,$.addSeconds(a,e._timeBarSecondsSpan*c,new $)),e._touchState.centerX=r,e._touchState.spanX=s))}}Al.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 I6=Al;var vIe=$r(SIe(),1);function uNt(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 wIe(){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 fNt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(wIe(),e._locked=!1),e._noSleep.disable(),Nr.exitFullscreen(),n(!1)):(Nr.fullscreen||Nr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=uNt("landscape")),t.useWebVR=!0,n(!0)))}function P6(e,t){let n=this,i=xe.observable(Nr.enabled),o=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Nr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new wr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof ln)}),this._locked=!1,this._noSleep=new vIe.default,this._command=vn(function(){fNt(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=On(t)??document.body,this._callback=function(){!Nr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(wIe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Nr.changeEventName,this._callback)}Object.defineProperties(P6.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});P6.prototype.isDestroyed=function(){return!1};P6.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Nr.changeEventName,this._callback),ce(this)};var D6=P6;var dNt="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",hNt="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 R6(e,t,n){e=On(e);let i=new D6(t,n);i._exitVRPath=hNt,i._enterVRPath=dNt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(R6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});R6.prototype.isDestroyed=function(){return!1};R6.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),ce(this)};var O6=R6;var IIe=new re;function RIe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function mNt(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 pNt(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 PIe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof hr)return i;if(n instanceof ma)return new hr({name:pNt(n),description:mNt(n),feature:n})}if(l(e.scene.globe))return yNt(e,t.position)}var _Nt=new $;function BJ(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;$.equals(i,o)&&(o=$.addSeconds(i,P.EPSILON2,_Nt)),e.updateFromClock(),e.zoomTo(i,o)}}}var gNt=new h;function yNt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new hr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=DIe();return}let a=s[0],c=new hr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,gNt);c.position=new kl(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=DIe())}),r}function DIe(){return new hr({id:"None",description:"No features found."})}function xNt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=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(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let _=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${_}px`,e.forceResize()}}function Zi(e,t){e=On(e),t=t??G.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Bm,u=new I5(c),f=!0);let d=new AG(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=d.scene,_=new wr;_.add(c.onTick,Zi.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let j=document.createElement("div");j.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(j),m=new S6(j,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let j=document.createElement("div");j.className="cesium-viewer-infoBoxContainer",o.appendChild(j),y=new a6(j);let W=y.viewModel;_.add(W.cameraClicked,Zi.prototype._onInfoBoxCameraClicked,this),_.add(W.closeClicked,Zi.prototype._onInfoBoxClockClicked,this)}let x=document.createElement("div");x.className="cesium-viewer-toolbar",o.appendChild(x);let b;if(!l(t.geocoder)||t.geocoder!==!1){let j=document.createElement("div");j.className="cesium-viewer-geocoderContainer",x.appendChild(j);let W;typeof t.geocoder=="string"?W=[new US({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(W=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new n6({container:j,geocoderServices:W,scene:p}),_.add(b.viewModel.search.beforeExecute,Zi.prototype._clearObjects,this)}let T;(!l(t.homeButton)||t.homeButton!==!1)&&(T=new J5(x,p),l(b)&&_.add(T.viewModel.command.afterExecute,function(){let j=b.viewModel;j.searchText="",j.isSearchInProgress&&j.search()}),_.add(T.viewModel.command.beforeExecute,Zi.prototype._clearTrackedObject,this));let C;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(C=new T6(x,p));let A;t.projectionPicker&&(A=new g6(x,p));let S,w;if(n){let j=t.imageryProviderViewModels??k5(),W=t.terrainProviderViewModels??U5();S=new B5(x,{globe:p.globe,imageryProviderViewModels:j,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:W,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=x.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let R;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let j=!0;try{if(l(window.localStorage)){let W=window.localStorage.getItem("cesium-hasSeenNavHelp");l(W)&&W?j=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}R=new u6({container:x,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??j})}let D;if(!l(t.animation)||t.animation!==!1){let j=document.createElement("div");j.className="cesium-viewer-animationContainer",o.appendChild(j),D=new M5(j,new L5(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let j=document.createElement("div");j.className="cesium-viewer-timelineContainer",o.appendChild(j),M=new I6(j,c),M.addEventListener("settime",RIe,!1),M.zoomTo(c.startTime,c.stopTime)}let L,g,E;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(E=document.createElement("div"),E.className="cesium-viewer-fullscreenContainer",o.appendChild(E),L=new $5(E,t.fullscreenElement),g=Ja(L.viewModel,"isFullscreenEnabled",function(j){E.style.display=j?"block":"none",l(M)&&(M.container.style.right=`${E.clientWidth}px`,M.resize())}));let v,I,N;if(t.vrButton){let j=document.createElement("div");j.className="cesium-viewer-vrContainer",o.appendChild(j),v=new O6(j,p,t.fullScreenElement),I=Ja(v.viewModel,"isVREnabled",function(W){j.style.display=W?"block":"none",l(L)&&(j.style.right=`${E.clientWidth}px`),l(M)&&(M.container.style.right=`${j.clientWidth}px`,M.resize())}),N=Ja(v.viewModel,"isVRMode",function(W){xNt(i,W)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=g,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=x,this._homeButton=T,this._sceneModePicker=C,this._projectionPicker=A,this._baseLayerPicker=S,this._navigationHelpButton=R,this._animation=D,this._timeline=M,this._fullscreenButton=L,this._vrButton=v,this._geocoder=b,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new me;let F=this._cesiumWidget.dataSources,U=this._cesiumWidget.dataSourceDisplay;_.add(F.dataSourceAdded,Zi.prototype._onDataSourceAdded,this),_.add(F.dataSourceRemoved,Zi.prototype._onDataSourceRemoved,this),_.add(p.postUpdate,Zi.prototype.resize,this);let k=F.length;for(let j=0;j<k;j++)this._dataSourceAdded(F,F.get(j));this._dataSourceAdded(void 0,U.defaultDataSource),_.add(F.dataSourceAdded,Zi.prototype._dataSourceAdded,this),_.add(F.dataSourceRemoved,Zi.prototype._dataSourceRemoved,this);function z(j){let W=PIe(i,j);l(W)?X.getValueOrUndefined(W.position,i.clock.currentTime)?i.trackedEntity=W:i.zoomTo(W):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function B(j){i.selectedEntity=PIe(i,j)}d.screenSpaceEventHandler.setInputAction(B,An.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(z,An.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Zi.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,BJ(this._timeline,e))}}});Zi.prototype.extend=function(e,t){e(this,t)};Zi.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 m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,_=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,x=c.container,b=x.style;p=x.clientHeight+3,b.left=`${f}px`;let T=0;l(m)&&(T+=m.container.clientWidth),l(y)&&(T+=y.container.clientWidth),b.right=`${T}px`,c.resize()}!r&&l(this._fullscreenButton)&&(_=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${_}px`,this._lastWidth=n,this._lastHeight=i};Zi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Zi.prototype.render=function(){this._cesiumWidget.render()};Zi.prototype.isDestroyed=function(){return!1};Zi.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(An.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(An.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",RIe,!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(),ce(this)};Zi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Zi.prototype._onEntityCollectionChanged,this)};Zi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Zi.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Zi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Zi.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,IIe)!==ut.FAILED?n=IIe.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=h.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=X.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Zi.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)}};Zi.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)}};Zi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Zi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Zi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Zi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&BJ(this.timeline,e)};Zi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&BJ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Zi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Zi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Zi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Zi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var OIe=Zi;function bNt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new q5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var MIe=bNt;function TNt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new H5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var LIe=TNt;function CNt(e,t){t=t??G.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new me,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=On(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){NIe(s,u),s=f,kJ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?kJ(s,u):NIe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){eC(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let _=0;_<p;_++){let m=d[_],y=new FileReader;y.onload=ANt(e,m,c,a),y.onerror=ENt(e,m),y.readAsText(m)}}kJ(s,u),e.destroy=s4(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function eC(e){e.stopPropagation(),e.preventDefault()}function NIe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",eC,!1),n.removeEventListener("dragover",eC,!1),n.removeEventListener("dragexit",eC,!1))}function kJ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",eC,!1),e.addEventListener("dragover",eC,!1),e.addEventListener("dragexit",eC,!1)}function ANt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=iU.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=tT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=ES.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=uV.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 ENt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var FIe=CNt;function SNt(e,t){t=t??G.EMPTY_OBJECT;let n=new h6({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var BIe=SNt;function kIe(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 Pd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=kIe(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===$a.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===$a.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===$a.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-P.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:P.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.translationX=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.translationY=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.translationZ=O.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.scaleX=O.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.scaleY=O.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)},getPrimitiveFunction:function(){t.scaleZ=O.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&wp(t)}})}var vNt=new h,wNt=new h,INt=new fc,PNt=new Z;function wp(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,vNt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,wNt),i=INt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=Z.fromHeadingPitchRoll(i,PNt),r=Z.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=O.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Pd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=kIe(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,wp(t)}}});Pd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Pd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Pd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Pd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Pd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new yv({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Pd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),ce(this)};var M6=Pd;function L6(e,t){e=On(e);let n=document.createElement("div"),i=new M6(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=cf,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),_=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,x=P.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-x,+x)),d.appendChild(c("Pitch","angleY",-x,+x)),d.appendChild(c("Roll","angleZ",-x,+x)),UJ("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),UJ("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),UJ("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");_.appendChild(b);let T=document.createElement("textarea");T.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(T);let C=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(C);let A=document.createElement("label");A.style.display="block",A.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(A),xe.applyBindings(i,n)}Object.defineProperties(L6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});L6.prototype.isDestroyed=function(){return!1};L6.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ce(this)};function UJ(e,t,n,i,o,r,s,a,c,u,f,d,p,_){let m=cf.createRangeInputWithDynamicMinMax,y=_.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,d))}var N6=L6;function DNt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new N6(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var UIe=DNt;globalThis.CESIUM_VERSION="1.129";var fvo="1.129";export{o_ as AlphaMode,RB as AlphaPipelineStage,L2 as AnchorPointDirect,N2 as AnchorPointIndirect,M5 as Animation,L5 as AnimationViewModel,lo as Appearance,mi as ApproximateTerrainHeights,Y0e as ArcGISTiledElevationTerrainProvider,fp as ArcGisBaseMapType,G0 as ArcGisMapServerImageryProvider,pd as ArcGisMapService,nn as ArcType,ol as ArticulationStageType,It as AssociativeArray,wA as Atmosphere,uB as AtmospherePipelineStage,Mn as AttributeCompression,rn as AttributeType,dH as AutoExposure,mg as AutomaticUniforms,Go as Axis,Fx as AxisAlignedBoundingBox,Y2 as B3dmLoader,q2 as B3dmParser,B5 as BaseLayerPicker,N5 as BaseLayerPickerViewModel,zC as BatchTable,uA as BatchTableHierarchy,Gl as BatchTexture,OB as BatchTexturePipelineStage,po as Billboard,jf as BillboardCollection,jc as BillboardGraphics,ps as BillboardLoadState,wy as BillboardTexture,IN as BillboardVisualizer,K0e as BingMapsGeocoderService,d4 as BingMapsImageryProvider,ZD as BingMapsStyle,pc as BlendEquation,Oo as BlendFunction,No as BlendOption,fn as BlendingState,Xe as BoundingRectangle,re as BoundingSphere,ut as BoundingSphereState,bA as BoundingVolumeSemantics,YEe as BoxEmitter,mc as BoxGeometry,EF as BoxGeometryUpdater,XC as BoxGraphics,om as BoxOutlineGeometry,n8 as BrdfLutGenerator,st as Buffer,hA as BufferLoader,Ne as BufferUsage,FB as CPUStylingPipelineStage,SF as CallbackPositionProperty,fm as CallbackProperty,ho as Camera,_H as CameraEventAggregator,Gi as CameraEventType,i8 as CameraFlightPath,V as Cartesian2,h as Cartesian3,ie as Cartesian4,fe as Cartographic,$0e as CartographicGeocoderService,Q0e as CatmullRomSpline,lA as Cesium3DContentGroup,sh as Cesium3DTile,Hg as Cesium3DTileBatchTable,Tu as Cesium3DTileColorBlendMode,XEe as Cesium3DTileContent,tE as Cesium3DTileContentFactory,nr as Cesium3DTileContentState,Zs as Cesium3DTileContentType,ma as Cesium3DTileFeature,Em as Cesium3DTileFeatureTable,oh as Cesium3DTileOptimizationHint,gk as Cesium3DTileOptimizations,qo as Cesium3DTilePass,Bh as Cesium3DTilePassState,Iy as Cesium3DTilePointFeature,Jo as Cesium3DTileRefine,Iv as Cesium3DTileStyle,Ck as Cesium3DTileStyleEngine,q5 as Cesium3DTilesInspector,j5 as Cesium3DTilesInspectorViewModel,$Ee as Cesium3DTilesVoxelProvider,Ls as Cesium3DTileset,Ek as Cesium3DTilesetBaseTraversal,xk as Cesium3DTilesetCache,tA as Cesium3DTilesetGraphics,Tk as Cesium3DTilesetHeatmap,mE as Cesium3DTilesetMetadata,Ak as Cesium3DTilesetMostDetailedTraversal,vk as Cesium3DTilesetSkipTraversal,Lm as Cesium3DTilesetStatistics,Ta as Cesium3DTilesetTraversal,Ik as Cesium3DTilesetVisualizer,H5 as CesiumInspector,z5 as CesiumInspectorViewModel,DS as CesiumTerrainProvider,AG as CesiumWidget,co as Check,SP as CheckerboardMaterialProperty,LG as CircleEmitter,axe as CircleGeometry,cxe as CircleOutlineGeometry,w3 as ClassificationModelDrawCommand,MB as ClassificationPipelineStage,Dw as ClassificationPrimitive,zn as ClassificationType,ri as ClearCommand,CA as ClippingPlane,Os as ClippingPlaneCollection,OI as ClippingPolygon,Tm as ClippingPolygonCollection,Bm as Clock,rs as ClockRange,Ao as ClockStep,I5 as ClockViewModel,iSe as CloudCollection,X1 as CloudType,H as Color,il as ColorBlendMode,Yt as ColorGeometryInstanceAttribute,Wt as ColorMaterialProperty,Zwe as Command,K as ComponentDatatype,DF as Composite3DTileContent,pde as CompositeEntityCollection,PP as CompositeMaterialProperty,Ga as CompositePositionProperty,ll as CompositeProperty,EO as CompressedTextureBuffer,Fa as ComputeCommand,AO as ComputeEngine,OG as ConditionsExpression,oSe as ConeEmitter,kl as ConstantPositionProperty,Qn as ConstantProperty,by as ConstantSpline,rk as ContentMetadata,AN as Context,Lt as ContextLimits,CU as CoplanarPolygonGeometry,My as CoplanarPolygonGeometryLibrary,rh as CoplanarPolygonOutlineGeometry,Vi as CornerType,F2 as CorrelationGroup,AE as CorridorGeometry,Yi as CorridorGeometryLibrary,kk as CorridorGeometryUpdater,$C as CorridorGraphics,Bk as CorridorOutlineGeometry,_t as Credit,h8 as CreditDisplay,fr as CubeMap,kO as CubeMapFace,AC as CubicRealPolynomial,Si as CullFace,Ds as CullingVolume,Ed as CumulusCloud,Gk as CustomDataSource,lxe as CustomHeightmapTerrainProvider,yv as CustomShader,Ay as CustomShaderMode,GB as CustomShaderPipelineStage,db as CustomShaderTranslucencyMode,jk as CylinderGeometry,SE as CylinderGeometryLibrary,qk as CylinderGeometryUpdater,ZC as CylinderGraphics,Wk as CylinderOutlineGeometry,iU as CzmlDataSource,os as DataSource,km as DataSourceClock,rU as DataSourceCollection,YU as DataSourceDisplay,hSe as DebugAppearance,Z_ as DebugCameraPrimitive,DH as DebugInspector,kG as DebugModelMatrixPrimitive,fxe as DefaultProxy,qc as DepthFunction,y8 as DepthPlane,jB as DequantizationPipelineStage,Q_ as DerivedCommand,he as DeveloperError,b8 as DeviceOrientationCameraController,mSe as DirectionalLight,JD as DiscardEmptyTileImagePolicy,u4 as DiscardMissingTileImagePolicy,Mt as DistanceDisplayCondition,Un as DistanceDisplayConditionGeometryInstanceAttribute,LS as DoubleEndedPriorityQueue,yk as DoublyLinkedList,Zg as DracoLoader,qe as DrawCommand,uy as DynamicAtmosphereLightingType,fy as DynamicEnvironmentMapManager,kE as DynamicGeometryBatch,si as DynamicGeometryUpdater,aO as EarthOrientationParameters,gx as EarthOrientationParametersSample,as as EasingFunction,eu as EllipseGeometry,Nu as EllipseGeometryLibrary,mU as EllipseGeometryUpdater,QC as EllipseGraphics,sd as EllipseOutlineGeometry,te as Ellipsoid,Mg as EllipsoidGeodesic,Sa as EllipsoidGeometry,pU as EllipsoidGeometryUpdater,JC as EllipsoidGraphics,Zf as EllipsoidOutlineGeometry,Z4 as EllipsoidPrimitive,_c as EllipsoidRhumbLine,pSe as EllipsoidSurfaceAppearance,fs as EllipsoidTangentPlane,K_ as EllipsoidTerrainProvider,jy as EllipsoidalOccluder,dP as Empty3DTileContent,Gn as EncodedCartesian3,hr as Entity,td as EntityCluster,Ca as EntityCollection,$U as EntityView,me as Event,wr as EventHelper,Hd as Expression,gt as ExpressionNodeType,nd as ExtrapolationType,Ft as FeatureDetection,fb as FeatureIdPipelineStage,T8 as Fog,Re as ForEach,VG as FrameRateMonitor,C8 as FrameState,Zr as Framebuffer,bi as FramebufferManager,G as Frozen,P8 as FrustumCommands,BS as FrustumGeometry,kV as FrustumOutlineGeometry,Nr as Fullscreen,$5 as FullscreenButton,X5 as FullscreenButtonViewModel,tT as GeoJsonDataSource,K2 as GeoJsonLoader,aT as GeocodeType,n6 as Geocoder,WD as GeocoderService,e6 as GeocoderViewModel,Fi as GeographicProjection,vi as GeographicTilingScheme,lt as Geometry,BF as Geometry3DTileContent,we as GeometryAttribute,pn as GeometryAttributes,bxe as GeometryFactory,Pt as GeometryInstance,Yc as GeometryInstanceAttribute,cn as GeometryOffsetAttribute,Fn as GeometryPipeline,YB as GeometryPipelineStage,Od as GeometryType,ai as GeometryUpdater,eS as GeometryUpdaterSet,BU as GeometryVisualizer,ZS as GetFeatureInfoFormat,K4 as Globe,D8 as GlobeDepth,l4 as GlobeSurfaceShaderSet,Lh as GlobeSurfaceTile,B4 as GlobeSurfaceTileProvider,k4 as GlobeTranslucency,R8 as GlobeTranslucencyFramebuffer,A8 as GlobeTranslucencyState,dI as GltfBufferViewLoader,hI as GltfDracoLoader,k2 as GltfGpmLoader,kI as GltfGpmLocal,mI as GltfImageLoader,pI as GltfIndexBufferLoader,gI as GltfJsonLoader,Am as GltfLoader,Eu as GltfLoaderUtil,H2 as GltfMeshPrimitiveGpmLoader,D2 as GltfStructuralMetadataLoader,TI as GltfTextureLoader,CI as GltfVertexBufferLoader,gSe as GoogleEarthEnterpriseImageryProvider,y4 as GoogleEarthEnterpriseMapsProvider,O0 as GoogleEarthEnterpriseMetadata,qD as GoogleEarthEnterpriseTerrainData,Pxe as GoogleEarthEnterpriseTerrainProvider,VV as GoogleEarthEnterpriseTileInformation,Rxe as GoogleGeocoderService,kS as GoogleMaps,uV as GpxDataSource,_g as GregorianDate,ySe as GridImageryProvider,UP as GridMaterialProperty,jn as GroundGeometryUpdater,WC as GroundPolylineGeometry,sm as GroundPolylinePrimitive,Bl as GroundPrimitive,_P as GroupMetadata,bh as HeadingPitchRange,fc as HeadingPitchRoll,tO as Heap,$e as HeightReference,Ih as HeightmapEncoding,Dc as HeightmapTerrainData,UD as HeightmapTessellator,Xk as HermitePolynomialApproximation,f_ as HermiteSpline,cI as HilbertOrder,J5 as HomeButton,Z5 as HomeButtonViewModel,Ei as HorizontalOrigin,xIe as I3SBuildingSceneLayerExplorer,o6 as I3SBuildingSceneLayerExplorerViewModel,Ap as I3SDataProvider,HG as I3SDecoder,GG as I3SFeature,WG as I3SField,Q1 as I3SGeometry,Dv as I3SLayer,J1 as I3SNode,$G as I3SStatistics,ZG as I3SSublayer,XG as I3SSymbology,eB as I3dmLoader,Z2 as I3dmParser,vSe as ITwinData,ta as ITwinPlatform,qV as Iau2000Orientation,uO as Iau2006XysData,gC as Iau2006XysSample,YV as IauOrientationAxes,WV as IauOrientationParameters,cA as ImageBasedLighting,dB as ImageBasedLightingPipelineStage,Hx as ImageMaterialProperty,o1 as Imagery,Mc as ImageryLayer,z4 as ImageryLayerCollection,up as ImageryLayerFeatureInfo,lu as ImageryProvider,ui as ImageryState,wI as Implicit3DTileContent,lI as ImplicitAvailabilityBitstream,uI as ImplicitMetadataView,hs as ImplicitSubdivisionScheme,yA as ImplicitSubtree,MG as ImplicitSubtreeCache,VF as ImplicitSubtreeMetadata,gE as ImplicitTileCoordinates,_E as ImplicitTileset,ke as IndexDatatype,a6 as InfoBox,r6 as InfoBoxViewModel,cf as InspectorShared,ms as InstanceAttributeSemantic,wB as InstancingPipelineStage,Yxe as InterpolationAlgorithm,rl as InterpolationType,Gt as Intersect,ni as IntersectionTests,P0 as Intersections2D,hc as Interval,T1 as InvertClassification,mm as Ion,L0 as IonGeocodeProviderType,US as IonGeocoderService,j0 as IonImageryProvider,Rf as IonResource,W0 as IonWorldImageryStyle,Ge as Iso8601,S8 as JobScheduler,xc as JobType,dy as JsonMetadataTable,$ as JulianDate,SO as KTX2Transcoder,Pa as KeyboardEventModifier,Eo as KeyframeNode,fV as KmlCamera,ES as KmlDataSource,dV as KmlLookAt,mV as KmlTour,_V as KmlTourFlyTo,gV as KmlTourWait,xb as Label,g_ as LabelCollection,cm as LabelGraphics,tr as LabelStyle,kU as LabelVisualizer,Kk as LagrangePolynomialApproximation,Qi as LeapSecond,ISe as Light,h_ as LightingModel,KB as LightingPipelineStage,PE as LinearApproximation,Kd as LinearSpline,Kxe as ManageIndexedDB,Vl as ManagedArray,$u as MapMode2D,$xe as MapProjection,x4 as MapboxImageryProvider,DSe as MapboxStyleImageryProvider,Ji as Material,mo as MaterialAppearance,ZB as MaterialPipelineStage,dr as MaterialProperty,P as Math,ti as Matrix2,Z as Matrix3,O as Matrix4,B1 as Megatexture,V2 as MeshPrimitiveGpmLocal,xm as MetadataClass,t_ as MetadataClassProperty,kt as MetadataComponentType,kn as MetadataEntity,u2 as MetadataEnum,c2 as MetadataEnumValue,w8 as MetadataPicking,Uf as MetadataPickingPipelineStage,$d as MetadataPipelineStage,Ff as MetadataSchema,EI as MetadataSchemaLoader,xA as MetadataSemantic,jd as MetadataTable,GF as MetadataTableProperty,at as MetadataType,Fd as MipmapHint,wm as Model,zf as Model3DTileContent,p3 as ModelAlphaOptions,nB as ModelAnimation,tB as ModelAnimationChannel,oB as ModelAnimationCollection,vu as ModelAnimationLoop,Sm as ModelAnimationState,pB as ModelArticulation,hB as ModelArticulationStage,yB as ModelClippingPlanesPipelineStage,TB as ModelClippingPolygonsPipelineStage,ub as ModelColorPipelineStage,Cn as ModelComponents,P3 as ModelDrawCommand,O3 as ModelDrawCommands,rB as ModelFeature,sB as ModelFeatureTable,Fg as ModelGraphics,Wwe as ModelInstanceCollection,S3 as ModelLightingOptions,IB as ModelMatrixUpdateStage,CB as ModelNode,_3 as ModelRenderResources,DB as ModelRuntimeNode,h3 as ModelRuntimePrimitive,L3 as ModelSceneGraph,b3 as ModelSilhouettePipelineStage,m3 as ModelSkin,A3 as ModelSplitterPipelineStage,N3 as ModelStatistics,vr as ModelType,Jt as ModelUtility,zU as ModelVisualizer,e8 as Moon,JB as MorphTargetsPipelineStage,$V as MorphWeightSpline,wb as MortonOrder,ck as Multiple3DTileContent,EN as MultisampleFramebuffer,u6 as NavigationHelpButton,c6 as NavigationHelpButtonViewModel,Vt as NearFarScalar,RSe as NeverTileDiscardPolicy,E3 as NodeRenderResources,PB as NodeStatisticsPipelineStage,eA as NodeTransformationProperty,M8 as OIT,e4 as Occluder,ro as OffsetGeometryInstanceAttribute,Jxe as OpenCageGeocoderService,rx as OpenStreetMapImageryProvider,aU as OrderedGroundPrimitiveCollection,Pn as OrientedBoundingBox,ln as OrthographicFrustum,Qr as OrthographicOffCenterFrustum,ebe as Packable,tbe as PackableForInterpolation,nR as Particle,LSe as ParticleBurst,FSe as ParticleEmitter,USe as ParticleSystem,Se as Pass,Hc as PassState,Bg as PathGraphics,VU as PathVisualizer,XV as PeliasGeocoderService,un as PerInstanceColorAppearance,$0 as PerformanceDisplay,h6 as PerformanceWatchdog,f6 as PerformanceWatchdogViewModel,Li as PerspectiveFrustum,au as PerspectiveOffCenterFrustum,I8 as PickDepth,L8 as PickDepthFramebuffer,N8 as PickFramebuffer,oG as PickedMetadataInfo,q8 as Picking,e3 as PickingPipelineStage,g0 as PinBuilder,He as PixelDatatype,je as PixelFormat,en as Plane,yU as PlaneGeometry,TU as PlaneGeometryUpdater,AF as PlaneGraphics,bU as PlaneOutlineGeometry,B3 as PntsLoader,YA as PntsParser,CG as PointCloud,py as PointCloudEyeDomeLighting,s_ as PointCloudShading,n3 as PointCloudStylingPipelineStage,nA as PointGraphics,ea as PointPrimitive,NP as PointPrimitiveCollection,HU as PointVisualizer,ly as PolygonGeometry,Hn as PolygonGeometryLibrary,SU as PolygonGeometryUpdater,lm as PolygonGraphics,gc as PolygonHierarchy,EU as PolygonOutlineGeometry,li as PolygonPipeline,Qd as Polyline,zP as PolylineArrowMaterialProperty,Rm as PolylineCollection,ds as PolylineColorAppearance,VP as PolylineDashMaterialProperty,c0 as PolylineGeometry,jU as PolylineGeometryUpdater,HP as PolylineGlowMaterialProperty,Kc as PolylineGraphics,Ua as PolylineMaterialAppearance,Mb as PolylineOutlineMaterialProperty,zi as PolylinePipeline,qU as PolylineVisualizer,vU as PolylineVolumeGeometry,Nm as PolylineVolumeGeometryLibrary,IU as PolylineVolumeGeometryUpdater,iA as PolylineVolumeGraphics,wU as PolylineVolumeOutlineGeometry,am as PositionProperty,qy as PositionPropertyArray,yo as PostProcessStage,hH as PostProcessStageCollection,Qu as PostProcessStageComposite,bd as PostProcessStageLibrary,xd as PostProcessStageSampleMode,dv as PostProcessStageTextureCache,z2 as PpeMetadata,eve as PpeSource,U2 as PpeTexture,Dn as Primitive,Jl as PrimitiveCollection,RA as PrimitiveLoadPlan,DA as PrimitiveOutlineGenerator,r3 as PrimitiveOutlinePipelineStage,VC as PrimitivePipeline,v3 as PrimitiveRenderResources,kr as PrimitiveState,s3 as PrimitiveStatisticsPipelineStage,Le as PrimitiveType,g6 as ProjectionPicker,p6 as ProjectionPickerViewModel,X as Property,GP as PropertyArray,IA as PropertyAttribute,w2 as PropertyAttributeProperty,zl as PropertyBag,ql as PropertyTable,hy as PropertyTexture,v2 as PropertyTextureProperty,Ss as ProviderViewModel,obe as Proxy,Dl as QuadraticRealPolynomial,V4 as QuadtreeOccluders,X4 as QuadtreePrimitive,G4 as QuadtreeTile,Da as QuadtreeTileLoadState,zSe as QuadtreeTileProvider,PS as QuantizedMeshTerrainData,wO as QuarticRealPolynomial,Pe as Quaternion,Ty as QuaternionSpline,Wl as Queue,gn as Ray,ae as Rectangle,iS as RectangleCollisionChecker,$E as RectangleGeometry,Js as RectangleGeometryLibrary,PU as RectangleGeometryUpdater,um as RectangleGraphics,sE as RectangleOutlineGeometry,Wi as ReferenceFrame,Xy as ReferenceProperty,ze as RenderState,Af as Renderbuffer,Ml as RenderbufferFormat,ur as Request,Op as RequestErrorEvent,lc as RequestScheduler,Xn as RequestState,Is as RequestType,Ee as Resource,Ri as ResourceCache,Su as ResourceCacheKey,h2 as ResourceCacheStatistics,eo as ResourceLoader,yt as ResourceLoaderState,uh as Rotation,se as RuntimeError,Kg as S2Cell,xa as SDFSettings,ja as SampledPositionProperty,od as SampledProperty,zt as Sampler,U_ as ScaledPositionProperty,cG as Scene,cv as SceneFramebuffer,ne as SceneMode,a3 as SceneMode2DPipelineStage,T6 as SceneModePicker,x6 as SceneModePickerViewModel,qi as SceneTransforms,pH as SceneTransitioner,vH as ScreenSpaceCameraController,md as ScreenSpaceEventHandler,An as ScreenSpaceEventType,hb as SelectedFeatureIdPipelineStage,S6 as SelectionIndicator,A6 as SelectionIndicatorViewModel,qP as SensorVolumePortionToDisplay,OC as ShaderBuilder,gN as ShaderCache,pe as ShaderDestination,wN as ShaderFunction,Xt as ShaderProgram,Be as ShaderSource,vN as ShaderStruct,Q0 as ShadowMap,tg as ShadowMapShader,Tn as ShadowMode,wf as ShadowVolumeAppearance,bn as ShowGeometryInstanceAttribute,Dx as Simon1994PlanetaryPositions,Cbe as SimplePolylineGeometry,b4 as SingleTileImageryProvider,l3 as SkinningPipelineStage,fG as SkyAtmosphere,mG as SkyBox,eG as SpatialNode,B2 as Spdcf,hm as SpecularEnvironmentCubeMap,VSe as SphereEmitter,Abe as SphereGeometry,Ny as SphereOutlineGeometry,$k as Spherical,to as Spline,Jr as SplitDirection,H1 as Splitter,ph as StaticGeometryColorBatch,gh as StaticGeometryPerMaterialBatch,rD as StaticGroundGeometryColorBatch,FU as StaticGroundGeometryPerMaterialBatch,WU as StaticGroundPolylinePerMaterialBatch,sD as StaticOutlineGeometryBatch,jt as StencilConstants,Vn as StencilFunction,ht as StencilOperation,zA as SteppedSpline,nl as Stereographic,ab as StorageType,jP as StripeMaterialProperty,Um as StripeOrientation,ga as StructuralMetadata,vm as StyleCommandsNeeded,HSe as StyleExpression,yG as Sun,wg as SunLight,PH as SunPostProcess,M2 as SupportedImageFormats,w5 as SvgPathBindingHandler,hi as TaskProcessor,t5 as Terrain,sp as TerrainData,gl as TerrainEncoding,a1 as TerrainFillMesh,Ph as TerrainMesh,sA as TerrainOffsetProperty,Ts as TerrainProvider,Ia as TerrainQuantization,go as TerrainState,dt as Texture,wie as Texture3D,MC as TextureAtlas,xN as TextureCache,Kn as TextureMagnificationFilter,ZH as TextureManager,ft as TextureMinificationFilter,xw as TexturePacker,QSe as TextureUniform,sn as TextureWrap,ap as TileAvailability,$f as TileBoundingRegion,dk as TileBoundingS2Cell,Fy as TileBoundingSphere,GSe as TileBoundingVolume,n5 as TileCoordinatesImageryProvider,jSe as TileCoordinatesImageryProviderFlw,WSe as TileCoordinatesImageryProviderJww,qSe as TileDiscardPolicy,yn as TileEdge,r1 as TileImagery,fT as TileMapServiceImageryProvider,sk as TileMetadata,Du as TileOrientedBoundingBox,Fo as TileProviderError,W4 as TileReplacementQueue,$n as TileSelectionResult,YSe as TileState,U3 as Tileset3DTileContent,_k as TilesetMetadata,aB as TilesetPipelineStage,Ebe as TilingScheme,Yn as TimeConstants,QS as TimeDynamicImagery,j1 as TimeDynamicPointCloud,Sn as TimeInterval,is as TimeIntervalCollection,$y as TimeIntervalCollectionPositionProperty,Zy as TimeIntervalCollectionProperty,Wn as TimeStandard,I6 as Timeline,v6 as TimelineHighlightRange,w6 as TimelineTrack,DO as Tipsify,ZT as ToggleButtonViewModel,ex as Tonemapper,Og as TrackingReferenceFrame,Et as Transforms,jx as TranslationRotationScale,k8 as TranslucentTileClassification,HI as TridiagonalSystemSolver,Jv as TrustedServers,mv as TweenCollection,CN as UniformState,L1 as UniformType,Oc as UrlTemplateImageryProvider,fvo as VERSION,O6 as VRButton,D6 as VRButtonViewModel,Ibe as VRTheWorldTerrainProvider,JSe as VaryingType,Zp as Vector3DTileBatch,nk as Vector3DTileClampedPolylines,ok as Vector3DTileContent,Wg as Vector3DTileGeometry,Z3 as Vector3DTilePoints,Q3 as Vector3DTilePolygons,eE as Vector3DTilePolylines,fA as Vector3DTilePrimitive,Qk as VelocityOrientationProperty,Qy as VelocityVectorProperty,qn as VertexArray,Ig as VertexArrayFacade,mt as VertexAttributeSemantic,De as VertexFormat,Br as VerticalExaggeration,f3 as VerticalExaggerationPipelineStage,Bn as VerticalOrigin,Sbe as VideoSynchronizer,uv as View,OIe as Viewer,XSe as ViewportQuad,Dr as Visibility,L0e as Visualizer,bv as VoxelBoxShape,RH as VoxelCell,xv as VoxelContent,Tv as VoxelCylinderShape,Cv as VoxelEllipsoidShape,N6 as VoxelInspector,M6 as VoxelInspectorViewModel,zh as VoxelMetadataOrder,DT as VoxelPrimitive,KSe as VoxelProvider,qH as VoxelRenderResources,$Se as VoxelShape,$a as VoxelShapeType,nG as VoxelTraversal,Pbe as VulkanConstants,RU as WallGeometry,QE as WallGeometryLibrary,MU as WallGeometryUpdater,kg as WallGraphics,OU as WallOutlineGeometry,q as WebGLConstants,C4 as WebMapServiceImageryProvider,A4 as WebMapTileServiceImageryProvider,ki as WebMercatorProjection,Cs as WebMercatorTilingScheme,Ps as WindingOrder,XI as WireframeIndexGenerator,d3 as WireframePipelineStage,Y8 as _shadersAcesTonemappingStage,wH as _shadersAdditiveBlend,C1 as _shadersAdjustTranslucentFS,DN as _shadersAllMaterialAppearanceFS,RN as _shadersAllMaterialAppearanceVS,X8 as _shadersAmbientOcclusionGenerate,K8 as _shadersAmbientOcclusionModulate,FN as _shadersAspectRampMaterial,Cm as _shadersAtmosphereCommon,cB as _shadersAtmosphereStageFS,lB as _shadersAtmosphereStageVS,ON as _shadersBasicMaterialAppearanceFS,MN as _shadersBasicMaterialAppearanceVS,z3 as _shadersBillboardCollectionFS,V3 as _shadersBillboardCollectionVS,$8 as _shadersBlackAndWhite,Z8 as _shadersBloomComposite,t8 as _shadersBrdfLutGeneratorFS,IH as _shadersBrightPass,Q8 as _shadersBrightness,BN as _shadersBumpMapMaterial,NB as _shadersCPUStylingStageFS,LB as _shadersCPUStylingStageVS,kN as _shadersCheckerboardMaterial,EG as _shadersCloudCollectionFS,SG as _shadersCloudCollectionVS,vG as _shadersCloudNoiseFS,wG as _shadersCloudNoiseVS,B8 as _shadersCompareAndPackTranslucentDepth,O8 as _shadersCompositeOITFS,lv as _shadersCompositeTranslucentClassification,C2 as _shadersComputeIrradianceFS,A2 as _shadersComputeRadianceMapFS,J8 as _shadersContrastBias,E2 as _shadersConvolveSpecularMapFS,S2 as _shadersConvolveSpecularMapVS,kB as _shadersCustomShaderStageFS,BB as _shadersCustomShaderStageVS,IC as _shadersCzmBuiltins,eH as _shadersDepthOfField,p8 as _shadersDepthPlaneFS,_8 as _shadersDepthPlaneVS,tH as _shadersDepthView,ZSe as _shadersDepthViewPacked,UN as _shadersDotMaterial,nH as _shadersEdgeDetection,zN as _shadersElevationBandMaterial,VN as _shadersElevationContourMaterial,HN as _shadersElevationRampMaterial,f1 as _shadersEllipsoidFS,UG as _shadersEllipsoidSurfaceAppearanceFS,zG as _shadersEllipsoidSurfaceAppearanceVS,d1 as _shadersEllipsoidVS,rH as _shadersFXAA,fH as _shadersFXAA3_11,GN as _shadersFadeMaterial,UB as _shadersFeatureIdStageFS,zB as _shadersFeatureIdStageVS,iH as _shadersFilmicTonemapping,bT as _shadersGaussianBlur1D,WB as _shadersGeometryStageFS,qB as _shadersGeometryStageVS,a4 as _shadersGlobeFS,c4 as _shadersGlobeVS,jN as _shadersGridMaterial,$D as _shadersGroundAtmosphere,_L as _shadersHSBToRGB,gL as _shadersHSLToRGB,fB as _shadersImageBasedLightingStageFS,AB as _shadersInstancingStageCommon,EB as _shadersInstancingStageVS,kH as _shadersIntersectBox,BH as _shadersIntersectClippingPlanes,UH as _shadersIntersectCylinder,FH as _shadersIntersectDepth,zH as _shadersIntersectEllipsoid,M1 as _shadersIntersectLongitude,_v as _shadersIntersection,NH as _shadersIntersectionUtils,SB as _shadersLegacyInstancingStageVS,sH as _shadersLensFlare,XB as _shadersLightingStageFS,$B as _shadersMaterialStageFS,WH as _shadersMegatexture,VB as _shadersMetadataStageFS,HB as _shadersMetadataStageVS,gB as _shadersModelClippingPlanesStageFS,bB as _shadersModelClippingPolygonsStageFS,xB as _shadersModelClippingPolygonsStageVS,_B as _shadersModelColorStageFS,R3 as _shadersModelFS,g3 as _shadersModelSilhouetteStageFS,y3 as _shadersModelSilhouetteStageVS,T3 as _shadersModelSplitterStageFS,D3 as _shadersModelVS,aH as _shadersModifiedReinhardTonemapping,QB as _shadersMorphTargetsStageVS,cH as _shadersNightVision,WN as _shadersNormalMapMaterial,IG as _shadersOctahedralProjectionAtlasFS,PG as _shadersOctahedralProjectionFS,DG as _shadersOctahedralProjectionVS,jH as _shadersOctree,Zu as _shadersPassThrough,gT as _shadersPassThroughDepth,oH as _shadersPbrNeutralTonemapping,tF as _shadersPerInstanceColorAppearanceFS,nF as _shadersPerInstanceColorAppearanceVS,kC as _shadersPerInstanceFlatColorAppearanceFS,iF as _shadersPerInstanceFlatColorAppearanceVS,W2 as _shadersPointCloudEyeDomeLighting,t3 as _shadersPointCloudStylingStageVS,Db as _shadersPointPrimitiveCollectionFS,Vk as _shadersPointPrimitiveCollectionVS,T2 as _shadersPolygonSignedDistanceFS,qN as _shadersPolylineArrowMaterial,TF as _shadersPolylineColorAppearanceVS,If as _shadersPolylineCommon,YN as _shadersPolylineDashMaterial,qC as _shadersPolylineFS,XN as _shadersPolylineGlowMaterial,CF as _shadersPolylineMaterialAppearanceVS,KN as _shadersPolylineOutlineMaterial,gF as _shadersPolylineShadowVolumeFS,yF as _shadersPolylineShadowVolumeMorphFS,xF as _shadersPolylineShadowVolumeMorphVS,bF as _shadersPolylineShadowVolumeVS,q3 as _shadersPolylineVS,o3 as _shadersPrimitiveOutlineStageFS,i3 as _shadersPrimitiveOutlineStageVS,GL as _shadersRGBToHSB,jL as _shadersRGBToHSL,WL as _shadersRGBToXYZ,lH as _shadersReinhardTonemapping,E4 as _shadersReprojectWebMercatorFS,S4 as _shadersReprojectWebMercatorVS,$N as _shadersRimLightingMaterial,qI as _shadersSelectedFeatureIdStageCommon,Pw as _shadersShadowVolumeAppearanceFS,aF as _shadersShadowVolumeAppearanceVS,Bx as _shadersShadowVolumeFS,uH as _shadersSilhouette,c3 as _shadersSkinningStageVS,U1 as _shadersSkyAtmosphereCommon,lG as _shadersSkyAtmosphereFS,uG as _shadersSkyAtmosphereVS,dG as _shadersSkyBoxFS,hG as _shadersSkyBoxVS,ZN as _shadersSlopeRampMaterial,QN as _shadersStripeMaterial,pG as _shadersSunFS,_G as _shadersSunTextureFS,gG as _shadersSunVS,LN as _shadersTexturedMaterialAppearanceFS,NN as _shadersTexturedMaterialAppearanceVS,tk as _shadersVector3DTileClampedPolylinesFS,ek as _shadersVector3DTileClampedPolylinesVS,J3 as _shadersVector3DTilePolylinesVS,sI as _shadersVectorTileVS,u3 as _shadersVerticalExaggerationStageVS,RG as _shadersViewportQuadFS,bC as _shadersViewportQuadVS,MH as _shadersVoxelFS,OH as _shadersVoxelUtils,LH as _shadersVoxelVS,eF as _shadersWater,JN as _shadersWaterMaskMaterial,pN as _shadersXYZToRGB,LM as _shadersacesTonemapping,NM as _shadersalphaWeight,FM as _shadersantialias,BM as _shadersapplyHSBShift,kM as _shadersapproximateSphericalCoordinates,UM as _shadersapproximateTanh,zM as _shadersbackFacing,VM as _shadersbranchFreeTernary,HM as _shaderscascadeColor,GM as _shaderscascadeDistance,jM as _shaderscascadeMatrix,WM as _shaderscascadeWeights,qM as _shadersclipPolygons,YM as _shaderscolumbusViewMorph,XM as _shaderscomputeAtmosphereColor,KM as _shaderscomputeGroundAtmosphereScattering,$M as _shaderscomputePosition,ZM as _shaderscomputeScattering,VH as _shadersconvertUvToBox,HH as _shadersconvertUvToCylinder,GH as _shadersconvertUvToEllipsoid,QM as _shaderscosineAndSine,JM as _shadersdecompressTextureCoordinates,HO as _shadersdegreesPerRadian,eL as _shadersdepthClamp,GO as _shadersdepthRange,vM as _shadersdepthRangeStruct,tL as _shaderseastNorthUpToEyeCoordinates,nL as _shadersellipsoidContainsPoint,iL as _shadersellipsoidTextureCoordinates,jO as _shadersepsilon1,WO as _shadersepsilon2,qO as _shadersepsilon3,YO as _shadersepsilon4,XO as _shadersepsilon5,KO as _shadersepsilon6,$O as _shadersepsilon7,oL as _shadersequalsEpsilon,rL as _shaderseyeOffset,sL as _shaderseyeToWindowCoordinates,aL as _shadersfastApproximateAtan,cL as _shadersfog,lL as _shadersgammaCorrect,uL as _shadersgeodeticSurfaceNormal,fL as _shadersgetDefaultMaterial,dL as _shadersgetDynamicAtmosphereLightDirection,hL as _shadersgetLambertDiffuse,mL as _shadersgetSpecular,pL as _shadersgetWaterNoise,yL as _shadershue,ZO as _shadersinfinity,xL as _shadersinverseGamma,bL as _shadersisEmpty,TL as _shadersisFull,CL as _shaderslatitudeToWebMercatorFraction,EL as _shaderslineDistance,AL as _shaderslinearToSrgb,SL as _shadersluminance,wM as _shadersmaterial,IM as _shadersmaterialInput,vL as _shadersmaximumComponent,wL as _shadersmetersPerPixel,PM as _shadersmodelMaterial,IL as _shadersmodelToWindowCoordinates,DM as _shadersmodelVertexOutput,PL as _shadersmultiplyWithColorBalance,DL as _shadersnearFarScalar,RL as _shadersoctDecode,QO as _shadersoneOverPi,JO as _shadersoneOverTwoPi,OL as _shaderspackDepth,eM as _shaderspassCesium3DTile,tM as _shaderspassCesium3DTileClassification,nM as _shaderspassCesium3DTileClassificationIgnoreShow,iM as _shaderspassClassification,oM as _shaderspassCompute,rM as _shaderspassEnvironment,sM as _shaderspassGlobe,aM as _shaderspassOpaque,cM as _shaderspassOverlay,lM as _shaderspassTerrainClassification,uM as _shaderspassTranslucent,fM as _shaderspassVoxels,ML as _shaderspbrLighting,LL as _shaderspbrNeutralTonemapping,NL as _shadersphong,dM as _shaderspi,hM as _shaderspiOverFour,mM as _shaderspiOverSix,pM as _shaderspiOverThree,_M as _shaderspiOverTwo,FL as _shadersplaneDistance,BL as _shaderspointAlongRay,gM as _shadersradiansPerDegree,RM as _shadersray,kL as _shadersrayEllipsoidIntersectionInterval,OM as _shadersraySegment,UL as _shadersraySphereIntersectionInterval,zL as _shadersreadDepth,VL as _shadersreadNonPerspective,HL as _shadersreverseLogDepth,qL as _shadersround,YL as _shaderssaturation,yM as _shaderssceneMode2D,xM as _shaderssceneMode3D,bM as _shaderssceneModeColumbusView,TM as _shaderssceneModeMorphing,XL as _shadersshadowDepthCompare,MM as _shadersshadowParameters,KL as _shadersshadowVisibility,$L as _shaderssignNotZero,CM as _shaderssolarRadius,ZL as _shaderssphericalHarmonics,QL as _shaderssrgbToLinear,JL as _shaderstangentToEyeSpaceMatrix,eN as _shaderstextureCube,AM as _shadersthreePiOver2,tN as _shaderstransformPlane,nN as _shaderstranslateRelativeToEye,iN as _shaderstranslucentPhong,oN as _shaderstranspose,EM as _shaderstwoPi,rN as _shadersunpackClippingExtents,sN as _shadersunpackDepth,aN as _shadersunpackFloat,cN as _shadersunpackUint,lN as _shadersvalueTransform,uN as _shadersvertexLogDepth,SM as _shaderswebMercatorMaxLatitude,fN as _shaderswindowToEyeCoordinates,dN as _shaderswriteDepthClamp,hN as _shaderswriteLogDepth,mN as _shaderswriteNonPerspective,e2 as addBuffer,jF as addDefaults,ZF as addExtensionsRequired,Wd as addExtensionsUsed,eb as addPipelineExtras,Ks as addToArray,ZR as appendForwardSlash,vo as arrayRemoveDuplicates,CC as barycentricCoordinates,zo as binarySearch,on as buildModuleUrl,KH as buildVoxelDrawCommands,Fe as clone,ct as combine,jS as computeFlyToLocationForRectangle,KA as createBillboardPointCallback,vn as createCommand,k5 as createDefaultImageryProviderViewModels,U5 as createDefaultTerrainProviderViewModels,cSe as createElevationBandMaterial,uSe as createGooglePhotorealistic3DTileset,Nn as createGuid,Ho as createMaterialPropertyDescriptor,fSe as createOsmBuildingsAsync,ue as createPropertyDescriptor,Ul as createRawPropertyDescriptor,dSe as createTangentSpaceDebugPrimitive,tve as createTaskProcessorWorker,xO as createUniform,bO as createUniformArray,LV as createWorldBathymetryAsync,q0 as createWorldImageryAsync,OS as createWorldTerrainAsync,NV as decodeGoogleEarthEnterpriseData,ik as decodeVectorPolylinePositions,Oe as defaultValue,la as defer,l as defined,_N as demodernizeShader,Mo as deprecationWarning,ce as destroyObject,jge as exportKml,pA as findAccessorMinMax,nE as findContentMetadata,iE as findGroupMetadata,ak as findTileMetadata,_I as forEachTextureInMaterial,Y_ as formatError,ote as freezeRenderState,_f as getAbsoluteUri,Au as getAccessorByteStride,QR as getBaseUri,Mf as getBinaryAccessor,xG as getClipAndStyleCode,H0 as getClippingFunction,ty as getComponentReader,On as getElement,uC as getExtensionFromUri,Wy as getFilenameFromUri,zV as getImageFromTypedArray,qh as getImagePixels,jo as getJsonFromTypedArray,Hl as getMagic,iG as getMetadataClassProperty,rG as getMetadataProperty,ha as getStringFromTypedArray,Pi as getTimestamp,ci as hasExtension,Ug as heightReferenceOnEntityPropertyChanged,xl as isBitSet,fC as isBlobUri,yx as isCrossOriginUrl,yg as isDataUri,Wh as isLeapYear,xe as knockout,Gv as knockout_3_5_1,v5 as knockout_es5,dC as loadAndExecuteScript,SN as loadCubeMap,Jg as loadImageFromTypedArray,fa as loadKTX2,F0 as mergeSort,$F as moveTechniqueRenderStates,QF as moveTechniquesToExtension,Nf as numberOfComponentsForType,hC as objectToQuery,Tt as oneTimeWarning,_y as parseBatchTable,P2 as parseFeatureMetadataLegacy,YF as parseGlb,eO as parseResponseHeaders,I2 as parseStructuralMetadata,ZI as pickModel,nbe as pointInsideTriangle,Oy as preprocess3DTileContent,XH as processVoxelProperties,gf as queryToObject,t2 as readAccessorPacked,_A as removeExtension,qF as removeExtensionsRequired,mA as removeExtensionsUsed,KF as removePipelineExtras,JF as removeUnusedElements,nb as resizeImageToNextPowerOfTwo,t4 as sampleTerrain,VS as sampleTerrainMostDetailed,sC as scaleToGeodeticSurface,GS as srgbToLinear,cF as subdivideArray,Ja as subscribeAndEvaluate,i2 as updateAccessorComponentTypes,r2 as updateVersion,Er as usesExtension,MIe as viewerCesium3DTilesInspectorMixin,LIe as viewerCesiumInspectorMixin,FIe as viewerDragDropMixin,BIe as viewerPerformanceWatchdogMixin,UIe as viewerVoxelInspectorMixin,V0 as webGLConstantToGlslType,s4 as wrapFunction,ZA as writeTextToCanvas}; diff --git a/src/renderer/public/sdk/Cesium/index.js.map b/src/renderer/public/sdk/Cesium/index.js.map deleted file mode 100644 index 0c7e070..0000000 --- a/src/renderer/public/sdk/Cesium/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../node_modules/.store/mersenne-twister@1.1.0/node_modules/mersenne-twister/src/mersenne-twister.js", "../../node_modules/.store/urijs@1.19.11/node_modules/urijs/src/punycode.js", "../../node_modules/.store/urijs@1.19.11/node_modules/urijs/src/IPv6.js", "../../node_modules/.store/urijs@1.19.11/node_modules/urijs/src/SecondLevelDomains.js", "../../node_modules/.store/urijs@1.19.11/node_modules/urijs/src/URI.js", "../../node_modules/.store/dompurify@2.5.6/node_modules/dompurify/src/utils.js", "../../node_modules/.store/dompurify@2.5.6/node_modules/dompurify/src/tags.js", "../../node_modules/.store/dompurify@2.5.6/node_modules/dompurify/src/attrs.js", "../../node_modules/.store/dompurify@2.5.6/node_modules/dompurify/src/regexp.js", "../../node_modules/.store/dompurify@2.5.6/node_modules/dompurify/src/purify.js", "../../node_modules/.store/jsep@0.3.5/node_modules/jsep/build/jsep.js", "../../node_modules/.store/bitmap-sdf@1.0.4/node_modules/bitmap-sdf/index.js", "../../node_modules/.store/grapheme-splitter@1.0.4/node_modules/grapheme-splitter/index.js", "../../node_modules/.store/earcut@2.2.4/node_modules/earcut/src/earcut.js", "../../node_modules/.store/rbush@3.0.1/node_modules/rbush/rbush.min.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/minimal/lib/prelude.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/aspromise/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/base64/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/eventemitter/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/float/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/inquire/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/pool/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/node_modules/@protobufjs/utf8/index.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/index-minimal", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/reader.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/reader_buffer.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/roots.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/rpc.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/rpc/service.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/util/longbits.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/util/minimal.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/writer.js", "../../node_modules/.store/protobufjs@7.4.0/node_modules/protobufjs/dist/src/writer_buffer.js", "../../node_modules/.store/nosleep.js@0.12.0/node_modules/nosleep.js/src/media.js", "../../node_modules/.store/nosleep.js@0.12.0/node_modules/nosleep.js/src/index.js", "../../Source/Core/defaultValue.js", "../../Source/Core/defined.js", "../../Source/Core/DeveloperError.js", "../../Source/Core/Check.js", "../../Source/Core/Event.js", "../../Source/DataSources/ConstantProperty.js", "../../Source/DataSources/createPropertyDescriptor.js", "../../Source/DataSources/BillboardGraphics.js", "../../Source/Core/AssociativeArray.js", "../../Source/Core/Math.js", "../../Source/Core/Cartesian2.js", "../../Source/Core/Cartesian3.js", "../../Source/Core/scaleToGeodeticSurface.js", "../../Source/Core/Cartographic.js", "../../Source/Core/Ellipsoid.js", "../../Source/Core/GeographicProjection.js", "../../Source/Core/Intersect.js", "../../Source/Core/Rectangle.js", "../../Source/Core/BoundingRectangle.js", "../../Source/Core/Fullscreen.js", "../../Source/Core/FeatureDetection.js", "../../Source/Core/Color.js", "../../Source/Core/destroyObject.js", "../../Source/Core/DistanceDisplayCondition.js", "../../Source/Core/NearFarScalar.js", "../../Source/Scene/HeightReference.js", "../../Source/Scene/HorizontalOrigin.js", "../../Source/Scene/VerticalOrigin.js", "../../Source/DataSources/BoundingSphereState.js", "../../Source/DataSources/Property.js", "../../Source/DataSources/BillboardVisualizer.js", "../../Source/Core/Interval.js", "../../Source/Core/Matrix3.js", "../../Source/Core/Cartesian4.js", "../../Source/Core/RuntimeError.js", "../../Source/Core/Matrix4.js", "../../Source/Core/BoundingSphere.js", "../../Source/Core/WebGLConstants.js", "../../Source/Core/ComponentDatatype.js", "../../Source/Core/GeometryType.js", "../../Source/Core/Matrix2.js", "../../Source/Core/PrimitiveType.js", "../../Source/Core/Quaternion.js", "../../Source/Core/binarySearch.js", "../../Source/Core/EarthOrientationParametersSample.js", "../../Source/Core/GregorianDate.js", "../../Source/Core/isLeapYear.js", "../../Source/Core/LeapSecond.js", "../../Source/Core/TimeConstants.js", "../../Source/Core/TimeStandard.js", "../../Source/Core/JulianDate.js", "../../Source/Core/Resource.js", "../../Source/Core/appendForwardSlash.js", "../../Source/Core/clone.js", "../../Source/Core/combine.js", "../../Source/Core/defer.js", "../../Source/Core/getAbsoluteUri.js", "../../Source/Core/getBaseUri.js", "../../Source/Core/getExtensionFromUri.js", "../../Source/Core/getImagePixels.js", "../../Source/Core/isBlobUri.js", "../../Source/Core/isCrossOriginUrl.js", "../../Source/Core/isDataUri.js", "../../Source/Core/loadAndExecuteScript.js", "../../Source/Core/objectToQuery.js", "../../Source/Core/queryToObject.js", "../../Source/Core/RequestState.js", "../../Source/Core/RequestType.js", "../../Source/Core/Request.js", "../../Source/Core/parseResponseHeaders.js", "../../Source/Core/RequestErrorEvent.js", "../../Source/Core/RequestScheduler.js", "../../Source/Core/Heap.js", "../../Source/Core/TrustedServers.js", "../../Source/Core/EarthOrientationParameters.js", "../../Source/Core/HeadingPitchRoll.js", "../../Source/Core/buildModuleUrl.js", "../../Source/Core/Iau2006XysSample.js", "../../Source/Core/Iau2006XysData.js", "../../Source/Core/Transforms.js", "../../Source/Core/Geometry.js", "../../Source/Core/GeometryAttribute.js", "../../Source/Core/GeometryAttributes.js", "../../Source/Core/GeometryOffsetAttribute.js", "../../Source/Core/VertexFormat.js", "../../Source/Core/BoxGeometry.js", "../../Source/Core/BoxOutlineGeometry.js", "../../Source/Core/ColorGeometryInstanceAttribute.js", "../../Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js", "../../Source/Core/GeometryInstance.js", "../../Source/Core/TimeInterval.js", "../../Source/Core/Iso8601.js", "../../Source/Core/OffsetGeometryInstanceAttribute.js", "../../Source/Core/ShowGeometryInstanceAttribute.js", "../../Source/Shaders/Appearances/AllMaterialAppearanceFS.js", "../../Source/Shaders/Appearances/AllMaterialAppearanceVS.js", "../../Source/Shaders/Appearances/BasicMaterialAppearanceFS.js", "../../Source/Shaders/Appearances/BasicMaterialAppearanceVS.js", "../../Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js", "../../Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js", "../../Source/Scene/BlendEquation.js", "../../Source/Scene/BlendFunction.js", "../../Source/Scene/BlendingState.js", "../../Source/Scene/CullFace.js", "../../Source/Scene/Appearance.js", "../../Source/Core/createGuid.js", "../../Source/Core/CompressedTextureBuffer.js", "../../Source/Core/TaskProcessor.js", "../../Source/Core/KTX2Transcoder.js", "../../Source/Core/loadKTX2.js", "../../Source/Renderer/PixelDatatype.js", "../../Source/Core/PixelFormat.js", "../../Source/Renderer/ContextLimits.js", "../../Source/Renderer/CubeMapFace.js", "../../Source/Renderer/MipmapHint.js", "../../Source/Renderer/TextureMagnificationFilter.js", "../../Source/Renderer/TextureMinificationFilter.js", "../../Source/Renderer/TextureWrap.js", "../../Source/Renderer/Sampler.js", "../../Source/Renderer/CubeMap.js", "../../Source/Renderer/Texture.js", "../../Source/Shaders/Materials/AspectRampMaterial.js", "../../Source/Shaders/Materials/BumpMapMaterial.js", "../../Source/Shaders/Materials/CheckerboardMaterial.js", "../../Source/Shaders/Materials/DotMaterial.js", "../../Source/Shaders/Materials/ElevationBandMaterial.js", "../../Source/Shaders/Materials/ElevationContourMaterial.js", "../../Source/Shaders/Materials/ElevationRampMaterial.js", "../../Source/Shaders/Materials/FadeMaterial.js", "../../Source/Shaders/Materials/GridMaterial.js", "../../Source/Shaders/Materials/NormalMapMaterial.js", "../../Source/Shaders/Materials/PolylineArrowMaterial.js", "../../Source/Shaders/Materials/PolylineDashMaterial.js", "../../Source/Shaders/Materials/PolylineGlowMaterial.js", "../../Source/Shaders/Materials/PolylineOutlineMaterial.js", "../../Source/Shaders/Materials/RimLightingMaterial.js", "../../Source/Shaders/Materials/SlopeRampMaterial.js", "../../Source/Shaders/Materials/StripeMaterial.js", "../../Source/Shaders/Materials/Water.js", "../../Source/Scene/Material.js", "../../Source/Scene/MaterialAppearance.js", "../../Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js", "../../Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js", "../../Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js", "../../Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js", "../../Source/Scene/PerInstanceColorAppearance.js", "../../Source/DataSources/ColorMaterialProperty.js", "../../Source/Core/GeographicTilingScheme.js", "../../Source/Core/ApproximateTerrainHeights.js", "../../Source/Core/AxisAlignedBoundingBox.js", "../../Source/Core/QuadraticRealPolynomial.js", "../../Source/Core/CubicRealPolynomial.js", "../../Source/Core/QuarticRealPolynomial.js", "../../Source/Core/Ray.js", "../../Source/Core/IntersectionTests.js", "../../Source/Core/Plane.js", "../../Source/Core/EllipsoidTangentPlane.js", "../../Source/Core/OrientedBoundingBox.js", "../../Source/Core/TerrainExaggeration.js", "../../Source/Renderer/DrawCommand.js", "../../Source/Renderer/Pass.js", "../../Source/Core/WindingOrder.js", "../../Source/Renderer/freezeRenderState.js", "../../Source/Renderer/RenderState.js", "../../Source/Renderer/AutomaticUniforms.js", "../../Source/Renderer/createUniform.js", "../../Source/Renderer/createUniformArray.js", "../../Source/Renderer/ShaderProgram.js", "../../Source/Renderer/modernizeShader.js", "../../Source/Shaders/Builtin/Constants/degreesPerRadian.js", "../../Source/Shaders/Builtin/Constants/depthRange.js", "../../Source/Shaders/Builtin/Constants/epsilon1.js", "../../Source/Shaders/Builtin/Constants/epsilon2.js", "../../Source/Shaders/Builtin/Constants/epsilon3.js", "../../Source/Shaders/Builtin/Constants/epsilon4.js", "../../Source/Shaders/Builtin/Constants/epsilon5.js", "../../Source/Shaders/Builtin/Constants/epsilon6.js", "../../Source/Shaders/Builtin/Constants/epsilon7.js", "../../Source/Shaders/Builtin/Constants/infinity.js", "../../Source/Shaders/Builtin/Constants/oneOverPi.js", "../../Source/Shaders/Builtin/Constants/oneOverTwoPi.js", "../../Source/Shaders/Builtin/Constants/passCesium3DTile.js", "../../Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js", "../../Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js", "../../Source/Shaders/Builtin/Constants/passClassification.js", "../../Source/Shaders/Builtin/Constants/passCompute.js", "../../Source/Shaders/Builtin/Constants/passEnvironment.js", "../../Source/Shaders/Builtin/Constants/passGlobe.js", "../../Source/Shaders/Builtin/Constants/passOpaque.js", "../../Source/Shaders/Builtin/Constants/passOverlay.js", "../../Source/Shaders/Builtin/Constants/passTerrainClassification.js", "../../Source/Shaders/Builtin/Constants/passTranslucent.js", "../../Source/Shaders/Builtin/Constants/pi.js", "../../Source/Shaders/Builtin/Constants/piOverFour.js", "../../Source/Shaders/Builtin/Constants/piOverSix.js", "../../Source/Shaders/Builtin/Constants/piOverThree.js", "../../Source/Shaders/Builtin/Constants/piOverTwo.js", "../../Source/Shaders/Builtin/Constants/radiansPerDegree.js", "../../Source/Shaders/Builtin/Constants/sceneMode2D.js", "../../Source/Shaders/Builtin/Constants/sceneMode3D.js", "../../Source/Shaders/Builtin/Constants/sceneModeColumbusView.js", "../../Source/Shaders/Builtin/Constants/sceneModeMorphing.js", "../../Source/Shaders/Builtin/Constants/solarRadius.js", "../../Source/Shaders/Builtin/Constants/threePiOver2.js", "../../Source/Shaders/Builtin/Constants/twoPi.js", "../../Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js", "../../Source/Shaders/Builtin/Structs/depthRangeStruct.js", "../../Source/Shaders/Builtin/Structs/material.js", "../../Source/Shaders/Builtin/Structs/materialInput.js", "../../Source/Shaders/Builtin/Structs/modelMaterial.js", "../../Source/Shaders/Builtin/Structs/modelVertexOutput.js", "../../Source/Shaders/Builtin/Structs/pbrParameters.js", "../../Source/Shaders/Builtin/Structs/ray.js", "../../Source/Shaders/Builtin/Structs/raySegment.js", "../../Source/Shaders/Builtin/Structs/shadowParameters.js", "../../Source/Shaders/Builtin/Functions/acesTonemapping.js", "../../Source/Shaders/Builtin/Functions/alphaWeight.js", "../../Source/Shaders/Builtin/Functions/antialias.js", "../../Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js", "../../Source/Shaders/Builtin/Functions/backFacing.js", "../../Source/Shaders/Builtin/Functions/branchFreeTernary.js", "../../Source/Shaders/Builtin/Functions/cascadeColor.js", "../../Source/Shaders/Builtin/Functions/cascadeDistance.js", "../../Source/Shaders/Builtin/Functions/cascadeMatrix.js", "../../Source/Shaders/Builtin/Functions/cascadeWeights.js", "../../Source/Shaders/Builtin/Functions/columbusViewMorph.js", "../../Source/Shaders/Builtin/Functions/computePosition.js", "../../Source/Shaders/Builtin/Functions/cosineAndSine.js", "../../Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js", "../../Source/Shaders/Builtin/Functions/defaultPbrMaterial.js", "../../Source/Shaders/Builtin/Functions/depthClamp.js", "../../Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js", "../../Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js", "../../Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js", "../../Source/Shaders/Builtin/Functions/equalsEpsilon.js", "../../Source/Shaders/Builtin/Functions/eyeOffset.js", "../../Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js", "../../Source/Shaders/Builtin/Functions/fastApproximateAtan.js", "../../Source/Shaders/Builtin/Functions/fog.js", "../../Source/Shaders/Builtin/Functions/gammaCorrect.js", "../../Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js", "../../Source/Shaders/Builtin/Functions/getDefaultMaterial.js", "../../Source/Shaders/Builtin/Functions/getLambertDiffuse.js", "../../Source/Shaders/Builtin/Functions/getSpecular.js", "../../Source/Shaders/Builtin/Functions/getWaterNoise.js", "../../Source/Shaders/Builtin/Functions/HSBToRGB.js", "../../Source/Shaders/Builtin/Functions/HSLToRGB.js", "../../Source/Shaders/Builtin/Functions/hue.js", "../../Source/Shaders/Builtin/Functions/inverseGamma.js", "../../Source/Shaders/Builtin/Functions/isEmpty.js", "../../Source/Shaders/Builtin/Functions/isFull.js", "../../Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js", "../../Source/Shaders/Builtin/Functions/linearToSrgb.js", "../../Source/Shaders/Builtin/Functions/lineDistance.js", "../../Source/Shaders/Builtin/Functions/luminance.js", "../../Source/Shaders/Builtin/Functions/metersPerPixel.js", "../../Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js", "../../Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js", "../../Source/Shaders/Builtin/Functions/nearFarScalar.js", "../../Source/Shaders/Builtin/Functions/octDecode.js", "../../Source/Shaders/Builtin/Functions/packDepth.js", "../../Source/Shaders/Builtin/Functions/pbrLighting.js", "../../Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js", "../../Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js", "../../Source/Shaders/Builtin/Functions/phong.js", "../../Source/Shaders/Builtin/Functions/planeDistance.js", "../../Source/Shaders/Builtin/Functions/pointAlongRay.js", "../../Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js", "../../Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js", "../../Source/Shaders/Builtin/Functions/readDepth.js", "../../Source/Shaders/Builtin/Functions/readNonPerspective.js", "../../Source/Shaders/Builtin/Functions/reverseLogDepth.js", "../../Source/Shaders/Builtin/Functions/RGBToHSB.js", "../../Source/Shaders/Builtin/Functions/RGBToHSL.js", "../../Source/Shaders/Builtin/Functions/RGBToXYZ.js", "../../Source/Shaders/Builtin/Functions/round.js", "../../Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js", "../../Source/Shaders/Builtin/Functions/saturation.js", "../../Source/Shaders/Builtin/Functions/shadowDepthCompare.js", "../../Source/Shaders/Builtin/Functions/shadowVisibility.js", "../../Source/Shaders/Builtin/Functions/signNotZero.js", "../../Source/Shaders/Builtin/Functions/sphericalHarmonics.js", "../../Source/Shaders/Builtin/Functions/srgbToLinear.js", "../../Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js", "../../Source/Shaders/Builtin/Functions/transformPlane.js", "../../Source/Shaders/Builtin/Functions/translateRelativeToEye.js", "../../Source/Shaders/Builtin/Functions/translucentPhong.js", "../../Source/Shaders/Builtin/Functions/transpose.js", "../../Source/Shaders/Builtin/Functions/unpackDepth.js", "../../Source/Shaders/Builtin/Functions/unpackFloat.js", "../../Source/Shaders/Builtin/Functions/unpackUint.js", "../../Source/Shaders/Builtin/Functions/valueTransform.js", "../../Source/Shaders/Builtin/Functions/vertexLogDepth.js", "../../Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js", "../../Source/Shaders/Builtin/Functions/writeDepthClamp.js", "../../Source/Shaders/Builtin/Functions/writeLogDepth.js", "../../Source/Shaders/Builtin/Functions/writeNonPerspective.js", "../../Source/Shaders/Builtin/Functions/XYZToRGB.js", "../../Source/Shaders/Builtin/CzmBuiltins.js", "../../Source/Renderer/ShaderSource.js", "../../Source/Shaders/ShadowVolumeAppearanceVS.js", "../../Source/Shaders/ShadowVolumeFS.js", "../../Source/Scene/ClassificationType.js", "../../Source/Scene/DepthFunction.js", "../../Source/Core/EncodedCartesian3.js", "../../Source/Core/subdivideArray.js", "../../Source/Renderer/BufferUsage.js", "../../Source/Core/IndexDatatype.js", "../../Source/Renderer/Buffer.js", "../../Source/Renderer/VertexArray.js", "../../Source/Scene/BatchTable.js", "../../Source/Scene/AttributeType.js", "../../Source/Core/AttributeCompression.js", "../../Source/Core/barycentricCoordinates.js", "../../Source/Core/Tipsify.js", "../../Source/Core/GeometryPipeline.js", "../../Source/Core/WebMercatorProjection.js", "../../Source/Scene/PrimitivePipeline.js", "../../Source/Scene/PrimitiveState.js", "../../Source/Scene/SceneMode.js", "../../Source/Scene/ShadowMode.js", "../../Source/Scene/Primitive.js", "../../Source/Core/GeometryInstanceAttribute.js", "../../Source/Shaders/ShadowVolumeAppearanceFS.js", "../../Source/Scene/ShadowVolumeAppearance.js", "../../Source/Scene/StencilFunction.js", "../../Source/Scene/StencilOperation.js", "../../Source/Scene/StencilConstants.js", "../../Source/Scene/ClassificationPrimitive.js", "../../Source/Scene/GroundPrimitive.js", "../../Source/DataSources/MaterialProperty.js", "../../Source/DataSources/DynamicGeometryUpdater.js", "../../Source/Core/oneTimeWarning.js", "../../Source/Core/ArcType.js", "../../Source/Core/arrayRemoveDuplicates.js", "../../Source/Core/EllipsoidGeodesic.js", "../../Source/Core/EllipsoidRhumbLine.js", "../../Source/Core/GroundPolylineGeometry.js", "../../Source/Shaders/PolylineShadowVolumeFS.js", "../../Source/Shaders/PolylineShadowVolumeMorphFS.js", "../../Source/Shaders/PolylineShadowVolumeMorphVS.js", "../../Source/Shaders/PolylineShadowVolumeVS.js", "../../Source/Shaders/Appearances/PolylineColorAppearanceVS.js", "../../Source/Shaders/PolylineCommon.js", "../../Source/Scene/PolylineColorAppearance.js", "../../Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js", "../../Source/Shaders/PolylineFS.js", "../../Source/Scene/PolylineMaterialAppearance.js", "../../Source/Scene/GroundPolylinePrimitive.js", "../../Source/DataSources/ImageMaterialProperty.js", "../../Source/DataSources/createMaterialPropertyDescriptor.js", "../../Source/DataSources/BoxGraphics.js", "../../Source/Core/ReferenceFrame.js", "../../Source/DataSources/PositionProperty.js", "../../Source/DataSources/ConstantPositionProperty.js", "../../Source/DataSources/CorridorGraphics.js", "../../Source/DataSources/createRawPropertyDescriptor.js", "../../Source/DataSources/CylinderGraphics.js", "../../Source/DataSources/EllipseGraphics.js", "../../Source/DataSources/EllipsoidGraphics.js", "../../Source/DataSources/LabelGraphics.js", "../../Source/Core/TranslationRotationScale.js", "../../Source/DataSources/NodeTransformationProperty.js", "../../Source/DataSources/PropertyBag.js", "../../Source/DataSources/ModelGraphics.js", "../../Source/DataSources/Cesium3DTilesetGraphics.js", "../../Source/DataSources/PathGraphics.js", "../../Source/DataSources/PlaneGraphics.js", "../../Source/DataSources/PointGraphics.js", "../../Source/Core/PolygonHierarchy.js", "../../Source/DataSources/PolygonGraphics.js", "../../Source/DataSources/PolylineGraphics.js", "../../Source/DataSources/PolylineVolumeGraphics.js", "../../Source/DataSources/RectangleGraphics.js", "../../Source/DataSources/WallGraphics.js", "../../Source/DataSources/Entity.js", "../../Source/DataSources/GeometryUpdater.js", "../../Source/DataSources/CallbackProperty.js", "../../Source/DataSources/TerrainOffsetProperty.js", "../../Source/DataSources/heightReferenceOnEntityPropertyChanged.js", "../../Source/DataSources/BoxGeometryUpdater.js", "../../Source/Core/Credit.js", "../../Source/Core/deprecationWarning.js", "../../Source/Renderer/ComputeCommand.js", "../../Source/Shaders/OctahedralProjectionAtlasFS.js", "../../Source/Shaders/OctahedralProjectionFS.js", "../../Source/Shaders/OctahedralProjectionVS.js", "../../Source/Scene/OctahedralProjectedCubeMap.js", "../../Source/Scene/ImageBasedLighting.js", "../../Source/Core/ManagedArray.js", "../../Source/Renderer/ClearCommand.js", "../../Source/Scene/Axis.js", "../../Source/Core/CullingVolume.js", "../../Source/Core/OrthographicOffCenterFrustum.js", "../../Source/Core/OrthographicFrustum.js", "../../Source/Scene/Cesium3DContentGroup.js", "../../Source/Core/getStringFromTypedArray.js", "../../Source/Core/getMagic.js", "../../Source/Scene/Composite3DTileContent.js", "../../Source/Core/getJsonFromTypedArray.js", "../../Source/Scene/BatchTexture.js", "../../Source/Scene/getBinaryAccessor.js", "../../Source/Scene/BatchTableHierarchy.js", "../../Source/Scene/Cesium3DTileColorBlendMode.js", "../../Source/Scene/Cesium3DTileBatchTable.js", "../../Source/Scene/Vector3DTileBatch.js", "../../Source/Shaders/VectorTileVS.js", "../../Source/Scene/Cesium3DTileFeature.js", "../../Source/Scene/Expression.js", "../../Source/Scene/ExpressionNodeType.js", "../../Source/Scene/Vector3DTilePrimitive.js", "../../Source/Scene/Vector3DTileGeometry.js", "../../Source/Scene/Geometry3DTileContent.js", "../../Source/Core/HilbertOrder.js", "../../Source/Core/S2Cell.js", "../../Source/Scene/hasExtension.js", "../../Source/Scene/ImplicitAvailabilityBitstream.js", "../../Source/Scene/ImplicitMetadataView.js", "../../Source/Scene/ImplicitSubdivisionScheme.js", "../../Source/Scene/MetadataEntity.js", "../../Source/Scene/ImplicitSubtreeMetadata.js", "../../Source/Scene/MetadataComponentType.js", "../../Source/Scene/MetadataType.js", "../../Source/Scene/MetadataClassProperty.js", "../../Source/Scene/MetadataTableProperty.js", "../../Source/Scene/MetadataTable.js", "../../Source/Scene/ResourceLoader.js", "../../Source/Scene/ResourceLoaderState.js", "../../Source/Scene/BufferLoader.js", "../../node_modules/.store/meshoptimizer@0.18.1/node_modules/meshoptimizer/meshopt_encoder.module.js", "../../node_modules/.store/meshoptimizer@0.18.1/node_modules/meshoptimizer/meshopt_decoder.module.js", "../../node_modules/.store/meshoptimizer@0.18.1/node_modules/meshoptimizer/meshopt_simplifier.module.js", "../../Source/Scene/GltfBufferViewLoader.js", "../../Source/Scene/DracoLoader.js", "../../Source/Scene/GltfDracoLoader.js", "../../Source/Core/loadImageFromTypedArray.js", "../../Source/Scene/GltfImageLoader.js", "../../Source/Scene/JobType.js", "../../Source/Scene/GltfIndexBufferLoader.js", "../../Source/Scene/GltfPipeline/addToArray.js", "../../Source/Scene/GltfPipeline/usesExtension.js", "../../Source/Scene/GltfPipeline/ForEach.js", "../../Source/Scene/GltfPipeline/numberOfComponentsForType.js", "../../Source/Scene/GltfPipeline/getAccessorByteStride.js", "../../Source/Scene/GltfPipeline/addDefaults.js", "../../Source/Scene/GltfPipeline/addPipelineExtras.js", "../../Source/Scene/GltfPipeline/removeExtensionsRequired.js", "../../Source/Scene/GltfPipeline/removeExtensionsUsed.js", "../../Source/Scene/GltfPipeline/parseGlb.js", "../../Source/Scene/GltfPipeline/removePipelineExtras.js", "../../Source/Scene/GltfPipeline/addExtensionsUsed.js", "../../Source/Scene/GltfPipeline/getComponentReader.js", "../../Source/Scene/GltfPipeline/findAccessorMinMax.js", "../../Source/Scene/GltfPipeline/moveTechniqueRenderStates.js", "../../Source/Scene/GltfPipeline/addExtensionsRequired.js", "../../Source/Scene/GltfPipeline/moveTechniquesToExtension.js", "../../Source/Scene/GltfPipeline/forEachTextureInMaterial.js", "../../Source/Scene/GltfPipeline/removeUnusedElements.js", "../../Source/Scene/GltfPipeline/addBuffer.js", "../../Source/Scene/GltfPipeline/readAccessorPacked.js", "../../Source/Scene/GltfPipeline/updateAccessorComponentTypes.js", "../../Source/Scene/GltfPipeline/removeExtension.js", "../../Source/Scene/GltfPipeline/updateVersion.js", "../../Source/Scene/GltfJsonLoader.js", "../../Source/Scene/AlphaMode.js", "../../Source/Scene/ModelComponents.js", "../../Source/Scene/GltfLoaderUtil.js", "../../Source/Core/resizeImageToNextPowerOfTwo.js", "../../Source/Scene/GltfTextureLoader.js", "../../Source/Scene/GltfVertexBufferLoader.js", "../../Source/Scene/MetadataClass.js", "../../Source/Scene/MetadataEnumValue.js", "../../Source/Scene/MetadataEnum.js", "../../Source/Scene/MetadataSchema.js", "../../Source/Scene/MetadataSchemaLoader.js", "../../Source/Scene/ResourceCacheKey.js", "../../Source/Scene/ResourceCacheStatistics.js", "../../Source/Scene/ResourceCache.js", "../../Source/Scene/ImplicitSubtree.js", "../../Source/Scene/MetadataSemantic.js", "../../Source/Scene/parseBoundingVolumeSemantics.js", "../../Source/Scene/Implicit3DTileContent.js", "../../Source/Scene/ModelAnimationLoop.js", "../../Source/Scene/ClippingPlane.js", "../../Source/Scene/ClippingPlaneCollection.js", "../../Source/Scene/ColorBlendMode.js", "../../Source/Core/ArticulationStageType.js", "../../Source/Core/InterpolationType.js", "../../Source/Scene/JsonMetadataTable.js", "../../Source/Scene/PropertyTable.js", "../../Source/Scene/PropertyTextureProperty.js", "../../Source/Scene/PropertyTexture.js", "../../Source/Scene/PropertyAttributeProperty.js", "../../Source/Scene/PropertyAttribute.js", "../../Source/Scene/StructuralMetadata.js", "../../Source/Scene/parseStructuralMetadata.js", "../../Source/Scene/parseFeatureMetadataLegacy.js", "../../Source/Scene/GltfStructuralMetadataLoader.js", "../../Source/Scene/VertexAttributeSemantic.js", "../../Source/Scene/Model/ModelUtility.js", "../../Source/Scene/InstanceAttributeSemantic.js", "../../Source/Scene/Model/PrimitiveOutlineGenerator.js", "../../Source/Scene/PrimitiveLoadPlan.js", "../../Source/Scene/SupportedImageFormats.js", "../../Source/Scene/GltfLoader.js", "../../Source/Renderer/Framebuffer.js", "../../Source/Renderer/MultisampleFramebuffer.js", "../../Source/Renderer/RenderbufferFormat.js", "../../Source/Renderer/Renderbuffer.js", "../../Source/Renderer/FramebufferManager.js", "../../Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js", "../../Source/Scene/PointCloudEyeDomeLighting.js", "../../Source/Scene/PointCloudShading.js", "../../Source/Scene/SceneTransforms.js", "../../Source/Scene/SplitDirection.js", "../../Source/Scene/B3dmParser.js", "../../Source/Scene/Cesium3DTileFeatureTable.js", "../../Source/Scene/parseBatchTable.js", "../../Source/Scene/Model/B3dmLoader.js", "../../Source/Scene/Model/GeoJsonLoader.js", "../../Source/Scene/I3dmParser.js", "../../Source/Scene/Model/I3dmLoader.js", "../../Source/Scene/ModelAnimationState.js", "../../Source/Core/Spline.js", "../../Source/Core/ConstantSpline.js", "../../Source/Core/LinearSpline.js", "../../Source/Core/TridiagonalSystemSolver.js", "../../Source/Core/HermiteSpline.js", "../../Source/Core/SteppedSpline.js", "../../Source/Core/QuaternionSpline.js", "../../Source/Scene/Model/ModelAnimationChannel.js", "../../Source/Scene/Model/ModelAnimation.js", "../../Source/Scene/Model/ModelAnimationCollection.js", "../../Source/Scene/Model/ModelFeature.js", "../../Source/Scene/Model/StyleCommandsNeeded.js", "../../Source/Scene/Model/ModelType.js", "../../Source/Scene/Model/ModelFeatureTable.js", "../../Source/Shaders/Model/ModelFS.js", "../../Source/Shaders/Model/ModelVS.js", "../../Source/Scene/Model/ClassificationModelDrawCommand.js", "../../Source/Scene/Model/ModelDrawCommand.js", "../../Source/Scene/Model/buildDrawCommand.js", "../../Source/Renderer/ShaderDestination.js", "../../Source/Scene/Model/TilesetPipelineStage.js", "../../Source/Shaders/Model/ImageBasedLightingStageFS.js", "../../Source/Scene/Model/ImageBasedLightingPipelineStage.js", "../../Source/Scene/Model/ModelArticulationStage.js", "../../Source/Scene/Model/ModelArticulation.js", "../../Source/Shaders/Model/ModelColorStageFS.js", "../../Source/Scene/Model/ModelColorPipelineStage.js", "../../Source/Shaders/Model/ModelClippingPlanesStageFS.js", "../../Source/Scene/Model/ModelClippingPlanesPipelineStage.js", "../../Source/Scene/Model/ModelNode.js", "../../Source/Shaders/Model/InstancingStageCommon.js", "../../Source/Shaders/Model/InstancingStageVS.js", "../../Source/Shaders/Model/LegacyInstancingStageVS.js", "../../Source/Scene/Model/InstancingPipelineStage.js", "../../Source/Scene/Model/ModelMatrixUpdateStage.js", "../../Source/Scene/Model/NodeStatisticsPipelineStage.js", "../../Source/Scene/Model/ModelRuntimeNode.js", "../../Source/Scene/Model/AlphaPipelineStage.js", "../../Source/Scene/Model/BatchTexturePipelineStage.js", "../../Source/Scene/Model/ClassificationPipelineStage.js", "../../Source/Shaders/Model/CPUStylingStageVS.js", "../../Source/Shaders/Model/CPUStylingStageFS.js", "../../Source/Scene/Model/CPUStylingPipelineStage.js", "../../Source/Scene/Model/CustomShaderMode.js", "../../Source/Shaders/Model/CustomShaderStageVS.js", "../../Source/Shaders/Model/CustomShaderStageFS.js", "../../Source/Shaders/Model/FeatureIdStageFS.js", "../../Source/Shaders/Model/FeatureIdStageVS.js", "../../Source/Scene/Model/FeatureIdPipelineStage.js", "../../Source/Shaders/Model/MetadataStageFS.js", "../../Source/Shaders/Model/MetadataStageVS.js", "../../Source/Scene/Model/MetadataPipelineStage.js", "../../Source/Scene/Model/CustomShaderTranslucencyMode.js", "../../Source/Scene/Model/CustomShaderPipelineStage.js", "../../Source/Scene/Model/DequantizationPipelineStage.js", "../../Source/Shaders/Model/GeometryStageFS.js", "../../Source/Shaders/Model/GeometryStageVS.js", "../../Source/Shaders/Model/SelectedFeatureIdStageCommon.js", "../../Source/Scene/Model/SelectedFeatureIdPipelineStage.js", "../../Source/Scene/Model/GeometryPipelineStage.js", "../../Source/Shaders/Model/LightingStageFS.js", "../../Source/Scene/Model/LightingModel.js", "../../Source/Scene/Model/LightingPipelineStage.js", "../../Source/Shaders/Model/MaterialStageFS.js", "../../Source/Scene/Model/MaterialPipelineStage.js", "../../Source/Shaders/Model/MorphTargetsStageVS.js", "../../Source/Scene/Model/MorphTargetsPipelineStage.js", "../../Source/Scene/Model/PickingPipelineStage.js", "../../Source/Scene/Cesium3DTileRefine.js", "../../Source/Shaders/Model/PointCloudStylingStageVS.js", "../../Source/Scene/Model/PointCloudStylingPipelineStage.js", "../../Source/Shaders/Model/PrimitiveOutlineStageVS.js", "../../Source/Shaders/Model/PrimitiveOutlineStageFS.js", "../../Source/Scene/Model/PrimitiveOutlinePipelineStage.js", "../../Source/Scene/Model/PrimitiveStatisticsPipelineStage.js", "../../Source/Scene/Model/SceneMode2DPipelineStage.js", "../../Source/Shaders/Model/SkinningStageVS.js", "../../Source/Scene/Model/SkinningPipelineStage.js", "../../Source/Core/WireframeIndexGenerator.js", "../../Source/Scene/Model/WireframePipelineStage.js", "../../Source/Scene/Model/ModelRuntimePrimitive.js", "../../Source/Scene/Model/ModelSkin.js", "../../Source/Scene/Model/ModelAlphaOptions.js", "../../Source/Renderer/ShaderStruct.js", "../../Source/Renderer/ShaderFunction.js", "../../Source/Renderer/ShaderBuilder.js", "../../Source/Scene/Model/ModelRenderResources.js", "../../Source/Shaders/Model/ModelSilhouetteStageFS.js", "../../Source/Shaders/Model/ModelSilhouetteStageVS.js", "../../Source/Scene/Model/ModelSilhouettePipelineStage.js", "../../Source/Shaders/Model/ModelSplitterStageFS.js", "../../Source/Scene/Model/ModelSplitterPipelineStage.js", "../../Source/Scene/Model/NodeRenderResources.js", "../../Source/Scene/Model/ModelLightingOptions.js", "../../Source/Scene/Model/PrimitiveRenderResources.js", "../../Source/Scene/Model/ModelSceneGraph.js", "../../Source/Scene/Model/ModelStatistics.js", "../../Source/Scene/Model/PntsLoader.js", "../../Source/Scene/PntsParser.js", "../../Source/Scene/Model/Model.js", "../../Source/Scene/Model/Model3DTileContent.js", "../../Source/Scene/Tileset3DTileContent.js", "../../Source/Renderer/VertexArrayFacade.js", "../../Source/Shaders/BillboardCollectionFS.js", "../../Source/Shaders/BillboardCollectionVS.js", "../../Source/Scene/Billboard.js", "../../Source/Scene/BlendOption.js", "../../Source/Scene/SDFSettings.js", "../../Source/Scene/TextureAtlas.js", "../../Source/Scene/BillboardCollection.js", "../../Source/Scene/createBillboardPointCallback.js", "../../Source/Scene/Cesium3DTilePointFeature.js", "../../Source/Core/writeTextToCanvas.js", "../../Source/Scene/LabelCollection.js", "../../Source/Scene/LabelStyle.js", "../../Source/Scene/Label.js", "../../Source/Shaders/PolylineVS.js", "../../Source/Core/PolylinePipeline.js", "../../Source/Scene/Polyline.js", "../../Source/Scene/PolylineCollection.js", "../../Source/Scene/Vector3DTilePoints.js", "../../Source/Scene/Vector3DTilePolygons.js", "../../Source/Shaders/Vector3DTilePolylinesVS.js", "../../Source/Scene/Vector3DTilePolylines.js", "../../Source/Shaders/Vector3DTileClampedPolylinesVS.js", "../../Source/Shaders/Vector3DTileClampedPolylinesFS.js", "../../Source/Scene/Vector3DTileClampedPolylines.js", "../../Source/Core/decodeVectorPolylinePositions.js", "../../Source/Scene/Vector3DTileContent.js", "../../Source/Scene/Cesium3DTileContentFactory.js", "../../Source/Scene/Cesium3DTileContentState.js", "../../Source/Scene/Cesium3DTileContentType.js", "../../Source/Scene/Cesium3DTileOptimizationHint.js", "../../Source/Scene/Cesium3DTilesetMostDetailedTraversal.js", "../../Source/Scene/Cesium3DTilesetTraversal.js", "../../Source/Scene/Cesium3DTilePass.js", "../../Source/Scene/Empty3DTileContent.js", "../../Source/Scene/ContentMetadata.js", "../../Source/Scene/findContentMetadata.js", "../../Source/Scene/findGroupMetadata.js", "../../Source/Scene/TileMetadata.js", "../../Source/Scene/findTileMetadata.js", "../../Source/Scene/preprocess3DTileContent.js", "../../Source/Scene/Multiple3DTileContent.js", "../../Source/Core/PolygonPipeline.js", "../../Source/Core/RectangleGeometryLibrary.js", "../../Source/Core/RectangleOutlineGeometry.js", "../../Source/Scene/TileBoundingRegion.js", "../../Source/Core/CoplanarPolygonGeometryLibrary.js", "../../Source/Core/Queue.js", "../../Source/Core/PolygonGeometryLibrary.js", "../../Source/Core/CoplanarPolygonOutlineGeometry.js", "../../Source/Scene/TileBoundingS2Cell.js", "../../Source/Core/EllipsoidOutlineGeometry.js", "../../Source/Core/SphereOutlineGeometry.js", "../../Source/Scene/TileBoundingSphere.js", "../../Source/Scene/TileOrientedBoundingBox.js", "../../Source/Scene/Cesium3DTile.js", "../../Source/Scene/GroupMetadata.js", "../../Source/Scene/TilesetMetadata.js", "../../Source/Scene/Cesium3DTilesetMetadata.js", "../../Source/Scene/Cesium3DTileOptimizations.js", "../../Source/Core/DoublyLinkedList.js", "../../Source/Scene/Cesium3DTilesetCache.js", "../../Source/Scene/Cesium3DTilesetHeatmap.js", "../../Source/Scene/Cesium3DTilesetStatistics.js", "../../Source/Scene/Cesium3DTileStyleEngine.js", "../../Source/Scene/ImplicitTileset.js", "../../Source/Core/MortonOrder.js", "../../Source/Scene/ImplicitTileCoordinates.js", "../../Source/Scene/Cesium3DTileset.js", "../../Source/DataSources/Cesium3DTilesetVisualizer.js", "../../Source/DataSources/CheckerboardMaterialProperty.js", "../../Source/DataSources/EntityCollection.js", "../../Source/DataSources/CompositeEntityCollection.js", "../../Source/Core/EventHelper.js", "../../Source/Core/TimeIntervalCollection.js", "../../Source/DataSources/CompositeProperty.js", "../../Source/DataSources/CompositeMaterialProperty.js", "../../Source/DataSources/CompositePositionProperty.js", "../../Source/Core/CornerType.js", "../../Source/Core/PolylineVolumeGeometryLibrary.js", "../../Source/Core/CorridorGeometryLibrary.js", "../../Source/Core/CorridorGeometry.js", "../../Source/Core/CorridorOutlineGeometry.js", "../../Source/DataSources/GroundGeometryUpdater.js", "../../Source/DataSources/CorridorGeometryUpdater.js", "../../Source/DataSources/DataSource.js", "../../Source/Core/EllipsoidalOccluder.js", "../../Source/Scene/PointPrimitive.js", "../../Source/Shaders/PointPrimitiveCollectionFS.js", "../../Source/Shaders/PointPrimitiveCollectionVS.js", "../../Source/Scene/PointPrimitiveCollection.js", "../../node_modules/.store/kdbush@3.0.0/node_modules/kdbush/src/sort.js", "../../node_modules/.store/kdbush@3.0.0/node_modules/kdbush/src/range.js", "../../node_modules/.store/kdbush@3.0.0/node_modules/kdbush/src/within.js", "../../node_modules/.store/kdbush@3.0.0/node_modules/kdbush/src/index.js", "../../Source/DataSources/EntityCluster.js", "../../Source/DataSources/CustomDataSource.js", "../../Source/Core/CylinderGeometryLibrary.js", "../../Source/Core/CylinderGeometry.js", "../../Source/Core/CylinderOutlineGeometry.js", "../../Source/DataSources/CylinderGeometryUpdater.js", "../../Source/Core/ClockRange.js", "../../Source/Core/ClockStep.js", "../../Source/Core/ExtrapolationType.js", "../../Source/Core/getFilenameFromUri.js", "../../Source/Core/HermitePolynomialApproximation.js", "../../Source/Core/LagrangePolynomialApproximation.js", "../../Source/Core/LinearApproximation.js", "../../Source/Core/Spherical.js", "../../Source/DataSources/CzmlDataSource.js", "../../Source/Core/getTimestamp.js", "../../Source/Core/Clock.js", "../../Source/DataSources/DataSourceClock.js", "../../Source/DataSources/GridMaterialProperty.js", "../../Source/DataSources/PolylineArrowMaterialProperty.js", "../../Source/DataSources/PolylineDashMaterialProperty.js", "../../Source/DataSources/PolylineGlowMaterialProperty.js", "../../Source/DataSources/PolylineOutlineMaterialProperty.js", "../../Source/DataSources/PositionPropertyArray.js", "../../Source/DataSources/PropertyArray.js", "../../Source/DataSources/ReferenceProperty.js", "../../Source/DataSources/Rotation.js", "../../Source/DataSources/SampledProperty.js", "../../Source/DataSources/SampledPositionProperty.js", "../../Source/DataSources/StripeOrientation.js", "../../Source/DataSources/StripeMaterialProperty.js", "../../Source/DataSources/TimeIntervalCollectionPositionProperty.js", "../../Source/DataSources/TimeIntervalCollectionProperty.js", "../../Source/DataSources/VelocityVectorProperty.js", "../../Source/DataSources/VelocityOrientationProperty.js", "../../Source/DataSources/DataSourceCollection.js", "../../Source/Scene/PrimitiveCollection.js", "../../Source/Scene/OrderedGroundPrimitiveCollection.js", "../../Source/DataSources/DynamicGeometryBatch.js", "../../Source/Core/EllipseGeometryLibrary.js", "../../Source/Core/EllipseGeometry.js", "../../Source/Core/EllipseOutlineGeometry.js", "../../Source/DataSources/EllipseGeometryUpdater.js", "../../Source/Core/EllipsoidGeometry.js", "../../Source/DataSources/EllipsoidGeometryUpdater.js", "../../Source/Core/PlaneGeometry.js", "../../Source/Core/PlaneOutlineGeometry.js", "../../Source/DataSources/PlaneGeometryUpdater.js", "../../Source/Core/CoplanarPolygonGeometry.js", "../../Source/Core/PolygonGeometry.js", "../../Source/Core/PolygonOutlineGeometry.js", "../../Source/DataSources/PolygonGeometryUpdater.js", "../../Source/Core/PolylineVolumeGeometry.js", "../../Source/Core/PolylineVolumeOutlineGeometry.js", "../../Source/DataSources/PolylineVolumeGeometryUpdater.js", "../../Source/Core/RectangleGeometry.js", "../../Source/DataSources/RectangleGeometryUpdater.js", "../../Source/DataSources/StaticGeometryColorBatch.js", "../../Source/DataSources/StaticGeometryPerMaterialBatch.js", "../../Source/Core/RectangleCollisionChecker.js", "../../Source/DataSources/StaticGroundGeometryColorBatch.js", "../../Source/DataSources/StaticGroundGeometryPerMaterialBatch.js", "../../Source/DataSources/StaticOutlineGeometryBatch.js", "../../Source/Core/WallGeometryLibrary.js", "../../Source/Core/WallGeometry.js", "../../Source/Core/WallOutlineGeometry.js", "../../Source/DataSources/WallGeometryUpdater.js", "../../Source/DataSources/GeometryVisualizer.js", "../../Source/DataSources/LabelVisualizer.js", "../../Source/Core/sampleTerrain.js", "../../Source/Core/sampleTerrainMostDetailed.js", "../../Source/DataSources/ModelVisualizer.js", "../../Source/DataSources/ScaledPositionProperty.js", "../../Source/DataSources/PathVisualizer.js", "../../Source/DataSources/PointVisualizer.js", "../../Source/Core/PolylineGeometry.js", "../../Source/DataSources/PolylineGeometryUpdater.js", "../../Source/DataSources/StaticGroundPolylinePerMaterialBatch.js", "../../Source/DataSources/PolylineVisualizer.js", "../../Source/DataSources/DataSourceDisplay.js", "../../Source/Core/HeadingPitchRange.js", "../../Source/DataSources/EntityView.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/deflate.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/inflate.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/configuration.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/crc32.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/util/encode-text.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/sjcl.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/aes-crypto.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/zip-crypto.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/codec.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool-worker.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/engine.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/io.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/constants.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/util/cp437-decode.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/util/decode-text.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/zip-entry.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/zip-reader.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/core/zip-writer.js", "../../node_modules/.store/@zip.js+zip.js@2.4.26/node_modules/@zip.js/zip.js/lib/zip-no-worker.js", "../../Source/DataSources/exportKml.js", "../../Source/Core/PinBuilder.js", "../../node_modules/.store/topojson-client@3.1.0/node_modules/topojson-client/src/identity.js", "../../node_modules/.store/topojson-client@3.1.0/node_modules/topojson-client/src/transform.js", "../../node_modules/.store/topojson-client@3.1.0/node_modules/topojson-client/src/reverse.js", "../../node_modules/.store/topojson-client@3.1.0/node_modules/topojson-client/src/feature.js", "../../Source/DataSources/GeoJsonDataSource.js", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/version.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/utils.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/html-tag.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/truncate/truncate-smart.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/truncate/truncate-middle.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/truncate/truncate-end.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/anchor-tag-builder.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/match.ts", "../../node_modules/.store/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/email-match.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/hashtag-match.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/mention-match.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/phone-match.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/match/url-match.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/regex-lib.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/tld-regex.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/email-matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/url-match-validator.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/url-matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/hashtag-matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/phone-matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/matcher/mention-matcher.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/htmlParser/parse-html.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/autolinker.ts", "../../node_modules/.store/autolinker@3.16.2/node_modules/autolinker/src/index.ts", "../../Source/DataSources/GpxDataSource.js", "../../Source/DataSources/KmlCamera.js", "../../Source/DataSources/KmlDataSource.js", "../../Source/Widgets/getElement.js", "../../Source/DataSources/KmlLookAt.js", "../../Source/DataSources/KmlTour.js", "../../node_modules/.store/@tweenjs+tween.js@18.6.4/node_modules/@tweenjs/tween.js/dist/tween.esm.js", "../../Source/Core/EasingFunction.js", "../../Source/DataSources/KmlTourFlyTo.js", "../../Source/DataSources/KmlTourWait.js", "../../Source/DataSources/Visualizer.js", "../../Source/Shaders/ViewportQuadVS.js", "../../Source/Renderer/ComputeEngine.js", "../../Source/Renderer/PassState.js", "../../Source/Renderer/ShaderCache.js", "../../Source/Renderer/TextureCache.js", "../../Source/Core/Simon1994PlanetaryPositions.js", "../../Source/Scene/SunLight.js", "../../Source/Renderer/UniformState.js", "../../Source/Renderer/Context.js", "../../Source/Renderer/loadCubeMap.js", "../../Source/Core/HeightmapEncoding.js", "../../Source/Core/TerrainQuantization.js", "../../Source/Core/TerrainEncoding.js", "../../Source/Core/HeightmapTessellator.js", "../../Source/Core/TerrainData.js", "../../Source/Core/TerrainMesh.js", "../../Source/Core/TerrainProvider.js", "../../Source/Core/HeightmapTerrainData.js", "../../Source/Core/TileAvailability.js", "../../Source/Core/formatError.js", "../../Source/Core/TileProviderError.js", "../../Source/Core/WebMercatorTilingScheme.js", "../../Source/Core/ArcGISTiledElevationTerrainProvider.js", "../../Source/Core/BingMapsGeocoderService.js", "../../Source/Core/cancelAnimationFrame.js", "../../Source/Core/CartographicGeocoderService.js", "../../Source/Core/CatmullRomSpline.js", "../../Source/Core/Intersections2D.js", "../../Source/Core/QuantizedMeshTerrainData.js", "../../Source/Core/CesiumTerrainProvider.js", "../../Source/Core/CircleGeometry.js", "../../Source/Core/CircleOutlineGeometry.js", "../../Source/Core/IonResource.js", "../../Source/Core/Ion.js", "../../Source/Core/createWorldTerrain.js", "../../Source/Core/CustomHeightmapTerrainProvider.js", "../../Source/Core/decodeGoogleEarthEnterpriseData.js", "../../Source/Core/DefaultProxy.js", "../../Source/Core/DoubleEndedPriorityQueue.js", "../../Source/Core/EllipsoidTerrainProvider.js", "../../Source/Core/PerspectiveOffCenterFrustum.js", "../../Source/Core/PerspectiveFrustum.js", "../../Source/Core/FrustumGeometry.js", "../../Source/Core/FrustumOutlineGeometry.js", "../../Source/Core/GeocoderService.js", "../../Source/Core/GeocodeType.js", "../../Source/Core/GeometryFactory.js", "../../Source/Core/getImageFromTypedArray.js", "../../Source/Core/GoogleEarthEnterpriseMetadata.js", "../../Source/Core/isBitSet.js", "../../Source/Core/GoogleEarthEnterpriseTileInformation.js", "../../Source/Core/GoogleEarthEnterpriseTerrainData.js", "../../Source/Core/GoogleEarthEnterpriseTerrainProvider.js", "../../Source/Core/IauOrientationParameters.js", "../../Source/Core/Iau2000Orientation.js", "../../Source/Core/IauOrientationAxes.js", "../../Source/Core/InterpolationAlgorithm.js", "../../Source/Core/PeliasGeocoderService.js", "../../Source/Core/IonGeocoderService.js", "../../Source/Core/KeyboardEventModifier.js", "../../Source/Core/MapProjection.js", "../../Source/Core/mergeSort.js", "../../Source/Core/MorphWeightSpline.js", "../../Source/Core/Visibility.js", "../../Source/Core/Occluder.js", "../../Source/Core/OpenCageGeocoderService.js", "../../Source/Core/Packable.js", "../../Source/Core/PackableForInterpolation.js", "../../Source/Core/pointInsideTriangle.js", "../../Source/Core/Proxy.js", "../../Source/Core/requestAnimationFrame.js", "../../Source/Core/ScreenSpaceEventType.js", "../../Source/Core/ScreenSpaceEventHandler.js", "../../Source/Core/SimplePolylineGeometry.js", "../../Source/Core/SphereGeometry.js", "../../Source/Core/TileEdge.js", "../../Source/Core/TilingScheme.js", "../../Source/Core/VideoSynchronizer.js", "../../Source/Core/VRTheWorldTerrainProvider.js", "../../Source/Core/VulkanConstants.js", "../../Source/Core/webGLConstantToGlslType.js", "../../Source/Core/wrapFunction.js", "../../Source/ThirdParty/knockout-3.5.1.js", "../../Source/ThirdParty/knockout-es5.js", "../../Source/Widgets/SvgPathBindingHandler.js", "../../Source/ThirdParty/knockout.js", "../../Source/Shaders/AdjustTranslucentFS.js", "../../Source/Shaders/AtmosphereCommon.js", "../../Source/Shaders/BrdfLutGeneratorFS.js", "../../Source/Shaders/CloudCollectionFS.js", "../../Source/Shaders/CloudCollectionVS.js", "../../Source/Shaders/CloudNoiseFS.js", "../../Source/Shaders/CloudNoiseVS.js", "../../Source/Shaders/CompareAndPackTranslucentDepth.js", "../../Source/Shaders/CompositeOITFS.js", "../../Source/Shaders/DepthPlaneFS.js", "../../Source/Shaders/DepthPlaneVS.js", "../../Source/Shaders/EllipsoidFS.js", "../../Source/Shaders/EllipsoidVS.js", "../../Source/Shaders/FXAA3_11.js", "../../Source/Shaders/GlobeFS.js", "../../Source/Shaders/GlobeVS.js", "../../Source/Shaders/GroundAtmosphere.js", "../../Source/Shaders/ReprojectWebMercatorFS.js", "../../Source/Shaders/ReprojectWebMercatorVS.js", "../../Source/Shaders/SkyAtmosphereCommon.js", "../../Source/Shaders/SkyAtmosphereFS.js", "../../Source/Shaders/SkyAtmosphereVS.js", "../../Source/Shaders/SkyBoxFS.js", "../../Source/Shaders/SkyBoxVS.js", "../../Source/Shaders/SunFS.js", "../../Source/Shaders/SunTextureFS.js", "../../Source/Shaders/SunVS.js", "../../Source/Shaders/ViewportQuadFS.js", "../../Source/Widgets/ClockViewModel.js", "../../Source/Widgets/Command.js", "../../Source/Widgets/createCommand.js", "../../Source/Widgets/InspectorShared.js", "../../Source/Widgets/subscribeAndEvaluate.js", "../../Source/Widgets/ToggleButtonViewModel.js", "../../Source/Scene/DiscardMissingTileImagePolicy.js", "../../Source/Scene/ImageryLayerFeatureInfo.js", "../../Source/Scene/ImageryProvider.js", "../../Source/Scene/ArcGisMapServerImageryProvider.js", "../../Source/Scene/AutoExposure.js", "../../Source/Scene/BingMapsStyle.js", "../../Source/Scene/DiscardEmptyTileImagePolicy.js", "../../Source/Scene/BingMapsImageryProvider.js", "../../Source/Scene/BoxEmitter.js", "../../Source/Scene/BrdfLutGenerator.js", "../../Source/Scene/CameraFlightPath.js", "../../Source/Scene/MapMode2D.js", "../../Source/Scene/Camera.js", "../../Source/Scene/CameraEventType.js", "../../Source/Scene/CameraEventAggregator.js", "../../Source/Scene/Cesium3DTileContent.js", "../../Source/Scene/Cesium3DTilePassState.js", "../../Source/Scene/ConditionsExpression.js", "../../Source/Scene/Cesium3DTileStyle.js", "../../Source/Scene/CircleEmitter.js", "../../Source/Scene/CloudType.js", "../../Source/Scene/CumulusCloud.js", "../../Source/Scene/CloudCollection.js", "../../Source/Scene/computeFlyToLocationForRectangle.js", "../../Source/Scene/ConeEmitter.js", "../../Source/Scene/createElevationBandMaterial.js", "../../Source/Scene/createOsmBuildings.js", "../../Source/Scene/createTangentSpaceDebugPrimitive.js", "../../Source/Scene/UrlTemplateImageryProvider.js", "../../Source/Scene/TileMapServiceImageryProvider.js", "../../Source/Scene/GoogleEarthEnterpriseMapsProvider.js", "../../Source/Scene/MapboxImageryProvider.js", "../../Source/Scene/SingleTileImageryProvider.js", "../../Source/Scene/GetFeatureInfoFormat.js", "../../Source/Scene/TimeDynamicImagery.js", "../../Source/Scene/WebMapServiceImageryProvider.js", "../../Source/Scene/WebMapTileServiceImageryProvider.js", "../../Source/Scene/IonImageryProvider.js", "../../Source/Scene/IonWorldImageryStyle.js", "../../Source/Scene/createWorldImagery.js", "../../Source/Scene/CreditDisplay.js", "../../Source/Scene/DebugAppearance.js", "../../Source/Scene/DebugCameraPrimitive.js", "../../Source/Scene/DebugInspector.js", "../../Source/Scene/DebugModelMatrixPrimitive.js", "../../Source/Scene/DepthPlane.js", "../../Source/Scene/DerivedCommand.js", "../../Source/Scene/DeviceOrientationCameraController.js", "../../Source/Scene/DirectionalLight.js", "../../Source/Scene/EllipsoidPrimitive.js", "../../Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js", "../../Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js", "../../Source/Scene/EllipsoidSurfaceAppearance.js", "../../Source/Scene/Fog.js", "../../Source/Scene/FrameRateMonitor.js", "../../Source/Scene/FrameState.js", "../../Source/Scene/FrustumCommands.js", "../../Source/Scene/getClipAndStyleCode.js", "../../Source/Scene/getClippingFunction.js", "../../Source/Scene/GlobeSurfaceShaderSet.js", "../../Source/Scene/ImageryState.js", "../../Source/Scene/QuadtreeTileLoadState.js", "../../Source/Scene/TerrainState.js", "../../Source/Scene/GlobeSurfaceTile.js", "../../Source/Scene/Imagery.js", "../../Source/Scene/TileImagery.js", "../../Source/Scene/ImageryLayer.js", "../../Source/Scene/TileSelectionResult.js", "../../Source/Scene/TerrainFillMesh.js", "../../Source/Scene/GlobeSurfaceTileProvider.js", "../../Source/Scene/GlobeTranslucency.js", "../../Source/Scene/ImageryLayerCollection.js", "../../Source/Scene/QuadtreeOccluders.js", "../../Source/Scene/QuadtreeTile.js", "../../Source/Scene/TileReplacementQueue.js", "../../Source/Scene/QuadtreePrimitive.js", "../../Source/Scene/Globe.js", "../../Source/Shaders/PostProcessStages/PassThrough.js", "../../Source/Shaders/PostProcessStages/PassThroughDepth.js", "../../Source/Scene/GlobeDepth.js", "../../Source/Scene/GlobeTranslucencyFramebuffer.js", "../../Source/Scene/GlobeTranslucencyState.js", "../../Source/Scene/GoogleEarthEnterpriseImageryProvider.js", "../../Source/Scene/GridImageryProvider.js", "../../Source/Scene/InvertClassification.js", "../../Source/Scene/JobScheduler.js", "../../Source/Scene/Light.js", "../../Source/Scene/MapboxStyleImageryProvider.js", "../../Source/Scene/Moon.js", "../../Source/Scene/NeverTileDiscardPolicy.js", "../../Source/Scene/OIT.js", "../../Source/Scene/OpenStreetMapImageryProvider.js", "../../Source/Scene/Particle.js", "../../Source/Scene/ParticleBurst.js", "../../Source/Scene/ParticleEmitter.js", "../../Source/Scene/ParticleSystem.js", "../../Source/Scene/PerformanceDisplay.js", "../../Source/Scene/PickDepth.js", "../../Source/Scene/PickDepthFramebuffer.js", "../../Source/Scene/PickFramebuffer.js", "../../Source/Scene/SceneFramebuffer.js", "../../Source/Scene/ShadowMapShader.js", "../../Source/Scene/ShadowMap.js", "../../Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js", "../../Source/Scene/TranslucentTileClassification.js", "../../Source/Scene/View.js", "../../Source/Scene/Picking.js", "../../Source/Scene/PointCloud.js", "../../Source/Scene/Splitter.js", "../../Source/Scene/PostProcessStageSampleMode.js", "../../Source/Scene/PostProcessStage.js", "../../Source/Shaders/PostProcessStages/AcesTonemappingStage.js", "../../Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js", "../../Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js", "../../Source/Shaders/PostProcessStages/BlackAndWhite.js", "../../Source/Shaders/PostProcessStages/BloomComposite.js", "../../Source/Shaders/PostProcessStages/Brightness.js", "../../Source/Shaders/PostProcessStages/ContrastBias.js", "../../Source/Shaders/PostProcessStages/DepthOfField.js", "../../Source/Shaders/PostProcessStages/DepthView.js", "../../Source/Shaders/PostProcessStages/EdgeDetection.js", "../../Source/Shaders/PostProcessStages/FilmicTonemapping.js", "../../Source/Shaders/PostProcessStages/FXAA.js", "../../Source/Shaders/PostProcessStages/GaussianBlur1D.js", "../../Source/Shaders/PostProcessStages/LensFlare.js", "../../Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js", "../../Source/Shaders/PostProcessStages/NightVision.js", "../../Source/Shaders/PostProcessStages/ReinhardTonemapping.js", "../../Source/Shaders/PostProcessStages/Silhouette.js", "../../Source/Scene/PostProcessStageComposite.js", "../../Source/Scene/PostProcessStageLibrary.js", "../../Source/Scene/PostProcessStageTextureCache.js", "../../Source/Scene/Tonemapper.js", "../../Source/Scene/PostProcessStageCollection.js", "../../Source/Scene/QuadtreeTileProvider.js", "../../Source/Scene/SceneTransitioner.js", "../../Source/Scene/TweenCollection.js", "../../Source/Scene/ScreenSpaceCameraController.js", "../../Source/Shaders/PostProcessStages/AdditiveBlend.js", "../../Source/Shaders/PostProcessStages/BrightPass.js", "../../Source/Scene/SunPostProcess.js", "../../Source/Scene/Scene.js", "../../Source/Scene/SkyAtmosphere.js", "../../Source/Scene/SkyBox.js", "../../Source/Scene/SphereEmitter.js", "../../Source/Scene/StyleExpression.js", "../../Source/Scene/Sun.js", "../../Source/Scene/TileBoundingVolume.js", "../../Source/Scene/TileCoordinatesImageryProvider.js", "../../Source/Scene/TileCoordinatesImageryProviderFlw.js", "../../Source/Scene/TileCoordinatesImageryProviderJww.js", "../../Source/Scene/TileDiscardPolicy.js", "../../Source/Scene/TileState.js", "../../Source/Scene/TimeDynamicPointCloud.js", "../../Source/Scene/ViewportQuad.js", "../../Source/Shaders/PostProcessStages/DepthViewPacked.js", "../../Source/Widgets/Animation/Animation.js", "../../Source/Widgets/Animation/AnimationViewModel.js", "../../Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js", "../../Source/Widgets/BaseLayerPicker/BaseLayerPicker.js", "../../Source/Widgets/BaseLayerPicker/ProviderViewModel.js", "../../Source/Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels.js", "../../Source/Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels.js", "../../Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js", "../../Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.js", "../../Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js", "../../Source/Widgets/CesiumInspector/CesiumInspector.js", "../../Source/Widgets/CesiumWidget/CesiumWidget.js", "../../Source/Widgets/FullscreenButton/FullscreenButtonViewModel.js", "../../Source/Widgets/FullscreenButton/FullscreenButton.js", "../../Source/Widgets/Geocoder/GeocoderViewModel.js", "../../Source/Widgets/Geocoder/Geocoder.js", "../../Source/Widgets/HomeButton/HomeButtonViewModel.js", "../../Source/Widgets/HomeButton/HomeButton.js", "../../Source/Widgets/InfoBox/InfoBoxViewModel.js", "../../Source/Widgets/InfoBox/InfoBox.js", "../../Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel.js", "../../Source/Widgets/NavigationHelpButton/NavigationHelpButton.js", "../../Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel.js", "../../Source/Widgets/PerformanceWatchdog/PerformanceWatchdog.js", "../../Source/Widgets/ProjectionPicker/ProjectionPickerViewModel.js", "../../Source/Widgets/ProjectionPicker/ProjectionPicker.js", "../../Source/Widgets/SceneModePicker/SceneModePickerViewModel.js", "../../Source/Widgets/SceneModePicker/SceneModePicker.js", "../../Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js", "../../Source/Widgets/SelectionIndicator/SelectionIndicator.js", "../../Source/Widgets/Timeline/TimelineHighlightRange.js", "../../Source/Widgets/Timeline/TimelineTrack.js", "../../Source/Widgets/Timeline/Timeline.js", "../../Source/Widgets/VRButton/VRButtonViewModel.js", "../../Source/Widgets/VRButton/VRButton.js", "../../Source/Widgets/Viewer/Viewer.js", "../../Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js", "../../Source/Widgets/Viewer/viewerCesiumInspectorMixin.js", "../../Source/Widgets/Viewer/viewerDragDropMixin.js", "../../Source/Widgets/Viewer/viewerPerformanceWatchdogMixin.js", "../../Source/Scene/Model/UniformType.js", "../../Source/Scene/Model/TextureManager.js", "../../Source/Scene/Model/CustomShader.js", "../../Source/Scene/Model/TextureUniform.js", "../../Source/Scene/Model/VaryingType.js", "../../Source/WorkersES6/createTaskProcessorWorker.js", "../../Source/Cesium.js"], - "sourcesContent": ["/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over eachother's state.\n\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n\n var m = new MersenneTwister();\n var randomNumber = m.random();\n\n You can also call the other genrand_{foo}() methods on the instance.\n\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n\n var m = new MersenneTwister(123);\n\n and that will always produce the same random sequence.\n\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nvar MersenneTwister = function(seed) {\n\tif (seed == undefined) {\n\t\tseed = new Date().getTime();\n\t}\n\n\t/* Period parameters */\n\tthis.N = 624;\n\tthis.M = 397;\n\tthis.MATRIX_A = 0x9908b0df; /* constant vector a */\n\tthis.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n\tthis.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n\tthis.mt = new Array(this.N); /* the array for the state vector */\n\tthis.mti=this.N+1; /* mti==N+1 means mt[N] is not initialized */\n\n\tif (seed.constructor == Array) {\n\t\tthis.init_by_array(seed, seed.length);\n\t}\n\telse {\n\t\tthis.init_seed(seed);\n\t}\n}\n\n/* initializes mt[N] with a seed */\n/* origin name init_genrand */\nMersenneTwister.prototype.init_seed = function(s) {\n\tthis.mt[0] = s >>> 0;\n\tfor (this.mti=1; this.mti<this.N; this.mti++) {\n\t\tvar s = this.mt[this.mti-1] ^ (this.mt[this.mti-1] >>> 30);\n\t\tthis.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)\n\t\t+ this.mti;\n\t\t/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n\t\t/* In the previous versions, MSBs of the seed affect */\n\t\t/* only MSBs of the array mt[]. */\n\t\t/* 2002/01/09 modified by Makoto Matsumoto */\n\t\tthis.mt[this.mti] >>>= 0;\n\t\t/* for >32 bit machines */\n\t}\n}\n\n/* initialize by an array with array-length */\n/* init_key is the array for initializing keys */\n/* key_length is its length */\n/* slight change for C++, 2004/2/26 */\nMersenneTwister.prototype.init_by_array = function(init_key, key_length) {\n\tvar i, j, k;\n\tthis.init_seed(19650218);\n\ti=1; j=0;\n\tk = (this.N>key_length ? this.N : key_length);\n\tfor (; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30)\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))\n\t\t+ init_key[j] + j; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++; j++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t\tif (j>=key_length) j=0;\n\t}\n\tfor (k=this.N-1; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))\n\t\t- i; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t}\n\n\tthis.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n}\n\n/* generates a random number on [0,0xffffffff]-interval */\n/* origin name genrand_int32 */\nMersenneTwister.prototype.random_int = function() {\n\tvar y;\n\tvar mag01 = new Array(0x0, this.MATRIX_A);\n\t/* mag01[x] = x * MATRIX_A for x=0,1 */\n\n\tif (this.mti >= this.N) { /* generate N words at one time */\n\t\tvar kk;\n\n\t\tif (this.mti == this.N+1) /* if init_seed() has not been called, */\n\t\t\tthis.init_seed(5489); /* a default initial seed is used */\n\n\t\tfor (kk=0;kk<this.N-this.M;kk++) {\n\t\t\ty = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);\n\t\t\tthis.mt[kk] = this.mt[kk+this.M] ^ (y >>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\tfor (;kk<this.N-1;kk++) {\n\t\t\ty = (this.mt[kk]&this.UPPER_MASK)|(this.mt[kk+1]&this.LOWER_MASK);\n\t\t\tthis.mt[kk] = this.mt[kk+(this.M-this.N)] ^ (y >>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\ty = (this.mt[this.N-1]&this.UPPER_MASK)|(this.mt[0]&this.LOWER_MASK);\n\t\tthis.mt[this.N-1] = this.mt[this.M-1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n\t\tthis.mti = 0;\n\t}\n\n\ty = this.mt[this.mti++];\n\n\t/* Tempering */\n\ty ^= (y >>> 11);\n\ty ^= (y << 7) & 0x9d2c5680;\n\ty ^= (y << 15) & 0xefc60000;\n\ty ^= (y >>> 18);\n\n\treturn y >>> 0;\n}\n\n/* generates a random number on [0,0x7fffffff]-interval */\n/* origin name genrand_int31 */\nMersenneTwister.prototype.random_int31 = function() {\n\treturn (this.random_int()>>>1);\n}\n\n/* generates a random number on [0,1]-real-interval */\n/* origin name genrand_real1 */\nMersenneTwister.prototype.random_incl = function() {\n\treturn this.random_int()*(1.0/4294967295.0);\n\t/* divided by 2^32-1 */\n}\n\n/* generates a random number on [0,1)-real-interval */\nMersenneTwister.prototype.random = function() {\n\treturn this.random_int()*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on (0,1)-real-interval */\n/* origin name genrand_real3 */\nMersenneTwister.prototype.random_excl = function() {\n\treturn (this.random_int() + 0.5)*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on [0,1) with 53-bit resolution*/\n/* origin name genrand_res53 */\nMersenneTwister.prototype.random_long = function() {\n\tvar a=this.random_int()>>>5, b=this.random_int()>>>6;\n\treturn(a*67108864.0+b)*(1.0/9007199254740992.0);\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n\nmodule.exports = MersenneTwister;\n", "/*! https://mths.be/punycode v1.4.0 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n", "/*!\n * URI.js - Mutating URLs\n * IPv6 Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else {\n // Browser globals (root is window)\n root.IPv6 = factory(root);\n }\n}(this, function (root) {\n 'use strict';\n\n /*\n var _in = \"fe80:0000:0000:0000:0204:61ff:fe9d:f156\";\n var _out = IPv6.best(_in);\n var _expected = \"fe80::204:61ff:fe9d:f156\";\n\n console.log(_in, _out, _expected, _out === _expected);\n */\n\n // save current IPv6 variable, if any\n var _IPv6 = root && root.IPv6;\n\n function bestPresentation(address) {\n // based on:\n // Javascript to test an IPv6 address for proper format, and to\n // present the \"best text representation\" according to IETF Draft RFC at\n // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04\n // 8 Feb 2010 Rich Brown, Dartware, LLC\n // Please feel free to use this code as long as you provide a link to\n // http://www.intermapper.com\n // http://intermapper.com/support/tools/IPV6-Validator.aspx\n // http://download.dartware.com/thirdparty/ipv6validator.js\n\n var _address = address.toLowerCase();\n var segments = _address.split(':');\n var length = segments.length;\n var total = 8;\n\n // trim colons (:: or ::a:b:c\u2026 or \u2026a:b:c::)\n if (segments[0] === '' && segments[1] === '' && segments[2] === '') {\n // must have been ::\n // remove first two items\n segments.shift();\n segments.shift();\n } else if (segments[0] === '' && segments[1] === '') {\n // must have been ::xxxx\n // remove the first item\n segments.shift();\n } else if (segments[length - 1] === '' && segments[length - 2] === '') {\n // must have been xxxx::\n segments.pop();\n }\n\n length = segments.length;\n\n // adjust total segments for IPv4 trailer\n if (segments[length - 1].indexOf('.') !== -1) {\n // found a \".\" which means IPv4\n total = 7;\n }\n\n // fill empty segments them with \"0000\"\n var pos;\n for (pos = 0; pos < length; pos++) {\n if (segments[pos] === '') {\n break;\n }\n }\n\n if (pos < total) {\n segments.splice(pos, 1, '0000');\n while (segments.length < total) {\n segments.splice(pos, 0, '0000');\n }\n }\n\n // strip leading zeros\n var _segments;\n for (var i = 0; i < total; i++) {\n _segments = segments[i].split('');\n for (var j = 0; j < 3 ; j++) {\n if (_segments[0] === '0' && _segments.length > 1) {\n _segments.splice(0,1);\n } else {\n break;\n }\n }\n\n segments[i] = _segments.join('');\n }\n\n // find longest sequence of zeroes and coalesce them into one segment\n var best = -1;\n var _best = 0;\n var _current = 0;\n var current = -1;\n var inzeroes = false;\n // i; already declared\n\n for (i = 0; i < total; i++) {\n if (inzeroes) {\n if (segments[i] === '0') {\n _current += 1;\n } else {\n inzeroes = false;\n if (_current > _best) {\n best = current;\n _best = _current;\n }\n }\n } else {\n if (segments[i] === '0') {\n inzeroes = true;\n current = i;\n _current = 1;\n }\n }\n }\n\n if (_current > _best) {\n best = current;\n _best = _current;\n }\n\n if (_best > 1) {\n segments.splice(best, _best, '');\n }\n\n length = segments.length;\n\n // assemble remaining segments\n var result = '';\n if (segments[0] === '') {\n result = ':';\n }\n\n for (i = 0; i < length; i++) {\n result += segments[i];\n if (i === length - 1) {\n break;\n }\n\n result += ':';\n }\n\n if (segments[length - 1] === '') {\n result += ':';\n }\n\n return result;\n }\n\n function noConflict() {\n /*jshint validthis: true */\n if (root.IPv6 === this) {\n root.IPv6 = _IPv6;\n }\n\n return this;\n }\n\n return {\n best: bestPresentation,\n noConflict: noConflict\n };\n}));\n", "/*!\n * URI.js - Mutating URLs\n * Second Level Domain (SLD) Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else {\n // Browser globals (root is window)\n root.SecondLevelDomains = factory(root);\n }\n}(this, function (root) {\n 'use strict';\n\n // save current SecondLevelDomains variable, if any\n var _SecondLevelDomains = root && root.SecondLevelDomains;\n\n var SLD = {\n // list of known Second Level Domains\n // converted list of SLDs from https://github.com/gavingmiller/second-level-domains\n // ----\n // publicsuffix.org is more current and actually used by a couple of browsers internally.\n // downside is it also contains domains like \"dyndns.org\" - which is fine for the security\n // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js\n // ----\n list: {\n 'ac':' com gov mil net org ',\n 'ae':' ac co gov mil name net org pro sch ',\n 'af':' com edu gov net org ',\n 'al':' com edu gov mil net org ',\n 'ao':' co ed gv it og pb ',\n 'ar':' com edu gob gov int mil net org tur ',\n 'at':' ac co gv or ',\n 'au':' asn com csiro edu gov id net org ',\n 'ba':' co com edu gov mil net org rs unbi unmo unsa untz unze ',\n 'bb':' biz co com edu gov info net org store tv ',\n 'bh':' biz cc com edu gov info net org ',\n 'bn':' com edu gov net org ',\n 'bo':' com edu gob gov int mil net org tv ',\n '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 ',\n 'bs':' com edu gov net org ',\n 'bz':' du et om ov rg ',\n 'ca':' ab bc mb nb nf nl ns nt nu on pe qc sk yk ',\n 'ck':' biz co edu gen gov info net org ',\n '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 ',\n 'co':' com edu gov mil net nom org ',\n 'cr':' ac c co ed fi go or sa ',\n 'cy':' ac biz com ekloges gov ltd name net org parliament press pro tm ',\n 'do':' art com edu gob gov mil net org sld web ',\n 'dz':' art asso com edu gov net org pol ',\n 'ec':' com edu fin gov info med mil net org pro ',\n 'eg':' com edu eun gov mil name net org sci ',\n 'er':' com edu gov ind mil net org rochest w ',\n 'es':' com edu gob nom org ',\n 'et':' biz com edu gov info name net org ',\n 'fj':' ac biz com info mil name net org pro ',\n 'fk':' ac co gov net nom org ',\n 'fr':' asso com f gouv nom prd presse tm ',\n 'gg':' co net org ',\n 'gh':' com edu gov mil org ',\n 'gn':' ac com gov net org ',\n 'gr':' com edu gov mil net org ',\n 'gt':' com edu gob ind mil net org ',\n 'gu':' com edu gov net org ',\n 'hk':' com edu gov idv net org ',\n '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 ',\n 'id':' ac co go mil net or sch web ',\n 'il':' ac co gov idf k12 muni net org ',\n 'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',\n 'iq':' com edu gov i mil net org ',\n 'ir':' ac co dnssec gov i id net org sch ',\n 'it':' edu gov ',\n 'je':' co net org ',\n 'jo':' com edu gov mil name net org sch ',\n 'jp':' ac ad co ed go gr lg ne or ',\n 'ke':' ac co go info me mobi ne or sc ',\n 'kh':' com edu gov mil net org per ',\n 'ki':' biz com de edu gov info mob net org tel ',\n 'km':' asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ',\n 'kn':' edu gov net org ',\n '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 ',\n 'kw':' com edu gov net org ',\n 'ky':' com edu gov net org ',\n 'kz':' com edu gov mil net org ',\n 'lb':' com edu gov net org ',\n 'lk':' assn com edu gov grp hotel int ltd net ngo org sch soc web ',\n 'lr':' com edu gov net org ',\n 'lv':' asn com conf edu gov id mil net org ',\n 'ly':' com edu gov id med net org plc sch ',\n 'ma':' ac co gov m net org press ',\n 'mc':' asso tm ',\n 'me':' ac co edu gov its net org priv ',\n 'mg':' com edu gov mil nom org prd tm ',\n 'mk':' com edu gov inf name net org pro ',\n 'ml':' com edu gov net org presse ',\n 'mn':' edu gov org ',\n 'mo':' com edu gov net org ',\n 'mt':' com edu gov net org ',\n 'mv':' aero biz com coop edu gov info int mil museum name net org pro ',\n 'mw':' ac co com coop edu gov int museum net org ',\n 'mx':' com edu gob net org ',\n 'my':' com edu gov mil name net org sch ',\n 'nf':' arts com firm info net other per rec store web ',\n 'ng':' biz com edu gov mil mobi name net org sch ',\n 'ni':' ac co com edu gob mil net nom org ',\n 'np':' com edu gov mil net org ',\n 'nr':' biz com edu gov info net org ',\n 'om':' ac biz co com edu gov med mil museum net org pro sch ',\n 'pe':' com edu gob mil net nom org sld ',\n 'ph':' com edu gov i mil net ngo org ',\n 'pk':' biz com edu fam gob gok gon gop gos gov net org web ',\n '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 ',\n 'pr':' ac biz com edu est gov info isla name net org pro prof ',\n 'ps':' com edu gov net org plo sec ',\n 'pw':' belau co ed go ne or ',\n 'ro':' arts com firm info nom nt org rec store tm www ',\n 'rs':' ac co edu gov in org ',\n 'sb':' com edu gov net org ',\n 'sc':' com edu gov net org ',\n 'sh':' co com edu gov net nom org ',\n 'sl':' com edu gov net org ',\n 'st':' co com consulado edu embaixada gov mil net org principe saotome store ',\n 'sv':' com edu gob org red ',\n 'sz':' ac co org ',\n 'tr':' av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ',\n 'tt':' aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ',\n 'tw':' club com ebiz edu game gov idv mil net org ',\n 'mu':' ac co com gov net or org ',\n 'mz':' ac co edu gov org ',\n 'na':' co com ',\n 'nz':' ac co cri geek gen govt health iwi maori mil net org parliament school ',\n 'pa':' abo ac com edu gob ing med net nom org sld ',\n 'pt':' com edu gov int net nome org publ ',\n 'py':' com edu gov mil net org ',\n 'qa':' com edu gov mil net org ',\n 're':' asso com nom ',\n '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 ',\n 'rw':' ac co com edu gouv gov int mil net ',\n 'sa':' com edu gov med net org pub sch ',\n 'sd':' com edu gov info med net org tv ',\n '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 ',\n 'sg':' com edu gov idn net org per ',\n 'sn':' art com edu gouv org perso univ ',\n 'sy':' com edu gov mil net news org ',\n 'th':' ac co go in mi net or ',\n 'tj':' ac biz co com edu go gov info int mil name net nic org test web ',\n 'tn':' agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ',\n 'tz':' ac co go ne or ',\n '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 ',\n 'ug':' ac co go ne or org sc ',\n '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 ',\n 'us':' dni fed isa kids nsn ',\n 'uy':' com edu gub mil net org ',\n 've':' co com edu gob info mil net org web ',\n 'vi':' co com k12 net org ',\n 'vn':' ac biz com edu gov health info int name net org pro ',\n 'ye':' co com gov ltd me net org plc ',\n 'yu':' ac co edu gov org ',\n '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 ',\n 'zm':' ac co com edu gov net org sch ',\n // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains\n 'com': 'ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ',\n 'net': 'gb jp se uk ',\n 'org': 'ae',\n 'de': 'com '\n },\n // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost\n // in both performance and memory footprint. No initialization required.\n // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4\n // Following methods use lastIndexOf() rather than array.split() in order\n // to avoid any memory allocations.\n has: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return false;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n return false;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return false;\n }\n return sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') >= 0;\n },\n is: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return false;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset >= 0) {\n return false;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return false;\n }\n return sldList.indexOf(' ' + domain.slice(0, tldOffset) + ' ') >= 0;\n },\n get: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return null;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n return null;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return null;\n }\n if (sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') < 0) {\n return null;\n }\n return domain.slice(sldOffset+1);\n },\n noConflict: function(){\n if (root.SecondLevelDomains === this) {\n root.SecondLevelDomains = _SecondLevelDomains;\n }\n return this;\n }\n };\n\n return SLD;\n}));\n", "/*!\n * URI.js - Mutating URLs\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains'));\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['./punycode', './IPv6', './SecondLevelDomains'], factory);\n } else {\n // Browser globals (root is window)\n root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);\n }\n}(this, function (punycode, IPv6, SLD, root) {\n 'use strict';\n /*global location, escape, unescape */\n // FIXME: v2.0.0 renamce non-camelCase properties to uppercase\n /*jshint camelcase: false */\n\n // save current URI variable, if any\n var _URI = root && root.URI;\n\n function URI(url, base) {\n var _urlSupplied = arguments.length >= 1;\n var _baseSupplied = arguments.length >= 2;\n\n // Allow instantiation without the 'new' keyword\n if (!(this instanceof URI)) {\n if (_urlSupplied) {\n if (_baseSupplied) {\n return new URI(url, base);\n }\n\n return new URI(url);\n }\n\n return new URI();\n }\n\n if (url === undefined) {\n if (_urlSupplied) {\n throw new TypeError('undefined is not a valid argument for URI');\n }\n\n if (typeof location !== 'undefined') {\n url = location.href + '';\n } else {\n url = '';\n }\n }\n\n if (url === null) {\n if (_urlSupplied) {\n throw new TypeError('null is not a valid argument for URI');\n }\n }\n\n this.href(url);\n\n // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor\n if (base !== undefined) {\n return this.absoluteTo(base);\n }\n\n return this;\n }\n\n function isInteger(value) {\n return /^[0-9]+$/.test(value);\n }\n\n URI.version = '1.19.11';\n\n var p = URI.prototype;\n var hasOwn = Object.prototype.hasOwnProperty;\n\n function escapeRegEx(string) {\n // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963\n return string.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n }\n\n function getType(value) {\n // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value\n if (value === undefined) {\n return 'Undefined';\n }\n\n return String(Object.prototype.toString.call(value)).slice(8, -1);\n }\n\n function isArray(obj) {\n return getType(obj) === 'Array';\n }\n\n function filterArrayValues(data, value) {\n var lookup = {};\n var i, length;\n\n if (getType(value) === 'RegExp') {\n lookup = null;\n } else if (isArray(value)) {\n for (i = 0, length = value.length; i < length; i++) {\n lookup[value[i]] = true;\n }\n } else {\n lookup[value] = true;\n }\n\n for (i = 0, length = data.length; i < length; i++) {\n /*jshint laxbreak: true */\n var _match = lookup && lookup[data[i]] !== undefined\n || !lookup && value.test(data[i]);\n /*jshint laxbreak: false */\n if (_match) {\n data.splice(i, 1);\n length--;\n i--;\n }\n }\n\n return data;\n }\n\n function arrayContains(list, value) {\n var i, length;\n\n // value may be string, number, array, regexp\n if (isArray(value)) {\n // Note: this can be optimized to O(n) (instead of current O(m * n))\n for (i = 0, length = value.length; i < length; i++) {\n if (!arrayContains(list, value[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n var _type = getType(value);\n for (i = 0, length = list.length; i < length; i++) {\n if (_type === 'RegExp') {\n if (typeof list[i] === 'string' && list[i].match(value)) {\n return true;\n }\n } else if (list[i] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n function arraysEqual(one, two) {\n if (!isArray(one) || !isArray(two)) {\n return false;\n }\n\n // arrays can't be equal if they have different amount of content\n if (one.length !== two.length) {\n return false;\n }\n\n one.sort();\n two.sort();\n\n for (var i = 0, l = one.length; i < l; i++) {\n if (one[i] !== two[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n function trimSlashes(text) {\n var trim_expression = /^\\/+|\\/+$/g;\n return text.replace(trim_expression, '');\n }\n\n URI._parts = function() {\n return {\n protocol: null,\n username: null,\n password: null,\n hostname: null,\n urn: null,\n port: null,\n path: null,\n query: null,\n fragment: null,\n // state\n preventInvalidHostname: URI.preventInvalidHostname,\n duplicateQueryParameters: URI.duplicateQueryParameters,\n escapeQuerySpace: URI.escapeQuerySpace\n };\n };\n // state: throw on invalid hostname\n // see https://github.com/medialize/URI.js/pull/345\n // and https://github.com/medialize/URI.js/issues/354\n URI.preventInvalidHostname = false;\n // state: allow duplicate query parameters (a=1&a=1)\n URI.duplicateQueryParameters = false;\n // state: replaces + with %20 (space in query strings)\n URI.escapeQuerySpace = true;\n // static properties\n URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;\n URI.idn_expression = /[^a-z0-9\\._-]/i;\n URI.punycode_expression = /(xn--)/i;\n // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?\n URI.ip4_expression = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n // credits to Rich Brown\n // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096\n // specification: http://www.ietf.org/rfc/rfc4291.txt\n URI.ip6_expression = /^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A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;\n // expression used is \"gruber revised\" (@gruber v2) determined to be the\n // best solution in a regex-golf we did a couple of ages ago at\n // * http://mathiasbynens.be/demo/url-regex\n // * http://rodneyrehm.de/t/url-regex.html\n URI.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`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]))/ig;\n URI.findUri = {\n // valid \"scheme://\" or \"www.\"\n start: /\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,\n // everything up to the next whitespace\n end: /[\\s\\r\\n]|$/,\n // trim trailing punctuation captured by end RegExp\n trim: /[`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u201E\u2018\u2019]+$/,\n // balanced parens inclusion (), [], {}, <>\n parens: /(\\([^\\)]*\\)|\\[[^\\]]*\\]|\\{[^}]*\\}|<[^>]*>)/g,\n };\n URI.leading_whitespace_expression = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n URI.ascii_tab_whitespace = /[\\u0009\\u000A\\u000D]+/g\n // http://www.iana.org/assignments/uri-schemes.html\n // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports\n URI.defaultPorts = {\n http: '80',\n https: '443',\n ftp: '21',\n gopher: '70',\n ws: '80',\n wss: '443'\n };\n // list of protocols which always require a hostname\n URI.hostProtocols = [\n 'http',\n 'https'\n ];\n\n // allowed hostname characters according to RFC 3986\n // ALPHA DIGIT \"-\" \".\" \"_\" \"~\" \"!\" \"$\" \"&\" \"'\" \"(\" \")\" \"*\" \"+\" \",\" \";\" \"=\" %encoded\n // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _\n URI.invalid_hostname_characters = /[^a-zA-Z0-9\\.\\-:_]/;\n // map DOM Elements to their URI attribute\n URI.domAttributes = {\n 'a': 'href',\n 'blockquote': 'cite',\n 'link': 'href',\n 'base': 'href',\n 'script': 'src',\n 'form': 'action',\n 'img': 'src',\n 'area': 'href',\n 'iframe': 'src',\n 'embed': 'src',\n 'source': 'src',\n 'track': 'src',\n 'input': 'src', // but only if type=\"image\"\n 'audio': 'src',\n 'video': 'src'\n };\n URI.getDomAttribute = function(node) {\n if (!node || !node.nodeName) {\n return undefined;\n }\n\n var nodeName = node.nodeName.toLowerCase();\n // <input> should only expose src for type=\"image\"\n if (nodeName === 'input' && node.type !== 'image') {\n return undefined;\n }\n\n return URI.domAttributes[nodeName];\n };\n\n function escapeForDumbFirefox36(value) {\n // https://github.com/medialize/URI.js/issues/91\n return escape(value);\n }\n\n // encoding / decoding according to RFC3986\n function strictEncodeURIComponent(string) {\n // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent\n return encodeURIComponent(string)\n .replace(/[!'()*]/g, escapeForDumbFirefox36)\n .replace(/\\*/g, '%2A');\n }\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n URI.iso8859 = function() {\n URI.encode = escape;\n URI.decode = unescape;\n };\n URI.unicode = function() {\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n };\n URI.characters = {\n pathname: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,\n map: {\n // -._~!'()*\n '%24': '$',\n '%26': '&',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '=',\n '%3A': ':',\n '%40': '@'\n }\n },\n decode: {\n expression: /[\\/\\?#]/g,\n map: {\n '/': '%2F',\n '?': '%3F',\n '#': '%23'\n }\n }\n },\n reserved: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,\n map: {\n // gen-delims\n '%3A': ':',\n '%2F': '/',\n '%3F': '?',\n '%23': '#',\n '%5B': '[',\n '%5D': ']',\n '%40': '@',\n // sub-delims\n '%21': '!',\n '%24': '$',\n '%26': '&',\n '%27': '\\'',\n '%28': '(',\n '%29': ')',\n '%2A': '*',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '='\n }\n }\n },\n urnpath: {\n // The characters under `encode` are the characters called out by RFC 2141 as being acceptable\n // for usage in a URN. RFC2141 also calls out \"-\", \".\", and \"_\" as acceptable characters, but\n // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also\n // note that the colon character is not featured in the encoding map; this is because URI.js\n // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it\n // should not appear unencoded in a segment itself.\n // See also the note above about RFC3986 and capitalalized hex digits.\n encode: {\n expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,\n map: {\n '%21': '!',\n '%24': '$',\n '%27': '\\'',\n '%28': '(',\n '%29': ')',\n '%2A': '*',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '=',\n '%40': '@'\n }\n },\n // These characters are the characters called out by RFC2141 as \"reserved\" characters that\n // should never appear in a URN, plus the colon character (see note above).\n decode: {\n expression: /[\\/\\?#:]/g,\n map: {\n '/': '%2F',\n '?': '%3F',\n '#': '%23',\n ':': '%3A'\n }\n }\n }\n };\n URI.encodeQuery = function(string, escapeQuerySpace) {\n var escaped = URI.encode(string + '');\n if (escapeQuerySpace === undefined) {\n escapeQuerySpace = URI.escapeQuerySpace;\n }\n\n return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;\n };\n URI.decodeQuery = function(string, escapeQuerySpace) {\n string += '';\n if (escapeQuerySpace === undefined) {\n escapeQuerySpace = URI.escapeQuerySpace;\n }\n\n try {\n return URI.decode(escapeQuerySpace ? string.replace(/\\+/g, '%20') : string);\n } catch(e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n // generate encode/decode path functions\n var _parts = {'encode':'encode', 'decode':'decode'};\n var _part;\n var generateAccessor = function(_group, _part) {\n return function(string) {\n try {\n return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {\n return URI.characters[_group][_part].map[c];\n });\n } catch (e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n };\n\n for (_part in _parts) {\n URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);\n URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);\n }\n\n var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {\n return function(string) {\n // Why pass in names of functions, rather than the function objects themselves? The\n // definitions of some functions (but in particular, URI.decode) will occasionally change due\n // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure\n // that the functions we use here are \"fresh\".\n var actualCodingFunc;\n if (!_innerCodingFuncName) {\n actualCodingFunc = URI[_codingFuncName];\n } else {\n actualCodingFunc = function(string) {\n return URI[_codingFuncName](URI[_innerCodingFuncName](string));\n };\n }\n\n var segments = (string + '').split(_sep);\n\n for (var i = 0, length = segments.length; i < length; i++) {\n segments[i] = actualCodingFunc(segments[i]);\n }\n\n return segments.join(_sep);\n };\n };\n\n // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.\n URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');\n URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');\n URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');\n URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');\n\n URI.encodeReserved = generateAccessor('reserved', 'encode');\n\n URI.parse = function(string, parts) {\n var pos;\n if (!parts) {\n parts = {\n preventInvalidHostname: URI.preventInvalidHostname\n };\n }\n\n string = string.replace(URI.leading_whitespace_expression, '')\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n string = string.replace(URI.ascii_tab_whitespace, '')\n\n // [protocol\"://\"[username[\":\"password]\"@\"]hostname[\":\"port]\"/\"?][path][\"?\"querystring][\"#\"fragment]\n\n // extract fragment\n pos = string.indexOf('#');\n if (pos > -1) {\n // escaping?\n parts.fragment = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n\n // extract query\n pos = string.indexOf('?');\n if (pos > -1) {\n // escaping?\n parts.query = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n\n // slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)\n string = string.replace(/^(https?|ftp|wss?)?:+[/\\\\]*/i, '$1://');\n // slashes and backslashes have lost all meaning for scheme relative URLs\n string = string.replace(/^[/\\\\]{2,}/i, '//');\n\n // extract protocol\n if (string.substring(0, 2) === '//') {\n // relative-scheme\n parts.protocol = null;\n string = string.substring(2);\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n pos = string.indexOf(':');\n if (pos > -1) {\n parts.protocol = string.substring(0, pos) || null;\n if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {\n // : may be within the path\n parts.protocol = undefined;\n } else if (string.substring(pos + 1, pos + 3).replace(/\\\\/g, '/') === '//') {\n string = string.substring(pos + 3);\n\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n string = string.substring(pos + 1);\n parts.urn = true;\n }\n }\n }\n\n // what's left must be the path\n parts.path = string;\n\n // and we're done\n return parts;\n };\n URI.parseHost = function(string, parts) {\n if (!string) {\n string = '';\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n // https://github.com/medialize/URI.js/pull/233\n string = string.replace(/\\\\/g, '/');\n\n // extract host:port\n var pos = string.indexOf('/');\n var bracketPos;\n var t;\n\n if (pos === -1) {\n pos = string.length;\n }\n\n if (string.charAt(0) === '[') {\n // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6\n // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts\n // IPv6+port in the format [2001:db8::1]:80 (for the time being)\n bracketPos = string.indexOf(']');\n parts.hostname = string.substring(1, bracketPos) || null;\n parts.port = string.substring(bracketPos + 2, pos) || null;\n if (parts.port === '/') {\n parts.port = null;\n }\n } else {\n var firstColon = string.indexOf(':');\n var firstSlash = string.indexOf('/');\n var nextColon = string.indexOf(':', firstColon + 1);\n if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {\n // IPv6 host contains multiple colons - but no port\n // this notation is actually not allowed by RFC 3986, but we're a liberal parser\n parts.hostname = string.substring(0, pos) || null;\n parts.port = null;\n } else {\n t = string.substring(0, pos).split(':');\n parts.hostname = t[0] || null;\n parts.port = t[1] || null;\n }\n }\n\n if (parts.hostname && string.substring(pos).charAt(0) !== '/') {\n pos++;\n string = '/' + string;\n }\n\n if (parts.preventInvalidHostname) {\n URI.ensureValidHostname(parts.hostname, parts.protocol);\n }\n\n if (parts.port) {\n URI.ensureValidPort(parts.port);\n }\n\n return string.substring(pos) || '/';\n };\n URI.parseAuthority = function(string, parts) {\n string = URI.parseUserinfo(string, parts);\n return URI.parseHost(string, parts);\n };\n URI.parseUserinfo = function(string, parts) {\n // extract username:password\n var _string = string\n var firstBackSlash = string.indexOf('\\\\');\n if (firstBackSlash !== -1) {\n string = string.replace(/\\\\/g, '/')\n }\n var firstSlash = string.indexOf('/');\n var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);\n var t;\n\n // authority@ must come before /path or \\path\n if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {\n t = string.substring(0, pos).split(':');\n parts.username = t[0] ? URI.decode(t[0]) : null;\n t.shift();\n parts.password = t[0] ? URI.decode(t.join(':')) : null;\n string = _string.substring(pos + 1);\n } else {\n parts.username = null;\n parts.password = null;\n }\n\n return string;\n };\n URI.parseQuery = function(string, escapeQuerySpace) {\n if (!string) {\n return {};\n }\n\n // throw out the funky business - \"?\"[name\"=\"value\"&\"]+\n string = string.replace(/&+/g, '&').replace(/^\\?*&*|&+$/g, '');\n\n if (!string) {\n return {};\n }\n\n var items = {};\n var splits = string.split('&');\n var length = splits.length;\n var v, name, value;\n\n for (var i = 0; i < length; i++) {\n v = splits[i].split('=');\n name = URI.decodeQuery(v.shift(), escapeQuerySpace);\n // no \"=\" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters\n value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;\n\n if (name === '__proto__') {\n // ignore attempt at exploiting JavaScript internals\n continue;\n } else if (hasOwn.call(items, name)) {\n if (typeof items[name] === 'string' || items[name] === null) {\n items[name] = [items[name]];\n }\n\n items[name].push(value);\n } else {\n items[name] = value;\n }\n }\n\n return items;\n };\n\n URI.build = function(parts) {\n var t = '';\n var requireAbsolutePath = false\n\n if (parts.protocol) {\n t += parts.protocol + ':';\n }\n\n if (!parts.urn && (t || parts.hostname)) {\n t += '//';\n requireAbsolutePath = true\n }\n\n t += (URI.buildAuthority(parts) || '');\n\n if (typeof parts.path === 'string') {\n if (parts.path.charAt(0) !== '/' && requireAbsolutePath) {\n t += '/';\n }\n\n t += parts.path;\n }\n\n if (typeof parts.query === 'string' && parts.query) {\n t += '?' + parts.query;\n }\n\n if (typeof parts.fragment === 'string' && parts.fragment) {\n t += '#' + parts.fragment;\n }\n return t;\n };\n URI.buildHost = function(parts) {\n var t = '';\n\n if (!parts.hostname) {\n return '';\n } else if (URI.ip6_expression.test(parts.hostname)) {\n t += '[' + parts.hostname + ']';\n } else {\n t += parts.hostname;\n }\n\n if (parts.port) {\n t += ':' + parts.port;\n }\n\n return t;\n };\n URI.buildAuthority = function(parts) {\n return URI.buildUserinfo(parts) + URI.buildHost(parts);\n };\n URI.buildUserinfo = function(parts) {\n var t = '';\n\n if (parts.username) {\n t += URI.encode(parts.username);\n }\n\n if (parts.password) {\n t += ':' + URI.encode(parts.password);\n }\n\n if (t) {\n t += '@';\n }\n\n return t;\n };\n URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {\n // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html\n // being \u00BB-._~!$&'()*+,;=:@/?\u00AB %HEX and alnum are allowed\n // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!\n // URI.js treats the query string as being application/x-www-form-urlencoded\n // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type\n\n var t = '';\n var unique, key, i, length;\n for (key in data) {\n if (key === '__proto__') {\n // ignore attempt at exploiting JavaScript internals\n continue;\n } else if (hasOwn.call(data, key)) {\n if (isArray(data[key])) {\n unique = {};\n for (i = 0, length = data[key].length; i < length; i++) {\n if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {\n t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);\n if (duplicateQueryParameters !== true) {\n unique[data[key][i] + ''] = true;\n }\n }\n }\n } else if (data[key] !== undefined) {\n t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);\n }\n }\n }\n\n return t.substring(1);\n };\n URI.buildQueryParameter = function(name, value, escapeQuerySpace) {\n // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded\n // don't append \"=\" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization\n return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');\n };\n\n URI.addQuery = function(data, name, value) {\n if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n URI.addQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n if (data[name] === undefined) {\n data[name] = value;\n return;\n } else if (typeof data[name] === 'string') {\n data[name] = [data[name]];\n }\n\n if (!isArray(value)) {\n value = [value];\n }\n\n data[name] = (data[name] || []).concat(value);\n } else {\n throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n }\n };\n\n URI.setQuery = function(data, name, value) {\n if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n URI.setQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n data[name] = value === undefined ? null : value;\n } else {\n throw new TypeError('URI.setQuery() accepts an object, string as the name parameter');\n }\n };\n\n URI.removeQuery = function(data, name, value) {\n var i, length, key;\n\n if (isArray(name)) {\n for (i = 0, length = name.length; i < length; i++) {\n data[name[i]] = undefined;\n }\n } else if (getType(name) === 'RegExp') {\n for (key in data) {\n if (name.test(key)) {\n data[key] = undefined;\n }\n }\n } else if (typeof name === 'object') {\n for (key in name) {\n if (hasOwn.call(name, key)) {\n URI.removeQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n if (value !== undefined) {\n if (getType(value) === 'RegExp') {\n if (!isArray(data[name]) && value.test(data[name])) {\n data[name] = undefined;\n } else {\n data[name] = filterArrayValues(data[name], value);\n }\n } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {\n data[name] = undefined;\n } else if (isArray(data[name])) {\n data[name] = filterArrayValues(data[name], value);\n }\n } else {\n data[name] = undefined;\n }\n } else {\n throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');\n }\n };\n URI.hasQuery = function(data, name, value, withinArray) {\n switch (getType(name)) {\n case 'String':\n // Nothing to do here\n break;\n\n case 'RegExp':\n for (var key in data) {\n if (hasOwn.call(data, key)) {\n if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) {\n return true;\n }\n }\n }\n\n return false;\n\n case 'Object':\n for (var _key in name) {\n if (hasOwn.call(name, _key)) {\n if (!URI.hasQuery(data, _key, name[_key])) {\n return false;\n }\n }\n }\n\n return true;\n\n default:\n throw new TypeError('URI.hasQuery() accepts a string, regular expression or object as the name parameter');\n }\n\n switch (getType(value)) {\n case 'Undefined':\n // true if exists (but may be empty)\n return name in data; // data[name] !== undefined;\n\n case 'Boolean':\n // true if exists and non-empty\n var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);\n return value === _booly;\n\n case 'Function':\n // allow complex comparison\n return !!value(data[name], name, data);\n\n case 'Array':\n if (!isArray(data[name])) {\n return false;\n }\n\n var op = withinArray ? arrayContains : arraysEqual;\n return op(data[name], value);\n\n case 'RegExp':\n if (!isArray(data[name])) {\n return Boolean(data[name] && data[name].match(value));\n }\n\n if (!withinArray) {\n return false;\n }\n\n return arrayContains(data[name], value);\n\n case 'Number':\n value = String(value);\n /* falls through */\n case 'String':\n if (!isArray(data[name])) {\n return data[name] === value;\n }\n\n if (!withinArray) {\n return false;\n }\n\n return arrayContains(data[name], value);\n\n default:\n throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');\n }\n };\n\n\n URI.joinPaths = function() {\n var input = [];\n var segments = [];\n var nonEmptySegments = 0;\n\n for (var i = 0; i < arguments.length; i++) {\n var url = new URI(arguments[i]);\n input.push(url);\n var _segments = url.segment();\n for (var s = 0; s < _segments.length; s++) {\n if (typeof _segments[s] === 'string') {\n segments.push(_segments[s]);\n }\n\n if (_segments[s]) {\n nonEmptySegments++;\n }\n }\n }\n\n if (!segments.length || !nonEmptySegments) {\n return new URI('');\n }\n\n var uri = new URI('').segment(segments);\n\n if (input[0].path() === '' || input[0].path().slice(0, 1) === '/') {\n uri.path('/' + uri.path());\n }\n\n return uri.normalize();\n };\n\n URI.commonPath = function(one, two) {\n var length = Math.min(one.length, two.length);\n var pos;\n\n // find first non-matching character\n for (pos = 0; pos < length; pos++) {\n if (one.charAt(pos) !== two.charAt(pos)) {\n pos--;\n break;\n }\n }\n\n if (pos < 1) {\n return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';\n }\n\n // revert to last /\n if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {\n pos = one.substring(0, pos).lastIndexOf('/');\n }\n\n return one.substring(0, pos + 1);\n };\n\n URI.withinString = function(string, callback, options) {\n options || (options = {});\n var _start = options.start || URI.findUri.start;\n var _end = options.end || URI.findUri.end;\n var _trim = options.trim || URI.findUri.trim;\n var _parens = options.parens || URI.findUri.parens;\n var _attributeOpen = /[a-z0-9-]=[\"']?$/i;\n\n _start.lastIndex = 0;\n while (true) {\n var match = _start.exec(string);\n if (!match) {\n break;\n }\n\n var start = match.index;\n if (options.ignoreHtml) {\n // attribut(e=[\"']?$)\n var attributeOpen = string.slice(Math.max(start - 3, 0), start);\n if (attributeOpen && _attributeOpen.test(attributeOpen)) {\n continue;\n }\n }\n\n var end = start + string.slice(start).search(_end);\n var slice = string.slice(start, end);\n // make sure we include well balanced parens\n var parensEnd = -1;\n while (true) {\n var parensMatch = _parens.exec(slice);\n if (!parensMatch) {\n break;\n }\n\n var parensMatchEnd = parensMatch.index + parensMatch[0].length;\n parensEnd = Math.max(parensEnd, parensMatchEnd);\n }\n\n if (parensEnd > -1) {\n slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, '');\n } else {\n slice = slice.replace(_trim, '');\n }\n\n if (slice.length <= match[0].length) {\n // the extract only contains the starting marker of a URI,\n // e.g. \"www\" or \"http://\"\n continue;\n }\n\n if (options.ignore && options.ignore.test(slice)) {\n continue;\n }\n\n end = start + slice.length;\n var result = callback(slice, start, end, string);\n if (result === undefined) {\n _start.lastIndex = end;\n continue;\n }\n\n result = String(result);\n string = string.slice(0, start) + result + string.slice(end);\n _start.lastIndex = start + result.length;\n }\n\n _start.lastIndex = 0;\n return string;\n };\n\n URI.ensureValidHostname = function(v, protocol) {\n // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)\n // they are not part of DNS and therefore ignored by URI.js\n\n var hasHostname = !!v; // not null and not an empty string\n var hasProtocol = !!protocol;\n var rejectEmptyHostname = false;\n\n if (hasProtocol) {\n rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);\n }\n\n if (rejectEmptyHostname && !hasHostname) {\n throw new TypeError('Hostname cannot be empty, if protocol is ' + protocol);\n } else if (v && v.match(URI.invalid_hostname_characters)) {\n // test punycode\n if (!punycode) {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');\n }\n if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_]');\n }\n }\n };\n\n URI.ensureValidPort = function (v) {\n if (!v) {\n return;\n }\n\n var port = Number(v);\n if (isInteger(port) && (port > 0) && (port < 65536)) {\n return;\n }\n\n throw new TypeError('Port \"' + v + '\" is not a valid port');\n };\n\n // noConflict\n URI.noConflict = function(removeAll) {\n if (removeAll) {\n var unconflicted = {\n URI: this.noConflict()\n };\n\n if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {\n unconflicted.URITemplate = root.URITemplate.noConflict();\n }\n\n if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {\n unconflicted.IPv6 = root.IPv6.noConflict();\n }\n\n if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {\n unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();\n }\n\n return unconflicted;\n } else if (root.URI === this) {\n root.URI = _URI;\n }\n\n return this;\n };\n\n p.build = function(deferBuild) {\n if (deferBuild === true) {\n this._deferred_build = true;\n } else if (deferBuild === undefined || this._deferred_build) {\n this._string = URI.build(this._parts);\n this._deferred_build = false;\n }\n\n return this;\n };\n\n p.clone = function() {\n return new URI(this);\n };\n\n p.valueOf = p.toString = function() {\n return this.build(false)._string;\n };\n\n\n function generateSimpleAccessor(_part){\n return function(v, build) {\n if (v === undefined) {\n return this._parts[_part] || '';\n } else {\n this._parts[_part] = v || null;\n this.build(!build);\n return this;\n }\n };\n }\n\n function generatePrefixAccessor(_part, _key){\n return function(v, build) {\n if (v === undefined) {\n return this._parts[_part] || '';\n } else {\n if (v !== null) {\n v = v + '';\n if (v.charAt(0) === _key) {\n v = v.substring(1);\n }\n }\n\n this._parts[_part] = v;\n this.build(!build);\n return this;\n }\n };\n }\n\n p.protocol = generateSimpleAccessor('protocol');\n p.username = generateSimpleAccessor('username');\n p.password = generateSimpleAccessor('password');\n p.hostname = generateSimpleAccessor('hostname');\n p.port = generateSimpleAccessor('port');\n p.query = generatePrefixAccessor('query', '?');\n p.fragment = generatePrefixAccessor('fragment', '#');\n\n p.search = function(v, build) {\n var t = this.query(v, build);\n return typeof t === 'string' && t.length ? ('?' + t) : t;\n };\n p.hash = function(v, build) {\n var t = this.fragment(v, build);\n return typeof t === 'string' && t.length ? ('#' + t) : t;\n };\n\n p.pathname = function(v, build) {\n if (v === undefined || v === true) {\n var res = this._parts.path || (this._parts.hostname ? '/' : '');\n return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;\n } else {\n if (this._parts.urn) {\n this._parts.path = v ? URI.recodeUrnPath(v) : '';\n } else {\n this._parts.path = v ? URI.recodePath(v) : '/';\n }\n this.build(!build);\n return this;\n }\n };\n p.path = p.pathname;\n p.href = function(href, build) {\n var key;\n\n if (href === undefined) {\n return this.toString();\n }\n\n this._string = '';\n this._parts = URI._parts();\n\n var _URI = href instanceof URI;\n var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);\n if (href.nodeName) {\n var attribute = URI.getDomAttribute(href);\n href = href[attribute] || '';\n _object = false;\n }\n\n // window.location is reported to be an object, but it's not the sort\n // of object we're looking for:\n // * location.protocol ends with a colon\n // * location.query != object.search\n // * location.hash != object.fragment\n // simply serializing the unknown object should do the trick\n // (for location, not for everything...)\n if (!_URI && _object && href.pathname !== undefined) {\n href = href.toString();\n }\n\n if (typeof href === 'string' || href instanceof String) {\n this._parts = URI.parse(String(href), this._parts);\n } else if (_URI || _object) {\n var src = _URI ? href._parts : href;\n for (key in src) {\n if (key === 'query') { continue; }\n if (hasOwn.call(this._parts, key)) {\n this._parts[key] = src[key];\n }\n }\n if (src.query) {\n this.query(src.query, false);\n }\n } else {\n throw new TypeError('invalid input');\n }\n\n this.build(!build);\n return this;\n };\n\n // identification accessors\n p.is = function(what) {\n var ip = false;\n var ip4 = false;\n var ip6 = false;\n var name = false;\n var sld = false;\n var idn = false;\n var punycode = false;\n var relative = !this._parts.urn;\n\n if (this._parts.hostname) {\n relative = false;\n ip4 = URI.ip4_expression.test(this._parts.hostname);\n ip6 = URI.ip6_expression.test(this._parts.hostname);\n ip = ip4 || ip6;\n name = !ip;\n sld = name && SLD && SLD.has(this._parts.hostname);\n idn = name && URI.idn_expression.test(this._parts.hostname);\n punycode = name && URI.punycode_expression.test(this._parts.hostname);\n }\n\n switch (what.toLowerCase()) {\n case 'relative':\n return relative;\n\n case 'absolute':\n return !relative;\n\n // hostname identification\n case 'domain':\n case 'name':\n return name;\n\n case 'sld':\n return sld;\n\n case 'ip':\n return ip;\n\n case 'ip4':\n case 'ipv4':\n case 'inet4':\n return ip4;\n\n case 'ip6':\n case 'ipv6':\n case 'inet6':\n return ip6;\n\n case 'idn':\n return idn;\n\n case 'url':\n return !this._parts.urn;\n\n case 'urn':\n return !!this._parts.urn;\n\n case 'punycode':\n return punycode;\n }\n\n return null;\n };\n\n // component specific input validation\n var _protocol = p.protocol;\n var _port = p.port;\n var _hostname = p.hostname;\n\n p.protocol = function(v, build) {\n if (v) {\n // accept trailing ://\n v = v.replace(/:(\\/\\/)?$/, '');\n\n if (!v.match(URI.protocol_expression)) {\n throw new TypeError('Protocol \"' + v + '\" contains characters other than [A-Z0-9.+-] or doesn\\'t start with [A-Z]');\n }\n }\n\n return _protocol.call(this, v, build);\n };\n p.scheme = p.protocol;\n p.port = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v !== undefined) {\n if (v === 0) {\n v = null;\n }\n\n if (v) {\n v += '';\n if (v.charAt(0) === ':') {\n v = v.substring(1);\n }\n\n URI.ensureValidPort(v);\n }\n }\n return _port.call(this, v, build);\n };\n p.hostname = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v !== undefined) {\n var x = { preventInvalidHostname: this._parts.preventInvalidHostname };\n var res = URI.parseHost(v, x);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n v = x.hostname;\n if (this._parts.preventInvalidHostname) {\n URI.ensureValidHostname(v, this._parts.protocol);\n }\n }\n\n return _hostname.call(this, v, build);\n };\n\n // compound accessors\n p.origin = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n var protocol = this.protocol();\n var authority = this.authority();\n if (!authority) {\n return '';\n }\n\n return (protocol ? protocol + '://' : '') + this.authority();\n } else {\n var origin = URI(v);\n this\n .protocol(origin.protocol())\n .authority(origin.authority())\n .build(!build);\n return this;\n }\n };\n p.host = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n return this._parts.hostname ? URI.buildHost(this._parts) : '';\n } else {\n var res = URI.parseHost(v, this._parts);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n this.build(!build);\n return this;\n }\n };\n p.authority = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n return this._parts.hostname ? URI.buildAuthority(this._parts) : '';\n } else {\n var res = URI.parseAuthority(v, this._parts);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n this.build(!build);\n return this;\n }\n };\n p.userinfo = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n var t = URI.buildUserinfo(this._parts);\n return t ? t.substring(0, t.length -1) : t;\n } else {\n if (v[v.length-1] !== '@') {\n v += '@';\n }\n\n URI.parseUserinfo(v, this._parts);\n this.build(!build);\n return this;\n }\n };\n p.resource = function(v, build) {\n var parts;\n\n if (v === undefined) {\n return this.path() + this.search() + this.hash();\n }\n\n parts = URI.parse(v);\n this._parts.path = parts.path;\n this._parts.query = parts.query;\n this._parts.fragment = parts.fragment;\n this.build(!build);\n return this;\n };\n\n // fraction accessors\n p.subdomain = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n // convenience, return \"www\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n // grab domain and add another segment\n var end = this._parts.hostname.length - this.domain().length - 1;\n return this._parts.hostname.substring(0, end) || '';\n } else {\n var e = this._parts.hostname.length - this.domain().length;\n var sub = this._parts.hostname.substring(0, e);\n var replace = new RegExp('^' + escapeRegEx(sub));\n\n if (v && v.charAt(v.length - 1) !== '.') {\n v += '.';\n }\n\n if (v.indexOf(':') !== -1) {\n throw new TypeError('Domains cannot contain colons');\n }\n\n if (v) {\n URI.ensureValidHostname(v, this._parts.protocol);\n }\n\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.domain = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v === 'boolean') {\n build = v;\n v = undefined;\n }\n\n // convenience, return \"example.org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n // if hostname consists of 1 or 2 segments, it must be the domain\n var t = this._parts.hostname.match(/\\./g);\n if (t && t.length < 2) {\n return this._parts.hostname;\n }\n\n // grab tld and add another segment\n var end = this._parts.hostname.length - this.tld(build).length - 1;\n end = this._parts.hostname.lastIndexOf('.', end -1) + 1;\n return this._parts.hostname.substring(end) || '';\n } else {\n if (!v) {\n throw new TypeError('cannot set domain empty');\n }\n\n if (v.indexOf(':') !== -1) {\n throw new TypeError('Domains cannot contain colons');\n }\n\n URI.ensureValidHostname(v, this._parts.protocol);\n\n if (!this._parts.hostname || this.is('IP')) {\n this._parts.hostname = v;\n } else {\n var replace = new RegExp(escapeRegEx(this.domain()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.tld = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v === 'boolean') {\n build = v;\n v = undefined;\n }\n\n // return \"org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n var pos = this._parts.hostname.lastIndexOf('.');\n var tld = this._parts.hostname.substring(pos + 1);\n\n if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {\n return SLD.get(this._parts.hostname) || tld;\n }\n\n return tld;\n } else {\n var replace;\n\n if (!v) {\n throw new TypeError('cannot set TLD empty');\n } else if (v.match(/[^a-zA-Z0-9-]/)) {\n if (SLD && SLD.is(v)) {\n replace = new RegExp(escapeRegEx(this.tld()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n } else {\n throw new TypeError('TLD \"' + v + '\" contains characters other than [A-Z0-9]');\n }\n } else if (!this._parts.hostname || this.is('IP')) {\n throw new ReferenceError('cannot set TLD on non-domain host');\n } else {\n replace = new RegExp(escapeRegEx(this.tld()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.directory = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined || v === true) {\n if (!this._parts.path && !this._parts.hostname) {\n return '';\n }\n\n if (this._parts.path === '/') {\n return '/';\n }\n\n var end = this._parts.path.length - this.filename().length - 1;\n var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');\n\n return v ? URI.decodePath(res) : res;\n\n } else {\n var e = this._parts.path.length - this.filename().length;\n var directory = this._parts.path.substring(0, e);\n var replace = new RegExp('^' + escapeRegEx(directory));\n\n // fully qualifier directories begin with a slash\n if (!this.is('relative')) {\n if (!v) {\n v = '/';\n }\n\n if (v.charAt(0) !== '/') {\n v = '/' + v;\n }\n }\n\n // directories always end with a slash\n if (v && v.charAt(v.length - 1) !== '/') {\n v += '/';\n }\n\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.filename = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v !== 'string') {\n if (!this._parts.path || this._parts.path === '/') {\n return '';\n }\n\n var pos = this._parts.path.lastIndexOf('/');\n var res = this._parts.path.substring(pos+1);\n\n return v ? URI.decodePathSegment(res) : res;\n } else {\n var mutatedDirectory = false;\n\n if (v.charAt(0) === '/') {\n v = v.substring(1);\n }\n\n if (v.match(/\\.?\\//)) {\n mutatedDirectory = true;\n }\n\n var replace = new RegExp(escapeRegEx(this.filename()) + '$');\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n\n if (mutatedDirectory) {\n this.normalizePath(build);\n } else {\n this.build(!build);\n }\n\n return this;\n }\n };\n p.suffix = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined || v === true) {\n if (!this._parts.path || this._parts.path === '/') {\n return '';\n }\n\n var filename = this.filename();\n var pos = filename.lastIndexOf('.');\n var s, res;\n\n if (pos === -1) {\n return '';\n }\n\n // suffix may only contain alnum characters (yup, I made this up.)\n s = filename.substring(pos+1);\n res = (/^[a-z0-9%]+$/i).test(s) ? s : '';\n return v ? URI.decodePathSegment(res) : res;\n } else {\n if (v.charAt(0) === '.') {\n v = v.substring(1);\n }\n\n var suffix = this.suffix();\n var replace;\n\n if (!suffix) {\n if (!v) {\n return this;\n }\n\n this._parts.path += '.' + URI.recodePath(v);\n } else if (!v) {\n replace = new RegExp(escapeRegEx('.' + suffix) + '$');\n } else {\n replace = new RegExp(escapeRegEx(suffix) + '$');\n }\n\n if (replace) {\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.segment = function(segment, v, build) {\n var separator = this._parts.urn ? ':' : '/';\n var path = this.path();\n var absolute = path.substring(0, 1) === '/';\n var segments = path.split(separator);\n\n if (segment !== undefined && typeof segment !== 'number') {\n build = v;\n v = segment;\n segment = undefined;\n }\n\n if (segment !== undefined && typeof segment !== 'number') {\n throw new Error('Bad segment \"' + segment + '\", must be 0-based integer');\n }\n\n if (absolute) {\n segments.shift();\n }\n\n if (segment < 0) {\n // allow negative indexes to address from the end\n segment = Math.max(segments.length + segment, 0);\n }\n\n if (v === undefined) {\n /*jshint laxbreak: true */\n return segment === undefined\n ? segments\n : segments[segment];\n /*jshint laxbreak: false */\n } else if (segment === null || segments[segment] === undefined) {\n if (isArray(v)) {\n segments = [];\n // collapse empty elements within array\n for (var i=0, l=v.length; i < l; i++) {\n if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {\n continue;\n }\n\n if (segments.length && !segments[segments.length -1].length) {\n segments.pop();\n }\n\n segments.push(trimSlashes(v[i]));\n }\n } else if (v || typeof v === 'string') {\n v = trimSlashes(v);\n if (segments[segments.length -1] === '') {\n // empty trailing elements have to be overwritten\n // to prevent results such as /foo//bar\n segments[segments.length -1] = v;\n } else {\n segments.push(v);\n }\n }\n } else {\n if (v) {\n segments[segment] = trimSlashes(v);\n } else {\n segments.splice(segment, 1);\n }\n }\n\n if (absolute) {\n segments.unshift('');\n }\n\n return this.path(segments.join(separator), build);\n };\n p.segmentCoded = function(segment, v, build) {\n var segments, i, l;\n\n if (typeof segment !== 'number') {\n build = v;\n v = segment;\n segment = undefined;\n }\n\n if (v === undefined) {\n segments = this.segment(segment, v, build);\n if (!isArray(segments)) {\n segments = segments !== undefined ? URI.decode(segments) : undefined;\n } else {\n for (i = 0, l = segments.length; i < l; i++) {\n segments[i] = URI.decode(segments[i]);\n }\n }\n\n return segments;\n }\n\n if (!isArray(v)) {\n v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;\n } else {\n for (i = 0, l = v.length; i < l; i++) {\n v[i] = URI.encode(v[i]);\n }\n }\n\n return this.segment(segment, v, build);\n };\n\n // mutating query string\n var q = p.query;\n p.query = function(v, build) {\n if (v === true) {\n return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n } else if (typeof v === 'function') {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n var result = v.call(this, data);\n this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else if (v !== undefined && typeof v !== 'string') {\n this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else {\n return q.call(this, v, build);\n }\n };\n p.setQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n\n if (typeof name === 'string' || name instanceof String) {\n data[name] = value !== undefined ? value : null;\n } else if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n data[key] = name[key];\n }\n }\n } else {\n throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n }\n\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.addQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.addQuery(data, name, value === undefined ? null : value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.removeQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.removeQuery(data, name, value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.hasQuery = function(name, value, withinArray) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n return URI.hasQuery(data, name, value, withinArray);\n };\n p.setSearch = p.setQuery;\n p.addSearch = p.addQuery;\n p.removeSearch = p.removeQuery;\n p.hasSearch = p.hasQuery;\n\n // sanitizing URLs\n p.normalize = function() {\n if (this._parts.urn) {\n return this\n .normalizeProtocol(false)\n .normalizePath(false)\n .normalizeQuery(false)\n .normalizeFragment(false)\n .build();\n }\n\n return this\n .normalizeProtocol(false)\n .normalizeHostname(false)\n .normalizePort(false)\n .normalizePath(false)\n .normalizeQuery(false)\n .normalizeFragment(false)\n .build();\n };\n p.normalizeProtocol = function(build) {\n if (typeof this._parts.protocol === 'string') {\n this._parts.protocol = this._parts.protocol.toLowerCase();\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeHostname = function(build) {\n if (this._parts.hostname) {\n if (this.is('IDN') && punycode) {\n this._parts.hostname = punycode.toASCII(this._parts.hostname);\n } else if (this.is('IPv6') && IPv6) {\n this._parts.hostname = IPv6.best(this._parts.hostname);\n }\n\n this._parts.hostname = this._parts.hostname.toLowerCase();\n this.build(!build);\n }\n\n return this;\n };\n p.normalizePort = function(build) {\n // remove port of it's the protocol's default\n if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {\n this._parts.port = null;\n this.build(!build);\n }\n\n return this;\n };\n p.normalizePath = function(build) {\n var _path = this._parts.path;\n if (!_path) {\n return this;\n }\n\n if (this._parts.urn) {\n this._parts.path = URI.recodeUrnPath(this._parts.path);\n this.build(!build);\n return this;\n }\n\n if (this._parts.path === '/') {\n return this;\n }\n\n _path = URI.recodePath(_path);\n\n var _was_relative;\n var _leadingParents = '';\n var _parent, _pos;\n\n // handle relative paths\n if (_path.charAt(0) !== '/') {\n _was_relative = true;\n _path = '/' + _path;\n }\n\n // handle relative files (as opposed to directories)\n if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {\n _path += '/';\n }\n\n // resolve simples\n _path = _path\n .replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/')\n .replace(/\\/{2,}/g, '/');\n\n // remember leading parents\n if (_was_relative) {\n _leadingParents = _path.substring(1).match(/^(\\.\\.\\/)+/) || '';\n if (_leadingParents) {\n _leadingParents = _leadingParents[0];\n }\n }\n\n // resolve parents\n while (true) {\n _parent = _path.search(/\\/\\.\\.(\\/|$)/);\n if (_parent === -1) {\n // no more ../ to resolve\n break;\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n _path = _path.substring(3);\n continue;\n }\n\n _pos = _path.substring(0, _parent).lastIndexOf('/');\n if (_pos === -1) {\n _pos = _parent;\n }\n _path = _path.substring(0, _pos) + _path.substring(_parent + 3);\n }\n\n // revert to relative\n if (_was_relative && this.is('relative')) {\n _path = _leadingParents + _path.substring(1);\n }\n\n this._parts.path = _path;\n this.build(!build);\n return this;\n };\n p.normalizePathname = p.normalizePath;\n p.normalizeQuery = function(build) {\n if (typeof this._parts.query === 'string') {\n if (!this._parts.query.length) {\n this._parts.query = null;\n } else {\n this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));\n }\n\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeFragment = function(build) {\n if (!this._parts.fragment) {\n this._parts.fragment = null;\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeSearch = p.normalizeQuery;\n p.normalizeHash = p.normalizeFragment;\n\n p.iso8859 = function() {\n // expect unicode input, iso8859 output\n var e = URI.encode;\n var d = URI.decode;\n\n URI.encode = escape;\n URI.decode = decodeURIComponent;\n try {\n this.normalize();\n } finally {\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n\n p.unicode = function() {\n // expect iso8859 input, unicode output\n var e = URI.encode;\n var d = URI.decode;\n\n URI.encode = strictEncodeURIComponent;\n URI.decode = unescape;\n try {\n this.normalize();\n } finally {\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n\n p.readable = function() {\n var uri = this.clone();\n // removing username, password, because they shouldn't be displayed according to RFC 3986\n uri.username('').password('').normalize();\n var t = '';\n if (uri._parts.protocol) {\n t += uri._parts.protocol + '://';\n }\n\n if (uri._parts.hostname) {\n if (uri.is('punycode') && punycode) {\n t += punycode.toUnicode(uri._parts.hostname);\n if (uri._parts.port) {\n t += ':' + uri._parts.port;\n }\n } else {\n t += uri.host();\n }\n }\n\n if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {\n t += '/';\n }\n\n t += uri.path(true);\n if (uri._parts.query) {\n var q = '';\n for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {\n var kv = (qp[i] || '').split('=');\n q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)\n .replace(/&/g, '%26');\n\n if (kv[1] !== undefined) {\n q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)\n .replace(/&/g, '%26');\n }\n }\n t += '?' + q.substring(1);\n }\n\n t += URI.decodeQuery(uri.hash(), true);\n return t;\n };\n\n // resolving relative and absolute URLs\n p.absoluteTo = function(base) {\n var resolved = this.clone();\n var properties = ['protocol', 'username', 'password', 'hostname', 'port'];\n var basedir, i, p;\n\n if (this._parts.urn) {\n throw new Error('URNs do not have any generally defined hierarchical components');\n }\n\n if (!(base instanceof URI)) {\n base = new URI(base);\n }\n\n if (resolved._parts.protocol) {\n // Directly returns even if this._parts.hostname is empty.\n return resolved;\n } else {\n resolved._parts.protocol = base._parts.protocol;\n }\n\n if (this._parts.hostname) {\n return resolved;\n }\n\n for (i = 0; (p = properties[i]); i++) {\n resolved._parts[p] = base._parts[p];\n }\n\n if (!resolved._parts.path) {\n resolved._parts.path = base._parts.path;\n if (!resolved._parts.query) {\n resolved._parts.query = base._parts.query;\n }\n } else {\n if (resolved._parts.path.substring(-2) === '..') {\n resolved._parts.path += '/';\n }\n\n if (resolved.path().charAt(0) !== '/') {\n basedir = base.directory();\n basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';\n resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;\n resolved.normalizePath();\n }\n }\n\n resolved.build();\n return resolved;\n };\n p.relativeTo = function(base) {\n var relative = this.clone().normalize();\n var relativeParts, baseParts, common, relativePath, basePath;\n\n if (relative._parts.urn) {\n throw new Error('URNs do not have any generally defined hierarchical components');\n }\n\n base = new URI(base).normalize();\n relativeParts = relative._parts;\n baseParts = base._parts;\n relativePath = relative.path();\n basePath = base.path();\n\n if (relativePath.charAt(0) !== '/') {\n throw new Error('URI is already relative');\n }\n\n if (basePath.charAt(0) !== '/') {\n throw new Error('Cannot calculate a URI relative to another relative URI');\n }\n\n if (relativeParts.protocol === baseParts.protocol) {\n relativeParts.protocol = null;\n }\n\n if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {\n return relative.build();\n }\n\n if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {\n return relative.build();\n }\n\n if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {\n relativeParts.hostname = null;\n relativeParts.port = null;\n } else {\n return relative.build();\n }\n\n if (relativePath === basePath) {\n relativeParts.path = '';\n return relative.build();\n }\n\n // determine common sub path\n common = URI.commonPath(relativePath, basePath);\n\n // If the paths have nothing in common, return a relative URL with the absolute path.\n if (!common) {\n return relative.build();\n }\n\n var parents = baseParts.path\n .substring(common.length)\n .replace(/[^\\/]*$/, '')\n .replace(/.*?\\//g, '../');\n\n relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';\n\n return relative.build();\n };\n\n // comparing URIs\n p.equals = function(uri) {\n var one = this.clone();\n var two = new URI(uri);\n var one_map = {};\n var two_map = {};\n var checked = {};\n var one_query, two_query, key;\n\n one.normalize();\n two.normalize();\n\n // exact match\n if (one.toString() === two.toString()) {\n return true;\n }\n\n // extract query string\n one_query = one.query();\n two_query = two.query();\n one.query('');\n two.query('');\n\n // definitely not equal if not even non-query parts match\n if (one.toString() !== two.toString()) {\n return false;\n }\n\n // query parameters have the same length, even if they're permuted\n if (one_query.length !== two_query.length) {\n return false;\n }\n\n one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);\n two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);\n\n for (key in one_map) {\n if (hasOwn.call(one_map, key)) {\n if (!isArray(one_map[key])) {\n if (one_map[key] !== two_map[key]) {\n return false;\n }\n } else if (!arraysEqual(one_map[key], two_map[key])) {\n return false;\n }\n\n checked[key] = true;\n }\n }\n\n for (key in two_map) {\n if (hasOwn.call(two_map, key)) {\n if (!checked[key]) {\n // two contains a parameter not present in one\n return false;\n }\n }\n }\n\n return true;\n };\n\n // state\n p.preventInvalidHostname = function(v) {\n this._parts.preventInvalidHostname = !!v;\n return this;\n };\n\n p.duplicateQueryParameters = function(v) {\n this._parts.duplicateQueryParameters = !!v;\n return this;\n };\n\n p.escapeQuerySpace = function(v) {\n this._parts.escapeQuerySpace = !!v;\n return this;\n };\n\n return URI;\n}));\n", "const {\n hasOwnProperty,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!apply) {\n apply = function (fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\n\nif (!freeze) {\n freeze = function (x) {\n return x;\n };\n}\n\nif (!seal) {\n seal = function (x) {\n return x;\n };\n}\n\nif (!construct) {\n construct = function (Func, args) {\n return new Func(...args);\n };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\nexport function unapply(func) {\n return (thisArg, ...args) => apply(func, thisArg, args);\n}\n\nexport function unconstruct(func) {\n return (...args) => construct(func, args);\n}\n\n/* Add properties to a lookup table */\nexport function addToSet(set, array, transformCaseFunc) {\n transformCaseFunc = transformCaseFunc ?? stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n}\n\n/* Shallow clone an object */\nexport function clone(object) {\n const newObject = create(null);\n\n let property;\n for (property in object) {\n if (apply(hasOwnProperty, object, [property]) === true) {\n newObject[property] = object[property];\n }\n }\n\n return newObject;\n}\n\n/* IE10 doesn't support __lookupGetter__ so lets'\n * simulate it. It also automatically checks\n * if the prop is function or getter and behaves\n * accordingly. */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n}\n\nexport {\n // Array\n arrayForEach,\n arrayIndexOf,\n arrayPop,\n arrayPush,\n arraySlice,\n // Object\n freeze,\n getPrototypeOf,\n getOwnPropertyDescriptor,\n hasOwnProperty,\n isFrozen,\n setPrototypeOf,\n seal,\n // RegExp\n regExpTest,\n // String\n stringIndexOf,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringTrim,\n // Errors\n typeErrorCreate,\n // Other\n lookupGetter,\n};\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'a',\n 'abbr',\n 'acronym',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'big',\n 'blink',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'content',\n 'data',\n 'datalist',\n 'dd',\n 'decorator',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'element',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'marquee',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'nobr',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'shadow',\n 'small',\n 'source',\n 'spacer',\n 'span',\n 'strike',\n 'strong',\n 'style',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'template',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\n\n// SVG\nexport const svg = freeze([\n 'svg',\n 'a',\n 'altglyph',\n 'altglyphdef',\n 'altglyphitem',\n 'animatecolor',\n 'animatemotion',\n 'animatetransform',\n 'circle',\n 'clippath',\n 'defs',\n 'desc',\n 'ellipse',\n 'filter',\n 'font',\n 'g',\n 'glyph',\n 'glyphref',\n 'hkern',\n 'image',\n 'line',\n 'lineargradient',\n 'marker',\n 'mask',\n 'metadata',\n 'mpath',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialgradient',\n 'rect',\n 'stop',\n 'style',\n 'switch',\n 'symbol',\n 'text',\n 'textpath',\n 'title',\n 'tref',\n 'tspan',\n 'view',\n 'vkern',\n]);\n\nexport const svgFilters = freeze([\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDistantLight',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussianBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n]);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n 'animate',\n 'color-profile',\n 'cursor',\n 'discard',\n 'fedropshadow',\n 'font-face',\n 'font-face-format',\n 'font-face-name',\n 'font-face-src',\n 'font-face-uri',\n 'foreignobject',\n 'hatch',\n 'hatchpath',\n 'mesh',\n 'meshgradient',\n 'meshpatch',\n 'meshrow',\n 'missing-glyph',\n 'script',\n 'set',\n 'solidcolor',\n 'unknown',\n 'use',\n]);\n\nexport const mathMl = freeze([\n 'math',\n 'menclose',\n 'merror',\n 'mfenced',\n 'mfrac',\n 'mglyph',\n 'mi',\n 'mlabeledtr',\n 'mmultiscripts',\n 'mn',\n 'mo',\n 'mover',\n 'mpadded',\n 'mphantom',\n 'mroot',\n 'mrow',\n 'ms',\n 'mspace',\n 'msqrt',\n 'mstyle',\n 'msub',\n 'msup',\n 'msubsup',\n 'mtable',\n 'mtd',\n 'mtext',\n 'mtr',\n 'munder',\n 'munderover',\n]);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n 'maction',\n 'maligngroup',\n 'malignmark',\n 'mlongdiv',\n 'mscarries',\n 'mscarry',\n 'msgroup',\n 'mstack',\n 'msline',\n 'msrow',\n 'semantics',\n 'annotation',\n 'annotation-xml',\n 'mprescripts',\n 'none',\n]);\n\nexport const text = freeze(['#text']);\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n 'accept',\n 'action',\n 'align',\n 'alt',\n 'autocapitalize',\n 'autocomplete',\n 'autopictureinpicture',\n 'autoplay',\n 'background',\n 'bgcolor',\n 'border',\n 'capture',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'cite',\n 'class',\n 'clear',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'controlslist',\n 'coords',\n 'crossorigin',\n 'datetime',\n 'decoding',\n 'default',\n 'dir',\n 'disabled',\n 'disablepictureinpicture',\n 'disableremoteplayback',\n 'download',\n 'draggable',\n 'enctype',\n 'enterkeyhint',\n 'face',\n 'for',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'id',\n 'inputmode',\n 'integrity',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'loading',\n 'loop',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'method',\n 'min',\n 'minlength',\n 'multiple',\n 'muted',\n 'name',\n 'nonce',\n 'noshade',\n 'novalidate',\n 'nowrap',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'playsinline',\n 'poster',\n 'preload',\n 'pubdate',\n 'radiogroup',\n 'readonly',\n 'rel',\n 'required',\n 'rev',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'spellcheck',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'srclang',\n 'start',\n 'src',\n 'srcset',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'xmlns',\n 'slot',\n]);\n\nexport const svg = freeze([\n 'accent-height',\n 'accumulate',\n 'additive',\n 'alignment-baseline',\n 'ascent',\n 'attributename',\n 'attributetype',\n 'azimuth',\n 'basefrequency',\n 'baseline-shift',\n 'begin',\n 'bias',\n 'by',\n 'class',\n 'clip',\n 'clippathunits',\n 'clip-path',\n 'clip-rule',\n 'color',\n 'color-interpolation',\n 'color-interpolation-filters',\n 'color-profile',\n 'color-rendering',\n 'cx',\n 'cy',\n 'd',\n 'dx',\n 'dy',\n 'diffuseconstant',\n 'direction',\n 'display',\n 'divisor',\n 'dur',\n 'edgemode',\n 'elevation',\n 'end',\n 'fill',\n 'fill-opacity',\n 'fill-rule',\n 'filter',\n 'filterunits',\n 'flood-color',\n 'flood-opacity',\n 'font-family',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'fx',\n 'fy',\n 'g1',\n 'g2',\n 'glyph-name',\n 'glyphref',\n 'gradientunits',\n 'gradienttransform',\n 'height',\n 'href',\n 'id',\n 'image-rendering',\n 'in',\n 'in2',\n 'k',\n 'k1',\n 'k2',\n 'k3',\n 'k4',\n 'kerning',\n 'keypoints',\n 'keysplines',\n 'keytimes',\n 'lang',\n 'lengthadjust',\n 'letter-spacing',\n 'kernelmatrix',\n 'kernelunitlength',\n 'lighting-color',\n 'local',\n 'marker-end',\n 'marker-mid',\n 'marker-start',\n 'markerheight',\n 'markerunits',\n 'markerwidth',\n 'maskcontentunits',\n 'maskunits',\n 'max',\n 'mask',\n 'media',\n 'method',\n 'mode',\n 'min',\n 'name',\n 'numoctaves',\n 'offset',\n 'operator',\n 'opacity',\n 'order',\n 'orient',\n 'orientation',\n 'origin',\n 'overflow',\n 'paint-order',\n 'path',\n 'pathlength',\n 'patterncontentunits',\n 'patterntransform',\n 'patternunits',\n 'points',\n 'preservealpha',\n 'preserveaspectratio',\n 'primitiveunits',\n 'r',\n 'rx',\n 'ry',\n 'radius',\n 'refx',\n 'refy',\n 'repeatcount',\n 'repeatdur',\n 'restart',\n 'result',\n 'rotate',\n 'scale',\n 'seed',\n 'shape-rendering',\n 'specularconstant',\n 'specularexponent',\n 'spreadmethod',\n 'startoffset',\n 'stddeviation',\n 'stitchtiles',\n 'stop-color',\n 'stop-opacity',\n 'stroke-dasharray',\n 'stroke-dashoffset',\n 'stroke-linecap',\n 'stroke-linejoin',\n 'stroke-miterlimit',\n 'stroke-opacity',\n 'stroke',\n 'stroke-width',\n 'style',\n 'surfacescale',\n 'systemlanguage',\n 'tabindex',\n 'targetx',\n 'targety',\n 'transform',\n 'transform-origin',\n 'text-anchor',\n 'text-decoration',\n 'text-rendering',\n 'textlength',\n 'type',\n 'u1',\n 'u2',\n 'unicode',\n 'values',\n 'viewbox',\n 'visibility',\n 'version',\n 'vert-adv-y',\n 'vert-origin-x',\n 'vert-origin-y',\n 'width',\n 'word-spacing',\n 'wrap',\n 'writing-mode',\n 'xchannelselector',\n 'ychannelselector',\n 'x',\n 'x1',\n 'x2',\n 'xmlns',\n 'y',\n 'y1',\n 'y2',\n 'z',\n 'zoomandpan',\n]);\n\nexport const mathMl = freeze([\n 'accent',\n 'accentunder',\n 'align',\n 'bevelled',\n 'close',\n 'columnsalign',\n 'columnlines',\n 'columnspan',\n 'denomalign',\n 'depth',\n 'dir',\n 'display',\n 'displaystyle',\n 'encoding',\n 'fence',\n 'frame',\n 'height',\n 'href',\n 'id',\n 'largeop',\n 'length',\n 'linethickness',\n 'lspace',\n 'lquote',\n 'mathbackground',\n 'mathcolor',\n 'mathsize',\n 'mathvariant',\n 'maxsize',\n 'minsize',\n 'movablelimits',\n 'notation',\n 'numalign',\n 'open',\n 'rowalign',\n 'rowlines',\n 'rowspacing',\n 'rowspan',\n 'rspace',\n 'rquote',\n 'scriptlevel',\n 'scriptminsize',\n 'scriptsizemultiplier',\n 'selection',\n 'separator',\n 'separators',\n 'stretchy',\n 'subscriptshift',\n 'supscriptshift',\n 'symmetric',\n 'voffset',\n 'width',\n 'xmlns',\n]);\n\nexport const xml = freeze([\n 'xlink:href',\n 'xml:id',\n 'xlink:title',\n 'xml:space',\n 'xmlns:xlink',\n]);\n", "import { seal } from './utils.js';\n\n// eslint-disable-next-line unicorn/better-regex\nexport const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n", "import * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n addToSet,\n clone,\n freeze,\n arrayForEach,\n arrayPop,\n arrayPush,\n stringMatch,\n stringReplace,\n stringToLowerCase,\n stringToString,\n stringIndexOf,\n stringTrim,\n regExpTest,\n typeErrorCreate,\n lookupGetter,\n} from './utils.js';\n\nconst getGlobal = () => (typeof window === 'undefined' ? null : window);\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {Document} document The document object (to determine policy name suffix)\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported).\n */\nconst _createTrustedTypesPolicy = function (trustedTypes, document) {\n if (\n typeof trustedTypes !== 'object' ||\n typeof trustedTypes.createPolicy !== 'function'\n ) {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (\n document.currentScript &&\n document.currentScript.hasAttribute(ATTR_NAME)\n ) {\n suffix = document.currentScript.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n },\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn(\n 'TrustedTypes policy ' + policyName + ' could not be created.'\n );\n return null;\n }\n};\n\nfunction createDOMPurify(window = getGlobal()) {\n const DOMPurify = (root) => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = VERSION;\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n const originalDocument = window.document;\n\n let { document } = window;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes,\n } = window;\n\n const ElementPrototype = Element.prototype;\n\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n const trustedTypesPolicy = _createTrustedTypesPolicy(\n trustedTypes,\n originalDocument\n );\n const emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';\n\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName,\n } = document;\n const { importNode } = originalDocument;\n\n let documentMode = {};\n try {\n documentMode = clone(document).documentMode ? document.documentMode : {};\n } catch (_) {}\n\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported =\n typeof getParentNode === 'function' &&\n implementation &&\n implementation.createHTMLDocument !== undefined &&\n documentMode !== 9;\n\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT,\n } = EXPRESSIONS;\n\n let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n ...TAGS.html,\n ...TAGS.svg,\n ...TAGS.svgFilters,\n ...TAGS.mathMl,\n ...TAGS.text,\n ]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n ...ATTRS.html,\n ...ATTRS.svg,\n ...ATTRS.mathMl,\n ...ATTRS.xml,\n ]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(\n Object.create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null,\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false,\n },\n })\n );\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n 'annotation-xml',\n 'audio',\n 'colgroup',\n 'desc',\n 'foreignobject',\n 'head',\n 'iframe',\n 'math',\n 'mi',\n 'mn',\n 'mo',\n 'ms',\n 'mtext',\n 'noembed',\n 'noframes',\n 'noscript',\n 'plaintext',\n 'script',\n 'style',\n 'svg',\n 'template',\n 'thead',\n 'title',\n 'video',\n 'xmp',\n ]);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n 'audio',\n 'video',\n 'img',\n 'source',\n 'image',\n 'track',\n ]);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n 'alt',\n 'class',\n 'for',\n 'id',\n 'label',\n 'name',\n 'pattern',\n 'placeholder',\n 'role',\n 'summary',\n 'title',\n 'value',\n 'style',\n 'xmlns',\n ]);\n\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n {},\n [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n stringToString\n );\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function (testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function (cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n ? (PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE)\n : (PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE);\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc =\n PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n ? stringToString\n : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS =\n 'ALLOWED_TAGS' in cfg\n ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc)\n : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR =\n 'ALLOWED_ATTR' in cfg\n ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc)\n : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES =\n 'ALLOWED_NAMESPACES' in cfg\n ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString)\n : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES =\n 'ADD_URI_SAFE_ATTR' in cfg\n ? addToSet(\n clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS =\n 'ADD_DATA_URI_TAGS' in cfg\n ? addToSet(\n clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS =\n 'FORBID_CONTENTS' in cfg\n ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc)\n : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS =\n 'FORBID_TAGS' in cfg\n ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc)\n : {};\n FORBID_ATTR =\n 'FORBID_ATTR' in cfg\n ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc)\n : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)\n ) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (\n cfg.CUSTOM_ELEMENT_HANDLING &&\n typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements ===\n 'boolean'\n ) {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [...TAGS.text]);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, TAGS.html);\n addToSet(ALLOWED_ATTR, ATTRS.html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, TAGS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n addToSet(ALLOWED_ATTR, ATTRS.svg);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, TAGS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n addToSet(ALLOWED_ATTR, ATTRS.xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [\n 'mi',\n 'mo',\n 'mn',\n 'ms',\n 'mtext',\n ]);\n\n const HTML_INTEGRATION_POINTS = addToSet({}, [\n 'foreignobject',\n 'annotation-xml',\n ]);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n 'title',\n 'style',\n 'font',\n 'a',\n 'script',\n ]);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, TAGS.svg);\n addToSet(ALL_SVG_TAGS, TAGS.svgFilters);\n addToSet(ALL_SVG_TAGS, TAGS.svgDisallowed);\n\n const ALL_MATHML_TAGS = addToSet({}, TAGS.mathMl);\n addToSet(ALL_MATHML_TAGS, TAGS.mathMlDisallowed);\n\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function (element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template',\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return (\n tagName === 'svg' &&\n (parentTagName === 'annotation-xml' ||\n MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n );\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (\n parent.namespaceURI === SVG_NAMESPACE &&\n !HTML_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n if (\n parent.namespaceURI === MATHML_NAMESPACE &&\n !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n ) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return (\n !ALL_MATHML_TAGS[tagName] &&\n (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n );\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n ALLOWED_NAMESPACES[element.namespaceURI]\n ) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function (node) {\n arrayPush(DOMPurify.removed, { element: node });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n try {\n node.outerHTML = emptyHTML;\n } catch (_) {\n node.remove();\n }\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function (name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node,\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node,\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function (dirty) {\n /* Create a HTML document */\n let doc;\n let leadingWhitespace;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (\n PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n NAMESPACE === HTML_NAMESPACE\n ) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty =\n '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' +\n dirty +\n '</body></html>';\n }\n\n const dirtyPayload = trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT\n ? emptyHTML\n : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(\n document.createTextNode(leadingWhitespace),\n body.childNodes[0] || null\n );\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(\n doc,\n WHOLE_DOCUMENT ? 'html' : 'body'\n )[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n const _createIterator = function (root) {\n return createNodeIterator.call(\n root.ownerDocument || root,\n root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT |\n NodeFilter.SHOW_COMMENT |\n NodeFilter.SHOW_TEXT |\n NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n NodeFilter.SHOW_CDATA_SECTION,\n null,\n false\n );\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function (elm) {\n return (\n elm instanceof HTMLFormElement &&\n (typeof elm.nodeName !== 'string' ||\n typeof elm.textContent !== 'string' ||\n typeof elm.removeChild !== 'function' ||\n !(elm.attributes instanceof NamedNodeMap) ||\n typeof elm.removeAttribute !== 'function' ||\n typeof elm.setAttribute !== 'function' ||\n typeof elm.namespaceURI !== 'string' ||\n typeof elm.insertBefore !== 'function' ||\n typeof elm.hasChildNodes !== 'function')\n );\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function (object) {\n return typeof Node === 'object'\n ? object instanceof Node\n : object &&\n typeof object === 'object' &&\n typeof object.nodeType === 'number' &&\n typeof object.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function (entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], (hook) => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function (currentNode) {\n let content;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check if tagname contains Unicode */\n if (regExpTest(/[\\u0080-\\uFFFF]/, currentNode.nodeName)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS,\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (\n currentNode.hasChildNodes() &&\n !_isNode(currentNode.firstElementChild) &&\n (!_isNode(currentNode.content) ||\n !_isNode(currentNode.content.firstElementChild)) &&\n regExpTest(/<[/\\w]/g, currentNode.innerHTML) &&\n regExpTest(/<[/\\w]/g, currentNode.textContent)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Mitigate a problem with templates inside select */\n if (\n tagName === 'select' &&\n regExpTest(/<template/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === 7) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (\n SAFE_FOR_XML &&\n currentNode.nodeType === 8 &&\n regExpTest(/<[/\\w]/g, currentNode.data)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n )\n return false;\n if (\n CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)\n )\n return false;\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if (\n (tagName === 'noscript' ||\n tagName === 'noembed' ||\n tagName === 'noframes') &&\n regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)\n ) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = stringReplace(content, MUSTACHE_EXPR, ' ');\n content = stringReplace(content, ERB_EXPR, ' ');\n content = stringReplace(content, TMPLIT_EXPR, ' ');\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function (lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (\n SANITIZE_DOM &&\n (lcName === 'id' || lcName === 'name') &&\n (value in document || value in formElement)\n ) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (\n ALLOW_DATA_ATTR &&\n !FORBID_ATTR[lcName] &&\n regExpTest(DATA_ATTR, lcName)\n ) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n (_basicCustomElementTest(lcTag) &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))) &&\n ((CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName)) ||\n (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)))) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n (lcName === 'is' &&\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n ((CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp &&\n regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)) ||\n (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function &&\n CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))\n ) {\n // If user has supplied a regexp or function in CUSTOM_ELEMENT_HANDLING.tagNameCheck, we need to also allow derived custom elements using the same tagName test.\n // Additionally, we need to allow attributes passing the CUSTOM_ELEMENT_HANDLING.attributeNameCheck user has configured, as custom elements can define these at their own discretion.\n } else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (\n regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if (\n (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n lcTag !== 'script' &&\n stringIndexOf(value, 'data:') === 0 &&\n DATA_URI_TAGS[lcTag]\n ) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (\n ALLOW_UNKNOWN_PROTOCOLS &&\n !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n ) {\n // This attribute is safe\n /* Check for binary attributes */\n } else if (value) {\n return false;\n } else {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n }\n\n return true;\n };\n\n /**\n * _basicCustomElementCheck\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n * @param {string} tagName name of the tag of the node to sanitize\n */\n const _basicCustomElementTest = function (tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function (currentNode) {\n let attr;\n let value;\n let lcName;\n let l;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const { attributes } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n const { name, namespaceURI } = attr;\n value = name === 'value' ? attr.value : stringTrim(attr.value);\n lcName = transformCaseFunc(name);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = stringReplace(value, MUSTACHE_EXPR, ' ');\n value = stringReplace(value, ERB_EXPR, ' ');\n value = stringReplace(value, TMPLIT_EXPR, ' ');\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (\n trustedTypesPolicy &&\n typeof trustedTypes === 'object' &&\n typeof trustedTypes.getAttributeType === 'function'\n ) {\n if (namespaceURI) {\n /* Namespaces are not yet supported, see https://bugs.chromium.org/p/chromium/issues/detail?id=1305293 */\n } else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML': {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL': {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function (fragment) {\n let shadowNode;\n const shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while ((shadowNode = shadowIterator.nextNode())) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg = {}) {\n let body;\n let importedNode;\n let currentNode;\n let oldNode;\n let returnNode;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (\n typeof window.toStaticHTML === 'object' ||\n typeof window.toStaticHTML === 'function'\n ) {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate(\n 'root node is forbidden and cannot be sanitized in-place'\n );\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n oldNode = null;\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (\n WHOLE_DOCUMENT &&\n ALLOWED_TAGS['!doctype'] &&\n body.ownerDocument &&\n body.ownerDocument.doctype &&\n body.ownerDocument.doctype.name &&\n regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n ) {\n serializedHTML =\n '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');\n serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n", "// JavaScript Expression Parser (JSEP) 0.3.5\n// JSEP may be freely distributed under the MIT License\n// https://ericsmekens.github.io/jsep/\n\n/*global module: true, exports: true, console: true */\n(function (root) {\n\t'use strict';\n\t// Node Types\n\t// ----------\n\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tvar COMPOUND = 'Compound',\n\t\tIDENTIFIER = 'Identifier',\n\t\tMEMBER_EXP = 'MemberExpression',\n\t\tLITERAL = 'Literal',\n\t\tTHIS_EXP = 'ThisExpression',\n\t\tCALL_EXP = 'CallExpression',\n\t\tUNARY_EXP = 'UnaryExpression',\n\t\tBINARY_EXP = 'BinaryExpression',\n\t\tLOGICAL_EXP = 'LogicalExpression',\n\t\tCONDITIONAL_EXP = 'ConditionalExpression',\n\t\tARRAY_EXP = 'ArrayExpression',\n\n\t\tPERIOD_CODE = 46, // '.'\n\t\tCOMMA_CODE = 44, // ','\n\t\tSQUOTE_CODE = 39, // single quote\n\t\tDQUOTE_CODE = 34, // double quotes\n\t\tOPAREN_CODE = 40, // (\n\t\tCPAREN_CODE = 41, // )\n\t\tOBRACK_CODE = 91, // [\n\t\tCBRACK_CODE = 93, // ]\n\t\tQUMARK_CODE = 63, // ?\n\t\tSEMCOL_CODE = 59, // ;\n\t\tCOLON_CODE = 58, // :\n\n\t\tthrowError = function(message, index) {\n\t\t\tvar error = new Error(message + ' at character ' + index);\n\t\t\terror.index = index;\n\t\t\terror.description = message;\n\t\t\tthrow error;\n\t\t},\n\n\t// Operations\n\t// ----------\n\n\t// Set `t` to `true` to save space (when minified, not gzipped)\n\t\tt = true,\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `true` (it really doesn't matter)\n\t\tunary_ops = {'-': t, '!': t, '~': t, '+': t},\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference:\n\t// see [Order of operations](http://en.wikipedia.org/wiki/Order_of_operations#Programming_language)\n\t\tbinary_ops = {\n\t\t\t'||': 1, '&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t\t'<<':8, '>>': 8, '>>>': 8,\n\t\t\t'+': 9, '-': 9,\n\t\t\t'*': 10, '/': 10, '%': 10\n\t\t},\n\t// Get return the longest key length of any object\n\t\tgetMaxKeyLen = function(obj) {\n\t\t\tvar max_len = 0, len;\n\t\t\tfor(var key in obj) {\n\t\t\t\tif((len = key.length) > max_len && obj.hasOwnProperty(key)) {\n\t\t\t\t\tmax_len = len;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_len;\n\t\t},\n\t\tmax_unop_len = getMaxKeyLen(unary_ops),\n\t\tmax_binop_len = getMaxKeyLen(binary_ops),\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\t\tliterals = {\n\t\t\t'true': true,\n\t\t\t'false': false,\n\t\t\t'null': null\n\t\t},\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\t\tthis_str = 'this',\n\t// Returns the precedence of a binary operator or `0` if it isn't a binary operator\n\t\tbinaryPrecedence = function(op_val) {\n\t\t\treturn binary_ops[op_val] || 0;\n\t\t},\n\t// Utility function (gets called from multiple places)\n\t// Also note that `a && b` and `a || b` are *logical* expressions, not binary expressions\n\t\tcreateBinaryExpression = function (operator, left, right) {\n\t\t\tvar type = (operator === '||' || operator === '&&') ? LOGICAL_EXP : BINARY_EXP;\n\t\t\treturn {\n\t\t\t\ttype: type,\n\t\t\t\toperator: operator,\n\t\t\t\tleft: left,\n\t\t\t\tright: right\n\t\t\t};\n\t\t},\n\t\t// `ch` is a character code in the next three functions\n\t\tisDecimalDigit = function(ch) {\n\t\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t\t},\n\t\tisIdentifierStart = function(ch) {\n\t\t\treturn (ch === 36) || (ch === 95) || // `$` and `_`\n\t\t\t\t\t(ch >= 65 && ch <= 90) || // A...Z\n\t\t\t\t\t(ch >= 97 && ch <= 122) || // a...z\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\n\t\t},\n\t\tisIdentifierPart = function(ch) {\n\t\t\treturn (ch === 36) || (ch === 95) || // `$` and `_`\n\t\t\t\t\t(ch >= 65 && ch <= 90) || // A...Z\n\t\t\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t\t\t(ch >= 48 && ch <= 57) || // 0...9\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\n\t\t},\n\n\t\t// Parsing\n\t\t// -------\n\t\t// `expr` is a string with the passed in expression\n\t\tjsep = function(expr) {\n\t\t\t// `index` stores the character number we are currently at while `length` is a constant\n\t\t\t// All of the gobbles below will modify `index` as we move along\n\t\t\tvar index = 0,\n\t\t\t\tcharAtFunc = expr.charAt,\n\t\t\t\tcharCodeAtFunc = expr.charCodeAt,\n\t\t\t\texprI = function(i) { return charAtFunc.call(expr, i); },\n\t\t\t\texprICode = function(i) { return charCodeAtFunc.call(expr, i); },\n\t\t\t\tlength = expr.length,\n\n\t\t\t\t// Push `index` up to the next non-space character\n\t\t\t\tgobbleSpaces = function() {\n\t\t\t\t\tvar ch = exprICode(index);\n\t\t\t\t\t// space or tab\n\t\t\t\t\twhile(ch === 32 || ch === 9 || ch === 10 || ch === 13) {\n\t\t\t\t\t\tch = exprICode(++index);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// The main parsing function. Much of this code is dedicated to ternary expressions\n\t\t\t\tgobbleExpression = function() {\n\t\t\t\t\tvar test = gobbleBinaryExpression(),\n\t\t\t\t\t\tconsequent, alternate;\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tif(exprICode(index) === QUMARK_CODE) {\n\t\t\t\t\t\t// Ternary expression: test ? consequent : alternate\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tconsequent = gobbleExpression();\n\t\t\t\t\t\tif(!consequent) {\n\t\t\t\t\t\t\tthrowError('Expected expression', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tif(exprICode(index) === COLON_CODE) {\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\talternate = gobbleExpression();\n\t\t\t\t\t\t\tif(!alternate) {\n\t\t\t\t\t\t\t\tthrowError('Expected expression', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\t\t\ttest: test,\n\t\t\t\t\t\t\t\tconsequent: consequent,\n\t\t\t\t\t\t\t\talternate: alternate\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrowError('Expected :', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn test;\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Search for the operation portion of the string (e.g. `+`, `===`)\n\t\t\t\t// Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t\t\t\t// and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t\t\t\t// then, return that binary operation\n\t\t\t\tgobbleBinaryOp = function() {\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tvar biop, to_check = expr.substr(index, max_binop_len), tc_len = to_check.length;\n\t\t\t\t\twhile(tc_len > 0) {\n\t\t\t\t\t\t// Don't accept a binary op when it is an identifier.\n\t\t\t\t\t\t// Binary ops that start with a identifier-valid character must be followed\n\t\t\t\t\t\t// by a non identifier-part valid character\n\t\t\t\t\t\tif(binary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t\t\t!isIdentifierStart(exprICode(index)) ||\n\t\t\t\t\t\t\t(index+to_check.length< expr.length && !isIdentifierPart(exprICode(index+to_check.length)))\n\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\tindex += tc_len;\n\t\t\t\t\t\t\treturn to_check;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\n\t\t\t\t// This function is responsible for gobbling an individual expression,\n\t\t\t\t// e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t\t\t\tgobbleBinaryExpression = function() {\n\t\t\t\t\tvar ch_i, node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n\t\t\t\t\t// First, try to get the leftmost thing\n\t\t\t\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t\t\t\tleft = gobbleToken();\n\t\t\t\t\tbiop = gobbleBinaryOp();\n\n\t\t\t\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\t\t\t\tif(!biop) {\n\t\t\t\t\t\treturn left;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t\t\t\t// precedence structure\n\t\t\t\t\tbiop_info = { value: biop, prec: binaryPrecedence(biop)};\n\n\t\t\t\t\tright = gobbleToken();\n\t\t\t\t\tif(!right) {\n\t\t\t\t\t\tthrowError(\"Expected expression after \" + biop, index);\n\t\t\t\t\t}\n\t\t\t\t\tstack = [left, biop_info, right];\n\n\t\t\t\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\t\t\t\twhile((biop = gobbleBinaryOp())) {\n\t\t\t\t\t\tprec = binaryPrecedence(biop);\n\n\t\t\t\t\t\tif(prec === 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbiop_info = { value: biop, prec: prec };\n\n\t\t\t\t\t\tcur_biop = biop;\n\t\t\t\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\t\t\t\twhile ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n\t\t\t\t\t\t\tright = stack.pop();\n\t\t\t\t\t\t\tbiop = stack.pop().value;\n\t\t\t\t\t\t\tleft = stack.pop();\n\t\t\t\t\t\t\tnode = createBinaryExpression(biop, left, right);\n\t\t\t\t\t\t\tstack.push(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnode = gobbleToken();\n\t\t\t\t\t\tif(!node) {\n\t\t\t\t\t\t\tthrowError(\"Expected expression after \" + cur_biop, index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstack.push(biop_info, node);\n\t\t\t\t\t}\n\n\t\t\t\t\ti = stack.length - 1;\n\t\t\t\t\tnode = stack[i];\n\t\t\t\t\twhile(i > 1) {\n\t\t\t\t\t\tnode = createBinaryExpression(stack[i - 1].value, stack[i - 2], node);\n\t\t\t\t\t\ti -= 2;\n\t\t\t\t\t}\n\t\t\t\t\treturn node;\n\t\t\t\t},\n\n\t\t\t\t// An individual part of a binary expression:\n\t\t\t\t// e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t\t\t\tgobbleToken = function() {\n\t\t\t\t\tvar ch, to_check, tc_len;\n\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tch = exprICode(index);\n\n\t\t\t\t\tif(isDecimalDigit(ch) || ch === PERIOD_CODE) {\n\t\t\t\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\t\t\t\treturn gobbleNumericLiteral();\n\t\t\t\t\t} else if(ch === SQUOTE_CODE || ch === DQUOTE_CODE) {\n\t\t\t\t\t\t// Single or double quotes\n\t\t\t\t\t\treturn gobbleStringLiteral();\n\t\t\t\t\t} else if (ch === OBRACK_CODE) {\n\t\t\t\t\t\treturn gobbleArray();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tto_check = expr.substr(index, max_unop_len);\n\t\t\t\t\t\ttc_len = to_check.length;\n\t\t\t\t\t\twhile(tc_len > 0) {\n\t\t\t\t\t\t// Don't accept an unary op when it is an identifier.\n\t\t\t\t\t\t// Unary ops that start with a identifier-valid character must be followed\n\t\t\t\t\t\t// by a non identifier-part valid character\n\t\t\t\t\t\t\tif(unary_ops.hasOwnProperty(to_check) && (\n\t\t\t\t\t\t\t\t!isIdentifierStart(exprICode(index)) ||\n\t\t\t\t\t\t\t\t(index+to_check.length < expr.length && !isIdentifierPart(exprICode(index+to_check.length)))\n\t\t\t\t\t\t\t)) {\n\t\t\t\t\t\t\t\tindex += tc_len;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ttype: UNARY_EXP,\n\t\t\t\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\t\t\t\targument: gobbleToken(),\n\t\t\t\t\t\t\t\t\tprefix: true\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isIdentifierStart(ch) || ch === OPAREN_CODE) { // open parenthesis\n\t\t\t\t\t\t\t// `foo`, `bar.baz`\n\t\t\t\t\t\t\treturn gobbleVariable();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t\t// Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t\t\t\t// keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t\t\t\tgobbleNumericLiteral = function() {\n\t\t\t\t\tvar number = '', ch, chCode;\n\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) {\n\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(exprICode(index) === PERIOD_CODE) { // can start with a decimal marker\n\t\t\t\t\t\tnumber += exprI(index++);\n\n\t\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) {\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tch = exprI(index);\n\t\t\t\t\tif(ch === 'e' || ch === 'E') { // exponent marker\n\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\tch = exprI(index);\n\t\t\t\t\t\tif(ch === '+' || ch === '-') { // exponent sign\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) { //exponent itself\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isDecimalDigit(exprICode(index-1)) ) {\n\t\t\t\t\t\t\tthrowError('Expected exponent (' + number + exprI(index) + ')', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tchCode = exprICode(index);\n\t\t\t\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\t\t\t\tif(isIdentifierStart(chCode)) {\n\t\t\t\t\t\tthrowError('Variable names cannot start with a number (' +\n\t\t\t\t\t\t\t\t\tnumber + exprI(index) + ')', index);\n\t\t\t\t\t} else if(chCode === PERIOD_CODE) {\n\t\t\t\t\t\tthrowError('Unexpected period', index);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\tvalue: parseFloat(number),\n\t\t\t\t\t\traw: number\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\t// Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t\t\t\t// e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t\t\t\tgobbleStringLiteral = function() {\n\t\t\t\t\tvar str = '', quote = exprI(index++), closed = false, ch;\n\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tch = exprI(index++);\n\t\t\t\t\t\tif(ch === quote) {\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if(ch === '\\\\') {\n\t\t\t\t\t\t\t// Check for all of the common escape codes\n\t\t\t\t\t\t\tch = exprI(index++);\n\t\t\t\t\t\t\tswitch(ch) {\n\t\t\t\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\t\t\t\tdefault : str += ch;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstr += ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!closed) {\n\t\t\t\t\t\tthrowError('Unclosed quote after \"'+str+'\"', index);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\tvalue: str,\n\t\t\t\t\t\traw: quote + str + quote\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\t// Gobbles only identifiers\n\t\t\t\t// e.g.: `foo`, `_value`, `$x1`\n\t\t\t\t// Also, this function checks if that identifier is a literal:\n\t\t\t\t// (e.g. `true`, `false`, `null`) or `this`\n\t\t\t\tgobbleIdentifier = function() {\n\t\t\t\t\tvar ch = exprICode(index), start = index, identifier;\n\n\t\t\t\t\tif(isIdentifierStart(ch)) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrowError('Unexpected ' + exprI(index), index);\n\t\t\t\t\t}\n\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tch = exprICode(index);\n\t\t\t\t\t\tif(isIdentifierPart(ch)) {\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tidentifier = expr.slice(start, index);\n\n\t\t\t\t\tif(literals.hasOwnProperty(identifier)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\t\tvalue: literals[identifier],\n\t\t\t\t\t\t\traw: identifier\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if(identifier === this_str) {\n\t\t\t\t\t\treturn { type: THIS_EXP };\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: IDENTIFIER,\n\t\t\t\t\t\t\tname: identifier\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Gobbles a list of arguments within the context of a function call\n\t\t\t\t// or array literal. This function also assumes that the opening character\n\t\t\t\t// `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t\t\t\t// until the terminator character `)` or `]` is encountered.\n\t\t\t\t// e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t\t\t\tgobbleArguments = function(termination) {\n\t\t\t\t\tvar ch_i, args = [], node, closed = false;\n\t\t\t\t\tvar separator_count = 0;\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t\tif(ch_i === termination) { // done parsing\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\tif(termination === CPAREN_CODE && separator_count && separator_count >= args.length){\n\t\t\t\t\t\t\t\tthrowError('Unexpected token ' + String.fromCharCode(termination), index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (ch_i === COMMA_CODE) { // between expressions\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\tseparator_count++;\n\t\t\t\t\t\t\tif(separator_count !== args.length) { // missing argument\n\t\t\t\t\t\t\t\tif(termination === CPAREN_CODE) {\n\t\t\t\t\t\t\t\t\tthrowError('Unexpected token ,', index);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(termination === CBRACK_CODE) {\n\t\t\t\t\t\t\t\t\tfor(var arg = args.length; arg< separator_count; arg++) {\n\t\t\t\t\t\t\t\t\t\targs.push(null);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode = gobbleExpression();\n\t\t\t\t\t\t\tif(!node || node.type === COMPOUND) {\n\t\t\t\t\t\t\t\tthrowError('Expected comma', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\targs.push(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!closed) {\n\t\t\t\t\t\tthrowError('Expected ' + String.fromCharCode(termination), index);\n\t\t\t\t\t}\n\t\t\t\t\treturn args;\n\t\t\t\t},\n\n\t\t\t\t// Gobble a non-literal variable name. This variable name may include properties\n\t\t\t\t// e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t\t\t\t// It also gobbles function calls:\n\t\t\t\t// e.g. `Math.acos(obj.angle)`\n\t\t\t\tgobbleVariable = function() {\n\t\t\t\t\tvar ch_i, node;\n\t\t\t\t\tch_i = exprICode(index);\n\n\t\t\t\t\tif(ch_i === OPAREN_CODE) {\n\t\t\t\t\t\tnode = gobbleGroup();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode = gobbleIdentifier();\n\t\t\t\t\t}\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\twhile(ch_i === PERIOD_CODE || ch_i === OBRACK_CODE || ch_i === OPAREN_CODE) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif(ch_i === PERIOD_CODE) {\n\t\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: MEMBER_EXP,\n\t\t\t\t\t\t\t\tcomputed: false,\n\t\t\t\t\t\t\t\tobject: node,\n\t\t\t\t\t\t\t\tproperty: gobbleIdentifier()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if(ch_i === OBRACK_CODE) {\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: MEMBER_EXP,\n\t\t\t\t\t\t\t\tcomputed: true,\n\t\t\t\t\t\t\t\tobject: node,\n\t\t\t\t\t\t\t\tproperty: gobbleExpression()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t\t\tif(ch_i !== CBRACK_CODE) {\n\t\t\t\t\t\t\t\tthrowError('Unclosed [', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else if(ch_i === OPAREN_CODE) {\n\t\t\t\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: CALL_EXP,\n\t\t\t\t\t\t\t\t'arguments': gobbleArguments(CPAREN_CODE),\n\t\t\t\t\t\t\t\tcallee: node\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t}\n\t\t\t\t\treturn node;\n\t\t\t\t},\n\n\t\t\t\t// Responsible for parsing a group of things within parentheses `()`\n\t\t\t\t// This function assumes that it needs to gobble the opening parenthesis\n\t\t\t\t// and then tries to gobble everything within that parenthesis, assuming\n\t\t\t\t// that the next thing it should see is the close parenthesis. If not,\n\t\t\t\t// then the expression probably doesn't have a `)`\n\t\t\t\tgobbleGroup = function() {\n\t\t\t\t\tindex++;\n\t\t\t\t\tvar node = gobbleExpression();\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tif(exprICode(index) === CPAREN_CODE) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrowError('Unclosed (', index);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Responsible for parsing Array literals `[1, 2, 3]`\n\t\t\t\t// This function assumes that it needs to gobble the opening bracket\n\t\t\t\t// and then tries to gobble the expressions as arguments.\n\t\t\t\tgobbleArray = function() {\n\t\t\t\t\tindex++;\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: ARRAY_EXP,\n\t\t\t\t\t\telements: gobbleArguments(CBRACK_CODE)\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\tnodes = [], ch_i, node;\n\n\t\t\twhile(index < length) {\n\t\t\t\tch_i = exprICode(index);\n\n\t\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t\t// separators\n\t\t\t\tif(ch_i === SEMCOL_CODE || ch_i === COMMA_CODE) {\n\t\t\t\t\tindex++; // ignore separators\n\t\t\t\t} else {\n\t\t\t\t\t// Try to gobble each expression individually\n\t\t\t\t\tif((node = gobbleExpression())) {\n\t\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t\t} else if(index < length) {\n\t\t\t\t\t\tthrowError('Unexpected \"' + exprI(index) + '\"', index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there's only one expression just try returning the expression\n\t\t\tif(nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\ttype: COMPOUND,\n\t\t\t\t\tbody: nodes\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t// To be filled in by the template\n\tjsep.version = '0.3.5';\n\tjsep.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + jsep.version; };\n\n\t/**\n\t * @method jsep.addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @return jsep\n\t */\n\tjsep.addUnaryOp = function(op_name) {\n\t\tmax_unop_len = Math.max(op_name.length, max_unop_len);\n\t\tunary_ops[op_name] = t; return this;\n\t};\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float)\n\t * @return jsep\n\t */\n\tjsep.addBinaryOp = function(op_name, precedence) {\n\t\tmax_binop_len = Math.max(op_name.length, max_binop_len);\n\t\tbinary_ops[op_name] = precedence;\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @return jsep\n\t */\n\tjsep.addLiteral = function(literal_name, literal_value) {\n\t\tliterals[literal_name] = literal_value;\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @return jsep\n\t */\n\tjsep.removeUnaryOp = function(op_name) {\n\t\tdelete unary_ops[op_name];\n\t\tif(op_name.length === max_unop_len) {\n\t\t\tmax_unop_len = getMaxKeyLen(unary_ops);\n\t\t}\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllUnaryOps\n\t * @return jsep\n\t */\n\tjsep.removeAllUnaryOps = function() {\n\t\tunary_ops = {};\n\t\tmax_unop_len = 0;\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @return jsep\n\t */\n\tjsep.removeBinaryOp = function(op_name) {\n\t\tdelete binary_ops[op_name];\n\t\tif(op_name.length === max_binop_len) {\n\t\t\tmax_binop_len = getMaxKeyLen(binary_ops);\n\t\t}\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllBinaryOps\n\t * @return jsep\n\t */\n\tjsep.removeAllBinaryOps = function() {\n\t\tbinary_ops = {};\n\t\tmax_binop_len = 0;\n\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @return jsep\n\t */\n\tjsep.removeLiteral = function(literal_name) {\n\t\tdelete literals[literal_name];\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllLiterals\n\t * @return jsep\n\t */\n\tjsep.removeAllLiterals = function() {\n\t\tliterals = {};\n\n\t\treturn this;\n\t};\n\n\t// In desktop environments, have a way to restore the old value for `jsep`\n\tif (typeof exports === 'undefined') {\n\t\tvar old_jsep = root.jsep;\n\t\t// The star of the show! It's a function!\n\t\troot.jsep = jsep;\n\t\t// And a courteous function willing to move out of the way for other similarly-named objects!\n\t\tjsep.noConflict = function() {\n\t\t\tif(root.jsep === jsep) {\n\t\t\t\troot.jsep = old_jsep;\n\t\t\t}\n\t\t\treturn jsep;\n\t\t};\n\t} else {\n\t\t// In Node.JS environments\n\t\tif (typeof module !== 'undefined' && module.exports) {\n\t\t\texports = module.exports = jsep;\n\t\t} else {\n\t\t\texports.parse = jsep;\n\t\t}\n\t}\n}(this));\n", "'use strict'\r\n\r\nmodule.exports = calcSDF\r\n\r\nvar INF = 1e20\r\n\r\nfunction calcSDF(src, options) {\r\n if (!options) options = {}\r\n\r\n var cutoff = options.cutoff == null ? 0.25 : options.cutoff\r\n var radius = options.radius == null ? 8 : options.radius\r\n var channel = options.channel || 0\r\n var w, h, size, data, intData, stride, ctx, canvas, imgData, i, l\r\n\r\n // handle image container\r\n if (ArrayBuffer.isView(src) || Array.isArray(src)) {\r\n if (!options.width || !options.height) throw Error('For raw data width and height should be provided by options')\r\n w = options.width, h = options.height\r\n data = src\r\n\r\n if (!options.stride) stride = Math.floor(src.length / w / h)\r\n else stride = options.stride\r\n }\r\n else {\r\n if (window.HTMLCanvasElement && src instanceof window.HTMLCanvasElement) {\r\n canvas = src\r\n ctx = canvas.getContext('2d')\r\n w = canvas.width, h = canvas.height\r\n imgData = ctx.getImageData(0, 0, w, h)\r\n data = imgData.data\r\n stride = 4\r\n }\r\n else if (window.CanvasRenderingContext2D && src instanceof window.CanvasRenderingContext2D) {\r\n canvas = src.canvas\r\n ctx = src\r\n w = canvas.width, h = canvas.height\r\n imgData = ctx.getImageData(0, 0, w, h)\r\n data = imgData.data\r\n stride = 4\r\n }\r\n else if (window.ImageData && src instanceof window.ImageData) {\r\n imgData = src\r\n w = src.width, h = src.height\r\n data = imgData.data\r\n stride = 4\r\n }\r\n }\r\n\r\n size = Math.max(w, h)\r\n\r\n //convert int data to floats\r\n if ((window.Uint8ClampedArray && data instanceof window.Uint8ClampedArray) || (window.Uint8Array && data instanceof window.Uint8Array)) {\r\n intData = data\r\n data = Array(w*h)\r\n\r\n for (i = 0, l = Math.floor(intData.length / stride); i < l; i++) {\r\n data[i] = intData[i*stride + channel] / 255\r\n }\r\n }\r\n else {\r\n if (stride !== 1) throw Error('Raw data can have only 1 value per pixel')\r\n }\r\n\r\n // temporary arrays for the distance transform\r\n var gridOuter = Array(w * h)\r\n var gridInner = Array(w * h)\r\n var f = Array(size)\r\n var d = Array(size)\r\n var z = Array(size + 1)\r\n var v = Array(size)\r\n\r\n for (i = 0, l = w * h; i < l; i++) {\r\n var a = data[i]\r\n gridOuter[i] = a === 1 ? 0 : a === 0 ? INF : Math.pow(Math.max(0, 0.5 - a), 2)\r\n gridInner[i] = a === 1 ? INF : a === 0 ? 0 : Math.pow(Math.max(0, a - 0.5), 2)\r\n }\r\n\r\n edt(gridOuter, w, h, f, d, v, z)\r\n edt(gridInner, w, h, f, d, v, z)\r\n\r\n var dist = window.Float32Array ? new Float32Array(w * h) : new Array(w * h)\r\n\r\n for (i = 0, l = w*h; i < l; i++) {\r\n dist[i] = Math.min(Math.max(1 - ( (gridOuter[i] - gridInner[i]) / radius + cutoff), 0), 1)\r\n }\r\n\r\n return dist\r\n}\r\n\r\n// 2D Euclidean distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/dt/\r\nfunction edt(data, width, height, f, d, v, z) {\r\n for (var x = 0; x < width; x++) {\r\n for (var y = 0; y < height; y++) {\r\n f[y] = data[y * width + x]\r\n }\r\n edt1d(f, d, v, z, height)\r\n for (y = 0; y < height; y++) {\r\n data[y * width + x] = d[y]\r\n }\r\n }\r\n for (y = 0; y < height; y++) {\r\n for (x = 0; x < width; x++) {\r\n f[x] = data[y * width + x]\r\n }\r\n edt1d(f, d, v, z, width)\r\n for (x = 0; x < width; x++) {\r\n data[y * width + x] = Math.sqrt(d[x])\r\n }\r\n }\r\n}\r\n\r\n// 1D squared distance transform\r\nfunction edt1d(f, d, v, z, n) {\r\n v[0] = 0;\r\n z[0] = -INF\r\n z[1] = +INF\r\n\r\n for (var q = 1, k = 0; q < n; q++) {\r\n var s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k])\r\n while (s <= z[k]) {\r\n k--\r\n s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k])\r\n }\r\n k++\r\n v[k] = q\r\n z[k] = s\r\n z[k + 1] = +INF\r\n }\r\n\r\n for (q = 0, k = 0; q < n; q++) {\r\n while (z[k + 1] < q) k++\r\n d[q] = (q - v[k]) * (q - v[k]) + f[v[k]]\r\n }\r\n}\r\n", "/*\r\nBreaks a Javascript string into individual user-perceived \"characters\" \r\ncalled extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0\r\n\r\nUsage:\r\nvar splitter = new GraphemeSplitter();\r\n//returns an array of strings, one string for each grapheme cluster\r\nvar graphemes = splitter.splitGraphemes(string); \r\n\r\n*/\r\nfunction GraphemeSplitter(){\r\n\tvar CR = 0,\r\n\t\tLF = 1,\r\n\t\tControl = 2,\r\n\t\tExtend = 3,\r\n\t\tRegional_Indicator = 4,\r\n\t\tSpacingMark = 5,\r\n\t\tL = 6,\r\n\t\tV = 7,\r\n\t\tT = 8,\r\n\t\tLV = 9,\r\n\t\tLVT = 10,\r\n\t\tOther = 11,\r\n\t\tPrepend = 12,\r\n\t\tE_Base = 13,\r\n\t\tE_Modifier = 14,\r\n\t\tZWJ = 15,\r\n\t\tGlue_After_Zwj = 16,\r\n\t\tE_Base_GAZ = 17;\r\n\t\t\r\n\t// BreakTypes\r\n\tvar NotBreak = 0,\r\n\t\tBreakStart = 1,\r\n\t\tBreak = 2,\r\n\t\tBreakLastRegional = 3,\r\n\t\tBreakPenultimateRegional = 4;\r\n\t\t\r\n\tfunction isSurrogate(str, pos) {\r\n\t\treturn 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && \r\n\t\t\t\t0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff;\r\n\t}\r\n\t\t\r\n\t// Private function, gets a Unicode code point from a JavaScript UTF-16 string\r\n\t// handling surrogate pairs appropriately\r\n\tfunction codePointAt(str, idx){\r\n\t\tif(idx === undefined){\r\n\t\t\tidx = 0;\r\n\t\t}\r\n\t\tvar code = str.charCodeAt(idx);\r\n\r\n\t\t// if a high surrogate\r\n\t\tif (0xD800 <= code && code <= 0xDBFF && \r\n\t\t\tidx < str.length - 1){\r\n\t\t\tvar hi = code;\r\n\t\t\tvar low = str.charCodeAt(idx + 1);\r\n\t\t\tif (0xDC00 <= low && low <= 0xDFFF){\r\n\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\r\n\t\t\t}\r\n\t\t\treturn hi;\r\n\t\t}\r\n\t\t\r\n\t\t// if a low surrogate\r\n\t\tif (0xDC00 <= code && code <= 0xDFFF &&\r\n\t\t\tidx >= 1){\r\n\t\t\tvar hi = str.charCodeAt(idx - 1);\r\n\t\t\tvar low = code;\r\n\t\t\tif (0xD800 <= hi && hi <= 0xDBFF){\r\n\t\t\t\treturn ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;\r\n\t\t\t}\r\n\t\t\treturn low;\r\n\t\t}\r\n\t\t\r\n\t\t//just return the char if an unmatched surrogate half or a \r\n\t\t//single-char codepoint\r\n\t\treturn code;\r\n\t}\r\n\t\r\n\t// Private function, returns whether a break is allowed between the \r\n\t// two given grapheme breaking classes\r\n\tfunction shouldBreak(start, mid, end){\r\n\t\tvar all = [start].concat(mid).concat([end]);\r\n\t\tvar previous = all[all.length - 2]\r\n\t\tvar next = end\r\n\t\t\r\n\t\t// Lookahead termintor for:\r\n\t\t// GB10. (E_Base | EBG) Extend* ?\tE_Modifier\r\n\t\tvar eModifierIndex = all.lastIndexOf(E_Modifier)\r\n\t\tif(eModifierIndex > 1 &&\r\n\t\t\tall.slice(1, eModifierIndex).every(function(c){return c == Extend}) &&\r\n\t\t\t[Extend, E_Base, E_Base_GAZ].indexOf(start) == -1){\r\n\t\t\treturn Break\r\n\t\t}\r\n\r\n\t\t// Lookahead termintor for:\r\n\t\t// GB12. ^ (RI RI)* RI\t?\tRI\r\n\t\t// GB13. [^RI] (RI RI)* RI\t?\tRI\r\n\t\tvar rIIndex = all.lastIndexOf(Regional_Indicator)\r\n\t\tif(rIIndex > 0 &&\r\n\t\t\tall.slice(1, rIIndex).every(function(c){return c == Regional_Indicator}) &&\r\n\t\t\t[Prepend, Regional_Indicator].indexOf(previous) == -1) { \r\n\t\t\tif(all.filter(function(c){return c == Regional_Indicator}).length % 2 == 1) {\r\n\t\t\t\treturn BreakLastRegional\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn BreakPenultimateRegional\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// GB3. CR X LF\r\n\t\tif(previous == CR && next == LF){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB4. (Control|CR|LF) \u00F7\r\n\t\telse if(previous == Control || previous == CR || previous == LF){\r\n\t\t\tif(next == E_Modifier && mid.every(function(c){return c == Extend})){\r\n\t\t\t\treturn Break\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn BreakStart\r\n\t\t\t}\r\n\t\t}\r\n\t\t// GB5. \u00F7 (Control|CR|LF)\r\n\t\telse if(next == Control || next == CR || next == LF){\r\n\t\t\treturn BreakStart;\r\n\t\t}\r\n\t\t// GB6. L X (L|V|LV|LVT)\r\n\t\telse if(previous == L && \r\n\t\t\t(next == L || next == V || next == LV || next == LVT)){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB7. (LV|V) X (V|T)\r\n\t\telse if((previous == LV || previous == V) && \r\n\t\t\t(next == V || next == T)){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB8. (LVT|T) X (T)\r\n\t\telse if((previous == LVT || previous == T) && \r\n\t\t\tnext == T){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9. X (Extend|ZWJ)\r\n\t\telse if (next == Extend || next == ZWJ){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9a. X SpacingMark\r\n\t\telse if(next == SpacingMark){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t// GB9b. Prepend X\r\n\t\telse if (previous == Prepend){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t\r\n\t\t// GB10. (E_Base | EBG) Extend* ?\tE_Modifier\r\n\t\tvar previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2;\r\n\t\tif([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 &&\r\n\t\t\tall.slice(previousNonExtendIndex + 1, -1).every(function(c){return c == Extend}) &&\r\n\t\t\tnext == E_Modifier){\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\t\t\r\n\t\t// GB11. ZWJ ? (Glue_After_Zwj | EBG)\r\n\t\tif(previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) {\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\r\n\t\t// GB12. ^ (RI RI)* RI ? RI\r\n\t\t// GB13. [^RI] (RI RI)* RI ? RI\r\n\t\tif(mid.indexOf(Regional_Indicator) != -1) { \r\n\t\t\treturn Break;\r\n\t\t}\r\n\t\tif(previous == Regional_Indicator && next == Regional_Indicator) {\r\n\t\t\treturn NotBreak;\r\n\t\t}\r\n\r\n\t\t// GB999. Any ? Any\r\n\t\treturn BreakStart;\r\n\t}\r\n\t\r\n\t// Returns the next grapheme break in the string after the given index\r\n\tthis.nextBreak = function(string, index){\r\n\t\tif(index === undefined){\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\tif(index < 0){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(index >= string.length - 1){\r\n\t\t\treturn string.length;\r\n\t\t}\r\n\t\tvar prev = getGraphemeBreakProperty(codePointAt(string, index));\r\n\t\tvar mid = []\r\n\t\tfor (var i = index + 1; i < string.length; i++) {\r\n\t\t\t// check for already processed low surrogates\r\n\t\t\tif(isSurrogate(string, i - 1)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tvar next = getGraphemeBreakProperty(codePointAt(string, i));\r\n\t\t\tif(shouldBreak(prev, mid, next)){\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmid.push(next);\r\n\t\t}\r\n\t\treturn string.length;\r\n\t};\r\n\t\r\n\t// Breaks the given string into an array of grapheme cluster strings\r\n\tthis.splitGraphemes = function(str){\r\n\t\tvar res = [];\r\n\t\tvar index = 0;\r\n\t\tvar brk;\r\n\t\twhile((brk = this.nextBreak(str, index)) < str.length){\r\n\t\t\tres.push(str.slice(index, brk));\r\n\t\t\tindex = brk;\r\n\t\t}\r\n\t\tif(index < str.length){\r\n\t\t\tres.push(str.slice(index));\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\t// Returns the iterator of grapheme clusters there are in the given string\r\n\tthis.iterateGraphemes = function(str) {\r\n\t\tvar index = 0;\r\n\t\tvar res = {\r\n\t\t\tnext: (function() {\r\n\t\t\t\tvar value;\r\n\t\t\t\tvar brk;\r\n\t\t\t\tif ((brk = this.nextBreak(str, index)) < str.length) {\r\n\t\t\t\t\tvalue = str.slice(index, brk);\r\n\t\t\t\t\tindex = brk;\r\n\t\t\t\t\treturn { value: value, done: false };\r\n\t\t\t\t}\r\n\t\t\t\tif (index < str.length) {\r\n\t\t\t\t\tvalue = str.slice(index);\r\n\t\t\t\t\tindex = str.length;\r\n\t\t\t\t\treturn { value: value, done: false };\r\n\t\t\t\t}\r\n\t\t\t\treturn { value: undefined, done: true };\r\n\t\t\t}).bind(this)\r\n\t\t};\r\n\t\t// ES2015 @@iterator method (iterable) for spread syntax and for...of statement\r\n\t\tif (typeof Symbol !== 'undefined' && Symbol.iterator) {\r\n\t\t\tres[Symbol.iterator] = function() {return res};\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\t// Returns the number of grapheme clusters there are in the given string\r\n\tthis.countGraphemes = function(str){\r\n\t\tvar count = 0;\r\n\t\tvar index = 0;\r\n\t\tvar brk;\r\n\t\twhile((brk = this.nextBreak(str, index)) < str.length){\r\n\t\t\tindex = brk;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tif(index < str.length){\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\treturn count;\r\n\t};\r\n\t\r\n\t//given a Unicode code point, determines this symbol's grapheme break property\r\n\tfunction getGraphemeBreakProperty(code){\r\n\t\t\r\n\t\t//grapheme break property for Unicode 10.0.0, \r\n\t\t//taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt\r\n\t\t//and adapted to JavaScript rules\r\n\t\t\r\n\t\tif(\t\t\r\n\t\t(0x0600 <= code && code <= 0x0605) || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE\r\n\t\t0x06DD == code || // Cf ARABIC END OF AYAH\r\n\t\t0x070F == code || // Cf SYRIAC ABBREVIATION MARK\r\n\t\t0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH\r\n\t\t0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH\r\n\t\t0x110BD == code || // Cf KAITHI NUMBER SIGN\r\n\t\t(0x111C2 <= code && code <= 0x111C3) || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA\r\n\t\t0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA\r\n\t\t(0x11A86 <= code && code <= 0x11A89) || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA\r\n\t\t0x11D46 == code // Lo MASARAM GONDI REPHA\r\n\t\t){\r\n\t\t\treturn Prepend;\r\n\t\t}\r\n\t\tif(\r\n\t\t0x000D == code // Cc <control-000D>\r\n\t\t){\r\n\t\t\treturn CR;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x000A == code // Cc <control-000A>\r\n\t\t){\r\n\t\t\treturn LF;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x0000 <= code && code <= 0x0009) || // Cc [10] <control-0000>..<control-0009>\r\n\t\t(0x000B <= code && code <= 0x000C) || // Cc [2] <control-000B>..<control-000C>\r\n\t\t(0x000E <= code && code <= 0x001F) || // Cc [18] <control-000E>..<control-001F>\r\n\t\t(0x007F <= code && code <= 0x009F) || // Cc [33] <control-007F>..<control-009F>\r\n\t\t0x00AD == code || // Cf SOFT HYPHEN\r\n\t\t0x061C == code || // Cf ARABIC LETTER MARK\r\n\t\r\n\t\t0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR\r\n\t\t0x200B == code || // Cf ZERO WIDTH SPACE\r\n\t\t(0x200E <= code && code <= 0x200F) || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK\r\n\t\t0x2028 == code || // Zl LINE SEPARATOR\r\n\t\t0x2029 == code || // Zp PARAGRAPH SEPARATOR\r\n\t\t(0x202A <= code && code <= 0x202E) || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE\r\n\t\t(0x2060 <= code && code <= 0x2064) || // Cf [5] WORD JOINER..INVISIBLE PLUS\r\n\t\t0x2065 == code || // Cn <reserved-2065>\r\n\t\t(0x2066 <= code && code <= 0x206F) || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES\r\n\t\t(0xD800 <= code && code <= 0xDFFF) || // Cs [2048] <surrogate-D800>..<surrogate-DFFF>\r\n\t\t0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE\r\n\t\t(0xFFF0 <= code && code <= 0xFFF8) || // Cn [9] <reserved-FFF0>..<reserved-FFF8>\r\n\t\t(0xFFF9 <= code && code <= 0xFFFB) || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR\r\n\t\t(0x1BCA0 <= code && code <= 0x1BCA3) || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP\r\n\t\t(0x1D173 <= code && code <= 0x1D17A) || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE\r\n\t\t0xE0000 == code || // Cn <reserved-E0000>\r\n\t\t0xE0001 == code || // Cf LANGUAGE TAG\r\n\t\t(0xE0002 <= code && code <= 0xE001F) || // Cn [30] <reserved-E0002>..<reserved-E001F>\r\n\t\t(0xE0080 <= code && code <= 0xE00FF) || // Cn [128] <reserved-E0080>..<reserved-E00FF>\r\n\t\t(0xE01F0 <= code && code <= 0xE0FFF) // Cn [3600] <reserved-E01F0>..<reserved-E0FFF>\r\n\t\t){\r\n\t\t\treturn Control;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x0300 <= code && code <= 0x036F) || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X\r\n\t\t(0x0483 <= code && code <= 0x0487) || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE\r\n\t\t(0x0488 <= code && code <= 0x0489) || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN\r\n\t\t(0x0591 <= code && code <= 0x05BD) || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG\r\n\t\t0x05BF == code || // Mn HEBREW POINT RAFE\r\n\t\t(0x05C1 <= code && code <= 0x05C2) || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT\r\n\t\t(0x05C4 <= code && code <= 0x05C5) || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT\r\n\t\t0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN\r\n\t\t(0x0610 <= code && code <= 0x061A) || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA\r\n\t\t(0x064B <= code && code <= 0x065F) || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW\r\n\t\t0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF\r\n\t\t(0x06D6 <= code && code <= 0x06DC) || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN\r\n\t\t(0x06DF <= code && code <= 0x06E4) || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA\r\n\t\t(0x06E7 <= code && code <= 0x06E8) || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON\r\n\t\t(0x06EA <= code && code <= 0x06ED) || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM\r\n\t\t0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH\r\n\t\t(0x0730 <= code && code <= 0x074A) || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH\r\n\t\t(0x07A6 <= code && code <= 0x07B0) || // Mn [11] THAANA ABAFILI..THAANA SUKUN\r\n\t\t(0x07EB <= code && code <= 0x07F3) || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE\r\n\t\t(0x0816 <= code && code <= 0x0819) || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH\r\n\t\t(0x081B <= code && code <= 0x0823) || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A\r\n\t\t(0x0825 <= code && code <= 0x0827) || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U\r\n\t\t(0x0829 <= code && code <= 0x082D) || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA\r\n\t\t(0x0859 <= code && code <= 0x085B) || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK\r\n\t\t(0x08D4 <= code && code <= 0x08E1) || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA\r\n\t\t(0x08E3 <= code && code <= 0x0902) || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA\r\n\t\t0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE\r\n\t\t0x093C == code || // Mn DEVANAGARI SIGN NUKTA\r\n\t\t(0x0941 <= code && code <= 0x0948) || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI\r\n\t\t0x094D == code || // Mn DEVANAGARI SIGN VIRAMA\r\n\t\t(0x0951 <= code && code <= 0x0957) || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE\r\n\t\t(0x0962 <= code && code <= 0x0963) || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL\r\n\t\t0x0981 == code || // Mn BENGALI SIGN CANDRABINDU\r\n\t\t0x09BC == code || // Mn BENGALI SIGN NUKTA\r\n\t\t0x09BE == code || // Mc BENGALI VOWEL SIGN AA\r\n\t\t(0x09C1 <= code && code <= 0x09C4) || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR\r\n\t\t0x09CD == code || // Mn BENGALI SIGN VIRAMA\r\n\t\t0x09D7 == code || // Mc BENGALI AU LENGTH MARK\r\n\t\t(0x09E2 <= code && code <= 0x09E3) || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL\r\n\t\t(0x0A01 <= code && code <= 0x0A02) || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI\r\n\t\t0x0A3C == code || // Mn GURMUKHI SIGN NUKTA\r\n\t\t(0x0A41 <= code && code <= 0x0A42) || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU\r\n\t\t(0x0A47 <= code && code <= 0x0A48) || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI\r\n\t\t(0x0A4B <= code && code <= 0x0A4D) || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA\r\n\t\t0x0A51 == code || // Mn GURMUKHI SIGN UDAAT\r\n\t\t(0x0A70 <= code && code <= 0x0A71) || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK\r\n\t\t0x0A75 == code || // Mn GURMUKHI SIGN YAKASH\r\n\t\t(0x0A81 <= code && code <= 0x0A82) || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA\r\n\t\t0x0ABC == code || // Mn GUJARATI SIGN NUKTA\r\n\t\t(0x0AC1 <= code && code <= 0x0AC5) || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E\r\n\t\t(0x0AC7 <= code && code <= 0x0AC8) || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI\r\n\t\t0x0ACD == code || // Mn GUJARATI SIGN VIRAMA\r\n\t\t(0x0AE2 <= code && code <= 0x0AE3) || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL\r\n\t\t(0x0AFA <= code && code <= 0x0AFF) || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE\r\n\t\t0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU\r\n\t\t0x0B3C == code || // Mn ORIYA SIGN NUKTA\r\n\t\t0x0B3E == code || // Mc ORIYA VOWEL SIGN AA\r\n\t\t0x0B3F == code || // Mn ORIYA VOWEL SIGN I\r\n\t\t(0x0B41 <= code && code <= 0x0B44) || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR\r\n\t\t0x0B4D == code || // Mn ORIYA SIGN VIRAMA\r\n\t\t0x0B56 == code || // Mn ORIYA AI LENGTH MARK\r\n\t\t0x0B57 == code || // Mc ORIYA AU LENGTH MARK\r\n\t\t(0x0B62 <= code && code <= 0x0B63) || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL\r\n\t\t0x0B82 == code || // Mn TAMIL SIGN ANUSVARA\r\n\t\t0x0BBE == code || // Mc TAMIL VOWEL SIGN AA\r\n\t\t0x0BC0 == code || // Mn TAMIL VOWEL SIGN II\r\n\t\t0x0BCD == code || // Mn TAMIL SIGN VIRAMA\r\n\t\t0x0BD7 == code || // Mc TAMIL AU LENGTH MARK\r\n\t\t0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE\r\n\t\t(0x0C3E <= code && code <= 0x0C40) || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II\r\n\t\t(0x0C46 <= code && code <= 0x0C48) || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI\r\n\t\t(0x0C4A <= code && code <= 0x0C4D) || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA\r\n\t\t(0x0C55 <= code && code <= 0x0C56) || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK\r\n\t\t(0x0C62 <= code && code <= 0x0C63) || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL\r\n\t\t0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU\r\n\t\t0x0CBC == code || // Mn KANNADA SIGN NUKTA\r\n\t\t0x0CBF == code || // Mn KANNADA VOWEL SIGN I\r\n\t\t0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU\r\n\t\t0x0CC6 == code || // Mn KANNADA VOWEL SIGN E\r\n\t\t(0x0CCC <= code && code <= 0x0CCD) || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA\r\n\t\t(0x0CD5 <= code && code <= 0x0CD6) || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK\r\n\t\t(0x0CE2 <= code && code <= 0x0CE3) || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL\r\n\t\t(0x0D00 <= code && code <= 0x0D01) || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU\r\n\t\t(0x0D3B <= code && code <= 0x0D3C) || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA\r\n\t\t0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA\r\n\t\t(0x0D41 <= code && code <= 0x0D44) || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR\r\n\t\t0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA\r\n\t\t0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK\r\n\t\t(0x0D62 <= code && code <= 0x0D63) || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL\r\n\t\t0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA\r\n\t\t0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA\r\n\t\t(0x0DD2 <= code && code <= 0x0DD4) || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA\r\n\t\t0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA\r\n\t\t0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA\r\n\t\t0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT\r\n\t\t(0x0E34 <= code && code <= 0x0E3A) || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU\r\n\t\t(0x0E47 <= code && code <= 0x0E4E) || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN\r\n\t\t0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN\r\n\t\t(0x0EB4 <= code && code <= 0x0EB9) || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU\r\n\t\t(0x0EBB <= code && code <= 0x0EBC) || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO\r\n\t\t(0x0EC8 <= code && code <= 0x0ECD) || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA\r\n\t\t(0x0F18 <= code && code <= 0x0F19) || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS\r\n\t\t0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA\r\n\t\t0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS\r\n\t\t0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU\r\n\t\t(0x0F71 <= code && code <= 0x0F7E) || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO\r\n\t\t(0x0F80 <= code && code <= 0x0F84) || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA\r\n\t\t(0x0F86 <= code && code <= 0x0F87) || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS\r\n\t\t(0x0F8D <= code && code <= 0x0F97) || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA\r\n\t\t(0x0F99 <= code && code <= 0x0FBC) || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA\r\n\t\t0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN\r\n\t\t(0x102D <= code && code <= 0x1030) || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU\r\n\t\t(0x1032 <= code && code <= 0x1037) || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW\r\n\t\t(0x1039 <= code && code <= 0x103A) || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT\r\n\t\t(0x103D <= code && code <= 0x103E) || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA\r\n\t\t(0x1058 <= code && code <= 0x1059) || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL\r\n\t\t(0x105E <= code && code <= 0x1060) || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA\r\n\t\t(0x1071 <= code && code <= 0x1074) || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE\r\n\t\t0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA\r\n\t\t(0x1085 <= code && code <= 0x1086) || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y\r\n\t\t0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE\r\n\t\t0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI\r\n\t\t(0x135D <= code && code <= 0x135F) || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK\r\n\t\t(0x1712 <= code && code <= 0x1714) || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA\r\n\t\t(0x1732 <= code && code <= 0x1734) || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD\r\n\t\t(0x1752 <= code && code <= 0x1753) || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U\r\n\t\t(0x1772 <= code && code <= 0x1773) || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U\r\n\t\t(0x17B4 <= code && code <= 0x17B5) || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA\r\n\t\t(0x17B7 <= code && code <= 0x17BD) || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA\r\n\t\t0x17C6 == code || // Mn KHMER SIGN NIKAHIT\r\n\t\t(0x17C9 <= code && code <= 0x17D3) || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT\r\n\t\t0x17DD == code || // Mn KHMER SIGN ATTHACAN\r\n\t\t(0x180B <= code && code <= 0x180D) || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE\r\n\t\t(0x1885 <= code && code <= 0x1886) || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA\r\n\t\t0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA\r\n\t\t(0x1920 <= code && code <= 0x1922) || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U\r\n\t\t(0x1927 <= code && code <= 0x1928) || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O\r\n\t\t0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA\r\n\t\t(0x1939 <= code && code <= 0x193B) || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I\r\n\t\t(0x1A17 <= code && code <= 0x1A18) || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U\r\n\t\t0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE\r\n\t\t0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA\r\n\t\t(0x1A58 <= code && code <= 0x1A5E) || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA\r\n\t\t0x1A60 == code || // Mn TAI THAM SIGN SAKOT\r\n\t\t0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT\r\n\t\t(0x1A65 <= code && code <= 0x1A6C) || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW\r\n\t\t(0x1A73 <= code && code <= 0x1A7C) || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN\r\n\t\t0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT\r\n\t\t(0x1AB0 <= code && code <= 0x1ABD) || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW\r\n\t\t0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY\r\n\t\t(0x1B00 <= code && code <= 0x1B03) || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG\r\n\t\t0x1B34 == code || // Mn BALINESE SIGN REREKAN\r\n\t\t(0x1B36 <= code && code <= 0x1B3A) || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA\r\n\t\t0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA\r\n\t\t0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET\r\n\t\t(0x1B6B <= code && code <= 0x1B73) || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG\r\n\t\t(0x1B80 <= code && code <= 0x1B81) || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR\r\n\t\t(0x1BA2 <= code && code <= 0x1BA5) || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU\r\n\t\t(0x1BA8 <= code && code <= 0x1BA9) || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG\r\n\t\t(0x1BAB <= code && code <= 0x1BAD) || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA\r\n\t\t0x1BE6 == code || // Mn BATAK SIGN TOMPI\r\n\t\t(0x1BE8 <= code && code <= 0x1BE9) || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE\r\n\t\t0x1BED == code || // Mn BATAK VOWEL SIGN KARO O\r\n\t\t(0x1BEF <= code && code <= 0x1BF1) || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H\r\n\t\t(0x1C2C <= code && code <= 0x1C33) || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T\r\n\t\t(0x1C36 <= code && code <= 0x1C37) || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA\r\n\t\t(0x1CD0 <= code && code <= 0x1CD2) || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA\r\n\t\t(0x1CD4 <= code && code <= 0x1CE0) || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA\r\n\t\t(0x1CE2 <= code && code <= 0x1CE8) || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL\r\n\t\t0x1CED == code || // Mn VEDIC SIGN TIRYAK\r\n\t\t0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE\r\n\t\t(0x1CF8 <= code && code <= 0x1CF9) || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE\r\n\t\t(0x1DC0 <= code && code <= 0x1DF9) || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW\r\n\t\t(0x1DFB <= code && code <= 0x1DFF) || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW\r\n\t\t0x200C == code || // Cf ZERO WIDTH NON-JOINER\r\n\t\t(0x20D0 <= code && code <= 0x20DC) || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE\r\n\t\t(0x20DD <= code && code <= 0x20E0) || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH\r\n\t\t0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE\r\n\t\t(0x20E2 <= code && code <= 0x20E4) || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE\r\n\t\t(0x20E5 <= code && code <= 0x20F0) || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE\r\n\t\t(0x2CEF <= code && code <= 0x2CF1) || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS\r\n\t\t0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER\r\n\t\t(0x2DE0 <= code && code <= 0x2DFF) || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS\r\n\t\t(0x302A <= code && code <= 0x302D) || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK\r\n\t\t(0x302E <= code && code <= 0x302F) || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK\r\n\t\t(0x3099 <= code && code <= 0x309A) || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK\r\n\t\t0xA66F == code || // Mn COMBINING CYRILLIC VZMET\r\n\t\t(0xA670 <= code && code <= 0xA672) || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN\r\n\t\t(0xA674 <= code && code <= 0xA67D) || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK\r\n\t\t(0xA69E <= code && code <= 0xA69F) || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E\r\n\t\t(0xA6F0 <= code && code <= 0xA6F1) || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS\r\n\t\t0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA\r\n\t\t0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA\r\n\t\t0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA\r\n\t\t(0xA825 <= code && code <= 0xA826) || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E\r\n\t\t(0xA8C4 <= code && code <= 0xA8C5) || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU\r\n\t\t(0xA8E0 <= code && code <= 0xA8F1) || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA\r\n\t\t(0xA926 <= code && code <= 0xA92D) || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU\r\n\t\t(0xA947 <= code && code <= 0xA951) || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R\r\n\t\t(0xA980 <= code && code <= 0xA982) || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR\r\n\t\t0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU\r\n\t\t(0xA9B6 <= code && code <= 0xA9B9) || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT\r\n\t\t0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET\r\n\t\t0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW\r\n\t\t(0xAA29 <= code && code <= 0xAA2E) || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE\r\n\t\t(0xAA31 <= code && code <= 0xAA32) || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE\r\n\t\t(0xAA35 <= code && code <= 0xAA36) || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA\r\n\t\t0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG\r\n\t\t0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M\r\n\t\t0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2\r\n\t\t0xAAB0 == code || // Mn TAI VIET MAI KANG\r\n\t\t(0xAAB2 <= code && code <= 0xAAB4) || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U\r\n\t\t(0xAAB7 <= code && code <= 0xAAB8) || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA\r\n\t\t(0xAABE <= code && code <= 0xAABF) || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK\r\n\t\t0xAAC1 == code || // Mn TAI VIET TONE MAI THO\r\n\t\t(0xAAEC <= code && code <= 0xAAED) || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI\r\n\t\t0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA\r\n\t\t0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP\r\n\t\t0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP\r\n\t\t0xABED == code || // Mn MEETEI MAYEK APUN IYEK\r\n\t\t0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA\r\n\t\t(0xFE00 <= code && code <= 0xFE0F) || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16\r\n\t\t(0xFE20 <= code && code <= 0xFE2F) || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF\r\n\t\t(0xFF9E <= code && code <= 0xFF9F) || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK\r\n\t\t0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE\r\n\t\t0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK\r\n\t\t(0x10376 <= code && code <= 0x1037A) || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII\r\n\t\t(0x10A01 <= code && code <= 0x10A03) || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R\r\n\t\t(0x10A05 <= code && code <= 0x10A06) || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O\r\n\t\t(0x10A0C <= code && code <= 0x10A0F) || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA\r\n\t\t(0x10A38 <= code && code <= 0x10A3A) || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW\r\n\t\t0x10A3F == code || // Mn KHAROSHTHI VIRAMA\r\n\t\t(0x10AE5 <= code && code <= 0x10AE6) || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW\r\n\t\t0x11001 == code || // Mn BRAHMI SIGN ANUSVARA\r\n\t\t(0x11038 <= code && code <= 0x11046) || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA\r\n\t\t(0x1107F <= code && code <= 0x11081) || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA\r\n\t\t(0x110B3 <= code && code <= 0x110B6) || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI\r\n\t\t(0x110B9 <= code && code <= 0x110BA) || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA\r\n\t\t(0x11100 <= code && code <= 0x11102) || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA\r\n\t\t(0x11127 <= code && code <= 0x1112B) || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU\r\n\t\t(0x1112D <= code && code <= 0x11134) || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA\r\n\t\t0x11173 == code || // Mn MAHAJANI SIGN NUKTA\r\n\t\t(0x11180 <= code && code <= 0x11181) || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA\r\n\t\t(0x111B6 <= code && code <= 0x111BE) || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O\r\n\t\t(0x111CA <= code && code <= 0x111CC) || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK\r\n\t\t(0x1122F <= code && code <= 0x11231) || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI\r\n\t\t0x11234 == code || // Mn KHOJKI SIGN ANUSVARA\r\n\t\t(0x11236 <= code && code <= 0x11237) || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA\r\n\t\t0x1123E == code || // Mn KHOJKI SIGN SUKUN\r\n\t\t0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA\r\n\t\t(0x112E3 <= code && code <= 0x112EA) || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA\r\n\t\t(0x11300 <= code && code <= 0x11301) || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU\r\n\t\t0x1133C == code || // Mn GRANTHA SIGN NUKTA\r\n\t\t0x1133E == code || // Mc GRANTHA VOWEL SIGN AA\r\n\t\t0x11340 == code || // Mn GRANTHA VOWEL SIGN II\r\n\t\t0x11357 == code || // Mc GRANTHA AU LENGTH MARK\r\n\t\t(0x11366 <= code && code <= 0x1136C) || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX\r\n\t\t(0x11370 <= code && code <= 0x11374) || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA\r\n\t\t(0x11438 <= code && code <= 0x1143F) || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI\r\n\t\t(0x11442 <= code && code <= 0x11444) || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA\r\n\t\t0x11446 == code || // Mn NEWA SIGN NUKTA\r\n\t\t0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA\r\n\t\t(0x114B3 <= code && code <= 0x114B8) || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL\r\n\t\t0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E\r\n\t\t0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O\r\n\t\t(0x114BF <= code && code <= 0x114C0) || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA\r\n\t\t(0x114C2 <= code && code <= 0x114C3) || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA\r\n\t\t0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA\r\n\t\t(0x115B2 <= code && code <= 0x115B5) || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR\r\n\t\t(0x115BC <= code && code <= 0x115BD) || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA\r\n\t\t(0x115BF <= code && code <= 0x115C0) || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA\r\n\t\t(0x115DC <= code && code <= 0x115DD) || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU\r\n\t\t(0x11633 <= code && code <= 0x1163A) || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI\r\n\t\t0x1163D == code || // Mn MODI SIGN ANUSVARA\r\n\t\t(0x1163F <= code && code <= 0x11640) || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA\r\n\t\t0x116AB == code || // Mn TAKRI SIGN ANUSVARA\r\n\t\t0x116AD == code || // Mn TAKRI VOWEL SIGN AA\r\n\t\t(0x116B0 <= code && code <= 0x116B5) || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU\r\n\t\t0x116B7 == code || // Mn TAKRI SIGN NUKTA\r\n\t\t(0x1171D <= code && code <= 0x1171F) || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA\r\n\t\t(0x11722 <= code && code <= 0x11725) || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU\r\n\t\t(0x11727 <= code && code <= 0x1172B) || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER\r\n\t\t(0x11A01 <= code && code <= 0x11A06) || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O\r\n\t\t(0x11A09 <= code && code <= 0x11A0A) || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK\r\n\t\t(0x11A33 <= code && code <= 0x11A38) || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA\r\n\t\t(0x11A3B <= code && code <= 0x11A3E) || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA\r\n\t\t0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER\r\n\t\t(0x11A51 <= code && code <= 0x11A56) || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE\r\n\t\t(0x11A59 <= code && code <= 0x11A5B) || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK\r\n\t\t(0x11A8A <= code && code <= 0x11A96) || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA\r\n\t\t(0x11A98 <= code && code <= 0x11A99) || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER\r\n\t\t(0x11C30 <= code && code <= 0x11C36) || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L\r\n\t\t(0x11C38 <= code && code <= 0x11C3D) || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA\r\n\t\t0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA\r\n\t\t(0x11C92 <= code && code <= 0x11CA7) || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA\r\n\t\t(0x11CAA <= code && code <= 0x11CB0) || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA\r\n\t\t(0x11CB2 <= code && code <= 0x11CB3) || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E\r\n\t\t(0x11CB5 <= code && code <= 0x11CB6) || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU\r\n\t\t(0x11D31 <= code && code <= 0x11D36) || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R\r\n\t\t0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E\r\n\t\t(0x11D3C <= code && code <= 0x11D3D) || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O\r\n\t\t(0x11D3F <= code && code <= 0x11D45) || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA\r\n\t\t0x11D47 == code || // Mn MASARAM GONDI RA-KARA\r\n\t\t(0x16AF0 <= code && code <= 0x16AF4) || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE\r\n\t\t(0x16B30 <= code && code <= 0x16B36) || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM\r\n\t\t(0x16F8F <= code && code <= 0x16F92) || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW\r\n\t\t(0x1BC9D <= code && code <= 0x1BC9E) || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK\r\n\t\t0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM\r\n\t\t(0x1D167 <= code && code <= 0x1D169) || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3\r\n\t\t(0x1D16E <= code && code <= 0x1D172) || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5\r\n\t\t(0x1D17B <= code && code <= 0x1D182) || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE\r\n\t\t(0x1D185 <= code && code <= 0x1D18B) || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE\r\n\t\t(0x1D1AA <= code && code <= 0x1D1AD) || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO\r\n\t\t(0x1D242 <= code && code <= 0x1D244) || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME\r\n\t\t(0x1DA00 <= code && code <= 0x1DA36) || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN\r\n\t\t(0x1DA3B <= code && code <= 0x1DA6C) || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT\r\n\t\t0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS\r\n\t\t0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK\r\n\t\t(0x1DA9B <= code && code <= 0x1DA9F) || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6\r\n\t\t(0x1DAA1 <= code && code <= 0x1DAAF) || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16\r\n\t\t(0x1E000 <= code && code <= 0x1E006) || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE\r\n\t\t(0x1E008 <= code && code <= 0x1E018) || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU\r\n\t\t(0x1E01B <= code && code <= 0x1E021) || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI\r\n\t\t(0x1E023 <= code && code <= 0x1E024) || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS\r\n\t\t(0x1E026 <= code && code <= 0x1E02A) || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA\r\n\t\t(0x1E8D0 <= code && code <= 0x1E8D6) || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS\r\n\t\t(0x1E944 <= code && code <= 0x1E94A) || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA\r\n\t\t(0xE0020 <= code && code <= 0xE007F) || // Cf [96] TAG SPACE..CANCEL TAG\r\n\t\t(0xE0100 <= code && code <= 0xE01EF) // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256\r\n\t\t){\r\n\t\t\treturn Extend;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1F1E6 <= code && code <= 0x1F1FF) // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z\r\n\t\t){\r\n\t\t\treturn Regional_Indicator;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x0903 == code || // Mc DEVANAGARI SIGN VISARGA\r\n\t\t0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE\r\n\t\t(0x093E <= code && code <= 0x0940) || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II\r\n\t\t(0x0949 <= code && code <= 0x094C) || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU\r\n\t\t(0x094E <= code && code <= 0x094F) || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW\r\n\t\t(0x0982 <= code && code <= 0x0983) || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA\r\n\t\t(0x09BF <= code && code <= 0x09C0) || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II\r\n\t\t(0x09C7 <= code && code <= 0x09C8) || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI\r\n\t\t(0x09CB <= code && code <= 0x09CC) || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU\r\n\t\t0x0A03 == code || // Mc GURMUKHI SIGN VISARGA\r\n\t\t(0x0A3E <= code && code <= 0x0A40) || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II\r\n\t\t0x0A83 == code || // Mc GUJARATI SIGN VISARGA\r\n\t\t(0x0ABE <= code && code <= 0x0AC0) || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II\r\n\t\t0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O\r\n\t\t(0x0ACB <= code && code <= 0x0ACC) || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU\r\n\t\t(0x0B02 <= code && code <= 0x0B03) || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA\r\n\t\t0x0B40 == code || // Mc ORIYA VOWEL SIGN II\r\n\t\t(0x0B47 <= code && code <= 0x0B48) || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI\r\n\t\t(0x0B4B <= code && code <= 0x0B4C) || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU\r\n\t\t0x0BBF == code || // Mc TAMIL VOWEL SIGN I\r\n\t\t(0x0BC1 <= code && code <= 0x0BC2) || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU\r\n\t\t(0x0BC6 <= code && code <= 0x0BC8) || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI\r\n\t\t(0x0BCA <= code && code <= 0x0BCC) || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU\r\n\t\t(0x0C01 <= code && code <= 0x0C03) || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA\r\n\t\t(0x0C41 <= code && code <= 0x0C44) || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR\r\n\t\t(0x0C82 <= code && code <= 0x0C83) || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA\r\n\t\t0x0CBE == code || // Mc KANNADA VOWEL SIGN AA\r\n\t\t(0x0CC0 <= code && code <= 0x0CC1) || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U\r\n\t\t(0x0CC3 <= code && code <= 0x0CC4) || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR\r\n\t\t(0x0CC7 <= code && code <= 0x0CC8) || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI\r\n\t\t(0x0CCA <= code && code <= 0x0CCB) || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO\r\n\t\t(0x0D02 <= code && code <= 0x0D03) || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA\r\n\t\t(0x0D3F <= code && code <= 0x0D40) || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II\r\n\t\t(0x0D46 <= code && code <= 0x0D48) || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI\r\n\t\t(0x0D4A <= code && code <= 0x0D4C) || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU\r\n\t\t(0x0D82 <= code && code <= 0x0D83) || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA\r\n\t\t(0x0DD0 <= code && code <= 0x0DD1) || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA\r\n\t\t(0x0DD8 <= code && code <= 0x0DDE) || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA\r\n\t\t(0x0DF2 <= code && code <= 0x0DF3) || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA\r\n\t\t0x0E33 == code || // Lo THAI CHARACTER SARA AM\r\n\t\t0x0EB3 == code || // Lo LAO VOWEL SIGN AM\r\n\t\t(0x0F3E <= code && code <= 0x0F3F) || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES\r\n\t\t0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD\r\n\t\t0x1031 == code || // Mc MYANMAR VOWEL SIGN E\r\n\t\t(0x103B <= code && code <= 0x103C) || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA\r\n\t\t(0x1056 <= code && code <= 0x1057) || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR\r\n\t\t0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E\r\n\t\t0x17B6 == code || // Mc KHMER VOWEL SIGN AA\r\n\t\t(0x17BE <= code && code <= 0x17C5) || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU\r\n\t\t(0x17C7 <= code && code <= 0x17C8) || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU\r\n\t\t(0x1923 <= code && code <= 0x1926) || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU\r\n\t\t(0x1929 <= code && code <= 0x192B) || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA\r\n\t\t(0x1930 <= code && code <= 0x1931) || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA\r\n\t\t(0x1933 <= code && code <= 0x1938) || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA\r\n\t\t(0x1A19 <= code && code <= 0x1A1A) || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O\r\n\t\t0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA\r\n\t\t0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI\r\n\t\t(0x1A6D <= code && code <= 0x1A72) || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI\r\n\t\t0x1B04 == code || // Mc BALINESE SIGN BISAH\r\n\t\t0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG\r\n\t\t0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG\r\n\t\t(0x1B3D <= code && code <= 0x1B41) || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG\r\n\t\t(0x1B43 <= code && code <= 0x1B44) || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG\r\n\t\t0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD\r\n\t\t0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL\r\n\t\t(0x1BA6 <= code && code <= 0x1BA7) || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG\r\n\t\t0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH\r\n\t\t0x1BE7 == code || // Mc BATAK VOWEL SIGN E\r\n\t\t(0x1BEA <= code && code <= 0x1BEC) || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O\r\n\t\t0x1BEE == code || // Mc BATAK VOWEL SIGN U\r\n\t\t(0x1BF2 <= code && code <= 0x1BF3) || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN\r\n\t\t(0x1C24 <= code && code <= 0x1C2B) || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU\r\n\t\t(0x1C34 <= code && code <= 0x1C35) || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG\r\n\t\t0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA\r\n\t\t(0x1CF2 <= code && code <= 0x1CF3) || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA\r\n\t\t0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA\r\n\t\t(0xA823 <= code && code <= 0xA824) || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I\r\n\t\t0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO\r\n\t\t(0xA880 <= code && code <= 0xA881) || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA\r\n\t\t(0xA8B4 <= code && code <= 0xA8C3) || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU\r\n\t\t(0xA952 <= code && code <= 0xA953) || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA\r\n\t\t0xA983 == code || // Mc JAVANESE SIGN WIGNYAN\r\n\t\t(0xA9B4 <= code && code <= 0xA9B5) || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG\r\n\t\t(0xA9BA <= code && code <= 0xA9BB) || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE\r\n\t\t(0xA9BD <= code && code <= 0xA9C0) || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON\r\n\t\t(0xAA2F <= code && code <= 0xAA30) || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI\r\n\t\t(0xAA33 <= code && code <= 0xAA34) || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA\r\n\t\t0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H\r\n\t\t0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II\r\n\t\t(0xAAEE <= code && code <= 0xAAEF) || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU\r\n\t\t0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA\r\n\t\t(0xABE3 <= code && code <= 0xABE4) || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP\r\n\t\t(0xABE6 <= code && code <= 0xABE7) || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP\r\n\t\t(0xABE9 <= code && code <= 0xABEA) || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG\r\n\t\t0xABEC == code || // Mc MEETEI MAYEK LUM IYEK\r\n\t\t0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU\r\n\t\t0x11002 == code || // Mc BRAHMI SIGN VISARGA\r\n\t\t0x11082 == code || // Mc KAITHI SIGN VISARGA\r\n\t\t(0x110B0 <= code && code <= 0x110B2) || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II\r\n\t\t(0x110B7 <= code && code <= 0x110B8) || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU\r\n\t\t0x1112C == code || // Mc CHAKMA VOWEL SIGN E\r\n\t\t0x11182 == code || // Mc SHARADA SIGN VISARGA\r\n\t\t(0x111B3 <= code && code <= 0x111B5) || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II\r\n\t\t(0x111BF <= code && code <= 0x111C0) || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA\r\n\t\t(0x1122C <= code && code <= 0x1122E) || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II\r\n\t\t(0x11232 <= code && code <= 0x11233) || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU\r\n\t\t0x11235 == code || // Mc KHOJKI SIGN VIRAMA\r\n\t\t(0x112E0 <= code && code <= 0x112E2) || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II\r\n\t\t(0x11302 <= code && code <= 0x11303) || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA\r\n\t\t0x1133F == code || // Mc GRANTHA VOWEL SIGN I\r\n\t\t(0x11341 <= code && code <= 0x11344) || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR\r\n\t\t(0x11347 <= code && code <= 0x11348) || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI\r\n\t\t(0x1134B <= code && code <= 0x1134D) || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA\r\n\t\t(0x11362 <= code && code <= 0x11363) || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL\r\n\t\t(0x11435 <= code && code <= 0x11437) || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II\r\n\t\t(0x11440 <= code && code <= 0x11441) || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU\r\n\t\t0x11445 == code || // Mc NEWA SIGN VISARGA\r\n\t\t(0x114B1 <= code && code <= 0x114B2) || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II\r\n\t\t0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E\r\n\t\t(0x114BB <= code && code <= 0x114BC) || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O\r\n\t\t0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU\r\n\t\t0x114C1 == code || // Mc TIRHUTA SIGN VISARGA\r\n\t\t(0x115B0 <= code && code <= 0x115B1) || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II\r\n\t\t(0x115B8 <= code && code <= 0x115BB) || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU\r\n\t\t0x115BE == code || // Mc SIDDHAM SIGN VISARGA\r\n\t\t(0x11630 <= code && code <= 0x11632) || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II\r\n\t\t(0x1163B <= code && code <= 0x1163C) || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU\r\n\t\t0x1163E == code || // Mc MODI SIGN VISARGA\r\n\t\t0x116AC == code || // Mc TAKRI SIGN VISARGA\r\n\t\t(0x116AE <= code && code <= 0x116AF) || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II\r\n\t\t0x116B6 == code || // Mc TAKRI SIGN VIRAMA\r\n\t\t(0x11720 <= code && code <= 0x11721) || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA\r\n\t\t0x11726 == code || // Mc AHOM VOWEL SIGN E\r\n\t\t(0x11A07 <= code && code <= 0x11A08) || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU\r\n\t\t0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA\r\n\t\t(0x11A57 <= code && code <= 0x11A58) || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU\r\n\t\t0x11A97 == code || // Mc SOYOMBO SIGN VISARGA\r\n\t\t0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA\r\n\t\t0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA\r\n\t\t0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA\r\n\t\t0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I\r\n\t\t0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O\r\n\t\t(0x16F51 <= code && code <= 0x16F7E) || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG\r\n\t\t0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM\r\n\t\t0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT\r\n\t\t){\r\n\t\t\treturn SpacingMark;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1100 <= code && code <= 0x115F) || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER\r\n\t\t(0xA960 <= code && code <= 0xA97C) // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH\r\n\t\t){\r\n\t\t\treturn L;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t(0x1160 <= code && code <= 0x11A7) || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE\r\n\t\t(0xD7B0 <= code && code <= 0xD7C6) // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E\r\n\t\t){\r\n\t\t\treturn V;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(\r\n\t\t(0x11A8 <= code && code <= 0x11FF) || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN\r\n\t\t(0xD7CB <= code && code <= 0xD7FB) // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH\r\n\t\t){\r\n\t\t\treturn T;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0xAC00 == code || // Lo HANGUL SYLLABLE GA\r\n\t\t0xAC1C == code || // Lo HANGUL SYLLABLE GAE\r\n\t\t0xAC38 == code || // Lo HANGUL SYLLABLE GYA\r\n\t\t0xAC54 == code || // Lo HANGUL SYLLABLE GYAE\r\n\t\t0xAC70 == code || // Lo HANGUL SYLLABLE GEO\r\n\t\t0xAC8C == code || // Lo HANGUL SYLLABLE GE\r\n\t\t0xACA8 == code || // Lo HANGUL SYLLABLE GYEO\r\n\t\t0xACC4 == code || // Lo HANGUL SYLLABLE GYE\r\n\t\t0xACE0 == code || // Lo HANGUL SYLLABLE GO\r\n\t\t0xACFC == code || // Lo HANGUL SYLLABLE GWA\r\n\t\t0xAD18 == code || // Lo HANGUL SYLLABLE GWAE\r\n\t\t0xAD34 == code || // Lo HANGUL SYLLABLE GOE\r\n\t\t0xAD50 == code || // Lo HANGUL SYLLABLE GYO\r\n\t\t0xAD6C == code || // Lo HANGUL SYLLABLE GU\r\n\t\t0xAD88 == code || // Lo HANGUL SYLLABLE GWEO\r\n\t\t0xADA4 == code || // Lo HANGUL SYLLABLE GWE\r\n\t\t0xADC0 == code || // Lo HANGUL SYLLABLE GWI\r\n\t\t0xADDC == code || // Lo HANGUL SYLLABLE GYU\r\n\t\t0xADF8 == code || // Lo HANGUL SYLLABLE GEU\r\n\t\t0xAE14 == code || // Lo HANGUL SYLLABLE GYI\r\n\t\t0xAE30 == code || // Lo HANGUL SYLLABLE GI\r\n\t\t0xAE4C == code || // Lo HANGUL SYLLABLE GGA\r\n\t\t0xAE68 == code || // Lo HANGUL SYLLABLE GGAE\r\n\t\t0xAE84 == code || // Lo HANGUL SYLLABLE GGYA\r\n\t\t0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE\r\n\t\t0xAEBC == code || // Lo HANGUL SYLLABLE GGEO\r\n\t\t0xAED8 == code || // Lo HANGUL SYLLABLE GGE\r\n\t\t0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO\r\n\t\t0xAF10 == code || // Lo HANGUL SYLLABLE GGYE\r\n\t\t0xAF2C == code || // Lo HANGUL SYLLABLE GGO\r\n\t\t0xAF48 == code || // Lo HANGUL SYLLABLE GGWA\r\n\t\t0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE\r\n\t\t0xAF80 == code || // Lo HANGUL SYLLABLE GGOE\r\n\t\t0xAF9C == code || // Lo HANGUL SYLLABLE GGYO\r\n\t\t0xAFB8 == code || // Lo HANGUL SYLLABLE GGU\r\n\t\t0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO\r\n\t\t0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE\r\n\t\t0xB00C == code || // Lo HANGUL SYLLABLE GGWI\r\n\t\t0xB028 == code || // Lo HANGUL SYLLABLE GGYU\r\n\t\t0xB044 == code || // Lo HANGUL SYLLABLE GGEU\r\n\t\t0xB060 == code || // Lo HANGUL SYLLABLE GGYI\r\n\t\t0xB07C == code || // Lo HANGUL SYLLABLE GGI\r\n\t\t0xB098 == code || // Lo HANGUL SYLLABLE NA\r\n\t\t0xB0B4 == code || // Lo HANGUL SYLLABLE NAE\r\n\t\t0xB0D0 == code || // Lo HANGUL SYLLABLE NYA\r\n\t\t0xB0EC == code || // Lo HANGUL SYLLABLE NYAE\r\n\t\t0xB108 == code || // Lo HANGUL SYLLABLE NEO\r\n\t\t0xB124 == code || // Lo HANGUL SYLLABLE NE\r\n\t\t0xB140 == code || // Lo HANGUL SYLLABLE NYEO\r\n\t\t0xB15C == code || // Lo HANGUL SYLLABLE NYE\r\n\t\t0xB178 == code || // Lo HANGUL SYLLABLE NO\r\n\t\t0xB194 == code || // Lo HANGUL SYLLABLE NWA\r\n\t\t0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE\r\n\t\t0xB1CC == code || // Lo HANGUL SYLLABLE NOE\r\n\t\t0xB1E8 == code || // Lo HANGUL SYLLABLE NYO\r\n\t\t0xB204 == code || // Lo HANGUL SYLLABLE NU\r\n\t\t0xB220 == code || // Lo HANGUL SYLLABLE NWEO\r\n\t\t0xB23C == code || // Lo HANGUL SYLLABLE NWE\r\n\t\t0xB258 == code || // Lo HANGUL SYLLABLE NWI\r\n\t\t0xB274 == code || // Lo HANGUL SYLLABLE NYU\r\n\t\t0xB290 == code || // Lo HANGUL SYLLABLE NEU\r\n\t\t0xB2AC == code || // Lo HANGUL SYLLABLE NYI\r\n\t\t0xB2C8 == code || // Lo HANGUL SYLLABLE NI\r\n\t\t0xB2E4 == code || // Lo HANGUL SYLLABLE DA\r\n\t\t0xB300 == code || // Lo HANGUL SYLLABLE DAE\r\n\t\t0xB31C == code || // Lo HANGUL SYLLABLE DYA\r\n\t\t0xB338 == code || // Lo HANGUL SYLLABLE DYAE\r\n\t\t0xB354 == code || // Lo HANGUL SYLLABLE DEO\r\n\t\t0xB370 == code || // Lo HANGUL SYLLABLE DE\r\n\t\t0xB38C == code || // Lo HANGUL SYLLABLE DYEO\r\n\t\t0xB3A8 == code || // Lo HANGUL SYLLABLE DYE\r\n\t\t0xB3C4 == code || // Lo HANGUL SYLLABLE DO\r\n\t\t0xB3E0 == code || // Lo HANGUL SYLLABLE DWA\r\n\t\t0xB3FC == code || // Lo HANGUL SYLLABLE DWAE\r\n\t\t0xB418 == code || // Lo HANGUL SYLLABLE DOE\r\n\t\t0xB434 == code || // Lo HANGUL SYLLABLE DYO\r\n\t\t0xB450 == code || // Lo HANGUL SYLLABLE DU\r\n\t\t0xB46C == code || // Lo HANGUL SYLLABLE DWEO\r\n\t\t0xB488 == code || // Lo HANGUL SYLLABLE DWE\r\n\t\t0xB4A4 == code || // Lo HANGUL SYLLABLE DWI\r\n\t\t0xB4C0 == code || // Lo HANGUL SYLLABLE DYU\r\n\t\t0xB4DC == code || // Lo HANGUL SYLLABLE DEU\r\n\t\t0xB4F8 == code || // Lo HANGUL SYLLABLE DYI\r\n\t\t0xB514 == code || // Lo HANGUL SYLLABLE DI\r\n\t\t0xB530 == code || // Lo HANGUL SYLLABLE DDA\r\n\t\t0xB54C == code || // Lo HANGUL SYLLABLE DDAE\r\n\t\t0xB568 == code || // Lo HANGUL SYLLABLE DDYA\r\n\t\t0xB584 == code || // Lo HANGUL SYLLABLE DDYAE\r\n\t\t0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO\r\n\t\t0xB5BC == code || // Lo HANGUL SYLLABLE DDE\r\n\t\t0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO\r\n\t\t0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE\r\n\t\t0xB610 == code || // Lo HANGUL SYLLABLE DDO\r\n\t\t0xB62C == code || // Lo HANGUL SYLLABLE DDWA\r\n\t\t0xB648 == code || // Lo HANGUL SYLLABLE DDWAE\r\n\t\t0xB664 == code || // Lo HANGUL SYLLABLE DDOE\r\n\t\t0xB680 == code || // Lo HANGUL SYLLABLE DDYO\r\n\t\t0xB69C == code || // Lo HANGUL SYLLABLE DDU\r\n\t\t0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO\r\n\t\t0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE\r\n\t\t0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI\r\n\t\t0xB70C == code || // Lo HANGUL SYLLABLE DDYU\r\n\t\t0xB728 == code || // Lo HANGUL SYLLABLE DDEU\r\n\t\t0xB744 == code || // Lo HANGUL SYLLABLE DDYI\r\n\t\t0xB760 == code || // Lo HANGUL SYLLABLE DDI\r\n\t\t0xB77C == code || // Lo HANGUL SYLLABLE RA\r\n\t\t0xB798 == code || // Lo HANGUL SYLLABLE RAE\r\n\t\t0xB7B4 == code || // Lo HANGUL SYLLABLE RYA\r\n\t\t0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE\r\n\t\t0xB7EC == code || // Lo HANGUL SYLLABLE REO\r\n\t\t0xB808 == code || // Lo HANGUL SYLLABLE RE\r\n\t\t0xB824 == code || // Lo HANGUL SYLLABLE RYEO\r\n\t\t0xB840 == code || // Lo HANGUL SYLLABLE RYE\r\n\t\t0xB85C == code || // Lo HANGUL SYLLABLE RO\r\n\t\t0xB878 == code || // Lo HANGUL SYLLABLE RWA\r\n\t\t0xB894 == code || // Lo HANGUL SYLLABLE RWAE\r\n\t\t0xB8B0 == code || // Lo HANGUL SYLLABLE ROE\r\n\t\t0xB8CC == code || // Lo HANGUL SYLLABLE RYO\r\n\t\t0xB8E8 == code || // Lo HANGUL SYLLABLE RU\r\n\t\t0xB904 == code || // Lo HANGUL SYLLABLE RWEO\r\n\t\t0xB920 == code || // Lo HANGUL SYLLABLE RWE\r\n\t\t0xB93C == code || // Lo HANGUL SYLLABLE RWI\r\n\t\t0xB958 == code || // Lo HANGUL SYLLABLE RYU\r\n\t\t0xB974 == code || // Lo HANGUL SYLLABLE REU\r\n\t\t0xB990 == code || // Lo HANGUL SYLLABLE RYI\r\n\t\t0xB9AC == code || // Lo HANGUL SYLLABLE RI\r\n\t\t0xB9C8 == code || // Lo HANGUL SYLLABLE MA\r\n\t\t0xB9E4 == code || // Lo HANGUL SYLLABLE MAE\r\n\t\t0xBA00 == code || // Lo HANGUL SYLLABLE MYA\r\n\t\t0xBA1C == code || // Lo HANGUL SYLLABLE MYAE\r\n\t\t0xBA38 == code || // Lo HANGUL SYLLABLE MEO\r\n\t\t0xBA54 == code || // Lo HANGUL SYLLABLE ME\r\n\t\t0xBA70 == code || // Lo HANGUL SYLLABLE MYEO\r\n\t\t0xBA8C == code || // Lo HANGUL SYLLABLE MYE\r\n\t\t0xBAA8 == code || // Lo HANGUL SYLLABLE MO\r\n\t\t0xBAC4 == code || // Lo HANGUL SYLLABLE MWA\r\n\t\t0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE\r\n\t\t0xBAFC == code || // Lo HANGUL SYLLABLE MOE\r\n\t\t0xBB18 == code || // Lo HANGUL SYLLABLE MYO\r\n\t\t0xBB34 == code || // Lo HANGUL SYLLABLE MU\r\n\t\t0xBB50 == code || // Lo HANGUL SYLLABLE MWEO\r\n\t\t0xBB6C == code || // Lo HANGUL SYLLABLE MWE\r\n\t\t0xBB88 == code || // Lo HANGUL SYLLABLE MWI\r\n\t\t0xBBA4 == code || // Lo HANGUL SYLLABLE MYU\r\n\t\t0xBBC0 == code || // Lo HANGUL SYLLABLE MEU\r\n\t\t0xBBDC == code || // Lo HANGUL SYLLABLE MYI\r\n\t\t0xBBF8 == code || // Lo HANGUL SYLLABLE MI\r\n\t\t0xBC14 == code || // Lo HANGUL SYLLABLE BA\r\n\t\t0xBC30 == code || // Lo HANGUL SYLLABLE BAE\r\n\t\t0xBC4C == code || // Lo HANGUL SYLLABLE BYA\r\n\t\t0xBC68 == code || // Lo HANGUL SYLLABLE BYAE\r\n\t\t0xBC84 == code || // Lo HANGUL SYLLABLE BEO\r\n\t\t0xBCA0 == code || // Lo HANGUL SYLLABLE BE\r\n\t\t0xBCBC == code || // Lo HANGUL SYLLABLE BYEO\r\n\t\t0xBCD8 == code || // Lo HANGUL SYLLABLE BYE\r\n\t\t0xBCF4 == code || // Lo HANGUL SYLLABLE BO\r\n\t\t0xBD10 == code || // Lo HANGUL SYLLABLE BWA\r\n\t\t0xBD2C == code || // Lo HANGUL SYLLABLE BWAE\r\n\t\t0xBD48 == code || // Lo HANGUL SYLLABLE BOE\r\n\t\t0xBD64 == code || // Lo HANGUL SYLLABLE BYO\r\n\t\t0xBD80 == code || // Lo HANGUL SYLLABLE BU\r\n\t\t0xBD9C == code || // Lo HANGUL SYLLABLE BWEO\r\n\t\t0xBDB8 == code || // Lo HANGUL SYLLABLE BWE\r\n\t\t0xBDD4 == code || // Lo HANGUL SYLLABLE BWI\r\n\t\t0xBDF0 == code || // Lo HANGUL SYLLABLE BYU\r\n\t\t0xBE0C == code || // Lo HANGUL SYLLABLE BEU\r\n\t\t0xBE28 == code || // Lo HANGUL SYLLABLE BYI\r\n\t\t0xBE44 == code || // Lo HANGUL SYLLABLE BI\r\n\t\t0xBE60 == code || // Lo HANGUL SYLLABLE BBA\r\n\t\t0xBE7C == code || // Lo HANGUL SYLLABLE BBAE\r\n\t\t0xBE98 == code || // Lo HANGUL SYLLABLE BBYA\r\n\t\t0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE\r\n\t\t0xBED0 == code || // Lo HANGUL SYLLABLE BBEO\r\n\t\t0xBEEC == code || // Lo HANGUL SYLLABLE BBE\r\n\t\t0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO\r\n\t\t0xBF24 == code || // Lo HANGUL SYLLABLE BBYE\r\n\t\t0xBF40 == code || // Lo HANGUL SYLLABLE BBO\r\n\t\t0xBF5C == code || // Lo HANGUL SYLLABLE BBWA\r\n\t\t0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE\r\n\t\t0xBF94 == code || // Lo HANGUL SYLLABLE BBOE\r\n\t\t0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO\r\n\t\t0xBFCC == code || // Lo HANGUL SYLLABLE BBU\r\n\t\t0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO\r\n\t\t0xC004 == code || // Lo HANGUL SYLLABLE BBWE\r\n\t\t0xC020 == code || // Lo HANGUL SYLLABLE BBWI\r\n\t\t0xC03C == code || // Lo HANGUL SYLLABLE BBYU\r\n\t\t0xC058 == code || // Lo HANGUL SYLLABLE BBEU\r\n\t\t0xC074 == code || // Lo HANGUL SYLLABLE BBYI\r\n\t\t0xC090 == code || // Lo HANGUL SYLLABLE BBI\r\n\t\t0xC0AC == code || // Lo HANGUL SYLLABLE SA\r\n\t\t0xC0C8 == code || // Lo HANGUL SYLLABLE SAE\r\n\t\t0xC0E4 == code || // Lo HANGUL SYLLABLE SYA\r\n\t\t0xC100 == code || // Lo HANGUL SYLLABLE SYAE\r\n\t\t0xC11C == code || // Lo HANGUL SYLLABLE SEO\r\n\t\t0xC138 == code || // Lo HANGUL SYLLABLE SE\r\n\t\t0xC154 == code || // Lo HANGUL SYLLABLE SYEO\r\n\t\t0xC170 == code || // Lo HANGUL SYLLABLE SYE\r\n\t\t0xC18C == code || // Lo HANGUL SYLLABLE SO\r\n\t\t0xC1A8 == code || // Lo HANGUL SYLLABLE SWA\r\n\t\t0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE\r\n\t\t0xC1E0 == code || // Lo HANGUL SYLLABLE SOE\r\n\t\t0xC1FC == code || // Lo HANGUL SYLLABLE SYO\r\n\t\t0xC218 == code || // Lo HANGUL SYLLABLE SU\r\n\t\t0xC234 == code || // Lo HANGUL SYLLABLE SWEO\r\n\t\t0xC250 == code || // Lo HANGUL SYLLABLE SWE\r\n\t\t0xC26C == code || // Lo HANGUL SYLLABLE SWI\r\n\t\t0xC288 == code || // Lo HANGUL SYLLABLE SYU\r\n\t\t0xC2A4 == code || // Lo HANGUL SYLLABLE SEU\r\n\t\t0xC2C0 == code || // Lo HANGUL SYLLABLE SYI\r\n\t\t0xC2DC == code || // Lo HANGUL SYLLABLE SI\r\n\t\t0xC2F8 == code || // Lo HANGUL SYLLABLE SSA\r\n\t\t0xC314 == code || // Lo HANGUL SYLLABLE SSAE\r\n\t\t0xC330 == code || // Lo HANGUL SYLLABLE SSYA\r\n\t\t0xC34C == code || // Lo HANGUL SYLLABLE SSYAE\r\n\t\t0xC368 == code || // Lo HANGUL SYLLABLE SSEO\r\n\t\t0xC384 == code || // Lo HANGUL SYLLABLE SSE\r\n\t\t0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO\r\n\t\t0xC3BC == code || // Lo HANGUL SYLLABLE SSYE\r\n\t\t0xC3D8 == code || // Lo HANGUL SYLLABLE SSO\r\n\t\t0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA\r\n\t\t0xC410 == code || // Lo HANGUL SYLLABLE SSWAE\r\n\t\t0xC42C == code || // Lo HANGUL SYLLABLE SSOE\r\n\t\t0xC448 == code || // Lo HANGUL SYLLABLE SSYO\r\n\t\t0xC464 == code || // Lo HANGUL SYLLABLE SSU\r\n\t\t0xC480 == code || // Lo HANGUL SYLLABLE SSWEO\r\n\t\t0xC49C == code || // Lo HANGUL SYLLABLE SSWE\r\n\t\t0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI\r\n\t\t0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU\r\n\t\t0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU\r\n\t\t0xC50C == code || // Lo HANGUL SYLLABLE SSYI\r\n\t\t0xC528 == code || // Lo HANGUL SYLLABLE SSI\r\n\t\t0xC544 == code || // Lo HANGUL SYLLABLE A\r\n\t\t0xC560 == code || // Lo HANGUL SYLLABLE AE\r\n\t\t0xC57C == code || // Lo HANGUL SYLLABLE YA\r\n\t\t0xC598 == code || // Lo HANGUL SYLLABLE YAE\r\n\t\t0xC5B4 == code || // Lo HANGUL SYLLABLE EO\r\n\t\t0xC5D0 == code || // Lo HANGUL SYLLABLE E\r\n\t\t0xC5EC == code || // Lo HANGUL SYLLABLE YEO\r\n\t\t0xC608 == code || // Lo HANGUL SYLLABLE YE\r\n\t\t0xC624 == code || // Lo HANGUL SYLLABLE O\r\n\t\t0xC640 == code || // Lo HANGUL SYLLABLE WA\r\n\t\t0xC65C == code || // Lo HANGUL SYLLABLE WAE\r\n\t\t0xC678 == code || // Lo HANGUL SYLLABLE OE\r\n\t\t0xC694 == code || // Lo HANGUL SYLLABLE YO\r\n\t\t0xC6B0 == code || // Lo HANGUL SYLLABLE U\r\n\t\t0xC6CC == code || // Lo HANGUL SYLLABLE WEO\r\n\t\t0xC6E8 == code || // Lo HANGUL SYLLABLE WE\r\n\t\t0xC704 == code || // Lo HANGUL SYLLABLE WI\r\n\t\t0xC720 == code || // Lo HANGUL SYLLABLE YU\r\n\t\t0xC73C == code || // Lo HANGUL SYLLABLE EU\r\n\t\t0xC758 == code || // Lo HANGUL SYLLABLE YI\r\n\t\t0xC774 == code || // Lo HANGUL SYLLABLE I\r\n\t\t0xC790 == code || // Lo HANGUL SYLLABLE JA\r\n\t\t0xC7AC == code || // Lo HANGUL SYLLABLE JAE\r\n\t\t0xC7C8 == code || // Lo HANGUL SYLLABLE JYA\r\n\t\t0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE\r\n\t\t0xC800 == code || // Lo HANGUL SYLLABLE JEO\r\n\t\t0xC81C == code || // Lo HANGUL SYLLABLE JE\r\n\t\t0xC838 == code || // Lo HANGUL SYLLABLE JYEO\r\n\t\t0xC854 == code || // Lo HANGUL SYLLABLE JYE\r\n\t\t0xC870 == code || // Lo HANGUL SYLLABLE JO\r\n\t\t0xC88C == code || // Lo HANGUL SYLLABLE JWA\r\n\t\t0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE\r\n\t\t0xC8C4 == code || // Lo HANGUL SYLLABLE JOE\r\n\t\t0xC8E0 == code || // Lo HANGUL SYLLABLE JYO\r\n\t\t0xC8FC == code || // Lo HANGUL SYLLABLE JU\r\n\t\t0xC918 == code || // Lo HANGUL SYLLABLE JWEO\r\n\t\t0xC934 == code || // Lo HANGUL SYLLABLE JWE\r\n\t\t0xC950 == code || // Lo HANGUL SYLLABLE JWI\r\n\t\t0xC96C == code || // Lo HANGUL SYLLABLE JYU\r\n\t\t0xC988 == code || // Lo HANGUL SYLLABLE JEU\r\n\t\t0xC9A4 == code || // Lo HANGUL SYLLABLE JYI\r\n\t\t0xC9C0 == code || // Lo HANGUL SYLLABLE JI\r\n\t\t0xC9DC == code || // Lo HANGUL SYLLABLE JJA\r\n\t\t0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE\r\n\t\t0xCA14 == code || // Lo HANGUL SYLLABLE JJYA\r\n\t\t0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE\r\n\t\t0xCA4C == code || // Lo HANGUL SYLLABLE JJEO\r\n\t\t0xCA68 == code || // Lo HANGUL SYLLABLE JJE\r\n\t\t0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO\r\n\t\t0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE\r\n\t\t0xCABC == code || // Lo HANGUL SYLLABLE JJO\r\n\t\t0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA\r\n\t\t0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE\r\n\t\t0xCB10 == code || // Lo HANGUL SYLLABLE JJOE\r\n\t\t0xCB2C == code || // Lo HANGUL SYLLABLE JJYO\r\n\t\t0xCB48 == code || // Lo HANGUL SYLLABLE JJU\r\n\t\t0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO\r\n\t\t0xCB80 == code || // Lo HANGUL SYLLABLE JJWE\r\n\t\t0xCB9C == code || // Lo HANGUL SYLLABLE JJWI\r\n\t\t0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU\r\n\t\t0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU\r\n\t\t0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI\r\n\t\t0xCC0C == code || // Lo HANGUL SYLLABLE JJI\r\n\t\t0xCC28 == code || // Lo HANGUL SYLLABLE CA\r\n\t\t0xCC44 == code || // Lo HANGUL SYLLABLE CAE\r\n\t\t0xCC60 == code || // Lo HANGUL SYLLABLE CYA\r\n\t\t0xCC7C == code || // Lo HANGUL SYLLABLE CYAE\r\n\t\t0xCC98 == code || // Lo HANGUL SYLLABLE CEO\r\n\t\t0xCCB4 == code || // Lo HANGUL SYLLABLE CE\r\n\t\t0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO\r\n\t\t0xCCEC == code || // Lo HANGUL SYLLABLE CYE\r\n\t\t0xCD08 == code || // Lo HANGUL SYLLABLE CO\r\n\t\t0xCD24 == code || // Lo HANGUL SYLLABLE CWA\r\n\t\t0xCD40 == code || // Lo HANGUL SYLLABLE CWAE\r\n\t\t0xCD5C == code || // Lo HANGUL SYLLABLE COE\r\n\t\t0xCD78 == code || // Lo HANGUL SYLLABLE CYO\r\n\t\t0xCD94 == code || // Lo HANGUL SYLLABLE CU\r\n\t\t0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO\r\n\t\t0xCDCC == code || // Lo HANGUL SYLLABLE CWE\r\n\t\t0xCDE8 == code || // Lo HANGUL SYLLABLE CWI\r\n\t\t0xCE04 == code || // Lo HANGUL SYLLABLE CYU\r\n\t\t0xCE20 == code || // Lo HANGUL SYLLABLE CEU\r\n\t\t0xCE3C == code || // Lo HANGUL SYLLABLE CYI\r\n\t\t0xCE58 == code || // Lo HANGUL SYLLABLE CI\r\n\t\t0xCE74 == code || // Lo HANGUL SYLLABLE KA\r\n\t\t0xCE90 == code || // Lo HANGUL SYLLABLE KAE\r\n\t\t0xCEAC == code || // Lo HANGUL SYLLABLE KYA\r\n\t\t0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE\r\n\t\t0xCEE4 == code || // Lo HANGUL SYLLABLE KEO\r\n\t\t0xCF00 == code || // Lo HANGUL SYLLABLE KE\r\n\t\t0xCF1C == code || // Lo HANGUL SYLLABLE KYEO\r\n\t\t0xCF38 == code || // Lo HANGUL SYLLABLE KYE\r\n\t\t0xCF54 == code || // Lo HANGUL SYLLABLE KO\r\n\t\t0xCF70 == code || // Lo HANGUL SYLLABLE KWA\r\n\t\t0xCF8C == code || // Lo HANGUL SYLLABLE KWAE\r\n\t\t0xCFA8 == code || // Lo HANGUL SYLLABLE KOE\r\n\t\t0xCFC4 == code || // Lo HANGUL SYLLABLE KYO\r\n\t\t0xCFE0 == code || // Lo HANGUL SYLLABLE KU\r\n\t\t0xCFFC == code || // Lo HANGUL SYLLABLE KWEO\r\n\t\t0xD018 == code || // Lo HANGUL SYLLABLE KWE\r\n\t\t0xD034 == code || // Lo HANGUL SYLLABLE KWI\r\n\t\t0xD050 == code || // Lo HANGUL SYLLABLE KYU\r\n\t\t0xD06C == code || // Lo HANGUL SYLLABLE KEU\r\n\t\t0xD088 == code || // Lo HANGUL SYLLABLE KYI\r\n\t\t0xD0A4 == code || // Lo HANGUL SYLLABLE KI\r\n\t\t0xD0C0 == code || // Lo HANGUL SYLLABLE TA\r\n\t\t0xD0DC == code || // Lo HANGUL SYLLABLE TAE\r\n\t\t0xD0F8 == code || // Lo HANGUL SYLLABLE TYA\r\n\t\t0xD114 == code || // Lo HANGUL SYLLABLE TYAE\r\n\t\t0xD130 == code || // Lo HANGUL SYLLABLE TEO\r\n\t\t0xD14C == code || // Lo HANGUL SYLLABLE TE\r\n\t\t0xD168 == code || // Lo HANGUL SYLLABLE TYEO\r\n\t\t0xD184 == code || // Lo HANGUL SYLLABLE TYE\r\n\t\t0xD1A0 == code || // Lo HANGUL SYLLABLE TO\r\n\t\t0xD1BC == code || // Lo HANGUL SYLLABLE TWA\r\n\t\t0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE\r\n\t\t0xD1F4 == code || // Lo HANGUL SYLLABLE TOE\r\n\t\t0xD210 == code || // Lo HANGUL SYLLABLE TYO\r\n\t\t0xD22C == code || // Lo HANGUL SYLLABLE TU\r\n\t\t0xD248 == code || // Lo HANGUL SYLLABLE TWEO\r\n\t\t0xD264 == code || // Lo HANGUL SYLLABLE TWE\r\n\t\t0xD280 == code || // Lo HANGUL SYLLABLE TWI\r\n\t\t0xD29C == code || // Lo HANGUL SYLLABLE TYU\r\n\t\t0xD2B8 == code || // Lo HANGUL SYLLABLE TEU\r\n\t\t0xD2D4 == code || // Lo HANGUL SYLLABLE TYI\r\n\t\t0xD2F0 == code || // Lo HANGUL SYLLABLE TI\r\n\t\t0xD30C == code || // Lo HANGUL SYLLABLE PA\r\n\t\t0xD328 == code || // Lo HANGUL SYLLABLE PAE\r\n\t\t0xD344 == code || // Lo HANGUL SYLLABLE PYA\r\n\t\t0xD360 == code || // Lo HANGUL SYLLABLE PYAE\r\n\t\t0xD37C == code || // Lo HANGUL SYLLABLE PEO\r\n\t\t0xD398 == code || // Lo HANGUL SYLLABLE PE\r\n\t\t0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO\r\n\t\t0xD3D0 == code || // Lo HANGUL SYLLABLE PYE\r\n\t\t0xD3EC == code || // Lo HANGUL SYLLABLE PO\r\n\t\t0xD408 == code || // Lo HANGUL SYLLABLE PWA\r\n\t\t0xD424 == code || // Lo HANGUL SYLLABLE PWAE\r\n\t\t0xD440 == code || // Lo HANGUL SYLLABLE POE\r\n\t\t0xD45C == code || // Lo HANGUL SYLLABLE PYO\r\n\t\t0xD478 == code || // Lo HANGUL SYLLABLE PU\r\n\t\t0xD494 == code || // Lo HANGUL SYLLABLE PWEO\r\n\t\t0xD4B0 == code || // Lo HANGUL SYLLABLE PWE\r\n\t\t0xD4CC == code || // Lo HANGUL SYLLABLE PWI\r\n\t\t0xD4E8 == code || // Lo HANGUL SYLLABLE PYU\r\n\t\t0xD504 == code || // Lo HANGUL SYLLABLE PEU\r\n\t\t0xD520 == code || // Lo HANGUL SYLLABLE PYI\r\n\t\t0xD53C == code || // Lo HANGUL SYLLABLE PI\r\n\t\t0xD558 == code || // Lo HANGUL SYLLABLE HA\r\n\t\t0xD574 == code || // Lo HANGUL SYLLABLE HAE\r\n\t\t0xD590 == code || // Lo HANGUL SYLLABLE HYA\r\n\t\t0xD5AC == code || // Lo HANGUL SYLLABLE HYAE\r\n\t\t0xD5C8 == code || // Lo HANGUL SYLLABLE HEO\r\n\t\t0xD5E4 == code || // Lo HANGUL SYLLABLE HE\r\n\t\t0xD600 == code || // Lo HANGUL SYLLABLE HYEO\r\n\t\t0xD61C == code || // Lo HANGUL SYLLABLE HYE\r\n\t\t0xD638 == code || // Lo HANGUL SYLLABLE HO\r\n\t\t0xD654 == code || // Lo HANGUL SYLLABLE HWA\r\n\t\t0xD670 == code || // Lo HANGUL SYLLABLE HWAE\r\n\t\t0xD68C == code || // Lo HANGUL SYLLABLE HOE\r\n\t\t0xD6A8 == code || // Lo HANGUL SYLLABLE HYO\r\n\t\t0xD6C4 == code || // Lo HANGUL SYLLABLE HU\r\n\t\t0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO\r\n\t\t0xD6FC == code || // Lo HANGUL SYLLABLE HWE\r\n\t\t0xD718 == code || // Lo HANGUL SYLLABLE HWI\r\n\t\t0xD734 == code || // Lo HANGUL SYLLABLE HYU\r\n\t\t0xD750 == code || // Lo HANGUL SYLLABLE HEU\r\n\t\t0xD76C == code || // Lo HANGUL SYLLABLE HYI\r\n\t\t0xD788 == code // Lo HANGUL SYLLABLE HI\r\n\t\t){\r\n\t\t\treturn LV;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t(0xAC01 <= code && code <= 0xAC1B) || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH\r\n\t\t(0xAC1D <= code && code <= 0xAC37) || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH\r\n\t\t(0xAC39 <= code && code <= 0xAC53) || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH\r\n\t\t(0xAC55 <= code && code <= 0xAC6F) || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH\r\n\t\t(0xAC71 <= code && code <= 0xAC8B) || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH\r\n\t\t(0xAC8D <= code && code <= 0xACA7) || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH\r\n\t\t(0xACA9 <= code && code <= 0xACC3) || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH\r\n\t\t(0xACC5 <= code && code <= 0xACDF) || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH\r\n\t\t(0xACE1 <= code && code <= 0xACFB) || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH\r\n\t\t(0xACFD <= code && code <= 0xAD17) || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH\r\n\t\t(0xAD19 <= code && code <= 0xAD33) || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH\r\n\t\t(0xAD35 <= code && code <= 0xAD4F) || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH\r\n\t\t(0xAD51 <= code && code <= 0xAD6B) || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH\r\n\t\t(0xAD6D <= code && code <= 0xAD87) || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH\r\n\t\t(0xAD89 <= code && code <= 0xADA3) || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH\r\n\t\t(0xADA5 <= code && code <= 0xADBF) || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH\r\n\t\t(0xADC1 <= code && code <= 0xADDB) || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH\r\n\t\t(0xADDD <= code && code <= 0xADF7) || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH\r\n\t\t(0xADF9 <= code && code <= 0xAE13) || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH\r\n\t\t(0xAE15 <= code && code <= 0xAE2F) || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH\r\n\t\t(0xAE31 <= code && code <= 0xAE4B) || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH\r\n\t\t(0xAE4D <= code && code <= 0xAE67) || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH\r\n\t\t(0xAE69 <= code && code <= 0xAE83) || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH\r\n\t\t(0xAE85 <= code && code <= 0xAE9F) || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH\r\n\t\t(0xAEA1 <= code && code <= 0xAEBB) || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH\r\n\t\t(0xAEBD <= code && code <= 0xAED7) || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH\r\n\t\t(0xAED9 <= code && code <= 0xAEF3) || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH\r\n\t\t(0xAEF5 <= code && code <= 0xAF0F) || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH\r\n\t\t(0xAF11 <= code && code <= 0xAF2B) || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH\r\n\t\t(0xAF2D <= code && code <= 0xAF47) || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH\r\n\t\t(0xAF49 <= code && code <= 0xAF63) || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH\r\n\t\t(0xAF65 <= code && code <= 0xAF7F) || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH\r\n\t\t(0xAF81 <= code && code <= 0xAF9B) || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH\r\n\t\t(0xAF9D <= code && code <= 0xAFB7) || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH\r\n\t\t(0xAFB9 <= code && code <= 0xAFD3) || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH\r\n\t\t(0xAFD5 <= code && code <= 0xAFEF) || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH\r\n\t\t(0xAFF1 <= code && code <= 0xB00B) || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH\r\n\t\t(0xB00D <= code && code <= 0xB027) || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH\r\n\t\t(0xB029 <= code && code <= 0xB043) || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH\r\n\t\t(0xB045 <= code && code <= 0xB05F) || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH\r\n\t\t(0xB061 <= code && code <= 0xB07B) || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH\r\n\t\t(0xB07D <= code && code <= 0xB097) || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH\r\n\t\t(0xB099 <= code && code <= 0xB0B3) || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH\r\n\t\t(0xB0B5 <= code && code <= 0xB0CF) || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH\r\n\t\t(0xB0D1 <= code && code <= 0xB0EB) || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH\r\n\t\t(0xB0ED <= code && code <= 0xB107) || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH\r\n\t\t(0xB109 <= code && code <= 0xB123) || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH\r\n\t\t(0xB125 <= code && code <= 0xB13F) || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH\r\n\t\t(0xB141 <= code && code <= 0xB15B) || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH\r\n\t\t(0xB15D <= code && code <= 0xB177) || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH\r\n\t\t(0xB179 <= code && code <= 0xB193) || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH\r\n\t\t(0xB195 <= code && code <= 0xB1AF) || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH\r\n\t\t(0xB1B1 <= code && code <= 0xB1CB) || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH\r\n\t\t(0xB1CD <= code && code <= 0xB1E7) || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH\r\n\t\t(0xB1E9 <= code && code <= 0xB203) || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH\r\n\t\t(0xB205 <= code && code <= 0xB21F) || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH\r\n\t\t(0xB221 <= code && code <= 0xB23B) || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH\r\n\t\t(0xB23D <= code && code <= 0xB257) || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH\r\n\t\t(0xB259 <= code && code <= 0xB273) || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH\r\n\t\t(0xB275 <= code && code <= 0xB28F) || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH\r\n\t\t(0xB291 <= code && code <= 0xB2AB) || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH\r\n\t\t(0xB2AD <= code && code <= 0xB2C7) || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH\r\n\t\t(0xB2C9 <= code && code <= 0xB2E3) || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH\r\n\t\t(0xB2E5 <= code && code <= 0xB2FF) || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH\r\n\t\t(0xB301 <= code && code <= 0xB31B) || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH\r\n\t\t(0xB31D <= code && code <= 0xB337) || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH\r\n\t\t(0xB339 <= code && code <= 0xB353) || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH\r\n\t\t(0xB355 <= code && code <= 0xB36F) || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH\r\n\t\t(0xB371 <= code && code <= 0xB38B) || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH\r\n\t\t(0xB38D <= code && code <= 0xB3A7) || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH\r\n\t\t(0xB3A9 <= code && code <= 0xB3C3) || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH\r\n\t\t(0xB3C5 <= code && code <= 0xB3DF) || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH\r\n\t\t(0xB3E1 <= code && code <= 0xB3FB) || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH\r\n\t\t(0xB3FD <= code && code <= 0xB417) || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH\r\n\t\t(0xB419 <= code && code <= 0xB433) || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH\r\n\t\t(0xB435 <= code && code <= 0xB44F) || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH\r\n\t\t(0xB451 <= code && code <= 0xB46B) || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH\r\n\t\t(0xB46D <= code && code <= 0xB487) || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH\r\n\t\t(0xB489 <= code && code <= 0xB4A3) || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH\r\n\t\t(0xB4A5 <= code && code <= 0xB4BF) || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH\r\n\t\t(0xB4C1 <= code && code <= 0xB4DB) || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH\r\n\t\t(0xB4DD <= code && code <= 0xB4F7) || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH\r\n\t\t(0xB4F9 <= code && code <= 0xB513) || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH\r\n\t\t(0xB515 <= code && code <= 0xB52F) || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH\r\n\t\t(0xB531 <= code && code <= 0xB54B) || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH\r\n\t\t(0xB54D <= code && code <= 0xB567) || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH\r\n\t\t(0xB569 <= code && code <= 0xB583) || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH\r\n\t\t(0xB585 <= code && code <= 0xB59F) || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH\r\n\t\t(0xB5A1 <= code && code <= 0xB5BB) || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH\r\n\t\t(0xB5BD <= code && code <= 0xB5D7) || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH\r\n\t\t(0xB5D9 <= code && code <= 0xB5F3) || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH\r\n\t\t(0xB5F5 <= code && code <= 0xB60F) || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH\r\n\t\t(0xB611 <= code && code <= 0xB62B) || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH\r\n\t\t(0xB62D <= code && code <= 0xB647) || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH\r\n\t\t(0xB649 <= code && code <= 0xB663) || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH\r\n\t\t(0xB665 <= code && code <= 0xB67F) || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH\r\n\t\t(0xB681 <= code && code <= 0xB69B) || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH\r\n\t\t(0xB69D <= code && code <= 0xB6B7) || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH\r\n\t\t(0xB6B9 <= code && code <= 0xB6D3) || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH\r\n\t\t(0xB6D5 <= code && code <= 0xB6EF) || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH\r\n\t\t(0xB6F1 <= code && code <= 0xB70B) || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH\r\n\t\t(0xB70D <= code && code <= 0xB727) || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH\r\n\t\t(0xB729 <= code && code <= 0xB743) || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH\r\n\t\t(0xB745 <= code && code <= 0xB75F) || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH\r\n\t\t(0xB761 <= code && code <= 0xB77B) || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH\r\n\t\t(0xB77D <= code && code <= 0xB797) || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH\r\n\t\t(0xB799 <= code && code <= 0xB7B3) || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH\r\n\t\t(0xB7B5 <= code && code <= 0xB7CF) || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH\r\n\t\t(0xB7D1 <= code && code <= 0xB7EB) || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH\r\n\t\t(0xB7ED <= code && code <= 0xB807) || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH\r\n\t\t(0xB809 <= code && code <= 0xB823) || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH\r\n\t\t(0xB825 <= code && code <= 0xB83F) || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH\r\n\t\t(0xB841 <= code && code <= 0xB85B) || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH\r\n\t\t(0xB85D <= code && code <= 0xB877) || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH\r\n\t\t(0xB879 <= code && code <= 0xB893) || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH\r\n\t\t(0xB895 <= code && code <= 0xB8AF) || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH\r\n\t\t(0xB8B1 <= code && code <= 0xB8CB) || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH\r\n\t\t(0xB8CD <= code && code <= 0xB8E7) || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH\r\n\t\t(0xB8E9 <= code && code <= 0xB903) || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH\r\n\t\t(0xB905 <= code && code <= 0xB91F) || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH\r\n\t\t(0xB921 <= code && code <= 0xB93B) || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH\r\n\t\t(0xB93D <= code && code <= 0xB957) || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH\r\n\t\t(0xB959 <= code && code <= 0xB973) || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH\r\n\t\t(0xB975 <= code && code <= 0xB98F) || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH\r\n\t\t(0xB991 <= code && code <= 0xB9AB) || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH\r\n\t\t(0xB9AD <= code && code <= 0xB9C7) || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH\r\n\t\t(0xB9C9 <= code && code <= 0xB9E3) || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH\r\n\t\t(0xB9E5 <= code && code <= 0xB9FF) || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH\r\n\t\t(0xBA01 <= code && code <= 0xBA1B) || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH\r\n\t\t(0xBA1D <= code && code <= 0xBA37) || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH\r\n\t\t(0xBA39 <= code && code <= 0xBA53) || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH\r\n\t\t(0xBA55 <= code && code <= 0xBA6F) || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH\r\n\t\t(0xBA71 <= code && code <= 0xBA8B) || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH\r\n\t\t(0xBA8D <= code && code <= 0xBAA7) || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH\r\n\t\t(0xBAA9 <= code && code <= 0xBAC3) || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH\r\n\t\t(0xBAC5 <= code && code <= 0xBADF) || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH\r\n\t\t(0xBAE1 <= code && code <= 0xBAFB) || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH\r\n\t\t(0xBAFD <= code && code <= 0xBB17) || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH\r\n\t\t(0xBB19 <= code && code <= 0xBB33) || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH\r\n\t\t(0xBB35 <= code && code <= 0xBB4F) || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH\r\n\t\t(0xBB51 <= code && code <= 0xBB6B) || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH\r\n\t\t(0xBB6D <= code && code <= 0xBB87) || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH\r\n\t\t(0xBB89 <= code && code <= 0xBBA3) || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH\r\n\t\t(0xBBA5 <= code && code <= 0xBBBF) || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH\r\n\t\t(0xBBC1 <= code && code <= 0xBBDB) || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH\r\n\t\t(0xBBDD <= code && code <= 0xBBF7) || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH\r\n\t\t(0xBBF9 <= code && code <= 0xBC13) || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH\r\n\t\t(0xBC15 <= code && code <= 0xBC2F) || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH\r\n\t\t(0xBC31 <= code && code <= 0xBC4B) || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH\r\n\t\t(0xBC4D <= code && code <= 0xBC67) || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH\r\n\t\t(0xBC69 <= code && code <= 0xBC83) || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH\r\n\t\t(0xBC85 <= code && code <= 0xBC9F) || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH\r\n\t\t(0xBCA1 <= code && code <= 0xBCBB) || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH\r\n\t\t(0xBCBD <= code && code <= 0xBCD7) || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH\r\n\t\t(0xBCD9 <= code && code <= 0xBCF3) || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH\r\n\t\t(0xBCF5 <= code && code <= 0xBD0F) || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH\r\n\t\t(0xBD11 <= code && code <= 0xBD2B) || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH\r\n\t\t(0xBD2D <= code && code <= 0xBD47) || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH\r\n\t\t(0xBD49 <= code && code <= 0xBD63) || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH\r\n\t\t(0xBD65 <= code && code <= 0xBD7F) || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH\r\n\t\t(0xBD81 <= code && code <= 0xBD9B) || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH\r\n\t\t(0xBD9D <= code && code <= 0xBDB7) || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH\r\n\t\t(0xBDB9 <= code && code <= 0xBDD3) || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH\r\n\t\t(0xBDD5 <= code && code <= 0xBDEF) || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH\r\n\t\t(0xBDF1 <= code && code <= 0xBE0B) || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH\r\n\t\t(0xBE0D <= code && code <= 0xBE27) || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH\r\n\t\t(0xBE29 <= code && code <= 0xBE43) || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH\r\n\t\t(0xBE45 <= code && code <= 0xBE5F) || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH\r\n\t\t(0xBE61 <= code && code <= 0xBE7B) || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH\r\n\t\t(0xBE7D <= code && code <= 0xBE97) || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH\r\n\t\t(0xBE99 <= code && code <= 0xBEB3) || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH\r\n\t\t(0xBEB5 <= code && code <= 0xBECF) || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH\r\n\t\t(0xBED1 <= code && code <= 0xBEEB) || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH\r\n\t\t(0xBEED <= code && code <= 0xBF07) || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH\r\n\t\t(0xBF09 <= code && code <= 0xBF23) || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH\r\n\t\t(0xBF25 <= code && code <= 0xBF3F) || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH\r\n\t\t(0xBF41 <= code && code <= 0xBF5B) || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH\r\n\t\t(0xBF5D <= code && code <= 0xBF77) || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH\r\n\t\t(0xBF79 <= code && code <= 0xBF93) || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH\r\n\t\t(0xBF95 <= code && code <= 0xBFAF) || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH\r\n\t\t(0xBFB1 <= code && code <= 0xBFCB) || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH\r\n\t\t(0xBFCD <= code && code <= 0xBFE7) || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH\r\n\t\t(0xBFE9 <= code && code <= 0xC003) || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH\r\n\t\t(0xC005 <= code && code <= 0xC01F) || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH\r\n\t\t(0xC021 <= code && code <= 0xC03B) || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH\r\n\t\t(0xC03D <= code && code <= 0xC057) || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH\r\n\t\t(0xC059 <= code && code <= 0xC073) || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH\r\n\t\t(0xC075 <= code && code <= 0xC08F) || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH\r\n\t\t(0xC091 <= code && code <= 0xC0AB) || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH\r\n\t\t(0xC0AD <= code && code <= 0xC0C7) || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH\r\n\t\t(0xC0C9 <= code && code <= 0xC0E3) || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH\r\n\t\t(0xC0E5 <= code && code <= 0xC0FF) || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH\r\n\t\t(0xC101 <= code && code <= 0xC11B) || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH\r\n\t\t(0xC11D <= code && code <= 0xC137) || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH\r\n\t\t(0xC139 <= code && code <= 0xC153) || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH\r\n\t\t(0xC155 <= code && code <= 0xC16F) || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH\r\n\t\t(0xC171 <= code && code <= 0xC18B) || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH\r\n\t\t(0xC18D <= code && code <= 0xC1A7) || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH\r\n\t\t(0xC1A9 <= code && code <= 0xC1C3) || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH\r\n\t\t(0xC1C5 <= code && code <= 0xC1DF) || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH\r\n\t\t(0xC1E1 <= code && code <= 0xC1FB) || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH\r\n\t\t(0xC1FD <= code && code <= 0xC217) || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH\r\n\t\t(0xC219 <= code && code <= 0xC233) || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH\r\n\t\t(0xC235 <= code && code <= 0xC24F) || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH\r\n\t\t(0xC251 <= code && code <= 0xC26B) || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH\r\n\t\t(0xC26D <= code && code <= 0xC287) || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH\r\n\t\t(0xC289 <= code && code <= 0xC2A3) || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH\r\n\t\t(0xC2A5 <= code && code <= 0xC2BF) || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH\r\n\t\t(0xC2C1 <= code && code <= 0xC2DB) || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH\r\n\t\t(0xC2DD <= code && code <= 0xC2F7) || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH\r\n\t\t(0xC2F9 <= code && code <= 0xC313) || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH\r\n\t\t(0xC315 <= code && code <= 0xC32F) || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH\r\n\t\t(0xC331 <= code && code <= 0xC34B) || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH\r\n\t\t(0xC34D <= code && code <= 0xC367) || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH\r\n\t\t(0xC369 <= code && code <= 0xC383) || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH\r\n\t\t(0xC385 <= code && code <= 0xC39F) || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH\r\n\t\t(0xC3A1 <= code && code <= 0xC3BB) || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH\r\n\t\t(0xC3BD <= code && code <= 0xC3D7) || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH\r\n\t\t(0xC3D9 <= code && code <= 0xC3F3) || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH\r\n\t\t(0xC3F5 <= code && code <= 0xC40F) || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH\r\n\t\t(0xC411 <= code && code <= 0xC42B) || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH\r\n\t\t(0xC42D <= code && code <= 0xC447) || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH\r\n\t\t(0xC449 <= code && code <= 0xC463) || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH\r\n\t\t(0xC465 <= code && code <= 0xC47F) || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH\r\n\t\t(0xC481 <= code && code <= 0xC49B) || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH\r\n\t\t(0xC49D <= code && code <= 0xC4B7) || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH\r\n\t\t(0xC4B9 <= code && code <= 0xC4D3) || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH\r\n\t\t(0xC4D5 <= code && code <= 0xC4EF) || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH\r\n\t\t(0xC4F1 <= code && code <= 0xC50B) || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH\r\n\t\t(0xC50D <= code && code <= 0xC527) || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH\r\n\t\t(0xC529 <= code && code <= 0xC543) || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH\r\n\t\t(0xC545 <= code && code <= 0xC55F) || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH\r\n\t\t(0xC561 <= code && code <= 0xC57B) || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH\r\n\t\t(0xC57D <= code && code <= 0xC597) || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH\r\n\t\t(0xC599 <= code && code <= 0xC5B3) || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH\r\n\t\t(0xC5B5 <= code && code <= 0xC5CF) || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH\r\n\t\t(0xC5D1 <= code && code <= 0xC5EB) || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH\r\n\t\t(0xC5ED <= code && code <= 0xC607) || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH\r\n\t\t(0xC609 <= code && code <= 0xC623) || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH\r\n\t\t(0xC625 <= code && code <= 0xC63F) || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH\r\n\t\t(0xC641 <= code && code <= 0xC65B) || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH\r\n\t\t(0xC65D <= code && code <= 0xC677) || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH\r\n\t\t(0xC679 <= code && code <= 0xC693) || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH\r\n\t\t(0xC695 <= code && code <= 0xC6AF) || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH\r\n\t\t(0xC6B1 <= code && code <= 0xC6CB) || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH\r\n\t\t(0xC6CD <= code && code <= 0xC6E7) || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH\r\n\t\t(0xC6E9 <= code && code <= 0xC703) || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH\r\n\t\t(0xC705 <= code && code <= 0xC71F) || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH\r\n\t\t(0xC721 <= code && code <= 0xC73B) || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH\r\n\t\t(0xC73D <= code && code <= 0xC757) || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH\r\n\t\t(0xC759 <= code && code <= 0xC773) || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH\r\n\t\t(0xC775 <= code && code <= 0xC78F) || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH\r\n\t\t(0xC791 <= code && code <= 0xC7AB) || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH\r\n\t\t(0xC7AD <= code && code <= 0xC7C7) || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH\r\n\t\t(0xC7C9 <= code && code <= 0xC7E3) || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH\r\n\t\t(0xC7E5 <= code && code <= 0xC7FF) || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH\r\n\t\t(0xC801 <= code && code <= 0xC81B) || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH\r\n\t\t(0xC81D <= code && code <= 0xC837) || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH\r\n\t\t(0xC839 <= code && code <= 0xC853) || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH\r\n\t\t(0xC855 <= code && code <= 0xC86F) || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH\r\n\t\t(0xC871 <= code && code <= 0xC88B) || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH\r\n\t\t(0xC88D <= code && code <= 0xC8A7) || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH\r\n\t\t(0xC8A9 <= code && code <= 0xC8C3) || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH\r\n\t\t(0xC8C5 <= code && code <= 0xC8DF) || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH\r\n\t\t(0xC8E1 <= code && code <= 0xC8FB) || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH\r\n\t\t(0xC8FD <= code && code <= 0xC917) || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH\r\n\t\t(0xC919 <= code && code <= 0xC933) || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH\r\n\t\t(0xC935 <= code && code <= 0xC94F) || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH\r\n\t\t(0xC951 <= code && code <= 0xC96B) || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH\r\n\t\t(0xC96D <= code && code <= 0xC987) || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH\r\n\t\t(0xC989 <= code && code <= 0xC9A3) || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH\r\n\t\t(0xC9A5 <= code && code <= 0xC9BF) || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH\r\n\t\t(0xC9C1 <= code && code <= 0xC9DB) || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH\r\n\t\t(0xC9DD <= code && code <= 0xC9F7) || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH\r\n\t\t(0xC9F9 <= code && code <= 0xCA13) || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH\r\n\t\t(0xCA15 <= code && code <= 0xCA2F) || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH\r\n\t\t(0xCA31 <= code && code <= 0xCA4B) || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH\r\n\t\t(0xCA4D <= code && code <= 0xCA67) || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH\r\n\t\t(0xCA69 <= code && code <= 0xCA83) || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH\r\n\t\t(0xCA85 <= code && code <= 0xCA9F) || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH\r\n\t\t(0xCAA1 <= code && code <= 0xCABB) || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH\r\n\t\t(0xCABD <= code && code <= 0xCAD7) || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH\r\n\t\t(0xCAD9 <= code && code <= 0xCAF3) || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH\r\n\t\t(0xCAF5 <= code && code <= 0xCB0F) || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH\r\n\t\t(0xCB11 <= code && code <= 0xCB2B) || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH\r\n\t\t(0xCB2D <= code && code <= 0xCB47) || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH\r\n\t\t(0xCB49 <= code && code <= 0xCB63) || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH\r\n\t\t(0xCB65 <= code && code <= 0xCB7F) || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH\r\n\t\t(0xCB81 <= code && code <= 0xCB9B) || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH\r\n\t\t(0xCB9D <= code && code <= 0xCBB7) || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH\r\n\t\t(0xCBB9 <= code && code <= 0xCBD3) || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH\r\n\t\t(0xCBD5 <= code && code <= 0xCBEF) || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH\r\n\t\t(0xCBF1 <= code && code <= 0xCC0B) || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH\r\n\t\t(0xCC0D <= code && code <= 0xCC27) || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH\r\n\t\t(0xCC29 <= code && code <= 0xCC43) || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH\r\n\t\t(0xCC45 <= code && code <= 0xCC5F) || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH\r\n\t\t(0xCC61 <= code && code <= 0xCC7B) || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH\r\n\t\t(0xCC7D <= code && code <= 0xCC97) || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH\r\n\t\t(0xCC99 <= code && code <= 0xCCB3) || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH\r\n\t\t(0xCCB5 <= code && code <= 0xCCCF) || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH\r\n\t\t(0xCCD1 <= code && code <= 0xCCEB) || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH\r\n\t\t(0xCCED <= code && code <= 0xCD07) || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH\r\n\t\t(0xCD09 <= code && code <= 0xCD23) || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH\r\n\t\t(0xCD25 <= code && code <= 0xCD3F) || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH\r\n\t\t(0xCD41 <= code && code <= 0xCD5B) || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH\r\n\t\t(0xCD5D <= code && code <= 0xCD77) || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH\r\n\t\t(0xCD79 <= code && code <= 0xCD93) || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH\r\n\t\t(0xCD95 <= code && code <= 0xCDAF) || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH\r\n\t\t(0xCDB1 <= code && code <= 0xCDCB) || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH\r\n\t\t(0xCDCD <= code && code <= 0xCDE7) || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH\r\n\t\t(0xCDE9 <= code && code <= 0xCE03) || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH\r\n\t\t(0xCE05 <= code && code <= 0xCE1F) || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH\r\n\t\t(0xCE21 <= code && code <= 0xCE3B) || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH\r\n\t\t(0xCE3D <= code && code <= 0xCE57) || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH\r\n\t\t(0xCE59 <= code && code <= 0xCE73) || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH\r\n\t\t(0xCE75 <= code && code <= 0xCE8F) || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH\r\n\t\t(0xCE91 <= code && code <= 0xCEAB) || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH\r\n\t\t(0xCEAD <= code && code <= 0xCEC7) || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH\r\n\t\t(0xCEC9 <= code && code <= 0xCEE3) || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH\r\n\t\t(0xCEE5 <= code && code <= 0xCEFF) || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH\r\n\t\t(0xCF01 <= code && code <= 0xCF1B) || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH\r\n\t\t(0xCF1D <= code && code <= 0xCF37) || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH\r\n\t\t(0xCF39 <= code && code <= 0xCF53) || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH\r\n\t\t(0xCF55 <= code && code <= 0xCF6F) || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH\r\n\t\t(0xCF71 <= code && code <= 0xCF8B) || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH\r\n\t\t(0xCF8D <= code && code <= 0xCFA7) || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH\r\n\t\t(0xCFA9 <= code && code <= 0xCFC3) || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH\r\n\t\t(0xCFC5 <= code && code <= 0xCFDF) || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH\r\n\t\t(0xCFE1 <= code && code <= 0xCFFB) || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH\r\n\t\t(0xCFFD <= code && code <= 0xD017) || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH\r\n\t\t(0xD019 <= code && code <= 0xD033) || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH\r\n\t\t(0xD035 <= code && code <= 0xD04F) || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH\r\n\t\t(0xD051 <= code && code <= 0xD06B) || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH\r\n\t\t(0xD06D <= code && code <= 0xD087) || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH\r\n\t\t(0xD089 <= code && code <= 0xD0A3) || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH\r\n\t\t(0xD0A5 <= code && code <= 0xD0BF) || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH\r\n\t\t(0xD0C1 <= code && code <= 0xD0DB) || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH\r\n\t\t(0xD0DD <= code && code <= 0xD0F7) || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH\r\n\t\t(0xD0F9 <= code && code <= 0xD113) || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH\r\n\t\t(0xD115 <= code && code <= 0xD12F) || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH\r\n\t\t(0xD131 <= code && code <= 0xD14B) || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH\r\n\t\t(0xD14D <= code && code <= 0xD167) || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH\r\n\t\t(0xD169 <= code && code <= 0xD183) || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH\r\n\t\t(0xD185 <= code && code <= 0xD19F) || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH\r\n\t\t(0xD1A1 <= code && code <= 0xD1BB) || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH\r\n\t\t(0xD1BD <= code && code <= 0xD1D7) || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH\r\n\t\t(0xD1D9 <= code && code <= 0xD1F3) || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH\r\n\t\t(0xD1F5 <= code && code <= 0xD20F) || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH\r\n\t\t(0xD211 <= code && code <= 0xD22B) || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH\r\n\t\t(0xD22D <= code && code <= 0xD247) || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH\r\n\t\t(0xD249 <= code && code <= 0xD263) || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH\r\n\t\t(0xD265 <= code && code <= 0xD27F) || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH\r\n\t\t(0xD281 <= code && code <= 0xD29B) || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH\r\n\t\t(0xD29D <= code && code <= 0xD2B7) || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH\r\n\t\t(0xD2B9 <= code && code <= 0xD2D3) || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH\r\n\t\t(0xD2D5 <= code && code <= 0xD2EF) || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH\r\n\t\t(0xD2F1 <= code && code <= 0xD30B) || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH\r\n\t\t(0xD30D <= code && code <= 0xD327) || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH\r\n\t\t(0xD329 <= code && code <= 0xD343) || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH\r\n\t\t(0xD345 <= code && code <= 0xD35F) || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH\r\n\t\t(0xD361 <= code && code <= 0xD37B) || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH\r\n\t\t(0xD37D <= code && code <= 0xD397) || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH\r\n\t\t(0xD399 <= code && code <= 0xD3B3) || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH\r\n\t\t(0xD3B5 <= code && code <= 0xD3CF) || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH\r\n\t\t(0xD3D1 <= code && code <= 0xD3EB) || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH\r\n\t\t(0xD3ED <= code && code <= 0xD407) || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH\r\n\t\t(0xD409 <= code && code <= 0xD423) || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH\r\n\t\t(0xD425 <= code && code <= 0xD43F) || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH\r\n\t\t(0xD441 <= code && code <= 0xD45B) || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH\r\n\t\t(0xD45D <= code && code <= 0xD477) || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH\r\n\t\t(0xD479 <= code && code <= 0xD493) || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH\r\n\t\t(0xD495 <= code && code <= 0xD4AF) || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH\r\n\t\t(0xD4B1 <= code && code <= 0xD4CB) || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH\r\n\t\t(0xD4CD <= code && code <= 0xD4E7) || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH\r\n\t\t(0xD4E9 <= code && code <= 0xD503) || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH\r\n\t\t(0xD505 <= code && code <= 0xD51F) || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH\r\n\t\t(0xD521 <= code && code <= 0xD53B) || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH\r\n\t\t(0xD53D <= code && code <= 0xD557) || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH\r\n\t\t(0xD559 <= code && code <= 0xD573) || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH\r\n\t\t(0xD575 <= code && code <= 0xD58F) || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH\r\n\t\t(0xD591 <= code && code <= 0xD5AB) || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH\r\n\t\t(0xD5AD <= code && code <= 0xD5C7) || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH\r\n\t\t(0xD5C9 <= code && code <= 0xD5E3) || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH\r\n\t\t(0xD5E5 <= code && code <= 0xD5FF) || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH\r\n\t\t(0xD601 <= code && code <= 0xD61B) || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH\r\n\t\t(0xD61D <= code && code <= 0xD637) || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH\r\n\t\t(0xD639 <= code && code <= 0xD653) || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH\r\n\t\t(0xD655 <= code && code <= 0xD66F) || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH\r\n\t\t(0xD671 <= code && code <= 0xD68B) || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH\r\n\t\t(0xD68D <= code && code <= 0xD6A7) || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH\r\n\t\t(0xD6A9 <= code && code <= 0xD6C3) || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH\r\n\t\t(0xD6C5 <= code && code <= 0xD6DF) || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH\r\n\t\t(0xD6E1 <= code && code <= 0xD6FB) || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH\r\n\t\t(0xD6FD <= code && code <= 0xD717) || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH\r\n\t\t(0xD719 <= code && code <= 0xD733) || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH\r\n\t\t(0xD735 <= code && code <= 0xD74F) || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH\r\n\t\t(0xD751 <= code && code <= 0xD76B) || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH\r\n\t\t(0xD76D <= code && code <= 0xD787) || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH\r\n\t\t(0xD789 <= code && code <= 0xD7A3) // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH\r\n\t\t){\r\n\t\t\treturn LVT;\r\n\t\t}\r\n\t\t\r\n\t\tif(\r\n\t\t0x261D == code || // So WHITE UP POINTING INDEX\r\n\t\t0x26F9 == code || // So PERSON WITH BALL\r\n\t\t(0x270A <= code && code <= 0x270D) || // So [4] RAISED FIST..WRITING HAND\r\n\t\t0x1F385 == code || // So FATHER CHRISTMAS\r\n\t\t(0x1F3C2 <= code && code <= 0x1F3C4) || // So [3] SNOWBOARDER..SURFER\r\n\t\t0x1F3C7 == code || // So HORSE RACING\r\n\t\t(0x1F3CA <= code && code <= 0x1F3CC) || // So [3] SWIMMER..GOLFER\r\n\t\t(0x1F442 <= code && code <= 0x1F443) || // So [2] EAR..NOSE\r\n\t\t(0x1F446 <= code && code <= 0x1F450) || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN\r\n\t\t0x1F46E == code || // So POLICE OFFICER\r\n\t\t(0x1F470 <= code && code <= 0x1F478) || // So [9] BRIDE WITH VEIL..PRINCESS\r\n\t\t0x1F47C == code || // So BABY ANGEL\r\n\t\t(0x1F481 <= code && code <= 0x1F483) || // So [3] INFORMATION DESK PERSON..DANCER\r\n\t\t(0x1F485 <= code && code <= 0x1F487) || // So [3] NAIL POLISH..HAIRCUT\r\n\t\t0x1F4AA == code || // So FLEXED BICEPS\r\n\t\t(0x1F574 <= code && code <= 0x1F575) || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY\r\n\t\t0x1F57A == code || // So MAN DANCING\r\n\t\t0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED\r\n\t\t(0x1F595 <= code && code <= 0x1F596) || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS\r\n\t\t(0x1F645 <= code && code <= 0x1F647) || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY\r\n\t\t(0x1F64B <= code && code <= 0x1F64F) || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS\r\n\t\t0x1F6A3 == code || // So ROWBOAT\r\n\t\t(0x1F6B4 <= code && code <= 0x1F6B6) || // So [3] BICYCLIST..PEDESTRIAN\r\n\t\t0x1F6C0 == code || // So BATH\r\n\t\t0x1F6CC == code || // So SLEEPING ACCOMMODATION\r\n\t\t(0x1F918 <= code && code <= 0x1F91C) || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST\r\n\t\t(0x1F91E <= code && code <= 0x1F91F) || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN\r\n\t\t0x1F926 == code || // So FACE PALM\r\n\t\t(0x1F930 <= code && code <= 0x1F939) || // So [10] PREGNANT WOMAN..JUGGLING\r\n\t\t(0x1F93D <= code && code <= 0x1F93E) || // So [2] WATER POLO..HANDBALL\r\n\t\t(0x1F9D1 <= code && code <= 0x1F9DD) // So [13] ADULT..ELF\r\n\t\t){\r\n\t\t\treturn E_Base;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t(0x1F3FB <= code && code <= 0x1F3FF) // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6\r\n\t\t){\r\n\t\t\treturn E_Modifier;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t0x200D == code // Cf ZERO WIDTH JOINER\r\n\t\t){\r\n\t\t\treturn ZWJ;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t0x2640 == code || // So FEMALE SIGN\r\n\t\t0x2642 == code || // So MALE SIGN\r\n\t\t(0x2695 <= code && code <= 0x2696) || // So [2] STAFF OF AESCULAPIUS..SCALES\r\n\t\t0x2708 == code || // So AIRPLANE\r\n\t\t0x2764 == code || // So HEAVY BLACK HEART\r\n\t\t0x1F308 == code || // So RAINBOW\r\n\t\t0x1F33E == code || // So EAR OF RICE\r\n\t\t0x1F373 == code || // So COOKING\r\n\t\t0x1F393 == code || // So GRADUATION CAP\r\n\t\t0x1F3A4 == code || // So MICROPHONE\r\n\t\t0x1F3A8 == code || // So ARTIST PALETTE\r\n\t\t0x1F3EB == code || // So SCHOOL\r\n\t\t0x1F3ED == code || // So FACTORY\r\n\t\t0x1F48B == code || // So KISS MARK\r\n\t\t(0x1F4BB <= code && code <= 0x1F4BC) || // So [2] PERSONAL COMPUTER..BRIEFCASE\r\n\t\t0x1F527 == code || // So WRENCH\r\n\t\t0x1F52C == code || // So MICROSCOPE\r\n\t\t0x1F5E8 == code || // So LEFT SPEECH BUBBLE\r\n\t\t0x1F680 == code || // So ROCKET\r\n\t\t0x1F692 == code // So FIRE ENGINE\r\n\t\t){\r\n\t\t\treturn Glue_After_Zwj;\r\n\t\t}\r\n\r\n\t\tif(\r\n\t\t(0x1F466 <= code && code <= 0x1F469) // So [4] BOY..WOMAN\r\n\t\t){\r\n\t\t\treturn E_Base_GAZ;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//all unlisted characters have a grapheme break property of \"Other\"\r\n\t\treturn Other;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\nif (typeof module != 'undefined' && module.exports) {\r\n module.exports = GraphemeSplitter;\r\n}\r\n", "'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n", "!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=i():\"function\"==typeof define&&define.amd?define(i):(t=t||self).RBush=i()}(this,function(){\"use strict\";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d<x;){for(i(n,d,x),d++,x--;h(n[d],p)<0;)d++;for(;h(n[x],p)>0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return t<i?-1:t>i?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r<i.length;r++)if(n(t,i[r]))return r;return-1}function a(t,i){h(t,0,t.children.length,i,t)}function h(t,i,n,r,e){e||(e=p(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var a=i;a<n;a++){var h=t.children[a];o(e,t.leaf?r(h):h)}return e}function o(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function l(t,i){return t.minY-i.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function m(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function c(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a<i.children.length;a++){var h=i.children[a],o=i.leaf?r(h):h;c(t,o)&&(i.leaf?n.push(h):m(t,o)?this._all(h,n):e.push(h))}i=e.pop()}return n},r.prototype.collides=function(t){var i=this.data;if(!c(t,i))return!1;for(var n=[];i;){for(var r=0;r<i.children.length;r++){var e=i.children[r],a=i.leaf?this.toBBox(e):e;if(c(t,a)){if(i.leaf||m(t,a))return!0;n.push(e)}}i=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0;i<t.length;i++)this.insert(t[i]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,i){if(!t)return this;for(var n,r,a,h=this.data,o=this.toBBox(t),s=[],l=[];h||s.length;){if(h||(h=s.pop(),r=s[s.length-1],n=l.pop(),a=!0),h.leaf){var f=e(t,h.children,i);if(-1!==f)return h.children.splice(f,1),s.push(h),this._condense(s),this}a||h.leaf||!m(h,o)?r?(n++,h=r.children[n],a=!1):h=null:(s.push(h),l.push(n),n=0,r=h,h=h.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,i){return t.minX-i.minX},r.prototype.compareMinY=function(t,i){return t.minY-i.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},r.prototype._build=function(t,i,n,r){var e,h=n-i+1,o=this._maxEntries;if(h<=o)return a(e=p(t.slice(i,n+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(h)/Math.log(o)),o=Math.ceil(h/Math.pow(o,r-1))),(e=p([])).leaf=!1,e.height=r;var s=Math.ceil(h/o),l=s*Math.ceil(Math.sqrt(o));d(t,i,n,l,this.compareMinX);for(var f=i;f<=n;f+=l){var u=Math.min(f+l-1,n);d(t,f,u,s,this.compareMinY);for(var m=f;m<=u;m+=s){var c=Math.min(m+s-1,u);e.children.push(this._build(t,m,c,r-1))}}return a(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,i,n,r){for(;r.push(i),!i.leaf&&r.length-1!==n;){for(var e=1/0,a=1/0,h=void 0,o=0;o<i.children.length;o++){var s=i.children[o],l=f(s),u=(m=t,c=s,(Math.max(c.maxX,m.maxX)-Math.min(c.minX,m.minX))*(Math.max(c.maxY,m.maxY)-Math.min(c.minY,m.minY))-l);u<a?(a=u,e=l<e?l:e,h=s):u===a&&l<e&&(e=l,h=s)}i=h||i.children[0]}var m,c;return i},r.prototype._insert=function(t,i,n){var r=n?t:this.toBBox(t),e=[],a=this._chooseSubtree(r,this.data,i,e);for(a.children.push(t),o(a,r);i>=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v<m?(m=v,r=p,c=M<c?M:c):v===m&&M<c&&(c=M,r=p)}return r||n-i},r.prototype._chooseSplitAxis=function(t,i,n){var r=t.leaf?this.compareMinX:s,e=t.leaf?this.compareMinY:l;this._allDistMargin(t,i,n,r)<this._allDistMargin(t,i,n,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,i,n,r){t.children.sort(r);for(var e=this.toBBox,a=h(t,0,i,e),s=h(t,n-i,n,e),l=u(a)+u(s),f=i;f<n-i;f++){var m=t.children[f];o(a,t.leaf?e(m):m),l+=u(a)}for(var c=n-i-1;c>=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n", "(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n // so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n var protobuf = $require(entries[0]);\n\n // Expose globally\n protobuf.util.global.protobuf = protobuf;\n\n // Be nice to AMD\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n\n // Be nice to CommonJS\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n\n})/* end of prelude */", "\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n", "\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.<string,*>}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n", "\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n", "\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(16);\nprotobuf.BufferWriter = require(17);\nprotobuf.Reader = require(9);\nprotobuf.BufferReader = require(10);\n\n// Utility\nprotobuf.util = require(15);\nprotobuf.rpc = require(12);\nprotobuf.roots = require(11);\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n", "\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(15);\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n\n if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n var nativeBuffer = util.Buffer;\n return nativeBuffer\n ? nativeBuffer.alloc(0)\n : new this.buf.constructor(0);\n }\n return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n", "\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(9);\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n", "\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.<string,Root>}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n", "\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod<Message<{}>,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(13);\n", "\"use strict\";\nmodule.exports = Service;\n\nvar util = require(15);\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise<Message<TRes>>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod<TReq,TRes>} method Reflected or static method\n * @param {Constructor<TReq>} requestCtor Request constructor\n * @param {Constructor<TRes>} responseCtor Response constructor\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n", "\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(15);\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n", "\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(1);\n\n// converts to / from base64 encoded strings\nutil.base64 = require(2);\n\n// base class of rpc.Service\nutil.EventEmitter = require(3);\n\n// float handling accross browsers\nutil.float = require(4);\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(5);\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(7);\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(6);\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(14);\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor<Buffer>}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor<Uint8Array>}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor<Long>}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.<string,*>} dst Destination object\n * @param {Object.<string,*>} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.<string,*>} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor<Error>} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message<T>\n * @constructor\n * @param {string} message Error message\n * @param {Object.<string,*>} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message<T>}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n", "\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(15);\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n", "\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(16);\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(15);\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n", "module.exports = {\n webm:\n \"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAAD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Zimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAA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Aw\",\n};\n", "const { webm, mp4 } = require(\"./media.js\");\n\n// Detect iOS browsers < version 10\nconst oldIOS = () =>\n typeof navigator !== \"undefined\" &&\n parseFloat(\n (\n \"\" +\n (/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(\n navigator.userAgent\n ) || [0, \"\"])[1]\n )\n .replace(\"undefined\", \"3_2\")\n .replace(\"_\", \".\")\n .replace(\"_\", \"\")\n ) < 10 &&\n !window.MSStream;\n\n// Detect native Wake Lock API support\nconst nativeWakeLock = () => \"wakeLock\" in navigator;\n\nclass NoSleep {\n constructor() {\n this.enabled = false;\n if (nativeWakeLock()) {\n this._wakeLock = null;\n const handleVisibilityChange = () => {\n if (this._wakeLock !== null && document.visibilityState === \"visible\") {\n this.enable();\n }\n };\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(\"fullscreenchange\", handleVisibilityChange);\n } else if (oldIOS()) {\n this.noSleepTimer = null;\n } else {\n // Set up no sleep video element\n this.noSleepVideo = document.createElement(\"video\");\n\n this.noSleepVideo.setAttribute(\"title\", \"No Sleep\");\n this.noSleepVideo.setAttribute(\"playsinline\", \"\");\n\n this._addSourceToVideo(this.noSleepVideo, \"webm\", webm);\n this._addSourceToVideo(this.noSleepVideo, \"mp4\", mp4);\n\n this.noSleepVideo.addEventListener(\"loadedmetadata\", () => {\n if (this.noSleepVideo.duration <= 1) {\n // webm source\n this.noSleepVideo.setAttribute(\"loop\", \"\");\n } else {\n // mp4 source\n this.noSleepVideo.addEventListener(\"timeupdate\", () => {\n if (this.noSleepVideo.currentTime > 0.5) {\n this.noSleepVideo.currentTime = Math.random();\n }\n });\n }\n });\n }\n }\n\n _addSourceToVideo(element, type, dataURI) {\n var source = document.createElement(\"source\");\n source.src = dataURI;\n source.type = `video/${type}`;\n element.appendChild(source);\n }\n\n get isEnabled() {\n return this.enabled;\n }\n\n enable() {\n if (nativeWakeLock()) {\n return navigator.wakeLock\n .request(\"screen\")\n .then((wakeLock) => {\n this._wakeLock = wakeLock;\n this.enabled = true;\n console.log(\"Wake Lock active.\");\n this._wakeLock.addEventListener(\"release\", () => {\n // ToDo: Potentially emit an event for the page to observe since\n // Wake Lock releases happen when page visibility changes.\n // (https://web.dev/wakelock/#wake-lock-lifecycle)\n console.log(\"Wake Lock released.\");\n });\n })\n .catch((err) => {\n this.enabled = false;\n console.error(`${err.name}, ${err.message}`);\n throw err;\n });\n } else if (oldIOS()) {\n this.disable();\n console.warn(`\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n `);\n this.noSleepTimer = window.setInterval(() => {\n if (!document.hidden) {\n window.location.href = window.location.href.split(\"#\")[0];\n window.setTimeout(window.stop, 0);\n }\n }, 15000);\n this.enabled = true;\n return Promise.resolve();\n } else {\n let playPromise = this.noSleepVideo.play();\n return playPromise\n .then((res) => {\n this.enabled = true;\n return res;\n })\n .catch((err) => {\n this.enabled = false;\n throw err;\n });\n }\n }\n\n disable() {\n if (nativeWakeLock()) {\n if (this._wakeLock) {\n this._wakeLock.release();\n }\n this._wakeLock = null;\n } else if (oldIOS()) {\n if (this.noSleepTimer) {\n console.warn(`\n NoSleep now disabled for older iOS devices.\n `);\n window.clearInterval(this.noSleepTimer);\n this.noSleepTimer = null;\n }\n } else {\n this.noSleepVideo.pause();\n }\n this.enabled = false;\n }\n}\n\nmodule.exports = NoSleep;\n", "/**\n * Returns the first parameter if not undefined, otherwise the second parameter.\n * Useful for setting a default value for a parameter.\n *\n * @function\n *\n * @param {*} a\n * @param {*} b\n * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter.\n *\n * @example\n * param = Cesium.defaultValue(param, 'default');\n */\nfunction defaultValue(a, b) {\n if (a !== undefined && a !== null) {\n return a;\n }\n return b;\n}\n\n/**\n * A frozen empty object that can be used as the default value for options passed as\n * an object literal.\n * @type {Object}\n * @memberof defaultValue\n */\ndefaultValue.EMPTY_OBJECT = Object.freeze({});\n\nexport default defaultValue;\n", "/**\n * @function\n *\n * @param {*} value The object.\n * @returns {Boolean} Returns true if the object is defined, returns false otherwise.\n *\n * @example\n * if (Cesium.defined(positions)) {\n * doSomething();\n * } else {\n * doSomethingElse();\n * }\n */\nfunction defined(value) {\n return value !== undefined && value !== null;\n}\nexport default defined;\n", "import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,\n * argument out of range, etc. This exception should only be thrown during development;\n * it usually indicates a bug in the calling code. This exception should never be\n * caught; instead the calling code should strive not to generate it.\n * <br /><br />\n * On the other hand, a {@link RuntimeError} indicates an exception that may\n * be thrown at runtime, e.g., out of memory, that the calling code should be prepared\n * to catch.\n *\n * @alias DeveloperError\n * @constructor\n * @extends Error\n *\n * @param {String} [message] The error message for this exception.\n *\n * @see RuntimeError\n */\nfunction DeveloperError(message) {\n /**\n * 'DeveloperError' indicating that this exception was thrown due to a developer error.\n * @type {String}\n * @readonly\n */\n this.name = \"DeveloperError\";\n\n /**\n * The explanation for why this exception was thrown.\n * @type {String}\n * @readonly\n */\n this.message = message;\n\n //Browsers such as IE don't have a stack property until you actually throw the error.\n let stack;\n try {\n throw new Error();\n } catch (e) {\n stack = e.stack;\n }\n\n /**\n * The stack trace of this exception, if available.\n * @type {String}\n * @readonly\n */\n this.stack = stack;\n}\n\nif (defined(Object.create)) {\n DeveloperError.prototype = Object.create(Error.prototype);\n DeveloperError.prototype.constructor = DeveloperError;\n}\n\nDeveloperError.prototype.toString = function () {\n let str = `${this.name}: ${this.message}`;\n\n if (defined(this.stack)) {\n str += `\\n${this.stack.toString()}`;\n }\n\n return str;\n};\n\n/**\n * @private\n */\nDeveloperError.throwInstantiationError = function () {\n throw new DeveloperError(\n \"This function defines an interface and should not be called directly.\"\n );\n};\nexport default DeveloperError;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Contains functions for checking that supplied arguments are of a specified type\n * or meet specified conditions\n * @private\n */\nconst Check = {};\n\n/**\n * Contains type checking functions, all using the typeof operator\n */\nCheck.typeOf = {};\n\nfunction getUndefinedErrorMessage(name) {\n return `${name} is required, actual value was undefined`;\n}\n\nfunction getFailedTypeErrorMessage(actual, expected, name) {\n return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;\n}\n\n/**\n * Throws if test is not defined\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value that is to be checked\n * @exception {DeveloperError} test must be defined\n */\nCheck.defined = function (name, test) {\n if (!defined(test)) {\n throw new DeveloperError(getUndefinedErrorMessage(name));\n }\n};\n\n/**\n * Throws if test is not typeof 'function'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'function'\n */\nCheck.typeOf.func = function (name, test) {\n if (typeof test !== \"function\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"function\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'string'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'string'\n */\nCheck.typeOf.string = function (name, test) {\n if (typeof test !== \"string\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"string\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'number'\n */\nCheck.typeOf.number = function (name, test) {\n if (typeof test !== \"number\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"number\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number' and less than limit\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {Number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and less than limit\n */\nCheck.typeOf.number.lessThan = function (name, test, limit) {\n Check.typeOf.number(name, test);\n if (test >= limit) {\n throw new DeveloperError(\n `Expected ${name} to be less than ${limit}, actual value was ${test}`\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number' and less than or equal to limit\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {Number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit\n */\nCheck.typeOf.number.lessThanOrEquals = function (name, test, limit) {\n Check.typeOf.number(name, test);\n if (test > limit) {\n throw new DeveloperError(\n `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number' and greater than limit\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {Number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and greater than limit\n */\nCheck.typeOf.number.greaterThan = function (name, test, limit) {\n Check.typeOf.number(name, test);\n if (test <= limit) {\n throw new DeveloperError(\n `Expected ${name} to be greater than ${limit}, actual value was ${test}`\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'number' and greater than or equal to limit\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @param {Number} limit The limit value to compare against\n * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit\n */\nCheck.typeOf.number.greaterThanOrEquals = function (name, test, limit) {\n Check.typeOf.number(name, test);\n if (test < limit) {\n throw new DeveloperError(\n `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'object'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'object'\n */\nCheck.typeOf.object = function (name, test) {\n if (typeof test !== \"object\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"object\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'boolean'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'boolean'\n */\nCheck.typeOf.bool = function (name, test) {\n if (typeof test !== \"boolean\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"boolean\", name)\n );\n }\n};\n\n/**\n * Throws if test is not typeof 'bigint'\n *\n * @param {String} name The name of the variable being tested\n * @param {*} test The value to test\n * @exception {DeveloperError} test must be typeof 'bigint'\n */\nCheck.typeOf.bigint = function (name, test) {\n if (typeof test !== \"bigint\") {\n throw new DeveloperError(\n getFailedTypeErrorMessage(typeof test, \"bigint\", name)\n );\n }\n};\n\n/**\n * Throws if test1 and test2 is not typeof 'number' and not equal in value\n *\n * @param {String} name1 The name of the first variable being tested\n * @param {String} name2 The name of the second variable being tested against\n * @param {*} test1 The value to test\n * @param {*} test2 The value to test against\n * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value\n */\nCheck.typeOf.number.equals = function (name1, name2, test1, test2) {\n Check.typeOf.number(name1, test1);\n Check.typeOf.number(name2, test2);\n if (test1 !== test2) {\n throw new DeveloperError(\n `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`\n );\n }\n};\nexport default Check;\n", "import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A generic utility class for managing subscribers for a particular event.\n * This class is usually instantiated inside of a container class and\n * exposed as a property for others to subscribe to.\n *\n * @alias Event\n * @template Listener extends (...args: any[]) => void = (...args: any[]) => void\n * @constructor\n * @example\n * MyObject.prototype.myListener = function(arg1, arg2) {\n * this.myArg1Copy = arg1;\n * this.myArg2Copy = arg2;\n * }\n *\n * const myObjectInstance = new MyObject();\n * const evt = new Cesium.Event();\n * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);\n * evt.raiseEvent('1', '2');\n * evt.removeEventListener(MyObject.prototype.myListener);\n */\nfunction Event() {\n this._listeners = [];\n this._scopes = [];\n this._toRemove = [];\n this._insideRaiseEvent = false;\n}\n\nObject.defineProperties(Event.prototype, {\n /**\n * The number of listeners currently subscribed to the event.\n * @memberof Event.prototype\n * @type {Number}\n * @readonly\n */\n numberOfListeners: {\n get: function () {\n return this._listeners.length - this._toRemove.length;\n },\n },\n});\n\n/**\n * Registers a callback function to be executed whenever the event is raised.\n * An optional scope can be provided to serve as the <code>this</code> pointer\n * in which the function will execute.\n *\n * @param {Listener} listener The function to be executed when the event is raised.\n * @param {Object} [scope] An optional object scope to serve as the <code>this</code>\n * pointer in which the listener function will execute.\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#raiseEvent\n * @see Event#removeEventListener\n */\nEvent.prototype.addEventListener = function (listener, scope) {\n this._listeners.push(listener);\n this._scopes.push(scope);\n\n const event = this;\n return function () {\n event.removeEventListener(listener, scope);\n };\n};\n\n/**\n * Unregisters a previously registered callback.\n *\n * @param {Listener} listener The function to be unregistered.\n * @param {Object} [scope] The scope that was originally passed to addEventListener.\n * @returns {Boolean} <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.\n *\n * @see Event#addEventListener\n * @see Event#raiseEvent\n */\nEvent.prototype.removeEventListener = function (listener, scope) {\n const listeners = this._listeners;\n const scopes = this._scopes;\n\n let index = -1;\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener && scopes[i] === scope) {\n index = i;\n break;\n }\n }\n\n if (index !== -1) {\n if (this._insideRaiseEvent) {\n //In order to allow removing an event subscription from within\n //a callback, we don't actually remove the items here. Instead\n //remember the index they are at and undefined their value.\n this._toRemove.push(index);\n listeners[index] = undefined;\n scopes[index] = undefined;\n } else {\n listeners.splice(index, 1);\n scopes.splice(index, 1);\n }\n return true;\n }\n\n return false;\n};\n\nfunction compareNumber(a, b) {\n return b - a;\n}\n\n/**\n * Raises the event by calling each registered listener with all supplied arguments.\n *\n * @param {...Parameters<Listener>} arguments This method takes any number of parameters and passes them through to the listener functions.\n *\n * @see Event#addEventListener\n * @see Event#removeEventListener\n */\nEvent.prototype.raiseEvent = function () {\n this._insideRaiseEvent = true;\n\n let i;\n const listeners = this._listeners;\n const scopes = this._scopes;\n let length = listeners.length;\n\n for (i = 0; i < length; i++) {\n const listener = listeners[i];\n if (defined(listener)) {\n listeners[i].apply(scopes[i], arguments);\n }\n }\n\n //Actually remove items removed in removeEventListener.\n const toRemove = this._toRemove;\n length = toRemove.length;\n if (length > 0) {\n toRemove.sort(compareNumber);\n for (i = 0; i < length; i++) {\n const index = toRemove[i];\n listeners.splice(index, 1);\n scopes.splice(index, 1);\n }\n toRemove.length = 0;\n }\n\n this._insideRaiseEvent = false;\n};\n\n/**\n * A function that removes a listener.\n * @callback Event.RemoveCallback\n */\n\nexport default Event;\n", "import defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\n\n/**\n * A {@link Property} whose value does not change with respect to simulation time.\n *\n * @alias ConstantProperty\n * @constructor\n *\n * @param {*} [value] The property value.\n *\n * @see ConstantPositionProperty\n */\nfunction ConstantProperty(value) {\n this._value = undefined;\n this._hasClone = false;\n this._hasEquals = false;\n this._definitionChanged = new Event();\n this.setValue(value);\n}\n\nObject.defineProperties(ConstantProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * This property always returns <code>true</code>.\n * @memberof ConstantProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n value: true,\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value.\n * @memberof ConstantProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantProperty.prototype.getValue = function (time, result) {\n return this._hasClone ? this._value.clone(result) : this._value;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {*} value The property value.\n */\nConstantProperty.prototype.setValue = function (value) {\n const oldValue = this._value;\n if (oldValue !== value) {\n const isDefined = defined(value);\n const hasClone = isDefined && typeof value.clone === \"function\";\n const hasEquals = isDefined && typeof value.equals === \"function\";\n\n const changed = !hasEquals || !value.equals(oldValue);\n if (changed) {\n this._hasClone = hasClone;\n this._hasEquals = hasEquals;\n this._value = !hasClone ? value : value.clone(this._value);\n this._definitionChanged.raiseEvent(this);\n }\n }\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nConstantProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof ConstantProperty && //\n ((!this._hasEquals && this._value === other._value) || //\n (this._hasEquals && this._value.equals(other._value))))\n );\n};\n\n/**\n * Gets this property's value.\n *\n * @returns {*} This property's value.\n */\nConstantProperty.prototype.valueOf = function () {\n return this._value;\n};\n\n/**\n * Creates a string representing this property's value.\n *\n * @returns {String} A string representing the property's value.\n */\nConstantProperty.prototype.toString = function () {\n return String(this._value);\n};\nexport default ConstantProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\n\nfunction createProperty(\n name,\n privateName,\n subscriptionName,\n configurable,\n createPropertyCallback\n) {\n return {\n configurable: configurable,\n get: function () {\n return this[privateName];\n },\n set: function (value) {\n const oldValue = this[privateName];\n const subscription = this[subscriptionName];\n if (defined(subscription)) {\n subscription();\n this[subscriptionName] = undefined;\n }\n\n const hasValue = value !== undefined;\n if (\n hasValue &&\n (!defined(value) || !defined(value.getValue)) &&\n defined(createPropertyCallback)\n ) {\n value = createPropertyCallback(value);\n }\n\n if (oldValue !== value) {\n this[privateName] = value;\n this._definitionChanged.raiseEvent(this, name, value, oldValue);\n }\n\n if (defined(value) && defined(value.definitionChanged)) {\n this[subscriptionName] = value.definitionChanged.addEventListener(\n function () {\n this._definitionChanged.raiseEvent(this, name, value, value);\n },\n this\n );\n }\n },\n };\n}\n\nfunction createConstantProperty(value) {\n return new ConstantProperty(value);\n}\n\n/**\n * Used to consistently define all DataSources graphics objects.\n * This is broken into two functions because the Chrome profiler does a better\n * job of optimizing lookups if it notices that the string is constant throughout the function.\n * @private\n */\nfunction createPropertyDescriptor(name, configurable, createPropertyCallback) {\n //Safari 8.0.3 has a JavaScript bug that causes it to confuse two variables and treat them as the same.\n //The two extra toString calls work around the issue.\n return createProperty(\n name,\n `_${name.toString()}`,\n `_${name.toString()}Subscription`,\n defaultValue(configurable, false),\n defaultValue(createPropertyCallback, createConstantProperty)\n );\n}\nexport default createPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} BillboardGraphics.ConstructorOptions\n *\n * Initialization options for the BillboardGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the billboard.\n * @property {Property | string | HTMLCanvasElement} [image] A Property specifying the Image, URI, or Canvas to use for the billboard.\n * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the image size.\n * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset.\n * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset.\n * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}.\n * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the tint {@link Color} of the image.\n * @property {Property | number} [rotation=0] A numeric Property specifying the rotation about the alignedAxis.\n * @property {Property | Cartesian3} [alignedAxis=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the unit vector axis of rotation.\n * @property {Property | boolean} [sizeInMeters] A boolean Property specifying whether this billboard's size should be measured in meters.\n * @property {Property | number} [width] A numeric Property specifying the width of the billboard in pixels, overriding the native size.\n * @property {Property | number} [height] A numeric Property specifying the height of the billboard in pixels, overriding the native size.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance from the camera.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.\n * @property {Property | BoundingRectangle} [imageSubRegion] A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this billboard will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a two dimensional icon located at the position of the containing {@link Entity}.\n * <p>\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n * </p>\n *\n * @alias BillboardGraphics\n * @constructor\n *\n * @param {BillboardGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n */\nfunction BillboardGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._image = undefined;\n this._imageSubscription = undefined;\n this._scale = undefined;\n this._scaleSubscription = undefined;\n this._pixelOffset = undefined;\n this._pixelOffsetSubscription = undefined;\n this._eyeOffset = undefined;\n this._eyeOffsetSubscription = undefined;\n this._horizontalOrigin = undefined;\n this._horizontalOriginSubscription = undefined;\n this._verticalOrigin = undefined;\n this._verticalOriginSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._color = undefined;\n this._colorSubscription = undefined;\n this._rotation = undefined;\n this._rotationSubscription = undefined;\n this._alignedAxis = undefined;\n this._alignedAxisSubscription = undefined;\n this._sizeInMeters = undefined;\n this._sizeInMetersSubscription = undefined;\n this._width = undefined;\n this._widthSubscription = undefined;\n this._height = undefined;\n this._heightSubscription = undefined;\n this._scaleByDistance = undefined;\n this._scaleByDistanceSubscription = undefined;\n this._translucencyByDistance = undefined;\n this._translucencyByDistanceSubscription = undefined;\n this._pixelOffsetScaleByDistance = undefined;\n this._pixelOffsetScaleByDistanceSubscription = undefined;\n this._imageSubRegion = undefined;\n this._imageSubRegionSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._disableDepthTestDistance = undefined;\n this._disableDepthTestDistanceSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(BillboardGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof BillboardGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the billboard.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n image: createPropertyDescriptor(\"image\"),\n\n /**\n * Gets or sets the numeric Property specifying the uniform scale to apply to the image.\n * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.\n * <p>\n * <div align='center'>\n * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>\n * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.\n * </div>\n * </p>\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n scale: createPropertyDescriptor(\"scale\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space\n * from the origin of this billboard. This is commonly used to align multiple billboards and labels at\n * the same position, e.g., an image and text. The screen space origin is the top, left corner of the\n * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.\n * <p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>\n * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n * </tr></table>\n * The billboard's origin is indicated by the yellow point.\n * </div>\n * </p>\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default Cartesian2.ZERO\n */\n pixelOffset: createPropertyDescriptor(\"pixelOffset\"),\n\n /**\n * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.\n * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's\n * right, <code>y</code> points up, and <code>z</code> points into the screen.\n * <p>\n * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to\n * arrange a billboard above its corresponding 3D model.\n * </p>\n * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always\n * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n * <p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n * </tr></table>\n * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>\n * </div>\n * </p>\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default Cartesian3.ZERO\n */\n eyeOffset: createPropertyDescriptor(\"eyeOffset\"),\n\n /**\n * Gets or sets the Property specifying the {@link HorizontalOrigin}.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default HorizontalOrigin.CENTER\n */\n horizontalOrigin: createPropertyDescriptor(\"horizontalOrigin\"),\n\n /**\n * Gets or sets the Property specifying the {@link VerticalOrigin}.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default VerticalOrigin.CENTER\n */\n verticalOrigin: createPropertyDescriptor(\"verticalOrigin\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.\n * This has two common use cases. First, the same white texture may be used by many different billboards,\n * each with a different color, to create colored billboards. Second, the color's alpha component can be\n * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard\n * transparent, and <code>1.0</code> makes the billboard opaque.\n * <p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>\n * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>\n * </tr></table>\n * </div>\n * </p>\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the numeric Property specifying the rotation of the image\n * counter clockwise from the <code>alignedAxis</code>.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n rotation: createPropertyDescriptor(\"rotation\"),\n\n /**\n * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation\n * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default Cartesian3.ZERO\n */\n alignedAxis: createPropertyDescriptor(\"alignedAxis\"),\n\n /**\n * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n sizeInMeters: createPropertyDescriptor(\"sizeInMeters\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the billboard in pixels.\n * When undefined, the native width is used.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n width: createPropertyDescriptor(\"width\"),\n\n /**\n * Gets or sets the numeric Property specifying the height of the billboard in pixels.\n * When undefined, the native height is used.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n height: createPropertyDescriptor(\"height\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.\n * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's scale remains clamped to the nearest bound.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.\n * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.\n * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n pixelOffsetScaleByDistance: createPropertyDescriptor(\n \"pixelOffsetScaleByDistance\"\n ),\n\n /**\n * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a\n * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,\n * measured in pixels from the bottom-left.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n imageSubRegion: createPropertyDescriptor(\"imageSubRegion\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof BillboardGraphics.prototype\n * @type {Property|undefined}\n */\n disableDepthTestDistance: createPropertyDescriptor(\n \"disableDepthTestDistance\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {BillboardGraphics} [result] The object onto which to store the result.\n * @returns {BillboardGraphics} The modified result parameter or a new instance if one was not provided.\n */\nBillboardGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new BillboardGraphics(this);\n }\n result.show = this._show;\n result.image = this._image;\n result.scale = this._scale;\n result.pixelOffset = this._pixelOffset;\n result.eyeOffset = this._eyeOffset;\n result.horizontalOrigin = this._horizontalOrigin;\n result.verticalOrigin = this._verticalOrigin;\n result.heightReference = this._heightReference;\n result.color = this._color;\n result.rotation = this._rotation;\n result.alignedAxis = this._alignedAxis;\n result.sizeInMeters = this._sizeInMeters;\n result.width = this._width;\n result.height = this._height;\n result.scaleByDistance = this._scaleByDistance;\n result.translucencyByDistance = this._translucencyByDistance;\n result.pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n result.imageSubRegion = this._imageSubRegion;\n result.distanceDisplayCondition = this._distanceDisplayCondition;\n result.disableDepthTestDistance = this._disableDepthTestDistance;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {BillboardGraphics} source The object to be merged into this object.\n */\nBillboardGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this._show, source.show);\n this.image = defaultValue(this._image, source.image);\n this.scale = defaultValue(this._scale, source.scale);\n this.pixelOffset = defaultValue(this._pixelOffset, source.pixelOffset);\n this.eyeOffset = defaultValue(this._eyeOffset, source.eyeOffset);\n this.horizontalOrigin = defaultValue(\n this._horizontalOrigin,\n source.horizontalOrigin\n );\n this.verticalOrigin = defaultValue(\n this._verticalOrigin,\n source.verticalOrigin\n );\n this.heightReference = defaultValue(\n this._heightReference,\n source.heightReference\n );\n this.color = defaultValue(this._color, source.color);\n this.rotation = defaultValue(this._rotation, source.rotation);\n this.alignedAxis = defaultValue(this._alignedAxis, source.alignedAxis);\n this.sizeInMeters = defaultValue(this._sizeInMeters, source.sizeInMeters);\n this.width = defaultValue(this._width, source.width);\n this.height = defaultValue(this._height, source.height);\n this.scaleByDistance = defaultValue(\n this._scaleByDistance,\n source.scaleByDistance\n );\n this.translucencyByDistance = defaultValue(\n this._translucencyByDistance,\n source.translucencyByDistance\n );\n this.pixelOffsetScaleByDistance = defaultValue(\n this._pixelOffsetScaleByDistance,\n source.pixelOffsetScaleByDistance\n );\n this.imageSubRegion = defaultValue(\n this._imageSubRegion,\n source.imageSubRegion\n );\n this.distanceDisplayCondition = defaultValue(\n this._distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.disableDepthTestDistance = defaultValue(\n this._disableDepthTestDistance,\n source.disableDepthTestDistance\n );\n};\nexport default BillboardGraphics;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A collection of key-value pairs that is stored as a hash for easy\n * lookup but also provides an array for fast iteration.\n * @alias AssociativeArray\n * @constructor\n */\nfunction AssociativeArray() {\n this._array = [];\n this._hash = {};\n}\n\nObject.defineProperties(AssociativeArray.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof AssociativeArray.prototype\n *\n * @type {Number}\n */\n length: {\n get: function () {\n return this._array.length;\n },\n },\n /**\n * Gets an unordered array of all values in the collection.\n * This is a live array that will automatically reflect the values in the collection,\n * it should not be modified directly.\n * @memberof AssociativeArray.prototype\n *\n * @type {Array}\n */\n values: {\n get: function () {\n return this._array;\n },\n },\n});\n\n/**\n * Determines if the provided key is in the array.\n *\n * @param {String|Number} key The key to check.\n * @returns {Boolean} <code>true</code> if the key is in the array, <code>false</code> otherwise.\n */\nAssociativeArray.prototype.contains = function (key) {\nreturn defined(this._hash[key]);\n};\n\n/**\n * Associates the provided key with the provided value. If the key already\n * exists, it is overwritten with the new value.\n *\n * @param {String|Number} key A unique identifier.\n * @param {*} value The value to associate with the provided key.\n */\nAssociativeArray.prototype.set = function (key, value) {\n const oldValue = this._hash[key];\n if (value !== oldValue) {\n this.remove(key);\n this._hash[key] = value;\n this._array.push(value);\n }\n};\n\n/**\n * Retrieves the value associated with the provided key.\n *\n * @param {String|Number} key The key whose value is to be retrieved.\n * @returns {*} The associated value, or undefined if the key does not exist in the collection.\n */\nAssociativeArray.prototype.get = function (key) {\nreturn this._hash[key];\n};\n\n/**\n * Removes a key-value pair from the collection.\n *\n * @param {String|Number} key The key to be removed.\n * @returns {Boolean} True if it was removed, false if the key was not in the collection.\n */\nAssociativeArray.prototype.remove = function (key) {\n const value = this._hash[key];\n const hasValue = defined(value);\n if (hasValue) {\n const array = this._array;\n array.splice(array.indexOf(value), 1);\n delete this._hash[key];\n }\n return hasValue;\n};\n\n/**\n * Clears the collection.\n */\nAssociativeArray.prototype.removeAll = function () {\n const array = this._array;\n if (array.length > 0) {\n this._hash = {};\n array.length = 0;\n }\n};\nexport default AssociativeArray;\n", "import MersenneTwister from \"mersenne-twister\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Math functions.\n *\n * @exports CesiumMath\n * @alias Math\n */\nconst CesiumMath = {};\n\n/**\n * 0.1\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON1 = 0.1;\n\n/**\n * 0.01\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON2 = 0.01;\n\n/**\n * 0.001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON3 = 0.001;\n\n/**\n * 0.0001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON4 = 0.0001;\n\n/**\n * 0.00001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON5 = 0.00001;\n\n/**\n * 0.000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON6 = 0.000001;\n\n/**\n * 0.0000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON7 = 0.0000001;\n\n/**\n * 0.00000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON8 = 0.00000001;\n\n/**\n * 0.000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON9 = 0.000000001;\n\n/**\n * 0.0000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON10 = 0.0000000001;\n\n/**\n * 0.00000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON11 = 0.00000000001;\n\n/**\n * 0.000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON12 = 0.000000000001;\n\n/**\n * 0.0000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON13 = 0.0000000000001;\n\n/**\n * 0.00000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON14 = 0.00000000000001;\n\n/**\n * 0.000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON15 = 0.000000000000001;\n\n/**\n * 0.0000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON16 = 0.0000000000000001;\n\n/**\n * 0.00000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON17 = 0.00000000000000001;\n\n/**\n * 0.000000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON18 = 0.000000000000000001;\n\n/**\n * 0.0000000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON19 = 0.0000000000000000001;\n\n/**\n * 0.00000000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON20 = 0.00000000000000000001;\n\n/**\n * 0.000000000000000000001\n * @type {Number}\n * @constant\n */\nCesiumMath.EPSILON21 = 0.000000000000000000001;\n\n/**\n * The gravitational parameter of the Earth in meters cubed\n * per second squared as defined by the WGS84 model: 3.986004418e14\n * @type {Number}\n * @constant\n */\nCesiumMath.GRAVITATIONALPARAMETER = 3.986004418e14;\n\n/**\n * Radius of the sun in meters: 6.955e8\n * @type {Number}\n * @constant\n */\nCesiumMath.SOLAR_RADIUS = 6.955e8;\n\n/**\n * The mean radius of the moon, according to the \"Report of the IAU/IAG Working Group on\n * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000\",\n * Celestial Mechanics 82: 83-110, 2002.\n * @type {Number}\n * @constant\n */\nCesiumMath.LUNAR_RADIUS = 1737400.0;\n\n/**\n * 64 * 1024\n * @type {Number}\n * @constant\n */\nCesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;\n\n/**\n * 4 * 1024 * 1024 * 1024\n * @type {Number}\n * @constant\n */\nCesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;\n\n/**\n * Returns the sign of the value; 1 if the value is positive, -1 if the value is\n * negative, or 0 if the value is 0.\n *\n * @function\n * @param {Number} value The value to return the sign of.\n * @returns {Number} The sign of value.\n */\n// eslint-disable-next-line es/no-math-sign\nCesiumMath.sign = defaultValue(Math.sign, function sign(value) {\n value = +value; // coerce to number\n if (value === 0 || value !== value) {\n // zero or NaN\n return value;\n }\n return value > 0 ? 1 : -1;\n});\n\n/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.\n * This is similar to {@link CesiumMath#sign} except that returns 1.0 instead of\n * 0.0 when the input value is 0.0.\n * @param {Number} value The value to return the sign of.\n * @returns {Number} The sign of value.\n */\nCesiumMath.signNotZero = function (value) {\n return value < 0.0 ? -1.0 : 1.0;\n};\n\n/**\n * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]\n * @param {Number} value The scalar value in the range [-1.0, 1.0]\n * @param {Number} [rangeMaximum=255] The maximum value in the mapped range, 255 by default.\n * @returns {Number} A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.\n *\n * @see CesiumMath.fromSNorm\n */\nCesiumMath.toSNorm = function (value, rangeMaximum) {\n rangeMaximum = defaultValue(rangeMaximum, 255);\n return Math.round(\n (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum\n );\n};\n\n/**\n * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].\n * @param {Number} value SNORM value in the range [0, rangeMaximum]\n * @param {Number} [rangeMaximum=255] The maximum value in the SNORM range, 255 by default.\n * @returns {Number} Scalar in the range [-1.0, 1.0].\n *\n * @see CesiumMath.toSNorm\n */\nCesiumMath.fromSNorm = function (value, rangeMaximum) {\n rangeMaximum = defaultValue(rangeMaximum, 255);\n return (\n (CesiumMath.clamp(value, 0.0, rangeMaximum) / rangeMaximum) * 2.0 - 1.0\n );\n};\n\n/**\n * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]\n * @param {Number} value The scalar value in the range [rangeMinimum, rangeMaximum]\n * @param {Number} rangeMinimum The minimum value in the mapped range.\n * @param {Number} rangeMaximum The maximum value in the mapped range.\n * @returns {Number} A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.\n */\nCesiumMath.normalize = function (value, rangeMinimum, rangeMaximum) {\n rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0.0);\n return rangeMaximum === 0.0\n ? 0.0\n : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0.0, 1.0);\n};\n\n/**\n * Returns the hyperbolic sine of a number.\n * The hyperbolic sine of <em>value</em> is defined to be\n * (<em>e<sup>x</sup> - e<sup>-x</sup></em>)/2.0\n * where <i>e</i> is Euler's number, approximately 2.71828183.\n *\n * <p>Special cases:\n * <ul>\n * <li>If the argument is NaN, then the result is NaN.</li>\n *\n * <li>If the argument is infinite, then the result is an infinity\n * with the same sign as the argument.</li>\n *\n * <li>If the argument is zero, then the result is a zero with the\n * same sign as the argument.</li>\n * </ul>\n *</p>\n *\n * @function\n * @param {Number} value The number whose hyperbolic sine is to be returned.\n * @returns {Number} The hyperbolic sine of <code>value</code>.\n */\n// eslint-disable-next-line es/no-math-sinh\nCesiumMath.sinh = defaultValue(Math.sinh, function sinh(value) {\n return (Math.exp(value) - Math.exp(-value)) / 2.0;\n});\n\n/**\n * Returns the hyperbolic cosine of a number.\n * The hyperbolic cosine of <strong>value</strong> is defined to be\n * (<em>e<sup>x</sup> + e<sup>-x</sup></em>)/2.0\n * where <i>e</i> is Euler's number, approximately 2.71828183.\n *\n * <p>Special cases:\n * <ul>\n * <li>If the argument is NaN, then the result is NaN.</li>\n *\n * <li>If the argument is infinite, then the result is positive infinity.</li>\n *\n * <li>If the argument is zero, then the result is 1.0.</li>\n * </ul>\n *</p>\n *\n * @function\n * @param {Number} value The number whose hyperbolic cosine is to be returned.\n * @returns {Number} The hyperbolic cosine of <code>value</code>.\n */\n// eslint-disable-next-line es/no-math-cosh\nCesiumMath.cosh = defaultValue(Math.cosh, function cosh(value) {\n return (Math.exp(value) + Math.exp(-value)) / 2.0;\n});\n\n/**\n * Computes the linear interpolation of two values.\n *\n * @param {Number} p The start value to interpolate.\n * @param {Number} q The end value to interpolate.\n * @param {Number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.\n * @returns {Number} The linearly interpolated value.\n *\n * @example\n * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0\n */\nCesiumMath.lerp = function (p, q, time) {\n return (1.0 - time) * p + time * q;\n};\n\n/**\n * pi\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.PI = Math.PI;\n\n/**\n * 1/pi\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.ONE_OVER_PI = 1.0 / Math.PI;\n\n/**\n * pi/2\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.PI_OVER_TWO = Math.PI / 2.0;\n\n/**\n * pi/3\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.PI_OVER_THREE = Math.PI / 3.0;\n\n/**\n * pi/4\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.PI_OVER_FOUR = Math.PI / 4.0;\n\n/**\n * pi/6\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.PI_OVER_SIX = Math.PI / 6.0;\n\n/**\n * 3pi/2\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) / 2.0;\n\n/**\n * 2pi\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.TWO_PI = 2.0 * Math.PI;\n\n/**\n * 1/2pi\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI);\n\n/**\n * The number of radians in a degree.\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0;\n\n/**\n * The number of degrees in a radian.\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI;\n\n/**\n * The number of radians in an arc second.\n *\n * @type {Number}\n * @constant\n */\nCesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0;\n\n/**\n * Converts degrees to radians.\n * @param {Number} degrees The angle to convert in degrees.\n * @returns {Number} The corresponding angle in radians.\n */\nCesiumMath.toRadians = function (degrees) {\nreturn degrees * CesiumMath.RADIANS_PER_DEGREE;\n};\n\n/**\n * Converts radians to degrees.\n * @param {Number} radians The angle to convert in radians.\n * @returns {Number} The corresponding angle in degrees.\n */\nCesiumMath.toDegrees = function (radians) {\nreturn radians * CesiumMath.DEGREES_PER_RADIAN;\n};\n\n/**\n * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n *\n * @param {Number} angle The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n * @returns {Number} The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).\n *\n * @example\n * // Convert 270 degrees to -90 degrees longitude\n * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));\n */\nCesiumMath.convertLongitudeRange = function (angle) {\nconst twoPi = CesiumMath.TWO_PI;\n\n const simplified = angle - Math.floor(angle / twoPi) * twoPi;\n\n if (simplified < -Math.PI) {\n return simplified + twoPi;\n }\n if (simplified >= Math.PI) {\n return simplified - twoPi;\n }\n\n return simplified;\n};\n\n/**\n * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n * Useful for sanitizing data before use in objects requiring correct range.\n *\n * @param {Number} angle The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n * @returns {Number} The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).\n *\n * @example\n * // Clamp 108 degrees latitude to 90 degrees latitude\n * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));\n */\nCesiumMath.clampToLatitudeRange = function (angle) {\n return CesiumMath.clamp(\n angle,\n -1 * CesiumMath.PI_OVER_TWO,\n CesiumMath.PI_OVER_TWO\n );\n};\n\n/**\n * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.\n *\n * @param {Number} angle in radians\n * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>].\n */\nCesiumMath.negativePiToPi = function (angle) {\nif (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {\n // Early exit if the input is already inside the range. This avoids\n // unnecessary math which could introduce floating point error.\n return angle;\n }\n return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;\n};\n\n/**\n * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.\n *\n * @param {Number} angle in radians\n * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>].\n */\nCesiumMath.zeroToTwoPi = function (angle) {\nif (angle >= 0 && angle <= CesiumMath.TWO_PI) {\n // Early exit if the input is already inside the range. This avoids\n // unnecessary math which could introduce floating point error.\n return angle;\n }\n const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);\n if (\n Math.abs(mod) < CesiumMath.EPSILON14 &&\n Math.abs(angle) > CesiumMath.EPSILON14\n ) {\n return CesiumMath.TWO_PI;\n }\n return mod;\n};\n\n/**\n * The modulo operation that also works for negative dividends.\n *\n * @param {Number} m The dividend.\n * @param {Number} n The divisor.\n * @returns {Number} The remainder.\n */\nCesiumMath.mod = function (m, n) {\nif (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {\n // Early exit if the input does not need to be modded. This avoids\n // unnecessary math which could introduce floating point error.\n return m;\n }\n\n return ((m % n) + n) % n;\n};\n\n/**\n * Determines if two values are equal using an absolute or relative tolerance test. This is useful\n * to avoid problems due to roundoff error when comparing floating-point values directly. The values are\n * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.\n * Use this test if you are unsure of the magnitudes of left and right.\n *\n * @param {Number} left The first value to compare.\n * @param {Number} right The other value to compare.\n * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.\n * @returns {Boolean} <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.\n *\n * @example\n * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true\n * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false\n * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true\n * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false\n */\nCesiumMath.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n relativeEpsilon = defaultValue(relativeEpsilon, 0.0);\n absoluteEpsilon = defaultValue(absoluteEpsilon, relativeEpsilon);\n const absDiff = Math.abs(left - right);\n return (\n absDiff <= absoluteEpsilon ||\n absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right))\n );\n};\n\n/**\n * Determines if the left value is less than the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.\n *\n * @param {Number} left The first number to compare.\n * @param {Number} right The second number to compare.\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {Boolean} <code>true</code> if <code>left</code> is less than <code>right</code> by more than\n * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two\n * values are nearly equal.\n */\nCesiumMath.lessThan = function (left, right, absoluteEpsilon) {\nreturn left - right < -absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is less than or equal to the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.\n *\n * @param {Number} left The first number to compare.\n * @param {Number} right The second number to compare.\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {Boolean} <code>true</code> if <code>left</code> is less than <code>right</code> or if the\n * the values are nearly equal.\n */\nCesiumMath.lessThanOrEquals = function (left, right, absoluteEpsilon) {\nreturn left - right < absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is greater the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.\n *\n * @param {Number} left The first number to compare.\n * @param {Number} right The second number to compare.\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {Boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> by more than\n * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two\n * values are nearly equal.\n */\nCesiumMath.greaterThan = function (left, right, absoluteEpsilon) {\nreturn left - right > absoluteEpsilon;\n};\n\n/**\n * Determines if the left value is greater than or equal to the right value. If the two values are within\n * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.\n *\n * @param {Number} left The first number to compare.\n * @param {Number} right The second number to compare.\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\n * @returns {Boolean} <code>true</code> if <code>left</code> is greater than <code>right</code> or if the\n * the values are nearly equal.\n */\nCesiumMath.greaterThanOrEquals = function (left, right, absoluteEpsilon) {\nreturn left - right > -absoluteEpsilon;\n};\n\nconst factorials = [1];\n\n/**\n * Computes the factorial of the provided number.\n *\n * @param {Number} n The number whose factorial is to be computed.\n * @returns {Number} The factorial of the provided number or undefined if the number is less than 0.\n *\n * @exception {DeveloperError} A number greater than or equal to 0 is required.\n *\n *\n * @example\n * //Compute 7!, which is equal to 5040\n * const computedFactorial = Cesium.Math.factorial(7);\n *\n * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia}\n */\nCesiumMath.factorial = function (n) {\n const length = factorials.length;\n if (n >= length) {\n let sum = factorials[length - 1];\n for (let i = length; i <= n; i++) {\n const next = sum * i;\n factorials.push(next);\n sum = next;\n }\n }\n return factorials[n];\n};\n\n/**\n * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.\n *\n * @param {Number} [n] The number to be incremented.\n * @param {Number} [maximumValue] The maximum incremented value before rolling over to the minimum value.\n * @param {Number} [minimumValue=0.0] The number reset to after the maximum value has been exceeded.\n * @returns {Number} The incremented number.\n *\n * @exception {DeveloperError} Maximum value must be greater than minimum value.\n *\n * @example\n * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6\n * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0\n */\nCesiumMath.incrementWrap = function (n, maximumValue, minimumValue) {\n minimumValue = defaultValue(minimumValue, 0.0);\n\n ++n;\n if (n > maximumValue) {\n n = minimumValue;\n }\n return n;\n};\n\n/**\n * Determines if a non-negative integer is a power of two.\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {Number} n The integer to test in the range [0, (2^32)-1].\n * @returns {Boolean} <code>true</code> if the number if a power of two; otherwise, <code>false</code>.\n *\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\n *\n * @example\n * const t = Cesium.Math.isPowerOfTwo(16); // true\n * const f = Cesium.Math.isPowerOfTwo(20); // false\n */\nCesiumMath.isPowerOfTwo = function (n) {\n return n !== 0 && (n & (n - 1)) === 0;\n};\n\n/**\n * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.\n * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {Number} n The integer to test in the range [0, 2^31].\n * @returns {Number} The next power-of-two integer.\n *\n * @exception {DeveloperError} A number between 0 and 2^31 is required.\n *\n * @example\n * const n = Cesium.Math.nextPowerOfTwo(29); // 32\n * const m = Cesium.Math.nextPowerOfTwo(32); // 32\n */\nCesiumMath.nextPowerOfTwo = function (n) {\n // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2\n --n;\n n |= n >> 1;\n n |= n >> 2;\n n |= n >> 4;\n n |= n >> 8;\n n |= n >> 16;\n ++n;\n\n return n;\n};\n\n/**\n * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\n *\n * @param {Number} n The integer to test in the range [0, (2^32)-1].\n * @returns {Number} The previous power-of-two integer.\n *\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\n *\n * @example\n * const n = Cesium.Math.previousPowerOfTwo(29); // 16\n * const m = Cesium.Math.previousPowerOfTwo(32); // 32\n */\nCesiumMath.previousPowerOfTwo = function (n) {\n n |= n >> 1;\n n |= n >> 2;\n n |= n >> 4;\n n |= n >> 8;\n n |= n >> 16;\n n |= n >> 32;\n\n // The previous bitwise operations implicitly convert to signed 32-bit. Use `>>>` to convert to unsigned\n n = (n >>> 0) - (n >>> 1);\n\n return n;\n};\n\n/**\n * Constraint a value to lie between two values.\n *\n * @param {Number} value The value to clamp.\n * @param {Number} min The minimum value.\n * @param {Number} max The maximum value.\n * @returns {Number} The clamped value such that min <= result <= max.\n */\nCesiumMath.clamp = function (value, min, max) {\n return value < min ? min : value > max ? max : value;\n};\n\nlet randomNumberGenerator = new MersenneTwister();\n\n/**\n * Sets the seed used by the random number generator\n * in {@link CesiumMath#nextRandomNumber}.\n *\n * @param {Number} seed An integer used as the seed.\n */\nCesiumMath.setRandomNumberSeed = function (seed) {\n randomNumberGenerator = new MersenneTwister(seed);\n};\n\n/**\n * Generates a random floating point number in the range of [0.0, 1.0)\n * using a Mersenne twister.\n *\n * @returns {Number} A random number in the range of [0.0, 1.0).\n *\n * @see CesiumMath.setRandomNumberSeed\n * @see {@link http://en.wikipedia.org/wiki/Mersenne_twister|Mersenne twister on Wikipedia}\n */\nCesiumMath.nextRandomNumber = function () {\n return randomNumberGenerator.random();\n};\n\n/**\n * Generates a random number between two numbers.\n *\n * @param {Number} min The minimum value.\n * @param {Number} max The maximum value.\n * @returns {Number} A random number between the min and max.\n */\nCesiumMath.randomBetween = function (min, max) {\n return CesiumMath.nextRandomNumber() * (max - min) + min;\n};\n\n/**\n * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]\n * so that the function will never return NaN.\n *\n * @param {Number} value The value for which to compute acos.\n * @returns {Number} The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,\n * whichever is closer, if the value is outside the range.\n */\nCesiumMath.acosClamped = function (value) {\nreturn Math.acos(CesiumMath.clamp(value, -1.0, 1.0));\n};\n\n/**\n * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]\n * so that the function will never return NaN.\n *\n * @param {Number} value The value for which to compute asin.\n * @returns {Number} The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,\n * whichever is closer, if the value is outside the range.\n */\nCesiumMath.asinClamped = function (value) {\nreturn Math.asin(CesiumMath.clamp(value, -1.0, 1.0));\n};\n\n/**\n * Finds the chord length between two points given the circle's radius and the angle between the points.\n *\n * @param {Number} angle The angle between the two points.\n * @param {Number} radius The radius of the circle.\n * @returns {Number} The chord length.\n */\nCesiumMath.chordLength = function (angle, radius) {\nreturn 2.0 * radius * Math.sin(angle * 0.5);\n};\n\n/**\n * Finds the logarithm of a number to a base.\n *\n * @param {Number} number The number.\n * @param {Number} base The base.\n * @returns {Number} The result.\n */\nCesiumMath.logBase = function (number, base) {\nreturn Math.log(number) / Math.log(base);\n};\n\n/**\n * Finds the cube root of a number.\n * Returns NaN if <code>number</code> is not provided.\n *\n * @function\n * @param {Number} [number] The number.\n * @returns {Number} The result.\n */\n// eslint-disable-next-line es/no-math-cbrt\nCesiumMath.cbrt = defaultValue(Math.cbrt, function cbrt(number) {\n const result = Math.pow(Math.abs(number), 1.0 / 3.0);\n return number < 0.0 ? -result : result;\n});\n\n/**\n * Finds the base 2 logarithm of a number.\n *\n * @function\n * @param {Number} number The number.\n * @returns {Number} The result.\n */\n// eslint-disable-next-line es/no-math-log2\nCesiumMath.log2 = defaultValue(Math.log2, function log2(number) {\n return Math.log(number) * Math.LOG2E;\n});\n\n/**\n * @private\n */\nCesiumMath.fog = function (distanceToCamera, density) {\n const scalar = distanceToCamera * density;\n return 1.0 - Math.exp(-(scalar * scalar));\n};\n\n/**\n * Computes a fast approximation of Atan for input in the range [-1, 1].\n *\n * Based on Michal Drobot's approximation from ShaderFastLibs,\n * which in turn is based on \"Efficient approximations for the arctangent function,\"\n * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\n * Adapted from ShaderFastLibs under MIT License.\n *\n * @param {Number} x An input number in the range [-1, 1]\n * @returns {Number} An approximation of atan(x)\n */\nCesiumMath.fastApproximateAtan = function (x) {\n return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);\n};\n\n/**\n * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.\n *\n * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html\n *\n * @param {Number} x An input number that isn't zero if y is zero.\n * @param {Number} y An input number that isn't zero if x is zero.\n * @returns {Number} An approximation of atan2(x, y)\n */\nCesiumMath.fastApproximateAtan2 = function (x, y) {\n // atan approximations are usually only reliable over [-1, 1]\n // So reduce the range by flipping whether x or y is on top based on which is bigger.\n let opposite;\n let t = Math.abs(x); // t used as swap and atan result.\n opposite = Math.abs(y);\n const adjacent = Math.max(t, opposite);\n opposite = Math.min(t, opposite);\n\n const oppositeOverAdjacent = opposite / adjacent;\nt = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);\n\n // Undo range reduction\n t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;\n t = x < 0.0 ? CesiumMath.PI - t : t;\n t = y < 0.0 ? -t : t;\n return t;\n};\nexport default CesiumMath;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 2D Cartesian point.\n * @alias Cartesian2\n * @constructor\n *\n * @param {Number} [x=0.0] The X component.\n * @param {Number} [y=0.0] The Y component.\n *\n * @see Cartesian3\n * @see Cartesian4\n * @see Packable\n */\nfunction Cartesian2(x, y) {\n /**\n * The X component.\n * @type {Number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {Number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n}\n\n/**\n * Creates a Cartesian2 instance from x and y coordinates.\n *\n * @param {Number} x The x coordinate.\n * @param {Number} y The y coordinate.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromElements = function (x, y, result) {\n if (!defined(result)) {\n return new Cartesian2(x, y);\n }\n\n result.x = x;\n result.y = y;\n return result;\n};\n\n/**\n * Duplicates a Cartesian2 instance.\n *\n * @param {Cartesian2} cartesian The Cartesian to duplicate.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian2.clone = function (cartesian, result) {\n if (!defined(cartesian)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Cartesian2(cartesian.x, cartesian.y);\n }\n\n result.x = cartesian.x;\n result.y = cartesian.y;\n return result;\n};\n\n/**\n * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the\n * x and y properties of the Cartesian3 and drops z.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromCartesian3 = Cartesian2.clone;\n\n/**\n * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the\n * x and y properties of the Cartesian4 and drops z and w.\n * @function\n *\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.fromCartesian4 = Cartesian2.clone;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCartesian2.packedLength = 2;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian2} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCartesian2.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex] = value.y;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian2} [result] The object into which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Cartesian2();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Cartesian2s into an array of components.\n *\n * @param {Cartesian2[]} array The array of cartesians to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.\n * @returns {Number[]} The packed array.\n */\nCartesian2.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 2;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Cartesian2.pack(array[i], result, i * 2);\n }\n return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian2s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Cartesian2[]} [result] The array onto which to store the result.\n * @returns {Cartesian2[]} The unpacked array.\n */\nCartesian2.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 2);\n } else {\n result.length = length / 2;\n }\n\n for (let i = 0; i < length; i += 2) {\n const index = i / 2;\n result[index] = Cartesian2.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Creates a Cartesian2 from two consecutive elements in an array.\n * @function\n *\n * @param {Number[]} array The array whose two consecutive elements correspond to the x and y components, respectively.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian2 with (1.0, 2.0)\n * const v = [1.0, 2.0];\n * const p = Cesium.Cartesian2.fromArray(v);\n *\n * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0];\n * const p2 = Cesium.Cartesian2.fromArray(v2, 2);\n */\nCartesian2.fromArray = Cartesian2.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The cartesian to use.\n * @returns {Number} The value of the maximum component.\n */\nCartesian2.maximumComponent = function (cartesian) {\n return Math.max(cartesian.x, cartesian.y);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The cartesian to use.\n * @returns {Number} The value of the minimum component.\n */\nCartesian2.minimumComponent = function (cartesian) {\n return Math.min(cartesian.x, cartesian.y);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian2} first A cartesian to compare.\n * @param {Cartesian2} second A cartesian to compare.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} A cartesian with the minimum components.\n */\nCartesian2.minimumByComponent = function (first, second, result) {\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n\n return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian2} first A cartesian to compare.\n * @param {Cartesian2} second A cartesian to compare.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} A cartesian with the maximum components.\n */\nCartesian2.maximumByComponent = function (first, second, result) {\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian2} value The value to clamp.\n * @param {Cartesian2} min The minimum bound.\n * @param {Cartesian2} max The maximum bound.\n * @param {Cartesian2} result The object into which to store the result.\n * @returns {Cartesian2} The clamped value such that min <= result <= max.\n */\nCartesian2.clamp = function (value, min, max, result) {\n const x = CesiumMath.clamp(value.x, min.x, max.x);\n const y = CesiumMath.clamp(value.y, min.y, max.y);\n\n result.x = x;\n result.y = y;\n\n return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {Number} The squared magnitude.\n */\nCartesian2.magnitudeSquared = function (cartesian) {\n return cartesian.x * cartesian.x + cartesian.y * cartesian.y;\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {Number} The magnitude.\n */\nCartesian2.magnitude = function (cartesian) {\n return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian2();\n\n/**\n * Computes the distance between two points.\n *\n * @param {Cartesian2} left The first point to compute the distance from.\n * @param {Cartesian2} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));\n */\nCartesian2.distance = function (left, right) {\n Cartesian2.subtract(left, right, distanceScratch);\n return Cartesian2.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.\n *\n * @param {Cartesian2} left The first point to compute the distance from.\n * @param {Cartesian2} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));\n */\nCartesian2.distanceSquared = function (left, right) {\n Cartesian2.subtract(left, right, distanceScratch);\n return Cartesian2.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian to be normalized.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.normalize = function (cartesian, result) {\n const magnitude = Cartesian2.magnitude(cartesian);\n\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {Number} The dot product.\n */\nCartesian2.dot = function (left, right) {\n return left.x * right.x + left.y * right.y;\n};\n\n/**\n * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {Number} The cross product.\n */\nCartesian2.cross = function (left, right) {\n return left.x * right.y - left.y * right.x;\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.multiplyComponents = function (left, right, result) {\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.divideComponents = function (left, right, result) {\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.add = function (left, right, result) {\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.subtract = function (left, right, result) {\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian2} cartesian The Cartesian to be scaled.\n * @param {Number} scalar The scalar to multiply with.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.multiplyByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian2} cartesian The Cartesian to be divided.\n * @param {Number} scalar The scalar to divide by.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.divideByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian to be negated.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.negate = function (cartesian, result) {\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.abs = function (cartesian, result) {\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n return result;\n};\n\nconst lerpScratch = new Cartesian2();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian2} start The value corresponding to t at 0.0.\n * @param {Cartesian2} end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nCartesian2.lerp = function (start, end, t, result) {\n Cartesian2.multiplyByScalar(end, t, lerpScratch);\n result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);\n return Cartesian2.add(lerpScratch, result, result);\n};\n\nconst angleBetweenScratch = new Cartesian2();\nconst angleBetweenScratch2 = new Cartesian2();\n/**\n * Returns the angle, in radians, between the provided Cartesians.\n *\n * @param {Cartesian2} left The first Cartesian.\n * @param {Cartesian2} right The second Cartesian.\n * @returns {Number} The angle between the Cartesians.\n */\nCartesian2.angleBetween = function (left, right) {\n Cartesian2.normalize(left, angleBetweenScratch);\n Cartesian2.normalize(right, angleBetweenScratch2);\n return CesiumMath.acosClamped(\n Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2)\n );\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian2();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The most orthogonal axis.\n */\nCartesian2.mostOrthogonalAxis = function (cartesian, result) {\n const f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);\n Cartesian2.abs(f, f);\n\n if (f.x <= f.y) {\n result = Cartesian2.clone(Cartesian2.UNIT_X, result);\n } else {\n result = Cartesian2.clone(Cartesian2.UNIT_Y, result);\n }\n\n return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian2} [left] The first Cartesian.\n * @param {Cartesian2} [right] The second Cartesian.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian2.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y)\n );\n};\n\n/**\n * @private\n */\nCartesian2.equalsArray = function (cartesian, array, offset) {\n return cartesian.x === array[offset] && cartesian.y === array[offset + 1];\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian2} [left] The first Cartesian.\n * @param {Cartesian2} [right] The second Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian2.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.x,\n right.x,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.y,\n right.y,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\n\n/**\n * An immutable Cartesian2 instance initialized to (0.0, 0.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (1.0, 1.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.ONE = Object.freeze(new Cartesian2(1.0, 1.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (1.0, 0.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0));\n\n/**\n * An immutable Cartesian2 instance initialized to (0.0, 1.0).\n *\n * @type {Cartesian2}\n * @constant\n */\nCartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0));\n\n/**\n * Duplicates this Cartesian2 instance.\n *\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\n */\nCartesian2.prototype.clone = function (result) {\n return Cartesian2.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian2} [right] The right hand side Cartesian.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian2.prototype.equals = function (right) {\n return Cartesian2.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian2} [right] The right hand side Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian2.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return Cartesian2.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon\n );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y)'.\n *\n * @returns {String} A string representing the provided Cartesian in the format '(x, y)'.\n */\nCartesian2.prototype.toString = function () {\n return `(${this.x}, ${this.y})`;\n};\nexport default Cartesian2;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3D Cartesian point.\n * @alias Cartesian3\n * @constructor\n *\n * @param {Number} [x=0.0] The X component.\n * @param {Number} [y=0.0] The Y component.\n * @param {Number} [z=0.0] The Z component.\n *\n * @see Cartesian2\n * @see Cartesian4\n * @see Packable\n */\nfunction Cartesian3(x, y, z) {\n /**\n * The X component.\n * @type {Number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {Number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The Z component.\n * @type {Number}\n * @default 0.0\n */\n this.z = defaultValue(z, 0.0);\n}\n\n/**\n * Converts the provided Spherical into Cartesian3 coordinates.\n *\n * @param {Spherical} spherical The Spherical to be converted to Cartesian3.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromSpherical = function (spherical, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const clock = spherical.clock;\n const cone = spherical.cone;\n const magnitude = defaultValue(spherical.magnitude, 1.0);\n const radial = magnitude * Math.sin(cone);\n result.x = radial * Math.cos(clock);\n result.y = radial * Math.sin(clock);\n result.z = magnitude * Math.cos(cone);\n return result;\n};\n\n/**\n * Creates a Cartesian3 instance from x, y and z coordinates.\n *\n * @param {Number} x The x coordinate.\n * @param {Number} y The y coordinate.\n * @param {Number} z The z coordinate.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromElements = function (x, y, z, result) {\n if (!defined(result)) {\n return new Cartesian3(x, y, z);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Duplicates a Cartesian3 instance.\n *\n * @param {Cartesian3} cartesian The Cartesian to duplicate.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian3.clone = function (cartesian, result) {\n if (!defined(cartesian)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Cartesian3(cartesian.x, cartesian.y, cartesian.z);\n }\n\n result.x = cartesian.x;\n result.y = cartesian.y;\n result.z = cartesian.z;\n return result;\n};\n\n/**\n * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the\n * x, y, and z properties of the Cartesian4 and drops w.\n * @function\n *\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian3 instance from.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.fromCartesian4 = Cartesian3.clone;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCartesian3.packedLength = 3;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian3} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCartesian3.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex] = value.z;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian3} [result] The object into which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.z = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Cartesian3s into an array of components.\n *\n * @param {Cartesian3[]} array The array of cartesians to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.\n * @returns {Number[]} The packed array.\n */\nCartesian3.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 3;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Cartesian3.pack(array[i], result, i * 3);\n }\n return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian3s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Cartesian3[]} [result] The array onto which to store the result.\n * @returns {Cartesian3[]} The unpacked array.\n */\nCartesian3.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 3);\n } else {\n result.length = length / 3;\n }\n\n for (let i = 0; i < length; i += 3) {\n const index = i / 3;\n result[index] = Cartesian3.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Creates a Cartesian3 from three consecutive elements in an array.\n * @function\n *\n * @param {Number[]} array The array whose three consecutive elements correspond to the x, y, and z components, respectively.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian3 with (1.0, 2.0, 3.0)\n * const v = [1.0, 2.0, 3.0];\n * const p = Cesium.Cartesian3.fromArray(v);\n *\n * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];\n * const p2 = Cesium.Cartesian3.fromArray(v2, 2);\n */\nCartesian3.fromArray = Cartesian3.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The cartesian to use.\n * @returns {Number} The value of the maximum component.\n */\nCartesian3.maximumComponent = function (cartesian) {\n return Math.max(cartesian.x, cartesian.y, cartesian.z);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The cartesian to use.\n * @returns {Number} The value of the minimum component.\n */\nCartesian3.minimumComponent = function (cartesian) {\n return Math.min(cartesian.x, cartesian.y, cartesian.z);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian3} first A cartesian to compare.\n * @param {Cartesian3} second A cartesian to compare.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} A cartesian with the minimum components.\n */\nCartesian3.minimumByComponent = function (first, second, result) {\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n result.z = Math.min(first.z, second.z);\n\n return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian3} first A cartesian to compare.\n * @param {Cartesian3} second A cartesian to compare.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} A cartesian with the maximum components.\n */\nCartesian3.maximumByComponent = function (first, second, result) {\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n result.z = Math.max(first.z, second.z);\n return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian3} cartesian The value to clamp.\n * @param {Cartesian3} min The minimum bound.\n * @param {Cartesian3} max The maximum bound.\n * @param {Cartesian3} result The object into which to store the result.\n * @returns {Cartesian3} The clamped value such that min <= value <= max.\n */\nCartesian3.clamp = function (value, min, max, result) {\n const x = CesiumMath.clamp(value.x, min.x, max.x);\n const y = CesiumMath.clamp(value.y, min.y, max.y);\n const z = CesiumMath.clamp(value.z, min.z, max.z);\n\n result.x = x;\n result.y = y;\n result.z = z;\n\n return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian3} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {Number} The squared magnitude.\n */\nCartesian3.magnitudeSquared = function (cartesian) {\n return (\n cartesian.x * cartesian.x +\n cartesian.y * cartesian.y +\n cartesian.z * cartesian.z\n );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian3} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {Number} The magnitude.\n */\nCartesian3.magnitude = function (cartesian) {\n return Math.sqrt(Cartesian3.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian3();\n\n/**\n * Computes the distance between two points.\n *\n * @param {Cartesian3} left The first point to compute the distance from.\n * @param {Cartesian3} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));\n */\nCartesian3.distance = function (left, right) {\n Cartesian3.subtract(left, right, distanceScratch);\n return Cartesian3.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.\n *\n * @param {Cartesian3} left The first point to compute the distance from.\n * @param {Cartesian3} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));\n */\nCartesian3.distanceSquared = function (left, right) {\n Cartesian3.subtract(left, right, distanceScratch);\n return Cartesian3.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian to be normalized.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.normalize = function (cartesian, result) {\n const magnitude = Cartesian3.magnitude(cartesian);\n\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n result.z = cartesian.z / magnitude;\n\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @returns {Number} The dot product.\n */\nCartesian3.dot = function (left, right) {\n return left.x * right.x + left.y * right.y + left.z * right.z;\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.multiplyComponents = function (left, right, result) {\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n result.z = left.z * right.z;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.divideComponents = function (left, right, result) {\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n result.z = left.z / right.z;\n return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.add = function (left, right, result) {\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.subtract = function (left, right, result) {\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian3} cartesian The Cartesian to be scaled.\n * @param {Number} scalar The scalar to multiply with.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.multiplyByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n result.z = cartesian.z * scalar;\n return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian3} cartesian The Cartesian to be divided.\n * @param {Number} scalar The scalar to divide by.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.divideByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n result.z = cartesian.z / scalar;\n return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian to be negated.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.negate = function (cartesian, result) {\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n result.z = -cartesian.z;\n return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.abs = function (cartesian, result) {\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n result.z = Math.abs(cartesian.z);\n return result;\n};\n\nconst lerpScratch = new Cartesian3();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian3} start The value corresponding to t at 0.0.\n * @param {Cartesian3} end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nCartesian3.lerp = function (start, end, t, result) {\n Cartesian3.multiplyByScalar(end, t, lerpScratch);\n result = Cartesian3.multiplyByScalar(start, 1.0 - t, result);\n return Cartesian3.add(lerpScratch, result, result);\n};\n\nconst angleBetweenScratch = new Cartesian3();\nconst angleBetweenScratch2 = new Cartesian3();\n/**\n * Returns the angle, in radians, between the provided Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @returns {Number} The angle between the Cartesians.\n */\nCartesian3.angleBetween = function (left, right) {\n Cartesian3.normalize(left, angleBetweenScratch);\n Cartesian3.normalize(right, angleBetweenScratch2);\n const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);\n const sine = Cartesian3.magnitude(\n Cartesian3.cross(\n angleBetweenScratch,\n angleBetweenScratch2,\n angleBetweenScratch\n )\n );\n return Math.atan2(sine, cosine);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian3();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian3} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The most orthogonal axis.\n */\nCartesian3.mostOrthogonalAxis = function (cartesian, result) {\n const f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch);\n Cartesian3.abs(f, f);\n\n if (f.x <= f.y) {\n if (f.x <= f.z) {\n result = Cartesian3.clone(Cartesian3.UNIT_X, result);\n } else {\n result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\n }\n } else if (f.y <= f.z) {\n result = Cartesian3.clone(Cartesian3.UNIT_Y, result);\n } else {\n result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\n }\n\n return result;\n};\n\n/**\n * Projects vector a onto vector b\n * @param {Cartesian3} a The vector that needs projecting\n * @param {Cartesian3} b The vector to project onto\n * @param {Cartesian3} result The result cartesian\n * @returns {Cartesian3} The modified result parameter\n */\nCartesian3.projectVector = function (a, b, result) {\n const scalar = Cartesian3.dot(a, b) / Cartesian3.dot(b, b);\n return Cartesian3.multiplyByScalar(b, scalar, result);\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian3} [left] The first Cartesian.\n * @param {Cartesian3} [right] The second Cartesian.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian3.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z)\n );\n};\n\n/**\n * @private\n */\nCartesian3.equalsArray = function (cartesian, array, offset) {\n return (\n cartesian.x === array[offset] &&\n cartesian.y === array[offset + 1] &&\n cartesian.z === array[offset + 2]\n );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian3} [left] The first Cartesian.\n * @param {Cartesian3} [right] The second Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian3.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.x,\n right.x,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.y,\n right.y,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.z,\n right.z,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\n\n/**\n * Computes the cross (outer) product of two Cartesians.\n *\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The cross product.\n */\nCartesian3.cross = function (left, right, result) {\n const leftX = left.x;\n const leftY = left.y;\n const leftZ = left.z;\n const rightX = right.x;\n const rightY = right.y;\n const rightZ = right.z;\n\n const x = leftY * rightZ - leftZ * rightY;\n const y = leftZ * rightX - leftX * rightZ;\n const z = leftX * rightY - leftY * rightX;\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the midpoint between the right and left Cartesian.\n * @param {Cartesian3} left The first Cartesian.\n * @param {Cartesian3} right The second Cartesian.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The midpoint.\n */\nCartesian3.midpoint = function (left, right, result) {\n result.x = (left.x + right.x) * 0.5;\n result.y = (left.y + right.y) * 0.5;\n result.z = (left.z + right.z) * 0.5;\n\n return result;\n};\n\n/**\n * Returns a Cartesian3 position from longitude and latitude values given in degrees.\n *\n * @param {Number} longitude The longitude, in degrees\n * @param {Number} latitude The latitude, in degrees\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n *\n * @example\n * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);\n */\nCartesian3.fromDegrees = function (\n longitude,\n latitude,\n height,\n ellipsoid,\n result\n) {\n longitude = CesiumMath.toRadians(longitude);\n latitude = CesiumMath.toRadians(latitude);\n return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);\n};\n\nlet scratchN = new Cartesian3();\nlet scratchK = new Cartesian3();\nconst wgs84RadiiSquared = new Cartesian3(\n 6378137.0 * 6378137.0,\n 6378137.0 * 6378137.0,\n 6356752.3142451793 * 6356752.3142451793\n);\n\n/**\n * Returns a Cartesian3 position from longitude and latitude values given in radians.\n *\n * @param {Number} longitude The longitude, in radians\n * @param {Number} latitude The latitude, in radians\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n *\n * @example\n * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);\n */\nCartesian3.fromRadians = function (\n longitude,\n latitude,\n height,\n ellipsoid,\n result\n) {\n height = defaultValue(height, 0.0);\n const radiiSquared = defined(ellipsoid)\n ? ellipsoid.radiiSquared\n : wgs84RadiiSquared;\n\n const cosLatitude = Math.cos(latitude);\n scratchN.x = cosLatitude * Math.cos(longitude);\n scratchN.y = cosLatitude * Math.sin(longitude);\n scratchN.z = Math.sin(latitude);\n scratchN = Cartesian3.normalize(scratchN, scratchN);\n\n Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);\n const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));\n scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);\n scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n return Cartesian3.add(scratchK, scratchN, result);\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.\n *\n * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);\n */\nCartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) {\n const length = coordinates.length;\n if (!defined(result)) {\n result = new Array(length / 2);\n } else {\n result.length = length / 2;\n }\n\n for (let i = 0; i < length; i += 2) {\n const longitude = coordinates[i];\n const latitude = coordinates[i + 1];\n const index = i / 2;\n result[index] = Cartesian3.fromDegrees(\n longitude,\n latitude,\n 0,\n ellipsoid,\n result[index]\n );\n }\n\n return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.\n *\n * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);\n */\nCartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) {\n const length = coordinates.length;\n if (!defined(result)) {\n result = new Array(length / 2);\n } else {\n result.length = length / 2;\n }\n\n for (let i = 0; i < length; i += 2) {\n const longitude = coordinates[i];\n const latitude = coordinates[i + 1];\n const index = i / 2;\n result[index] = Cartesian3.fromRadians(\n longitude,\n latitude,\n 0,\n ellipsoid,\n result[index]\n );\n }\n\n return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.\n *\n * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);\n */\nCartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) {\n const length = coordinates.length;\n if (!defined(result)) {\n result = new Array(length / 3);\n } else {\n result.length = length / 3;\n }\n\n for (let i = 0; i < length; i += 3) {\n const longitude = coordinates[i];\n const latitude = coordinates[i + 1];\n const height = coordinates[i + 2];\n const index = i / 3;\n result[index] = Cartesian3.fromDegrees(\n longitude,\n latitude,\n height,\n ellipsoid,\n result[index]\n );\n }\n\n return result;\n};\n\n/**\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.\n *\n * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\n * @returns {Cartesian3[]} The array of positions.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);\n */\nCartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) {\n const length = coordinates.length;\n if (!defined(result)) {\n result = new Array(length / 3);\n } else {\n result.length = length / 3;\n }\n\n for (let i = 0; i < length; i += 3) {\n const longitude = coordinates[i];\n const latitude = coordinates[i + 1];\n const height = coordinates[i + 2];\n const index = i / 3;\n result[index] = Cartesian3.fromRadians(\n longitude,\n latitude,\n height,\n ellipsoid,\n result[index]\n );\n }\n\n return result;\n};\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.ONE = Object.freeze(new Cartesian3(1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).\n *\n * @type {Cartesian3}\n * @constant\n */\nCartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian3 instance.\n *\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nCartesian3.prototype.clone = function (result) {\n return Cartesian3.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian3} [right] The right hand side Cartesian.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian3.prototype.equals = function (right) {\n return Cartesian3.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian3} [right] The right hand side Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian3.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return Cartesian3.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon\n );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z)'.\n *\n * @returns {String} A string representing this Cartesian in the format '(x, y, z)'.\n */\nCartesian3.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z})`;\n};\nexport default Cartesian3;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scaleToGeodeticSurfaceIntersection = new Cartesian3();\nconst scaleToGeodeticSurfaceGradient = new Cartesian3();\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.\n * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.\n * @param {Number} centerToleranceSquared Tolerance for closeness to the center.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n *\n * @function scaleToGeodeticSurface\n *\n * @private\n */\nfunction scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n result\n) {\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n\n const oneOverRadiiX = oneOverRadii.x;\n const oneOverRadiiY = oneOverRadii.y;\n const oneOverRadiiZ = oneOverRadii.z;\n\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\n\n // Compute the squared ellipsoid norm.\n const squaredNorm = x2 + y2 + z2;\n const ratio = Math.sqrt(1.0 / squaredNorm);\n\n // As an initial approximation, assume that the radial intersection is the projection point.\n const intersection = Cartesian3.multiplyByScalar(\n cartesian,\n ratio,\n scaleToGeodeticSurfaceIntersection\n );\n\n // If the position is near the center, the iteration will not converge.\n if (squaredNorm < centerToleranceSquared) {\n return !isFinite(ratio)\n ? undefined\n : Cartesian3.clone(intersection, result);\n }\n\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n // Use the gradient at the intersection point in place of the true unit normal.\n // The difference in magnitude will be absorbed in the multiplier.\n const gradient = scaleToGeodeticSurfaceGradient;\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\n\n // Compute the initial guess at the normal vector multiplier, lambda.\n let lambda =\n ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /\n (0.5 * Cartesian3.magnitude(gradient));\n let correction = 0.0;\n\n let func;\n let denominator;\n let xMultiplier;\n let yMultiplier;\n let zMultiplier;\n let xMultiplier2;\n let yMultiplier2;\n let zMultiplier2;\n let xMultiplier3;\n let yMultiplier3;\n let zMultiplier3;\n\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n xMultiplier2 = xMultiplier * xMultiplier;\n yMultiplier2 = yMultiplier * yMultiplier;\n zMultiplier2 = zMultiplier * zMultiplier;\n\n xMultiplier3 = xMultiplier2 * xMultiplier;\n yMultiplier3 = yMultiplier2 * yMultiplier;\n zMultiplier3 = zMultiplier2 * zMultiplier;\n\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\n // computations in the sections to follow.\n denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n const derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (Math.abs(func) > CesiumMath.EPSILON12);\n\n if (!defined(result)) {\n return new Cartesian3(\n positionX * xMultiplier,\n positionY * yMultiplier,\n positionZ * zMultiplier\n );\n }\n result.x = positionX * xMultiplier;\n result.y = positionY * yMultiplier;\n result.z = positionZ * zMultiplier;\n return result;\n}\nexport default scaleToGeodeticSurface;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\n/**\n * A position defined by longitude, latitude, and height.\n * @alias Cartographic\n * @constructor\n *\n * @param {Number} [longitude=0.0] The longitude, in radians.\n * @param {Number} [latitude=0.0] The latitude, in radians.\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\n *\n * @see Ellipsoid\n */\nfunction Cartographic(longitude, latitude, height) {\n /**\n * The longitude, in radians.\n * @type {Number}\n * @default 0.0\n */\n this.longitude = defaultValue(longitude, 0.0);\n\n /**\n * The latitude, in radians.\n * @type {Number}\n * @default 0.0\n */\n this.latitude = defaultValue(latitude, 0.0);\n\n /**\n * The height, in meters, above the ellipsoid.\n * @type {Number}\n * @default 0.0\n */\n this.height = defaultValue(height, 0.0);\n}\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in radians.\n *\n * @param {Number} longitude The longitude, in radians.\n * @param {Number} latitude The latitude, in radians.\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromRadians = function (longitude, latitude, height, result) {\n height = defaultValue(height, 0.0);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartographic instance from longitude and latitude\n * specified in degrees. The values in the resulting object will\n * be in radians.\n *\n * @param {Number} longitude The longitude, in degrees.\n * @param {Number} latitude The latitude, in degrees.\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.fromDegrees = function (longitude, latitude, height, result) {\nlongitude = CesiumMath.toRadians(longitude);\n latitude = CesiumMath.toRadians(latitude);\n\n return Cartographic.fromRadians(longitude, latitude, height, result);\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\nconst wgs84OneOverRadii = new Cartesian3(\n 1.0 / 6378137.0,\n 1.0 / 6378137.0,\n 1.0 / 6356752.3142451793\n);\nconst wgs84OneOverRadiiSquared = new Cartesian3(\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6378137.0 * 6378137.0),\n 1.0 / (6356752.3142451793 * 6356752.3142451793)\n);\nconst wgs84CenterToleranceSquared = CesiumMath.EPSILON1;\n\n/**\n * Creates a new Cartographic instance from a Cartesian position. The values in the\n * resulting object will be in radians.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n */\nCartographic.fromCartesian = function (cartesian, ellipsoid, result) {\n const oneOverRadii = defined(ellipsoid)\n ? ellipsoid.oneOverRadii\n : wgs84OneOverRadii;\n const oneOverRadiiSquared = defined(ellipsoid)\n ? ellipsoid.oneOverRadiiSquared\n : wgs84OneOverRadiiSquared;\n const centerToleranceSquared = defined(ellipsoid)\n ? ellipsoid._centerToleranceSquared\n : wgs84CenterToleranceSquared;\n\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = scaleToGeodeticSurface(\n cartesian,\n oneOverRadii,\n oneOverRadiiSquared,\n centerToleranceSquared,\n cartesianToCartographicP\n );\n\n if (!defined(p)) {\n return undefined;\n }\n\n let n = Cartesian3.multiplyComponents(\n p,\n oneOverRadiiSquared,\n cartesianToCartographicN\n );\n n = Cartesian3.normalize(n, n);\n\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted\n * object should be in radians.\n *\n * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The position\n */\nCartographic.toCartesian = function (cartographic, ellipsoid, result) {\n return Cartesian3.fromRadians(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height,\n ellipsoid,\n result\n );\n};\n\n/**\n * Duplicates a Cartographic instance.\n *\n * @param {Cartographic} cartographic The cartographic to duplicate.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)\n */\nCartographic.clone = function (cartographic, result) {\n if (!defined(cartographic)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Cartographic(\n cartographic.longitude,\n cartographic.latitude,\n cartographic.height\n );\n }\n result.longitude = cartographic.longitude;\n result.latitude = cartographic.latitude;\n result.height = cartographic.height;\n return result;\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartographic.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.longitude === right.longitude &&\n left.latitude === right.latitude &&\n left.height === right.height)\n );\n};\n\n/**\n * Compares the provided cartographics componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Cartographic} [left] The first cartographic.\n * @param {Cartographic} [right] The second cartographic.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartographic.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.longitude - right.longitude) <= epsilon &&\n Math.abs(left.latitude - right.latitude) <= epsilon &&\n Math.abs(left.height - right.height) <= epsilon)\n );\n};\n\n/**\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\n *\n * @type {Cartographic}\n * @constant\n */\nCartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));\n\n/**\n * Duplicates this instance.\n *\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\n */\nCartographic.prototype.clone = function (result) {\n return Cartographic.clone(this, result);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartographic.prototype.equals = function (right) {\n return Cartographic.equals(this, right);\n};\n\n/**\n * Compares the provided against this cartographic componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Cartographic} [right] The second cartographic.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartographic.prototype.equalsEpsilon = function (right, epsilon) {\n return Cartographic.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\n *\n * @returns {String} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\n */\nCartographic.prototype.toString = function () {\n return `(${this.longitude}, ${this.latitude}, ${this.height})`;\n};\nexport default Cartographic;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\n\nfunction initialize(ellipsoid, x, y, z) {\n x = defaultValue(x, 0.0);\n y = defaultValue(y, 0.0);\n z = defaultValue(z, 0.0);\n\n ellipsoid._radii = new Cartesian3(x, y, z);\n\n ellipsoid._radiiSquared = new Cartesian3(x * x, y * y, z * z);\n\n ellipsoid._radiiToTheFourth = new Cartesian3(\n x * x * x * x,\n y * y * y * y,\n z * z * z * z\n );\n\n ellipsoid._oneOverRadii = new Cartesian3(\n x === 0.0 ? 0.0 : 1.0 / x,\n y === 0.0 ? 0.0 : 1.0 / y,\n z === 0.0 ? 0.0 : 1.0 / z\n );\n\n ellipsoid._oneOverRadiiSquared = new Cartesian3(\n x === 0.0 ? 0.0 : 1.0 / (x * x),\n y === 0.0 ? 0.0 : 1.0 / (y * y),\n z === 0.0 ? 0.0 : 1.0 / (z * z)\n );\n\n ellipsoid._minimumRadius = Math.min(x, y, z);\n\n ellipsoid._maximumRadius = Math.max(x, y, z);\n\n ellipsoid._centerToleranceSquared = CesiumMath.EPSILON1;\n\n if (ellipsoid._radiiSquared.z !== 0) {\n ellipsoid._squaredXOverSquaredZ =\n ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;\n }\n}\n\n/**\n * A quadratic surface defined in Cartesian coordinates by the equation\n * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used\n * by Cesium to represent the shape of planetary bodies.\n *\n * Rather than constructing this object directly, one of the provided\n * constants is normally used.\n * @alias Ellipsoid\n * @constructor\n *\n * @param {Number} [x=0] The radius in the x direction.\n * @param {Number} [y=0] The radius in the y direction.\n * @param {Number} [z=0] The radius in the z direction.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.fromCartesian3\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nfunction Ellipsoid(x, y, z) {\n this._radii = undefined;\n this._radiiSquared = undefined;\n this._radiiToTheFourth = undefined;\n this._oneOverRadii = undefined;\n this._oneOverRadiiSquared = undefined;\n this._minimumRadius = undefined;\n this._maximumRadius = undefined;\n this._centerToleranceSquared = undefined;\n this._squaredXOverSquaredZ = undefined;\n\n initialize(this, x, y, z);\n}\n\nObject.defineProperties(Ellipsoid.prototype, {\n /**\n * Gets the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radii: {\n get: function () {\n return this._radii;\n },\n },\n /**\n * Gets the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiSquared: {\n get: function () {\n return this._radiiSquared;\n },\n },\n /**\n * Gets the radii of the ellipsoid raise to the fourth power.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n radiiToTheFourth: {\n get: function () {\n return this._radiiToTheFourth;\n },\n },\n /**\n * Gets one over the radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadii: {\n get: function () {\n return this._oneOverRadii;\n },\n },\n /**\n * Gets one over the squared radii of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Cartesian3}\n * @readonly\n */\n oneOverRadiiSquared: {\n get: function () {\n return this._oneOverRadiiSquared;\n },\n },\n /**\n * Gets the minimum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Number}\n * @readonly\n */\n minimumRadius: {\n get: function () {\n return this._minimumRadius;\n },\n },\n /**\n * Gets the maximum radius of the ellipsoid.\n * @memberof Ellipsoid.prototype\n * @type {Number}\n * @readonly\n */\n maximumRadius: {\n get: function () {\n return this._maximumRadius;\n },\n },\n});\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\n */\nEllipsoid.clone = function (ellipsoid, result) {\n if (!defined(ellipsoid)) {\n return undefined;\n }\n const radii = ellipsoid._radii;\n\n if (!defined(result)) {\n return new Ellipsoid(radii.x, radii.y, radii.z);\n }\n\n Cartesian3.clone(radii, result._radii);\n Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);\n Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\n Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);\n Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\n result._minimumRadius = ellipsoid._minimumRadius;\n result._maximumRadius = ellipsoid._maximumRadius;\n result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\n\n return result;\n};\n\n/**\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\n *\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} A new Ellipsoid instance.\n *\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\n *\n * @see Ellipsoid.WGS84\n * @see Ellipsoid.UNIT_SPHERE\n */\nEllipsoid.fromCartesian3 = function (cartesian, result) {\n if (!defined(result)) {\n result = new Ellipsoid();\n }\n\n if (!defined(cartesian)) {\n return result;\n }\n\n initialize(result, cartesian.x, cartesian.y, cartesian.z);\n return result;\n};\n\n/**\n * An Ellipsoid instance initialized to the WGS84 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.WGS84 = Object.freeze(\n new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)\n);\n\n/**\n * An Ellipsoid instance initialized to the CGCS2000 standard.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.CGCS2000 = Object.freeze(\n new Ellipsoid(6378137.0, 6378137.0, 6356752.31414035585)\n);\n\n\n/**\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));\n\n/**\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\n *\n * @type {Ellipsoid}\n * @constant\n */\nEllipsoid.MOON = Object.freeze(\n new Ellipsoid(\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS,\n CesiumMath.LUNAR_RADIUS\n )\n);\n\n/**\n * Duplicates an Ellipsoid instance.\n *\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\n * instance should be created.\n * @returns {Ellipsoid} The cloned Ellipsoid.\n */\nEllipsoid.prototype.clone = function (result) {\n return Ellipsoid.clone(this, result);\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nEllipsoid.packedLength = Cartesian3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Ellipsoid} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nEllipsoid.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._radii, array, startingIndex);\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Ellipsoid} [result] The object into which to store the result.\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\n */\nEllipsoid.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const radii = Cartesian3.unpack(array, startingIndex);\n return Ellipsoid.fromCartesian3(radii, result);\n};\n\n/**\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.geodeticSurfaceNormalCartographic = function (\n cartographic,\n result\n) {\n const longitude = cartographic.longitude;\n const latitude = cartographic.latitude;\n const cosLatitude = Math.cos(latitude);\n\n const x = cosLatitude * Math.cos(longitude);\n const y = cosLatitude * Math.sin(longitude);\n const z = Math.sin(latitude);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result.x = x;\n result.y = y;\n result.z = z;\n return Cartesian3.normalize(result, result);\n};\n\n/**\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\n *\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\n */\nEllipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {\n if (\n Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)\n ) {\n return undefined;\n }\n if (!defined(result)) {\n result = new Cartesian3();\n }\n result = Cartesian3.multiplyComponents(\n cartesian,\n this._oneOverRadiiSquared,\n result\n );\n return Cartesian3.normalize(result, result);\n};\n\nconst cartographicToCartesianNormal = new Cartesian3();\nconst cartographicToCartesianK = new Cartesian3();\n\n/**\n * Converts the provided cartographic to Cartesian representation.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n *\n * @example\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\n */\nEllipsoid.prototype.cartographicToCartesian = function (cartographic, result) {\n //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\n const n = cartographicToCartesianNormal;\n const k = cartographicToCartesianK;\n this.geodeticSurfaceNormalCartographic(cartographic, n);\n Cartesian3.multiplyComponents(this._radiiSquared, n, k);\n const gamma = Math.sqrt(Cartesian3.dot(n, k));\n Cartesian3.divideByScalar(k, gamma, k);\n Cartesian3.multiplyByScalar(n, cartographic.height, n);\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n return Cartesian3.add(k, n, result);\n};\n\n/**\n * Converts the provided array of cartographics to an array of Cartesians.\n *\n * @param {Cartographic[]} cartographics An array of cartographic positions.\n * @param {Cartesian3[]} [result] The object onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\n */\nEllipsoid.prototype.cartographicArrayToCartesianArray = function (\n cartographics,\n result\n) {\nconst length = cartographics.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; i++) {\n result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\n }\n return result;\n};\n\nconst cartesianToCartographicN = new Cartesian3();\nconst cartesianToCartographicP = new Cartesian3();\nconst cartesianToCartographicH = new Cartesian3();\n\n/**\n * Converts the provided cartesian to cartographic representation.\n * The cartesian is undefined at the center of the ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\n *\n * @example\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\n */\nEllipsoid.prototype.cartesianToCartographic = function (cartesian, result) {\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\n const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);\n\n if (!defined(p)) {\n return undefined;\n }\n\n const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\n\n const longitude = Math.atan2(n.y, n.x);\n const latitude = Math.asin(n.z);\n const height =\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\n\n/**\n * Converts the provided array of cartesians to an array of cartographics.\n *\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\n * @param {Cartographic[]} [result] The object onto which to store the result.\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\n *\n * @example\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\n * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\n * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\n */\nEllipsoid.prototype.cartesianArrayToCartographicArray = function (\n cartesians,\n result\n) {\n const length = cartesians.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n for (let i = 0; i < length; ++i) {\n result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\n }\n return result;\n};\n\n/**\n * Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\n */\nEllipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {\n return scaleToGeodeticSurface(\n cartesian,\n this._oneOverRadii,\n this._oneOverRadiiSquared,\n this._centerToleranceSquared,\n result\n );\n};\n\n/**\n * Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid.\n *\n * @param {Cartesian3} cartesian The Cartesian position to scale.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const positionX = cartesian.x;\n const positionY = cartesian.y;\n const positionZ = cartesian.z;\n const oneOverRadiiSquared = this._oneOverRadiiSquared;\n\n const beta =\n 1.0 /\n Math.sqrt(\n positionX * positionX * oneOverRadiiSquared.x +\n positionY * positionY * oneOverRadiiSquared.y +\n positionZ * positionZ * oneOverRadiiSquared.z\n );\n\n return Cartesian3.multiplyByScalar(cartesian, beta, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionToScaledSpace = function (\n position,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);\n};\n\n/**\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of {@link Ellipsoid#radii}.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\n */\nEllipsoid.prototype.transformPositionFromScaledSpace = function (\n position,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.multiplyComponents(position, this._radii, result);\n};\n\n/**\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Ellipsoid} [right] The other Ellipsoid.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nEllipsoid.prototype.equals = function (right) {\n return (\n this === right ||\n (defined(right) && Cartesian3.equals(this._radii, right._radii))\n );\n};\n\n/**\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n *\n * @returns {String} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\n */\nEllipsoid.prototype.toString = function () {\n return this._radii.toString();\n};\n\n/**\n * Computes a point which is the intersection of the surface normal with the z-axis.\n *\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\n * @param {Number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\n * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.\n * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\n * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\n * return a new instance.\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\n *\n * @exception {DeveloperError} position is required.\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\n */\nEllipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (\n position,\n buffer,\n result\n) {\n buffer = defaultValue(buffer, 0.0);\n\n const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n result.x = 0.0;\n result.y = 0.0;\n result.z = position.z * (1 - squaredXOverSquaredZ);\n\n if (Math.abs(result.z) >= this._radii.z - buffer) {\n return undefined;\n }\n\n return result;\n};\n\nconst abscissas = [\n 0.14887433898163,\n 0.43339539412925,\n 0.67940956829902,\n 0.86506336668898,\n 0.97390652851717,\n 0.0,\n];\nconst weights = [\n 0.29552422471475,\n 0.26926671930999,\n 0.21908636251598,\n 0.14945134915058,\n 0.066671344308684,\n 0.0,\n];\n\n/**\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\n *\n * @param {Number} a The lower bound for the integration.\n * @param {Number} b The upper bound for the integration.\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\n * @returns {Number} The value of the integral of the given function over the given domain.\n *\n * @private\n */\nfunction gaussLegendreQuadrature(a, b, func) {\n // The range is half of the normal range since the five weights add to one (ten weights add to two).\n // The values of the abscissas are multiplied by two to account for this.\n const xMean = 0.5 * (b + a);\n const xRange = 0.5 * (b - a);\n\n let sum = 0.0;\n for (let i = 0; i < 5; i++) {\n const dx = xRange * abscissas[i];\n sum += weights[i] * (func(xMean + dx) + func(xMean - dx));\n }\n\n // Scale the sum to the range of x.\n sum *= xRange;\n return sum;\n}\n\n/**\n * A real valued scalar function.\n * @callback Ellipsoid~RealValuedScalarFunction\n *\n * @param {Number} x The value used to evaluate the function.\n * @returns {Number} The value of the function at x.\n *\n * @private\n */\n\n/**\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\n * Gauss-Legendre 10th order quadrature.\n *\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\n * @returns {Number} The approximate area of the rectangle on the surface of this ellipsoid.\n */\nEllipsoid.prototype.surfaceArea = function (rectangle) {\nconst minLongitude = rectangle.west;\n let maxLongitude = rectangle.east;\n const minLatitude = rectangle.south;\n const maxLatitude = rectangle.north;\n\n while (maxLongitude < minLongitude) {\n maxLongitude += CesiumMath.TWO_PI;\n }\n\n const radiiSquared = this._radiiSquared;\n const a2 = radiiSquared.x;\n const b2 = radiiSquared.y;\n const c2 = radiiSquared.z;\n const a2b2 = a2 * b2;\n return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {\n // phi represents the angle measured from the north pole\n // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\n const sinPhi = Math.cos(lat);\n const cosPhi = Math.sin(lat);\n return (\n Math.cos(lat) *\n gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {\n const cosTheta = Math.cos(lon);\n const sinTheta = Math.sin(lon);\n return Math.sqrt(\n a2b2 * cosPhi * cosPhi +\n c2 *\n (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *\n sinPhi *\n sinPhi\n );\n })\n );\n });\n};\n\nexport default Ellipsoid;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\n\n/**\n * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying\n * them by the {@link Ellipsoid#maximumRadius}. This projection\n * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carr\u00E9e. It\n * is also known as EPSG:4326.\n *\n * @alias GeographicProjection\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n *\n * @see WebMercatorProjection\n */\nfunction GeographicProjection(ellipsoid) {\n this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n this._semimajorAxis = this._ellipsoid.maximumRadius;\n this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\n}\n\nObject.defineProperties(GeographicProjection.prototype, {\n /**\n * Gets the {@link Ellipsoid}.\n *\n * @memberof GeographicProjection.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n});\n\n/**\n * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.\n * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the\n * ellipsoid. Z is the unmodified height.\n *\n * @param {Cartographic} cartographic The coordinates to project.\n * @param {Cartesian3} [result] An instance into which to copy the result. If this parameter is\n * undefined, a new instance is created and returned.\n * @returns {Cartesian3} The projected coordinates. If the result parameter is not undefined, the\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\n * created and returned.\n */\nGeographicProjection.prototype.project = function (cartographic, result) {\n // Actually this is the special case of equidistant cylindrical called the plate carree\n const semimajorAxis = this._semimajorAxis;\n const x = cartographic.longitude * semimajorAxis;\n const y = cartographic.latitude * semimajorAxis;\n const z = cartographic.height;\n\n if (!defined(result)) {\n return new Cartesian3(x, y, z);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}\n * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,\n * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.\n *\n * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.\n * @param {Cartographic} [result] An instance into which to copy the result. If this parameter is\n * undefined, a new instance is created and returned.\n * @returns {Cartographic} The unprojected coordinates. If the result parameter is not undefined, the\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\n * created and returned.\n */\nGeographicProjection.prototype.unproject = function (cartesian, result) {\n const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\n const longitude = cartesian.x * oneOverEarthSemimajorAxis;\n const latitude = cartesian.y * oneOverEarthSemimajorAxis;\n const height = cartesian.z;\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\nexport default GeographicProjection;\n", "/**\n * This enumerated type is used in determining where, relative to the frustum, an\n * object is located. The object can either be fully contained within the frustum (INSIDE),\n * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely\n * outside of the frustum's 6 planes (OUTSIDE).\n *\n * @enum {Number}\n */\nconst Intersect = {\n /**\n * Represents that an object is not contained within the frustum.\n *\n * @type {Number}\n * @constant\n */\n OUTSIDE: -1,\n\n /**\n * Represents that an object intersects one of the frustum's planes.\n *\n * @type {Number}\n * @constant\n */\n INTERSECTING: 0,\n\n /**\n * Represents that an object is fully within the frustum.\n *\n * @type {Number}\n * @constant\n */\n INSIDE: 1,\n};\nexport default Object.freeze(Intersect);\n", "import Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A two dimensional region specified as longitude and latitude coordinates.\n *\n * @alias Rectangle\n * @constructor\n *\n * @param {Number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi].\n * @param {Number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].\n * @param {Number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi].\n * @param {Number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].\n *\n * @see Packable\n */\nfunction Rectangle(west, south, east, north) {\n /**\n * The westernmost longitude in radians in the range [-Pi, Pi].\n *\n * @type {Number}\n * @default 0.0\n */\n this.west = defaultValue(west, 0.0);\n\n /**\n * The southernmost latitude in radians in the range [-Pi/2, Pi/2].\n *\n * @type {Number}\n * @default 0.0\n */\n this.south = defaultValue(south, 0.0);\n\n /**\n * The easternmost longitude in radians in the range [-Pi, Pi].\n *\n * @type {Number}\n * @default 0.0\n */\n this.east = defaultValue(east, 0.0);\n\n /**\n * The northernmost latitude in radians in the range [-Pi/2, Pi/2].\n *\n * @type {Number}\n * @default 0.0\n */\n this.north = defaultValue(north, 0.0);\n}\n\nObject.defineProperties(Rectangle.prototype, {\n /**\n * Gets the width of the rectangle in radians.\n * @memberof Rectangle.prototype\n * @type {Number}\n * @readonly\n */\n width: {\n get: function () {\n return Rectangle.computeWidth(this);\n },\n },\n\n /**\n * Gets the height of the rectangle in radians.\n * @memberof Rectangle.prototype\n * @type {Number}\n * @readonly\n */\n height: {\n get: function () {\n return Rectangle.computeHeight(this);\n },\n },\n});\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nRectangle.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Rectangle} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nRectangle.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.west;\n array[startingIndex++] = value.south;\n array[startingIndex++] = value.east;\n array[startingIndex] = value.north;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Rectangle} [result] The object into which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\n */\nRectangle.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Rectangle();\n }\n\n result.west = array[startingIndex++];\n result.south = array[startingIndex++];\n result.east = array[startingIndex++];\n result.north = array[startingIndex];\n return result;\n};\n\n/**\n * Computes the width of a rectangle in radians.\n * @param {Rectangle} rectangle The rectangle to compute the width of.\n * @returns {Number} The width.\n */\nRectangle.computeWidth = function (rectangle) {\nlet east = rectangle.east;\n const west = rectangle.west;\n if (east < west) {\n east += CesiumMath.TWO_PI;\n }\n return east - west;\n};\n\n/**\n * Computes the height of a rectangle in radians.\n * @param {Rectangle} rectangle The rectangle to compute the height of.\n * @returns {Number} The height.\n */\nRectangle.computeHeight = function (rectangle) {\nreturn rectangle.north - rectangle.south;\n};\n\n/**\n * Creates a rectangle given the boundary longitude and latitude in degrees.\n *\n * @param {Number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0].\n * @param {Number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0].\n * @param {Number} [east=0.0] The easternmost longitude in degrees in the range [-180.0, 180.0].\n * @param {Number} [north=0.0] The northernmost latitude in degrees in the range [-90.0, 90.0].\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n *\n * @example\n * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);\n */\nRectangle.fromDegrees = function (west, south, east, north, result) {\n west = CesiumMath.toRadians(defaultValue(west, 0.0));\n south = CesiumMath.toRadians(defaultValue(south, 0.0));\n east = CesiumMath.toRadians(defaultValue(east, 0.0));\n north = CesiumMath.toRadians(defaultValue(north, 0.0));\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n\n return result;\n};\n\n/**\n * Creates a rectangle given the boundary longitude and latitude in radians.\n *\n * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI].\n * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\n * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI].\n * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n *\n * @example\n * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);\n */\nRectangle.fromRadians = function (west, south, east, north, result) {\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = defaultValue(west, 0.0);\n result.south = defaultValue(south, 0.0);\n result.east = defaultValue(east, 0.0);\n result.north = defaultValue(north, 0.0);\n\n return result;\n};\n\n/**\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\n *\n * @param {Cartographic[]} cartographics The list of Cartographic instances.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.fromCartographicArray = function (cartographics, result) {\n let west = Number.MAX_VALUE;\n let east = -Number.MAX_VALUE;\n let westOverIDL = Number.MAX_VALUE;\n let eastOverIDL = -Number.MAX_VALUE;\n let south = Number.MAX_VALUE;\n let north = -Number.MAX_VALUE;\n\n for (let i = 0, len = cartographics.length; i < len; i++) {\n const position = cartographics[i];\n west = Math.min(west, position.longitude);\n east = Math.max(east, position.longitude);\n south = Math.min(south, position.latitude);\n north = Math.max(north, position.latitude);\n\n const lonAdjusted =\n position.longitude >= 0\n ? position.longitude\n : position.longitude + CesiumMath.TWO_PI;\n westOverIDL = Math.min(westOverIDL, lonAdjusted);\n eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\n }\n\n if (east - west > eastOverIDL - westOverIDL) {\n west = westOverIDL;\n east = eastOverIDL;\n\n if (east > CesiumMath.PI) {\n east = east - CesiumMath.TWO_PI;\n }\n if (west > CesiumMath.PI) {\n west = west - CesiumMath.TWO_PI;\n }\n }\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\n *\n * @param {Cartesian3[]} cartesians The list of Cartesian instances.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid the cartesians are on.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.fromCartesianArray = function (cartesians, ellipsoid, result) {\nellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n let west = Number.MAX_VALUE;\n let east = -Number.MAX_VALUE;\n let westOverIDL = Number.MAX_VALUE;\n let eastOverIDL = -Number.MAX_VALUE;\n let south = Number.MAX_VALUE;\n let north = -Number.MAX_VALUE;\n\n for (let i = 0, len = cartesians.length; i < len; i++) {\n const position = ellipsoid.cartesianToCartographic(cartesians[i]);\n west = Math.min(west, position.longitude);\n east = Math.max(east, position.longitude);\n south = Math.min(south, position.latitude);\n north = Math.max(north, position.latitude);\n\n const lonAdjusted =\n position.longitude >= 0\n ? position.longitude\n : position.longitude + CesiumMath.TWO_PI;\n westOverIDL = Math.min(westOverIDL, lonAdjusted);\n eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\n }\n\n if (east - west > eastOverIDL - westOverIDL) {\n west = westOverIDL;\n east = eastOverIDL;\n\n if (east > CesiumMath.PI) {\n east = east - CesiumMath.TWO_PI;\n }\n if (west > CesiumMath.PI) {\n west = west - CesiumMath.TWO_PI;\n }\n }\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Duplicates a Rectangle.\n *\n * @param {Rectangle} rectangle The rectangle to clone.\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)\n */\nRectangle.clone = function (rectangle, result) {\n if (!defined(rectangle)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Rectangle(\n rectangle.west,\n rectangle.south,\n rectangle.east,\n rectangle.north\n );\n }\n\n result.west = rectangle.west;\n result.south = rectangle.south;\n result.east = rectangle.east;\n result.north = rectangle.north;\n return result;\n};\n\n/**\n * Compares the provided Rectangles componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [left] The first Rectangle.\n * @param {Rectangle} [right] The second Rectangle.\n * @param {Number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nRectangle.equalsEpsilon = function (left, right, absoluteEpsilon) {\n absoluteEpsilon = defaultValue(absoluteEpsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.west - right.west) <= absoluteEpsilon &&\n Math.abs(left.south - right.south) <= absoluteEpsilon &&\n Math.abs(left.east - right.east) <= absoluteEpsilon &&\n Math.abs(left.north - right.north) <= absoluteEpsilon)\n );\n};\n\n/**\n * Duplicates this Rectangle.\n *\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.prototype.clone = function (result) {\n return Rectangle.clone(this, result);\n};\n\n/**\n * Compares the provided Rectangle with this Rectangle componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Rectangle} [other] The Rectangle to compare.\n * @returns {Boolean} <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.\n */\nRectangle.prototype.equals = function (other) {\n return Rectangle.equals(this, other);\n};\n\n/**\n * Compares the provided rectangles and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [left] The first Rectangle.\n * @param {Rectangle} [right] The second Rectangle.\n * @returns {Boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nRectangle.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.west === right.west &&\n left.south === right.south &&\n left.east === right.east &&\n left.north === right.north)\n );\n};\n\n/**\n * Compares the provided Rectangle with this Rectangle componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Rectangle} [other] The Rectangle to compare.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.\n */\nRectangle.prototype.equalsEpsilon = function (other, epsilon) {\n return Rectangle.equalsEpsilon(this, other, epsilon);\n};\n\n/**\n * Checks a Rectangle's properties and throws if they are not in valid ranges.\n *\n * @param {Rectangle} rectangle The rectangle to validate\n *\n * @exception {DeveloperError} <code>north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n */\nRectangle.validate = function (rectangle) {\n};\n\n/**\n * Computes the southwest corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.southwest = function (rectangle, result) {\n if (!defined(result)) {\n return new Cartographic(rectangle.west, rectangle.south);\n }\n result.longitude = rectangle.west;\n result.latitude = rectangle.south;\n result.height = 0.0;\n return result;\n};\n\n/**\n * Computes the northwest corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.northwest = function (rectangle, result) {\n if (!defined(result)) {\n return new Cartographic(rectangle.west, rectangle.north);\n }\n result.longitude = rectangle.west;\n result.latitude = rectangle.north;\n result.height = 0.0;\n return result;\n};\n\n/**\n * Computes the northeast corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.northeast = function (rectangle, result) {\n if (!defined(result)) {\n return new Cartographic(rectangle.east, rectangle.north);\n }\n result.longitude = rectangle.east;\n result.latitude = rectangle.north;\n result.height = 0.0;\n return result;\n};\n\n/**\n * Computes the southeast corner of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the corner\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.southeast = function (rectangle, result) {\n if (!defined(result)) {\n return new Cartographic(rectangle.east, rectangle.south);\n }\n result.longitude = rectangle.east;\n result.latitude = rectangle.south;\n result.height = 0.0;\n return result;\n};\n\n/**\n * Computes the center of a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle for which to find the center\n * @param {Cartographic} [result] The object onto which to store the result.\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\n */\nRectangle.center = function (rectangle, result) {\n let east = rectangle.east;\n const west = rectangle.west;\n\n if (east < west) {\n east += CesiumMath.TWO_PI;\n }\n\n const longitude = CesiumMath.negativePiToPi((west + east) * 0.5);\n const latitude = (rectangle.south + rectangle.north) * 0.5;\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = 0.0;\n return result;\n};\n\n/**\n * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are\n * latitude and longitude in radians and produces a correct intersection, taking into account the fact that\n * the same angle can be represented with multiple values as well as the wrapping of longitude at the\n * anti-meridian. For a simple intersection that ignores these factors and can be used with projected\n * coordinates, see {@link Rectangle.simpleIntersection}.\n *\n * @param {Rectangle} rectangle On rectangle to find an intersection\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\n */\nRectangle.intersection = function (rectangle, otherRectangle, result) {\n let rectangleEast = rectangle.east;\n let rectangleWest = rectangle.west;\n\n let otherRectangleEast = otherRectangle.east;\n let otherRectangleWest = otherRectangle.west;\n\n if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\n rectangleEast += CesiumMath.TWO_PI;\n } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\n otherRectangleEast += CesiumMath.TWO_PI;\n }\n\n if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\n otherRectangleWest += CesiumMath.TWO_PI;\n } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\n rectangleWest += CesiumMath.TWO_PI;\n }\n\n const west = CesiumMath.negativePiToPi(\n Math.max(rectangleWest, otherRectangleWest)\n );\n const east = CesiumMath.negativePiToPi(\n Math.min(rectangleEast, otherRectangleEast)\n );\n\n if (\n (rectangle.west < rectangle.east ||\n otherRectangle.west < otherRectangle.east) &&\n east <= west\n ) {\n return undefined;\n }\n\n const south = Math.max(rectangle.south, otherRectangle.south);\n const north = Math.min(rectangle.north, otherRectangle.north);\n\n if (south >= north) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function\n * does not attempt to put the angular coordinates into a consistent range or to account for crossing the\n * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude\n * and longitude (i.e. projected coordinates).\n *\n * @param {Rectangle} rectangle On rectangle to find an intersection\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\n */\nRectangle.simpleIntersection = function (rectangle, otherRectangle, result) {\n const west = Math.max(rectangle.west, otherRectangle.west);\n const south = Math.max(rectangle.south, otherRectangle.south);\n const east = Math.min(rectangle.east, otherRectangle.east);\n const north = Math.min(rectangle.north, otherRectangle.north);\n\n if (south >= north || west >= east) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Computes a rectangle that is the union of two rectangles.\n *\n * @param {Rectangle} rectangle A rectangle to enclose in rectangle.\n * @param {Rectangle} otherRectangle A rectangle to enclose in a rectangle.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.union = function (rectangle, otherRectangle, result) {\n if (!defined(result)) {\n result = new Rectangle();\n }\n\n let rectangleEast = rectangle.east;\n let rectangleWest = rectangle.west;\n\n let otherRectangleEast = otherRectangle.east;\n let otherRectangleWest = otherRectangle.west;\n\n if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\n rectangleEast += CesiumMath.TWO_PI;\n } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\n otherRectangleEast += CesiumMath.TWO_PI;\n }\n\n if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\n otherRectangleWest += CesiumMath.TWO_PI;\n } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\n rectangleWest += CesiumMath.TWO_PI;\n }\n\n const west = CesiumMath.negativePiToPi(\n Math.min(rectangleWest, otherRectangleWest)\n );\n const east = CesiumMath.negativePiToPi(\n Math.max(rectangleEast, otherRectangleEast)\n );\n\n result.west = west;\n result.south = Math.min(rectangle.south, otherRectangle.south);\n result.east = east;\n result.north = Math.max(rectangle.north, otherRectangle.north);\n\n return result;\n};\n\n/**\n * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.\n *\n * @param {Rectangle} rectangle A rectangle to expand.\n * @param {Cartographic} cartographic A cartographic to enclose in a rectangle.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\n */\nRectangle.expand = function (rectangle, cartographic, result) {\n if (!defined(result)) {\n result = new Rectangle();\n }\n\n result.west = Math.min(rectangle.west, cartographic.longitude);\n result.south = Math.min(rectangle.south, cartographic.latitude);\n result.east = Math.max(rectangle.east, cartographic.longitude);\n result.north = Math.max(rectangle.north, cartographic.latitude);\n\n return result;\n};\n\n/**\n * Returns true if the cartographic is on or inside the rectangle, false otherwise.\n *\n * @param {Rectangle} rectangle The rectangle\n * @param {Cartographic} cartographic The cartographic to test.\n * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise.\n */\nRectangle.contains = function (rectangle, cartographic) {\n let longitude = cartographic.longitude;\n const latitude = cartographic.latitude;\n\n const west = rectangle.west;\n let east = rectangle.east;\n\n if (east < west) {\n east += CesiumMath.TWO_PI;\n if (longitude < 0.0) {\n longitude += CesiumMath.TWO_PI;\n }\n }\n return (\n (longitude > west ||\n CesiumMath.equalsEpsilon(longitude, west, CesiumMath.EPSILON14)) &&\n (longitude < east ||\n CesiumMath.equalsEpsilon(longitude, east, CesiumMath.EPSILON14)) &&\n latitude >= rectangle.south &&\n latitude <= rectangle.north\n );\n};\n\nconst subsampleLlaScratch = new Cartographic();\n/**\n * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to\n * {@link BoundingSphere#fromPoints}. Sampling is necessary to account\n * for rectangles that cover the poles or cross the equator.\n *\n * @param {Rectangle} rectangle The rectangle to subsample.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n * @param {Number} [surfaceHeight=0.0] The height of the rectangle above the ellipsoid.\n * @param {Cartesian3[]} [result] The array of Cartesians onto which to store the result.\n * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided.\n */\nRectangle.subsample = function (rectangle, ellipsoid, surfaceHeight, result) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n surfaceHeight = defaultValue(surfaceHeight, 0.0);\n\n if (!defined(result)) {\n result = [];\n }\n let length = 0;\n\n const north = rectangle.north;\n const south = rectangle.south;\n const east = rectangle.east;\n const west = rectangle.west;\n\n const lla = subsampleLlaScratch;\n lla.height = surfaceHeight;\n\n lla.longitude = west;\n lla.latitude = north;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n\n lla.longitude = east;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n\n lla.latitude = south;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n\n lla.longitude = west;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n\n if (north < 0.0) {\n lla.latitude = north;\n } else if (south > 0.0) {\n lla.latitude = south;\n } else {\n lla.latitude = 0.0;\n }\n\n for (let i = 1; i < 8; ++i) {\n lla.longitude = -Math.PI + i * CesiumMath.PI_OVER_TWO;\n if (Rectangle.contains(rectangle, lla)) {\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n }\n }\n\n if (lla.latitude === 0.0) {\n lla.longitude = west;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n lla.longitude = east;\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\n length++;\n }\n result.length = length;\n return result;\n};\n\n/**\n * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].\n *\n * @param {Rectangle} rectangle The rectangle to subsection.\n * @param {Number} westLerp The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.\n * @param {Number} southLerp The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.\n * @param {Number} eastLerp The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.\n * @param {Number} northLerp The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.\n * @param {Rectangle} [result] The object onto which to store the result.\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\n */\nRectangle.subsection = function (\n rectangle,\n westLerp,\n southLerp,\n eastLerp,\n northLerp,\n result\n) {\n if (!defined(result)) {\n result = new Rectangle();\n }\n\n // This function doesn't use CesiumMath.lerp because it has floating point precision problems\n // when the start and end values are the same but the t changes.\n\n if (rectangle.west <= rectangle.east) {\n const width = rectangle.east - rectangle.west;\n result.west = rectangle.west + westLerp * width;\n result.east = rectangle.west + eastLerp * width;\n } else {\n const width = CesiumMath.TWO_PI + rectangle.east - rectangle.west;\n result.west = CesiumMath.negativePiToPi(rectangle.west + westLerp * width);\n result.east = CesiumMath.negativePiToPi(rectangle.west + eastLerp * width);\n }\n const height = rectangle.north - rectangle.south;\n result.south = rectangle.south + southLerp * height;\n result.north = rectangle.south + northLerp * height;\n\n // Fix floating point precision problems when t = 1\n if (westLerp === 1.0) {\n result.west = rectangle.east;\n }\n if (eastLerp === 1.0) {\n result.east = rectangle.east;\n }\n if (southLerp === 1.0) {\n result.south = rectangle.north;\n }\n if (northLerp === 1.0) {\n result.north = rectangle.north;\n }\n\n return result;\n};\n\n/**\n * The largest possible rectangle.\n *\n * @type {Rectangle}\n * @constant\n */\nRectangle.MAX_VALUE = Object.freeze(\n new Rectangle(\n -Math.PI,\n -CesiumMath.PI_OVER_TWO,\n Math.PI,\n CesiumMath.PI_OVER_TWO\n )\n);\nexport default Rectangle;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Intersect from \"./Intersect.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A bounding rectangle given by a corner, width and height.\n * @alias BoundingRectangle\n * @constructor\n *\n * @param {Number} [x=0.0] The x coordinate of the rectangle.\n * @param {Number} [y=0.0] The y coordinate of the rectangle.\n * @param {Number} [width=0.0] The width of the rectangle.\n * @param {Number} [height=0.0] The height of the rectangle.\n *\n * @see BoundingSphere\n * @see Packable\n */\nfunction BoundingRectangle(x, y, width, height) {\n /**\n * The x coordinate of the rectangle.\n * @type {Number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The y coordinate of the rectangle.\n * @type {Number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The width of the rectangle.\n * @type {Number}\n * @default 0.0\n */\n this.width = defaultValue(width, 0.0);\n\n /**\n * The height of the rectangle.\n * @type {Number}\n * @default 0.0\n */\n this.height = defaultValue(height, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nBoundingRectangle.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoundingRectangle} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nBoundingRectangle.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.width;\n array[startingIndex] = value.height;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoundingRectangle} [result] The object into which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.width = array[startingIndex++];\n result.height = array[startingIndex];\n return result;\n};\n\n/**\n * Computes a bounding rectangle enclosing the list of 2D points.\n * The rectangle is oriented with the corner at the bottom left.\n *\n * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.fromPoints = function (positions, result) {\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n if (!defined(positions) || positions.length === 0) {\n result.x = 0;\n result.y = 0;\n result.width = 0;\n result.height = 0;\n return result;\n }\n\n const length = positions.length;\n\n let minimumX = positions[0].x;\n let minimumY = positions[0].y;\n\n let maximumX = positions[0].x;\n let maximumY = positions[0].y;\n\n for (let i = 1; i < length; i++) {\n const p = positions[i];\n const x = p.x;\n const y = p.y;\n\n minimumX = Math.min(x, minimumX);\n maximumX = Math.max(x, maximumX);\n minimumY = Math.min(y, minimumY);\n maximumY = Math.max(y, maximumY);\n }\n\n result.x = minimumX;\n result.y = minimumY;\n result.width = maximumX - minimumX;\n result.height = maximumY - minimumY;\n return result;\n};\n\nconst defaultProjection = new GeographicProjection();\nconst fromRectangleLowerLeft = new Cartographic();\nconst fromRectangleUpperRight = new Cartographic();\n/**\n * Computes a bounding rectangle from a rectangle.\n *\n * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.fromRectangle = function (rectangle, projection, result) {\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n if (!defined(rectangle)) {\n result.x = 0;\n result.y = 0;\n result.width = 0;\n result.height = 0;\n return result;\n }\n\n projection = defaultValue(projection, defaultProjection);\n\n const lowerLeft = projection.project(\n Rectangle.southwest(rectangle, fromRectangleLowerLeft)\n );\n const upperRight = projection.project(\n Rectangle.northeast(rectangle, fromRectangleUpperRight)\n );\n\n Cartesian2.subtract(upperRight, lowerLeft, upperRight);\n\n result.x = lowerLeft.x;\n result.y = lowerLeft.y;\n result.width = upperRight.x;\n result.height = upperRight.y;\n return result;\n};\n\n/**\n * Duplicates a BoundingRectangle instance.\n *\n * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)\n */\nBoundingRectangle.clone = function (rectangle, result) {\n if (!defined(rectangle)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new BoundingRectangle(\n rectangle.x,\n rectangle.y,\n rectangle.width,\n rectangle.height\n );\n }\n\n result.x = rectangle.x;\n result.y = rectangle.y;\n result.width = rectangle.width;\n result.height = rectangle.height;\n return result;\n};\n\n/**\n * Computes a bounding rectangle that is the union of the left and right bounding rectangles.\n *\n * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.\n * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.union = function (left, right, result) {\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n const lowerLeftX = Math.min(left.x, right.x);\n const lowerLeftY = Math.min(left.y, right.y);\n const upperRightX = Math.max(left.x + left.width, right.x + right.width);\n const upperRightY = Math.max(left.y + left.height, right.y + right.height);\n\n result.x = lowerLeftX;\n result.y = lowerLeftY;\n result.width = upperRightX - lowerLeftX;\n result.height = upperRightY - lowerLeftY;\n return result;\n};\n\n/**\n * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.\n *\n * @param {BoundingRectangle} rectangle A rectangle to expand.\n * @param {Cartesian2} point A point to enclose in a bounding rectangle.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.expand = function (rectangle, point, result) {\n result = BoundingRectangle.clone(rectangle, result);\n\n const width = point.x - result.x;\n const height = point.y - result.y;\n\n if (width > result.width) {\n result.width = width;\n } else if (width < 0) {\n result.width -= width;\n result.x = point.x;\n }\n\n if (height > result.height) {\n result.height = height;\n } else if (height < 0) {\n result.height -= height;\n result.y = point.y;\n }\n\n return result;\n};\n\n/**\n * Determines if two rectangles intersect.\n *\n * @param {BoundingRectangle} left A rectangle to check for intersection.\n * @param {BoundingRectangle} right The other rectangle to check for intersection.\n * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.\n */\nBoundingRectangle.intersect = function (left, right) {\n const leftX = left.x;\n const leftY = left.y;\n const rightX = right.x;\n const rightY = right.y;\n if (\n !(\n leftX > rightX + right.width ||\n leftX + left.width < rightX ||\n leftY + left.height < rightY ||\n leftY > rightY + right.height\n )\n ) {\n return Intersect.INTERSECTING;\n }\n\n return Intersect.OUTSIDE;\n};\n\n/**\n * Compares the provided BoundingRectangles componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingRectangle} [left] The first BoundingRectangle.\n * @param {BoundingRectangle} [right] The second BoundingRectangle.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nBoundingRectangle.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.width === right.width &&\n left.height === right.height)\n );\n};\n\n/**\n * Duplicates this BoundingRectangle instance.\n *\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\n */\nBoundingRectangle.prototype.clone = function (result) {\n return BoundingRectangle.clone(this, result);\n};\n\n/**\n * Determines if this rectangle intersects with another.\n *\n * @param {BoundingRectangle} right A rectangle to check for intersection.\n * @returns {Intersect} <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.\n */\nBoundingRectangle.prototype.intersect = function (right) {\n return BoundingRectangle.intersect(this, right);\n};\n\n/**\n * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nBoundingRectangle.prototype.equals = function (right) {\n return BoundingRectangle.equals(this, right);\n};\nexport default BoundingRectangle;\n", "import defined from \"./defined.js\";\n\nlet _supportsFullscreen;\nconst _names = {\n requestFullscreen: undefined,\n exitFullscreen: undefined,\n fullscreenEnabled: undefined,\n fullscreenElement: undefined,\n fullscreenchange: undefined,\n fullscreenerror: undefined,\n};\n\n/**\n * Browser-independent functions for working with the standard fullscreen API.\n *\n * @namespace Fullscreen\n *\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nconst Fullscreen = {};\n\nObject.defineProperties(Fullscreen, {\n /**\n * The element that is currently fullscreen, if any. To simply check if the\n * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {Object}\n * @readonly\n */\n element: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenElement];\n },\n },\n\n /**\n * The name of the event on the document that is fired when fullscreen is\n * entered or exited. This event name is intended for use with addEventListener.\n * In your event handler, to determine if the browser is in fullscreen mode or not,\n * use {@link Fullscreen#fullscreen}.\n * @memberof Fullscreen\n * @type {String}\n * @readonly\n */\n changeEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenchange;\n },\n },\n\n /**\n * The name of the event that is fired when a fullscreen error\n * occurs. This event name is intended for use with addEventListener.\n * @memberof Fullscreen\n * @type {String}\n * @readonly\n */\n errorEventName: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return _names.fullscreenerror;\n },\n },\n\n /**\n * Determine whether the browser will allow an element to be made fullscreen, or not.\n * For example, by default, iframes cannot go fullscreen unless the containing page\n * adds an \"allowfullscreen\" attribute (or prefixed equivalent).\n * @memberof Fullscreen\n * @type {Boolean}\n * @readonly\n */\n enabled: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return document[_names.fullscreenEnabled];\n },\n },\n\n /**\n * Determines if the browser is currently in fullscreen mode.\n * @memberof Fullscreen\n * @type {Boolean}\n * @readonly\n */\n fullscreen: {\n get: function () {\n if (!Fullscreen.supportsFullscreen()) {\n return undefined;\n }\n\n return Fullscreen.element !== null;\n },\n },\n});\n\n/**\n * Detects whether the browser supports the standard fullscreen API.\n *\n * @returns {Boolean} <code>true</code> if the browser supports the standard fullscreen API,\n * <code>false</code> otherwise.\n */\nFullscreen.supportsFullscreen = function () {\n if (defined(_supportsFullscreen)) {\n return _supportsFullscreen;\n }\n\n _supportsFullscreen = false;\n\n const body = document.body;\n if (typeof body.requestFullscreen === \"function\") {\n // go with the unprefixed, standard set of names\n _names.requestFullscreen = \"requestFullscreen\";\n _names.exitFullscreen = \"exitFullscreen\";\n _names.fullscreenEnabled = \"fullscreenEnabled\";\n _names.fullscreenElement = \"fullscreenElement\";\n _names.fullscreenchange = \"fullscreenchange\";\n _names.fullscreenerror = \"fullscreenerror\";\n _supportsFullscreen = true;\n return _supportsFullscreen;\n }\n\n //check for the correct combination of prefix plus the various names that browsers use\n const prefixes = [\"webkit\", \"moz\", \"o\", \"ms\", \"khtml\"];\n let name;\n for (let i = 0, len = prefixes.length; i < len; ++i) {\n const prefix = prefixes[i];\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}RequestFullscreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n } else {\n name = `${prefix}RequestFullScreen`;\n if (typeof body[name] === \"function\") {\n _names.requestFullscreen = name;\n _supportsFullscreen = true;\n }\n }\n\n // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\n name = `${prefix}ExitFullscreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n } else {\n name = `${prefix}CancelFullScreen`;\n if (typeof document[name] === \"function\") {\n _names.exitFullscreen = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n } else {\n name = `${prefix}FullScreenEnabled`;\n if (document[name] !== undefined) {\n _names.fullscreenEnabled = name;\n }\n }\n\n // casing of Fullscreen differs across browsers\n name = `${prefix}FullscreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n } else {\n name = `${prefix}FullScreenElement`;\n if (document[name] !== undefined) {\n _names.fullscreenElement = name;\n }\n }\n\n // thankfully, event names are all lowercase per spec\n name = `${prefix}fullscreenchange`;\n // event names do not have 'on' in the front, but the property on the document does\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenChange\";\n }\n _names.fullscreenchange = name;\n }\n\n name = `${prefix}fullscreenerror`;\n if (document[`on${name}`] !== undefined) {\n //except on IE\n if (prefix === \"ms\") {\n name = \"MSFullscreenError\";\n }\n _names.fullscreenerror = name;\n }\n }\n\n return _supportsFullscreen;\n};\n\n/**\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\n * If fullscreen mode is not supported by the browser, does nothing.\n *\n * @param {Object} element The HTML element which will be placed into fullscreen mode.\n * @param {Object} [vrDevice] The HMDVRDevice device.\n *\n * @example\n * // Put the entire page into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(document.body)\n *\n * // Place only the Cesium canvas into fullscreen.\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\n */\nFullscreen.requestFullscreen = function (element, vrDevice) {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n element[_names.requestFullscreen]({ vrDisplay: vrDevice });\n};\n\n/**\n * Asynchronously exits fullscreen mode. If the browser is not currently\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\n */\nFullscreen.exitFullscreen = function () {\n if (!Fullscreen.supportsFullscreen()) {\n return;\n }\n\n document[_names.exitFullscreen]();\n};\n\n//For unit tests\nFullscreen._names = _names;\nexport default Fullscreen;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Fullscreen from \"./Fullscreen.js\";\n\nlet theNavigator;\nif (typeof navigator !== \"undefined\") {\n theNavigator = navigator;\n} else {\n theNavigator = {};\n}\n\nfunction extractVersion(versionString) {\n const parts = versionString.split(\".\");\n for (let i = 0, len = parts.length; i < len; ++i) {\n parts[i] = parseInt(parts[i], 10);\n }\n return parts;\n}\n\nlet isChromeResult;\nlet chromeVersionResult;\nfunction isChrome() {\n if (!defined(isChromeResult)) {\n isChromeResult = false;\n // Edge contains Chrome in the user agent too\n if (!isEdge()) {\n const fields = / Chrome\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isChromeResult = true;\n chromeVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isChromeResult;\n}\n\nfunction chromeVersion() {\n return isChrome() && chromeVersionResult;\n}\n\nlet isSafariResult;\nlet safariVersionResult;\nfunction isSafari() {\n if (!defined(isSafariResult)) {\n isSafariResult = false;\n\n // Chrome and Edge contain Safari in the user agent too\n if (\n !isChrome() &&\n !isEdge() &&\n / Safari\\/[\\.0-9]+/.test(theNavigator.userAgent)\n ) {\n const fields = / Version\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isSafariResult = true;\n safariVersionResult = extractVersion(fields[1]);\n }\n }\n }\n\n return isSafariResult;\n}\n\nfunction safariVersion() {\n return isSafari() && safariVersionResult;\n}\n\nlet isWebkitResult;\nlet webkitVersionResult;\nfunction isWebkit() {\n if (!defined(isWebkitResult)) {\n isWebkitResult = false;\n\n const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isWebkitResult = true;\n webkitVersionResult = extractVersion(fields[1]);\n webkitVersionResult.isNightly = !!fields[2];\n }\n }\n\n return isWebkitResult;\n}\n\nfunction webkitVersion() {\n return isWebkit() && webkitVersionResult;\n}\n\nlet isInternetExplorerResult;\nlet internetExplorerVersionResult;\nfunction isInternetExplorer() {\n if (!defined(isInternetExplorerResult)) {\n isInternetExplorerResult = false;\n\n let fields;\n if (theNavigator.appName === \"Microsoft Internet Explorer\") {\n fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n } else if (theNavigator.appName === \"Netscape\") {\n fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec(\n theNavigator.userAgent\n );\n if (fields !== null) {\n isInternetExplorerResult = true;\n internetExplorerVersionResult = extractVersion(fields[1]);\n }\n }\n }\n return isInternetExplorerResult;\n}\n\nfunction internetExplorerVersion() {\n return isInternetExplorer() && internetExplorerVersionResult;\n}\n\nlet isEdgeResult;\nlet edgeVersionResult;\nfunction isEdge() {\n if (!defined(isEdgeResult)) {\n isEdgeResult = false;\n const fields = / Edg\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isEdgeResult = true;\n edgeVersionResult = extractVersion(fields[1]);\n }\n }\n return isEdgeResult;\n}\n\nfunction edgeVersion() {\n return isEdge() && edgeVersionResult;\n}\n\nlet isFirefoxResult;\nlet firefoxVersionResult;\nfunction isFirefox() {\n if (!defined(isFirefoxResult)) {\n isFirefoxResult = false;\n\n const fields = /Firefox\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\n if (fields !== null) {\n isFirefoxResult = true;\n firefoxVersionResult = extractVersion(fields[1]);\n }\n }\n return isFirefoxResult;\n}\n\nlet isWindowsResult;\nfunction isWindows() {\n if (!defined(isWindowsResult)) {\n isWindowsResult = /Windows/i.test(theNavigator.appVersion);\n }\n return isWindowsResult;\n}\n\nlet isIPadOrIOSResult;\nfunction isIPadOrIOS() {\n if (!defined(isIPadOrIOSResult)) {\n isIPadOrIOSResult =\n navigator.platform === \"iPhone\" ||\n navigator.platform === \"iPod\" ||\n navigator.platform === \"iPad\";\n }\n\n return isIPadOrIOSResult;\n}\n\nfunction firefoxVersion() {\n return isFirefox() && firefoxVersionResult;\n}\n\nlet hasPointerEvents;\nfunction supportsPointerEvents() {\n if (!defined(hasPointerEvents)) {\n //While navigator.pointerEnabled is deprecated in the W3C specification\n //we still need to use it if it exists in order to support browsers\n //that rely on it, such as the Windows WebBrowser control which defines\n //PointerEvent but sets navigator.pointerEnabled to false.\n\n //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\n hasPointerEvents =\n !isFirefox() &&\n typeof PointerEvent !== \"undefined\" &&\n (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);\n }\n return hasPointerEvents;\n}\n\nlet imageRenderingValueResult;\nlet supportsImageRenderingPixelatedResult;\nfunction supportsImageRenderingPixelated() {\n if (!defined(supportsImageRenderingPixelatedResult)) {\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\n \"style\",\n \"image-rendering: -moz-crisp-edges;\" + \"image-rendering: pixelated;\"\n );\n //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\n const tmp = canvas.style.imageRendering;\n supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== \"\";\n if (supportsImageRenderingPixelatedResult) {\n imageRenderingValueResult = tmp;\n }\n }\n return supportsImageRenderingPixelatedResult;\n}\n\nfunction imageRenderingValue() {\n return supportsImageRenderingPixelated()\n ? imageRenderingValueResult\n : undefined;\n}\n\nfunction supportsWebP() {\nreturn supportsWebP._result;\n}\nsupportsWebP._promise = undefined;\nsupportsWebP._result = undefined;\nsupportsWebP.initialize = function () {\n // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\n if (defined(supportsWebP._promise)) {\n return supportsWebP._promise;\n }\n\n supportsWebP._promise = new Promise((resolve) => {\n const image = new Image();\n image.onload = function () {\n supportsWebP._result = image.width > 0 && image.height > 0;\n resolve(supportsWebP._result);\n };\n\n image.onerror = function () {\n supportsWebP._result = false;\n resolve(supportsWebP._result);\n };\n image.src =\n \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\n });\n\n return supportsWebP._promise;\n};\nObject.defineProperties(supportsWebP, {\n initialized: {\n get: function () {\n return defined(supportsWebP._result);\n },\n },\n});\n\nconst typedArrayTypes = [];\nif (typeof ArrayBuffer !== \"undefined\") {\n typedArrayTypes.push(\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array\n );\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof Uint8ClampedArray !== \"undefined\") {\n typedArrayTypes.push(Uint8ClampedArray);\n }\n\n if (typeof BigInt64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigInt64Array);\n }\n\n if (typeof BigUint64Array !== \"undefined\") {\n // eslint-disable-next-line no-undef\n typedArrayTypes.push(BigUint64Array);\n }\n}\n\n/**\n * A set of functions to detect whether the current browser supports\n * various features.\n *\n * @namespace FeatureDetection\n */\nconst FeatureDetection = {\n isChrome: isChrome,\n chromeVersion: chromeVersion,\n isSafari: isSafari,\n safariVersion: safariVersion,\n isWebkit: isWebkit,\n webkitVersion: webkitVersion,\n isInternetExplorer: isInternetExplorer,\n internetExplorerVersion: internetExplorerVersion,\n isEdge: isEdge,\n edgeVersion: edgeVersion,\n isFirefox: isFirefox,\n firefoxVersion: firefoxVersion,\n isWindows: isWindows,\n isIPadOrIOS: isIPadOrIOS,\n hardwareConcurrency: defaultValue(theNavigator.hardwareConcurrency, 3),\n supportsPointerEvents: supportsPointerEvents,\n supportsImageRenderingPixelated: supportsImageRenderingPixelated,\n supportsWebP: supportsWebP,\n imageRenderingValue: imageRenderingValue,\n typedArrayTypes: typedArrayTypes,\n};\n\n/**\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\n *\n * @param {Scene} scene\n * @returns {Boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\n */\nFeatureDetection.supportsBasis = function (scene) {\n return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\n};\n\n/**\n * Detects whether the current browser supports the full screen standard.\n *\n * @returns {Boolean} true if the browser supports the full screen standard, false if not.\n *\n * @see Fullscreen\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\n */\nFeatureDetection.supportsFullscreen = function () {\n return Fullscreen.supportsFullscreen();\n};\n\n/**\n * Detects whether the current browser supports typed arrays.\n *\n * @returns {Boolean} true if the browser supports typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsTypedArrays = function () {\n return typeof ArrayBuffer !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt64Array typed arrays.\n *\n * @returns {Boolean} true if the browser supports BigInt64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigInt64Array = function () {\n return typeof BigInt64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigUint64Array typed arrays.\n *\n * @returns {Boolean} true if the browser supports BigUint64Array typed arrays, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\n */\nFeatureDetection.supportsBigUint64Array = function () {\n return typeof BigUint64Array !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports BigInt.\n *\n * @returns {Boolean} true if the browser supports BigInt, false if not.\n *\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\n */\nFeatureDetection.supportsBigInt = function () {\n return typeof BigInt !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Workers.\n *\n * @returns {Boolean} true if the browsers supports Web Workers, false if not.\n *\n * @see {@link http://www.w3.org/TR/workers/}\n */\nFeatureDetection.supportsWebWorkers = function () {\n return typeof Worker !== \"undefined\";\n};\n\n/**\n * Detects whether the current browser supports Web Assembly.\n *\n * @returns {Boolean} true if the browsers supports Web Assembly, false if not.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\n */\nFeatureDetection.supportsWebAssembly = function () {\n return typeof WebAssembly !== \"undefined\";\n};\nexport default FeatureDetection;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction hue2rgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n }\n if (h > 1) {\n h -= 1;\n }\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * 6 * h;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\n\n/**\n * A color, specified using red, green, blue, and alpha values,\n * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).\n * @param {Number} [red=1.0] The red component.\n * @param {Number} [green=1.0] The green component.\n * @param {Number} [blue=1.0] The blue component.\n * @param {Number} [alpha=1.0] The alpha component.\n *\n * @constructor\n * @alias Color\n *\n * @see Packable\n */\nfunction Color(red, green, blue, alpha) {\n /**\n * The red component.\n * @type {Number}\n * @default 1.0\n */\n this.red = defaultValue(red, 1.0);\n /**\n * The green component.\n * @type {Number}\n * @default 1.0\n */\n this.green = defaultValue(green, 1.0);\n /**\n * The blue component.\n * @type {Number}\n * @default 1.0\n */\n this.blue = defaultValue(blue, 1.0);\n /**\n * The alpha component.\n * @type {Number}\n * @default 1.0\n */\n this.alpha = defaultValue(alpha, 1.0);\n}\n\n/**\n * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,\n * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.\n *\n * @param {Cartesian4} cartesian The source cartesian.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.fromCartesian4 = function (cartesian, result) {\n if (!defined(result)) {\n return new Color(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n }\n\n result.red = cartesian.x;\n result.green = cartesian.y;\n result.blue = cartesian.z;\n result.alpha = cartesian.w;\n return result;\n};\n\n/**\n * Creates a new Color specified using red, green, blue, and alpha values\n * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.\n *\n * @param {Number} [red=255] The red component.\n * @param {Number} [green=255] The green component.\n * @param {Number} [blue=255] The blue component.\n * @param {Number} [alpha=255] The alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.fromBytes = function (red, green, blue, alpha, result) {\n red = Color.byteToFloat(defaultValue(red, 255.0));\n green = Color.byteToFloat(defaultValue(green, 255.0));\n blue = Color.byteToFloat(defaultValue(blue, 255.0));\n alpha = Color.byteToFloat(defaultValue(alpha, 255.0));\n\n if (!defined(result)) {\n return new Color(red, green, blue, alpha);\n }\n\n result.red = red;\n result.green = green;\n result.blue = blue;\n result.alpha = alpha;\n return result;\n};\n\n/**\n * Creates a new Color that has the same red, green, and blue components\n * of the specified color, but with the specified alpha value.\n *\n * @param {Color} color The base color\n * @param {Number} alpha The new alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n *\n * @example const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);\n */\nColor.fromAlpha = function (color, alpha, result) {\n if (!defined(result)) {\n return new Color(color.red, color.green, color.blue, alpha);\n }\n\n result.red = color.red;\n result.green = color.green;\n result.blue = color.blue;\n result.alpha = alpha;\n return result;\n};\n\nlet scratchArrayBuffer;\nlet scratchUint32Array;\nlet scratchUint8Array;\nif (FeatureDetection.supportsTypedArrays()) {\n scratchArrayBuffer = new ArrayBuffer(4);\n scratchUint32Array = new Uint32Array(scratchArrayBuffer);\n scratchUint8Array = new Uint8Array(scratchArrayBuffer);\n}\n\n/**\n * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness\n * of the system.\n *\n * @param {Number} rgba A single numeric unsigned 32-bit RGBA value.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object.\n *\n * @example\n * const color = Cesium.Color.fromRgba(0x67ADDFFF);\n *\n * @see Color#toRgba\n */\nColor.fromRgba = function (rgba, result) {\n // scratchUint32Array and scratchUint8Array share an underlying array buffer\n scratchUint32Array[0] = rgba;\n return Color.fromBytes(\n scratchUint8Array[0],\n scratchUint8Array[1],\n scratchUint8Array[2],\n scratchUint8Array[3],\n result\n );\n};\n\n/**\n * Creates a Color instance from hue, saturation, and lightness.\n *\n * @param {Number} [hue=0] The hue angle 0...1\n * @param {Number} [saturation=0] The saturation value 0...1\n * @param {Number} [lightness=0] The lightness value 0...1\n * @param {Number} [alpha=1.0] The alpha component 0...1\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object.\n *\n * @see {@link http://www.w3.org/TR/css3-color/#hsl-color|CSS color values}\n */\nColor.fromHsl = function (hue, saturation, lightness, alpha, result) {\n hue = defaultValue(hue, 0.0) % 1.0;\n saturation = defaultValue(saturation, 0.0);\n lightness = defaultValue(lightness, 0.0);\n alpha = defaultValue(alpha, 1.0);\n\n let red = lightness;\n let green = lightness;\n let blue = lightness;\n\n if (saturation !== 0) {\n let m2;\n if (lightness < 0.5) {\n m2 = lightness * (1 + saturation);\n } else {\n m2 = lightness + saturation - lightness * saturation;\n }\n\n const m1 = 2.0 * lightness - m2;\n red = hue2rgb(m1, m2, hue + 1 / 3);\n green = hue2rgb(m1, m2, hue);\n blue = hue2rgb(m1, m2, hue - 1 / 3);\n }\n\n if (!defined(result)) {\n return new Color(red, green, blue, alpha);\n }\n\n result.red = red;\n result.green = green;\n result.blue = blue;\n result.alpha = alpha;\n return result;\n};\n\n/**\n * Creates a random color using the provided options. For reproducible random colors, you should\n * call {@link CesiumMath#setRandomNumberSeed} once at the beginning of your application.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.red] If specified, the red component to use instead of a randomized value.\n * @param {Number} [options.minimumRed=0.0] The maximum red value to generate if none was specified.\n * @param {Number} [options.maximumRed=1.0] The minimum red value to generate if none was specified.\n * @param {Number} [options.green] If specified, the green component to use instead of a randomized value.\n * @param {Number} [options.minimumGreen=0.0] The maximum green value to generate if none was specified.\n * @param {Number} [options.maximumGreen=1.0] The minimum green value to generate if none was specified.\n * @param {Number} [options.blue] If specified, the blue component to use instead of a randomized value.\n * @param {Number} [options.minimumBlue=0.0] The maximum blue value to generate if none was specified.\n * @param {Number} [options.maximumBlue=1.0] The minimum blue value to generate if none was specified.\n * @param {Number} [options.alpha] If specified, the alpha component to use instead of a randomized value.\n * @param {Number} [options.minimumAlpha=0.0] The maximum alpha value to generate if none was specified.\n * @param {Number} [options.maximumAlpha=1.0] The minimum alpha value to generate if none was specified.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\n *\n * @exception {DeveloperError} minimumRed must be less than or equal to maximumRed.\n * @exception {DeveloperError} minimumGreen must be less than or equal to maximumGreen.\n * @exception {DeveloperError} minimumBlue must be less than or equal to maximumBlue.\n * @exception {DeveloperError} minimumAlpha must be less than or equal to maximumAlpha.\n *\n * @example\n * //Create a completely random color\n * const color = Cesium.Color.fromRandom();\n *\n * //Create a random shade of yellow.\n * const color1 = Cesium.Color.fromRandom({\n * red : 1.0,\n * green : 1.0,\n * alpha : 1.0\n * });\n *\n * //Create a random bright color.\n * const color2 = Cesium.Color.fromRandom({\n * minimumRed : 0.75,\n * minimumGreen : 0.75,\n * minimumBlue : 0.75,\n * alpha : 1.0\n * });\n */\nColor.fromRandom = function (options, result) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let red = options.red;\n if (!defined(red)) {\n const minimumRed = defaultValue(options.minimumRed, 0);\n const maximumRed = defaultValue(options.maximumRed, 1.0);\n\n red =\n minimumRed + CesiumMath.nextRandomNumber() * (maximumRed - minimumRed);\n }\n\n let green = options.green;\n if (!defined(green)) {\n const minimumGreen = defaultValue(options.minimumGreen, 0);\n const maximumGreen = defaultValue(options.maximumGreen, 1.0);\n\ngreen =\n minimumGreen +\n CesiumMath.nextRandomNumber() * (maximumGreen - minimumGreen);\n }\n\n let blue = options.blue;\n if (!defined(blue)) {\n const minimumBlue = defaultValue(options.minimumBlue, 0);\n const maximumBlue = defaultValue(options.maximumBlue, 1.0);\n\n blue =\n minimumBlue + CesiumMath.nextRandomNumber() * (maximumBlue - minimumBlue);\n }\n\n let alpha = options.alpha;\n if (!defined(alpha)) {\n const minimumAlpha = defaultValue(options.minimumAlpha, 0);\n const maximumAlpha = defaultValue(options.maximumAlpha, 1.0);\n\n alpha =\n minimumAlpha +\n CesiumMath.nextRandomNumber() * (maximumAlpha - minimumAlpha);\n }\n\n if (!defined(result)) {\n return new Color(red, green, blue, alpha);\n }\n\n result.red = red;\n result.green = green;\n result.blue = blue;\n result.alpha = alpha;\n return result;\n};\n\n//#rgba\nconst rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i;\n//#rrggbbaa\nconst rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i;\n//rgb(), rgba(), or rgb%()\nconst rgbParenthesesMatcher = /^rgba?\\(\\s*([0-9.]+%?)\\s*,\\s*([0-9.]+%?)\\s*,\\s*([0-9.]+%?)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i;\n//hsl() or hsla()\nconst hslParenthesesMatcher = /^hsla?\\(\\s*([0-9.]+)\\s*,\\s*([0-9.]+%)\\s*,\\s*([0-9.]+%)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i;\n\n/**\n * Creates a Color instance from a CSS color value.\n *\n * @param {String} color The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The color object, or undefined if the string was not a valid CSS color.\n *\n *\n * @example\n * const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');\n * const green = Cesium.Color.fromCssColorString('green');\n *\n * @see {@link http://www.w3.org/TR/css3-color|CSS color values}\n */\nColor.fromCssColorString = function (color, result) {\n if (!defined(result)) {\n result = new Color();\n }\n\n // Remove all whitespaces from the color string\n color = color.replace(/\\s/g, \"\");\n\n const namedColor = Color[color.toUpperCase()];\n if (defined(namedColor)) {\n Color.clone(namedColor, result);\n return result;\n }\n\n let matches = rgbaMatcher.exec(color);\n if (matches !== null) {\n result.red = parseInt(matches[1], 16) / 15;\n result.green = parseInt(matches[2], 16) / 15.0;\n result.blue = parseInt(matches[3], 16) / 15.0;\n result.alpha = parseInt(defaultValue(matches[4], \"f\"), 16) / 15.0;\n return result;\n }\n\n matches = rrggbbaaMatcher.exec(color);\n if (matches !== null) {\n result.red = parseInt(matches[1], 16) / 255.0;\n result.green = parseInt(matches[2], 16) / 255.0;\n result.blue = parseInt(matches[3], 16) / 255.0;\n result.alpha = parseInt(defaultValue(matches[4], \"ff\"), 16) / 255.0;\n return result;\n }\n\n matches = rgbParenthesesMatcher.exec(color);\n if (matches !== null) {\n result.red =\n parseFloat(matches[1]) / (\"%\" === matches[1].substr(-1) ? 100.0 : 255.0);\n result.green =\n parseFloat(matches[2]) / (\"%\" === matches[2].substr(-1) ? 100.0 : 255.0);\n result.blue =\n parseFloat(matches[3]) / (\"%\" === matches[3].substr(-1) ? 100.0 : 255.0);\n result.alpha = parseFloat(defaultValue(matches[4], \"1.0\"));\n return result;\n }\n\n matches = hslParenthesesMatcher.exec(color);\n if (matches !== null) {\n return Color.fromHsl(\n parseFloat(matches[1]) / 360.0,\n parseFloat(matches[2]) / 100.0,\n parseFloat(matches[3]) / 100.0,\n parseFloat(defaultValue(matches[4], \"1.0\")),\n result\n );\n }\n\n result = undefined;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nColor.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Color} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nColor.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n array[startingIndex++] = value.red;\n array[startingIndex++] = value.green;\n array[startingIndex++] = value.blue;\n array[startingIndex] = value.alpha;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Color} [result] The object into which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nColor.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n if (!defined(result)) {\n result = new Color();\n }\n result.red = array[startingIndex++];\n result.green = array[startingIndex++];\n result.blue = array[startingIndex++];\n result.alpha = array[startingIndex];\n return result;\n};\n\n/**\n * Converts a 'byte' color component in the range of 0 to 255 into\n * a 'float' color component in the range of 0 to 1.0.\n *\n * @param {Number} number The number to be converted.\n * @returns {Number} The converted number.\n */\nColor.byteToFloat = function (number) {\n return number / 255.0;\n};\n\n/**\n * Converts a 'float' color component in the range of 0 to 1.0 into\n * a 'byte' color component in the range of 0 to 255.\n *\n * @param {Number} number The number to be converted.\n * @returns {Number} The converted number.\n */\nColor.floatToByte = function (number) {\n return number === 1.0 ? 255.0 : (number * 256.0) | 0;\n};\n\n/**\n * Duplicates a Color.\n *\n * @param {Color} color The Color to duplicate.\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)\n */\nColor.clone = function (color, result) {\n if (!defined(color)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Color(color.red, color.green, color.blue, color.alpha);\n }\n result.red = color.red;\n result.green = color.green;\n result.blue = color.blue;\n result.alpha = color.alpha;\n return result;\n};\n\n/**\n * Returns true if the first Color equals the second color.\n *\n * @param {Color} left The first Color to compare for equality.\n * @param {Color} right The second Color to compare for equality.\n * @returns {Boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.\n */\nColor.equals = function (left, right) {\n return (\n left === right || //\n (defined(left) && //\n defined(right) && //\n left.red === right.red && //\n left.green === right.green && //\n left.blue === right.blue && //\n left.alpha === right.alpha)\n );\n};\n\n/**\n * @private\n */\nColor.equalsArray = function (color, array, offset) {\n return (\n color.red === array[offset] &&\n color.green === array[offset + 1] &&\n color.blue === array[offset + 2] &&\n color.alpha === array[offset + 3]\n );\n};\n\n/**\n * Returns a duplicate of a Color instance.\n *\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\n */\nColor.prototype.clone = function (result) {\n return Color.clone(this, result);\n};\n\n/**\n * Returns true if this Color equals other.\n *\n * @param {Color} other The Color to compare for equality.\n * @returns {Boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.\n */\nColor.prototype.equals = function (other) {\n return Color.equals(this, other);\n};\n\n/**\n * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.\n *\n * @param {Color} other The Color to compare for equality.\n * @param {Number} [epsilon=0.0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.\n */\nColor.prototype.equalsEpsilon = function (other, epsilon) {\n return (\n this === other || //\n (defined(other) && //\n Math.abs(this.red - other.red) <= epsilon && //\n Math.abs(this.green - other.green) <= epsilon && //\n Math.abs(this.blue - other.blue) <= epsilon && //\n Math.abs(this.alpha - other.alpha) <= epsilon)\n );\n};\n\n/**\n * Creates a string representing this Color in the format '(red, green, blue, alpha)'.\n *\n * @returns {String} A string representing this Color in the format '(red, green, blue, alpha)'.\n */\nColor.prototype.toString = function () {\n return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;\n};\n\n/**\n * Creates a string containing the CSS color value for this color.\n *\n * @returns {String} The CSS equivalent of this color.\n *\n * @see {@link http://www.w3.org/TR/css3-color/#rgba-color|CSS RGB or RGBA color values}\n */\nColor.prototype.toCssColorString = function () {\n const red = Color.floatToByte(this.red);\n const green = Color.floatToByte(this.green);\n const blue = Color.floatToByte(this.blue);\n if (this.alpha === 1) {\n return `rgb(${red},${green},${blue})`;\n }\n return `rgba(${red},${green},${blue},${this.alpha})`;\n};\n\n/**\n * Creates a string containing CSS hex string color value for this color.\n *\n * @returns {String} The CSS hex string equivalent of this color.\n */\nColor.prototype.toCssHexString = function () {\n let r = Color.floatToByte(this.red).toString(16);\n if (r.length < 2) {\n r = `0${r}`;\n }\n let g = Color.floatToByte(this.green).toString(16);\n if (g.length < 2) {\n g = `0${g}`;\n }\n let b = Color.floatToByte(this.blue).toString(16);\n if (b.length < 2) {\n b = `0${b}`;\n }\n if (this.alpha < 1) {\n let hexAlpha = Color.floatToByte(this.alpha).toString(16);\n if (hexAlpha.length < 2) {\n hexAlpha = `0${hexAlpha}`;\n }\n return `#${r}${g}${b}${hexAlpha}`;\n }\n return `#${r}${g}${b}`;\n};\n\n/**\n * Converts this color to an array of red, green, blue, and alpha values\n * that are in the range of 0 to 255.\n *\n * @param {Number[]} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Number[]} The modified result parameter or a new instance if result was undefined.\n */\nColor.prototype.toBytes = function (result) {\n const red = Color.floatToByte(this.red);\n const green = Color.floatToByte(this.green);\n const blue = Color.floatToByte(this.blue);\n const alpha = Color.floatToByte(this.alpha);\n\n if (!defined(result)) {\n return [red, green, blue, alpha];\n }\n result[0] = red;\n result[1] = green;\n result[2] = blue;\n result[3] = alpha;\n return result;\n};\n\n/**\n * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness\n * of the system.\n *\n * @returns {Number} A single numeric unsigned 32-bit RGBA value.\n *\n *\n * @example\n * const rgba = Cesium.Color.BLUE.toRgba();\n *\n * @see Color.fromRgba\n */\nColor.prototype.toRgba = function () {\n // scratchUint32Array and scratchUint8Array share an underlying array buffer\n scratchUint8Array[0] = Color.floatToByte(this.red);\n scratchUint8Array[1] = Color.floatToByte(this.green);\n scratchUint8Array[2] = Color.floatToByte(this.blue);\n scratchUint8Array[3] = Color.floatToByte(this.alpha);\n return scratchUint32Array[0];\n};\n\n/**\n * Brightens this color by the provided magnitude.\n *\n * @param {Number} magnitude A positive number indicating the amount to brighten.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n *\n * @example\n * const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());\n */\nColor.prototype.brighten = function (magnitude, result) {\n magnitude = 1.0 - magnitude;\n result.red = 1.0 - (1.0 - this.red) * magnitude;\n result.green = 1.0 - (1.0 - this.green) * magnitude;\n result.blue = 1.0 - (1.0 - this.blue) * magnitude;\n result.alpha = this.alpha;\n return result;\n};\n\n/**\n * Darkens this color by the provided magnitude.\n *\n * @param {Number} magnitude A positive number indicating the amount to darken.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n *\n * @example\n * const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());\n */\nColor.prototype.darken = function (magnitude, result) {\n magnitude = 1.0 - magnitude;\n result.red = this.red * magnitude;\n result.green = this.green * magnitude;\n result.blue = this.blue * magnitude;\n result.alpha = this.alpha;\n return result;\n};\n\n/**\n * Creates a new Color that has the same red, green, and blue components\n * as this Color, but with the specified alpha value.\n *\n * @param {Number} alpha The new alpha component.\n * @param {Color} [result] The object onto which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n *\n * @example const translucentRed = Cesium.Color.RED.withAlpha(0.9);\n */\nColor.prototype.withAlpha = function (alpha, result) {\n return Color.fromAlpha(this, alpha, result);\n};\n\n/**\n * Computes the componentwise sum of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.add = function (left, right, result) {\n result.red = left.red + right.red;\n result.green = left.green + right.green;\n result.blue = left.blue + right.blue;\n result.alpha = left.alpha + right.alpha;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.subtract = function (left, right, result) {\n result.red = left.red - right.red;\n result.green = left.green - right.green;\n result.blue = left.blue - right.blue;\n result.alpha = left.alpha - right.alpha;\n return result;\n};\n\n/**\n * Computes the componentwise product of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.multiply = function (left, right, result) {\n result.red = left.red * right.red;\n result.green = left.green * right.green;\n result.blue = left.blue * right.blue;\n result.alpha = left.alpha * right.alpha;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.divide = function (left, right, result) {\n result.red = left.red / right.red;\n result.green = left.green / right.green;\n result.blue = left.blue / right.blue;\n result.alpha = left.alpha / right.alpha;\n return result;\n};\n\n/**\n * Computes the componentwise modulus of two Colors.\n *\n * @param {Color} left The first Color.\n * @param {Color} right The second Color.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.mod = function (left, right, result) {\n result.red = left.red % right.red;\n result.green = left.green % right.green;\n result.blue = left.blue % right.blue;\n result.alpha = left.alpha % right.alpha;\n return result;\n};\n\n/**\n * Computes the linear interpolation or extrapolation at t between the provided colors.\n *\n * @param {Color} start The color corresponding to t at 0.0.\n * @param {Color} end The color corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.lerp = function (start, end, t, result) {\n result.red = CesiumMath.lerp(start.red, end.red, t);\n result.green = CesiumMath.lerp(start.green, end.green, t);\n result.blue = CesiumMath.lerp(start.blue, end.blue, t);\n result.alpha = CesiumMath.lerp(start.alpha, end.alpha, t);\n return result;\n};\n\n/**\n * Multiplies the provided Color componentwise by the provided scalar.\n *\n * @param {Color} color The Color to be scaled.\n * @param {Number} scalar The scalar to multiply with.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.multiplyByScalar = function (color, scalar, result) {\n result.red = color.red * scalar;\n result.green = color.green * scalar;\n result.blue = color.blue * scalar;\n result.alpha = color.alpha * scalar;\n return result;\n};\n\n/**\n * Divides the provided Color componentwise by the provided scalar.\n *\n * @param {Color} color The Color to be divided.\n * @param {Number} scalar The scalar to divide with.\n * @param {Color} result The object onto which to store the result.\n * @returns {Color} The modified result parameter.\n */\nColor.divideByScalar = function (color, scalar, result) {\n result.red = color.red / scalar;\n result.green = color.green / scalar;\n result.blue = color.blue / scalar;\n result.alpha = color.alpha / scalar;\n return result;\n};\n\n/**\n * An immutable Color instance initialized to CSS color #F0F8FF\n * <span class=\"colorSwath\" style=\"background: #F0F8FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ALICEBLUE = Object.freeze(Color.fromCssColorString(\"#F0F8FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAEBD7\n * <span class=\"colorSwath\" style=\"background: #FAEBD7;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString(\"#FAEBD7\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FFFF\n * <span class=\"colorSwath\" style=\"background: #00FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AQUA = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7FFFD4\n * <span class=\"colorSwath\" style=\"background: #7FFFD4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AQUAMARINE = Object.freeze(Color.fromCssColorString(\"#7FFFD4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F0FFFF\n * <span class=\"colorSwath\" style=\"background: #F0FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.AZURE = Object.freeze(Color.fromCssColorString(\"#F0FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5F5DC\n * <span class=\"colorSwath\" style=\"background: #F5F5DC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BEIGE = Object.freeze(Color.fromCssColorString(\"#F5F5DC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4C4\n * <span class=\"colorSwath\" style=\"background: #FFE4C4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BISQUE = Object.freeze(Color.fromCssColorString(\"#FFE4C4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #000000\n * <span class=\"colorSwath\" style=\"background: #000000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLACK = Object.freeze(Color.fromCssColorString(\"#000000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFEBCD\n * <span class=\"colorSwath\" style=\"background: #FFEBCD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString(\"#FFEBCD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #0000FF\n * <span class=\"colorSwath\" style=\"background: #0000FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLUE = Object.freeze(Color.fromCssColorString(\"#0000FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8A2BE2\n * <span class=\"colorSwath\" style=\"background: #8A2BE2;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BLUEVIOLET = Object.freeze(Color.fromCssColorString(\"#8A2BE2\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A52A2A\n * <span class=\"colorSwath\" style=\"background: #A52A2A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BROWN = Object.freeze(Color.fromCssColorString(\"#A52A2A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DEB887\n * <span class=\"colorSwath\" style=\"background: #DEB887;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.BURLYWOOD = Object.freeze(Color.fromCssColorString(\"#DEB887\"));\n\n/**\n * An immutable Color instance initialized to CSS color #5F9EA0\n * <span class=\"colorSwath\" style=\"background: #5F9EA0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CADETBLUE = Object.freeze(Color.fromCssColorString(\"#5F9EA0\"));\n/**\n * An immutable Color instance initialized to CSS color #7FFF00\n * <span class=\"colorSwath\" style=\"background: #7FFF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CHARTREUSE = Object.freeze(Color.fromCssColorString(\"#7FFF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D2691E\n * <span class=\"colorSwath\" style=\"background: #D2691E;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CHOCOLATE = Object.freeze(Color.fromCssColorString(\"#D2691E\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF7F50\n * <span class=\"colorSwath\" style=\"background: #FF7F50;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORAL = Object.freeze(Color.fromCssColorString(\"#FF7F50\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6495ED\n * <span class=\"colorSwath\" style=\"background: #6495ED;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString(\"#6495ED\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF8DC\n * <span class=\"colorSwath\" style=\"background: #FFF8DC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CORNSILK = Object.freeze(Color.fromCssColorString(\"#FFF8DC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DC143C\n * <span class=\"colorSwath\" style=\"background: #DC143C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CRIMSON = Object.freeze(Color.fromCssColorString(\"#DC143C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FFFF\n * <span class=\"colorSwath\" style=\"background: #00FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.CYAN = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00008B\n * <span class=\"colorSwath\" style=\"background: #00008B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKBLUE = Object.freeze(Color.fromCssColorString(\"#00008B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008B8B\n * <span class=\"colorSwath\" style=\"background: #008B8B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKCYAN = Object.freeze(Color.fromCssColorString(\"#008B8B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B8860B\n * <span class=\"colorSwath\" style=\"background: #B8860B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGOLDENROD = Object.freeze(Color.fromCssColorString(\"#B8860B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A9A9A9\n * <span class=\"colorSwath\" style=\"background: #A9A9A9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGRAY = Object.freeze(Color.fromCssColorString(\"#A9A9A9\"));\n\n/**\n * An immutable Color instance initialized to CSS color #006400\n * <span class=\"colorSwath\" style=\"background: #006400;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGREEN = Object.freeze(Color.fromCssColorString(\"#006400\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A9A9A9\n * <span class=\"colorSwath\" style=\"background: #A9A9A9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKGREY = Color.DARKGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #BDB76B\n * <span class=\"colorSwath\" style=\"background: #BDB76B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKKHAKI = Object.freeze(Color.fromCssColorString(\"#BDB76B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B008B\n * <span class=\"colorSwath\" style=\"background: #8B008B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKMAGENTA = Object.freeze(Color.fromCssColorString(\"#8B008B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #556B2F\n * <span class=\"colorSwath\" style=\"background: #556B2F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString(\"#556B2F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF8C00\n * <span class=\"colorSwath\" style=\"background: #FF8C00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKORANGE = Object.freeze(Color.fromCssColorString(\"#FF8C00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9932CC\n * <span class=\"colorSwath\" style=\"background: #9932CC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKORCHID = Object.freeze(Color.fromCssColorString(\"#9932CC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B0000\n * <span class=\"colorSwath\" style=\"background: #8B0000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKRED = Object.freeze(Color.fromCssColorString(\"#8B0000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E9967A\n * <span class=\"colorSwath\" style=\"background: #E9967A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSALMON = Object.freeze(Color.fromCssColorString(\"#E9967A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8FBC8F\n * <span class=\"colorSwath\" style=\"background: #8FBC8F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSEAGREEN = Object.freeze(Color.fromCssColorString(\"#8FBC8F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #483D8B\n * <span class=\"colorSwath\" style=\"background: #483D8B;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#483D8B\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2F4F4F\n * <span class=\"colorSwath\" style=\"background: #2F4F4F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#2F4F4F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2F4F4F\n * <span class=\"colorSwath\" style=\"background: #2F4F4F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKSLATEGREY = Color.DARKSLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #00CED1\n * <span class=\"colorSwath\" style=\"background: #00CED1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKTURQUOISE = Object.freeze(Color.fromCssColorString(\"#00CED1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9400D3\n * <span class=\"colorSwath\" style=\"background: #9400D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DARKVIOLET = Object.freeze(Color.fromCssColorString(\"#9400D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF1493\n * <span class=\"colorSwath\" style=\"background: #FF1493;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DEEPPINK = Object.freeze(Color.fromCssColorString(\"#FF1493\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00BFFF\n * <span class=\"colorSwath\" style=\"background: #00BFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString(\"#00BFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #696969\n * <span class=\"colorSwath\" style=\"background: #696969;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DIMGRAY = Object.freeze(Color.fromCssColorString(\"#696969\"));\n\n/**\n * An immutable Color instance initialized to CSS color #696969\n * <span class=\"colorSwath\" style=\"background: #696969;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DIMGREY = Color.DIMGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #1E90FF\n * <span class=\"colorSwath\" style=\"background: #1E90FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.DODGERBLUE = Object.freeze(Color.fromCssColorString(\"#1E90FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B22222\n * <span class=\"colorSwath\" style=\"background: #B22222;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FIREBRICK = Object.freeze(Color.fromCssColorString(\"#B22222\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFAF0\n * <span class=\"colorSwath\" style=\"background: #FFFAF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FLORALWHITE = Object.freeze(Color.fromCssColorString(\"#FFFAF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #228B22\n * <span class=\"colorSwath\" style=\"background: #228B22;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FORESTGREEN = Object.freeze(Color.fromCssColorString(\"#228B22\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF00FF\n * <span class=\"colorSwath\" style=\"background: #FF00FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.FUCHSIA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DCDCDC\n * <span class=\"colorSwath\" style=\"background: #DCDCDC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GAINSBORO = Object.freeze(Color.fromCssColorString(\"#DCDCDC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F8F8FF\n * <span class=\"colorSwath\" style=\"background: #F8F8FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GHOSTWHITE = Object.freeze(Color.fromCssColorString(\"#F8F8FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFD700\n * <span class=\"colorSwath\" style=\"background: #FFD700;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GOLD = Object.freeze(Color.fromCssColorString(\"#FFD700\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DAA520\n * <span class=\"colorSwath\" style=\"background: #DAA520;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GOLDENROD = Object.freeze(Color.fromCssColorString(\"#DAA520\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808080\n * <span class=\"colorSwath\" style=\"background: #808080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GRAY = Object.freeze(Color.fromCssColorString(\"#808080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008000\n * <span class=\"colorSwath\" style=\"background: #008000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREEN = Object.freeze(Color.fromCssColorString(\"#008000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #ADFF2F\n * <span class=\"colorSwath\" style=\"background: #ADFF2F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREENYELLOW = Object.freeze(Color.fromCssColorString(\"#ADFF2F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808080\n * <span class=\"colorSwath\" style=\"background: #808080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.GREY = Color.GRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #F0FFF0\n * <span class=\"colorSwath\" style=\"background: #F0FFF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.HONEYDEW = Object.freeze(Color.fromCssColorString(\"#F0FFF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF69B4\n * <span class=\"colorSwath\" style=\"background: #FF69B4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.HOTPINK = Object.freeze(Color.fromCssColorString(\"#FF69B4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #CD5C5C\n * <span class=\"colorSwath\" style=\"background: #CD5C5C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.INDIANRED = Object.freeze(Color.fromCssColorString(\"#CD5C5C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4B0082\n * <span class=\"colorSwath\" style=\"background: #4B0082;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.INDIGO = Object.freeze(Color.fromCssColorString(\"#4B0082\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFF0\n * <span class=\"colorSwath\" style=\"background: #FFFFF0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.IVORY = Object.freeze(Color.fromCssColorString(\"#FFFFF0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F0E68C\n * <span class=\"colorSwath\" style=\"background: #F0E68C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.KHAKI = Object.freeze(Color.fromCssColorString(\"#F0E68C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E6E6FA\n * <span class=\"colorSwath\" style=\"background: #E6E6FA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAVENDER = Object.freeze(Color.fromCssColorString(\"#E6E6FA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF0F5\n * <span class=\"colorSwath\" style=\"background: #FFF0F5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString(\"#FFF0F5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7CFC00\n * <span class=\"colorSwath\" style=\"background: #7CFC00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LAWNGREEN = Object.freeze(Color.fromCssColorString(\"#7CFC00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFACD\n * <span class=\"colorSwath\" style=\"background: #FFFACD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LEMONCHIFFON = Object.freeze(Color.fromCssColorString(\"#FFFACD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #ADD8E6\n * <span class=\"colorSwath\" style=\"background: #ADD8E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#ADD8E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F08080\n * <span class=\"colorSwath\" style=\"background: #F08080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTCORAL = Object.freeze(Color.fromCssColorString(\"#F08080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #E0FFFF\n * <span class=\"colorSwath\" style=\"background: #E0FFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTCYAN = Object.freeze(Color.fromCssColorString(\"#E0FFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAFAD2\n * <span class=\"colorSwath\" style=\"background: #FAFAD2;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString(\"#FAFAD2\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D3D3D3\n * <span class=\"colorSwath\" style=\"background: #D3D3D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGRAY = Object.freeze(Color.fromCssColorString(\"#D3D3D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #90EE90\n * <span class=\"colorSwath\" style=\"background: #90EE90;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGREEN = Object.freeze(Color.fromCssColorString(\"#90EE90\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D3D3D3\n * <span class=\"colorSwath\" style=\"background: #D3D3D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTGREY = Color.LIGHTGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #FFB6C1\n * <span class=\"colorSwath\" style=\"background: #FFB6C1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTPINK = Object.freeze(Color.fromCssColorString(\"#FFB6C1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #20B2AA\n * <span class=\"colorSwath\" style=\"background: #20B2AA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString(\"#20B2AA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #87CEFA\n * <span class=\"colorSwath\" style=\"background: #87CEFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #778899\n * <span class=\"colorSwath\" style=\"background: #778899;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#778899\"));\n\n/**\n * An immutable Color instance initialized to CSS color #778899\n * <span class=\"colorSwath\" style=\"background: #778899;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #B0C4DE\n * <span class=\"colorSwath\" style=\"background: #B0C4DE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString(\"#B0C4DE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFE0\n * <span class=\"colorSwath\" style=\"background: #FFFFE0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIGHTYELLOW = Object.freeze(Color.fromCssColorString(\"#FFFFE0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FF00\n * <span class=\"colorSwath\" style=\"background: #00FF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIME = Object.freeze(Color.fromCssColorString(\"#00FF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #32CD32\n * <span class=\"colorSwath\" style=\"background: #32CD32;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LIMEGREEN = Object.freeze(Color.fromCssColorString(\"#32CD32\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FAF0E6\n * <span class=\"colorSwath\" style=\"background: #FAF0E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.LINEN = Object.freeze(Color.fromCssColorString(\"#FAF0E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF00FF\n * <span class=\"colorSwath\" style=\"background: #FF00FF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MAGENTA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #800000\n * <span class=\"colorSwath\" style=\"background: #800000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MAROON = Object.freeze(Color.fromCssColorString(\"#800000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #66CDAA\n * <span class=\"colorSwath\" style=\"background: #66CDAA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString(\"#66CDAA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #0000CD\n * <span class=\"colorSwath\" style=\"background: #0000CD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMBLUE = Object.freeze(Color.fromCssColorString(\"#0000CD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #BA55D3\n * <span class=\"colorSwath\" style=\"background: #BA55D3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMORCHID = Object.freeze(Color.fromCssColorString(\"#BA55D3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9370DB\n * <span class=\"colorSwath\" style=\"background: #9370DB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString(\"#9370DB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #3CB371\n * <span class=\"colorSwath\" style=\"background: #3CB371;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString(\"#3CB371\"));\n\n/**\n * An immutable Color instance initialized to CSS color #7B68EE\n * <span class=\"colorSwath\" style=\"background: #7B68EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#7B68EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FA9A\n * <span class=\"colorSwath\" style=\"background: #00FA9A;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FA9A\"));\n\n/**\n * An immutable Color instance initialized to CSS color #48D1CC\n * <span class=\"colorSwath\" style=\"background: #48D1CC;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString(\"#48D1CC\"));\n\n/**\n * An immutable Color instance initialized to CSS color #C71585\n * <span class=\"colorSwath\" style=\"background: #C71585;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString(\"#C71585\"));\n\n/**\n * An immutable Color instance initialized to CSS color #191970\n * <span class=\"colorSwath\" style=\"background: #191970;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#191970\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5FFFA\n * <span class=\"colorSwath\" style=\"background: #F5FFFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MINTCREAM = Object.freeze(Color.fromCssColorString(\"#F5FFFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4E1\n * <span class=\"colorSwath\" style=\"background: #FFE4E1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MISTYROSE = Object.freeze(Color.fromCssColorString(\"#FFE4E1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFE4B5\n * <span class=\"colorSwath\" style=\"background: #FFE4B5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.MOCCASIN = Object.freeze(Color.fromCssColorString(\"#FFE4B5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFDEAD\n * <span class=\"colorSwath\" style=\"background: #FFDEAD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.NAVAJOWHITE = Object.freeze(Color.fromCssColorString(\"#FFDEAD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #000080\n * <span class=\"colorSwath\" style=\"background: #000080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.NAVY = Object.freeze(Color.fromCssColorString(\"#000080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FDF5E6\n * <span class=\"colorSwath\" style=\"background: #FDF5E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLDLACE = Object.freeze(Color.fromCssColorString(\"#FDF5E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #808000\n * <span class=\"colorSwath\" style=\"background: #808000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLIVE = Object.freeze(Color.fromCssColorString(\"#808000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6B8E23\n * <span class=\"colorSwath\" style=\"background: #6B8E23;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.OLIVEDRAB = Object.freeze(Color.fromCssColorString(\"#6B8E23\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFA500\n * <span class=\"colorSwath\" style=\"background: #FFA500;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORANGE = Object.freeze(Color.fromCssColorString(\"#FFA500\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF4500\n * <span class=\"colorSwath\" style=\"background: #FF4500;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORANGERED = Object.freeze(Color.fromCssColorString(\"#FF4500\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DA70D6\n * <span class=\"colorSwath\" style=\"background: #DA70D6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ORCHID = Object.freeze(Color.fromCssColorString(\"#DA70D6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #EEE8AA\n * <span class=\"colorSwath\" style=\"background: #EEE8AA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEGOLDENROD = Object.freeze(Color.fromCssColorString(\"#EEE8AA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #98FB98\n * <span class=\"colorSwath\" style=\"background: #98FB98;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEGREEN = Object.freeze(Color.fromCssColorString(\"#98FB98\"));\n\n/**\n * An immutable Color instance initialized to CSS color #AFEEEE\n * <span class=\"colorSwath\" style=\"background: #AFEEEE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALETURQUOISE = Object.freeze(Color.fromCssColorString(\"#AFEEEE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DB7093\n * <span class=\"colorSwath\" style=\"background: #DB7093;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PALEVIOLETRED = Object.freeze(Color.fromCssColorString(\"#DB7093\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFEFD5\n * <span class=\"colorSwath\" style=\"background: #FFEFD5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PAPAYAWHIP = Object.freeze(Color.fromCssColorString(\"#FFEFD5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFDAB9\n * <span class=\"colorSwath\" style=\"background: #FFDAB9;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PEACHPUFF = Object.freeze(Color.fromCssColorString(\"#FFDAB9\"));\n\n/**\n * An immutable Color instance initialized to CSS color #CD853F\n * <span class=\"colorSwath\" style=\"background: #CD853F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PERU = Object.freeze(Color.fromCssColorString(\"#CD853F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFC0CB\n * <span class=\"colorSwath\" style=\"background: #FFC0CB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PINK = Object.freeze(Color.fromCssColorString(\"#FFC0CB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #DDA0DD\n * <span class=\"colorSwath\" style=\"background: #DDA0DD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PLUM = Object.freeze(Color.fromCssColorString(\"#DDA0DD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #B0E0E6\n * <span class=\"colorSwath\" style=\"background: #B0E0E6;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.POWDERBLUE = Object.freeze(Color.fromCssColorString(\"#B0E0E6\"));\n\n/**\n * An immutable Color instance initialized to CSS color #800080\n * <span class=\"colorSwath\" style=\"background: #800080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.PURPLE = Object.freeze(Color.fromCssColorString(\"#800080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF0000\n * <span class=\"colorSwath\" style=\"background: #FF0000;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.RED = Object.freeze(Color.fromCssColorString(\"#FF0000\"));\n\n/**\n * An immutable Color instance initialized to CSS color #BC8F8F\n * <span class=\"colorSwath\" style=\"background: #BC8F8F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ROSYBROWN = Object.freeze(Color.fromCssColorString(\"#BC8F8F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4169E1\n * <span class=\"colorSwath\" style=\"background: #4169E1;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.ROYALBLUE = Object.freeze(Color.fromCssColorString(\"#4169E1\"));\n\n/**\n * An immutable Color instance initialized to CSS color #8B4513\n * <span class=\"colorSwath\" style=\"background: #8B4513;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SADDLEBROWN = Object.freeze(Color.fromCssColorString(\"#8B4513\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FA8072\n * <span class=\"colorSwath\" style=\"background: #FA8072;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SALMON = Object.freeze(Color.fromCssColorString(\"#FA8072\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F4A460\n * <span class=\"colorSwath\" style=\"background: #F4A460;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SANDYBROWN = Object.freeze(Color.fromCssColorString(\"#F4A460\"));\n\n/**\n * An immutable Color instance initialized to CSS color #2E8B57\n * <span class=\"colorSwath\" style=\"background: #2E8B57;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SEAGREEN = Object.freeze(Color.fromCssColorString(\"#2E8B57\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFF5EE\n * <span class=\"colorSwath\" style=\"background: #FFF5EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SEASHELL = Object.freeze(Color.fromCssColorString(\"#FFF5EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #A0522D\n * <span class=\"colorSwath\" style=\"background: #A0522D;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SIENNA = Object.freeze(Color.fromCssColorString(\"#A0522D\"));\n\n/**\n * An immutable Color instance initialized to CSS color #C0C0C0\n * <span class=\"colorSwath\" style=\"background: #C0C0C0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SILVER = Object.freeze(Color.fromCssColorString(\"#C0C0C0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #87CEEB\n * <span class=\"colorSwath\" style=\"background: #87CEEB;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEEB\"));\n\n/**\n * An immutable Color instance initialized to CSS color #6A5ACD\n * <span class=\"colorSwath\" style=\"background: #6A5ACD;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEBLUE = Object.freeze(Color.fromCssColorString(\"#6A5ACD\"));\n\n/**\n * An immutable Color instance initialized to CSS color #708090\n * <span class=\"colorSwath\" style=\"background: #708090;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEGRAY = Object.freeze(Color.fromCssColorString(\"#708090\"));\n\n/**\n * An immutable Color instance initialized to CSS color #708090\n * <span class=\"colorSwath\" style=\"background: #708090;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SLATEGREY = Color.SLATEGRAY;\n\n/**\n * An immutable Color instance initialized to CSS color #FFFAFA\n * <span class=\"colorSwath\" style=\"background: #FFFAFA;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SNOW = Object.freeze(Color.fromCssColorString(\"#FFFAFA\"));\n\n/**\n * An immutable Color instance initialized to CSS color #00FF7F\n * <span class=\"colorSwath\" style=\"background: #00FF7F;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.SPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FF7F\"));\n\n/**\n * An immutable Color instance initialized to CSS color #4682B4\n * <span class=\"colorSwath\" style=\"background: #4682B4;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.STEELBLUE = Object.freeze(Color.fromCssColorString(\"#4682B4\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D2B48C\n * <span class=\"colorSwath\" style=\"background: #D2B48C;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TAN = Object.freeze(Color.fromCssColorString(\"#D2B48C\"));\n\n/**\n * An immutable Color instance initialized to CSS color #008080\n * <span class=\"colorSwath\" style=\"background: #008080;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TEAL = Object.freeze(Color.fromCssColorString(\"#008080\"));\n\n/**\n * An immutable Color instance initialized to CSS color #D8BFD8\n * <span class=\"colorSwath\" style=\"background: #D8BFD8;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.THISTLE = Object.freeze(Color.fromCssColorString(\"#D8BFD8\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FF6347\n * <span class=\"colorSwath\" style=\"background: #FF6347;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TOMATO = Object.freeze(Color.fromCssColorString(\"#FF6347\"));\n\n/**\n * An immutable Color instance initialized to CSS color #40E0D0\n * <span class=\"colorSwath\" style=\"background: #40E0D0;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TURQUOISE = Object.freeze(Color.fromCssColorString(\"#40E0D0\"));\n\n/**\n * An immutable Color instance initialized to CSS color #EE82EE\n * <span class=\"colorSwath\" style=\"background: #EE82EE;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.VIOLET = Object.freeze(Color.fromCssColorString(\"#EE82EE\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5DEB3\n * <span class=\"colorSwath\" style=\"background: #F5DEB3;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHEAT = Object.freeze(Color.fromCssColorString(\"#F5DEB3\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFFFF\n * <span class=\"colorSwath\" style=\"background: #FFFFFF;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHITE = Object.freeze(Color.fromCssColorString(\"#FFFFFF\"));\n\n/**\n * An immutable Color instance initialized to CSS color #F5F5F5\n * <span class=\"colorSwath\" style=\"background: #F5F5F5;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.WHITESMOKE = Object.freeze(Color.fromCssColorString(\"#F5F5F5\"));\n\n/**\n * An immutable Color instance initialized to CSS color #FFFF00\n * <span class=\"colorSwath\" style=\"background: #FFFF00;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.YELLOW = Object.freeze(Color.fromCssColorString(\"#FFFF00\"));\n\n/**\n * An immutable Color instance initialized to CSS color #9ACD32\n * <span class=\"colorSwath\" style=\"background: #9ACD32;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.YELLOWGREEN = Object.freeze(Color.fromCssColorString(\"#9ACD32\"));\n\n/**\n * An immutable Color instance initialized to CSS transparent.\n * <span class=\"colorSwath\" style=\"background: transparent;\"></span>\n *\n * @constant\n * @type {Color}\n */\nColor.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));\nexport default Color;\n", "import defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nfunction returnTrue() {\n return true;\n}\n\n/**\n * Destroys an object. Each of the object's functions, including functions in its prototype,\n * is replaced with a function that throws a {@link DeveloperError}, except for the object's\n * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.\n * The object's properties are removed with <code>delete</code>.\n * <br /><br />\n * This function is used by objects that hold native resources, e.g., WebGL resources, which\n * need to be explicitly released. Client code calls an object's <code>destroy</code> function,\n * which then releases the native resource and calls <code>destroyObject</code> to put itself\n * in a destroyed state.\n *\n * @function\n *\n * @param {Object} object The object to destroy.\n * @param {String} [message] The message to include in the exception that is thrown if\n * a destroyed object's function is called.\n *\n *\n * @example\n * // How a texture would destroy itself.\n * this.destroy = function () {\n * _gl.deleteTexture(_texture);\n * return Cesium.destroyObject(this);\n * };\n *\n * @see DeveloperError\n */\nfunction destroyObject(object, message) {\n message = defaultValue(\n message,\n \"This object was destroyed, i.e., destroy() was called.\"\n );\n\n function throwOnDestroyed() {\n}\n\n for (const key in object) {\n if (typeof object[key] === \"function\") {\n object[key] = throwOnDestroyed;\n }\n }\n\n object.isDestroyed = returnTrue;\n\n return undefined;\n}\nexport default destroyObject;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines visibility based on the distance to the camera.\n *\n * @alias DistanceDisplayCondition\n * @constructor\n *\n * @param {Number} [near=0.0] The smallest distance in the interval where the object is visible.\n * @param {Number} [far=Number.MAX_VALUE] The largest distance in the interval where the object is visible.\n *\n * @example\n * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.\n * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);\n */\nfunction DistanceDisplayCondition(near, far) {\n near = defaultValue(near, 0.0);\n this._near = near;\n\n far = defaultValue(far, Number.MAX_VALUE);\n this._far = far;\n}\n\nObject.defineProperties(DistanceDisplayCondition.prototype, {\n /**\n * The smallest distance in the interval where the object is visible.\n * @memberof DistanceDisplayCondition.prototype\n * @type {Number}\n * @default 0.0\n */\n near: {\n get: function () {\n return this._near;\n },\n set: function (value) {\n this._near = value;\n },\n },\n /**\n * The largest distance in the interval where the object is visible.\n * @memberof DistanceDisplayCondition.prototype\n * @type {Number}\n * @default Number.MAX_VALUE\n */\n far: {\n get: function () {\n return this._far;\n },\n set: function (value) {\n this._far = value;\n },\n },\n});\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nDistanceDisplayCondition.packedLength = 2;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {DistanceDisplayCondition} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nDistanceDisplayCondition.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.near;\n array[startingIndex] = value.far;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {DistanceDisplayCondition} [result] The object into which to store the result.\n * @returns {DistanceDisplayCondition} The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.\n */\nDistanceDisplayCondition.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new DistanceDisplayCondition();\n }\n result.near = array[startingIndex++];\n result.far = array[startingIndex];\n return result;\n};\n\n/**\n * Determines if two distance display conditions are equal.\n *\n * @param {DistanceDisplayCondition} left A distance display condition.\n * @param {DistanceDisplayCondition} right Another distance display condition.\n * @return {Boolean} Whether the two distance display conditions are equal.\n */\nDistanceDisplayCondition.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.near === right.near &&\n left.far === right.far)\n );\n};\n\n/**\n * Duplicates a distance display condition instance.\n *\n * @param {DistanceDisplayCondition} [value] The distance display condition to duplicate.\n * @param {DistanceDisplayCondition} [result] The result onto which to store the result.\n * @return {DistanceDisplayCondition} The duplicated instance.\n */\nDistanceDisplayCondition.clone = function (value, result) {\n if (!defined(value)) {\n return undefined;\n }\n\n if (!defined(result)) {\n result = new DistanceDisplayCondition();\n }\n\n result.near = value.near;\n result.far = value.far;\n return result;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {DistanceDisplayCondition} [result] The result onto which to store the result.\n * @return {DistanceDisplayCondition} The duplicated instance.\n */\nDistanceDisplayCondition.prototype.clone = function (result) {\n return DistanceDisplayCondition.clone(this, result);\n};\n\n/**\n * Determines if this distance display condition is equal to another.\n *\n * @param {DistanceDisplayCondition} other Another distance display condition.\n * @return {Boolean} Whether this distance display condition is equal to the other.\n */\nDistanceDisplayCondition.prototype.equals = function (other) {\n return DistanceDisplayCondition.equals(this, other);\n};\nexport default DistanceDisplayCondition;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.\n * @alias NearFarScalar\n * @constructor\n *\n * @param {Number} [near=0.0] The lower bound of the camera range.\n * @param {Number} [nearValue=0.0] The value at the lower bound of the camera range.\n * @param {Number} [far=1.0] The upper bound of the camera range.\n * @param {Number} [farValue=0.0] The value at the upper bound of the camera range.\n *\n * @see Packable\n */\nfunction NearFarScalar(near, nearValue, far, farValue) {\n /**\n * The lower bound of the camera range.\n * @type {Number}\n * @default 0.0\n */\n this.near = defaultValue(near, 0.0);\n /**\n * The value at the lower bound of the camera range.\n * @type {Number}\n * @default 0.0\n */\n this.nearValue = defaultValue(nearValue, 0.0);\n /**\n * The upper bound of the camera range.\n * @type {Number}\n * @default 1.0\n */\n this.far = defaultValue(far, 1.0);\n /**\n * The value at the upper bound of the camera range.\n * @type {Number}\n * @default 0.0\n */\n this.farValue = defaultValue(farValue, 0.0);\n}\n\n/**\n * Duplicates a NearFarScalar instance.\n *\n * @param {NearFarScalar} nearFarScalar The NearFarScalar to duplicate.\n * @param {NearFarScalar} [result] The object onto which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)\n */\nNearFarScalar.clone = function (nearFarScalar, result) {\n if (!defined(nearFarScalar)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new NearFarScalar(\n nearFarScalar.near,\n nearFarScalar.nearValue,\n nearFarScalar.far,\n nearFarScalar.farValue\n );\n }\n\n result.near = nearFarScalar.near;\n result.nearValue = nearFarScalar.nearValue;\n result.far = nearFarScalar.far;\n result.farValue = nearFarScalar.farValue;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nNearFarScalar.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {NearFarScalar} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nNearFarScalar.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.near;\n array[startingIndex++] = value.nearValue;\n array[startingIndex++] = value.far;\n array[startingIndex] = value.farValue;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {NearFarScalar} [result] The object into which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided.\n */\nNearFarScalar.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new NearFarScalar();\n }\n result.near = array[startingIndex++];\n result.nearValue = array[startingIndex++];\n result.far = array[startingIndex++];\n result.farValue = array[startingIndex];\n return result;\n};\n\n/**\n * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {NearFarScalar} [left] The first NearFarScalar.\n * @param {NearFarScalar} [right] The second NearFarScalar.\n * @returns {Boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nNearFarScalar.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.near === right.near &&\n left.nearValue === right.nearValue &&\n left.far === right.far &&\n left.farValue === right.farValue)\n );\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {NearFarScalar} [result] The object onto which to store the result.\n * @returns {NearFarScalar} The modified result parameter or a new NearFarScalar instance if one was not provided.\n */\nNearFarScalar.prototype.clone = function (result) {\n return NearFarScalar.clone(this, result);\n};\n\n/**\n * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,\n * <code>false</code> otherwise.\n *\n * @param {NearFarScalar} [right] The right hand side NearFarScalar.\n * @returns {Boolean} <code>true</code> if left and right are equal; otherwise <code>false</code>.\n */\nNearFarScalar.prototype.equals = function (right) {\n return NearFarScalar.equals(this, right);\n};\nexport default NearFarScalar;\n", "/**\n * Represents the position relative to the terrain.\n *\n * @enum {Number}\n */\nconst HeightReference = {\n /**\n * The position is absolute.\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * The position is clamped to the terrain.\n * @type {Number}\n * @constant\n */\n CLAMP_TO_GROUND: 1,\n\n /**\n * The position height is the height above the terrain.\n * @type {Number}\n * @constant\n */\n RELATIVE_TO_GROUND: 2,\n};\nexport default Object.freeze(HeightReference);\n", "/**\n * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}\n * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>\n * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)\n * of the anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n * </div>\n *\n * @enum {Number}\n *\n * @see Billboard#horizontalOrigin\n * @see Label#horizontalOrigin\n */\nconst HorizontalOrigin = {\n /**\n * The origin is at the horizontal center of the object.\n *\n * @type {Number}\n * @constant\n */\n CENTER: 0,\n\n /**\n * The origin is on the left side of the object.\n *\n * @type {Number}\n * @constant\n */\n LEFT: 1,\n\n /**\n * The origin is on the right side of the object.\n *\n * @type {Number}\n * @constant\n */\n RIGHT: -1,\n};\nexport default Object.freeze(HorizontalOrigin);\n", "/**\n * The vertical location of an origin relative to an object, e.g., a {@link Billboard}\n * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>\n * or <code>BOTTOM</code> will display a billboard above or below (in screen space)\n * the anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n * </div>\n *\n * @enum {Number}\n *\n * @see Billboard#verticalOrigin\n * @see Label#verticalOrigin\n */\nconst VerticalOrigin = {\n /**\n * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.\n *\n * @type {Number}\n * @constant\n */\n CENTER: 0,\n\n /**\n * The origin is at the bottom of the object.\n *\n * @type {Number}\n * @constant\n */\n BOTTOM: 1,\n\n /**\n * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.\n *\n * @type {Number}\n * @constant\n */\n BASELINE: 2,\n\n /**\n * The origin is at the top of the object.\n *\n * @type {Number}\n * @constant\n */\n TOP: -1,\n};\nexport default Object.freeze(VerticalOrigin);\n", "/**\n * The state of a BoundingSphere computation being performed by a {@link Visualizer}.\n * @enum {Number}\n * @private\n */\nconst BoundingSphereState = {\n /**\n * The BoundingSphere has been computed.\n * @type BoundingSphereState\n * @constant\n */\n DONE: 0,\n /**\n * The BoundingSphere is still being computed.\n * @type BoundingSphereState\n * @constant\n */\n PENDING: 1,\n /**\n * The BoundingSphere does not exist.\n * @type BoundingSphereState\n * @constant\n */\n FAILED: 2,\n};\nexport default Object.freeze(BoundingSphereState);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The interface for all properties, which represent a value that can optionally vary over time.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias Property\n * @constructor\n * @abstract\n *\n * @see CompositeProperty\n * @see ConstantProperty\n * @see SampledProperty\n * @see TimeIntervalCollectionProperty\n * @see MaterialProperty\n * @see PositionProperty\n * @see ReferenceProperty\n */\nfunction Property() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(Property.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof Property.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof Property.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Gets the value of the property at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\n/**\n * @private\n */\nProperty.equals = function (left, right) {\n return left === right || (defined(left) && left.equals(right));\n};\n\n/**\n * @private\n */\nProperty.arrayEquals = function (left, right) {\n if (left === right) {\n return true;\n }\n if (!defined(left) || !defined(right) || left.length !== right.length) {\n return false;\n }\n const length = left.length;\n for (let i = 0; i < length; i++) {\n if (!Property.equals(left[i], right[i])) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * @private\n */\nProperty.isConstant = function (property) {\n return !defined(property) || property.isConstant;\n};\n\n/**\n * @private\n */\nProperty.getValueOrUndefined = function (property, time, result) {\n return defined(property) ? property.getValue(time, result) : undefined;\n};\n\n/**\n * @private\n */\nProperty.getValueOrDefault = function (property, time, valueDefault, result) {\n return defined(property)\n ? defaultValue(property.getValue(time, result), valueDefault)\n : valueDefault;\n};\n\n/**\n * @private\n */\nProperty.getValueOrClonedDefault = function (\n property,\n time,\n valueDefault,\n result\n) {\n let value;\n if (defined(property)) {\n value = property.getValue(time, result);\n }\n if (!defined(value)) {\n value = valueDefault.clone(value);\n }\n return value;\n};\nexport default Property;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultEyeOffset = Cartesian3.ZERO;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultPixelOffset = Cartesian2.ZERO;\nconst defaultScale = 1.0;\nconst defaultRotation = 0.0;\nconst defaultAlignedAxis = Cartesian3.ZERO;\nconst defaultHorizontalOrigin = HorizontalOrigin.CENTER;\nconst defaultVerticalOrigin = VerticalOrigin.CENTER;\nconst defaultSizeInMeters = false;\n\nconst positionScratch = new Cartesian3();\nconst colorScratch = new Color();\nconst eyeOffsetScratch = new Cartesian3();\nconst pixelOffsetScratch = new Cartesian2();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst pixelOffsetScaleByDistanceScratch = new NearFarScalar();\nconst boundingRectangleScratch = new BoundingRectangle();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n this.entity = entity;\n this.billboard = undefined;\n this.textureValue = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.\n * @alias BillboardVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction BillboardVisualizer(entityCluster, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n BillboardVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._cluster = entityCluster;\n this._entityCollection = entityCollection;\n this._items = new AssociativeArray();\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nBillboardVisualizer.prototype.update = function (time) {\n const items = this._items.values;\n const cluster = this._cluster;\n\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const entity = item.entity;\n const billboardGraphics = entity._billboard;\n let textureValue;\n let billboard = item.billboard;\n let show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n Property.getValueOrDefault(billboardGraphics._show, time, true);\n let position;\n if (show) {\n position = Property.getValueOrUndefined(\n entity._position,\n time,\n positionScratch\n );\n textureValue = Property.getValueOrUndefined(\n billboardGraphics._image,\n time\n );\n show = defined(position) && defined(textureValue);\n }\n\n if (!show) {\n //don't bother creating or updating anything else\n returnPrimitive(item, entity, cluster);\n continue;\n }\n\n if (!Property.isConstant(entity._position)) {\n cluster._clusterDirty = true;\n }\n\n if (!defined(billboard)) {\n billboard = cluster.getBillboard(entity);\n billboard.id = entity;\n billboard.image = undefined;\n item.billboard = billboard;\n }\n\n billboard.show = show;\n if (!defined(billboard.image) || item.textureValue !== textureValue) {\n billboard.image = textureValue;\n item.textureValue = textureValue;\n }\n billboard.position = position;\n billboard.color = Property.getValueOrDefault(\n billboardGraphics._color,\n time,\n defaultColor,\n colorScratch\n );\n billboard.eyeOffset = Property.getValueOrDefault(\n billboardGraphics._eyeOffset,\n time,\n defaultEyeOffset,\n eyeOffsetScratch\n );\n billboard.heightReference = Property.getValueOrDefault(\n billboardGraphics._heightReference,\n time,\n defaultHeightReference\n );\n billboard.pixelOffset = Property.getValueOrDefault(\n billboardGraphics._pixelOffset,\n time,\n defaultPixelOffset,\n pixelOffsetScratch\n );\n billboard.scale = Property.getValueOrDefault(\n billboardGraphics._scale,\n time,\n defaultScale\n );\n billboard.rotation = Property.getValueOrDefault(\n billboardGraphics._rotation,\n time,\n defaultRotation\n );\n billboard.alignedAxis = Property.getValueOrDefault(\n billboardGraphics._alignedAxis,\n time,\n defaultAlignedAxis\n );\n billboard.horizontalOrigin = Property.getValueOrDefault(\n billboardGraphics._horizontalOrigin,\n time,\n defaultHorizontalOrigin\n );\n billboard.verticalOrigin = Property.getValueOrDefault(\n billboardGraphics._verticalOrigin,\n time,\n defaultVerticalOrigin\n );\n billboard.width = Property.getValueOrUndefined(\n billboardGraphics._width,\n time\n );\n billboard.height = Property.getValueOrUndefined(\n billboardGraphics._height,\n time\n );\n billboard.scaleByDistance = Property.getValueOrUndefined(\n billboardGraphics._scaleByDistance,\n time,\n scaleByDistanceScratch\n );\n billboard.translucencyByDistance = Property.getValueOrUndefined(\n billboardGraphics._translucencyByDistance,\n time,\n translucencyByDistanceScratch\n );\n billboard.pixelOffsetScaleByDistance = Property.getValueOrUndefined(\n billboardGraphics._pixelOffsetScaleByDistance,\n time,\n pixelOffsetScaleByDistanceScratch\n );\n billboard.sizeInMeters = Property.getValueOrDefault(\n billboardGraphics._sizeInMeters,\n time,\n defaultSizeInMeters\n );\n billboard.distanceDisplayCondition = Property.getValueOrUndefined(\n billboardGraphics._distanceDisplayCondition,\n time,\n distanceDisplayConditionScratch\n );\n billboard.disableDepthTestDistance = Property.getValueOrUndefined(\n billboardGraphics._disableDepthTestDistance,\n time\n );\n\n const subRegion = Property.getValueOrUndefined(\n billboardGraphics._imageSubRegion,\n time,\n boundingRectangleScratch\n );\n if (defined(subRegion)) {\n billboard.setImageSubRegion(billboard._imageId, subRegion);\n }\n }\n return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nBillboardVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const item = this._items.get(entity.id);\n if (!defined(item) || !defined(item.billboard)) {\n return BoundingSphereState.FAILED;\n }\n\n const billboard = item.billboard;\n if (billboard.heightReference === HeightReference.NONE) {\n result.center = Cartesian3.clone(billboard.position, result.center);\n } else {\n if (!defined(billboard._clampedPosition)) {\n return BoundingSphereState.PENDING;\n }\n result.center = Cartesian3.clone(billboard._clampedPosition, result.center);\n }\n result.radius = 0;\n return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nBillboardVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nBillboardVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n BillboardVisualizer.prototype._onCollectionChanged,\n this\n );\n const entities = this._entityCollection.values;\n for (let i = 0; i < entities.length; i++) {\n this._cluster.removeBillboard(entities[i]);\n }\n return destroyObject(this);\n};\n\nBillboardVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n const items = this._items;\n const cluster = this._cluster;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._billboard) && defined(entity._position)) {\n items.set(entity.id, new EntityData(entity));\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._billboard) && defined(entity._position)) {\n if (!items.contains(entity.id)) {\n items.set(entity.id, new EntityData(entity));\n }\n } else {\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n if (defined(item)) {\n item.billboard = undefined;\n cluster.removeBillboard(entity);\n }\n}\nexport default BillboardVisualizer;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Represents the closed interval [start, stop].\n * @alias Interval\n * @constructor\n *\n * @param {Number} [start=0.0] The beginning of the interval.\n * @param {Number} [stop=0.0] The end of the interval.\n */\nfunction Interval(start, stop) {\n /**\n * The beginning of the interval.\n * @type {Number}\n * @default 0.0\n */\n this.start = defaultValue(start, 0.0);\n /**\n * The end of the interval.\n * @type {Number}\n * @default 0.0\n */\n this.stop = defaultValue(stop, 0.0);\n}\nexport default Interval;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 3x3 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix3\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {Number} [column2Row0=0.0] The value for column 2, row 0.\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\n * @param {Number} [column2Row1=0.0] The value for column 2, row 1.\n * @param {Number} [column0Row2=0.0] The value for column 0, row 2.\n * @param {Number} [column1Row2=0.0] The value for column 1, row 2.\n * @param {Number} [column2Row2=0.0] The value for column 2, row 2.\n *\n * @see Matrix3.fromArray\n * @see Matrix3.fromColumnMajorArray\n * @see Matrix3.fromRowMajorArray\n * @see Matrix3.fromQuaternion\n * @see Matrix3.fromHeadingPitchRoll\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.fromCrossProduct\n * @see Matrix3.fromRotationX\n * @see Matrix3.fromRotationY\n * @see Matrix3.fromRotationZ\n * @see Matrix2\n * @see Matrix4\n */\nfunction Matrix3(\n column0Row0,\n column1Row0,\n column2Row0,\n column0Row1,\n column1Row1,\n column2Row1,\n column0Row2,\n column1Row2,\n column2Row2\n) {\n this[0] = defaultValue(column0Row0, 0.0);\n this[1] = defaultValue(column0Row1, 0.0);\n this[2] = defaultValue(column0Row2, 0.0);\n this[3] = defaultValue(column1Row0, 0.0);\n this[4] = defaultValue(column1Row1, 0.0);\n this[5] = defaultValue(column1Row2, 0.0);\n this[6] = defaultValue(column2Row0, 0.0);\n this[7] = defaultValue(column2Row1, 0.0);\n this[8] = defaultValue(column2Row2, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nMatrix3.packedLength = 9;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix3} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nMatrix3.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value[0];\n array[startingIndex++] = value[1];\n array[startingIndex++] = value[2];\n array[startingIndex++] = value[3];\n array[startingIndex++] = value[4];\n array[startingIndex++] = value[5];\n array[startingIndex++] = value[6];\n array[startingIndex++] = value[7];\n array[startingIndex++] = value[8];\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix3} [result] The object into which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Matrix3();\n }\n\n result[0] = array[startingIndex++];\n result[1] = array[startingIndex++];\n result[2] = array[startingIndex++];\n result[3] = array[startingIndex++];\n result[4] = array[startingIndex++];\n result[5] = array[startingIndex++];\n result[6] = array[startingIndex++];\n result[7] = array[startingIndex++];\n result[8] = array[startingIndex++];\n return result;\n};\n\n/**\n * Flattens an array of Matrix3s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix3[]} array The array of matrices to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.\n * @returns {Number[]} The packed array.\n */\nMatrix3.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 9;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Matrix3.pack(array[i], result, i * 9);\n }\n return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix3s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Matrix3[]} [result] The array onto which to store the result.\n * @returns {Matrix3[]} The unpacked array.\n */\nMatrix3.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 9);\n } else {\n result.length = length / 9;\n }\n\n for (let i = 0; i < length; i += 9) {\n const index = i / 9;\n result[index] = Matrix3.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Duplicates a Matrix3 instance.\n *\n * @param {Matrix3} matrix The matrix to duplicate.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix3.clone = function (matrix, result) {\n if (!defined(matrix)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Matrix3(\n matrix[0],\n matrix[3],\n matrix[6],\n matrix[1],\n matrix[4],\n matrix[7],\n matrix[2],\n matrix[5],\n matrix[8]\n );\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n return result;\n};\n\n/**\n * Creates a Matrix3 from 9 consecutive elements in an array.\n *\n * @function\n * @param {Number[]} array The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Create the Matrix3:\n * // [1.0, 2.0, 3.0]\n * // [1.0, 2.0, 3.0]\n * // [1.0, 2.0, 3.0]\n *\n * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\n * const m = Cesium.Matrix3.fromArray(v);\n *\n * // Create same Matrix3 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\n * const m2 = Cesium.Matrix3.fromArray(v2, 2);\n */\nMatrix3.fromArray = Matrix3.unpack;\n\n/**\n * Creates a Matrix3 instance from a column-major order array.\n *\n * @param {Number[]} values The column-major order array.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n */\nMatrix3.fromColumnMajorArray = function (values, result) {\n return Matrix3.clone(values, result);\n};\n\n/**\n * Creates a Matrix3 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {Number[]} values The row-major order array.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n */\nMatrix3.fromRowMajorArray = function (values, result) {\n if (!defined(result)) {\n return new Matrix3(\n values[0],\n values[1],\n values[2],\n values[3],\n values[4],\n values[5],\n values[6],\n values[7],\n values[8]\n );\n }\n result[0] = values[0];\n result[1] = values[3];\n result[2] = values[6];\n result[3] = values[1];\n result[4] = values[4];\n result[5] = values[7];\n result[6] = values[2];\n result[7] = values[5];\n result[8] = values[8];\n return result;\n};\n\n/**\n * Computes a 3x3 rotation matrix from the provided quaternion.\n *\n * @param {Quaternion} quaternion the quaternion to use.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The 3x3 rotation matrix from this quaternion.\n */\nMatrix3.fromQuaternion = function (quaternion, result) {\n const x2 = quaternion.x * quaternion.x;\n const xy = quaternion.x * quaternion.y;\n const xz = quaternion.x * quaternion.z;\n const xw = quaternion.x * quaternion.w;\n const y2 = quaternion.y * quaternion.y;\n const yz = quaternion.y * quaternion.z;\n const yw = quaternion.y * quaternion.w;\n const z2 = quaternion.z * quaternion.z;\n const zw = quaternion.z * quaternion.w;\n const w2 = quaternion.w * quaternion.w;\n\n const m00 = x2 - y2 - z2 + w2;\n const m01 = 2.0 * (xy - zw);\n const m02 = 2.0 * (xz + yw);\n\n const m10 = 2.0 * (xy + zw);\n const m11 = -x2 + y2 - z2 + w2;\n const m12 = 2.0 * (yz - xw);\n\n const m20 = 2.0 * (xz - yw);\n const m21 = 2.0 * (yz + xw);\n const m22 = -x2 - y2 + z2 + w2;\n\n if (!defined(result)) {\n return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\n }\n result[0] = m00;\n result[1] = m10;\n result[2] = m20;\n result[3] = m01;\n result[4] = m11;\n result[5] = m21;\n result[6] = m02;\n result[7] = m12;\n result[8] = m22;\n return result;\n};\n\n/**\n * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\n *\n * @param {HeadingPitchRoll} headingPitchRoll the headingPitchRoll to use.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll.\n */\nMatrix3.fromHeadingPitchRoll = function (headingPitchRoll, result) {\n const cosTheta = Math.cos(-headingPitchRoll.pitch);\n const cosPsi = Math.cos(-headingPitchRoll.heading);\n const cosPhi = Math.cos(headingPitchRoll.roll);\n const sinTheta = Math.sin(-headingPitchRoll.pitch);\n const sinPsi = Math.sin(-headingPitchRoll.heading);\n const sinPhi = Math.sin(headingPitchRoll.roll);\n\n const m00 = cosTheta * cosPsi;\n const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;\n const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;\n\n const m10 = cosTheta * sinPsi;\n const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;\n const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;\n\n const m20 = -sinTheta;\n const m21 = sinPhi * cosTheta;\n const m22 = cosPhi * cosTheta;\n\n if (!defined(result)) {\n return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\n }\n result[0] = m00;\n result[1] = m10;\n result[2] = m20;\n result[3] = m01;\n result[4] = m11;\n result[5] = m21;\n result[6] = m02;\n result[7] = m12;\n result[8] = m22;\n return result;\n};\n\n/**\n * Computes a Matrix3 instance representing a non-uniform scale.\n *\n * @param {Cartesian3} scale The x, y, and z scale factors.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [7.0, 0.0, 0.0]\n * // [0.0, 8.0, 0.0]\n * // [0.0, 0.0, 9.0]\n * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix3.fromScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix3(scale.x, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, scale.z);\n }\n\n result[0] = scale.x;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = scale.y;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = scale.z;\n return result;\n};\n\n/**\n * Computes a Matrix3 instance representing a uniform scale.\n *\n * @param {Number} scale The uniform scale factor.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [2.0, 0.0, 0.0]\n * // [0.0, 2.0, 0.0]\n * // [0.0, 0.0, 2.0]\n * const m = Cesium.Matrix3.fromUniformScale(2.0);\n */\nMatrix3.fromUniformScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix3(scale, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, scale);\n }\n\n result[0] = scale;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = scale;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = scale;\n return result;\n};\n\n/**\n * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.\n *\n * @param {Cartesian3} vector the vector on the left hand side of the cross product operation.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [0.0, -9.0, 8.0]\n * // [9.0, 0.0, -7.0]\n * // [-8.0, 7.0, 0.0]\n * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix3.fromCrossProduct = function (vector, result) {\n if (!defined(result)) {\n return new Matrix3(\n 0.0,\n -vector.z,\n vector.y,\n vector.z,\n 0.0,\n -vector.x,\n -vector.y,\n vector.x,\n 0.0\n );\n }\n\n result[0] = 0.0;\n result[1] = vector.z;\n result[2] = -vector.y;\n result[3] = -vector.z;\n result[4] = 0.0;\n result[5] = vector.x;\n result[6] = vector.y;\n result[7] = -vector.x;\n result[8] = 0.0;\n return result;\n};\n\n/**\n * Creates a rotation matrix around the x-axis.\n *\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the x-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationX = function (angle, result) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n\n if (!defined(result)) {\n return new Matrix3(\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n cosAngle,\n -sinAngle,\n 0.0,\n sinAngle,\n cosAngle\n );\n }\n\n result[0] = 1.0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = cosAngle;\n result[5] = sinAngle;\n result[6] = 0.0;\n result[7] = -sinAngle;\n result[8] = cosAngle;\n\n return result;\n};\n\n/**\n * Creates a rotation matrix around the y-axis.\n *\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the y-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationY = function (angle, result) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n\n if (!defined(result)) {\n return new Matrix3(\n cosAngle,\n 0.0,\n sinAngle,\n 0.0,\n 1.0,\n 0.0,\n -sinAngle,\n 0.0,\n cosAngle\n );\n }\n\n result[0] = cosAngle;\n result[1] = 0.0;\n result[2] = -sinAngle;\n result[3] = 0.0;\n result[4] = 1.0;\n result[5] = 0.0;\n result[6] = sinAngle;\n result[7] = 0.0;\n result[8] = cosAngle;\n\n return result;\n};\n\n/**\n * Creates a rotation matrix around the z-axis.\n *\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise around the z-axis.\n * const p = new Cesium.Cartesian3(5, 6, 7);\n * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\n */\nMatrix3.fromRotationZ = function (angle, result) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n\n if (!defined(result)) {\n return new Matrix3(\n cosAngle,\n -sinAngle,\n 0.0,\n sinAngle,\n cosAngle,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n\n result[0] = cosAngle;\n result[1] = sinAngle;\n result[2] = 0.0;\n result[3] = -sinAngle;\n result[4] = cosAngle;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 1.0;\n\n return result;\n};\n\n/**\n * Creates an Array from the provided Matrix3 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix3} matrix The matrix to use..\n * @param {Number[]} [result] The Array onto which to store the result.\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\n */\nMatrix3.toArray = function (matrix, result) {\n if (!defined(result)) {\n return [\n matrix[0],\n matrix[1],\n matrix[2],\n matrix[3],\n matrix[4],\n matrix[5],\n matrix[6],\n matrix[7],\n matrix[8],\n ];\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {Number} column The zero-based index of the column.\n * @param {Number} row The zero-based index of the row.\n * @returns {Number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0, 1, or 2.\n * @exception {DeveloperError} column must be 0, 1, or 2.\n *\n * @example\n * const myMatrix = new Cesium.Matrix3();\n * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index]\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix3.getElementIndex = function (column, row) {\n return column * 3 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to retrieve.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.getColumn = function (matrix, index, result) {\n const startIndex = index * 3;\n const x = matrix[startIndex];\n const y = matrix[startIndex + 1];\n const z = matrix[startIndex + 2];\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to set.\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.setColumn = function (matrix, index, cartesian, result) {\n result = Matrix3.clone(matrix, result);\n const startIndex = index * 3;\n result[startIndex] = cartesian.x;\n result[startIndex + 1] = cartesian.y;\n result[startIndex + 2] = cartesian.z;\n return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to retrieve.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.getRow = function (matrix, index, result) {\n const x = matrix[index];\n const y = matrix[index + 3];\n const z = matrix[index + 6];\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to set.\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, or 2.\n */\nMatrix3.setRow = function (matrix, index, cartesian, result) {\n result = Matrix3.clone(matrix, result);\n result[index] = cartesian.x;\n result[index + 3] = cartesian.y;\n result[index + 6] = cartesian.z;\n return result;\n};\n\nconst scaleScratch1 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.setScale = function (matrix, scale, result) {\n const existingScale = Matrix3.getScale(matrix, scaleScratch1);\n const scaleRatioX = scale.x / existingScale.x;\n const scaleRatioY = scale.y / existingScale.y;\n const scaleRatioZ = scale.z / existingScale.z;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioX;\n result[3] = matrix[3] * scaleRatioY;\n result[4] = matrix[4] * scaleRatioY;\n result[5] = matrix[5] * scaleRatioY;\n result[6] = matrix[6] * scaleRatioZ;\n result[7] = matrix[7] * scaleRatioZ;\n result[8] = matrix[8] * scaleRatioZ;\n\n return result;\n};\n\nconst scaleScratch2 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.setUniformScale = function (matrix, scale, result) {\n const existingScale = Matrix3.getScale(matrix, scaleScratch2);\n const scaleRatioX = scale / existingScale.x;\n const scaleRatioY = scale / existingScale.y;\n const scaleRatioZ = scale / existingScale.z;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioX;\n result[3] = matrix[3] * scaleRatioY;\n result[4] = matrix[4] * scaleRatioY;\n result[5] = matrix[5] * scaleRatioY;\n result[6] = matrix[6] * scaleRatioZ;\n result[7] = matrix[7] * scaleRatioZ;\n result[8] = matrix[8] * scaleRatioZ;\n\n return result;\n};\n\nconst scratchColumn = new Cartesian3();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @see Matrix3.multiplyByScale\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n */\nMatrix3.getScale = function (matrix, result) {\n result.x = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\n );\n result.y = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)\n );\n result.z = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)\n );\n return result;\n};\n\nconst scaleScratch3 = new Cartesian3();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors.\n *\n * @param {Matrix3} matrix The matrix.\n * @returns {Number} The maximum scale.\n */\nMatrix3.getMaximumScale = function (matrix) {\n Matrix3.getScale(matrix, scaleScratch3);\n return Cartesian3.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian3();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Matrix3} rotation The rotation matrix.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.getRotation\n */\nMatrix3.setRotation = function (matrix, rotation, result) {\n const scale = Matrix3.getScale(matrix, scaleScratch4);\n\n result[0] = rotation[0] * scale.x;\n result[1] = rotation[1] * scale.x;\n result[2] = rotation[2] * scale.x;\n result[3] = rotation[3] * scale.y;\n result[4] = rotation[4] * scale.y;\n result[5] = rotation[5] * scale.y;\n result[6] = rotation[6] * scale.z;\n result[7] = rotation[7] * scale.z;\n result[8] = rotation[8] * scale.z;\n\n return result;\n};\n\nconst scaleScratch5 = new Cartesian3();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix3.setRotation\n */\nMatrix3.getRotation = function (matrix, result) {\n const scale = Matrix3.getScale(matrix, scaleScratch5);\n\n result[0] = matrix[0] / scale.x;\n result[1] = matrix[1] / scale.x;\n result[2] = matrix[2] / scale.x;\n result[3] = matrix[3] / scale.y;\n result[4] = matrix[4] / scale.y;\n result[5] = matrix[5] / scale.y;\n result[6] = matrix[6] / scale.z;\n result[7] = matrix[7] / scale.z;\n result[8] = matrix[8] / scale.z;\n\n return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.multiply = function (left, right, result) {\n const column0Row0 =\n left[0] * right[0] + left[3] * right[1] + left[6] * right[2];\n const column0Row1 =\n left[1] * right[0] + left[4] * right[1] + left[7] * right[2];\n const column0Row2 =\n left[2] * right[0] + left[5] * right[1] + left[8] * right[2];\n\n const column1Row0 =\n left[0] * right[3] + left[3] * right[4] + left[6] * right[5];\n const column1Row1 =\n left[1] * right[3] + left[4] * right[4] + left[7] * right[5];\n const column1Row2 =\n left[2] * right[3] + left[5] * right[4] + left[8] * right[5];\n\n const column2Row0 =\n left[0] * right[6] + left[3] * right[7] + left[6] * right[8];\n const column2Row1 =\n left[1] * right[6] + left[4] * right[7] + left[7] * right[8];\n const column2Row2 =\n left[2] * right[6] + left[5] * right[7] + left[8] * right[8];\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = column1Row0;\n result[4] = column1Row1;\n result[5] = column1Row2;\n result[6] = column2Row0;\n result[7] = column2Row1;\n result[8] = column2Row2;\n return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.add = function (left, right, result) {\n result[0] = left[0] + right[0];\n result[1] = left[1] + right[1];\n result[2] = left[2] + right[2];\n result[3] = left[3] + right[3];\n result[4] = left[4] + right[4];\n result[5] = left[5] + right[5];\n result[6] = left[6] + right[6];\n result[7] = left[7] + right[7];\n result[8] = left[8] + right[8];\n return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix3} left The first matrix.\n * @param {Matrix3} right The second matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.subtract = function (left, right, result) {\n result[0] = left[0] - right[0];\n result[1] = left[1] - right[1];\n result[2] = left[2] - right[2];\n result[3] = left[3] - right[3];\n result[4] = left[4] - right[4];\n result[5] = left[5] - right[5];\n result[6] = left[6] - right[6];\n result[7] = left[7] - right[7];\n result[8] = left[8] - right[8];\n return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Cartesian3} cartesian The column.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix3.multiplyByVector = function (matrix, cartesian, result) {\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;\n const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;\n const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix3} matrix The matrix.\n * @param {Number} scalar The number to multiply by.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.multiplyByScalar = function (matrix, scalar, result) {\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n result[4] = matrix[4] * scalar;\n result[5] = matrix[5] * scalar;\n result[6] = matrix[6] * scalar;\n result[7] = matrix[7] * scalar;\n result[8] = matrix[8] * scalar;\n return result;\n};\n\n/**\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\n *\n * @param {Matrix3} matrix The matrix on the left-hand side.\n * @param {Number} scale The non-uniform scale on the right-hand side.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);\n * Cesium.Matrix3.multiplyByScale(m, scale, m);\n *\n * @see Matrix3.multiplyByUniformScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.multiplyByScale = function (matrix, scale, result) {\n result[0] = matrix[0] * scale.x;\n result[1] = matrix[1] * scale.x;\n result[2] = matrix[2] * scale.x;\n result[3] = matrix[3] * scale.y;\n result[4] = matrix[4] * scale.y;\n result[5] = matrix[5] * scale.y;\n result[6] = matrix[6] * scale.z;\n result[7] = matrix[7] * scale.z;\n result[8] = matrix[8] * scale.z;\n\n return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix3} matrix The matrix on the left-hand side.\n * @param {Number} scale The uniform scale on the right-hand side.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);\n * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix3.multiplyByScale\n * @see Matrix3.fromScale\n * @see Matrix3.fromUniformScale\n * @see Matrix3.setScale\n * @see Matrix3.setUniformScale\n * @see Matrix3.getScale\n */\nMatrix3.multiplyByUniformScale = function (matrix, scale, result) {\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3] * scale;\n result[4] = matrix[4] * scale;\n result[5] = matrix[5] * scale;\n result[6] = matrix[6] * scale;\n result[7] = matrix[7] * scale;\n result[8] = matrix[8] * scale;\n\n return result;\n};\n\n/**\n * Creates a negated copy of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to negate.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.negate = function (matrix, result) {\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n result[4] = -matrix[4];\n result[5] = -matrix[5];\n result[6] = -matrix[6];\n result[7] = -matrix[7];\n result[8] = -matrix[8];\n return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.transpose = function (matrix, result) {\n const column0Row0 = matrix[0];\n const column0Row1 = matrix[3];\n const column0Row2 = matrix[6];\n const column1Row0 = matrix[1];\n const column1Row1 = matrix[4];\n const column1Row2 = matrix[7];\n const column2Row0 = matrix[2];\n const column2Row1 = matrix[5];\n const column2Row2 = matrix[8];\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = column1Row0;\n result[4] = column1Row1;\n result[5] = column1Row2;\n result[6] = column2Row0;\n result[7] = column2Row1;\n result[8] = column2Row2;\n return result;\n};\n\nfunction computeFrobeniusNorm(matrix) {\n let norm = 0.0;\n for (let i = 0; i < 9; ++i) {\n const temp = matrix[i];\n norm += temp * temp;\n }\n\n return Math.sqrt(norm);\n}\n\nconst rowVal = [1, 0, 0];\nconst colVal = [2, 2, 1];\n\nfunction offDiagonalFrobeniusNorm(matrix) {\n // Computes the \"off-diagonal\" Frobenius norm.\n // Assumes matrix is symmetric.\n\n let norm = 0.0;\n for (let i = 0; i < 3; ++i) {\n const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];\n norm += 2.0 * temp * temp;\n }\n\n return Math.sqrt(norm);\n}\n\nfunction shurDecomposition(matrix, result) {\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n // section 8.4.2 The 2by2 Symmetric Schur Decomposition.\n //\n // The routine takes a matrix, which is assumed to be symmetric, and\n // finds the largest off-diagonal term, and then creates\n // a matrix (result) which can be used to help reduce it\n\n const tolerance = CesiumMath.EPSILON15;\n\n let maxDiagonal = 0.0;\n let rotAxis = 1;\n\n // find pivot (rotAxis) based on max diagonal of matrix\n for (let i = 0; i < 3; ++i) {\n const temp = Math.abs(\n matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]\n );\n if (temp > maxDiagonal) {\n rotAxis = i;\n maxDiagonal = temp;\n }\n }\n\n let c = 1.0;\n let s = 0.0;\n\n const p = rowVal[rotAxis];\n const q = colVal[rotAxis];\n\n if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {\n const qq = matrix[Matrix3.getElementIndex(q, q)];\n const pp = matrix[Matrix3.getElementIndex(p, p)];\n const qp = matrix[Matrix3.getElementIndex(q, p)];\n\n const tau = (qq - pp) / 2.0 / qp;\n let t;\n\n if (tau < 0.0) {\n t = -1.0 / (-tau + Math.sqrt(1.0 + tau * tau));\n } else {\n t = 1.0 / (tau + Math.sqrt(1.0 + tau * tau));\n }\n\n c = 1.0 / Math.sqrt(1.0 + t * t);\n s = t * c;\n }\n\n result = Matrix3.clone(Matrix3.IDENTITY, result);\n\n result[Matrix3.getElementIndex(p, p)] = result[\n Matrix3.getElementIndex(q, q)\n ] = c;\n result[Matrix3.getElementIndex(q, p)] = s;\n result[Matrix3.getElementIndex(p, q)] = -s;\n\n return result;\n}\n\nconst jMatrix = new Matrix3();\nconst jMatrixTranspose = new Matrix3();\n\n/**\n * Computes the eigenvectors and eigenvalues of a symmetric matrix.\n * <p>\n * Returns a diagonal matrix and unitary matrix such that:\n * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>\n * </p>\n * <p>\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\n * of the unitary matrix are the corresponding eigenvectors.\n * </p>\n *\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\n * @param {Object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\n * @returns {Object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\n *\n * @example\n * const a = //... symetric matrix\n * const result = {\n * unitary : new Cesium.Matrix3(),\n * diagonal : new Cesium.Matrix3()\n * };\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\n *\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\n *\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)\n */\nMatrix3.computeEigenDecomposition = function (matrix, result) {\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\n // section 8.4.3 The Classical Jacobi Algorithm\n\n const tolerance = CesiumMath.EPSILON20;\n const maxSweeps = 10;\n\n let count = 0;\n let sweep = 0;\n\n if (!defined(result)) {\n result = {};\n }\n\n const unitaryMatrix = (result.unitary = Matrix3.clone(\n Matrix3.IDENTITY,\n result.unitary\n ));\n const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));\n\n const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);\n\n while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {\n shurDecomposition(diagMatrix, jMatrix);\n Matrix3.transpose(jMatrix, jMatrixTranspose);\n Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);\n Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);\n Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);\n\n if (++count > 2) {\n ++sweep;\n count = 0;\n }\n }\n\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix3} matrix The matrix with signed elements.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.abs = function (matrix, result) {\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n\n return result;\n};\n\n/**\n * Computes the determinant of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to use.\n * @returns {Number} The value of the determinant of the matrix.\n */\nMatrix3.determinant = function (matrix) {\n const m11 = matrix[0];\n const m21 = matrix[3];\n const m31 = matrix[6];\n const m12 = matrix[1];\n const m22 = matrix[4];\n const m32 = matrix[7];\n const m13 = matrix[2];\n const m23 = matrix[5];\n const m33 = matrix[8];\n\n return (\n m11 * (m22 * m33 - m23 * m32) +\n m12 * (m23 * m31 - m21 * m33) +\n m13 * (m21 * m32 - m22 * m31)\n );\n};\n\n/**\n * Computes the inverse of the provided matrix.\n *\n * @param {Matrix3} matrix The matrix to invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @exception {DeveloperError} matrix is not invertible.\n */\nMatrix3.inverse = function (matrix, result) {\n const m11 = matrix[0];\n const m21 = matrix[1];\n const m31 = matrix[2];\n const m12 = matrix[3];\n const m22 = matrix[4];\n const m32 = matrix[5];\n const m13 = matrix[6];\n const m23 = matrix[7];\n const m33 = matrix[8];\n\n const determinant = Matrix3.determinant(matrix);\n\n result[0] = m22 * m33 - m23 * m32;\n result[1] = m23 * m31 - m21 * m33;\n result[2] = m21 * m32 - m22 * m31;\n result[3] = m13 * m32 - m12 * m33;\n result[4] = m11 * m33 - m13 * m31;\n result[5] = m12 * m31 - m11 * m32;\n result[6] = m12 * m23 - m13 * m22;\n result[7] = m13 * m21 - m11 * m23;\n result[8] = m11 * m22 - m12 * m21;\n\n const scale = 1.0 / determinant;\n return Matrix3.multiplyByScalar(result, scale, result);\n};\n\nconst scratchTransposeMatrix = new Matrix3();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix3} matrix The matrix to transpose and invert.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n */\nMatrix3.inverseTranspose = function (matrix, result) {\n return Matrix3.inverse(\n Matrix3.transpose(matrix, scratchTransposeMatrix),\n result\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMatrix3.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[3] === right[3] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[7] === right[7] &&\n left[8] === right[8])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix3} [left] The first matrix.\n * @param {Matrix3} [right] The second matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix3.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon)\n );\n};\n\n/**\n * An immutable Matrix3 instance initialized to the identity matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.IDENTITY = Object.freeze(\n new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)\n);\n\n/**\n * An immutable Matrix3 instance initialized to the zero matrix.\n *\n * @type {Matrix3}\n * @constant\n */\nMatrix3.ZERO = Object.freeze(\n new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\n);\n\n/**\n * The index into Matrix3 for column 0, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix3 for column 0, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix3 for column 0, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix3 for column 1, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN1ROW0 = 3;\n\n/**\n * The index into Matrix3 for column 1, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN1ROW1 = 4;\n\n/**\n * The index into Matrix3 for column 1, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN1ROW2 = 5;\n\n/**\n * The index into Matrix3 for column 2, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN2ROW0 = 6;\n\n/**\n * The index into Matrix3 for column 2, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN2ROW1 = 7;\n\n/**\n * The index into Matrix3 for column 2, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix3.COLUMN2ROW2 = 8;\n\nObject.defineProperties(Matrix3.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix3.prototype\n *\n * @type {Number}\n */\n length: {\n get: function () {\n return Matrix3.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix3 instance.\n *\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\n */\nMatrix3.prototype.clone = function (result) {\n return Matrix3.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix3.prototype.equals = function (right) {\n return Matrix3.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix3.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix3} [right] The right hand side matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix3.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix3.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2)'.\n *\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\n */\nMatrix3.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[3]}, ${this[6]})\\n` +\n `(${this[1]}, ${this[4]}, ${this[7]})\\n` +\n `(${this[2]}, ${this[5]}, ${this[8]})`\n );\n};\nexport default Matrix3;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A 4D Cartesian point.\n * @alias Cartesian4\n * @constructor\n *\n * @param {Number} [x=0.0] The X component.\n * @param {Number} [y=0.0] The Y component.\n * @param {Number} [z=0.0] The Z component.\n * @param {Number} [w=0.0] The W component.\n *\n * @see Cartesian2\n * @see Cartesian3\n * @see Packable\n */\nfunction Cartesian4(x, y, z, w) {\n /**\n * The X component.\n * @type {Number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {Number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The Z component.\n * @type {Number}\n * @default 0.0\n */\n this.z = defaultValue(z, 0.0);\n\n /**\n * The W component.\n * @type {Number}\n * @default 0.0\n */\n this.w = defaultValue(w, 0.0);\n}\n\n/**\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\n *\n * @param {Number} x The x coordinate.\n * @param {Number} y The y coordinate.\n * @param {Number} z The z coordinate.\n * @param {Number} w The w coordinate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromElements = function (x, y, z, w, result) {\n if (!defined(result)) {\n return new Cartesian4(x, y, z, w);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,\n * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.\n *\n * @param {Color} color The source color.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.fromColor = function (color, result) {\nif (!defined(result)) {\n return new Cartesian4(color.red, color.green, color.blue, color.alpha);\n }\n\n result.x = color.red;\n result.y = color.green;\n result.z = color.blue;\n result.w = color.alpha;\n return result;\n};\n\n/**\n * Duplicates a Cartesian4 instance.\n *\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\n */\nCartesian4.clone = function (cartesian, result) {\n if (!defined(cartesian)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n }\n\n result.x = cartesian.x;\n result.y = cartesian.y;\n result.z = cartesian.z;\n result.w = cartesian.w;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCartesian4.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Cartesian4} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCartesian4.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Cartesian4} [result] The object into which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Cartesian4();\n }\n result.x = array[startingIndex++];\n result.y = array[startingIndex++];\n result.z = array[startingIndex++];\n result.w = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Cartesian4s into an array of components.\n *\n * @param {Cartesian4[]} array The array of cartesians to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\n * @returns {Number[]} The packed array.\n */\nCartesian4.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 4;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Cartesian4.pack(array[i], result, i * 4);\n }\n return result;\n};\n\n/**\n * Unpacks an array of cartesian components into an array of Cartesian4s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Cartesian4[]} [result] The array onto which to store the result.\n * @returns {Cartesian4[]} The unpacked array.\n */\nCartesian4.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 4);\n } else {\n result.length = length / 4;\n }\n\n for (let i = 0; i < length; i += 4) {\n const index = i / 4;\n result[index] = Cartesian4.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Creates a Cartesian4 from four consecutive elements in an array.\n * @function\n *\n * @param {Number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n *\n * @example\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\n * const v = [1.0, 2.0, 3.0, 4.0];\n * const p = Cesium.Cartesian4.fromArray(v);\n *\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\n */\nCartesian4.fromArray = Cartesian4.unpack;\n\n/**\n * Computes the value of the maximum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {Number} The value of the maximum component.\n */\nCartesian4.maximumComponent = function (cartesian) {\n return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Computes the value of the minimum component for the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The cartesian to use.\n * @returns {Number} The value of the minimum component.\n */\nCartesian4.minimumComponent = function (cartesian) {\n return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the minimum components.\n */\nCartesian4.minimumByComponent = function (first, second, result) {\n result.x = Math.min(first.x, second.x);\n result.y = Math.min(first.y, second.y);\n result.z = Math.min(first.z, second.z);\n result.w = Math.min(first.w, second.w);\n\n return result;\n};\n\n/**\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\n *\n * @param {Cartesian4} first A cartesian to compare.\n * @param {Cartesian4} second A cartesian to compare.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} A cartesian with the maximum components.\n */\nCartesian4.maximumByComponent = function (first, second, result) {\n result.x = Math.max(first.x, second.x);\n result.y = Math.max(first.y, second.y);\n result.z = Math.max(first.z, second.z);\n result.w = Math.max(first.w, second.w);\n\n return result;\n};\n\n/**\n * Constrain a value to lie between two values.\n *\n * @param {Cartesian4} value The value to clamp.\n * @param {Cartesian4} min The minimum bound.\n * @param {Cartesian4} max The maximum bound.\n * @param {Cartesian4} result The object into which to store the result.\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\n */\nCartesian4.clamp = function (value, min, max, result) {\n const x = CesiumMath.clamp(value.x, min.x, max.x);\n const y = CesiumMath.clamp(value.y, min.y, max.y);\n const z = CesiumMath.clamp(value.z, min.z, max.z);\n const w = CesiumMath.clamp(value.w, min.w, max.w);\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n\n return result;\n};\n\n/**\n * Computes the provided Cartesian's squared magnitude.\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\n * @returns {Number} The squared magnitude.\n */\nCartesian4.magnitudeSquared = function (cartesian) {\n return (\n cartesian.x * cartesian.x +\n cartesian.y * cartesian.y +\n cartesian.z * cartesian.z +\n cartesian.w * cartesian.w\n );\n};\n\n/**\n * Computes the Cartesian's magnitude (length).\n *\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\n * @returns {Number} The magnitude.\n */\nCartesian4.magnitude = function (cartesian) {\n return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));\n};\n\nconst distanceScratch = new Cartesian4();\n\n/**\n * Computes the 4-space distance between two points.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 1.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distance = function (left, right) {\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitude(distanceScratch);\n};\n\n/**\n * Computes the squared distance between two points. Comparing squared distances\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\n *\n * @param {Cartesian4} left The first point to compute the distance from.\n * @param {Cartesian4} right The second point to compute the distance to.\n * @returns {Number} The distance between two points.\n *\n * @example\n * // Returns 4.0, not 2.0\n * const d = Cesium.Cartesian4.distance(\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\n * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\n */\nCartesian4.distanceSquared = function (left, right) {\n Cartesian4.subtract(left, right, distanceScratch);\n return Cartesian4.magnitudeSquared(distanceScratch);\n};\n\n/**\n * Computes the normalized form of the supplied Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.normalize = function (cartesian, result) {\n const magnitude = Cartesian4.magnitude(cartesian);\n\n result.x = cartesian.x / magnitude;\n result.y = cartesian.y / magnitude;\n result.z = cartesian.z / magnitude;\n result.w = cartesian.w / magnitude;\n\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @returns {Number} The dot product.\n */\nCartesian4.dot = function (left, right) {\n return (\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n );\n};\n\n/**\n * Computes the componentwise product of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyComponents = function (left, right, result) {\n result.x = left.x * right.x;\n result.y = left.y * right.y;\n result.z = left.z * right.z;\n result.w = left.w * right.w;\n return result;\n};\n\n/**\n * Computes the componentwise quotient of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideComponents = function (left, right, result) {\n result.x = left.x / right.x;\n result.y = left.y / right.y;\n result.z = left.z / right.z;\n result.w = left.w / right.w;\n return result;\n};\n\n/**\n * Computes the componentwise sum of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.add = function (left, right, result) {\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two Cartesians.\n *\n * @param {Cartesian4} left The first Cartesian.\n * @param {Cartesian4} right The second Cartesian.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.subtract = function (left, right, result) {\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n\n/**\n * Multiplies the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\n * @param {Number} scalar The scalar to multiply with.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.multiplyByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x * scalar;\n result.y = cartesian.y * scalar;\n result.z = cartesian.z * scalar;\n result.w = cartesian.w * scalar;\n return result;\n};\n\n/**\n * Divides the provided Cartesian componentwise by the provided scalar.\n *\n * @param {Cartesian4} cartesian The Cartesian to be divided.\n * @param {Number} scalar The scalar to divide by.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.divideByScalar = function (cartesian, scalar, result) {\n result.x = cartesian.x / scalar;\n result.y = cartesian.y / scalar;\n result.z = cartesian.z / scalar;\n result.w = cartesian.w / scalar;\n return result;\n};\n\n/**\n * Negates the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian to be negated.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.negate = function (cartesian, result) {\n result.x = -cartesian.x;\n result.y = -cartesian.y;\n result.z = -cartesian.z;\n result.w = -cartesian.w;\n return result;\n};\n\n/**\n * Computes the absolute value of the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.abs = function (cartesian, result) {\n result.x = Math.abs(cartesian.x);\n result.y = Math.abs(cartesian.y);\n result.z = Math.abs(cartesian.z);\n result.w = Math.abs(cartesian.w);\n return result;\n};\n\nconst lerpScratch = new Cartesian4();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\n *\n * @param {Cartesian4} start The value corresponding to t at 0.0.\n * @param {Cartesian4}end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nCartesian4.lerp = function (start, end, t, result) {\n Cartesian4.multiplyByScalar(end, t, lerpScratch);\n result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);\n return Cartesian4.add(lerpScratch, result, result);\n};\n\nconst mostOrthogonalAxisScratch = new Cartesian4();\n/**\n * Returns the axis that is most orthogonal to the provided Cartesian.\n *\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The most orthogonal axis.\n */\nCartesian4.mostOrthogonalAxis = function (cartesian, result) {\n const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);\n Cartesian4.abs(f, f);\n\n if (f.x <= f.y) {\n if (f.x <= f.z) {\n if (f.x <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_X, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.y <= f.z) {\n if (f.y <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Y, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n } else if (f.z <= f.w) {\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\n } else {\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\n }\n\n return result;\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCartesian4.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * @private\n */\nCartesian4.equalsArray = function (cartesian, array, offset) {\n return (\n cartesian.x === array[offset] &&\n cartesian.y === array[offset + 1] &&\n cartesian.z === array[offset + 2] &&\n cartesian.w === array[offset + 3]\n );\n};\n\n/**\n * Compares the provided Cartesians componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian4} [left] The first Cartesian.\n * @param {Cartesian4} [right] The second Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian4.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.x,\n right.x,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.y,\n right.y,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.z,\n right.z,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.w,\n right.w,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));\n\n/**\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Cartesian4}\n * @constant\n */\nCartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Cartesian4 instance.\n *\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\n */\nCartesian4.prototype.clone = function (result) {\n return Cartesian4.clone(this, result);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nCartesian4.prototype.equals = function (right) {\n return Cartesian4.equals(this, right);\n};\n\n/**\n * Compares this Cartesian against the provided Cartesian componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {Cartesian4} [right] The right hand side Cartesian.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nCartesian4.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return Cartesian4.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon\n );\n};\n\n/**\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\n *\n * @returns {String} A string representing the provided Cartesian in the format '(x, y, z, w)'.\n */\nCartesian4.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\n\n// scratchU8Array and scratchF32Array are views into the same buffer\nconst scratchF32Array = new Float32Array(1);\nconst scratchU8Array = new Uint8Array(scratchF32Array.buffer);\n\nconst testU32 = new Uint32Array([0x11223344]);\nconst testU8 = new Uint8Array(testU32.buffer);\nconst littleEndian = testU8[0] === 0x44;\n\n/**\n * Packs an arbitrary floating point value to 4 values representable using uint8.\n *\n * @param {Number} value A floating point number.\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\n */\nCartesian4.packFloat = function (value, result) {\n if (!defined(result)) {\n result = new Cartesian4();\n }\n\n // scratchU8Array and scratchF32Array are views into the same buffer\n scratchF32Array[0] = value;\n\n if (littleEndian) {\n result.x = scratchU8Array[0];\n result.y = scratchU8Array[1];\n result.z = scratchU8Array[2];\n result.w = scratchU8Array[3];\n } else {\n // convert from big-endian to little-endian\n result.x = scratchU8Array[3];\n result.y = scratchU8Array[2];\n result.z = scratchU8Array[1];\n result.w = scratchU8Array[0];\n }\n return result;\n};\n\n/**\n * Unpacks a float packed using Cartesian4.packFloat.\n *\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\n * @returns {Number} The unpacked float.\n * @private\n */\nCartesian4.unpackFloat = function (packedFloat) {\n // scratchU8Array and scratchF32Array are views into the same buffer\n if (littleEndian) {\n scratchU8Array[0] = packedFloat.x;\n scratchU8Array[1] = packedFloat.y;\n scratchU8Array[2] = packedFloat.z;\n scratchU8Array[3] = packedFloat.w;\n } else {\n // convert from little-endian to big-endian\n scratchU8Array[0] = packedFloat.w;\n scratchU8Array[1] = packedFloat.z;\n scratchU8Array[2] = packedFloat.y;\n scratchU8Array[3] = packedFloat.x;\n }\n return scratchF32Array[0];\n};\nexport default Cartesian4;\n", "import defined from \"./defined.js\";\n\n/**\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\n * out of memory, could not compile shader, etc. If a function may throw this\n * exception, the calling code should be prepared to catch it.\n * <br /><br />\n * On the other hand, a {@link DeveloperError} indicates an exception due\n * to a developer error, e.g., invalid argument, that usually indicates a bug in the\n * calling code.\n *\n * @alias RuntimeError\n * @constructor\n * @extends Error\n *\n * @param {String} [message] The error message for this exception.\n *\n * @see DeveloperError\n */\nfunction RuntimeError(message) {\n /**\n * 'RuntimeError' indicating that this exception was thrown due to a runtime error.\n * @type {String}\n * @readonly\n */\n this.name = \"RuntimeError\";\n\n /**\n * The explanation for why this exception was thrown.\n * @type {String}\n * @readonly\n */\n this.message = message;\n\n //Browsers such as IE don't have a stack property until you actually throw the error.\n let stack;\n try {\n throw new Error();\n } catch (e) {\n stack = e.stack;\n }\n\n /**\n * The stack trace of this exception, if available.\n * @type {String}\n * @readonly\n */\n this.stack = stack;\n}\n\nif (defined(Object.create)) {\n RuntimeError.prototype = Object.create(Error.prototype);\n RuntimeError.prototype.constructor = RuntimeError;\n}\n\nRuntimeError.prototype.toString = function () {\n let str = `${this.name}: ${this.message}`;\n\n if (defined(this.stack)) {\n str += `\\n${this.stack.toString()}`;\n }\n\n return str;\n};\nexport default RuntimeError;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A 4x4 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix4\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {Number} [column2Row0=0.0] The value for column 2, row 0.\n * @param {Number} [column3Row0=0.0] The value for column 3, row 0.\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\n * @param {Number} [column2Row1=0.0] The value for column 2, row 1.\n * @param {Number} [column3Row1=0.0] The value for column 3, row 1.\n * @param {Number} [column0Row2=0.0] The value for column 0, row 2.\n * @param {Number} [column1Row2=0.0] The value for column 1, row 2.\n * @param {Number} [column2Row2=0.0] The value for column 2, row 2.\n * @param {Number} [column3Row2=0.0] The value for column 3, row 2.\n * @param {Number} [column0Row3=0.0] The value for column 0, row 3.\n * @param {Number} [column1Row3=0.0] The value for column 1, row 3.\n * @param {Number} [column2Row3=0.0] The value for column 2, row 3.\n * @param {Number} [column3Row3=0.0] The value for column 3, row 3.\n *\n * @see Matrix4.fromArray\n * @see Matrix4.fromColumnMajorArray\n * @see Matrix4.fromRowMajorArray\n * @see Matrix4.fromRotationTranslation\n * @see Matrix4.fromTranslationQuaternionRotationScale\n * @see Matrix4.fromTranslationRotationScale\n * @see Matrix4.fromTranslation\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.fromRotation\n * @see Matrix4.fromCamera\n * @see Matrix4.computePerspectiveFieldOfView\n * @see Matrix4.computeOrthographicOffCenter\n * @see Matrix4.computePerspectiveOffCenter\n * @see Matrix4.computeInfinitePerspectiveOffCenter\n * @see Matrix4.computeViewportTransformation\n * @see Matrix4.computeView\n * @see Matrix2\n * @see Matrix3\n * @see Packable\n */\nfunction Matrix4(\n column0Row0,\n column1Row0,\n column2Row0,\n column3Row0,\n column0Row1,\n column1Row1,\n column2Row1,\n column3Row1,\n column0Row2,\n column1Row2,\n column2Row2,\n column3Row2,\n column0Row3,\n column1Row3,\n column2Row3,\n column3Row3\n) {\n this[0] = defaultValue(column0Row0, 0.0);\n this[1] = defaultValue(column0Row1, 0.0);\n this[2] = defaultValue(column0Row2, 0.0);\n this[3] = defaultValue(column0Row3, 0.0);\n this[4] = defaultValue(column1Row0, 0.0);\n this[5] = defaultValue(column1Row1, 0.0);\n this[6] = defaultValue(column1Row2, 0.0);\n this[7] = defaultValue(column1Row3, 0.0);\n this[8] = defaultValue(column2Row0, 0.0);\n this[9] = defaultValue(column2Row1, 0.0);\n this[10] = defaultValue(column2Row2, 0.0);\n this[11] = defaultValue(column2Row3, 0.0);\n this[12] = defaultValue(column3Row0, 0.0);\n this[13] = defaultValue(column3Row1, 0.0);\n this[14] = defaultValue(column3Row2, 0.0);\n this[15] = defaultValue(column3Row3, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nMatrix4.packedLength = 16;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix4} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nMatrix4.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value[0];\n array[startingIndex++] = value[1];\n array[startingIndex++] = value[2];\n array[startingIndex++] = value[3];\n array[startingIndex++] = value[4];\n array[startingIndex++] = value[5];\n array[startingIndex++] = value[6];\n array[startingIndex++] = value[7];\n array[startingIndex++] = value[8];\n array[startingIndex++] = value[9];\n array[startingIndex++] = value[10];\n array[startingIndex++] = value[11];\n array[startingIndex++] = value[12];\n array[startingIndex++] = value[13];\n array[startingIndex++] = value[14];\n array[startingIndex] = value[15];\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix4} [result] The object into which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Matrix4();\n }\n\n result[0] = array[startingIndex++];\n result[1] = array[startingIndex++];\n result[2] = array[startingIndex++];\n result[3] = array[startingIndex++];\n result[4] = array[startingIndex++];\n result[5] = array[startingIndex++];\n result[6] = array[startingIndex++];\n result[7] = array[startingIndex++];\n result[8] = array[startingIndex++];\n result[9] = array[startingIndex++];\n result[10] = array[startingIndex++];\n result[11] = array[startingIndex++];\n result[12] = array[startingIndex++];\n result[13] = array[startingIndex++];\n result[14] = array[startingIndex++];\n result[15] = array[startingIndex];\n return result;\n};\n\n/**\n * Flattens an array of Matrix4s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix4[]} array The array of matrices to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.\n * @returns {Number[]} The packed array.\n */\nMatrix4.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 16;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Matrix4.pack(array[i], result, i * 16);\n }\n return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix4s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Matrix4[]} [result] The array onto which to store the result.\n * @returns {Matrix4[]} The unpacked array.\n */\nMatrix4.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 16);\n } else {\n result.length = length / 16;\n }\n\n for (let i = 0; i < length; i += 16) {\n const index = i / 16;\n result[index] = Matrix4.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Duplicates a Matrix4 instance.\n *\n * @param {Matrix4} matrix The matrix to duplicate.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix4.clone = function (matrix, result) {\n if (!defined(matrix)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Matrix4(\n matrix[0],\n matrix[4],\n matrix[8],\n matrix[12],\n matrix[1],\n matrix[5],\n matrix[9],\n matrix[13],\n matrix[2],\n matrix[6],\n matrix[10],\n matrix[14],\n matrix[3],\n matrix[7],\n matrix[11],\n matrix[15]\n );\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Creates a Matrix4 from 16 consecutive elements in an array.\n * @function\n *\n * @param {Number[]} array The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Create the Matrix4:\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n * // [1.0, 2.0, 3.0, 4.0]\n *\n * const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\n * const m = Cesium.Matrix4.fromArray(v);\n *\n * // Create same Matrix4 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\n * const m2 = Cesium.Matrix4.fromArray(v2, 2);\n */\nMatrix4.fromArray = Matrix4.unpack;\n\n/**\n * Computes a Matrix4 instance from a column-major order array.\n *\n * @param {Number[]} values The column-major order array.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromColumnMajorArray = function (values, result) {\n return Matrix4.clone(values, result);\n};\n\n/**\n * Computes a Matrix4 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {Number[]} values The row-major order array.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRowMajorArray = function (values, result) {\n if (!defined(result)) {\n return new Matrix4(\n values[0],\n values[1],\n values[2],\n values[3],\n values[4],\n values[5],\n values[6],\n values[7],\n values[8],\n values[9],\n values[10],\n values[11],\n values[12],\n values[13],\n values[14],\n values[15]\n );\n }\n result[0] = values[0];\n result[1] = values[4];\n result[2] = values[8];\n result[3] = values[12];\n result[4] = values[1];\n result[5] = values[5];\n result[6] = values[9];\n result[7] = values[13];\n result[8] = values[2];\n result[9] = values[6];\n result[10] = values[10];\n result[11] = values[14];\n result[12] = values[3];\n result[13] = values[7];\n result[14] = values[11];\n result[15] = values[15];\n return result;\n};\n\n/**\n * Computes a Matrix4 instance from a Matrix3 representing the rotation\n * and a Cartesian3 representing the translation.\n *\n * @param {Matrix3} rotation The upper left portion of the matrix representing the rotation.\n * @param {Cartesian3} [translation=Cartesian3.ZERO] The upper right portion of the matrix representing the translation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRotationTranslation = function (rotation, translation, result) {\n translation = defaultValue(translation, Cartesian3.ZERO);\n\n if (!defined(result)) {\n return new Matrix4(\n rotation[0],\n rotation[3],\n rotation[6],\n translation.x,\n rotation[1],\n rotation[4],\n rotation[7],\n translation.y,\n rotation[2],\n rotation[5],\n rotation[8],\n translation.z,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n\n result[0] = rotation[0];\n result[1] = rotation[1];\n result[2] = rotation[2];\n result[3] = 0.0;\n result[4] = rotation[3];\n result[5] = rotation[4];\n result[6] = rotation[5];\n result[7] = 0.0;\n result[8] = rotation[6];\n result[9] = rotation[7];\n result[10] = rotation[8];\n result[11] = 0.0;\n result[12] = translation.x;\n result[13] = translation.y;\n result[14] = translation.z;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)\n * representation with the rotation represented as a quaternion.\n *\n * @param {Cartesian3} translation The translation transformation.\n * @param {Quaternion} rotation The rotation transformation.\n * @param {Cartesian3} scale The non-uniform scale transformation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(\n * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation\n * Cesium.Quaternion.IDENTITY, // rotation\n * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale\n * result);\n */\nMatrix4.fromTranslationQuaternionRotationScale = function (\n translation,\n rotation,\n scale,\n result\n) {\n if (!defined(result)) {\n result = new Matrix4();\n }\n\n const scaleX = scale.x;\n const scaleY = scale.y;\n const scaleZ = scale.z;\n\n const x2 = rotation.x * rotation.x;\n const xy = rotation.x * rotation.y;\n const xz = rotation.x * rotation.z;\n const xw = rotation.x * rotation.w;\n const y2 = rotation.y * rotation.y;\n const yz = rotation.y * rotation.z;\n const yw = rotation.y * rotation.w;\n const z2 = rotation.z * rotation.z;\n const zw = rotation.z * rotation.w;\n const w2 = rotation.w * rotation.w;\n\n const m00 = x2 - y2 - z2 + w2;\n const m01 = 2.0 * (xy - zw);\n const m02 = 2.0 * (xz + yw);\n\n const m10 = 2.0 * (xy + zw);\n const m11 = -x2 + y2 - z2 + w2;\n const m12 = 2.0 * (yz - xw);\n\n const m20 = 2.0 * (xz - yw);\n const m21 = 2.0 * (yz + xw);\n const m22 = -x2 - y2 + z2 + w2;\n\n result[0] = m00 * scaleX;\n result[1] = m10 * scaleX;\n result[2] = m20 * scaleX;\n result[3] = 0.0;\n result[4] = m01 * scaleY;\n result[5] = m11 * scaleY;\n result[6] = m21 * scaleY;\n result[7] = 0.0;\n result[8] = m02 * scaleZ;\n result[9] = m12 * scaleZ;\n result[10] = m22 * scaleZ;\n result[11] = 0.0;\n result[12] = translation.x;\n result[13] = translation.y;\n result[14] = translation.z;\n result[15] = 1.0;\n\n return result;\n};\n\n/**\n * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.\n *\n * @param {TranslationRotationScale} translationRotationScale The instance.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromTranslationRotationScale = function (\n translationRotationScale,\n result\n) {\n return Matrix4.fromTranslationQuaternionRotationScale(\n translationRotationScale.translation,\n translationRotationScale.rotation,\n translationRotationScale.scale,\n result\n );\n};\n\n/**\n * Creates a Matrix4 instance from a Cartesian3 representing the translation.\n *\n * @param {Cartesian3} translation The upper right portion of the matrix representing the translation.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @see Matrix4.multiplyByTranslation\n */\nMatrix4.fromTranslation = function (translation, result) {\n return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result);\n};\n\n/**\n * Computes a Matrix4 instance representing a non-uniform scale.\n *\n * @param {Cartesian3} scale The x, y, and z scale factors.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [7.0, 0.0, 0.0, 0.0]\n * // [0.0, 8.0, 0.0, 0.0]\n * // [0.0, 0.0, 9.0, 0.0]\n * // [0.0, 0.0, 0.0, 1.0]\n * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\n */\nMatrix4.fromScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix4(\n scale.x,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n scale.y,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n scale.z,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n\n result[0] = scale.x;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = scale.y;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = scale.z;\n result[11] = 0.0;\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = 0.0;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance representing a uniform scale.\n *\n * @param {Number} scale The uniform scale factor.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [2.0, 0.0, 0.0, 0.0]\n * // [0.0, 2.0, 0.0, 0.0]\n * // [0.0, 0.0, 2.0, 0.0]\n * // [0.0, 0.0, 0.0, 1.0]\n * const m = Cesium.Matrix4.fromUniformScale(2.0);\n */\nMatrix4.fromUniformScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix4(\n scale,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n scale,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n scale,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n\n result[0] = scale;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = scale;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = scale;\n result[11] = 0.0;\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = 0.0;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Creates a rotation matrix.\n *\n * @param {Matrix3} rotation The rotation matrix.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromRotation = function (rotation, result) {\n if (!defined(result)) {\n result = new Matrix4();\n }\n result[0] = rotation[0];\n result[1] = rotation[1];\n result[2] = rotation[2];\n result[3] = 0.0;\n\n result[4] = rotation[3];\n result[5] = rotation[4];\n result[6] = rotation[5];\n result[7] = 0.0;\n\n result[8] = rotation[6];\n result[9] = rotation[7];\n result[10] = rotation[8];\n result[11] = 0.0;\n\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = 0.0;\n result[15] = 1.0;\n\n return result;\n};\n\nconst fromCameraF = new Cartesian3();\nconst fromCameraR = new Cartesian3();\nconst fromCameraU = new Cartesian3();\n\n/**\n * Computes a Matrix4 instance from a Camera.\n *\n * @param {Camera} camera The camera to use.\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\n */\nMatrix4.fromCamera = function (camera, result) {\n const position = camera.position;\n const direction = camera.direction;\n const up = camera.up;\n\n Cartesian3.normalize(direction, fromCameraF);\n Cartesian3.normalize(\n Cartesian3.cross(fromCameraF, up, fromCameraR),\n fromCameraR\n );\n Cartesian3.normalize(\n Cartesian3.cross(fromCameraR, fromCameraF, fromCameraU),\n fromCameraU\n );\n\n const sX = fromCameraR.x;\n const sY = fromCameraR.y;\n const sZ = fromCameraR.z;\n const fX = fromCameraF.x;\n const fY = fromCameraF.y;\n const fZ = fromCameraF.z;\n const uX = fromCameraU.x;\n const uY = fromCameraU.y;\n const uZ = fromCameraU.z;\n const positionX = position.x;\n const positionY = position.y;\n const positionZ = position.z;\n const t0 = sX * -positionX + sY * -positionY + sZ * -positionZ;\n const t1 = uX * -positionX + uY * -positionY + uZ * -positionZ;\n const t2 = fX * positionX + fY * positionY + fZ * positionZ;\n\n // The code below this comment is an optimized\n // version of the commented lines.\n // Rather that create two matrices and then multiply,\n // we just bake in the multiplcation as part of creation.\n // const rotation = new Matrix4(\n // sX, sY, sZ, 0.0,\n // uX, uY, uZ, 0.0,\n // -fX, -fY, -fZ, 0.0,\n // 0.0, 0.0, 0.0, 1.0);\n // const translation = new Matrix4(\n // 1.0, 0.0, 0.0, -position.x,\n // 0.0, 1.0, 0.0, -position.y,\n // 0.0, 0.0, 1.0, -position.z,\n // 0.0, 0.0, 0.0, 1.0);\n // return rotation.multiply(translation);\n if (!defined(result)) {\n return new Matrix4(\n sX,\n sY,\n sZ,\n t0,\n uX,\n uY,\n uZ,\n t1,\n -fX,\n -fY,\n -fZ,\n t2,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n result[0] = sX;\n result[1] = uX;\n result[2] = -fX;\n result[3] = 0.0;\n result[4] = sY;\n result[5] = uY;\n result[6] = -fY;\n result[7] = 0.0;\n result[8] = sZ;\n result[9] = uZ;\n result[10] = -fZ;\n result[11] = 0.0;\n result[12] = t0;\n result[13] = t1;\n result[14] = t2;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance representing a perspective transformation matrix.\n *\n * @param {Number} fovY The field of view along the Y axis in radians.\n * @param {Number} aspectRatio The aspect ratio.\n * @param {Number} near The distance to the near plane in meters.\n * @param {Number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} fovY must be in (0, PI].\n * @exception {DeveloperError} aspectRatio must be greater than zero.\n * @exception {DeveloperError} near must be greater than zero.\n * @exception {DeveloperError} far must be greater than zero.\n */\nMatrix4.computePerspectiveFieldOfView = function (\n fovY,\n aspectRatio,\n near,\n far,\n result\n) {\n const bottom = Math.tan(fovY * 0.5);\n\n const column1Row1 = 1.0 / bottom;\n const column0Row0 = column1Row1 / aspectRatio;\n const column2Row2 = (far + near) / (near - far);\n const column3Row2 = (2.0 * far * near) / (near - far);\n\n result[0] = column0Row0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = column1Row1;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = column2Row2;\n result[11] = -1.0;\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = column3Row2;\n result[15] = 0.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an orthographic transformation matrix.\n *\n * @param {Number} left The number of meters to the left of the camera that will be in view.\n * @param {Number} right The number of meters to the right of the camera that will be in view.\n * @param {Number} bottom The number of meters below of the camera that will be in view.\n * @param {Number} top The number of meters above of the camera that will be in view.\n * @param {Number} near The distance to the near plane in meters.\n * @param {Number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeOrthographicOffCenter = function (\n left,\n right,\n bottom,\n top,\n near,\n far,\n result\n) {\n let a = 1.0 / (right - left);\n let b = 1.0 / (top - bottom);\n let c = 1.0 / (far - near);\n\n const tx = -(right + left) * a;\n const ty = -(top + bottom) * b;\n const tz = -(far + near) * c;\n a *= 2.0;\n b *= 2.0;\n c *= -2.0;\n\n result[0] = a;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = b;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = c;\n result[11] = 0.0;\n result[12] = tx;\n result[13] = ty;\n result[14] = tz;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an off center perspective transformation.\n *\n * @param {Number} left The number of meters to the left of the camera that will be in view.\n * @param {Number} right The number of meters to the right of the camera that will be in view.\n * @param {Number} bottom The number of meters below of the camera that will be in view.\n * @param {Number} top The number of meters above of the camera that will be in view.\n * @param {Number} near The distance to the near plane in meters.\n * @param {Number} far The distance to the far plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computePerspectiveOffCenter = function (\n left,\n right,\n bottom,\n top,\n near,\n far,\n result\n) {\n const column0Row0 = (2.0 * near) / (right - left);\n const column1Row1 = (2.0 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -(far + near) / (far - near);\n const column2Row3 = -1.0;\n const column3Row2 = (-2.0 * far * near) / (far - near);\n\n result[0] = column0Row0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = column1Row1;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = column3Row2;\n result[15] = 0.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance representing an infinite off center perspective transformation.\n *\n * @param {Number} left The number of meters to the left of the camera that will be in view.\n * @param {Number} right The number of meters to the right of the camera that will be in view.\n * @param {Number} bottom The number of meters below of the camera that will be in view.\n * @param {Number} top The number of meters above of the camera that will be in view.\n * @param {Number} near The distance to the near plane in meters.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeInfinitePerspectiveOffCenter = function (\n left,\n right,\n bottom,\n top,\n near,\n result\n) {\n const column0Row0 = (2.0 * near) / (right - left);\n const column1Row1 = (2.0 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1.0;\n const column2Row3 = -1.0;\n const column3Row2 = -2.0 * near;\n\n result[0] = column0Row0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = column1Row1;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0.0;\n result[13] = 0.0;\n result[14] = column3Row2;\n result[15] = 0.0;\n return result;\n};\n\n/**\n * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.\n *\n * @param {Object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1.\n * @param {Number} [nearDepthRange=0.0] The near plane distance in window coordinates.\n * @param {Number} [farDepthRange=1.0] The far plane distance in window coordinates.\n * @param {Matrix4} [result] The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Create viewport transformation using an explicit viewport and depth range.\n * const m = Cesium.Matrix4.computeViewportTransformation({\n * x : 0.0,\n * y : 0.0,\n * width : 1024.0,\n * height : 768.0\n * }, 0.0, 1.0, new Cesium.Matrix4());\n */\nMatrix4.computeViewportTransformation = function (\n viewport,\n nearDepthRange,\n farDepthRange,\n result\n) {\n if (!defined(result)) {\n result = new Matrix4();\n }\n\n viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT);\n const x = defaultValue(viewport.x, 0.0);\n const y = defaultValue(viewport.y, 0.0);\n const width = defaultValue(viewport.width, 0.0);\n const height = defaultValue(viewport.height, 0.0);\n nearDepthRange = defaultValue(nearDepthRange, 0.0);\n farDepthRange = defaultValue(farDepthRange, 1.0);\n\n const halfWidth = width * 0.5;\n const halfHeight = height * 0.5;\n const halfDepth = (farDepthRange - nearDepthRange) * 0.5;\n\n const column0Row0 = halfWidth;\n const column1Row1 = halfHeight;\n const column2Row2 = halfDepth;\n const column3Row0 = x + halfWidth;\n const column3Row1 = y + halfHeight;\n const column3Row2 = nearDepthRange + halfDepth;\n const column3Row3 = 1.0;\n\n result[0] = column0Row0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = column1Row1;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = column3Row0;\n result[13] = column3Row1;\n result[14] = column3Row2;\n result[15] = column3Row3;\n\n return result;\n};\n\n/**\n * Computes a Matrix4 instance that transforms from world space to view space.\n *\n * @param {Cartesian3} position The position of the camera.\n * @param {Cartesian3} direction The forward direction.\n * @param {Cartesian3} up The up direction.\n * @param {Cartesian3} right The right direction.\n * @param {Matrix4} result The object in which the result will be stored.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.computeView = function (position, direction, up, right, result) {\n result[0] = right.x;\n result[1] = up.x;\n result[2] = -direction.x;\n result[3] = 0.0;\n result[4] = right.y;\n result[5] = up.y;\n result[6] = -direction.y;\n result[7] = 0.0;\n result[8] = right.z;\n result[9] = up.z;\n result[10] = -direction.z;\n result[11] = 0.0;\n result[12] = -Cartesian3.dot(right, position);\n result[13] = -Cartesian3.dot(up, position);\n result[14] = Cartesian3.dot(direction, position);\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Computes an Array from the provided Matrix4 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix4} matrix The matrix to use..\n * @param {Number[]} [result] The Array onto which to store the result.\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\n *\n * @example\n * //create an array from an instance of Matrix4\n * // m = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n * const a = Cesium.Matrix4.toArray(m);\n *\n * // m remains the same\n * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]\n */\nMatrix4.toArray = function (matrix, result) {\n if (!defined(result)) {\n return [\n matrix[0],\n matrix[1],\n matrix[2],\n matrix[3],\n matrix[4],\n matrix[5],\n matrix[6],\n matrix[7],\n matrix[8],\n matrix[9],\n matrix[10],\n matrix[11],\n matrix[12],\n matrix[13],\n matrix[14],\n matrix[15],\n ];\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {Number} row The zero-based index of the row.\n * @param {Number} column The zero-based index of the column.\n * @returns {Number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0, 1, 2, or 3.\n * @exception {DeveloperError} column must be 0, 1, 2, or 3.\n *\n * @example\n * const myMatrix = new Cesium.Matrix4();\n * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index];\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix4.getElementIndex = function (column, row) {\n return column * 4 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to retrieve.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //returns a Cartesian4 instance with values from the specified column\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * //Example 1: Creates an instance of Cartesian\n * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());\n *\n * @example\n * //Example 2: Sets values for Cartesian instance\n * const a = new Cesium.Cartesian4();\n * Cesium.Matrix4.getColumn(m, 2, a);\n *\n * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;\n */\nMatrix4.getColumn = function (matrix, index, result) {\n const startIndex = index * 4;\n const x = matrix[startIndex];\n const y = matrix[startIndex + 1];\n const z = matrix[startIndex + 2];\n const w = matrix[startIndex + 3];\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to set.\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //creates a new Matrix4 instance with new column values from the Cartesian4 instance\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 11.0, 99.0, 13.0]\n * // [14.0, 15.0, 98.0, 17.0]\n * // [18.0, 19.0, 97.0, 21.0]\n * // [22.0, 23.0, 96.0, 25.0]\n */\nMatrix4.setColumn = function (matrix, index, cartesian, result) {\n result = Matrix4.clone(matrix, result);\n const startIndex = index * 4;\n result[startIndex] = cartesian.x;\n result[startIndex + 1] = cartesian.y;\n result[startIndex + 2] = cartesian.z;\n result[startIndex + 3] = cartesian.w;\n return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to retrieve.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //returns a Cartesian4 instance with values from the specified column\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * //Example 1: Returns an instance of Cartesian\n * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());\n *\n * @example\n * //Example 2: Sets values for a Cartesian instance\n * const a = new Cesium.Cartesian4();\n * Cesium.Matrix4.getRow(m, 2, a);\n *\n * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;\n */\nMatrix4.getRow = function (matrix, index, result) {\n const x = matrix[index];\n const y = matrix[index + 4];\n const z = matrix[index + 8];\n const w = matrix[index + 12];\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to set.\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\n *\n * @example\n * //create a new Matrix4 instance with new row values from the Cartesian4 instance\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [99.0, 98.0, 97.0, 96.0]\n * // [22.0, 23.0, 24.0, 25.0]\n */\nMatrix4.setRow = function (matrix, index, cartesian, result) {\n result = Matrix4.clone(matrix, result);\n result[index] = cartesian.x;\n result[index + 4] = cartesian.y;\n result[index + 8] = cartesian.z;\n result[index + 12] = cartesian.w;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the translation in the rightmost column of the provided\n * matrix with the provided translation. This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.setTranslation = function (matrix, translation, result) {\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n\n result[12] = translation.x;\n result[13] = translation.y;\n result[14] = translation.z;\n result[15] = matrix[15];\n\n return result;\n};\n\nconst scaleScratch1 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.setUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.setScale = function (matrix, scale, result) {\n const existingScale = Matrix4.getScale(matrix, scaleScratch1);\n const scaleRatioX = scale.x / existingScale.x;\n const scaleRatioY = scale.y / existingScale.y;\n const scaleRatioZ = scale.z / existingScale.z;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioX;\n result[3] = matrix[3];\n\n result[4] = matrix[4] * scaleRatioY;\n result[5] = matrix[5] * scaleRatioY;\n result[6] = matrix[6] * scaleRatioY;\n result[7] = matrix[7];\n\n result[8] = matrix[8] * scaleRatioZ;\n result[9] = matrix[9] * scaleRatioZ;\n result[10] = matrix[10] * scaleRatioZ;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\nconst scaleScratch2 = new Cartesian3();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.setScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.setUniformScale = function (matrix, scale, result) {\n const existingScale = Matrix4.getScale(matrix, scaleScratch2);\n const scaleRatioX = scale / existingScale.x;\n const scaleRatioY = scale / existingScale.y;\n const scaleRatioZ = scale / existingScale.z;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioX;\n result[3] = matrix[3];\n\n result[4] = matrix[4] * scaleRatioY;\n result[5] = matrix[5] * scaleRatioY;\n result[6] = matrix[6] * scaleRatioY;\n result[7] = matrix[7];\n\n result[8] = matrix[8] * scaleRatioZ;\n result[9] = matrix[9] * scaleRatioZ;\n result[10] = matrix[10] * scaleRatioZ;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\nconst scratchColumn = new Cartesian3();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n */\nMatrix4.getScale = function (matrix, result) {\n result.x = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\n );\n result.y = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)\n );\n result.z = Cartesian3.magnitude(\n Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn)\n );\n return result;\n};\n\nconst scaleScratch3 = new Cartesian3();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors in the upper-left\n * 3x3 matrix.\n *\n * @param {Matrix4} matrix The matrix.\n * @returns {Number} The maximum scale.\n */\nMatrix4.getMaximumScale = function (matrix) {\n Matrix4.getScale(matrix, scaleScratch3);\n return Cartesian3.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian3();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Matrix3} rotation The rotation matrix.\n * @returns {Matrix4} The modified result parameter.\n *\n * @see Matrix4.fromRotation\n * @see Matrix4.getRotation\n */\nMatrix4.setRotation = function (matrix, rotation, result) {\n const scale = Matrix4.getScale(matrix, scaleScratch4);\n\n result[0] = rotation[0] * scale.x;\n result[1] = rotation[1] * scale.x;\n result[2] = rotation[2] * scale.x;\n result[3] = matrix[3];\n\n result[4] = rotation[3] * scale.y;\n result[5] = rotation[4] * scale.y;\n result[6] = rotation[5] * scale.y;\n result[7] = matrix[7];\n\n result[8] = rotation[6] * scale.z;\n result[9] = rotation[7] * scale.z;\n result[10] = rotation[8] * scale.z;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\nconst scaleScratch5 = new Cartesian3();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @see Matrix4.setRotation\n * @see Matrix4.fromRotation\n */\nMatrix4.getRotation = function (matrix, result) {\n const scale = Matrix4.getScale(matrix, scaleScratch5);\n\n result[0] = matrix[0] / scale.x;\n result[1] = matrix[1] / scale.x;\n result[2] = matrix[2] / scale.x;\n\n result[3] = matrix[4] / scale.y;\n result[4] = matrix[5] / scale.y;\n result[5] = matrix[6] / scale.y;\n\n result[6] = matrix[8] / scale.z;\n result[7] = matrix[9] / scale.z;\n result[8] = matrix[10] / scale.z;\n\n return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.multiply = function (left, right, result) {\n const left0 = left[0];\n const left1 = left[1];\n const left2 = left[2];\n const left3 = left[3];\n const left4 = left[4];\n const left5 = left[5];\n const left6 = left[6];\n const left7 = left[7];\n const left8 = left[8];\n const left9 = left[9];\n const left10 = left[10];\n const left11 = left[11];\n const left12 = left[12];\n const left13 = left[13];\n const left14 = left[14];\n const left15 = left[15];\n\n const right0 = right[0];\n const right1 = right[1];\n const right2 = right[2];\n const right3 = right[3];\n const right4 = right[4];\n const right5 = right[5];\n const right6 = right[6];\n const right7 = right[7];\n const right8 = right[8];\n const right9 = right[9];\n const right10 = right[10];\n const right11 = right[11];\n const right12 = right[12];\n const right13 = right[13];\n const right14 = right[14];\n const right15 = right[15];\n\n const column0Row0 =\n left0 * right0 + left4 * right1 + left8 * right2 + left12 * right3;\n const column0Row1 =\n left1 * right0 + left5 * right1 + left9 * right2 + left13 * right3;\n const column0Row2 =\n left2 * right0 + left6 * right1 + left10 * right2 + left14 * right3;\n const column0Row3 =\n left3 * right0 + left7 * right1 + left11 * right2 + left15 * right3;\n\n const column1Row0 =\n left0 * right4 + left4 * right5 + left8 * right6 + left12 * right7;\n const column1Row1 =\n left1 * right4 + left5 * right5 + left9 * right6 + left13 * right7;\n const column1Row2 =\n left2 * right4 + left6 * right5 + left10 * right6 + left14 * right7;\n const column1Row3 =\n left3 * right4 + left7 * right5 + left11 * right6 + left15 * right7;\n\n const column2Row0 =\n left0 * right8 + left4 * right9 + left8 * right10 + left12 * right11;\n const column2Row1 =\n left1 * right8 + left5 * right9 + left9 * right10 + left13 * right11;\n const column2Row2 =\n left2 * right8 + left6 * right9 + left10 * right10 + left14 * right11;\n const column2Row3 =\n left3 * right8 + left7 * right9 + left11 * right10 + left15 * right11;\n\n const column3Row0 =\n left0 * right12 + left4 * right13 + left8 * right14 + left12 * right15;\n const column3Row1 =\n left1 * right12 + left5 * right13 + left9 * right14 + left13 * right15;\n const column3Row2 =\n left2 * right12 + left6 * right13 + left10 * right14 + left14 * right15;\n const column3Row3 =\n left3 * right12 + left7 * right13 + left11 * right14 + left15 * right15;\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = column0Row3;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = column1Row3;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = column3Row0;\n result[13] = column3Row1;\n result[14] = column3Row2;\n result[15] = column3Row3;\n return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.add = function (left, right, result) {\n result[0] = left[0] + right[0];\n result[1] = left[1] + right[1];\n result[2] = left[2] + right[2];\n result[3] = left[3] + right[3];\n result[4] = left[4] + right[4];\n result[5] = left[5] + right[5];\n result[6] = left[6] + right[6];\n result[7] = left[7] + right[7];\n result[8] = left[8] + right[8];\n result[9] = left[9] + right[9];\n result[10] = left[10] + right[10];\n result[11] = left[11] + right[11];\n result[12] = left[12] + right[12];\n result[13] = left[13] + right[13];\n result[14] = left[14] + right[14];\n result[15] = left[15] + right[15];\n return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.subtract = function (left, right, result) {\n result[0] = left[0] - right[0];\n result[1] = left[1] - right[1];\n result[2] = left[2] - right[2];\n result[3] = left[3] - right[3];\n result[4] = left[4] - right[4];\n result[5] = left[5] - right[5];\n result[6] = left[6] - right[6];\n result[7] = left[7] - right[7];\n result[8] = left[8] - right[8];\n result[9] = left[9] - right[9];\n result[10] = left[10] - right[10];\n result[11] = left[11] - right[11];\n result[12] = left[12] - right[12];\n result[13] = left[13] - right[13];\n result[14] = left[14] - right[14];\n result[15] = left[15] - right[15];\n return result;\n};\n\n/**\n * Computes the product of two matrices assuming the matrices are affine transformation matrices,\n * where the upper left 3x3 elements are any matrix, and\n * the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the product for general 4x4\n * matrices using {@link Matrix4.multiply}.\n *\n * @param {Matrix4} left The first matrix.\n * @param {Matrix4} right The second matrix.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);\n * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));\n * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());\n */\nMatrix4.multiplyTransformation = function (left, right, result) {\n const left0 = left[0];\n const left1 = left[1];\n const left2 = left[2];\n const left4 = left[4];\n const left5 = left[5];\n const left6 = left[6];\n const left8 = left[8];\n const left9 = left[9];\n const left10 = left[10];\n const left12 = left[12];\n const left13 = left[13];\n const left14 = left[14];\n\n const right0 = right[0];\n const right1 = right[1];\n const right2 = right[2];\n const right4 = right[4];\n const right5 = right[5];\n const right6 = right[6];\n const right8 = right[8];\n const right9 = right[9];\n const right10 = right[10];\n const right12 = right[12];\n const right13 = right[13];\n const right14 = right[14];\n\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n const column3Row0 =\n left0 * right12 + left4 * right13 + left8 * right14 + left12;\n const column3Row1 =\n left1 * right12 + left5 * right13 + left9 * right14 + left13;\n const column3Row2 =\n left2 * right12 + left6 * right13 + left10 * right14 + left14;\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = 0.0;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = column3Row0;\n result[13] = column3Row1;\n result[14] = column3Row2;\n result[15] = 1.0;\n return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by a 3x3 rotation matrix. This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\n */\nMatrix4.multiplyByMatrix3 = function (matrix, rotation, result) {\n const left0 = matrix[0];\n const left1 = matrix[1];\n const left2 = matrix[2];\n const left4 = matrix[4];\n const left5 = matrix[5];\n const left6 = matrix[6];\n const left8 = matrix[8];\n const left9 = matrix[9];\n const left10 = matrix[10];\n\n const right0 = rotation[0];\n const right1 = rotation[1];\n const right2 = rotation[2];\n const right4 = rotation[3];\n const right5 = rotation[4];\n const right6 = rotation[5];\n const right8 = rotation[6];\n const right9 = rotation[7];\n const right10 = rotation[8];\n\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\n\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\n\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column0Row2;\n result[3] = 0.0;\n result[4] = column1Row0;\n result[5] = column1Row1;\n result[6] = column1Row2;\n result[7] = 0.0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = 0.0;\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Cartesian3} translation The translation on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\n */\nMatrix4.multiplyByTranslation = function (matrix, translation, result) {\n const x = translation.x;\n const y = translation.y;\n const z = translation.z;\n\n const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\n const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\n const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\n\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n result[4] = matrix[4];\n result[5] = matrix[5];\n result[6] = matrix[6];\n result[7] = matrix[7];\n result[8] = matrix[8];\n result[9] = matrix[9];\n result[10] = matrix[10];\n result[11] = matrix[11];\n result[12] = tx;\n result[13] = ty;\n result[14] = tz;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)\n * by an implicit non-uniform scale matrix. This is an optimization\n * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where\n * <code>m</code> must be an affine matrix.\n * This function performs fewer allocations and arithmetic operations.\n *\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\n *\n * @see Matrix4.multiplyByUniformScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByScale = function (matrix, scale, result) {\n const scaleX = scale.x;\n const scaleY = scale.y;\n const scaleZ = scale.z;\n\n // Faster than Cartesian3.equals\n if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {\n return Matrix4.clone(matrix, result);\n }\n\n result[0] = scaleX * matrix[0];\n result[1] = scaleX * matrix[1];\n result[2] = scaleX * matrix[2];\n result[3] = matrix[3];\n\n result[4] = scaleY * matrix[4];\n result[5] = scaleY * matrix[5];\n result[6] = scaleY * matrix[6];\n result[7] = matrix[7];\n\n result[8] = scaleZ * matrix[8];\n result[9] = scaleZ * matrix[9];\n result[10] = scaleZ * matrix[10];\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix4} matrix The matrix on the left-hand side.\n * @param {Number} scale The uniform scale on the right-hand side.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix4.multiplyByScale\n * @see Matrix4.fromScale\n * @see Matrix4.fromUniformScale\n * @see Matrix4.setScale\n * @see Matrix4.setUniformScale\n * @see Matrix4.getScale\n */\nMatrix4.multiplyByUniformScale = function (matrix, scale, result) {\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3];\n\n result[4] = matrix[4] * scale;\n result[5] = matrix[5] * scale;\n result[6] = matrix[6] * scale;\n result[7] = matrix[7];\n\n result[8] = matrix[8] * scale;\n result[9] = matrix[9] * scale;\n result[10] = matrix[10] * scale;\n result[11] = matrix[11];\n\n result[12] = matrix[12];\n result[13] = matrix[13];\n result[14] = matrix[14];\n result[15] = matrix[15];\n\n return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian4} cartesian The vector.\n * @param {Cartesian4} result The object onto which to store the result.\n * @returns {Cartesian4} The modified result parameter.\n */\nMatrix4.multiplyByVector = function (matrix, cartesian, result) {\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n const vW = cartesian.w;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\n const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a <code>w</code> component of zero.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\n * // A shortcut for\n * // Cartesian3 p = ...\n * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\n */\nMatrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\n * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Cartesian3} cartesian The point.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n *\n * @example\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\n */\nMatrix4.multiplyByPoint = function (matrix, cartesian, result) {\n const vX = cartesian.x;\n const vY = cartesian.y;\n const vZ = cartesian.z;\n\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix4} matrix The matrix.\n * @param {Number} scalar The number to multiply by.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-20.0, -22.0, -24.0, -26.0]\n * // [-28.0, -30.0, -32.0, -34.0]\n * // [-36.0, -38.0, -40.0, -42.0]\n * // [-44.0, -46.0, -48.0, -50.0]\n */\nMatrix4.multiplyByScalar = function (matrix, scalar, result) {\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n result[4] = matrix[4] * scalar;\n result[5] = matrix[5] * scalar;\n result[6] = matrix[6] * scalar;\n result[7] = matrix[7] * scalar;\n result[8] = matrix[8] * scalar;\n result[9] = matrix[9] * scalar;\n result[10] = matrix[10] * scalar;\n result[11] = matrix[11] * scalar;\n result[12] = matrix[12] * scalar;\n result[13] = matrix[13] * scalar;\n result[14] = matrix[14] * scalar;\n result[15] = matrix[15] * scalar;\n return result;\n};\n\n/**\n * Computes a negated copy of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to negate.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //create a new Matrix4 instance which is a negation of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [-10.0, -11.0, -12.0, -13.0]\n * // [-14.0, -15.0, -16.0, -17.0]\n * // [-18.0, -19.0, -20.0, -21.0]\n * // [-22.0, -23.0, -24.0, -25.0]\n */\nMatrix4.negate = function (matrix, result) {\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n result[4] = -matrix[4];\n result[5] = -matrix[5];\n result[6] = -matrix[6];\n result[7] = -matrix[7];\n result[8] = -matrix[8];\n result[9] = -matrix[9];\n result[10] = -matrix[10];\n result[11] = -matrix[11];\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = -matrix[15];\n return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @example\n * //returns transpose of a Matrix4\n * // m = [10.0, 11.0, 12.0, 13.0]\n * // [14.0, 15.0, 16.0, 17.0]\n * // [18.0, 19.0, 20.0, 21.0]\n * // [22.0, 23.0, 24.0, 25.0]\n *\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\n *\n * // m remains the same\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n */\nMatrix4.transpose = function (matrix, result) {\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix3 = matrix[3];\n const matrix6 = matrix[6];\n const matrix7 = matrix[7];\n const matrix11 = matrix[11];\n\n result[0] = matrix[0];\n result[1] = matrix[4];\n result[2] = matrix[8];\n result[3] = matrix[12];\n result[4] = matrix1;\n result[5] = matrix[5];\n result[6] = matrix[9];\n result[7] = matrix[13];\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix[10];\n result[11] = matrix[14];\n result[12] = matrix3;\n result[13] = matrix7;\n result[14] = matrix11;\n result[15] = matrix[15];\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix4} matrix The matrix with signed elements.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.abs = function (matrix, result) {\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n result[4] = Math.abs(matrix[4]);\n result[5] = Math.abs(matrix[5]);\n result[6] = Math.abs(matrix[6]);\n result[7] = Math.abs(matrix[7]);\n result[8] = Math.abs(matrix[8]);\n result[9] = Math.abs(matrix[9]);\n result[10] = Math.abs(matrix[10]);\n result[11] = Math.abs(matrix[11]);\n result[12] = Math.abs(matrix[12]);\n result[13] = Math.abs(matrix[13]);\n result[14] = Math.abs(matrix[14]);\n result[15] = Math.abs(matrix[15]);\n\n return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equals(a,b)) {\n * console.log(\"Both matrices are equal\");\n * } else {\n * console.log(\"They are not equal\");\n * }\n *\n * //Prints \"Both matrices are equal\" on the console\n */\nMatrix4.equals = function (left, right) {\n // Given that most matrices will be transformation matrices, the elements\n // are tested in order such that the test is likely to fail as early\n // as possible. I _think_ this is just as friendly to the L1 cache\n // as testing in index order. It is certainty faster in practice.\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n // Translation\n left[12] === right[12] &&\n left[13] === right[13] &&\n left[14] === right[14] &&\n // Rotation/scale\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[4] === right[4] &&\n left[5] === right[5] &&\n left[6] === right[6] &&\n left[8] === right[8] &&\n left[9] === right[9] &&\n left[10] === right[10] &&\n // Bottom row\n left[3] === right[3] &&\n left[7] === right[7] &&\n left[11] === right[11] &&\n left[15] === right[15])\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix4} [left] The first matrix.\n * @param {Matrix4} [right] The second matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n *\n * @example\n * //compares two Matrix4 instances\n *\n * // a = [10.5, 14.5, 18.5, 22.5]\n * // [11.5, 15.5, 19.5, 23.5]\n * // [12.5, 16.5, 20.5, 24.5]\n * // [13.5, 17.5, 21.5, 25.5]\n *\n * // b = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\n * console.log(\"Difference between both the matrices is less than 0.1\");\n * } else {\n * console.log(\"Difference between both the matrices is not less than 0.1\");\n * }\n *\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\n */\nMatrix4.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon &&\n Math.abs(left[4] - right[4]) <= epsilon &&\n Math.abs(left[5] - right[5]) <= epsilon &&\n Math.abs(left[6] - right[6]) <= epsilon &&\n Math.abs(left[7] - right[7]) <= epsilon &&\n Math.abs(left[8] - right[8]) <= epsilon &&\n Math.abs(left[9] - right[9]) <= epsilon &&\n Math.abs(left[10] - right[10]) <= epsilon &&\n Math.abs(left[11] - right[11]) <= epsilon &&\n Math.abs(left[12] - right[12]) <= epsilon &&\n Math.abs(left[13] - right[13]) <= epsilon &&\n Math.abs(left[14] - right[14]) <= epsilon &&\n Math.abs(left[15] - right[15]) <= epsilon)\n );\n};\n\n/**\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nMatrix4.getTranslation = function (matrix, result) {\n result.x = matrix[12];\n result.y = matrix[13];\n result.z = matrix[14];\n return result;\n};\n\n/**\n * Gets the upper left 3x3 matrix of the provided matrix.\n *\n * @param {Matrix4} matrix The matrix to use.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter.\n *\n * @example\n * // returns a Matrix3 instance from a Matrix4 instance\n *\n * // m = [10.0, 14.0, 18.0, 22.0]\n * // [11.0, 15.0, 19.0, 23.0]\n * // [12.0, 16.0, 20.0, 24.0]\n * // [13.0, 17.0, 21.0, 25.0]\n *\n * const b = new Cesium.Matrix3();\n * Cesium.Matrix4.getMatrix3(m,b);\n *\n * // b = [10.0, 14.0, 18.0]\n * // [11.0, 15.0, 19.0]\n * // [12.0, 16.0, 20.0]\n */\nMatrix4.getMatrix3 = function (matrix, result) {\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[4];\n result[4] = matrix[5];\n result[5] = matrix[6];\n result[6] = matrix[8];\n result[7] = matrix[9];\n result[8] = matrix[10];\n return result;\n};\n\nconst scratchInverseRotation = new Matrix3();\nconst scratchMatrix3Zero = new Matrix3();\nconst scratchBottomRow = new Cartesian4();\nconst scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);\n\n/**\n * Computes the inverse of the provided matrix using Cramers Rule.\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\n * If the matrix is a proper rigid transformation, it is more efficient\n * to invert it with {@link Matrix4.inverseTransformation}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n *\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\n */\nMatrix4.inverse = function (matrix, result) {\n//\n // Ported from:\n // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\n //\n const src0 = matrix[0];\n const src1 = matrix[4];\n const src2 = matrix[8];\n const src3 = matrix[12];\n const src4 = matrix[1];\n const src5 = matrix[5];\n const src6 = matrix[9];\n const src7 = matrix[13];\n const src8 = matrix[2];\n const src9 = matrix[6];\n const src10 = matrix[10];\n const src11 = matrix[14];\n const src12 = matrix[3];\n const src13 = matrix[7];\n const src14 = matrix[11];\n const src15 = matrix[15];\n\n // calculate pairs for first 8 elements (cofactors)\n let tmp0 = src10 * src15;\n let tmp1 = src11 * src14;\n let tmp2 = src9 * src15;\n let tmp3 = src11 * src13;\n let tmp4 = src9 * src14;\n let tmp5 = src10 * src13;\n let tmp6 = src8 * src15;\n let tmp7 = src11 * src12;\n let tmp8 = src8 * src14;\n let tmp9 = src10 * src12;\n let tmp10 = src8 * src13;\n let tmp11 = src9 * src12;\n\n // calculate first 8 elements (cofactors)\n const dst0 =\n tmp0 * src5 +\n tmp3 * src6 +\n tmp4 * src7 -\n (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\n const dst1 =\n tmp1 * src4 +\n tmp6 * src6 +\n tmp9 * src7 -\n (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\n const dst2 =\n tmp2 * src4 +\n tmp7 * src5 +\n tmp10 * src7 -\n (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\n const dst3 =\n tmp5 * src4 +\n tmp8 * src5 +\n tmp11 * src6 -\n (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\n const dst4 =\n tmp1 * src1 +\n tmp2 * src2 +\n tmp5 * src3 -\n (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\n const dst5 =\n tmp0 * src0 +\n tmp7 * src2 +\n tmp8 * src3 -\n (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\n const dst6 =\n tmp3 * src0 +\n tmp6 * src1 +\n tmp11 * src3 -\n (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\n const dst7 =\n tmp4 * src0 +\n tmp9 * src1 +\n tmp10 * src2 -\n (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\n\n // calculate pairs for second 8 elements (cofactors)\n tmp0 = src2 * src7;\n tmp1 = src3 * src6;\n tmp2 = src1 * src7;\n tmp3 = src3 * src5;\n tmp4 = src1 * src6;\n tmp5 = src2 * src5;\n tmp6 = src0 * src7;\n tmp7 = src3 * src4;\n tmp8 = src0 * src6;\n tmp9 = src2 * src4;\n tmp10 = src0 * src5;\n tmp11 = src1 * src4;\n\n // calculate second 8 elements (cofactors)\n const dst8 =\n tmp0 * src13 +\n tmp3 * src14 +\n tmp4 * src15 -\n (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\n const dst9 =\n tmp1 * src12 +\n tmp6 * src14 +\n tmp9 * src15 -\n (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\n const dst10 =\n tmp2 * src12 +\n tmp7 * src13 +\n tmp10 * src15 -\n (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\n const dst11 =\n tmp5 * src12 +\n tmp8 * src13 +\n tmp11 * src14 -\n (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\n const dst12 =\n tmp2 * src10 +\n tmp5 * src11 +\n tmp1 * src9 -\n (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\n const dst13 =\n tmp8 * src11 +\n tmp0 * src8 +\n tmp7 * src10 -\n (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\n const dst14 =\n tmp6 * src9 +\n tmp11 * src11 +\n tmp3 * src8 -\n (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\n const dst15 =\n tmp10 * src10 +\n tmp4 * src8 +\n tmp9 * src9 -\n (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\n\n // calculate determinant\n let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\n\n if (Math.abs(det) < CesiumMath.EPSILON21) {\n // Special case for a zero scale matrix that can occur, for example,\n // when a model's node has a [0, 0, 0] scale.\n if (\n Matrix3.equalsEpsilon(\n Matrix4.getMatrix3(matrix, scratchInverseRotation),\n scratchMatrix3Zero,\n CesiumMath.EPSILON7\n ) &&\n Cartesian4.equals(\n Matrix4.getRow(matrix, 3, scratchBottomRow),\n scratchExpectedBottomRow\n )\n ) {\n result[0] = 0.0;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = 0.0;\n result[4] = 0.0;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 0.0;\n result[9] = 0.0;\n result[10] = 0.0;\n result[11] = 0.0;\n result[12] = -matrix[12];\n result[13] = -matrix[13];\n result[14] = -matrix[14];\n result[15] = 1.0;\n return result;\n }\n\n throw new RuntimeError(\n \"matrix is not invertible because its determinate is zero.\"\n );\n }\n\n // calculate matrix inverse\n det = 1.0 / det;\n\n result[0] = dst0 * det;\n result[1] = dst1 * det;\n result[2] = dst2 * det;\n result[3] = dst3 * det;\n result[4] = dst4 * det;\n result[5] = dst5 * det;\n result[6] = dst6 * det;\n result[7] = dst7 * det;\n result[8] = dst8 * det;\n result[9] = dst9 * det;\n result[10] = dst10 * det;\n result[11] = dst11 * det;\n result[12] = dst12 * det;\n result[13] = dst13 * det;\n result[14] = dst14 * det;\n result[15] = dst15 * det;\n return result;\n};\n\n/**\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\n * where the upper left 3x3 elements are a rotation matrix,\n * and the upper three elements in the fourth column are the translation.\n * The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * This method is faster than computing the inverse for a general 4x4\n * matrix using {@link Matrix4.inverse}.\n *\n * @param {Matrix4} matrix The matrix to invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTransformation = function (matrix, result) {\n //This function is an optimized version of the below 4 lines.\n //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\n //const rTN = Matrix3.negate(rT);\n //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\n //return Matrix4.fromRotationTranslation(rT, rTT, result);\n\n const matrix0 = matrix[0];\n const matrix1 = matrix[1];\n const matrix2 = matrix[2];\n const matrix4 = matrix[4];\n const matrix5 = matrix[5];\n const matrix6 = matrix[6];\n const matrix8 = matrix[8];\n const matrix9 = matrix[9];\n const matrix10 = matrix[10];\n\n const vX = matrix[12];\n const vY = matrix[13];\n const vZ = matrix[14];\n\n const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\n const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\n const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\n\n result[0] = matrix0;\n result[1] = matrix4;\n result[2] = matrix8;\n result[3] = 0.0;\n result[4] = matrix1;\n result[5] = matrix5;\n result[6] = matrix9;\n result[7] = 0.0;\n result[8] = matrix2;\n result[9] = matrix6;\n result[10] = matrix10;\n result[11] = 0.0;\n result[12] = x;\n result[13] = y;\n result[14] = z;\n result[15] = 1.0;\n return result;\n};\n\nconst scratchTransposeMatrix = new Matrix4();\n\n/**\n * Computes the inverse transpose of a matrix.\n *\n * @param {Matrix4} matrix The matrix to transpose and invert.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter.\n */\nMatrix4.inverseTranspose = function (matrix, result) {\n return Matrix4.inverse(\n Matrix4.transpose(matrix, scratchTransposeMatrix),\n result\n );\n};\n\n/**\n * An immutable Matrix4 instance initialized to the identity matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.IDENTITY = Object.freeze(\n new Matrix4(\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n )\n);\n\n/**\n * An immutable Matrix4 instance initialized to the zero matrix.\n *\n * @type {Matrix4}\n * @constant\n */\nMatrix4.ZERO = Object.freeze(\n new Matrix4(\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0\n )\n);\n\n/**\n * The index into Matrix4 for column 0, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix4 for column 0, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix4 for column 0, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN0ROW2 = 2;\n\n/**\n * The index into Matrix4 for column 0, row 3.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN0ROW3 = 3;\n\n/**\n * The index into Matrix4 for column 1, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN1ROW0 = 4;\n\n/**\n * The index into Matrix4 for column 1, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN1ROW1 = 5;\n\n/**\n * The index into Matrix4 for column 1, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN1ROW2 = 6;\n\n/**\n * The index into Matrix4 for column 1, row 3.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN1ROW3 = 7;\n\n/**\n * The index into Matrix4 for column 2, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN2ROW0 = 8;\n\n/**\n * The index into Matrix4 for column 2, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN2ROW1 = 9;\n\n/**\n * The index into Matrix4 for column 2, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN2ROW2 = 10;\n\n/**\n * The index into Matrix4 for column 2, row 3.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN2ROW3 = 11;\n\n/**\n * The index into Matrix4 for column 3, row 0.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN3ROW0 = 12;\n\n/**\n * The index into Matrix4 for column 3, row 1.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN3ROW1 = 13;\n\n/**\n * The index into Matrix4 for column 3, row 2.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN3ROW2 = 14;\n\n/**\n * The index into Matrix4 for column 3, row 3.\n *\n * @type {Number}\n * @constant\n */\nMatrix4.COLUMN3ROW3 = 15;\n\nObject.defineProperties(Matrix4.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix4.prototype\n *\n * @type {Number}\n */\n length: {\n get: function () {\n return Matrix4.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix4 instance.\n *\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\n */\nMatrix4.prototype.clone = function (result) {\n return Matrix4.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix4.prototype.equals = function (right) {\n return Matrix4.equals(this, right);\n};\n\n/**\n * @private\n */\nMatrix4.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3] &&\n matrix[4] === array[offset + 4] &&\n matrix[5] === array[offset + 5] &&\n matrix[6] === array[offset + 6] &&\n matrix[7] === array[offset + 7] &&\n matrix[8] === array[offset + 8] &&\n matrix[9] === array[offset + 9] &&\n matrix[10] === array[offset + 10] &&\n matrix[11] === array[offset + 11] &&\n matrix[12] === array[offset + 12] &&\n matrix[13] === array[offset + 13] &&\n matrix[14] === array[offset + 14] &&\n matrix[15] === array[offset + 15]\n );\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix4} [right] The right hand side matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix4.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix4.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Computes a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1, column2, column3)'.\n *\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\n */\nMatrix4.prototype.toString = function () {\n return (\n `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\\n` +\n `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\\n` +\n `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\\n` +\n `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`\n );\n};\nexport default Matrix4;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Intersect from \"./Intersect.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A bounding sphere with a center and a radius.\n * @alias BoundingSphere\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.\n * @param {Number} [radius=0.0] The radius of the bounding sphere.\n *\n * @see AxisAlignedBoundingBox\n * @see BoundingRectangle\n * @see Packable\n */\nfunction BoundingSphere(center, radius) {\n /**\n * The center point of the sphere.\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\n\n /**\n * The radius of the sphere.\n * @type {Number}\n * @default 0.0\n */\n this.radius = defaultValue(radius, 0.0);\n}\n\nconst fromPointsXMin = new Cartesian3();\nconst fromPointsYMin = new Cartesian3();\nconst fromPointsZMin = new Cartesian3();\nconst fromPointsXMax = new Cartesian3();\nconst fromPointsYMax = new Cartesian3();\nconst fromPointsZMax = new Cartesian3();\nconst fromPointsCurrentPos = new Cartesian3();\nconst fromPointsScratch = new Cartesian3();\nconst fromPointsRitterCenter = new Cartesian3();\nconst fromPointsMinBoxPt = new Cartesian3();\nconst fromPointsMaxBoxPt = new Cartesian3();\nconst fromPointsNaiveCenterScratch = new Cartesian3();\nconst volumeConstant = (4.0 / 3.0) * CesiumMath.PI;\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.\n * The bounding sphere is computed by running two algorithms, a naive algorithm and\n * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.\n *\n * @param {Cartesian3[]} [positions] An array of points that the bounding sphere will enclose. Each point must have <code>x</code>, <code>y</code>, and <code>z</code> properties.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @see {@link http://help.agi.com/AGIComponents/html/BlogBoundingSphere.htm|Bounding Sphere computation article}\n */\nBoundingSphere.fromPoints = function (positions, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (!defined(positions) || positions.length === 0) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n const currentPos = Cartesian3.clone(positions[0], fromPointsCurrentPos);\n\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n const numPositions = positions.length;\n let i;\n for (i = 1; i < numPositions; i++) {\n Cartesian3.clone(positions[i], currentPos);\n\n const x = currentPos.x;\n const y = currentPos.y;\n const z = currentPos.z;\n\n // Store points containing the the smallest and largest components\n if (x < xMin.x) {\n Cartesian3.clone(currentPos, xMin);\n }\n\n if (x > xMax.x) {\n Cartesian3.clone(currentPos, xMax);\n }\n\n if (y < yMin.y) {\n Cartesian3.clone(currentPos, yMin);\n }\n\n if (y > yMax.y) {\n Cartesian3.clone(currentPos, yMax);\n }\n\n if (z < zMin.z) {\n Cartesian3.clone(currentPos, zMin);\n }\n\n if (z > zMax.z) {\n Cartesian3.clone(currentPos, zMax);\n }\n }\n\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n const xSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n );\n const ySpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n );\n const zSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n );\n\n // Set the diameter endpoints to the largest span.\n let diameter1 = xMin;\n let diameter2 = xMax;\n let maxSpan = xSpan;\n if (ySpan > maxSpan) {\n maxSpan = ySpan;\n diameter1 = yMin;\n diameter2 = yMax;\n }\n if (zSpan > maxSpan) {\n maxSpan = zSpan;\n diameter1 = zMin;\n diameter2 = zMax;\n }\n\n // Calculate the center of the initial sphere found by Ritter's algorithm\n const ritterCenter = fromPointsRitterCenter;\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n // Calculate the radius of the initial sphere found by Ritter's algorithm\n let radiusSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n );\n let ritterRadius = Math.sqrt(radiusSquared);\n\n // Find the center of the sphere found using the Naive method.\n const minBoxPt = fromPointsMinBoxPt;\n minBoxPt.x = xMin.x;\n minBoxPt.y = yMin.y;\n minBoxPt.z = zMin.z;\n\n const maxBoxPt = fromPointsMaxBoxPt;\n maxBoxPt.x = xMax.x;\n maxBoxPt.y = yMax.y;\n maxBoxPt.z = zMax.z;\n\n const naiveCenter = Cartesian3.midpoint(\n minBoxPt,\n maxBoxPt,\n fromPointsNaiveCenterScratch\n );\n\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\n let naiveRadius = 0;\n for (i = 0; i < numPositions; i++) {\n Cartesian3.clone(positions[i], currentPos);\n\n // Find the furthest point from the naive center to calculate the naive radius.\n const r = Cartesian3.magnitude(\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n );\n if (r > naiveRadius) {\n naiveRadius = r;\n }\n\n // Make adjustments to the Ritter Sphere to include all points.\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n );\n if (oldCenterToPointSquared > radiusSquared) {\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n // Calculate new radius to include the point that lies outside\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n radiusSquared = ritterRadius * ritterRadius;\n // Calculate center of new Ritter sphere\n const oldToNew = oldCenterToPoint - ritterRadius;\n ritterCenter.x =\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n oldCenterToPoint;\n ritterCenter.y =\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n oldCenterToPoint;\n ritterCenter.z =\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n oldCenterToPoint;\n }\n }\n\n if (ritterRadius < naiveRadius) {\n Cartesian3.clone(ritterCenter, result.center);\n result.radius = ritterRadius;\n } else {\n Cartesian3.clone(naiveCenter, result.center);\n result.radius = naiveRadius;\n }\n\n return result;\n};\n\nconst defaultProjection = new GeographicProjection();\nconst fromRectangle2DLowerLeft = new Cartesian3();\nconst fromRectangle2DUpperRight = new Cartesian3();\nconst fromRectangle2DSouthwest = new Cartographic();\nconst fromRectangle2DNortheast = new Cartographic();\n\n/**\n * Computes a bounding sphere from a rectangle projected in 2D.\n *\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangle2D = function (rectangle, projection, result) {\n return BoundingSphere.fromRectangleWithHeights2D(\n rectangle,\n projection,\n 0.0,\n 0.0,\n result\n );\n};\n\n/**\n * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the\n * object's minimum and maximum heights over the rectangle.\n *\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\n * @param {Number} [minimumHeight=0.0] The minimum height over the rectangle.\n * @param {Number} [maximumHeight=0.0] The maximum height over the rectangle.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangleWithHeights2D = function (\n rectangle,\n projection,\n minimumHeight,\n maximumHeight,\n result\n) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (!defined(rectangle)) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n projection = defaultValue(projection, defaultProjection);\n\n Rectangle.southwest(rectangle, fromRectangle2DSouthwest);\n fromRectangle2DSouthwest.height = minimumHeight;\n Rectangle.northeast(rectangle, fromRectangle2DNortheast);\n fromRectangle2DNortheast.height = maximumHeight;\n\n const lowerLeft = projection.project(\n fromRectangle2DSouthwest,\n fromRectangle2DLowerLeft\n );\n const upperRight = projection.project(\n fromRectangle2DNortheast,\n fromRectangle2DUpperRight\n );\n\n const width = upperRight.x - lowerLeft.x;\n const height = upperRight.y - lowerLeft.y;\n const elevation = upperRight.z - lowerLeft.z;\n\n result.radius =\n Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;\n const center = result.center;\n center.x = lowerLeft.x + width * 0.5;\n center.y = lowerLeft.y + height * 0.5;\n center.z = lowerLeft.z + elevation * 0.5;\n return result;\n};\n\nconst fromRectangle3DScratch = [];\n\n/**\n * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points\n * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.\n *\n * @param {Rectangle} [rectangle] The valid rectangle used to create a bounding sphere.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.\n * @param {Number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromRectangle3D = function (\n rectangle,\n ellipsoid,\n surfaceHeight,\n result\n) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n surfaceHeight = defaultValue(surfaceHeight, 0.0);\n\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (!defined(rectangle)) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n const positions = Rectangle.subsample(\n rectangle,\n ellipsoid,\n surfaceHeight,\n fromRectangle3DScratch\n );\n return BoundingSphere.fromPoints(positions, result);\n};\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are\n * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\n * ensure a tight fit.\n *\n * @param {Number[]} [positions] An array of points that the bounding sphere will enclose. Each point\n * is formed from three elements in the array in the order X, Y, Z.\n * @param {Cartesian3} [center=Cartesian3.ZERO] The position to which the positions are relative, which need not be the\n * origin of the coordinate system. This is useful when the positions are to be used for\n * relative-to-center (RTC) rendering.\n * @param {Number} [stride=3] The number of array elements per vertex. It must be at least 3, but it may\n * be higher. Regardless of the value of this parameter, the X coordinate of the first position\n * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index\n * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If\n * the stride is 5, however, two array elements are skipped and the next position begins at array\n * index 5.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @example\n * // Compute the bounding sphere from 3 positions, each specified relative to a center.\n * // In addition to the X, Y, and Z coordinates, the points array contains two additional\n * // elements per point which are ignored for the purpose of computing the bounding sphere.\n * const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const points = [1.0, 2.0, 3.0, 0.1, 0.2,\n * 4.0, 5.0, 6.0, 0.1, 0.2,\n * 7.0, 8.0, 9.0, 0.1, 0.2];\n * const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);\n *\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\n */\nBoundingSphere.fromVertices = function (positions, center, stride, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (!defined(positions) || positions.length === 0) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n center = defaultValue(center, Cartesian3.ZERO);\n\n stride = defaultValue(stride, 3);\n\n const currentPos = fromPointsCurrentPos;\n currentPos.x = positions[0] + center.x;\n currentPos.y = positions[1] + center.y;\n currentPos.z = positions[2] + center.z;\n\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n const numElements = positions.length;\n let i;\n for (i = 0; i < numElements; i += stride) {\n const x = positions[i] + center.x;\n const y = positions[i + 1] + center.y;\n const z = positions[i + 2] + center.z;\n\n currentPos.x = x;\n currentPos.y = y;\n currentPos.z = z;\n\n // Store points containing the the smallest and largest components\n if (x < xMin.x) {\n Cartesian3.clone(currentPos, xMin);\n }\n\n if (x > xMax.x) {\n Cartesian3.clone(currentPos, xMax);\n }\n\n if (y < yMin.y) {\n Cartesian3.clone(currentPos, yMin);\n }\n\n if (y > yMax.y) {\n Cartesian3.clone(currentPos, yMax);\n }\n\n if (z < zMin.z) {\n Cartesian3.clone(currentPos, zMin);\n }\n\n if (z > zMax.z) {\n Cartesian3.clone(currentPos, zMax);\n }\n }\n\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n const xSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n );\n const ySpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n );\n const zSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n );\n\n // Set the diameter endpoints to the largest span.\n let diameter1 = xMin;\n let diameter2 = xMax;\n let maxSpan = xSpan;\n if (ySpan > maxSpan) {\n maxSpan = ySpan;\n diameter1 = yMin;\n diameter2 = yMax;\n }\n if (zSpan > maxSpan) {\n maxSpan = zSpan;\n diameter1 = zMin;\n diameter2 = zMax;\n }\n\n // Calculate the center of the initial sphere found by Ritter's algorithm\n const ritterCenter = fromPointsRitterCenter;\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n // Calculate the radius of the initial sphere found by Ritter's algorithm\n let radiusSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n );\n let ritterRadius = Math.sqrt(radiusSquared);\n\n // Find the center of the sphere found using the Naive method.\n const minBoxPt = fromPointsMinBoxPt;\n minBoxPt.x = xMin.x;\n minBoxPt.y = yMin.y;\n minBoxPt.z = zMin.z;\n\n const maxBoxPt = fromPointsMaxBoxPt;\n maxBoxPt.x = xMax.x;\n maxBoxPt.y = yMax.y;\n maxBoxPt.z = zMax.z;\n\n const naiveCenter = Cartesian3.midpoint(\n minBoxPt,\n maxBoxPt,\n fromPointsNaiveCenterScratch\n );\n\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\n let naiveRadius = 0;\n for (i = 0; i < numElements; i += stride) {\n currentPos.x = positions[i] + center.x;\n currentPos.y = positions[i + 1] + center.y;\n currentPos.z = positions[i + 2] + center.z;\n\n // Find the furthest point from the naive center to calculate the naive radius.\n const r = Cartesian3.magnitude(\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n );\n if (r > naiveRadius) {\n naiveRadius = r;\n }\n\n // Make adjustments to the Ritter Sphere to include all points.\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n );\n if (oldCenterToPointSquared > radiusSquared) {\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n // Calculate new radius to include the point that lies outside\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n radiusSquared = ritterRadius * ritterRadius;\n // Calculate center of new Ritter sphere\n const oldToNew = oldCenterToPoint - ritterRadius;\n ritterCenter.x =\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n oldCenterToPoint;\n ritterCenter.y =\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n oldCenterToPoint;\n ritterCenter.z =\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n oldCenterToPoint;\n }\n }\n\n if (ritterRadius < naiveRadius) {\n Cartesian3.clone(ritterCenter, result.center);\n result.radius = ritterRadius;\n } else {\n Cartesian3.clone(naiveCenter, result.center);\n result.radius = naiveRadius;\n }\n\n return result;\n};\n\n/**\n * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are\n * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\n * ensure a tight fit.\n *\n * @param {Number[]} [positionsHigh] An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point\n * is formed from three elements in the array in the order X, Y, Z.\n * @param {Number[]} [positionsLow] An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point\n * is formed from three elements in the array in the order X, Y, Z.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n *\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\n */\nBoundingSphere.fromEncodedCartesianVertices = function (\n positionsHigh,\n positionsLow,\n result\n) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (\n !defined(positionsHigh) ||\n !defined(positionsLow) ||\n positionsHigh.length !== positionsLow.length ||\n positionsHigh.length === 0\n ) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n const currentPos = fromPointsCurrentPos;\n currentPos.x = positionsHigh[0] + positionsLow[0];\n currentPos.y = positionsHigh[1] + positionsLow[1];\n currentPos.z = positionsHigh[2] + positionsLow[2];\n\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\n\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\n\n const numElements = positionsHigh.length;\n let i;\n for (i = 0; i < numElements; i += 3) {\n const x = positionsHigh[i] + positionsLow[i];\n const y = positionsHigh[i + 1] + positionsLow[i + 1];\n const z = positionsHigh[i + 2] + positionsLow[i + 2];\n\n currentPos.x = x;\n currentPos.y = y;\n currentPos.z = z;\n\n // Store points containing the the smallest and largest components\n if (x < xMin.x) {\n Cartesian3.clone(currentPos, xMin);\n }\n\n if (x > xMax.x) {\n Cartesian3.clone(currentPos, xMax);\n }\n\n if (y < yMin.y) {\n Cartesian3.clone(currentPos, yMin);\n }\n\n if (y > yMax.y) {\n Cartesian3.clone(currentPos, yMax);\n }\n\n if (z < zMin.z) {\n Cartesian3.clone(currentPos, zMin);\n }\n\n if (z > zMax.z) {\n Cartesian3.clone(currentPos, zMax);\n }\n }\n\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\n const xSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\n );\n const ySpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\n );\n const zSpan = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\n );\n\n // Set the diameter endpoints to the largest span.\n let diameter1 = xMin;\n let diameter2 = xMax;\n let maxSpan = xSpan;\n if (ySpan > maxSpan) {\n maxSpan = ySpan;\n diameter1 = yMin;\n diameter2 = yMax;\n }\n if (zSpan > maxSpan) {\n maxSpan = zSpan;\n diameter1 = zMin;\n diameter2 = zMax;\n }\n\n // Calculate the center of the initial sphere found by Ritter's algorithm\n const ritterCenter = fromPointsRitterCenter;\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\n\n // Calculate the radius of the initial sphere found by Ritter's algorithm\n let radiusSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\n );\n let ritterRadius = Math.sqrt(radiusSquared);\n\n // Find the center of the sphere found using the Naive method.\n const minBoxPt = fromPointsMinBoxPt;\n minBoxPt.x = xMin.x;\n minBoxPt.y = yMin.y;\n minBoxPt.z = zMin.z;\n\n const maxBoxPt = fromPointsMaxBoxPt;\n maxBoxPt.x = xMax.x;\n maxBoxPt.y = yMax.y;\n maxBoxPt.z = zMax.z;\n\n const naiveCenter = Cartesian3.midpoint(\n minBoxPt,\n maxBoxPt,\n fromPointsNaiveCenterScratch\n );\n\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\n let naiveRadius = 0;\n for (i = 0; i < numElements; i += 3) {\n currentPos.x = positionsHigh[i] + positionsLow[i];\n currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];\n currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];\n\n // Find the furthest point from the naive center to calculate the naive radius.\n const r = Cartesian3.magnitude(\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\n );\n if (r > naiveRadius) {\n naiveRadius = r;\n }\n\n // Make adjustments to the Ritter Sphere to include all points.\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\n );\n if (oldCenterToPointSquared > radiusSquared) {\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\n // Calculate new radius to include the point that lies outside\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\n radiusSquared = ritterRadius * ritterRadius;\n // Calculate center of new Ritter sphere\n const oldToNew = oldCenterToPoint - ritterRadius;\n ritterCenter.x =\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\n oldCenterToPoint;\n ritterCenter.y =\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\n oldCenterToPoint;\n ritterCenter.z =\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\n oldCenterToPoint;\n }\n }\n\n if (ritterRadius < naiveRadius) {\n Cartesian3.clone(ritterCenter, result.center);\n result.radius = ritterRadius;\n } else {\n Cartesian3.clone(naiveCenter, result.center);\n result.radius = naiveRadius;\n }\n\n return result;\n};\n\n/**\n * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere\n * tightly and fully encompasses the box.\n *\n * @param {Cartesian3} [corner] The minimum height over the rectangle.\n * @param {Cartesian3} [oppositeCorner] The maximum height over the rectangle.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * // Create a bounding sphere around the unit cube\n * const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));\n */\nBoundingSphere.fromCornerPoints = function (corner, oppositeCorner, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n const center = Cartesian3.midpoint(corner, oppositeCorner, result.center);\n result.radius = Cartesian3.distance(center, oppositeCorner);\n return result;\n};\n\n/**\n * Creates a bounding sphere encompassing an ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid around which to create a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);\n */\nBoundingSphere.fromEllipsoid = function (ellipsoid, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = ellipsoid.maximumRadius;\n return result;\n};\n\nconst fromBoundingSpheresScratch = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.\n *\n * @param {BoundingSphere[]} [boundingSpheres] The array of bounding spheres.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromBoundingSpheres = function (boundingSpheres, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n if (!defined(boundingSpheres) || boundingSpheres.length === 0) {\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n result.radius = 0.0;\n return result;\n }\n\n const length = boundingSpheres.length;\n if (length === 1) {\n return BoundingSphere.clone(boundingSpheres[0], result);\n }\n\n if (length === 2) {\n return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);\n }\n\n const positions = [];\n let i;\n for (i = 0; i < length; i++) {\n positions.push(boundingSpheres[i].center);\n }\n\n result = BoundingSphere.fromPoints(positions, result);\n\n const center = result.center;\n let radius = result.radius;\n for (i = 0; i < length; i++) {\n const tmp = boundingSpheres[i];\n radius = Math.max(\n radius,\n Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) +\n tmp.radius\n );\n }\n result.radius = radius;\n\n return result;\n};\n\nconst fromOrientedBoundingBoxScratchU = new Cartesian3();\nconst fromOrientedBoundingBoxScratchV = new Cartesian3();\nconst fromOrientedBoundingBoxScratchW = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.\n *\n * @param {OrientedBoundingBox} orientedBoundingBox The oriented bounding box.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromOrientedBoundingBox = function (\n orientedBoundingBox,\n result\n) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n const halfAxes = orientedBoundingBox.halfAxes;\n const u = Matrix3.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);\n const v = Matrix3.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);\n const w = Matrix3.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);\n\n Cartesian3.add(u, v, u);\n Cartesian3.add(u, w, u);\n\n result.center = Cartesian3.clone(orientedBoundingBox.center, result.center);\n result.radius = Cartesian3.magnitude(u);\n\n return result;\n};\n\nconst scratchFromTransformationCenter = new Cartesian3();\nconst scratchFromTransformationScale = new Cartesian3();\n\n/**\n * Computes a tight-fitting bounding sphere enclosing the provided affine transformation.\n *\n * @param {Matrix4} transformation The affine transformation.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.fromTransformation = function (transformation, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n const center = Matrix4.getTranslation(\n transformation,\n scratchFromTransformationCenter\n );\n const scale = Matrix4.getScale(\n transformation,\n scratchFromTransformationScale\n );\n const radius = 0.5 * Cartesian3.magnitude(scale);\n result.center = Cartesian3.clone(center, result.center);\n result.radius = radius;\n\n return result;\n};\n\n/**\n * Duplicates a BoundingSphere instance.\n *\n * @param {BoundingSphere} sphere The bounding sphere to duplicate.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)\n */\nBoundingSphere.clone = function (sphere, result) {\n if (!defined(sphere)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new BoundingSphere(sphere.center, sphere.radius);\n }\n\n result.center = Cartesian3.clone(sphere.center, result.center);\n result.radius = sphere.radius;\n return result;\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nBoundingSphere.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoundingSphere} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nBoundingSphere.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const center = value.center;\n array[startingIndex++] = center.x;\n array[startingIndex++] = center.y;\n array[startingIndex++] = center.z;\n array[startingIndex] = value.radius;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoundingSphere} [result] The object into which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\n */\nBoundingSphere.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n const center = result.center;\n center.x = array[startingIndex++];\n center.y = array[startingIndex++];\n center.z = array[startingIndex++];\n result.radius = array[startingIndex];\n return result;\n};\n\nconst unionScratch = new Cartesian3();\nconst unionScratchCenter = new Cartesian3();\n/**\n * Computes a bounding sphere that contains both the left and right bounding spheres.\n *\n * @param {BoundingSphere} left A sphere to enclose in a bounding sphere.\n * @param {BoundingSphere} right A sphere to enclose in a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.union = function (left, right, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n const leftCenter = left.center;\n const leftRadius = left.radius;\n const rightCenter = right.center;\n const rightRadius = right.radius;\n\n const toRightCenter = Cartesian3.subtract(\n rightCenter,\n leftCenter,\n unionScratch\n );\n const centerSeparation = Cartesian3.magnitude(toRightCenter);\n\n if (leftRadius >= centerSeparation + rightRadius) {\n // Left sphere wins.\n left.clone(result);\n return result;\n }\n\n if (rightRadius >= centerSeparation + leftRadius) {\n // Right sphere wins.\n right.clone(result);\n return result;\n }\n\n // There are two tangent points, one on far side of each sphere.\n const halfDistanceBetweenTangentPoints =\n (leftRadius + centerSeparation + rightRadius) * 0.5;\n\n // Compute the center point halfway between the two tangent points.\n const center = Cartesian3.multiplyByScalar(\n toRightCenter,\n (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,\n unionScratchCenter\n );\n Cartesian3.add(center, leftCenter, center);\n Cartesian3.clone(center, result.center);\n result.radius = halfDistanceBetweenTangentPoints;\n\n return result;\n};\n\nconst expandScratch = new Cartesian3();\n/**\n * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.\n *\n * @param {BoundingSphere} sphere A sphere to expand.\n * @param {Cartesian3} point A point to enclose in a bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.expand = function (sphere, point, result) {\n result = BoundingSphere.clone(sphere, result);\n\n const radius = Cartesian3.magnitude(\n Cartesian3.subtract(point, result.center, expandScratch)\n );\n if (radius > result.radius) {\n result.radius = radius;\n }\n\n return result;\n};\n\n/**\n * Determines which side of a plane a sphere is located.\n *\n * @param {BoundingSphere} sphere The bounding sphere to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n * intersects the plane.\n */\nBoundingSphere.intersectPlane = function (sphere, plane) {\n const center = sphere.center;\n const radius = sphere.radius;\n const normal = plane.normal;\n const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\n\n if (distanceToPlane < -radius) {\n // The center point is negative side of the plane normal\n return Intersect.OUTSIDE;\n } else if (distanceToPlane < radius) {\n // The center point is positive side of the plane, but radius extends beyond it; partial overlap\n return Intersect.INTERSECTING;\n }\n return Intersect.INSIDE;\n};\n\n/**\n * Applies a 4x4 affine transformation matrix to a bounding sphere.\n *\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.transform = function (sphere, transform, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n result.center = Matrix4.multiplyByPoint(\n transform,\n sphere.center,\n result.center\n );\n result.radius = Matrix4.getMaximumScale(transform) * sphere.radius;\n\n return result;\n};\n\nconst distanceSquaredToScratch = new Cartesian3();\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\n *\n * @param {BoundingSphere} sphere The sphere.\n * @param {Cartesian3} cartesian The point\n * @returns {Number} The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.\n *\n * @example\n * // Sort bounding spheres from back to front\n * spheres.sort(function(a, b) {\n * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);\n * });\n */\nBoundingSphere.distanceSquaredTo = function (sphere, cartesian) {\n const diff = Cartesian3.subtract(\n sphere.center,\n cartesian,\n distanceSquaredToScratch\n );\n\n const distance = Cartesian3.magnitude(diff) - sphere.radius;\n if (distance <= 0.0) {\n return 0.0;\n }\n\n return distance * distance;\n};\n\n/**\n * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale\n * The transformation matrix is not verified to have a uniform scale of 1.\n * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.\n *\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n *\n * @example\n * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);\n * const boundingSphere = new Cesium.BoundingSphere();\n * const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);\n */\nBoundingSphere.transformWithoutScale = function (sphere, transform, result) {\n if (!defined(result)) {\n result = new BoundingSphere();\n }\n\n result.center = Matrix4.multiplyByPoint(\n transform,\n sphere.center,\n result.center\n );\n result.radius = sphere.radius;\n\n return result;\n};\n\nconst scratchCartesian3 = new Cartesian3();\n/**\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\n * plus/minus the radius of the bounding sphere.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding sphere.\n *\n * @param {BoundingSphere} sphere The bounding sphere to calculate the distance to.\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\n */\nBoundingSphere.computePlaneDistances = function (\n sphere,\n position,\n direction,\n result\n) {\n if (!defined(result)) {\n result = new Interval();\n }\n\n const toCenter = Cartesian3.subtract(\n sphere.center,\n position,\n scratchCartesian3\n );\n const mag = Cartesian3.dot(direction, toCenter);\n\n result.start = mag - sphere.radius;\n result.stop = mag + sphere.radius;\n return result;\n};\n\nconst projectTo2DNormalScratch = new Cartesian3();\nconst projectTo2DEastScratch = new Cartesian3();\nconst projectTo2DNorthScratch = new Cartesian3();\nconst projectTo2DWestScratch = new Cartesian3();\nconst projectTo2DSouthScratch = new Cartesian3();\nconst projectTo2DCartographicScratch = new Cartographic();\nconst projectTo2DPositionsScratch = new Array(8);\nfor (let n = 0; n < 8; ++n) {\n projectTo2DPositionsScratch[n] = new Cartesian3();\n}\n\nconst projectTo2DProjection = new GeographicProjection();\n/**\n * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.\n *\n * @param {BoundingSphere} sphere The bounding sphere to transform to 2D.\n * @param {Object} [projection=GeographicProjection] The projection to 2D.\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.projectTo2D = function (sphere, projection, result) {\n projection = defaultValue(projection, projectTo2DProjection);\n\n const ellipsoid = projection.ellipsoid;\n let center = sphere.center;\n const radius = sphere.radius;\n\n let normal;\n if (Cartesian3.equals(center, Cartesian3.ZERO)) {\n // Bounding sphere is at the center. The geodetic surface normal is not\n // defined here so pick the x-axis as a fallback.\n normal = Cartesian3.clone(Cartesian3.UNIT_X, projectTo2DNormalScratch);\n } else {\n normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);\n }\n const east = Cartesian3.cross(\n Cartesian3.UNIT_Z,\n normal,\n projectTo2DEastScratch\n );\n Cartesian3.normalize(east, east);\n const north = Cartesian3.cross(normal, east, projectTo2DNorthScratch);\n Cartesian3.normalize(north, north);\n\n Cartesian3.multiplyByScalar(normal, radius, normal);\n Cartesian3.multiplyByScalar(north, radius, north);\n Cartesian3.multiplyByScalar(east, radius, east);\n\n const south = Cartesian3.negate(north, projectTo2DSouthScratch);\n const west = Cartesian3.negate(east, projectTo2DWestScratch);\n\n const positions = projectTo2DPositionsScratch;\n\n // top NE corner\n let corner = positions[0];\n Cartesian3.add(normal, north, corner);\n Cartesian3.add(corner, east, corner);\n\n // top NW corner\n corner = positions[1];\n Cartesian3.add(normal, north, corner);\n Cartesian3.add(corner, west, corner);\n\n // top SW corner\n corner = positions[2];\n Cartesian3.add(normal, south, corner);\n Cartesian3.add(corner, west, corner);\n\n // top SE corner\n corner = positions[3];\n Cartesian3.add(normal, south, corner);\n Cartesian3.add(corner, east, corner);\n\n Cartesian3.negate(normal, normal);\n\n // bottom NE corner\n corner = positions[4];\n Cartesian3.add(normal, north, corner);\n Cartesian3.add(corner, east, corner);\n\n // bottom NW corner\n corner = positions[5];\n Cartesian3.add(normal, north, corner);\n Cartesian3.add(corner, west, corner);\n\n // bottom SW corner\n corner = positions[6];\n Cartesian3.add(normal, south, corner);\n Cartesian3.add(corner, west, corner);\n\n // bottom SE corner\n corner = positions[7];\n Cartesian3.add(normal, south, corner);\n Cartesian3.add(corner, east, corner);\n\n const length = positions.length;\n for (let i = 0; i < length; ++i) {\n const position = positions[i];\n Cartesian3.add(center, position, position);\n const cartographic = ellipsoid.cartesianToCartographic(\n position,\n projectTo2DCartographicScratch\n );\n projection.project(cartographic, position);\n }\n\n result = BoundingSphere.fromPoints(positions, result);\n\n // swizzle center components\n center = result.center;\n const x = center.x;\n const y = center.y;\n const z = center.z;\n center.x = z;\n center.y = x;\n center.z = y;\n\n return result;\n};\n\n/**\n * Determines whether or not a sphere is hidden from view by the occluder.\n *\n * @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object.\n * @param {Occluder} occluder The occluder.\n * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nBoundingSphere.isOccluded = function (sphere, occluder) {\nreturn !occluder.isBoundingSphereVisible(sphere);\n};\n\n/**\n * Compares the provided BoundingSphere componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingSphere} [left] The first BoundingSphere.\n * @param {BoundingSphere} [right] The second BoundingSphere.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nBoundingSphere.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Cartesian3.equals(left.center, right.center) &&\n left.radius === right.radius)\n );\n};\n\n/**\n * Determines which side of a plane the sphere is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n * intersects the plane.\n */\nBoundingSphere.prototype.intersectPlane = function (plane) {\n return BoundingSphere.intersectPlane(this, plane);\n};\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\n *\n * @param {Cartesian3} cartesian The point\n * @returns {Number} The estimated distance squared from the bounding sphere to the point.\n *\n * @example\n * // Sort bounding spheres from back to front\n * spheres.sort(function(a, b) {\n * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\n * });\n */\nBoundingSphere.prototype.distanceSquaredTo = function (cartesian) {\n return BoundingSphere.distanceSquaredTo(this, cartesian);\n};\n\n/**\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\n * plus/minus the radius of the bounding sphere.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding sphere.\n *\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\n */\nBoundingSphere.prototype.computePlaneDistances = function (\n position,\n direction,\n result\n) {\n return BoundingSphere.computePlaneDistances(\n this,\n position,\n direction,\n result\n );\n};\n\n/**\n * Determines whether or not a sphere is hidden from view by the occluder.\n *\n * @param {Occluder} occluder The occluder.\n * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nBoundingSphere.prototype.isOccluded = function (occluder) {\n return BoundingSphere.isOccluded(this, occluder);\n};\n\n/**\n * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {BoundingSphere} [right] The right hand side BoundingSphere.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nBoundingSphere.prototype.equals = function (right) {\n return BoundingSphere.equals(this, right);\n};\n\n/**\n * Duplicates this BoundingSphere instance.\n *\n * @param {BoundingSphere} [result] The object onto which to store the result.\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\n */\nBoundingSphere.prototype.clone = function (result) {\n return BoundingSphere.clone(this, result);\n};\n\n/**\n * Computes the radius of the BoundingSphere.\n * @returns {Number} The radius of the BoundingSphere.\n */\nBoundingSphere.prototype.volume = function () {\n const radius = this.radius;\n return volumeConstant * radius * radius * radius;\n};\nexport default BoundingSphere;\n", "/**\n * Enum containing WebGL Constant values by name.\n * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context\n * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).\n *\n * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}\n * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}\n * specifications.\n *\n * @enum {Number}\n */\nconst WebGLConstants = {\n DEPTH_BUFFER_BIT: 0x00000100,\n STENCIL_BUFFER_BIT: 0x00000400,\n COLOR_BUFFER_BIT: 0x00004000,\n POINTS: 0x0000,\n LINES: 0x0001,\n LINE_LOOP: 0x0002,\n LINE_STRIP: 0x0003,\n TRIANGLES: 0x0004,\n TRIANGLE_STRIP: 0x0005,\n TRIANGLE_FAN: 0x0006,\n ZERO: 0,\n ONE: 1,\n SRC_COLOR: 0x0300,\n ONE_MINUS_SRC_COLOR: 0x0301,\n SRC_ALPHA: 0x0302,\n ONE_MINUS_SRC_ALPHA: 0x0303,\n DST_ALPHA: 0x0304,\n ONE_MINUS_DST_ALPHA: 0x0305,\n DST_COLOR: 0x0306,\n ONE_MINUS_DST_COLOR: 0x0307,\n SRC_ALPHA_SATURATE: 0x0308,\n FUNC_ADD: 0x8006,\n BLEND_EQUATION: 0x8009,\n BLEND_EQUATION_RGB: 0x8009, // same as BLEND_EQUATION\n BLEND_EQUATION_ALPHA: 0x883d,\n FUNC_SUBTRACT: 0x800a,\n FUNC_REVERSE_SUBTRACT: 0x800b,\n BLEND_DST_RGB: 0x80c8,\n BLEND_SRC_RGB: 0x80c9,\n BLEND_DST_ALPHA: 0x80ca,\n BLEND_SRC_ALPHA: 0x80cb,\n CONSTANT_COLOR: 0x8001,\n ONE_MINUS_CONSTANT_COLOR: 0x8002,\n CONSTANT_ALPHA: 0x8003,\n ONE_MINUS_CONSTANT_ALPHA: 0x8004,\n BLEND_COLOR: 0x8005,\n ARRAY_BUFFER: 0x8892,\n ELEMENT_ARRAY_BUFFER: 0x8893,\n ARRAY_BUFFER_BINDING: 0x8894,\n ELEMENT_ARRAY_BUFFER_BINDING: 0x8895,\n STREAM_DRAW: 0x88e0,\n STATIC_DRAW: 0x88e4,\n DYNAMIC_DRAW: 0x88e8,\n BUFFER_SIZE: 0x8764,\n BUFFER_USAGE: 0x8765,\n CURRENT_VERTEX_ATTRIB: 0x8626,\n FRONT: 0x0404,\n BACK: 0x0405,\n FRONT_AND_BACK: 0x0408,\n CULL_FACE: 0x0b44,\n BLEND: 0x0be2,\n DITHER: 0x0bd0,\n STENCIL_TEST: 0x0b90,\n DEPTH_TEST: 0x0b71,\n SCISSOR_TEST: 0x0c11,\n POLYGON_OFFSET_FILL: 0x8037,\n SAMPLE_ALPHA_TO_COVERAGE: 0x809e,\n SAMPLE_COVERAGE: 0x80a0,\n NO_ERROR: 0,\n INVALID_ENUM: 0x0500,\n INVALID_VALUE: 0x0501,\n INVALID_OPERATION: 0x0502,\n OUT_OF_MEMORY: 0x0505,\n CW: 0x0900,\n CCW: 0x0901,\n LINE_WIDTH: 0x0b21,\n ALIASED_POINT_SIZE_RANGE: 0x846d,\n ALIASED_LINE_WIDTH_RANGE: 0x846e,\n CULL_FACE_MODE: 0x0b45,\n FRONT_FACE: 0x0b46,\n DEPTH_RANGE: 0x0b70,\n DEPTH_WRITEMASK: 0x0b72,\n DEPTH_CLEAR_VALUE: 0x0b73,\n DEPTH_FUNC: 0x0b74,\n STENCIL_CLEAR_VALUE: 0x0b91,\n STENCIL_FUNC: 0x0b92,\n STENCIL_FAIL: 0x0b94,\n STENCIL_PASS_DEPTH_FAIL: 0x0b95,\n STENCIL_PASS_DEPTH_PASS: 0x0b96,\n STENCIL_REF: 0x0b97,\n STENCIL_VALUE_MASK: 0x0b93,\n STENCIL_WRITEMASK: 0x0b98,\n STENCIL_BACK_FUNC: 0x8800,\n STENCIL_BACK_FAIL: 0x8801,\n STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802,\n STENCIL_BACK_PASS_DEPTH_PASS: 0x8803,\n STENCIL_BACK_REF: 0x8ca3,\n STENCIL_BACK_VALUE_MASK: 0x8ca4,\n STENCIL_BACK_WRITEMASK: 0x8ca5,\n VIEWPORT: 0x0ba2,\n SCISSOR_BOX: 0x0c10,\n COLOR_CLEAR_VALUE: 0x0c22,\n COLOR_WRITEMASK: 0x0c23,\n UNPACK_ALIGNMENT: 0x0cf5,\n PACK_ALIGNMENT: 0x0d05,\n MAX_TEXTURE_SIZE: 0x0d33,\n MAX_VIEWPORT_DIMS: 0x0d3a,\n SUBPIXEL_BITS: 0x0d50,\n RED_BITS: 0x0d52,\n GREEN_BITS: 0x0d53,\n BLUE_BITS: 0x0d54,\n ALPHA_BITS: 0x0d55,\n DEPTH_BITS: 0x0d56,\n STENCIL_BITS: 0x0d57,\n POLYGON_OFFSET_UNITS: 0x2a00,\n POLYGON_OFFSET_FACTOR: 0x8038,\n TEXTURE_BINDING_2D: 0x8069,\n SAMPLE_BUFFERS: 0x80a8,\n SAMPLES: 0x80a9,\n SAMPLE_COVERAGE_VALUE: 0x80aa,\n SAMPLE_COVERAGE_INVERT: 0x80ab,\n COMPRESSED_TEXTURE_FORMATS: 0x86a3,\n DONT_CARE: 0x1100,\n FASTEST: 0x1101,\n NICEST: 0x1102,\n GENERATE_MIPMAP_HINT: 0x8192,\n BYTE: 0x1400,\n UNSIGNED_BYTE: 0x1401,\n SHORT: 0x1402,\n UNSIGNED_SHORT: 0x1403,\n INT: 0x1404,\n UNSIGNED_INT: 0x1405,\n FLOAT: 0x1406,\n DEPTH_COMPONENT: 0x1902,\n ALPHA: 0x1906,\n RGB: 0x1907,\n RGBA: 0x1908,\n LUMINANCE: 0x1909,\n LUMINANCE_ALPHA: 0x190a,\n UNSIGNED_SHORT_4_4_4_4: 0x8033,\n UNSIGNED_SHORT_5_5_5_1: 0x8034,\n UNSIGNED_SHORT_5_6_5: 0x8363,\n FRAGMENT_SHADER: 0x8b30,\n VERTEX_SHADER: 0x8b31,\n MAX_VERTEX_ATTRIBS: 0x8869,\n MAX_VERTEX_UNIFORM_VECTORS: 0x8dfb,\n MAX_VARYING_VECTORS: 0x8dfc,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8b4d,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8b4c,\n MAX_TEXTURE_IMAGE_UNITS: 0x8872,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0x8dfd,\n SHADER_TYPE: 0x8b4f,\n DELETE_STATUS: 0x8b80,\n LINK_STATUS: 0x8b82,\n VALIDATE_STATUS: 0x8b83,\n ATTACHED_SHADERS: 0x8b85,\n ACTIVE_UNIFORMS: 0x8b86,\n ACTIVE_ATTRIBUTES: 0x8b89,\n SHADING_LANGUAGE_VERSION: 0x8b8c,\n CURRENT_PROGRAM: 0x8b8d,\n NEVER: 0x0200,\n LESS: 0x0201,\n EQUAL: 0x0202,\n LEQUAL: 0x0203,\n GREATER: 0x0204,\n NOTEQUAL: 0x0205,\n GEQUAL: 0x0206,\n ALWAYS: 0x0207,\n KEEP: 0x1e00,\n REPLACE: 0x1e01,\n INCR: 0x1e02,\n DECR: 0x1e03,\n INVERT: 0x150a,\n INCR_WRAP: 0x8507,\n DECR_WRAP: 0x8508,\n VENDOR: 0x1f00,\n RENDERER: 0x1f01,\n VERSION: 0x1f02,\n NEAREST: 0x2600,\n LINEAR: 0x2601,\n NEAREST_MIPMAP_NEAREST: 0x2700,\n LINEAR_MIPMAP_NEAREST: 0x2701,\n NEAREST_MIPMAP_LINEAR: 0x2702,\n LINEAR_MIPMAP_LINEAR: 0x2703,\n TEXTURE_MAG_FILTER: 0x2800,\n TEXTURE_MIN_FILTER: 0x2801,\n TEXTURE_WRAP_S: 0x2802,\n TEXTURE_WRAP_T: 0x2803,\n TEXTURE_2D: 0x0de1,\n TEXTURE: 0x1702,\n TEXTURE_CUBE_MAP: 0x8513,\n TEXTURE_BINDING_CUBE_MAP: 0x8514,\n TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515,\n TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516,\n TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517,\n TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518,\n TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519,\n TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851a,\n MAX_CUBE_MAP_TEXTURE_SIZE: 0x851c,\n TEXTURE0: 0x84c0,\n TEXTURE1: 0x84c1,\n TEXTURE2: 0x84c2,\n TEXTURE3: 0x84c3,\n TEXTURE4: 0x84c4,\n TEXTURE5: 0x84c5,\n TEXTURE6: 0x84c6,\n TEXTURE7: 0x84c7,\n TEXTURE8: 0x84c8,\n TEXTURE9: 0x84c9,\n TEXTURE10: 0x84ca,\n TEXTURE11: 0x84cb,\n TEXTURE12: 0x84cc,\n TEXTURE13: 0x84cd,\n TEXTURE14: 0x84ce,\n TEXTURE15: 0x84cf,\n TEXTURE16: 0x84d0,\n TEXTURE17: 0x84d1,\n TEXTURE18: 0x84d2,\n TEXTURE19: 0x84d3,\n TEXTURE20: 0x84d4,\n TEXTURE21: 0x84d5,\n TEXTURE22: 0x84d6,\n TEXTURE23: 0x84d7,\n TEXTURE24: 0x84d8,\n TEXTURE25: 0x84d9,\n TEXTURE26: 0x84da,\n TEXTURE27: 0x84db,\n TEXTURE28: 0x84dc,\n TEXTURE29: 0x84dd,\n TEXTURE30: 0x84de,\n TEXTURE31: 0x84df,\n ACTIVE_TEXTURE: 0x84e0,\n REPEAT: 0x2901,\n CLAMP_TO_EDGE: 0x812f,\n MIRRORED_REPEAT: 0x8370,\n FLOAT_VEC2: 0x8b50,\n FLOAT_VEC3: 0x8b51,\n FLOAT_VEC4: 0x8b52,\n INT_VEC2: 0x8b53,\n INT_VEC3: 0x8b54,\n INT_VEC4: 0x8b55,\n BOOL: 0x8b56,\n BOOL_VEC2: 0x8b57,\n BOOL_VEC3: 0x8b58,\n BOOL_VEC4: 0x8b59,\n FLOAT_MAT2: 0x8b5a,\n FLOAT_MAT3: 0x8b5b,\n FLOAT_MAT4: 0x8b5c,\n SAMPLER_2D: 0x8b5e,\n SAMPLER_CUBE: 0x8b60,\n VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622,\n VERTEX_ATTRIB_ARRAY_SIZE: 0x8623,\n VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624,\n VERTEX_ATTRIB_ARRAY_TYPE: 0x8625,\n VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886a,\n VERTEX_ATTRIB_ARRAY_POINTER: 0x8645,\n VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889f,\n IMPLEMENTATION_COLOR_READ_TYPE: 0x8b9a,\n IMPLEMENTATION_COLOR_READ_FORMAT: 0x8b9b,\n COMPILE_STATUS: 0x8b81,\n LOW_FLOAT: 0x8df0,\n MEDIUM_FLOAT: 0x8df1,\n HIGH_FLOAT: 0x8df2,\n LOW_INT: 0x8df3,\n MEDIUM_INT: 0x8df4,\n HIGH_INT: 0x8df5,\n FRAMEBUFFER: 0x8d40,\n RENDERBUFFER: 0x8d41,\n RGBA4: 0x8056,\n RGB5_A1: 0x8057,\n RGB565: 0x8d62,\n DEPTH_COMPONENT16: 0x81a5,\n STENCIL_INDEX: 0x1901,\n STENCIL_INDEX8: 0x8d48,\n DEPTH_STENCIL: 0x84f9,\n RENDERBUFFER_WIDTH: 0x8d42,\n RENDERBUFFER_HEIGHT: 0x8d43,\n RENDERBUFFER_INTERNAL_FORMAT: 0x8d44,\n RENDERBUFFER_RED_SIZE: 0x8d50,\n RENDERBUFFER_GREEN_SIZE: 0x8d51,\n RENDERBUFFER_BLUE_SIZE: 0x8d52,\n RENDERBUFFER_ALPHA_SIZE: 0x8d53,\n RENDERBUFFER_DEPTH_SIZE: 0x8d54,\n RENDERBUFFER_STENCIL_SIZE: 0x8d55,\n FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8cd0,\n FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8cd1,\n FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8cd2,\n FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8cd3,\n COLOR_ATTACHMENT0: 0x8ce0,\n DEPTH_ATTACHMENT: 0x8d00,\n STENCIL_ATTACHMENT: 0x8d20,\n DEPTH_STENCIL_ATTACHMENT: 0x821a,\n NONE: 0,\n FRAMEBUFFER_COMPLETE: 0x8cd5,\n FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8cd6,\n FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8cd7,\n FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8cd9,\n FRAMEBUFFER_UNSUPPORTED: 0x8cdd,\n FRAMEBUFFER_BINDING: 0x8ca6,\n RENDERBUFFER_BINDING: 0x8ca7,\n MAX_RENDERBUFFER_SIZE: 0x84e8,\n INVALID_FRAMEBUFFER_OPERATION: 0x0506,\n UNPACK_FLIP_Y_WEBGL: 0x9240,\n UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241,\n CONTEXT_LOST_WEBGL: 0x9242,\n UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243,\n BROWSER_DEFAULT_WEBGL: 0x9244,\n\n // WEBGL_compressed_texture_s3tc\n COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,\n COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,\n COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,\n COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,\n\n // WEBGL_compressed_texture_pvrtc\n COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,\n COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,\n COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,\n COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,\n\n // WEBGL_compressed_texture_astc\n COMPRESSED_RGBA_ASTC_4x4_WEBGL: 0x93b0,\n\n // WEBGL_compressed_texture_etc1\n COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,\n\n // EXT_texture_compression_bptc\n COMPRESSED_RGBA_BPTC_UNORM: 0x8e8c,\n\n // EXT_color_buffer_half_float\n HALF_FLOAT_OES: 0x8d61,\n\n // Desktop OpenGL\n DOUBLE: 0x140a,\n\n // WebGL 2\n READ_BUFFER: 0x0c02,\n UNPACK_ROW_LENGTH: 0x0cf2,\n UNPACK_SKIP_ROWS: 0x0cf3,\n UNPACK_SKIP_PIXELS: 0x0cf4,\n PACK_ROW_LENGTH: 0x0d02,\n PACK_SKIP_ROWS: 0x0d03,\n PACK_SKIP_PIXELS: 0x0d04,\n COLOR: 0x1800,\n DEPTH: 0x1801,\n STENCIL: 0x1802,\n RED: 0x1903,\n RGB8: 0x8051,\n RGBA8: 0x8058,\n RGB10_A2: 0x8059,\n TEXTURE_BINDING_3D: 0x806a,\n UNPACK_SKIP_IMAGES: 0x806d,\n UNPACK_IMAGE_HEIGHT: 0x806e,\n TEXTURE_3D: 0x806f,\n TEXTURE_WRAP_R: 0x8072,\n MAX_3D_TEXTURE_SIZE: 0x8073,\n UNSIGNED_INT_2_10_10_10_REV: 0x8368,\n MAX_ELEMENTS_VERTICES: 0x80e8,\n MAX_ELEMENTS_INDICES: 0x80e9,\n TEXTURE_MIN_LOD: 0x813a,\n TEXTURE_MAX_LOD: 0x813b,\n TEXTURE_BASE_LEVEL: 0x813c,\n TEXTURE_MAX_LEVEL: 0x813d,\n MIN: 0x8007,\n MAX: 0x8008,\n DEPTH_COMPONENT24: 0x81a6,\n MAX_TEXTURE_LOD_BIAS: 0x84fd,\n TEXTURE_COMPARE_MODE: 0x884c,\n TEXTURE_COMPARE_FUNC: 0x884d,\n CURRENT_QUERY: 0x8865,\n QUERY_RESULT: 0x8866,\n QUERY_RESULT_AVAILABLE: 0x8867,\n STREAM_READ: 0x88e1,\n STREAM_COPY: 0x88e2,\n STATIC_READ: 0x88e5,\n STATIC_COPY: 0x88e6,\n DYNAMIC_READ: 0x88e9,\n DYNAMIC_COPY: 0x88ea,\n MAX_DRAW_BUFFERS: 0x8824,\n DRAW_BUFFER0: 0x8825,\n DRAW_BUFFER1: 0x8826,\n DRAW_BUFFER2: 0x8827,\n DRAW_BUFFER3: 0x8828,\n DRAW_BUFFER4: 0x8829,\n DRAW_BUFFER5: 0x882a,\n DRAW_BUFFER6: 0x882b,\n DRAW_BUFFER7: 0x882c,\n DRAW_BUFFER8: 0x882d,\n DRAW_BUFFER9: 0x882e,\n DRAW_BUFFER10: 0x882f,\n DRAW_BUFFER11: 0x8830,\n DRAW_BUFFER12: 0x8831,\n DRAW_BUFFER13: 0x8832,\n DRAW_BUFFER14: 0x8833,\n DRAW_BUFFER15: 0x8834,\n MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8b49,\n MAX_VERTEX_UNIFORM_COMPONENTS: 0x8b4a,\n SAMPLER_3D: 0x8b5f,\n SAMPLER_2D_SHADOW: 0x8b62,\n FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8b8b,\n PIXEL_PACK_BUFFER: 0x88eb,\n PIXEL_UNPACK_BUFFER: 0x88ec,\n PIXEL_PACK_BUFFER_BINDING: 0x88ed,\n PIXEL_UNPACK_BUFFER_BINDING: 0x88ef,\n FLOAT_MAT2x3: 0x8b65,\n FLOAT_MAT2x4: 0x8b66,\n FLOAT_MAT3x2: 0x8b67,\n FLOAT_MAT3x4: 0x8b68,\n FLOAT_MAT4x2: 0x8b69,\n FLOAT_MAT4x3: 0x8b6a,\n SRGB: 0x8c40,\n SRGB8: 0x8c41,\n SRGB8_ALPHA8: 0x8c43,\n COMPARE_REF_TO_TEXTURE: 0x884e,\n RGBA32F: 0x8814,\n RGB32F: 0x8815,\n RGBA16F: 0x881a,\n RGB16F: 0x881b,\n VERTEX_ATTRIB_ARRAY_INTEGER: 0x88fd,\n MAX_ARRAY_TEXTURE_LAYERS: 0x88ff,\n MIN_PROGRAM_TEXEL_OFFSET: 0x8904,\n MAX_PROGRAM_TEXEL_OFFSET: 0x8905,\n MAX_VARYING_COMPONENTS: 0x8b4b,\n TEXTURE_2D_ARRAY: 0x8c1a,\n TEXTURE_BINDING_2D_ARRAY: 0x8c1d,\n R11F_G11F_B10F: 0x8c3a,\n UNSIGNED_INT_10F_11F_11F_REV: 0x8c3b,\n RGB9_E5: 0x8c3d,\n UNSIGNED_INT_5_9_9_9_REV: 0x8c3e,\n TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8c7f,\n MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8c80,\n TRANSFORM_FEEDBACK_VARYINGS: 0x8c83,\n TRANSFORM_FEEDBACK_BUFFER_START: 0x8c84,\n TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8c85,\n TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8c88,\n RASTERIZER_DISCARD: 0x8c89,\n MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8c8a,\n MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8c8b,\n INTERLEAVED_ATTRIBS: 0x8c8c,\n SEPARATE_ATTRIBS: 0x8c8d,\n TRANSFORM_FEEDBACK_BUFFER: 0x8c8e,\n TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8c8f,\n RGBA32UI: 0x8d70,\n RGB32UI: 0x8d71,\n RGBA16UI: 0x8d76,\n RGB16UI: 0x8d77,\n RGBA8UI: 0x8d7c,\n RGB8UI: 0x8d7d,\n RGBA32I: 0x8d82,\n RGB32I: 0x8d83,\n RGBA16I: 0x8d88,\n RGB16I: 0x8d89,\n RGBA8I: 0x8d8e,\n RGB8I: 0x8d8f,\n RED_INTEGER: 0x8d94,\n RGB_INTEGER: 0x8d98,\n RGBA_INTEGER: 0x8d99,\n SAMPLER_2D_ARRAY: 0x8dc1,\n SAMPLER_2D_ARRAY_SHADOW: 0x8dc4,\n SAMPLER_CUBE_SHADOW: 0x8dc5,\n UNSIGNED_INT_VEC2: 0x8dc6,\n UNSIGNED_INT_VEC3: 0x8dc7,\n UNSIGNED_INT_VEC4: 0x8dc8,\n INT_SAMPLER_2D: 0x8dca,\n INT_SAMPLER_3D: 0x8dcb,\n INT_SAMPLER_CUBE: 0x8dcc,\n INT_SAMPLER_2D_ARRAY: 0x8dcf,\n UNSIGNED_INT_SAMPLER_2D: 0x8dd2,\n UNSIGNED_INT_SAMPLER_3D: 0x8dd3,\n UNSIGNED_INT_SAMPLER_CUBE: 0x8dd4,\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8dd7,\n DEPTH_COMPONENT32F: 0x8cac,\n DEPTH32F_STENCIL8: 0x8cad,\n FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8dad,\n FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210,\n FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211,\n FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212,\n FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213,\n FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214,\n FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215,\n FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216,\n FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217,\n FRAMEBUFFER_DEFAULT: 0x8218,\n UNSIGNED_INT_24_8: 0x84fa,\n DEPTH24_STENCIL8: 0x88f0,\n UNSIGNED_NORMALIZED: 0x8c17,\n DRAW_FRAMEBUFFER_BINDING: 0x8ca6, // Same as FRAMEBUFFER_BINDING\n READ_FRAMEBUFFER: 0x8ca8,\n DRAW_FRAMEBUFFER: 0x8ca9,\n READ_FRAMEBUFFER_BINDING: 0x8caa,\n RENDERBUFFER_SAMPLES: 0x8cab,\n FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8cd4,\n MAX_COLOR_ATTACHMENTS: 0x8cdf,\n COLOR_ATTACHMENT1: 0x8ce1,\n COLOR_ATTACHMENT2: 0x8ce2,\n COLOR_ATTACHMENT3: 0x8ce3,\n COLOR_ATTACHMENT4: 0x8ce4,\n COLOR_ATTACHMENT5: 0x8ce5,\n COLOR_ATTACHMENT6: 0x8ce6,\n COLOR_ATTACHMENT7: 0x8ce7,\n COLOR_ATTACHMENT8: 0x8ce8,\n COLOR_ATTACHMENT9: 0x8ce9,\n COLOR_ATTACHMENT10: 0x8cea,\n COLOR_ATTACHMENT11: 0x8ceb,\n COLOR_ATTACHMENT12: 0x8cec,\n COLOR_ATTACHMENT13: 0x8ced,\n COLOR_ATTACHMENT14: 0x8cee,\n COLOR_ATTACHMENT15: 0x8cef,\n FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8d56,\n MAX_SAMPLES: 0x8d57,\n HALF_FLOAT: 0x140b,\n RG: 0x8227,\n RG_INTEGER: 0x8228,\n R8: 0x8229,\n RG8: 0x822b,\n R16F: 0x822d,\n R32F: 0x822e,\n RG16F: 0x822f,\n RG32F: 0x8230,\n R8I: 0x8231,\n R8UI: 0x8232,\n R16I: 0x8233,\n R16UI: 0x8234,\n R32I: 0x8235,\n R32UI: 0x8236,\n RG8I: 0x8237,\n RG8UI: 0x8238,\n RG16I: 0x8239,\n RG16UI: 0x823a,\n RG32I: 0x823b,\n RG32UI: 0x823c,\n VERTEX_ARRAY_BINDING: 0x85b5,\n R8_SNORM: 0x8f94,\n RG8_SNORM: 0x8f95,\n RGB8_SNORM: 0x8f96,\n RGBA8_SNORM: 0x8f97,\n SIGNED_NORMALIZED: 0x8f9c,\n COPY_READ_BUFFER: 0x8f36,\n COPY_WRITE_BUFFER: 0x8f37,\n COPY_READ_BUFFER_BINDING: 0x8f36, // Same as COPY_READ_BUFFER\n COPY_WRITE_BUFFER_BINDING: 0x8f37, // Same as COPY_WRITE_BUFFER\n UNIFORM_BUFFER: 0x8a11,\n UNIFORM_BUFFER_BINDING: 0x8a28,\n UNIFORM_BUFFER_START: 0x8a29,\n UNIFORM_BUFFER_SIZE: 0x8a2a,\n MAX_VERTEX_UNIFORM_BLOCKS: 0x8a2b,\n MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8a2d,\n MAX_COMBINED_UNIFORM_BLOCKS: 0x8a2e,\n MAX_UNIFORM_BUFFER_BINDINGS: 0x8a2f,\n MAX_UNIFORM_BLOCK_SIZE: 0x8a30,\n MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8a31,\n MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8a33,\n UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8a34,\n ACTIVE_UNIFORM_BLOCKS: 0x8a36,\n UNIFORM_TYPE: 0x8a37,\n UNIFORM_SIZE: 0x8a38,\n UNIFORM_BLOCK_INDEX: 0x8a3a,\n UNIFORM_OFFSET: 0x8a3b,\n UNIFORM_ARRAY_STRIDE: 0x8a3c,\n UNIFORM_MATRIX_STRIDE: 0x8a3d,\n UNIFORM_IS_ROW_MAJOR: 0x8a3e,\n UNIFORM_BLOCK_BINDING: 0x8a3f,\n UNIFORM_BLOCK_DATA_SIZE: 0x8a40,\n UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8a42,\n UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8a43,\n UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8a44,\n UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8a46,\n INVALID_INDEX: 0xffffffff,\n MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122,\n MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125,\n MAX_SERVER_WAIT_TIMEOUT: 0x9111,\n OBJECT_TYPE: 0x9112,\n SYNC_CONDITION: 0x9113,\n SYNC_STATUS: 0x9114,\n SYNC_FLAGS: 0x9115,\n SYNC_FENCE: 0x9116,\n SYNC_GPU_COMMANDS_COMPLETE: 0x9117,\n UNSIGNALED: 0x9118,\n SIGNALED: 0x9119,\n ALREADY_SIGNALED: 0x911a,\n TIMEOUT_EXPIRED: 0x911b,\n CONDITION_SATISFIED: 0x911c,\n WAIT_FAILED: 0x911d,\n SYNC_FLUSH_COMMANDS_BIT: 0x00000001,\n VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88fe,\n ANY_SAMPLES_PASSED: 0x8c2f,\n ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8d6a,\n SAMPLER_BINDING: 0x8919,\n RGB10_A2UI: 0x906f,\n INT_2_10_10_10_REV: 0x8d9f,\n TRANSFORM_FEEDBACK: 0x8e22,\n TRANSFORM_FEEDBACK_PAUSED: 0x8e23,\n TRANSFORM_FEEDBACK_ACTIVE: 0x8e24,\n TRANSFORM_FEEDBACK_BINDING: 0x8e25,\n COMPRESSED_R11_EAC: 0x9270,\n COMPRESSED_SIGNED_R11_EAC: 0x9271,\n COMPRESSED_RG11_EAC: 0x9272,\n COMPRESSED_SIGNED_RG11_EAC: 0x9273,\n COMPRESSED_RGB8_ETC2: 0x9274,\n COMPRESSED_SRGB8_ETC2: 0x9275,\n COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276,\n COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277,\n COMPRESSED_RGBA8_ETC2_EAC: 0x9278,\n COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279,\n TEXTURE_IMMUTABLE_FORMAT: 0x912f,\n MAX_ELEMENT_INDEX: 0x8d6b,\n TEXTURE_IMMUTABLE_LEVELS: 0x82df,\n\n // Extensions\n MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84ff,\n};\nexport default Object.freeze(WebGLConstants);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * WebGL component datatypes. Components are intrinsics,\n * which form attributes, which form vertices.\n *\n * @enum {Number}\n */\nconst ComponentDatatype = {\n /**\n * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type\n * of an element in <code>Int8Array</code>.\n *\n * @type {Number}\n * @constant\n */\n BYTE: WebGLConstants.BYTE,\n\n /**\n * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type\n * of an element in <code>Uint8Array</code>.\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n\n /**\n * 16-bit signed short corresponding to <code>SHORT</code> and the type\n * of an element in <code>Int16Array</code>.\n *\n * @type {Number}\n * @constant\n */\n SHORT: WebGLConstants.SHORT,\n\n /**\n * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type\n * of an element in <code>Uint16Array</code>.\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n\n /**\n * 32-bit signed int corresponding to <code>INT</code> and the type\n * of an element in <code>Int32Array</code>.\n *\n * @memberOf ComponentDatatype\n *\n * @type {Number}\n * @constant\n */\n INT: WebGLConstants.INT,\n\n /**\n * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type\n * of an element in <code>Uint32Array</code>.\n *\n * @memberOf ComponentDatatype\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n\n /**\n * 32-bit floating-point corresponding to <code>FLOAT</code> and the type\n * of an element in <code>Float32Array</code>.\n *\n * @type {Number}\n * @constant\n */\n FLOAT: WebGLConstants.FLOAT,\n\n /**\n * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;\n * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})\n * and the type of an element in <code>Float64Array</code>.\n *\n * @memberOf ComponentDatatype\n *\n * @type {Number}\n * @constant\n * @default 0x140A\n */\n DOUBLE: WebGLConstants.DOUBLE,\n};\n\n/**\n * Returns the size, in bytes, of the corresponding datatype.\n *\n * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.\n * @returns {Number} The size in bytes.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n *\n * @example\n * // Returns Int8Array.BYTES_PER_ELEMENT\n * const size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);\n */\nComponentDatatype.getSizeInBytes = function (componentDatatype) {\n switch (componentDatatype) {\n case ComponentDatatype.BYTE:\n return Int8Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.UNSIGNED_BYTE:\n return Uint8Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.SHORT:\n return Int16Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.UNSIGNED_SHORT:\n return Uint16Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.INT:\n return Int32Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.UNSIGNED_INT:\n return Uint32Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.FLOAT:\n return Float32Array.BYTES_PER_ELEMENT;\n case ComponentDatatype.DOUBLE:\n return Float64Array.BYTES_PER_ELEMENT;\n}\n};\n\n/**\n * Gets the {@link ComponentDatatype} for the provided TypedArray instance.\n *\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array.\n * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.\n */\nComponentDatatype.fromTypedArray = function (array) {\n if (array instanceof Int8Array) {\n return ComponentDatatype.BYTE;\n }\n if (array instanceof Uint8Array) {\n return ComponentDatatype.UNSIGNED_BYTE;\n }\n if (array instanceof Int16Array) {\n return ComponentDatatype.SHORT;\n }\n if (array instanceof Uint16Array) {\n return ComponentDatatype.UNSIGNED_SHORT;\n }\n if (array instanceof Int32Array) {\n return ComponentDatatype.INT;\n }\n if (array instanceof Uint32Array) {\n return ComponentDatatype.UNSIGNED_INT;\n }\n if (array instanceof Float32Array) {\n return ComponentDatatype.FLOAT;\n }\n if (array instanceof Float64Array) {\n return ComponentDatatype.DOUBLE;\n }\n\n};\n\n/**\n * Validates that the provided component datatype is a valid {@link ComponentDatatype}\n *\n * @param {ComponentDatatype} componentDatatype The component datatype to validate.\n * @returns {Boolean} <code>true</code> if the provided component datatype is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {\n * throw new Cesium.DeveloperError('componentDatatype must be a valid value.');\n * }\n */\nComponentDatatype.validate = function (componentDatatype) {\n return (\n defined(componentDatatype) &&\n (componentDatatype === ComponentDatatype.BYTE ||\n componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||\n componentDatatype === ComponentDatatype.SHORT ||\n componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||\n componentDatatype === ComponentDatatype.INT ||\n componentDatatype === ComponentDatatype.UNSIGNED_INT ||\n componentDatatype === ComponentDatatype.FLOAT ||\n componentDatatype === ComponentDatatype.DOUBLE)\n );\n};\n\n/**\n * Creates a typed array corresponding to component data type.\n *\n * @param {ComponentDatatype} componentDatatype The component data type.\n * @param {Number|Array} valuesOrLength The length of the array to create or an array.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n *\n * @example\n * // creates a Float32Array with length of 100\n * const typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);\n */\nComponentDatatype.createTypedArray = function (\n componentDatatype,\n valuesOrLength\n) {\n switch (componentDatatype) {\n case ComponentDatatype.BYTE:\n return new Int8Array(valuesOrLength);\n case ComponentDatatype.UNSIGNED_BYTE:\n return new Uint8Array(valuesOrLength);\n case ComponentDatatype.SHORT:\n return new Int16Array(valuesOrLength);\n case ComponentDatatype.UNSIGNED_SHORT:\n return new Uint16Array(valuesOrLength);\n case ComponentDatatype.INT:\n return new Int32Array(valuesOrLength);\n case ComponentDatatype.UNSIGNED_INT:\n return new Uint32Array(valuesOrLength);\n case ComponentDatatype.FLOAT:\n return new Float32Array(valuesOrLength);\n case ComponentDatatype.DOUBLE:\n return new Float64Array(valuesOrLength);\n}\n};\n\n/**\n * Creates a typed view of an array of bytes.\n *\n * @param {ComponentDatatype} componentDatatype The type of the view to create.\n * @param {ArrayBuffer} buffer The buffer storage to use for the view.\n * @param {Number} [byteOffset] The offset, in bytes, to the first element in the view.\n * @param {Number} [length] The number of elements in the view.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.\n *\n * @exception {DeveloperError} componentDatatype is not a valid value.\n */\nComponentDatatype.createArrayBufferView = function (\n componentDatatype,\n buffer,\n byteOffset,\n length\n) {\n byteOffset = defaultValue(byteOffset, 0);\n length = defaultValue(\n length,\n (buffer.byteLength - byteOffset) /\n ComponentDatatype.getSizeInBytes(componentDatatype)\n );\n\n switch (componentDatatype) {\n case ComponentDatatype.BYTE:\n return new Int8Array(buffer, byteOffset, length);\n case ComponentDatatype.UNSIGNED_BYTE:\n return new Uint8Array(buffer, byteOffset, length);\n case ComponentDatatype.SHORT:\n return new Int16Array(buffer, byteOffset, length);\n case ComponentDatatype.UNSIGNED_SHORT:\n return new Uint16Array(buffer, byteOffset, length);\n case ComponentDatatype.INT:\n return new Int32Array(buffer, byteOffset, length);\n case ComponentDatatype.UNSIGNED_INT:\n return new Uint32Array(buffer, byteOffset, length);\n case ComponentDatatype.FLOAT:\n return new Float32Array(buffer, byteOffset, length);\n case ComponentDatatype.DOUBLE:\n return new Float64Array(buffer, byteOffset, length);\n}\n};\n\n/**\n * Get the ComponentDatatype from its name.\n *\n * @param {String} name The name of the ComponentDatatype.\n * @returns {ComponentDatatype} The ComponentDatatype.\n *\n * @exception {DeveloperError} name is not a valid value.\n */\nComponentDatatype.fromName = function (name) {\n switch (name) {\n case \"BYTE\":\n return ComponentDatatype.BYTE;\n case \"UNSIGNED_BYTE\":\n return ComponentDatatype.UNSIGNED_BYTE;\n case \"SHORT\":\n return ComponentDatatype.SHORT;\n case \"UNSIGNED_SHORT\":\n return ComponentDatatype.UNSIGNED_SHORT;\n case \"INT\":\n return ComponentDatatype.INT;\n case \"UNSIGNED_INT\":\n return ComponentDatatype.UNSIGNED_INT;\n case \"FLOAT\":\n return ComponentDatatype.FLOAT;\n case \"DOUBLE\":\n return ComponentDatatype.DOUBLE;\n}\n};\nexport default Object.freeze(ComponentDatatype);\n", "/**\n * @private\n */\nconst GeometryType = {\n NONE: 0,\n TRIANGLES: 1,\n LINES: 2,\n POLYLINES: 3,\n};\nexport default Object.freeze(GeometryType);\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A 2x2 matrix, indexable as a column-major order array.\n * Constructor parameters are in row-major order for code readability.\n * @alias Matrix2\n * @constructor\n * @implements {ArrayLike<number>}\n *\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\n *\n * @see Matrix2.fromArray\n * @see Matrix2.fromColumnMajorArray\n * @see Matrix2.fromRowMajorArray\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.fromRotation\n * @see Matrix3\n * @see Matrix4\n */\nfunction Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {\n this[0] = defaultValue(column0Row0, 0.0);\n this[1] = defaultValue(column0Row1, 0.0);\n this[2] = defaultValue(column1Row0, 0.0);\n this[3] = defaultValue(column1Row1, 0.0);\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nMatrix2.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Matrix2} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nMatrix2.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value[0];\n array[startingIndex++] = value[1];\n array[startingIndex++] = value[2];\n array[startingIndex++] = value[3];\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Matrix2} [result] The object into which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n */\nMatrix2.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Matrix2();\n }\n\n result[0] = array[startingIndex++];\n result[1] = array[startingIndex++];\n result[2] = array[startingIndex++];\n result[3] = array[startingIndex++];\n return result;\n};\n\n/**\n * Flattens an array of Matrix2s into an array of components. The components\n * are stored in column-major order.\n *\n * @param {Matrix2[]} array The array of matrices to pack.\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\n * @returns {Number[]} The packed array.\n */\nMatrix2.packArray = function (array, result) {\n const length = array.length;\n const resultLength = length * 4;\n if (!defined(result)) {\n result = new Array(resultLength);\n } else if (!Array.isArray(result) && result.length !== resultLength) {\n} else if (result.length !== resultLength) {\n result.length = resultLength;\n }\n\n for (let i = 0; i < length; ++i) {\n Matrix2.pack(array[i], result, i * 4);\n }\n return result;\n};\n\n/**\n * Unpacks an array of column-major matrix components into an array of Matrix2s.\n *\n * @param {Number[]} array The array of components to unpack.\n * @param {Matrix2[]} [result] The array onto which to store the result.\n * @returns {Matrix2[]} The unpacked array.\n */\nMatrix2.unpackArray = function (array, result) {\n const length = array.length;\n if (!defined(result)) {\n result = new Array(length / 4);\n } else {\n result.length = length / 4;\n }\n\n for (let i = 0; i < length; i += 4) {\n const index = i / 4;\n result[index] = Matrix2.unpack(array, i, result[index]);\n }\n return result;\n};\n\n/**\n * Duplicates a Matrix2 instance.\n *\n * @param {Matrix2} matrix The matrix to duplicate.\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)\n */\nMatrix2.clone = function (matrix, result) {\n if (!defined(matrix)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Matrix2(matrix[0], matrix[2], matrix[1], matrix[3]);\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n return result;\n};\n\n/**\n * Creates a Matrix2 from 4 consecutive elements in an array.\n *\n * @function\n * @param {Number[]} array The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Create the Matrix2:\n * // [1.0, 2.0]\n * // [1.0, 2.0]\n *\n * const v = [1.0, 1.0, 2.0, 2.0];\n * const m = Cesium.Matrix2.fromArray(v);\n *\n * // Create same Matrix2 with using an offset into an array\n * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];\n * const m2 = Cesium.Matrix2.fromArray(v2, 2);\n */\nMatrix2.fromArray = Matrix2.unpack;\n/**\n * Creates a Matrix2 instance from a column-major order array.\n *\n * @param {Number[]} values The column-major order array.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n */\nMatrix2.fromColumnMajorArray = function (values, result) {\n return Matrix2.clone(values, result);\n};\n\n/**\n * Creates a Matrix2 instance from a row-major order array.\n * The resulting matrix will be in column-major order.\n *\n * @param {Number[]} values The row-major order array.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n */\nMatrix2.fromRowMajorArray = function (values, result) {\n if (!defined(result)) {\n return new Matrix2(values[0], values[1], values[2], values[3]);\n }\n result[0] = values[0];\n result[1] = values[2];\n result[2] = values[1];\n result[3] = values[3];\n return result;\n};\n\n/**\n * Computes a Matrix2 instance representing a non-uniform scale.\n *\n * @param {Cartesian2} scale The x and y scale factors.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [7.0, 0.0]\n * // [0.0, 8.0]\n * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));\n */\nMatrix2.fromScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix2(scale.x, 0.0, 0.0, scale.y);\n }\n\n result[0] = scale.x;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = scale.y;\n return result;\n};\n\n/**\n * Computes a Matrix2 instance representing a uniform scale.\n *\n * @param {Number} scale The uniform scale factor.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Creates\n * // [2.0, 0.0]\n * // [0.0, 2.0]\n * const m = Cesium.Matrix2.fromUniformScale(2.0);\n */\nMatrix2.fromUniformScale = function (scale, result) {\n if (!defined(result)) {\n return new Matrix2(scale, 0.0, 0.0, scale);\n }\n\n result[0] = scale;\n result[1] = 0.0;\n result[2] = 0.0;\n result[3] = scale;\n return result;\n};\n\n/**\n * Creates a rotation matrix.\n *\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\n *\n * @example\n * // Rotate a point 45 degrees counterclockwise.\n * const p = new Cesium.Cartesian2(5, 6);\n * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));\n * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());\n */\nMatrix2.fromRotation = function (angle, result) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n\n if (!defined(result)) {\n return new Matrix2(cosAngle, -sinAngle, sinAngle, cosAngle);\n }\n result[0] = cosAngle;\n result[1] = sinAngle;\n result[2] = -sinAngle;\n result[3] = cosAngle;\n return result;\n};\n\n/**\n * Creates an Array from the provided Matrix2 instance.\n * The array will be in column-major order.\n *\n * @param {Matrix2} matrix The matrix to use..\n * @param {Number[]} [result] The Array onto which to store the result.\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\n */\nMatrix2.toArray = function (matrix, result) {\n if (!defined(result)) {\n return [matrix[0], matrix[1], matrix[2], matrix[3]];\n }\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[3];\n return result;\n};\n\n/**\n * Computes the array index of the element at the provided row and column.\n *\n * @param {Number} row The zero-based index of the row.\n * @param {Number} column The zero-based index of the column.\n * @returns {Number} The index of the element at the provided row and column.\n *\n * @exception {DeveloperError} row must be 0 or 1.\n * @exception {DeveloperError} column must be 0 or 1.\n *\n * @example\n * const myMatrix = new Cesium.Matrix2();\n * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);\n * const column1Row0 = myMatrix[column1Row0Index]\n * myMatrix[column1Row0Index] = 10.0;\n */\nMatrix2.getElementIndex = function (column, row) {\n return column * 2 + row;\n};\n\n/**\n * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to retrieve.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.getColumn = function (matrix, index, result) {\n const startIndex = index * 2;\n const x = matrix[startIndex];\n const y = matrix[startIndex + 1];\n\n result.x = x;\n result.y = y;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Number} index The zero-based index of the column to set.\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified column.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.setColumn = function (matrix, index, cartesian, result) {\n result = Matrix2.clone(matrix, result);\n const startIndex = index * 2;\n result[startIndex] = cartesian.x;\n result[startIndex + 1] = cartesian.y;\n return result;\n};\n\n/**\n * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to retrieve.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.getRow = function (matrix, index, result) {\n const x = matrix[index];\n const y = matrix[index + 2];\n\n result.x = x;\n result.y = y;\n return result;\n};\n\n/**\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Number} index The zero-based index of the row to set.\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified row.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @exception {DeveloperError} index must be 0 or 1.\n */\nMatrix2.setRow = function (matrix, index, cartesian, result) {\n result = Matrix2.clone(matrix, result);\n result[index] = cartesian.x;\n result[index + 2] = cartesian.y;\n return result;\n};\n\nconst scaleScratch1 = new Cartesian2();\n\n/**\n * Computes a new matrix that replaces the scale with the provided scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Cartesian2} scale The scale that replaces the scale of the provided matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.setScale = function (matrix, scale, result) {\n const existingScale = Matrix2.getScale(matrix, scaleScratch1);\n const scaleRatioX = scale.x / existingScale.x;\n const scaleRatioY = scale.y / existingScale.y;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioY;\n result[3] = matrix[3] * scaleRatioY;\n\n return result;\n};\n\nconst scaleScratch2 = new Cartesian2();\n\n/**\n * Computes a new matrix that replaces the scale with the provided uniform scale.\n * This assumes the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix to use.\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.setUniformScale = function (matrix, scale, result) {\n const existingScale = Matrix2.getScale(matrix, scaleScratch2);\n const scaleRatioX = scale / existingScale.x;\n const scaleRatioY = scale / existingScale.y;\n\n result[0] = matrix[0] * scaleRatioX;\n result[1] = matrix[1] * scaleRatioX;\n result[2] = matrix[2] * scaleRatioY;\n result[3] = matrix[3] * scaleRatioY;\n\n return result;\n};\n\nconst scratchColumn = new Cartesian2();\n\n/**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n *\n * @see Matrix2.multiplyByScale\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n */\nMatrix2.getScale = function (matrix, result) {\n result.x = Cartesian2.magnitude(\n Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)\n );\n result.y = Cartesian2.magnitude(\n Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)\n );\n return result;\n};\n\nconst scaleScratch3 = new Cartesian2();\n\n/**\n * Computes the maximum scale assuming the matrix is an affine transformation.\n * The maximum scale is the maximum length of the column vectors.\n *\n * @param {Matrix2} matrix The matrix.\n * @returns {Number} The maximum scale.\n */\nMatrix2.getMaximumScale = function (matrix) {\n Matrix2.getScale(matrix, scaleScratch3);\n return Cartesian2.maximumComponent(scaleScratch3);\n};\n\nconst scaleScratch4 = new Cartesian2();\n\n/**\n * Sets the rotation assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Matrix2} rotation The rotation matrix.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.fromRotation\n * @see Matrix2.getRotation\n */\nMatrix2.setRotation = function (matrix, rotation, result) {\n const scale = Matrix2.getScale(matrix, scaleScratch4);\n\n result[0] = rotation[0] * scale.x;\n result[1] = rotation[1] * scale.x;\n result[2] = rotation[2] * scale.y;\n result[3] = rotation[3] * scale.y;\n\n return result;\n};\n\nconst scaleScratch5 = new Cartesian2();\n\n/**\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @see Matrix2.setRotation\n * @see Matrix2.fromRotation\n */\nMatrix2.getRotation = function (matrix, result) {\n const scale = Matrix2.getScale(matrix, scaleScratch5);\n\n result[0] = matrix[0] / scale.x;\n result[1] = matrix[1] / scale.x;\n result[2] = matrix[2] / scale.y;\n result[3] = matrix[3] / scale.y;\n\n return result;\n};\n\n/**\n * Computes the product of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.multiply = function (left, right, result) {\n const column0Row0 = left[0] * right[0] + left[2] * right[1];\n const column1Row0 = left[0] * right[2] + left[2] * right[3];\n const column0Row1 = left[1] * right[0] + left[3] * right[1];\n const column1Row1 = left[1] * right[2] + left[3] * right[3];\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column1Row0;\n result[3] = column1Row1;\n return result;\n};\n\n/**\n * Computes the sum of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.add = function (left, right, result) {\n result[0] = left[0] + right[0];\n result[1] = left[1] + right[1];\n result[2] = left[2] + right[2];\n result[3] = left[3] + right[3];\n return result;\n};\n\n/**\n * Computes the difference of two matrices.\n *\n * @param {Matrix2} left The first matrix.\n * @param {Matrix2} right The second matrix.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.subtract = function (left, right, result) {\n result[0] = left[0] - right[0];\n result[1] = left[1] - right[1];\n result[2] = left[2] - right[2];\n result[3] = left[3] - right[3];\n return result;\n};\n\n/**\n * Computes the product of a matrix and a column vector.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Cartesian2} cartesian The column.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter.\n */\nMatrix2.multiplyByVector = function (matrix, cartesian, result) {\n const x = matrix[0] * cartesian.x + matrix[2] * cartesian.y;\n const y = matrix[1] * cartesian.x + matrix[3] * cartesian.y;\n\n result.x = x;\n result.y = y;\n return result;\n};\n\n/**\n * Computes the product of a matrix and a scalar.\n *\n * @param {Matrix2} matrix The matrix.\n * @param {Number} scalar The number to multiply by.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.multiplyByScalar = function (matrix, scalar, result) {\n result[0] = matrix[0] * scalar;\n result[1] = matrix[1] * scalar;\n result[2] = matrix[2] * scalar;\n result[3] = matrix[3] * scalar;\n return result;\n};\n\n/**\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\n *\n * @param {Matrix2} matrix The matrix on the left-hand side.\n * @param {Number} scale The non-uniform scale on the right-hand side.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n *\n * @example\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);\n * Cesium.Matrix2.multiplyByScale(m, scale, m);\n *\n * @see Matrix2.multiplyByUniformScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.multiplyByScale = function (matrix, scale, result) {\n result[0] = matrix[0] * scale.x;\n result[1] = matrix[1] * scale.x;\n result[2] = matrix[2] * scale.y;\n result[3] = matrix[3] * scale.y;\n\n return result;\n};\n\n/**\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\n *\n * @param {Matrix2} matrix The matrix on the left-hand side.\n * @param {Number} scale The uniform scale on the right-hand side.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n *\n * @example\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);\n * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);\n *\n * @see Matrix2.multiplyByScale\n * @see Matrix2.fromScale\n * @see Matrix2.fromUniformScale\n * @see Matrix2.setScale\n * @see Matrix2.setUniformScale\n * @see Matrix2.getScale\n */\nMatrix2.multiplyByUniformScale = function (matrix, scale, result) {\n result[0] = matrix[0] * scale;\n result[1] = matrix[1] * scale;\n result[2] = matrix[2] * scale;\n result[3] = matrix[3] * scale;\n\n return result;\n};\n\n/**\n * Creates a negated copy of the provided matrix.\n *\n * @param {Matrix2} matrix The matrix to negate.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.negate = function (matrix, result) {\n result[0] = -matrix[0];\n result[1] = -matrix[1];\n result[2] = -matrix[2];\n result[3] = -matrix[3];\n return result;\n};\n\n/**\n * Computes the transpose of the provided matrix.\n *\n * @param {Matrix2} matrix The matrix to transpose.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.transpose = function (matrix, result) {\n const column0Row0 = matrix[0];\n const column0Row1 = matrix[2];\n const column1Row0 = matrix[1];\n const column1Row1 = matrix[3];\n\n result[0] = column0Row0;\n result[1] = column0Row1;\n result[2] = column1Row0;\n result[3] = column1Row1;\n return result;\n};\n\n/**\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\n *\n * @param {Matrix2} matrix The matrix with signed elements.\n * @param {Matrix2} result The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter.\n */\nMatrix2.abs = function (matrix, result) {\n result[0] = Math.abs(matrix[0]);\n result[1] = Math.abs(matrix[1]);\n result[2] = Math.abs(matrix[2]);\n result[3] = Math.abs(matrix[3]);\n\n return result;\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix2} [left] The first matrix.\n * @param {Matrix2} [right] The second matrix.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMatrix2.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left[0] === right[0] &&\n left[1] === right[1] &&\n left[2] === right[2] &&\n left[3] === right[3])\n );\n};\n\n/**\n * @private\n */\nMatrix2.equalsArray = function (matrix, array, offset) {\n return (\n matrix[0] === array[offset] &&\n matrix[1] === array[offset + 1] &&\n matrix[2] === array[offset + 2] &&\n matrix[3] === array[offset + 3]\n );\n};\n\n/**\n * Compares the provided matrices componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix2} [left] The first matrix.\n * @param {Matrix2} [right] The second matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix2.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left[0] - right[0]) <= epsilon &&\n Math.abs(left[1] - right[1]) <= epsilon &&\n Math.abs(left[2] - right[2]) <= epsilon &&\n Math.abs(left[3] - right[3]) <= epsilon)\n );\n};\n\n/**\n * An immutable Matrix2 instance initialized to the identity matrix.\n *\n * @type {Matrix2}\n * @constant\n */\nMatrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0, 0.0, 1.0));\n\n/**\n * An immutable Matrix2 instance initialized to the zero matrix.\n *\n * @type {Matrix2}\n * @constant\n */\nMatrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0, 0.0, 0.0));\n\n/**\n * The index into Matrix2 for column 0, row 0.\n *\n * @type {Number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0\n */\nMatrix2.COLUMN0ROW0 = 0;\n\n/**\n * The index into Matrix2 for column 0, row 1.\n *\n * @type {Number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0\n */\nMatrix2.COLUMN0ROW1 = 1;\n\n/**\n * The index into Matrix2 for column 1, row 0.\n *\n * @type {Number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0\n */\nMatrix2.COLUMN1ROW0 = 2;\n\n/**\n * The index into Matrix2 for column 1, row 1.\n *\n * @type {Number}\n * @constant\n *\n * @example\n * const matrix = new Cesium.Matrix2();\n * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0\n */\nMatrix2.COLUMN1ROW1 = 3;\n\nObject.defineProperties(Matrix2.prototype, {\n /**\n * Gets the number of items in the collection.\n * @memberof Matrix2.prototype\n *\n * @type {Number}\n */\n length: {\n get: function () {\n return Matrix2.packedLength;\n },\n },\n});\n\n/**\n * Duplicates the provided Matrix2 instance.\n *\n * @param {Matrix2} [result] The object onto which to store the result.\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\n */\nMatrix2.prototype.clone = function (result) {\n return Matrix2.clone(this, result);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Matrix2} [right] The right hand side matrix.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nMatrix2.prototype.equals = function (right) {\n return Matrix2.equals(this, right);\n};\n\n/**\n * Compares this matrix to the provided matrix componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Matrix2} [right] The right hand side matrix.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nMatrix2.prototype.equalsEpsilon = function (right, epsilon) {\n return Matrix2.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this Matrix with each row being\n * on a separate line and in the format '(column0, column1)'.\n *\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.\n */\nMatrix2.prototype.toString = function () {\n return `(${this[0]}, ${this[2]})\\n` + `(${this[1]}, ${this[3]})`;\n};\nexport default Matrix2;\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * The type of a geometric primitive, i.e., points, lines, and triangles.\n *\n * @enum {Number}\n */\nconst PrimitiveType = {\n /**\n * Points primitive where each vertex (or index) is a separate point.\n *\n * @type {Number}\n * @constant\n */\n POINTS: WebGLConstants.POINTS,\n\n /**\n * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.\n *\n * @type {Number}\n * @constant\n */\n LINES: WebGLConstants.LINES,\n\n /**\n * Line loop primitive where each vertex (or index) after the first connects a line to\n * the previous vertex, and the last vertex implicitly connects to the first.\n *\n * @type {Number}\n * @constant\n */\n LINE_LOOP: WebGLConstants.LINE_LOOP,\n\n /**\n * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.\n *\n * @type {Number}\n * @constant\n */\n LINE_STRIP: WebGLConstants.LINE_STRIP,\n\n /**\n * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.\n *\n * @type {Number}\n * @constant\n */\n TRIANGLES: WebGLConstants.TRIANGLES,\n\n /**\n * Triangle strip primitive where each vertex (or index) after the first two connect to\n * the previous two vertices forming a triangle. For example, this can be used to model a wall.\n *\n * @type {Number}\n * @constant\n */\n TRIANGLE_STRIP: WebGLConstants.TRIANGLE_STRIP,\n\n /**\n * Triangle fan primitive where each vertex (or index) after the first two connect to\n * the previous vertex and the first vertex forming a triangle. For example, this can be used\n * to model a cone or circle.\n *\n * @type {Number}\n * @constant\n */\n TRIANGLE_FAN: WebGLConstants.TRIANGLE_FAN,\n};\n\n/**\n * @private\n */\nPrimitiveType.isLines = function (primitiveType) {\n return (\n primitiveType === PrimitiveType.LINES ||\n primitiveType === PrimitiveType.LINE_LOOP ||\n primitiveType === PrimitiveType.LINE_STRIP\n );\n};\n\n/**\n * @private\n */\nPrimitiveType.isTriangles = function (primitiveType) {\n return (\n primitiveType === PrimitiveType.TRIANGLES ||\n primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n primitiveType === PrimitiveType.TRIANGLE_FAN\n );\n};\n\n/**\n * @private\n */\nPrimitiveType.validate = function (primitiveType) {\n return (\n primitiveType === PrimitiveType.POINTS ||\n primitiveType === PrimitiveType.LINES ||\n primitiveType === PrimitiveType.LINE_LOOP ||\n primitiveType === PrimitiveType.LINE_STRIP ||\n primitiveType === PrimitiveType.TRIANGLES ||\n primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n primitiveType === PrimitiveType.TRIANGLE_FAN\n );\n};\n\nexport default Object.freeze(PrimitiveType);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\n\n/**\n * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.\n * @alias Quaternion\n * @constructor\n *\n * @param {Number} [x=0.0] The X component.\n * @param {Number} [y=0.0] The Y component.\n * @param {Number} [z=0.0] The Z component.\n * @param {Number} [w=0.0] The W component.\n *\n * @see PackableForInterpolation\n */\nfunction Quaternion(x, y, z, w) {\n /**\n * The X component.\n * @type {Number}\n * @default 0.0\n */\n this.x = defaultValue(x, 0.0);\n\n /**\n * The Y component.\n * @type {Number}\n * @default 0.0\n */\n this.y = defaultValue(y, 0.0);\n\n /**\n * The Z component.\n * @type {Number}\n * @default 0.0\n */\n this.z = defaultValue(z, 0.0);\n\n /**\n * The W component.\n * @type {Number}\n * @default 0.0\n */\n this.w = defaultValue(w, 0.0);\n}\n\nlet fromAxisAngleScratch = new Cartesian3();\n\n/**\n * Computes a quaternion representing a rotation around an axis.\n *\n * @param {Cartesian3} axis The axis of rotation.\n * @param {Number} angle The angle in radians to rotate around the axis.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.fromAxisAngle = function (axis, angle, result) {\n const halfAngle = angle / 2.0;\n const s = Math.sin(halfAngle);\n fromAxisAngleScratch = Cartesian3.normalize(axis, fromAxisAngleScratch);\n\n const x = fromAxisAngleScratch.x * s;\n const y = fromAxisAngleScratch.y * s;\n const z = fromAxisAngleScratch.z * s;\n const w = Math.cos(halfAngle);\n if (!defined(result)) {\n return new Quaternion(x, y, z, w);\n }\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\nconst fromRotationMatrixNext = [1, 2, 0];\nconst fromRotationMatrixQuat = new Array(3);\n/**\n * Computes a Quaternion from the provided Matrix3 instance.\n *\n * @param {Matrix3} matrix The rotation matrix.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n *\n * @see Matrix3.fromQuaternion\n */\nQuaternion.fromRotationMatrix = function (matrix, result) {\n let root;\n let x;\n let y;\n let z;\n let w;\n\n const m00 = matrix[Matrix3.COLUMN0ROW0];\n const m11 = matrix[Matrix3.COLUMN1ROW1];\n const m22 = matrix[Matrix3.COLUMN2ROW2];\n const trace = m00 + m11 + m22;\n\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n root = Math.sqrt(trace + 1.0); // 2w\n w = 0.5 * root;\n root = 0.5 / root; // 1/(4w)\n\n x = (matrix[Matrix3.COLUMN1ROW2] - matrix[Matrix3.COLUMN2ROW1]) * root;\n y = (matrix[Matrix3.COLUMN2ROW0] - matrix[Matrix3.COLUMN0ROW2]) * root;\n z = (matrix[Matrix3.COLUMN0ROW1] - matrix[Matrix3.COLUMN1ROW0]) * root;\n } else {\n // |w| <= 1/2\n const next = fromRotationMatrixNext;\n\n let i = 0;\n if (m11 > m00) {\n i = 1;\n }\n if (m22 > m00 && m22 > m11) {\n i = 2;\n }\n const j = next[i];\n const k = next[j];\n\n root = Math.sqrt(\n matrix[Matrix3.getElementIndex(i, i)] -\n matrix[Matrix3.getElementIndex(j, j)] -\n matrix[Matrix3.getElementIndex(k, k)] +\n 1.0\n );\n\n const quat = fromRotationMatrixQuat;\n quat[i] = 0.5 * root;\n root = 0.5 / root;\n w =\n (matrix[Matrix3.getElementIndex(k, j)] -\n matrix[Matrix3.getElementIndex(j, k)]) *\n root;\n quat[j] =\n (matrix[Matrix3.getElementIndex(j, i)] +\n matrix[Matrix3.getElementIndex(i, j)]) *\n root;\n quat[k] =\n (matrix[Matrix3.getElementIndex(k, i)] +\n matrix[Matrix3.getElementIndex(i, k)]) *\n root;\n\n x = -quat[0];\n y = -quat[1];\n z = -quat[2];\n }\n\n if (!defined(result)) {\n return new Quaternion(x, y, z, w);\n }\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\nconst scratchHPRQuaternion = new Quaternion();\nlet scratchHeadingQuaternion = new Quaternion();\nlet scratchPitchQuaternion = new Quaternion();\nlet scratchRollQuaternion = new Quaternion();\n\n/**\n * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\n * the positive x axis.\n *\n * @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\n */\nQuaternion.fromHeadingPitchRoll = function (headingPitchRoll, result) {\n scratchRollQuaternion = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_X,\n headingPitchRoll.roll,\n scratchHPRQuaternion\n );\n scratchPitchQuaternion = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_Y,\n -headingPitchRoll.pitch,\n result\n );\n result = Quaternion.multiply(\n scratchPitchQuaternion,\n scratchRollQuaternion,\n scratchPitchQuaternion\n );\n scratchHeadingQuaternion = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_Z,\n -headingPitchRoll.heading,\n scratchHPRQuaternion\n );\n return Quaternion.multiply(scratchHeadingQuaternion, result, result);\n};\n\nconst sampledQuaternionAxis = new Cartesian3();\nconst sampledQuaternionRotation = new Cartesian3();\nconst sampledQuaternionTempQuaternion = new Quaternion();\nconst sampledQuaternionQuaternion0 = new Quaternion();\nconst sampledQuaternionQuaternion0Conjugate = new Quaternion();\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nQuaternion.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {Quaternion} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nQuaternion.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.x;\n array[startingIndex++] = value.y;\n array[startingIndex++] = value.z;\n array[startingIndex] = value.w;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new Quaternion();\n }\n result.x = array[startingIndex];\n result.y = array[startingIndex + 1];\n result.z = array[startingIndex + 2];\n result.w = array[startingIndex + 3];\n return result;\n};\n\n/**\n * The number of elements used to store the object into an array in its interpolatable form.\n * @type {Number}\n */\nQuaternion.packedInterpolationLength = 3;\n\n/**\n * Converts a packed array into a form suitable for interpolation.\n *\n * @param {Number[]} packedArray The packed array.\n * @param {Number} [startingIndex=0] The index of the first element to be converted.\n * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted.\n * @param {Number[]} [result] The object into which to store the result.\n */\nQuaternion.convertPackedArrayForInterpolation = function (\n packedArray,\n startingIndex,\n lastIndex,\n result\n) {\n Quaternion.unpack(\n packedArray,\n lastIndex * 4,\n sampledQuaternionQuaternion0Conjugate\n );\n Quaternion.conjugate(\n sampledQuaternionQuaternion0Conjugate,\n sampledQuaternionQuaternion0Conjugate\n );\n\n for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {\n const offset = i * 3;\n Quaternion.unpack(\n packedArray,\n (startingIndex + i) * 4,\n sampledQuaternionTempQuaternion\n );\n\n Quaternion.multiply(\n sampledQuaternionTempQuaternion,\n sampledQuaternionQuaternion0Conjugate,\n sampledQuaternionTempQuaternion\n );\n\n if (sampledQuaternionTempQuaternion.w < 0) {\n Quaternion.negate(\n sampledQuaternionTempQuaternion,\n sampledQuaternionTempQuaternion\n );\n }\n\n Quaternion.computeAxis(\n sampledQuaternionTempQuaternion,\n sampledQuaternionAxis\n );\n const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion);\n if (!defined(result)) {\n result = [];\n }\n result[offset] = sampledQuaternionAxis.x * angle;\n result[offset + 1] = sampledQuaternionAxis.y * angle;\n result[offset + 2] = sampledQuaternionAxis.z * angle;\n }\n};\n\n/**\n * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.\n *\n * @param {Number[]} array The array previously packed for interpolation.\n * @param {Number[]} sourceArray The original packed array.\n * @param {Number} [firstIndex=0] The firstIndex used to convert the array.\n * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n * @param {Quaternion} [result] The object into which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.unpackInterpolationResult = function (\n array,\n sourceArray,\n firstIndex,\n lastIndex,\n result\n) {\n if (!defined(result)) {\n result = new Quaternion();\n }\n Cartesian3.fromArray(array, 0, sampledQuaternionRotation);\n const magnitude = Cartesian3.magnitude(sampledQuaternionRotation);\n\n Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);\n\n if (magnitude === 0) {\n Quaternion.clone(Quaternion.IDENTITY, sampledQuaternionTempQuaternion);\n } else {\n Quaternion.fromAxisAngle(\n sampledQuaternionRotation,\n magnitude,\n sampledQuaternionTempQuaternion\n );\n }\n\n return Quaternion.multiply(\n sampledQuaternionTempQuaternion,\n sampledQuaternionQuaternion0,\n result\n );\n};\n\n/**\n * Duplicates a Quaternion instance.\n *\n * @param {Quaternion} quaternion The quaternion to duplicate.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)\n */\nQuaternion.clone = function (quaternion, result) {\n if (!defined(quaternion)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Quaternion(\n quaternion.x,\n quaternion.y,\n quaternion.z,\n quaternion.w\n );\n }\n\n result.x = quaternion.x;\n result.y = quaternion.y;\n result.z = quaternion.z;\n result.w = quaternion.w;\n return result;\n};\n\n/**\n * Computes the conjugate of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.conjugate = function (quaternion, result) {\n result.x = -quaternion.x;\n result.y = -quaternion.y;\n result.z = -quaternion.z;\n result.w = quaternion.w;\n return result;\n};\n\n/**\n * Computes magnitude squared for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {Number} The magnitude squared.\n */\nQuaternion.magnitudeSquared = function (quaternion) {\n return (\n quaternion.x * quaternion.x +\n quaternion.y * quaternion.y +\n quaternion.z * quaternion.z +\n quaternion.w * quaternion.w\n );\n};\n\n/**\n * Computes magnitude for the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to conjugate.\n * @returns {Number} The magnitude.\n */\nQuaternion.magnitude = function (quaternion) {\n return Math.sqrt(Quaternion.magnitudeSquared(quaternion));\n};\n\n/**\n * Computes the normalized form of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.normalize = function (quaternion, result) {\n const inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion);\n const x = quaternion.x * inverseMagnitude;\n const y = quaternion.y * inverseMagnitude;\n const z = quaternion.z * inverseMagnitude;\n const w = quaternion.w * inverseMagnitude;\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Computes the inverse of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to normalize.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.inverse = function (quaternion, result) {\n const magnitudeSquared = Quaternion.magnitudeSquared(quaternion);\n result = Quaternion.conjugate(quaternion, result);\n return Quaternion.multiplyByScalar(result, 1.0 / magnitudeSquared, result);\n};\n\n/**\n * Computes the componentwise sum of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.add = function (left, right, result) {\n result.x = left.x + right.x;\n result.y = left.y + right.y;\n result.z = left.z + right.z;\n result.w = left.w + right.w;\n return result;\n};\n\n/**\n * Computes the componentwise difference of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.subtract = function (left, right, result) {\n result.x = left.x - right.x;\n result.y = left.y - right.y;\n result.z = left.z - right.z;\n result.w = left.w - right.w;\n return result;\n};\n\n/**\n * Negates the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to be negated.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.negate = function (quaternion, result) {\n result.x = -quaternion.x;\n result.y = -quaternion.y;\n result.z = -quaternion.z;\n result.w = -quaternion.w;\n return result;\n};\n\n/**\n * Computes the dot (scalar) product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @returns {Number} The dot product.\n */\nQuaternion.dot = function (left, right) {\n return (\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\n );\n};\n\n/**\n * Computes the product of two quaternions.\n *\n * @param {Quaternion} left The first quaternion.\n * @param {Quaternion} right The second quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.multiply = function (left, right, result) {\n const leftX = left.x;\n const leftY = left.y;\n const leftZ = left.z;\n const leftW = left.w;\n\n const rightX = right.x;\n const rightY = right.y;\n const rightZ = right.z;\n const rightW = right.w;\n\n const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;\n const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;\n const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;\n const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;\n\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n};\n\n/**\n * Multiplies the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be scaled.\n * @param {Number} scalar The scalar to multiply with.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.multiplyByScalar = function (quaternion, scalar, result) {\n result.x = quaternion.x * scalar;\n result.y = quaternion.y * scalar;\n result.z = quaternion.z * scalar;\n result.w = quaternion.w * scalar;\n return result;\n};\n\n/**\n * Divides the provided quaternion componentwise by the provided scalar.\n *\n * @param {Quaternion} quaternion The quaternion to be divided.\n * @param {Number} scalar The scalar to divide by.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.divideByScalar = function (quaternion, scalar, result) {\n result.x = quaternion.x / scalar;\n result.y = quaternion.y / scalar;\n result.z = quaternion.z / scalar;\n result.w = quaternion.w / scalar;\n return result;\n};\n\n/**\n * Computes the axis of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nQuaternion.computeAxis = function (quaternion, result) {\n const w = quaternion.w;\n if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) {\n result.x = result.y = result.z = 0;\n return result;\n }\n\n const scalar = 1.0 / Math.sqrt(1.0 - w * w);\n\n result.x = quaternion.x * scalar;\n result.y = quaternion.y * scalar;\n result.z = quaternion.z * scalar;\n return result;\n};\n\n/**\n * Computes the angle of rotation of the provided quaternion.\n *\n * @param {Quaternion} quaternion The quaternion to use.\n * @returns {Number} The angle of rotation.\n */\nQuaternion.computeAngle = function (quaternion) {\n if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) {\n return 0.0;\n }\n return 2.0 * Math.acos(quaternion.w);\n};\n\nlet lerpScratch = new Quaternion();\n/**\n * Computes the linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.lerp = function (start, end, t, result) {\n lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch);\n result = Quaternion.multiplyByScalar(start, 1.0 - t, result);\n return Quaternion.add(lerpScratch, result, result);\n};\n\nlet slerpEndNegated = new Quaternion();\nlet slerpScaledP = new Quaternion();\nlet slerpScaledR = new Quaternion();\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#fastSlerp\n */\nQuaternion.slerp = function (start, end, t, result) {\n let dot = Quaternion.dot(start, end);\n\n // The angle between start must be acute. Since q and -q represent\n // the same rotation, negate q to get the acute angle.\n let r = end;\n if (dot < 0.0) {\n dot = -dot;\n r = slerpEndNegated = Quaternion.negate(end, slerpEndNegated);\n }\n\n // dot > 0, as the dot product approaches 1, the angle between the\n // quaternions vanishes. use linear interpolation.\n if (1.0 - dot < CesiumMath.EPSILON6) {\n return Quaternion.lerp(start, r, t, result);\n }\n\n const theta = Math.acos(dot);\n slerpScaledP = Quaternion.multiplyByScalar(\n start,\n Math.sin((1 - t) * theta),\n slerpScaledP\n );\n slerpScaledR = Quaternion.multiplyByScalar(\n r,\n Math.sin(t * theta),\n slerpScaledR\n );\n result = Quaternion.add(slerpScaledP, slerpScaledR, result);\n return Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result);\n};\n\n/**\n * The logarithmic quaternion function.\n *\n * @param {Quaternion} quaternion The unit quaternion.\n * @param {Cartesian3} result The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter.\n */\nQuaternion.log = function (quaternion, result) {\n const theta = CesiumMath.acosClamped(quaternion.w);\n let thetaOverSinTheta = 0.0;\n\n if (theta !== 0.0) {\n thetaOverSinTheta = theta / Math.sin(theta);\n }\n\n return Cartesian3.multiplyByScalar(quaternion, thetaOverSinTheta, result);\n};\n\n/**\n * The exponential quaternion function.\n *\n * @param {Cartesian3} cartesian The cartesian.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n */\nQuaternion.exp = function (cartesian, result) {\n const theta = Cartesian3.magnitude(cartesian);\n let sinThetaOverTheta = 0.0;\n\n if (theta !== 0.0) {\n sinThetaOverTheta = Math.sin(theta) / theta;\n }\n\n result.x = cartesian.x * sinThetaOverTheta;\n result.y = cartesian.y * sinThetaOverTheta;\n result.z = cartesian.z * sinThetaOverTheta;\n result.w = Math.cos(theta);\n\n return result;\n};\n\nconst squadScratchCartesian0 = new Cartesian3();\nconst squadScratchCartesian1 = new Cartesian3();\nconst squadScratchQuaternion0 = new Quaternion();\nconst squadScratchQuaternion1 = new Quaternion();\n\n/**\n * Computes an inner quadrangle point.\n * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} q2 The third quaternion.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#squad\n */\nQuaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {\n const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);\n Quaternion.multiply(qInv, q2, squadScratchQuaternion1);\n const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);\n\n Quaternion.multiply(qInv, q0, squadScratchQuaternion1);\n const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);\n\n Cartesian3.add(cart0, cart1, cart0);\n Cartesian3.multiplyByScalar(cart0, 0.25, cart0);\n Cartesian3.negate(cart0, cart0);\n Quaternion.exp(cart0, squadScratchQuaternion0);\n\n return Quaternion.multiply(q1, squadScratchQuaternion0, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {Number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n *\n * @example\n * // 1. compute the squad interpolation between two quaternions on a curve\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\n *\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\n *\n * @see Quaternion#computeInnerQuadrangle\n */\nQuaternion.squad = function (q0, q1, s0, s1, t, result) {\n const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\nconst fastSlerpScratchQuaternion = new Quaternion();\n// eslint-disable-next-line no-loss-of-precision\nconst opmu = 1.90110745351730037;\nconst u = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst v = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bT = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\nconst bD = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\n\nfor (let i = 0; i < 7; ++i) {\n const s = i + 1.0;\n const t = 2.0 * s + 1.0;\n u[i] = 1.0 / (s * t);\n v[i] = s / t;\n}\n\nu[7] = opmu / (8.0 * 17.0);\nv[7] = (opmu * 8.0) / 17.0;\n\n/**\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.\n *\n * @param {Quaternion} start The value corresponding to t at 0.0.\n * @param {Quaternion} end The value corresponding to t at 1.0.\n * @param {Number} t The point along t at which to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter.\n *\n * @see Quaternion#slerp\n */\nQuaternion.fastSlerp = function (start, end, t, result) {\n let x = Quaternion.dot(start, end);\n\n let sign;\n if (x >= 0) {\n sign = 1.0;\n } else {\n sign = -1.0;\n x = -x;\n }\n\n const xm1 = x - 1.0;\n const d = 1.0 - t;\n const sqrT = t * t;\n const sqrD = d * d;\n\n for (let i = 7; i >= 0; --i) {\n bT[i] = (u[i] * sqrT - v[i]) * xm1;\n bD[i] = (u[i] * sqrD - v[i]) * xm1;\n }\n\n const cT =\n sign *\n t *\n (1.0 +\n bT[0] *\n (1.0 +\n bT[1] *\n (1.0 +\n bT[2] *\n (1.0 +\n bT[3] *\n (1.0 +\n bT[4] *\n (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));\n const cD =\n d *\n (1.0 +\n bD[0] *\n (1.0 +\n bD[1] *\n (1.0 +\n bD[2] *\n (1.0 +\n bD[3] *\n (1.0 +\n bD[4] *\n (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));\n\n const temp = Quaternion.multiplyByScalar(\n start,\n cD,\n fastSlerpScratchQuaternion\n );\n Quaternion.multiplyByScalar(end, cT, result);\n return Quaternion.add(temp, result, result);\n};\n\n/**\n * Computes the spherical quadrangle interpolation between quaternions.\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\n *\n * @param {Quaternion} q0 The first quaternion.\n * @param {Quaternion} q1 The second quaternion.\n * @param {Quaternion} s0 The first inner quadrangle.\n * @param {Quaternion} s1 The second inner quadrangle.\n * @param {Number} t The time in [0,1] used to interpolate.\n * @param {Quaternion} result The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\n *\n * @see Quaternion#squad\n */\nQuaternion.fastSquad = function (q0, q1, s0, s1, t, result) {\n const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);\n const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);\n return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nQuaternion.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.x === right.x &&\n left.y === right.y &&\n left.z === right.z &&\n left.w === right.w)\n );\n};\n\n/**\n * Compares the provided quaternions componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Quaternion} [left] The first quaternion.\n * @param {Quaternion} [right] The second quaternion.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nQuaternion.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.x - right.x) <= epsilon &&\n Math.abs(left.y - right.y) <= epsilon &&\n Math.abs(left.z - right.z) <= epsilon &&\n Math.abs(left.w - right.w) <= epsilon)\n );\n};\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));\n\n/**\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\n *\n * @type {Quaternion}\n * @constant\n */\nQuaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));\n\n/**\n * Duplicates this Quaternion instance.\n *\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nQuaternion.prototype.clone = function (result) {\n return Quaternion.clone(this, result);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nQuaternion.prototype.equals = function (right) {\n return Quaternion.equals(this, right);\n};\n\n/**\n * Compares this and the provided quaternion componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {Quaternion} [right] The right hand side quaternion.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nQuaternion.prototype.equalsEpsilon = function (right, epsilon) {\n return Quaternion.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Returns a string representing this quaternion in the format (x, y, z, w).\n *\n * @returns {String} A string representing this Quaternion.\n */\nQuaternion.prototype.toString = function () {\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\n};\nexport default Quaternion;\n", "import Check from \"./Check.js\";\n\n/**\n * Finds an item in a sorted array.\n *\n * @function\n * @param {Array} array The sorted array to search.\n * @param {*} itemToFind The item to find in the array.\n * @param {binarySearchComparator} comparator The function to use to compare the item to\n * elements in the array.\n * @returns {Number} The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>\n * does not exist, the return value is a negative number which is the bitwise complement (~)\n * of the index before which the itemToFind should be inserted in order to maintain the\n * sorted order of the array.\n *\n * @example\n * // Create a comparator function to search through an array of numbers.\n * function comparator(a, b) {\n * return a - b;\n * };\n * const numbers = [0, 2, 4, 6, 8];\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\n */\nfunction binarySearch(array, itemToFind, comparator) {\n let low = 0;\n let high = array.length - 1;\n let i;\n let comparison;\n\n while (low <= high) {\n i = ~~((low + high) / 2);\n comparison = comparator(array[i], itemToFind);\n if (comparison < 0) {\n low = i + 1;\n continue;\n }\n if (comparison > 0) {\n high = i - 1;\n continue;\n }\n return i;\n }\n return ~(high + 1);\n}\n\n/**\n * A function used to compare two items while performing a binary search.\n * @callback binarySearchComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b The item being searched for.\n * @returns {Number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n * a positive value if <code>a</code> is greater than <code>b</code>, or\n * 0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b) {\n * return a - b;\n * }\n */\nexport default binarySearch;\n", "/**\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\n *\n * @alias EarthOrientationParametersSample\n * @constructor\n *\n * @param {Number} xPoleWander The pole wander about the X axis, in radians.\n * @param {Number} yPoleWander The pole wander about the Y axis, in radians.\n * @param {Number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @param {Number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @param {Number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\n *\n * @private\n */\nfunction EarthOrientationParametersSample(\n xPoleWander,\n yPoleWander,\n xPoleOffset,\n yPoleOffset,\n ut1MinusUtc\n) {\n /**\n * The pole wander about the X axis, in radians.\n * @type {Number}\n */\n this.xPoleWander = xPoleWander;\n\n /**\n * The pole wander about the Y axis, in radians.\n * @type {Number}\n */\n this.yPoleWander = yPoleWander;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\n * @type {Number}\n */\n this.xPoleOffset = xPoleOffset;\n\n /**\n * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\n * @type {Number}\n */\n this.yPoleOffset = yPoleOffset;\n\n /**\n * The difference in time standards, UT1 - UTC, in seconds.\n * @type {Number}\n */\n this.ut1MinusUtc = ut1MinusUtc;\n}\nexport default EarthOrientationParametersSample;\n", "/**\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\n * In addition to submillisecond precision, this object can also represent leap seconds.\n * @alias GregorianDate\n * @constructor\n *\n * @param {Number} [year] The year as a whole number.\n * @param {Number} [month] The month as a whole number with range [1, 12].\n * @param {Number} [day] The day of the month as a whole number starting at 1.\n * @param {Number} [hour] The hour as a whole number with range [0, 23].\n * @param {Number} [minute] The minute of the hour as a whole number with range [0, 59].\n * @param {Number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @param {Number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @param {Boolean} [isLeapSecond] Whether this time is during a leap second.\n *\n * @see JulianDate#toGregorianDate\n */\nfunction GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond\n) {\n /**\n * Gets or sets the year as a whole number.\n * @type {Number}\n */\n this.year = year;\n /**\n * Gets or sets the month as a whole number with range [1, 12].\n * @type {Number}\n */\n this.month = month;\n /**\n * Gets or sets the day of the month as a whole number starting at 1.\n * @type {Number}\n */\n this.day = day;\n /**\n * Gets or sets the hour as a whole number with range [0, 23].\n * @type {Number}\n */\n this.hour = hour;\n /**\n * Gets or sets the minute of the hour as a whole number with range [0, 59].\n * @type {Number}\n */\n this.minute = minute;\n /**\n * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\n * @type {Number}\n */\n this.second = second;\n /**\n * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\n * @type {Number}\n */\n this.millisecond = millisecond;\n /**\n * Gets or sets whether this time is during a leap second.\n * @type {Boolean}\n */\n this.isLeapSecond = isLeapSecond;\n}\nexport default GregorianDate;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Determines if a given date is a leap year.\n *\n * @function isLeapYear\n *\n * @param {Number} year The year to be tested.\n * @returns {Boolean} True if <code>year</code> is a leap year.\n *\n * @example\n * const leapYear = Cesium.isLeapYear(2000); // true\n */\nfunction isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\nexport default isLeapYear;\n", "/**\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\n * @alias LeapSecond\n * @constructor\n *\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\n * @param {Number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\n */\nfunction LeapSecond(date, offset) {\n /**\n * Gets or sets the date at which this leap second occurs.\n * @type {JulianDate}\n */\n this.julianDate = date;\n\n /**\n * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\n * of this leap second.\n * @type {Number}\n */\n this.offset = offset;\n}\nexport default LeapSecond;\n", "/**\n * Constants for time conversions like those done by {@link JulianDate}.\n *\n * @namespace TimeConstants\n *\n * @see JulianDate\n *\n * @private\n */\nconst TimeConstants = {\n /**\n * The number of seconds in one millisecond: <code>0.001</code>\n * @type {Number}\n * @constant\n */\n SECONDS_PER_MILLISECOND: 0.001,\n\n /**\n * The number of seconds in one minute: <code>60</code>.\n * @type {Number}\n * @constant\n */\n SECONDS_PER_MINUTE: 60.0,\n\n /**\n * The number of minutes in one hour: <code>60</code>.\n * @type {Number}\n * @constant\n */\n MINUTES_PER_HOUR: 60.0,\n\n /**\n * The number of hours in one day: <code>24</code>.\n * @type {Number}\n * @constant\n */\n HOURS_PER_DAY: 24.0,\n\n /**\n * The number of seconds in one hour: <code>3600</code>.\n * @type {Number}\n * @constant\n */\n SECONDS_PER_HOUR: 3600.0,\n\n /**\n * The number of minutes in one day: <code>1440</code>.\n * @type {Number}\n * @constant\n */\n MINUTES_PER_DAY: 1440.0,\n\n /**\n * The number of seconds in one day, ignoring leap seconds: <code>86400</code>.\n * @type {Number}\n * @constant\n */\n SECONDS_PER_DAY: 86400.0,\n\n /**\n * The number of days in one Julian century: <code>36525</code>.\n * @type {Number}\n * @constant\n */\n DAYS_PER_JULIAN_CENTURY: 36525.0,\n\n /**\n * One trillionth of a second.\n * @type {Number}\n * @constant\n */\n PICOSECOND: 0.000000001,\n\n /**\n * The number of days to subtract from a Julian date to determine the\n * modified Julian date, which gives the number of days since midnight\n * on November 17, 1858.\n * @type {Number}\n * @constant\n */\n MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,\n};\nexport default Object.freeze(TimeConstants);\n", "/**\n * Provides the type of time standards which JulianDate can take as input.\n *\n * @enum {Number}\n *\n * @see JulianDate\n */\nconst TimeStandard = {\n /**\n * Represents the coordinated Universal Time (UTC) time standard.\n *\n * UTC is related to TAI according to the relationship\n * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap\n * seconds which have been introduced as of the time in TAI.\n *\n * @type {Number}\n * @constant\n */\n UTC: 0,\n\n /**\n * Represents the International Atomic Time (TAI) time standard.\n * TAI is the principal time standard to which the other time standards are related.\n *\n * @type {Number}\n * @constant\n */\n TAI: 1,\n};\nexport default Object.freeze(TimeStandard);\n", "import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\nconst gregorianDateScratch = new GregorianDate();\nconst daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst daysInLeapFeburary = 29;\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\n}\n\n// we don't really need a leap second instance, anything with a julianDate property will do\nconst binarySearchScratchLeapSecond = new LeapSecond();\n\nfunction convertUtcToTai(julianDate) {\n //Even though julianDate is in UTC, we'll treat it as TAI and\n //search the leap second table for it.\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates\n );\n\n if (index < 0) {\n index = ~index;\n }\n\n if (index >= leapSeconds.length) {\n index = leapSeconds.length - 1;\n }\n\n let offset = leapSeconds[index].offset;\n if (index > 0) {\n //Now we have the index of the closest leap second that comes on or after our UTC time.\n //However, if the difference between the UTC date being converted and the TAI\n //defined leap second is greater than the offset, we are off by one and need to use\n //the previous leap second.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate\n );\n if (difference > offset) {\n index--;\n offset = leapSeconds[index].offset;\n }\n }\n\n JulianDate.addSeconds(julianDate, offset, julianDate);\n}\n\nfunction convertTaiToUtc(julianDate, result) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates\n );\n if (index < 0) {\n index = ~index;\n }\n\n //All times before our first leap second get the first offset.\n if (index === 0) {\n return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\n }\n\n //All times after our leap second get the last offset.\n if (index >= leapSeconds.length) {\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index - 1].offset,\n result\n );\n }\n\n //Compute the difference between the found leap second and the time we are converting.\n const difference = JulianDate.secondsDifference(\n leapSeconds[index].julianDate,\n julianDate\n );\n\n if (difference === 0) {\n //The date is in our leap second table.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[index].offset,\n result\n );\n }\n\n if (difference <= 1.0) {\n //The requested date is during the moment of a leap second, then we cannot convert to UTC\n return undefined;\n }\n\n //The time is in between two leap seconds, index is the leap second after the date\n //we're converting, so we subtract one to get the correct LeapSecond instance.\n return JulianDate.addSeconds(\n julianDate,\n -leapSeconds[--index].offset,\n result\n );\n}\n\nfunction setComponents(wholeDays, secondsOfDay, julianDate) {\n const extraDays = (secondsOfDay / TimeConstants.SECONDS_PER_DAY) | 0;\n wholeDays += extraDays;\n secondsOfDay -= TimeConstants.SECONDS_PER_DAY * extraDays;\n\n if (secondsOfDay < 0) {\n wholeDays--;\n secondsOfDay += TimeConstants.SECONDS_PER_DAY;\n }\n\n julianDate.dayNumber = wholeDays;\n julianDate.secondsOfDay = secondsOfDay;\n return julianDate;\n}\n\nfunction computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond\n) {\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n\n const a = ((month - 14) / 12) | 0;\n const b = year + 4800 + a;\n let dayNumber =\n (((1461 * b) / 4) | 0) +\n (((367 * (month - 2 - 12 * a)) / 12) | 0) -\n (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +\n day -\n 32075;\n\n // JulianDates are noon-based\n hour = hour - 12;\n if (hour < 0) {\n hour += 24;\n }\n\n const secondsOfDay =\n second +\n (hour * TimeConstants.SECONDS_PER_HOUR +\n minute * TimeConstants.SECONDS_PER_MINUTE +\n millisecond * TimeConstants.SECONDS_PER_MILLISECOND);\n\n if (secondsOfDay >= 43200.0) {\n dayNumber -= 1;\n }\n\n return [dayNumber, secondsOfDay];\n}\n\n//Regular expressions used for ISO8601 date parsing.\n//YYYY\nconst matchCalendarYear = /^(\\d{4})$/;\n//YYYY-MM (YYYYMM is invalid)\nconst matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\n//YYYY-DDD or YYYYDDD\nconst matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\nconst matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\n//YYYY-MM-DD or YYYYMMDD\nconst matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\n// Match utc offset\nconst utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\n// Match hours HH or HH.xxxxx\nconst matchHours = /^(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM HHMM.xxxxx\nconst matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\nconst matchHoursMinutesSeconds =\n /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\n\nconst iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\n\n/**\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\n * For increased precision, this class stores the whole number part of the date and the seconds\n * part of the date in separate components. In order to be safe for arithmetic and represent\n * leap seconds, the date is always stored in the International Atomic Time standard\n * {@link TimeStandard.TAI}.\n * @alias JulianDate\n * @constructor\n *\n * @param {Number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.\n * @param {Number} [secondsOfDay=0.0] The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\n */\nfunction JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\n /**\n * Gets or sets the number of whole days.\n * @type {Number}\n */\n this.dayNumber = undefined;\n\n /**\n * Gets or sets the number of seconds into the current day.\n * @type {Number}\n */\n this.secondsOfDay = undefined;\n\n julianDayNumber = defaultValue(julianDayNumber, 0.0);\n secondsOfDay = defaultValue(secondsOfDay, 0.0);\n timeStandard = defaultValue(timeStandard, TimeStandard.UTC);\n\n //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\n const wholeDays = julianDayNumber | 0;\n secondsOfDay =\n secondsOfDay +\n (julianDayNumber - wholeDays) * TimeConstants.SECONDS_PER_DAY;\n\n setComponents(wholeDays, secondsOfDay, this);\n\n if (timeStandard === TimeStandard.UTC) {\n convertUtcToTai(this);\n }\n}\n\n/**\n * Creates a new instance from a GregorianDate.\n *\n * @param {GregorianDate} date A GregorianDate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid GregorianDate.\n */\nJulianDate.fromGregorianDate = function (date, result) {\n const components = computeJulianDateComponents(\n date.year,\n date.month,\n date.day,\n date.hour,\n date.minute,\n date.second,\n date.millisecond\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a JavaScript Date.\n *\n * @param {Date} date A JavaScript Date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} date must be a valid JavaScript Date.\n */\nJulianDate.fromDate = function (date, result) {\n const components = computeJulianDateComponents(\n date.getUTCFullYear(),\n date.getUTCMonth() + 1,\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds()\n );\n if (!defined(result)) {\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\n }\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n return result;\n};\n\n/**\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\n * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\n *\n * @param {String} iso8601String An ISO 8601 date.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n *\n * @exception {DeveloperError} Invalid ISO 8601 date.\n */\nJulianDate.fromIso8601 = function (iso8601String, result) {\n //Comma and decimal point both indicate a fractional number according to ISO 8601,\n //start out by blanket replacing , with . which is the only valid such symbol in JS.\n iso8601String = iso8601String.replace(\",\", \".\");\n\n //Split the string into its date and time components, denoted by a mandatory T\n let tokens = iso8601String.split(\"T\");\n let year;\n let month = 1;\n let day = 1;\n let hour = 0;\n let minute = 0;\n let second = 0;\n let millisecond = 0;\n\n //Lacking a time is okay, but a missing date is illegal.\n const date = tokens[0];\n const time = tokens[1];\n let tmp;\n let inLeapYear;\n //First match the date against possible regular expressions.\n tokens = date.match(matchCalendarDate);\n if (tokens !== null) {\nyear = +tokens[1];\n month = +tokens[2];\n day = +tokens[3];\n } else {\n tokens = date.match(matchCalendarMonth);\n if (tokens !== null) {\n year = +tokens[1];\n month = +tokens[2];\n } else {\n tokens = date.match(matchCalendarYear);\n if (tokens !== null) {\n year = +tokens[1];\n } else {\n //Not a year/month/day so it must be an ordinal date.\n let dayOfYear;\n tokens = date.match(matchOrdinalDate);\n if (tokens !== null) {\n year = +tokens[1];\n dayOfYear = +tokens[2];\n inLeapYear = isLeapYear(year);\n\n //This validation is only applicable for this format.\n} else {\n tokens = date.match(matchWeekDate);\n if (tokens !== null) {\n //ISO week date to ordinal date from\n //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\n year = +tokens[1];\n const weekNumber = +tokens[2];\n const dayOfWeek = +tokens[3] || 0;\n\nconst january4 = new Date(Date.UTC(year, 0, 4));\n dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\n } else {\n //None of our regular expressions succeeded in parsing the date properly.\n}\n }\n //Split an ordinal date into month/day.\n tmp = new Date(Date.UTC(year, 0, 1));\n tmp.setUTCDate(dayOfYear);\n month = tmp.getUTCMonth() + 1;\n day = tmp.getUTCDate();\n }\n }\n }\n\n //Now that we have all of the date components, validate them to make sure nothing is out of range.\n inLeapYear = isLeapYear(year);\n//Now move onto the time string, which is much simpler.\n //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\n let offsetIndex;\n if (defined(time)) {\n tokens = time.match(matchHoursMinutesSeconds);\n if (tokens !== null) {\nhour = +tokens[1];\n minute = +tokens[2];\n second = +tokens[3];\n millisecond = +(tokens[4] || 0) * 1000.0;\n offsetIndex = 5;\n } else {\n tokens = time.match(matchHoursMinutes);\n if (tokens !== null) {\nhour = +tokens[1];\n minute = +tokens[2];\n second = +(tokens[3] || 0) * 60.0;\n offsetIndex = 4;\n } else {\n tokens = time.match(matchHours);\n if (tokens !== null) {\n hour = +tokens[1];\n minute = +(tokens[2] || 0) * 60.0;\n offsetIndex = 3;\n } else {\n}\n }\n }\n\n //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.\n //Check the UTC offset value, if no value exists, use local time\n //a Z indicates UTC, + or - are offsets.\n const offset = tokens[offsetIndex];\n const offsetHours = +tokens[offsetIndex + 1];\n const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\n switch (offset) {\n case \"+\":\n hour = hour - offsetHours;\n minute = minute - offsetMinutes;\n break;\n case \"-\":\n hour = hour + offsetHours;\n minute = minute + offsetMinutes;\n break;\n case \"Z\":\n break;\n default:\n minute =\n minute +\n new Date(\n Date.UTC(year, month - 1, day, hour, minute)\n ).getTimezoneOffset();\n break;\n }\n }\n\n //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\n //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\n //Then we add it back in after converting to TAI.\n const isLeapSecond = second === 60;\n if (isLeapSecond) {\n second--;\n }\n\n //Even if we successfully parsed the string into its components, after applying UTC offset or\n //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\n\n //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\n while (minute >= 60) {\n minute -= 60;\n hour++;\n }\n\n while (hour >= 24) {\n hour -= 24;\n day++;\n }\n\n tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n while (day > tmp) {\n day -= tmp;\n month++;\n\n if (month > 12) {\n month -= 12;\n year++;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n }\n\n //If UTC offset is at the beginning/end of the day, minutes can be negative.\n while (minute < 0) {\n minute += 60;\n hour--;\n }\n\n while (hour < 0) {\n hour += 24;\n day--;\n }\n\n while (day < 1) {\n month--;\n if (month < 1) {\n month += 12;\n year--;\n }\n\n tmp =\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\n day += tmp;\n }\n\n //Now create the JulianDate components from the Gregorian date and actually create our instance.\n const components = computeJulianDateComponents(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond\n );\n\n if (!defined(result)) {\n result = new JulianDate(components[0], components[1], TimeStandard.UTC);\n } else {\n setComponents(components[0], components[1], result);\n convertUtcToTai(result);\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n JulianDate.addSeconds(result, 1, result);\n }\n\n return result;\n};\n\n/**\n * Creates a new instance that represents the current system time.\n * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.now = function (result) {\n return JulianDate.fromDate(new Date(), result);\n};\n\nconst toGregorianDateScratch = new JulianDate(0, 0, TimeStandard.TAI);\n\n/**\n * Creates a {@link GregorianDate} from the provided instance.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {GregorianDate} [result] An existing instance to use for the result.\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.toGregorianDate = function (julianDate, result) {\n let isLeapSecond = false;\n let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);\n if (!defined(thisUtc)) {\n //Conversion to UTC will fail if we are during a leap second.\n //If that's the case, subtract a second and convert again.\n //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\n JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);\n thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);\n isLeapSecond = true;\n }\n\n let julianDayNumber = thisUtc.dayNumber;\n const secondsOfDay = thisUtc.secondsOfDay;\n\n if (secondsOfDay >= 43200.0) {\n julianDayNumber += 1;\n }\n\n // Algorithm from page 604 of the Explanatory Supplement to the\n // Astronomical Almanac (Seidelmann 1992).\n let L = (julianDayNumber + 68569) | 0;\n const N = ((4 * L) / 146097) | 0;\n L = (L - (((146097 * N + 3) / 4) | 0)) | 0;\n const I = ((4000 * (L + 1)) / 1461001) | 0;\n L = (L - (((1461 * I) / 4) | 0) + 31) | 0;\n const J = ((80 * L) / 2447) | 0;\n const day = (L - (((2447 * J) / 80) | 0)) | 0;\n L = (J / 11) | 0;\n const month = (J + 2 - 12 * L) | 0;\n const year = (100 * (N - 49) + I + L) | 0;\n\n let hour = (secondsOfDay / TimeConstants.SECONDS_PER_HOUR) | 0;\n let remainingSeconds = secondsOfDay - hour * TimeConstants.SECONDS_PER_HOUR;\n const minute = (remainingSeconds / TimeConstants.SECONDS_PER_MINUTE) | 0;\n remainingSeconds =\n remainingSeconds - minute * TimeConstants.SECONDS_PER_MINUTE;\n let second = remainingSeconds | 0;\n const millisecond =\n (remainingSeconds - second) / TimeConstants.SECONDS_PER_MILLISECOND;\n\n // JulianDates are noon-based\n hour += 12;\n if (hour > 23) {\n hour -= 24;\n }\n\n //If we were on a leap second, add it back.\n if (isLeapSecond) {\n second += 1;\n }\n\n if (!defined(result)) {\n return new GregorianDate(\n year,\n month,\n day,\n hour,\n minute,\n second,\n millisecond,\n isLeapSecond\n );\n }\n\n result.year = year;\n result.month = month;\n result.day = day;\n result.hour = hour;\n result.minute = minute;\n result.second = second;\n result.millisecond = millisecond;\n result.isLeapSecond = isLeapSecond;\n return result;\n};\n\n/**\n * Creates a JavaScript Date from the provided instance.\n * Since JavaScript dates are only accurate to the nearest millisecond and\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\n * If the provided JulianDate is during a leap second, the previous second is used.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @returns {Date} A new instance representing the provided date.\n */\nJulianDate.toDate = function (julianDate) {\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let second = gDate.second;\n if (gDate.isLeapSecond) {\n second -= 1;\n }\n return new Date(\n Date.UTC(\n gDate.year,\n gDate.month - 1,\n gDate.day,\n gDate.hour,\n gDate.minute,\n second,\n gDate.millisecond\n )\n );\n};\n\n/**\n * Creates an ISO8601 representation of the provided date.\n *\n * @param {JulianDate} julianDate The date to be converted.\n * @param {Number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\n * @returns {String} The ISO8601 representation of the provided date.\n */\nJulianDate.toIso8601 = function (julianDate, precision) {\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\n let year = gDate.year;\n let month = gDate.month;\n let day = gDate.day;\n let hour = gDate.hour;\n const minute = gDate.minute;\n const second = gDate.second;\n const millisecond = gDate.millisecond;\n\n // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\n // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\n if (\n year === 10000 &&\n month === 1 &&\n day === 1 &&\n hour === 0 &&\n minute === 0 &&\n second === 0 &&\n millisecond === 0\n ) {\n year = 9999;\n month = 12;\n day = 31;\n hour = 24;\n }\n\n let millisecondStr;\n\n if (!defined(precision) && millisecond !== 0) {\n //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\n millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day\n .toString()\n .padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute\n .toString()\n .padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n }\n\n //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\n if (!defined(precision) || precision === 0) {\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day\n .toString()\n .padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute\n .toString()\n .padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\n }\n\n //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\n millisecondStr = (millisecond * 0.01)\n .toFixed(precision)\n .replace(\".\", \"\")\n .slice(0, precision);\n return `${year.toString().padStart(4, \"0\")}-${month\n .toString()\n .padStart(2, \"0\")}-${day\n .toString()\n .padStart(2, \"0\")}T${hour\n .toString()\n .padStart(2, \"0\")}:${minute\n .toString()\n .padStart(2, \"0\")}:${second\n .toString()\n .padStart(2, \"0\")}.${millisecondStr}Z`;\n};\n\n/**\n * Duplicates a JulianDate instance.\n *\n * @param {JulianDate} julianDate The date to duplicate.\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\n */\nJulianDate.clone = function (julianDate, result) {\n if (!defined(julianDate)) {\n return undefined;\n }\n if (!defined(result)) {\n return new JulianDate(\n julianDate.dayNumber,\n julianDate.secondsOfDay,\n TimeStandard.TAI\n );\n }\n result.dayNumber = julianDate.dayNumber;\n result.secondsOfDay = julianDate.secondsOfDay;\n return result;\n};\n\n/**\n * Compares two instances.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Number} A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.\n */\nJulianDate.compare = function (left, right) {\n const julianDayNumberDifference = left.dayNumber - right.dayNumber;\n if (julianDayNumberDifference !== 0) {\n return julianDayNumberDifference;\n }\n return left.secondsOfDay - right.secondsOfDay;\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @returns {Boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nJulianDate.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.dayNumber === right.dayNumber &&\n left.secondsOfDay === right.secondsOfDay)\n );\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {JulianDate} [left] The first instance.\n * @param {JulianDate} [right] The second instance.\n * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {Boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nJulianDate.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)\n );\n};\n\n/**\n * Computes the total number of whole and fractional days represented by the provided instance.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {Number} The Julian date as single floating point number.\n */\nJulianDate.totalDays = function (julianDate) {\nreturn (\n julianDate.dayNumber +\n julianDate.secondsOfDay / TimeConstants.SECONDS_PER_DAY\n );\n};\n\n/**\n * Computes the difference in seconds between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Number} The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.\n */\nJulianDate.secondsDifference = function (left, right) {\n const dayDifference =\n (left.dayNumber - right.dayNumber) * TimeConstants.SECONDS_PER_DAY;\n return dayDifference + (left.secondsOfDay - right.secondsOfDay);\n};\n\n/**\n * Computes the difference in days between the provided instance.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Number} The difference, in days, when subtracting <code>right</code> from <code>left</code>.\n */\nJulianDate.daysDifference = function (left, right) {\n const dayDifference = left.dayNumber - right.dayNumber;\n const secondDifference =\n (left.secondsOfDay - right.secondsOfDay) / TimeConstants.SECONDS_PER_DAY;\n return dayDifference + secondDifference;\n};\n\n/**\n * Computes the number of seconds the provided instance is ahead of UTC.\n *\n * @param {JulianDate} julianDate The date.\n * @returns {Number} The number of seconds the provided instance is ahead of UTC\n */\nJulianDate.computeTaiMinusUtc = function (julianDate) {\n binarySearchScratchLeapSecond.julianDate = julianDate;\n const leapSeconds = JulianDate.leapSeconds;\n let index = binarySearch(\n leapSeconds,\n binarySearchScratchLeapSecond,\n compareLeapSecondDates\n );\n if (index < 0) {\n index = ~index;\n --index;\n if (index < 0) {\n index = 0;\n }\n }\n return leapSeconds[index].offset;\n};\n\n/**\n * Adds the provided number of seconds to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {Number} seconds The number of seconds to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addSeconds = function (julianDate, seconds, result) {\n return setComponents(\n julianDate.dayNumber,\n julianDate.secondsOfDay + seconds,\n result\n );\n};\n\n/**\n * Adds the provided number of minutes to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {Number} minutes The number of minutes to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addMinutes = function (julianDate, minutes, result) {\n const newSecondsOfDay =\n julianDate.secondsOfDay + minutes * TimeConstants.SECONDS_PER_MINUTE;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of hours to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {Number} hours The number of hours to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addHours = function (julianDate, hours, result) {\n const newSecondsOfDay =\n julianDate.secondsOfDay + hours * TimeConstants.SECONDS_PER_HOUR;\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\n};\n\n/**\n * Adds the provided number of days to the provided date instance.\n *\n * @param {JulianDate} julianDate The date.\n * @param {Number} days The number of days to add or subtract.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n */\nJulianDate.addDays = function (julianDate, days, result) {\n const newJulianDayNumber = julianDate.dayNumber + days;\n return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Boolean} <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.lessThan = function (left, right) {\n return JulianDate.compare(left, right) < 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Boolean} <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.lessThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) <= 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Boolean} <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.greaterThan = function (left, right) {\n return JulianDate.compare(left, right) > 0;\n};\n\n/**\n * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.\n *\n * @param {JulianDate} left The first instance.\n * @param {JulianDate} right The second instance.\n * @returns {Boolean} <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.\n */\nJulianDate.greaterThanOrEquals = function (left, right) {\n return JulianDate.compare(left, right) >= 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {JulianDate} [result] An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\n */\nJulianDate.prototype.clone = function (result) {\n return JulianDate.clone(this, result);\n};\n\n/**\n * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {JulianDate} [right] The second instance.\n * @returns {Boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nJulianDate.prototype.equals = function (right) {\n return JulianDate.equals(this, right);\n};\n\n/**\n * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {JulianDate} [right] The second instance.\n * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @returns {Boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nJulianDate.prototype.equalsEpsilon = function (right, epsilon) {\n return JulianDate.equalsEpsilon(this, right, epsilon);\n};\n\n/**\n * Creates a string representing this date in ISO8601 format.\n *\n * @returns {String} A string representing this date in ISO8601 format.\n */\nJulianDate.prototype.toString = function () {\n return JulianDate.toIso8601(this);\n};\n\n/**\n * Gets or sets the list of leap seconds used throughout Cesium.\n * @memberof JulianDate\n * @type {LeapSecond[]}\n */\nJulianDate.leapSeconds = [\n new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard.TAI), 10), // January 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard.TAI), 11), // July 1, 1972 00:00:00 UTC\n new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard.TAI), 12), // January 1, 1973 00:00:00 UTC\n new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard.TAI), 13), // January 1, 1974 00:00:00 UTC\n new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard.TAI), 14), // January 1, 1975 00:00:00 UTC\n new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard.TAI), 15), // January 1, 1976 00:00:00 UTC\n new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard.TAI), 16), // January 1, 1977 00:00:00 UTC\n new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard.TAI), 17), // January 1, 1978 00:00:00 UTC\n new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard.TAI), 18), // January 1, 1979 00:00:00 UTC\n new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard.TAI), 19), // January 1, 1980 00:00:00 UTC\n new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard.TAI), 20), // July 1, 1981 00:00:00 UTC\n new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard.TAI), 21), // July 1, 1982 00:00:00 UTC\n new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard.TAI), 22), // July 1, 1983 00:00:00 UTC\n new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard.TAI), 23), // July 1, 1985 00:00:00 UTC\n new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard.TAI), 24), // January 1, 1988 00:00:00 UTC\n new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard.TAI), 25), // January 1, 1990 00:00:00 UTC\n new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard.TAI), 26), // January 1, 1991 00:00:00 UTC\n new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard.TAI), 27), // July 1, 1992 00:00:00 UTC\n new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard.TAI), 28), // July 1, 1993 00:00:00 UTC\n new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard.TAI), 29), // July 1, 1994 00:00:00 UTC\n new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard.TAI), 30), // January 1, 1996 00:00:00 UTC\n new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard.TAI), 31), // July 1, 1997 00:00:00 UTC\n new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard.TAI), 32), // January 1, 1999 00:00:00 UTC\n new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard.TAI), 33), // January 1, 2006 00:00:00 UTC\n new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard.TAI), 34), // January 1, 2009 00:00:00 UTC\n new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard.TAI), 35), // July 1, 2012 00:00:00 UTC\n new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard.TAI), 36), // July 1, 2015 00:00:00 UTC\n new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard.TAI), 37), // January 1, 2017 00:00:00 UTC\n];\nexport default JulianDate;\n", "import Uri from \"urijs\";\nimport appendForwardSlash from \"./appendForwardSlash.js\";\nimport Check from \"./Check.js\";\nimport clone from \"./clone.js\";\nimport combine from \"./combine.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport getBaseUri from \"./getBaseUri.js\";\nimport getExtensionFromUri from \"./getExtensionFromUri.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport objectToQuery from \"./objectToQuery.js\";\nimport queryToObject from \"./queryToObject.js\";\nimport Request from \"./Request.js\";\nimport RequestErrorEvent from \"./RequestErrorEvent.js\";\nimport RequestScheduler from \"./RequestScheduler.js\";\nimport RequestState from \"./RequestState.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TrustedServers from \"./TrustedServers.js\";\n\nconst xhrBlobSupported = (function () {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"#\", true);\n xhr.responseType = \"blob\";\n return xhr.responseType === \"blob\";\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * Parses a query string and returns the object equivalent.\n *\n * @param {Uri} uri The Uri with a query object.\n * @param {Resource} resource The Resource that will be assigned queryParameters.\n * @param {Boolean} merge If true, we'll merge with the resource's existing queryParameters. Otherwise they will be replaced.\n * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in uri will take precedence.\n *\n * @private\n */\nfunction parseQuery(uri, resource, merge, preserveQueryParameters) {\n const queryString = uri.query();\n if (queryString.length === 0) {\n return {};\n }\n\n let query;\n // Special case we run into where the querystring is just a string, not key/value pairs\n if (queryString.indexOf(\"=\") === -1) {\n const result = {};\n result[queryString] = undefined;\n query = result;\n } else {\n query = queryToObject(queryString);\n }\n\n if (merge) {\n resource._queryParameters = combineQueryParameters(\n query,\n resource._queryParameters,\n preserveQueryParameters\n );\n } else {\n resource._queryParameters = query;\n }\n uri.search(\"\");\n}\n\n/**\n * Converts a query object into a string.\n *\n * @param {Uri} uri The Uri object that will have the query object set.\n * @param {Resource} resource The resource that has queryParameters\n *\n * @private\n */\nfunction stringifyQuery(uri, resource) {\n const queryObject = resource._queryParameters;\n\n const keys = Object.keys(queryObject);\n\n // We have 1 key with an undefined value, so this is just a string, not key/value pairs\n if (keys.length === 1 && !defined(queryObject[keys[0]])) {\n uri.search(keys[0]);\n } else {\n uri.search(objectToQuery(queryObject));\n }\n}\n\n/**\n * Clones a value if it is defined, otherwise returns the default value\n *\n * @param {*} [val] The value to clone.\n * @param {*} [defaultVal] The default value.\n *\n * @returns {*} A clone of val or the defaultVal.\n *\n * @private\n */\nfunction defaultClone(val, defaultVal) {\n if (!defined(val)) {\n return defaultVal;\n }\n\n return defined(val.clone) ? val.clone() : clone(val);\n}\n\n/**\n * Checks to make sure the Resource isn't already being requested.\n *\n * @param {Request} request The request to check.\n *\n * @private\n */\nfunction checkAndResetRequest(request) {\n if (\n request.state === RequestState.ISSUED ||\n request.state === RequestState.ACTIVE\n ) {\n throw new RuntimeError(\"The Resource is already being fetched.\");\n }\n\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n}\n\n/**\n * This combines a map of query parameters.\n *\n * @param {Object} q1 The first map of query parameters. Values in this map will take precedence if preserveQueryParameters is false.\n * @param {Object} q2 The second map of query parameters.\n * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in q1 will take precedence.\n *\n * @returns {Object} The combined map of query parameters.\n *\n * @example\n * const q1 = {\n * a: 1,\n * b: 2\n * };\n * const q2 = {\n * a: 3,\n * c: 4\n * };\n * const q3 = {\n * b: [5, 6],\n * d: 7\n * }\n *\n * // Returns\n * // {\n * // a: [1, 3],\n * // b: 2,\n * // c: 4\n * // };\n * combineQueryParameters(q1, q2, true);\n *\n * // Returns\n * // {\n * // a: 1,\n * // b: 2,\n * // c: 4\n * // };\n * combineQueryParameters(q1, q2, false);\n *\n * // Returns\n * // {\n * // a: 1,\n * // b: [2, 5, 6],\n * // d: 7\n * // };\n * combineQueryParameters(q1, q3, true);\n *\n * // Returns\n * // {\n * // a: 1,\n * // b: 2,\n * // d: 7\n * // };\n * combineQueryParameters(q1, q3, false);\n *\n * @private\n */\nfunction combineQueryParameters(q1, q2, preserveQueryParameters) {\n if (!preserveQueryParameters) {\n return combine(q1, q2);\n }\n\n const result = clone(q1, true);\n for (const param in q2) {\n if (q2.hasOwnProperty(param)) {\n let value = result[param];\n const q2Value = q2[param];\n if (defined(value)) {\n if (!Array.isArray(value)) {\n value = result[param] = [value];\n }\n\n result[param] = value.concat(q2Value);\n } else {\n result[param] = Array.isArray(q2Value) ? q2Value.slice() : q2Value;\n }\n }\n }\n\n return result;\n}\n\n/**\n * @typedef {Object} Resource.ConstructorOptions\n *\n * Initialization options for the Resource constructor\n *\n * @property {String} url The url of the resource.\n * @property {Object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @property {Object} [headers={}] Additional HTTP headers that will be sent.\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\n */\n\n/**\n * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.\n *\n * @alias Resource\n * @constructor\n *\n * @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options\n *\n * @example\n * function refreshTokenRetryCallback(resource, error) {\n * if (error.statusCode === 403) {\n * // 403 status code means a new token should be generated\n * return getNewAccessToken()\n * .then(function(token) {\n * resource.queryParameters.access_token = token;\n * return true;\n * })\n * .catch(function() {\n * return false;\n * });\n * }\n *\n * return false;\n * }\n *\n * const resource = new Resource({\n * url: 'http://server.com/path/to/resource.json',\n * proxy: new DefaultProxy('/proxy/'),\n * headers: {\n * 'X-My-Header': 'valueOfHeader'\n * },\n * queryParameters: {\n * 'access_token': '123-435-456-000'\n * },\n * retryCallback: refreshTokenRetryCallback,\n * retryAttempts: 1\n * });\n */\nfunction Resource(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n if (typeof options === \"string\") {\n options = {\n url: options,\n };\n }\n\n this._url = undefined;\n this._templateValues = defaultClone(options.templateValues, {});\n this._queryParameters = defaultClone(options.queryParameters, {});\n\n /**\n * Additional HTTP headers that will be sent with the request.\n *\n * @type {Object}\n */\n this.headers = defaultClone(options.headers, {});\n\n /**\n * A Request object that will be used. Intended for internal use only.\n *\n * @type {Request}\n */\n this.request = defaultValue(options.request, new Request());\n\n /**\n * A proxy to be used when loading the resource.\n *\n * @type {Proxy}\n */\n this.proxy = options.proxy;\n\n /**\n * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.\n *\n * @type {Function}\n */\n this.retryCallback = options.retryCallback;\n\n /**\n * The number of times the retryCallback should be called before giving up.\n *\n * @type {Number}\n */\n this.retryAttempts = defaultValue(options.retryAttempts, 0);\n this._retryCount = 0;\n\n const uri = new Uri(options.url);\n parseQuery(uri, this, true, true);\n\n // Remove the fragment as it's not sent with a request\n uri.fragment(\"\");\n\n this._url = uri.toString();\n}\n\n/**\n * A helper function to create a resource depending on whether we have a String or a Resource\n *\n * @param {Resource|String} resource A Resource or a String to use when creating a new Resource.\n *\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\n *\n * @private\n */\nResource.createIfNeeded = function (resource) {\n if (resource instanceof Resource) {\n // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\n // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\n // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\n // in the underlying tiling code the requests for this resource will use it.\n return resource.getDerivedResource({\n request: resource.request,\n });\n }\n\n if (typeof resource !== \"string\") {\n return resource;\n }\n\n return new Resource({\n url: resource,\n });\n};\n\nlet supportsImageBitmapOptionsPromise;\n/**\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\n *\n * @returns {Promise<Boolean>} A promise that resolves to true if this browser supports creating an ImageBitmap with options.\n *\n * @private\n */\nResource.supportsImageBitmapOptions = function () {\n // Until the HTML folks figure out what to do about this, we need to actually try loading an image to\n // know if this browser supports passing options to the createImageBitmap function.\n // https://github.com/whatwg/html/pull/4248\n //\n // We also need to check whether the colorSpaceConversion option is supported.\n // We do this by loading a PNG with an embedded color profile, first with\n // colorSpaceConversion: \"none\" and then with colorSpaceConversion: \"default\".\n // If the pixel color is different then we know the option is working.\n // As of Webkit 17612.3.6.1.6 the createImageBitmap promise resolves but the\n // option is not actually supported.\n if (defined(supportsImageBitmapOptionsPromise)) {\n return supportsImageBitmapOptionsPromise;\n }\n\n if (typeof createImageBitmap !== \"function\") {\n supportsImageBitmapOptionsPromise = Promise.resolve(false);\n return supportsImageBitmapOptionsPromise;\n }\n\n const imageDataUri =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC\";\n\n supportsImageBitmapOptionsPromise = Resource.fetchBlob({\n url: imageDataUri,\n })\n .then(function (blob) {\n const imageBitmapOptions = {\n imageOrientation: \"flipY\", // default is \"none\"\n premultiplyAlpha: \"none\", // default is \"default\"\n colorSpaceConversion: \"none\", // default is \"default\"\n };\n return Promise.all([\n createImageBitmap(blob, imageBitmapOptions),\n createImageBitmap(blob),\n ]);\n })\n .then(function (imageBitmaps) {\n // Check whether the colorSpaceConversion option had any effect on the green channel\n const colorWithOptions = getImagePixels(imageBitmaps[0]);\n const colorWithDefaults = getImagePixels(imageBitmaps[1]);\n return colorWithOptions[1] !== colorWithDefaults[1];\n })\n .catch(function () {\n return false;\n });\n\n return supportsImageBitmapOptionsPromise;\n};\n\nObject.defineProperties(Resource, {\n /**\n * Returns true if blobs are supported.\n *\n * @memberof Resource\n * @type {Boolean}\n *\n * @readonly\n */\n isBlobSupported: {\n get: function () {\n return xhrBlobSupported;\n },\n },\n});\n\nObject.defineProperties(Resource.prototype, {\n /**\n * Query parameters appended to the url.\n *\n * @memberof Resource.prototype\n * @type {Object}\n *\n * @readonly\n */\n queryParameters: {\n get: function () {\n return this._queryParameters;\n },\n },\n\n /**\n * The key/value pairs used to replace template parameters in the url.\n *\n * @memberof Resource.prototype\n * @type {Object}\n *\n * @readonly\n */\n templateValues: {\n get: function () {\n return this._templateValues;\n },\n },\n\n /**\n * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.\n *\n * @memberof Resource.prototype\n * @type {String}\n */\n url: {\n get: function () {\n return this.getUrlComponent(true, true);\n },\n set: function (value) {\n const uri = new Uri(value);\n\n parseQuery(uri, this, false);\n\n // Remove the fragment as it's not sent with a request\n uri.fragment(\"\");\n\n this._url = uri.toString();\n },\n },\n\n /**\n * The file extension of the resource.\n *\n * @memberof Resource.prototype\n * @type {String}\n *\n * @readonly\n */\n extension: {\n get: function () {\n return getExtensionFromUri(this._url);\n },\n },\n\n /**\n * True if the Resource refers to a data URI.\n *\n * @memberof Resource.prototype\n * @type {Boolean}\n */\n isDataUri: {\n get: function () {\n return isDataUri(this._url);\n },\n },\n\n /**\n * True if the Resource refers to a blob URI.\n *\n * @memberof Resource.prototype\n * @type {Boolean}\n */\n isBlobUri: {\n get: function () {\n return isBlobUri(this._url);\n },\n },\n\n /**\n * True if the Resource refers to a cross origin URL.\n *\n * @memberof Resource.prototype\n * @type {Boolean}\n */\n isCrossOriginUrl: {\n get: function () {\n return isCrossOriginUrl(this._url);\n },\n },\n\n /**\n * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.\n *\n * @memberof Resource.prototype\n * @type {Boolean}\n */\n hasHeaders: {\n get: function () {\n return Object.keys(this.headers).length > 0;\n },\n },\n});\n\n/**\n * Override Object#toString so that implicit string conversion gives the\n * complete URL represented by this Resource.\n *\n * @returns {String} The URL represented by this Resource\n */\nResource.prototype.toString = function () {\n return this.getUrlComponent(true, true);\n};\n\n/**\n * Returns the url, optional with the query string and processed by a proxy.\n *\n * @param {Boolean} [query=false] If true, the query string is included.\n * @param {Boolean} [proxy=false] If true, the url is processed by the proxy object, if defined.\n *\n * @returns {String} The url with all the requested components.\n */\nResource.prototype.getUrlComponent = function (query, proxy) {\n if (this.isDataUri) {\n return this._url;\n }\n\n const uri = new Uri(this._url);\n\n if (query) {\n stringifyQuery(uri, this);\n }\n\n // objectToQuery escapes the placeholders. Undo that.\n let url = uri.toString().replace(/%7B/g, \"{\").replace(/%7D/g, \"}\");\n\n const templateValues = this._templateValues;\n url = url.replace(/{(.*?)}/g, function (match, key) {\n const replacement = templateValues[key];\n if (defined(replacement)) {\n // use the replacement value from templateValues if there is one...\n return encodeURIComponent(replacement);\n }\n // otherwise leave it unchanged\n return match;\n });\n\n if (proxy && defined(this.proxy)) {\n url = this.proxy.getURL(url);\n }\n return url;\n};\n\n/**\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\n * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.\n *\n * @param {Object} params The query parameters\n * @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined.\n */\nResource.prototype.setQueryParameters = function (params, useAsDefault) {\n if (useAsDefault) {\n this._queryParameters = combineQueryParameters(\n this._queryParameters,\n params,\n false\n );\n } else {\n this._queryParameters = combineQueryParameters(\n params,\n this._queryParameters,\n false\n );\n }\n};\n\n/**\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\n * as opposed to adding them one at a time to the queryParameters property.\n *\n * @param {Object} params The query parameters\n */\nResource.prototype.appendQueryParameters = function (params) {\n this._queryParameters = combineQueryParameters(\n params,\n this._queryParameters,\n true\n );\n};\n\n/**\n * Combines the specified object and the existing template values. This allows you to add many values at once,\n * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.\n *\n * @param {Object} template The template values\n * @param {Boolean} [useAsDefault=false] If true the values will be used as the default values, so they will only be set if they are undefined.\n */\nResource.prototype.setTemplateValues = function (template, useAsDefault) {\n if (useAsDefault) {\n this._templateValues = combine(this._templateValues, template);\n } else {\n this._templateValues = combine(template, this._templateValues);\n }\n};\n\n/**\n * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.\n *\n * @param {Object} options An object with the following properties\n * @param {String} [options.url] The url that will be resolved relative to the url of the current instance.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be combined with those of the current instance.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails.\n * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {Boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.\n *\n * @returns {Resource} The resource derived from the current one.\n */\nResource.prototype.getDerivedResource = function (options) {\n const resource = this.clone();\n resource._retryCount = 0;\n\n if (defined(options.url)) {\n const uri = new Uri(options.url);\n\n const preserveQueryParameters = defaultValue(\n options.preserveQueryParameters,\n false\n );\n parseQuery(uri, resource, true, preserveQueryParameters);\n\n // Remove the fragment as it's not sent with a request\n uri.fragment(\"\");\n\n if (uri.scheme() !== \"\") {\n resource._url = uri.toString();\n } else {\n resource._url = uri\n .absoluteTo(new Uri(getAbsoluteUri(this._url)))\n .toString();\n }\n }\n\n if (defined(options.queryParameters)) {\n resource._queryParameters = combine(\n options.queryParameters,\n resource._queryParameters\n );\n }\n if (defined(options.templateValues)) {\n resource._templateValues = combine(\n options.templateValues,\n resource.templateValues\n );\n }\n if (defined(options.headers)) {\n resource.headers = combine(options.headers, resource.headers);\n }\n if (defined(options.proxy)) {\n resource.proxy = options.proxy;\n }\n if (defined(options.request)) {\n resource.request = options.request;\n }\n if (defined(options.retryCallback)) {\n resource.retryCallback = options.retryCallback;\n }\n if (defined(options.retryAttempts)) {\n resource.retryAttempts = options.retryAttempts;\n }\n\n return resource;\n};\n\n/**\n * Called when a resource fails to load. This will call the retryCallback function if defined until retryAttempts is reached.\n *\n * @param {Error} [error] The error that was encountered.\n *\n * @returns {Promise<Boolean>} A promise to a boolean, that if true will cause the resource request to be retried.\n *\n * @private\n */\nResource.prototype.retryOnError = function (error) {\n const retryCallback = this.retryCallback;\n if (\n typeof retryCallback !== \"function\" ||\n this._retryCount >= this.retryAttempts\n ) {\n return Promise.resolve(false);\n }\n\n const that = this;\n return Promise.resolve(retryCallback(this, error)).then(function (result) {\n ++that._retryCount;\n\n return result;\n });\n};\n\n/**\n * Duplicates a Resource instance.\n *\n * @param {Resource} [result] The object onto which to store the result.\n *\n * @returns {Resource} The modified result parameter or a new Resource instance if one was not provided.\n */\nResource.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new Resource({\n url: this._url,\n });\n }\n\n result._url = this._url;\n result._queryParameters = clone(this._queryParameters);\n result._templateValues = clone(this._templateValues);\n result.headers = clone(this.headers);\n result.proxy = this.proxy;\n result.retryCallback = this.retryCallback;\n result.retryAttempts = this.retryAttempts;\n result._retryCount = 0;\n result.request = this.request.clone();\n\n return result;\n};\n\n/**\n * Returns the base path of the Resource.\n *\n * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\n *\n * @returns {String} The base URI of the resource\n */\nResource.prototype.getBaseUri = function (includeQuery) {\n return getBaseUri(this.getUrlComponent(includeQuery), includeQuery);\n};\n\n/**\n * Appends a forward slash to the URL.\n */\nResource.prototype.appendForwardSlash = function () {\n this._url = appendForwardSlash(this._url);\n};\n\n/**\n * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to\n * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise.<ArrayBuffer>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchArrayBuffer = function () {\n return this.fetch({\n responseType: \"arraybuffer\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchArrayBuffer() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise.<ArrayBuffer>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchArrayBuffer = function (options) {\n const resource = new Resource(options);\n return resource.fetchArrayBuffer();\n};\n\n/**\n * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to\n * a Blob once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise.<Blob>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load a single URL asynchronously\n * resource.fetchBlob().then(function(blob) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchBlob = function () {\n return this.fetch({\n responseType: \"blob\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchBlob() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise.<Blob>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchBlob = function (options) {\n const resource = new Resource(options);\n return resource.fetchBlob();\n};\n\n/**\n * Asynchronously loads the given image resource. Returns a promise that will resolve to\n * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\n *\n * @param {Object} [options] An object with the following properties.\n * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {Boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.\n * @returns {Promise.<ImageBitmap|HTMLImageElement>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a single image asynchronously\n * resource.fetchImage().then(function(image) {\n * // use the loaded image\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * // load several images in parallel\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\n * // images is an array containing all the loaded images\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchImage = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const preferImageBitmap = defaultValue(options.preferImageBitmap, false);\n const preferBlob = defaultValue(options.preferBlob, false);\n const flipY = defaultValue(options.flipY, false);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n\n checkAndResetRequest(this.request);\n // We try to load the image normally if\n // 1. Blobs aren't supported\n // 2. It's a data URI\n // 3. It's a blob URI\n // 4. It doesn't have request headers and we preferBlob is false\n if (\n !xhrBlobSupported ||\n this.isDataUri ||\n this.isBlobUri ||\n (!this.hasHeaders && !preferBlob)\n ) {\n return fetchImage({\n resource: this,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n\n const blobPromise = this.fetchBlob();\n if (!defined(blobPromise)) {\n return;\n }\n\n let supportsImageBitmap;\n let useImageBitmap;\n let generatedBlobResource;\n let generatedBlob;\n return Resource.supportsImageBitmapOptions()\n .then(function (result) {\n supportsImageBitmap = result;\n useImageBitmap = supportsImageBitmap && preferImageBitmap;\n return blobPromise;\n })\n .then(function (blob) {\n if (!defined(blob)) {\n return;\n }\n generatedBlob = blob;\n if (useImageBitmap) {\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n }\n const blobUrl = window.URL.createObjectURL(blob);\n generatedBlobResource = new Resource({\n url: blobUrl,\n });\n\n return fetchImage({\n resource: generatedBlobResource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: false,\n });\n })\n .then(function (image) {\n if (!defined(image)) {\n return;\n }\n\n // The blob object may be needed for use by a TileDiscardPolicy,\n // so attach it to the image.\n image.blob = generatedBlob;\n\n if (useImageBitmap) {\n return image;\n }\n\n window.URL.revokeObjectURL(generatedBlobResource.url);\n return image;\n })\n .catch(function (error) {\n if (defined(generatedBlobResource)) {\n window.URL.revokeObjectURL(generatedBlobResource.url);\n }\n\n // If the blob load succeeded but the image decode failed, attach the blob\n // to the error object for use by a TileDiscardPolicy.\n // In particular, BingMapsImageryProvider uses this to detect the\n // zero-length response that is returned when a tile is not available.\n error.blob = generatedBlob;\n\n return Promise.reject(error);\n });\n};\n\n/**\n * Fetches an image and returns a promise to it.\n *\n * @param {Object} [options] An object with the following properties.\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\n * @param {Boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {Boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.\n * @private\n */\nfunction fetchImage(options) {\n const resource = options.resource;\n const flipY = options.flipY;\n const skipColorSpaceConversion = options.skipColorSpaceConversion;\n const preferImageBitmap = options.preferImageBitmap;\n\n const request = resource.request;\n request.url = resource.url;\n request.requestFunction = function () {\n let crossOrigin = false;\n\n // data URIs can't have crossorigin set.\n if (!resource.isDataUri && !resource.isBlobUri) {\n crossOrigin = resource.isCrossOriginUrl;\n }\n\n const deferred = defer();\n Resource._Implementations.createImage(\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap\n );\n\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n // Don't retry cancelled or otherwise aborted requests\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchImage({\n resource: resource,\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: preferImageBitmap,\n });\n }\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource and calls fetchImage() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.\n * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.\n * @returns {Promise.<ImageBitmap|HTMLImageElement>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchImage = function (options) {\n const resource = new Resource(options);\n return resource.fetchImage({\n flipY: options.flipY,\n skipColorSpaceConversion: options.skipColorSpaceConversion,\n preferBlob: options.preferBlob,\n preferImageBitmap: options.preferImageBitmap,\n });\n};\n\n/**\n * Asynchronously loads the given resource as text. Returns a promise that will resolve to\n * a String once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise.<String>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @example\n * // load text from a URL, setting a custom header\n * const resource = new Resource({\n * url: 'http://someUrl.com/someJson.txt',\n * headers: {\n * 'X-Custom-Header' : 'some value'\n * }\n * });\n * resource.fetchText().then(function(text) {\n * // Do something with the text\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchText = function () {\n return this.fetch({\n responseType: \"text\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchText() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise.<String>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchText = function (options) {\n const resource = new Resource(options);\n return resource.fetchText();\n};\n\n// note: */* below is */* but that ends the comment block early\n/**\n * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to\n * a JSON object once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\n * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not\n * already specified.\n *\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetchJson().then(function(jsonData) {\n * // Do something with the JSON object\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJson = function () {\n const promise = this.fetch({\n responseType: \"text\",\n headers: {\n Accept: \"application/json,*/*;q=0.01\",\n },\n });\n\n if (!defined(promise)) {\n return undefined;\n }\n\n return promise.then(function (value) {\n if (!defined(value)) {\n return;\n }\n return JSON.parse(value);\n });\n};\n\n/**\n * Creates a Resource and calls fetchJson() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchJson = function (options) {\n const resource = new Resource(options);\n return resource.fetchJson();\n};\n\n/**\n * Asynchronously loads the given resource as XML. Returns a promise that will resolve to\n * an XML Document once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @returns {Promise.<XMLDocument>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load XML from a URL, setting a custom header\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\n * 'X-Custom-Header' : 'some value'\n * }).then(function(document) {\n * // Do something with the document\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchXML = function () {\n return this.fetch({\n responseType: \"document\",\n overrideMimeType: \"text/xml\",\n });\n};\n\n/**\n * Creates a Resource and calls fetchXML() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @returns {Promise.<XMLDocument>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchXML = function (options) {\n const resource = new Resource(options);\n return resource.fetchXML();\n};\n\n/**\n * Requests a resource using JSONP.\n *\n * @param {String} [callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * // load a data asynchronously\n * resource.fetchJsonp().then(function(data) {\n * // use the loaded data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetchJsonp = function (callbackParameterName) {\n callbackParameterName = defaultValue(callbackParameterName, \"callback\");\n\n checkAndResetRequest(this.request);\n\n //generate a unique function name\n let functionName;\n do {\n functionName = `loadJsonp${CesiumMath.nextRandomNumber()\n .toString()\n .substring(2, 8)}`;\n } while (defined(window[functionName]));\n\n return fetchJsonp(this, callbackParameterName, functionName);\n};\n\nfunction fetchJsonp(resource, callbackParameterName, functionName) {\n const callbackQuery = {};\n callbackQuery[callbackParameterName] = functionName;\n resource.setQueryParameters(callbackQuery);\n\n const request = resource.request;\n request.url = resource.url;\n request.requestFunction = function () {\n const deferred = defer();\n\n //assign a function with that name in the global scope\n window[functionName] = function (data) {\n deferred.resolve(data);\n\n try {\n delete window[functionName];\n } catch (e) {\n window[functionName] = undefined;\n }\n };\n\n Resource._Implementations.loadAndExecuteScript(\n resource.url,\n functionName,\n deferred\n );\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise.catch(function (e) {\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return fetchJsonp(resource, callbackParameterName, functionName);\n }\n\n return Promise.reject(e);\n });\n });\n}\n\n/**\n * Creates a Resource from a URL and calls fetchJsonp() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetchJsonp = function (options) {\n const resource = new Resource(options);\n return resource.fetchJsonp(options.callbackParameterName);\n};\n\n/**\n * @private\n */\nResource.prototype._makeRequest = function (options) {\n const resource = this;\n checkAndResetRequest(resource.request);\n\n const request = resource.request;\n request.url = resource.url;\n\n request.requestFunction = function () {\n const responseType = options.responseType;\n const headers = combine(options.headers, resource.headers);\n const overrideMimeType = options.overrideMimeType;\n const method = options.method;\n const data = options.data;\n const deferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n resource.url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType\n );\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return deferred.promise;\n };\n\n const promise = RequestScheduler.request(request);\n if (!defined(promise)) {\n return;\n }\n\n return promise\n .then(function (data) {\n // explicitly set to undefined to ensure GC of request response data. See #8843\n\n console.log('data', data)\n request.cancelFunction = undefined;\n return data;\n })\n .catch(function (e) {\n request.cancelFunction = undefined;\n if (request.state !== RequestState.FAILED) {\n return Promise.reject(e);\n }\n\n return resource.retryOnError(e).then(function (retry) {\n if (retry) {\n // Reset request so it can try again\n request.state = RequestState.UNISSUED;\n request.deferred = undefined;\n\n return resource.fetch(options);\n }\n\n return Promise.reject(e);\n });\n });\n};\n\nconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\nfunction decodeDataUriText(isBase64, data) {\n const result = decodeURIComponent(data);\n if (isBase64) {\n return atob(result);\n }\n return result;\n}\n\nfunction decodeDataUriArrayBuffer(isBase64, data) {\n const byteString = decodeDataUriText(isBase64, data);\n const buffer = new ArrayBuffer(byteString.length);\n const view = new Uint8Array(buffer);\n for (let i = 0; i < byteString.length; i++) {\n view[i] = byteString.charCodeAt(i);\n }\n return buffer;\n}\n\nfunction decodeDataUri(dataUriRegexResult, responseType) {\n responseType = defaultValue(responseType, \"\");\n const mimeType = dataUriRegexResult[1];\n const isBase64 = !!dataUriRegexResult[2];\n const data = dataUriRegexResult[3];\n let buffer;\n let parser;\n\n switch (responseType) {\n case \"\":\n case \"text\":\n return decodeDataUriText(isBase64, data);\n case \"arraybuffer\":\n return decodeDataUriArrayBuffer(isBase64, data);\n case \"blob\":\n buffer = decodeDataUriArrayBuffer(isBase64, data);\n return new Blob([buffer], {\n type: mimeType,\n });\n case \"document\":\n parser = new DOMParser();\n return parser.parseFromString(\n decodeDataUriText(isBase64, data),\n mimeType\n );\n case \"json\":\n return JSON.parse(decodeDataUriText(isBase64, data));\n default:\n}\n}\n\n/**\n * Asynchronously loads the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\n * the more specific functions eg. fetchJson, fetchBlob, etc.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.fetch()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.fetch = function (options) {\n options = defaultClone(options, {});\n options.method = \"GET\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls fetch() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.fetch = function (options) {\n const resource = new Resource(options);\n return resource.fetch({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously deletes the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.delete()\n * .then(function(body) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.delete = function (options) {\n options = defaultClone(options, {});\n options.method = \"DELETE\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls delete() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.data] Data that is posted with the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.delete = function (options) {\n const resource = new Resource(options);\n return resource.delete({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n data: options.data,\n });\n};\n\n/**\n * Asynchronously gets headers the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.head()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.head = function (options) {\n options = defaultClone(options, {});\n options.method = \"HEAD\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls head() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.head = function (options) {\n const resource = new Resource(options);\n return resource.head({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously gets options the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.options()\n * .then(function(headers) {\n * // use the data\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.options = function (options) {\n options = defaultClone(options, {});\n options.method = \"OPTIONS\";\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls options() on it.\n *\n * @param {String|Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.options = function (options) {\n const resource = new Resource(options);\n return resource.options({\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously posts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} data Data that is posted with the resource.\n * @param {Object} [options] Object with the following properties:\n * @param {Object} [options.data] Data that is posted with the resource.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.post(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.post = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"POST\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls post() on it.\n *\n * @param {Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} options.data Data that is posted with the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.post = function (options) {\n const resource = new Resource(options);\n return resource.post(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously puts data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} data Data that is posted with the resource.\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.put(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.put = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PUT\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls put() on it.\n *\n * @param {Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} options.data Data that is posted with the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.put = function (options) {\n const resource = new Resource(options);\n return resource.put(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Asynchronously patches data to the given resource. Returns a promise that will resolve to\n * the result once loaded, or reject if the resource failed to load. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\n *\n * @param {Object} data Data that is posted with the resource.\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n *\n * @example\n * resource.patch(data)\n * .then(function(result) {\n * // use the result\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n */\nResource.prototype.patch = function (data, options) {\n Check.defined(\"data\", data);\n\n options = defaultClone(options, {});\n options.method = \"PATCH\";\n options.data = data;\n\n return this._makeRequest(options);\n};\n\n/**\n * Creates a Resource from a URL and calls patch() on it.\n *\n * @param {Object} options A url or an object with the following properties\n * @param {String} options.url The url of the resource.\n * @param {Object} options.data Data that is posted with the resource.\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n */\nResource.patch = function (options) {\n const resource = new Resource(options);\n return resource.patch(options.data, {\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\n responseType: options.responseType,\n overrideMimeType: options.overrideMimeType,\n });\n};\n\n/**\n * Contains implementations of functions that can be replaced for testing\n *\n * @private\n */\nResource._Implementations = {};\n\nResource._Implementations.loadImageElement = function (\n url,\n crossOrigin,\n deferred\n) {\n const image = new Image();\n\n image.onload = function () {\n // work-around a known issue with Firefox and dimensionless SVG, see:\n // - https://github.com/whatwg/html/issues/3510\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\n if (\n image.naturalWidth === 0 &&\n image.naturalHeight === 0 &&\n image.width === 0 &&\n image.height === 0\n ) {\n // these values affect rasterization and will likely mar the content\n // until Firefox takes a stance on the issue, marred content is better than no content\n // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\n // proposed later in the original issue thread:\n // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\n // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\n image.width = 300;\n image.height = 150;\n }\n deferred.resolve(image);\n };\n\n image.onerror = function (e) {\n deferred.reject(e);\n };\n\n if (crossOrigin) {\n if (TrustedServers.contains(url)) {\n image.crossOrigin = \"use-credentials\";\n } else {\n image.crossOrigin = \"\";\n }\n }\n\n image.src = url;\n};\n\nResource._Implementations.createImage = function (\n request,\n crossOrigin,\n deferred,\n flipY,\n skipColorSpaceConversion,\n preferImageBitmap\n) {\n const url = request.url;\n // Passing an Image to createImageBitmap will force it to run on the main thread\n // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\n // See:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\n // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\n Resource.supportsImageBitmapOptions()\n .then(function (supportsImageBitmap) {\n // We can only use ImageBitmap if we can flip on decode.\n // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\n if (!(supportsImageBitmap && preferImageBitmap)) {\n Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\n return;\n }\n const responseType = \"blob\";\n const method = \"GET\";\n const xhrDeferred = defer();\n const xhr = Resource._Implementations.loadWithXhr(\n url,\n responseType,\n method,\n undefined,\n undefined,\n xhrDeferred,\n undefined,\n undefined,\n undefined\n );\n\n if (defined(xhr) && defined(xhr.abort)) {\n request.cancelFunction = function () {\n xhr.abort();\n };\n }\n return xhrDeferred.promise\n .then(function (blob) {\n if (!defined(blob)) {\n deferred.reject(\n new RuntimeError(\n `Successfully retrieved ${url} but it contained no content.`\n )\n );\n return;\n }\n\n return Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n })\n .then(function (image) {\n deferred.resolve(image);\n });\n })\n .catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * Wrapper for createImageBitmap\n *\n * @private\n */\nResource.createImageBitmapFromBlob = function (blob, options) {\n Check.defined(\"options\", options);\n Check.typeOf.bool(\"options.flipY\", options.flipY);\n Check.typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\n Check.typeOf.bool(\n \"options.skipColorSpaceConversion\",\n options.skipColorSpaceConversion\n );\n\n return createImageBitmap(blob, {\n imageOrientation: options.flipY ? \"flipY\" : \"none\",\n premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\n colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\",\n });\n};\n\nfunction decodeResponse(loadWithHttpResponse, responseType) {\n switch (responseType) {\n case \"text\":\n return loadWithHttpResponse.toString(\"utf8\");\n case \"json\":\n return JSON.parse(loadWithHttpResponse.toString(\"utf8\"));\n default:\n return new Uint8Array(loadWithHttpResponse).buffer;\n }\n}\n\nfunction loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType\n) {\n // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\n let URL;\n let zlib;\n Promise.all([import(\"url\"), import(\"zlib\")])\n .then(([urlImport, zlibImport]) => {\n URL = urlImport.parse(url);\n zlib = zlibImport;\n\n return URL.protocol === \"https:\" ? import(\"https\") : import(\"http\");\n })\n .then((http) => {\n const options = {\n protocol: URL.protocol,\n hostname: URL.hostname,\n port: URL.port,\n path: URL.path,\n query: URL.query,\n method: method,\n headers: headers,\n };\n http\n .request(options)\n .on(\"response\", function (res) {\n if (res.statusCode < 200 || res.statusCode >= 300) {\n deferred.reject(\n new RequestErrorEvent(res.statusCode, res, res.headers)\n );\n return;\n }\n\n const chunkArray = [];\n res.on(\"data\", function (chunk) {\n chunkArray.push(chunk);\n });\n\n res.on(\"end\", function () {\n // eslint-disable-next-line no-undef\n const result = Buffer.concat(chunkArray);\n if (res.headers[\"content-encoding\"] === \"gzip\") {\n zlib.gunzip(result, function (error, resultUnzipped) {\n if (error) {\n deferred.reject(\n new RuntimeError(\"Error decompressing response.\")\n );\n } else {\n deferred.resolve(\n decodeResponse(resultUnzipped, responseType)\n );\n }\n });\n } else {\n deferred.resolve(decodeResponse(result, responseType));\n }\n });\n })\n .on(\"error\", function (e) {\n deferred.reject(new RequestErrorEvent());\n })\n .end();\n });\n}\n\nconst noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\nResource._Implementations.loadWithXhr = function (\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType\n) {\n const dataUriRegexResult = dataUriRegex.exec(url);\n if (dataUriRegexResult !== null) {\n deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));\n return;\n }\n\n if (noXMLHttpRequest) {\n loadWithHttpRequest(\n url,\n responseType,\n method,\n data,\n headers,\n deferred,\n overrideMimeType\n );\n return;\n }\n\n const xhr = new XMLHttpRequest();\n\n if (TrustedServers.contains(url)) {\n xhr.withCredentials = true;\n }\n\n xhr.open(method, url, true);\n\n if (defined(overrideMimeType) && defined(xhr.overrideMimeType)) {\n xhr.overrideMimeType(overrideMimeType);\n }\n\n if (defined(headers)) {\n for (const key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n }\n\n if (defined(responseType)) {\n xhr.responseType = responseType;\n }\n\n // While non-standard, file protocol always returns a status of 0 on success\n let localFile = false;\n if (typeof url === \"string\") {\n localFile =\n url.indexOf(\"file://\") === 0 ||\n (typeof window !== \"undefined\" && window.location.origin === \"file://\");\n }\n\n xhr.onload = function () {\n if (\n (xhr.status < 200 || xhr.status >= 300) &&\n !(localFile && xhr.status === 0)\n ) {\n deferred.reject(\n new RequestErrorEvent(\n xhr.status,\n xhr.response,\n xhr.getAllResponseHeaders()\n )\n );\n return;\n }\n\n const response = xhr.response;\n const browserResponseType = xhr.responseType;\n\n if (method === \"HEAD\" || method === \"OPTIONS\") {\n const responseHeaderString = xhr.getAllResponseHeaders();\n const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\n\n const responseHeaders = {};\n splitHeaders.forEach(function (line) {\n const parts = line.split(\": \");\n const header = parts.shift();\n responseHeaders[header] = parts.join(\": \");\n });\n\n deferred.resolve(responseHeaders);\n return;\n }\n\n //All modern browsers will go into either the first or second if block or last else block.\n //Other code paths support older browsers that either do not support the supplied responseType\n //or do not support the xhr.response property.\n if (xhr.status === 204) {\n // accept no content\n deferred.resolve();\n } else if (\n defined(response) &&\n (!defined(responseType) || browserResponseType === responseType)\n ) {\n deferred.resolve(response);\n } else if (responseType === \"json\" && typeof response === \"string\") {\n try {\n deferred.resolve(JSON.parse(response));\n } catch (e) {\n deferred.reject(e);\n }\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"document\") &&\n defined(xhr.responseXML) &&\n xhr.responseXML.hasChildNodes()\n ) {\n deferred.resolve(xhr.responseXML);\n } else if (\n (browserResponseType === \"\" || browserResponseType === \"text\") &&\n defined(xhr.responseText)\n ) {\n deferred.resolve(xhr.responseText);\n } else {\n deferred.reject(\n new RuntimeError(\"Invalid XMLHttpRequest response type.\")\n );\n }\n };\n\n xhr.onerror = function (e) {\n deferred.reject(new RequestErrorEvent());\n };\n\n xhr.send(data);\n\n return xhr;\n};\n\nResource._Implementations.loadAndExecuteScript = function (\n url,\n functionName,\n deferred\n) {\n return loadAndExecuteScript(url, functionName).catch(function (e) {\n deferred.reject(e);\n });\n};\n\n/**\n * The default implementations\n *\n * @private\n */\nResource._DefaultImplementations = {};\nResource._DefaultImplementations.createImage =\n Resource._Implementations.createImage;\nResource._DefaultImplementations.loadWithXhr =\n Resource._Implementations.loadWithXhr;\nResource._DefaultImplementations.loadAndExecuteScript =\n Resource._Implementations.loadAndExecuteScript;\n\n/**\n * A resource instance initialized to the current browser location\n *\n * @type {Resource}\n * @constant\n */\nResource.DEFAULT = Object.freeze(\n new Resource({\n url:\n typeof document === \"undefined\"\n ? \"\"\n : document.location.href.split(\"?\")[0],\n })\n);\n\n/**\n * A function that returns the value of the property.\n * @callback Resource.RetryCallback\n *\n * @param {Resource} [resource] The resource that failed to load.\n * @param {Error} [error] The error that occurred during the loading of the resource.\n * @returns {Boolean|Promise<Boolean>} If true or a promise that resolved to true, the resource will be retried. Otherwise the failure will be returned.\n */\nexport default Resource;\n", "/**\n * @private\n */\nfunction appendForwardSlash(url) {\n if (url.length === 0 || url[url.length - 1] !== \"/\") {\n url = `${url}/`;\n }\n return url;\n}\nexport default appendForwardSlash;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Clones an object, returning a new object containing the same properties.\n *\n * @function\n *\n * @param {Object} object The object to clone.\n * @param {Boolean} [deep=false] If true, all properties will be deep cloned recursively.\n * @returns {Object} The cloned object.\n */\nfunction clone(object, deep) {\n if (object === null || typeof object !== \"object\") {\n return object;\n }\n\n deep = defaultValue(deep, false);\n\n const result = new object.constructor();\n for (const propertyName in object) {\n if (object.hasOwnProperty(propertyName)) {\n let value = object[propertyName];\n if (deep) {\n value = clone(value, deep);\n }\n result[propertyName] = value;\n }\n }\n\n return result;\n}\nexport default clone;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Merges two objects, copying their properties onto a new combined object. When two objects have the same\n * property, the value of the property on the first object is used. If either object is undefined,\n * it will be treated as an empty object.\n *\n * @example\n * const object1 = {\n * propOne : 1,\n * propTwo : {\n * value1 : 10\n * }\n * }\n * const object2 = {\n * propTwo : 2\n * }\n * const final = Cesium.combine(object1, object2);\n *\n * // final === {\n * // propOne : 1,\n * // propTwo : {\n * // value1 : 10\n * // }\n * // }\n *\n * @param {Object} [object1] The first object to merge.\n * @param {Object} [object2] The second object to merge.\n * @param {Boolean} [deep=false] Perform a recursive merge.\n * @returns {Object} The combined object containing all properties from both objects.\n *\n * @function\n */\nfunction combine(object1, object2, deep) {\n deep = defaultValue(deep, false);\n\n const result = {};\n\n const object1Defined = defined(object1);\n const object2Defined = defined(object2);\n let property;\n let object1Value;\n let object2Value;\n if (object1Defined) {\n for (property in object1) {\n if (object1.hasOwnProperty(property)) {\n object1Value = object1[property];\n if (\n object2Defined &&\n deep &&\n typeof object1Value === \"object\" &&\n object2.hasOwnProperty(property)\n ) {\n object2Value = object2[property];\n if (typeof object2Value === \"object\") {\n result[property] = combine(object1Value, object2Value, deep);\n } else {\n result[property] = object1Value;\n }\n } else {\n result[property] = object1Value;\n }\n }\n }\n }\n if (object2Defined) {\n for (property in object2) {\n if (\n object2.hasOwnProperty(property) &&\n !result.hasOwnProperty(property)\n ) {\n object2Value = object2[property];\n result[property] = object2Value;\n }\n }\n }\n return result;\n}\nexport default combine;\n", "/**\n * A function used to resolve a promise upon completion .\n * @callback defer.resolve\n *\n * @param {*} value The resulting value.\n */\n\n/**\n * A function used to reject a promise upon failure.\n * @callback defer.reject\n *\n * @param {*} error The error.\n */\n\n/**\n * An object which contains a promise object, and functions to resolve or reject the promise.\n *\n * @typedef {Object} defer.deferred\n * @property {defer.resolve} resolve Resolves the promise when called.\n * @property {defer.reject} reject Rejects the promise when called.\n * @property {Promise} promise Promise object.\n */\n\n/**\n * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.\n * @returns {defer.deferred}\n * @private\n */\nfunction defer() {\n let resolve;\n let reject;\n const promise = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n\n return {\n resolve: resolve,\n reject: reject,\n promise: promise,\n };\n}\n\nexport default defer;\n", "import Uri from \"urijs\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.\n * @function\n *\n * @param {String} relative The relative Uri.\n * @param {String} [base] The base Uri.\n * @returns {String} The absolute Uri of the given relative Uri.\n *\n * @example\n * //absolute Uri will be \"https://test.com/awesome.png\";\n * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');\n */\nfunction getAbsoluteUri(relative, base) {\n let documentObject;\n if (typeof document !== \"undefined\") {\n documentObject = document;\n }\n\n return getAbsoluteUri._implementation(relative, base, documentObject);\n}\n\ngetAbsoluteUri._implementation = function (relative, base, documentObject) {\n if (!defined(base)) {\n if (typeof documentObject === \"undefined\") {\n return relative;\n }\n base = defaultValue(documentObject.baseURI, documentObject.location.href);\n }\n\n const relativeUri = new Uri(relative);\n if (relativeUri.scheme() !== \"\") {\n return relativeUri.toString();\n }\n return relativeUri.absoluteTo(base).toString();\n};\nexport default getAbsoluteUri;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the base path of the URI.\n * @function\n *\n * @param {String} uri The Uri.\n * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\n * @returns {String} The base path of the Uri.\n *\n * @example\n * // basePath will be \"/Gallery/\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');\n *\n * // basePath will be \"/Gallery/?value=true&example=false\";\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);\n */\nfunction getBaseUri(uri, includeQuery) {\n let basePath = \"\";\n const i = uri.lastIndexOf(\"/\");\n if (i !== -1) {\n basePath = uri.substring(0, i + 1);\n }\n\n if (!includeQuery) {\n return basePath;\n }\n\n uri = new Uri(uri);\n if (uri.query().length !== 0) {\n basePath += `?${uri.query()}`;\n }\n if (uri.fragment().length !== 0) {\n basePath += `#${uri.fragment()}`;\n }\n\n return basePath;\n}\nexport default getBaseUri;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the extension of the URI.\n * @function getExtensionFromUri\n *\n * @param {String} uri The Uri.\n * @returns {String} The extension of the Uri.\n *\n * @example\n * //extension will be \"czml\";\n * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');\n */\nfunction getExtensionFromUri(uri) {\n const uriObject = new Uri(uri);\n uriObject.normalize();\n let path = uriObject.path();\n let index = path.lastIndexOf(\"/\");\n if (index !== -1) {\n path = path.substr(index + 1);\n }\n index = path.lastIndexOf(\".\");\n if (index === -1) {\n path = \"\";\n } else {\n path = path.substr(index + 1);\n }\n return path;\n}\nexport default getExtensionFromUri;\n", "import defined from \"./defined.js\";\n\nconst context2DsByWidthAndHeight = {};\n\n/**\n * Extract a pixel array from a loaded image. Draws the image\n * into a canvas so it can read the pixels back.\n *\n * @function getImagePixels\n *\n * @param {HTMLImageElement|ImageBitmap} image The image to extract pixels from.\n * @param {Number} width The width of the image. If not defined, then image.width is assigned.\n * @param {Number} height The height of the image. If not defined, then image.height is assigned.\n * @returns {ImageData} The pixels of the image.\n */\nfunction getImagePixels(image, width, height) {\n if (!defined(width)) {\n width = image.width;\n }\n if (!defined(height)) {\n height = image.height;\n }\n\n let context2DsByHeight = context2DsByWidthAndHeight[width];\n if (!defined(context2DsByHeight)) {\n context2DsByHeight = {};\n context2DsByWidthAndHeight[width] = context2DsByHeight;\n }\n\n let context2d = context2DsByHeight[height];\n if (!defined(context2d)) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n context2d = canvas.getContext(\"2d\");\n context2d.globalCompositeOperation = \"copy\";\n context2DsByHeight[height] = context2d;\n }\n\n context2d.drawImage(image, 0, 0, width, height);\n return context2d.getImageData(0, 0, width, height).data;\n}\nexport default getImagePixels;\n", "import Check from \"./Check.js\";\n\nconst blobUriRegex = /^blob:/i;\n\n/**\n * Determines if the specified uri is a blob uri.\n *\n * @function isBlobUri\n *\n * @param {String} uri The uri to test.\n * @returns {Boolean} true when the uri is a blob uri; otherwise, false.\n *\n * @private\n */\nfunction isBlobUri(uri) {\n return blobUriRegex.test(uri);\n}\nexport default isBlobUri;\n", "import defined from \"./defined.js\";\n\nlet a;\n\n/**\n * Given a URL, determine whether that URL is considered cross-origin to the current page.\n *\n * @private\n */\nfunction isCrossOriginUrl(url) {\n if (!defined(a)) {\n a = document.createElement(\"a\");\n }\n\n // copy window location into the anchor to get consistent results\n // when the port is default for the protocol (e.g. 80 for HTTP)\n a.href = window.location.href;\n\n // host includes both hostname and port if the port is not standard\n const host = a.host;\n const protocol = a.protocol;\n\n a.href = url;\n // IE only absolutizes href on get, not set\n // eslint-disable-next-line no-self-assign\n a.href = a.href;\n\n return protocol !== a.protocol || host !== a.host;\n}\nexport default isCrossOriginUrl;\n", "import Check from \"./Check.js\";\n\nconst dataUriRegex = /^data:/i;\n\n/**\n * Determines if the specified uri is a data uri.\n *\n * @function isDataUri\n *\n * @param {String} uri The uri to test.\n * @returns {Boolean} true when the uri is a data uri; otherwise, false.\n *\n * @private\n */\nfunction isDataUri(uri) {\n return dataUriRegex.test(uri);\n}\nexport default isDataUri;\n", "/**\n * @private\n */\nfunction loadAndExecuteScript(url) {\n const script = document.createElement(\"script\");\n script.async = true;\n script.src = url;\n\n return new Promise((resolve, reject) => {\n if (window.crossOriginIsolated) {\n script.setAttribute(\"crossorigin\", \"anonymous\");\n }\n\n const head = document.getElementsByTagName(\"head\")[0];\n script.onload = function () {\n script.onload = undefined;\n head.removeChild(script);\n resolve();\n };\n script.onerror = function (e) {\n reject(e);\n };\n\n head.appendChild(script);\n });\n}\nexport default loadAndExecuteScript;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Converts an object representing a set of name/value pairs into a query string,\n * with names and values encoded properly for use in a URL. Values that are arrays\n * will produce multiple values with the same name.\n * @function objectToQuery\n *\n * @param {Object} obj The object containing data to encode.\n * @returns {String} An encoded query string.\n *\n *\n * @example\n * const str = Cesium.objectToQuery({\n * key1 : 'some value',\n * key2 : 'a/b',\n * key3 : ['x', 'y']\n * });\n *\n * @see queryToObject\n * // str will be:\n * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y'\n */\nfunction objectToQuery(obj) {\n let result = \"\";\n for (const propName in obj) {\n if (obj.hasOwnProperty(propName)) {\n const value = obj[propName];\n\n const part = `${encodeURIComponent(propName)}=`;\n if (Array.isArray(value)) {\n for (let i = 0, len = value.length; i < len; ++i) {\n result += `${part + encodeURIComponent(value[i])}&`;\n }\n } else {\n result += `${part + encodeURIComponent(value)}&`;\n }\n }\n }\n\n // trim last &\n result = result.slice(0, -1);\n\n // This function used to replace %20 with + which is more compact and readable.\n // However, some servers didn't properly handle + as a space.\n // https://github.com/CesiumGS/cesium/issues/2192\n\n return result;\n}\nexport default objectToQuery;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Parses a query string into an object, where the keys and values of the object are the\n * name/value pairs from the query string, decoded. If a name appears multiple times,\n * the value in the object will be an array of values.\n * @function queryToObject\n *\n * @param {String} queryString The query string.\n * @returns {Object} An object containing the parameters parsed from the query string.\n *\n *\n * @example\n * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');\n * // obj will be:\n * // {\n * // key1 : 'some value',\n * // key2 : 'a/b',\n * // key3 : ['x', 'y']\n * // }\n *\n * @see objectToQuery\n */\nfunction queryToObject(queryString) {\n const result = {};\n if (queryString === \"\") {\n return result;\n }\n const parts = queryString.replace(/\\+/g, \"%20\").split(/[&;]/);\n for (let i = 0, len = parts.length; i < len; ++i) {\n const subparts = parts[i].split(\"=\");\n\n const name = decodeURIComponent(subparts[0]);\n let value = subparts[1];\n if (defined(value)) {\n value = decodeURIComponent(value);\n } else {\n value = \"\";\n }\n\n const resultValue = result[name];\n if (typeof resultValue === \"string\") {\n // expand the single value to an array\n result[name] = [resultValue, value];\n } else if (Array.isArray(resultValue)) {\n resultValue.push(value);\n } else {\n result[name] = value;\n }\n }\n return result;\n}\nexport default queryToObject;\n", "/**\n * State of the request.\n *\n * @enum {Number}\n */\nconst RequestState = {\n /**\n * Initial unissued state.\n *\n * @type Number\n * @constant\n */\n UNISSUED: 0,\n\n /**\n * Issued but not yet active. Will become active when open slots are available.\n *\n * @type Number\n * @constant\n */\n ISSUED: 1,\n\n /**\n * Actual http request has been sent.\n *\n * @type Number\n * @constant\n */\n ACTIVE: 2,\n\n /**\n * Request completed successfully.\n *\n * @type Number\n * @constant\n */\n RECEIVED: 3,\n\n /**\n * Request was cancelled, either explicitly or automatically because of low priority.\n *\n * @type Number\n * @constant\n */\n CANCELLED: 4,\n\n /**\n * Request failed.\n *\n * @type Number\n * @constant\n */\n FAILED: 5,\n};\nexport default Object.freeze(RequestState);\n", "/**\n * An enum identifying the type of request. Used for finer grained logging and priority sorting.\n *\n * @enum {Number}\n */\nconst RequestType = {\n /**\n * Terrain request.\n *\n * @type Number\n * @constant\n */\n TERRAIN: 0,\n\n /**\n * Imagery request.\n *\n * @type Number\n * @constant\n */\n IMAGERY: 1,\n\n /**\n * 3D Tiles request.\n *\n * @type Number\n * @constant\n */\n TILES3D: 2,\n\n /**\n * Other request.\n *\n * @type Number\n * @constant\n */\n OTHER: 3,\n};\nexport default Object.freeze(RequestType);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\n\n/**\n * Stores information for making a request. In general this does not need to be constructed directly.\n *\n * @alias Request\n * @constructor\n\n * @param {Object} [options] An object with the following properties:\n * @param {String} [options.url] The url to request.\n * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request.\n * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled.\n * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame.\n * @param {Number} [options.priority=0.0] The initial priority of the request.\n * @param {Boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.\n * @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server.\n * @param {RequestType} [options.type=RequestType.OTHER] The type of request.\n */\nfunction Request(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const throttleByServer = defaultValue(options.throttleByServer, false);\n const throttle = defaultValue(options.throttle, false);\n\n /**\n * The URL to request.\n *\n * @type {String}\n */\n this.url = options.url;\n\n /**\n * The function that makes the actual data request.\n *\n * @type {Request.RequestCallback}\n */\n this.requestFunction = options.requestFunction;\n\n /**\n * The function that is called when the request is cancelled.\n *\n * @type {Request.CancelCallback}\n */\n this.cancelFunction = options.cancelFunction;\n\n /**\n * The function that is called to update the request's priority, which occurs once per frame.\n *\n * @type {Request.PriorityCallback}\n */\n this.priorityFunction = options.priorityFunction;\n\n /**\n * Priority is a unit-less value where lower values represent higher priority.\n * For world-based objects, this is usually the distance from the camera.\n * A request that does not have a priority function defaults to a priority of 0.\n *\n * If priorityFunction is defined, this value is updated every frame with the result of that call.\n *\n * @type {Number}\n * @default 0.0\n */\n this.priority = defaultValue(options.priority, 0.0);\n\n /**\n * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the\n * request will be throttled and sent based on priority.\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n this.throttle = throttle;\n\n /**\n * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections\n * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value\n * to <code>true</code> is preferable for requests going through HTTP/1 servers.\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n this.throttleByServer = throttleByServer;\n\n /**\n * Type of request.\n *\n * @type {RequestType}\n * @readonly\n *\n * @default RequestType.OTHER\n */\n this.type = defaultValue(options.type, RequestType.OTHER);\n\n /**\n * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\n *\n * @type {String}\n *\n * @private\n */\n this.serverKey = undefined;\n\n /**\n * The current state of the request.\n *\n * @type {RequestState}\n * @readonly\n */\n this.state = RequestState.UNISSUED;\n\n /**\n * The requests's deferred promise.\n *\n * @type {Object}\n *\n * @private\n */\n this.deferred = undefined;\n\n /**\n * Whether the request was explicitly cancelled.\n *\n * @type {Boolean}\n *\n * @private\n */\n this.cancelled = false;\n}\n\n/**\n * Mark the request as cancelled.\n *\n * @private\n */\nRequest.prototype.cancel = function () {\n this.cancelled = true;\n};\n\n/**\n * Duplicates a Request instance.\n *\n * @param {Request} [result] The object onto which to store the result.\n *\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\n */\nRequest.prototype.clone = function (result) {\n if (!defined(result)) {\n return new Request(this);\n }\n\n result.url = this.url;\n result.requestFunction = this.requestFunction;\n result.cancelFunction = this.cancelFunction;\n result.priorityFunction = this.priorityFunction;\n result.priority = this.priority;\n result.throttle = this.throttle;\n result.throttleByServer = this.throttleByServer;\n result.type = this.type;\n result.serverKey = this.serverKey;\n\n // These get defaulted because the cloned request hasn't been issued\n result.state = this.RequestState.UNISSUED;\n result.deferred = undefined;\n result.cancelled = false;\n\n return result;\n};\n\n/**\n * The function that makes the actual data request.\n * @callback Request.RequestCallback\n * @returns {Promise<void>} A promise for the requested data.\n */\n\n/**\n * The function that is called when the request is cancelled.\n * @callback Request.CancelCallback\n */\n\n/**\n * The function that is called to update the request's priority, which occurs once per frame.\n * @callback Request.PriorityCallback\n * @returns {Number} The updated priority value.\n */\nexport default Request;\n", "/**\n * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into\n * a dictionary.\n *\n * @function parseResponseHeaders\n *\n * @param {String} headerString The header string returned by getAllResponseHeaders(). The format is\n * described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method\n * @returns {Object} A dictionary of key/value pairs, where each key is the name of a header and the corresponding value\n * is that header's value.\n *\n * @private\n */\nfunction parseResponseHeaders(headerString) {\n const headers = {};\n\n if (!headerString) {\n return headers;\n }\n\n const headerPairs = headerString.split(\"\\u000d\\u000a\");\n\n for (let i = 0; i < headerPairs.length; ++i) {\n const headerPair = headerPairs[i];\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n const index = headerPair.indexOf(\"\\u003a\\u0020\");\n if (index > 0) {\n const key = headerPair.substring(0, index);\n const val = headerPair.substring(index + 2);\n headers[key] = val;\n }\n }\n\n return headers;\n}\nexport default parseResponseHeaders;\n", "import defined from \"./defined.js\";\nimport parseResponseHeaders from \"./parseResponseHeaders.js\";\n\n/**\n * An event that is raised when a request encounters an error.\n *\n * @constructor\n * @alias RequestErrorEvent\n *\n * @param {Number} [statusCode] The HTTP error status code, such as 404.\n * @param {Object} [response] The response included along with the error.\n * @param {String|Object} [responseHeaders] The response headers, represented either as an object literal or as a\n * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.\n */\nfunction RequestErrorEvent(statusCode, response, responseHeaders) {\n /**\n * The HTTP error status code, such as 404. If the error does not have a particular\n * HTTP code, this property will be undefined.\n *\n * @type {Number}\n */\n this.statusCode = statusCode;\n\n /**\n * The response included along with the error. If the error does not include a response,\n * this property will be undefined.\n *\n * @type {Object}\n */\n this.response = response;\n\n /**\n * The headers included in the response, represented as an object literal of key/value pairs.\n * If the error does not include any headers, this property will be undefined.\n *\n * @type {Object}\n */\n this.responseHeaders = responseHeaders;\n\n if (typeof this.responseHeaders === \"string\") {\n this.responseHeaders = parseResponseHeaders(this.responseHeaders);\n }\n}\n\n/**\n * Creates a string representing this RequestErrorEvent.\n * @memberof RequestErrorEvent\n *\n * @returns {String} A string representing the provided RequestErrorEvent.\n */\nRequestErrorEvent.prototype.toString = function () {\n let str = \"Request has failed.\";\n if (defined(this.statusCode)) {\n str += ` Status Code: ${this.statusCode}`;\n }\n return str;\n};\nexport default RequestErrorEvent;\n", "import Uri from \"urijs\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport Event from \"./Event.js\";\nimport Heap from \"./Heap.js\";\nimport isBlobUri from \"./isBlobUri.js\";\nimport isDataUri from \"./isDataUri.js\";\nimport RequestState from \"./RequestState.js\";\n\nfunction sortRequests(a, b) {\n return a.priority - b.priority;\n}\n\nconst statistics = {\n numberOfAttemptedRequests: 0,\n numberOfActiveRequests: 0,\n numberOfCancelledRequests: 0,\n numberOfCancelledActiveRequests: 0,\n numberOfFailedRequests: 0,\n numberOfActiveRequestsEver: 0,\n lastNumberOfActiveRequests: 0,\n};\n\nlet priorityHeapLength = 20;\nconst requestHeap = new Heap({\n comparator: sortRequests,\n});\nrequestHeap.maximumLength = priorityHeapLength;\nrequestHeap.reserve(priorityHeapLength);\n\nconst activeRequests = [];\nlet numberOfActiveRequestsByServer = {};\n\nconst pageUri =\n typeof document !== \"undefined\" ? new Uri(document.location.href) : new Uri();\n\nconst requestCompletedEvent = new Event();\n\n/**\n * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability\n * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,\n * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the\n * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.\n *\n * @namespace RequestScheduler\n *\n */\nfunction RequestScheduler() {}\n\n/**\n * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.\n * @type {Number}\n * @default 50\n */\nRequestScheduler.maximumRequests = 50;\n\n/**\n * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically\n * listed in {@link requestsByServer} do not observe this limit.\n * @type {Number}\n * @default 6\n */\nRequestScheduler.maximumRequestsPerServer = 6;\n\n/**\n * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>\n * @type {Object}\n *\n * @example\n * RequestScheduler.requestsByServer = {\n * 'api.cesium.com:443': 18,\n * 'assets.cesium.com:443': 18\n * };\n */\nRequestScheduler.requestsByServer = {\n \"api.cesium.com:443\": 18,\n \"assets.cesium.com:443\": 18,\n};\n\n/**\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\n * @type {Boolean}\n * @default true\n */\nRequestScheduler.throttleRequests = true;\n\n/**\n * When true, log statistics to the console every frame\n * @type {Boolean}\n * @default false\n * @private\n */\nRequestScheduler.debugShowStatistics = false;\n\n/**\n * An event that's raised when a request is completed. Event handlers are passed\n * the error object if the request fails.\n *\n * @type {Event}\n * @default Event()\n * @private\n */\nRequestScheduler.requestCompletedEvent = requestCompletedEvent;\n\nObject.defineProperties(RequestScheduler, {\n /**\n * Returns the statistics used by the request scheduler.\n *\n * @memberof RequestScheduler\n *\n * @type Object\n * @readonly\n * @private\n */\n statistics: {\n get: function () {\n return statistics;\n },\n },\n\n /**\n * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\n *\n * @memberof RequestScheduler\n *\n * @type {Number}\n * @default 20\n * @private\n */\n priorityHeapLength: {\n get: function () {\n return priorityHeapLength;\n },\n set: function (value) {\n // If the new length shrinks the heap, need to cancel some of the requests.\n // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\n if (value < priorityHeapLength) {\n while (requestHeap.length > value) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n }\n priorityHeapLength = value;\n requestHeap.maximumLength = value;\n requestHeap.reserve(value);\n },\n },\n});\n\nfunction updatePriority(request) {\n if (defined(request.priorityFunction)) {\n request.priority = request.priorityFunction();\n }\n}\n\n/**\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\n * @param {String} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\n * @param {Number} [desiredRequests=1] How many requests the caller plans to request\n * @return {Boolean} True if there are enough open slots for <code>desiredRequests</code> more requests.\n * @private\n */\nRequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {\n desiredRequests = defaultValue(desiredRequests, 1);\n\n const maxRequests = defaultValue(\n RequestScheduler.requestsByServer[serverKey],\n RequestScheduler.maximumRequestsPerServer\n );\n const hasOpenSlotsServer =\n numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\n\n return hasOpenSlotsServer;\n};\n\n/**\n * Check if the priority heap has open slots, regardless of which server they\n * are from. This is used in {@link Multiple3DTileContent} for determining when\n * all requests can be scheduled\n * @param {Number} desiredRequests The number of requests the caller intends to make\n * @return {Boolean} <code>true</code> if the heap has enough available slots to meet the desiredRequests. <code>false</code> otherwise.\n *\n * @private\n */\nRequestScheduler.heapHasOpenSlots = function (desiredRequests) {\n const hasOpenSlotsHeap =\n requestHeap.length + desiredRequests <= priorityHeapLength;\n return hasOpenSlotsHeap;\n};\n\nfunction issueRequest(request) {\n if (request.state === RequestState.UNISSUED) {\n request.state = RequestState.ISSUED;\n request.deferred = defer();\n }\n return request.deferred.promise;\n}\n\nfunction getRequestReceivedFunction(request) {\n return function (results) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n // explicitly set to undefined to ensure GC of request response data. See #8843\n const deferred = request.deferred;\n\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n request.deferred = undefined;\n\n deferred.resolve(results);\n };\n}\n\nfunction getRequestFailedFunction(request) {\n return function (error) {\n if (request.state === RequestState.CANCELLED) {\n // If the data request comes back but the request is cancelled, ignore it.\n return;\n }\n ++statistics.numberOfFailedRequests;\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n requestCompletedEvent.raiseEvent(error);\n request.state = RequestState.FAILED;\n request.deferred.reject(error);\n };\n}\n\nfunction startRequest(request) {\n const promise = issueRequest(request);\n request.state = RequestState.ACTIVE;\n activeRequests.push(request);\n ++statistics.numberOfActiveRequests;\n ++statistics.numberOfActiveRequestsEver;\n ++numberOfActiveRequestsByServer[request.serverKey];\n request\n .requestFunction()\n .then(getRequestReceivedFunction(request))\n .catch(getRequestFailedFunction(request));\n return promise;\n}\n\nfunction cancelRequest(request) {\n const active = request.state === RequestState.ACTIVE;\n request.state = RequestState.CANCELLED;\n ++statistics.numberOfCancelledRequests;\n // check that deferred has not been cleared since cancelRequest can be called\n // on a finished request, e.g. by clearForSpecs during tests\n if (defined(request.deferred)) {\n const deferred = request.deferred;\n request.deferred = undefined;\n deferred.reject();\n }\n\n if (active) {\n --statistics.numberOfActiveRequests;\n --numberOfActiveRequestsByServer[request.serverKey];\n ++statistics.numberOfCancelledActiveRequests;\n }\n\n if (defined(request.cancelFunction)) {\n request.cancelFunction();\n }\n}\n\n/**\n * Sort requests by priority and start requests.\n * @private\n */\nRequestScheduler.update = function () {\n let i;\n let request;\n\n // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\n let removeCount = 0;\n const activeLength = activeRequests.length;\n for (i = 0; i < activeLength; ++i) {\n request = activeRequests[i];\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n }\n if (request.state !== RequestState.ACTIVE) {\n // Request is no longer active, remove from array\n ++removeCount;\n continue;\n }\n if (removeCount > 0) {\n // Shift back to fill in vacated slots from completed requests\n activeRequests[i - removeCount] = request;\n }\n }\n activeRequests.length -= removeCount;\n\n // Update priority of issued requests and resort the heap\n const issuedRequests = requestHeap.internalArray;\n const issuedLength = requestHeap.length;\n for (i = 0; i < issuedLength; ++i) {\n updatePriority(issuedRequests[i]);\n }\n requestHeap.resort();\n\n // Get the number of open slots and fill with the highest priority requests.\n // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\n const openSlots = Math.max(\n RequestScheduler.maximumRequests - activeRequests.length,\n 0\n );\n let filledSlots = 0;\n while (filledSlots < openSlots && requestHeap.length > 0) {\n // Loop until all open slots are filled or the heap becomes empty\n request = requestHeap.pop();\n if (request.cancelled) {\n // Request was explicitly cancelled\n cancelRequest(request);\n continue;\n }\n\n if (\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Open slots are available, but the request is throttled by its server. Cancel and try again later.\n cancelRequest(request);\n continue;\n }\n\n startRequest(request);\n ++filledSlots;\n }\n\n updateStatistics();\n};\n\n/**\n * Get the server key from a given url.\n *\n * @param {String} url The url.\n * @returns {String} The server key.\n * @private\n */\nRequestScheduler.getServerKey = function (url) {\n let uri = new Uri(url);\n if (uri.scheme() === \"\") {\n uri = new Uri(url).absoluteTo(pageUri);\n uri.normalize();\n }\n\n let serverKey = uri.authority();\n if (!/:/.test(serverKey)) {\n // If the authority does not contain a port number, add port 443 for https or port 80 for http\n serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\n }\n\n const length = numberOfActiveRequestsByServer[serverKey];\n if (!defined(length)) {\n numberOfActiveRequestsByServer[serverKey] = 0;\n }\n\n return serverKey;\n};\n\n/**\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\n * queued and sorted by priority before being sent.\n *\n * @param {Request} request The request object.\n *\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\n *\n * @private\n */\nRequestScheduler.request = function (request) {\n if (isDataUri(request.url) || isBlobUri(request.url)) {\n requestCompletedEvent.raiseEvent();\n request.state = RequestState.RECEIVED;\n return request.requestFunction();\n }\n\n ++statistics.numberOfAttemptedRequests;\n\n if (!defined(request.serverKey)) {\n request.serverKey = RequestScheduler.getServerKey(request.url);\n }\n\n if (\n RequestScheduler.throttleRequests &&\n request.throttleByServer &&\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\n ) {\n // Server is saturated. Try again later.\n return undefined;\n }\n\n if (!RequestScheduler.throttleRequests || !request.throttle) {\n return startRequest(request);\n }\n\n if (activeRequests.length >= RequestScheduler.maximumRequests) {\n // Active requests are saturated. Try again later.\n return undefined;\n }\n\n // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\n // priority it will be returned.\n updatePriority(request);\n const removedRequest = requestHeap.insert(request);\n\n if (defined(removedRequest)) {\n if (removedRequest === request) {\n // Request does not have high enough priority to be issued\n return undefined;\n }\n // A previously issued request has been bumped off the priority heap, so cancel it\n cancelRequest(removedRequest);\n }\n\n return issueRequest(request);\n};\n\nfunction updateStatistics() {\n if (!RequestScheduler.debugShowStatistics) {\n return;\n }\n\n if (\n statistics.numberOfActiveRequests === 0 &&\n statistics.lastNumberOfActiveRequests > 0\n ) {\n if (statistics.numberOfAttemptedRequests > 0) {\n console.log(\n `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`\n );\n statistics.numberOfAttemptedRequests = 0;\n }\n\n if (statistics.numberOfCancelledRequests > 0) {\n console.log(\n `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`\n );\n statistics.numberOfCancelledRequests = 0;\n }\n\n if (statistics.numberOfCancelledActiveRequests > 0) {\n console.log(\n `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`\n );\n statistics.numberOfCancelledActiveRequests = 0;\n }\n\n if (statistics.numberOfFailedRequests > 0) {\n console.log(\n `Number of failed requests: ${statistics.numberOfFailedRequests}`\n );\n statistics.numberOfFailedRequests = 0;\n }\n }\n\n statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;\n}\n\n/**\n * For testing only. Clears any requests that may not have completed from previous tests.\n *\n * @private\n */\nRequestScheduler.clearForSpecs = function () {\n while (requestHeap.length > 0) {\n const request = requestHeap.pop();\n cancelRequest(request);\n }\n const length = activeRequests.length;\n for (let i = 0; i < length; ++i) {\n cancelRequest(activeRequests[i]);\n }\n activeRequests.length = 0;\n numberOfActiveRequestsByServer = {};\n\n // Clear stats\n statistics.numberOfAttemptedRequests = 0;\n statistics.numberOfActiveRequests = 0;\n statistics.numberOfCancelledRequests = 0;\n statistics.numberOfCancelledActiveRequests = 0;\n statistics.numberOfFailedRequests = 0;\n statistics.numberOfActiveRequestsEver = 0;\n statistics.lastNumberOfActiveRequests = 0;\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {\n return numberOfActiveRequestsByServer[serverKey];\n};\n\n/**\n * For testing only.\n *\n * @private\n */\nRequestScheduler.requestHeap = requestHeap;\nexport default RequestScheduler;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Array implementation of a heap.\n *\n * @alias Heap\n * @constructor\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n */\nfunction Heap(options) {\n this._comparator = options.comparator;\n this._array = [];\n this._length = 0;\n this._maximumLength = undefined;\n}\n\nObject.defineProperties(Heap.prototype, {\n /**\n * Gets the length of the heap.\n *\n * @memberof Heap.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._length;\n },\n },\n\n /**\n * Gets the internal array.\n *\n * @memberof Heap.prototype\n *\n * @type {Array}\n * @readonly\n */\n internalArray: {\n get: function () {\n return this._array;\n },\n },\n\n /**\n * Gets and sets the maximum length of the heap.\n *\n * @memberof Heap.prototype\n *\n * @type {Number}\n */\n maximumLength: {\n get: function () {\n return this._maximumLength;\n },\n set: function (value) {\nconst originalLength = this._length;\n if (value < originalLength) {\n const array = this._array;\n // Remove trailing references\n for (let i = value; i < originalLength; ++i) {\n array[i] = undefined;\n }\n this._length = value;\n array.length = value;\n }\n this._maximumLength = value;\n },\n },\n\n /**\n * The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n *\n * @memberof Heap.prototype\n *\n * @type {Heap.ComparatorCallback}\n */\n comparator: {\n get: function () {\n return this._comparator;\n },\n },\n});\n\nfunction swap(array, a, b) {\n const temp = array[a];\n array[a] = array[b];\n array[b] = temp;\n}\n\n/**\n * Resizes the internal array of the heap.\n *\n * @param {Number} [length] The length to resize internal array to. Defaults to the current length of the heap.\n */\nHeap.prototype.reserve = function (length) {\n length = defaultValue(length, this._length);\n this._array.length = length;\n};\n\n/**\n * Update the heap so that index and all descendants satisfy the heap property.\n *\n * @param {Number} [index=0] The starting index to heapify from.\n */\nHeap.prototype.heapify = function (index) {\n index = defaultValue(index, 0);\n const length = this._length;\n const comparator = this._comparator;\n const array = this._array;\n let candidate = -1;\n let inserting = true;\n\n while (inserting) {\n const right = 2 * (index + 1);\n const left = right - 1;\n\n if (left < length && comparator(array[left], array[index]) < 0) {\n candidate = left;\n } else {\n candidate = index;\n }\n\n if (right < length && comparator(array[right], array[candidate]) < 0) {\n candidate = right;\n }\n if (candidate !== index) {\n swap(array, candidate, index);\n index = candidate;\n } else {\n inserting = false;\n }\n }\n};\n\n/**\n * Resort the heap.\n */\nHeap.prototype.resort = function () {\n const length = this._length;\n for (let i = Math.ceil(length / 2); i >= 0; --i) {\n this.heapify(i);\n }\n};\n\n/**\n * Insert an element into the heap. If the length would grow greater than maximumLength\n * of the heap, extra elements are removed.\n *\n * @param {*} element The element to insert\n *\n * @return {*} The element that was removed from the heap if the heap is at full capacity.\n */\nHeap.prototype.insert = function (element) {\n const array = this._array;\n const comparator = this._comparator;\n const maximumLength = this._maximumLength;\n\n let index = this._length++;\n if (index < array.length) {\n array[index] = element;\n } else {\n array.push(element);\n }\n\n while (index !== 0) {\n const parent = Math.floor((index - 1) / 2);\n if (comparator(array[index], array[parent]) < 0) {\n swap(array, index, parent);\n index = parent;\n } else {\n break;\n }\n }\n\n let removedElement;\n\n if (defined(maximumLength) && this._length > maximumLength) {\n removedElement = array[maximumLength];\n this._length = maximumLength;\n }\n\n return removedElement;\n};\n\n/**\n * Remove the element specified by index from the heap and return it.\n *\n * @param {Number} [index=0] The index to remove.\n * @returns {*} The specified element of the heap.\n */\nHeap.prototype.pop = function (index) {\n index = defaultValue(index, 0);\n if (this._length === 0) {\n return undefined;\n }\n const array = this._array;\n const root = array[index];\n swap(array, index, --this._length);\n this.heapify(index);\n array[this._length] = undefined; // Remove trailing reference\n return root;\n};\n\n/**\n * The comparator to use for the heap.\n * @callback Heap.ComparatorCallback\n * @param {*} a An element in the heap.\n * @param {*} b An element in the heap.\n * @returns {Number} If the result of the comparison is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\n */\nexport default Heap;\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A singleton that contains all of the servers that are trusted. Credentials will be sent with\n * any requests to these servers.\n *\n * @namespace TrustedServers\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nconst TrustedServers = {};\nlet _servers = {};\n\n/**\n * Adds a trusted server to the registry\n *\n * @param {String} host The host to be added.\n * @param {Number} port The port used to access the host.\n *\n * @example\n * // Add a trusted server\n * TrustedServers.add('my.server.com', 80);\n */\nTrustedServers.add = function (host, port) {\n const authority = `${host.toLowerCase()}:${port}`;\n if (!defined(_servers[authority])) {\n _servers[authority] = true;\n }\n};\n\n/**\n * Removes a trusted server from the registry\n *\n * @param {String} host The host to be removed.\n * @param {Number} port The port used to access the host.\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.remove('my.server.com', 80);\n */\nTrustedServers.remove = function (host, port) {\n const authority = `${host.toLowerCase()}:${port}`;\n if (defined(_servers[authority])) {\n delete _servers[authority];\n }\n};\n\nfunction getAuthority(url) {\n const uri = new Uri(url);\n uri.normalize();\n\n // Removes username:password@ so we just have host[:port]\n let authority = uri.authority();\n if (authority.length === 0) {\n return undefined; // Relative URL\n }\n uri.authority(authority);\n\n if (authority.indexOf(\"@\") !== -1) {\n const parts = authority.split(\"@\");\n authority = parts[1];\n }\n\n // If the port is missing add one based on the scheme\n if (authority.indexOf(\":\") === -1) {\n let scheme = uri.scheme();\n if (scheme.length === 0) {\n scheme = window.location.protocol;\n scheme = scheme.substring(0, scheme.length - 1);\n }\n if (scheme === \"http\") {\n authority += \":80\";\n } else if (scheme === \"https\") {\n authority += \":443\";\n } else {\n return undefined;\n }\n }\n\n return authority;\n}\n\n/**\n * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.\n *\n * @param {String} url The url to be tested against the trusted list\n *\n * @returns {boolean} Returns true if url is trusted, false otherwise.\n *\n * @example\n * // Add server\n * TrustedServers.add('my.server.com', 81);\n *\n * // Check if server is trusted\n * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {\n * // my.server.com:81 is trusted\n * }\n * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {\n * // my.server.com isn't trusted\n * }\n */\nTrustedServers.contains = function (url) {\nconst authority = getAuthority(url);\n if (defined(authority) && defined(_servers[authority])) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Clears the registry\n *\n * @example\n * // Remove a trusted server\n * TrustedServers.clear();\n */\nTrustedServers.clear = function () {\n _servers = {};\n};\nexport default TrustedServers;\n", "import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport LeapSecond from \"./LeapSecond.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * Specifies Earth polar motion coordinates and the difference between UT1 and UTC.\n * These Earth Orientation Parameters (EOP) are primarily used in the transformation from\n * the International Celestial Reference Frame (ICRF) to the International Terrestrial\n * Reference Frame (ITRF).\n *\n * @alias EarthOrientationParameters\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Resource|String} [options.url] The URL from which to obtain EOP data. If neither this\n * parameter nor options.data is specified, all EOP values are assumed\n * to be 0.0. If options.data is specified, this parameter is\n * ignored.\n * @param {Object} [options.data] The actual EOP data. If neither this\n * parameter nor options.data is specified, all EOP values are assumed\n * to be 0.0.\n * @param {Boolean} [options.addNewLeapSeconds=true] True if leap seconds that\n * are specified in the EOP data but not in {@link JulianDate.leapSeconds}\n * should be added to {@link JulianDate.leapSeconds}. False if\n * new leap seconds should be handled correctly in the context\n * of the EOP data but otherwise ignored.\n *\n * @example\n * // An example EOP data file, EOP.json:\n * {\n * \"columnNames\" : [\"dateIso8601\",\"modifiedJulianDateUtc\",\"xPoleWanderRadians\",\"yPoleWanderRadians\",\"ut1MinusUtcSeconds\",\"lengthOfDayCorrectionSeconds\",\"xCelestialPoleOffsetRadians\",\"yCelestialPoleOffsetRadians\",\"taiMinusUtcSeconds\"],\n * \"samples\" : [\n * \"2011-07-01T00:00:00Z\",55743.0,2.117957047295119e-7,2.111518721609984e-6,-0.2908948,-2.956e-4,3.393695767766752e-11,3.3452143996557983e-10,34.0,\n * \"2011-07-02T00:00:00Z\",55744.0,2.193297093339541e-7,2.115460256837405e-6,-0.29065,-1.824e-4,-8.241832578862112e-11,5.623838700870617e-10,34.0,\n * \"2011-07-03T00:00:00Z\",55745.0,2.262286080161428e-7,2.1191157519929706e-6,-0.2905572,1.9e-6,-3.490658503988659e-10,6.981317007977318e-10,34.0\n * ]\n * }\n *\n * @example\n * // Loading the EOP data\n * const eop = new Cesium.EarthOrientationParameters({ url : 'Data/EOP.json' });\n * Cesium.Transforms.earthOrientationParameters = eop;\n *\n * @private\n */\nfunction EarthOrientationParameters(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._dates = undefined;\n this._samples = undefined;\n\n this._dateColumn = -1;\n this._xPoleWanderRadiansColumn = -1;\n this._yPoleWanderRadiansColumn = -1;\n this._ut1MinusUtcSecondsColumn = -1;\n this._xCelestialPoleOffsetRadiansColumn = -1;\n this._yCelestialPoleOffsetRadiansColumn = -1;\n this._taiMinusUtcSecondsColumn = -1;\n\n this._columnCount = 0;\n this._lastIndex = -1;\n\n this._downloadPromise = undefined;\n this._dataError = undefined;\n\n this._addNewLeapSeconds = defaultValue(options.addNewLeapSeconds, true);\n\n if (defined(options.data)) {\n // Use supplied EOP data.\n onDataReady(this, options.data);\n } else if (defined(options.url)) {\n const resource = Resource.createIfNeeded(options.url);\n\n // Download EOP data.\n const that = this;\n this._downloadPromise = resource\n .fetchJson()\n .then(function (eopData) {\n onDataReady(that, eopData);\n })\n .catch(function () {\n that._dataError = `An error occurred while retrieving the EOP data from the URL ${resource.url}.`;\n });\n } else {\n // Use all zeros for EOP data.\n onDataReady(this, {\n columnNames: [\n \"dateIso8601\",\n \"modifiedJulianDateUtc\",\n \"xPoleWanderRadians\",\n \"yPoleWanderRadians\",\n \"ut1MinusUtcSeconds\",\n \"lengthOfDayCorrectionSeconds\",\n \"xCelestialPoleOffsetRadians\",\n \"yCelestialPoleOffsetRadians\",\n \"taiMinusUtcSeconds\",\n ],\n samples: [],\n });\n }\n}\n\n/**\n * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.\n */\nEarthOrientationParameters.NONE = Object.freeze({\n getPromiseToLoad: function () {\n return Promise.resolve();\n },\n compute: function (date, result) {\n if (!defined(result)) {\n result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\n } else {\n result.xPoleWander = 0.0;\n result.yPoleWander = 0.0;\n result.xPoleOffset = 0.0;\n result.yPoleOffset = 0.0;\n result.ut1MinusUtc = 0.0;\n }\n return result;\n },\n});\n\n/**\n * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is\n * ready to use.\n *\n * @returns {Promise<void>} The promise.\n */\nEarthOrientationParameters.prototype.getPromiseToLoad = function () {\n return Promise.resolve(this._downloadPromise);\n};\n\n/**\n * Computes the Earth Orientation Parameters (EOP) for a given date by interpolating.\n * If the EOP data has not yet been download, this method returns undefined.\n *\n * @param {JulianDate} date The date for each to evaluate the EOP.\n * @param {EarthOrientationParametersSample} [result] The instance to which to copy the result.\n * If this parameter is undefined, a new instance is created and returned.\n * @returns {EarthOrientationParametersSample} The EOP evaluated at the given date, or\n * undefined if the data necessary to evaluate EOP at the date has not yet been\n * downloaded.\n *\n * @exception {RuntimeError} The loaded EOP data has an error and cannot be used.\n *\n * @see EarthOrientationParameters#getPromiseToLoad\n */\nEarthOrientationParameters.prototype.compute = function (date, result) {\n // We cannot compute until the samples are available.\n if (!defined(this._samples)) {\n if (defined(this._dataError)) {\n throw new RuntimeError(this._dataError);\n }\n\n return undefined;\n }\n\n if (!defined(result)) {\n result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\n }\n\n if (this._samples.length === 0) {\n result.xPoleWander = 0.0;\n result.yPoleWander = 0.0;\n result.xPoleOffset = 0.0;\n result.yPoleOffset = 0.0;\n result.ut1MinusUtc = 0.0;\n return result;\n }\n\n const dates = this._dates;\n const lastIndex = this._lastIndex;\n\n let before = 0;\n let after = 0;\n if (defined(lastIndex)) {\n const previousIndexDate = dates[lastIndex];\n const nextIndexDate = dates[lastIndex + 1];\n const isAfterPrevious = JulianDate.lessThanOrEquals(\n previousIndexDate,\n date\n );\n const isAfterLastSample = !defined(nextIndexDate);\n const isBeforeNext =\n isAfterLastSample || JulianDate.greaterThanOrEquals(nextIndexDate, date);\n\n if (isAfterPrevious && isBeforeNext) {\n before = lastIndex;\n\n if (!isAfterLastSample && nextIndexDate.equals(date)) {\n ++before;\n }\n after = before + 1;\n\n interpolate(this, dates, this._samples, date, before, after, result);\n return result;\n }\n }\n\n let index = binarySearch(dates, date, JulianDate.compare, this._dateColumn);\n if (index >= 0) {\n // If the next entry is the same date, use the later entry. This way, if two entries\n // describe the same moment, one before a leap second and the other after, then we will use\n // the post-leap second data.\n if (index < dates.length - 1 && dates[index + 1].equals(date)) {\n ++index;\n }\n before = index;\n after = index;\n } else {\n after = ~index;\n before = after - 1;\n\n // Use the first entry if the date requested is before the beginning of the data.\n if (before < 0) {\n before = 0;\n }\n }\n\n this._lastIndex = before;\n\n interpolate(this, dates, this._samples, date, before, after, result);\n return result;\n};\n\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\n return JulianDate.compare(leapSecond.julianDate, dateToFind);\n}\n\nfunction onDataReady(eop, eopData) {\n if (!defined(eopData.columnNames)) {\n eop._dataError =\n \"Error in loaded EOP data: The columnNames property is required.\";\n return;\n }\n\n if (!defined(eopData.samples)) {\n eop._dataError =\n \"Error in loaded EOP data: The samples property is required.\";\n return;\n }\n\n const dateColumn = eopData.columnNames.indexOf(\"modifiedJulianDateUtc\");\n const xPoleWanderRadiansColumn = eopData.columnNames.indexOf(\n \"xPoleWanderRadians\"\n );\n const yPoleWanderRadiansColumn = eopData.columnNames.indexOf(\n \"yPoleWanderRadians\"\n );\n const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf(\n \"ut1MinusUtcSeconds\"\n );\n const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\n \"xCelestialPoleOffsetRadians\"\n );\n const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\n \"yCelestialPoleOffsetRadians\"\n );\n const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf(\n \"taiMinusUtcSeconds\"\n );\n\n if (\n dateColumn < 0 ||\n xPoleWanderRadiansColumn < 0 ||\n yPoleWanderRadiansColumn < 0 ||\n ut1MinusUtcSecondsColumn < 0 ||\n xCelestialPoleOffsetRadiansColumn < 0 ||\n yCelestialPoleOffsetRadiansColumn < 0 ||\n taiMinusUtcSecondsColumn < 0\n ) {\n eop._dataError =\n \"Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns\";\n return;\n }\n\n const samples = (eop._samples = eopData.samples);\n const dates = (eop._dates = []);\n\n eop._dateColumn = dateColumn;\n eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;\n eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;\n eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;\n eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;\n eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;\n eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;\n\n eop._columnCount = eopData.columnNames.length;\n eop._lastIndex = undefined;\n\n let lastTaiMinusUtc;\n\n const addNewLeapSeconds = eop._addNewLeapSeconds;\n\n // Convert the ISO8601 dates to JulianDates.\n for (let i = 0, len = samples.length; i < len; i += eop._columnCount) {\n const mjd = samples[i + dateColumn];\n const taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];\n const day = mjd + TimeConstants.MODIFIED_JULIAN_DATE_DIFFERENCE;\n const date = new JulianDate(day, taiMinusUtc, TimeStandard.TAI);\n dates.push(date);\n\n if (addNewLeapSeconds) {\n if (taiMinusUtc !== lastTaiMinusUtc && defined(lastTaiMinusUtc)) {\n // We crossed a leap second boundary, so add the leap second\n // if it does not already exist.\n const leapSeconds = JulianDate.leapSeconds;\n const leapSecondIndex = binarySearch(\n leapSeconds,\n date,\n compareLeapSecondDates\n );\n if (leapSecondIndex < 0) {\n const leapSecond = new LeapSecond(date, taiMinusUtc);\n leapSeconds.splice(~leapSecondIndex, 0, leapSecond);\n }\n }\n lastTaiMinusUtc = taiMinusUtc;\n }\n }\n}\n\nfunction fillResultFromIndex(eop, samples, index, columnCount, result) {\n const start = index * columnCount;\n result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];\n result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];\n result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];\n result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];\n result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];\n}\n\nfunction linearInterp(dx, y1, y2) {\n return y1 + dx * (y2 - y1);\n}\n\nfunction interpolate(eop, dates, samples, date, before, after, result) {\n const columnCount = eop._columnCount;\n\n // First check the bounds on the EOP data\n // If we are after the bounds of the data, return zeros.\n // The 'before' index should never be less than zero.\n if (after > dates.length - 1) {\n result.xPoleWander = 0;\n result.yPoleWander = 0;\n result.xPoleOffset = 0;\n result.yPoleOffset = 0;\n result.ut1MinusUtc = 0;\n return result;\n }\n\n const beforeDate = dates[before];\n const afterDate = dates[after];\n if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {\n fillResultFromIndex(eop, samples, before, columnCount, result);\n return result;\n } else if (date.equals(afterDate)) {\n fillResultFromIndex(eop, samples, after, columnCount, result);\n return result;\n }\n\n const factor =\n JulianDate.secondsDifference(date, beforeDate) /\n JulianDate.secondsDifference(afterDate, beforeDate);\n\n const startBefore = before * columnCount;\n const startAfter = after * columnCount;\n\n // Handle UT1 leap second edge case\n let beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];\n let afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];\n\n const offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;\n if (offsetDifference > 0.5 || offsetDifference < -0.5) {\n // The absolute difference between the values is more than 0.5, so we may have\n // crossed a leap second. Check if this is the case and, if so, adjust the\n // afterValue to account for the leap second. This way, our interpolation will\n // produce reasonable results.\n const beforeTaiMinusUtc =\n samples[startBefore + eop._taiMinusUtcSecondsColumn];\n const afterTaiMinusUtc =\n samples[startAfter + eop._taiMinusUtcSecondsColumn];\n if (beforeTaiMinusUtc !== afterTaiMinusUtc) {\n if (afterDate.equals(date)) {\n // If we are at the end of the leap second interval, take the second value\n // Otherwise, the interpolation below will yield the wrong side of the\n // discontinuity\n // At the end of the leap second, we need to start accounting for the jump\n beforeUt1MinusUtc = afterUt1MinusUtc;\n } else {\n // Otherwise, remove the leap second so that the interpolation is correct\n afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;\n }\n }\n }\n\n result.xPoleWander = linearInterp(\n factor,\n samples[startBefore + eop._xPoleWanderRadiansColumn],\n samples[startAfter + eop._xPoleWanderRadiansColumn]\n );\n result.yPoleWander = linearInterp(\n factor,\n samples[startBefore + eop._yPoleWanderRadiansColumn],\n samples[startAfter + eop._yPoleWanderRadiansColumn]\n );\n result.xPoleOffset = linearInterp(\n factor,\n samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn],\n samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]\n );\n result.yPoleOffset = linearInterp(\n factor,\n samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn],\n samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]\n );\n result.ut1MinusUtc = linearInterp(\n factor,\n beforeUt1MinusUtc,\n afterUt1MinusUtc\n );\n return result;\n}\nexport default EarthOrientationParameters;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\n * the positive x axis.\n * @alias HeadingPitchRoll\n * @constructor\n *\n * @param {Number} [heading=0.0] The heading component in radians.\n * @param {Number} [pitch=0.0] The pitch component in radians.\n * @param {Number} [roll=0.0] The roll component in radians.\n */\nfunction HeadingPitchRoll(heading, pitch, roll) {\n /**\n * Gets or sets the heading.\n * @type {Number}\n * @default 0.0\n */\n this.heading = defaultValue(heading, 0.0);\n /**\n * Gets or sets the pitch.\n * @type {Number}\n * @default 0.0\n */\n this.pitch = defaultValue(pitch, 0.0);\n /**\n * Gets or sets the roll.\n * @type {Number}\n * @default 0.0\n */\n this.roll = defaultValue(roll, 0.0);\n}\n\n/**\n * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\n *\n * @param {Quaternion} quaternion The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.fromQuaternion = function (quaternion, result) {\nif (!defined(result)) {\n result = new HeadingPitchRoll();\n }\n const test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);\n const denominatorRoll =\n 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);\n const numeratorRoll =\n 2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);\n const denominatorHeading =\n 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);\n const numeratorHeading =\n 2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);\n result.heading = -Math.atan2(numeratorHeading, denominatorHeading);\n result.roll = Math.atan2(numeratorRoll, denominatorRoll);\n result.pitch = -CesiumMath.asinClamped(test);\n return result;\n};\n\n/**\n * Returns a new HeadingPitchRoll instance from angles given in degrees.\n *\n * @param {Number} heading the heading in degrees\n * @param {Number} pitch the pitch in degrees\n * @param {Number} roll the heading in degrees\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\n * @returns {HeadingPitchRoll} A new HeadingPitchRoll instance\n */\nHeadingPitchRoll.fromDegrees = function (heading, pitch, roll, result) {\nif (!defined(result)) {\n result = new HeadingPitchRoll();\n }\n result.heading = heading * CesiumMath.RADIANS_PER_DEGREE;\n result.pitch = pitch * CesiumMath.RADIANS_PER_DEGREE;\n result.roll = roll * CesiumMath.RADIANS_PER_DEGREE;\n return result;\n};\n\n/**\n * Duplicates a HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} headingPitchRoll The HeadingPitchRoll to duplicate.\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)\n */\nHeadingPitchRoll.clone = function (headingPitchRoll, result) {\n if (!defined(headingPitchRoll)) {\n return undefined;\n }\n if (!defined(result)) {\n return new HeadingPitchRoll(\n headingPitchRoll.heading,\n headingPitchRoll.pitch,\n headingPitchRoll.roll\n );\n }\n result.heading = headingPitchRoll.heading;\n result.pitch = headingPitchRoll.pitch;\n result.roll = headingPitchRoll.roll;\n return result;\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nHeadingPitchRoll.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.heading === right.heading &&\n left.pitch === right.pitch &&\n left.roll === right.roll)\n );\n};\n\n/**\n * Compares the provided HeadingPitchRolls componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.\n */\nHeadingPitchRoll.equalsEpsilon = function (\n left,\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n CesiumMath.equalsEpsilon(\n left.heading,\n right.heading,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.pitch,\n right.pitch,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n left.roll,\n right.roll,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\n\n/**\n * Duplicates this HeadingPitchRoll instance.\n *\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\n */\nHeadingPitchRoll.prototype.clone = function (result) {\n return HeadingPitchRoll.clone(this, result);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nHeadingPitchRoll.prototype.equals = function (right) {\n return HeadingPitchRoll.equals(this, right);\n};\n\n/**\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nHeadingPitchRoll.prototype.equalsEpsilon = function (\n right,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return HeadingPitchRoll.equalsEpsilon(\n this,\n right,\n relativeEpsilon,\n absoluteEpsilon\n );\n};\n\n/**\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\n *\n * @returns {String} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\n */\nHeadingPitchRoll.prototype.toString = function () {\n return `(${this.heading}, ${this.pitch}, ${this.roll})`;\n};\nexport default HeadingPitchRoll;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\nimport Resource from \"./Resource.js\";\n\n/*global CESIUM_BASE_URL,define,require*/\n\nconst cesiumScriptRegex = /((?:.*\\/)|^)Cesium\\.js(?:\\?|\\#|$)/;\nfunction getBaseUrlFromCesiumScript() {\n const scripts = document.getElementsByTagName(\"script\");\n for (let i = 0, len = scripts.length; i < len; ++i) {\n const src = scripts[i].getAttribute(\"src\");\n const result = cesiumScriptRegex.exec(src);\n if (result !== null) {\n return result[1];\n }\n }\n return undefined;\n}\n\nlet a;\nfunction tryMakeAbsolute(url) {\n if (typeof document === \"undefined\") {\n //Node.js and Web Workers. In both cases, the URL will already be absolute.\n return url;\n }\n\n if (!defined(a)) {\n a = document.createElement(\"a\");\n }\n a.href = url;\n\n // IE only absolutizes href on get, not set\n // eslint-disable-next-line no-self-assign\n a.href = a.href;\n return a.href;\n}\n\nlet baseResource;\nfunction getCesiumBaseUrl() {\n if (defined(baseResource)) {\n return baseResource;\n }\n\n let baseUrlString;\n if (typeof CESIUM_BASE_URL !== \"undefined\") {\n baseUrlString = CESIUM_BASE_URL;\n } else if (\n typeof define === \"object\" &&\n defined(define.amd) &&\n !define.amd.toUrlUndefined &&\n defined(require.toUrl)\n ) {\n baseUrlString = getAbsoluteUri(\n \"..\",\n buildModuleUrl(\"Core/buildModuleUrl.js\")\n );\n } else {\n baseUrlString = getBaseUrlFromCesiumScript();\n }\n\n baseResource = new Resource({\n url: tryMakeAbsolute(baseUrlString),\n });\n baseResource.appendForwardSlash();\n\n return baseResource;\n}\n\nfunction buildModuleUrlFromRequireToUrl(moduleID) {\n //moduleID will be non-relative, so require it relative to this module, in Core.\n return tryMakeAbsolute(require.toUrl(`../${moduleID}`));\n}\n\nfunction buildModuleUrlFromBaseUrl(moduleID) {\n const resource = getCesiumBaseUrl().getDerivedResource({\n url: moduleID,\n });\n return resource.url;\n}\n\nlet implementation;\n\n/**\n * Given a relative URL under the Cesium base URL, returns an absolute URL.\n * @function\n *\n * @param {String} relativeUrl The relative path.\n * @returns {String} The absolutely URL representation of the provided path.\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n * imageryProvider: new Cesium.TileMapServiceImageryProvider({\n * url: Cesium.buildModuleUrl(\"Assets/Textures/NaturalEarthII\"),\n * }),\n * baseLayerPicker: false,\n * });\n */\nfunction buildModuleUrl(relativeUrl) {\n if (!defined(implementation)) {\n //select implementation\n if (\n typeof define === \"object\" &&\n defined(define.amd) &&\n !define.amd.toUrlUndefined &&\n defined(require.toUrl)\n ) {\n implementation = buildModuleUrlFromRequireToUrl;\n } else {\n implementation = buildModuleUrlFromBaseUrl;\n }\n }\n\n const url = implementation(relativeUrl);\n return url;\n}\n\n// exposed for testing\nbuildModuleUrl._cesiumScriptRegex = cesiumScriptRegex;\nbuildModuleUrl._buildModuleUrlFromBaseUrl = buildModuleUrlFromBaseUrl;\nbuildModuleUrl._clearBaseResource = function () {\n baseResource = undefined;\n};\n\n/**\n * Sets the base URL for resolving modules.\n * @param {String} value The new base URL.\n */\nbuildModuleUrl.setBaseUrl = function (value) {\n baseResource = Resource.DEFAULT.getDerivedResource({\n url: value,\n });\n};\n\n/**\n * Gets the base URL for resolving modules.\n *\n * @function\n * @returns {String} The configured base URL\n */\nbuildModuleUrl.getCesiumBaseUrl = getCesiumBaseUrl;\n\nexport default buildModuleUrl;\n", "/**\n * An IAU 2006 XYS value sampled at a particular time.\n *\n * @alias Iau2006XysSample\n * @constructor\n *\n * @param {Number} x The X value.\n * @param {Number} y The Y value.\n * @param {Number} s The S value.\n *\n * @private\n */\nfunction Iau2006XysSample(x, y, s) {\n /**\n * The X value.\n * @type {Number}\n */\n this.x = x;\n\n /**\n * The Y value.\n * @type {Number}\n */\n this.y = y;\n\n /**\n * The S value.\n * @type {Number}\n */\n this.s = s;\n}\nexport default Iau2006XysSample;\n", "import buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport Resource from \"./Resource.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\n *\n * @alias Iau2006XysData\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Resource|String} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,\n * `{0}` will be replaced with the file index.\n * @param {Number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\n * @param {Number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\n * first XYS sample.\n * @param {Number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\n * @param {Number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\n * @param {Number} [options.totalSamples=27426] The total number of samples in all XYS files.\n *\n * @private\n */\nfunction Iau2006XysData(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._xysFileUrlTemplate = Resource.createIfNeeded(\n options.xysFileUrlTemplate\n );\n this._interpolationOrder = defaultValue(options.interpolationOrder, 9);\n this._sampleZeroJulianEphemerisDate = defaultValue(\n options.sampleZeroJulianEphemerisDate,\n 2442396.5\n );\n this._sampleZeroDateTT = new JulianDate(\n this._sampleZeroJulianEphemerisDate,\n 0.0,\n TimeStandard.TAI\n );\n this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0);\n this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000);\n this._totalSamples = defaultValue(options.totalSamples, 27426);\n this._samples = new Array(this._totalSamples * 3);\n this._chunkDownloadsInProgress = [];\n\n const order = this._interpolationOrder;\n\n // Compute denominators and X values for interpolation.\n const denom = (this._denominators = new Array(order + 1));\n const xTable = (this._xTable = new Array(order + 1));\n\n const stepN = Math.pow(this._stepSizeDays, order);\n\n for (let i = 0; i <= order; ++i) {\n denom[i] = stepN;\n xTable[i] = i * this._stepSizeDays;\n\n for (let j = 0; j <= order; ++j) {\n if (j !== i) {\n denom[i] *= i - j;\n }\n }\n\n denom[i] = 1.0 / denom[i];\n }\n\n // Allocate scratch arrays for interpolation.\n this._work = new Array(order + 1);\n this._coef = new Array(order + 1);\n}\n\nconst julianDateScratch = new JulianDate(0, 0.0, TimeStandard.TAI);\n\nfunction getDaysSinceEpoch(xys, dayTT, secondTT) {\n const dateTT = julianDateScratch;\n dateTT.dayNumber = dayTT;\n dateTT.secondsOfDay = secondTT;\n return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);\n}\n\n/**\n * Preloads XYS data for a specified date range.\n *\n * @param {Number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {Number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {Number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\n * the Terrestrial Time (TT) time standard.\n * @returns {Promise<void>} A promise that, when resolved, indicates that the requested interval has been\n * preloaded.\n */\nIau2006XysData.prototype.preload = function (\n startDayTT,\n startSecondTT,\n stopDayTT,\n stopSecondTT\n) {\n const startDaysSinceEpoch = getDaysSinceEpoch(\n this,\n startDayTT,\n startSecondTT\n );\n const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT);\n\n let startIndex =\n (startDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\n 0;\n if (startIndex < 0) {\n startIndex = 0;\n }\n\n let stopIndex =\n (stopDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\n (0 + this._interpolationOrder);\n if (stopIndex >= this._totalSamples) {\n stopIndex = this._totalSamples - 1;\n }\n\n const startChunk = (startIndex / this._samplesPerXysFile) | 0;\n const stopChunk = (stopIndex / this._samplesPerXysFile) | 0;\n\n const promises = [];\n for (let i = startChunk; i <= stopChunk; ++i) {\n promises.push(requestXysChunk(this, i));\n }\n\n return Promise.all(promises);\n};\n\n/**\n * Computes the XYS values for a given date by interpolating. If the required data is not yet downloaded,\n * this method will return undefined.\n *\n * @param {Number} dayTT The Julian day number for which to compute the XYS value, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {Number} secondTT The seconds past noon of the date for which to compute the XYS value, expressed in\n * the Terrestrial Time (TT) time standard.\n * @param {Iau2006XysSample} [result] The instance to which to copy the interpolated result. If this parameter\n * is undefined, a new instance is allocated and returned.\n * @returns {Iau2006XysSample} The interpolated XYS values, or undefined if the required data for this\n * computation has not yet been downloaded.\n *\n * @see Iau2006XysData#preload\n */\nIau2006XysData.prototype.computeXysRadians = function (\n dayTT,\n secondTT,\n result\n) {\n const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT);\n if (daysSinceEpoch < 0.0) {\n // Can't evaluate prior to the epoch of the data.\n return undefined;\n }\n\n const centerIndex = (daysSinceEpoch / this._stepSizeDays) | 0;\n if (centerIndex >= this._totalSamples) {\n // Can't evaluate after the last sample in the data.\n return undefined;\n }\n\n const degree = this._interpolationOrder;\n\n let firstIndex = centerIndex - ((degree / 2) | 0);\n if (firstIndex < 0) {\n firstIndex = 0;\n }\n let lastIndex = firstIndex + degree;\n if (lastIndex >= this._totalSamples) {\n lastIndex = this._totalSamples - 1;\n firstIndex = lastIndex - degree;\n if (firstIndex < 0) {\n firstIndex = 0;\n }\n }\n\n // Are all the samples we need present?\n // We can assume so if the first and last are present\n let isDataMissing = false;\n const samples = this._samples;\n if (!defined(samples[firstIndex * 3])) {\n requestXysChunk(this, (firstIndex / this._samplesPerXysFile) | 0);\n isDataMissing = true;\n }\n\n if (!defined(samples[lastIndex * 3])) {\n requestXysChunk(this, (lastIndex / this._samplesPerXysFile) | 0);\n isDataMissing = true;\n }\n\n if (isDataMissing) {\n return undefined;\n }\n\n if (!defined(result)) {\n result = new Iau2006XysSample(0.0, 0.0, 0.0);\n } else {\n result.x = 0.0;\n result.y = 0.0;\n result.s = 0.0;\n }\n\n const x = daysSinceEpoch - firstIndex * this._stepSizeDays;\n\n const work = this._work;\n const denom = this._denominators;\n const coef = this._coef;\n const xTable = this._xTable;\n\n let i, j;\n for (i = 0; i <= degree; ++i) {\n work[i] = x - xTable[i];\n }\n\n for (i = 0; i <= degree; ++i) {\n coef[i] = 1.0;\n\n for (j = 0; j <= degree; ++j) {\n if (j !== i) {\n coef[i] *= work[j];\n }\n }\n\n coef[i] *= denom[i];\n\n let sampleIndex = (firstIndex + i) * 3;\n result.x += coef[i] * samples[sampleIndex++];\n result.y += coef[i] * samples[sampleIndex++];\n result.s += coef[i] * samples[sampleIndex];\n }\n\n return result;\n};\n\nfunction requestXysChunk(xysData, chunkIndex) {\n if (xysData._chunkDownloadsInProgress[chunkIndex]) {\n // Chunk has already been requested.\n return xysData._chunkDownloadsInProgress[chunkIndex];\n }\n\n let chunkUrl;\n const xysFileUrlTemplate = xysData._xysFileUrlTemplate;\n if (defined(xysFileUrlTemplate)) {\n chunkUrl = xysFileUrlTemplate.getDerivedResource({\n templateValues: {\n 0: chunkIndex,\n },\n });\n } else {\n chunkUrl = new Resource({\n url: buildModuleUrl(`Assets/IAU2006_XYS/IAU2006_XYS_${chunkIndex}.json`),\n });\n }\n\n const promise = chunkUrl.fetchJson().then(function (chunk) {\n xysData._chunkDownloadsInProgress[chunkIndex] = false;\n\n const samples = xysData._samples;\n const newSamples = chunk.samples;\n const startIndex = chunkIndex * xysData._samplesPerXysFile * 3;\n\n for (let i = 0, len = newSamples.length; i < len; ++i) {\n samples[startIndex + i] = newSamples[i];\n }\n });\n xysData._chunkDownloadsInProgress[chunkIndex] = promise;\n\n return promise;\n}\nexport default Iau2006XysData;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EarthOrientationParameters from \"./EarthOrientationParameters.js\";\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport HeadingPitchRoll from \"./HeadingPitchRoll.js\";\nimport Iau2006XysData from \"./Iau2006XysData.js\";\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport TimeConstants from \"./TimeConstants.js\";\n\n/**\n * Contains functions for transforming positions to various reference frames.\n *\n * @namespace Transforms\n */\nconst Transforms = {};\n\nconst vectorProductLocalFrame = {\n up: {\n south: \"east\",\n north: \"west\",\n west: \"south\",\n east: \"north\",\n },\n down: {\n south: \"west\",\n north: \"east\",\n west: \"north\",\n east: \"south\",\n },\n south: {\n up: \"west\",\n down: \"east\",\n west: \"down\",\n east: \"up\",\n },\n north: {\n up: \"east\",\n down: \"west\",\n west: \"up\",\n east: \"down\",\n },\n west: {\n up: \"north\",\n down: \"south\",\n north: \"down\",\n south: \"up\",\n },\n east: {\n up: \"south\",\n down: \"north\",\n north: \"up\",\n south: \"down\",\n },\n};\n\nconst degeneratePositionLocalFrame = {\n north: [-1, 0, 0],\n east: [0, 1, 0],\n up: [0, 0, 1],\n south: [1, 0, 0],\n west: [0, -1, 0],\n down: [0, 0, -1],\n};\n\nconst localFrameToFixedFrameCache = {};\n\nconst scratchCalculateCartesian = {\n east: new Cartesian3(),\n north: new Cartesian3(),\n up: new Cartesian3(),\n west: new Cartesian3(),\n south: new Cartesian3(),\n down: new Cartesian3(),\n};\nlet scratchFirstCartesian = new Cartesian3();\nlet scratchSecondCartesian = new Cartesian3();\nlet scratchThirdCartesian = new Cartesian3();\n/**\n * Generates a function that computes a 4x4 transformation matrix from a reference frame\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * @param {String} firstAxis name of the first axis of the local reference frame. Must be\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\n * @param {String} secondAxis name of the second axis of the local reference frame. Must be\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\n * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a\n * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,\n */\nTransforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) {\n if (\n !vectorProductLocalFrame.hasOwnProperty(firstAxis) ||\n !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)\n ) {\n throw new DeveloperError(\n \"firstAxis and secondAxis must be east, north, up, west, south or down.\"\n );\n }\n const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis];\n\n /**\n * Computes a 4x4 transformation matrix from a reference frame\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * @callback Transforms.LocalFrameToFixedFrame\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n */\n let resultat;\n const hashAxis = firstAxis + secondAxis;\n if (defined(localFrameToFixedFrameCache[hashAxis])) {\n resultat = localFrameToFixedFrameCache[hashAxis];\n } else {\n resultat = function (origin, ellipsoid, result) {\nif (!defined(result)) {\n result = new Matrix4();\n }\n if (\n Cartesian3.equalsEpsilon(origin, Cartesian3.ZERO, CesiumMath.EPSILON14)\n ) {\n // If x, y, and z are zero, use the degenerate local frame, which is a special case\n Cartesian3.unpack(\n degeneratePositionLocalFrame[firstAxis],\n 0,\n scratchFirstCartesian\n );\n Cartesian3.unpack(\n degeneratePositionLocalFrame[secondAxis],\n 0,\n scratchSecondCartesian\n );\n Cartesian3.unpack(\n degeneratePositionLocalFrame[thirdAxis],\n 0,\n scratchThirdCartesian\n );\n } else if (\n CesiumMath.equalsEpsilon(origin.x, 0.0, CesiumMath.EPSILON14) &&\n CesiumMath.equalsEpsilon(origin.y, 0.0, CesiumMath.EPSILON14)\n ) {\n // If x and y are zero, assume origin is at a pole, which is a special case.\n const sign = CesiumMath.sign(origin.z);\n\n Cartesian3.unpack(\n degeneratePositionLocalFrame[firstAxis],\n 0,\n scratchFirstCartesian\n );\n if (firstAxis !== \"east\" && firstAxis !== \"west\") {\n Cartesian3.multiplyByScalar(\n scratchFirstCartesian,\n sign,\n scratchFirstCartesian\n );\n }\n\n Cartesian3.unpack(\n degeneratePositionLocalFrame[secondAxis],\n 0,\n scratchSecondCartesian\n );\n if (secondAxis !== \"east\" && secondAxis !== \"west\") {\n Cartesian3.multiplyByScalar(\n scratchSecondCartesian,\n sign,\n scratchSecondCartesian\n );\n }\n\n Cartesian3.unpack(\n degeneratePositionLocalFrame[thirdAxis],\n 0,\n scratchThirdCartesian\n );\n if (thirdAxis !== \"east\" && thirdAxis !== \"west\") {\n Cartesian3.multiplyByScalar(\n scratchThirdCartesian,\n sign,\n scratchThirdCartesian\n );\n }\n } else {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n ellipsoid.geodeticSurfaceNormal(origin, scratchCalculateCartesian.up);\n\n const up = scratchCalculateCartesian.up;\n const east = scratchCalculateCartesian.east;\n east.x = -origin.y;\n east.y = origin.x;\n east.z = 0.0;\n Cartesian3.normalize(east, scratchCalculateCartesian.east);\n Cartesian3.cross(up, east, scratchCalculateCartesian.north);\n\n Cartesian3.multiplyByScalar(\n scratchCalculateCartesian.up,\n -1,\n scratchCalculateCartesian.down\n );\n Cartesian3.multiplyByScalar(\n scratchCalculateCartesian.east,\n -1,\n scratchCalculateCartesian.west\n );\n Cartesian3.multiplyByScalar(\n scratchCalculateCartesian.north,\n -1,\n scratchCalculateCartesian.south\n );\n\n scratchFirstCartesian = scratchCalculateCartesian[firstAxis];\n scratchSecondCartesian = scratchCalculateCartesian[secondAxis];\n scratchThirdCartesian = scratchCalculateCartesian[thirdAxis];\n }\n result[0] = scratchFirstCartesian.x;\n result[1] = scratchFirstCartesian.y;\n result[2] = scratchFirstCartesian.z;\n result[3] = 0.0;\n result[4] = scratchSecondCartesian.x;\n result[5] = scratchSecondCartesian.y;\n result[6] = scratchSecondCartesian.z;\n result[7] = 0.0;\n result[8] = scratchThirdCartesian.x;\n result[9] = scratchThirdCartesian.y;\n result[10] = scratchThirdCartesian.z;\n result[11] = 0.0;\n result[12] = origin.x;\n result[13] = origin.y;\n result[14] = origin.z;\n result[15] = 1.0;\n return result;\n };\n localFrameToFixedFrameCache[hashAxis] = resultat;\n }\n return resultat;\n};\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local east direction.</li>\n * <li>The <code>y</code> axis points in the local north direction.</li>\n * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n */\nTransforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n \"east\",\n \"north\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the local east direction.</li>\n * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);\n */\nTransforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n \"north\",\n \"east\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * <li>The <code>z</code> axis points in the local east direction.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);\n */\nTransforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n \"north\",\n \"up\"\n);\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\n * The local axes are defined as:\n * <ul>\n * <li>The <code>x</code> axis points in the local north direction.</li>\n * <li>The <code>y</code> axis points in the local west direction.</li>\n * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>\n * </ul>\n *\n * @function\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);\n */\nTransforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\n \"north\",\n \"west\"\n);\n\nconst scratchHPRQuaternion = new Quaternion();\nconst scratchScale = new Cartesian3(1.0, 1.0, 1.0);\nconst scratchHPRMatrix4 = new Matrix4();\n\n/**\n * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles\n * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {Matrix4} [result] The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\n *\n * @example\n * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const heading = -Cesium.Math.PI_OVER_TWO;\n * const pitch = Cesium.Math.PI_OVER_FOUR;\n * const roll = 0.0;\n * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);\n * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);\n */\nTransforms.headingPitchRollToFixedFrame = function (\n origin,\n headingPitchRoll,\n ellipsoid,\n fixedFrameTransform,\n result\n) {\n fixedFrameTransform = defaultValue(\n fixedFrameTransform,\n Transforms.eastNorthUpToFixedFrame\n );\n const hprQuaternion = Quaternion.fromHeadingPitchRoll(\n headingPitchRoll,\n scratchHPRQuaternion\n );\n const hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(\n Cartesian3.ZERO,\n hprQuaternion,\n scratchScale,\n scratchHPRMatrix4\n );\n result = fixedFrameTransform(origin, ellipsoid, result);\n return Matrix4.multiply(result, hprMatrix, result);\n};\n\nconst scratchENUMatrix4 = new Matrix4();\nconst scratchHPRMatrix3 = new Matrix3();\n\n/**\n * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles\n * centered at the provided origin. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Cartesian3} origin The center point of the local reference frame.\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\n *\n * @example\n * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const heading = -Cesium.Math.PI_OVER_TWO;\n * const pitch = Cesium.Math.PI_OVER_FOUR;\n * const roll = 0.0;\n * const hpr = new HeadingPitchRoll(heading, pitch, roll);\n * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);\n */\nTransforms.headingPitchRollQuaternion = function (\n origin,\n headingPitchRoll,\n ellipsoid,\n fixedFrameTransform,\n result\n) {\n const transform = Transforms.headingPitchRollToFixedFrame(\n origin,\n headingPitchRoll,\n ellipsoid,\n fixedFrameTransform,\n scratchENUMatrix4\n );\n const rotation = Matrix4.getMatrix3(transform, scratchHPRMatrix3);\n return Quaternion.fromRotationMatrix(rotation, result);\n};\n\nconst noScale = new Cartesian3(1.0, 1.0, 1.0);\nconst hprCenterScratch = new Cartesian3();\nconst ffScratch = new Matrix4();\nconst hprTransformScratch = new Matrix4();\nconst hprRotationScratch = new Matrix3();\nconst hprQuaternionScratch = new Quaternion();\n/**\n * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\n *\n * @param {Matrix4} transform The transform\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided.\n */\nTransforms.fixedFrameToHeadingPitchRoll = function (\n transform,\n ellipsoid,\n fixedFrameTransform,\n result\n) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n fixedFrameTransform = defaultValue(\n fixedFrameTransform,\n Transforms.eastNorthUpToFixedFrame\n );\n if (!defined(result)) {\n result = new HeadingPitchRoll();\n }\n\n const center = Matrix4.getTranslation(transform, hprCenterScratch);\n if (Cartesian3.equals(center, Cartesian3.ZERO)) {\n result.heading = 0;\n result.pitch = 0;\n result.roll = 0;\n return result;\n }\n let toFixedFrame = Matrix4.inverseTransformation(\n fixedFrameTransform(center, ellipsoid, ffScratch),\n ffScratch\n );\n let transformCopy = Matrix4.setScale(transform, noScale, hprTransformScratch);\n transformCopy = Matrix4.setTranslation(\n transformCopy,\n Cartesian3.ZERO,\n transformCopy\n );\n\n toFixedFrame = Matrix4.multiply(toFixedFrame, transformCopy, toFixedFrame);\n let quaternionRotation = Quaternion.fromRotationMatrix(\n Matrix4.getMatrix3(toFixedFrame, hprRotationScratch),\n hprQuaternionScratch\n );\n quaternionRotation = Quaternion.normalize(\n quaternionRotation,\n quaternionRotation\n );\n\n return HeadingPitchRoll.fromQuaternion(quaternionRotation, result);\n};\n\nconst gmstConstant0 = 6 * 3600 + 41 * 60 + 50.54841;\nconst gmstConstant1 = 8640184.812866;\nconst gmstConstant2 = 0.093104;\nconst gmstConstant3 = -6.2e-6;\nconst rateCoef = 1.1772758384668e-19;\nconst wgs84WRPrecessing = 7.2921158553e-5;\nconst twoPiOverSecondsInDay = CesiumMath.TWO_PI / 86400.0;\nlet dateInUtc = new JulianDate();\n\n/**\n * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the\n * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\n *\n * @example\n * //Set the view to the inertial frame.\n * scene.postUpdate.addEventListener(function(scene, time) {\n * const now = Cesium.JulianDate.now();\n * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());\n * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));\n * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());\n * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);\n * camera.lookAtTransform(transform, offset);\n * });\n */\nTransforms.computeTemeToPseudoFixedMatrix = function (date, result) {\n // GMST is actually computed using UT1. We're using UTC as an approximation of UT1.\n // We do not want to use the function like convertTaiToUtc in JulianDate because\n // we explicitly do not want to fail when inside the leap second.\n\n dateInUtc = JulianDate.addSeconds(\n date,\n -JulianDate.computeTaiMinusUtc(date),\n dateInUtc\n );\n const utcDayNumber = dateInUtc.dayNumber;\n const utcSecondsIntoDay = dateInUtc.secondsOfDay;\n\n let t;\n const diffDays = utcDayNumber - 2451545;\n if (utcSecondsIntoDay >= 43200.0) {\n t = (diffDays + 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n } else {\n t = (diffDays - 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n }\n\n const gmst0 =\n gmstConstant0 +\n t * (gmstConstant1 + t * (gmstConstant2 + t * gmstConstant3));\n const angle = (gmst0 * twoPiOverSecondsInDay) % CesiumMath.TWO_PI;\n const ratio = wgs84WRPrecessing + rateCoef * (utcDayNumber - 2451545.5);\n const secondsSinceMidnight =\n (utcSecondsIntoDay + TimeConstants.SECONDS_PER_DAY * 0.5) %\n TimeConstants.SECONDS_PER_DAY;\n const gha = angle + ratio * secondsSinceMidnight;\n const cosGha = Math.cos(gha);\n const sinGha = Math.sin(gha);\n\n if (!defined(result)) {\n return new Matrix3(\n cosGha,\n sinGha,\n 0.0,\n -sinGha,\n cosGha,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n result[0] = cosGha;\n result[1] = -sinGha;\n result[2] = 0.0;\n result[3] = sinGha;\n result[4] = cosGha;\n result[5] = 0.0;\n result[6] = 0.0;\n result[7] = 0.0;\n result[8] = 1.0;\n return result;\n};\n\n/**\n * The source of IAU 2006 XYS data, used for computing the transformation between the\n * Fixed and ICRF axes.\n * @type {Iau2006XysData}\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n *\n * @private\n */\nTransforms.iau2006XysData = new Iau2006XysData();\n\n/**\n * The source of Earth Orientation Parameters (EOP) data, used for computing the transformation\n * between the Fixed and ICRF axes. By default, zero values are used for all EOP values,\n * yielding a reasonable but not completely accurate representation of the ICRF axes.\n * @type {EarthOrientationParameters}\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n *\n * @private\n */\nTransforms.earthOrientationParameters = EarthOrientationParameters.NONE;\n\nconst ttMinusTai = 32.184;\nconst j2000ttDays = 2451545.0;\n\n/**\n * Preloads the data necessary to transform between the ICRF and Fixed axes, in either\n * direction, over a given interval. This function returns a promise that, when resolved,\n * indicates that the preload has completed.\n *\n * @param {TimeInterval} timeInterval The interval to preload.\n * @returns {Promise<void>} A promise that, when resolved, indicates that the preload has completed\n * and evaluation of the transformation between the fixed and ICRF axes will\n * no longer return undefined for a time inside the interval.\n *\n *\n * @example\n * const interval = new Cesium.TimeInterval(...);\n * Promise.resolve(Cesium.Transforms.preloadIcrfFixed(interval)).then(function() {\n * // the data is now loaded\n * });\n *\n * @see Transforms.computeIcrfToFixedMatrix\n * @see Transforms.computeFixedToIcrfMatrix\n */\nTransforms.preloadIcrfFixed = function (timeInterval) {\n const startDayTT = timeInterval.start.dayNumber;\n const startSecondTT = timeInterval.start.secondsOfDay + ttMinusTai;\n const stopDayTT = timeInterval.stop.dayNumber;\n const stopSecondTT = timeInterval.stop.secondsOfDay + ttMinusTai;\n\n const xysPromise = Transforms.iau2006XysData.preload(\n startDayTT,\n startSecondTT,\n stopDayTT,\n stopSecondTT\n );\n const eopPromise = Transforms.earthOrientationParameters.getPromiseToLoad();\n\n return Promise.all([xysPromise, eopPromise]);\n};\n\n/**\n * Computes a rotation matrix to transform a point or vector from the International Celestial\n * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)\n * at a given time. This function may return undefined if the data necessary to\n * do the transformation is not yet loaded.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result. If this parameter is\n * not specified, a new instance is created and returned.\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\n * transformation is not yet loaded.\n *\n *\n * @example\n * scene.postUpdate.addEventListener(function(scene, time) {\n * // View in ICRF.\n * const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);\n * if (Cesium.defined(icrfToFixed)) {\n * const offset = Cesium.Cartesian3.clone(camera.position);\n * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);\n * camera.lookAtTransform(transform, offset);\n * }\n * });\n *\n * @see Transforms.preloadIcrfFixed\n */\nTransforms.computeIcrfToFixedMatrix = function (date, result) {\nif (!defined(result)) {\n result = new Matrix3();\n }\n\n const fixedToIcrfMtx = Transforms.computeFixedToIcrfMatrix(date, result);\n if (!defined(fixedToIcrfMtx)) {\n return undefined;\n }\n\n return Matrix3.transpose(fixedToIcrfMtx, result);\n};\n\nconst xysScratch = new Iau2006XysSample(0.0, 0.0, 0.0);\nconst eopScratch = new EarthOrientationParametersSample(\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0\n);\nconst rotation1Scratch = new Matrix3();\nconst rotation2Scratch = new Matrix3();\n\n/**\n * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)\n * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes\n * at a given time. This function may return undefined if the data necessary to\n * do the transformation is not yet loaded.\n *\n * @param {JulianDate} date The time at which to compute the rotation matrix.\n * @param {Matrix3} [result] The object onto which to store the result. If this parameter is\n * not specified, a new instance is created and returned.\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\n * transformation is not yet loaded.\n *\n *\n * @example\n * // Transform a point from the ICRF axes to the Fixed axes.\n * const now = Cesium.JulianDate.now();\n * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);\n * let pointInInertial = new Cesium.Cartesian3();\n * if (Cesium.defined(fixedToIcrf)) {\n * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);\n * }\n *\n * @see Transforms.preloadIcrfFixed\n */\nTransforms.computeFixedToIcrfMatrix = function (date, result) {\n if (!defined(result)) {\n result = new Matrix3();\n }\n\n // Compute pole wander\n const eop = Transforms.earthOrientationParameters.compute(date, eopScratch);\n if (!defined(eop)) {\n return undefined;\n }\n\n // There is no external conversion to Terrestrial Time (TT).\n // So use International Atomic Time (TAI) and convert using offsets.\n // Here we are assuming that dayTT and secondTT are positive\n const dayTT = date.dayNumber;\n // It's possible here that secondTT could roll over 86400\n // This does not seem to affect the precision (unit tests check for this)\n const secondTT = date.secondsOfDay + ttMinusTai;\n\n const xys = Transforms.iau2006XysData.computeXysRadians(\n dayTT,\n secondTT,\n xysScratch\n );\n if (!defined(xys)) {\n return undefined;\n }\n\n const x = xys.x + eop.xPoleOffset;\n const y = xys.y + eop.yPoleOffset;\n\n // Compute XYS rotation\n const a = 1.0 / (1.0 + Math.sqrt(1.0 - x * x - y * y));\n\n const rotation1 = rotation1Scratch;\n rotation1[0] = 1.0 - a * x * x;\n rotation1[3] = -a * x * y;\n rotation1[6] = x;\n rotation1[1] = -a * x * y;\n rotation1[4] = 1 - a * y * y;\n rotation1[7] = y;\n rotation1[2] = -x;\n rotation1[5] = -y;\n rotation1[8] = 1 - a * (x * x + y * y);\n\n const rotation2 = Matrix3.fromRotationZ(-xys.s, rotation2Scratch);\n const matrixQ = Matrix3.multiply(rotation1, rotation2, rotation1Scratch);\n\n // Similar to TT conversions above\n // It's possible here that secondTT could roll over 86400\n // This does not seem to affect the precision (unit tests check for this)\n const dateUt1day = date.dayNumber;\n const dateUt1sec =\n date.secondsOfDay - JulianDate.computeTaiMinusUtc(date) + eop.ut1MinusUtc;\n\n // Compute Earth rotation angle\n // The IERS standard for era is\n // era = 0.7790572732640 + 1.00273781191135448 * Tu\n // where\n // Tu = JulianDateInUt1 - 2451545.0\n // However, you get much more precision if you make the following simplification\n // era = a + (1 + b) * (JulianDayNumber + FractionOfDay - 2451545)\n // era = a + (JulianDayNumber - 2451545) + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\n // era = a + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\n // since (JulianDayNumber - 2451545) represents an integer number of revolutions which will be discarded anyway.\n const daysSinceJ2000 = dateUt1day - 2451545;\n const fractionOfDay = dateUt1sec / TimeConstants.SECONDS_PER_DAY;\n let era =\n 0.779057273264 +\n fractionOfDay +\n 0.00273781191135448 * (daysSinceJ2000 + fractionOfDay);\n era = (era % 1.0) * CesiumMath.TWO_PI;\n\n const earthRotation = Matrix3.fromRotationZ(era, rotation2Scratch);\n\n // pseudoFixed to ICRF\n const pfToIcrf = Matrix3.multiply(matrixQ, earthRotation, rotation1Scratch);\n\n // Compute pole wander matrix\n const cosxp = Math.cos(eop.xPoleWander);\n const cosyp = Math.cos(eop.yPoleWander);\n const sinxp = Math.sin(eop.xPoleWander);\n const sinyp = Math.sin(eop.yPoleWander);\n\n let ttt = dayTT - j2000ttDays + secondTT / TimeConstants.SECONDS_PER_DAY;\n ttt /= 36525.0;\n\n // approximate sp value in rad\n const sp = (-47.0e-6 * ttt * CesiumMath.RADIANS_PER_DEGREE) / 3600.0;\n const cossp = Math.cos(sp);\n const sinsp = Math.sin(sp);\n\n const fToPfMtx = rotation2Scratch;\n fToPfMtx[0] = cosxp * cossp;\n fToPfMtx[1] = cosxp * sinsp;\n fToPfMtx[2] = sinxp;\n fToPfMtx[3] = -cosyp * sinsp + sinyp * sinxp * cossp;\n fToPfMtx[4] = cosyp * cossp + sinyp * sinxp * sinsp;\n fToPfMtx[5] = -sinyp * cosxp;\n fToPfMtx[6] = -sinyp * sinsp - cosyp * sinxp * cossp;\n fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;\n fToPfMtx[8] = cosyp * cosxp;\n\n return Matrix3.multiply(pfToIcrf, fToPfMtx, result);\n};\n\nconst pointToWindowCoordinatesTemp = new Cartesian4();\n\n/**\n * Transform a point from model coordinates to window coordinates.\n *\n * @param {Matrix4} modelViewProjectionMatrix The 4x4 model-view-projection matrix.\n * @param {Matrix4} viewportTransformation The 4x4 viewport transformation.\n * @param {Cartesian3} point The point to transform.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\n */\nTransforms.pointToWindowCoordinates = function (\n modelViewProjectionMatrix,\n viewportTransformation,\n point,\n result\n) {\n result = Transforms.pointToGLWindowCoordinates(\n modelViewProjectionMatrix,\n viewportTransformation,\n point,\n result\n );\n result.y = 2.0 * viewportTransformation[5] - result.y;\n return result;\n};\n\n/**\n * @private\n */\nTransforms.pointToGLWindowCoordinates = function (\n modelViewProjectionMatrix,\n viewportTransformation,\n point,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const tmp = pointToWindowCoordinatesTemp;\n\n Matrix4.multiplyByVector(\n modelViewProjectionMatrix,\n Cartesian4.fromElements(point.x, point.y, point.z, 1, tmp),\n tmp\n );\n Cartesian4.multiplyByScalar(tmp, 1.0 / tmp.w, tmp);\n Matrix4.multiplyByVector(viewportTransformation, tmp, tmp);\n return Cartesian2.fromCartesian4(tmp, result);\n};\n\nconst normalScratch = new Cartesian3();\nconst rightScratch = new Cartesian3();\nconst upScratch = new Cartesian3();\n\n/**\n * Transform a position and velocity to a rotation matrix.\n *\n * @param {Cartesian3} position The position to transform.\n * @param {Cartesian3} velocity The velocity vector to transform.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\n * @param {Matrix3} [result] The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\n */\nTransforms.rotationMatrixFromPositionVelocity = function (\n position,\n velocity,\n ellipsoid,\n result\n) {\n const normal = defaultValue(ellipsoid, Ellipsoid.WGS84).geodeticSurfaceNormal(\n position,\n normalScratch\n );\n let right = Cartesian3.cross(velocity, normal, rightScratch);\n\n if (Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)) {\n right = Cartesian3.clone(Cartesian3.UNIT_X, right);\n }\n\n const up = Cartesian3.cross(right, velocity, upScratch);\n Cartesian3.normalize(up, up);\n Cartesian3.cross(velocity, up, right);\n Cartesian3.negate(right, right);\n Cartesian3.normalize(right, right);\n\n if (!defined(result)) {\n result = new Matrix3();\n }\n\n result[0] = velocity.x;\n result[1] = velocity.y;\n result[2] = velocity.z;\n result[3] = right.x;\n result[4] = right.y;\n result[5] = right.z;\n result[6] = up.x;\n result[7] = up.y;\n result[8] = up.z;\n\n return result;\n};\n\nconst swizzleMatrix = new Matrix4(\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n);\n\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian3Projection = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchFromENU = new Matrix4();\nconst scratchToENU = new Matrix4();\n\n/**\n * @private\n */\nTransforms.basisTo2D = function (projection, matrix, result) {\n const rtcCenter = Matrix4.getTranslation(matrix, scratchCenter);\n const ellipsoid = projection.ellipsoid;\n\n // Get the 2D Center\n const cartographic = ellipsoid.cartesianToCartographic(\n rtcCenter,\n scratchCartographic\n );\n const projectedPosition = projection.project(\n cartographic,\n scratchCartesian3Projection\n );\n Cartesian3.fromElements(\n projectedPosition.z,\n projectedPosition.x,\n projectedPosition.y,\n projectedPosition\n );\n\n // Assuming the instance are positioned in WGS84, invert the WGS84 transform to get the local transform and then convert to 2D\n const fromENU = Transforms.eastNorthUpToFixedFrame(\n rtcCenter,\n ellipsoid,\n scratchFromENU\n );\n const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\n const rotation = Matrix4.getMatrix3(matrix, scratchRotation);\n const local = Matrix4.multiplyByMatrix3(toENU, rotation, result);\n Matrix4.multiply(swizzleMatrix, local, result); // Swap x, y, z for 2D\n Matrix4.setTranslation(result, projectedPosition, result); // Use the projected center\n\n return result;\n};\n\n/**\n * @private\n */\nTransforms.wgs84To2DModelMatrix = function (projection, center, result) {\n const ellipsoid = projection.ellipsoid;\n\n const fromENU = Transforms.eastNorthUpToFixedFrame(\n center,\n ellipsoid,\n scratchFromENU\n );\n const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\n\n const cartographic = ellipsoid.cartesianToCartographic(\n center,\n scratchCartographic\n );\n const projectedPosition = projection.project(\n cartographic,\n scratchCartesian3Projection\n );\n Cartesian3.fromElements(\n projectedPosition.z,\n projectedPosition.x,\n projectedPosition.y,\n projectedPosition\n );\n\n const translation = Matrix4.fromTranslation(\n projectedPosition,\n scratchFromENU\n );\n Matrix4.multiply(swizzleMatrix, toENU, result);\n Matrix4.multiply(translation, result, result);\n\n return result;\n};\nexport default Transforms;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Transforms from \"./Transforms.js\";\n\n/**\n * A geometry representation with attributes forming vertices and optional index data\n * defining primitives. Geometries and an {@link Appearance}, which describes the shading,\n * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can\n * be created from many heterogeneous - in many cases - geometries for performance.\n * <p>\n * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.\n * </p>\n *\n * @alias Geometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices.\n * @param {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry.\n * @param {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry.\n * @param {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.\n *\n * @see PolygonGeometry\n * @see RectangleGeometry\n * @see EllipseGeometry\n * @see CircleGeometry\n * @see WallGeometry\n * @see SimplePolylineGeometry\n * @see BoxGeometry\n * @see EllipsoidGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}\n *\n * @example\n * // Create geometry with a position attribute and indexed lines.\n * const positions = new Float64Array([\n * 0.0, 0.0, 0.0,\n * 7500000.0, 0.0, 0.0,\n * 0.0, 7500000.0, 0.0\n * ]);\n *\n * const geometry = new Cesium.Geometry({\n * attributes : {\n * position : new Cesium.GeometryAttribute({\n * componentDatatype : Cesium.ComponentDatatype.DOUBLE,\n * componentsPerAttribute : 3,\n * values : positions\n * })\n * },\n * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),\n * primitiveType : Cesium.PrimitiveType.LINES,\n * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)\n * });\n */\nfunction Geometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a\n * {@link GeometryAttribute} containing the attribute's data.\n * <p>\n * Attributes are always stored non-interleaved in a Geometry.\n * </p>\n * <p>\n * There are reserved attribute names with well-known semantics. The following attributes\n * are created by a Geometry (depending on the provided {@link VertexFormat}.\n * <ul>\n * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>\n * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>\n * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>\n * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li>\n * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li>\n * </ul>\n * </p>\n * <p>\n * The following attribute names are generally not created by a Geometry, but are added\n * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare\n * the geometry for rendering.\n * <ul>\n * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>\n * <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>\n * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>\n * <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>\n * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>\n * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>\n * </ul>\n * </p>\n *\n * @type GeometryAttributes\n *\n * @default undefined\n *\n *\n * @example\n * geometry.attributes.position = new Cesium.GeometryAttribute({\n * componentDatatype : Cesium.ComponentDatatype.FLOAT,\n * componentsPerAttribute : 3,\n * values : new Float32Array(0)\n * });\n *\n * @see GeometryAttribute\n * @see VertexFormat\n */\n this.attributes = options.attributes;\n\n /**\n * Optional index data that - along with {@link Geometry#primitiveType} -\n * determines the primitives in the geometry.\n *\n * @type Array\n *\n * @default undefined\n */\n this.indices = options.indices;\n\n /**\n * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},\n * but can varying based on the specific geometry.\n *\n * @type PrimitiveType\n *\n * @default undefined\n */\n this.primitiveType = defaultValue(\n options.primitiveType,\n PrimitiveType.TRIANGLES\n );\n\n /**\n * An optional bounding sphere that fully encloses the geometry. This is\n * commonly used for culling.\n *\n * @type BoundingSphere\n *\n * @default undefined\n */\n this.boundingSphere = options.boundingSphere;\n\n /**\n * @private\n */\n this.geometryType = defaultValue(options.geometryType, GeometryType.NONE);\n\n /**\n * @private\n */\n this.boundingSphereCV = options.boundingSphereCV;\n\n /**\n * Used for computing the bounding sphere for geometry using the applyOffset vertex attribute\n * @private\n */\n this.offsetAttribute = options.offsetAttribute;\n}\n\n/**\n * Computes the number of vertices in a geometry. The runtime is linear with\n * respect to the number of attributes in a vertex, not the number of vertices.\n *\n * @param {Geometry} geometry The geometry.\n * @returns {Number} The number of vertices in the geometry.\n *\n * @example\n * const numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);\n */\nGeometry.computeNumberOfVertices = function (geometry) {\n let numberOfVertices = -1;\n for (const property in geometry.attributes) {\n if (\n geometry.attributes.hasOwnProperty(property) &&\n defined(geometry.attributes[property]) &&\n defined(geometry.attributes[property].values)\n ) {\n const attribute = geometry.attributes[property];\n const num = attribute.values.length / attribute.componentsPerAttribute;\nnumberOfVertices = num;\n }\n }\n\n return numberOfVertices;\n};\n\nconst rectangleCenterScratch = new Cartographic();\nconst enuCenterScratch = new Cartesian3();\nconst fixedFrameToEnuScratch = new Matrix4();\nconst boundingRectanglePointsCartographicScratch = [\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n];\nconst boundingRectanglePointsEnuScratch = [\n new Cartesian2(),\n new Cartesian2(),\n new Cartesian2(),\n];\nconst points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];\nconst pointEnuScratch = new Cartesian3();\nconst enuRotationScratch = new Quaternion();\nconst enuRotationMatrixScratch = new Matrix4();\nconst rotation2DScratch = new Matrix2();\n\n/**\n * For remapping texture coordinates when rendering GroundPrimitives with materials.\n * GroundPrimitive texture coordinates are computed to align with the cartographic coordinate system on the globe.\n * However, EllipseGeometry, RectangleGeometry, and PolygonGeometry all bake rotations to per-vertex texture coordinates\n * using different strategies.\n *\n * This method is used by EllipseGeometry and PolygonGeometry to approximate the same visual effect.\n * We encapsulate rotation and scale by computing a \"transformed\" texture coordinate system and computing\n * a set of reference points from which \"cartographic\" texture coordinates can be remapped to the \"transformed\"\n * system using distances to lines in 2D.\n *\n * This approximation becomes less accurate as the covered area increases, especially for GroundPrimitives near the poles,\n * but is generally reasonable for polygons and ellipses around the size of USA states.\n *\n * RectangleGeometry has its own version of this method that computes remapping coordinates using cartographic space\n * as an intermediary instead of local ENU, which is more accurate for large-area rectangles.\n *\n * @param {Cartesian3[]} positions Array of positions outlining the geometry\n * @param {Number} stRotation Texture coordinate rotation.\n * @param {Ellipsoid} ellipsoid Ellipsoid for projecting and generating local vectors.\n * @param {Rectangle} boundingRectangle Bounding rectangle around the positions.\n * @returns {Number[]} An array of 6 numbers specifying [minimum point, u extent, v extent] as points in the \"cartographic\" system.\n * @private\n */\nGeometry._textureCoordinateRotationPoints = function (\n positions,\n stRotation,\n ellipsoid,\n boundingRectangle\n) {\n let i;\n\n // Create a local east-north-up coordinate system centered on the polygon's bounding rectangle.\n // Project the southwest, northwest, and southeast corners of the bounding rectangle into the plane of ENU as 2D points.\n // These are the equivalents of (0,0), (0,1), and (1,0) in the texture coordiante system computed in ShadowVolumeAppearanceFS,\n // aka \"ENU texture space.\"\n const rectangleCenter = Rectangle.center(\n boundingRectangle,\n rectangleCenterScratch\n );\n const enuCenter = Cartographic.toCartesian(\n rectangleCenter,\n ellipsoid,\n enuCenterScratch\n );\n const enuToFixedFrame = Transforms.eastNorthUpToFixedFrame(\n enuCenter,\n ellipsoid,\n fixedFrameToEnuScratch\n );\n const fixedFrameToEnu = Matrix4.inverse(\n enuToFixedFrame,\n fixedFrameToEnuScratch\n );\n\n const boundingPointsEnu = boundingRectanglePointsEnuScratch;\n const boundingPointsCarto = boundingRectanglePointsCartographicScratch;\n\n boundingPointsCarto[0].longitude = boundingRectangle.west;\n boundingPointsCarto[0].latitude = boundingRectangle.south;\n\n boundingPointsCarto[1].longitude = boundingRectangle.west;\n boundingPointsCarto[1].latitude = boundingRectangle.north;\n\n boundingPointsCarto[2].longitude = boundingRectangle.east;\n boundingPointsCarto[2].latitude = boundingRectangle.south;\n\n let posEnu = pointEnuScratch;\n\n for (i = 0; i < 3; i++) {\n Cartographic.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);\n posEnu = Matrix4.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);\n boundingPointsEnu[i].x = posEnu.x;\n boundingPointsEnu[i].y = posEnu.y;\n }\n\n // Rotate each point in the polygon around the up vector in the ENU by -stRotation and project into ENU as 2D.\n // Compute the bounding box of these rotated points in the 2D ENU plane.\n // Rotate the corners back by stRotation, then compute their equivalents in the ENU texture space using the corners computed earlier.\n const rotation = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_Z,\n -stRotation,\n enuRotationScratch\n );\n const textureMatrix = Matrix3.fromQuaternion(\n rotation,\n enuRotationMatrixScratch\n );\n\n const positionsLength = positions.length;\n let enuMinX = Number.POSITIVE_INFINITY;\n let enuMinY = Number.POSITIVE_INFINITY;\n let enuMaxX = Number.NEGATIVE_INFINITY;\n let enuMaxY = Number.NEGATIVE_INFINITY;\n for (i = 0; i < positionsLength; i++) {\n posEnu = Matrix4.multiplyByPointAsVector(\n fixedFrameToEnu,\n positions[i],\n posEnu\n );\n posEnu = Matrix3.multiplyByVector(textureMatrix, posEnu, posEnu);\n\n enuMinX = Math.min(enuMinX, posEnu.x);\n enuMinY = Math.min(enuMinY, posEnu.y);\n enuMaxX = Math.max(enuMaxX, posEnu.x);\n enuMaxY = Math.max(enuMaxY, posEnu.y);\n }\n\n const toDesiredInComputed = Matrix2.fromRotation(\n stRotation,\n rotation2DScratch\n );\n\n const points2D = points2DScratch;\n points2D[0].x = enuMinX;\n points2D[0].y = enuMinY;\n\n points2D[1].x = enuMinX;\n points2D[1].y = enuMaxY;\n\n points2D[2].x = enuMaxX;\n points2D[2].y = enuMinY;\n\n const boundingEnuMin = boundingPointsEnu[0];\n const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;\n const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;\n\n for (i = 0; i < 3; i++) {\n const point2D = points2D[i];\n // rotate back\n Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);\n\n // Convert point into east-north texture coordinate space\n point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;\n point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;\n }\n\n const minXYCorner = points2D[0];\n const maxYCorner = points2D[1];\n const maxXCorner = points2D[2];\n const result = new Array(6);\n Cartesian2.pack(minXYCorner, result);\n Cartesian2.pack(maxYCorner, result, 2);\n Cartesian2.pack(maxXCorner, result, 4);\n\n return result;\n};\nexport default Geometry;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Values and type information for geometry attributes. A {@link Geometry}\n * generally contains one or more attributes. All attributes together form\n * the geometry's vertices.\n *\n * @alias GeometryAttribute\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values.\n * @param {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes.\n * @param {Boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array.\n *\n * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.\n *\n *\n * @example\n * const geometry = new Cesium.Geometry({\n * attributes : {\n * position : new Cesium.GeometryAttribute({\n * componentDatatype : Cesium.ComponentDatatype.FLOAT,\n * componentsPerAttribute : 3,\n * values : new Float32Array([\n * 0.0, 0.0, 0.0,\n * 7500000.0, 0.0, 0.0,\n * 0.0, 7500000.0, 0.0\n * ])\n * })\n * },\n * primitiveType : Cesium.PrimitiveType.LINE_LOOP\n * });\n *\n * @see Geometry\n */\nfunction GeometryAttribute(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link GeometryAttribute#values}.\n *\n * @type ComponentDatatype\n *\n * @default undefined\n */\n this.componentDatatype = options.componentDatatype;\n\n /**\n * A number between 1 and 4 that defines the number of components in an attributes.\n * For example, a position attribute with x, y, and z components would have 3 as\n * shown in the code example.\n *\n * @type Number\n *\n * @default undefined\n *\n * @example\n * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\n * attribute.componentsPerAttribute = 3;\n * attribute.values = new Float32Array([\n * 0.0, 0.0, 0.0,\n * 7500000.0, 0.0, 0.0,\n * 0.0, 7500000.0, 0.0\n * ]);\n */\n this.componentsPerAttribute = options.componentsPerAttribute;\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * <p>\n * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n *\n * @example\n * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;\n * attribute.componentsPerAttribute = 4;\n * attribute.normalize = true;\n * attribute.values = new Uint8Array([\n * Cesium.Color.floatToByte(color.red),\n * Cesium.Color.floatToByte(color.green),\n * Cesium.Color.floatToByte(color.blue),\n * Cesium.Color.floatToByte(color.alpha)\n * ]);\n */\n this.normalize = defaultValue(options.normalize, false);\n\n /**\n * The values for the attributes stored in a typed array. In the code example,\n * every three elements in <code>values</code> defines one attributes since\n * <code>componentsPerAttribute</code> is 3.\n *\n * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array}\n *\n * @default undefined\n *\n * @example\n * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\n * attribute.componentsPerAttribute = 3;\n * attribute.values = new Float32Array([\n * 0.0, 0.0, 0.0,\n * 7500000.0, 0.0, 0.0,\n * 0.0, 7500000.0, 0.0\n * ]);\n */\n this.values = options.values;\n}\nexport default GeometryAttribute;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a\n * {@link GeometryAttribute} containing the attribute's data.\n * <p>\n * Attributes are always stored non-interleaved in a Geometry.\n * </p>\n *\n * @alias GeometryAttributes\n * @constructor\n */\nfunction GeometryAttributes(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The 3D position attribute.\n * <p>\n * 64-bit floating-point (for precision). 3 components per attribute.\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.position = options.position;\n\n /**\n * The normal attribute (normalized), which is commonly used for lighting.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.normal = options.normal;\n\n /**\n * The 2D texture coordinate attribute.\n * <p>\n * 32-bit floating-point. 2 components per attribute\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.st = options.st;\n\n /**\n * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.bitangent = options.bitangent;\n\n /**\n * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.tangent = options.tangent;\n\n /**\n * The color attribute.\n * <p>\n * 8-bit unsigned integer. 4 components per attribute.\n * </p>\n *\n * @type GeometryAttribute\n *\n * @default undefined\n */\n this.color = options.color;\n}\nexport default GeometryAttributes;\n", "/**\n * Represents which vertices should have a value of `true` for the `applyOffset` attribute\n * @private\n */\nconst GeometryOffsetAttribute = {\n NONE: 0,\n TOP: 1,\n ALL: 2,\n};\nexport default Object.freeze(GeometryOffsetAttribute);\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided\n * to a {@link Geometry} to request that certain properties be computed, e.g., just position,\n * position and normal, etc.\n *\n * @param {Object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.\n *\n * @alias VertexFormat\n * @constructor\n *\n * @example\n * // Create a vertex format with position and 2D texture coordinate attributes.\n * const format = new Cesium.VertexFormat({\n * position : true,\n * st : true\n * });\n *\n * @see Geometry#attributes\n * @see Packable\n */\nfunction VertexFormat(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * When <code>true</code>, the vertex has a 3D position attribute.\n * <p>\n * 64-bit floating-point (for precision). 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.position = defaultValue(options.position, false);\n\n /**\n * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.normal = defaultValue(options.normal, false);\n\n /**\n * When <code>true</code>, the vertex has a 2D texture coordinate attribute.\n * <p>\n * 32-bit floating-point. 2 components per attribute\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.st = defaultValue(options.st, false);\n\n /**\n * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.bitangent = defaultValue(options.bitangent, false);\n\n /**\n * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\n * <p>\n * 32-bit floating-point. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.tangent = defaultValue(options.tangent, false);\n\n /**\n * When <code>true</code>, the vertex has an RGB color attribute.\n * <p>\n * 8-bit unsigned byte. 3 components per attribute.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.color = defaultValue(options.color, false);\n}\n\n/**\n * An immutable vertex format with only a position attribute.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n */\nVertexFormat.POSITION_ONLY = Object.freeze(\n new VertexFormat({\n position: true,\n })\n);\n\n/**\n * An immutable vertex format with position and normal attributes.\n * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n */\nVertexFormat.POSITION_AND_NORMAL = Object.freeze(\n new VertexFormat({\n position: true,\n normal: true,\n })\n);\n\n/**\n * An immutable vertex format with position, normal, and st attributes.\n * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}\n * is <code>TEXTURED/code>.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n * @see VertexFormat#st\n */\nVertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(\n new VertexFormat({\n position: true,\n normal: true,\n st: true,\n })\n);\n\n/**\n * An immutable vertex format with position and st attributes.\n * This is compatible with {@link EllipsoidSurfaceAppearance}.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#st\n */\nVertexFormat.POSITION_AND_ST = Object.freeze(\n new VertexFormat({\n position: true,\n st: true,\n })\n);\n\n/**\n * An immutable vertex format with position and color attributes.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#color\n */\nVertexFormat.POSITION_AND_COLOR = Object.freeze(\n new VertexFormat({\n position: true,\n color: true,\n })\n);\n\n/**\n * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n * @see VertexFormat#st\n * @see VertexFormat#tangent\n * @see VertexFormat#bitangent\n */\nVertexFormat.ALL = Object.freeze(\n new VertexFormat({\n position: true,\n normal: true,\n st: true,\n tangent: true,\n bitangent: true,\n })\n);\n\n/**\n * An immutable vertex format with position, normal, and st attributes.\n * This is compatible with most appearances and materials; however\n * normal and st attributes are not always required. When this is\n * known in advance, another <code>VertexFormat</code> should be used.\n *\n * @type {VertexFormat}\n * @constant\n *\n * @see VertexFormat#position\n * @see VertexFormat#normal\n */\nVertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nVertexFormat.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {VertexFormat} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nVertexFormat.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.position ? 1.0 : 0.0;\n array[startingIndex++] = value.normal ? 1.0 : 0.0;\n array[startingIndex++] = value.st ? 1.0 : 0.0;\n array[startingIndex++] = value.tangent ? 1.0 : 0.0;\n array[startingIndex++] = value.bitangent ? 1.0 : 0.0;\n array[startingIndex] = value.color ? 1.0 : 0.0;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {VertexFormat} [result] The object into which to store the result.\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided.\n */\nVertexFormat.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new VertexFormat();\n }\n\n result.position = array[startingIndex++] === 1.0;\n result.normal = array[startingIndex++] === 1.0;\n result.st = array[startingIndex++] === 1.0;\n result.tangent = array[startingIndex++] === 1.0;\n result.bitangent = array[startingIndex++] === 1.0;\n result.color = array[startingIndex] === 1.0;\n return result;\n};\n\n/**\n * Duplicates a VertexFormat instance.\n *\n * @param {VertexFormat} vertexFormat The vertex format to duplicate.\n * @param {VertexFormat} [result] The object onto which to store the result.\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)\n */\nVertexFormat.clone = function (vertexFormat, result) {\n if (!defined(vertexFormat)) {\n return undefined;\n }\n if (!defined(result)) {\n result = new VertexFormat();\n }\n\n result.position = vertexFormat.position;\n result.normal = vertexFormat.normal;\n result.st = vertexFormat.st;\n result.tangent = vertexFormat.tangent;\n result.bitangent = vertexFormat.bitangent;\n result.color = vertexFormat.color;\n return result;\n};\nexport default VertexFormat;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst diffScratch = new Cartesian3();\n\n/**\n * Describes a cube centered at the origin.\n *\n * @alias BoxGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @see BoxGeometry.fromDimensions\n * @see BoxGeometry.createGeometry\n * @see Packable\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}\n *\n * @example\n * const box = new Cesium.BoxGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\n * });\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\n */\nfunction BoxGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const min = options.minimum;\n const max = options.maximum;\n\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n this._minimum = Cartesian3.clone(min);\n this._maximum = Cartesian3.clone(max);\n this._vertexFormat = vertexFormat;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createBoxGeometry\";\n}\n\n/**\n * Creates a cube centered at the origin given its dimensions.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @returns {BoxGeometry}\n *\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\n *\n *\n * @example\n * const box = Cesium.BoxGeometry.fromDimensions({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\n *\n * @see BoxGeometry.createGeometry\n */\nBoxGeometry.fromDimensions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const dimensions = options.dimensions;\n\n const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\n\n return new BoxGeometry({\n minimum: Cartesian3.negate(corner, new Cartesian3()),\n maximum: corner,\n vertexFormat: options.vertexFormat,\n offsetAttribute: options.offsetAttribute,\n });\n};\n\n/**\n * Creates a cube from the dimensions of an AxisAlignedBoundingBox.\n *\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\n * @returns {BoxGeometry}\n *\n *\n *\n * @example\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ]));\n * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);\n *\n * @see BoxGeometry.createGeometry\n */\nBoxGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\n return new BoxGeometry({\n minimum: boundingBox.minimum,\n maximum: boundingBox.maximum,\n });\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nBoxGeometry.packedLength =\n 2 * Cartesian3.packedLength + VertexFormat.packedLength + 1;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoxGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nBoxGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._minimum, array, startingIndex);\n Cartesian3.pack(\n value._maximum,\n array,\n startingIndex + Cartesian3.packedLength\n );\n VertexFormat.pack(\n value._vertexFormat,\n array,\n startingIndex + 2 * Cartesian3.packedLength\n );\n array[\n startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\n ] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n minimum: scratchMin,\n maximum: scratchMax,\n vertexFormat: scratchVertexFormat,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoxGeometry} [result] The object into which to store the result.\n * @returns {BoxGeometry} The modified result parameter or a new BoxGeometry instance if one was not provided.\n */\nBoxGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const min = Cartesian3.unpack(array, startingIndex, scratchMin);\n const max = Cartesian3.unpack(\n array,\n startingIndex + Cartesian3.packedLength,\n scratchMax\n );\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex + 2 * Cartesian3.packedLength,\n scratchVertexFormat\n );\n const offsetAttribute =\n array[\n startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\n ];\n\n if (!defined(result)) {\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new BoxGeometry(scratchOptions);\n }\n\n result._minimum = Cartesian3.clone(min, result._minimum);\n result._maximum = Cartesian3.clone(max, result._maximum);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.\n *\n * @param {BoxGeometry} boxGeometry A description of the box.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nBoxGeometry.createGeometry = function (boxGeometry) {\n const min = boxGeometry._minimum;\n const max = boxGeometry._maximum;\n const vertexFormat = boxGeometry._vertexFormat;\n\n if (Cartesian3.equals(min, max)) {\n return;\n }\n\n const attributes = new GeometryAttributes();\n let indices;\n let positions;\n\n if (\n vertexFormat.position &&\n (vertexFormat.st ||\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent)\n ) {\n if (vertexFormat.position) {\n // 8 corner points. Duplicated 3 times each for each incident edge/face.\n positions = new Float64Array(6 * 4 * 3);\n\n // +z face\n positions[0] = min.x;\n positions[1] = min.y;\n positions[2] = max.z;\n positions[3] = max.x;\n positions[4] = min.y;\n positions[5] = max.z;\n positions[6] = max.x;\n positions[7] = max.y;\n positions[8] = max.z;\n positions[9] = min.x;\n positions[10] = max.y;\n positions[11] = max.z;\n\n // -z face\n positions[12] = min.x;\n positions[13] = min.y;\n positions[14] = min.z;\n positions[15] = max.x;\n positions[16] = min.y;\n positions[17] = min.z;\n positions[18] = max.x;\n positions[19] = max.y;\n positions[20] = min.z;\n positions[21] = min.x;\n positions[22] = max.y;\n positions[23] = min.z;\n\n // +x face\n positions[24] = max.x;\n positions[25] = min.y;\n positions[26] = min.z;\n positions[27] = max.x;\n positions[28] = max.y;\n positions[29] = min.z;\n positions[30] = max.x;\n positions[31] = max.y;\n positions[32] = max.z;\n positions[33] = max.x;\n positions[34] = min.y;\n positions[35] = max.z;\n\n // -x face\n positions[36] = min.x;\n positions[37] = min.y;\n positions[38] = min.z;\n positions[39] = min.x;\n positions[40] = max.y;\n positions[41] = min.z;\n positions[42] = min.x;\n positions[43] = max.y;\n positions[44] = max.z;\n positions[45] = min.x;\n positions[46] = min.y;\n positions[47] = max.z;\n\n // +y face\n positions[48] = min.x;\n positions[49] = max.y;\n positions[50] = min.z;\n positions[51] = max.x;\n positions[52] = max.y;\n positions[53] = min.z;\n positions[54] = max.x;\n positions[55] = max.y;\n positions[56] = max.z;\n positions[57] = min.x;\n positions[58] = max.y;\n positions[59] = max.z;\n\n // -y face\n positions[60] = min.x;\n positions[61] = min.y;\n positions[62] = min.z;\n positions[63] = max.x;\n positions[64] = min.y;\n positions[65] = min.z;\n positions[66] = max.x;\n positions[67] = min.y;\n positions[68] = max.z;\n positions[69] = min.x;\n positions[70] = min.y;\n positions[71] = max.z;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n }\n\n if (vertexFormat.normal) {\n const normals = new Float32Array(6 * 4 * 3);\n\n // +z face\n normals[0] = 0.0;\n normals[1] = 0.0;\n normals[2] = 1.0;\n normals[3] = 0.0;\n normals[4] = 0.0;\n normals[5] = 1.0;\n normals[6] = 0.0;\n normals[7] = 0.0;\n normals[8] = 1.0;\n normals[9] = 0.0;\n normals[10] = 0.0;\n normals[11] = 1.0;\n\n // -z face\n normals[12] = 0.0;\n normals[13] = 0.0;\n normals[14] = -1.0;\n normals[15] = 0.0;\n normals[16] = 0.0;\n normals[17] = -1.0;\n normals[18] = 0.0;\n normals[19] = 0.0;\n normals[20] = -1.0;\n normals[21] = 0.0;\n normals[22] = 0.0;\n normals[23] = -1.0;\n\n // +x face\n normals[24] = 1.0;\n normals[25] = 0.0;\n normals[26] = 0.0;\n normals[27] = 1.0;\n normals[28] = 0.0;\n normals[29] = 0.0;\n normals[30] = 1.0;\n normals[31] = 0.0;\n normals[32] = 0.0;\n normals[33] = 1.0;\n normals[34] = 0.0;\n normals[35] = 0.0;\n\n // -x face\n normals[36] = -1.0;\n normals[37] = 0.0;\n normals[38] = 0.0;\n normals[39] = -1.0;\n normals[40] = 0.0;\n normals[41] = 0.0;\n normals[42] = -1.0;\n normals[43] = 0.0;\n normals[44] = 0.0;\n normals[45] = -1.0;\n normals[46] = 0.0;\n normals[47] = 0.0;\n\n // +y face\n normals[48] = 0.0;\n normals[49] = 1.0;\n normals[50] = 0.0;\n normals[51] = 0.0;\n normals[52] = 1.0;\n normals[53] = 0.0;\n normals[54] = 0.0;\n normals[55] = 1.0;\n normals[56] = 0.0;\n normals[57] = 0.0;\n normals[58] = 1.0;\n normals[59] = 0.0;\n\n // -y face\n normals[60] = 0.0;\n normals[61] = -1.0;\n normals[62] = 0.0;\n normals[63] = 0.0;\n normals[64] = -1.0;\n normals[65] = 0.0;\n normals[66] = 0.0;\n normals[67] = -1.0;\n normals[68] = 0.0;\n normals[69] = 0.0;\n normals[70] = -1.0;\n normals[71] = 0.0;\n\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.st) {\n const texCoords = new Float32Array(6 * 4 * 2);\n\n // +z face\n texCoords[0] = 0.0;\n texCoords[1] = 0.0;\n texCoords[2] = 1.0;\n texCoords[3] = 0.0;\n texCoords[4] = 1.0;\n texCoords[5] = 1.0;\n texCoords[6] = 0.0;\n texCoords[7] = 1.0;\n\n // -z face\n texCoords[8] = 1.0;\n texCoords[9] = 0.0;\n texCoords[10] = 0.0;\n texCoords[11] = 0.0;\n texCoords[12] = 0.0;\n texCoords[13] = 1.0;\n texCoords[14] = 1.0;\n texCoords[15] = 1.0;\n\n //+x face\n texCoords[16] = 0.0;\n texCoords[17] = 0.0;\n texCoords[18] = 1.0;\n texCoords[19] = 0.0;\n texCoords[20] = 1.0;\n texCoords[21] = 1.0;\n texCoords[22] = 0.0;\n texCoords[23] = 1.0;\n\n // -x face\n texCoords[24] = 1.0;\n texCoords[25] = 0.0;\n texCoords[26] = 0.0;\n texCoords[27] = 0.0;\n texCoords[28] = 0.0;\n texCoords[29] = 1.0;\n texCoords[30] = 1.0;\n texCoords[31] = 1.0;\n\n // +y face\n texCoords[32] = 1.0;\n texCoords[33] = 0.0;\n texCoords[34] = 0.0;\n texCoords[35] = 0.0;\n texCoords[36] = 0.0;\n texCoords[37] = 1.0;\n texCoords[38] = 1.0;\n texCoords[39] = 1.0;\n\n // -y face\n texCoords[40] = 0.0;\n texCoords[41] = 0.0;\n texCoords[42] = 1.0;\n texCoords[43] = 0.0;\n texCoords[44] = 1.0;\n texCoords[45] = 1.0;\n texCoords[46] = 0.0;\n texCoords[47] = 1.0;\n\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: texCoords,\n });\n }\n\n if (vertexFormat.tangent) {\n const tangents = new Float32Array(6 * 4 * 3);\n\n // +z face\n tangents[0] = 1.0;\n tangents[1] = 0.0;\n tangents[2] = 0.0;\n tangents[3] = 1.0;\n tangents[4] = 0.0;\n tangents[5] = 0.0;\n tangents[6] = 1.0;\n tangents[7] = 0.0;\n tangents[8] = 0.0;\n tangents[9] = 1.0;\n tangents[10] = 0.0;\n tangents[11] = 0.0;\n\n // -z face\n tangents[12] = -1.0;\n tangents[13] = 0.0;\n tangents[14] = 0.0;\n tangents[15] = -1.0;\n tangents[16] = 0.0;\n tangents[17] = 0.0;\n tangents[18] = -1.0;\n tangents[19] = 0.0;\n tangents[20] = 0.0;\n tangents[21] = -1.0;\n tangents[22] = 0.0;\n tangents[23] = 0.0;\n\n // +x face\n tangents[24] = 0.0;\n tangents[25] = 1.0;\n tangents[26] = 0.0;\n tangents[27] = 0.0;\n tangents[28] = 1.0;\n tangents[29] = 0.0;\n tangents[30] = 0.0;\n tangents[31] = 1.0;\n tangents[32] = 0.0;\n tangents[33] = 0.0;\n tangents[34] = 1.0;\n tangents[35] = 0.0;\n\n // -x face\n tangents[36] = 0.0;\n tangents[37] = -1.0;\n tangents[38] = 0.0;\n tangents[39] = 0.0;\n tangents[40] = -1.0;\n tangents[41] = 0.0;\n tangents[42] = 0.0;\n tangents[43] = -1.0;\n tangents[44] = 0.0;\n tangents[45] = 0.0;\n tangents[46] = -1.0;\n tangents[47] = 0.0;\n\n // +y face\n tangents[48] = -1.0;\n tangents[49] = 0.0;\n tangents[50] = 0.0;\n tangents[51] = -1.0;\n tangents[52] = 0.0;\n tangents[53] = 0.0;\n tangents[54] = -1.0;\n tangents[55] = 0.0;\n tangents[56] = 0.0;\n tangents[57] = -1.0;\n tangents[58] = 0.0;\n tangents[59] = 0.0;\n\n // -y face\n tangents[60] = 1.0;\n tangents[61] = 0.0;\n tangents[62] = 0.0;\n tangents[63] = 1.0;\n tangents[64] = 0.0;\n tangents[65] = 0.0;\n tangents[66] = 1.0;\n tangents[67] = 0.0;\n tangents[68] = 0.0;\n tangents[69] = 1.0;\n tangents[70] = 0.0;\n tangents[71] = 0.0;\n\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n const bitangents = new Float32Array(6 * 4 * 3);\n\n // +z face\n bitangents[0] = 0.0;\n bitangents[1] = 1.0;\n bitangents[2] = 0.0;\n bitangents[3] = 0.0;\n bitangents[4] = 1.0;\n bitangents[5] = 0.0;\n bitangents[6] = 0.0;\n bitangents[7] = 1.0;\n bitangents[8] = 0.0;\n bitangents[9] = 0.0;\n bitangents[10] = 1.0;\n bitangents[11] = 0.0;\n\n // -z face\n bitangents[12] = 0.0;\n bitangents[13] = 1.0;\n bitangents[14] = 0.0;\n bitangents[15] = 0.0;\n bitangents[16] = 1.0;\n bitangents[17] = 0.0;\n bitangents[18] = 0.0;\n bitangents[19] = 1.0;\n bitangents[20] = 0.0;\n bitangents[21] = 0.0;\n bitangents[22] = 1.0;\n bitangents[23] = 0.0;\n\n // +x face\n bitangents[24] = 0.0;\n bitangents[25] = 0.0;\n bitangents[26] = 1.0;\n bitangents[27] = 0.0;\n bitangents[28] = 0.0;\n bitangents[29] = 1.0;\n bitangents[30] = 0.0;\n bitangents[31] = 0.0;\n bitangents[32] = 1.0;\n bitangents[33] = 0.0;\n bitangents[34] = 0.0;\n bitangents[35] = 1.0;\n\n // -x face\n bitangents[36] = 0.0;\n bitangents[37] = 0.0;\n bitangents[38] = 1.0;\n bitangents[39] = 0.0;\n bitangents[40] = 0.0;\n bitangents[41] = 1.0;\n bitangents[42] = 0.0;\n bitangents[43] = 0.0;\n bitangents[44] = 1.0;\n bitangents[45] = 0.0;\n bitangents[46] = 0.0;\n bitangents[47] = 1.0;\n\n // +y face\n bitangents[48] = 0.0;\n bitangents[49] = 0.0;\n bitangents[50] = 1.0;\n bitangents[51] = 0.0;\n bitangents[52] = 0.0;\n bitangents[53] = 1.0;\n bitangents[54] = 0.0;\n bitangents[55] = 0.0;\n bitangents[56] = 1.0;\n bitangents[57] = 0.0;\n bitangents[58] = 0.0;\n bitangents[59] = 1.0;\n\n // -y face\n bitangents[60] = 0.0;\n bitangents[61] = 0.0;\n bitangents[62] = 1.0;\n bitangents[63] = 0.0;\n bitangents[64] = 0.0;\n bitangents[65] = 1.0;\n bitangents[66] = 0.0;\n bitangents[67] = 0.0;\n bitangents[68] = 1.0;\n bitangents[69] = 0.0;\n bitangents[70] = 0.0;\n bitangents[71] = 1.0;\n\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n // 12 triangles: 6 faces, 2 triangles each.\n indices = new Uint16Array(6 * 2 * 3);\n\n // +z face\n indices[0] = 0;\n indices[1] = 1;\n indices[2] = 2;\n indices[3] = 0;\n indices[4] = 2;\n indices[5] = 3;\n\n // -z face\n indices[6] = 4 + 2;\n indices[7] = 4 + 1;\n indices[8] = 4 + 0;\n indices[9] = 4 + 3;\n indices[10] = 4 + 2;\n indices[11] = 4 + 0;\n\n // +x face\n indices[12] = 8 + 0;\n indices[13] = 8 + 1;\n indices[14] = 8 + 2;\n indices[15] = 8 + 0;\n indices[16] = 8 + 2;\n indices[17] = 8 + 3;\n\n // -x face\n indices[18] = 12 + 2;\n indices[19] = 12 + 1;\n indices[20] = 12 + 0;\n indices[21] = 12 + 3;\n indices[22] = 12 + 2;\n indices[23] = 12 + 0;\n\n // +y face\n indices[24] = 16 + 2;\n indices[25] = 16 + 1;\n indices[26] = 16 + 0;\n indices[27] = 16 + 3;\n indices[28] = 16 + 2;\n indices[29] = 16 + 0;\n\n // -y face\n indices[30] = 20 + 0;\n indices[31] = 20 + 1;\n indices[32] = 20 + 2;\n indices[33] = 20 + 0;\n indices[34] = 20 + 2;\n indices[35] = 20 + 3;\n } else {\n // Positions only - no need to duplicate corner points\n positions = new Float64Array(8 * 3);\n\n positions[0] = min.x;\n positions[1] = min.y;\n positions[2] = min.z;\n positions[3] = max.x;\n positions[4] = min.y;\n positions[5] = min.z;\n positions[6] = max.x;\n positions[7] = max.y;\n positions[8] = min.z;\n positions[9] = min.x;\n positions[10] = max.y;\n positions[11] = min.z;\n positions[12] = min.x;\n positions[13] = min.y;\n positions[14] = max.z;\n positions[15] = max.x;\n positions[16] = min.y;\n positions[17] = max.z;\n positions[18] = max.x;\n positions[19] = max.y;\n positions[20] = max.z;\n positions[21] = min.x;\n positions[22] = max.y;\n positions[23] = max.z;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n // 12 triangles: 6 faces, 2 triangles each.\n indices = new Uint16Array(6 * 2 * 3);\n\n // plane z = corner.Z\n indices[0] = 4;\n indices[1] = 5;\n indices[2] = 6;\n indices[3] = 4;\n indices[4] = 6;\n indices[5] = 7;\n\n // plane z = -corner.Z\n indices[6] = 1;\n indices[7] = 0;\n indices[8] = 3;\n indices[9] = 1;\n indices[10] = 3;\n indices[11] = 2;\n\n // plane x = corner.X\n indices[12] = 1;\n indices[13] = 6;\n indices[14] = 5;\n indices[15] = 1;\n indices[16] = 2;\n indices[17] = 6;\n\n // plane y = corner.Y\n indices[18] = 2;\n indices[19] = 3;\n indices[20] = 7;\n indices[21] = 2;\n indices[22] = 7;\n indices[23] = 6;\n\n // plane x = -corner.X\n indices[24] = 3;\n indices[25] = 0;\n indices[26] = 4;\n indices[27] = 3;\n indices[28] = 4;\n indices[29] = 7;\n\n // plane y = -corner.Y\n indices[30] = 0;\n indices[31] = 1;\n indices[32] = 5;\n indices[33] = 0;\n indices[34] = 5;\n indices[35] = 4;\n }\n\n const diff = Cartesian3.subtract(max, min, diffScratch);\n const radius = Cartesian3.magnitude(diff) * 0.5;\n\n if (defined(boxGeometry._offsetAttribute)) {\n const length = positions.length;\n const offsetValue =\n boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\n offsetAttribute: boxGeometry._offsetAttribute,\n });\n};\n\nlet unitBoxGeometry;\n\n/**\n * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nBoxGeometry.getUnitBox = function () {\n if (!defined(unitBoxGeometry)) {\n unitBoxGeometry = BoxGeometry.createGeometry(\n BoxGeometry.fromDimensions({\n dimensions: new Cartesian3(1.0, 1.0, 1.0),\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n }\n return unitBoxGeometry;\n};\nexport default BoxGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst diffScratch = new Cartesian3();\n\n/**\n * A description of the outline of a cube centered at the origin.\n *\n * @alias BoxOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\n *\n * @see BoxOutlineGeometry.fromDimensions\n * @see BoxOutlineGeometry.createGeometry\n * @see Packable\n *\n * @example\n * const box = new Cesium.BoxOutlineGeometry({\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\n * });\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\n */\nfunction BoxOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const min = options.minimum;\n const max = options.maximum;\n\n this._min = Cartesian3.clone(min);\n this._max = Cartesian3.clone(max);\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createBoxOutlineGeometry\";\n}\n\n/**\n * Creates an outline of a cube centered at the origin given its dimensions.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.\n * @returns {BoxOutlineGeometry}\n *\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\n *\n *\n * @example\n * const box = Cesium.BoxOutlineGeometry.fromDimensions({\n * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\n *\n * @see BoxOutlineGeometry.createGeometry\n */\nBoxOutlineGeometry.fromDimensions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const dimensions = options.dimensions;\n\n const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\n\n return new BoxOutlineGeometry({\n minimum: Cartesian3.negate(corner, new Cartesian3()),\n maximum: corner,\n offsetAttribute: options.offsetAttribute,\n });\n};\n\n/**\n * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.\n *\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\n * @returns {BoxOutlineGeometry}\n *\n *\n *\n * @example\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ]));\n * const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);\n *\n * @see BoxOutlineGeometry.createGeometry\n */\nBoxOutlineGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\n return new BoxOutlineGeometry({\n minimum: boundingBox.minimum,\n maximum: boundingBox.maximum,\n });\n};\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nBoxOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 1;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {BoxOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nBoxOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._min, array, startingIndex);\n Cartesian3.pack(value._max, array, startingIndex + Cartesian3.packedLength);\n array[startingIndex + Cartesian3.packedLength * 2] = defaultValue(\n value._offsetAttribute,\n -1\n );\n\n return array;\n};\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchOptions = {\n minimum: scratchMin,\n maximum: scratchMax,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {BoxOutlineGeometry} [result] The object into which to store the result.\n * @returns {BoxOutlineGeometry} The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.\n */\nBoxOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const min = Cartesian3.unpack(array, startingIndex, scratchMin);\n const max = Cartesian3.unpack(\n array,\n startingIndex + Cartesian3.packedLength,\n scratchMax\n );\n const offsetAttribute = array[startingIndex + Cartesian3.packedLength * 2];\n\n if (!defined(result)) {\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new BoxOutlineGeometry(scratchOptions);\n }\n\n result._min = Cartesian3.clone(min, result._min);\n result._max = Cartesian3.clone(max, result._max);\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.\n *\n * @param {BoxOutlineGeometry} boxGeometry A description of the box outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nBoxOutlineGeometry.createGeometry = function (boxGeometry) {\n const min = boxGeometry._min;\n const max = boxGeometry._max;\n\n if (Cartesian3.equals(min, max)) {\n return;\n }\n\n const attributes = new GeometryAttributes();\n const indices = new Uint16Array(12 * 2);\n const positions = new Float64Array(8 * 3);\n\n positions[0] = min.x;\n positions[1] = min.y;\n positions[2] = min.z;\n positions[3] = max.x;\n positions[4] = min.y;\n positions[5] = min.z;\n positions[6] = max.x;\n positions[7] = max.y;\n positions[8] = min.z;\n positions[9] = min.x;\n positions[10] = max.y;\n positions[11] = min.z;\n\n positions[12] = min.x;\n positions[13] = min.y;\n positions[14] = max.z;\n positions[15] = max.x;\n positions[16] = min.y;\n positions[17] = max.z;\n positions[18] = max.x;\n positions[19] = max.y;\n positions[20] = max.z;\n positions[21] = min.x;\n positions[22] = max.y;\n positions[23] = max.z;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n // top\n indices[0] = 4;\n indices[1] = 5;\n indices[2] = 5;\n indices[3] = 6;\n indices[4] = 6;\n indices[5] = 7;\n indices[6] = 7;\n indices[7] = 4;\n\n // bottom\n indices[8] = 0;\n indices[9] = 1;\n indices[10] = 1;\n indices[11] = 2;\n indices[12] = 2;\n indices[13] = 3;\n indices[14] = 3;\n indices[15] = 0;\n\n // left\n indices[16] = 0;\n indices[17] = 4;\n indices[18] = 1;\n indices[19] = 5;\n\n //right\n indices[20] = 2;\n indices[21] = 6;\n indices[22] = 3;\n indices[23] = 7;\n\n const diff = Cartesian3.subtract(max, min, diffScratch);\n const radius = Cartesian3.magnitude(diff) * 0.5;\n\n if (defined(boxGeometry._offsetAttribute)) {\n const length = positions.length;\n const offsetValue =\n boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\n offsetAttribute: boxGeometry._offsetAttribute,\n });\n};\nexport default BoxOutlineGeometry;\n", "import Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry color.\n *\n * @alias ColorGeometryInstanceAttribute\n * @constructor\n *\n * @param {Number} [red=1.0] The red component.\n * @param {Number} [green=1.0] The green component.\n * @param {Number} [blue=1.0] The blue component.\n * @param {Number} [alpha=1.0] The alpha component.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n * geometry : Cesium.BoxGeometry.fromDimensions({\n * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n * }),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n * id : 'box',\n * attributes : {\n * color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)\n * }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction ColorGeometryInstanceAttribute(red, green, blue, alpha) {\n red = defaultValue(red, 1.0);\n green = defaultValue(green, 1.0);\n blue = defaultValue(blue, 1.0);\n alpha = defaultValue(alpha, 1.0);\n\n /**\n * The values for the attributes stored in a typed array.\n *\n * @type Uint8Array\n *\n * @default [255, 255, 255, 255]\n */\n this.value = new Uint8Array([\n Color.floatToByte(red),\n Color.floatToByte(green),\n Color.floatToByte(blue),\n Color.floatToByte(alpha),\n ]);\n}\n\nObject.defineProperties(ColorGeometryInstanceAttribute.prototype, {\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link ColorGeometryInstanceAttribute#value}.\n *\n * @memberof ColorGeometryInstanceAttribute.prototype\n *\n * @type {ComponentDatatype}\n * @readonly\n *\n * @default {@link ComponentDatatype.UNSIGNED_BYTE}\n */\n componentDatatype: {\n get: function () {\n return ComponentDatatype.UNSIGNED_BYTE;\n },\n },\n\n /**\n * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.\n *\n * @memberof ColorGeometryInstanceAttribute.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 4\n */\n componentsPerAttribute: {\n get: function () {\n return 4;\n },\n },\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n *\n * @memberof ColorGeometryInstanceAttribute.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n normalize: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.\n *\n * @param {Color} color The color.\n * @returns {ColorGeometryInstanceAttribute} The new {@link ColorGeometryInstanceAttribute} instance.\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n * geometry : geometry,\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),\n * }\n * });\n */\nColorGeometryInstanceAttribute.fromColor = function (color) {\n return new ColorGeometryInstanceAttribute(\n color.red,\n color.green,\n color.blue,\n color.alpha\n );\n};\n\n/**\n * Converts a color to a typed array that can be used to assign a color attribute.\n *\n * @param {Color} color The color.\n * @param {Uint8Array} [result] The array to store the result in, if undefined a new instance will be created.\n *\n * @returns {Uint8Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);\n */\nColorGeometryInstanceAttribute.toValue = function (color, result) {\n if (!defined(result)) {\n return new Uint8Array(color.toBytes());\n }\n return color.toBytes(result);\n};\n\n/**\n * Compares the provided ColorGeometryInstanceAttributes and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {ColorGeometryInstanceAttribute} [left] The first ColorGeometryInstanceAttribute.\n * @param {ColorGeometryInstanceAttribute} [right] The second ColorGeometryInstanceAttribute.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nColorGeometryInstanceAttribute.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.value[0] === right.value[0] &&\n left.value[1] === right.value[1] &&\n left.value[2] === right.value[2] &&\n left.value[3] === right.value[3])\n );\n};\nexport default ColorGeometryInstanceAttribute;\n", "import ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.\n *\n * @alias DistanceDisplayConditionGeometryInstanceAttribute\n * @constructor\n *\n * @param {Number} [near=0.0] The near distance.\n * @param {Number} [far=Number.MAX_VALUE] The far distance.\n *\n * @exception {DeveloperError} far must be greater than near.\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n * geometry : new Cesium.BoxGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)\n * }),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n * id : 'box',\n * attributes : {\n * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)\n * }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction DistanceDisplayConditionGeometryInstanceAttribute(near, far) {\n near = defaultValue(near, 0.0);\n far = defaultValue(far, Number.MAX_VALUE);\n\n /**\n * The values for the attributes stored in a typed array.\n *\n * @type Float32Array\n *\n * @default [0.0, 0.0, Number.MAX_VALUE]\n */\n this.value = new Float32Array([near, far]);\n}\n\nObject.defineProperties(\n DistanceDisplayConditionGeometryInstanceAttribute.prototype,\n {\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.\n *\n * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n *\n * @type {ComponentDatatype}\n * @readonly\n *\n * @default {@link ComponentDatatype.FLOAT}\n */\n componentDatatype: {\n get: function () {\n return ComponentDatatype.FLOAT;\n },\n },\n\n /**\n * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.\n *\n * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 3\n */\n componentsPerAttribute: {\n get: function () {\n return 2;\n },\n },\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n *\n * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n normalize: {\n get: function () {\n return false;\n },\n },\n }\n);\n\n/**\n * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\n *\n * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition.\n * @returns {DistanceDisplayConditionGeometryInstanceAttribute} The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.\n *\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @example\n * const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);\n * const instance = new Cesium.GeometryInstance({\n * geometry : geometry,\n * attributes : {\n * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)\n * }\n * });\n */\nDistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = function (\n distanceDisplayCondition\n) {\n return new DistanceDisplayConditionGeometryInstanceAttribute(\n distanceDisplayCondition.near,\n distanceDisplayCondition.far\n );\n};\n\n/**\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\n *\n * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition value.\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);\n */\nDistanceDisplayConditionGeometryInstanceAttribute.toValue = function (\n distanceDisplayCondition,\n result\n) {\n if (!defined(result)) {\n return new Float32Array([\n distanceDisplayCondition.near,\n distanceDisplayCondition.far,\n ]);\n }\n result[0] = distanceDisplayCondition.near;\n result[1] = distanceDisplayCondition.far;\n return result;\n};\nexport default DistanceDisplayConditionGeometryInstanceAttribute;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * Geometry instancing allows one {@link Geometry} object to be positions in several\n * different locations and colored uniquely. For example, one {@link BoxGeometry} can\n * be instanced several times, each with a different <code>modelMatrix</code> to change\n * its position, rotation, and scale.\n *\n * @alias GeometryInstance\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Geometry|GeometryFactory} options.geometry The geometry to instance.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.\n * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.\n * @param {Object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.\n *\n *\n * @example\n * // Create geometry for a box, and two instances that refer to it.\n * // One instance positions the box on the bottom and colored aqua.\n * // The other instance positions the box on the top and color white.\n * const geometry = Cesium.BoxGeometry.fromDimensions({\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n * });\n * const instanceBottom = new Cesium.GeometryInstance({\n * geometry : geometry,\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n * },\n * id : 'bottom'\n * });\n * const instanceTop = new Cesium.GeometryInstance({\n * geometry : geometry,\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n * },\n * id : 'top'\n * });\n *\n * @see Geometry\n */\nfunction GeometryInstance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The geometry being instanced.\n *\n * @type Geometry\n *\n * @default undefined\n */\n this.geometry = options.geometry;\n\n /**\n * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.\n * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type Matrix4\n *\n * @default Matrix4.IDENTITY\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n\n /**\n * User-defined object returned when the instance is picked or used to get/set per-instance attributes.\n *\n * @type Object\n *\n * @default undefined\n *\n * @see Scene#pick\n * @see Primitive#getGeometryInstanceAttributes\n */\n this.id = options.id;\n\n /**\n * Used for picking primitives that wrap geometry instances.\n *\n * @private\n */\n this.pickPrimitive = options.pickPrimitive;\n\n /**\n * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.\n * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.\n *\n * @type Object\n *\n * @default undefined\n */\n this.attributes = defaultValue(options.attributes, {});\n\n /**\n * @private\n */\n this.westHemisphereGeometry = undefined;\n /**\n * @private\n */\n this.eastHemisphereGeometry = undefined;\n}\nexport default GeometryInstance;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * An interval defined by a start and a stop time; optionally including those times as part of the interval.\n * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.\n *\n * @alias TimeInterval\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {JulianDate} [options.start=new JulianDate()] The start time of the interval.\n * @param {JulianDate} [options.stop=new JulianDate()] The stop time of the interval.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @param {Object} [options.data] Arbitrary data associated with this interval.\n *\n * @example\n * // Create an instance that spans August 1st, 1980 and is associated\n * // with a Cartesian position.\n * const timeInterval = new Cesium.TimeInterval({\n * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),\n * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),\n * isStartIncluded : true,\n * isStopIncluded : false,\n * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)\n * });\n *\n * @example\n * // Create two instances from ISO 8601 intervals with associated numeric data\n * // then compute their intersection, summing the data they contain.\n * const left = Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2000/2010',\n * data : 2\n * });\n *\n * const right = Cesium.TimeInterval.fromIso8601({\n * iso8601 : '1995/2005',\n * data : 3\n * });\n *\n * //The result of the below intersection will be an interval equivalent to\n * //const intersection = Cesium.TimeInterval.fromIso8601({\n * // iso8601 : '2000/2005',\n * // data : 5\n * //});\n * const intersection = new Cesium.TimeInterval();\n * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {\n * return leftData + rightData;\n * });\n *\n * @example\n * // Check if an interval contains a specific time.\n * const dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');\n * const containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);\n */\nfunction TimeInterval(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n /**\n * Gets or sets the start time of this interval.\n * @type {JulianDate}\n */\n this.start = defined(options.start)\n ? JulianDate.clone(options.start)\n : new JulianDate();\n\n /**\n * Gets or sets the stop time of this interval.\n * @type {JulianDate}\n */\n this.stop = defined(options.stop)\n ? JulianDate.clone(options.stop)\n : new JulianDate();\n\n /**\n * Gets or sets the data associated with this interval.\n * @type {*}\n */\n this.data = options.data;\n\n /**\n * Gets or sets whether or not the start time is included in this interval.\n * @type {Boolean}\n * @default true\n */\n this.isStartIncluded = defaultValue(options.isStartIncluded, true);\n\n /**\n * Gets or sets whether or not the stop time is included in this interval.\n * @type {Boolean}\n * @default true\n */\n this.isStopIncluded = defaultValue(options.isStopIncluded, true);\n}\n\nObject.defineProperties(TimeInterval.prototype, {\n /**\n * Gets whether or not this interval is empty.\n * @memberof TimeInterval.prototype\n * @type {Boolean}\n * @readonly\n */\n isEmpty: {\n get: function () {\n const stopComparedToStart = JulianDate.compare(this.stop, this.start);\n return (\n stopComparedToStart < 0 ||\n (stopComparedToStart === 0 &&\n (!this.isStartIncluded || !this.isStopIncluded))\n );\n },\n },\n});\n\nconst scratchInterval = {\n start: undefined,\n stop: undefined,\n isStartIncluded: undefined,\n isStopIncluded: undefined,\n data: undefined,\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.\n *\n * @throws DeveloperError if options.iso8601 does not match proper formatting.\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.iso8601 An ISO 8601 interval.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @param {Object} [options.data] Arbitrary data associated with this interval.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.fromIso8601 = function (options, result) {\n const dates = options.iso8601.split(\"/\");\n if (dates.length !== 2) {\n throw new DeveloperError(\n \"options.iso8601 is an invalid ISO 8601 interval.\"\n );\n }\n const start = JulianDate.fromIso8601(dates[0]);\n const stop = JulianDate.fromIso8601(dates[1]);\n const isStartIncluded = defaultValue(options.isStartIncluded, true);\n const isStopIncluded = defaultValue(options.isStopIncluded, true);\n const data = options.data;\n\n if (!defined(result)) {\n scratchInterval.start = start;\n scratchInterval.stop = stop;\n scratchInterval.isStartIncluded = isStartIncluded;\n scratchInterval.isStopIncluded = isStopIncluded;\n scratchInterval.data = data;\n return new TimeInterval(scratchInterval);\n }\n\n result.start = start;\n result.stop = stop;\n result.isStartIncluded = isStartIncluded;\n result.isStopIncluded = isStopIncluded;\n result.data = data;\n return result;\n};\n\n/**\n * Creates an ISO8601 representation of the provided interval.\n *\n * @param {TimeInterval} timeInterval The interval to be converted.\n * @param {Number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\n * @returns {String} The ISO8601 representation of the provided interval.\n */\nTimeInterval.toIso8601 = function (timeInterval, precision) {\n return `${JulianDate.toIso8601(\n timeInterval.start,\n precision\n )}/${JulianDate.toIso8601(timeInterval.stop, precision)}`;\n};\n\n/**\n * Duplicates the provided instance.\n *\n * @param {TimeInterval} [timeInterval] The instance to clone.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.clone = function (timeInterval, result) {\n if (!defined(timeInterval)) {\n return undefined;\n }\n if (!defined(result)) {\n return new TimeInterval(timeInterval);\n }\n result.start = timeInterval.start;\n result.stop = timeInterval.stop;\n result.isStartIncluded = timeInterval.isStartIncluded;\n result.isStopIncluded = timeInterval.isStopIncluded;\n result.data = timeInterval.data;\n return result;\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeInterval} [left] The first instance.\n * @param {TimeInterval} [right] The second instance.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @returns {Boolean} <code>true</code> if the dates are equal; otherwise, <code>false</code>.\n */\nTimeInterval.equals = function (left, right, dataComparer) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n ((left.isEmpty && right.isEmpty) ||\n (left.isStartIncluded === right.isStartIncluded &&\n left.isStopIncluded === right.isStopIncluded &&\n JulianDate.equals(left.start, right.start) &&\n JulianDate.equals(left.stop, right.stop) &&\n (left.data === right.data ||\n (defined(dataComparer) && dataComparer(left.data, right.data))))))\n );\n};\n\n/**\n * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of\n * each other. That is, in order for the dates to be considered equal (and for\n * this function to return <code>true</code>), the absolute value of the difference between them, in\n * seconds, must be less than <code>epsilon</code>.\n *\n * @param {TimeInterval} [left] The first instance.\n * @param {TimeInterval} [right] The second instance.\n * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @returns {Boolean} <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.\n */\nTimeInterval.equalsEpsilon = function (left, right, epsilon, dataComparer) {\n epsilon = defaultValue(epsilon, 0);\n\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n ((left.isEmpty && right.isEmpty) ||\n (left.isStartIncluded === right.isStartIncluded &&\n left.isStopIncluded === right.isStopIncluded &&\n JulianDate.equalsEpsilon(left.start, right.start, epsilon) &&\n JulianDate.equalsEpsilon(left.stop, right.stop, epsilon) &&\n (left.data === right.data ||\n (defined(dataComparer) && dataComparer(left.data, right.data))))))\n );\n};\n\n/**\n * Computes the intersection of two intervals, optionally merging their data.\n *\n * @param {TimeInterval} left The first interval.\n * @param {TimeInterval} [right] The second interval.\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.\n * @returns {TimeInterval} The modified result parameter.\n */\nTimeInterval.intersect = function (left, right, result, mergeCallback) {\n if (!defined(right)) {\n return TimeInterval.clone(TimeInterval.EMPTY, result);\n }\n\n const leftStart = left.start;\n const leftStop = left.stop;\n\n const rightStart = right.start;\n const rightStop = right.stop;\n\n const intersectsStartRight =\n JulianDate.greaterThanOrEquals(rightStart, leftStart) &&\n JulianDate.greaterThanOrEquals(leftStop, rightStart);\n const intersectsStartLeft =\n !intersectsStartRight &&\n JulianDate.lessThanOrEquals(rightStart, leftStart) &&\n JulianDate.lessThanOrEquals(leftStart, rightStop);\n\n if (!intersectsStartRight && !intersectsStartLeft) {\n return TimeInterval.clone(TimeInterval.EMPTY, result);\n }\n\n const leftIsStartIncluded = left.isStartIncluded;\n const leftIsStopIncluded = left.isStopIncluded;\n const rightIsStartIncluded = right.isStartIncluded;\n const rightIsStopIncluded = right.isStopIncluded;\n const leftLessThanRight = JulianDate.lessThan(leftStop, rightStop);\n\n if (!defined(result)) {\n result = new TimeInterval();\n }\n\n result.start = intersectsStartRight ? rightStart : leftStart;\n result.isStartIncluded =\n (leftIsStartIncluded && rightIsStartIncluded) ||\n (!JulianDate.equals(rightStart, leftStart) &&\n ((intersectsStartRight && rightIsStartIncluded) ||\n (intersectsStartLeft && leftIsStartIncluded)));\n result.stop = leftLessThanRight ? leftStop : rightStop;\n result.isStopIncluded = leftLessThanRight\n ? leftIsStopIncluded\n : (leftIsStopIncluded && rightIsStopIncluded) ||\n (!JulianDate.equals(rightStop, leftStop) && rightIsStopIncluded);\n result.data = defined(mergeCallback)\n ? mergeCallback(left.data, right.data)\n : left.data;\n return result;\n};\n\n/**\n * Checks if the specified date is inside the provided interval.\n *\n * @param {TimeInterval} timeInterval The interval.\n * @param {JulianDate} julianDate The date to check.\n * @returns {Boolean} <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.\n */\nTimeInterval.contains = function (timeInterval, julianDate) {\n if (timeInterval.isEmpty) {\n return false;\n }\n\n const startComparedToDate = JulianDate.compare(\n timeInterval.start,\n julianDate\n );\n if (startComparedToDate === 0) {\n return timeInterval.isStartIncluded;\n }\n\n const dateComparedToStop = JulianDate.compare(julianDate, timeInterval.stop);\n if (dateComparedToStop === 0) {\n return timeInterval.isStopIncluded;\n }\n\n return startComparedToDate < 0 && dateComparedToStop < 0;\n};\n\n/**\n * Duplicates this instance.\n *\n * @param {TimeInterval} [result] An existing instance to use for the result.\n * @returns {TimeInterval} The modified result parameter or a new instance if none was provided.\n */\nTimeInterval.prototype.clone = function (result) {\n return TimeInterval.clone(this, result);\n};\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeInterval} [right] The right hand side interval.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTimeInterval.prototype.equals = function (right, dataComparer) {\n return TimeInterval.equals(this, right, dataComparer);\n};\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are within the provided epsilon,\n * <code>false</code> otherwise.\n *\n * @param {TimeInterval} [right] The right hand side interval.\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.\n */\nTimeInterval.prototype.equalsEpsilon = function (right, epsilon, dataComparer) {\n return TimeInterval.equalsEpsilon(this, right, epsilon, dataComparer);\n};\n\n/**\n * Creates a string representing this TimeInterval in ISO8601 format.\n *\n * @returns {String} A string representing this TimeInterval in ISO8601 format.\n */\nTimeInterval.prototype.toString = function () {\n return TimeInterval.toIso8601(this);\n};\n\n/**\n * An immutable empty interval.\n *\n * @type {TimeInterval}\n * @constant\n */\nTimeInterval.EMPTY = Object.freeze(\n new TimeInterval({\n start: new JulianDate(),\n stop: new JulianDate(),\n isStartIncluded: false,\n isStopIncluded: false,\n })\n);\n\n/**\n * Function interface for merging interval data.\n * @callback TimeInterval.MergeCallback\n *\n * @param {*} leftData The first data instance.\n * @param {*} rightData The second data instance.\n * @returns {*} The result of merging the two data instances.\n */\n\n/**\n * Function interface for comparing interval data.\n * @callback TimeInterval.DataComparer\n * @param {*} leftData The first data instance.\n * @param {*} rightData The second data instance.\n * @returns {Boolean} <code>true</code> if the provided instances are equal, <code>false</code> otherwise.\n */\nexport default TimeInterval;\n", "import JulianDate from \"./JulianDate.js\";\nimport TimeInterval from \"./TimeInterval.js\";\n\nconst MINIMUM_VALUE = Object.freeze(\n JulianDate.fromIso8601(\"0000-01-01T00:00:00Z\")\n);\nconst MAXIMUM_VALUE = Object.freeze(\n JulianDate.fromIso8601(\"9999-12-31T24:00:00Z\")\n);\nconst MAXIMUM_INTERVAL = Object.freeze(\n new TimeInterval({\n start: MINIMUM_VALUE,\n stop: MAXIMUM_VALUE,\n })\n);\n\n/**\n * Constants related to ISO8601 support.\n *\n * @namespace\n *\n * @see {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601 on Wikipedia}\n * @see JulianDate\n * @see TimeInterval\n */\nconst Iso8601 = {\n /**\n * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.\n * This is equivalent to the date string '0000-01-01T00:00:00Z'\n *\n * @type {JulianDate}\n * @constant\n */\n MINIMUM_VALUE: MINIMUM_VALUE,\n\n /**\n * A {@link JulianDate} representing the latest time representable by an ISO8601 date.\n * This is equivalent to the date string '9999-12-31T24:00:00Z'\n *\n * @type {JulianDate}\n * @constant\n */\n MAXIMUM_VALUE: MAXIMUM_VALUE,\n\n /**\n * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.\n * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'\n *\n * @type {TimeInterval}\n * @constant\n */\n MAXIMUM_INTERVAL: MAXIMUM_INTERVAL,\n};\nexport default Iso8601;\n", "import Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines the geometry instance offset\n *\n * @alias OffsetGeometryInstanceAttribute\n * @constructor\n *\n * @param {Number} [x=0] The x translation\n * @param {Number} [y=0] The y translation\n * @param {Number} [z=0] The z translation\n *\n * @private\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction OffsetGeometryInstanceAttribute(x, y, z) {\n x = defaultValue(x, 0);\n y = defaultValue(y, 0);\n z = defaultValue(z, 0);\n\n /**\n * The values for the attributes stored in a typed array.\n *\n * @type Float32Array\n */\n this.value = new Float32Array([x, y, z]);\n}\n\nObject.defineProperties(OffsetGeometryInstanceAttribute.prototype, {\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link OffsetGeometryInstanceAttribute#value}.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {ComponentDatatype}\n * @readonly\n *\n * @default {@link ComponentDatatype.FLOAT}\n */\n componentDatatype: {\n get: function () {\n return ComponentDatatype.FLOAT;\n },\n },\n\n /**\n * The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 3\n */\n componentsPerAttribute: {\n get: function () {\n return 3;\n },\n },\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n *\n * @memberof OffsetGeometryInstanceAttribute.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n normalize: {\n get: function () {\n return false;\n },\n },\n});\n\n/**\n * Creates a new {@link OffsetGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @returns {OffsetGeometryInstanceAttribute} The new {@link OffsetGeometryInstanceAttribute} instance.\n */\nOffsetGeometryInstanceAttribute.fromCartesian3 = function (offset) {\n return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);\n};\n\n/**\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\n *\n * @param {Cartesian3} offset The cartesian offset\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.modelMatrix = Cesium.OffsetGeometryInstanceAttribute.toValue(modelMatrix, attributes.modelMatrix);\n */\nOffsetGeometryInstanceAttribute.toValue = function (offset, result) {\n if (!defined(result)) {\n result = new Float32Array([offset.x, offset.y, offset.z]);\n }\n\n result[0] = offset.x;\n result[1] = offset.y;\n result[2] = offset.z;\n return result;\n};\nexport default OffsetGeometryInstanceAttribute;\n", "import ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.\n *\n * @alias ShowGeometryInstanceAttribute\n * @constructor\n *\n * @param {Boolean} [show=true] Determines if the geometry instance will be shown.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n * geometry : new Cesium.BoxGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)\n * }),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n * id : 'box',\n * attributes : {\n * show : new Cesium.ShowGeometryInstanceAttribute(false)\n * }\n * });\n *\n * @see GeometryInstance\n * @see GeometryInstanceAttribute\n */\nfunction ShowGeometryInstanceAttribute(show) {\n show = defaultValue(show, true);\n\n /**\n * The values for the attributes stored in a typed array.\n *\n * @type Uint8Array\n *\n * @default [1.0]\n */\n this.value = ShowGeometryInstanceAttribute.toValue(show);\n}\n\nObject.defineProperties(ShowGeometryInstanceAttribute.prototype, {\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link ColorGeometryInstanceAttribute#value}.\n *\n * @memberof ShowGeometryInstanceAttribute.prototype\n *\n * @type {ComponentDatatype}\n * @readonly\n *\n * @default {@link ComponentDatatype.UNSIGNED_BYTE}\n */\n componentDatatype: {\n get: function () {\n return ComponentDatatype.UNSIGNED_BYTE;\n },\n },\n\n /**\n * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.\n *\n * @memberof ShowGeometryInstanceAttribute.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 1\n */\n componentsPerAttribute: {\n get: function () {\n return 1;\n },\n },\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n *\n * @memberof ShowGeometryInstanceAttribute.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n normalize: {\n get: function () {\n return false;\n },\n },\n});\n\n/**\n * Converts a boolean show to a typed array that can be used to assign a show attribute.\n *\n * @param {Boolean} show The show value.\n * @param {Uint8Array} [result] The array to store the result in, if undefined a new instance will be created.\n * @returns {Uint8Array} The modified result parameter or a new instance if result was undefined.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);\n */\nShowGeometryInstanceAttribute.toValue = function (show, result) {\n if (!defined(result)) {\n return new Uint8Array([show]);\n }\n result[0] = show;\n return result;\n};\nexport default ShowGeometryInstanceAttribute;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec3 v_tangentEC;\\n\\\nvarying vec3 v_bitangentEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionToEyeEC = -v_positionEC;\\n\\\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\\n\\\nvec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nmaterialInput.st = v_st;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 normal;\\n\\\nattribute vec3 tangent;\\n\\\nattribute vec3 bitangent;\\n\\\nattribute vec2 st;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec3 v_tangentEC;\\n\\\nvarying vec3 v_bitangentEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\nv_normalEC = czm_normal * normal;\\n\\\nv_tangentEC = czm_normal * tangent;\\n\\\nv_bitangentEC = czm_normal * bitangent;\\n\\\nv_st = st;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionToEyeEC = -v_positionEC;\\n\\\nvec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 normal;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\nv_normalEC = czm_normal * normal;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionToEyeEC = -v_positionEC;\\n\\\nvec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nmaterialInput.st = v_st;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 normal;\\n\\\nattribute vec2 st;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\nv_normalEC = czm_normal * normal;\\n\\\nv_st = st;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines how two pixels' values are combined.\n *\n * @enum {Number}\n */\nconst BlendEquation = {\n /**\n * Pixel values are added componentwise. This is used in additive blending for translucency.\n *\n * @type {Number}\n * @constant\n */\n ADD: WebGLConstants.FUNC_ADD,\n\n /**\n * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.\n *\n * @type {Number}\n * @constant\n */\n SUBTRACT: WebGLConstants.FUNC_SUBTRACT,\n\n /**\n * Pixel values are subtracted componentwise (destination - source).\n *\n * @type {Number}\n * @constant\n */\n REVERSE_SUBTRACT: WebGLConstants.FUNC_REVERSE_SUBTRACT,\n\n /**\n * Pixel values are given to the minimum function (min(source, destination)).\n *\n * This equation operates on each pixel color component.\n *\n * @type {Number}\n * @constant\n */\n MIN: WebGLConstants.MIN,\n\n /**\n * Pixel values are given to the maximum function (max(source, destination)).\n *\n * This equation operates on each pixel color component.\n *\n * @type {Number}\n * @constant\n */\n MAX: WebGLConstants.MAX,\n};\nexport default Object.freeze(BlendEquation);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines how blending factors are computed.\n *\n * @enum {Number}\n */\nconst BlendFunction = {\n /**\n * The blend factor is zero.\n *\n * @type {Number}\n * @constant\n */\n ZERO: WebGLConstants.ZERO,\n\n /**\n * The blend factor is one.\n *\n * @type {Number}\n * @constant\n */\n ONE: WebGLConstants.ONE,\n\n /**\n * The blend factor is the source color.\n *\n * @type {Number}\n * @constant\n */\n SOURCE_COLOR: WebGLConstants.SRC_COLOR,\n\n /**\n * The blend factor is one minus the source color.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_SOURCE_COLOR: WebGLConstants.ONE_MINUS_SRC_COLOR,\n\n /**\n * The blend factor is the destination color.\n *\n * @type {Number}\n * @constant\n */\n DESTINATION_COLOR: WebGLConstants.DST_COLOR,\n\n /**\n * The blend factor is one minus the destination color.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_DESTINATION_COLOR: WebGLConstants.ONE_MINUS_DST_COLOR,\n\n /**\n * The blend factor is the source alpha.\n *\n * @type {Number}\n * @constant\n */\n SOURCE_ALPHA: WebGLConstants.SRC_ALPHA,\n\n /**\n * The blend factor is one minus the source alpha.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_SOURCE_ALPHA: WebGLConstants.ONE_MINUS_SRC_ALPHA,\n\n /**\n * The blend factor is the destination alpha.\n *\n * @type {Number}\n * @constant\n */\n DESTINATION_ALPHA: WebGLConstants.DST_ALPHA,\n\n /**\n * The blend factor is one minus the destination alpha.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_DESTINATION_ALPHA: WebGLConstants.ONE_MINUS_DST_ALPHA,\n\n /**\n * The blend factor is the constant color.\n *\n * @type {Number}\n * @constant\n */\n CONSTANT_COLOR: WebGLConstants.CONSTANT_COLOR,\n\n /**\n * The blend factor is one minus the constant color.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_CONSTANT_COLOR: WebGLConstants.ONE_MINUS_CONSTANT_COLOR,\n\n /**\n * The blend factor is the constant alpha.\n *\n * @type {Number}\n * @constant\n */\n CONSTANT_ALPHA: WebGLConstants.CONSTANT_ALPHA,\n\n /**\n * The blend factor is one minus the constant alpha.\n *\n * @type {Number}\n * @constant\n */\n ONE_MINUS_CONSTANT_ALPHA: WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,\n\n /**\n * The blend factor is the saturated source alpha.\n *\n * @type {Number}\n * @constant\n */\n SOURCE_ALPHA_SATURATE: WebGLConstants.SRC_ALPHA_SATURATE,\n};\nexport default Object.freeze(BlendFunction);\n", "import BlendEquation from \"./BlendEquation.js\";\nimport BlendFunction from \"./BlendFunction.js\";\n\n/**\n * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the\n * <code>enabled</code> flag to define the full blending state for combining source and\n * destination fragments when rendering.\n * <p>\n * This is a helper when using custom render states with {@link Appearance#renderState}.\n * </p>\n *\n * @namespace\n */\nconst BlendingState = {\n /**\n * Blending is disabled.\n *\n * @type {Object}\n * @constant\n */\n DISABLED: Object.freeze({\n enabled: false,\n }),\n\n /**\n * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.\n *\n * @type {Object}\n * @constant\n */\n ALPHA_BLEND: Object.freeze({\n enabled: true,\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.SOURCE_ALPHA,\n functionSourceAlpha: BlendFunction.ONE,\n functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n }),\n\n /**\n * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.\n *\n * @type {Object}\n * @constant\n */\n PRE_MULTIPLIED_ALPHA_BLEND: Object.freeze({\n enabled: true,\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.ONE,\n functionSourceAlpha: BlendFunction.ONE,\n functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n }),\n\n /**\n * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.\n *\n * @type {Object}\n * @constant\n */\n ADDITIVE_BLEND: Object.freeze({\n enabled: true,\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.SOURCE_ALPHA,\n functionSourceAlpha: BlendFunction.ONE,\n functionDestinationRgb: BlendFunction.ONE,\n functionDestinationAlpha: BlendFunction.ONE,\n }),\n};\nexport default Object.freeze(BlendingState);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines which triangles, if any, are culled.\n *\n * @enum {Number}\n */\nconst CullFace = {\n /**\n * Front-facing triangles are culled.\n *\n * @type {Number}\n * @constant\n */\n FRONT: WebGLConstants.FRONT,\n\n /**\n * Back-facing triangles are culled.\n *\n * @type {Number}\n * @constant\n */\n BACK: WebGLConstants.BACK,\n\n /**\n * Both front-facing and back-facing triangles are culled.\n *\n * @type {Number}\n * @constant\n */\n FRONT_AND_BACK: WebGLConstants.FRONT_AND_BACK,\n};\nexport default Object.freeze(CullFace);\n", "import clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\n\n/**\n * An appearance defines the full GLSL vertex and fragment shaders and the\n * render state used to draw a {@link Primitive}. All appearances implement\n * this base <code>Appearance</code> interface.\n *\n * @alias Appearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.\n * @param {Boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @see MaterialAppearance\n * @see EllipsoidSurfaceAppearance\n * @see PerInstanceColorAppearance\n * @see DebugAppearance\n * @see PolylineColorAppearance\n * @see PolylineMaterialAppearance\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}\n */\nfunction Appearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The material used to determine the fragment color. Unlike other {@link Appearance}\n * properties, this is not read-only, so an appearance's material can change on the fly.\n *\n * @type Material\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = options.material;\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = defaultValue(options.translucent, true);\n\n this._vertexShaderSource = options.vertexShaderSource;\n this._fragmentShaderSource = options.fragmentShaderSource;\n this._renderState = options.renderState;\n this._closed = defaultValue(options.closed, false);\n}\n\nObject.defineProperties(Appearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof Appearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader. The full fragment shader\n * source is built procedurally taking into account the {@link Appearance#material}.\n * Use {@link Appearance#getFragmentShaderSource} to get the full source.\n *\n * @memberof Appearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n *\n * @memberof Appearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed.\n *\n * @memberof Appearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n});\n\n/**\n * Procedurally creates the full GLSL fragment shader source for this appearance\n * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nAppearance.prototype.getFragmentShaderSource = function () {\n const parts = [];\n if (this.flat) {\n parts.push(\"#define FLAT\");\n }\n if (this.faceForward) {\n parts.push(\"#define FACE_FORWARD\");\n }\n if (defined(this.material)) {\n parts.push(this.material.shaderSource);\n }\n parts.push(this.fragmentShaderSource);\n\n return parts.join(\"\\n\");\n};\n\n/**\n * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nAppearance.prototype.isTranslucent = function () {\n return (\n (defined(this.material) && this.material.isTranslucent()) ||\n (!defined(this.material) && this.translucent)\n );\n};\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @returns {Object} The render state.\n */\nAppearance.prototype.getRenderState = function () {\n const translucent = this.isTranslucent();\n const rs = clone(this.renderState, false);\n if (translucent) {\n rs.depthMask = false;\n rs.blending = BlendingState.ALPHA_BLEND;\n } else {\n rs.depthMask = true;\n }\n return rs;\n};\n\n/**\n * @private\n */\nAppearance.getDefaultRenderState = function (translucent, closed, existing) {\n let rs = {\n depthTest: {\n enabled: true,\n },\n };\n\n if (translucent) {\n rs.depthMask = false;\n rs.blending = BlendingState.ALPHA_BLEND;\n }\n\n if (closed) {\n rs.cull = {\n enabled: true,\n face: CullFace.BACK,\n };\n }\n\n if (defined(existing)) {\n rs = combine(existing, rs, true);\n }\n\n return rs;\n};\nexport default Appearance;\n", "/**\n * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.\n *\n * @function\n *\n * @returns {String}\n *\n *\n * @example\n * this.guid = Cesium.createGuid();\n *\n * @see {@link http://www.ietf.org/rfc/rfc4122.txt|RFC 4122 A Universally Unique IDentifier (UUID) URN Namespace}\n */\nfunction createGuid() {\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nexport default createGuid;\n", "import defined from \"./defined.js\";\n\n/**\n * Describes a compressed texture and contains a compressed texture buffer.\n * @alias CompressedTextureBuffer\n * @constructor\n *\n * @param {PixelFormat} internalFormat The pixel format of the compressed texture.\n * @param {PixelDatatype} pixelDatatype The pixel datatype of the compressed texture.\n * @param {Number} width The width of the texture.\n * @param {Number} height The height of the texture.\n * @param {Uint8Array} buffer The compressed texture buffer.\n */\nfunction CompressedTextureBuffer(\n internalFormat,\n pixelDatatype,\n width,\n height,\n buffer\n) {\n this._format = internalFormat;\n this._datatype = pixelDatatype;\n this._width = width;\n this._height = height;\n this._buffer = buffer;\n}\n\nObject.defineProperties(CompressedTextureBuffer.prototype, {\n /**\n * The format of the compressed texture.\n * @type PixelFormat\n * @readonly\n * @memberof CompressedTextureBuffer.prototype\n */\n internalFormat: {\n get: function () {\n return this._format;\n },\n },\n /**\n * The datatype of the compressed texture.\n * @type PixelDatatype\n * @readonly\n * @memberof CompressedTextureBuffer.prototype\n */\n pixelDatatype: {\n get: function () {\n return this._datatype;\n },\n },\n /**\n * The width of the texture.\n * @type Number\n * @readonly\n * @memberof CompressedTextureBuffer.prototype\n */\n width: {\n get: function () {\n return this._width;\n },\n },\n /**\n * The height of the texture.\n * @type Number\n * @readonly\n * @memberof CompressedTextureBuffer.prototype\n */\n height: {\n get: function () {\n return this._height;\n },\n },\n /**\n * The compressed texture buffer.\n * @type Uint8Array\n * @readonly\n * @memberof CompressedTextureBuffer.prototype\n */\n bufferView: {\n get: function () {\n return this._buffer;\n },\n },\n});\n\n/**\n * Creates a shallow clone of a compressed texture buffer.\n *\n * @param {CompressedTextureBuffer} object The compressed texture buffer to be cloned.\n * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.\n */\nCompressedTextureBuffer.clone = function (object) {\n if (!defined(object)) {\n return undefined;\n }\n\n return new CompressedTextureBuffer(\n object._format,\n object._datatype,\n object._width,\n object._height,\n object._buffer\n );\n};\n\n/**\n * Creates a shallow clone of this compressed texture buffer.\n *\n * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.\n */\nCompressedTextureBuffer.prototype.clone = function () {\n return CompressedTextureBuffer.clone(this);\n};\nexport default CompressedTextureBuffer;\n", "import Uri from \"urijs\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defer from \"./defer.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\nfunction canTransferArrayBuffer() {\n if (!defined(TaskProcessor._canTransferArrayBuffer)) {\n const worker = new Worker(\n getWorkerUrl(\"Workers/transferTypedArrayTest.js\")\n );\n worker.postMessage = defaultValue(\n worker.webkitPostMessage,\n worker.postMessage\n );\n\n const value = 99;\n const array = new Int8Array([value]);\n\n try {\n // postMessage might fail with a DataCloneError\n // if transferring array buffers is not supported.\n worker.postMessage(\n {\n array: array,\n },\n [array.buffer]\n );\n } catch (e) {\n TaskProcessor._canTransferArrayBuffer = false;\n return TaskProcessor._canTransferArrayBuffer;\n }\n\n const deferred = defer();\n\n worker.onmessage = function (event) {\n const array = event.data.array;\n\n // some versions of Firefox silently fail to transfer typed arrays.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=841904\n // Check to make sure the value round-trips successfully.\n const result = defined(array) && array[0] === value;\n deferred.resolve(result);\n\n worker.terminate();\n\n TaskProcessor._canTransferArrayBuffer = result;\n };\n\n TaskProcessor._canTransferArrayBuffer = deferred.promise;\n }\n\n return TaskProcessor._canTransferArrayBuffer;\n}\n\nconst taskCompletedEvent = new Event();\n\nfunction completeTask(processor, data) {\n --processor._activeTasks;\n\n const id = data.id;\n if (!defined(id)) {\n // This is not one of ours.\n return;\n }\n\n const deferreds = processor._deferreds;\n const deferred = deferreds[id];\n\n if (defined(data.error)) {\n let error = data.error;\n if (error.name === \"RuntimeError\") {\n error = new RuntimeError(data.error.message);\n error.stack = data.error.stack;\n } else if (error.name === \"DeveloperError\") {\n error = new DeveloperError(data.error.message);\n error.stack = data.error.stack;\n }\n taskCompletedEvent.raiseEvent(error);\n deferred.reject(error);\n } else {\n taskCompletedEvent.raiseEvent();\n deferred.resolve(data.result);\n }\n\n delete deferreds[id];\n}\n\nfunction getWorkerUrl(moduleID) {\n let url = buildModuleUrl(moduleID);\n\n if (isCrossOriginUrl(url)) {\n //to load cross-origin, create a shim worker from a blob URL\n const script = `importScripts(\"${url}\");`;\n\n let blob;\n try {\n blob = new Blob([script], {\n type: \"application/javascript\",\n });\n } catch (e) {\n const BlobBuilder =\n window.BlobBuilder ||\n window.WebKitBlobBuilder ||\n window.MozBlobBuilder ||\n window.MSBlobBuilder;\n const blobBuilder = new BlobBuilder();\n blobBuilder.append(script);\n blob = blobBuilder.getBlob(\"application/javascript\");\n }\n\n const URL = window.URL || window.webkitURL;\n url = URL.createObjectURL(blob);\n }\n\n return url;\n}\n\nlet bootstrapperUrlResult;\nfunction getBootstrapperUrl() {\n if (!defined(bootstrapperUrlResult)) {\n bootstrapperUrlResult = getWorkerUrl(\"Workers/cesiumWorkerBootstrapper.js\");\n }\n return bootstrapperUrlResult;\n}\n\nfunction createWorker(processor) {\n const worker = new Worker(getBootstrapperUrl());\n worker.postMessage = defaultValue(\n worker.webkitPostMessage,\n worker.postMessage\n );\n\n const bootstrapMessage = {\n loaderConfig: {\n paths: {\n Workers: buildModuleUrl(\"Workers\"),\n },\n baseUrl: buildModuleUrl.getCesiumBaseUrl().url,\n },\n workerModule: processor._workerPath,\n };\n\n worker.postMessage(bootstrapMessage);\n worker.onmessage = function (event) {\n completeTask(processor, event.data);\n };\n\n return worker;\n}\n\nfunction getWebAssemblyLoaderConfig(processor, wasmOptions) {\n const config = {\n modulePath: undefined,\n wasmBinaryFile: undefined,\n wasmBinary: undefined,\n };\n\n // Web assembly not supported, use fallback js module if provided\n if (!FeatureDetection.supportsWebAssembly()) {\n if (!defined(wasmOptions.fallbackModulePath)) {\n throw new RuntimeError(\n `This browser does not support Web Assembly, and no backup module was provided for ${processor._workerPath}`\n );\n }\n\n config.modulePath = buildModuleUrl(wasmOptions.fallbackModulePath);\n return Promise.resolve(config);\n }\n\n config.modulePath = buildModuleUrl(wasmOptions.modulePath);\n config.wasmBinaryFile = buildModuleUrl(wasmOptions.wasmBinaryFile);\n\n return Resource.fetchArrayBuffer({\n url: config.wasmBinaryFile,\n }).then(function (arrayBuffer) {\n config.wasmBinary = arrayBuffer;\n return config;\n });\n}\n\n/**\n * A wrapper around a web worker that allows scheduling tasks for a given worker,\n * returning results asynchronously via a promise.\n *\n * The Worker is not constructed until a task is scheduled.\n *\n * @alias TaskProcessor\n * @constructor\n *\n * @param {String} workerPath The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.\n * @param {Number} [maximumActiveTasks=Number.POSITIVE_INFINITY] The maximum number of active tasks. Once exceeded,\n * scheduleTask will not queue any more tasks, allowing\n * work to be rescheduled in future frames.\n */\nfunction TaskProcessor(workerPath, maximumActiveTasks) {\n const uri = new Uri(workerPath);\n this._workerPath =\n uri.scheme().length !== 0 && uri.fragment().length === 0\n ? workerPath\n : TaskProcessor._workerModulePrefix + workerPath;\n this._maximumActiveTasks = defaultValue(\n maximumActiveTasks,\n Number.POSITIVE_INFINITY\n );\n this._activeTasks = 0;\n this._deferreds = {};\n this._nextID = 0;\n}\n\nconst emptyTransferableObjectArray = [];\n\n/**\n * Schedule a task to be processed by the web worker asynchronously. If there are currently more\n * tasks active than the maximum set by the constructor, will immediately return undefined.\n * Otherwise, returns a promise that will resolve to the result posted back by the worker when\n * finished.\n *\n * @param {Object} parameters Any input data that will be posted to the worker.\n * @param {Object[]} [transferableObjects] An array of objects contained in parameters that should be\n * transferred to the worker instead of copied.\n * @returns {Promise.<Object>|undefined} Either a promise that will resolve to the result when available, or undefined\n * if there are too many active tasks,\n *\n * @example\n * const taskProcessor = new Cesium.TaskProcessor('myWorkerPath');\n * const promise = taskProcessor.scheduleTask({\n * someParameter : true,\n * another : 'hello'\n * });\n * if (!Cesium.defined(promise)) {\n * // too many active tasks - try again later\n * } else {\n * promise.then(function(result) {\n * // use the result of the task\n * });\n * }\n */\nTaskProcessor.prototype.scheduleTask = function (\n parameters,\n transferableObjects\n) {\n if (!defined(this._worker)) {\n this._worker = createWorker(this);\n }\n\n if (this._activeTasks >= this._maximumActiveTasks) {\n return undefined;\n }\n\n ++this._activeTasks;\n\n const processor = this;\n return Promise.resolve(canTransferArrayBuffer()).then(function (\n canTransferArrayBuffer\n ) {\n if (!defined(transferableObjects)) {\n transferableObjects = emptyTransferableObjectArray;\n } else if (!canTransferArrayBuffer) {\n transferableObjects.length = 0;\n }\n\n const id = processor._nextID++;\n const deferred = defer();\n processor._deferreds[id] = deferred;\n\n processor._worker.postMessage(\n {\n id: id,\n parameters: parameters,\n canTransferArrayBuffer: canTransferArrayBuffer,\n },\n transferableObjects\n );\n\n return deferred.promise;\n });\n};\n\n/**\n * Posts a message to a web worker with configuration to initialize loading\n * and compiling a web assembly module asychronously, as well as an optional\n * fallback JavaScript module to use if Web Assembly is not supported.\n *\n * @param {Object} [webAssemblyOptions] An object with the following properties:\n * @param {String} [webAssemblyOptions.modulePath] The path of the web assembly JavaScript wrapper module.\n * @param {String} [webAssemblyOptions.wasmBinaryFile] The path of the web assembly binary file.\n * @param {String} [webAssemblyOptions.fallbackModulePath] The path of the fallback JavaScript module to use if web assembly is not supported.\n * @returns {Promise.<Object>} A promise that resolves to the result when the web worker has loaded and compiled the web assembly module and is ready to process tasks.\n */\nTaskProcessor.prototype.initWebAssemblyModule = function (webAssemblyOptions) {\n if (!defined(this._worker)) {\n this._worker = createWorker(this);\n }\n\n const deferred = defer();\n const processor = this;\n const worker = this._worker;\n getWebAssemblyLoaderConfig(this, webAssemblyOptions).then(function (\n wasmConfig\n ) {\n return Promise.resolve(canTransferArrayBuffer()).then(function (\n canTransferArrayBuffer\n ) {\n let transferableObjects;\n const binary = wasmConfig.wasmBinary;\n if (defined(binary) && canTransferArrayBuffer) {\n transferableObjects = [binary];\n }\n\n worker.onmessage = function (event) {\n worker.onmessage = function (event) {\n completeTask(processor, event.data);\n };\n\n deferred.resolve(event.data);\n };\n\n worker.postMessage(\n { webAssemblyConfig: wasmConfig },\n transferableObjects\n );\n });\n });\n\n return deferred.promise;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TaskProcessor#destroy\n */\nTaskProcessor.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys this object. This will immediately terminate the Worker.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n */\nTaskProcessor.prototype.destroy = function () {\n if (defined(this._worker)) {\n this._worker.terminate();\n }\n return destroyObject(this);\n};\n\n/**\n * An event that's raised when a task is completed successfully. Event handlers are passed\n * the error object is a task fails.\n *\n * @type {Event}\n *\n * @private\n */\nTaskProcessor.taskCompletedEvent = taskCompletedEvent;\n\n// exposed for testing purposes\nTaskProcessor._defaultWorkerModulePrefix = \"Workers/\";\nTaskProcessor._workerModulePrefix = TaskProcessor._defaultWorkerModulePrefix;\nTaskProcessor._canTransferArrayBuffer = undefined;\nexport default TaskProcessor;\n", "import Check from \"./Check.js\";\nimport CompressedTextureBuffer from \"./CompressedTextureBuffer.js\";\nimport defined from \"./defined.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\n\n/**\n * Transcodes KTX2 textures using web workers.\n *\n * @private\n */\nfunction KTX2Transcoder() {}\n\nKTX2Transcoder._transcodeTaskProcessor = new TaskProcessor(\n \"transcodeKTX2\",\n Number.POSITIVE_INFINITY // KTX2 transcoding is used in place of Resource.fetchImage, so it can't reject as \"just soooo busy right now\"\n);\n\nKTX2Transcoder._readyPromise = undefined;\n\nfunction makeReadyPromise() {\n const readyPromise = KTX2Transcoder._transcodeTaskProcessor\n .initWebAssemblyModule({\n modulePath: \"ThirdParty/Workers/basis_transcoder.js\",\n wasmBinaryFile: \"ThirdParty/basis_transcoder.wasm\",\n })\n .then(function () {\n return KTX2Transcoder._transcodeTaskProcessor;\n });\n KTX2Transcoder._readyPromise = readyPromise;\n}\n\nKTX2Transcoder.transcode = function (ktx2Buffer, supportedTargetFormats) {\n if (!defined(KTX2Transcoder._readyPromise)) {\n makeReadyPromise();\n }\n\n return KTX2Transcoder._readyPromise\n .then(function (taskProcessor) {\n let parameters;\n if (ktx2Buffer instanceof ArrayBuffer) {\n const view = new Uint8Array(ktx2Buffer);\n parameters = {\n supportedTargetFormats: supportedTargetFormats,\n ktx2Buffer: view,\n };\n return taskProcessor.scheduleTask(parameters, [ktx2Buffer]);\n }\n parameters = {\n supportedTargetFormats: supportedTargetFormats,\n ktx2Buffer: ktx2Buffer,\n };\n return taskProcessor.scheduleTask(parameters, [ktx2Buffer.buffer]);\n })\n .then(function (result) {\n const levelsLength = result.length;\n const faceKeys = Object.keys(result[0]);\n const faceKeysLength = faceKeys.length;\n\n let i;\n for (i = 0; i < levelsLength; i++) {\n const faces = result[i];\n for (let j = 0; j < faceKeysLength; j++) {\n const face = faces[faceKeys[j]];\n faces[faceKeys[j]] = new CompressedTextureBuffer(\n face.internalFormat,\n face.datatype,\n face.width,\n face.height,\n face.levelBuffer\n );\n }\n }\n\n // Cleaning up parsed result if it's a single image\n if (faceKeysLength === 1) {\n for (i = 0; i < levelsLength; ++i) {\n result[i] = result[i][faceKeys[0]];\n }\n\n if (levelsLength === 1) {\n result = result[0];\n }\n }\n return result;\n })\n .catch(function (error) {\n throw error;\n });\n};\n\nexport default KTX2Transcoder;\n", "import Check from \"./Check.js\";\nimport Resource from \"./Resource.js\";\nimport KTX2Transcoder from \"./KTX2Transcoder.js\";\n\n/**\n * Stores the supported formats that KTX2 can transcode to. Called during context creation.\n *\n * @param {Boolean} s3tc Whether or not S3TC is supported\n * @param {Boolean} pvrtc Whether or not PVRTC is supported\n * @param {Boolean} astc Whether or not ASTC is supported\n * @param {Boolean} etc Whether or not ETC is supported\n * @param {Boolean} etc1 Whether or not ETC1 is supported\n * @param {Boolean} bc7 Whether or not BC7 is supported\n * @private\n */\nlet supportedTranscoderFormats;\n\nloadKTX2.setKTX2SupportedFormats = function (\n s3tc,\n pvrtc,\n astc,\n etc,\n etc1,\n bc7\n) {\n supportedTranscoderFormats = {\n s3tc: s3tc,\n pvrtc: pvrtc,\n astc: astc,\n etc: etc,\n etc1: etc1,\n bc7: bc7,\n };\n};\n\n/**\n * Asynchronously loads and parses the given URL to a KTX2 file or parses the raw binary data of a KTX2 file.\n * Returns a promise that will resolve to an object containing the image buffer, width, height, and format once loaded,\n * or reject if the URL failed to load or failed to parse the data. The data is loaded\n * using XMLHttpRequest, which means that in order to make requests to another origin,\n * the server must have Cross-Origin Resource sharing (CORS) headers enabled.\n * <p>\n * The following are part of the KTX2 format specification but are not supported:\n * <ul>\n * <li>Metadata</li>\n * <li>3D textures</li>\n * <li>Texture Arrays</li>\n * <li>Video</li>\n * </ul>\n * </p>\n *\n * @function loadKTX2\n *\n * @param {Resource|String|ArrayBuffer} resourceOrUrlOrBuffer The URL of the binary data or an ArrayBuffer.\n * @returns {Promise.<CompressedTextureBuffer>|undefined} A promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.\n *\n * @exception {RuntimeError} Invalid KTX2 file.\n * @exception {RuntimeError} KTX2 texture arrays are not supported.\n * @exception {RuntimeError} KTX2 3D textures are unsupported.\n * @exception {RuntimeError} No transcoding format target available for ETC1S compressed ktx2s.\n * @exception {RuntimeError} No transcoding format target available for UASTC compressed ktx2s.\n * @exception {RuntimeError} startTranscoding() failed.\n * @exception {RuntimeError} transcodeImage() failed.\n *\n * @example\n * // load a single URL asynchronously\n * Cesium.loadKTX2('some/url').then(function (ktx2Data) {\n * const width = ktx2Data.width;\n * const height = ktx2Data.height;\n * const format = ktx2Data.internalFormat;\n * const arrayBufferView = ktx2Data.bufferView;\n * // use the data to create a texture\n * }).catch(function (error) {\n * // an error occurred.\n * });\n *\n * @see {@link https://github.com/KhronosGroup/KTX-Specification|KTX file format}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n * @private\n */\nfunction loadKTX2(resourceOrUrlOrBuffer) {\n let loadPromise;\n if (\n resourceOrUrlOrBuffer instanceof ArrayBuffer ||\n ArrayBuffer.isView(resourceOrUrlOrBuffer)\n ) {\n loadPromise = Promise.resolve(resourceOrUrlOrBuffer);\n } else {\n const resource = Resource.createIfNeeded(resourceOrUrlOrBuffer);\n loadPromise = resource.fetchArrayBuffer();\n }\n\n // load module then return\n return loadPromise.then(function (data) {\n return KTX2Transcoder.transcode(data, supportedTranscoderFormats);\n });\n}\n\nexport default loadKTX2;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * The data type of a pixel.\n *\n * @enum {Number}\n * @see PostProcessStage\n */\nconst PixelDatatype = {\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n FLOAT: WebGLConstants.FLOAT,\n HALF_FLOAT: WebGLConstants.HALF_FLOAT_OES,\n UNSIGNED_INT_24_8: WebGLConstants.UNSIGNED_INT_24_8,\n UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4,\n UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1,\n UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5,\n};\n\n/**\n @private\n*/\nPixelDatatype.toWebGLConstant = function (pixelDatatype, context) {\n switch (pixelDatatype) {\n case PixelDatatype.UNSIGNED_BYTE:\n return WebGLConstants.UNSIGNED_BYTE;\n case PixelDatatype.UNSIGNED_SHORT:\n return WebGLConstants.UNSIGNED_SHORT;\n case PixelDatatype.UNSIGNED_INT:\n return WebGLConstants.UNSIGNED_INT;\n case PixelDatatype.FLOAT:\n return WebGLConstants.FLOAT;\n case PixelDatatype.HALF_FLOAT:\n return context.webgl2\n ? WebGLConstants.HALF_FLOAT\n : WebGLConstants.HALF_FLOAT_OES;\n case PixelDatatype.UNSIGNED_INT_24_8:\n return WebGLConstants.UNSIGNED_INT_24_8;\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n return WebGLConstants.UNSIGNED_SHORT_4_4_4_4;\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n return WebGLConstants.UNSIGNED_SHORT_5_5_5_1;\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n return PixelDatatype.UNSIGNED_SHORT_5_6_5;\n }\n};\n\n/**\n @private\n*/\nPixelDatatype.isPacked = function (pixelDatatype) {\n return (\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n );\n};\n\n/**\n @private\n*/\nPixelDatatype.sizeInBytes = function (pixelDatatype) {\n switch (pixelDatatype) {\n case PixelDatatype.UNSIGNED_BYTE:\n return 1;\n case PixelDatatype.UNSIGNED_SHORT:\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n case PixelDatatype.HALF_FLOAT:\n return 2;\n case PixelDatatype.UNSIGNED_INT:\n case PixelDatatype.FLOAT:\n case PixelDatatype.UNSIGNED_INT_24_8:\n return 4;\n }\n};\n\n/**\n @private\n*/\nPixelDatatype.validate = function (pixelDatatype) {\n return (\n pixelDatatype === PixelDatatype.UNSIGNED_BYTE ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT ||\n pixelDatatype === PixelDatatype.UNSIGNED_INT ||\n pixelDatatype === PixelDatatype.FLOAT ||\n pixelDatatype === PixelDatatype.HALF_FLOAT ||\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n );\n};\n\nexport default Object.freeze(PixelDatatype);\n", "import PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * The format of a pixel, i.e., the number of components it has and what they represent.\n *\n * @enum {Number}\n */\nconst PixelFormat = {\n /**\n * A pixel format containing a depth value.\n *\n * @type {Number}\n * @constant\n */\n DEPTH_COMPONENT: WebGLConstants.DEPTH_COMPONENT,\n\n /**\n * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.\n *\n * @type {Number}\n * @constant\n */\n DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL,\n\n /**\n * A pixel format containing an alpha channel.\n *\n * @type {Number}\n * @constant\n */\n ALPHA: WebGLConstants.ALPHA,\n\n /**\n * A pixel format containing red, green, and blue channels.\n *\n * @type {Number}\n * @constant\n */\n RGB: WebGLConstants.RGB,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels.\n *\n * @type {Number}\n * @constant\n */\n RGBA: WebGLConstants.RGBA,\n\n /**\n * A pixel format containing a luminance (intensity) channel.\n *\n * @type {Number}\n * @constant\n */\n LUMINANCE: WebGLConstants.LUMINANCE,\n\n /**\n * A pixel format containing luminance (intensity) and alpha channels.\n *\n * @type {Number}\n * @constant\n */\n LUMINANCE_ALPHA: WebGLConstants.LUMINANCE_ALPHA,\n\n /**\n * A pixel format containing red, green, and blue channels that is DXT1 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGB_DXT1: WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_DXT1: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_DXT3: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_DXT5: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n\n /**\n * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.\n *\n * @type {Number}\n * @constant\n */\n RGB_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,\n\n /**\n * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.\n *\n * @type {Number}\n * @constant\n */\n RGB_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_ASTC: WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,\n\n /**\n * A pixel format containing red, green, and blue channels that is ETC1 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGB_ETC1: WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,\n\n /**\n * A pixel format containing red, green, and blue channels that is ETC2 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGB8_ETC2: WebGLConstants.COMPRESSED_RGB8_ETC2,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA8_ETC2_EAC: WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,\n\n /**\n * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.\n *\n * @type {Number}\n * @constant\n */\n RGBA_BC7: WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM,\n};\n\n/**\n * @private\n */\nPixelFormat.componentsLength = function (pixelFormat) {\n switch (pixelFormat) {\n case PixelFormat.RGB:\n return 3;\n case PixelFormat.RGBA:\n return 4;\n case PixelFormat.LUMINANCE_ALPHA:\n return 2;\n case PixelFormat.ALPHA:\n case PixelFormat.LUMINANCE:\n return 1;\n default:\n return 1;\n }\n};\n\n/**\n * @private\n */\nPixelFormat.validate = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.DEPTH_COMPONENT ||\n pixelFormat === PixelFormat.DEPTH_STENCIL ||\n pixelFormat === PixelFormat.ALPHA ||\n pixelFormat === PixelFormat.RGB ||\n pixelFormat === PixelFormat.RGBA ||\n pixelFormat === PixelFormat.LUMINANCE ||\n pixelFormat === PixelFormat.LUMINANCE_ALPHA ||\n pixelFormat === PixelFormat.RGB_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT3 ||\n pixelFormat === PixelFormat.RGBA_DXT5 ||\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\n pixelFormat === PixelFormat.RGBA_ASTC ||\n pixelFormat === PixelFormat.RGB_ETC1 ||\n pixelFormat === PixelFormat.RGB8_ETC2 ||\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\n pixelFormat === PixelFormat.RGBA_BC7\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isColorFormat = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.ALPHA ||\n pixelFormat === PixelFormat.RGB ||\n pixelFormat === PixelFormat.RGBA ||\n pixelFormat === PixelFormat.LUMINANCE ||\n pixelFormat === PixelFormat.LUMINANCE_ALPHA\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isDepthFormat = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.DEPTH_COMPONENT ||\n pixelFormat === PixelFormat.DEPTH_STENCIL\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isCompressedFormat = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.RGB_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT3 ||\n pixelFormat === PixelFormat.RGBA_DXT5 ||\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\n pixelFormat === PixelFormat.RGBA_ASTC ||\n pixelFormat === PixelFormat.RGB_ETC1 ||\n pixelFormat === PixelFormat.RGB8_ETC2 ||\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\n pixelFormat === PixelFormat.RGBA_BC7\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isDXTFormat = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.RGB_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT1 ||\n pixelFormat === PixelFormat.RGBA_DXT3 ||\n pixelFormat === PixelFormat.RGBA_DXT5\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isPVRTCFormat = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isASTCFormat = function (pixelFormat) {\n return pixelFormat === PixelFormat.RGBA_ASTC;\n};\n\n/**\n * @private\n */\nPixelFormat.isETC1Format = function (pixelFormat) {\n return pixelFormat === PixelFormat.RGB_ETC1;\n};\n\n/**\n * @private\n */\nPixelFormat.isETC2Format = function (pixelFormat) {\n return (\n pixelFormat === PixelFormat.RGB8_ETC2 ||\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC\n );\n};\n\n/**\n * @private\n */\nPixelFormat.isBC7Format = function (pixelFormat) {\n return pixelFormat === PixelFormat.RGBA_BC7;\n};\n\n/**\n * @private\n */\nPixelFormat.compressedTextureSizeInBytes = function (\n pixelFormat,\n width,\n height\n) {\n switch (pixelFormat) {\n case PixelFormat.RGB_DXT1:\n case PixelFormat.RGBA_DXT1:\n case PixelFormat.RGB_ETC1:\n case PixelFormat.RGB8_ETC2:\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n\n case PixelFormat.RGBA_DXT3:\n case PixelFormat.RGBA_DXT5:\n case PixelFormat.RGBA_ASTC:\n case PixelFormat.RGBA8_ETC2_EAC:\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\n\n case PixelFormat.RGB_PVRTC_4BPPV1:\n case PixelFormat.RGBA_PVRTC_4BPPV1:\n return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);\n\n case PixelFormat.RGB_PVRTC_2BPPV1:\n case PixelFormat.RGBA_PVRTC_2BPPV1:\n return Math.floor(\n (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8\n );\n\n case PixelFormat.RGBA_BC7:\n return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;\n\n default:\n return 0;\n }\n};\n\n/**\n * @private\n */\nPixelFormat.textureSizeInBytes = function (\n pixelFormat,\n pixelDatatype,\n width,\n height\n) {\n let componentsLength = PixelFormat.componentsLength(pixelFormat);\n if (PixelDatatype.isPacked(pixelDatatype)) {\n componentsLength = 1;\n }\n return (\n componentsLength * PixelDatatype.sizeInBytes(pixelDatatype) * width * height\n );\n};\n\n/**\n * @private\n */\nPixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {\n const mod =\n PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4;\n return mod === 0 ? 4 : mod === 2 ? 2 : 1;\n};\n\n/**\n * @private\n */\nPixelFormat.createTypedArray = function (\n pixelFormat,\n pixelDatatype,\n width,\n height\n) {\n let constructor;\n const sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype);\n if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {\n constructor = Uint8Array;\n } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {\n constructor = Uint16Array;\n } else if (\n sizeInBytes === Float32Array.BYTES_PER_ELEMENT &&\n pixelDatatype === PixelDatatype.FLOAT\n ) {\n constructor = Float32Array;\n } else {\n constructor = Uint32Array;\n }\n\n const size = PixelFormat.componentsLength(pixelFormat) * width * height;\n return new constructor(size);\n};\n\n/**\n * @private\n */\nPixelFormat.flipY = function (\n bufferView,\n pixelFormat,\n pixelDatatype,\n width,\n height\n) {\n if (height === 1) {\n return bufferView;\n }\n const flipped = PixelFormat.createTypedArray(\n pixelFormat,\n pixelDatatype,\n width,\n height\n );\n const numberOfComponents = PixelFormat.componentsLength(pixelFormat);\n const textureWidth = width * numberOfComponents;\n for (let i = 0; i < height; ++i) {\n const row = i * width * numberOfComponents;\n const flippedRow = (height - i - 1) * width * numberOfComponents;\n for (let j = 0; j < textureWidth; ++j) {\n flipped[flippedRow + j] = bufferView[row + j];\n }\n }\n return flipped;\n};\n\n/**\n * @private\n */\nPixelFormat.toInternalFormat = function (pixelFormat, pixelDatatype, context) {\n // WebGL 1 require internalFormat to be the same as PixelFormat\n if (!context.webgl2) {\n return pixelFormat;\n }\n\n // Convert pixelFormat to correct internalFormat for WebGL 2\n if (pixelFormat === PixelFormat.DEPTH_STENCIL) {\n return WebGLConstants.DEPTH24_STENCIL8;\n }\n\n if (pixelFormat === PixelFormat.DEPTH_COMPONENT) {\n if (pixelDatatype === PixelDatatype.UNSIGNED_SHORT) {\n return WebGLConstants.DEPTH_COMPONENT16;\n } else if (pixelDatatype === PixelDatatype.UNSIGNED_INT) {\n return WebGLConstants.DEPTH_COMPONENT24;\n }\n }\n\n if (pixelDatatype === PixelDatatype.FLOAT) {\n switch (pixelFormat) {\n case PixelFormat.RGBA:\n return WebGLConstants.RGBA32F;\n case PixelFormat.RGB:\n return WebGLConstants.RGB32F;\n case PixelFormat.RG:\n return WebGLConstants.RG32F;\n case PixelFormat.R:\n return WebGLConstants.R32F;\n }\n }\n\n if (pixelDatatype === PixelDatatype.HALF_FLOAT) {\n switch (pixelFormat) {\n case PixelFormat.RGBA:\n return WebGLConstants.RGBA16F;\n case PixelFormat.RGB:\n return WebGLConstants.RGB16F;\n case PixelFormat.RG:\n return WebGLConstants.RG16F;\n case PixelFormat.R:\n return WebGLConstants.R16F;\n }\n }\n\n return pixelFormat;\n};\n\nexport default Object.freeze(PixelFormat);\n", "/**\n * @private\n */\nconst ContextLimits = {\n _maximumCombinedTextureImageUnits: 0,\n _maximumCubeMapSize: 0,\n _maximumFragmentUniformVectors: 0,\n _maximumTextureImageUnits: 0,\n _maximumRenderbufferSize: 0,\n _maximumTextureSize: 0,\n _maximumVaryingVectors: 0,\n _maximumVertexAttributes: 0,\n _maximumVertexTextureImageUnits: 0,\n _maximumVertexUniformVectors: 0,\n _minimumAliasedLineWidth: 0,\n _maximumAliasedLineWidth: 0,\n _minimumAliasedPointSize: 0,\n _maximumAliasedPointSize: 0,\n _maximumViewportWidth: 0,\n _maximumViewportHeight: 0,\n _maximumTextureFilterAnisotropy: 0,\n _maximumDrawBuffers: 0,\n _maximumColorAttachments: 0,\n _maximumSamples: 0,\n _highpFloatSupported: false,\n _highpIntSupported: false,\n};\n\nObject.defineProperties(ContextLimits, {\n /**\n * The maximum number of texture units that can be used from the vertex and fragment\n * shader with this WebGL implementation. The minimum is eight. If both shaders access the\n * same texture unit, this counts as two texture units.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_COMBINED_TEXTURE_IMAGE_UNITS</code>.\n */\n maximumCombinedTextureImageUnits: {\n get: function () {\n return ContextLimits._maximumCombinedTextureImageUnits;\n },\n },\n\n /**\n * The approximate maximum cube mape width and height supported by this WebGL implementation.\n * The minimum is 16, but most desktop and laptop implementations will support much larger sizes like 8,192.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_CUBE_MAP_TEXTURE_SIZE</code>.\n */\n maximumCubeMapSize: {\n get: function () {\n return ContextLimits._maximumCubeMapSize;\n },\n },\n\n /**\n * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>\n * uniforms that can be used by a fragment shader with this WebGL implementation. The minimum is 16.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_FRAGMENT_UNIFORM_VECTORS</code>.\n */\n maximumFragmentUniformVectors: {\n get: function () {\n return ContextLimits._maximumFragmentUniformVectors;\n },\n },\n\n /**\n * The maximum number of texture units that can be used from the fragment shader with this WebGL implementation. The minimum is eight.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_TEXTURE_IMAGE_UNITS</code>.\n */\n maximumTextureImageUnits: {\n get: function () {\n return ContextLimits._maximumTextureImageUnits;\n },\n },\n\n /**\n * The maximum renderbuffer width and height supported by this WebGL implementation.\n * The minimum is 16, but most desktop and laptop implementations will support much larger sizes like 8,192.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_RENDERBUFFER_SIZE</code>.\n */\n maximumRenderbufferSize: {\n get: function () {\n return ContextLimits._maximumRenderbufferSize;\n },\n },\n\n /**\n * The approximate maximum texture width and height supported by this WebGL implementation.\n * The minimum is 64, but most desktop and laptop implementations will support much larger sizes like 8,192.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_TEXTURE_SIZE</code>.\n */\n maximumTextureSize: {\n get: function () {\n return ContextLimits._maximumTextureSize;\n },\n },\n\n /**\n * The maximum number of <code>vec4</code> varying variables supported by this WebGL implementation.\n * The minimum is eight. Matrices and arrays count as multiple <code>vec4</code>s.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VARYING_VECTORS</code>.\n */\n maximumVaryingVectors: {\n get: function () {\n return ContextLimits._maximumVaryingVectors;\n },\n },\n\n /**\n * The maximum number of <code>vec4</code> vertex attributes supported by this WebGL implementation. The minimum is eight.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_ATTRIBS</code>.\n */\n maximumVertexAttributes: {\n get: function () {\n return ContextLimits._maximumVertexAttributes;\n },\n },\n\n /**\n * The maximum number of texture units that can be used from the vertex shader with this WebGL implementation.\n * The minimum is zero, which means the GL does not support vertex texture fetch.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_TEXTURE_IMAGE_UNITS</code>.\n */\n maximumVertexTextureImageUnits: {\n get: function () {\n return ContextLimits._maximumVertexTextureImageUnits;\n },\n },\n\n /**\n * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>\n * uniforms that can be used by a vertex shader with this WebGL implementation. The minimum is 16.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VERTEX_UNIFORM_VECTORS</code>.\n */\n maximumVertexUniformVectors: {\n get: function () {\n return ContextLimits._maximumVertexUniformVectors;\n },\n },\n\n /**\n * The minimum aliased line width, in pixels, supported by this WebGL implementation. It will be at most one.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n */\n minimumAliasedLineWidth: {\n get: function () {\n return ContextLimits._minimumAliasedLineWidth;\n },\n },\n\n /**\n * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n */\n maximumAliasedLineWidth: {\n get: function () {\n return ContextLimits._maximumAliasedLineWidth;\n },\n },\n\n /**\n * The minimum aliased point size, in pixels, supported by this WebGL implementation. It will be at most one.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.\n */\n minimumAliasedPointSize: {\n get: function () {\n return ContextLimits._minimumAliasedPointSize;\n },\n },\n\n /**\n * The maximum aliased point size, in pixels, supported by this WebGL implementation. It will be at least one.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_POINT_SIZE_RANGE</code>.\n */\n maximumAliasedPointSize: {\n get: function () {\n return ContextLimits._maximumAliasedPointSize;\n },\n },\n\n /**\n * The maximum supported width of the viewport. It will be at least as large as the visible width of the associated canvas.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.\n */\n maximumViewportWidth: {\n get: function () {\n return ContextLimits._maximumViewportWidth;\n },\n },\n\n /**\n * The maximum supported height of the viewport. It will be at least as large as the visible height of the associated canvas.\n * @memberof ContextLimits\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>MAX_VIEWPORT_DIMS</code>.\n */\n maximumViewportHeight: {\n get: function () {\n return ContextLimits._maximumViewportHeight;\n },\n },\n\n /**\n * The maximum degree of anisotropy for texture filtering\n * @memberof ContextLimits\n * @type {Number}\n */\n maximumTextureFilterAnisotropy: {\n get: function () {\n return ContextLimits._maximumTextureFilterAnisotropy;\n },\n },\n\n /**\n * The maximum number of simultaneous outputs that may be written in a fragment shader.\n * @memberof ContextLimits\n * @type {Number}\n */\n maximumDrawBuffers: {\n get: function () {\n return ContextLimits._maximumDrawBuffers;\n },\n },\n\n /**\n * The maximum number of color attachments supported.\n * @memberof ContextLimits\n * @type {Number}\n */\n maximumColorAttachments: {\n get: function () {\n return ContextLimits._maximumColorAttachments;\n },\n },\n\n /**\n * The maximum number of samples supported for multisampling.\n * @memberof ContextLimits\n * @type {Number}\n */\n maximumSamples: {\n get: function () {\n return ContextLimits._maximumSamples;\n },\n },\n\n /**\n * High precision float supported (<code>highp</code>) in fragment shaders.\n * @memberof ContextLimits\n * @type {Boolean}\n */\n highpFloatSupported: {\n get: function () {\n return ContextLimits._highpFloatSupported;\n },\n },\n\n /**\n * High precision int supported (<code>highp</code>) in fragment shaders.\n * @memberof ContextLimits\n * @type {Boolean}\n */\n highpIntSupported: {\n get: function () {\n return ContextLimits._highpIntSupported;\n },\n },\n});\nexport default ContextLimits;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\n\n/**\n * @private\n */\nfunction CubeMapFace(\n context,\n texture,\n textureTarget,\n targetFace,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n) {\n this._context = context;\n this._texture = texture;\n this._textureTarget = textureTarget;\n this._targetFace = targetFace;\n this._pixelDatatype = pixelDatatype;\n this._internalFormat = internalFormat;\n this._pixelFormat = pixelFormat;\n this._size = size;\n this._preMultiplyAlpha = preMultiplyAlpha;\n this._flipY = flipY;\n this._initialized = initialized;\n}\n\nObject.defineProperties(CubeMapFace.prototype, {\n pixelFormat: {\n get: function () {\n return this._pixelFormat;\n },\n },\n pixelDatatype: {\n get: function () {\n return this._pixelDatatype;\n },\n },\n _target: {\n get: function () {\n return this._targetFace;\n },\n },\n});\n\n/**\n * Copies texels from the source to the cubemap's face.\n * @param {Object} options Object with the following properties:\n * @param {Object} options.source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, {@link HTMLVideoElement},\n * or an object with a width, height, and arrayBufferView properties.\n * @param {Number} [options.xOffset=0] An offset in the x direction in the cubemap where copying begins.\n * @param {Number} [options.yOffset=0] An offset in the y direction in the cubemap where copying begins.\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Create a cubemap with 1x1 faces, and make the +x face red.\n * const cubeMap = new CubeMap({\n * context : context\n * width : 1,\n * height : 1\n * });\n * cubeMap.positiveX.copyFrom({\n * source: {\n * width : 1,\n * height : 1,\n * arrayBufferView : new Uint8Array([255, 0, 0, 255])\n * }\n * });\n */\nCubeMapFace.prototype.copyFrom = function (options) {\n const xOffset = defaultValue(options.xOffset, 0);\n const yOffset = defaultValue(options.yOffset, 0);\n\n const source = options.source;\n\n const gl = this._context._gl;\n const target = this._textureTarget;\n const targetFace = this._targetFace;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n\n const width = source.width;\n const height = source.height;\n let arrayBufferView = source.arrayBufferView;\n\n const size = this._size;\n const pixelFormat = this._pixelFormat;\n const internalFormat = this._internalFormat;\n const pixelDatatype = this._pixelDatatype;\n\n const preMultiplyAlpha = this._preMultiplyAlpha;\n const flipY = this._flipY;\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n\n let unpackAlignment = 4;\n if (defined(arrayBufferView)) {\n unpackAlignment = PixelFormat.alignmentInBytes(\n pixelFormat,\n pixelDatatype,\n width\n );\n }\n\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n if (skipColorSpaceConversion) {\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n } else {\n gl.pixelStorei(\n gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n gl.BROWSER_DEFAULT_WEBGL\n );\n }\n\n let uploaded = false;\n if (!this._initialized) {\n if (xOffset === 0 && yOffset === 0 && width === size && height === size) {\n // initialize the entire texture\n if (defined(arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n size,\n size\n );\n }\n gl.texImage2D(\n targetFace,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n arrayBufferView\n );\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n gl.texImage2D(\n targetFace,\n 0,\n internalFormat,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n source\n );\n }\n uploaded = true;\n } else {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n // initialize the entire texture to zero\n const bufferView = PixelFormat.createTypedArray(\n pixelFormat,\n pixelDatatype,\n size,\n size\n );\n gl.texImage2D(\n targetFace,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n bufferView\n );\n }\n this._initialized = true;\n }\n\n if (!uploaded) {\n if (defined(arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n width,\n height\n );\n }\n gl.texSubImage2D(\n targetFace,\n 0,\n xOffset,\n yOffset,\n width,\n height,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n arrayBufferView\n );\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n gl.texSubImage2D(\n targetFace,\n 0,\n xOffset,\n yOffset,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, this._context),\n source\n );\n }\n }\n\n gl.bindTexture(target, null);\n};\n\n/**\n * Copies texels from the framebuffer to the cubemap's face.\n *\n * @param {Number} [xOffset=0] An offset in the x direction in the cubemap where copying begins.\n * @param {Number} [yOffset=0] An offset in the y direction in the cubemap where copying begins.\n * @param {Number} [framebufferXOffset=0] An offset in the x direction in the framebuffer where copying begins from.\n * @param {Number} [framebufferYOffset=0] An offset in the y direction in the framebuffer where copying begins from.\n * @param {Number} [width=CubeMap's width] The width of the subimage to copy.\n * @param {Number} [height=CubeMap's height] The height of the subimage to copy.\n *\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Copy the framebuffer contents to the +x cube map face.\n * cubeMap.positiveX.copyFromFramebuffer();\n */\nCubeMapFace.prototype.copyFromFramebuffer = function (\n xOffset,\n yOffset,\n framebufferXOffset,\n framebufferYOffset,\n width,\n height\n) {\n xOffset = defaultValue(xOffset, 0);\n yOffset = defaultValue(yOffset, 0);\n framebufferXOffset = defaultValue(framebufferXOffset, 0);\n framebufferYOffset = defaultValue(framebufferYOffset, 0);\n width = defaultValue(width, this._size);\n height = defaultValue(height, this._size);\n\n const gl = this._context._gl;\n const target = this._textureTarget;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.copyTexSubImage2D(\n this._targetFace,\n 0,\n xOffset,\n yOffset,\n framebufferXOffset,\n framebufferYOffset,\n width,\n height\n );\n gl.bindTexture(target, null);\n this._initialized = true;\n};\nexport default CubeMapFace;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst MipmapHint = {\n DONT_CARE: WebGLConstants.DONT_CARE,\n FASTEST: WebGLConstants.FASTEST,\n NICEST: WebGLConstants.NICEST,\n\n validate: function (mipmapHint) {\n return (\n mipmapHint === MipmapHint.DONT_CARE ||\n mipmapHint === MipmapHint.FASTEST ||\n mipmapHint === MipmapHint.NICEST\n );\n },\n};\nexport default Object.freeze(MipmapHint);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Enumerates all possible filters used when magnifying WebGL textures.\n *\n * @enum {Number}\n *\n * @see TextureMinificationFilter\n */\nconst TextureMagnificationFilter = {\n /**\n * Samples the texture by returning the closest pixel.\n *\n * @type {Number}\n * @constant\n */\n NEAREST: WebGLConstants.NEAREST,\n /**\n * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.\n *\n * @type {Number}\n * @constant\n */\n LINEAR: WebGLConstants.LINEAR,\n};\n\n/**\n * Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.\n * @param textureMagnificationFilter\n * @returns {Boolean} <code>true</code> if <code>textureMagnificationFilter</code> is valid.\n *\n * @private\n */\nTextureMagnificationFilter.validate = function (textureMagnificationFilter) {\n return (\n textureMagnificationFilter === TextureMagnificationFilter.NEAREST ||\n textureMagnificationFilter === TextureMagnificationFilter.LINEAR\n );\n};\n\nexport default Object.freeze(TextureMagnificationFilter);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Enumerates all possible filters used when minifying WebGL textures.\n *\n * @enum {Number}\n *\n * @see TextureMagnificationFilter\n */\nconst TextureMinificationFilter = {\n /**\n * Samples the texture by returning the closest pixel.\n *\n * @type {Number}\n * @constant\n */\n NEAREST: WebGLConstants.NEAREST,\n /**\n * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.\n *\n * @type {Number}\n * @constant\n */\n LINEAR: WebGLConstants.LINEAR,\n /**\n * Selects the nearest mip level and applies nearest sampling within that level.\n * <p>\n * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n * </p>\n *\n * @type {Number}\n * @constant\n */\n NEAREST_MIPMAP_NEAREST: WebGLConstants.NEAREST_MIPMAP_NEAREST,\n /**\n * Selects the nearest mip level and applies linear sampling within that level.\n * <p>\n * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n * </p>\n *\n * @type {Number}\n * @constant\n */\n LINEAR_MIPMAP_NEAREST: WebGLConstants.LINEAR_MIPMAP_NEAREST,\n /**\n * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.\n * <p>\n * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.\n * </p>\n * <p>\n * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n * </p>\n *\n * @type {Number}\n * @constant\n */\n NEAREST_MIPMAP_LINEAR: WebGLConstants.NEAREST_MIPMAP_LINEAR,\n /**\n * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.\n * <p>\n * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.\n * </p>\n * <p>\n * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.\n * </p>\n * @type {Number}\n * @constant\n */\n LINEAR_MIPMAP_LINEAR: WebGLConstants.LINEAR_MIPMAP_LINEAR,\n};\n\n/**\n * Validates the given <code>textureMinificationFilter</code> with respect to the possible enum values.\n *\n * @private\n *\n * @param textureMinificationFilter\n * @returns {Boolean} <code>true</code> if <code>textureMinificationFilter</code> is valid.\n */\nTextureMinificationFilter.validate = function (textureMinificationFilter) {\n return (\n textureMinificationFilter === TextureMinificationFilter.NEAREST ||\n textureMinificationFilter === TextureMinificationFilter.LINEAR ||\n textureMinificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n textureMinificationFilter ===\n TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n textureMinificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR\n );\n};\n\nexport default Object.freeze(TextureMinificationFilter);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst TextureWrap = {\n CLAMP_TO_EDGE: WebGLConstants.CLAMP_TO_EDGE,\n REPEAT: WebGLConstants.REPEAT,\n MIRRORED_REPEAT: WebGLConstants.MIRRORED_REPEAT,\n\n validate: function (textureWrap) {\n return (\n textureWrap === TextureWrap.CLAMP_TO_EDGE ||\n textureWrap === TextureWrap.REPEAT ||\n textureWrap === TextureWrap.MIRRORED_REPEAT\n );\n },\n};\nexport default Object.freeze(TextureWrap);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\nimport TextureWrap from \"./TextureWrap.js\";\n\n/**\n * @private\n */\nfunction Sampler(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const wrapS = defaultValue(options.wrapS, TextureWrap.CLAMP_TO_EDGE);\n const wrapT = defaultValue(options.wrapT, TextureWrap.CLAMP_TO_EDGE);\n const minificationFilter = defaultValue(\n options.minificationFilter,\n TextureMinificationFilter.LINEAR\n );\n const magnificationFilter = defaultValue(\n options.magnificationFilter,\n TextureMagnificationFilter.LINEAR\n );\n const maximumAnisotropy = defined(options.maximumAnisotropy)\n ? options.maximumAnisotropy\n : 1.0;\n\n this._wrapS = wrapS;\n this._wrapT = wrapT;\n this._minificationFilter = minificationFilter;\n this._magnificationFilter = magnificationFilter;\n this._maximumAnisotropy = maximumAnisotropy;\n}\n\nObject.defineProperties(Sampler.prototype, {\n wrapS: {\n get: function () {\n return this._wrapS;\n },\n },\n wrapT: {\n get: function () {\n return this._wrapT;\n },\n },\n minificationFilter: {\n get: function () {\n return this._minificationFilter;\n },\n },\n magnificationFilter: {\n get: function () {\n return this._magnificationFilter;\n },\n },\n maximumAnisotropy: {\n get: function () {\n return this._maximumAnisotropy;\n },\n },\n});\n\nSampler.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left._wrapS === right._wrapS &&\n left._wrapT === right._wrapT &&\n left._minificationFilter === right._minificationFilter &&\n left._magnificationFilter === right._magnificationFilter &&\n left._maximumAnisotropy === right._maximumAnisotropy)\n );\n};\n\nSampler.NEAREST = Object.freeze(\n new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.NEAREST,\n magnificationFilter: TextureMagnificationFilter.NEAREST,\n })\n);\nexport default Sampler;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport CubeMapFace from \"./CubeMapFace.js\";\nimport MipmapHint from \"./MipmapHint.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Sampler from \"./Sampler.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\n\n/**\n * @private\n */\nfunction CubeMap(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const source = options.source;\n let width;\n let height;\n\n if (defined(source)) {\n const faces = [\n source.positiveX,\n source.negativeX,\n source.positiveY,\n source.negativeY,\n source.positiveZ,\n source.negativeZ,\n ];\n\n width = faces[0].width;\n height = faces[0].height;\n\n} else {\n width = options.width;\n height = options.height;\n }\n\n const size = width;\n const pixelDatatype = defaultValue(\n options.pixelDatatype,\n PixelDatatype.UNSIGNED_BYTE\n );\n const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n const internalFormat = PixelFormat.toInternalFormat(\n pixelFormat,\n pixelDatatype,\n context\n );\n\n const sizeInBytes =\n PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, size, size) * 6;\n\n // Use premultiplied alpha for opaque textures should perform better on Chrome:\n // http://media.tojicode.com/webglCamp4/#20\n const preMultiplyAlpha =\n options.preMultiplyAlpha ||\n pixelFormat === PixelFormat.RGB ||\n pixelFormat === PixelFormat.LUMINANCE;\n const flipY = defaultValue(options.flipY, true);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n\n const gl = context._gl;\n const textureTarget = gl.TEXTURE_CUBE_MAP;\n const texture = gl.createTexture();\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(textureTarget, texture);\n\n function createFace(\n target,\n sourceFace,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n ) {\n let arrayBufferView = sourceFace.arrayBufferView;\n if (!defined(arrayBufferView)) {\n arrayBufferView = sourceFace.bufferView;\n }\n\n let unpackAlignment = 4;\n if (defined(arrayBufferView)) {\n unpackAlignment = PixelFormat.alignmentInBytes(\n pixelFormat,\n pixelDatatype,\n width\n );\n }\n\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n if (skipColorSpaceConversion) {\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n } else {\n gl.pixelStorei(\n gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n gl.BROWSER_DEFAULT_WEBGL\n );\n }\n\n if (defined(arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n size,\n size\n );\n }\n gl.texImage2D(\n target,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n arrayBufferView\n );\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n gl.texImage2D(\n target,\n 0,\n internalFormat,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n sourceFace\n );\n }\n }\n\n if (defined(source)) {\n createFace(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n source.positiveX,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n createFace(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n source.negativeX,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n createFace(\n gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n source.positiveY,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n createFace(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n source.negativeY,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n createFace(\n gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n source.positiveZ,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n createFace(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n source.negativeZ,\n preMultiplyAlpha,\n flipY,\n skipColorSpaceConversion\n );\n } else {\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n 0,\n internalFormat,\n size,\n size,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n }\n gl.bindTexture(textureTarget, null);\n\n this._context = context;\n this._textureFilterAnisotropic = context._textureFilterAnisotropic;\n this._textureTarget = textureTarget;\n this._texture = texture;\n this._pixelFormat = pixelFormat;\n this._pixelDatatype = pixelDatatype;\n this._size = size;\n this._hasMipmap = false;\n this._sizeInBytes = sizeInBytes;\n this._preMultiplyAlpha = preMultiplyAlpha;\n this._flipY = flipY;\n this._sampler = undefined;\n\n const initialized = defined(source);\n this._positiveX = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n this._negativeX = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_NEGATIVE_X,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n this._positiveY = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n this._negativeY = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n this._positiveZ = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n this._negativeZ = new CubeMapFace(\n context,\n texture,\n textureTarget,\n gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n internalFormat,\n pixelFormat,\n pixelDatatype,\n size,\n preMultiplyAlpha,\n flipY,\n initialized\n );\n\n this.sampler = defined(options.sampler) ? options.sampler : new Sampler();\n}\n\nObject.defineProperties(CubeMap.prototype, {\n positiveX: {\n get: function () {\n return this._positiveX;\n },\n },\n negativeX: {\n get: function () {\n return this._negativeX;\n },\n },\n positiveY: {\n get: function () {\n return this._positiveY;\n },\n },\n negativeY: {\n get: function () {\n return this._negativeY;\n },\n },\n positiveZ: {\n get: function () {\n return this._positiveZ;\n },\n },\n negativeZ: {\n get: function () {\n return this._negativeZ;\n },\n },\n sampler: {\n get: function () {\n return this._sampler;\n },\n set: function (sampler) {\n let minificationFilter = sampler.minificationFilter;\n let magnificationFilter = sampler.magnificationFilter;\n\n const mipmap =\n minificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n minificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n minificationFilter ===\n TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n const context = this._context;\n const pixelDatatype = this._pixelDatatype;\n\n // float textures only support nearest filtering unless the linear extensions are supported, so override the sampler's settings\n if (\n (pixelDatatype === PixelDatatype.FLOAT &&\n !context.textureFloatLinear) ||\n (pixelDatatype === PixelDatatype.HALF_FLOAT &&\n !context.textureHalfFloatLinear)\n ) {\n minificationFilter = mipmap\n ? TextureMinificationFilter.NEAREST_MIPMAP_NEAREST\n : TextureMinificationFilter.NEAREST;\n magnificationFilter = TextureMagnificationFilter.NEAREST;\n }\n\n const gl = context._gl;\n const target = this._textureTarget;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);\n gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);\n gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);\n gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);\n if (defined(this._textureFilterAnisotropic)) {\n gl.texParameteri(\n target,\n this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n sampler.maximumAnisotropy\n );\n }\n gl.bindTexture(target, null);\n\n this._sampler = sampler;\n },\n },\n pixelFormat: {\n get: function () {\n return this._pixelFormat;\n },\n },\n pixelDatatype: {\n get: function () {\n return this._pixelDatatype;\n },\n },\n width: {\n get: function () {\n return this._size;\n },\n },\n height: {\n get: function () {\n return this._size;\n },\n },\n sizeInBytes: {\n get: function () {\n if (this._hasMipmap) {\n return Math.floor((this._sizeInBytes * 4) / 3);\n }\n return this._sizeInBytes;\n },\n },\n preMultiplyAlpha: {\n get: function () {\n return this._preMultiplyAlpha;\n },\n },\n flipY: {\n get: function () {\n return this._flipY;\n },\n },\n\n _target: {\n get: function () {\n return this._textureTarget;\n },\n },\n});\n\n/**\n * Generates a complete mipmap chain for each cubemap face.\n *\n * @param {MipmapHint} [hint=MipmapHint.DONT_CARE] A performance vs. quality hint.\n *\n * @exception {DeveloperError} hint is invalid.\n * @exception {DeveloperError} This CubeMap's width must be a power of two to call generateMipmap().\n * @exception {DeveloperError} This CubeMap's height must be a power of two to call generateMipmap().\n * @exception {DeveloperError} This CubeMap was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Generate mipmaps, and then set the sampler so mipmaps are used for\n * // minification when the cube map is sampled.\n * cubeMap.generateMipmap();\n * cubeMap.sampler = new Sampler({\n * minificationFilter : Cesium.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR\n * });\n */\nCubeMap.prototype.generateMipmap = function (hint) {\n hint = defaultValue(hint, MipmapHint.DONT_CARE);\n\n this._hasMipmap = true;\n\n const gl = this._context._gl;\n const target = this._textureTarget;\n gl.hint(gl.GENERATE_MIPMAP_HINT, hint);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.generateMipmap(target);\n gl.bindTexture(target, null);\n};\n\nCubeMap.prototype.isDestroyed = function () {\n return false;\n};\n\nCubeMap.prototype.destroy = function () {\n this._context._gl.deleteTexture(this._texture);\n this._positiveX = destroyObject(this._positiveX);\n this._negativeX = destroyObject(this._negativeX);\n this._positiveY = destroyObject(this._positiveY);\n this._negativeY = destroyObject(this._negativeY);\n this._positiveZ = destroyObject(this._positiveZ);\n this._negativeZ = destroyObject(this._negativeZ);\n return destroyObject(this);\n};\nexport default CubeMap;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport MipmapHint from \"./MipmapHint.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Sampler from \"./Sampler.js\";\nimport TextureMagnificationFilter from \"./TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"./TextureMinificationFilter.js\";\n\n/**\n * @private\n */\nfunction Texture(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n let width = options.width;\n let height = options.height;\n const source = options.source;\n\n if (defined(source)) {\n if (!defined(width)) {\n width = defaultValue(source.videoWidth, source.width);\n }\n if (!defined(height)) {\n height = defaultValue(source.videoHeight, source.height);\n }\n }\n\n const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n const pixelDatatype = defaultValue(\n options.pixelDatatype,\n PixelDatatype.UNSIGNED_BYTE\n );\n const internalFormat = PixelFormat.toInternalFormat(\n pixelFormat,\n pixelDatatype,\n context\n );\n\n const isCompressed = PixelFormat.isCompressedFormat(internalFormat);\n\n // Use premultiplied alpha for opaque textures should perform better on Chrome:\n // http://media.tojicode.com/webglCamp4/#20\n const preMultiplyAlpha =\n options.preMultiplyAlpha ||\n pixelFormat === PixelFormat.RGB ||\n pixelFormat === PixelFormat.LUMINANCE;\n const flipY = defaultValue(options.flipY, true);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n\n let initialized = true;\n\n const gl = context._gl;\n const textureTarget = gl.TEXTURE_2D;\n const texture = gl.createTexture();\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(textureTarget, texture);\n\n let unpackAlignment = 4;\n if (defined(source) && defined(source.arrayBufferView) && !isCompressed) {\n unpackAlignment = PixelFormat.alignmentInBytes(\n pixelFormat,\n pixelDatatype,\n width\n );\n }\n\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n if (skipColorSpaceConversion) {\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n } else {\n gl.pixelStorei(\n gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n gl.BROWSER_DEFAULT_WEBGL\n );\n }\n\n if (defined(source)) {\n if (defined(source.arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n // Source: typed array\n let arrayBufferView = source.arrayBufferView;\n let i, mipWidth, mipHeight;\n if (isCompressed) {\n gl.compressedTexImage2D(\n textureTarget,\n 0,\n internalFormat,\n width,\n height,\n 0,\n arrayBufferView\n );\n if (defined(source.mipLevels)) {\n mipWidth = width;\n mipHeight = height;\n for (i = 0; i < source.mipLevels.length; ++i) {\n mipWidth = Math.floor(mipWidth / 2) | 0;\n if (mipWidth < 1) {\n mipWidth = 1;\n }\n mipHeight = Math.floor(mipHeight / 2) | 0;\n if (mipHeight < 1) {\n mipHeight = 1;\n }\n gl.compressedTexImage2D(\n textureTarget,\n i + 1,\n internalFormat,\n mipWidth,\n mipHeight,\n 0,\n source.mipLevels[i]\n );\n }\n }\n } else {\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n width,\n height\n );\n }\n gl.texImage2D(\n textureTarget,\n 0,\n internalFormat,\n width,\n height,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n arrayBufferView\n );\n\n if (defined(source.mipLevels)) {\n mipWidth = width;\n mipHeight = height;\n for (i = 0; i < source.mipLevels.length; ++i) {\n mipWidth = Math.floor(mipWidth / 2) | 0;\n if (mipWidth < 1) {\n mipWidth = 1;\n }\n mipHeight = Math.floor(mipHeight / 2) | 0;\n if (mipHeight < 1) {\n mipHeight = 1;\n }\n gl.texImage2D(\n textureTarget,\n i + 1,\n internalFormat,\n mipWidth,\n mipHeight,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n source.mipLevels[i]\n );\n }\n }\n }\n } else if (defined(source.framebuffer)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n // Source: framebuffer\n if (source.framebuffer !== context.defaultFramebuffer) {\n source.framebuffer._bind();\n }\n\n gl.copyTexImage2D(\n textureTarget,\n 0,\n internalFormat,\n source.xOffset,\n source.yOffset,\n width,\n height,\n 0\n );\n\n if (source.framebuffer !== context.defaultFramebuffer) {\n source.framebuffer._unBind();\n }\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n // Source: ImageData, HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement\n gl.texImage2D(\n textureTarget,\n 0,\n internalFormat,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n source\n );\n }\n } else {\n gl.texImage2D(\n textureTarget,\n 0,\n internalFormat,\n width,\n height,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n null\n );\n initialized = false;\n }\n gl.bindTexture(textureTarget, null);\n\n let sizeInBytes;\n if (isCompressed) {\n sizeInBytes = PixelFormat.compressedTextureSizeInBytes(\n pixelFormat,\n width,\n height\n );\n } else {\n sizeInBytes = PixelFormat.textureSizeInBytes(\n pixelFormat,\n pixelDatatype,\n width,\n height\n );\n }\n\n this._id = createGuid();\n this._context = context;\n this._textureFilterAnisotropic = context._textureFilterAnisotropic;\n this._textureTarget = textureTarget;\n this._texture = texture;\n this._internalFormat = internalFormat;\n this._pixelFormat = pixelFormat;\n this._pixelDatatype = pixelDatatype;\n this._width = width;\n this._height = height;\n this._dimensions = new Cartesian2(width, height);\n this._hasMipmap = false;\n this._sizeInBytes = sizeInBytes;\n this._preMultiplyAlpha = preMultiplyAlpha;\n this._flipY = flipY;\n this._initialized = initialized;\n this._sampler = undefined;\n\n this.sampler = defined(options.sampler) ? options.sampler : new Sampler();\n}\n\n/**\n * This function is identical to using the Texture constructor except that it can be\n * replaced with a mock/spy in tests.\n * @private\n */\nTexture.create = function (options) {\n return new Texture(options);\n};\n\n/**\n * Creates a texture, and copies a subimage of the framebuffer to it. When called without arguments,\n * the texture is the same width and height as the framebuffer and contains its contents.\n *\n * @param {Object} options Object with the following properties:\n * @param {Context} options.context The context in which the Texture gets created.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGB] The texture's internal pixel format.\n * @param {Number} [options.framebufferXOffset=0] An offset in the x direction in the framebuffer where copying begins from.\n * @param {Number} [options.framebufferYOffset=0] An offset in the y direction in the framebuffer where copying begins from.\n * @param {Number} [options.width=canvas.clientWidth] The width of the texture in texels.\n * @param {Number} [options.height=canvas.clientHeight] The height of the texture in texels.\n * @param {Framebuffer} [options.framebuffer=defaultFramebuffer] The framebuffer from which to create the texture. If this\n * parameter is not specified, the default framebuffer is used.\n * @returns {Texture} A texture with contents from the framebuffer.\n *\n * @exception {DeveloperError} Invalid pixelFormat.\n * @exception {DeveloperError} pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset + width must be less than or equal to canvas.clientWidth.\n * @exception {DeveloperError} framebufferYOffset + height must be less than or equal to canvas.clientHeight.\n *\n *\n * @example\n * // Create a texture with the contents of the framebuffer.\n * const t = Texture.fromFramebuffer({\n * context : context\n * });\n *\n * @see Sampler\n *\n * @private\n */\nTexture.fromFramebuffer = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const gl = context._gl;\n\n const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGB);\n const framebufferXOffset = defaultValue(options.framebufferXOffset, 0);\n const framebufferYOffset = defaultValue(options.framebufferYOffset, 0);\n const width = defaultValue(options.width, gl.drawingBufferWidth);\n const height = defaultValue(options.height, gl.drawingBufferHeight);\n const framebuffer = options.framebuffer;\n\n const texture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: pixelFormat,\n source: {\n framebuffer: defined(framebuffer)\n ? framebuffer\n : context.defaultFramebuffer,\n xOffset: framebufferXOffset,\n yOffset: framebufferYOffset,\n width: width,\n height: height,\n },\n });\n\n return texture;\n};\n\nObject.defineProperties(Texture.prototype, {\n /**\n * A unique id for the texture\n * @memberof Texture.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * The sampler to use when sampling this texture.\n * Create a sampler by calling {@link Sampler}. If this\n * parameter is not specified, a default sampler is used. The default sampler clamps texture\n * coordinates in both directions, uses linear filtering for both magnification and minification,\n * and uses a maximum anisotropy of 1.0.\n * @memberof Texture.prototype\n * @type {Object}\n */\n sampler: {\n get: function () {\n return this._sampler;\n },\n set: function (sampler) {\n let minificationFilter = sampler.minificationFilter;\n let magnificationFilter = sampler.magnificationFilter;\n const context = this._context;\n const pixelFormat = this._pixelFormat;\n const pixelDatatype = this._pixelDatatype;\n\n const mipmap =\n minificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n minificationFilter ===\n TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n minificationFilter ===\n TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n minificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n // float textures only support nearest filtering unless the linear extensions are supported, so override the sampler's settings\n if (\n (pixelDatatype === PixelDatatype.FLOAT &&\n !context.textureFloatLinear) ||\n (pixelDatatype === PixelDatatype.HALF_FLOAT &&\n !context.textureHalfFloatLinear)\n ) {\n minificationFilter = mipmap\n ? TextureMinificationFilter.NEAREST_MIPMAP_NEAREST\n : TextureMinificationFilter.NEAREST;\n magnificationFilter = TextureMagnificationFilter.NEAREST;\n }\n\n // WebGL 2 depth texture only support nearest filtering. See section 3.8.13 OpenGL ES 3 spec\n if (context.webgl2) {\n if (PixelFormat.isDepthFormat(pixelFormat)) {\n minificationFilter = TextureMinificationFilter.NEAREST;\n magnificationFilter = TextureMagnificationFilter.NEAREST;\n }\n }\n\n const gl = context._gl;\n const target = this._textureTarget;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);\n gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);\n gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);\n gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);\n if (defined(this._textureFilterAnisotropic)) {\n gl.texParameteri(\n target,\n this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n sampler.maximumAnisotropy\n );\n }\n gl.bindTexture(target, null);\n\n this._sampler = sampler;\n },\n },\n pixelFormat: {\n get: function () {\n return this._pixelFormat;\n },\n },\n pixelDatatype: {\n get: function () {\n return this._pixelDatatype;\n },\n },\n dimensions: {\n get: function () {\n return this._dimensions;\n },\n },\n preMultiplyAlpha: {\n get: function () {\n return this._preMultiplyAlpha;\n },\n },\n flipY: {\n get: function () {\n return this._flipY;\n },\n },\n width: {\n get: function () {\n return this._width;\n },\n },\n height: {\n get: function () {\n return this._height;\n },\n },\n sizeInBytes: {\n get: function () {\n if (this._hasMipmap) {\n return Math.floor((this._sizeInBytes * 4) / 3);\n }\n return this._sizeInBytes;\n },\n },\n _target: {\n get: function () {\n return this._textureTarget;\n },\n },\n});\n\n/**\n * Copy new image data into this texture, from a source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement}.\n * or an object with width, height, and arrayBufferView properties.\n * @param {Object} options Object with the following properties:\n * @param {Object} options.source The source {@link ImageData}, {@link HTMLImageElement}, {@link HTMLCanvasElement}, or {@link HTMLVideoElement},\n * or an object with width, height, and arrayBufferView properties.\n * @param {Number} [options.xOffset=0] The offset in the x direction within the texture to copy into.\n * @param {Number} [options.yOffset=0] The offset in the y direction within the texture to copy into.\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the texture will be ignored.\n *\n * @exception {DeveloperError} Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call copyFrom with a compressed texture pixel format.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + source.width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + source.height must be less than or equal to height.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n *\n * @example\n * texture.copyFrom({\n * source: {\n * width : 1,\n * height : 1,\n * arrayBufferView : new Uint8Array([255, 0, 0, 255])\n * }\n * });\n */\nTexture.prototype.copyFrom = function (options) {\n const xOffset = defaultValue(options.xOffset, 0);\n const yOffset = defaultValue(options.yOffset, 0);\n\n const source = options.source;\n\n const context = this._context;\n const gl = context._gl;\n const target = this._textureTarget;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n\n const width = source.width;\n const height = source.height;\n let arrayBufferView = source.arrayBufferView;\n\n const textureWidth = this._width;\n const textureHeight = this._height;\n const internalFormat = this._internalFormat;\n const pixelFormat = this._pixelFormat;\n const pixelDatatype = this._pixelDatatype;\n\n const preMultiplyAlpha = this._preMultiplyAlpha;\n const flipY = this._flipY;\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n\n let unpackAlignment = 4;\n if (defined(arrayBufferView)) {\n unpackAlignment = PixelFormat.alignmentInBytes(\n pixelFormat,\n pixelDatatype,\n width\n );\n }\n\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);\n\n if (skipColorSpaceConversion) {\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n } else {\n gl.pixelStorei(\n gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,\n gl.BROWSER_DEFAULT_WEBGL\n );\n }\n\n let uploaded = false;\n if (!this._initialized) {\n if (\n xOffset === 0 &&\n yOffset === 0 &&\n width === textureWidth &&\n height === textureHeight\n ) {\n // initialize the entire texture\n if (defined(arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n textureWidth,\n textureHeight\n );\n }\n gl.texImage2D(\n target,\n 0,\n internalFormat,\n textureWidth,\n textureHeight,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n arrayBufferView\n );\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n gl.texImage2D(\n target,\n 0,\n internalFormat,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n source\n );\n }\n uploaded = true;\n } else {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n // initialize the entire texture to zero\n const bufferView = PixelFormat.createTypedArray(\n pixelFormat,\n pixelDatatype,\n textureWidth,\n textureHeight\n );\n gl.texImage2D(\n target,\n 0,\n internalFormat,\n textureWidth,\n textureHeight,\n 0,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n bufferView\n );\n }\n this._initialized = true;\n }\n\n if (!uploaded) {\n if (defined(arrayBufferView)) {\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n if (flipY) {\n arrayBufferView = PixelFormat.flipY(\n arrayBufferView,\n pixelFormat,\n pixelDatatype,\n width,\n height\n );\n }\n gl.texSubImage2D(\n target,\n 0,\n xOffset,\n yOffset,\n width,\n height,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n arrayBufferView\n );\n } else {\n // Only valid for DOM-Element uploads\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);\n\n gl.texSubImage2D(\n target,\n 0,\n xOffset,\n yOffset,\n pixelFormat,\n PixelDatatype.toWebGLConstant(pixelDatatype, context),\n source\n );\n }\n }\n\n gl.bindTexture(target, null);\n};\n\n/**\n * @param {Number} [xOffset=0] The offset in the x direction within the texture to copy into.\n * @param {Number} [yOffset=0] The offset in the y direction within the texture to copy into.\n * @param {Number} [framebufferXOffset=0] optional\n * @param {Number} [framebufferYOffset=0] optional\n * @param {Number} [width=width] optional\n * @param {Number} [height=height] optional\n *\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.\n * @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.\n * @exception {DeveloperError} Cannot call copyFrom with a compressed texture pixel format.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n * @exception {DeveloperError} xOffset must be greater than or equal to zero.\n * @exception {DeveloperError} yOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferXOffset must be greater than or equal to zero.\n * @exception {DeveloperError} framebufferYOffset must be greater than or equal to zero.\n * @exception {DeveloperError} xOffset + width must be less than or equal to width.\n * @exception {DeveloperError} yOffset + height must be less than or equal to height.\n */\nTexture.prototype.copyFromFramebuffer = function (\n xOffset,\n yOffset,\n framebufferXOffset,\n framebufferYOffset,\n width,\n height\n) {\n xOffset = defaultValue(xOffset, 0);\n yOffset = defaultValue(yOffset, 0);\n framebufferXOffset = defaultValue(framebufferXOffset, 0);\n framebufferYOffset = defaultValue(framebufferYOffset, 0);\n width = defaultValue(width, this._width);\n height = defaultValue(height, this._height);\n\n const gl = this._context._gl;\n const target = this._textureTarget;\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.copyTexSubImage2D(\n target,\n 0,\n xOffset,\n yOffset,\n framebufferXOffset,\n framebufferYOffset,\n width,\n height\n );\n gl.bindTexture(target, null);\n this._initialized = true;\n};\n\n/**\n * @param {MipmapHint} [hint=MipmapHint.DONT_CARE] optional.\n *\n * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.\n * @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is a compressed format.\n * @exception {DeveloperError} hint is invalid.\n * @exception {DeveloperError} This texture's width must be a power of two to call generateMipmap() in a WebGL1 context.\n * @exception {DeveloperError} This texture's height must be a power of two to call generateMipmap() in a WebGL1 context.\n * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.\n */\nTexture.prototype.generateMipmap = function (hint) {\n hint = defaultValue(hint, MipmapHint.DONT_CARE);\n\n this._hasMipmap = true;\n\n const gl = this._context._gl;\n const target = this._textureTarget;\n\n gl.hint(gl.GENERATE_MIPMAP_HINT, hint);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(target, this._texture);\n gl.generateMipmap(target);\n gl.bindTexture(target, null);\n};\n\nTexture.prototype.isDestroyed = function () {\n return false;\n};\n\nTexture.prototype.destroy = function () {\n this._context._gl.deleteTexture(this._texture);\n return destroyObject(this);\n};\nexport default Texture;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\\n\\\nrampColor = czm_gammaCorrect(rampColor);\\n\\\nmaterial.diffuse = rampColor.rgb;\\n\\\nmaterial.alpha = rampColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float strength;\\n\\\nuniform vec2 repeat;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nvec2 centerPixel = fract(repeat * st);\\n\\\nfloat centerBump = texture2D(image, centerPixel).channel;\\n\\\nfloat imageWidth = float(imageDimensions.x);\\n\\\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\\n\\\nfloat rightBump = texture2D(image, rightPixel).channel;\\n\\\nfloat imageHeight = float(imageDimensions.y);\\n\\\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\\n\\\nfloat topBump = texture2D(image, leftPixel).channel;\\n\\\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\\n\\\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\\n\\\nmaterial.normal = normalEC;\\n\\\nmaterial.diffuse = vec3(0.01);\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 lightColor;\\n\\\nuniform vec4 darkColor;\\n\\\nuniform vec2 repeat;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\\n\\\nfloat scaledWidth = fract(repeat.s * st.s);\\n\\\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\\n\\\nfloat scaledHeight = fract(repeat.t * st.t);\\n\\\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\\n\\\nfloat value = min(scaledWidth, scaledHeight);\\n\\\nvec4 currentColor = mix(lightColor, darkColor, b);\\n\\\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 lightColor;\\n\\\nuniform vec4 darkColor;\\n\\\nuniform vec2 repeat;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\\n\\\nvec4 color = mix(lightColor, darkColor, b);\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D heights;\\n\\\nuniform sampler2D colors;\\n\\\nfloat getHeight(int idx, float invTexSize)\\n\\\n{\\n\\\nvec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\\n\\\n#ifdef OES_texture_float\\n\\\nreturn texture2D(heights, uv).x;\\n\\\n#else\\n\\\nreturn czm_unpackFloat(texture2D(heights, uv));\\n\\\n#endif\\n\\\n}\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat height = materialInput.height;\\n\\\nfloat invTexSize = 1.0 / float(heightsDimensions.x);\\n\\\nfloat minHeight = getHeight(0, invTexSize);\\n\\\nfloat maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\\n\\\nif (height < minHeight || height > maxHeight) {\\n\\\nmaterial.diffuse = vec3(0.0);\\n\\\nmaterial.alpha = 0.0;\\n\\\nreturn material;\\n\\\n}\\n\\\nint idxBelow = 0;\\n\\\nint idxAbove = heightsDimensions.x;\\n\\\nfloat heightBelow = minHeight;\\n\\\nfloat heightAbove = maxHeight;\\n\\\nconst int maxIterations = 16;\\n\\\nfor (int i = 0; i < maxIterations; i++) {\\n\\\nif (idxBelow >= idxAbove - 1) {\\n\\\nbreak;\\n\\\n}\\n\\\nint idxMid = (idxBelow + idxAbove) / 2;\\n\\\nfloat heightTex = getHeight(idxMid, invTexSize);\\n\\\nif (height > heightTex) {\\n\\\nidxBelow = idxMid;\\n\\\nheightBelow = heightTex;\\n\\\n} else {\\n\\\nidxAbove = idxMid;\\n\\\nheightAbove = heightTex;\\n\\\n}\\n\\\n}\\n\\\nfloat lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\\n\\\nvec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\\n\\\nvec4 color = texture2D(colors, colorUv);\\n\\\nif (color.a > 0.0)\\n\\\n{\\n\\\ncolor.rgb /= color.a;\\n\\\n}\\n\\\ncolor.rgb = czm_gammaCorrect(color.rgb);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\nuniform vec4 color;\\n\\\nuniform float spacing;\\n\\\nuniform float width;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat distanceToContour = mod(materialInput.height, spacing);\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\nfloat dxc = abs(dFdx(materialInput.height));\\n\\\nfloat dyc = abs(dFdy(materialInput.height));\\n\\\nfloat dF = max(dxc, dyc) * czm_pixelRatio * width;\\n\\\nfloat alpha = (distanceToContour < dF) ? 1.0 : 0.0;\\n\\\n#else\\n\\\nfloat alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\\n\\\n#endif\\n\\\nvec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\\n\\\nmaterial.diffuse = outColor.rgb;\\n\\\nmaterial.alpha = outColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float minimumHeight;\\n\\\nuniform float maximumHeight;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\\n\\\nvec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\\n\\\nrampColor = czm_gammaCorrect(rampColor);\\n\\\nmaterial.diffuse = rampColor.rgb;\\n\\\nmaterial.alpha = rampColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 fadeInColor;\\n\\\nuniform vec4 fadeOutColor;\\n\\\nuniform float maximumDistance;\\n\\\nuniform bool repeat;\\n\\\nuniform vec2 fadeDirection;\\n\\\nuniform vec2 time;\\n\\\nfloat getTime(float t, float coord)\\n\\\n{\\n\\\nfloat scalar = 1.0 / maximumDistance;\\n\\\nfloat q = distance(t, coord) * scalar;\\n\\\nif (repeat)\\n\\\n{\\n\\\nfloat r = distance(t, coord + 1.0) * scalar;\\n\\\nfloat s = distance(t, coord - 1.0) * scalar;\\n\\\nq = min(min(r, s), q);\\n\\\n}\\n\\\nreturn clamp(q, 0.0, 1.0);\\n\\\n}\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\\n\\\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\\n\\\nfloat u = length(vec2(s, t));\\n\\\nvec4 color = mix(fadeInColor, fadeOutColor, u);\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\nmaterial.emission = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\nuniform vec4 color;\\n\\\nuniform float cellAlpha;\\n\\\nuniform vec2 lineCount;\\n\\\nuniform vec2 lineThickness;\\n\\\nuniform vec2 lineOffset;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\\n\\\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\\n\\\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\\n\\\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\\n\\\nfloat value;\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\nconst float fuzz = 1.2;\\n\\\nvec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\\n\\\nvec2 dx = abs(dFdx(st));\\n\\\nvec2 dy = abs(dFdy(st));\\n\\\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\\n\\\nvalue = min(\\n\\\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\\n\\\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\\n\\\n#else\\n\\\nconst float fuzz = 0.05;\\n\\\nvec2 range = 0.5 - (lineThickness * 0.05);\\n\\\nvalue = min(\\n\\\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\\n\\\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\\n\\\n#endif\\n\\\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\\n\\\nfloat sRim = smoothstep(0.8, 1.0, dRim);\\n\\\nvalue *= (1.0 - sRim);\\n\\\nvec4 halfColor;\\n\\\nhalfColor.rgb = color.rgb * 0.5;\\n\\\nhalfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\\n\\\nhalfColor = czm_gammaCorrect(halfColor);\\n\\\nmaterial.diffuse = halfColor.rgb;\\n\\\nmaterial.emission = halfColor.rgb;\\n\\\nmaterial.alpha = halfColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nuniform float strength;\\n\\\nuniform vec2 repeat;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\\n\\\nvec3 normalTangentSpace = textureValue.channels;\\n\\\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\\n\\\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\\n\\\nnormalTangentSpace = normalize(normalTangentSpace);\\n\\\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\\n\\\nmaterial.normal = normalEC;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\nuniform vec4 color;\\n\\\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\\n\\\n{\\n\\\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\\n\\\nreturn slope * (x - p0.x) + p0.y;\\n\\\n}\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\\n\\\n#else\\n\\\nfloat base = 0.975;\\n\\\n#endif\\n\\\nvec2 center = vec2(1.0, 0.5);\\n\\\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\\n\\\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\\n\\\nfloat halfWidth = 0.15;\\n\\\nfloat s = step(0.5 - halfWidth, st.t);\\n\\\ns *= 1.0 - step(0.5 + halfWidth, st.t);\\n\\\ns *= 1.0 - step(base, st.s);\\n\\\nfloat t = step(base, materialInput.st.s);\\n\\\nt *= 1.0 - step(ptOnUpperLine, st.t);\\n\\\nt *= step(ptOnLowerLine, st.t);\\n\\\nfloat dist;\\n\\\nif (st.s < base)\\n\\\n{\\n\\\nfloat d1 = abs(st.t - (0.5 - halfWidth));\\n\\\nfloat d2 = abs(st.t - (0.5 + halfWidth));\\n\\\ndist = min(d1, d2);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat d1 = czm_infinity;\\n\\\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\\n\\\n{\\n\\\nd1 = abs(st.s - base);\\n\\\n}\\n\\\nfloat d2 = abs(st.t - ptOnUpperLine);\\n\\\nfloat d3 = abs(st.t - ptOnLowerLine);\\n\\\ndist = min(min(d1, d2), d3);\\n\\\n}\\n\\\nvec4 outsideColor = vec4(0.0);\\n\\\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\\n\\\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\\n\\\noutColor = czm_gammaCorrect(outColor);\\n\\\nmaterial.diffuse = outColor.rgb;\\n\\\nmaterial.alpha = outColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 gapColor;\\n\\\nuniform float dashLength;\\n\\\nuniform float dashPattern;\\n\\\nvarying float v_polylineAngle;\\n\\\nconst float maskLength = 16.0;\\n\\\nmat2 rotate(float rad) {\\n\\\nfloat c = cos(rad);\\n\\\nfloat s = sin(rad);\\n\\\nreturn mat2(\\n\\\nc, s,\\n\\\n-s, c\\n\\\n);\\n\\\n}\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\\n\\\nfloat dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\\n\\\nfloat maskIndex = floor(dashPosition * maskLength);\\n\\\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\\n\\\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\\n\\\nif (fragColor.a < 0.005) {\\n\\\ndiscard;\\n\\\n}\\n\\\nfragColor = czm_gammaCorrect(fragColor);\\n\\\nmaterial.emission = fragColor.rgb;\\n\\\nmaterial.alpha = fragColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform float glowPower;\\n\\\nuniform float taperPower;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\\n\\\nif (taperPower <= 0.99999) {\\n\\\nglow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\\n\\\n}\\n\\\nvec4 fragColor;\\n\\\nfragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\\n\\\nfragColor.a = clamp(0.0, 1.0, glow) * color.a;\\n\\\nfragColor = czm_gammaCorrect(fragColor);\\n\\\nmaterial.emission = fragColor.rgb;\\n\\\nmaterial.alpha = fragColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 outlineColor;\\n\\\nuniform float outlineWidth;\\n\\\nvarying float v_width;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec2 st = materialInput.st;\\n\\\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\\n\\\nfloat b = step(0.5 - halfInteriorWidth, st.t);\\n\\\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\\n\\\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\\n\\\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\\n\\\nfloat dist = min(d1, d2);\\n\\\nvec4 currentColor = mix(outlineColor, color, b);\\n\\\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\\n\\\noutColor = czm_gammaCorrect(outColor);\\n\\\nmaterial.diffuse = outColor.rgb;\\n\\\nmaterial.alpha = outColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 color;\\n\\\nuniform vec4 rimColor;\\n\\\nuniform float width;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\\n\\\nfloat s = smoothstep(1.0 - width, 1.0, d);\\n\\\nvec4 outColor = czm_gammaCorrect(color);\\n\\\nvec4 outRimColor = czm_gammaCorrect(rimColor);\\n\\\nmaterial.diffuse = outColor.rgb;\\n\\\nmaterial.emission = outRimColor.rgb * s;\\n\\\nmaterial.alpha = mix(outColor.a, outRimColor.a, s);\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D image;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nvec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\\n\\\nrampColor = czm_gammaCorrect(rampColor);\\n\\\nmaterial.diffuse = rampColor.rgb;\\n\\\nmaterial.alpha = rampColor.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 evenColor;\\n\\\nuniform vec4 oddColor;\\n\\\nuniform float offset;\\n\\\nuniform float repeat;\\n\\\nuniform bool horizontal;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\\n\\\nfloat value = fract((coord - offset) * (repeat * 0.5));\\n\\\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\\n\\\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\\n\\\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D specularMap;\\n\\\nuniform sampler2D normalMap;\\n\\\nuniform vec4 baseWaterColor;\\n\\\nuniform vec4 blendColor;\\n\\\nuniform float frequency;\\n\\\nuniform float animationSpeed;\\n\\\nuniform float amplitude;\\n\\\nuniform float specularIntensity;\\n\\\nuniform float fadeFactor;\\n\\\nczm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nfloat time = czm_frameNumber * animationSpeed;\\n\\\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\\n\\\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\\n\\\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\\n\\\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\\n\\\nnormalTangentSpace.xy /= fade;\\n\\\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\\n\\\nnormalTangentSpace = normalize(normalTangentSpace);\\n\\\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\\n\\\nmaterial.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\\n\\\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\\n\\\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\\n\\\nmaterial.diffuse = material.diffuse;\\n\\\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\\n\\\nmaterial.specular = specularIntensity;\\n\\\nmaterial.shininess = 10.0;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport AspectRampMaterial from \"../Shaders/Materials/AspectRampMaterial.js\";\nimport BumpMapMaterial from \"../Shaders/Materials/BumpMapMaterial.js\";\nimport CheckerboardMaterial from \"../Shaders/Materials/CheckerboardMaterial.js\";\nimport DotMaterial from \"../Shaders/Materials/DotMaterial.js\";\nimport ElevationBandMaterial from \"../Shaders/Materials/ElevationBandMaterial.js\";\nimport ElevationContourMaterial from \"../Shaders/Materials/ElevationContourMaterial.js\";\nimport ElevationRampMaterial from \"../Shaders/Materials/ElevationRampMaterial.js\";\nimport FadeMaterial from \"../Shaders/Materials/FadeMaterial.js\";\nimport GridMaterial from \"../Shaders/Materials/GridMaterial.js\";\nimport NormalMapMaterial from \"../Shaders/Materials/NormalMapMaterial.js\";\nimport PolylineArrowMaterial from \"../Shaders/Materials/PolylineArrowMaterial.js\";\nimport PolylineDashMaterial from \"../Shaders/Materials/PolylineDashMaterial.js\";\nimport PolylineGlowMaterial from \"../Shaders/Materials/PolylineGlowMaterial.js\";\nimport PolylineOutlineMaterial from \"../Shaders/Materials/PolylineOutlineMaterial.js\";\nimport RimLightingMaterial from \"../Shaders/Materials/RimLightingMaterial.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport SlopeRampMaterial from \"../Shaders/Materials/SlopeRampMaterial.js\";\nimport StripeMaterial from \"../Shaders/Materials/StripeMaterial.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport WaterMaterial from \"../Shaders/Materials/Water.js\";\n\n/**\n * A Material defines surface appearance through a combination of diffuse, specular,\n * normal, emission, and alpha components. These values are specified using a\n * JSON schema called Fabric which gets parsed and assembled into glsl shader code\n * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}\n * for more details on Fabric.\n * <br /><br />\n * <style type=\"text/css\">\n * #materialDescriptions code {\n * font-weight: normal;\n * font-family: Consolas, 'Lucida Console', Monaco, monospace;\n * color: #A35A00;\n * }\n * #materialDescriptions ul, #materialDescriptions ul ul {\n * list-style-type: none;\n * }\n * #materialDescriptions ul ul {\n * margin-bottom: 10px;\n * }\n * #materialDescriptions ul ul li {\n * font-weight: normal;\n * color: #000000;\n * text-indent: -2em;\n * margin-left: 2em;\n * }\n * #materialDescriptions ul li {\n * font-weight: bold;\n * color: #0053CF;\n * }\n * </style>\n *\n * Base material types and their uniforms:\n * <div id='materialDescriptions'>\n * <ul>\n * <li>Color</li>\n * <ul>\n * <li><code>color</code>: rgba color object.</li>\n * </ul>\n * <li>Image</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * </ul>\n * <li>DiffuseMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * </ul>\n * <li>AlphaMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * </ul>\n * <li>SpecularMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * </ul>\n * <li>EmissionMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * </ul>\n * <li>BumpMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>\n * </ul>\n * <li>NormalMap</li>\n * <ul>\n * <li><code>image</code>: path to image.</li>\n * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>\n * <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>\n * </ul>\n * <li>Grid</li>\n * <ul>\n * <li><code>color</code>: rgba color object for the whole material.</li>\n * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>\n * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>\n * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>\n * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>\n * </ul>\n * <li>Stripe</li>\n * <ul>\n * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>\n * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>\n * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>\n * <li><code>offset</code>: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.</li>\n * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>\n * </ul>\n * <li>Checkerboard</li>\n * <ul>\n * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>\n * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>\n * </ul>\n * <li>Dot</li>\n * <ul>\n * <li><code>lightColor</code>: rgba color object for the dot color.</li>\n * <li><code>darkColor</code>: rgba color object for the background color.</li>\n * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>\n * </ul>\n * <li>Water</li>\n * <ul>\n * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>\n * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>\n * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>\n * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>\n * <li><code>frequency</code>: Number that controls the number of waves.</li>\n * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>\n * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>\n * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>\n * </ul>\n * <li>RimLighting</li>\n * <ul>\n * <li><code>color</code>: diffuse color and alpha.</li>\n * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>\n * <li><code>width</code>: Number that determines the rim's width.</li>\n * </ul>\n * <li>Fade</li>\n * <ul>\n * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>\n * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>\n * <li><code>maximumDistance</code>: Number between 0.0 and 1.0 where the <code>fadeInColor</code> becomes the <code>fadeOutColor</code>. A value of 0.0 gives the entire material a color of <code>fadeOutColor</code> and a value of 1.0 gives the the entire material a color of <code>fadeInColor</code></li>\n * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>\n * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>\n * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>\n * </ul>\n * <li>PolylineArrow</li>\n * <ul>\n * <li><code>color</code>: diffuse color and alpha.</li>\n * </ul>\n * <li>PolylineDash</li>\n * <ul>\n * <li><code>color</code>: color for the line.</li>\n * <li><code>gapColor</code>: color for the gaps in the line.</li>\n * <li><code>dashLength</code>: Dash length in pixels.</li>\n * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>\n * </ul>\n * <li>PolylineGlow</li>\n * <ul>\n * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>\n * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>\n * <li><code>taperPower</code>: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.</li>\n * </ul>\n * <li>PolylineOutline</li>\n * <ul>\n * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>\n * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>\n * <li><code>outlineWidth</code>: width of the outline in pixels.</li>\n * </ul>\n * <li>ElevationContour</li>\n * <ul>\n * <li><code>color</code>: color and alpha for the contour line.</li>\n * <li><code>spacing</code>: spacing for contour lines in meters.</li>\n * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>\n * </ul>\n * <li>ElevationRamp</li>\n * <ul>\n * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>\n * <li><code>minimumHeight</code>: minimum height for the ramp.</li>\n * <li><code>maximumHeight</code>: maximum height for the ramp.</li>\n * </ul>\n * <li>SlopeRamp</li>\n * <ul>\n * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>\n * </ul>\n * <li>AspectRamp</li>\n * <ul>\n * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>\n * </ul>\n * <li>ElevationBand</li>\n * <ul>\n * <li><code>heights</code>: image of heights sorted from lowest to highest.</li>\n * <li><code>colors</code>: image of colors at the corresponding heights.</li>\n * </ul>\n * </ul>\n * </ul>\n * </div>\n *\n * @alias Material\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.strict=false] Throws errors for issues that would normally be ignored, including unused uniforms or materials.\n * @param {Boolean|Function} [options.translucent=true] When <code>true</code> or a function that returns <code>true</code>, the geometry\n * with this material is expected to appear translucent.\n * @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The {@link TextureMinificationFilter} to apply to this material's textures.\n * @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The {@link TextureMagnificationFilter} to apply to this material's textures.\n * @param {Object} options.fabric The fabric JSON used to generate the material.\n *\n * @constructor\n *\n * @exception {DeveloperError} fabric: uniform has invalid type.\n * @exception {DeveloperError} fabric: uniforms and materials cannot share the same property.\n * @exception {DeveloperError} fabric: cannot have source and components in the same section.\n * @exception {DeveloperError} fabric: property name is not valid. It should be 'type', 'materials', 'uniforms', 'components', or 'source'.\n * @exception {DeveloperError} fabric: property name is not valid. It should be 'diffuse', 'specular', 'shininess', 'normal', 'emission', or 'alpha'.\n * @exception {DeveloperError} strict: shader source does not use string.\n * @exception {DeveloperError} strict: shader source does not use uniform.\n * @exception {DeveloperError} strict: shader source does not use material.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric wiki page} for a more detailed options of Fabric.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Materials Demo}\n *\n * @example\n * // Create a color material with fromType:\n * polygon.material = Cesium.Material.fromType('Color');\n * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n *\n * // Create the default material:\n * polygon.material = new Cesium.Material();\n *\n * // Create a color material with full Fabric notation:\n * polygon.material = new Cesium.Material({\n * fabric : {\n * type : 'Color',\n * uniforms : {\n * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)\n * }\n * }\n * });\n */\nfunction Material(options) {\n /**\n * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.\n * @type {String}\n * @default undefined\n */\n this.type = undefined;\n\n /**\n * The glsl shader source for this material.\n * @type {String}\n * @default undefined\n */\n this.shaderSource = undefined;\n\n /**\n * Maps sub-material names to Material objects.\n * @type {Object}\n * @default undefined\n */\n this.materials = undefined;\n\n /**\n * Maps uniform names to their values.\n * @type {Object}\n * @default undefined\n */\n this.uniforms = undefined;\n this._uniforms = undefined;\n\n /**\n * When <code>true</code> or a function that returns <code>true</code>,\n * the geometry is expected to appear translucent.\n * @type {Boolean|Function}\n * @default undefined\n */\n this.translucent = undefined;\n\n this._minificationFilter = defaultValue(\n options.minificationFilter,\n TextureMinificationFilter.LINEAR\n );\n this._magnificationFilter = defaultValue(\n options.magnificationFilter,\n TextureMagnificationFilter.LINEAR\n );\n\n this._strict = undefined;\n this._template = undefined;\n this._count = undefined;\n\n this._texturePaths = {};\n this._loadedImages = [];\n this._loadedCubeMaps = [];\n\n this._textures = {};\n\n this._updateFunctions = [];\n\n this._defaultTexture = undefined;\n\n initializeMaterial(options, this);\n Object.defineProperties(this, {\n type: {\n value: this.type,\n writable: false,\n },\n });\n\n if (!defined(Material._uniformList[this.type])) {\n Material._uniformList[this.type] = Object.keys(this._uniforms);\n }\n}\n\n// Cached list of combined uniform names indexed by type.\n// Used to get the list of uniforms in the same order.\nMaterial._uniformList = {};\n\n/**\n * Creates a new material using an existing material type.\n * <br /><br />\n * Shorthand for: new Material({fabric : {type : type}});\n *\n * @param {String} type The base material type.\n * @param {Object} [uniforms] Overrides for the default uniforms.\n * @returns {Material} New material object.\n *\n * @exception {DeveloperError} material with that type does not exist.\n *\n * @example\n * const material = Cesium.Material.fromType('Color', {\n * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)\n * });\n */\nMaterial.fromType = function (type, uniforms) {\n const material = new Material({\n fabric: {\n type: type,\n },\n });\n\n if (defined(uniforms)) {\n for (const name in uniforms) {\n if (uniforms.hasOwnProperty(name)) {\n material.uniforms[name] = uniforms[name];\n }\n }\n }\n\n return material;\n};\n\n/**\n * Gets whether or not this material is translucent.\n * @returns {Boolean} <code>true</code> if this material is translucent, <code>false</code> otherwise.\n */\nMaterial.prototype.isTranslucent = function () {\n if (defined(this.translucent)) {\n if (typeof this.translucent === \"function\") {\n return this.translucent();\n }\n\n return this.translucent;\n }\n\n let translucent = true;\n const funcs = this._translucentFunctions;\n const length = funcs.length;\n for (let i = 0; i < length; ++i) {\n const func = funcs[i];\n if (typeof func === \"function\") {\n translucent = translucent && func();\n } else {\n translucent = translucent && func;\n }\n\n if (!translucent) {\n break;\n }\n }\n return translucent;\n};\n\n/**\n * @private\n */\nMaterial.prototype.update = function (context) {\n this._defaultTexture = context.defaultTexture;\n\n let i;\n let uniformId;\n\n const loadedImages = this._loadedImages;\n let length = loadedImages.length;\n for (i = 0; i < length; ++i) {\n const loadedImage = loadedImages[i];\n uniformId = loadedImage.id;\n let image = loadedImage.image;\n\n // Images transcoded from KTX2 can contain multiple mip levels:\n // https://github.khronos.org/KTX-Specification/#_mip_level_array\n let mipLevels;\n if (Array.isArray(image)) {\n // highest detail mip should be level 0\n mipLevels = image.slice(1, image.length).map(function (mipLevel) {\n return mipLevel.bufferView;\n });\n image = image[0];\n }\n\n const sampler = new Sampler({\n minificationFilter: this._minificationFilter,\n magnificationFilter: this._magnificationFilter,\n });\n\n let texture;\n if (defined(image.internalFormat)) {\n texture = new Texture({\n context: context,\n pixelFormat: image.internalFormat,\n width: image.width,\n height: image.height,\n source: {\n arrayBufferView: image.bufferView,\n mipLevels: mipLevels,\n },\n sampler: sampler,\n });\n } else {\n texture = new Texture({\n context: context,\n source: image,\n sampler: sampler,\n });\n }\n\n // The material destroys its old texture only after the new one has been loaded.\n // This will ensure a smooth swap of textures and prevent the default texture\n // from appearing for a few frames.\n const oldTexture = this._textures[uniformId];\n if (defined(oldTexture) && oldTexture !== this._defaultTexture) {\n oldTexture.destroy();\n }\n\n this._textures[uniformId] = texture;\n\n const uniformDimensionsName = `${uniformId}Dimensions`;\n if (this.uniforms.hasOwnProperty(uniformDimensionsName)) {\n const uniformDimensions = this.uniforms[uniformDimensionsName];\n uniformDimensions.x = texture._width;\n uniformDimensions.y = texture._height;\n }\n }\n\n loadedImages.length = 0;\n\n const loadedCubeMaps = this._loadedCubeMaps;\n length = loadedCubeMaps.length;\n\n for (i = 0; i < length; ++i) {\n const loadedCubeMap = loadedCubeMaps[i];\n uniformId = loadedCubeMap.id;\n const images = loadedCubeMap.images;\n\n const cubeMap = new CubeMap({\n context: context,\n source: {\n positiveX: images[0],\n negativeX: images[1],\n positiveY: images[2],\n negativeY: images[3],\n positiveZ: images[4],\n negativeZ: images[5],\n },\n sampler: new Sampler({\n minificationFilter: this._minificationFilter,\n magnificationFilter: this._magnificationFilter,\n }),\n });\n\n this._textures[uniformId] = cubeMap;\n }\n\n loadedCubeMaps.length = 0;\n\n const updateFunctions = this._updateFunctions;\n length = updateFunctions.length;\n for (i = 0; i < length; ++i) {\n updateFunctions[i](this, context);\n }\n\n const subMaterials = this.materials;\n for (const name in subMaterials) {\n if (subMaterials.hasOwnProperty(name)) {\n subMaterials[name].update(context);\n }\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see Material#destroy\n */\nMaterial.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * material = material && material.destroy();\n *\n * @see Material#isDestroyed\n */\nMaterial.prototype.destroy = function () {\n const textures = this._textures;\n for (const texture in textures) {\n if (textures.hasOwnProperty(texture)) {\n const instance = textures[texture];\n if (instance !== this._defaultTexture) {\n instance.destroy();\n }\n }\n }\n\n const materials = this.materials;\n for (const material in materials) {\n if (materials.hasOwnProperty(material)) {\n materials[material].destroy();\n }\n }\n return destroyObject(this);\n};\n\nfunction initializeMaterial(options, result) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n result._strict = defaultValue(options.strict, false);\n result._count = defaultValue(options.count, 0);\n result._template = clone(\n defaultValue(options.fabric, defaultValue.EMPTY_OBJECT)\n );\n result._template.uniforms = clone(\n defaultValue(result._template.uniforms, defaultValue.EMPTY_OBJECT)\n );\n result._template.materials = clone(\n defaultValue(result._template.materials, defaultValue.EMPTY_OBJECT)\n );\n\n result.type = defined(result._template.type)\n ? result._template.type\n : createGuid();\n\n result.shaderSource = \"\";\n result.materials = {};\n result.uniforms = {};\n result._uniforms = {};\n result._translucentFunctions = [];\n\n let translucent;\n\n // If the cache contains this material type, build the material template off of the stored template.\n const cachedMaterial = Material._materialCache.getMaterial(result.type);\n if (defined(cachedMaterial)) {\n const template = clone(cachedMaterial.fabric, true);\n result._template = combine(result._template, template, true);\n translucent = cachedMaterial.translucent;\n }\n\n // Make sure the template has no obvious errors. More error checking happens later.\n checkForTemplateErrors(result);\n\n // If the material has a new type, add it to the cache.\n if (!defined(cachedMaterial)) {\n Material._materialCache.addMaterial(result.type, result);\n }\n\n createMethodDefinition(result);\n createUniforms(result);\n createSubMaterials(result);\n\n const defaultTranslucent =\n result._translucentFunctions.length === 0 ? true : undefined;\n translucent = defaultValue(translucent, defaultTranslucent);\n translucent = defaultValue(options.translucent, translucent);\n\n if (defined(translucent)) {\n if (typeof translucent === \"function\") {\n const wrappedTranslucent = function () {\n return translucent(result);\n };\n result._translucentFunctions.push(wrappedTranslucent);\n } else {\n result._translucentFunctions.push(translucent);\n }\n }\n}\n\nfunction checkForValidProperties(object, properties, result, throwNotFound) {\n if (defined(object)) {\n for (const property in object) {\n if (object.hasOwnProperty(property)) {\n const hasProperty = properties.indexOf(property) !== -1;\n if (\n (throwNotFound && !hasProperty) ||\n (!throwNotFound && hasProperty)\n ) {\n result(property, properties);\n }\n }\n }\n }\n}\n\nfunction invalidNameError(property, properties) {\n}\n\nfunction duplicateNameError(property, properties) {\n}\n\nconst templateProperties = [\n \"type\",\n \"materials\",\n \"uniforms\",\n \"components\",\n \"source\",\n];\nconst componentProperties = [\n \"diffuse\",\n \"specular\",\n \"shininess\",\n \"normal\",\n \"emission\",\n \"alpha\",\n];\n\nfunction checkForTemplateErrors(material) {\n const template = material._template;\n const uniforms = template.uniforms;\n const materials = template.materials;\n const components = template.components;\n\n // Make sure source and components do not exist in the same template.\n // Make sure all template and components properties are valid.\n checkForValidProperties(template, templateProperties, invalidNameError, true);\n checkForValidProperties(\n components,\n componentProperties,\n invalidNameError,\n true\n );\n\n // Make sure uniforms and materials do not share any of the same names.\n const materialNames = [];\n for (const property in materials) {\n if (materials.hasOwnProperty(property)) {\n materialNames.push(property);\n }\n }\n checkForValidProperties(uniforms, materialNames, duplicateNameError, false);\n}\n\nfunction isMaterialFused(shaderComponent, material) {\n const materials = material._template.materials;\n for (const subMaterialId in materials) {\n if (materials.hasOwnProperty(subMaterialId)) {\n if (shaderComponent.indexOf(subMaterialId) > -1) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n// Create the czm_getMaterial method body using source or components.\nfunction createMethodDefinition(material) {\n const components = material._template.components;\n const source = material._template.source;\n if (defined(source)) {\n material.shaderSource += `${source}\\n`;\n } else {\n material.shaderSource +=\n \"czm_material czm_getMaterial(czm_materialInput materialInput)\\n{\\n\";\n material.shaderSource +=\n \"czm_material material = czm_getDefaultMaterial(materialInput);\\n\";\n if (defined(components)) {\n const isMultiMaterial =\n Object.keys(material._template.materials).length > 0;\n for (const component in components) {\n if (components.hasOwnProperty(component)) {\n if (component === \"diffuse\" || component === \"emission\") {\n const isFusion =\n isMultiMaterial &&\n isMaterialFused(components[component], material);\n const componentSource = isFusion\n ? components[component]\n : `czm_gammaCorrect(${components[component]})`;\n material.shaderSource += `material.${component} = ${componentSource}; \\n`;\n } else if (component === \"alpha\") {\n material.shaderSource += `material.alpha = ${components.alpha}; \\n`;\n } else {\n material.shaderSource += `material.${component} = ${components[component]};\\n`;\n }\n }\n }\n }\n material.shaderSource += \"return material;\\n}\\n\";\n }\n}\n\nconst matrixMap = {\n mat2: Matrix2,\n mat3: Matrix3,\n mat4: Matrix4,\n};\n\nconst ktx2Regex = /\\.ktx2$/i;\n\nfunction createTexture2DUpdateFunction(uniformId) {\n let oldUniformValue;\n return function (material, context) {\n const uniforms = material.uniforms;\n const uniformValue = uniforms[uniformId];\n const uniformChanged = oldUniformValue !== uniformValue;\n const uniformValueIsDefaultImage =\n !defined(uniformValue) || uniformValue === Material.DefaultImageId;\n oldUniformValue = uniformValue;\n\n let texture = material._textures[uniformId];\n let uniformDimensionsName;\n let uniformDimensions;\n\n if (uniformValue instanceof HTMLVideoElement) {\n // HTMLVideoElement.readyState >=2 means we have enough data for the current frame.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n if (uniformValue.readyState >= 2) {\n if (uniformChanged && defined(texture)) {\n if (texture !== context.defaultTexture) {\n texture.destroy();\n }\n texture = undefined;\n }\n\n if (!defined(texture) || texture === context.defaultTexture) {\n const sampler = new Sampler({\n minificationFilter: material._minificationFilter,\n magnificationFilter: material._magnificationFilter,\n });\n texture = new Texture({\n context: context,\n source: uniformValue,\n sampler: sampler,\n });\n material._textures[uniformId] = texture;\n return;\n }\n\n texture.copyFrom({\n source: uniformValue,\n });\n } else if (!defined(texture)) {\n material._textures[uniformId] = context.defaultTexture;\n }\n return;\n }\n\n if (uniformValue instanceof Texture && uniformValue !== texture) {\n material._texturePaths[uniformId] = undefined;\n const tmp = material._textures[uniformId];\n if (defined(tmp) && tmp !== material._defaultTexture) {\n tmp.destroy();\n }\n material._textures[uniformId] = uniformValue;\n\n uniformDimensionsName = `${uniformId}Dimensions`;\n if (uniforms.hasOwnProperty(uniformDimensionsName)) {\n uniformDimensions = uniforms[uniformDimensionsName];\n uniformDimensions.x = uniformValue._width;\n uniformDimensions.y = uniformValue._height;\n }\n\n return;\n }\n\n if (uniformChanged && defined(texture) && uniformValueIsDefaultImage) {\n // If the newly-assigned texture is the default texture,\n // we don't need to wait for a new image to load before destroying\n // the old texture.\n if (texture !== material._defaultTexture) {\n texture.destroy();\n }\n texture = undefined;\n }\n\n if (!defined(texture)) {\n material._texturePaths[uniformId] = undefined;\n texture = material._textures[uniformId] = material._defaultTexture;\n\n uniformDimensionsName = `${uniformId}Dimensions`;\n if (uniforms.hasOwnProperty(uniformDimensionsName)) {\n uniformDimensions = uniforms[uniformDimensionsName];\n uniformDimensions.x = texture._width;\n uniformDimensions.y = texture._height;\n }\n }\n\n if (uniformValueIsDefaultImage) {\n return;\n }\n\n // When using the entity layer, the Resource objects get recreated on getValue because\n // they are clonable. That's why we check the url property for Resources\n // because the instances aren't the same and we keep trying to load the same\n // image if it fails to load.\n const isResource = uniformValue instanceof Resource;\n if (\n !defined(material._texturePaths[uniformId]) ||\n (isResource &&\n uniformValue.url !== material._texturePaths[uniformId].url) ||\n (!isResource && uniformValue !== material._texturePaths[uniformId])\n ) {\n if (typeof uniformValue === \"string\" || isResource) {\n const resource = isResource\n ? uniformValue\n : Resource.createIfNeeded(uniformValue);\n\n let promise;\n if (ktx2Regex.test(resource.url)) {\n promise = loadKTX2(resource.url);\n } else {\n promise = resource.fetchImage();\n }\n\n Promise.resolve(promise)\n .then(function (image) {\n material._loadedImages.push({\n id: uniformId,\n image: image,\n });\n })\n .catch(function () {\n if (defined(texture) && texture !== material._defaultTexture) {\n texture.destroy();\n }\n material._textures[uniformId] = material._defaultTexture;\n });\n } else if (\n uniformValue instanceof HTMLCanvasElement ||\n uniformValue instanceof HTMLImageElement\n ) {\n material._loadedImages.push({\n id: uniformId,\n image: uniformValue,\n });\n }\n\n material._texturePaths[uniformId] = uniformValue;\n }\n };\n}\n\nfunction createCubeMapUpdateFunction(uniformId) {\n return function (material, context) {\n const uniformValue = material.uniforms[uniformId];\n\n if (uniformValue instanceof CubeMap) {\n const tmp = material._textures[uniformId];\n if (tmp !== material._defaultTexture) {\n tmp.destroy();\n }\n material._texturePaths[uniformId] = undefined;\n material._textures[uniformId] = uniformValue;\n return;\n }\n\n if (!defined(material._textures[uniformId])) {\n material._texturePaths[uniformId] = undefined;\n material._textures[uniformId] = context.defaultCubeMap;\n }\n\n if (uniformValue === Material.DefaultCubeMapId) {\n return;\n }\n\n const path =\n uniformValue.positiveX +\n uniformValue.negativeX +\n uniformValue.positiveY +\n uniformValue.negativeY +\n uniformValue.positiveZ +\n uniformValue.negativeZ;\n\n if (path !== material._texturePaths[uniformId]) {\n const promises = [\n Resource.createIfNeeded(uniformValue.positiveX).fetchImage(),\n Resource.createIfNeeded(uniformValue.negativeX).fetchImage(),\n Resource.createIfNeeded(uniformValue.positiveY).fetchImage(),\n Resource.createIfNeeded(uniformValue.negativeY).fetchImage(),\n Resource.createIfNeeded(uniformValue.positiveZ).fetchImage(),\n Resource.createIfNeeded(uniformValue.negativeZ).fetchImage(),\n ];\n\n Promise.all(promises).then(function (images) {\n material._loadedCubeMaps.push({\n id: uniformId,\n images: images,\n });\n });\n\n material._texturePaths[uniformId] = path;\n }\n };\n}\n\nfunction createUniforms(material) {\n const uniforms = material._template.uniforms;\n for (const uniformId in uniforms) {\n if (uniforms.hasOwnProperty(uniformId)) {\n createUniform(material, uniformId);\n }\n }\n}\n\n// Writes uniform declarations to the shader file and connects uniform values with\n// corresponding material properties through the returnUniforms function.\nfunction createUniform(material, uniformId) {\n const strict = material._strict;\n const materialUniforms = material._template.uniforms;\n const uniformValue = materialUniforms[uniformId];\n const uniformType = getUniformType(uniformValue);\n\n let replacedTokenCount;\n if (uniformType === \"channels\") {\n replacedTokenCount = replaceToken(material, uniformId, uniformValue, false);\n} else {\n // Since webgl doesn't allow texture dimension queries in glsl, create a uniform to do it.\n // Check if the shader source actually uses texture dimensions before creating the uniform.\n if (uniformType === \"sampler2D\") {\n const imageDimensionsUniformName = `${uniformId}Dimensions`;\n if (getNumberOfTokens(material, imageDimensionsUniformName) > 0) {\n materialUniforms[imageDimensionsUniformName] = {\n type: \"ivec3\",\n x: 1,\n y: 1,\n };\n createUniform(material, imageDimensionsUniformName);\n }\n }\n\n // Add uniform declaration to source code.\n const uniformDeclarationRegex = new RegExp(\n `uniform\\\\s+${uniformType}\\\\s+${uniformId}\\\\s*;`\n );\n if (!uniformDeclarationRegex.test(material.shaderSource)) {\n const uniformDeclaration = `uniform ${uniformType} ${uniformId};`;\n material.shaderSource = uniformDeclaration + material.shaderSource;\n }\n\n const newUniformId = `${uniformId}_${material._count++}`;\n replacedTokenCount = replaceToken(material, uniformId, newUniformId);\n // Set uniform value\n material.uniforms[uniformId] = uniformValue;\n\n if (uniformType === \"sampler2D\") {\n material._uniforms[newUniformId] = function () {\n return material._textures[uniformId];\n };\n material._updateFunctions.push(createTexture2DUpdateFunction(uniformId));\n } else if (uniformType === \"samplerCube\") {\n material._uniforms[newUniformId] = function () {\n return material._textures[uniformId];\n };\n material._updateFunctions.push(createCubeMapUpdateFunction(uniformId));\n } else if (uniformType.indexOf(\"mat\") !== -1) {\n const scratchMatrix = new matrixMap[uniformType]();\n material._uniforms[newUniformId] = function () {\n return matrixMap[uniformType].fromColumnMajorArray(\n material.uniforms[uniformId],\n scratchMatrix\n );\n };\n } else {\n material._uniforms[newUniformId] = function () {\n return material.uniforms[uniformId];\n };\n }\n }\n}\n\n// Determines the uniform type based on the uniform in the template.\nfunction getUniformType(uniformValue) {\n let uniformType = uniformValue.type;\n if (!defined(uniformType)) {\n const type = typeof uniformValue;\n if (type === \"number\") {\n uniformType = \"float\";\n } else if (type === \"boolean\") {\n uniformType = \"bool\";\n } else if (\n type === \"string\" ||\n uniformValue instanceof Resource ||\n uniformValue instanceof HTMLCanvasElement ||\n uniformValue instanceof HTMLImageElement\n ) {\n if (/^([rgba]){1,4}$/i.test(uniformValue)) {\n uniformType = \"channels\";\n } else if (uniformValue === Material.DefaultCubeMapId) {\n uniformType = \"samplerCube\";\n } else {\n uniformType = \"sampler2D\";\n }\n } else if (type === \"object\") {\n if (Array.isArray(uniformValue)) {\n if (\n uniformValue.length === 4 ||\n uniformValue.length === 9 ||\n uniformValue.length === 16\n ) {\n uniformType = `mat${Math.sqrt(uniformValue.length)}`;\n }\n } else {\n let numAttributes = 0;\n for (const attribute in uniformValue) {\n if (uniformValue.hasOwnProperty(attribute)) {\n numAttributes += 1;\n }\n }\n if (numAttributes >= 2 && numAttributes <= 4) {\n uniformType = `vec${numAttributes}`;\n } else if (numAttributes === 6) {\n uniformType = \"samplerCube\";\n }\n }\n }\n }\n return uniformType;\n}\n\n// Create all sub-materials by combining source and uniforms together.\nfunction createSubMaterials(material) {\n const strict = material._strict;\n const subMaterialTemplates = material._template.materials;\n for (const subMaterialId in subMaterialTemplates) {\n if (subMaterialTemplates.hasOwnProperty(subMaterialId)) {\n // Construct the sub-material.\n const subMaterial = new Material({\n strict: strict,\n fabric: subMaterialTemplates[subMaterialId],\n count: material._count,\n });\n\n material._count = subMaterial._count;\n material._uniforms = combine(\n material._uniforms,\n subMaterial._uniforms,\n true\n );\n material.materials[subMaterialId] = subMaterial;\n material._translucentFunctions = material._translucentFunctions.concat(\n subMaterial._translucentFunctions\n );\n\n // Make the material's czm_getMaterial unique by appending the sub-material type.\n const originalMethodName = \"czm_getMaterial\";\n const newMethodName = `${originalMethodName}_${material._count++}`;\n replaceToken(subMaterial, originalMethodName, newMethodName);\n material.shaderSource = subMaterial.shaderSource + material.shaderSource;\n\n // Replace each material id with an czm_getMaterial method call.\n const materialMethodCall = `${newMethodName}(materialInput)`;\n const tokensReplacedCount = replaceToken(\n material,\n subMaterialId,\n materialMethodCall\n );\n}\n }\n}\n\n// Used for searching or replacing a token in a material's shader source with something else.\n// If excludePeriod is true, do not accept tokens that are preceded by periods.\n// http://stackoverflow.com/questions/641407/javascript-negative-lookbehind-equivalent\nfunction replaceToken(material, token, newToken, excludePeriod) {\n excludePeriod = defaultValue(excludePeriod, true);\n let count = 0;\n const suffixChars = \"([\\\\w])?\";\n const prefixChars = `([\\\\w${excludePeriod ? \".\" : \"\"}])?`;\n const regExp = new RegExp(prefixChars + token + suffixChars, \"g\");\n material.shaderSource = material.shaderSource.replace(regExp, function (\n $0,\n $1,\n $2\n ) {\n if ($1 || $2) {\n return $0;\n }\n count += 1;\n return newToken;\n });\n return count;\n}\n\nfunction getNumberOfTokens(material, token, excludePeriod) {\n return replaceToken(material, token, token, excludePeriod);\n}\n\nMaterial._materialCache = {\n _materials: {},\n addMaterial: function (type, materialTemplate) {\n this._materials[type] = materialTemplate;\n },\n getMaterial: function (type) {\n return this._materials[type];\n },\n};\n\n/**\n * Gets or sets the default texture uniform value.\n * @type {String}\n */\nMaterial.DefaultImageId = \"czm_defaultImage\";\n\n/**\n * Gets or sets the default cube map texture uniform value.\n * @type {String}\n */\nMaterial.DefaultCubeMapId = \"czm_defaultCubeMap\";\n\n/**\n * Gets the name of the color material.\n * @type {String}\n * @readonly\n */\nMaterial.ColorType = \"Color\";\nMaterial._materialCache.addMaterial(Material.ColorType, {\n fabric: {\n type: Material.ColorType,\n uniforms: {\n color: new Color(1.0, 0.0, 0.0, 0.5),\n },\n components: {\n diffuse: \"color.rgb\",\n alpha: \"color.a\",\n },\n },\n translucent: function (material) {\n return material.uniforms.color.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the image material.\n * @type {String}\n * @readonly\n */\nMaterial.ImageType = \"Image\";\nMaterial._materialCache.addMaterial(Material.ImageType, {\n fabric: {\n type: Material.ImageType,\n uniforms: {\n image: Material.DefaultImageId,\n repeat: new Cartesian2(1.0, 1.0),\n color: new Color(1.0, 1.0, 1.0, 1.0),\n },\n components: {\n diffuse:\n \"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb\",\n alpha: \"texture2D(image, fract(repeat * materialInput.st)).a * color.a\",\n },\n },\n translucent: function (material) {\n return material.uniforms.color.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the diffuce map material.\n * @type {String}\n * @readonly\n */\nMaterial.DiffuseMapType = \"DiffuseMap\";\nMaterial._materialCache.addMaterial(Material.DiffuseMapType, {\n fabric: {\n type: Material.DiffuseMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channels: \"rgb\",\n repeat: new Cartesian2(1.0, 1.0),\n },\n components: {\n diffuse: \"texture2D(image, fract(repeat * materialInput.st)).channels\",\n },\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the alpha map material.\n * @type {String}\n * @readonly\n */\nMaterial.AlphaMapType = \"AlphaMap\";\nMaterial._materialCache.addMaterial(Material.AlphaMapType, {\n fabric: {\n type: Material.AlphaMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channel: \"a\",\n repeat: new Cartesian2(1.0, 1.0),\n },\n components: {\n alpha: \"texture2D(image, fract(repeat * materialInput.st)).channel\",\n },\n },\n translucent: true,\n});\n\n/**\n * Gets the name of the specular map material.\n * @type {String}\n * @readonly\n */\nMaterial.SpecularMapType = \"SpecularMap\";\nMaterial._materialCache.addMaterial(Material.SpecularMapType, {\n fabric: {\n type: Material.SpecularMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channel: \"r\",\n repeat: new Cartesian2(1.0, 1.0),\n },\n components: {\n specular: \"texture2D(image, fract(repeat * materialInput.st)).channel\",\n },\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the emmision map material.\n * @type {String}\n * @readonly\n */\nMaterial.EmissionMapType = \"EmissionMap\";\nMaterial._materialCache.addMaterial(Material.EmissionMapType, {\n fabric: {\n type: Material.EmissionMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channels: \"rgb\",\n repeat: new Cartesian2(1.0, 1.0),\n },\n components: {\n emission: \"texture2D(image, fract(repeat * materialInput.st)).channels\",\n },\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the bump map material.\n * @type {String}\n * @readonly\n */\nMaterial.BumpMapType = \"BumpMap\";\nMaterial._materialCache.addMaterial(Material.BumpMapType, {\n fabric: {\n type: Material.BumpMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channel: \"r\",\n strength: 0.8,\n repeat: new Cartesian2(1.0, 1.0),\n },\n source: BumpMapMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the normal map material.\n * @type {String}\n * @readonly\n */\nMaterial.NormalMapType = \"NormalMap\";\nMaterial._materialCache.addMaterial(Material.NormalMapType, {\n fabric: {\n type: Material.NormalMapType,\n uniforms: {\n image: Material.DefaultImageId,\n channels: \"rgb\",\n strength: 0.8,\n repeat: new Cartesian2(1.0, 1.0),\n },\n source: NormalMapMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the grid material.\n * @type {String}\n * @readonly\n */\nMaterial.GridType = \"Grid\";\nMaterial._materialCache.addMaterial(Material.GridType, {\n fabric: {\n type: Material.GridType,\n uniforms: {\n color: new Color(0.0, 1.0, 0.0, 1.0),\n cellAlpha: 0.1,\n lineCount: new Cartesian2(8.0, 8.0),\n lineThickness: new Cartesian2(1.0, 1.0),\n lineOffset: new Cartesian2(0.0, 0.0),\n },\n source: GridMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.color.alpha < 1.0 || uniforms.cellAlpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the stripe material.\n * @type {String}\n * @readonly\n */\nMaterial.StripeType = \"Stripe\";\nMaterial._materialCache.addMaterial(Material.StripeType, {\n fabric: {\n type: Material.StripeType,\n uniforms: {\n horizontal: true,\n evenColor: new Color(1.0, 1.0, 1.0, 0.5),\n oddColor: new Color(0.0, 0.0, 1.0, 0.5),\n offset: 0.0,\n repeat: 5.0,\n },\n source: StripeMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.evenColor.alpha < 1.0 || uniforms.oddColor.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the checkerboard material.\n * @type {String}\n * @readonly\n */\nMaterial.CheckerboardType = \"Checkerboard\";\nMaterial._materialCache.addMaterial(Material.CheckerboardType, {\n fabric: {\n type: Material.CheckerboardType,\n uniforms: {\n lightColor: new Color(1.0, 1.0, 1.0, 0.5),\n darkColor: new Color(0.0, 0.0, 0.0, 0.5),\n repeat: new Cartesian2(5.0, 5.0),\n },\n source: CheckerboardMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.lightColor.alpha < 1.0 || uniforms.darkColor.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the dot material.\n * @type {String}\n * @readonly\n */\nMaterial.DotType = \"Dot\";\nMaterial._materialCache.addMaterial(Material.DotType, {\n fabric: {\n type: Material.DotType,\n uniforms: {\n lightColor: new Color(1.0, 1.0, 0.0, 0.75),\n darkColor: new Color(0.0, 1.0, 1.0, 0.75),\n repeat: new Cartesian2(5.0, 5.0),\n },\n source: DotMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.lightColor.alpha < 1.0 || uniforms.darkColor.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the water material.\n * @type {String}\n * @readonly\n */\nMaterial.WaterType = \"Water\";\nMaterial._materialCache.addMaterial(Material.WaterType, {\n fabric: {\n type: Material.WaterType,\n uniforms: {\n baseWaterColor: new Color(0.2, 0.3, 0.6, 1.0),\n blendColor: new Color(0.0, 1.0, 0.699, 1.0),\n specularMap: Material.DefaultImageId,\n normalMap: Material.DefaultImageId,\n frequency: 10.0,\n animationSpeed: 0.01,\n amplitude: 1.0,\n specularIntensity: 0.5,\n fadeFactor: 1.0,\n },\n source: WaterMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return (\n uniforms.baseWaterColor.alpha < 1.0 || uniforms.blendColor.alpha < 1.0\n );\n },\n});\n\n/**\n * Gets the name of the rim lighting material.\n * @type {String}\n * @readonly\n */\nMaterial.RimLightingType = \"RimLighting\";\nMaterial._materialCache.addMaterial(Material.RimLightingType, {\n fabric: {\n type: Material.RimLightingType,\n uniforms: {\n color: new Color(1.0, 0.0, 0.0, 0.7),\n rimColor: new Color(1.0, 1.0, 1.0, 0.4),\n width: 0.3,\n },\n source: RimLightingMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.color.alpha < 1.0 || uniforms.rimColor.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the fade material.\n * @type {String}\n * @readonly\n */\nMaterial.FadeType = \"Fade\";\nMaterial._materialCache.addMaterial(Material.FadeType, {\n fabric: {\n type: Material.FadeType,\n uniforms: {\n fadeInColor: new Color(1.0, 0.0, 0.0, 1.0),\n fadeOutColor: new Color(0.0, 0.0, 0.0, 0.0),\n maximumDistance: 0.5,\n repeat: true,\n fadeDirection: {\n x: true,\n y: true,\n },\n time: new Cartesian2(0.5, 0.5),\n },\n source: FadeMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return (\n uniforms.fadeInColor.alpha < 1.0 || uniforms.fadeOutColor.alpha < 1.0\n );\n },\n});\n\n/**\n * Gets the name of the polyline arrow material.\n * @type {String}\n * @readonly\n */\nMaterial.PolylineArrowType = \"PolylineArrow\";\nMaterial._materialCache.addMaterial(Material.PolylineArrowType, {\n fabric: {\n type: Material.PolylineArrowType,\n uniforms: {\n color: new Color(1.0, 1.0, 1.0, 1.0),\n },\n source: PolylineArrowMaterial,\n },\n translucent: true,\n});\n\n/**\n * Gets the name of the polyline glow material.\n * @type {String}\n * @readonly\n */\nMaterial.PolylineDashType = \"PolylineDash\";\nMaterial._materialCache.addMaterial(Material.PolylineDashType, {\n fabric: {\n type: Material.PolylineDashType,\n uniforms: {\n color: new Color(1.0, 0.0, 1.0, 1.0),\n gapColor: new Color(0.0, 0.0, 0.0, 0.0),\n dashLength: 16.0,\n dashPattern: 255.0,\n },\n source: PolylineDashMaterial,\n },\n translucent: true,\n});\n\n/**\n * Gets the name of the polyline glow material.\n * @type {String}\n * @readonly\n */\nMaterial.PolylineGlowType = \"PolylineGlow\";\nMaterial._materialCache.addMaterial(Material.PolylineGlowType, {\n fabric: {\n type: Material.PolylineGlowType,\n uniforms: {\n color: new Color(0.0, 0.5, 1.0, 1.0),\n glowPower: 0.25,\n taperPower: 1.0,\n },\n source: PolylineGlowMaterial,\n },\n translucent: true,\n});\n\n/**\n * Gets the name of the polyline outline material.\n * @type {String}\n * @readonly\n */\nMaterial.PolylineOutlineType = \"PolylineOutline\";\nMaterial._materialCache.addMaterial(Material.PolylineOutlineType, {\n fabric: {\n type: Material.PolylineOutlineType,\n uniforms: {\n color: new Color(1.0, 1.0, 1.0, 1.0),\n outlineColor: new Color(1.0, 0.0, 0.0, 1.0),\n outlineWidth: 1.0,\n },\n source: PolylineOutlineMaterial,\n },\n translucent: function (material) {\n const uniforms = material.uniforms;\n return uniforms.color.alpha < 1.0 || uniforms.outlineColor.alpha < 1.0;\n },\n});\n\n/**\n * Gets the name of the elevation contour material.\n * @type {String}\n * @readonly\n */\nMaterial.ElevationContourType = \"ElevationContour\";\nMaterial._materialCache.addMaterial(Material.ElevationContourType, {\n fabric: {\n type: Material.ElevationContourType,\n uniforms: {\n spacing: 100.0,\n color: new Color(1.0, 0.0, 0.0, 1.0),\n width: 1.0,\n },\n source: ElevationContourMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the elevation contour material.\n * @type {String}\n * @readonly\n */\nMaterial.ElevationRampType = \"ElevationRamp\";\nMaterial._materialCache.addMaterial(Material.ElevationRampType, {\n fabric: {\n type: Material.ElevationRampType,\n uniforms: {\n image: Material.DefaultImageId,\n minimumHeight: 0.0,\n maximumHeight: 10000.0,\n },\n source: ElevationRampMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the slope ramp material.\n * @type {String}\n * @readonly\n */\nMaterial.SlopeRampMaterialType = \"SlopeRamp\";\nMaterial._materialCache.addMaterial(Material.SlopeRampMaterialType, {\n fabric: {\n type: Material.SlopeRampMaterialType,\n uniforms: {\n image: Material.DefaultImageId,\n },\n source: SlopeRampMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the aspect ramp material.\n * @type {String}\n * @readonly\n */\nMaterial.AspectRampMaterialType = \"AspectRamp\";\nMaterial._materialCache.addMaterial(Material.AspectRampMaterialType, {\n fabric: {\n type: Material.AspectRampMaterialType,\n uniforms: {\n image: Material.DefaultImageId,\n },\n source: AspectRampMaterial,\n },\n translucent: false,\n});\n\n/**\n * Gets the name of the elevation band material.\n * @type {String}\n * @readonly\n */\nMaterial.ElevationBandType = \"ElevationBand\";\nMaterial._materialCache.addMaterial(Material.ElevationBandType, {\n fabric: {\n type: Material.ElevationBandType,\n uniforms: {\n heights: Material.DefaultImageId,\n colors: Material.DefaultImageId,\n },\n source: ElevationBandMaterial,\n },\n translucent: true,\n});\n\nexport default Material;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport AllMaterialAppearanceFS from \"../Shaders/Appearances/AllMaterialAppearanceFS.js\";\nimport AllMaterialAppearanceVS from \"../Shaders/Appearances/AllMaterialAppearanceVS.js\";\nimport BasicMaterialAppearanceFS from \"../Shaders/Appearances/BasicMaterialAppearanceFS.js\";\nimport BasicMaterialAppearanceVS from \"../Shaders/Appearances/BasicMaterialAppearanceVS.js\";\nimport TexturedMaterialAppearanceFS from \"../Shaders/Appearances/TexturedMaterialAppearanceFS.js\";\nimport TexturedMaterialAppearanceVS from \"../Shaders/Appearances/TexturedMaterialAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\n/**\n * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)\n * that supports shading with materials.\n *\n * @alias MaterialAppearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n * @param {Boolean} [options.faceForward=!options.closed] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.\n * @param {Boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.\n * @param {MaterialAppearance.MaterialSupportType} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Materials.html|Cesium Sandcastle Material Appearance Demo}\n *\n * @example\n * const primitive = new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : new Cesium.WallGeometry({\n materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,\n * // ...\n * })\n * }),\n * appearance : new Cesium.MaterialAppearance({\n * material : Cesium.Material.fromType('Color'),\n * faceForward : true\n * })\n *\n * });\n */\nfunction MaterialAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const translucent = defaultValue(options.translucent, true);\n const closed = defaultValue(options.closed, false);\n const materialSupport = defaultValue(\n options.materialSupport,\n MaterialAppearance.MaterialSupport.TEXTURED\n );\n\n /**\n * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}\n * properties, this is not read-only, so an appearance's material can change on the fly.\n *\n * @type Material\n *\n * @default {@link Material.ColorType}\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = defined(options.material)\n ? options.material\n : Material.fromType(Material.ColorType);\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = translucent;\n\n this._vertexShaderSource = defaultValue(\n options.vertexShaderSource,\n materialSupport.vertexShaderSource\n );\n this._fragmentShaderSource = defaultValue(\n options.fragmentShaderSource,\n materialSupport.fragmentShaderSource\n );\n this._renderState = Appearance.getDefaultRenderState(\n translucent,\n closed,\n options.renderState\n );\n this._closed = closed;\n\n // Non-derived members\n\n this._materialSupport = materialSupport;\n this._vertexFormat = materialSupport.vertexFormat;\n this._flat = defaultValue(options.flat, false);\n this._faceForward = defaultValue(options.faceForward, !closed);\n}\n\nObject.defineProperties(MaterialAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader. The full fragment shader\n * source is built procedurally taking into account {@link MaterialAppearance#material},\n * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.\n * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n * <p>\n * The render state can be explicitly defined when constructing a {@link MaterialAppearance}\n * instance, or it is set implicitly via {@link MaterialAppearance#translucent}\n * and {@link MaterialAppearance#closed}.\n * </p>\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed so\n * {@link MaterialAppearance#renderState} has backface culling enabled.\n * If the viewer enters the geometry, it will not be visible.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The type of materials supported by this instance. This impacts the required\n * {@link VertexFormat} and the complexity of the vertex and fragment shaders.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {MaterialAppearance.MaterialSupportType}\n * @readonly\n *\n * @default {@link MaterialAppearance.MaterialSupport.TEXTURED}\n */\n materialSupport: {\n get: function () {\n return this._materialSupport;\n },\n },\n\n /**\n * The {@link VertexFormat} that this appearance instance is compatible with.\n * A geometry can have more vertex attributes and still be compatible - at a\n * potential performance cost - but it can't have less.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type VertexFormat\n * @readonly\n *\n * @default {@link MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}\n */\n vertexFormat: {\n get: function () {\n return this._vertexFormat;\n },\n },\n\n /**\n * When <code>true</code>, flat shading is used in the fragment shader,\n * which means lighting is not taking into account.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n flat: {\n get: function () {\n return this._flat;\n },\n },\n\n /**\n * When <code>true</code>, the fragment shader flips the surface normal\n * as needed to ensure that the normal faces the viewer to avoid\n * dark spots. This is useful when both sides of a geometry should be\n * shaded like {@link WallGeometry}.\n *\n * @memberof MaterialAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n faceForward: {\n get: function () {\n return this._faceForward;\n },\n },\n});\n\n/**\n * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},\n * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},\n * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nMaterialAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nMaterialAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nMaterialAppearance.prototype.getRenderState =\n Appearance.prototype.getRenderState;\n\n/**\n * @typedef MaterialAppearance.MaterialSupportType\n * @type {Object}\n * @property {VertexFormat} vertexFormat\n * @property {String} vertexShaderSource\n * @property {String} fragmentShaderSource\n */\n\n/**\n * Determines the type of {@link Material} that is supported by a\n * {@link MaterialAppearance} instance. This is a trade-off between\n * flexibility (a wide array of materials) and memory/performance\n * (required vertex format and GLSL shader complexity.\n * @namespace\n */\nMaterialAppearance.MaterialSupport = {\n /**\n * Only basic materials, which require just <code>position</code> and\n * <code>normal</code> vertex attributes, are supported.\n *\n * @type {MaterialAppearance.MaterialSupportType}\n * @constant\n */\n BASIC: Object.freeze({\n vertexFormat: VertexFormat.POSITION_AND_NORMAL,\n vertexShaderSource: BasicMaterialAppearanceVS,\n fragmentShaderSource: BasicMaterialAppearanceFS,\n }),\n /**\n * Materials with textures, which require <code>position</code>,\n * <code>normal</code>, and <code>st</code> vertex attributes,\n * are supported. The vast majority of materials fall into this category.\n *\n * @type {MaterialAppearance.MaterialSupportType}\n * @constant\n */\n TEXTURED: Object.freeze({\n vertexFormat: VertexFormat.POSITION_NORMAL_AND_ST,\n vertexShaderSource: TexturedMaterialAppearanceVS,\n fragmentShaderSource: TexturedMaterialAppearanceFS,\n }),\n /**\n * All materials, including those that work in tangent space, are supported.\n * This requires <code>position</code>, <code>normal</code>, <code>st</code>,\n * <code>tangent</code>, and <code>bitangent</code> vertex attributes.\n *\n * @type {MaterialAppearance.MaterialSupportType}\n * @constant\n */\n ALL: Object.freeze({\n vertexFormat: VertexFormat.ALL,\n vertexShaderSource: AllMaterialAppearanceVS,\n fragmentShaderSource: AllMaterialAppearanceFS,\n }),\n};\nexport default MaterialAppearance;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec4 v_color;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionToEyeEC = -v_positionEC;\\n\\\nvec3 normalEC = normalize(v_normalEC);\\n\\\n#ifdef FACE_FORWARD\\n\\\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\nvec4 color = czm_gammaCorrect(v_color);\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 normal;\\n\\\nattribute vec4 color;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_normalEC;\\n\\\nvarying vec4 v_color;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\nv_normalEC = czm_normal * normal;\\n\\\nv_color = color;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec4 v_color;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_FragColor = czm_gammaCorrect(v_color);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec4 color;\\n\\\nattribute float batchId;\\n\\\nvarying vec4 v_color;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_color = color;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PerInstanceColorAppearanceFS from \"../Shaders/Appearances/PerInstanceColorAppearanceFS.js\";\nimport PerInstanceColorAppearanceVS from \"../Shaders/Appearances/PerInstanceColorAppearanceVS.js\";\nimport PerInstanceFlatColorAppearanceFS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js\";\nimport PerInstanceFlatColorAppearanceVS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\n\n/**\n * An appearance for {@link GeometryInstance} instances with color attributes.\n * This allows several geometry instances, each with a different color, to\n * be drawn with the same {@link Primitive} as shown in the second example below.\n *\n * @alias PerInstanceColorAppearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n * @param {Boolean} [options.faceForward=!options.closed] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.\n * @param {Boolean} [options.closed=false] When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @example\n * // A solid white line segment\n * const primitive = new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : new Cesium.SimplePolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 5.0, 0.0\n * ])\n * }),\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))\n * }\n * }),\n * appearance : new Cesium.PerInstanceColorAppearance({\n * flat : true,\n * translucent : false\n * })\n * });\n *\n * // Two rectangles in a primitive, each with a different color\n * const instance = new Cesium.GeometryInstance({\n * geometry : new Cesium.RectangleGeometry({\n * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)\n * }),\n * attributes : {\n * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)\n * }\n * });\n *\n * const anotherInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.RectangleGeometry({\n * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)\n * }),\n * attributes : {\n * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)\n * }\n * });\n *\n * const rectanglePrimitive = new Cesium.Primitive({\n * geometryInstances : [instance, anotherInstance],\n * appearance : new Cesium.PerInstanceColorAppearance()\n * });\n */\nfunction PerInstanceColorAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const translucent = defaultValue(options.translucent, true);\n const closed = defaultValue(options.closed, false);\n const flat = defaultValue(options.flat, false);\n const vs = flat\n ? PerInstanceFlatColorAppearanceVS\n : PerInstanceColorAppearanceVS;\n const fs = flat\n ? PerInstanceFlatColorAppearanceFS\n : PerInstanceColorAppearanceFS;\n const vertexFormat = flat\n ? PerInstanceColorAppearance.FLAT_VERTEX_FORMAT\n : PerInstanceColorAppearance.VERTEX_FORMAT;\n\n /**\n * This property is part of the {@link Appearance} interface, but is not\n * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.\n *\n * @type Material\n *\n * @default undefined\n */\n this.material = undefined;\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent so\n * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = translucent;\n\n this._vertexShaderSource = defaultValue(options.vertexShaderSource, vs);\n this._fragmentShaderSource = defaultValue(options.fragmentShaderSource, fs);\n this._renderState = Appearance.getDefaultRenderState(\n translucent,\n closed,\n options.renderState\n );\n this._closed = closed;\n\n // Non-derived members\n\n this._vertexFormat = vertexFormat;\n this._flat = flat;\n this._faceForward = defaultValue(options.faceForward, !closed);\n}\n\nObject.defineProperties(PerInstanceColorAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n * <p>\n * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}\n * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}\n * and {@link PerInstanceColorAppearance#closed}.\n * </p>\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed so\n * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.\n * If the viewer enters the geometry, it will not be visible.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The {@link VertexFormat} that this appearance instance is compatible with.\n * A geometry can have more vertex attributes and still be compatible - at a\n * potential performance cost - but it can't have less.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type VertexFormat\n * @readonly\n */\n vertexFormat: {\n get: function () {\n return this._vertexFormat;\n },\n },\n\n /**\n * When <code>true</code>, flat shading is used in the fragment shader,\n * which means lighting is not taking into account.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n flat: {\n get: function () {\n return this._flat;\n },\n },\n\n /**\n * When <code>true</code>, the fragment shader flips the surface normal\n * as needed to ensure that the normal faces the viewer to avoid\n * dark spots. This is useful when both sides of a geometry should be\n * shaded like {@link WallGeometry}.\n *\n * @memberof PerInstanceColorAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n faceForward: {\n get: function () {\n return this._faceForward;\n },\n },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances\n * are compatible with. This requires only <code>position</code> and <code>normal</code>\n * attributes.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPerInstanceColorAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_NORMAL;\n\n/**\n * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances\n * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.\n * This requires only a <code>position</code> attribute.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPerInstanceColorAppearance.FLAT_VERTEX_FORMAT = VertexFormat.POSITION_ONLY;\n\n/**\n * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},\n * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},\n * and {@link PerInstanceColorAppearance#faceForward}.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nPerInstanceColorAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nPerInstanceColorAppearance.prototype.isTranslucent =\n Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nPerInstanceColorAppearance.prototype.getRenderState =\n Appearance.prototype.getRenderState;\nexport default PerInstanceColorAppearance;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.\n *\n * @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.\n *\n * @alias ColorMaterialProperty\n * @constructor\n */\nfunction ColorMaterialProperty(color) {\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n\n this.color = color;\n}\n\nObject.defineProperties(ColorMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof ColorMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return Property.isConstant(this._color);\n },\n },\n\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof ColorMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the {@link Color} {@link Property}.\n * @memberof ColorMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nColorMaterialProperty.prototype.getType = function (time) {\n return \"Color\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nColorMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n Color.WHITE,\n result.color\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nColorMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof ColorMaterialProperty && //\n Property.equals(this._color, other._color))\n );\n};\nexport default ColorMaterialProperty;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where\n * longitude and latitude are directly mapped to X and Y. This projection is commonly\n * known as geographic, equirectangular, equidistant cylindrical, or plate carr\u00E9e.\n *\n * @alias GeographicTilingScheme\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to\n * the WGS84 ellipsoid.\n * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.\n * @param {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of\n * the tile tree.\n * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of\n * the tile tree.\n */\nfunction GeographicTilingScheme(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n // this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n // this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n // this._projection = new GeographicProjection(this._ellipsoid);\n // this._numberOfLevelZeroTilesX = defaultValue(\n // options.numberOfLevelZeroTilesX,\n // 2\n // );\n // this._numberOfLevelZeroTilesY = defaultValue(\n // options.numberOfLevelZeroTilesY,\n // 1\n // );\n if (defined(options.tileInfo)\n && defined(options.tileInfo.spatialReference)\n && defined(options.tileInfo.spatialReference.wkid)\n && options.tileInfo.spatialReference.wkid == 4490) {\n this._tileInfo = options.tileInfo;\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.CGCS2000);\n this._rectangle = defaultValue(options.rectangle, Rectangle.fromDegrees(-180, -90, 180, 90));\n this._numberOfLevelZeroTilesX = defaultValue(options.numberOfLevelZeroTilesX, 4);\n this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 2);\n }\n else {\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n this._numberOfLevelZeroTilesX = defaultValue(options.numberOfLevelZeroTilesX, 2);\n this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 1);\n }\n\n this._projection = new GeographicProjection(this._ellipsoid);\n}\n\nObject.defineProperties(GeographicTilingScheme.prototype, {\n /**\n * Gets the ellipsoid that is tiled by this tiling scheme.\n * @memberof GeographicTilingScheme.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the rectangle, in radians, covered by this tiling scheme.\n * @memberof GeographicTilingScheme.prototype\n * @type {Rectangle}\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n\n /**\n * Gets the map projection used by this tiling scheme.\n * @memberof GeographicTilingScheme.prototype\n * @type {MapProjection}\n */\n projection: {\n get: function () {\n return this._projection;\n },\n },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the X direction at the given level.\n */\nGeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {\n if (!defined(this._tileInfo)) {\n return this._numberOfLevelZeroTilesX << level\n } else { // \u4F7F\u7528\u5207\u7247\u77E9\u9635\u8BA1\u7B97\n var currentMatrix = this._tileInfo.lods.filter(function(item) {\n return item.level === level\n })\n var currentResolution = currentMatrix[0].resolution\n // return Math.round(360 / (this._tileInfo.rows * currentResolution))\n return Math.round(CesiumMath.toDegrees(CesiumMath.TWO_PI) / (this._tileInfo.rows * currentResolution));\n }\n};\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the Y direction at the given level.\n */\nGeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {\n if (!defined(this._tileInfo)) {\n return this._numberOfLevelZeroTilesY << level\n } else { // \u4F7F\u7528\u5207\u7247\u77E9\u9635\u8BA1\u7B97\n var currentMatrix = this._tileInfo.lods.filter(function(item) {\n return item.level === level\n })\n var currentResolution = currentMatrix[0].resolution\n // return Math.round(180 / (this._tileInfo.cols * currentResolution))\n return Math.round(CesiumMath.toDegrees(CesiumMath.TWO_PI / 2) / (this._tileInfo.cols * currentResolution));\n }\n};\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n * is undefined.\n */\nGeographicTilingScheme.prototype.rectangleToNativeRectangle = function (\n rectangle,\n result\n) {\n const west = CesiumMath.toDegrees(rectangle.west);\n const south = CesiumMath.toDegrees(rectangle.south);\n const east = CesiumMath.toDegrees(rectangle.east);\n const north = CesiumMath.toDegrees(rectangle.north);\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.tileXYToNativeRectangle = function (\n x,\n y,\n level,\n result\n) {\n const rectangleRadians = this.tileXYToRectangle(x, y, level, result);\n rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west);\n rectangleRadians.south = CesiumMath.toDegrees(rectangleRadians.south);\n rectangleRadians.east = CesiumMath.toDegrees(rectangleRadians.east);\n rectangleRadians.north = CesiumMath.toDegrees(rectangleRadians.north);\n return rectangleRadians;\n};\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.tileXYToRectangle = function (\n x,\n y,\n level,\n result\n) {\n const rectangle = this._rectangle;\n\n const xTiles = this.getNumberOfXTilesAtLevel(level);\n const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n const xTileWidth = rectangle.width / xTiles;\n const west = x * xTileWidth + rectangle.west;\n const east = (x + 1) * xTileWidth + rectangle.west;\n\n const yTileHeight = rectangle.height / yTiles;\n const north = rectangle.north - y * yTileHeight;\n const south = rectangle.north - (y + 1) * yTileHeight;\n\n if (!defined(result)) {\n result = new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n *\n * @param {Cartographic} position The position.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n * if 'result' is undefined.\n */\nGeographicTilingScheme.prototype.positionToTileXY = function (\n position,\n level,\n result\n) {\n const rectangle = this._rectangle;\n if (!Rectangle.contains(rectangle, position)) {\n // outside the bounds of the tiling scheme\n return undefined;\n }\n\n const xTiles = this.getNumberOfXTilesAtLevel(level);\n const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n const xTileWidth = rectangle.width / xTiles;\n const yTileHeight = rectangle.height / yTiles;\n\n let longitude = position.longitude;\n if (rectangle.east < rectangle.west) {\n longitude += CesiumMath.TWO_PI;\n }\n\n let xTileCoordinate = ((longitude - rectangle.west) / xTileWidth) | 0;\n if (xTileCoordinate >= xTiles) {\n xTileCoordinate = xTiles - 1;\n }\n\n let yTileCoordinate =\n ((rectangle.north - position.latitude) / yTileHeight) | 0;\n if (yTileCoordinate >= yTiles) {\n yTileCoordinate = yTiles - 1;\n }\n\n if (!defined(result)) {\n return new Cartesian2(xTileCoordinate, yTileCoordinate);\n }\n\n result.x = xTileCoordinate;\n result.y = yTileCoordinate;\n return result;\n};\nexport default GeographicTilingScheme;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\nconst scratchDiagonalCartesianNE = new Cartesian3();\nconst scratchDiagonalCartesianSW = new Cartesian3();\nconst scratchDiagonalCartographic = new Cartographic();\nconst scratchCenterCartesian = new Cartesian3();\nconst scratchSurfaceCartesian = new Cartesian3();\n\nconst scratchBoundingSphere = new BoundingSphere();\nconst tilingScheme = new GeographicTilingScheme();\nconst scratchCorners = [\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n];\nconst scratchTileXY = new Cartesian2();\n\n/**\n * A collection of functions for approximating terrain height\n * @private\n */\nconst ApproximateTerrainHeights = {};\n\n/**\n * Initializes the minimum and maximum terrain heights\n * @return {Promise.<void>}\n */\nApproximateTerrainHeights.initialize = function () {\n let initPromise = ApproximateTerrainHeights._initPromise;\n if (defined(initPromise)) {\n return initPromise;\n }\n\n initPromise = Resource.fetchJson(\n buildModuleUrl(\"Assets/approximateTerrainHeights.json\")\n ).then(function (json) {\n ApproximateTerrainHeights._terrainHeights = json;\n });\n ApproximateTerrainHeights._initPromise = initPromise;\n\n return initPromise;\n};\n\n/**\n * Computes the minimum and maximum terrain heights for a given rectangle\n * @param {Rectangle} rectangle The bounding rectangle\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\n * @return {{minimumTerrainHeight: Number, maximumTerrainHeight: Number}}\n */\nApproximateTerrainHeights.getMinimumMaximumHeights = function (\n rectangle,\n ellipsoid\n) {\nellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n const xyLevel = getTileXYLevel(rectangle);\n\n // Get the terrain min/max for that tile\n let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n if (defined(xyLevel)) {\n const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\n const heights = ApproximateTerrainHeights._terrainHeights[key];\n if (defined(heights)) {\n minTerrainHeight = heights[0];\n maxTerrainHeight = heights[1];\n }\n\n // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface\n ellipsoid.cartographicToCartesian(\n Rectangle.northeast(rectangle, scratchDiagonalCartographic),\n scratchDiagonalCartesianNE\n );\n ellipsoid.cartographicToCartesian(\n Rectangle.southwest(rectangle, scratchDiagonalCartographic),\n scratchDiagonalCartesianSW\n );\n\n Cartesian3.midpoint(\n scratchDiagonalCartesianSW,\n scratchDiagonalCartesianNE,\n scratchCenterCartesian\n );\n const surfacePosition = ellipsoid.scaleToGeodeticSurface(\n scratchCenterCartesian,\n scratchSurfaceCartesian\n );\n if (defined(surfacePosition)) {\n const distance = Cartesian3.distance(\n scratchCenterCartesian,\n surfacePosition\n );\n minTerrainHeight = Math.min(minTerrainHeight, -distance);\n } else {\n minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n }\n }\n\n minTerrainHeight = Math.max(\n ApproximateTerrainHeights._defaultMinTerrainHeight,\n minTerrainHeight\n );\n\n return {\n minimumTerrainHeight: minTerrainHeight,\n maximumTerrainHeight: maxTerrainHeight,\n };\n};\n\n/**\n * Computes the bounding sphere based on the tile heights in the rectangle\n * @param {Rectangle} rectangle The bounding rectangle\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\n * @return {BoundingSphere} The result bounding sphere\n */\nApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {\nellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n const xyLevel = getTileXYLevel(rectangle);\n\n // Get the terrain max for that tile\n let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n if (defined(xyLevel)) {\n const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\n const heights = ApproximateTerrainHeights._terrainHeights[key];\n if (defined(heights)) {\n maxTerrainHeight = heights[1];\n }\n }\n\n const result = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);\n BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n maxTerrainHeight,\n scratchBoundingSphere\n );\n\n return BoundingSphere.union(result, scratchBoundingSphere, result);\n};\n\nfunction getTileXYLevel(rectangle) {\n Cartographic.fromRadians(\n rectangle.east,\n rectangle.north,\n 0.0,\n scratchCorners[0]\n );\n Cartographic.fromRadians(\n rectangle.west,\n rectangle.north,\n 0.0,\n scratchCorners[1]\n );\n Cartographic.fromRadians(\n rectangle.east,\n rectangle.south,\n 0.0,\n scratchCorners[2]\n );\n Cartographic.fromRadians(\n rectangle.west,\n rectangle.south,\n 0.0,\n scratchCorners[3]\n );\n\n // Determine which tile the bounding rectangle is in\n let lastLevelX = 0,\n lastLevelY = 0;\n let currentX = 0,\n currentY = 0;\n const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;\n let i;\n for (i = 0; i <= maxLevel; ++i) {\n let failed = false;\n for (let j = 0; j < 4; ++j) {\n const corner = scratchCorners[j];\n tilingScheme.positionToTileXY(corner, i, scratchTileXY);\n if (j === 0) {\n currentX = scratchTileXY.x;\n currentY = scratchTileXY.y;\n } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {\n failed = true;\n break;\n }\n }\n\n if (failed) {\n break;\n }\n\n lastLevelX = currentX;\n lastLevelY = currentY;\n }\n\n if (i === 0) {\n return undefined;\n }\n\n return {\n x: lastLevelX,\n y: lastLevelY,\n level: i > maxLevel ? maxLevel : i - 1,\n };\n}\n\nApproximateTerrainHeights._terrainHeightsMaxLevel = 6;\nApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;\nApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;\nApproximateTerrainHeights._terrainHeights = undefined;\nApproximateTerrainHeights._initPromise = undefined;\n\nObject.defineProperties(ApproximateTerrainHeights, {\n /**\n * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,\n * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.\n * @type {Boolean}\n * @readonly\n * @memberof ApproximateTerrainHeights\n */\n initialized: {\n get: function () {\n return defined(ApproximateTerrainHeights._terrainHeights);\n },\n },\n});\nexport default ApproximateTerrainHeights;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Intersect from \"./Intersect.js\";\n\n/**\n * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.\n * @alias AxisAlignedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes.\n * @param {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes.\n * @param {Cartesian3} [center] The center of the box; automatically computed if not supplied.\n *\n * @see BoundingSphere\n * @see BoundingRectangle\n */\nfunction AxisAlignedBoundingBox(minimum, maximum, center) {\n /**\n * The minimum point defining the bounding box.\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.minimum = Cartesian3.clone(defaultValue(minimum, Cartesian3.ZERO));\n\n /**\n * The maximum point defining the bounding box.\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.maximum = Cartesian3.clone(defaultValue(maximum, Cartesian3.ZERO));\n\n // If center was not defined, compute it.\n if (!defined(center)) {\n center = Cartesian3.midpoint(this.minimum, this.maximum, new Cartesian3());\n } else {\n center = Cartesian3.clone(center);\n }\n\n /**\n * The center point of the bounding box.\n * @type {Cartesian3}\n */\n this.center = center;\n}\n\n/**\n * Creates an instance of an AxisAlignedBoundingBox from its corners.\n *\n * @param {Cartesian3} minimum The minimum point along the x, y, and z axes.\n * @param {Cartesian3} maximum The maximum point along the x, y, and z axes.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an axis aligned bounding box from the two corners.\n * const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));\n */\nAxisAlignedBoundingBox.fromCorners = function (minimum, maximum, result) {\n if (!defined(result)) {\n result = new AxisAlignedBoundingBox();\n }\n\n result.minimum = Cartesian3.clone(minimum, result.minimum);\n result.maximum = Cartesian3.clone(maximum, result.maximum);\n result.center = Cartesian3.midpoint(minimum, maximum, result.center);\n\n return result;\n};\n\n/**\n * Computes an instance of an AxisAlignedBoundingBox. The box is determined by\n * finding the points spaced the farthest apart on the x, y, and z axes.\n *\n * @param {Cartesian3[]} positions List of points that the bounding box will enclose. Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an axis aligned bounding box enclosing two points.\n * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\n */\nAxisAlignedBoundingBox.fromPoints = function (positions, result) {\n if (!defined(result)) {\n result = new AxisAlignedBoundingBox();\n }\n\n if (!defined(positions) || positions.length === 0) {\n result.minimum = Cartesian3.clone(Cartesian3.ZERO, result.minimum);\n result.maximum = Cartesian3.clone(Cartesian3.ZERO, result.maximum);\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\n return result;\n }\n\n let minimumX = positions[0].x;\n let minimumY = positions[0].y;\n let minimumZ = positions[0].z;\n\n let maximumX = positions[0].x;\n let maximumY = positions[0].y;\n let maximumZ = positions[0].z;\n\n const length = positions.length;\n for (let i = 1; i < length; i++) {\n const p = positions[i];\n const x = p.x;\n const y = p.y;\n const z = p.z;\n\n minimumX = Math.min(x, minimumX);\n maximumX = Math.max(x, maximumX);\n minimumY = Math.min(y, minimumY);\n maximumY = Math.max(y, maximumY);\n minimumZ = Math.min(z, minimumZ);\n maximumZ = Math.max(z, maximumZ);\n }\n\n const minimum = result.minimum;\n minimum.x = minimumX;\n minimum.y = minimumY;\n minimum.z = minimumZ;\n\n const maximum = result.maximum;\n maximum.x = maximumX;\n maximum.y = maximumY;\n maximum.z = maximumZ;\n\n result.center = Cartesian3.midpoint(minimum, maximum, result.center);\n\n return result;\n};\n\n/**\n * Duplicates a AxisAlignedBoundingBox instance.\n *\n * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\n */\nAxisAlignedBoundingBox.clone = function (box, result) {\n if (!defined(box)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);\n }\n\n result.minimum = Cartesian3.clone(box.minimum, result.minimum);\n result.maximum = Cartesian3.clone(box.maximum, result.maximum);\n result.center = Cartesian3.clone(box.center, result.center);\n return result;\n};\n\n/**\n * Compares the provided AxisAlignedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.\n * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nAxisAlignedBoundingBox.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Cartesian3.equals(left.center, right.center) &&\n Cartesian3.equals(left.minimum, right.minimum) &&\n Cartesian3.equals(left.maximum, right.maximum))\n );\n};\n\nlet intersectScratch = new Cartesian3();\n/**\n * Determines which side of a plane a box is located.\n *\n * @param {AxisAlignedBoundingBox} box The bounding box to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nAxisAlignedBoundingBox.intersectPlane = function (box, plane) {\n intersectScratch = Cartesian3.subtract(\n box.maximum,\n box.minimum,\n intersectScratch\n );\n const h = Cartesian3.multiplyByScalar(\n intersectScratch,\n 0.5,\n intersectScratch\n ); //The positive half diagonal\n const normal = plane.normal;\n const e =\n h.x * Math.abs(normal.x) +\n h.y * Math.abs(normal.y) +\n h.z * Math.abs(normal.z);\n const s = Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center\n\n if (s - e > 0) {\n return Intersect.INSIDE;\n }\n\n if (s + e < 0) {\n //Not in front because normals point inward\n return Intersect.OUTSIDE;\n }\n\n return Intersect.INTERSECTING;\n};\n\n/**\n * Duplicates this AxisAlignedBoundingBox instance.\n *\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\n */\nAxisAlignedBoundingBox.prototype.clone = function (result) {\n return AxisAlignedBoundingBox.clone(this, result);\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nAxisAlignedBoundingBox.prototype.intersectPlane = function (plane) {\n return AxisAlignedBoundingBox.intersectPlane(this, plane);\n};\n\n/**\n * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nAxisAlignedBoundingBox.prototype.equals = function (right) {\n return AxisAlignedBoundingBox.equals(this, right);\n};\nexport default AxisAlignedBoundingBox;\n", "import DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.\n *\n * @namespace QuadraticRealPolynomial\n */\nconst QuadraticRealPolynomial = {};\n\n/**\n * Provides the discriminant of the quadratic equation from the supplied coefficients.\n *\n * @param {Number} a The coefficient of the 2nd order monomial.\n * @param {Number} b The coefficient of the 1st order monomial.\n * @param {Number} c The coefficient of the 0th order monomial.\n * @returns {Number} The value of the discriminant.\n */\nQuadraticRealPolynomial.computeDiscriminant = function (a, b, c) {\n const discriminant = b * b - 4.0 * a * c;\n return discriminant;\n};\n\nfunction addWithCancellationCheck(left, right, tolerance) {\n const difference = left + right;\n if (\n CesiumMath.sign(left) !== CesiumMath.sign(right) &&\n Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\n ) {\n return 0.0;\n }\n\n return difference;\n}\n\n/**\n * Provides the real valued roots of the quadratic polynomial with the provided coefficients.\n *\n * @param {Number} a The coefficient of the 2nd order monomial.\n * @param {Number} b The coefficient of the 1st order monomial.\n * @param {Number} c The coefficient of the 0th order monomial.\n * @returns {Number[]} The real valued roots.\n */\nQuadraticRealPolynomial.computeRealRoots = function (a, b, c) {\n let ratio;\n if (a === 0.0) {\n if (b === 0.0) {\n // Constant function: c = 0.\n return [];\n }\n\n // Linear function: b * x + c = 0.\n return [-c / b];\n } else if (b === 0.0) {\n if (c === 0.0) {\n // 2nd order monomial: a * x^2 = 0.\n return [0.0, 0.0];\n }\n\n const cMagnitude = Math.abs(c);\n const aMagnitude = Math.abs(a);\n\n if (\n cMagnitude < aMagnitude &&\n cMagnitude / aMagnitude < CesiumMath.EPSILON14\n ) {\n // c ~= 0.0.\n // 2nd order monomial: a * x^2 = 0.\n return [0.0, 0.0];\n } else if (\n cMagnitude > aMagnitude &&\n aMagnitude / cMagnitude < CesiumMath.EPSILON14\n ) {\n // a ~= 0.0.\n // Constant function: c = 0.\n return [];\n }\n\n // a * x^2 + c = 0\n ratio = -c / a;\n\n if (ratio < 0.0) {\n // Both roots are complex.\n return [];\n }\n\n // Both roots are real.\n const root = Math.sqrt(ratio);\n return [-root, root];\n } else if (c === 0.0) {\n // a * x^2 + b * x = 0\n ratio = -b / a;\n if (ratio < 0.0) {\n return [ratio, 0.0];\n }\n\n return [0.0, ratio];\n }\n\n // a * x^2 + b * x + c = 0\n const b2 = b * b;\n const four_ac = 4.0 * a * c;\n const radicand = addWithCancellationCheck(b2, -four_ac, CesiumMath.EPSILON14);\n\n if (radicand < 0.0) {\n // Both roots are complex.\n return [];\n }\n\n const q =\n -0.5 *\n addWithCancellationCheck(\n b,\n CesiumMath.sign(b) * Math.sqrt(radicand),\n CesiumMath.EPSILON14\n );\n if (b > 0.0) {\n return [q / a, c / q];\n }\n\n return [c / q, q / a];\n};\nexport default QuadraticRealPolynomial;\n", "import DeveloperError from \"./DeveloperError.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\n\n/**\n * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.\n *\n * @namespace CubicRealPolynomial\n */\nconst CubicRealPolynomial = {};\n\n/**\n * Provides the discriminant of the cubic equation from the supplied coefficients.\n *\n * @param {Number} a The coefficient of the 3rd order monomial.\n * @param {Number} b The coefficient of the 2nd order monomial.\n * @param {Number} c The coefficient of the 1st order monomial.\n * @param {Number} d The coefficient of the 0th order monomial.\n * @returns {Number} The value of the discriminant.\n */\nCubicRealPolynomial.computeDiscriminant = function (a, b, c, d) {\n const a2 = a * a;\n const b2 = b * b;\n const c2 = c * c;\n const d2 = d * d;\n\n const discriminant =\n 18.0 * a * b * c * d +\n b2 * c2 -\n 27.0 * a2 * d2 -\n 4.0 * (a * c2 * c + b2 * b * d);\n return discriminant;\n};\n\nfunction computeRealRoots(a, b, c, d) {\n const A = a;\n const B = b / 3.0;\n const C = c / 3.0;\n const D = d;\n\n const AC = A * C;\n const BD = B * D;\n const B2 = B * B;\n const C2 = C * C;\n const delta1 = A * C - B2;\n const delta2 = A * D - B * C;\n const delta3 = B * D - C2;\n\n const discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;\n let temp;\n let temp1;\n\n if (discriminant < 0.0) {\n let ABar;\n let CBar;\n let DBar;\n\n if (B2 * BD >= AC * C2) {\n ABar = A;\n CBar = delta1;\n DBar = -2.0 * B * delta1 + A * delta2;\n } else {\n ABar = D;\n CBar = delta3;\n DBar = -D * delta2 + 2.0 * C * delta3;\n }\n\n const s = DBar < 0.0 ? -1.0 : 1.0; // This is not Math.Sign()!\n const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);\n temp1 = -DBar + temp0;\n\n const x = temp1 / 2.0;\n const p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);\n const q = temp1 === temp0 ? -p : -CBar / p;\n\n temp = CBar <= 0.0 ? p + q : -DBar / (p * p + q * q + CBar);\n\n if (B2 * BD >= AC * C2) {\n return [(temp - B) / A];\n }\n\n return [-D / (temp + C)];\n }\n\n const CBarA = delta1;\n const DBarA = -2.0 * B * delta1 + A * delta2;\n\n const CBarD = delta3;\n const DBarD = -D * delta2 + 2.0 * C * delta3;\n\n const squareRootOfDiscriminant = Math.sqrt(discriminant);\n const halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;\n\n let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);\n temp = 2.0 * Math.sqrt(-CBarA);\n let cosine = Math.cos(theta);\n temp1 = temp * cosine;\n let temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\n\n const numeratorLarge = temp1 + temp3 > 2.0 * B ? temp1 - B : temp3 - B;\n const denominatorLarge = A;\n\n const root1 = numeratorLarge / denominatorLarge;\n\n theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);\n temp = 2.0 * Math.sqrt(-CBarD);\n cosine = Math.cos(theta);\n temp1 = temp * cosine;\n temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\n\n const numeratorSmall = -D;\n const denominatorSmall = temp1 + temp3 < 2.0 * C ? temp1 + C : temp3 + C;\n\n const root3 = numeratorSmall / denominatorSmall;\n\n const E = denominatorLarge * denominatorSmall;\n const F =\n -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;\n const G = numeratorLarge * numeratorSmall;\n\n const root2 = (C * F - B * G) / (-B * F + C * E);\n\n if (root1 <= root2) {\n if (root1 <= root3) {\n if (root2 <= root3) {\n return [root1, root2, root3];\n }\n return [root1, root3, root2];\n }\n return [root3, root1, root2];\n }\n if (root1 <= root3) {\n return [root2, root1, root3];\n }\n if (root2 <= root3) {\n return [root2, root3, root1];\n }\n return [root3, root2, root1];\n}\n\n/**\n * Provides the real valued roots of the cubic polynomial with the provided coefficients.\n *\n * @param {Number} a The coefficient of the 3rd order monomial.\n * @param {Number} b The coefficient of the 2nd order monomial.\n * @param {Number} c The coefficient of the 1st order monomial.\n * @param {Number} d The coefficient of the 0th order monomial.\n * @returns {Number[]} The real valued roots.\n */\nCubicRealPolynomial.computeRealRoots = function (a, b, c, d) {\n let roots;\n let ratio;\n if (a === 0.0) {\n // Quadratic function: b * x^2 + c * x + d = 0.\n return QuadraticRealPolynomial.computeRealRoots(b, c, d);\n } else if (b === 0.0) {\n if (c === 0.0) {\n if (d === 0.0) {\n // 3rd order monomial: a * x^3 = 0.\n return [0.0, 0.0, 0.0];\n }\n\n // a * x^3 + d = 0\n ratio = -d / a;\n const root =\n ratio < 0.0 ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);\n return [root, root, root];\n } else if (d === 0.0) {\n // x * (a * x^2 + c) = 0.\n roots = QuadraticRealPolynomial.computeRealRoots(a, 0, c);\n\n // Return the roots in ascending order.\n if (roots.Length === 0) {\n return [0.0];\n }\n return [roots[0], 0.0, roots[1]];\n }\n\n // Deflated cubic polynomial: a * x^3 + c * x + d= 0.\n return computeRealRoots(a, 0, c, d);\n } else if (c === 0.0) {\n if (d === 0.0) {\n // x^2 * (a * x + b) = 0.\n ratio = -b / a;\n if (ratio < 0.0) {\n return [ratio, 0.0, 0.0];\n }\n return [0.0, 0.0, ratio];\n }\n // a * x^3 + b * x^2 + d = 0.\n return computeRealRoots(a, b, 0, d);\n } else if (d === 0.0) {\n // x * (a * x^2 + b * x + c) = 0\n roots = QuadraticRealPolynomial.computeRealRoots(a, b, c);\n\n // Return the roots in ascending order.\n if (roots.length === 0) {\n return [0.0];\n } else if (roots[1] <= 0.0) {\n return [roots[0], roots[1], 0.0];\n } else if (roots[0] >= 0.0) {\n return [0.0, roots[0], roots[1]];\n }\n return [roots[0], 0.0, roots[1]];\n }\n\n return computeRealRoots(a, b, c, d);\n};\nexport default CubicRealPolynomial;\n", "import CubicRealPolynomial from \"./CubicRealPolynomial.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\n\n/**\n * Defines functions for 4th order polynomial functions of one variable with only real coefficients.\n *\n * @namespace QuarticRealPolynomial\n */\nconst QuarticRealPolynomial = {};\n\n/**\n * Provides the discriminant of the quartic equation from the supplied coefficients.\n *\n * @param {Number} a The coefficient of the 4th order monomial.\n * @param {Number} b The coefficient of the 3rd order monomial.\n * @param {Number} c The coefficient of the 2nd order monomial.\n * @param {Number} d The coefficient of the 1st order monomial.\n * @param {Number} e The coefficient of the 0th order monomial.\n * @returns {Number} The value of the discriminant.\n */\nQuarticRealPolynomial.computeDiscriminant = function (a, b, c, d, e) {\n const a2 = a * a;\n const a3 = a2 * a;\n const b2 = b * b;\n const b3 = b2 * b;\n const c2 = c * c;\n const c3 = c2 * c;\n const d2 = d * d;\n const d3 = d2 * d;\n const e2 = e * e;\n const e3 = e2 * e;\n\n const discriminant =\n b2 * c2 * d2 -\n 4.0 * b3 * d3 -\n 4.0 * a * c3 * d2 +\n 18 * a * b * c * d3 -\n 27.0 * a2 * d2 * d2 +\n 256.0 * a3 * e3 +\n e *\n (18.0 * b3 * c * d -\n 4.0 * b2 * c3 +\n 16.0 * a * c2 * c2 -\n 80.0 * a * b * c2 * d -\n 6.0 * a * b2 * d2 +\n 144.0 * a2 * c * d2) +\n e2 *\n (144.0 * a * b2 * c -\n 27.0 * b2 * b2 -\n 128.0 * a2 * c2 -\n 192.0 * a2 * b * d);\n return discriminant;\n};\n\nfunction original(a3, a2, a1, a0) {\n const a3Squared = a3 * a3;\n\n const p = a2 - (3.0 * a3Squared) / 8.0;\n const q = a1 - (a2 * a3) / 2.0 + (a3Squared * a3) / 8.0;\n const r =\n a0 -\n (a1 * a3) / 4.0 +\n (a2 * a3Squared) / 16.0 -\n (3.0 * a3Squared * a3Squared) / 256.0;\n\n // Find the roots of the cubic equations: h^6 + 2 p h^4 + (p^2 - 4 r) h^2 - q^2 = 0.\n const cubicRoots = CubicRealPolynomial.computeRealRoots(\n 1.0,\n 2.0 * p,\n p * p - 4.0 * r,\n -q * q\n );\n\n if (cubicRoots.length > 0) {\n const temp = -a3 / 4.0;\n\n // Use the largest positive root.\n const hSquared = cubicRoots[cubicRoots.length - 1];\n\n if (Math.abs(hSquared) < CesiumMath.EPSILON14) {\n // y^4 + p y^2 + r = 0.\n const roots = QuadraticRealPolynomial.computeRealRoots(1.0, p, r);\n\n if (roots.length === 2) {\n const root0 = roots[0];\n const root1 = roots[1];\n\n let y;\n if (root0 >= 0.0 && root1 >= 0.0) {\n const y0 = Math.sqrt(root0);\n const y1 = Math.sqrt(root1);\n\n return [temp - y1, temp - y0, temp + y0, temp + y1];\n } else if (root0 >= 0.0 && root1 < 0.0) {\n y = Math.sqrt(root0);\n return [temp - y, temp + y];\n } else if (root0 < 0.0 && root1 >= 0.0) {\n y = Math.sqrt(root1);\n return [temp - y, temp + y];\n }\n }\n return [];\n } else if (hSquared > 0.0) {\n const h = Math.sqrt(hSquared);\n\n const m = (p + hSquared - q / h) / 2.0;\n const n = (p + hSquared + q / h) / 2.0;\n\n // Now solve the two quadratic factors: (y^2 + h y + m)(y^2 - h y + n);\n const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, h, m);\n const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, -h, n);\n\n if (roots1.length !== 0) {\n roots1[0] += temp;\n roots1[1] += temp;\n\n if (roots2.length !== 0) {\n roots2[0] += temp;\n roots2[1] += temp;\n\n if (roots1[1] <= roots2[0]) {\n return [roots1[0], roots1[1], roots2[0], roots2[1]];\n } else if (roots2[1] <= roots1[0]) {\n return [roots2[0], roots2[1], roots1[0], roots1[1]];\n } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\n return [roots2[0], roots1[0], roots1[1], roots2[1]];\n } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\n return [roots1[0], roots2[0], roots2[1], roots1[1]];\n } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\n return [roots2[0], roots1[0], roots2[1], roots1[1]];\n }\n return [roots1[0], roots2[0], roots1[1], roots2[1]];\n }\n return roots1;\n }\n\n if (roots2.length !== 0) {\n roots2[0] += temp;\n roots2[1] += temp;\n\n return roots2;\n }\n return [];\n }\n }\n return [];\n}\n\nfunction neumark(a3, a2, a1, a0) {\n const a1Squared = a1 * a1;\n const a2Squared = a2 * a2;\n const a3Squared = a3 * a3;\n\n const p = -2.0 * a2;\n const q = a1 * a3 + a2Squared - 4.0 * a0;\n const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;\n\n const cubicRoots = CubicRealPolynomial.computeRealRoots(1.0, p, q, r);\n\n if (cubicRoots.length > 0) {\n // Use the most positive root\n const y = cubicRoots[0];\n\n const temp = a2 - y;\n const tempSquared = temp * temp;\n\n const g1 = a3 / 2.0;\n const h1 = temp / 2.0;\n\n const m = tempSquared - 4.0 * a0;\n const mError = tempSquared + 4.0 * Math.abs(a0);\n\n const n = a3Squared - 4.0 * y;\n const nError = a3Squared + 4.0 * Math.abs(y);\n\n let g2;\n let h2;\n\n if (y < 0.0 || m * nError < n * mError) {\n const squareRootOfN = Math.sqrt(n);\n g2 = squareRootOfN / 2.0;\n h2 = squareRootOfN === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfN;\n } else {\n const squareRootOfM = Math.sqrt(m);\n g2 = squareRootOfM === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfM;\n h2 = squareRootOfM / 2.0;\n }\n\n let G;\n let g;\n if (g1 === 0.0 && g2 === 0.0) {\n G = 0.0;\n g = 0.0;\n } else if (CesiumMath.sign(g1) === CesiumMath.sign(g2)) {\n G = g1 + g2;\n g = y / G;\n } else {\n g = g1 - g2;\n G = y / g;\n }\n\n let H;\n let h;\n if (h1 === 0.0 && h2 === 0.0) {\n H = 0.0;\n h = 0.0;\n } else if (CesiumMath.sign(h1) === CesiumMath.sign(h2)) {\n H = h1 + h2;\n h = a0 / H;\n } else {\n h = h1 - h2;\n H = a0 / h;\n }\n\n // Now solve the two quadratic factors: (y^2 + G y + H)(y^2 + g y + h);\n const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, G, H);\n const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, g, h);\n\n if (roots1.length !== 0) {\n if (roots2.length !== 0) {\n if (roots1[1] <= roots2[0]) {\n return [roots1[0], roots1[1], roots2[0], roots2[1]];\n } else if (roots2[1] <= roots1[0]) {\n return [roots2[0], roots2[1], roots1[0], roots1[1]];\n } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\n return [roots2[0], roots1[0], roots1[1], roots2[1]];\n } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\n return [roots1[0], roots2[0], roots2[1], roots1[1]];\n } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\n return [roots2[0], roots1[0], roots2[1], roots1[1]];\n }\n return [roots1[0], roots2[0], roots1[1], roots2[1]];\n }\n return roots1;\n }\n if (roots2.length !== 0) {\n return roots2;\n }\n }\n return [];\n}\n\n/**\n * Provides the real valued roots of the quartic polynomial with the provided coefficients.\n *\n * @param {Number} a The coefficient of the 4th order monomial.\n * @param {Number} b The coefficient of the 3rd order monomial.\n * @param {Number} c The coefficient of the 2nd order monomial.\n * @param {Number} d The coefficient of the 1st order monomial.\n * @param {Number} e The coefficient of the 0th order monomial.\n * @returns {Number[]} The real valued roots.\n */\nQuarticRealPolynomial.computeRealRoots = function (a, b, c, d, e) {\n if (Math.abs(a) < CesiumMath.EPSILON15) {\n return CubicRealPolynomial.computeRealRoots(b, c, d, e);\n }\n const a3 = b / a;\n const a2 = c / a;\n const a1 = d / a;\n const a0 = e / a;\n\n let k = a3 < 0.0 ? 1 : 0;\n k += a2 < 0.0 ? k + 1 : k;\n k += a1 < 0.0 ? k + 1 : k;\n k += a0 < 0.0 ? k + 1 : k;\n\n switch (k) {\n case 0:\n return original(a3, a2, a1, a0);\n case 1:\n return neumark(a3, a2, a1, a0);\n case 2:\n return neumark(a3, a2, a1, a0);\n case 3:\n return original(a3, a2, a1, a0);\n case 4:\n return original(a3, a2, a1, a0);\n case 5:\n return neumark(a3, a2, a1, a0);\n case 6:\n return original(a3, a2, a1, a0);\n case 7:\n return original(a3, a2, a1, a0);\n case 8:\n return neumark(a3, a2, a1, a0);\n case 9:\n return original(a3, a2, a1, a0);\n case 10:\n return original(a3, a2, a1, a0);\n case 11:\n return neumark(a3, a2, a1, a0);\n case 12:\n return original(a3, a2, a1, a0);\n case 13:\n return original(a3, a2, a1, a0);\n case 14:\n return original(a3, a2, a1, a0);\n case 15:\n return original(a3, a2, a1, a0);\n default:\n return undefined;\n }\n};\nexport default QuarticRealPolynomial;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Represents a ray that extends infinitely from the provided origin in the provided direction.\n * @alias Ray\n * @constructor\n *\n * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.\n * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.\n */\nfunction Ray(origin, direction) {\n direction = Cartesian3.clone(defaultValue(direction, Cartesian3.ZERO));\n if (!Cartesian3.equals(direction, Cartesian3.ZERO)) {\n Cartesian3.normalize(direction, direction);\n }\n\n /**\n * The origin of the ray.\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.origin = Cartesian3.clone(defaultValue(origin, Cartesian3.ZERO));\n\n /**\n * The direction of the ray.\n * @type {Cartesian3}\n */\n this.direction = direction;\n}\n\n/**\n * Duplicates a Ray instance.\n *\n * @param {Ray} ray The ray to duplicate.\n * @param {Ray} [result] The object onto which to store the result.\n * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)\n */\nRay.clone = function (ray, result) {\n if (!defined(ray)) {\n return undefined;\n }\n if (!defined(result)) {\n return new Ray(ray.origin, ray.direction);\n }\n result.origin = Cartesian3.clone(ray.origin);\n result.direction = Cartesian3.clone(ray.direction);\n return result;\n};\n\n/**\n * Computes the point along the ray given by r(t) = o + t*d,\n * where o is the origin of the ray and d is the direction.\n *\n * @param {Ray} ray The ray.\n * @param {Number} t A scalar value.\n * @param {Cartesian3} [result] The object in which the result will be stored.\n * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.\n *\n * @example\n * //Get the first intersection point of a ray and an ellipsoid.\n * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);\n * const point = Cesium.Ray.getPoint(ray, intersection.start);\n */\nRay.getPoint = function (ray, t, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n result = Cartesian3.multiplyByScalar(ray.direction, t, result);\n return Cartesian3.add(ray.origin, result, result);\n};\nexport default Ray;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\nimport QuarticRealPolynomial from \"./QuarticRealPolynomial.js\";\nimport Ray from \"./Ray.js\";\n\n/**\n * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.\n *\n * @namespace IntersectionTests\n */\nconst IntersectionTests = {};\n\n/**\n * Computes the intersection of a ray and a plane.\n *\n * @param {Ray} ray The ray.\n * @param {Plane} plane The plane.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.rayPlane = function (ray, plane, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const origin = ray.origin;\n const direction = ray.direction;\n const normal = plane.normal;\n const denominator = Cartesian3.dot(normal, direction);\n\n if (Math.abs(denominator) < CesiumMath.EPSILON15) {\n // Ray is parallel to plane. The ray may be in the polygon's plane.\n return undefined;\n }\n\n const t = (-plane.distance - Cartesian3.dot(normal, origin)) / denominator;\n\n if (t < 0) {\n return undefined;\n }\n\n result = Cartesian3.multiplyByScalar(direction, t, result);\n return Cartesian3.add(origin, result, result);\n};\n\nconst scratchEdge0 = new Cartesian3();\nconst scratchEdge1 = new Cartesian3();\nconst scratchPVec = new Cartesian3();\nconst scratchTVec = new Cartesian3();\nconst scratchQVec = new Cartesian3();\n\n/**\n * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.\n *\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\n *\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n * and return undefined for intersections with the back face.\n * @returns {Number} The intersection as a parametric distance along the ray, or undefined if there is no intersection.\n */\nIntersectionTests.rayTriangleParametric = function (\n ray,\n p0,\n p1,\n p2,\n cullBackFaces\n) {\n cullBackFaces = defaultValue(cullBackFaces, false);\n\n const origin = ray.origin;\n const direction = ray.direction;\n\n const edge0 = Cartesian3.subtract(p1, p0, scratchEdge0);\n const edge1 = Cartesian3.subtract(p2, p0, scratchEdge1);\n\n const p = Cartesian3.cross(direction, edge1, scratchPVec);\n const det = Cartesian3.dot(edge0, p);\n\n let tvec;\n let q;\n\n let u;\n let v;\n let t;\n\n if (cullBackFaces) {\n if (det < CesiumMath.EPSILON6) {\n return undefined;\n }\n\n tvec = Cartesian3.subtract(origin, p0, scratchTVec);\n u = Cartesian3.dot(tvec, p);\n if (u < 0.0 || u > det) {\n return undefined;\n }\n\n q = Cartesian3.cross(tvec, edge0, scratchQVec);\n\n v = Cartesian3.dot(direction, q);\n if (v < 0.0 || u + v > det) {\n return undefined;\n }\n\n t = Cartesian3.dot(edge1, q) / det;\n } else {\n if (Math.abs(det) < CesiumMath.EPSILON6) {\n return undefined;\n }\n const invDet = 1.0 / det;\n\n tvec = Cartesian3.subtract(origin, p0, scratchTVec);\n u = Cartesian3.dot(tvec, p) * invDet;\n if (u < 0.0 || u > 1.0) {\n return undefined;\n }\n\n q = Cartesian3.cross(tvec, edge0, scratchQVec);\n\n v = Cartesian3.dot(direction, q) * invDet;\n if (v < 0.0 || u + v > 1.0) {\n return undefined;\n }\n\n t = Cartesian3.dot(edge1, q) * invDet;\n }\n\n return t;\n};\n\n/**\n * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.\n *\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\n *\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n * and return undefined for intersections with the back face.\n * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.rayTriangle = function (\n ray,\n p0,\n p1,\n p2,\n cullBackFaces,\n result\n) {\n const t = IntersectionTests.rayTriangleParametric(\n ray,\n p0,\n p1,\n p2,\n cullBackFaces\n );\n if (!defined(t) || t < 0.0) {\n return undefined;\n }\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n Cartesian3.multiplyByScalar(ray.direction, t, result);\n return Cartesian3.add(ray.origin, result, result);\n};\n\nconst scratchLineSegmentTriangleRay = new Ray();\n\n/**\n * Computes the intersection of a line segment and a triangle.\n * @memberof IntersectionTests\n *\n * @param {Cartesian3} v0 The an end point of the line segment.\n * @param {Cartesian3} v1 The other end point of the line segment.\n * @param {Cartesian3} p0 The first vertex of the triangle.\n * @param {Cartesian3} p1 The second vertex of the triangle.\n * @param {Cartesian3} p2 The third vertex of the triangle.\n * @param {Boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle\n * and return undefined for intersections with the back face.\n * @param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\n */\nIntersectionTests.lineSegmentTriangle = function (\n v0,\n v1,\n p0,\n p1,\n p2,\n cullBackFaces,\n result\n) {\n const ray = scratchLineSegmentTriangleRay;\n Cartesian3.clone(v0, ray.origin);\n Cartesian3.subtract(v1, v0, ray.direction);\n Cartesian3.normalize(ray.direction, ray.direction);\n\n const t = IntersectionTests.rayTriangleParametric(\n ray,\n p0,\n p1,\n p2,\n cullBackFaces\n );\n if (!defined(t) || t < 0.0 || t > Cartesian3.distance(v0, v1)) {\n return undefined;\n }\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n Cartesian3.multiplyByScalar(ray.direction, t, result);\n return Cartesian3.add(ray.origin, result, result);\n};\n\nfunction solveQuadratic(a, b, c, result) {\n const det = b * b - 4.0 * a * c;\n if (det < 0.0) {\n return undefined;\n } else if (det > 0.0) {\n const denom = 1.0 / (2.0 * a);\n const disc = Math.sqrt(det);\n const root0 = (-b + disc) * denom;\n const root1 = (-b - disc) * denom;\n\n if (root0 < root1) {\n result.root0 = root0;\n result.root1 = root1;\n } else {\n result.root0 = root1;\n result.root1 = root0;\n }\n\n return result;\n }\n\n const root = -b / (2.0 * a);\n if (root === 0.0) {\n return undefined;\n }\n\n result.root0 = result.root1 = root;\n return result;\n}\n\nconst raySphereRoots = {\n root0: 0.0,\n root1: 0.0,\n};\n\nfunction raySphere(ray, sphere, result) {\n if (!defined(result)) {\n result = new Interval();\n }\n\n const origin = ray.origin;\n const direction = ray.direction;\n\n const center = sphere.center;\n const radiusSquared = sphere.radius * sphere.radius;\n\n const diff = Cartesian3.subtract(origin, center, scratchPVec);\n\n const a = Cartesian3.dot(direction, direction);\n const b = 2.0 * Cartesian3.dot(direction, diff);\n const c = Cartesian3.magnitudeSquared(diff) - radiusSquared;\n\n const roots = solveQuadratic(a, b, c, raySphereRoots);\n if (!defined(roots)) {\n return undefined;\n }\n\n result.start = roots.root0;\n result.stop = roots.root1;\n return result;\n}\n\n/**\n * Computes the intersection points of a ray with a sphere.\n * @memberof IntersectionTests\n *\n * @param {Ray} ray The ray.\n * @param {BoundingSphere} sphere The sphere.\n * @param {Interval} [result] The result onto which to store the result.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.raySphere = function (ray, sphere, result) {\n result = raySphere(ray, sphere, result);\n if (!defined(result) || result.stop < 0.0) {\n return undefined;\n }\n\n result.start = Math.max(result.start, 0.0);\n return result;\n};\n\nconst scratchLineSegmentRay = new Ray();\n\n/**\n * Computes the intersection points of a line segment with a sphere.\n * @memberof IntersectionTests\n *\n * @param {Cartesian3} p0 An end point of the line segment.\n * @param {Cartesian3} p1 The other end point of the line segment.\n * @param {BoundingSphere} sphere The sphere.\n * @param {Interval} [result] The result onto which to store the result.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.lineSegmentSphere = function (p0, p1, sphere, result) {\n const ray = scratchLineSegmentRay;\n Cartesian3.clone(p0, ray.origin);\n const direction = Cartesian3.subtract(p1, p0, ray.direction);\n\n const maxT = Cartesian3.magnitude(direction);\n Cartesian3.normalize(direction, direction);\n\n result = raySphere(ray, sphere, result);\n if (!defined(result) || result.stop < 0.0 || result.start > maxT) {\n return undefined;\n }\n\n result.start = Math.max(result.start, 0.0);\n result.stop = Math.min(result.stop, maxT);\n return result;\n};\n\nconst scratchQ = new Cartesian3();\nconst scratchW = new Cartesian3();\n\n/**\n * Computes the intersection points of a ray with an ellipsoid.\n *\n * @param {Ray} ray The ray.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\n */\nIntersectionTests.rayEllipsoid = function (ray, ellipsoid) {\n const inverseRadii = ellipsoid.oneOverRadii;\n const q = Cartesian3.multiplyComponents(inverseRadii, ray.origin, scratchQ);\n const w = Cartesian3.multiplyComponents(\n inverseRadii,\n ray.direction,\n scratchW\n );\n\n const q2 = Cartesian3.magnitudeSquared(q);\n const qw = Cartesian3.dot(q, w);\n\n let difference, w2, product, discriminant, temp;\n\n if (q2 > 1.0) {\n // Outside ellipsoid.\n if (qw >= 0.0) {\n // Looking outward or tangent (0 intersections).\n return undefined;\n }\n\n // qw < 0.0.\n const qw2 = qw * qw;\n difference = q2 - 1.0; // Positively valued.\n w2 = Cartesian3.magnitudeSquared(w);\n product = w2 * difference;\n\n if (qw2 < product) {\n // Imaginary roots (0 intersections).\n return undefined;\n } else if (qw2 > product) {\n // Distinct roots (2 intersections).\n discriminant = qw * qw - product;\n temp = -qw + Math.sqrt(discriminant); // Avoid cancellation.\n const root0 = temp / w2;\n const root1 = difference / temp;\n if (root0 < root1) {\n return new Interval(root0, root1);\n }\n\n return {\n start: root1,\n stop: root0,\n };\n }\n // qw2 == product. Repeated roots (2 intersections).\n const root = Math.sqrt(difference / w2);\n return new Interval(root, root);\n } else if (q2 < 1.0) {\n // Inside ellipsoid (2 intersections).\n difference = q2 - 1.0; // Negatively valued.\n w2 = Cartesian3.magnitudeSquared(w);\n product = w2 * difference; // Negatively valued.\n\n discriminant = qw * qw - product;\n temp = -qw + Math.sqrt(discriminant); // Positively valued.\n return new Interval(0.0, temp / w2);\n }\n // q2 == 1.0. On ellipsoid.\n if (qw < 0.0) {\n // Looking inward.\n w2 = Cartesian3.magnitudeSquared(w);\n return new Interval(0.0, -qw / w2);\n }\n\n // qw >= 0.0. Looking outward or tangent.\n return undefined;\n};\n\nfunction addWithCancellationCheck(left, right, tolerance) {\n const difference = left + right;\n if (\n CesiumMath.sign(left) !== CesiumMath.sign(right) &&\n Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\n ) {\n return 0.0;\n }\n\n return difference;\n}\n\nfunction quadraticVectorExpression(A, b, c, x, w) {\n const xSquared = x * x;\n const wSquared = w * w;\n\n const l2 = (A[Matrix3.COLUMN1ROW1] - A[Matrix3.COLUMN2ROW2]) * wSquared;\n const l1 =\n w *\n (x *\n addWithCancellationCheck(\n A[Matrix3.COLUMN1ROW0],\n A[Matrix3.COLUMN0ROW1],\n CesiumMath.EPSILON15\n ) +\n b.y);\n const l0 =\n A[Matrix3.COLUMN0ROW0] * xSquared +\n A[Matrix3.COLUMN2ROW2] * wSquared +\n x * b.x +\n c;\n\n const r1 =\n wSquared *\n addWithCancellationCheck(\n A[Matrix3.COLUMN2ROW1],\n A[Matrix3.COLUMN1ROW2],\n CesiumMath.EPSILON15\n );\n const r0 =\n w *\n (x *\n addWithCancellationCheck(A[Matrix3.COLUMN2ROW0], A[Matrix3.COLUMN0ROW2]) +\n b.z);\n\n let cosines;\n const solutions = [];\n if (r0 === 0.0 && r1 === 0.0) {\n cosines = QuadraticRealPolynomial.computeRealRoots(l2, l1, l0);\n if (cosines.length === 0) {\n return solutions;\n }\n\n const cosine0 = cosines[0];\n const sine0 = Math.sqrt(Math.max(1.0 - cosine0 * cosine0, 0.0));\n solutions.push(new Cartesian3(x, w * cosine0, w * -sine0));\n solutions.push(new Cartesian3(x, w * cosine0, w * sine0));\n\n if (cosines.length === 2) {\n const cosine1 = cosines[1];\n const sine1 = Math.sqrt(Math.max(1.0 - cosine1 * cosine1, 0.0));\n solutions.push(new Cartesian3(x, w * cosine1, w * -sine1));\n solutions.push(new Cartesian3(x, w * cosine1, w * sine1));\n }\n\n return solutions;\n }\n\n const r0Squared = r0 * r0;\n const r1Squared = r1 * r1;\n const l2Squared = l2 * l2;\n const r0r1 = r0 * r1;\n\n const c4 = l2Squared + r1Squared;\n const c3 = 2.0 * (l1 * l2 + r0r1);\n const c2 = 2.0 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;\n const c1 = 2.0 * (l0 * l1 - r0r1);\n const c0 = l0 * l0 - r0Squared;\n\n if (c4 === 0.0 && c3 === 0.0 && c2 === 0.0 && c1 === 0.0) {\n return solutions;\n }\n\n cosines = QuarticRealPolynomial.computeRealRoots(c4, c3, c2, c1, c0);\n const length = cosines.length;\n if (length === 0) {\n return solutions;\n }\n\n for (let i = 0; i < length; ++i) {\n const cosine = cosines[i];\n const cosineSquared = cosine * cosine;\n const sineSquared = Math.max(1.0 - cosineSquared, 0.0);\n const sine = Math.sqrt(sineSquared);\n\n //const left = l2 * cosineSquared + l1 * cosine + l0;\n let left;\n if (CesiumMath.sign(l2) === CesiumMath.sign(l0)) {\n left = addWithCancellationCheck(\n l2 * cosineSquared + l0,\n l1 * cosine,\n CesiumMath.EPSILON12\n );\n } else if (CesiumMath.sign(l0) === CesiumMath.sign(l1 * cosine)) {\n left = addWithCancellationCheck(\n l2 * cosineSquared,\n l1 * cosine + l0,\n CesiumMath.EPSILON12\n );\n } else {\n left = addWithCancellationCheck(\n l2 * cosineSquared + l1 * cosine,\n l0,\n CesiumMath.EPSILON12\n );\n }\n\n const right = addWithCancellationCheck(\n r1 * cosine,\n r0,\n CesiumMath.EPSILON15\n );\n const product = left * right;\n\n if (product < 0.0) {\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\n } else if (product > 0.0) {\n solutions.push(new Cartesian3(x, w * cosine, w * -sine));\n } else if (sine !== 0.0) {\n solutions.push(new Cartesian3(x, w * cosine, w * -sine));\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\n ++i;\n } else {\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\n }\n }\n\n return solutions;\n}\n\nconst firstAxisScratch = new Cartesian3();\nconst secondAxisScratch = new Cartesian3();\nconst thirdAxisScratch = new Cartesian3();\nconst referenceScratch = new Cartesian3();\nconst bCart = new Cartesian3();\nconst bScratch = new Matrix3();\nconst btScratch = new Matrix3();\nconst diScratch = new Matrix3();\nconst dScratch = new Matrix3();\nconst cScratch = new Matrix3();\nconst tempMatrix = new Matrix3();\nconst aScratch = new Matrix3();\nconst sScratch = new Cartesian3();\nconst closestScratch = new Cartesian3();\nconst surfPointScratch = new Cartographic();\n\n/**\n * Provides the point along the ray which is nearest to the ellipsoid.\n *\n * @param {Ray} ray The ray.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @returns {Cartesian3} The nearest planetodetic point on the ray.\n */\nIntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {\n const position = ray.origin;\n const direction = ray.direction;\n\n if (!Cartesian3.equals(position, Cartesian3.ZERO)) {\n const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);\n if (Cartesian3.dot(direction, normal) >= 0.0) {\n // The location provided is the closest point in altitude\n return position;\n }\n }\n\n const intersects = defined(this.rayEllipsoid(ray, ellipsoid));\n\n // Compute the scaled direction vector.\n const f = ellipsoid.transformPositionToScaledSpace(\n direction,\n firstAxisScratch\n );\n\n // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose.\n const firstAxis = Cartesian3.normalize(f, f);\n const reference = Cartesian3.mostOrthogonalAxis(f, referenceScratch);\n const secondAxis = Cartesian3.normalize(\n Cartesian3.cross(reference, firstAxis, secondAxisScratch),\n secondAxisScratch\n );\n const thirdAxis = Cartesian3.normalize(\n Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch),\n thirdAxisScratch\n );\n const B = bScratch;\n B[0] = firstAxis.x;\n B[1] = firstAxis.y;\n B[2] = firstAxis.z;\n B[3] = secondAxis.x;\n B[4] = secondAxis.y;\n B[5] = secondAxis.z;\n B[6] = thirdAxis.x;\n B[7] = thirdAxis.y;\n B[8] = thirdAxis.z;\n\n const B_T = Matrix3.transpose(B, btScratch);\n\n // Get the scaling matrix and its inverse.\n const D_I = Matrix3.fromScale(ellipsoid.radii, diScratch);\n const D = Matrix3.fromScale(ellipsoid.oneOverRadii, dScratch);\n\n const C = cScratch;\n C[0] = 0.0;\n C[1] = -direction.z;\n C[2] = direction.y;\n C[3] = direction.z;\n C[4] = 0.0;\n C[5] = -direction.x;\n C[6] = -direction.y;\n C[7] = direction.x;\n C[8] = 0.0;\n\n const temp = Matrix3.multiply(\n Matrix3.multiply(B_T, D, tempMatrix),\n C,\n tempMatrix\n );\n const A = Matrix3.multiply(\n Matrix3.multiply(temp, D_I, aScratch),\n B,\n aScratch\n );\n const b = Matrix3.multiplyByVector(temp, position, bCart);\n\n // Solve for the solutions to the expression in standard form:\n const solutions = quadraticVectorExpression(\n A,\n Cartesian3.negate(b, firstAxisScratch),\n 0.0,\n 0.0,\n 1.0\n );\n\n let s;\n let altitude;\n const length = solutions.length;\n if (length > 0) {\n let closest = Cartesian3.clone(Cartesian3.ZERO, closestScratch);\n let maximumValue = Number.NEGATIVE_INFINITY;\n\n for (let i = 0; i < length; ++i) {\n s = Matrix3.multiplyByVector(\n D_I,\n Matrix3.multiplyByVector(B, solutions[i], sScratch),\n sScratch\n );\n const v = Cartesian3.normalize(\n Cartesian3.subtract(s, position, referenceScratch),\n referenceScratch\n );\n const dotProduct = Cartesian3.dot(v, direction);\n\n if (dotProduct > maximumValue) {\n maximumValue = dotProduct;\n closest = Cartesian3.clone(s, closest);\n }\n }\n\n const surfacePoint = ellipsoid.cartesianToCartographic(\n closest,\n surfPointScratch\n );\n maximumValue = CesiumMath.clamp(maximumValue, 0.0, 1.0);\n altitude =\n Cartesian3.magnitude(\n Cartesian3.subtract(closest, position, referenceScratch)\n ) * Math.sqrt(1.0 - maximumValue * maximumValue);\n altitude = intersects ? -altitude : altitude;\n surfacePoint.height = altitude;\n return ellipsoid.cartographicToCartesian(surfacePoint, new Cartesian3());\n }\n\n return undefined;\n};\n\nconst lineSegmentPlaneDifference = new Cartesian3();\n\n/**\n * Computes the intersection of a line segment and a plane.\n *\n * @param {Cartesian3} endPoint0 An end point of the line segment.\n * @param {Cartesian3} endPoint1 The other end point of the line segment.\n * @param {Plane} plane The plane.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The intersection point or undefined if there is no intersection.\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\n *\n * const p0 = new Cesium.Cartesian3(...);\n * const p1 = new Cesium.Cartesian3(...);\n *\n * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.\n * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);\n */\nIntersectionTests.lineSegmentPlane = function (\n endPoint0,\n endPoint1,\n plane,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const difference = Cartesian3.subtract(\n endPoint1,\n endPoint0,\n lineSegmentPlaneDifference\n );\n const normal = plane.normal;\n const nDotDiff = Cartesian3.dot(normal, difference);\n\n // check if the segment and plane are parallel\n if (Math.abs(nDotDiff) < CesiumMath.EPSILON6) {\n return undefined;\n }\n\n const nDotP0 = Cartesian3.dot(normal, endPoint0);\n const t = -(plane.distance + nDotP0) / nDotDiff;\n\n // intersection only if t is in [0, 1]\n if (t < 0.0 || t > 1.0) {\n return undefined;\n }\n\n // intersection is endPoint0 + t * (endPoint1 - endPoint0)\n Cartesian3.multiplyByScalar(difference, t, result);\n Cartesian3.add(endPoint0, result, result);\n return result;\n};\n\n/**\n * Computes the intersection of a triangle and a plane\n *\n * @param {Cartesian3} p0 First point of the triangle\n * @param {Cartesian3} p1 Second point of the triangle\n * @param {Cartesian3} p2 Third point of the triangle\n * @param {Plane} plane Intersection plane\n * @returns {Object} An object with properties <code>positions</code> and <code>indices</code>, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\n *\n * const p0 = new Cesium.Cartesian3(...);\n * const p1 = new Cesium.Cartesian3(...);\n * const p2 = new Cesium.Cartesian3(...);\n *\n * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane\n * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);\n */\nIntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) {\n const planeNormal = plane.normal;\n const planeD = plane.distance;\n const p0Behind = Cartesian3.dot(planeNormal, p0) + planeD < 0.0;\n const p1Behind = Cartesian3.dot(planeNormal, p1) + planeD < 0.0;\n const p2Behind = Cartesian3.dot(planeNormal, p2) + planeD < 0.0;\n // Given these dots products, the calls to lineSegmentPlaneIntersection\n // always have defined results.\n\n let numBehind = 0;\n numBehind += p0Behind ? 1 : 0;\n numBehind += p1Behind ? 1 : 0;\n numBehind += p2Behind ? 1 : 0;\n\n let u1, u2;\n if (numBehind === 1 || numBehind === 2) {\n u1 = new Cartesian3();\n u2 = new Cartesian3();\n }\n\n if (numBehind === 1) {\n if (p0Behind) {\n IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);\n IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 0,\n 3,\n 4,\n\n // In front\n 1,\n 2,\n 4,\n 1,\n 4,\n 3,\n ],\n };\n } else if (p1Behind) {\n IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);\n IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 1,\n 3,\n 4,\n\n // In front\n 2,\n 0,\n 4,\n 2,\n 4,\n 3,\n ],\n };\n } else if (p2Behind) {\n IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);\n IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 2,\n 3,\n 4,\n\n // In front\n 0,\n 1,\n 4,\n 0,\n 4,\n 3,\n ],\n };\n }\n } else if (numBehind === 2) {\n if (!p0Behind) {\n IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);\n IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 1,\n 2,\n 4,\n 1,\n 4,\n 3,\n\n // In front\n 0,\n 3,\n 4,\n ],\n };\n } else if (!p1Behind) {\n IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);\n IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 2,\n 0,\n 4,\n 2,\n 4,\n 3,\n\n // In front\n 1,\n 3,\n 4,\n ],\n };\n } else if (!p2Behind) {\n IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);\n IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);\n\n return {\n positions: [p0, p1, p2, u1, u2],\n indices: [\n // Behind\n 0,\n 1,\n 4,\n 0,\n 4,\n 3,\n\n // In front\n 2,\n 3,\n 4,\n ],\n };\n }\n }\n\n // if numBehind is 3, the triangle is completely behind the plane;\n // otherwise, it is completely in front (numBehind is 0).\n return undefined;\n};\nexport default IntersectionTests;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * A plane in Hessian Normal Form defined by\n * <pre>\n * ax + by + cz + d = 0\n * </pre>\n * where (a, b, c) is the plane's <code>normal</code>, d is the signed\n * <code>distance</code> to the plane, and (x, y, z) is any point on\n * the plane.\n *\n * @alias Plane\n * @constructor\n *\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {Number} distance The shortest distance from the origin to the plane. The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on. If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n *\n * @example\n * // The plane x=0\n * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nfunction Plane(normal, distance) {\n /**\n * The plane's normal.\n *\n * @type {Cartesian3}\n */\n this.normal = Cartesian3.clone(normal);\n\n /**\n * The shortest distance from the origin to the plane. The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on. If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n *\n * @type {Number}\n */\n this.distance = distance;\n}\n\n/**\n * Creates a plane from a normal and a point on the plane.\n *\n * @param {Cartesian3} point The point on the plane.\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} A new plane instance or the modified result parameter.\n *\n * @example\n * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);\n * const normal = ellipsoid.geodeticSurfaceNormal(point);\n * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nPlane.fromPointNormal = function (point, normal, result) {\n const distance = -Cartesian3.dot(normal, point);\n\n if (!defined(result)) {\n return new Plane(normal, distance);\n }\n\n Cartesian3.clone(normal, result.normal);\n result.distance = distance;\n return result;\n};\n\nconst scratchNormal = new Cartesian3();\n/**\n * Creates a plane from the general equation\n *\n * @param {Cartesian4} coefficients The plane's normal (normalized).\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} A new plane instance or the modified result parameter.\n *\n * @exception {DeveloperError} Normal must be normalized\n */\nPlane.fromCartesian4 = function (coefficients, result) {\n const normal = Cartesian3.fromCartesian4(coefficients, scratchNormal);\n const distance = coefficients.w;\n\n if (!defined(result)) {\n return new Plane(normal, distance);\n }\n Cartesian3.clone(normal, result.normal);\n result.distance = distance;\n return result;\n};\n\n/**\n * Computes the signed shortest distance of a point to a plane.\n * The sign of the distance determines which side of the plane the point\n * is on. If the distance is positive, the point is in the half-space\n * in the direction of the normal; if negative, the point is in the half-space\n * opposite to the normal; if zero, the plane passes through the point.\n *\n * @param {Plane} plane The plane.\n * @param {Cartesian3} point The point.\n * @returns {Number} The signed shortest distance of the point to the plane.\n */\nPlane.getPointDistance = function (plane, point) {\n return Cartesian3.dot(plane.normal, point) + plane.distance;\n};\n\nconst scratchCartesian = new Cartesian3();\n/**\n * Projects a point onto the plane.\n * @param {Plane} plane The plane to project the point onto\n * @param {Cartesian3} point The point to project onto the plane\n * @param {Cartesian3} [result] The result point. If undefined, a new Cartesian3 will be created.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\n */\nPlane.projectPointOntoPlane = function (plane, point, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n // projectedPoint = point - (normal.point + scale) * normal\n const pointDistance = Plane.getPointDistance(plane, point);\n const scaledNormal = Cartesian3.multiplyByScalar(\n plane.normal,\n pointDistance,\n scratchCartesian\n );\n\n return Cartesian3.subtract(point, scaledNormal, result);\n};\n\nconst scratchInverseTranspose = new Matrix4();\nconst scratchPlaneCartesian4 = new Cartesian4();\nconst scratchTransformNormal = new Cartesian3();\n/**\n * Transforms the plane by the given transformation matrix.\n *\n * @param {Plane} plane The plane.\n * @param {Matrix4} transform The transformation matrix.\n * @param {Plane} [result] The object into which to store the result.\n * @returns {Plane} The plane transformed by the given transformation matrix.\n */\nPlane.transform = function (plane, transform, result) {\n const normal = plane.normal;\n const distance = plane.distance;\n const inverseTranspose = Matrix4.inverseTranspose(\n transform,\n scratchInverseTranspose\n );\n let planeAsCartesian4 = Cartesian4.fromElements(\n normal.x,\n normal.y,\n normal.z,\n distance,\n scratchPlaneCartesian4\n );\n planeAsCartesian4 = Matrix4.multiplyByVector(\n inverseTranspose,\n planeAsCartesian4,\n planeAsCartesian4\n );\n\n // Convert the transformed plane to Hessian Normal Form\n const transformedNormal = Cartesian3.fromCartesian4(\n planeAsCartesian4,\n scratchTransformNormal\n );\n\n planeAsCartesian4 = Cartesian4.divideByScalar(\n planeAsCartesian4,\n Cartesian3.magnitude(transformedNormal),\n planeAsCartesian4\n );\n\n return Plane.fromCartesian4(planeAsCartesian4, result);\n};\n\n/**\n * Duplicates a Plane instance.\n *\n * @param {Plane} plane The plane to duplicate.\n * @param {Plane} [result] The object onto which to store the result.\n * @returns {Plane} The modified result parameter or a new Plane instance if one was not provided.\n */\nPlane.clone = function (plane, result) {\n if (!defined(result)) {\n return new Plane(plane.normal, plane.distance);\n }\n\n Cartesian3.clone(plane.normal, result.normal);\n result.distance = plane.distance;\n\n return result;\n};\n\n/**\n * Compares the provided Planes by normal and distance and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Plane} left The first plane.\n * @param {Plane} right The second plane.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPlane.equals = function (left, right) {\n return (\n left.distance === right.distance &&\n Cartesian3.equals(left.normal, right.normal)\n );\n};\n\n/**\n * A constant initialized to the XY plane passing through the origin, with normal in positive Z.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Z, 0.0));\n\n/**\n * A constant initialized to the YZ plane passing through the origin, with normal in positive X.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_X, 0.0));\n\n/**\n * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.\n *\n * @type {Plane}\n * @constant\n */\nPlane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Y, 0.0));\nexport default Plane;\n", "import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport Ray from \"./Ray.js\";\nimport Transforms from \"./Transforms.js\";\n\nconst scratchCart4 = new Cartesian4();\n/**\n * A plane tangent to the provided ellipsoid at the provided origin.\n * If origin is not on the surface of the ellipsoid, it's surface projection will be used.\n * If origin is at the center of the ellipsoid, an exception will be thrown.\n * @alias EllipsoidTangentPlane\n * @constructor\n *\n * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n *\n * @exception {DeveloperError} origin must not be at the center of the ellipsoid.\n */\nfunction EllipsoidTangentPlane(origin, ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n origin = ellipsoid.scaleToGeodeticSurface(origin);\n\n const eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);\n this._ellipsoid = ellipsoid;\n this._origin = origin;\n this._xAxis = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 0, scratchCart4)\n );\n this._yAxis = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 1, scratchCart4)\n );\n\n const normal = Cartesian3.fromCartesian4(\n Matrix4.getColumn(eastNorthUp, 2, scratchCart4)\n );\n this._plane = Plane.fromPointNormal(origin, normal);\n}\n\nObject.defineProperties(EllipsoidTangentPlane.prototype, {\n /**\n * Gets the ellipsoid.\n * @memberof EllipsoidTangentPlane.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the origin.\n * @memberof EllipsoidTangentPlane.prototype\n * @type {Cartesian3}\n */\n origin: {\n get: function () {\n return this._origin;\n },\n },\n\n /**\n * Gets the plane which is tangent to the ellipsoid.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Plane}\n */\n plane: {\n get: function () {\n return this._plane;\n },\n },\n\n /**\n * Gets the local X-axis (east) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n xAxis: {\n get: function () {\n return this._xAxis;\n },\n },\n\n /**\n * Gets the local Y-axis (north) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n yAxis: {\n get: function () {\n return this._yAxis;\n },\n },\n\n /**\n * Gets the local Z-axis (up) of the tangent plane.\n * @memberof EllipsoidTangentPlane.prototype\n * @readonly\n * @type {Cartesian3}\n */\n zAxis: {\n get: function () {\n return this._plane.normal;\n },\n },\n});\n\nconst tmp = new AxisAlignedBoundingBox();\n/**\n * Creates a new instance from the provided ellipsoid and the center\n * point of the provided Cartesians.\n *\n * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\n * @returns {EllipsoidTangentPlane} The new instance of EllipsoidTangentPlane.\n */\nEllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {\n const box = AxisAlignedBoundingBox.fromPoints(cartesians, tmp);\n return new EllipsoidTangentPlane(box.center, ellipsoid);\n};\n\nconst scratchProjectPointOntoPlaneRay = new Ray();\nconst scratchProjectPointOntoPlaneCartesian3 = new Cartesian3();\n\n/**\n * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.\n *\n * @param {Cartesian3} cartesian The point to project.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point\n */\nEllipsoidTangentPlane.prototype.projectPointOntoPlane = function (\n cartesian,\n result\n) {\n const ray = scratchProjectPointOntoPlaneRay;\n ray.origin = cartesian;\n Cartesian3.normalize(cartesian, ray.direction);\n\n let intersectionPoint = IntersectionTests.rayPlane(\n ray,\n this._plane,\n scratchProjectPointOntoPlaneCartesian3\n );\n if (!defined(intersectionPoint)) {\n Cartesian3.negate(ray.direction, ray.direction);\n intersectionPoint = IntersectionTests.rayPlane(\n ray,\n this._plane,\n scratchProjectPointOntoPlaneCartesian3\n );\n }\n\n if (defined(intersectionPoint)) {\n const v = Cartesian3.subtract(\n intersectionPoint,\n this._origin,\n intersectionPoint\n );\n const x = Cartesian3.dot(this._xAxis, v);\n const y = Cartesian3.dot(this._yAxis, v);\n\n if (!defined(result)) {\n return new Cartesian2(x, y);\n }\n result.x = x;\n result.y = y;\n return result;\n }\n return undefined;\n};\n\n/**\n * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.\n * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.\n *\n * @see EllipsoidTangentPlane.projectPointOntoPlane\n *\n * @param {Cartesian3[]} cartesians The array of points to project.\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointsOntoPlane = function (\n cartesians,\n result\n) {\n if (!defined(result)) {\n result = [];\n }\n\n let count = 0;\n const length = cartesians.length;\n for (let i = 0; i < length; i++) {\n const p = this.projectPointOntoPlane(cartesians[i], result[count]);\n if (defined(p)) {\n result[count] = p;\n count++;\n }\n }\n result.length = count;\n return result;\n};\n\n/**\n * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.\n *\n * @param {Cartesian3} cartesian The point to project.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function (\n cartesian,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const ray = scratchProjectPointOntoPlaneRay;\n ray.origin = cartesian;\n Cartesian3.clone(this._plane.normal, ray.direction);\n\n let intersectionPoint = IntersectionTests.rayPlane(\n ray,\n this._plane,\n scratchProjectPointOntoPlaneCartesian3\n );\n if (!defined(intersectionPoint)) {\n Cartesian3.negate(ray.direction, ray.direction);\n intersectionPoint = IntersectionTests.rayPlane(\n ray,\n this._plane,\n scratchProjectPointOntoPlaneCartesian3\n );\n }\n\n const v = Cartesian3.subtract(\n intersectionPoint,\n this._origin,\n intersectionPoint\n );\n const x = Cartesian3.dot(this._xAxis, v);\n const y = Cartesian3.dot(this._yAxis, v);\n\n result.x = x;\n result.y = y;\n return result;\n};\n\n/**\n * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.\n *\n * @see EllipsoidTangentPlane.projectPointToNearestOnPlane\n *\n * @param {Cartesian3[]} cartesians The array of points to project.\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>.\n */\nEllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function (\n cartesians,\n result\n) {\n if (!defined(result)) {\n result = [];\n }\n\n const length = cartesians.length;\n result.length = length;\n for (let i = 0; i < length; i++) {\n result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);\n }\n return result;\n};\n\nconst projectPointsOntoEllipsoidScratch = new Cartesian3();\n/**\n * Computes the projection of the provided 2D position onto the 3D ellipsoid.\n *\n * @param {Cartesian2} cartesian The points to project.\n * @param {Cartesian3} [result] The Cartesian3 instance to store result.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function (\n cartesian,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const ellipsoid = this._ellipsoid;\n const origin = this._origin;\n const xAxis = this._xAxis;\n const yAxis = this._yAxis;\n const tmp = projectPointsOntoEllipsoidScratch;\n\n Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);\n result = Cartesian3.add(origin, tmp, result);\n Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);\n Cartesian3.add(result, tmp, result);\n ellipsoid.scaleToGeocentricSurface(result, result);\n\n return result;\n};\n\n/**\n * Computes the projection of the provided 2D positions onto the 3D ellipsoid.\n *\n * @param {Cartesian2[]} cartesians The array of points to project.\n * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.\n * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.\n */\nEllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function (\n cartesians,\n result\n) {\n const length = cartesians.length;\n if (!defined(result)) {\n result = new Array(length);\n } else {\n result.length = length;\n }\n\n for (let i = 0; i < length; ++i) {\n result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);\n }\n\n return result;\n};\nexport default EllipsoidTangentPlane;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Intersect from \"./Intersect.js\";\nimport Interval from \"./Interval.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Creates an instance of an OrientedBoundingBox.\n * An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.\n * @alias OrientedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.\n * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.\n * Equivalently, the transformation matrix, to rotate and scale a 0x0x0\n * cube centered at the origin.\n *\n *\n * @example\n * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.\n * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);\n * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());\n *\n * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);\n *\n * @see BoundingSphere\n * @see BoundingRectangle\n */\nfunction OrientedBoundingBox(center, halfAxes) {\n /**\n * The center of the box.\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\n /**\n * The transformation matrix, to rotate the box to the right position.\n * @type {Matrix3}\n * @default {@link Matrix3.ZERO}\n */\n this.halfAxes = Matrix3.clone(defaultValue(halfAxes, Matrix3.ZERO));\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nOrientedBoundingBox.packedLength =\n Cartesian3.packedLength + Matrix3.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {OrientedBoundingBox} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nOrientedBoundingBox.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value.center, array, startingIndex);\n Matrix3.pack(value.halfAxes, array, startingIndex + Cartesian3.packedLength);\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {OrientedBoundingBox} [result] The object into which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n */\nOrientedBoundingBox.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new OrientedBoundingBox();\n }\n\n Cartesian3.unpack(array, startingIndex, result.center);\n Matrix3.unpack(\n array,\n startingIndex + Cartesian3.packedLength,\n result.halfAxes\n );\n return result;\n};\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\nconst scratchCartesian6 = new Cartesian3();\nconst scratchCovarianceResult = new Matrix3();\nconst scratchEigenResult = {\n unitary: new Matrix3(),\n diagonal: new Matrix3(),\n};\n\n/**\n * Computes an instance of an OrientedBoundingBox of the given positions.\n * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).\n * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf\n *\n * @param {Cartesian3[]} [positions] List of {@link Cartesian3} points that the bounding box will enclose.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n *\n * @example\n * // Compute an object oriented bounding box enclosing two points.\n * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\n */\nOrientedBoundingBox.fromPoints = function (positions, result) {\n if (!defined(result)) {\n result = new OrientedBoundingBox();\n }\n\n if (!defined(positions) || positions.length === 0) {\n result.halfAxes = Matrix3.ZERO;\n result.center = Cartesian3.ZERO;\n return result;\n }\n\n let i;\n const length = positions.length;\n\n const meanPoint = Cartesian3.clone(positions[0], scratchCartesian1);\n for (i = 1; i < length; i++) {\n Cartesian3.add(meanPoint, positions[i], meanPoint);\n }\n const invLength = 1.0 / length;\n Cartesian3.multiplyByScalar(meanPoint, invLength, meanPoint);\n\n let exx = 0.0;\n let exy = 0.0;\n let exz = 0.0;\n let eyy = 0.0;\n let eyz = 0.0;\n let ezz = 0.0;\n let p;\n\n for (i = 0; i < length; i++) {\n p = Cartesian3.subtract(positions[i], meanPoint, scratchCartesian2);\n exx += p.x * p.x;\n exy += p.x * p.y;\n exz += p.x * p.z;\n eyy += p.y * p.y;\n eyz += p.y * p.z;\n ezz += p.z * p.z;\n }\n\n exx *= invLength;\n exy *= invLength;\n exz *= invLength;\n eyy *= invLength;\n eyz *= invLength;\n ezz *= invLength;\n\n const covarianceMatrix = scratchCovarianceResult;\n covarianceMatrix[0] = exx;\n covarianceMatrix[1] = exy;\n covarianceMatrix[2] = exz;\n covarianceMatrix[3] = exy;\n covarianceMatrix[4] = eyy;\n covarianceMatrix[5] = eyz;\n covarianceMatrix[6] = exz;\n covarianceMatrix[7] = eyz;\n covarianceMatrix[8] = ezz;\n\n const eigenDecomposition = Matrix3.computeEigenDecomposition(\n covarianceMatrix,\n scratchEigenResult\n );\n const rotation = Matrix3.clone(eigenDecomposition.unitary, result.halfAxes);\n\n let v1 = Matrix3.getColumn(rotation, 0, scratchCartesian4);\n let v2 = Matrix3.getColumn(rotation, 1, scratchCartesian5);\n let v3 = Matrix3.getColumn(rotation, 2, scratchCartesian6);\n\n let u1 = -Number.MAX_VALUE;\n let u2 = -Number.MAX_VALUE;\n let u3 = -Number.MAX_VALUE;\n let l1 = Number.MAX_VALUE;\n let l2 = Number.MAX_VALUE;\n let l3 = Number.MAX_VALUE;\n\n for (i = 0; i < length; i++) {\n p = positions[i];\n u1 = Math.max(Cartesian3.dot(v1, p), u1);\n u2 = Math.max(Cartesian3.dot(v2, p), u2);\n u3 = Math.max(Cartesian3.dot(v3, p), u3);\n\n l1 = Math.min(Cartesian3.dot(v1, p), l1);\n l2 = Math.min(Cartesian3.dot(v2, p), l2);\n l3 = Math.min(Cartesian3.dot(v3, p), l3);\n }\n\n v1 = Cartesian3.multiplyByScalar(v1, 0.5 * (l1 + u1), v1);\n v2 = Cartesian3.multiplyByScalar(v2, 0.5 * (l2 + u2), v2);\n v3 = Cartesian3.multiplyByScalar(v3, 0.5 * (l3 + u3), v3);\n\n const center = Cartesian3.add(v1, v2, result.center);\n Cartesian3.add(center, v3, center);\n\n const scale = scratchCartesian3;\n scale.x = u1 - l1;\n scale.y = u2 - l2;\n scale.z = u3 - l3;\n Cartesian3.multiplyByScalar(scale, 0.5, scale);\n Matrix3.multiplyByScale(result.halfAxes, scale, result.halfAxes);\n\n return result;\n};\n\nconst scratchOffset = new Cartesian3();\nconst scratchScale = new Cartesian3();\nfunction fromPlaneExtents(\n planeOrigin,\n planeXAxis,\n planeYAxis,\n planeZAxis,\n minimumX,\n maximumX,\n minimumY,\n maximumY,\n minimumZ,\n maximumZ,\n result\n) {\n if (!defined(result)) {\n result = new OrientedBoundingBox();\n }\n\n const halfAxes = result.halfAxes;\n Matrix3.setColumn(halfAxes, 0, planeXAxis, halfAxes);\n Matrix3.setColumn(halfAxes, 1, planeYAxis, halfAxes);\n Matrix3.setColumn(halfAxes, 2, planeZAxis, halfAxes);\n\n let centerOffset = scratchOffset;\n centerOffset.x = (minimumX + maximumX) / 2.0;\n centerOffset.y = (minimumY + maximumY) / 2.0;\n centerOffset.z = (minimumZ + maximumZ) / 2.0;\n\n const scale = scratchScale;\n scale.x = (maximumX - minimumX) / 2.0;\n scale.y = (maximumY - minimumY) / 2.0;\n scale.z = (maximumZ - minimumZ) / 2.0;\n\n const center = result.center;\n centerOffset = Matrix3.multiplyByVector(halfAxes, centerOffset, centerOffset);\n Cartesian3.add(planeOrigin, centerOffset, center);\n Matrix3.multiplyByScale(halfAxes, scale, halfAxes);\n\n return result;\n}\n\nconst scratchRectangleCenterCartographic = new Cartographic();\nconst scratchRectangleCenter = new Cartesian3();\nconst scratchPerimeterCartographicNC = new Cartographic();\nconst scratchPerimeterCartographicNW = new Cartographic();\nconst scratchPerimeterCartographicCW = new Cartographic();\nconst scratchPerimeterCartographicSW = new Cartographic();\nconst scratchPerimeterCartographicSC = new Cartographic();\nconst scratchPerimeterCartesianNC = new Cartesian3();\nconst scratchPerimeterCartesianNW = new Cartesian3();\nconst scratchPerimeterCartesianCW = new Cartesian3();\nconst scratchPerimeterCartesianSW = new Cartesian3();\nconst scratchPerimeterCartesianSC = new Cartesian3();\nconst scratchPerimeterProjectedNC = new Cartesian2();\nconst scratchPerimeterProjectedNW = new Cartesian2();\nconst scratchPerimeterProjectedCW = new Cartesian2();\nconst scratchPerimeterProjectedSW = new Cartesian2();\nconst scratchPerimeterProjectedSC = new Cartesian2();\n\nconst scratchPlaneOrigin = new Cartesian3();\nconst scratchPlaneNormal = new Cartesian3();\nconst scratchPlaneXAxis = new Cartesian3();\nconst scratchHorizonCartesian = new Cartesian3();\nconst scratchHorizonProjected = new Cartesian2();\nconst scratchMaxY = new Cartesian3();\nconst scratchMinY = new Cartesian3();\nconst scratchZ = new Cartesian3();\nconst scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);\n\n/**\n * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.\n * There are no guarantees about the orientation of the bounding box.\n *\n * @param {Rectangle} rectangle The cartographic rectangle on the surface of the ellipsoid.\n * @param {Number} [minimumHeight=0.0] The minimum height (elevation) within the tile.\n * @param {Number} [maximumHeight=0.0] The maximum height (elevation) within the tile.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle is defined.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\n *\n * @exception {DeveloperError} rectangle.width must be between 0 and pi.\n * @exception {DeveloperError} rectangle.height must be between 0 and pi.\n * @exception {DeveloperError} ellipsoid must be an ellipsoid of revolution (<code>radii.x == radii.y</code>)\n */\nOrientedBoundingBox.fromRectangle = function (\n rectangle,\n minimumHeight,\n maximumHeight,\n ellipsoid,\n result\n) {\n minimumHeight = defaultValue(minimumHeight, 0.0);\n maximumHeight = defaultValue(maximumHeight, 0.0);\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n let minX, maxX, minY, maxY, minZ, maxZ, plane;\n\n if (rectangle.width <= CesiumMath.PI) {\n // The bounding box will be aligned with the tangent plane at the center of the rectangle.\n const tangentPointCartographic = Rectangle.center(\n rectangle,\n scratchRectangleCenterCartographic\n );\n const tangentPoint = ellipsoid.cartographicToCartesian(\n tangentPointCartographic,\n scratchRectangleCenter\n );\n const tangentPlane = new EllipsoidTangentPlane(tangentPoint, ellipsoid);\n plane = tangentPlane.plane;\n\n // If the rectangle spans the equator, CW is instead aligned with the equator (because it sticks out the farthest at the equator).\n const lonCenter = tangentPointCartographic.longitude;\n const latCenter =\n rectangle.south < 0.0 && rectangle.north > 0.0\n ? 0.0\n : tangentPointCartographic.latitude;\n\n // Compute XY extents using the rectangle at maximum height\n const perimeterCartographicNC = Cartographic.fromRadians(\n lonCenter,\n rectangle.north,\n maximumHeight,\n scratchPerimeterCartographicNC\n );\n const perimeterCartographicNW = Cartographic.fromRadians(\n rectangle.west,\n rectangle.north,\n maximumHeight,\n scratchPerimeterCartographicNW\n );\n const perimeterCartographicCW = Cartographic.fromRadians(\n rectangle.west,\n latCenter,\n maximumHeight,\n scratchPerimeterCartographicCW\n );\n const perimeterCartographicSW = Cartographic.fromRadians(\n rectangle.west,\n rectangle.south,\n maximumHeight,\n scratchPerimeterCartographicSW\n );\n const perimeterCartographicSC = Cartographic.fromRadians(\n lonCenter,\n rectangle.south,\n maximumHeight,\n scratchPerimeterCartographicSC\n );\n\n const perimeterCartesianNC = ellipsoid.cartographicToCartesian(\n perimeterCartographicNC,\n scratchPerimeterCartesianNC\n );\n let perimeterCartesianNW = ellipsoid.cartographicToCartesian(\n perimeterCartographicNW,\n scratchPerimeterCartesianNW\n );\n const perimeterCartesianCW = ellipsoid.cartographicToCartesian(\n perimeterCartographicCW,\n scratchPerimeterCartesianCW\n );\n let perimeterCartesianSW = ellipsoid.cartographicToCartesian(\n perimeterCartographicSW,\n scratchPerimeterCartesianSW\n );\n const perimeterCartesianSC = ellipsoid.cartographicToCartesian(\n perimeterCartographicSC,\n scratchPerimeterCartesianSC\n );\n\n const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane(\n perimeterCartesianNC,\n scratchPerimeterProjectedNC\n );\n const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane(\n perimeterCartesianNW,\n scratchPerimeterProjectedNW\n );\n const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane(\n perimeterCartesianCW,\n scratchPerimeterProjectedCW\n );\n const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane(\n perimeterCartesianSW,\n scratchPerimeterProjectedSW\n );\n const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane(\n perimeterCartesianSC,\n scratchPerimeterProjectedSC\n );\n\n minX = Math.min(\n perimeterProjectedNW.x,\n perimeterProjectedCW.x,\n perimeterProjectedSW.x\n );\n maxX = -minX; // symmetrical\n\n maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);\n minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);\n\n // Compute minimum Z using the rectangle at minimum height, since it will be deeper than the maximum height\n perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight;\n perimeterCartesianNW = ellipsoid.cartographicToCartesian(\n perimeterCartographicNW,\n scratchPerimeterCartesianNW\n );\n perimeterCartesianSW = ellipsoid.cartographicToCartesian(\n perimeterCartographicSW,\n scratchPerimeterCartesianSW\n );\n\n minZ = Math.min(\n Plane.getPointDistance(plane, perimeterCartesianNW),\n Plane.getPointDistance(plane, perimeterCartesianSW)\n );\n maxZ = maximumHeight; // Since the tangent plane touches the surface at height = 0, this is okay\n\n return fromPlaneExtents(\n tangentPlane.origin,\n tangentPlane.xAxis,\n tangentPlane.yAxis,\n tangentPlane.zAxis,\n minX,\n maxX,\n minY,\n maxY,\n minZ,\n maxZ,\n result\n );\n }\n\n // Handle the case where rectangle width is greater than PI (wraps around more than half the ellipsoid).\n const fullyAboveEquator = rectangle.south > 0.0;\n const fullyBelowEquator = rectangle.north < 0.0;\n const latitudeNearestToEquator = fullyAboveEquator\n ? rectangle.south\n : fullyBelowEquator\n ? rectangle.north\n : 0.0;\n const centerLongitude = Rectangle.center(\n rectangle,\n scratchRectangleCenterCartographic\n ).longitude;\n\n // Plane is located at the rectangle's center longitude and the rectangle's latitude that is closest to the equator. It rotates around the Z axis.\n // This results in a better fit than the obb approach for smaller rectangles, which orients with the rectangle's center normal.\n const planeOrigin = Cartesian3.fromRadians(\n centerLongitude,\n latitudeNearestToEquator,\n maximumHeight,\n ellipsoid,\n scratchPlaneOrigin\n );\n planeOrigin.z = 0.0; // center the plane on the equator to simpify plane normal calculation\n const isPole =\n Math.abs(planeOrigin.x) < CesiumMath.EPSILON10 &&\n Math.abs(planeOrigin.y) < CesiumMath.EPSILON10;\n const planeNormal = !isPole\n ? Cartesian3.normalize(planeOrigin, scratchPlaneNormal)\n : Cartesian3.UNIT_X;\n const planeYAxis = Cartesian3.UNIT_Z;\n const planeXAxis = Cartesian3.cross(\n planeNormal,\n planeYAxis,\n scratchPlaneXAxis\n );\n plane = Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane);\n\n // Get the horizon point relative to the center. This will be the farthest extent in the plane's X dimension.\n const horizonCartesian = Cartesian3.fromRadians(\n centerLongitude + CesiumMath.PI_OVER_TWO,\n latitudeNearestToEquator,\n maximumHeight,\n ellipsoid,\n scratchHorizonCartesian\n );\n maxX = Cartesian3.dot(\n Plane.projectPointOntoPlane(\n plane,\n horizonCartesian,\n scratchHorizonProjected\n ),\n planeXAxis\n );\n minX = -maxX; // symmetrical\n\n // Get the min and max Y, using the height that will give the largest extent\n maxY = Cartesian3.fromRadians(\n 0.0,\n rectangle.north,\n fullyBelowEquator ? minimumHeight : maximumHeight,\n ellipsoid,\n scratchMaxY\n ).z;\n minY = Cartesian3.fromRadians(\n 0.0,\n rectangle.south,\n fullyAboveEquator ? minimumHeight : maximumHeight,\n ellipsoid,\n scratchMinY\n ).z;\n\n const farZ = Cartesian3.fromRadians(\n rectangle.east,\n latitudeNearestToEquator,\n maximumHeight,\n ellipsoid,\n scratchZ\n );\n minZ = Plane.getPointDistance(plane, farZ);\n maxZ = 0.0; // plane origin starts at maxZ already\n\n // min and max are local to the plane axes\n return fromPlaneExtents(\n planeOrigin,\n planeXAxis,\n planeYAxis,\n planeNormal,\n minX,\n maxX,\n minY,\n maxY,\n minZ,\n maxZ,\n result\n );\n};\n\n/**\n * Computes an OrientedBoundingBox that bounds an affine transformation.\n *\n * @param {Matrix4} transformation The affine transformation.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\n */\nOrientedBoundingBox.fromTransformation = function (transformation, result) {\n if (!defined(result)) {\n result = new OrientedBoundingBox();\n }\n\n result.center = Matrix4.getTranslation(transformation, result.center);\n result.halfAxes = Matrix4.getMatrix3(transformation, result.halfAxes);\n result.halfAxes = Matrix3.multiplyByScalar(\n result.halfAxes,\n 0.5,\n result.halfAxes\n );\n return result;\n};\n\n/**\n * Duplicates a OrientedBoundingBox instance.\n *\n * @param {OrientedBoundingBox} box The bounding box to duplicate.\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\n */\nOrientedBoundingBox.clone = function (box, result) {\n if (!defined(box)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new OrientedBoundingBox(box.center, box.halfAxes);\n }\n\n Cartesian3.clone(box.center, result.center);\n Matrix3.clone(box.halfAxes, result.halfAxes);\n\n return result;\n};\n\n/**\n * Determines which side of a plane the oriented bounding box is located.\n *\n * @param {OrientedBoundingBox} box The oriented bounding box to test.\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nOrientedBoundingBox.intersectPlane = function (box, plane) {\n const center = box.center;\n const normal = plane.normal;\n const halfAxes = box.halfAxes;\n const normalX = normal.x,\n normalY = normal.y,\n normalZ = normal.z;\n // plane is used as if it is its normal; the first three components are assumed to be normalized\n const radEffective =\n Math.abs(\n normalX * halfAxes[Matrix3.COLUMN0ROW0] +\n normalY * halfAxes[Matrix3.COLUMN0ROW1] +\n normalZ * halfAxes[Matrix3.COLUMN0ROW2]\n ) +\n Math.abs(\n normalX * halfAxes[Matrix3.COLUMN1ROW0] +\n normalY * halfAxes[Matrix3.COLUMN1ROW1] +\n normalZ * halfAxes[Matrix3.COLUMN1ROW2]\n ) +\n Math.abs(\n normalX * halfAxes[Matrix3.COLUMN2ROW0] +\n normalY * halfAxes[Matrix3.COLUMN2ROW1] +\n normalZ * halfAxes[Matrix3.COLUMN2ROW2]\n );\n const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\n\n if (distanceToPlane <= -radEffective) {\n // The entire box is on the negative side of the plane normal\n return Intersect.OUTSIDE;\n } else if (distanceToPlane >= radEffective) {\n // The entire box is on the positive side of the plane normal\n return Intersect.INSIDE;\n }\n return Intersect.INTERSECTING;\n};\n\nconst scratchCartesianU = new Cartesian3();\nconst scratchCartesianV = new Cartesian3();\nconst scratchCartesianW = new Cartesian3();\nconst scratchValidAxis2 = new Cartesian3();\nconst scratchValidAxis3 = new Cartesian3();\nconst scratchPPrime = new Cartesian3();\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\n *\n * @param {OrientedBoundingBox} box The box.\n * @param {Cartesian3} cartesian The point\n * @returns {Number} The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.\n *\n * @example\n * // Sort bounding boxes from back to front\n * boxes.sort(function(a, b) {\n * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);\n * });\n */\nOrientedBoundingBox.distanceSquaredTo = function (box, cartesian) {\n // See Geometric Tools for Computer Graphics 10.4.2\n\n const offset = Cartesian3.subtract(cartesian, box.center, scratchOffset);\n\n const halfAxes = box.halfAxes;\n let u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\n let v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\n let w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\n\n const uHalf = Cartesian3.magnitude(u);\n const vHalf = Cartesian3.magnitude(v);\n const wHalf = Cartesian3.magnitude(w);\n\n let uValid = true;\n let vValid = true;\n let wValid = true;\n\n if (uHalf > 0) {\n Cartesian3.divideByScalar(u, uHalf, u);\n } else {\n uValid = false;\n }\n\n if (vHalf > 0) {\n Cartesian3.divideByScalar(v, vHalf, v);\n } else {\n vValid = false;\n }\n\n if (wHalf > 0) {\n Cartesian3.divideByScalar(w, wHalf, w);\n } else {\n wValid = false;\n }\n\n const numberOfDegenerateAxes = !uValid + !vValid + !wValid;\n let validAxis1;\n let validAxis2;\n let validAxis3;\n\n if (numberOfDegenerateAxes === 1) {\n let degenerateAxis = u;\n validAxis1 = v;\n validAxis2 = w;\n if (!vValid) {\n degenerateAxis = v;\n validAxis1 = u;\n } else if (!wValid) {\n degenerateAxis = w;\n validAxis2 = u;\n }\n\n validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\n\n if (degenerateAxis === u) {\n u = validAxis3;\n } else if (degenerateAxis === v) {\n v = validAxis3;\n } else if (degenerateAxis === w) {\n w = validAxis3;\n }\n } else if (numberOfDegenerateAxes === 2) {\n validAxis1 = u;\n if (vValid) {\n validAxis1 = v;\n } else if (wValid) {\n validAxis1 = w;\n }\n\n let crossVector = Cartesian3.UNIT_Y;\n if (crossVector.equalsEpsilon(validAxis1, CesiumMath.EPSILON3)) {\n crossVector = Cartesian3.UNIT_X;\n }\n\n validAxis2 = Cartesian3.cross(validAxis1, crossVector, scratchValidAxis2);\n Cartesian3.normalize(validAxis2, validAxis2);\n validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\n Cartesian3.normalize(validAxis3, validAxis3);\n\n if (validAxis1 === u) {\n v = validAxis2;\n w = validAxis3;\n } else if (validAxis1 === v) {\n w = validAxis2;\n u = validAxis3;\n } else if (validAxis1 === w) {\n u = validAxis2;\n v = validAxis3;\n }\n } else if (numberOfDegenerateAxes === 3) {\n u = Cartesian3.UNIT_X;\n v = Cartesian3.UNIT_Y;\n w = Cartesian3.UNIT_Z;\n }\n\n const pPrime = scratchPPrime;\n pPrime.x = Cartesian3.dot(offset, u);\n pPrime.y = Cartesian3.dot(offset, v);\n pPrime.z = Cartesian3.dot(offset, w);\n\n let distanceSquared = 0.0;\n let d;\n\n if (pPrime.x < -uHalf) {\n d = pPrime.x + uHalf;\n distanceSquared += d * d;\n } else if (pPrime.x > uHalf) {\n d = pPrime.x - uHalf;\n distanceSquared += d * d;\n }\n\n if (pPrime.y < -vHalf) {\n d = pPrime.y + vHalf;\n distanceSquared += d * d;\n } else if (pPrime.y > vHalf) {\n d = pPrime.y - vHalf;\n distanceSquared += d * d;\n }\n\n if (pPrime.z < -wHalf) {\n d = pPrime.z + wHalf;\n distanceSquared += d * d;\n } else if (pPrime.z > wHalf) {\n d = pPrime.z - wHalf;\n distanceSquared += d * d;\n }\n\n return distanceSquared;\n};\n\nconst scratchCorner = new Cartesian3();\nconst scratchToCenter = new Cartesian3();\n\n/**\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding box.\n *\n * @param {OrientedBoundingBox} box The bounding box to calculate the distance to.\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\n */\nOrientedBoundingBox.computePlaneDistances = function (\n box,\n position,\n direction,\n result\n) {\n if (!defined(result)) {\n result = new Interval();\n }\n\n let minDist = Number.POSITIVE_INFINITY;\n let maxDist = Number.NEGATIVE_INFINITY;\n\n const center = box.center;\n const halfAxes = box.halfAxes;\n\n const u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\n const v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\n const w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\n\n // project first corner\n const corner = Cartesian3.add(u, v, scratchCorner);\n Cartesian3.add(corner, w, corner);\n Cartesian3.add(corner, center, corner);\n\n const toCenter = Cartesian3.subtract(corner, position, scratchToCenter);\n let mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project second corner\n Cartesian3.add(center, u, corner);\n Cartesian3.add(corner, v, corner);\n Cartesian3.subtract(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project third corner\n Cartesian3.add(center, u, corner);\n Cartesian3.subtract(corner, v, corner);\n Cartesian3.add(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project fourth corner\n Cartesian3.add(center, u, corner);\n Cartesian3.subtract(corner, v, corner);\n Cartesian3.subtract(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project fifth corner\n Cartesian3.subtract(center, u, corner);\n Cartesian3.add(corner, v, corner);\n Cartesian3.add(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project sixth corner\n Cartesian3.subtract(center, u, corner);\n Cartesian3.add(corner, v, corner);\n Cartesian3.subtract(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project seventh corner\n Cartesian3.subtract(center, u, corner);\n Cartesian3.subtract(corner, v, corner);\n Cartesian3.add(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n // project eighth corner\n Cartesian3.subtract(center, u, corner);\n Cartesian3.subtract(corner, v, corner);\n Cartesian3.subtract(corner, w, corner);\n\n Cartesian3.subtract(corner, position, toCenter);\n mag = Cartesian3.dot(direction, toCenter);\n\n minDist = Math.min(mag, minDist);\n maxDist = Math.max(mag, maxDist);\n\n result.start = minDist;\n result.stop = maxDist;\n return result;\n};\n\nconst scratchXAxis = new Cartesian3();\nconst scratchYAxis = new Cartesian3();\nconst scratchZAxis = new Cartesian3();\n\n/**\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\n *\n * @param {OrientedBoundingBox} box The oriented bounding box.\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\n */\nOrientedBoundingBox.computeCorners = function (box, result) {\n if (!defined(result)) {\n result = [\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n ];\n }\n\n const center = box.center;\n const halfAxes = box.halfAxes;\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n Cartesian3.clone(center, result[0]);\n Cartesian3.subtract(result[0], xAxis, result[0]);\n Cartesian3.subtract(result[0], yAxis, result[0]);\n Cartesian3.subtract(result[0], zAxis, result[0]);\n\n Cartesian3.clone(center, result[1]);\n Cartesian3.subtract(result[1], xAxis, result[1]);\n Cartesian3.subtract(result[1], yAxis, result[1]);\n Cartesian3.add(result[1], zAxis, result[1]);\n\n Cartesian3.clone(center, result[2]);\n Cartesian3.subtract(result[2], xAxis, result[2]);\n Cartesian3.add(result[2], yAxis, result[2]);\n Cartesian3.subtract(result[2], zAxis, result[2]);\n\n Cartesian3.clone(center, result[3]);\n Cartesian3.subtract(result[3], xAxis, result[3]);\n Cartesian3.add(result[3], yAxis, result[3]);\n Cartesian3.add(result[3], zAxis, result[3]);\n\n Cartesian3.clone(center, result[4]);\n Cartesian3.add(result[4], xAxis, result[4]);\n Cartesian3.subtract(result[4], yAxis, result[4]);\n Cartesian3.subtract(result[4], zAxis, result[4]);\n\n Cartesian3.clone(center, result[5]);\n Cartesian3.add(result[5], xAxis, result[5]);\n Cartesian3.subtract(result[5], yAxis, result[5]);\n Cartesian3.add(result[5], zAxis, result[5]);\n\n Cartesian3.clone(center, result[6]);\n Cartesian3.add(result[6], xAxis, result[6]);\n Cartesian3.add(result[6], yAxis, result[6]);\n Cartesian3.subtract(result[6], zAxis, result[6]);\n\n Cartesian3.clone(center, result[7]);\n Cartesian3.add(result[7], xAxis, result[7]);\n Cartesian3.add(result[7], yAxis, result[7]);\n Cartesian3.add(result[7], zAxis, result[7]);\n\n return result;\n};\n\nconst scratchRotationScale = new Matrix3();\n\n/**\n * Computes a transformation matrix from an oriented bounding box.\n *\n * @param {OrientedBoundingBox} box The oriented bounding box.\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\n */\nOrientedBoundingBox.computeTransformation = function (box, result) {\n if (!defined(result)) {\n result = new Matrix4();\n }\n\n const translation = box.center;\n const rotationScale = Matrix3.multiplyByUniformScale(\n box.halfAxes,\n 2.0,\n scratchRotationScale\n );\n return Matrix4.fromRotationTranslation(rotationScale, translation, result);\n};\n\nconst scratchBoundingSphere = new BoundingSphere();\n\n/**\n * Determines whether or not a bounding box is hidden from view by the occluder.\n *\n * @param {OrientedBoundingBox} box The bounding box surrounding the occludee object.\n * @param {Occluder} occluder The occluder.\n * @returns {Boolean} <code>true</code> if the box is not visible; otherwise <code>false</code>.\n */\nOrientedBoundingBox.isOccluded = function (box, occluder) {\n const sphere = BoundingSphere.fromOrientedBoundingBox(\n box,\n scratchBoundingSphere\n );\n\n return !occluder.isBoundingSphereVisible(sphere);\n};\n\n/**\n * Determines which side of a plane the oriented bounding box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nOrientedBoundingBox.prototype.intersectPlane = function (plane) {\n return OrientedBoundingBox.intersectPlane(this, plane);\n};\n\n/**\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\n *\n * @param {Cartesian3} cartesian The point\n * @returns {Number} The estimated distance squared from the bounding sphere to the point.\n *\n * @example\n * // Sort bounding boxes from back to front\n * boxes.sort(function(a, b) {\n * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\n * });\n */\nOrientedBoundingBox.prototype.distanceSquaredTo = function (cartesian) {\n return OrientedBoundingBox.distanceSquaredTo(this, cartesian);\n};\n\n/**\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\n * <br>\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\n * closest and farthest planes from position that intersect the bounding box.\n *\n * @param {Cartesian3} position The position to calculate the distance from.\n * @param {Cartesian3} direction The direction from position.\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\n */\nOrientedBoundingBox.prototype.computePlaneDistances = function (\n position,\n direction,\n result\n) {\n return OrientedBoundingBox.computePlaneDistances(\n this,\n position,\n direction,\n result\n );\n};\n\n/**\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\n *\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\n */\nOrientedBoundingBox.prototype.computeCorners = function (result) {\n return OrientedBoundingBox.computeCorners(this, result);\n};\n\n/**\n * Computes a transformation matrix from an oriented bounding box.\n *\n * @param {Matrix4} result The object onto which to store the result.\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\n */\nOrientedBoundingBox.prototype.computeTransformation = function (result) {\n return OrientedBoundingBox.computeTransformation(this, result);\n};\n\n/**\n * Determines whether or not a bounding box is hidden from view by the occluder.\n *\n * @param {Occluder} occluder The occluder.\n * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>.\n */\nOrientedBoundingBox.prototype.isOccluded = function (occluder) {\n return OrientedBoundingBox.isOccluded(this, occluder);\n};\n\n/**\n * Compares the provided OrientedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrientedBoundingBox} left The first OrientedBoundingBox.\n * @param {OrientedBoundingBox} right The second OrientedBoundingBox.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nOrientedBoundingBox.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Cartesian3.equals(left.center, right.center) &&\n Matrix3.equals(left.halfAxes, right.halfAxes))\n );\n};\n\n/**\n * Duplicates this OrientedBoundingBox instance.\n *\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\n */\nOrientedBoundingBox.prototype.clone = function (result) {\n return OrientedBoundingBox.clone(this, result);\n};\n\n/**\n * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrientedBoundingBox} [right] The right hand side OrientedBoundingBox.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrientedBoundingBox.prototype.equals = function (right) {\n return OrientedBoundingBox.equals(this, right);\n};\nexport default OrientedBoundingBox;\n", "import Cartesian3 from \"./Cartesian3.js\";\n\n/**\n * @private\n */\nconst TerrainExaggeration = {};\n\n/**\n * Scales a height relative to an offset.\n *\n * @param {Number} height The height.\n * @param {Number} scale A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.\n * @param {Number} relativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.\n */\nTerrainExaggeration.getHeight = function (height, scale, relativeHeight) {\n return (height - relativeHeight) * scale + relativeHeight;\n};\n\nconst scratchCartographic = new Cartesian3();\n\n/**\n * Scales a position by exaggeration.\n */\nTerrainExaggeration.getPosition = function (\n position,\n ellipsoid,\n terrainExaggeration,\n terrainExaggerationRelativeHeight,\n result\n) {\n const cartographic = ellipsoid.cartesianToCartographic(\n position,\n scratchCartographic\n );\n const newHeight = TerrainExaggeration.getHeight(\n cartographic.height,\n terrainExaggeration,\n terrainExaggerationRelativeHeight\n );\n return Cartesian3.fromRadians(\n cartographic.longitude,\n cartographic.latitude,\n newHeight,\n ellipsoid,\n result\n );\n};\n\nexport default TerrainExaggeration;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\n\nconst Flags = {\n CULL: 1,\n OCCLUDE: 2,\n EXECUTE_IN_CLOSEST_FRUSTUM: 4,\n DEBUG_SHOW_BOUNDING_VOLUME: 8,\n CAST_SHADOWS: 16,\n RECEIVE_SHADOWS: 32,\n PICK_ONLY: 64,\n DEPTH_FOR_TRANSLUCENT_CLASSIFICATION: 128,\n};\n\n/**\n * Represents a command to the renderer for drawing.\n *\n * @private\n */\nfunction DrawCommand(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._boundingVolume = options.boundingVolume;\n this._orientedBoundingBox = options.orientedBoundingBox;\n this._modelMatrix = options.modelMatrix;\n this._primitiveType = defaultValue(\n options.primitiveType,\n PrimitiveType.TRIANGLES\n );\n this._vertexArray = options.vertexArray;\n this._count = options.count;\n this._offset = defaultValue(options.offset, 0);\n this._instanceCount = defaultValue(options.instanceCount, 0);\n this._shaderProgram = options.shaderProgram;\n this._uniformMap = options.uniformMap;\n this._renderState = options.renderState;\n this._framebuffer = options.framebuffer;\n this._pass = options.pass;\n this._owner = options.owner;\n this._debugOverlappingFrustums = 0;\n this._pickId = options.pickId;\n\n // Set initial flags.\n this._flags = 0;\n this.cull = defaultValue(options.cull, true);\n this.occlude = defaultValue(options.occlude, true);\n this.executeInClosestFrustum = defaultValue(\n options.executeInClosestFrustum,\n false\n );\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n this.castShadows = defaultValue(options.castShadows, false);\n this.receiveShadows = defaultValue(options.receiveShadows, false);\n this.pickOnly = defaultValue(options.pickOnly, false);\n this.depthForTranslucentClassification = defaultValue(\n options.depthForTranslucentClassification,\n false\n );\n\n this.dirty = true;\n this.lastDirtyTime = 0;\n\n /**\n * @private\n */\n this.derivedCommands = {};\n}\n\nfunction hasFlag(command, flag) {\n return (command._flags & flag) === flag;\n}\n\nfunction setFlag(command, flag, value) {\n if (value) {\n command._flags |= flag;\n } else {\n command._flags &= ~flag;\n }\n}\n\nObject.defineProperties(DrawCommand.prototype, {\n /**\n * The bounding volume of the geometry in world space. This is used for culling and frustum selection.\n * <p>\n * For best rendering performance, use the tightest possible bounding volume. Although\n * <code>undefined</code> is allowed, always try to provide a bounding volume to\n * allow the tightest possible near and far planes to be computed for the scene, and\n * minimize the number of frustums needed.\n * </p>\n *\n * @memberof DrawCommand.prototype\n * @type {Object}\n * @default undefined\n *\n * @see DrawCommand#debugShowBoundingVolume\n */\n boundingVolume: {\n get: function () {\n return this._boundingVolume;\n },\n set: function (value) {\n if (this._boundingVolume !== value) {\n this._boundingVolume = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The oriented bounding box of the geometry in world space. If this is defined, it is used instead of\n * {@link DrawCommand#boundingVolume} for plane intersection testing.\n *\n * @memberof DrawCommand.prototype\n * @type {OrientedBoundingBox}\n * @default undefined\n *\n * @see DrawCommand#debugShowBoundingVolume\n */\n orientedBoundingBox: {\n get: function () {\n return this._orientedBoundingBox;\n },\n set: function (value) {\n if (this._orientedBoundingBox !== value) {\n this._orientedBoundingBox = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * When <code>true</code>, the renderer frustum and horizon culls the command based on its {@link DrawCommand#boundingVolume}.\n * If the command was already culled, set this to <code>false</code> for a performance improvement.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default true\n */\n cull: {\n get: function () {\n return hasFlag(this, Flags.CULL);\n },\n set: function (value) {\n if (hasFlag(this, Flags.CULL) !== value) {\n setFlag(this, Flags.CULL, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * When <code>true</code>, the horizon culls the command based on its {@link DrawCommand#boundingVolume}.\n * {@link DrawCommand#cull} must also be <code>true</code> in order for the command to be culled.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default true\n */\n occlude: {\n get: function () {\n return hasFlag(this, Flags.OCCLUDE);\n },\n set: function (value) {\n if (hasFlag(this, Flags.OCCLUDE) !== value) {\n setFlag(this, Flags.OCCLUDE, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * The transformation from the geometry in model space to world space.\n * <p>\n * When <code>undefined</code>, the geometry is assumed to be defined in world space.\n * </p>\n *\n * @memberof DrawCommand.prototype\n * @type {Matrix4}\n * @default undefined\n */\n modelMatrix: {\n get: function () {\n return this._modelMatrix;\n },\n set: function (value) {\n if (this._modelMatrix !== value) {\n this._modelMatrix = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The type of geometry in the vertex array.\n *\n * @memberof DrawCommand.prototype\n * @type {PrimitiveType}\n * @default PrimitiveType.TRIANGLES\n */\n primitiveType: {\n get: function () {\n return this._primitiveType;\n },\n set: function (value) {\n if (this._primitiveType !== value) {\n this._primitiveType = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The vertex array.\n *\n * @memberof DrawCommand.prototype\n * @type {VertexArray}\n * @default undefined\n */\n vertexArray: {\n get: function () {\n return this._vertexArray;\n },\n set: function (value) {\n if (this._vertexArray !== value) {\n this._vertexArray = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The number of vertices to draw in the vertex array.\n *\n * @memberof DrawCommand.prototype\n * @type {Number}\n * @default undefined\n */\n count: {\n get: function () {\n return this._count;\n },\n set: function (value) {\n if (this._count !== value) {\n this._count = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The offset to start drawing in the vertex array.\n *\n * @memberof DrawCommand.prototype\n * @type {Number}\n * @default 0\n */\n offset: {\n get: function () {\n return this._offset;\n },\n set: function (value) {\n if (this._offset !== value) {\n this._offset = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The number of instances to draw.\n *\n * @memberof DrawCommand.prototype\n * @type {Number}\n * @default 0\n */\n instanceCount: {\n get: function () {\n return this._instanceCount;\n },\n set: function (value) {\n if (this._instanceCount !== value) {\n this._instanceCount = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The shader program to apply.\n *\n * @memberof DrawCommand.prototype\n * @type {ShaderProgram}\n * @default undefined\n */\n shaderProgram: {\n get: function () {\n return this._shaderProgram;\n },\n set: function (value) {\n if (this._shaderProgram !== value) {\n this._shaderProgram = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * Whether this command should cast shadows when shadowing is enabled.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n */\n castShadows: {\n get: function () {\n return hasFlag(this, Flags.CAST_SHADOWS);\n },\n set: function (value) {\n if (hasFlag(this, Flags.CAST_SHADOWS) !== value) {\n setFlag(this, Flags.CAST_SHADOWS, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * Whether this command should receive shadows when shadowing is enabled.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n */\n receiveShadows: {\n get: function () {\n return hasFlag(this, Flags.RECEIVE_SHADOWS);\n },\n set: function (value) {\n if (hasFlag(this, Flags.RECEIVE_SHADOWS) !== value) {\n setFlag(this, Flags.RECEIVE_SHADOWS, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * An object with functions whose names match the uniforms in the shader program\n * and return values to set those uniforms.\n *\n * @memberof DrawCommand.prototype\n * @type {Object}\n * @default undefined\n */\n uniformMap: {\n get: function () {\n return this._uniformMap;\n },\n set: function (value) {\n if (this._uniformMap !== value) {\n this._uniformMap = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The render state.\n *\n * @memberof DrawCommand.prototype\n * @type {RenderState}\n * @default undefined\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n set: function (value) {\n if (this._renderState !== value) {\n this._renderState = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The framebuffer to draw to.\n *\n * @memberof DrawCommand.prototype\n * @type {Framebuffer}\n * @default undefined\n */\n framebuffer: {\n get: function () {\n return this._framebuffer;\n },\n set: function (value) {\n if (this._framebuffer !== value) {\n this._framebuffer = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * The pass when to render.\n *\n * @memberof DrawCommand.prototype\n * @type {Pass}\n * @default undefined\n */\n pass: {\n get: function () {\n return this._pass;\n },\n set: function (value) {\n if (this._pass !== value) {\n this._pass = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * Specifies if this command is only to be executed in the frustum closest\n * to the eye containing the bounding volume. Defaults to <code>false</code>.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n */\n executeInClosestFrustum: {\n get: function () {\n return hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM);\n },\n set: function (value) {\n if (hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM) !== value) {\n setFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * The object who created this command. This is useful for debugging command\n * execution; it allows us to see who created a command when we only have a\n * reference to the command, and can be used to selectively execute commands\n * with {@link Scene#debugCommandFilter}.\n *\n * @memberof DrawCommand.prototype\n * @type {Object}\n * @default undefined\n *\n * @see Scene#debugCommandFilter\n */\n owner: {\n get: function () {\n return this._owner;\n },\n set: function (value) {\n if (this._owner !== value) {\n this._owner = value;\n this.dirty = true;\n }\n },\n },\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the {@link DrawCommand#boundingVolume} for this command, assuming it is a sphere, when the command executes.\n * </p>\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n *\n * @see DrawCommand#boundingVolume\n */\n debugShowBoundingVolume: {\n get: function () {\n return hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME);\n },\n set: function (value) {\n if (hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME) !== value) {\n setFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME, value);\n this.dirty = true;\n }\n },\n },\n\n /**\n * Used to implement Scene.debugShowFrustums.\n * @private\n */\n debugOverlappingFrustums: {\n get: function () {\n return this._debugOverlappingFrustums;\n },\n set: function (value) {\n if (this._debugOverlappingFrustums !== value) {\n this._debugOverlappingFrustums = value;\n this.dirty = true;\n }\n },\n },\n /**\n * A GLSL string that will evaluate to a pick id. When <code>undefined</code>, the command will only draw depth\n * during the pick pass.\n *\n * @memberof DrawCommand.prototype\n * @type {String}\n * @default undefined\n */\n pickId: {\n get: function () {\n return this._pickId;\n },\n set: function (value) {\n if (this._pickId !== value) {\n this._pickId = value;\n this.dirty = true;\n }\n },\n },\n /**\n * Whether this command should be executed in the pick pass only.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n */\n pickOnly: {\n get: function () {\n return hasFlag(this, Flags.PICK_ONLY);\n },\n set: function (value) {\n if (hasFlag(this, Flags.PICK_ONLY) !== value) {\n setFlag(this, Flags.PICK_ONLY, value);\n this.dirty = true;\n }\n },\n },\n /**\n * Whether this command should be derived to draw depth for classification of translucent primitives.\n *\n * @memberof DrawCommand.prototype\n * @type {Boolean}\n * @default false\n */\n depthForTranslucentClassification: {\n get: function () {\n return hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION);\n },\n set: function (value) {\n if (hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION) !== value) {\n setFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION, value);\n this.dirty = true;\n }\n },\n },\n});\n\n/**\n * @private\n */\nDrawCommand.shallowClone = function (command, result) {\n if (!defined(command)) {\n return undefined;\n }\n if (!defined(result)) {\n result = new DrawCommand();\n }\n\n result._boundingVolume = command._boundingVolume;\n result._orientedBoundingBox = command._orientedBoundingBox;\n result._modelMatrix = command._modelMatrix;\n result._primitiveType = command._primitiveType;\n result._vertexArray = command._vertexArray;\n result._count = command._count;\n result._offset = command._offset;\n result._instanceCount = command._instanceCount;\n result._shaderProgram = command._shaderProgram;\n result._uniformMap = command._uniformMap;\n result._renderState = command._renderState;\n result._framebuffer = command._framebuffer;\n result._pass = command._pass;\n result._owner = command._owner;\n result._debugOverlappingFrustums = command._debugOverlappingFrustums;\n result._pickId = command._pickId;\n result._flags = command._flags;\n\n result.dirty = true;\n result.lastDirtyTime = 0;\n\n return result;\n};\n\n/**\n * Executes the draw command.\n *\n * @param {Context} context The renderer context in which to draw.\n * @param {PassState} [passState] The state for the current render pass.\n */\nDrawCommand.prototype.execute = function (context, passState) {\n context.draw(this, passState);\n};\nexport default DrawCommand;\n", "/**\n * The render pass for a command.\n *\n * @private\n */\nconst Pass = {\n // If you add/modify/remove Pass constants, also change the automatic GLSL constants\n // that start with 'czm_pass'\n //\n // Commands are executed in order by pass up to the translucent pass.\n // Translucent geometry needs special handling (sorting/OIT). The compute pass\n // is executed first and the overlay pass is executed last. Both are not sorted\n // by frustum.\n ENVIRONMENT: 0,\n COMPUTE: 1,\n GLOBE: 2,\n TERRAIN_CLASSIFICATION: 3,\n CESIUM_3D_TILE: 4,\n CESIUM_3D_TILE_CLASSIFICATION: 5,\n CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW: 6,\n OPAQUE: 7,\n TRANSLUCENT: 8,\n OVERLAY: 9,\n NUMBER_OF_PASSES: 10,\n};\nexport default Object.freeze(Pass);\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * Winding order defines the order of vertices for a triangle to be considered front-facing.\n *\n * @enum {Number}\n */\nconst WindingOrder = {\n /**\n * Vertices are in clockwise order.\n *\n * @type {Number}\n * @constant\n */\n CLOCKWISE: WebGLConstants.CW,\n\n /**\n * Vertices are in counter-clockwise order.\n *\n * @type {Number}\n * @constant\n */\n COUNTER_CLOCKWISE: WebGLConstants.CCW,\n};\n\n/**\n * @private\n */\nWindingOrder.validate = function (windingOrder) {\n return (\n windingOrder === WindingOrder.CLOCKWISE ||\n windingOrder === WindingOrder.COUNTER_CLOCKWISE\n );\n};\n\nexport default Object.freeze(WindingOrder);\n", "/**\n * Returns frozen renderState as well as all of the object literal properties. This function is deep object freeze\n * function ignoring properties named \"_applyFunctions\".\n *\n * @private\n *\n * @param {Object} renderState\n * @returns {Object} Returns frozen renderState.\n *\n */\nfunction freezeRenderState(renderState) {\n if (typeof renderState !== \"object\" || renderState === null) {\n return renderState;\n }\n\n let propName;\n const propNames = Object.keys(renderState);\n\n for (let i = 0; i < propNames.length; i++) {\n propName = propNames[i];\n if (\n renderState.hasOwnProperty(propName) &&\n propName !== \"_applyFunctions\"\n ) {\n renderState[propName] = freezeRenderState(renderState[propName]);\n }\n }\n return Object.freeze(renderState);\n}\nexport default freezeRenderState;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport WindingOrder from \"../Core/WindingOrder.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport freezeRenderState from \"./freezeRenderState.js\";\n\nfunction validateBlendEquation(blendEquation) {\n return (\n blendEquation === WebGLConstants.FUNC_ADD ||\n blendEquation === WebGLConstants.FUNC_SUBTRACT ||\n blendEquation === WebGLConstants.FUNC_REVERSE_SUBTRACT ||\n blendEquation === WebGLConstants.MIN ||\n blendEquation === WebGLConstants.MAX\n );\n}\n\nfunction validateBlendFunction(blendFunction) {\n return (\n blendFunction === WebGLConstants.ZERO ||\n blendFunction === WebGLConstants.ONE ||\n blendFunction === WebGLConstants.SRC_COLOR ||\n blendFunction === WebGLConstants.ONE_MINUS_SRC_COLOR ||\n blendFunction === WebGLConstants.DST_COLOR ||\n blendFunction === WebGLConstants.ONE_MINUS_DST_COLOR ||\n blendFunction === WebGLConstants.SRC_ALPHA ||\n blendFunction === WebGLConstants.ONE_MINUS_SRC_ALPHA ||\n blendFunction === WebGLConstants.DST_ALPHA ||\n blendFunction === WebGLConstants.ONE_MINUS_DST_ALPHA ||\n blendFunction === WebGLConstants.CONSTANT_COLOR ||\n blendFunction === WebGLConstants.ONE_MINUS_CONSTANT_COLOR ||\n blendFunction === WebGLConstants.CONSTANT_ALPHA ||\n blendFunction === WebGLConstants.ONE_MINUS_CONSTANT_ALPHA ||\n blendFunction === WebGLConstants.SRC_ALPHA_SATURATE\n );\n}\n\nfunction validateCullFace(cullFace) {\n return (\n cullFace === WebGLConstants.FRONT ||\n cullFace === WebGLConstants.BACK ||\n cullFace === WebGLConstants.FRONT_AND_BACK\n );\n}\n\nfunction validateDepthFunction(depthFunction) {\n return (\n depthFunction === WebGLConstants.NEVER ||\n depthFunction === WebGLConstants.LESS ||\n depthFunction === WebGLConstants.EQUAL ||\n depthFunction === WebGLConstants.LEQUAL ||\n depthFunction === WebGLConstants.GREATER ||\n depthFunction === WebGLConstants.NOTEQUAL ||\n depthFunction === WebGLConstants.GEQUAL ||\n depthFunction === WebGLConstants.ALWAYS\n );\n}\n\nfunction validateStencilFunction(stencilFunction) {\n return (\n stencilFunction === WebGLConstants.NEVER ||\n stencilFunction === WebGLConstants.LESS ||\n stencilFunction === WebGLConstants.EQUAL ||\n stencilFunction === WebGLConstants.LEQUAL ||\n stencilFunction === WebGLConstants.GREATER ||\n stencilFunction === WebGLConstants.NOTEQUAL ||\n stencilFunction === WebGLConstants.GEQUAL ||\n stencilFunction === WebGLConstants.ALWAYS\n );\n}\n\nfunction validateStencilOperation(stencilOperation) {\n return (\n stencilOperation === WebGLConstants.ZERO ||\n stencilOperation === WebGLConstants.KEEP ||\n stencilOperation === WebGLConstants.REPLACE ||\n stencilOperation === WebGLConstants.INCR ||\n stencilOperation === WebGLConstants.DECR ||\n stencilOperation === WebGLConstants.INVERT ||\n stencilOperation === WebGLConstants.INCR_WRAP ||\n stencilOperation === WebGLConstants.DECR_WRAP\n );\n}\n\n/**\n * @private\n */\nfunction RenderState(renderState) {\n const rs = defaultValue(renderState, defaultValue.EMPTY_OBJECT);\n const cull = defaultValue(rs.cull, defaultValue.EMPTY_OBJECT);\n const polygonOffset = defaultValue(\n rs.polygonOffset,\n defaultValue.EMPTY_OBJECT\n );\n const scissorTest = defaultValue(rs.scissorTest, defaultValue.EMPTY_OBJECT);\n const scissorTestRectangle = defaultValue(\n scissorTest.rectangle,\n defaultValue.EMPTY_OBJECT\n );\n const depthRange = defaultValue(rs.depthRange, defaultValue.EMPTY_OBJECT);\n const depthTest = defaultValue(rs.depthTest, defaultValue.EMPTY_OBJECT);\n const colorMask = defaultValue(rs.colorMask, defaultValue.EMPTY_OBJECT);\n const blending = defaultValue(rs.blending, defaultValue.EMPTY_OBJECT);\n const blendingColor = defaultValue(blending.color, defaultValue.EMPTY_OBJECT);\n const stencilTest = defaultValue(rs.stencilTest, defaultValue.EMPTY_OBJECT);\n const stencilTestFrontOperation = defaultValue(\n stencilTest.frontOperation,\n defaultValue.EMPTY_OBJECT\n );\n const stencilTestBackOperation = defaultValue(\n stencilTest.backOperation,\n defaultValue.EMPTY_OBJECT\n );\n const sampleCoverage = defaultValue(\n rs.sampleCoverage,\n defaultValue.EMPTY_OBJECT\n );\n const viewport = rs.viewport;\n\n this.frontFace = defaultValue(rs.frontFace, WindingOrder.COUNTER_CLOCKWISE);\n this.cull = {\n enabled: defaultValue(cull.enabled, false),\n face: defaultValue(cull.face, WebGLConstants.BACK),\n };\n this.lineWidth = defaultValue(rs.lineWidth, 1.0);\n this.polygonOffset = {\n enabled: defaultValue(polygonOffset.enabled, false),\n factor: defaultValue(polygonOffset.factor, 0),\n units: defaultValue(polygonOffset.units, 0),\n };\n this.scissorTest = {\n enabled: defaultValue(scissorTest.enabled, false),\n rectangle: BoundingRectangle.clone(scissorTestRectangle),\n };\n this.depthRange = {\n near: defaultValue(depthRange.near, 0),\n far: defaultValue(depthRange.far, 1),\n };\n this.depthTest = {\n enabled: defaultValue(depthTest.enabled, false),\n func: defaultValue(depthTest.func, WebGLConstants.LESS), // func, because function is a JavaScript keyword\n };\n this.colorMask = {\n red: defaultValue(colorMask.red, true),\n green: defaultValue(colorMask.green, true),\n blue: defaultValue(colorMask.blue, true),\n alpha: defaultValue(colorMask.alpha, true),\n };\n this.depthMask = defaultValue(rs.depthMask, true);\n this.stencilMask = defaultValue(rs.stencilMask, ~0);\n this.blending = {\n enabled: defaultValue(blending.enabled, false),\n color: new Color(\n defaultValue(blendingColor.red, 0.0),\n defaultValue(blendingColor.green, 0.0),\n defaultValue(blendingColor.blue, 0.0),\n defaultValue(blendingColor.alpha, 0.0)\n ),\n equationRgb: defaultValue(blending.equationRgb, WebGLConstants.FUNC_ADD),\n equationAlpha: defaultValue(\n blending.equationAlpha,\n WebGLConstants.FUNC_ADD\n ),\n functionSourceRgb: defaultValue(\n blending.functionSourceRgb,\n WebGLConstants.ONE\n ),\n functionSourceAlpha: defaultValue(\n blending.functionSourceAlpha,\n WebGLConstants.ONE\n ),\n functionDestinationRgb: defaultValue(\n blending.functionDestinationRgb,\n WebGLConstants.ZERO\n ),\n functionDestinationAlpha: defaultValue(\n blending.functionDestinationAlpha,\n WebGLConstants.ZERO\n ),\n };\n this.stencilTest = {\n enabled: defaultValue(stencilTest.enabled, false),\n frontFunction: defaultValue(\n stencilTest.frontFunction,\n WebGLConstants.ALWAYS\n ),\n backFunction: defaultValue(stencilTest.backFunction, WebGLConstants.ALWAYS),\n reference: defaultValue(stencilTest.reference, 0),\n mask: defaultValue(stencilTest.mask, ~0),\n frontOperation: {\n fail: defaultValue(stencilTestFrontOperation.fail, WebGLConstants.KEEP),\n zFail: defaultValue(stencilTestFrontOperation.zFail, WebGLConstants.KEEP),\n zPass: defaultValue(stencilTestFrontOperation.zPass, WebGLConstants.KEEP),\n },\n backOperation: {\n fail: defaultValue(stencilTestBackOperation.fail, WebGLConstants.KEEP),\n zFail: defaultValue(stencilTestBackOperation.zFail, WebGLConstants.KEEP),\n zPass: defaultValue(stencilTestBackOperation.zPass, WebGLConstants.KEEP),\n },\n };\n this.sampleCoverage = {\n enabled: defaultValue(sampleCoverage.enabled, false),\n value: defaultValue(sampleCoverage.value, 1.0),\n invert: defaultValue(sampleCoverage.invert, false),\n };\n this.viewport = defined(viewport)\n ? new BoundingRectangle(\n viewport.x,\n viewport.y,\n viewport.width,\n viewport.height\n )\n : undefined;\n\n this.id = 0;\n this._applyFunctions = [];\n}\n\nlet nextRenderStateId = 0;\nlet renderStateCache = {};\n\n/**\n * Validates and then finds or creates an immutable render state, which defines the pipeline\n * state for a {@link DrawCommand} or {@link ClearCommand}. All inputs states are optional. Omitted states\n * use the defaults shown in the example below.\n *\n * @param {Object} [renderState] The states defining the render state as shown in the example below.\n *\n * @exception {RuntimeError} renderState.lineWidth is out of range.\n * @exception {DeveloperError} Invalid renderState.frontFace.\n * @exception {DeveloperError} Invalid renderState.cull.face.\n * @exception {DeveloperError} scissorTest.rectangle.width and scissorTest.rectangle.height must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.depthRange.near can't be greater than renderState.depthRange.far.\n * @exception {DeveloperError} renderState.depthRange.near must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.depthRange.far must be less than or equal to zero.\n * @exception {DeveloperError} Invalid renderState.depthTest.func.\n * @exception {DeveloperError} renderState.blending.color components must be greater than or equal to zero and less than or equal to one\n * @exception {DeveloperError} Invalid renderState.blending.equationRgb.\n * @exception {DeveloperError} Invalid renderState.blending.equationAlpha.\n * @exception {DeveloperError} Invalid renderState.blending.functionSourceRgb.\n * @exception {DeveloperError} Invalid renderState.blending.functionSourceAlpha.\n * @exception {DeveloperError} Invalid renderState.blending.functionDestinationRgb.\n * @exception {DeveloperError} Invalid renderState.blending.functionDestinationAlpha.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontFunction.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backFunction.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.fail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.zFail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.frontOperation.zPass.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.fail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.zFail.\n * @exception {DeveloperError} Invalid renderState.stencilTest.backOperation.zPass.\n * @exception {DeveloperError} renderState.viewport.width must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.viewport.width must be less than or equal to the maximum viewport width.\n * @exception {DeveloperError} renderState.viewport.height must be greater than or equal to zero.\n * @exception {DeveloperError} renderState.viewport.height must be less than or equal to the maximum viewport height.\n *\n *\n * @example\n * const defaults = {\n * frontFace : WindingOrder.COUNTER_CLOCKWISE,\n * cull : {\n * enabled : false,\n * face : CullFace.BACK\n * },\n * lineWidth : 1,\n * polygonOffset : {\n * enabled : false,\n * factor : 0,\n * units : 0\n * },\n * scissorTest : {\n * enabled : false,\n * rectangle : {\n * x : 0,\n * y : 0,\n * width : 0,\n * height : 0\n * }\n * },\n * depthRange : {\n * near : 0,\n * far : 1\n * },\n * depthTest : {\n * enabled : false,\n * func : DepthFunction.LESS\n * },\n * colorMask : {\n * red : true,\n * green : true,\n * blue : true,\n * alpha : true\n * },\n * depthMask : true,\n * stencilMask : ~0,\n * blending : {\n * enabled : false,\n * color : {\n * red : 0.0,\n * green : 0.0,\n * blue : 0.0,\n * alpha : 0.0\n * },\n * equationRgb : BlendEquation.ADD,\n * equationAlpha : BlendEquation.ADD,\n * functionSourceRgb : BlendFunction.ONE,\n * functionSourceAlpha : BlendFunction.ONE,\n * functionDestinationRgb : BlendFunction.ZERO,\n * functionDestinationAlpha : BlendFunction.ZERO\n * },\n * stencilTest : {\n * enabled : false,\n * frontFunction : StencilFunction.ALWAYS,\n * backFunction : StencilFunction.ALWAYS,\n * reference : 0,\n * mask : ~0,\n * frontOperation : {\n * fail : StencilOperation.KEEP,\n * zFail : StencilOperation.KEEP,\n * zPass : StencilOperation.KEEP\n * },\n * backOperation : {\n * fail : StencilOperation.KEEP,\n * zFail : StencilOperation.KEEP,\n * zPass : StencilOperation.KEEP\n * }\n * },\n * sampleCoverage : {\n * enabled : false,\n * value : 1.0,\n * invert : false\n * }\n * };\n *\n * const rs = RenderState.fromCache(defaults);\n *\n * @see DrawCommand\n * @see ClearCommand\n *\n * @private\n */\nRenderState.fromCache = function (renderState) {\n const partialKey = JSON.stringify(renderState);\n let cachedState = renderStateCache[partialKey];\n if (defined(cachedState)) {\n ++cachedState.referenceCount;\n return cachedState.state;\n }\n\n // Cache miss. Fully define render state and try again.\n let states = new RenderState(renderState);\n const fullKey = JSON.stringify(states);\n cachedState = renderStateCache[fullKey];\n if (!defined(cachedState)) {\n states.id = nextRenderStateId++;\ncachedState = {\n referenceCount: 0,\n state: states,\n };\n\n // Cache full render state. Multiple partially defined render states may map to this.\n renderStateCache[fullKey] = cachedState;\n }\n\n ++cachedState.referenceCount;\n\n // Cache partial render state so we can skip validation on a cache hit for a partially defined render state\n renderStateCache[partialKey] = {\n referenceCount: 1,\n state: cachedState.state,\n };\n\n return cachedState.state;\n};\n\n/**\n * @private\n */\nRenderState.removeFromCache = function (renderState) {\n const states = new RenderState(renderState);\n const fullKey = JSON.stringify(states);\n const fullCachedState = renderStateCache[fullKey];\n\n // decrement partial key reference count\n const partialKey = JSON.stringify(renderState);\n const cachedState = renderStateCache[partialKey];\n if (defined(cachedState)) {\n --cachedState.referenceCount;\n\n if (cachedState.referenceCount === 0) {\n // remove partial key\n delete renderStateCache[partialKey];\n\n // decrement full key reference count\n if (defined(fullCachedState)) {\n --fullCachedState.referenceCount;\n }\n }\n }\n\n // remove full key if reference count is zero\n if (defined(fullCachedState) && fullCachedState.referenceCount === 0) {\n delete renderStateCache[fullKey];\n }\n};\n\n/**\n * This function is for testing purposes only.\n * @private\n */\nRenderState.getCache = function () {\n return renderStateCache;\n};\n\n/**\n * This function is for testing purposes only.\n * @private\n */\nRenderState.clearCache = function () {\n renderStateCache = {};\n};\n\nfunction enableOrDisable(gl, glEnum, enable) {\n if (enable) {\n gl.enable(glEnum);\n } else {\n gl.disable(glEnum);\n }\n}\n\nfunction applyFrontFace(gl, renderState) {\n gl.frontFace(renderState.frontFace);\n}\n\nfunction applyCull(gl, renderState) {\n const cull = renderState.cull;\n const enabled = cull.enabled;\n\n enableOrDisable(gl, gl.CULL_FACE, enabled);\n\n if (enabled) {\n gl.cullFace(cull.face);\n }\n}\n\nfunction applyLineWidth(gl, renderState) {\n gl.lineWidth(renderState.lineWidth);\n}\n\nfunction applyPolygonOffset(gl, renderState) {\n const polygonOffset = renderState.polygonOffset;\n const enabled = polygonOffset.enabled;\n\n enableOrDisable(gl, gl.POLYGON_OFFSET_FILL, enabled);\n\n if (enabled) {\n gl.polygonOffset(polygonOffset.factor, polygonOffset.units);\n }\n}\n\nfunction applyScissorTest(gl, renderState, passState) {\n const scissorTest = renderState.scissorTest;\n const enabled = defined(passState.scissorTest)\n ? passState.scissorTest.enabled\n : scissorTest.enabled;\n\n enableOrDisable(gl, gl.SCISSOR_TEST, enabled);\n\n if (enabled) {\n const rectangle = defined(passState.scissorTest)\n ? passState.scissorTest.rectangle\n : scissorTest.rectangle;\n gl.scissor(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n }\n}\n\nfunction applyDepthRange(gl, renderState) {\n const depthRange = renderState.depthRange;\n gl.depthRange(depthRange.near, depthRange.far);\n}\n\nfunction applyDepthTest(gl, renderState) {\n const depthTest = renderState.depthTest;\n const enabled = depthTest.enabled;\n\n enableOrDisable(gl, gl.DEPTH_TEST, enabled);\n\n if (enabled) {\n gl.depthFunc(depthTest.func);\n }\n}\n\nfunction applyColorMask(gl, renderState) {\n const colorMask = renderState.colorMask;\n gl.colorMask(colorMask.red, colorMask.green, colorMask.blue, colorMask.alpha);\n}\n\nfunction applyDepthMask(gl, renderState) {\n gl.depthMask(renderState.depthMask);\n}\n\nfunction applyStencilMask(gl, renderState) {\n gl.stencilMask(renderState.stencilMask);\n}\n\nfunction applyBlendingColor(gl, color) {\n gl.blendColor(color.red, color.green, color.blue, color.alpha);\n}\n\nfunction applyBlending(gl, renderState, passState) {\n const blending = renderState.blending;\n const enabled = defined(passState.blendingEnabled)\n ? passState.blendingEnabled\n : blending.enabled;\n\n enableOrDisable(gl, gl.BLEND, enabled);\n\n if (enabled) {\n applyBlendingColor(gl, blending.color);\n gl.blendEquationSeparate(blending.equationRgb, blending.equationAlpha);\n gl.blendFuncSeparate(\n blending.functionSourceRgb,\n blending.functionDestinationRgb,\n blending.functionSourceAlpha,\n blending.functionDestinationAlpha\n );\n }\n}\n\nfunction applyStencilTest(gl, renderState) {\n const stencilTest = renderState.stencilTest;\n const enabled = stencilTest.enabled;\n\n enableOrDisable(gl, gl.STENCIL_TEST, enabled);\n\n if (enabled) {\n const frontFunction = stencilTest.frontFunction;\n const backFunction = stencilTest.backFunction;\n const reference = stencilTest.reference;\n const mask = stencilTest.mask;\n\n // Section 6.8 of the WebGL spec requires the reference and masks to be the same for\n // front- and back-face tests. This call prevents invalid operation errors when calling\n // stencilFuncSeparate on Firefox. Perhaps they should delay validation to avoid requiring this.\n gl.stencilFunc(frontFunction, reference, mask);\n gl.stencilFuncSeparate(gl.BACK, backFunction, reference, mask);\n gl.stencilFuncSeparate(gl.FRONT, frontFunction, reference, mask);\n\n const frontOperation = stencilTest.frontOperation;\n const frontOperationFail = frontOperation.fail;\n const frontOperationZFail = frontOperation.zFail;\n const frontOperationZPass = frontOperation.zPass;\n\n gl.stencilOpSeparate(\n gl.FRONT,\n frontOperationFail,\n frontOperationZFail,\n frontOperationZPass\n );\n\n const backOperation = stencilTest.backOperation;\n const backOperationFail = backOperation.fail;\n const backOperationZFail = backOperation.zFail;\n const backOperationZPass = backOperation.zPass;\n\n gl.stencilOpSeparate(\n gl.BACK,\n backOperationFail,\n backOperationZFail,\n backOperationZPass\n );\n }\n}\n\nfunction applySampleCoverage(gl, renderState) {\n const sampleCoverage = renderState.sampleCoverage;\n const enabled = sampleCoverage.enabled;\n\n enableOrDisable(gl, gl.SAMPLE_COVERAGE, enabled);\n\n if (enabled) {\n gl.sampleCoverage(sampleCoverage.value, sampleCoverage.invert);\n }\n}\n\nconst scratchViewport = new BoundingRectangle();\n\nfunction applyViewport(gl, renderState, passState) {\n let viewport = defaultValue(renderState.viewport, passState.viewport);\n if (!defined(viewport)) {\n viewport = scratchViewport;\n viewport.width = passState.context.drawingBufferWidth;\n viewport.height = passState.context.drawingBufferHeight;\n }\n\n passState.context.uniformState.viewport = viewport;\n gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);\n}\n\nRenderState.apply = function (gl, renderState, passState) {\n applyFrontFace(gl, renderState);\n applyCull(gl, renderState);\n applyLineWidth(gl, renderState);\n applyPolygonOffset(gl, renderState);\n applyDepthRange(gl, renderState);\n applyDepthTest(gl, renderState);\n applyColorMask(gl, renderState);\n applyDepthMask(gl, renderState);\n applyStencilMask(gl, renderState);\n applyStencilTest(gl, renderState);\n applySampleCoverage(gl, renderState);\n applyScissorTest(gl, renderState, passState);\n applyBlending(gl, renderState, passState);\n applyViewport(gl, renderState, passState);\n};\n\nfunction createFuncs(previousState, nextState) {\n const funcs = [];\n\n if (previousState.frontFace !== nextState.frontFace) {\n funcs.push(applyFrontFace);\n }\n\n if (\n previousState.cull.enabled !== nextState.cull.enabled ||\n previousState.cull.face !== nextState.cull.face\n ) {\n funcs.push(applyCull);\n }\n\n if (previousState.lineWidth !== nextState.lineWidth) {\n funcs.push(applyLineWidth);\n }\n\n if (\n previousState.polygonOffset.enabled !== nextState.polygonOffset.enabled ||\n previousState.polygonOffset.factor !== nextState.polygonOffset.factor ||\n previousState.polygonOffset.units !== nextState.polygonOffset.units\n ) {\n funcs.push(applyPolygonOffset);\n }\n\n if (\n previousState.depthRange.near !== nextState.depthRange.near ||\n previousState.depthRange.far !== nextState.depthRange.far\n ) {\n funcs.push(applyDepthRange);\n }\n\n if (\n previousState.depthTest.enabled !== nextState.depthTest.enabled ||\n previousState.depthTest.func !== nextState.depthTest.func\n ) {\n funcs.push(applyDepthTest);\n }\n\n if (\n previousState.colorMask.red !== nextState.colorMask.red ||\n previousState.colorMask.green !== nextState.colorMask.green ||\n previousState.colorMask.blue !== nextState.colorMask.blue ||\n previousState.colorMask.alpha !== nextState.colorMask.alpha\n ) {\n funcs.push(applyColorMask);\n }\n\n if (previousState.depthMask !== nextState.depthMask) {\n funcs.push(applyDepthMask);\n }\n\n if (previousState.stencilMask !== nextState.stencilMask) {\n funcs.push(applyStencilMask);\n }\n\n if (\n previousState.stencilTest.enabled !== nextState.stencilTest.enabled ||\n previousState.stencilTest.frontFunction !==\n nextState.stencilTest.frontFunction ||\n previousState.stencilTest.backFunction !==\n nextState.stencilTest.backFunction ||\n previousState.stencilTest.reference !== nextState.stencilTest.reference ||\n previousState.stencilTest.mask !== nextState.stencilTest.mask ||\n previousState.stencilTest.frontOperation.fail !==\n nextState.stencilTest.frontOperation.fail ||\n previousState.stencilTest.frontOperation.zFail !==\n nextState.stencilTest.frontOperation.zFail ||\n previousState.stencilTest.backOperation.fail !==\n nextState.stencilTest.backOperation.fail ||\n previousState.stencilTest.backOperation.zFail !==\n nextState.stencilTest.backOperation.zFail ||\n previousState.stencilTest.backOperation.zPass !==\n nextState.stencilTest.backOperation.zPass\n ) {\n funcs.push(applyStencilTest);\n }\n\n if (\n previousState.sampleCoverage.enabled !== nextState.sampleCoverage.enabled ||\n previousState.sampleCoverage.value !== nextState.sampleCoverage.value ||\n previousState.sampleCoverage.invert !== nextState.sampleCoverage.invert\n ) {\n funcs.push(applySampleCoverage);\n }\n\n return funcs;\n}\n\nRenderState.partialApply = function (\n gl,\n previousRenderState,\n renderState,\n previousPassState,\n passState,\n clear\n) {\n if (previousRenderState !== renderState) {\n // When a new render state is applied, instead of making WebGL calls for all the states or first\n // comparing the states one-by-one with the previous state (basically a linear search), we take\n // advantage of RenderState's immutability, and store a dynamically populated sparse data structure\n // containing functions that make the minimum number of WebGL calls when transitioning from one state\n // to the other. In practice, this works well since state-to-state transitions generally only require a\n // few WebGL calls, especially if commands are stored by state.\n let funcs = renderState._applyFunctions[previousRenderState.id];\n if (!defined(funcs)) {\n funcs = createFuncs(previousRenderState, renderState);\n renderState._applyFunctions[previousRenderState.id] = funcs;\n }\n\n const len = funcs.length;\n for (let i = 0; i < len; ++i) {\n funcs[i](gl, renderState);\n }\n }\n\n const previousScissorTest = defined(previousPassState.scissorTest)\n ? previousPassState.scissorTest\n : previousRenderState.scissorTest;\n const scissorTest = defined(passState.scissorTest)\n ? passState.scissorTest\n : renderState.scissorTest;\n\n // Our scissor rectangle can get out of sync with the GL scissor rectangle on clears.\n // Seems to be a problem only on ANGLE. See https://github.com/CesiumGS/cesium/issues/2994\n if (previousScissorTest !== scissorTest || clear) {\n applyScissorTest(gl, renderState, passState);\n }\n\n const previousBlendingEnabled = defined(previousPassState.blendingEnabled)\n ? previousPassState.blendingEnabled\n : previousRenderState.blending.enabled;\n const blendingEnabled = defined(passState.blendingEnabled)\n ? passState.blendingEnabled\n : renderState.blending.enabled;\n if (\n previousBlendingEnabled !== blendingEnabled ||\n (blendingEnabled && previousRenderState.blending !== renderState.blending)\n ) {\n applyBlending(gl, renderState, passState);\n }\n\n if (\n previousRenderState !== renderState ||\n previousPassState !== passState ||\n previousPassState.context !== passState.context\n ) {\n applyViewport(gl, renderState, passState);\n }\n};\n\nRenderState.getState = function (renderState) {\n return {\n frontFace: renderState.frontFace,\n cull: {\n enabled: renderState.cull.enabled,\n face: renderState.cull.face,\n },\n lineWidth: renderState.lineWidth,\n polygonOffset: {\n enabled: renderState.polygonOffset.enabled,\n factor: renderState.polygonOffset.factor,\n units: renderState.polygonOffset.units,\n },\n scissorTest: {\n enabled: renderState.scissorTest.enabled,\n rectangle: BoundingRectangle.clone(renderState.scissorTest.rectangle),\n },\n depthRange: {\n near: renderState.depthRange.near,\n far: renderState.depthRange.far,\n },\n depthTest: {\n enabled: renderState.depthTest.enabled,\n func: renderState.depthTest.func,\n },\n colorMask: {\n red: renderState.colorMask.red,\n green: renderState.colorMask.green,\n blue: renderState.colorMask.blue,\n alpha: renderState.colorMask.alpha,\n },\n depthMask: renderState.depthMask,\n stencilMask: renderState.stencilMask,\n blending: {\n enabled: renderState.blending.enabled,\n color: Color.clone(renderState.blending.color),\n equationRgb: renderState.blending.equationRgb,\n equationAlpha: renderState.blending.equationAlpha,\n functionSourceRgb: renderState.blending.functionSourceRgb,\n functionSourceAlpha: renderState.blending.functionSourceAlpha,\n functionDestinationRgb: renderState.blending.functionDestinationRgb,\n functionDestinationAlpha: renderState.blending.functionDestinationAlpha,\n },\n stencilTest: {\n enabled: renderState.stencilTest.enabled,\n frontFunction: renderState.stencilTest.frontFunction,\n backFunction: renderState.stencilTest.backFunction,\n reference: renderState.stencilTest.reference,\n mask: renderState.stencilTest.mask,\n frontOperation: {\n fail: renderState.stencilTest.frontOperation.fail,\n zFail: renderState.stencilTest.frontOperation.zFail,\n zPass: renderState.stencilTest.frontOperation.zPass,\n },\n backOperation: {\n fail: renderState.stencilTest.backOperation.fail,\n zFail: renderState.stencilTest.backOperation.zFail,\n zPass: renderState.stencilTest.backOperation.zPass,\n },\n },\n sampleCoverage: {\n enabled: renderState.sampleCoverage.enabled,\n value: renderState.sampleCoverage.value,\n invert: renderState.sampleCoverage.invert,\n },\n viewport: defined(renderState.viewport)\n ? BoundingRectangle.clone(renderState.viewport)\n : undefined,\n };\n};\nexport default RenderState;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\n\nconst viewerPositionWCScratch = new Cartesian3();\n\nfunction AutomaticUniform(options) {\n this._size = options.size;\n this._datatype = options.datatype;\n this.getValue = options.getValue;\n}\n\nconst datatypeToGlsl = {};\ndatatypeToGlsl[WebGLConstants.FLOAT] = \"float\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC2] = \"vec2\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC3] = \"vec3\";\ndatatypeToGlsl[WebGLConstants.FLOAT_VEC4] = \"vec4\";\ndatatypeToGlsl[WebGLConstants.INT] = \"int\";\ndatatypeToGlsl[WebGLConstants.INT_VEC2] = \"ivec2\";\ndatatypeToGlsl[WebGLConstants.INT_VEC3] = \"ivec3\";\ndatatypeToGlsl[WebGLConstants.INT_VEC4] = \"ivec4\";\ndatatypeToGlsl[WebGLConstants.BOOL] = \"bool\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC2] = \"bvec2\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC3] = \"bvec3\";\ndatatypeToGlsl[WebGLConstants.BOOL_VEC4] = \"bvec4\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT2] = \"mat2\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT3] = \"mat3\";\ndatatypeToGlsl[WebGLConstants.FLOAT_MAT4] = \"mat4\";\ndatatypeToGlsl[WebGLConstants.SAMPLER_2D] = \"sampler2D\";\ndatatypeToGlsl[WebGLConstants.SAMPLER_CUBE] = \"samplerCube\";\n\nAutomaticUniform.prototype.getDeclaration = function (name) {\n let declaration = `uniform ${datatypeToGlsl[this._datatype]} ${name}`;\n\n const size = this._size;\n if (size === 1) {\n declaration += \";\";\n } else {\n declaration += `[${size.toString()}];`;\n }\n\n return declaration;\n};\n\n/**\n * @private\n */\nconst AutomaticUniforms = {\n /**\n * An automatic GLSL uniform containing the viewport's <code>x</code>, <code>y</code>, <code>width</code>,\n * and <code>height</code> properties in an <code>vec4</code>'s <code>x</code>, <code>y</code>, <code>z</code>,\n * and <code>w</code> components, respectively.\n *\n * @example\n * // GLSL declaration\n * uniform vec4 czm_viewport;\n *\n * // Scale the window coordinate components to [0, 1] by dividing\n * // by the viewport's width and height.\n * vec2 v = gl_FragCoord.xy / czm_viewport.zw;\n *\n * @see Context#getViewport\n */\n czm_viewport: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC4,\n getValue: function (uniformState) {\n return uniformState.viewportCartesian4;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 orthographic projection matrix that\n * transforms window coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n * <br /><br />\n * This transform is useful when a vertex shader inputs or manipulates window coordinates\n * as done by {@link BillboardCollection}.\n * <br /><br />\n * Do not confuse {@link czm_viewportTransformation} with <code>czm_viewportOrthographic</code>.\n * The former transforms from normalized device coordinates to window coordinates; the later transforms\n * from window coordinates to clip coordinates, and is often used to assign to <code>gl_Position</code>.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_viewportOrthographic;\n *\n * // Example\n * gl_Position = czm_viewportOrthographic * vec4(windowPosition, 0.0, 1.0);\n *\n * @see UniformState#viewportOrthographic\n * @see czm_viewport\n * @see czm_viewportTransformation\n * @see BillboardCollection\n */\n czm_viewportOrthographic: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.viewportOrthographic;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 transformation matrix that\n * transforms normalized device coordinates to window coordinates. The context's\n * full viewport is used, and the depth range is assumed to be <code>near = 0</code>\n * and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}. In many cases,\n * this matrix will not be used directly; instead, {@link czm_modelToWindowCoordinates}\n * will be used to transform directly from model to window coordinates.\n * <br /><br />\n * Do not confuse <code>czm_viewportTransformation</code> with {@link czm_viewportOrthographic}.\n * The former transforms from normalized device coordinates to window coordinates; the later transforms\n * from window coordinates to clip coordinates, and is often used to assign to <code>gl_Position</code>.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_viewportTransformation;\n *\n * // Use czm_viewportTransformation as part of the\n * // transform from model to window coordinates.\n * vec4 q = czm_modelViewProjection * positionMC; // model to clip coordinates\n * q.xyz /= q.w; // clip to normalized device coordinates (ndc)\n * q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // ndc to window coordinates\n *\n * @see UniformState#viewportTransformation\n * @see czm_viewport\n * @see czm_viewportOrthographic\n * @see czm_modelToWindowCoordinates\n * @see BillboardCollection\n */\n czm_viewportTransformation: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.viewportTransformation;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the depth of the scene\n * after the globe pass and then updated after the 3D Tiles pass.\n * The depth is packed into an RGBA texture.\n *\n * @example\n * // GLSL declaration\n * uniform sampler2D czm_globeDepthTexture;\n *\n * // Get the depth at the current fragment\n * vec2 coords = gl_FragCoord.xy / czm_viewport.zw;\n * float depth = czm_unpackDepth(texture2D(czm_globeDepthTexture, coords));\n */\n czm_globeDepthTexture: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.SAMPLER_2D,\n getValue: function (uniformState) {\n return uniformState.globeDepthTexture;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model transformation matrix that\n * transforms model coordinates to world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_model;\n *\n * // Example\n * vec4 worldPosition = czm_model * modelPosition;\n *\n * @see UniformState#model\n * @see czm_inverseModel\n * @see czm_modelView\n * @see czm_modelViewProjection\n */\n czm_model: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.model;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model transformation matrix that\n * transforms world coordinates to model coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseModel;\n *\n * // Example\n * vec4 modelPosition = czm_inverseModel * worldPosition;\n *\n * @see UniformState#inverseModel\n * @see czm_model\n * @see czm_inverseModelView\n */\n czm_inverseModel: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseModel;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 view transformation matrix that\n * transforms world coordinates to eye coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_view;\n *\n * // Example\n * vec4 eyePosition = czm_view * worldPosition;\n *\n * @see UniformState#view\n * @see czm_viewRotation\n * @see czm_modelView\n * @see czm_viewProjection\n * @see czm_modelViewProjection\n * @see czm_inverseView\n */\n czm_view: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.view;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 view transformation matrix that\n * transforms 3D world coordinates to eye coordinates. In 3D mode, this is identical to\n * {@link czm_view}, but in 2D and Columbus View it represents the view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_view3D;\n *\n * // Example\n * vec4 eyePosition3D = czm_view3D * worldPosition3D;\n *\n * @see UniformState#view3D\n * @see czm_view\n */\n czm_view3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.view3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 view rotation matrix that\n * transforms vectors in world coordinates to eye coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_viewRotation;\n *\n * // Example\n * vec3 eyeVector = czm_viewRotation * worldVector;\n *\n * @see UniformState#viewRotation\n * @see czm_view\n * @see czm_inverseView\n * @see czm_inverseViewRotation\n */\n czm_viewRotation: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.viewRotation;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 view rotation matrix that\n * transforms vectors in 3D world coordinates to eye coordinates. In 3D mode, this is identical to\n * {@link czm_viewRotation}, but in 2D and Columbus View it represents the view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_viewRotation3D;\n *\n * // Example\n * vec3 eyeVector = czm_viewRotation3D * worldVector;\n *\n * @see UniformState#viewRotation3D\n * @see czm_viewRotation\n */\n czm_viewRotation3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.viewRotation3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 transformation matrix that\n * transforms from eye coordinates to world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseView;\n *\n * // Example\n * vec4 worldPosition = czm_inverseView * eyePosition;\n *\n * @see UniformState#inverseView\n * @see czm_view\n * @see czm_inverseNormal\n */\n czm_inverseView: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseView;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 transformation matrix that\n * transforms from 3D eye coordinates to world coordinates. In 3D mode, this is identical to\n * {@link czm_inverseView}, but in 2D and Columbus View it represents the inverse view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseView3D;\n *\n * // Example\n * vec4 worldPosition = czm_inverseView3D * eyePosition;\n *\n * @see UniformState#inverseView3D\n * @see czm_inverseView\n */\n czm_inverseView3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseView3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 rotation matrix that\n * transforms vectors from eye coordinates to world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_inverseViewRotation;\n *\n * // Example\n * vec4 worldVector = czm_inverseViewRotation * eyeVector;\n *\n * @see UniformState#inverseView\n * @see czm_view\n * @see czm_viewRotation\n * @see czm_inverseViewRotation\n */\n czm_inverseViewRotation: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.inverseViewRotation;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 rotation matrix that\n * transforms vectors from 3D eye coordinates to world coordinates. In 3D mode, this is identical to\n * {@link czm_inverseViewRotation}, but in 2D and Columbus View it represents the inverse view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_inverseViewRotation3D;\n *\n * // Example\n * vec4 worldVector = czm_inverseViewRotation3D * eyeVector;\n *\n * @see UniformState#inverseView3D\n * @see czm_inverseViewRotation\n */\n czm_inverseViewRotation3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.inverseViewRotation3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 projection transformation matrix that\n * transforms eye coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_projection;\n *\n * // Example\n * gl_Position = czm_projection * eyePosition;\n *\n * @see UniformState#projection\n * @see czm_viewProjection\n * @see czm_modelViewProjection\n * @see czm_infiniteProjection\n */\n czm_projection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.projection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 inverse projection transformation matrix that\n * transforms from clip coordinates to eye coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseProjection;\n *\n * // Example\n * vec4 eyePosition = czm_inverseProjection * clipPosition;\n *\n * @see UniformState#inverseProjection\n * @see czm_projection\n */\n czm_inverseProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 projection transformation matrix with the far plane at infinity,\n * that transforms eye coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output. An infinite far plane is used\n * in algorithms like shadow volumes and GPU ray casting with proxy geometry to ensure that triangles\n * are not clipped by the far plane.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_infiniteProjection;\n *\n * // Example\n * gl_Position = czm_infiniteProjection * eyePosition;\n *\n * @see UniformState#infiniteProjection\n * @see czm_projection\n * @see czm_modelViewInfiniteProjection\n */\n czm_infiniteProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.infiniteProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n * transforms model coordinates to eye coordinates.\n * <br /><br />\n * Positions should be transformed to eye coordinates using <code>czm_modelView</code> and\n * normals should be transformed using {@link czm_normal}.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelView;\n *\n * // Example\n * vec4 eyePosition = czm_modelView * modelPosition;\n *\n * // The above is equivalent to, but more efficient than:\n * vec4 eyePosition = czm_view * czm_model * modelPosition;\n *\n * @see UniformState#modelView\n * @see czm_model\n * @see czm_view\n * @see czm_modelViewProjection\n * @see czm_normal\n */\n czm_modelView: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelView;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n * transforms 3D model coordinates to eye coordinates. In 3D mode, this is identical to\n * {@link czm_modelView}, but in 2D and Columbus View it represents the model-view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n * <br /><br />\n * Positions should be transformed to eye coordinates using <code>czm_modelView3D</code> and\n * normals should be transformed using {@link czm_normal3D}.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelView3D;\n *\n * // Example\n * vec4 eyePosition = czm_modelView3D * modelPosition;\n *\n * // The above is equivalent to, but more efficient than:\n * vec4 eyePosition = czm_view3D * czm_model * modelPosition;\n *\n * @see UniformState#modelView3D\n * @see czm_modelView\n */\n czm_modelView3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelView3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view transformation matrix that\n * transforms model coordinates, relative to the eye, to eye coordinates. This is used\n * in conjunction with {@link czm_translateRelativeToEye}.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelViewRelativeToEye;\n *\n * // Example\n * attribute vec3 positionHigh;\n * attribute vec3 positionLow;\n *\n * void main()\n * {\n * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n * gl_Position = czm_projection * (czm_modelViewRelativeToEye * p);\n * }\n *\n * @see czm_modelViewProjectionRelativeToEye\n * @see czm_translateRelativeToEye\n * @see EncodedCartesian3\n */\n czm_modelViewRelativeToEye: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelViewRelativeToEye;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 transformation matrix that\n * transforms from eye coordinates to model coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseModelView;\n *\n * // Example\n * vec4 modelPosition = czm_inverseModelView * eyePosition;\n *\n * @see UniformState#inverseModelView\n * @see czm_modelView\n */\n czm_inverseModelView: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseModelView;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 transformation matrix that\n * transforms from eye coordinates to 3D model coordinates. In 3D mode, this is identical to\n * {@link czm_inverseModelView}, but in 2D and Columbus View it represents the inverse model-view matrix\n * as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseModelView3D;\n *\n * // Example\n * vec4 modelPosition = czm_inverseModelView3D * eyePosition;\n *\n * @see UniformState#inverseModelView\n * @see czm_inverseModelView\n * @see czm_modelView3D\n */\n czm_inverseModelView3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseModelView3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that\n * transforms world coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_viewProjection;\n *\n * // Example\n * vec4 gl_Position = czm_viewProjection * czm_model * modelPosition;\n *\n * // The above is equivalent to, but more efficient than:\n * gl_Position = czm_projection * czm_view * czm_model * modelPosition;\n *\n * @see UniformState#viewProjection\n * @see czm_view\n * @see czm_projection\n * @see czm_modelViewProjection\n * @see czm_inverseViewProjection\n */\n czm_viewProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.viewProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 view-projection transformation matrix that\n * transforms clip coordinates to world coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseViewProjection;\n *\n * // Example\n * vec4 worldPosition = czm_inverseViewProjection * clipPosition;\n *\n * @see UniformState#inverseViewProjection\n * @see czm_viewProjection\n */\n czm_inverseViewProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseViewProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n * transforms model coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelViewProjection;\n *\n * // Example\n * vec4 gl_Position = czm_modelViewProjection * modelPosition;\n *\n * // The above is equivalent to, but more efficient than:\n * gl_Position = czm_projection * czm_view * czm_model * modelPosition;\n *\n * @see UniformState#modelViewProjection\n * @see czm_model\n * @see czm_view\n * @see czm_projection\n * @see czm_modelView\n * @see czm_viewProjection\n * @see czm_modelViewInfiniteProjection\n * @see czm_inverseModelViewProjection\n */\n czm_modelViewProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelViewProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 inverse model-view-projection transformation matrix that\n * transforms clip coordinates to model coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_inverseModelViewProjection;\n *\n * // Example\n * vec4 modelPosition = czm_inverseModelViewProjection * clipPosition;\n *\n * @see UniformState#modelViewProjection\n * @see czm_modelViewProjection\n */\n czm_inverseModelViewProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.inverseModelViewProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n * transforms model coordinates, relative to the eye, to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output. This is used in\n * conjunction with {@link czm_translateRelativeToEye}.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelViewProjectionRelativeToEye;\n *\n * // Example\n * attribute vec3 positionHigh;\n * attribute vec3 positionLow;\n *\n * void main()\n * {\n * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n * }\n *\n * @see czm_modelViewRelativeToEye\n * @see czm_translateRelativeToEye\n * @see EncodedCartesian3\n */\n czm_modelViewProjectionRelativeToEye: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelViewProjectionRelativeToEye;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 4x4 model-view-projection transformation matrix that\n * transforms model coordinates to clip coordinates. Clip coordinates is the\n * coordinate system for a vertex shader's <code>gl_Position</code> output. The projection matrix places\n * the far plane at infinity. This is useful in algorithms like shadow volumes and GPU ray casting with\n * proxy geometry to ensure that triangles are not clipped by the far plane.\n *\n * @example\n * // GLSL declaration\n * uniform mat4 czm_modelViewInfiniteProjection;\n *\n * // Example\n * vec4 gl_Position = czm_modelViewInfiniteProjection * modelPosition;\n *\n * // The above is equivalent to, but more efficient than:\n * gl_Position = czm_infiniteProjection * czm_view * czm_model * modelPosition;\n *\n * @see UniformState#modelViewInfiniteProjection\n * @see czm_model\n * @see czm_view\n * @see czm_infiniteProjection\n * @see czm_modelViewProjection\n */\n czm_modelViewInfiniteProjection: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT4,\n getValue: function (uniformState) {\n return uniformState.modelViewInfiniteProjection;\n },\n }),\n\n /**\n * An automatic GLSL uniform that indicates if the current camera is orthographic in 3D.\n *\n * @see UniformState#orthographicIn3D\n */\n czm_orthographicIn3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.orthographicIn3D ? 1 : 0;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n * transforms normal vectors in model coordinates to eye coordinates.\n * <br /><br />\n * Positions should be transformed to eye coordinates using {@link czm_modelView} and\n * normals should be transformed using <code>czm_normal</code>.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_normal;\n *\n * // Example\n * vec3 eyeNormal = czm_normal * normal;\n *\n * @see UniformState#normal\n * @see czm_inverseNormal\n * @see czm_modelView\n */\n czm_normal: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.normal;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n * transforms normal vectors in 3D model coordinates to eye coordinates.\n * In 3D mode, this is identical to\n * {@link czm_normal}, but in 2D and Columbus View it represents the normal transformation\n * matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n * <br /><br />\n * Positions should be transformed to eye coordinates using {@link czm_modelView3D} and\n * normals should be transformed using <code>czm_normal3D</code>.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_normal3D;\n *\n * // Example\n * vec3 eyeNormal = czm_normal3D * normal;\n *\n * @see UniformState#normal3D\n * @see czm_normal\n */\n czm_normal3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.normal3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n * transforms normal vectors in eye coordinates to model coordinates. This is\n * the opposite of the transform provided by {@link czm_normal}.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_inverseNormal;\n *\n * // Example\n * vec3 normalMC = czm_inverseNormal * normalEC;\n *\n * @see UniformState#inverseNormal\n * @see czm_normal\n * @see czm_modelView\n * @see czm_inverseView\n */\n czm_inverseNormal: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.inverseNormal;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 normal transformation matrix that\n * transforms normal vectors in eye coordinates to 3D model coordinates. This is\n * the opposite of the transform provided by {@link czm_normal}.\n * In 3D mode, this is identical to\n * {@link czm_inverseNormal}, but in 2D and Columbus View it represents the inverse normal transformation\n * matrix as if the camera were at an equivalent location in 3D mode. This is useful for lighting\n * 2D and Columbus View in the same way that 3D is lit.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_inverseNormal3D;\n *\n * // Example\n * vec3 normalMC = czm_inverseNormal3D * normalEC;\n *\n * @see UniformState#inverseNormal3D\n * @see czm_inverseNormal\n */\n czm_inverseNormal3D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.inverseNormal3D;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the height in meters of the\n * eye (camera) above or below the ellipsoid.\n *\n * @see UniformState#eyeHeight\n */\n czm_eyeHeight: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.eyeHeight;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing height (<code>x</code>) and height squared (<code>y</code>)\n * in meters of the eye (camera) above the 2D world plane. This uniform is only valid\n * when the {@link SceneMode} is <code>SCENE2D</code>.\n *\n * @see UniformState#eyeHeight2D\n */\n czm_eyeHeight2D: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC2,\n getValue: function (uniformState) {\n return uniformState.eyeHeight2D;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the near distance (<code>x</code>) and the far distance (<code>y</code>)\n * of the frustum defined by the camera. This is the largest possible frustum, not an individual\n * frustum used for multi-frustum rendering.\n *\n * @example\n * // GLSL declaration\n * uniform vec2 czm_entireFrustum;\n *\n * // Example\n * float frustumLength = czm_entireFrustum.y - czm_entireFrustum.x;\n *\n * @see UniformState#entireFrustum\n * @see czm_currentFrustum\n */\n czm_entireFrustum: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC2,\n getValue: function (uniformState) {\n return uniformState.entireFrustum;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the near distance (<code>x</code>) and the far distance (<code>y</code>)\n * of the frustum defined by the camera. This is the individual\n * frustum used for multi-frustum rendering.\n *\n * @example\n * // GLSL declaration\n * uniform vec2 czm_currentFrustum;\n *\n * // Example\n * float frustumLength = czm_currentFrustum.y - czm_currentFrustum.x;\n *\n * @see UniformState#currentFrustum\n * @see czm_entireFrustum\n */\n czm_currentFrustum: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC2,\n getValue: function (uniformState) {\n return uniformState.currentFrustum;\n },\n }),\n\n /**\n * The distances to the frustum planes. The top, bottom, left and right distances are\n * the x, y, z, and w components, respectively.\n */\n czm_frustumPlanes: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC4,\n getValue: function (uniformState) {\n return uniformState.frustumPlanes;\n },\n }),\n\n /**\n * Gets the far plane's distance from the near plane, plus 1.0.\n */\n czm_farDepthFromNearPlusOne: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.farDepthFromNearPlusOne;\n },\n }),\n\n /**\n * Gets the log2 of {@link AutomaticUniforms#czm_farDepthFromNearPlusOne}.\n */\n czm_log2FarDepthFromNearPlusOne: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.log2FarDepthFromNearPlusOne;\n },\n }),\n\n /**\n * Gets 1.0 divided by {@link AutomaticUniforms#czm_log2FarDepthFromNearPlusOne}.\n */\n czm_oneOverLog2FarDepthFromNearPlusOne: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.oneOverLog2FarDepthFromNearPlusOne;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the sun position in world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_sunPositionWC;\n *\n * @see UniformState#sunPositionWC\n * @see czm_sunPositionColumbusView\n * @see czm_sunDirectionWC\n */\n czm_sunPositionWC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.sunPositionWC;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the sun position in Columbus view world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_sunPositionColumbusView;\n *\n * @see UniformState#sunPositionColumbusView\n * @see czm_sunPositionWC\n */\n czm_sunPositionColumbusView: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.sunPositionColumbusView;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the normalized direction to the sun in eye coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_sunDirectionEC;\n *\n * // Example\n * float diffuse = max(dot(czm_sunDirectionEC, normalEC), 0.0);\n *\n * @see UniformState#sunDirectionEC\n * @see czm_moonDirectionEC\n * @see czm_sunDirectionWC\n */\n czm_sunDirectionEC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.sunDirectionEC;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the normalized direction to the sun in world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_sunDirectionWC;\n *\n * // Example\n * float diffuse = max(dot(czm_sunDirectionWC, normalWC), 0.0);\n *\n * @see UniformState#sunDirectionWC\n * @see czm_sunPositionWC\n * @see czm_sunDirectionEC\n */\n czm_sunDirectionWC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.sunDirectionWC;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the normalized direction to the moon in eye coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_moonDirectionEC;\n *\n * // Example\n * float diffuse = max(dot(czm_moonDirectionEC, normalEC), 0.0);\n *\n * @see UniformState#moonDirectionEC\n * @see czm_sunDirectionEC\n */\n czm_moonDirectionEC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.moonDirectionEC;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the normalized direction to the scene's light source in eye coordinates.\n * This is commonly used for directional lighting computations.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_lightDirectionEC;\n *\n * // Example\n * float diffuse = max(dot(czm_lightDirectionEC, normalEC), 0.0);\n *\n * @see UniformState#lightDirectionEC\n * @see czm_lightDirectionWC\n */\n czm_lightDirectionEC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.lightDirectionEC;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the normalized direction to the scene's light source in world coordinates.\n * This is commonly used for directional lighting computations.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_lightDirectionWC;\n *\n * // Example\n * float diffuse = max(dot(czm_lightDirectionWC, normalWC), 0.0);\n *\n * @see UniformState#lightDirectionWC\n * @see czm_lightDirectionEC\n */\n czm_lightDirectionWC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.lightDirectionWC;\n },\n }),\n\n /**\n * An automatic GLSL uniform that represents the color of light emitted by the scene's light source. This\n * is equivalent to the light color multiplied by the light intensity limited to a maximum luminance of 1.0\n * suitable for non-HDR lighting.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_lightColor;\n *\n * // Example\n * vec3 diffuseColor = czm_lightColor * max(dot(czm_lightDirectionWC, normalWC), 0.0);\n *\n * @see UniformState#lightColor\n * @see czm_lightColorHdr\n */\n czm_lightColor: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.lightColor;\n },\n }),\n\n /**\n * An automatic GLSL uniform that represents the high dynamic range color of light emitted by the scene's light\n * source. This is equivalent to the light color multiplied by the light intensity suitable for HDR lighting.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_lightColorHdr;\n *\n * // Example\n * vec3 diffuseColor = czm_lightColorHdr * max(dot(czm_lightDirectionWC, normalWC), 0.0);\n *\n * @see UniformState#lightColorHdr\n * @see czm_lightColor\n */\n czm_lightColorHdr: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.lightColorHdr;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the high bits of the camera position in model\n * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering\n * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_encodedCameraPositionMCHigh;\n *\n * @see czm_encodedCameraPositionMCLow\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n */\n czm_encodedCameraPositionMCHigh: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.encodedCameraPositionMCHigh;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the low bits of the camera position in model\n * coordinates. This is used for GPU RTE to eliminate jittering artifacts when rendering\n * as described in {@linkhttp://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_encodedCameraPositionMCLow;\n *\n * @see czm_encodedCameraPositionMCHigh\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n */\n czm_encodedCameraPositionMCLow: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.encodedCameraPositionMCLow;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the position of the viewer (camera) in world coordinates.\n *\n * @example\n * // GLSL declaration\n * uniform vec3 czm_viewerPositionWC;\n */\n czm_viewerPositionWC: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return Matrix4.getTranslation(\n uniformState.inverseView,\n viewerPositionWCScratch\n );\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the frame number. This uniform is automatically incremented\n * every frame.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_frameNumber;\n */\n czm_frameNumber: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.frameState.frameNumber;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the current morph transition time between\n * 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_morphTime;\n *\n * // Example\n * vec4 p = czm_columbusViewMorph(position2D, position3D, czm_morphTime);\n */\n czm_morphTime: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.frameState.morphTime;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the current {@link SceneMode}, expressed\n * as a float.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_sceneMode;\n *\n * // Example\n * if (czm_sceneMode == czm_sceneMode2D)\n * {\n * eyeHeightSq = czm_eyeHeight2D.y;\n * }\n *\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\n czm_sceneMode: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.frameState.mode;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the current rendering pass.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_pass;\n *\n * // Example\n * if ((czm_pass == czm_passTranslucent) && isOpaque())\n * {\n * gl_Position *= 0.0; // Cull opaque geometry in the translucent pass\n * }\n */\n czm_pass: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.pass;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the current scene background color.\n *\n * @example\n * // GLSL declaration\n * uniform vec4 czm_backgroundColor;\n *\n * // Example: If the given color's RGB matches the background color, invert it.\n * vec4 adjustColorForContrast(vec4 color)\n * {\n * if (czm_backgroundColor.rgb == color.rgb)\n * {\n * color.rgb = vec3(1.0) - color.rgb;\n * }\n *\n * return color;\n * }\n */\n czm_backgroundColor: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC4,\n getValue: function (uniformState) {\n return uniformState.backgroundColor;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the BRDF look up texture used for image-based lighting computations.\n *\n * @example\n * // GLSL declaration\n * uniform sampler2D czm_brdfLut;\n *\n * // Example: For a given roughness and NdotV value, find the material's BRDF information in the red and green channels\n * float roughness = 0.5;\n * float NdotV = dot(normal, view);\n * vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n */\n czm_brdfLut: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.SAMPLER_2D,\n getValue: function (uniformState) {\n return uniformState.brdfLut;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the environment map used within the scene.\n *\n * @example\n * // GLSL declaration\n * uniform samplerCube czm_environmentMap;\n *\n * // Example: Create a perfect reflection of the environment map on a model\n * float reflected = reflect(view, normal);\n * vec4 reflectedColor = textureCube(czm_environmentMap, reflected);\n */\n czm_environmentMap: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.SAMPLER_CUBE,\n getValue: function (uniformState) {\n return uniformState.environmentMap;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the specular environment map atlas used within the scene.\n *\n * @example\n * // GLSL declaration\n * uniform sampler2D czm_specularEnvironmentMaps;\n */\n czm_specularEnvironmentMaps: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.SAMPLER_2D,\n getValue: function (uniformState) {\n return uniformState.specularEnvironmentMaps;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the size of the specular environment map atlas used within the scene.\n *\n * @example\n * // GLSL declaration\n * uniform vec2 czm_specularEnvironmentMapSize;\n */\n czm_specularEnvironmentMapSize: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC2,\n getValue: function (uniformState) {\n return uniformState.specularEnvironmentMapsDimensions;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the maximum level-of-detail of the specular environment map atlas used within the scene.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_specularEnvironmentMapsMaximumLOD;\n */\n czm_specularEnvironmentMapsMaximumLOD: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.specularEnvironmentMapsMaximumLOD;\n },\n }),\n\n /**\n * An automatic GLSL uniform containing the spherical harmonic coefficients used within the scene.\n *\n * @example\n * // GLSL declaration\n * uniform vec3[9] czm_sphericalHarmonicCoefficients;\n */\n czm_sphericalHarmonicCoefficients: new AutomaticUniform({\n size: 9,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.sphericalHarmonicCoefficients;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing a 3x3 rotation matrix that transforms\n * from True Equator Mean Equinox (TEME) axes to the pseudo-fixed axes at the current scene time.\n *\n * @example\n * // GLSL declaration\n * uniform mat3 czm_temeToPseudoFixed;\n *\n * // Example\n * vec3 pseudoFixed = czm_temeToPseudoFixed * teme;\n *\n * @see UniformState#temeToPseudoFixedMatrix\n * @see Transforms.computeTemeToPseudoFixedMatrix\n */\n czm_temeToPseudoFixed: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_MAT3,\n getValue: function (uniformState) {\n return uniformState.temeToPseudoFixedMatrix;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the ratio of canvas coordinate space to canvas pixel space.\n *\n * @example\n * uniform float czm_pixelRatio;\n */\n czm_pixelRatio: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.pixelRatio;\n },\n }),\n\n /**\n * An automatic GLSL uniform scalar used to mix a color with the fog color based on the distance to the camera.\n *\n * @see czm_fog\n */\n czm_fogDensity: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.fogDensity;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the splitter position to use when rendering with a splitter.\n * This will be in pixel coordinates relative to the canvas.\n *\n * @example\n * // GLSL declaration\n * uniform float czm_splitPosition;\n */\n czm_splitPosition: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.splitPosition;\n },\n }),\n\n /**\n * An automatic GLSL uniform scalar representing the geometric tolerance per meter\n */\n czm_geometricToleranceOverMeter: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.geometricToleranceOverMeter;\n },\n }),\n\n /**\n * An automatic GLSL uniform representing the distance from the camera at which to disable the depth test of billboards, labels and points\n * to, for example, prevent clipping against terrain. When set to zero, the depth test should always be applied. When less than zero,\n * the depth test should never be applied.\n */\n czm_minimumDisableDepthTestDistance: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.minimumDisableDepthTestDistance;\n },\n }),\n\n /**\n * An automatic GLSL uniform that will be the highlight color of unclassified 3D Tiles.\n */\n czm_invertClassificationColor: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC4,\n getValue: function (uniformState) {\n return uniformState.invertClassificationColor;\n },\n }),\n\n /**\n * An automatic GLSL uniform that is used for gamma correction.\n */\n czm_gamma: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT,\n getValue: function (uniformState) {\n return uniformState.gamma;\n },\n }),\n\n /**\n * An automatic GLSL uniform that stores the ellipsoid radii.\n */\n czm_ellipsoidRadii: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.ellipsoid.radii;\n },\n }),\n\n /**\n * An automatic GLSL uniform that stores the ellipsoid inverse radii.\n */\n czm_ellipsoidInverseRadii: new AutomaticUniform({\n size: 1,\n datatype: WebGLConstants.FLOAT_VEC3,\n getValue: function (uniformState) {\n return uniformState.ellipsoid.oneOverRadii;\n },\n }),\n};\nexport default AutomaticUniforms;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction createUniform(gl, activeUniform, uniformName, location) {\n switch (activeUniform.type) {\n case gl.FLOAT:\n return new UniformFloat(gl, activeUniform, uniformName, location);\n case gl.FLOAT_VEC2:\n return new UniformFloatVec2(gl, activeUniform, uniformName, location);\n case gl.FLOAT_VEC3:\n return new UniformFloatVec3(gl, activeUniform, uniformName, location);\n case gl.FLOAT_VEC4:\n return new UniformFloatVec4(gl, activeUniform, uniformName, location);\n case gl.SAMPLER_2D:\n case gl.SAMPLER_CUBE:\n return new UniformSampler(gl, activeUniform, uniformName, location);\n case gl.INT:\n case gl.BOOL:\n return new UniformInt(gl, activeUniform, uniformName, location);\n case gl.INT_VEC2:\n case gl.BOOL_VEC2:\n return new UniformIntVec2(gl, activeUniform, uniformName, location);\n case gl.INT_VEC3:\n case gl.BOOL_VEC3:\n return new UniformIntVec3(gl, activeUniform, uniformName, location);\n case gl.INT_VEC4:\n case gl.BOOL_VEC4:\n return new UniformIntVec4(gl, activeUniform, uniformName, location);\n case gl.FLOAT_MAT2:\n return new UniformMat2(gl, activeUniform, uniformName, location);\n case gl.FLOAT_MAT3:\n return new UniformMat3(gl, activeUniform, uniformName, location);\n case gl.FLOAT_MAT4:\n return new UniformMat4(gl, activeUniform, uniformName, location);\n default:\n throw new RuntimeError(\n `Unrecognized uniform type: ${activeUniform.type} for uniform \"${uniformName}\".`\n );\n }\n}\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloat(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = 0.0;\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformFloat.prototype.set = function () {\n if (this.value !== this._value) {\n this._value = this.value;\n this._gl.uniform1f(this._location, this.value);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec2(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Cartesian2();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformFloatVec2.prototype.set = function () {\n const v = this.value;\n if (!Cartesian2.equals(v, this._value)) {\n Cartesian2.clone(v, this._value);\n this._gl.uniform2f(this._location, v.x, v.y);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec3(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = undefined;\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformFloatVec3.prototype.set = function () {\n const v = this.value;\n\n if (defined(v.red)) {\n if (!Color.equals(v, this._value)) {\n this._value = Color.clone(v, this._value);\n this._gl.uniform3f(this._location, v.red, v.green, v.blue);\n }\n } else if (defined(v.x)) {\n if (!Cartesian3.equals(v, this._value)) {\n this._value = Cartesian3.clone(v, this._value);\n this._gl.uniform3f(this._location, v.x, v.y, v.z);\n }\n } else {\n}\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformFloatVec4(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = undefined;\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformFloatVec4.prototype.set = function () {\n const v = this.value;\n\n if (defined(v.red)) {\n if (!Color.equals(v, this._value)) {\n this._value = Color.clone(v, this._value);\n this._gl.uniform4f(this._location, v.red, v.green, v.blue, v.alpha);\n }\n } else if (defined(v.x)) {\n if (!Cartesian4.equals(v, this._value)) {\n this._value = Cartesian4.clone(v, this._value);\n this._gl.uniform4f(this._location, v.x, v.y, v.z, v.w);\n }\n } else {\n}\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformSampler(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n\n this._gl = gl;\n this._location = location;\n\n this.textureUnitIndex = undefined;\n}\n\nUniformSampler.prototype.set = function () {\n const gl = this._gl;\n gl.activeTexture(gl.TEXTURE0 + this.textureUnitIndex);\n\n const v = this.value;\n gl.bindTexture(v._target, v._texture);\n};\n\nUniformSampler.prototype._setSampler = function (textureUnitIndex) {\n this.textureUnitIndex = textureUnitIndex;\n this._gl.uniform1i(this._location, textureUnitIndex);\n return textureUnitIndex + 1;\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformInt(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = 0.0;\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformInt.prototype.set = function () {\n if (this.value !== this._value) {\n this._value = this.value;\n this._gl.uniform1i(this._location, this.value);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec2(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Cartesian2();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformIntVec2.prototype.set = function () {\n const v = this.value;\n if (!Cartesian2.equals(v, this._value)) {\n Cartesian2.clone(v, this._value);\n this._gl.uniform2i(this._location, v.x, v.y);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec3(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Cartesian3();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformIntVec3.prototype.set = function () {\n const v = this.value;\n if (!Cartesian3.equals(v, this._value)) {\n Cartesian3.clone(v, this._value);\n this._gl.uniform3i(this._location, v.x, v.y, v.z);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n/**\n * @private\n * @constructor\n */\nfunction UniformIntVec4(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Cartesian4();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformIntVec4.prototype.set = function () {\n const v = this.value;\n if (!Cartesian4.equals(v, this._value)) {\n Cartesian4.clone(v, this._value);\n this._gl.uniform4i(this._location, v.x, v.y, v.z, v.w);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchUniformArray = new Float32Array(4);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat2(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Matrix2();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformMat2.prototype.set = function () {\n if (!Matrix2.equalsArray(this.value, this._value, 0)) {\n Matrix2.clone(this.value, this._value);\n\n const array = Matrix2.toArray(this.value, scratchUniformArray);\n this._gl.uniformMatrix2fv(this._location, false, array);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchMat3Array = new Float32Array(9);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat3(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Matrix3();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformMat3.prototype.set = function () {\n if (!Matrix3.equalsArray(this.value, this._value, 0)) {\n Matrix3.clone(this.value, this._value);\n\n const array = Matrix3.toArray(this.value, scratchMat3Array);\n this._gl.uniformMatrix3fv(this._location, false, array);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchMat4Array = new Float32Array(16);\n/**\n * @private\n * @constructor\n */\nfunction UniformMat4(gl, activeUniform, uniformName, location) {\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = undefined;\n this._value = new Matrix4();\n\n this._gl = gl;\n this._location = location;\n}\n\nUniformMat4.prototype.set = function () {\n if (!Matrix4.equalsArray(this.value, this._value, 0)) {\n Matrix4.clone(this.value, this._value);\n\n const array = Matrix4.toArray(this.value, scratchMat4Array);\n this._gl.uniformMatrix4fv(this._location, false, array);\n }\n};\nexport default createUniform;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction createUniformArray(gl, activeUniform, uniformName, locations) {\n switch (activeUniform.type) {\n case gl.FLOAT:\n return new UniformArrayFloat(gl, activeUniform, uniformName, locations);\n case gl.FLOAT_VEC2:\n return new UniformArrayFloatVec2(\n gl,\n activeUniform,\n uniformName,\n locations\n );\n case gl.FLOAT_VEC3:\n return new UniformArrayFloatVec3(\n gl,\n activeUniform,\n uniformName,\n locations\n );\n case gl.FLOAT_VEC4:\n return new UniformArrayFloatVec4(\n gl,\n activeUniform,\n uniformName,\n locations\n );\n case gl.SAMPLER_2D:\n case gl.SAMPLER_CUBE:\n return new UniformArraySampler(gl, activeUniform, uniformName, locations);\n case gl.INT:\n case gl.BOOL:\n return new UniformArrayInt(gl, activeUniform, uniformName, locations);\n case gl.INT_VEC2:\n case gl.BOOL_VEC2:\n return new UniformArrayIntVec2(gl, activeUniform, uniformName, locations);\n case gl.INT_VEC3:\n case gl.BOOL_VEC3:\n return new UniformArrayIntVec3(gl, activeUniform, uniformName, locations);\n case gl.INT_VEC4:\n case gl.BOOL_VEC4:\n return new UniformArrayIntVec4(gl, activeUniform, uniformName, locations);\n case gl.FLOAT_MAT2:\n return new UniformArrayMat2(gl, activeUniform, uniformName, locations);\n case gl.FLOAT_MAT3:\n return new UniformArrayMat3(gl, activeUniform, uniformName, locations);\n case gl.FLOAT_MAT4:\n return new UniformArrayMat4(gl, activeUniform, uniformName, locations);\n default:\n throw new RuntimeError(\n `Unrecognized uniform type: ${activeUniform.type} for uniform \"${uniformName}\".`\n );\n }\n}\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloat(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayFloat.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (v !== arraybuffer[i]) {\n arraybuffer[i] = v;\n changed = true;\n }\n }\n\n if (changed) {\n this._gl.uniform1fv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec2(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 2);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayFloatVec2.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Cartesian2.equalsArray(v, arraybuffer, j)) {\n Cartesian2.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 2;\n }\n\n if (changed) {\n this._gl.uniform2fv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec3(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 3);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayFloatVec3.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (defined(v.red)) {\n if (\n v.red !== arraybuffer[j] ||\n v.green !== arraybuffer[j + 1] ||\n v.blue !== arraybuffer[j + 2]\n ) {\n arraybuffer[j] = v.red;\n arraybuffer[j + 1] = v.green;\n arraybuffer[j + 2] = v.blue;\n changed = true;\n }\n } else if (defined(v.x)) {\n if (!Cartesian3.equalsArray(v, arraybuffer, j)) {\n Cartesian3.pack(v, arraybuffer, j);\n changed = true;\n }\n } else {\n}\n\n j += 3;\n }\n\n if (changed) {\n this._gl.uniform3fv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayFloatVec4(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 4);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayFloatVec4.prototype.set = function () {\n // PERFORMANCE_IDEA: if it is a common case that only a few elements\n // in a uniform array change, we could use heuristics to determine\n // when it is better to call uniform4f for each element that changed\n // vs. call uniform4fv once to set the entire array. This applies\n // to all uniform array types, not just vec4. We might not care\n // once we have uniform buffers since that will be the fast path.\n\n // PERFORMANCE_IDEA: Micro-optimization (I bet it works though):\n // As soon as changed is true, break into a separate loop that\n // does the copy without the equals check.\n\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (defined(v.red)) {\n if (!Color.equalsArray(v, arraybuffer, j)) {\n Color.pack(v, arraybuffer, j);\n changed = true;\n }\n } else if (defined(v.x)) {\n if (!Cartesian4.equalsArray(v, arraybuffer, j)) {\n Cartesian4.pack(v, arraybuffer, j);\n changed = true;\n }\n } else {\n}\n\n j += 4;\n }\n\n if (changed) {\n this._gl.uniform4fv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArraySampler(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length);\n\n this._gl = gl;\n this._locations = locations;\n\n this.textureUnitIndex = undefined;\n}\n\nUniformArraySampler.prototype.set = function () {\n const gl = this._gl;\n const textureUnitIndex = gl.TEXTURE0 + this.textureUnitIndex;\n\n const value = this.value;\n const length = value.length;\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n gl.activeTexture(textureUnitIndex + i);\n gl.bindTexture(v._target, v._texture);\n }\n};\n\nUniformArraySampler.prototype._setSampler = function (textureUnitIndex) {\n this.textureUnitIndex = textureUnitIndex;\n\n const locations = this._locations;\n const length = locations.length;\n for (let i = 0; i < length; ++i) {\n const index = textureUnitIndex + i;\n this._gl.uniform1i(locations[i], index);\n }\n\n return textureUnitIndex + length;\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayInt(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Int32Array(length);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayInt.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (v !== arraybuffer[i]) {\n arraybuffer[i] = v;\n changed = true;\n }\n }\n\n if (changed) {\n this._gl.uniform1iv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec2(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Int32Array(length * 2);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayIntVec2.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Cartesian2.equalsArray(v, arraybuffer, j)) {\n Cartesian2.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 2;\n }\n\n if (changed) {\n this._gl.uniform2iv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec3(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Int32Array(length * 3);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayIntVec3.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Cartesian3.equalsArray(v, arraybuffer, j)) {\n Cartesian3.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 3;\n }\n\n if (changed) {\n this._gl.uniform3iv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayIntVec4(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Int32Array(length * 4);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayIntVec4.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Cartesian4.equalsArray(v, arraybuffer, j)) {\n Cartesian4.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 4;\n }\n\n if (changed) {\n this._gl.uniform4iv(this._location, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat2(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 4);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayMat2.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Matrix2.equalsArray(v, arraybuffer, j)) {\n Matrix2.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 4;\n }\n\n if (changed) {\n this._gl.uniformMatrix2fv(this._location, false, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat3(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 9);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayMat3.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Matrix3.equalsArray(v, arraybuffer, j)) {\n Matrix3.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 9;\n }\n\n if (changed) {\n this._gl.uniformMatrix3fv(this._location, false, arraybuffer);\n }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n * @constructor\n */\nfunction UniformArrayMat4(gl, activeUniform, uniformName, locations) {\n const length = locations.length;\n\n /**\n * @type {String}\n * @readonly\n */\n this.name = uniformName;\n\n this.value = new Array(length);\n this._value = new Float32Array(length * 16);\n\n this._gl = gl;\n this._location = locations[0];\n}\n\nUniformArrayMat4.prototype.set = function () {\n const value = this.value;\n const length = value.length;\n const arraybuffer = this._value;\n let changed = false;\n let j = 0;\n\n for (let i = 0; i < length; ++i) {\n const v = value[i];\n\n if (!Matrix4.equalsArray(v, arraybuffer, j)) {\n Matrix4.pack(v, arraybuffer, j);\n changed = true;\n }\n j += 16;\n }\n\n if (changed) {\n this._gl.uniformMatrix4fv(this._location, false, arraybuffer);\n }\n};\nexport default createUniformArray;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport AutomaticUniforms from \"./AutomaticUniforms.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport createUniform from \"./createUniform.js\";\nimport createUniformArray from \"./createUniformArray.js\";\n\nlet nextShaderProgramId = 0;\n\n/**\n * @private\n */\nfunction ShaderProgram(options) {\n let vertexShaderText = options.vertexShaderText;\n let fragmentShaderText = options.fragmentShaderText;\n\n if (typeof spector !== \"undefined\") {\n // The #line statements common in Cesium shaders interfere with the ability of the\n // SpectorJS to show errors on the correct line. So remove them when SpectorJS\n // is active.\n vertexShaderText = vertexShaderText.replace(/^#line/gm, \"//#line\");\n fragmentShaderText = fragmentShaderText.replace(/^#line/gm, \"//#line\");\n }\n\n const modifiedFS = handleUniformPrecisionMismatches(\n vertexShaderText,\n fragmentShaderText\n );\n\n this._gl = options.gl;\n this._logShaderCompilation = options.logShaderCompilation;\n this._debugShaders = options.debugShaders;\n this._attributeLocations = options.attributeLocations;\n\n this._program = undefined;\n this._numberOfVertexAttributes = undefined;\n this._vertexAttributes = undefined;\n this._uniformsByName = undefined;\n this._uniforms = undefined;\n this._automaticUniforms = undefined;\n this._manualUniforms = undefined;\n this._duplicateUniformNames = modifiedFS.duplicateUniformNames;\n this._cachedShader = undefined; // Used by ShaderCache\n\n /**\n * @private\n */\n this.maximumTextureUnitIndex = undefined;\n\n this._vertexShaderSource = options.vertexShaderSource;\n this._vertexShaderText = options.vertexShaderText;\n this._fragmentShaderSource = options.fragmentShaderSource;\n this._fragmentShaderText = modifiedFS.fragmentShaderText;\n\n /**\n * @private\n */\n this.id = nextShaderProgramId++;\n}\n\nShaderProgram.fromCache = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n return options.context.shaderCache.getShaderProgram(options);\n};\n\nShaderProgram.replaceCache = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n return options.context.shaderCache.replaceShaderProgram(options);\n};\n\nObject.defineProperties(ShaderProgram.prototype, {\n /**\n * GLSL source for the shader program's vertex shader.\n * @memberof ShaderProgram.prototype\n *\n * @type {ShaderSource}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n /**\n * GLSL source for the shader program's fragment shader.\n * @memberof ShaderProgram.prototype\n *\n * @type {ShaderSource}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n vertexAttributes: {\n get: function () {\n initialize(this);\n return this._vertexAttributes;\n },\n },\n numberOfVertexAttributes: {\n get: function () {\n initialize(this);\n return this._numberOfVertexAttributes;\n },\n },\n allUniforms: {\n get: function () {\n initialize(this);\n return this._uniformsByName;\n },\n },\n});\n\nfunction extractUniforms(shaderText) {\n const uniformNames = [];\n const uniformLines = shaderText.match(/uniform.*?(?![^{]*})(?=[=\\[;])/g);\n if (defined(uniformLines)) {\n const len = uniformLines.length;\n for (let i = 0; i < len; i++) {\n const line = uniformLines[i].trim();\n const name = line.slice(line.lastIndexOf(\" \") + 1);\n uniformNames.push(name);\n }\n }\n return uniformNames;\n}\n\nfunction handleUniformPrecisionMismatches(\n vertexShaderText,\n fragmentShaderText\n) {\n // If a uniform exists in both the vertex and fragment shader but with different precision qualifiers,\n // give the fragment shader uniform a different name. This fixes shader compilation errors on devices\n // that only support mediump in the fragment shader.\n const duplicateUniformNames = {};\n\n if (!ContextLimits.highpFloatSupported || !ContextLimits.highpIntSupported) {\n let i, j;\n let uniformName;\n let duplicateName;\n const vertexShaderUniforms = extractUniforms(vertexShaderText);\n const fragmentShaderUniforms = extractUniforms(fragmentShaderText);\n const vertexUniformsCount = vertexShaderUniforms.length;\n const fragmentUniformsCount = fragmentShaderUniforms.length;\n\n for (i = 0; i < vertexUniformsCount; i++) {\n for (j = 0; j < fragmentUniformsCount; j++) {\n if (vertexShaderUniforms[i] === fragmentShaderUniforms[j]) {\n uniformName = vertexShaderUniforms[i];\n duplicateName = `czm_mediump_${uniformName}`;\n // Update fragmentShaderText with renamed uniforms\n const re = new RegExp(`${uniformName}\\\\b`, \"g\");\n fragmentShaderText = fragmentShaderText.replace(re, duplicateName);\n duplicateUniformNames[duplicateName] = uniformName;\n }\n }\n }\n }\n\n return {\n fragmentShaderText: fragmentShaderText,\n duplicateUniformNames: duplicateUniformNames,\n };\n}\n\nconst consolePrefix = \"[Cesium WebGL] \";\n\nfunction createAndLinkProgram(gl, shader) {\n const vsSource = shader._vertexShaderText;\n const fsSource = shader._fragmentShaderText;\n\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vsSource);\n gl.compileShader(vertexShader);\n\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fsSource);\n gl.compileShader(fragmentShader);\n\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n const attributeLocations = shader._attributeLocations;\n if (defined(attributeLocations)) {\n for (const attribute in attributeLocations) {\n if (attributeLocations.hasOwnProperty(attribute)) {\n gl.bindAttribLocation(\n program,\n attributeLocations[attribute],\n attribute\n );\n }\n }\n }\n\n gl.linkProgram(program);\n let log;\n\n // For performance: if linker succeeds, return without checking compile status\n if (gl.getProgramParameter(program, gl.LINK_STATUS)) {\n if (shader._logShaderCompilation) {\n log = gl.getShaderInfoLog(vertexShader);\n if (defined(log) && log.length > 0) {\n console.log(`${consolePrefix}Vertex shader compile log: ${log}`);\n }\n\n log = gl.getShaderInfoLog(fragmentShader);\n if (defined(log) && log.length > 0) {\n console.log(`${consolePrefix}Fragment shader compile log: ${log}`);\n }\n\n log = gl.getProgramInfoLog(program);\n if (defined(log) && log.length > 0) {\n console.log(`${consolePrefix}Shader program link log: ${log}`);\n }\n }\n\n gl.deleteShader(vertexShader);\n gl.deleteShader(fragmentShader);\n\n return program;\n }\n\n // Program failed to link. Try to find and report the reason\n let errorMessage;\n const debugShaders = shader._debugShaders;\n\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n log = gl.getShaderInfoLog(fragmentShader);\n console.error(`${consolePrefix}Fragment shader compile log: ${log}`);\n console.error(`${consolePrefix} Fragment shader source:\\n${fsSource}`);\n errorMessage = `Fragment shader failed to compile. Compile log: ${log}`;\n } else if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n log = gl.getShaderInfoLog(vertexShader);\n console.error(`${consolePrefix}Vertex shader compile log: ${log}`);\n console.error(`${consolePrefix} Vertex shader source:\\n${vsSource}`);\n errorMessage = `Vertex shader failed to compile. Compile log: ${log}`;\n } else {\n log = gl.getProgramInfoLog(program);\n console.error(`${consolePrefix}Shader program link log: ${log}`);\n logTranslatedSource(vertexShader, \"vertex\");\n logTranslatedSource(fragmentShader, \"fragment\");\n errorMessage = `Program failed to link. Link log: ${log}`;\n }\n\n gl.deleteShader(vertexShader);\n gl.deleteShader(fragmentShader);\n gl.deleteProgram(program);\n throw new RuntimeError(errorMessage);\n\n function logTranslatedSource(compiledShader, name) {\n if (!defined(debugShaders)) {\n return;\n }\n const translation = debugShaders.getTranslatedShaderSource(compiledShader);\n if (translation === \"\") {\n console.error(`${consolePrefix}${name} shader translation failed.`);\n return;\n }\n console.error(\n `${consolePrefix}Translated ${name} shaderSource:\\n${translation}`\n );\n }\n}\n\nfunction findVertexAttributes(gl, program, numberOfAttributes) {\n const attributes = {};\n for (let i = 0; i < numberOfAttributes; ++i) {\n const attr = gl.getActiveAttrib(program, i);\n const location = gl.getAttribLocation(program, attr.name);\n\n attributes[attr.name] = {\n name: attr.name,\n type: attr.type,\n index: location,\n };\n }\n\n return attributes;\n}\n\nfunction findUniforms(gl, program) {\n const uniformsByName = {};\n const uniforms = [];\n const samplerUniforms = [];\n\n const numberOfUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (let i = 0; i < numberOfUniforms; ++i) {\n const activeUniform = gl.getActiveUniform(program, i);\n const suffix = \"[0]\";\n const uniformName =\n activeUniform.name.indexOf(\n suffix,\n activeUniform.name.length - suffix.length\n ) !== -1\n ? activeUniform.name.slice(0, activeUniform.name.length - 3)\n : activeUniform.name;\n\n // Ignore GLSL built-in uniforms returned in Firefox.\n if (uniformName.indexOf(\"gl_\") !== 0) {\n if (activeUniform.name.indexOf(\"[\") < 0) {\n // Single uniform\n const location = gl.getUniformLocation(program, uniformName);\n\n // IE 11.0.9 needs this check since getUniformLocation can return null\n // if the uniform is not active (e.g., it is optimized out). Looks like\n // getActiveUniform() above returns uniforms that are not actually active.\n if (location !== null) {\n const uniform = createUniform(\n gl,\n activeUniform,\n uniformName,\n location\n );\n\n uniformsByName[uniformName] = uniform;\n uniforms.push(uniform);\n\n if (uniform._setSampler) {\n samplerUniforms.push(uniform);\n }\n }\n } else {\n // Uniform array\n\n let uniformArray;\n let locations;\n let value;\n let loc;\n\n // On some platforms - Nexus 4 in Firefox for one - an array of sampler2D ends up being represented\n // as separate uniforms, one for each array element. Check for and handle that case.\n const indexOfBracket = uniformName.indexOf(\"[\");\n if (indexOfBracket >= 0) {\n // We're assuming the array elements show up in numerical order - it seems to be true.\n uniformArray = uniformsByName[uniformName.slice(0, indexOfBracket)];\n\n // Nexus 4 with Android 4.3 needs this check, because it reports a uniform\n // with the strange name webgl_3467e0265d05c3c1[1] in our globe surface shader.\n if (!defined(uniformArray)) {\n continue;\n }\n\n locations = uniformArray._locations;\n\n // On the Nexus 4 in Chrome, we get one uniform per sampler, just like in Firefox,\n // but the size is not 1 like it is in Firefox. So if we push locations here,\n // we'll end up adding too many locations.\n if (locations.length <= 1) {\n value = uniformArray.value;\n loc = gl.getUniformLocation(program, uniformName);\n\n // Workaround for IE 11.0.9. See above.\n if (loc !== null) {\n locations.push(loc);\n value.push(gl.getUniform(program, loc));\n }\n }\n } else {\n locations = [];\n for (let j = 0; j < activeUniform.size; ++j) {\n loc = gl.getUniformLocation(program, `${uniformName}[${j}]`);\n\n // Workaround for IE 11.0.9. See above.\n if (loc !== null) {\n locations.push(loc);\n }\n }\n uniformArray = createUniformArray(\n gl,\n activeUniform,\n uniformName,\n locations\n );\n\n uniformsByName[uniformName] = uniformArray;\n uniforms.push(uniformArray);\n\n if (uniformArray._setSampler) {\n samplerUniforms.push(uniformArray);\n }\n }\n }\n }\n }\n\n return {\n uniformsByName: uniformsByName,\n uniforms: uniforms,\n samplerUniforms: samplerUniforms,\n };\n}\n\nfunction partitionUniforms(shader, uniforms) {\n const automaticUniforms = [];\n const manualUniforms = [];\n\n for (const uniform in uniforms) {\n if (uniforms.hasOwnProperty(uniform)) {\n const uniformObject = uniforms[uniform];\n let uniformName = uniform;\n // if it's a duplicate uniform, use its original name so it is updated correctly\n const duplicateUniform = shader._duplicateUniformNames[uniformName];\n if (defined(duplicateUniform)) {\n uniformObject.name = duplicateUniform;\n uniformName = duplicateUniform;\n }\n const automaticUniform = AutomaticUniforms[uniformName];\n if (defined(automaticUniform)) {\n automaticUniforms.push({\n uniform: uniformObject,\n automaticUniform: automaticUniform,\n });\n } else {\n manualUniforms.push(uniformObject);\n }\n }\n }\n\n return {\n automaticUniforms: automaticUniforms,\n manualUniforms: manualUniforms,\n };\n}\n\nfunction setSamplerUniforms(gl, program, samplerUniforms) {\n gl.useProgram(program);\n\n let textureUnitIndex = 0;\n const length = samplerUniforms.length;\n for (let i = 0; i < length; ++i) {\n textureUnitIndex = samplerUniforms[i]._setSampler(textureUnitIndex);\n }\n\n gl.useProgram(null);\n\n return textureUnitIndex;\n}\n\nfunction initialize(shader) {\n if (defined(shader._program)) {\n return;\n }\n\n reinitialize(shader);\n}\n\nfunction reinitialize(shader) {\n const oldProgram = shader._program;\n\n const gl = shader._gl;\n const program = createAndLinkProgram(gl, shader, shader._debugShaders);\n const numberOfVertexAttributes = gl.getProgramParameter(\n program,\n gl.ACTIVE_ATTRIBUTES\n );\n const uniforms = findUniforms(gl, program);\n const partitionedUniforms = partitionUniforms(\n shader,\n uniforms.uniformsByName\n );\n\n shader._program = program;\n shader._numberOfVertexAttributes = numberOfVertexAttributes;\n shader._vertexAttributes = findVertexAttributes(\n gl,\n program,\n numberOfVertexAttributes\n );\n shader._uniformsByName = uniforms.uniformsByName;\n shader._uniforms = uniforms.uniforms;\n shader._automaticUniforms = partitionedUniforms.automaticUniforms;\n shader._manualUniforms = partitionedUniforms.manualUniforms;\n\n shader.maximumTextureUnitIndex = setSamplerUniforms(\n gl,\n program,\n uniforms.samplerUniforms\n );\n\n if (oldProgram) {\n shader._gl.deleteProgram(oldProgram);\n }\n\n // If SpectorJS is active, add the hook to make the shader editor work.\n // https://github.com/BabylonJS/Spector.js/blob/master/documentation/extension.md#shader-editor\n if (typeof spector !== \"undefined\") {\n shader._program.__SPECTOR_rebuildProgram = function (\n vertexSourceCode, // The new vertex shader source\n fragmentSourceCode, // The new fragment shader source\n onCompiled, // Callback triggered by your engine when the compilation is successful. It needs to send back the new linked program.\n onError // Callback triggered by your engine in case of error. It needs to send the WebGL error to allow the editor to display the error in the gutter.\n ) {\n const originalVS = shader._vertexShaderText;\n const originalFS = shader._fragmentShaderText;\n\n // SpectorJS likes to replace `!=` with `! =` for unknown reasons,\n // and that causes glsl compile failures. So fix that up.\n const regex = / ! = /g;\n shader._vertexShaderText = vertexSourceCode.replace(regex, \" != \");\n shader._fragmentShaderText = fragmentSourceCode.replace(regex, \" != \");\n\n try {\n reinitialize(shader);\n onCompiled(shader._program);\n } catch (e) {\n shader._vertexShaderText = originalVS;\n shader._fragmentShaderText = originalFS;\n\n // Only pass on the WebGL error:\n const errorMatcher = /(?:Compile|Link) error: ([^]*)/;\n const match = errorMatcher.exec(e.message);\n if (match) {\n onError(match[1]);\n } else {\n onError(e.message);\n }\n }\n };\n }\n}\n\nShaderProgram.prototype._bind = function () {\n initialize(this);\n this._gl.useProgram(this._program);\n};\n\nShaderProgram.prototype._setUniforms = function (\n uniformMap,\n uniformState,\n validate\n) {\n let len;\n let i;\n\n if (defined(uniformMap)) {\n const manualUniforms = this._manualUniforms;\n len = manualUniforms.length;\n for (i = 0; i < len; ++i) {\n const mu = manualUniforms[i];\n mu.value = uniformMap[mu.name]();\n }\n }\n\n const automaticUniforms = this._automaticUniforms;\n len = automaticUniforms.length;\n for (i = 0; i < len; ++i) {\n const au = automaticUniforms[i];\n au.uniform.value = au.automaticUniform.getValue(uniformState);\n }\n\n ///////////////////////////////////////////////////////////////////\n\n // It appears that assigning the uniform values above and then setting them here\n // (which makes the GL calls) is faster than removing this loop and making\n // the GL calls above. I suspect this is because each GL call pollutes the\n // L2 cache making our JavaScript and the browser/driver ping-pong cache lines.\n const uniforms = this._uniforms;\n len = uniforms.length;\n for (i = 0; i < len; ++i) {\n uniforms[i].set();\n }\n\n if (validate) {\n const gl = this._gl;\n const program = this._program;\n\n gl.validateProgram(program);\n}\n};\n\nShaderProgram.prototype.isDestroyed = function () {\n return false;\n};\n\nShaderProgram.prototype.destroy = function () {\n this._cachedShader.cache.releaseShaderProgram(this);\n return undefined;\n};\n\nShaderProgram.prototype.finalDestroy = function () {\n this._gl.deleteProgram(this._program);\n return destroyObject(this);\n};\nexport default ShaderProgram;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A function to port GLSL shaders from GLSL ES 1.00 to GLSL ES 3.00\n *\n * This function is nowhere near comprehensive or complete. It just\n * handles some common cases.\n *\n * Note that this function requires the presence of the\n * \"#define OUTPUT_DECLARATION\" line that is appended\n * by ShaderSource.\n *\n * @private\n */\nfunction modernizeShader(source, isFragmentShader) {\n const outputDeclarationRegex = /#define OUTPUT_DECLARATION/;\n const splitSource = source.split(\"\\n\");\n\n if (/#version 300 es/g.test(source)) {\n return source;\n }\n\n let outputDeclarationLine = -1;\n let i, line;\n for (i = 0; i < splitSource.length; ++i) {\n line = splitSource[i];\n if (outputDeclarationRegex.test(line)) {\n outputDeclarationLine = i;\n break;\n }\n }\n\n if (outputDeclarationLine === -1) {\n throw new DeveloperError(\"Could not find a #define OUTPUT_DECLARATION!\");\n }\n\n const outputVariables = [];\n\n for (i = 0; i < 10; i++) {\n const fragDataString = `gl_FragData\\\\[${i}\\\\]`;\n const newOutput = `czm_out${i}`;\n const regex = new RegExp(fragDataString, \"g\");\n if (regex.test(source)) {\n setAdd(newOutput, outputVariables);\n replaceInSourceString(fragDataString, newOutput, splitSource);\n splitSource.splice(\n outputDeclarationLine,\n 0,\n `layout(location = ${i}) out vec4 ${newOutput};`\n );\n outputDeclarationLine += 1;\n }\n }\n\n const czmFragColor = \"czm_fragColor\";\n if (findInSource(\"gl_FragColor\", splitSource)) {\n setAdd(czmFragColor, outputVariables);\n replaceInSourceString(\"gl_FragColor\", czmFragColor, splitSource);\n splitSource.splice(\n outputDeclarationLine,\n 0,\n \"layout(location = 0) out vec4 czm_fragColor;\"\n );\n outputDeclarationLine += 1;\n }\n\n const variableMap = getVariablePreprocessorBranch(\n outputVariables,\n splitSource\n );\n const lineAdds = {};\n for (i = 0; i < splitSource.length; i++) {\n line = splitSource[i];\n for (const variable in variableMap) {\n if (variableMap.hasOwnProperty(variable)) {\n const matchVar = new RegExp(\n `(layout)[^]+(out)[^]+(${variable})[^]+`,\n \"g\"\n );\n if (matchVar.test(line)) {\n lineAdds[line] = variable;\n }\n }\n }\n }\n\n for (const layoutDeclaration in lineAdds) {\n if (lineAdds.hasOwnProperty(layoutDeclaration)) {\n const variableName = lineAdds[layoutDeclaration];\n let lineNumber = splitSource.indexOf(layoutDeclaration);\n const entry = variableMap[variableName];\n const depth = entry.length;\n for (let d = 0; d < depth; d++) {\n splitSource.splice(lineNumber, 0, entry[d]);\n }\n lineNumber += depth + 1;\n for (let d = depth - 1; d >= 0; d--) {\n splitSource.splice(lineNumber, 0, `#endif //${entry[d]}`);\n }\n }\n }\n\n const webgl2UniqueID = \"WEBGL_2\";\n const webgl2DefineMacro = `#define ${webgl2UniqueID}`;\n const versionThree = \"#version 300 es\";\n let foundVersion = false;\n for (i = 0; i < splitSource.length; i++) {\n if (/#version/.test(splitSource[i])) {\n splitSource[i] = versionThree;\n foundVersion = true;\n break;\n }\n }\n\n if (!foundVersion) {\n splitSource.splice(0, 0, versionThree);\n }\n\n splitSource.splice(1, 0, webgl2DefineMacro);\n\n removeExtension(\"EXT_draw_buffers\", webgl2UniqueID, splitSource);\n removeExtension(\"EXT_frag_depth\", webgl2UniqueID, splitSource);\n removeExtension(\"OES_standard_derivatives\", webgl2UniqueID, splitSource);\n\n replaceInSourceString(\"texture2D\", \"texture\", splitSource);\n replaceInSourceString(\"texture3D\", \"texture\", splitSource);\n replaceInSourceString(\"textureCube\", \"texture\", splitSource);\n replaceInSourceString(\"gl_FragDepthEXT\", \"gl_FragDepth\", splitSource);\n\n if (isFragmentShader) {\n replaceInSourceString(\"varying\", \"in\", splitSource);\n } else {\n replaceInSourceString(\"attribute\", \"in\", splitSource);\n replaceInSourceString(\"varying\", \"out\", splitSource);\n }\n\n return compileSource(splitSource);\n}\n\n// Note that this fails if your string looks like\n// searchString[singleCharacter]searchString\nfunction replaceInSourceString(str, replacement, splitSource) {\n const regexStr = `(^|[^\\\\w])(${str})($|[^\\\\w])`;\n const regex = new RegExp(regexStr, \"g\");\n\n const splitSourceLength = splitSource.length;\n for (let i = 0; i < splitSourceLength; ++i) {\n const line = splitSource[i];\n splitSource[i] = line.replace(regex, `$1${replacement}$3`);\n }\n}\n\nfunction replaceInSourceRegex(regex, replacement, splitSource) {\n const splitSourceLength = splitSource.length;\n for (let i = 0; i < splitSourceLength; ++i) {\n const line = splitSource[i];\n splitSource[i] = line.replace(regex, replacement);\n }\n}\n\nfunction findInSource(str, splitSource) {\n const regexStr = `(^|[^\\\\w])(${str})($|[^\\\\w])`;\n const regex = new RegExp(regexStr, \"g\");\n\n const splitSourceLength = splitSource.length;\n for (let i = 0; i < splitSourceLength; ++i) {\n const line = splitSource[i];\n if (regex.test(line)) {\n return true;\n }\n }\n return false;\n}\n\nfunction compileSource(splitSource) {\n let wholeSource = \"\";\n\n const splitSourceLength = splitSource.length;\n for (let i = 0; i < splitSourceLength; ++i) {\n wholeSource += `${splitSource[i]}\\n`;\n }\n return wholeSource;\n}\n\nfunction setAdd(variable, set) {\n if (set.indexOf(variable) === -1) {\n set.push(variable);\n }\n}\n\nfunction getVariablePreprocessorBranch(layoutVariables, splitSource) {\n const variableMap = {};\n\n const numLayoutVariables = layoutVariables.length;\n\n const stack = [];\n for (let i = 0; i < splitSource.length; ++i) {\n const line = splitSource[i];\n const hasIF = /(#ifdef|#if)/g.test(line);\n const hasELSE = /#else/g.test(line);\n const hasENDIF = /#endif/g.test(line);\n\n if (hasIF) {\n stack.push(line);\n } else if (hasELSE) {\n const top = stack[stack.length - 1];\n let op = top.replace(\"ifdef\", \"ifndef\");\n if (/if/g.test(op)) {\n op = op.replace(/(#if\\s+)(\\S*)([^]*)/, \"$1!($2)$3\");\n }\n stack.pop();\n stack.push(op);\n } else if (hasENDIF) {\n stack.pop();\n } else if (!/layout/g.test(line)) {\n for (let varIndex = 0; varIndex < numLayoutVariables; ++varIndex) {\n const varName = layoutVariables[varIndex];\n if (line.indexOf(varName) !== -1) {\n if (!defined(variableMap[varName])) {\n variableMap[varName] = stack.slice();\n } else {\n variableMap[varName] = variableMap[varName].filter(function (x) {\n return stack.indexOf(x) >= 0;\n });\n }\n }\n }\n }\n }\n\n return variableMap;\n}\n\nfunction removeExtension(name, webgl2UniqueID, splitSource) {\n const regex = `#extension\\\\s+GL_${name}\\\\s+:\\\\s+[a-zA-Z0-9]+\\\\s*$`;\n replaceInSourceRegex(new RegExp(regex, \"g\"), \"\", splitSource);\n\n // replace any possible directive #ifdef (GL_EXT_extension) with WEBGL_2 unique directive\n replaceInSourceString(`GL_${name}`, webgl2UniqueID, splitSource);\n}\nexport default modernizeShader;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_degreesPerRadian = 57.29577951308232;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon1 = 0.1;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon2 = 0.01;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon3 = 0.001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon4 = 0.0001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon5 = 0.00001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon6 = 0.000001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_epsilon7 = 0.0000001;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_infinity = 5906376272000.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_oneOverPi = 0.3183098861837907;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_oneOverTwoPi = 0.15915494309189535;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passCesium3DTile = 4.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passCesium3DTileClassification = 5.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passClassification = 7.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passCompute = 1.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passEnvironment = 0.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passGlobe = 2.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passOpaque = 7.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passOverlay = 9.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passTerrainClassification = 3.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_passTranslucent = 8.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_pi = 3.141592653589793;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_piOverFour = 0.7853981633974483;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_piOverSix = 0.5235987755982988;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_piOverThree = 1.0471975511965976;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_piOverTwo = 1.5707963267948966;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_radiansPerDegree = 0.017453292519943295;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_sceneMode2D = 2.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_sceneMode3D = 3.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_sceneModeColumbusView = 1.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_sceneModeMorphing = 0.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_solarRadius = 695500000.0;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_threePiOver2 = 4.71238898038469;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_twoPi = 6.283185307179586;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_depthRangeStruct\\n\\\n{\\n\\\nfloat near;\\n\\\nfloat far;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_material\\n\\\n{\\n\\\nvec3 diffuse;\\n\\\nfloat specular;\\n\\\nfloat shininess;\\n\\\nvec3 normal;\\n\\\nvec3 emission;\\n\\\nfloat alpha;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_materialInput\\n\\\n{\\n\\\nfloat s;\\n\\\nvec2 st;\\n\\\nvec3 str;\\n\\\nvec3 normalEC;\\n\\\nmat3 tangentToEyeMatrix;\\n\\\nvec3 positionToEyeEC;\\n\\\nfloat height;\\n\\\nfloat slope;\\n\\\nfloat aspect;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_modelMaterial {\\n\\\nvec3 diffuse;\\n\\\nfloat alpha;\\n\\\nvec3 specular;\\n\\\nfloat roughness;\\n\\\nvec3 normalEC;\\n\\\nfloat occlusion;\\n\\\nvec3 emissive;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_modelVertexOutput {\\n\\\nvec3 positionMC;\\n\\\nfloat pointSize;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_pbrParameters\\n\\\n{\\n\\\nvec3 diffuseColor;\\n\\\nfloat roughness;\\n\\\nvec3 f0;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_ray\\n\\\n{\\n\\\nvec3 origin;\\n\\\nvec3 direction;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_raySegment\\n\\\n{\\n\\\nfloat start;\\n\\\nfloat stop;\\n\\\n};\\n\\\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\\n\\\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"struct czm_shadowParameters\\n\\\n{\\n\\\n#ifdef USE_CUBE_MAP_SHADOW\\n\\\nvec3 texCoords;\\n\\\n#else\\n\\\nvec2 texCoords;\\n\\\n#endif\\n\\\nfloat depthBias;\\n\\\nfloat depth;\\n\\\nfloat nDotL;\\n\\\nvec2 texelStepSize;\\n\\\nfloat normalShadingSmooth;\\n\\\nfloat darkness;\\n\\\n};\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_acesTonemapping(vec3 color) {\\n\\\nfloat g = 0.985;\\n\\\nfloat a = 0.065;\\n\\\nfloat b = 0.0001;\\n\\\nfloat c = 0.433;\\n\\\nfloat d = 0.238;\\n\\\ncolor = (color * (color + a) - b) / (color * (g * color + c) + d);\\n\\\ncolor = clamp(color, 0.0, 1.0);\\n\\\nreturn color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_alphaWeight(float a)\\n\\\n{\\n\\\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\\n\\\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\\n\\\n{\\n\\\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\\n\\\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\\n\\\nval1 = val1 * (1.0 - val2);\\n\\\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\\n\\\nval1 = pow(val1, 0.5);\\n\\\nvec4 midColor = (color1 + color2) * 0.5;\\n\\\nreturn mix(midColor, currentColor, val1);\\n\\\n}\\n\\\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\\n\\\n{\\n\\\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 czm_approximateSphericalCoordinates(vec3 normal) {\\n\\\nfloat latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\\n\\\nfloat longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\\n\\\nreturn vec2(latitudeApproximation, longitudeApproximation);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool czm_backFacing()\\n\\\n{\\n\\\nreturn gl_FrontFacing == false;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_branchFreeTernary(bool comparison, float a, float b) {\\n\\\nfloat useA = float(comparison);\\n\\\nreturn a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\\n\\\nfloat useA = float(comparison);\\n\\\nreturn a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\\n\\\nfloat useA = float(comparison);\\n\\\nreturn a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\\n\\\nfloat useA = float(comparison);\\n\\\nreturn a * useA + b * (1.0 - useA);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_cascadeColor(vec4 weights)\\n\\\n{\\n\\\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\\n\\\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\\n\\\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\\n\\\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 shadowMap_cascadeDistances;\\n\\\nfloat czm_cascadeDistance(vec4 weights)\\n\\\n{\\n\\\nreturn dot(shadowMap_cascadeDistances, weights);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform mat4 shadowMap_cascadeMatrices[4];\\n\\\nmat4 czm_cascadeMatrix(vec4 weights)\\n\\\n{\\n\\\nreturn shadowMap_cascadeMatrices[0] * weights.x +\\n\\\nshadowMap_cascadeMatrices[1] * weights.y +\\n\\\nshadowMap_cascadeMatrices[2] * weights.z +\\n\\\nshadowMap_cascadeMatrices[3] * weights.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 shadowMap_cascadeSplits[2];\\n\\\nvec4 czm_cascadeWeights(float depthEye)\\n\\\n{\\n\\\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\\n\\\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\\n\\\nreturn near * far;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\\n\\\n{\\n\\\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\\n\\\nreturn vec4(p, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_computePosition();\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 cordic(float angle)\\n\\\n{\\n\\\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\\n\\\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 7.8539816339744828e-1;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfloat factor = sense * 5.0e-1;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 4.6364760900080609e-1;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 2.5e-1;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 2.4497866312686414e-1;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.25e-1;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.2435499454676144e-1;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 6.25e-2;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 6.2418809995957350e-2;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 3.125e-2;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 3.1239833430268277e-2;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.5625e-2;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.5623728620476831e-2;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 7.8125e-3;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 7.8123410601011111e-3;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 3.90625e-3;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 3.9062301319669718e-3;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.953125e-3;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.9531225164788188e-3;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 9.765625e-4;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 9.7656218955931946e-4;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 4.8828125e-4;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 4.8828121119489829e-4;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 2.44140625e-4;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 2.4414062014936177e-4;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.220703125e-4;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.2207031189367021e-4;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 6.103515625e-5;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 6.1035156174208773e-5;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 3.0517578125e-5;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 3.0517578115526096e-5;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.52587890625e-5;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.5258789061315762e-5;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 7.62939453125e-6;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 7.6293945311019700e-6;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 3.814697265625e-6;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 3.8146972656064961e-6;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.9073486328125e-6;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 1.9073486328101870e-6;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 9.5367431640625e-7;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 9.5367431640596084e-7;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 4.76837158203125e-7;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 4.7683715820308884e-7;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 2.384185791015625e-7;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nangle -= sense * 2.3841857910155797e-7;\\n\\\nsense = (angle < 0.0) ? -1.0 : 1.0;\\n\\\nfactor = sense * 1.1920928955078125e-7;\\n\\\nrotation[0][1] = factor;\\n\\\nrotation[1][0] = -factor;\\n\\\nvector = rotation * vector;\\n\\\nreturn vector;\\n\\\n}\\n\\\nvec2 czm_cosineAndSine(float angle)\\n\\\n{\\n\\\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\\n\\\n{\\n\\\nif (angle < 0.0)\\n\\\n{\\n\\\nreturn -cordic(angle + czm_pi);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nreturn -cordic(angle - czm_pi);\\n\\\n}\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nreturn cordic(angle);\\n\\\n}\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 czm_decompressTextureCoordinates(float encoded)\\n\\\n{\\n\\\nfloat temp = encoded / 4096.0;\\n\\\nfloat xZeroTo4095 = floor(temp);\\n\\\nfloat stx = xZeroTo4095 / 4095.0;\\n\\\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\\n\\\nreturn vec2(stx, sty);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_pbrParameters czm_defaultPbrMaterial()\\n\\\n{\\n\\\nczm_pbrParameters results;\\n\\\nresults.diffuseColor = vec3(1.0);\\n\\\nresults.roughness = 1.0;\\n\\\nconst vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\\n\\\nresults.f0 = REFLECTANCE_DIELECTRIC;\\n\\\nreturn results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\\n\\\nvarying float v_WindowZ;\\n\\\n#endif\\n\\\nvec4 czm_depthClamp(vec4 coords)\\n\\\n{\\n\\\n#ifndef LOG_DEPTH\\n\\\n#ifdef GL_EXT_frag_depth\\n\\\nv_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\\n\\\ncoords.z = 0.0;\\n\\\n#else\\n\\\ncoords.z = min(coords.z, coords.w);\\n\\\n#endif\\n\\\n#endif\\n\\\nreturn coords;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\\n\\\n{\\n\\\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\\n\\\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\\n\\\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\\n\\\nreturn mat3(\\n\\\ntangentEC.x, tangentEC.y, tangentEC.z,\\n\\\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\\n\\\nnormalEC.x, normalEC.y, normalEC.z);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\\n\\\n{\\n\\\nvec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\\n\\\nreturn (dot(scaled, scaled) <= 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\\n\\\n{\\n\\\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\\n\\\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\\n\\\n}\\n\\\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\\n\\\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\\n\\\n}\\n\\\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\\n\\\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\\n\\\n}\\n\\\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\\n\\\nreturn (abs(left - right) <= epsilon);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\\n\\\n{\\n\\\nvec4 p = positionEC;\\n\\\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\\n\\\np.xy += eyeOffset.xy + zEyeOffset.xy;\\n\\\np.z += zEyeOffset.z;\\n\\\nreturn p;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\\n\\\n{\\n\\\nvec4 q = czm_projection * positionEC;\\n\\\nq.xyz /= q.w;\\n\\\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\\n\\\nreturn q;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_fastApproximateAtan(float x) {\\n\\\nreturn x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\\n\\\n}\\n\\\nfloat czm_fastApproximateAtan(float x, float y) {\\n\\\nfloat t = abs(x);\\n\\\nfloat opposite = abs(y);\\n\\\nfloat adjacent = max(t, opposite);\\n\\\nopposite = min(t, opposite);\\n\\\nt = czm_fastApproximateAtan(opposite / adjacent);\\n\\\nt = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\\n\\\nt = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\\n\\\nt = czm_branchFreeTernary(y < 0.0, -t, t);\\n\\\nreturn t;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\\n\\\n{\\n\\\nfloat scalar = distanceToCamera * czm_fogDensity;\\n\\\nfloat fog = 1.0 - exp(-(scalar * scalar));\\n\\\nreturn mix(color, fogColor, fog);\\n\\\n}\\n\\\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\\n\\\n{\\n\\\nfloat scalar = distanceToCamera * czm_fogDensity;\\n\\\nfloat fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\\n\\\nreturn mix(color, fogColor, fog);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_gammaCorrect(vec3 color) {\\n\\\n#ifdef HDR\\n\\\ncolor = pow(color, vec3(czm_gamma));\\n\\\n#endif\\n\\\nreturn color;\\n\\\n}\\n\\\nvec4 czm_gammaCorrect(vec4 color) {\\n\\\n#ifdef HDR\\n\\\ncolor.rgb = pow(color.rgb, vec3(czm_gamma));\\n\\\n#endif\\n\\\nreturn color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\\n\\\n{\\n\\\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\nczm_material material;\\n\\\nmaterial.diffuse = vec3(0.0);\\n\\\nmaterial.specular = 0.0;\\n\\\nmaterial.shininess = 1.0;\\n\\\nmaterial.normal = materialInput.normalEC;\\n\\\nmaterial.emission = vec3(0.0);\\n\\\nmaterial.alpha = 1.0;\\n\\\nreturn material;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\\n\\\n{\\n\\\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\\n\\\n{\\n\\\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\\n\\\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\\n\\\nreturn pow(specular, max(shininess, czm_epsilon2));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\\n\\\n{\\n\\\nfloat cosAngle = cos(angleInRadians);\\n\\\nfloat sinAngle = sin(angleInRadians);\\n\\\nvec2 s0 = vec2(1.0/17.0, 0.0);\\n\\\nvec2 s1 = vec2(-1.0/29.0, 0.0);\\n\\\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\\n\\\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\\n\\\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\\n\\\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\\n\\\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\\n\\\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\\n\\\nvec2 uv0 = (uv/103.0) + (time * s0);\\n\\\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\\n\\\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\\n\\\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\\n\\\nuv0 = fract(uv0);\\n\\\nuv1 = fract(uv1);\\n\\\nuv2 = fract(uv2);\\n\\\nuv3 = fract(uv3);\\n\\\nvec4 noise = (texture2D(normalMap, uv0)) +\\n\\\n(texture2D(normalMap, uv1)) +\\n\\\n(texture2D(normalMap, uv2)) +\\n\\\n(texture2D(normalMap, uv3));\\n\\\nreturn ((noise / 4.0) - 0.5) * 2.0;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\\n\\\nvec3 czm_HSBToRGB(vec3 hsb)\\n\\\n{\\n\\\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\\n\\\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 hueToRGB(float hue)\\n\\\n{\\n\\\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\\n\\\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\\n\\\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\\n\\\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\\n\\\n}\\n\\\nvec3 czm_HSLToRGB(vec3 hsl)\\n\\\n{\\n\\\nvec3 rgb = hueToRGB(hsl.x);\\n\\\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\\n\\\nreturn (rgb - 0.5) * c + hsl.z;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_hue(vec3 rgb, float adjustment)\\n\\\n{\\n\\\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\\n\\\n0.595716, -0.274453, -0.321263,\\n\\\n0.211456, -0.522591, 0.311135);\\n\\\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\\n\\\n1.0, -0.2721, -0.6474,\\n\\\n1.0, -1.107, 1.7046);\\n\\\nvec3 yiq = toYIQ * rgb;\\n\\\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\\n\\\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\\n\\\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\\n\\\nreturn toRGB * color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_inverseGamma(vec3 color) {\\n\\\nreturn pow(color, vec3(1.0 / czm_gamma));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool czm_isEmpty(czm_raySegment interval)\\n\\\n{\\n\\\nreturn (interval.stop < 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool czm_isFull(czm_raySegment interval)\\n\\\n{\\n\\\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\\n\\\n{\\n\\\nfloat sinLatitude = sin(latitude);\\n\\\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\\n\\\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_linearToSrgb(vec3 linearIn)\\n\\\n{\\n\\\nreturn pow(linearIn, vec3(1.0/2.2));\\n\\\n}\\n\\\nvec4 czm_linearToSrgb(vec4 linearIn)\\n\\\n{\\n\\\nvec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));\\n\\\nreturn vec4(srgbOut, linearIn.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\\n\\\nreturn abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_luminance(vec3 rgb)\\n\\\n{\\n\\\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\nreturn dot(rgb, W);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_metersPerPixel(vec4 positionEC, float pixelRatio)\\n\\\n{\\n\\\nfloat width = czm_viewport.z;\\n\\\nfloat height = czm_viewport.w;\\n\\\nfloat pixelWidth;\\n\\\nfloat pixelHeight;\\n\\\nfloat top = czm_frustumPlanes.x;\\n\\\nfloat bottom = czm_frustumPlanes.y;\\n\\\nfloat left = czm_frustumPlanes.z;\\n\\\nfloat right = czm_frustumPlanes.w;\\n\\\nif (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\\n\\\n{\\n\\\nfloat frustumWidth = right - left;\\n\\\nfloat frustumHeight = top - bottom;\\n\\\npixelWidth = frustumWidth / width;\\n\\\npixelHeight = frustumHeight / height;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat distanceToPixel = -positionEC.z;\\n\\\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\\n\\\nfloat tanTheta = top * inverseNear;\\n\\\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\\n\\\ntanTheta = right * inverseNear;\\n\\\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\\n\\\n}\\n\\\nreturn max(pixelWidth, pixelHeight) * pixelRatio;\\n\\\n}\\n\\\nfloat czm_metersPerPixel(vec4 positionEC)\\n\\\n{\\n\\\nreturn czm_metersPerPixel(positionEC, czm_pixelRatio);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_modelToWindowCoordinates(vec4 position)\\n\\\n{\\n\\\nvec4 q = czm_modelViewProjection * position;\\n\\\nq.xyz /= q.w;\\n\\\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\\n\\\nreturn q;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\\n\\\n{\\n\\\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\nvec3 target = left * right;\\n\\\nfloat leftLuminance = dot(left, W);\\n\\\nfloat rightLuminance = dot(right, W);\\n\\\nfloat targetLuminance = dot(target, W);\\n\\\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\\n\\\n{\\n\\\nfloat valueAtMin = nearFarScalar.y;\\n\\\nfloat valueAtMax = nearFarScalar.w;\\n\\\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\\n\\\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\\n\\\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\\n\\\nt = pow(clamp(t, 0.0, 1.0), 0.2);\\n\\\nreturn mix(valueAtMin, valueAtMax, t);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_octDecode(vec2 encoded, float range)\\n\\\n{\\n\\\nif (encoded.x == 0.0 && encoded.y == 0.0) {\\n\\\nreturn vec3(0.0, 0.0, 0.0);\\n\\\n}\\n\\\nencoded = encoded / range * 2.0 - 1.0;\\n\\\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\\n\\\nif (v.z < 0.0)\\n\\\n{\\n\\\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\\n\\\n}\\n\\\nreturn normalize(v);\\n\\\n}\\n\\\nvec3 czm_octDecode(vec2 encoded)\\n\\\n{\\n\\\nreturn czm_octDecode(encoded, 255.0);\\n\\\n}\\n\\\nvec3 czm_octDecode(float encoded)\\n\\\n{\\n\\\nfloat temp = encoded / 256.0;\\n\\\nfloat x = floor(temp);\\n\\\nfloat y = (temp - x) * 256.0;\\n\\\nreturn czm_octDecode(vec2(x, y));\\n\\\n}\\n\\\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\\n\\\n{\\n\\\nfloat temp = encoded.x / 65536.0;\\n\\\nfloat x = floor(temp);\\n\\\nfloat encodedFloat1 = (temp - x) * 65536.0;\\n\\\ntemp = encoded.y / 65536.0;\\n\\\nfloat y = floor(temp);\\n\\\nfloat encodedFloat2 = (temp - y) * 65536.0;\\n\\\nvector1 = czm_octDecode(encodedFloat1);\\n\\\nvector2 = czm_octDecode(encodedFloat2);\\n\\\nvector3 = czm_octDecode(vec2(x, y));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_packDepth(float depth)\\n\\\n{\\n\\\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\\n\\\nenc = fract(enc);\\n\\\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\\n\\\nreturn enc;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 lambertianDiffuse(vec3 diffuseColor)\\n\\\n{\\n\\\nreturn diffuseColor / czm_pi;\\n\\\n}\\n\\\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\\n\\\n{\\n\\\nreturn f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\\n\\\n}\\n\\\nfloat smithVisibilityG1(float NdotV, float roughness)\\n\\\n{\\n\\\nfloat k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\\n\\\nreturn NdotV / (NdotV * (1.0 - k) + k);\\n\\\n}\\n\\\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\\n\\\n{\\n\\\nreturn (\\n\\\nsmithVisibilityG1(NdotL, roughness) *\\n\\\nsmithVisibilityG1(NdotV, roughness)\\n\\\n);\\n\\\n}\\n\\\nfloat GGX(float roughness, float NdotH)\\n\\\n{\\n\\\nfloat roughnessSquared = roughness * roughness;\\n\\\nfloat f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\\n\\\nreturn roughnessSquared / (czm_pi * f * f);\\n\\\n}\\n\\\nvec3 czm_pbrLighting(\\n\\\nvec3 positionEC,\\n\\\nvec3 normalEC,\\n\\\nvec3 lightDirectionEC,\\n\\\nvec3 lightColorHdr,\\n\\\nczm_pbrParameters pbrParameters\\n\\\n)\\n\\\n{\\n\\\nvec3 v = -normalize(positionEC);\\n\\\nvec3 l = normalize(lightDirectionEC);\\n\\\nvec3 h = normalize(v + l);\\n\\\nvec3 n = normalEC;\\n\\\nfloat NdotL = clamp(dot(n, l), 0.001, 1.0);\\n\\\nfloat NdotV = abs(dot(n, v)) + 0.001;\\n\\\nfloat NdotH = clamp(dot(n, h), 0.0, 1.0);\\n\\\nfloat LdotH = clamp(dot(l, h), 0.0, 1.0);\\n\\\nfloat VdotH = clamp(dot(v, h), 0.0, 1.0);\\n\\\nvec3 f0 = pbrParameters.f0;\\n\\\nfloat reflectance = max(max(f0.r, f0.g), f0.b);\\n\\\nvec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\\n\\\nvec3 F = fresnelSchlick2(f0, f90, VdotH);\\n\\\nfloat alpha = pbrParameters.roughness;\\n\\\nfloat G = smithVisibilityGGX(alpha, NdotL, NdotV);\\n\\\nfloat D = GGX(alpha, NdotH);\\n\\\nvec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\\n\\\nvec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\nvec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\\n\\\nreturn (diffuseContribution + specularContribution) * NdotL * lightColorHdr;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_pbrParameters czm_pbrMetallicRoughnessMaterial(\\n\\\nvec3 baseColor,\\n\\\nfloat metallic,\\n\\\nfloat roughness\\n\\\n)\\n\\\n{\\n\\\nczm_pbrParameters results;\\n\\\nroughness = clamp(roughness, 0.0, 1.0);\\n\\\nresults.roughness = roughness * roughness;\\n\\\nmetallic = clamp(metallic, 0.0, 1.0);\\n\\\nconst vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\\n\\\nvec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);\\n\\\nresults.f0 = f0;\\n\\\nresults.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);\\n\\\nreturn results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_pbrParameters czm_pbrSpecularGlossinessMaterial(\\n\\\nvec3 diffuse,\\n\\\nvec3 specular,\\n\\\nfloat glossiness\\n\\\n)\\n\\\n{\\n\\\nczm_pbrParameters results;\\n\\\nfloat roughness = 1.0 - glossiness;\\n\\\nresults.roughness = roughness * roughness;\\n\\\nresults.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));\\n\\\nresults.f0 = specular;\\n\\\nreturn results;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\\n\\\n{\\n\\\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\\n\\\n}\\n\\\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\\n\\\n{\\n\\\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\\n\\\n}\\n\\\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\\n\\\nif (czm_sceneMode == czm_sceneMode3D) {\\n\\\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\\n\\\n}\\n\\\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\\n\\\nvec3 materialDiffuse = material.diffuse * 0.5;\\n\\\nvec3 ambient = materialDiffuse;\\n\\\nvec3 color = ambient + material.emission;\\n\\\ncolor += materialDiffuse * diffuse * czm_lightColor;\\n\\\ncolor += material.specular * specular * czm_lightColor;\\n\\\nreturn vec4(color, material.alpha);\\n\\\n}\\n\\\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\\n\\\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\\n\\\nvec3 ambient = vec3(0.0);\\n\\\nvec3 color = ambient + material.emission;\\n\\\ncolor += material.diffuse * diffuse * czm_lightColor;\\n\\\ncolor += material.specular * specular * czm_lightColor;\\n\\\nreturn vec4(color, material.alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_planeDistance(vec4 plane, vec3 point) {\\n\\\nreturn (dot(plane.xyz, point) + plane.w);\\n\\\n}\\n\\\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\\n\\\nreturn (dot(planeNormal, point) + planeDistance);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_pointAlongRay(czm_ray ray, float time)\\n\\\n{\\n\\\nreturn ray.origin + (time * ray.direction);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\\n\\\n{\\n\\\nvec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\\n\\\nvec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\\n\\\nq = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\\n\\\nfloat q2 = dot(q, q);\\n\\\nfloat qw = dot(q, w);\\n\\\nif (q2 > 1.0)\\n\\\n{\\n\\\nif (qw >= 0.0)\\n\\\n{\\n\\\nreturn czm_emptyRaySegment;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat qw2 = qw * qw;\\n\\\nfloat difference = q2 - 1.0;\\n\\\nfloat w2 = dot(w, w);\\n\\\nfloat product = w2 * difference;\\n\\\nif (qw2 < product)\\n\\\n{\\n\\\nreturn czm_emptyRaySegment;\\n\\\n}\\n\\\nelse if (qw2 > product)\\n\\\n{\\n\\\nfloat discriminant = qw * qw - product;\\n\\\nfloat temp = -qw + sqrt(discriminant);\\n\\\nfloat root0 = temp / w2;\\n\\\nfloat root1 = difference / temp;\\n\\\nif (root0 < root1)\\n\\\n{\\n\\\nczm_raySegment i = czm_raySegment(root0, root1);\\n\\\nreturn i;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nczm_raySegment i = czm_raySegment(root1, root0);\\n\\\nreturn i;\\n\\\n}\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat root = sqrt(difference / w2);\\n\\\nczm_raySegment i = czm_raySegment(root, root);\\n\\\nreturn i;\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\nelse if (q2 < 1.0)\\n\\\n{\\n\\\nfloat difference = q2 - 1.0;\\n\\\nfloat w2 = dot(w, w);\\n\\\nfloat product = w2 * difference;\\n\\\nfloat discriminant = qw * qw - product;\\n\\\nfloat temp = -qw + sqrt(discriminant);\\n\\\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\\n\\\nreturn i;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nif (qw < 0.0)\\n\\\n{\\n\\\nfloat w2 = dot(w, w);\\n\\\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\\n\\\nreturn i;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nreturn czm_emptyRaySegment;\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)\\n\\\n{\\n\\\nvec3 o = ray.origin;\\n\\\nvec3 d = ray.direction;\\n\\\nvec3 oc = o - center;\\n\\\nfloat a = dot(d, d);\\n\\\nfloat b = 2.0 * dot(d, oc);\\n\\\nfloat c = dot(oc, oc) - (radius * radius);\\n\\\nfloat det = (b * b) - (4.0 * a * c);\\n\\\nif (det < 0.0) {\\n\\\nreturn czm_emptyRaySegment;\\n\\\n}\\n\\\nfloat sqrtDet = sqrt(det);\\n\\\nfloat t0 = (-b - sqrtDet) / (2.0 * a);\\n\\\nfloat t1 = (-b + sqrtDet) / (2.0 * a);\\n\\\nczm_raySegment result = czm_raySegment(t0, t1);\\n\\\nreturn result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\\n\\\n{\\n\\\nreturn czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_readNonPerspective(float value, float oneOverW) {\\n\\\nreturn value * oneOverW;\\n\\\n}\\n\\\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\\n\\\nreturn value * oneOverW;\\n\\\n}\\n\\\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\\n\\\nreturn value * oneOverW;\\n\\\n}\\n\\\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\\n\\\nreturn value * oneOverW;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_reverseLogDepth(float logZ)\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\nfloat near = czm_currentFrustum.x;\\n\\\nfloat far = czm_currentFrustum.y;\\n\\\nfloat log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\\n\\\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\\n\\\nreturn far * (1.0 - near / (depthFromNear + near)) / (far - near);\\n\\\n#endif\\n\\\nreturn logZ;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\\n\\\nvec3 czm_RGBToHSB(vec3 rgb)\\n\\\n{\\n\\\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\\n\\\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\\n\\\nfloat d = q.x - min(q.w, q.y);\\n\\\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 RGBtoHCV(vec3 rgb)\\n\\\n{\\n\\\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\\n\\\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\\n\\\nfloat c = q.x - min(q.w, q.y);\\n\\\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\\n\\\nreturn vec3(h, c, q.x);\\n\\\n}\\n\\\nvec3 czm_RGBToHSL(vec3 rgb)\\n\\\n{\\n\\\nvec3 hcv = RGBtoHCV(rgb);\\n\\\nfloat l = hcv.z - hcv.y * 0.5;\\n\\\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\\n\\\nreturn vec3(hcv.x, s, l);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_RGBToXYZ(vec3 rgb)\\n\\\n{\\n\\\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\\n\\\n0.3576, 0.7152, 0.1192,\\n\\\n0.1805, 0.0722, 0.9505);\\n\\\nvec3 xyz = RGB2XYZ * rgb;\\n\\\nvec3 Yxy;\\n\\\nYxy.r = xyz.g;\\n\\\nfloat temp = dot(vec3(1.0), xyz);\\n\\\nYxy.gb = xyz.rg / temp;\\n\\\nreturn Yxy;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_round(float value) {\\n\\\nreturn floor(value + 0.5);\\n\\\n}\\n\\\nvec2 czm_round(vec2 value) {\\n\\\nreturn floor(value + 0.5);\\n\\\n}\\n\\\nvec3 czm_round(vec3 value) {\\n\\\nreturn floor(value + 0.5);\\n\\\n}\\n\\\nvec4 czm_round(vec4 value) {\\n\\\nreturn floor(value + 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\\n\\\n{\\n\\\ndirection /= dot(vec3(1.0), abs(direction));\\n\\\nvec2 rev = abs(direction.zx) - vec2(1.0);\\n\\\nvec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\\n\\\ndirection.z < 0.0 ? rev.y : -rev.y);\\n\\\nvec2 uv = direction.y < 0.0 ? neg : direction.xz;\\n\\\nvec2 coord = 0.5 * uv + vec2(0.5);\\n\\\nvec2 pixel = 1.0 / textureSize;\\n\\\nif (lod > 0.0)\\n\\\n{\\n\\\nfloat scale = 1.0 / pow(2.0, lod);\\n\\\nfloat offset = ((textureSize.y + 1.0) / textureSize.x);\\n\\\ncoord.x *= offset;\\n\\\ncoord *= scale;\\n\\\ncoord.x += offset + pixel.x;\\n\\\ncoord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\ncoord.x *= (textureSize.y / textureSize.x);\\n\\\n}\\n\\\n#ifndef OES_texture_float_linear\\n\\\nvec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\\n\\\nvec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\\n\\\nvec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\\n\\\nvec3 color4 = texture2D(projectedMap, coord).rgb;\\n\\\nvec2 texturePosition = coord * textureSize;\\n\\\nfloat fu = fract(texturePosition.x);\\n\\\nfloat fv = fract(texturePosition.y);\\n\\\nvec3 average1 = mix(color4, color2, fu);\\n\\\nvec3 average2 = mix(color1, color3, fu);\\n\\\nvec3 color = mix(average1, average2, fv);\\n\\\n#else\\n\\\nvec3 color = texture2D(projectedMap, coord).rgb;\\n\\\n#endif\\n\\\nreturn color;\\n\\\n}\\n\\\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\\n\\\nfloat currentLod = floor(lod + 0.5);\\n\\\nfloat nextLod = min(currentLod + 1.0, maxLod);\\n\\\nvec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\\n\\\nvec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\\n\\\nreturn mix(colorNextLod, colorCurrentLod, nextLod - lod);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_saturation(vec3 rgb, float adjustment)\\n\\\n{\\n\\\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\\n\\\nvec3 intensity = vec3(dot(rgb, W));\\n\\\nreturn mix(intensity, rgb, adjustment);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\\n\\\n{\\n\\\nreturn czm_unpackDepth(textureCube(shadowMap, d));\\n\\\n}\\n\\\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\\n\\\n{\\n\\\n#ifdef USE_SHADOW_DEPTH_TEXTURE\\n\\\nreturn texture2D(shadowMap, uv).r;\\n\\\n#else\\n\\\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\\n\\\n#endif\\n\\\n}\\n\\\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\\n\\\n{\\n\\\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\\n\\\n}\\n\\\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\\n\\\n{\\n\\\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\\n\\\n{\\n\\\n#ifdef USE_NORMAL_SHADING\\n\\\n#ifdef USE_NORMAL_SHADING_SMOOTH\\n\\\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\\n\\\n#else\\n\\\nfloat strength = step(0.0, nDotL);\\n\\\n#endif\\n\\\nvisibility *= strength;\\n\\\n#endif\\n\\\nvisibility = max(visibility, darkness);\\n\\\nreturn visibility;\\n\\\n}\\n\\\n#ifdef USE_CUBE_MAP_SHADOW\\n\\\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\\n\\\n{\\n\\\nfloat depthBias = shadowParameters.depthBias;\\n\\\nfloat depth = shadowParameters.depth;\\n\\\nfloat nDotL = shadowParameters.nDotL;\\n\\\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\\n\\\nfloat darkness = shadowParameters.darkness;\\n\\\nvec3 uvw = shadowParameters.texCoords;\\n\\\ndepth -= depthBias;\\n\\\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\\n\\\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\\n\\\n}\\n\\\n#else\\n\\\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\\n\\\n{\\n\\\nfloat depthBias = shadowParameters.depthBias;\\n\\\nfloat depth = shadowParameters.depth;\\n\\\nfloat nDotL = shadowParameters.nDotL;\\n\\\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\\n\\\nfloat darkness = shadowParameters.darkness;\\n\\\nvec2 uv = shadowParameters.texCoords;\\n\\\ndepth -= depthBias;\\n\\\n#ifdef USE_SOFT_SHADOWS\\n\\\nvec2 texelStepSize = shadowParameters.texelStepSize;\\n\\\nfloat radius = 1.0;\\n\\\nfloat dx0 = -texelStepSize.x * radius;\\n\\\nfloat dy0 = -texelStepSize.y * radius;\\n\\\nfloat dx1 = texelStepSize.x * radius;\\n\\\nfloat dy1 = texelStepSize.y * radius;\\n\\\nfloat visibility = (\\n\\\nczm_shadowDepthCompare(shadowMap, uv, depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\\n\\\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\\n\\\n) * (1.0 / 9.0);\\n\\\n#else\\n\\\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\\n\\\n#endif\\n\\\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\\n\\\n}\\n\\\n#endif\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_signNotZero(float value)\\n\\\n{\\n\\\nreturn value >= 0.0 ? 1.0 : -1.0;\\n\\\n}\\n\\\nvec2 czm_signNotZero(vec2 value)\\n\\\n{\\n\\\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\\n\\\n}\\n\\\nvec3 czm_signNotZero(vec3 value)\\n\\\n{\\n\\\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\\n\\\n}\\n\\\nvec4 czm_signNotZero(vec4 value)\\n\\\n{\\n\\\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\\n\\\n{\\n\\\nvec3 L00 = coefficients[0];\\n\\\nvec3 L1_1 = coefficients[1];\\n\\\nvec3 L10 = coefficients[2];\\n\\\nvec3 L11 = coefficients[3];\\n\\\nvec3 L2_2 = coefficients[4];\\n\\\nvec3 L2_1 = coefficients[5];\\n\\\nvec3 L20 = coefficients[6];\\n\\\nvec3 L21 = coefficients[7];\\n\\\nvec3 L22 = coefficients[8];\\n\\\nfloat x = normal.x;\\n\\\nfloat y = normal.y;\\n\\\nfloat z = normal.z;\\n\\\nreturn\\n\\\nL00\\n\\\n+ L1_1 * y\\n\\\n+ L10 * z\\n\\\n+ L11 * x\\n\\\n+ L2_2 * (y * x)\\n\\\n+ L2_1 * (y * z)\\n\\\n+ L20 * (3.0 * z * z - 1.0)\\n\\\n+ L21 * (z * x)\\n\\\n+ L22 * (x * x - y * y);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_srgbToLinear(vec3 srgbIn)\\n\\\n{\\n\\\nreturn pow(srgbIn, vec3(2.2));\\n\\\n}\\n\\\nvec4 czm_srgbToLinear(vec4 srgbIn)\\n\\\n{\\n\\\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\\n\\\nreturn vec4(linearOut, srgbIn.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\\n\\\n{\\n\\\nvec3 normal = normalize(normalEC);\\n\\\nvec3 tangent = normalize(tangentEC);\\n\\\nvec3 bitangent = normalize(bitangentEC);\\n\\\nreturn mat3(tangent.x , tangent.y , tangent.z,\\n\\\nbitangent.x, bitangent.y, bitangent.z,\\n\\\nnormal.x , normal.y , normal.z);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_transformPlane(vec4 plane, mat4 transform) {\\n\\\nvec4 transformedPlane = transform * plane;\\n\\\nfloat normalMagnitude = length(transformedPlane.xyz);\\n\\\nreturn transformedPlane / normalMagnitude;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\\n\\\n{\\n\\\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\\n\\\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\\n\\\nreturn vec4(highDifference + lowDifference, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\\n\\\n{\\n\\\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\\n\\\nif (czm_sceneMode == czm_sceneMode3D) {\\n\\\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\\n\\\n}\\n\\\ndiffuse = clamp(diffuse, 0.0, 1.0);\\n\\\nfloat specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\\n\\\nvec3 materialDiffuse = material.diffuse * 0.5;\\n\\\nvec3 ambient = materialDiffuse;\\n\\\nvec3 color = ambient + material.emission;\\n\\\ncolor += materialDiffuse * diffuse * czm_lightColor;\\n\\\ncolor += material.specular * specular * czm_lightColor;\\n\\\nreturn vec4(color, material.alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"mat2 czm_transpose(mat2 matrix)\\n\\\n{\\n\\\nreturn mat2(\\n\\\nmatrix[0][0], matrix[1][0],\\n\\\nmatrix[0][1], matrix[1][1]);\\n\\\n}\\n\\\nmat3 czm_transpose(mat3 matrix)\\n\\\n{\\n\\\nreturn mat3(\\n\\\nmatrix[0][0], matrix[1][0], matrix[2][0],\\n\\\nmatrix[0][1], matrix[1][1], matrix[2][1],\\n\\\nmatrix[0][2], matrix[1][2], matrix[2][2]);\\n\\\n}\\n\\\nmat4 czm_transpose(mat4 matrix)\\n\\\n{\\n\\\nreturn mat4(\\n\\\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\\n\\\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\\n\\\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\\n\\\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_unpackDepth(vec4 packedDepth)\\n\\\n{\\n\\\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_unpackFloat(vec4 packedFloat)\\n\\\n{\\n\\\npackedFloat = floor(packedFloat * 255.0 + 0.5);\\n\\\nfloat sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\\n\\\nfloat exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;\\n\\\nif (exponent == -127.0)\\n\\\n{\\n\\\nreturn 0.0;\\n\\\n}\\n\\\nfloat mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\\n\\\nfloat result = sign * exp2(exponent - 23.0) * mantissa;\\n\\\nreturn result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"int czm_unpackUint(float packedValue) {\\n\\\nfloat rounded = czm_round(packedValue * 255.0);\\n\\\nreturn int(rounded);\\n\\\n}\\n\\\nint czm_unpackUint(vec2 packedValue) {\\n\\\nvec2 rounded = czm_round(packedValue * 255.0);\\n\\\nreturn int(dot(rounded, vec2(1.0, 256.0)));\\n\\\n}\\n\\\nint czm_unpackUint(vec3 packedValue) {\\n\\\nvec3 rounded = czm_round(packedValue * 255.0);\\n\\\nreturn int(dot(rounded, vec3(1.0, 256.0, 65536.0)));\\n\\\n}\\n\\\nint czm_unpackUint(vec4 packedValue) {\\n\\\nvec4 rounded = czm_round(packedValue * 255.0);\\n\\\nreturn int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_valueTransform(float offset, float scale, float value) {\\n\\\nreturn scale * value + offset;\\n\\\n}\\n\\\nvec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\\n\\\nreturn scale * value + offset;\\n\\\n}\\n\\\nvec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\\n\\\nreturn scale * value + offset;\\n\\\n}\\n\\\nvec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\\n\\\nreturn scale * value + offset;\\n\\\n}\\n\\\nmat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\\n\\\nreturn matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\nmat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\\n\\\nreturn matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\nmat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\\n\\\nreturn matrixCompMult(scale, value) + offset;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LOG_DEPTH\\n\\\nvarying float v_depthFromNearPlusOne;\\n\\\n#ifdef SHADOW_MAP\\n\\\nvarying vec3 v_logPositionEC;\\n\\\n#endif\\n\\\n#endif\\n\\\nvec4 czm_updatePositionDepth(vec4 coords) {\\n\\\n#if defined(LOG_DEPTH)\\n\\\n#ifdef SHADOW_MAP\\n\\\nvec3 logPositionEC = (czm_inverseProjection * coords).xyz;\\n\\\nv_logPositionEC = logPositionEC;\\n\\\n#endif\\n\\\ncoords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\\n\\\n#endif\\n\\\nreturn coords;\\n\\\n}\\n\\\nvoid czm_vertexLogDepth()\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\nv_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\\n\\\ngl_Position = czm_updatePositionDepth(gl_Position);\\n\\\n#endif\\n\\\n}\\n\\\nvoid czm_vertexLogDepth(vec4 clipCoords)\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\nv_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\\n\\\nczm_updatePositionDepth(clipCoords);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\\n\\\n{\\n\\\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\\n\\\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\\n\\\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\\n\\\nvec4 q = vec4(x, y, z, 1.0);\\n\\\nq /= fragmentCoordinate.w;\\n\\\nif (!(czm_inverseProjection == mat4(0.0)))\\n\\\n{\\n\\\nq = czm_inverseProjection * q;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat top = czm_frustumPlanes.x;\\n\\\nfloat bottom = czm_frustumPlanes.y;\\n\\\nfloat left = czm_frustumPlanes.z;\\n\\\nfloat right = czm_frustumPlanes.w;\\n\\\nfloat near = czm_currentFrustum.x;\\n\\\nfloat far = czm_currentFrustum.y;\\n\\\nq.x = (q.x * (right - left) + left + right) * 0.5;\\n\\\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\\n\\\nq.z = (q.z * (near - far) - near - far) * 0.5;\\n\\\nq.w = 1.0;\\n\\\n}\\n\\\nreturn q;\\n\\\n}\\n\\\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\\n\\\n{\\n\\\n#ifdef LOG_DEPTH\\n\\\nfloat near = czm_currentFrustum.x;\\n\\\nfloat far = czm_currentFrustum.y;\\n\\\nfloat log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\\n\\\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\\n\\\nfloat depthFromCamera = depthFromNear + near;\\n\\\nvec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\\n\\\neyeCoordinate.w = 1.0 / depthFromCamera;\\n\\\nreturn eyeCoordinate;\\n\\\n#else\\n\\\nvec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\\n\\\n#endif\\n\\\nreturn eyeCoordinate;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\\n\\\nvarying float v_WindowZ;\\n\\\n#endif\\n\\\nvoid czm_writeDepthClamp()\\n\\\n{\\n\\\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\\n\\\ngl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LOG_DEPTH\\n\\\nvarying float v_depthFromNearPlusOne;\\n\\\n#ifdef POLYGON_OFFSET\\n\\\nuniform vec2 u_polygonOffset;\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\n#endif\\n\\\n#endif\\n\\\nvoid czm_writeLogDepth(float depth)\\n\\\n{\\n\\\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)\\n\\\nif (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#ifdef POLYGON_OFFSET\\n\\\nfloat factor = u_polygonOffset[0];\\n\\\nfloat units = u_polygonOffset[1];\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\nif (factor != 0.0) {\\n\\\nfloat x = dFdx(depth);\\n\\\nfloat y = dFdy(depth);\\n\\\nfloat m = sqrt(x * x + y * y);\\n\\\ndepth += m * factor;\\n\\\n}\\n\\\n#endif\\n\\\n#endif\\n\\\ngl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\\n\\\n#ifdef POLYGON_OFFSET\\n\\\ngl_FragDepthEXT += czm_epsilon7 * units;\\n\\\n#endif\\n\\\n#endif\\n\\\n}\\n\\\nvoid czm_writeLogDepth() {\\n\\\n#ifdef LOG_DEPTH\\n\\\nczm_writeLogDepth(v_depthFromNearPlusOne);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float czm_writeNonPerspective(float value, float w) {\\n\\\nreturn value * w;\\n\\\n}\\n\\\nvec2 czm_writeNonPerspective(vec2 value, float w) {\\n\\\nreturn value * w;\\n\\\n}\\n\\\nvec3 czm_writeNonPerspective(vec3 value, float w) {\\n\\\nreturn value * w;\\n\\\n}\\n\\\nvec4 czm_writeNonPerspective(vec4 value, float w) {\\n\\\nreturn value * w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 czm_XYZToRGB(vec3 Yxy)\\n\\\n{\\n\\\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\\n\\\n-1.5371, 1.8760, -0.2040,\\n\\\n-0.4985, 0.0416, 1.0572);\\n\\\nvec3 xyz;\\n\\\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\\n\\\nxyz.g = Yxy.r;\\n\\\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\\n\\\nreturn XYZ2RGB * xyz;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nimport czm_degreesPerRadian from './Constants/degreesPerRadian.js'\nimport czm_depthRange from './Constants/depthRange.js'\nimport czm_epsilon1 from './Constants/epsilon1.js'\nimport czm_epsilon2 from './Constants/epsilon2.js'\nimport czm_epsilon3 from './Constants/epsilon3.js'\nimport czm_epsilon4 from './Constants/epsilon4.js'\nimport czm_epsilon5 from './Constants/epsilon5.js'\nimport czm_epsilon6 from './Constants/epsilon6.js'\nimport czm_epsilon7 from './Constants/epsilon7.js'\nimport czm_infinity from './Constants/infinity.js'\nimport czm_oneOverPi from './Constants/oneOverPi.js'\nimport czm_oneOverTwoPi from './Constants/oneOverTwoPi.js'\nimport czm_passCesium3DTile from './Constants/passCesium3DTile.js'\nimport czm_passCesium3DTileClassification from './Constants/passCesium3DTileClassification.js'\nimport czm_passCesium3DTileClassificationIgnoreShow from './Constants/passCesium3DTileClassificationIgnoreShow.js'\nimport czm_passClassification from './Constants/passClassification.js'\nimport czm_passCompute from './Constants/passCompute.js'\nimport czm_passEnvironment from './Constants/passEnvironment.js'\nimport czm_passGlobe from './Constants/passGlobe.js'\nimport czm_passOpaque from './Constants/passOpaque.js'\nimport czm_passOverlay from './Constants/passOverlay.js'\nimport czm_passTerrainClassification from './Constants/passTerrainClassification.js'\nimport czm_passTranslucent from './Constants/passTranslucent.js'\nimport czm_pi from './Constants/pi.js'\nimport czm_piOverFour from './Constants/piOverFour.js'\nimport czm_piOverSix from './Constants/piOverSix.js'\nimport czm_piOverThree from './Constants/piOverThree.js'\nimport czm_piOverTwo from './Constants/piOverTwo.js'\nimport czm_radiansPerDegree from './Constants/radiansPerDegree.js'\nimport czm_sceneMode2D from './Constants/sceneMode2D.js'\nimport czm_sceneMode3D from './Constants/sceneMode3D.js'\nimport czm_sceneModeColumbusView from './Constants/sceneModeColumbusView.js'\nimport czm_sceneModeMorphing from './Constants/sceneModeMorphing.js'\nimport czm_solarRadius from './Constants/solarRadius.js'\nimport czm_threePiOver2 from './Constants/threePiOver2.js'\nimport czm_twoPi from './Constants/twoPi.js'\nimport czm_webMercatorMaxLatitude from './Constants/webMercatorMaxLatitude.js'\nimport czm_depthRangeStruct from './Structs/depthRangeStruct.js'\nimport czm_material from './Structs/material.js'\nimport czm_materialInput from './Structs/materialInput.js'\nimport czm_modelMaterial from './Structs/modelMaterial.js'\nimport czm_modelVertexOutput from './Structs/modelVertexOutput.js'\nimport czm_pbrParameters from './Structs/pbrParameters.js'\nimport czm_ray from './Structs/ray.js'\nimport czm_raySegment from './Structs/raySegment.js'\nimport czm_shadowParameters from './Structs/shadowParameters.js'\nimport czm_acesTonemapping from './Functions/acesTonemapping.js'\nimport czm_alphaWeight from './Functions/alphaWeight.js'\nimport czm_antialias from './Functions/antialias.js'\nimport czm_approximateSphericalCoordinates from './Functions/approximateSphericalCoordinates.js'\nimport czm_backFacing from './Functions/backFacing.js'\nimport czm_branchFreeTernary from './Functions/branchFreeTernary.js'\nimport czm_cascadeColor from './Functions/cascadeColor.js'\nimport czm_cascadeDistance from './Functions/cascadeDistance.js'\nimport czm_cascadeMatrix from './Functions/cascadeMatrix.js'\nimport czm_cascadeWeights from './Functions/cascadeWeights.js'\nimport czm_columbusViewMorph from './Functions/columbusViewMorph.js'\nimport czm_computePosition from './Functions/computePosition.js'\nimport czm_cosineAndSine from './Functions/cosineAndSine.js'\nimport czm_decompressTextureCoordinates from './Functions/decompressTextureCoordinates.js'\nimport czm_defaultPbrMaterial from './Functions/defaultPbrMaterial.js'\nimport czm_depthClamp from './Functions/depthClamp.js'\nimport czm_eastNorthUpToEyeCoordinates from './Functions/eastNorthUpToEyeCoordinates.js'\nimport czm_ellipsoidContainsPoint from './Functions/ellipsoidContainsPoint.js'\nimport czm_ellipsoidWgs84TextureCoordinates from './Functions/ellipsoidWgs84TextureCoordinates.js'\nimport czm_equalsEpsilon from './Functions/equalsEpsilon.js'\nimport czm_eyeOffset from './Functions/eyeOffset.js'\nimport czm_eyeToWindowCoordinates from './Functions/eyeToWindowCoordinates.js'\nimport czm_fastApproximateAtan from './Functions/fastApproximateAtan.js'\nimport czm_fog from './Functions/fog.js'\nimport czm_gammaCorrect from './Functions/gammaCorrect.js'\nimport czm_geodeticSurfaceNormal from './Functions/geodeticSurfaceNormal.js'\nimport czm_getDefaultMaterial from './Functions/getDefaultMaterial.js'\nimport czm_getLambertDiffuse from './Functions/getLambertDiffuse.js'\nimport czm_getSpecular from './Functions/getSpecular.js'\nimport czm_getWaterNoise from './Functions/getWaterNoise.js'\nimport czm_HSBToRGB from './Functions/HSBToRGB.js'\nimport czm_HSLToRGB from './Functions/HSLToRGB.js'\nimport czm_hue from './Functions/hue.js'\nimport czm_inverseGamma from './Functions/inverseGamma.js'\nimport czm_isEmpty from './Functions/isEmpty.js'\nimport czm_isFull from './Functions/isFull.js'\nimport czm_latitudeToWebMercatorFraction from './Functions/latitudeToWebMercatorFraction.js'\nimport czm_linearToSrgb from './Functions/linearToSrgb.js'\nimport czm_lineDistance from './Functions/lineDistance.js'\nimport czm_luminance from './Functions/luminance.js'\nimport czm_metersPerPixel from './Functions/metersPerPixel.js'\nimport czm_modelToWindowCoordinates from './Functions/modelToWindowCoordinates.js'\nimport czm_multiplyWithColorBalance from './Functions/multiplyWithColorBalance.js'\nimport czm_nearFarScalar from './Functions/nearFarScalar.js'\nimport czm_octDecode from './Functions/octDecode.js'\nimport czm_packDepth from './Functions/packDepth.js'\nimport czm_pbrLighting from './Functions/pbrLighting.js'\nimport czm_pbrMetallicRoughnessMaterial from './Functions/pbrMetallicRoughnessMaterial.js'\nimport czm_pbrSpecularGlossinessMaterial from './Functions/pbrSpecularGlossinessMaterial.js'\nimport czm_phong from './Functions/phong.js'\nimport czm_planeDistance from './Functions/planeDistance.js'\nimport czm_pointAlongRay from './Functions/pointAlongRay.js'\nimport czm_rayEllipsoidIntersectionInterval from './Functions/rayEllipsoidIntersectionInterval.js'\nimport czm_raySphereIntersectionInterval from './Functions/raySphereIntersectionInterval.js'\nimport czm_readDepth from './Functions/readDepth.js'\nimport czm_readNonPerspective from './Functions/readNonPerspective.js'\nimport czm_reverseLogDepth from './Functions/reverseLogDepth.js'\nimport czm_RGBToHSB from './Functions/RGBToHSB.js'\nimport czm_RGBToHSL from './Functions/RGBToHSL.js'\nimport czm_RGBToXYZ from './Functions/RGBToXYZ.js'\nimport czm_round from './Functions/round.js'\nimport czm_sampleOctahedralProjection from './Functions/sampleOctahedralProjection.js'\nimport czm_saturation from './Functions/saturation.js'\nimport czm_shadowDepthCompare from './Functions/shadowDepthCompare.js'\nimport czm_shadowVisibility from './Functions/shadowVisibility.js'\nimport czm_signNotZero from './Functions/signNotZero.js'\nimport czm_sphericalHarmonics from './Functions/sphericalHarmonics.js'\nimport czm_srgbToLinear from './Functions/srgbToLinear.js'\nimport czm_tangentToEyeSpaceMatrix from './Functions/tangentToEyeSpaceMatrix.js'\nimport czm_transformPlane from './Functions/transformPlane.js'\nimport czm_translateRelativeToEye from './Functions/translateRelativeToEye.js'\nimport czm_translucentPhong from './Functions/translucentPhong.js'\nimport czm_transpose from './Functions/transpose.js'\nimport czm_unpackDepth from './Functions/unpackDepth.js'\nimport czm_unpackFloat from './Functions/unpackFloat.js'\nimport czm_unpackUint from './Functions/unpackUint.js'\nimport czm_valueTransform from './Functions/valueTransform.js'\nimport czm_vertexLogDepth from './Functions/vertexLogDepth.js'\nimport czm_windowToEyeCoordinates from './Functions/windowToEyeCoordinates.js'\nimport czm_writeDepthClamp from './Functions/writeDepthClamp.js'\nimport czm_writeLogDepth from './Functions/writeLogDepth.js'\nimport czm_writeNonPerspective from './Functions/writeNonPerspective.js'\nimport czm_XYZToRGB from './Functions/XYZToRGB.js'\n\nexport default {\n czm_degreesPerRadian : czm_degreesPerRadian,\n czm_depthRange : czm_depthRange,\n czm_epsilon1 : czm_epsilon1,\n czm_epsilon2 : czm_epsilon2,\n czm_epsilon3 : czm_epsilon3,\n czm_epsilon4 : czm_epsilon4,\n czm_epsilon5 : czm_epsilon5,\n czm_epsilon6 : czm_epsilon6,\n czm_epsilon7 : czm_epsilon7,\n czm_infinity : czm_infinity,\n czm_oneOverPi : czm_oneOverPi,\n czm_oneOverTwoPi : czm_oneOverTwoPi,\n czm_passCesium3DTile : czm_passCesium3DTile,\n czm_passCesium3DTileClassification : czm_passCesium3DTileClassification,\n czm_passCesium3DTileClassificationIgnoreShow : czm_passCesium3DTileClassificationIgnoreShow,\n czm_passClassification : czm_passClassification,\n czm_passCompute : czm_passCompute,\n czm_passEnvironment : czm_passEnvironment,\n czm_passGlobe : czm_passGlobe,\n czm_passOpaque : czm_passOpaque,\n czm_passOverlay : czm_passOverlay,\n czm_passTerrainClassification : czm_passTerrainClassification,\n czm_passTranslucent : czm_passTranslucent,\n czm_pi : czm_pi,\n czm_piOverFour : czm_piOverFour,\n czm_piOverSix : czm_piOverSix,\n czm_piOverThree : czm_piOverThree,\n czm_piOverTwo : czm_piOverTwo,\n czm_radiansPerDegree : czm_radiansPerDegree,\n czm_sceneMode2D : czm_sceneMode2D,\n czm_sceneMode3D : czm_sceneMode3D,\n czm_sceneModeColumbusView : czm_sceneModeColumbusView,\n czm_sceneModeMorphing : czm_sceneModeMorphing,\n czm_solarRadius : czm_solarRadius,\n czm_threePiOver2 : czm_threePiOver2,\n czm_twoPi : czm_twoPi,\n czm_webMercatorMaxLatitude : czm_webMercatorMaxLatitude,\n czm_depthRangeStruct : czm_depthRangeStruct,\n czm_material : czm_material,\n czm_materialInput : czm_materialInput,\n czm_modelMaterial : czm_modelMaterial,\n czm_modelVertexOutput : czm_modelVertexOutput,\n czm_pbrParameters : czm_pbrParameters,\n czm_ray : czm_ray,\n czm_raySegment : czm_raySegment,\n czm_shadowParameters : czm_shadowParameters,\n czm_acesTonemapping : czm_acesTonemapping,\n czm_alphaWeight : czm_alphaWeight,\n czm_antialias : czm_antialias,\n czm_approximateSphericalCoordinates : czm_approximateSphericalCoordinates,\n czm_backFacing : czm_backFacing,\n czm_branchFreeTernary : czm_branchFreeTernary,\n czm_cascadeColor : czm_cascadeColor,\n czm_cascadeDistance : czm_cascadeDistance,\n czm_cascadeMatrix : czm_cascadeMatrix,\n czm_cascadeWeights : czm_cascadeWeights,\n czm_columbusViewMorph : czm_columbusViewMorph,\n czm_computePosition : czm_computePosition,\n czm_cosineAndSine : czm_cosineAndSine,\n czm_decompressTextureCoordinates : czm_decompressTextureCoordinates,\n czm_defaultPbrMaterial : czm_defaultPbrMaterial,\n czm_depthClamp : czm_depthClamp,\n czm_eastNorthUpToEyeCoordinates : czm_eastNorthUpToEyeCoordinates,\n czm_ellipsoidContainsPoint : czm_ellipsoidContainsPoint,\n czm_ellipsoidWgs84TextureCoordinates : czm_ellipsoidWgs84TextureCoordinates,\n czm_equalsEpsilon : czm_equalsEpsilon,\n czm_eyeOffset : czm_eyeOffset,\n czm_eyeToWindowCoordinates : czm_eyeToWindowCoordinates,\n czm_fastApproximateAtan : czm_fastApproximateAtan,\n czm_fog : czm_fog,\n czm_gammaCorrect : czm_gammaCorrect,\n czm_geodeticSurfaceNormal : czm_geodeticSurfaceNormal,\n czm_getDefaultMaterial : czm_getDefaultMaterial,\n czm_getLambertDiffuse : czm_getLambertDiffuse,\n czm_getSpecular : czm_getSpecular,\n czm_getWaterNoise : czm_getWaterNoise,\n czm_HSBToRGB : czm_HSBToRGB,\n czm_HSLToRGB : czm_HSLToRGB,\n czm_hue : czm_hue,\n czm_inverseGamma : czm_inverseGamma,\n czm_isEmpty : czm_isEmpty,\n czm_isFull : czm_isFull,\n czm_latitudeToWebMercatorFraction : czm_latitudeToWebMercatorFraction,\n czm_linearToSrgb : czm_linearToSrgb,\n czm_lineDistance : czm_lineDistance,\n czm_luminance : czm_luminance,\n czm_metersPerPixel : czm_metersPerPixel,\n czm_modelToWindowCoordinates : czm_modelToWindowCoordinates,\n czm_multiplyWithColorBalance : czm_multiplyWithColorBalance,\n czm_nearFarScalar : czm_nearFarScalar,\n czm_octDecode : czm_octDecode,\n czm_packDepth : czm_packDepth,\n czm_pbrLighting : czm_pbrLighting,\n czm_pbrMetallicRoughnessMaterial : czm_pbrMetallicRoughnessMaterial,\n czm_pbrSpecularGlossinessMaterial : czm_pbrSpecularGlossinessMaterial,\n czm_phong : czm_phong,\n czm_planeDistance : czm_planeDistance,\n czm_pointAlongRay : czm_pointAlongRay,\n czm_rayEllipsoidIntersectionInterval : czm_rayEllipsoidIntersectionInterval,\n czm_raySphereIntersectionInterval : czm_raySphereIntersectionInterval,\n czm_readDepth : czm_readDepth,\n czm_readNonPerspective : czm_readNonPerspective,\n czm_reverseLogDepth : czm_reverseLogDepth,\n czm_RGBToHSB : czm_RGBToHSB,\n czm_RGBToHSL : czm_RGBToHSL,\n czm_RGBToXYZ : czm_RGBToXYZ,\n czm_round : czm_round,\n czm_sampleOctahedralProjection : czm_sampleOctahedralProjection,\n czm_saturation : czm_saturation,\n czm_shadowDepthCompare : czm_shadowDepthCompare,\n czm_shadowVisibility : czm_shadowVisibility,\n czm_signNotZero : czm_signNotZero,\n czm_sphericalHarmonics : czm_sphericalHarmonics,\n czm_srgbToLinear : czm_srgbToLinear,\n czm_tangentToEyeSpaceMatrix : czm_tangentToEyeSpaceMatrix,\n czm_transformPlane : czm_transformPlane,\n czm_translateRelativeToEye : czm_translateRelativeToEye,\n czm_translucentPhong : czm_translucentPhong,\n czm_transpose : czm_transpose,\n czm_unpackDepth : czm_unpackDepth,\n czm_unpackFloat : czm_unpackFloat,\n czm_unpackUint : czm_unpackUint,\n czm_valueTransform : czm_valueTransform,\n czm_vertexLogDepth : czm_vertexLogDepth,\n czm_windowToEyeCoordinates : czm_windowToEyeCoordinates,\n czm_writeDepthClamp : czm_writeDepthClamp,\n czm_writeLogDepth : czm_writeLogDepth,\n czm_writeNonPerspective : czm_writeNonPerspective,\n czm_XYZToRGB : czm_XYZToRGB\n};\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport modernizeShader from \"../Renderer/modernizeShader.js\";\nimport CzmBuiltins from \"../Shaders/Builtin/CzmBuiltins.js\";\nimport AutomaticUniforms from \"./AutomaticUniforms.js\";\n\nfunction removeComments(source) {\n // remove inline comments\n source = source.replace(/\\/\\/.*/g, \"\");\n // remove multiline comment block\n return source.replace(/\\/\\*\\*[\\s\\S]*?\\*\\//gm, function (match) {\n // preserve the number of lines in the comment block so the line numbers will be correct when debugging shaders\n const numberOfLines = match.match(/\\n/gm).length;\n let replacement = \"\";\n for (let lineNumber = 0; lineNumber < numberOfLines; ++lineNumber) {\n replacement += \"\\n\";\n }\n return replacement;\n });\n}\n\nfunction getDependencyNode(name, glslSource, nodes) {\n let dependencyNode;\n\n // check if already loaded\n for (let i = 0; i < nodes.length; ++i) {\n if (nodes[i].name === name) {\n dependencyNode = nodes[i];\n }\n }\n\n if (!defined(dependencyNode)) {\n // strip doc comments so we don't accidentally try to determine a dependency for something found\n // in a comment\n glslSource = removeComments(glslSource);\n\n // create new node\n dependencyNode = {\n name: name,\n glslSource: glslSource,\n dependsOn: [],\n requiredBy: [],\n evaluated: false,\n };\n nodes.push(dependencyNode);\n }\n\n return dependencyNode;\n}\n\nfunction generateDependencies(currentNode, dependencyNodes) {\n if (currentNode.evaluated) {\n return;\n }\n\n currentNode.evaluated = true;\n\n // identify all dependencies that are referenced from this glsl source code\n let czmMatches = currentNode.glslSource.match(/\\bczm_[a-zA-Z0-9_]*/g);\n if (defined(czmMatches) && czmMatches !== null) {\n // remove duplicates\n czmMatches = czmMatches.filter(function (elem, pos) {\n return czmMatches.indexOf(elem) === pos;\n });\n\n czmMatches.forEach(function (element) {\n if (\n element !== currentNode.name &&\n ShaderSource._czmBuiltinsAndUniforms.hasOwnProperty(element)\n ) {\n const referencedNode = getDependencyNode(\n element,\n ShaderSource._czmBuiltinsAndUniforms[element],\n dependencyNodes\n );\n currentNode.dependsOn.push(referencedNode);\n referencedNode.requiredBy.push(currentNode);\n\n // recursive call to find any dependencies of the new node\n generateDependencies(referencedNode, dependencyNodes);\n }\n });\n }\n}\n\nfunction sortDependencies(dependencyNodes) {\n const nodesWithoutIncomingEdges = [];\n const allNodes = [];\n\n while (dependencyNodes.length > 0) {\n const node = dependencyNodes.pop();\n allNodes.push(node);\n\n if (node.requiredBy.length === 0) {\n nodesWithoutIncomingEdges.push(node);\n }\n }\n\n while (nodesWithoutIncomingEdges.length > 0) {\n const currentNode = nodesWithoutIncomingEdges.shift();\n\n dependencyNodes.push(currentNode);\n\n for (let i = 0; i < currentNode.dependsOn.length; ++i) {\n // remove the edge from the graph\n const referencedNode = currentNode.dependsOn[i];\n const index = referencedNode.requiredBy.indexOf(currentNode);\n referencedNode.requiredBy.splice(index, 1);\n\n // if referenced node has no more incoming edges, add to list\n if (referencedNode.requiredBy.length === 0) {\n nodesWithoutIncomingEdges.push(referencedNode);\n }\n }\n }\n\n // if there are any nodes left with incoming edges, then there was a circular dependency somewhere in the graph\n const badNodes = [];\n for (let j = 0; j < allNodes.length; ++j) {\n if (allNodes[j].requiredBy.length !== 0) {\n badNodes.push(allNodes[j]);\n }\n }\n\n}\n\nfunction getBuiltinsAndAutomaticUniforms(shaderSource) {\n // generate a dependency graph for builtin functions\n const dependencyNodes = [];\n const root = getDependencyNode(\"main\", shaderSource, dependencyNodes);\n generateDependencies(root, dependencyNodes);\n sortDependencies(dependencyNodes);\n\n // Concatenate the source code for the function dependencies.\n // Iterate in reverse so that dependent items are declared before they are used.\n let builtinsSource = \"\";\n for (let i = dependencyNodes.length - 1; i >= 0; --i) {\n builtinsSource = `${builtinsSource + dependencyNodes[i].glslSource}\\n`;\n }\n\n return builtinsSource.replace(root.glslSource, \"\");\n}\n\nfunction combineShader(shaderSource, isFragmentShader, context) {\n let i;\n let length;\n\n // Combine shader sources, generally for pseudo-polymorphism, e.g., czm_getMaterial.\n let combinedSources = \"\";\n const sources = shaderSource.sources;\n if (defined(sources)) {\n for (i = 0, length = sources.length; i < length; ++i) {\n // #line needs to be on its own line.\n combinedSources += `\\n#line 0\\n${sources[i]}`;\n }\n }\n\n combinedSources = removeComments(combinedSources);\n\n // Extract existing shader version from sources\n let version;\n combinedSources = combinedSources.replace(/#version\\s+(.*?)\\n/gm, function (\n match,\n group1\n ) {\n // Extract #version to put at the top\n version = group1;\n\n // Replace original #version directive with a new line so the line numbers\n // are not off by one. There can be only one #version directive\n // and it must appear at the top of the source, only preceded by\n // whitespace and comments.\n return \"\\n\";\n });\n\n // Extract shader extensions from sources\n const extensions = [];\n combinedSources = combinedSources.replace(/#extension.*\\n/gm, function (\n match\n ) {\n // Extract extension to put at the top\n extensions.push(match);\n\n // Replace original #extension directive with a new line so the line numbers\n // are not off by one.\n return \"\\n\";\n });\n\n // Remove precision qualifier\n combinedSources = combinedSources.replace(\n /precision\\s(lowp|mediump|highp)\\s(float|int);/,\n \"\"\n );\n\n // Replace main() for picked if desired.\n const pickColorQualifier = shaderSource.pickColorQualifier;\n if (defined(pickColorQualifier)) {\n combinedSources = ShaderSource.createPickFragmentShaderSource(\n combinedSources,\n pickColorQualifier\n );\n }\n\n // combine into single string\n let result = \"\";\n\n // #version must be first\n // defaults to #version 100 if not specified\n if (defined(version)) {\n result = `#version ${version}\\n`;\n }\n\n const extensionsLength = extensions.length;\n for (i = 0; i < extensionsLength; i++) {\n result += extensions[i];\n }\n\n if (isFragmentShader) {\n // If high precision isn't support replace occurrences of highp with mediump\n // The highp keyword is not always available on older mobile devices\n // See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#In_WebGL_1_highp_float_support_is_optional_in_fragment_shaders\n result +=\n \"\\\n#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\\\n precision highp float;\\n\\\n precision highp int;\\n\\\n#else\\n\\\n precision mediump float;\\n\\\n precision mediump int;\\n\\\n #define highp mediump\\n\\\n#endif\\n\\n\";\n }\n\n // Prepend #defines for uber-shaders\n const defines = shaderSource.defines;\n if (defined(defines)) {\n for (i = 0, length = defines.length; i < length; ++i) {\n const define = defines[i];\n if (define.length !== 0) {\n result += `#define ${define}\\n`;\n }\n }\n }\n\n // GLSLModernizer inserts its own layout qualifiers\n // at this position in the source\n if (context.webgl2) {\n result += \"#define OUTPUT_DECLARATION\\n\\n\";\n }\n\n // Define a constant for the OES_texture_float_linear extension since WebGL does not.\n if (context.textureFloatLinear) {\n result += \"#define OES_texture_float_linear\\n\\n\";\n }\n\n // Define a constant for the OES_texture_float extension since WebGL does not.\n if (context.floatingPointTexture) {\n result += \"#define OES_texture_float\\n\\n\";\n }\n\n // append built-ins\n if (shaderSource.includeBuiltIns) {\n result += getBuiltinsAndAutomaticUniforms(combinedSources);\n }\n\n // reset line number\n result += \"\\n#line 0\\n\";\n\n // append actual source\n result += combinedSources;\n\n // modernize the source\n if (context.webgl2) {\n result = modernizeShader(result, isFragmentShader, true);\n }\n\n return result;\n}\n\n/**\n * An object containing various inputs that will be combined to form a final GLSL shader string.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {String[]} [options.sources] An array of strings to combine containing GLSL code for the shader.\n * @param {String[]} [options.defines] An array of strings containing GLSL identifiers to <code>#define</code>.\n * @param {String} [options.pickColorQualifier] The GLSL qualifier, <code>uniform</code> or <code>varying</code>, for the input <code>czm_pickColor</code>. When defined, a pick fragment shader is generated.\n * @param {Boolean} [options.includeBuiltIns=true] If true, referenced built-in functions will be included with the combined shader. Set to false if this shader will become a source in another shader, to avoid duplicating functions.\n *\n * @exception {DeveloperError} options.pickColorQualifier must be 'uniform' or 'varying'.\n *\n * @example\n * // 1. Prepend #defines to a shader\n * const source = new Cesium.ShaderSource({\n * defines : ['WHITE'],\n * sources : ['void main() { \\n#ifdef WHITE\\n gl_FragColor = vec4(1.0); \\n#else\\n gl_FragColor = vec4(0.0); \\n#endif\\n }']\n * });\n *\n * // 2. Modify a fragment shader for picking\n * const source2 = new Cesium.ShaderSource({\n * sources : ['void main() { gl_FragColor = vec4(1.0); }'],\n * pickColorQualifier : 'uniform'\n * });\n *\n * @private\n */\nfunction ShaderSource(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const pickColorQualifier = options.pickColorQualifier;\n\n this.defines = defined(options.defines) ? options.defines.slice(0) : [];\n this.sources = defined(options.sources) ? options.sources.slice(0) : [];\n this.pickColorQualifier = pickColorQualifier;\n this.includeBuiltIns = defaultValue(options.includeBuiltIns, true);\n}\n\nShaderSource.prototype.clone = function () {\n return new ShaderSource({\n sources: this.sources,\n defines: this.defines,\n pickColorQualifier: this.pickColorQualifier,\n includeBuiltIns: this.includeBuiltIns,\n });\n};\n\nShaderSource.replaceMain = function (source, renamedMain) {\n renamedMain = `void ${renamedMain}()`;\n return source.replace(/void\\s+main\\s*\\(\\s*(?:void)?\\s*\\)/g, renamedMain);\n};\n\n/**\n * Since {@link ShaderSource#createCombinedVertexShader} and\n * {@link ShaderSource#createCombinedFragmentShader} are both expensive to\n * compute, create a simpler string key for lookups in the {@link ShaderCache}.\n *\n * @returns {String} A key for identifying this shader\n *\n * @private\n */\nShaderSource.prototype.getCacheKey = function () {\n // Sort defines to make the key comparison deterministic\n const sortedDefines = this.defines.slice().sort();\n const definesKey = sortedDefines.join(\",\");\n const pickKey = this.pickColorQualifier;\n const builtinsKey = this.includeBuiltIns;\n const sourcesKey = this.sources.join(\"\\n\");\n\n return `${definesKey}:${pickKey}:${builtinsKey}:${sourcesKey}`;\n};\n\n/**\n * Create a single string containing the full, combined vertex shader with all dependencies and defines.\n *\n * @param {Context} context The current rendering context\n *\n * @returns {String} The combined shader string.\n */\nShaderSource.prototype.createCombinedVertexShader = function (context) {\n return combineShader(this, false, context);\n};\n\n/**\n * Create a single string containing the full, combined fragment shader with all dependencies and defines.\n *\n * @param {Context} context The current rendering context\n *\n * @returns {String} The combined shader string.\n */\nShaderSource.prototype.createCombinedFragmentShader = function (context) {\n return combineShader(this, true, context);\n};\n\n/**\n * For ShaderProgram testing\n * @private\n */\nShaderSource._czmBuiltinsAndUniforms = {};\n\n// combine automatic uniforms and Cesium built-ins\nfor (const builtinName in CzmBuiltins) {\n if (CzmBuiltins.hasOwnProperty(builtinName)) {\n ShaderSource._czmBuiltinsAndUniforms[builtinName] =\n CzmBuiltins[builtinName];\n }\n}\nfor (const uniformName in AutomaticUniforms) {\n if (AutomaticUniforms.hasOwnProperty(uniformName)) {\n const uniform = AutomaticUniforms[uniformName];\n if (typeof uniform.getDeclaration === \"function\") {\n ShaderSource._czmBuiltinsAndUniforms[\n uniformName\n ] = uniform.getDeclaration(uniformName);\n }\n }\n}\n\nShaderSource.createPickVertexShaderSource = function (vertexShaderSource) {\n const renamedVS = ShaderSource.replaceMain(\n vertexShaderSource,\n \"czm_old_main\"\n );\n const pickMain =\n \"attribute vec4 pickColor; \\n\" +\n \"varying vec4 czm_pickColor; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_old_main(); \\n\" +\n \" czm_pickColor = pickColor; \\n\" +\n \"}\";\n\n return `${renamedVS}\\n${pickMain}`;\n};\n\nShaderSource.createPickFragmentShaderSource = function (\n fragmentShaderSource,\n pickColorQualifier\n) {\n const renamedFS = ShaderSource.replaceMain(\n fragmentShaderSource,\n \"czm_old_main\"\n );\n const pickMain =\n `${pickColorQualifier} vec4 czm_pickColor; \\n` +\n `void main() \\n` +\n `{ \\n` +\n ` czm_old_main(); \\n` +\n ` if (gl_FragColor.a == 0.0) { \\n` +\n ` discard; \\n` +\n ` } \\n` +\n ` gl_FragColor = czm_pickColor; \\n` +\n `}`;\n\n return `${renamedFS}\\n${pickMain}`;\n};\n\nfunction containsDefine(shaderSource, define) {\n const defines = shaderSource.defines;\n const definesLength = defines.length;\n for (let i = 0; i < definesLength; ++i) {\n if (defines[i] === define) {\n return true;\n }\n }\n return false;\n}\n\nfunction containsString(shaderSource, string) {\n const sources = shaderSource.sources;\n const sourcesLength = sources.length;\n for (let i = 0; i < sourcesLength; ++i) {\n if (sources[i].indexOf(string) !== -1) {\n return true;\n }\n }\n return false;\n}\n\nfunction findFirstString(shaderSource, strings) {\n const stringsLength = strings.length;\n for (let i = 0; i < stringsLength; ++i) {\n const string = strings[i];\n if (containsString(shaderSource, string)) {\n return string;\n }\n }\n return undefined;\n}\n\nconst normalVaryingNames = [\"v_normalEC\", \"v_normal\"];\n\nShaderSource.findNormalVarying = function (shaderSource) {\n // Fix for Model: the shader text always has the word v_normalEC\n // wrapped in an #ifdef so instead of looking for v_normalEC look for the define\n if (containsString(shaderSource, \"#ifdef HAS_NORMALS\")) {\n if (containsDefine(shaderSource, \"HAS_NORMALS\")) {\n return \"v_normalEC\";\n }\n return undefined;\n }\n\n return findFirstString(shaderSource, normalVaryingNames);\n};\n\nconst positionVaryingNames = [\"v_positionEC\"];\n\nShaderSource.findPositionVarying = function (shaderSource) {\n return findFirstString(shaderSource, positionVaryingNames);\n};\nexport default ShaderSource;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute float batchId;\\n\\\n#ifdef EXTRUDED_GEOMETRY\\n\\\nattribute vec3 extrudeDirection;\\n\\\nuniform float u_globeMinimumAltitude;\\n\\\n#endif // EXTRUDED_GEOMETRY\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\nvarying vec4 v_sphericalExtents;\\n\\\n#else // SPHERICAL\\n\\\nvarying vec2 v_inversePlaneExtents;\\n\\\nvarying vec4 v_westPlane;\\n\\\nvarying vec4 v_southPlane;\\n\\\n#endif // SPHERICAL\\n\\\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\\n\\\nvarying vec3 v_uMaxAndInverseDistance;\\n\\\nvarying vec3 v_vMaxAndInverseDistance;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 position = czm_computePosition();\\n\\\n#ifdef EXTRUDED_GEOMETRY\\n\\\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\\n\\\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\\n\\\nposition = position + vec4(extrudeDirection * delta, 0.0);\\n\\\n#endif\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\\n\\\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\\n\\\n#else // SPHERICAL\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\\n\\\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\\n\\\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\\n\\\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\\n\\\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\\n\\\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\\n\\\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\\n\\\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\\n\\\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\\n\\\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\\n\\\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\\n\\\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\\n\\\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\\n\\\n#else // COLUMBUS_VIEW_2D\\n\\\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\\n\\\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\\n\\\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\\n\\\n#endif // COLUMBUS_VIEW_2D\\n\\\nvec3 eastWard = southEastCorner - southWestCorner;\\n\\\nfloat eastExtent = length(eastWard);\\n\\\neastWard /= eastExtent;\\n\\\nvec3 northWard = northWestCorner - southWestCorner;\\n\\\nfloat northExtent = length(northWard);\\n\\\nnorthWard /= northExtent;\\n\\\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\\n\\\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\\n\\\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\\n\\\n#endif // SPHERICAL\\n\\\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\\n\\\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\\n\\\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\\n\\\nv_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\\n\\\nv_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nv_color = czm_batchTable_color(batchId);\\n\\\n#endif\\n\\\ngl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_EXT_frag_depth\\n\\\n#extension GL_EXT_frag_depth : enable\\n\\\n#endif\\n\\\n#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\nvoid main(void)\\n\\\n{\\n\\\n#ifdef VECTOR_TILE\\n\\\ngl_FragColor = czm_gammaCorrect(u_highlightColor);\\n\\\n#else\\n\\\ngl_FragColor = vec4(1.0);\\n\\\n#endif\\n\\\nczm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "/**\n * Whether a classification affects terrain, 3D Tiles or both.\n *\n * @enum {Number}\n */\nconst ClassificationType = {\n /**\n * Only terrain will be classified.\n *\n * @type {Number}\n * @constant\n */\n TERRAIN: 0,\n /**\n * Only 3D Tiles will be classified.\n *\n * @type {Number}\n * @constant\n */\n CESIUM_3D_TILE: 1,\n /**\n * Both terrain and 3D Tiles will be classified.\n *\n * @type {Number}\n * @constant\n */\n BOTH: 2,\n};\n\n/**\n * @private\n */\nClassificationType.NUMBER_OF_CLASSIFICATION_TYPES = 3;\n\nexport default Object.freeze(ClassificationType);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the function used to compare two depths for the depth test.\n *\n * @enum {Number}\n */\nconst DepthFunction = {\n /**\n * The depth test never passes.\n *\n * @type {Number}\n * @constant\n */\n NEVER: WebGLConstants.NEVER,\n\n /**\n * The depth test passes if the incoming depth is less than the stored depth.\n *\n * @type {Number}\n * @constant\n */\n LESS: WebGLConstants.LESS,\n\n /**\n * The depth test passes if the incoming depth is equal to the stored depth.\n *\n * @type {Number}\n * @constant\n */\n EQUAL: WebGLConstants.EQUAL,\n\n /**\n * The depth test passes if the incoming depth is less than or equal to the stored depth.\n *\n * @type {Number}\n * @constant\n */\n LESS_OR_EQUAL: WebGLConstants.LEQUAL,\n\n /**\n * The depth test passes if the incoming depth is greater than the stored depth.\n *\n * @type {Number}\n * @constant\n */\n GREATER: WebGLConstants.GREATER,\n\n /**\n * The depth test passes if the incoming depth is not equal to the stored depth.\n *\n * @type {Number}\n * @constant\n */\n NOT_EQUAL: WebGLConstants.NOTEQUAL,\n\n /**\n * The depth test passes if the incoming depth is greater than or equal to the stored depth.\n *\n * @type {Number}\n * @constant\n */\n GREATER_OR_EQUAL: WebGLConstants.GEQUAL,\n\n /**\n * The depth test always passes.\n *\n * @type {Number}\n * @constant\n */\n ALWAYS: WebGLConstants.ALWAYS,\n};\nexport default Object.freeze(DepthFunction);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\n * <p>\n * This is used to encode positions in vertex buffers for rendering without jittering artifacts\n * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @alias EncodedCartesian3\n * @constructor\n *\n * @private\n */\nfunction EncodedCartesian3() {\n /**\n * The high bits for each component. Bits 0 to 22 store the whole value. Bits 23 to 31 are not used.\n *\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.high = Cartesian3.clone(Cartesian3.ZERO);\n\n /**\n * The low bits for each component. Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction. Bits 23 to 31 are not used.\n *\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n */\n this.low = Cartesian3.clone(Cartesian3.ZERO);\n}\n\n/**\n * Encodes a 64-bit floating-point value as two floating-point values that, when converted to\n * 32-bit floating-point and added, approximate the original input. The returned object\n * has <code>high</code> and <code>low</code> properties for the high and low bits, respectively.\n * <p>\n * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @param {Number} value The floating-point value to encode.\n * @param {Object} [result] The object onto which to store the result.\n * @returns {Object} The modified result parameter or a new instance if one was not provided.\n *\n * @example\n * const value = 1234567.1234567;\n * const splitValue = Cesium.EncodedCartesian3.encode(value);\n */\nEncodedCartesian3.encode = function (value, result) {\n if (!defined(result)) {\n result = {\n high: 0.0,\n low: 0.0,\n };\n }\n\n let doubleHigh;\n if (value >= 0.0) {\n doubleHigh = Math.floor(value / 65536.0) * 65536.0;\n result.high = doubleHigh;\n result.low = value - doubleHigh;\n } else {\n doubleHigh = Math.floor(-value / 65536.0) * 65536.0;\n result.high = -doubleHigh;\n result.low = value + doubleHigh;\n }\n\n return result;\n};\n\nconst scratchEncode = {\n high: 0.0,\n low: 0.0,\n};\n\n/**\n * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3}\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\n * <p>\n * The fixed-point encoding follows {@link https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian to encode.\n * @param {EncodedCartesian3} [result] The object onto which to store the result.\n * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided.\n *\n * @example\n * const cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0);\n * const encoded = Cesium.EncodedCartesian3.fromCartesian(cart);\n */\nEncodedCartesian3.fromCartesian = function (cartesian, result) {\n if (!defined(result)) {\n result = new EncodedCartesian3();\n }\n\n const high = result.high;\n const low = result.low;\n\n EncodedCartesian3.encode(cartesian.x, scratchEncode);\n high.x = scratchEncode.high;\n low.x = scratchEncode.low;\n\n EncodedCartesian3.encode(cartesian.y, scratchEncode);\n high.y = scratchEncode.high;\n low.y = scratchEncode.low;\n\n EncodedCartesian3.encode(cartesian.z, scratchEncode);\n high.z = scratchEncode.high;\n low.z = scratchEncode.low;\n\n return result;\n};\n\nconst encodedP = new EncodedCartesian3();\n\n/**\n * Encodes the provided <code>cartesian</code>, and writes it to an array with <code>high</code>\n * components followed by <code>low</code> components, i.e. <code>[high.x, high.y, high.z, low.x, low.y, low.z]</code>.\n * <p>\n * This is used to create interleaved high-precision position vertex attributes.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian to encode.\n * @param {Number[]} cartesianArray The array to write to.\n * @param {Number} index The index into the array to start writing. Six elements will be written.\n *\n * @exception {DeveloperError} index must be a number greater than or equal to 0.\n *\n * @example\n * const positions = [\n * new Cesium.Cartesian3(),\n * // ...\n * ];\n * const encodedPositions = new Float32Array(2 * 3 * positions.length);\n * let j = 0;\n * for (let i = 0; i < positions.length; ++i) {\n * Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j);\n * j += 6;\n * }\n */\nEncodedCartesian3.writeElements = function (cartesian, cartesianArray, index) {\n EncodedCartesian3.fromCartesian(cartesian, encodedP);\n const high = encodedP.high;\n const low = encodedP.low;\n\n cartesianArray[index] = high.x;\n cartesianArray[index + 1] = high.y;\n cartesianArray[index + 2] = high.z;\n cartesianArray[index + 3] = low.x;\n cartesianArray[index + 4] = low.y;\n cartesianArray[index + 5] = low.z;\n};\nexport default EncodedCartesian3;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Subdivides an array into a number of smaller, equal sized arrays.\n *\n * @function subdivideArray\n *\n * @param {Array} array The array to divide.\n * @param {Number} numberOfArrays The number of arrays to divide the provided array into.\n *\n * @exception {DeveloperError} numberOfArrays must be greater than 0.\n */\nfunction subdivideArray(array, numberOfArrays) {\n const result = [];\n const len = array.length;\n let i = 0;\n while (i < len) {\n const size = Math.ceil((len - i) / numberOfArrays--);\n result.push(array.slice(i, i + size));\n i += size;\n }\n return result;\n}\nexport default subdivideArray;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst BufferUsage = {\n STREAM_DRAW: WebGLConstants.STREAM_DRAW,\n STATIC_DRAW: WebGLConstants.STATIC_DRAW,\n DYNAMIC_DRAW: WebGLConstants.DYNAMIC_DRAW,\n\n validate: function (bufferUsage) {\n return (\n bufferUsage === BufferUsage.STREAM_DRAW ||\n bufferUsage === BufferUsage.STATIC_DRAW ||\n bufferUsage === BufferUsage.DYNAMIC_DRAW\n );\n },\n};\nexport default Object.freeze(BufferUsage);\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * Constants for WebGL index datatypes. These corresponds to the\n * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.\n *\n * @enum {Number}\n */\nconst IndexDatatype = {\n /**\n * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type\n * of an element in <code>Uint8Array</code>.\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n\n /**\n * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type\n * of an element in <code>Uint16Array</code>.\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n\n /**\n * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type\n * of an element in <code>Uint32Array</code>.\n *\n * @type {Number}\n * @constant\n */\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n};\n\n/**\n * Returns the size, in bytes, of the corresponding datatype.\n *\n * @param {IndexDatatype} indexDatatype The index datatype to get the size of.\n * @returns {Number} The size in bytes.\n *\n * @example\n * // Returns 2\n * const size = Cesium.IndexDatatype.getSizeInBytes(Cesium.IndexDatatype.UNSIGNED_SHORT);\n */\nIndexDatatype.getSizeInBytes = function (indexDatatype) {\n switch (indexDatatype) {\n case IndexDatatype.UNSIGNED_BYTE:\n return Uint8Array.BYTES_PER_ELEMENT;\n case IndexDatatype.UNSIGNED_SHORT:\n return Uint16Array.BYTES_PER_ELEMENT;\n case IndexDatatype.UNSIGNED_INT:\n return Uint32Array.BYTES_PER_ELEMENT;\n }\n\n};\n\n/**\n * Gets the datatype with a given size in bytes.\n *\n * @param {Number} sizeInBytes The size of a single index in bytes.\n * @returns {IndexDatatype} The index datatype with the given size.\n */\nIndexDatatype.fromSizeInBytes = function (sizeInBytes) {\n switch (sizeInBytes) {\n case 2:\n return IndexDatatype.UNSIGNED_SHORT;\n case 4:\n return IndexDatatype.UNSIGNED_INT;\n case 1:\n return IndexDatatype.UNSIGNED_BYTE;\n}\n};\n\n/**\n * Validates that the provided index datatype is a valid {@link IndexDatatype}.\n *\n * @param {IndexDatatype} indexDatatype The index datatype to validate.\n * @returns {Boolean} <code>true</code> if the provided index datatype is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.IndexDatatype.validate(indexDatatype)) {\n * throw new Cesium.DeveloperError('indexDatatype must be a valid value.');\n * }\n */\nIndexDatatype.validate = function (indexDatatype) {\n return (\n defined(indexDatatype) &&\n (indexDatatype === IndexDatatype.UNSIGNED_BYTE ||\n indexDatatype === IndexDatatype.UNSIGNED_SHORT ||\n indexDatatype === IndexDatatype.UNSIGNED_INT)\n );\n};\n\n/**\n * Creates a typed array that will store indices, using either <code><Uint16Array</code>\n * or <code>Uint32Array</code> depending on the number of vertices.\n *\n * @param {Number} numberOfVertices Number of vertices that the indices will reference.\n * @param {Number|Array} indicesLengthOrArray Passed through to the typed array constructor.\n * @returns {Uint16Array|Uint32Array} A <code>Uint16Array</code> or <code>Uint32Array</code> constructed with <code>indicesLengthOrArray</code>.\n *\n * @example\n * this.indices = Cesium.IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);\n */\nIndexDatatype.createTypedArray = function (\n numberOfVertices,\n indicesLengthOrArray\n) {\n if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\n return new Uint32Array(indicesLengthOrArray);\n }\n\n return new Uint16Array(indicesLengthOrArray);\n};\n\n/**\n * Creates a typed array from a source array buffer. The resulting typed array will store indices, using either <code><Uint16Array</code>\n * or <code>Uint32Array</code> depending on the number of vertices.\n *\n * @param {Number} numberOfVertices Number of vertices that the indices will reference.\n * @param {ArrayBuffer} sourceArray Passed through to the typed array constructor.\n * @param {Number} byteOffset Passed through to the typed array constructor.\n * @param {Number} length Passed through to the typed array constructor.\n * @returns {Uint16Array|Uint32Array} A <code>Uint16Array</code> or <code>Uint32Array</code> constructed with <code>sourceArray</code>, <code>byteOffset</code>, and <code>length</code>.\n *\n */\nIndexDatatype.createTypedArrayFromArrayBuffer = function (\n numberOfVertices,\n sourceArray,\n byteOffset,\n length\n) {\n if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\n return new Uint32Array(sourceArray, byteOffset, length);\n }\n\n return new Uint16Array(sourceArray, byteOffset, length);\n};\n\n/**\n * Gets the {@link IndexDatatype} for the provided TypedArray instance.\n *\n * @param {Uint8Array|Uint16Array|Uint32Array} array The typed array.\n * @returns {IndexDatatype} The IndexDatatype for the provided array, or undefined if the array is not a Uint8Array, Uint16Array, or Uint32Array.\n */\nIndexDatatype.fromTypedArray = function (array) {\n if (array instanceof Uint8Array) {\n return IndexDatatype.UNSIGNED_BYTE;\n }\n if (array instanceof Uint16Array) {\n return IndexDatatype.UNSIGNED_SHORT;\n }\n if (array instanceof Uint32Array) {\n return IndexDatatype.UNSIGNED_INT;\n }\n\n};\n\nexport default Object.freeze(IndexDatatype);\n", "import Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport BufferUsage from \"./BufferUsage.js\";\n\n/**\n * @private\n */\nfunction Buffer(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const gl = options.context._gl;\n const bufferTarget = options.bufferTarget;\n const typedArray = options.typedArray;\n let sizeInBytes = options.sizeInBytes;\n const usage = options.usage;\n const hasArray = defined(typedArray);\n\n if (hasArray) {\n sizeInBytes = typedArray.byteLength;\n }\n\n const buffer = gl.createBuffer();\n gl.bindBuffer(bufferTarget, buffer);\n gl.bufferData(bufferTarget, hasArray ? typedArray : sizeInBytes, usage);\n gl.bindBuffer(bufferTarget, null);\n\n this._id = createGuid();\n this._gl = gl;\n this._webgl2 = options.context._webgl2;\n this._bufferTarget = bufferTarget;\n this._sizeInBytes = sizeInBytes;\n this._usage = usage;\n this._buffer = buffer;\n this.vertexArrayDestroyable = true;\n}\n\n/**\n * Creates a vertex buffer, which contains untyped vertex data in GPU-controlled memory.\n * <br /><br />\n * A vertex array defines the actual makeup of a vertex, e.g., positions, normals, texture coordinates,\n * etc., by interpreting the raw data in one or more vertex buffers.\n *\n * @param {Object} options An object containing the following properties:\n * @param {Context} options.context The context in which to create the buffer\n * @param {ArrayBufferView} [options.typedArray] A typed array containing the data to copy to the buffer.\n * @param {Number} [options.sizeInBytes] A <code>Number</code> defining the size of the buffer in bytes. Required if options.typedArray is not given.\n * @param {BufferUsage} options.usage Specifies the expected usage pattern of the buffer. On some GL implementations, this can significantly affect performance. See {@link BufferUsage}.\n * @returns {VertexBuffer} The vertex buffer, ready to be attached to a vertex array.\n *\n * @exception {DeveloperError} Must specify either <options.typedArray> or <options.sizeInBytes>, but not both.\n * @exception {DeveloperError} The buffer size must be greater than zero.\n * @exception {DeveloperError} Invalid <code>usage</code>.\n *\n *\n * @example\n * // Example 1. Create a dynamic vertex buffer 16 bytes in size.\n * const buffer = Buffer.createVertexBuffer({\n * context : context,\n * sizeInBytes : 16,\n * usage : BufferUsage.DYNAMIC_DRAW\n * });\n *\n * @example\n * // Example 2. Create a dynamic vertex buffer from three floating-point values.\n * // The data copied to the vertex buffer is considered raw bytes until it is\n * // interpreted as vertices using a vertex array.\n * const positionBuffer = buffer.createVertexBuffer({\n * context : context,\n * typedArray : new Float32Array([0, 0, 0]),\n * usage : BufferUsage.STATIC_DRAW\n * });\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGenBuffer.xml|glGenBuffer}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindBuffer.xml|glBindBuffer} with <code>ARRAY_BUFFER</code>\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBufferData.xml|glBufferData} with <code>ARRAY_BUFFER</code>\n */\nBuffer.createVertexBuffer = function (options) {\n return new Buffer({\n context: options.context,\n bufferTarget: WebGLConstants.ARRAY_BUFFER,\n typedArray: options.typedArray,\n sizeInBytes: options.sizeInBytes,\n usage: options.usage,\n });\n};\n\n/**\n * Creates an index buffer, which contains typed indices in GPU-controlled memory.\n * <br /><br />\n * An index buffer can be attached to a vertex array to select vertices for rendering.\n * <code>Context.draw</code> can render using the entire index buffer or a subset\n * of the index buffer defined by an offset and count.\n *\n * @param {Object} options An object containing the following properties:\n * @param {Context} options.context The context in which to create the buffer\n * @param {ArrayBufferView} [options.typedArray] A typed array containing the data to copy to the buffer.\n * @param {Number} [options.sizeInBytes] A <code>Number</code> defining the size of the buffer in bytes. Required if options.typedArray is not given.\n * @param {BufferUsage} options.usage Specifies the expected usage pattern of the buffer. On some GL implementations, this can significantly affect performance. See {@link BufferUsage}.\n * @param {IndexDatatype} options.indexDatatype The datatype of indices in the buffer.\n * @returns {IndexBuffer} The index buffer, ready to be attached to a vertex array.\n *\n * @exception {DeveloperError} Must specify either <options.typedArray> or <options.sizeInBytes>, but not both.\n * @exception {DeveloperError} IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.\n * @exception {DeveloperError} The size in bytes must be greater than zero.\n * @exception {DeveloperError} Invalid <code>usage</code>.\n * @exception {DeveloperError} Invalid <code>indexDatatype</code>.\n *\n *\n * @example\n * // Example 1. Create a stream index buffer of unsigned shorts that is\n * // 16 bytes in size.\n * const buffer = Buffer.createIndexBuffer({\n * context : context,\n * sizeInBytes : 16,\n * usage : BufferUsage.STREAM_DRAW,\n * indexDatatype : IndexDatatype.UNSIGNED_SHORT\n * });\n *\n * @example\n * // Example 2. Create a static index buffer containing three unsigned shorts.\n * const buffer = Buffer.createIndexBuffer({\n * context : context,\n * typedArray : new Uint16Array([0, 1, 2]),\n * usage : BufferUsage.STATIC_DRAW,\n * indexDatatype : IndexDatatype.UNSIGNED_SHORT\n * });\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGenBuffer.xml|glGenBuffer}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBindBuffer.xml|glBindBuffer} with <code>ELEMENT_ARRAY_BUFFER</code>\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glBufferData.xml|glBufferData} with <code>ELEMENT_ARRAY_BUFFER</code>\n */\nBuffer.createIndexBuffer = function (options) {\n const context = options.context;\n const indexDatatype = options.indexDatatype;\n\n const bytesPerIndex = IndexDatatype.getSizeInBytes(indexDatatype);\n const buffer = new Buffer({\n context: context,\n bufferTarget: WebGLConstants.ELEMENT_ARRAY_BUFFER,\n typedArray: options.typedArray,\n sizeInBytes: options.sizeInBytes,\n usage: options.usage,\n });\n\n const numberOfIndices = buffer.sizeInBytes / bytesPerIndex;\n\n Object.defineProperties(buffer, {\n indexDatatype: {\n get: function () {\n return indexDatatype;\n },\n },\n bytesPerIndex: {\n get: function () {\n return bytesPerIndex;\n },\n },\n numberOfIndices: {\n get: function () {\n return numberOfIndices;\n },\n },\n });\n\n return buffer;\n};\n\nObject.defineProperties(Buffer.prototype, {\n sizeInBytes: {\n get: function () {\n return this._sizeInBytes;\n },\n },\n\n usage: {\n get: function () {\n return this._usage;\n },\n },\n});\n\nBuffer.prototype._getBuffer = function () {\n return this._buffer;\n};\n\nBuffer.prototype.copyFromArrayView = function (arrayView, offsetInBytes) {\n offsetInBytes = defaultValue(offsetInBytes, 0);\n\n const gl = this._gl;\n const target = this._bufferTarget;\n gl.bindBuffer(target, this._buffer);\n gl.bufferSubData(target, offsetInBytes, arrayView);\n gl.bindBuffer(target, null);\n};\n\nBuffer.prototype.copyFromBuffer = function (\n readBuffer,\n readOffset,\n writeOffset,\n sizeInBytes\n) {\n const readTarget = WebGLConstants.COPY_READ_BUFFER;\n const writeTarget = WebGLConstants.COPY_WRITE_BUFFER;\n\n const gl = this._gl;\n gl.bindBuffer(writeTarget, this._buffer);\n gl.bindBuffer(readTarget, readBuffer._buffer);\n gl.copyBufferSubData(\n readTarget,\n writeTarget,\n readOffset,\n writeOffset,\n sizeInBytes\n );\n gl.bindBuffer(writeTarget, null);\n gl.bindBuffer(readTarget, null);\n};\n\nBuffer.prototype.getBufferData = function (\n arrayView,\n sourceOffset,\n destinationOffset,\n length\n) {\n sourceOffset = defaultValue(sourceOffset, 0);\n destinationOffset = defaultValue(destinationOffset, 0);\n\n const gl = this._gl;\n const target = WebGLConstants.COPY_READ_BUFFER;\n gl.bindBuffer(target, this._buffer);\n gl.getBufferSubData(\n target,\n sourceOffset,\n arrayView,\n destinationOffset,\n length\n );\n gl.bindBuffer(target, null);\n};\n\nBuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nBuffer.prototype.destroy = function () {\n this._gl.deleteBuffer(this._buffer);\n return destroyObject(this);\n};\nexport default Buffer;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Buffer from \"./Buffer.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport ContextLimits from \"./ContextLimits.js\";\n\nfunction addAttribute(attributes, attribute, index, context) {\n const hasVertexBuffer = defined(attribute.vertexBuffer);\n const hasValue = defined(attribute.value);\n const componentsPerAttribute = attribute.value\n ? attribute.value.length\n : attribute.componentsPerAttribute;\n\n // Shallow copy the attribute; we do not want to copy the vertex buffer.\n const attr = {\n index: defaultValue(attribute.index, index),\n enabled: defaultValue(attribute.enabled, true),\n vertexBuffer: attribute.vertexBuffer,\n value: hasValue ? attribute.value.slice(0) : undefined,\n componentsPerAttribute: componentsPerAttribute,\n componentDatatype: defaultValue(\n attribute.componentDatatype,\n ComponentDatatype.FLOAT\n ),\n normalize: defaultValue(attribute.normalize, false),\n offsetInBytes: defaultValue(attribute.offsetInBytes, 0),\n strideInBytes: defaultValue(attribute.strideInBytes, 0),\n instanceDivisor: defaultValue(attribute.instanceDivisor, 0),\n };\n\n if (hasVertexBuffer) {\n // Common case: vertex buffer for per-vertex data\n attr.vertexAttrib = function (gl) {\n const index = this.index;\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer._getBuffer());\n gl.vertexAttribPointer(\n index,\n this.componentsPerAttribute,\n this.componentDatatype,\n this.normalize,\n this.strideInBytes,\n this.offsetInBytes\n );\n gl.enableVertexAttribArray(index);\n if (this.instanceDivisor > 0) {\n context.glVertexAttribDivisor(index, this.instanceDivisor);\n context._vertexAttribDivisors[index] = this.instanceDivisor;\n context._previousDrawInstanced = true;\n }\n };\n\n attr.disableVertexAttribArray = function (gl) {\n gl.disableVertexAttribArray(this.index);\n if (this.instanceDivisor > 0) {\n context.glVertexAttribDivisor(index, 0);\n }\n };\n } else {\n // Less common case: value array for the same data for each vertex\n switch (attr.componentsPerAttribute) {\n case 1:\n attr.vertexAttrib = function (gl) {\n gl.vertexAttrib1fv(this.index, this.value);\n };\n break;\n case 2:\n attr.vertexAttrib = function (gl) {\n gl.vertexAttrib2fv(this.index, this.value);\n };\n break;\n case 3:\n attr.vertexAttrib = function (gl) {\n gl.vertexAttrib3fv(this.index, this.value);\n };\n break;\n case 4:\n attr.vertexAttrib = function (gl) {\n gl.vertexAttrib4fv(this.index, this.value);\n };\n break;\n }\n\n attr.disableVertexAttribArray = function (gl) {};\n }\n\n attributes.push(attr);\n}\n\nfunction bind(gl, attributes, indexBuffer) {\n for (let i = 0; i < attributes.length; ++i) {\n const attribute = attributes[i];\n if (attribute.enabled) {\n attribute.vertexAttrib(gl);\n }\n }\n\n if (defined(indexBuffer)) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer._getBuffer());\n }\n}\n\n/**\n * Creates a vertex array, which defines the attributes making up a vertex, and contains an optional index buffer\n * to select vertices for rendering. Attributes are defined using object literals as shown in Example 1 below.\n *\n * @param {Object} options Object with the following properties:\n * @param {Context} options.context The context in which the VertexArray gets created.\n * @param {Object[]} options.attributes An array of attributes.\n * @param {IndexBuffer} [options.indexBuffer] An optional index buffer.\n *\n * @returns {VertexArray} The vertex array, ready for use with drawing.\n *\n * @exception {DeveloperError} Attribute must have a <code>vertexBuffer</code>.\n * @exception {DeveloperError} Attribute must have a <code>componentsPerAttribute</code>.\n * @exception {DeveloperError} Attribute must have a valid <code>componentDatatype</code> or not specify it.\n * @exception {DeveloperError} Attribute must have a <code>strideInBytes</code> less than or equal to 255 or not specify it.\n * @exception {DeveloperError} Index n is used by more than one attribute.\n *\n *\n * @example\n * // Example 1. Create a vertex array with vertices made up of three floating point\n * // values, e.g., a position, from a single vertex buffer. No index buffer is used.\n * const positionBuffer = Buffer.createVertexBuffer({\n * context : context,\n * sizeInBytes : 12,\n * usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n * {\n * index : 0,\n * enabled : true,\n * vertexBuffer : positionBuffer,\n * componentsPerAttribute : 3,\n * componentDatatype : ComponentDatatype.FLOAT,\n * normalize : false,\n * offsetInBytes : 0,\n * strideInBytes : 0 // tightly packed\n * instanceDivisor : 0 // not instanced\n * }\n * ];\n * const va = new VertexArray({\n * context : context,\n * attributes : attributes\n * });\n *\n * @example\n * // Example 2. Create a vertex array with vertices from two different vertex buffers.\n * // Each vertex has a three-component position and three-component normal.\n * const positionBuffer = Buffer.createVertexBuffer({\n * context : context,\n * sizeInBytes : 12,\n * usage : BufferUsage.STATIC_DRAW\n * });\n * const normalBuffer = Buffer.createVertexBuffer({\n * context : context,\n * sizeInBytes : 12,\n * usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n * {\n * index : 0,\n * vertexBuffer : positionBuffer,\n * componentsPerAttribute : 3,\n * componentDatatype : ComponentDatatype.FLOAT\n * },\n * {\n * index : 1,\n * vertexBuffer : normalBuffer,\n * componentsPerAttribute : 3,\n * componentDatatype : ComponentDatatype.FLOAT\n * }\n * ];\n * const va = new VertexArray({\n * context : context,\n * attributes : attributes\n * });\n *\n * @example\n * // Example 3. Creates the same vertex layout as Example 2 using a single\n * // vertex buffer, instead of two.\n * const buffer = Buffer.createVertexBuffer({\n * context : context,\n * sizeInBytes : 24,\n * usage : BufferUsage.STATIC_DRAW\n * });\n * const attributes = [\n * {\n * vertexBuffer : buffer,\n * componentsPerAttribute : 3,\n * componentDatatype : ComponentDatatype.FLOAT,\n * offsetInBytes : 0,\n * strideInBytes : 24\n * },\n * {\n * vertexBuffer : buffer,\n * componentsPerAttribute : 3,\n * componentDatatype : ComponentDatatype.FLOAT,\n * normalize : true,\n * offsetInBytes : 12,\n * strideInBytes : 24\n * }\n * ];\n * const va = new VertexArray({\n * context : context,\n * attributes : attributes\n * });\n *\n * @see Buffer#createVertexBuffer\n * @see Buffer#createIndexBuffer\n * @see Context#draw\n *\n * @private\n */\nfunction VertexArray(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const gl = context._gl;\n const attributes = options.attributes;\n const indexBuffer = options.indexBuffer;\n\n let i;\n const vaAttributes = [];\n let numberOfVertices = 1; // if every attribute is backed by a single value\n let hasInstancedAttributes = false;\n let hasConstantAttributes = false;\n\n let length = attributes.length;\n for (i = 0; i < length; ++i) {\n addAttribute(vaAttributes, attributes[i], i, context);\n }\n\n length = vaAttributes.length;\n for (i = 0; i < length; ++i) {\n const attribute = vaAttributes[i];\n\n if (defined(attribute.vertexBuffer) && attribute.instanceDivisor === 0) {\n // This assumes that each vertex buffer in the vertex array has the same number of vertices.\n const bytes =\n attribute.strideInBytes ||\n attribute.componentsPerAttribute *\n ComponentDatatype.getSizeInBytes(attribute.componentDatatype);\n numberOfVertices = attribute.vertexBuffer.sizeInBytes / bytes;\n break;\n }\n }\n\n for (i = 0; i < length; ++i) {\n if (vaAttributes[i].instanceDivisor > 0) {\n hasInstancedAttributes = true;\n }\n if (defined(vaAttributes[i].value)) {\n hasConstantAttributes = true;\n }\n }\n\n let vao;\n\n // Setup VAO if supported\n if (context.vertexArrayObject) {\n vao = context.glCreateVertexArray();\n context.glBindVertexArray(vao);\n bind(gl, vaAttributes, indexBuffer);\n context.glBindVertexArray(null);\n }\n\n this._numberOfVertices = numberOfVertices;\n this._hasInstancedAttributes = hasInstancedAttributes;\n this._hasConstantAttributes = hasConstantAttributes;\n this._context = context;\n this._gl = gl;\n this._vao = vao;\n this._attributes = vaAttributes;\n this._indexBuffer = indexBuffer;\n}\n\nfunction computeNumberOfVertices(attribute) {\n return attribute.values.length / attribute.componentsPerAttribute;\n}\n\nfunction computeAttributeSizeInBytes(attribute) {\n return (\n ComponentDatatype.getSizeInBytes(attribute.componentDatatype) *\n attribute.componentsPerAttribute\n );\n}\n\nfunction interleaveAttributes(attributes) {\n let j;\n let name;\n let attribute;\n\n // Extract attribute names.\n const names = [];\n for (name in attributes) {\n // Attribute needs to have per-vertex values; not a constant value for all vertices.\n if (\n attributes.hasOwnProperty(name) &&\n defined(attributes[name]) &&\n defined(attributes[name].values)\n ) {\n names.push(name);\n\n if (attributes[name].componentDatatype === ComponentDatatype.DOUBLE) {\n attributes[name].componentDatatype = ComponentDatatype.FLOAT;\n attributes[name].values = ComponentDatatype.createTypedArray(\n ComponentDatatype.FLOAT,\n attributes[name].values\n );\n }\n }\n }\n\n // Validation. Compute number of vertices.\n let numberOfVertices;\n const namesLength = names.length;\n\n if (namesLength > 0) {\n numberOfVertices = computeNumberOfVertices(attributes[names[0]]);\n\n for (j = 1; j < namesLength; ++j) {\n const currentNumberOfVertices = computeNumberOfVertices(\n attributes[names[j]]\n );\n\n if (currentNumberOfVertices !== numberOfVertices) {\n throw new RuntimeError(\n `${\n \"Each attribute list must have the same number of vertices. \" +\n \"Attribute \"\n }${names[j]} has a different number of vertices ` +\n `(${currentNumberOfVertices.toString()})` +\n ` than attribute ${names[0]} (${numberOfVertices.toString()}).`\n );\n }\n }\n }\n\n // Sort attributes by the size of their components. From left to right, a vertex stores floats, shorts, and then bytes.\n names.sort(function (left, right) {\n return (\n ComponentDatatype.getSizeInBytes(attributes[right].componentDatatype) -\n ComponentDatatype.getSizeInBytes(attributes[left].componentDatatype)\n );\n });\n\n // Compute sizes and strides.\n let vertexSizeInBytes = 0;\n const offsetsInBytes = {};\n\n for (j = 0; j < namesLength; ++j) {\n name = names[j];\n attribute = attributes[name];\n\n offsetsInBytes[name] = vertexSizeInBytes;\n vertexSizeInBytes += computeAttributeSizeInBytes(attribute);\n }\n\n if (vertexSizeInBytes > 0) {\n // Pad each vertex to be a multiple of the largest component datatype so each\n // attribute can be addressed using typed arrays.\n const maxComponentSizeInBytes = ComponentDatatype.getSizeInBytes(\n attributes[names[0]].componentDatatype\n ); // Sorted large to small\n const remainder = vertexSizeInBytes % maxComponentSizeInBytes;\n if (remainder !== 0) {\n vertexSizeInBytes += maxComponentSizeInBytes - remainder;\n }\n\n // Total vertex buffer size in bytes, including per-vertex padding.\n const vertexBufferSizeInBytes = numberOfVertices * vertexSizeInBytes;\n\n // Create array for interleaved vertices. Each attribute has a different view (pointer) into the array.\n const buffer = new ArrayBuffer(vertexBufferSizeInBytes);\n const views = {};\n\n for (j = 0; j < namesLength; ++j) {\n name = names[j];\n const sizeInBytes = ComponentDatatype.getSizeInBytes(\n attributes[name].componentDatatype\n );\n\n views[name] = {\n pointer: ComponentDatatype.createTypedArray(\n attributes[name].componentDatatype,\n buffer\n ),\n index: offsetsInBytes[name] / sizeInBytes, // Offset in ComponentType\n strideInComponentType: vertexSizeInBytes / sizeInBytes,\n };\n }\n\n // Copy attributes into one interleaved array.\n // PERFORMANCE_IDEA: Can we optimize these loops?\n for (j = 0; j < numberOfVertices; ++j) {\n for (let n = 0; n < namesLength; ++n) {\n name = names[n];\n attribute = attributes[name];\n const values = attribute.values;\n const view = views[name];\n const pointer = view.pointer;\n\n const numberOfComponents = attribute.componentsPerAttribute;\n for (let k = 0; k < numberOfComponents; ++k) {\n pointer[view.index + k] = values[j * numberOfComponents + k];\n }\n\n view.index += view.strideInComponentType;\n }\n }\n\n return {\n buffer: buffer,\n offsetsInBytes: offsetsInBytes,\n vertexSizeInBytes: vertexSizeInBytes,\n };\n }\n\n // No attributes to interleave.\n return undefined;\n}\n\n/**\n * Creates a vertex array from a geometry. A geometry contains vertex attributes and optional index data\n * in system memory, whereas a vertex array contains vertex buffers and an optional index buffer in WebGL\n * memory for use with rendering.\n * <br /><br />\n * The <code>geometry</code> argument should use the standard layout like the geometry returned by {@link BoxGeometry}.\n * <br /><br />\n * <code>options</code> can have four properties:\n * <ul>\n * <li><code>geometry</code>: The source geometry containing data used to create the vertex array.</li>\n * <li><code>attributeLocations</code>: An object that maps geometry attribute names to vertex shader attribute locations.</li>\n * <li><code>bufferUsage</code>: The expected usage pattern of the vertex array's buffers. On some WebGL implementations, this can significantly affect performance. See {@link BufferUsage}. Default: <code>BufferUsage.DYNAMIC_DRAW</code>.</li>\n * <li><code>interleave</code>: Determines if all attributes are interleaved in a single vertex buffer or if each attribute is stored in a separate vertex buffer. Default: <code>false</code>.</li>\n * </ul>\n * <br />\n * If <code>options</code> is not specified or the <code>geometry</code> contains no data, the returned vertex array is empty.\n *\n * @param {Object} options An object defining the geometry, attribute indices, buffer usage, and vertex layout used to create the vertex array.\n *\n * @exception {RuntimeError} Each attribute list must have the same number of vertices.\n * @exception {DeveloperError} The geometry must have zero or one index lists.\n * @exception {DeveloperError} Index n is used by more than one attribute.\n *\n *\n * @example\n * // Example 1. Creates a vertex array for rendering a box. The default dynamic draw\n * // usage is used for the created vertex and index buffer. The attributes are not\n * // interleaved by default.\n * const geometry = new BoxGeometry();\n * const va = VertexArray.fromGeometry({\n * context : context,\n * geometry : geometry,\n * attributeLocations : GeometryPipeline.createAttributeLocations(geometry),\n * });\n *\n * @example\n * // Example 2. Creates a vertex array with interleaved attributes in a\n * // single vertex buffer. The vertex and index buffer have static draw usage.\n * const va = VertexArray.fromGeometry({\n * context : context,\n * geometry : geometry,\n * attributeLocations : GeometryPipeline.createAttributeLocations(geometry),\n * bufferUsage : BufferUsage.STATIC_DRAW,\n * interleave : true\n * });\n *\n * @example\n * // Example 3. When the caller destroys the vertex array, it also destroys the\n * // attached vertex buffer(s) and index buffer.\n * va = va.destroy();\n *\n * @see Buffer#createVertexBuffer\n * @see Buffer#createIndexBuffer\n * @see GeometryPipeline.createAttributeLocations\n * @see ShaderProgram\n */\nVertexArray.fromGeometry = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const geometry = defaultValue(options.geometry, defaultValue.EMPTY_OBJECT);\n\n const bufferUsage = defaultValue(\n options.bufferUsage,\n BufferUsage.DYNAMIC_DRAW\n );\n\n const attributeLocations = defaultValue(\n options.attributeLocations,\n defaultValue.EMPTY_OBJECT\n );\n const interleave = defaultValue(options.interleave, false);\n const createdVAAttributes = options.vertexArrayAttributes;\n\n let name;\n let attribute;\n let vertexBuffer;\n const vaAttributes = defined(createdVAAttributes) ? createdVAAttributes : [];\n const attributes = geometry.attributes;\n\n if (interleave) {\n // Use a single vertex buffer with interleaved vertices.\n const interleavedAttributes = interleaveAttributes(attributes);\n if (defined(interleavedAttributes)) {\n vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: interleavedAttributes.buffer,\n usage: bufferUsage,\n });\n const offsetsInBytes = interleavedAttributes.offsetsInBytes;\n const strideInBytes = interleavedAttributes.vertexSizeInBytes;\n\n for (name in attributes) {\n if (attributes.hasOwnProperty(name) && defined(attributes[name])) {\n attribute = attributes[name];\n\n if (defined(attribute.values)) {\n // Common case: per-vertex attributes\n vaAttributes.push({\n index: attributeLocations[name],\n vertexBuffer: vertexBuffer,\n componentDatatype: attribute.componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n offsetInBytes: offsetsInBytes[name],\n strideInBytes: strideInBytes,\n });\n } else {\n // Constant attribute for all vertices\n vaAttributes.push({\n index: attributeLocations[name],\n value: attribute.value,\n componentDatatype: attribute.componentDatatype,\n normalize: attribute.normalize,\n });\n }\n }\n }\n }\n } else {\n // One vertex buffer per attribute.\n for (name in attributes) {\n if (attributes.hasOwnProperty(name) && defined(attributes[name])) {\n attribute = attributes[name];\n\n let componentDatatype = attribute.componentDatatype;\n if (componentDatatype === ComponentDatatype.DOUBLE) {\n componentDatatype = ComponentDatatype.FLOAT;\n }\n\n vertexBuffer = undefined;\n if (defined(attribute.values)) {\n vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: ComponentDatatype.createTypedArray(\n componentDatatype,\n attribute.values\n ),\n usage: bufferUsage,\n });\n }\n\n vaAttributes.push({\n index: attributeLocations[name],\n vertexBuffer: vertexBuffer,\n value: attribute.value,\n componentDatatype: componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n });\n }\n }\n }\n\n let indexBuffer;\n const indices = geometry.indices;\n if (defined(indices)) {\n if (\n Geometry.computeNumberOfVertices(geometry) >=\n CesiumMath.SIXTY_FOUR_KILOBYTES &&\n context.elementIndexUint\n ) {\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: new Uint32Array(indices),\n usage: bufferUsage,\n indexDatatype: IndexDatatype.UNSIGNED_INT,\n });\n } else {\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: new Uint16Array(indices),\n usage: bufferUsage,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n }\n }\n\n return new VertexArray({\n context: context,\n attributes: vaAttributes,\n indexBuffer: indexBuffer,\n });\n};\n\nObject.defineProperties(VertexArray.prototype, {\n numberOfAttributes: {\n get: function () {\n return this._attributes.length;\n },\n },\n numberOfVertices: {\n get: function () {\n return this._numberOfVertices;\n },\n },\n indexBuffer: {\n get: function () {\n return this._indexBuffer;\n },\n },\n});\n\n/**\n * index is the location in the array of attributes, not the index property of an attribute.\n */\nVertexArray.prototype.getAttribute = function (index) {\n return this._attributes[index];\n};\n\n// Workaround for ANGLE, where the attribute divisor seems to be part of the global state instead\n// of the VAO state. This function is called when the vao is bound, and should be removed\n// once the ANGLE issue is resolved. Setting the divisor should normally happen in vertexAttrib and\n// disableVertexAttribArray.\nfunction setVertexAttribDivisor(vertexArray) {\n const context = vertexArray._context;\n const hasInstancedAttributes = vertexArray._hasInstancedAttributes;\n if (!hasInstancedAttributes && !context._previousDrawInstanced) {\n return;\n }\n context._previousDrawInstanced = hasInstancedAttributes;\n\n const divisors = context._vertexAttribDivisors;\n const attributes = vertexArray._attributes;\n const maxAttributes = ContextLimits.maximumVertexAttributes;\n let i;\n\n if (hasInstancedAttributes) {\n const length = attributes.length;\n for (i = 0; i < length; ++i) {\n const attribute = attributes[i];\n if (attribute.enabled) {\n const divisor = attribute.instanceDivisor;\n const index = attribute.index;\n if (divisor !== divisors[index]) {\n context.glVertexAttribDivisor(index, divisor);\n divisors[index] = divisor;\n }\n }\n }\n } else {\n for (i = 0; i < maxAttributes; ++i) {\n if (divisors[i] > 0) {\n context.glVertexAttribDivisor(i, 0);\n divisors[i] = 0;\n }\n }\n }\n}\n\n// Vertex attributes backed by a constant value go through vertexAttrib[1234]f[v]\n// which is part of context state rather than VAO state.\nfunction setConstantAttributes(vertexArray, gl) {\n const attributes = vertexArray._attributes;\n const length = attributes.length;\n for (let i = 0; i < length; ++i) {\n const attribute = attributes[i];\n if (attribute.enabled && defined(attribute.value)) {\n attribute.vertexAttrib(gl);\n }\n }\n}\n\nVertexArray.prototype._bind = function () {\n if (defined(this._vao)) {\n this._context.glBindVertexArray(this._vao);\n if (this._context.instancedArrays) {\n setVertexAttribDivisor(this);\n }\n if (this._hasConstantAttributes) {\n setConstantAttributes(this, this._gl);\n }\n } else {\n bind(this._gl, this._attributes, this._indexBuffer);\n }\n};\n\nVertexArray.prototype._unBind = function () {\n if (defined(this._vao)) {\n this._context.glBindVertexArray(null);\n } else {\n const attributes = this._attributes;\n const gl = this._gl;\n\n for (let i = 0; i < attributes.length; ++i) {\n const attribute = attributes[i];\n if (attribute.enabled) {\n attribute.disableVertexAttribArray(gl);\n }\n }\n if (this._indexBuffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n }\n }\n};\n\nVertexArray.prototype.isDestroyed = function () {\n return false;\n};\n\nVertexArray.prototype.destroy = function () {\n const attributes = this._attributes;\n for (let i = 0; i < attributes.length; ++i) {\n const vertexBuffer = attributes[i].vertexBuffer;\n if (\n defined(vertexBuffer) &&\n !vertexBuffer.isDestroyed() &&\n vertexBuffer.vertexArrayDestroyable\n ) {\n vertexBuffer.destroy();\n }\n }\n\n const indexBuffer = this._indexBuffer;\n if (\n defined(indexBuffer) &&\n !indexBuffer.isDestroyed() &&\n indexBuffer.vertexArrayDestroyable\n ) {\n indexBuffer.destroy();\n }\n\n if (defined(this._vao)) {\n this._context.glDeleteVertexArray(this._vao);\n }\n\n return destroyObject(this);\n};\nexport default VertexArray;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n/**\n * Creates a texture to look up per instance attributes for batched primitives. For example, store each primitive's pick color in the texture.\n *\n * @alias BatchTable\n * @constructor\n * @private\n *\n * @param {Context} context The context in which the batch table is created.\n * @param {Object[]} attributes An array of objects describing a per instance attribute. Each object contains a datatype, components per attributes, whether it is normalized and a function name\n * to retrieve the value in the vertex shader.\n * @param {Number} numberOfInstances The number of instances in a batch table.\n *\n * @example\n * // create the batch table\n * const attributes = [{\n * functionName : 'getShow',\n * componentDatatype : ComponentDatatype.UNSIGNED_BYTE,\n * componentsPerAttribute : 1\n * }, {\n * functionName : 'getPickColor',\n * componentDatatype : ComponentDatatype.UNSIGNED_BYTE,\n * componentsPerAttribute : 4,\n * normalize : true\n * }];\n * const batchTable = new BatchTable(context, attributes, 5);\n *\n * // when creating the draw commands, update the uniform map and the vertex shader\n * vertexShaderSource = batchTable.getVertexShaderCallback()(vertexShaderSource);\n * const shaderProgram = ShaderProgram.fromCache({\n * // ...\n * vertexShaderSource : vertexShaderSource,\n * });\n *\n * drawCommand.shaderProgram = shaderProgram;\n * drawCommand.uniformMap = batchTable.getUniformMapCallback()(uniformMap);\n *\n * // use the attribute function names in the shader to retrieve the instance values\n * // ...\n * attribute float batchId;\n *\n * void main() {\n * // ...\n * float show = getShow(batchId);\n * vec3 pickColor = getPickColor(batchId);\n * // ...\n * }\n */\nfunction BatchTable(context, attributes, numberOfInstances) {\n this._attributes = attributes;\n this._numberOfInstances = numberOfInstances;\n\n if (attributes.length === 0) {\n return;\n }\n\n // PERFORMANCE_IDEA: We may be able to arrange the attributes so they can be packing into fewer texels.\n // Right now, an attribute with one component uses an entire texel when 4 single component attributes can\n // be packed into a texel.\n //\n // Packing floats into unsigned byte textures makes the problem worse. A single component float attribute\n // will be packed into a single texel leaving 3 texels unused. 4 texels are reserved for each float attribute\n // regardless of how many components it has.\n const pixelDatatype = getDatatype(attributes);\n const textureFloatSupported = context.floatingPointTexture;\n const packFloats =\n pixelDatatype === PixelDatatype.FLOAT && !textureFloatSupported;\n const offsets = createOffsets(attributes, packFloats);\n\n const stride = getStride(offsets, attributes, packFloats);\n const maxNumberOfInstancesPerRow = Math.floor(\n ContextLimits.maximumTextureSize / stride\n );\n\n const instancesPerWidth = Math.min(\n numberOfInstances,\n maxNumberOfInstancesPerRow\n );\n const width = stride * instancesPerWidth;\n const height = Math.ceil(numberOfInstances / instancesPerWidth);\n\n const stepX = 1.0 / width;\n const centerX = stepX * 0.5;\n const stepY = 1.0 / height;\n const centerY = stepY * 0.5;\n\n this._textureDimensions = new Cartesian2(width, height);\n this._textureStep = new Cartesian4(stepX, centerX, stepY, centerY);\n this._pixelDatatype = !packFloats\n ? pixelDatatype\n : PixelDatatype.UNSIGNED_BYTE;\n this._packFloats = packFloats;\n this._offsets = offsets;\n this._stride = stride;\n this._texture = undefined;\n\n const batchLength = 4 * width * height;\n this._batchValues =\n pixelDatatype === PixelDatatype.FLOAT && !packFloats\n ? new Float32Array(batchLength)\n : new Uint8Array(batchLength);\n this._batchValuesDirty = false;\n}\n\nObject.defineProperties(BatchTable.prototype, {\n /**\n * The attribute descriptions.\n * @memberOf BatchTable.prototype\n * @type {Object[]}\n * @readonly\n */\n attributes: {\n get: function () {\n return this._attributes;\n },\n },\n /**\n * The number of instances.\n * @memberOf BatchTable.prototype\n * @type {Number}\n * @readonly\n */\n numberOfInstances: {\n get: function () {\n return this._numberOfInstances;\n },\n },\n});\n\nfunction getDatatype(attributes) {\n let foundFloatDatatype = false;\n const length = attributes.length;\n for (let i = 0; i < length; ++i) {\n if (attributes[i].componentDatatype !== ComponentDatatype.UNSIGNED_BYTE) {\n foundFloatDatatype = true;\n break;\n }\n }\n return foundFloatDatatype ? PixelDatatype.FLOAT : PixelDatatype.UNSIGNED_BYTE;\n}\n\nfunction getAttributeType(attributes, attributeIndex) {\n const componentsPerAttribute =\n attributes[attributeIndex].componentsPerAttribute;\n if (componentsPerAttribute === 2) {\n return Cartesian2;\n } else if (componentsPerAttribute === 3) {\n return Cartesian3;\n } else if (componentsPerAttribute === 4) {\n return Cartesian4;\n }\n return Number;\n}\n\nfunction createOffsets(attributes, packFloats) {\n const offsets = new Array(attributes.length);\n\n let currentOffset = 0;\n const attributesLength = attributes.length;\n for (let i = 0; i < attributesLength; ++i) {\n const attribute = attributes[i];\n const componentDatatype = attribute.componentDatatype;\n\n offsets[i] = currentOffset;\n\n if (componentDatatype !== ComponentDatatype.UNSIGNED_BYTE && packFloats) {\n currentOffset += 4;\n } else {\n ++currentOffset;\n }\n }\n\n return offsets;\n}\n\nfunction getStride(offsets, attributes, packFloats) {\n const length = offsets.length;\n const lastOffset = offsets[length - 1];\n const lastAttribute = attributes[length - 1];\n const componentDatatype = lastAttribute.componentDatatype;\n\n if (componentDatatype !== ComponentDatatype.UNSIGNED_BYTE && packFloats) {\n return lastOffset + 4;\n }\n return lastOffset + 1;\n}\n\nconst scratchPackedFloatCartesian4 = new Cartesian4();\n\nfunction getPackedFloat(array, index, result) {\n let packed = Cartesian4.unpack(array, index, scratchPackedFloatCartesian4);\n const x = Cartesian4.unpackFloat(packed);\n\n packed = Cartesian4.unpack(array, index + 4, scratchPackedFloatCartesian4);\n const y = Cartesian4.unpackFloat(packed);\n\n packed = Cartesian4.unpack(array, index + 8, scratchPackedFloatCartesian4);\n const z = Cartesian4.unpackFloat(packed);\n\n packed = Cartesian4.unpack(array, index + 12, scratchPackedFloatCartesian4);\n const w = Cartesian4.unpackFloat(packed);\n\n return Cartesian4.fromElements(x, y, z, w, result);\n}\n\nfunction setPackedAttribute(value, array, index) {\n let packed = Cartesian4.packFloat(value.x, scratchPackedFloatCartesian4);\n Cartesian4.pack(packed, array, index);\n\n packed = Cartesian4.packFloat(value.y, packed);\n Cartesian4.pack(packed, array, index + 4);\n\n packed = Cartesian4.packFloat(value.z, packed);\n Cartesian4.pack(packed, array, index + 8);\n\n packed = Cartesian4.packFloat(value.w, packed);\n Cartesian4.pack(packed, array, index + 12);\n}\n\nconst scratchGetAttributeCartesian4 = new Cartesian4();\n\n/**\n * Gets the value of an attribute in the table.\n *\n * @param {Number} instanceIndex The index of the instance.\n * @param {Number} attributeIndex The index of the attribute.\n * @param {undefined|Cartesian2|Cartesian3|Cartesian4} [result] The object onto which to store the result. The type is dependent on the attribute's number of components.\n * @returns {Number|Cartesian2|Cartesian3|Cartesian4} The attribute value stored for the instance.\n *\n * @exception {DeveloperError} instanceIndex is out of range.\n * @exception {DeveloperError} attributeIndex is out of range.\n */\nBatchTable.prototype.getBatchedAttribute = function (\n instanceIndex,\n attributeIndex,\n result\n) {\n const attributes = this._attributes;\n const offset = this._offsets[attributeIndex];\n const stride = this._stride;\n\n const index = 4 * stride * instanceIndex + 4 * offset;\n let value;\n\n if (\n this._packFloats &&\n attributes[attributeIndex].componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n ) {\n value = getPackedFloat(\n this._batchValues,\n index,\n scratchGetAttributeCartesian4\n );\n } else {\n value = Cartesian4.unpack(\n this._batchValues,\n index,\n scratchGetAttributeCartesian4\n );\n }\n\n const attributeType = getAttributeType(attributes, attributeIndex);\n if (defined(attributeType.fromCartesian4)) {\n return attributeType.fromCartesian4(value, result);\n } else if (defined(attributeType.clone)) {\n return attributeType.clone(value, result);\n }\n\n return value.x;\n};\n\nconst setAttributeScratchValues = [\n undefined,\n undefined,\n new Cartesian2(),\n new Cartesian3(),\n new Cartesian4(),\n];\nconst setAttributeScratchCartesian4 = new Cartesian4();\n\n/**\n * Sets the value of an attribute in the table.\n *\n * @param {Number} instanceIndex The index of the instance.\n * @param {Number} attributeIndex The index of the attribute.\n * @param {Number|Cartesian2|Cartesian3|Cartesian4} value The value to be stored in the table. The type of value will depend on the number of components of the attribute.\n *\n * @exception {DeveloperError} instanceIndex is out of range.\n * @exception {DeveloperError} attributeIndex is out of range.\n */\nBatchTable.prototype.setBatchedAttribute = function (\n instanceIndex,\n attributeIndex,\n value\n) {\n const attributes = this._attributes;\n const result =\n setAttributeScratchValues[\n attributes[attributeIndex].componentsPerAttribute\n ];\n const currentAttribute = this.getBatchedAttribute(\n instanceIndex,\n attributeIndex,\n result\n );\n const attributeType = getAttributeType(this._attributes, attributeIndex);\n const entriesEqual = defined(attributeType.equals)\n ? attributeType.equals(currentAttribute, value)\n : currentAttribute === value;\n if (entriesEqual) {\n return;\n }\n\n const attributeValue = setAttributeScratchCartesian4;\n attributeValue.x = defined(value.x) ? value.x : value;\n attributeValue.y = defined(value.y) ? value.y : 0.0;\n attributeValue.z = defined(value.z) ? value.z : 0.0;\n attributeValue.w = defined(value.w) ? value.w : 0.0;\n\n const offset = this._offsets[attributeIndex];\n const stride = this._stride;\n const index = 4 * stride * instanceIndex + 4 * offset;\n\n if (\n this._packFloats &&\n attributes[attributeIndex].componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n ) {\n setPackedAttribute(attributeValue, this._batchValues, index);\n } else {\n Cartesian4.pack(attributeValue, this._batchValues, index);\n }\n\n this._batchValuesDirty = true;\n};\n\nfunction createTexture(batchTable, context) {\n const dimensions = batchTable._textureDimensions;\n batchTable._texture = new Texture({\n context: context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: batchTable._pixelDatatype,\n width: dimensions.x,\n height: dimensions.y,\n sampler: Sampler.NEAREST,\n flipY: false,\n });\n}\n\nfunction updateTexture(batchTable) {\n const dimensions = batchTable._textureDimensions;\n batchTable._texture.copyFrom({\n source: {\n width: dimensions.x,\n height: dimensions.y,\n arrayBufferView: batchTable._batchValues,\n },\n });\n}\n\n/**\n * Creates/updates the batch table texture.\n * @param {FrameState} frameState The frame state.\n *\n * @exception {RuntimeError} The floating point texture extension is required but not supported.\n */\nBatchTable.prototype.update = function (frameState) {\n if (\n (defined(this._texture) && !this._batchValuesDirty) ||\n this._attributes.length === 0\n ) {\n return;\n }\n\n this._batchValuesDirty = false;\n\n if (!defined(this._texture)) {\n createTexture(this, frameState.context);\n }\n updateTexture(this);\n};\n\n/**\n * Gets a function that will update a uniform map to contain values for looking up values in the batch table.\n *\n * @returns {BatchTable.updateUniformMapCallback} A callback for updating uniform maps.\n */\nBatchTable.prototype.getUniformMapCallback = function () {\n const that = this;\n return function (uniformMap) {\n if (that._attributes.length === 0) {\n return uniformMap;\n }\n\n const batchUniformMap = {\n batchTexture: function () {\n return that._texture;\n },\n batchTextureDimensions: function () {\n return that._textureDimensions;\n },\n batchTextureStep: function () {\n return that._textureStep;\n },\n };\n return combine(uniformMap, batchUniformMap);\n };\n};\n\nfunction getGlslComputeSt(batchTable) {\n const stride = batchTable._stride;\n\n // GLSL batchId is zero-based: [0, numberOfInstances - 1]\n if (batchTable._textureDimensions.y === 1) {\n return (\n `${\n \"uniform vec4 batchTextureStep; \\n\" +\n \"vec2 computeSt(float batchId) \\n\" +\n \"{ \\n\" +\n \" float stepX = batchTextureStep.x; \\n\" +\n \" float centerX = batchTextureStep.y; \\n\" +\n \" float numberOfAttributes = float(\"\n }${stride}); \\n` +\n ` return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \\n` +\n `} \\n`\n );\n }\n\n return (\n `${\n \"uniform vec4 batchTextureStep; \\n\" +\n \"uniform vec2 batchTextureDimensions; \\n\" +\n \"vec2 computeSt(float batchId) \\n\" +\n \"{ \\n\" +\n \" float stepX = batchTextureStep.x; \\n\" +\n \" float centerX = batchTextureStep.y; \\n\" +\n \" float stepY = batchTextureStep.z; \\n\" +\n \" float centerY = batchTextureStep.w; \\n\" +\n \" float numberOfAttributes = float(\"\n }${stride}); \\n` +\n ` float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \\n` +\n ` float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \\n` +\n ` return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \\n` +\n `} \\n`\n );\n}\n\nfunction getComponentType(componentsPerAttribute) {\n if (componentsPerAttribute === 1) {\n return \"float\";\n }\n return `vec${componentsPerAttribute}`;\n}\n\nfunction getComponentSwizzle(componentsPerAttribute) {\n if (componentsPerAttribute === 1) {\n return \".x\";\n } else if (componentsPerAttribute === 2) {\n return \".xy\";\n } else if (componentsPerAttribute === 3) {\n return \".xyz\";\n }\n return \"\";\n}\n\nfunction getGlslAttributeFunction(batchTable, attributeIndex) {\n const attributes = batchTable._attributes;\n const attribute = attributes[attributeIndex];\n const componentsPerAttribute = attribute.componentsPerAttribute;\n const functionName = attribute.functionName;\n const functionReturnType = getComponentType(componentsPerAttribute);\n const functionReturnValue = getComponentSwizzle(componentsPerAttribute);\n\n const offset = batchTable._offsets[attributeIndex];\n\n let glslFunction =\n `${functionReturnType} ${functionName}(float batchId) \\n` +\n `{ \\n` +\n ` vec2 st = computeSt(batchId); \\n` +\n ` st.x += batchTextureStep.x * float(${offset}); \\n`;\n\n if (\n batchTable._packFloats &&\n attribute.componentDatatype !== PixelDatatype.UNSIGNED_BYTE\n ) {\n glslFunction +=\n \"vec4 textureValue; \\n\" +\n \"textureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \\n\" +\n \"textureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \\n\" +\n \"textureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \\n\" +\n \"textureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \\n\";\n } else {\n glslFunction += \" vec4 textureValue = texture2D(batchTexture, st); \\n\";\n }\n\n glslFunction += ` ${functionReturnType} value = textureValue${functionReturnValue}; \\n`;\n\n if (\n batchTable._pixelDatatype === PixelDatatype.UNSIGNED_BYTE &&\n attribute.componentDatatype === ComponentDatatype.UNSIGNED_BYTE &&\n !attribute.normalize\n ) {\n glslFunction += \"value *= 255.0; \\n\";\n } else if (\n batchTable._pixelDatatype === PixelDatatype.FLOAT &&\n attribute.componentDatatype === ComponentDatatype.UNSIGNED_BYTE &&\n attribute.normalize\n ) {\n glslFunction += \"value /= 255.0; \\n\";\n }\n\n glslFunction += \" return value; \\n\" + \"} \\n\";\n return glslFunction;\n}\n\n/**\n * Gets a function that will update a vertex shader to contain functions for looking up values in the batch table.\n *\n * @returns {BatchTable.updateVertexShaderSourceCallback} A callback for updating a vertex shader source.\n */\nBatchTable.prototype.getVertexShaderCallback = function () {\n const attributes = this._attributes;\n if (attributes.length === 0) {\n return function (source) {\n return source;\n };\n }\n\n let batchTableShader = \"uniform highp sampler2D batchTexture; \\n\";\n batchTableShader += `${getGlslComputeSt(this)}\\n`;\n\n const length = attributes.length;\n for (let i = 0; i < length; ++i) {\n batchTableShader += getGlslAttributeFunction(this, i);\n }\n\n return function (source) {\n const mainIndex = source.indexOf(\"void main\");\n const beforeMain = source.substring(0, mainIndex);\n const afterMain = source.substring(mainIndex);\n return `${beforeMain}\\n${batchTableShader}\\n${afterMain}`;\n };\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BatchTable#destroy\n */\nBatchTable.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see BatchTable#isDestroyed\n */\nBatchTable.prototype.destroy = function () {\n this._texture = this._texture && this._texture.destroy();\n return destroyObject(this);\n};\n\n/**\n * A callback for updating uniform maps.\n * @callback BatchTable.updateUniformMapCallback\n *\n * @param {Object} uniformMap The uniform map.\n * @returns {Object} The new uniform map with properties for retrieving values from the batch table.\n */\n\n/**\n * A callback for updating a vertex shader source.\n * @callback BatchTable.updateVertexShaderSourceCallback\n *\n * @param {String} vertexShaderSource The vertex shader source.\n * @returns {String} The new vertex shader source with the functions for retrieving batch table values injected.\n */\nexport default BatchTable;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum describing the attribute type for glTF and 3D Tiles.\n *\n * @enum {String}\n *\n * @private\n */\nconst AttributeType = {\n /**\n * The attribute is a single component.\n *\n * @type {String}\n * @constant\n */\n SCALAR: \"SCALAR\",\n\n /**\n * The attribute is a two-component vector.\n *\n * @type {String}\n * @constant\n */\n VEC2: \"VEC2\",\n\n /**\n * The attribute is a three-component vector.\n *\n * @type {String}\n * @constant\n */\n VEC3: \"VEC3\",\n\n /**\n * The attribute is a four-component vector.\n *\n * @type {String}\n * @constant\n */\n VEC4: \"VEC4\",\n\n /**\n * The attribute is a 2x2 matrix.\n *\n * @type {String}\n * @constant\n */\n MAT2: \"MAT2\",\n\n /**\n * The attribute is a 3x3 matrix.\n *\n * @type {String}\n * @constant\n */\n MAT3: \"MAT3\",\n\n /**\n * The attribute is a 4x4 matrix.\n *\n * @type {String}\n * @constant\n */\n MAT4: \"MAT4\",\n};\n\n/**\n * Gets the scalar, vector, or matrix type for the attribute type.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {*} The math type.\n *\n * @private\n */\nAttributeType.getMathType = function (attributeType) {\n switch (attributeType) {\n case AttributeType.SCALAR:\n return Number;\n case AttributeType.VEC2:\n return Cartesian2;\n case AttributeType.VEC3:\n return Cartesian3;\n case AttributeType.VEC4:\n return Cartesian4;\n case AttributeType.MAT2:\n return Matrix2;\n case AttributeType.MAT3:\n return Matrix3;\n case AttributeType.MAT4:\n return Matrix4;\n}\n};\n\n/**\n * Gets the number of components per attribute.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {Number} The number of components.\n *\n * @private\n */\nAttributeType.getNumberOfComponents = function (attributeType) {\n switch (attributeType) {\n case AttributeType.SCALAR:\n return 1;\n case AttributeType.VEC2:\n return 2;\n case AttributeType.VEC3:\n return 3;\n case AttributeType.VEC4:\n case AttributeType.MAT2:\n return 4;\n case AttributeType.MAT3:\n return 9;\n case AttributeType.MAT4:\n return 16;\n}\n};\n\n/**\n * Get the number of attribute locations needed to fit this attribute. Most\n * types require one, but matrices require multiple attribute locations.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {Number} The number of attribute locations needed in the shader\n *\n * @private\n */\nAttributeType.getAttributeLocationCount = function (attributeType) {\n switch (attributeType) {\n case AttributeType.SCALAR:\n case AttributeType.VEC2:\n case AttributeType.VEC3:\n case AttributeType.VEC4:\n return 1;\n case AttributeType.MAT2:\n return 2;\n case AttributeType.MAT3:\n return 3;\n case AttributeType.MAT4:\n return 4;\n}\n};\n\n/**\n * Gets the GLSL type for the attribute type.\n *\n * @param {AttributeType} attributeType The attribute type.\n * @returns {String} The GLSL type for the attribute type.\n *\n * @private\n */\nAttributeType.getGlslType = function (attributeType) {\n switch (attributeType) {\n case AttributeType.SCALAR:\n return \"float\";\n case AttributeType.VEC2:\n return \"vec2\";\n case AttributeType.VEC3:\n return \"vec3\";\n case AttributeType.VEC4:\n return \"vec4\";\n case AttributeType.MAT2:\n return \"mat2\";\n case AttributeType.MAT3:\n return \"mat3\";\n case AttributeType.MAT4:\n return \"mat4\";\n}\n};\n\nexport default Object.freeze(AttributeType);\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport AttributeType from \"../Scene/AttributeType.js\";\n\nconst RIGHT_SHIFT = 1.0 / 256.0;\nconst LEFT_SHIFT = 256.0;\n\n/**\n * Attribute compression and decompression functions.\n *\n * @namespace AttributeCompression\n *\n * @private\n */\nconst AttributeCompression = {};\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-rangeMax] following the 'oct' encoding.\n *\n * Oct encoding is a compact representation of unit length vectors.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: {@link http://jcgt.org/published/0003/02/01/}\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 component 'oct' encoding.\n * @param {Cartesian2} result The 2 component oct-encoded unit length vector.\n * @param {Number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @returns {Cartesian2} The 2 component oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octDecodeInRange\n */\nAttributeCompression.octEncodeInRange = function (vector, rangeMax, result) {\n result.x =\n vector.x / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));\n result.y =\n vector.y / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));\n if (vector.z < 0) {\n const x = result.x;\n const y = result.y;\n result.x = (1.0 - Math.abs(y)) * CesiumMath.signNotZero(x);\n result.y = (1.0 - Math.abs(x)) * CesiumMath.signNotZero(y);\n }\n\n result.x = CesiumMath.toSNorm(result.x, rangeMax);\n result.y = CesiumMath.toSNorm(result.y, rangeMax);\n\n return result;\n};\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding.\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.\n * @param {Cartesian2} result The 2 byte oct-encoded unit length vector.\n * @returns {Cartesian2} The 2 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octEncodeInRange\n * @see AttributeCompression.octDecode\n */\nAttributeCompression.octEncode = function (vector, result) {\n return AttributeCompression.octEncodeInRange(vector, 255, result);\n};\n\nconst octEncodeScratch = new Cartesian2();\nconst uint8ForceArray = new Uint8Array(1);\nfunction forceUint8(value) {\n uint8ForceArray[0] = value;\n return uint8ForceArray[0];\n}\n/**\n * @param {Cartesian3} vector The normalized vector to be compressed into 4 byte 'oct' encoding.\n * @param {Cartesian4} result The 4 byte oct-encoded unit length vector.\n * @returns {Cartesian4} The 4 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n *\n * @see AttributeCompression.octEncodeInRange\n * @see AttributeCompression.octDecodeFromCartesian4\n */\nAttributeCompression.octEncodeToCartesian4 = function (vector, result) {\n AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);\n result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);\n result.y = forceUint8(octEncodeScratch.x);\n result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);\n result.w = forceUint8(octEncodeScratch.y);\n return result;\n};\n\n/**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector.\n *\n * @param {Number} x The x component of the oct-encoded unit length vector.\n * @param {Number} y The y component of the oct-encoded unit length vector.\n * @param {Number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n * @param {Cartesian3} result The decoded and normalized vector\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x and y must be unsigned normalized integers between 0 and rangeMax.\n *\n * @see AttributeCompression.octEncodeInRange\n */\nAttributeCompression.octDecodeInRange = function (x, y, rangeMax, result) {\n result.x = CesiumMath.fromSNorm(x, rangeMax);\n result.y = CesiumMath.fromSNorm(y, rangeMax);\n result.z = 1.0 - (Math.abs(result.x) + Math.abs(result.y));\n\n if (result.z < 0.0) {\n const oldVX = result.x;\n result.x = (1.0 - Math.abs(result.y)) * CesiumMath.signNotZero(oldVX);\n result.y = (1.0 - Math.abs(oldVX)) * CesiumMath.signNotZero(result.y);\n }\n\n return Cartesian3.normalize(result, result);\n};\n\n/**\n * Decodes a unit-length vector in 2 byte 'oct' encoding to a normalized 3-component vector.\n *\n * @param {Number} x The x component of the oct-encoded unit length vector.\n * @param {Number} y The y component of the oct-encoded unit length vector.\n * @param {Cartesian3} result The decoded and normalized vector.\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and 255.\n *\n * @see AttributeCompression.octDecodeInRange\n */\nAttributeCompression.octDecode = function (x, y, result) {\n return AttributeCompression.octDecodeInRange(x, y, 255, result);\n};\n\n/**\n * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector.\n *\n * @param {Cartesian4} encoded The oct-encoded unit length vector.\n * @param {Cartesian3} result The decoded and normalized vector.\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n * @exception {DeveloperError} x, y, z, and w must be unsigned normalized integers between 0 and 255.\n *\n * @see AttributeCompression.octDecodeInRange\n * @see AttributeCompression.octEncodeToCartesian4\n */\nAttributeCompression.octDecodeFromCartesian4 = function (encoded, result) {\nconst x = encoded.x;\n const y = encoded.y;\n const z = encoded.z;\n const w = encoded.w;\n const xOct16 = x * LEFT_SHIFT + y;\n const yOct16 = z * LEFT_SHIFT + w;\n return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);\n};\n\n/**\n * Packs an oct encoded vector into a single floating-point number.\n *\n * @param {Cartesian2} encoded The oct encoded vector.\n * @returns {Number} The oct encoded vector packed into a single float.\n *\n */\nAttributeCompression.octPackFloat = function (encoded) {\nreturn 256.0 * encoded.x + encoded.y;\n};\n\nconst scratchEncodeCart2 = new Cartesian2();\n\n/**\n * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding and\n * stores those values in a single float-point number.\n *\n * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.\n * @returns {Number} The 2 byte oct-encoded unit length vector.\n *\n * @exception {DeveloperError} vector must be normalized.\n */\nAttributeCompression.octEncodeFloat = function (vector) {\n AttributeCompression.octEncode(vector, scratchEncodeCart2);\n return AttributeCompression.octPackFloat(scratchEncodeCart2);\n};\n\n/**\n * Decodes a unit-length vector in 'oct' encoding packed in a floating-point number to a normalized 3-component vector.\n *\n * @param {Number} value The oct-encoded unit length vector stored as a single floating-point number.\n * @param {Cartesian3} result The decoded and normalized vector\n * @returns {Cartesian3} The decoded and normalized vector.\n *\n */\nAttributeCompression.octDecodeFloat = function (value, result) {\n const temp = value / 256.0;\n const x = Math.floor(temp);\n const y = (temp - x) * 256.0;\n\n return AttributeCompression.octDecode(x, y, result);\n};\n\n/**\n * Encodes three normalized vectors into 6 SNORM values in the range of [0-255] following the 'oct' encoding and\n * packs those into two floating-point numbers.\n *\n * @param {Cartesian3} v1 A normalized vector to be compressed.\n * @param {Cartesian3} v2 A normalized vector to be compressed.\n * @param {Cartesian3} v3 A normalized vector to be compressed.\n * @param {Cartesian2} result The 'oct' encoded vectors packed into two floating-point numbers.\n * @returns {Cartesian2} The 'oct' encoded vectors packed into two floating-point numbers.\n *\n */\nAttributeCompression.octPack = function (v1, v2, v3, result) {\n const encoded1 = AttributeCompression.octEncodeFloat(v1);\n const encoded2 = AttributeCompression.octEncodeFloat(v2);\n\n const encoded3 = AttributeCompression.octEncode(v3, scratchEncodeCart2);\n result.x = 65536.0 * encoded3.x + encoded1;\n result.y = 65536.0 * encoded3.y + encoded2;\n return result;\n};\n\n/**\n * Decodes three unit-length vectors in 'oct' encoding packed into a floating-point number to a normalized 3-component vector.\n *\n * @param {Cartesian2} packed The three oct-encoded unit length vectors stored as two floating-point number.\n * @param {Cartesian3} v1 One decoded and normalized vector.\n * @param {Cartesian3} v2 One decoded and normalized vector.\n * @param {Cartesian3} v3 One decoded and normalized vector.\n */\nAttributeCompression.octUnpack = function (packed, v1, v2, v3) {\n let temp = packed.x / 65536.0;\n const x = Math.floor(temp);\n const encodedFloat1 = (temp - x) * 65536.0;\n\n temp = packed.y / 65536.0;\n const y = Math.floor(temp);\n const encodedFloat2 = (temp - y) * 65536.0;\n\n AttributeCompression.octDecodeFloat(encodedFloat1, v1);\n AttributeCompression.octDecodeFloat(encodedFloat2, v2);\n AttributeCompression.octDecode(x, y, v3);\n};\n\n/**\n * Pack texture coordinates into a single float. The texture coordinates will only preserve 12 bits of precision.\n *\n * @param {Cartesian2} textureCoordinates The texture coordinates to compress. Both coordinates must be in the range 0.0-1.0.\n * @returns {Number} The packed texture coordinates.\n *\n */\nAttributeCompression.compressTextureCoordinates = function (\n textureCoordinates\n) {\n // Move x and y to the range 0-4095;\n const x = (textureCoordinates.x * 4095.0) | 0;\n const y = (textureCoordinates.y * 4095.0) | 0;\n return 4096.0 * x + y;\n};\n\n/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @param {Number} compressed The compressed texture coordinates.\n * @param {Cartesian2} result The decompressed texture coordinates.\n * @returns {Cartesian2} The modified result parameter.\n *\n */\nAttributeCompression.decompressTextureCoordinates = function (\n compressed,\n result\n) {\n const temp = compressed / 4096.0;\n const xZeroTo4095 = Math.floor(temp);\n result.x = xZeroTo4095 / 4095.0;\n result.y = (compressed - xZeroTo4095 * 4096) / 4095;\n return result;\n};\n\nfunction zigZagDecode(value) {\n return (value >> 1) ^ -(value & 1);\n}\n\n/**\n * Decodes delta and ZigZag encoded vertices. This modifies the buffers in place.\n *\n * @param {Uint16Array} uBuffer The buffer view of u values.\n * @param {Uint16Array} vBuffer The buffer view of v values.\n * @param {Uint16Array} [heightBuffer] The buffer view of height values.\n *\n * @see {@link https://github.com/CesiumGS/quantized-mesh|quantized-mesh-1.0 terrain format}\n */\nAttributeCompression.zigZagDeltaDecode = function (\n uBuffer,\n vBuffer,\n heightBuffer\n) {\n const count = uBuffer.length;\n\n let u = 0;\n let v = 0;\n let height = 0;\n\n for (let i = 0; i < count; ++i) {\n u += zigZagDecode(uBuffer[i]);\n v += zigZagDecode(vBuffer[i]);\n\n uBuffer[i] = u;\n vBuffer[i] = v;\n\n if (defined(heightBuffer)) {\n height += zigZagDecode(heightBuffer[i]);\n heightBuffer[i] = height;\n }\n }\n};\n\n/**\n * Dequantizes a quantized typed array into a floating point typed array.\n *\n * @see {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data}\n *\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array} typedArray The typed array for the quantized data.\n * @param {ComponentDatatype} componentDatatype The component datatype of the quantized data.\n * @param {AttributeType} type The attribute type of the quantized data.\n * @param {Number} count The number of attributes referenced in the dequantized array.\n *\n * @returns {Float32Array} The dequantized array.\n */\nAttributeCompression.dequantize = function (\n typedArray,\n componentDatatype,\n type,\n count\n) {\n const componentsPerAttribute = AttributeType.getNumberOfComponents(type);\n\n let divisor;\n switch (componentDatatype) {\n case ComponentDatatype.BYTE:\n divisor = 127.0;\n break;\n case ComponentDatatype.UNSIGNED_BYTE:\n divisor = 255.0;\n break;\n case ComponentDatatype.SHORT:\n divisor = 32767.0;\n break;\n case ComponentDatatype.UNSIGNED_SHORT:\n divisor = 65535.0;\n break;\n case ComponentDatatype.INT:\n divisor = 2147483647.0;\n break;\n case ComponentDatatype.UNSIGNED_INT:\n divisor = 4294967295.0;\n break;\n}\n\n const dequantizedTypedArray = new Float32Array(\n count * componentsPerAttribute\n );\n\n for (let i = 0; i < count; i++) {\n for (let j = 0; j < componentsPerAttribute; j++) {\n const index = i * componentsPerAttribute + j;\n dequantizedTypedArray[index] = Math.max(\n typedArray[index] / divisor,\n -1.0\n );\n }\n }\n\n return dequantizedTypedArray;\n};\n\n/**\n * Decode RGB565-encoded colors into a floating point typed array containing\n * normalized RGB values.\n *\n * @param {Uint16Array} typedArray Array of RGB565 values\n * @param {Float32Array} [result] Array to store the normalized VEC3 result\n */\nAttributeCompression.decodeRGB565 = function (typedArray, result) {\n const count = typedArray.length;\n if (!defined(result)) {\n result = new Float32Array(count * 3);\n }\n\n const mask5 = (1 << 5) - 1;\n const mask6 = (1 << 6) - 1;\n const normalize5 = 1.0 / 31.0;\n const normalize6 = 1.0 / 63.0;\n for (let i = 0; i < count; i++) {\n const value = typedArray[i];\n const red = value >> 11;\n const green = (value >> 5) & mask6;\n const blue = value & mask5;\n\n const offset = 3 * i;\n result[offset] = red * normalize5;\n result[offset + 1] = green * normalize6;\n result[offset + 2] = blue * normalize5;\n }\n\n return result;\n};\n\nexport default AttributeCompression;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\n\n/**\n * Computes the barycentric coordinates for a point with respect to a triangle.\n *\n * @function\n *\n * @param {Cartesian2|Cartesian3} point The point to test.\n * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis.\n * @param {Cartesian2|Cartesian3} p1 The second point of the triangle, corresponding to the barycentric y-axis.\n * @param {Cartesian2|Cartesian3} p2 The third point of the triangle, corresponding to the barycentric z-axis.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.\n *\n * @example\n * // Returns Cartesian3.UNIT_X\n * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);\n * const b = Cesium.barycentricCoordinates(p,\n * new Cesium.Cartesian3(-1.0, 0.0, 0.0),\n * new Cesium.Cartesian3( 1.0, 0.0, 0.0),\n * new Cesium.Cartesian3( 0.0, 1.0, 1.0));\n */\nfunction barycentricCoordinates(point, p0, p1, p2, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n // Implementation based on http://www.blackpawn.com/texts/pointinpoly/default.html.\n let v0;\n let v1;\n let v2;\n let dot00;\n let dot01;\n let dot02;\n let dot11;\n let dot12;\n\n if (!defined(p0.z)) {\n if (Cartesian2.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_X, result);\n }\n if (Cartesian2.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_Y, result);\n }\n if (Cartesian2.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_Z, result);\n }\n\n v0 = Cartesian2.subtract(p1, p0, scratchCartesian1);\n v1 = Cartesian2.subtract(p2, p0, scratchCartesian2);\n v2 = Cartesian2.subtract(point, p0, scratchCartesian3);\n\n dot00 = Cartesian2.dot(v0, v0);\n dot01 = Cartesian2.dot(v0, v1);\n dot02 = Cartesian2.dot(v0, v2);\n dot11 = Cartesian2.dot(v1, v1);\n dot12 = Cartesian2.dot(v1, v2);\n } else {\n if (Cartesian3.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_X, result);\n }\n if (Cartesian3.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_Y, result);\n }\n if (Cartesian3.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\n return Cartesian3.clone(Cartesian3.UNIT_Z, result);\n }\n\n v0 = Cartesian3.subtract(p1, p0, scratchCartesian1);\n v1 = Cartesian3.subtract(p2, p0, scratchCartesian2);\n v2 = Cartesian3.subtract(point, p0, scratchCartesian3);\n\n dot00 = Cartesian3.dot(v0, v0);\n dot01 = Cartesian3.dot(v0, v1);\n dot02 = Cartesian3.dot(v0, v2);\n dot11 = Cartesian3.dot(v1, v1);\n dot12 = Cartesian3.dot(v1, v2);\n }\n\n result.y = dot11 * dot02 - dot01 * dot12;\n result.z = dot00 * dot12 - dot01 * dot02;\n const q = dot00 * dot11 - dot01 * dot01;\n\n // Triangle is degenerate\n if (q === 0) {\n return undefined;\n }\n\n result.y /= q;\n result.z /= q;\n result.x = 1.0 - result.y - result.z;\n return result;\n}\nexport default barycentricCoordinates;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Encapsulates an algorithm to optimize triangles for the post\n * vertex-shader cache. This is based on the 2007 SIGGRAPH paper\n * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.'\n * The runtime is linear but several passes are made.\n *\n * @namespace Tipsify\n *\n * @see <a href='http://gfx.cs.princeton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf'>\n * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw</a>\n * by Sander, Nehab, and Barczak\n *\n * @private\n */\nconst Tipsify = {};\n\n/**\n * Calculates the average cache miss ratio (ACMR) for a given set of indices.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\n * in the vertex buffer that define the geometry's triangles.\n * @param {Number} [options.maximumIndex] The maximum value of the elements in <code>args.indices</code>.\n * If not supplied, this value will be computed.\n * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\n * @returns {Number} The average cache miss ratio (ACMR).\n *\n * @exception {DeveloperError} indices length must be a multiple of three.\n * @exception {DeveloperError} cacheSize must be greater than two.\n *\n * @example\n * const indices = [0, 1, 2, 3, 4, 5];\n * const maxIndex = 5;\n * const cacheSize = 3;\n * const acmr = Cesium.Tipsify.calculateACMR({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\n */\nTipsify.calculateACMR = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const indices = options.indices;\n let maximumIndex = options.maximumIndex;\n const cacheSize = defaultValue(options.cacheSize, 24);\n\n const numIndices = indices.length;\n\n // Compute the maximumIndex if not given\n if (!defined(maximumIndex)) {\n maximumIndex = 0;\n let currentIndex = 0;\n let intoIndices = indices[currentIndex];\n while (currentIndex < numIndices) {\n if (intoIndices > maximumIndex) {\n maximumIndex = intoIndices;\n }\n ++currentIndex;\n intoIndices = indices[currentIndex];\n }\n }\n\n // Vertex time stamps\n const vertexTimeStamps = [];\n for (let i = 0; i < maximumIndex + 1; i++) {\n vertexTimeStamps[i] = 0;\n }\n\n // Cache processing\n let s = cacheSize + 1;\n for (let j = 0; j < numIndices; ++j) {\n if (s - vertexTimeStamps[indices[j]] > cacheSize) {\n vertexTimeStamps[indices[j]] = s;\n ++s;\n }\n }\n\n return (s - cacheSize + 1) / (numIndices / 3);\n};\n\n/**\n * Optimizes triangles for the post-vertex shader cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\n * in the vertex buffer that define the geometry's triangles.\n * @param {Number} [options.maximumIndex] The maximum value of the elements in <code>args.indices</code>.\n * If not supplied, this value will be computed.\n * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\n * @returns {Number[]} A list of the input indices in an optimized order.\n *\n * @exception {DeveloperError} indices length must be a multiple of three.\n * @exception {DeveloperError} cacheSize must be greater than two.\n *\n * @example\n * const indices = [0, 1, 2, 3, 4, 5];\n * const maxIndex = 5;\n * const cacheSize = 3;\n * const reorderedIndices = Cesium.Tipsify.tipsify({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\n */\nTipsify.tipsify = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const indices = options.indices;\n const maximumIndex = options.maximumIndex;\n const cacheSize = defaultValue(options.cacheSize, 24);\n\n let cursor;\n\n function skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne) {\n while (deadEnd.length >= 1) {\n // while the stack is not empty\n const d = deadEnd[deadEnd.length - 1]; // top of the stack\n deadEnd.splice(deadEnd.length - 1, 1); // pop the stack\n\n if (vertices[d].numLiveTriangles > 0) {\n return d;\n }\n }\n\n while (cursor < maximumIndexPlusOne) {\n if (vertices[cursor].numLiveTriangles > 0) {\n ++cursor;\n return cursor - 1;\n }\n ++cursor;\n }\n return -1;\n }\n\n function getNextVertex(\n indices,\n cacheSize,\n oneRing,\n vertices,\n s,\n deadEnd,\n maximumIndexPlusOne\n ) {\n let n = -1;\n let p;\n let m = -1;\n let itOneRing = 0;\n while (itOneRing < oneRing.length) {\n const index = oneRing[itOneRing];\n if (vertices[index].numLiveTriangles) {\n p = 0;\n if (\n s -\n vertices[index].timeStamp +\n 2 * vertices[index].numLiveTriangles <=\n cacheSize\n ) {\n p = s - vertices[index].timeStamp;\n }\n if (p > m || m === -1) {\n m = p;\n n = index;\n }\n }\n ++itOneRing;\n }\n if (n === -1) {\n return skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne);\n }\n return n;\n }\n\n const numIndices = indices.length;\n\n // Determine maximum index\n let maximumIndexPlusOne = 0;\n let currentIndex = 0;\n let intoIndices = indices[currentIndex];\n const endIndex = numIndices;\n if (defined(maximumIndex)) {\n maximumIndexPlusOne = maximumIndex + 1;\n } else {\n while (currentIndex < endIndex) {\n if (intoIndices > maximumIndexPlusOne) {\n maximumIndexPlusOne = intoIndices;\n }\n ++currentIndex;\n intoIndices = indices[currentIndex];\n }\n if (maximumIndexPlusOne === -1) {\n return 0;\n }\n ++maximumIndexPlusOne;\n }\n\n // Vertices\n const vertices = [];\n let i;\n for (i = 0; i < maximumIndexPlusOne; i++) {\n vertices[i] = {\n numLiveTriangles: 0,\n timeStamp: 0,\n vertexTriangles: [],\n };\n }\n currentIndex = 0;\n let triangle = 0;\n while (currentIndex < endIndex) {\n vertices[indices[currentIndex]].vertexTriangles.push(triangle);\n ++vertices[indices[currentIndex]].numLiveTriangles;\n vertices[indices[currentIndex + 1]].vertexTriangles.push(triangle);\n ++vertices[indices[currentIndex + 1]].numLiveTriangles;\n vertices[indices[currentIndex + 2]].vertexTriangles.push(triangle);\n ++vertices[indices[currentIndex + 2]].numLiveTriangles;\n ++triangle;\n currentIndex += 3;\n }\n\n // Starting index\n let f = 0;\n\n // Time Stamp\n let s = cacheSize + 1;\n cursor = 1;\n\n // Process\n let oneRing = [];\n const deadEnd = []; //Stack\n let vertex;\n let intoVertices;\n let currentOutputIndex = 0;\n const outputIndices = [];\n const numTriangles = numIndices / 3;\n const triangleEmitted = [];\n for (i = 0; i < numTriangles; i++) {\n triangleEmitted[i] = false;\n }\n let index;\n let limit;\n while (f !== -1) {\n oneRing = [];\n intoVertices = vertices[f];\n limit = intoVertices.vertexTriangles.length;\n for (let k = 0; k < limit; ++k) {\n triangle = intoVertices.vertexTriangles[k];\n if (!triangleEmitted[triangle]) {\n triangleEmitted[triangle] = true;\n currentIndex = triangle + triangle + triangle;\n for (let j = 0; j < 3; ++j) {\n // Set this index as a possible next index\n index = indices[currentIndex];\n oneRing.push(index);\n deadEnd.push(index);\n\n // Output index\n outputIndices[currentOutputIndex] = index;\n ++currentOutputIndex;\n\n // Cache processing\n vertex = vertices[index];\n --vertex.numLiveTriangles;\n if (s - vertex.timeStamp > cacheSize) {\n vertex.timeStamp = s;\n ++s;\n }\n ++currentIndex;\n }\n }\n }\n f = getNextVertex(\n indices,\n cacheSize,\n oneRing,\n vertices,\n s,\n deadEnd,\n maximumIndexPlusOne\n );\n }\n\n return outputIndices;\n};\nexport default Tipsify;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport barycentricCoordinates from \"./barycentricCoordinates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersect from \"./Intersect.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Tipsify from \"./Tipsify.js\";\n\n/**\n * Content pipeline functions for geometries.\n *\n * @namespace GeometryPipeline\n *\n * @see Geometry\n */\nconst GeometryPipeline = {};\n\nfunction addTriangle(lines, index, i0, i1, i2) {\n lines[index++] = i0;\n lines[index++] = i1;\n\n lines[index++] = i1;\n lines[index++] = i2;\n\n lines[index++] = i2;\n lines[index] = i0;\n}\n\nfunction trianglesToLines(triangles) {\n const count = triangles.length;\n const size = (count / 3) * 6;\n const lines = IndexDatatype.createTypedArray(count, size);\n\n let index = 0;\n for (let i = 0; i < count; i += 3, index += 6) {\n addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);\n }\n\n return lines;\n}\n\nfunction triangleStripToLines(triangles) {\n const count = triangles.length;\n if (count >= 3) {\n const size = (count - 2) * 6;\n const lines = IndexDatatype.createTypedArray(count, size);\n\n addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);\n let index = 6;\n\n for (let i = 3; i < count; ++i, index += 6) {\n addTriangle(\n lines,\n index,\n triangles[i - 1],\n triangles[i],\n triangles[i - 2]\n );\n }\n\n return lines;\n }\n\n return new Uint16Array();\n}\n\nfunction triangleFanToLines(triangles) {\n if (triangles.length > 0) {\n const count = triangles.length - 1;\n const size = (count - 1) * 6;\n const lines = IndexDatatype.createTypedArray(count, size);\n\n const base = triangles[0];\n let index = 0;\n for (let i = 1; i < count; ++i, index += 6) {\n addTriangle(lines, index, base, triangles[i], triangles[i + 1]);\n }\n\n return lines;\n }\n\n return new Uint16Array();\n}\n\n/**\n * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>\n * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,\n * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.\n * <p>\n * This is commonly used to create a wireframe geometry for visual debugging.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its triangle indices converted to lines.\n *\n * @exception {DeveloperError} geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.toWireframe(geometry);\n */\nGeometryPipeline.toWireframe = function (geometry) {\n const indices = geometry.indices;\n if (defined(indices)) {\n switch (geometry.primitiveType) {\n case PrimitiveType.TRIANGLES:\n geometry.indices = trianglesToLines(indices);\n break;\n case PrimitiveType.TRIANGLE_STRIP:\n geometry.indices = triangleStripToLines(indices);\n break;\n case PrimitiveType.TRIANGLE_FAN:\n geometry.indices = triangleFanToLines(indices);\n break;\n}\n\n geometry.primitiveType = PrimitiveType.LINES;\n }\n\n return geometry;\n};\n\n/**\n * Creates a new {@link Geometry} with <code>LINES</code> representing the provided\n * attribute (<code>attributeName</code>) for the provided geometry. This is used to\n * visualize vector attributes like normals, tangents, and bitangents.\n *\n * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute.\n * @param {String} [attributeName='normal'] The name of the attribute.\n * @param {Number} [length=10000.0] The length of each line segment in meters. This can be negative to point the vector in the opposite direction.\n * @returns {Geometry} A new <code>Geometry</code> instance with line segments for the vector.\n *\n * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter.\n *\n * @example\n * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);\n */\nGeometryPipeline.createLineSegmentsForVectors = function (\n geometry,\n attributeName,\n length\n) {\n attributeName = defaultValue(attributeName, \"normal\");\n\n length = defaultValue(length, 10000.0);\n\n const positions = geometry.attributes.position.values;\n const vectors = geometry.attributes[attributeName].values;\n const positionsLength = positions.length;\n\n const newPositions = new Float64Array(2 * positionsLength);\n\n let j = 0;\n for (let i = 0; i < positionsLength; i += 3) {\n newPositions[j++] = positions[i];\n newPositions[j++] = positions[i + 1];\n newPositions[j++] = positions[i + 2];\n\n newPositions[j++] = positions[i] + vectors[i] * length;\n newPositions[j++] = positions[i + 1] + vectors[i + 1] * length;\n newPositions[j++] = positions[i + 2] + vectors[i + 2] * length;\n }\n\n let newBoundingSphere;\n const bs = geometry.boundingSphere;\n if (defined(bs)) {\n newBoundingSphere = new BoundingSphere(bs.center, bs.radius + length);\n }\n\n return new Geometry({\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: newPositions,\n }),\n },\n primitiveType: PrimitiveType.LINES,\n boundingSphere: newBoundingSphere,\n });\n};\n\n/**\n * Creates an object that maps attribute names to unique locations (indices)\n * for matching vertex attributes and shader programs.\n *\n * @param {Geometry} geometry The geometry, which is not modified, to create the object for.\n * @returns {Object} An object with attribute name / index pairs.\n *\n * @example\n * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);\n * // Example output\n * // {\n * // 'position' : 0,\n * // 'normal' : 1\n * // }\n */\nGeometryPipeline.createAttributeLocations = function (geometry) {\n// There can be a WebGL performance hit when attribute 0 is disabled, so\n // assign attribute locations to well-known attributes.\n const semantics = [\n \"position\",\n \"positionHigh\",\n \"positionLow\",\n\n // From VertexFormat.position - after 2D projection and high-precision encoding\n \"position3DHigh\",\n \"position3DLow\",\n \"position2DHigh\",\n \"position2DLow\",\n\n // From Primitive\n \"pickColor\",\n\n // From VertexFormat\n \"normal\",\n \"st\",\n \"tangent\",\n \"bitangent\",\n\n // For shadow volumes\n \"extrudeDirection\",\n\n // From compressing texture coordinates and normals\n \"compressedAttributes\",\n ];\n\n const attributes = geometry.attributes;\n const indices = {};\n let j = 0;\n let i;\n const len = semantics.length;\n\n // Attribute locations for well-known attributes\n for (i = 0; i < len; ++i) {\n const semantic = semantics[i];\n\n if (defined(attributes[semantic])) {\n indices[semantic] = j++;\n }\n }\n\n // Locations for custom attributes\n for (const name in attributes) {\n if (attributes.hasOwnProperty(name) && !defined(indices[name])) {\n indices[name] = j++;\n }\n }\n\n return indices;\n};\n\n/**\n * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.\n *\n * @exception {DeveloperError} Each attribute array in geometry.attributes must have the same number of attributes.\n *\n *\n * @example\n * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);\n *\n * @see GeometryPipeline.reorderForPostVertexCache\n */\nGeometryPipeline.reorderForPreVertexCache = function (geometry) {\n const numVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = geometry.indices;\n if (defined(indices)) {\n const indexCrossReferenceOldToNew = new Int32Array(numVertices);\n for (let i = 0; i < numVertices; i++) {\n indexCrossReferenceOldToNew[i] = -1;\n }\n\n // Construct cross reference and reorder indices\n const indicesIn = indices;\n const numIndices = indicesIn.length;\n const indicesOut = IndexDatatype.createTypedArray(numVertices, numIndices);\n\n let intoIndicesIn = 0;\n let intoIndicesOut = 0;\n let nextIndex = 0;\n let tempIndex;\n while (intoIndicesIn < numIndices) {\n tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];\n if (tempIndex !== -1) {\n indicesOut[intoIndicesOut] = tempIndex;\n } else {\n tempIndex = indicesIn[intoIndicesIn];\n indexCrossReferenceOldToNew[tempIndex] = nextIndex;\n\n indicesOut[intoIndicesOut] = nextIndex;\n ++nextIndex;\n }\n ++intoIndicesIn;\n ++intoIndicesOut;\n }\n geometry.indices = indicesOut;\n\n // Reorder attributes\n const attributes = geometry.attributes;\n for (const property in attributes) {\n if (\n attributes.hasOwnProperty(property) &&\n defined(attributes[property]) &&\n defined(attributes[property].values)\n ) {\n const attribute = attributes[property];\n const elementsIn = attribute.values;\n let intoElementsIn = 0;\n const numComponents = attribute.componentsPerAttribute;\n const elementsOut = ComponentDatatype.createTypedArray(\n attribute.componentDatatype,\n nextIndex * numComponents\n );\n while (intoElementsIn < numVertices) {\n const temp = indexCrossReferenceOldToNew[intoElementsIn];\n if (temp !== -1) {\n for (let j = 0; j < numComponents; j++) {\n elementsOut[numComponents * temp + j] =\n elementsIn[numComponents * intoElementsIn + j];\n }\n }\n ++intoElementsIn;\n }\n attribute.values = elementsOut;\n }\n }\n }\n\n return geometry;\n};\n\n/**\n * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's\n * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>\n * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {Number} [cacheCapacity=24] The number of vertices that can be held in the GPU's vertex cache.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.\n *\n * @exception {DeveloperError} cacheCapacity must be greater than two.\n *\n *\n * @example\n * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);\n *\n * @see GeometryPipeline.reorderForPreVertexCache\n * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw}\n * by Sander, Nehab, and Barczak\n */\nGeometryPipeline.reorderForPostVertexCache = function (\n geometry,\n cacheCapacity\n) {\n const indices = geometry.indices;\n if (geometry.primitiveType === PrimitiveType.TRIANGLES && defined(indices)) {\n const numIndices = indices.length;\n let maximumIndex = 0;\n for (let j = 0; j < numIndices; j++) {\n if (indices[j] > maximumIndex) {\n maximumIndex = indices[j];\n }\n }\n geometry.indices = Tipsify.tipsify({\n indices: indices,\n maximumIndex: maximumIndex,\n cacheSize: cacheCapacity,\n });\n }\n\n return geometry;\n};\n\nfunction copyAttributesDescriptions(attributes) {\n const newAttributes = {};\n\n for (const attribute in attributes) {\n if (\n attributes.hasOwnProperty(attribute) &&\n defined(attributes[attribute]) &&\n defined(attributes[attribute].values)\n ) {\n const attr = attributes[attribute];\n newAttributes[attribute] = new GeometryAttribute({\n componentDatatype: attr.componentDatatype,\n componentsPerAttribute: attr.componentsPerAttribute,\n normalize: attr.normalize,\n values: [],\n });\n }\n }\n\n return newAttributes;\n}\n\nfunction copyVertex(destinationAttributes, sourceAttributes, index) {\n for (const attribute in sourceAttributes) {\n if (\n sourceAttributes.hasOwnProperty(attribute) &&\n defined(sourceAttributes[attribute]) &&\n defined(sourceAttributes[attribute].values)\n ) {\n const attr = sourceAttributes[attribute];\n\n for (let k = 0; k < attr.componentsPerAttribute; ++k) {\n destinationAttributes[attribute].values.push(\n attr.values[index * attr.componentsPerAttribute + k]\n );\n }\n }\n }\n}\n\n/**\n * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the\n * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements\n * when unsigned int indices are not supported.\n * <p>\n * If the geometry does not have any <code>indices</code>, this function has no effect.\n * </p>\n *\n * @param {Geometry} geometry The geometry to be split into multiple geometries.\n * @returns {Geometry[]} An array of geometries, each with indices that fit into unsigned shorts.\n *\n * @exception {DeveloperError} geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS\n * @exception {DeveloperError} All geometry attribute lists must have the same number of attributes.\n *\n * @example\n * const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);\n */\nGeometryPipeline.fitToUnsignedShortIndices = function (geometry) {\n const geometries = [];\n\n // If there's an index list and more than 64K attributes, it is possible that\n // some indices are outside the range of unsigned short [0, 64K - 1]\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n if (\n defined(geometry.indices) &&\n numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES\n ) {\n let oldToNewIndex = [];\n let newIndices = [];\n let currentIndex = 0;\n let newAttributes = copyAttributesDescriptions(geometry.attributes);\n\n const originalIndices = geometry.indices;\n const numberOfIndices = originalIndices.length;\n\n let indicesPerPrimitive;\n\n if (geometry.primitiveType === PrimitiveType.TRIANGLES) {\n indicesPerPrimitive = 3;\n } else if (geometry.primitiveType === PrimitiveType.LINES) {\n indicesPerPrimitive = 2;\n } else if (geometry.primitiveType === PrimitiveType.POINTS) {\n indicesPerPrimitive = 1;\n }\n\n for (let j = 0; j < numberOfIndices; j += indicesPerPrimitive) {\n for (let k = 0; k < indicesPerPrimitive; ++k) {\n const x = originalIndices[j + k];\n let i = oldToNewIndex[x];\n if (!defined(i)) {\n i = currentIndex++;\n oldToNewIndex[x] = i;\n copyVertex(newAttributes, geometry.attributes, x);\n }\n newIndices.push(i);\n }\n\n if (\n currentIndex + indicesPerPrimitive >=\n CesiumMath.SIXTY_FOUR_KILOBYTES\n ) {\n geometries.push(\n new Geometry({\n attributes: newAttributes,\n indices: newIndices,\n primitiveType: geometry.primitiveType,\n boundingSphere: geometry.boundingSphere,\n boundingSphereCV: geometry.boundingSphereCV,\n })\n );\n\n // Reset for next vertex-array\n oldToNewIndex = [];\n newIndices = [];\n currentIndex = 0;\n newAttributes = copyAttributesDescriptions(geometry.attributes);\n }\n }\n\n if (newIndices.length !== 0) {\n geometries.push(\n new Geometry({\n attributes: newAttributes,\n indices: newIndices,\n primitiveType: geometry.primitiveType,\n boundingSphere: geometry.boundingSphere,\n boundingSphereCV: geometry.boundingSphereCV,\n })\n );\n }\n } else {\n // No need to split into multiple geometries\n geometries.push(geometry);\n }\n\n return geometries;\n};\n\nconst scratchProjectTo2DCartesian3 = new Cartesian3();\nconst scratchProjectTo2DCartographic = new Cartographic();\n\n/**\n * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>\n * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.\n * <p>\n * If the geometry does not have a <code>position</code>, this function has no effect.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {String} attributeName The name of the attribute.\n * @param {String} attributeName3D The name of the attribute in 3D.\n * @param {String} attributeName2D The name of the attribute in 2D.\n * @param {Object} [projection=new GeographicProjection()] The projection to use.\n * @returns {Geometry} The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.\n *\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\n * @exception {DeveloperError} Could not project a point to 2D.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');\n */\nGeometryPipeline.projectTo2D = function (\n geometry,\n attributeName,\n attributeName3D,\n attributeName2D,\n projection\n) {\n const attribute = geometry.attributes[attributeName];\n projection = defined(projection) ? projection : new GeographicProjection();\n const ellipsoid = projection.ellipsoid;\n\n // Project original values to 2D.\n const values3D = attribute.values;\n const projectedValues = new Float64Array(values3D.length);\n let index = 0;\n\n for (let i = 0; i < values3D.length; i += 3) {\n const value = Cartesian3.fromArray(\n values3D,\n i,\n scratchProjectTo2DCartesian3\n );\n\n const lonLat = ellipsoid.cartesianToCartographic(\n value,\n scratchProjectTo2DCartographic\n );\n const projectedLonLat = projection.project(\n lonLat,\n scratchProjectTo2DCartesian3\n );\n\n projectedValues[index++] = projectedLonLat.x;\n projectedValues[index++] = projectedLonLat.y;\n projectedValues[index++] = projectedLonLat.z;\n }\n\n // Rename original cartesians to WGS84 cartesians.\n geometry.attributes[attributeName3D] = attribute;\n\n // Replace original cartesians with 2D projected cartesians\n geometry.attributes[attributeName2D] = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: projectedValues,\n });\n delete geometry.attributes[attributeName];\n\n return geometry;\n};\n\nconst encodedResult = {\n high: 0.0,\n low: 0.0,\n};\n\n/**\n * Encodes floating-point geometry attribute values as two separate attributes to improve\n * rendering precision.\n * <p>\n * This is commonly used to create high-precision position vertex attributes.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @param {String} attributeName The name of the attribute.\n * @param {String} attributeHighName The name of the attribute for the encoded high bits.\n * @param {String} attributeLowName The name of the attribute for the encoded low bits.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its encoded attribute.\n *\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');\n */\nGeometryPipeline.encodeAttribute = function (\n geometry,\n attributeName,\n attributeHighName,\n attributeLowName\n) {\n const attribute = geometry.attributes[attributeName];\n const values = attribute.values;\n const length = values.length;\n const highValues = new Float32Array(length);\n const lowValues = new Float32Array(length);\n\n for (let i = 0; i < length; ++i) {\n EncodedCartesian3.encode(values[i], encodedResult);\n highValues[i] = encodedResult.high;\n lowValues[i] = encodedResult.low;\n }\n\n const componentsPerAttribute = attribute.componentsPerAttribute;\n\n geometry.attributes[attributeHighName] = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: componentsPerAttribute,\n values: highValues,\n });\n geometry.attributes[attributeLowName] = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: componentsPerAttribute,\n values: lowValues,\n });\n delete geometry.attributes[attributeName];\n\n return geometry;\n};\n\nlet scratchCartesian3 = new Cartesian3();\n\nfunction transformPoint(matrix, attribute) {\n if (defined(attribute)) {\n const values = attribute.values;\n const length = values.length;\n for (let i = 0; i < length; i += 3) {\n Cartesian3.unpack(values, i, scratchCartesian3);\n Matrix4.multiplyByPoint(matrix, scratchCartesian3, scratchCartesian3);\n Cartesian3.pack(scratchCartesian3, values, i);\n }\n }\n}\n\nfunction transformVector(matrix, attribute) {\n if (defined(attribute)) {\n const values = attribute.values;\n const length = values.length;\n for (let i = 0; i < length; i += 3) {\n Cartesian3.unpack(values, i, scratchCartesian3);\n Matrix3.multiplyByVector(matrix, scratchCartesian3, scratchCartesian3);\n scratchCartesian3 = Cartesian3.normalize(\n scratchCartesian3,\n scratchCartesian3\n );\n Cartesian3.pack(scratchCartesian3, values, i);\n }\n }\n}\n\nconst inverseTranspose = new Matrix4();\nconst normalMatrix = new Matrix3();\n\n/**\n * Transforms a geometry instance to world coordinates. This changes\n * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the\n * following attributes if they are present: <code>position</code>, <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>.\n *\n * @param {GeometryInstance} instance The geometry instance to modify.\n * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates.\n *\n * @example\n * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);\n */\nGeometryPipeline.transformToWorldCoordinates = function (instance) {\n const modelMatrix = instance.modelMatrix;\n\n if (Matrix4.equals(modelMatrix, Matrix4.IDENTITY)) {\n // Already in world coordinates\n return instance;\n }\n\n const attributes = instance.geometry.attributes;\n\n // Transform attributes in known vertex formats\n transformPoint(modelMatrix, attributes.position);\n transformPoint(modelMatrix, attributes.prevPosition);\n transformPoint(modelMatrix, attributes.nextPosition);\n\n if (\n defined(attributes.normal) ||\n defined(attributes.tangent) ||\n defined(attributes.bitangent)\n ) {\n Matrix4.inverse(modelMatrix, inverseTranspose);\n Matrix4.transpose(inverseTranspose, inverseTranspose);\n Matrix4.getMatrix3(inverseTranspose, normalMatrix);\n\n transformVector(normalMatrix, attributes.normal);\n transformVector(normalMatrix, attributes.tangent);\n transformVector(normalMatrix, attributes.bitangent);\n }\n\n const boundingSphere = instance.geometry.boundingSphere;\n if (defined(boundingSphere)) {\n instance.geometry.boundingSphere = BoundingSphere.transform(\n boundingSphere,\n modelMatrix,\n boundingSphere\n );\n }\n\n instance.modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n return instance;\n};\n\nfunction findAttributesInAllGeometries(instances, propertyName) {\n const length = instances.length;\n\n const attributesInAllGeometries = {};\n\n const attributes0 = instances[0][propertyName].attributes;\n let name;\n\n for (name in attributes0) {\n if (\n attributes0.hasOwnProperty(name) &&\n defined(attributes0[name]) &&\n defined(attributes0[name].values)\n ) {\n const attribute = attributes0[name];\n let numberOfComponents = attribute.values.length;\n let inAllGeometries = true;\n\n // Does this same attribute exist in all geometries?\n for (let i = 1; i < length; ++i) {\n const otherAttribute = instances[i][propertyName].attributes[name];\n\n if (\n !defined(otherAttribute) ||\n attribute.componentDatatype !== otherAttribute.componentDatatype ||\n attribute.componentsPerAttribute !==\n otherAttribute.componentsPerAttribute ||\n attribute.normalize !== otherAttribute.normalize\n ) {\n inAllGeometries = false;\n break;\n }\n\n numberOfComponents += otherAttribute.values.length;\n }\n\n if (inAllGeometries) {\n attributesInAllGeometries[name] = new GeometryAttribute({\n componentDatatype: attribute.componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n values: ComponentDatatype.createTypedArray(\n attribute.componentDatatype,\n numberOfComponents\n ),\n });\n }\n }\n }\n\n return attributesInAllGeometries;\n}\n\nconst tempScratch = new Cartesian3();\n\nfunction combineGeometries(instances, propertyName) {\n const length = instances.length;\n\n let name;\n let i;\n let j;\n let k;\n\n const m = instances[0].modelMatrix;\n const haveIndices = defined(instances[0][propertyName].indices);\n const primitiveType = instances[0][propertyName].primitiveType;\n\n // Find subset of attributes in all geometries\n const attributes = findAttributesInAllGeometries(instances, propertyName);\n let values;\n let sourceValues;\n let sourceValuesLength;\n\n // Combine attributes from each geometry into a single typed array\n for (name in attributes) {\n if (attributes.hasOwnProperty(name)) {\n values = attributes[name].values;\n\n k = 0;\n for (i = 0; i < length; ++i) {\n sourceValues = instances[i][propertyName].attributes[name].values;\n sourceValuesLength = sourceValues.length;\n\n for (j = 0; j < sourceValuesLength; ++j) {\n values[k++] = sourceValues[j];\n }\n }\n }\n }\n\n // Combine index lists\n let indices;\n\n if (haveIndices) {\n let numberOfIndices = 0;\n for (i = 0; i < length; ++i) {\n numberOfIndices += instances[i][propertyName].indices.length;\n }\n\n const numberOfVertices = Geometry.computeNumberOfVertices(\n new Geometry({\n attributes: attributes,\n primitiveType: PrimitiveType.POINTS,\n })\n );\n const destIndices = IndexDatatype.createTypedArray(\n numberOfVertices,\n numberOfIndices\n );\n\n let destOffset = 0;\n let offset = 0;\n\n for (i = 0; i < length; ++i) {\n const sourceIndices = instances[i][propertyName].indices;\n const sourceIndicesLen = sourceIndices.length;\n\n for (k = 0; k < sourceIndicesLen; ++k) {\n destIndices[destOffset++] = offset + sourceIndices[k];\n }\n\n offset += Geometry.computeNumberOfVertices(instances[i][propertyName]);\n }\n\n indices = destIndices;\n }\n\n // Create bounding sphere that includes all instances\n let center = new Cartesian3();\n let radius = 0.0;\n let bs;\n\n for (i = 0; i < length; ++i) {\n bs = instances[i][propertyName].boundingSphere;\n if (!defined(bs)) {\n // If any geometries have an undefined bounding sphere, then so does the combined geometry\n center = undefined;\n break;\n }\n\n Cartesian3.add(bs.center, center, center);\n }\n\n if (defined(center)) {\n Cartesian3.divideByScalar(center, length, center);\n\n for (i = 0; i < length; ++i) {\n bs = instances[i][propertyName].boundingSphere;\n const tempRadius =\n Cartesian3.magnitude(\n Cartesian3.subtract(bs.center, center, tempScratch)\n ) + bs.radius;\n\n if (tempRadius > radius) {\n radius = tempRadius;\n }\n }\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: primitiveType,\n boundingSphere: defined(center)\n ? new BoundingSphere(center, radius)\n : undefined,\n });\n}\n\n/**\n * Combines geometry from several {@link GeometryInstance} objects into one geometry.\n * This concatenates the attributes, concatenates and adjusts the indices, and creates\n * a bounding sphere encompassing all instances.\n * <p>\n * If the instances do not have the same attributes, a subset of attributes common\n * to all instances is used, and the others are ignored.\n * </p>\n * <p>\n * This is used by {@link Primitive} to efficiently render a large amount of static data.\n * </p>\n *\n * @private\n *\n * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined.\n * @returns {Geometry} A single geometry created from the provided geometry instances.\n *\n * @exception {DeveloperError} All instances must have the same modelMatrix.\n * @exception {DeveloperError} All instance geometries must have an indices or not have one.\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n *\n *\n * @example\n * for (let i = 0; i < instances.length; ++i) {\n * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]);\n * }\n * const geometries = Cesium.GeometryPipeline.combineInstances(instances);\n *\n * @see GeometryPipeline.transformToWorldCoordinates\n */\nGeometryPipeline.combineInstances = function (instances) {\n const instanceGeometry = [];\n const instanceSplitGeometry = [];\n const length = instances.length;\n for (let i = 0; i < length; ++i) {\n const instance = instances[i];\n\n if (defined(instance.geometry)) {\n instanceGeometry.push(instance);\n } else if (\n defined(instance.westHemisphereGeometry) &&\n defined(instance.eastHemisphereGeometry)\n ) {\n instanceSplitGeometry.push(instance);\n }\n }\n\n const geometries = [];\n if (instanceGeometry.length > 0) {\n geometries.push(combineGeometries(instanceGeometry, \"geometry\"));\n }\n\n if (instanceSplitGeometry.length > 0) {\n geometries.push(\n combineGeometries(instanceSplitGeometry, \"westHemisphereGeometry\")\n );\n geometries.push(\n combineGeometries(instanceSplitGeometry, \"eastHemisphereGeometry\")\n );\n }\n\n return geometries;\n};\n\nconst normal = new Cartesian3();\nconst v0 = new Cartesian3();\nconst v1 = new Cartesian3();\nconst v2 = new Cartesian3();\n\n/**\n * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of\n * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.\n * This assumes a counter-clockwise winding order.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.\n *\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\n *\n * @example\n * Cesium.GeometryPipeline.computeNormal(geometry);\n */\nGeometryPipeline.computeNormal = function (geometry) {\n const indices = geometry.indices;\n const attributes = geometry.attributes;\n const vertices = attributes.position.values;\n const numVertices = attributes.position.values.length / 3;\n const numIndices = indices.length;\n const normalsPerVertex = new Array(numVertices);\n const normalsPerTriangle = new Array(numIndices / 3);\n const normalIndices = new Array(numIndices);\n let i;\n for (i = 0; i < numVertices; i++) {\n normalsPerVertex[i] = {\n indexOffset: 0,\n count: 0,\n currentCount: 0,\n };\n }\n\n let j = 0;\n for (i = 0; i < numIndices; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n const i03 = i0 * 3;\n const i13 = i1 * 3;\n const i23 = i2 * 3;\n\n v0.x = vertices[i03];\n v0.y = vertices[i03 + 1];\n v0.z = vertices[i03 + 2];\n v1.x = vertices[i13];\n v1.y = vertices[i13 + 1];\n v1.z = vertices[i13 + 2];\n v2.x = vertices[i23];\n v2.y = vertices[i23 + 1];\n v2.z = vertices[i23 + 2];\n\n normalsPerVertex[i0].count++;\n normalsPerVertex[i1].count++;\n normalsPerVertex[i2].count++;\n\n Cartesian3.subtract(v1, v0, v1);\n Cartesian3.subtract(v2, v0, v2);\n normalsPerTriangle[j] = Cartesian3.cross(v1, v2, new Cartesian3());\n j++;\n }\n\n let indexOffset = 0;\n for (i = 0; i < numVertices; i++) {\n normalsPerVertex[i].indexOffset += indexOffset;\n indexOffset += normalsPerVertex[i].count;\n }\n\n j = 0;\n let vertexNormalData;\n for (i = 0; i < numIndices; i += 3) {\n vertexNormalData = normalsPerVertex[indices[i]];\n let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n normalIndices[index] = j;\n vertexNormalData.currentCount++;\n\n vertexNormalData = normalsPerVertex[indices[i + 1]];\n index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n normalIndices[index] = j;\n vertexNormalData.currentCount++;\n\n vertexNormalData = normalsPerVertex[indices[i + 2]];\n index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\n normalIndices[index] = j;\n vertexNormalData.currentCount++;\n\n j++;\n }\n\n const normalValues = new Float32Array(numVertices * 3);\n for (i = 0; i < numVertices; i++) {\n const i3 = i * 3;\n vertexNormalData = normalsPerVertex[i];\n Cartesian3.clone(Cartesian3.ZERO, normal);\n if (vertexNormalData.count > 0) {\n for (j = 0; j < vertexNormalData.count; j++) {\n Cartesian3.add(\n normal,\n normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],\n normal\n );\n }\n\n // We can run into an issue where a vertex is used with 2 primitives that have opposite winding order.\n if (\n Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\n ) {\n Cartesian3.clone(\n normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],\n normal\n );\n }\n }\n\n // We end up with a zero vector probably because of a degenerate triangle\n if (\n Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\n ) {\n // Default to (0,0,1)\n normal.z = 1.0;\n }\n\n Cartesian3.normalize(normal, normal);\n normalValues[i3] = normal.x;\n normalValues[i3 + 1] = normal.y;\n normalValues[i3 + 2] = normal.z;\n }\n\n geometry.attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normalValues,\n });\n\n return geometry;\n};\n\nconst normalScratch = new Cartesian3();\nconst normalScale = new Cartesian3();\nconst tScratch = new Cartesian3();\n\n/**\n * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.\n * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.\n * This assumes a counter-clockwise winding order.\n * <p>\n * Based on <a href=\"http://www.terathon.com/code/tangent.html\">Computing Tangent Space Basis Vectors\n * for an Arbitrary Mesh</a> by Eric Lengyel.\n * </p>\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.\n *\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\n *\n * @example\n * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);\n */\nGeometryPipeline.computeTangentAndBitangent = function (geometry) {\n const attributes = geometry.attributes;\n const indices = geometry.indices;\n\n const vertices = geometry.attributes.position.values;\n const normals = geometry.attributes.normal.values;\n const st = geometry.attributes.st.values;\n\n const numVertices = geometry.attributes.position.values.length / 3;\n const numIndices = indices.length;\n const tan1 = new Array(numVertices * 3);\n\n let i;\n for (i = 0; i < tan1.length; i++) {\n tan1[i] = 0;\n }\n\n let i03;\n let i13;\n let i23;\n for (i = 0; i < numIndices; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n i03 = i0 * 3;\n i13 = i1 * 3;\n i23 = i2 * 3;\n const i02 = i0 * 2;\n const i12 = i1 * 2;\n const i22 = i2 * 2;\n\n const ux = vertices[i03];\n const uy = vertices[i03 + 1];\n const uz = vertices[i03 + 2];\n\n const wx = st[i02];\n const wy = st[i02 + 1];\n const t1 = st[i12 + 1] - wy;\n const t2 = st[i22 + 1] - wy;\n\n const r = 1.0 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);\n const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;\n const sdiry =\n (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;\n const sdirz =\n (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;\n\n tan1[i03] += sdirx;\n tan1[i03 + 1] += sdiry;\n tan1[i03 + 2] += sdirz;\n\n tan1[i13] += sdirx;\n tan1[i13 + 1] += sdiry;\n tan1[i13 + 2] += sdirz;\n\n tan1[i23] += sdirx;\n tan1[i23 + 1] += sdiry;\n tan1[i23 + 2] += sdirz;\n }\n\n const tangentValues = new Float32Array(numVertices * 3);\n const bitangentValues = new Float32Array(numVertices * 3);\n\n for (i = 0; i < numVertices; i++) {\n i03 = i * 3;\n i13 = i03 + 1;\n i23 = i03 + 2;\n\n const n = Cartesian3.fromArray(normals, i03, normalScratch);\n const t = Cartesian3.fromArray(tan1, i03, tScratch);\n const scalar = Cartesian3.dot(n, t);\n Cartesian3.multiplyByScalar(n, scalar, normalScale);\n Cartesian3.normalize(Cartesian3.subtract(t, normalScale, t), t);\n\n tangentValues[i03] = t.x;\n tangentValues[i13] = t.y;\n tangentValues[i23] = t.z;\n\n Cartesian3.normalize(Cartesian3.cross(n, t, t), t);\n\n bitangentValues[i03] = t.x;\n bitangentValues[i13] = t.y;\n bitangentValues[i23] = t.z;\n }\n\n geometry.attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangentValues,\n });\n\n geometry.attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangentValues,\n });\n\n return geometry;\n};\n\nconst scratchCartesian2 = new Cartesian2();\nconst toEncode1 = new Cartesian3();\nconst toEncode2 = new Cartesian3();\nconst toEncode3 = new Cartesian3();\nlet encodeResult2 = new Cartesian2();\n/**\n * Compresses and packs geometry normal attribute values to save memory.\n *\n * @param {Geometry} geometry The geometry to modify.\n * @returns {Geometry} The modified <code>geometry</code> argument, with its normals compressed and packed.\n *\n * @example\n * geometry = Cesium.GeometryPipeline.compressVertices(geometry);\n */\nGeometryPipeline.compressVertices = function (geometry) {\n const extrudeAttribute = geometry.attributes.extrudeDirection;\n let i;\n let numVertices;\n if (defined(extrudeAttribute)) {\n //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes\n const extrudeDirections = extrudeAttribute.values;\n numVertices = extrudeDirections.length / 3.0;\n const compressedDirections = new Float32Array(numVertices * 2);\n\n let i2 = 0;\n for (i = 0; i < numVertices; ++i) {\n Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1);\n if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) {\n i2 += 2;\n continue;\n }\n encodeResult2 = AttributeCompression.octEncodeInRange(\n toEncode1,\n 65535,\n encodeResult2\n );\n compressedDirections[i2++] = encodeResult2.x;\n compressedDirections[i2++] = encodeResult2.y;\n }\n\n geometry.attributes.compressedAttributes = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: compressedDirections,\n });\n delete geometry.attributes.extrudeDirection;\n return geometry;\n }\n\n const normalAttribute = geometry.attributes.normal;\n const stAttribute = geometry.attributes.st;\n\n const hasNormal = defined(normalAttribute);\n const hasSt = defined(stAttribute);\n if (!hasNormal && !hasSt) {\n return geometry;\n }\n\n const tangentAttribute = geometry.attributes.tangent;\n const bitangentAttribute = geometry.attributes.bitangent;\n\n const hasTangent = defined(tangentAttribute);\n const hasBitangent = defined(bitangentAttribute);\n\n let normals;\n let st;\n let tangents;\n let bitangents;\n\n if (hasNormal) {\n normals = normalAttribute.values;\n }\n if (hasSt) {\n st = stAttribute.values;\n }\n if (hasTangent) {\n tangents = tangentAttribute.values;\n }\n if (hasBitangent) {\n bitangents = bitangentAttribute.values;\n }\n\n const length = hasNormal ? normals.length : st.length;\n const numComponents = hasNormal ? 3.0 : 2.0;\n numVertices = length / numComponents;\n\n let compressedLength = numVertices;\n let numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0;\n numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0;\n compressedLength *= numCompressedComponents;\n\n const compressedAttributes = new Float32Array(compressedLength);\n\n let normalIndex = 0;\n for (i = 0; i < numVertices; ++i) {\n if (hasSt) {\n Cartesian2.fromArray(st, i * 2.0, scratchCartesian2);\n compressedAttributes[\n normalIndex++\n ] = AttributeCompression.compressTextureCoordinates(scratchCartesian2);\n }\n\n const index = i * 3.0;\n if (hasNormal && defined(tangents) && defined(bitangents)) {\n Cartesian3.fromArray(normals, index, toEncode1);\n Cartesian3.fromArray(tangents, index, toEncode2);\n Cartesian3.fromArray(bitangents, index, toEncode3);\n\n AttributeCompression.octPack(\n toEncode1,\n toEncode2,\n toEncode3,\n scratchCartesian2\n );\n compressedAttributes[normalIndex++] = scratchCartesian2.x;\n compressedAttributes[normalIndex++] = scratchCartesian2.y;\n } else {\n if (hasNormal) {\n Cartesian3.fromArray(normals, index, toEncode1);\n compressedAttributes[\n normalIndex++\n ] = AttributeCompression.octEncodeFloat(toEncode1);\n }\n\n if (hasTangent) {\n Cartesian3.fromArray(tangents, index, toEncode1);\n compressedAttributes[\n normalIndex++\n ] = AttributeCompression.octEncodeFloat(toEncode1);\n }\n\n if (hasBitangent) {\n Cartesian3.fromArray(bitangents, index, toEncode1);\n compressedAttributes[\n normalIndex++\n ] = AttributeCompression.octEncodeFloat(toEncode1);\n }\n }\n }\n\n geometry.attributes.compressedAttributes = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: numCompressedComponents,\n values: compressedAttributes,\n });\n\n if (hasNormal) {\n delete geometry.attributes.normal;\n }\n if (hasSt) {\n delete geometry.attributes.st;\n }\n if (hasBitangent) {\n delete geometry.attributes.bitangent;\n }\n if (hasTangent) {\n delete geometry.attributes.tangent;\n }\n\n return geometry;\n};\n\nfunction indexTriangles(geometry) {\n if (defined(geometry.indices)) {\n return geometry;\n }\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n numberOfVertices\n );\n for (let i = 0; i < numberOfVertices; ++i) {\n indices[i] = i;\n }\n\n geometry.indices = indices;\n return geometry;\n}\n\nfunction indexTriangleFan(geometry) {\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n (numberOfVertices - 2) * 3\n );\n indices[0] = 1;\n indices[1] = 0;\n indices[2] = 2;\n\n let indicesIndex = 3;\n for (let i = 3; i < numberOfVertices; ++i) {\n indices[indicesIndex++] = i - 1;\n indices[indicesIndex++] = 0;\n indices[indicesIndex++] = i;\n }\n\n geometry.indices = indices;\n geometry.primitiveType = PrimitiveType.TRIANGLES;\n return geometry;\n}\n\nfunction indexTriangleStrip(geometry) {\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n (numberOfVertices - 2) * 3\n );\n indices[0] = 0;\n indices[1] = 1;\n indices[2] = 2;\n\n if (numberOfVertices > 3) {\n indices[3] = 0;\n indices[4] = 2;\n indices[5] = 3;\n }\n\n let indicesIndex = 6;\n for (let i = 3; i < numberOfVertices - 1; i += 2) {\n indices[indicesIndex++] = i;\n indices[indicesIndex++] = i - 1;\n indices[indicesIndex++] = i + 1;\n\n if (i + 2 < numberOfVertices) {\n indices[indicesIndex++] = i;\n indices[indicesIndex++] = i + 1;\n indices[indicesIndex++] = i + 2;\n }\n }\n\n geometry.indices = indices;\n geometry.primitiveType = PrimitiveType.TRIANGLES;\n return geometry;\n}\n\nfunction indexLines(geometry) {\n if (defined(geometry.indices)) {\n return geometry;\n }\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n numberOfVertices\n );\n for (let i = 0; i < numberOfVertices; ++i) {\n indices[i] = i;\n }\n\n geometry.indices = indices;\n return geometry;\n}\n\nfunction indexLineStrip(geometry) {\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n (numberOfVertices - 1) * 2\n );\n indices[0] = 0;\n indices[1] = 1;\n let indicesIndex = 2;\n for (let i = 2; i < numberOfVertices; ++i) {\n indices[indicesIndex++] = i - 1;\n indices[indicesIndex++] = i;\n }\n\n geometry.indices = indices;\n geometry.primitiveType = PrimitiveType.LINES;\n return geometry;\n}\n\nfunction indexLineLoop(geometry) {\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n\n const indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n numberOfVertices * 2\n );\n\n indices[0] = 0;\n indices[1] = 1;\n\n let indicesIndex = 2;\n for (let i = 2; i < numberOfVertices; ++i) {\n indices[indicesIndex++] = i - 1;\n indices[indicesIndex++] = i;\n }\n\n indices[indicesIndex++] = numberOfVertices - 1;\n indices[indicesIndex] = 0;\n\n geometry.indices = indices;\n geometry.primitiveType = PrimitiveType.LINES;\n return geometry;\n}\n\nfunction indexPrimitive(geometry) {\n switch (geometry.primitiveType) {\n case PrimitiveType.TRIANGLE_FAN:\n return indexTriangleFan(geometry);\n case PrimitiveType.TRIANGLE_STRIP:\n return indexTriangleStrip(geometry);\n case PrimitiveType.TRIANGLES:\n return indexTriangles(geometry);\n case PrimitiveType.LINE_STRIP:\n return indexLineStrip(geometry);\n case PrimitiveType.LINE_LOOP:\n return indexLineLoop(geometry);\n case PrimitiveType.LINES:\n return indexLines(geometry);\n }\n\n return geometry;\n}\n\nfunction offsetPointFromXZPlane(p, isBehind) {\n if (Math.abs(p.y) < CesiumMath.EPSILON6) {\n if (isBehind) {\n p.y = -CesiumMath.EPSILON6;\n } else {\n p.y = CesiumMath.EPSILON6;\n }\n }\n}\n\nfunction offsetTriangleFromXZPlane(p0, p1, p2) {\n if (p0.y !== 0.0 && p1.y !== 0.0 && p2.y !== 0.0) {\n offsetPointFromXZPlane(p0, p0.y < 0.0);\n offsetPointFromXZPlane(p1, p1.y < 0.0);\n offsetPointFromXZPlane(p2, p2.y < 0.0);\n return;\n }\n\n const p0y = Math.abs(p0.y);\n const p1y = Math.abs(p1.y);\n const p2y = Math.abs(p2.y);\n\n let sign;\n if (p0y > p1y) {\n if (p0y > p2y) {\n sign = CesiumMath.sign(p0.y);\n } else {\n sign = CesiumMath.sign(p2.y);\n }\n } else if (p1y > p2y) {\n sign = CesiumMath.sign(p1.y);\n } else {\n sign = CesiumMath.sign(p2.y);\n }\n\n const isBehind = sign < 0.0;\n offsetPointFromXZPlane(p0, isBehind);\n offsetPointFromXZPlane(p1, isBehind);\n offsetPointFromXZPlane(p2, isBehind);\n}\n\nconst c3 = new Cartesian3();\nfunction getXZIntersectionOffsetPoints(p, p1, u1, v1) {\n Cartesian3.add(\n p,\n Cartesian3.multiplyByScalar(\n Cartesian3.subtract(p1, p, c3),\n p.y / (p.y - p1.y),\n c3\n ),\n u1\n );\n Cartesian3.clone(u1, v1);\n offsetPointFromXZPlane(u1, true);\n offsetPointFromXZPlane(v1, false);\n}\n\nconst u1 = new Cartesian3();\nconst u2 = new Cartesian3();\nconst q1 = new Cartesian3();\nconst q2 = new Cartesian3();\n\nconst splitTriangleResult = {\n positions: new Array(7),\n indices: new Array(3 * 3),\n};\n\nfunction splitTriangle(p0, p1, p2) {\n // In WGS84 coordinates, for a triangle approximately on the\n // ellipsoid to cross the IDL, first it needs to be on the\n // negative side of the plane x = 0.\n if (p0.x >= 0.0 || p1.x >= 0.0 || p2.x >= 0.0) {\n return undefined;\n }\n\n offsetTriangleFromXZPlane(p0, p1, p2);\n\n const p0Behind = p0.y < 0.0;\n const p1Behind = p1.y < 0.0;\n const p2Behind = p2.y < 0.0;\n\n let numBehind = 0;\n numBehind += p0Behind ? 1 : 0;\n numBehind += p1Behind ? 1 : 0;\n numBehind += p2Behind ? 1 : 0;\n\n const indices = splitTriangleResult.indices;\n\n if (numBehind === 1) {\n indices[1] = 3;\n indices[2] = 4;\n indices[5] = 6;\n indices[7] = 6;\n indices[8] = 5;\n\n if (p0Behind) {\n getXZIntersectionOffsetPoints(p0, p1, u1, q1);\n getXZIntersectionOffsetPoints(p0, p2, u2, q2);\n\n indices[0] = 0;\n indices[3] = 1;\n indices[4] = 2;\n indices[6] = 1;\n } else if (p1Behind) {\n getXZIntersectionOffsetPoints(p1, p2, u1, q1);\n getXZIntersectionOffsetPoints(p1, p0, u2, q2);\n\n indices[0] = 1;\n indices[3] = 2;\n indices[4] = 0;\n indices[6] = 2;\n } else if (p2Behind) {\n getXZIntersectionOffsetPoints(p2, p0, u1, q1);\n getXZIntersectionOffsetPoints(p2, p1, u2, q2);\n\n indices[0] = 2;\n indices[3] = 0;\n indices[4] = 1;\n indices[6] = 0;\n }\n } else if (numBehind === 2) {\n indices[2] = 4;\n indices[4] = 4;\n indices[5] = 3;\n indices[7] = 5;\n indices[8] = 6;\n\n if (!p0Behind) {\n getXZIntersectionOffsetPoints(p0, p1, u1, q1);\n getXZIntersectionOffsetPoints(p0, p2, u2, q2);\n\n indices[0] = 1;\n indices[1] = 2;\n indices[3] = 1;\n indices[6] = 0;\n } else if (!p1Behind) {\n getXZIntersectionOffsetPoints(p1, p2, u1, q1);\n getXZIntersectionOffsetPoints(p1, p0, u2, q2);\n\n indices[0] = 2;\n indices[1] = 0;\n indices[3] = 2;\n indices[6] = 1;\n } else if (!p2Behind) {\n getXZIntersectionOffsetPoints(p2, p0, u1, q1);\n getXZIntersectionOffsetPoints(p2, p1, u2, q2);\n\n indices[0] = 0;\n indices[1] = 1;\n indices[3] = 0;\n indices[6] = 2;\n }\n }\n\n const positions = splitTriangleResult.positions;\n positions[0] = p0;\n positions[1] = p1;\n positions[2] = p2;\n positions.length = 3;\n\n if (numBehind === 1 || numBehind === 2) {\n positions[3] = u1;\n positions[4] = u2;\n positions[5] = q1;\n positions[6] = q2;\n positions.length = 7;\n }\n\n return splitTriangleResult;\n}\n\nfunction updateGeometryAfterSplit(geometry, computeBoundingSphere) {\n const attributes = geometry.attributes;\n\n if (attributes.position.values.length === 0) {\n return undefined;\n }\n\n for (const property in attributes) {\n if (\n attributes.hasOwnProperty(property) &&\n defined(attributes[property]) &&\n defined(attributes[property].values)\n ) {\n const attribute = attributes[property];\n attribute.values = ComponentDatatype.createTypedArray(\n attribute.componentDatatype,\n attribute.values\n );\n }\n }\n\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\n geometry.indices = IndexDatatype.createTypedArray(\n numberOfVertices,\n geometry.indices\n );\n\n if (computeBoundingSphere) {\n geometry.boundingSphere = BoundingSphere.fromVertices(\n attributes.position.values\n );\n }\n\n return geometry;\n}\n\nfunction copyGeometryForSplit(geometry) {\n const attributes = geometry.attributes;\n const copiedAttributes = {};\n\n for (const property in attributes) {\n if (\n attributes.hasOwnProperty(property) &&\n defined(attributes[property]) &&\n defined(attributes[property].values)\n ) {\n const attribute = attributes[property];\n copiedAttributes[property] = new GeometryAttribute({\n componentDatatype: attribute.componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n values: [],\n });\n }\n }\n\n return new Geometry({\n attributes: copiedAttributes,\n indices: [],\n primitiveType: geometry.primitiveType,\n });\n}\n\nfunction updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {\n const computeBoundingSphere = defined(instance.geometry.boundingSphere);\n\n westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);\n eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);\n\n if (defined(eastGeometry) && !defined(westGeometry)) {\n instance.geometry = eastGeometry;\n } else if (!defined(eastGeometry) && defined(westGeometry)) {\n instance.geometry = westGeometry;\n } else {\n instance.westHemisphereGeometry = westGeometry;\n instance.eastHemisphereGeometry = eastGeometry;\n instance.geometry = undefined;\n }\n}\n\nfunction generateBarycentricInterpolateFunction(\n CartesianType,\n numberOfComponents\n) {\n const v0Scratch = new CartesianType();\n const v1Scratch = new CartesianType();\n const v2Scratch = new CartesianType();\n\n return function (\n i0,\n i1,\n i2,\n coords,\n sourceValues,\n currentValues,\n insertedIndex,\n normalize\n ) {\n const v0 = CartesianType.fromArray(\n sourceValues,\n i0 * numberOfComponents,\n v0Scratch\n );\n const v1 = CartesianType.fromArray(\n sourceValues,\n i1 * numberOfComponents,\n v1Scratch\n );\n const v2 = CartesianType.fromArray(\n sourceValues,\n i2 * numberOfComponents,\n v2Scratch\n );\n\n CartesianType.multiplyByScalar(v0, coords.x, v0);\n CartesianType.multiplyByScalar(v1, coords.y, v1);\n CartesianType.multiplyByScalar(v2, coords.z, v2);\n\n const value = CartesianType.add(v0, v1, v0);\n CartesianType.add(value, v2, value);\n\n if (normalize) {\n CartesianType.normalize(value, value);\n }\n\n CartesianType.pack(\n value,\n currentValues,\n insertedIndex * numberOfComponents\n );\n };\n}\n\nconst interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(\n Cartesian4,\n 4\n);\nconst interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(\n Cartesian3,\n 3\n);\nconst interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(\n Cartesian2,\n 2\n);\nconst interpolateAndPackBoolean = function (\n i0,\n i1,\n i2,\n coords,\n sourceValues,\n currentValues,\n insertedIndex\n) {\n const v1 = sourceValues[i0] * coords.x;\n const v2 = sourceValues[i1] * coords.y;\n const v3 = sourceValues[i2] * coords.z;\n currentValues[insertedIndex] = v1 + v2 + v3 > CesiumMath.EPSILON6 ? 1 : 0;\n};\n\nconst p0Scratch = new Cartesian3();\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\nconst barycentricScratch = new Cartesian3();\n\nfunction computeTriangleAttributes(\n i0,\n i1,\n i2,\n point,\n positions,\n normals,\n tangents,\n bitangents,\n texCoords,\n extrudeDirections,\n applyOffset,\n currentAttributes,\n customAttributeNames,\n customAttributesLength,\n allAttributes,\n insertedIndex\n) {\n if (\n !defined(normals) &&\n !defined(tangents) &&\n !defined(bitangents) &&\n !defined(texCoords) &&\n !defined(extrudeDirections) &&\n customAttributesLength === 0\n ) {\n return;\n }\n\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\n const p2 = Cartesian3.fromArray(positions, i2 * 3, p2Scratch);\n const coords = barycentricCoordinates(point, p0, p1, p2, barycentricScratch);\n if (!defined(coords)) {\n return;\n }\n\n if (defined(normals)) {\n interpolateAndPackCartesian3(\n i0,\n i1,\n i2,\n coords,\n normals,\n currentAttributes.normal.values,\n insertedIndex,\n true\n );\n }\n\n if (defined(extrudeDirections)) {\n const d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch);\n const d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch);\n const d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch);\n\n Cartesian3.multiplyByScalar(d0, coords.x, d0);\n Cartesian3.multiplyByScalar(d1, coords.y, d1);\n Cartesian3.multiplyByScalar(d2, coords.z, d2);\n\n let direction;\n if (\n !Cartesian3.equals(d0, Cartesian3.ZERO) ||\n !Cartesian3.equals(d1, Cartesian3.ZERO) ||\n !Cartesian3.equals(d2, Cartesian3.ZERO)\n ) {\n direction = Cartesian3.add(d0, d1, d0);\n Cartesian3.add(direction, d2, direction);\n Cartesian3.normalize(direction, direction);\n } else {\n direction = p0Scratch;\n direction.x = 0;\n direction.y = 0;\n direction.z = 0;\n }\n Cartesian3.pack(\n direction,\n currentAttributes.extrudeDirection.values,\n insertedIndex * 3\n );\n }\n\n if (defined(applyOffset)) {\n interpolateAndPackBoolean(\n i0,\n i1,\n i2,\n coords,\n applyOffset,\n currentAttributes.applyOffset.values,\n insertedIndex\n );\n }\n\n if (defined(tangents)) {\n interpolateAndPackCartesian3(\n i0,\n i1,\n i2,\n coords,\n tangents,\n currentAttributes.tangent.values,\n insertedIndex,\n true\n );\n }\n\n if (defined(bitangents)) {\n interpolateAndPackCartesian3(\n i0,\n i1,\n i2,\n coords,\n bitangents,\n currentAttributes.bitangent.values,\n insertedIndex,\n true\n );\n }\n\n if (defined(texCoords)) {\n interpolateAndPackCartesian2(\n i0,\n i1,\n i2,\n coords,\n texCoords,\n currentAttributes.st.values,\n insertedIndex\n );\n }\n\n if (customAttributesLength > 0) {\n for (let i = 0; i < customAttributesLength; i++) {\n const attributeName = customAttributeNames[i];\n genericInterpolate(\n i0,\n i1,\n i2,\n coords,\n insertedIndex,\n allAttributes[attributeName],\n currentAttributes[attributeName]\n );\n }\n }\n}\n\nfunction genericInterpolate(\n i0,\n i1,\n i2,\n coords,\n insertedIndex,\n sourceAttribute,\n currentAttribute\n) {\n const componentsPerAttribute = sourceAttribute.componentsPerAttribute;\n const sourceValues = sourceAttribute.values;\n const currentValues = currentAttribute.values;\n switch (componentsPerAttribute) {\n case 4:\n interpolateAndPackCartesian4(\n i0,\n i1,\n i2,\n coords,\n sourceValues,\n currentValues,\n insertedIndex,\n false\n );\n break;\n case 3:\n interpolateAndPackCartesian3(\n i0,\n i1,\n i2,\n coords,\n sourceValues,\n currentValues,\n insertedIndex,\n false\n );\n break;\n case 2:\n interpolateAndPackCartesian2(\n i0,\n i1,\n i2,\n coords,\n sourceValues,\n currentValues,\n insertedIndex,\n false\n );\n break;\n default:\n currentValues[insertedIndex] =\n sourceValues[i0] * coords.x +\n sourceValues[i1] * coords.y +\n sourceValues[i2] * coords.z;\n }\n}\n\nfunction insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n currentIndex,\n point\n) {\n const insertIndex = currentAttributes.position.values.length / 3;\n\n if (currentIndex !== -1) {\n const prevIndex = indices[currentIndex];\n const newIndex = currentIndexMap[prevIndex];\n\n if (newIndex === -1) {\n currentIndexMap[prevIndex] = insertIndex;\n currentAttributes.position.values.push(point.x, point.y, point.z);\n currentIndices.push(insertIndex);\n return insertIndex;\n }\n\n currentIndices.push(newIndex);\n return newIndex;\n }\n\n currentAttributes.position.values.push(point.x, point.y, point.z);\n currentIndices.push(insertIndex);\n return insertIndex;\n}\n\nconst NAMED_ATTRIBUTES = {\n position: true,\n normal: true,\n bitangent: true,\n tangent: true,\n st: true,\n extrudeDirection: true,\n applyOffset: true,\n};\nfunction splitLongitudeTriangles(instance) {\n const geometry = instance.geometry;\n const attributes = geometry.attributes;\n const positions = attributes.position.values;\n const normals = defined(attributes.normal)\n ? attributes.normal.values\n : undefined;\n const bitangents = defined(attributes.bitangent)\n ? attributes.bitangent.values\n : undefined;\n const tangents = defined(attributes.tangent)\n ? attributes.tangent.values\n : undefined;\n const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\n const extrudeDirections = defined(attributes.extrudeDirection)\n ? attributes.extrudeDirection.values\n : undefined;\n const applyOffset = defined(attributes.applyOffset)\n ? attributes.applyOffset.values\n : undefined;\n const indices = geometry.indices;\n\n const customAttributeNames = [];\n for (const attributeName in attributes) {\n if (\n attributes.hasOwnProperty(attributeName) &&\n !NAMED_ATTRIBUTES[attributeName] &&\n defined(attributes[attributeName])\n ) {\n customAttributeNames.push(attributeName);\n }\n }\n const customAttributesLength = customAttributeNames.length;\n\n const eastGeometry = copyGeometryForSplit(geometry);\n const westGeometry = copyGeometryForSplit(geometry);\n\n let currentAttributes;\n let currentIndices;\n let currentIndexMap;\n let insertedIndex;\n let i;\n\n const westGeometryIndexMap = [];\n westGeometryIndexMap.length = positions.length / 3;\n\n const eastGeometryIndexMap = [];\n eastGeometryIndexMap.length = positions.length / 3;\n\n for (i = 0; i < westGeometryIndexMap.length; ++i) {\n westGeometryIndexMap[i] = -1;\n eastGeometryIndexMap[i] = -1;\n }\n\n const len = indices.length;\n for (i = 0; i < len; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n let p0 = Cartesian3.fromArray(positions, i0 * 3);\n let p1 = Cartesian3.fromArray(positions, i1 * 3);\n let p2 = Cartesian3.fromArray(positions, i2 * 3);\n\n const result = splitTriangle(p0, p1, p2);\n if (defined(result) && result.positions.length > 3) {\n const resultPositions = result.positions;\n const resultIndices = result.indices;\n const resultLength = resultIndices.length;\n\n for (let j = 0; j < resultLength; ++j) {\n const resultIndex = resultIndices[j];\n const point = resultPositions[resultIndex];\n\n if (point.y < 0.0) {\n currentAttributes = westGeometry.attributes;\n currentIndices = westGeometry.indices;\n currentIndexMap = westGeometryIndexMap;\n } else {\n currentAttributes = eastGeometry.attributes;\n currentIndices = eastGeometry.indices;\n currentIndexMap = eastGeometryIndexMap;\n }\n\n insertedIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n resultIndex < 3 ? i + resultIndex : -1,\n point\n );\n computeTriangleAttributes(\n i0,\n i1,\n i2,\n point,\n positions,\n normals,\n tangents,\n bitangents,\n texCoords,\n extrudeDirections,\n applyOffset,\n currentAttributes,\n customAttributeNames,\n customAttributesLength,\n attributes,\n insertedIndex\n );\n }\n } else {\n if (defined(result)) {\n p0 = result.positions[0];\n p1 = result.positions[1];\n p2 = result.positions[2];\n }\n\n if (p0.y < 0.0) {\n currentAttributes = westGeometry.attributes;\n currentIndices = westGeometry.indices;\n currentIndexMap = westGeometryIndexMap;\n } else {\n currentAttributes = eastGeometry.attributes;\n currentIndices = eastGeometry.indices;\n currentIndexMap = eastGeometryIndexMap;\n }\n\n insertedIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n i,\n p0\n );\n computeTriangleAttributes(\n i0,\n i1,\n i2,\n p0,\n positions,\n normals,\n tangents,\n bitangents,\n texCoords,\n extrudeDirections,\n applyOffset,\n currentAttributes,\n customAttributeNames,\n customAttributesLength,\n attributes,\n insertedIndex\n );\n\n insertedIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n i + 1,\n p1\n );\n computeTriangleAttributes(\n i0,\n i1,\n i2,\n p1,\n positions,\n normals,\n tangents,\n bitangents,\n texCoords,\n extrudeDirections,\n applyOffset,\n currentAttributes,\n customAttributeNames,\n customAttributesLength,\n attributes,\n insertedIndex\n );\n\n insertedIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n i + 2,\n p2\n );\n computeTriangleAttributes(\n i0,\n i1,\n i2,\n p2,\n positions,\n normals,\n tangents,\n bitangents,\n texCoords,\n extrudeDirections,\n applyOffset,\n currentAttributes,\n customAttributeNames,\n customAttributesLength,\n attributes,\n insertedIndex\n );\n }\n }\n\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\nconst xzPlane = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\n\nconst offsetScratch = new Cartesian3();\nconst offsetPointScratch = new Cartesian3();\n\nfunction computeLineAttributes(\n i0,\n i1,\n point,\n positions,\n insertIndex,\n currentAttributes,\n applyOffset\n) {\n if (!defined(applyOffset)) {\n return;\n }\n\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n if (Cartesian3.equalsEpsilon(p0, point, CesiumMath.EPSILON10)) {\n currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];\n } else {\n currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];\n }\n}\n\nfunction splitLongitudeLines(instance) {\n const geometry = instance.geometry;\n const attributes = geometry.attributes;\n const positions = attributes.position.values;\n const applyOffset = defined(attributes.applyOffset)\n ? attributes.applyOffset.values\n : undefined;\n const indices = geometry.indices;\n\n const eastGeometry = copyGeometryForSplit(geometry);\n const westGeometry = copyGeometryForSplit(geometry);\n\n let i;\n const length = indices.length;\n\n const westGeometryIndexMap = [];\n westGeometryIndexMap.length = positions.length / 3;\n\n const eastGeometryIndexMap = [];\n eastGeometryIndexMap.length = positions.length / 3;\n\n for (i = 0; i < westGeometryIndexMap.length; ++i) {\n westGeometryIndexMap[i] = -1;\n eastGeometryIndexMap[i] = -1;\n }\n\n for (i = 0; i < length; i += 2) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\n const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\n let insertIndex;\n\n if (Math.abs(p0.y) < CesiumMath.EPSILON6) {\n if (p0.y < 0.0) {\n p0.y = -CesiumMath.EPSILON6;\n } else {\n p0.y = CesiumMath.EPSILON6;\n }\n }\n\n if (Math.abs(p1.y) < CesiumMath.EPSILON6) {\n if (p1.y < 0.0) {\n p1.y = -CesiumMath.EPSILON6;\n } else {\n p1.y = CesiumMath.EPSILON6;\n }\n }\n\n let p0Attributes = eastGeometry.attributes;\n let p0Indices = eastGeometry.indices;\n let p0IndexMap = eastGeometryIndexMap;\n let p1Attributes = westGeometry.attributes;\n let p1Indices = westGeometry.indices;\n let p1IndexMap = westGeometryIndexMap;\n\n const intersection = IntersectionTests.lineSegmentPlane(\n p0,\n p1,\n xzPlane,\n p2Scratch\n );\n if (defined(intersection)) {\n // move point on the xz-plane slightly away from the plane\n const offset = Cartesian3.multiplyByScalar(\n Cartesian3.UNIT_Y,\n 5.0 * CesiumMath.EPSILON9,\n offsetScratch\n );\n if (p0.y < 0.0) {\n Cartesian3.negate(offset, offset);\n\n p0Attributes = westGeometry.attributes;\n p0Indices = westGeometry.indices;\n p0IndexMap = westGeometryIndexMap;\n p1Attributes = eastGeometry.attributes;\n p1Indices = eastGeometry.indices;\n p1IndexMap = eastGeometryIndexMap;\n }\n\n const offsetPoint = Cartesian3.add(\n intersection,\n offset,\n offsetPointScratch\n );\n\n insertIndex = insertSplitPoint(\n p0Attributes,\n p0Indices,\n p0IndexMap,\n indices,\n i,\n p0\n );\n computeLineAttributes(\n i0,\n i1,\n p0,\n positions,\n insertIndex,\n p0Attributes,\n applyOffset\n );\n\n insertIndex = insertSplitPoint(\n p0Attributes,\n p0Indices,\n p0IndexMap,\n indices,\n -1,\n offsetPoint\n );\n computeLineAttributes(\n i0,\n i1,\n offsetPoint,\n positions,\n insertIndex,\n p0Attributes,\n applyOffset\n );\n\n Cartesian3.negate(offset, offset);\n Cartesian3.add(intersection, offset, offsetPoint);\n insertIndex = insertSplitPoint(\n p1Attributes,\n p1Indices,\n p1IndexMap,\n indices,\n -1,\n offsetPoint\n );\n computeLineAttributes(\n i0,\n i1,\n offsetPoint,\n positions,\n insertIndex,\n p1Attributes,\n applyOffset\n );\n\n insertIndex = insertSplitPoint(\n p1Attributes,\n p1Indices,\n p1IndexMap,\n indices,\n i + 1,\n p1\n );\n computeLineAttributes(\n i0,\n i1,\n p1,\n positions,\n insertIndex,\n p1Attributes,\n applyOffset\n );\n } else {\n let currentAttributes;\n let currentIndices;\n let currentIndexMap;\n\n if (p0.y < 0.0) {\n currentAttributes = westGeometry.attributes;\n currentIndices = westGeometry.indices;\n currentIndexMap = westGeometryIndexMap;\n } else {\n currentAttributes = eastGeometry.attributes;\n currentIndices = eastGeometry.indices;\n currentIndexMap = eastGeometryIndexMap;\n }\n\n insertIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n i,\n p0\n );\n computeLineAttributes(\n i0,\n i1,\n p0,\n positions,\n insertIndex,\n currentAttributes,\n applyOffset\n );\n\n insertIndex = insertSplitPoint(\n currentAttributes,\n currentIndices,\n currentIndexMap,\n indices,\n i + 1,\n p1\n );\n computeLineAttributes(\n i0,\n i1,\n p1,\n positions,\n insertIndex,\n currentAttributes,\n applyOffset\n );\n }\n }\n\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\nconst cartesian2Scratch0 = new Cartesian2();\nconst cartesian2Scratch1 = new Cartesian2();\n\nconst cartesian3Scratch0 = new Cartesian3();\nconst cartesian3Scratch2 = new Cartesian3();\nconst cartesian3Scratch3 = new Cartesian3();\nconst cartesian3Scratch4 = new Cartesian3();\nconst cartesian3Scratch5 = new Cartesian3();\nconst cartesian3Scratch6 = new Cartesian3();\n\nconst cartesian4Scratch0 = new Cartesian4();\n\nfunction updateAdjacencyAfterSplit(geometry) {\n const attributes = geometry.attributes;\n const positions = attributes.position.values;\n const prevPositions = attributes.prevPosition.values;\n const nextPositions = attributes.nextPosition.values;\n\n const length = positions.length;\n for (let j = 0; j < length; j += 3) {\n const position = Cartesian3.unpack(positions, j, cartesian3Scratch0);\n if (position.x > 0.0) {\n continue;\n }\n\n const prevPosition = Cartesian3.unpack(\n prevPositions,\n j,\n cartesian3Scratch2\n );\n if (\n (position.y < 0.0 && prevPosition.y > 0.0) ||\n (position.y > 0.0 && prevPosition.y < 0.0)\n ) {\n if (j - 3 > 0) {\n prevPositions[j] = positions[j - 3];\n prevPositions[j + 1] = positions[j - 2];\n prevPositions[j + 2] = positions[j - 1];\n } else {\n Cartesian3.pack(position, prevPositions, j);\n }\n }\n\n const nextPosition = Cartesian3.unpack(\n nextPositions,\n j,\n cartesian3Scratch3\n );\n if (\n (position.y < 0.0 && nextPosition.y > 0.0) ||\n (position.y > 0.0 && nextPosition.y < 0.0)\n ) {\n if (j + 3 < length) {\n nextPositions[j] = positions[j + 3];\n nextPositions[j + 1] = positions[j + 4];\n nextPositions[j + 2] = positions[j + 5];\n } else {\n Cartesian3.pack(position, nextPositions, j);\n }\n }\n }\n}\n\nconst offsetScalar = 5.0 * CesiumMath.EPSILON9;\nconst coplanarOffset = CesiumMath.EPSILON6;\n\nfunction splitLongitudePolyline(instance) {\n const geometry = instance.geometry;\n const attributes = geometry.attributes;\n const positions = attributes.position.values;\n const prevPositions = attributes.prevPosition.values;\n const nextPositions = attributes.nextPosition.values;\n const expandAndWidths = attributes.expandAndWidth.values;\n\n const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\n const colors = defined(attributes.color)\n ? attributes.color.values\n : undefined;\n\n const eastGeometry = copyGeometryForSplit(geometry);\n const westGeometry = copyGeometryForSplit(geometry);\n\n let i;\n let j;\n let index;\n\n let intersectionFound = false;\n\n const length = positions.length / 3;\n for (i = 0; i < length; i += 4) {\n const i0 = i;\n const i2 = i + 2;\n\n const p0 = Cartesian3.fromArray(positions, i0 * 3, cartesian3Scratch0);\n const p2 = Cartesian3.fromArray(positions, i2 * 3, cartesian3Scratch2);\n\n // Offset points that are close to the 180 longitude and change the previous/next point\n // to be the same offset point so it can be projected to 2D. There is special handling in the\n // shader for when position == prevPosition || position == nextPosition.\n if (Math.abs(p0.y) < coplanarOffset) {\n p0.y = coplanarOffset * (p2.y < 0.0 ? -1.0 : 1.0);\n positions[i * 3 + 1] = p0.y;\n positions[(i + 1) * 3 + 1] = p0.y;\n\n for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\n prevPositions[j] = positions[i * 3];\n prevPositions[j + 1] = positions[i * 3 + 1];\n prevPositions[j + 2] = positions[i * 3 + 2];\n }\n }\n\n // Do the same but for when the line crosses 180 longitude in the opposite direction.\n if (Math.abs(p2.y) < coplanarOffset) {\n p2.y = coplanarOffset * (p0.y < 0.0 ? -1.0 : 1.0);\n positions[(i + 2) * 3 + 1] = p2.y;\n positions[(i + 3) * 3 + 1] = p2.y;\n\n for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\n nextPositions[j] = positions[(i + 2) * 3];\n nextPositions[j + 1] = positions[(i + 2) * 3 + 1];\n nextPositions[j + 2] = positions[(i + 2) * 3 + 2];\n }\n }\n\n let p0Attributes = eastGeometry.attributes;\n let p0Indices = eastGeometry.indices;\n let p2Attributes = westGeometry.attributes;\n let p2Indices = westGeometry.indices;\n\n const intersection = IntersectionTests.lineSegmentPlane(\n p0,\n p2,\n xzPlane,\n cartesian3Scratch4\n );\n if (defined(intersection)) {\n intersectionFound = true;\n\n // move point on the xz-plane slightly away from the plane\n const offset = Cartesian3.multiplyByScalar(\n Cartesian3.UNIT_Y,\n offsetScalar,\n cartesian3Scratch5\n );\n if (p0.y < 0.0) {\n Cartesian3.negate(offset, offset);\n p0Attributes = westGeometry.attributes;\n p0Indices = westGeometry.indices;\n p2Attributes = eastGeometry.attributes;\n p2Indices = eastGeometry.indices;\n }\n\n const offsetPoint = Cartesian3.add(\n intersection,\n offset,\n cartesian3Scratch6\n );\n p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\n p0Attributes.position.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p0Attributes.position.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n\n p0Attributes.prevPosition.values.push(\n prevPositions[i0 * 3],\n prevPositions[i0 * 3 + 1],\n prevPositions[i0 * 3 + 2]\n );\n p0Attributes.prevPosition.values.push(\n prevPositions[i0 * 3 + 3],\n prevPositions[i0 * 3 + 4],\n prevPositions[i0 * 3 + 5]\n );\n p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\n\n p0Attributes.nextPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p0Attributes.nextPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p0Attributes.nextPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p0Attributes.nextPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n\n Cartesian3.negate(offset, offset);\n Cartesian3.add(intersection, offset, offsetPoint);\n p2Attributes.position.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p2Attributes.position.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\n\n p2Attributes.prevPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p2Attributes.prevPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p2Attributes.prevPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n p2Attributes.prevPosition.values.push(\n offsetPoint.x,\n offsetPoint.y,\n offsetPoint.z\n );\n\n p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\n p2Attributes.nextPosition.values.push(\n nextPositions[i2 * 3],\n nextPositions[i2 * 3 + 1],\n nextPositions[i2 * 3 + 2]\n );\n p2Attributes.nextPosition.values.push(\n nextPositions[i2 * 3 + 3],\n nextPositions[i2 * 3 + 4],\n nextPositions[i2 * 3 + 5]\n );\n\n const ew0 = Cartesian2.fromArray(\n expandAndWidths,\n i0 * 2,\n cartesian2Scratch0\n );\n const width = Math.abs(ew0.y);\n\n p0Attributes.expandAndWidth.values.push(-1, width, 1, width);\n p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\n p2Attributes.expandAndWidth.values.push(-1, width, 1, width);\n p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\n\n let t = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(intersection, p0, cartesian3Scratch3)\n );\n t /= Cartesian3.magnitudeSquared(\n Cartesian3.subtract(p2, p0, cartesian3Scratch3)\n );\n\n if (defined(colors)) {\n const c0 = Cartesian4.fromArray(colors, i0 * 4, cartesian4Scratch0);\n const c2 = Cartesian4.fromArray(colors, i2 * 4, cartesian4Scratch0);\n\n const r = CesiumMath.lerp(c0.x, c2.x, t);\n const g = CesiumMath.lerp(c0.y, c2.y, t);\n const b = CesiumMath.lerp(c0.z, c2.z, t);\n const a = CesiumMath.lerp(c0.w, c2.w, t);\n\n for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {\n p0Attributes.color.values.push(colors[j]);\n }\n p0Attributes.color.values.push(r, g, b, a);\n p0Attributes.color.values.push(r, g, b, a);\n p2Attributes.color.values.push(r, g, b, a);\n p2Attributes.color.values.push(r, g, b, a);\n for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {\n p2Attributes.color.values.push(colors[j]);\n }\n }\n\n if (defined(texCoords)) {\n const s0 = Cartesian2.fromArray(texCoords, i0 * 2, cartesian2Scratch0);\n const s3 = Cartesian2.fromArray(\n texCoords,\n (i + 3) * 2,\n cartesian2Scratch1\n );\n\n const sx = CesiumMath.lerp(s0.x, s3.x, t);\n\n for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {\n p0Attributes.st.values.push(texCoords[j]);\n }\n p0Attributes.st.values.push(sx, s0.y);\n p0Attributes.st.values.push(sx, s3.y);\n p2Attributes.st.values.push(sx, s0.y);\n p2Attributes.st.values.push(sx, s3.y);\n for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {\n p2Attributes.st.values.push(texCoords[j]);\n }\n }\n\n index = p0Attributes.position.values.length / 3 - 4;\n p0Indices.push(index, index + 2, index + 1);\n p0Indices.push(index + 1, index + 2, index + 3);\n\n index = p2Attributes.position.values.length / 3 - 4;\n p2Indices.push(index, index + 2, index + 1);\n p2Indices.push(index + 1, index + 2, index + 3);\n } else {\n let currentAttributes;\n let currentIndices;\n\n if (p0.y < 0.0) {\n currentAttributes = westGeometry.attributes;\n currentIndices = westGeometry.indices;\n } else {\n currentAttributes = eastGeometry.attributes;\n currentIndices = eastGeometry.indices;\n }\n\n currentAttributes.position.values.push(p0.x, p0.y, p0.z);\n currentAttributes.position.values.push(p0.x, p0.y, p0.z);\n currentAttributes.position.values.push(p2.x, p2.y, p2.z);\n currentAttributes.position.values.push(p2.x, p2.y, p2.z);\n\n for (j = i * 3; j < i * 3 + 4 * 3; ++j) {\n currentAttributes.prevPosition.values.push(prevPositions[j]);\n currentAttributes.nextPosition.values.push(nextPositions[j]);\n }\n\n for (j = i * 2; j < i * 2 + 4 * 2; ++j) {\n currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);\n if (defined(texCoords)) {\n currentAttributes.st.values.push(texCoords[j]);\n }\n }\n\n if (defined(colors)) {\n for (j = i * 4; j < i * 4 + 4 * 4; ++j) {\n currentAttributes.color.values.push(colors[j]);\n }\n }\n\n index = currentAttributes.position.values.length / 3 - 4;\n currentIndices.push(index, index + 2, index + 1);\n currentIndices.push(index + 1, index + 2, index + 3);\n }\n }\n\n if (intersectionFound) {\n updateAdjacencyAfterSplit(westGeometry);\n updateAdjacencyAfterSplit(eastGeometry);\n }\n\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\n}\n\n/**\n * Splits the instances's geometry, by introducing new vertices and indices,that\n * intersect the International Date Line and Prime Meridian so that no primitives cross longitude\n * -180/180 degrees. This is not required for 3D drawing, but is required for\n * correcting drawing in 2D and Columbus view.\n *\n * @private\n *\n * @param {GeometryInstance} instance The instance to modify.\n * @returns {GeometryInstance} The modified <code>instance</code> argument, with it's geometry split at the International Date Line.\n *\n * @example\n * instance = Cesium.GeometryPipeline.splitLongitude(instance);\n */\nGeometryPipeline.splitLongitude = function (instance) {\n const geometry = instance.geometry;\n const boundingSphere = geometry.boundingSphere;\n if (defined(boundingSphere)) {\n const minX = boundingSphere.center.x - boundingSphere.radius;\n if (\n minX > 0 ||\n BoundingSphere.intersectPlane(boundingSphere, Plane.ORIGIN_ZX_PLANE) !==\n Intersect.INTERSECTING\n ) {\n return instance;\n }\n }\n\n if (geometry.geometryType !== GeometryType.NONE) {\n switch (geometry.geometryType) {\n case GeometryType.POLYLINES:\n splitLongitudePolyline(instance);\n break;\n case GeometryType.TRIANGLES:\n splitLongitudeTriangles(instance);\n break;\n case GeometryType.LINES:\n splitLongitudeLines(instance);\n break;\n }\n } else {\n indexPrimitive(geometry);\n if (geometry.primitiveType === PrimitiveType.TRIANGLES) {\n splitLongitudeTriangles(instance);\n } else if (geometry.primitiveType === PrimitiveType.LINES) {\n splitLongitudeLines(instance);\n }\n }\n\n return instance;\n};\nexport default GeometryPipeline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This\n * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using\n * the spherical (rather than ellipsoidal) equations.\n *\n * @alias WebMercatorProjection\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n *\n * @see GeographicProjection\n */\nfunction WebMercatorProjection(ellipsoid) {\n this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n this._semimajorAxis = this._ellipsoid.maximumRadius;\n this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\n}\n\nObject.defineProperties(WebMercatorProjection.prototype, {\n /**\n * Gets the {@link Ellipsoid}.\n *\n * @memberof WebMercatorProjection.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n});\n\n/**\n * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude\n * in the range -PI/2 to PI/2.\n *\n * @param {Number} mercatorAngle The angle to convert.\n * @returns {Number} The geodetic latitude in radians.\n */\nWebMercatorProjection.mercatorAngleToGeodeticLatitude = function (\n mercatorAngle\n) {\n return CesiumMath.PI_OVER_TWO - 2.0 * Math.atan(Math.exp(-mercatorAngle));\n};\n\n/**\n * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator\n * angle in the range -PI to PI.\n *\n * @param {Number} latitude The geodetic latitude in radians.\n * @returns {Number} The Mercator angle.\n */\nWebMercatorProjection.geodeticLatitudeToMercatorAngle = function (latitude) {\n // Clamp the latitude coordinate to the valid Mercator bounds.\n if (latitude > WebMercatorProjection.MaximumLatitude) {\n latitude = WebMercatorProjection.MaximumLatitude;\n } else if (latitude < -WebMercatorProjection.MaximumLatitude) {\n latitude = -WebMercatorProjection.MaximumLatitude;\n }\n const sinLatitude = Math.sin(latitude);\n return 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n};\n\n/**\n * The maximum latitude (both North and South) supported by a Web Mercator\n * (EPSG:3857) projection. Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square. That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed by calling:\n * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)\n *\n * @type {Number}\n */\nWebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\n Math.PI\n);\n\n/**\n * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator\n * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height\n * is copied unmodified to the Z coordinate.\n *\n * @param {Cartographic} cartographic The cartographic coordinates in radians.\n * @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a\n * new instance should be created.\n * @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.\n */\nWebMercatorProjection.prototype.project = function (cartographic, result) {\n const semimajorAxis = this._semimajorAxis;\n const x = cartographic.longitude * semimajorAxis;\n const y =\n WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n cartographic.latitude\n ) * semimajorAxis;\n const z = cartographic.height;\n\n if (!defined(result)) {\n return new Cartesian3(x, y, z);\n }\n\n result.x = x;\n result.y = y;\n result.z = z;\n return result;\n};\n\n/**\n * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}\n * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the\n * height.\n *\n * @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.\n * @param {Cartographic} [result] The instance to which to copy the result, or undefined if a\n * new instance should be created.\n * @returns {Cartographic} The equivalent cartographic coordinates.\n */\nWebMercatorProjection.prototype.unproject = function (cartesian, result) {\n const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\n const longitude = cartesian.x * oneOverEarthSemimajorAxis;\n const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\n cartesian.y * oneOverEarthSemimajorAxis\n );\n const height = cartesian.z;\n\n if (!defined(result)) {\n return new Cartographic(longitude, latitude, height);\n }\n\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = height;\n return result;\n};\nexport default WebMercatorProjection;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport GeometryAttributes from \"../Core/GeometryAttributes.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\n\nfunction transformToWorldCoordinates(\n instances,\n primitiveModelMatrix,\n scene3DOnly\n) {\n let toWorld = !scene3DOnly;\n const length = instances.length;\n let i;\n\n if (!toWorld && length > 1) {\n const modelMatrix = instances[0].modelMatrix;\n\n for (i = 1; i < length; ++i) {\n if (!Matrix4.equals(modelMatrix, instances[i].modelMatrix)) {\n toWorld = true;\n break;\n }\n }\n }\n\n if (toWorld) {\n for (i = 0; i < length; ++i) {\n if (defined(instances[i].geometry)) {\n GeometryPipeline.transformToWorldCoordinates(instances[i]);\n }\n }\n } else {\n // Leave geometry in local coordinate system; auto update model-matrix.\n Matrix4.multiplyTransformation(\n primitiveModelMatrix,\n instances[0].modelMatrix,\n primitiveModelMatrix\n );\n }\n}\n\nfunction addGeometryBatchId(geometry, batchId) {\n const attributes = geometry.attributes;\n const positionAttr = attributes.position;\n const numberOfComponents =\n positionAttr.values.length / positionAttr.componentsPerAttribute;\n\n attributes.batchId = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 1,\n values: new Float32Array(numberOfComponents),\n });\n\n const values = attributes.batchId.values;\n for (let j = 0; j < numberOfComponents; ++j) {\n values[j] = batchId;\n }\n}\n\nfunction addBatchIds(instances) {\n const length = instances.length;\n\n for (let i = 0; i < length; ++i) {\n const instance = instances[i];\n if (defined(instance.geometry)) {\n addGeometryBatchId(instance.geometry, i);\n } else if (\n defined(instance.westHemisphereGeometry) &&\n defined(instance.eastHemisphereGeometry)\n ) {\n addGeometryBatchId(instance.westHemisphereGeometry, i);\n addGeometryBatchId(instance.eastHemisphereGeometry, i);\n }\n }\n}\n\nfunction geometryPipeline(parameters) {\n const instances = parameters.instances;\n const projection = parameters.projection;\n const uintIndexSupport = parameters.elementIndexUintSupported;\n const scene3DOnly = parameters.scene3DOnly;\n const vertexCacheOptimize = parameters.vertexCacheOptimize;\n const compressVertices = parameters.compressVertices;\n const modelMatrix = parameters.modelMatrix;\n\n let i;\n let geometry;\n let primitiveType;\n let length = instances.length;\n\n for (i = 0; i < length; ++i) {\n if (defined(instances[i].geometry)) {\n primitiveType = instances[i].geometry.primitiveType;\n break;\n }\n }\n\n // Unify to world coordinates before combining.\n transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);\n\n // Clip to IDL\n if (!scene3DOnly) {\n for (i = 0; i < length; ++i) {\n if (defined(instances[i].geometry)) {\n GeometryPipeline.splitLongitude(instances[i]);\n }\n }\n }\n\n addBatchIds(instances);\n\n // Optimize for vertex shader caches\n if (vertexCacheOptimize) {\n for (i = 0; i < length; ++i) {\n const instance = instances[i];\n if (defined(instance.geometry)) {\n GeometryPipeline.reorderForPostVertexCache(instance.geometry);\n GeometryPipeline.reorderForPreVertexCache(instance.geometry);\n } else if (\n defined(instance.westHemisphereGeometry) &&\n defined(instance.eastHemisphereGeometry)\n ) {\n GeometryPipeline.reorderForPostVertexCache(\n instance.westHemisphereGeometry\n );\n GeometryPipeline.reorderForPreVertexCache(\n instance.westHemisphereGeometry\n );\n\n GeometryPipeline.reorderForPostVertexCache(\n instance.eastHemisphereGeometry\n );\n GeometryPipeline.reorderForPreVertexCache(\n instance.eastHemisphereGeometry\n );\n }\n }\n }\n\n // Combine into single geometry for better rendering performance.\n let geometries = GeometryPipeline.combineInstances(instances);\n\n length = geometries.length;\n for (i = 0; i < length; ++i) {\n geometry = geometries[i];\n\n // Split positions for GPU RTE\n const attributes = geometry.attributes;\n if (!scene3DOnly) {\n for (const name in attributes) {\n if (\n attributes.hasOwnProperty(name) &&\n attributes[name].componentDatatype === ComponentDatatype.DOUBLE\n ) {\n const name3D = `${name}3D`;\n const name2D = `${name}2D`;\n\n // Compute 2D positions\n GeometryPipeline.projectTo2D(\n geometry,\n name,\n name3D,\n name2D,\n projection\n );\n if (defined(geometry.boundingSphere) && name === \"position\") {\n geometry.boundingSphereCV = BoundingSphere.fromVertices(\n geometry.attributes.position2D.values\n );\n }\n\n GeometryPipeline.encodeAttribute(\n geometry,\n name3D,\n `${name3D}High`,\n `${name3D}Low`\n );\n GeometryPipeline.encodeAttribute(\n geometry,\n name2D,\n `${name2D}High`,\n `${name2D}Low`\n );\n }\n }\n } else {\n for (const name in attributes) {\n if (\n attributes.hasOwnProperty(name) &&\n attributes[name].componentDatatype === ComponentDatatype.DOUBLE\n ) {\n GeometryPipeline.encodeAttribute(\n geometry,\n name,\n `${name}3DHigh`,\n `${name}3DLow`\n );\n }\n }\n }\n\n // oct encode and pack normals, compress texture coordinates\n if (compressVertices) {\n GeometryPipeline.compressVertices(geometry);\n }\n }\n\n if (!uintIndexSupport) {\n // Break into multiple geometries to fit within unsigned short indices if needed\n let splitGeometries = [];\n length = geometries.length;\n for (i = 0; i < length; ++i) {\n geometry = geometries[i];\n splitGeometries = splitGeometries.concat(\n GeometryPipeline.fitToUnsignedShortIndices(geometry)\n );\n }\n\n geometries = splitGeometries;\n }\n\n return geometries;\n}\n\nfunction createPickOffsets(instances, geometryName, geometries, pickOffsets) {\n let offset;\n let indexCount;\n let geometryIndex;\n\n const offsetIndex = pickOffsets.length - 1;\n if (offsetIndex >= 0) {\n const pickOffset = pickOffsets[offsetIndex];\n offset = pickOffset.offset + pickOffset.count;\n geometryIndex = pickOffset.index;\n indexCount = geometries[geometryIndex].indices.length;\n } else {\n offset = 0;\n geometryIndex = 0;\n indexCount = geometries[geometryIndex].indices.length;\n }\n\n const length = instances.length;\n for (let i = 0; i < length; ++i) {\n const instance = instances[i];\n const geometry = instance[geometryName];\n if (!defined(geometry)) {\n continue;\n }\n\n const count = geometry.indices.length;\n\n if (offset + count > indexCount) {\n offset = 0;\n indexCount = geometries[++geometryIndex].indices.length;\n }\n\n pickOffsets.push({\n index: geometryIndex,\n offset: offset,\n count: count,\n });\n offset += count;\n }\n}\n\nfunction createInstancePickOffsets(instances, geometries) {\n const pickOffsets = [];\n createPickOffsets(instances, \"geometry\", geometries, pickOffsets);\n createPickOffsets(\n instances,\n \"westHemisphereGeometry\",\n geometries,\n pickOffsets\n );\n createPickOffsets(\n instances,\n \"eastHemisphereGeometry\",\n geometries,\n pickOffsets\n );\n return pickOffsets;\n}\n\n/**\n * @private\n */\nconst PrimitivePipeline = {};\n\n/**\n * @private\n */\nPrimitivePipeline.combineGeometry = function (parameters) {\n let geometries;\n let attributeLocations;\n const instances = parameters.instances;\n const length = instances.length;\n let pickOffsets;\n\n let offsetInstanceExtend;\n let hasOffset = false;\n if (length > 0) {\n geometries = geometryPipeline(parameters);\n if (geometries.length > 0) {\n attributeLocations = GeometryPipeline.createAttributeLocations(\n geometries[0]\n );\n if (parameters.createPickOffsets) {\n pickOffsets = createInstancePickOffsets(instances, geometries);\n }\n }\n if (\n defined(instances[0].attributes) &&\n defined(instances[0].attributes.offset)\n ) {\n offsetInstanceExtend = new Array(length);\n hasOffset = true;\n }\n }\n\n const boundingSpheres = new Array(length);\n const boundingSpheresCV = new Array(length);\n for (let i = 0; i < length; ++i) {\n const instance = instances[i];\n const geometry = instance.geometry;\n if (defined(geometry)) {\n boundingSpheres[i] = geometry.boundingSphere;\n boundingSpheresCV[i] = geometry.boundingSphereCV;\n if (hasOffset) {\n offsetInstanceExtend[i] = instance.geometry.offsetAttribute;\n }\n }\n\n const eastHemisphereGeometry = instance.eastHemisphereGeometry;\n const westHemisphereGeometry = instance.westHemisphereGeometry;\n if (defined(eastHemisphereGeometry) && defined(westHemisphereGeometry)) {\n if (\n defined(eastHemisphereGeometry.boundingSphere) &&\n defined(westHemisphereGeometry.boundingSphere)\n ) {\n boundingSpheres[i] = BoundingSphere.union(\n eastHemisphereGeometry.boundingSphere,\n westHemisphereGeometry.boundingSphere\n );\n }\n if (\n defined(eastHemisphereGeometry.boundingSphereCV) &&\n defined(westHemisphereGeometry.boundingSphereCV)\n ) {\n boundingSpheresCV[i] = BoundingSphere.union(\n eastHemisphereGeometry.boundingSphereCV,\n westHemisphereGeometry.boundingSphereCV\n );\n }\n }\n }\n\n return {\n geometries: geometries,\n modelMatrix: parameters.modelMatrix,\n attributeLocations: attributeLocations,\n pickOffsets: pickOffsets,\n offsetInstanceExtend: offsetInstanceExtend,\n boundingSpheres: boundingSpheres,\n boundingSpheresCV: boundingSpheresCV,\n };\n};\n\nfunction transferGeometry(geometry, transferableObjects) {\n const attributes = geometry.attributes;\n for (const name in attributes) {\n if (attributes.hasOwnProperty(name)) {\n const attribute = attributes[name];\n\n if (defined(attribute) && defined(attribute.values)) {\n transferableObjects.push(attribute.values.buffer);\n }\n }\n }\n\n if (defined(geometry.indices)) {\n transferableObjects.push(geometry.indices.buffer);\n }\n}\n\nfunction transferGeometries(geometries, transferableObjects) {\n const length = geometries.length;\n for (let i = 0; i < length; ++i) {\n transferGeometry(geometries[i], transferableObjects);\n }\n}\n\n// This function was created by simplifying packCreateGeometryResults into a count-only operation.\nfunction countCreateGeometryResults(items) {\n let count = 1;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const geometry = items[i];\n ++count;\n\n if (!defined(geometry)) {\n continue;\n }\n\n const attributes = geometry.attributes;\n\n count +=\n 7 +\n 2 * BoundingSphere.packedLength +\n (defined(geometry.indices) ? geometry.indices.length : 0);\n\n for (const property in attributes) {\n if (\n attributes.hasOwnProperty(property) &&\n defined(attributes[property])\n ) {\n const attribute = attributes[property];\n count += 5 + attribute.values.length;\n }\n }\n }\n\n return count;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCreateGeometryResults = function (\n items,\n transferableObjects\n) {\n const packedData = new Float64Array(countCreateGeometryResults(items));\n const stringTable = [];\n const stringHash = {};\n\n const length = items.length;\n let count = 0;\n packedData[count++] = length;\n for (let i = 0; i < length; i++) {\n const geometry = items[i];\n\n const validGeometry = defined(geometry);\n packedData[count++] = validGeometry ? 1.0 : 0.0;\n\n if (!validGeometry) {\n continue;\n }\n\n packedData[count++] = geometry.primitiveType;\n packedData[count++] = geometry.geometryType;\n packedData[count++] = defaultValue(geometry.offsetAttribute, -1);\n\n const validBoundingSphere = defined(geometry.boundingSphere) ? 1.0 : 0.0;\n packedData[count++] = validBoundingSphere;\n if (validBoundingSphere) {\n BoundingSphere.pack(geometry.boundingSphere, packedData, count);\n }\n\n count += BoundingSphere.packedLength;\n\n const validBoundingSphereCV = defined(geometry.boundingSphereCV)\n ? 1.0\n : 0.0;\n packedData[count++] = validBoundingSphereCV;\n if (validBoundingSphereCV) {\n BoundingSphere.pack(geometry.boundingSphereCV, packedData, count);\n }\n\n count += BoundingSphere.packedLength;\n\n const attributes = geometry.attributes;\n const attributesToWrite = [];\n for (const property in attributes) {\n if (\n attributes.hasOwnProperty(property) &&\n defined(attributes[property])\n ) {\n attributesToWrite.push(property);\n if (!defined(stringHash[property])) {\n stringHash[property] = stringTable.length;\n stringTable.push(property);\n }\n }\n }\n\n packedData[count++] = attributesToWrite.length;\n for (let q = 0; q < attributesToWrite.length; q++) {\n const name = attributesToWrite[q];\n const attribute = attributes[name];\n packedData[count++] = stringHash[name];\n packedData[count++] = attribute.componentDatatype;\n packedData[count++] = attribute.componentsPerAttribute;\n packedData[count++] = attribute.normalize ? 1 : 0;\n packedData[count++] = attribute.values.length;\n packedData.set(attribute.values, count);\n count += attribute.values.length;\n }\n\n const indicesLength = defined(geometry.indices)\n ? geometry.indices.length\n : 0;\n packedData[count++] = indicesLength;\n\n if (indicesLength > 0) {\n packedData.set(geometry.indices, count);\n count += indicesLength;\n }\n }\n\n transferableObjects.push(packedData.buffer);\n\n return {\n stringTable: stringTable,\n packedData: packedData,\n };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCreateGeometryResults = function (\n createGeometryResult\n) {\n const stringTable = createGeometryResult.stringTable;\n const packedGeometry = createGeometryResult.packedData;\n\n let i;\n const result = new Array(packedGeometry[0]);\n let resultIndex = 0;\n\n let packedGeometryIndex = 1;\n while (packedGeometryIndex < packedGeometry.length) {\n const valid = packedGeometry[packedGeometryIndex++] === 1.0;\n if (!valid) {\n result[resultIndex++] = undefined;\n continue;\n }\n\n const primitiveType = packedGeometry[packedGeometryIndex++];\n const geometryType = packedGeometry[packedGeometryIndex++];\n let offsetAttribute = packedGeometry[packedGeometryIndex++];\n if (offsetAttribute === -1) {\n offsetAttribute = undefined;\n }\n\n let boundingSphere;\n let boundingSphereCV;\n\n const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1.0;\n if (validBoundingSphere) {\n boundingSphere = BoundingSphere.unpack(\n packedGeometry,\n packedGeometryIndex\n );\n }\n\n packedGeometryIndex += BoundingSphere.packedLength;\n\n const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1.0;\n if (validBoundingSphereCV) {\n boundingSphereCV = BoundingSphere.unpack(\n packedGeometry,\n packedGeometryIndex\n );\n }\n\n packedGeometryIndex += BoundingSphere.packedLength;\n\n let length;\n let values;\n let componentsPerAttribute;\n const attributes = new GeometryAttributes();\n const numAttributes = packedGeometry[packedGeometryIndex++];\n for (i = 0; i < numAttributes; i++) {\n const name = stringTable[packedGeometry[packedGeometryIndex++]];\n const componentDatatype = packedGeometry[packedGeometryIndex++];\n componentsPerAttribute = packedGeometry[packedGeometryIndex++];\n const normalize = packedGeometry[packedGeometryIndex++] !== 0;\n\n length = packedGeometry[packedGeometryIndex++];\n values = ComponentDatatype.createTypedArray(componentDatatype, length);\n for (let valuesIndex = 0; valuesIndex < length; valuesIndex++) {\n values[valuesIndex] = packedGeometry[packedGeometryIndex++];\n }\n\n attributes[name] = new GeometryAttribute({\n componentDatatype: componentDatatype,\n componentsPerAttribute: componentsPerAttribute,\n normalize: normalize,\n values: values,\n });\n }\n\n let indices;\n length = packedGeometry[packedGeometryIndex++];\n\n if (length > 0) {\n const numberOfVertices = values.length / componentsPerAttribute;\n indices = IndexDatatype.createTypedArray(numberOfVertices, length);\n for (i = 0; i < length; i++) {\n indices[i] = packedGeometry[packedGeometryIndex++];\n }\n }\n\n result[resultIndex++] = new Geometry({\n primitiveType: primitiveType,\n geometryType: geometryType,\n boundingSphere: boundingSphere,\n boundingSphereCV: boundingSphereCV,\n indices: indices,\n attributes: attributes,\n offsetAttribute: offsetAttribute,\n });\n }\n\n return result;\n};\n\nfunction packInstancesForCombine(instances, transferableObjects) {\n const length = instances.length;\n const packedData = new Float64Array(1 + length * 19);\n let count = 0;\n packedData[count++] = length;\n for (let i = 0; i < length; i++) {\n const instance = instances[i];\n Matrix4.pack(instance.modelMatrix, packedData, count);\n count += Matrix4.packedLength;\n if (defined(instance.attributes) && defined(instance.attributes.offset)) {\n const values = instance.attributes.offset.value;\n packedData[count] = values[0];\n packedData[count + 1] = values[1];\n packedData[count + 2] = values[2];\n }\n count += 3;\n }\n transferableObjects.push(packedData.buffer);\n\n return packedData;\n}\n\nfunction unpackInstancesForCombine(data) {\n const packedInstances = data;\n const result = new Array(packedInstances[0]);\n let count = 0;\n\n let i = 1;\n while (i < packedInstances.length) {\n const modelMatrix = Matrix4.unpack(packedInstances, i);\n let attributes;\n i += Matrix4.packedLength;\n if (defined(packedInstances[i])) {\n attributes = {\n offset: new OffsetGeometryInstanceAttribute(\n packedInstances[i],\n packedInstances[i + 1],\n packedInstances[i + 2]\n ),\n };\n }\n i += 3;\n\n result[count++] = {\n modelMatrix: modelMatrix,\n attributes: attributes,\n };\n }\n\n return result;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCombineGeometryParameters = function (\n parameters,\n transferableObjects\n) {\n const createGeometryResults = parameters.createGeometryResults;\n const length = createGeometryResults.length;\n\n for (let i = 0; i < length; i++) {\n transferableObjects.push(createGeometryResults[i].packedData.buffer);\n }\n\n return {\n createGeometryResults: parameters.createGeometryResults,\n packedInstances: packInstancesForCombine(\n parameters.instances,\n transferableObjects\n ),\n ellipsoid: parameters.ellipsoid,\n isGeographic: parameters.projection instanceof GeographicProjection,\n elementIndexUintSupported: parameters.elementIndexUintSupported,\n scene3DOnly: parameters.scene3DOnly,\n vertexCacheOptimize: parameters.vertexCacheOptimize,\n compressVertices: parameters.compressVertices,\n modelMatrix: parameters.modelMatrix,\n createPickOffsets: parameters.createPickOffsets,\n };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCombineGeometryParameters = function (\n packedParameters\n) {\n const instances = unpackInstancesForCombine(packedParameters.packedInstances);\n const createGeometryResults = packedParameters.createGeometryResults;\n const length = createGeometryResults.length;\n let instanceIndex = 0;\n\n for (let resultIndex = 0; resultIndex < length; resultIndex++) {\n const geometries = PrimitivePipeline.unpackCreateGeometryResults(\n createGeometryResults[resultIndex]\n );\n const geometriesLength = geometries.length;\n for (\n let geometryIndex = 0;\n geometryIndex < geometriesLength;\n geometryIndex++\n ) {\n const geometry = geometries[geometryIndex];\n const instance = instances[instanceIndex];\n instance.geometry = geometry;\n ++instanceIndex;\n }\n }\n\n const ellipsoid = Ellipsoid.clone(packedParameters.ellipsoid);\n const projection = packedParameters.isGeographic\n ? new GeographicProjection(ellipsoid)\n : new WebMercatorProjection(ellipsoid);\n\n return {\n instances: instances,\n ellipsoid: ellipsoid,\n projection: projection,\n elementIndexUintSupported: packedParameters.elementIndexUintSupported,\n scene3DOnly: packedParameters.scene3DOnly,\n vertexCacheOptimize: packedParameters.vertexCacheOptimize,\n compressVertices: packedParameters.compressVertices,\n modelMatrix: Matrix4.clone(packedParameters.modelMatrix),\n createPickOffsets: packedParameters.createPickOffsets,\n };\n};\n\nfunction packBoundingSpheres(boundingSpheres) {\n const length = boundingSpheres.length;\n const bufferLength = 1 + (BoundingSphere.packedLength + 1) * length;\n const buffer = new Float32Array(bufferLength);\n\n let bufferIndex = 0;\n buffer[bufferIndex++] = length;\n\n for (let i = 0; i < length; ++i) {\n const bs = boundingSpheres[i];\n if (!defined(bs)) {\n buffer[bufferIndex++] = 0.0;\n } else {\n buffer[bufferIndex++] = 1.0;\n BoundingSphere.pack(boundingSpheres[i], buffer, bufferIndex);\n }\n bufferIndex += BoundingSphere.packedLength;\n }\n\n return buffer;\n}\n\nfunction unpackBoundingSpheres(buffer) {\n const result = new Array(buffer[0]);\n let count = 0;\n\n let i = 1;\n while (i < buffer.length) {\n if (buffer[i++] === 1.0) {\n result[count] = BoundingSphere.unpack(buffer, i);\n }\n ++count;\n i += BoundingSphere.packedLength;\n }\n\n return result;\n}\n\n/**\n * @private\n */\nPrimitivePipeline.packCombineGeometryResults = function (\n results,\n transferableObjects\n) {\n if (defined(results.geometries)) {\n transferGeometries(results.geometries, transferableObjects);\n }\n\n const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);\n const packedBoundingSpheresCV = packBoundingSpheres(\n results.boundingSpheresCV\n );\n transferableObjects.push(\n packedBoundingSpheres.buffer,\n packedBoundingSpheresCV.buffer\n );\n\n return {\n geometries: results.geometries,\n attributeLocations: results.attributeLocations,\n modelMatrix: results.modelMatrix,\n pickOffsets: results.pickOffsets,\n offsetInstanceExtend: results.offsetInstanceExtend,\n boundingSpheres: packedBoundingSpheres,\n boundingSpheresCV: packedBoundingSpheresCV,\n };\n};\n\n/**\n * @private\n */\nPrimitivePipeline.unpackCombineGeometryResults = function (packedResult) {\n return {\n geometries: packedResult.geometries,\n attributeLocations: packedResult.attributeLocations,\n modelMatrix: packedResult.modelMatrix,\n pickOffsets: packedResult.pickOffsets,\n offsetInstanceExtend: packedResult.offsetInstanceExtend,\n boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),\n boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV),\n };\n};\nexport default PrimitivePipeline;\n", "/**\n * @private\n */\nconst PrimitiveState = {\n READY: 0,\n CREATING: 1,\n CREATED: 2,\n COMBINING: 3,\n COMBINED: 4,\n COMPLETE: 5,\n FAILED: 6,\n};\nexport default Object.freeze(PrimitiveState);\n", "/**\n * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.\n *\n * @enum {Number}\n * @see Scene#mode\n */\nconst SceneMode = {\n /**\n * Morphing between mode, e.g., 3D to 2D.\n *\n * @type {Number}\n * @constant\n */\n MORPHING: 0,\n\n /**\n * Columbus View mode. A 2.5D perspective view where the map is laid out\n * flat and objects with non-zero height are drawn above it.\n *\n * @type {Number}\n * @constant\n */\n COLUMBUS_VIEW: 1,\n\n /**\n * 2D mode. The map is viewed top-down with an orthographic projection.\n *\n * @type {Number}\n * @constant\n */\n SCENE2D: 2,\n\n /**\n * 3D mode. A traditional 3D perspective view of the globe.\n *\n * @type {Number}\n * @constant\n */\n SCENE3D: 3,\n};\n\n/**\n * Returns the morph time for the given scene mode.\n *\n * @param {SceneMode} value The scene mode\n * @returns {Number} The morph time\n */\nSceneMode.getMorphTime = function (value) {\n if (value === SceneMode.SCENE3D) {\n return 1.0;\n } else if (value === SceneMode.MORPHING) {\n return undefined;\n }\n return 0.0;\n};\nexport default Object.freeze(SceneMode);\n", "/**\n * Specifies whether the object casts or receives shadows from light sources when\n * shadows are enabled.\n *\n * @enum {Number}\n */\nconst ShadowMode = {\n /**\n * The object does not cast or receive shadows.\n *\n * @type {Number}\n * @constant\n */\n DISABLED: 0,\n\n /**\n * The object casts and receives shadows.\n *\n * @type {Number}\n * @constant\n */\n ENABLED: 1,\n\n /**\n * The object casts shadows only.\n *\n * @type {Number}\n * @constant\n */\n CAST_ONLY: 2,\n\n /**\n * The object receives shadows only.\n *\n * @type {Number}\n * @constant\n */\n RECEIVE_ONLY: 3,\n};\n\n/**\n * @private\n */\nShadowMode.NUMBER_OF_SHADOW_MODES = 4;\n\n/**\n * @private\n */\nShadowMode.castShadows = function (shadowMode) {\n return (\n shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.CAST_ONLY\n );\n};\n\n/**\n * @private\n */\nShadowMode.receiveShadows = function (shadowMode) {\n return (\n shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.RECEIVE_ONLY\n );\n};\n\n/**\n * @private\n */\nShadowMode.fromCastReceive = function (castShadows, receiveShadows) {\n if (castShadows && receiveShadows) {\n return ShadowMode.ENABLED;\n } else if (castShadows) {\n return ShadowMode.CAST_ONLY;\n } else if (receiveShadows) {\n return ShadowMode.RECEIVE_ONLY;\n }\n return ShadowMode.DISABLED;\n};\n\nexport default Object.freeze(ShadowMode);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport GeometryAttributes from \"../Core/GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Plane from \"../Core/Plane.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport subdivideArray from \"../Core/subdivideArray.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport BatchTable from \"./BatchTable.js\";\nimport CullFace from \"./CullFace.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport PrimitivePipeline from \"./PrimitivePipeline.js\";\nimport PrimitiveState from \"./PrimitiveState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\n\n/**\n * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}\n * as shown in example 1 below, or from an array of instances, even if the geometry is from different\n * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * </p>\n * <p>\n * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.\n * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using\n * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.\n * </p>\n * <p>\n * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples\n * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example\n * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.\n * </p>\n *\n * @alias Primitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {GeometryInstance[]|GeometryInstance} [options.geometryInstances] The geometry instances - or a single geometry instance - to render.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive.\n * @param {Appearance} [options.depthFailAppearance] The appearance used to shade this primitive when it fails the depth test.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.\n * @param {Boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {Boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {Boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {Boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {Boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n * @param {Boolean} [options.cull=true] When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume. Set this to <code>false</code> for a small performance gain if you are manually culling the primitive.\n * @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {ShadowMode} [options.shadows=ShadowMode.DISABLED] Determines whether this primitive casts or receives shadows from light sources.\n *\n * @example\n * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern\n * const instance = new Cesium.GeometryInstance({\n * geometry : new Cesium.EllipseGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),\n * semiMinorAxis : 500000.0,\n * semiMajorAxis : 1000000.0,\n * rotation : Cesium.Math.PI_OVER_FOUR,\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST\n * }),\n * id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n * scene.primitives.add(new Cesium.Primitive({\n * geometryInstances : instance,\n * appearance : new Cesium.EllipsoidSurfaceAppearance({\n * material : Cesium.Material.fromType('Checkerboard')\n * })\n * }));\n *\n * @example\n * // 2. Draw different instances each with a unique color\n * const rectangleInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.RectangleGeometry({\n * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),\n * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT\n * }),\n * id : 'rectangle',\n * attributes : {\n * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)\n * }\n * });\n * const ellipsoidInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.EllipsoidGeometry({\n * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL\n * }),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),\n * id : 'ellipsoid',\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n * }\n * });\n * scene.primitives.add(new Cesium.Primitive({\n * geometryInstances : [rectangleInstance, ellipsoidInstance],\n * appearance : new Cesium.PerInstanceColorAppearance()\n * }));\n *\n * @example\n * // 3. Create the geometry on the main thread.\n * scene.primitives.add(new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({\n * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL\n * })),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),\n * id : 'ellipsoid',\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\n * }\n * }),\n * appearance : new Cesium.PerInstanceColorAppearance(),\n * asynchronous : false\n * }));\n *\n * @see GeometryInstance\n * @see Appearance\n * @see ClassificationPrimitive\n * @see GroundPrimitive\n */\nfunction Primitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The geometry instances rendered with this primitive. This may\n * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n * is <code>true</code> when the primitive is constructed.\n * <p>\n * Changing this property after the primitive is rendered has no effect.\n * </p>\n *\n * @readonly\n * @type GeometryInstance[]|GeometryInstance\n *\n * @default undefined\n */\n this.geometryInstances = options.geometryInstances;\n\n /**\n * The {@link Appearance} used to shade this primitive. Each geometry\n * instance is shaded with the same appearance. Some appearances, like\n * {@link PerInstanceColorAppearance} allow giving each instance unique\n * properties.\n *\n * @type Appearance\n *\n * @default undefined\n */\n this.appearance = options.appearance;\n this._appearance = undefined;\n this._material = undefined;\n\n /**\n * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry\n * instance is shaded with the same appearance. Some appearances, like\n * {@link PerInstanceColorAppearance} allow giving each instance unique\n * properties.\n *\n * <p>\n * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,\n * add a depthFailColor per-instance attribute instead.\n * </p>\n *\n * <p>\n * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,\n * there may be artifacts.\n * </p>\n * @type Appearance\n *\n * @default undefined\n */\n this.depthFailAppearance = options.depthFailAppearance;\n this._depthFailAppearance = undefined;\n this._depthFailMaterial = undefined;\n\n /**\n * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.\n * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * <p>\n * This property is only supported in 3D mode.\n * </p>\n *\n * @type Matrix4\n *\n * @default Matrix4.IDENTITY\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = new Matrix4();\n\n /**\n * Determines if the primitive will be shown. This affects all geometry\n * instances in the primitive.\n *\n * @type Boolean\n *\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n this._vertexCacheOptimize = defaultValue(options.vertexCacheOptimize, false);\n this._interleave = defaultValue(options.interleave, false);\n this._releaseGeometryInstances = defaultValue(\n options.releaseGeometryInstances,\n true\n );\n this._allowPicking = defaultValue(options.allowPicking, true);\n this._asynchronous = defaultValue(options.asynchronous, true);\n this._compressVertices = defaultValue(options.compressVertices, true);\n\n /**\n * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands\n * based on their bounding volume. Set this to <code>false</code> for a small performance gain\n * if you are manually culling the primitive.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.cull = defaultValue(options.cull, true);\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * @private\n */\n this.rtcCenter = options.rtcCenter;\n\n /**\n * Determines whether this primitive casts or receives shadows from light sources.\n *\n * @type {ShadowMode}\n *\n * @default ShadowMode.DISABLED\n */\n this.shadows = defaultValue(options.shadows, ShadowMode.DISABLED);\n\n this._translucent = undefined;\n\n this._state = PrimitiveState.READY;\n this._geometries = [];\n this._error = undefined;\n this._numberOfInstances = 0;\n\n this._boundingSpheres = [];\n this._boundingSphereWC = [];\n this._boundingSphereCV = [];\n this._boundingSphere2D = [];\n this._boundingSphereMorph = [];\n this._perInstanceAttributeCache = [];\n this._instanceIds = [];\n this._lastPerInstanceAttributeIndex = 0;\n\n this._va = [];\n this._attributeLocations = undefined;\n this._primitiveType = undefined;\n\n this._frontFaceRS = undefined;\n this._backFaceRS = undefined;\n this._sp = undefined;\n\n this._depthFailAppearance = undefined;\n this._spDepthFail = undefined;\n this._frontFaceDepthFailRS = undefined;\n this._backFaceDepthFailRS = undefined;\n\n this._pickIds = [];\n\n this._colorCommands = [];\n this._pickCommands = [];\n\n this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;\n this._createRenderStatesFunction = options._createRenderStatesFunction;\n this._createShaderProgramFunction = options._createShaderProgramFunction;\n this._createCommandsFunction = options._createCommandsFunction;\n this._updateAndQueueCommandsFunction =\n options._updateAndQueueCommandsFunction;\n\n this._createPickOffsets = options._createPickOffsets;\n this._pickOffsets = undefined;\n\n this._createGeometryResults = undefined;\n this._ready = false;\n\n const primitive = this;\n this._readyPromise = new Promise((resolve, reject) => {\n primitive._completeLoad = (frameState, state, error) => {\n this._error = error;\n this._state = state;\n frameState.afterRender.push(function () {\n primitive._ready =\n primitive._state === PrimitiveState.COMPLETE ||\n primitive._state === PrimitiveState.FAILED;\n if (!defined(error)) {\n resolve(primitive);\n } else {\n reject(error);\n }\n });\n };\n });\n\n this._batchTable = undefined;\n this._batchTableAttributeIndices = undefined;\n this._offsetInstanceExtend = undefined;\n this._batchTableOffsetAttribute2DIndex = undefined;\n this._batchTableOffsetsUpdated = false;\n this._instanceBoundingSpheres = undefined;\n this._instanceBoundingSpheresCV = undefined;\n this._tempBoundingSpheres = undefined;\n this._recomputeBoundingSpheres = false;\n this._batchTableBoundingSpheresUpdated = false;\n this._batchTableBoundingSphereAttributeIndices = undefined;\n}\n\nObject.defineProperties(Primitive.prototype, {\n /**\n * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n vertexCacheOptimize: {\n get: function () {\n return this._vertexCacheOptimize;\n },\n },\n\n /**\n * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n interleave: {\n get: function () {\n return this._interleave;\n },\n },\n\n /**\n * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n releaseGeometryInstances: {\n get: function () {\n return this._releaseGeometryInstances;\n },\n },\n\n /**\n * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n allowPicking: {\n get: function () {\n return this._allowPicking;\n },\n },\n\n /**\n * Determines if the geometry instances will be created and batched on a web worker.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n asynchronous: {\n get: function () {\n return this._asynchronous;\n },\n },\n\n /**\n * When <code>true</code>, geometry vertices are compressed, which will save memory.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n compressVertices: {\n get: function () {\n return this._compressVertices;\n },\n },\n\n /**\n * Determines if the primitive is complete and ready to render. If this property is\n * true, the primitive will be rendered the next time that {@link Primitive#update}\n * is called.\n *\n * @memberof Primitive.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Primitive.prototype\n * @type {Promise.<Primitive>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction getCommonPerInstanceAttributeNames(instances) {\n const length = instances.length;\n\n const attributesInAllInstances = [];\n const attributes0 = instances[0].attributes;\n let name;\n\n for (name in attributes0) {\n if (attributes0.hasOwnProperty(name) && defined(attributes0[name])) {\n const attribute = attributes0[name];\n let inAllInstances = true;\n\n // Does this same attribute exist in all instances?\n for (let i = 1; i < length; ++i) {\n const otherAttribute = instances[i].attributes[name];\n\n if (\n !defined(otherAttribute) ||\n attribute.componentDatatype !== otherAttribute.componentDatatype ||\n attribute.componentsPerAttribute !==\n otherAttribute.componentsPerAttribute ||\n attribute.normalize !== otherAttribute.normalize\n ) {\n inAllInstances = false;\n break;\n }\n }\n\n if (inAllInstances) {\n attributesInAllInstances.push(name);\n }\n }\n }\n\n return attributesInAllInstances;\n}\n\nconst scratchGetAttributeCartesian2 = new Cartesian2();\nconst scratchGetAttributeCartesian3 = new Cartesian3();\nconst scratchGetAttributeCartesian4 = new Cartesian4();\n\nfunction getAttributeValue(value) {\n const componentsPerAttribute = value.length;\n if (componentsPerAttribute === 1) {\n return value[0];\n } else if (componentsPerAttribute === 2) {\n return Cartesian2.unpack(value, 0, scratchGetAttributeCartesian2);\n } else if (componentsPerAttribute === 3) {\n return Cartesian3.unpack(value, 0, scratchGetAttributeCartesian3);\n } else if (componentsPerAttribute === 4) {\n return Cartesian4.unpack(value, 0, scratchGetAttributeCartesian4);\n }\n}\n\nfunction createBatchTable(primitive, context) {\n const geometryInstances = primitive.geometryInstances;\n const instances = Array.isArray(geometryInstances)\n ? geometryInstances\n : [geometryInstances];\n const numberOfInstances = instances.length;\n if (numberOfInstances === 0) {\n return;\n }\n\n const names = getCommonPerInstanceAttributeNames(instances);\n const length = names.length;\n\n const attributes = [];\n const attributeIndices = {};\n const boundingSphereAttributeIndices = {};\n let offset2DIndex;\n\n const firstInstance = instances[0];\n let instanceAttributes = firstInstance.attributes;\n\n let i;\n let name;\n let attribute;\n\n for (i = 0; i < length; ++i) {\n name = names[i];\n attribute = instanceAttributes[name];\n\n attributeIndices[name] = i;\n attributes.push({\n functionName: `czm_batchTable_${name}`,\n componentDatatype: attribute.componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n });\n }\n\n if (names.indexOf(\"distanceDisplayCondition\") !== -1) {\n attributes.push(\n {\n functionName: \"czm_batchTable_boundingSphereCenter3DHigh\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n functionName: \"czm_batchTable_boundingSphereCenter3DLow\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n functionName: \"czm_batchTable_boundingSphereCenter2DHigh\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n functionName: \"czm_batchTable_boundingSphereCenter2DLow\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n functionName: \"czm_batchTable_boundingSphereRadius\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 1,\n }\n );\n boundingSphereAttributeIndices.center3DHigh = attributes.length - 5;\n boundingSphereAttributeIndices.center3DLow = attributes.length - 4;\n boundingSphereAttributeIndices.center2DHigh = attributes.length - 3;\n boundingSphereAttributeIndices.center2DLow = attributes.length - 2;\n boundingSphereAttributeIndices.radius = attributes.length - 1;\n }\n\n if (names.indexOf(\"offset\") !== -1) {\n attributes.push({\n functionName: \"czm_batchTable_offset2D\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n });\n offset2DIndex = attributes.length - 1;\n }\n\n attributes.push({\n functionName: \"czm_batchTable_pickColor\",\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 4,\n normalize: true,\n });\n\n const attributesLength = attributes.length;\n const batchTable = new BatchTable(context, attributes, numberOfInstances);\n\n for (i = 0; i < numberOfInstances; ++i) {\n const instance = instances[i];\n instanceAttributes = instance.attributes;\n\n for (let j = 0; j < length; ++j) {\n name = names[j];\n attribute = instanceAttributes[name];\n const value = getAttributeValue(attribute.value);\n const attributeIndex = attributeIndices[name];\n batchTable.setBatchedAttribute(i, attributeIndex, value);\n }\n\n const pickObject = {\n primitive: defaultValue(instance.pickPrimitive, primitive),\n };\n\n if (defined(instance.id)) {\n pickObject.id = instance.id;\n }\n\n const pickId = context.createPickId(pickObject);\n primitive._pickIds.push(pickId);\n\n const pickColor = pickId.color;\n const color = scratchGetAttributeCartesian4;\n color.x = Color.floatToByte(pickColor.red);\n color.y = Color.floatToByte(pickColor.green);\n color.z = Color.floatToByte(pickColor.blue);\n color.w = Color.floatToByte(pickColor.alpha);\n\n batchTable.setBatchedAttribute(i, attributesLength - 1, color);\n }\n\n primitive._batchTable = batchTable;\n primitive._batchTableAttributeIndices = attributeIndices;\n primitive._batchTableBoundingSphereAttributeIndices = boundingSphereAttributeIndices;\n primitive._batchTableOffsetAttribute2DIndex = offset2DIndex;\n}\n\nfunction cloneAttribute(attribute) {\n let clonedValues;\n if (Array.isArray(attribute.values)) {\n clonedValues = attribute.values.slice(0);\n } else {\n clonedValues = new attribute.values.constructor(attribute.values);\n }\n return new GeometryAttribute({\n componentDatatype: attribute.componentDatatype,\n componentsPerAttribute: attribute.componentsPerAttribute,\n normalize: attribute.normalize,\n values: clonedValues,\n });\n}\n\nfunction cloneGeometry(geometry) {\n const attributes = geometry.attributes;\n const newAttributes = new GeometryAttributes();\n for (const property in attributes) {\n if (attributes.hasOwnProperty(property) && defined(attributes[property])) {\n newAttributes[property] = cloneAttribute(attributes[property]);\n }\n }\n\n let indices;\n if (defined(geometry.indices)) {\n const sourceValues = geometry.indices;\n if (Array.isArray(sourceValues)) {\n indices = sourceValues.slice(0);\n } else {\n indices = new sourceValues.constructor(sourceValues);\n }\n }\n\n return new Geometry({\n attributes: newAttributes,\n indices: indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: BoundingSphere.clone(geometry.boundingSphere),\n });\n}\n\nfunction cloneInstance(instance, geometry) {\n return {\n geometry: geometry,\n attributes: instance.attributes,\n modelMatrix: Matrix4.clone(instance.modelMatrix),\n pickPrimitive: instance.pickPrimitive,\n id: instance.id,\n };\n}\n\nconst positionRegex = /attribute\\s+vec(?:3|4)\\s+(.*)3DHigh;/g;\n\nPrimitive._modifyShaderPosition = function (\n primitive,\n vertexShaderSource,\n scene3DOnly\n) {\n let match;\n\n let forwardDecl = \"\";\n let attributes = \"\";\n let computeFunctions = \"\";\n\n while ((match = positionRegex.exec(vertexShaderSource)) !== null) {\n const name = match[1];\n\n const functionName = `vec4 czm_compute${name[0].toUpperCase()}${name.substr(\n 1\n )}()`;\n\n // Don't forward-declare czm_computePosition because computePosition.glsl already does.\n if (functionName !== \"vec4 czm_computePosition()\") {\n forwardDecl += `${functionName};\\n`;\n }\n\n if (!defined(primitive.rtcCenter)) {\n // Use GPU RTE\n if (!scene3DOnly) {\n attributes +=\n `attribute vec3 ${name}2DHigh;\\n` + `attribute vec3 ${name}2DLow;\\n`;\n\n computeFunctions +=\n `${functionName}\\n` +\n `{\\n` +\n ` vec4 p;\\n` +\n ` if (czm_morphTime == 1.0)\\n` +\n ` {\\n` +\n ` p = czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);\\n` +\n ` }\\n` +\n ` else if (czm_morphTime == 0.0)\\n` +\n ` {\\n` +\n ` p = czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy);\\n` +\n ` }\\n` +\n ` else\\n` +\n ` {\\n` +\n ` p = czm_columbusViewMorph(\\n` +\n ` czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy),\\n` +\n ` czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow),\\n` +\n ` czm_morphTime);\\n` +\n ` }\\n` +\n ` return p;\\n` +\n `}\\n\\n`;\n } else {\n computeFunctions +=\n `${functionName}\\n` +\n `{\\n` +\n ` return czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);\\n` +\n `}\\n\\n`;\n }\n } else {\n // Use RTC\n vertexShaderSource = vertexShaderSource.replace(\n /attribute\\s+vec(?:3|4)\\s+position3DHigh;/g,\n \"\"\n );\n vertexShaderSource = vertexShaderSource.replace(\n /attribute\\s+vec(?:3|4)\\s+position3DLow;/g,\n \"\"\n );\n\n forwardDecl += \"uniform mat4 u_modifiedModelView;\\n\";\n attributes += \"attribute vec4 position;\\n\";\n\n computeFunctions +=\n `${functionName}\\n` +\n `{\\n` +\n ` return u_modifiedModelView * position;\\n` +\n `}\\n\\n`;\n\n vertexShaderSource = vertexShaderSource.replace(\n /czm_modelViewRelativeToEye\\s+\\*\\s+/g,\n \"\"\n );\n vertexShaderSource = vertexShaderSource.replace(\n /czm_modelViewProjectionRelativeToEye/g,\n \"czm_projection\"\n );\n }\n }\n\n return [forwardDecl, attributes, vertexShaderSource, computeFunctions].join(\n \"\\n\"\n );\n};\n\nPrimitive._appendShowToShader = function (primitive, vertexShaderSource) {\n if (!defined(primitive._batchTableAttributeIndices.show)) {\n return vertexShaderSource;\n }\n\n const renamedVS = ShaderSource.replaceMain(\n vertexShaderSource,\n \"czm_non_show_main\"\n );\n const showMain =\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_non_show_main(); \\n\" +\n \" gl_Position *= czm_batchTable_show(batchId); \\n\" +\n \"}\";\n\n return `${renamedVS}\\n${showMain}`;\n};\n\nPrimitive._updateColorAttribute = function (\n primitive,\n vertexShaderSource,\n isDepthFail\n) {\n // some appearances have a color attribute for per vertex color.\n // only remove if color is a per instance attribute.\n if (\n !defined(primitive._batchTableAttributeIndices.color) &&\n !defined(primitive._batchTableAttributeIndices.depthFailColor)\n ) {\n return vertexShaderSource;\n }\n\n if (vertexShaderSource.search(/attribute\\s+vec4\\s+color;/g) === -1) {\n return vertexShaderSource;\n }\n\n let modifiedVS = vertexShaderSource;\n modifiedVS = modifiedVS.replace(/attribute\\s+vec4\\s+color;/g, \"\");\n if (!isDepthFail) {\n modifiedVS = modifiedVS.replace(\n /(\\b)color(\\b)/g,\n \"$1czm_batchTable_color(batchId)$2\"\n );\n } else {\n modifiedVS = modifiedVS.replace(\n /(\\b)color(\\b)/g,\n \"$1czm_batchTable_depthFailColor(batchId)$2\"\n );\n }\n return modifiedVS;\n};\n\nfunction appendPickToVertexShader(source) {\n const renamedVS = ShaderSource.replaceMain(source, \"czm_non_pick_main\");\n const pickMain =\n \"varying vec4 v_pickColor; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_non_pick_main(); \\n\" +\n \" v_pickColor = czm_batchTable_pickColor(batchId); \\n\" +\n \"}\";\n\n return `${renamedVS}\\n${pickMain}`;\n}\n\nfunction appendPickToFragmentShader(source) {\n return `varying vec4 v_pickColor;\\n${source}`;\n}\n\nPrimitive._updatePickColorAttribute = function (source) {\n let vsPick = source.replace(/attribute\\s+vec4\\s+pickColor;/g, \"\");\n vsPick = vsPick.replace(\n /(\\b)pickColor(\\b)/g,\n \"$1czm_batchTable_pickColor(batchId)$2\"\n );\n return vsPick;\n};\n\nPrimitive._appendOffsetToShader = function (primitive, vertexShaderSource) {\n if (!defined(primitive._batchTableAttributeIndices.offset)) {\n return vertexShaderSource;\n }\n\n let attr = \"attribute float batchId;\\n\";\n attr += \"attribute float applyOffset;\";\n let modifiedShader = vertexShaderSource.replace(\n /attribute\\s+float\\s+batchId;/g,\n attr\n );\n\n let str = \"vec4 $1 = czm_computePosition();\\n\";\n str += \" if (czm_sceneMode == czm_sceneMode3D)\\n\";\n str += \" {\\n\";\n str +=\n \" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);\";\n str += \" }\\n\";\n str += \" else\\n\";\n str += \" {\\n\";\n str +=\n \" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);\";\n str += \" }\\n\";\n modifiedShader = modifiedShader.replace(\n /vec4\\s+([A-Za-z0-9_]+)\\s+=\\s+czm_computePosition\\(\\);/g,\n str\n );\n return modifiedShader;\n};\n\nPrimitive._appendDistanceDisplayConditionToShader = function (\n primitive,\n vertexShaderSource,\n scene3DOnly\n) {\n if (\n !defined(primitive._batchTableAttributeIndices.distanceDisplayCondition)\n ) {\n return vertexShaderSource;\n }\n\n const renamedVS = ShaderSource.replaceMain(\n vertexShaderSource,\n \"czm_non_distanceDisplayCondition_main\"\n );\n let distanceDisplayConditionMain =\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_non_distanceDisplayCondition_main(); \\n\" +\n \" vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\\n\" +\n \" vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\\n\" +\n \" vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\\n\" +\n \" float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\\n\";\n\n if (!scene3DOnly) {\n distanceDisplayConditionMain +=\n \" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\\n\" +\n \" vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\\n\" +\n \" vec4 centerRTE;\\n\" +\n \" if (czm_morphTime == 1.0)\\n\" +\n \" {\\n\" +\n \" centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\\n\" +\n \" }\\n\" +\n \" else if (czm_morphTime == 0.0)\\n\" +\n \" {\\n\" +\n \" centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\\n\" +\n \" }\\n\" +\n \" else\\n\" +\n \" {\\n\" +\n \" centerRTE = czm_columbusViewMorph(\\n\" +\n \" czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\\n\" +\n \" czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\\n\" +\n \" czm_morphTime);\\n\" +\n \" }\\n\";\n } else {\n distanceDisplayConditionMain +=\n \" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\\n\";\n }\n\n distanceDisplayConditionMain +=\n \" float radiusSq = boundingSphereRadius * boundingSphereRadius; \\n\" +\n \" float distanceSq; \\n\" +\n \" if (czm_sceneMode == czm_sceneMode2D) \\n\" +\n \" { \\n\" +\n \" distanceSq = czm_eyeHeight2D.y - radiusSq; \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \\n\" +\n \" } \\n\" +\n \" distanceSq = max(distanceSq, 0.0); \\n\" +\n \" float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \\n\" +\n \" float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \\n\" +\n \" float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \\n\" +\n \" gl_Position *= show; \\n\" +\n \"}\";\n return `${renamedVS}\\n${distanceDisplayConditionMain}`;\n};\n\nfunction modifyForEncodedNormals(primitive, vertexShaderSource) {\n if (!primitive.compressVertices) {\n return vertexShaderSource;\n }\n\n const containsNormal =\n vertexShaderSource.search(/attribute\\s+vec3\\s+normal;/g) !== -1;\n const containsSt =\n vertexShaderSource.search(/attribute\\s+vec2\\s+st;/g) !== -1;\n if (!containsNormal && !containsSt) {\n return vertexShaderSource;\n }\n\n const containsTangent =\n vertexShaderSource.search(/attribute\\s+vec3\\s+tangent;/g) !== -1;\n const containsBitangent =\n vertexShaderSource.search(/attribute\\s+vec3\\s+bitangent;/g) !== -1;\n\n let numComponents = containsSt && containsNormal ? 2.0 : 1.0;\n numComponents += containsTangent || containsBitangent ? 1 : 0;\n\n const type = numComponents > 1 ? `vec${numComponents}` : \"float\";\n\n const attributeName = \"compressedAttributes\";\n const attributeDecl = `attribute ${type} ${attributeName};`;\n\n let globalDecl = \"\";\n let decode = \"\";\n\n if (containsSt) {\n globalDecl += \"vec2 st;\\n\";\n const stComponent =\n numComponents > 1 ? `${attributeName}.x` : attributeName;\n decode += ` st = czm_decompressTextureCoordinates(${stComponent});\\n`;\n }\n\n if (containsNormal && containsTangent && containsBitangent) {\n globalDecl += \"vec3 normal;\\n\" + \"vec3 tangent;\\n\" + \"vec3 bitangent;\\n\";\n decode += ` czm_octDecode(${attributeName}.${\n containsSt ? \"yz\" : \"xy\"\n }, normal, tangent, bitangent);\\n`;\n } else {\n if (containsNormal) {\n globalDecl += \"vec3 normal;\\n\";\n decode += ` normal = czm_octDecode(${attributeName}${\n numComponents > 1 ? `.${containsSt ? \"y\" : \"x\"}` : \"\"\n });\\n`;\n }\n\n if (containsTangent) {\n globalDecl += \"vec3 tangent;\\n\";\n decode += ` tangent = czm_octDecode(${attributeName}.${\n containsSt && containsNormal ? \"z\" : \"y\"\n });\\n`;\n }\n\n if (containsBitangent) {\n globalDecl += \"vec3 bitangent;\\n\";\n decode += ` bitangent = czm_octDecode(${attributeName}.${\n containsSt && containsNormal ? \"z\" : \"y\"\n });\\n`;\n }\n }\n\n let modifiedVS = vertexShaderSource;\n modifiedVS = modifiedVS.replace(/attribute\\s+vec3\\s+normal;/g, \"\");\n modifiedVS = modifiedVS.replace(/attribute\\s+vec2\\s+st;/g, \"\");\n modifiedVS = modifiedVS.replace(/attribute\\s+vec3\\s+tangent;/g, \"\");\n modifiedVS = modifiedVS.replace(/attribute\\s+vec3\\s+bitangent;/g, \"\");\n modifiedVS = ShaderSource.replaceMain(modifiedVS, \"czm_non_compressed_main\");\n const compressedMain =\n `${\"void main() \\n\" + \"{ \\n\"}${decode} czm_non_compressed_main(); \\n` +\n `}`;\n\n return [attributeDecl, globalDecl, modifiedVS, compressedMain].join(\"\\n\");\n}\n\nfunction depthClampVS(vertexShaderSource) {\n let modifiedVS = ShaderSource.replaceMain(\n vertexShaderSource,\n \"czm_non_depth_clamp_main\"\n );\n modifiedVS +=\n \"void main() {\\n\" +\n \" czm_non_depth_clamp_main();\\n\" +\n \" gl_Position = czm_depthClamp(gl_Position);\" +\n \"}\\n\";\n return modifiedVS;\n}\n\nfunction depthClampFS(fragmentShaderSource) {\n let modifiedFS = ShaderSource.replaceMain(\n fragmentShaderSource,\n \"czm_non_depth_clamp_main\"\n );\n modifiedFS +=\n \"void main() {\\n\" +\n \" czm_non_depth_clamp_main();\\n\" +\n \"#if defined(GL_EXT_frag_depth)\\n\" +\n \" #if defined(LOG_DEPTH)\\n\" +\n \" czm_writeLogDepth();\\n\" +\n \" #else\\n\" +\n \" czm_writeDepthClamp();\\n\" +\n \" #endif\\n\" +\n \"#endif\\n\" +\n \"}\\n\";\n modifiedFS = `${\n \"#ifdef GL_EXT_frag_depth\\n\" +\n \"#extension GL_EXT_frag_depth : enable\\n\" +\n \"#endif\\n\"\n }${modifiedFS}`;\n return modifiedFS;\n}\n\nfunction validateShaderMatching(shaderProgram, attributeLocations) {\n // For a VAO and shader program to be compatible, the VAO must have\n // all active attribute in the shader program. The VAO may have\n // extra attributes with the only concern being a potential\n // performance hit due to extra memory bandwidth and cache pollution.\n // The shader source could have extra attributes that are not used,\n // but there is no guarantee they will be optimized out.\n //\n // Here, we validate that the VAO has all attributes required\n // to match the shader program.\n const shaderAttributes = shaderProgram.vertexAttributes;\n\n}\n\nfunction getUniformFunction(uniforms, name) {\n return function () {\n return uniforms[name];\n };\n}\n\nconst numberOfCreationWorkers = Math.max(\n FeatureDetection.hardwareConcurrency - 1,\n 1\n);\nlet createGeometryTaskProcessors;\nconst combineGeometryTaskProcessor = new TaskProcessor(\"combineGeometry\");\n\nfunction loadAsynchronous(primitive, frameState) {\n let instances;\n let geometry;\n let i;\n let j;\n\n const instanceIds = primitive._instanceIds;\n\n if (primitive._state === PrimitiveState.READY) {\n instances = Array.isArray(primitive.geometryInstances)\n ? primitive.geometryInstances\n : [primitive.geometryInstances];\n const length = (primitive._numberOfInstances = instances.length);\n\n const promises = [];\n let subTasks = [];\n for (i = 0; i < length; ++i) {\n geometry = instances[i].geometry;\n instanceIds.push(instances[i].id);\n\n subTasks.push({\n moduleName: geometry._workerName,\n geometry: geometry,\n });\n }\n\n if (!defined(createGeometryTaskProcessors)) {\n createGeometryTaskProcessors = new Array(numberOfCreationWorkers);\n for (i = 0; i < numberOfCreationWorkers; i++) {\n createGeometryTaskProcessors[i] = new TaskProcessor(\"createGeometry\");\n }\n }\n\n let subTask;\n subTasks = subdivideArray(subTasks, numberOfCreationWorkers);\n\n for (i = 0; i < subTasks.length; i++) {\n let packedLength = 0;\n const workerSubTasks = subTasks[i];\n const workerSubTasksLength = workerSubTasks.length;\n for (j = 0; j < workerSubTasksLength; ++j) {\n subTask = workerSubTasks[j];\n geometry = subTask.geometry;\n if (defined(geometry.constructor.pack)) {\n subTask.offset = packedLength;\n packedLength += defaultValue(\n geometry.constructor.packedLength,\n geometry.packedLength\n );\n }\n }\n\n let subTaskTransferableObjects;\n\n if (packedLength > 0) {\n const array = new Float64Array(packedLength);\n subTaskTransferableObjects = [array.buffer];\n\n for (j = 0; j < workerSubTasksLength; ++j) {\n subTask = workerSubTasks[j];\n geometry = subTask.geometry;\n if (defined(geometry.constructor.pack)) {\n geometry.constructor.pack(geometry, array, subTask.offset);\n subTask.geometry = array;\n }\n }\n }\n\n promises.push(\n createGeometryTaskProcessors[i].scheduleTask(\n {\n subTasks: subTasks[i],\n },\n subTaskTransferableObjects\n )\n );\n }\n\n primitive._state = PrimitiveState.CREATING;\n\n Promise.all(promises)\n .then(function (results) {\n primitive._createGeometryResults = results;\n primitive._state = PrimitiveState.CREATED;\n })\n .catch(function (error) {\n setReady(primitive, frameState, PrimitiveState.FAILED, error);\n });\n } else if (primitive._state === PrimitiveState.CREATED) {\n const transferableObjects = [];\n instances = Array.isArray(primitive.geometryInstances)\n ? primitive.geometryInstances\n : [primitive.geometryInstances];\n\n const scene3DOnly = frameState.scene3DOnly;\n const projection = frameState.mapProjection;\n\n const promise = combineGeometryTaskProcessor.scheduleTask(\n PrimitivePipeline.packCombineGeometryParameters(\n {\n createGeometryResults: primitive._createGeometryResults,\n instances: instances,\n ellipsoid: projection.ellipsoid,\n projection: projection,\n elementIndexUintSupported: frameState.context.elementIndexUint,\n scene3DOnly: scene3DOnly,\n vertexCacheOptimize: primitive.vertexCacheOptimize,\n compressVertices: primitive.compressVertices,\n modelMatrix: primitive.modelMatrix,\n createPickOffsets: primitive._createPickOffsets,\n },\n transferableObjects\n ),\n transferableObjects\n );\n\n primitive._createGeometryResults = undefined;\n primitive._state = PrimitiveState.COMBINING;\n\n Promise.resolve(promise)\n .then(function (packedResult) {\n const result = PrimitivePipeline.unpackCombineGeometryResults(\n packedResult\n );\n primitive._geometries = result.geometries;\n primitive._attributeLocations = result.attributeLocations;\n primitive.modelMatrix = Matrix4.clone(\n result.modelMatrix,\n primitive.modelMatrix\n );\n primitive._pickOffsets = result.pickOffsets;\n primitive._offsetInstanceExtend = result.offsetInstanceExtend;\n primitive._instanceBoundingSpheres = result.boundingSpheres;\n primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;\n\n if (\n defined(primitive._geometries) &&\n primitive._geometries.length > 0\n ) {\n primitive._recomputeBoundingSpheres = true;\n primitive._state = PrimitiveState.COMBINED;\n } else {\n setReady(primitive, frameState, PrimitiveState.FAILED, undefined);\n }\n })\n .catch(function (error) {\n setReady(primitive, frameState, PrimitiveState.FAILED, error);\n });\n }\n}\n\nfunction loadSynchronous(primitive, frameState) {\n const instances = Array.isArray(primitive.geometryInstances)\n ? primitive.geometryInstances\n : [primitive.geometryInstances];\n const length = (primitive._numberOfInstances = instances.length);\n const clonedInstances = new Array(length);\n const instanceIds = primitive._instanceIds;\n\n let instance;\n let i;\n\n let geometryIndex = 0;\n for (i = 0; i < length; i++) {\n instance = instances[i];\n const geometry = instance.geometry;\n\n let createdGeometry;\n if (defined(geometry.attributes) && defined(geometry.primitiveType)) {\n createdGeometry = cloneGeometry(geometry);\n } else {\n createdGeometry = geometry.constructor.createGeometry(geometry);\n }\n\n clonedInstances[geometryIndex++] = cloneInstance(instance, createdGeometry);\n instanceIds.push(instance.id);\n }\n\n clonedInstances.length = geometryIndex;\n\n const scene3DOnly = frameState.scene3DOnly;\n const projection = frameState.mapProjection;\n\n const result = PrimitivePipeline.combineGeometry({\n instances: clonedInstances,\n ellipsoid: projection.ellipsoid,\n projection: projection,\n elementIndexUintSupported: frameState.context.elementIndexUint,\n scene3DOnly: scene3DOnly,\n vertexCacheOptimize: primitive.vertexCacheOptimize,\n compressVertices: primitive.compressVertices,\n modelMatrix: primitive.modelMatrix,\n createPickOffsets: primitive._createPickOffsets,\n });\n\n primitive._geometries = result.geometries;\n primitive._attributeLocations = result.attributeLocations;\n primitive.modelMatrix = Matrix4.clone(\n result.modelMatrix,\n primitive.modelMatrix\n );\n primitive._pickOffsets = result.pickOffsets;\n primitive._offsetInstanceExtend = result.offsetInstanceExtend;\n primitive._instanceBoundingSpheres = result.boundingSpheres;\n primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;\n\n if (defined(primitive._geometries) && primitive._geometries.length > 0) {\n primitive._recomputeBoundingSpheres = true;\n primitive._state = PrimitiveState.COMBINED;\n } else {\n setReady(primitive, frameState, PrimitiveState.FAILED, undefined);\n }\n}\n\nfunction recomputeBoundingSpheres(primitive, frameState) {\n const offsetIndex = primitive._batchTableAttributeIndices.offset;\n if (!primitive._recomputeBoundingSpheres || !defined(offsetIndex)) {\n primitive._recomputeBoundingSpheres = false;\n return;\n }\n\n let i;\n const offsetInstanceExtend = primitive._offsetInstanceExtend;\n const boundingSpheres = primitive._instanceBoundingSpheres;\n const length = boundingSpheres.length;\n let newBoundingSpheres = primitive._tempBoundingSpheres;\n if (!defined(newBoundingSpheres)) {\n newBoundingSpheres = new Array(length);\n for (i = 0; i < length; i++) {\n newBoundingSpheres[i] = new BoundingSphere();\n }\n primitive._tempBoundingSpheres = newBoundingSpheres;\n }\n for (i = 0; i < length; ++i) {\n let newBS = newBoundingSpheres[i];\n const offset = primitive._batchTable.getBatchedAttribute(\n i,\n offsetIndex,\n new Cartesian3()\n );\n newBS = boundingSpheres[i].clone(newBS);\n transformBoundingSphere(newBS, offset, offsetInstanceExtend[i]);\n }\n const combinedBS = [];\n const combinedWestBS = [];\n const combinedEastBS = [];\n\n for (i = 0; i < length; ++i) {\n const bs = newBoundingSpheres[i];\n\n const minX = bs.center.x - bs.radius;\n if (\n minX > 0 ||\n BoundingSphere.intersectPlane(bs, Plane.ORIGIN_ZX_PLANE) !==\n Intersect.INTERSECTING\n ) {\n combinedBS.push(bs);\n } else {\n combinedWestBS.push(bs);\n combinedEastBS.push(bs);\n }\n }\n\n let resultBS1 = combinedBS[0];\n let resultBS2 = combinedEastBS[0];\n let resultBS3 = combinedWestBS[0];\n\n for (i = 1; i < combinedBS.length; i++) {\n resultBS1 = BoundingSphere.union(resultBS1, combinedBS[i]);\n }\n for (i = 1; i < combinedEastBS.length; i++) {\n resultBS2 = BoundingSphere.union(resultBS2, combinedEastBS[i]);\n }\n for (i = 1; i < combinedWestBS.length; i++) {\n resultBS3 = BoundingSphere.union(resultBS3, combinedWestBS[i]);\n }\n const result = [];\n if (defined(resultBS1)) {\n result.push(resultBS1);\n }\n if (defined(resultBS2)) {\n result.push(resultBS2);\n }\n if (defined(resultBS3)) {\n result.push(resultBS3);\n }\n\n for (i = 0; i < result.length; i++) {\n const boundingSphere = result[i].clone(primitive._boundingSpheres[i]);\n primitive._boundingSpheres[i] = boundingSphere;\n primitive._boundingSphereCV[i] = BoundingSphere.projectTo2D(\n boundingSphere,\n frameState.mapProjection,\n primitive._boundingSphereCV[i]\n );\n }\n\n Primitive._updateBoundingVolumes(\n primitive,\n frameState,\n primitive.modelMatrix,\n true\n );\n primitive._recomputeBoundingSpheres = false;\n}\n\nconst scratchBoundingSphereCenterEncoded = new EncodedCartesian3();\nconst scratchBoundingSphereCartographic = new Cartographic();\nconst scratchBoundingSphereCenter2D = new Cartesian3();\nconst scratchBoundingSphere = new BoundingSphere();\n\nfunction updateBatchTableBoundingSpheres(primitive, frameState) {\n const hasDistanceDisplayCondition = defined(\n primitive._batchTableAttributeIndices.distanceDisplayCondition\n );\n if (\n !hasDistanceDisplayCondition ||\n primitive._batchTableBoundingSpheresUpdated\n ) {\n return;\n }\n\n const indices = primitive._batchTableBoundingSphereAttributeIndices;\n const center3DHighIndex = indices.center3DHigh;\n const center3DLowIndex = indices.center3DLow;\n const center2DHighIndex = indices.center2DHigh;\n const center2DLowIndex = indices.center2DLow;\n const radiusIndex = indices.radius;\n\n const projection = frameState.mapProjection;\n const ellipsoid = projection.ellipsoid;\n\n const batchTable = primitive._batchTable;\n const boundingSpheres = primitive._instanceBoundingSpheres;\n const length = boundingSpheres.length;\n\n for (let i = 0; i < length; ++i) {\n let boundingSphere = boundingSpheres[i];\n if (!defined(boundingSphere)) {\n continue;\n }\n\n const modelMatrix = primitive.modelMatrix;\n if (defined(modelMatrix)) {\n boundingSphere = BoundingSphere.transform(\n boundingSphere,\n modelMatrix,\n scratchBoundingSphere\n );\n }\n\n const center = boundingSphere.center;\n const radius = boundingSphere.radius;\n\n let encodedCenter = EncodedCartesian3.fromCartesian(\n center,\n scratchBoundingSphereCenterEncoded\n );\n batchTable.setBatchedAttribute(i, center3DHighIndex, encodedCenter.high);\n batchTable.setBatchedAttribute(i, center3DLowIndex, encodedCenter.low);\n\n if (!frameState.scene3DOnly) {\n const cartographic = ellipsoid.cartesianToCartographic(\n center,\n scratchBoundingSphereCartographic\n );\n const center2D = projection.project(\n cartographic,\n scratchBoundingSphereCenter2D\n );\n encodedCenter = EncodedCartesian3.fromCartesian(\n center2D,\n scratchBoundingSphereCenterEncoded\n );\n batchTable.setBatchedAttribute(i, center2DHighIndex, encodedCenter.high);\n batchTable.setBatchedAttribute(i, center2DLowIndex, encodedCenter.low);\n }\n\n batchTable.setBatchedAttribute(i, radiusIndex, radius);\n }\n\n primitive._batchTableBoundingSpheresUpdated = true;\n}\n\nconst offsetScratchCartesian = new Cartesian3();\nconst offsetCenterScratch = new Cartesian3();\nfunction updateBatchTableOffsets(primitive, frameState) {\n const hasOffset = defined(primitive._batchTableAttributeIndices.offset);\n if (\n !hasOffset ||\n primitive._batchTableOffsetsUpdated ||\n frameState.scene3DOnly\n ) {\n return;\n }\n\n const index2D = primitive._batchTableOffsetAttribute2DIndex;\n\n const projection = frameState.mapProjection;\n const ellipsoid = projection.ellipsoid;\n\n const batchTable = primitive._batchTable;\n const boundingSpheres = primitive._instanceBoundingSpheres;\n const length = boundingSpheres.length;\n\n for (let i = 0; i < length; ++i) {\n let boundingSphere = boundingSpheres[i];\n if (!defined(boundingSphere)) {\n continue;\n }\n const offset = batchTable.getBatchedAttribute(\n i,\n primitive._batchTableAttributeIndices.offset\n );\n if (Cartesian3.equals(offset, Cartesian3.ZERO)) {\n batchTable.setBatchedAttribute(i, index2D, Cartesian3.ZERO);\n continue;\n }\n\n const modelMatrix = primitive.modelMatrix;\n if (defined(modelMatrix)) {\n boundingSphere = BoundingSphere.transform(\n boundingSphere,\n modelMatrix,\n scratchBoundingSphere\n );\n }\n\n let center = boundingSphere.center;\n center = ellipsoid.scaleToGeodeticSurface(center, offsetCenterScratch);\n let cartographic = ellipsoid.cartesianToCartographic(\n center,\n scratchBoundingSphereCartographic\n );\n const center2D = projection.project(\n cartographic,\n scratchBoundingSphereCenter2D\n );\n\n const newPoint = Cartesian3.add(offset, center, offsetScratchCartesian);\n cartographic = ellipsoid.cartesianToCartographic(newPoint, cartographic);\n\n const newPointProjected = projection.project(\n cartographic,\n offsetScratchCartesian\n );\n\n const newVector = Cartesian3.subtract(\n newPointProjected,\n center2D,\n offsetScratchCartesian\n );\n\n const x = newVector.x;\n newVector.x = newVector.z;\n newVector.z = newVector.y;\n newVector.y = x;\n\n batchTable.setBatchedAttribute(i, index2D, newVector);\n }\n\n primitive._batchTableOffsetsUpdated = true;\n}\n\nfunction createVertexArray(primitive, frameState) {\n const attributeLocations = primitive._attributeLocations;\n const geometries = primitive._geometries;\n const scene3DOnly = frameState.scene3DOnly;\n const context = frameState.context;\n\n const va = [];\n const length = geometries.length;\n for (let i = 0; i < length; ++i) {\n const geometry = geometries[i];\n\n va.push(\n VertexArray.fromGeometry({\n context: context,\n geometry: geometry,\n attributeLocations: attributeLocations,\n bufferUsage: BufferUsage.STATIC_DRAW,\n interleave: primitive._interleave,\n })\n );\n\n if (defined(primitive._createBoundingVolumeFunction)) {\n primitive._createBoundingVolumeFunction(frameState, geometry);\n } else {\n primitive._boundingSpheres.push(\n BoundingSphere.clone(geometry.boundingSphere)\n );\n primitive._boundingSphereWC.push(new BoundingSphere());\n\n if (!scene3DOnly) {\n const center = geometry.boundingSphereCV.center;\n const x = center.x;\n const y = center.y;\n const z = center.z;\n center.x = z;\n center.y = x;\n center.z = y;\n\n primitive._boundingSphereCV.push(\n BoundingSphere.clone(geometry.boundingSphereCV)\n );\n primitive._boundingSphere2D.push(new BoundingSphere());\n primitive._boundingSphereMorph.push(new BoundingSphere());\n }\n }\n }\n\n primitive._va = va;\n primitive._primitiveType = geometries[0].primitiveType;\n\n if (primitive.releaseGeometryInstances) {\n primitive.geometryInstances = undefined;\n }\n\n primitive._geometries = undefined;\n setReady(primitive, frameState, PrimitiveState.COMPLETE, undefined);\n}\n\nfunction createRenderStates(primitive, context, appearance, twoPasses) {\n let renderState = appearance.getRenderState();\n let rs;\n\n if (twoPasses) {\n rs = clone(renderState, false);\n rs.cull = {\n enabled: true,\n face: CullFace.BACK,\n };\n primitive._frontFaceRS = RenderState.fromCache(rs);\n\n rs.cull.face = CullFace.FRONT;\n primitive._backFaceRS = RenderState.fromCache(rs);\n } else {\n primitive._frontFaceRS = RenderState.fromCache(renderState);\n primitive._backFaceRS = primitive._frontFaceRS;\n }\n\n rs = clone(renderState, false);\n if (defined(primitive._depthFailAppearance)) {\n rs.depthTest.enabled = false;\n }\n\n if (defined(primitive._depthFailAppearance)) {\n renderState = primitive._depthFailAppearance.getRenderState();\n rs = clone(renderState, false);\n rs.depthTest.func = DepthFunction.GREATER;\n if (twoPasses) {\n rs.cull = {\n enabled: true,\n face: CullFace.BACK,\n };\n primitive._frontFaceDepthFailRS = RenderState.fromCache(rs);\n\n rs.cull.face = CullFace.FRONT;\n primitive._backFaceDepthFailRS = RenderState.fromCache(rs);\n } else {\n primitive._frontFaceDepthFailRS = RenderState.fromCache(rs);\n primitive._backFaceDepthFailRS = primitive._frontFaceRS;\n }\n }\n}\n\nfunction createShaderProgram(primitive, frameState, appearance) {\n const context = frameState.context;\n\n const attributeLocations = primitive._attributeLocations;\n\n let vs = primitive._batchTable.getVertexShaderCallback()(\n appearance.vertexShaderSource\n );\n vs = Primitive._appendOffsetToShader(primitive, vs);\n vs = Primitive._appendShowToShader(primitive, vs);\n vs = Primitive._appendDistanceDisplayConditionToShader(\n primitive,\n vs,\n frameState.scene3DOnly\n );\n vs = appendPickToVertexShader(vs);\n vs = Primitive._updateColorAttribute(primitive, vs, false);\n vs = modifyForEncodedNormals(primitive, vs);\n vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);\n let fs = appearance.getFragmentShaderSource();\n fs = appendPickToFragmentShader(fs);\n\n primitive._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: primitive._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n validateShaderMatching(primitive._sp, attributeLocations);\n\n if (defined(primitive._depthFailAppearance)) {\n vs = primitive._batchTable.getVertexShaderCallback()(\n primitive._depthFailAppearance.vertexShaderSource\n );\n vs = Primitive._appendShowToShader(primitive, vs);\n vs = Primitive._appendDistanceDisplayConditionToShader(\n primitive,\n vs,\n frameState.scene3DOnly\n );\n vs = appendPickToVertexShader(vs);\n vs = Primitive._updateColorAttribute(primitive, vs, true);\n vs = modifyForEncodedNormals(primitive, vs);\n vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);\n vs = depthClampVS(vs);\n\n fs = primitive._depthFailAppearance.getFragmentShaderSource();\n fs = appendPickToFragmentShader(fs);\n fs = depthClampFS(fs);\n\n primitive._spDepthFail = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: primitive._spDepthFail,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n validateShaderMatching(primitive._spDepthFail, attributeLocations);\n }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction getUniforms(primitive, appearance, material, frameState) {\n // Create uniform map by combining uniforms from the appearance and material if either have uniforms.\n const materialUniformMap = defined(material) ? material._uniforms : undefined;\n const appearanceUniformMap = {};\n const appearanceUniforms = appearance.uniforms;\n if (defined(appearanceUniforms)) {\n // Convert to uniform map of functions for the renderer\n for (const name in appearanceUniforms) {\n if (appearanceUniforms.hasOwnProperty(name)) {\n appearanceUniformMap[name] = getUniformFunction(\n appearanceUniforms,\n name\n );\n }\n }\n }\n let uniforms = combine(appearanceUniformMap, materialUniformMap);\n uniforms = primitive._batchTable.getUniformMapCallback()(uniforms);\n\n if (defined(primitive.rtcCenter)) {\n uniforms.u_modifiedModelView = function () {\n const viewMatrix = frameState.context.uniformState.view;\n Matrix4.multiply(\n viewMatrix,\n primitive._modelMatrix,\n modifiedModelViewScratch\n );\n Matrix4.multiplyByPoint(\n modifiedModelViewScratch,\n primitive.rtcCenter,\n rtcScratch\n );\n Matrix4.setTranslation(\n modifiedModelViewScratch,\n rtcScratch,\n modifiedModelViewScratch\n );\n return modifiedModelViewScratch;\n };\n }\n\n return uniforms;\n}\n\nfunction createCommands(\n primitive,\n appearance,\n material,\n translucent,\n twoPasses,\n colorCommands,\n pickCommands,\n frameState\n) {\n const uniforms = getUniforms(primitive, appearance, material, frameState);\n\n let depthFailUniforms;\n if (defined(primitive._depthFailAppearance)) {\n depthFailUniforms = getUniforms(\n primitive,\n primitive._depthFailAppearance,\n primitive._depthFailAppearance.material,\n frameState\n );\n }\n\n const pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n let multiplier = twoPasses ? 2 : 1;\n multiplier *= defined(primitive._depthFailAppearance) ? 2 : 1;\n colorCommands.length = primitive._va.length * multiplier;\n\n const length = colorCommands.length;\n let vaIndex = 0;\n for (let i = 0; i < length; ++i) {\n let colorCommand;\n\n if (twoPasses) {\n colorCommand = colorCommands[i];\n if (!defined(colorCommand)) {\n colorCommand = colorCommands[i] = new DrawCommand({\n owner: primitive,\n primitiveType: primitive._primitiveType,\n });\n }\n colorCommand.vertexArray = primitive._va[vaIndex];\n colorCommand.renderState = primitive._backFaceRS;\n colorCommand.shaderProgram = primitive._sp;\n colorCommand.uniformMap = uniforms;\n colorCommand.pass = pass;\n\n ++i;\n }\n\n colorCommand = colorCommands[i];\n if (!defined(colorCommand)) {\n colorCommand = colorCommands[i] = new DrawCommand({\n owner: primitive,\n primitiveType: primitive._primitiveType,\n });\n }\n colorCommand.vertexArray = primitive._va[vaIndex];\n colorCommand.renderState = primitive._frontFaceRS;\n colorCommand.shaderProgram = primitive._sp;\n colorCommand.uniformMap = uniforms;\n colorCommand.pass = pass;\n\n if (defined(primitive._depthFailAppearance)) {\n if (twoPasses) {\n ++i;\n\n colorCommand = colorCommands[i];\n if (!defined(colorCommand)) {\n colorCommand = colorCommands[i] = new DrawCommand({\n owner: primitive,\n primitiveType: primitive._primitiveType,\n });\n }\n colorCommand.vertexArray = primitive._va[vaIndex];\n colorCommand.renderState = primitive._backFaceDepthFailRS;\n colorCommand.shaderProgram = primitive._spDepthFail;\n colorCommand.uniformMap = depthFailUniforms;\n colorCommand.pass = pass;\n }\n\n ++i;\n\n colorCommand = colorCommands[i];\n if (!defined(colorCommand)) {\n colorCommand = colorCommands[i] = new DrawCommand({\n owner: primitive,\n primitiveType: primitive._primitiveType,\n });\n }\n colorCommand.vertexArray = primitive._va[vaIndex];\n colorCommand.renderState = primitive._frontFaceDepthFailRS;\n colorCommand.shaderProgram = primitive._spDepthFail;\n colorCommand.uniformMap = depthFailUniforms;\n colorCommand.pass = pass;\n }\n\n ++vaIndex;\n }\n}\n\nPrimitive._updateBoundingVolumes = function (\n primitive,\n frameState,\n modelMatrix,\n forceUpdate\n) {\n let i;\n let length;\n let boundingSphere;\n\n if (forceUpdate || !Matrix4.equals(modelMatrix, primitive._modelMatrix)) {\n Matrix4.clone(modelMatrix, primitive._modelMatrix);\n length = primitive._boundingSpheres.length;\n for (i = 0; i < length; ++i) {\n boundingSphere = primitive._boundingSpheres[i];\n if (defined(boundingSphere)) {\n primitive._boundingSphereWC[i] = BoundingSphere.transform(\n boundingSphere,\n modelMatrix,\n primitive._boundingSphereWC[i]\n );\n if (!frameState.scene3DOnly) {\n primitive._boundingSphere2D[i] = BoundingSphere.clone(\n primitive._boundingSphereCV[i],\n primitive._boundingSphere2D[i]\n );\n primitive._boundingSphere2D[i].center.x = 0.0;\n primitive._boundingSphereMorph[i] = BoundingSphere.union(\n primitive._boundingSphereWC[i],\n primitive._boundingSphereCV[i]\n );\n }\n }\n }\n }\n\n // Update bounding volumes for primitives that are sized in pixels.\n // The pixel size in meters varies based on the distance from the camera.\n const pixelSize = primitive.appearance.pixelSize;\n if (defined(pixelSize)) {\n length = primitive._boundingSpheres.length;\n for (i = 0; i < length; ++i) {\n boundingSphere = primitive._boundingSpheres[i];\n const boundingSphereWC = primitive._boundingSphereWC[i];\n const pixelSizeInMeters = frameState.camera.getPixelSize(\n boundingSphere,\n frameState.context.drawingBufferWidth,\n frameState.context.drawingBufferHeight\n );\n const sizeInMeters = pixelSizeInMeters * pixelSize;\n boundingSphereWC.radius = boundingSphere.radius + sizeInMeters;\n }\n }\n};\n\nfunction updateAndQueueCommands(\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n) {\n Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix);\n\n let boundingSpheres;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingSpheres = primitive._boundingSphereWC;\n } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n boundingSpheres = primitive._boundingSphereCV;\n } else if (\n frameState.mode === SceneMode.SCENE2D &&\n defined(primitive._boundingSphere2D)\n ) {\n boundingSpheres = primitive._boundingSphere2D;\n } else if (defined(primitive._boundingSphereMorph)) {\n boundingSpheres = primitive._boundingSphereMorph;\n }\n\n const commandList = frameState.commandList;\n const passes = frameState.passes;\n if (passes.render || passes.pick) {\n const allowPicking = primitive.allowPicking;\n const castShadows = ShadowMode.castShadows(primitive.shadows);\n const receiveShadows = ShadowMode.receiveShadows(primitive.shadows);\n const colorLength = colorCommands.length;\n\n let factor = twoPasses ? 2 : 1;\n factor *= defined(primitive._depthFailAppearance) ? 2 : 1;\n\n for (let j = 0; j < colorLength; ++j) {\n const sphereIndex = Math.floor(j / factor);\n const colorCommand = colorCommands[j];\n colorCommand.modelMatrix = modelMatrix;\n colorCommand.boundingVolume = boundingSpheres[sphereIndex];\n colorCommand.cull = cull;\n colorCommand.debugShowBoundingVolume = debugShowBoundingVolume;\n colorCommand.castShadows = castShadows;\n colorCommand.receiveShadows = receiveShadows;\n\n if (allowPicking) {\n colorCommand.pickId = \"v_pickColor\";\n } else {\n colorCommand.pickId = undefined;\n }\n\n commandList.push(colorCommand);\n }\n }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n * @exception {DeveloperError} Primitive.modelMatrix is only supported in 3D mode.\n * @exception {RuntimeError} 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.\n */\nPrimitive.prototype.update = function (frameState) {\n if (\n (!defined(this.geometryInstances) && this._va.length === 0) ||\n (defined(this.geometryInstances) &&\n Array.isArray(this.geometryInstances) &&\n this.geometryInstances.length === 0) ||\n !defined(this.appearance) ||\n (frameState.mode !== SceneMode.SCENE3D && frameState.scene3DOnly) ||\n (!frameState.passes.render && !frameState.passes.pick)\n ) {\n return;\n }\n\n if (defined(this._error)) {\n throw this._error;\n }\n\n if (this._state === PrimitiveState.FAILED) {\n return;\n }\n\n const context = frameState.context;\n if (!defined(this._batchTable)) {\n createBatchTable(this, context);\n }\n if (this._batchTable.attributes.length > 0) {\n if (ContextLimits.maximumVertexTextureImageUnits === 0) {\n throw new RuntimeError(\n \"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.\"\n );\n }\n this._batchTable.update(frameState);\n }\n\n if (\n this._state !== PrimitiveState.COMPLETE &&\n this._state !== PrimitiveState.COMBINED\n ) {\n if (this.asynchronous) {\n loadAsynchronous(this, frameState);\n } else {\n loadSynchronous(this, frameState);\n }\n }\n\n if (this._state === PrimitiveState.COMBINED) {\n updateBatchTableBoundingSpheres(this, frameState);\n updateBatchTableOffsets(this, frameState);\n createVertexArray(this, frameState);\n }\n\n if (!this.show || this._state !== PrimitiveState.COMPLETE) {\n return;\n }\n\n if (!this._batchTableOffsetsUpdated) {\n updateBatchTableOffsets(this, frameState);\n }\n if (this._recomputeBoundingSpheres) {\n recomputeBoundingSpheres(this, frameState);\n }\n\n // Create or recreate render state and shader program if appearance/material changed\n const appearance = this.appearance;\n const material = appearance.material;\n let createRS = false;\n let createSP = false;\n\n if (this._appearance !== appearance) {\n this._appearance = appearance;\n this._material = material;\n createRS = true;\n createSP = true;\n } else if (this._material !== material) {\n this._material = material;\n createSP = true;\n }\n\n const depthFailAppearance = this.depthFailAppearance;\n const depthFailMaterial = defined(depthFailAppearance)\n ? depthFailAppearance.material\n : undefined;\n\n if (this._depthFailAppearance !== depthFailAppearance) {\n this._depthFailAppearance = depthFailAppearance;\n this._depthFailMaterial = depthFailMaterial;\n createRS = true;\n createSP = true;\n } else if (this._depthFailMaterial !== depthFailMaterial) {\n this._depthFailMaterial = depthFailMaterial;\n createSP = true;\n }\n\n const translucent = this._appearance.isTranslucent();\n if (this._translucent !== translucent) {\n this._translucent = translucent;\n createRS = true;\n }\n\n if (defined(this._material)) {\n this._material.update(context);\n }\n\n const twoPasses = appearance.closed && translucent;\n\n if (createRS) {\n const rsFunc = defaultValue(\n this._createRenderStatesFunction,\n createRenderStates\n );\n rsFunc(this, context, appearance, twoPasses);\n }\n\n if (createSP) {\n const spFunc = defaultValue(\n this._createShaderProgramFunction,\n createShaderProgram\n );\n spFunc(this, frameState, appearance);\n }\n\n if (createRS || createSP) {\n const commandFunc = defaultValue(\n this._createCommandsFunction,\n createCommands\n );\n commandFunc(\n this,\n appearance,\n material,\n translucent,\n twoPasses,\n this._colorCommands,\n this._pickCommands,\n frameState\n );\n }\n\n const updateAndQueueCommandsFunc = defaultValue(\n this._updateAndQueueCommandsFunction,\n updateAndQueueCommands\n );\n updateAndQueueCommandsFunc(\n this,\n frameState,\n this._colorCommands,\n this._pickCommands,\n this.modelMatrix,\n this.cull,\n this.debugShowBoundingVolume,\n twoPasses\n );\n};\n\nconst offsetBoundingSphereScratch1 = new BoundingSphere();\nconst offsetBoundingSphereScratch2 = new BoundingSphere();\nfunction transformBoundingSphere(boundingSphere, offset, offsetAttribute) {\n if (offsetAttribute === GeometryOffsetAttribute.TOP) {\n const origBS = BoundingSphere.clone(\n boundingSphere,\n offsetBoundingSphereScratch1\n );\n const offsetBS = BoundingSphere.clone(\n boundingSphere,\n offsetBoundingSphereScratch2\n );\n offsetBS.center = Cartesian3.add(offsetBS.center, offset, offsetBS.center);\n boundingSphere = BoundingSphere.union(origBS, offsetBS, boundingSphere);\n } else if (offsetAttribute === GeometryOffsetAttribute.ALL) {\n boundingSphere.center = Cartesian3.add(\n boundingSphere.center,\n offset,\n boundingSphere.center\n );\n }\n\n return boundingSphere;\n}\n\nfunction createGetFunction(batchTable, instanceIndex, attributeIndex) {\n return function () {\n const attributeValue = batchTable.getBatchedAttribute(\n instanceIndex,\n attributeIndex\n );\n const attribute = batchTable.attributes[attributeIndex];\n const componentsPerAttribute = attribute.componentsPerAttribute;\n const value = ComponentDatatype.createTypedArray(\n attribute.componentDatatype,\n componentsPerAttribute\n );\n if (defined(attributeValue.constructor.pack)) {\n attributeValue.constructor.pack(attributeValue, value, 0);\n } else {\n value[0] = attributeValue;\n }\n return value;\n };\n}\n\nfunction createSetFunction(\n batchTable,\n instanceIndex,\n attributeIndex,\n primitive,\n name\n) {\n return function (value) {\nconst attributeValue = getAttributeValue(value);\n batchTable.setBatchedAttribute(\n instanceIndex,\n attributeIndex,\n attributeValue\n );\n if (name === \"offset\") {\n primitive._recomputeBoundingSpheres = true;\n primitive._batchTableOffsetsUpdated = false;\n }\n };\n}\n\nconst offsetScratch = new Cartesian3();\n\nfunction createBoundingSphereProperties(primitive, properties, index) {\n properties.boundingSphere = {\n get: function () {\n let boundingSphere = primitive._instanceBoundingSpheres[index];\n if (defined(boundingSphere)) {\n boundingSphere = boundingSphere.clone();\n const modelMatrix = primitive.modelMatrix;\n const offset = properties.offset;\n if (defined(offset)) {\n transformBoundingSphere(\n boundingSphere,\n Cartesian3.fromArray(offset.get(), 0, offsetScratch),\n primitive._offsetInstanceExtend[index]\n );\n }\n if (defined(modelMatrix)) {\n boundingSphere = BoundingSphere.transform(\n boundingSphere,\n modelMatrix\n );\n }\n }\n\n return boundingSphere;\n },\n };\n properties.boundingSphereCV = {\n get: function () {\n return primitive._instanceBoundingSpheresCV[index];\n },\n };\n}\n\nfunction createPickIdProperty(primitive, properties, index) {\n properties.pickId = {\n get: function () {\n return primitive._pickIds[index];\n },\n };\n}\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {Object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);\n * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);\n */\nPrimitive.prototype.getGeometryInstanceAttributes = function (id) {\n let index = -1;\n const lastIndex = this._lastPerInstanceAttributeIndex;\n const ids = this._instanceIds;\n const length = ids.length;\n for (let i = 0; i < length; ++i) {\n const curIndex = (lastIndex + i) % length;\n if (id === ids[curIndex]) {\n index = curIndex;\n break;\n }\n }\n\n if (index === -1) {\n return undefined;\n }\n\n let attributes = this._perInstanceAttributeCache[index];\n if (defined(attributes)) {\n return attributes;\n }\n\n const batchTable = this._batchTable;\n const perInstanceAttributeIndices = this._batchTableAttributeIndices;\n attributes = {};\n const properties = {};\n\n for (const name in perInstanceAttributeIndices) {\n if (perInstanceAttributeIndices.hasOwnProperty(name)) {\n const attributeIndex = perInstanceAttributeIndices[name];\n properties[name] = {\n get: createGetFunction(batchTable, index, attributeIndex),\n set: createSetFunction(batchTable, index, attributeIndex, this, name),\n };\n }\n }\n\n createBoundingSphereProperties(this, properties, index);\n createPickIdProperty(this, properties, index);\n Object.defineProperties(attributes, properties);\n\n this._lastPerInstanceAttributeIndex = index;\n this._perInstanceAttributeCache[index] = attributes;\n return attributes;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Primitive#destroy\n */\nPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * e = e && e.destroy();\n *\n * @see Primitive#isDestroyed\n */\nPrimitive.prototype.destroy = function () {\n let length;\n let i;\n\n this._sp = this._sp && this._sp.destroy();\n this._spDepthFail = this._spDepthFail && this._spDepthFail.destroy();\n\n const va = this._va;\n length = va.length;\n for (i = 0; i < length; ++i) {\n va[i].destroy();\n }\n this._va = undefined;\n\n const pickIds = this._pickIds;\n length = pickIds.length;\n for (i = 0; i < length; ++i) {\n pickIds[i].destroy();\n }\n this._pickIds = undefined;\n\n this._batchTable = this._batchTable && this._batchTable.destroy();\n\n //These objects may be fairly large and reference other large objects (like Entities)\n //We explicitly set them to undefined here so that the memory can be freed\n //even if a reference to the destroyed Primitive has been kept around.\n this._instanceIds = undefined;\n this._perInstanceAttributeCache = undefined;\n this._attributeLocations = undefined;\n\n return destroyObject(this);\n};\n\nfunction setReady(primitive, frameState, state, error) {\n primitive._completeLoad(frameState, state, error);\n}\nexport default Primitive;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Values and type information for per-instance geometry attributes.\n *\n * @alias GeometryInstanceAttribute\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {ComponentDatatype} options.componentDatatype The datatype of each component in the attribute, e.g., individual elements in values.\n * @param {Number} options.componentsPerAttribute A number between 1 and 4 that defines the number of components in an attributes.\n * @param {Boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * @param {Number[]} options.value The value for the attribute.\n *\n * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.\n *\n *\n * @example\n * const instance = new Cesium.GeometryInstance({\n * geometry : Cesium.BoxGeometry.fromDimensions({\n * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\n * }),\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\n * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\n * id : 'box',\n * attributes : {\n * color : new Cesium.GeometryInstanceAttribute({\n * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n * componentsPerAttribute : 4,\n * normalize : true,\n * value : [255, 255, 0, 255]\n * })\n * }\n * });\n *\n * @see ColorGeometryInstanceAttribute\n * @see ShowGeometryInstanceAttribute\n * @see DistanceDisplayConditionGeometryInstanceAttribute\n */\nfunction GeometryInstanceAttribute(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The datatype of each component in the attribute, e.g., individual elements in\n * {@link GeometryInstanceAttribute#value}.\n *\n * @type ComponentDatatype\n *\n * @default undefined\n */\n this.componentDatatype = options.componentDatatype;\n\n /**\n * A number between 1 and 4 that defines the number of components in an attributes.\n * For example, a position attribute with x, y, and z components would have 3 as\n * shown in the code example.\n *\n * @type Number\n *\n * @default undefined\n *\n * @example\n * show : new Cesium.GeometryInstanceAttribute({\n * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n * componentsPerAttribute : 1,\n * normalize : true,\n * value : [1.0]\n * })\n */\n this.componentsPerAttribute = options.componentsPerAttribute;\n\n /**\n * When <code>true</code> and <code>componentDatatype</code> is an integer format,\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\n * <p>\n * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n *\n * @example\n * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;\n * attribute.componentsPerAttribute = 4;\n * attribute.normalize = true;\n * attribute.value = [\n * Cesium.Color.floatToByte(color.red),\n * Cesium.Color.floatToByte(color.green),\n * Cesium.Color.floatToByte(color.blue),\n * Cesium.Color.floatToByte(color.alpha)\n * ];\n */\n this.normalize = defaultValue(options.normalize, false);\n\n /**\n * The values for the attributes stored in a typed array. In the code example,\n * every three elements in <code>values</code> defines one attributes since\n * <code>componentsPerAttribute</code> is 3.\n *\n * @type {Number[]}\n *\n * @default undefined\n *\n * @example\n * show : new Cesium.GeometryInstanceAttribute({\n * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,\n * componentsPerAttribute : 1,\n * normalize : true,\n * value : [1.0]\n * })\n */\n this.value = options.value;\n}\nexport default GeometryInstanceAttribute;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_EXT_frag_depth\\n\\\n#extension GL_EXT_frag_depth : enable\\n\\\n#endif\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\n#ifdef SPHERICAL\\n\\\nvarying vec4 v_sphericalExtents;\\n\\\n#else // SPHERICAL\\n\\\nvarying vec2 v_inversePlaneExtents;\\n\\\nvarying vec4 v_westPlane;\\n\\\nvarying vec4 v_southPlane;\\n\\\n#endif // SPHERICAL\\n\\\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\\n\\\nvarying vec3 v_uMaxAndInverseDistance;\\n\\\nvarying vec3 v_vMaxAndInverseDistance;\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#endif\\n\\\n#ifdef NORMAL_EC\\n\\\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\\n\\\nreturn eyeCoordinate.xyz / eyeCoordinate.w;\\n\\\n}\\n\\\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\\n\\\nvec2 glFragCoordXY = gl_FragCoord.xy;\\n\\\nfloat upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\\n\\\nfloat downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\\n\\\nbvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\\n\\\nfloat useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\\n\\\nfloat useDownOrLeft = float(useUpOrRight == 0.0);\\n\\\nvec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\\n\\\nvec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\\n\\\nreturn (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\\n\\\n}\\n\\\n#endif // NORMAL_EC\\n\\\nvoid main(void)\\n\\\n{\\n\\\n#ifdef REQUIRES_EC\\n\\\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\n#endif\\n\\\n#ifdef REQUIRES_WC\\n\\\nvec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\\n\\\nvec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\\n\\\n#endif\\n\\\n#ifdef TEXTURE_COORDINATES\\n\\\nvec2 uv;\\n\\\n#ifdef SPHERICAL\\n\\\nvec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\\n\\\nsphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\\n\\\nsphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\\n\\\nuv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\\n\\\nuv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\\n\\\n#else // SPHERICAL\\n\\\nuv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\\n\\\nuv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\\n\\\n#endif // SPHERICAL\\n\\\n#endif // TEXTURE_COORDINATES\\n\\\n#ifdef PICK\\n\\\n#ifdef CULL_FRAGMENTS\\n\\\nif (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\\n\\\ngl_FragColor.a = 1.0;\\n\\\nczm_writeDepthClamp();\\n\\\n}\\n\\\n#else // CULL_FRAGMENTS\\n\\\ngl_FragColor.a = 1.0;\\n\\\n#endif // CULL_FRAGMENTS\\n\\\n#else // PICK\\n\\\n#ifdef CULL_FRAGMENTS\\n\\\nif (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef NORMAL_EC\\n\\\nvec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\\n\\\nvec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\\n\\\nvec3 normalEC = normalize(cross(leftRight, downUp));\\n\\\n#endif\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvec4 color = czm_gammaCorrect(v_color);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = color;\\n\\\n#else // FLAT\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\\n\\\nczm_material material = czm_getDefaultMaterial(materialInput);\\n\\\nmaterial.diffuse = color.rgb;\\n\\\nmaterial.alpha = color.a;\\n\\\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\\n\\\n#endif // FLAT\\n\\\ngl_FragColor.rgb *= gl_FragColor.a;\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\nczm_materialInput materialInput;\\n\\\n#ifdef USES_NORMAL_EC\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\n#endif\\n\\\n#ifdef USES_POSITION_TO_EYE_EC\\n\\\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\\n\\\n#endif\\n\\\n#ifdef USES_TANGENT_TO_EYE\\n\\\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\\n\\\n#endif\\n\\\n#ifdef USES_ST\\n\\\nmaterialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\\n\\\nmaterialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\\n\\\n#endif\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else // FLAT\\n\\\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\\n\\\n#endif // FLAT\\n\\\ngl_FragColor.rgb *= gl_FragColor.a;\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\nczm_writeDepthClamp();\\n\\\n#endif // PICK\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport GeometryInstanceAttribute from \"../Core/GeometryInstanceAttribute.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ShadowVolumeAppearanceFS from \"../Shaders/ShadowVolumeAppearanceFS.js\";\n\n/**\n * Creates shaders for a ClassificationPrimitive to use a given Appearance, as well as for picking.\n *\n * @param {Boolean} extentsCulling Discard fragments outside the instance's texture coordinate extents.\n * @param {Boolean} planarExtents If true, texture coordinates will be computed using planes instead of spherical coordinates.\n * @param {Appearance} appearance An Appearance to be used with a ClassificationPrimitive via GroundPrimitive.\n * @private\n */\nfunction ShadowVolumeAppearance(extentsCulling, planarExtents, appearance) {\n this._projectionExtentDefines = {\n eastMostYhighDefine: \"\",\n eastMostYlowDefine: \"\",\n westMostYhighDefine: \"\",\n westMostYlowDefine: \"\",\n };\n\n // Compute shader dependencies\n const colorShaderDependencies = new ShaderDependencies();\n colorShaderDependencies.requiresTextureCoordinates = extentsCulling;\n colorShaderDependencies.requiresEC = !appearance.flat;\n\n const pickShaderDependencies = new ShaderDependencies();\n pickShaderDependencies.requiresTextureCoordinates = extentsCulling;\n\n if (appearance instanceof PerInstanceColorAppearance) {\n // PerInstanceColorAppearance doesn't have material.shaderSource, instead it has its own vertex and fragment shaders\n colorShaderDependencies.requiresNormalEC = !appearance.flat;\n } else {\n // Scan material source for what hookups are needed. Assume czm_materialInput materialInput.\n const materialShaderSource = `${appearance.material.shaderSource}\\n${appearance.fragmentShaderSource}`;\n\n colorShaderDependencies.normalEC =\n materialShaderSource.indexOf(\"materialInput.normalEC\") !== -1 ||\n materialShaderSource.indexOf(\"czm_getDefaultMaterial\") !== -1;\n colorShaderDependencies.positionToEyeEC =\n materialShaderSource.indexOf(\"materialInput.positionToEyeEC\") !== -1;\n colorShaderDependencies.tangentToEyeMatrix =\n materialShaderSource.indexOf(\"materialInput.tangentToEyeMatrix\") !== -1;\n colorShaderDependencies.st =\n materialShaderSource.indexOf(\"materialInput.st\") !== -1;\n }\n\n this._colorShaderDependencies = colorShaderDependencies;\n this._pickShaderDependencies = pickShaderDependencies;\n this._appearance = appearance;\n this._extentsCulling = extentsCulling;\n this._planarExtents = planarExtents;\n}\n\n/**\n * Create the fragment shader for a ClassificationPrimitive's color pass when rendering for color.\n *\n * @param {Boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @returns {ShaderSource} Shader source for the fragment shader.\n */\nShadowVolumeAppearance.prototype.createFragmentShader = function (\n columbusView2D\n) {\n const appearance = this._appearance;\n const dependencies = this._colorShaderDependencies;\n\n const defines = [];\n if (!columbusView2D && !this._planarExtents) {\n defines.push(\"SPHERICAL\");\n }\n if (dependencies.requiresEC) {\n defines.push(\"REQUIRES_EC\");\n }\n if (dependencies.requiresWC) {\n defines.push(\"REQUIRES_WC\");\n }\n if (dependencies.requiresTextureCoordinates) {\n defines.push(\"TEXTURE_COORDINATES\");\n }\n if (this._extentsCulling) {\n defines.push(\"CULL_FRAGMENTS\");\n }\n if (dependencies.requiresNormalEC) {\n defines.push(\"NORMAL_EC\");\n }\n if (appearance instanceof PerInstanceColorAppearance) {\n defines.push(\"PER_INSTANCE_COLOR\");\n }\n\n // Material inputs. Use of parameters in the material is different\n // from requirement of the parameters in the overall shader, for example,\n // texture coordinates may be used for fragment culling but not for the material itself.\n if (dependencies.normalEC) {\n defines.push(\"USES_NORMAL_EC\");\n }\n if (dependencies.positionToEyeEC) {\n defines.push(\"USES_POSITION_TO_EYE_EC\");\n }\n if (dependencies.tangentToEyeMatrix) {\n defines.push(\"USES_TANGENT_TO_EYE\");\n }\n if (dependencies.st) {\n defines.push(\"USES_ST\");\n }\n\n if (appearance.flat) {\n defines.push(\"FLAT\");\n }\n\n let materialSource = \"\";\n if (!(appearance instanceof PerInstanceColorAppearance)) {\n materialSource = appearance.material.shaderSource;\n }\n\n return new ShaderSource({\n defines: defines,\n sources: [materialSource, ShadowVolumeAppearanceFS],\n });\n};\n\nShadowVolumeAppearance.prototype.createPickFragmentShader = function (\n columbusView2D\n) {\n const dependencies = this._pickShaderDependencies;\n\n const defines = [\"PICK\"];\n if (!columbusView2D && !this._planarExtents) {\n defines.push(\"SPHERICAL\");\n }\n if (dependencies.requiresEC) {\n defines.push(\"REQUIRES_EC\");\n }\n if (dependencies.requiresWC) {\n defines.push(\"REQUIRES_WC\");\n }\n if (dependencies.requiresTextureCoordinates) {\n defines.push(\"TEXTURE_COORDINATES\");\n }\n if (this._extentsCulling) {\n defines.push(\"CULL_FRAGMENTS\");\n }\n return new ShaderSource({\n defines: defines,\n sources: [ShadowVolumeAppearanceFS],\n pickColorQualifier: \"varying\",\n });\n};\n\n/**\n * Create the vertex shader for a ClassificationPrimitive's color pass on the final of 3 shadow volume passes\n *\n * @param {String[]} defines External defines to pass to the vertex shader.\n * @param {String} vertexShaderSource ShadowVolumeAppearanceVS with any required modifications for computing position.\n * @param {Boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @param {MapProjection} mapProjection Current scene's map projection.\n * @returns {String} Shader source for the vertex shader.\n */\nShadowVolumeAppearance.prototype.createVertexShader = function (\n defines,\n vertexShaderSource,\n columbusView2D,\n mapProjection\n) {\nreturn createShadowVolumeAppearanceVS(\n this._colorShaderDependencies,\n this._planarExtents,\n columbusView2D,\n defines,\n vertexShaderSource,\n this._appearance,\n mapProjection,\n this._projectionExtentDefines\n );\n};\n\n/**\n * Create the vertex shader for a ClassificationPrimitive's pick pass on the final of 3 shadow volume passes\n *\n * @param {String[]} defines External defines to pass to the vertex shader.\n * @param {String} vertexShaderSource ShadowVolumeAppearanceVS with any required modifications for computing position and picking.\n * @param {Boolean} columbusView2D Whether the shader will be used for Columbus View or 2D.\n * @param {MapProjection} mapProjection Current scene's map projection.\n * @returns {String} Shader source for the vertex shader.\n */\nShadowVolumeAppearance.prototype.createPickVertexShader = function (\n defines,\n vertexShaderSource,\n columbusView2D,\n mapProjection\n) {\nreturn createShadowVolumeAppearanceVS(\n this._pickShaderDependencies,\n this._planarExtents,\n columbusView2D,\n defines,\n vertexShaderSource,\n undefined,\n mapProjection,\n this._projectionExtentDefines\n );\n};\n\nconst longitudeExtentsCartesianScratch = new Cartesian3();\nconst longitudeExtentsCartographicScratch = new Cartographic();\nconst longitudeExtentsEncodeScratch = {\n high: 0.0,\n low: 0.0,\n};\nfunction createShadowVolumeAppearanceVS(\n shaderDependencies,\n planarExtents,\n columbusView2D,\n defines,\n vertexShaderSource,\n appearance,\n mapProjection,\n projectionExtentDefines\n) {\n const allDefines = defines.slice();\n\n if (projectionExtentDefines.eastMostYhighDefine === \"\") {\n const eastMostCartographic = longitudeExtentsCartographicScratch;\n eastMostCartographic.longitude = CesiumMath.PI;\n eastMostCartographic.latitude = 0.0;\n eastMostCartographic.height = 0.0;\n const eastMostCartesian = mapProjection.project(\n eastMostCartographic,\n longitudeExtentsCartesianScratch\n );\n let encoded = EncodedCartesian3.encode(\n eastMostCartesian.x,\n longitudeExtentsEncodeScratch\n );\n projectionExtentDefines.eastMostYhighDefine = `EAST_MOST_X_HIGH ${encoded.high.toFixed(\n `${encoded.high}`.length + 1\n )}`;\n projectionExtentDefines.eastMostYlowDefine = `EAST_MOST_X_LOW ${encoded.low.toFixed(\n `${encoded.low}`.length + 1\n )}`;\n\n const westMostCartographic = longitudeExtentsCartographicScratch;\n westMostCartographic.longitude = -CesiumMath.PI;\n westMostCartographic.latitude = 0.0;\n westMostCartographic.height = 0.0;\n const westMostCartesian = mapProjection.project(\n westMostCartographic,\n longitudeExtentsCartesianScratch\n );\n encoded = EncodedCartesian3.encode(\n westMostCartesian.x,\n longitudeExtentsEncodeScratch\n );\n projectionExtentDefines.westMostYhighDefine = `WEST_MOST_X_HIGH ${encoded.high.toFixed(\n `${encoded.high}`.length + 1\n )}`;\n projectionExtentDefines.westMostYlowDefine = `WEST_MOST_X_LOW ${encoded.low.toFixed(\n `${encoded.low}`.length + 1\n )}`;\n }\n\n if (columbusView2D) {\n allDefines.push(projectionExtentDefines.eastMostYhighDefine);\n allDefines.push(projectionExtentDefines.eastMostYlowDefine);\n allDefines.push(projectionExtentDefines.westMostYhighDefine);\n allDefines.push(projectionExtentDefines.westMostYlowDefine);\n }\n\n if (defined(appearance) && appearance instanceof PerInstanceColorAppearance) {\n allDefines.push(\"PER_INSTANCE_COLOR\");\n }\n if (shaderDependencies.requiresTextureCoordinates) {\n allDefines.push(\"TEXTURE_COORDINATES\");\n if (!(planarExtents || columbusView2D)) {\n allDefines.push(\"SPHERICAL\");\n }\n if (columbusView2D) {\n allDefines.push(\"COLUMBUS_VIEW_2D\");\n }\n }\n\n return new ShaderSource({\n defines: allDefines,\n sources: [vertexShaderSource],\n });\n}\n\n/**\n * Tracks shader dependencies.\n * @private\n */\nfunction ShaderDependencies() {\n this._requiresEC = false;\n this._requiresWC = false; // depends on eye coordinates, needed for material and for phong\n this._requiresNormalEC = false; // depends on eye coordinates, needed for material\n this._requiresTextureCoordinates = false; // depends on world coordinates, needed for material and for culling\n\n this._usesNormalEC = false;\n this._usesPositionToEyeEC = false;\n this._usesTangentToEyeMat = false;\n this._usesSt = false;\n}\n\nObject.defineProperties(ShaderDependencies.prototype, {\n // Set when assessing final shading (flat vs. phong) and culling using computed texture coordinates\n requiresEC: {\n get: function () {\n return this._requiresEC;\n },\n set: function (value) {\n this._requiresEC = value || this._requiresEC;\n },\n },\n requiresWC: {\n get: function () {\n return this._requiresWC;\n },\n set: function (value) {\n this._requiresWC = value || this._requiresWC;\n this.requiresEC = this._requiresWC;\n },\n },\n requiresNormalEC: {\n get: function () {\n return this._requiresNormalEC;\n },\n set: function (value) {\n this._requiresNormalEC = value || this._requiresNormalEC;\n this.requiresEC = this._requiresNormalEC;\n },\n },\n requiresTextureCoordinates: {\n get: function () {\n return this._requiresTextureCoordinates;\n },\n set: function (value) {\n this._requiresTextureCoordinates =\n value || this._requiresTextureCoordinates;\n this.requiresWC = this._requiresTextureCoordinates;\n },\n },\n // Get/Set when assessing material hookups\n normalEC: {\n set: function (value) {\n this.requiresNormalEC = value;\n this._usesNormalEC = value;\n },\n get: function () {\n return this._usesNormalEC;\n },\n },\n tangentToEyeMatrix: {\n set: function (value) {\n this.requiresWC = value;\n this.requiresNormalEC = value;\n this._usesTangentToEyeMat = value;\n },\n get: function () {\n return this._usesTangentToEyeMat;\n },\n },\n positionToEyeEC: {\n set: function (value) {\n this.requiresEC = value;\n this._usesPositionToEyeEC = value;\n },\n get: function () {\n return this._usesPositionToEyeEC;\n },\n },\n st: {\n set: function (value) {\n this.requiresTextureCoordinates = value;\n this._usesSt = value;\n },\n get: function () {\n return this._usesSt;\n },\n },\n});\n\nfunction pointLineDistance(point1, point2, point) {\n return (\n Math.abs(\n (point2.y - point1.y) * point.x -\n (point2.x - point1.x) * point.y +\n point2.x * point1.y -\n point2.y * point1.x\n ) / Cartesian2.distance(point2, point1)\n );\n}\n\nconst points2DScratch = [\n new Cartesian2(),\n new Cartesian2(),\n new Cartesian2(),\n new Cartesian2(),\n];\n\n// textureCoordinateRotationPoints form 2 lines in the computed UV space that remap to desired texture coordinates.\n// This allows simulation of baked texture coordinates for EllipseGeometry, RectangleGeometry, and PolygonGeometry.\nfunction addTextureCoordinateRotationAttributes(\n attributes,\n textureCoordinateRotationPoints\n) {\n const points2D = points2DScratch;\n\n const minXYCorner = Cartesian2.unpack(\n textureCoordinateRotationPoints,\n 0,\n points2D[0]\n );\n const maxYCorner = Cartesian2.unpack(\n textureCoordinateRotationPoints,\n 2,\n points2D[1]\n );\n const maxXCorner = Cartesian2.unpack(\n textureCoordinateRotationPoints,\n 4,\n points2D[2]\n );\n\n attributes.uMaxVmax = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n value: [maxYCorner.x, maxYCorner.y, maxXCorner.x, maxXCorner.y],\n });\n\n const inverseExtentX =\n 1.0 / pointLineDistance(minXYCorner, maxYCorner, maxXCorner);\n const inverseExtentY =\n 1.0 / pointLineDistance(minXYCorner, maxXCorner, maxYCorner);\n\n attributes.uvMinAndExtents = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n value: [minXYCorner.x, minXYCorner.y, inverseExtentX, inverseExtentY],\n });\n}\n\nconst cartographicScratch = new Cartographic();\nconst cornerScratch = new Cartesian3();\nconst northWestScratch = new Cartesian3();\nconst southEastScratch = new Cartesian3();\nconst highLowScratch = { high: 0.0, low: 0.0 };\nfunction add2DTextureCoordinateAttributes(rectangle, projection, attributes) {\n // Compute corner positions in double precision\n const carto = cartographicScratch;\n carto.height = 0.0;\n\n carto.longitude = rectangle.west;\n carto.latitude = rectangle.south;\n\n const southWestCorner = projection.project(carto, cornerScratch);\n\n carto.latitude = rectangle.north;\n const northWest = projection.project(carto, northWestScratch);\n\n carto.longitude = rectangle.east;\n carto.latitude = rectangle.south;\n const southEast = projection.project(carto, southEastScratch);\n\n // Since these positions are all in the 2D plane, there's a lot of zeros\n // and a lot of repetition. So we only need to encode 4 values.\n // Encode:\n // x: x value for southWestCorner\n // y: y value for southWestCorner\n // z: y value for northWest\n // w: x value for southEast\n\n const valuesHigh = [0, 0, 0, 0];\n const valuesLow = [0, 0, 0, 0];\n let encoded = EncodedCartesian3.encode(southWestCorner.x, highLowScratch);\n valuesHigh[0] = encoded.high;\n valuesLow[0] = encoded.low;\n\n encoded = EncodedCartesian3.encode(southWestCorner.y, highLowScratch);\n valuesHigh[1] = encoded.high;\n valuesLow[1] = encoded.low;\n\n encoded = EncodedCartesian3.encode(northWest.y, highLowScratch);\n valuesHigh[2] = encoded.high;\n valuesLow[2] = encoded.low;\n\n encoded = EncodedCartesian3.encode(southEast.x, highLowScratch);\n valuesHigh[3] = encoded.high;\n valuesLow[3] = encoded.low;\n\n attributes.planes2D_HIGH = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n value: valuesHigh,\n });\n\n attributes.planes2D_LOW = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n value: valuesLow,\n });\n}\n\nconst enuMatrixScratch = new Matrix4();\nconst inverseEnuScratch = new Matrix4();\nconst rectanglePointCartesianScratch = new Cartesian3();\nconst rectangleCenterScratch = new Cartographic();\nconst pointsCartographicScratch = [\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n];\n/**\n * When computing planes to bound the rectangle,\n * need to factor in \"bulge\" and other distortion.\n * Flatten the ellipsoid-centered corners and edge-centers of the rectangle\n * into the plane of the local ENU system, compute bounds in 2D, and\n * project back to ellipsoid-centered.\n *\n * @private\n */\nfunction computeRectangleBounds(\n rectangle,\n ellipsoid,\n height,\n southWestCornerResult,\n eastVectorResult,\n northVectorResult\n) {\n // Compute center of rectangle\n const centerCartographic = Rectangle.center(\n rectangle,\n rectangleCenterScratch\n );\n centerCartographic.height = height;\n const centerCartesian = Cartographic.toCartesian(\n centerCartographic,\n ellipsoid,\n rectanglePointCartesianScratch\n );\n const enuMatrix = Transforms.eastNorthUpToFixedFrame(\n centerCartesian,\n ellipsoid,\n enuMatrixScratch\n );\n const inverseEnu = Matrix4.inverse(enuMatrix, inverseEnuScratch);\n\n const west = rectangle.west;\n const east = rectangle.east;\n const north = rectangle.north;\n const south = rectangle.south;\n\n const cartographics = pointsCartographicScratch;\n cartographics[0].latitude = south;\n cartographics[0].longitude = west;\n cartographics[1].latitude = north;\n cartographics[1].longitude = west;\n cartographics[2].latitude = north;\n cartographics[2].longitude = east;\n cartographics[3].latitude = south;\n cartographics[3].longitude = east;\n\n const longitudeCenter = (west + east) * 0.5;\n const latitudeCenter = (north + south) * 0.5;\n\n cartographics[4].latitude = south;\n cartographics[4].longitude = longitudeCenter;\n cartographics[5].latitude = north;\n cartographics[5].longitude = longitudeCenter;\n cartographics[6].latitude = latitudeCenter;\n cartographics[6].longitude = west;\n cartographics[7].latitude = latitudeCenter;\n cartographics[7].longitude = east;\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n for (let i = 0; i < 8; i++) {\n cartographics[i].height = height;\n const pointCartesian = Cartographic.toCartesian(\n cartographics[i],\n ellipsoid,\n rectanglePointCartesianScratch\n );\n Matrix4.multiplyByPoint(inverseEnu, pointCartesian, pointCartesian);\n pointCartesian.z = 0.0; // flatten into XY plane of ENU coordinate system\n minX = Math.min(minX, pointCartesian.x);\n maxX = Math.max(maxX, pointCartesian.x);\n minY = Math.min(minY, pointCartesian.y);\n maxY = Math.max(maxY, pointCartesian.y);\n }\n\n const southWestCorner = southWestCornerResult;\n southWestCorner.x = minX;\n southWestCorner.y = minY;\n southWestCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, southWestCorner, southWestCorner);\n\n const southEastCorner = eastVectorResult;\n southEastCorner.x = maxX;\n southEastCorner.y = minY;\n southEastCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, southEastCorner, southEastCorner);\n // make eastward vector\n Cartesian3.subtract(southEastCorner, southWestCorner, eastVectorResult);\n\n const northWestCorner = northVectorResult;\n northWestCorner.x = minX;\n northWestCorner.y = maxY;\n northWestCorner.z = 0.0;\n Matrix4.multiplyByPoint(enuMatrix, northWestCorner, northWestCorner);\n // make eastward vector\n Cartesian3.subtract(northWestCorner, southWestCorner, northVectorResult);\n}\n\nconst eastwardScratch = new Cartesian3();\nconst northwardScratch = new Cartesian3();\nconst encodeScratch = new EncodedCartesian3();\n/**\n * Gets an attributes object containing:\n * - 3 high-precision points as 6 GeometryInstanceAttributes. These points are used to compute eye-space planes.\n * - 1 texture coordinate rotation GeometryInstanceAttributes\n * - 2 GeometryInstanceAttributes used to compute high-precision points in 2D and Columbus View.\n * These points are used to compute eye-space planes like above.\n *\n * Used to compute texture coordinates for small-area ClassificationPrimitives with materials or multiple non-overlapping instances.\n *\n * @see ShadowVolumeAppearance\n * @private\n *\n * @param {Rectangle} boundingRectangle Rectangle object that the points will approximately bound\n * @param {Number[]} textureCoordinateRotationPoints Points in the computed texture coordinate system for remapping texture coordinates\n * @param {Ellipsoid} ellipsoid Ellipsoid for converting Rectangle points to world coordinates\n * @param {MapProjection} projection The MapProjection used for 2D and Columbus View.\n * @param {Number} [height=0] The maximum height for the shadow volume.\n * @returns {Object} An attributes dictionary containing planar texture coordinate attributes.\n */\nShadowVolumeAppearance.getPlanarTextureCoordinateAttributes = function (\n boundingRectangle,\n textureCoordinateRotationPoints,\n ellipsoid,\n projection,\n height\n) {\n const corner = cornerScratch;\n const eastward = eastwardScratch;\n const northward = northwardScratch;\n computeRectangleBounds(\n boundingRectangle,\n ellipsoid,\n defaultValue(height, 0.0),\n corner,\n eastward,\n northward\n );\n\n const attributes = {};\n addTextureCoordinateRotationAttributes(\n attributes,\n textureCoordinateRotationPoints\n );\n\n const encoded = EncodedCartesian3.fromCartesian(corner, encodeScratch);\n\n attributes.southWest_HIGH = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n normalize: false,\n value: Cartesian3.pack(encoded.high, [0, 0, 0]),\n });\n attributes.southWest_LOW = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n normalize: false,\n value: Cartesian3.pack(encoded.low, [0, 0, 0]),\n });\n attributes.eastward = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n normalize: false,\n value: Cartesian3.pack(eastward, [0, 0, 0]),\n });\n attributes.northward = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n normalize: false,\n value: Cartesian3.pack(northward, [0, 0, 0]),\n });\n\n add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);\n return attributes;\n};\n\nconst spherePointScratch = new Cartesian3();\nfunction latLongToSpherical(latitude, longitude, ellipsoid, result) {\n const cartographic = cartographicScratch;\n cartographic.latitude = latitude;\n cartographic.longitude = longitude;\n cartographic.height = 0.0;\n\n const spherePoint = Cartographic.toCartesian(\n cartographic,\n ellipsoid,\n spherePointScratch\n );\n\n // Project into plane with vertical for latitude\n const magXY = Math.sqrt(\n spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y\n );\n\n // Use fastApproximateAtan2 for alignment with shader\n const sphereLatitude = CesiumMath.fastApproximateAtan2(magXY, spherePoint.z);\n const sphereLongitude = CesiumMath.fastApproximateAtan2(\n spherePoint.x,\n spherePoint.y\n );\n\n result.x = sphereLatitude;\n result.y = sphereLongitude;\n\n return result;\n}\n\nconst sphericalScratch = new Cartesian2();\n/**\n * Gets an attributes object containing:\n * - the southwest corner of a rectangular area in spherical coordinates, as well as the inverse of the latitude/longitude range.\n * These are computed using the same atan2 approximation used in the shader.\n * - 1 texture coordinate rotation GeometryInstanceAttributes\n * - 2 GeometryInstanceAttributes used to compute high-precision points in 2D and Columbus View.\n * These points are used to compute eye-space planes like above.\n *\n * Used when computing texture coordinates for large-area ClassificationPrimitives with materials or\n * multiple non-overlapping instances.\n * @see ShadowVolumeAppearance\n * @private\n *\n * @param {Rectangle} boundingRectangle Rectangle object that the spherical extents will approximately bound\n * @param {Number[]} textureCoordinateRotationPoints Points in the computed texture coordinate system for remapping texture coordinates\n * @param {Ellipsoid} ellipsoid Ellipsoid for converting Rectangle points to world coordinates\n * @param {MapProjection} projection The MapProjection used for 2D and Columbus View.\n * @returns {Object} An attributes dictionary containing spherical texture coordinate attributes.\n */\nShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function (\n boundingRectangle,\n textureCoordinateRotationPoints,\n ellipsoid,\n projection\n) {\n // rectangle cartographic coords !== spherical because it's on an ellipsoid\n const southWestExtents = latLongToSpherical(\n boundingRectangle.south,\n boundingRectangle.west,\n ellipsoid,\n sphericalScratch\n );\n\n let south = southWestExtents.x;\n let west = southWestExtents.y;\n\n const northEastExtents = latLongToSpherical(\n boundingRectangle.north,\n boundingRectangle.east,\n ellipsoid,\n sphericalScratch\n );\n let north = northEastExtents.x;\n let east = northEastExtents.y;\n\n // If the bounding rectangle crosses the IDL, rotate the spherical extents so the cross no longer happens.\n // This rotation must happen in the shader too.\n let rotationRadians = 0.0;\n if (west > east) {\n rotationRadians = CesiumMath.PI - west;\n west = -CesiumMath.PI;\n east += rotationRadians;\n }\n\n // Slightly pad extents to avoid floating point error when fragment culling at edges.\n south -= CesiumMath.EPSILON5;\n west -= CesiumMath.EPSILON5;\n north += CesiumMath.EPSILON5;\n east += CesiumMath.EPSILON5;\n\n const longitudeRangeInverse = 1.0 / (east - west);\n const latitudeRangeInverse = 1.0 / (north - south);\n\n const attributes = {\n sphericalExtents: new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n value: [south, west, latitudeRangeInverse, longitudeRangeInverse],\n }),\n longitudeRotation: new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 1,\n normalize: false,\n value: [rotationRadians],\n }),\n };\n\n addTextureCoordinateRotationAttributes(\n attributes,\n textureCoordinateRotationPoints\n );\n add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);\n return attributes;\n};\n\nShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes = function (\n attributes\n) {\n return (\n defined(attributes.southWest_HIGH) &&\n defined(attributes.southWest_LOW) &&\n defined(attributes.northward) &&\n defined(attributes.eastward) &&\n defined(attributes.planes2D_HIGH) &&\n defined(attributes.planes2D_LOW) &&\n defined(attributes.uMaxVmax) &&\n defined(attributes.uvMinAndExtents)\n );\n};\n\nShadowVolumeAppearance.hasAttributesForSphericalExtents = function (\n attributes\n) {\n return (\n defined(attributes.sphericalExtents) &&\n defined(attributes.longitudeRotation) &&\n defined(attributes.planes2D_HIGH) &&\n defined(attributes.planes2D_LOW) &&\n defined(attributes.uMaxVmax) &&\n defined(attributes.uvMinAndExtents)\n );\n};\n\nfunction shouldUseSpherical(rectangle) {\n return (\n Math.max(rectangle.width, rectangle.height) >\n ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS\n );\n}\n\n/**\n * Computes whether the given rectangle is wide enough that texture coordinates\n * over its area should be computed using spherical extents instead of distance to planes.\n *\n * @param {Rectangle} rectangle A rectangle\n * @private\n */\nShadowVolumeAppearance.shouldUseSphericalCoordinates = function (rectangle) {\n return shouldUseSpherical(rectangle);\n};\n\n/**\n * Texture coordinates for ground primitives are computed either using spherical coordinates for large areas or\n * using distance from planes for small areas.\n *\n * @type {Number}\n * @constant\n * @private\n */\nShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS = CesiumMath.toRadians(1.0);\nexport default ShadowVolumeAppearance;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the function used to compare stencil values for the stencil test.\n *\n * @enum {Number}\n */\nconst StencilFunction = {\n /**\n * The stencil test never passes.\n *\n * @type {Number}\n * @constant\n */\n NEVER: WebGLConstants.NEVER,\n\n /**\n * The stencil test passes when the masked reference value is less than the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n LESS: WebGLConstants.LESS,\n\n /**\n * The stencil test passes when the masked reference value is equal to the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n EQUAL: WebGLConstants.EQUAL,\n\n /**\n * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n LESS_OR_EQUAL: WebGLConstants.LEQUAL,\n\n /**\n * The stencil test passes when the masked reference value is greater than the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n GREATER: WebGLConstants.GREATER,\n\n /**\n * The stencil test passes when the masked reference value is not equal to the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n NOT_EQUAL: WebGLConstants.NOTEQUAL,\n\n /**\n * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.\n *\n * @type {Number}\n * @constant\n */\n GREATER_OR_EQUAL: WebGLConstants.GEQUAL,\n\n /**\n * The stencil test always passes.\n *\n * @type {Number}\n * @constant\n */\n ALWAYS: WebGLConstants.ALWAYS,\n};\nexport default Object.freeze(StencilFunction);\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * Determines the action taken based on the result of the stencil test.\n *\n * @enum {Number}\n */\nconst StencilOperation = {\n /**\n * Sets the stencil buffer value to zero.\n *\n * @type {Number}\n * @constant\n */\n ZERO: WebGLConstants.ZERO,\n\n /**\n * Does not change the stencil buffer.\n *\n * @type {Number}\n * @constant\n */\n KEEP: WebGLConstants.KEEP,\n\n /**\n * Replaces the stencil buffer value with the reference value.\n *\n * @type {Number}\n * @constant\n */\n REPLACE: WebGLConstants.REPLACE,\n\n /**\n * Increments the stencil buffer value, clamping to unsigned byte.\n *\n * @type {Number}\n * @constant\n */\n INCREMENT: WebGLConstants.INCR,\n\n /**\n * Decrements the stencil buffer value, clamping to zero.\n *\n * @type {Number}\n * @constant\n */\n DECREMENT: WebGLConstants.DECR,\n\n /**\n * Bitwise inverts the existing stencil buffer value.\n *\n * @type {Number}\n * @constant\n */\n INVERT: WebGLConstants.INVERT,\n\n /**\n * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.\n *\n * @type {Number}\n * @constant\n */\n INCREMENT_WRAP: WebGLConstants.INCR_WRAP,\n\n /**\n * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.\n *\n * @type {Number}\n * @constant\n */\n DECREMENT_WRAP: WebGLConstants.DECR_WRAP,\n};\nexport default Object.freeze(StencilOperation);\n", "import StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * The most significant bit is used to identify whether the pixel is 3D Tiles.\n * The next three bits store selection depth for the skip LODs optimization.\n * The last four bits are for increment/decrement shadow volume operations for classification.\n *\n * @private\n */\nconst StencilConstants = {\n CESIUM_3D_TILE_MASK: 0x80,\n SKIP_LOD_MASK: 0x70,\n SKIP_LOD_BIT_SHIFT: 4,\n CLASSIFICATION_MASK: 0x0f,\n};\n\nStencilConstants.setCesium3DTileBit = function () {\n return {\n enabled: true,\n frontFunction: StencilFunction.ALWAYS,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.REPLACE,\n },\n backFunction: StencilFunction.ALWAYS,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.REPLACE,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n };\n};\nexport default Object.freeze(StencilConstants);\n", "import ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShadowVolumeAppearanceVS from \"../Shaders/ShadowVolumeAppearanceVS.js\";\nimport ShadowVolumeFS from \"../Shaders/ShadowVolumeFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowVolumeAppearance from \"./ShadowVolumeAppearance.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using\n * ClassificationPrimitive directly.\n * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.\n * </p>\n * <p>\n * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there\n * will be rendering artifacts for some viewing angles.\n * </p>\n * <p>\n * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.\n * </p>\n * <p>\n * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},\n * are also valid if they are extruded volumes; otherwise, they will not be rendered.\n * </p>\n *\n * @alias ClassificationPrimitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] The geometry instances to render. This can either be a single instance or an array of length one.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {Boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {Boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {Boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {Boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n * @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on\n * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.\n *\n * @see Primitive\n * @see GroundPrimitive\n * @see GeometryInstance\n * @see Appearance\n */\nfunction ClassificationPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const geometryInstances = options.geometryInstances;\n\n /**\n * The geometry instance rendered with this primitive. This may\n * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n * is <code>true</code> when the primitive is constructed.\n * <p>\n * Changing this property after the primitive is rendered has no effect.\n * </p>\n * <p>\n * Because of the rendering technique used, all geometry instances must be the same color.\n * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown\n * on the first attempt to render.\n * </p>\n *\n * @readonly\n * @type {Array|GeometryInstance}\n *\n * @default undefined\n */\n this.geometryInstances = geometryInstances;\n /**\n * Determines if the primitive will be shown. This affects all geometry\n * instances in the primitive.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.show = defaultValue(options.show, true);\n /**\n * Determines whether terrain, 3D Tiles or both will be classified.\n *\n * @type {ClassificationType}\n *\n * @default ClassificationType.BOTH\n */\n this.classificationType = defaultValue(\n options.classificationType,\n ClassificationType.BOTH\n );\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the shadow volume for each geometry in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowShadowVolume = defaultValue(\n options.debugShowShadowVolume,\n false\n );\n this._debugShowShadowVolume = false;\n\n // These are used by GroundPrimitive to augment the shader and uniform map.\n this._extruded = defaultValue(options._extruded, false);\n this._uniformMap = options._uniformMap;\n\n this._sp = undefined;\n this._spStencil = undefined;\n this._spPick = undefined;\n this._spColor = undefined;\n\n this._spPick2D = undefined; // only derived if necessary\n this._spColor2D = undefined; // only derived if necessary\n\n this._rsStencilDepthPass = undefined;\n this._rsStencilDepthPass3DTiles = undefined;\n this._rsColorPass = undefined;\n this._rsPickPass = undefined;\n\n this._commandsIgnoreShow = [];\n\n this._ready = false;\n\n const classificationPrimitive = this;\n this._readyPromise = new Promise((resolve, reject) => {\n classificationPrimitive._completeLoad = () => {\n if (this._ready) {\n return;\n }\n\n this._ready = true;\n\n if (this.releaseGeometryInstances) {\n this.geometryInstances = undefined;\n }\n\n const error = this._error;\n if (!defined(error)) {\n resolve(this);\n } else {\n reject(error);\n }\n };\n });\n\n this._primitive = undefined;\n this._pickPrimitive = options._pickPrimitive;\n\n // Set in update\n this._hasSphericalExtentsAttribute = false;\n this._hasPlanarExtentsAttributes = false;\n this._hasPerColorAttribute = false;\n\n this.appearance = options.appearance;\n\n this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;\n this._updateAndQueueCommandsFunction =\n options._updateAndQueueCommandsFunction;\n\n this._usePickOffsets = false;\n\n this._primitiveOptions = {\n geometryInstances: undefined,\n appearance: undefined,\n vertexCacheOptimize: defaultValue(options.vertexCacheOptimize, false),\n interleave: defaultValue(options.interleave, false),\n releaseGeometryInstances: defaultValue(\n options.releaseGeometryInstances,\n true\n ),\n allowPicking: defaultValue(options.allowPicking, true),\n asynchronous: defaultValue(options.asynchronous, true),\n compressVertices: defaultValue(options.compressVertices, true),\n _createBoundingVolumeFunction: undefined,\n _createRenderStatesFunction: undefined,\n _createShaderProgramFunction: undefined,\n _createCommandsFunction: undefined,\n _updateAndQueueCommandsFunction: undefined,\n _createPickOffsets: true,\n };\n}\n\nObject.defineProperties(ClassificationPrimitive.prototype, {\n /**\n * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n vertexCacheOptimize: {\n get: function () {\n return this._primitiveOptions.vertexCacheOptimize;\n },\n },\n\n /**\n * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n interleave: {\n get: function () {\n return this._primitiveOptions.interleave;\n },\n },\n\n /**\n * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n releaseGeometryInstances: {\n get: function () {\n return this._primitiveOptions.releaseGeometryInstances;\n },\n },\n\n /**\n * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n allowPicking: {\n get: function () {\n return this._primitiveOptions.allowPicking;\n },\n },\n\n /**\n * Determines if the geometry instances will be created and batched on a web worker.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n asynchronous: {\n get: function () {\n return this._primitiveOptions.asynchronous;\n },\n },\n\n /**\n * When <code>true</code>, geometry vertices are compressed, which will save memory.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n compressVertices: {\n get: function () {\n return this._primitiveOptions.compressVertices;\n },\n },\n\n /**\n * Determines if the primitive is complete and ready to render. If this property is\n * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}\n * is called.\n *\n * @memberof ClassificationPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof ClassificationPrimitive.prototype\n * @type {Promise.<ClassificationPrimitive>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Returns true if the ClassificationPrimitive needs a separate shader and commands for 2D.\n * This is because texture coordinates on ClassificationPrimitives are computed differently,\n * and are used for culling when multiple GeometryInstances are batched in one ClassificationPrimitive.\n * @memberof ClassificationPrimitive.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n _needs2DShader: {\n get: function () {\n return (\n this._hasPlanarExtentsAttributes || this._hasSphericalExtentsAttribute\n );\n },\n },\n});\n\n/**\n * Determines if ClassificationPrimitive rendering is supported.\n *\n * @param {Scene} scene The scene.\n * @returns {Boolean} <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>\n */\nClassificationPrimitive.isSupported = function (scene) {\n return scene.context.stencilBuffer;\n};\n\nfunction getStencilDepthRenderState(enableStencil, mask3DTiles) {\n const stencilFunction = mask3DTiles\n ? StencilFunction.EQUAL\n : StencilFunction.ALWAYS;\n return {\n colorMask: {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n },\n stencilTest: {\n enabled: enableStencil,\n frontFunction: stencilFunction,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.DECREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: stencilFunction,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.INCREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS_OR_EQUAL,\n },\n depthMask: false,\n };\n}\n\nfunction getColorRenderState(enableStencil) {\n return {\n stencilTest: {\n enabled: enableStencil,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n };\n}\n\nconst pickRenderState = {\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n};\n\nfunction createRenderStates(\n classificationPrimitive,\n context,\n appearance,\n twoPasses\n) {\n if (defined(classificationPrimitive._rsStencilDepthPass)) {\n return;\n }\n const stencilEnabled = !classificationPrimitive.debugShowShadowVolume;\n\n classificationPrimitive._rsStencilDepthPass = RenderState.fromCache(\n getStencilDepthRenderState(stencilEnabled, false)\n );\n classificationPrimitive._rsStencilDepthPass3DTiles = RenderState.fromCache(\n getStencilDepthRenderState(stencilEnabled, true)\n );\n classificationPrimitive._rsColorPass = RenderState.fromCache(\n getColorRenderState(stencilEnabled, false)\n );\n classificationPrimitive._rsPickPass = RenderState.fromCache(pickRenderState);\n}\n\nfunction modifyForEncodedNormals(primitive, vertexShaderSource) {\n if (!primitive.compressVertices) {\n return vertexShaderSource;\n }\n\n if (\n vertexShaderSource.search(/attribute\\s+vec3\\s+extrudeDirection;/g) !== -1\n ) {\n const attributeName = \"compressedAttributes\";\n\n //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes\n const attributeDecl = `attribute vec2 ${attributeName};`;\n\n const globalDecl = \"vec3 extrudeDirection;\\n\";\n const decode = ` extrudeDirection = czm_octDecode(${attributeName}, 65535.0);\\n`;\n\n let modifiedVS = vertexShaderSource;\n modifiedVS = modifiedVS.replace(\n /attribute\\s+vec3\\s+extrudeDirection;/g,\n \"\"\n );\n modifiedVS = ShaderSource.replaceMain(\n modifiedVS,\n \"czm_non_compressed_main\"\n );\n const compressedMain =\n `${\"void main() \\n\" + \"{ \\n\"}${decode} czm_non_compressed_main(); \\n` +\n `}`;\n\n return [attributeDecl, globalDecl, modifiedVS, compressedMain].join(\"\\n\");\n }\n}\n\nfunction createShaderProgram(classificationPrimitive, frameState) {\n const context = frameState.context;\n const primitive = classificationPrimitive._primitive;\n let vs = ShadowVolumeAppearanceVS;\n vs = classificationPrimitive._primitive._batchTable.getVertexShaderCallback()(\n vs\n );\n vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs);\n vs = Primitive._modifyShaderPosition(\n classificationPrimitive,\n vs,\n frameState.scene3DOnly\n );\n vs = Primitive._updateColorAttribute(primitive, vs);\n\n const planarExtents = classificationPrimitive._hasPlanarExtentsAttributes;\n const cullFragmentsUsingExtents =\n planarExtents || classificationPrimitive._hasSphericalExtentsAttribute;\n\n if (classificationPrimitive._extruded) {\n vs = modifyForEncodedNormals(primitive, vs);\n }\n\n const extrudedDefine = classificationPrimitive._extruded\n ? \"EXTRUDED_GEOMETRY\"\n : \"\";\n\n let vsSource = new ShaderSource({\n defines: [extrudedDefine],\n sources: [vs],\n });\n const fsSource = new ShaderSource({\n sources: [ShadowVolumeFS],\n });\n const attributeLocations =\n classificationPrimitive._primitive._attributeLocations;\n\n const shadowVolumeAppearance = new ShadowVolumeAppearance(\n cullFragmentsUsingExtents,\n planarExtents,\n classificationPrimitive.appearance\n );\n\n classificationPrimitive._spStencil = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: classificationPrimitive._spStencil,\n vertexShaderSource: vsSource,\n fragmentShaderSource: fsSource,\n attributeLocations: attributeLocations,\n });\n\n if (classificationPrimitive._primitive.allowPicking) {\n let vsPick = ShaderSource.createPickVertexShaderSource(vs);\n vsPick = Primitive._appendShowToShader(primitive, vsPick);\n vsPick = Primitive._updatePickColorAttribute(vsPick);\n\n const pickFS3D = shadowVolumeAppearance.createPickFragmentShader(false);\n const pickVS3D = shadowVolumeAppearance.createPickVertexShader(\n [extrudedDefine],\n vsPick,\n false,\n frameState.mapProjection\n );\n\n classificationPrimitive._spPick = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: classificationPrimitive._spPick,\n vertexShaderSource: pickVS3D,\n fragmentShaderSource: pickFS3D,\n attributeLocations: attributeLocations,\n });\n\n // Derive a 2D pick shader if the primitive uses texture coordinate-based fragment culling,\n // since texture coordinates are computed differently in 2D.\n if (cullFragmentsUsingExtents) {\n let pickProgram2D = context.shaderCache.getDerivedShaderProgram(\n classificationPrimitive._spPick,\n \"2dPick\"\n );\n if (!defined(pickProgram2D)) {\n const pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true);\n const pickVS2D = shadowVolumeAppearance.createPickVertexShader(\n [extrudedDefine],\n vsPick,\n true,\n frameState.mapProjection\n );\n\n pickProgram2D = context.shaderCache.createDerivedShaderProgram(\n classificationPrimitive._spPick,\n \"2dPick\",\n {\n vertexShaderSource: pickVS2D,\n fragmentShaderSource: pickFS2D,\n attributeLocations: attributeLocations,\n }\n );\n }\n classificationPrimitive._spPick2D = pickProgram2D;\n }\n } else {\n classificationPrimitive._spPick = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vsSource,\n fragmentShaderSource: fsSource,\n attributeLocations: attributeLocations,\n });\n }\n\n vs = Primitive._appendShowToShader(primitive, vs);\n vsSource = new ShaderSource({\n defines: [extrudedDefine],\n sources: [vs],\n });\n\n classificationPrimitive._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: classificationPrimitive._sp,\n vertexShaderSource: vsSource,\n fragmentShaderSource: fsSource,\n attributeLocations: attributeLocations,\n });\n\n // Create a fragment shader that computes only required material hookups using screen space techniques\n const fsColorSource = shadowVolumeAppearance.createFragmentShader(false);\n const vsColorSource = shadowVolumeAppearance.createVertexShader(\n [extrudedDefine],\n vs,\n false,\n frameState.mapProjection\n );\n\n classificationPrimitive._spColor = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: classificationPrimitive._spColor,\n vertexShaderSource: vsColorSource,\n fragmentShaderSource: fsColorSource,\n attributeLocations: attributeLocations,\n });\n\n // Derive a 2D shader if the primitive uses texture coordinate-based fragment culling,\n // since texture coordinates are computed differently in 2D.\n // Any material that uses texture coordinates will also equip texture coordinate-based fragment culling.\n if (cullFragmentsUsingExtents) {\n let colorProgram2D = context.shaderCache.getDerivedShaderProgram(\n classificationPrimitive._spColor,\n \"2dColor\"\n );\n if (!defined(colorProgram2D)) {\n const fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true);\n const vsColorSource2D = shadowVolumeAppearance.createVertexShader(\n [extrudedDefine],\n vs,\n true,\n frameState.mapProjection\n );\n\n colorProgram2D = context.shaderCache.createDerivedShaderProgram(\n classificationPrimitive._spColor,\n \"2dColor\",\n {\n vertexShaderSource: vsColorSource2D,\n fragmentShaderSource: fsColorSource2D,\n attributeLocations: attributeLocations,\n }\n );\n }\n classificationPrimitive._spColor2D = colorProgram2D;\n }\n}\n\nfunction createColorCommands(classificationPrimitive, colorCommands) {\n const primitive = classificationPrimitive._primitive;\n let length = primitive._va.length * 2; // each geometry (pack of vertex attributes) needs 2 commands: front/back stencils and fill\n colorCommands.length = length;\n\n let i;\n let command;\n let derivedCommand;\n let vaIndex = 0;\n let uniformMap = primitive._batchTable.getUniformMapCallback()(\n classificationPrimitive._uniformMap\n );\n\n const needs2DShader = classificationPrimitive._needs2DShader;\n\n for (i = 0; i < length; i += 2) {\n const vertexArray = primitive._va[vaIndex++];\n\n // Stencil depth command\n command = colorCommands[i];\n if (!defined(command)) {\n command = colorCommands[i] = new DrawCommand({\n owner: classificationPrimitive,\n primitiveType: primitive._primitiveType,\n });\n }\n\n command.vertexArray = vertexArray;\n command.renderState = classificationPrimitive._rsStencilDepthPass;\n command.shaderProgram = classificationPrimitive._sp;\n command.uniformMap = uniformMap;\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n\n derivedCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedCommand.renderState =\n classificationPrimitive._rsStencilDepthPass3DTiles;\n derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedCommand;\n\n // Color command\n command = colorCommands[i + 1];\n if (!defined(command)) {\n command = colorCommands[i + 1] = new DrawCommand({\n owner: classificationPrimitive,\n primitiveType: primitive._primitiveType,\n });\n }\n\n command.vertexArray = vertexArray;\n command.renderState = classificationPrimitive._rsColorPass;\n command.shaderProgram = classificationPrimitive._spColor;\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n\n const appearance = classificationPrimitive.appearance;\n const material = appearance.material;\n if (defined(material)) {\n uniformMap = combine(uniformMap, material._uniforms);\n }\n\n command.uniformMap = uniformMap;\n\n derivedCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedCommand;\n\n // Derive for 2D if texture coordinates are ever computed\n if (needs2DShader) {\n // First derive from the terrain command\n let derived2DCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.appearance2D\n );\n derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;\n command.derivedCommands.appearance2D = derived2DCommand;\n\n // Then derive from the 3D Tiles command\n derived2DCommand = DrawCommand.shallowClone(\n derivedCommand,\n derivedCommand.derivedCommands.appearance2D\n );\n derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;\n derivedCommand.derivedCommands.appearance2D = derived2DCommand;\n }\n }\n\n const commandsIgnoreShow = classificationPrimitive._commandsIgnoreShow;\n const spStencil = classificationPrimitive._spStencil;\n\n let commandIndex = 0;\n length = commandsIgnoreShow.length = length / 2;\n\n for (let j = 0; j < length; ++j) {\n const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone(\n colorCommands[commandIndex],\n commandsIgnoreShow[j]\n ));\n commandIgnoreShow.shaderProgram = spStencil;\n commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n\n commandIndex += 2;\n }\n}\n\nfunction createPickCommands(classificationPrimitive, pickCommands) {\n const usePickOffsets = classificationPrimitive._usePickOffsets;\n\n const primitive = classificationPrimitive._primitive;\n let length = primitive._va.length * 2; // each geometry (pack of vertex attributes) needs 2 commands: front/back stencils and fill\n\n // Fallback for batching same-color geometry instances\n let pickOffsets;\n let pickIndex = 0;\n let pickOffset;\n if (usePickOffsets) {\n pickOffsets = primitive._pickOffsets;\n length = pickOffsets.length * 2;\n }\n\n pickCommands.length = length;\n\n let j;\n let command;\n let derivedCommand;\n let vaIndex = 0;\n const uniformMap = primitive._batchTable.getUniformMapCallback()(\n classificationPrimitive._uniformMap\n );\n\n const needs2DShader = classificationPrimitive._needs2DShader;\n\n for (j = 0; j < length; j += 2) {\n let vertexArray = primitive._va[vaIndex++];\n if (usePickOffsets) {\n pickOffset = pickOffsets[pickIndex++];\n vertexArray = primitive._va[pickOffset.index];\n }\n\n // Stencil depth command\n command = pickCommands[j];\n if (!defined(command)) {\n command = pickCommands[j] = new DrawCommand({\n owner: classificationPrimitive,\n primitiveType: primitive._primitiveType,\n pickOnly: true,\n });\n }\n\n command.vertexArray = vertexArray;\n command.renderState = classificationPrimitive._rsStencilDepthPass;\n command.shaderProgram = classificationPrimitive._sp;\n command.uniformMap = uniformMap;\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n if (usePickOffsets) {\n command.offset = pickOffset.offset;\n command.count = pickOffset.count;\n }\n\n // Derive for 3D Tiles classification\n derivedCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedCommand.renderState =\n classificationPrimitive._rsStencilDepthPass3DTiles;\n derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedCommand;\n\n // Pick color command\n command = pickCommands[j + 1];\n if (!defined(command)) {\n command = pickCommands[j + 1] = new DrawCommand({\n owner: classificationPrimitive,\n primitiveType: primitive._primitiveType,\n pickOnly: true,\n });\n }\n\n command.vertexArray = vertexArray;\n command.renderState = classificationPrimitive._rsPickPass;\n command.shaderProgram = classificationPrimitive._spPick;\n command.uniformMap = uniformMap;\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n if (usePickOffsets) {\n command.offset = pickOffset.offset;\n command.count = pickOffset.count;\n }\n\n derivedCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedCommand;\n\n // Derive for 2D if texture coordinates are ever computed\n if (needs2DShader) {\n // First derive from the terrain command\n let derived2DCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.pick2D\n );\n derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;\n command.derivedCommands.pick2D = derived2DCommand;\n\n // Then derive from the 3D Tiles command\n derived2DCommand = DrawCommand.shallowClone(\n derivedCommand,\n derivedCommand.derivedCommands.pick2D\n );\n derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;\n derivedCommand.derivedCommands.pick2D = derived2DCommand;\n }\n }\n}\n\nfunction createCommands(\n classificationPrimitive,\n appearance,\n material,\n translucent,\n twoPasses,\n colorCommands,\n pickCommands\n) {\n createColorCommands(classificationPrimitive, colorCommands);\n createPickCommands(classificationPrimitive, pickCommands);\n}\n\nfunction boundingVolumeIndex(commandIndex, length) {\n return Math.floor((commandIndex % length) / 2);\n}\n\nfunction updateAndQueueRenderCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n) {\n command.modelMatrix = modelMatrix;\n command.boundingVolume = boundingVolume;\n command.cull = cull;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n frameState.commandList.push(command);\n}\n\nfunction updateAndQueuePickCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n) {\n command.modelMatrix = modelMatrix;\n command.boundingVolume = boundingVolume;\n command.cull = cull;\n\n frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n classificationPrimitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n) {\n const primitive = classificationPrimitive._primitive;\n Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix);\n\n let boundingVolumes;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingVolumes = primitive._boundingSphereWC;\n } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n boundingVolumes = primitive._boundingSphereCV;\n } else if (\n frameState.mode === SceneMode.SCENE2D &&\n defined(primitive._boundingSphere2D)\n ) {\n boundingVolumes = primitive._boundingSphere2D;\n } else if (defined(primitive._boundingSphereMorph)) {\n boundingVolumes = primitive._boundingSphereMorph;\n }\n\n const classificationType = classificationPrimitive.classificationType;\n const queueTerrainCommands =\n classificationType !== ClassificationType.CESIUM_3D_TILE;\n const queue3DTilesCommands =\n classificationType !== ClassificationType.TERRAIN;\n\n const passes = frameState.passes;\n\n let i;\n let boundingVolume;\n let command;\n\n if (passes.render) {\n const colorLength = colorCommands.length;\n for (i = 0; i < colorLength; ++i) {\n boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];\n if (queueTerrainCommands) {\n command = colorCommands[i];\n updateAndQueueRenderCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n if (queue3DTilesCommands) {\n command = colorCommands[i].derivedCommands.tileset;\n updateAndQueueRenderCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n }\n\n if (frameState.invertClassification) {\n const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;\n const ignoreShowCommandsLength = ignoreShowCommands.length;\n for (i = 0; i < ignoreShowCommandsLength; ++i) {\n boundingVolume = boundingVolumes[i];\n command = ignoreShowCommands[i];\n updateAndQueueRenderCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n }\n }\n\n if (passes.pick) {\n const pickLength = pickCommands.length;\n const pickOffsets = primitive._pickOffsets;\n for (i = 0; i < pickLength; ++i) {\n const pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];\n boundingVolume = boundingVolumes[pickOffset.index];\n if (queueTerrainCommands) {\n command = pickCommands[i];\n updateAndQueuePickCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n );\n }\n if (queue3DTilesCommands) {\n command = pickCommands[i].derivedCommands.tileset;\n updateAndQueuePickCommand(\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n );\n }\n }\n }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n * @exception {DeveloperError} Not all of the geometry instances have the same color attribute.\n */\nClassificationPrimitive.prototype.update = function (frameState) {\n if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n return;\n }\n\n let appearance = this.appearance;\n if (defined(appearance) && defined(appearance.material)) {\n appearance.material.update(frameState.context);\n }\n\n const that = this;\n const primitiveOptions = this._primitiveOptions;\n\n if (!defined(this._primitive)) {\n const instances = Array.isArray(this.geometryInstances)\n ? this.geometryInstances\n : [this.geometryInstances];\n const length = instances.length;\n\n let i;\n let instance;\n let attributes;\n\n let hasPerColorAttribute = false;\n let allColorsSame = true;\n let firstColor;\n let hasSphericalExtentsAttribute = false;\n let hasPlanarExtentsAttributes = false;\n\n if (length > 0) {\n attributes = instances[0].attributes;\n // Not expecting these to be set by users, should only be set via GroundPrimitive.\n // So don't check for mismatch.\n hasSphericalExtentsAttribute = ShadowVolumeAppearance.hasAttributesForSphericalExtents(\n attributes\n );\n hasPlanarExtentsAttributes = ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes(\n attributes\n );\n firstColor = attributes.color;\n }\n\n for (i = 0; i < length; i++) {\n instance = instances[i];\n const color = instance.attributes.color;\n if (defined(color)) {\n hasPerColorAttribute = true;\n }\n allColorsSame =\n allColorsSame &&\n defined(color) &&\n ColorGeometryInstanceAttribute.equals(firstColor, color);\n }\n\n // If no attributes exist for computing spherical extents or fragment culling,\n // throw if the colors aren't all the same.\n if (\n !allColorsSame &&\n !hasSphericalExtentsAttribute &&\n !hasPlanarExtentsAttributes\n ) {\n throw new DeveloperError(\n \"All GeometryInstances must have the same color attribute except via GroundPrimitives\"\n );\n }\n\n // default to a color appearance\n if (hasPerColorAttribute && !defined(appearance)) {\n appearance = new PerInstanceColorAppearance({\n flat: true,\n });\n this.appearance = appearance;\n }\n\n this._usePickOffsets =\n !hasSphericalExtentsAttribute && !hasPlanarExtentsAttributes;\n this._hasSphericalExtentsAttribute = hasSphericalExtentsAttribute;\n this._hasPlanarExtentsAttributes = hasPlanarExtentsAttributes;\n this._hasPerColorAttribute = hasPerColorAttribute;\n\n const geometryInstances = new Array(length);\n for (i = 0; i < length; ++i) {\n instance = instances[i];\n geometryInstances[i] = new GeometryInstance({\n geometry: instance.geometry,\n attributes: instance.attributes,\n modelMatrix: instance.modelMatrix,\n id: instance.id,\n pickPrimitive: defaultValue(this._pickPrimitive, that),\n });\n }\n\n primitiveOptions.appearance = appearance;\n primitiveOptions.geometryInstances = geometryInstances;\n\n if (defined(this._createBoundingVolumeFunction)) {\n primitiveOptions._createBoundingVolumeFunction = function (\n frameState,\n geometry\n ) {\n that._createBoundingVolumeFunction(frameState, geometry);\n };\n }\n\n primitiveOptions._createRenderStatesFunction = function (\n primitive,\n context,\n appearance,\n twoPasses\n ) {\n createRenderStates(that, context);\n };\n primitiveOptions._createShaderProgramFunction = function (\n primitive,\n frameState,\n appearance\n ) {\n createShaderProgram(that, frameState);\n };\n primitiveOptions._createCommandsFunction = function (\n primitive,\n appearance,\n material,\n translucent,\n twoPasses,\n colorCommands,\n pickCommands\n ) {\n createCommands(\n that,\n undefined,\n undefined,\n true,\n false,\n colorCommands,\n pickCommands\n );\n };\n\n if (defined(this._updateAndQueueCommandsFunction)) {\n primitiveOptions._updateAndQueueCommandsFunction = function (\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n ) {\n that._updateAndQueueCommandsFunction(\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n );\n };\n } else {\n primitiveOptions._updateAndQueueCommandsFunction = function (\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n ) {\n updateAndQueueCommands(\n that,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n );\n };\n }\n\n this._primitive = new Primitive(primitiveOptions);\n }\n\n if (\n this.debugShowShadowVolume &&\n !this._debugShowShadowVolume &&\n this._ready\n ) {\n this._debugShowShadowVolume = true;\n this._rsStencilDepthPass = RenderState.fromCache(\n getStencilDepthRenderState(false, false)\n );\n this._rsStencilDepthPass3DTiles = RenderState.fromCache(\n getStencilDepthRenderState(false, true)\n );\n this._rsColorPass = RenderState.fromCache(getColorRenderState(false));\n } else if (!this.debugShowShadowVolume && this._debugShowShadowVolume) {\n this._debugShowShadowVolume = false;\n this._rsStencilDepthPass = RenderState.fromCache(\n getStencilDepthRenderState(true, false)\n );\n this._rsStencilDepthPass3DTiles = RenderState.fromCache(\n getStencilDepthRenderState(true, true)\n );\n this._rsColorPass = RenderState.fromCache(getColorRenderState(true));\n }\n // Update primitive appearance\n if (this._primitive.appearance !== appearance) {\nthis._primitive.appearance = appearance;\n }\n\n this._primitive.show = this.show;\n this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n this._primitive.update(frameState);\n\n frameState.afterRender.push(() => {\n if (defined(this._primitive) && this._primitive.ready) {\n this._completeLoad();\n }\n });\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {Object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nClassificationPrimitive.prototype.getGeometryInstanceAttributes = function (\n id\n) {\nreturn this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ClassificationPrimitive#destroy\n */\nClassificationPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see ClassificationPrimitive#isDestroyed\n */\nClassificationPrimitive.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n this._sp = this._sp && this._sp.destroy();\n this._spPick = this._spPick && this._spPick.destroy();\n this._spColor = this._spColor && this._spColor.destroy();\n\n // Derived programs, destroyed above if they existed.\n this._spPick2D = undefined;\n this._spColor2D = undefined;\n return destroyObject(this);\n};\nexport default ClassificationPrimitive;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TerrainExaggeration from \"../Core/TerrainExaggeration.js\";\nimport ClassificationPrimitive from \"./ClassificationPrimitive.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowVolumeAppearance from \"./ShadowVolumeAppearance.js\";\n\nconst GroundPrimitiveUniformMap = {\n u_globeMinimumAltitude: function () {\n return 55000.0;\n },\n};\n\n/**\n * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.\n * <p>\n * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including\n * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,\n * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix\n * and match most of them and add a new geometry or appearance independently of each other.\n * </p>\n * <p>\n * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors\n * or materials besides PerInstanceColorAppearance.\n * </p>\n * <p>\n * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping\n * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.\n * </p>\n * <p>\n * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there\n * will be rendering artifacts for some viewing angles.\n * </p>\n * <p>\n * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.\n * </p>\n *\n * @alias GroundPrimitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] The geometry instances to render.\n * @param {Appearance} [options.appearance] The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Boolean} [options.vertexCacheOptimize=false] When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n * @param {Boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {Boolean} [options.compressVertices=true] When <code>true</code>, the geometry vertices are compressed, which will save memory.\n * @param {Boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {Boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n * @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on\n * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.\n *\n * @example\n * // Example 1: Create primitive with a single instance\n * const rectangleInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.RectangleGeometry({\n * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)\n * }),\n * id : 'rectangle',\n * attributes : {\n * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)\n * }\n * });\n * scene.primitives.add(new Cesium.GroundPrimitive({\n * geometryInstances : rectangleInstance\n * }));\n *\n * // Example 2: Batch instances\n * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.\n * const rectangleInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.RectangleGeometry({\n * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)\n * }),\n * id : 'rectangle',\n * attributes : {\n * color : color\n * }\n * });\n * const ellipseInstance = new Cesium.GeometryInstance({\n * geometry : new Cesium.EllipseGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),\n * semiMinorAxis : 300000.0,\n * semiMajorAxis : 400000.0\n * }),\n * id : 'ellipse',\n * attributes : {\n * color : color\n * }\n * });\n * scene.primitives.add(new Cesium.GroundPrimitive({\n * geometryInstances : [rectangleInstance, ellipseInstance]\n * }));\n *\n * @see Primitive\n * @see ClassificationPrimitive\n * @see GeometryInstance\n * @see Appearance\n */\nfunction GroundPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let appearance = options.appearance;\n const geometryInstances = options.geometryInstances;\n if (!defined(appearance) && defined(geometryInstances)) {\n const geometryInstancesArray = Array.isArray(geometryInstances)\n ? geometryInstances\n : [geometryInstances];\n const geometryInstanceCount = geometryInstancesArray.length;\n for (let i = 0; i < geometryInstanceCount; i++) {\n const attributes = geometryInstancesArray[i].attributes;\n if (defined(attributes) && defined(attributes.color)) {\n appearance = new PerInstanceColorAppearance({\n flat: true,\n });\n break;\n }\n }\n }\n /**\n * The {@link Appearance} used to shade this primitive. Each geometry\n * instance is shaded with the same appearance. Some appearances, like\n * {@link PerInstanceColorAppearance} allow giving each instance unique\n * properties.\n *\n * @type Appearance\n *\n * @default undefined\n */\n this.appearance = appearance;\n\n /**\n * The geometry instances rendered with this primitive. This may\n * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n * is <code>true</code> when the primitive is constructed.\n * <p>\n * Changing this property after the primitive is rendered has no effect.\n * </p>\n *\n * @readonly\n * @type {Array|GeometryInstance}\n *\n * @default undefined\n */\n this.geometryInstances = options.geometryInstances;\n /**\n * Determines if the primitive will be shown. This affects all geometry\n * instances in the primitive.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.show = defaultValue(options.show, true);\n /**\n * Determines whether terrain, 3D Tiles or both will be classified.\n *\n * @type {ClassificationType}\n *\n * @default ClassificationType.BOTH\n */\n this.classificationType = defaultValue(\n options.classificationType,\n ClassificationType.BOTH\n );\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the shadow volume for each geometry in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowShadowVolume = defaultValue(\n options.debugShowShadowVolume,\n false\n );\n\n this._boundingVolumes = [];\n this._boundingVolumes2D = [];\n\n this._ready = false;\n\n const groundPrimitive = this;\n this._readyPromise = new Promise((resolve, reject) => {\n groundPrimitive._completeLoad = () => {\n if (this._ready) {\n return;\n }\n\n this._ready = true;\n\n if (this.releaseGeometryInstances) {\n this.geometryInstances = undefined;\n }\n\n const error = this._error;\n if (!defined(error)) {\n resolve(this);\n } else {\n reject(error);\n }\n };\n });\n\n this._primitive = undefined;\n\n this._maxHeight = undefined;\n this._minHeight = undefined;\n\n this._maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n this._minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\n\n this._boundingSpheresKeys = [];\n this._boundingSpheres = [];\n\n this._useFragmentCulling = false;\n // Used when inserting in an OrderedPrimitiveCollection\n this._zIndex = undefined;\n\n const that = this;\n this._classificationPrimitiveOptions = {\n geometryInstances: undefined,\n appearance: undefined,\n vertexCacheOptimize: defaultValue(options.vertexCacheOptimize, false),\n interleave: defaultValue(options.interleave, false),\n releaseGeometryInstances: defaultValue(\n options.releaseGeometryInstances,\n true\n ),\n allowPicking: defaultValue(options.allowPicking, true),\n asynchronous: defaultValue(options.asynchronous, true),\n compressVertices: defaultValue(options.compressVertices, true),\n _createBoundingVolumeFunction: undefined,\n _updateAndQueueCommandsFunction: undefined,\n _pickPrimitive: that,\n _extruded: true,\n _uniformMap: GroundPrimitiveUniformMap,\n };\n}\n\nObject.defineProperties(GroundPrimitive.prototype, {\n /**\n * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n vertexCacheOptimize: {\n get: function () {\n return this._classificationPrimitiveOptions.vertexCacheOptimize;\n },\n },\n\n /**\n * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n interleave: {\n get: function () {\n return this._classificationPrimitiveOptions.interleave;\n },\n },\n\n /**\n * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n releaseGeometryInstances: {\n get: function () {\n return this._classificationPrimitiveOptions.releaseGeometryInstances;\n },\n },\n\n /**\n * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n allowPicking: {\n get: function () {\n return this._classificationPrimitiveOptions.allowPicking;\n },\n },\n\n /**\n * Determines if the geometry instances will be created and batched on a web worker.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n asynchronous: {\n get: function () {\n return this._classificationPrimitiveOptions.asynchronous;\n },\n },\n\n /**\n * When <code>true</code>, geometry vertices are compressed, which will save memory.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n compressVertices: {\n get: function () {\n return this._classificationPrimitiveOptions.compressVertices;\n },\n },\n\n /**\n * Determines if the primitive is complete and ready to render. If this property is\n * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}\n * is called.\n *\n * @memberof GroundPrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof GroundPrimitive.prototype\n * @type {Promise.<GroundPrimitive>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\n/**\n * Determines if GroundPrimitive rendering is supported.\n *\n * @function\n * @param {Scene} scene The scene.\n * @returns {Boolean} <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>\n */\nGroundPrimitive.isSupported = ClassificationPrimitive.isSupported;\n\nfunction getComputeMaximumHeightFunction(primitive) {\n return function (granularity, ellipsoid) {\n const r = ellipsoid.maximumRadius;\n const delta = r / Math.cos(granularity * 0.5) - r;\n return primitive._maxHeight + delta;\n };\n}\n\nfunction getComputeMinimumHeightFunction(primitive) {\n return function (granularity, ellipsoid) {\n return primitive._minHeight;\n };\n}\n\nconst scratchBVCartesianHigh = new Cartesian3();\nconst scratchBVCartesianLow = new Cartesian3();\nconst scratchBVCartesian = new Cartesian3();\nconst scratchBVCartographic = new Cartographic();\nconst scratchBVRectangle = new Rectangle();\n\nfunction getRectangle(frameState, geometry) {\n const ellipsoid = frameState.mapProjection.ellipsoid;\n\n if (\n !defined(geometry.attributes) ||\n !defined(geometry.attributes.position3DHigh)\n ) {\n if (defined(geometry.rectangle)) {\n return geometry.rectangle;\n }\n\n return undefined;\n }\n\n const highPositions = geometry.attributes.position3DHigh.values;\n const lowPositions = geometry.attributes.position3DLow.values;\n const length = highPositions.length;\n\n let minLat = Number.POSITIVE_INFINITY;\n let minLon = Number.POSITIVE_INFINITY;\n let maxLat = Number.NEGATIVE_INFINITY;\n let maxLon = Number.NEGATIVE_INFINITY;\n\n for (let i = 0; i < length; i += 3) {\n const highPosition = Cartesian3.unpack(\n highPositions,\n i,\n scratchBVCartesianHigh\n );\n const lowPosition = Cartesian3.unpack(\n lowPositions,\n i,\n scratchBVCartesianLow\n );\n\n const position = Cartesian3.add(\n highPosition,\n lowPosition,\n scratchBVCartesian\n );\n const cartographic = ellipsoid.cartesianToCartographic(\n position,\n scratchBVCartographic\n );\n\n const latitude = cartographic.latitude;\n const longitude = cartographic.longitude;\n\n minLat = Math.min(minLat, latitude);\n minLon = Math.min(minLon, longitude);\n maxLat = Math.max(maxLat, latitude);\n maxLon = Math.max(maxLon, longitude);\n }\n\n const rectangle = scratchBVRectangle;\n rectangle.north = maxLat;\n rectangle.south = minLat;\n rectangle.east = maxLon;\n rectangle.west = minLon;\n\n return rectangle;\n}\n\nfunction setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) {\n const result = ApproximateTerrainHeights.getMinimumMaximumHeights(\n rectangle,\n ellipsoid\n );\n\n primitive._minTerrainHeight = result.minimumTerrainHeight;\n primitive._maxTerrainHeight = result.maximumTerrainHeight;\n}\n\nfunction createBoundingVolume(groundPrimitive, frameState, geometry) {\n const ellipsoid = frameState.mapProjection.ellipsoid;\n const rectangle = getRectangle(frameState, geometry);\n\n const obb = OrientedBoundingBox.fromRectangle(\n rectangle,\n groundPrimitive._minHeight,\n groundPrimitive._maxHeight,\n ellipsoid\n );\n groundPrimitive._boundingVolumes.push(obb);\n\n if (!frameState.scene3DOnly) {\n const projection = frameState.mapProjection;\n const boundingVolume = BoundingSphere.fromRectangleWithHeights2D(\n rectangle,\n projection,\n groundPrimitive._maxHeight,\n groundPrimitive._minHeight\n );\n Cartesian3.fromElements(\n boundingVolume.center.z,\n boundingVolume.center.x,\n boundingVolume.center.y,\n boundingVolume.center\n );\n\n groundPrimitive._boundingVolumes2D.push(boundingVolume);\n }\n}\n\nfunction boundingVolumeIndex(commandIndex, length) {\n return Math.floor((commandIndex % length) / 2);\n}\n\nfunction updateAndQueueRenderCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n) {\n // Use derived appearance command for 2D if needed\n const classificationPrimitive = groundPrimitive._primitive;\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n command.shaderProgram === classificationPrimitive._spColor &&\n classificationPrimitive._needs2DShader\n ) {\n command = command.derivedCommands.appearance2D;\n }\n\n command.owner = groundPrimitive;\n command.modelMatrix = modelMatrix;\n command.boundingVolume = boundingVolume;\n command.cull = cull;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n frameState.commandList.push(command);\n}\n\nfunction updateAndQueuePickCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n) {\n // Use derived pick command for 2D if needed\n const classificationPrimitive = groundPrimitive._primitive;\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n command.shaderProgram === classificationPrimitive._spPick &&\n classificationPrimitive._needs2DShader\n ) {\n command = command.derivedCommands.pick2D;\n }\n\n command.owner = groundPrimitive;\n command.modelMatrix = modelMatrix;\n command.boundingVolume = boundingVolume;\n command.cull = cull;\n\n frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n groundPrimitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n) {\n let boundingVolumes;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingVolumes = groundPrimitive._boundingVolumes;\n } else {\n boundingVolumes = groundPrimitive._boundingVolumes2D;\n }\n\n const classificationType = groundPrimitive.classificationType;\n const queueTerrainCommands =\n classificationType !== ClassificationType.CESIUM_3D_TILE;\n const queue3DTilesCommands =\n classificationType !== ClassificationType.TERRAIN;\n\n const passes = frameState.passes;\n const classificationPrimitive = groundPrimitive._primitive;\n\n let i;\n let boundingVolume;\n let command;\n\n if (passes.render) {\n const colorLength = colorCommands.length;\n\n for (i = 0; i < colorLength; ++i) {\n boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];\n if (queueTerrainCommands) {\n command = colorCommands[i];\n updateAndQueueRenderCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n if (queue3DTilesCommands) {\n command = colorCommands[i].derivedCommands.tileset;\n updateAndQueueRenderCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n }\n\n if (frameState.invertClassification) {\n const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;\n const ignoreShowCommandsLength = ignoreShowCommands.length;\n for (i = 0; i < ignoreShowCommandsLength; ++i) {\n boundingVolume = boundingVolumes[i];\n command = ignoreShowCommands[i];\n updateAndQueueRenderCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n }\n }\n\n if (passes.pick) {\n const pickLength = pickCommands.length;\n\n let pickOffsets;\n if (!groundPrimitive._useFragmentCulling) {\n // Must be using pick offsets\n pickOffsets = classificationPrimitive._primitive._pickOffsets;\n }\n for (i = 0; i < pickLength; ++i) {\n boundingVolume = boundingVolumes[boundingVolumeIndex(i, pickLength)];\n if (!groundPrimitive._useFragmentCulling) {\n const pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];\n boundingVolume = boundingVolumes[pickOffset.index];\n }\n if (queueTerrainCommands) {\n command = pickCommands[i];\n updateAndQueuePickCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n );\n }\n if (queue3DTilesCommands) {\n command = pickCommands[i].derivedCommands.tileset;\n updateAndQueuePickCommand(\n groundPrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume\n );\n }\n }\n }\n}\n\n/**\n * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the\n * GroundPrimitive synchronously.\n *\n * @returns {Promise<void>} A promise that will resolve once the terrain heights have been loaded.\n *\n */\nGroundPrimitive.initializeTerrainHeights = function () {\n return ApproximateTerrainHeights.initialize();\n};\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} For synchronous GroundPrimitive, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\n * @exception {DeveloperError} Appearance and material have a uniform with the same name.\n */\nGroundPrimitive.prototype.update = function (frameState) {\n if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n return;\n }\n\n if (!ApproximateTerrainHeights.initialized) {\n GroundPrimitive.initializeTerrainHeights();\n return;\n }\n\n const that = this;\n const primitiveOptions = this._classificationPrimitiveOptions;\n\n if (!defined(this._primitive)) {\n const ellipsoid = frameState.mapProjection.ellipsoid;\n\n let instance;\n let geometry;\n let instanceType;\n\n const instances = Array.isArray(this.geometryInstances)\n ? this.geometryInstances\n : [this.geometryInstances];\n const length = instances.length;\n const groundInstances = new Array(length);\n\n let i;\n let rectangle;\n for (i = 0; i < length; ++i) {\n instance = instances[i];\n geometry = instance.geometry;\n const instanceRectangle = getRectangle(frameState, geometry);\n if (!defined(rectangle)) {\n rectangle = Rectangle.clone(instanceRectangle);\n } else if (defined(instanceRectangle)) {\n Rectangle.union(rectangle, instanceRectangle, rectangle);\n }\n\n const id = instance.id;\n if (defined(id) && defined(instanceRectangle)) {\n const boundingSphere = ApproximateTerrainHeights.getBoundingSphere(\n instanceRectangle,\n ellipsoid\n );\n this._boundingSpheresKeys.push(id);\n this._boundingSpheres.push(boundingSphere);\n }\n\n instanceType = geometry.constructor;\n if (!defined(instanceType) || !defined(instanceType.createShadowVolume)) {\n}\n }\n\n // Now compute the min/max heights for the primitive\n setMinMaxTerrainHeights(this, rectangle, ellipsoid);\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n this._minHeight = TerrainExaggeration.getHeight(\n this._minTerrainHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n this._maxHeight = TerrainExaggeration.getHeight(\n this._maxTerrainHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n\n const useFragmentCulling = GroundPrimitive._supportsMaterials(\n frameState.context\n );\n this._useFragmentCulling = useFragmentCulling;\n\n if (useFragmentCulling) {\n // Determine whether to add spherical or planar extent attributes for computing texture coordinates.\n // This depends on the size of the GeometryInstances.\n let attributes;\n let usePlanarExtents = true;\n for (i = 0; i < length; ++i) {\n instance = instances[i];\n geometry = instance.geometry;\n rectangle = getRectangle(frameState, geometry);\n if (ShadowVolumeAppearance.shouldUseSphericalCoordinates(rectangle)) {\n usePlanarExtents = false;\n break;\n }\n }\n\n for (i = 0; i < length; ++i) {\n instance = instances[i];\n geometry = instance.geometry;\n instanceType = geometry.constructor;\n\n const boundingRectangle = getRectangle(frameState, geometry);\n const textureCoordinateRotationPoints =\n geometry.textureCoordinateRotationPoints;\n\n if (usePlanarExtents) {\n attributes = ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes(\n boundingRectangle,\n textureCoordinateRotationPoints,\n ellipsoid,\n frameState.mapProjection,\n this._maxHeight\n );\n } else {\n attributes = ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes(\n boundingRectangle,\n textureCoordinateRotationPoints,\n ellipsoid,\n frameState.mapProjection\n );\n }\n\n const instanceAttributes = instance.attributes;\n for (const attributeKey in instanceAttributes) {\n if (instanceAttributes.hasOwnProperty(attributeKey)) {\n attributes[attributeKey] = instanceAttributes[attributeKey];\n }\n }\n\n groundInstances[i] = new GeometryInstance({\n geometry: instanceType.createShadowVolume(\n geometry,\n getComputeMinimumHeightFunction(this),\n getComputeMaximumHeightFunction(this)\n ),\n attributes: attributes,\n id: instance.id,\n });\n }\n } else {\n // ClassificationPrimitive will check if the colors are all the same if it detects lack of fragment culling attributes\n for (i = 0; i < length; ++i) {\n instance = instances[i];\n geometry = instance.geometry;\n instanceType = geometry.constructor;\n groundInstances[i] = new GeometryInstance({\n geometry: instanceType.createShadowVolume(\n geometry,\n getComputeMinimumHeightFunction(this),\n getComputeMaximumHeightFunction(this)\n ),\n attributes: instance.attributes,\n id: instance.id,\n });\n }\n }\n\n primitiveOptions.geometryInstances = groundInstances;\n primitiveOptions.appearance = this.appearance;\n\n primitiveOptions._createBoundingVolumeFunction = function (\n frameState,\n geometry\n ) {\n createBoundingVolume(that, frameState, geometry);\n };\n primitiveOptions._updateAndQueueCommandsFunction = function (\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n ) {\n updateAndQueueCommands(\n that,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n );\n };\n\n this._primitive = new ClassificationPrimitive(primitiveOptions);\n }\n\n this._primitive.appearance = this.appearance;\n this._primitive.show = this.show;\n this._primitive.debugShowShadowVolume = this.debugShowShadowVolume;\n this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n this._primitive.update(frameState);\n\n frameState.afterRender.push(() => {\n if (defined(this._primitive) && this._primitive.ready) {\n this._completeLoad();\n }\n });\n};\n\n/**\n * @private\n */\nGroundPrimitive.prototype.getBoundingSphere = function (id) {\n const index = this._boundingSpheresKeys.indexOf(id);\n if (index !== -1) {\n return this._boundingSpheres[index];\n }\n\n return undefined;\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {Object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nGroundPrimitive.prototype.getGeometryInstanceAttributes = function (id) {\nreturn this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see GroundPrimitive#destroy\n */\nGroundPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see GroundPrimitive#isDestroyed\n */\nGroundPrimitive.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n return destroyObject(this);\n};\n\n/**\n * Exposed for testing.\n *\n * @param {Context} context Rendering context\n * @returns {Boolean} Whether or not the current context supports materials on GroundPrimitives.\n * @private\n */\nGroundPrimitive._supportsMaterials = function (context) {\n return context.depthTexture;\n};\n\n/**\n * Checks if the given Scene supports materials on GroundPrimitives.\n * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.\n *\n * @param {Scene} scene The current scene.\n * @returns {Boolean} Whether or not the current scene supports materials on GroundPrimitives.\n */\nGroundPrimitive.supportsMaterials = function (scene) {\n return GroundPrimitive._supportsMaterials(scene.frameState.context);\n};\nexport default GroundPrimitive;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Material from \"../Scene/Material.js\";\n\n/**\n * The interface for all {@link Property} objects that represent {@link Material} uniforms.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias MaterialProperty\n * @constructor\n * @abstract\n *\n * @see ColorMaterialProperty\n * @see CompositeMaterialProperty\n * @see GridMaterialProperty\n * @see ImageMaterialProperty\n * @see PolylineGlowMaterialProperty\n * @see PolylineOutlineMaterialProperty\n * @see StripeMaterialProperty\n */\nfunction MaterialProperty() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(MaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof MaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof MaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nMaterialProperty.prototype.getType = DeveloperError.throwInstantiationError;\n\n/**\n * Gets the value of the property at the provided time.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nMaterialProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nMaterialProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\n/**\n * @private\n */\nMaterialProperty.getValue = function (time, materialProperty, material) {\n let type;\n\n if (defined(materialProperty)) {\n type = materialProperty.getType(time);\n if (defined(type)) {\n if (!defined(material) || material.type !== type) {\n material = Material.fromType(type);\n }\n materialProperty.getValue(time, material.uniforms);\n return material;\n }\n }\n\n if (!defined(material) || material.type !== Material.ColorType) {\n material = Material.fromType(Material.ColorType);\n }\n Color.clone(Color.WHITE, material.uniforms.color);\n\n return material;\n};\nexport default MaterialProperty;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * Defines the interface for a dynamic geometry updater. A DynamicGeometryUpdater\n * is responsible for handling visualization of a specific type of geometry\n * that needs to be recomputed based on simulation time.\n * This object is never used directly by client code, but is instead created by\n * {@link GeometryUpdater} implementations which contain dynamic geometry.\n *\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias DynamicGeometryUpdater\n * @constructor\n * @private\n * @abstract\n */\nfunction DynamicGeometryUpdater(\n geometryUpdater,\n primitives,\n orderedGroundPrimitives\n) {\n this._primitives = primitives;\n this._orderedGroundPrimitives = orderedGroundPrimitives;\n this._primitive = undefined;\n this._outlinePrimitive = undefined;\n this._geometryUpdater = geometryUpdater;\n this._options = geometryUpdater._options;\n this._entity = geometryUpdater._entity;\n this._material = undefined;\n}\n\nDynamicGeometryUpdater.prototype._isHidden = function (entity, geometry, time) {\n return (\n !entity.isShowing ||\n !entity.isAvailable(time) ||\n !Property.getValueOrDefault(geometry.show, time, true)\n );\n};\n\nDynamicGeometryUpdater.prototype._setOptions =\n DeveloperError.throwInstantiationError;\n\n/**\n * Updates the geometry to the specified time.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @param {JulianDate} time The current time.\n */\nDynamicGeometryUpdater.prototype.update = function (time) {\n const geometryUpdater = this._geometryUpdater;\n const onTerrain = geometryUpdater._onTerrain;\n\n const primitives = this._primitives;\n const orderedGroundPrimitives = this._orderedGroundPrimitives;\n if (onTerrain) {\n orderedGroundPrimitives.remove(this._primitive);\n } else {\n primitives.removeAndDestroy(this._primitive);\n primitives.removeAndDestroy(this._outlinePrimitive);\n this._outlinePrimitive = undefined;\n }\n this._primitive = undefined;\n\n const entity = this._entity;\n const geometry = entity[this._geometryUpdater._geometryPropertyName];\n this._setOptions(entity, geometry, time);\n if (this._isHidden(entity, geometry, time)) {\n return;\n }\n\n const shadows = this._geometryUpdater.shadowsProperty.getValue(time);\n const options = this._options;\n if (!defined(geometry.fill) || geometry.fill.getValue(time)) {\n const fillMaterialProperty = geometryUpdater.fillMaterialProperty;\n const isColorAppearance =\n fillMaterialProperty instanceof ColorMaterialProperty;\n let appearance;\n const closed = geometryUpdater._getIsClosed(options);\n if (isColorAppearance) {\n appearance = new PerInstanceColorAppearance({\n closed: closed,\n flat:\n onTerrain && !geometryUpdater._supportsMaterialsforEntitiesOnTerrain,\n });\n } else {\n const material = MaterialProperty.getValue(\n time,\n fillMaterialProperty,\n this._material\n );\n this._material = material;\n appearance = new MaterialAppearance({\n material: material,\n translucent: material.isTranslucent(),\n closed: closed,\n });\n }\n\n if (onTerrain) {\n options.vertexFormat = PerInstanceColorAppearance.VERTEX_FORMAT;\n this._primitive = orderedGroundPrimitives.add(\n new GroundPrimitive({\n geometryInstances: this._geometryUpdater.createFillGeometryInstance(\n time\n ),\n appearance: appearance,\n asynchronous: false,\n shadows: shadows,\n classificationType: this._geometryUpdater.classificationTypeProperty.getValue(\n time\n ),\n }),\n Property.getValueOrUndefined(this._geometryUpdater.zIndex, time)\n );\n } else {\n options.vertexFormat = appearance.vertexFormat;\n\n const fillInstance = this._geometryUpdater.createFillGeometryInstance(\n time\n );\n\n if (isColorAppearance) {\n appearance.translucent = fillInstance.attributes.color.value[3] !== 255;\n }\n\n this._primitive = primitives.add(\n new Primitive({\n geometryInstances: fillInstance,\n appearance: appearance,\n asynchronous: false,\n shadows: shadows,\n })\n );\n }\n }\n\n if (\n !onTerrain &&\n defined(geometry.outline) &&\n geometry.outline.getValue(time)\n ) {\n const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(\n time\n );\n const outlineWidth = Property.getValueOrDefault(\n geometry.outlineWidth,\n time,\n 1.0\n );\n\n this._outlinePrimitive = primitives.add(\n new Primitive({\n geometryInstances: outlineInstance,\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: outlineInstance.attributes.color.value[3] !== 255,\n renderState: {\n lineWidth: geometryUpdater._scene.clampLineWidth(outlineWidth),\n },\n }),\n asynchronous: false,\n shadows: shadows,\n })\n );\n }\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n * @function\n *\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nDynamicGeometryUpdater.prototype.getBoundingSphere = function (result) {\nconst entity = this._entity;\n const primitive = this._primitive;\n const outlinePrimitive = this._outlinePrimitive;\n\n let attributes;\n\n //Outline and Fill geometries have the same bounding sphere, so just use whichever one is defined and ready\n if (defined(primitive) && primitive.show && primitive.ready) {\n attributes = primitive.getGeometryInstanceAttributes(entity);\n if (defined(attributes) && defined(attributes.boundingSphere)) {\n BoundingSphere.clone(attributes.boundingSphere, result);\n return BoundingSphereState.DONE;\n }\n }\n\n if (\n defined(outlinePrimitive) &&\n outlinePrimitive.show &&\n outlinePrimitive.ready\n ) {\n attributes = outlinePrimitive.getGeometryInstanceAttributes(entity);\n if (defined(attributes) && defined(attributes.boundingSphere)) {\n BoundingSphere.clone(attributes.boundingSphere, result);\n return BoundingSphereState.DONE;\n }\n }\n\n if (\n (defined(primitive) && !primitive.ready) ||\n (defined(outlinePrimitive) && !outlinePrimitive.ready)\n ) {\n return BoundingSphereState.PENDING;\n }\n\n return BoundingSphereState.FAILED;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nDynamicGeometryUpdater.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys and resources used by the object. Once an object is destroyed, it should not be used.\n * @memberof DynamicGeometryUpdater\n * @function\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDynamicGeometryUpdater.prototype.destroy = function () {\n const primitives = this._primitives;\n const orderedGroundPrimitives = this._orderedGroundPrimitives;\n if (this._geometryUpdater._onTerrain) {\n orderedGroundPrimitives.remove(this._primitive);\n } else {\n primitives.removeAndDestroy(this._primitive);\n }\n primitives.removeAndDestroy(this._outlinePrimitive);\n destroyObject(this);\n};\nexport default DynamicGeometryUpdater;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst warnings = {};\n\n/**\n * Logs a one time message to the console. Use this function instead of\n * <code>console.log</code> directly since this does not log duplicate messages\n * unless it is called from multiple workers.\n *\n * @function oneTimeWarning\n *\n * @param {String} identifier The unique identifier for this warning.\n * @param {String} [message=identifier] The message to log to the console.\n *\n * @example\n * for(let i=0;i<foo.length;++i) {\n * if (!defined(foo[i].bar)) {\n * // Something that can be recovered from but may happen a lot\n * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.');\n * foo[i].bar = 0;\n * // ...\n * }\n * }\n *\n * @private\n */\nfunction oneTimeWarning(identifier, message) {\n if (!defined(warnings[identifier])) {\n warnings[identifier] = true;\n console.warn(defaultValue(message, identifier));\n }\n}\n\noneTimeWarning.geometryOutlines =\n \"Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.\";\n\noneTimeWarning.geometryZIndex =\n \"Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored\";\n\noneTimeWarning.geometryHeightReference =\n \"Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored\";\noneTimeWarning.geometryExtrudedHeightReference =\n \"Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored\";\nexport default oneTimeWarning;\n", "/**\n * ArcType defines the path that should be taken connecting vertices.\n *\n * @enum {Number}\n */\nconst ArcType = {\n /**\n * Straight line that does not conform to the surface of the ellipsoid.\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * Follow geodesic path.\n *\n * @type {Number}\n * @constant\n */\n GEODESIC: 1,\n\n /**\n * Follow rhumb or loxodrome path.\n *\n * @type {Number}\n * @constant\n */\n RHUMB: 2,\n};\nexport default Object.freeze(ArcType);\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst removeDuplicatesEpsilon = CesiumMath.EPSILON10;\n\n/**\n * Removes adjacent duplicate values in an array of values.\n *\n * @param {Array.<*>} [values] The array of values.\n * @param {Function} equalsEpsilon Function to compare values with an epsilon. Boolean equalsEpsilon(left, right, epsilon).\n * @param {Boolean} [wrapAround=false] Compare the last value in the array against the first value. If they are equal, the last value is removed.\n * @param {Array.<Number>} [removedIndices=undefined] Store the indices that correspond to the duplicate items removed from the array, if there were any.\n * @returns {Array.<*>|undefined} A new array of values with no adjacent duplicate values or the input array if no duplicates were found.\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0), (1.0, 1.0, 1.0)]\n * const values = [\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon);\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\n * const values = [\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\n *\n * @example\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\n * // removedIndices will be equal to [1, 3, 5]\n * const values = [\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\n * @private\n */\nfunction arrayRemoveDuplicates(\n values,\n equalsEpsilon,\n wrapAround,\n removedIndices\n) {\n if (!defined(values)) {\n return undefined;\n }\n\n wrapAround = defaultValue(wrapAround, false);\n const storeRemovedIndices = defined(removedIndices);\n\n const length = values.length;\n if (length < 2) {\n return values;\n }\n\n let i;\n let v0 = values[0];\n let v1;\n\n // We only want to create a new array if there are duplicates in the array.\n // As such, cleanedValues is undefined until it encounters the first duplicate, if it exists.\n let cleanedValues;\n let lastCleanIndex = 0;\n\n // removedIndexLCI keeps track of where lastCleanIndex would be if it were sorted into the removedIndices array.\n // In case of arrays such as [A, B, C, ..., A, A, A], removedIndices will not be sorted properly without this.\n let removedIndexLCI = -1;\n\n for (i = 1; i < length; ++i) {\n v1 = values[i];\n if (equalsEpsilon(v0, v1, removeDuplicatesEpsilon)) {\n if (!defined(cleanedValues)) {\n cleanedValues = values.slice(0, i);\n lastCleanIndex = i - 1;\n removedIndexLCI = 0;\n }\n if (storeRemovedIndices) {\n removedIndices.push(i);\n }\n } else {\n if (defined(cleanedValues)) {\n cleanedValues.push(v1);\n lastCleanIndex = i;\n if (storeRemovedIndices) {\n removedIndexLCI = removedIndices.length;\n }\n }\n v0 = v1;\n }\n }\n\n if (\n wrapAround &&\n equalsEpsilon(values[0], values[length - 1], removeDuplicatesEpsilon)\n ) {\n if (storeRemovedIndices) {\n if (defined(cleanedValues)) {\n removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);\n } else {\n removedIndices.push(length - 1);\n }\n }\n\n if (defined(cleanedValues)) {\n cleanedValues.length -= 1;\n } else {\n cleanedValues = values.slice(0, -1);\n }\n }\n\n return defined(cleanedValues) ? cleanedValues : values;\n}\n\nexport default arrayRemoveDuplicates;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction setConstants(ellipsoidGeodesic) {\n const uSquared = ellipsoidGeodesic._uSquared;\n const a = ellipsoidGeodesic._ellipsoid.maximumRadius;\n const b = ellipsoidGeodesic._ellipsoid.minimumRadius;\n const f = (a - b) / a;\n\n const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);\n const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);\n\n const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);\n\n const cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);\n const sineU = cosineU * tanU;\n\n const sigma = Math.atan2(tanU, cosineHeading);\n\n const sineAlpha = cosineU * sineHeading;\n const sineSquaredAlpha = sineAlpha * sineAlpha;\n\n const cosineSquaredAlpha = 1.0 - sineSquaredAlpha;\n const cosineAlpha = Math.sqrt(cosineSquaredAlpha);\n\n const u2Over4 = uSquared / 4.0;\n const u4Over16 = u2Over4 * u2Over4;\n const u6Over64 = u4Over16 * u2Over4;\n const u8Over256 = u4Over16 * u4Over16;\n\n const a0 =\n 1.0 +\n u2Over4 -\n (3.0 * u4Over16) / 4.0 +\n (5.0 * u6Over64) / 4.0 -\n (175.0 * u8Over256) / 64.0;\n const a1 = 1.0 - u2Over4 + (15.0 * u4Over16) / 8.0 - (35.0 * u6Over64) / 8.0;\n const a2 = 1.0 - 3.0 * u2Over4 + (35.0 * u4Over16) / 4.0;\n const a3 = 1.0 - 5.0 * u2Over4;\n\n const distanceRatio =\n a0 * sigma -\n (a1 * Math.sin(2.0 * sigma) * u2Over4) / 2.0 -\n (a2 * Math.sin(4.0 * sigma) * u4Over16) / 16.0 -\n (a3 * Math.sin(6.0 * sigma) * u6Over64) / 48.0 -\n (Math.sin(8.0 * sigma) * 5.0 * u8Over256) / 512;\n\n const constants = ellipsoidGeodesic._constants;\n\n constants.a = a;\n constants.b = b;\n constants.f = f;\n constants.cosineHeading = cosineHeading;\n constants.sineHeading = sineHeading;\n constants.tanU = tanU;\n constants.cosineU = cosineU;\n constants.sineU = sineU;\n constants.sigma = sigma;\n constants.sineAlpha = sineAlpha;\n constants.sineSquaredAlpha = sineSquaredAlpha;\n constants.cosineSquaredAlpha = cosineSquaredAlpha;\n constants.cosineAlpha = cosineAlpha;\n constants.u2Over4 = u2Over4;\n constants.u4Over16 = u4Over16;\n constants.u6Over64 = u6Over64;\n constants.u8Over256 = u8Over256;\n constants.a0 = a0;\n constants.a1 = a1;\n constants.a2 = a2;\n constants.a3 = a3;\n constants.distanceRatio = distanceRatio;\n}\n\nfunction computeC(f, cosineSquaredAlpha) {\n return (\n (f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha))) /\n 16.0\n );\n}\n\nfunction computeDeltaLambda(\n f,\n sineAlpha,\n cosineSquaredAlpha,\n sigma,\n sineSigma,\n cosineSigma,\n cosineTwiceSigmaMidpoint\n) {\n const C = computeC(f, cosineSquaredAlpha);\n\n return (\n (1.0 - C) *\n f *\n sineAlpha *\n (sigma +\n C *\n sineSigma *\n (cosineTwiceSigmaMidpoint +\n C *\n cosineSigma *\n (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)))\n );\n}\n\nfunction vincentyInverseFormula(\n ellipsoidGeodesic,\n major,\n minor,\n firstLongitude,\n firstLatitude,\n secondLongitude,\n secondLatitude\n) {\n const eff = (major - minor) / major;\n const l = secondLongitude - firstLongitude;\n\n const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));\n const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));\n\n const cosineU1 = Math.cos(u1);\n const sineU1 = Math.sin(u1);\n const cosineU2 = Math.cos(u2);\n const sineU2 = Math.sin(u2);\n\n const cc = cosineU1 * cosineU2;\n const cs = cosineU1 * sineU2;\n const ss = sineU1 * sineU2;\n const sc = sineU1 * cosineU2;\n\n let lambda = l;\n let lambdaDot = CesiumMath.TWO_PI;\n\n let cosineLambda = Math.cos(lambda);\n let sineLambda = Math.sin(lambda);\n\n let sigma;\n let cosineSigma;\n let sineSigma;\n let cosineSquaredAlpha;\n let cosineTwiceSigmaMidpoint;\n\n do {\n cosineLambda = Math.cos(lambda);\n sineLambda = Math.sin(lambda);\n\n const temp = cs - sc * cosineLambda;\n sineSigma = Math.sqrt(\n cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp\n );\n cosineSigma = ss + cc * cosineLambda;\n\n sigma = Math.atan2(sineSigma, cosineSigma);\n\n let sineAlpha;\n\n if (sineSigma === 0.0) {\n sineAlpha = 0.0;\n cosineSquaredAlpha = 1.0;\n } else {\n sineAlpha = (cc * sineLambda) / sineSigma;\n cosineSquaredAlpha = 1.0 - sineAlpha * sineAlpha;\n }\n\n lambdaDot = lambda;\n\n cosineTwiceSigmaMidpoint = cosineSigma - (2.0 * ss) / cosineSquaredAlpha;\n\n if (!isFinite(cosineTwiceSigmaMidpoint)) {\n cosineTwiceSigmaMidpoint = 0.0;\n }\n\n lambda =\n l +\n computeDeltaLambda(\n eff,\n sineAlpha,\n cosineSquaredAlpha,\n sigma,\n sineSigma,\n cosineSigma,\n cosineTwiceSigmaMidpoint\n );\n } while (Math.abs(lambda - lambdaDot) > CesiumMath.EPSILON12);\n\n const uSquared =\n (cosineSquaredAlpha * (major * major - minor * minor)) / (minor * minor);\n const A =\n 1.0 +\n (uSquared *\n (4096.0 + uSquared * (uSquared * (320.0 - 175.0 * uSquared) - 768.0))) /\n 16384.0;\n const B =\n (uSquared *\n (256.0 + uSquared * (uSquared * (74.0 - 47.0 * uSquared) - 128.0))) /\n 1024.0;\n\n const cosineSquaredTwiceSigmaMidpoint =\n cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;\n const deltaSigma =\n B *\n sineSigma *\n (cosineTwiceSigmaMidpoint +\n (B *\n (cosineSigma * (2.0 * cosineSquaredTwiceSigmaMidpoint - 1.0) -\n (B *\n cosineTwiceSigmaMidpoint *\n (4.0 * sineSigma * sineSigma - 3.0) *\n (4.0 * cosineSquaredTwiceSigmaMidpoint - 3.0)) /\n 6.0)) /\n 4.0);\n\n const distance = minor * A * (sigma - deltaSigma);\n\n const startHeading = Math.atan2(\n cosineU2 * sineLambda,\n cs - sc * cosineLambda\n );\n const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);\n\n ellipsoidGeodesic._distance = distance;\n ellipsoidGeodesic._startHeading = startHeading;\n ellipsoidGeodesic._endHeading = endHeading;\n ellipsoidGeodesic._uSquared = uSquared;\n}\n\nconst scratchCart1 = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\nfunction computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {\n const firstCartesian = Cartesian3.normalize(\n ellipsoid.cartographicToCartesian(start, scratchCart2),\n scratchCart1\n );\n const lastCartesian = Cartesian3.normalize(\n ellipsoid.cartographicToCartesian(end, scratchCart2),\n scratchCart2\n );\n\n vincentyInverseFormula(\n ellipsoidGeodesic,\n ellipsoid.maximumRadius,\n ellipsoid.minimumRadius,\n start.longitude,\n start.latitude,\n end.longitude,\n end.latitude\n );\n\n ellipsoidGeodesic._start = Cartographic.clone(\n start,\n ellipsoidGeodesic._start\n );\n ellipsoidGeodesic._end = Cartographic.clone(end, ellipsoidGeodesic._end);\n ellipsoidGeodesic._start.height = 0;\n ellipsoidGeodesic._end.height = 0;\n\n setConstants(ellipsoidGeodesic);\n}\n\n/**\n * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.\n *\n * @alias EllipsoidGeodesic\n * @constructor\n *\n * @param {Cartographic} [start] The initial planetodetic point on the path.\n * @param {Cartographic} [end] The final planetodetic point on the path.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.\n */\nfunction EllipsoidGeodesic(start, end, ellipsoid) {\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n this._ellipsoid = e;\n this._start = new Cartographic();\n this._end = new Cartographic();\n\n this._constants = {};\n this._startHeading = undefined;\n this._endHeading = undefined;\n this._distance = undefined;\n this._uSquared = undefined;\n\n if (defined(start) && defined(end)) {\n computeProperties(this, start, end, e);\n }\n}\n\nObject.defineProperties(EllipsoidGeodesic.prototype, {\n /**\n * Gets the ellipsoid.\n * @memberof EllipsoidGeodesic.prototype\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the surface distance between the start and end point\n * @memberof EllipsoidGeodesic.prototype\n * @type {Number}\n * @readonly\n */\n surfaceDistance: {\n get: function () {\n return this._distance;\n },\n },\n\n /**\n * Gets the initial planetodetic point on the path.\n * @memberof EllipsoidGeodesic.prototype\n * @type {Cartographic}\n * @readonly\n */\n start: {\n get: function () {\n return this._start;\n },\n },\n\n /**\n * Gets the final planetodetic point on the path.\n * @memberof EllipsoidGeodesic.prototype\n * @type {Cartographic}\n * @readonly\n */\n end: {\n get: function () {\n return this._end;\n },\n },\n\n /**\n * Gets the heading at the initial point.\n * @memberof EllipsoidGeodesic.prototype\n * @type {Number}\n * @readonly\n */\n startHeading: {\n get: function () {\n return this._startHeading;\n },\n },\n\n /**\n * Gets the heading at the final point.\n * @memberof EllipsoidGeodesic.prototype\n * @type {Number}\n * @readonly\n */\n endHeading: {\n get: function () {\n return this._endHeading;\n },\n },\n});\n\n/**\n * Sets the start and end points of the geodesic\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {Cartographic} end The final planetodetic point on the path.\n */\nEllipsoidGeodesic.prototype.setEndPoints = function (start, end) {\n computeProperties(this, start, end, this._ellipsoid);\n};\n\n/**\n * Provides the location of a point at the indicated portion along the geodesic.\n *\n * @param {Number} fraction The portion of the distance between the initial and final points.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the geodesic.\n */\nEllipsoidGeodesic.prototype.interpolateUsingFraction = function (\n fraction,\n result\n) {\n return this.interpolateUsingSurfaceDistance(\n this._distance * fraction,\n result\n );\n};\n\n/**\n * Provides the location of a point at the indicated distance along the geodesic.\n *\n * @param {Number} distance The distance from the inital point to the point of interest along the geodesic\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the geodesic.\n *\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\n */\nEllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function (\n distance,\n result\n) {\n const constants = this._constants;\n\n const s = constants.distanceRatio + distance / constants.b;\n\n const cosine2S = Math.cos(2.0 * s);\n const cosine4S = Math.cos(4.0 * s);\n const cosine6S = Math.cos(6.0 * s);\n const sine2S = Math.sin(2.0 * s);\n const sine4S = Math.sin(4.0 * s);\n const sine6S = Math.sin(6.0 * s);\n const sine8S = Math.sin(8.0 * s);\n\n const s2 = s * s;\n const s3 = s * s2;\n\n const u8Over256 = constants.u8Over256;\n const u2Over4 = constants.u2Over4;\n const u6Over64 = constants.u6Over64;\n const u4Over16 = constants.u4Over16;\n let sigma =\n (2.0 * s3 * u8Over256 * cosine2S) / 3.0 +\n s *\n (1.0 -\n u2Over4 +\n (7.0 * u4Over16) / 4.0 -\n (15.0 * u6Over64) / 4.0 +\n (579.0 * u8Over256) / 64.0 -\n (u4Over16 - (15.0 * u6Over64) / 4.0 + (187.0 * u8Over256) / 16.0) *\n cosine2S -\n ((5.0 * u6Over64) / 4.0 - (115.0 * u8Over256) / 16.0) * cosine4S -\n (29.0 * u8Over256 * cosine6S) / 16.0) +\n (u2Over4 / 2.0 -\n u4Over16 +\n (71.0 * u6Over64) / 32.0 -\n (85.0 * u8Over256) / 16.0) *\n sine2S +\n ((5.0 * u4Over16) / 16.0 -\n (5.0 * u6Over64) / 4.0 +\n (383.0 * u8Over256) / 96.0) *\n sine4S -\n s2 *\n ((u6Over64 - (11.0 * u8Over256) / 2.0) * sine2S +\n (5.0 * u8Over256 * sine4S) / 2.0) +\n ((29.0 * u6Over64) / 96.0 - (29.0 * u8Over256) / 16.0) * sine6S +\n (539.0 * u8Over256 * sine8S) / 1536.0;\n\n const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);\n const latitude = Math.atan((constants.a / constants.b) * Math.tan(theta));\n\n // Redefine in terms of relative argument of latitude.\n sigma = sigma - constants.sigma;\n\n const cosineTwiceSigmaMidpoint = Math.cos(2.0 * constants.sigma + sigma);\n\n const sineSigma = Math.sin(sigma);\n const cosineSigma = Math.cos(sigma);\n\n const cc = constants.cosineU * cosineSigma;\n const ss = constants.sineU * sineSigma;\n\n const lambda = Math.atan2(\n sineSigma * constants.sineHeading,\n cc - ss * constants.cosineHeading\n );\n\n const l =\n lambda -\n computeDeltaLambda(\n constants.f,\n constants.sineAlpha,\n constants.cosineSquaredAlpha,\n sigma,\n sineSigma,\n cosineSigma,\n cosineTwiceSigmaMidpoint\n );\n\n if (defined(result)) {\n result.longitude = this._start.longitude + l;\n result.latitude = latitude;\n result.height = 0.0;\n return result;\n }\n\n return new Cartographic(this._start.longitude + l, latitude, 0.0);\n};\nexport default EllipsoidGeodesic;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\n\nfunction calculateM(ellipticity, major, latitude) {\n if (ellipticity === 0.0) {\n // sphere\n return major * latitude;\n }\n\n const e2 = ellipticity * ellipticity;\n const e4 = e2 * e2;\n const e6 = e4 * e2;\n const e8 = e6 * e2;\n const e10 = e8 * e2;\n const e12 = e10 * e2;\n const phi = latitude;\n const sin2Phi = Math.sin(2 * phi);\n const sin4Phi = Math.sin(4 * phi);\n const sin6Phi = Math.sin(6 * phi);\n const sin8Phi = Math.sin(8 * phi);\n const sin10Phi = Math.sin(10 * phi);\n const sin12Phi = Math.sin(12 * phi);\n\n return (\n major *\n ((1 -\n e2 / 4 -\n (3 * e4) / 64 -\n (5 * e6) / 256 -\n (175 * e8) / 16384 -\n (441 * e10) / 65536 -\n (4851 * e12) / 1048576) *\n phi -\n ((3 * e2) / 8 +\n (3 * e4) / 32 +\n (45 * e6) / 1024 +\n (105 * e8) / 4096 +\n (2205 * e10) / 131072 +\n (6237 * e12) / 524288) *\n sin2Phi +\n ((15 * e4) / 256 +\n (45 * e6) / 1024 +\n (525 * e8) / 16384 +\n (1575 * e10) / 65536 +\n (155925 * e12) / 8388608) *\n sin4Phi -\n ((35 * e6) / 3072 +\n (175 * e8) / 12288 +\n (3675 * e10) / 262144 +\n (13475 * e12) / 1048576) *\n sin6Phi +\n ((315 * e8) / 131072 + (2205 * e10) / 524288 + (43659 * e12) / 8388608) *\n sin8Phi -\n ((693 * e10) / 1310720 + (6237 * e12) / 5242880) * sin10Phi +\n ((1001 * e12) / 8388608) * sin12Phi)\n );\n}\n\nfunction calculateInverseM(M, ellipticity, major) {\n const d = M / major;\n\n if (ellipticity === 0.0) {\n // sphere\n return d;\n }\n\n const d2 = d * d;\n const d3 = d2 * d;\n const d4 = d3 * d;\n const e = ellipticity;\n const e2 = e * e;\n const e4 = e2 * e2;\n const e6 = e4 * e2;\n const e8 = e6 * e2;\n const e10 = e8 * e2;\n const e12 = e10 * e2;\n const sin2D = Math.sin(2 * d);\n const cos2D = Math.cos(2 * d);\n const sin4D = Math.sin(4 * d);\n const cos4D = Math.cos(4 * d);\n const sin6D = Math.sin(6 * d);\n const cos6D = Math.cos(6 * d);\n const sin8D = Math.sin(8 * d);\n const cos8D = Math.cos(8 * d);\n const sin10D = Math.sin(10 * d);\n const cos10D = Math.cos(10 * d);\n const sin12D = Math.sin(12 * d);\n\n return (\n d +\n (d * e2) / 4 +\n (7 * d * e4) / 64 +\n (15 * d * e6) / 256 +\n (579 * d * e8) / 16384 +\n (1515 * d * e10) / 65536 +\n (16837 * d * e12) / 1048576 +\n ((3 * d * e4) / 16 +\n (45 * d * e6) / 256 -\n (d * (32 * d2 - 561) * e8) / 4096 -\n (d * (232 * d2 - 1677) * e10) / 16384 +\n (d * (399985 - 90560 * d2 + 512 * d4) * e12) / 5242880) *\n cos2D +\n ((21 * d * e6) / 256 +\n (483 * d * e8) / 4096 -\n (d * (224 * d2 - 1969) * e10) / 16384 -\n (d * (33152 * d2 - 112599) * e12) / 1048576) *\n cos4D +\n ((151 * d * e8) / 4096 +\n (4681 * d * e10) / 65536 +\n (1479 * d * e12) / 16384 -\n (453 * d3 * e12) / 32768) *\n cos6D +\n ((1097 * d * e10) / 65536 + (42783 * d * e12) / 1048576) * cos8D +\n ((8011 * d * e12) / 1048576) * cos10D +\n ((3 * e2) / 8 +\n (3 * e4) / 16 +\n (213 * e6) / 2048 -\n (3 * d2 * e6) / 64 +\n (255 * e8) / 4096 -\n (33 * d2 * e8) / 512 +\n (20861 * e10) / 524288 -\n (33 * d2 * e10) / 512 +\n (d4 * e10) / 1024 +\n (28273 * e12) / 1048576 -\n (471 * d2 * e12) / 8192 +\n (9 * d4 * e12) / 4096) *\n sin2D +\n ((21 * e4) / 256 +\n (21 * e6) / 256 +\n (533 * e8) / 8192 -\n (21 * d2 * e8) / 512 +\n (197 * e10) / 4096 -\n (315 * d2 * e10) / 4096 +\n (584039 * e12) / 16777216 -\n (12517 * d2 * e12) / 131072 +\n (7 * d4 * e12) / 2048) *\n sin4D +\n ((151 * e6) / 6144 +\n (151 * e8) / 4096 +\n (5019 * e10) / 131072 -\n (453 * d2 * e10) / 16384 +\n (26965 * e12) / 786432 -\n (8607 * d2 * e12) / 131072) *\n sin6D +\n ((1097 * e8) / 131072 +\n (1097 * e10) / 65536 +\n (225797 * e12) / 10485760 -\n (1097 * d2 * e12) / 65536) *\n sin8D +\n ((8011 * e10) / 2621440 + (8011 * e12) / 1048576) * sin10D +\n ((293393 * e12) / 251658240) * sin12D\n );\n}\n\nfunction calculateSigma(ellipticity, latitude) {\n if (ellipticity === 0.0) {\n // sphere\n return Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude)));\n }\n\n const eSinL = ellipticity * Math.sin(latitude);\n return (\n Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude))) -\n (ellipticity / 2.0) * Math.log((1 + eSinL) / (1 - eSinL))\n );\n}\n\nfunction calculateHeading(\n ellipsoidRhumbLine,\n firstLongitude,\n firstLatitude,\n secondLongitude,\n secondLatitude\n) {\n const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);\n const sigma2 = calculateSigma(\n ellipsoidRhumbLine._ellipticity,\n secondLatitude\n );\n return Math.atan2(\n CesiumMath.negativePiToPi(secondLongitude - firstLongitude),\n sigma2 - sigma1\n );\n}\n\nfunction calculateArcLength(\n ellipsoidRhumbLine,\n major,\n minor,\n firstLongitude,\n firstLatitude,\n secondLongitude,\n secondLatitude\n) {\n const heading = ellipsoidRhumbLine._heading;\n const deltaLongitude = secondLongitude - firstLongitude;\n\n let distance = 0.0;\n\n //Check to see if the rhumb line has constant latitude\n //This equation will diverge if heading gets close to 90 degrees\n if (\n CesiumMath.equalsEpsilon(\n Math.abs(heading),\n CesiumMath.PI_OVER_TWO,\n CesiumMath.EPSILON8\n )\n ) {\n //If heading is close to 90 degrees\n if (major === minor) {\n distance =\n major *\n Math.cos(firstLatitude) *\n CesiumMath.negativePiToPi(deltaLongitude);\n } else {\n const sinPhi = Math.sin(firstLatitude);\n distance =\n (major *\n Math.cos(firstLatitude) *\n CesiumMath.negativePiToPi(deltaLongitude)) /\n Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);\n }\n } else {\n const M1 = calculateM(\n ellipsoidRhumbLine._ellipticity,\n major,\n firstLatitude\n );\n const M2 = calculateM(\n ellipsoidRhumbLine._ellipticity,\n major,\n secondLatitude\n );\n\n distance = (M2 - M1) / Math.cos(heading);\n }\n return Math.abs(distance);\n}\n\nconst scratchCart1 = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\n\nfunction computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {\n const firstCartesian = Cartesian3.normalize(\n ellipsoid.cartographicToCartesian(start, scratchCart2),\n scratchCart1\n );\n const lastCartesian = Cartesian3.normalize(\n ellipsoid.cartographicToCartesian(end, scratchCart2),\n scratchCart2\n );\n\n const major = ellipsoid.maximumRadius;\n const minor = ellipsoid.minimumRadius;\n const majorSquared = major * major;\n const minorSquared = minor * minor;\n ellipsoidRhumbLine._ellipticitySquared =\n (majorSquared - minorSquared) / majorSquared;\n ellipsoidRhumbLine._ellipticity = Math.sqrt(\n ellipsoidRhumbLine._ellipticitySquared\n );\n\n ellipsoidRhumbLine._start = Cartographic.clone(\n start,\n ellipsoidRhumbLine._start\n );\n ellipsoidRhumbLine._start.height = 0;\n\n ellipsoidRhumbLine._end = Cartographic.clone(end, ellipsoidRhumbLine._end);\n ellipsoidRhumbLine._end.height = 0;\n\n ellipsoidRhumbLine._heading = calculateHeading(\n ellipsoidRhumbLine,\n start.longitude,\n start.latitude,\n end.longitude,\n end.latitude\n );\n ellipsoidRhumbLine._distance = calculateArcLength(\n ellipsoidRhumbLine,\n ellipsoid.maximumRadius,\n ellipsoid.minimumRadius,\n start.longitude,\n start.latitude,\n end.longitude,\n end.latitude\n );\n}\n\nfunction interpolateUsingSurfaceDistance(\n start,\n heading,\n distance,\n major,\n ellipticity,\n result\n) {\n if (distance === 0.0) {\n return Cartographic.clone(start, result);\n }\n\n const ellipticitySquared = ellipticity * ellipticity;\n\n let longitude;\n let latitude;\n let deltaLongitude;\n\n //Check to see if the rhumb line has constant latitude\n //This won't converge if heading is close to 90 degrees\n if (\n Math.abs(CesiumMath.PI_OVER_TWO - Math.abs(heading)) > CesiumMath.EPSILON8\n ) {\n //Calculate latitude of the second point\n const M1 = calculateM(ellipticity, major, start.latitude);\n const deltaM = distance * Math.cos(heading);\n const M2 = M1 + deltaM;\n latitude = calculateInverseM(M2, ellipticity, major);\n\n //Now find the longitude of the second point\n const sigma1 = calculateSigma(ellipticity, start.latitude);\n const sigma2 = calculateSigma(ellipticity, latitude);\n deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\n longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n } else {\n //If heading is close to 90 degrees\n latitude = start.latitude;\n let localRad;\n\n if (ellipticity === 0.0) {\n // sphere\n localRad = major * Math.cos(start.latitude);\n } else {\n const sinPhi = Math.sin(start.latitude);\n localRad =\n (major * Math.cos(start.latitude)) /\n Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);\n }\n\n deltaLongitude = distance / localRad;\n if (heading > 0.0) {\n longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n } else {\n longitude = CesiumMath.negativePiToPi(start.longitude - deltaLongitude);\n }\n }\n\n if (defined(result)) {\n result.longitude = longitude;\n result.latitude = latitude;\n result.height = 0;\n\n return result;\n }\n\n return new Cartographic(longitude, latitude, 0);\n}\n\n/**\n * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.\n *\n * @alias EllipsoidRhumbLine\n * @constructor\n *\n * @param {Cartographic} [start] The initial planetodetic point on the path.\n * @param {Cartographic} [end] The final planetodetic point on the path.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\n *\n * @exception {DeveloperError} angle between start and end must be at least 0.0125 radians.\n */\nfunction EllipsoidRhumbLine(start, end, ellipsoid) {\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n this._ellipsoid = e;\n this._start = new Cartographic();\n this._end = new Cartographic();\n\n this._heading = undefined;\n this._distance = undefined;\n this._ellipticity = undefined;\n this._ellipticitySquared = undefined;\n\n if (defined(start) && defined(end)) {\n computeProperties(this, start, end, e);\n }\n}\n\nObject.defineProperties(EllipsoidRhumbLine.prototype, {\n /**\n * Gets the ellipsoid.\n * @memberof EllipsoidRhumbLine.prototype\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the surface distance between the start and end point\n * @memberof EllipsoidRhumbLine.prototype\n * @type {Number}\n * @readonly\n */\n surfaceDistance: {\n get: function () {\n return this._distance;\n },\n },\n\n /**\n * Gets the initial planetodetic point on the path.\n * @memberof EllipsoidRhumbLine.prototype\n * @type {Cartographic}\n * @readonly\n */\n start: {\n get: function () {\n return this._start;\n },\n },\n\n /**\n * Gets the final planetodetic point on the path.\n * @memberof EllipsoidRhumbLine.prototype\n * @type {Cartographic}\n * @readonly\n */\n end: {\n get: function () {\n return this._end;\n },\n },\n\n /**\n * Gets the heading from the start point to the end point.\n * @memberof EllipsoidRhumbLine.prototype\n * @type {Number}\n * @readonly\n */\n heading: {\n get: function () {\n return this._heading;\n },\n },\n});\n\n/**\n * Create a rhumb line using an initial position with a heading and distance.\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {Number} heading The heading in radians.\n * @param {Number} distance The rhumb line distance between the start and end point.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\n * @param {EllipsoidRhumbLine} [result] The object in which to store the result.\n * @returns {EllipsoidRhumbLine} The EllipsoidRhumbLine object.\n */\nEllipsoidRhumbLine.fromStartHeadingDistance = function (\n start,\n heading,\n distance,\n ellipsoid,\n result\n) {\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\n const major = e.maximumRadius;\n const minor = e.minimumRadius;\n const majorSquared = major * major;\n const minorSquared = minor * minor;\n const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);\n\n heading = CesiumMath.negativePiToPi(heading);\n const end = interpolateUsingSurfaceDistance(\n start,\n heading,\n distance,\n e.maximumRadius,\n ellipticity\n );\n\n if (\n !defined(result) ||\n (defined(ellipsoid) && !ellipsoid.equals(result.ellipsoid))\n ) {\n return new EllipsoidRhumbLine(start, end, e);\n }\n\n result.setEndPoints(start, end);\n return result;\n};\n\n/**\n * Sets the start and end points of the rhumb line.\n *\n * @param {Cartographic} start The initial planetodetic point on the path.\n * @param {Cartographic} end The final planetodetic point on the path.\n */\nEllipsoidRhumbLine.prototype.setEndPoints = function (start, end) {\n computeProperties(this, start, end, this._ellipsoid);\n};\n\n/**\n * Provides the location of a point at the indicated portion along the rhumb line.\n *\n * @param {Number} fraction The portion of the distance between the initial and final points.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the rhumb line.\n */\nEllipsoidRhumbLine.prototype.interpolateUsingFraction = function (\n fraction,\n result\n) {\n return this.interpolateUsingSurfaceDistance(\n fraction * this._distance,\n result\n );\n};\n\n/**\n * Provides the location of a point at the indicated distance along the rhumb line.\n *\n * @param {Number} distance The distance from the inital point to the point of interest along the rhumbLine.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the point along the rhumb line.\n *\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\n */\nEllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function (\n distance,\n result\n) {\n return interpolateUsingSurfaceDistance(\n this._start,\n this._heading,\n distance,\n this._ellipsoid.maximumRadius,\n this._ellipticity,\n result\n );\n};\n\n/**\n * Provides the location of a point at the indicated longitude along the rhumb line.\n * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\n *\n * @param {Number} intersectionLongitude The longitude, in radians, at which to find the intersection point from the starting point using the heading.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\n *\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\n */\nEllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function (\n intersectionLongitude,\n result\n) {\n const ellipticity = this._ellipticity;\n const heading = this._heading;\n const absHeading = Math.abs(heading);\n const start = this._start;\n\n intersectionLongitude = CesiumMath.negativePiToPi(intersectionLongitude);\n\n if (\n CesiumMath.equalsEpsilon(\n Math.abs(intersectionLongitude),\n Math.PI,\n CesiumMath.EPSILON14\n )\n ) {\n intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI;\n }\n\n if (!defined(result)) {\n result = new Cartographic();\n }\n\n // If heading is -PI/2 or PI/2, this is an E-W rhumb line\n // If heading is 0 or PI, this is an N-S rhumb line\n if (Math.abs(CesiumMath.PI_OVER_TWO - absHeading) <= CesiumMath.EPSILON8) {\n result.longitude = intersectionLongitude;\n result.latitude = start.latitude;\n result.height = 0;\n return result;\n } else if (\n CesiumMath.equalsEpsilon(\n Math.abs(CesiumMath.PI_OVER_TWO - absHeading),\n CesiumMath.PI_OVER_TWO,\n CesiumMath.EPSILON8\n )\n ) {\n if (\n CesiumMath.equalsEpsilon(\n intersectionLongitude,\n start.longitude,\n CesiumMath.EPSILON12\n )\n ) {\n return undefined;\n }\n\n result.longitude = intersectionLongitude;\n result.latitude =\n CesiumMath.PI_OVER_TWO *\n CesiumMath.sign(CesiumMath.PI_OVER_TWO - heading);\n result.height = 0;\n return result;\n }\n\n // Use iterative solver from Equation 9 from http://edwilliams.org/ellipsoid/ellipsoid.pdf\n const phi1 = start.latitude;\n const eSinPhi1 = ellipticity * Math.sin(phi1);\n const leftComponent =\n Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + phi1)) *\n Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));\n const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);\n\n let newPhi = start.latitude;\n let phi;\n do {\n phi = newPhi;\n const eSinPhi = ellipticity * Math.sin(phi);\n const numerator = (1 + eSinPhi) / (1 - eSinPhi);\n newPhi =\n 2 *\n Math.atan(\n leftComponent * Math.pow(numerator / denominator, ellipticity / 2)\n ) -\n CesiumMath.PI_OVER_TWO;\n } while (!CesiumMath.equalsEpsilon(newPhi, phi, CesiumMath.EPSILON12));\n\n result.longitude = intersectionLongitude;\n result.latitude = newPhi;\n result.height = 0;\n return result;\n};\n\n/**\n * Provides the location of a point at the indicated latitude along the rhumb line.\n * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\n *\n * @param {Number} intersectionLatitude The latitude, in radians, at which to find the intersection point from the starting point using the heading.\n * @param {Cartographic} [result] The object in which to store the result.\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\n *\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\n */\nEllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function (\n intersectionLatitude,\n result\n) {\n const ellipticity = this._ellipticity;\n const heading = this._heading;\n const start = this._start;\n\n // If start and end have same latitude, return undefined since it's either no intersection or infinite intersections\n if (\n CesiumMath.equalsEpsilon(\n Math.abs(heading),\n CesiumMath.PI_OVER_TWO,\n CesiumMath.EPSILON8\n )\n ) {\n return;\n }\n\n // Can be solved using the same equations from interpolateUsingSurfaceDistance\n const sigma1 = calculateSigma(ellipticity, start.latitude);\n const sigma2 = calculateSigma(ellipticity, intersectionLatitude);\n const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\n const longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\n\n if (defined(result)) {\n result.longitude = longitude;\n result.latitude = intersectionLatitude;\n result.height = 0;\n\n return result;\n }\n\n return new Cartographic(longitude, intersectionLatitude, 0);\n};\nexport default EllipsoidRhumbLine;\n", "import ApproximateTerrainHeights from \"./ApproximateTerrainHeights.js\";\nimport ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Plane from \"./Plane.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\nconst PROJECTIONS = [GeographicProjection, WebMercatorProjection];\nconst PROJECTION_COUNT = PROJECTIONS.length;\n\nconst MITER_BREAK_SMALL = Math.cos(CesiumMath.toRadians(30.0));\nconst MITER_BREAK_LARGE = Math.cos(CesiumMath.toRadians(150.0));\n\n// Initial heights for constructing the wall.\n// Keeping WALL_INITIAL_MIN_HEIGHT near the ellipsoid surface helps\n// prevent precision problems with planes in the shader.\n// Putting the start point of a plane at ApproximateTerrainHeights._defaultMinTerrainHeight,\n// which is a highly conservative bound, usually puts the plane origin several thousands\n// of meters away from the actual terrain, causing floating point problems when checking\n// fragments on terrain against the plane.\n// Ellipsoid height is generally much closer.\n// The initial max height is arbitrary.\n// Both heights are corrected using ApproximateTerrainHeights for computing the actual volume geometry.\nconst WALL_INITIAL_MIN_HEIGHT = 0.0;\nconst WALL_INITIAL_MAX_HEIGHT = 1000.0;\n\n/**\n * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.\n *\n * @alias GroundPolylineGeometry\n * @constructor\n *\n * @param {Object} options Options with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.\n * @param {Number} [options.width=1.0] The screen space width in pixels.\n * @param {Number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.\n * @param {Boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n *\n * @exception {DeveloperError} At least two positions are required.\n *\n * @see GroundPolylinePrimitive\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n * -112.1340164450331, 36.05494287836128,\n * -112.08821010582645, 36.097804071380715,\n * -112.13296079730024, 36.168769146801104\n * ]);\n *\n * const geometry = new Cesium.GroundPolylineGeometry({\n * positions : positions\n * });\n */\nfunction GroundPolylineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n\n /**\n * The screen space width in pixels.\n * @type {Number}\n */\n this.width = defaultValue(options.width, 1.0); // Doesn't get packed, not necessary for computing geometry.\n\n this._positions = positions;\n\n /**\n * The distance interval used for interpolating options.points. Zero indicates no interpolation.\n * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.\n * @type {Boolean}\n * @default 9999.0\n */\n this.granularity = defaultValue(options.granularity, 9999.0);\n\n /**\n * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\n * If the geometry has two positions this parameter will be ignored.\n * @type {Boolean}\n * @default false\n */\n this.loop = defaultValue(options.loop, false);\n\n /**\n * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @type {ArcType}\n * @default ArcType.GEODESIC\n */\n this.arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n this._ellipsoid = Ellipsoid.WGS84;\n\n // MapProjections can't be packed, so store the index to a known MapProjection.\n this._projectionIndex = 0;\n this._workerName = \"createGroundPolylineGeometry\";\n\n // Used by GroundPolylinePrimitive to signal worker that scenemode is 3D only.\n this._scene3DOnly = false;\n}\n\nObject.defineProperties(GroundPolylineGeometry.prototype, {\n /**\n * The number of elements used to pack the object into an array.\n * @memberof GroundPolylineGeometry.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n packedLength: {\n get: function () {\n return (\n 1.0 +\n this._positions.length * 3 +\n 1.0 +\n 1.0 +\n 1.0 +\n Ellipsoid.packedLength +\n 1.0 +\n 1.0\n );\n },\n },\n});\n\n/**\n * Set the GroundPolylineGeometry's projection and ellipsoid.\n * Used by GroundPolylinePrimitive to signal scene information to the geometry for generating 2D attributes.\n *\n * @param {GroundPolylineGeometry} groundPolylineGeometry GroundPolylinGeometry describing a polyline on terrain or 3D Tiles.\n * @param {Projection} mapProjection A MapProjection used for projecting cartographic coordinates to 2D.\n * @private\n */\nGroundPolylineGeometry.setProjectionAndEllipsoid = function (\n groundPolylineGeometry,\n mapProjection\n) {\n let projectionIndex = 0;\n for (let i = 0; i < PROJECTION_COUNT; i++) {\n if (mapProjection instanceof PROJECTIONS[i]) {\n projectionIndex = i;\n break;\n }\n }\n\n groundPolylineGeometry._projectionIndex = projectionIndex;\n groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;\n};\n\nconst cart3Scratch1 = new Cartesian3();\nconst cart3Scratch2 = new Cartesian3();\nconst cart3Scratch3 = new Cartesian3();\nfunction computeRightNormal(start, end, maxHeight, ellipsoid, result) {\n const startBottom = getPosition(ellipsoid, start, 0.0, cart3Scratch1);\n const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);\n const endBottom = getPosition(ellipsoid, end, 0.0, cart3Scratch3);\n\n const up = direction(startTop, startBottom, cart3Scratch2);\n const forward = direction(endBottom, startBottom, cart3Scratch3);\n\n Cartesian3.cross(forward, up, result);\n return Cartesian3.normalize(result, result);\n}\n\nconst interpolatedCartographicScratch = new Cartographic();\nconst interpolatedBottomScratch = new Cartesian3();\nconst interpolatedTopScratch = new Cartesian3();\nconst interpolatedNormalScratch = new Cartesian3();\nfunction interpolateSegment(\n start,\n end,\n minHeight,\n maxHeight,\n granularity,\n arcType,\n ellipsoid,\n normalsArray,\n bottomPositionsArray,\n topPositionsArray,\n cartographicsArray\n) {\n if (granularity === 0.0) {\n return;\n }\n\n let ellipsoidLine;\n if (arcType === ArcType.GEODESIC) {\n ellipsoidLine = new EllipsoidGeodesic(start, end, ellipsoid);\n } else if (arcType === ArcType.RHUMB) {\n ellipsoidLine = new EllipsoidRhumbLine(start, end, ellipsoid);\n }\n\n const surfaceDistance = ellipsoidLine.surfaceDistance;\n if (surfaceDistance < granularity) {\n return;\n }\n\n // Compute rightwards normal applicable at all interpolated points\n const interpolatedNormal = computeRightNormal(\n start,\n end,\n maxHeight,\n ellipsoid,\n interpolatedNormalScratch\n );\n\n const segments = Math.ceil(surfaceDistance / granularity);\n const interpointDistance = surfaceDistance / segments;\n let distanceFromStart = interpointDistance;\n const pointsToAdd = segments - 1;\n let packIndex = normalsArray.length;\n for (let i = 0; i < pointsToAdd; i++) {\n const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(\n distanceFromStart,\n interpolatedCartographicScratch\n );\n const interpolatedBottom = getPosition(\n ellipsoid,\n interpolatedCartographic,\n minHeight,\n interpolatedBottomScratch\n );\n const interpolatedTop = getPosition(\n ellipsoid,\n interpolatedCartographic,\n maxHeight,\n interpolatedTopScratch\n );\n\n Cartesian3.pack(interpolatedNormal, normalsArray, packIndex);\n Cartesian3.pack(interpolatedBottom, bottomPositionsArray, packIndex);\n Cartesian3.pack(interpolatedTop, topPositionsArray, packIndex);\n cartographicsArray.push(interpolatedCartographic.latitude);\n cartographicsArray.push(interpolatedCartographic.longitude);\n\n packIndex += 3;\n distanceFromStart += interpointDistance;\n }\n}\n\nconst heightlessCartographicScratch = new Cartographic();\nfunction getPosition(ellipsoid, cartographic, height, result) {\n Cartographic.clone(cartographic, heightlessCartographicScratch);\n heightlessCartographicScratch.height = height;\n return Cartographic.toCartesian(\n heightlessCartographicScratch,\n ellipsoid,\n result\n );\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nGroundPolylineGeometry.pack = function (value, array, startingIndex) {\n let index = defaultValue(startingIndex, 0);\n\n const positions = value._positions;\n const positionsLength = positions.length;\n\n array[index++] = positionsLength;\n\n for (let i = 0; i < positionsLength; ++i) {\n const cartesian = positions[i];\n Cartesian3.pack(cartesian, array, index);\n index += 3;\n }\n\n array[index++] = value.granularity;\n array[index++] = value.loop ? 1.0 : 0.0;\n array[index++] = value.arcType;\n\n Ellipsoid.pack(value._ellipsoid, array, index);\n index += Ellipsoid.packedLength;\n\n array[index++] = value._projectionIndex;\n array[index++] = value._scene3DOnly ? 1.0 : 0.0;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonGeometry} [result] The object into which to store the result.\n */\nGroundPolylineGeometry.unpack = function (array, startingIndex, result) {\n let index = defaultValue(startingIndex, 0);\n const positionsLength = array[index++];\n const positions = new Array(positionsLength);\n\n for (let i = 0; i < positionsLength; i++) {\n positions[i] = Cartesian3.unpack(array, index);\n index += 3;\n }\n\n const granularity = array[index++];\n const loop = array[index++] === 1.0;\n const arcType = array[index++];\n\n const ellipsoid = Ellipsoid.unpack(array, index);\n index += Ellipsoid.packedLength;\n\n const projectionIndex = array[index++];\n const scene3DOnly = array[index++] === 1.0;\n\n if (!defined(result)) {\n result = new GroundPolylineGeometry({\n positions: positions,\n });\n }\n\n result._positions = positions;\n result.granularity = granularity;\n result.loop = loop;\n result.arcType = arcType;\n result._ellipsoid = ellipsoid;\n result._projectionIndex = projectionIndex;\n result._scene3DOnly = scene3DOnly;\n\n return result;\n};\n\nfunction direction(target, origin, result) {\n Cartesian3.subtract(target, origin, result);\n Cartesian3.normalize(result, result);\n return result;\n}\n\nfunction tangentDirection(target, origin, up, result) {\n result = direction(target, origin, result);\n\n // orthogonalize\n result = Cartesian3.cross(result, up, result);\n result = Cartesian3.normalize(result, result);\n result = Cartesian3.cross(up, result, result);\n return result;\n}\n\nconst toPreviousScratch = new Cartesian3();\nconst toNextScratch = new Cartesian3();\nconst forwardScratch = new Cartesian3();\nconst vertexUpScratch = new Cartesian3();\nconst cosine90 = 0.0;\nconst cosine180 = -1.0;\nfunction computeVertexMiterNormal(\n previousBottom,\n vertexBottom,\n vertexTop,\n nextBottom,\n result\n) {\n const up = direction(vertexTop, vertexBottom, vertexUpScratch);\n\n // Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid\n const toPrevious = tangentDirection(\n previousBottom,\n vertexBottom,\n up,\n toPreviousScratch\n );\n const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);\n\n // Check if tangents are almost opposite - if so, no need to miter.\n if (\n CesiumMath.equalsEpsilon(\n Cartesian3.dot(toPrevious, toNext),\n cosine180,\n CesiumMath.EPSILON5\n )\n ) {\n result = Cartesian3.cross(up, toPrevious, result);\n result = Cartesian3.normalize(result, result);\n return result;\n }\n\n // Average directions to previous and to next in the plane of Up\n result = Cartesian3.add(toNext, toPrevious, result);\n result = Cartesian3.normalize(result, result);\n\n // Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more \"backwards\")\n const forward = Cartesian3.cross(up, result, forwardScratch);\n if (Cartesian3.dot(toNext, forward) < cosine90) {\n result = Cartesian3.negate(result, result);\n }\n\n return result;\n}\n\nconst XZ_PLANE = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\n\nconst previousBottomScratch = new Cartesian3();\nconst vertexBottomScratch = new Cartesian3();\nconst vertexTopScratch = new Cartesian3();\nconst nextBottomScratch = new Cartesian3();\nconst vertexNormalScratch = new Cartesian3();\nconst intersectionScratch = new Cartesian3();\nconst cartographicScratch0 = new Cartographic();\nconst cartographicScratch1 = new Cartographic();\nconst cartographicIntersectionScratch = new Cartographic();\n/**\n * Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.\n * Vertices are \"fat,\" packing all the data needed in each volume to describe a line on terrain or 3D Tiles.\n * Should not be called independent of {@link GroundPolylinePrimitive}.\n *\n * @param {GroundPolylineGeometry} groundPolylineGeometry\n * @private\n */\nGroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) {\n const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;\n let loop = groundPolylineGeometry.loop;\n const ellipsoid = groundPolylineGeometry._ellipsoid;\n const granularity = groundPolylineGeometry.granularity;\n const arcType = groundPolylineGeometry.arcType;\n const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](\n ellipsoid\n );\n\n const minHeight = WALL_INITIAL_MIN_HEIGHT;\n const maxHeight = WALL_INITIAL_MAX_HEIGHT;\n\n let index;\n let i;\n\n const positions = groundPolylineGeometry._positions;\n const positionsLength = positions.length;\n\n if (positionsLength === 2) {\n loop = false;\n }\n\n // Split positions across the IDL and the Prime Meridian as well.\n // Split across prime meridian because very large geometries crossing the Prime Meridian but not the IDL\n // may get split by the plane of IDL + Prime Meridian.\n let p0;\n let p1;\n let c0;\n let c1;\n const rhumbLine = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n let intersection;\n let intersectionCartographic;\n let intersectionLongitude;\n const splitPositions = [positions[0]];\n for (i = 0; i < positionsLength - 1; i++) {\n p0 = positions[i];\n p1 = positions[i + 1];\n intersection = IntersectionTests.lineSegmentPlane(\n p0,\n p1,\n XZ_PLANE,\n intersectionScratch\n );\n if (\n defined(intersection) &&\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n ) {\n if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\n splitPositions.push(Cartesian3.clone(intersection));\n } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\n intersectionLongitude = ellipsoid.cartesianToCartographic(\n intersection,\n cartographicScratch0\n ).longitude;\n c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\n c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\n rhumbLine.setEndPoints(c0, c1);\n intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\n intersectionLongitude,\n cartographicIntersectionScratch\n );\n intersection = ellipsoid.cartographicToCartesian(\n intersectionCartographic,\n intersectionScratch\n );\n if (\n defined(intersection) &&\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n ) {\n splitPositions.push(Cartesian3.clone(intersection));\n }\n }\n }\n splitPositions.push(p1);\n }\n\n if (loop) {\n p0 = positions[positionsLength - 1];\n p1 = positions[0];\n intersection = IntersectionTests.lineSegmentPlane(\n p0,\n p1,\n XZ_PLANE,\n intersectionScratch\n );\n if (\n defined(intersection) &&\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n ) {\n if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\n splitPositions.push(Cartesian3.clone(intersection));\n } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\n intersectionLongitude = ellipsoid.cartesianToCartographic(\n intersection,\n cartographicScratch0\n ).longitude;\n c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\n c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\n rhumbLine.setEndPoints(c0, c1);\n intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\n intersectionLongitude,\n cartographicIntersectionScratch\n );\n intersection = ellipsoid.cartographicToCartesian(\n intersectionCartographic,\n intersectionScratch\n );\n if (\n defined(intersection) &&\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\n ) {\n splitPositions.push(Cartesian3.clone(intersection));\n }\n }\n }\n }\n let cartographicsLength = splitPositions.length;\n\n let cartographics = new Array(cartographicsLength);\n for (i = 0; i < cartographicsLength; i++) {\n const cartographic = Cartographic.fromCartesian(\n splitPositions[i],\n ellipsoid\n );\n cartographic.height = 0.0;\n cartographics[i] = cartographic;\n }\n\n cartographics = arrayRemoveDuplicates(\n cartographics,\n Cartographic.equalsEpsilon\n );\n cartographicsLength = cartographics.length;\n\n if (cartographicsLength < 2) {\n return undefined;\n }\n\n /**** Build heap-side arrays for positions, interpolated cartographics, and normals from which to compute vertices ****/\n // We build a \"wall\" and then decompose it into separately connected component \"volumes\" because we need a lot\n // of information about the wall. Also, this simplifies interpolation.\n // Convention: \"next\" and \"end\" are locally forward to each segment of the wall,\n // and we are computing normals pointing towards the local right side of the vertices in each segment.\n const cartographicsArray = [];\n const normalsArray = [];\n const bottomPositionsArray = [];\n const topPositionsArray = [];\n\n let previousBottom = previousBottomScratch;\n let vertexBottom = vertexBottomScratch;\n let vertexTop = vertexTopScratch;\n let nextBottom = nextBottomScratch;\n let vertexNormal = vertexNormalScratch;\n\n // First point - either loop or attach a \"perpendicular\" normal\n const startCartographic = cartographics[0];\n const nextCartographic = cartographics[1];\n\n const prestartCartographic = cartographics[cartographicsLength - 1];\n previousBottom = getPosition(\n ellipsoid,\n prestartCartographic,\n minHeight,\n previousBottom\n );\n nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);\n vertexBottom = getPosition(\n ellipsoid,\n startCartographic,\n minHeight,\n vertexBottom\n );\n vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);\n\n if (loop) {\n vertexNormal = computeVertexMiterNormal(\n previousBottom,\n vertexBottom,\n vertexTop,\n nextBottom,\n vertexNormal\n );\n } else {\n vertexNormal = computeRightNormal(\n startCartographic,\n nextCartographic,\n maxHeight,\n ellipsoid,\n vertexNormal\n );\n }\n\n Cartesian3.pack(vertexNormal, normalsArray, 0);\n Cartesian3.pack(vertexBottom, bottomPositionsArray, 0);\n Cartesian3.pack(vertexTop, topPositionsArray, 0);\n cartographicsArray.push(startCartographic.latitude);\n cartographicsArray.push(startCartographic.longitude);\n\n interpolateSegment(\n startCartographic,\n nextCartographic,\n minHeight,\n maxHeight,\n granularity,\n arcType,\n ellipsoid,\n normalsArray,\n bottomPositionsArray,\n topPositionsArray,\n cartographicsArray\n );\n\n // All inbetween points\n for (i = 1; i < cartographicsLength - 1; ++i) {\n previousBottom = Cartesian3.clone(vertexBottom, previousBottom);\n vertexBottom = Cartesian3.clone(nextBottom, vertexBottom);\n const vertexCartographic = cartographics[i];\n getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);\n getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);\n\n computeVertexMiterNormal(\n previousBottom,\n vertexBottom,\n vertexTop,\n nextBottom,\n vertexNormal\n );\n\n index = normalsArray.length;\n Cartesian3.pack(vertexNormal, normalsArray, index);\n Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\n Cartesian3.pack(vertexTop, topPositionsArray, index);\n cartographicsArray.push(vertexCartographic.latitude);\n cartographicsArray.push(vertexCartographic.longitude);\n\n interpolateSegment(\n cartographics[i],\n cartographics[i + 1],\n minHeight,\n maxHeight,\n granularity,\n arcType,\n ellipsoid,\n normalsArray,\n bottomPositionsArray,\n topPositionsArray,\n cartographicsArray\n );\n }\n\n // Last point - either loop or attach a normal \"perpendicular\" to the wall.\n const endCartographic = cartographics[cartographicsLength - 1];\n const preEndCartographic = cartographics[cartographicsLength - 2];\n\n vertexBottom = getPosition(\n ellipsoid,\n endCartographic,\n minHeight,\n vertexBottom\n );\n vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);\n\n if (loop) {\n const postEndCartographic = cartographics[0];\n previousBottom = getPosition(\n ellipsoid,\n preEndCartographic,\n minHeight,\n previousBottom\n );\n nextBottom = getPosition(\n ellipsoid,\n postEndCartographic,\n minHeight,\n nextBottom\n );\n\n vertexNormal = computeVertexMiterNormal(\n previousBottom,\n vertexBottom,\n vertexTop,\n nextBottom,\n vertexNormal\n );\n } else {\n vertexNormal = computeRightNormal(\n preEndCartographic,\n endCartographic,\n maxHeight,\n ellipsoid,\n vertexNormal\n );\n }\n\n index = normalsArray.length;\n Cartesian3.pack(vertexNormal, normalsArray, index);\n Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\n Cartesian3.pack(vertexTop, topPositionsArray, index);\n cartographicsArray.push(endCartographic.latitude);\n cartographicsArray.push(endCartographic.longitude);\n\n if (loop) {\n interpolateSegment(\n endCartographic,\n startCartographic,\n minHeight,\n maxHeight,\n granularity,\n arcType,\n ellipsoid,\n normalsArray,\n bottomPositionsArray,\n topPositionsArray,\n cartographicsArray\n );\n index = normalsArray.length;\n for (i = 0; i < 3; ++i) {\n normalsArray[index + i] = normalsArray[i];\n bottomPositionsArray[index + i] = bottomPositionsArray[i];\n topPositionsArray[index + i] = topPositionsArray[i];\n }\n cartographicsArray.push(startCartographic.latitude);\n cartographicsArray.push(startCartographic.longitude);\n }\n\n return generateGeometryAttributes(\n loop,\n projection,\n bottomPositionsArray,\n topPositionsArray,\n normalsArray,\n cartographicsArray,\n compute2dAttributes\n );\n};\n\n// If the end normal angle is too steep compared to the direction of the line segment,\n// \"break\" the miter by rotating the normal 90 degrees around the \"up\" direction at the point\n// For ultra precision we would want to project into a plane, but in practice this is sufficient.\nconst lineDirectionScratch = new Cartesian3();\nconst matrix3Scratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\nfunction breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {\n const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);\n\n const dot = Cartesian3.dot(lineDirection, endGeometryNormal);\n if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {\n const vertexUp = direction(endTop, endBottom, vertexUpScratch);\n const angle =\n dot < MITER_BREAK_LARGE\n ? CesiumMath.PI_OVER_TWO\n : -CesiumMath.PI_OVER_TWO;\n const quaternion = Quaternion.fromAxisAngle(\n vertexUp,\n angle,\n quaternionScratch\n );\n const rotationMatrix = Matrix3.fromQuaternion(quaternion, matrix3Scratch);\n Matrix3.multiplyByVector(\n rotationMatrix,\n endGeometryNormal,\n endGeometryNormal\n );\n return true;\n }\n return false;\n}\n\nconst endPosCartographicScratch = new Cartographic();\nconst normalStartpointScratch = new Cartesian3();\nconst normalEndpointScratch = new Cartesian3();\nfunction projectNormal(\n projection,\n cartographic,\n normal,\n projectedPosition,\n result\n) {\n const position = Cartographic.toCartesian(\n cartographic,\n projection._ellipsoid,\n normalStartpointScratch\n );\n let normalEndpoint = Cartesian3.add(position, normal, normalEndpointScratch);\n let flipNormal = false;\n\n const ellipsoid = projection._ellipsoid;\n let normalEndpointCartographic = ellipsoid.cartesianToCartographic(\n normalEndpoint,\n endPosCartographicScratch\n );\n // If normal crosses the IDL, go the other way and flip the result.\n // In practice this almost never happens because the cartographic start\n // and end points of each segment are \"nudged\" to be on the same side\n // of the IDL and slightly away from the IDL.\n if (\n Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) >\n CesiumMath.PI_OVER_TWO\n ) {\n flipNormal = true;\n normalEndpoint = Cartesian3.subtract(\n position,\n normal,\n normalEndpointScratch\n );\n normalEndpointCartographic = ellipsoid.cartesianToCartographic(\n normalEndpoint,\n endPosCartographicScratch\n );\n }\n\n normalEndpointCartographic.height = 0.0;\n const normalEndpointProjected = projection.project(\n normalEndpointCartographic,\n result\n );\n result = Cartesian3.subtract(\n normalEndpointProjected,\n projectedPosition,\n result\n );\n result.z = 0.0;\n result = Cartesian3.normalize(result, result);\n if (flipNormal) {\n Cartesian3.negate(result, result);\n }\n return result;\n}\n\nconst adjustHeightNormalScratch = new Cartesian3();\nconst adjustHeightOffsetScratch = new Cartesian3();\nfunction adjustHeights(\n bottom,\n top,\n minHeight,\n maxHeight,\n adjustHeightBottom,\n adjustHeightTop\n) {\n // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively\n const adjustHeightNormal = Cartesian3.subtract(\n top,\n bottom,\n adjustHeightNormalScratch\n );\n Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal);\n\n const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;\n let adjustHeightOffset = Cartesian3.multiplyByScalar(\n adjustHeightNormal,\n distanceForBottom,\n adjustHeightOffsetScratch\n );\n Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom);\n\n const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;\n adjustHeightOffset = Cartesian3.multiplyByScalar(\n adjustHeightNormal,\n distanceForTop,\n adjustHeightOffsetScratch\n );\n Cartesian3.add(top, adjustHeightOffset, adjustHeightTop);\n}\n\nconst nudgeDirectionScratch = new Cartesian3();\nfunction nudgeXZ(start, end) {\n const startToXZdistance = Plane.getPointDistance(XZ_PLANE, start);\n const endToXZdistance = Plane.getPointDistance(XZ_PLANE, end);\n let offset = nudgeDirectionScratch;\n // Larger epsilon than what's used in GeometryPipeline, a centimeter in world space\n if (CesiumMath.equalsEpsilon(startToXZdistance, 0.0, CesiumMath.EPSILON2)) {\n offset = direction(end, start, offset);\n Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\n Cartesian3.add(start, offset, start);\n } else if (\n CesiumMath.equalsEpsilon(endToXZdistance, 0.0, CesiumMath.EPSILON2)\n ) {\n offset = direction(start, end, offset);\n Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\n Cartesian3.add(end, offset, end);\n }\n}\n\n// \"Nudge\" cartographic coordinates so start and end are on the same side of the IDL.\n// Nudge amounts are tiny, basically just an IDL flip.\n// Only used for 2D/CV.\nfunction nudgeCartographic(start, end) {\n const absStartLon = Math.abs(start.longitude);\n const absEndLon = Math.abs(end.longitude);\n if (\n CesiumMath.equalsEpsilon(absStartLon, CesiumMath.PI, CesiumMath.EPSILON11)\n ) {\n const endSign = CesiumMath.sign(end.longitude);\n start.longitude = endSign * (absStartLon - CesiumMath.EPSILON11);\n return 1;\n } else if (\n CesiumMath.equalsEpsilon(absEndLon, CesiumMath.PI, CesiumMath.EPSILON11)\n ) {\n const startSign = CesiumMath.sign(start.longitude);\n end.longitude = startSign * (absEndLon - CesiumMath.EPSILON11);\n return 2;\n }\n return 0;\n}\n\nconst startCartographicScratch = new Cartographic();\nconst endCartographicScratch = new Cartographic();\n\nconst segmentStartTopScratch = new Cartesian3();\nconst segmentEndTopScratch = new Cartesian3();\nconst segmentStartBottomScratch = new Cartesian3();\nconst segmentEndBottomScratch = new Cartesian3();\nconst segmentStartNormalScratch = new Cartesian3();\nconst segmentEndNormalScratch = new Cartesian3();\n\nconst getHeightCartographics = [\n startCartographicScratch,\n endCartographicScratch,\n];\nconst getHeightRectangleScratch = new Rectangle();\n\nconst adjustHeightStartTopScratch = new Cartesian3();\nconst adjustHeightEndTopScratch = new Cartesian3();\nconst adjustHeightStartBottomScratch = new Cartesian3();\nconst adjustHeightEndBottomScratch = new Cartesian3();\n\nconst segmentStart2DScratch = new Cartesian3();\nconst segmentEnd2DScratch = new Cartesian3();\nconst segmentStartNormal2DScratch = new Cartesian3();\nconst segmentEndNormal2DScratch = new Cartesian3();\n\nconst offsetScratch = new Cartesian3();\nconst startUpScratch = new Cartesian3();\nconst endUpScratch = new Cartesian3();\nconst rightScratch = new Cartesian3();\nconst startPlaneNormalScratch = new Cartesian3();\nconst endPlaneNormalScratch = new Cartesian3();\nconst encodeScratch = new EncodedCartesian3();\n\nconst encodeScratch2D = new EncodedCartesian3();\nconst forwardOffset2DScratch = new Cartesian3();\nconst right2DScratch = new Cartesian3();\n\nconst normalNudgeScratch = new Cartesian3();\n\nconst scratchBoundingSpheres = [new BoundingSphere(), new BoundingSphere()];\n\n// Winding order is reversed so each segment's volume is inside-out\nconst REFERENCE_INDICES = [\n 0,\n 2,\n 1,\n 0,\n 3,\n 2, // right\n 0,\n 7,\n 3,\n 0,\n 4,\n 7, // start\n 0,\n 5,\n 4,\n 0,\n 1,\n 5, // bottom\n 5,\n 7,\n 4,\n 5,\n 6,\n 7, // left\n 5,\n 2,\n 6,\n 5,\n 1,\n 2, // end\n 3,\n 6,\n 2,\n 3,\n 7,\n 6, // top\n];\nconst REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;\n\n// Decompose the \"wall\" into a series of shadow volumes.\n// Each shadow volume's vertices encode a description of the line it contains,\n// including mitering planes at the end points, a plane along the line itself,\n// and attributes for computing length-wise texture coordinates.\nfunction generateGeometryAttributes(\n loop,\n projection,\n bottomPositionsArray,\n topPositionsArray,\n normalsArray,\n cartographicsArray,\n compute2dAttributes\n) {\n let i;\n let index;\n const ellipsoid = projection._ellipsoid;\n\n // Each segment will have 8 vertices\n const segmentCount = bottomPositionsArray.length / 3 - 1;\n const vertexCount = segmentCount * 8;\n const arraySizeVec4 = vertexCount * 4;\n const indexCount = segmentCount * 36;\n\n const indices =\n vertexCount > 65535\n ? new Uint32Array(indexCount)\n : new Uint16Array(indexCount);\n const positionsArray = new Float64Array(vertexCount * 3);\n\n const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);\n const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);\n const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);\n const endNormalAndTextureCoordinateNormalizationX = new Float32Array(\n arraySizeVec4\n );\n const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(\n arraySizeVec4\n );\n\n let startHiLo2D;\n let offsetAndRight2D;\n let startEndNormals2D;\n let texcoordNormalization2D;\n\n if (compute2dAttributes) {\n startHiLo2D = new Float32Array(arraySizeVec4);\n offsetAndRight2D = new Float32Array(arraySizeVec4);\n startEndNormals2D = new Float32Array(arraySizeVec4);\n texcoordNormalization2D = new Float32Array(vertexCount * 2);\n }\n\n /*** Compute total lengths for texture coordinate normalization ***/\n // 2D\n const cartographicsLength = cartographicsArray.length / 2;\n let length2D = 0.0;\n\n const startCartographic = startCartographicScratch;\n startCartographic.height = 0.0;\n const endCartographic = endCartographicScratch;\n endCartographic.height = 0.0;\n\n let segmentStartCartesian = segmentStartTopScratch;\n let segmentEndCartesian = segmentEndTopScratch;\n\n if (compute2dAttributes) {\n index = 0;\n for (i = 1; i < cartographicsLength; i++) {\n // Don't clone anything from previous segment b/c possible IDL touch\n startCartographic.latitude = cartographicsArray[index];\n startCartographic.longitude = cartographicsArray[index + 1];\n endCartographic.latitude = cartographicsArray[index + 2];\n endCartographic.longitude = cartographicsArray[index + 3];\n\n segmentStartCartesian = projection.project(\n startCartographic,\n segmentStartCartesian\n );\n segmentEndCartesian = projection.project(\n endCartographic,\n segmentEndCartesian\n );\n length2D += Cartesian3.distance(\n segmentStartCartesian,\n segmentEndCartesian\n );\n index += 2;\n }\n }\n\n // 3D\n const positionsLength = topPositionsArray.length / 3;\n segmentEndCartesian = Cartesian3.unpack(\n topPositionsArray,\n 0,\n segmentEndCartesian\n );\n let length3D = 0.0;\n\n index = 3;\n for (i = 1; i < positionsLength; i++) {\n segmentStartCartesian = Cartesian3.clone(\n segmentEndCartesian,\n segmentStartCartesian\n );\n segmentEndCartesian = Cartesian3.unpack(\n topPositionsArray,\n index,\n segmentEndCartesian\n );\n length3D += Cartesian3.distance(segmentStartCartesian, segmentEndCartesian);\n index += 3;\n }\n\n /*** Generate segments ***/\n let j;\n index = 3;\n let cartographicsIndex = 0;\n let vec2sWriteIndex = 0;\n let vec3sWriteIndex = 0;\n let vec4sWriteIndex = 0;\n let miterBroken = false;\n\n let endBottom = Cartesian3.unpack(\n bottomPositionsArray,\n 0,\n segmentEndBottomScratch\n );\n let endTop = Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch);\n let endGeometryNormal = Cartesian3.unpack(\n normalsArray,\n 0,\n segmentEndNormalScratch\n );\n\n if (loop) {\n const preEndBottom = Cartesian3.unpack(\n bottomPositionsArray,\n bottomPositionsArray.length - 6,\n segmentStartBottomScratch\n );\n if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {\n // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom)\n endGeometryNormal = Cartesian3.negate(\n endGeometryNormal,\n endGeometryNormal\n );\n }\n }\n\n let lengthSoFar3D = 0.0;\n let lengthSoFar2D = 0.0;\n\n // For translating bounding volume\n let sumHeights = 0.0;\n\n for (i = 0; i < segmentCount; i++) {\n const startBottom = Cartesian3.clone(endBottom, segmentStartBottomScratch);\n const startTop = Cartesian3.clone(endTop, segmentStartTopScratch);\n let startGeometryNormal = Cartesian3.clone(\n endGeometryNormal,\n segmentStartNormalScratch\n );\n\n if (miterBroken) {\n startGeometryNormal = Cartesian3.negate(\n startGeometryNormal,\n startGeometryNormal\n );\n }\n\n endBottom = Cartesian3.unpack(\n bottomPositionsArray,\n index,\n segmentEndBottomScratch\n );\n endTop = Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch);\n endGeometryNormal = Cartesian3.unpack(\n normalsArray,\n index,\n segmentEndNormalScratch\n );\n\n miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);\n\n // 2D - don't clone anything from previous segment b/c possible IDL touch\n startCartographic.latitude = cartographicsArray[cartographicsIndex];\n startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];\n endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];\n endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];\n let start2D;\n let end2D;\n let startGeometryNormal2D;\n let endGeometryNormal2D;\n\n if (compute2dAttributes) {\n const nudgeResult = nudgeCartographic(startCartographic, endCartographic);\n start2D = projection.project(startCartographic, segmentStart2DScratch);\n end2D = projection.project(endCartographic, segmentEnd2DScratch);\n const direction2D = direction(end2D, start2D, forwardOffset2DScratch);\n direction2D.y = Math.abs(direction2D.y);\n\n startGeometryNormal2D = segmentStartNormal2DScratch;\n endGeometryNormal2D = segmentEndNormal2DScratch;\n if (\n nudgeResult === 0 ||\n Cartesian3.dot(direction2D, Cartesian3.UNIT_Y) > MITER_BREAK_SMALL\n ) {\n // No nudge - project the original normal\n // Or, if the line's angle relative to the IDL is very acute,\n // in which case snapping will produce oddly shaped volumes.\n startGeometryNormal2D = projectNormal(\n projection,\n startCartographic,\n startGeometryNormal,\n start2D,\n segmentStartNormal2DScratch\n );\n endGeometryNormal2D = projectNormal(\n projection,\n endCartographic,\n endGeometryNormal,\n end2D,\n segmentEndNormal2DScratch\n );\n } else if (nudgeResult === 1) {\n // Start is close to IDL - snap start normal to align with IDL\n endGeometryNormal2D = projectNormal(\n projection,\n endCartographic,\n endGeometryNormal,\n end2D,\n segmentEndNormal2DScratch\n );\n startGeometryNormal2D.x = 0.0;\n // If start longitude is negative and end longitude is less negative, relative right is unit -Y\n // If start longitude is positive and end longitude is less positive, relative right is unit +Y\n startGeometryNormal2D.y = CesiumMath.sign(\n startCartographic.longitude - Math.abs(endCartographic.longitude)\n );\n startGeometryNormal2D.z = 0.0;\n } else {\n // End is close to IDL - snap end normal to align with IDL\n startGeometryNormal2D = projectNormal(\n projection,\n startCartographic,\n startGeometryNormal,\n start2D,\n segmentStartNormal2DScratch\n );\n endGeometryNormal2D.x = 0.0;\n // If end longitude is negative and start longitude is less negative, relative right is unit Y\n // If end longitude is positive and start longitude is less positive, relative right is unit -Y\n endGeometryNormal2D.y = CesiumMath.sign(\n startCartographic.longitude - endCartographic.longitude\n );\n endGeometryNormal2D.z = 0.0;\n }\n }\n\n /****************************************\n * Geometry descriptors of a \"line on terrain,\"\n * as opposed to the \"shadow volume used to draw\n * the line on terrain\":\n * - position of start + offset to end\n * - start, end, and right-facing planes\n * - encoded texture coordinate offsets\n ****************************************/\n\n /* 3D */\n const segmentLength3D = Cartesian3.distance(startTop, endTop);\n\n const encodedStart = EncodedCartesian3.fromCartesian(\n startBottom,\n encodeScratch\n );\n const forwardOffset = Cartesian3.subtract(\n endBottom,\n startBottom,\n offsetScratch\n );\n const forward = Cartesian3.normalize(forwardOffset, rightScratch);\n\n let startUp = Cartesian3.subtract(startTop, startBottom, startUpScratch);\n startUp = Cartesian3.normalize(startUp, startUp);\n let rightNormal = Cartesian3.cross(forward, startUp, rightScratch);\n rightNormal = Cartesian3.normalize(rightNormal, rightNormal);\n\n let startPlaneNormal = Cartesian3.cross(\n startUp,\n startGeometryNormal,\n startPlaneNormalScratch\n );\n startPlaneNormal = Cartesian3.normalize(startPlaneNormal, startPlaneNormal);\n\n let endUp = Cartesian3.subtract(endTop, endBottom, endUpScratch);\n endUp = Cartesian3.normalize(endUp, endUp);\n let endPlaneNormal = Cartesian3.cross(\n endGeometryNormal,\n endUp,\n endPlaneNormalScratch\n );\n endPlaneNormal = Cartesian3.normalize(endPlaneNormal, endPlaneNormal);\n\n const texcoordNormalization3DX = segmentLength3D / length3D;\n const texcoordNormalization3DY = lengthSoFar3D / length3D;\n\n /* 2D */\n let segmentLength2D = 0.0;\n let encodedStart2D;\n let forwardOffset2D;\n let right2D;\n let texcoordNormalization2DX = 0.0;\n let texcoordNormalization2DY = 0.0;\n if (compute2dAttributes) {\n segmentLength2D = Cartesian3.distance(start2D, end2D);\n\n encodedStart2D = EncodedCartesian3.fromCartesian(\n start2D,\n encodeScratch2D\n );\n forwardOffset2D = Cartesian3.subtract(\n end2D,\n start2D,\n forwardOffset2DScratch\n );\n\n // Right direction is just forward direction rotated by -90 degrees around Z\n // Similarly with plane normals\n right2D = Cartesian3.normalize(forwardOffset2D, right2DScratch);\n const swap = right2D.x;\n right2D.x = right2D.y;\n right2D.y = -swap;\n\n texcoordNormalization2DX = segmentLength2D / length2D;\n texcoordNormalization2DY = lengthSoFar2D / length2D;\n }\n /** Pack **/\n for (j = 0; j < 8; j++) {\n const vec4Index = vec4sWriteIndex + j * 4;\n const vec2Index = vec2sWriteIndex + j * 2;\n const wIndex = vec4Index + 3;\n\n // Encode sidedness of vertex relative to right plane in texture coordinate normalization X,\n // whether vertex is top or bottom of volume in sign/magnitude of normalization Y.\n const rightPlaneSide = j < 4 ? 1.0 : -1.0;\n const topBottomSide =\n j === 2 || j === 3 || j === 6 || j === 7 ? 1.0 : -1.0;\n\n // 3D\n Cartesian3.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);\n startHiAndForwardOffsetX[wIndex] = forwardOffset.x;\n\n Cartesian3.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);\n startLoAndForwardOffsetY[wIndex] = forwardOffset.y;\n\n Cartesian3.pack(\n startPlaneNormal,\n startNormalAndForwardOffsetZ,\n vec4Index\n );\n startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;\n\n Cartesian3.pack(\n endPlaneNormal,\n endNormalAndTextureCoordinateNormalizationX,\n vec4Index\n );\n endNormalAndTextureCoordinateNormalizationX[wIndex] =\n texcoordNormalization3DX * rightPlaneSide;\n\n Cartesian3.pack(\n rightNormal,\n rightNormalAndTextureCoordinateNormalizationY,\n vec4Index\n );\n\n let texcoordNormalization = texcoordNormalization3DY * topBottomSide;\n if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\n texcoordNormalization = 9.0; // some value greater than 1.0\n }\n rightNormalAndTextureCoordinateNormalizationY[\n wIndex\n ] = texcoordNormalization;\n\n // 2D\n if (compute2dAttributes) {\n startHiLo2D[vec4Index] = encodedStart2D.high.x;\n startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;\n startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;\n startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;\n\n startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;\n startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;\n startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;\n startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;\n\n offsetAndRight2D[vec4Index] = forwardOffset2D.x;\n offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;\n offsetAndRight2D[vec4Index + 2] = right2D.x;\n offsetAndRight2D[vec4Index + 3] = right2D.y;\n\n texcoordNormalization2D[vec2Index] =\n texcoordNormalization2DX * rightPlaneSide;\n\n texcoordNormalization = texcoordNormalization2DY * topBottomSide;\n if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\n texcoordNormalization = 9.0; // some value greater than 1.0\n }\n texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;\n }\n }\n\n // Adjust height of volume in 3D\n const adjustHeightStartBottom = adjustHeightStartBottomScratch;\n const adjustHeightEndBottom = adjustHeightEndBottomScratch;\n const adjustHeightStartTop = adjustHeightStartTopScratch;\n const adjustHeightEndTop = adjustHeightEndTopScratch;\n\n const getHeightsRectangle = Rectangle.fromCartographicArray(\n getHeightCartographics,\n getHeightRectangleScratch\n );\n const minMaxHeights = ApproximateTerrainHeights.getMinimumMaximumHeights(\n getHeightsRectangle,\n ellipsoid\n );\n const minHeight = minMaxHeights.minimumTerrainHeight;\n const maxHeight = minMaxHeights.maximumTerrainHeight;\n\n sumHeights += minHeight;\n sumHeights += maxHeight;\n\n adjustHeights(\n startBottom,\n startTop,\n minHeight,\n maxHeight,\n adjustHeightStartBottom,\n adjustHeightStartTop\n );\n adjustHeights(\n endBottom,\n endTop,\n minHeight,\n maxHeight,\n adjustHeightEndBottom,\n adjustHeightEndTop\n );\n\n // Nudge the positions away from the \"polyline\" a little bit to prevent errors in GeometryPipeline\n let normalNudge = Cartesian3.multiplyByScalar(\n rightNormal,\n CesiumMath.EPSILON5,\n normalNudgeScratch\n );\n Cartesian3.add(\n adjustHeightStartBottom,\n normalNudge,\n adjustHeightStartBottom\n );\n Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\n Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\n Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\n\n // If the segment is very close to the XZ plane, nudge the vertices slightly to avoid touching it.\n nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\n nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\n\n Cartesian3.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);\n Cartesian3.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);\n Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);\n Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);\n\n normalNudge = Cartesian3.multiplyByScalar(\n rightNormal,\n -2.0 * CesiumMath.EPSILON5,\n normalNudgeScratch\n );\n Cartesian3.add(\n adjustHeightStartBottom,\n normalNudge,\n adjustHeightStartBottom\n );\n Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\n Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\n Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\n\n nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\n nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\n\n Cartesian3.pack(\n adjustHeightStartBottom,\n positionsArray,\n vec3sWriteIndex + 12\n );\n Cartesian3.pack(\n adjustHeightEndBottom,\n positionsArray,\n vec3sWriteIndex + 15\n );\n Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);\n Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);\n\n cartographicsIndex += 2;\n index += 3;\n\n vec2sWriteIndex += 16;\n vec3sWriteIndex += 24;\n vec4sWriteIndex += 32;\n\n lengthSoFar3D += segmentLength3D;\n lengthSoFar2D += segmentLength2D;\n }\n\n index = 0;\n let indexOffset = 0;\n for (i = 0; i < segmentCount; i++) {\n for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {\n indices[index + j] = REFERENCE_INDICES[j] + indexOffset;\n }\n indexOffset += 8;\n index += REFERENCE_INDICES_LENGTH;\n }\n\n const boundingSpheres = scratchBoundingSpheres;\n BoundingSphere.fromVertices(\n bottomPositionsArray,\n Cartesian3.ZERO,\n 3,\n boundingSpheres[0]\n );\n BoundingSphere.fromVertices(\n topPositionsArray,\n Cartesian3.ZERO,\n 3,\n boundingSpheres[1]\n );\n const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres);\n\n // Adjust bounding sphere height and radius to cover more of the volume\n boundingSphere.radius += sumHeights / (segmentCount * 2.0);\n\n const attributes = {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n normalize: false,\n values: positionsArray,\n }),\n startHiAndForwardOffsetX: getVec4GeometryAttribute(\n startHiAndForwardOffsetX\n ),\n startLoAndForwardOffsetY: getVec4GeometryAttribute(\n startLoAndForwardOffsetY\n ),\n startNormalAndForwardOffsetZ: getVec4GeometryAttribute(\n startNormalAndForwardOffsetZ\n ),\n endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(\n endNormalAndTextureCoordinateNormalizationX\n ),\n rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(\n rightNormalAndTextureCoordinateNormalizationY\n ),\n };\n\n if (compute2dAttributes) {\n attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);\n attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);\n attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);\n attributes.texcoordNormalization2D = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n normalize: false,\n values: texcoordNormalization2D,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n boundingSphere: boundingSphere,\n });\n}\n\nfunction getVec4GeometryAttribute(typedArray) {\n return new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n normalize: false,\n values: typedArray,\n });\n}\n\n/**\n * Approximates an ellipsoid-tangent vector in 2D by projecting the end point into 2D.\n * Exposed for testing.\n *\n * @param {MapProjection} projection Map Projection for projecting coordinates to 2D.\n * @param {Cartographic} cartographic The cartographic origin point of the normal.\n * Used to check if the normal crosses the IDL during projection.\n * @param {Cartesian3} normal The normal in 3D.\n * @param {Cartesian3} projectedPosition The projected origin point of the normal in 2D.\n * @param {Cartesian3} result Result parameter on which to store the projected normal.\n * @private\n */\nGroundPolylineGeometry._projectNormal = projectNormal;\nexport default GroundPolylineGeometry;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_EXT_frag_depth\\n\\\n#extension GL_EXT_frag_depth : enable\\n\\\n#endif\\n\\\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\\n\\\nvarying vec4 v_endPlaneNormalEcAndBatchId;\\n\\\nvarying vec4 v_rightPlaneEC;\\n\\\nvarying vec4 v_endEcAndStartEcX;\\n\\\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#endif\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\\n\\\nvec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\\n\\\nif (logDepthOrDepth == 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\\n\\\nreturn;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\ndiscard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n}\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\neyeCoordinate /= eyeCoordinate.w;\\n\\\nfloat halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\\n\\\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\\n\\\nfloat distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\\n\\\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\\n\\\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\\n\\\nreturn;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\ndiscard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n}\\n\\\nvec3 alignedPlaneNormal;\\n\\\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\\n\\\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\\n\\\ndistanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\\n\\\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\\n\\\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\\n\\\ndistanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\ngl_FragColor = czm_gammaCorrect(v_color);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\nfloat s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\\n\\\ns = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\\n\\\nfloat t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.s = s;\\n\\\nmaterialInput.st = vec2(s, t);\\n\\\nmaterialInput.str = vec3(s, t, 0.0);\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\ngl_FragColor.rgb *= gl_FragColor.a;\\n\\\nczm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_forwardDirectionEC;\\n\\\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\\n\\\nvarying float v_batchId;\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#else\\n\\\nvarying vec2 v_alignedPlaneDistances;\\n\\\nvarying float v_texcoordT;\\n\\\n#endif\\n\\\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\\n\\\nreturn (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\\n\\\n}\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec4 eyeCoordinate = gl_FragCoord;\\n\\\neyeCoordinate /= eyeCoordinate.w;\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\ngl_FragColor = czm_gammaCorrect(v_color);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\nfloat distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\\n\\\nfloat distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\\n\\\ndistanceFromStart = max(0.0, distanceFromStart);\\n\\\ndistanceFromEnd = max(0.0, distanceFromEnd);\\n\\\nfloat s = distanceFromStart / (distanceFromStart + distanceFromEnd);\\n\\\ns = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.s = s;\\n\\\nmaterialInput.st = vec2(s, v_texcoordT);\\n\\\nmaterialInput.str = vec3(s, v_texcoordT, 0.0);\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec4 startHiAndForwardOffsetX;\\n\\\nattribute vec4 startLoAndForwardOffsetY;\\n\\\nattribute vec4 startNormalAndForwardOffsetZ;\\n\\\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\\n\\\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\\n\\\nattribute vec4 startHiLo2D;\\n\\\nattribute vec4 offsetAndRight2D;\\n\\\nattribute vec4 startEndNormals2D;\\n\\\nattribute vec2 texcoordNormalization2D;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_forwardDirectionEC;\\n\\\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\\n\\\nvarying float v_batchId;\\n\\\n#ifdef WIDTH_VARYING\\n\\\nvarying float v_width;\\n\\\n#endif\\n\\\n#ifdef ANGLE_VARYING\\n\\\nvarying float v_polylineAngle;\\n\\\n#endif\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#else\\n\\\nvarying vec2 v_alignedPlaneDistances;\\n\\\nvarying float v_texcoordT;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nv_batchId = batchId;\\n\\\nvec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\\n\\\nvec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\\n\\\nvec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\\n\\\nvec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\\n\\\nvec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\\n\\\nvec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\\n\\\nvec4 startPlane2D;\\n\\\nvec4 startPlane3D;\\n\\\nstartPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\\n\\\nstartPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\\n\\\nstartPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\\n\\\nstartPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\\n\\\nvec4 rightPlane2D;\\n\\\nvec4 rightPlane3D;\\n\\\nrightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\\n\\\nrightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\\n\\\nrightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\\n\\\nrightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\\n\\\nposRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\\n\\\nposRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\\n\\\nposRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\\n\\\nposEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\\n\\\nposEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\\n\\\nvec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\\n\\\nvec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\\n\\\nvec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\\n\\\nvec4 endPlane2D;\\n\\\nvec4 endPlane3D;\\n\\\nendPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\\n\\\nendPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\\n\\\nendPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\\n\\\nendPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\\n\\\nv_forwardDirectionEC = normalize(endEC - startEC);\\n\\\nvec2 cleanTexcoordNormalization2D;\\n\\\ncleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\\n\\\ncleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\\n\\\nvec2 cleanTexcoordNormalization3D;\\n\\\ncleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\ncleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\\n\\\ncleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\\n\\\nv_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nv_color = czm_batchTable_color(batchId);\\n\\\n#else // PER_INSTANCE_COLOR\\n\\\nv_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\\n\\\nv_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\n#ifdef WIDTH_VARYING\\n\\\nfloat width = czm_batchTable_width(batchId);\\n\\\nfloat halfWidth = width * 0.5;\\n\\\nv_width = width;\\n\\\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\\n\\\n#else\\n\\\nfloat halfWidth = 0.5 * czm_batchTable_width(batchId);\\n\\\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\\n\\\n#endif\\n\\\nvec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);\\n\\\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\\n\\\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\\n\\\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\\n\\\nvec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));\\n\\\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\\n\\\nvec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\\n\\\ngeodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\\n\\\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\\n\\\npositionEc3D.xyz += geodeticSurfaceNormal;\\n\\\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\npositionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;\\n\\\nvec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\\n\\\nabsStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\\n\\\nabsEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\\n\\\nplaneDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\\n\\\nupOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));\\n\\\nnormalEC = normalize(cross(planeDirection, upOrDown));\\n\\\ngeodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\\n\\\ngeodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\\n\\\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\\n\\\npositionEc2D.xyz += geodeticSurfaceNormal;\\n\\\nnormalEC *= sign(texcoordNormalization2D.x);\\n\\\n#ifndef PER_INSTANCE_COLOR\\n\\\nv_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\\n\\\n#endif\\n\\\npositionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;\\n\\\ngl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\\n\\\n#ifdef ANGLE_VARYING\\n\\\nvec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\\n\\\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\\n\\\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\n#ifndef COLUMBUS_VIEW_2D\\n\\\nattribute vec4 startHiAndForwardOffsetX;\\n\\\nattribute vec4 startLoAndForwardOffsetY;\\n\\\nattribute vec4 startNormalAndForwardOffsetZ;\\n\\\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\\n\\\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\\n\\\n#else\\n\\\nattribute vec4 startHiLo2D;\\n\\\nattribute vec4 offsetAndRight2D;\\n\\\nattribute vec4 startEndNormals2D;\\n\\\nattribute vec2 texcoordNormalization2D;\\n\\\n#endif\\n\\\nattribute float batchId;\\n\\\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\\n\\\nvarying vec4 v_endPlaneNormalEcAndBatchId;\\n\\\nvarying vec4 v_rightPlaneEC;\\n\\\nvarying vec4 v_endEcAndStartEcX;\\n\\\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\\n\\\n#ifdef WIDTH_VARYING\\n\\\nvarying float v_width;\\n\\\n#endif\\n\\\n#ifdef ANGLE_VARYING\\n\\\nvarying float v_polylineAngle;\\n\\\n#endif\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nvarying vec4 v_color;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\\n\\\nvec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\\n\\\nvec3 ecEnd = forwardDirectionEC + ecStart;\\n\\\nforwardDirectionEC = normalize(forwardDirectionEC);\\n\\\nv_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\\n\\\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\\n\\\nvec4 startPlaneEC;\\n\\\nstartPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\\n\\\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\\n\\\nvec4 endPlaneEC;\\n\\\nendPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\\n\\\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\\n\\\nv_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\\n\\\nv_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\\n\\\n#else // COLUMBUS_VIEW_2D\\n\\\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\\n\\\nvec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\\n\\\nvec3 ecEnd = ecStart + offset;\\n\\\nvec3 forwardDirectionEC = normalize(offset);\\n\\\nvec4 startPlaneEC;\\n\\\nstartPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\\n\\\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\\n\\\nvec4 endPlaneEC;\\n\\\nendPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\\n\\\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\\n\\\nv_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\\n\\\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\\n\\\nv_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\nv_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\\n\\\n#endif // COLUMBUS_VIEW_2D\\n\\\nv_endEcAndStartEcX.xyz = ecEnd;\\n\\\nv_endEcAndStartEcX.w = ecStart.x;\\n\\\nv_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\\n\\\n#ifdef PER_INSTANCE_COLOR\\n\\\nv_color = czm_batchTable_color(batchId);\\n\\\n#endif // PER_INSTANCE_COLOR\\n\\\nvec4 positionRelativeToEye = czm_computePosition();\\n\\\nvec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;\\n\\\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\\n\\\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\\n\\\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\\n\\\nvec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));\\n\\\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\\n\\\nupOrDown = cross(forwardDirectionEC, normalEC);\\n\\\nupOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\\n\\\nupOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\\n\\\nupOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\\n\\\npositionEC.xyz += upOrDown;\\n\\\nv_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\\n\\\nfloat width = czm_batchTable_width(batchId);\\n\\\n#ifdef WIDTH_VARYING\\n\\\nv_width = width;\\n\\\n#endif\\n\\\nv_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\\n\\\nv_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\\n\\\nv_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\\n\\\nv_endPlaneNormalEcAndBatchId.w = batchId;\\n\\\nwidth = width * max(0.0, czm_metersPerPixel(positionEC));\\n\\\nwidth = width / dot(normalEC, v_rightPlaneEC.xyz);\\n\\\n#ifdef COLUMBUS_VIEW_2D\\n\\\nnormalEC *= sign(texcoordNormalization2D.x);\\n\\\n#else\\n\\\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\\n\\\n#endif\\n\\\npositionEC.xyz += width * normalEC;\\n\\\ngl_Position = czm_depthClamp(czm_projection * positionEC);\\n\\\n#ifdef ANGLE_VARYING\\n\\\nvec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\\n\\\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\\n\\\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 prevPosition3DHigh;\\n\\\nattribute vec3 prevPosition3DLow;\\n\\\nattribute vec3 nextPosition3DHigh;\\n\\\nattribute vec3 nextPosition3DLow;\\n\\\nattribute vec2 expandAndWidth;\\n\\\nattribute vec4 color;\\n\\\nattribute float batchId;\\n\\\nvarying vec4 v_color;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat expandDir = expandAndWidth.x;\\n\\\nfloat width = abs(expandAndWidth.y) + 0.5;\\n\\\nbool usePrev = expandAndWidth.y < 0.0;\\n\\\nvec4 p = czm_computePosition();\\n\\\nvec4 prev = czm_computePrevPosition();\\n\\\nvec4 next = czm_computeNextPosition();\\n\\\nfloat angle;\\n\\\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\\n\\\ngl_Position = czm_viewportOrthographic * positionWC;\\n\\\nv_color = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void clipLineSegmentToNearPlane(\\n\\\nvec3 p0,\\n\\\nvec3 p1,\\n\\\nout vec4 positionWC,\\n\\\nout bool clipped,\\n\\\nout bool culledByNearPlane,\\n\\\nout vec4 clippedPositionEC)\\n\\\n{\\n\\\nculledByNearPlane = false;\\n\\\nclipped = false;\\n\\\nvec3 p0ToP1 = p1 - p0;\\n\\\nfloat magnitude = length(p0ToP1);\\n\\\nvec3 direction = normalize(p0ToP1);\\n\\\nfloat endPoint0Distance = czm_currentFrustum.x + p0.z;\\n\\\nfloat denominator = -direction.z;\\n\\\nif (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\\n\\\n{\\n\\\nculledByNearPlane = true;\\n\\\n}\\n\\\nelse if (endPoint0Distance > 0.0)\\n\\\n{\\n\\\nfloat t = endPoint0Distance / denominator;\\n\\\nif (t < 0.0 || t > magnitude)\\n\\\n{\\n\\\nculledByNearPlane = true;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\np0 = p0 + t * direction;\\n\\\np0.z = min(p0.z, -czm_currentFrustum.x);\\n\\\nclipped = true;\\n\\\n}\\n\\\n}\\n\\\nclippedPositionEC = vec4(p0, 1.0);\\n\\\npositionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\\n\\\n}\\n\\\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\\n\\\n{\\n\\\n#ifdef POLYLINE_DASH\\n\\\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\\n\\\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\\n\\\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\\n\\\nvec2 lineDir;\\n\\\nif (usePrevious) {\\n\\\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\\n\\\n}\\n\\\nelse {\\n\\\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\\n\\\n}\\n\\\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\\n\\\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\\n\\\n#endif\\n\\\nvec4 clippedPrevWC, clippedPrevEC;\\n\\\nbool prevSegmentClipped, prevSegmentCulled;\\n\\\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\\n\\\nvec4 clippedNextWC, clippedNextEC;\\n\\\nbool nextSegmentClipped, nextSegmentCulled;\\n\\\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\\n\\\nbool segmentClipped, segmentCulled;\\n\\\nvec4 clippedPositionWC, clippedPositionEC;\\n\\\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\\n\\\nif (segmentCulled)\\n\\\n{\\n\\\nreturn vec4(0.0, 0.0, 0.0, 1.0);\\n\\\n}\\n\\\nvec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\\n\\\nvec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\\n\\\nif (prevSegmentCulled)\\n\\\n{\\n\\\ndirectionToPrevWC = -directionToNextWC;\\n\\\n}\\n\\\nelse if (nextSegmentCulled)\\n\\\n{\\n\\\ndirectionToNextWC = -directionToPrevWC;\\n\\\n}\\n\\\nvec2 thisSegmentForwardWC, otherSegmentForwardWC;\\n\\\nif (usePrevious)\\n\\\n{\\n\\\nthisSegmentForwardWC = -directionToPrevWC;\\n\\\notherSegmentForwardWC = directionToNextWC;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nthisSegmentForwardWC = directionToNextWC;\\n\\\notherSegmentForwardWC = -directionToPrevWC;\\n\\\n}\\n\\\nvec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\\n\\\nvec2 leftWC = thisSegmentLeftWC;\\n\\\nfloat expandWidth = width * 0.5;\\n\\\nif (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\\n\\\n{\\n\\\nvec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\\n\\\nvec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\\n\\\nfloat leftSumLength = length(leftSumWC);\\n\\\nleftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\\n\\\nvec2 u = -thisSegmentForwardWC;\\n\\\nvec2 v = leftWC;\\n\\\nfloat sinAngle = abs(u.x * v.y - u.y * v.x);\\n\\\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\\n\\\n}\\n\\\nvec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\\n\\\nreturn vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\\n\\\n}\\n\\\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\\n\\\n{\\n\\\nvec4 positionEC = czm_modelViewRelativeToEye * position;\\n\\\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\\n\\\nvec4 nextEC = czm_modelViewRelativeToEye * next;\\n\\\nreturn getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PerInstanceFlatColorAppearanceFS from \"../Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js\";\nimport PolylineColorAppearanceVS from \"../Shaders/Appearances/PolylineColorAppearanceVS.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Appearance from \"./Appearance.js\";\n\nlet defaultVertexShaderSource = `${PolylineCommon}\\n${PolylineColorAppearanceVS}`;\nconst defaultFragmentShaderSource = PerInstanceFlatColorAppearanceFS;\n\nif (!FeatureDetection.isInternetExplorer()) {\n defaultVertexShaderSource = `#define CLIP_POLYLINE \\n${defaultVertexShaderSource}`;\n}\n\n/**\n * An appearance for {@link GeometryInstance} instances with color attributes and\n * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.\n * This allows several geometry instances, each with a different color, to\n * be drawn with the same {@link Primitive}.\n *\n * @alias PolylineColorAppearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @example\n * // A solid white line segment\n * const primitive = new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : new Cesium.PolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 5.0, 0.0\n * ]),\n * width : 10.0,\n * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT\n * }),\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))\n * }\n * }),\n * appearance : new Cesium.PolylineColorAppearance({\n * translucent : false\n * })\n * });\n */\nfunction PolylineColorAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const translucent = defaultValue(options.translucent, true);\n const closed = false;\n const vertexFormat = PolylineColorAppearance.VERTEX_FORMAT;\n\n /**\n * This property is part of the {@link Appearance} interface, but is not\n * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.\n *\n * @type Material\n *\n * @default undefined\n */\n this.material = undefined;\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent so\n * {@link PolylineColorAppearance#renderState} has alpha blending enabled.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = translucent;\n\n this._vertexShaderSource = defaultValue(\n options.vertexShaderSource,\n defaultVertexShaderSource\n );\n this._fragmentShaderSource = defaultValue(\n options.fragmentShaderSource,\n defaultFragmentShaderSource\n );\n this._renderState = Appearance.getDefaultRenderState(\n translucent,\n closed,\n options.renderState\n );\n this._closed = closed;\n\n // Non-derived members\n\n this._vertexFormat = vertexFormat;\n}\n\nObject.defineProperties(PolylineColorAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof PolylineColorAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader.\n *\n * @memberof PolylineColorAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n * <p>\n * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}\n * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.\n * </p>\n *\n * @memberof PolylineColorAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed so\n * {@link PolylineColorAppearance#renderState} has backface culling enabled.\n * This is always <code>false</code> for <code>PolylineColorAppearance</code>.\n *\n * @memberof PolylineColorAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The {@link VertexFormat} that this appearance instance is compatible with.\n * A geometry can have more vertex attributes and still be compatible - at a\n * potential performance cost - but it can't have less.\n *\n * @memberof PolylineColorAppearance.prototype\n *\n * @type VertexFormat\n * @readonly\n *\n * @default {@link PolylineColorAppearance.VERTEX_FORMAT}\n */\n vertexFormat: {\n get: function () {\n return this._vertexFormat;\n },\n },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances\n * are compatible with. This requires only a <code>position</code> attribute.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPolylineColorAppearance.VERTEX_FORMAT = VertexFormat.POSITION_ONLY;\n\n/**\n * Procedurally creates the full GLSL fragment shader source.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nPolylineColorAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nPolylineColorAppearance.prototype.isTranslucent =\n Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nPolylineColorAppearance.prototype.getRenderState =\n Appearance.prototype.getRenderState;\nexport default PolylineColorAppearance;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 prevPosition3DHigh;\\n\\\nattribute vec3 prevPosition3DLow;\\n\\\nattribute vec3 nextPosition3DHigh;\\n\\\nattribute vec3 nextPosition3DLow;\\n\\\nattribute vec2 expandAndWidth;\\n\\\nattribute vec2 st;\\n\\\nattribute float batchId;\\n\\\nvarying float v_width;\\n\\\nvarying vec2 v_st;\\n\\\nvarying float v_polylineAngle;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat expandDir = expandAndWidth.x;\\n\\\nfloat width = abs(expandAndWidth.y) + 0.5;\\n\\\nbool usePrev = expandAndWidth.y < 0.0;\\n\\\nvec4 p = czm_computePosition();\\n\\\nvec4 prev = czm_computePrevPosition();\\n\\\nvec4 next = czm_computeNextPosition();\\n\\\nfloat angle;\\n\\\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\\n\\\ngl_Position = czm_viewportOrthographic * positionWC;\\n\\\nv_width = width;\\n\\\nv_st.s = st.s;\\n\\\nv_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\\n\\\nv_polylineAngle = angle;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nczm_materialInput materialInput;\\n\\\nvec2 st = v_st;\\n\\\nst.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\\n\\\nmaterialInput.s = st.s;\\n\\\nmaterialInput.st = st;\\n\\\nmaterialInput.str = vec3(st, 0.0);\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#ifdef VECTOR_TILE\\n\\\ngl_FragColor *= u_highlightColor;\\n\\\n#endif\\n\\\nczm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport PolylineMaterialAppearanceVS from \"../Shaders/Appearances/PolylineMaterialAppearanceVS.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport PolylineFS from \"../Shaders/PolylineFS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\nlet defaultVertexShaderSource = `${PolylineCommon}\\n${PolylineMaterialAppearanceVS}`;\nconst defaultFragmentShaderSource = PolylineFS;\n\nif (!FeatureDetection.isInternetExplorer()) {\n defaultVertexShaderSource = `#define CLIP_POLYLINE \\n${defaultVertexShaderSource}`;\n}\n\n/**\n * An appearance for {@link PolylineGeometry} that supports shading with materials.\n *\n * @alias PolylineMaterialAppearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n *\n * @example\n * const primitive = new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : new Cesium.PolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 5.0, 0.0\n * ]),\n * width : 10.0,\n * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT\n * })\n * }),\n * appearance : new Cesium.PolylineMaterialAppearance({\n * material : Cesium.Material.fromType('Color')\n * })\n * });\n */\nfunction PolylineMaterialAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const translucent = defaultValue(options.translucent, true);\n const closed = false;\n const vertexFormat = PolylineMaterialAppearance.VERTEX_FORMAT;\n\n /**\n * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}\n * properties, this is not read-only, so an appearance's material can change on the fly.\n *\n * @type Material\n *\n * @default {@link Material.ColorType}\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = defined(options.material)\n ? options.material\n : Material.fromType(Material.ColorType);\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent so\n * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = translucent;\n\n this._vertexShaderSource = defaultValue(\n options.vertexShaderSource,\n defaultVertexShaderSource\n );\n this._fragmentShaderSource = defaultValue(\n options.fragmentShaderSource,\n defaultFragmentShaderSource\n );\n this._renderState = Appearance.getDefaultRenderState(\n translucent,\n closed,\n options.renderState\n );\n this._closed = closed;\n\n // Non-derived members\n\n this._vertexFormat = vertexFormat;\n}\n\nObject.defineProperties(PolylineMaterialAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof PolylineMaterialAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n let vs = this._vertexShaderSource;\n if (\n this.material.shaderSource.search(\n /varying\\s+float\\s+v_polylineAngle;/g\n ) !== -1\n ) {\n vs = `#define POLYLINE_DASH\\n${vs}`;\n }\n return vs;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader.\n *\n * @memberof PolylineMaterialAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n * <p>\n * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}\n * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}\n * and {@link PolylineMaterialAppearance#closed}.\n * </p>\n *\n * @memberof PolylineMaterialAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed so\n * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.\n * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.\n *\n * @memberof PolylineMaterialAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The {@link VertexFormat} that this appearance instance is compatible with.\n * A geometry can have more vertex attributes and still be compatible - at a\n * potential performance cost - but it can't have less.\n *\n * @memberof PolylineMaterialAppearance.prototype\n *\n * @type VertexFormat\n * @readonly\n *\n * @default {@link PolylineMaterialAppearance.VERTEX_FORMAT}\n */\n vertexFormat: {\n get: function () {\n return this._vertexFormat;\n },\n },\n});\n\n/**\n * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances\n * are compatible with. This requires <code>position</code> and <code>st</code> attributes.\n *\n * @type VertexFormat\n *\n * @constant\n */\nPolylineMaterialAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_ST;\n\n/**\n * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},\n * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nPolylineMaterialAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nPolylineMaterialAppearance.prototype.isTranslucent =\n Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nPolylineMaterialAppearance.prototype.getRenderState =\n Appearance.prototype.getRenderState;\nexport default PolylineMaterialAppearance;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryInstanceAttribute from \"../Core/GeometryInstanceAttribute.js\";\nimport GroundPolylineGeometry from \"../Core/GroundPolylineGeometry.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport PolylineShadowVolumeFS from \"../Shaders/PolylineShadowVolumeFS.js\";\nimport PolylineShadowVolumeMorphFS from \"../Shaders/PolylineShadowVolumeMorphFS.js\";\nimport PolylineShadowVolumeMorphVS from \"../Shaders/PolylineShadowVolumeMorphVS.js\";\nimport PolylineShadowVolumeVS from \"../Shaders/PolylineShadowVolumeVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport CullFace from \"./CullFace.js\";\nimport PolylineColorAppearance from \"./PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"./PolylineMaterialAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.\n * <p>\n * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.\n * </p>\n *\n * @alias GroundPolylinePrimitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Array|GeometryInstance} [options.geometryInstances] GeometryInstances containing GroundPolylineGeometry\n * @param {Appearance} [options.appearance] The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Boolean} [options.interleave=false] When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.\n * @param {Boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n * @param {Boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n * @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.\n * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on creation to have effect.\n *\n * @example\n * // 1. Draw a polyline on terrain with a basic color material\n *\n * const instance = new Cesium.GeometryInstance({\n * geometry : new Cesium.GroundPolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -112.1340164450331, 36.05494287836128,\n * -112.08821010582645, 36.097804071380715\n * ]),\n * width : 4.0\n * }),\n * id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n *\n * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({\n * geometryInstances : instance,\n * appearance : new Cesium.PolylineMaterialAppearance()\n * }));\n *\n * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.\n * // Distance display conditions for polylines on terrain are based on an approximate terrain height\n * // instead of true terrain height.\n *\n * const instance2 = new Cesium.GeometryInstance({\n * geometry : new Cesium.GroundPolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -112.1340164450331, 36.05494287836128,\n * -112.08821010582645, 36.097804071380715,\n * -112.13296079730024, 36.168769146801104\n * ]),\n * loop : true,\n * width : 4.0\n * }),\n * attributes : {\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),\n * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)\n * },\n * id : 'object returned when this instance is picked and to get/set per-instance attributes'\n * });\n *\n * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({\n * geometryInstances : instance2,\n * appearance : new Cesium.PolylineColorAppearance()\n * }));\n */\nfunction GroundPolylinePrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The geometry instances rendered with this primitive. This may\n * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>\n * is <code>true</code> when the primitive is constructed.\n * <p>\n * Changing this property after the primitive is rendered has no effect.\n * </p>\n *\n * @readonly\n * @type {Array|GeometryInstance}\n *\n * @default undefined\n */\n this.geometryInstances = options.geometryInstances;\n this._hasPerInstanceColors = true;\n\n let appearance = options.appearance;\n if (!defined(appearance)) {\n appearance = new PolylineMaterialAppearance();\n }\n /**\n * The {@link Appearance} used to shade this primitive. Each geometry\n * instance is shaded with the same appearance. Some appearances, like\n * {@link PolylineColorAppearance} allow giving each instance unique\n * properties.\n *\n * @type Appearance\n *\n * @default undefined\n */\n this.appearance = appearance;\n\n /**\n * Determines if the primitive will be shown. This affects all geometry\n * instances in the primitive.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * Determines whether terrain, 3D Tiles or both will be classified.\n *\n * @type {ClassificationType}\n *\n * @default ClassificationType.BOTH\n */\n this.classificationType = defaultValue(\n options.classificationType,\n ClassificationType.BOTH\n );\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n // Shadow volume is shown by removing a discard in the shader, so this isn't toggleable.\n this._debugShowShadowVolume = defaultValue(\n options.debugShowShadowVolume,\n false\n );\n\n this._primitiveOptions = {\n geometryInstances: undefined,\n appearance: undefined,\n vertexCacheOptimize: false,\n interleave: defaultValue(options.interleave, false),\n releaseGeometryInstances: defaultValue(\n options.releaseGeometryInstances,\n true\n ),\n allowPicking: defaultValue(options.allowPicking, true),\n asynchronous: defaultValue(options.asynchronous, true),\n compressVertices: false,\n _createShaderProgramFunction: undefined,\n _createCommandsFunction: undefined,\n _updateAndQueueCommandsFunction: undefined,\n };\n\n // Used when inserting in an OrderedPrimitiveCollection\n this._zIndex = undefined;\n\n this._ready = false;\n const groundPolylinePrimitive = this;\n this._readyPromise = new Promise((resolve, reject) => {\n groundPolylinePrimitive._completeLoad = () => {\n this._ready = true;\n\n if (this.releaseGeometryInstances) {\n this.geometryInstances = undefined;\n }\n\n const error = this._error;\n if (!defined(error)) {\n resolve(this);\n } else {\n reject(error);\n }\n };\n });\n\n this._primitive = undefined;\n\n this._sp = undefined;\n this._sp2D = undefined;\n this._spMorph = undefined;\n\n this._renderState = getRenderState(false);\n this._renderState3DTiles = getRenderState(true);\n\n this._renderStateMorph = RenderState.fromCache({\n cull: {\n enabled: true,\n face: CullFace.FRONT, // Geometry is \"inverted,\" so cull front when materials on volume instead of on terrain (morph)\n },\n depthTest: {\n enabled: true,\n },\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n depthMask: false,\n });\n}\n\nObject.defineProperties(GroundPolylinePrimitive.prototype, {\n /**\n * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n interleave: {\n get: function () {\n return this._primitiveOptions.interleave;\n },\n },\n\n /**\n * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n releaseGeometryInstances: {\n get: function () {\n return this._primitiveOptions.releaseGeometryInstances;\n },\n },\n\n /**\n * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n allowPicking: {\n get: function () {\n return this._primitiveOptions.allowPicking;\n },\n },\n\n /**\n * Determines if the geometry instances will be created and batched on a web worker.\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n asynchronous: {\n get: function () {\n return this._primitiveOptions.asynchronous;\n },\n },\n\n /**\n * Determines if the primitive is complete and ready to render. If this property is\n * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}\n * is called.\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof GroundPolylinePrimitive.prototype\n * @type {Promise.<GroundPolylinePrimitive>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * If true, draws the shadow volume for each geometry in the primitive.\n * </p>\n *\n * @memberof GroundPolylinePrimitive.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n debugShowShadowVolume: {\n get: function () {\n return this._debugShowShadowVolume;\n },\n },\n});\n\n/**\n * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the\n * GroundPolylinePrimitive synchronously.\n *\n * @returns {Promise<void>} A promise that will resolve once the terrain heights have been loaded.\n */\nGroundPolylinePrimitive.initializeTerrainHeights = function () {\n return ApproximateTerrainHeights.initialize();\n};\n\nfunction createShaderProgram(groundPolylinePrimitive, frameState, appearance) {\n const context = frameState.context;\n const primitive = groundPolylinePrimitive._primitive;\n const attributeLocations = primitive._attributeLocations;\n\n let vs = primitive._batchTable.getVertexShaderCallback()(\n PolylineShadowVolumeVS\n );\n vs = Primitive._appendShowToShader(primitive, vs);\n vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs);\n vs = Primitive._modifyShaderPosition(\n groundPolylinePrimitive,\n vs,\n frameState.scene3DOnly\n );\n\n let vsMorph = primitive._batchTable.getVertexShaderCallback()(\n PolylineShadowVolumeMorphVS\n );\n vsMorph = Primitive._appendShowToShader(primitive, vsMorph);\n vsMorph = Primitive._appendDistanceDisplayConditionToShader(\n primitive,\n vsMorph\n );\n vsMorph = Primitive._modifyShaderPosition(\n groundPolylinePrimitive,\n vsMorph,\n frameState.scene3DOnly\n );\n\n // Access pick color from fragment shader.\n // Helps with varying budget.\n let fs = primitive._batchTable.getVertexShaderCallback()(\n PolylineShadowVolumeFS\n );\n\n const vsDefines = [\n `GLOBE_MINIMUM_ALTITUDE ${frameState.mapProjection.ellipsoid.minimumRadius.toFixed(\n 1\n )}`,\n ];\n let colorDefine = \"\";\n let materialShaderSource = \"\";\n if (defined(appearance.material)) {\n materialShaderSource = defined(appearance.material)\n ? appearance.material.shaderSource\n : \"\";\n\n // Check for use of v_width and v_polylineAngle in material shader\n // to determine whether these varyings should be active in the vertex shader.\n if (\n materialShaderSource.search(/varying\\s+float\\s+v_polylineAngle;/g) !== -1\n ) {\n vsDefines.push(\"ANGLE_VARYING\");\n }\n if (materialShaderSource.search(/varying\\s+float\\s+v_width;/g) !== -1) {\n vsDefines.push(\"WIDTH_VARYING\");\n }\n } else {\n colorDefine = \"PER_INSTANCE_COLOR\";\n }\n\n vsDefines.push(colorDefine);\n const fsDefines = groundPolylinePrimitive.debugShowShadowVolume\n ? [\"DEBUG_SHOW_VOLUME\", colorDefine]\n : [colorDefine];\n\n const vsColor3D = new ShaderSource({\n defines: vsDefines,\n sources: [vs],\n });\n const fsColor3D = new ShaderSource({\n defines: fsDefines,\n sources: [materialShaderSource, fs],\n });\n groundPolylinePrimitive._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: primitive._sp,\n vertexShaderSource: vsColor3D,\n fragmentShaderSource: fsColor3D,\n attributeLocations: attributeLocations,\n });\n\n // Derive 2D/CV\n let colorProgram2D = context.shaderCache.getDerivedShaderProgram(\n groundPolylinePrimitive._sp,\n \"2dColor\"\n );\n if (!defined(colorProgram2D)) {\n const vsColor2D = new ShaderSource({\n defines: vsDefines.concat([\"COLUMBUS_VIEW_2D\"]),\n sources: [vs],\n });\n colorProgram2D = context.shaderCache.createDerivedShaderProgram(\n groundPolylinePrimitive._sp,\n \"2dColor\",\n {\n context: context,\n shaderProgram: groundPolylinePrimitive._sp2D,\n vertexShaderSource: vsColor2D,\n fragmentShaderSource: fsColor3D,\n attributeLocations: attributeLocations,\n }\n );\n }\n groundPolylinePrimitive._sp2D = colorProgram2D;\n\n // Derive Morph\n let colorProgramMorph = context.shaderCache.getDerivedShaderProgram(\n groundPolylinePrimitive._sp,\n \"MorphColor\"\n );\n if (!defined(colorProgramMorph)) {\n const vsColorMorph = new ShaderSource({\n defines: vsDefines.concat([\n `MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(\n 1\n )}`,\n ]),\n sources: [vsMorph],\n });\n\n fs = primitive._batchTable.getVertexShaderCallback()(\n PolylineShadowVolumeMorphFS\n );\n const fsColorMorph = new ShaderSource({\n defines: fsDefines,\n sources: [materialShaderSource, fs],\n });\n colorProgramMorph = context.shaderCache.createDerivedShaderProgram(\n groundPolylinePrimitive._sp,\n \"MorphColor\",\n {\n context: context,\n shaderProgram: groundPolylinePrimitive._spMorph,\n vertexShaderSource: vsColorMorph,\n fragmentShaderSource: fsColorMorph,\n attributeLocations: attributeLocations,\n }\n );\n }\n groundPolylinePrimitive._spMorph = colorProgramMorph;\n}\n\nfunction getRenderState(mask3DTiles) {\n return RenderState.fromCache({\n cull: {\n enabled: true, // prevent double-draw. Geometry is \"inverted\" (reversed winding order) so we're drawing backfaces.\n },\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n depthMask: false,\n stencilTest: {\n enabled: mask3DTiles,\n frontFunction: StencilFunction.EQUAL,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: StencilFunction.EQUAL,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n });\n}\n\nfunction createCommands(\n groundPolylinePrimitive,\n appearance,\n material,\n translucent,\n colorCommands,\n pickCommands\n) {\n const primitive = groundPolylinePrimitive._primitive;\n const length = primitive._va.length;\n colorCommands.length = length;\n pickCommands.length = length;\n\n const isPolylineColorAppearance =\n appearance instanceof PolylineColorAppearance;\n\n const materialUniforms = isPolylineColorAppearance ? {} : material._uniforms;\n const uniformMap = primitive._batchTable.getUniformMapCallback()(\n materialUniforms\n );\n\n for (let i = 0; i < length; i++) {\n const vertexArray = primitive._va[i];\n\n let command = colorCommands[i];\n if (!defined(command)) {\n command = colorCommands[i] = new DrawCommand({\n owner: groundPolylinePrimitive,\n primitiveType: primitive._primitiveType,\n });\n }\n\n command.vertexArray = vertexArray;\n command.renderState = groundPolylinePrimitive._renderState;\n command.shaderProgram = groundPolylinePrimitive._sp;\n command.uniformMap = uniformMap;\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n command.pickId = \"czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)\";\n\n const derivedTilesetCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedTilesetCommand.renderState =\n groundPolylinePrimitive._renderState3DTiles;\n derivedTilesetCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedTilesetCommand;\n\n // derive for 2D\n const derived2DCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.color2D\n );\n derived2DCommand.shaderProgram = groundPolylinePrimitive._sp2D;\n command.derivedCommands.color2D = derived2DCommand;\n\n const derived2DTilesetCommand = DrawCommand.shallowClone(\n derivedTilesetCommand,\n derivedTilesetCommand.derivedCommands.color2D\n );\n derived2DTilesetCommand.shaderProgram = groundPolylinePrimitive._sp2D;\n derivedTilesetCommand.derivedCommands.color2D = derived2DTilesetCommand;\n\n // derive for Morph\n const derivedMorphCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.colorMorph\n );\n derivedMorphCommand.renderState = groundPolylinePrimitive._renderStateMorph;\n derivedMorphCommand.shaderProgram = groundPolylinePrimitive._spMorph;\n derivedMorphCommand.pickId = \"czm_batchTable_pickColor(v_batchId)\";\n command.derivedCommands.colorMorph = derivedMorphCommand;\n }\n}\n\nfunction updateAndQueueCommand(\n groundPolylinePrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n) {\n // Use derived appearance command for morph and 2D\n if (frameState.mode === SceneMode.MORPHING) {\n command = command.derivedCommands.colorMorph;\n } else if (frameState.mode !== SceneMode.SCENE3D) {\n command = command.derivedCommands.color2D;\n }\n command.modelMatrix = modelMatrix;\n command.boundingVolume = boundingVolume;\n command.cull = cull;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n\n frameState.commandList.push(command);\n}\n\nfunction updateAndQueueCommands(\n groundPolylinePrimitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume\n) {\n const primitive = groundPolylinePrimitive._primitive;\n\n Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix); // Expected to be identity - GroundPrimitives don't support other model matrices\n\n let boundingSpheres;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingSpheres = primitive._boundingSphereWC;\n } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n boundingSpheres = primitive._boundingSphereCV;\n } else if (\n frameState.mode === SceneMode.SCENE2D &&\n defined(primitive._boundingSphere2D)\n ) {\n boundingSpheres = primitive._boundingSphere2D;\n } else if (defined(primitive._boundingSphereMorph)) {\n boundingSpheres = primitive._boundingSphereMorph;\n }\n\n const morphing = frameState.mode === SceneMode.MORPHING;\n const classificationType = groundPolylinePrimitive.classificationType;\n const queueTerrainCommands =\n classificationType !== ClassificationType.CESIUM_3D_TILE;\n const queue3DTilesCommands =\n classificationType !== ClassificationType.TERRAIN && !morphing;\n\n let command;\n const passes = frameState.passes;\n if (passes.render || (passes.pick && primitive.allowPicking)) {\n const colorLength = colorCommands.length;\n for (let j = 0; j < colorLength; ++j) {\n const boundingVolume = boundingSpheres[j];\n if (queueTerrainCommands) {\n command = colorCommands[j];\n updateAndQueueCommand(\n groundPolylinePrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n if (queue3DTilesCommands) {\n command = colorCommands[j].derivedCommands.tileset;\n updateAndQueueCommand(\n groundPolylinePrimitive,\n command,\n frameState,\n modelMatrix,\n cull,\n boundingVolume,\n debugShowBoundingVolume\n );\n }\n }\n }\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.\n * @exception {DeveloperError} All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.\n */\nGroundPolylinePrimitive.prototype.update = function (frameState) {\n if (!defined(this._primitive) && !defined(this.geometryInstances)) {\n return;\n }\n\n if (!ApproximateTerrainHeights.initialized) {\n GroundPolylinePrimitive.initializeTerrainHeights();\n return;\n }\n\n let i;\n\n const that = this;\n const primitiveOptions = this._primitiveOptions;\n if (!defined(this._primitive)) {\n const geometryInstances = Array.isArray(this.geometryInstances)\n ? this.geometryInstances\n : [this.geometryInstances];\n const geometryInstancesLength = geometryInstances.length;\n const groundInstances = new Array(geometryInstancesLength);\n\n let attributes;\n\n // Check if each instance has a color attribute.\n for (i = 0; i < geometryInstancesLength; ++i) {\n attributes = geometryInstances[i].attributes;\n if (!defined(attributes) || !defined(attributes.color)) {\n this._hasPerInstanceColors = false;\n break;\n }\n }\n\n for (i = 0; i < geometryInstancesLength; ++i) {\n const geometryInstance = geometryInstances[i];\n attributes = {};\n const instanceAttributes = geometryInstance.attributes;\n for (const attributeKey in instanceAttributes) {\n if (instanceAttributes.hasOwnProperty(attributeKey)) {\n attributes[attributeKey] = instanceAttributes[attributeKey];\n }\n }\n\n // Automatically create line width attribute if not already given\n if (!defined(attributes.width)) {\n attributes.width = new GeometryInstanceAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1.0,\n value: [geometryInstance.geometry.width],\n });\n }\n\n // Update each geometry for framestate.scene3DOnly = true and projection\n geometryInstance.geometry._scene3DOnly = frameState.scene3DOnly;\n GroundPolylineGeometry.setProjectionAndEllipsoid(\n geometryInstance.geometry,\n frameState.mapProjection\n );\n\n groundInstances[i] = new GeometryInstance({\n geometry: geometryInstance.geometry,\n attributes: attributes,\n id: geometryInstance.id,\n pickPrimitive: that,\n });\n }\n\n primitiveOptions.geometryInstances = groundInstances;\n primitiveOptions.appearance = this.appearance;\n\n primitiveOptions._createShaderProgramFunction = function (\n primitive,\n frameState,\n appearance\n ) {\n createShaderProgram(that, frameState, appearance);\n };\n primitiveOptions._createCommandsFunction = function (\n primitive,\n appearance,\n material,\n translucent,\n twoPasses,\n colorCommands,\n pickCommands\n ) {\n createCommands(\n that,\n appearance,\n material,\n translucent,\n colorCommands,\n pickCommands\n );\n };\n primitiveOptions._updateAndQueueCommandsFunction = function (\n primitive,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume,\n twoPasses\n ) {\n updateAndQueueCommands(\n that,\n frameState,\n colorCommands,\n pickCommands,\n modelMatrix,\n cull,\n debugShowBoundingVolume\n );\n };\n\n this._primitive = new Primitive(primitiveOptions);\n this._primitive.readyPromise.then(this._completeLoad);\n }\n\n if (\n this.appearance instanceof PolylineColorAppearance &&\n !this._hasPerInstanceColors\n ) {\n throw new DeveloperError(\n \"All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.\"\n );\n }\n\n this._primitive.appearance = this.appearance;\n this._primitive.show = this.show;\n this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;\n this._primitive.update(frameState);\n};\n\n/**\n * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.\n *\n * @param {*} id The id of the {@link GeometryInstance}.\n * @returns {Object} The typed array in the attribute's format or undefined if the is no instance with id.\n *\n * @exception {DeveloperError} must call update before calling getGeometryInstanceAttributes.\n *\n * @example\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\n * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);\n * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);\n */\nGroundPolylinePrimitive.prototype.getGeometryInstanceAttributes = function (\n id\n) {\nreturn this._primitive.getGeometryInstanceAttributes(id);\n};\n\n/**\n * Checks if the given Scene supports GroundPolylinePrimitives.\n * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.\n *\n * @param {Scene} scene The current scene.\n * @returns {Boolean} Whether or not the current scene supports GroundPolylinePrimitives.\n */\nGroundPolylinePrimitive.isSupported = function (scene) {\n return scene.frameState.context.depthTexture;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see GroundPolylinePrimitive#destroy\n */\nGroundPolylinePrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see GroundPolylinePrimitive#isDestroyed\n */\nGroundPolylinePrimitive.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n this._sp = this._sp && this._sp.destroy();\n\n // Derived programs, destroyed above if they existed.\n this._sp2D = undefined;\n this._spMorph = undefined;\n\n return destroyObject(this);\n};\nexport default GroundPolylinePrimitive;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultRepeat = new Cartesian2(1, 1);\nconst defaultTransparent = false;\nconst defaultColor = Color.WHITE;\n\n/**\n * A {@link MaterialProperty} that maps to image {@link Material} uniforms.\n * @alias ImageMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|String|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [options.image] A Property specifying the Image, URL, Canvas, or Video.\n * @param {Property|Cartesian2} [options.repeat=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.\n * @param {Property|Color} [options.color=Color.WHITE] The color applied to the image\n * @param {Property|Boolean} [options.transparent=false] Set to true when the image has transparency (for example, when a png has transparent sections)\n */\nfunction ImageMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._image = undefined;\n this._imageSubscription = undefined;\n this._repeat = undefined;\n this._repeatSubscription = undefined;\n this._color = undefined;\n this._colorSubscription = undefined;\n this._transparent = undefined;\n this._transparentSubscription = undefined;\n\n this.image = options.image;\n this.repeat = options.repeat;\n this.color = options.color;\n this.transparent = options.transparent;\n}\n\nObject.defineProperties(ImageMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof ImageMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._image) && Property.isConstant(this._repeat)\n );\n },\n },\n\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof ImageMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.\n * @memberof ImageMaterialProperty.prototype\n * @type {Property|undefined}\n */\n image: createPropertyDescriptor(\"image\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.\n * @memberof ImageMaterialProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(1, 1)\n */\n repeat: createPropertyDescriptor(\"repeat\"),\n\n /**\n * Gets or sets the Color Property specifying the desired color applied to the image.\n * @memberof ImageMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the Boolean Property specifying whether the image has transparency\n * @memberof ImageMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n transparent: createPropertyDescriptor(\"transparent\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nImageMaterialProperty.prototype.getType = function (time) {\n return \"Image\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nImageMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n\n result.image = Property.getValueOrUndefined(this._image, time);\n result.repeat = Property.getValueOrClonedDefault(\n this._repeat,\n time,\n defaultRepeat,\n result.repeat\n );\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n defaultColor,\n result.color\n );\n if (Property.getValueOrDefault(this._transparent, time, defaultTransparent)) {\n result.color.alpha = Math.min(0.99, result.color.alpha);\n }\n\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nImageMaterialProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof ImageMaterialProperty &&\n Property.equals(this._image, other._image) &&\n Property.equals(this._repeat, other._repeat) &&\n Property.equals(this._color, other._color) &&\n Property.equals(this._transparent, other._transparent))\n );\n};\nexport default ImageMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport ImageMaterialProperty from \"./ImageMaterialProperty.js\";\n\nfunction createMaterialProperty(value) {\n if (value instanceof Color) {\n return new ColorMaterialProperty(value);\n }\n\n if (\n typeof value === \"string\" ||\n value instanceof Resource ||\n value instanceof HTMLCanvasElement ||\n value instanceof HTMLVideoElement\n ) {\n const result = new ImageMaterialProperty();\n result.image = value;\n return result;\n }\n\n}\n\n/**\n * @private\n */\nfunction createMaterialPropertyDescriptor(name, configurable) {\n return createPropertyDescriptor(name, configurable, createMaterialProperty);\n}\nexport default createMaterialPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} BoxGraphics.ConstructorOptions\n *\n * Initialization options for the BoxGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the box.\n * @property {Property | Cartesian3} [dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the box is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the box.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the box is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the box casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this box will be displayed.\n *\n */\n\n/**\n * Describes a box. The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias BoxGraphics\n * @constructor\n *\n * @param {BoxGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}\n */\nfunction BoxGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._dimensions = undefined;\n this._dimensionsSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(BoxGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof BoxGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the box.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n */\n dimensions: createPropertyDescriptor(\"dimensions\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the box is filled with the provided material.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the material used to fill the box.\n * @memberof BoxGraphics.prototype\n * @type {MaterialProperty|undefined}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the box is outlined.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the box\n * casts or receives shadows from light sources.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.\n * @memberof BoxGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {BoxGraphics} [result] The object onto which to store the result.\n * @returns {BoxGraphics} The modified result parameter or a new instance if one was not provided.\n */\nBoxGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new BoxGraphics(this);\n }\n result.show = this.show;\n result.dimensions = this.dimensions;\n result.heightReference = this.heightReference;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {BoxGraphics} source The object to be merged into this object.\n */\nBoxGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.dimensions = defaultValue(this.dimensions, source.dimensions);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default BoxGraphics;\n", "/**\n * Constants for identifying well-known reference frames.\n *\n * @enum {Number}\n */\nconst ReferenceFrame = {\n /**\n * The fixed frame.\n *\n * @type {Number}\n * @constant\n */\n FIXED: 0,\n\n /**\n * The inertial frame.\n *\n * @type {Number}\n * @constant\n */\n INERTIAL: 1,\n};\nexport default Object.freeze(ReferenceFrame);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Transforms from \"../Core/Transforms.js\";\n\n/**\n * The interface for all {@link Property} objects that define a world\n * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.\n * This type defines an interface and cannot be instantiated directly.\n *\n * @alias PositionProperty\n * @constructor\n * @abstract\n *\n * @see CompositePositionProperty\n * @see ConstantPositionProperty\n * @see SampledPositionProperty\n * @see TimeIntervalCollectionPositionProperty\n */\nfunction PositionProperty() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(PositionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof PositionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof PositionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the reference frame that the position is defined in.\n * @memberof PositionProperty.prototype\n * @type {ReferenceFrame}\n */\n referenceFrame: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionProperty.prototype.getValue = DeveloperError.throwInstantiationError;\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n * @function\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionProperty.prototype.getValueInReferenceFrame =\n DeveloperError.throwInstantiationError;\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n * @function\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPositionProperty.prototype.equals = DeveloperError.throwInstantiationError;\n\nconst scratchMatrix3 = new Matrix3();\n\n/**\n * @private\n */\nPositionProperty.convertToReferenceFrame = function (\n time,\n value,\n inputFrame,\n outputFrame,\n result\n) {\n if (!defined(value)) {\n return value;\n }\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n if (inputFrame === outputFrame) {\n return Cartesian3.clone(value, result);\n }\n\n let icrfToFixed = Transforms.computeIcrfToFixedMatrix(time, scratchMatrix3);\n if (!defined(icrfToFixed)) {\n icrfToFixed = Transforms.computeTemeToPseudoFixedMatrix(\n time,\n scratchMatrix3\n );\n }\n if (inputFrame === ReferenceFrame.INERTIAL) {\n return Matrix3.multiplyByVector(icrfToFixed, value, result);\n }\n if (inputFrame === ReferenceFrame.FIXED) {\n return Matrix3.multiplyByVector(\n Matrix3.transpose(icrfToFixed, scratchMatrix3),\n value,\n result\n );\n }\n};\nexport default PositionProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport PositionProperty from \"./PositionProperty.js\";\n\n/**\n * A {@link PositionProperty} whose value does not change in respect to the\n * {@link ReferenceFrame} in which is it defined.\n *\n * @alias ConstantPositionProperty\n * @constructor\n *\n * @param {Cartesian3} [value] The property value.\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction ConstantPositionProperty(value, referenceFrame) {\n this._definitionChanged = new Event();\n this._value = Cartesian3.clone(value);\n this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n}\n\nObject.defineProperties(ConstantPositionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof ConstantPositionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n !defined(this._value) || this._referenceFrame === ReferenceFrame.FIXED\n );\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof ConstantPositionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the reference frame in which the position is defined.\n * @memberof ConstantPositionProperty.prototype\n * @type {ReferenceFrame}\n * @default ReferenceFrame.FIXED;\n */\n referenceFrame: {\n get: function () {\n return this._referenceFrame;\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantPositionProperty.prototype.getValue = function (time, result) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Cartesian3} value The property value.\n * @param {ReferenceFrame} [referenceFrame=this.referenceFrame] The reference frame in which the position is defined.\n */\nConstantPositionProperty.prototype.setValue = function (value, referenceFrame) {\n let definitionChanged = false;\n if (!Cartesian3.equals(this._value, value)) {\n definitionChanged = true;\n this._value = Cartesian3.clone(value);\n }\n if (defined(referenceFrame) && this._referenceFrame !== referenceFrame) {\n definitionChanged = true;\n this._referenceFrame = referenceFrame;\n }\n if (definitionChanged) {\n this._definitionChanged.raiseEvent(this);\n }\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nConstantPositionProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n return PositionProperty.convertToReferenceFrame(\n time,\n this._value,\n this._referenceFrame,\n referenceFrame,\n result\n );\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nConstantPositionProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof ConstantPositionProperty &&\n Cartesian3.equals(this._value, other._value) &&\n this._referenceFrame === other._referenceFrame)\n );\n};\nexport default ConstantPositionProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} CorridorGraphics.ConstructorOptions\n *\n * Initialization options for the CorridorGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the corridor.\n * @property {Property | Cartesian3[]} [positions] A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.\n * @property {Property | number} [width] A numeric Property specifying the distance between the edges of the corridor.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the corridor is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the corridor.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the corridor is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the corridor casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this corridor will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex] A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static.\n */\n\n/**\n * Describes a corridor, which is a shape defined by a centerline and width that\n * conforms to the curvature of the globe. It can be placed on the surface or at altitude\n * and can optionally be extruded into a volume.\n *\n * @alias CorridorGraphics\n * @constructor\n *\n * @param {CorridorGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}\n */\nfunction CorridorGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._positions = undefined;\n this._positionsSubscription = undefined;\n this._width = undefined;\n this._widthSubscription = undefined;\n this._height = undefined;\n this._heightSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._extrudedHeight = undefined;\n this._extrudedHeightSubscription = undefined;\n this._extrudedHeightReference = undefined;\n this._extrudedHeightReferenceSubscription = undefined;\n this._cornerType = undefined;\n this._cornerTypeSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._classificationType = undefined;\n this._classificationTypeSubscription = undefined;\n this._zIndex = undefined;\n this._zIndexSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(CorridorGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof CorridorGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the corridor.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n */\n positions: createPropertyDescriptor(\"positions\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n */\n width: createPropertyDescriptor(\"width\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the corridor.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n height: createPropertyDescriptor(\"height\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.\n * Setting this property creates a corridor shaped volume starting at height and ending\n * at this altitude.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n */\n extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n /**\n * Gets or sets the Property specifying the extruded {@link HeightReference}.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n /**\n * Gets or sets the {@link CornerType} Property specifying how corners are styled.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default CornerType.ROUNDED\n */\n cornerType: createPropertyDescriptor(\"cornerType\"),\n\n /**\n * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the corridor.\n * @memberof CorridorGraphics.prototype\n * @type {MaterialProperty|undefined}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the corridor is outlined.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the corridor\n * casts or receives shadows from light sources.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof CorridorGraphics.prototype\n * @type {Property|undefined}\n * @default ClassificationType.BOTH\n */\n classificationType: createPropertyDescriptor(\"classificationType\"),\n\n /**\n * Gets or sets the zIndex Property specifying the ordering of the corridor. Only has an effect if the coridor is static and neither height or exturdedHeight are specified.\n * @memberof CorridorGraphics.prototype\n * @type {ConstantProperty|undefined}\n * @default 0\n */\n zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {CorridorGraphics} [result] The object onto which to store the result.\n * @returns {CorridorGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCorridorGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new CorridorGraphics(this);\n }\n result.show = this.show;\n result.positions = this.positions;\n result.width = this.width;\n result.height = this.height;\n result.heightReference = this.heightReference;\n result.extrudedHeight = this.extrudedHeight;\n result.extrudedHeightReference = this.extrudedHeightReference;\n result.cornerType = this.cornerType;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.classificationType = this.classificationType;\n result.zIndex = this.zIndex;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {CorridorGraphics} source The object to be merged into this object.\n */\nCorridorGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.positions = defaultValue(this.positions, source.positions);\n this.width = defaultValue(this.width, source.width);\n this.height = defaultValue(this.height, source.height);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.extrudedHeight = defaultValue(\n this.extrudedHeight,\n source.extrudedHeight\n );\n this.extrudedHeightReference = defaultValue(\n this.extrudedHeightReference,\n source.extrudedHeightReference\n );\n this.cornerType = defaultValue(this.cornerType, source.cornerType);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.classificationType = defaultValue(\n this.classificationType,\n source.classificationType\n );\n this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default CorridorGraphics;\n", "import createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\nfunction createRawProperty(value) {\n return value;\n}\n\n/**\n * @private\n */\nfunction createRawPropertyDescriptor(name, configurable) {\n return createPropertyDescriptor(name, configurable, createRawProperty);\n}\nexport default createRawPropertyDescriptor;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} CylinderGraphics.ConstructorOptions\n *\n * Initialization options for the CylinderGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the cylinder.\n * @property {Property | number} [length] A numeric Property specifying the length of the cylinder.\n * @property {Property | number} [topRadius] A numeric Property specifying the radius of the top of the cylinder.\n * @property {Property | number} [bottomRadius] A numeric Property specifying the radius of the bottom of the cylinder.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the cylinder is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the cylinder.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the cylinder is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @property {Property | number} [slices=128] The number of edges around the perimeter of the cylinder.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the cylinder casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this cylinder will be displayed.\n */\n\n/**\n * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.\n * The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias CylinderGraphics\n * @constructor\n *\n * @param {CylinderGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction CylinderGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._length = undefined;\n this._lengthSubscription = undefined;\n this._topRadius = undefined;\n this._topRadiusSubscription = undefined;\n this._bottomRadius = undefined;\n this._bottomRadiusSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._numberOfVerticalLines = undefined;\n this._numberOfVerticalLinesSubscription = undefined;\n this._slices = undefined;\n this._slicesSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(CylinderGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof CylinderGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the numeric Property specifying the length of the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n */\n length: createPropertyDescriptor(\"length\"),\n\n /**\n * Gets or sets the numeric Property specifying the radius of the top of the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n */\n topRadius: createPropertyDescriptor(\"topRadius\"),\n\n /**\n * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n */\n bottomRadius: createPropertyDescriptor(\"bottomRadius\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {MaterialProperty|undefined}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the cylinder is outlined.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default 16\n */\n numberOfVerticalLines: createPropertyDescriptor(\"numberOfVerticalLines\"),\n\n /**\n * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default 128\n */\n slices: createPropertyDescriptor(\"slices\"),\n\n /**\n * Get or sets the enum Property specifying whether the cylinder\n * casts or receives shadows from light sources.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.\n * @memberof CylinderGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {CylinderGraphics} [result] The object onto which to store the result.\n * @returns {CylinderGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCylinderGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new CylinderGraphics(this);\n }\n result.show = this.show;\n result.length = this.length;\n result.topRadius = this.topRadius;\n result.bottomRadius = this.bottomRadius;\n result.heightReference = this.heightReference;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.numberOfVerticalLines = this.numberOfVerticalLines;\n result.slices = this.slices;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {CylinderGraphics} source The object to be merged into this object.\n */\nCylinderGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.length = defaultValue(this.length, source.length);\n this.topRadius = defaultValue(this.topRadius, source.topRadius);\n this.bottomRadius = defaultValue(this.bottomRadius, source.bottomRadius);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.numberOfVerticalLines = defaultValue(\n this.numberOfVerticalLines,\n source.numberOfVerticalLines\n );\n this.slices = defaultValue(this.slices, source.slices);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default CylinderGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} EllipseGraphics.ConstructorOptions\n *\n * Initialization options for the EllipseGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipse.\n * @property {Property | number} [semiMajorAxis] The numeric Property specifying the semi-major axis.\n * @property {Property | number} [semiMinorAxis] The numeric Property specifying the semi-minor axis.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipse is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipse.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipse is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipse casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipse will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified.\n */\n\n/**\n * Describes an ellipse defined by a center point and semi-major and semi-minor axes.\n * The ellipse conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n * The center point is determined by the containing {@link Entity}.\n *\n * @alias EllipseGraphics\n * @constructor\n *\n * @param {EllipseGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Circles and Ellipses.html|Cesium Sandcastle Circles and Ellipses Demo}\n */\nfunction EllipseGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._semiMajorAxis = undefined;\n this._semiMajorAxisSubscription = undefined;\n this._semiMinorAxis = undefined;\n this._semiMinorAxisSubscription = undefined;\n this._height = undefined;\n this._heightSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._extrudedHeight = undefined;\n this._extrudedHeightSubscription = undefined;\n this._extrudedHeightReference = undefined;\n this._extrudedHeightReferenceSubscription = undefined;\n this._rotation = undefined;\n this._rotationSubscription = undefined;\n this._stRotation = undefined;\n this._stRotationSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._numberOfVerticalLines = undefined;\n this._numberOfVerticalLinesSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._classificationType = undefined;\n this._classificationTypeSubscription = undefined;\n this._zIndex = undefined;\n this._zIndexSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(EllipseGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof EllipseGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the ellipse.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the numeric Property specifying the semi-major axis.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n */\n semiMajorAxis: createPropertyDescriptor(\"semiMajorAxis\"),\n\n /**\n * Gets or sets the numeric Property specifying the semi-minor axis.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n */\n semiMinorAxis: createPropertyDescriptor(\"semiMinorAxis\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the ellipse.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n height: createPropertyDescriptor(\"height\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.\n * Setting this property creates volume starting at height and ending at this altitude.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n */\n extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n /**\n * Gets or sets the Property specifying the extruded {@link HeightReference}.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n /**\n * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n rotation: createPropertyDescriptor(\"rotation\"),\n\n /**\n * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n stRotation: createPropertyDescriptor(\"stRotation\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the ellipse.\n * @memberof EllipseGraphics.prototype\n * @type {MaterialProperty|undefined}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the ellipse is outlined.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default 16\n */\n numberOfVerticalLines: createPropertyDescriptor(\"numberOfVerticalLines\"),\n\n /**\n * Get or sets the enum Property specifying whether the ellipse\n * casts or receives shadows from light sources.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof EllipseGraphics.prototype\n * @type {Property|undefined}\n * @default ClassificationType.BOTH\n */\n classificationType: createPropertyDescriptor(\"classificationType\"),\n\n /**\n * Gets or sets the zIndex Property specifying the ellipse ordering. Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified\n * @memberof EllipseGraphics.prototype\n * @type {ConstantProperty|undefined}\n * @default 0\n */\n zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {EllipseGraphics} [result] The object onto which to store the result.\n * @returns {EllipseGraphics} The modified result parameter or a new instance if one was not provided.\n */\nEllipseGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new EllipseGraphics(this);\n }\n result.show = this.show;\n result.semiMajorAxis = this.semiMajorAxis;\n result.semiMinorAxis = this.semiMinorAxis;\n result.height = this.height;\n result.heightReference = this.heightReference;\n result.extrudedHeight = this.extrudedHeight;\n result.extrudedHeightReference = this.extrudedHeightReference;\n result.rotation = this.rotation;\n result.stRotation = this.stRotation;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.numberOfVerticalLines = this.numberOfVerticalLines;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.classificationType = this.classificationType;\n result.zIndex = this.zIndex;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {EllipseGraphics} source The object to be merged into this object.\n */\nEllipseGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.semiMajorAxis = defaultValue(this.semiMajorAxis, source.semiMajorAxis);\n this.semiMinorAxis = defaultValue(this.semiMinorAxis, source.semiMinorAxis);\n this.height = defaultValue(this.height, source.height);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.extrudedHeight = defaultValue(\n this.extrudedHeight,\n source.extrudedHeight\n );\n this.extrudedHeightReference = defaultValue(\n this.extrudedHeightReference,\n source.extrudedHeightReference\n );\n this.rotation = defaultValue(this.rotation, source.rotation);\n this.stRotation = defaultValue(this.stRotation, source.stRotation);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.numberOfVerticalLines = defaultValue(\n this.numberOfVerticalLines,\n source.numberOfVerticalLines\n );\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.classificationType = defaultValue(\n this.classificationType,\n source.classificationType\n );\n this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default EllipseGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} EllipsoidGraphics.ConstructorOptions\n *\n * Initialization options for the EllipsoidGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the ellipsoid.\n * @property {Property | Cartesian3} [radii] A {@link Cartesian3} Property specifying the radii of the ellipsoid.\n * @property {Property | Cartesian3} [innerRadii] A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.\n * @property {Property | number} [minimumClock=0.0] A Property specifying the minimum clock angle of the ellipsoid.\n * @property {Property | number} [maximumClock=2*PI] A Property specifying the maximum clock angle of the ellipsoid.\n * @property {Property | number} [minimumCone=0.0] A Property specifying the minimum cone angle of the ellipsoid.\n * @property {Property | number} [maximumCone=PI] A Property specifying the maximum cone angle of the ellipsoid.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the ellipsoid is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the ellipsoid.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the ellipsoid is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | number} [stackPartitions=64] A Property specifying the number of stacks.\n * @property {Property | number} [slicePartitions=64] A Property specifying the number of radial slices.\n * @property {Property | number} [subdivisions=128] A Property specifying the number of samples per outline ring, determining the granularity of the curvature.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this ellipsoid will be displayed.\n */\n\n/**\n * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias EllipsoidGraphics\n * @constructor\n *\n * @param {EllipsoidGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Spheres%20and%20Ellipsoids.html|Cesium Sandcastle Spheres and Ellipsoids Demo}\n */\nfunction EllipsoidGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._radii = undefined;\n this._radiiSubscription = undefined;\n this._innerRadii = undefined;\n this._innerRadiiSubscription = undefined;\n this._minimumClock = undefined;\n this._minimumClockSubscription = undefined;\n this._maximumClock = undefined;\n this._maximumClockSubscription = undefined;\n this._minimumCone = undefined;\n this._minimumConeSubscription = undefined;\n this._maximumCone = undefined;\n this._maximumConeSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._stackPartitions = undefined;\n this._stackPartitionsSubscription = undefined;\n this._slicePartitions = undefined;\n this._slicePartitionsSubscription = undefined;\n this._subdivisions = undefined;\n this._subdivisionsSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(EllipsoidGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof EllipsoidGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n */\n radii: createPropertyDescriptor(\"radii\"),\n\n /**\n * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default radii\n */\n innerRadii: createPropertyDescriptor(\"innerRadii\"),\n\n /**\n * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n minimumClock: createPropertyDescriptor(\"minimumClock\"),\n\n /**\n * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 2*PI\n */\n maximumClock: createPropertyDescriptor(\"maximumClock\"),\n\n /**\n * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n minimumCone: createPropertyDescriptor(\"minimumCone\"),\n\n /**\n * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default PI\n */\n maximumCone: createPropertyDescriptor(\"maximumCone\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the ellipsoid.\n * @memberof EllipsoidGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the ellipsoid is outlined.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets the Property specifying the number of stacks.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 64\n */\n stackPartitions: createPropertyDescriptor(\"stackPartitions\"),\n\n /**\n * Gets or sets the Property specifying the number of radial slices per 360 degrees.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 64\n */\n slicePartitions: createPropertyDescriptor(\"slicePartitions\"),\n\n /**\n * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default 128\n */\n subdivisions: createPropertyDescriptor(\"subdivisions\"),\n\n /**\n * Get or sets the enum Property specifying whether the ellipsoid\n * casts or receives shadows from light sources.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.\n * @memberof EllipsoidGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {EllipsoidGraphics} [result] The object onto which to store the result.\n * @returns {EllipsoidGraphics} The modified result parameter or a new instance if one was not provided.\n */\nEllipsoidGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new EllipsoidGraphics(this);\n }\n result.show = this.show;\n result.radii = this.radii;\n result.innerRadii = this.innerRadii;\n result.minimumClock = this.minimumClock;\n result.maximumClock = this.maximumClock;\n result.minimumCone = this.minimumCone;\n result.maximumCone = this.maximumCone;\n result.heightReference = this.heightReference;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.stackPartitions = this.stackPartitions;\n result.slicePartitions = this.slicePartitions;\n result.subdivisions = this.subdivisions;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {EllipsoidGraphics} source The object to be merged into this object.\n */\nEllipsoidGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.radii = defaultValue(this.radii, source.radii);\n this.innerRadii = defaultValue(this.innerRadii, source.innerRadii);\n this.minimumClock = defaultValue(this.minimumClock, source.minimumClock);\n this.maximumClock = defaultValue(this.maximumClock, source.maximumClock);\n this.minimumCone = defaultValue(this.minimumCone, source.minimumCone);\n this.maximumCone = defaultValue(this.maximumCone, source.maximumCone);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.stackPartitions = defaultValue(\n this.stackPartitions,\n source.stackPartitions\n );\n this.slicePartitions = defaultValue(\n this.slicePartitions,\n source.slicePartitions\n );\n this.subdivisions = defaultValue(this.subdivisions, source.subdivisions);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default EllipsoidGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} LabelGraphics.ConstructorOptions\n *\n * Initialization options for the LabelGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the label.\n * @property {Property | string} [text] A Property specifying the text. Explicit newlines '\\n' are supported.\n * @property {Property | string} [font='30px sans-serif'] A Property specifying the CSS font.\n * @property {Property | LabelStyle} [style=LabelStyle.FILL] A Property specifying the {@link LabelStyle}.\n * @property {Property | number} [scale=1.0] A numeric Property specifying the scale to apply to the text.\n * @property {Property | boolean} [showBackground=false] A boolean Property specifying the visibility of the background behind the label.\n * @property {Property | Color} [backgroundColor=new Color(0.165, 0.165, 0.165, 0.8)] A Property specifying the background {@link Color}.\n * @property {Property | Cartesian2} [backgroundPadding=new Cartesian2(7, 5)] A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.\n * @property {Property | Cartesian2} [pixelOffset=Cartesian2.ZERO] A {@link Cartesian2} Property specifying the pixel offset.\n * @property {Property | Cartesian3} [eyeOffset=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the eye offset.\n * @property {Property | HorizontalOrigin} [horizontalOrigin=HorizontalOrigin.CENTER] A Property specifying the {@link HorizontalOrigin}.\n * @property {Property | VerticalOrigin} [verticalOrigin=VerticalOrigin.CENTER] A Property specifying the {@link VerticalOrigin}.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [fillColor=Color.WHITE] A Property specifying the fill {@link Color}.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the outline {@link Color}.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the outline width.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | NearFarScalar} [pixelOffsetScaleByDistance] A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to set scale based on distance from the camera.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this label will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a two dimensional label located at the position of the containing {@link Entity}.\n * <p>\n * <div align='center'>\n * <img src='Images/Label.png' width='400' height='300' /><br />\n * Example labels\n * </div>\n * </p>\n *\n * @alias LabelGraphics\n * @constructor\n *\n * @param {LabelGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n */\nfunction LabelGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._text = undefined;\n this._textSubscription = undefined;\n this._font = undefined;\n this._fontSubscription = undefined;\n this._style = undefined;\n this._styleSubscription = undefined;\n this._scale = undefined;\n this._scaleSubscription = undefined;\n this._showBackground = undefined;\n this._showBackgroundSubscription = undefined;\n this._backgroundColor = undefined;\n this._backgroundColorSubscription = undefined;\n this._backgroundPadding = undefined;\n this._backgroundPaddingSubscription = undefined;\n this._pixelOffset = undefined;\n this._pixelOffsetSubscription = undefined;\n this._eyeOffset = undefined;\n this._eyeOffsetSubscription = undefined;\n this._horizontalOrigin = undefined;\n this._horizontalOriginSubscription = undefined;\n this._verticalOrigin = undefined;\n this._verticalOriginSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._fillColor = undefined;\n this._fillColorSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._translucencyByDistance = undefined;\n this._translucencyByDistanceSubscription = undefined;\n this._pixelOffsetScaleByDistance = undefined;\n this._pixelOffsetScaleByDistanceSubscription = undefined;\n this._scaleByDistance = undefined;\n this._scaleByDistanceSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._disableDepthTestDistance = undefined;\n this._disableDepthTestDistanceSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(LabelGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof LabelGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the label.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the string Property specifying the text of the label.\n * Explicit newlines '\\n' are supported.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n text: createPropertyDescriptor(\"text\"),\n\n /**\n * Gets or sets the string Property specifying the font in CSS syntax.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/font|CSS font on MDN}\n */\n font: createPropertyDescriptor(\"font\"),\n\n /**\n * Gets or sets the Property specifying the {@link LabelStyle}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n style: createPropertyDescriptor(\"style\"),\n\n /**\n * Gets or sets the numeric Property specifying the uniform scale to apply to the image.\n * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.\n * <p>\n * <div align='center'>\n * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>\n * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n * and <code>2.0</code>.\n * </div>\n * </p>\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n scale: createPropertyDescriptor(\"scale\"),\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the background behind the label.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n showBackground: createPropertyDescriptor(\"showBackground\"),\n\n /**\n * Gets or sets the Property specifying the background {@link Color}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default new Color(0.165, 0.165, 0.165, 0.8)\n */\n backgroundColor: createPropertyDescriptor(\"backgroundColor\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical\n * background padding in pixels.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(7, 5)\n */\n backgroundPadding: createPropertyDescriptor(\"backgroundPadding\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space\n * from the origin of this label. This is commonly used to align multiple labels and labels at\n * the same position, e.g., an image and text. The screen space origin is the top, left corner of the\n * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.\n * <p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>\n * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n * </tr></table>\n * The label's origin is indicated by the yellow point.\n * </div>\n * </p>\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default Cartesian2.ZERO\n */\n pixelOffset: createPropertyDescriptor(\"pixelOffset\"),\n\n /**\n * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.\n * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's\n * right, <code>y</code> points up, and <code>z</code> points into the screen.\n * <p>\n * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to\n * arrange a label above its corresponding 3D model.\n * </p>\n * Below, the label is positioned at the center of the Earth but an eye offset makes it always\n * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n * <p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n * </tr></table>\n * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n * </div>\n * </p>\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default Cartesian3.ZERO\n */\n eyeOffset: createPropertyDescriptor(\"eyeOffset\"),\n\n /**\n * Gets or sets the Property specifying the {@link HorizontalOrigin}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n horizontalOrigin: createPropertyDescriptor(\"horizontalOrigin\"),\n\n /**\n * Gets or sets the Property specifying the {@link VerticalOrigin}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n verticalOrigin: createPropertyDescriptor(\"verticalOrigin\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the Property specifying the fill {@link Color}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n fillColor: createPropertyDescriptor(\"fillColor\"),\n\n /**\n * Gets or sets the Property specifying the outline {@link Color}.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the outline width.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.\n * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's translucency remains clamped to the nearest bound.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.\n * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n pixelOffsetScaleByDistance: createPropertyDescriptor(\n \"pixelOffsetScaleByDistance\"\n ),\n\n /**\n * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.\n * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,\n * scaleByDistance will be disabled.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof LabelGraphics.prototype\n * @type {Property|undefined}\n */\n disableDepthTestDistance: createPropertyDescriptor(\n \"disableDepthTestDistance\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {LabelGraphics} [result] The object onto which to store the result.\n * @returns {LabelGraphics} The modified result parameter or a new instance if one was not provided.\n */\nLabelGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new LabelGraphics(this);\n }\n result.show = this.show;\n result.text = this.text;\n result.font = this.font;\n result.style = this.style;\n result.scale = this.scale;\n result.showBackground = this.showBackground;\n result.backgroundColor = this.backgroundColor;\n result.backgroundPadding = this.backgroundPadding;\n result.pixelOffset = this.pixelOffset;\n result.eyeOffset = this.eyeOffset;\n result.horizontalOrigin = this.horizontalOrigin;\n result.verticalOrigin = this.verticalOrigin;\n result.heightReference = this.heightReference;\n result.fillColor = this.fillColor;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.translucencyByDistance = this.translucencyByDistance;\n result.pixelOffsetScaleByDistance = this.pixelOffsetScaleByDistance;\n result.scaleByDistance = this.scaleByDistance;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.disableDepthTestDistance = this.disableDepthTestDistance;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {LabelGraphics} source The object to be merged into this object.\n */\nLabelGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.text = defaultValue(this.text, source.text);\n this.font = defaultValue(this.font, source.font);\n this.style = defaultValue(this.style, source.style);\n this.scale = defaultValue(this.scale, source.scale);\n this.showBackground = defaultValue(\n this.showBackground,\n source.showBackground\n );\n this.backgroundColor = defaultValue(\n this.backgroundColor,\n source.backgroundColor\n );\n this.backgroundPadding = defaultValue(\n this.backgroundPadding,\n source.backgroundPadding\n );\n this.pixelOffset = defaultValue(this.pixelOffset, source.pixelOffset);\n this.eyeOffset = defaultValue(this.eyeOffset, source.eyeOffset);\n this.horizontalOrigin = defaultValue(\n this.horizontalOrigin,\n source.horizontalOrigin\n );\n this.verticalOrigin = defaultValue(\n this.verticalOrigin,\n source.verticalOrigin\n );\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.fillColor = defaultValue(this.fillColor, source.fillColor);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.translucencyByDistance = defaultValue(\n this.translucencyByDistance,\n source.translucencyByDistance\n );\n this.pixelOffsetScaleByDistance = defaultValue(\n this.pixelOffsetScaleByDistance,\n source.pixelOffsetScaleByDistance\n );\n this.scaleByDistance = defaultValue(\n this.scaleByDistance,\n source.scaleByDistance\n );\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.disableDepthTestDistance = defaultValue(\n this.disableDepthTestDistance,\n source.disableDepthTestDistance\n );\n};\nexport default LabelGraphics;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst defaultScale = new Cartesian3(1.0, 1.0, 1.0);\nconst defaultTranslation = Cartesian3.ZERO;\nconst defaultRotation = Quaternion.IDENTITY;\n\n/**\n * An affine transformation defined by a translation, rotation, and scale.\n * @alias TranslationRotationScale\n * @constructor\n *\n * @param {Cartesian3} [translation=Cartesian3.ZERO] A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.\n * @param {Quaternion} [rotation=Quaternion.IDENTITY] A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.\n * @param {Cartesian3} [scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.\n */\nfunction TranslationRotationScale(translation, rotation, scale) {\n /**\n * Gets or sets the (x, y, z) translation to apply to the node.\n * @type {Cartesian3}\n * @default Cartesian3.ZERO\n */\n this.translation = Cartesian3.clone(\n defaultValue(translation, defaultTranslation)\n );\n\n /**\n * Gets or sets the (x, y, z, w) rotation to apply to the node.\n * @type {Quaternion}\n * @default Quaternion.IDENTITY\n */\n this.rotation = Quaternion.clone(defaultValue(rotation, defaultRotation));\n\n /**\n * Gets or sets the (x, y, z) scaling to apply to the node.\n * @type {Cartesian3}\n * @default new Cartesian3(1.0, 1.0, 1.0)\n */\n this.scale = Cartesian3.clone(defaultValue(scale, defaultScale));\n}\n\n/**\n * Compares this instance against the provided instance and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TranslationRotationScale} [right] The right hand side TranslationRotationScale.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTranslationRotationScale.prototype.equals = function (right) {\n return (\n this === right ||\n (defined(right) &&\n Cartesian3.equals(this.translation, right.translation) &&\n Quaternion.equals(this.rotation, right.rotation) &&\n Cartesian3.equals(this.scale, right.scale))\n );\n};\nexport default TranslationRotationScale;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport TranslationRotationScale from \"../Core/TranslationRotationScale.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultNodeTransformation = new TranslationRotationScale();\n\n/**\n * A {@link Property} that produces {@link TranslationRotationScale} data.\n * @alias NodeTransformationProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Cartesian3} [options.translation=Cartesian3.ZERO] A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.\n * @param {Property|Quaternion} [options.rotation=Quaternion.IDENTITY] A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.\n * @param {Property|Cartesian3} [options.scale=new Cartesian3(1.0, 1.0, 1.0)] A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.\n */\nfunction NodeTransformationProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._translation = undefined;\n this._translationSubscription = undefined;\n this._rotation = undefined;\n this._rotationSubscription = undefined;\n this._scale = undefined;\n this._scaleSubscription = undefined;\n\n this.translation = options.translation;\n this.rotation = options.rotation;\n this.scale = options.scale;\n}\n\nObject.defineProperties(NodeTransformationProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof NodeTransformationProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._translation) &&\n Property.isConstant(this._rotation) &&\n Property.isConstant(this._scale)\n );\n },\n },\n\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof NodeTransformationProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.\n * @memberof NodeTransformationProperty.prototype\n * @type {Property|undefined}\n * @default Cartesian3.ZERO\n */\n translation: createPropertyDescriptor(\"translation\"),\n\n /**\n * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.\n * @memberof NodeTransformationProperty.prototype\n * @type {Property|undefined}\n * @default Quaternion.IDENTITY\n */\n rotation: createPropertyDescriptor(\"rotation\"),\n\n /**\n * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.\n * @memberof NodeTransformationProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian3(1.0, 1.0, 1.0)\n */\n scale: createPropertyDescriptor(\"scale\"),\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {TranslationRotationScale} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {TranslationRotationScale} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nNodeTransformationProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = new TranslationRotationScale();\n }\n\n result.translation = Property.getValueOrClonedDefault(\n this._translation,\n time,\n defaultNodeTransformation.translation,\n result.translation\n );\n result.rotation = Property.getValueOrClonedDefault(\n this._rotation,\n time,\n defaultNodeTransformation.rotation,\n result.rotation\n );\n result.scale = Property.getValueOrClonedDefault(\n this._scale,\n time,\n defaultNodeTransformation.scale,\n result.scale\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nNodeTransformationProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof NodeTransformationProperty &&\n Property.equals(this._translation, other._translation) &&\n Property.equals(this._rotation, other._rotation) &&\n Property.equals(this._scale, other._scale))\n );\n};\nexport default NodeTransformationProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.\n *\n * @alias PropertyBag\n * @implements Record<string, any>\n * @constructor\n *\n * @param {Object} [value] An object, containing key-value mapping of property names to properties.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property.\n */\nfunction PropertyBag(value, createPropertyCallback) {\n this._propertyNames = [];\n this._definitionChanged = new Event();\n\n if (defined(value)) {\n this.merge(value, createPropertyCallback);\n }\n}\n\nObject.defineProperties(PropertyBag.prototype, {\n /**\n * Gets the names of all properties registered on this instance.\n * @memberof PropertyBag.prototype\n * @type {Array}\n */\n propertyNames: {\n get: function () {\n return this._propertyNames;\n },\n },\n /**\n * Gets a value indicating if this property is constant. This property\n * is considered constant if all property items in this object are constant.\n * @memberof PropertyBag.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n const propertyNames = this._propertyNames;\n for (let i = 0, len = propertyNames.length; i < len; i++) {\n if (!Property.isConstant(this[propertyNames[i]])) {\n return false;\n }\n }\n return true;\n },\n },\n /**\n * Gets the event that is raised whenever the set of properties contained in this\n * object changes, or one of the properties itself changes.\n *\n * @memberof PropertyBag.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\n/**\n * Determines if this object has defined a property with the given name.\n *\n * @param {String} propertyName The name of the property to check for.\n *\n * @returns {Boolean} True if this object has defined a property with the given name, false otherwise.\n */\nPropertyBag.prototype.hasProperty = function (propertyName) {\n return this._propertyNames.indexOf(propertyName) !== -1;\n};\n\nfunction createConstantProperty(value) {\n return new ConstantProperty(value);\n}\n\n/**\n * Adds a property to this object.\n *\n * @param {String} propertyName The name of the property to add.\n * @param {*} [value] The value of the new property, if provided.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of this new property is set to a value that is not a Property.\n *\n * @exception {DeveloperError} \"propertyName\" is already a registered property.\n */\nPropertyBag.prototype.addProperty = function (\n propertyName,\n value,\n createPropertyCallback\n) {\n const propertyNames = this._propertyNames;\n\n propertyNames.push(propertyName);\n Object.defineProperty(\n this,\n propertyName,\n createPropertyDescriptor(\n propertyName,\n true,\n defaultValue(createPropertyCallback, createConstantProperty)\n )\n );\n\n if (defined(value)) {\n this[propertyName] = value;\n }\n\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Removed a property previously added with addProperty.\n *\n * @param {String} propertyName The name of the property to remove.\n *\n * @exception {DeveloperError} \"propertyName\" is not a registered property.\n */\nPropertyBag.prototype.removeProperty = function (propertyName) {\n const propertyNames = this._propertyNames;\n const index = propertyNames.indexOf(propertyName);\n\n this._propertyNames.splice(index, 1);\n delete this[propertyName];\n\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall\n * result will be an object, mapping property names to those values.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * Note that any properties in result which are not part of this PropertyBag will be left as-is.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPropertyBag.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n\n const propertyNames = this._propertyNames;\n for (let i = 0, len = propertyNames.length; i < len; i++) {\n const propertyName = propertyNames[i];\n result[propertyName] = Property.getValueOrUndefined(\n this[propertyName],\n time,\n result[propertyName]\n );\n }\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {Object} source The object to be merged into this object.\n * @param {Function} [createPropertyCallback] A function that will be called when the value of any of the properties in value are not a Property.\n */\nPropertyBag.prototype.merge = function (source, createPropertyCallback) {\n const propertyNames = this._propertyNames;\n const sourcePropertyNames = defined(source._propertyNames)\n ? source._propertyNames\n : Object.keys(source);\n for (let i = 0, len = sourcePropertyNames.length; i < len; i++) {\n const name = sourcePropertyNames[i];\n\n const targetProperty = this[name];\n const sourceProperty = source[name];\n\n //Custom properties that are registered on the source must also be added to this.\n if (targetProperty === undefined && propertyNames.indexOf(name) === -1) {\n this.addProperty(name, undefined, createPropertyCallback);\n }\n\n if (sourceProperty !== undefined) {\n if (targetProperty !== undefined) {\n if (defined(targetProperty) && defined(targetProperty.merge)) {\n targetProperty.merge(sourceProperty);\n }\n } else if (\n defined(sourceProperty) &&\n defined(sourceProperty.merge) &&\n defined(sourceProperty.clone)\n ) {\n this[name] = sourceProperty.clone();\n } else {\n this[name] = sourceProperty;\n }\n }\n }\n};\n\nfunction propertiesEqual(a, b) {\n const aPropertyNames = a._propertyNames;\n const bPropertyNames = b._propertyNames;\n\n const len = aPropertyNames.length;\n if (len !== bPropertyNames.length) {\n return false;\n }\n\n for (let aIndex = 0; aIndex < len; ++aIndex) {\n const name = aPropertyNames[aIndex];\n const bIndex = bPropertyNames.indexOf(name);\n if (bIndex === -1) {\n return false;\n }\n if (!Property.equals(a[name], b[name])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPropertyBag.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PropertyBag && //\n propertiesEqual(this, other))\n );\n};\nexport default PropertyBag;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport NodeTransformationProperty from \"./NodeTransformationProperty.js\";\nimport PropertyBag from \"./PropertyBag.js\";\n\nfunction createNodeTransformationProperty(value) {\n return new NodeTransformationProperty(value);\n}\n\nfunction createNodeTransformationPropertyBag(value) {\n return new PropertyBag(value, createNodeTransformationProperty);\n}\n\nfunction createArticulationStagePropertyBag(value) {\n return new PropertyBag(value);\n}\n\n/**\n * @typedef {Object} ModelGraphics.ConstructorOptions\n *\n * Initialization options for the ModelGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the model.\n * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the glTF asset.\n * @property {Property | number} [scale=1.0] A numeric Property specifying a uniform linear scale.\n * @property {Property | number} [minimumPixelSize=0.0] A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.\n * @property {Property | number} [maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @property {Property | boolean} [incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.\n * @property {Property | boolean} [runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started.\n * @property {Property | boolean} [clampAnimations=true] A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.\n * @property {Property | ShadowMode} [shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from light sources.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [silhouetteColor=Color.RED] A Property specifying the {@link Color} of the silhouette.\n * @property {Property | number} [silhouetteSize=0.0] A numeric Property specifying the size of the silhouette in pixels.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color.\n * @property {Property | ColorBlendMode} [colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model.\n * @property {Property | number} [colorBlendAmount=0.5] A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @property {Property | Cartesian2} [imageBasedLightingFactor=new Cartesian2(1.0, 1.0)] A property specifying the contribution from diffuse and specular image-based lighting.\n * @property {Property | Color} [lightColor] A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this model will be displayed.\n * @property {PropertyBag | Object.<string, TranslationRotationScale>} [nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.\n * @property {PropertyBag | Object.<string, number>} [articulations] An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties.\n * @property {Property | ClippingPlaneCollection} [clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @property {Property | CustomShader} [customShader] A property specifying the {@link CustomShader} to apply to this model.\n */\n\n/**\n * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.\n * The position and orientation of the model is determined by the containing {@link Entity}.\n * <p>\n * Cesium includes support for glTF geometry, materials, animations, and skinning.\n * Cameras and lights are not currently supported.\n * </p>\n *\n * @alias ModelGraphics\n * @constructor\n *\n * @param {ModelGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=3D%20Models.html|Cesium Sandcastle 3D Models Demo}\n */\nfunction ModelGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._uri = undefined;\n this._uriSubscription = undefined;\n this._scale = undefined;\n this._scaleSubscription = undefined;\n this._minimumPixelSize = undefined;\n this._minimumPixelSizeSubscription = undefined;\n this._maximumScale = undefined;\n this._maximumScaleSubscription = undefined;\n this._incrementallyLoadTextures = undefined;\n this._incrementallyLoadTexturesSubscription = undefined;\n this._runAnimations = undefined;\n this._runAnimationsSubscription = undefined;\n this._clampAnimations = undefined;\n this._clampAnimationsSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._silhouetteColor = undefined;\n this._silhouetteColorSubscription = undefined;\n this._silhouetteSize = undefined;\n this._silhouetteSizeSubscription = undefined;\n this._color = undefined;\n this._colorSubscription = undefined;\n this._colorBlendMode = undefined;\n this._colorBlendModeSubscription = undefined;\n this._colorBlendAmount = undefined;\n this._colorBlendAmountSubscription = undefined;\n this._imageBasedLightingFactor = undefined;\n this._imageBasedLightingFactorSubscription = undefined;\n this._lightColor = undefined;\n this._lightColorSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._nodeTransformations = undefined;\n this._nodeTransformationsSubscription = undefined;\n this._articulations = undefined;\n this._articulationsSubscription = undefined;\n this._clippingPlanes = undefined;\n this._clippingPlanesSubscription = undefined;\n this._customShader = undefined;\n this._customShaderSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(ModelGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof ModelGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the model.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the string Property specifying the URI of the glTF asset.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n uri: createPropertyDescriptor(\"uri\"),\n\n /**\n * Gets or sets the numeric Property specifying a uniform linear scale\n * for this model. Values greater than 1.0 increase the size of the model while\n * values less than 1.0 decrease it.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n scale: createPropertyDescriptor(\"scale\"),\n\n /**\n * Gets or sets the numeric Property specifying the approximate minimum\n * pixel size of the model regardless of zoom. This can be used to ensure that\n * a model is visible even when the viewer zooms out. When <code>0.0</code>,\n * no minimum size is enforced.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n minimumPixelSize: createPropertyDescriptor(\"minimumPixelSize\"),\n\n /**\n * Gets or sets the numeric Property specifying the maximum scale\n * size of a model. This property is used as an upper limit for\n * {@link ModelGraphics#minimumPixelSize}.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n maximumScale: createPropertyDescriptor(\"maximumScale\"),\n\n /**\n * Get or sets the boolean Property specifying whether textures\n * may continue to stream in after the model is loaded.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n incrementallyLoadTextures: createPropertyDescriptor(\n \"incrementallyLoadTextures\"\n ),\n\n /**\n * Gets or sets the boolean Property specifying if glTF animations should be run.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n runAnimations: createPropertyDescriptor(\"runAnimations\"),\n\n /**\n * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n clampAnimations: createPropertyDescriptor(\"clampAnimations\"),\n\n /**\n * Get or sets the enum Property specifying whether the model\n * casts or receives shadows from light sources.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.ENABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the silhouette.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default Color.RED\n */\n silhouetteColor: createPropertyDescriptor(\"silhouetteColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the size of the silhouette in pixels.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n silhouetteSize: createPropertyDescriptor(\"silhouetteSize\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the enum Property specifying how the color blends with the model.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default ColorBlendMode.HIGHLIGHT\n */\n colorBlendMode: createPropertyDescriptor(\"colorBlendMode\"),\n\n /**\n * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.\n * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with\n * any value in-between resulting in a mix of the two.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n * @default 0.5\n */\n colorBlendAmount: createPropertyDescriptor(\"colorBlendAmount\"),\n\n /**\n * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n imageBasedLightingFactor: createPropertyDescriptor(\n \"imageBasedLightingFactor\"\n ),\n\n /**\n * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @memberOf ModelGraphics.prototype\n * @type {Property|undefined}\n */\n lightColor: createPropertyDescriptor(\"lightColor\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are\n * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.\n * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.\n * @memberof ModelGraphics.prototype\n * @type {PropertyBag}\n */\n nodeTransformations: createPropertyDescriptor(\n \"nodeTransformations\",\n undefined,\n createNodeTransformationPropertyBag\n ),\n\n /**\n * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are\n * composed as the name of the articulation, a single space, and the name of the stage.\n * @memberof ModelGraphics.prototype\n * @type {PropertyBag}\n */\n articulations: createPropertyDescriptor(\n \"articulations\",\n undefined,\n createArticulationStagePropertyBag\n ),\n\n /**\n * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n clippingPlanes: createPropertyDescriptor(\"clippingPlanes\"),\n\n /**\n * Gets or sets the {@link CustomShader} to apply to this model. When <code>undefined</code>, no custom shader code is used.\n * @memberof ModelGraphics.prototype\n * @type {Property|undefined}\n */\n customShader: createPropertyDescriptor(\"customShader\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {ModelGraphics} [result] The object onto which to store the result.\n * @returns {ModelGraphics} The modified result parameter or a new instance if one was not provided.\n */\nModelGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new ModelGraphics(this);\n }\n result.show = this.show;\n result.uri = this.uri;\n result.scale = this.scale;\n result.minimumPixelSize = this.minimumPixelSize;\n result.maximumScale = this.maximumScale;\n result.incrementallyLoadTextures = this.incrementallyLoadTextures;\n result.runAnimations = this.runAnimations;\n result.clampAnimations = this.clampAnimations;\n result.heightReference = this._heightReference;\n result.silhouetteColor = this.silhouetteColor;\n result.silhouetteSize = this.silhouetteSize;\n result.color = this.color;\n result.colorBlendMode = this.colorBlendMode;\n result.colorBlendAmount = this.colorBlendAmount;\n result.imageBasedLightingFactor = this.imageBasedLightingFactor;\n result.lightColor = this.lightColor;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.nodeTransformations = this.nodeTransformations;\n result.articulations = this.articulations;\n result.clippingPlanes = this.clippingPlanes;\n result.customShader = this.customShader;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {ModelGraphics} source The object to be merged into this object.\n */\nModelGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.uri = defaultValue(this.uri, source.uri);\n this.scale = defaultValue(this.scale, source.scale);\n this.minimumPixelSize = defaultValue(\n this.minimumPixelSize,\n source.minimumPixelSize\n );\n this.maximumScale = defaultValue(this.maximumScale, source.maximumScale);\n this.incrementallyLoadTextures = defaultValue(\n this.incrementallyLoadTextures,\n source.incrementallyLoadTextures\n );\n this.runAnimations = defaultValue(this.runAnimations, source.runAnimations);\n this.clampAnimations = defaultValue(\n this.clampAnimations,\n source.clampAnimations\n );\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.silhouetteColor = defaultValue(\n this.silhouetteColor,\n source.silhouetteColor\n );\n this.silhouetteSize = defaultValue(\n this.silhouetteSize,\n source.silhouetteSize\n );\n this.color = defaultValue(this.color, source.color);\n this.colorBlendMode = defaultValue(\n this.colorBlendMode,\n source.colorBlendMode\n );\n this.colorBlendAmount = defaultValue(\n this.colorBlendAmount,\n source.colorBlendAmount\n );\n this.imageBasedLightingFactor = defaultValue(\n this.imageBasedLightingFactor,\n source.imageBasedLightingFactor\n );\n this.lightColor = defaultValue(this.lightColor, source.lightColor);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.clippingPlanes = defaultValue(\n this.clippingPlanes,\n source.clippingPlanes\n );\n this.customShader = defaultValue(this.customShader, source.customShader);\n\n const sourceNodeTransformations = source.nodeTransformations;\n if (defined(sourceNodeTransformations)) {\n const targetNodeTransformations = this.nodeTransformations;\n if (defined(targetNodeTransformations)) {\n targetNodeTransformations.merge(sourceNodeTransformations);\n } else {\n this.nodeTransformations = new PropertyBag(\n sourceNodeTransformations,\n createNodeTransformationProperty\n );\n }\n }\n\n const sourceArticulations = source.articulations;\n if (defined(sourceArticulations)) {\n const targetArticulations = this.articulations;\n if (defined(targetArticulations)) {\n targetArticulations.merge(sourceArticulations);\n } else {\n this.articulations = new PropertyBag(sourceArticulations);\n }\n }\n};\nexport default ModelGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} Cesium3DTilesetGraphics.ConstructorOptions\n *\n * Initialization options for the Cesium3DTilesetGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the tileset.\n * @property {Property | string | Resource} [uri] A string or Resource Property specifying the URI of the tileset.\n * @property {Property | number} [maximumScreenSpaceError] A number or Property specifying the maximum screen space error used to drive level of detail refinement.\n */\n\n/**\n * A 3D Tiles tileset represented by an {@link Entity}.\n * The tileset modelMatrix is determined by the containing Entity position and orientation\n * or is left unset if position is undefined.\n *\n * @alias Cesium3DTilesetGraphics\n * @constructor\n *\n * @param {Cesium3DTilesetGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction Cesium3DTilesetGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._uri = undefined;\n this._uriSubscription = undefined;\n this._maximumScreenSpaceError = undefined;\n this._maximumScreenSpaceErrorSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(Cesium3DTilesetGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof Cesium3DTilesetGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the model.\n * @memberof Cesium3DTilesetGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the string Property specifying the URI of the glTF asset.\n * @memberof Cesium3DTilesetGraphics.prototype\n * @type {Property|undefined}\n */\n uri: createPropertyDescriptor(\"uri\"),\n\n /**\n * Gets or sets the maximum screen space error used to drive level of detail refinement.\n * @memberof Cesium3DTilesetGraphics.prototype\n * @type {Property|undefined}\n */\n maximumScreenSpaceError: createPropertyDescriptor(\"maximumScreenSpaceError\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {Cesium3DTilesetGraphics} [result] The object onto which to store the result.\n * @returns {Cesium3DTilesetGraphics} The modified result parameter or a new instance if one was not provided.\n */\nCesium3DTilesetGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new Cesium3DTilesetGraphics(this);\n }\n result.show = this.show;\n result.uri = this.uri;\n result.maximumScreenSpaceError = this.maximumScreenSpaceError;\n\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {Cesium3DTilesetGraphics} source The object to be merged into this object.\n */\nCesium3DTilesetGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.uri = defaultValue(this.uri, source.uri);\n this.maximumScreenSpaceError = defaultValue(\n this.maximumScreenSpaceError,\n source.maximumScreenSpaceError\n );\n};\n\nexport default Cesium3DTilesetGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} PathGraphics.ConstructorOptions\n *\n * Initialization options for the PathGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the path.\n * @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show.\n * @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show.\n * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.\n * @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed.\n */\n\n/**\n * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.\n *\n * @alias PathGraphics\n * @constructor\n *\n * @param {PathGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction PathGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._leadTime = undefined;\n this._leadTimeSubscription = undefined;\n this._trailTime = undefined;\n this._trailTimeSubscription = undefined;\n this._width = undefined;\n this._widthSubscription = undefined;\n this._resolution = undefined;\n this._resolutionSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PathGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PathGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the path.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the number of seconds in front of the object to show.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n */\n leadTime: createPropertyDescriptor(\"leadTime\"),\n\n /**\n * Gets or sets the Property specifying the number of seconds behind the object to show.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n */\n trailTime: createPropertyDescriptor(\"trailTime\"),\n\n /**\n * Gets or sets the numeric Property specifying the width in pixels.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n width: createPropertyDescriptor(\"width\"),\n\n /**\n * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n * @default 60\n */\n resolution: createPropertyDescriptor(\"resolution\"),\n\n /**\n * Gets or sets the Property specifying the material used to draw the path.\n * @memberof PathGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.\n * @memberof PathGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PathGraphics} [result] The object onto which to store the result.\n * @returns {PathGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPathGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PathGraphics(this);\n }\n result.show = this.show;\n result.leadTime = this.leadTime;\n result.trailTime = this.trailTime;\n result.width = this.width;\n result.resolution = this.resolution;\n result.material = this.material;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PathGraphics} source The object to be merged into this object.\n */\nPathGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.leadTime = defaultValue(this.leadTime, source.leadTime);\n this.trailTime = defaultValue(this.trailTime, source.trailTime);\n this.width = defaultValue(this.width, source.width);\n this.resolution = defaultValue(this.resolution, source.resolution);\n this.material = defaultValue(this.material, source.material);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default PathGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} PlaneGraphics.ConstructorOptions\n *\n * Initialization options for the PlaneGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the plane.\n * @property {Property | Plane} [plane] A {@link Plane} Property specifying the normal and distance for the plane.\n * @property {Property | Cartesian2} [dimensions] A {@link Cartesian2} Property specifying the width and height of the plane.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the plane is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the plane.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the plane is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the plane casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this plane will be displayed.\n */\n\n/**\n * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.\n *\n * @alias PlaneGraphics\n * @constructor\n *\n * @param {PlaneGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Plane.html|Cesium Sandcastle Plane Demo}\n */\nfunction PlaneGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._plane = undefined;\n this._planeSubscription = undefined;\n this._dimensions = undefined;\n this._dimensionsSubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PlaneGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PlaneGraphics.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the plane.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.\n *\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n */\n plane: createPropertyDescriptor(\"plane\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.\n *\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n */\n dimensions: createPropertyDescriptor(\"dimensions\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the material used to fill the plane.\n * @memberof PlaneGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the plane is outlined.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the plane\n * casts or receives shadows from light sources.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.\n * @memberof PlaneGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PlaneGraphics} [result] The object onto which to store the result.\n * @returns {PlaneGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPlaneGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PlaneGraphics(this);\n }\n result.show = this.show;\n result.plane = this.plane;\n result.dimensions = this.dimensions;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PlaneGraphics} source The object to be merged into this object.\n */\nPlaneGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.plane = defaultValue(this.plane, source.plane);\n this.dimensions = defaultValue(this.dimensions, source.dimensions);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default PlaneGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} PointGraphics.ConstructorOptions\n *\n * Initialization options for the PointGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the point.\n * @property {Property | number} [pixelSize=1] A numeric Property specifying the size in pixels.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | Color} [color=Color.WHITE] A Property specifying the {@link Color} of the point.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=0] A numeric Property specifying the the outline width in pixels.\n * @property {Property | NearFarScalar} [scaleByDistance] A {@link NearFarScalar} Property used to scale the point based on distance.\n * @property {Property | NearFarScalar} [translucencyByDistance] A {@link NearFarScalar} Property used to set translucency based on distance from the camera.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this point will be displayed.\n * @property {Property | number} [disableDepthTestDistance] A Property specifying the distance from the camera at which to disable the depth test to.\n */\n\n/**\n * Describes a graphical point located at the position of the containing {@link Entity}.\n *\n * @alias PointGraphics\n * @constructor\n *\n * @param {PointGraphics.ConstructorOptions} [options] Object describing initialization options\n */\nfunction PointGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._pixelSize = undefined;\n this._pixelSizeSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._color = undefined;\n this._colorSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._scaleByDistance = undefined;\n this._scaleByDistanceSubscription = undefined;\n this._translucencyByDistance = undefined;\n this._translucencyByDistanceSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._disableDepthTestDistance = undefined;\n this._disableDepthTestDistanceSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PointGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PointGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the point.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the numeric Property specifying the size in pixels.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default 1\n */\n pixelSize: createPropertyDescriptor(\"pixelSize\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the point.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the the outline width in pixels.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.\n * If undefined, a constant size is used.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n */\n scaleByDistance: createPropertyDescriptor(\"scaleByDistance\"),\n\n /**\n * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.\n * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the points's translucency remains clamped to the nearest bound.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n */\n translucencyByDistance: createPropertyDescriptor(\"translucencyByDistance\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof PointGraphics.prototype\n * @type {Property|undefined}\n */\n disableDepthTestDistance: createPropertyDescriptor(\n \"disableDepthTestDistance\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PointGraphics} [result] The object onto which to store the result.\n * @returns {PointGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPointGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PointGraphics(this);\n }\n result.show = this.show;\n result.pixelSize = this.pixelSize;\n result.heightReference = this.heightReference;\n result.color = this.color;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.scaleByDistance = this.scaleByDistance;\n result.translucencyByDistance = this._translucencyByDistance;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.disableDepthTestDistance = this.disableDepthTestDistance;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PointGraphics} source The object to be merged into this object.\n */\nPointGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.pixelSize = defaultValue(this.pixelSize, source.pixelSize);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.color = defaultValue(this.color, source.color);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.scaleByDistance = defaultValue(\n this.scaleByDistance,\n source.scaleByDistance\n );\n this.translucencyByDistance = defaultValue(\n this._translucencyByDistance,\n source.translucencyByDistance\n );\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.disableDepthTestDistance = defaultValue(\n this.disableDepthTestDistance,\n source.disableDepthTestDistance\n );\n};\nexport default PointGraphics;\n", "import defined from \"./defined.js\";\n\n/**\n * An hierarchy of linear rings which define a polygon and its holes.\n * The holes themselves may also have holes which nest inner polygons.\n * @alias PolygonHierarchy\n * @constructor\n *\n * @param {Cartesian3[]} [positions] A linear ring defining the outer boundary of the polygon or hole.\n * @param {PolygonHierarchy[]} [holes] An array of polygon hierarchies defining holes in the polygon.\n */\nfunction PolygonHierarchy(positions, holes) {\n /**\n * A linear ring defining the outer boundary of the polygon or hole.\n * @type {Cartesian3[]}\n */\n this.positions = defined(positions) ? positions : [];\n\n /**\n * An array of polygon hierarchies defining holes in the polygon.\n * @type {PolygonHierarchy[]}\n */\n this.holes = defined(holes) ? holes : [];\n}\nexport default PolygonHierarchy;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\nfunction createPolygonHierarchyProperty(value) {\n if (Array.isArray(value)) {\n // convert array of positions to PolygonHierarchy object\n value = new PolygonHierarchy(value);\n }\n return new ConstantProperty(value);\n}\n\n/**\n * @typedef {Object} PolygonGraphics.ConstructorOptions\n *\n * Initialization options for the PolygonGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polygon.\n * @property {Property | PolygonHierarchy} [hierarchy] A Property specifying the {@link PolygonHierarchy}.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the polygon is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the polygon.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the polygon is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | boolean} [perPositionHeight=false] A boolean specifying whether or not the height of each position is used.\n * @property {Boolean | boolean} [closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @property {Boolean | boolean} [closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polygon casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polygon will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.\n * @property {ConstantProperty | number} [zIndex=0] A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.\n * @property {Property | PolygonHierarchy} [textureCoordinates] A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n */\n\n/**\n * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.\n * The polygon conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n *\n * @alias PolygonGraphics\n * @constructor\n *\n * @param {PolygonGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}\n */\nfunction PolygonGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._hierarchy = undefined;\n this._hierarchySubscription = undefined;\n this._height = undefined;\n this._heightSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._extrudedHeight = undefined;\n this._extrudedHeightSubscription = undefined;\n this._extrudedHeightReference = undefined;\n this._extrudedHeightReferenceSubscription = undefined;\n this._stRotation = undefined;\n this._stRotationSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._perPositionHeight = undefined;\n this._perPositionHeightSubscription = undefined;\n this._closeTop = undefined;\n this._closeTopSubscription = undefined;\n this._closeBottom = undefined;\n this._closeBottomSubscription = undefined;\n this._arcType = undefined;\n this._arcTypeSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._classificationType = undefined;\n this._classificationTypeSubscription = undefined;\n this._zIndex = undefined;\n this._zIndexSubscription = undefined;\n this._textureCoordinates = undefined;\n this._textureCoordinatesSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolygonGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PolygonGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the polygon.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the {@link PolygonHierarchy}.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n hierarchy: createPropertyDescriptor(\n \"hierarchy\",\n undefined,\n createPolygonHierarchyProperty\n ),\n\n /**\n * Gets or sets the numeric Property specifying the constant altitude of the polygon.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n height: createPropertyDescriptor(\"height\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.\n * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.\n * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n /**\n * Gets or sets the Property specifying the extruded {@link HeightReference}.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n /**\n * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n stRotation: createPropertyDescriptor(\"stRotation\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between points on the polygon.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the polygon.\n * @memberof PolygonGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the polygon is outlined.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Gets or sets the boolean specifying whether or not the the height of each position is used.\n * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.\n * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n perPositionHeight: createPropertyDescriptor(\"perPositionHeight\"),\n\n /**\n * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n closeTop: createPropertyDescriptor(\"closeTop\"),\n\n /**\n * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n closeBottom: createPropertyDescriptor(\"closeBottom\"),\n\n /**\n * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default ArcType.GEODESIC\n */\n arcType: createPropertyDescriptor(\"arcType\"),\n\n /**\n * Get or sets the enum Property specifying whether the polygon\n * casts or receives shadows from light sources.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n * @default ClassificationType.BOTH\n */\n classificationType: createPropertyDescriptor(\"classificationType\"),\n\n /**\n * Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.\n * @memberof PolygonGraphics.prototype\n * @type {ConstantProperty|undefined}\n * @default 0\n */\n zIndex: createPropertyDescriptor(\"zIndex\"),\n\n /**\n * A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n * @memberof PolygonGraphics.prototype\n * @type {Property|undefined}\n */\n textureCoordinates: createPropertyDescriptor(\"textureCoordinates\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolygonGraphics} [result] The object onto which to store the result.\n * @returns {PolygonGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolygonGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PolygonGraphics(this);\n }\n result.show = this.show;\n result.hierarchy = this.hierarchy;\n result.height = this.height;\n result.heightReference = this.heightReference;\n result.extrudedHeight = this.extrudedHeight;\n result.extrudedHeightReference = this.extrudedHeightReference;\n result.stRotation = this.stRotation;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.perPositionHeight = this.perPositionHeight;\n result.closeTop = this.closeTop;\n result.closeBottom = this.closeBottom;\n result.arcType = this.arcType;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.classificationType = this.classificationType;\n result.zIndex = this.zIndex;\n result.textureCoordinates = this.textureCoordinates;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolygonGraphics} source The object to be merged into this object.\n */\nPolygonGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.hierarchy = defaultValue(this.hierarchy, source.hierarchy);\n this.height = defaultValue(this.height, source.height);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.extrudedHeight = defaultValue(\n this.extrudedHeight,\n source.extrudedHeight\n );\n this.extrudedHeightReference = defaultValue(\n this.extrudedHeightReference,\n source.extrudedHeightReference\n );\n this.stRotation = defaultValue(this.stRotation, source.stRotation);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.perPositionHeight = defaultValue(\n this.perPositionHeight,\n source.perPositionHeight\n );\n this.closeTop = defaultValue(this.closeTop, source.closeTop);\n this.closeBottom = defaultValue(this.closeBottom, source.closeBottom);\n this.arcType = defaultValue(this.arcType, source.arcType);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.classificationType = defaultValue(\n this.classificationType,\n source.classificationType\n );\n this.zIndex = defaultValue(this.zIndex, source.zIndex);\n this.textureCoordinates = defaultValue(\n this.textureCoordinates,\n source.textureCoordinates\n );\n};\nexport default PolygonGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} PolylineGraphics.ConstructorOptions\n *\n * Initialization options for the PolylineGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the polyline.\n * @property {Property | Array<Cartesian3>} [positions] A Property specifying the array of {@link Cartesian3} positions that define the line strip.\n * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the polyline.\n * @property {MaterialProperty | Color} [depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain.\n * @property {Property | ArcType} [arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @property {Property | boolean} [clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this polyline will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.\n * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported.\n */\n\n/**\n * Describes a polyline. The first two positions define a line segment,\n * and each additional position defines a line segment from the previous position. The segments\n * can be linear connected points, great arcs, or clamped to terrain.\n *\n * @alias PolylineGraphics\n * @constructor\n *\n * @param {PolylineGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}\n */\nfunction PolylineGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._positions = undefined;\n this._positionsSubscription = undefined;\n this._width = undefined;\n this._widthSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._depthFailMaterial = undefined;\n this._depthFailMaterialSubscription = undefined;\n this._arcType = undefined;\n this._arcTypeSubscription = undefined;\n this._clampToGround = undefined;\n this._clampToGroundSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n this._classificationType = undefined;\n this._classificationTypeSubscription = undefined;\n this._zIndex = undefined;\n this._zIndexSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolylineGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PolylineGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the polyline.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the array of {@link Cartesian3}\n * positions that define the line strip.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n */\n positions: createPropertyDescriptor(\"positions\"),\n\n /**\n * Gets or sets the numeric Property specifying the width in pixels.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n width: createPropertyDescriptor(\"width\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default Cesium.Math.RADIANS_PER_DEGREE\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the Property specifying the material used to draw the polyline.\n * @memberof PolylineGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.\n * <p>\n * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,\n * there may be artifacts.\n * </p>\n * @memberof PolylineGraphics.prototype\n * @type {MaterialProperty}\n * @default undefined\n */\n depthFailMaterial: createMaterialPropertyDescriptor(\"depthFailMaterial\"),\n\n /**\n * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default ArcType.GEODESIC\n */\n arcType: createPropertyDescriptor(\"arcType\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the polyline\n * should be clamped to the ground.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n clampToGround: createPropertyDescriptor(\"clampToGround\"),\n\n /**\n * Get or sets the enum Property specifying whether the polyline\n * casts or receives shadows from light sources.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof PolylineGraphics.prototype\n * @type {Property|undefined}\n * @default ClassificationType.BOTH\n */\n classificationType: createPropertyDescriptor(\"classificationType\"),\n\n /**\n * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported.\n * @memberof PolylineGraphics.prototype\n * @type {ConstantProperty|undefined}\n * @default 0\n */\n zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolylineGraphics} [result] The object onto which to store the result.\n * @returns {PolylineGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolylineGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PolylineGraphics(this);\n }\n result.show = this.show;\n result.positions = this.positions;\n result.width = this.width;\n result.granularity = this.granularity;\n result.material = this.material;\n result.depthFailMaterial = this.depthFailMaterial;\n result.arcType = this.arcType;\n result.clampToGround = this.clampToGround;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.classificationType = this.classificationType;\n result.zIndex = this.zIndex;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolylineGraphics} source The object to be merged into this object.\n */\nPolylineGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.positions = defaultValue(this.positions, source.positions);\n this.width = defaultValue(this.width, source.width);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.material = defaultValue(this.material, source.material);\n this.depthFailMaterial = defaultValue(\n this.depthFailMaterial,\n source.depthFailMaterial\n );\n this.arcType = defaultValue(this.arcType, source.arcType);\n this.clampToGround = defaultValue(this.clampToGround, source.clampToGround);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.classificationType = defaultValue(\n this.classificationType,\n source.classificationType\n );\n this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default PolylineGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} PolylineVolumeGraphics.ConstructorOptions\n *\n * Initialization options for the PolylineVolumeGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the volume.\n * @property {Property | Array<Cartesian3>} [positions] A Property specifying the array of {@link Cartesian3} positions which define the line strip.\n * @property {Property | Array<Cartesian2>} [shape] A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.\n * @property {Property | CornerType} [cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the volume is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the volume.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the volume is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the volume casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this volume will be displayed.\n */\n\n/**\n * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.\n * The resulting volume conforms to the curvature of the globe.\n *\n * @alias PolylineVolumeGraphics\n * @constructor\n *\n * @param {PolylineVolumeGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}\n */\nfunction PolylineVolumeGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._positions = undefined;\n this._positionsSubscription = undefined;\n this._shape = undefined;\n this._shapeSubscription = undefined;\n this._cornerType = undefined;\n this._cornerTypeSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubsription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(PolylineVolumeGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof PolylineVolumeGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the volume.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n */\n positions: createPropertyDescriptor(\"positions\"),\n\n /**\n * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n */\n shape: createPropertyDescriptor(\"shape\"),\n\n /**\n * Gets or sets the {@link CornerType} Property specifying the style of the corners.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default CornerType.ROUNDED\n */\n cornerType: createPropertyDescriptor(\"cornerType\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between points on the volume.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the volume.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the volume is outlined.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the volume\n * casts or receives shadows from light sources.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.\n * @memberof PolylineVolumeGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {PolylineVolumeGraphics} [result] The object onto which to store the result.\n * @returns {PolylineVolumeGraphics} The modified result parameter or a new instance if one was not provided.\n */\nPolylineVolumeGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new PolylineVolumeGraphics(this);\n }\n result.show = this.show;\n result.positions = this.positions;\n result.shape = this.shape;\n result.cornerType = this.cornerType;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {PolylineVolumeGraphics} source The object to be merged into this object.\n */\nPolylineVolumeGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.positions = defaultValue(this.positions, source.positions);\n this.shape = defaultValue(this.shape, source.shape);\n this.cornerType = defaultValue(this.cornerType, source.cornerType);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default PolylineVolumeGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} RectangleGraphics.ConstructorOptions\n *\n * Initialization options for the RectangleGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the rectangle.\n * @property {Property | Rectangle} [coordinates] The Property specifying the {@link Rectangle}.\n * @property {Property | number} [height=0] A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.\n * @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height is relative to.\n * @property {Property | number} [extrudedHeight] A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.\n * @property {Property | HeightReference} [extrudedHeightReference=HeightReference.NONE] A Property specifying what the extrudedHeight is relative to.\n * @property {Property | number} [rotation=0.0] A numeric property specifying the rotation of the rectangle clockwise from north.\n * @property {Property | number} [stRotation=0.0] A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the rectangle.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the rectangle is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the rectangle.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the rectangle is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the rectangle casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this rectangle will be displayed.\n * @property {Property | ClassificationType} [classificationType=ClassificationType.BOTH] An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.\n * @property {Property | number} [zIndex=0] A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.\n */\n\n/**\n * Describes graphics for a {@link Rectangle}.\n * The rectangle conforms to the curvature of the globe and can be placed on the surface or\n * at altitude and can optionally be extruded into a volume.\n *\n * @alias RectangleGraphics\n * @constructor\n *\n * @param {RectangleGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}\n */\nfunction RectangleGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._coordinates = undefined;\n this._coordinatesSubscription = undefined;\n this._height = undefined;\n this._heightSubscription = undefined;\n this._heightReference = undefined;\n this._heightReferenceSubscription = undefined;\n this._extrudedHeight = undefined;\n this._extrudedHeightSubscription = undefined;\n this._extrudedHeightReference = undefined;\n this._extrudedHeightReferenceSubscription = undefined;\n this._rotation = undefined;\n this._rotationSubscription = undefined;\n this._stRotation = undefined;\n this._stRotationSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distancedisplayConditionSubscription = undefined;\n this._classificationType = undefined;\n this._classificationTypeSubscription = undefined;\n this._zIndex = undefined;\n this._zIndexSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(RectangleGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof RectangleGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the rectangle.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the {@link Rectangle}.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n */\n coordinates: createPropertyDescriptor(\"coordinates\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the rectangle.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n height: createPropertyDescriptor(\"height\"),\n\n /**\n * Gets or sets the Property specifying the {@link HeightReference}.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n heightReference: createPropertyDescriptor(\"heightReference\"),\n\n /**\n * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.\n * Setting this property creates volume starting at height and ending at this altitude.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n */\n extrudedHeight: createPropertyDescriptor(\"extrudedHeight\"),\n\n /**\n * Gets or sets the Property specifying the extruded {@link HeightReference}.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default HeightReference.NONE\n */\n extrudedHeightReference: createPropertyDescriptor(\"extrudedHeightReference\"),\n\n /**\n * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n rotation: createPropertyDescriptor(\"rotation\"),\n\n /**\n * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default 0\n */\n stRotation: createPropertyDescriptor(\"stRotation\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the rectangle.\n * @memberof RectangleGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the rectangle is outlined.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the rectangle\n * casts or receives shadows from light sources.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n\n /**\n * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof RectangleGraphics.prototype\n * @type {Property|undefined}\n * @default ClassificationType.BOTH\n */\n classificationType: createPropertyDescriptor(\"classificationType\"),\n\n /**\n * Gets or sets the zIndex Property specifying the ordering of the rectangle. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.\n * @memberof RectangleGraphics.prototype\n * @type {ConstantProperty|undefined}\n * @default 0\n */\n zIndex: createPropertyDescriptor(\"zIndex\"),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {RectangleGraphics} [result] The object onto which to store the result.\n * @returns {RectangleGraphics} The modified result parameter or a new instance if one was not provided.\n */\nRectangleGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new RectangleGraphics(this);\n }\n result.show = this.show;\n result.coordinates = this.coordinates;\n result.height = this.height;\n result.heightReference = this.heightReference;\n result.extrudedHeight = this.extrudedHeight;\n result.extrudedHeightReference = this.extrudedHeightReference;\n result.rotation = this.rotation;\n result.stRotation = this.stRotation;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n result.classificationType = this.classificationType;\n result.zIndex = this.zIndex;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {RectangleGraphics} source The object to be merged into this object.\n */\nRectangleGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.coordinates = defaultValue(this.coordinates, source.coordinates);\n this.height = defaultValue(this.height, source.height);\n this.heightReference = defaultValue(\n this.heightReference,\n source.heightReference\n );\n this.extrudedHeight = defaultValue(\n this.extrudedHeight,\n source.extrudedHeight\n );\n this.extrudedHeightReference = defaultValue(\n this.extrudedHeightReference,\n source.extrudedHeightReference\n );\n this.rotation = defaultValue(this.rotation, source.rotation);\n this.stRotation = defaultValue(this.stRotation, source.stRotation);\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n this.classificationType = defaultValue(\n this.classificationType,\n source.classificationType\n );\n this.zIndex = defaultValue(this.zIndex, source.zIndex);\n};\nexport default RectangleGraphics;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport createMaterialPropertyDescriptor from \"./createMaterialPropertyDescriptor.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\n\n/**\n * @typedef {Object} WallGraphics.ConstructorOptions\n *\n * Initialization options for the WallGraphics constructor\n *\n * @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the wall.\n * @property {Property | Array<Cartesian3>} [positions] A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.\n * @property {Property | Array<number>} [minimumHeights] A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.\n * @property {Property | Array<number>} [maximumHeights] A Property specifying an array of heights to be used for the top of the wall instead of the height of each position.\n * @property {Property | number} [granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude point.\n * @property {Property | boolean} [fill=true] A boolean Property specifying whether the wall is filled with the provided material.\n * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the wall.\n * @property {Property | boolean} [outline=false] A boolean Property specifying whether the wall is outlined.\n * @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.\n * @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the wall casts or receives shadows from light sources.\n * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this wall will be displayed.\n */\n\n/**\n * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.\n * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.\n *\n * @alias WallGraphics\n * @constructor\n *\n * @param {WallGraphics.ConstructorOptions} [options] Object describing initialization options\n *\n * @see Entity\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}\n */\nfunction WallGraphics(options) {\n this._definitionChanged = new Event();\n this._show = undefined;\n this._showSubscription = undefined;\n this._positions = undefined;\n this._positionsSubscription = undefined;\n this._minimumHeights = undefined;\n this._minimumHeightsSubscription = undefined;\n this._maximumHeights = undefined;\n this._maximumHeightsSubscription = undefined;\n this._granularity = undefined;\n this._granularitySubscription = undefined;\n this._fill = undefined;\n this._fillSubscription = undefined;\n this._material = undefined;\n this._materialSubscription = undefined;\n this._outline = undefined;\n this._outlineSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n this._shadows = undefined;\n this._shadowsSubscription = undefined;\n this._distanceDisplayCondition = undefined;\n this._distanceDisplayConditionSubscription = undefined;\n\n this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));\n}\n\nObject.defineProperties(WallGraphics.prototype, {\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof WallGraphics.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the boolean Property specifying the visibility of the wall.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n show: createPropertyDescriptor(\"show\"),\n\n /**\n * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n */\n positions: createPropertyDescriptor(\"positions\"),\n\n /**\n * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe.\n * If defined, the array must be the same length as {@link Wall#positions}.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n */\n minimumHeights: createPropertyDescriptor(\"minimumHeights\"),\n\n /**\n * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position.\n * If defined, the array must be the same length as {@link Wall#positions}.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n */\n maximumHeights: createPropertyDescriptor(\"maximumHeights\"),\n\n /**\n * Gets or sets the numeric Property specifying the angular distance between points on the wall.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default {CesiumMath.RADIANS_PER_DEGREE}\n */\n granularity: createPropertyDescriptor(\"granularity\"),\n\n /**\n * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default true\n */\n fill: createPropertyDescriptor(\"fill\"),\n\n /**\n * Gets or sets the Property specifying the material used to fill the wall.\n * @memberof WallGraphics.prototype\n * @type {MaterialProperty}\n * @default Color.WHITE\n */\n material: createMaterialPropertyDescriptor(\"material\"),\n\n /**\n * Gets or sets the Property specifying whether the wall is outlined.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default false\n */\n outline: createPropertyDescriptor(\"outline\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * <p>\n * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.\n * </p>\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n\n /**\n * Get or sets the enum Property specifying whether the wall\n * casts or receives shadows from light sources.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n * @default ShadowMode.DISABLED\n */\n shadows: createPropertyDescriptor(\"shadows\"),\n\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.\n * @memberof WallGraphics.prototype\n * @type {Property|undefined}\n */\n distanceDisplayCondition: createPropertyDescriptor(\n \"distanceDisplayCondition\"\n ),\n});\n\n/**\n * Duplicates this instance.\n *\n * @param {WallGraphics} [result] The object onto which to store the result.\n * @returns {WallGraphics} The modified result parameter or a new instance if one was not provided.\n */\nWallGraphics.prototype.clone = function (result) {\n if (!defined(result)) {\n return new WallGraphics(this);\n }\n result.show = this.show;\n result.positions = this.positions;\n result.minimumHeights = this.minimumHeights;\n result.maximumHeights = this.maximumHeights;\n result.granularity = this.granularity;\n result.fill = this.fill;\n result.material = this.material;\n result.outline = this.outline;\n result.outlineColor = this.outlineColor;\n result.outlineWidth = this.outlineWidth;\n result.shadows = this.shadows;\n result.distanceDisplayCondition = this.distanceDisplayCondition;\n return result;\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {WallGraphics} source The object to be merged into this object.\n */\nWallGraphics.prototype.merge = function (source) {\n this.show = defaultValue(this.show, source.show);\n this.positions = defaultValue(this.positions, source.positions);\n this.minimumHeights = defaultValue(\n this.minimumHeights,\n source.minimumHeights\n );\n this.maximumHeights = defaultValue(\n this.maximumHeights,\n source.maximumHeights\n );\n this.granularity = defaultValue(this.granularity, source.granularity);\n this.fill = defaultValue(this.fill, source.fill);\n this.material = defaultValue(this.material, source.material);\n this.outline = defaultValue(this.outline, source.outline);\n this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);\n this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);\n this.shadows = defaultValue(this.shadows, source.shadows);\n this.distanceDisplayCondition = defaultValue(\n this.distanceDisplayCondition,\n source.distanceDisplayCondition\n );\n};\nexport default WallGraphics;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport BoxGraphics from \"./BoxGraphics.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport CorridorGraphics from \"./CorridorGraphics.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport createRawPropertyDescriptor from \"./createRawPropertyDescriptor.js\";\nimport CylinderGraphics from \"./CylinderGraphics.js\";\nimport EllipseGraphics from \"./EllipseGraphics.js\";\nimport EllipsoidGraphics from \"./EllipsoidGraphics.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport Cesium3DTilesetGraphics from \"./Cesium3DTilesetGraphics.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PlaneGraphics from \"./PlaneGraphics.js\";\nimport PointGraphics from \"./PointGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineVolumeGraphics from \"./PolylineVolumeGraphics.js\";\nimport Property from \"./Property.js\";\nimport PropertyBag from \"./PropertyBag.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport WallGraphics from \"./WallGraphics.js\";\n\nconst cartoScratch = new Cartographic();\n\nfunction createConstantPositionProperty(value) {\n return new ConstantPositionProperty(value);\n}\n\nfunction createPositionPropertyDescriptor(name) {\n return createPropertyDescriptor(\n name,\n undefined,\n createConstantPositionProperty\n );\n}\n\nfunction createPropertyTypeDescriptor(name, Type) {\n return createPropertyDescriptor(name, undefined, function (value) {\n if (value instanceof Type) {\n return value;\n }\n return new Type(value);\n });\n}\n\n/**\n * @typedef {Object} Entity.ConstructorOptions\n *\n * Initialization options for the Entity constructor\n *\n * @property {String} [id] A unique identifier for this object. If none is provided, a GUID is generated.\n * @property {String} [name] A human readable name to display to users. It does not have to be unique.\n * @property {TimeIntervalCollection} [availability] The availability, if any, associated with this object.\n * @property {Boolean} [show] A boolean value indicating if the entity and its children are displayed.\n * @property {Property | string} [description] A string Property specifying an HTML description for this entity.\n * @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position.\n * @property {Property} [orientation] A Property specifying the entity orientation.\n * @property {Property} [viewFrom] A suggested initial offset for viewing this object.\n * @property {Entity} [parent] A parent entity to associate with this entity.\n * @property {BillboardGraphics | BillboardGraphics.ConstructorOptions} [billboard] A billboard to associate with this entity.\n * @property {BoxGraphics | BoxGraphics.ConstructorOptions} [box] A box to associate with this entity.\n * @property {CorridorGraphics | CorridorGraphics.ConstructorOptions} [corridor] A corridor to associate with this entity.\n * @property {CylinderGraphics | CylinderGraphics.ConstructorOptions} [cylinder] A cylinder to associate with this entity.\n * @property {EllipseGraphics | EllipseGraphics.ConstructorOptions} [ellipse] A ellipse to associate with this entity.\n * @property {EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions} [ellipsoid] A ellipsoid to associate with this entity.\n * @property {LabelGraphics | LabelGraphics.ConstructorOptions} [label] A options.label to associate with this entity.\n * @property {ModelGraphics | ModelGraphics.ConstructorOptions} [model] A model to associate with this entity.\n * @property {Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions} [tileset] A 3D Tiles tileset to associate with this entity.\n * @property {PathGraphics | PathGraphics.ConstructorOptions} [path] A path to associate with this entity.\n * @property {PlaneGraphics | PlaneGraphics.ConstructorOptions} [plane] A plane to associate with this entity.\n * @property {PointGraphics | PointGraphics.ConstructorOptions} [point] A point to associate with this entity.\n * @property {PolygonGraphics | PolygonGraphics.ConstructorOptions} [polygon] A polygon to associate with this entity.\n * @property {PolylineGraphics | PolylineGraphics.ConstructorOptions} [polyline] A polyline to associate with this entity.\n * @property {PropertyBag | Object.<string,*>} [properties] Arbitrary properties to associate with this entity.\n * @property {PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions} [polylineVolume] A polylineVolume to associate with this entity.\n * @property {RectangleGraphics | RectangleGraphics.ConstructorOptions} [rectangle] A rectangle to associate with this entity.\n * @property {WallGraphics | WallGraphics.ConstructorOptions} [wall] A wall to associate with this entity.\n */\n\n/**\n * Entity instances aggregate multiple forms of visualization into a single high-level object.\n * They can be created manually and added to {@link Viewer#entities} or be produced by\n * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.\n * @alias Entity\n * @constructor\n *\n * @param {Entity.ConstructorOptions} [options] Object describing initialization options\n *\n * @see {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-creating-entities/|Creating Entities}\n */\nfunction Entity(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let id = options.id;\n if (!defined(id)) {\n id = createGuid();\n }\n\n this._availability = undefined;\n this._id = id;\n this._definitionChanged = new Event();\n this._name = options.name;\n this._show = defaultValue(options.show, true);\n this._parent = undefined;\n this._propertyNames = [\n \"billboard\",\n \"box\",\n \"corridor\",\n \"cylinder\",\n \"description\",\n \"ellipse\", //\n \"ellipsoid\",\n \"label\",\n \"model\",\n \"tileset\",\n \"orientation\",\n \"path\",\n \"plane\",\n \"point\",\n \"polygon\", //\n \"polyline\",\n \"polylineVolume\",\n \"position\",\n \"properties\",\n \"rectangle\",\n \"viewFrom\",\n \"wall\",\n ];\n\n this._billboard = undefined;\n this._billboardSubscription = undefined;\n this._box = undefined;\n this._boxSubscription = undefined;\n this._corridor = undefined;\n this._corridorSubscription = undefined;\n this._cylinder = undefined;\n this._cylinderSubscription = undefined;\n this._description = undefined;\n this._descriptionSubscription = undefined;\n this._ellipse = undefined;\n this._ellipseSubscription = undefined;\n this._ellipsoid = undefined;\n this._ellipsoidSubscription = undefined;\n this._label = undefined;\n this._labelSubscription = undefined;\n this._model = undefined;\n this._modelSubscription = undefined;\n this._tileset = undefined;\n this._tilesetSubscription = undefined;\n this._orientation = undefined;\n this._orientationSubscription = undefined;\n this._path = undefined;\n this._pathSubscription = undefined;\n this._plane = undefined;\n this._planeSubscription = undefined;\n this._point = undefined;\n this._pointSubscription = undefined;\n this._polygon = undefined;\n this._polygonSubscription = undefined;\n this._polyline = undefined;\n this._polylineSubscription = undefined;\n this._polylineVolume = undefined;\n this._polylineVolumeSubscription = undefined;\n this._position = undefined;\n this._positionSubscription = undefined;\n this._properties = undefined;\n this._propertiesSubscription = undefined;\n this._rectangle = undefined;\n this._rectangleSubscription = undefined;\n this._viewFrom = undefined;\n this._viewFromSubscription = undefined;\n this._wall = undefined;\n this._wallSubscription = undefined;\n this._children = [];\n\n /**\n * Gets or sets the entity collection that this entity belongs to.\n * @type {EntityCollection}\n */\n this.entityCollection = undefined;\n\n this.parent = options.parent;\n this.merge(options);\n}\n\nfunction updateShow(entity, children, isShowing) {\n const length = children.length;\n for (let i = 0; i < length; i++) {\n const child = children[i];\n const childShow = child._show;\n const oldValue = !isShowing && childShow;\n const newValue = isShowing && childShow;\n if (oldValue !== newValue) {\n updateShow(child, child._children, isShowing);\n }\n }\n entity._definitionChanged.raiseEvent(\n entity,\n \"isShowing\",\n isShowing,\n !isShowing\n );\n}\n\nObject.defineProperties(Entity.prototype, {\n /**\n * The availability, if any, associated with this object.\n * If availability is undefined, it is assumed that this object's\n * other properties will return valid data for any provided time.\n * If availability exists, the objects other properties will only\n * provide valid data if queried within the given interval.\n * @memberof Entity.prototype\n * @type {TimeIntervalCollection|undefined}\n */\n availability: createRawPropertyDescriptor(\"availability\"),\n /**\n * Gets the unique ID associated with this object.\n * @memberof Entity.prototype\n * @type {String}\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * Gets the event that is raised whenever a property or sub-property is changed or modified.\n * @memberof Entity.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the name of the object. The name is intended for end-user\n * consumption and does not need to be unique.\n * @memberof Entity.prototype\n * @type {String|undefined}\n */\n name: createRawPropertyDescriptor(\"name\"),\n /**\n * Gets or sets whether this entity should be displayed. When set to true,\n * the entity is only displayed if the parent entity's show property is also true.\n * @memberof Entity.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (value === this._show) {\n return;\n }\n\n const wasShowing = this.isShowing;\n this._show = value;\n const isShowing = this.isShowing;\n\n if (wasShowing !== isShowing) {\n updateShow(this, this._children, isShowing);\n }\n\n this._definitionChanged.raiseEvent(this, \"show\", value, !value);\n },\n },\n /**\n * Gets whether this entity is being displayed, taking into account\n * the visibility of any ancestor entities.\n * @memberof Entity.prototype\n * @type {Boolean}\n */\n isShowing: {\n get: function () {\n return (\n this._show &&\n (!defined(this.entityCollection) || this.entityCollection.show) &&\n (!defined(this._parent) || this._parent.isShowing)\n );\n },\n },\n /**\n * Gets or sets the parent object.\n * @memberof Entity.prototype\n * @type {Entity|undefined}\n */\n parent: {\n get: function () {\n return this._parent;\n },\n set: function (value) {\n const oldValue = this._parent;\n\n if (oldValue === value) {\n return;\n }\n\n const wasShowing = this.isShowing;\n if (defined(oldValue)) {\n const index = oldValue._children.indexOf(this);\n oldValue._children.splice(index, 1);\n }\n\n this._parent = value;\n if (defined(value)) {\n value._children.push(this);\n }\n\n const isShowing = this.isShowing;\n\n if (wasShowing !== isShowing) {\n updateShow(this, this._children, isShowing);\n }\n\n this._definitionChanged.raiseEvent(this, \"parent\", value, oldValue);\n },\n },\n /**\n * Gets the names of all properties registered on this instance.\n * @memberof Entity.prototype\n * @type {string[]}\n */\n propertyNames: {\n get: function () {\n return this._propertyNames;\n },\n },\n /**\n * Gets or sets the billboard.\n * @memberof Entity.prototype\n * @type {BillboardGraphics|undefined}\n */\n billboard: createPropertyTypeDescriptor(\"billboard\", BillboardGraphics),\n /**\n * Gets or sets the box.\n * @memberof Entity.prototype\n * @type {BoxGraphics|undefined}\n */\n box: createPropertyTypeDescriptor(\"box\", BoxGraphics),\n /**\n * Gets or sets the corridor.\n * @memberof Entity.prototype\n * @type {CorridorGraphics|undefined}\n */\n corridor: createPropertyTypeDescriptor(\"corridor\", CorridorGraphics),\n /**\n * Gets or sets the cylinder.\n * @memberof Entity.prototype\n * @type {CylinderGraphics|undefined}\n */\n cylinder: createPropertyTypeDescriptor(\"cylinder\", CylinderGraphics),\n /**\n * Gets or sets the description.\n * @memberof Entity.prototype\n * @type {Property|undefined}\n */\n description: createPropertyDescriptor(\"description\"),\n /**\n * Gets or sets the ellipse.\n * @memberof Entity.prototype\n * @type {EllipseGraphics|undefined}\n */\n ellipse: createPropertyTypeDescriptor(\"ellipse\", EllipseGraphics),\n /**\n * Gets or sets the ellipsoid.\n * @memberof Entity.prototype\n * @type {EllipsoidGraphics|undefined}\n */\n ellipsoid: createPropertyTypeDescriptor(\"ellipsoid\", EllipsoidGraphics),\n /**\n * Gets or sets the label.\n * @memberof Entity.prototype\n * @type {LabelGraphics|undefined}\n */\n label: createPropertyTypeDescriptor(\"label\", LabelGraphics),\n /**\n * Gets or sets the model.\n * @memberof Entity.prototype\n * @type {ModelGraphics|undefined}\n */\n model: createPropertyTypeDescriptor(\"model\", ModelGraphics),\n /**\n * Gets or sets the tileset.\n * @memberof Entity.prototype\n * @type {Cesium3DTilesetGraphics|undefined}\n */\n tileset: createPropertyTypeDescriptor(\"tileset\", Cesium3DTilesetGraphics),\n /**\n * Gets or sets the orientation.\n * @memberof Entity.prototype\n * @type {Property|undefined}\n */\n orientation: createPropertyDescriptor(\"orientation\"),\n /**\n * Gets or sets the path.\n * @memberof Entity.prototype\n * @type {PathGraphics|undefined}\n */\n path: createPropertyTypeDescriptor(\"path\", PathGraphics),\n /**\n * Gets or sets the plane.\n * @memberof Entity.prototype\n * @type {PlaneGraphics|undefined}\n */\n plane: createPropertyTypeDescriptor(\"plane\", PlaneGraphics),\n /**\n * Gets or sets the point graphic.\n * @memberof Entity.prototype\n * @type {PointGraphics|undefined}\n */\n point: createPropertyTypeDescriptor(\"point\", PointGraphics),\n /**\n * Gets or sets the polygon.\n * @memberof Entity.prototype\n * @type {PolygonGraphics|undefined}\n */\n polygon: createPropertyTypeDescriptor(\"polygon\", PolygonGraphics),\n /**\n * Gets or sets the polyline.\n * @memberof Entity.prototype\n * @type {PolylineGraphics|undefined}\n */\n polyline: createPropertyTypeDescriptor(\"polyline\", PolylineGraphics),\n /**\n * Gets or sets the polyline volume.\n * @memberof Entity.prototype\n * @type {PolylineVolumeGraphics|undefined}\n */\n polylineVolume: createPropertyTypeDescriptor(\n \"polylineVolume\",\n PolylineVolumeGraphics\n ),\n /**\n * Gets or sets the bag of arbitrary properties associated with this entity.\n * @memberof Entity.prototype\n * @type {PropertyBag|undefined}\n */\n properties: createPropertyTypeDescriptor(\"properties\", PropertyBag),\n /**\n * Gets or sets the position.\n * @memberof Entity.prototype\n * @type {PositionProperty|undefined}\n */\n position: createPositionPropertyDescriptor(\"position\"),\n /**\n * Gets or sets the rectangle.\n * @memberof Entity.prototype\n * @type {RectangleGraphics|undefined}\n */\n rectangle: createPropertyTypeDescriptor(\"rectangle\", RectangleGraphics),\n /**\n * Gets or sets the suggested initial offset when tracking this object.\n * The offset is typically defined in the east-north-up reference frame,\n * but may be another frame depending on the object's velocity.\n * @memberof Entity.prototype\n * @type {Property|undefined}\n */\n viewFrom: createPropertyDescriptor(\"viewFrom\"),\n /**\n * Gets or sets the wall.\n * @memberof Entity.prototype\n * @type {WallGraphics|undefined}\n */\n wall: createPropertyTypeDescriptor(\"wall\", WallGraphics),\n});\n\n/**\n * Given a time, returns true if this object should have data during that time.\n *\n * @param {JulianDate} time The time to check availability for.\n * @returns {Boolean} true if the object should have data during the provided time, false otherwise.\n */\nEntity.prototype.isAvailable = function (time) {\n const availability = this._availability;\n return !defined(availability) || availability.contains(time);\n};\n\n/**\n * Adds a property to this object. Once a property is added, it can be\n * observed with {@link Entity#definitionChanged} and composited\n * with {@link CompositeEntityCollection}\n *\n * @param {String} propertyName The name of the property to add.\n *\n * @exception {DeveloperError} \"propertyName\" is a reserved property name.\n * @exception {DeveloperError} \"propertyName\" is already a registered property.\n */\nEntity.prototype.addProperty = function (propertyName) {\n const propertyNames = this._propertyNames;\n\n propertyNames.push(propertyName);\n Object.defineProperty(\n this,\n propertyName,\n createRawPropertyDescriptor(propertyName, true)\n );\n};\n\n/**\n * Removed a property previously added with addProperty.\n *\n * @param {String} propertyName The name of the property to remove.\n *\n * @exception {DeveloperError} \"propertyName\" is a reserved property name.\n * @exception {DeveloperError} \"propertyName\" is not a registered property.\n */\nEntity.prototype.removeProperty = function (propertyName) {\n const propertyNames = this._propertyNames;\n const index = propertyNames.indexOf(propertyName);\n\n this._propertyNames.splice(index, 1);\n delete this[propertyName];\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {Entity} source The object to be merged into this object.\n */\nEntity.prototype.merge = function (source) {\n //Name, show, and availability are not Property objects and are currently handled differently.\n //source.show is intentionally ignored because this.show always has a value.\n this.name = defaultValue(this.name, source.name);\n this.availability = defaultValue(this.availability, source.availability);\n\n const propertyNames = this._propertyNames;\n const sourcePropertyNames = defined(source._propertyNames)\n ? source._propertyNames\n : Object.keys(source);\n const propertyNamesLength = sourcePropertyNames.length;\n for (let i = 0; i < propertyNamesLength; i++) {\n const name = sourcePropertyNames[i];\n\n //While source is required by the API to be an Entity, we internally call this method from the\n //constructor with an options object to configure initial custom properties.\n //So we need to ignore reserved-non-property.\n if (name === \"parent\" || name === \"name\" || name === \"availability\") {\n continue;\n }\n\n const targetProperty = this[name];\n const sourceProperty = source[name];\n\n //Custom properties that are registered on the source entity must also\n //get registered on this entity.\n if (!defined(targetProperty) && propertyNames.indexOf(name) === -1) {\n this.addProperty(name);\n }\n\n if (defined(sourceProperty)) {\n if (defined(targetProperty)) {\n if (defined(targetProperty.merge)) {\n targetProperty.merge(sourceProperty);\n }\n } else if (\n defined(sourceProperty.merge) &&\n defined(sourceProperty.clone)\n ) {\n this[name] = sourceProperty.clone();\n } else {\n this[name] = sourceProperty;\n }\n }\n }\n};\n\nconst matrix3Scratch = new Matrix3();\nconst positionScratch = new Cartesian3();\nconst orientationScratch = new Quaternion();\n\n/**\n * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position\n * are undefined.\n *\n * @param {JulianDate} time The time to retrieve model matrix for.\n * @param {Matrix4} [result] The object onto which to store the result.\n *\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.\n */\nEntity.prototype.computeModelMatrix = function (time, result) {\nconst position = Property.getValueOrUndefined(\n this._position,\n time,\n positionScratch\n );\n if (!defined(position)) {\n return undefined;\n }\n\n const orientation = Property.getValueOrUndefined(\n this._orientation,\n time,\n orientationScratch\n );\n if (!defined(orientation)) {\n result = Transforms.eastNorthUpToFixedFrame(position, undefined, result);\n } else {\n result = Matrix4.fromRotationTranslation(\n Matrix3.fromQuaternion(orientation, matrix3Scratch),\n position,\n result\n );\n }\n return result;\n};\n\n/**\n * @private\n */\nEntity.prototype.computeModelMatrixForHeightReference = function (\n time,\n heightReferenceProperty,\n heightOffset,\n ellipsoid,\n result\n) {\nconst heightReference = Property.getValueOrDefault(\n heightReferenceProperty,\n time,\n HeightReference.NONE\n );\n let position = Property.getValueOrUndefined(\n this._position,\n time,\n positionScratch\n );\n if (\n heightReference === HeightReference.NONE ||\n !defined(position) ||\n Cartesian3.equalsEpsilon(position, Cartesian3.ZERO, CesiumMath.EPSILON8)\n ) {\n return this.computeModelMatrix(time, result);\n }\n\n const carto = ellipsoid.cartesianToCartographic(position, cartoScratch);\n if (heightReference === HeightReference.CLAMP_TO_GROUND) {\n carto.height = heightOffset;\n } else {\n carto.height += heightOffset;\n }\n position = ellipsoid.cartographicToCartesian(carto, position);\n\n const orientation = Property.getValueOrUndefined(\n this._orientation,\n time,\n orientationScratch\n );\n if (!defined(orientation)) {\n result = Transforms.eastNorthUpToFixedFrame(position, undefined, result);\n } else {\n result = Matrix4.fromRotationTranslation(\n Matrix3.fromQuaternion(orientation, matrix3Scratch),\n position,\n result\n );\n }\n return result;\n};\n\n/**\n * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.\n * If this feature is not supported, Entities with non-color materials but no `height` will\n * instead be rendered as if height is 0.\n *\n * @param {Scene} scene The current scene.\n * @returns {Boolean} Whether or not the current scene supports materials for entities on terrain.\n */\nEntity.supportsMaterialsforEntitiesOnTerrain = function (scene) {\n return GroundPrimitive.supportsMaterials(scene);\n};\n\n/**\n * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.\n * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at\n * the provided heights and using the `arcType` parameter instead of clamped to the ground.\n *\n * @param {Scene} scene The current scene.\n * @returns {Boolean} Whether or not the current scene supports polylines on terrain or 3D TIles.\n */\nEntity.supportsPolylinesOnTerrain = function (scene) {\n return GroundPolylinePrimitive.isSupported(scene);\n};\nexport default Entity;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport Entity from \"./Entity.js\";\nimport Property from \"./Property.js\";\n\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultShow = new ConstantProperty(true);\nconst defaultFill = new ConstantProperty(true);\nconst defaultOutline = new ConstantProperty(false);\nconst defaultOutlineColor = new ConstantProperty(Color.BLACK);\nconst defaultShadows = new ConstantProperty(ShadowMode.DISABLED);\nconst defaultDistanceDisplayCondition = new ConstantProperty(\n new DistanceDisplayCondition()\n);\nconst defaultClassificationType = new ConstantProperty(ClassificationType.BOTH);\n\n/**\n * An abstract class for updating geometry entities.\n * @alias GeometryUpdater\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {Entity} options.entity The entity containing the geometry to be visualized.\n * @param {Scene} options.scene The scene where visualization is taking place.\n * @param {Object} options.geometryOptions Options for the geometry\n * @param {String} options.geometryPropertyName The geometry property name\n * @param {String[]} options.observedPropertyNames The entity properties this geometry cares about\n */\nfunction GeometryUpdater(options) {\n const entity = options.entity;\n const geometryPropertyName = options.geometryPropertyName;\n\n this._entity = entity;\n this._scene = options.scene;\n this._fillEnabled = false;\n this._isClosed = false;\n this._onTerrain = false;\n this._dynamic = false;\n this._outlineEnabled = false;\n this._geometryChanged = new Event();\n this._showProperty = undefined;\n this._materialProperty = undefined;\n this._showOutlineProperty = undefined;\n this._outlineColorProperty = undefined;\n this._outlineWidth = 1.0;\n this._shadowsProperty = undefined;\n this._distanceDisplayConditionProperty = undefined;\n this._classificationTypeProperty = undefined;\n this._options = options.geometryOptions;\n this._geometryPropertyName = geometryPropertyName;\n this._id = `${geometryPropertyName}-${entity.id}`;\n this._observedPropertyNames = options.observedPropertyNames;\n this._supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(\n options.scene\n );\n}\n\nObject.defineProperties(GeometryUpdater.prototype, {\n /**\n * Gets the unique ID associated with this updater\n * @memberof GeometryUpdater.prototype\n * @type {String}\n * @readonly\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * Gets the entity associated with this geometry.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Entity}\n * @readonly\n */\n entity: {\n get: function () {\n return this._entity;\n },\n },\n /**\n * Gets a value indicating if the geometry has a fill component.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n fillEnabled: {\n get: function () {\n return this._fillEnabled;\n },\n },\n /**\n * Gets a value indicating if fill visibility varies with simulation time.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n hasConstantFill: {\n get: function () {\n return (\n !this._fillEnabled ||\n (!defined(this._entity.availability) &&\n Property.isConstant(this._showProperty) &&\n Property.isConstant(this._fillProperty))\n );\n },\n },\n /**\n * Gets the material property used to fill the geometry.\n * @memberof GeometryUpdater.prototype\n *\n * @type {MaterialProperty}\n * @readonly\n */\n fillMaterialProperty: {\n get: function () {\n return this._materialProperty;\n },\n },\n /**\n * Gets a value indicating if the geometry has an outline component.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n outlineEnabled: {\n get: function () {\n return this._outlineEnabled;\n },\n },\n /**\n * Gets a value indicating if the geometry has an outline component.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n hasConstantOutline: {\n get: function () {\n return (\n !this._outlineEnabled ||\n (!defined(this._entity.availability) &&\n Property.isConstant(this._showProperty) &&\n Property.isConstant(this._showOutlineProperty))\n );\n },\n },\n /**\n * Gets the {@link Color} property for the geometry outline.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n outlineColorProperty: {\n get: function () {\n return this._outlineColorProperty;\n },\n },\n /**\n * Gets the constant with of the geometry outline, in pixels.\n * This value is only valid if isDynamic is false.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Number}\n * @readonly\n */\n outlineWidth: {\n get: function () {\n return this._outlineWidth;\n },\n },\n /**\n * Gets the property specifying whether the geometry\n * casts or receives shadows from light sources.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n shadowsProperty: {\n get: function () {\n return this._shadowsProperty;\n },\n },\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n distanceDisplayConditionProperty: {\n get: function () {\n return this._distanceDisplayConditionProperty;\n },\n },\n /**\n * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n classificationTypeProperty: {\n get: function () {\n return this._classificationTypeProperty;\n },\n },\n /**\n * Gets a value indicating if the geometry is time-varying.\n * If true, all visualization is delegated to a DynamicGeometryUpdater\n * returned by GeometryUpdater#createDynamicUpdater.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isDynamic: {\n get: function () {\n return this._dynamic;\n },\n },\n /**\n * Gets a value indicating if the geometry is closed.\n * This property is only valid for static geometry.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isClosed: {\n get: function () {\n return this._isClosed;\n },\n },\n /**\n * Gets a value indicating if the geometry should be drawn on terrain.\n * @memberof EllipseGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n onTerrain: {\n get: function () {\n return this._onTerrain;\n },\n },\n /**\n * Gets an event that is raised whenever the public properties\n * of this updater change.\n * @memberof GeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n geometryChanged: {\n get: function () {\n return this._geometryChanged;\n },\n },\n});\n\n/**\n * Checks if the geometry is outlined at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {Boolean} true if geometry is outlined at the provided time, false otherwise.\n */\nGeometryUpdater.prototype.isOutlineVisible = function (time) {\n const entity = this._entity;\n const visible =\n this._outlineEnabled &&\n entity.isAvailable(time) &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time);\n return defaultValue(visible, false);\n};\n\n/**\n * Checks if the geometry is filled at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {Boolean} true if geometry is filled at the provided time, false otherwise.\n */\nGeometryUpdater.prototype.isFilled = function (time) {\n const entity = this._entity;\n const visible =\n this._fillEnabled &&\n entity.isAvailable(time) &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time);\n return defaultValue(visible, false);\n};\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @function\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nGeometryUpdater.prototype.createFillGeometryInstance =\n DeveloperError.throwInstantiationError;\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @function\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nGeometryUpdater.prototype.createOutlineGeometryInstance =\n DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nGeometryUpdater.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys and resources used by the object. Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nGeometryUpdater.prototype.destroy = function () {\n destroyObject(this);\n};\n/**\n * @param {Entity} entity\n * @param {Object} geometry\n * @private\n */\nGeometryUpdater.prototype._isHidden = function (entity, geometry) {\n const show = geometry.show;\n return (\n defined(show) && show.isConstant && !show.getValue(Iso8601.MINIMUM_VALUE)\n );\n};\n\n/**\n * @param {Entity} entity\n * @param {Object} geometry\n * @private\n */\nGeometryUpdater.prototype._isOnTerrain = function (entity, geometry) {\n return false;\n};\n\n/**\n * @param {GeometryOptions} options\n * @private\n */\nGeometryUpdater.prototype._getIsClosed = function (options) {\n return true;\n};\n\n/**\n * @param {Entity} entity\n * @param {Object} geometry\n * @private\n */\nGeometryUpdater.prototype._isDynamic = DeveloperError.throwInstantiationError;\n\n/**\n * @param {Entity} entity\n * @param {Object} geometry\n * @private\n */\nGeometryUpdater.prototype._setStaticOptions =\n DeveloperError.throwInstantiationError;\n\n/**\n * @param {Entity} entity\n * @param {String} propertyName\n * @param {*} newValue\n * @param {*} oldValue\n * @private\n */\nGeometryUpdater.prototype._onEntityPropertyChanged = function (\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n return;\n }\n\n const geometry = this._entity[this._geometryPropertyName];\n\n if (!defined(geometry)) {\n if (this._fillEnabled || this._outlineEnabled) {\n this._fillEnabled = false;\n this._outlineEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n const fillProperty = geometry.fill;\n const fillEnabled =\n defined(fillProperty) && fillProperty.isConstant\n ? fillProperty.getValue(Iso8601.MINIMUM_VALUE)\n : true;\n\n const outlineProperty = geometry.outline;\n let outlineEnabled = defined(outlineProperty);\n if (outlineEnabled && outlineProperty.isConstant) {\n outlineEnabled = outlineProperty.getValue(Iso8601.MINIMUM_VALUE);\n }\n\n if (!fillEnabled && !outlineEnabled) {\n if (this._fillEnabled || this._outlineEnabled) {\n this._fillEnabled = false;\n this._outlineEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n const show = geometry.show;\n if (this._isHidden(entity, geometry)) {\n if (this._fillEnabled || this._outlineEnabled) {\n this._fillEnabled = false;\n this._outlineEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n this._materialProperty = defaultValue(geometry.material, defaultMaterial);\n this._fillProperty = defaultValue(fillProperty, defaultFill);\n this._showProperty = defaultValue(show, defaultShow);\n this._showOutlineProperty = defaultValue(geometry.outline, defaultOutline);\n this._outlineColorProperty = outlineEnabled\n ? defaultValue(geometry.outlineColor, defaultOutlineColor)\n : undefined;\n this._shadowsProperty = defaultValue(geometry.shadows, defaultShadows);\n this._distanceDisplayConditionProperty = defaultValue(\n geometry.distanceDisplayCondition,\n defaultDistanceDisplayCondition\n );\n this._classificationTypeProperty = defaultValue(\n geometry.classificationType,\n defaultClassificationType\n );\n\n this._fillEnabled = fillEnabled;\n\n const onTerrain =\n this._isOnTerrain(entity, geometry) &&\n (this._supportsMaterialsforEntitiesOnTerrain ||\n this._materialProperty instanceof ColorMaterialProperty);\n\n if (outlineEnabled && onTerrain) {\n oneTimeWarning(oneTimeWarning.geometryOutlines);\n outlineEnabled = false;\n }\n\n this._onTerrain = onTerrain;\n this._outlineEnabled = outlineEnabled;\n\n if (this._isDynamic(entity, geometry)) {\n if (!this._dynamic) {\n this._dynamic = true;\n this._geometryChanged.raiseEvent(this);\n }\n } else {\n this._setStaticOptions(entity, geometry);\n this._isClosed = this._getIsClosed(this._options);\n const outlineWidth = geometry.outlineWidth;\n this._outlineWidth = defined(outlineWidth)\n ? outlineWidth.getValue(Iso8601.MINIMUM_VALUE)\n : 1.0;\n this._dynamic = false;\n this._geometryChanged.raiseEvent(this);\n }\n};\n\n/**\n * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.\n *\n * @param {PrimitiveCollection} primitives The primitive collection to use.\n * @param {PrimitiveCollection} [groundPrimitives] The primitive collection to use for ground primitives.\n *\n * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.\n *\n * @exception {DeveloperError} This instance does not represent dynamic geometry.\n * @private\n */\nGeometryUpdater.prototype.createDynamicUpdater = function (\n primitives,\n groundPrimitives\n) {\n return new this.constructor.DynamicGeometryUpdater(\n this,\n primitives,\n groundPrimitives\n );\n};\nexport default GeometryUpdater;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\n\n/**\n * A {@link Property} whose value is lazily evaluated by a callback function.\n *\n * @alias CallbackProperty\n * @constructor\n *\n * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated.\n * @param {Boolean} isConstant <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.\n */\nfunction CallbackProperty(callback, isConstant) {\n this._callback = undefined;\n this._isConstant = undefined;\n this._definitionChanged = new Event();\n this.setCallback(callback, isConstant);\n}\n\nObject.defineProperties(CallbackProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * @memberof CallbackProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._isConstant;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setCallback is called.\n * @memberof CallbackProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.\n */\nCallbackProperty.prototype.getValue = function (time, result) {\n return this._callback(time, result);\n};\n\n/**\n * Sets the callback to be used.\n *\n * @param {CallbackProperty.Callback} callback The function to be called when the property is evaluated.\n * @param {Boolean} isConstant <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.\n */\nCallbackProperty.prototype.setCallback = function (callback, isConstant) {\n const changed =\n this._callback !== callback || this._isConstant !== isConstant;\n\n this._callback = callback;\n this._isConstant = isConstant;\n\n if (changed) {\n this._definitionChanged.raiseEvent(this);\n }\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCallbackProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof CallbackProperty &&\n this._callback === other._callback &&\n this._isConstant === other._isConstant)\n );\n};\n\n/**\n * A function that returns the value of the property.\n * @callback CallbackProperty.Callback\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into. If omitted, the function must create and return a new instance.\n * @returns {Object} The modified result parameter, or a new instance if the result parameter was not supplied or is unsupported.\n */\nexport default CallbackProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport Property from \"./Property.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchCarto = new Cartographic();\n\n/**\n * @private\n */\nfunction TerrainOffsetProperty(\n scene,\n positionProperty,\n heightReferenceProperty,\n extrudedHeightReferenceProperty\n) {\n this._scene = scene;\n this._heightReference = heightReferenceProperty;\n this._extrudedHeightReference = extrudedHeightReferenceProperty;\n this._positionProperty = positionProperty;\n\n this._position = new Cartesian3();\n this._cartographicPosition = new Cartographic();\n this._normal = new Cartesian3();\n\n this._definitionChanged = new Event();\n this._terrainHeight = 0;\n this._removeCallbackFunc = undefined;\n this._removeEventListener = undefined;\n this._removeModeListener = undefined;\n\n const that = this;\n if (defined(scene.globe)) {\n this._removeEventListener = scene.terrainProviderChanged.addEventListener(\n function () {\n that._updateClamping();\n }\n );\n this._removeModeListener = scene.morphComplete.addEventListener(\n function () {\n that._updateClamping();\n }\n );\n }\n\n if (positionProperty.isConstant) {\n const position = positionProperty.getValue(\n Iso8601.MINIMUM_VALUE,\n scratchPosition\n );\n if (\n !defined(position) ||\n Cartesian3.equals(position, Cartesian3.ZERO) ||\n !defined(scene.globe)\n ) {\n return;\n }\n this._position = Cartesian3.clone(position, this._position);\n\n this._updateClamping();\n\n this._normal = scene.globe.ellipsoid.geodeticSurfaceNormal(\n position,\n this._normal\n );\n }\n}\n\nObject.defineProperties(TerrainOffsetProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * @memberof TerrainOffsetProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return false;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * @memberof TerrainOffsetProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\n/**\n * @private\n */\nTerrainOffsetProperty.prototype._updateClamping = function () {\n if (defined(this._removeCallbackFunc)) {\n this._removeCallbackFunc();\n }\n\n const scene = this._scene;\n const globe = scene.globe;\n const position = this._position;\n\n if (!defined(globe) || Cartesian3.equals(position, Cartesian3.ZERO)) {\n this._terrainHeight = 0;\n return;\n }\n const ellipsoid = globe.ellipsoid;\n const surface = globe._surface;\n\n const that = this;\n const cartographicPosition = ellipsoid.cartesianToCartographic(\n position,\n this._cartographicPosition\n );\n const height = globe.getHeight(cartographicPosition);\n if (defined(height)) {\n this._terrainHeight = height;\n } else {\n this._terrainHeight = 0;\n }\n\n function updateFunction(clampedPosition) {\n if (scene.mode === SceneMode.SCENE3D) {\n const carto = ellipsoid.cartesianToCartographic(\n clampedPosition,\n scratchCarto\n );\n that._terrainHeight = carto.height;\n } else {\n that._terrainHeight = clampedPosition.x;\n }\n that.definitionChanged.raiseEvent();\n }\n this._removeCallbackFunc = surface.updateHeight(\n cartographicPosition,\n updateFunction\n );\n};\n\n/**\n * Gets the height relative to the terrain based on the positions.\n *\n * @returns {Cartesian3} The offset\n */\nTerrainOffsetProperty.prototype.getValue = function (time, result) {\n const heightReference = Property.getValueOrDefault(\n this._heightReference,\n time,\n HeightReference.NONE\n );\n const extrudedHeightReference = Property.getValueOrDefault(\n this._extrudedHeightReference,\n time,\n HeightReference.NONE\n );\n\n if (\n heightReference === HeightReference.NONE &&\n extrudedHeightReference !== HeightReference.RELATIVE_TO_GROUND\n ) {\n this._position = Cartesian3.clone(Cartesian3.ZERO, this._position);\n return Cartesian3.clone(Cartesian3.ZERO, result);\n }\n\n if (this._positionProperty.isConstant) {\n return Cartesian3.multiplyByScalar(\n this._normal,\n this._terrainHeight,\n result\n );\n }\n\n const scene = this._scene;\n const position = this._positionProperty.getValue(time, scratchPosition);\n if (\n !defined(position) ||\n Cartesian3.equals(position, Cartesian3.ZERO) ||\n !defined(scene.globe)\n ) {\n return Cartesian3.clone(Cartesian3.ZERO, result);\n }\n\n if (\n Cartesian3.equalsEpsilon(this._position, position, CesiumMath.EPSILON10)\n ) {\n return Cartesian3.multiplyByScalar(\n this._normal,\n this._terrainHeight,\n result\n );\n }\n\n this._position = Cartesian3.clone(position, this._position);\n\n this._updateClamping();\n\n const normal = scene.globe.ellipsoid.geodeticSurfaceNormal(\n position,\n this._normal\n );\n return Cartesian3.multiplyByScalar(normal, this._terrainHeight, result);\n};\n\nTerrainOffsetProperty.prototype.isDestroyed = function () {\n return false;\n};\n\nTerrainOffsetProperty.prototype.destroy = function () {\n if (defined(this._removeEventListener)) {\n this._removeEventListener();\n }\n if (defined(this._removeModeListener)) {\n this._removeModeListener();\n }\n if (defined(this._removeCallbackFunc)) {\n this._removeCallbackFunc();\n }\n return destroyObject(this);\n};\n\n/**\n * A function which creates one or more providers.\n * @callback TerrainOffsetProperty.PositionFunction\n * @param {JulianDate} time The clock time at which to retrieve the position\n * @param {Cartesian3} result The result position\n * @returns {Cartesian3} The position at which to do the terrain height check\n */\nexport default TerrainOffsetProperty;\n", "import defined from \"../Core/defined.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport TerrainOffsetProperty from \"./TerrainOffsetProperty.js\";\n\nfunction heightReferenceOnEntityPropertyChanged(\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n GeometryUpdater.prototype._onEntityPropertyChanged.call(\n this,\n entity,\n propertyName,\n newValue,\n oldValue\n );\n if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n return;\n }\n\n const geometry = this._entity[this._geometryPropertyName];\n if (!defined(geometry)) {\n return;\n }\n\n if (defined(this._terrainOffsetProperty)) {\n this._terrainOffsetProperty.destroy();\n this._terrainOffsetProperty = undefined;\n }\n\n const heightReferenceProperty = geometry.heightReference;\n\n if (defined(heightReferenceProperty)) {\n const centerPosition = new CallbackProperty(\n this._computeCenter.bind(this),\n !this._dynamic\n );\n this._terrainOffsetProperty = new TerrainOffsetProperty(\n this._scene,\n centerPosition,\n heightReferenceProperty\n );\n }\n}\nexport default heightReferenceOnEntityPropertyChanged;\n", "import BoxGeometry from \"../Core/BoxGeometry.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport Property from \"./Property.js\";\n\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction BoxGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.dimensions = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for boxes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias BoxGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction BoxGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new BoxGeometryOptions(entity),\n geometryPropertyName: \"box\",\n observedPropertyNames: [\"availability\", \"position\", \"orientation\", \"box\"],\n });\n\n this._onEntityPropertyChanged(entity, \"box\", entity.box, undefined);\n}\n\nif (defined(Object.create)) {\n BoxGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n BoxGeometryUpdater.prototype.constructor = BoxGeometryUpdater;\n}\n\nObject.defineProperties(BoxGeometryUpdater.prototype, {\n /**\n * Gets the terrain offset property\n * @type {TerrainOffsetProperty}\n * @memberof BoxGeometryUpdater.prototype\n * @readonly\n * @private\n */\n terrainOffsetProperty: {\n get: function () {\n return this._terrainOffsetProperty;\n },\n },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nBoxGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n\n const attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: undefined,\n offset: undefined,\n };\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: BoxGeometry.fromDimensions(this._options),\n modelMatrix: entity.computeModelMatrixForHeightReference(\n time,\n entity.box.heightReference,\n this._options.dimensions.z * 0.5,\n this._scene.mapProjection.ellipsoid\n ),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nBoxGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: BoxOutlineGeometry.fromDimensions(this._options),\n modelMatrix: entity.computeModelMatrixForHeightReference(\n time,\n entity.box.heightReference,\n this._options.dimensions.z * 0.5,\n this._scene.mapProjection.ellipsoid\n ),\n attributes: attributes,\n });\n};\n\nBoxGeometryUpdater.prototype._computeCenter = function (time, result) {\n return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nBoxGeometryUpdater.prototype._isHidden = function (entity, box) {\n return (\n !defined(box.dimensions) ||\n !defined(entity.position) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, box)\n );\n};\n\nBoxGeometryUpdater.prototype._isDynamic = function (entity, box) {\n return (\n !entity.position.isConstant ||\n !Property.isConstant(entity.orientation) ||\n !box.dimensions.isConstant ||\n !Property.isConstant(box.outlineWidth)\n );\n};\n\nBoxGeometryUpdater.prototype._setStaticOptions = function (entity, box) {\n const heightReference = Property.getValueOrDefault(\n box.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n\n const options = this._options;\n options.vertexFormat =\n this._materialProperty instanceof ColorMaterialProperty\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.dimensions = box.dimensions.getValue(\n Iso8601.MINIMUM_VALUE,\n options.dimensions\n );\n options.offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n};\n\nBoxGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nBoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicBoxGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicBoxGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicBoxGeometryUpdater.prototype.constructor = DynamicBoxGeometryUpdater;\n}\n\nDynamicBoxGeometryUpdater.prototype._isHidden = function (entity, box, time) {\n const position = Property.getValueOrUndefined(\n entity.position,\n time,\n positionScratch\n );\n const dimensions = this._options.dimensions;\n return (\n !defined(position) ||\n !defined(dimensions) ||\n DynamicGeometryUpdater.prototype._isHidden.call(this, entity, box, time)\n );\n};\n\nDynamicBoxGeometryUpdater.prototype._setOptions = function (entity, box, time) {\n const heightReference = Property.getValueOrDefault(\n box.heightReference,\n time,\n HeightReference.NONE\n );\n const options = this._options;\n options.dimensions = Property.getValueOrUndefined(\n box.dimensions,\n time,\n options.dimensions\n );\n options.offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n};\nexport default BoxGeometryUpdater;\n", "import DOMPurify from \"dompurify\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\nlet nextCreditId = 0;\nconst creditToId = {};\n\n/**\n * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.\n * @param {String} html An string representing an html code snippet\n * @param {Boolean} [showOnScreen=false] If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover\n *\n * @alias Credit\n * @constructor\n *\n * @exception {DeveloperError} html is required.\n *\n * @example\n * //Create a credit with a tooltip, image and link\n * const credit = new Cesium.Credit('<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"/images/cesium_logo.png\" title=\"Cesium\"/></a>');\n */\nfunction Credit(html, showOnScreen) {\nlet id;\n const key = html;\n\n if (defined(creditToId[key])) {\n id = creditToId[key];\n } else {\n id = nextCreditId++;\n creditToId[key] = id;\n }\n\n showOnScreen = defaultValue(showOnScreen, false);\n\n // Credits are immutable so generate an id to use to optimize equal()\n this._id = id;\n this._html = html;\n this._showOnScreen = showOnScreen;\n this._element = undefined;\n}\n\nObject.defineProperties(Credit.prototype, {\n /**\n * The credit content\n * @memberof Credit.prototype\n * @type {String}\n * @readonly\n */\n html: {\n get: function () {\n return this._html;\n },\n },\n\n /**\n * @memberof Credit.prototype\n * @type {Number}\n * @readonly\n *\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * Whether the credit should be displayed on screen or in a lightbox\n * @memberof Credit.prototype\n * @type {Boolean}\n */\n showOnScreen: {\n get: function () {\n return this._showOnScreen;\n },\n set: function (value) {\n this._showOnScreen = value;\n },\n },\n\n /**\n * Gets the credit element\n * @memberof Credit.prototype\n * @type {HTMLElement}\n * @readonly\n */\n element: {\n get: function () {\n if (!defined(this._element)) {\n const html = DOMPurify.sanitize(this._html);\n\n const div = document.createElement(\"div\");\n div._creditId = this._id;\n div.style.display = \"inline\";\n div.innerHTML = html;\n\n const links = div.querySelectorAll(\"a\");\n for (let i = 0; i < links.length; i++) {\n links[i].setAttribute(\"target\", \"_blank\");\n }\n\n this._element = div;\n }\n return this._element;\n },\n },\n});\n\n/**\n * Returns true if the credits are equal\n *\n * @param {Credit} left The first credit\n * @param {Credit} right The second credit\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCredit.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left._id === right._id &&\n left._showOnScreen === right._showOnScreen)\n );\n};\n\n/**\n * Returns true if the credits are equal\n *\n * @param {Credit} credit The credit to compare to.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCredit.prototype.equals = function (credit) {\n return Credit.equals(this, credit);\n};\n\n/**\n * @private\n * @param attribution\n * @return {Credit}\n */\nCredit.getIonCredit = function (attribution) {\n const showOnScreen =\n defined(attribution.collapsible) && !attribution.collapsible;\n const credit = new Credit(attribution.html, showOnScreen);\n\n credit._isIon = credit.html.indexOf(\"ion-credit.png\") !== -1;\n return credit;\n};\n\n/**\n * Duplicates a Credit instance.\n *\n * @param {Credit} [credit] The Credit to duplicate.\n * @returns {Credit} A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)\n */\nCredit.clone = function (credit) {\n if (defined(credit)) {\n return new Credit(credit.html, credit.showOnScreen);\n }\n};\nexport default Credit;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport oneTimeWarning from \"./oneTimeWarning.js\";\n\n/**\n * Logs a deprecation message to the console. Use this function instead of\n * <code>console.log</code> directly since this does not log duplicate messages\n * unless it is called from multiple workers.\n *\n * @function deprecationWarning\n *\n * @param {String} identifier The unique identifier for this deprecated API.\n * @param {String} message The message to log to the console.\n *\n * @example\n * // Deprecated function or class\n * function Foo() {\n * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.');\n * // ...\n * }\n *\n * // Deprecated function\n * Bar.prototype.func = function() {\n * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.');\n * // ...\n * };\n *\n * // Deprecated property\n * Object.defineProperties(Bar.prototype, {\n * prop : {\n * get : function() {\n * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.');\n * // ...\n * },\n * set : function(value) {\n * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.');\n * // ...\n * }\n * }\n * });\n *\n * @private\n */\nfunction deprecationWarning(identifier, message) {\n oneTimeWarning(identifier, message);\n}\nexport default deprecationWarning;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport Pass from \"./Pass.js\";\n\n/**\n * Represents a command to the renderer for GPU Compute (using old-school GPGPU).\n *\n * @private\n * @constructor\n */\nfunction ComputeCommand(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The vertex array. If none is provided, a viewport quad will be used.\n *\n * @type {VertexArray}\n * @default undefined\n */\n this.vertexArray = options.vertexArray;\n\n /**\n * The fragment shader source. The default vertex shader is ViewportQuadVS.\n *\n * @type {ShaderSource}\n * @default undefined\n */\n this.fragmentShaderSource = options.fragmentShaderSource;\n\n /**\n * The shader program to apply.\n *\n * @type {ShaderProgram}\n * @default undefined\n */\n this.shaderProgram = options.shaderProgram;\n\n /**\n * An object with functions whose names match the uniforms in the shader program\n * and return values to set those uniforms.\n *\n * @type {Object}\n * @default undefined\n */\n this.uniformMap = options.uniformMap;\n\n /**\n * Texture to use for offscreen rendering.\n *\n * @type {Texture}\n * @default undefined\n */\n this.outputTexture = options.outputTexture;\n\n /**\n * Function that is called immediately before the ComputeCommand is executed. Used to\n * update any renderer resources. Takes the ComputeCommand as its single argument.\n *\n * @type {Function}\n * @default undefined\n */\n this.preExecute = options.preExecute;\n\n /**\n * Function that is called after the ComputeCommand is executed. Takes the output\n * texture as its single argument.\n *\n * @type {Function}\n * @default undefined\n */\n this.postExecute = options.postExecute;\n\n /**\n * Function that is called when the command is canceled\n *\n * @type {Function}\n * @default undefined\n */\n this.canceled = options.canceled;\n\n /**\n * Whether the renderer resources will persist beyond this call. If not, they\n * will be destroyed after completion.\n *\n * @type {Boolean}\n * @default false\n */\n this.persists = defaultValue(options.persists, false);\n\n /**\n * The pass when to render. Always compute pass.\n *\n * @type {Pass}\n * @default Pass.COMPUTE;\n */\n this.pass = Pass.COMPUTE;\n\n /**\n * The object who created this command. This is useful for debugging command\n * execution; it allows us to see who created a command when we only have a\n * reference to the command, and can be used to selectively execute commands\n * with {@link Scene#debugCommandFilter}.\n *\n * @type {Object}\n * @default undefined\n *\n * @see Scene#debugCommandFilter\n */\n this.owner = options.owner;\n}\n\n/**\n * Executes the compute command.\n *\n * @param {ComputeEngine} computeEngine The context that processes the compute command.\n */\nComputeCommand.prototype.execute = function (computeEngine) {\n computeEngine.execute(this);\n};\nexport default ComputeCommand;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec2 v_textureCoordinates;\\n\\\nuniform float originalSize;\\n\\\nuniform sampler2D texture0;\\n\\\nuniform sampler2D texture1;\\n\\\nuniform sampler2D texture2;\\n\\\nuniform sampler2D texture3;\\n\\\nuniform sampler2D texture4;\\n\\\nuniform sampler2D texture5;\\n\\\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\\n\\\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\\n\\\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\\n\\\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\\n\\\nvoid main()\\n\\\n{\\n\\\nvec2 uv = v_textureCoordinates;\\n\\\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\\n\\\nvec2 pixel = 1.0 / textureSize;\\n\\\nfloat mipLevel = 0.0;\\n\\\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\\n\\\n{\\n\\\nmipLevel = 1.0;\\n\\\nif (uv.y - pixel.y > yMipLevel1)\\n\\\n{\\n\\\nmipLevel = 2.0;\\n\\\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\\n\\\n{\\n\\\nmipLevel = 3.0;\\n\\\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\\n\\\n{\\n\\\nmipLevel = 4.0;\\n\\\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\\n\\\n{\\n\\\nmipLevel = 5.0;\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\nif (mipLevel > 0.0)\\n\\\n{\\n\\\nfloat scale = pow(2.0, mipLevel);\\n\\\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\\n\\\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\\n\\\nuv.x -= 1.0 + pixel.x;\\n\\\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\\n\\\nuv *= scale;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nuv.x *= (textureSize.x / textureSize.y);\\n\\\n}\\n\\\nif(mipLevel == 0.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture0, uv);\\n\\\n}\\n\\\nelse if(mipLevel == 1.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture1, uv);\\n\\\n}\\n\\\nelse if(mipLevel == 2.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture2, uv);\\n\\\n}\\n\\\nelse if(mipLevel == 3.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture3, uv);\\n\\\n}\\n\\\nelse if(mipLevel == 4.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture4, uv);\\n\\\n}\\n\\\nelse if(mipLevel == 5.0)\\n\\\n{\\n\\\ngl_FragColor = texture2D(texture5, uv);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\ngl_FragColor = vec4(0.0);\\n\\\n}\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_cubeMapCoordinates;\\n\\\nuniform samplerCube cubeMap;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);\\n\\\n#ifdef RGBA_NORMALIZED\\n\\\ngl_FragColor = vec4(rgba.rgb, 1.0);\\n\\\n#else\\n\\\nfloat m = rgba.a * 16.0;\\n\\\nvec3 r = rgba.rgb * m;\\n\\\ngl_FragColor = vec4(r * r, 1.0);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 position;\\n\\\nattribute vec3 cubeMapCoordinates;\\n\\\nvarying vec3 v_cubeMapCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_Position = position;\\n\\\nv_cubeMapCoordinates = cubeMapCoordinates;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport OctahedralProjectionAtlasFS from \"../Shaders/OctahedralProjectionAtlasFS.js\";\nimport OctahedralProjectionFS from \"../Shaders/OctahedralProjectionFS.js\";\nimport OctahedralProjectionVS from \"../Shaders/OctahedralProjectionVS.js\";\n\n/**\n * Packs all mip levels of a cube map into a 2D texture atlas.\n *\n * Octahedral projection is a way of putting the cube maps onto a 2D texture\n * with minimal distortion and easy look up.\n * See Chapter 16 of WebGL Insights \"HDR Image-Based Lighting on the Web\" by Jeff Russell\n * and \"Octahedron Environment Maps\" for reference.\n *\n * @private\n */\nfunction OctahedralProjectedCubeMap(url) {\n this._url = url;\n\n this._cubeMapBuffers = undefined;\n this._cubeMaps = undefined;\n this._texture = undefined;\n this._mipTextures = undefined;\n this._va = undefined;\n this._sp = undefined;\n\n this._maximumMipmapLevel = undefined;\n\n this._loading = false;\n this._ready = false;\n\n const cubeMap = this;\n this._readyPromise = new Promise((resolve, reject) => {\n cubeMap._completeLoadFromCache = (cachedTexture) => {\n cleanupResources(this);\n this._texture = cachedTexture;\n this._maximumMipmapLevel = this._texture.maximumMipmapLevel;\n this._ready = true;\n resolve();\n return;\n };\n\n cubeMap._failLoad = (error) => {\n reject(error);\n };\n\n cubeMap._completeLoad = () => {\n this._ready = true;\n resolve();\n };\n });\n}\n\nObject.defineProperties(OctahedralProjectedCubeMap.prototype, {\n /**\n * The url to the KTX2 file containing the specular environment map and convoluted mipmaps.\n * @memberof OctahedralProjectedCubeMap.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._url;\n },\n },\n /**\n * A texture containing all the packed convolutions.\n * @memberof OctahedralProjectedCubeMap.prototype\n * @type {Texture}\n * @readonly\n */\n texture: {\n get: function () {\n return this._texture;\n },\n },\n /**\n * The maximum number of mip levels.\n * @memberOf OctahedralProjectedCubeMap.prototype\n * @type {Number}\n * @readonly\n */\n maximumMipmapLevel: {\n get: function () {\n return this._maximumMipmapLevel;\n },\n },\n /**\n * Determines if the texture atlas is complete and ready to use.\n * @memberof OctahedralProjectedCubeMap.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n /**\n * Gets a promise that resolves when the texture atlas is ready to use.\n * @memberof OctahedralProjectedCubeMap.prototype\n * @type {Promise<void>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nOctahedralProjectedCubeMap.isSupported = function (context) {\n return (\n (context.colorBufferHalfFloat && context.halfFloatingPointTexture) ||\n (context.floatingPointTexture && context.colorBufferFloat)\n );\n};\n\n// These vertices are based on figure 1 from \"Octahedron Environment Maps\".\nconst v1 = new Cartesian3(1.0, 0.0, 0.0);\nconst v2 = new Cartesian3(0.0, 0.0, 1.0);\nconst v3 = new Cartesian3(-1.0, 0.0, 0.0);\nconst v4 = new Cartesian3(0.0, 0.0, -1.0);\nconst v5 = new Cartesian3(0.0, 1.0, 0.0);\nconst v6 = new Cartesian3(0.0, -1.0, 0.0);\n\n// top left, left, top, center, right, top right, bottom, bottom left, bottom right\nconst cubeMapCoordinates = [v5, v3, v2, v6, v1, v5, v4, v5, v5];\nconst length = cubeMapCoordinates.length;\nconst flatCubeMapCoordinates = new Float32Array(length * 3);\n\nlet offset = 0;\nfor (let i = 0; i < length; ++i, offset += 3) {\n Cartesian3.pack(cubeMapCoordinates[i], flatCubeMapCoordinates, offset);\n}\n\nconst flatPositions = new Float32Array([\n -1.0,\n 1.0, // top left\n -1.0,\n 0.0, // left\n 0.0,\n 1.0, // top\n 0.0,\n 0.0, // center\n 1.0,\n 0.0, // right\n 1.0,\n 1.0, // top right\n 0.0,\n -1.0, // bottom\n -1.0,\n -1.0, // bottom left\n 1.0,\n -1.0, // bottom right\n]);\nconst indices = new Uint16Array([\n 0,\n 1,\n 2, // top left, left, top,\n 2,\n 3,\n 1, // top, center, left,\n 7,\n 6,\n 1, // bottom left, bottom, left,\n 3,\n 6,\n 1, // center, bottom, left,\n 2,\n 5,\n 4, // top, top right, right,\n 3,\n 4,\n 2, // center, right, top,\n 4,\n 8,\n 6, // right, bottom right, bottom,\n 3,\n 4,\n 6, //center, right, bottom\n]);\n\nfunction createVertexArray(context) {\n const positionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: flatPositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const cubeMapCoordinatesBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: flatCubeMapCoordinates,\n usage: BufferUsage.STATIC_DRAW,\n });\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n const attributes = [\n {\n index: 0,\n vertexBuffer: positionBuffer,\n componentsPerAttribute: 2,\n componentDatatype: ComponentDatatype.FLOAT,\n },\n {\n index: 1,\n vertexBuffer: cubeMapCoordinatesBuffer,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n },\n ];\n return new VertexArray({\n context: context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n });\n}\n\nfunction createUniformTexture(texture) {\n return function () {\n return texture;\n };\n}\n\nfunction cleanupResources(map) {\n map._va = map._va && map._va.destroy();\n map._sp = map._sp && map._sp.destroy();\n\n let i;\n let length;\n\n const cubeMaps = map._cubeMaps;\n if (defined(cubeMaps)) {\n length = cubeMaps.length;\n for (i = 0; i < length; ++i) {\n cubeMaps[i].destroy();\n }\n }\n const mipTextures = map._mipTextures;\n if (defined(mipTextures)) {\n length = mipTextures.length;\n for (i = 0; i < length; ++i) {\n mipTextures[i].destroy();\n }\n }\n\n map._va = undefined;\n map._sp = undefined;\n map._cubeMaps = undefined;\n map._cubeMapBuffers = undefined;\n map._mipTextures = undefined;\n}\n\n/**\n * Creates compute commands to generate octahedral projections of each cube map\n * and then renders them to an atlas.\n * <p>\n * Only needs to be called twice. The first call queues the compute commands to generate the atlas.\n * The second call cleans up unused resources. Every call afterwards is a no-op.\n * </p>\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nOctahedralProjectedCubeMap.prototype.update = function (frameState) {\n const context = frameState.context;\n\n if (!OctahedralProjectedCubeMap.isSupported(context)) {\n return;\n }\n\n if (defined(this._texture) && defined(this._va)) {\n cleanupResources(this);\n }\n if (defined(this._texture)) {\n return;\n }\n\n if (!defined(this._texture) && !this._loading) {\n const cachedTexture = frameState.context.textureCache.getTexture(this._url);\n if (defined(cachedTexture)) {\n this._completeLoadFromCache(cachedTexture);\n }\n }\n\n const cubeMapBuffers = this._cubeMapBuffers;\n if (!defined(cubeMapBuffers) && !this._loading) {\n const that = this;\n loadKTX2(this._url)\n .then(function (buffers) {\n that._cubeMapBuffers = buffers;\n that._loading = false;\n })\n .catch(function (e) {\n that._failLoad(e);\n });\n this._loading = true;\n }\n\n if (!defined(this._cubeMapBuffers)) {\n return;\n }\n\n const defines = [];\n // Datatype is defined if it is a normalized type (i.e. ..._UNORM, ..._SFLOAT)\n let pixelDatatype = cubeMapBuffers[0].positiveX.pixelDatatype;\n if (!defined(pixelDatatype)) {\n pixelDatatype = context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT;\n } else {\n defines.push(\"RGBA_NORMALIZED\");\n }\n const pixelFormat = PixelFormat.RGBA;\n\n const fs = new ShaderSource({\n defines: defines,\n sources: [OctahedralProjectionFS],\n });\n\n this._va = createVertexArray(context);\n this._sp = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: OctahedralProjectionVS,\n fragmentShaderSource: fs,\n attributeLocations: {\n position: 0,\n cubeMapCoordinates: 1,\n },\n });\n\n // We only need up to 6 mip levels to avoid artifacts.\n const length = Math.min(cubeMapBuffers.length, 6);\n this._maximumMipmapLevel = length - 1;\n const cubeMaps = (this._cubeMaps = new Array(length));\n const mipTextures = (this._mipTextures = new Array(length));\n const originalSize = cubeMapBuffers[0].positiveX.width * 2.0;\n const uniformMap = {\n originalSize: function () {\n return originalSize;\n },\n };\n\n // First we project each cubemap onto a flat octahedron, and write that to a texture.\n for (let i = 0; i < length; ++i) {\n // Swap +Y/-Y faces since the octahedral projection expects this order.\n const positiveY = cubeMapBuffers[i].positiveY;\n cubeMapBuffers[i].positiveY = cubeMapBuffers[i].negativeY;\n cubeMapBuffers[i].negativeY = positiveY;\n\n const cubeMap = (cubeMaps[i] = new CubeMap({\n context: context,\n source: cubeMapBuffers[i],\n pixelDatatype: pixelDatatype,\n }));\n const size = cubeMaps[i].width * 2;\n\n const mipTexture = (mipTextures[i] = new Texture({\n context: context,\n width: size,\n height: size,\n pixelDatatype: pixelDatatype,\n pixelFormat: pixelFormat,\n }));\n\n const command = new ComputeCommand({\n vertexArray: this._va,\n shaderProgram: this._sp,\n uniformMap: {\n cubeMap: createUniformTexture(cubeMap),\n },\n outputTexture: mipTexture,\n persists: true,\n owner: this,\n });\n frameState.commandList.push(command);\n\n uniformMap[`texture${i}`] = createUniformTexture(mipTexture);\n }\n\n this._texture = new Texture({\n context: context,\n width: originalSize * 1.5 + 2.0, // We add a 1 pixel border to avoid linear sampling artifacts.\n height: originalSize,\n pixelDatatype: pixelDatatype,\n pixelFormat: pixelFormat,\n });\n\n this._texture.maximumMipmapLevel = this._maximumMipmapLevel;\n context.textureCache.addTexture(this._url, this._texture);\n\n const atlasCommand = new ComputeCommand({\n fragmentShaderSource: OctahedralProjectionAtlasFS,\n uniformMap: uniformMap,\n outputTexture: this._texture,\n persists: false,\n owner: this,\n });\n frameState.commandList.push(atlasCommand);\n\n this._completeLoad();\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see OctahedralProjectedCubeMap#destroy\n */\nOctahedralProjectedCubeMap.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see OctahedralProjectedCubeMap#isDestroyed\n */\nOctahedralProjectedCubeMap.prototype.destroy = function () {\n cleanupResources(this);\n this._texture = this._texture && this._texture.destroy();\n return destroyObject(this);\n};\nexport default OctahedralProjectedCubeMap;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport OctahedralProjectedCubeMap from \"./OctahedralProjectedCubeMap.js\";\n\n/**\n * Properties for managing image-based lighting on tilesets and models.\n * Also manages the necessary resources and textures.\n * <p>\n * If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called\n * when the image-based lighting is no longer needed to clean up GPU resources properly.\n * If a model or tileset creates an instance of ImageBasedLighting, it will handle this.\n * Otherwise, the application is responsible for calling destroy().\n *</p>\n *\n * @alias ImageBasedLighting\n * @constructor\n *\n * @param {Cartesian2} [options.imageBasedLightingFactor=Cartesian2(1.0, 1.0)] Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.\n * @param {Number} [options.luminanceAtZenith=0.2] The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.\n * @param {Cartesian3[]} [options.sphericalHarmonicCoefficients] The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.\n * @param {String} [options.specularEnvironmentMaps] A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.\n */\nfunction ImageBasedLighting(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const imageBasedLightingFactor = defined(options.imageBasedLightingFactor)\n ? Cartesian2.clone(options.imageBasedLightingFactor)\n : new Cartesian2(1.0, 1.0);\n\n this._imageBasedLightingFactor = imageBasedLightingFactor;\n\n const luminanceAtZenith = defaultValue(options.luminanceAtZenith, 0.2);\n\n this._luminanceAtZenith = luminanceAtZenith;\n\n const sphericalHarmonicCoefficients = options.sphericalHarmonicCoefficients;\n\nthis._sphericalHarmonicCoefficients = sphericalHarmonicCoefficients;\n\n // The specular environment map texture is created in update();\n this._specularEnvironmentMaps = options.specularEnvironmentMaps;\n this._specularEnvironmentMapAtlas = undefined;\n this._specularEnvironmentMapAtlasDirty = true;\n this._specularEnvironmentMapLoaded = false;\n this._previousSpecularEnvironmentMapLoaded = false;\n\n this._useDefaultSpecularMaps = false;\n this._useDefaultSphericalHarmonics = false;\n this._shouldRegenerateShaders = false;\n\n // Store the previous frame number to prevent redundant update calls\n this._previousFrameNumber = undefined;\n\n // Keeps track of the last values for use during update logic\n this._previousImageBasedLightingFactor = Cartesian2.clone(\n imageBasedLightingFactor\n );\n this._previousLuminanceAtZenith = luminanceAtZenith;\n this._previousSphericalHarmonicCoefficients = sphericalHarmonicCoefficients;\n}\n\nObject.defineProperties(ImageBasedLighting.prototype, {\n /**\n * Cesium adds lighting from the earth, sky, atmosphere, and star skybox.\n * This cartesian is used to scale the final diffuse and specular lighting\n * contribution from those sources to the final color. A value of 0.0 will\n * disable those light sources.\n *\n * @memberof ImageBasedLighting.prototype\n *\n * @type {Cartesian2}\n * @default Cartesian2(1.0, 1.0)\n */\n imageBasedLightingFactor: {\n get: function () {\n return this._imageBasedLightingFactor;\n },\n set: function (value) {\nthis._previousImageBasedLightingFactor = Cartesian2.clone(\n this._imageBasedLightingFactor,\n this._previousImageBasedLightingFactor\n );\n this._imageBasedLightingFactor = Cartesian2.clone(\n value,\n this._imageBasedLightingFactor\n );\n },\n },\n\n /**\n * The sun's luminance at the zenith in kilo candela per meter squared\n * to use for this model's procedural environment map. This is used when\n * {@link ImageBasedLighting#specularEnvironmentMaps} and {@link ImageBasedLighting#sphericalHarmonicCoefficients}\n * are not defined.\n *\n * @memberof ImageBasedLighting.prototype\n *\n * @type {Number}\n * @default 0.2\n */\n luminanceAtZenith: {\n get: function () {\n return this._luminanceAtZenith;\n },\n set: function (value) {\n this._previousLuminanceAtZenith = this._luminanceAtZenith;\n this._luminanceAtZenith = value;\n },\n },\n\n /**\n * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance\n * computed from the atmosphere color is used.\n * <p>\n * There are nine <code>Cartesian3</code> coefficients.\n * The order of the coefficients is: L<sub>0,0</sub>, L<sub>1,-1</sub>, L<sub>1,0</sub>, L<sub>1,1</sub>, L<sub>2,-2</sub>, L<sub>2,-1</sub>, L<sub>2,0</sub>, L<sub>2,1</sub>, L<sub>2,2</sub>\n * </p>\n *\n * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of\n * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be\n * supplied to {@link Model#specularEnvironmentMaps}.\n *\n * @memberof ImageBasedLighting.prototype\n *\n * @type {Cartesian3[]}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo}\n * @see {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf|An Efficient Representation for Irradiance Environment Maps}\n */\n sphericalHarmonicCoefficients: {\n get: function () {\n return this._sphericalHarmonicCoefficients;\n },\n set: function (value) {\nthis._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;\n this._sphericalHarmonicCoefficients = value;\n },\n },\n\n /**\n * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.\n *\n * @memberof ImageBasedLighting.prototype\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Image-Based Lighting.html|Sandcastle Image Based Lighting Demo}\n * @type {String}\n * @see ImageBasedLighting#sphericalHarmonicCoefficients\n */\n specularEnvironmentMaps: {\n get: function () {\n return this._specularEnvironmentMaps;\n },\n set: function (value) {\n if (value !== this._specularEnvironmentMaps) {\n this._specularEnvironmentMapAtlasDirty =\n this._specularEnvironmentMapAtlasDirty ||\n value !== this._specularEnvironmentMaps;\n this._specularEnvironmentMapLoaded = false;\n }\n this._specularEnvironmentMaps = value;\n },\n },\n\n /**\n * Whether or not image-based lighting is enabled.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n enabled: {\n get: function () {\n return (\n this._imageBasedLightingFactor.x > 0.0 ||\n this._imageBasedLightingFactor.y > 0.0\n );\n },\n },\n\n /**\n * Whether or not the models that use this lighting should regenerate their shaders,\n * based on the properties and resources have changed.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n shouldRegenerateShaders: {\n get: function () {\n return this._shouldRegenerateShaders;\n },\n },\n\n /**\n * Whether or not to use the default spherical harmonic coefficients.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n useDefaultSphericalHarmonics: {\n get: function () {\n return this._useDefaultSphericalHarmonics;\n },\n },\n\n /**\n * Whether or not the image-based lighting settings use spherical harmonic coefficients.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n useSphericalHarmonicCoefficients: {\n get: function () {\n return (\n defined(this._sphericalHarmonicCoefficients) ||\n this._useDefaultSphericalHarmonics\n );\n },\n },\n\n /**\n * The texture atlas for the specular environment maps.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {OctahedralProjectedCubeMap}\n *\n * @private\n */\n specularEnvironmentMapAtlas: {\n get: function () {\n return this._specularEnvironmentMapAtlas;\n },\n },\n\n /**\n * Whether or not to use the default specular environment maps.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n useDefaultSpecularMaps: {\n get: function () {\n return this._useDefaultSpecularMaps;\n },\n },\n\n /**\n * Whether or not the image-based lighting settings use specular environment maps.\n *\n * @memberof ImageBasedLighting.prototype\n * @type {Boolean}\n *\n * @private\n */\n useSpecularEnvironmentMaps: {\n get: function () {\n return (\n (defined(this._specularEnvironmentMapAtlas) &&\n this._specularEnvironmentMapAtlas.ready) ||\n this._useDefaultSpecularMaps\n );\n },\n },\n});\n\nfunction createSpecularEnvironmentMapAtlas(imageBasedLighting, context) {\n if (!OctahedralProjectedCubeMap.isSupported(context)) {\n return;\n }\n\n imageBasedLighting._specularEnvironmentMapAtlas =\n imageBasedLighting._specularEnvironmentMapAtlas &&\n imageBasedLighting._specularEnvironmentMapAtlas.destroy();\n\n if (defined(imageBasedLighting._specularEnvironmentMaps)) {\n const atlas = new OctahedralProjectedCubeMap(\n imageBasedLighting._specularEnvironmentMaps\n );\n imageBasedLighting._specularEnvironmentMapAtlas = atlas;\n\n atlas.readyPromise\n .then(function () {\n imageBasedLighting._specularEnvironmentMapLoaded = true;\n })\n .catch(function (error) {\n console.error(`Error loading specularEnvironmentMaps: ${error}`);\n });\n }\n\n // Regenerate shaders so they do not use an environment map.\n // Will be set to true again if there was a new environment map and it is ready.\n imageBasedLighting._shouldRegenerateShaders = true;\n}\n\nImageBasedLighting.prototype.update = function (frameState) {\n if (frameState.frameNumber === this._previousFrameNumber) {\n return;\n }\n\n this._previousFrameNumber = frameState.frameNumber;\n const context = frameState.context;\n\n frameState.brdfLutGenerator.update(frameState);\n this._shouldRegenerateShaders = false;\n\n const iblFactor = this._imageBasedLightingFactor;\n const previousIBLFactor = this._previousImageBasedLightingFactor;\n if (!Cartesian2.equals(iblFactor, previousIBLFactor)) {\n this._shouldRegenerateShaders =\n (iblFactor.x > 0.0 && previousIBLFactor.x === 0.0) ||\n (iblFactor.x === 0.0 && previousIBLFactor.x > 0.0);\n this._shouldRegenerateShaders =\n this._shouldRegenerateShaders ||\n (iblFactor.y > 0.0 && previousIBLFactor.y === 0.0) ||\n (iblFactor.y === 0.0 && previousIBLFactor.y > 0.0);\n\n this._previousImageBasedLightingFactor = Cartesian2.clone(\n this._imageBasedLightingFactor,\n this._previousImageBasedLightingFactor\n );\n }\n\n if (this._luminanceAtZenith !== this._previousLuminanceAtZenith) {\n this._shouldRegenerateShaders =\n this._shouldRegenerateShaders ||\n defined(this._luminanceAtZenith) !==\n defined(this._previousLuminanceAtZenith);\n\n this._previousLuminanceAtZenith = this._luminanceAtZenith;\n }\n\n if (\n this._previousSphericalHarmonicCoefficients !==\n this._sphericalHarmonicCoefficients\n ) {\n this._shouldRegenerateShaders =\n this._shouldRegenerateShaders ||\n defined(this._previousSphericalHarmonicCoefficients) !==\n defined(this._sphericalHarmonicCoefficients);\n\n this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;\n }\n\n this._shouldRegenerateShaders =\n this._shouldRegenerateShaders ||\n this._previousSpecularEnvironmentMapLoaded !==\n this._specularEnvironmentMapLoaded;\n\n this._previousSpecularEnvironmentMapLoaded = this._specularEnvironmentMapLoaded;\n\n if (this._specularEnvironmentMapAtlasDirty) {\n createSpecularEnvironmentMapAtlas(this, context);\n this._specularEnvironmentMapAtlasDirty = false;\n }\n\n if (defined(this._specularEnvironmentMapAtlas)) {\n this._specularEnvironmentMapAtlas.update(frameState);\n }\n\n const recompileWithDefaultAtlas =\n !defined(this._specularEnvironmentMapAtlas) &&\n defined(frameState.specularEnvironmentMaps) &&\n !this._useDefaultSpecularMaps;\n const recompileWithoutDefaultAtlas =\n !defined(frameState.specularEnvironmentMaps) &&\n this._useDefaultSpecularMaps;\n\n const recompileWithDefaultSHCoeffs =\n !defined(this._sphericalHarmonicCoefficients) &&\n defined(frameState.sphericalHarmonicCoefficients) &&\n !this._useDefaultSphericalHarmonics;\n const recompileWithoutDefaultSHCoeffs =\n !defined(frameState.sphericalHarmonicCoefficients) &&\n this._useDefaultSphericalHarmonics;\n\n this._shouldRegenerateShaders =\n this._shouldRegenerateShaders ||\n recompileWithDefaultAtlas ||\n recompileWithoutDefaultAtlas ||\n recompileWithDefaultSHCoeffs ||\n recompileWithoutDefaultSHCoeffs;\n\n this._useDefaultSpecularMaps =\n !defined(this._specularEnvironmentMapAtlas) &&\n defined(frameState.specularEnvironmentMaps);\n this._useDefaultSphericalHarmonics =\n !defined(this._sphericalHarmonicCoefficients) &&\n defined(frameState.sphericalHarmonicCoefficients);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ImageBasedLighting#destroy\n * @private\n */\nImageBasedLighting.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * imageBasedLighting = imageBasedLighting && imageBasedLighting.destroy();\n *\n * @see ImageBasedLighting#isDestroyed\n * @private\n */\nImageBasedLighting.prototype.destroy = function () {\n this._specularEnvironmentMapAtlas =\n this._specularEnvironmentMapAtlas &&\n this._specularEnvironmentMapAtlas.destroy();\n return destroyObject(this);\n};\n\nexport default ImageBasedLighting;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\n\n/**\n * A wrapper around arrays so that the internal length of the array can be manually managed.\n *\n * @alias ManagedArray\n * @constructor\n * @private\n *\n * @param {Number} [length=0] The initial length of the array.\n */\nfunction ManagedArray(length) {\n length = defaultValue(length, 0);\n this._array = new Array(length);\n this._length = length;\n}\n\nObject.defineProperties(ManagedArray.prototype, {\n /**\n * Gets or sets the length of the array.\n * If the set length is greater than the length of the internal array, the internal array is resized.\n *\n * @memberof ManagedArray.prototype\n * @type Number\n */\n length: {\n get: function () {\n return this._length;\n },\n set: function (length) {\nconst array = this._array;\n const originalLength = this._length;\n if (length < originalLength) {\n // Remove trailing references\n for (let i = length; i < originalLength; ++i) {\n array[i] = undefined;\n }\n } else if (length > array.length) {\n array.length = length;\n }\n this._length = length;\n },\n },\n\n /**\n * Gets the internal array.\n *\n * @memberof ManagedArray.prototype\n * @type Array\n * @readonly\n */\n values: {\n get: function () {\n return this._array;\n },\n },\n});\n\n/**\n * Gets the element at an index.\n *\n * @param {Number} index The index to get.\n */\nManagedArray.prototype.get = function (index) {\n return this._array[index];\n};\n\n/**\n * Sets the element at an index. Resizes the array if index is greater than the length of the array.\n *\n * @param {Number} index The index to set.\n * @param {*} element The element to set at index.\n */\nManagedArray.prototype.set = function (index, element) {\n if (index >= this._length) {\n this.length = index + 1;\n }\n this._array[index] = element;\n};\n\n/**\n * Returns the last element in the array without modifying the array.\n *\n * @returns {*} The last element in the array.\n */\nManagedArray.prototype.peek = function () {\n return this._array[this._length - 1];\n};\n\n/**\n * Push an element into the array.\n *\n * @param {*} element The element to push.\n */\nManagedArray.prototype.push = function (element) {\n const index = this.length++;\n this._array[index] = element;\n};\n\n/**\n * Pop an element from the array.\n *\n * @returns {*} The last element in the array.\n */\nManagedArray.prototype.pop = function () {\n if (this._length === 0) {\n return undefined;\n }\n const element = this._array[this._length - 1];\n --this.length;\n return element;\n};\n\n/**\n * Resize the internal array if length > _array.length.\n *\n * @param {Number} length The length.\n */\nManagedArray.prototype.reserve = function (length) {\n if (length > this._array.length) {\n this._array.length = length;\n }\n};\n\n/**\n * Resize the array.\n *\n * @param {Number} length The length.\n */\nManagedArray.prototype.resize = function (length) {\n this.length = length;\n};\n\n/**\n * Trim the internal array to the specified length. Defaults to the current length.\n *\n * @param {Number} [length] The length.\n */\nManagedArray.prototype.trim = function (length) {\n length = defaultValue(length, this._length);\n this._array.length = length;\n};\nexport default ManagedArray;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Represents a command to the renderer for clearing a framebuffer.\n *\n * @private\n * @constructor\n */\nfunction ClearCommand(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The value to clear the color buffer to. When <code>undefined</code>, the color buffer is not cleared.\n *\n * @type {Color}\n *\n * @default undefined\n */\n this.color = options.color;\n\n /**\n * The value to clear the depth buffer to. When <code>undefined</code>, the depth buffer is not cleared.\n *\n * @type {Number}\n *\n * @default undefined\n */\n this.depth = options.depth;\n\n /**\n * The value to clear the stencil buffer to. When <code>undefined</code>, the stencil buffer is not cleared.\n *\n * @type {Number}\n *\n * @default undefined\n */\n this.stencil = options.stencil;\n\n /**\n * The render state to apply when executing the clear command. The following states affect clearing:\n * scissor test, color mask, depth mask, and stencil mask. When the render state is\n * <code>undefined</code>, the default render state is used.\n *\n * @type {RenderState}\n *\n * @default undefined\n */\n this.renderState = options.renderState;\n\n /**\n * The framebuffer to clear.\n *\n * @type {Framebuffer}\n *\n * @default undefined\n */\n this.framebuffer = options.framebuffer;\n\n /**\n * The object who created this command. This is useful for debugging command\n * execution; it allows you to see who created a command when you only have a\n * reference to the command, and can be used to selectively execute commands\n * with {@link Scene#debugCommandFilter}.\n *\n * @type {Object}\n *\n * @default undefined\n *\n * @see Scene#debugCommandFilter\n */\n this.owner = options.owner;\n\n /**\n * The pass in which to run this command.\n *\n * @type {Pass}\n *\n * @default undefined\n */\n this.pass = options.pass;\n}\n\n/**\n * Clears color to (0.0, 0.0, 0.0, 0.0); depth to 1.0; and stencil to 0.\n *\n * @type {ClearCommand}\n *\n * @constant\n */\nClearCommand.ALL = Object.freeze(\n new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n depth: 1.0,\n stencil: 0.0,\n })\n);\n\nClearCommand.prototype.execute = function (context, passState) {\n context.clear(this, passState);\n};\nexport default ClearCommand;\n", "import Check from \"../Core/Check.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum describing the x, y, and z axes and helper conversion functions.\n *\n * @enum {Number}\n */\nconst Axis = {\n /**\n * Denotes the x-axis.\n *\n * @type {Number}\n * @constant\n */\n X: 0,\n\n /**\n * Denotes the y-axis.\n *\n * @type {Number}\n * @constant\n */\n Y: 1,\n\n /**\n * Denotes the z-axis.\n *\n * @type {Number}\n * @constant\n */\n Z: 2,\n};\n\n/**\n * Matrix used to convert from y-up to z-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Y_UP_TO_Z_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from z-up to y-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Z_UP_TO_Y_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from x-up to z-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.X_UP_TO_Z_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from z-up to x-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Z_UP_TO_X_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from x-up to y-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.X_UP_TO_Y_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Matrix used to convert from y-up to x-up\n *\n * @type {Matrix4}\n * @constant\n */\nAxis.Y_UP_TO_X_UP = Matrix4.fromRotationTranslation(\n Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO)\n);\n\n/**\n * Gets the axis by name\n *\n * @param {String} name The name of the axis.\n * @returns {Number} The axis enum.\n */\nAxis.fromName = function (name) {\n return Axis[name];\n};\n\nexport default Object.freeze(Axis);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Intersect from \"./Intersect.js\";\nimport Plane from \"./Plane.js\";\n\n/**\n * The culling volume defined by planes.\n *\n * @alias CullingVolume\n * @constructor\n *\n * @param {Cartesian4[]} [planes] An array of clipping planes.\n */\nfunction CullingVolume(planes) {\n /**\n * Each plane is represented by a Cartesian4 object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin.\n * @type {Cartesian4[]}\n * @default []\n */\n this.planes = defaultValue(planes, []);\n}\n\nconst faces = [new Cartesian3(), new Cartesian3(), new Cartesian3()];\nCartesian3.clone(Cartesian3.UNIT_X, faces[0]);\nCartesian3.clone(Cartesian3.UNIT_Y, faces[1]);\nCartesian3.clone(Cartesian3.UNIT_Z, faces[2]);\n\nconst scratchPlaneCenter = new Cartesian3();\nconst scratchPlaneNormal = new Cartesian3();\nconst scratchPlane = new Plane(new Cartesian3(1.0, 0.0, 0.0), 0.0);\n\n/**\n * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.\n * The planes are aligned to the x, y, and z axes in world coordinates.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume.\n * @param {CullingVolume} [result] The object onto which to store the result.\n * @returns {CullingVolume} The culling volume created from the bounding sphere.\n */\nCullingVolume.fromBoundingSphere = function (boundingSphere, result) {\n if (!defined(result)) {\n result = new CullingVolume();\n }\n\n const length = faces.length;\n const planes = result.planes;\n planes.length = 2 * length;\n\n const center = boundingSphere.center;\n const radius = boundingSphere.radius;\n\n let planeIndex = 0;\n\n for (let i = 0; i < length; ++i) {\n const faceNormal = faces[i];\n\n let plane0 = planes[planeIndex];\n let plane1 = planes[planeIndex + 1];\n\n if (!defined(plane0)) {\n plane0 = planes[planeIndex] = new Cartesian4();\n }\n if (!defined(plane1)) {\n plane1 = planes[planeIndex + 1] = new Cartesian4();\n }\n\n Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);\n Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\n\n plane0.x = faceNormal.x;\n plane0.y = faceNormal.y;\n plane0.z = faceNormal.z;\n plane0.w = -Cartesian3.dot(faceNormal, scratchPlaneCenter);\n\n Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);\n Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\n\n plane1.x = -faceNormal.x;\n plane1.y = -faceNormal.y;\n plane1.z = -faceNormal.z;\n plane1.w = -Cartesian3.dot(\n Cartesian3.negate(faceNormal, scratchPlaneNormal),\n scratchPlaneCenter\n );\n\n planeIndex += 2;\n }\n\n return result;\n};\n\n/**\n * Determines whether a bounding volume intersects the culling volume.\n *\n * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\n * @returns {Intersect} Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.\n */\nCullingVolume.prototype.computeVisibility = function (boundingVolume) {\n const planes = this.planes;\n let intersecting = false;\n for (let k = 0, len = planes.length; k < len; ++k) {\n const result = boundingVolume.intersectPlane(\n Plane.fromCartesian4(planes[k], scratchPlane)\n );\n if (result === Intersect.OUTSIDE) {\n return Intersect.OUTSIDE;\n } else if (result === Intersect.INTERSECTING) {\n intersecting = true;\n }\n }\n\n return intersecting ? Intersect.INTERSECTING : Intersect.INSIDE;\n};\n\n/**\n * Determines whether a bounding volume intersects the culling volume.\n *\n * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\n * @param {Number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling\n * volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then\n * the parent (and therefore this) volume is completely inside plane[planeIndex]\n * and that plane check can be skipped.\n * @returns {Number} A plane mask as described above (which can be applied to this boundingVolume's children).\n *\n * @private\n */\nCullingVolume.prototype.computeVisibilityWithPlaneMask = function (\n boundingVolume,\n parentPlaneMask\n) {\n if (\n parentPlaneMask === CullingVolume.MASK_OUTSIDE ||\n parentPlaneMask === CullingVolume.MASK_INSIDE\n ) {\n // parent is completely outside or completely inside, so this child is as well.\n return parentPlaneMask;\n }\n\n // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.\n // (Because if there are fewer than 31 planes, the upper bits wont be changed.)\n let mask = CullingVolume.MASK_INSIDE;\n\n const planes = this.planes;\n for (let k = 0, len = planes.length; k < len; ++k) {\n // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.\n const flag = k < 31 ? 1 << k : 0;\n if (k < 31 && (parentPlaneMask & flag) === 0) {\n // boundingVolume is known to be INSIDE this plane.\n continue;\n }\n\n const result = boundingVolume.intersectPlane(\n Plane.fromCartesian4(planes[k], scratchPlane)\n );\n if (result === Intersect.OUTSIDE) {\n return CullingVolume.MASK_OUTSIDE;\n } else if (result === Intersect.INTERSECTING) {\n mask |= flag;\n }\n }\n\n return mask;\n};\n\n/**\n * For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value\n * represents the case where the object bounding volume is entirely outside the culling volume.\n *\n * @type {Number}\n * @private\n */\nCullingVolume.MASK_OUTSIDE = 0xffffffff;\n\n/**\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\n * represents the case where the object bounding volume is entirely inside the culling volume.\n *\n * @type {Number}\n * @private\n */\nCullingVolume.MASK_INSIDE = 0x00000000;\n\n/**\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\n * represents the case where the object bounding volume (may) intersect all planes of the culling volume.\n *\n * @type {Number}\n * @private\n */\nCullingVolume.MASK_INDETERMINATE = 0x7fffffff;\nexport default CullingVolume;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport CullingVolume from \"./CullingVolume.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias OrthographicOffCenterFrustum\n * @constructor\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Number} [options.left] The left clipping plane distance.\n * @param {Number} [options.right] The right clipping plane distance.\n * @param {Number} [options.top] The top clipping plane distance.\n * @param {Number} [options.bottom] The bottom clipping plane distance.\n * @param {Number} [options.near=1.0] The near clipping plane distance.\n * @param {Number} [options.far=500000000.0] The far clipping plane distance.\n *\n * @example\n * const maxRadii = ellipsoid.maximumRadius;\n *\n * const frustum = new Cesium.OrthographicOffCenterFrustum();\n * frustum.right = maxRadii * Cesium.Math.PI;\n * frustum.left = -c.frustum.right;\n * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);\n * frustum.bottom = -c.frustum.top;\n * frustum.near = 0.01 * maxRadii;\n * frustum.far = 50.0 * maxRadii;\n */\nfunction OrthographicOffCenterFrustum(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The left clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.left = options.left;\n this._left = undefined;\n\n /**\n * The right clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.right = options.right;\n this._right = undefined;\n\n /**\n * The top clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.top = options.top;\n this._top = undefined;\n\n /**\n * The bottom clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.bottom = options.bottom;\n this._bottom = undefined;\n\n /**\n * The distance of the near plane.\n * @type {Number}\n * @default 1.0\n */\n this.near = defaultValue(options.near, 1.0);\n this._near = this.near;\n\n /**\n * The distance of the far plane.\n * @type {Number}\n * @default 500000000.0;\n */\n this.far = defaultValue(options.far, 500000000.0);\n this._far = this.far;\n\n this._cullingVolume = new CullingVolume();\n this._orthographicMatrix = new Matrix4();\n}\n\nfunction update(frustum) {\n if (\n frustum.top !== frustum._top ||\n frustum.bottom !== frustum._bottom ||\n frustum.left !== frustum._left ||\n frustum.right !== frustum._right ||\n frustum.near !== frustum._near ||\n frustum.far !== frustum._far\n ) {\n frustum._left = frustum.left;\n frustum._right = frustum.right;\n frustum._top = frustum.top;\n frustum._bottom = frustum.bottom;\n frustum._near = frustum.near;\n frustum._far = frustum.far;\n frustum._orthographicMatrix = Matrix4.computeOrthographicOffCenter(\n frustum.left,\n frustum.right,\n frustum.bottom,\n frustum.top,\n frustum.near,\n frustum.far,\n frustum._orthographicMatrix\n );\n }\n}\n\nObject.defineProperties(OrthographicOffCenterFrustum.prototype, {\n /**\n * Gets the orthographic projection matrix computed from the view frustum.\n * @memberof OrthographicOffCenterFrustum.prototype\n * @type {Matrix4}\n * @readonly\n */\n projectionMatrix: {\n get: function () {\n update(this);\n return this._orthographicMatrix;\n },\n },\n});\n\nconst getPlanesRight = new Cartesian3();\nconst getPlanesNearCenter = new Cartesian3();\nconst getPlanesPoint = new Cartesian3();\nconst negateScratch = new Cartesian3();\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nOrthographicOffCenterFrustum.prototype.computeCullingVolume = function (\n position,\n direction,\n up\n) {\n const planes = this._cullingVolume.planes;\n const t = this.top;\n const b = this.bottom;\n const r = this.right;\n const l = this.left;\n const n = this.near;\n const f = this.far;\n\n const right = Cartesian3.cross(direction, up, getPlanesRight);\n Cartesian3.normalize(right, right);\n const nearCenter = getPlanesNearCenter;\n Cartesian3.multiplyByScalar(direction, n, nearCenter);\n Cartesian3.add(position, nearCenter, nearCenter);\n\n const point = getPlanesPoint;\n\n // Left plane\n Cartesian3.multiplyByScalar(right, l, point);\n Cartesian3.add(nearCenter, point, point);\n\n let plane = planes[0];\n if (!defined(plane)) {\n plane = planes[0] = new Cartesian4();\n }\n plane.x = right.x;\n plane.y = right.y;\n plane.z = right.z;\n plane.w = -Cartesian3.dot(right, point);\n\n // Right plane\n Cartesian3.multiplyByScalar(right, r, point);\n Cartesian3.add(nearCenter, point, point);\n\n plane = planes[1];\n if (!defined(plane)) {\n plane = planes[1] = new Cartesian4();\n }\n plane.x = -right.x;\n plane.y = -right.y;\n plane.z = -right.z;\n plane.w = -Cartesian3.dot(Cartesian3.negate(right, negateScratch), point);\n\n // Bottom plane\n Cartesian3.multiplyByScalar(up, b, point);\n Cartesian3.add(nearCenter, point, point);\n\n plane = planes[2];\n if (!defined(plane)) {\n plane = planes[2] = new Cartesian4();\n }\n plane.x = up.x;\n plane.y = up.y;\n plane.z = up.z;\n plane.w = -Cartesian3.dot(up, point);\n\n // Top plane\n Cartesian3.multiplyByScalar(up, t, point);\n Cartesian3.add(nearCenter, point, point);\n\n plane = planes[3];\n if (!defined(plane)) {\n plane = planes[3] = new Cartesian4();\n }\n plane.x = -up.x;\n plane.y = -up.y;\n plane.z = -up.z;\n plane.w = -Cartesian3.dot(Cartesian3.negate(up, negateScratch), point);\n\n // Near plane\n plane = planes[4];\n if (!defined(plane)) {\n plane = planes[4] = new Cartesian4();\n }\n plane.x = direction.x;\n plane.y = direction.y;\n plane.z = direction.z;\n plane.w = -Cartesian3.dot(direction, nearCenter);\n\n // Far plane\n Cartesian3.multiplyByScalar(direction, f, point);\n Cartesian3.add(position, point, point);\n\n plane = planes[5];\n if (!defined(plane)) {\n plane = planes[5] = new Cartesian4();\n }\n plane.x = -direction.x;\n plane.y = -direction.y;\n plane.z = -direction.z;\n plane.w = -Cartesian3.dot(Cartesian3.negate(direction, negateScratch), point);\n\n return this._cullingVolume;\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\n * @param {Number} distance The distance to the near plane in meters.\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\n */\nOrthographicOffCenterFrustum.prototype.getPixelDimensions = function (\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n) {\n update(this);\n\n const frustumWidth = this.right - this.left;\n const frustumHeight = this.top - this.bottom;\n const pixelWidth = (pixelRatio * frustumWidth) / drawingBufferWidth;\n const pixelHeight = (pixelRatio * frustumHeight) / drawingBufferHeight;\n\n result.x = pixelWidth;\n result.y = pixelHeight;\n return result;\n};\n\n/**\n * Returns a duplicate of a OrthographicOffCenterFrustum instance.\n *\n * @param {OrthographicOffCenterFrustum} [result] The object onto which to store the result.\n * @returns {OrthographicOffCenterFrustum} The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.\n */\nOrthographicOffCenterFrustum.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new OrthographicOffCenterFrustum();\n }\n\n result.left = this.left;\n result.right = this.right;\n result.top = this.top;\n result.bottom = this.bottom;\n result.near = this.near;\n result.far = this.far;\n\n // force update of clone to compute matrices\n result._left = undefined;\n result._right = undefined;\n result._top = undefined;\n result._bottom = undefined;\n result._near = undefined;\n result._far = undefined;\n\n return result;\n};\n\n/**\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrthographicOffCenterFrustum} [other] The right hand side OrthographicOffCenterFrustum.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrthographicOffCenterFrustum.prototype.equals = function (other) {\n return (\n defined(other) &&\n other instanceof OrthographicOffCenterFrustum &&\n this.right === other.right &&\n this.left === other.left &&\n this.top === other.top &&\n this.bottom === other.bottom &&\n this.near === other.near &&\n this.far === other.far\n );\n};\n\n/**\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {OrthographicOffCenterFrustum} other The right hand side OrthographicOffCenterFrustum.\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nOrthographicOffCenterFrustum.prototype.equalsEpsilon = function (\n other,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n other === this ||\n (defined(other) &&\n other instanceof OrthographicOffCenterFrustum &&\n CesiumMath.equalsEpsilon(\n this.right,\n other.right,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.left,\n other.left,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.top,\n other.top,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.bottom,\n other.bottom,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.near,\n other.near,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.far,\n other.far,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\nexport default OrthographicOffCenterFrustum;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrthographicOffCenterFrustum from \"./OrthographicOffCenterFrustum.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias OrthographicFrustum\n * @constructor\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Number} [options.width] The width of the frustum in meters.\n * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\n * @param {Number} [options.near=1.0] The distance of the near plane.\n * @param {Number} [options.far=500000000.0] The distance of the far plane.\n *\n * @example\n * const maxRadii = ellipsoid.maximumRadius;\n *\n * const frustum = new Cesium.OrthographicFrustum();\n * frustum.near = 0.01 * maxRadii;\n * frustum.far = 50.0 * maxRadii;\n */\nfunction OrthographicFrustum(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._offCenterFrustum = new OrthographicOffCenterFrustum();\n\n /**\n * The horizontal width of the frustum in meters.\n * @type {Number}\n * @default undefined\n */\n this.width = options.width;\n this._width = undefined;\n\n /**\n * The aspect ratio of the frustum's width to it's height.\n * @type {Number}\n * @default undefined\n */\n this.aspectRatio = options.aspectRatio;\n this._aspectRatio = undefined;\n\n /**\n * The distance of the near plane.\n * @type {Number}\n * @default 1.0\n */\n this.near = defaultValue(options.near, 1.0);\n this._near = this.near;\n\n /**\n * The distance of the far plane.\n * @type {Number}\n * @default 500000000.0;\n */\n this.far = defaultValue(options.far, 500000000.0);\n this._far = this.far;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nOrthographicFrustum.packedLength = 4;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {OrthographicFrustum} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nOrthographicFrustum.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.width;\n array[startingIndex++] = value.aspectRatio;\n array[startingIndex++] = value.near;\n array[startingIndex] = value.far;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {OrthographicFrustum} [result] The object into which to store the result.\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\n */\nOrthographicFrustum.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new OrthographicFrustum();\n }\n\n result.width = array[startingIndex++];\n result.aspectRatio = array[startingIndex++];\n result.near = array[startingIndex++];\n result.far = array[startingIndex];\n\n return result;\n};\n\nfunction update(frustum) {\n const f = frustum._offCenterFrustum;\n\n if (\n frustum.width !== frustum._width ||\n frustum.aspectRatio !== frustum._aspectRatio ||\n frustum.near !== frustum._near ||\n frustum.far !== frustum._far\n ) {\n frustum._aspectRatio = frustum.aspectRatio;\n frustum._width = frustum.width;\n frustum._near = frustum.near;\n frustum._far = frustum.far;\n\n const ratio = 1.0 / frustum.aspectRatio;\n f.right = frustum.width * 0.5;\n f.left = -f.right;\n f.top = ratio * f.right;\n f.bottom = -f.top;\n f.near = frustum.near;\n f.far = frustum.far;\n }\n}\n\nObject.defineProperties(OrthographicFrustum.prototype, {\n /**\n * Gets the orthographic projection matrix computed from the view frustum.\n * @memberof OrthographicFrustum.prototype\n * @type {Matrix4}\n * @readonly\n */\n projectionMatrix: {\n get: function () {\n update(this);\n return this._offCenterFrustum.projectionMatrix;\n },\n },\n});\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nOrthographicFrustum.prototype.computeCullingVolume = function (\n position,\n direction,\n up\n) {\n update(this);\n return this._offCenterFrustum.computeCullingVolume(position, direction, up);\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\n * @param {Number} distance The distance to the near plane in meters.\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\n */\nOrthographicFrustum.prototype.getPixelDimensions = function (\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n) {\n update(this);\n return this._offCenterFrustum.getPixelDimensions(\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n );\n};\n\n/**\n * Returns a duplicate of a OrthographicFrustum instance.\n *\n * @param {OrthographicFrustum} [result] The object onto which to store the result.\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\n */\nOrthographicFrustum.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new OrthographicFrustum();\n }\n\n result.aspectRatio = this.aspectRatio;\n result.width = this.width;\n result.near = this.near;\n result.far = this.far;\n\n // force update of clone to compute matrices\n result._aspectRatio = undefined;\n result._width = undefined;\n result._near = undefined;\n result._far = undefined;\n\n this._offCenterFrustum.clone(result._offCenterFrustum);\n\n return result;\n};\n\n/**\n * Compares the provided OrthographicFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {OrthographicFrustum} [other] The right hand side OrthographicFrustum.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nOrthographicFrustum.prototype.equals = function (other) {\n if (!defined(other) || !(other instanceof OrthographicFrustum)) {\n return false;\n }\n\n update(this);\n update(other);\n\n return (\n this.width === other.width &&\n this.aspectRatio === other.aspectRatio &&\n this._offCenterFrustum.equals(other._offCenterFrustum)\n );\n};\n\n/**\n * Compares the provided OrthographicFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {OrthographicFrustum} other The right hand side OrthographicFrustum.\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nOrthographicFrustum.prototype.equalsEpsilon = function (\n other,\n relativeEpsilon,\n absoluteEpsilon\n) {\n if (!defined(other) || !(other instanceof OrthographicFrustum)) {\n return false;\n }\n\n update(this);\n update(other);\n\n return (\n CesiumMath.equalsEpsilon(\n this.width,\n other.width,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.aspectRatio,\n other.aspectRatio,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n this._offCenterFrustum.equalsEpsilon(\n other._offCenterFrustum,\n relativeEpsilon,\n absoluteEpsilon\n )\n );\n};\nexport default OrthographicFrustum;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Simple abstraction for a group. This class exists to make the metadata API\n * more consistent, i.e. metadata can be accessed via\n * <code>content.group.metadata</code> much like tile metadata is accessed as\n * <code>tile.metadata</code>.\n *\n * @param {Object} options Object with the following properties:\n * @param {GroupMetadata} options.metadata The metadata associated with this group.\n *\n * @alias Cesium3DContentGroup\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Cesium3DContentGroup(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._metadata = options.metadata;\n}\n\nObject.defineProperties(Cesium3DContentGroup.prototype, {\n /**\n * Get the metadata for this group\n *\n * @memberof Cesium3DContentGroup.prototype\n *\n * @type {GroupMetadata}\n *\n * @readonly\n */\n metadata: {\n get: function () {\n return this._metadata;\n },\n },\n});\n\nexport default Cesium3DContentGroup;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * Reads a string from a Uint8Array.\n *\n * @function\n *\n * @param {Uint8Array} uint8Array The Uint8Array to read from.\n * @param {Number} [byteOffset=0] The byte offset to start reading from.\n * @param {Number} [byteLength] The byte length to read. If byteLength is omitted the remainder of the buffer is read.\n * @returns {String} The string.\n *\n * @private\n */\nfunction getStringFromTypedArray(uint8Array, byteOffset, byteLength) {\n byteOffset = defaultValue(byteOffset, 0);\n byteLength = defaultValue(byteLength, uint8Array.byteLength - byteOffset);\n\n uint8Array = uint8Array.subarray(byteOffset, byteOffset + byteLength);\n\n return getStringFromTypedArray.decode(uint8Array);\n}\n\n// Exposed functions for testing\ngetStringFromTypedArray.decodeWithTextDecoder = function (view) {\n const decoder = new TextDecoder(\"utf-8\");\n return decoder.decode(view);\n};\n\ngetStringFromTypedArray.decodeWithFromCharCode = function (view) {\n let result = \"\";\n const codePoints = utf8Handler(view);\n const length = codePoints.length;\n for (let i = 0; i < length; ++i) {\n let cp = codePoints[i];\n if (cp <= 0xffff) {\n result += String.fromCharCode(cp);\n } else {\n cp -= 0x10000;\n result += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);\n }\n }\n return result;\n};\n\nfunction inRange(a, min, max) {\n return min <= a && a <= max;\n}\n\n// This code is inspired by public domain code found here: https://github.com/inexorabletash/text-encoding\nfunction utf8Handler(utfBytes) {\n let codePoint = 0;\n let bytesSeen = 0;\n let bytesNeeded = 0;\n let lowerBoundary = 0x80;\n let upperBoundary = 0xbf;\n\n const codePoints = [];\n const length = utfBytes.length;\n for (let i = 0; i < length; ++i) {\n const currentByte = utfBytes[i];\n\n // If bytesNeeded = 0, then we are starting a new character\n if (bytesNeeded === 0) {\n // 1 Byte Ascii character\n if (inRange(currentByte, 0x00, 0x7f)) {\n // Return a code point whose value is byte.\n codePoints.push(currentByte);\n continue;\n }\n\n // 2 Byte character\n if (inRange(currentByte, 0xc2, 0xdf)) {\n bytesNeeded = 1;\n codePoint = currentByte & 0x1f;\n continue;\n }\n\n // 3 Byte character\n if (inRange(currentByte, 0xe0, 0xef)) {\n // If byte is 0xE0, set utf-8 lower boundary to 0xA0.\n if (currentByte === 0xe0) {\n lowerBoundary = 0xa0;\n }\n // If byte is 0xED, set utf-8 upper boundary to 0x9F.\n if (currentByte === 0xed) {\n upperBoundary = 0x9f;\n }\n\n bytesNeeded = 2;\n codePoint = currentByte & 0xf;\n continue;\n }\n\n // 4 Byte character\n if (inRange(currentByte, 0xf0, 0xf4)) {\n // If byte is 0xF0, set utf-8 lower boundary to 0x90.\n if (currentByte === 0xf0) {\n lowerBoundary = 0x90;\n }\n // If byte is 0xF4, set utf-8 upper boundary to 0x8F.\n if (currentByte === 0xf4) {\n upperBoundary = 0x8f;\n }\n\n bytesNeeded = 3;\n codePoint = currentByte & 0x7;\n continue;\n }\n\n throw new RuntimeError(\"String decoding failed.\");\n }\n\n // Out of range, so ignore the first part(s) of the character and continue with this byte on its own\n if (!inRange(currentByte, lowerBoundary, upperBoundary)) {\n codePoint = bytesNeeded = bytesSeen = 0;\n lowerBoundary = 0x80;\n upperBoundary = 0xbf;\n --i;\n continue;\n }\n\n // Set appropriate boundaries, since we've now checked byte 2 of a potential longer character\n lowerBoundary = 0x80;\n upperBoundary = 0xbf;\n\n // Add byte to code point\n codePoint = (codePoint << 6) | (currentByte & 0x3f);\n\n // We have the correct number of bytes, so push and reset for next character\n ++bytesSeen;\n if (bytesSeen === bytesNeeded) {\n codePoints.push(codePoint);\n codePoint = bytesNeeded = bytesSeen = 0;\n }\n }\n\n return codePoints;\n}\n\nif (typeof TextDecoder !== \"undefined\") {\n getStringFromTypedArray.decode =\n getStringFromTypedArray.decodeWithTextDecoder;\n} else {\n getStringFromTypedArray.decode =\n getStringFromTypedArray.decodeWithFromCharCode;\n}\nexport default getStringFromTypedArray;\n", "import defaultValue from \"./defaultValue.js\";\nimport getStringFromTypedArray from \"./getStringFromTypedArray.js\";\n\n/**\n * @private\n */\nfunction getMagic(uint8Array, byteOffset) {\n byteOffset = defaultValue(byteOffset, 0);\n return getStringFromTypedArray(\n uint8Array,\n byteOffset,\n Math.min(4, uint8Array.length)\n );\n}\nexport default getMagic;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Composite|Composite}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Composite3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Composite3DTileContent(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset,\n factory\n) {\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n this._contents = [];\n\n this._metadata = undefined;\n this._group = undefined;\n\n this._readyPromise = initialize(this, arrayBuffer, byteOffset, factory);\n}\n\nObject.defineProperties(Composite3DTileContent.prototype, {\n featurePropertiesDirty: {\n get: function () {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n if (contents[i].featurePropertiesDirty) {\n return true;\n }\n }\n\n return false;\n },\n set: function (value) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].featurePropertiesDirty = value;\n }\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>featuresLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n featuresLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>pointsLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>trianglesLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n trianglesLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>geometryByteLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n geometryByteLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>texturesByteLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>batchTableByteLength</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n batchTableByteLength: {\n get: function () {\n return 0;\n },\n },\n\n innerContents: {\n get: function () {\n return this._contents;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._resource.getUrlComponent(true);\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * both stores the content metadata and propagates the content metadata to all of its children.\n * @memberof Composite3DTileContent.prototype\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n metadata: {\n get: function () {\n return this._metadata;\n },\n set: function (value) {\n this._metadata = value;\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].metadata = value;\n }\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>batchTable</code> for a tile in the composite.\n * @memberof Composite3DTileContent.prototype\n */\n batchTable: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * both stores the group metadata and propagates the group metadata to all of its children.\n * @memberof Composite3DTileContent.prototype\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].group = value;\n }\n },\n },\n});\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nfunction initialize(content, arrayBuffer, byteOffset, factory) {\n byteOffset = defaultValue(byteOffset, 0);\n\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Composite Tile version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n // Skip byteLength\n byteOffset += sizeOfUint32;\n\n const tilesLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const contentPromises = [];\n\n // For caching purposes, models within the composite tile must be\n // distinguished. To do this, add a query parameter ?compositeIndex=i.\n // Since composite tiles may contain other composite tiles, check for an\n // existing prefix and separate them with underscores. e.g.\n // ?compositeIndex=0_1_1\n const resource = content._resource;\n let prefix = resource.queryParameters.compositeIndex;\n if (defined(prefix)) {\n // We'll be adding another value at the end, so add an underscore.\n prefix = `${prefix}_`;\n } else {\n // no prefix\n prefix = \"\";\n }\n\n for (let i = 0; i < tilesLength; ++i) {\n const tileType = getMagic(uint8Array, byteOffset);\n\n // Tile byte length is stored after magic and version\n const tileByteLength = view.getUint32(byteOffset + sizeOfUint32 * 2, true);\n\n const contentFactory = factory[tileType];\n\n // Label which content within the composite this is\n const compositeIndex = `${prefix}${i}`;\n const childResource = resource.getDerivedResource({\n queryParameters: {\n compositeIndex: compositeIndex,\n },\n });\n\n if (defined(contentFactory)) {\n const innerContent = contentFactory(\n content._tileset,\n content._tile,\n childResource,\n arrayBuffer,\n byteOffset\n );\n content._contents.push(innerContent);\n contentPromises.push(innerContent.readyPromise);\n } else {\n throw new RuntimeError(\n `Unknown tile content type, ${tileType}, inside Composite tile`\n );\n }\n\n byteOffset += tileByteLength;\n }\n\n return Promise.all(contentPromises).then(function () {\n return content;\n });\n}\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>false</code>. Instead call <code>hasProperty</code> for a tile in the composite.\n */\nComposite3DTileContent.prototype.hasProperty = function (batchId, name) {\n return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Composite3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>getFeature</code> for a tile in the composite.\n */\nComposite3DTileContent.prototype.getFeature = function (batchId) {\n return undefined;\n};\n\nComposite3DTileContent.prototype.applyDebugSettings = function (\n enabled,\n color\n) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].applyDebugSettings(enabled, color);\n }\n};\n\nComposite3DTileContent.prototype.applyStyle = function (style) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].applyStyle(style);\n }\n};\n\nComposite3DTileContent.prototype.update = function (tileset, frameState) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].update(tileset, frameState);\n }\n};\n\nComposite3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nComposite3DTileContent.prototype.destroy = function () {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].destroy();\n }\n return destroyObject(this);\n};\nexport default Composite3DTileContent;\n", "import getStringFromTypedArray from \"./getStringFromTypedArray.js\";\n\n/**\n * Parses JSON from a Uint8Array.\n *\n * @function\n *\n * @param {Uint8Array} uint8Array The Uint8Array to read from.\n * @param {Number} [byteOffset=0] The byte offset to start reading from.\n * @param {Number} [byteLength] The byte length to read. If byteLength is omitted the remainder of the buffer is read.\n * @returns {Object} An object containing the parsed JSON.\n *\n * @private\n */\nfunction getJsonFromTypedArray(uint8Array, byteOffset, byteLength) {\n return JSON.parse(\n getStringFromTypedArray(uint8Array, byteOffset, byteLength)\n );\n}\n\nexport default getJsonFromTypedArray;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n/**\n * An object that manages color, show/hide and picking textures for a batch\n * table or feature table.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} featuresLength The number of features in the batch table or feature table\n * @param {Cesium3DTileContent|ModelFeatureTable} owner The owner of this batch texture. For 3D Tiles, this will be a {@link Cesium3DTileContent}. For glTF models, this will be a {@link ModelFeatureTable}.\n * @param {Object} [statistics] The statistics object to update with information about the batch texture.\n * @param {Function} [colorChangedCallback] A callback function that is called whenever the color of a feature changes.\n *\n * @alias BatchTexture\n * @constructor\n *\n * @private\n */\nfunction BatchTexture(options) {\n this._id = createGuid();\n\n const featuresLength = options.featuresLength;\n\n // PERFORMANCE_IDEA: These parallel arrays probably generate cache misses in get/set color/show\n // and use A LOT of memory. How can we use less memory?\n this._showAlphaProperties = undefined; // [Show (0 or 255), Alpha (0 to 255)] property for each feature\n this._batchValues = undefined; // Per-feature RGBA (A is based on the color's alpha and feature's show property)\n\n this._batchValuesDirty = false;\n this._batchTexture = undefined;\n this._defaultTexture = undefined;\n\n this._pickTexture = undefined;\n this._pickIds = [];\n\n // Dimensions for batch and pick textures\n let textureDimensions;\n let textureStep;\n\n if (featuresLength > 0) {\n // PERFORMANCE_IDEA: this can waste memory in the last row in the uncommon case\n // when more than one row is needed (e.g., > 16K features in one tile)\n const width = Math.min(featuresLength, ContextLimits.maximumTextureSize);\n const height = Math.ceil(featuresLength / ContextLimits.maximumTextureSize);\n const stepX = 1.0 / width;\n const centerX = stepX * 0.5;\n const stepY = 1.0 / height;\n const centerY = stepY * 0.5;\n\n textureDimensions = new Cartesian2(width, height);\n textureStep = new Cartesian4(stepX, centerX, stepY, centerY);\n }\n\n this._translucentFeaturesLength = 0;\n this._featuresLength = featuresLength;\n this._textureDimensions = textureDimensions;\n this._textureStep = textureStep;\n this._owner = options.owner;\n this._statistics = options.statistics;\n this._colorChangedCallback = options.colorChangedCallback;\n}\n\nObject.defineProperties(BatchTexture.prototype, {\n /**\n * Number of features that are translucent\n *\n * @memberof BatchTexture.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n translucentFeaturesLength: {\n get: function () {\n return this._translucentFeaturesLength;\n },\n },\n\n /**\n * Total size of all GPU resources used by this batch texture.\n *\n * @memberof BatchTexture.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n byteLength: {\n get: function () {\n let memory = 0;\n if (defined(this._pickTexture)) {\n memory += this._pickTexture.sizeInBytes;\n }\n if (defined(this._batchTexture)) {\n memory += this._batchTexture.sizeInBytes;\n }\n return memory;\n },\n },\n\n /**\n * Dimensions of the underlying batch texture.\n *\n * @memberof BatchTexture.prototype\n * @type {Cartesian2}\n * @readonly\n * @private\n */\n textureDimensions: {\n get: function () {\n return this._textureDimensions;\n },\n },\n\n /**\n * Size of each texture and distance from side to center of a texel in\n * each direction. Stored as (stepX, centerX, stepY, centerY)\n *\n * @memberof BatchTexture.prototype\n * @type {Cartesian4}\n * @readonly\n * @private\n */\n textureStep: {\n get: function () {\n return this._textureStep;\n },\n },\n\n /**\n * The underlying texture used for styling. The texels are accessed\n * by batch ID, and the value is the color of this feature after accounting\n * for show/hide settings.\n *\n * @memberof BatchTexture.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n batchTexture: {\n get: function () {\n return this._batchTexture;\n },\n },\n\n /**\n * The default texture to use when there are no batch values\n *\n * @memberof BatchTexture.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n defaultTexture: {\n get: function () {\n return this._defaultTexture;\n },\n },\n\n /**\n * The underlying texture used for picking. The texels are accessed by\n * batch ID, and the value is the pick color.\n *\n * @memberof BatchTexture.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n pickTexture: {\n get: function () {\n return this._pickTexture;\n },\n },\n});\n\nBatchTexture.DEFAULT_COLOR_VALUE = Color.WHITE;\nBatchTexture.DEFAULT_SHOW_VALUE = true;\n\nfunction getByteLength(batchTexture) {\n const dimensions = batchTexture._textureDimensions;\n return dimensions.x * dimensions.y * 4;\n}\n\nfunction getBatchValues(batchTexture) {\n if (!defined(batchTexture._batchValues)) {\n // Default batch texture to RGBA = 255: white highlight (RGB) and show/alpha = true/255 (A).\n const byteLength = getByteLength(batchTexture);\n const bytes = new Uint8Array(byteLength).fill(255);\n batchTexture._batchValues = bytes;\n }\n\n return batchTexture._batchValues;\n}\n\nfunction getShowAlphaProperties(batchTexture) {\n if (!defined(batchTexture._showAlphaProperties)) {\n const byteLength = 2 * batchTexture._featuresLength;\n const bytes = new Uint8Array(byteLength).fill(255);\n // [Show = true, Alpha = 255]\n batchTexture._showAlphaProperties = bytes;\n }\n return batchTexture._showAlphaProperties;\n}\n\nfunction checkBatchId(batchId, featuresLength) {\n if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n throw new DeveloperError(\n `batchId is required and between zero and featuresLength - 1 (${featuresLength}` -\n +\").\"\n );\n }\n}\n\n/**\n * Set whether a feature is visible.\n *\n * @param {Number} batchId the ID of the feature\n * @param {Boolean} show <code>true</code> if the feature should be shown, <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.setShow = function (batchId, show) {\n if (show && !defined(this._showAlphaProperties)) {\n // Avoid allocating since the default is show = true\n return;\n }\n\n const showAlphaProperties = getShowAlphaProperties(this);\n const propertyOffset = batchId * 2;\n\n const newShow = show ? 255 : 0;\n if (showAlphaProperties[propertyOffset] !== newShow) {\n showAlphaProperties[propertyOffset] = newShow;\n\n const batchValues = getBatchValues(this);\n\n // Compute alpha used in the shader based on show and color.alpha properties\n const offset = batchId * 4 + 3;\n batchValues[offset] = show ? showAlphaProperties[propertyOffset + 1] : 0;\n\n this._batchValuesDirty = true;\n }\n};\n\n/**\n * Set the show for all features at once.\n *\n * @param {Boolean} show <code>true</code> if the feature should be shown, <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.setAllShow = function (show) {\n const featuresLength = this._featuresLength;\n for (let i = 0; i < featuresLength; ++i) {\n this.setShow(i, show);\n }\n};\n\n/**\n * Check the current show value for a feature\n *\n * @param {Number} batchId the ID of the feature\n * @return {Boolean} <code>true</code> if the feature is shown, or <code>false</code> otherwise\n * @private\n */\nBatchTexture.prototype.getShow = function (batchId) {\n if (!defined(this._showAlphaProperties)) {\n // Avoid allocating since the default is show = true\n return true;\n }\n\n const offset = batchId * 2;\n return this._showAlphaProperties[offset] === 255;\n};\n\nconst scratchColorBytes = new Array(4);\n\n/**\n * Set the styling color of a feature\n *\n * @param {Number} batchId the ID of the feature\n * @param {Color} color the color to assign to this feature.\n *\n * @private\n */\nBatchTexture.prototype.setColor = function (batchId, color) {\n if (\n Color.equals(color, BatchTexture.DEFAULT_COLOR_VALUE) &&\n !defined(this._batchValues)\n ) {\n // Avoid allocating since the default is white\n return;\n }\n\n const newColor = color.toBytes(scratchColorBytes);\n const newAlpha = newColor[3];\n\n const batchValues = getBatchValues(this);\n const offset = batchId * 4;\n\n const showAlphaProperties = getShowAlphaProperties(this);\n const propertyOffset = batchId * 2;\n\n if (\n batchValues[offset] !== newColor[0] ||\n batchValues[offset + 1] !== newColor[1] ||\n batchValues[offset + 2] !== newColor[2] ||\n showAlphaProperties[propertyOffset + 1] !== newAlpha\n ) {\n batchValues[offset] = newColor[0];\n batchValues[offset + 1] = newColor[1];\n batchValues[offset + 2] = newColor[2];\n\n const wasTranslucent = showAlphaProperties[propertyOffset + 1] !== 255;\n\n // Compute alpha used in the shader based on show and color.alpha properties\n const show = showAlphaProperties[propertyOffset] !== 0;\n batchValues[offset + 3] = show ? newAlpha : 0;\n showAlphaProperties[propertyOffset + 1] = newAlpha;\n\n // Track number of translucent features so we know if this tile needs\n // opaque commands, translucent commands, or both for rendering.\n const isTranslucent = newAlpha !== 255;\n if (isTranslucent && !wasTranslucent) {\n ++this._translucentFeaturesLength;\n } else if (!isTranslucent && wasTranslucent) {\n --this._translucentFeaturesLength;\n }\n\n this._batchValuesDirty = true;\n\n if (defined(this._colorChangedCallback)) {\n this._colorChangedCallback(batchId, color);\n }\n }\n};\n\n/**\n * Set the styling color for all features at once\n *\n * @param {Color} color the color to assign to all features.\n *\n * @private\n */\nBatchTexture.prototype.setAllColor = function (color) {\n const featuresLength = this._featuresLength;\n for (let i = 0; i < featuresLength; ++i) {\n this.setColor(i, color);\n }\n};\n\n/**\n * Get the current color of a feature\n *\n * @param {Number} batchId The ID of the feature\n * @param {Color} result A color object where the result will be stored.\n * @return {Color} The color assigned to the selected feature\n *\n * @private\n */\nBatchTexture.prototype.getColor = function (batchId, result) {\n if (!defined(this._batchValues)) {\n return Color.clone(BatchTexture.DEFAULT_COLOR_VALUE, result);\n }\n\n const batchValues = this._batchValues;\n const offset = batchId * 4;\n\n const showAlphaProperties = this._showAlphaProperties;\n const propertyOffset = batchId * 2;\n\n return Color.fromBytes(\n batchValues[offset],\n batchValues[offset + 1],\n batchValues[offset + 2],\n showAlphaProperties[propertyOffset + 1],\n result\n );\n};\n\n/**\n * Get the pick color of a feature. This feature is an RGBA encoding of the\n * pick ID.\n *\n * @param {Number} batchId The ID of the feature\n * @return {PickId} The picking color assigned to this feature\n *\n * @private\n */\nBatchTexture.prototype.getPickColor = function (batchId) {\nreturn this._pickIds[batchId];\n};\n\nfunction createTexture(batchTexture, context, bytes) {\n const dimensions = batchTexture._textureDimensions;\n return new Texture({\n context: context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n width: dimensions.x,\n height: dimensions.y,\n arrayBufferView: bytes,\n },\n flipY: false,\n sampler: Sampler.NEAREST,\n });\n}\n\nfunction createPickTexture(batchTexture, context) {\n const featuresLength = batchTexture._featuresLength;\n if (!defined(batchTexture._pickTexture) && featuresLength > 0) {\n const pickIds = batchTexture._pickIds;\n const byteLength = getByteLength(batchTexture);\n const bytes = new Uint8Array(byteLength);\n const owner = batchTexture._owner;\n const statistics = batchTexture._statistics;\n\n // PERFORMANCE_IDEA: we could skip the pick texture completely by allocating\n // a continuous range of pickIds and then converting the base pickId + batchId\n // to RGBA in the shader. The only consider is precision issues, which might\n // not be an issue in WebGL 2.\n for (let i = 0; i < featuresLength; ++i) {\n const pickId = context.createPickId(owner.getFeature(i));\n pickIds.push(pickId);\n\n const pickColor = pickId.color;\n const offset = i * 4;\n bytes[offset] = Color.floatToByte(pickColor.red);\n bytes[offset + 1] = Color.floatToByte(pickColor.green);\n bytes[offset + 2] = Color.floatToByte(pickColor.blue);\n bytes[offset + 3] = Color.floatToByte(pickColor.alpha);\n }\n\n batchTexture._pickTexture = createTexture(batchTexture, context, bytes);\n\n // Make sure the tileset statistics are updated the frame when the pick\n // texture is created.\n if (defined(statistics)) {\n statistics.batchTableByteLength += batchTexture._pickTexture.sizeInBytes;\n }\n }\n}\n\nfunction updateBatchTexture(batchTexture) {\n const dimensions = batchTexture._textureDimensions;\n // PERFORMANCE_IDEA: Instead of rewriting the entire texture, use fine-grained\n // texture updates when less than, for example, 10%, of the values changed. Or\n // even just optimize the common case when one feature show/color changed.\n batchTexture._batchTexture.copyFrom({\n source: {\n width: dimensions.x,\n height: dimensions.y,\n arrayBufferView: batchTexture._batchValues,\n },\n });\n}\n\nBatchTexture.prototype.update = function (tileset, frameState) {\n const context = frameState.context;\n this._defaultTexture = context.defaultTexture;\n\n const passes = frameState.passes;\n if (passes.pick || passes.postProcess) {\n createPickTexture(this, context);\n }\n\n if (this._batchValuesDirty) {\n this._batchValuesDirty = false;\n\n // Create batch texture on-demand\n if (!defined(this._batchTexture)) {\n this._batchTexture = createTexture(this, context, this._batchValues);\n\n // Make sure the tileset statistics are updated the frame when the\n // batch texture is created.\n if (defined(this._statistics)) {\n this._statistics.batchTableByteLength += this._batchTexture.sizeInBytes;\n }\n }\n\n updateBatchTexture(this); // Apply per-feature show/color updates\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BatchTexture#destroy\n * @private\n */\nBatchTexture.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see BatchTexture#isDestroyed\n * @private\n */\nBatchTexture.prototype.destroy = function () {\n this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n this._pickTexture = this._pickTexture && this._pickTexture.destroy();\n\n const pickIds = this._pickIds;\n const length = pickIds.length;\n for (let i = 0; i < length; ++i) {\n pickIds[i].destroy();\n }\n\n return destroyObject(this);\n};\n\nexport default BatchTexture;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\nconst ComponentsPerAttribute = {\n SCALAR: 1,\n VEC2: 2,\n VEC3: 3,\n VEC4: 4,\n MAT2: 4,\n MAT3: 9,\n MAT4: 16,\n};\n\nconst ClassPerType = {\n SCALAR: undefined,\n VEC2: Cartesian2,\n VEC3: Cartesian3,\n VEC4: Cartesian4,\n MAT2: Matrix2,\n MAT3: Matrix3,\n MAT4: Matrix4,\n};\n\n/**\n * @private\n */\nfunction getBinaryAccessor(accessor) {\n const componentType = accessor.componentType;\n let componentDatatype;\n if (typeof componentType === \"string\") {\n componentDatatype = ComponentDatatype.fromName(componentType);\n } else {\n componentDatatype = componentType;\n }\n\n const componentsPerAttribute = ComponentsPerAttribute[accessor.type];\n const classType = ClassPerType[accessor.type];\n return {\n componentsPerAttribute: componentsPerAttribute,\n classType: classType,\n createArrayBufferView: function (buffer, byteOffset, length) {\n return ComponentDatatype.createArrayBufferView(\n componentDatatype,\n buffer,\n byteOffset,\n componentsPerAttribute * length\n );\n },\n };\n}\nexport default getBinaryAccessor;\n", "import AttributeType from \"./AttributeType.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Object for handling the <code>3DTILES_batch_table_hierarchy</code> extension\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.extension The <code>3DTILES_batch_table_hierarchy</code> extension object.\n * @param {Uint8Array} [options.binaryBody] The binary body of the batch table\n *\n * @alias BatchTableHierarchy\n * @constructor\n *\n * @private\n */\nfunction BatchTableHierarchy(options) {\n this._classes = undefined;\n this._classIds = undefined;\n this._classIndexes = undefined;\n this._parentCounts = undefined;\n this._parentIndexes = undefined;\n this._parentIds = undefined;\n\n // Total memory used by the typed arrays\n this._byteLength = 0;\n\n initialize(this, options.extension, options.binaryBody);\n\n}\n\nObject.defineProperties(BatchTableHierarchy.prototype, {\n byteLength: {\n get: function () {\n return this._byteLength;\n },\n },\n});\n\n/**\n * Parse the batch table hierarchy from the\n * <code>3DTILES_batch_table_hierarchy</code> extension.\n *\n * @param {BatchTableHierarchy} hierarchy The hierarchy instance\n * @param {Object} hierarchyJson The JSON of the extension\n * @param {Uint8Array} [binaryBody] The binary body of the batch table for accessing binary properties\n * @private\n */\nfunction initialize(hierarchy, hierarchyJson, binaryBody) {\n let i;\n let classId;\n let binaryAccessor;\n\n const instancesLength = hierarchyJson.instancesLength;\n const classes = hierarchyJson.classes;\n let classIds = hierarchyJson.classIds;\n let parentCounts = hierarchyJson.parentCounts;\n let parentIds = hierarchyJson.parentIds;\n let parentIdsLength = instancesLength;\n let byteLength = 0;\n\n if (defined(classIds.byteOffset)) {\n classIds.componentType = defaultValue(\n classIds.componentType,\n ComponentDatatype.UNSIGNED_SHORT\n );\n classIds.type = AttributeType.SCALAR;\n binaryAccessor = getBinaryAccessor(classIds);\n classIds = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + classIds.byteOffset,\n instancesLength\n );\n byteLength += classIds.byteLength;\n }\n\n let parentIndexes;\n if (defined(parentCounts)) {\n if (defined(parentCounts.byteOffset)) {\n parentCounts.componentType = defaultValue(\n parentCounts.componentType,\n ComponentDatatype.UNSIGNED_SHORT\n );\n parentCounts.type = AttributeType.SCALAR;\n binaryAccessor = getBinaryAccessor(parentCounts);\n parentCounts = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + parentCounts.byteOffset,\n instancesLength\n );\n byteLength += parentCounts.byteLength;\n }\n parentIndexes = new Uint16Array(instancesLength);\n parentIdsLength = 0;\n for (i = 0; i < instancesLength; ++i) {\n parentIndexes[i] = parentIdsLength;\n parentIdsLength += parentCounts[i];\n }\n\n byteLength += parentIndexes.byteLength;\n }\n\n if (defined(parentIds) && defined(parentIds.byteOffset)) {\n parentIds.componentType = defaultValue(\n parentIds.componentType,\n ComponentDatatype.UNSIGNED_SHORT\n );\n parentIds.type = AttributeType.SCALAR;\n binaryAccessor = getBinaryAccessor(parentIds);\n parentIds = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + parentIds.byteOffset,\n parentIdsLength\n );\n\n byteLength += parentIds.byteLength;\n }\n\n const classesLength = classes.length;\n for (i = 0; i < classesLength; ++i) {\n const classInstancesLength = classes[i].length;\n const properties = classes[i].instances;\n const binaryProperties = getBinaryProperties(\n classInstancesLength,\n properties,\n binaryBody\n );\n byteLength += countBinaryPropertyMemory(binaryProperties);\n classes[i].instances = combine(binaryProperties, properties);\n }\n\n const classCounts = new Array(classesLength).fill(0);\n const classIndexes = new Uint16Array(instancesLength);\n for (i = 0; i < instancesLength; ++i) {\n classId = classIds[i];\n classIndexes[i] = classCounts[classId];\n ++classCounts[classId];\n }\n byteLength += classIndexes.byteLength;\n\n hierarchy._classes = classes;\n hierarchy._classIds = classIds;\n hierarchy._classIndexes = classIndexes;\n hierarchy._parentCounts = parentCounts;\n hierarchy._parentIndexes = parentIndexes;\n hierarchy._parentIds = parentIds;\n hierarchy._byteLength = byteLength;\n}\n\nfunction getBinaryProperties(featuresLength, properties, binaryBody) {\n let binaryProperties;\n for (const name in properties) {\n if (properties.hasOwnProperty(name)) {\n const property = properties[name];\n const byteOffset = property.byteOffset;\n if (defined(byteOffset)) {\n // This is a binary property\n const componentType = property.componentType;\n const type = property.type;\n if (!defined(componentType)) {\n throw new RuntimeError(\"componentType is required.\");\n }\n if (!defined(type)) {\n throw new RuntimeError(\"type is required.\");\n }\n if (!defined(binaryBody)) {\n throw new RuntimeError(\n `Property ${name} requires a batch table binary.`\n );\n }\n\n const binaryAccessor = getBinaryAccessor(property);\n const componentCount = binaryAccessor.componentsPerAttribute;\n const classType = binaryAccessor.classType;\n const typedArray = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + byteOffset,\n featuresLength\n );\n\n if (!defined(binaryProperties)) {\n binaryProperties = {};\n }\n\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n binaryProperties[name] = {\n typedArray: typedArray,\n componentCount: componentCount,\n type: classType,\n };\n }\n }\n }\n return binaryProperties;\n}\n\nfunction countBinaryPropertyMemory(binaryProperties) {\n let byteLength = 0;\n for (const name in binaryProperties) {\n if (binaryProperties.hasOwnProperty(name)) {\n byteLength += binaryProperties[name].typedArray.byteLength;\n }\n }\n return byteLength;\n}\n\n// The size of this array equals the maximum instance count among all loaded tiles, which has the potential to be large.\nconst scratchVisited = [];\nconst scratchStack = [];\nlet marker = 0;\nfunction traverseHierarchyMultipleParents(\n hierarchy,\n instanceIndex,\n endConditionCallback\n) {\n const classIds = hierarchy._classIds;\n const parentCounts = hierarchy._parentCounts;\n const parentIds = hierarchy._parentIds;\n const parentIndexes = hierarchy._parentIndexes;\n const instancesLength = classIds.length;\n\n // Ignore instances that have already been visited. This occurs in diamond inheritance situations.\n // Use a marker value to indicate that an instance has been visited, which increments with each run.\n // This is more efficient than clearing the visited array every time.\n const visited = scratchVisited;\n visited.length = Math.max(visited.length, instancesLength);\n const visitedMarker = ++marker;\n\n const stack = scratchStack;\n stack.length = 0;\n stack.push(instanceIndex);\n\n while (stack.length > 0) {\n instanceIndex = stack.pop();\n if (visited[instanceIndex] === visitedMarker) {\n // This instance has already been visited, stop traversal\n continue;\n }\n visited[instanceIndex] = visitedMarker;\n const result = endConditionCallback(hierarchy, instanceIndex);\n if (defined(result)) {\n // The end condition was met, stop the traversal and return the result\n return result;\n }\n const parentCount = parentCounts[instanceIndex];\n const parentIndex = parentIndexes[instanceIndex];\n for (let i = 0; i < parentCount; ++i) {\n const parentId = parentIds[parentIndex + i];\n // Stop the traversal when the instance has no parent (its parentId equals itself)\n // else add the parent to the stack to continue the traversal.\n if (parentId !== instanceIndex) {\n stack.push(parentId);\n }\n }\n }\n}\n\nfunction traverseHierarchySingleParent(\n hierarchy,\n instanceIndex,\n endConditionCallback\n) {\n let hasParent = true;\n while (hasParent) {\n const result = endConditionCallback(hierarchy, instanceIndex);\n if (defined(result)) {\n // The end condition was met, stop the traversal and return the result\n return result;\n }\n const parentId = hierarchy._parentIds[instanceIndex];\n hasParent = parentId !== instanceIndex;\n instanceIndex = parentId;\n }\n}\n\nfunction traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) {\n // Traverse over the hierarchy and process each instance with the endConditionCallback.\n // When the endConditionCallback returns a value, the traversal stops and that value is returned.\n const parentCounts = hierarchy._parentCounts;\n const parentIds = hierarchy._parentIds;\n if (!defined(parentIds)) {\n return endConditionCallback(hierarchy, instanceIndex);\n } else if (defined(parentCounts)) {\n return traverseHierarchyMultipleParents(\n hierarchy,\n instanceIndex,\n endConditionCallback\n );\n }\n return traverseHierarchySingleParent(\n hierarchy,\n instanceIndex,\n endConditionCallback\n );\n}\n\n/**\n * Returns whether the feature has this property.\n *\n * @param {Number} batchId the batch ID of the feature\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the feature has this property.\n * @private\n */\nBatchTableHierarchy.prototype.hasProperty = function (batchId, propertyId) {\n const result = traverseHierarchy(this, batchId, function (\n hierarchy,\n instanceIndex\n ) {\n const classId = hierarchy._classIds[instanceIndex];\n const instances = hierarchy._classes[classId].instances;\n if (defined(instances[propertyId])) {\n return true;\n }\n });\n return defined(result);\n};\n\n/**\n * Returns whether any feature has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether any feature has this property.\n * @private\n */\nBatchTableHierarchy.prototype.propertyExists = function (propertyId) {\n const classes = this._classes;\n const classesLength = classes.length;\n for (let i = 0; i < classesLength; ++i) {\n const instances = classes[i].instances;\n if (defined(instances[propertyId])) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {Number} batchId the batch ID of the feature\n * @param {Number} index The index of the entity.\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nBatchTableHierarchy.prototype.getPropertyIds = function (batchId, results) {\n results = defined(results) ? results : [];\n results.length = 0;\n\n traverseHierarchy(this, batchId, function (hierarchy, instanceIndex) {\n const classId = hierarchy._classIds[instanceIndex];\n const instances = hierarchy._classes[classId].instances;\n for (const name in instances) {\n if (instances.hasOwnProperty(name)) {\n if (results.indexOf(name) === -1) {\n results.push(name);\n }\n }\n }\n });\n\n return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n *\n * @param {Number} batchId the batch ID of the feature\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nBatchTableHierarchy.prototype.getProperty = function (batchId, propertyId) {\n return traverseHierarchy(this, batchId, function (hierarchy, instanceIndex) {\n const classId = hierarchy._classIds[instanceIndex];\n const instanceClass = hierarchy._classes[classId];\n const indexInClass = hierarchy._classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[propertyId];\n if (defined(propertyValues)) {\n if (defined(propertyValues.typedArray)) {\n return getBinaryProperty(propertyValues, indexInClass);\n }\n return clone(propertyValues[indexInClass], true);\n }\n });\n};\n\nfunction getBinaryProperty(binaryProperty, index) {\n const typedArray = binaryProperty.typedArray;\n const componentCount = binaryProperty.componentCount;\n if (componentCount === 1) {\n return typedArray[index];\n }\n return binaryProperty.type.unpack(typedArray, index * componentCount);\n}\n\n/**\n * Sets the value of the property with the given ID. Only properties of the\n * instance may be set; parent properties may not be set.\n *\n * @param {Number} batchId The batchId of the feature\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} when setting an inherited property\n * @private\n */\nBatchTableHierarchy.prototype.setProperty = function (\n batchId,\n propertyId,\n value\n) {\n const result = traverseHierarchy(this, batchId, function (\n hierarchy,\n instanceIndex\n ) {\n const classId = hierarchy._classIds[instanceIndex];\n const instanceClass = hierarchy._classes[classId];\n const indexInClass = hierarchy._classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[propertyId];\n if (defined(propertyValues)) {\nif (defined(propertyValues.typedArray)) {\n setBinaryProperty(propertyValues, indexInClass, value);\n } else {\n propertyValues[indexInClass] = clone(value, true);\n }\n return true;\n }\n });\n return defined(result);\n};\n\nfunction setBinaryProperty(binaryProperty, index, value) {\n const typedArray = binaryProperty.typedArray;\n const componentCount = binaryProperty.componentCount;\n if (componentCount === 1) {\n typedArray[index] = value;\n } else {\n binaryProperty.type.pack(value, typedArray, index * componentCount);\n }\n}\n\n/**\n * Check if a feature belongs to a class with the given name\n *\n * @param {Number} batchId The batch ID of the feature\n * @param {String} className The name of the class\n * @return {Boolean} <code>true</code> if the feature belongs to the class given by className, or <code>false</code> otherwise\n * @private\n */\nBatchTableHierarchy.prototype.isClass = function (batchId, className) {\n // PERFORMANCE_IDEA : cache results in the ancestor classes to speed up this check if this area becomes a hotspot\n // PERFORMANCE_IDEA : treat class names as integers for faster comparisons\n const result = traverseHierarchy(this, batchId, function (\n hierarchy,\n instanceIndex\n ) {\n const classId = hierarchy._classIds[instanceIndex];\n const instanceClass = hierarchy._classes[classId];\n if (instanceClass.name === className) {\n return true;\n }\n });\n return defined(result);\n};\n\n/**\n * Get the name of the class a given feature belongs to\n *\n * @param {Number} batchId The batch ID of the feature\n * @return {String} The name of the class this feature belongs to\n */\nBatchTableHierarchy.prototype.getClassName = function (batchId) {\n const classId = this._classIds[batchId];\n const instanceClass = this._classes[classId];\n return instanceClass.name;\n};\n\nexport default BatchTableHierarchy;\n", "/**\n * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from\n * the original feature, e.g. glTF material or per-point color in the tile.\n * <p>\n * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the\n * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.\n * </p>\n * <p>\n * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the\n * tileset's color blend mode.\n * </p>\n * <pre><code>\n * \"techniques\": {\n * \"technique0\": {\n * \"parameters\": {\n * \"diffuse\": {\n * \"semantic\": \"_3DTILESDIFFUSE\",\n * \"type\": 35666\n * }\n * }\n * }\n * }\n * </code></pre>\n *\n * @enum {Number}\n */\nconst Cesium3DTileColorBlendMode = {\n /**\n * Multiplies the source color by the feature color.\n *\n * @type {Number}\n * @constant\n */\n HIGHLIGHT: 0,\n\n /**\n * Replaces the source color with the feature color.\n *\n * @type {Number}\n * @constant\n */\n REPLACE: 1,\n\n /**\n * Blends the source color and feature color together.\n *\n * @type {Number}\n * @constant\n */\n MIX: 2,\n};\nexport default Object.freeze(Cesium3DTileColorBlendMode);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BatchTexture from \"./BatchTexture.js\";\nimport BatchTableHierarchy from \"./BatchTableHierarchy.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileColorBlendMode from \"./Cesium3DTileColorBlendMode.js\";\nimport CullFace from \"./CullFace.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\nconst DEFAULT_COLOR_VALUE = BatchTexture.DEFAULT_COLOR_VALUE;\nconst DEFAULT_SHOW_VALUE = BatchTexture.DEFAULT_SHOW_VALUE;\n\n/**\n * @private\n * @constructor\n */\nfunction Cesium3DTileBatchTable(\n content,\n featuresLength,\n batchTableJson,\n batchTableBinary,\n colorChangedCallback\n) {\n /**\n * @readonly\n */\n this.featuresLength = featuresLength;\n\n let extensions;\n if (defined(batchTableJson)) {\n extensions = batchTableJson.extensions;\n }\n this._extensions = defaultValue(extensions, {});\n\n const properties = initializeProperties(batchTableJson);\n this._properties = properties;\n\n this._batchTableHierarchy = initializeHierarchy(\n this,\n batchTableJson,\n batchTableBinary\n );\n\n const binaryProperties = getBinaryProperties(\n featuresLength,\n properties,\n batchTableBinary\n );\n this._binaryPropertiesByteLength = countBinaryPropertyMemory(\n binaryProperties\n );\n this._batchTableBinaryProperties = binaryProperties;\n\n this._content = content;\n\n this._batchTexture = new BatchTexture({\n featuresLength: featuresLength,\n colorChangedCallback: colorChangedCallback,\n owner: content,\n statistics: content.tileset.statistics,\n });\n}\n\n// This can be overridden for testing purposes\nCesium3DTileBatchTable._deprecationWarning = deprecationWarning;\n\nObject.defineProperties(Cesium3DTileBatchTable.prototype, {\n /**\n * Size of the batch table, including the batch table hierarchy's binary\n * buffers and any binary properties. JSON data is not counted.\n *\n * @memberof Cesium3DTileBatchTable.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n batchTableByteLength: {\n get: function () {\n let totalByteLength = this._binaryPropertiesByteLength;\n\n if (defined(this._batchTableHierarchy)) {\n totalByteLength += this._batchTableHierarchy.byteLength;\n }\n\n totalByteLength += this._batchTexture.byteLength;\n\n return totalByteLength;\n },\n },\n});\n\nfunction initializeProperties(jsonHeader) {\n const properties = {};\n\n if (!defined(jsonHeader)) {\n return properties;\n }\n\n for (const propertyName in jsonHeader) {\n if (\n jsonHeader.hasOwnProperty(propertyName) &&\n propertyName !== \"HIERARCHY\" && // Deprecated HIERARCHY property\n propertyName !== \"extensions\" &&\n propertyName !== \"extras\"\n ) {\n properties[propertyName] = clone(jsonHeader[propertyName], true);\n }\n }\n\n return properties;\n}\n\nfunction initializeHierarchy(batchTable, jsonHeader, binaryBody) {\n if (!defined(jsonHeader)) {\n return;\n }\n\n let hierarchy = batchTable._extensions[\"3DTILES_batch_table_hierarchy\"];\n\n const legacyHierarchy = jsonHeader.HIERARCHY;\n if (defined(legacyHierarchy)) {\n Cesium3DTileBatchTable._deprecationWarning(\n \"batchTableHierarchyExtension\",\n \"The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.\"\n );\n batchTable._extensions[\"3DTILES_batch_table_hierarchy\"] = legacyHierarchy;\n hierarchy = legacyHierarchy;\n }\n\n if (!defined(hierarchy)) {\n return;\n }\n\n return new BatchTableHierarchy({\n extension: hierarchy,\n binaryBody: binaryBody,\n });\n}\n\nfunction getBinaryProperties(featuresLength, properties, binaryBody) {\n let binaryProperties;\n for (const name in properties) {\n if (properties.hasOwnProperty(name)) {\n const property = properties[name];\n const byteOffset = property.byteOffset;\n if (defined(byteOffset)) {\n // This is a binary property\n const componentType = property.componentType;\n const type = property.type;\n if (!defined(componentType)) {\n throw new RuntimeError(\"componentType is required.\");\n }\n if (!defined(type)) {\n throw new RuntimeError(\"type is required.\");\n }\n if (!defined(binaryBody)) {\n throw new RuntimeError(\n `Property ${name} requires a batch table binary.`\n );\n }\n\n const binaryAccessor = getBinaryAccessor(property);\n const componentCount = binaryAccessor.componentsPerAttribute;\n const classType = binaryAccessor.classType;\n const typedArray = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + byteOffset,\n featuresLength\n );\n\n if (!defined(binaryProperties)) {\n binaryProperties = {};\n }\n\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n binaryProperties[name] = {\n typedArray: typedArray,\n componentCount: componentCount,\n type: classType,\n };\n }\n }\n }\n return binaryProperties;\n}\n\nfunction countBinaryPropertyMemory(binaryProperties) {\n if (!defined(binaryProperties)) {\n return 0;\n }\n\n let byteLength = 0;\n for (const name in binaryProperties) {\n if (binaryProperties.hasOwnProperty(name)) {\n byteLength += binaryProperties[name].typedArray.byteLength;\n }\n }\n return byteLength;\n}\n\nCesium3DTileBatchTable.getBinaryProperties = function (\n featuresLength,\n batchTableJson,\n batchTableBinary\n) {\n return getBinaryProperties(featuresLength, batchTableJson, batchTableBinary);\n};\n\nCesium3DTileBatchTable.prototype.setShow = function (batchId, show) {\n this._batchTexture.setShow(batchId, show);\n};\n\nCesium3DTileBatchTable.prototype.setAllShow = function (show) {\n this._batchTexture.setAllShow(show);\n};\n\nCesium3DTileBatchTable.prototype.getShow = function (batchId) {\n return this._batchTexture.getShow(batchId);\n};\n\nCesium3DTileBatchTable.prototype.setColor = function (batchId, color) {\n this._batchTexture.setColor(batchId, color);\n};\n\nCesium3DTileBatchTable.prototype.setAllColor = function (color) {\n this._batchTexture.setAllColor(color);\n};\n\nCesium3DTileBatchTable.prototype.getColor = function (batchId, result) {\n return this._batchTexture.getColor(batchId, result);\n};\n\nCesium3DTileBatchTable.prototype.getPickColor = function (batchId) {\n return this._batchTexture.getPickColor(batchId);\n};\n\nconst scratchColor = new Color();\n\nCesium3DTileBatchTable.prototype.applyStyle = function (style) {\n if (!defined(style)) {\n this.setAllColor(DEFAULT_COLOR_VALUE);\n this.setAllShow(DEFAULT_SHOW_VALUE);\n return;\n }\n\n const content = this._content;\n const length = this.featuresLength;\n for (let i = 0; i < length; ++i) {\n const feature = content.getFeature(i);\n const color = defined(style.color)\n ? defaultValue(\n style.color.evaluateColor(feature, scratchColor),\n DEFAULT_COLOR_VALUE\n )\n : DEFAULT_COLOR_VALUE;\n const show = defined(style.show)\n ? defaultValue(style.show.evaluate(feature), DEFAULT_SHOW_VALUE)\n : DEFAULT_SHOW_VALUE;\n this.setColor(i, color);\n this.setShow(i, show);\n }\n};\n\nfunction getBinaryProperty(binaryProperty, index) {\n const typedArray = binaryProperty.typedArray;\n const componentCount = binaryProperty.componentCount;\n if (componentCount === 1) {\n return typedArray[index];\n }\n return binaryProperty.type.unpack(typedArray, index * componentCount);\n}\n\nfunction setBinaryProperty(binaryProperty, index, value) {\n const typedArray = binaryProperty.typedArray;\n const componentCount = binaryProperty.componentCount;\n if (componentCount === 1) {\n typedArray[index] = value;\n } else {\n binaryProperty.type.pack(value, typedArray, index * componentCount);\n }\n}\n\nfunction checkBatchId(batchId, featuresLength) {\n if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {\n throw new DeveloperError(\n `batchId is required and must be between zero and featuresLength - 1 (${featuresLength}` -\n +\").\"\n );\n }\n}\n\nCesium3DTileBatchTable.prototype.isClass = function (batchId, className) {\n const hierarchy = this._batchTableHierarchy;\n if (!defined(hierarchy)) {\n return false;\n }\n\n return hierarchy.isClass(batchId, className);\n};\n\nCesium3DTileBatchTable.prototype.isExactClass = function (batchId, className) {\n return this.getExactClassName(batchId) === className;\n};\n\nCesium3DTileBatchTable.prototype.getExactClassName = function (batchId) {\n const hierarchy = this._batchTableHierarchy;\n if (!defined(hierarchy)) {\n return undefined;\n }\n\n return hierarchy.getClassName(batchId);\n};\n\nCesium3DTileBatchTable.prototype.hasProperty = function (batchId, name) {\n return (\n defined(this._properties[name]) ||\n (defined(this._batchTableHierarchy) &&\n this._batchTableHierarchy.hasProperty(batchId, name))\n );\n};\n\n/**\n * @private\n */\nCesium3DTileBatchTable.prototype.hasPropertyBySemantic = function () {\n // Cesium 3D Tiles 1.0 formats do not have semantics\n return false;\n};\n\nCesium3DTileBatchTable.prototype.getPropertyIds = function (batchId, results) {\n results = defined(results) ? results : [];\n results.length = 0;\n\n const scratchPropertyIds = Object.keys(this._properties);\n results.push.apply(results, scratchPropertyIds);\n\n if (defined(this._batchTableHierarchy)) {\n results.push.apply(\n results,\n this._batchTableHierarchy.getPropertyIds(batchId, scratchPropertyIds)\n );\n }\n\n return results;\n};\n\n/**\n * @private\n */\nCesium3DTileBatchTable.prototype.getPropertyBySemantic = function (\n batchId,\n name\n) {\n // Cesium 3D Tiles 1.0 formats do not have semantics\n return undefined;\n};\n\nCesium3DTileBatchTable.prototype.getProperty = function (batchId, name) {\n if (defined(this._batchTableBinaryProperties)) {\n const binaryProperty = this._batchTableBinaryProperties[name];\n if (defined(binaryProperty)) {\n return getBinaryProperty(binaryProperty, batchId);\n }\n }\n\n const propertyValues = this._properties[name];\n if (defined(propertyValues)) {\n return clone(propertyValues[batchId], true);\n }\n\n if (defined(this._batchTableHierarchy)) {\n const hierarchyProperty = this._batchTableHierarchy.getProperty(\n batchId,\n name\n );\n if (defined(hierarchyProperty)) {\n return hierarchyProperty;\n }\n }\n\n return undefined;\n};\n\nCesium3DTileBatchTable.prototype.setProperty = function (batchId, name, value) {\n const featuresLength = this.featuresLength;\n if (defined(this._batchTableBinaryProperties)) {\n const binaryProperty = this._batchTableBinaryProperties[name];\n if (defined(binaryProperty)) {\n setBinaryProperty(binaryProperty, batchId, value);\n return;\n }\n }\n\n if (defined(this._batchTableHierarchy)) {\n if (this._batchTableHierarchy.setProperty(batchId, name, value)) {\n return;\n }\n }\n\n let propertyValues = this._properties[name];\n if (!defined(propertyValues)) {\n // Property does not exist. Create it.\n this._properties[name] = new Array(featuresLength);\n propertyValues = this._properties[name];\n }\n\n propertyValues[batchId] = clone(value, true);\n};\n\nfunction getGlslComputeSt(batchTable) {\n // GLSL batchId is zero-based: [0, featuresLength - 1]\n if (batchTable._batchTexture.textureDimensions.y === 1) {\n return (\n \"uniform vec4 tile_textureStep; \\n\" +\n \"vec2 computeSt(float batchId) \\n\" +\n \"{ \\n\" +\n \" float stepX = tile_textureStep.x; \\n\" +\n \" float centerX = tile_textureStep.y; \\n\" +\n \" return vec2(centerX + (batchId * stepX), 0.5); \\n\" +\n \"} \\n\"\n );\n }\n\n return (\n \"uniform vec4 tile_textureStep; \\n\" +\n \"uniform vec2 tile_textureDimensions; \\n\" +\n \"vec2 computeSt(float batchId) \\n\" +\n \"{ \\n\" +\n \" float stepX = tile_textureStep.x; \\n\" +\n \" float centerX = tile_textureStep.y; \\n\" +\n \" float stepY = tile_textureStep.z; \\n\" +\n \" float centerY = tile_textureStep.w; \\n\" +\n \" float xId = mod(batchId, tile_textureDimensions.x); \\n\" +\n \" float yId = floor(batchId / tile_textureDimensions.x); \\n\" +\n \" return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \\n\" +\n \"} \\n\"\n );\n}\n\nCesium3DTileBatchTable.prototype.getVertexShaderCallback = function (\n handleTranslucent,\n batchIdAttributeName,\n diffuseAttributeOrUniformName\n) {\n if (this.featuresLength === 0) {\n return;\n }\n\n const that = this;\n return function (source) {\n // If the color blend mode is HIGHLIGHT, the highlight color will always be applied in the fragment shader.\n // No need to apply the highlight color in the vertex shader as well.\n const renamedSource = modifyDiffuse(\n source,\n diffuseAttributeOrUniformName,\n false\n );\n let newMain;\n\n if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n // When VTF is supported, perform per-feature show/hide in the vertex shader\n newMain = \"\";\n if (handleTranslucent) {\n newMain += \"uniform bool tile_translucentCommand; \\n\";\n }\n newMain +=\n `${\n \"uniform sampler2D tile_batchTexture; \\n\" +\n \"varying vec4 tile_featureColor; \\n\" +\n \"varying vec2 tile_featureSt; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" vec2 st = computeSt(\"\n }${batchIdAttributeName}); \\n` +\n ` vec4 featureProperties = texture2D(tile_batchTexture, st); \\n` +\n ` tile_color(featureProperties); \\n` +\n ` float show = ceil(featureProperties.a); \\n` + // 0 - false, non-zero - true\n ` gl_Position *= show; \\n`; // Per-feature show/hide\n if (handleTranslucent) {\n newMain +=\n \" bool isStyleTranslucent = (featureProperties.a != 1.0); \\n\" +\n \" if (czm_pass == czm_passTranslucent) \\n\" +\n \" { \\n\" +\n \" if (!isStyleTranslucent && !tile_translucentCommand) \\n\" + // Do not render opaque features in the translucent pass\n \" { \\n\" +\n \" gl_Position *= 0.0; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" if (isStyleTranslucent) \\n\" + // Do not render translucent features in the opaque pass\n \" { \\n\" +\n \" gl_Position *= 0.0; \\n\" +\n \" } \\n\" +\n \" } \\n\";\n }\n newMain +=\n \" tile_featureColor = featureProperties; \\n\" +\n \" tile_featureSt = st; \\n\" +\n \"}\";\n } else {\n // When VTF is not supported, color blend mode MIX will look incorrect due to the feature's color not being available in the vertex shader\n newMain =\n `${\n \"varying vec2 tile_featureSt; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" tile_color(vec4(1.0)); \\n\" +\n \" tile_featureSt = computeSt(\"\n }${batchIdAttributeName}); \\n` + `}`;\n }\n\n return `${renamedSource}\\n${getGlslComputeSt(that)}${newMain}`;\n };\n};\n\nfunction getDefaultShader(source, applyHighlight) {\n source = ShaderSource.replaceMain(source, \"tile_main\");\n\n if (!applyHighlight) {\n return (\n `${source}void tile_color(vec4 tile_featureColor) \\n` +\n `{ \\n` +\n ` tile_main(); \\n` +\n `} \\n`\n );\n }\n\n // The color blend mode is intended for the RGB channels so alpha is always just multiplied.\n // gl_FragColor is multiplied by the tile color only when tile_colorBlend is 0.0 (highlight)\n return (\n `${source}uniform float tile_colorBlend; \\n` +\n `void tile_color(vec4 tile_featureColor) \\n` +\n `{ \\n` +\n ` tile_main(); \\n` +\n ` tile_featureColor = czm_gammaCorrect(tile_featureColor); \\n` +\n ` gl_FragColor.a *= tile_featureColor.a; \\n` +\n ` float highlight = ceil(tile_colorBlend); \\n` +\n ` gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \\n` +\n `} \\n`\n );\n}\n\nfunction replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName) {\n const functionCall = `texture2D(${diffuseAttributeOrUniformName}`;\n\n let fromIndex = 0;\n let startIndex = source.indexOf(functionCall, fromIndex);\n let endIndex;\n\n while (startIndex > -1) {\n let nestedLevel = 0;\n for (let i = startIndex; i < source.length; ++i) {\n const character = source.charAt(i);\n if (character === \"(\") {\n ++nestedLevel;\n } else if (character === \")\") {\n --nestedLevel;\n if (nestedLevel === 0) {\n endIndex = i + 1;\n break;\n }\n }\n }\n const extractedFunction = source.slice(startIndex, endIndex);\n const replacedFunction = `tile_diffuse_final(${extractedFunction}, tile_diffuse)`;\n\n source =\n source.slice(0, startIndex) + replacedFunction + source.slice(endIndex);\n fromIndex = startIndex + replacedFunction.length;\n startIndex = source.indexOf(functionCall, fromIndex);\n }\n\n return source;\n}\n\nfunction modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) {\n // If the glTF does not specify the _3DTILESDIFFUSE semantic, return the default shader.\n // Otherwise if _3DTILESDIFFUSE is defined prefer the shader below that can switch the color mode at runtime.\n if (!defined(diffuseAttributeOrUniformName)) {\n return getDefaultShader(source, applyHighlight);\n }\n\n // Find the diffuse uniform. Examples matches:\n // uniform vec3 u_diffuseColor;\n // uniform sampler2D diffuseTexture;\n let regex = new RegExp(\n `(uniform|attribute|in)\\\\s+(vec[34]|sampler2D)\\\\s+${diffuseAttributeOrUniformName};`\n );\n const uniformMatch = source.match(regex);\n\n if (!defined(uniformMatch)) {\n // Could not find uniform declaration of type vec3, vec4, or sampler2D\n return getDefaultShader(source, applyHighlight);\n }\n\n const declaration = uniformMatch[0];\n const type = uniformMatch[2];\n\n source = ShaderSource.replaceMain(source, \"tile_main\");\n source = source.replace(declaration, \"\"); // Remove uniform declaration for now so the replace below doesn't affect it\n\n // If the tile color is white, use the source color. This implies the feature has not been styled.\n // Highlight: tile_colorBlend is 0.0 and the source color is used\n // Replace: tile_colorBlend is 1.0 and the tile color is used\n // Mix: tile_colorBlend is between 0.0 and 1.0, causing the source color and tile color to mix\n const finalDiffuseFunction =\n \"bool isWhite(vec3 color) \\n\" +\n \"{ \\n\" +\n \" return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \\n\" +\n \"} \\n\" +\n \"vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \\n\" +\n \"{ \\n\" +\n \" vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \\n\" +\n \" vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \\n\" +\n \" return vec4(diffuse.rgb, sourceDiffuse.a); \\n\" +\n \"} \\n\";\n\n // The color blend mode is intended for the RGB channels so alpha is always just multiplied.\n // gl_FragColor is multiplied by the tile color only when tile_colorBlend is 0.0 (highlight)\n const highlight =\n \" tile_featureColor = czm_gammaCorrect(tile_featureColor); \\n\" +\n \" gl_FragColor.a *= tile_featureColor.a; \\n\" +\n \" float highlight = ceil(tile_colorBlend); \\n\" +\n \" gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \\n\";\n\n let setColor;\n if (type === \"vec3\" || type === \"vec4\") {\n const sourceDiffuse =\n type === \"vec3\"\n ? `vec4(${diffuseAttributeOrUniformName}, 1.0)`\n : diffuseAttributeOrUniformName;\n const replaceDiffuse =\n type === \"vec3\" ? \"tile_diffuse.xyz\" : \"tile_diffuse\";\n regex = new RegExp(diffuseAttributeOrUniformName, \"g\");\n source = source.replace(regex, replaceDiffuse);\n setColor =\n ` vec4 source = ${sourceDiffuse}; \\n` +\n ` tile_diffuse = tile_diffuse_final(source, tile_featureColor); \\n` +\n ` tile_main(); \\n`;\n } else if (type === \"sampler2D\") {\n // Handles any number of nested parentheses\n // E.g. texture2D(u_diffuse, uv)\n // E.g. texture2D(u_diffuse, computeUV(index))\n source = replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName);\n setColor =\n \" tile_diffuse = tile_featureColor; \\n\" + \" tile_main(); \\n\";\n }\n\n source =\n `${\n \"uniform float tile_colorBlend; \\n\" + \"vec4 tile_diffuse = vec4(1.0); \\n\"\n }${finalDiffuseFunction}${declaration}\\n${source}\\n` +\n `void tile_color(vec4 tile_featureColor) \\n` +\n `{ \\n${setColor}`;\n\n if (applyHighlight) {\n source += highlight;\n }\n\n source += \"} \\n\";\n return source;\n}\n\nCesium3DTileBatchTable.prototype.getFragmentShaderCallback = function (\n handleTranslucent,\n diffuseAttributeOrUniformName,\n hasPremultipliedAlpha\n) {\n if (this.featuresLength === 0) {\n return;\n }\n return function (source) {\n source = modifyDiffuse(source, diffuseAttributeOrUniformName, true);\n if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n // When VTF is supported, per-feature show/hide already happened in the fragment shader\n source +=\n \"uniform sampler2D tile_pickTexture; \\n\" +\n \"varying vec2 tile_featureSt; \\n\" +\n \"varying vec4 tile_featureColor; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" tile_color(tile_featureColor); \\n\";\n\n if (hasPremultipliedAlpha) {\n source += \" gl_FragColor.rgb *= gl_FragColor.a; \\n\";\n }\n\n source += \"}\";\n } else {\n if (handleTranslucent) {\n source += \"uniform bool tile_translucentCommand; \\n\";\n }\n source +=\n \"uniform sampler2D tile_pickTexture; \\n\" +\n \"uniform sampler2D tile_batchTexture; \\n\" +\n \"varying vec2 tile_featureSt; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \\n\" +\n \" if (featureProperties.a == 0.0) { \\n\" + // show: alpha == 0 - false, non-zeo - true\n \" discard; \\n\" +\n \" } \\n\";\n\n if (handleTranslucent) {\n source +=\n \" bool isStyleTranslucent = (featureProperties.a != 1.0); \\n\" +\n \" if (czm_pass == czm_passTranslucent) \\n\" +\n \" { \\n\" +\n \" if (!isStyleTranslucent && !tile_translucentCommand) \\n\" + // Do not render opaque features in the translucent pass\n \" { \\n\" +\n \" discard; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" if (isStyleTranslucent) \\n\" + // Do not render translucent features in the opaque pass\n \" { \\n\" +\n \" discard; \\n\" +\n \" } \\n\" +\n \" } \\n\";\n }\n\n source += \" tile_color(featureProperties); \\n\";\n\n if (hasPremultipliedAlpha) {\n source += \" gl_FragColor.rgb *= gl_FragColor.a; \\n\";\n }\n\n source += \"} \\n\";\n }\n return source;\n };\n};\n\nCesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = function () {\n if (this.featuresLength === 0) {\n return;\n }\n return function (source) {\n source = ShaderSource.replaceMain(source, \"tile_main\");\n if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n // When VTF is supported, per-feature show/hide already happened in the fragment shader\n source +=\n \"uniform sampler2D tile_pickTexture;\\n\" +\n \"varying vec2 tile_featureSt; \\n\" +\n \"varying vec4 tile_featureColor; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" tile_main(); \\n\" +\n \" gl_FragColor = tile_featureColor; \\n\" +\n \" gl_FragColor.rgb *= gl_FragColor.a; \\n\" +\n \"}\";\n } else {\n source +=\n \"uniform sampler2D tile_batchTexture; \\n\" +\n \"uniform sampler2D tile_pickTexture;\\n\" +\n \"varying vec2 tile_featureSt; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" tile_main(); \\n\" +\n \" vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \\n\" +\n \" if (featureProperties.a == 0.0) { \\n\" + // show: alpha == 0 - false, non-zero - true\n \" discard; \\n\" +\n \" } \\n\" +\n \" gl_FragColor = featureProperties; \\n\" +\n \" gl_FragColor.rgb *= gl_FragColor.a; \\n\" +\n \"} \\n\";\n }\n return source;\n };\n};\n\nfunction getColorBlend(batchTable) {\n const tileset = batchTable._content.tileset;\n const colorBlendMode = tileset.colorBlendMode;\n const colorBlendAmount = tileset.colorBlendAmount;\n if (colorBlendMode === Cesium3DTileColorBlendMode.HIGHLIGHT) {\n return 0.0;\n }\n if (colorBlendMode === Cesium3DTileColorBlendMode.REPLACE) {\n return 1.0;\n }\n if (colorBlendMode === Cesium3DTileColorBlendMode.MIX) {\n // The value 0.0 is reserved for highlight, so clamp to just above 0.0.\n return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0);\n }\n}\n\nCesium3DTileBatchTable.prototype.getUniformMapCallback = function () {\n if (this.featuresLength === 0) {\n return;\n }\n\n const that = this;\n return function (uniformMap) {\n const batchUniformMap = {\n tile_batchTexture: function () {\n // PERFORMANCE_IDEA: we could also use a custom shader that avoids the texture read.\n return defaultValue(\n that._batchTexture.batchTexture,\n that._batchTexture.defaultTexture\n );\n },\n tile_textureDimensions: function () {\n return that._batchTexture.textureDimensions;\n },\n tile_textureStep: function () {\n return that._batchTexture.textureStep;\n },\n tile_colorBlend: function () {\n return getColorBlend(that);\n },\n tile_pickTexture: function () {\n return that._batchTexture.pickTexture;\n },\n };\n\n return combine(uniformMap, batchUniformMap);\n };\n};\n\nCesium3DTileBatchTable.prototype.getPickId = function () {\n return \"texture2D(tile_pickTexture, tile_featureSt)\";\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nconst StyleCommandsNeeded = {\n ALL_OPAQUE: 0,\n ALL_TRANSLUCENT: 1,\n OPAQUE_AND_TRANSLUCENT: 2,\n};\n\nCesium3DTileBatchTable.prototype.addDerivedCommands = function (\n frameState,\n commandStart\n) {\n const commandList = frameState.commandList;\n const commandEnd = commandList.length;\n const tile = this._content._tile;\n const finalResolution = tile._finalResolution;\n const tileset = tile.tileset;\n const bivariateVisibilityTest =\n tileset._skipLevelOfDetail &&\n tileset._hasMixedContent &&\n frameState.context.stencilBuffer;\n const styleCommandsNeeded = getStyleCommandsNeeded(this);\n\n for (let i = commandStart; i < commandEnd; ++i) {\n const command = commandList[i];\n if (command.pass === Pass.COMPUTE) {\n continue;\n }\n\n let derivedCommands = command.derivedCommands.tileset;\n if (!defined(derivedCommands) || command.dirty) {\n derivedCommands = {};\n command.derivedCommands.tileset = derivedCommands;\n derivedCommands.originalCommand = deriveCommand(command);\n command.dirty = false;\n }\n const originalCommand = derivedCommands.originalCommand;\n\n if (\n styleCommandsNeeded !== StyleCommandsNeeded.ALL_OPAQUE &&\n command.pass !== Pass.TRANSLUCENT\n ) {\n if (!defined(derivedCommands.translucent)) {\n derivedCommands.translucent = deriveTranslucentCommand(originalCommand);\n }\n }\n\n if (\n styleCommandsNeeded !== StyleCommandsNeeded.ALL_TRANSLUCENT &&\n command.pass !== Pass.TRANSLUCENT\n ) {\n if (!defined(derivedCommands.opaque)) {\n derivedCommands.opaque = deriveOpaqueCommand(originalCommand);\n }\n\n if (bivariateVisibilityTest) {\n if (!finalResolution) {\n if (!defined(derivedCommands.zback)) {\n derivedCommands.zback = deriveZBackfaceCommand(\n frameState.context,\n originalCommand\n );\n }\n tileset._backfaceCommands.push(derivedCommands.zback);\n }\n if (\n !defined(derivedCommands.stencil) ||\n tile._selectionDepth !==\n getLastSelectionDepth(derivedCommands.stencil)\n ) {\n if (command.renderState.depthMask) {\n derivedCommands.stencil = deriveStencilCommand(\n originalCommand,\n tile._selectionDepth\n );\n } else {\n // Ignore if tile does not write depth\n derivedCommands.stencil = derivedCommands.opaque;\n }\n }\n }\n }\n\n const opaqueCommand = bivariateVisibilityTest\n ? derivedCommands.stencil\n : derivedCommands.opaque;\n const translucentCommand = derivedCommands.translucent;\n\n // If the command was originally opaque:\n // * If the styling applied to the tile is all opaque, use the opaque command\n // (with one additional uniform needed for the shader).\n // * If the styling is all translucent, use new (cached) derived commands (front\n // and back faces) with a translucent render state.\n // * If the styling causes both opaque and translucent features in this tile,\n // then use both sets of commands.\n if (command.pass !== Pass.TRANSLUCENT) {\n if (styleCommandsNeeded === StyleCommandsNeeded.ALL_OPAQUE) {\n commandList[i] = opaqueCommand;\n }\n if (styleCommandsNeeded === StyleCommandsNeeded.ALL_TRANSLUCENT) {\n commandList[i] = translucentCommand;\n }\n if (styleCommandsNeeded === StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT) {\n // PERFORMANCE_IDEA: if the tile has multiple commands, we do not know what features are in what\n // commands so this case may be overkill.\n commandList[i] = opaqueCommand;\n commandList.push(translucentCommand);\n }\n } else {\n // Command was originally translucent so no need to derive new commands;\n // as of now, a style can't change an originally translucent feature to\n // opaque since the style's alpha is modulated, not a replacement. When\n // this changes, we need to derive new opaque commands here.\n commandList[i] = originalCommand;\n }\n }\n};\n\nfunction getStyleCommandsNeeded(batchTable) {\n const translucentFeaturesLength =\n batchTable._batchTexture.translucentFeaturesLength;\n\n if (translucentFeaturesLength === 0) {\n return StyleCommandsNeeded.ALL_OPAQUE;\n } else if (translucentFeaturesLength === batchTable.featuresLength) {\n return StyleCommandsNeeded.ALL_TRANSLUCENT;\n }\n\n return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;\n}\n\nfunction deriveCommand(command) {\n const derivedCommand = DrawCommand.shallowClone(command);\n\n // Add a uniform to indicate if the original command was translucent so\n // the shader knows not to cull vertices that were originally transparent\n // even though their style is opaque.\n const translucentCommand = derivedCommand.pass === Pass.TRANSLUCENT;\n\n derivedCommand.uniformMap = defined(derivedCommand.uniformMap)\n ? derivedCommand.uniformMap\n : {};\n derivedCommand.uniformMap.tile_translucentCommand = function () {\n return translucentCommand;\n };\n\n return derivedCommand;\n}\n\nfunction deriveTranslucentCommand(command) {\n const derivedCommand = DrawCommand.shallowClone(command);\n derivedCommand.pass = Pass.TRANSLUCENT;\n derivedCommand.renderState = getTranslucentRenderState(command.renderState);\n return derivedCommand;\n}\n\nfunction deriveOpaqueCommand(command) {\n const derivedCommand = DrawCommand.shallowClone(command);\n derivedCommand.renderState = getOpaqueRenderState(command.renderState);\n return derivedCommand;\n}\n\nfunction getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n \"zBackfaceLogDepth\"\n );\n if (!defined(shader)) {\n const fs = shaderProgram.fragmentShaderSource.clone();\n fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n fs.defines.push(\"POLYGON_OFFSET\");\n\n fs.sources.unshift(\n \"#ifdef GL_OES_standard_derivatives\\n#extension GL_OES_standard_derivatives : enable\\n#endif\\n\"\n );\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"zBackfaceLogDepth\",\n {\n vertexShaderSource: shaderProgram.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: shaderProgram._attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nfunction deriveZBackfaceCommand(context, command) {\n // Write just backface depth of unresolved tiles so resolved stenciled tiles do not appear in front\n const derivedCommand = DrawCommand.shallowClone(command);\n const rs = clone(derivedCommand.renderState, true);\n rs.cull.enabled = true;\n rs.cull.face = CullFace.FRONT;\n // Back faces do not need to write color.\n rs.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n // Push back face depth away from the camera so it is less likely that back faces and front faces of the same tile\n // intersect and overlap. This helps avoid flickering for very thin double-sided walls.\n rs.polygonOffset = {\n enabled: true,\n factor: 5.0,\n units: 5.0,\n };\n // Set the 3D Tiles bit\n rs.stencilTest = StencilConstants.setCesium3DTileBit();\n rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n derivedCommand.renderState = RenderState.fromCache(rs);\n derivedCommand.castShadows = false;\n derivedCommand.receiveShadows = false;\n derivedCommand.uniformMap = clone(command.uniformMap);\n\n const polygonOffset = new Cartesian2(5.0, 5.0);\n derivedCommand.uniformMap.u_polygonOffset = function () {\n return polygonOffset;\n };\n\n // Make the log depth depth fragment write account for the polygon offset, too.\n // Otherwise, the back face commands will cause the higher resolution\n // tiles to disappear.\n derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram(\n context,\n command.shaderProgram\n );\n return derivedCommand;\n}\n\nfunction deriveStencilCommand(command, reference) {\n // Tiles only draw if their selection depth is >= the tile drawn already. They write their\n // selection depth to the stencil buffer to prevent ancestor tiles from drawing on top\n const derivedCommand = DrawCommand.shallowClone(command);\n const rs = clone(derivedCommand.renderState, true);\n // Stencil test is masked to the most significant 3 bits so the reference is shifted. Writes 0 for the terrain bit\n rs.stencilTest.enabled = true;\n rs.stencilTest.mask = StencilConstants.SKIP_LOD_MASK;\n rs.stencilTest.reference =\n StencilConstants.CESIUM_3D_TILE_MASK |\n (reference << StencilConstants.SKIP_LOD_BIT_SHIFT);\n rs.stencilTest.frontFunction = StencilFunction.GREATER_OR_EQUAL;\n rs.stencilTest.frontOperation.zPass = StencilOperation.REPLACE;\n rs.stencilTest.backFunction = StencilFunction.GREATER_OR_EQUAL;\n rs.stencilTest.backOperation.zPass = StencilOperation.REPLACE;\n rs.stencilMask =\n StencilConstants.CESIUM_3D_TILE_MASK | StencilConstants.SKIP_LOD_MASK;\n derivedCommand.renderState = RenderState.fromCache(rs);\n return derivedCommand;\n}\n\nfunction getLastSelectionDepth(stencilCommand) {\n // Isolate the selection depth from the stencil reference.\n const reference = stencilCommand.renderState.stencilTest.reference;\n return (\n (reference & StencilConstants.SKIP_LOD_MASK) >>>\n StencilConstants.SKIP_LOD_BIT_SHIFT\n );\n}\n\nfunction getTranslucentRenderState(renderState) {\n const rs = clone(renderState, true);\n rs.cull.enabled = false;\n rs.depthTest.enabled = true;\n rs.depthMask = false;\n rs.blending = BlendingState.ALPHA_BLEND;\n rs.stencilTest = StencilConstants.setCesium3DTileBit();\n rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n return RenderState.fromCache(rs);\n}\n\nfunction getOpaqueRenderState(renderState) {\n const rs = clone(renderState, true);\n rs.stencilTest = StencilConstants.setCesium3DTileBit();\n rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n\n return RenderState.fromCache(rs);\n}\n\nCesium3DTileBatchTable.prototype.update = function (tileset, frameState) {\n this._batchTexture.update(tileset, frameState);\n};\n\nCesium3DTileBatchTable.prototype.isDestroyed = function () {\n return false;\n};\n\nCesium3DTileBatchTable.prototype.destroy = function () {\n this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n return destroyObject(this);\n};\nexport default Cesium3DTileBatchTable;\n", "/**\n * Describes a renderable batch of geometry.\n *\n * @alias Vector3DTileBatch\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {Number} options.offset The offset of the batch into the indices buffer.\n * @param {Number} options.count The number of indices in the batch.\n * @param {Color} options.color The color of the geometry in the batch.\n * @param {Number[]} options.batchIds An array where each element is the batch id of the geometry in the batch.\n *\n * @private\n */\nfunction Vector3DTileBatch(options) {\n /**\n * The offset of the batch into the indices buffer.\n * @type {Number}\n */\n this.offset = options.offset;\n /**\n * The number of indices in the batch.\n * @type {Number}\n */\n this.count = options.count;\n /**\n * The color of the geometry in the batch.\n * @type {Color}\n */\n this.color = options.color;\n /**\n * An array where each element is the batch id of the geometry in the batch.\n * @type {Number[]}\n */\n this.batchIds = options.batchIds;\n}\nexport default Vector3DTileBatch;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position;\\n\\\nattribute float a_batchId;\\n\\\nuniform mat4 u_modifiedModelViewProjection;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\\n\\\n}\\n\\\n\";\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A feature of a {@link Cesium3DTileset}.\n * <p>\n * Provides access to a feature's properties stored in the tile's batch table, as well\n * as the ability to show/hide a feature and change its highlight color via\n * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.\n * </p>\n * <p>\n * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's\n * content. If the tile's content is unloaded, e.g., due to it going out of view and needing\n * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any\n * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.\n * </p>\n * <p>\n * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}\n * or picking using {@link Scene#pick}.\n * </p>\n *\n * @alias Cesium3DTileFeature\n * @constructor\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n * const feature = scene.pick(movement.endPosition);\n * if (feature instanceof Cesium.Cesium3DTileFeature) {\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n * const propertyId = propertyIds[i];\n * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n * }\n * }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nfunction Cesium3DTileFeature(content, batchId) {\n this._content = content;\n this._batchId = batchId;\n this._color = undefined; // for calling getColor\n}\n\nObject.defineProperties(Cesium3DTileFeature.prototype, {\n /**\n * Gets or sets if the feature will be shown. This is set for all features\n * when a style's show is evaluated.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Boolean}\n *\n * @default true\n */\n show: {\n get: function () {\n return this._content.batchTable.getShow(this._batchId);\n },\n set: function (value) {\n this._content.batchTable.setShow(this._batchId, value);\n },\n },\n\n /**\n * Gets or sets the highlight color multiplied with the feature's color. When\n * this is white, the feature's color is not changed. This is set for all features\n * when a style's color is evaluated.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Color}\n *\n * @default {@link Color.WHITE}\n */\n color: {\n get: function () {\n if (!defined(this._color)) {\n this._color = new Color();\n }\n return this._content.batchTable.getColor(this._batchId, this._color);\n },\n set: function (value) {\n this._content.batchTable.setColor(this._batchId, value);\n },\n },\n\n /**\n * Gets a typed array containing the ECEF positions of the polyline.\n * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false\n * or the feature is not a polyline in a vector tile.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @type {Float64Array}\n */\n polylinePositions: {\n get: function () {\n if (!defined(this._content.getPolylinePositions)) {\n return undefined;\n }\n\n return this._content.getPolylinePositions(this._batchId);\n },\n },\n\n /**\n * Gets the content of the tile containing the feature.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Cesium3DTileContent}\n *\n * @readonly\n * @private\n */\n content: {\n get: function () {\n return this._content;\n },\n },\n\n /**\n * Gets the tileset containing the feature.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Cesium3DTileset}\n *\n * @readonly\n */\n tileset: {\n get: function () {\n return this._content.tileset;\n },\n },\n\n /**\n * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n * the tileset containing the feature.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Cesium3DTileset}\n *\n * @readonly\n */\n primitive: {\n get: function () {\n return this._content.tileset;\n },\n },\n\n /**\n * Get the feature ID associated with this feature. For 3D Tiles 1.0, the\n * batch ID is returned. For EXT_mesh_features, this is the feature ID from\n * the selected feature ID set.\n *\n * @memberof Cesium3DTileFeature.prototype\n *\n * @type {Number}\n *\n * @readonly\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n featureId: {\n get: function () {\n return this._batchId;\n },\n },\n\n /**\n * @private\n */\n pickId: {\n get: function () {\n return this._content.batchTable.getPickColor(this._batchId);\n },\n },\n});\n\n/**\n * Returns whether the feature contains this property. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {Boolean} Whether the feature contains this property.\n */\nCesium3DTileFeature.prototype.hasProperty = function (name) {\n return this._content.batchTable.hasProperty(this._batchId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The IDs of the feature's properties.\n */\nCesium3DTileFeature.prototype.getPropertyIds = function (results) {\n return this._content.batchTable.getPropertyIds(this._batchId, results);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n * const propertyId = propertyIds[i];\n * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n * }\n */\nCesium3DTileFeature.prototype.getProperty = function (name) {\n return this._content.batchTable.getProperty(this._batchId, name);\n};\n\n/**\n * Returns a copy of the feature's property with the given name, examining all\n * the metadata from 3D Tiles 1.0 formats, the EXT_structural_metadata and legacy\n * EXT_feature_metadata glTF extensions, and the metadata present either in the\n * tileset JSON (3D Tiles 1.1) or in the 3DTILES_metadata 3D Tiles extension.\n * Metadata is checked against name from most specific to most general and the\n * first match is returned. Metadata is checked in this order:\n *\n * <ol>\n * <li>Batch table (structural metadata) property by semantic</li>\n * <li>Batch table (structural metadata) property by property ID</li>\n * <li>Content metadata property by semantic</li>\n * <li>Content metadata property by property</li>\n * <li>Tile metadata property by semantic</li>\n * <li>Tile metadata property by property ID</li>\n * <li>Subtree metadata property by semantic</li>\n * <li>Subtree metadata property by property ID</li>\n * <li>Group metadata property by semantic</li>\n * <li>Group metadata property by property ID</li>\n * <li>Tileset metadata property by semantic</li>\n * <li>Tileset metadata property by property ID</li>\n * <li>Otherwise, return undefined</li>\n * </ol>\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}\n * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension}\n * </p>\n *\n * @param {Cesium3DTileContent} content The content for accessing the metadata\n * @param {Number} batchId The batch ID (or feature ID) of the feature to get a property for\n * @param {String} name The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.\n * @return {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nCesium3DTileFeature.getPropertyInherited = function (content, batchId, name) {\n const batchTable = content.batchTable;\n if (defined(batchTable)) {\n if (batchTable.hasPropertyBySemantic(batchId, name)) {\n return batchTable.getPropertyBySemantic(batchId, name);\n }\n\n if (batchTable.hasProperty(batchId, name)) {\n return batchTable.getProperty(batchId, name);\n }\n }\n\n const contentMetadata = content.metadata;\n if (defined(contentMetadata)) {\n if (contentMetadata.hasPropertyBySemantic(name)) {\n return contentMetadata.getPropertyBySemantic(name);\n }\n\n if (contentMetadata.hasProperty(name)) {\n return contentMetadata.getProperty(name);\n }\n }\n\n const tile = content.tile;\n const tileMetadata = tile.metadata;\n if (defined(tileMetadata)) {\n if (tileMetadata.hasPropertyBySemantic(name)) {\n return tileMetadata.getPropertyBySemantic(name);\n }\n\n if (tileMetadata.hasProperty(name)) {\n return tileMetadata.getProperty(name);\n }\n }\n\n let subtreeMetadata;\n if (defined(tile.implicitSubtree)) {\n subtreeMetadata = tile.implicitSubtree.metadata;\n }\n\n if (defined(subtreeMetadata)) {\n if (subtreeMetadata.hasPropertyBySemantic(name)) {\n return subtreeMetadata.getPropertyBySemantic(name);\n }\n\n if (subtreeMetadata.hasProperty(name)) {\n return subtreeMetadata.getProperty(name);\n }\n }\n\n const groupMetadata = defined(content.group)\n ? content.group.metadata\n : undefined;\n if (defined(groupMetadata)) {\n if (groupMetadata.hasPropertyBySemantic(name)) {\n return groupMetadata.getPropertyBySemantic(name);\n }\n\n if (groupMetadata.hasProperty(name)) {\n return groupMetadata.getProperty(name);\n }\n }\n\n const tilesetMetadata = content.tileset.metadata;\n if (defined(tilesetMetadata)) {\n if (tilesetMetadata.hasPropertyBySemantic(name)) {\n return tilesetMetadata.getPropertyBySemantic(name);\n }\n\n if (tilesetMetadata.hasProperty(name)) {\n return tilesetMetadata.getProperty(name);\n }\n }\n\n return undefined;\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n * If the feature is contained within a tileset that has metadata (3D Tiles 1.1)\n * or uses the <code>3DTILES_metadata</code> extension, tileset, group and tile\n * metadata is inherited.\n * <p>\n * To resolve name conflicts, this method resolves names from most specific to\n * least specific by metadata granularity in the order: feature, tile, group,\n * tileset. Within each granularity, semantics are resolved first, then other\n * properties.\n * </p>\n * @param {String} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nCesium3DTileFeature.prototype.getPropertyInherited = function (name) {\n return Cesium3DTileFeature.getPropertyInherited(\n this._content,\n this._batchId,\n name\n );\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n * <p>\n * If a property with the given name doesn't exist, it is created.\n * </p>\n *\n * @param {String} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n * console.log('already clicked');\n * } else {\n * feature.setProperty(name, true);\n * console.log('first click');\n * }\n */\nCesium3DTileFeature.prototype.setProperty = function (name, value) {\n this._content.batchTable.setProperty(this._batchId, name, value);\n\n // PERFORMANCE_IDEA: Probably overkill, but maybe only mark the tile dirty if the\n // property is in one of the style's expressions or - if it can be done quickly -\n // if the new property value changed the result of an expression.\n this._content.featurePropertiesDirty = true;\n};\n\n/**\n * Returns whether the feature's class name equals <code>className</code>. Unlike {@link Cesium3DTileFeature#isClass}\n * this function only checks the feature's exact class and not inherited classes.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {String} className The name to check against.\n * @returns {Boolean} Whether the feature's class name equals <code>className</code>\n *\n * @private\n */\nCesium3DTileFeature.prototype.isExactClass = function (className) {\n return this._content.batchTable.isExactClass(this._batchId, className);\n};\n\n/**\n * Returns whether the feature's class or any inherited classes are named <code>className</code>.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {String} className The name to check against.\n * @returns {Boolean} Whether the feature's class or inherited classes are named <code>className</code>\n *\n * @private\n */\nCesium3DTileFeature.prototype.isClass = function (className) {\n return this._content.batchTable.isClass(this._batchId, className);\n};\n\n/**\n * Returns the feature's class name.\n * <p>\n * This function returns <code>undefined</code> if no batch table hierarchy is present.\n * </p>\n *\n * @returns {String} The feature's class name.\n *\n * @private\n */\nCesium3DTileFeature.prototype.getExactClassName = function () {\n return this._content.batchTable.getExactClassName(this._batchId);\n};\nexport default Cesium3DTileFeature;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport jsep from \"jsep\";\nimport ExpressionNodeType from \"./ExpressionNodeType.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates an expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * Implements the {@link StyleExpression} interface.\n * </p>\n *\n * @alias Expression\n * @constructor\n *\n * @param {String} [expression] The expression defined using the 3D Tiles Styling language.\n * @param {Object} [defines] Defines in the style.\n *\n * @example\n * const expression = new Cesium.Expression('(regExp(\"^Chest\").test(${County})) && (${YearBuilt} >= 1970)');\n * expression.evaluate(feature); // returns true or false depending on the feature's properties\n *\n * @example\n * const expression = new Cesium.Expression('(${Temperature} > 90) ? color(\"red\") : color(\"white\")');\n * expression.evaluateColor(feature, result); // returns a Cesium.Color object\n */\nfunction Expression(expression, defines) {\n this._expression = expression;\n expression = replaceDefines(expression, defines);\n expression = replaceVariables(removeBackslashes(expression));\n\n // customize jsep operators\n jsep.addBinaryOp(\"=~\", 0);\n jsep.addBinaryOp(\"!~\", 0);\n\n let ast;\n try {\n ast = jsep(expression);\n } catch (e) {\n throw new RuntimeError(e);\n }\n\n this._runtimeAst = createRuntimeAst(this, ast);\n}\n\nObject.defineProperties(Expression.prototype, {\n /**\n * Gets the expression defined in the 3D Tiles Styling language.\n *\n * @memberof Expression.prototype\n *\n * @type {String}\n * @readonly\n *\n * @default undefined\n */\n expression: {\n get: function () {\n return this._expression;\n },\n },\n});\n\n// Scratch storage manager while evaluating deep expressions.\n// For example, an expression like dot(vec4(${red}), vec4(${green}) * vec4(${blue}) requires 3 scratch Cartesian4's\nconst scratchStorage = {\n arrayIndex: 0,\n arrayArray: [[]],\n cartesian2Index: 0,\n cartesian3Index: 0,\n cartesian4Index: 0,\n cartesian2Array: [new Cartesian2()],\n cartesian3Array: [new Cartesian3()],\n cartesian4Array: [new Cartesian4()],\n reset: function () {\n this.arrayIndex = 0;\n this.cartesian2Index = 0;\n this.cartesian3Index = 0;\n this.cartesian4Index = 0;\n },\n getArray: function () {\n if (this.arrayIndex >= this.arrayArray.length) {\n this.arrayArray.push([]);\n }\n const array = this.arrayArray[this.arrayIndex++];\n array.length = 0;\n return array;\n },\n getCartesian2: function () {\n if (this.cartesian2Index >= this.cartesian2Array.length) {\n this.cartesian2Array.push(new Cartesian2());\n }\n return this.cartesian2Array[this.cartesian2Index++];\n },\n getCartesian3: function () {\n if (this.cartesian3Index >= this.cartesian3Array.length) {\n this.cartesian3Array.push(new Cartesian3());\n }\n return this.cartesian3Array[this.cartesian3Index++];\n },\n getCartesian4: function () {\n if (this.cartesian4Index >= this.cartesian4Array.length) {\n this.cartesian4Array.push(new Cartesian4());\n }\n return this.cartesian4Array[this.cartesian4Index++];\n },\n};\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Object} [result] The object onto which to store the result.\n * @returns {Boolean|Number|String|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nExpression.prototype.evaluate = function (feature, result) {\n scratchStorage.reset();\n const value = this._runtimeAst.evaluate(feature);\n if (result instanceof Color && value instanceof Cartesian4) {\n return Color.fromCartesian4(value, result);\n }\n if (\n value instanceof Cartesian2 ||\n value instanceof Cartesian3 ||\n value instanceof Cartesian4\n ) {\n return value.clone(result);\n }\n return value;\n};\n\n/**\n * Evaluates the result of a Color expression, optionally using the provided feature's properties.\n * <p>\n * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.\n * </p>\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nExpression.prototype.evaluateColor = function (feature, result) {\n scratchStorage.reset();\n const color = this._runtimeAst.evaluate(feature);\n return Color.fromCartesian4(color, result);\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {String} returnType The return type of the generated function.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nExpression.prototype.getShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n returnType\n) {\n let shaderExpression = this.getShaderExpression(\n variableSubstitutionMap,\n shaderState\n );\n\n shaderExpression =\n `${returnType} ${functionSignature}\\n` +\n `{\\n` +\n ` return ${shaderExpression};\\n` +\n `}\\n`;\n\n return shaderExpression;\n};\n\n/**\n * Gets the shader expression for this expression.\n * Returns undefined if the shader expression can't be generated from this expression.\n *\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {String} The shader expression.\n *\n * @private\n */\nExpression.prototype.getShaderExpression = function (\n variableSubstitutionMap,\n shaderState\n) {\n return this._runtimeAst.getShaderExpression(\n variableSubstitutionMap,\n shaderState\n );\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {String[]} The variables used by the expression.\n *\n * @private\n */\nExpression.prototype.getVariables = function () {\n let variables = [];\n\n this._runtimeAst.getVariables(variables);\n\n // Remove duplicates\n variables = variables.filter(function (variable, index, variables) {\n return variables.indexOf(variable) === index;\n });\n\n return variables;\n};\n\nconst unaryOperators = [\"!\", \"-\", \"+\"];\nconst binaryOperators = [\n \"+\",\n \"-\",\n \"*\",\n \"/\",\n \"%\",\n \"===\",\n \"!==\",\n \">\",\n \">=\",\n \"<\",\n \"<=\",\n \"&&\",\n \"||\",\n \"!~\",\n \"=~\",\n];\n\nconst variableRegex = /\\${(.*?)}/g; // Matches ${variable_name}\nconst backslashRegex = /\\\\/g;\nconst backslashReplacement = \"@#%\";\nconst replacementRegex = /@#%/g;\n\nconst scratchColor = new Color();\n\nconst unaryFunctions = {\n abs: getEvaluateUnaryComponentwise(Math.abs),\n sqrt: getEvaluateUnaryComponentwise(Math.sqrt),\n cos: getEvaluateUnaryComponentwise(Math.cos),\n sin: getEvaluateUnaryComponentwise(Math.sin),\n tan: getEvaluateUnaryComponentwise(Math.tan),\n acos: getEvaluateUnaryComponentwise(Math.acos),\n asin: getEvaluateUnaryComponentwise(Math.asin),\n atan: getEvaluateUnaryComponentwise(Math.atan),\n radians: getEvaluateUnaryComponentwise(CesiumMath.toRadians),\n degrees: getEvaluateUnaryComponentwise(CesiumMath.toDegrees),\n sign: getEvaluateUnaryComponentwise(CesiumMath.sign),\n floor: getEvaluateUnaryComponentwise(Math.floor),\n ceil: getEvaluateUnaryComponentwise(Math.ceil),\n round: getEvaluateUnaryComponentwise(Math.round),\n exp: getEvaluateUnaryComponentwise(Math.exp),\n exp2: getEvaluateUnaryComponentwise(exp2),\n log: getEvaluateUnaryComponentwise(Math.log),\n log2: getEvaluateUnaryComponentwise(log2),\n fract: getEvaluateUnaryComponentwise(fract),\n length: length,\n normalize: normalize,\n};\n\nconst binaryFunctions = {\n atan2: getEvaluateBinaryComponentwise(Math.atan2, false),\n pow: getEvaluateBinaryComponentwise(Math.pow, false),\n min: getEvaluateBinaryComponentwise(Math.min, true),\n max: getEvaluateBinaryComponentwise(Math.max, true),\n distance: distance,\n dot: dot,\n cross: cross,\n};\n\nconst ternaryFunctions = {\n clamp: getEvaluateTernaryComponentwise(CesiumMath.clamp, true),\n mix: getEvaluateTernaryComponentwise(CesiumMath.lerp, true),\n};\n\nfunction fract(number) {\n return number - Math.floor(number);\n}\n\nfunction exp2(exponent) {\n return Math.pow(2.0, exponent);\n}\n\nfunction log2(number) {\n return CesiumMath.log2(number);\n}\n\nfunction getEvaluateUnaryComponentwise(operation) {\n return function (call, left) {\n if (typeof left === \"number\") {\n return operation(left);\n } else if (left instanceof Cartesian2) {\n return Cartesian2.fromElements(\n operation(left.x),\n operation(left.y),\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian3) {\n return Cartesian3.fromElements(\n operation(left.x),\n operation(left.y),\n operation(left.z),\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian4) {\n return Cartesian4.fromElements(\n operation(left.x),\n operation(left.y),\n operation(left.z),\n operation(left.w),\n scratchStorage.getCartesian4()\n );\n }\n throw new RuntimeError(\n `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n );\n };\n}\n\nfunction getEvaluateBinaryComponentwise(operation, allowScalar) {\n return function (call, left, right) {\n if (allowScalar && typeof right === \"number\") {\n if (typeof left === \"number\") {\n return operation(left, right);\n } else if (left instanceof Cartesian2) {\n return Cartesian2.fromElements(\n operation(left.x, right),\n operation(left.y, right),\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian3) {\n return Cartesian3.fromElements(\n operation(left.x, right),\n operation(left.y, right),\n operation(left.z, right),\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian4) {\n return Cartesian4.fromElements(\n operation(left.x, right),\n operation(left.y, right),\n operation(left.z, right),\n operation(left.w, right),\n scratchStorage.getCartesian4()\n );\n }\n }\n\n if (typeof left === \"number\" && typeof right === \"number\") {\n return operation(left, right);\n } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n return Cartesian2.fromElements(\n operation(left.x, right.x),\n operation(left.y, right.y),\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n return Cartesian3.fromElements(\n operation(left.x, right.x),\n operation(left.y, right.y),\n operation(left.z, right.z),\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n return Cartesian4.fromElements(\n operation(left.x, right.x),\n operation(left.y, right.y),\n operation(left.z, right.z),\n operation(left.w, right.w),\n scratchStorage.getCartesian4()\n );\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n );\n };\n}\n\nfunction getEvaluateTernaryComponentwise(operation, allowScalar) {\n return function (call, left, right, test) {\n if (allowScalar && typeof test === \"number\") {\n if (typeof left === \"number\" && typeof right === \"number\") {\n return operation(left, right, test);\n } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n return Cartesian2.fromElements(\n operation(left.x, right.x, test),\n operation(left.y, right.y, test),\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n return Cartesian3.fromElements(\n operation(left.x, right.x, test),\n operation(left.y, right.y, test),\n operation(left.z, right.z, test),\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n return Cartesian4.fromElements(\n operation(left.x, right.x, test),\n operation(left.y, right.y, test),\n operation(left.z, right.z, test),\n operation(left.w, right.w, test),\n scratchStorage.getCartesian4()\n );\n }\n }\n\n if (\n typeof left === \"number\" &&\n typeof right === \"number\" &&\n typeof test === \"number\"\n ) {\n return operation(left, right, test);\n } else if (\n left instanceof Cartesian2 &&\n right instanceof Cartesian2 &&\n test instanceof Cartesian2\n ) {\n return Cartesian2.fromElements(\n operation(left.x, right.x, test.x),\n operation(left.y, right.y, test.y),\n scratchStorage.getCartesian2()\n );\n } else if (\n left instanceof Cartesian3 &&\n right instanceof Cartesian3 &&\n test instanceof Cartesian3\n ) {\n return Cartesian3.fromElements(\n operation(left.x, right.x, test.x),\n operation(left.y, right.y, test.y),\n operation(left.z, right.z, test.z),\n scratchStorage.getCartesian3()\n );\n } else if (\n left instanceof Cartesian4 &&\n right instanceof Cartesian4 &&\n test instanceof Cartesian4\n ) {\n return Cartesian4.fromElements(\n operation(left.x, right.x, test.x),\n operation(left.y, right.y, test.y),\n operation(left.z, right.z, test.z),\n operation(left.w, right.w, test.w),\n scratchStorage.getCartesian4()\n );\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left}, ${right}, and ${test}.`\n );\n };\n}\n\nfunction length(call, left) {\n if (typeof left === \"number\") {\n return Math.abs(left);\n } else if (left instanceof Cartesian2) {\n return Cartesian2.magnitude(left);\n } else if (left instanceof Cartesian3) {\n return Cartesian3.magnitude(left);\n } else if (left instanceof Cartesian4) {\n return Cartesian4.magnitude(left);\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n );\n}\n\nfunction normalize(call, left) {\n if (typeof left === \"number\") {\n return 1.0;\n } else if (left instanceof Cartesian2) {\n return Cartesian2.normalize(left, scratchStorage.getCartesian2());\n } else if (left instanceof Cartesian3) {\n return Cartesian3.normalize(left, scratchStorage.getCartesian3());\n } else if (left instanceof Cartesian4) {\n return Cartesian4.normalize(left, scratchStorage.getCartesian4());\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires a vector or number argument. Argument is ${left}.`\n );\n}\n\nfunction distance(call, left, right) {\n if (typeof left === \"number\" && typeof right === \"number\") {\n return Math.abs(left - right);\n } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n return Cartesian2.distance(left, right);\n } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n return Cartesian3.distance(left, right);\n } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n return Cartesian4.distance(left, right);\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n );\n}\n\nfunction dot(call, left, right) {\n if (typeof left === \"number\" && typeof right === \"number\") {\n return left * right;\n } else if (left instanceof Cartesian2 && right instanceof Cartesian2) {\n return Cartesian2.dot(left, right);\n } else if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n return Cartesian3.dot(left, right);\n } else if (left instanceof Cartesian4 && right instanceof Cartesian4) {\n return Cartesian4.dot(left, right);\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n );\n}\n\nfunction cross(call, left, right) {\n if (left instanceof Cartesian3 && right instanceof Cartesian3) {\n return Cartesian3.cross(left, right, scratchStorage.getCartesian3());\n }\n\n throw new RuntimeError(\n `Function \"${call}\" requires vec3 arguments. Arguments are ${left} and ${right}.`\n );\n}\n\nfunction Node(type, value, left, right, test) {\n this._type = type;\n this._value = value;\n this._left = left;\n this._right = right;\n this._test = test;\n this.evaluate = undefined;\n\n setEvaluateFunction(this);\n}\n\nfunction replaceDefines(expression, defines) {\n if (!defined(defines)) {\n return expression;\n }\n for (const key in defines) {\n if (defines.hasOwnProperty(key)) {\n const definePlaceholder = new RegExp(`\\\\$\\\\{${key}\\\\}`, \"g\");\n const defineReplace = `(${defines[key]})`;\n if (defined(defineReplace)) {\n expression = expression.replace(definePlaceholder, defineReplace);\n }\n }\n }\n return expression;\n}\n\nfunction removeBackslashes(expression) {\n return expression.replace(backslashRegex, backslashReplacement);\n}\n\nfunction replaceBackslashes(expression) {\n return expression.replace(replacementRegex, \"\\\\\");\n}\n\nfunction replaceVariables(expression) {\n let exp = expression;\n let result = \"\";\n let i = exp.indexOf(\"${\");\n while (i >= 0) {\n // Check if string is inside quotes\n const openSingleQuote = exp.indexOf(\"'\");\n const openDoubleQuote = exp.indexOf('\"');\n let closeQuote;\n if (openSingleQuote >= 0 && openSingleQuote < i) {\n closeQuote = exp.indexOf(\"'\", openSingleQuote + 1);\n result += exp.substr(0, closeQuote + 1);\n exp = exp.substr(closeQuote + 1);\n i = exp.indexOf(\"${\");\n } else if (openDoubleQuote >= 0 && openDoubleQuote < i) {\n closeQuote = exp.indexOf('\"', openDoubleQuote + 1);\n result += exp.substr(0, closeQuote + 1);\n exp = exp.substr(closeQuote + 1);\n i = exp.indexOf(\"${\");\n } else {\n result += exp.substr(0, i);\n const j = exp.indexOf(\"}\");\n if (j < 0) {\n throw new RuntimeError(\"Unmatched {.\");\n }\n result += `czm_${exp.substr(i + 2, j - (i + 2))}`;\n exp = exp.substr(j + 1);\n i = exp.indexOf(\"${\");\n }\n }\n result += exp;\n return result;\n}\n\nfunction parseLiteral(ast) {\n const type = typeof ast.value;\n if (ast.value === null) {\n return new Node(ExpressionNodeType.LITERAL_NULL, null);\n } else if (type === \"boolean\") {\n return new Node(ExpressionNodeType.LITERAL_BOOLEAN, ast.value);\n } else if (type === \"number\") {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, ast.value);\n } else if (type === \"string\") {\n if (ast.value.indexOf(\"${\") >= 0) {\n return new Node(ExpressionNodeType.VARIABLE_IN_STRING, ast.value);\n }\n return new Node(\n ExpressionNodeType.LITERAL_STRING,\n replaceBackslashes(ast.value)\n );\n }\n}\n\nfunction parseCall(expression, ast) {\n const args = ast.arguments;\n const argsLength = args.length;\n let call;\n let val, left, right;\n\n // Member function calls\n if (ast.callee.type === \"MemberExpression\") {\n call = ast.callee.property.name;\n const object = ast.callee.object;\n if (call === \"test\" || call === \"exec\") {\n // Make sure this is called on a valid type\n if (object.callee.name !== \"regExp\") {\n throw new RuntimeError(`${call} is not a function.`);\n }\n if (argsLength === 0) {\n if (call === \"test\") {\n return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n }\n return new Node(ExpressionNodeType.LITERAL_NULL, null);\n }\n left = createRuntimeAst(expression, object);\n right = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.FUNCTION_CALL, call, left, right);\n } else if (call === \"toString\") {\n val = createRuntimeAst(expression, object);\n return new Node(ExpressionNodeType.FUNCTION_CALL, call, val);\n }\n\n throw new RuntimeError(`Unexpected function call \"${call}\".`);\n }\n\n // Non-member function calls\n call = ast.callee.name;\n if (call === \"color\") {\n if (argsLength === 0) {\n return new Node(ExpressionNodeType.LITERAL_COLOR, call);\n }\n val = createRuntimeAst(expression, args[0]);\n if (defined(args[1])) {\n const alpha = createRuntimeAst(expression, args[1]);\n return new Node(ExpressionNodeType.LITERAL_COLOR, call, [val, alpha]);\n }\n return new Node(ExpressionNodeType.LITERAL_COLOR, call, [val]);\n } else if (call === \"rgb\" || call === \"hsl\") {\n if (argsLength < 3) {\n throw new RuntimeError(`${call} requires three arguments.`);\n }\n val = [\n createRuntimeAst(expression, args[0]),\n createRuntimeAst(expression, args[1]),\n createRuntimeAst(expression, args[2]),\n ];\n return new Node(ExpressionNodeType.LITERAL_COLOR, call, val);\n } else if (call === \"rgba\" || call === \"hsla\") {\n if (argsLength < 4) {\n throw new RuntimeError(`${call} requires four arguments.`);\n }\n val = [\n createRuntimeAst(expression, args[0]),\n createRuntimeAst(expression, args[1]),\n createRuntimeAst(expression, args[2]),\n createRuntimeAst(expression, args[3]),\n ];\n return new Node(ExpressionNodeType.LITERAL_COLOR, call, val);\n } else if (call === \"vec2\" || call === \"vec3\" || call === \"vec4\") {\n // Check for invalid constructors at evaluation time\n val = new Array(argsLength);\n for (let i = 0; i < argsLength; ++i) {\n val[i] = createRuntimeAst(expression, args[i]);\n }\n return new Node(ExpressionNodeType.LITERAL_VECTOR, call, val);\n } else if (call === \"isNaN\" || call === \"isFinite\") {\n if (argsLength === 0) {\n if (call === \"isNaN\") {\n return new Node(ExpressionNodeType.LITERAL_BOOLEAN, true);\n }\n return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (call === \"isExactClass\" || call === \"isClass\") {\n if (argsLength < 1 || argsLength > 1) {\n throw new RuntimeError(`${call} requires exactly one argument.`);\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (call === \"getExactClassName\") {\n if (argsLength > 0) {\n throw new RuntimeError(`${call} does not take any argument.`);\n }\n return new Node(ExpressionNodeType.UNARY, call);\n } else if (defined(unaryFunctions[call])) {\n if (argsLength !== 1) {\n throw new RuntimeError(`${call} requires exactly one argument.`);\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (defined(binaryFunctions[call])) {\n if (argsLength !== 2) {\n throw new RuntimeError(`${call} requires exactly two arguments.`);\n }\n left = createRuntimeAst(expression, args[0]);\n right = createRuntimeAst(expression, args[1]);\n return new Node(ExpressionNodeType.BINARY, call, left, right);\n } else if (defined(ternaryFunctions[call])) {\n if (argsLength !== 3) {\n throw new RuntimeError(`${call} requires exactly three arguments.`);\n }\n left = createRuntimeAst(expression, args[0]);\n right = createRuntimeAst(expression, args[1]);\n const test = createRuntimeAst(expression, args[2]);\n return new Node(ExpressionNodeType.TERNARY, call, left, right, test);\n } else if (call === \"Boolean\") {\n if (argsLength === 0) {\n return new Node(ExpressionNodeType.LITERAL_BOOLEAN, false);\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (call === \"Number\") {\n if (argsLength === 0) {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, 0);\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (call === \"String\") {\n if (argsLength === 0) {\n return new Node(ExpressionNodeType.LITERAL_STRING, \"\");\n }\n val = createRuntimeAst(expression, args[0]);\n return new Node(ExpressionNodeType.UNARY, call, val);\n } else if (call === \"regExp\") {\n return parseRegex(expression, ast);\n }\n\n throw new RuntimeError(`Unexpected function call \"${call}\".`);\n}\n\nfunction parseRegex(expression, ast) {\n const args = ast.arguments;\n // no arguments, return default regex\n if (args.length === 0) {\n return new Node(ExpressionNodeType.LITERAL_REGEX, new RegExp());\n }\n\n const pattern = createRuntimeAst(expression, args[0]);\n let exp;\n\n // optional flag argument supplied\n if (args.length > 1) {\n const flags = createRuntimeAst(expression, args[1]);\n if (isLiteralType(pattern) && isLiteralType(flags)) {\n try {\n exp = new RegExp(\n replaceBackslashes(String(pattern._value)),\n flags._value\n );\n } catch (e) {\n throw new RuntimeError(e);\n }\n return new Node(ExpressionNodeType.LITERAL_REGEX, exp);\n }\n return new Node(ExpressionNodeType.REGEX, pattern, flags);\n }\n\n // only pattern argument supplied\n if (isLiteralType(pattern)) {\n try {\n exp = new RegExp(replaceBackslashes(String(pattern._value)));\n } catch (e) {\n throw new RuntimeError(e);\n }\n return new Node(ExpressionNodeType.LITERAL_REGEX, exp);\n }\n return new Node(ExpressionNodeType.REGEX, pattern);\n}\n\nfunction parseKeywordsAndVariables(ast) {\n if (isVariable(ast.name)) {\n const name = getPropertyName(ast.name);\n if (name.substr(0, 8) === \"tiles3d_\") {\n return new Node(ExpressionNodeType.BUILTIN_VARIABLE, name);\n }\n return new Node(ExpressionNodeType.VARIABLE, name);\n } else if (ast.name === \"NaN\") {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, NaN);\n } else if (ast.name === \"Infinity\") {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, Infinity);\n } else if (ast.name === \"undefined\") {\n return new Node(ExpressionNodeType.LITERAL_UNDEFINED, undefined);\n }\n\n throw new RuntimeError(`${ast.name} is not defined.`);\n}\n\nfunction parseMathConstant(ast) {\n const name = ast.property.name;\n if (name === \"PI\") {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, Math.PI);\n } else if (name === \"E\") {\n return new Node(ExpressionNodeType.LITERAL_NUMBER, Math.E);\n }\n}\n\nfunction parseNumberConstant(ast) {\n const name = ast.property.name;\n if (name === \"POSITIVE_INFINITY\") {\n return new Node(\n ExpressionNodeType.LITERAL_NUMBER,\n Number.POSITIVE_INFINITY\n );\n }\n}\n\nfunction parseMemberExpression(expression, ast) {\n if (ast.object.name === \"Math\") {\n return parseMathConstant(ast);\n } else if (ast.object.name === \"Number\") {\n return parseNumberConstant(ast);\n }\n\n let val;\n const obj = createRuntimeAst(expression, ast.object);\n if (ast.computed) {\n val = createRuntimeAst(expression, ast.property);\n return new Node(ExpressionNodeType.MEMBER, \"brackets\", obj, val);\n }\n\n val = new Node(ExpressionNodeType.LITERAL_STRING, ast.property.name);\n return new Node(ExpressionNodeType.MEMBER, \"dot\", obj, val);\n}\n\nfunction isLiteralType(node) {\n return node._type >= ExpressionNodeType.LITERAL_NULL;\n}\n\nfunction isVariable(name) {\n return name.substr(0, 4) === \"czm_\";\n}\n\nfunction getPropertyName(variable) {\n return variable.substr(4);\n}\n\nfunction createRuntimeAst(expression, ast) {\n let node;\n let op;\n let left;\n let right;\n\n if (ast.type === \"Literal\") {\n node = parseLiteral(ast);\n } else if (ast.type === \"CallExpression\") {\n node = parseCall(expression, ast);\n } else if (ast.type === \"Identifier\") {\n node = parseKeywordsAndVariables(ast);\n } else if (ast.type === \"UnaryExpression\") {\n op = ast.operator;\n const child = createRuntimeAst(expression, ast.argument);\n if (unaryOperators.indexOf(op) > -1) {\n node = new Node(ExpressionNodeType.UNARY, op, child);\n } else {\n throw new RuntimeError(`Unexpected operator \"${op}\".`);\n }\n } else if (ast.type === \"BinaryExpression\") {\n op = ast.operator;\n left = createRuntimeAst(expression, ast.left);\n right = createRuntimeAst(expression, ast.right);\n if (binaryOperators.indexOf(op) > -1) {\n node = new Node(ExpressionNodeType.BINARY, op, left, right);\n } else {\n throw new RuntimeError(`Unexpected operator \"${op}\".`);\n }\n } else if (ast.type === \"LogicalExpression\") {\n op = ast.operator;\n left = createRuntimeAst(expression, ast.left);\n right = createRuntimeAst(expression, ast.right);\n if (binaryOperators.indexOf(op) > -1) {\n node = new Node(ExpressionNodeType.BINARY, op, left, right);\n }\n } else if (ast.type === \"ConditionalExpression\") {\n const test = createRuntimeAst(expression, ast.test);\n left = createRuntimeAst(expression, ast.consequent);\n right = createRuntimeAst(expression, ast.alternate);\n node = new Node(ExpressionNodeType.CONDITIONAL, \"?\", left, right, test);\n } else if (ast.type === \"MemberExpression\") {\n node = parseMemberExpression(expression, ast);\n } else if (ast.type === \"ArrayExpression\") {\n const val = [];\n for (let i = 0; i < ast.elements.length; i++) {\n val[i] = createRuntimeAst(expression, ast.elements[i]);\n }\n node = new Node(ExpressionNodeType.ARRAY, val);\n } else if (ast.type === \"Compound\") {\n // empty expression or multiple expressions\n throw new RuntimeError(\"Provide exactly one expression.\");\n } else {\n throw new RuntimeError(\"Cannot parse expression.\");\n }\n\n return node;\n}\n\nfunction setEvaluateFunction(node) {\n if (node._type === ExpressionNodeType.CONDITIONAL) {\n node.evaluate = node._evaluateConditional;\n } else if (node._type === ExpressionNodeType.FUNCTION_CALL) {\n if (node._value === \"test\") {\n node.evaluate = node._evaluateRegExpTest;\n } else if (node._value === \"exec\") {\n node.evaluate = node._evaluateRegExpExec;\n } else if (node._value === \"toString\") {\n node.evaluate = node._evaluateToString;\n }\n } else if (node._type === ExpressionNodeType.UNARY) {\n if (node._value === \"!\") {\n node.evaluate = node._evaluateNot;\n } else if (node._value === \"-\") {\n node.evaluate = node._evaluateNegative;\n } else if (node._value === \"+\") {\n node.evaluate = node._evaluatePositive;\n } else if (node._value === \"isNaN\") {\n node.evaluate = node._evaluateNaN;\n } else if (node._value === \"isFinite\") {\n node.evaluate = node._evaluateIsFinite;\n } else if (node._value === \"isExactClass\") {\n node.evaluate = node._evaluateIsExactClass;\n } else if (node._value === \"isClass\") {\n node.evaluate = node._evaluateIsClass;\n } else if (node._value === \"getExactClassName\") {\n node.evaluate = node._evaluateGetExactClassName;\n } else if (node._value === \"Boolean\") {\n node.evaluate = node._evaluateBooleanConversion;\n } else if (node._value === \"Number\") {\n node.evaluate = node._evaluateNumberConversion;\n } else if (node._value === \"String\") {\n node.evaluate = node._evaluateStringConversion;\n } else if (defined(unaryFunctions[node._value])) {\n node.evaluate = getEvaluateUnaryFunction(node._value);\n }\n } else if (node._type === ExpressionNodeType.BINARY) {\n if (node._value === \"+\") {\n node.evaluate = node._evaluatePlus;\n } else if (node._value === \"-\") {\n node.evaluate = node._evaluateMinus;\n } else if (node._value === \"*\") {\n node.evaluate = node._evaluateTimes;\n } else if (node._value === \"/\") {\n node.evaluate = node._evaluateDivide;\n } else if (node._value === \"%\") {\n node.evaluate = node._evaluateMod;\n } else if (node._value === \"===\") {\n node.evaluate = node._evaluateEqualsStrict;\n } else if (node._value === \"!==\") {\n node.evaluate = node._evaluateNotEqualsStrict;\n } else if (node._value === \"<\") {\n node.evaluate = node._evaluateLessThan;\n } else if (node._value === \"<=\") {\n node.evaluate = node._evaluateLessThanOrEquals;\n } else if (node._value === \">\") {\n node.evaluate = node._evaluateGreaterThan;\n } else if (node._value === \">=\") {\n node.evaluate = node._evaluateGreaterThanOrEquals;\n } else if (node._value === \"&&\") {\n node.evaluate = node._evaluateAnd;\n } else if (node._value === \"||\") {\n node.evaluate = node._evaluateOr;\n } else if (node._value === \"=~\") {\n node.evaluate = node._evaluateRegExpMatch;\n } else if (node._value === \"!~\") {\n node.evaluate = node._evaluateRegExpNotMatch;\n } else if (defined(binaryFunctions[node._value])) {\n node.evaluate = getEvaluateBinaryFunction(node._value);\n }\n } else if (node._type === ExpressionNodeType.TERNARY) {\n node.evaluate = getEvaluateTernaryFunction(node._value);\n } else if (node._type === ExpressionNodeType.MEMBER) {\n if (node._value === \"brackets\") {\n node.evaluate = node._evaluateMemberBrackets;\n } else {\n node.evaluate = node._evaluateMemberDot;\n }\n } else if (node._type === ExpressionNodeType.ARRAY) {\n node.evaluate = node._evaluateArray;\n } else if (node._type === ExpressionNodeType.VARIABLE) {\n node.evaluate = node._evaluateVariable;\n } else if (node._type === ExpressionNodeType.VARIABLE_IN_STRING) {\n node.evaluate = node._evaluateVariableString;\n } else if (node._type === ExpressionNodeType.LITERAL_COLOR) {\n node.evaluate = node._evaluateLiteralColor;\n } else if (node._type === ExpressionNodeType.LITERAL_VECTOR) {\n node.evaluate = node._evaluateLiteralVector;\n } else if (node._type === ExpressionNodeType.LITERAL_STRING) {\n node.evaluate = node._evaluateLiteralString;\n } else if (node._type === ExpressionNodeType.REGEX) {\n node.evaluate = node._evaluateRegExp;\n } else if (node._type === ExpressionNodeType.BUILTIN_VARIABLE) {\n if (node._value === \"tiles3d_tileset_time\") {\n node.evaluate = evaluateTilesetTime;\n }\n } else {\n node.evaluate = node._evaluateLiteral;\n }\n}\n\nfunction evaluateTilesetTime(feature) {\n if (!defined(feature)) {\n return 0.0;\n }\n return feature.content.tileset.timeSinceLoad;\n}\n\nfunction getEvaluateUnaryFunction(call) {\n const evaluate = unaryFunctions[call];\n return function (feature) {\n const left = this._left.evaluate(feature);\n return evaluate(call, left);\n };\n}\n\nfunction getEvaluateBinaryFunction(call) {\n const evaluate = binaryFunctions[call];\n return function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n return evaluate(call, left, right);\n };\n}\n\nfunction getEvaluateTernaryFunction(call) {\n const evaluate = ternaryFunctions[call];\n return function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n const test = this._test.evaluate(feature);\n return evaluate(call, left, right, test);\n };\n}\n\nfunction getFeatureProperty(feature, name) {\n // Returns undefined if the feature is not defined or the property name is not defined for that feature\n if (defined(feature)) {\n return feature.getPropertyInherited(name);\n }\n}\n\nNode.prototype._evaluateLiteral = function () {\n return this._value;\n};\n\nNode.prototype._evaluateLiteralColor = function (feature) {\n const color = scratchColor;\n const args = this._left;\n if (this._value === \"color\") {\n if (!defined(args)) {\n Color.fromBytes(255, 255, 255, 255, color);\n } else if (args.length > 1) {\n Color.fromCssColorString(args[0].evaluate(feature), color);\n color.alpha = args[1].evaluate(feature);\n } else {\n Color.fromCssColorString(args[0].evaluate(feature), color);\n }\n } else if (this._value === \"rgb\") {\n Color.fromBytes(\n args[0].evaluate(feature),\n args[1].evaluate(feature),\n args[2].evaluate(feature),\n 255,\n color\n );\n } else if (this._value === \"rgba\") {\n // convert between css alpha (0 to 1) and cesium alpha (0 to 255)\n const a = args[3].evaluate(feature) * 255;\n Color.fromBytes(\n args[0].evaluate(feature),\n args[1].evaluate(feature),\n args[2].evaluate(feature),\n a,\n color\n );\n } else if (this._value === \"hsl\") {\n Color.fromHsl(\n args[0].evaluate(feature),\n args[1].evaluate(feature),\n args[2].evaluate(feature),\n 1.0,\n color\n );\n } else if (this._value === \"hsla\") {\n Color.fromHsl(\n args[0].evaluate(feature),\n args[1].evaluate(feature),\n args[2].evaluate(feature),\n args[3].evaluate(feature),\n color\n );\n }\n return Cartesian4.fromColor(color, scratchStorage.getCartesian4());\n};\n\nNode.prototype._evaluateLiteralVector = function (feature) {\n // Gather the components that make up the vector, which includes components from interior vectors.\n // For example vec3(1, 2, 3) or vec3(vec2(1, 2), 3) are both valid.\n //\n // If the number of components does not equal the vector's size, then a RuntimeError is thrown - with two exceptions:\n // 1. A vector may be constructed from a larger vector and drop the extra components.\n // 2. A vector may be constructed from a single component - vec3(1) will become vec3(1, 1, 1).\n //\n // Examples of invalid constructors include:\n // vec4(1, 2) // not enough components\n // vec3(vec2(1, 2)) // not enough components\n // vec3(1, 2, 3, 4) // too many components\n // vec2(vec4(1), 1) // too many components\n\n const components = scratchStorage.getArray();\n const call = this._value;\n const args = this._left;\n const argsLength = args.length;\n for (let i = 0; i < argsLength; ++i) {\n const value = args[i].evaluate(feature);\n if (typeof value === \"number\") {\n components.push(value);\n } else if (value instanceof Cartesian2) {\n components.push(value.x, value.y);\n } else if (value instanceof Cartesian3) {\n components.push(value.x, value.y, value.z);\n } else if (value instanceof Cartesian4) {\n components.push(value.x, value.y, value.z, value.w);\n } else {\n throw new RuntimeError(\n `${call} argument must be a vector or number. Argument is ${value}.`\n );\n }\n }\n\n const componentsLength = components.length;\n const vectorLength = parseInt(call.charAt(3));\n\n if (componentsLength === 0) {\n throw new RuntimeError(`Invalid ${call} constructor. No valid arguments.`);\n } else if (componentsLength < vectorLength && componentsLength > 1) {\n throw new RuntimeError(\n `Invalid ${call} constructor. Not enough arguments.`\n );\n } else if (componentsLength > vectorLength && argsLength > 1) {\n throw new RuntimeError(`Invalid ${call} constructor. Too many arguments.`);\n }\n\n if (componentsLength === 1) {\n // Add the same component 3 more times\n const component = components[0];\n components.push(component, component, component);\n }\n\n if (call === \"vec2\") {\n return Cartesian2.fromArray(components, 0, scratchStorage.getCartesian2());\n } else if (call === \"vec3\") {\n return Cartesian3.fromArray(components, 0, scratchStorage.getCartesian3());\n } else if (call === \"vec4\") {\n return Cartesian4.fromArray(components, 0, scratchStorage.getCartesian4());\n }\n};\n\nNode.prototype._evaluateLiteralString = function () {\n return this._value;\n};\n\nNode.prototype._evaluateVariableString = function (feature) {\n let result = this._value;\n let match = variableRegex.exec(result);\n while (match !== null) {\n const placeholder = match[0];\n const variableName = match[1];\n let property = getFeatureProperty(feature, variableName);\n if (!defined(property)) {\n property = \"\";\n }\n result = result.replace(placeholder, property);\n match = variableRegex.exec(result);\n }\n return result;\n};\n\nNode.prototype._evaluateVariable = function (feature) {\n // evaluates to undefined if the property name is not defined for that feature\n return getFeatureProperty(feature, this._value);\n};\n\nfunction checkFeature(ast) {\n return ast._value === \"feature\";\n}\n\n// PERFORMANCE_IDEA: Determine if parent property needs to be computed before runtime\nNode.prototype._evaluateMemberDot = function (feature) {\n if (checkFeature(this._left)) {\n return getFeatureProperty(feature, this._right.evaluate(feature));\n }\n const property = this._left.evaluate(feature);\n if (!defined(property)) {\n return undefined;\n }\n\n const member = this._right.evaluate(feature);\n if (\n property instanceof Cartesian2 ||\n property instanceof Cartesian3 ||\n property instanceof Cartesian4\n ) {\n // Vector components may be accessed with .r, .g, .b, .a and implicitly with .x, .y, .z, .w\n if (member === \"r\") {\n return property.x;\n } else if (member === \"g\") {\n return property.y;\n } else if (member === \"b\") {\n return property.z;\n } else if (member === \"a\") {\n return property.w;\n }\n }\n return property[member];\n};\n\nNode.prototype._evaluateMemberBrackets = function (feature) {\n if (checkFeature(this._left)) {\n return getFeatureProperty(feature, this._right.evaluate(feature));\n }\n const property = this._left.evaluate(feature);\n if (!defined(property)) {\n return undefined;\n }\n\n const member = this._right.evaluate(feature);\n if (\n property instanceof Cartesian2 ||\n property instanceof Cartesian3 ||\n property instanceof Cartesian4\n ) {\n // Vector components may be accessed with [0][1][2][3], ['r']['g']['b']['a'] and implicitly with ['x']['y']['z']['w']\n // For Cartesian2 and Cartesian3 out-of-range components will just return undefined\n if (member === 0 || member === \"r\") {\n return property.x;\n } else if (member === 1 || member === \"g\") {\n return property.y;\n } else if (member === 2 || member === \"b\") {\n return property.z;\n } else if (member === 3 || member === \"a\") {\n return property.w;\n }\n }\n return property[member];\n};\n\nNode.prototype._evaluateArray = function (feature) {\n const array = [];\n for (let i = 0; i < this._value.length; i++) {\n array[i] = this._value[i].evaluate(feature);\n }\n return array;\n};\n\n// PERFORMANCE_IDEA: Have \"fast path\" functions that deal only with specific types\n// that we can assign if we know the types before runtime\n\nNode.prototype._evaluateNot = function (feature) {\n const left = this._left.evaluate(feature);\n if (typeof left !== \"boolean\") {\n throw new RuntimeError(\n `Operator \"!\" requires a boolean argument. Argument is ${left}.`\n );\n }\n return !left;\n};\n\nNode.prototype._evaluateNegative = function (feature) {\n const left = this._left.evaluate(feature);\n if (left instanceof Cartesian2) {\n return Cartesian2.negate(left, scratchStorage.getCartesian2());\n } else if (left instanceof Cartesian3) {\n return Cartesian3.negate(left, scratchStorage.getCartesian3());\n } else if (left instanceof Cartesian4) {\n return Cartesian4.negate(left, scratchStorage.getCartesian4());\n } else if (typeof left === \"number\") {\n return -left;\n }\n\n throw new RuntimeError(\n `Operator \"-\" requires a vector or number argument. Argument is ${left}.`\n );\n};\n\nNode.prototype._evaluatePositive = function (feature) {\n const left = this._left.evaluate(feature);\n\n if (\n !(\n left instanceof Cartesian2 ||\n left instanceof Cartesian3 ||\n left instanceof Cartesian4 ||\n typeof left === \"number\"\n )\n ) {\n throw new RuntimeError(\n `Operator \"+\" requires a vector or number argument. Argument is ${left}.`\n );\n }\n\n return left;\n};\n\nNode.prototype._evaluateLessThan = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (typeof left !== \"number\" || typeof right !== \"number\") {\n throw new RuntimeError(\n `Operator \"<\" requires number arguments. Arguments are ${left} and ${right}.`\n );\n }\n\n return left < right;\n};\n\nNode.prototype._evaluateLessThanOrEquals = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (typeof left !== \"number\" || typeof right !== \"number\") {\n throw new RuntimeError(\n `Operator \"<=\" requires number arguments. Arguments are ${left} and ${right}.`\n );\n }\n\n return left <= right;\n};\n\nNode.prototype._evaluateGreaterThan = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (typeof left !== \"number\" || typeof right !== \"number\") {\n throw new RuntimeError(\n `Operator \">\" requires number arguments. Arguments are ${left} and ${right}.`\n );\n }\n\n return left > right;\n};\n\nNode.prototype._evaluateGreaterThanOrEquals = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (typeof left !== \"number\" || typeof right !== \"number\") {\n throw new RuntimeError(\n `Operator \">=\" requires number arguments. Arguments are ${left} and ${right}.`\n );\n }\n\n return left >= right;\n};\n\nNode.prototype._evaluateOr = function (feature) {\n const left = this._left.evaluate(feature);\n if (typeof left !== \"boolean\") {\n throw new RuntimeError(\n `Operator \"||\" requires boolean arguments. First argument is ${left}.`\n );\n }\n\n // short circuit the expression\n if (left) {\n return true;\n }\n\n const right = this._right.evaluate(feature);\n if (typeof right !== \"boolean\") {\n throw new RuntimeError(\n `Operator \"||\" requires boolean arguments. Second argument is ${right}.`\n );\n }\n\n return left || right;\n};\n\nNode.prototype._evaluateAnd = function (feature) {\n const left = this._left.evaluate(feature);\n if (typeof left !== \"boolean\") {\n throw new RuntimeError(\n `Operator \"&&\" requires boolean arguments. First argument is ${left}.`\n );\n }\n\n // short circuit the expression\n if (!left) {\n return false;\n }\n\n const right = this._right.evaluate(feature);\n if (typeof right !== \"boolean\") {\n throw new RuntimeError(\n `Operator \"&&\" requires boolean arguments. Second argument is ${right}.`\n );\n }\n\n return left && right;\n};\n\nNode.prototype._evaluatePlus = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n return Cartesian2.add(left, right, scratchStorage.getCartesian2());\n } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n return Cartesian3.add(left, right, scratchStorage.getCartesian3());\n } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n return Cartesian4.add(left, right, scratchStorage.getCartesian4());\n } else if (typeof left === \"string\" || typeof right === \"string\") {\n // If only one argument is a string the other argument calls its toString function.\n return left + right;\n } else if (typeof left === \"number\" && typeof right === \"number\") {\n return left + right;\n }\n\n throw new RuntimeError(\n `Operator \"+\" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateMinus = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n return Cartesian2.subtract(left, right, scratchStorage.getCartesian2());\n } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n return Cartesian3.subtract(left, right, scratchStorage.getCartesian3());\n } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n return Cartesian4.subtract(left, right, scratchStorage.getCartesian4());\n } else if (typeof left === \"number\" && typeof right === \"number\") {\n return left - right;\n }\n\n throw new RuntimeError(\n `Operator \"-\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateTimes = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n return Cartesian2.multiplyComponents(\n left,\n right,\n scratchStorage.getCartesian2()\n );\n } else if (right instanceof Cartesian2 && typeof left === \"number\") {\n return Cartesian2.multiplyByScalar(\n right,\n left,\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian2 && typeof right === \"number\") {\n return Cartesian2.multiplyByScalar(\n left,\n right,\n scratchStorage.getCartesian2()\n );\n } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n return Cartesian3.multiplyComponents(\n left,\n right,\n scratchStorage.getCartesian3()\n );\n } else if (right instanceof Cartesian3 && typeof left === \"number\") {\n return Cartesian3.multiplyByScalar(\n right,\n left,\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian3 && typeof right === \"number\") {\n return Cartesian3.multiplyByScalar(\n left,\n right,\n scratchStorage.getCartesian3()\n );\n } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n return Cartesian4.multiplyComponents(\n left,\n right,\n scratchStorage.getCartesian4()\n );\n } else if (right instanceof Cartesian4 && typeof left === \"number\") {\n return Cartesian4.multiplyByScalar(\n right,\n left,\n scratchStorage.getCartesian4()\n );\n } else if (left instanceof Cartesian4 && typeof right === \"number\") {\n return Cartesian4.multiplyByScalar(\n left,\n right,\n scratchStorage.getCartesian4()\n );\n } else if (typeof left === \"number\" && typeof right === \"number\") {\n return left * right;\n }\n\n throw new RuntimeError(\n `Operator \"*\" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateDivide = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n return Cartesian2.divideComponents(\n left,\n right,\n scratchStorage.getCartesian2()\n );\n } else if (left instanceof Cartesian2 && typeof right === \"number\") {\n return Cartesian2.divideByScalar(\n left,\n right,\n scratchStorage.getCartesian2()\n );\n } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n return Cartesian3.divideComponents(\n left,\n right,\n scratchStorage.getCartesian3()\n );\n } else if (left instanceof Cartesian3 && typeof right === \"number\") {\n return Cartesian3.divideByScalar(\n left,\n right,\n scratchStorage.getCartesian3()\n );\n } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n return Cartesian4.divideComponents(\n left,\n right,\n scratchStorage.getCartesian4()\n );\n } else if (left instanceof Cartesian4 && typeof right === \"number\") {\n return Cartesian4.divideByScalar(\n left,\n right,\n scratchStorage.getCartesian4()\n );\n } else if (typeof left === \"number\" && typeof right === \"number\") {\n return left / right;\n }\n\n throw new RuntimeError(\n `Operator \"/\" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateMod = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (right instanceof Cartesian2 && left instanceof Cartesian2) {\n return Cartesian2.fromElements(\n left.x % right.x,\n left.y % right.y,\n scratchStorage.getCartesian2()\n );\n } else if (right instanceof Cartesian3 && left instanceof Cartesian3) {\n return Cartesian3.fromElements(\n left.x % right.x,\n left.y % right.y,\n left.z % right.z,\n scratchStorage.getCartesian3()\n );\n } else if (right instanceof Cartesian4 && left instanceof Cartesian4) {\n return Cartesian4.fromElements(\n left.x % right.x,\n left.y % right.y,\n left.z % right.z,\n left.w % right.w,\n scratchStorage.getCartesian4()\n );\n } else if (typeof left === \"number\" && typeof right === \"number\") {\n return left % right;\n }\n\n throw new RuntimeError(\n `Operator \"%\" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateEqualsStrict = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (\n (right instanceof Cartesian2 && left instanceof Cartesian2) ||\n (right instanceof Cartesian3 && left instanceof Cartesian3) ||\n (right instanceof Cartesian4 && left instanceof Cartesian4)\n ) {\n return left.equals(right);\n }\n return left === right;\n};\n\nNode.prototype._evaluateNotEqualsStrict = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n if (\n (right instanceof Cartesian2 && left instanceof Cartesian2) ||\n (right instanceof Cartesian3 && left instanceof Cartesian3) ||\n (right instanceof Cartesian4 && left instanceof Cartesian4)\n ) {\n return !left.equals(right);\n }\n return left !== right;\n};\n\nNode.prototype._evaluateConditional = function (feature) {\n const test = this._test.evaluate(feature);\n\n if (typeof test !== \"boolean\") {\n throw new RuntimeError(\n `Conditional argument of conditional expression must be a boolean. Argument is ${test}.`\n );\n }\n\n if (test) {\n return this._left.evaluate(feature);\n }\n return this._right.evaluate(feature);\n};\n\nNode.prototype._evaluateNaN = function (feature) {\n return isNaN(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateIsFinite = function (feature) {\n return isFinite(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateIsExactClass = function (feature) {\n if (defined(feature)) {\n return feature.isExactClass(this._left.evaluate(feature));\n }\n return false;\n};\n\nNode.prototype._evaluateIsClass = function (feature) {\n if (defined(feature)) {\n return feature.isClass(this._left.evaluate(feature));\n }\n return false;\n};\n\nNode.prototype._evaluateGetExactClassName = function (feature) {\n if (defined(feature)) {\n return feature.getExactClassName();\n }\n};\n\nNode.prototype._evaluateBooleanConversion = function (feature) {\n return Boolean(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateNumberConversion = function (feature) {\n return Number(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateStringConversion = function (feature) {\n return String(this._left.evaluate(feature));\n};\n\nNode.prototype._evaluateRegExp = function (feature) {\n const pattern = this._value.evaluate(feature);\n let flags = \"\";\n\n if (defined(this._left)) {\n flags = this._left.evaluate(feature);\n }\n\n let exp;\n try {\n exp = new RegExp(pattern, flags);\n } catch (e) {\n throw new RuntimeError(e);\n }\n return exp;\n};\n\nNode.prototype._evaluateRegExpTest = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (!(left instanceof RegExp && typeof right === \"string\")) {\n throw new RuntimeError(\n `RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`\n );\n }\n\n return left.test(right);\n};\n\nNode.prototype._evaluateRegExpMatch = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (left instanceof RegExp && typeof right === \"string\") {\n return left.test(right);\n } else if (right instanceof RegExp && typeof left === \"string\") {\n return right.test(left);\n }\n\n throw new RuntimeError(\n `Operator \"=~\" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateRegExpNotMatch = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (left instanceof RegExp && typeof right === \"string\") {\n return !left.test(right);\n } else if (right instanceof RegExp && typeof left === \"string\") {\n return !right.test(left);\n }\n\n throw new RuntimeError(\n `Operator \"!~\" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`\n );\n};\n\nNode.prototype._evaluateRegExpExec = function (feature) {\n const left = this._left.evaluate(feature);\n const right = this._right.evaluate(feature);\n\n if (!(left instanceof RegExp && typeof right === \"string\")) {\n throw new RuntimeError(\n `RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`\n );\n }\n\n const exec = left.exec(right);\n if (!defined(exec)) {\n return null;\n }\n return exec[1];\n};\n\nNode.prototype._evaluateToString = function (feature) {\n const left = this._left.evaluate(feature);\n if (\n left instanceof RegExp ||\n left instanceof Cartesian2 ||\n left instanceof Cartesian3 ||\n left instanceof Cartesian4\n ) {\n return String(left);\n }\n\n throw new RuntimeError(`Unexpected function call \"${this._value}\".`);\n};\n\nfunction convertHSLToRGB(ast) {\n // Check if the color contains any nested expressions to see if the color can be converted here.\n // E.g. \"hsl(0.9, 0.6, 0.7)\" is able to convert directly to rgb, \"hsl(0.9, 0.6, ${Height})\" is not.\n const channels = ast._left;\n const length = channels.length;\n for (let i = 0; i < length; ++i) {\n if (channels[i]._type !== ExpressionNodeType.LITERAL_NUMBER) {\n return undefined;\n }\n }\n const h = channels[0]._value;\n const s = channels[1]._value;\n const l = channels[2]._value;\n const a = length === 4 ? channels[3]._value : 1.0;\n return Color.fromHsl(h, s, l, a, scratchColor);\n}\n\nfunction convertRGBToColor(ast) {\n // Check if the color contains any nested expressions to see if the color can be converted here.\n // E.g. \"rgb(255, 255, 255)\" is able to convert directly to Color, \"rgb(255, 255, ${Height})\" is not.\n const channels = ast._left;\n const length = channels.length;\n for (let i = 0; i < length; ++i) {\n if (channels[i]._type !== ExpressionNodeType.LITERAL_NUMBER) {\n return undefined;\n }\n }\n const color = scratchColor;\n color.red = channels[0]._value / 255.0;\n color.green = channels[1]._value / 255.0;\n color.blue = channels[2]._value / 255.0;\n color.alpha = length === 4 ? channels[3]._value : 1.0;\n return color;\n}\n\nfunction numberToString(number) {\n if (number % 1 === 0) {\n // Add a .0 to whole numbers\n return number.toFixed(1);\n }\n\n return number.toString();\n}\n\nfunction colorToVec3(color) {\n const r = numberToString(color.red);\n const g = numberToString(color.green);\n const b = numberToString(color.blue);\n return `vec3(${r}, ${g}, ${b})`;\n}\n\nfunction colorToVec4(color) {\n const r = numberToString(color.red);\n const g = numberToString(color.green);\n const b = numberToString(color.blue);\n const a = numberToString(color.alpha);\n return `vec4(${r}, ${g}, ${b}, ${a})`;\n}\n\nfunction getExpressionArray(\n array,\n variableSubstitutionMap,\n shaderState,\n parent\n) {\n const length = array.length;\n const expressions = new Array(length);\n for (let i = 0; i < length; ++i) {\n expressions[i] = array[i].getShaderExpression(\n variableSubstitutionMap,\n shaderState,\n parent\n );\n }\n return expressions;\n}\n\nfunction getVariableName(variableName, variableSubstitutionMap) {\n if (!defined(variableSubstitutionMap[variableName])) {\n return Expression.NULL_SENTINEL;\n }\n\n return variableSubstitutionMap[variableName];\n}\n\n/**\n * @private\n */\nExpression.NULL_SENTINEL = \"czm_infinity\"; // null just needs to be some sentinel value that will cause \"[expression] === null\" to be false in nearly all cases. GLSL doesn't have a NaN constant so use czm_infinity.\n\nNode.prototype.getShaderExpression = function (\n variableSubstitutionMap,\n shaderState,\n parent\n) {\n let color;\n let left;\n let right;\n let test;\n\n const type = this._type;\n let value = this._value;\n\n if (defined(this._left)) {\n if (Array.isArray(this._left)) {\n // Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR\n left = getExpressionArray(\n this._left,\n variableSubstitutionMap,\n shaderState,\n this\n );\n } else {\n left = this._left.getShaderExpression(\n variableSubstitutionMap,\n shaderState,\n this\n );\n }\n }\n\n if (defined(this._right)) {\n right = this._right.getShaderExpression(\n variableSubstitutionMap,\n shaderState,\n this\n );\n }\n\n if (defined(this._test)) {\n test = this._test.getShaderExpression(\n variableSubstitutionMap,\n shaderState,\n this\n );\n }\n\n if (Array.isArray(this._value)) {\n // For ARRAY type\n value = getExpressionArray(\n this._value,\n variableSubstitutionMap,\n shaderState,\n this\n );\n }\n\n let args;\n let length;\n let vectorExpression;\n switch (type) {\n case ExpressionNodeType.VARIABLE:\n if (checkFeature(this)) {\n return undefined;\n }\n return getVariableName(value, variableSubstitutionMap);\n case ExpressionNodeType.UNARY:\n // Supported types: +, -, !, Boolean, Number\n if (value === \"Boolean\") {\n return `bool(${left})`;\n } else if (value === \"Number\") {\n return `float(${left})`;\n } else if (value === \"round\") {\n return `floor(${left} + 0.5)`;\n } else if (defined(unaryFunctions[value])) {\n return `${value}(${left})`;\n } else if (value === \"isNaN\") {\n // In GLSL 2.0 use isnan instead\n return `(${left} != ${left})`;\n } else if (value === \"isFinite\") {\n // In GLSL 2.0 use isinf instead. GLSL doesn't have an infinity constant so use czm_infinity which is an arbitrarily big enough number.\n return `(abs(${left}) < czm_infinity)`;\n } else if (\n value === \"String\" ||\n value === \"isExactClass\" ||\n value === \"isClass\" ||\n value === \"getExactClassName\"\n ) {\n throw new RuntimeError(\n `Error generating style shader: \"${value}\" is not supported.`\n );\n }\n return value + left;\n case ExpressionNodeType.BINARY:\n // Supported types: ||, &&, ===, !==, <, >, <=, >=, +, -, *, /, %\n if (value === \"%\") {\n return `mod(${left}, ${right})`;\n } else if (value === \"===\") {\n return `(${left} == ${right})`;\n } else if (value === \"!==\") {\n return `(${left} != ${right})`;\n } else if (value === \"atan2\") {\n return `atan(${left}, ${right})`;\n } else if (defined(binaryFunctions[value])) {\n return `${value}(${left}, ${right})`;\n }\n return `(${left} ${value} ${right})`;\n case ExpressionNodeType.TERNARY:\n if (defined(ternaryFunctions[value])) {\n return `${value}(${left}, ${right}, ${test})`;\n }\n break;\n case ExpressionNodeType.CONDITIONAL:\n return `(${test} ? ${left} : ${right})`;\n case ExpressionNodeType.MEMBER:\n if (checkFeature(this._left)) {\n return getVariableName(right, variableSubstitutionMap);\n }\n // This is intended for accessing the components of vector properties. String members aren't supported.\n // Check for 0.0 rather than 0 because all numbers are previously converted to decimals.\n if (right === \"r\" || right === \"x\" || right === \"0.0\") {\n return `${left}[0]`;\n } else if (right === \"g\" || right === \"y\" || right === \"1.0\") {\n return `${left}[1]`;\n } else if (right === \"b\" || right === \"z\" || right === \"2.0\") {\n return `${left}[2]`;\n } else if (right === \"a\" || right === \"w\" || right === \"3.0\") {\n return `${left}[3]`;\n }\n return `${left}[int(${right})]`;\n case ExpressionNodeType.FUNCTION_CALL:\n throw new RuntimeError(\n `Error generating style shader: \"${value}\" is not supported.`\n );\n case ExpressionNodeType.ARRAY:\n if (value.length === 4) {\n return `vec4(${value[0]}, ${value[1]}, ${value[2]}, ${value[3]})`;\n } else if (value.length === 3) {\n return `vec3(${value[0]}, ${value[1]}, ${value[2]})`;\n } else if (value.length === 2) {\n return `vec2(${value[0]}, ${value[1]})`;\n }\n throw new RuntimeError(\n \"Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.\"\n );\n case ExpressionNodeType.REGEX:\n throw new RuntimeError(\n \"Error generating style shader: Regular expressions are not supported.\"\n );\n case ExpressionNodeType.VARIABLE_IN_STRING:\n throw new RuntimeError(\n \"Error generating style shader: Converting a variable to a string is not supported.\"\n );\n case ExpressionNodeType.LITERAL_NULL:\n return Expression.NULL_SENTINEL;\n case ExpressionNodeType.LITERAL_BOOLEAN:\n return value ? \"true\" : \"false\";\n case ExpressionNodeType.LITERAL_NUMBER:\n return numberToString(value);\n case ExpressionNodeType.LITERAL_STRING:\n if (defined(parent) && parent._type === ExpressionNodeType.MEMBER) {\n if (\n value === \"r\" ||\n value === \"g\" ||\n value === \"b\" ||\n value === \"a\" ||\n value === \"x\" ||\n value === \"y\" ||\n value === \"z\" ||\n value === \"w\" ||\n checkFeature(parent._left)\n ) {\n return value;\n }\n }\n // Check for css color strings\n color = Color.fromCssColorString(value, scratchColor);\n if (defined(color)) {\n return colorToVec3(color);\n }\n throw new RuntimeError(\n \"Error generating style shader: String literals are not supported.\"\n );\n case ExpressionNodeType.LITERAL_COLOR:\n args = left;\n if (value === \"color\") {\n if (!defined(args)) {\n return \"vec4(1.0)\";\n } else if (args.length > 1) {\n const rgb = args[0];\n const alpha = args[1];\n if (alpha !== \"1.0\") {\n shaderState.translucent = true;\n }\n return `vec4(${rgb}, ${alpha})`;\n }\n return `vec4(${args[0]}, 1.0)`;\n } else if (value === \"rgb\") {\n color = convertRGBToColor(this);\n if (defined(color)) {\n return colorToVec4(color);\n }\n return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, 1.0)`;\n } else if (value === \"rgba\") {\n if (args[3] !== \"1.0\") {\n shaderState.translucent = true;\n }\n color = convertRGBToColor(this);\n if (defined(color)) {\n return colorToVec4(color);\n }\n return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, ${args[3]})`;\n } else if (value === \"hsl\") {\n color = convertHSLToRGB(this);\n if (defined(color)) {\n return colorToVec4(color);\n }\n return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), 1.0)`;\n } else if (value === \"hsla\") {\n color = convertHSLToRGB(this);\n if (defined(color)) {\n if (color.alpha !== 1.0) {\n shaderState.translucent = true;\n }\n return colorToVec4(color);\n }\n if (args[3] !== \"1.0\") {\n shaderState.translucent = true;\n }\n return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), ${args[3]})`;\n }\n break;\n case ExpressionNodeType.LITERAL_VECTOR:\nlength = left.length;\n vectorExpression = `${value}(`;\n for (let i = 0; i < length; ++i) {\n vectorExpression += left[i];\n if (i < length - 1) {\n vectorExpression += \", \";\n }\n }\n vectorExpression += \")\";\n return vectorExpression;\n case ExpressionNodeType.LITERAL_REGEX:\n throw new RuntimeError(\n \"Error generating style shader: Regular expressions are not supported.\"\n );\n case ExpressionNodeType.LITERAL_UNDEFINED:\n return Expression.NULL_SENTINEL;\n case ExpressionNodeType.BUILTIN_VARIABLE:\n if (value === \"tiles3d_tileset_time\") {\n return value;\n }\n }\n};\n\nNode.prototype.getVariables = function (variables, parent) {\n let array;\n let length;\n let i;\n\n const type = this._type;\n const value = this._value;\n\n if (defined(this._left)) {\n if (Array.isArray(this._left)) {\n // Left can be an array if the type is LITERAL_COLOR or LITERAL_VECTOR\n array = this._left;\n length = array.length;\n for (i = 0; i < length; ++i) {\n array[i].getVariables(variables, this);\n }\n } else {\n this._left.getVariables(variables, this);\n }\n }\n\n if (defined(this._right)) {\n this._right.getVariables(variables, this);\n }\n\n if (defined(this._test)) {\n this._test.getVariables(variables, this);\n }\n\n if (Array.isArray(this._value)) {\n // For ARRAY type\n array = this._value;\n length = array.length;\n for (i = 0; i < length; ++i) {\n array[i].getVariables(variables, this);\n }\n }\n\n let match;\n switch (type) {\n case ExpressionNodeType.VARIABLE:\n if (!checkFeature(this)) {\n variables.push(value);\n }\n break;\n case ExpressionNodeType.VARIABLE_IN_STRING:\n match = variableRegex.exec(value);\n while (match !== null) {\n variables.push(match[1]);\n match = variableRegex.exec(value);\n }\n break;\n case ExpressionNodeType.LITERAL_STRING:\n if (\n defined(parent) &&\n parent._type === ExpressionNodeType.MEMBER &&\n checkFeature(parent._left)\n ) {\n variables.push(value);\n }\n break;\n }\n};\n\nexport default Expression;\n", "/**\n * @private\n */\nconst ExpressionNodeType = {\n VARIABLE: 0,\n UNARY: 1,\n BINARY: 2,\n TERNARY: 3,\n CONDITIONAL: 4,\n MEMBER: 5,\n FUNCTION_CALL: 6,\n ARRAY: 7,\n REGEX: 8,\n VARIABLE_IN_STRING: 9,\n LITERAL_NULL: 10,\n LITERAL_BOOLEAN: 11,\n LITERAL_NUMBER: 12,\n LITERAL_STRING: 13,\n LITERAL_COLOR: 14,\n LITERAL_VECTOR: 15,\n LITERAL_REGEX: 16,\n LITERAL_UNDEFINED: 17,\n BUILTIN_VARIABLE: 18,\n};\nexport default Object.freeze(ExpressionNodeType);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ShadowVolumeFS from \"../Shaders/ShadowVolumeFS.js\";\nimport VectorTileVS from \"../Shaders/VectorTileVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport Expression from \"./Expression.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\n\n/**\n * Creates a batch of classification meshes.\n *\n * @alias Vector3DTilePrimitive\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Float32Array} options.positions The positions of the meshes.\n * @param {Uint16Array|Uint32Array} options.indices The indices of the triangulated meshes. The indices must be contiguous so that\n * the indices for mesh n are in [i, i + indexCounts[n]] where i = sum{indexCounts[0], indexCounts[n - 1]}.\n * @param {Uint32Array} options.indexCounts The number of indices for each mesh.\n * @param {Uint32Array} options.indexOffsets The offset into the index buffer for each mesh.\n * @param {Vector3DTileBatch[]} options.batchedIndices The index offset and count for each batch with the same color.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched meshes.\n * @param {Uint16Array} options.batchIds The batch ids for each mesh.\n * @param {Uint16Array} options.vertexBatchIds The batch id for each vertex.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of meshes.\n * @param {BoundingSphere[]} options.boundingVolumes The bounding volume for each mesh.\n * @param {ClassificationType} [options.classificationType] What this tile will classify.\n *\n * @private\n */\nfunction Vector3DTilePrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._batchTable = options.batchTable;\n this._batchIds = options.batchIds;\n\n // These arrays are released after VAO creation.\n this._positions = options.positions;\n this._vertexBatchIds = options.vertexBatchIds;\n\n // These arrays are kept for re-batching indices based on colors.\n // If WebGL 2 is supported, indices will be released and re-batching uses buffer-to-buffer copies.\n this._indices = options.indices;\n this._indexCounts = options.indexCounts;\n this._indexOffsets = options.indexOffsets;\n this._batchedIndices = options.batchedIndices;\n\n this._boundingVolume = options.boundingVolume;\n this._boundingVolumes = options.boundingVolumes;\n\n this._center = defaultValue(options.center, Cartesian3.ZERO);\n\n this._va = undefined;\n this._sp = undefined;\n this._spStencil = undefined;\n this._spPick = undefined;\n this._uniformMap = undefined;\n\n // Only used with WebGL 2 to ping-pong ibos after copy.\n this._vaSwap = undefined;\n\n this._rsStencilDepthPass = undefined;\n this._rsStencilDepthPass3DTiles = undefined;\n this._rsColorPass = undefined;\n this._rsPickPass = undefined;\n this._rsWireframe = undefined;\n\n this._commands = [];\n this._commandsIgnoreShow = [];\n this._pickCommands = [];\n\n this._constantColor = Color.clone(Color.WHITE);\n this._highlightColor = this._constantColor;\n\n this._batchDirty = true;\n this._pickCommandsDirty = true;\n this._framesSinceLastRebatch = 0;\n\n this._updatingAllCommands = false;\n\n this._trianglesLength = this._indices.length / 3;\n this._geometryByteLength =\n this._indices.byteLength +\n this._positions.byteLength +\n this._vertexBatchIds.byteLength;\n\n /**\n * Draw the wireframe of the classification meshes.\n * @type {Boolean}\n * @default false\n */\n this.debugWireframe = false;\n this._debugWireframe = this.debugWireframe;\n this._wireframeDirty = false;\n\n /**\n * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n * @type {Boolean}\n * @default false\n */\n this.forceRebatch = false;\n\n /**\n * What this tile will classify.\n * @type {ClassificationType}\n * @default ClassificationType.BOTH\n */\n this.classificationType = defaultValue(\n options.classificationType,\n ClassificationType.BOTH\n );\n\n // Hidden options\n this._vertexShaderSource = options._vertexShaderSource;\n this._fragmentShaderSource = options._fragmentShaderSource;\n this._attributeLocations = options._attributeLocations;\n this._uniformMap = options._uniformMap;\n this._pickId = options._pickId;\n this._modelMatrix = options._modelMatrix;\n this._boundingSphere = options._boundingSphere;\n\n this._batchIdLookUp = {};\n\n const length = this._batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = this._batchIds[i];\n this._batchIdLookUp[batchId] = i;\n }\n}\n\nObject.defineProperties(Vector3DTilePrimitive.prototype, {\n /**\n * Gets the number of triangles.\n *\n * @memberof Vector3DTilePrimitive.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n get: function () {\n return this._trianglesLength;\n },\n },\n\n /**\n * Gets the geometry memory in bytes.\n *\n * @memberof Vector3DTilePrimitive.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n get: function () {\n return this._geometryByteLength;\n },\n },\n});\n\nconst defaultAttributeLocations = {\n position: 0,\n a_batchId: 1,\n};\n\nfunction createVertexArray(primitive, context) {\n if (defined(primitive._va)) {\n return;\n }\n\n const positionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: primitive._positions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const idBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: primitive._vertexBatchIds,\n usage: BufferUsage.STATIC_DRAW,\n });\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: primitive._indices,\n usage: BufferUsage.DYNAMIC_DRAW,\n indexDatatype:\n primitive._indices.BYTES_PER_ELEMENT === 2\n ? IndexDatatype.UNSIGNED_SHORT\n : IndexDatatype.UNSIGNED_INT,\n });\n\n const vertexAttributes = [\n {\n index: 0,\n vertexBuffer: positionBuffer,\n componentDatatype: ComponentDatatype.fromTypedArray(primitive._positions),\n componentsPerAttribute: 3,\n },\n {\n index: 1,\n vertexBuffer: idBuffer,\n componentDatatype: ComponentDatatype.fromTypedArray(\n primitive._vertexBatchIds\n ),\n componentsPerAttribute: 1,\n },\n ];\n\n primitive._va = new VertexArray({\n context: context,\n attributes: vertexAttributes,\n indexBuffer: indexBuffer,\n });\n\n if (context.webgl2) {\n primitive._vaSwap = new VertexArray({\n context: context,\n attributes: vertexAttributes,\n indexBuffer: Buffer.createIndexBuffer({\n context: context,\n sizeInBytes: indexBuffer.sizeInBytes,\n usage: BufferUsage.DYNAMIC_DRAW,\n indexDatatype: indexBuffer.indexDatatype,\n }),\n });\n }\n\n primitive._batchedPositions = undefined;\n primitive._transferrableBatchIds = undefined;\n primitive._vertexBatchIds = undefined;\n primitive._verticesPromise = undefined;\n}\n\nfunction createShaders(primitive, context) {\n if (defined(primitive._sp)) {\n return;\n }\n\n const batchTable = primitive._batchTable;\n const attributeLocations = defaultValue(\n primitive._attributeLocations,\n defaultAttributeLocations\n );\n\n let pickId = primitive._pickId;\n const vertexShaderSource = primitive._vertexShaderSource;\n let fragmentShaderSource = primitive._fragmentShaderSource;\n if (defined(vertexShaderSource)) {\n primitive._sp = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vertexShaderSource,\n fragmentShaderSource: fragmentShaderSource,\n attributeLocations: attributeLocations,\n });\n primitive._spStencil = primitive._sp;\n\n fragmentShaderSource = ShaderSource.replaceMain(\n fragmentShaderSource,\n \"czm_non_pick_main\"\n );\n fragmentShaderSource =\n `${fragmentShaderSource}void main() \\n` +\n `{ \\n` +\n ` czm_non_pick_main(); \\n` +\n ` gl_FragColor = ${pickId}; \\n` +\n `} \\n`;\n primitive._spPick = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vertexShaderSource,\n fragmentShaderSource: fragmentShaderSource,\n attributeLocations: attributeLocations,\n });\n return;\n }\n\n const vsSource = batchTable.getVertexShaderCallback(\n false,\n \"a_batchId\",\n undefined\n )(VectorTileVS);\n let fsSource = batchTable.getFragmentShaderCallback(\n false,\n undefined,\n true\n )(ShadowVolumeFS);\n\n pickId = batchTable.getPickId();\n\n let vs = new ShaderSource({\n sources: [vsSource],\n });\n let fs = new ShaderSource({\n defines: [\"VECTOR_TILE\"],\n sources: [fsSource],\n });\n\n primitive._sp = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n vs = new ShaderSource({\n sources: [VectorTileVS],\n });\n fs = new ShaderSource({\n defines: [\"VECTOR_TILE\"],\n sources: [ShadowVolumeFS],\n });\n\n primitive._spStencil = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n fsSource = ShaderSource.replaceMain(fsSource, \"czm_non_pick_main\");\n fsSource =\n `${fsSource}\\n` +\n `void main() \\n` +\n `{ \\n` +\n ` czm_non_pick_main(); \\n` +\n ` gl_FragColor = ${pickId}; \\n` +\n `} \\n`;\n\n const pickVS = new ShaderSource({\n sources: [vsSource],\n });\n const pickFS = new ShaderSource({\n defines: [\"VECTOR_TILE\"],\n sources: [fsSource],\n });\n primitive._spPick = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: pickVS,\n fragmentShaderSource: pickFS,\n attributeLocations: attributeLocations,\n });\n}\n\nfunction getStencilDepthRenderState(mask3DTiles) {\n const stencilFunction = mask3DTiles\n ? StencilFunction.EQUAL\n : StencilFunction.ALWAYS;\n return {\n colorMask: {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n },\n stencilTest: {\n enabled: true,\n frontFunction: stencilFunction,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.DECREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: stencilFunction,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.INCREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS_OR_EQUAL,\n },\n depthMask: false,\n };\n}\n\nconst colorRenderState = {\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n};\n\nconst pickRenderState = {\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n};\n\nfunction createRenderStates(primitive) {\n if (defined(primitive._rsStencilDepthPass)) {\n return;\n }\n\n primitive._rsStencilDepthPass = RenderState.fromCache(\n getStencilDepthRenderState(false)\n );\n primitive._rsStencilDepthPass3DTiles = RenderState.fromCache(\n getStencilDepthRenderState(true)\n );\n primitive._rsColorPass = RenderState.fromCache(colorRenderState);\n primitive._rsPickPass = RenderState.fromCache(pickRenderState);\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n if (defined(primitive._uniformMap)) {\n return;\n }\n\n const uniformMap = {\n u_modifiedModelViewProjection: function () {\n const viewMatrix = context.uniformState.view;\n const projectionMatrix = context.uniformState.projection;\n Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n Matrix4.multiplyByPoint(\n modifiedModelViewScratch,\n primitive._center,\n rtcScratch\n );\n Matrix4.setTranslation(\n modifiedModelViewScratch,\n rtcScratch,\n modifiedModelViewScratch\n );\n Matrix4.multiply(\n projectionMatrix,\n modifiedModelViewScratch,\n modifiedModelViewScratch\n );\n return modifiedModelViewScratch;\n },\n u_highlightColor: function () {\n return primitive._highlightColor;\n },\n };\n\n primitive._uniformMap = primitive._batchTable.getUniformMapCallback()(\n uniformMap\n );\n}\n\nfunction copyIndicesCPU(\n indices,\n newIndices,\n currentOffset,\n offsets,\n counts,\n batchIds,\n batchIdLookUp\n) {\n const sizeInBytes = indices.constructor.BYTES_PER_ELEMENT;\n\n const batchedIdsLength = batchIds.length;\n for (let j = 0; j < batchedIdsLength; ++j) {\n const batchedId = batchIds[j];\n const index = batchIdLookUp[batchedId];\n const offset = offsets[index];\n const count = counts[index];\n\n const subarray = new indices.constructor(\n indices.buffer,\n sizeInBytes * offset,\n count\n );\n newIndices.set(subarray, currentOffset);\n\n offsets[index] = currentOffset;\n currentOffset += count;\n }\n\n return currentOffset;\n}\n\nfunction rebatchCPU(primitive, batchedIndices) {\n const indices = primitive._indices;\n const indexOffsets = primitive._indexOffsets;\n const indexCounts = primitive._indexCounts;\n const batchIdLookUp = primitive._batchIdLookUp;\n\n const newIndices = new indices.constructor(indices.length);\n\n let current = batchedIndices.pop();\n const newBatchedIndices = [current];\n\n let currentOffset = copyIndicesCPU(\n indices,\n newIndices,\n 0,\n indexOffsets,\n indexCounts,\n current.batchIds,\n batchIdLookUp\n );\n\n current.offset = 0;\n current.count = currentOffset;\n\n while (batchedIndices.length > 0) {\n const next = batchedIndices.pop();\n if (Color.equals(next.color, current.color)) {\n currentOffset = copyIndicesCPU(\n indices,\n newIndices,\n currentOffset,\n indexOffsets,\n indexCounts,\n next.batchIds,\n batchIdLookUp\n );\n current.batchIds = current.batchIds.concat(next.batchIds);\n current.count = currentOffset - current.offset;\n } else {\n const offset = currentOffset;\n currentOffset = copyIndicesCPU(\n indices,\n newIndices,\n currentOffset,\n indexOffsets,\n indexCounts,\n next.batchIds,\n batchIdLookUp\n );\n\n next.offset = offset;\n next.count = currentOffset - offset;\n newBatchedIndices.push(next);\n current = next;\n }\n }\n\n primitive._va.indexBuffer.copyFromArrayView(newIndices);\n\n primitive._indices = newIndices;\n primitive._batchedIndices = newBatchedIndices;\n}\n\nfunction copyIndicesGPU(\n readBuffer,\n writeBuffer,\n currentOffset,\n offsets,\n counts,\n batchIds,\n batchIdLookUp\n) {\n const sizeInBytes = readBuffer.bytesPerIndex;\n\n const batchedIdsLength = batchIds.length;\n for (let j = 0; j < batchedIdsLength; ++j) {\n const batchedId = batchIds[j];\n const index = batchIdLookUp[batchedId];\n const offset = offsets[index];\n const count = counts[index];\n\n writeBuffer.copyFromBuffer(\n readBuffer,\n offset * sizeInBytes,\n currentOffset * sizeInBytes,\n count * sizeInBytes\n );\n\n offsets[index] = currentOffset;\n currentOffset += count;\n }\n\n return currentOffset;\n}\n\nfunction rebatchGPU(primitive, batchedIndices) {\n const indexOffsets = primitive._indexOffsets;\n const indexCounts = primitive._indexCounts;\n const batchIdLookUp = primitive._batchIdLookUp;\n\n let current = batchedIndices.pop();\n const newBatchedIndices = [current];\n\n const readBuffer = primitive._va.indexBuffer;\n const writeBuffer = primitive._vaSwap.indexBuffer;\n\n let currentOffset = copyIndicesGPU(\n readBuffer,\n writeBuffer,\n 0,\n indexOffsets,\n indexCounts,\n current.batchIds,\n batchIdLookUp\n );\n\n current.offset = 0;\n current.count = currentOffset;\n\n while (batchedIndices.length > 0) {\n const next = batchedIndices.pop();\n if (Color.equals(next.color, current.color)) {\n currentOffset = copyIndicesGPU(\n readBuffer,\n writeBuffer,\n currentOffset,\n indexOffsets,\n indexCounts,\n next.batchIds,\n batchIdLookUp\n );\n current.batchIds = current.batchIds.concat(next.batchIds);\n current.count = currentOffset - current.offset;\n } else {\n const offset = currentOffset;\n currentOffset = copyIndicesGPU(\n readBuffer,\n writeBuffer,\n currentOffset,\n indexOffsets,\n indexCounts,\n next.batchIds,\n batchIdLookUp\n );\n next.offset = offset;\n next.count = currentOffset - offset;\n newBatchedIndices.push(next);\n current = next;\n }\n }\n\n const temp = primitive._va;\n primitive._va = primitive._vaSwap;\n primitive._vaSwap = temp;\n\n primitive._batchedIndices = newBatchedIndices;\n}\n\nfunction compareColors(a, b) {\n return b.color.toRgba() - a.color.toRgba();\n}\n\n// PERFORMANCE_IDEA: For WebGL 2, we can use copyBufferSubData for buffer-to-buffer copies.\n// PERFORMANCE_IDEA: Not supported, but we could use glMultiDrawElements here.\nfunction rebatchCommands(primitive, context) {\n if (!primitive._batchDirty) {\n return false;\n }\n\n const batchedIndices = primitive._batchedIndices;\n const length = batchedIndices.length;\n\n let needToRebatch = false;\n const colorCounts = {};\n\n for (let i = 0; i < length; ++i) {\n const color = batchedIndices[i].color;\n const rgba = color.toRgba();\n if (defined(colorCounts[rgba])) {\n needToRebatch = true;\n break;\n } else {\n colorCounts[rgba] = true;\n }\n }\n\n if (!needToRebatch) {\n primitive._batchDirty = false;\n return false;\n }\n\n if (\n needToRebatch &&\n !primitive.forceRebatch &&\n primitive._framesSinceLastRebatch < 120\n ) {\n ++primitive._framesSinceLastRebatch;\n return;\n }\n\n batchedIndices.sort(compareColors);\n\n if (context.webgl2) {\n rebatchGPU(primitive, batchedIndices);\n } else {\n rebatchCPU(primitive, batchedIndices);\n }\n\n primitive._framesSinceLastRebatch = 0;\n primitive._batchDirty = false;\n primitive._pickCommandsDirty = true;\n primitive._wireframeDirty = true;\n return true;\n}\n\nfunction createColorCommands(primitive, context) {\n const needsRebatch = rebatchCommands(primitive, context);\n\n const commands = primitive._commands;\n const batchedIndices = primitive._batchedIndices;\n const length = batchedIndices.length;\n const commandsLength = length * 2;\n\n if (\n defined(commands) &&\n !needsRebatch &&\n commands.length === commandsLength\n ) {\n return;\n }\n\n commands.length = commandsLength;\n\n const vertexArray = primitive._va;\n const sp = primitive._sp;\n const modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);\n const uniformMap = primitive._uniformMap;\n const bv = primitive._boundingVolume;\n\n for (let j = 0; j < length; ++j) {\n const offset = batchedIndices[j].offset;\n const count = batchedIndices[j].count;\n\n let stencilDepthCommand = commands[j * 2];\n if (!defined(stencilDepthCommand)) {\n stencilDepthCommand = commands[j * 2] = new DrawCommand({\n owner: primitive,\n });\n }\n\n stencilDepthCommand.vertexArray = vertexArray;\n stencilDepthCommand.modelMatrix = modelMatrix;\n stencilDepthCommand.offset = offset;\n stencilDepthCommand.count = count;\n stencilDepthCommand.renderState = primitive._rsStencilDepthPass;\n stencilDepthCommand.shaderProgram = sp;\n stencilDepthCommand.uniformMap = uniformMap;\n stencilDepthCommand.boundingVolume = bv;\n stencilDepthCommand.cull = false;\n stencilDepthCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n const stencilDepthDerivedCommand = DrawCommand.shallowClone(\n stencilDepthCommand,\n stencilDepthCommand.derivedCommands.tileset\n );\n stencilDepthDerivedCommand.renderState =\n primitive._rsStencilDepthPass3DTiles;\n stencilDepthDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;\n\n let colorCommand = commands[j * 2 + 1];\n if (!defined(colorCommand)) {\n colorCommand = commands[j * 2 + 1] = new DrawCommand({\n owner: primitive,\n });\n }\n\n colorCommand.vertexArray = vertexArray;\n colorCommand.modelMatrix = modelMatrix;\n colorCommand.offset = offset;\n colorCommand.count = count;\n colorCommand.renderState = primitive._rsColorPass;\n colorCommand.shaderProgram = sp;\n colorCommand.uniformMap = uniformMap;\n colorCommand.boundingVolume = bv;\n colorCommand.cull = false;\n colorCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n const colorDerivedCommand = DrawCommand.shallowClone(\n colorCommand,\n colorCommand.derivedCommands.tileset\n );\n colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n colorCommand.derivedCommands.tileset = colorDerivedCommand;\n }\n\n primitive._commandsDirty = true;\n}\n\nfunction createColorCommandsIgnoreShow(primitive, frameState) {\n if (\n primitive.classificationType === ClassificationType.TERRAIN ||\n !frameState.invertClassification ||\n (defined(primitive._commandsIgnoreShow) && !primitive._commandsDirty)\n ) {\n return;\n }\n\n const commands = primitive._commands;\n const commandsIgnoreShow = primitive._commandsIgnoreShow;\n const spStencil = primitive._spStencil;\n\n const commandsLength = commands.length;\n const length = (commandsIgnoreShow.length = commandsLength / 2);\n\n let commandIndex = 0;\n for (let j = 0; j < length; ++j) {\n const commandIgnoreShow = (commandsIgnoreShow[j] = DrawCommand.shallowClone(\n commands[commandIndex],\n commandsIgnoreShow[j]\n ));\n commandIgnoreShow.shaderProgram = spStencil;\n commandIgnoreShow.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n\n commandIndex += 2;\n }\n\n primitive._commandsDirty = false;\n}\n\nfunction createPickCommands(primitive) {\n if (!primitive._pickCommandsDirty) {\n return;\n }\n\n const length = primitive._indexOffsets.length;\n const pickCommands = primitive._pickCommands;\n pickCommands.length = length * 2;\n\n const vertexArray = primitive._va;\n const spStencil = primitive._spStencil;\n const spPick = primitive._spPick;\n const modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);\n const uniformMap = primitive._uniformMap;\n\n for (let j = 0; j < length; ++j) {\n const offset = primitive._indexOffsets[j];\n const count = primitive._indexCounts[j];\n const bv = defined(primitive._boundingVolumes)\n ? primitive._boundingVolumes[j]\n : primitive.boundingVolume;\n\n let stencilDepthCommand = pickCommands[j * 2];\n if (!defined(stencilDepthCommand)) {\n stencilDepthCommand = pickCommands[j * 2] = new DrawCommand({\n owner: primitive,\n pickOnly: true,\n });\n }\n\n stencilDepthCommand.vertexArray = vertexArray;\n stencilDepthCommand.modelMatrix = modelMatrix;\n stencilDepthCommand.offset = offset;\n stencilDepthCommand.count = count;\n stencilDepthCommand.renderState = primitive._rsStencilDepthPass;\n stencilDepthCommand.shaderProgram = spStencil;\n stencilDepthCommand.uniformMap = uniformMap;\n stencilDepthCommand.boundingVolume = bv;\n stencilDepthCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n const stencilDepthDerivedCommand = DrawCommand.shallowClone(\n stencilDepthCommand,\n stencilDepthCommand.derivedCommands.tileset\n );\n stencilDepthDerivedCommand.renderState =\n primitive._rsStencilDepthPass3DTiles;\n stencilDepthDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;\n\n let colorCommand = pickCommands[j * 2 + 1];\n if (!defined(colorCommand)) {\n colorCommand = pickCommands[j * 2 + 1] = new DrawCommand({\n owner: primitive,\n pickOnly: true,\n });\n }\n\n colorCommand.vertexArray = vertexArray;\n colorCommand.modelMatrix = modelMatrix;\n colorCommand.offset = offset;\n colorCommand.count = count;\n colorCommand.renderState = primitive._rsPickPass;\n colorCommand.shaderProgram = spPick;\n colorCommand.uniformMap = uniformMap;\n colorCommand.boundingVolume = bv;\n colorCommand.pass = Pass.TERRAIN_CLASSIFICATION;\n\n const colorDerivedCommand = DrawCommand.shallowClone(\n colorCommand,\n colorCommand.derivedCommands.tileset\n );\n colorDerivedCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n colorCommand.derivedCommands.tileset = colorDerivedCommand;\n }\n\n primitive._pickCommandsDirty = false;\n}\n\n/**\n * Creates features for each mesh and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePrimitive.prototype.createFeatures = function (content, features) {\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n features[batchId] = new Cesium3DTileFeature(content, batchId);\n }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (mesh batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePrimitive.prototype.applyDebugSettings = function (enabled, color) {\n this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n polygons._updatingAllCommands = true;\n\n const batchIds = polygons._batchIds;\n let length = batchIds.length;\n let i;\n\n for (i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.show = true;\n feature.color = Color.WHITE;\n }\n\n const batchedIndices = polygons._batchedIndices;\n length = batchedIndices.length;\n\n for (i = 0; i < length; ++i) {\n batchedIndices[i].color = Color.clone(Color.WHITE);\n }\n\n polygons._updatingAllCommands = false;\n polygons._batchDirty = true;\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\nconst complexExpressionReg = /\\$/;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePrimitive.prototype.applyStyle = function (style, features) {\n if (!defined(style)) {\n clearStyle(this, features);\n return;\n }\n\n const colorExpression = style.color;\n const isSimpleStyle =\n colorExpression instanceof Expression &&\n !complexExpressionReg.test(colorExpression.expression);\n this._updatingAllCommands = isSimpleStyle;\n\n const batchIds = this._batchIds;\n let length = batchIds.length;\n let i;\n\n for (i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.color = defined(style.color)\n ? style.color.evaluateColor(feature, scratchColor)\n : DEFAULT_COLOR_VALUE;\n feature.show = defined(style.show)\n ? style.show.evaluate(feature)\n : DEFAULT_SHOW_VALUE;\n }\n\n if (isSimpleStyle) {\n const batchedIndices = this._batchedIndices;\n length = batchedIndices.length;\n\n for (i = 0; i < length; ++i) {\n batchedIndices[i].color = Color.clone(Color.WHITE);\n }\n\n this._updatingAllCommands = false;\n this._batchDirty = true;\n }\n};\n\n/**\n * Call when updating the color of a mesh with batchId changes color. The meshes will need to be re-batched\n * on the next update.\n *\n * @param {Number} batchId The batch id of the meshes whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTilePrimitive.prototype.updateCommands = function (batchId, color) {\n if (this._updatingAllCommands) {\n return;\n }\n\n const batchIdLookUp = this._batchIdLookUp;\n const index = batchIdLookUp[batchId];\n if (!defined(index)) {\n return;\n }\n\n const indexOffsets = this._indexOffsets;\n const indexCounts = this._indexCounts;\n\n const offset = indexOffsets[index];\n const count = indexCounts[index];\n\n const batchedIndices = this._batchedIndices;\n const length = batchedIndices.length;\n\n let i;\n for (i = 0; i < length; ++i) {\n const batchedOffset = batchedIndices[i].offset;\n const batchedCount = batchedIndices[i].count;\n\n if (offset >= batchedOffset && offset < batchedOffset + batchedCount) {\n break;\n }\n }\n\n batchedIndices.push(\n new Vector3DTileBatch({\n color: Color.clone(color),\n offset: offset,\n count: count,\n batchIds: [batchId],\n })\n );\n\n const startIds = [];\n const endIds = [];\n\n const batchIds = batchedIndices[i].batchIds;\n const batchIdsLength = batchIds.length;\n\n for (let j = 0; j < batchIdsLength; ++j) {\n const id = batchIds[j];\n if (id === batchId) {\n continue;\n }\n\n const offsetIndex = batchIdLookUp[id];\n if (indexOffsets[offsetIndex] < offset) {\n startIds.push(id);\n } else {\n endIds.push(id);\n }\n }\n\n if (endIds.length !== 0) {\n batchedIndices.push(\n new Vector3DTileBatch({\n color: Color.clone(batchedIndices[i].color),\n offset: offset + count,\n count:\n batchedIndices[i].offset + batchedIndices[i].count - (offset + count),\n batchIds: endIds,\n })\n );\n }\n\n if (startIds.length !== 0) {\n batchedIndices[i].count = offset - batchedIndices[i].offset;\n batchedIndices[i].batchIds = startIds;\n } else {\n batchedIndices.splice(i, 1);\n }\n\n this._batchDirty = true;\n};\n\nfunction queueCommands(primitive, frameState, commands, commandsIgnoreShow) {\n const classificationType = primitive.classificationType;\n const queueTerrainCommands =\n classificationType !== ClassificationType.CESIUM_3D_TILE;\n const queue3DTilesCommands =\n classificationType !== ClassificationType.TERRAIN;\n\n const commandList = frameState.commandList;\n let commandLength = commands.length;\n let command;\n let i;\n for (i = 0; i < commandLength; ++i) {\n if (queueTerrainCommands) {\n command = commands[i];\n command.pass = Pass.TERRAIN_CLASSIFICATION;\n commandList.push(command);\n }\n if (queue3DTilesCommands) {\n command = commands[i].derivedCommands.tileset;\n command.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n commandList.push(command);\n }\n }\n\n if (!frameState.invertClassification || !defined(commandsIgnoreShow)) {\n return;\n }\n\n commandLength = commandsIgnoreShow.length;\n for (i = 0; i < commandLength; ++i) {\n commandList.push(commandsIgnoreShow[i]);\n }\n}\n\nfunction queueWireframeCommands(frameState, commands) {\n const commandList = frameState.commandList;\n const commandLength = commands.length;\n for (let i = 0; i < commandLength; i += 2) {\n const command = commands[i + 1];\n command.pass = Pass.OPAQUE;\n commandList.push(command);\n }\n}\n\nfunction updateWireframe(primitive) {\n let earlyExit = primitive.debugWireframe === primitive._debugWireframe;\n earlyExit =\n earlyExit && !(primitive.debugWireframe && primitive._wireframeDirty);\n if (earlyExit) {\n return;\n }\n\n if (!defined(primitive._rsWireframe)) {\n primitive._rsWireframe = RenderState.fromCache({});\n }\n\n let rs;\n let type;\n\n if (primitive.debugWireframe) {\n rs = primitive._rsWireframe;\n type = PrimitiveType.LINES;\n } else {\n rs = primitive._rsColorPass;\n type = PrimitiveType.TRIANGLES;\n }\n\n const commands = primitive._commands;\n const commandLength = commands.length;\n for (let i = 0; i < commandLength; i += 2) {\n const command = commands[i + 1];\n command.renderState = rs;\n command.primitiveType = type;\n }\n\n primitive._debugWireframe = primitive.debugWireframe;\n primitive._wireframeDirty = false;\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePrimitive.prototype.update = function (frameState) {\n const context = frameState.context;\n\n createVertexArray(this, context);\n createShaders(this, context);\n createRenderStates(this);\n createUniformMap(this, context);\n\n const passes = frameState.passes;\n if (passes.render) {\n createColorCommands(this, context);\n createColorCommandsIgnoreShow(this, frameState);\n updateWireframe(this);\n\n if (this._debugWireframe) {\n queueWireframeCommands(frameState, this._commands);\n } else {\n queueCommands(this, frameState, this._commands, this._commandsIgnoreShow);\n }\n }\n\n if (passes.pick) {\n createPickCommands(this);\n queueCommands(this, frameState, this._pickCommands);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePrimitive.prototype.destroy = function () {\n this._va = this._va && this._va.destroy();\n this._sp = this._sp && this._sp.destroy();\n this._spPick = this._spPick && this._spPick.destroy();\n this._vaSwap = this._vaSwap && this._vaSwap.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTilePrimitive;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\nimport Vector3DTilePrimitive from \"./Vector3DTilePrimitive.js\";\n\n/**\n * Creates a batch of box, cylinder, ellipsoid and/or sphere geometries intersecting terrain or 3D Tiles.\n *\n * @alias Vector3DTileGeometry\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Float32Array} [options.boxes] The boxes in the tile.\n * @param {Uint16Array} [options.boxBatchIds] The batch ids for each box.\n * @param {Float32Array} [options.cylinders] The cylinders in the tile.\n * @param {Uint16Array} [options.cylinderBatchIds] The batch ids for each cylinder.\n * @param {Float32Array} [options.ellipsoids] The ellipsoids in the tile.\n * @param {Uint16Array} [options.ellipsoidBatchIds] The batch ids for each ellipsoid.\n * @param {Float32Array} [options.spheres] The spheres in the tile.\n * @param {Uint16Array} [options.sphereBatchIds] The batch ids for each sphere.\n * @param {Cartesian3} options.center The RTC center of all geometries.\n * @param {Matrix4} options.modelMatrix The model matrix of all geometries. Applied after the individual geometry model matrices.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table.\n * @param {BoundingSphere} options.boundingVolume The bounding volume containing all of the geometry in the tile.\n *\n * @private\n */\nfunction Vector3DTileGeometry(options) {\n // these will all be released after the primitive is created\n this._boxes = options.boxes;\n this._boxBatchIds = options.boxBatchIds;\n this._cylinders = options.cylinders;\n this._cylinderBatchIds = options.cylinderBatchIds;\n this._ellipsoids = options.ellipsoids;\n this._ellipsoidBatchIds = options.ellipsoidBatchIds;\n this._spheres = options.spheres;\n this._sphereBatchIds = options.sphereBatchIds;\n this._modelMatrix = options.modelMatrix;\n this._batchTable = options.batchTable;\n this._boundingVolume = options.boundingVolume;\n\n this._center = options.center;\n if (!defined(this._center)) {\n if (defined(this._boundingVolume)) {\n this._center = Cartesian3.clone(this._boundingVolume.center);\n } else {\n this._center = Cartesian3.clone(Cartesian3.ZERO);\n }\n }\n\n this._boundingVolumes = undefined;\n this._batchedIndices = undefined;\n\n this._indices = undefined;\n this._indexOffsets = undefined;\n this._indexCounts = undefined;\n\n this._positions = undefined;\n this._vertexBatchIds = undefined;\n\n this._batchIds = undefined;\n\n this._batchTableColors = undefined;\n this._packedBuffer = undefined;\n\n this._ready = false;\n this._update = function (geometries, frameState) {};\n this._readyPromise = initialize(this);\n\n this._verticesPromise = undefined;\n\n this._primitive = undefined;\n\n /**\n * Draws the wireframe of the classification geometries.\n * @type {Boolean}\n * @default false\n */\n this.debugWireframe = false;\n\n /**\n * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n * @type {Boolean}\n * @default false\n */\n this.forceRebatch = false;\n\n /**\n * What this tile will classify.\n * @type {ClassificationType}\n * @default ClassificationType.BOTH\n */\n this.classificationType = ClassificationType.BOTH;\n}\n\nObject.defineProperties(Vector3DTileGeometry.prototype, {\n /**\n * Gets the number of triangles.\n *\n * @memberof Vector3DTileGeometry.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n get: function () {\n if (defined(this._primitive)) {\n return this._primitive.trianglesLength;\n }\n return 0;\n },\n },\n\n /**\n * Gets the geometry memory in bytes.\n *\n * @memberof Vector3DTileGeometry.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n get: function () {\n if (defined(this._primitive)) {\n return this._primitive.geometryByteLength;\n }\n return 0;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Vector3DTileGeometry.prototype\n * @type {Promise<void>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nVector3DTileGeometry.packedBoxLength =\n Matrix4.packedLength + Cartesian3.packedLength;\nVector3DTileGeometry.packedCylinderLength = Matrix4.packedLength + 2;\nVector3DTileGeometry.packedEllipsoidLength =\n Matrix4.packedLength + Cartesian3.packedLength;\nVector3DTileGeometry.packedSphereLength = Cartesian3.packedLength + 1;\n\nfunction packBuffer(geometries) {\n const packedBuffer = new Float64Array(\n Matrix4.packedLength + Cartesian3.packedLength\n );\n\n let offset = 0;\n Cartesian3.pack(geometries._center, packedBuffer, offset);\n offset += Cartesian3.packedLength;\n Matrix4.pack(geometries._modelMatrix, packedBuffer, offset);\n\n return packedBuffer;\n}\n\nfunction unpackBuffer(geometries, packedBuffer) {\n let offset = 0;\n\n const indicesBytesPerElement = packedBuffer[offset++];\n const numBVS = packedBuffer[offset++];\n const bvs = (geometries._boundingVolumes = new Array(numBVS));\n\n for (let i = 0; i < numBVS; ++i) {\n bvs[i] = BoundingSphere.unpack(packedBuffer, offset);\n offset += BoundingSphere.packedLength;\n }\n\n const numBatchedIndices = packedBuffer[offset++];\n const bis = (geometries._batchedIndices = new Array(numBatchedIndices));\n\n for (let j = 0; j < numBatchedIndices; ++j) {\n const color = Color.unpack(packedBuffer, offset);\n offset += Color.packedLength;\n\n const indexOffset = packedBuffer[offset++];\n const count = packedBuffer[offset++];\n\n const length = packedBuffer[offset++];\n const batchIds = new Array(length);\n\n for (let k = 0; k < length; ++k) {\n batchIds[k] = packedBuffer[offset++];\n }\n\n bis[j] = new Vector3DTileBatch({\n color: color,\n offset: indexOffset,\n count: count,\n batchIds: batchIds,\n });\n }\n\n return indicesBytesPerElement;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n \"createVectorTileGeometries\",\n 5\n);\nconst scratchColor = new Color();\n\nfunction createPrimitive(geometries) {\n if (defined(geometries._primitive)) {\n return;\n }\n\n if (!defined(geometries._verticesPromise)) {\n let boxes = geometries._boxes;\n let boxBatchIds = geometries._boxBatchIds;\n let cylinders = geometries._cylinders;\n let cylinderBatchIds = geometries._cylinderBatchIds;\n let ellipsoids = geometries._ellipsoids;\n let ellipsoidBatchIds = geometries._ellipsoidBatchIds;\n let spheres = geometries._spheres;\n let sphereBatchIds = geometries._sphereBatchIds;\n\n let batchTableColors = geometries._batchTableColors;\n let packedBuffer = geometries._packedBuffer;\n\n if (!defined(batchTableColors)) {\n // Copy because they may be the views on the same buffer.\n let length = 0;\n if (defined(geometries._boxes)) {\n boxes = geometries._boxes = boxes.slice();\n boxBatchIds = geometries._boxBatchIds = boxBatchIds.slice();\n length += boxBatchIds.length;\n }\n if (defined(geometries._cylinders)) {\n cylinders = geometries._cylinders = cylinders.slice();\n cylinderBatchIds = geometries._cylinderBatchIds = cylinderBatchIds.slice();\n length += cylinderBatchIds.length;\n }\n if (defined(geometries._ellipsoids)) {\n ellipsoids = geometries._ellipsoids = ellipsoids.slice();\n ellipsoidBatchIds = geometries._ellipsoidBatchIds = ellipsoidBatchIds.slice();\n length += ellipsoidBatchIds.length;\n }\n if (defined(geometries._spheres)) {\n spheres = geometries._sphere = spheres.slice();\n sphereBatchIds = geometries._sphereBatchIds = sphereBatchIds.slice();\n length += sphereBatchIds.length;\n }\n\n batchTableColors = geometries._batchTableColors = new Uint32Array(length);\n const batchTable = geometries._batchTable;\n\n for (let i = 0; i < length; ++i) {\n const color = batchTable.getColor(i, scratchColor);\n batchTableColors[i] = color.toRgba();\n }\n\n packedBuffer = geometries._packedBuffer = packBuffer(geometries);\n }\n\n const transferrableObjects = [];\n if (defined(boxes)) {\n transferrableObjects.push(boxes.buffer, boxBatchIds.buffer);\n }\n if (defined(cylinders)) {\n transferrableObjects.push(cylinders.buffer, cylinderBatchIds.buffer);\n }\n if (defined(ellipsoids)) {\n transferrableObjects.push(ellipsoids.buffer, ellipsoidBatchIds.buffer);\n }\n if (defined(spheres)) {\n transferrableObjects.push(spheres.buffer, sphereBatchIds.buffer);\n }\n transferrableObjects.push(batchTableColors.buffer, packedBuffer.buffer);\n\n const parameters = {\n boxes: defined(boxes) ? boxes.buffer : undefined,\n boxBatchIds: defined(boxes) ? boxBatchIds.buffer : undefined,\n cylinders: defined(cylinders) ? cylinders.buffer : undefined,\n cylinderBatchIds: defined(cylinders)\n ? cylinderBatchIds.buffer\n : undefined,\n ellipsoids: defined(ellipsoids) ? ellipsoids.buffer : undefined,\n ellipsoidBatchIds: defined(ellipsoids)\n ? ellipsoidBatchIds.buffer\n : undefined,\n spheres: defined(spheres) ? spheres.buffer : undefined,\n sphereBatchIds: defined(spheres) ? sphereBatchIds.buffer : undefined,\n batchTableColors: batchTableColors.buffer,\n packedBuffer: packedBuffer.buffer,\n };\n\n const verticesPromise = (geometries._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n parameters,\n transferrableObjects\n ));\n if (!defined(verticesPromise)) {\n // Postponed\n return;\n }\n\n return verticesPromise.then(function (result) {\n const packedBuffer = new Float64Array(result.packedBuffer);\n const indicesBytesPerElement = unpackBuffer(geometries, packedBuffer);\n\n if (indicesBytesPerElement === 2) {\n geometries._indices = new Uint16Array(result.indices);\n } else {\n geometries._indices = new Uint32Array(result.indices);\n }\n\n geometries._indexOffsets = new Uint32Array(result.indexOffsets);\n geometries._indexCounts = new Uint32Array(result.indexCounts);\n\n geometries._positions = new Float32Array(result.positions);\n geometries._vertexBatchIds = new Uint16Array(result.vertexBatchIds);\n\n geometries._batchIds = new Uint16Array(result.batchIds);\n\n geometries._ready = true;\n });\n }\n}\n\nfunction finishPrimitive(geometries) {\n if (geometries._ready && !defined(geometries._primitive)) {\n geometries._primitive = new Vector3DTilePrimitive({\n batchTable: geometries._batchTable,\n positions: geometries._positions,\n batchIds: geometries._batchIds,\n vertexBatchIds: geometries._vertexBatchIds,\n indices: geometries._indices,\n indexOffsets: geometries._indexOffsets,\n indexCounts: geometries._indexCounts,\n batchedIndices: geometries._batchedIndices,\n boundingVolume: geometries._boundingVolume,\n boundingVolumes: geometries._boundingVolumes,\n center: geometries._center,\n pickObject: defaultValue(geometries._pickObject, geometries),\n });\n\n geometries._boxes = undefined;\n geometries._boxBatchIds = undefined;\n geometries._cylinders = undefined;\n geometries._cylinderBatchIds = undefined;\n geometries._ellipsoids = undefined;\n geometries._ellipsoidBatchIds = undefined;\n geometries._spheres = undefined;\n geometries._sphereBatchIds = undefined;\n geometries._center = undefined;\n geometries._modelMatrix = undefined;\n geometries._batchTable = undefined;\n geometries._boundingVolume = undefined;\n\n geometries._boundingVolumes = undefined;\n geometries._batchedIndices = undefined;\n\n geometries._indices = undefined;\n geometries._indexOffsets = undefined;\n geometries._indexCounts = undefined;\n\n geometries._positions = undefined;\n geometries._vertexBatchIds = undefined;\n\n geometries._batchIds = undefined;\n\n geometries._batchTableColors = undefined;\n geometries._packedBuffer = undefined;\n\n geometries._verticesPromise = undefined;\n }\n}\n\n/**\n * Creates features for each geometry and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTileGeometry.prototype.createFeatures = function (content, features) {\n this._primitive.createFeatures(content, features);\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (geometry batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTileGeometry.prototype.applyDebugSettings = function (enabled, color) {\n this._primitive.applyDebugSettings(enabled, color);\n};\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTileGeometry.prototype.applyStyle = function (style, features) {\n this._primitive.applyStyle(style, features);\n};\n\n/**\n * Call when updating the color of a geometry with batchId changes color. The geometries will need to be re-batched\n * on the next update.\n *\n * @param {Number} batchId The batch id of the geometries whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTileGeometry.prototype.updateCommands = function (batchId, color) {\n this._primitive.updateCommands(batchId, color);\n};\n\nfunction initialize(geometries) {\n return new Promise(function (resolve, reject) {\n geometries._update = function (geometries, frameState) {\n const promise = createPrimitive(geometries);\n\n if (geometries._ready) {\n geometries._primitive.debugWireframe = geometries.debugWireframe;\n geometries._primitive.forceRebatch = geometries.forceRebatch;\n geometries._primitive.classificationType =\n geometries.classificationType;\n geometries._primitive.update(frameState);\n }\n\n if (!defined(promise)) {\n return;\n }\n\n promise\n .then(function () {\n finishPrimitive(geometries);\n resolve(geometries);\n })\n .catch(function (e) {\n reject(e);\n });\n };\n });\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTileGeometry.prototype.update = function (frameState) {\n this._update(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTileGeometry.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTileGeometry.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTileGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport Vector3DTileGeometry from \"./Vector3DTileGeometry.js\";\n\n/**\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Geometry3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Geometry3DTileContent(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n) {\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n this._geometries = undefined;\n\n this._metadata = undefined;\n\n this._batchTable = undefined;\n this._features = undefined;\n\n /**\n * Part of the {@link Cesium3DTileContent} interface.\n */\n this.featurePropertiesDirty = false;\n this._group = undefined;\n\n this._readyPromise = initialize(this, arrayBuffer, byteOffset);\n}\n\nObject.defineProperties(Geometry3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n return defined(this._batchTable) ? this._batchTable.featuresLength : 0;\n },\n },\n\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n trianglesLength: {\n get: function () {\n if (defined(this._geometries)) {\n return this._geometries.trianglesLength;\n }\n return 0;\n },\n },\n\n geometryByteLength: {\n get: function () {\n if (defined(this._geometries)) {\n return this._geometries.geometryByteLength;\n }\n return 0;\n },\n },\n\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n return defined(this._batchTable)\n ? this._batchTable.batchTableByteLength\n : 0;\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._resource.getUrlComponent(true);\n },\n },\n\n metadata: {\n get: function () {\n return this._metadata;\n },\n set: function (value) {\n this._metadata = value;\n },\n },\n\n batchTable: {\n get: function () {\n return this._batchTable;\n },\n },\n\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n },\n },\n});\n\nfunction createColorChangedCallback(content) {\n return function (batchId, color) {\n if (defined(content._geometries)) {\n content._geometries.updateCommands(batchId, color);\n }\n };\n}\n\nfunction getBatchIds(featureTableJson, featureTableBinary) {\n let boxBatchIds;\n let cylinderBatchIds;\n let ellipsoidBatchIds;\n let sphereBatchIds;\n let i;\n\n const numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);\n const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);\n const numberOfEllipsoids = defaultValue(\n featureTableJson.ELLIPSOIDS_LENGTH,\n 0\n );\n const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);\n\n if (numberOfBoxes > 0 && defined(featureTableJson.BOX_BATCH_IDS)) {\n const boxBatchIdsByteOffset =\n featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;\n boxBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n boxBatchIdsByteOffset,\n numberOfBoxes\n );\n }\n\n if (numberOfCylinders > 0 && defined(featureTableJson.CYLINDER_BATCH_IDS)) {\n const cylinderBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.CYLINDER_BATCH_IDS.byteOffset;\n cylinderBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n cylinderBatchIdsByteOffset,\n numberOfCylinders\n );\n }\n\n if (numberOfEllipsoids > 0 && defined(featureTableJson.ELLIPSOID_BATCH_IDS)) {\n const ellipsoidBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.ELLIPSOID_BATCH_IDS.byteOffset;\n ellipsoidBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n ellipsoidBatchIdsByteOffset,\n numberOfEllipsoids\n );\n }\n\n if (numberOfSpheres > 0 && defined(featureTableJson.SPHERE_BATCH_IDS)) {\n const sphereBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.SPHERE_BATCH_IDS.byteOffset;\n sphereBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n sphereBatchIdsByteOffset,\n numberOfSpheres\n );\n }\n\n const atLeastOneDefined =\n defined(boxBatchIds) ||\n defined(cylinderBatchIds) ||\n defined(ellipsoidBatchIds) ||\n defined(sphereBatchIds);\n const atLeastOneUndefined =\n (numberOfBoxes > 0 && !defined(boxBatchIds)) ||\n (numberOfCylinders > 0 && !defined(cylinderBatchIds)) ||\n (numberOfEllipsoids > 0 && !defined(ellipsoidBatchIds)) ||\n (numberOfSpheres > 0 && !defined(sphereBatchIds));\n\n if (atLeastOneDefined && atLeastOneUndefined) {\n throw new RuntimeError(\n \"If one group of batch ids is defined, then all batch ids must be defined.\"\n );\n }\n\n const allUndefinedBatchIds =\n !defined(boxBatchIds) &&\n !defined(cylinderBatchIds) &&\n !defined(ellipsoidBatchIds) &&\n !defined(sphereBatchIds);\n if (allUndefinedBatchIds) {\n let id = 0;\n if (!defined(boxBatchIds) && numberOfBoxes > 0) {\n boxBatchIds = new Uint16Array(numberOfBoxes);\n for (i = 0; i < numberOfBoxes; ++i) {\n boxBatchIds[i] = id++;\n }\n }\n if (!defined(cylinderBatchIds) && numberOfCylinders > 0) {\n cylinderBatchIds = new Uint16Array(numberOfCylinders);\n for (i = 0; i < numberOfCylinders; ++i) {\n cylinderBatchIds[i] = id++;\n }\n }\n if (!defined(ellipsoidBatchIds) && numberOfEllipsoids > 0) {\n ellipsoidBatchIds = new Uint16Array(numberOfEllipsoids);\n for (i = 0; i < numberOfEllipsoids; ++i) {\n ellipsoidBatchIds[i] = id++;\n }\n }\n if (!defined(sphereBatchIds) && numberOfSpheres > 0) {\n sphereBatchIds = new Uint16Array(numberOfSpheres);\n for (i = 0; i < numberOfSpheres; ++i) {\n sphereBatchIds[i] = id++;\n }\n }\n }\n\n return {\n boxes: boxBatchIds,\n cylinders: cylinderBatchIds,\n ellipsoids: ellipsoidBatchIds,\n spheres: sphereBatchIds,\n };\n}\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nfunction initialize(content, arrayBuffer, byteOffset) {\n byteOffset = defaultValue(byteOffset, 0);\n\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic number\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Geometry tile version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n const byteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n if (byteLength === 0) {\n content._readyPromise.resolve(content);\n return;\n }\n\n const featureTableJSONByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n if (featureTableJSONByteLength === 0) {\n throw new RuntimeError(\n \"Feature table must have a byte length greater than zero\"\n );\n }\n\n const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const batchTableJSONByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const featureTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n featureTableJSONByteLength\n );\n byteOffset += featureTableJSONByteLength;\n\n const featureTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n featureTableBinaryByteLength\n );\n byteOffset += featureTableBinaryByteLength;\n\n let batchTableJson;\n let batchTableBinary;\n if (batchTableJSONByteLength > 0) {\n // PERFORMANCE_IDEA: is it possible to allocate this on-demand? Perhaps keep the\n // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n //\n // We could also make another request for it, but that would make the property set/get\n // API async, and would double the number of numbers in some cases.\n batchTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n batchTableJSONByteLength\n );\n byteOffset += batchTableJSONByteLength;\n\n if (batchTableBinaryByteLength > 0) {\n // Has a batch table binary\n batchTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n batchTableBinaryByteLength\n );\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n }\n }\n\n const numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);\n const numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);\n const numberOfEllipsoids = defaultValue(\n featureTableJson.ELLIPSOIDS_LENGTH,\n 0\n );\n const numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);\n\n const totalPrimitives =\n numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;\n\n const batchTable = new Cesium3DTileBatchTable(\n content,\n totalPrimitives,\n batchTableJson,\n batchTableBinary,\n createColorChangedCallback(content)\n );\n content._batchTable = batchTable;\n\n if (totalPrimitives === 0) {\n return;\n }\n\n const modelMatrix = content.tile.computedTransform;\n\n let center;\n if (defined(featureTableJson.RTC_CENTER)) {\n center = Cartesian3.unpack(featureTableJson.RTC_CENTER);\n Matrix4.multiplyByPoint(modelMatrix, center, center);\n }\n\n const batchIds = getBatchIds(featureTableJson, featureTableBinary);\n\n if (\n numberOfBoxes > 0 ||\n numberOfCylinders > 0 ||\n numberOfEllipsoids > 0 ||\n numberOfSpheres > 0\n ) {\n let boxes;\n let cylinders;\n let ellipsoids;\n let spheres;\n\n if (numberOfBoxes > 0) {\n const boxesByteOffset =\n featureTableBinary.byteOffset + featureTableJson.BOXES.byteOffset;\n boxes = new Float32Array(\n featureTableBinary.buffer,\n boxesByteOffset,\n Vector3DTileGeometry.packedBoxLength * numberOfBoxes\n );\n }\n\n if (numberOfCylinders > 0) {\n const cylindersByteOffset =\n featureTableBinary.byteOffset + featureTableJson.CYLINDERS.byteOffset;\n cylinders = new Float32Array(\n featureTableBinary.buffer,\n cylindersByteOffset,\n Vector3DTileGeometry.packedCylinderLength * numberOfCylinders\n );\n }\n\n if (numberOfEllipsoids > 0) {\n const ellipsoidsByteOffset =\n featureTableBinary.byteOffset + featureTableJson.ELLIPSOIDS.byteOffset;\n ellipsoids = new Float32Array(\n featureTableBinary.buffer,\n ellipsoidsByteOffset,\n Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids\n );\n }\n\n if (numberOfSpheres > 0) {\n const spheresByteOffset =\n featureTableBinary.byteOffset + featureTableJson.SPHERES.byteOffset;\n spheres = new Float32Array(\n featureTableBinary.buffer,\n spheresByteOffset,\n Vector3DTileGeometry.packedSphereLength * numberOfSpheres\n );\n }\n\n content._geometries = new Vector3DTileGeometry({\n boxes: boxes,\n boxBatchIds: batchIds.boxes,\n cylinders: cylinders,\n cylinderBatchIds: batchIds.cylinders,\n ellipsoids: ellipsoids,\n ellipsoidBatchIds: batchIds.ellipsoids,\n spheres: spheres,\n sphereBatchIds: batchIds.spheres,\n center: center,\n modelMatrix: modelMatrix,\n batchTable: batchTable,\n boundingVolume: content.tile.boundingVolume.boundingVolume,\n });\n\n return content._geometries.readyPromise.then(function () {\n return content;\n });\n }\n\n return Promise.resolve(content);\n}\n\nfunction createFeatures(content) {\n const featuresLength = content.featuresLength;\n if (!defined(content._features) && featuresLength > 0) {\n const features = new Array(featuresLength);\n if (defined(content._geometries)) {\n content._geometries.createFeatures(content, features);\n }\n content._features = features;\n }\n}\n\nGeometry3DTileContent.prototype.hasProperty = function (batchId, name) {\n return this._batchTable.hasProperty(batchId, name);\n};\n\nGeometry3DTileContent.prototype.getFeature = function (batchId) {\n createFeatures(this);\n return this._features[batchId];\n};\n\nGeometry3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n if (defined(this._geometries)) {\n this._geometries.applyDebugSettings(enabled, color);\n }\n};\n\nGeometry3DTileContent.prototype.applyStyle = function (style) {\n createFeatures(this);\n if (defined(this._geometries)) {\n this._geometries.applyStyle(style, this._features);\n }\n};\n\nGeometry3DTileContent.prototype.update = function (tileset, frameState) {\n if (defined(this._geometries)) {\n this._geometries.classificationType = this._tileset.classificationType;\n this._geometries.debugWireframe = this._tileset.debugWireframe;\n this._geometries.update(frameState);\n }\n if (defined(this._batchTable) && this._geometries._ready) {\n this._batchTable.update(tileset, frameState);\n }\n};\n\nGeometry3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nGeometry3DTileContent.prototype.destroy = function () {\n this._geometries = this._geometries && this._geometries.destroy();\n this._batchTable = this._batchTable && this._batchTable.destroy();\n return destroyObject(this);\n};\nexport default Geometry3DTileContent;\n", "import Check from \"./Check.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Hilbert Order helper functions.\n *\n * @namespace HilbertOrder\n */\nconst HilbertOrder = {};\n\n/**\n * Computes the Hilbert index at the given level from 2D coordinates.\n *\n * @param {Number} level The level of the curve\n * @param {Number} x The X coordinate\n * @param {Number} y The Y coordinate\n * @returns {Number} The Hilbert index.\n * @private\n */\nHilbertOrder.encode2D = function (level, x, y) {\n const n = Math.pow(2, level);\n const p = {\n x: x,\n y: y,\n };\n let rx,\n ry,\n s,\n // eslint-disable-next-line no-undef\n index = BigInt(0);\n\n for (s = n / 2; s > 0; s /= 2) {\n rx = (p.x & s) > 0 ? 1 : 0;\n ry = (p.y & s) > 0 ? 1 : 0;\n // eslint-disable-next-line no-undef\n index += BigInt(((3 * rx) ^ ry) * s * s);\n rotate(n, p, rx, ry);\n }\n\n return index;\n};\n\n/**\n * Computes the 2D coordinates from the Hilbert index at the given level.\n *\n * @param {Number} level The level of the curve\n * @param {BigInt} index The Hilbert index\n * @returns {Number[]} An array containing the 2D coordinates ([x, y]) corresponding to the Morton index.\n * @private\n */\nHilbertOrder.decode2D = function (level, index) {\n const n = Math.pow(2, level);\n const p = {\n x: 0,\n y: 0,\n };\n let rx, ry, s, t;\n\n for (s = 1, t = index; s < n; s *= 2) {\n // eslint-disable-next-line no-undef\n rx = 1 & Number(t / BigInt(2));\n // eslint-disable-next-line no-undef\n ry = 1 & Number(t ^ BigInt(rx));\n rotate(s, p, rx, ry);\n p.x += s * rx;\n p.y += s * ry;\n // eslint-disable-next-line no-undef\n t /= BigInt(4);\n }\n\n return [p.x, p.y];\n};\n\n/**\n * @private\n */\nfunction rotate(n, p, rx, ry) {\n if (ry !== 0) {\n return;\n }\n\n if (rx === 1) {\n p.x = n - 1 - p.x;\n p.y = n - 1 - p.y;\n }\n\n const t = p.x;\n p.x = p.y;\n p.y = t;\n}\n\nexport default HilbertOrder;\n", "/* eslint-disable new-cap */\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * S2\n * --\n *\n * This implementation is based on the S2 C++ reference implementation: https://github.com/google/s2geometry\n *\n *\n * Overview:\n * ---------\n * The S2 library decomposes the unit sphere into a hierarchy of cells. A cell is a quadrilateral bounded by 4 geodesics.\n * The 6 root cells are obtained by projecting the six faces of a cube on a unit sphere. Each root cell follows a quadtree\n * subdivision scheme, i.e. each cell subdivides into 4 smaller cells that cover the same area as the parent cell. The S2 cell\n * hierarchy extends from level 0 (root cells) to level 30 (leaf cells). The root cells are rotated to enable a continuous Hilbert\n * curve to map all 6 faces of the cube.\n *\n *\n * Cell ID:\n * --------\n * Each cell in S2 can be uniquely identified using a 64-bit unsigned integer, its cell ID. The first 3 bits of the cell ID are the face bits, i.e.\n * they indicate which of the 6 faces of the cube a cell lies on. After the face bits are the position bits, i.e. they indicate the position\n * of the cell along the Hilbert curve. After the positions bits is the sentinel bit, which is always set to 1, and it indicates the level of the\n * cell. Again, the level can be between 0 and 30 in S2.\n *\n * Note: In the illustration below, the face bits are marked with 'f', the position bits are marked with 'p', the zero bits are marked with '-'.\n *\n * Cell ID (base 10): 3170534137668829184\n * Cell ID (base 2) : 0010110000000000000000000000000000000000000000000000000000000000\n *\n * 001 0110000000000000000000000000000000000000000000000000000000000\n * fff pps----------------------------------------------------------\n *\n * For the cell above, we can see that it lies on face 1 (01), with a Hilbert index of 1 (1).\n *\n *\n * Cell Subdivision:\n * ------------------\n * Cells in S2 subdivide recursively using quadtree subdivision. For each cell, you can get a child of index [0-3]. To compute the child at index i,\n * insert the base 2 representation of i to the right of the parent's position bits. Ensure that the sentinel bit is also shifted two places to the right.\n *\n * Parent Cell ID (base 10) : 3170534137668829184\n * Parent Cell ID (base 2) : 0010110000000000000000000000000000000000000000000000000000000000\n *\n * 001 0110000000000000000000000000000000000000000000000000000000000\n * fff pps----------------------------------------------------------\n *\n * To get the 3rd child of the cell above, we insert the binary representation of 3 to the right of the parent's position bits:\n *\n * Note: In the illustration below, the bits to be added are highlighted with '^'.\n *\n * 001 0111100000000000000000000000000000000000000000000000000000000\n * fff pppps--------------------------------------------------------\n * ^^\n *\n * Child(3) Cell ID (base 10) : 3386706919782612992\n * Child(3) Cell ID (base 2) : 0010111100000000000000000000000000000000000000000000000000000000\n *\n * Cell Token:\n * -----------\n * To provide a more concise representation of the S2 cell ID, we can use their hexadecimal representation.\n *\n * Cell ID (base 10): 3170534137668829184\n * Cell ID (base 2) : 0010110000000000000000000000000000000000000000000000000000000000\n *\n * We remove all trailing zero bits, until we reach the nybble (4 bits) that contains the sentinel bit.\n *\n * Note: In the illustration below, the bits to be removed are highlighted with 'X'.\n *\n * 0010110000000000000000000000000000000000000000000000000000000000\n * fffpps--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n *\n * We convert the remaining bits to their hexadecimal representation.\n *\n * Base 2: 0010 1100\n * Base 16: \"2\" \"c\"\n *\n * Cell Token: \"2c\"\n *\n * To compute the cell ID from the token, we simply add enough zeros to the right to make the ID span 64 bits.\n *\n * Coordinate Transforms:\n * ----------------------\n *\n * To go from a cell in S2 to a point on the ellipsoid, the following order of transforms is applied:\n *\n * 1. (Cell ID): S2 cell ID\n * 2. (Face, I, J): Leaf cell coordinates, where i and j are in range [0, 2^30 - 1]\n * 3. (Face, S, T): Cell space coordinates, where s and t are in range [0, 1].\n * 4. (Face, Si, Ti): Discrete cell space coordinates, where si and ti are in range [0, 2^31]\n * 5. (Face, U, V): Cube space coordinates, where u and v are in range [-1, 1]. We apply the non-linear quadratic transform here.\n * 6. (X, Y, Z): Direction vector, where vector may not be unit length. Can be normalized to obtain point on unit sphere\n * 7. (Latitude, Longitude): Direction vector, where latitude is in range [-90, 90] and longitude is in range [-180, 180]\n *\n * @ignore\n */\n\n// The maximum level supported within an S2 cell ID. Each level is represented by two bits in the final cell ID\nconst S2_MAX_LEVEL = 30;\n\n// The maximum index of a valid leaf cell plus one. The range of valid leaf cell indices is [0..S2_LIMIT_IJ-1].\nconst S2_LIMIT_IJ = 1 << S2_MAX_LEVEL;\n\n// The maximum value of an si- or ti-coordinate. The range of valid (si,ti) values is [0..S2_MAX_SITI]. Use `>>>` to convert to unsigned.\nconst S2_MAX_SITI = (1 << (S2_MAX_LEVEL + 1)) >>> 0;\n\n// The number of bits in a S2 cell ID used for specifying the position along the Hilbert curve\nconst S2_POSITION_BITS = 2 * S2_MAX_LEVEL + 1;\n\n// The number of bits per I and J in the lookup tables\nconst S2_LOOKUP_BITS = 4;\n\n// Lookup table for mapping 10 bits of IJ + orientation to 10 bits of Hilbert curve position + orientation.\nconst S2_LOOKUP_POSITIONS = [];\n\n// Lookup table for mapping 10 bits of IJ + orientation to 10 bits of Hilbert curve position + orientation.\nconst S2_LOOKUP_IJ = [];\n\n// Lookup table of two bits of IJ from two bits of curve position, based also on the current curve orientation from the swap and invert bits\nconst S2_POSITION_TO_IJ = [\n [0, 1, 3, 2], // 0: Normal order, no swap or invert\n [0, 2, 3, 1], // 1: Swap bit set, swap I and J bits\n [3, 2, 0, 1], // 2: Invert bit set, invert bits\n [3, 1, 0, 2], // 3: Swap and invert bits set\n];\n\n// Mask that specifies the swap orientation bit for the Hilbert curve\nconst S2_SWAP_MASK = 1;\n\n// Mask that specifies the invert orientation bit for the Hilbert curve\nconst S2_INVERT_MASK = 2;\n\n// Lookup for the orientation update mask of one of the four sub-cells within a higher level cell.\n// This mask is XOR'ed with the current orientation to get the sub-cell orientation.\nconst S2_POSITION_TO_ORIENTATION_MASK = [\n S2_SWAP_MASK,\n 0,\n 0,\n S2_SWAP_MASK | S2_INVERT_MASK,\n];\n\n/**\n * Represents a cell in the S2 geometry library.\n *\n * @alias S2Cell\n * @constructor\n *\n * @param {BigInt} [cellId] The 64-bit S2CellId.\n * @private\n */\nfunction S2Cell(cellId) {\n if (!FeatureDetection.supportsBigInt()) {\n throw new RuntimeError(\"S2 required BigInt support\");\n }\n this._cellId = cellId;\n this._level = S2Cell.getLevel(cellId);\n}\n\n/**\n * Creates a new S2Cell from a token. A token is a hexadecimal representation of the 64-bit S2CellId.\n *\n * @param {String} token The token for the S2 Cell.\n * @returns {S2Cell} Returns a new S2Cell.\n * @private\n */\nS2Cell.fromToken = function (token) {\n return new S2Cell(S2Cell.getIdFromToken(token));\n};\n\n/**\n * Validates an S2 cell ID.\n *\n * @param {BigInt} [cellId] The S2CellId.\n * @returns {Boolean} Returns true if the cell ID is valid, returns false otherwise.\n * @private\n */\nS2Cell.isValidId = function (cellId) {\n // Check if sentinel bit is missing.\n if (cellId <= 0) {\n return false;\n }\n\n // Check if face bits indicate a valid value, in range [0-5].\n // eslint-disable-next-line\n if (cellId >> BigInt(S2_POSITION_BITS) > 5) {\n return false;\n }\n\n // Check trailing 1 bit is in one of the even bit positions allowed for the 30 levels, using a bitmask.\n // eslint-disable-next-line no-undef\n const lowestSetBit = cellId & (~cellId + BigInt(1));\n // eslint-disable-next-line\n if (!(lowestSetBit & BigInt(\"0x1555555555555555\"))) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Validates an S2 cell token.\n *\n * @param {String} [token] The hexadecimal representation of an S2CellId.\n * @returns {Boolean} Returns true if the token is valid, returns false otherwise.\n * @private\n */\nS2Cell.isValidToken = function (token) {\n if (!/^[0-9a-fA-F]{1,16}$/.test(token)) {\n return false;\n }\n\n return S2Cell.isValidId(S2Cell.getIdFromToken(token));\n};\n\n/**\n * Converts an S2 cell token to a 64-bit S2 cell ID.\n *\n * @param {String} [token] The hexadecimal representation of an S2CellId. Expected to be a valid S2 token.\n * @returns {BigInt} Returns the S2 cell ID.\n * @private\n */\nS2Cell.getIdFromToken = function (token) {\n return BigInt(\"0x\" + token + \"0\".repeat(16 - token.length)); // eslint-disable-line\n};\n\n/**\n * Converts a 64-bit S2 cell ID to an S2 cell token.\n *\n * @param {BigInt} [cellId] The S2 cell ID.\n * @returns {BigInt} Returns hexadecimal representation of an S2CellId.\n * @private\n */\nS2Cell.getTokenFromId = function (cellId) {\n const trailingZeroHexChars = Math.floor(countTrailingZeroBits(cellId) / 4);\n const hexString = cellId.toString(16).replace(/0*$/, \"\");\n\n const zeroString = Array(17 - trailingZeroHexChars - hexString.length).join(\n \"0\"\n );\n return zeroString + hexString;\n};\n\n/**\n * Gets the level of the cell from the cell ID.\n *\n * @param {BigInt} [cellId] The S2 cell ID.\n * @returns {number} Returns the level of the cell.\n * @private\n */\nS2Cell.getLevel = function (cellId) {\n let lsbPosition = 0;\n // eslint-disable-next-line\n while (cellId !== BigInt(0)) {\n // eslint-disable-next-line\n if (cellId & BigInt(1)) {\n break;\n }\n lsbPosition++;\n cellId = cellId >> BigInt(1); // eslint-disable-line\n }\n\n // We use (>> 1) because there are 2 bits per level.\n return S2_MAX_LEVEL - (lsbPosition >> 1);\n};\n\n/**\n * Gets the child cell of the cell at the given index.\n *\n * @param {Number} index An integer index of the child.\n * @returns {S2Cell} The child of the S2Cell.\n * @private\n */\nS2Cell.prototype.getChild = function (index) {\n // Shift sentinel bit 2 positions to the right.\n // eslint-disable-next-line no-undef\n const newLsb = lsb(this._cellId) >> BigInt(2);\n // Insert child index before the sentinel bit.\n // eslint-disable-next-line no-undef\n const childCellId = this._cellId + BigInt(2 * index + 1 - 4) * newLsb;\n return new S2Cell(childCellId);\n};\n\n/**\n * Gets the parent cell of an S2Cell.\n *\n * @returns {S2Cell} Returns the parent of the S2Cell.\n * @private\n */\nS2Cell.prototype.getParent = function () {\n// Shift the sentinel bit 2 positions to the left.\n // eslint-disable-next-line no-undef\n const newLsb = lsb(this._cellId) << BigInt(2);\n // Erase the left over bits to the right of the sentinel bit.\n // eslint-disable-next-line no-undef\n return new S2Cell((this._cellId & (~newLsb + BigInt(1))) | newLsb);\n};\n\n/**\n * Gets the parent cell at the given level.\n *\n * @returns {S2Cell} Returns the parent of the S2Cell.\n * @private\n */\nS2Cell.prototype.getParentAtLevel = function (level) {\nconst newLsb = lsbForLevel(level);\n return new S2Cell((this._cellId & -newLsb) | newLsb);\n};\n\n/**\n * Get center of the S2 cell.\n *\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @returns {Cartesian} The position of center of the S2 cell.\n * @private\n */\nS2Cell.prototype.getCenter = function (ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n let center = getS2Center(this._cellId, this._level);\n // Normalize XYZ.\n center = Cartesian3.normalize(center, center);\n const cartographic = new Cartographic.fromCartesian(\n center,\n Ellipsoid.UNIT_SPHERE\n );\n // Interpret as geodetic coordinates on the ellipsoid.\n return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3());\n};\n\n/**\n * Get vertex of the S2 cell. Vertices are indexed in CCW order.\n *\n * @param {Number} index An integer index of the vertex. Must be in the range [0-3].\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @returns {Cartesian} The position of the vertex of the S2 cell.\n * @private\n */\nS2Cell.prototype.getVertex = function (index, ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n let vertex = getS2Vertex(this._cellId, this._level, index);\n // Normalize XYZ.\n vertex = Cartesian3.normalize(vertex, vertex);\n const cartographic = new Cartographic.fromCartesian(\n vertex,\n Ellipsoid.UNIT_SPHERE\n );\n // Interpret as geodetic coordinates on the ellipsoid.\n return Cartographic.toCartesian(cartographic, ellipsoid, new Cartesian3());\n};\n\n/**\n * Creates an S2Cell from its face, position along the Hilbert curve for a given level.\n *\n * @param {Number} face The root face of S2 this cell is on. Must be in the range [0-5].\n * @param {BigInt} position The position along the Hilbert curve. Must be in the range [0-4**level).\n * @param {Number} level The level of the S2 curve. Must be in the range [0-30].\n * @returns {S2Cell} A new S2Cell from the given parameters.\n * @private\n */\nS2Cell.fromFacePositionLevel = function (face, position, level) {\n const faceBitString =\n (face < 4 ? \"0\" : \"\") + (face < 2 ? \"0\" : \"\") + face.toString(2);\n const positionBitString = position.toString(2);\n const positionPrefixPadding = Array(\n 2 * level - positionBitString.length + 1\n ).join(\"0\");\n const positionSuffixPadding = Array(S2_POSITION_BITS - 2 * level).join(\"0\");\n\n // eslint-disable-next-line no-undef\n const cellId = BigInt(\n `0b${faceBitString}${positionPrefixPadding}${positionBitString}1${\n // Adding the sentinel bit that always follows the position bits.\n positionSuffixPadding\n }`\n );\n return new S2Cell(cellId);\n};\n\n/**\n * @private\n */\nfunction getS2Center(cellId, level) {\n const faceSiTi = convertCellIdToFaceSiTi(cellId, level);\n return convertFaceSiTitoXYZ(faceSiTi[0], faceSiTi[1], faceSiTi[2]);\n}\n/**\n * @private\n */\nfunction getS2Vertex(cellId, level, index) {\n const faceIJ = convertCellIdToFaceIJ(cellId, level);\n const uv = convertIJLeveltoBoundUV([faceIJ[1], faceIJ[2]], level);\n // Handles CCW ordering of the vertices.\n const y = (index >> 1) & 1;\n return convertFaceUVtoXYZ(faceIJ[0], uv[0][y ^ (index & 1)], uv[1][y]);\n}\n\n// S2 Coordinate Conversions\n\n/**\n * @private\n */\nfunction convertCellIdToFaceSiTi(cellId, level) {\n const faceIJ = convertCellIdToFaceIJ(cellId);\n const face = faceIJ[0];\n const i = faceIJ[1];\n const j = faceIJ[2];\n\n // We're resolving the center when we do the coordinate transform here. For the leaf cells, we're adding half the cell size\n // (remember that this space has 31 levels - which allows us to pick center and edges of the leaf cells). For non leaf cells,\n // we get one of either two cells diagonal to the cell center. The correction is used to make sure we pick the leaf cell edges\n // that represent the parent cell center.\n const isLeaf = level === 30;\n const shouldCorrect =\n !isLeaf && (BigInt(i) ^ (cellId >> BigInt(2))) & BigInt(1); // eslint-disable-line\n const correction = isLeaf ? 1 : shouldCorrect ? 2 : 0;\n const si = (i << 1) + correction;\n const ti = (j << 1) + correction;\n return [face, si, ti];\n}\n\n/**\n * @private\n */\nfunction convertCellIdToFaceIJ(cellId) {\n if (S2_LOOKUP_POSITIONS.length === 0) {\n generateLookupTable();\n }\n\n // eslint-disable-next-line no-undef\n const face = Number(cellId >> BigInt(S2_POSITION_BITS));\n let bits = face & S2_SWAP_MASK;\n const lookupMask = (1 << S2_LOOKUP_BITS) - 1;\n\n let i = 0;\n let j = 0;\n\n for (let k = 7; k >= 0; k--) {\n const numberOfBits =\n k === 7 ? S2_MAX_LEVEL - 7 * S2_LOOKUP_BITS : S2_LOOKUP_BITS;\n const extractMask = (1 << (2 * numberOfBits)) - 1;\n bits +=\n Number(\n (cellId >> BigInt(k * 2 * S2_LOOKUP_BITS + 1)) & BigInt(extractMask) // eslint-disable-line\n ) << 2;\n\n bits = S2_LOOKUP_IJ[bits];\n\n const offset = k * S2_LOOKUP_BITS;\n i += (bits >> (S2_LOOKUP_BITS + 2)) << offset;\n j += ((bits >> 2) & lookupMask) << offset;\n\n bits &= S2_SWAP_MASK | S2_INVERT_MASK;\n }\n\n return [face, i, j];\n}\n\n/**\n * @private\n */\nfunction convertFaceSiTitoXYZ(face, si, ti) {\n const s = convertSiTitoST(si);\n const t = convertSiTitoST(ti);\n\n const u = convertSTtoUV(s);\n const v = convertSTtoUV(t);\n return convertFaceUVtoXYZ(face, u, v);\n}\n\n/**\n * @private\n */\nfunction convertFaceUVtoXYZ(face, u, v) {\n switch (face) {\n case 0:\n return new Cartesian3(1, u, v);\n case 1:\n return new Cartesian3(-u, 1, v);\n case 2:\n return new Cartesian3(-u, -v, 1);\n case 3:\n return new Cartesian3(-1, -v, -u);\n case 4:\n return new Cartesian3(v, -1, -u);\n default:\n return new Cartesian3(v, u, -1);\n }\n}\n\n/**\n * S2 provides 3 methods for the non-linear transform: linear, quadratic and tangential.\n * This implementation uses the quadratic method because it provides a good balance of\n * accuracy and speed.\n *\n * For a more detailed comparison of these transform methods, see\n * {@link https://github.com/google/s2geometry/blob/0c4c460bdfe696da303641771f9def900b3e440f/src/s2/s2metrics.cc}\n * @private\n */\nfunction convertSTtoUV(s) {\n if (s >= 0.5) {\n return (1 / 3) * (4 * s * s - 1);\n }\n return (1 / 3) * (1 - 4 * (1 - s) * (1 - s));\n}\n\n/**\n * @private\n */\nfunction convertSiTitoST(si) {\n return (1.0 / S2_MAX_SITI) * si;\n}\n\n/**\n * @private\n */\nfunction convertIJLeveltoBoundUV(ij, level) {\n const result = [[], []];\n const cellSize = getSizeIJ(level);\n for (let d = 0; d < 2; ++d) {\n const ijLow = ij[d] & -cellSize;\n const ijHigh = ijLow + cellSize;\n result[d][0] = convertSTtoUV(convertIJtoSTMinimum(ijLow));\n result[d][1] = convertSTtoUV(convertIJtoSTMinimum(ijHigh));\n }\n return result;\n}\n\n/**\n * @private\n */\nfunction getSizeIJ(level) {\n return (1 << (S2_MAX_LEVEL - level)) >>> 0;\n}\n\n/**\n * @private\n */\nfunction convertIJtoSTMinimum(i) {\n return (1.0 / S2_LIMIT_IJ) * i;\n}\n\n// Utility Functions\n\n/**\n * This function generates 4 variations of a Hilbert curve of level 4, based on the S2_POSITION_TO_IJ table, for fast lookups of (i, j)\n * to position along Hilbert curve. The reference C++ implementation uses an iterative approach, however, this function is implemented\n * recursively.\n *\n * See {@link https://github.com/google/s2geometry/blob/c59d0ca01ae3976db7f8abdc83fcc871a3a95186/src/s2/s2cell_id.cc#L75-L109}\n * @private\n */\nfunction generateLookupCell(\n level,\n i,\n j,\n originalOrientation,\n position,\n orientation\n) {\n if (level === S2_LOOKUP_BITS) {\n const ij = (i << S2_LOOKUP_BITS) + j;\n S2_LOOKUP_POSITIONS[(ij << 2) + originalOrientation] =\n (position << 2) + orientation;\n S2_LOOKUP_IJ[(position << 2) + originalOrientation] =\n (ij << 2) + orientation;\n } else {\n level++;\n i <<= 1;\n j <<= 1;\n position <<= 2;\n const r = S2_POSITION_TO_IJ[orientation];\n generateLookupCell(\n level,\n i + (r[0] >> 1),\n j + (r[0] & 1),\n originalOrientation,\n position,\n orientation ^ S2_POSITION_TO_ORIENTATION_MASK[0]\n );\n generateLookupCell(\n level,\n i + (r[1] >> 1),\n j + (r[1] & 1),\n originalOrientation,\n position + 1,\n orientation ^ S2_POSITION_TO_ORIENTATION_MASK[1]\n );\n generateLookupCell(\n level,\n i + (r[2] >> 1),\n j + (r[2] & 1),\n originalOrientation,\n position + 2,\n orientation ^ S2_POSITION_TO_ORIENTATION_MASK[2]\n );\n generateLookupCell(\n level,\n i + (r[3] >> 1),\n j + (r[3] & 1),\n originalOrientation,\n position + 3,\n orientation ^ S2_POSITION_TO_ORIENTATION_MASK[3]\n );\n }\n}\n\n/**\n * @private\n */\nfunction generateLookupTable() {\n generateLookupCell(0, 0, 0, 0, 0, 0);\n generateLookupCell(0, 0, 0, S2_SWAP_MASK, 0, S2_SWAP_MASK);\n generateLookupCell(0, 0, 0, S2_INVERT_MASK, 0, S2_INVERT_MASK);\n generateLookupCell(\n 0,\n 0,\n 0,\n S2_SWAP_MASK | S2_INVERT_MASK,\n 0,\n S2_SWAP_MASK | S2_INVERT_MASK\n );\n}\n\n/**\n * Return the lowest-numbered bit that is on for this cell id\n * @private\n */\nfunction lsb(cellId) {\n return cellId & (~cellId + BigInt(1)); // eslint-disable-line\n}\n\n/**\n * Return the lowest-numbered bit that is on for cells at the given level.\n * @private\n */\nfunction lsbForLevel(level) {\n return BigInt(1) << BigInt(2 * (S2_MAX_LEVEL - level)); // eslint-disable-line\n}\n\n// Lookup table for getting trailing zero bits.\n// https://graphics.stanford.edu/~seander/bithacks.html\nconst Mod67BitPosition = [\n 64,\n 0,\n 1,\n 39,\n 2,\n 15,\n 40,\n 23,\n 3,\n 12,\n 16,\n 59,\n 41,\n 19,\n 24,\n 54,\n 4,\n 64,\n 13,\n 10,\n 17,\n 62,\n 60,\n 28,\n 42,\n 30,\n 20,\n 51,\n 25,\n 44,\n 55,\n 47,\n 5,\n 32,\n 65,\n 38,\n 14,\n 22,\n 11,\n 58,\n 18,\n 53,\n 63,\n 9,\n 61,\n 27,\n 29,\n 50,\n 43,\n 46,\n 31,\n 37,\n 21,\n 57,\n 52,\n 8,\n 26,\n 49,\n 45,\n 36,\n 56,\n 7,\n 48,\n 35,\n 6,\n 34,\n 33,\n 0,\n];\n\n/**\n * Return the number of trailing zeros in number.\n * @private\n */\nfunction countTrailingZeroBits(x) {\n return Mod67BitPosition[(-x & x) % BigInt(67)]; // eslint-disable-line\n}\n\nexport default S2Cell;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * Check if a specific extension is present on a JSON object. This can be used\n * for either 3D Tiles extensions or glTF extensions\n * @param {Object} json The JSON object\n * @param {String} extensionName The name of the extension, e.g. '3DTILES_implicit_tiling'\n * @returns {Boolean} True if the extension is present\n * @private\n */\nfunction hasExtension(json, extensionName) {\n return (\n defined(json) &&\n defined(json.extensions) &&\n defined(json.extensions[extensionName])\n );\n}\n\nexport default hasExtension;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * An availability bitstream for use in an {@link ImplicitSubtree}. This handles\n * both Uint8Array bitstreams and constant values.\n *\n * @alias ImplicitAvailabilityBitstream\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {Number} options.lengthBits The length of the bitstream in bits\n * @param {Boolean} [options.constant] A single boolean value indicating the value of all the bits in the bitstream if they are all the same\n * @param {Uint8Array} [options.bitstream] An array of bytes storing the bitstream in binary\n * @param {Number} [options.availableCount] A number indicating how many 1 bits are found in the bitstream\n * @param {Boolean} [options.computeAvailableCountEnabled=false] If true, and options.availableCount is undefined, the availableCount will be computed from the bitstream.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitAvailabilityBitstream(options) {\n const lengthBits = options.lengthBits;\n let availableCount = options.availableCount;\n\n const constant = options.constant;\n const bitstream = options.bitstream;\n\n if (defined(constant)) {\n // if defined, constant must be 1 which means all tiles are available\n availableCount = lengthBits;\n } else {\n const expectedLength = Math.ceil(lengthBits / 8);\n if (bitstream.length !== expectedLength) {\n throw new RuntimeError(\n `Availability bitstream must be exactly ${expectedLength} bytes long to store ${lengthBits} bits. Actual bitstream was ${bitstream.length} bytes long.`\n );\n }\n\n // Only compute the available count if requested, as this involves looping\n // over the bitstream.\n const computeAvailableCountEnabled = defaultValue(\n options.computeAvailableCountEnabled,\n false\n );\n if (!defined(availableCount) && computeAvailableCountEnabled) {\n availableCount = count1Bits(bitstream, lengthBits);\n }\n }\n\n this._lengthBits = lengthBits;\n this._availableCount = availableCount;\n this._constant = constant;\n this._bitstream = bitstream;\n}\n\n/**\n * Count the number of bits with value 1 in the bitstream. This is used for\n * computing availableCount if not precomputed\n *\n * @param {Uint8Array} bitstream The bitstream typed array\n * @param {Number} lengthBits How many bits are in the bitstream\n * @private\n */\nfunction count1Bits(bitstream, lengthBits) {\n let count = 0;\n for (let i = 0; i < lengthBits; i++) {\n const byteIndex = i >> 3;\n const bitIndex = i % 8;\n count += (bitstream[byteIndex] >> bitIndex) & 1;\n }\n return count;\n}\n\nObject.defineProperties(ImplicitAvailabilityBitstream.prototype, {\n /**\n * The length of the bitstream in bits.\n *\n * @memberof ImplicitAvailabilityBitstream.prototype\n *\n * @type {Number}\n * @readonly\n * @private\n */\n lengthBits: {\n get: function () {\n return this._lengthBits;\n },\n },\n /**\n * The number of bits in the bitstream with value <code>1</code>.\n *\n * @memberof ImplicitAvailabilityBitstream.prototype\n *\n * @type {Number}\n * @readonly\n * @private\n */\n availableCount: {\n get: function () {\n return this._availableCount;\n },\n },\n});\n\n/**\n * Get a bit from the availability bitstream as a Boolean. If the bitstream\n * is a constant, the constant value is returned instead.\n *\n * @param {Number} index The integer index of the bit.\n * @returns {Boolean} The value of the bit\n * @private\n */\nImplicitAvailabilityBitstream.prototype.getBit = function (index) {\n if (defined(this._constant)) {\n return this._constant;\n }\n\n // byteIndex is floor(index / 8)\n const byteIndex = index >> 3;\n const bitIndex = index % 8;\n\n return ((this._bitstream[byteIndex] >> bitIndex) & 1) === 1;\n};\n\nexport default ImplicitAvailabilityBitstream;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * This class represents a single entity in the <code>MetadataTable</code> owned by an implicit subtree. The entity is specified by the entityId.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {MetadataTable} options.metadataTable The metadata table.\n * @param {MetadataClass} options.class The class that the metadata conforms to.\n * @param {Number} options.entityId The ID of the entity the metadata belongs to.\n * @param {Object} options.propertyTableJson The JSON that contains the property table of the entity.\n *\n * @alias ImplicitMetadataView\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitMetadataView(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const metadataTable = options.metadataTable;\n const metadataClass = options.class;\n const entityId = options.entityId;\n const propertyTableJson = options.propertyTableJson;\n\n this._class = metadataClass;\n this._metadataTable = metadataTable;\n this._entityId = entityId;\n\n this._extensions = propertyTableJson.extensions;\n this._extras = propertyTableJson.extras;\n}\n\nObject.defineProperties(ImplicitMetadataView.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof ImplicitMetadataView.prototype\n * @type {MetadataClass}\n * @readonly\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof ImplicitMetadataView.prototype\n * @type {Object}\n * @readonly\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof ImplicitMetadataView.prototype\n * @type {Object}\n * @readonly\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the metadata contains this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the tile has this property.\n * @private\n */\nImplicitMetadataView.prototype.hasProperty = function (propertyId) {\n return this._metadataTable.hasProperty(propertyId);\n};\n\n/**\n * Returns whether the metadata contains a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the tile has a property with the given semantic.\n * @private\n */\nImplicitMetadataView.prototype.hasPropertyBySemantic = function (semantic) {\n return this._metadataTable.hasPropertyBySemantic(semantic);\n};\n\n/**\n * Returns an array of property IDs in the metadata table.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nImplicitMetadataView.prototype.getPropertyIds = function (results) {\n return this._metadataTable.getPropertyIds(results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this property.\n * @private\n */\nImplicitMetadataView.prototype.getProperty = function (propertyId) {\n return this._metadataTable.getProperty(this._entityId, propertyId);\n};\n\n/**\n * Sets the value of the property with the given ID in the metadata table.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitMetadataView.prototype.setProperty = function (propertyId, value) {\n return this._metadataTable.setProperty(this._entityId, propertyId, value);\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic in the metadata table.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this semantic.\n * @private\n */\nImplicitMetadataView.prototype.getPropertyBySemantic = function (semantic) {\n return this._metadataTable.getPropertyBySemantic(this._entityId, semantic);\n};\n\n/**\n * Sets the value of the property with the given semantic in the metadata table.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\n\nImplicitMetadataView.prototype.setPropertyBySemantic = function (\n semantic,\n value\n) {\n return this._metadataTable.setPropertyBySemantic(\n this._entityId,\n semantic,\n value\n );\n};\n\nexport default ImplicitMetadataView;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The subdivision scheme for an implicit tileset.\n *\n * @enum {String}\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst ImplicitSubdivisionScheme = {\n /**\n * A quadtree divides a parent tile into four children, split at the midpoint\n * of the x and y dimensions of the bounding box\n * @type {String}\n * @constant\n * @private\n */\n QUADTREE: \"QUADTREE\",\n /**\n * An octree divides a parent tile into eight children, split at the midpoint\n * of the x, y, and z dimensions of the bounding box.\n * @type {String}\n * @constant\n * @private\n */\n OCTREE: \"OCTREE\",\n};\n\n/**\n * Get the branching factor for the given subdivision scheme\n * @param {ImplicitSubdivisionScheme} subdivisionScheme The subdivision scheme\n * @returns {Number} The branching factor, either 4 for QUADTREE or 8 for OCTREE\n * @private\n */\nImplicitSubdivisionScheme.getBranchingFactor = function (subdivisionScheme) {\n switch (subdivisionScheme) {\n case ImplicitSubdivisionScheme.OCTREE:\n return 8;\n case ImplicitSubdivisionScheme.QUADTREE:\n return 4;\n}\n};\n\nexport default Object.freeze(ImplicitSubdivisionScheme);\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An entity containing metadata.\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @alias MetadataEntity\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEntity() {}\n\nObject.defineProperties(MetadataEntity.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof MetadataEntity.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n});\n\n/**\n * Returns whether the entity has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the entity has this property.\n * @private\n */\nMetadataEntity.prototype.hasProperty = function (propertyId) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns whether the entity has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the entity has a property with the given semantic.\n * @private\n */\nMetadataEntity.prototype.hasPropertyBySemantic = function (semantic) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nMetadataEntity.prototype.getPropertyIds = function (results) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n * @private\n */\nMetadataEntity.prototype.getProperty = function (propertyId) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.prototype.setProperty = function (propertyId, value) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n * @private\n */\nMetadataEntity.prototype.getPropertyBySemantic = function (semantic) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.prototype.setPropertyBySemantic = function (semantic, value) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns whether the entity has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {Boolean} Whether the entity has this property.\n *\n * @private\n */\nMetadataEntity.hasProperty = function (\n propertyId,\n properties,\n classDefinition\n) {\n if (defined(properties[propertyId])) {\n return true;\n }\n\n const classProperties = classDefinition.properties;\n if (!defined(classProperties)) {\n return false;\n }\n\n const classProperty = classProperties[propertyId];\n if (defined(classProperty) && defined(classProperty.default)) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Returns whether the entity has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {Boolean} Whether the entity has a property with the given semantic.\n *\n * @private\n */\nMetadataEntity.hasPropertyBySemantic = function (\n semantic,\n properties,\n classDefinition\n) {\n const propertiesBySemantic = classDefinition.propertiesBySemantic;\n if (!defined(propertiesBySemantic)) {\n return false;\n }\n\n const property = propertiesBySemantic[semantic];\n return defined(property);\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n *\n * @private\n */\nMetadataEntity.getPropertyIds = function (\n properties,\n classDefinition,\n results\n) {\n results = defined(results) ? results : [];\n results.length = 0;\n\n // Add entity properties\n for (const propertyId in properties) {\n if (\n properties.hasOwnProperty(propertyId) &&\n defined(properties[propertyId])\n ) {\n results.push(propertyId);\n }\n }\n\n // Add default properties\n const classProperties = classDefinition.properties;\n if (defined(classProperties)) {\n for (const classPropertyId in classProperties) {\n if (\n classProperties.hasOwnProperty(classPropertyId) &&\n !defined(properties[classPropertyId]) &&\n defined(classProperties[classPropertyId].default)\n ) {\n results.push(classPropertyId);\n }\n }\n }\n\n return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @private\n */\nMetadataEntity.getProperty = function (\n propertyId,\n properties,\n classDefinition\n) {\n const classProperty = classDefinition.properties[propertyId];\n let value = properties[propertyId];\n\n // Clone array values\n if (Array.isArray(value)) {\n value = value.slice();\n }\n\n // Arrays of vectors are represented as nested arrays in JSON\n const enableNestedArrays = true;\n\n // Handle noData and default\n value = classProperty.handleNoData(value);\n if (!defined(value) && defined(classProperty.default)) {\n value = clone(classProperty.default, true);\n return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);\n }\n\n if (!defined(value)) {\n return undefined;\n }\n\n value = classProperty.normalize(value);\n value = classProperty.applyValueTransform(value);\n return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @private\n */\nMetadataEntity.setProperty = function (\n propertyId,\n value,\n properties,\n classDefinition\n) {\n if (!defined(properties[propertyId])) {\n return false;\n }\n\n if (Array.isArray(value)) {\n value = value.slice(); // clone\n }\n\n let classProperty;\n const classProperties = classDefinition.properties;\n if (defined(classProperties)) {\n classProperty = classProperties[propertyId];\n }\n\n // arrays of vectors are represented as nested arrays in JSON\n const enableNestedArrays = true;\n if (defined(classProperty)) {\n value = classProperty.packVectorAndMatrixTypes(value, enableNestedArrays);\n value = classProperty.unapplyValueTransform(value);\n value = classProperty.unnormalize(value);\n }\n\n properties[propertyId] = value;\n return true;\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @private\n */\nMetadataEntity.getPropertyBySemantic = function (\n semantic,\n properties,\n classDefinition\n) {\n const propertiesBySemantic = classDefinition.propertiesBySemantic;\n if (!defined(propertiesBySemantic)) {\n return undefined;\n }\n\n const property = propertiesBySemantic[semantic];\n if (defined(property)) {\n return MetadataEntity.getProperty(property.id, properties, classDefinition);\n }\n return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @param {Object} properties The dictionary containing properties.\n * @param {MetadataClass} classDefinition The class.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nMetadataEntity.setPropertyBySemantic = function (\n semantic,\n value,\n properties,\n classDefinition\n) {\n const propertiesBySemantic = classDefinition.propertiesBySemantic;\n if (!defined(propertiesBySemantic)) {\n return false;\n }\n\n const property = classDefinition.propertiesBySemantic[semantic];\n if (defined(property)) {\n return MetadataEntity.setProperty(\n property.id,\n value,\n properties,\n classDefinition\n );\n }\n\n return false;\n};\n\nexport default MetadataEntity;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about an implicit subtree.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.subtreeMetadata The subtree metadata JSON object.\n * @param {MetadataClass} options.class The class that subtree metadata conforms to.\n *\n * @alias ImplicitSubtreeMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitSubtreeMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const subtreeMetadata = options.subtreeMetadata;\n const metadataClass = options.class;\n\n const properties = defined(subtreeMetadata.properties)\n ? subtreeMetadata.properties\n : {};\n\n this._class = metadataClass;\n this._properties = properties;\n this._extras = subtreeMetadata.extras;\n this._extensions = subtreeMetadata.extensions;\n}\n\nObject.defineProperties(ImplicitSubtreeMetadata.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof ImplicitSubtreeMetadata.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof ImplicitSubtreeMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof ImplicitSubtreeMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the subtree has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the subtree has this property.\n * @private\n */\nImplicitSubtreeMetadata.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the subtree has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the subtree has a property with the given semantic.\n * @private\n */\nImplicitSubtreeMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the subtree does not have this property.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getProperty = function (propertyId) {\n return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitSubtreeMetadata.prototype.setProperty = function (propertyId, value) {\n return MetadataEntity.setProperty(\n propertyId,\n value,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the subtree does not have this semantic.\n * @private\n */\nImplicitSubtreeMetadata.prototype.getPropertyBySemantic = function (semantic) {\n return MetadataEntity.getPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nImplicitSubtreeMetadata.prototype.setPropertyBySemantic = function (\n semantic,\n value\n) {\n return MetadataEntity.setPropertyBySemantic(\n semantic,\n value,\n this._properties,\n this._class\n );\n};\n\nexport default ImplicitSubtreeMetadata;\n", "import CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\n\n/**\n * An enum of metadata component types.\n *\n * @enum MetadataComponentType\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst MetadataComponentType = {\n /**\n * An 8-bit signed integer\n *\n * @type {String}\n * @constant\n * @private\n */\n INT8: \"INT8\",\n /**\n * An 8-bit unsigned integer\n *\n * @type {String}\n * @constant\n * @private\n */\n UINT8: \"UINT8\",\n /**\n * A 16-bit signed integer\n *\n * @type {String}\n * @constant\n * @private\n */\n INT16: \"INT16\",\n /**\n * A 16-bit unsigned integer\n *\n * @type {String}\n * @constant\n * @private\n */\n UINT16: \"UINT16\",\n /**\n * A 32-bit signed integer\n *\n * @type {String}\n * @constant\n * @private\n */\n INT32: \"INT32\",\n /**\n * A 32-bit unsigned integer\n *\n * @type {String}\n * @constant\n * @private\n */\n UINT32: \"UINT32\",\n /**\n * A 64-bit signed integer. This type requires BigInt support.\n *\n * @see FeatureDetection.supportsBigInt\n *\n * @type {String}\n * @constant\n * @private\n */\n INT64: \"INT64\",\n /**\n * A 64-bit signed integer. This type requires BigInt support\n *\n * @see FeatureDetection.supportsBigInt\n *\n * @type {String}\n * @constant\n * @private\n */\n UINT64: \"UINT64\",\n /**\n * A 32-bit (single precision) floating point number\n *\n * @type {String}\n * @constant\n * @private\n */\n FLOAT32: \"FLOAT32\",\n /**\n * A 64-bit (double precision) floating point number\n *\n * @type {String}\n * @constant\n * @private\n */\n FLOAT64: \"FLOAT64\",\n};\n\n/**\n * Gets the minimum value for the numeric type.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * Otherwise an approximate number is returned.\n * </p>\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Number|BigInt} The minimum value.\n *\n * @exception {DeveloperError} type must be a numeric type\n *\n * @private\n */\nMetadataComponentType.getMinimum = function (type) {\n switch (type) {\n case MetadataComponentType.INT8:\n return -128;\n case MetadataComponentType.UINT8:\n return 0;\n case MetadataComponentType.INT16:\n return -32768;\n case MetadataComponentType.UINT16:\n return 0;\n case MetadataComponentType.INT32:\n return -2147483648;\n case MetadataComponentType.UINT32:\n return 0;\n case MetadataComponentType.INT64:\n if (FeatureDetection.supportsBigInt()) {\n return BigInt(\"-9223372036854775808\"); // eslint-disable-line\n }\n return -Math.pow(2, 63);\n case MetadataComponentType.UINT64:\n if (FeatureDetection.supportsBigInt()) {\n return BigInt(0); // eslint-disable-line\n }\n return 0;\n case MetadataComponentType.FLOAT32:\n // Maximum 32-bit floating point number. This value will be converted to the nearest 64-bit Number\n return -340282346638528859811704183484516925440.0;\n case MetadataComponentType.FLOAT64:\n return -Number.MAX_VALUE;\n }\n};\n\n/**\n * Gets the maximum value for the numeric type.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * Otherwise an approximate number is returned.\n * </p>\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Number|BigInt} The maximum value.\n *\n * @exception {DeveloperError} type must be a numeric type\n *\n * @private\n */\nMetadataComponentType.getMaximum = function (type) {\n switch (type) {\n case MetadataComponentType.INT8:\n return 127;\n case MetadataComponentType.UINT8:\n return 255;\n case MetadataComponentType.INT16:\n return 32767;\n case MetadataComponentType.UINT16:\n return 65535;\n case MetadataComponentType.INT32:\n return 2147483647;\n case MetadataComponentType.UINT32:\n return 4294967295;\n case MetadataComponentType.INT64:\n if (FeatureDetection.supportsBigInt()) {\n // Need to initialize with a string otherwise the value will be 9223372036854775808\n return BigInt(\"9223372036854775807\"); // eslint-disable-line\n }\n return Math.pow(2, 63) - 1;\n case MetadataComponentType.UINT64:\n if (FeatureDetection.supportsBigInt()) {\n // Need to initialize with a string otherwise the value will be 18446744073709551616\n return BigInt(\"18446744073709551615\"); // eslint-disable-line\n }\n return Math.pow(2, 64) - 1;\n case MetadataComponentType.FLOAT32:\n // Maximum 32-bit floating point number\n return 340282346638528859811704183484516925440.0;\n case MetadataComponentType.FLOAT64:\n return Number.MAX_VALUE;\n }\n};\n\n/**\n * Returns whether the type is a numeric type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Boolean} Whether the type is a numeric type.\n *\n * @private\n */\nMetadataComponentType.isNumericType = function (type) {\n switch (type) {\n case MetadataComponentType.INT8:\n case MetadataComponentType.UINT8:\n case MetadataComponentType.INT16:\n case MetadataComponentType.UINT16:\n case MetadataComponentType.INT32:\n case MetadataComponentType.UINT32:\n case MetadataComponentType.INT64:\n case MetadataComponentType.UINT64:\n case MetadataComponentType.FLOAT32:\n case MetadataComponentType.FLOAT64:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Returns whether the type is an integer type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Boolean} Whether the type is an integer type.\n *\n * @private\n */\nMetadataComponentType.isIntegerType = function (type) {\n switch (type) {\n case MetadataComponentType.INT8:\n case MetadataComponentType.UINT8:\n case MetadataComponentType.INT16:\n case MetadataComponentType.UINT16:\n case MetadataComponentType.INT32:\n case MetadataComponentType.UINT32:\n case MetadataComponentType.INT64:\n case MetadataComponentType.UINT64:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Returns whether the type is an unsigned integer type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Boolean} Whether the type is an unsigned integer type.\n *\n * @private\n */\nMetadataComponentType.isUnsignedIntegerType = function (type) {\n switch (type) {\n case MetadataComponentType.UINT8:\n case MetadataComponentType.UINT16:\n case MetadataComponentType.UINT32:\n case MetadataComponentType.UINT64:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Returns whether a type can be used in a vector, i.e. the {@link Cartesian2},\n * {@link Cartesian3}, or {@link Cartesian4} classes. This includes all numeric\n * types except for types requiring 64-bit integers\n * @param {MetadataComponentType} type The type to check\n * @return {Boolean} <code>true</code> if the type can be encoded as a vector type, or <code>false</code> otherwise\n * @private\n */\nMetadataComponentType.isVectorCompatible = function (type) {\n switch (type) {\n case MetadataComponentType.INT8:\n case MetadataComponentType.UINT8:\n case MetadataComponentType.INT16:\n case MetadataComponentType.UINT16:\n case MetadataComponentType.INT32:\n case MetadataComponentType.UINT32:\n case MetadataComponentType.FLOAT32:\n case MetadataComponentType.FLOAT64:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Normalizes signed integers to the range [-1.0, 1.0] and unsigned integers to\n * the range [0.0, 1.0].\n * <p>\n * The value may be a BigInt for the INT64 and UINT64 types. The value is converted\n * to a 64-bit floating point number during normalization which may result in\n * small precision differences.\n * </p>\n *\n * @param {Number|BigInt} value The integer value.\n * @param {MetadataComponentType} type The type.\n * @returns {Number} The normalized value.\n *\n * @exception {DeveloperError} value must be a number or a BigInt\n * @exception {DeveloperError} type must be an integer type\n *\n * @private\n */\nMetadataComponentType.normalize = function (value, type) {\n return Math.max(\n Number(value) / Number(MetadataComponentType.getMaximum(type)),\n -1.0\n );\n};\n\n/**\n * Unnormalizes signed numbers in the range [-1.0, 1.0] to signed integers and\n * unsigned numbers in the range [0.0, 1.0] to unsigned integers. Values outside\n * the range are clamped to the range.\n * <p>\n * Returns a BigInt for the INT64 and UINT64 types if BigInt is supported on this platform.\n * </p>\n *\n * @param {Number} value The normalized value.\n * @param {MetadataComponentType} type The type.\n * @returns {Number|BigInt} The integer value.\n *\n * @exception {DeveloperError} type must be an integer type\n *\n * @private\n */\nMetadataComponentType.unnormalize = function (value, type) {\n const max = MetadataComponentType.getMaximum(type);\n const min = MetadataComponentType.isUnsignedIntegerType(type) ? 0 : -max;\n\n value = CesiumMath.sign(value) * Math.round(Math.abs(value) * Number(max));\n\n if (\n (type === MetadataComponentType.INT64 ||\n type === MetadataComponentType.UINT64) &&\n FeatureDetection.supportsBigInt()\n ) {\n value = BigInt(value); // eslint-disable-line\n }\n\n if (value > max) {\n return max;\n }\n\n if (value < min) {\n return min;\n }\n\n return value;\n};\n\nMetadataComponentType.applyValueTransform = function (value, offset, scale) {\n return scale * value + offset;\n};\n\nMetadataComponentType.unapplyValueTransform = function (value, offset, scale) {\n // if the scale is 0, avoid a divide by zero error. The result can be any\n // finite number, so 0.0 will do nicely.\n if (scale === 0) {\n return 0.0;\n }\n\n return (value - offset) / scale;\n};\n\n/**\n * Gets the size in bytes for the numeric type.\n *\n * @param {MetadataComponentType} type The type.\n * @returns {Number} The size in bytes.\n *\n * @exception {DeveloperError} type must be a numeric type\n *\n * @private\n */\nMetadataComponentType.getSizeInBytes = function (type) {\nswitch (type) {\n case MetadataComponentType.INT8:\n case MetadataComponentType.UINT8:\n return 1;\n case MetadataComponentType.INT16:\n case MetadataComponentType.UINT16:\n return 2;\n case MetadataComponentType.INT32:\n case MetadataComponentType.UINT32:\n return 4;\n case MetadataComponentType.INT64:\n case MetadataComponentType.UINT64:\n return 8;\n case MetadataComponentType.FLOAT32:\n return 4;\n case MetadataComponentType.FLOAT64:\n return 8;\n }\n};\n\nexport default Object.freeze(MetadataComponentType);\n", "import Check from \"../Core/Check.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * An enum of metadata types. These metadata types are containers containing\n * one or more components of type {@link MetadataComponentType}\n *\n * @enum MetadataType\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst MetadataType = {\n /**\n * A single component\n *\n * @type {String}\n * @constant\n * @private\n */\n SCALAR: \"SCALAR\",\n /**\n * A vector with two components\n *\n * @type {String}\n * @constant\n * @private\n */\n VEC2: \"VEC2\",\n /**\n * A vector with three components\n *\n * @type {String}\n * @constant\n * @private\n */\n VEC3: \"VEC3\",\n /**\n * A vector with four components\n *\n * @type {String}\n * @constant\n * @private\n */\n VEC4: \"VEC4\",\n /**\n * A 2x2 matrix, stored in column-major format.\n *\n * @type {String}\n * @constant\n * @private\n */\n MAT2: \"MAT2\",\n /**\n * A 2x2 matrix, stored in column-major format.\n *\n * @type {String}\n * @constant\n * @private\n */\n MAT3: \"MAT3\",\n /**\n * A 2x2 matrix, stored in column-major format.\n *\n * @type {String}\n * @constant\n * @private\n */\n MAT4: \"MAT4\",\n /**\n * A boolean (true/false) value\n *\n * @type {String}\n * @constant\n * @private\n */\n BOOLEAN: \"BOOLEAN\",\n /**\n * A UTF-8 encoded string value\n *\n * @type {String}\n * @constant\n * @private\n */\n STRING: \"STRING\",\n /**\n * An enumerated value. This type is used in conjunction with a {@link MetadataEnum} to describe the valid values.\n *\n * @see MetadataEnum\n *\n * @type {String}\n * @constant\n * @private\n */\n ENUM: \"ENUM\",\n};\n\n/**\n * Check if a type is VEC2, VEC3 or VEC4\n *\n * @param {MetadataType} type The type\n * @return {Boolean} <code>true</code> if the type is a vector, <code>false</code> otherwise\n */\nMetadataType.isVectorType = function (type) {\n switch (type) {\n case MetadataType.VEC2:\n case MetadataType.VEC3:\n case MetadataType.VEC4:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Check if a type is MAT2, MAT3 or MAT4\n *\n * @param {MetadataType} type The type\n * @return {Boolean} <code>true</code> if the type is a matrix, <code>false</code> otherwise\n */\nMetadataType.isMatrixType = function (type) {\n switch (type) {\n case MetadataType.MAT2:\n case MetadataType.MAT3:\n case MetadataType.MAT4:\n return true;\n default:\n return false;\n }\n};\n\n/**\n * Get the number of components for a vector or matrix type. e.g.\n * a VECN returns N, and a MATN returns N*N. All other types return 1.\n *\n * @param {MetadataType} type The type to get the component count for\n * @return {Number} The number of components\n */\nMetadataType.getComponentCount = function (type) {\n switch (type) {\n case MetadataType.SCALAR:\n case MetadataType.STRING:\n case MetadataType.ENUM:\n case MetadataType.BOOLEAN:\n return 1;\n case MetadataType.VEC2:\n return 2;\n case MetadataType.VEC3:\n return 3;\n case MetadataType.VEC4:\n return 4;\n case MetadataType.MAT2:\n return 4;\n case MetadataType.MAT3:\n return 9;\n case MetadataType.MAT4:\n return 16;\n}\n};\n\n/**\n * Get the corresponding vector or matrix class. This is used to simplify\n * packing and unpacking code.\n * @param {MetadataType} type The metadata type\n * @return {Object} The appropriate CartesianN class for vector types, MatrixN class for matrix types, or undefined otherwise.\n * @private\n */\nMetadataType.getMathType = function (type) {\n switch (type) {\n case MetadataType.VEC2:\n return Cartesian2;\n case MetadataType.VEC3:\n return Cartesian3;\n case MetadataType.VEC4:\n return Cartesian4;\n case MetadataType.MAT2:\n return Matrix2;\n case MetadataType.MAT3:\n return Matrix3;\n case MetadataType.MAT4:\n return Matrix4;\n default:\n return undefined;\n }\n};\n\nexport default Object.freeze(MetadataType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix2 from \"../Core/Matrix2.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A metadata property, as part of a {@link MetadataClass}\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.id The ID of the property.\n * @param {Object} options.property The property JSON object.\n * @param {Object.<String, MetadataEnum>} [options.enums] A dictionary of enums.\n *\n * @alias MetadataClassProperty\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataClassProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const id = options.id;\n const property = options.property;\n\n // Try to determine if this is the legacy extension. This is not\n // always possible, as there are some types that are valid in both\n // extensions.\n const isLegacyExtension = isLegacy(property);\n const parsedType = parseType(property, options.enums);\n const componentType = parsedType.componentType;\n\n const normalized =\n defined(componentType) &&\n MetadataComponentType.isIntegerType(componentType) &&\n defaultValue(property.normalized, false);\n\n // Basic information about this property\n this._id = id;\n this._name = property.name;\n this._description = property.description;\n this._semantic = property.semantic;\n this._isLegacyExtension = isLegacyExtension;\n\n // Details about basic types\n this._type = parsedType.type;\n this._componentType = componentType;\n this._enumType = parsedType.enumType;\n this._valueType = parsedType.valueType;\n\n // Details about arrays\n this._isArray = parsedType.isArray;\n this._isVariableLengthArray = parsedType.isVariableLengthArray;\n this._arrayLength = parsedType.arrayLength;\n\n // min and max allowed values\n this._min = property.min;\n this._max = property.max;\n\n // properties that adjust the range of metadata values\n this._normalized = normalized;\n\n let offset = property.offset;\n let scale = property.scale;\n const hasValueTransform = defined(offset) || defined(scale);\n\n const enableNestedArrays = true;\n if (!defined(offset)) {\n offset = this.expandConstant(0, enableNestedArrays);\n }\n\n if (!defined(scale)) {\n scale = this.expandConstant(1, enableNestedArrays);\n }\n\n this._offset = offset;\n this._scale = scale;\n this._hasValueTransform = hasValueTransform;\n\n // sentinel value for missing data, and a default value to use\n // in its place if needed.\n this._noData = property.noData;\n // For vector and array types, this is stored as an array of values.\n this._default = property.default;\n\n // EXT_feature_metadata had an optional flag, while EXT_structural_metadata\n // has a required flag. The defaults are not the same, and there's some cases\n // like {type: BOOLEAN} that are ambiguous. Coalesce this into a single\n // required flag\n let required;\n if (!defined(isLegacyExtension)) {\n // Impossible to tell which extension was used, so don't require\n // the property\n required = false;\n } else if (isLegacyExtension) {\n required = defined(property.optional) ? !property.optional : true;\n } else {\n required = defaultValue(property.required, false);\n }\n this._required = required;\n\n // extras and extensions\n this._extras = property.extras;\n this._extensions = property.extensions;\n}\n\nObject.defineProperties(MetadataClassProperty.prototype, {\n /**\n * The ID of the property.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * The name of the property.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The description of the property.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {String}\n * @readonly\n * @private\n */\n description: {\n get: function () {\n return this._description;\n },\n },\n\n /**\n * The type of the property such as SCALAR, VEC2, VEC3\n *\n *\n * @memberof MetadataClassProperty.prototype\n * @type {MetadataType}\n * @readonly\n * @private\n */\n type: {\n get: function () {\n return this._type;\n },\n },\n\n /**\n * The enum type of the property. Only defined when type is ENUM.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {MetadataEnum}\n * @readonly\n * @private\n */\n enumType: {\n get: function () {\n return this._enumType;\n },\n },\n\n /**\n * The component type of the property. This includes integer\n * (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values\n *\n * @memberof MetadataClassProperty.prototype\n * @type {MetadataComponentType}\n * @readonly\n * @private\n */\n componentType: {\n get: function () {\n return this._componentType;\n },\n },\n\n /**\n * The datatype used for storing each component of the property. This\n * is usually the same as componentType except for ENUM, where this\n * returns an integer type\n *\n * @memberof MetadataClassProperty.prototype\n * @type {MetadataComponentType}\n * @readonly\n * @private\n */\n valueType: {\n get: function () {\n return this._valueType;\n },\n },\n\n /**\n * True if a property is an array (either fixed length or variable length),\n * false otherwise.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n isArray: {\n get: function () {\n return this._isArray;\n },\n },\n\n /**\n * True if a property is a variable length array, false otherwise.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n isVariableLengthArray: {\n get: function () {\n return this._isVariableLengthArray;\n },\n },\n\n /**\n * The number of array elements. Only defined for fixed-size\n * arrays.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n arrayLength: {\n get: function () {\n return this._arrayLength;\n },\n },\n\n /**\n * Whether the property is normalized.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n normalized: {\n get: function () {\n return this._normalized;\n },\n },\n\n /**\n * A number or an array of numbers storing the maximum allowable value of this property. Only defined when type or componentType is a numeric type.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]}\n * @readonly\n * @private\n */\n max: {\n get: function () {\n return this._max;\n },\n },\n\n /**\n * A number or an array of numbers storing the minimum allowable value of this property. Only defined when type or componentType is a numeric type.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]}\n * @readonly\n * @private\n */\n min: {\n get: function () {\n return this._min;\n },\n },\n\n /**\n * The no-data sentinel value that represents null values\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean|Number|String|Array}\n * @readonly\n * @private\n */\n noData: {\n get: function () {\n return this._noData;\n },\n },\n\n /**\n * A default value to use when an entity's property value is not defined.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean|Number|String|Array}\n * @readonly\n * @private\n */\n default: {\n get: function () {\n return this._default;\n },\n },\n\n /**\n * Whether the property is required.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n required: {\n get: function () {\n return this._required;\n },\n },\n\n /**\n * An identifier that describes how this property should be interpreted.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {String}\n * @readonly\n * @private\n */\n semantic: {\n get: function () {\n return this._semantic;\n },\n },\n\n /**\n * True if offset/scale should be applied. If both offset/scale were\n * undefined, they default to identity so this property is set false\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n hasValueTransform: {\n get: function () {\n return this._hasValueTransform;\n },\n },\n\n /**\n * The offset to be added to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]|Number[][]}\n * @readonly\n * @private\n */\n offset: {\n get: function () {\n return this._offset;\n },\n },\n\n /**\n * The scale to be multiplied to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]|Number[][]}\n * @readonly\n * @private\n */\n scale: {\n get: function () {\n return this._scale;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nfunction isLegacy(property) {\n if (property.type === \"ARRAY\") {\n return true;\n }\n\n // New property types in EXT_structural_metadata\n const type = property.type;\n if (\n type === MetadataType.SCALAR ||\n MetadataType.isMatrixType(type) ||\n MetadataType.isVectorType(type)\n ) {\n return false;\n }\n\n // EXT_feature_metadata allowed numeric types as a type. Now they are\n // represented as {type: SINGLE, componentType: type}\n if (MetadataComponentType.isNumericType(type)) {\n return true;\n }\n\n // New properties in EXT_structural_metadata\n if (\n defined(property.noData) ||\n defined(property.scale) ||\n defined(property.offset) ||\n defined(property.required) ||\n defined(property.count) ||\n defined(property.array)\n ) {\n return false;\n }\n\n // Properties that only exist in EXT_feature_metadata\n if (defined(property.optional)) {\n return false;\n }\n\n // impossible to tell, give up.\n return undefined;\n}\n\nfunction parseType(property, enums) {\n const type = property.type;\n const componentType = property.componentType;\n\n // EXT_feature_metadata had an ARRAY type. This is now handled\n // with array + count, so some details need to be transcoded\n const isLegacyArray = type === \"ARRAY\";\n let isArray;\n let arrayLength;\n let isVariableLengthArray;\n if (isLegacyArray) {\n // definitely EXT_feature_metadata\n isArray = true;\n arrayLength = property.componentCount;\n isVariableLengthArray = !defined(arrayLength);\n } else if (property.array) {\n isArray = true;\n arrayLength = property.count;\n isVariableLengthArray = !defined(property.count);\n } else {\n // Could be either extension. Some cases are impossible to distinguish\n // Default to a single value\n isArray = false;\n arrayLength = undefined;\n isVariableLengthArray = false;\n }\n\n let enumType;\n if (defined(property.enumType)) {\n enumType = enums[property.enumType];\n }\n\n // In both EXT_feature_metadata and EXT_structural_metadata, ENUM appears\n // as a type.\n if (type === MetadataType.ENUM) {\n return {\n type: type,\n componentType: undefined,\n enumType: enumType,\n valueType: enumType.valueType,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // In EXT_feature_metadata, ENUM also appears as an ARRAY componentType\n if (isLegacyArray && componentType === MetadataType.ENUM) {\n return {\n type: componentType,\n componentType: undefined,\n enumType: enumType,\n valueType: enumType.valueType,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // EXT_structural_metadata only: SCALAR, VECN and MATN\n if (\n type === MetadataType.SCALAR ||\n MetadataType.isMatrixType(type) ||\n MetadataType.isVectorType(type)\n ) {\n return {\n type: type,\n componentType: componentType,\n enumType: undefined,\n valueType: componentType,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // In both EXT_structural_metadata and EXT_feature_metadata,\n // BOOLEAN and STRING appear as types\n if (type === MetadataType.BOOLEAN || type === MetadataType.STRING) {\n return {\n type: type,\n componentType: undefined,\n enumType: undefined,\n valueType: undefined,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // EXT_feature_metadata also allows BOOLEAN and STRING as an ARRAY\n // componentType\n if (\n isLegacyArray &&\n (componentType === MetadataType.BOOLEAN ||\n componentType === MetadataType.STRING)\n ) {\n return {\n type: componentType,\n componentType: undefined,\n enumType: undefined,\n valueType: undefined,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // Both EXT_feature_metadata and EXT_structural_metadata allow numeric types like\n // INT32 or FLOAT64 as a componentType.\n if (\n defined(componentType) &&\n MetadataComponentType.isNumericType(componentType)\n ) {\n return {\n type: MetadataType.SCALAR,\n componentType: componentType,\n enumType: undefined,\n valueType: componentType,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n // EXT_feature_metadata: integer and float types were allowed as types,\n // but now these are expressed as {type: SCALAR, componentType: type}\n if (MetadataComponentType.isNumericType(type)) {\n return {\n type: MetadataType.SCALAR,\n componentType: type,\n enumType: undefined,\n valueType: type,\n isArray: isArray,\n isVariableLengthArray: isVariableLengthArray,\n arrayLength: arrayLength,\n };\n }\n\n}\n\n/**\n * Normalizes integer property values. If the property is not normalized\n * the value is returned unmodified.\n * <p>\n * Given the way normalization is defined in {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#normalized-values|the 3D Metadata Specification},\n * normalize and unnormalize are almost, but not quite inverses. In particular,\n * the smallest signed integer value will be off by one after normalizing and\n * unnormalizing. See\n * {@link https://www.desmos.com/calculator/nledg1evut|this Desmos graph} for\n * an example using INT8.\n * </p>\n * <p>\n * Furthermore, for 64-bit integer types, there may be a loss of precision\n * due to conversion to Number\n * </p>\n *\n * @param {*} value The integer value or array of integer values.\n * @returns {*} The normalized value or array of normalized values.\n *\n * @private\n */\nMetadataClassProperty.prototype.normalize = function (value) {\n if (!this._normalized) {\n return value;\n }\n\n return normalizeInPlace(\n value,\n this._valueType,\n MetadataComponentType.normalize\n );\n};\n\n/**\n * Unnormalizes integer property values. If the property is not normalized\n * the value is returned unmodified.\n * <p>\n * Given the way normalization is defined in {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#normalized-values|the 3D Metadata Specification},\n * normalize and unnormalize are almost, but not quite inverses. In particular,\n * the smallest signed integer value will be off by one after normalizing and\n * unnormalizing. See\n * {@link https://www.desmos.com/calculator/nledg1evut|this Desmos graph} for\n * an example using INT8.\n * </p>\n * <p>\n * Furthermore, for 64-bit integer types, there may be a loss of precision\n * due to conversion to Number\n * </p>\n *\n * @param {*} value The normalized value or array of normalized values.\n * @returns {*} The integer value or array of integer values.\n *\n * @private\n */\nMetadataClassProperty.prototype.unnormalize = function (value) {\n if (!this._normalized) {\n return value;\n }\n\n return normalizeInPlace(\n value,\n this._valueType,\n MetadataComponentType.unnormalize\n );\n};\n\nMetadataClassProperty.prototype.applyValueTransform = function (value) {\n // variable length arrays do not have a well-defined offset/scale so this\n // is forbidden by the spec\n if (!this._hasValueTransform || this._isVariableLengthArray) {\n return value;\n }\n\n return MetadataClassProperty.valueTransformInPlace(\n value,\n this._offset,\n this._scale,\n MetadataComponentType.applyValueTransform\n );\n};\n\nMetadataClassProperty.prototype.unapplyValueTransform = function (value) {\n // variable length arrays do not have a well-defined offset/scale so this\n // is forbidden by the spec\n if (!this._hasValueTransform || this._isVariableLengthArray) {\n return value;\n }\n\n return MetadataClassProperty.valueTransformInPlace(\n value,\n this._offset,\n this._scale,\n MetadataComponentType.unapplyValueTransform\n );\n};\n\nMetadataClassProperty.prototype.expandConstant = function (\n constant,\n enableNestedArrays\n) {\n enableNestedArrays = defaultValue(enableNestedArrays, false);\n const isArray = this._isArray;\n const arrayLength = this._arrayLength;\n const componentCount = MetadataType.getComponentCount(this._type);\n const isNested = isArray && componentCount > 1;\n\n // scalar values can be returned directly\n if (!isArray && componentCount === 1) {\n return constant;\n }\n\n // vector and matrix values\n if (!isArray) {\n return new Array(componentCount).fill(constant);\n }\n\n // arrays of scalars\n if (!isNested) {\n return new Array(arrayLength).fill(constant);\n }\n\n // arrays of vectors/matrices: flattened\n if (!enableNestedArrays) {\n return new Array(this._arrayLength * componentCount).fill(constant);\n }\n\n // array of vectors/matrices: nested\n const innerConstant = new Array(componentCount).fill(constant);\n // This array fill duplicates the pointer to the inner arrays. Since this is\n // intended for use with constants, no need to clone the array.\n return new Array(this._arrayLength).fill(innerConstant);\n};\n\n/**\n * If the value is the noData sentinel, return undefined. Otherwise, return\n * the value.\n * @param {*} value The raw value\n * @returns {*} Either the value or undefined if the value was a no data value.\n *\n * @private\n */\nMetadataClassProperty.prototype.handleNoData = function (value) {\n const sentinel = this._noData;\n if (!defined(sentinel)) {\n return value;\n }\n\n if (arrayEquals(value, sentinel)) {\n return undefined;\n }\n\n return value;\n};\n\nfunction arrayEquals(left, right) {\n if (!Array.isArray(left)) {\n return left === right;\n }\n\n if (!Array.isArray(right)) {\n return false;\n }\n\n if (left.length !== right.length) {\n return false;\n }\n\n for (let i = 0; i < left.length; i++) {\n if (!arrayEquals(left[i], right[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Unpack VECN values into {@link Cartesian2}, {@link Cartesian3}, or\n * {@link Cartesian4} and MATN values into {@link Matrix2}, {@link Matrix3}, or\n * {@link Matrix4} depending on N. All other values (including arrays of\n * other sizes) are passed through unaltered.\n *\n * @param {*} value the original, normalized values.\n * @param {Boolean} [enableNestedArrays=false] If true, arrays of vectors are represented as nested arrays. This is used for JSON encoding but not binary encoding\n * @returns {*} The appropriate vector or matrix type if the value is a vector or matrix type, respectively. If the property is an array of vectors or matrices, an array of the appropriate vector or matrix type is returned. Otherwise, the value is returned unaltered.\n * @private\n */\nMetadataClassProperty.prototype.unpackVectorAndMatrixTypes = function (\n value,\n enableNestedArrays\n) {\n enableNestedArrays = defaultValue(enableNestedArrays, false);\n const MathType = MetadataType.getMathType(this._type);\n const isArray = this._isArray;\n const componentCount = MetadataType.getComponentCount(this._type);\n const isNested = isArray && componentCount > 1;\n\n if (!defined(MathType)) {\n return value;\n }\n\n if (enableNestedArrays && isNested) {\n return value.map(function (x) {\n return MathType.unpack(x);\n });\n }\n\n if (isArray) {\n return MathType.unpackArray(value);\n }\n\n return MathType.unpack(value);\n};\n\n/**\n * Pack a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} into an\n * array if this property is an <code>VECN</code>.\n * Pack a {@link Matrix2}, {@link Matrix3}, or {@link Matrix4} into an\n * array if this property is an <code>MATN</code>.\n * All other values (including arrays of other sizes) are passed through unaltered.\n *\n * @param {*} value The value of this property\n * @param {Boolean} [enableNestedArrays=false] If true, arrays of vectors are represented as nested arrays. This is used for JSON encoding but not binary encoding\n * @returns {*} An array of the appropriate length if the property is a vector or matrix type. Otherwise, the value is returned unaltered.\n * @private\n */\nMetadataClassProperty.prototype.packVectorAndMatrixTypes = function (\n value,\n enableNestedArrays\n) {\n enableNestedArrays = defaultValue(enableNestedArrays, false);\n const MathType = MetadataType.getMathType(this._type);\n const isArray = this._isArray;\n const componentCount = MetadataType.getComponentCount(this._type);\n const isNested = isArray && componentCount > 1;\n\n if (!defined(MathType)) {\n return value;\n }\n\n if (enableNestedArrays && isNested) {\n return value.map(function (x) {\n return MathType.pack(x, []);\n });\n }\n\n if (isArray) {\n return MathType.packArray(value, []);\n }\n\n return MathType.pack(value, []);\n};\n\n/**\n * Validates whether the given value conforms to the property.\n *\n * @param {*} value The value.\n * @returns {String|undefined} An error message if the value does not conform to the property, otherwise undefined.\n * @private\n */\nMetadataClassProperty.prototype.validate = function (value) {\n if (!defined(value) && defined(this._default)) {\n // no value, but we have a default to use.\n return undefined;\n }\n\n if (this._required && !defined(value)) {\n return `required property must have a value`;\n }\n\n if (this._isArray) {\n return validateArray(this, value);\n }\n\n return validateSingleValue(this, value);\n};\n\nfunction validateArray(classProperty, value) {\n if (!Array.isArray(value)) {\n return `value ${value} must be an array`;\n }\n\n const length = value.length;\n if (\n !classProperty._isVariableLengthArray &&\n length !== classProperty._arrayLength\n ) {\n return \"Array length does not match property.arrayLength\";\n }\n\n for (let i = 0; i < length; i++) {\n const message = validateSingleValue(classProperty, value[i]);\n if (defined(message)) {\n return message;\n }\n }\n}\n\nfunction validateSingleValue(classProperty, value) {\n const type = classProperty._type;\n const componentType = classProperty._componentType;\n const enumType = classProperty._enumType;\n const normalized = classProperty._normalized;\n\n if (MetadataType.isVectorType(type)) {\n return validateVector(value, type, componentType);\n } else if (MetadataType.isMatrixType(type)) {\n return validateMatrix(value, type, componentType);\n } else if (type === MetadataType.STRING) {\n return validateString(value);\n } else if (type === MetadataType.BOOLEAN) {\n return validateBoolean(value);\n } else if (type === MetadataType.ENUM) {\n return validateEnum(value, enumType);\n }\n\n return validateScalar(value, componentType, normalized);\n}\n\nfunction validateVector(value, type, componentType) {\n if (!MetadataComponentType.isVectorCompatible(componentType)) {\n return `componentType ${componentType} is incompatible with vector type ${type}`;\n }\n\n if (type === MetadataType.VEC2 && !(value instanceof Cartesian2)) {\n return `vector value ${value} must be a Cartesian2`;\n }\n\n if (type === MetadataType.VEC3 && !(value instanceof Cartesian3)) {\n return `vector value ${value} must be a Cartesian3`;\n }\n\n if (type === MetadataType.VEC4 && !(value instanceof Cartesian4)) {\n return `vector value ${value} must be a Cartesian4`;\n }\n}\n\nfunction validateMatrix(value, type, componentType) {\n if (!MetadataComponentType.isVectorCompatible(componentType)) {\n return `componentType ${componentType} is incompatible with matrix type ${type}`;\n }\n\n if (type === MetadataType.MAT2 && !(value instanceof Matrix2)) {\n return `matrix value ${value} must be a Matrix2`;\n }\n\n if (type === MetadataType.MAT3 && !(value instanceof Matrix3)) {\n return `matrix value ${value} must be a Matrix3`;\n }\n\n if (type === MetadataType.MAT4 && !(value instanceof Matrix4)) {\n return `matrix value ${value} must be a Matrix4`;\n }\n}\n\nfunction validateString(value) {\n if (typeof value !== \"string\") {\n return getTypeErrorMessage(value, MetadataType.STRING);\n }\n}\n\nfunction validateBoolean(value) {\n if (typeof value !== \"boolean\") {\n return getTypeErrorMessage(value, MetadataType.BOOLEAN);\n }\n}\n\nfunction validateEnum(value, enumType) {\n const javascriptType = typeof value;\n if (defined(enumType)) {\n if (javascriptType !== \"string\" || !defined(enumType.valuesByName[value])) {\n return `value ${value} is not a valid enum name for ${enumType.id}`;\n }\n return;\n }\n}\n\nfunction validateScalar(value, componentType, normalized) {\n const javascriptType = typeof value;\n\n switch (componentType) {\n case MetadataComponentType.INT8:\n case MetadataComponentType.UINT8:\n case MetadataComponentType.INT16:\n case MetadataComponentType.UINT16:\n case MetadataComponentType.INT32:\n case MetadataComponentType.UINT32:\n case MetadataComponentType.FLOAT32:\n case MetadataComponentType.FLOAT64:\n if (javascriptType !== \"number\") {\n return getTypeErrorMessage(value, componentType);\n }\n if (!isFinite(value)) {\n return getNonFiniteErrorMessage(value, componentType);\n }\n return checkInRange(value, componentType, normalized);\n case MetadataComponentType.INT64:\n case MetadataComponentType.UINT64:\n if (javascriptType !== \"number\" && javascriptType !== \"bigint\") {\n return getTypeErrorMessage(value, componentType);\n }\n if (javascriptType === \"number\" && !isFinite(value)) {\n return getNonFiniteErrorMessage(value, componentType);\n }\n return checkInRange(value, componentType, normalized);\n }\n}\n\nfunction getTypeErrorMessage(value, type) {\n return `value ${value} does not match type ${type}`;\n}\n\nfunction getOutOfRangeErrorMessage(value, type, normalized) {\n let errorMessage = `value ${value} is out of range for type ${type}`;\n if (normalized) {\n errorMessage += \" (normalized)\";\n }\n return errorMessage;\n}\n\nfunction checkInRange(value, componentType, normalized) {\n if (normalized) {\n const min = MetadataComponentType.isUnsignedIntegerType(componentType)\n ? 0.0\n : -1.0;\n const max = 1.0;\n if (value < min || value > max) {\n return getOutOfRangeErrorMessage(value, componentType, normalized);\n }\n return;\n }\n\n if (\n value < MetadataComponentType.getMinimum(componentType) ||\n value > MetadataComponentType.getMaximum(componentType)\n ) {\n return getOutOfRangeErrorMessage(value, componentType, normalized);\n }\n}\n\nfunction getNonFiniteErrorMessage(value, type) {\n return `value ${value} of type ${type} must be finite`;\n}\n\nfunction normalizeInPlace(values, valueType, normalizeFunction) {\n if (!Array.isArray(values)) {\n return normalizeFunction(values, valueType);\n }\n\n for (let i = 0; i < values.length; i++) {\n values[i] = normalizeInPlace(values[i], valueType, normalizeFunction);\n }\n\n return values;\n}\n\nMetadataClassProperty.valueTransformInPlace = function (\n values,\n offsets,\n scales,\n transformationFunction\n) {\n if (!Array.isArray(values)) {\n // transform a single value\n return transformationFunction(values, offsets, scales);\n }\n\n for (let i = 0; i < values.length; i++) {\n // offsets and scales must be the same array shape as values.\n values[i] = MetadataClassProperty.valueTransformInPlace(\n values[i],\n offsets[i],\n scales[i],\n transformationFunction\n );\n }\n\n return values;\n};\n\nexport default MetadataClassProperty;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport getStringFromTypedArray from \"../Core/getStringFromTypedArray.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\nimport MetadataClassProperty from \"./MetadataClassProperty.js\";\nimport MetadataType from \"./MetadataType.js\";\n\n/**\n * A binary property in a {@MetadataTable}\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}\n * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension}\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.count The number of elements in each property array.\n * @param {Object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n * @param {Object.<String, Uint8Array>} options.bufferViews An object mapping bufferView IDs to Uint8Array objects.\n *\n * @alias MetadataTableProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataTableProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const count = options.count;\n const property = options.property;\n const classProperty = options.classProperty;\n const bufferViews = options.bufferViews;\n\n const type = classProperty.type;\n const isArray = classProperty.isArray;\n const isVariableLengthArray = classProperty.isVariableLengthArray;\n\n let valueType = classProperty.valueType;\n const enumType = classProperty.enumType;\n\n const hasStrings = type === MetadataType.STRING;\n const hasBooleans = type === MetadataType.BOOLEAN;\n\n let byteLength = 0;\n\n let arrayOffsets;\n if (isVariableLengthArray) {\n // EXT_structural_metadata uses arrayOffsetType.\n // EXT_feature_metadata uses offsetType for both arrays and strings\n let arrayOffsetType = defaultValue(\n property.arrayOffsetType,\n property.offsetType\n );\n arrayOffsetType = defaultValue(\n MetadataComponentType[arrayOffsetType],\n MetadataComponentType.UINT32\n );\n\n // EXT_structural_metadata uses arrayOffsets.\n // EXT_feature_metadata uses arrayOffsetBufferView\n const arrayOffsetBufferView = defaultValue(\n property.arrayOffsets,\n property.arrayOffsetBufferView\n );\n arrayOffsets = new BufferView(\n bufferViews[arrayOffsetBufferView],\n arrayOffsetType,\n count + 1\n );\n\n byteLength += arrayOffsets.typedArray.byteLength;\n }\n\n const vectorComponentCount = MetadataType.getComponentCount(type);\n\n let arrayComponentCount;\n if (isVariableLengthArray) {\n arrayComponentCount = arrayOffsets.get(count) - arrayOffsets.get(0);\n } else if (isArray) {\n arrayComponentCount = count * classProperty.arrayLength;\n } else {\n arrayComponentCount = count;\n }\n\n const componentCount = vectorComponentCount * arrayComponentCount;\n\n let stringOffsets;\n if (hasStrings) {\n // EXT_structural_metadata uses stringOffsetType, EXT_feature_metadata uses offsetType for both arrays and strings\n let stringOffsetType = defaultValue(\n property.stringOffsetType,\n property.offsetType\n );\n stringOffsetType = defaultValue(\n MetadataComponentType[stringOffsetType],\n MetadataComponentType.UINT32\n );\n\n // EXT_structural_metadata uses stringOffsets.\n // EXT_feature_metadata uses stringOffsetBufferView\n const stringOffsetBufferView = defaultValue(\n property.stringOffsets,\n property.stringOffsetBufferView\n );\n stringOffsets = new BufferView(\n bufferViews[stringOffsetBufferView],\n stringOffsetType,\n componentCount + 1\n );\n\n byteLength += stringOffsets.typedArray.byteLength;\n }\n\n if (hasStrings || hasBooleans) {\n // STRING and BOOLEAN types need to be parsed differently than other types\n valueType = MetadataComponentType.UINT8;\n }\n\n let valueCount;\n if (hasStrings) {\n valueCount = stringOffsets.get(componentCount) - stringOffsets.get(0);\n } else if (hasBooleans) {\n valueCount = Math.ceil(componentCount / 8);\n } else {\n valueCount = componentCount;\n }\n\n // EXT_structural_metadata uses values\n // EXT_feature_metadata uses bufferView\n const valuesBufferView = defaultValue(property.values, property.bufferView);\n const values = new BufferView(\n bufferViews[valuesBufferView],\n valueType,\n valueCount\n );\n byteLength += values.typedArray.byteLength;\n\n let offset = property.offset;\n let scale = property.scale;\n\n // This needs to be set before handling default values\n const hasValueTransform =\n classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n // If the table does not define an offset/scale, it inherits from the\n // class property. The class property handles setting the default of identity:\n // (offset 0, scale 1) with the same array shape as the property's type\n // information.\n offset = defaultValue(offset, classProperty.offset);\n scale = defaultValue(scale, classProperty.scale);\n\n // Since metadata table properties are stored as packed typed\n // arrays, flatten the offset/scale to make it easier to apply the\n // transformation by iteration.\n offset = flatten(offset);\n scale = flatten(scale);\n\n let getValueFunction;\n let setValueFunction;\n const that = this;\n if (hasStrings) {\n getValueFunction = function (index) {\n return getString(index, that._values, that._stringOffsets);\n };\n } else if (hasBooleans) {\n getValueFunction = function (index) {\n return getBoolean(index, that._values);\n };\n setValueFunction = function (index, value) {\n setBoolean(index, that._values, value);\n };\n } else if (defined(enumType)) {\n getValueFunction = function (index) {\n const integer = that._values.get(index);\n return enumType.namesByValue[integer];\n };\n setValueFunction = function (index, value) {\n const integer = enumType.valuesByName[value];\n that._values.set(index, integer);\n };\n } else {\n getValueFunction = function (index) {\n return that._values.get(index);\n };\n setValueFunction = function (index, value) {\n that._values.set(index, value);\n };\n }\n\n this._arrayOffsets = arrayOffsets;\n this._stringOffsets = stringOffsets;\n this._values = values;\n this._classProperty = classProperty;\n this._count = count;\n this._vectorComponentCount = vectorComponentCount;\n this._min = property.min;\n this._max = property.max;\n this._offset = offset;\n this._scale = scale;\n this._hasValueTransform = hasValueTransform;\n this._getValue = getValueFunction;\n this._setValue = setValueFunction;\n this._unpackedValues = undefined;\n this._extras = property.extras;\n this._extensions = property.extensions;\n this._byteLength = byteLength;\n}\n\nObject.defineProperties(MetadataTableProperty.prototype, {\n /**\n * True if offset/scale should be applied. If both offset/scale were\n * undefined, they default to identity so this property is set false\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n hasValueTransform: {\n get: function () {\n return this._hasValueTransform;\n },\n },\n\n /**\n * The offset to be added to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]|Number[][]}\n * @readonly\n * @private\n */\n offset: {\n get: function () {\n return this._offset;\n },\n },\n\n /**\n * The scale to be multiplied to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Number[]|Number[][]}\n * @readonly\n * @private\n */\n scale: {\n get: function () {\n return this._scale;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataTableProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataTableProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n\n /**\n * Size of all typed arrays used by this table property\n *\n * @memberof MetadataTableProperty.prototype\n * @type {Normal}\n * @readonly\n * @private\n */\n byteLength: {\n get: function () {\n return this._byteLength;\n },\n },\n});\n\n/**\n * Returns a copy of the value at the given index.\n *\n * @param {Number} index The index.\n * @returns {*} The value of the property.\n *\n * @private\n */\nMetadataTableProperty.prototype.get = function (index) {\n let value = get(this, index);\n\n // handle noData and default\n value = this._classProperty.handleNoData(value);\n if (!defined(value)) {\n value = this._classProperty.default;\n return this._classProperty.unpackVectorAndMatrixTypes(value);\n }\n\n value = this._classProperty.normalize(value);\n value = applyValueTransform(this, value);\n return this._classProperty.unpackVectorAndMatrixTypes(value);\n};\n\n/**\n * Sets the value at the given index.\n *\n * @param {Number} index The index.\n * @param {*} value The value of the property.\n *\n * @private\n */\nMetadataTableProperty.prototype.set = function (index, value) {\n const classProperty = this._classProperty;\n\n value = classProperty.packVectorAndMatrixTypes(value);\n value = unapplyValueTransform(this, value);\n value = classProperty.unnormalize(value);\n\n set(this, index, value);\n};\n\n/**\n * Returns a typed array containing the property values.\n *\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTableProperty.prototype.getTypedArray = function () {\n // Note: depending on the class definition some properties are unpacked to\n // JS arrays when first accessed and values will be undefined. Generally not\n // a concern for fixed-length arrays of numbers.\n if (defined(this._values)) {\n return this._values.typedArray;\n }\n\n return undefined;\n};\n\nfunction flatten(values) {\n if (!Array.isArray(values)) {\n return values;\n }\n\n const result = [];\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (Array.isArray(value)) {\n result.push.apply(result, value);\n } else {\n result.push(value);\n }\n }\n\n return result;\n}\n\nfunction checkIndex(table, index) {\n const count = table._count;\n if (!defined(index) || index < 0 || index >= count) {\n const maximumIndex = count - 1;\n throw new DeveloperError(\n `index is required and between zero and count - 1. Actual value: ${maximumIndex}`\n );\n }\n}\n\nfunction get(property, index) {\n if (requiresUnpackForGet(property)) {\n unpackProperty(property);\n }\n\n const classProperty = property._classProperty;\n const isArray = classProperty.isArray;\n const type = classProperty.type;\n const componentCount = MetadataType.getComponentCount(type);\n\n if (defined(property._unpackedValues)) {\n const value = property._unpackedValues[index];\n if (isArray) {\n return clone(value, true);\n }\n return value;\n }\n\n // handle single values\n if (!isArray && componentCount === 1) {\n return property._getValue(index);\n }\n\n return getArrayValues(property, classProperty, index);\n}\n\nfunction getArrayValues(property, classProperty, index) {\n let offset;\n let length;\n if (classProperty.isVariableLengthArray) {\n offset = property._arrayOffsets.get(index);\n length = property._arrayOffsets.get(index + 1) - offset;\n\n // for vectors and matrices, the offset and length need to be multiplied\n // by the component count\n const componentCount = MetadataType.getComponentCount(classProperty.type);\n offset *= componentCount;\n length *= componentCount;\n } else {\n const arrayLength = defaultValue(classProperty.arrayLength, 1);\n const componentCount = arrayLength * property._vectorComponentCount;\n offset = index * componentCount;\n length = componentCount;\n }\n\n const values = new Array(length);\n for (let i = 0; i < length; i++) {\n values[i] = property._getValue(offset + i);\n }\n\n return values;\n}\n\nfunction set(property, index, value) {\n if (requiresUnpackForSet(property, index, value)) {\n unpackProperty(property);\n }\n\n const classProperty = property._classProperty;\n const isArray = classProperty.isArray;\n const type = classProperty.type;\n const componentCount = MetadataType.getComponentCount(type);\n\n if (defined(property._unpackedValues)) {\n if (classProperty.isArray) {\n value = clone(value, true);\n }\n property._unpackedValues[index] = value;\n return;\n }\n\n // Values are unpacked if the length of a variable-size array changes or the\n // property has strings. No need to handle these cases below.\n\n // Handle single values\n if (!isArray && componentCount === 1) {\n property._setValue(index, value);\n return;\n }\n\n let offset;\n let length;\n if (classProperty.isVariableLengthArray) {\n offset = property._arrayOffsets.get(index);\n length = property._arrayOffsets.get(index + 1) - offset;\n } else {\n const arrayLength = defaultValue(classProperty.arrayLength, 1);\n const componentCount = arrayLength * property._vectorComponentCount;\n offset = index * componentCount;\n length = componentCount;\n }\n\n for (let i = 0; i < length; ++i) {\n property._setValue(offset + i, value[i]);\n }\n}\n\nfunction getString(index, values, stringOffsets) {\n const stringByteOffset = stringOffsets.get(index);\n const stringByteLength = stringOffsets.get(index + 1) - stringByteOffset;\n return getStringFromTypedArray(\n values.typedArray,\n stringByteOffset,\n stringByteLength\n );\n}\n\nfunction getBoolean(index, values) {\n // byteIndex is floor(index / 8)\n const byteIndex = index >> 3;\n const bitIndex = index % 8;\n return ((values.typedArray[byteIndex] >> bitIndex) & 1) === 1;\n}\n\nfunction setBoolean(index, values, value) {\n // byteIndex is floor(index / 8)\n const byteIndex = index >> 3;\n const bitIndex = index % 8;\n\n if (value) {\n values.typedArray[byteIndex] |= 1 << bitIndex;\n } else {\n values.typedArray[byteIndex] &= ~(1 << bitIndex);\n }\n}\n\nfunction getInt64NumberFallback(index, values) {\n const dataView = values.dataView;\n const byteOffset = index * 8;\n let value = 0;\n const isNegative = (dataView.getUint8(byteOffset + 7) & 0x80) > 0;\n let carrying = true;\n for (let i = 0; i < 8; ++i) {\n let byte = dataView.getUint8(byteOffset + i);\n if (isNegative) {\n if (carrying) {\n if (byte !== 0x00) {\n byte = ~(byte - 1) & 0xff;\n carrying = false;\n }\n } else {\n byte = ~byte & 0xff;\n }\n }\n value += byte * Math.pow(256, i);\n }\n if (isNegative) {\n value = -value;\n }\n return value;\n}\n\nfunction getInt64BigIntFallback(index, values) {\n const dataView = values.dataView;\n const byteOffset = index * 8;\n // eslint-disable-next-line no-undef\n let value = BigInt(0);\n const isNegative = (dataView.getUint8(byteOffset + 7) & 0x80) > 0;\n let carrying = true;\n for (let i = 0; i < 8; ++i) {\n let byte = dataView.getUint8(byteOffset + i);\n if (isNegative) {\n if (carrying) {\n if (byte !== 0x00) {\n byte = ~(byte - 1) & 0xff;\n carrying = false;\n }\n } else {\n byte = ~byte & 0xff;\n }\n }\n value += BigInt(byte) * (BigInt(1) << BigInt(i * 8)); // eslint-disable-line\n }\n if (isNegative) {\n value = -value;\n }\n return value;\n}\n\nfunction getUint64NumberFallback(index, values) {\n const dataView = values.dataView;\n const byteOffset = index * 8;\n\n // Split 64-bit number into two 32-bit (4-byte) parts\n const left = dataView.getUint32(byteOffset, true);\n const right = dataView.getUint32(byteOffset + 4, true);\n\n // Combine the two 32-bit values\n const value = left + 4294967296 * right;\n\n return value;\n}\n\nfunction getUint64BigIntFallback(index, values) {\n const dataView = values.dataView;\n const byteOffset = index * 8;\n\n // Split 64-bit number into two 32-bit (4-byte) parts\n // eslint-disable-next-line no-undef\n const left = BigInt(dataView.getUint32(byteOffset, true));\n\n // eslint-disable-next-line no-undef\n const right = BigInt(dataView.getUint32(byteOffset + 4, true));\n\n // Combine the two 32-bit values\n // eslint-disable-next-line no-undef\n const value = left + BigInt(4294967296) * right;\n\n return value;\n}\n\nfunction getComponentDatatype(componentType) {\n switch (componentType) {\n case MetadataComponentType.INT8:\n return ComponentDatatype.BYTE;\n case MetadataComponentType.UINT8:\n return ComponentDatatype.UNSIGNED_BYTE;\n case MetadataComponentType.INT16:\n return ComponentDatatype.SHORT;\n case MetadataComponentType.UINT16:\n return ComponentDatatype.UNSIGNED_SHORT;\n case MetadataComponentType.INT32:\n return ComponentDatatype.INT;\n case MetadataComponentType.UINT32:\n return ComponentDatatype.UNSIGNED_INT;\n case MetadataComponentType.FLOAT32:\n return ComponentDatatype.FLOAT;\n case MetadataComponentType.FLOAT64:\n return ComponentDatatype.DOUBLE;\n }\n}\n\nfunction requiresUnpackForGet(property) {\n if (defined(property._unpackedValues)) {\n return false;\n }\n\n const classProperty = property._classProperty;\n const type = classProperty.type;\n const valueType = classProperty.valueType;\n\n if (type === MetadataType.STRING) {\n // Unpack since UTF-8 decoding is expensive\n return true;\n }\n\n if (\n valueType === MetadataComponentType.INT64 &&\n !FeatureDetection.supportsBigInt64Array()\n ) {\n // Unpack since the fallback INT64 getters are expensive\n return true;\n }\n\n if (\n valueType === MetadataComponentType.UINT64 &&\n !FeatureDetection.supportsBigUint64Array()\n ) {\n // Unpack since the fallback UINT64 getters are expensive\n return true;\n }\n\n return false;\n}\n\nfunction requiresUnpackForSet(property, index, value) {\n if (requiresUnpackForGet(property)) {\n return true;\n }\n\n const arrayOffsets = property._arrayOffsets;\n if (defined(arrayOffsets)) {\n // Unpacking is required if a variable-size array changes length since it\n // would be expensive to repack the binary data\n const oldLength = arrayOffsets.get(index + 1) - arrayOffsets.get(index);\n const newLength = value.length;\n if (oldLength !== newLength) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction unpackProperty(property) {\n property._unpackedValues = unpackValues(property);\n\n // Free memory\n property._arrayOffsets = undefined;\n property._stringOffsets = undefined;\n property._values = undefined;\n}\n\nfunction unpackValues(property) {\n const count = property._count;\n const unpackedValues = new Array(count);\n\n const classProperty = property._classProperty;\n const isArray = classProperty.isArray;\n const type = classProperty.type;\n const componentCount = MetadataType.getComponentCount(type);\n\n // Handle single values\n if (!isArray && componentCount === 1) {\n for (let i = 0; i < count; ++i) {\n unpackedValues[i] = property._getValue(i);\n }\n return unpackedValues;\n }\n\n for (let i = 0; i < count; i++) {\n unpackedValues[i] = getArrayValues(property, classProperty, i);\n }\n return unpackedValues;\n}\n\nfunction applyValueTransform(property, value) {\n const classProperty = property._classProperty;\n const isVariableLengthArray = classProperty.isVariableLengthArray;\n if (!property._hasValueTransform || isVariableLengthArray) {\n return value;\n }\n\n return MetadataClassProperty.valueTransformInPlace(\n value,\n property._offset,\n property._scale,\n MetadataComponentType.applyValueTransform\n );\n}\n\nfunction unapplyValueTransform(property, value) {\n const classProperty = property._classProperty;\n const isVariableLengthArray = classProperty.isVariableLengthArray;\n if (!property._hasValueTransform || isVariableLengthArray) {\n return value;\n }\n\n return MetadataClassProperty.valueTransformInPlace(\n value,\n property._offset,\n property._scale,\n MetadataComponentType.unapplyValueTransform\n );\n}\n\nfunction BufferView(bufferView, componentType, length) {\n const that = this;\n\n let typedArray;\n let getFunction;\n let setFunction;\n\n if (componentType === MetadataComponentType.INT64) {\n if (!FeatureDetection.supportsBigInt()) {\n oneTimeWarning(\n \"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.\"\n );\n typedArray = new Uint8Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length * 8\n );\n getFunction = function (index) {\n return getInt64NumberFallback(index, that);\n };\n } else if (!FeatureDetection.supportsBigInt64Array()) {\n typedArray = new Uint8Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length * 8\n );\n getFunction = function (index) {\n return getInt64BigIntFallback(index, that);\n };\n } else {\n // eslint-disable-next-line\n typedArray = new BigInt64Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length\n );\n setFunction = function (index, value) {\n // Convert the number to a BigInt before setting the value in the typed array\n that.typedArray[index] = BigInt(value); // eslint-disable-line\n };\n }\n } else if (componentType === MetadataComponentType.UINT64) {\n if (!FeatureDetection.supportsBigInt()) {\n oneTimeWarning(\n \"UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read.\"\n );\n typedArray = new Uint8Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length * 8\n );\n getFunction = function (index) {\n return getUint64NumberFallback(index, that);\n };\n } else if (!FeatureDetection.supportsBigUint64Array()) {\n typedArray = new Uint8Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length * 8\n );\n getFunction = function (index) {\n return getUint64BigIntFallback(index, that);\n };\n } else {\n // eslint-disable-next-line\n typedArray = new BigUint64Array(\n bufferView.buffer,\n bufferView.byteOffset,\n length\n );\n setFunction = function (index, value) {\n // Convert the number to a BigInt before setting the value in the typed array\n that.typedArray[index] = BigInt(value); // eslint-disable-line\n };\n }\n } else {\n const componentDatatype = getComponentDatatype(componentType);\n typedArray = ComponentDatatype.createArrayBufferView(\n componentDatatype,\n bufferView.buffer,\n bufferView.byteOffset,\n length\n );\n setFunction = function (index, value) {\n that.typedArray[index] = value;\n };\n }\n\n if (!defined(getFunction)) {\n getFunction = function (index) {\n return that.typedArray[index];\n };\n }\n\n this.typedArray = typedArray;\n this.dataView = new DataView(typedArray.buffer, typedArray.byteOffset);\n this.get = getFunction;\n this.set = setFunction;\n\n // for unit testing\n this._componentType = componentType;\n}\n\nexport default MetadataTableProperty;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\nimport MetadataTableProperty from \"./MetadataTableProperty.js\";\n\n/**\n * A table containing binary metadata for a collection of entities. This is\n * used for representing binary properties of a batch table, as well as binary\n * metadata in 3D Tiles next extensions.\n * <p>\n * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.count The number of entities in the table.\n * @param {Object} [options.properties] A dictionary containing properties.\n * @param {MetadataClass} options.class The class that properties conform to.\n * @param {Object.<String, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n *\n * @alias MetadataTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataTable(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const count = options.count;\n const metadataClass = options.class;\n\n let byteLength = 0;\n const properties = {};\n if (defined(options.properties)) {\n for (const propertyId in options.properties) {\n if (options.properties.hasOwnProperty(propertyId)) {\n const property = new MetadataTableProperty({\n count: count,\n property: options.properties[propertyId],\n classProperty: metadataClass.properties[propertyId],\n bufferViews: options.bufferViews,\n });\n properties[propertyId] = property;\n byteLength += property.byteLength;\n }\n }\n }\n\n this._count = count;\n this._class = metadataClass;\n this._properties = properties;\n this._byteLength = byteLength;\n}\n\nObject.defineProperties(MetadataTable.prototype, {\n /**\n * The number of entities in the table.\n *\n * @memberof MetadataTable.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n count: {\n get: function () {\n return this._count;\n },\n },\n\n /**\n * The class that properties conform to.\n *\n * @memberof MetadataTable.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * The size of all typed arrays used in this table.\n *\n * @memberof MetadataTable.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n byteLength: {\n get: function () {\n return this._byteLength;\n },\n },\n});\n\n/**\n * Returns whether the table has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the table has this property.\n * @private\n */\nMetadataTable.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the table has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the table has a property with the given semantic.\n * @private\n */\nMetadataTable.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nMetadataTable.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is an enum the name of the enum is returned.\n * </p>\n * <p>\n * If the property is normalized the normalized value is returned. The value is\n * in the range [-1.0, 1.0] for signed integer types and [0.0, 1.0] for unsigned\n * integer types.\n * </p>\n * <p>\n * If the property is not normalized and type or componentType is INT64 or\n * UINT64 a BigInt will be returned. On platforms that don't support BigInt a\n * number will be returned instead. Note that numbers only support up to 52 bits\n * of integer precision. Values greater than 2^53 - 1 or less than -(2^53 - 1)\n * may lose precision when read.\n * </p>\n *\n * @param {Number} index The index of the entity.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @private\n */\nMetadataTable.prototype.getProperty = function (index, propertyId) {\n const property = this._properties[propertyId];\n\n let value;\n if (defined(property)) {\n value = property.get(index);\n } else {\n value = getDefault(this._class, propertyId);\n }\n\n return value;\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is an enum the name of the enum must be provided, not the\n * integer value.\n * </p>\n * <p>\n * If the property is normalized a normalized value must be provided to this\n * function. The value must be in the range [-1.0, 1.0] for signed integer\n * types and [0.0, 1.0] for unsigned integer types.\n * </p>\n * <p>\n * If the property is not normalized and type or componentType is INT64 or\n * UINT64 a BigInt may be provided. On platforms that don't support BigInt a\n * number may be provided instead. Note that numbers only support up to 52 bits\n * of integer precision. Values greater than 2^53 - 1 or less than -(2^53 - 1)\n * may lose precision when set.\"\n * </p>\n *\n * @param {Number} index The index of the entity.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @exception {DeveloperError} value does not match type\n * @exception {DeveloperError} value is out of range for type\n * @exception {DeveloperError} Array length does not match componentCount\n * @private\n */\nMetadataTable.prototype.setProperty = function (index, propertyId, value) {\n const property = this._properties[propertyId];\n if (defined(property)) {\n property.set(index, value);\n return true;\n }\n\n return false;\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {Number} index The index of the entity.\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this semantic.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @private\n */\nMetadataTable.prototype.getPropertyBySemantic = function (index, semantic) {\n let property;\n const propertiesBySemantic = this._class.propertiesBySemantic;\n if (defined(propertiesBySemantic)) {\n property = propertiesBySemantic[semantic];\n }\n\n if (defined(property)) {\n return this.getProperty(index, property.id);\n }\n\n return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {Number} index The index of the entity.\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} index is required and between zero and count - 1\n * @exception {DeveloperError} value does not match type\n * @exception {DeveloperError} value is out of range for type\n * @exception {DeveloperError} Array length does not match componentCount\n * @private\n */\nMetadataTable.prototype.setPropertyBySemantic = function (\n index,\n semantic,\n value\n) {\n let property;\n const propertiesBySemantic = this._class.propertiesBySemantic;\n if (defined(propertiesBySemantic)) {\n property = propertiesBySemantic[semantic];\n }\n\n if (defined(property)) {\n return this.setProperty(index, property.id, value);\n }\n\n return false;\n};\n\n/**\n * Returns a typed array containing the property values for a given propertyId.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTable.prototype.getPropertyTypedArray = function (propertyId) {\n const property = this._properties[propertyId];\n\n if (defined(property)) {\n return property.getTypedArray();\n }\n\n return undefined;\n};\n\n/**\n * Returns a typed array containing the property values for the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nMetadataTable.prototype.getPropertyTypedArrayBySemantic = function (semantic) {\n let property;\n const propertiesBySemantic = this._class.propertiesBySemantic;\n if (defined(propertiesBySemantic)) {\n property = propertiesBySemantic[semantic];\n }\n\n if (defined(property)) {\n return this.getPropertyTypedArray(property.id);\n }\n\n return undefined;\n};\n\nfunction getDefault(classDefinition, propertyId) {\n const classProperties = classDefinition.properties;\n if (!defined(classProperties)) {\n return undefined;\n }\n\n const classProperty = classProperties[propertyId];\n if (defined(classProperty) && defined(classProperty.default)) {\n let value = classProperty.default;\n if (classProperty.isArray) {\n value = clone(value, true);\n }\n value = classProperty.normalize(value);\n return classProperty.unpackVectorAndMatrixTypes(value);\n }\n}\n\nexport default MetadataTable;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * A cache resource.\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias ResourceLoader\n * @constructor\n *\n * @see ResourceCache\n *\n * @private\n */\nfunction ResourceLoader() {}\n\nObject.defineProperties(ResourceLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof ResourceLoader.prototype\n *\n * @type {Promise.<ResourceLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof ResourceLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<ResourceLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nResourceLoader.prototype.load = function () {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nResourceLoader.prototype.unload = function () {};\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nResourceLoader.prototype.process = function (frameState) {};\n\n/**\n * Constructs a {@link RuntimeError} from an errorMessage and an error.\n *\n * @param {String} errorMessage The error message.\n * @param {Error} [error] The error.\n *\n * @returns {RuntimeError} The runtime error.\n * @private\n */\nResourceLoader.prototype.getError = function (errorMessage, error) {\n if (defined(error)) {\n errorMessage += `\\n${error.message}`;\n }\n\n const runtimeError = new RuntimeError(errorMessage);\n if (defined(error)) {\n runtimeError.stack = `Original stack:\\n${error.stack}\\nHandler stack:\\n${runtimeError.stack}`;\n }\n\n return runtimeError;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ResourceLoader#destroy\n * @private\n */\nResourceLoader.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the loaded resource.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * resourceLoader = resourceLoader && resourceLoader.destroy();\n *\n * @see ResourceLoader#isDestroyed\n * @private\n */\nResourceLoader.prototype.destroy = function () {\n this.unload();\n return destroyObject(this);\n};\n\nexport default ResourceLoader;\n", "/**\n * The {@link ResourceLoader} state.\n *\n * @private\n */\nconst ResourceLoaderState = {\n /**\n * The resource has not yet been loaded.\n *\n * @type {Number}\n * @constant\n * @private\n */\n UNLOADED: 0,\n /**\n * The resource is loading. In this state, external resources are fetched as needed.\n *\n * @type {Number}\n * @constant\n * @private\n */\n LOADING: 1,\n /**\n * The resource has finished loading, but requires further processing. GPU resources are allocated in this state as needed.\n *\n * @type {Number}\n * @constant\n * @private\n */\n PROCESSING: 2,\n /**\n * The resource has finished loading and processing; the results are ready to be used.\n *\n * @type {Number}\n * @constant\n * @private\n */\n READY: 3,\n /**\n * The resource loading or processing has failed due to an error.\n *\n * @type {Number}\n * @constant\n * @private\n */\n FAILED: 4,\n};\nexport default Object.freeze(ResourceLoaderState);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads an embedded or external buffer.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias BufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @exception {DeveloperError} One of options.typedArray and options.resource must be defined.\n *\n * @private\n */\nfunction BufferLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const typedArray = options.typedArray;\n const resource = options.resource;\n const cacheKey = options.cacheKey;\n\n this._typedArray = typedArray;\n this._resource = resource;\n this._cacheKey = cacheKey;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n BufferLoader.prototype = Object.create(ResourceLoader.prototype);\n BufferLoader.prototype.constructor = BufferLoader;\n}\n\nObject.defineProperties(BufferLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof BufferLoader.prototype\n *\n * @type {Promise.<BufferLoader>|undefined}\n * @readonly\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof BufferLoader.prototype\n *\n * @type {String}\n * @readonly\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The typed array containing the embedded buffer contents.\n *\n * @memberof BufferLoader.prototype\n *\n * @type {Uint8Array}\n * @readonly\n */\n typedArray: {\n get: function () {\n return this._typedArray;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<BufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nBufferLoader.prototype.load = function () {\n if (defined(this._typedArray)) {\n this._promise = Promise.resolve(this);\n } else {\n this._promise = loadExternalBuffer(this);\n }\n return this._promise;\n};\n\nfunction loadExternalBuffer(bufferLoader) {\n const resource = bufferLoader._resource;\n bufferLoader._state = ResourceLoaderState.LOADING;\n return BufferLoader._fetchArrayBuffer(resource)\n .then(function (arrayBuffer) {\n if (bufferLoader.isDestroyed()) {\n return;\n }\n bufferLoader._typedArray = new Uint8Array(arrayBuffer);\n bufferLoader._state = ResourceLoaderState.READY;\n return bufferLoader;\n })\n .catch(function (error) {\n if (bufferLoader.isDestroyed()) {\n return;\n }\n bufferLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = `Failed to load external buffer: ${resource.url}`;\n return Promise.reject(bufferLoader.getError(errorMessage, error));\n });\n}\n\n/**\n * Exposed for testing\n * @private\n */\nBufferLoader._fetchArrayBuffer = function (resource) {\n return resource.fetchArrayBuffer();\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nBufferLoader.prototype.unload = function () {\n this._typedArray = undefined;\n};\n\nexport default BufferLoader;\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptEncoder = (function() {\n\t\"use strict\";\n\n\t// Built with clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)\n\t// Built from meshoptimizer 0.18\n\tvar wasm = \"B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gVUUUUUB9gLUUUUB9gIUUUEU9gD99UE99I8ayDILEVLEVLOOOOORRVBWWBEdddLVE9wEIIVIEBEOWEUEC+g/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBV8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBOe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBRA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBWl9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+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB\";\n\n\t// Used to unpack wasm\n\tvar wasmpack = 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]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\t// This module requires WebAssembly to function\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar instance;\n\n\tvar promise =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t\tinstance.exports.meshopt_encodeVertexVersion(0);\n\t\t\tinstance.exports.meshopt_encodeIndexVersion(1);\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction assert(cond) {\n\t\tif (!cond) {\n\t\t\tthrow new Error(\"Assertion failed\");\n\t\t}\n\t}\n\n\tfunction bytes(view) {\n\t\treturn new Uint8Array(view.buffer, view.byteOffset, view.byteLength);\n\t}\n\n\tfunction reorder(indices, vertices, optf) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ip = sbrk(indices.length * 4);\n\t\tvar rp = sbrk(vertices * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar indices8 = bytes(indices);\n\t\theap.set(indices8, ip);\n\t\tif (optf) {\n\t\t\toptf(ip, ip, indices.length, vertices);\n\t\t}\n\t\tvar unique = instance.exports.meshopt_optimizeVertexFetchRemap(rp, ip, indices.length, vertices);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar remap = new Uint32Array(vertices);\n\t\tnew Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));\n\t\tindices8.set(heap.subarray(ip, ip + indices.length * 4));\n\t\tsbrk(ip - sbrk(0));\n\n\t\tfor (var i = 0; i < indices.length; ++i)\n\t\t\tindices[i] = remap[indices[i]];\n\n\t\treturn [remap, unique];\n\t}\n\n\tfunction encode(fun, bound, source, count, size) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar tp = sbrk(bound);\n\t\tvar sp = sbrk(count * size);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(source), sp);\n\t\tvar res = fun(tp, bound, sp, count, size);\n\t\tvar target = new Uint8Array(res);\n\t\ttarget.set(heap.subarray(tp, tp + res));\n\t\tsbrk(tp - sbrk(0));\n\t\treturn target;\n\t}\n\n\tfunction maxindex(source) {\n\t\tvar result = 0;\n\t\tfor (var i = 0; i < source.length; ++i) {\n\t\t\tvar index = source[i];\n\t\t\tresult = result < index ? index : result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction index32(source, size) {\n\t\tassert(size == 2 || size == 4);\n\t\tif (size == 4) {\n\t\t\treturn new Uint32Array(source.buffer, source.byteOffset, source.byteLength / 4);\n\t\t} else {\n\t\t\tvar view = new Uint16Array(source.buffer, source.byteOffset, source.byteLength / 2);\n\t\t\treturn new Uint32Array(view); // copies each element\n\t\t}\n\t}\n\n\tfunction filter(fun, source, count, stride, bits, insize) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar tp = sbrk(count * stride);\n\t\tvar sp = sbrk(count * insize);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(source), sp);\n\t\tfun(tp, count, stride, bits, sp);\n\t\tvar target = new Uint8Array(count * stride);\n\t\ttarget.set(heap.subarray(tp, tp + count * stride));\n\t\tsbrk(tp - sbrk(0));\n\t\treturn target;\n\t}\n\n\treturn {\n\t\tready: promise,\n\t\tsupported: true,\n\t\treorderMesh: function(indices, triangles, optsize) {\n\t\t\tvar optf = triangles ? (optsize ? instance.exports.meshopt_optimizeVertexCacheStrip : instance.exports.meshopt_optimizeVertexCache) : undefined;\n\t\t\treturn reorder(indices, maxindex(indices) + 1, optf);\n\t\t},\n\t\tencodeVertexBuffer: function(source, count, size) {\n\t\t\tassert(size > 0 && size <= 256);\n\t\t\tassert(size % 4 == 0);\n\t\t\tvar bound = instance.exports.meshopt_encodeVertexBufferBound(count, size);\n\t\t\treturn encode(instance.exports.meshopt_encodeVertexBuffer, bound, source, count, size);\n\t\t},\n\t\tencodeIndexBuffer: function(source, count, size) {\n\t\t\tassert(size == 2 || size == 4);\n\t\t\tassert(count % 3 == 0);\n\t\t\tvar indices = index32(source, size);\n\t\t\tvar bound = instance.exports.meshopt_encodeIndexBufferBound(count, maxindex(indices) + 1);\n\t\t\treturn encode(instance.exports.meshopt_encodeIndexBuffer, bound, indices, count, 4);\n\t\t},\n\t\tencodeIndexSequence: function(source, count, size) {\n\t\t\tassert(size == 2 || size == 4);\n\t\t\tvar indices = index32(source, size);\n\t\t\tvar bound = instance.exports.meshopt_encodeIndexSequenceBound(count, maxindex(indices) + 1);\n\t\t\treturn encode(instance.exports.meshopt_encodeIndexSequence, bound, indices, count, 4);\n\t\t},\n\t\tencodeGltfBuffer: function(source, count, size, mode) {\n\t\t\tvar table = {\n\t\t\t\tATTRIBUTES: this.encodeVertexBuffer,\n\t\t\t\tTRIANGLES: this.encodeIndexBuffer,\n\t\t\t\tINDICES: this.encodeIndexSequence,\n\t\t\t};\n\t\t\tassert(table[mode]);\n\t\t\treturn table[mode](source, count, size);\n\t\t},\n\t\tencodeFilterOct: function(source, count, stride, bits) {\n\t\t\tassert(stride == 4 || stride == 8);\n\t\t\tassert(bits >= 1 && bits <= 16);\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterOct, source, count, stride, bits, 16);\n\t\t},\n\t\tencodeFilterQuat: function(source, count, stride, bits) {\n\t\t\tassert(stride == 8);\n\t\t\tassert(bits >= 4 && bits <= 16);\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterQuat, source, count, stride, bits, 16);\n\t\t},\n\t\tencodeFilterExp: function(source, count, stride, bits) {\n\t\t\tassert(stride > 0 && stride % 4 == 0);\n\t\t\tassert(bits >= 1 && bits <= 24);\n\t\t\treturn filter(instance.exports.meshopt_encodeFilterExp, source, count, stride, bits, stride);\n\t\t},\n\t};\n})();\n\nexport { MeshoptEncoder };\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptDecoder = (function() {\n\t\"use strict\";\n\n\t// Built with clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)\n\t// Built from meshoptimizer 0.18\n\tvar wasm_base = \"B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9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UsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB\";\n\tvar wasm_simd = \"B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBRl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBWL79iv9rBdQ/T9TQLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK/H8jLhUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uHOAICEF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fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLAPeB+t+J83IBAIARP5EAIPBLAPeE+t+J83IWAIAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLAPeD+t+J83IZAIAKP5EAIPBLAPeI+t+J83IkKAWAIAO/8QBBKK+pDDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB\";\n\n\t// Uses bulk-memory and simd extensions\n\tvar detector = 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]);\n\n\t// Used to unpack wasm\n\tvar wasmpack = 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]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\t// This module requires WebAssembly to function\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar wasm = wasm_base;\n\n\tif (WebAssembly.validate(detector)) {\n\t\twasm = wasm_simd;\n\t}\n\n\tvar instance;\n\n\tvar promise =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction decode(fun, target, count, size, source, filter) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar count4 = (count + 3) & ~3; // pad for SIMD filter\n\t\tvar tp = sbrk(count4 * size);\n\t\tvar sp = sbrk(source.length);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(source, sp);\n\t\tvar res = fun(tp, count, size, sp, source.length);\n\t\tif (res == 0 && filter) {\n\t\t\tfilter(tp, count4, size);\n\t\t}\n\t\ttarget.set(heap.subarray(tp, tp + count * size));\n\t\tsbrk(tp - sbrk(0));\n\t\tif (res != 0) {\n\t\t\tthrow new Error(\"Malformed buffer data: \" + res);\n\t\t}\n\t};\n\n\tvar filters = {\n\t\t// legacy index-based enums for glTF\n\t\t0: \"\",\n\t\t1: \"meshopt_decodeFilterOct\",\n\t\t2: \"meshopt_decodeFilterQuat\",\n\t\t3: \"meshopt_decodeFilterExp\",\n\t\t// string-based enums for glTF\n\t\tNONE: \"\",\n\t\tOCTAHEDRAL: \"meshopt_decodeFilterOct\",\n\t\tQUATERNION: \"meshopt_decodeFilterQuat\",\n\t\tEXPONENTIAL: \"meshopt_decodeFilterExp\",\n\t};\n\n\tvar decoders = {\n\t\t// legacy index-based enums for glTF\n\t\t0: \"meshopt_decodeVertexBuffer\",\n\t\t1: \"meshopt_decodeIndexBuffer\",\n\t\t2: \"meshopt_decodeIndexSequence\",\n\t\t// string-based enums for glTF\n\t\tATTRIBUTES: \"meshopt_decodeVertexBuffer\",\n\t\tTRIANGLES: \"meshopt_decodeIndexBuffer\",\n\t\tINDICES: \"meshopt_decodeIndexSequence\",\n\t};\n\n\treturn {\n\t\tready: promise,\n\t\tsupported: true,\n\t\tdecodeVertexBuffer: function(target, count, size, source, filter) {\n\t\t\tdecode(instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);\n\t\t},\n\t\tdecodeIndexBuffer: function(target, count, size, source) {\n\t\t\tdecode(instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);\n\t\t},\n\t\tdecodeIndexSequence: function(target, count, size, source) {\n\t\t\tdecode(instance.exports.meshopt_decodeIndexSequence, target, count, size, source);\n\t\t},\n\t\tdecodeGltfBuffer: function(target, count, size, source, mode, filter) {\n\t\t\tdecode(instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);\n\t\t}\n\t};\n})();\n\nexport { MeshoptDecoder };\n", "// This file is part of meshoptimizer library and is distributed under the terms of MIT License.\n// Copyright (C) 2016-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)\nvar MeshoptSimplifier = (function() {\n\t\"use strict\";\n\n\t// Built with clang version 14.0.4 (https://github.com/llvm/llvm-project 29f1039a7285a5c3a9c353d054140bf2556d4c4d)\n\t// Built from meshoptimizer 0.18\n\tvar wasm = \"B9h79tEBBBECd9gEUEU9gEUB9gBB9gQUUUUUUU99UUEU9gVUUUUUB9gLUUUUE999gIUUUE999gLUUUUEU9gIUUUEUIMXDILVORBWWBEWLVE9wEIIVIEBEOWE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HLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB\";\n\n\t// Used to unpack wasm\n\tvar wasmpack = 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]);\n\n\tif (typeof WebAssembly !== 'object') {\n\t\t// This module requires WebAssembly to function\n\t\treturn {\n\t\t\tsupported: false,\n\t\t};\n\t}\n\n\tvar instance;\n\n\tvar promise =\n\t\tWebAssembly.instantiate(unpack(wasm), {})\n\t\t.then(function(result) {\n\t\t\tinstance = result.instance;\n\t\t\tinstance.exports.__wasm_call_ctors();\n\t\t});\n\n\tfunction unpack(data) {\n\t\tvar result = new Uint8Array(data.length);\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tvar ch = data.charCodeAt(i);\n\t\t\tresult[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;\n\t\t}\n\t\tvar write = 0;\n\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\tresult[write++] = (result[i] < 60) ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];\n\t\t}\n\t\treturn result.buffer.slice(0, write);\n\t}\n\n\tfunction assert(cond) {\n\t\tif (!cond) {\n\t\t\tthrow new Error(\"Assertion failed\");\n\t\t}\n\t}\n\n\tfunction bytes(view) {\n\t\treturn new Uint8Array(view.buffer, view.byteOffset, view.byteLength);\n\t}\n\n\tfunction reorder(indices, vertices) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar ip = sbrk(indices.length * 4);\n\t\tvar rp = sbrk(vertices * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar indices8 = bytes(indices);\n\t\theap.set(indices8, ip);\n\t\tvar unique = instance.exports.meshopt_optimizeVertexFetchRemap(rp, ip, indices.length, vertices);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar remap = new Uint32Array(vertices);\n\t\tnew Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));\n\t\tindices8.set(heap.subarray(ip, ip + indices.length * 4));\n\t\tsbrk(ip - sbrk(0));\n\n\t\tfor (var i = 0; i < indices.length; ++i)\n\t\t\tindices[i] = remap[indices[i]];\n\n\t\treturn [remap, unique];\n\t}\n\n\tfunction maxindex(source) {\n\t\tvar result = 0;\n\t\tfor (var i = 0; i < source.length; ++i) {\n\t\t\tvar index = source[i];\n\t\t\tresult = result < index ? index : result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction simplify(fun, indices, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar te = sbrk(4);\n\t\tvar ti = sbrk(index_count * 4);\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar si = sbrk(index_count * 4);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\theap.set(bytes(indices), si);\n\t\tvar result = fun(ti, si, index_count, sp, vertex_count, vertex_positions_stride, target_index_count, target_error, options, te);\n\t\t// heap may have grown\n\t\theap = new Uint8Array(instance.exports.memory.buffer);\n\t\tvar target = new Uint32Array(result);\n\t\tbytes(target).set(heap.subarray(ti, ti + result * 4));\n\t\tvar error = new Float32Array(1);\n\t\tbytes(error).set(heap.subarray(te, te + 4));\n\t\tsbrk(te - sbrk(0));\n\t\treturn [target, error[0]];\n\t}\n\n\tfunction simplifyScale(fun, vertex_positions, vertex_count, vertex_positions_stride) {\n\t\tvar sbrk = instance.exports.sbrk;\n\t\tvar sp = sbrk(vertex_count * vertex_positions_stride);\n\t\tvar heap = new Uint8Array(instance.exports.memory.buffer);\n\t\theap.set(bytes(vertex_positions), sp);\n\t\tvar result = fun(sp, vertex_count, vertex_positions_stride);\n\t\tsbrk(sp - sbrk(0));\n\t\treturn result;\n\t}\n\n\tvar simplifyOptions = {\n\t\tLockBorder: 1,\n\t};\n\n\treturn {\n\t\tready: promise,\n\t\tsupported: true,\n\n\t\tcompactMesh: function(indices) {\n\t\t\tassert(indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array);\n\t\t\tassert(indices.length % 3 == 0);\n\n\t\t\tvar indices32 = indices.BYTES_PER_ELEMENT == 4 ? indices : new Uint32Array(indices);\n\t\t\treturn reorder(indices32, maxindex(indices) + 1);\n\t\t},\n\n\t\tsimplify: function(indices, vertex_positions, vertex_positions_stride, target_index_count, target_error, flags) {\n\t\t\tassert(indices instanceof Uint32Array || indices instanceof Int32Array || indices instanceof Uint16Array || indices instanceof Int16Array);\n\t\t\tassert(indices.length % 3 == 0);\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\t\t\tassert(vertex_positions_stride >= 3);\n\t\t\tassert(target_index_count % 3 == 0);\n\n\t\t\tvar options = 0;\n\t\t\tfor (var i = 0; i < (flags ? flags.length : 0); ++i) {\n\t\t\t\toptions |= simplifyOptions[flags[i]];\n\t\t\t}\n\n\t\t\tvar indices32 = indices.BYTES_PER_ELEMENT == 4 ? indices : new Uint32Array(indices);\n\t\t\tvar result = simplify(instance.exports.meshopt_simplify, indices32, indices.length, vertex_positions, vertex_positions.length, vertex_positions_stride * 4, target_index_count, target_error, options);\n\t\t\tresult[0] = (indices instanceof Uint32Array) ? result[0] : new indices.constructor(result[0]);\n\n\t\t\treturn result;\n\t\t},\n\n\t\tgetScale: function(vertex_positions, vertex_positions_stride) {\n\t\t\tassert(vertex_positions instanceof Float32Array);\n\t\t\tassert(vertex_positions.length % vertex_positions_stride == 0);\n\n\t\t\treturn simplifyScale(instance.exports.meshopt_simplifyScale, vertex_positions, vertex_positions.length, vertex_positions_stride * 4);\n\t\t},\n\t};\n})();\n\nexport { MeshoptSimplifier };\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport { MeshoptDecoder } from \"meshoptimizer\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a glTF buffer view.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfBufferViewLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.bufferViewId The buffer view ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfBufferViewLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const bufferViewId = options.bufferViewId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const cacheKey = options.cacheKey;\n\n const bufferView = gltf.bufferViews[bufferViewId];\n let bufferId = bufferView.buffer;\n let byteOffset = bufferView.byteOffset;\n let byteLength = bufferView.byteLength;\n\n let hasMeshopt = false;\n let meshoptByteStride;\n let meshoptCount;\n let meshoptMode;\n let meshoptFilter;\n\n if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n const meshopt = bufferView.extensions.EXT_meshopt_compression;\n bufferId = meshopt.buffer;\n byteOffset = defaultValue(meshopt.byteOffset, 0);\n byteLength = meshopt.byteLength;\n\n hasMeshopt = true;\n meshoptByteStride = meshopt.byteStride;\n meshoptCount = meshopt.count;\n meshoptMode = meshopt.mode;\n meshoptFilter = defaultValue(meshopt.filter, \"NONE\");\n }\n\n const buffer = gltf.buffers[bufferId];\n\n this._hasMeshopt = hasMeshopt;\n this._meshoptByteStride = meshoptByteStride;\n this._meshoptCount = meshoptCount;\n this._meshoptMode = meshoptMode;\n this._meshoptFilter = meshoptFilter;\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._buffer = buffer;\n this._bufferId = bufferId;\n this._byteOffset = byteOffset;\n this._byteLength = byteLength;\n this._cacheKey = cacheKey;\n this._bufferLoader = undefined;\n this._typedArray = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n}\n\nif (defined(Object.create)) {\n GltfBufferViewLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfBufferViewLoader.prototype.constructor = GltfBufferViewLoader;\n}\n\nObject.defineProperties(GltfBufferViewLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfBufferViewLoader.prototype\n *\n * @type {Promise.<GltfBufferViewLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfBufferViewLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The typed array containing buffer view data.\n *\n * @memberof GltfBufferViewLoader.prototype\n *\n * @type {Uint8Array}\n * @readonly\n * @private\n */\n typedArray: {\n get: function () {\n return this._typedArray;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfBufferViewLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfBufferViewLoader.prototype.load = function () {\n const bufferLoader = getBufferLoader(this);\n this._bufferLoader = bufferLoader;\n this._state = ResourceLoaderState.LOADING;\n\n const that = this;\n const bufferViewPromise = new Promise(function (resolve) {\n that._process = function (loader, frameState) {\n if (!loader._hasMeshopt) {\n return;\n }\n\n if (!defined(loader._typedArray)) {\n return;\n }\n\n if (loader._state !== ResourceLoaderState.PROCESSING) {\n return;\n }\n\n const count = loader._meshoptCount;\n const byteStride = loader._meshoptByteStride;\n const result = new Uint8Array(count * byteStride);\n MeshoptDecoder.decodeGltfBuffer(\n result,\n count,\n byteStride,\n loader._typedArray,\n loader._meshoptMode,\n loader._meshoptFilter\n );\n\n loader._typedArray = result;\n loader._state = ResourceLoaderState.READY;\n resolve(loader);\n };\n });\n\n this._promise = bufferLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n const bufferTypedArray = bufferLoader.typedArray;\n const bufferViewTypedArray = new Uint8Array(\n bufferTypedArray.buffer,\n bufferTypedArray.byteOffset + that._byteOffset,\n that._byteLength\n );\n\n // Unload the buffer\n that.unload();\n\n that._typedArray = bufferViewTypedArray;\n if (that._hasMeshopt) {\n that._state = ResourceLoaderState.PROCESSING;\n return bufferViewPromise;\n }\n\n that._state = ResourceLoaderState.READY;\n return that;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n that.unload();\n that._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load buffer view\";\n return Promise.reject(that.getError(errorMessage, error));\n });\n\n return this._promise;\n};\n\nfunction getBufferLoader(bufferViewLoader) {\n const resourceCache = bufferViewLoader._resourceCache;\n const buffer = bufferViewLoader._buffer;\n if (defined(buffer.uri)) {\n const baseResource = bufferViewLoader._baseResource;\n const resource = baseResource.getDerivedResource({\n url: buffer.uri,\n });\n return resourceCache.loadExternalBuffer({\n resource: resource,\n });\n }\n return resourceCache.loadEmbeddedBuffer({\n parentResource: bufferViewLoader._gltfResource,\n bufferId: bufferViewLoader._bufferId,\n });\n}\n\n/**\n * Processes the resources. For a BufferView that does not have the EXT_meshopt_compression extension, there\n * is no processing that needs to happen, so this function returns immediately.\n *\n * @param {FrameState} frameState The frame state.\n */\nGltfBufferViewLoader.prototype.process = function (frameState) {\n return this._process(this, frameState);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfBufferViewLoader.prototype.unload = function () {\n if (defined(this._bufferLoader)) {\n this._resourceCache.unload(this._bufferLoader);\n }\n\n this._bufferLoader = undefined;\n this._typedArray = undefined;\n};\n\nexport default GltfBufferViewLoader;\n", "import defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\n\n/**\n * @private\n */\nfunction DracoLoader() {}\n\n// Maximum concurrency to use when decoding draco models\nDracoLoader._maxDecodingConcurrency = Math.max(\n FeatureDetection.hardwareConcurrency - 1,\n 1\n);\n\n// Exposed for testing purposes\nDracoLoader._decoderTaskProcessor = undefined;\nDracoLoader._taskProcessorReady = false;\nDracoLoader._getDecoderTaskProcessor = function () {\n if (!defined(DracoLoader._decoderTaskProcessor)) {\n const processor = new TaskProcessor(\n \"decodeDraco\",\n DracoLoader._maxDecodingConcurrency\n );\n processor\n .initWebAssemblyModule({\n modulePath: \"ThirdParty/Workers/draco_decoder_nodejs.js\",\n wasmBinaryFile: \"ThirdParty/draco_decoder.wasm\",\n })\n .then(function () {\n DracoLoader._taskProcessorReady = true;\n });\n DracoLoader._decoderTaskProcessor = processor;\n }\n\n return DracoLoader._decoderTaskProcessor;\n};\n\n/**\n * Decodes a compressed point cloud. Returns undefined if the task cannot be scheduled.\n * @private\n */\nDracoLoader.decodePointCloud = function (parameters) {\n const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();\n if (!DracoLoader._taskProcessorReady) {\n // The task processor is not ready to schedule tasks\n return;\n }\n return decoderTaskProcessor.scheduleTask(parameters, [\n parameters.buffer.buffer,\n ]);\n};\n\n/**\n * Decodes a buffer view. Returns undefined if the task cannot be scheduled.\n *\n * @param {Object} options Object with the following properties:\n * @param {Uint8Array} options.array The typed array containing the buffer view data.\n * @param {Object} options.bufferView The glTF buffer view object.\n * @param {Object.<String, Number>} options.compressedAttributes The compressed attributes.\n * @param {Boolean} options.dequantizeInShader Whether POSITION and NORMAL attributes should be dequantized on the GPU.\n *\n * @returns {Promise} A promise that resolves to the decoded indices and attributes.\n * @private\n */\nDracoLoader.decodeBufferView = function (options) {\n const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();\n if (!DracoLoader._taskProcessorReady) {\n // The task processor is not ready to schedule tasks\n return;\n }\n\n return decoderTaskProcessor.scheduleTask(options, [options.array.buffer]);\n};\n\nexport default DracoLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DracoLoader from \"./DracoLoader.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Load a draco buffer from a glTF.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfDracoLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfDracoLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const draco = options.draco;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const cacheKey = options.cacheKey;\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._gltf = gltf;\n this._draco = draco;\n this._cacheKey = cacheKey;\n this._bufferViewLoader = undefined;\n this._bufferViewTypedArray = undefined;\n this._decodePromise = undefined;\n this._decodedData = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n}\n\nif (defined(Object.create)) {\n GltfDracoLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfDracoLoader.prototype.constructor = GltfDracoLoader;\n}\n\nObject.defineProperties(GltfDracoLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready.\n *\n * @memberof GltfDracoLoader.prototype\n *\n * @type {Promise.<GltfDracoLoader>}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfDracoLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The decoded data.\n *\n * @memberof GltfDracoLoader.prototype\n *\n * @type {Object}\n * @readonly\n * @private\n */\n decodedData: {\n get: function () {\n return this._decodedData;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfDracoLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfDracoLoader.prototype.load = function () {\n const resourceCache = this._resourceCache;\n const bufferViewLoader = resourceCache.loadBufferView({\n gltf: this._gltf,\n bufferViewId: this._draco.bufferView,\n gltfResource: this._gltfResource,\n baseResource: this._baseResource,\n });\n\n this._bufferViewLoader = bufferViewLoader;\n this._state = ResourceLoaderState.LOADING;\n const that = this;\n const dracoPromise = new Promise(function (resolve, reject) {\n that._process = function (loader, frameState) {\n if (!defined(loader._bufferViewTypedArray)) {\n // Not ready to decode the Draco buffer\n return;\n }\n\n if (defined(loader._decodePromise)) {\n // Currently decoding\n return;\n }\n\n const draco = loader._draco;\n const gltf = loader._gltf;\n const bufferViews = gltf.bufferViews;\n const bufferViewId = draco.bufferView;\n const bufferView = bufferViews[bufferViewId];\n const compressedAttributes = draco.attributes;\n\n const decodeOptions = {\n // Need to make a copy of the typed array otherwise the underlying\n // ArrayBuffer may be accessed on both the worker and the main thread. This\n // leads to errors such as \"ArrayBuffer at index 0 is already detached\".\n // PERFORMANCE_IDEA: Look into SharedArrayBuffer to get around this.\n array: new Uint8Array(loader._bufferViewTypedArray),\n bufferView: bufferView,\n compressedAttributes: compressedAttributes,\n dequantizeInShader: true,\n };\n\n const decodePromise = DracoLoader.decodeBufferView(decodeOptions);\n\n if (!defined(decodePromise)) {\n // Cannot schedule task this frame\n return;\n }\n\n loader._decodePromise = decodePromise\n .then(function (results) {\n if (loader.isDestroyed()) {\n resolve();\n return;\n }\n\n // Unload everything except the decoded data\n loader.unload();\n\n loader._decodedData = {\n indices: results.indexArray,\n vertexAttributes: results.attributeData,\n };\n loader._state = ResourceLoaderState.READY;\n resolve(loader);\n })\n .catch(function (e) {\n if (loader.isDestroyed()) {\n resolve();\n return;\n }\n\n reject(e);\n });\n };\n });\n\n this._promise = bufferViewLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n // Now wait for process() to run to finish loading\n that._bufferViewTypedArray = bufferViewLoader.typedArray;\n that._state = ResourceLoaderState.PROCESSING;\n\n return dracoPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction handleError(dracoLoader, error) {\n dracoLoader.unload();\n dracoLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load Draco\";\n return Promise.reject(dracoLoader.getError(errorMessage, error));\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfDracoLoader.prototype.process = function (frameState) {\n return this._process(this, frameState);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfDracoLoader.prototype.unload = function () {\n if (defined(this._bufferViewLoader)) {\n this._resourceCache.unload(this._bufferViewLoader);\n }\n\n this._bufferViewLoader = undefined;\n this._bufferViewTypedArray = undefined;\n this._decodedData = undefined;\n this._gltf = undefined;\n};\n\nexport default GltfDracoLoader;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * @private\n */\nfunction loadImageFromTypedArray(options) {\n const uint8Array = options.uint8Array;\n const format = options.format;\n const request = options.request;\n const flipY = defaultValue(options.flipY, false);\n const skipColorSpaceConversion = defaultValue(\n options.skipColorSpaceConversion,\n false\n );\n const blob = new Blob([uint8Array], {\n type: format,\n });\n\n let blobUrl;\n return Resource.supportsImageBitmapOptions()\n .then(function (result) {\n if (result) {\n return Promise.resolve(\n Resource.createImageBitmapFromBlob(blob, {\n flipY: flipY,\n premultiplyAlpha: false,\n skipColorSpaceConversion: skipColorSpaceConversion,\n })\n );\n }\n\n blobUrl = window.URL.createObjectURL(blob);\n const resource = new Resource({\n url: blobUrl,\n request: request,\n });\n\n return resource.fetchImage({\n flipY: flipY,\n skipColorSpaceConversion: skipColorSpaceConversion,\n });\n })\n .then(function (result) {\n if (defined(blobUrl)) {\n window.URL.revokeObjectURL(blobUrl);\n }\n return result;\n })\n .catch(function (error) {\n if (defined(blobUrl)) {\n window.URL.revokeObjectURL(blobUrl);\n }\n return Promise.reject(error);\n });\n}\nexport default loadImageFromTypedArray;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport loadImageFromTypedArray from \"../Core/loadImageFromTypedArray.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a glTF image.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfImageLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfImageLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const imageId = options.imageId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const cacheKey = options.cacheKey;\n\n const image = gltf.images[imageId];\n const bufferViewId = image.bufferView;\n const uri = image.uri;\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._gltf = gltf;\n this._bufferViewId = bufferViewId;\n this._uri = uri;\n this._cacheKey = cacheKey;\n this._bufferViewLoader = undefined;\n this._image = undefined;\n this._mipLevels = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n GltfImageLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfImageLoader.prototype.constructor = GltfImageLoader;\n}\n\nObject.defineProperties(GltfImageLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfImageLoader.prototype\n *\n * @type {Promise.<GltfImageLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfImageLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The image.\n *\n * @memberof GltfImageLoader.prototype\n *\n * @type {Image|ImageBitmap|CompressedTextureBuffer}\n * @readonly\n * @private\n */\n image: {\n get: function () {\n return this._image;\n },\n },\n /**\n * The mip levels. Only defined for KTX2 files containing mip levels.\n *\n * @memberof GltfImageLoader.prototype\n *\n * @type {Uint8Array[]}\n * @readonly\n * @private\n */\n mipLevels: {\n get: function () {\n return this._mipLevels;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfImageLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfImageLoader.prototype.load = function () {\n if (defined(this._bufferViewId)) {\n this._promise = loadFromBufferView(this);\n return this._promise;\n }\n\n this._promise = loadFromUri(this);\n return this._promise;\n};\n\nfunction getImageAndMipLevels(image) {\n // Images transcoded from KTX2 can contain multiple mip levels:\n // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n let mipLevels;\n if (Array.isArray(image)) {\n // highest detail mip should be level 0\n mipLevels = image.slice(1, image.length).map(function (mipLevel) {\n return mipLevel.bufferView;\n });\n image = image[0];\n }\n return {\n image: image,\n mipLevels: mipLevels,\n };\n}\n\nfunction loadFromBufferView(imageLoader) {\n const resourceCache = imageLoader._resourceCache;\n const bufferViewLoader = resourceCache.loadBufferView({\n gltf: imageLoader._gltf,\n bufferViewId: imageLoader._bufferViewId,\n gltfResource: imageLoader._gltfResource,\n baseResource: imageLoader._baseResource,\n });\n\n imageLoader._bufferViewLoader = bufferViewLoader;\n imageLoader._state = ResourceLoaderState.LOADING;\n\n return bufferViewLoader.promise\n .then(function () {\n if (imageLoader.isDestroyed()) {\n return;\n }\n\n const typedArray = bufferViewLoader.typedArray;\n return loadImageFromBufferTypedArray(typedArray).then(function (image) {\n if (imageLoader.isDestroyed()) {\n return;\n }\n\n const imageAndMipLevels = getImageAndMipLevels(image);\n\n // Unload everything except the image\n imageLoader.unload();\n\n imageLoader._image = imageAndMipLevels.image;\n imageLoader._mipLevels = imageAndMipLevels.mipLevels;\n imageLoader._state = ResourceLoaderState.READY;\n return imageLoader;\n });\n })\n .catch(function (error) {\n if (imageLoader.isDestroyed()) {\n return;\n }\n return handleError(imageLoader, error, \"Failed to load embedded image\");\n });\n}\n\nfunction loadFromUri(imageLoader) {\n const baseResource = imageLoader._baseResource;\n const uri = imageLoader._uri;\n const resource = baseResource.getDerivedResource({\n url: uri,\n });\n imageLoader._state = ResourceLoaderState.LOADING;\n return loadImageFromUri(resource)\n .then(function (image) {\n if (imageLoader.isDestroyed()) {\n return;\n }\n\n const imageAndMipLevels = getImageAndMipLevels(image);\n\n // Unload everything except the image\n imageLoader.unload();\n\n imageLoader._image = imageAndMipLevels.image;\n imageLoader._mipLevels = imageAndMipLevels.mipLevels;\n imageLoader._state = ResourceLoaderState.READY;\n return imageLoader;\n })\n .catch(function (error) {\n if (imageLoader.isDestroyed()) {\n return;\n }\n return handleError(imageLoader, error, `Failed to load image: ${uri}`);\n });\n}\n\nfunction handleError(imageLoader, error, errorMessage) {\n imageLoader.unload();\n imageLoader._state = ResourceLoaderState.FAILED;\n return Promise.reject(imageLoader.getError(errorMessage, error));\n}\n\nfunction getMimeTypeFromTypedArray(typedArray) {\n const header = typedArray.subarray(0, 2);\n const webpHeaderRIFFChars = typedArray.subarray(0, 4);\n const webpHeaderWEBPChars = typedArray.subarray(8, 12);\n\n if (header[0] === 0xff && header[1] === 0xd8) {\n // See https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format\n return \"image/jpeg\";\n } else if (header[0] === 0x89 && header[1] === 0x50) {\n // See http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html\n return \"image/png\";\n } else if (header[0] === 0xab && header[1] === 0x4b) {\n // See http://github.khronos.org/KTX-Specification/#_identifier\n return \"image/ktx2\";\n } else if (\n // See https://developers.google.com/speed/webp/docs/riff_container#webp_file_header\n webpHeaderRIFFChars[0] === 0x52 &&\n webpHeaderRIFFChars[1] === 0x49 &&\n webpHeaderRIFFChars[2] === 0x46 &&\n webpHeaderRIFFChars[3] === 0x46 &&\n webpHeaderWEBPChars[0] === 0x57 &&\n webpHeaderWEBPChars[1] === 0x45 &&\n webpHeaderWEBPChars[2] === 0x42 &&\n webpHeaderWEBPChars[3] === 0x50\n ) {\n return \"image/webp\";\n }\n\n throw new RuntimeError(\"Image format is not recognized\");\n}\n\nfunction loadImageFromBufferTypedArray(typedArray) {\n const mimeType = getMimeTypeFromTypedArray(typedArray);\n if (mimeType === \"image/ktx2\") {\n // Need to make a copy of the embedded KTX2 buffer otherwise the underlying\n // ArrayBuffer may be accessed on both the worker and the main thread and\n // throw an error like \"Cannot perform Construct on a detached ArrayBuffer\".\n // Look into SharedArrayBuffer at some point to get around this.\n const ktxBuffer = new Uint8Array(typedArray);\n\n // Resolves to a CompressedTextureBuffer\n return loadKTX2(ktxBuffer);\n }\n // Resolves to an Image or ImageBitmap\n return GltfImageLoader._loadImageFromTypedArray({\n uint8Array: typedArray,\n format: mimeType,\n flipY: false,\n skipColorSpaceConversion: true,\n });\n}\n\nconst ktx2Regex = /(^data:image\\/ktx2)|(\\.ktx2$)/i;\n\nfunction loadImageFromUri(resource) {\n const uri = resource.url;\n if (ktx2Regex.test(uri)) {\n // Resolves to a CompressedTextureBuffer\n return loadKTX2(resource);\n }\n // Resolves to an ImageBitmap or Image\n return resource.fetchImage({\n skipColorSpaceConversion: true,\n preferImageBitmap: true,\n });\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfImageLoader.prototype.unload = function () {\n if (defined(this._bufferViewLoader)) {\n this._resourceCache.unload(this._bufferViewLoader);\n }\n\n this._bufferViewLoader = undefined;\n this._uri = undefined; // Free in case the uri is a data uri\n this._image = undefined;\n this._mipLevels = undefined;\n this._gltf = undefined;\n};\n\n// Exposed for testing\nGltfImageLoader._loadImageFromTypedArray = loadImageFromTypedArray;\n\nexport default GltfImageLoader;\n", "/**\n * @private\n */\nconst JobType = {\n TEXTURE: 0,\n PROGRAM: 1,\n BUFFER: 2,\n NUMBER_OF_JOB_TYPES: 3,\n};\nexport default Object.freeze(JobType);\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport JobType from \"./JobType.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads an index buffer from a glTF accessor.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfIndexBufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {String} [options.cacheKey] The cache key of the resource.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.loadBuffer=false] Load the index buffer as a GPU index buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load the index buffer as a typed array.\n * @private\n */\nfunction GltfIndexBufferLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const accessorId = options.accessorId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const draco = options.draco;\n const cacheKey = options.cacheKey;\n const asynchronous = defaultValue(options.asynchronous, true);\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n const indexDatatype = gltf.accessors[accessorId].componentType;\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._gltf = gltf;\n this._accessorId = accessorId;\n this._indexDatatype = indexDatatype;\n this._draco = draco;\n this._cacheKey = cacheKey;\n this._asynchronous = asynchronous;\n this._loadBuffer = loadBuffer;\n this._loadTypedArray = loadTypedArray;\n this._bufferViewLoader = undefined;\n this._dracoLoader = undefined;\n this._typedArray = undefined;\n this._buffer = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n}\n\nif (defined(Object.create)) {\n GltfIndexBufferLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfIndexBufferLoader.prototype.constructor = GltfIndexBufferLoader;\n}\n\nObject.defineProperties(GltfIndexBufferLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource has not yet started loading.\n *\n * @memberof GltfIndexBufferLoader.prototype\n *\n * @type {Promise.<GltfIndexBufferLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfIndexBufferLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The index buffer. This is only defined when <code>loadBuffer</code> is true.\n *\n * @memberof GltfIndexBufferLoader.prototype\n *\n * @type {Buffer}\n * @readonly\n * @private\n */\n buffer: {\n get: function () {\n return this._buffer;\n },\n },\n /**\n * The typed array containing indices. This is only defined when <code>loadTypedArray</code> is true.\n *\n * @memberof GltfIndexBufferLoader.prototype\n *\n * @type {Uint8Array|Uint16Array|Uint32Array}\n * @readonly\n * @private\n */\n typedArray: {\n get: function () {\n return this._typedArray;\n },\n },\n\n /**\n * The index datatype after decode.\n *\n * @memberof GltfIndexBufferLoader.prototype\n *\n * @type {IndexDatatype}\n * @readonly\n * @private\n */\n indexDatatype: {\n get: function () {\n return this._indexDatatype;\n },\n },\n});\n\nconst scratchIndexBufferJob = new CreateIndexBufferJob();\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfIndexBufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfIndexBufferLoader.prototype.load = function () {\n let promise;\n\n if (defined(this._draco)) {\n promise = loadFromDraco(this);\n } else {\n promise = loadFromBufferView(this);\n }\n\n const that = this;\n const processPromise = new Promise(function (resolve) {\n that._process = function (loader, frameState) {\n if (loader._state === ResourceLoaderState.READY) {\n return;\n }\n\n const typedArray = loader._typedArray;\n const indexDatatype = loader._indexDatatype;\n\n if (defined(loader._dracoLoader)) {\n loader._dracoLoader.process(frameState);\n }\n\n if (defined(loader._bufferViewLoader)) {\n loader._bufferViewLoader.process(frameState);\n }\n\n if (!defined(typedArray)) {\n // Buffer view hasn't been loaded yet\n return;\n }\n\n let buffer;\n if (loader._loadBuffer && loader._asynchronous) {\n const indexBufferJob = scratchIndexBufferJob;\n indexBufferJob.set(typedArray, indexDatatype, frameState.context);\n const jobScheduler = frameState.jobScheduler;\n if (!jobScheduler.execute(indexBufferJob, JobType.BUFFER)) {\n // Job scheduler is full. Try again next frame.\n return;\n }\n buffer = indexBufferJob.buffer;\n } else if (loader._loadBuffer) {\n buffer = createIndexBuffer(\n typedArray,\n indexDatatype,\n frameState.context\n );\n }\n\n // Unload everything except the index buffer and/or typed array.\n loader.unload();\n\n loader._buffer = buffer;\n loader._typedArray = loader._loadTypedArray ? typedArray : undefined;\n loader._state = ResourceLoaderState.READY;\n resolve(loader);\n };\n });\n\n this._promise = promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n\n return processPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction loadFromDraco(indexBufferLoader) {\n const resourceCache = indexBufferLoader._resourceCache;\n const dracoLoader = resourceCache.loadDraco({\n gltf: indexBufferLoader._gltf,\n draco: indexBufferLoader._draco,\n gltfResource: indexBufferLoader._gltfResource,\n baseResource: indexBufferLoader._baseResource,\n });\n\n indexBufferLoader._dracoLoader = dracoLoader;\n indexBufferLoader._state = ResourceLoaderState.LOADING;\n\n return dracoLoader.promise.then(function () {\n if (indexBufferLoader.isDestroyed()) {\n return;\n }\n // Now wait for process() to run to finish loading\n const typedArray = dracoLoader.decodedData.indices.typedArray;\n indexBufferLoader._typedArray = typedArray;\n // The index datatype may be a smaller datatype after draco decode\n indexBufferLoader._indexDatatype = ComponentDatatype.fromTypedArray(\n typedArray\n );\n indexBufferLoader._state = ResourceLoaderState.PROCESSING;\n return indexBufferLoader;\n });\n}\n\nfunction loadFromBufferView(indexBufferLoader) {\n const gltf = indexBufferLoader._gltf;\n const accessorId = indexBufferLoader._accessorId;\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n\n const resourceCache = indexBufferLoader._resourceCache;\n const bufferViewLoader = resourceCache.loadBufferView({\n gltf: gltf,\n bufferViewId: bufferViewId,\n gltfResource: indexBufferLoader._gltfResource,\n baseResource: indexBufferLoader._baseResource,\n });\n indexBufferLoader._state = ResourceLoaderState.LOADING;\n indexBufferLoader._bufferViewLoader = bufferViewLoader;\n\n return bufferViewLoader.promise.then(function () {\n if (indexBufferLoader.isDestroyed()) {\n return;\n }\n\n // Now wait for process() to run to finish loading\n const bufferViewTypedArray = bufferViewLoader.typedArray;\n indexBufferLoader._typedArray = createIndicesTypedArray(\n indexBufferLoader,\n bufferViewTypedArray\n );\n indexBufferLoader._state = ResourceLoaderState.PROCESSING;\n return indexBufferLoader;\n });\n}\n\nfunction createIndicesTypedArray(indexBufferLoader, bufferViewTypedArray) {\n const gltf = indexBufferLoader._gltf;\n const accessorId = indexBufferLoader._accessorId;\n const accessor = gltf.accessors[accessorId];\n const count = accessor.count;\n const indexDatatype = accessor.componentType;\n const indexSize = IndexDatatype.getSizeInBytes(indexDatatype);\n\n let arrayBuffer = bufferViewTypedArray.buffer;\n let byteOffset = bufferViewTypedArray.byteOffset + accessor.byteOffset;\n\n if (byteOffset % indexSize !== 0) {\n const byteLength = count * indexSize;\n const view = new Uint8Array(arrayBuffer, byteOffset, byteLength);\n const copy = new Uint8Array(view);\n arrayBuffer = copy.buffer;\n byteOffset = 0;\n deprecationWarning(\n \"index-buffer-unaligned\",\n `The index array is not aligned to a ${indexSize}-byte boundary.`\n );\n }\n\n let typedArray;\n if (indexDatatype === IndexDatatype.UNSIGNED_BYTE) {\n typedArray = new Uint8Array(arrayBuffer, byteOffset, count);\n } else if (indexDatatype === IndexDatatype.UNSIGNED_SHORT) {\n typedArray = new Uint16Array(arrayBuffer, byteOffset, count);\n } else if (indexDatatype === IndexDatatype.UNSIGNED_INT) {\n typedArray = new Uint32Array(arrayBuffer, byteOffset, count);\n }\n\n return typedArray;\n}\n\nfunction handleError(indexBufferLoader, error) {\n indexBufferLoader.unload();\n indexBufferLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load index buffer\";\n error = indexBufferLoader.getError(errorMessage, error);\n return Promise.reject(error);\n}\n\nfunction CreateIndexBufferJob() {\n this.typedArray = undefined;\n this.indexDatatype = undefined;\n this.context = undefined;\n this.buffer = undefined;\n}\n\nCreateIndexBufferJob.prototype.set = function (\n typedArray,\n indexDatatype,\n context\n) {\n this.typedArray = typedArray;\n this.indexDatatype = indexDatatype;\n this.context = context;\n};\n\nCreateIndexBufferJob.prototype.execute = function () {\n this.buffer = createIndexBuffer(\n this.typedArray,\n this.indexDatatype,\n this.context\n );\n};\n\nfunction createIndexBuffer(typedArray, indexDatatype, context) {\n const buffer = Buffer.createIndexBuffer({\n typedArray: typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: indexDatatype,\n });\n buffer.vertexArrayDestroyable = false;\n return buffer;\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfIndexBufferLoader.prototype.process = function (frameState) {\n return this._process(this, frameState);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfIndexBufferLoader.prototype.unload = function () {\n if (defined(this._buffer)) {\n this._buffer.destroy();\n }\n\n const resourceCache = this._resourceCache;\n\n if (defined(this._bufferViewLoader)) {\n resourceCache.unload(this._bufferViewLoader);\n }\n\n if (defined(this._dracoLoader)) {\n resourceCache.unload(this._dracoLoader);\n }\n\n this._bufferViewLoader = undefined;\n this._dracoLoader = undefined;\n this._typedArray = undefined;\n this._buffer = undefined;\n this._gltf = undefined;\n};\n\nexport default GltfIndexBufferLoader;\n", "import defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * Adds an element to an array and returns the element's index.\n *\n * @param {Array} array The array to add to.\n * @param {Object} element The element to add.\n * @param {Boolean} [checkDuplicates=false] When <code>true</code>, if a duplicate element is found its index is returned and <code>element</code> is not added to the array.\n *\n * @private\n */\nfunction addToArray(array, element, checkDuplicates) {\n checkDuplicates = defaultValue(checkDuplicates, false);\n if (checkDuplicates) {\n const index = array.indexOf(element);\n if (index > -1) {\n return index;\n }\n }\n\n array.push(element);\n return array.length - 1;\n}\n\nexport default addToArray;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * Checks whether the glTF uses the given extension.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The name of the extension.\n * @returns {Boolean} Whether the glTF uses the given extension.\n *\n * @private\n */\nfunction usesExtension(gltf, extension) {\n return (\n defined(gltf.extensionsUsed) && gltf.extensionsUsed.indexOf(extension) >= 0\n );\n}\n\nexport default usesExtension;\n", "import usesExtension from \"./usesExtension.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Contains traversal functions for processing elements of the glTF hierarchy.\n * @constructor\n *\n * @private\n */\nfunction ForEach() {}\n\n/**\n * Fallback for glTF 1.0\n * @private\n */\nForEach.objectLegacy = function (objects, handler) {\n if (defined(objects)) {\n for (const objectId in objects) {\n if (Object.prototype.hasOwnProperty.call(objects, objectId)) {\n const object = objects[objectId];\n const value = handler(object, objectId);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n }\n};\n\n/**\n * @private\n */\nForEach.object = function (arrayOfObjects, handler) {\n if (defined(arrayOfObjects)) {\n const length = arrayOfObjects.length;\n for (let i = 0; i < length; i++) {\n const object = arrayOfObjects[i];\n const value = handler(object, i);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\n/**\n * Supports glTF 1.0 and 2.0\n * @private\n */\nForEach.topLevel = function (gltf, name, handler) {\n const gltfProperty = gltf[name];\n if (defined(gltfProperty) && !Array.isArray(gltfProperty)) {\n return ForEach.objectLegacy(gltfProperty, handler);\n }\n\n return ForEach.object(gltfProperty, handler);\n};\n\nForEach.accessor = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"accessors\", handler);\n};\n\nForEach.accessorWithSemantic = function (gltf, semantic, handler) {\n const visited = {};\n return ForEach.mesh(gltf, function (mesh) {\n return ForEach.meshPrimitive(mesh, function (primitive) {\n const valueForEach = ForEach.meshPrimitiveAttribute(\n primitive,\n function (accessorId, attributeSemantic) {\n if (\n attributeSemantic.indexOf(semantic) === 0 &&\n !defined(visited[accessorId])\n ) {\n visited[accessorId] = true;\n const value = handler(accessorId);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n );\n\n if (defined(valueForEach)) {\n return valueForEach;\n }\n\n return ForEach.meshPrimitiveTarget(primitive, function (target) {\n return ForEach.meshPrimitiveTargetAttribute(\n target,\n function (accessorId, attributeSemantic) {\n if (\n attributeSemantic.indexOf(semantic) === 0 &&\n !defined(visited[accessorId])\n ) {\n visited[accessorId] = true;\n const value = handler(accessorId);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n );\n });\n });\n });\n};\n\nForEach.accessorContainingVertexAttributeData = function (gltf, handler) {\n const visited = {};\n return ForEach.mesh(gltf, function (mesh) {\n return ForEach.meshPrimitive(mesh, function (primitive) {\n const valueForEach = ForEach.meshPrimitiveAttribute(\n primitive,\n function (accessorId) {\n if (!defined(visited[accessorId])) {\n visited[accessorId] = true;\n const value = handler(accessorId);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n );\n\n if (defined(valueForEach)) {\n return valueForEach;\n }\n\n return ForEach.meshPrimitiveTarget(primitive, function (target) {\n return ForEach.meshPrimitiveTargetAttribute(\n target,\n function (accessorId) {\n if (!defined(visited[accessorId])) {\n visited[accessorId] = true;\n const value = handler(accessorId);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n );\n });\n });\n });\n};\n\nForEach.accessorContainingIndexData = function (gltf, handler) {\n const visited = {};\n return ForEach.mesh(gltf, function (mesh) {\n return ForEach.meshPrimitive(mesh, function (primitive) {\n const indices = primitive.indices;\n if (defined(indices) && !defined(visited[indices])) {\n visited[indices] = true;\n const value = handler(indices);\n\n if (defined(value)) {\n return value;\n }\n }\n });\n });\n};\n\nForEach.animation = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"animations\", handler);\n};\n\nForEach.animationChannel = function (animation, handler) {\n const channels = animation.channels;\n return ForEach.object(channels, handler);\n};\n\nForEach.animationSampler = function (animation, handler) {\n const samplers = animation.samplers;\n return ForEach.object(samplers, handler);\n};\n\nForEach.buffer = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"buffers\", handler);\n};\n\nForEach.bufferView = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"bufferViews\", handler);\n};\n\nForEach.camera = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"cameras\", handler);\n};\n\nForEach.image = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"images\", handler);\n};\n\nForEach.material = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"materials\", handler);\n};\n\nForEach.materialValue = function (material, handler) {\n let values = material.values;\n if (\n defined(material.extensions) &&\n defined(material.extensions.KHR_techniques_webgl)\n ) {\n values = material.extensions.KHR_techniques_webgl.values;\n }\n\n for (const name in values) {\n if (Object.prototype.hasOwnProperty.call(values, name)) {\n const value = handler(values[name], name);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.mesh = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"meshes\", handler);\n};\n\nForEach.meshPrimitive = function (mesh, handler) {\n const primitives = mesh.primitives;\n if (defined(primitives)) {\n const primitivesLength = primitives.length;\n for (let i = 0; i < primitivesLength; i++) {\n const primitive = primitives[i];\n const value = handler(primitive, i);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.meshPrimitiveAttribute = function (primitive, handler) {\n const attributes = primitive.attributes;\n for (const semantic in attributes) {\n if (Object.prototype.hasOwnProperty.call(attributes, semantic)) {\n const value = handler(attributes[semantic], semantic);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.meshPrimitiveTarget = function (primitive, handler) {\n const targets = primitive.targets;\n if (defined(targets)) {\n const length = targets.length;\n for (let i = 0; i < length; ++i) {\n const value = handler(targets[i], i);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.meshPrimitiveTargetAttribute = function (target, handler) {\n for (const semantic in target) {\n if (Object.prototype.hasOwnProperty.call(target, semantic)) {\n const accessorId = target[semantic];\n const value = handler(accessorId, semantic);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.node = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"nodes\", handler);\n};\n\nForEach.nodeInTree = function (gltf, nodeIds, handler) {\n const nodes = gltf.nodes;\n if (defined(nodes)) {\n const length = nodeIds.length;\n for (let i = 0; i < length; i++) {\n const nodeId = nodeIds[i];\n const node = nodes[nodeId];\n if (defined(node)) {\n let value = handler(node, nodeId);\n\n if (defined(value)) {\n return value;\n }\n\n const children = node.children;\n if (defined(children)) {\n value = ForEach.nodeInTree(gltf, children, handler);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n }\n }\n};\n\nForEach.nodeInScene = function (gltf, scene, handler) {\n const sceneNodeIds = scene.nodes;\n if (defined(sceneNodeIds)) {\n return ForEach.nodeInTree(gltf, sceneNodeIds, handler);\n }\n};\n\nForEach.program = function (gltf, handler) {\n if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n return ForEach.object(\n gltf.extensions.KHR_techniques_webgl.programs,\n handler\n );\n }\n\n return ForEach.topLevel(gltf, \"programs\", handler);\n};\n\nForEach.sampler = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"samplers\", handler);\n};\n\nForEach.scene = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"scenes\", handler);\n};\n\nForEach.shader = function (gltf, handler) {\n if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n return ForEach.object(\n gltf.extensions.KHR_techniques_webgl.shaders,\n handler\n );\n }\n\n return ForEach.topLevel(gltf, \"shaders\", handler);\n};\n\nForEach.skin = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"skins\", handler);\n};\n\nForEach.skinJoint = function (skin, handler) {\n const joints = skin.joints;\n if (defined(joints)) {\n const jointsLength = joints.length;\n for (let i = 0; i < jointsLength; i++) {\n const joint = joints[i];\n const value = handler(joint);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.techniqueAttribute = function (technique, handler) {\n const attributes = technique.attributes;\n for (const attributeName in attributes) {\n if (Object.prototype.hasOwnProperty.call(attributes, attributeName)) {\n const value = handler(attributes[attributeName], attributeName);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.techniqueUniform = function (technique, handler) {\n const uniforms = technique.uniforms;\n for (const uniformName in uniforms) {\n if (Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {\n const value = handler(uniforms[uniformName], uniformName);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.techniqueParameter = function (technique, handler) {\n const parameters = technique.parameters;\n for (const parameterName in parameters) {\n if (Object.prototype.hasOwnProperty.call(parameters, parameterName)) {\n const value = handler(parameters[parameterName], parameterName);\n\n if (defined(value)) {\n return value;\n }\n }\n }\n};\n\nForEach.technique = function (gltf, handler) {\n if (usesExtension(gltf, \"KHR_techniques_webgl\")) {\n return ForEach.object(\n gltf.extensions.KHR_techniques_webgl.techniques,\n handler\n );\n }\n\n return ForEach.topLevel(gltf, \"techniques\", handler);\n};\n\nForEach.texture = function (gltf, handler) {\n return ForEach.topLevel(gltf, \"textures\", handler);\n};\n\nexport default ForEach;\n", "\n\n/**\n * Utility function for retrieving the number of components in a given type.\n *\n * @param {String} type glTF type\n * @returns {Number} The number of components in that type.\n *\n * @private\n */\nfunction numberOfComponentsForType(type) {\n switch (type) {\n case \"SCALAR\":\n return 1;\n case \"VEC2\":\n return 2;\n case \"VEC3\":\n return 3;\n case \"VEC4\":\n case \"MAT2\":\n return 4;\n case \"MAT3\":\n return 9;\n case \"MAT4\":\n return 16;\n }\n}\n\nexport default numberOfComponentsForType;\n", "import numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Returns the byte stride of the provided accessor.\n * If the byteStride is 0, it is calculated based on type and componentType\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {Object} accessor The accessor.\n * @returns {Number} The byte stride of the accessor.\n *\n * @private\n */\nfunction getAccessorByteStride(gltf, accessor) {\n const bufferViewId = accessor.bufferView;\n if (defined(bufferViewId)) {\n const bufferView = gltf.bufferViews[bufferViewId];\n if (defined(bufferView.byteStride) && bufferView.byteStride > 0) {\n return bufferView.byteStride;\n }\n }\n return (\n ComponentDatatype.getSizeInBytes(accessor.componentType) *\n numberOfComponentsForType(accessor.type)\n );\n}\n\nexport default getAccessorByteStride;\n", "import addToArray from \"./addToArray.js\";\nimport ForEach from \"./ForEach.js\";\nimport getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\n/**\n * Adds default glTF values if they don't exist.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} The modified glTF.\n *\n * @private\n */\nfunction addDefaults(gltf) {\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.bufferView)) {\n accessor.byteOffset = defaultValue(accessor.byteOffset, 0);\n }\n });\n\n ForEach.bufferView(gltf, function (bufferView) {\n if (defined(bufferView.buffer)) {\n bufferView.byteOffset = defaultValue(bufferView.byteOffset, 0);\n }\n });\n\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n primitive.mode = defaultValue(primitive.mode, WebGLConstants.TRIANGLES);\n if (!defined(primitive.material)) {\n if (!defined(gltf.materials)) {\n gltf.materials = [];\n }\n const defaultMaterial = {\n name: \"default\",\n };\n primitive.material = addToArray(gltf.materials, defaultMaterial);\n }\n });\n });\n\n ForEach.accessorContainingVertexAttributeData(gltf, function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n accessor.normalized = defaultValue(accessor.normalized, false);\n if (defined(bufferViewId)) {\n const bufferView = gltf.bufferViews[bufferViewId];\n bufferView.byteStride = getAccessorByteStride(gltf, accessor);\n bufferView.target = WebGLConstants.ARRAY_BUFFER;\n }\n });\n\n ForEach.accessorContainingIndexData(gltf, function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n if (defined(bufferViewId)) {\n const bufferView = gltf.bufferViews[bufferViewId];\n bufferView.target = WebGLConstants.ELEMENT_ARRAY_BUFFER;\n }\n });\n\n ForEach.material(gltf, function (material) {\n const extensions = defaultValue(\n material.extensions,\n defaultValue.EMPTY_OBJECT\n );\n const materialsCommon = extensions.KHR_materials_common;\n if (defined(materialsCommon)) {\n const technique = materialsCommon.technique;\n const values = defined(materialsCommon.values)\n ? materialsCommon.values\n : {};\n materialsCommon.values = values;\n\n values.ambient = defined(values.ambient)\n ? values.ambient\n : [0.0, 0.0, 0.0, 1.0];\n values.emission = defined(values.emission)\n ? values.emission\n : [0.0, 0.0, 0.0, 1.0];\n\n values.transparency = defaultValue(values.transparency, 1.0);\n\n if (technique !== \"CONSTANT\") {\n values.diffuse = defined(values.diffuse)\n ? values.diffuse\n : [0.0, 0.0, 0.0, 1.0];\n if (technique !== \"LAMBERT\") {\n values.specular = defined(values.specular)\n ? values.specular\n : [0.0, 0.0, 0.0, 1.0];\n values.shininess = defaultValue(values.shininess, 0.0);\n }\n }\n\n // These actually exist on the extension object, not the values object despite what's shown in the spec\n materialsCommon.transparent = defaultValue(\n materialsCommon.transparent,\n false\n );\n materialsCommon.doubleSided = defaultValue(\n materialsCommon.doubleSided,\n false\n );\n\n return;\n }\n\n material.emissiveFactor = defaultValue(\n material.emissiveFactor,\n [0.0, 0.0, 0.0]\n );\n material.alphaMode = defaultValue(material.alphaMode, \"OPAQUE\");\n material.doubleSided = defaultValue(material.doubleSided, false);\n\n if (material.alphaMode === \"MASK\") {\n material.alphaCutoff = defaultValue(material.alphaCutoff, 0.5);\n }\n\n const techniquesExtension = extensions.KHR_techniques_webgl;\n if (defined(techniquesExtension)) {\n ForEach.materialValue(material, function (materialValue) {\n // Check if material value is a TextureInfo object\n if (defined(materialValue.index)) {\n addTextureDefaults(materialValue);\n }\n });\n }\n\n addTextureDefaults(material.emissiveTexture);\n addTextureDefaults(material.normalTexture);\n addTextureDefaults(material.occlusionTexture);\n\n const pbrMetallicRoughness = material.pbrMetallicRoughness;\n if (defined(pbrMetallicRoughness)) {\n pbrMetallicRoughness.baseColorFactor = defaultValue(\n pbrMetallicRoughness.baseColorFactor,\n [1.0, 1.0, 1.0, 1.0]\n );\n pbrMetallicRoughness.metallicFactor = defaultValue(\n pbrMetallicRoughness.metallicFactor,\n 1.0\n );\n pbrMetallicRoughness.roughnessFactor = defaultValue(\n pbrMetallicRoughness.roughnessFactor,\n 1.0\n );\n addTextureDefaults(pbrMetallicRoughness.baseColorTexture);\n addTextureDefaults(pbrMetallicRoughness.metallicRoughnessTexture);\n }\n\n const pbrSpecularGlossiness =\n extensions.KHR_materials_pbrSpecularGlossiness;\n if (defined(pbrSpecularGlossiness)) {\n pbrSpecularGlossiness.diffuseFactor = defaultValue(\n pbrSpecularGlossiness.diffuseFactor,\n [1.0, 1.0, 1.0, 1.0]\n );\n pbrSpecularGlossiness.specularFactor = defaultValue(\n pbrSpecularGlossiness.specularFactor,\n [1.0, 1.0, 1.0]\n );\n pbrSpecularGlossiness.glossinessFactor = defaultValue(\n pbrSpecularGlossiness.glossinessFactor,\n 1.0\n );\n addTextureDefaults(pbrSpecularGlossiness.specularGlossinessTexture);\n }\n });\n\n ForEach.animation(gltf, function (animation) {\n ForEach.animationSampler(animation, function (sampler) {\n sampler.interpolation = defaultValue(sampler.interpolation, \"LINEAR\");\n });\n });\n\n const animatedNodes = getAnimatedNodes(gltf);\n ForEach.node(gltf, function (node, id) {\n const animated = defined(animatedNodes[id]);\n if (\n animated ||\n defined(node.translation) ||\n defined(node.rotation) ||\n defined(node.scale)\n ) {\n node.translation = defaultValue(node.translation, [0.0, 0.0, 0.0]);\n node.rotation = defaultValue(node.rotation, [0.0, 0.0, 0.0, 1.0]);\n node.scale = defaultValue(node.scale, [1.0, 1.0, 1.0]);\n } else {\n node.matrix = defaultValue(\n node.matrix,\n [\n 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,\n 0.0, 1.0,\n ]\n );\n }\n });\n\n ForEach.sampler(gltf, function (sampler) {\n sampler.wrapS = defaultValue(sampler.wrapS, WebGLConstants.REPEAT);\n sampler.wrapT = defaultValue(sampler.wrapT, WebGLConstants.REPEAT);\n });\n\n if (defined(gltf.scenes) && !defined(gltf.scene)) {\n gltf.scene = 0;\n }\n\n return gltf;\n}\n\nfunction getAnimatedNodes(gltf) {\n const nodes = {};\n ForEach.animation(gltf, function (animation) {\n ForEach.animationChannel(animation, function (channel) {\n const target = channel.target;\n const nodeId = target.node;\n const path = target.path;\n // Ignore animations that target 'weights'\n if (path === \"translation\" || path === \"rotation\" || path === \"scale\") {\n nodes[nodeId] = true;\n }\n });\n });\n return nodes;\n}\n\nfunction addTextureDefaults(texture) {\n if (defined(texture)) {\n texture.texCoord = defaultValue(texture.texCoord, 0);\n }\n}\n\nexport default addDefaults;\n", "import ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds extras._pipeline to each object that can have extras in the glTF asset.\n * This stage runs before updateVersion and handles both glTF 1.0 and glTF 2.0 assets.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} The glTF asset with the added pipeline extras.\n *\n * @private\n */\nfunction addPipelineExtras(gltf) {\n ForEach.shader(gltf, function (shader) {\n addExtras(shader);\n });\n ForEach.buffer(gltf, function (buffer) {\n addExtras(buffer);\n });\n ForEach.image(gltf, function (image) {\n addExtras(image);\n });\n\n addExtras(gltf);\n\n return gltf;\n}\n\nfunction addExtras(object) {\n object.extras = defined(object.extras) ? object.extras : {};\n object.extras._pipeline = defined(object.extras._pipeline)\n ? object.extras._pipeline\n : {};\n}\n\nexport default addPipelineExtras;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensionsRequired if it is present.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The extension to remove.\n *\n * @private\n */\nfunction removeExtensionsRequired(gltf, extension) {\n const extensionsRequired = gltf.extensionsRequired;\n if (defined(extensionsRequired)) {\n const index = extensionsRequired.indexOf(extension);\n if (index >= 0) {\n extensionsRequired.splice(index, 1);\n }\n if (extensionsRequired.length === 0) {\n delete gltf.extensionsRequired;\n }\n }\n}\n\nexport default removeExtensionsRequired;\n", "import removeExtensionsRequired from \"./removeExtensionsRequired.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensionsUsed and gltf.extensionsRequired if it is present.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The extension to remove.\n *\n * @private\n */\nfunction removeExtensionsUsed(gltf, extension) {\n const extensionsUsed = gltf.extensionsUsed;\n if (defined(extensionsUsed)) {\n const index = extensionsUsed.indexOf(extension);\n if (index >= 0) {\n extensionsUsed.splice(index, 1);\n }\n removeExtensionsRequired(gltf, extension);\n if (extensionsUsed.length === 0) {\n delete gltf.extensionsUsed;\n }\n }\n}\n\nexport default removeExtensionsUsed;\n", "import addPipelineExtras from \"./addPipelineExtras.js\";\nimport removeExtensionsUsed from \"./removeExtensionsUsed.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport getMagic from \"../../Core/getMagic.js\";\nimport getStringFromTypedArray from \"../../Core/getStringFromTypedArray.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\n\nconst sizeOfUint32 = 4;\n\n/**\n * Convert a binary glTF to glTF.\n *\n * The returned glTF has pipeline extras included. The embedded binary data is stored in gltf.buffers[0].extras._pipeline.source.\n *\n * @param {Buffer} glb The glb data to parse.\n * @returns {Object} A javascript object containing a glTF asset with pipeline extras included.\n *\n * @private\n */\nfunction parseGlb(glb) {\n // Check that the magic string is present\n const magic = getMagic(glb);\n if (magic !== \"glTF\") {\n throw new RuntimeError(\"File is not valid binary glTF\");\n }\n\n const header = readHeader(glb, 0, 5);\n const version = header[1];\n if (version !== 1 && version !== 2) {\n throw new RuntimeError(\"Binary glTF version is not 1 or 2\");\n }\n\n if (version === 1) {\n return parseGlbVersion1(glb, header);\n }\n\n return parseGlbVersion2(glb, header);\n}\n\nfunction readHeader(glb, byteOffset, count) {\n const dataView = new DataView(glb.buffer);\n const header = new Array(count);\n for (let i = 0; i < count; ++i) {\n header[i] = dataView.getUint32(\n glb.byteOffset + byteOffset + i * sizeOfUint32,\n true\n );\n }\n return header;\n}\n\nfunction parseGlbVersion1(glb, header) {\n const length = header[2];\n const contentLength = header[3];\n const contentFormat = header[4];\n\n // Check that the content format is 0, indicating that it is JSON\n if (contentFormat !== 0) {\n throw new RuntimeError(\"Binary glTF scene format is not JSON\");\n }\n\n const jsonStart = 20;\n const binaryStart = jsonStart + contentLength;\n\n const contentString = getStringFromTypedArray(glb, jsonStart, contentLength);\n const gltf = JSON.parse(contentString);\n addPipelineExtras(gltf);\n\n const binaryBuffer = glb.subarray(binaryStart, length);\n\n const buffers = gltf.buffers;\n if (defined(buffers) && Object.keys(buffers).length > 0) {\n // In some older models, the binary glTF buffer is named KHR_binary_glTF\n const binaryGltfBuffer = defaultValue(\n buffers.binary_glTF,\n buffers.KHR_binary_glTF\n );\n if (defined(binaryGltfBuffer)) {\n binaryGltfBuffer.extras._pipeline.source = binaryBuffer;\n delete binaryGltfBuffer.uri;\n }\n }\n // Remove the KHR_binary_glTF extension\n removeExtensionsUsed(gltf, \"KHR_binary_glTF\");\n return gltf;\n}\n\nfunction parseGlbVersion2(glb, header) {\n const length = header[2];\n let byteOffset = 12;\n let gltf;\n let binaryBuffer;\n while (byteOffset < length) {\n const chunkHeader = readHeader(glb, byteOffset, 2);\n const chunkLength = chunkHeader[0];\n const chunkType = chunkHeader[1];\n byteOffset += 8;\n const chunkBuffer = glb.subarray(byteOffset, byteOffset + chunkLength);\n byteOffset += chunkLength;\n // Load JSON chunk\n if (chunkType === 0x4e4f534a) {\n const jsonString = getStringFromTypedArray(chunkBuffer);\n gltf = JSON.parse(jsonString);\n addPipelineExtras(gltf);\n }\n // Load Binary chunk\n else if (chunkType === 0x004e4942) {\n binaryBuffer = chunkBuffer;\n }\n }\n if (defined(gltf) && defined(binaryBuffer)) {\n const buffers = gltf.buffers;\n if (defined(buffers) && buffers.length > 0) {\n const buffer = buffers[0];\n buffer.extras._pipeline.source = binaryBuffer;\n }\n }\n return gltf;\n}\n\nexport default parseGlb;\n", "import ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Iterate through the objects within the glTF and delete their pipeline extras object.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} glTF with no pipeline extras.\n *\n * @private\n */\nfunction removePipelineExtras(gltf) {\n ForEach.shader(gltf, function (shader) {\n removeExtras(shader);\n });\n ForEach.buffer(gltf, function (buffer) {\n removeExtras(buffer);\n });\n ForEach.image(gltf, function (image) {\n removeExtras(image);\n });\n\n removeExtras(gltf);\n\n return gltf;\n}\n\nfunction removeExtras(object) {\n if (!defined(object.extras)) {\n return;\n }\n\n if (defined(object.extras._pipeline)) {\n delete object.extras._pipeline;\n }\n\n if (Object.keys(object.extras).length === 0) {\n delete object.extras;\n }\n}\n\nexport default removePipelineExtras;\n", "import addToArray from \"./addToArray.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds an extension to gltf.extensionsUsed if it does not already exist.\n * Initializes extensionsUsed if it is not defined.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The extension to add.\n *\n * @private\n */\nfunction addExtensionsUsed(gltf, extension) {\n let extensionsUsed = gltf.extensionsUsed;\n if (!defined(extensionsUsed)) {\n extensionsUsed = [];\n gltf.extensionsUsed = extensionsUsed;\n }\n addToArray(extensionsUsed, extension, true);\n}\n\nexport default addExtensionsUsed;\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\n\n/**\n * Returns a function to read and convert data from a DataView into an array.\n *\n * @param {Number} componentType Type to convert the data to.\n * @returns {ComponentReader} Function that reads and converts data.\n *\n * @private\n */\nfunction getComponentReader(componentType) {\n switch (componentType) {\n case ComponentDatatype.BYTE:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getInt8(\n byteOffset + i * componentTypeByteLength\n );\n }\n };\n case ComponentDatatype.UNSIGNED_BYTE:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getUint8(\n byteOffset + i * componentTypeByteLength\n );\n }\n };\n case ComponentDatatype.SHORT:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getInt16(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n case ComponentDatatype.UNSIGNED_SHORT:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getUint16(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n case ComponentDatatype.INT:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getInt32(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n case ComponentDatatype.UNSIGNED_INT:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getUint32(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n case ComponentDatatype.FLOAT:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getFloat32(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n case ComponentDatatype.DOUBLE:\n return function (\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n result\n ) {\n for (let i = 0; i < numberOfComponents; ++i) {\n result[i] = dataView.getFloat64(\n byteOffset + i * componentTypeByteLength,\n true\n );\n }\n };\n }\n}\n\n/**\n * A callback function that logs messages.\n * @callback ComponentReader\n *\n * @param {DataView} dataView The data view to read from.\n * @param {Number} byteOffset The byte offset applied when reading from the data view.\n * @param {Number} numberOfComponents The number of components to read.\n * @param {Number} componentTypeByteLength The byte length of each component.\n * @param {Number} result An array storing the components that are read.\n *\n * @private\n */\n\nexport default getComponentReader;\n", "import getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport getComponentReader from \"./getComponentReader.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Finds the min and max values of the accessor.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {Object} accessor The accessor object from the glTF asset to read.\n * @returns {{min: Array, max: Array}} min holding the array of minimum values and max holding the array of maximum values.\n *\n * @private\n */\nfunction findAccessorMinMax(gltf, accessor) {\n const bufferViews = gltf.bufferViews;\n const buffers = gltf.buffers;\n const bufferViewId = accessor.bufferView;\n const numberOfComponents = numberOfComponentsForType(accessor.type);\n\n // According to the spec, when bufferView is not defined, accessor must be initialized with zeros\n if (!defined(accessor.bufferView)) {\n return {\n min: new Array(numberOfComponents).fill(0.0),\n max: new Array(numberOfComponents).fill(0.0),\n };\n }\n\n const min = new Array(numberOfComponents).fill(Number.POSITIVE_INFINITY);\n const max = new Array(numberOfComponents).fill(Number.NEGATIVE_INFINITY);\n\n const bufferView = bufferViews[bufferViewId];\n const bufferId = bufferView.buffer;\n const buffer = buffers[bufferId];\n const source = buffer.extras._pipeline.source;\n\n const count = accessor.count;\n const byteStride = getAccessorByteStride(gltf, accessor);\n let byteOffset =\n accessor.byteOffset + bufferView.byteOffset + source.byteOffset;\n const componentType = accessor.componentType;\n const componentTypeByteLength =\n ComponentDatatype.getSizeInBytes(componentType);\n const dataView = new DataView(source.buffer);\n const components = new Array(numberOfComponents);\n const componentReader = getComponentReader(componentType);\n\n for (let i = 0; i < count; i++) {\n componentReader(\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n components\n );\n for (let j = 0; j < numberOfComponents; j++) {\n const value = components[j];\n min[j] = Math.min(min[j], value);\n max[j] = Math.max(max[j], value);\n }\n byteOffset += byteStride;\n }\n\n return {\n min: min,\n max: max,\n };\n}\n\nexport default findAccessorMinMax;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport ForEach from \"./ForEach.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\nconst defaultBlendEquation = [WebGLConstants.FUNC_ADD, WebGLConstants.FUNC_ADD];\n\nconst defaultBlendFactors = [\n WebGLConstants.ONE,\n WebGLConstants.ZERO,\n WebGLConstants.ONE,\n WebGLConstants.ZERO,\n];\n\nfunction isStateEnabled(renderStates, state) {\n const enabled = renderStates.enable;\n if (!defined(enabled)) {\n return false;\n }\n\n return enabled.indexOf(state) > -1;\n}\n\nconst supportedBlendFactors = [\n WebGLConstants.ZERO,\n WebGLConstants.ONE,\n WebGLConstants.SRC_COLOR,\n WebGLConstants.ONE_MINUS_SRC_COLOR,\n WebGLConstants.SRC_ALPHA,\n WebGLConstants.ONE_MINUS_SRC_ALPHA,\n WebGLConstants.DST_ALPHA,\n WebGLConstants.ONE_MINUS_DST_ALPHA,\n WebGLConstants.DST_COLOR,\n WebGLConstants.ONE_MINUS_DST_COLOR,\n];\n\n// If any of the blend factors are not supported, return the default\nfunction getSupportedBlendFactors(value, defaultValue) {\n if (!defined(value)) {\n return defaultValue;\n }\n\n for (let i = 0; i < 4; i++) {\n if (supportedBlendFactors.indexOf(value[i]) === -1) {\n return defaultValue;\n }\n }\n\n return value;\n}\n\n/**\n * Move glTF 1.0 technique render states to glTF 2.0 materials properties and KHR_blend extension.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} The updated glTF asset.\n *\n * @private\n */\nfunction moveTechniqueRenderStates(gltf) {\n const blendingForTechnique = {};\n const materialPropertiesForTechnique = {};\n const techniquesLegacy = gltf.techniques;\n if (!defined(techniquesLegacy)) {\n return gltf;\n }\n\n ForEach.technique(gltf, function (techniqueLegacy, techniqueIndex) {\n const renderStates = techniqueLegacy.states;\n if (defined(renderStates)) {\n const materialProperties = (materialPropertiesForTechnique[\n techniqueIndex\n ] = {});\n\n // If BLEND is enabled, the material should have alpha mode BLEND\n if (isStateEnabled(renderStates, WebGLConstants.BLEND)) {\n materialProperties.alphaMode = \"BLEND\";\n\n const blendFunctions = renderStates.functions;\n if (\n defined(blendFunctions) &&\n (defined(blendFunctions.blendEquationSeparate) ||\n defined(blendFunctions.blendFuncSeparate))\n ) {\n blendingForTechnique[techniqueIndex] = {\n blendEquation: defaultValue(\n blendFunctions.blendEquationSeparate,\n defaultBlendEquation\n ),\n blendFactors: getSupportedBlendFactors(\n blendFunctions.blendFuncSeparate,\n defaultBlendFactors\n ),\n };\n }\n }\n\n // If CULL_FACE is not enabled, the material should be doubleSided\n if (!isStateEnabled(renderStates, WebGLConstants.CULL_FACE)) {\n materialProperties.doubleSided = true;\n }\n\n delete techniqueLegacy.states;\n }\n });\n\n if (Object.keys(blendingForTechnique).length > 0) {\n if (!defined(gltf.extensions)) {\n gltf.extensions = {};\n }\n\n addExtensionsUsed(gltf, \"KHR_blend\");\n }\n\n ForEach.material(gltf, function (material) {\n if (defined(material.technique)) {\n const materialProperties =\n materialPropertiesForTechnique[material.technique];\n ForEach.objectLegacy(materialProperties, function (value, property) {\n material[property] = value;\n });\n\n const blending = blendingForTechnique[material.technique];\n if (defined(blending)) {\n if (!defined(material.extensions)) {\n material.extensions = {};\n }\n\n material.extensions.KHR_blend = blending;\n }\n }\n });\n\n return gltf;\n}\n\nexport default moveTechniqueRenderStates;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addToArray from \"./addToArray.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Adds an extension to gltf.extensionsRequired if it does not already exist.\n * Initializes extensionsRequired if it is not defined.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The extension to add.\n *\n * @private\n */\nfunction addExtensionsRequired(gltf, extension) {\n let extensionsRequired = gltf.extensionsRequired;\n if (!defined(extensionsRequired)) {\n extensionsRequired = [];\n gltf.extensionsRequired = extensionsRequired;\n }\n addToArray(extensionsRequired, extension, true);\n addExtensionsUsed(gltf, extension);\n}\n\nexport default addExtensionsRequired;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addExtensionsRequired from \"./addExtensionsRequired.js\";\nimport addToArray from \"./addToArray.js\";\nimport ForEach from \"./ForEach.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Move glTF 1.0 material techniques to glTF 2.0 KHR_techniques_webgl extension.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} The updated glTF asset.\n *\n * @private\n */\nfunction moveTechniquesToExtension(gltf) {\n const techniquesLegacy = gltf.techniques;\n const mappedUniforms = {};\n const updatedTechniqueIndices = {};\n const seenPrograms = {};\n if (defined(techniquesLegacy)) {\n const extension = {\n programs: [],\n shaders: [],\n techniques: [],\n };\n\n // Some 1.1 models have a glExtensionsUsed property that can be transferred to program.glExtensions\n const glExtensions = gltf.glExtensionsUsed;\n delete gltf.glExtensionsUsed;\n\n ForEach.technique(gltf, function (techniqueLegacy, techniqueId) {\n const technique = {\n name: techniqueLegacy.name,\n program: undefined,\n attributes: {},\n uniforms: {},\n };\n\n let parameterLegacy;\n ForEach.techniqueAttribute(\n techniqueLegacy,\n function (parameterName, attributeName) {\n parameterLegacy = techniqueLegacy.parameters[parameterName];\n technique.attributes[attributeName] = {\n semantic: parameterLegacy.semantic,\n };\n }\n );\n\n ForEach.techniqueUniform(\n techniqueLegacy,\n function (parameterName, uniformName) {\n parameterLegacy = techniqueLegacy.parameters[parameterName];\n technique.uniforms[uniformName] = {\n count: parameterLegacy.count,\n node: parameterLegacy.node,\n type: parameterLegacy.type,\n semantic: parameterLegacy.semantic,\n value: parameterLegacy.value,\n };\n\n // Store the name of the uniform to update material values.\n if (!defined(mappedUniforms[techniqueId])) {\n mappedUniforms[techniqueId] = {};\n }\n mappedUniforms[techniqueId][parameterName] = uniformName;\n }\n );\n\n if (!defined(seenPrograms[techniqueLegacy.program])) {\n const programLegacy = gltf.programs[techniqueLegacy.program];\n\n const program = {\n name: programLegacy.name,\n fragmentShader: undefined,\n vertexShader: undefined,\n glExtensions: glExtensions,\n };\n\n const fs = gltf.shaders[programLegacy.fragmentShader];\n program.fragmentShader = addToArray(extension.shaders, fs, true);\n\n const vs = gltf.shaders[programLegacy.vertexShader];\n program.vertexShader = addToArray(extension.shaders, vs, true);\n\n technique.program = addToArray(extension.programs, program);\n seenPrograms[techniqueLegacy.program] = technique.program;\n } else {\n technique.program = seenPrograms[techniqueLegacy.program];\n }\n\n // Store the index of the new technique to reference instead.\n updatedTechniqueIndices[techniqueId] = addToArray(\n extension.techniques,\n technique\n );\n });\n\n if (extension.techniques.length > 0) {\n if (!defined(gltf.extensions)) {\n gltf.extensions = {};\n }\n\n gltf.extensions.KHR_techniques_webgl = extension;\n addExtensionsUsed(gltf, \"KHR_techniques_webgl\");\n addExtensionsRequired(gltf, \"KHR_techniques_webgl\");\n }\n }\n\n ForEach.material(gltf, function (material) {\n if (defined(material.technique)) {\n const materialExtension = {\n technique: updatedTechniqueIndices[material.technique],\n };\n\n ForEach.objectLegacy(material.values, function (value, parameterName) {\n if (!defined(materialExtension.values)) {\n materialExtension.values = {};\n }\n\n const uniformName = mappedUniforms[material.technique][parameterName];\n if (defined(uniformName)) {\n materialExtension.values[uniformName] = value;\n }\n });\n\n if (!defined(material.extensions)) {\n material.extensions = {};\n }\n\n material.extensions.KHR_techniques_webgl = materialExtension;\n }\n\n delete material.technique;\n delete material.values;\n });\n\n delete gltf.techniques;\n delete gltf.programs;\n delete gltf.shaders;\n\n return gltf;\n}\n\nexport default moveTechniquesToExtension;\n", "import ForEach from \"./ForEach.js\";\nimport Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Calls the provider handler function on each texture used by the material.\n * Mimics the behavior of functions in gltf-pipeline ForEach.\n * @param {Object} material The glTF material.\n * @param {forEachTextureInMaterial~handler} handler Function that is called for each texture in the material.\n *\n * @private\n */\nfunction forEachTextureInMaterial(material, handler) {\n Check.typeOf.object(\"material\", material);\n Check.defined(\"handler\", handler);\n\n // Metallic roughness\n const pbrMetallicRoughness = material.pbrMetallicRoughness;\n if (defined(pbrMetallicRoughness)) {\n if (defined(pbrMetallicRoughness.baseColorTexture)) {\n const textureInfo = pbrMetallicRoughness.baseColorTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n if (defined(pbrMetallicRoughness.metallicRoughnessTexture)) {\n const textureInfo = pbrMetallicRoughness.metallicRoughnessTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n }\n\n if (defined(material.extensions)) {\n // Spec gloss extension\n const pbrSpecularGlossiness =\n material.extensions.KHR_materials_pbrSpecularGlossiness;\n if (defined(pbrSpecularGlossiness)) {\n if (defined(pbrSpecularGlossiness.diffuseTexture)) {\n const textureInfo = pbrSpecularGlossiness.diffuseTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n const textureInfo = pbrSpecularGlossiness.specularGlossinessTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n }\n\n // Materials common extension (may be present in models converted from glTF 1.0)\n const materialsCommon = material.extensions.KHR_materials_common;\n if (defined(materialsCommon) && defined(materialsCommon.values)) {\n const diffuse = materialsCommon.values.diffuse;\n const ambient = materialsCommon.values.ambient;\n const emission = materialsCommon.values.emission;\n const specular = materialsCommon.values.specular;\n if (defined(diffuse) && defined(diffuse.index)) {\n const value = handler(diffuse.index, diffuse);\n if (defined(value)) {\n return value;\n }\n }\n if (defined(ambient) && defined(ambient.index)) {\n const value = handler(ambient.index, ambient);\n if (defined(value)) {\n return value;\n }\n }\n if (defined(emission) && defined(emission.index)) {\n const value = handler(emission.index, emission);\n if (defined(value)) {\n return value;\n }\n }\n if (defined(specular) && defined(specular.index)) {\n const value = handler(specular.index, specular);\n if (defined(value)) {\n return value;\n }\n }\n }\n }\n\n // KHR_techniques_webgl extension\n const value = ForEach.materialValue(material, function (materialValue) {\n if (defined(materialValue.index)) {\n const value = handler(materialValue.index, materialValue);\n if (defined(value)) {\n return value;\n }\n }\n });\n if (defined(value)) {\n return value;\n }\n\n // Top level textures\n if (defined(material.emissiveTexture)) {\n const textureInfo = material.emissiveTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n\n if (defined(material.normalTexture)) {\n const textureInfo = material.normalTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n\n if (defined(material.occlusionTexture)) {\n const textureInfo = material.occlusionTexture;\n const value = handler(textureInfo.index, textureInfo);\n if (defined(value)) {\n return value;\n }\n }\n}\n\n/**\n * Function that is called for each texture in the material. If this function returns a value the for each stops and returns that value.\n * @callback forEachTextureInMaterial~handler\n * @param {Number} The texture index.\n * @param {Object} The texture info object.\n *\n * @private\n */\n\nexport default forEachTextureInMaterial;\n", "import ForEach from \"./ForEach.js\";\nimport forEachTextureInMaterial from \"./forEachTextureInMaterial.js\";\nimport usesExtension from \"./usesExtension.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\n\nconst allElementTypes = [\n \"mesh\",\n \"node\",\n \"material\",\n \"accessor\",\n \"bufferView\",\n \"buffer\",\n \"texture\",\n \"sampler\",\n \"image\",\n];\n\n/**\n * Removes unused elements from gltf.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String[]} [elementTypes=['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer']] Element types to be removed. Needs to be a subset of ['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer'], other items will be ignored.\n *\n * @private\n */\nfunction removeUnusedElements(gltf, elementTypes) {\n elementTypes = defaultValue(elementTypes, allElementTypes);\n allElementTypes.forEach(function (type) {\n if (elementTypes.indexOf(type) > -1) {\n removeUnusedElementsByType(gltf, type);\n }\n });\n return gltf;\n}\n\nconst TypeToGltfElementName = {\n accessor: \"accessors\",\n buffer: \"buffers\",\n bufferView: \"bufferViews\",\n image: \"images\",\n node: \"nodes\",\n material: \"materials\",\n mesh: \"meshes\",\n sampler: \"samplers\",\n texture: \"textures\",\n};\n\nfunction removeUnusedElementsByType(gltf, type) {\n const name = TypeToGltfElementName[type];\n const arrayOfObjects = gltf[name];\n\n if (defined(arrayOfObjects)) {\n let removed = 0;\n const usedIds = getListOfElementsIdsInUse[type](gltf);\n const length = arrayOfObjects.length;\n\n for (let i = 0; i < length; ++i) {\n if (!usedIds[i]) {\n Remove[type](gltf, i - removed);\n removed++;\n }\n }\n }\n}\n\n/**\n * Contains functions for removing elements from a glTF hierarchy.\n * Since top-level glTF elements are arrays, when something is removed, referring\n * indices need to be updated.\n * @constructor\n *\n * @private\n */\nfunction Remove() {}\n\nRemove.accessor = function (gltf, accessorId) {\n const accessors = gltf.accessors;\n\n accessors.splice(accessorId, 1);\n\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n // Update accessor ids for the primitives.\n ForEach.meshPrimitiveAttribute(\n primitive,\n function (attributeAccessorId, semantic) {\n if (attributeAccessorId > accessorId) {\n primitive.attributes[semantic]--;\n }\n }\n );\n\n // Update accessor ids for the targets.\n ForEach.meshPrimitiveTarget(primitive, function (target) {\n ForEach.meshPrimitiveTargetAttribute(\n target,\n function (attributeAccessorId, semantic) {\n if (attributeAccessorId > accessorId) {\n target[semantic]--;\n }\n }\n );\n });\n const indices = primitive.indices;\n if (defined(indices) && indices > accessorId) {\n primitive.indices--;\n }\n });\n });\n\n ForEach.skin(gltf, function (skin) {\n if (\n defined(skin.inverseBindMatrices) &&\n skin.inverseBindMatrices > accessorId\n ) {\n skin.inverseBindMatrices--;\n }\n });\n\n ForEach.animation(gltf, function (animation) {\n ForEach.animationSampler(animation, function (sampler) {\n if (defined(sampler.input) && sampler.input > accessorId) {\n sampler.input--;\n }\n if (defined(sampler.output) && sampler.output > accessorId) {\n sampler.output--;\n }\n });\n });\n};\n\nRemove.buffer = function (gltf, bufferId) {\n const buffers = gltf.buffers;\n\n buffers.splice(bufferId, 1);\n\n ForEach.bufferView(gltf, function (bufferView) {\n if (defined(bufferView.buffer) && bufferView.buffer > bufferId) {\n bufferView.buffer--;\n }\n\n if (\n defined(bufferView.extensions) &&\n defined(bufferView.extensions.EXT_meshopt_compression)\n ) {\n bufferView.extensions.EXT_meshopt_compression.buffer--;\n }\n });\n};\n\nRemove.bufferView = function (gltf, bufferViewId) {\n const bufferViews = gltf.bufferViews;\n\n bufferViews.splice(bufferViewId, 1);\n\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.bufferView) && accessor.bufferView > bufferViewId) {\n accessor.bufferView--;\n }\n });\n\n ForEach.shader(gltf, function (shader) {\n if (defined(shader.bufferView) && shader.bufferView > bufferViewId) {\n shader.bufferView--;\n }\n });\n\n ForEach.image(gltf, function (image) {\n if (defined(image.bufferView) && image.bufferView > bufferViewId) {\n image.bufferView--;\n }\n });\n\n if (usesExtension(gltf, \"KHR_draco_mesh_compression\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n if (\n defined(primitive.extensions) &&\n defined(primitive.extensions.KHR_draco_mesh_compression)\n ) {\n if (\n primitive.extensions.KHR_draco_mesh_compression.bufferView >\n bufferViewId\n ) {\n primitive.extensions.KHR_draco_mesh_compression.bufferView--;\n }\n }\n });\n });\n }\n\n if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n const extension = gltf.extensions.EXT_feature_metadata;\n const featureTables = extension.featureTables;\n for (const featureTableId in featureTables) {\n if (featureTables.hasOwnProperty(featureTableId)) {\n const featureTable = featureTables[featureTableId];\n const properties = featureTable.properties;\n if (defined(properties)) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n if (\n defined(property.bufferView) &&\n property.bufferView > bufferViewId\n ) {\n property.bufferView--;\n }\n if (\n defined(property.arrayOffsetBufferView) &&\n property.arrayOffsetBufferView > bufferViewId\n ) {\n property.arrayOffsetBufferView--;\n }\n if (\n defined(property.stringOffsetBufferView) &&\n property.stringOffsetBufferView > bufferViewId\n ) {\n property.stringOffsetBufferView--;\n }\n }\n }\n }\n }\n }\n }\n\n if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n const extension = gltf.extensions.EXT_structural_metadata;\n const propertyTables = extension.propertyTables;\n if (defined(propertyTables)) {\n const propertyTablesLength = propertyTables.length;\n for (let i = 0; i < propertyTablesLength; ++i) {\n const propertyTable = propertyTables[i];\n const properties = propertyTable.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n if (defined(property.values) && property.values > bufferViewId) {\n property.values--;\n }\n if (\n defined(property.arrayOffsets) &&\n property.arrayOffsets > bufferViewId\n ) {\n property.arrayOffsets--;\n }\n if (\n defined(property.stringOffsets) &&\n property.stringOffsets > bufferViewId\n ) {\n property.stringOffsets--;\n }\n }\n }\n }\n }\n }\n};\n\nRemove.image = function (gltf, imageId) {\n const images = gltf.images;\n images.splice(imageId, 1);\n\n ForEach.texture(gltf, function (texture) {\n if (defined(texture.source)) {\n if (texture.source > imageId) {\n --texture.source;\n }\n }\n const ext = texture.extensions;\n if (\n defined(ext) &&\n defined(ext.EXT_texture_webp) &&\n ext.EXT_texture_webp.source > imageId\n ) {\n --texture.extensions.EXT_texture_webp.source;\n } else if (\n defined(ext) &&\n defined(ext.KHR_texture_basisu) &&\n ext.KHR_texture_basisu.source > imageId\n ) {\n --texture.extensions.KHR_texture_basisu.source;\n }\n });\n};\n\nRemove.mesh = function (gltf, meshId) {\n const meshes = gltf.meshes;\n meshes.splice(meshId, 1);\n\n ForEach.node(gltf, function (node) {\n if (defined(node.mesh)) {\n if (node.mesh > meshId) {\n node.mesh--;\n } else if (node.mesh === meshId) {\n // Remove reference to deleted mesh\n delete node.mesh;\n }\n }\n });\n};\n\nRemove.node = function (gltf, nodeId) {\n const nodes = gltf.nodes;\n nodes.splice(nodeId, 1);\n\n // Shift all node references\n ForEach.skin(gltf, function (skin) {\n if (defined(skin.skeleton) && skin.skeleton > nodeId) {\n skin.skeleton--;\n }\n\n skin.joints = skin.joints.map(function (x) {\n return x > nodeId ? x - 1 : x;\n });\n });\n ForEach.animation(gltf, function (animation) {\n ForEach.animationChannel(animation, function (channel) {\n if (\n defined(channel.target) &&\n defined(channel.target.node) &&\n channel.target.node > nodeId\n ) {\n channel.target.node--;\n }\n });\n });\n ForEach.technique(gltf, function (technique) {\n ForEach.techniqueUniform(technique, function (uniform) {\n if (defined(uniform.node) && uniform.node > nodeId) {\n uniform.node--;\n }\n });\n });\n ForEach.node(gltf, function (node) {\n if (!defined(node.children)) {\n return;\n }\n\n node.children = node.children\n .filter(function (x) {\n return x !== nodeId; // Remove\n })\n .map(function (x) {\n return x > nodeId ? x - 1 : x; // Shift indices\n });\n });\n ForEach.scene(gltf, function (scene) {\n scene.nodes = scene.nodes\n .filter(function (x) {\n return x !== nodeId; // Remove\n })\n .map(function (x) {\n return x > nodeId ? x - 1 : x; // Shift indices\n });\n });\n};\n\nRemove.material = function (gltf, materialId) {\n const materials = gltf.materials;\n materials.splice(materialId, 1);\n\n // Shift other material ids\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n if (defined(primitive.material) && primitive.material > materialId) {\n primitive.material--;\n }\n });\n });\n};\n\nRemove.sampler = function (gltf, samplerId) {\n const samplers = gltf.samplers;\n samplers.splice(samplerId, 1);\n\n ForEach.texture(gltf, function (texture) {\n if (defined(texture.sampler)) {\n if (texture.sampler > samplerId) {\n --texture.sampler;\n }\n }\n });\n};\n\nRemove.texture = function (gltf, textureId) {\n const textures = gltf.textures;\n textures.splice(textureId, 1);\n\n ForEach.material(gltf, function (material) {\n forEachTextureInMaterial(material, function (textureIndex, textureInfo) {\n if (textureInfo.index > textureId) {\n --textureInfo.index;\n }\n });\n });\n\n if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n const extensions = primitive.extensions;\n if (defined(extensions) && defined(extensions.EXT_feature_metadata)) {\n const extension = extensions.EXT_feature_metadata;\n const featureIdTextures = extension.featureIdTextures;\n if (defined(featureIdTextures)) {\n const featureIdTexturesLength = featureIdTextures.length;\n for (let i = 0; i < featureIdTexturesLength; ++i) {\n const featureIdTexture = featureIdTextures[i];\n const textureInfo = featureIdTexture.featureIds.texture;\n if (textureInfo.index > textureId) {\n --textureInfo.index;\n }\n }\n }\n }\n });\n });\n\n const extension = gltf.extensions.EXT_feature_metadata;\n const featureTextures = extension.featureTextures;\n for (const featureTextureId in featureTextures) {\n if (featureTextures.hasOwnProperty(featureTextureId)) {\n const featureTexture = featureTextures[featureTextureId];\n const properties = featureTexture.properties;\n if (defined(properties)) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const textureInfo = property.texture;\n if (textureInfo.index > textureId) {\n --textureInfo.index;\n }\n }\n }\n }\n }\n }\n }\n\n if (usesExtension(gltf, \"EXT_mesh_features\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n const extensions = primitive.extensions;\n if (defined(extensions) && defined(extensions.EXT_mesh_features)) {\n const extension = extensions.EXT_mesh_features;\n const featureIds = extension.featureIds;\n if (defined(featureIds)) {\n const featureIdsLength = featureIds.length;\n for (let i = 0; i < featureIdsLength; ++i) {\n const featureId = featureIds[i];\n if (defined(featureId.texture)) {\n if (featureId.texture.index > textureId) {\n --featureId.texture.index;\n }\n }\n }\n }\n }\n });\n });\n }\n\n if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n const extension = gltf.extensions.EXT_structural_metadata;\n const propertyTextures = extension.propertyTextures;\n if (defined(propertyTextures)) {\n const propertyTexturesLength = propertyTextures.length;\n for (let i = 0; i < propertyTexturesLength; ++i) {\n const propertyTexture = propertyTextures[i];\n const properties = propertyTexture.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n if (property.index > textureId) {\n --property.index;\n }\n }\n }\n }\n }\n }\n};\n\n/**\n * Contains functions for getting a list of element ids in use by the glTF asset.\n * @constructor\n *\n * @private\n */\nfunction getListOfElementsIdsInUse() {}\n\ngetListOfElementsIdsInUse.accessor = function (gltf) {\n // Calculate accessor's that are currently in use.\n const usedAccessorIds = {};\n\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n ForEach.meshPrimitiveAttribute(primitive, function (accessorId) {\n usedAccessorIds[accessorId] = true;\n });\n ForEach.meshPrimitiveTarget(primitive, function (target) {\n ForEach.meshPrimitiveTargetAttribute(target, function (accessorId) {\n usedAccessorIds[accessorId] = true;\n });\n });\n const indices = primitive.indices;\n if (defined(indices)) {\n usedAccessorIds[indices] = true;\n }\n });\n });\n\n ForEach.skin(gltf, function (skin) {\n if (defined(skin.inverseBindMatrices)) {\n usedAccessorIds[skin.inverseBindMatrices] = true;\n }\n });\n\n ForEach.animation(gltf, function (animation) {\n ForEach.animationSampler(animation, function (sampler) {\n if (defined(sampler.input)) {\n usedAccessorIds[sampler.input] = true;\n }\n if (defined(sampler.output)) {\n usedAccessorIds[sampler.output] = true;\n }\n });\n });\n\n if (usesExtension(gltf, \"EXT_mesh_gpu_instancing\")) {\n ForEach.node(gltf, function (node) {\n if (\n defined(node.extensions) &&\n defined(node.extensions.EXT_mesh_gpu_instancing)\n ) {\n Object.keys(node.extensions.EXT_mesh_gpu_instancing.attributes).forEach(\n function (key) {\n const attributeAccessorId =\n node.extensions.EXT_mesh_gpu_instancing.attributes[key];\n usedAccessorIds[attributeAccessorId] = true;\n }\n );\n }\n });\n }\n\n return usedAccessorIds;\n};\n\ngetListOfElementsIdsInUse.buffer = function (gltf) {\n // Calculate buffer's that are currently in use.\n const usedBufferIds = {};\n\n ForEach.bufferView(gltf, function (bufferView) {\n if (defined(bufferView.buffer)) {\n usedBufferIds[bufferView.buffer] = true;\n }\n if (\n defined(bufferView.extensions) &&\n defined(bufferView.extensions.EXT_meshopt_compression)\n ) {\n usedBufferIds[\n bufferView.extensions.EXT_meshopt_compression.buffer\n ] = true;\n }\n });\n\n return usedBufferIds;\n};\n\ngetListOfElementsIdsInUse.bufferView = function (gltf) {\n // Calculate bufferView's that are currently in use.\n const usedBufferViewIds = {};\n\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.bufferView)) {\n usedBufferViewIds[accessor.bufferView] = true;\n }\n });\n\n ForEach.shader(gltf, function (shader) {\n if (defined(shader.bufferView)) {\n usedBufferViewIds[shader.bufferView] = true;\n }\n });\n\n ForEach.image(gltf, function (image) {\n if (defined(image.bufferView)) {\n usedBufferViewIds[image.bufferView] = true;\n }\n });\n\n if (usesExtension(gltf, \"KHR_draco_mesh_compression\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n if (\n defined(primitive.extensions) &&\n defined(primitive.extensions.KHR_draco_mesh_compression)\n ) {\n usedBufferViewIds[\n primitive.extensions.KHR_draco_mesh_compression.bufferView\n ] = true;\n }\n });\n });\n }\n\n if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n const extension = gltf.extensions.EXT_feature_metadata;\n const featureTables = extension.featureTables;\n for (const featureTableId in featureTables) {\n if (featureTables.hasOwnProperty(featureTableId)) {\n const featureTable = featureTables[featureTableId];\n const properties = featureTable.properties;\n if (defined(properties)) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n if (defined(property.bufferView)) {\n usedBufferViewIds[property.bufferView] = true;\n }\n if (defined(property.arrayOffsetBufferView)) {\n usedBufferViewIds[property.arrayOffsetBufferView] = true;\n }\n if (defined(property.stringOffsetBufferView)) {\n usedBufferViewIds[property.stringOffsetBufferView] = true;\n }\n }\n }\n }\n }\n }\n }\n\n if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n const extension = gltf.extensions.EXT_structural_metadata;\n const propertyTables = extension.propertyTables;\n if (defined(propertyTables)) {\n const propertyTablesLength = propertyTables.length;\n for (let i = 0; i < propertyTablesLength; ++i) {\n const propertyTable = propertyTables[i];\n const properties = propertyTable.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n if (defined(property.values)) {\n usedBufferViewIds[property.values] = true;\n }\n if (defined(property.arrayOffsets)) {\n usedBufferViewIds[property.arrayOffsets] = true;\n }\n if (defined(property.stringOffsets)) {\n usedBufferViewIds[property.stringOffsets] = true;\n }\n }\n }\n }\n }\n }\n\n return usedBufferViewIds;\n};\n\ngetListOfElementsIdsInUse.image = function (gltf) {\n const usedImageIds = {};\n\n ForEach.texture(gltf, function (texture) {\n if (defined(texture.source)) {\n usedImageIds[texture.source] = true;\n }\n\n if (\n defined(texture.extensions) &&\n defined(texture.extensions.EXT_texture_webp)\n ) {\n usedImageIds[texture.extensions.EXT_texture_webp.source] = true;\n } else if (\n defined(texture.extensions) &&\n defined(texture.extensions.KHR_texture_basisu)\n ) {\n usedImageIds[texture.extensions.KHR_texture_basisu.source] = true;\n }\n });\n return usedImageIds;\n};\n\ngetListOfElementsIdsInUse.mesh = function (gltf) {\n const usedMeshIds = {};\n ForEach.node(gltf, function (node) {\n if (defined(node.mesh && defined(gltf.meshes))) {\n const mesh = gltf.meshes[node.mesh];\n if (\n defined(mesh) &&\n defined(mesh.primitives) &&\n mesh.primitives.length > 0\n ) {\n usedMeshIds[node.mesh] = true;\n }\n }\n });\n\n return usedMeshIds;\n};\n\n// Check if node is empty. It is considered empty if neither referencing\n// mesh, camera, extensions and has no children\nfunction nodeIsEmpty(gltf, nodeId, usedNodeIds) {\n const node = gltf.nodes[nodeId];\n if (\n defined(node.mesh) ||\n defined(node.camera) ||\n defined(node.skin) ||\n defined(node.weights) ||\n defined(node.extras) ||\n (defined(node.extensions) && Object.keys(node.extensions).length !== 0) ||\n defined(usedNodeIds[nodeId])\n ) {\n return false;\n }\n\n // Empty if no children or children are all empty nodes\n return (\n !defined(node.children) ||\n node.children.filter(function (n) {\n return !nodeIsEmpty(gltf, n, usedNodeIds);\n }).length === 0\n );\n}\n\ngetListOfElementsIdsInUse.node = function (gltf) {\n const usedNodeIds = {};\n ForEach.skin(gltf, function (skin) {\n if (defined(skin.skeleton)) {\n usedNodeIds[skin.skeleton] = true;\n }\n\n ForEach.skinJoint(skin, function (joint) {\n usedNodeIds[joint] = true;\n });\n });\n ForEach.animation(gltf, function (animation) {\n ForEach.animationChannel(animation, function (channel) {\n if (defined(channel.target) && defined(channel.target.node)) {\n usedNodeIds[channel.target.node] = true;\n }\n });\n });\n ForEach.technique(gltf, function (technique) {\n ForEach.techniqueUniform(technique, function (uniform) {\n if (defined(uniform.node)) {\n usedNodeIds[uniform.node] = true;\n }\n });\n });\n ForEach.node(gltf, function (node, nodeId) {\n if (!nodeIsEmpty(gltf, nodeId, usedNodeIds)) {\n usedNodeIds[nodeId] = true;\n }\n });\n\n return usedNodeIds;\n};\n\ngetListOfElementsIdsInUse.material = function (gltf) {\n const usedMaterialIds = {};\n\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n if (defined(primitive.material)) {\n usedMaterialIds[primitive.material] = true;\n }\n });\n });\n\n return usedMaterialIds;\n};\n\ngetListOfElementsIdsInUse.texture = function (gltf) {\n const usedTextureIds = {};\n\n ForEach.material(gltf, function (material) {\n forEachTextureInMaterial(material, function (textureId) {\n usedTextureIds[textureId] = true;\n });\n });\n\n if (usesExtension(gltf, \"EXT_feature_metadata\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n const extensions = primitive.extensions;\n if (defined(extensions) && defined(extensions.EXT_feature_metadata)) {\n const extension = extensions.EXT_feature_metadata;\n const featureIdTextures = extension.featureIdTextures;\n if (defined(featureIdTextures)) {\n const featureIdTexturesLength = featureIdTextures.length;\n for (let i = 0; i < featureIdTexturesLength; ++i) {\n const featureIdTexture = featureIdTextures[i];\n const textureInfo = featureIdTexture.featureIds.texture;\n usedTextureIds[textureInfo.index] = true;\n }\n }\n }\n });\n });\n\n const extension = gltf.extensions.EXT_feature_metadata;\n const featureTextures = extension.featureTextures;\n for (const featureTextureId in featureTextures) {\n if (featureTextures.hasOwnProperty(featureTextureId)) {\n const featureTexture = featureTextures[featureTextureId];\n const properties = featureTexture.properties;\n if (defined(properties)) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const textureInfo = property.texture;\n usedTextureIds[textureInfo.index] = true;\n }\n }\n }\n }\n }\n }\n\n if (usesExtension(gltf, \"EXT_mesh_features\")) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n const extensions = primitive.extensions;\n if (defined(extensions) && defined(extensions.EXT_mesh_features)) {\n const extension = extensions.EXT_mesh_features;\n const featureIds = extension.featureIds;\n if (defined(featureIds)) {\n const featureIdsLength = featureIds.length;\n for (let i = 0; i < featureIdsLength; ++i) {\n const featureId = featureIds[i];\n if (defined(featureId.texture)) {\n usedTextureIds[featureId.texture.index] = true;\n }\n }\n }\n }\n });\n });\n }\n\n if (usesExtension(gltf, \"EXT_structural_metadata\")) {\n const extension = gltf.extensions.EXT_structural_metadata;\n const propertyTextures = extension.propertyTextures;\n if (defined(propertyTextures)) {\n const propertyTexturesLength = propertyTextures.length;\n for (let i = 0; i < propertyTexturesLength; ++i) {\n const propertyTexture = propertyTextures[i];\n const properties = propertyTexture.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n usedTextureIds[property.index] = true;\n }\n }\n }\n }\n }\n\n return usedTextureIds;\n};\n\ngetListOfElementsIdsInUse.sampler = function (gltf) {\n const usedSamplerIds = {};\n\n ForEach.texture(gltf, function (texture) {\n if (defined(texture.sampler)) {\n usedSamplerIds[texture.sampler] = true;\n }\n });\n\n return usedSamplerIds;\n};\n\nexport default removeUnusedElements;\n", "import addToArray from \"./addToArray.js\";\n\n/**\n * Adds buffer to gltf.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {Buffer} buffer A Buffer object which will be added to gltf.buffers.\n * @returns {Number} The bufferView id of the newly added bufferView.\n *\n * @private\n */\nfunction addBuffer(gltf, buffer) {\n const newBuffer = {\n byteLength: buffer.length,\n extras: {\n _pipeline: {\n source: buffer,\n },\n },\n };\n const bufferId = addToArray(gltf.buffers, newBuffer);\n const bufferView = {\n buffer: bufferId,\n byteOffset: 0,\n byteLength: buffer.length,\n };\n return addToArray(gltf.bufferViews, bufferView);\n}\n\nexport default addBuffer;\n", "import getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport getComponentReader from \"./getComponentReader.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Returns the accessor data in a contiguous array.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {Object} accessor The accessor.\n * @returns {Array} The accessor values in a contiguous array.\n *\n * @private\n */\nfunction readAccessorPacked(gltf, accessor) {\n const byteStride = getAccessorByteStride(gltf, accessor);\n const componentTypeByteLength = ComponentDatatype.getSizeInBytes(\n accessor.componentType\n );\n const numberOfComponents = numberOfComponentsForType(accessor.type);\n const count = accessor.count;\n const values = new Array(numberOfComponents * count);\n\n if (!defined(accessor.bufferView)) {\n return values.fill(0);\n }\n\n const bufferView = gltf.bufferViews[accessor.bufferView];\n const source = gltf.buffers[bufferView.buffer].extras._pipeline.source;\n let byteOffset =\n accessor.byteOffset + bufferView.byteOffset + source.byteOffset;\n\n const dataView = new DataView(source.buffer);\n const components = new Array(numberOfComponents);\n const componentReader = getComponentReader(accessor.componentType);\n\n for (let i = 0; i < count; ++i) {\n componentReader(\n dataView,\n byteOffset,\n numberOfComponents,\n componentTypeByteLength,\n components\n );\n for (let j = 0; j < numberOfComponents; ++j) {\n values[i * numberOfComponents + j] = components[j];\n }\n byteOffset += byteStride;\n }\n return values;\n}\n\nexport default readAccessorPacked;\n", "import addBuffer from \"./addBuffer.js\";\nimport ForEach from \"./ForEach.js\";\nimport readAccessorPacked from \"./readAccessorPacked.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\n/**\n * Update accessors referenced by JOINTS_0 and WEIGHTS_0 attributes to use correct component types.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @returns {Object} The glTF asset with compressed meshes.\n *\n * @private\n */\nfunction updateAccessorComponentTypes(gltf) {\n let componentType;\n ForEach.accessorWithSemantic(gltf, \"JOINTS_0\", function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n componentType = accessor.componentType;\n if (componentType === WebGLConstants.BYTE) {\n convertType(gltf, accessor, ComponentDatatype.UNSIGNED_BYTE);\n } else if (\n componentType !== WebGLConstants.UNSIGNED_BYTE &&\n componentType !== WebGLConstants.UNSIGNED_SHORT\n ) {\n convertType(gltf, accessor, ComponentDatatype.UNSIGNED_SHORT);\n }\n });\n ForEach.accessorWithSemantic(gltf, \"WEIGHTS_0\", function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n componentType = accessor.componentType;\n if (componentType === WebGLConstants.BYTE) {\n convertType(gltf, accessor, ComponentDatatype.UNSIGNED_BYTE);\n } else if (componentType === WebGLConstants.SHORT) {\n convertType(gltf, accessor, ComponentDatatype.UNSIGNED_SHORT);\n }\n });\n\n return gltf;\n}\n\nfunction convertType(gltf, accessor, updatedComponentType) {\n const typedArray = ComponentDatatype.createTypedArray(\n updatedComponentType,\n readAccessorPacked(gltf, accessor)\n );\n const newBuffer = new Uint8Array(typedArray.buffer);\n accessor.bufferView = addBuffer(gltf, newBuffer);\n accessor.componentType = updatedComponentType;\n accessor.byteOffset = 0;\n}\n\nexport default updateAccessorComponentTypes;\n", "import ForEach from \"./ForEach.js\";\nimport removeExtensionsUsed from \"./removeExtensionsUsed.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * Removes an extension from gltf.extensions, gltf.extensionsUsed, gltf.extensionsRequired, and any other objects in the glTF if it is present.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {String} extension The extension to remove.\n *\n * @returns {*} The extension data removed from gltf.extensions.\n */\nfunction removeExtension(gltf, extension) {\n removeExtensionsUsed(gltf, extension); // Also removes from extensionsRequired\n\n if (extension === \"CESIUM_RTC\") {\n removeCesiumRTC(gltf);\n }\n\n return removeExtensionAndTraverse(gltf, extension);\n}\n\nfunction removeCesiumRTC(gltf) {\n ForEach.technique(gltf, function (technique) {\n ForEach.techniqueUniform(technique, function (uniform) {\n if (uniform.semantic === \"CESIUM_RTC_MODELVIEW\") {\n uniform.semantic = \"MODELVIEW\";\n }\n });\n });\n}\n\nfunction removeExtensionAndTraverse(object, extension) {\n if (Array.isArray(object)) {\n const length = object.length;\n for (let i = 0; i < length; ++i) {\n removeExtensionAndTraverse(object[i], extension);\n }\n } else if (\n object !== null &&\n typeof object === \"object\" &&\n object.constructor === Object\n ) {\n const extensions = object.extensions;\n let extensionData;\n if (defined(extensions)) {\n extensionData = extensions[extension];\n if (defined(extensionData)) {\n delete extensions[extension];\n if (Object.keys(extensions).length === 0) {\n delete object.extensions;\n }\n }\n }\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n removeExtensionAndTraverse(object[key], extension);\n }\n }\n return extensionData;\n }\n}\n\nexport default removeExtension;\n", "import addExtensionsUsed from \"./addExtensionsUsed.js\";\nimport addToArray from \"./addToArray.js\";\nimport findAccessorMinMax from \"./findAccessorMinMax.js\";\nimport ForEach from \"./ForEach.js\";\nimport getAccessorByteStride from \"./getAccessorByteStride.js\";\nimport numberOfComponentsForType from \"./numberOfComponentsForType.js\";\nimport moveTechniqueRenderStates from \"./moveTechniqueRenderStates.js\";\nimport moveTechniquesToExtension from \"./moveTechniquesToExtension.js\";\nimport removeUnusedElements from \"./removeUnusedElements.js\";\nimport updateAccessorComponentTypes from \"./updateAccessorComponentTypes.js\";\nimport removeExtension from \"./removeExtension.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport clone from \"../../Core/clone.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\n\nconst updateFunctions = {\n 0.8: glTF08to10,\n \"1.0\": glTF10to20,\n \"2.0\": undefined,\n};\n\n/**\n * Update the glTF version to the latest version (2.0), or targetVersion if specified.\n * Applies changes made to the glTF spec between revisions so that the core library\n * only has to handle the latest version.\n *\n * @param {Object} gltf A javascript object containing a glTF asset.\n * @param {Object} [options] Options for updating the glTF.\n * @param {String} [options.targetVersion] The glTF will be upgraded until it hits the specified version.\n * @returns {Object} The updated glTF asset.\n *\n * @private\n */\nfunction updateVersion(gltf, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const targetVersion = options.targetVersion;\n let version = gltf.version;\n\n gltf.asset = defaultValue(gltf.asset, {\n version: \"1.0\",\n });\n\n gltf.asset.version = defaultValue(gltf.asset.version, \"1.0\");\n version = defaultValue(version, gltf.asset.version).toString();\n\n // Invalid version\n if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {\n // Try truncating trailing version numbers, could be a number as well if it is 0.8\n if (defined(version)) {\n version = version.substring(0, 3);\n }\n // Default to 1.0 if it cannot be determined\n if (!Object.prototype.hasOwnProperty.call(updateFunctions, version)) {\n version = \"1.0\";\n }\n }\n\n let updateFunction = updateFunctions[version];\n\n while (defined(updateFunction)) {\n if (version === targetVersion) {\n break;\n }\n updateFunction(gltf, options);\n version = gltf.asset.version;\n updateFunction = updateFunctions[version];\n }\n\n if (!options.keepLegacyExtensions) {\n convertTechniquesToPbr(gltf);\n convertMaterialsCommonToPbr(gltf);\n }\n\n return gltf;\n}\n\nfunction updateInstanceTechniques(gltf) {\n const materials = gltf.materials;\n for (const materialId in materials) {\n if (Object.prototype.hasOwnProperty.call(materials, materialId)) {\n const material = materials[materialId];\n const instanceTechnique = material.instanceTechnique;\n if (defined(instanceTechnique)) {\n material.technique = instanceTechnique.technique;\n material.values = instanceTechnique.values;\n delete material.instanceTechnique;\n }\n }\n }\n}\n\nfunction setPrimitiveModes(gltf) {\n const meshes = gltf.meshes;\n for (const meshId in meshes) {\n if (Object.prototype.hasOwnProperty.call(meshes, meshId)) {\n const mesh = meshes[meshId];\n const primitives = mesh.primitives;\n if (defined(primitives)) {\n const primitivesLength = primitives.length;\n for (let i = 0; i < primitivesLength; ++i) {\n const primitive = primitives[i];\n const defaultMode = defaultValue(\n primitive.primitive,\n WebGLConstants.TRIANGLES\n );\n primitive.mode = defaultValue(primitive.mode, defaultMode);\n delete primitive.primitive;\n }\n }\n }\n }\n}\n\nfunction updateNodes(gltf) {\n const nodes = gltf.nodes;\n const axis = new Cartesian3();\n const quat = new Quaternion();\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n const node = nodes[nodeId];\n if (defined(node.rotation)) {\n const rotation = node.rotation;\n Cartesian3.fromArray(rotation, 0, axis);\n Quaternion.fromAxisAngle(axis, rotation[3], quat);\n node.rotation = [quat.x, quat.y, quat.z, quat.w];\n }\n const instanceSkin = node.instanceSkin;\n if (defined(instanceSkin)) {\n node.skeletons = instanceSkin.skeletons;\n node.skin = instanceSkin.skin;\n node.meshes = instanceSkin.meshes;\n delete node.instanceSkin;\n }\n }\n }\n}\n\nfunction updateAnimations(gltf) {\n const animations = gltf.animations;\n const accessors = gltf.accessors;\n const bufferViews = gltf.bufferViews;\n const buffers = gltf.buffers;\n const updatedAccessors = {};\n const axis = new Cartesian3();\n const quat = new Quaternion();\n for (const animationId in animations) {\n if (Object.prototype.hasOwnProperty.call(animations, animationId)) {\n const animation = animations[animationId];\n const channels = animation.channels;\n const parameters = animation.parameters;\n const samplers = animation.samplers;\n if (defined(channels)) {\n const channelsLength = channels.length;\n for (let i = 0; i < channelsLength; ++i) {\n const channel = channels[i];\n if (channel.target.path === \"rotation\") {\n const accessorId = parameters[samplers[channel.sampler].output];\n if (defined(updatedAccessors[accessorId])) {\n continue;\n }\n updatedAccessors[accessorId] = true;\n const accessor = accessors[accessorId];\n const bufferView = bufferViews[accessor.bufferView];\n const buffer = buffers[bufferView.buffer];\n const source = buffer.extras._pipeline.source;\n const byteOffset =\n source.byteOffset + bufferView.byteOffset + accessor.byteOffset;\n const componentType = accessor.componentType;\n const count = accessor.count;\n const componentsLength = numberOfComponentsForType(accessor.type);\n const length = accessor.count * componentsLength;\n const typedArray = ComponentDatatype.createArrayBufferView(\n componentType,\n source.buffer,\n byteOffset,\n length\n );\n\n for (let j = 0; j < count; j++) {\n const offset = j * componentsLength;\n Cartesian3.unpack(typedArray, offset, axis);\n const angle = typedArray[offset + 3];\n Quaternion.fromAxisAngle(axis, angle, quat);\n Quaternion.pack(quat, typedArray, offset);\n }\n }\n }\n }\n }\n }\n}\n\nfunction removeTechniquePasses(gltf) {\n const techniques = gltf.techniques;\n for (const techniqueId in techniques) {\n if (Object.prototype.hasOwnProperty.call(techniques, techniqueId)) {\n const technique = techniques[techniqueId];\n const passes = technique.passes;\n if (defined(passes)) {\n const passName = defaultValue(technique.pass, \"defaultPass\");\n if (Object.prototype.hasOwnProperty.call(passes, passName)) {\n const pass = passes[passName];\n const instanceProgram = pass.instanceProgram;\n technique.attributes = defaultValue(\n technique.attributes,\n instanceProgram.attributes\n );\n technique.program = defaultValue(\n technique.program,\n instanceProgram.program\n );\n technique.uniforms = defaultValue(\n technique.uniforms,\n instanceProgram.uniforms\n );\n technique.states = defaultValue(technique.states, pass.states);\n }\n delete technique.passes;\n delete technique.pass;\n }\n }\n }\n}\n\nfunction glTF08to10(gltf) {\n if (!defined(gltf.asset)) {\n gltf.asset = {};\n }\n const asset = gltf.asset;\n asset.version = \"1.0\";\n // Profile should be an object, not a string\n if (typeof asset.profile === \"string\") {\n const split = asset.profile.split(\" \");\n asset.profile = {\n api: split[0],\n version: split[1],\n };\n } else {\n asset.profile = {};\n }\n\n // Version property should be in asset, not on the root element\n if (defined(gltf.version)) {\n delete gltf.version;\n }\n // material.instanceTechnique properties should be directly on the material\n updateInstanceTechniques(gltf);\n // primitive.primitive should be primitive.mode\n setPrimitiveModes(gltf);\n // Node rotation should be quaternion, not axis-angle\n // node.instanceSkin is deprecated\n updateNodes(gltf);\n // Animations that target rotations should be quaternion, not axis-angle\n updateAnimations(gltf);\n // technique.pass and techniques.passes are deprecated\n removeTechniquePasses(gltf);\n // gltf.allExtensions -> extensionsUsed\n if (defined(gltf.allExtensions)) {\n gltf.extensionsUsed = gltf.allExtensions;\n delete gltf.allExtensions;\n }\n // gltf.lights -> khrMaterialsCommon.lights\n if (defined(gltf.lights)) {\n const extensions = defaultValue(gltf.extensions, {});\n gltf.extensions = extensions;\n const materialsCommon = defaultValue(extensions.KHR_materials_common, {});\n extensions.KHR_materials_common = materialsCommon;\n materialsCommon.lights = gltf.lights;\n delete gltf.lights;\n addExtensionsUsed(gltf, \"KHR_materials_common\");\n }\n}\n\nfunction removeAnimationSamplersIndirection(gltf) {\n const animations = gltf.animations;\n for (const animationId in animations) {\n if (Object.prototype.hasOwnProperty.call(animations, animationId)) {\n const animation = animations[animationId];\n const parameters = animation.parameters;\n if (defined(parameters)) {\n const samplers = animation.samplers;\n for (const samplerId in samplers) {\n if (Object.prototype.hasOwnProperty.call(samplers, samplerId)) {\n const sampler = samplers[samplerId];\n sampler.input = parameters[sampler.input];\n sampler.output = parameters[sampler.output];\n }\n }\n delete animation.parameters;\n }\n }\n }\n}\n\nfunction objectToArray(object, mapping) {\n const array = [];\n for (const id in object) {\n if (Object.prototype.hasOwnProperty.call(object, id)) {\n const value = object[id];\n mapping[id] = array.length;\n array.push(value);\n if (!defined(value.name)) {\n value.name = id;\n }\n }\n }\n return array;\n}\n\nfunction objectsToArrays(gltf) {\n let i;\n const globalMapping = {\n accessors: {},\n animations: {},\n buffers: {},\n bufferViews: {},\n cameras: {},\n images: {},\n materials: {},\n meshes: {},\n nodes: {},\n programs: {},\n samplers: {},\n scenes: {},\n shaders: {},\n skins: {},\n textures: {},\n techniques: {},\n };\n\n // Map joint names to id names\n let jointName;\n const jointNameToId = {};\n const nodes = gltf.nodes;\n for (const id in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, id)) {\n jointName = nodes[id].jointName;\n if (defined(jointName)) {\n jointNameToId[jointName] = id;\n }\n }\n }\n\n // Convert top level objects to arrays\n for (const topLevelId in gltf) {\n if (\n Object.prototype.hasOwnProperty.call(gltf, topLevelId) &&\n defined(globalMapping[topLevelId])\n ) {\n const objectMapping = {};\n const object = gltf[topLevelId];\n gltf[topLevelId] = objectToArray(object, objectMapping);\n globalMapping[topLevelId] = objectMapping;\n }\n }\n\n // Remap joint names to array indexes\n for (jointName in jointNameToId) {\n if (Object.prototype.hasOwnProperty.call(jointNameToId, jointName)) {\n jointNameToId[jointName] = globalMapping.nodes[jointNameToId[jointName]];\n }\n }\n\n // Fix references\n if (defined(gltf.scene)) {\n gltf.scene = globalMapping.scenes[gltf.scene];\n }\n ForEach.bufferView(gltf, function (bufferView) {\n if (defined(bufferView.buffer)) {\n bufferView.buffer = globalMapping.buffers[bufferView.buffer];\n }\n });\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.bufferView)) {\n accessor.bufferView = globalMapping.bufferViews[accessor.bufferView];\n }\n });\n ForEach.shader(gltf, function (shader) {\n const extensions = shader.extensions;\n if (defined(extensions)) {\n const binaryGltf = extensions.KHR_binary_glTF;\n if (defined(binaryGltf)) {\n shader.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];\n delete extensions.KHR_binary_glTF;\n }\n if (Object.keys(extensions).length === 0) {\n delete shader.extensions;\n }\n }\n });\n ForEach.program(gltf, function (program) {\n if (defined(program.vertexShader)) {\n program.vertexShader = globalMapping.shaders[program.vertexShader];\n }\n if (defined(program.fragmentShader)) {\n program.fragmentShader = globalMapping.shaders[program.fragmentShader];\n }\n });\n ForEach.technique(gltf, function (technique) {\n if (defined(technique.program)) {\n technique.program = globalMapping.programs[technique.program];\n }\n ForEach.techniqueParameter(technique, function (parameter) {\n if (defined(parameter.node)) {\n parameter.node = globalMapping.nodes[parameter.node];\n }\n const value = parameter.value;\n if (typeof value === \"string\") {\n parameter.value = {\n index: globalMapping.textures[value],\n };\n }\n });\n });\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n if (defined(primitive.indices)) {\n primitive.indices = globalMapping.accessors[primitive.indices];\n }\n ForEach.meshPrimitiveAttribute(\n primitive,\n function (accessorId, semantic) {\n primitive.attributes[semantic] = globalMapping.accessors[accessorId];\n }\n );\n if (defined(primitive.material)) {\n primitive.material = globalMapping.materials[primitive.material];\n }\n });\n });\n ForEach.node(gltf, function (node) {\n let children = node.children;\n if (defined(children)) {\n const childrenLength = children.length;\n for (i = 0; i < childrenLength; ++i) {\n children[i] = globalMapping.nodes[children[i]];\n }\n }\n if (defined(node.meshes)) {\n // Split out meshes on nodes\n const meshes = node.meshes;\n const meshesLength = meshes.length;\n if (meshesLength > 0) {\n node.mesh = globalMapping.meshes[meshes[0]];\n for (i = 1; i < meshesLength; ++i) {\n const meshNode = {\n mesh: globalMapping.meshes[meshes[i]],\n };\n const meshNodeId = addToArray(gltf.nodes, meshNode);\n if (!defined(children)) {\n children = [];\n node.children = children;\n }\n children.push(meshNodeId);\n }\n }\n delete node.meshes;\n }\n if (defined(node.camera)) {\n node.camera = globalMapping.cameras[node.camera];\n }\n if (defined(node.skin)) {\n node.skin = globalMapping.skins[node.skin];\n }\n if (defined(node.skeletons)) {\n // Assign skeletons to skins\n const skeletons = node.skeletons;\n const skeletonsLength = skeletons.length;\n if (skeletonsLength > 0 && defined(node.skin)) {\n const skin = gltf.skins[node.skin];\n skin.skeleton = globalMapping.nodes[skeletons[0]];\n }\n delete node.skeletons;\n }\n if (defined(node.jointName)) {\n delete node.jointName;\n }\n });\n ForEach.skin(gltf, function (skin) {\n if (defined(skin.inverseBindMatrices)) {\n skin.inverseBindMatrices =\n globalMapping.accessors[skin.inverseBindMatrices];\n }\n const jointNames = skin.jointNames;\n if (defined(jointNames)) {\n const joints = [];\n const jointNamesLength = jointNames.length;\n for (i = 0; i < jointNamesLength; ++i) {\n joints[i] = jointNameToId[jointNames[i]];\n }\n skin.joints = joints;\n delete skin.jointNames;\n }\n });\n ForEach.scene(gltf, function (scene) {\n const sceneNodes = scene.nodes;\n if (defined(sceneNodes)) {\n const sceneNodesLength = sceneNodes.length;\n for (i = 0; i < sceneNodesLength; ++i) {\n sceneNodes[i] = globalMapping.nodes[sceneNodes[i]];\n }\n }\n });\n ForEach.animation(gltf, function (animation) {\n const samplerMapping = {};\n animation.samplers = objectToArray(animation.samplers, samplerMapping);\n ForEach.animationSampler(animation, function (sampler) {\n sampler.input = globalMapping.accessors[sampler.input];\n sampler.output = globalMapping.accessors[sampler.output];\n });\n ForEach.animationChannel(animation, function (channel) {\n channel.sampler = samplerMapping[channel.sampler];\n const target = channel.target;\n if (defined(target)) {\n target.node = globalMapping.nodes[target.id];\n delete target.id;\n }\n });\n });\n ForEach.material(gltf, function (material) {\n if (defined(material.technique)) {\n material.technique = globalMapping.techniques[material.technique];\n }\n ForEach.materialValue(material, function (value, name) {\n if (typeof value === \"string\") {\n material.values[name] = {\n index: globalMapping.textures[value],\n };\n }\n });\n const extensions = material.extensions;\n if (defined(extensions)) {\n const materialsCommon = extensions.KHR_materials_common;\n if (defined(materialsCommon) && defined(materialsCommon.values)) {\n ForEach.materialValue(materialsCommon, function (value, name) {\n if (typeof value === \"string\") {\n materialsCommon.values[name] = {\n index: globalMapping.textures[value],\n };\n }\n });\n }\n }\n });\n ForEach.image(gltf, function (image) {\n const extensions = image.extensions;\n if (defined(extensions)) {\n const binaryGltf = extensions.KHR_binary_glTF;\n if (defined(binaryGltf)) {\n image.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];\n image.mimeType = binaryGltf.mimeType;\n delete extensions.KHR_binary_glTF;\n }\n if (Object.keys(extensions).length === 0) {\n delete image.extensions;\n }\n }\n });\n ForEach.texture(gltf, function (texture) {\n if (defined(texture.sampler)) {\n texture.sampler = globalMapping.samplers[texture.sampler];\n }\n if (defined(texture.source)) {\n texture.source = globalMapping.images[texture.source];\n }\n });\n}\n\nfunction removeAnimationSamplerNames(gltf) {\n ForEach.animation(gltf, function (animation) {\n ForEach.animationSampler(animation, function (sampler) {\n delete sampler.name;\n });\n });\n}\n\nfunction removeEmptyArrays(gltf) {\n for (const topLevelId in gltf) {\n if (Object.prototype.hasOwnProperty.call(gltf, topLevelId)) {\n const array = gltf[topLevelId];\n if (Array.isArray(array) && array.length === 0) {\n delete gltf[topLevelId];\n }\n }\n }\n ForEach.node(gltf, function (node) {\n if (defined(node.children) && node.children.length === 0) {\n delete node.children;\n }\n });\n}\n\nfunction stripAsset(gltf) {\n const asset = gltf.asset;\n delete asset.profile;\n delete asset.premultipliedAlpha;\n}\n\nconst knownExtensions = {\n CESIUM_RTC: true,\n KHR_materials_common: true,\n WEB3D_quantized_attributes: true,\n};\nfunction requireKnownExtensions(gltf) {\n const extensionsUsed = gltf.extensionsUsed;\n gltf.extensionsRequired = defaultValue(gltf.extensionsRequired, []);\n if (defined(extensionsUsed)) {\n const extensionsUsedLength = extensionsUsed.length;\n for (let i = 0; i < extensionsUsedLength; ++i) {\n const extension = extensionsUsed[i];\n if (defined(knownExtensions[extension])) {\n gltf.extensionsRequired.push(extension);\n }\n }\n }\n}\n\nfunction removeBufferType(gltf) {\n ForEach.buffer(gltf, function (buffer) {\n delete buffer.type;\n });\n}\n\nfunction removeTextureProperties(gltf) {\n ForEach.texture(gltf, function (texture) {\n delete texture.format;\n delete texture.internalFormat;\n delete texture.target;\n delete texture.type;\n });\n}\n\nfunction requireAttributeSetIndex(gltf) {\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n ForEach.meshPrimitiveAttribute(\n primitive,\n function (accessorId, semantic) {\n if (semantic === \"TEXCOORD\") {\n primitive.attributes.TEXCOORD_0 = accessorId;\n } else if (semantic === \"COLOR\") {\n primitive.attributes.COLOR_0 = accessorId;\n }\n }\n );\n delete primitive.attributes.TEXCOORD;\n delete primitive.attributes.COLOR;\n });\n });\n ForEach.technique(gltf, function (technique) {\n ForEach.techniqueParameter(technique, function (parameter) {\n const semantic = parameter.semantic;\n if (defined(semantic)) {\n if (semantic === \"TEXCOORD\") {\n parameter.semantic = \"TEXCOORD_0\";\n } else if (semantic === \"COLOR\") {\n parameter.semantic = \"COLOR_0\";\n }\n }\n });\n });\n}\n\nconst knownSemantics = {\n POSITION: true,\n NORMAL: true,\n TANGENT: true,\n};\nconst indexedSemantics = {\n COLOR: \"COLOR\",\n JOINT: \"JOINTS\",\n JOINTS: \"JOINTS\",\n TEXCOORD: \"TEXCOORD\",\n WEIGHT: \"WEIGHTS\",\n WEIGHTS: \"WEIGHTS\",\n};\nfunction underscoreApplicationSpecificSemantics(gltf) {\n const mappedSemantics = {};\n ForEach.mesh(gltf, function (mesh) {\n ForEach.meshPrimitive(mesh, function (primitive) {\n /*eslint-disable no-unused-vars*/\n ForEach.meshPrimitiveAttribute(\n primitive,\n function (accessorId, semantic) {\n if (semantic.charAt(0) !== \"_\") {\n const setIndex = semantic.search(/_[0-9]+/g);\n let strippedSemantic = semantic;\n let suffix = \"_0\";\n if (setIndex >= 0) {\n strippedSemantic = semantic.substring(0, setIndex);\n suffix = semantic.substring(setIndex);\n }\n let newSemantic;\n const indexedSemantic = indexedSemantics[strippedSemantic];\n if (defined(indexedSemantic)) {\n newSemantic = indexedSemantic + suffix;\n mappedSemantics[semantic] = newSemantic;\n } else if (!defined(knownSemantics[strippedSemantic])) {\n newSemantic = `_${semantic}`;\n mappedSemantics[semantic] = newSemantic;\n }\n }\n }\n );\n for (const semantic in mappedSemantics) {\n if (Object.prototype.hasOwnProperty.call(mappedSemantics, semantic)) {\n const mappedSemantic = mappedSemantics[semantic];\n const accessorId = primitive.attributes[semantic];\n if (defined(accessorId)) {\n delete primitive.attributes[semantic];\n primitive.attributes[mappedSemantic] = accessorId;\n }\n }\n }\n });\n });\n ForEach.technique(gltf, function (technique) {\n ForEach.techniqueParameter(technique, function (parameter) {\n const mappedSemantic = mappedSemantics[parameter.semantic];\n if (defined(mappedSemantic)) {\n parameter.semantic = mappedSemantic;\n }\n });\n });\n}\n\nfunction clampCameraParameters(gltf) {\n ForEach.camera(gltf, function (camera) {\n const perspective = camera.perspective;\n if (defined(perspective)) {\n const aspectRatio = perspective.aspectRatio;\n if (defined(aspectRatio) && aspectRatio === 0.0) {\n delete perspective.aspectRatio;\n }\n const yfov = perspective.yfov;\n if (defined(yfov) && yfov === 0.0) {\n perspective.yfov = 1.0;\n }\n }\n });\n}\n\nfunction computeAccessorByteStride(gltf, accessor) {\n return defined(accessor.byteStride) && accessor.byteStride !== 0\n ? accessor.byteStride\n : getAccessorByteStride(gltf, accessor);\n}\n\nfunction requireByteLength(gltf) {\n ForEach.buffer(gltf, function (buffer) {\n if (!defined(buffer.byteLength)) {\n buffer.byteLength = buffer.extras._pipeline.source.length;\n }\n });\n ForEach.accessor(gltf, function (accessor) {\n const bufferViewId = accessor.bufferView;\n if (defined(bufferViewId)) {\n const bufferView = gltf.bufferViews[bufferViewId];\n const accessorByteStride = computeAccessorByteStride(gltf, accessor);\n const accessorByteEnd =\n accessor.byteOffset + accessor.count * accessorByteStride;\n bufferView.byteLength = Math.max(\n defaultValue(bufferView.byteLength, 0),\n accessorByteEnd\n );\n }\n });\n}\n\nfunction moveByteStrideToBufferView(gltf) {\n let i;\n let j;\n let bufferView;\n const bufferViews = gltf.bufferViews;\n\n const bufferViewHasVertexAttributes = {};\n ForEach.accessorContainingVertexAttributeData(gltf, function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n if (defined(accessor.bufferView)) {\n bufferViewHasVertexAttributes[accessor.bufferView] = true;\n }\n });\n\n // Map buffer views to a list of accessors\n const bufferViewMap = {};\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.bufferView)) {\n bufferViewMap[accessor.bufferView] = defaultValue(\n bufferViewMap[accessor.bufferView],\n []\n );\n bufferViewMap[accessor.bufferView].push(accessor);\n }\n });\n\n // Split accessors with different byte strides\n for (const bufferViewId in bufferViewMap) {\n if (Object.prototype.hasOwnProperty.call(bufferViewMap, bufferViewId)) {\n bufferView = bufferViews[bufferViewId];\n const accessors = bufferViewMap[bufferViewId];\n accessors.sort(function (a, b) {\n return a.byteOffset - b.byteOffset;\n });\n let currentByteOffset = 0;\n let currentIndex = 0;\n const accessorsLength = accessors.length;\n for (i = 0; i < accessorsLength; ++i) {\n let accessor = accessors[i];\n const accessorByteStride = computeAccessorByteStride(gltf, accessor);\n const accessorByteOffset = accessor.byteOffset;\n const accessorByteLength = accessor.count * accessorByteStride;\n delete accessor.byteStride;\n\n const hasNextAccessor = i < accessorsLength - 1;\n const nextAccessorByteStride = hasNextAccessor\n ? computeAccessorByteStride(gltf, accessors[i + 1])\n : undefined;\n if (accessorByteStride !== nextAccessorByteStride) {\n const newBufferView = clone(bufferView, true);\n if (bufferViewHasVertexAttributes[bufferViewId]) {\n newBufferView.byteStride = accessorByteStride;\n }\n newBufferView.byteOffset += currentByteOffset;\n newBufferView.byteLength =\n accessorByteOffset + accessorByteLength - currentByteOffset;\n const newBufferViewId = addToArray(bufferViews, newBufferView);\n for (j = currentIndex; j <= i; ++j) {\n accessor = accessors[j];\n accessor.bufferView = newBufferViewId;\n accessor.byteOffset = accessor.byteOffset - currentByteOffset;\n }\n // Set current byte offset to next accessor's byte offset\n currentByteOffset = hasNextAccessor\n ? accessors[i + 1].byteOffset\n : undefined;\n currentIndex = i + 1;\n }\n }\n }\n }\n\n // Remove unused buffer views\n removeUnusedElements(gltf, [\"accessor\", \"bufferView\", \"buffer\"]);\n}\n\nfunction requirePositionAccessorMinMax(gltf) {\n ForEach.accessorWithSemantic(gltf, \"POSITION\", function (accessorId) {\n const accessor = gltf.accessors[accessorId];\n if (!defined(accessor.min) || !defined(accessor.max)) {\n const minMax = findAccessorMinMax(gltf, accessor);\n accessor.min = minMax.min;\n accessor.max = minMax.max;\n }\n });\n}\n\nfunction isNodeEmpty(node) {\n return (\n (!defined(node.children) || node.children.length === 0) &&\n (!defined(node.meshes) || node.meshes.length === 0) &&\n !defined(node.camera) &&\n !defined(node.skin) &&\n !defined(node.skeletons) &&\n !defined(node.jointName) &&\n (!defined(node.translation) ||\n Cartesian3.fromArray(node.translation).equals(Cartesian3.ZERO)) &&\n (!defined(node.scale) ||\n Cartesian3.fromArray(node.scale).equals(new Cartesian3(1.0, 1.0, 1.0))) &&\n (!defined(node.rotation) ||\n Cartesian4.fromArray(node.rotation).equals(\n new Cartesian4(0.0, 0.0, 0.0, 1.0)\n )) &&\n (!defined(node.matrix) ||\n Matrix4.fromColumnMajorArray(node.matrix).equals(Matrix4.IDENTITY)) &&\n !defined(node.extensions) &&\n !defined(node.extras)\n );\n}\n\nfunction deleteNode(gltf, nodeId) {\n // Remove from list of nodes in scene\n ForEach.scene(gltf, function (scene) {\n const sceneNodes = scene.nodes;\n if (defined(sceneNodes)) {\n const sceneNodesLength = sceneNodes.length;\n for (let i = sceneNodesLength; i >= 0; --i) {\n if (sceneNodes[i] === nodeId) {\n sceneNodes.splice(i, 1);\n return;\n }\n }\n }\n });\n\n // Remove parent node's reference to this node, and delete the parent if also empty\n ForEach.node(gltf, function (parentNode, parentNodeId) {\n if (defined(parentNode.children)) {\n const index = parentNode.children.indexOf(nodeId);\n if (index > -1) {\n parentNode.children.splice(index, 1);\n\n if (isNodeEmpty(parentNode)) {\n deleteNode(gltf, parentNodeId);\n }\n }\n }\n });\n\n delete gltf.nodes[nodeId];\n}\n\nfunction removeEmptyNodes(gltf) {\n ForEach.node(gltf, function (node, nodeId) {\n if (isNodeEmpty(node)) {\n deleteNode(gltf, nodeId);\n }\n });\n\n return gltf;\n}\n\nfunction requireAnimationAccessorMinMax(gltf) {\n ForEach.animation(gltf, function (animation) {\n ForEach.animationSampler(animation, function (sampler) {\n const accessor = gltf.accessors[sampler.input];\n if (!defined(accessor.min) || !defined(accessor.max)) {\n const minMax = findAccessorMinMax(gltf, accessor);\n accessor.min = minMax.min;\n accessor.max = minMax.max;\n }\n });\n });\n}\n\nfunction validatePresentAccessorMinMax(gltf) {\n ForEach.accessor(gltf, function (accessor) {\n if (defined(accessor.min) || defined(accessor.max)) {\n const minMax = findAccessorMinMax(gltf, accessor);\n if (defined(accessor.min)) {\n accessor.min = minMax.min;\n }\n if (defined(accessor.max)) {\n accessor.max = minMax.max;\n }\n }\n });\n}\n\nfunction glTF10to20(gltf) {\n gltf.asset = defaultValue(gltf.asset, {});\n gltf.asset.version = \"2.0\";\n // material.instanceTechnique properties should be directly on the material. instanceTechnique is a gltf 0.8 property but is seen in some 1.0 models.\n updateInstanceTechniques(gltf);\n // animation.samplers now refers directly to accessors and animation.parameters should be removed\n removeAnimationSamplersIndirection(gltf);\n // Remove empty nodes and re-assign referencing indices\n removeEmptyNodes(gltf);\n // Top-level objects are now arrays referenced by index instead of id\n objectsToArrays(gltf);\n // Animation.sampler objects cannot have names\n removeAnimationSamplerNames(gltf);\n // asset.profile no longer exists\n stripAsset(gltf);\n // Move known extensions from extensionsUsed to extensionsRequired\n requireKnownExtensions(gltf);\n // bufferView.byteLength and buffer.byteLength are required\n requireByteLength(gltf);\n // byteStride moved from accessor to bufferView\n moveByteStrideToBufferView(gltf);\n // accessor.min and accessor.max must be defined for accessors containing POSITION attributes\n requirePositionAccessorMinMax(gltf);\n // An animation sampler's input accessor must have min and max properties defined\n requireAnimationAccessorMinMax(gltf);\n // When an acccessor has a min- or max, then it is recomputed, to capture the actual\n // value, and not use the (possibly imprecise) value from the input\n validatePresentAccessorMinMax(gltf);\n // buffer.type is unnecessary and should be removed\n removeBufferType(gltf);\n // Remove format, internalFormat, target, and type\n removeTextureProperties(gltf);\n // TEXCOORD and COLOR attributes must be written with a set index (TEXCOORD_#)\n requireAttributeSetIndex(gltf);\n // Add underscores to application-specific parameters\n underscoreApplicationSpecificSemantics(gltf);\n // Accessors referenced by JOINTS_0 and WEIGHTS_0 attributes must have correct component types\n updateAccessorComponentTypes(gltf);\n // Clamp camera parameters\n clampCameraParameters(gltf);\n // Move legacy technique render states to material properties and add KHR_blend extension blending functions\n moveTechniqueRenderStates(gltf);\n // Add material techniques to KHR_techniques_webgl extension, removing shaders, programs, and techniques\n moveTechniquesToExtension(gltf);\n // Remove empty arrays\n removeEmptyArrays(gltf);\n}\n\n// It's not possible to upgrade glTF 1.0 shaders to 2.0 PBR materials in a generic way,\n// but we can look for certain uniform names that are commonly found in glTF 1.0 assets\n// and create PBR materials out of those.\nconst baseColorTextureNames = [\"u_tex\", \"u_diffuse\", \"u_emission\"];\nconst baseColorFactorNames = [\"u_diffuse\"];\n\nfunction initializePbrMaterial(material) {\n material.pbrMetallicRoughness = defined(material.pbrMetallicRoughness)\n ? material.pbrMetallicRoughness\n : {};\n\n material.pbrMetallicRoughness.roughnessFactor = 1.0;\n material.pbrMetallicRoughness.metallicFactor = 0.0;\n}\n\nfunction isTexture(value) {\n return defined(value.index);\n}\n\nfunction isVec4(value) {\n return Array.isArray(value) && value.length === 4;\n}\n\nfunction srgbToLinear(srgb) {\n const linear = new Array(4);\n linear[3] = srgb[3];\n\n for (let i = 0; i < 3; i++) {\n const c = srgb[i];\n if (c <= 0.04045) {\n // eslint-disable-next-line no-loss-of-precision\n linear[i] = srgb[i] * 0.07739938080495356037151702786378;\n } else {\n linear[i] = Math.pow(\n // eslint-disable-next-line no-loss-of-precision\n (c + 0.055) * 0.94786729857819905213270142180095,\n 2.4\n );\n }\n }\n\n return linear;\n}\n\nfunction convertTechniquesToPbr(gltf) {\n // Future work: convert other values like emissive, specular, etc. Only handling diffuse right now.\n ForEach.material(gltf, function (material) {\n ForEach.materialValue(material, function (value, name) {\n if (baseColorTextureNames.indexOf(name) !== -1 && isTexture(value)) {\n initializePbrMaterial(material);\n material.pbrMetallicRoughness.baseColorTexture = value;\n } else if (baseColorFactorNames.indexOf(name) !== -1 && isVec4(value)) {\n initializePbrMaterial(material);\n material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(value);\n }\n });\n });\n\n removeExtension(gltf, \"KHR_techniques_webgl\");\n removeExtension(gltf, \"KHR_blend\");\n}\n\nfunction convertMaterialsCommonToPbr(gltf) {\n // Future work: convert KHR_materials_common lights to KHR_lights_punctual\n ForEach.material(gltf, function (material) {\n const materialsCommon = defaultValue(\n material.extensions,\n defaultValue.EMPTY_OBJECT\n ).KHR_materials_common;\n\n if (defined(materialsCommon)) {\n const technique = materialsCommon.technique;\n if (technique === \"CONSTANT\") {\n // Add the KHR_materials_unlit extension\n addExtensionsUsed(gltf, \"KHR_materials_unlit\");\n material.extensions = defined(material.extensions)\n ? material.extensions\n : {};\n material.extensions[\"KHR_materials_unlit\"] = {};\n }\n\n const values = defined(materialsCommon.values)\n ? materialsCommon.values\n : {};\n\n const ambient = values.ambient;\n const diffuse = values.diffuse;\n const emission = values.emission;\n const transparency = values.transparency;\n\n // These actually exist on the extension object, not the values object despite what's shown in the spec\n const doubleSided = materialsCommon.doubleSided;\n const transparent = materialsCommon.transparent;\n\n // Ignore specular and shininess for now because the conversion to PBR\n // isn't straightforward and depends on the technique\n initializePbrMaterial(material);\n\n if (defined(ambient)) {\n if (isVec4(ambient)) {\n material.emissiveFactor = ambient.slice(0, 3);\n } else if (isTexture(ambient)) {\n material.emissiveTexture = ambient;\n }\n }\n\n if (defined(diffuse)) {\n if (isVec4(diffuse)) {\n material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(diffuse);\n } else if (isTexture(diffuse)) {\n material.pbrMetallicRoughness.baseColorTexture = diffuse;\n }\n }\n\n if (defined(doubleSided)) {\n material.doubleSided = doubleSided;\n }\n\n if (defined(emission)) {\n if (isVec4(emission)) {\n material.emissiveFactor = emission.slice(0, 3);\n } else if (isTexture(emission)) {\n material.emissiveTexture = emission;\n }\n }\n\n if (defined(transparency)) {\n if (defined(material.pbrMetallicRoughness.baseColorFactor)) {\n material.pbrMetallicRoughness.baseColorFactor[3] *= transparency;\n } else {\n material.pbrMetallicRoughness.baseColorFactor = [\n 1,\n 1,\n 1,\n transparency,\n ];\n }\n }\n\n if (defined(transparent)) {\n material.alphaMode = transparent ? \"BLEND\" : \"OPAQUE\";\n }\n }\n });\n\n removeExtension(gltf, \"KHR_materials_common\");\n}\n\nexport default updateVersion;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport isDataUri from \"../Core/isDataUri.js\";\nimport Resource from \"../Core/Resource.js\";\nimport addDefaults from \"./GltfPipeline/addDefaults.js\";\nimport addPipelineExtras from \"./GltfPipeline/addPipelineExtras.js\";\nimport ForEach from \"./GltfPipeline/ForEach.js\";\nimport parseGlb from \"./GltfPipeline/parseGlb.js\";\nimport removePipelineExtras from \"./GltfPipeline/removePipelineExtras.js\";\nimport updateVersion from \"./GltfPipeline/updateVersion.js\";\nimport usesExtension from \"./GltfPipeline/usesExtension.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a glTF JSON from a glTF or glb.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfJsonLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents.\n * @param {Object} [options.gltfJson] The parsed glTF JSON contents.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @private\n */\nfunction GltfJsonLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const typedArray = options.typedArray;\n const gltfJson = options.gltfJson;\n const cacheKey = options.cacheKey;\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._typedArray = typedArray;\n this._gltfJson = gltfJson;\n this._cacheKey = cacheKey;\n this._gltf = undefined;\n this._bufferLoaders = [];\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n GltfJsonLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfJsonLoader.prototype.constructor = GltfJsonLoader;\n}\n\nObject.defineProperties(GltfJsonLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfJsonLoader.prototype\n *\n * @type {Promise.<GltfJsonLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfJsonLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The glTF JSON.\n *\n * @memberof GltfJsonLoader.prototype\n *\n * @type {Object}\n * @readonly\n * @private\n */\n gltf: {\n get: function () {\n return this._gltf;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfJsonLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfJsonLoader.prototype.load = function () {\n this._state = ResourceLoaderState.LOADING;\n\n let processPromise;\n if (defined(this._gltfJson)) {\n processPromise = processGltfJson(this, this._gltfJson);\n } else if (defined(this._typedArray)) {\n processPromise = processGltfTypedArray(this, this._typedArray);\n } else {\n processPromise = loadFromUri(this);\n }\n\n const that = this;\n this._promise = processPromise\n .then(function (gltf) {\n if (that.isDestroyed()) {\n return;\n }\n that._gltf = gltf;\n that._state = ResourceLoaderState.READY;\n return that;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction loadFromUri(gltfJsonLoader) {\n return gltfJsonLoader._fetchGltf().then(function (arrayBuffer) {\n if (gltfJsonLoader.isDestroyed()) {\n return;\n }\n const typedArray = new Uint8Array(arrayBuffer);\n return processGltfTypedArray(gltfJsonLoader, typedArray);\n });\n}\n\nfunction handleError(gltfJsonLoader, error) {\n gltfJsonLoader.unload();\n gltfJsonLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = `Failed to load glTF: ${gltfJsonLoader._gltfResource.url}`;\n return Promise.reject(gltfJsonLoader.getError(errorMessage, error));\n}\n\nfunction upgradeVersion(gltfJsonLoader, gltf) {\n if (\n defined(gltf.asset) &&\n gltf.asset.version === \"2.0\" &&\n !usesExtension(gltf, \"KHR_techniques_webgl\") &&\n !usesExtension(gltf, \"KHR_materials_common\")\n ) {\n return Promise.resolve();\n }\n\n // Load all buffers into memory. updateVersion will read and in some cases modify\n // the buffer data, which it accesses from buffer.extras._pipeline.source\n const promises = [];\n ForEach.buffer(gltf, function (buffer) {\n if (\n !defined(buffer.extras._pipeline.source) && // Ignore uri if this buffer uses the glTF 1.0 KHR_binary_glTF extension\n defined(buffer.uri)\n ) {\n const resource = gltfJsonLoader._baseResource.getDerivedResource({\n url: buffer.uri,\n });\n const resourceCache = gltfJsonLoader._resourceCache;\n const bufferLoader = resourceCache.loadExternalBuffer({\n resource: resource,\n });\n\n gltfJsonLoader._bufferLoaders.push(bufferLoader);\n\n promises.push(\n bufferLoader.promise.then(function (bufferLoader) {\n buffer.extras._pipeline.source = bufferLoader.typedArray;\n })\n );\n }\n });\n\n return Promise.all(promises).then(function () {\n updateVersion(gltf);\n });\n}\n\nfunction decodeDataUris(gltf) {\n const promises = [];\n ForEach.buffer(gltf, function (buffer) {\n const bufferUri = buffer.uri;\n if (\n !defined(buffer.extras._pipeline.source) && // Ignore uri if this buffer uses the glTF 1.0 KHR_binary_glTF extension\n defined(bufferUri) &&\n isDataUri(bufferUri)\n ) {\n delete buffer.uri; // Delete the data URI to keep the cached glTF JSON small\n promises.push(\n Resource.fetchArrayBuffer(bufferUri).then(function (arrayBuffer) {\n buffer.extras._pipeline.source = new Uint8Array(arrayBuffer);\n })\n );\n }\n });\n return Promise.all(promises);\n}\n\nfunction loadEmbeddedBuffers(gltfJsonLoader, gltf) {\n const promises = [];\n ForEach.buffer(gltf, function (buffer, bufferId) {\n const source = buffer.extras._pipeline.source;\n if (defined(source) && !defined(buffer.uri)) {\n const resourceCache = gltfJsonLoader._resourceCache;\n const bufferLoader = resourceCache.loadEmbeddedBuffer({\n parentResource: gltfJsonLoader._gltfResource,\n bufferId: bufferId,\n typedArray: source,\n });\n\n gltfJsonLoader._bufferLoaders.push(bufferLoader);\n promises.push(bufferLoader.promise);\n }\n });\n return Promise.all(promises);\n}\n\nfunction processGltfJson(gltfJsonLoader, gltf) {\n addPipelineExtras(gltf);\n\n return decodeDataUris(gltf)\n .then(function () {\n return upgradeVersion(gltfJsonLoader, gltf);\n })\n .then(function () {\n addDefaults(gltf);\n return loadEmbeddedBuffers(gltfJsonLoader, gltf);\n })\n .then(function () {\n removePipelineExtras(gltf);\n return gltf;\n });\n}\n\nfunction processGltfTypedArray(gltfJsonLoader, typedArray) {\n let gltf;\n if (getMagic(typedArray) === \"glTF\") {\n gltf = parseGlb(typedArray);\n } else {\n gltf = getJsonFromTypedArray(typedArray);\n }\n\n return processGltfJson(gltfJsonLoader, gltf);\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfJsonLoader.prototype.unload = function () {\n const bufferLoaders = this._bufferLoaders;\n const bufferLoadersLength = bufferLoaders.length;\n for (let i = 0; i < bufferLoadersLength; ++i) {\n this._resourceCache.unload(bufferLoaders[i]);\n }\n this._bufferLoaders.length = 0;\n\n this._gltf = undefined;\n};\n\n/**\n * Exposed for testing\n *\n * @private\n */\nGltfJsonLoader.prototype._fetchGltf = function () {\n return this._gltfResource.fetchArrayBuffer();\n};\n\nexport default GltfJsonLoader;\n", "/**\n * The alpha rendering mode of the material.\n *\n * @enum {String}\n * @private\n */\nconst AlphaMode = {\n /**\n * The alpha value is ignored and the rendered output is fully opaque.\n *\n * @type {String}\n * @constant\n */\n OPAQUE: \"OPAQUE\",\n\n /**\n * The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value.\n *\n * @type {String}\n * @constant\n */\n MASK: \"MASK\",\n\n /**\n * The rendered output is composited onto the destination with alpha blending.\n *\n * @type {String}\n * @constant\n */\n BLEND: \"BLEND\",\n};\n\nexport default Object.freeze(AlphaMode);\n", "import AlphaMode from \"./AlphaMode.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\n\n/**\n * Components for building models.\n *\n * @namespace ModelComponents\n *\n * @private\n */\nconst ModelComponents = {};\n\n/**\n * Information about the quantized attribute.\n *\n * @alias ModelComponents.Quantization\n * @constructor\n *\n * @private\n */\nfunction Quantization() {\n /**\n * Whether the quantized attribute is oct-encoded.\n *\n * @type {Boolean}\n * @private\n */\n this.octEncoded = false;\n\n /**\n * Whether the oct-encoded values are stored as ZXY instead of XYZ. This is true when decoding from Draco.\n *\n * @type {Boolean}\n * @private\n */\n this.octEncodedZXY = false;\n\n /**\n * The range used to convert buffer values to normalized values [0.0, 1.0]\n * This is typically computed as (1 << quantizationBits) - 1.\n * For oct-encoded values this value is a single Number.\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.normalizationRange = undefined;\n\n /**\n * The bottom-left corner of the quantization volume. Not applicable for oct encoded attributes.\n * The type should match the attribute type - e.g. if the attribute type\n * is AttributeType.VEC4 the offset should be a Cartesian4.\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.quantizedVolumeOffset = undefined;\n\n /**\n * The dimensions of the quantization volume. Not applicable for oct encoded attributes.\n * The type should match the attribute type - e.g. if the attribute type\n * is AttributeType.VEC4 the dimensions should be a Cartesian4.\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.quantizedVolumeDimensions = undefined;\n\n /**\n * The step size of the quantization volume, equal to\n * quantizedVolumeDimensions / normalizationRange (component-wise).\n * Not applicable for oct encoded attributes.\n * The type should match the attribute type - e.g. if the attribute type\n * is AttributeType.VEC4 the dimensions should be a Cartesian4.\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.quantizedVolumeStepSize = undefined;\n\n /**\n * The component data type of the quantized attribute, e.g. ComponentDatatype.UNSIGNED_SHORT.\n *\n * <p>\n * The following component datatypes are not supported:\n * <ul>\n * <li>ComponentDatatype.INT</li>\n * <li>ComponentDatatype.UNSIGNED_INT</li>\n * <li>ComponentDatatype.DOUBLE</li>\n * </ul>\n * </p>\n *\n * @type {ComponentDatatype}\n * @private\n */\n this.componentDatatype = undefined;\n\n /**\n * The type of the quantized attribute, e.g. AttributeType.VEC2 for oct-encoded normals.\n *\n * @type {AttributeType}\n * @private\n */\n this.type = undefined;\n}\n\n/**\n * A per-vertex or per-instance attribute.\n *\n * @alias ModelComponents.Attribute\n * @constructor\n *\n * @private\n */\nfunction Attribute() {\n /**\n * The attribute name. Must be unique within the attributes array.\n *\n * @type {String}\n * @private\n */\n this.name = undefined;\n\n /**\n * The attribute semantic. The combination of semantic and setIndex must be\n * unique within the attributes array.\n *\n * @type {VertexAttributeSemantic|InstanceAttributeSemantic}\n * @private\n */\n this.semantic = undefined;\n\n /**\n * The set index of the attribute. Only applicable when the attribute has one\n * of the following semantics:\n *\n * <ul>\n * <li>{@link VertexAttributeSemantic.TEXCOORD}</li>\n * <li>{@link VertexAttributeSemantic.COLOR}</li>\n * <li>{@link VertexAttributeSemantic.JOINTS}</li>\n * <li>{@link VertexAttributeSemantic.WEIGHTS}</li>\n * <li>{@link VertexAttributeSemantic.FEATURE_ID}</li>\n * <li>{@link InstanceAttributeSemantic.FEATURE_ID}</li>\n * </ul>\n */\n this.setIndex = undefined;\n\n /**\n * The component data type of the attribute.\n * <p>\n * When the data is quantized the componentDatatype should match the\n * dequantized data, which is typically ComponentDatatype.FLOAT.\n * </p>\n * <p>\n * The following component datatypes are not supported:\n * <ul>\n * <li>ComponentDatatype.INT</li>\n * <li>ComponentDatatype.UNSIGNED_INT</li>\n * <li>ComponentDatatype.DOUBLE</li>\n * </ul>\n * </p>\n *\n * @type {ComponentDatatype}\n * @private\n */\n this.componentDatatype = undefined;\n\n /**\n * The type of the attribute.\n * <p>\n * When the data is oct-encoded the type should match the decoded data, which\n * is typically AttributeType.VEC3.\n * </p>\n *\n * @type {AttributeType}\n * @private\n */\n this.type = undefined;\n\n /**\n * Whether the attribute is normalized.\n *\n * @type {Boolean}\n * @default false\n * @private\n */\n this.normalized = false;\n\n /**\n * The number of elements.\n *\n * @type {Number}\n * @private\n */\n this.count = undefined;\n\n /**\n * Minimum value of each component in the attribute.\n * <p>\n * When the data is quantized the min should match the dequantized data.\n * The normalized property has no effect on these values.\n * </p>\n * <p>\n * Must be defined for POSITION attributes.\n * </p>\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.min = undefined;\n\n /**\n * Maximum value of each component in the attribute.\n * <p>\n * When the data is quantized the max should match the dequantized data.\n * The normalized property has no effect on these values.\n * </p>\n * <p>\n * Must be defined for POSITION attributes.\n * </p>\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.max = undefined;\n\n /**\n * A constant value used for all elements when typed array and buffer are undefined.\n *\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @private\n */\n this.constant = undefined;\n\n /**\n * Information about the quantized attribute.\n *\n * @type {ModelComponents.Quantization}\n * @private\n */\n this.quantization = undefined;\n\n /**\n * A typed array containing tightly-packed attribute values, as they appear\n * in the model file.\n *\n * @type {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array}\n * @private\n */\n this.typedArray = undefined;\n\n /**\n * A vertex buffer. Attribute values are accessed using byteOffset and byteStride.\n *\n * @type {Buffer}\n * @private\n */\n this.buffer = undefined;\n\n /**\n * The byte offset of elements in the buffer.\n *\n * @type {Number}\n * @default 0\n * @private\n */\n this.byteOffset = 0;\n\n /**\n * The byte stride of elements in the buffer. When undefined the elements are tightly packed.\n *\n * @type {Number}\n * @private\n */\n this.byteStride = undefined;\n}\n\n/**\n * Indices used to select vertices for rendering.\n *\n * @alias ModelComponents.Indices\n * @constructor\n *\n * @private\n */\nfunction Indices() {\n /**\n * The index data type of the attribute, e.g. IndexDatatype.UNSIGNED_SHORT.\n *\n * @type {IndexDatatype}\n * @private\n */\n this.indexDatatype = undefined;\n\n /**\n * The number of indices.\n *\n * @type {Number}\n * @private\n */\n this.count = undefined;\n\n /**\n * An index buffer containing indices.\n *\n * @type {Buffer}\n * @private\n */\n this.buffer = undefined;\n\n /**\n * A typed array containing indices.\n *\n * @type {Uint8Array|Uint16Array|Uint32Array}\n * @private\n */\n this.typedArray = undefined;\n}\n\n/**\n * Maps per-vertex or per-instance feature IDs to a property table. Feature\n * IDs are stored in an accessor.\n *\n * @alias ModelComponents.FeatureIdAttribute\n * @constructor\n *\n * @private\n */\nfunction FeatureIdAttribute() {\n /**\n * How many unique features are defined in this set of feature IDs\n *\n * @type {Number}\n * @private\n */\n this.featureCount = undefined;\n\n /**\n * This value indicates that no feature is indicated with this vertex\n *\n * @type {Number}\n * @private\n */\n this.nullFeatureId = undefined;\n\n /**\n * The ID of the property table that feature IDs index into. If undefined,\n * feature IDs are used for classification, but no metadata is associated.\n *\n *\n * @type {Number}\n * @private\n */\n this.propertyTableId = undefined;\n\n /**\n * The set index of feature ID attribute containing feature IDs.\n *\n * @type {Number}\n * @private\n */\n this.setIndex = undefined;\n\n /**\n * The label to identify this set of feature IDs. This is used in picking,\n * styling and shaders.\n *\n * @type {String}\n * @private\n */\n this.label = undefined;\n\n /**\n * Label to identify this set of feature IDs by its position in the array.\n * This will always be either \"featureId_N\" for primitives or\n * \"instanceFeatureId_N\" for instances.\n *\n * @type {String}\n * @private\n */\n this.positionalLabel = undefined;\n}\n\n/**\n * Defines a range of implicitly-defined feature IDs, one for each vertex or\n * instance. Such feature IDs may optionally be associated with a property table\n * storing metadata\n *\n * @alias ModelComponents.FeatureIdImplicitRange\n * @constructor\n *\n * @private\n */\nfunction FeatureIdImplicitRange() {\n /**\n * How many unique features are defined in this set of feature IDs\n *\n * @type {Number}\n * @private\n */\n this.featureCount = undefined;\n\n /**\n * This value indicates that no feature is indicated with this vertex\n *\n * @type {Number}\n * @private\n */\n this.nullFeatureId = undefined;\n\n /**\n * The ID of the property table that feature IDs index into. If undefined,\n * feature IDs are used for classification, but no metadata is associated.\n *\n * @type {Number}\n * @private\n */\n this.propertyTableId = undefined;\n\n /**\n * The first feature ID to use when setIndex is undefined\n *\n * @type {Number}\n * @default 0\n * @private\n */\n this.offset = 0;\n\n /**\n * Number of times each feature ID is repeated before being incremented.\n *\n * @type {Number}\n * @private\n */\n this.repeat = undefined;\n\n /**\n * The label to identify this set of feature IDs. This is used in picking,\n * styling and shaders.\n *\n * @type {String}\n * @private\n */\n this.label = undefined;\n\n /**\n * Label to identify this set of feature IDs by its position in the array.\n * This will always be either \"featureId_N\" for primitives or\n * \"instanceFeatureId_N\" for instances.\n *\n * @type {String}\n * @private\n */\n this.positionalLabel = undefined;\n}\n\n/**\n * A texture that contains per-texel feature IDs that index into a property table.\n *\n * @alias ModelComponents.FeatureIdTexture\n * @constructor\n *\n * @private\n */\nfunction FeatureIdTexture() {\n /**\n * How many unique features are defined in this set of feature IDs\n *\n * @type {Number}\n * @private\n */\n this.featureCount = undefined;\n\n /**\n * This value indicates that no feature is indicated with this texel\n *\n * @type {Number}\n * @private\n */\n this.nullFeatureId = undefined;\n\n /**\n * The ID of the property table that feature IDs index into. If undefined,\n * feature IDs are used for classification, but no metadata is associated.\n *\n * @type {String}\n * @private\n */\n this.propertyTableId = undefined;\n\n /**\n * The texture reader containing feature IDs.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.textureReader = undefined;\n\n /**\n * The label to identify this set of feature IDs. This is used in picking,\n * styling and shaders.\n *\n * @type {String}\n * @private\n */\n this.label = undefined;\n\n /**\n * Label to identify this set of feature IDs by its position in the array.\n * This will always be either \"featureId_N\" for primitives or\n * \"instanceFeatureId_N\" for instances.\n *\n * @type {String}\n * @private\n */\n this.positionalLabel = undefined;\n}\n\n/**\n * A morph target where each attribute contains attribute displacement data.\n *\n * @alias ModelComponents.MorphTarget\n * @constructor\n *\n * @private\n */\nfunction MorphTarget() {\n /**\n * Attributes that are part of the morph target, e.g. positions, normals, and tangents.\n *\n * @type {ModelComponents.Attribute[]}\n * @private\n */\n this.attributes = [];\n}\n\n/**\n * Geometry to be rendered with a material.\n *\n * @alias ModelComponents.Primitive\n * @constructor\n *\n * @private\n */\nfunction Primitive() {\n /**\n * The vertex attributes, e.g. positions, normals, etc.\n *\n * @type {ModelComponents.Attribute[]}\n * @private\n */\n this.attributes = [];\n\n /**\n * The morph targets.\n *\n * @type {ModelComponents.MorphTarget[]}\n * @private\n */\n this.morphTargets = [];\n\n /**\n * The indices.\n *\n * @type {ModelComponents.Indices}\n * @private\n */\n this.indices = undefined;\n\n /**\n * The material.\n *\n * @type {ModelComponents.Material}\n * @private\n */\n this.material = undefined;\n\n /**\n * The primitive type, e.g. PrimitiveType.TRIANGLES.\n *\n * @type {PrimitiveType}\n * @private\n */\n this.primitiveType = undefined;\n\n /**\n * The feature IDs associated with this primitive. Feature ID types may\n * be interleaved\n *\n * @type {Array.<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture>}\n * @private\n */\n this.featureIds = [];\n\n /**\n * The property texture IDs. These indices correspond to the array of\n * property textures.\n *\n * @type {Number[]}\n * @private\n */\n this.propertyTextureIds = [];\n\n /**\n * The property attribute IDs. These indices correspond to the array of\n * property attributes in the EXT_structural_metadata extension.\n *\n * @type {Number[]}\n * @private\n */\n this.propertyAttributeIds = [];\n\n /**\n * If the CESIUM_primitive_outline glTF extension is used, this property\n * stores an additional attribute storing outline coordinates.\n *\n * @type {Attribute}\n * @private\n */\n this.outlineCoordinates = undefined;\n}\n\n/**\n * Position and metadata information for instances of a node.\n *\n * @alias ModelComponents.Instances\n * @constructor\n *\n * @private\n */\nfunction Instances() {\n /**\n * The instance attributes, e.g. translation, rotation, scale, feature id, etc.\n *\n * @type {ModelComponents.Attribute[]}\n * @private\n */\n this.attributes = [];\n\n /**\n * The feature ID attributes associated with this set of instances.\n * Feature ID attribute types may be interleaved.\n *\n * @type {Array.<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange>}\n * @private\n */\n this.featureIds = [];\n\n /**\n * Whether the instancing transforms are applied in world space. For glTF models that\n * use EXT_mesh_gpu_instancing, the transform is applied in object space. For i3dm files,\n * the instance transform is in world space.\n *\n * @type {Boolean}\n * @private\n */\n this.transformInWorldSpace = false;\n}\n\n/**\n * Joints and matrices defining a skin.\n *\n * @alias ModelComponents.Skin\n * @constructor\n *\n * @private\n */\nfunction Skin() {\n /**\n * The index of the skin in the glTF. This is useful for finding the skin\n * that applies to a node after the skin is instantiated at runtime.\n *\n * @type {Number}\n * @private\n */\n this.index = undefined;\n\n /**\n * The joints.\n *\n * @type {ModelComponents.Node[]}\n * @private\n */\n this.joints = [];\n\n /**\n * The inverse bind matrices of the joints.\n *\n * @type {Matrix4[]}\n * @private\n */\n this.inverseBindMatrices = [];\n}\n\n/**\n * A node in the node hierarchy.\n *\n * @alias ModelComponents.Node\n * @constructor\n *\n * @private\n */\nfunction Node() {\n /**\n * The name of the node.\n *\n * @type {String}\n * @private\n */\n this.name = undefined;\n\n /**\n * The index of the node in the glTF. This is useful for finding the nodes\n * that belong to a skin after they have been instantiated at runtime.\n *\n * @type {Number}\n * @private\n */\n this.index = undefined;\n\n /**\n * The children nodes.\n *\n * @type {ModelComponents.Node[]}\n * @private\n */\n this.children = [];\n\n /**\n * The mesh primitives.\n *\n * @type {ModelComponents.Primitive[]}\n * @private\n */\n this.primitives = [];\n\n /**\n * Instances of this node.\n *\n * @type {ModelComponents.Instances}\n * @private\n */\n this.instances = undefined;\n\n /**\n * The skin.\n *\n * @type {ModelComponents.Skin}\n * @private\n */\n this.skin = undefined;\n\n /**\n * The local transformation matrix. When matrix is defined translation,\n * rotation, and scale must be undefined. When matrix is undefined\n * translation, rotation, and scale must all be defined.\n *\n * @type {Matrix4}\n * @private\n */\n this.matrix = undefined;\n\n /**\n * The local translation.\n *\n * @type {Cartesian3}\n * @private\n */\n this.translation = undefined;\n\n /**\n * The local rotation.\n *\n * @type {Quaternion}\n * @private\n */\n this.rotation = undefined;\n\n /**\n * The local scale.\n *\n * @type {Cartesian3}\n * @private\n */\n this.scale = undefined;\n\n /**\n * An array of weights to be applied to the primitives' morph targets.\n * These are supplied by either the node or its mesh.\n *\n * @type {Number[]}\n * @private\n */\n this.morphWeights = [];\n\n /**\n * The name of the articulation affecting this node, as defined by the\n * AGI_articulations extension.\n *\n * @type {String}\n * @private\n */\n this.articulationName = undefined;\n}\n\n/**\n * A scene containing nodes.\n *\n * @alias ModelComponents.Scene\n * @constructor\n *\n * @private\n */\nfunction Scene() {\n /**\n * The nodes belonging to the scene.\n *\n * @type {ModelComponents.Node[]}\n * @private\n */\n this.nodes = [];\n}\n\n/**\n * The property of the node that is targeted by an animation. The values of\n * this enum are used to look up the appropriate property on the runtime node.\n *\n * @alias {ModelComponents.AnimatedPropertyType}\n * @enum {String}\n *\n * @private\n */\nconst AnimatedPropertyType = {\n TRANSLATION: \"translation\",\n ROTATION: \"rotation\",\n SCALE: \"scale\",\n WEIGHTS: \"weights\",\n};\n\n/**\n * An animation sampler that describes the sources of animated keyframe data\n * and their interpolation.\n *\n * @alias {ModelComponents.AnimationSampler}\n * @constructor\n *\n * @private\n */\nfunction AnimationSampler() {\n /**\n * The timesteps of the animation.\n *\n * @type {Number[]}\n * @private\n */\n this.input = [];\n\n /**\n * The method used to interpolate between the animation's keyframe data.\n *\n * @type {InterpolationType}\n * @private\n */\n this.interpolation = undefined;\n\n /**\n * The keyframe data of the animation.\n *\n * @type {Number[]|Cartesian3[]|Quaternion[]}\n * @private\n */\n this.output = [];\n}\n\n/**\n * An animation target, which specifies the node and property to animate.\n *\n * @alias {ModelComponents.AnimationTarget}\n * @constructor\n *\n * @private\n */\nfunction AnimationTarget() {\n /**\n * The node that will be affected by the animation.\n *\n * @type {ModelComponents.Node}\n * @private\n */\n this.node = undefined;\n\n /**\n * The property of the node to be animated.\n *\n * @type {ModelComponents.AnimatedPropertyType}\n * @private\n */\n this.path = undefined;\n}\n\n/**\n * An animation channel linking an animation sampler and the target it animates.\n *\n * @alias {ModelComponents.AnimationChannel}\n * @constructor\n *\n * @private\n */\nfunction AnimationChannel() {\n /**\n * The sampler used as the source of the animation data.\n *\n * @type {ModelComponents.AnimationSampler}\n * @private\n */\n this.sampler = undefined;\n\n /**\n * The target of the animation.\n *\n * @type {ModelComponents.AnimationTarget}\n * @private\n */\n this.target = undefined;\n}\n\n/**\n * An animation in the model.\n *\n * @alias {ModelComponents.Animation}\n * @constructor\n *\n * @private\n */\nfunction Animation() {\n /**\n * The name of the animation.\n *\n * @type {String}\n * @private\n */\n this.name = undefined;\n\n /**\n * The samplers used in this animation.\n *\n * @type {ModelComponents.AnimationSampler[]}\n * @private\n */\n this.samplers = [];\n\n /**\n * The channels used in this animation.\n *\n * @type {ModelComponents.AnimationChannel[]}\n * @private\n */\n this.channels = [];\n}\n\n/**\n * An articulation stage belonging to an articulation from the\n * AGI_articulations extension.\n *\n * @alias {ModelComponents.ArticulationStage}\n * @constructor\n *\n * @private\n */\nfunction ArticulationStage() {\n /**\n * The name of the articulation stage.\n *\n * @type {String}\n * @private\n */\n this.name = undefined;\n\n /**\n * The type of the articulation stage, defined by the type of motion it modifies.\n *\n * @type {ArticulationStageType}\n * @private\n */\n this.type = undefined;\n\n /**\n * The minimum value for the range of motion of this articulation stage.\n *\n * @type {Number}\n * @private\n */\n this.minimumValue = undefined;\n\n /**\n * The maximum value for the range of motion of this articulation stage.\n *\n * @type {Number}\n * @private\n */\n this.maximumValue = undefined;\n\n /**\n * The initial value for this articulation stage.\n *\n * @type {Number}\n * @private\n */\n this.initialValue = undefined;\n}\n\n/**\n * An articulation for the model, as defined by the AGI_articulations extension.\n *\n * @alias {ModelComponents.Articulation}\n * @constructor\n *\n * @private\n */\nfunction Articulation() {\n /**\n * The name of the articulation.\n *\n * @type {String}\n * @private\n */\n this.name = undefined;\n\n /**\n * The stages belonging to this articulation. The stages are applied to\n * the model in order of appearance.\n *\n * @type {ModelComponents.ArticulationStage[]}\n * @private\n */\n this.stages = [];\n}\n\n/**\n * The asset of the model.\n *\n * @alias {ModelComponents.Asset}\n * @constructor\n *\n * @private\n */\nfunction Asset() {\n /**\n * The credits of the model.\n *\n * @type {Credit[]}\n * @private\n */\n this.credits = [];\n}\n\n/**\n * The components that make up a model.\n *\n * @alias ModelComponents.Components\n * @constructor\n *\n * @private\n */\nfunction Components() {\n /**\n * The asset of the model.\n *\n * @type {ModelComponents.Asset}\n * @private\n */\n this.asset = new Asset();\n\n /**\n * The default scene.\n *\n * @type {ModelComponents.Scene}\n * @private\n */\n this.scene = undefined;\n\n /**\n * All nodes in the model.\n *\n * @type {ModelComponents.Node[]}\n */\n this.nodes = [];\n\n /**\n * All skins in the model.\n *\n * @type {ModelComponents.Skin[]}\n */\n this.skins = [];\n\n /**\n * All animations in the model.\n *\n * @type {ModelComponents.Animation[]}\n */\n this.animations = [];\n\n /**\n * All articulations in the model as defined by the AGI_articulations extension.\n *\n * @type {ModelComponents.Articulation[]}\n */\n this.articulations = [];\n\n /**\n * Structural metadata containing the schema, property tables, property\n * textures and property mappings\n *\n * @type {StructuralMetadata}\n * @private\n */\n this.structuralMetadata = undefined;\n\n /**\n * The model's up axis.\n *\n * @type {Axis}\n * @private\n */\n this.upAxis = undefined;\n\n /**\n * The model's forward axis.\n *\n * @type {Axis}\n * @private\n */\n this.forwardAxis = undefined;\n\n /**\n * A world-space transform to apply to the primitives.\n *\n * @type {Matrix4}\n * @private\n */\n this.transform = Matrix4.clone(Matrix4.IDENTITY);\n}\n\n/**\n * Information about a GPU texture, including the texture itself\n *\n * @alias ModelComponents.TextureReader\n * @constructor\n *\n * @private\n */\nfunction TextureReader() {\n /**\n * The underlying GPU texture. The {@link Texture} contains the sampler.\n *\n * @type {Texture}\n * @private\n */\n this.texture = undefined;\n\n /**\n * The index of the texture in the glTF. This is useful for determining\n * when textures are shared to avoid attaching a texture in multiple uniform\n * slots in the shader.\n *\n * @type {Number}\n * @private\n */\n this.index = undefined;\n\n /**\n * The texture coordinate set.\n *\n * @type {Number}\n * @default 0\n * @private\n */\n this.texCoord = 0;\n\n /**\n * Transformation matrix to apply to texture coordinates.\n *\n * @type {Matrix3}\n * @default Matrix3.IDENTITY\n */\n this.transform = Matrix3.clone(Matrix3.IDENTITY);\n\n /**\n * The texture channels to read from. When undefined all channels are read.\n *\n * @type {String}\n */\n this.channels = undefined;\n}\n\n/**\n * Material properties for the PBR metallic roughness shading model.\n *\n * @alias ModelComponents.MetallicRoughness\n * @constructor\n *\n * @private\n */\nfunction MetallicRoughness() {\n /**\n * The base color texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.baseColorTexture = undefined;\n\n /**\n * The metallic roughness texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.metallicRoughnessTexture = undefined;\n\n /**\n * The base color factor.\n *\n * @type {Cartesian4}\n * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)\n * @private\n */\n this.baseColorFactor = Cartesian4.clone(\n MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR\n );\n\n /**\n * The metallic factor.\n *\n * @type {Number}\n * @default 1.0\n * @private\n */\n this.metallicFactor = MetallicRoughness.DEFAULT_METALLIC_FACTOR;\n\n /**\n * The roughness factor.\n *\n * @type {Number}\n * @default 1.0\n * @private\n */\n this.roughnessFactor = MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR;\n}\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_BASE_COLOR_FACTOR = Cartesian4.ONE;\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_METALLIC_FACTOR = 1.0;\n\n/**\n * @private\n */\nMetallicRoughness.DEFAULT_ROUGHNESS_FACTOR = 1.0;\n\n/**\n * Material properties for the PBR specular glossiness shading model.\n *\n * @alias ModelComponents.SpecularGlossiness\n * @constructor\n *\n * @private\n */\nfunction SpecularGlossiness() {\n /**\n * The diffuse texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.diffuseTexture = undefined;\n\n /**\n * The specular glossiness texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.specularGlossinessTexture = undefined;\n\n /**\n * The diffuse factor.\n *\n * @type {Cartesian4}\n * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)\n * @private\n */\n this.diffuseFactor = Cartesian4.clone(\n SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR\n );\n\n /**\n * The specular factor.\n *\n * @type {Cartesian3}\n * @default new Cartesian3(1.0, 1.0, 1.0)\n * @private\n */\n this.specularFactor = Cartesian3.clone(\n SpecularGlossiness.DEFAULT_SPECULAR_FACTOR\n );\n\n /**\n * The glossiness factor.\n *\n * @type {Number}\n * @default 1.0\n * @private\n */\n this.glossinessFactor = SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR;\n}\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_DIFFUSE_FACTOR = Cartesian4.ONE;\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_SPECULAR_FACTOR = Cartesian3.ONE;\n\n/**\n * @private\n */\nSpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR = 1.0;\n\n/**\n * The material appearance of a primitive.\n *\n * @alias ModelComponent.Material\n * @constructor\n *\n * @private\n */\nfunction Material() {\n /**\n * Material properties for the PBR metallic roughness shading model.\n *\n * @type {ModelComponents.MetallicRoughness}\n * @private\n */\n this.metallicRoughness = new MetallicRoughness();\n\n /**\n * Material properties for the PBR specular glossiness shading model.\n *\n * @type {ModelComponents.SpecularGlossiness}\n * @private\n */\n this.specularGlossiness = undefined;\n\n /**\n * The emissive texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.emissiveTexture = undefined;\n\n /**\n * The normal texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.normalTexture = undefined;\n\n /**\n * The occlusion texture reader.\n *\n * @type {ModelComponents.TextureReader}\n * @private\n */\n this.occlusionTexture = undefined;\n\n /**\n * The emissive factor.\n *\n * @type {Cartesian3}\n * @default Cartesian3.ZERO\n * @private\n */\n this.emissiveFactor = Cartesian3.clone(Material.DEFAULT_EMISSIVE_FACTOR);\n\n /**\n * The alpha mode.\n *\n * @type {AlphaMode}\n * @default AlphaMode.OPAQUE\n * @private\n */\n this.alphaMode = AlphaMode.OPAQUE;\n\n /**\n * The alpha cutoff value of the material for the MASK alpha mode.\n *\n * @type {Number}\n * @default 0.5\n * @private\n */\n this.alphaCutoff = 0.5;\n\n /**\n * Specifies whether the material is double sided.\n *\n * @type {Boolean}\n * @default false\n * @private\n */\n this.doubleSided = false;\n\n /**\n * Specifies whether the material is unlit.\n *\n * @type {Boolean}\n * @default false\n * @private\n */\n this.unlit = false;\n}\n\n/**\n * @private\n */\nMaterial.DEFAULT_EMISSIVE_FACTOR = Cartesian3.ZERO;\n\nModelComponents.Quantization = Quantization;\nModelComponents.Attribute = Attribute;\nModelComponents.Indices = Indices;\nModelComponents.FeatureIdAttribute = FeatureIdAttribute;\nModelComponents.FeatureIdTexture = FeatureIdTexture;\nModelComponents.FeatureIdImplicitRange = FeatureIdImplicitRange;\nModelComponents.MorphTarget = MorphTarget;\nModelComponents.Primitive = Primitive;\nModelComponents.Instances = Instances;\nModelComponents.Skin = Skin;\nModelComponents.Node = Node;\nModelComponents.Scene = Scene;\nModelComponents.AnimatedPropertyType = Object.freeze(AnimatedPropertyType);\nModelComponents.AnimationSampler = AnimationSampler;\nModelComponents.AnimationTarget = AnimationTarget;\nModelComponents.AnimationChannel = AnimationChannel;\nModelComponents.Animation = Animation;\nModelComponents.ArticulationStage = ArticulationStage;\nModelComponents.Articulation = Articulation;\nModelComponents.Asset = Asset;\nModelComponents.Components = Components;\nModelComponents.TextureReader = TextureReader;\nModelComponents.MetallicRoughness = MetallicRoughness;\nModelComponents.SpecularGlossiness = SpecularGlossiness;\nModelComponents.Material = Material;\n\nexport default ModelComponents;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport ModelComponents from \"./ModelComponents.js\";\n\n/**\n * glTF loading utilities.\n *\n * @namespace GltfLoaderUtil\n *\n * @private\n */\nconst GltfLoaderUtil = {};\n\n/**\n * Get the image ID referenced by a texture.\n * <p>\n * When the texture has the EXT_texture_webp extension and the browser supports\n * WebP images the WebP image ID is returned.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.textureId The texture ID.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n *\n * @returns {Number} The image ID.\n * @private\n */\nGltfLoaderUtil.getImageIdFromTexture = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const textureId = options.textureId;\n const supportedImageFormats = options.supportedImageFormats;\n\n const texture = gltf.textures[textureId];\n const extensions = texture.extensions;\n if (defined(extensions)) {\n if (supportedImageFormats.webp && defined(extensions.EXT_texture_webp)) {\n return extensions.EXT_texture_webp.source;\n } else if (\n supportedImageFormats.basis &&\n defined(extensions.KHR_texture_basisu)\n ) {\n return extensions.KHR_texture_basisu.source;\n }\n }\n return texture.source;\n};\n\n/**\n * Create a sampler for a texture.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.textureInfo The texture info object.\n * @param {Boolean} [options.compressedTextureNoMipmap=false] True when the texture is compressed and does not have an embedded mipmap.\n *\n * @returns {Sampler} The sampler.\n * @private\n */\nGltfLoaderUtil.createSampler = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const textureInfo = options.textureInfo;\n const compressedTextureNoMipmap = defaultValue(\n options.compressedTextureNoMipmap,\n false\n );\n\n // Default sampler properties\n let wrapS = TextureWrap.REPEAT;\n let wrapT = TextureWrap.REPEAT;\n let minFilter = TextureMinificationFilter.LINEAR;\n let magFilter = TextureMagnificationFilter.LINEAR;\n\n const textureId = textureInfo.index;\n const texture = gltf.textures[textureId];\n const samplerId = texture.sampler;\n\n if (defined(samplerId)) {\n const sampler = gltf.samplers[samplerId];\n wrapS = defaultValue(sampler.wrapS, wrapS);\n wrapT = defaultValue(sampler.wrapT, wrapT);\n minFilter = defaultValue(sampler.minFilter, minFilter);\n magFilter = defaultValue(sampler.magFilter, magFilter);\n }\n\n let usesTextureTransform = false;\n const extensions = textureInfo.extensions;\n if (defined(extensions) && defined(extensions.KHR_texture_transform)) {\n usesTextureTransform = true;\n }\n\n if (\n (compressedTextureNoMipmap || usesTextureTransform) &&\n minFilter !== TextureMinificationFilter.LINEAR &&\n minFilter !== TextureMinificationFilter.NEAREST\n ) {\n if (\n minFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n minFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR\n ) {\n minFilter = TextureMinificationFilter.NEAREST;\n } else {\n minFilter = TextureMinificationFilter.LINEAR;\n }\n }\n\n return new Sampler({\n wrapS: wrapS,\n wrapT: wrapT,\n minificationFilter: minFilter,\n magnificationFilter: magFilter,\n });\n};\n\nconst defaultScale = new Cartesian2(1.0, 1.0);\n\n/**\n * Create a model texture reader.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.textureInfo The texture info JSON.\n * @param {String} [options.channels] The texture channels to read from.\n * @param {Texture} [options.texture] The texture object.\n *\n * @returns {ModelComponents.TextureReader} The texture reader for this model.\n */\nGltfLoaderUtil.createModelTextureReader = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const textureInfo = options.textureInfo;\n const channels = options.channels;\n const texture = options.texture;\n\n let texCoord = defaultValue(textureInfo.texCoord, 0);\n let transform;\n\n const textureTransform = defaultValue(\n textureInfo.extensions,\n defaultValue.EMPTY_OBJECT\n ).KHR_texture_transform;\n\n if (defined(textureTransform)) {\n texCoord = defaultValue(textureTransform.texCoord, texCoord);\n\n const offset = defined(textureTransform.offset)\n ? Cartesian2.unpack(textureTransform.offset)\n : Cartesian2.ZERO;\n let rotation = defaultValue(textureTransform.rotation, 0.0);\n const scale = defined(textureTransform.scale)\n ? Cartesian2.unpack(textureTransform.scale)\n : defaultScale;\n\n // glTF assumes UV coordinates start with (0, 0) in the top left corner\n // (y-down) unlike WebGL which puts (0, 0) in the bottom left corner (y-up).\n // This means rotations are reversed since the angle from x to y is now\n // clockwise instead of CCW. Translations and scales are not impacted by\n // this.\n rotation = -rotation;\n\n // prettier-ignore\n transform = new Matrix3(\n Math.cos(rotation) * scale.x, -Math.sin(rotation) * scale.y, offset.x,\n Math.sin(rotation) * scale.x, Math.cos(rotation) * scale.y, offset.y,\n 0.0, 0.0, 1.0\n );\n }\n\n const modelTextureReader = new ModelComponents.TextureReader();\n modelTextureReader.index = textureInfo.index;\n modelTextureReader.texture = texture;\n modelTextureReader.texCoord = texCoord;\n modelTextureReader.transform = transform;\n modelTextureReader.channels = channels;\n\n return modelTextureReader;\n};\n\nexport default GltfLoaderUtil;\n", "import CesiumMath from \"./Math.js\";\n\n/**\n * Resizes an image to ensure both width and height are powers of 2.\n * NOTE: The input image is resampled larger, rather than padded.\n * The aspect ratio of the image may change.\n *\n * @param {HTMLImageElement|HTMLCanvasElement} image The image to be resized\n * @returns {HTMLCanvasElement} A new canvas with the resized image drawn to it\n *\n * @private\n */\nfunction resizeImageToNextPowerOfTwo(image) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = CesiumMath.nextPowerOfTwo(image.width);\n canvas.height = CesiumMath.nextPowerOfTwo(image.height);\n const canvasContext = canvas.getContext(\"2d\");\n canvasContext.drawImage(\n image,\n 0,\n 0,\n image.width,\n image.height,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n}\nexport default resizeImageToNextPowerOfTwo;\n", "import Check from \"../Core/Check.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport JobType from \"./JobType.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\nimport resizeImageToNextPowerOfTwo from \"../Core/resizeImageToNextPowerOfTwo.js\";\n\n/**\n * Loads a glTF texture.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfTextureLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {String} [options.cacheKey] The cache key of the resource.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @private\n */\nfunction GltfTextureLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const textureInfo = options.textureInfo;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const supportedImageFormats = options.supportedImageFormats;\n const cacheKey = options.cacheKey;\n const asynchronous = defaultValue(options.asynchronous, true);\n\n const textureId = textureInfo.index;\n\n // imageId is guaranteed to be defined otherwise the GltfTextureLoader\n // wouldn't have been created\n const imageId = GltfLoaderUtil.getImageIdFromTexture({\n gltf: gltf,\n textureId: textureId,\n supportedImageFormats: supportedImageFormats,\n });\n\n this._resourceCache = resourceCache;\n this._gltf = gltf;\n this._textureInfo = textureInfo;\n this._imageId = imageId;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._cacheKey = cacheKey;\n this._asynchronous = asynchronous;\n this._imageLoader = undefined;\n this._image = undefined;\n this._mipLevels = undefined;\n this._texture = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n}\n\nif (defined(Object.create)) {\n GltfTextureLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfTextureLoader.prototype.constructor = GltfTextureLoader;\n}\n\nObject.defineProperties(GltfTextureLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfTextureLoader.prototype\n *\n * @type {Promise.<GltfTextureLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfTextureLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The texture.\n *\n * @memberof GltfTextureLoader.prototype\n *\n * @type {Texture}\n * @readonly\n * @private\n */\n texture: {\n get: function () {\n return this._texture;\n },\n },\n});\n\nconst scratchTextureJob = new CreateTextureJob();\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfDracoLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfTextureLoader.prototype.load = function () {\n const resourceCache = this._resourceCache;\n const imageLoader = resourceCache.loadImage({\n gltf: this._gltf,\n imageId: this._imageId,\n gltfResource: this._gltfResource,\n baseResource: this._baseResource,\n });\n\n this._imageLoader = imageLoader;\n this._state = ResourceLoaderState.LOADING;\n const that = this;\n const processPromise = new Promise(function (resolve) {\n that._process = function (loader, frameState) {\n if (defined(loader._texture)) {\n // Already created texture\n return;\n }\n\n if (!defined(loader._image)) {\n // Not ready to create texture\n return;\n }\n\n let texture;\n\n if (loader._asynchronous) {\n const textureJob = scratchTextureJob;\n textureJob.set(\n loader._gltf,\n loader._textureInfo,\n loader._image,\n loader._mipLevels,\n frameState.context\n );\n const jobScheduler = frameState.jobScheduler;\n if (!jobScheduler.execute(textureJob, JobType.TEXTURE)) {\n // Job scheduler is full. Try again next frame.\n return;\n }\n texture = textureJob.texture;\n } else {\n texture = createTexture(\n loader._gltf,\n loader._textureInfo,\n loader._image,\n loader._mipLevels,\n frameState.context\n );\n }\n\n // Unload everything except the texture\n loader.unload();\n\n loader._texture = texture;\n loader._state = ResourceLoaderState.READY;\n resolve(loader);\n };\n });\n\n this._promise = imageLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n // Now wait for process() to run to finish loading\n that._image = imageLoader.image;\n that._mipLevels = imageLoader.mipLevels;\n that._state = ResourceLoaderState.PROCESSING;\n return processPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n that.unload();\n that._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load texture\";\n return Promise.reject(that.getError(errorMessage, error));\n });\n\n return this._promise;\n};\n\nfunction CreateTextureJob() {\n this.gltf = undefined;\n this.textureInfo = undefined;\n this.image = undefined;\n this.context = undefined;\n this.texture = undefined;\n}\n\nCreateTextureJob.prototype.set = function (\n gltf,\n textureInfo,\n image,\n mipLevels,\n context\n) {\n this.gltf = gltf;\n this.textureInfo = textureInfo;\n this.image = image;\n this.mipLevels = mipLevels;\n this.context = context;\n};\n\nCreateTextureJob.prototype.execute = function () {\n this.texture = createTexture(\n this.gltf,\n this.textureInfo,\n this.image,\n this.mipLevels,\n this.context\n );\n};\n\nfunction createTexture(gltf, textureInfo, image, mipLevels, context) {\n // internalFormat is only defined for CompressedTextureBuffer\n const internalFormat = image.internalFormat;\n\n let compressedTextureNoMipmap = false;\n if (PixelFormat.isCompressedFormat(internalFormat) && !defined(mipLevels)) {\n compressedTextureNoMipmap = true;\n }\n\n const sampler = GltfLoaderUtil.createSampler({\n gltf: gltf,\n textureInfo: textureInfo,\n compressedTextureNoMipmap: compressedTextureNoMipmap,\n });\n\n const minFilter = sampler.minificationFilter;\n const wrapS = sampler.wrapS;\n const wrapT = sampler.wrapT;\n\n const samplerRequiresMipmap =\n minFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST ||\n minFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR ||\n minFilter === TextureMinificationFilter.LINEAR_MIPMAP_NEAREST ||\n minFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n\n // generateMipmap is disallowed for compressed textures. Compressed textures\n // can have mipmaps but they must come with the KTX2 instead of generated by\n // WebGL. Also note from the KHR_texture_basisu spec:\n //\n // When a texture refers to a sampler with mipmap minification or when the\n // sampler is undefined, the KTX2 image SHOULD contain a full mip pyramid.\n //\n const generateMipmap = !defined(internalFormat) && samplerRequiresMipmap;\n\n // WebGL 1 requires power-of-two texture dimensions for mipmapping and REPEAT/MIRRORED_REPEAT wrap modes.\n const requiresPowerOfTwo =\n generateMipmap ||\n wrapS === TextureWrap.REPEAT ||\n wrapS === TextureWrap.MIRRORED_REPEAT ||\n wrapT === TextureWrap.REPEAT ||\n wrapT === TextureWrap.MIRRORED_REPEAT;\n\n const nonPowerOfTwo =\n !CesiumMath.isPowerOfTwo(image.width) ||\n !CesiumMath.isPowerOfTwo(image.height);\n\n const requiresResize = requiresPowerOfTwo && nonPowerOfTwo;\n\n let texture;\n if (defined(internalFormat)) {\n if (\n !context.webgl2 &&\n PixelFormat.isCompressedFormat(internalFormat) &&\n nonPowerOfTwo &&\n requiresPowerOfTwo\n ) {\n console.warn(\n \"Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly.\"\n );\n }\n\n texture = Texture.create({\n context: context,\n source: {\n arrayBufferView: image.bufferView, // Only defined for CompressedTextureBuffer\n mipLevels: mipLevels,\n },\n width: image.width,\n height: image.height,\n pixelFormat: image.internalFormat, // Only defined for CompressedTextureBuffer\n sampler: sampler,\n });\n } else {\n if (requiresResize) {\n image = resizeImageToNextPowerOfTwo(image);\n }\n texture = Texture.create({\n context: context,\n source: image,\n sampler: sampler,\n flipY: false,\n skipColorSpaceConversion: true,\n });\n }\n\n if (generateMipmap) {\n texture.generateMipmap();\n }\n\n return texture;\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfTextureLoader.prototype.process = function (frameState) {\n return this._process(this, frameState);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfTextureLoader.prototype.unload = function () {\n if (defined(this._texture)) {\n this._texture.destroy();\n }\n\n if (defined(this._imageLoader)) {\n this._resourceCache.unload(this._imageLoader);\n }\n\n this._imageLoader = undefined;\n this._image = undefined;\n this._mipLevels = undefined;\n this._texture = undefined;\n this._gltf = undefined;\n};\n\nexport default GltfTextureLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport JobType from \"./JobType.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads a vertex buffer from a glTF buffer view.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfVertexBufferLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceCache} options.resourceCache The {@link ResourceCache} (to avoid circular dependencies).\n * @param {Object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {String} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {Number} [options.accessorId] The accessor id.\n * @param {String} [options.cacheKey] The cache key of the resource.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n *\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n * @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.\n *\n * @private\n */\nfunction GltfVertexBufferLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceCache = options.resourceCache;\n const gltf = options.gltf;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const bufferViewId = options.bufferViewId;\n const draco = options.draco;\n const attributeSemantic = options.attributeSemantic;\n const accessorId = options.accessorId;\n const cacheKey = options.cacheKey;\n const asynchronous = defaultValue(options.asynchronous, true);\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n this._resourceCache = resourceCache;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._gltf = gltf;\n this._bufferViewId = bufferViewId;\n this._draco = draco;\n this._attributeSemantic = attributeSemantic;\n this._accessorId = accessorId;\n this._cacheKey = cacheKey;\n this._asynchronous = asynchronous;\n this._loadBuffer = loadBuffer;\n this._loadTypedArray = loadTypedArray;\n this._bufferViewLoader = undefined;\n this._dracoLoader = undefined;\n this._quantization = undefined;\n this._typedArray = undefined;\n this._buffer = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n}\n\nif (defined(Object.create)) {\n GltfVertexBufferLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfVertexBufferLoader.prototype.constructor = GltfVertexBufferLoader;\n}\n\nObject.defineProperties(GltfVertexBufferLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfVertexBufferLoader.prototype\n *\n * @type {Promise.<GltfVertexBufferLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfVertexBufferLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The vertex buffer. This is only defined when <code>loadAsTypedArray</code> is false.\n *\n * @memberof GltfVertexBufferLoader.prototype\n *\n * @type {Buffer}\n * @readonly\n * @private\n */\n buffer: {\n get: function () {\n return this._buffer;\n },\n },\n /**\n * The typed array containing vertex buffer data. This is only defined when <code>loadAsTypedArray</code> is true.\n *\n * @memberof GltfVertexBufferLoader.prototype\n *\n * @type {Uint8Array}\n * @readonly\n * @private\n */\n typedArray: {\n get: function () {\n return this._typedArray;\n },\n },\n /**\n * Information about the quantized vertex attribute after Draco decode.\n *\n * @memberof GltfVertexBufferLoader.prototype\n *\n * @type {ModelComponents.Quantization}\n * @readonly\n * @private\n */\n quantization: {\n get: function () {\n return this._quantization;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfVertexBufferLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfVertexBufferLoader.prototype.load = function () {\n let promise;\n\n if (defined(this._draco)) {\n promise = loadFromDraco(this);\n } else {\n promise = loadFromBufferView(this);\n }\n\n const that = this;\n const scratchVertexBufferJob = new CreateVertexBufferJob();\n const processPromise = new Promise(function (resolve) {\n that._process = function (loader, frameState) {\n if (loader._state === ResourceLoaderState.READY) {\n return;\n }\n\n const typedArray = loader._typedArray;\n\n if (defined(loader._dracoLoader)) {\n loader._dracoLoader.process(frameState);\n }\n\n if (defined(loader._bufferViewLoader)) {\n loader._bufferViewLoader.process(frameState);\n }\n\n if (!defined(typedArray)) {\n // Buffer view hasn't been loaded yet\n return;\n }\n\n let buffer;\n if (loader._loadBuffer && loader._asynchronous) {\n const vertexBufferJob = scratchVertexBufferJob;\n vertexBufferJob.set(typedArray, frameState.context);\n const jobScheduler = frameState.jobScheduler;\n if (!jobScheduler.execute(vertexBufferJob, JobType.BUFFER)) {\n // Job scheduler is full. Try again next frame.\n return;\n }\n buffer = vertexBufferJob.buffer;\n } else if (loader._loadBuffer) {\n buffer = createVertexBuffer(typedArray, frameState.context);\n }\n\n // Unload everything except the vertex buffer\n loader.unload();\n\n loader._buffer = buffer;\n loader._typedArray = loader._loadTypedArray ? typedArray : undefined;\n loader._state = ResourceLoaderState.READY;\n resolve(loader);\n };\n });\n\n this._promise = promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n\n return processPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n\n return handleError(that, error);\n });\n return this._promise;\n};\n\nfunction getQuantizationInformation(\n dracoQuantization,\n componentDatatype,\n componentCount,\n type\n) {\n const quantizationBits = dracoQuantization.quantizationBits;\n const normalizationRange = (1 << quantizationBits) - 1;\n const normalizationDivisor = 1.0 / normalizationRange;\n\n const quantization = new ModelComponents.Quantization();\n quantization.componentDatatype = componentDatatype;\n quantization.octEncoded = dracoQuantization.octEncoded;\n quantization.octEncodedZXY = true;\n quantization.type = type;\n\n if (quantization.octEncoded) {\n quantization.type = AttributeType.VEC2;\n quantization.normalizationRange = normalizationRange;\n } else {\n const MathType = AttributeType.getMathType(type);\n if (MathType === Number) {\n const dimensions = dracoQuantization.range;\n quantization.quantizedVolumeOffset = dracoQuantization.minValues[0];\n quantization.quantizedVolumeDimensions = dimensions;\n quantization.normalizationRange = normalizationRange;\n quantization.quantizedVolumeStepSize = dimensions * normalizationDivisor;\n } else {\n quantization.quantizedVolumeOffset = MathType.unpack(\n dracoQuantization.minValues\n );\n quantization.normalizationRange = MathType.unpack(\n new Array(componentCount).fill(normalizationRange)\n );\n const packedDimensions = new Array(componentCount).fill(\n dracoQuantization.range\n );\n quantization.quantizedVolumeDimensions = MathType.unpack(\n packedDimensions\n );\n\n // Computing the step size\n const packedSteps = packedDimensions.map(function (dimension) {\n return dimension * normalizationDivisor;\n });\n quantization.quantizedVolumeStepSize = MathType.unpack(packedSteps);\n }\n }\n\n return quantization;\n}\n\nfunction loadFromDraco(vertexBufferLoader) {\n const resourceCache = vertexBufferLoader._resourceCache;\n const dracoLoader = resourceCache.loadDraco({\n gltf: vertexBufferLoader._gltf,\n draco: vertexBufferLoader._draco,\n gltfResource: vertexBufferLoader._gltfResource,\n baseResource: vertexBufferLoader._baseResource,\n });\n\n vertexBufferLoader._dracoLoader = dracoLoader;\n vertexBufferLoader._state = ResourceLoaderState.LOADING;\n\n return dracoLoader.promise.then(function () {\n if (vertexBufferLoader.isDestroyed()) {\n return;\n }\n // Get the typed array and quantization information\n const decodedVertexAttributes = dracoLoader.decodedData.vertexAttributes;\n const attributeSemantic = vertexBufferLoader._attributeSemantic;\n const dracoAttribute = decodedVertexAttributes[attributeSemantic];\n const accessorId = vertexBufferLoader._accessorId;\n const accessor = vertexBufferLoader._gltf.accessors[accessorId];\n const type = accessor.type;\n const typedArray = dracoAttribute.array;\n const dracoQuantization = dracoAttribute.data.quantization;\n if (defined(dracoQuantization)) {\n vertexBufferLoader._quantization = getQuantizationInformation(\n dracoQuantization,\n dracoAttribute.data.componentDatatype,\n dracoAttribute.data.componentsPerAttribute,\n type\n );\n }\n\n // Now wait for process() to run to finish loading\n vertexBufferLoader._typedArray = new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n );\n vertexBufferLoader._state = ResourceLoaderState.PROCESSING;\n return vertexBufferLoader;\n });\n}\n\nfunction loadFromBufferView(vertexBufferLoader) {\n const resourceCache = vertexBufferLoader._resourceCache;\n const bufferViewLoader = resourceCache.loadBufferView({\n gltf: vertexBufferLoader._gltf,\n bufferViewId: vertexBufferLoader._bufferViewId,\n gltfResource: vertexBufferLoader._gltfResource,\n baseResource: vertexBufferLoader._baseResource,\n });\n vertexBufferLoader._state = ResourceLoaderState.LOADING;\n vertexBufferLoader._bufferViewLoader = bufferViewLoader;\n\n return bufferViewLoader.promise.then(function () {\n if (vertexBufferLoader.isDestroyed()) {\n return;\n }\n // Now wait for process() to run to finish loading\n vertexBufferLoader._typedArray = bufferViewLoader.typedArray;\n vertexBufferLoader._state = ResourceLoaderState.PROCESSING;\n return vertexBufferLoader;\n });\n}\n\nfunction handleError(vertexBufferLoader, error) {\n vertexBufferLoader.unload();\n vertexBufferLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load vertex buffer\";\n error = vertexBufferLoader.getError(errorMessage, error);\n return Promise.reject(error);\n}\n\nfunction CreateVertexBufferJob() {\n this.typedArray = undefined;\n this.context = undefined;\n this.buffer = undefined;\n}\n\nCreateVertexBufferJob.prototype.set = function (typedArray, context) {\n this.typedArray = typedArray;\n this.context = context;\n};\n\nCreateVertexBufferJob.prototype.execute = function () {\n this.buffer = createVertexBuffer(this.typedArray, this.context);\n};\n\nfunction createVertexBuffer(typedArray, context) {\n const buffer = Buffer.createVertexBuffer({\n typedArray: typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n });\n buffer.vertexArrayDestroyable = false;\n return buffer;\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfVertexBufferLoader.prototype.process = function (frameState) {\n return this._process(this, frameState);\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfVertexBufferLoader.prototype.unload = function () {\n if (defined(this._buffer)) {\n this._buffer.destroy();\n }\n\n const resourceCache = this._resourceCache;\n\n if (defined(this._bufferViewLoader)) {\n resourceCache.unload(this._bufferViewLoader);\n }\n\n if (defined(this._dracoLoader)) {\n resourceCache.unload(this._dracoLoader);\n }\n\n this._bufferViewLoader = undefined;\n this._dracoLoader = undefined;\n this._typedArray = undefined;\n this._buffer = undefined;\n this._gltf = undefined;\n};\n\nexport default GltfVertexBufferLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataClassProperty from \"./MetadataClassProperty.js\";\n\n/**\n * A metadata class.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.id The ID of the class.\n * @param {Object} options.class The class JSON object.\n * @param {Object.<String, MetadataEnum>} [options.enums] A dictionary of enums.\n *\n * @alias MetadataClass\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataClass(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const id = options.id;\n const classDefinition = options.class;\n\n const properties = {};\n const propertiesBySemantic = {};\n for (const propertyId in classDefinition.properties) {\n if (classDefinition.properties.hasOwnProperty(propertyId)) {\n const property = new MetadataClassProperty({\n id: propertyId,\n property: classDefinition.properties[propertyId],\n enums: options.enums,\n });\n properties[propertyId] = property;\n if (defined(property.semantic)) {\n propertiesBySemantic[property.semantic] = property;\n }\n }\n }\n\n this._properties = properties;\n this._propertiesBySemantic = propertiesBySemantic;\n this._id = id;\n this._name = classDefinition.name;\n this._description = classDefinition.description;\n this._extras = classDefinition.extras;\n this._extensions = classDefinition.extensions;\n}\n\nObject.defineProperties(MetadataClass.prototype, {\n /**\n * The class properties.\n *\n * @memberof MetadataClass.prototype\n * @type {Object.<String, MetadataClassProperty>}\n * @readonly\n * @private\n */\n properties: {\n get: function () {\n return this._properties;\n },\n },\n\n /**\n * A dictionary mapping semantics to class properties.\n *\n * @memberof MetadataClass.prototype\n * @type {Object.<String, MetadataClassProperty>}\n * @readonly\n *\n * @private\n */\n propertiesBySemantic: {\n get: function () {\n return this._propertiesBySemantic;\n },\n },\n\n /**\n * The ID of the class.\n *\n * @memberof MetadataClass.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * The name of the class.\n *\n * @memberof MetadataClass.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The description of the class.\n *\n * @memberof MetadataClass.prototype\n * @type {String}\n * @readonly\n * @private\n */\n description: {\n get: function () {\n return this._description;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataClass.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataClass.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * The class name given to the metadata class when a batch\n * table is loaded from 3D Tiles 1.0 formats.\n *\n * @private\n */\nMetadataClass.BATCH_TABLE_CLASS_NAME = \"_batchTable\";\n\nexport default MetadataClass;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * A metadata enum value.\n *\n * @param {Object} value The enum value JSON object.\n *\n * @alias MetadataEnumValue\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEnumValue(value) {\n this._value = value.value;\n this._name = value.name;\n this._description = value.description;\n this._extras = value.extras;\n this._extensions = value.extensions;\n}\n\nObject.defineProperties(MetadataEnumValue.prototype, {\n /**\n * The integer value.\n *\n * @memberof MetadataEnumValue.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n value: {\n get: function () {\n return this._value;\n },\n },\n\n /**\n * The name of the enum value.\n *\n * @memberof MetadataEnumValue.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The description of the enum value.\n *\n * @memberof MetadataEnumValue.prototype\n * @type {String}\n * @readonly\n * @private\n */\n description: {\n get: function () {\n return this._description;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataEnumValue.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataEnumValue.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nexport default MetadataEnumValue;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEnumValue from \"./MetadataEnumValue.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A metadata enum.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.id The ID of the enum.\n * @param {Object} options.enum The enum JSON object.\n *\n * @alias MetadataEnum\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataEnum(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const id = options.id;\n const enumDefinition = options.enum;\n\n const namesByValue = {};\n const valuesByName = {};\n const values = enumDefinition.values.map(function (value) {\n namesByValue[value.value] = value.name;\n valuesByName[value.name] = value.value;\n return new MetadataEnumValue(value);\n });\n\n const valueType = defaultValue(\n MetadataComponentType[enumDefinition.valueType],\n MetadataComponentType.UINT16\n );\n\n this._values = values;\n this._namesByValue = namesByValue;\n this._valuesByName = valuesByName;\n this._valueType = valueType;\n this._id = id;\n this._name = enumDefinition.name;\n this._description = enumDefinition.description;\n this._extras = enumDefinition.extras;\n this._extensions = enumDefinition.extensions;\n}\n\nObject.defineProperties(MetadataEnum.prototype, {\n /**\n * The enum values.\n *\n * @memberof MetadataEnum.prototype\n * @type {MetadataEnumValue[]}\n * @readonly\n * @private\n */\n values: {\n get: function () {\n return this._values;\n },\n },\n\n /**\n * A dictionary mapping enum integer values to names.\n *\n * @memberof MetadataEnum.prototype\n * @type {Object.<Number, String>}\n * @readonly\n *\n * @private\n */\n namesByValue: {\n get: function () {\n return this._namesByValue;\n },\n },\n\n /**\n * A dictionary mapping enum names to integer values.\n *\n * @memberof MetadataEnum.prototype\n * @type {Object.<String, Number>}\n * @readonly\n *\n * @private\n */\n valuesByName: {\n get: function () {\n return this._valuesByName;\n },\n },\n\n /**\n * The enum value type.\n *\n * @memberof MetadataEnum.prototype\n * @type {MetadataComponentType}\n * @readonly\n *\n * @private\n */\n valueType: {\n get: function () {\n return this._valueType;\n },\n },\n\n /**\n * The ID of the enum.\n *\n * @memberof MetadataEnum.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * The name of the enum.\n *\n * @memberof MetadataEnum.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The description of the enum.\n *\n * @memberof MetadataEnum.prototype\n * @type {String}\n * @readonly\n * @private\n */\n description: {\n get: function () {\n return this._description;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataEnum.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataEnum.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nexport default MetadataEnum;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataClass from \"./MetadataClass.js\";\nimport MetadataEnum from \"./MetadataEnum.js\";\n\n/**\n * A schema containing classes and enums.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} schema The schema JSON object.\n *\n * @alias MetadataSchema\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataSchema(schema) {\n const enums = {};\n if (defined(schema.enums)) {\n for (const enumId in schema.enums) {\n if (schema.enums.hasOwnProperty(enumId)) {\n enums[enumId] = new MetadataEnum({\n id: enumId,\n enum: schema.enums[enumId],\n });\n }\n }\n }\n\n const classes = {};\n if (defined(schema.classes)) {\n for (const classId in schema.classes) {\n if (schema.classes.hasOwnProperty(classId)) {\n classes[classId] = new MetadataClass({\n id: classId,\n class: schema.classes[classId],\n enums: enums,\n });\n }\n }\n }\n\n this._classes = classes;\n this._enums = enums;\n this._id = schema.id;\n this._name = schema.name;\n this._description = schema.description;\n this._version = schema.version;\n this._extras = schema.extras;\n this._extensions = schema.extensions;\n}\n\nObject.defineProperties(MetadataSchema.prototype, {\n /**\n * Classes defined in the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {Object.<String, MetadataClass>}\n * @readonly\n * @private\n */\n classes: {\n get: function () {\n return this._classes;\n },\n },\n\n /**\n * Enums defined in the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {Object.<String, MetadataEnum>}\n * @readonly\n * @private\n */\n enums: {\n get: function () {\n return this._enums;\n },\n },\n\n /**\n * The ID of the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * The name of the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The description of the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {String}\n * @readonly\n * @private\n */\n description: {\n get: function () {\n return this._description;\n },\n },\n\n /**\n * The application-specific version of the schema.\n *\n * @memberof MetadataSchema.prototype\n * @type {String}\n * @readonly\n * @private\n */\n version: {\n get: function () {\n return this._version;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof MetadataSchema.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof MetadataSchema.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nexport default MetadataSchema;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MetadataSchema from \"./MetadataSchema.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * A {@link MetadataSchema} loader.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias MetadataSchemaLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n * @param {String} [options.cacheKey] The cache key of the resource.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction MetadataSchemaLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const schema = options.schema;\n const resource = options.resource;\n const cacheKey = options.cacheKey;\n\n this._schema = defined(schema) ? new MetadataSchema(schema) : undefined;\n this._resource = resource;\n this._cacheKey = cacheKey;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n MetadataSchemaLoader.prototype = Object.create(ResourceLoader.prototype);\n MetadataSchemaLoader.prototype.constructor = MetadataSchemaLoader;\n}\n\nObject.defineProperties(MetadataSchemaLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof MetadataSchemaLoader.prototype\n *\n * @type {Promise.<MetadataSchemaLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof MetadataSchemaLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The metadata schema object.\n *\n * @memberof MetadataSchemaLoader.prototype\n *\n * @type {MetadataSchema}\n * @readonly\n * @private\n */\n schema: {\n get: function () {\n return this._schema;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<MetadataSchemaLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nMetadataSchemaLoader.prototype.load = function () {\n if (defined(this._schema)) {\n this._promise = Promise.resolve(this);\n } else {\n this._promise = loadExternalSchema(this);\n }\n\n return this._promise;\n};\n\nfunction loadExternalSchema(schemaLoader) {\n const resource = schemaLoader._resource;\n schemaLoader._state = ResourceLoaderState.LOADING;\n return resource\n .fetchJson()\n .then(function (json) {\n if (schemaLoader.isDestroyed()) {\n return;\n }\n schemaLoader._schema = new MetadataSchema(json);\n schemaLoader._state = ResourceLoaderState.READY;\n return schemaLoader;\n })\n .catch(function (error) {\n if (schemaLoader.isDestroyed()) {\n return;\n }\n schemaLoader._state = ResourceLoaderState.FAILED;\n const errorMessage = `Failed to load schema: ${resource.url}`;\n return Promise.reject(schemaLoader.getError(errorMessage, error));\n });\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nMetadataSchemaLoader.prototype.unload = function () {\n this._schema = undefined;\n};\n\nexport default MetadataSchemaLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getAbsoluteUri from \"../Core/getAbsoluteUri.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport hasExtension from \"./hasExtension.js\";\n\n/**\n * Compute cache keys for resources in {@link ResourceCache}.\n *\n * @namespace ResourceCacheKey\n *\n * @private\n */\nconst ResourceCacheKey = {};\n\nfunction getExternalResourceCacheKey(resource) {\n return getAbsoluteUri(resource.url);\n}\n\nfunction getBufferViewCacheKey(bufferView) {\n let byteOffset = bufferView.byteOffset;\n let byteLength = bufferView.byteLength;\n\n if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n const meshopt = bufferView.extensions.EXT_meshopt_compression;\n byteOffset = defaultValue(meshopt.byteOffset, 0);\n byteLength = meshopt.byteLength;\n }\n\n return `${byteOffset}-${byteOffset + byteLength}`;\n}\n\nfunction getAccessorCacheKey(accessor, bufferView) {\n const byteOffset = bufferView.byteOffset + accessor.byteOffset;\n const componentType = accessor.componentType;\n const type = accessor.type;\n const count = accessor.count;\n return `${byteOffset}-${componentType}-${type}-${count}`;\n}\n\nfunction getExternalBufferCacheKey(resource) {\n return getExternalResourceCacheKey(resource);\n}\n\nfunction getEmbeddedBufferCacheKey(parentResource, bufferId) {\n const parentCacheKey = getExternalResourceCacheKey(parentResource);\n return `${parentCacheKey}-buffer-id-${bufferId}`;\n}\n\nfunction getBufferCacheKey(buffer, bufferId, gltfResource, baseResource) {\n if (defined(buffer.uri)) {\n const resource = baseResource.getDerivedResource({\n url: buffer.uri,\n });\n return getExternalBufferCacheKey(resource);\n }\n\n return getEmbeddedBufferCacheKey(gltfResource, bufferId);\n}\n\nfunction getDracoCacheKey(gltf, draco, gltfResource, baseResource) {\n const bufferViewId = draco.bufferView;\n const bufferView = gltf.bufferViews[bufferViewId];\n const bufferId = bufferView.buffer;\n const buffer = gltf.buffers[bufferId];\n\n const bufferCacheKey = getBufferCacheKey(\n buffer,\n bufferId,\n gltfResource,\n baseResource\n );\n\n const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n return `${bufferCacheKey}-range-${bufferViewCacheKey}`;\n}\n\nfunction getImageCacheKey(gltf, imageId, gltfResource, baseResource) {\n const image = gltf.images[imageId];\n const bufferViewId = image.bufferView;\n const uri = image.uri;\n\n if (defined(uri)) {\n const resource = baseResource.getDerivedResource({\n url: uri,\n });\n return getExternalResourceCacheKey(resource);\n }\n\n const bufferView = gltf.bufferViews[bufferViewId];\n const bufferId = bufferView.buffer;\n const buffer = gltf.buffers[bufferId];\n\n const bufferCacheKey = getBufferCacheKey(\n buffer,\n bufferId,\n gltfResource,\n baseResource\n );\n\n const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n return `${bufferCacheKey}-range-${bufferViewCacheKey}`;\n}\n\nfunction getSamplerCacheKey(gltf, textureInfo) {\n const sampler = GltfLoaderUtil.createSampler({\n gltf: gltf,\n textureInfo: textureInfo,\n });\n\n return `${sampler.wrapS}-${sampler.wrapT}-${sampler.minificationFilter}-${sampler.magnificationFilter}`;\n}\n\n/**\n * Gets the schema cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n *\n * @returns {String} The schema cache key.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n * @private\n */\nResourceCacheKey.getSchemaCacheKey = function (options) {\n const schema = options.schema;\n const resource = options.resource;\n\n if (defined(schema)) {\n return `embedded-schema:${JSON.stringify(schema)}`;\n }\n\n return `external-schema:${getExternalResourceCacheKey(resource)}`;\n};\n\n/**\n * Gets the external buffer cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.resource The {@link Resource} pointing to the external buffer.\n *\n * @returns {String} The external buffer cache key.\n * @private\n */\nResourceCacheKey.getExternalBufferCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resource = options.resource;\n\n return `external-buffer:${getExternalBufferCacheKey(resource)}`;\n};\n\n/**\n * Gets the embedded buffer cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.parentResource The {@link Resource} containing the embedded buffer.\n * @param {Number} options.bufferId A unique identifier of the embedded buffer within the parent resource.\n *\n * @returns {String} The embedded buffer cache key.\n * @private\n */\nResourceCacheKey.getEmbeddedBufferCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const parentResource = options.parentResource;\n const bufferId = options.bufferId;\n\n return `embedded-buffer:${getEmbeddedBufferCacheKey(\n parentResource,\n bufferId\n )}`;\n};\n\n/**\n * Gets the glTF cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n *\n * @returns {String} The glTF cache key.\n * @private\n */\nResourceCacheKey.getGltfCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltfResource = options.gltfResource;\n\n return `gltf:${getExternalResourceCacheKey(gltfResource)}`;\n};\n\n/**\n * Gets the buffer view cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.bufferViewId The bufferView ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {String} The buffer view cache key.\n * @private\n */\nResourceCacheKey.getBufferViewCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const bufferViewId = options.bufferViewId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n const bufferView = gltf.bufferViews[bufferViewId];\n let bufferId = bufferView.buffer;\n const buffer = gltf.buffers[bufferId];\n if (hasExtension(bufferView, \"EXT_meshopt_compression\")) {\n const meshopt = bufferView.extensions.EXT_meshopt_compression;\n bufferId = meshopt.buffer;\n }\n\n const bufferCacheKey = getBufferCacheKey(\n buffer,\n bufferId,\n gltfResource,\n baseResource\n );\n\n const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n return `buffer-view:${bufferCacheKey}-range-${bufferViewCacheKey}`;\n};\n\n/**\n * Gets the Draco cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {String} The Draco cache key.\n * @private\n */\nResourceCacheKey.getDracoCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const draco = options.draco;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n return `draco:${getDracoCacheKey(gltf, draco, gltfResource, baseResource)}`;\n};\n\n/**\n * Gets the vertex buffer cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {Number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {String} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {Boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.\n * @param {Boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n *\n * @returns {String} The vertex buffer cache key.\n * @private\n */\nResourceCacheKey.getVertexBufferCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const frameState = options.frameState;\n const bufferViewId = options.bufferViewId;\n const draco = options.draco;\n const attributeSemantic = options.attributeSemantic;\n const dequantize = defaultValue(options.dequantize, false);\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n let cacheKeySuffix = \"\";\n if (dequantize) {\n cacheKeySuffix += \"-dequantize\";\n }\n\n if (loadBuffer) {\n cacheKeySuffix += \"-buffer\";\n cacheKeySuffix += `-context-${frameState.context.id}`;\n }\n\n if (loadTypedArray) {\n cacheKeySuffix += \"-typed-array\";\n }\n\n if (defined(draco)) {\n const dracoCacheKey = getDracoCacheKey(\n gltf,\n draco,\n gltfResource,\n baseResource\n );\n return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;\n }\n\n const bufferView = gltf.bufferViews[bufferViewId];\n const bufferId = bufferView.buffer;\n const buffer = gltf.buffers[bufferId];\n\n const bufferCacheKey = getBufferCacheKey(\n buffer,\n bufferId,\n gltfResource,\n baseResource\n );\n\n const bufferViewCacheKey = getBufferViewCacheKey(bufferView);\n\n return `vertex-buffer:${bufferCacheKey}-range-${bufferViewCacheKey}${cacheKeySuffix}`;\n};\n\n/**\n * Gets the index buffer cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {Boolean} [options.loadBuffer=false] Load index buffer as a GPU index buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load index buffer as a typed array.\n *\n * @returns {String} The index buffer cache key.\n * @private\n */\nResourceCacheKey.getIndexBufferCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const accessorId = options.accessorId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const frameState = options.frameState;\n const draco = options.draco;\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n let cacheKeySuffix = \"\";\n if (loadBuffer) {\n cacheKeySuffix += \"-buffer\";\n cacheKeySuffix += `-context-${frameState.context.id}`;\n }\n\n if (loadTypedArray) {\n cacheKeySuffix += \"-typed-array\";\n }\n\n if (defined(draco)) {\n const dracoCacheKey = getDracoCacheKey(\n gltf,\n draco,\n gltfResource,\n baseResource\n );\n return `index-buffer:${dracoCacheKey}-draco${cacheKeySuffix}`;\n }\n\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n const bufferView = gltf.bufferViews[bufferViewId];\n const bufferId = bufferView.buffer;\n const buffer = gltf.buffers[bufferId];\n\n const bufferCacheKey = getBufferCacheKey(\n buffer,\n bufferId,\n gltfResource,\n baseResource\n );\n\n const accessorCacheKey = getAccessorCacheKey(accessor, bufferView);\n\n return `index-buffer:${bufferCacheKey}-accessor-${accessorCacheKey}${cacheKeySuffix}`;\n};\n\n/**\n * Gets the image cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {String} The image cache key.\n * @private\n */\nResourceCacheKey.getImageCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const imageId = options.imageId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n const imageCacheKey = getImageCacheKey(\n gltf,\n imageId,\n gltfResource,\n baseResource\n );\n\n return `image:${imageCacheKey}`;\n};\n\n/**\n * Gets the texture cache key.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n *\n * @returns {String} The texture cache key.\n * @private\n */\nResourceCacheKey.getTextureCacheKey = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const textureInfo = options.textureInfo;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const supportedImageFormats = options.supportedImageFormats;\n const frameState = options.frameState;\n\n const textureId = textureInfo.index;\n\n const imageId = GltfLoaderUtil.getImageIdFromTexture({\n gltf: gltf,\n textureId: textureId,\n supportedImageFormats: supportedImageFormats,\n });\n\n const imageCacheKey = getImageCacheKey(\n gltf,\n imageId,\n gltfResource,\n baseResource\n );\n\n // Include the sampler cache key in the texture cache key since textures and\n // samplers are coupled in WebGL 1. When upgrading to WebGL 2 consider\n // removing the sampleCacheKey here.\n const samplerCacheKey = getSamplerCacheKey(gltf, textureInfo);\n\n return `texture:${imageCacheKey}-sampler-${samplerCacheKey}-context-${frameState.context.id}`;\n};\n\nexport default ResourceCacheKey;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * Statistics for the GPU and CPU memory used by the models loaded through the\n * {@link ResourceCache}.\n *\n * @alias ResourceCacheStatistics\n * @constructor\n *\n * @private\n */\nfunction ResourceCacheStatistics() {\n /**\n * The size of vertex buffers and index buffers loaded in the cache in bytes.\n *\n * @type {Number}\n * @private\n */\n this.geometryByteLength = 0;\n\n /**\n * The size of all textures loaded in the cache in bytes\n *\n * @type {Number}\n * @private\n */\n this.texturesByteLength = 0;\n\n // Track the sizes of resources by cache key. This is important so\n // removeLoader() can decrement the counts correctly.\n this._geometrySizes = {};\n this._textureSizes = {};\n}\n\n/**\n * Reset the memory counts\n *\n * @private\n */\nResourceCacheStatistics.prototype.clear = function () {\n this.geometryByteLength = 0;\n this.texturesByteLength = 0;\n\n this._geometrySizes = {};\n this._textureSizes = {};\n};\n\n/**\n * Track the resources for a vertex or index buffer loader. This is implemented\n * asynchronously since resources may not be immediately available to count.\n * This method handles the following cases gracefully:\n * <ul>\n * <li>If the loader is added twice, its resources will not be double-counted</li>\n * <li>If the geometry has a CPU copy of the GPU buffer, it will be added to the count</li>\n * <li>If the resource loading failed, its resources will not be counted</li>\n * <li>If removeLoader() was called before the loader promise resolves, its resources will not be counted</li>\n * </ul>\n * @param {GltfVertexBufferLoader|GltfIndexBufferLoader} loader The geometry buffer with resources to track\n * @returns {Promise} A promise that resolves once the count is updated.\n *\n * @private\n */\nResourceCacheStatistics.prototype.addGeometryLoader = function (loader) {\n const cacheKey = loader.cacheKey;\n\n // Don't double count the same resource.\n if (this._geometrySizes.hasOwnProperty(cacheKey)) {\n return;\n }\n\n this._geometrySizes[cacheKey] = 0;\n\n const that = this;\n return loader.promise\n .then(function (loader) {\n // loader was unloaded before its promise resolved\n if (!that._geometrySizes.hasOwnProperty(cacheKey)) {\n return;\n }\n\n const buffer = loader.buffer;\n const typedArray = loader.typedArray;\n\n let totalSize = 0;\n\n if (defined(buffer)) {\n totalSize += buffer.sizeInBytes;\n }\n\n if (defined(typedArray)) {\n totalSize += typedArray.byteLength;\n }\n\n that.geometryByteLength += totalSize;\n that._geometrySizes[cacheKey] = totalSize;\n })\n .catch(function () {\n // If the resource failed to load, remove it from the cache\n delete that._geometrySizes[cacheKey];\n });\n};\n\n/**\n * Track the resources for a texture loader. This is implemented\n * asynchronously since resources may not be immediately available to count.\n * This method handles the following cases gracefully:\n * <ul>\n * <li>If the loader is added twice, its resources will not be double-counted</li>\n * <li>If the resource loading failed, its resources will not be counted</li>\n * <li>If removeLoader() was called before the loader promise resolves, its resources will not be counted</li>\n * </ul>\n * @param {GltfTextureLoader} loader The texture loader with resources to track\n * @returns {Promise} A promise that resolves once the count is updated.\n *\n * @private\n */\nResourceCacheStatistics.prototype.addTextureLoader = function (loader) {\n const cacheKey = loader.cacheKey;\n\n // Don't double count the same resource.\n if (this._textureSizes.hasOwnProperty(cacheKey)) {\n return;\n }\n\n this._textureSizes[cacheKey] = 0;\n\n const that = this;\n return loader.promise\n .then(function (loader) {\n // loader was unloaded before its promise resolved\n if (!that._textureSizes.hasOwnProperty(cacheKey)) {\n return;\n }\n\n const totalSize = loader.texture.sizeInBytes;\n that.texturesByteLength += loader.texture.sizeInBytes;\n that._textureSizes[cacheKey] = totalSize;\n })\n .catch(function () {\n delete that._textureSizes[cacheKey];\n });\n};\n\n/**\n * Remove a loader's resources from the memory count. The loader's cache key\n * is used to determine information about the resource, so this method can\n * be used both for geometry and textures. If the loader does not have any\n * tracked resources, this is a no-op.\n * @param {ResourceLoader} loader The resource loader to remove from the cache\n *\n * @private\n */\nResourceCacheStatistics.prototype.removeLoader = function (loader) {\n const cacheKey = loader.cacheKey;\n const geometrySize = this._geometrySizes[cacheKey];\n delete this._geometrySizes[cacheKey];\n\n if (defined(geometrySize)) {\n this.geometryByteLength -= geometrySize;\n }\n\n const textureSize = this._textureSizes[cacheKey];\n delete this._textureSizes[cacheKey];\n\n if (defined(textureSize)) {\n this.texturesByteLength -= textureSize;\n }\n};\n\nexport default ResourceCacheStatistics;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport BufferLoader from \"./BufferLoader.js\";\nimport GltfBufferViewLoader from \"./GltfBufferViewLoader.js\";\nimport GltfDracoLoader from \"./GltfDracoLoader.js\";\nimport GltfImageLoader from \"./GltfImageLoader.js\";\nimport GltfIndexBufferLoader from \"./GltfIndexBufferLoader.js\";\nimport GltfJsonLoader from \"./GltfJsonLoader.js\";\nimport GltfTextureLoader from \"./GltfTextureLoader.js\";\nimport GltfVertexBufferLoader from \"./GltfVertexBufferLoader.js\";\nimport MetadataSchemaLoader from \"./MetadataSchemaLoader.js\";\nimport ResourceCacheKey from \"./ResourceCacheKey.js\";\nimport ResourceCacheStatistics from \"./ResourceCacheStatistics.js\";\n\n/**\n * Cache for resources shared across 3D Tiles and glTF.\n *\n * @namespace ResourceCache\n *\n * @private\n */\nfunction ResourceCache() {}\n\nResourceCache.cacheEntries = {};\n\n// Statistics about binary data stored in the resource cache\nResourceCache.statistics = new ResourceCacheStatistics();\n\n/**\n * A reference-counted cache entry.\n *\n * @param {ResourceLoader} resourceLoader The resource.\n *\n * @alias CacheEntry\n * @constructor\n *\n * @private\n */\nfunction CacheEntry(resourceLoader) {\n this.referenceCount = 1;\n this.resourceLoader = resourceLoader;\n\n // For unit testing only\n this._statisticsPromise = undefined;\n}\n\n/**\n * Gets a resource from the cache. If the resource exists its reference count is\n * incremented. Otherwise, if no resource loader exists, undefined is returned.\n *\n * @param {String} cacheKey The cache key of the resource.\n *\n * @returns {ResourceLoader|undefined} The resource.\n * @private\n */\nResourceCache.get = function (cacheKey) {\n const cacheEntry = ResourceCache.cacheEntries[cacheKey];\n if (defined(cacheEntry)) {\n ++cacheEntry.referenceCount;\n return cacheEntry.resourceLoader;\n }\n return undefined;\n};\n\n/**\n * Loads a resource and adds it to the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {ResourceLoader} options.resourceLoader The resource.\n *\n * @exception {DeveloperError} Resource with this cacheKey is already in the cach\n * @private\n */\nResourceCache.load = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resourceLoader = options.resourceLoader;\n\n const cacheKey = resourceLoader.cacheKey;\n\n ResourceCache.cacheEntries[cacheKey] = new CacheEntry(resourceLoader);\n\n resourceLoader.load();\n};\n\n/**\n * Unloads a resource from the cache. When the reference count hits zero the\n * resource is destroyed.\n *\n * @param {ResourceLoader} resourceLoader The resource.\n *\n * @exception {DeveloperError} Resource is not in the cache.\n * @exception {DeveloperError} Cannot unload resource that has no references.\n * @private\n */\nResourceCache.unload = function (resourceLoader) {\n const cacheKey = resourceLoader.cacheKey;\n const cacheEntry = ResourceCache.cacheEntries[cacheKey];\n\n --cacheEntry.referenceCount;\n\n if (cacheEntry.referenceCount === 0) {\n ResourceCache.statistics.removeLoader(resourceLoader);\n resourceLoader.destroy();\n delete ResourceCache.cacheEntries[cacheKey];\n }\n};\n\n/**\n * Loads a schema from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} [options.schema] An object that explicitly defines a schema JSON. Mutually exclusive with options.resource.\n * @param {Resource} [options.resource] The {@link Resource} pointing to the schema JSON. Mutually exclusive with options.schema.\n *\n * @returns {MetadataSchemaLoader} The schema resource.\n *\n * @exception {DeveloperError} One of options.schema and options.resource must be defined.\n * @private\n */\nResourceCache.loadSchema = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const schema = options.schema;\n const resource = options.resource;\n\n const cacheKey = ResourceCacheKey.getSchemaCacheKey({\n schema: schema,\n resource: resource,\n });\n\n let schemaLoader = ResourceCache.get(cacheKey);\n if (defined(schemaLoader)) {\n return schemaLoader;\n }\n\n schemaLoader = new MetadataSchemaLoader({\n schema: schema,\n resource: resource,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: schemaLoader,\n });\n\n return schemaLoader;\n};\n\n/**\n * Load an embedded buffer from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.parentResource The {@link Resource} containing the embedded buffer.\n * @param {Number} options.bufferId A unique identifier of the embedded buffer within the parent resource.\n * @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents.\n *\n * @returns {BufferLoader} The buffer loader.\n * @private\n */\nResourceCache.loadEmbeddedBuffer = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const parentResource = options.parentResource;\n const bufferId = options.bufferId;\n const typedArray = options.typedArray;\n\n const cacheKey = ResourceCacheKey.getEmbeddedBufferCacheKey({\n parentResource: parentResource,\n bufferId: bufferId,\n });\n\n let bufferLoader = ResourceCache.get(cacheKey);\n if (defined(bufferLoader)) {\n return bufferLoader;\n }\n\n bufferLoader = new BufferLoader({\n typedArray: typedArray,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: bufferLoader,\n });\n\n return bufferLoader;\n};\n\n/**\n * Loads an external buffer from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.resource The {@link Resource} pointing to the external buffer.\n *\n * @returns {BufferLoader} The buffer loader.\n * @private\n */\nResourceCache.loadExternalBuffer = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resource = options.resource;\n\n const cacheKey = ResourceCacheKey.getExternalBufferCacheKey({\n resource: resource,\n });\n\n let bufferLoader = ResourceCache.get(cacheKey);\n if (defined(bufferLoader)) {\n return bufferLoader;\n }\n\n bufferLoader = new BufferLoader({\n resource: resource,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: bufferLoader,\n });\n\n return bufferLoader;\n};\n\n/**\n * Loads a glTF JSON from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents.\n * @param {Object} [options.gltfJson] The parsed glTF JSON contents.\n *\n * @returns {GltfJsonLoader} The glTF JSON.\n * @private\n */\nResourceCache.loadGltfJson = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const typedArray = options.typedArray;\n const gltfJson = options.gltfJson;\n\n const cacheKey = ResourceCacheKey.getGltfCacheKey({\n gltfResource: gltfResource,\n });\n\n let gltfJsonLoader = ResourceCache.get(cacheKey);\n if (defined(gltfJsonLoader)) {\n return gltfJsonLoader;\n }\n\n gltfJsonLoader = new GltfJsonLoader({\n resourceCache: ResourceCache,\n gltfResource: gltfResource,\n baseResource: baseResource,\n typedArray: typedArray,\n gltfJson: gltfJson,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: gltfJsonLoader,\n });\n\n return gltfJsonLoader;\n};\n\n/**\n * Loads a glTF buffer view from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.bufferViewId The bufferView ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfBufferViewLoader} The buffer view loader.\n * @private\n */\nResourceCache.loadBufferView = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const bufferViewId = options.bufferViewId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n const cacheKey = ResourceCacheKey.getBufferViewCacheKey({\n gltf: gltf,\n bufferViewId: bufferViewId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n });\n\n let bufferViewLoader = ResourceCache.get(cacheKey);\n if (defined(bufferViewLoader)) {\n return bufferViewLoader;\n }\n\n bufferViewLoader = new GltfBufferViewLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n bufferViewId: bufferViewId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: bufferViewLoader,\n });\n\n return bufferViewLoader;\n};\n\n/**\n * Loads Draco data from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.draco The Draco extension object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfDracoLoader} The Draco loader.\n * @private\n */\nResourceCache.loadDraco = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const draco = options.draco;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n const cacheKey = ResourceCacheKey.getDracoCacheKey({\n gltf: gltf,\n draco: draco,\n gltfResource: gltfResource,\n baseResource: baseResource,\n });\n\n let dracoLoader = ResourceCache.get(cacheKey);\n if (defined(dracoLoader)) {\n return dracoLoader;\n }\n\n dracoLoader = new GltfDracoLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n draco: draco,\n gltfResource: gltfResource,\n baseResource: baseResource,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: dracoLoader,\n });\n\n return dracoLoader;\n};\n\n/**\n * Loads a glTF vertex buffer from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {Number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {String} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.\n * @param {Number} [options.accessorId] The accessor ID.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.dequantize=false] Determines whether or not the vertex buffer will be dequantized on the CPU.\n * @param {Boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.\n * @exception {DeveloperError} One of options.bufferViewId and options.draco must be defined.\n * @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.\n * @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.\n *\n * @returns {GltfVertexBufferLoader} The vertex buffer loader.\n * @private\n */\nResourceCache.loadVertexBuffer = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const frameState = options.frameState;\n const bufferViewId = options.bufferViewId;\n const draco = options.draco;\n const attributeSemantic = options.attributeSemantic;\n const accessorId = options.accessorId;\n const asynchronous = defaultValue(options.asynchronous, true);\n const dequantize = defaultValue(options.dequantize, false);\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n const cacheKey = ResourceCacheKey.getVertexBufferCacheKey({\n gltf: gltf,\n gltfResource: gltfResource,\n baseResource: baseResource,\n frameState: frameState,\n bufferViewId: bufferViewId,\n draco: draco,\n attributeSemantic: attributeSemantic,\n dequantize: dequantize,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n let vertexBufferLoader = ResourceCache.get(cacheKey);\n if (defined(vertexBufferLoader)) {\n return vertexBufferLoader;\n }\n\n vertexBufferLoader = new GltfVertexBufferLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n gltfResource: gltfResource,\n baseResource: baseResource,\n bufferViewId: bufferViewId,\n draco: draco,\n attributeSemantic: attributeSemantic,\n accessorId: accessorId,\n cacheKey: cacheKey,\n asynchronous: asynchronous,\n dequantize: dequantize,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n ResourceCache.load({\n resourceLoader: vertexBufferLoader,\n });\n\n const promise = ResourceCache.statistics.addGeometryLoader(\n vertexBufferLoader\n );\n\n // Needed for unit testing\n ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;\n\n return vertexBufferLoader;\n};\n\n/**\n * Loads a glTF index buffer from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.accessorId The accessor ID corresponding to the index buffer.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {FrameState} options.frameState The frame state.\n * @param {Object} [options.draco] The Draco extension object.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.loadBuffer=false] Load index buffer as a GPU index buffer.\n * @param {Boolean} [options.loadTypedArray=false] Load index buffer as a typed array.\n * @returns {GltfIndexBufferLoader} The index buffer loader.\n * @private\n */\nResourceCache.loadIndexBuffer = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const accessorId = options.accessorId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const frameState = options.frameState;\n const draco = options.draco;\n const asynchronous = defaultValue(options.asynchronous, true);\n const loadBuffer = defaultValue(options.loadBuffer, false);\n const loadTypedArray = defaultValue(options.loadTypedArray, false);\n\n const cacheKey = ResourceCacheKey.getIndexBufferCacheKey({\n gltf: gltf,\n accessorId: accessorId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n frameState: frameState,\n draco: draco,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n let indexBufferLoader = ResourceCache.get(cacheKey);\n if (defined(indexBufferLoader)) {\n return indexBufferLoader;\n }\n\n indexBufferLoader = new GltfIndexBufferLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n accessorId: accessorId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n draco: draco,\n cacheKey: cacheKey,\n asynchronous: asynchronous,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n ResourceCache.load({\n resourceLoader: indexBufferLoader,\n });\n const promise = ResourceCache.statistics.addGeometryLoader(indexBufferLoader);\n\n // Needed for unit testing\n ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;\n\n return indexBufferLoader;\n};\n\n/**\n * Loads a glTF image from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Number} options.imageId The image ID.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n *\n * @returns {GltfImageLoader} The image loader.\n * @private\n */\nResourceCache.loadImage = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const imageId = options.imageId;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n\n const cacheKey = ResourceCacheKey.getImageCacheKey({\n gltf: gltf,\n imageId: imageId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n });\n\n let imageLoader = ResourceCache.get(cacheKey);\n if (defined(imageLoader)) {\n return imageLoader;\n }\n\n imageLoader = new GltfImageLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n imageId: imageId,\n gltfResource: gltfResource,\n baseResource: baseResource,\n cacheKey: cacheKey,\n });\n\n ResourceCache.load({\n resourceLoader: imageLoader,\n });\n\n return imageLoader;\n};\n\n/**\n * Loads a glTF texture from the cache.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {Object} options.textureInfo The texture info object.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @returns {GltfTextureLoader} The texture loader.\n * @private\n */\nResourceCache.loadTexture = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const textureInfo = options.textureInfo;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const supportedImageFormats = options.supportedImageFormats;\n const frameState = options.frameState;\n const asynchronous = defaultValue(options.asynchronous, true);\n\n const cacheKey = ResourceCacheKey.getTextureCacheKey({\n gltf: gltf,\n textureInfo: textureInfo,\n gltfResource: gltfResource,\n baseResource: baseResource,\n supportedImageFormats: supportedImageFormats,\n frameState: frameState,\n });\n\n let textureLoader = ResourceCache.get(cacheKey);\n if (defined(textureLoader)) {\n return textureLoader;\n }\n\n textureLoader = new GltfTextureLoader({\n resourceCache: ResourceCache,\n gltf: gltf,\n textureInfo: textureInfo,\n gltfResource: gltfResource,\n baseResource: baseResource,\n supportedImageFormats: supportedImageFormats,\n cacheKey: cacheKey,\n asynchronous: asynchronous,\n });\n\n ResourceCache.load({\n resourceLoader: textureLoader,\n });\n const promise = ResourceCache.statistics.addTextureLoader(textureLoader);\n\n // Needed for unit testing\n ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;\n\n return textureLoader;\n};\n\n/**\n * Unload everything from the cache. This is used for unit testing.\n *\n * @private\n */\nResourceCache.clearForSpecs = function () {\n // Unload in the order below. This prevents an unload function from unloading\n // a resource that has already been unloaded.\n const precedence = [\n GltfVertexBufferLoader,\n GltfIndexBufferLoader,\n GltfDracoLoader,\n GltfTextureLoader,\n GltfImageLoader,\n GltfBufferViewLoader,\n BufferLoader,\n MetadataSchemaLoader,\n GltfJsonLoader,\n ];\n\n let cacheKey;\n const cacheEntries = ResourceCache.cacheEntries;\n\n const cacheEntriesSorted = [];\n for (cacheKey in cacheEntries) {\n if (cacheEntries.hasOwnProperty(cacheKey)) {\n cacheEntriesSorted.push(cacheEntries[cacheKey]);\n }\n }\n\n cacheEntriesSorted.sort(function (a, b) {\n const indexA = precedence.indexOf(a.resourceLoader.constructor);\n const indexB = precedence.indexOf(b.resourceLoader.constructor);\n return indexA - indexB;\n });\n\n const cacheEntriesLength = cacheEntriesSorted.length;\n for (let i = 0; i < cacheEntriesLength; ++i) {\n const cacheEntry = cacheEntriesSorted[i];\n cacheKey = cacheEntry.resourceLoader.cacheKey;\n if (defined(cacheEntries[cacheKey])) {\n cacheEntry.resourceLoader.destroy();\n delete cacheEntries[cacheKey];\n }\n }\n\n ResourceCache.statistics.clear();\n};\n\nexport default ResourceCache;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitAvailabilityBitstream from \"./ImplicitAvailabilityBitstream.js\";\nimport ImplicitMetadataView from \"./ImplicitMetadataView.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\nimport ImplicitSubtreeMetadata from \"./ImplicitSubtreeMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\nimport ResourceCache from \"./ResourceCache.js\";\n\n/**\n * An object representing a single subtree in an implicit tileset\n * including availability.\n * <p>\n * Subtrees handle tile metadata, defined in the subtree JSON in either\n * tileMetadata (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension.\n * Subtrees also handle content metadata and metadata about the subtree itself.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata#implicit-tile-properties|Implicit Tile Properties in the 3DTILES_metadata specification}\n *\n * @alias ImplicitSubtree\n * @constructor\n *\n * @param {Resource} resource The resource for this subtree. This is used for fetching external buffers as needed.\n * @param {Object} [json] The JSON object for this subtree. Mutually exclusive with subtreeView.\n * @param {Uint8Array} [subtreeView] The contents of a subtree binary in a Uint8Array. Mutually exclusive with json.\n * @param {ImplicitTileset} implicitTileset The implicit tileset. This includes information about the size of subtrees\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the subtree's root tile.\n *\n * @exception {DeveloperError} One of json and subtreeView must be defined.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitSubtree(\n resource,\n json,\n subtreeView,\n implicitTileset,\n implicitCoordinates\n) {\n this._resource = resource;\n this._subtreeJson = undefined;\n this._bufferLoader = undefined;\n this._tileAvailability = undefined;\n this._contentAvailabilityBitstreams = [];\n this._childSubtreeAvailability = undefined;\n this._implicitCoordinates = implicitCoordinates;\n this._subtreeLevels = implicitTileset.subtreeLevels;\n this._subdivisionScheme = implicitTileset.subdivisionScheme;\n this._branchingFactor = implicitTileset.branchingFactor;\n\n // properties for metadata\n this._metadata = undefined;\n this._tileMetadataTable = undefined;\n this._tilePropertyTableJson = undefined;\n\n this._contentMetadataTables = [];\n this._contentPropertyTableJsons = [];\n\n // Jump buffers are maps of availability bit index to entity ID\n this._tileJumpBuffer = undefined;\n this._contentJumpBuffers = [];\n\n this._readyPromise = initialize(this, json, subtreeView, implicitTileset);\n}\n\nObject.defineProperties(ImplicitSubtree.prototype, {\n /**\n * A promise that resolves once all necessary availability buffers\n * are loaded.\n *\n * @type {Promise}\n * @readonly\n * @private\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * When subtree metadata is present (3D Tiles 1.1), this property stores an {@link ImplicitSubtreeMetadata} instance\n *\n * @type {ImplicitSubtreeMetadata}\n * @readonly\n * @private\n */\n metadata: {\n get: function () {\n return this._metadata;\n },\n },\n\n /**\n * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n * this property stores a {@link MetadataTable} instance for the tiles in the subtree.\n *\n * @type {MetadataTable}\n * @readonly\n * @private\n */\n tileMetadataTable: {\n get: function () {\n return this._tileMetadataTable;\n },\n },\n\n /**\n * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n * this property stores the JSON from the extension. This is used by {@link TileMetadata}\n * to get the extras and extensions for the tiles in the subtree.\n *\n * @type {Object}\n * @readonly\n * @private\n */\n tilePropertyTableJson: {\n get: function () {\n return this._tilePropertyTableJson;\n },\n },\n\n /**\n * When content metadata is present (3D Tiles 1.1), this property stores\n * an array of {@link MetadataTable} instances for the contents in the subtree.\n *\n * @type {Array}\n * @readonly\n * @private\n */\n contentMetadataTables: {\n get: function () {\n return this._contentMetadataTables;\n },\n },\n\n /**\n * When content metadata is present (3D Tiles 1.1), this property\n * an array of the JSONs from the extension. This is used to get the extras\n * and extensions for the contents in the subtree.\n *\n * @type {Array}\n * @readonly\n * @private\n */\n contentPropertyTableJsons: {\n get: function () {\n return this._contentPropertyTableJsons;\n },\n },\n\n /**\n * Gets the implicit tile coordinates for the root of the subtree.\n *\n * @type {ImplicitTileCoordinates}\n * @readonly\n * @private\n */\n implicitCoordinates: {\n get: function () {\n return this._implicitCoordinates;\n },\n },\n});\n\n/**\n * Check if a specific tile is available at an index of the tile availability bitstream\n *\n * @param {Number} index The index of the desired tile\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.tileIsAvailableAtIndex = function (index) {\n return this._tileAvailability.getBit(index);\n};\n\n/**\n * Check if a specific tile is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.tileIsAvailableAtCoordinates = function (\n implicitCoordinates\n) {\n const index = this.getTileIndex(implicitCoordinates);\n return this.tileIsAvailableAtIndex(index);\n};\n\n/**\n * Check if a specific tile's content is available at an index of the content availability bitstream\n *\n * @param {Number} index The index of the desired tile\n * @param {Number} [contentIndex=0] The index of the desired content when multiple contents are used.\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.contentIsAvailableAtIndex = function (\n index,\n contentIndex\n) {\n contentIndex = defaultValue(contentIndex, 0);\n return this._contentAvailabilityBitstreams[contentIndex].getBit(index);\n};\n\n/**\n * Check if a specific tile's content is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @param {Number} [contentIndex=0] The index of the desired content when the <code>3DTILES_multiple_contents</code> extension is used.\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.contentIsAvailableAtCoordinates = function (\n implicitCoordinates,\n contentIndex\n) {\n const index = this.getTileIndex(implicitCoordinates);\n return this.contentIsAvailableAtIndex(index, contentIndex);\n};\n\n/**\n * Check if a child subtree is available at an index of the child subtree availability bitstream\n *\n * @param {Number} index The index of the desired child subtree\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.childSubtreeIsAvailableAtIndex = function (index) {\n return this._childSubtreeAvailability.getBit(index);\n};\n\n/**\n * Check if a specific child subtree is available at an implicit tile coordinate\n *\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a child subtree\n * @returns {Boolean} The value of the i-th bit\n * @private\n */\nImplicitSubtree.prototype.childSubtreeIsAvailableAtCoordinates = function (\n implicitCoordinates\n) {\n const index = this.getChildSubtreeIndex(implicitCoordinates);\n return this.childSubtreeIsAvailableAtIndex(index);\n};\n\n/**\n * Get the index of the first node at the given level within this subtree.\n * e.g. for a quadtree:\n * <ul>\n * <li>Level 0 starts at index 0</li>\n * <li>Level 1 starts at index 1</li>\n * <li>Level 2 starts at index 5</li>\n * </ul>\n *\n * @param {Number} level The 0-indexed level number relative to the root of the subtree\n * @returns {Number} The first index at the desired level\n * @private\n */\nImplicitSubtree.prototype.getLevelOffset = function (level) {\n const branchingFactor = this._branchingFactor;\n return (Math.pow(branchingFactor, level) - 1) / (branchingFactor - 1);\n};\n\n/**\n * Get the morton index of a tile's parent. This is equivalent to\n * chopping off the last 2 (quadtree) or 3 (octree) bits of the morton\n * index.\n *\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @returns {Number} The index of the child's parent node\n * @private\n */\nImplicitSubtree.prototype.getParentMortonIndex = function (mortonIndex) {\n let bitsPerLevel = 2;\n if (this._subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n bitsPerLevel = 3;\n }\n\n return mortonIndex >> bitsPerLevel;\n};\n\n/**\n * Parse all relevant information out of the subtree. This fetches any\n * external buffers that are used by the implicit tileset. When finished,\n * it resolves/rejects subtree.readyPromise.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @param {Object} [json] The JSON object for this subtree. If parsing from a binary subtree file, this will be undefined.\n * @param {Uint8Array} [subtreeView] The contents of the subtree binary\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @private\n */\nfunction initialize(subtree, json, subtreeView, implicitTileset) {\n let chunks;\n if (defined(json)) {\n chunks = {\n json: json,\n binary: undefined,\n };\n } else {\n chunks = parseSubtreeChunks(subtreeView);\n }\n\n const subtreeJson = chunks.json;\n subtree._subtreeJson = subtreeJson;\n\n let tilePropertyTableJson;\n if (hasExtension(subtreeJson, \"3DTILES_metadata\")) {\n tilePropertyTableJson = subtreeJson.extensions[\"3DTILES_metadata\"];\n } else if (defined(subtreeJson.tileMetadata)) {\n const propertyTableIndex = subtreeJson.tileMetadata;\n tilePropertyTableJson = subtreeJson.propertyTables[propertyTableIndex];\n }\n\n const contentPropertyTableJsons = [];\n if (defined(subtreeJson.contentMetadata)) {\n const length = subtreeJson.contentMetadata.length;\n for (let i = 0; i < length; i++) {\n const propertyTableIndex = subtreeJson.contentMetadata[i];\n contentPropertyTableJsons.push(\n subtreeJson.propertyTables[propertyTableIndex]\n );\n }\n }\n\n let metadata;\n const schema = implicitTileset.metadataSchema;\n const subtreeMetadata = subtreeJson.subtreeMetadata;\n if (defined(subtreeMetadata)) {\n const metadataClass = subtreeMetadata.class;\n const subtreeMetadataClass = schema.classes[metadataClass];\n metadata = new ImplicitSubtreeMetadata({\n subtreeMetadata: subtreeMetadata,\n class: subtreeMetadataClass,\n });\n }\n\n subtree._metadata = metadata;\n subtree._tilePropertyTableJson = tilePropertyTableJson;\n subtree._contentPropertyTableJsons = contentPropertyTableJsons;\n\n // if no contentAvailability is specified, no tile in the subtree has\n // content\n const defaultContentAvailability = {\n constant: 0,\n };\n\n // In 3D Tiles 1.1, content availability is provided in an array in the subtree JSON\n // regardless of whether or not it contains multiple contents. This differs from previous\n // schemas, where content availability is either a single object in the subtree JSON or\n // as an array in the 3DTILES_multiple_contents extension.\n //\n // After identifying how availability is stored, put the results in this new array for consistent processing later\n subtreeJson.contentAvailabilityHeaders = [];\n if (hasExtension(subtreeJson, \"3DTILES_multiple_contents\")) {\n subtreeJson.contentAvailabilityHeaders =\n subtreeJson.extensions[\"3DTILES_multiple_contents\"].contentAvailability;\n } else if (Array.isArray(subtreeJson.contentAvailability)) {\n subtreeJson.contentAvailabilityHeaders = subtreeJson.contentAvailability;\n } else {\n subtreeJson.contentAvailabilityHeaders.push(\n defaultValue(subtreeJson.contentAvailability, defaultContentAvailability)\n );\n }\n\n const bufferHeaders = preprocessBuffers(subtreeJson.buffers);\n const bufferViewHeaders = preprocessBufferViews(\n subtreeJson.bufferViews,\n bufferHeaders\n );\n\n // Buffers and buffer views are inactive until explicitly marked active.\n // This way we can avoid fetching buffers that will not be used.\n markActiveBufferViews(subtreeJson, bufferViewHeaders);\n if (defined(tilePropertyTableJson)) {\n markActiveMetadataBufferViews(tilePropertyTableJson, bufferViewHeaders);\n }\n\n for (let i = 0; i < contentPropertyTableJsons.length; i++) {\n const contentPropertyTableJson = contentPropertyTableJsons[i];\n markActiveMetadataBufferViews(contentPropertyTableJson, bufferViewHeaders);\n }\n\n return requestActiveBuffers(subtree, bufferHeaders, chunks.binary).then(\n function (buffersU8) {\n const bufferViewsU8 = parseActiveBufferViews(\n bufferViewHeaders,\n buffersU8\n );\n parseAvailability(subtree, subtreeJson, implicitTileset, bufferViewsU8);\n\n if (defined(tilePropertyTableJson)) {\n parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8);\n makeTileJumpBuffer(subtree);\n }\n\n parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8);\n makeContentJumpBuffers(subtree);\n\n return subtree;\n }\n );\n}\n\n/**\n * A helper object for storing the two parts of the subtree binary\n *\n * @typedef {Object} SubtreeChunks\n * @property {Object} json The json chunk of the subtree\n * @property {Uint8Array} binary The binary chunk of the subtree. This represents the internal buffer.\n * @private\n */\n\n/**\n * Given the binary contents of a subtree, split into JSON and binary chunks\n *\n * @param {Uint8Array} subtreeView The subtree binary\n * @returns {SubtreeChunks} An object containing the JSON and binary chunks.\n * @private\n */\nfunction parseSubtreeChunks(subtreeView) {\n // Parse the header\n const littleEndian = true;\n const subtreeReader = new DataView(\n subtreeView.buffer,\n subtreeView.byteOffset\n );\n // Skip to the chunk lengths\n let byteOffset = 8;\n\n // Read the bottom 32 bits of the 64-bit byte length. This is ok for now because:\n // 1) not all browsers have native 64-bit operations\n // 2) the data is well under 4GB\n const jsonByteLength = subtreeReader.getUint32(byteOffset, littleEndian);\n byteOffset += 8;\n const binaryByteLength = subtreeReader.getUint32(byteOffset, littleEndian);\n byteOffset += 8;\n\n const subtreeJson = getJsonFromTypedArray(\n subtreeView,\n byteOffset,\n jsonByteLength\n );\n byteOffset += jsonByteLength;\n const subtreeBinary = subtreeView.subarray(\n byteOffset,\n byteOffset + binaryByteLength\n );\n\n return {\n json: subtreeJson,\n binary: subtreeBinary,\n };\n}\n\n/**\n * A buffer header is the JSON header from the subtree JSON chunk plus\n * a couple extra boolean flags for easy reference.\n *\n * Buffers are assumed inactive until explicitly marked active. This is used\n * to avoid fetching unneeded buffers.\n *\n * @typedef {Object} BufferHeader\n * @property {Boolean} isExternal True if this is an external buffer\n * @property {Boolean} isActive Whether this buffer is currently used.\n * @property {String} [uri] The URI of the buffer (external buffers only)\n * @property {Number} byteLength The byte length of the buffer, including any padding contained within.\n * @private\n */\n\n/**\n * Iterate over the list of buffers from the subtree JSON and add the\n * isExternal and isActive fields for easier parsing later. This modifies\n * the objects in place.\n *\n * @param {Object[]} [bufferHeaders=[]] The JSON from subtreeJson.buffers.\n * @returns {BufferHeader[]} The same array of headers with additional fields.\n * @private\n */\nfunction preprocessBuffers(bufferHeaders) {\n bufferHeaders = defined(bufferHeaders) ? bufferHeaders : [];\n for (let i = 0; i < bufferHeaders.length; i++) {\n const bufferHeader = bufferHeaders[i];\n bufferHeader.isExternal = defined(bufferHeader.uri);\n bufferHeader.isActive = false;\n }\n\n return bufferHeaders;\n}\n\n/**\n * A buffer header is the JSON header from the subtree JSON chunk plus\n * the isActive flag and a reference to the header for the underlying buffer\n *\n * @typedef {Object} BufferViewHeader\n * @property {BufferHeader} bufferHeader A reference to the header for the underlying buffer\n * @property {Boolean} isActive Whether this bufferView is currently used.\n * @property {Number} buffer The index of the underlying buffer.\n * @property {Number} byteOffset The start byte of the bufferView within the buffer.\n * @property {Number} byteLength The length of the bufferView. No padding is included in this length.\n * @private\n */\n\n/**\n * Iterate the list of buffer views from the subtree JSON and add the\n * isActive flag. Also save a reference to the bufferHeader\n *\n * @param {Object[]} [bufferViewHeaders=[]] The JSON from subtree.bufferViews\n * @param {BufferHeader[]} bufferHeaders The preprocessed buffer headers\n * @returns {BufferViewHeader[]} The same array of bufferView headers with additional fields\n * @private\n */\nfunction preprocessBufferViews(bufferViewHeaders, bufferHeaders) {\n bufferViewHeaders = defined(bufferViewHeaders) ? bufferViewHeaders : [];\n for (let i = 0; i < bufferViewHeaders.length; i++) {\n const bufferViewHeader = bufferViewHeaders[i];\n const bufferHeader = bufferHeaders[bufferViewHeader.buffer];\n bufferViewHeader.bufferHeader = bufferHeader;\n bufferViewHeader.isActive = false;\n }\n return bufferViewHeaders;\n}\n\n/**\n * Determine which buffer views need to be loaded into memory. This includes:\n *\n * <ul>\n * <li>The tile availability bitstream (if a bitstream is defined)</li>\n * <li>The content availability bitstream(s) (if a bitstream is defined)</li>\n * <li>The child subtree availability bitstream (if a bitstream is defined)</li>\n * </ul>\n *\n * <p>\n * This function modifies the buffer view headers' isActive flags in place.\n * </p>\n *\n * @param {Object[]} subtreeJson The JSON chunk from the subtree\n * @param {BufferViewHeader[]} bufferViewHeaders The preprocessed buffer view headers\n * @private\n */\nfunction markActiveBufferViews(subtreeJson, bufferViewHeaders) {\n let header;\n const tileAvailabilityHeader = subtreeJson.tileAvailability;\n\n // Check for bitstream first, which is part of the current schema.\n // bufferView is the name of the bitstream from an older schema.\n if (defined(tileAvailabilityHeader.bitstream)) {\n header = bufferViewHeaders[tileAvailabilityHeader.bitstream];\n } else if (defined(tileAvailabilityHeader.bufferView)) {\n header = bufferViewHeaders[tileAvailabilityHeader.bufferView];\n }\n\n if (defined(header)) {\n header.isActive = true;\n header.bufferHeader.isActive = true;\n }\n\n const contentAvailabilityHeaders = subtreeJson.contentAvailabilityHeaders;\n for (let i = 0; i < contentAvailabilityHeaders.length; i++) {\n header = undefined;\n if (defined(contentAvailabilityHeaders[i].bitstream)) {\n header = bufferViewHeaders[contentAvailabilityHeaders[i].bitstream];\n } else if (defined(contentAvailabilityHeaders[i].bufferView)) {\n header = bufferViewHeaders[contentAvailabilityHeaders[i].bufferView];\n }\n\n if (defined(header)) {\n header.isActive = true;\n header.bufferHeader.isActive = true;\n }\n }\n\n header = undefined;\n const childSubtreeAvailabilityHeader = subtreeJson.childSubtreeAvailability;\n if (defined(childSubtreeAvailabilityHeader.bitstream)) {\n header = bufferViewHeaders[childSubtreeAvailabilityHeader.bitstream];\n } else if (defined(childSubtreeAvailabilityHeader.bufferView)) {\n header = bufferViewHeaders[childSubtreeAvailabilityHeader.bufferView];\n }\n\n if (defined(header)) {\n header.isActive = true;\n header.bufferHeader.isActive = true;\n }\n}\n\n/**\n * For handling metadata, look over the tile and content metadata buffers\n * <p>\n * This always loads all of the metadata immediately. Future iterations may\n * allow filtering this to avoid downloading unneeded buffers.\n * </p>\n *\n * @param {Object} propertyTableJson The property table JSON for either a tile or some content\n * @param {BufferViewHeader[]} bufferViewHeaders The preprocessed buffer view headers\n * @private\n */\nfunction markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) {\n const properties = propertyTableJson.properties;\n let header;\n for (const key in properties) {\n if (properties.hasOwnProperty(key)) {\n const metadataHeader = properties[key];\n\n // An older spec used bufferView\n const valuesBufferView = defaultValue(\n metadataHeader.values,\n metadataHeader.bufferView\n );\n header = bufferViewHeaders[valuesBufferView];\n header.isActive = true;\n header.bufferHeader.isActive = true;\n\n // An older spec used stringOffsetBufferView\n const stringOffsetBufferView = defaultValue(\n metadataHeader.stringOffsets,\n metadataHeader.stringOffsetBufferView\n );\n if (defined(stringOffsetBufferView)) {\n header = bufferViewHeaders[stringOffsetBufferView];\n header.isActive = true;\n header.bufferHeader.isActive = true;\n }\n\n // an older spec used arrayOffsetBufferView\n const arrayOffsetBufferView = defaultValue(\n metadataHeader.arrayOffsets,\n metadataHeader.arrayOffsetBufferView\n );\n if (defined(arrayOffsetBufferView)) {\n header = bufferViewHeaders[arrayOffsetBufferView];\n header.isActive = true;\n header.bufferHeader.isActive = true;\n }\n }\n }\n}\n\n/**\n * Go through the list of buffers and gather all the active ones into a\n * a dictionary. Since external buffers are allowed, this sometimes involves\n * fetching separate binary files. Consequently, this method returns a promise.\n * <p>\n * The results are put into a dictionary object. The keys are indices of\n * buffers, and the values are Uint8Arrays of the contents. Only buffers\n * marked with the isActive flag are fetched.\n * </p>\n * <p>\n * The internal buffer (the subtree's binary chunk) is also stored in this\n * dictionary if it is marked active.\n * </p>\n * @param {ImplicitSubtree} subtree The subtree\n * @param {BufferHeader[]} bufferHeaders The preprocessed buffer headers\n * @param {Uint8Array} internalBuffer The binary chunk of the subtree file\n * @returns {Promise<Object>} A promise resolving to the dictionary of active buffers\n * @private\n */\nfunction requestActiveBuffers(subtree, bufferHeaders, internalBuffer) {\n const promises = [];\n for (let i = 0; i < bufferHeaders.length; i++) {\n const bufferHeader = bufferHeaders[i];\n if (!bufferHeader.isActive) {\n promises.push(Promise.resolve(undefined));\n } else if (bufferHeader.isExternal) {\n const promise = requestExternalBuffer(subtree, bufferHeader);\n promises.push(promise);\n } else {\n promises.push(Promise.resolve(internalBuffer));\n }\n }\n return Promise.all(promises).then(function (bufferResults) {\n const buffersU8 = {};\n for (let i = 0; i < bufferResults.length; i++) {\n const result = bufferResults[i];\n if (defined(result)) {\n buffersU8[i] = result;\n }\n }\n return buffersU8;\n });\n}\n\nfunction requestExternalBuffer(subtree, bufferHeader) {\n const baseResource = subtree._resource;\n const bufferResource = baseResource.getDerivedResource({\n url: bufferHeader.uri,\n });\n\n const bufferLoader = ResourceCache.loadExternalBuffer({\n resource: bufferResource,\n });\n subtree._bufferLoader = bufferLoader;\n\n return bufferLoader.promise.then(function (bufferLoader) {\n return bufferLoader.typedArray;\n });\n}\n\n/**\n * Go through the list of buffer views, and if they are marked as active,\n * extract a subarray from one of the active buffers.\n *\n * @param {BufferViewHeader[]} bufferViewHeaders\n * @param {Object} buffersU8 A dictionary of buffer index to a Uint8Array of its contents.\n * @returns {Object} A dictionary of buffer view index to a Uint8Array of its contents.\n * @private\n */\nfunction parseActiveBufferViews(bufferViewHeaders, buffersU8) {\n const bufferViewsU8 = {};\n for (let i = 0; i < bufferViewHeaders.length; i++) {\n const bufferViewHeader = bufferViewHeaders[i];\n\n if (!bufferViewHeader.isActive) {\n continue;\n }\n\n const start = bufferViewHeader.byteOffset;\n const end = start + bufferViewHeader.byteLength;\n const buffer = buffersU8[bufferViewHeader.buffer];\n const bufferView = buffer.subarray(start, end);\n bufferViewsU8[i] = bufferView;\n }\n return bufferViewsU8;\n}\n\n/**\n * Parse the three availability bitstreams and store them in the subtree\n *\n * @param {ImplicitSubtree} subtree The subtree to modify\n * @param {Object} subtreeJson The subtree JSON\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to\n * @param {Object} bufferViewsU8 A dictionary of buffer view index to a Uint8Array of its contents.\n * @private\n */\nfunction parseAvailability(\n subtree,\n subtreeJson,\n implicitTileset,\n bufferViewsU8\n) {\n const branchingFactor = implicitTileset.branchingFactor;\n const subtreeLevels = implicitTileset.subtreeLevels;\n const tileAvailabilityBits =\n (Math.pow(branchingFactor, subtreeLevels) - 1) / (branchingFactor - 1);\n const childSubtreeBits = Math.pow(branchingFactor, subtreeLevels);\n\n // availableCount is only needed for the metadata jump buffer, which\n // corresponds to the tile availability bitstream.\n const hasMetadataExtension = hasExtension(subtreeJson, \"3DTILES_metadata\");\n const hasTileMetadata = defined(subtree._tilePropertyTableJson);\n let computeAvailableCountEnabled = hasMetadataExtension || hasTileMetadata;\n\n subtree._tileAvailability = parseAvailabilityBitstream(\n subtreeJson.tileAvailability,\n bufferViewsU8,\n tileAvailabilityBits,\n computeAvailableCountEnabled\n );\n\n const hasContentMetadata = subtree._contentPropertyTableJsons.length > 0;\n computeAvailableCountEnabled =\n computeAvailableCountEnabled || hasContentMetadata;\n\n for (let i = 0; i < subtreeJson.contentAvailabilityHeaders.length; i++) {\n const bitstream = parseAvailabilityBitstream(\n subtreeJson.contentAvailabilityHeaders[i],\n bufferViewsU8,\n // content availability has the same length as tile availability.\n tileAvailabilityBits,\n computeAvailableCountEnabled\n );\n subtree._contentAvailabilityBitstreams.push(bitstream);\n }\n\n subtree._childSubtreeAvailability = parseAvailabilityBitstream(\n subtreeJson.childSubtreeAvailability,\n bufferViewsU8,\n childSubtreeBits\n );\n}\n\n/**\n * Given the JSON describing an availability bitstream, turn it into an\n * in-memory representation using an {@link ImplicitAvailabilityBitstream}\n * object. This handles both constants and bitstreams from a bufferView.\n *\n * @param {Object} availabilityJson A JSON object representing the availability\n * @param {Object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @param {Number} lengthBits The length of the availability bitstream in bits\n * @param {Boolean} [computeAvailableCountEnabled] If true and availabilityJson.availableCount is undefined, the availableCount will be computed.\n * @returns {ImplicitAvailabilityBitstream} The parsed bitstream object\n * @private\n */\nfunction parseAvailabilityBitstream(\n availabilityJson,\n bufferViewsU8,\n lengthBits,\n computeAvailableCountEnabled\n) {\n if (defined(availabilityJson.constant)) {\n return new ImplicitAvailabilityBitstream({\n constant: Boolean(availabilityJson.constant),\n lengthBits: lengthBits,\n availableCount: availabilityJson.availableCount,\n });\n }\n\n let bufferView;\n\n // Check for bitstream first, which is part of the current schema.\n // bufferView is the name of the bitstream from an older schema.\n if (defined(availabilityJson.bitstream)) {\n bufferView = bufferViewsU8[availabilityJson.bitstream];\n } else if (defined(availabilityJson.bufferView)) {\n bufferView = bufferViewsU8[availabilityJson.bufferView];\n }\n\n return new ImplicitAvailabilityBitstream({\n bitstream: bufferView,\n lengthBits: lengthBits,\n availableCount: availabilityJson.availableCount,\n computeAvailableCountEnabled: computeAvailableCountEnabled,\n });\n}\n\n/**\n * Parse the metadata table for the tile metadata, storing a {@link MetadataTable}\n * in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @param {Object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @private\n */\nfunction parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8) {\n const tilePropertyTableJson = subtree._tilePropertyTableJson;\n const tileCount = subtree._tileAvailability.availableCount;\n const metadataSchema = implicitTileset.metadataSchema;\n\n const tileMetadataClassName = tilePropertyTableJson.class;\n const tileMetadataClass = metadataSchema.classes[tileMetadataClassName];\n\n subtree._tileMetadataTable = new MetadataTable({\n class: tileMetadataClass,\n count: tileCount,\n properties: tilePropertyTableJson.properties,\n bufferViews: bufferViewsU8,\n });\n}\n\n/**\n * Parse the metadata tables for the content metadata, storing an array of\n * {@link MetadataTable}s in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileset} implicitTileset The implicit tileset this subtree belongs to.\n * @param {Object} bufferViewsU8 A dictionary of bufferView index to its Uint8Array contents.\n * @private\n */\nfunction parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8) {\n const contentPropertyTableJsons = subtree._contentPropertyTableJsons;\n const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;\n const metadataSchema = implicitTileset.metadataSchema;\n\n const contentMetadataTables = subtree._contentMetadataTables;\n for (let i = 0; i < contentPropertyTableJsons.length; i++) {\n const contentPropertyTableJson = contentPropertyTableJsons[i];\n const contentAvailabilityBitsteam = contentAvailabilityBitstreams[i];\n\n const contentCount = contentAvailabilityBitsteam.availableCount;\n const contentMetadataClassName = contentPropertyTableJson.class;\n const contentMetadataClass =\n metadataSchema.classes[contentMetadataClassName];\n\n const metadataTable = new MetadataTable({\n class: contentMetadataClass,\n count: contentCount,\n properties: contentPropertyTableJson.properties,\n bufferViews: bufferViewsU8,\n });\n\n contentMetadataTables.push(metadataTable);\n }\n}\n\n/**\n * Make a jump buffer, i.e. a map of a bit index to the metadata entity ID.\n * <p>\n * For unavailable tiles and content, the jump buffer entries will be uninitialized.\n * Use the tile and content availability to determine whether a jump buffer value is valid.\n * </p>\n *\n * @param {ImplicitAvailabilityBitstream} availability The availability bitstream to create the jump buffer from.\n * @returns {Array} The resulting jump buffer.\n * @private\n */\nfunction makeJumpBuffer(availability) {\n let entityId = 0;\n const bufferLength = availability.lengthBits;\n const availableCount = availability.availableCount;\n\n let jumpBuffer;\n if (availableCount < 256) {\n jumpBuffer = new Uint8Array(bufferLength);\n } else if (availableCount < 65536) {\n jumpBuffer = new Uint16Array(bufferLength);\n } else {\n jumpBuffer = new Uint32Array(bufferLength);\n }\n\n for (let i = 0; i < availability.lengthBits; i++) {\n if (availability.getBit(i)) {\n jumpBuffer[i] = entityId;\n entityId++;\n }\n }\n\n return jumpBuffer;\n}\n\n/**\n * Make the jump buffer, i.e. a map of a bit index to the metadata entity ID,\n * for the content metadata. This is stored in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @private\n */\nfunction makeTileJumpBuffer(subtree) {\n const tileJumpBuffer = makeJumpBuffer(subtree._tileAvailability);\n subtree._tileJumpBuffer = tileJumpBuffer;\n}\n\n/**\n * Make the jump buffers, i.e. maps of bit indices to the metadata entity IDs,\n * for the content metadata. This is stored in the subtree.\n *\n * @param {ImplicitSubtree} subtree The subtree\n * @private\n */\nfunction makeContentJumpBuffers(subtree) {\n const contentJumpBuffers = subtree._contentJumpBuffers;\n const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;\n for (let i = 0; i < contentAvailabilityBitstreams.length; i++) {\n const contentAvailability = contentAvailabilityBitstreams[i];\n const contentJumpBuffer = makeJumpBuffer(contentAvailability);\n contentJumpBuffers.push(contentJumpBuffer);\n }\n}\n\n/**\n * Given the implicit tiling coordinates for a tile, get the index within the\n * subtree's tile availability bitstream.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {Number} The tile's index within the subtree.\n * @private\n */\nImplicitSubtree.prototype.getTileIndex = function (implicitCoordinates) {\n const localLevel =\n implicitCoordinates.level - this._implicitCoordinates.level;\n if (localLevel < 0 || this._subtreeLevels <= localLevel) {\n throw new RuntimeError(\"level is out of bounds for this subtree\");\n }\n\n const subtreeCoordinates = implicitCoordinates.getSubtreeCoordinates();\n const offsetCoordinates = subtreeCoordinates.getOffsetCoordinates(\n implicitCoordinates\n );\n const index = offsetCoordinates.tileIndex;\n return index;\n};\n\n/**\n * Given the implicit tiling coordinates for a child subtree, get the index within the\n * subtree's child subtree availability bitstream.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a child subtree\n * @return {Number} The child subtree's index within the subtree's child subtree availability bitstream.\n * @private\n */\nImplicitSubtree.prototype.getChildSubtreeIndex = function (\n implicitCoordinates\n) {\n const localLevel =\n implicitCoordinates.level - this._implicitCoordinates.level;\n if (localLevel !== this._implicitCoordinates.subtreeLevels) {\n throw new RuntimeError(\"level is out of bounds for this subtree\");\n }\n\n // Call getParentSubtreeCoordinates instead of getSubtreeCoordinates because the\n // child subtree is by definition the root of its own subtree, so we need to find\n // the parent subtree.\n const parentSubtreeCoordinates = implicitCoordinates.getParentSubtreeCoordinates();\n const offsetCoordinates = parentSubtreeCoordinates.getOffsetCoordinates(\n implicitCoordinates\n );\n const index = offsetCoordinates.mortonIndex;\n return index;\n};\n\n/**\n * Get the entity ID for a tile within this subtree.\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {Number} The entity ID for this tile for accessing tile metadata, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nfunction getTileEntityId(subtree, implicitCoordinates) {\n if (!defined(subtree._tileMetadataTable)) {\n return undefined;\n }\n\n const tileIndex = subtree.getTileIndex(implicitCoordinates);\n if (subtree._tileAvailability.getBit(tileIndex)) {\n return subtree._tileJumpBuffer[tileIndex];\n }\n\n return undefined;\n}\n\n/**\n * Get the entity ID for a content within this subtree.\n * @param {ImplicitSubtree} subtree The subtree\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a content\n * @param {Number} contentIndex The content index, for distinguishing between multiple contents.\n * @return {Number} The entity ID for this content for accessing content metadata, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nfunction getContentEntityId(subtree, implicitCoordinates, contentIndex) {\n const metadataTables = subtree._contentMetadataTables;\n if (!defined(metadataTables)) {\n return undefined;\n }\n\n const metadataTable = metadataTables[contentIndex];\n if (!defined(metadataTable)) {\n return undefined;\n }\n\n const availability = subtree._contentAvailabilityBitstreams[contentIndex];\n const tileIndex = subtree.getTileIndex(implicitCoordinates);\n if (availability.getBit(tileIndex)) {\n const contentJumpBuffer = subtree._contentJumpBuffers[contentIndex];\n return contentJumpBuffer[tileIndex];\n }\n\n return undefined;\n}\n\n/**\n * Create and return a metadata table view for a tile within this subtree.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a tile\n * @return {ImplicitMetadataView} The metadata view for this tile, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nImplicitSubtree.prototype.getTileMetadataView = function (implicitCoordinates) {\n const entityId = getTileEntityId(this, implicitCoordinates);\n if (!defined(entityId)) {\n return undefined;\n }\n\n const metadataTable = this._tileMetadataTable;\n return new ImplicitMetadataView({\n class: metadataTable.class,\n metadataTable: metadataTable,\n entityId: entityId,\n propertyTableJson: this._tilePropertyTableJson,\n });\n};\n\n/**\n * Create and return a metadata table view for a content within this subtree.\n * @param {ImplicitTileCoordinates} implicitCoordinates The global coordinates of a content\n * @param {Number} contentIndex The index of the content used to distinguish between multiple contents\n * @return {ImplicitMetadataView} The metadata view for this content, or <code>undefined</code> if not applicable.\n *\n * @private\n */\nImplicitSubtree.prototype.getContentMetadataView = function (\n implicitCoordinates,\n contentIndex\n) {\n const entityId = getContentEntityId(this, implicitCoordinates, contentIndex);\n if (!defined(entityId)) {\n return undefined;\n }\n\n const metadataTable = this._contentMetadataTables[contentIndex];\n const propertyTableJson = this._contentPropertyTableJsons[contentIndex];\n return new ImplicitMetadataView({\n class: metadataTable.class,\n metadataTable: metadataTable,\n entityId: entityId,\n contentIndex: contentIndex,\n propertyTableJson: propertyTableJson,\n });\n};\n\n/**\n * @private\n */\nImplicitSubtree.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * @private\n */\nImplicitSubtree.prototype.destroy = function () {\n if (defined(this._bufferLoader)) {\n ResourceCache.unload(this._bufferLoader);\n }\n\n return destroyObject(this);\n};\n\nexport default ImplicitSubtree;\n", "/**\n * An enum of built-in semantics.\n *\n * @enum MetadataSemantic\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference}\n */\nconst MetadataSemantic = {\n /**\n * A unique identifier, stored as a <code>STRING</code>.\n *\n * @type {String}\n * @constant\n * @private\n */\n ID: \"ID\",\n /**\n * A name, stored as a <code>STRING</code>. This does not have to be unique.\n *\n * @type {String}\n * @constant\n * @private\n */\n NAME: \"NAME\",\n /**\n * A description, stored as a <code>STRING</code>.\n *\n * @type {String}\n * @constant\n * @private\n */\n DESCRIPTION: \"DESCRIPTION\",\n /**\n * A bounding box for a tile, stored as an array of 12 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are the same format as for <code>boundingVolume.box</code> in 3D Tiles 1.0. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_BOUNDING_BOX: \"TILE_BOUNDING_BOX\",\n /**\n * A bounding region for a tile, stored as an array of 6 <code>FLOAT64</code> components. The components are <code>[west, south, east, north, minimumHeight, maximumHeight]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_BOUNDING_REGION: \"TILE_BOUNDING_REGION\",\n /**\n * A bounding sphere for a tile, stored as an array of 4 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are <code>[centerX, centerY, centerZ, radius]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_BOUNDING_SPHERE: \"TILE_BOUNDING_SPHERE\",\n /**\n * The minimum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_MINIMUM_HEIGHT: \"TILE_MINIMUM_HEIGHT\",\n /**\n * The maximum height of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to tighten bounding regions implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_MAXIMUM_HEIGHT: \"TILE_MAXIMUM_HEIGHT\",\n /**\n * The horizon occlusion point for a tile, stored as an <code>VEC3</code> of <code>FLOAT32</code> or <code>FLOAT64</code> components.\n *\n * @see {@link https://cesium.com/blog/2013/04/25/horizon-culling/|Horizon Culling}\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_HORIZON_OCCLUSION_POINT: \"TILE_HORIZON_OCCLUSION_POINT\",\n /**\n * The geometric error for a tile, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>. This semantic is used to override the geometric error implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n TILE_GEOMETRIC_ERROR: \"TILE_GEOMETRIC_ERROR\",\n /**\n * A bounding box for the content of a tile, stored as an array of 12 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are the same format as for <code>boundingVolume.box</code> in 3D Tiles 1.0. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_BOUNDING_BOX: \"CONTENT_BOUNDING_BOX\",\n /**\n * A bounding region for the content of a tile, stored as an array of 6 <code>FLOAT64</code> components. The components are <code>[west, south, east, north, minimumHeight, maximumHeight]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_BOUNDING_REGION: \"CONTENT_BOUNDING_REGION\",\n /**\n * A bounding sphere for the content of a tile, stored as an array of 4 <code>FLOAT32</code> or <code>FLOAT64</code> components. The components are <code>[centerX, centerY, centerZ, radius]</code>. This semantic is used to provide a tighter bounding volume than the one implicitly calculated in implicit tiling.\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_BOUNDING_SPHERE: \"CONTENT_BOUNDING_SPHERE\",\n /**\n * The minimum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_MINIMUM_HEIGHT: \"CONTENT_MINIMUM_HEIGHT\",\n /**\n * The maximum height of the content of a tile above (or below) the WGS84 ellipsoid, stored as a <code>FLOAT32</code> or a <code>FLOAT64</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_MAXIMUM_HEIGHT: \"CONTENT_MAXIMUM_HEIGHT\",\n /**\n * The horizon occlusion point for the content of a tile, stored as an <code>VEC3</code> of <code>FLOAT32</code> or <code>FLOAT64</code> components.\n *\n * @see {@link https://cesium.com/blog/2013/04/25/horizon-culling/|Horizon Culling}\n *\n * @type {String}\n * @constant\n * @private\n */\n CONTENT_HORIZON_OCCLUSION_POINT: \"CONTENT_HORIZON_OCCLUSION_POINT\",\n};\n\nexport default Object.freeze(MetadataSemantic);\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * Parse the bounding volume-related semantics such as\n * <code>TILE_BOUNDING_BOX</code> and <code>CONTENT_BOUNDING_REGION</code> from\n * implicit tile metadata. Results are returned as a JSON object for use when\n * transcoding tiles (see {@link Implicit3DTileContent}).\n * <p>\n * Bounding volumes are checked in the order box, region, then sphere. Only\n * the first valid bounding volume is returned.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata/Semantics|3D Metadata Semantic Reference} for the various bounding volumes and minimum/maximum heights.\n *\n * @param {TileMetadata} tileMetadata The metadata object for looking up values by semantic. In practice, this will typically be a {@link ImplicitMetadataView}\n * @return {Object} An object containing a <code>tile</code> property and a <code>content</code> property. These contain the bounding volume, and any minimum or maximum height.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseBoundingVolumeSemantics(tileMetadata) {\n return {\n tile: {\n boundingVolume: parseBoundingVolume(\"TILE\", tileMetadata),\n minimumHeight: parseMinimumHeight(\"TILE\", tileMetadata),\n maximumHeight: parseMaximumHeight(\"TILE\", tileMetadata),\n },\n content: {\n boundingVolume: parseBoundingVolume(\"CONTENT\", tileMetadata),\n minimumHeight: parseMinimumHeight(\"CONTENT\", tileMetadata),\n maximumHeight: parseMaximumHeight(\"CONTENT\", tileMetadata),\n },\n };\n}\n\n/**\n * Parse the bounding volume from a tile metadata. If the metadata specify\n * multiple bounding volumes, only the first one is returned. Bounding volumes\n * are checked in the order box, region, then sphere.\n *\n * This handles both tile and content bounding volumes, as the only difference\n * is the prefix. e.g. <code>TILE_BOUNDING_BOX</code> and\n * <code>CONTENT_BOUNDING_BOX</code> have the same memory layout.\n *\n * @param {String} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {Object} An object representing the JSON description of the tile metadata\n * @private\n */\nfunction parseBoundingVolume(prefix, tileMetadata) {\n const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;\n const boundingBox = tileMetadata.getPropertyBySemantic(boundingBoxSemantic);\n\n if (defined(boundingBox)) {\n return {\n box: boundingBox,\n };\n }\n\n const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`;\n const boundingRegion = tileMetadata.getPropertyBySemantic(\n boundingRegionSemantic\n );\n\n if (defined(boundingRegion)) {\n return {\n region: boundingRegion,\n };\n }\n\n const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`;\n const boundingSphere = tileMetadata.getPropertyBySemantic(\n boundingSphereSemantic\n );\n\n if (defined(boundingSphere)) {\n // ARRAY with 4 elements is automatically converted to a Cartesian4\n return {\n sphere: boundingSphere,\n };\n }\n\n return undefined;\n}\n\n/**\n * Parse the minimum height from tile metadata. This is used for making tighter\n * quadtree bounds for implicit tiling. This works for both\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>CONTENT_MINIMUM_HEIGHT</code>\n *\n * @param {String} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {Number} The minimum height\n * @private\n */\nfunction parseMinimumHeight(prefix, tileMetadata) {\n const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;\n return tileMetadata.getPropertyBySemantic(minimumHeightSemantic);\n}\n\n/**\n * Parse the maximum height from tile metadata. This is used for making tighter\n * quadtree bounds for implicit tiling. This works for both\n * <code>TILE_MAXIMUM_HEIGHT</code> and <code>CONTENT_MAXIMUM_HEIGHT</code>\n *\n * @param {String} prefix Either \"TILE\" or \"CONTENT\"\n * @param {TileMetadata} tileMetadata The tileMetadata for looking up values\n * @return {Number} The maximum height\n * @private\n */\nfunction parseMaximumHeight(prefix, tileMetadata) {\n const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;\n return tileMetadata.getPropertyBySemantic(maximumHeightSemantic);\n}\n\nexport default parseBoundingVolumeSemantics;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport HilbertOrder from \"../Core/HilbertOrder.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport S2Cell from \"../Core/S2Cell.js\";\nimport ImplicitSubtree from \"./ImplicitSubtree.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport MetadataSemantic from \"./MetadataSemantic.js\";\nimport parseBoundingVolumeSemantics from \"./parseBoundingVolumeSemantics.js\";\n\n/**\n * A specialized {@link Cesium3DTileContent} that lazily evaluates an implicit\n * tileset. It is somewhat similar in operation to a\n * {@link Tileset3DTileContent} in that once the content is constructed, it\n * updates the tileset tree with more tiles. However, unlike external tilesets,\n * child subtrees are represented as additional placeholder nodes with\n * Implicit3DTileContent.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Implicit3DTileContent\n * @constructor\n *\n * @param {Cesium3DTileset} tileset The tileset this content belongs to\n * @param {Cesium3DTile} tile The tile this content belongs to.\n * @param {Resource} resource The resource for the tileset\n * @param {Object} [json] The JSON object containing the subtree. Mutually exclusive with arrayBuffer.\n * @param {ArrayBuffer} [arrayBuffer] The array buffer that stores the content payload. Mutually exclusive with json.\n * @param {Number} [byteOffset=0] The offset into the array buffer, if one was provided\n *\n * @exception {DeveloperError} One of json and arrayBuffer must be defined.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Implicit3DTileContent(\n tileset,\n tile,\n resource,\n json,\n arrayBuffer,\n byteOffset\n) {\n const implicitTileset = tile.implicitTileset;\n const implicitCoordinates = tile.implicitCoordinates;\n\n this._implicitTileset = implicitTileset;\n this._implicitCoordinates = implicitCoordinates;\n this._implicitSubtree = undefined;\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n\n this._metadata = undefined;\n\n this.featurePropertiesDirty = false;\n this._group = undefined;\n\n const templateValues = implicitCoordinates.getTemplateValues();\n const subtreeResource = implicitTileset.subtreeUriTemplate.getDerivedResource(\n {\n templateValues: templateValues,\n }\n );\n this._url = subtreeResource.getUrlComponent(true);\n\n this._readyPromise = initialize(this, json, arrayBuffer, byteOffset);\n}\n\nObject.defineProperties(Implicit3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n return 0;\n },\n },\n\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n trianglesLength: {\n get: function () {\n return 0;\n },\n },\n\n geometryByteLength: {\n get: function () {\n return 0;\n },\n },\n\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n return 0;\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._url;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Implicit3DTileContent</code>\n * always returns <code>undefined</code>. Only transcoded tiles have content metadata.\n * @memberof Implicit3DTileContent.prototype\n * @private\n */\n metadata: {\n get: function () {\n return undefined;\n },\n set: function () {\n},\n },\n\n batchTable: {\n get: function () {\n return undefined;\n },\n },\n\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n },\n },\n});\n\n/**\n * Initialize the implicit content by parsing the subtree resource and setting\n * up a promise chain to expand the immediate subtree.\n *\n * @param {Implicit3DTileContent} content The implicit content\n * @param {Object} [json] The JSON containing the subtree. Mutually exclusive with arrayBuffer.\n * @param {ArrayBuffer} [arrayBuffer] The ArrayBuffer containing a subtree binary. Mutually exclusive with json.\n * @param {Number} [byteOffset=0] The byte offset into the arrayBuffer\n * @private\n */\nfunction initialize(content, json, arrayBuffer, byteOffset) {\n byteOffset = defaultValue(byteOffset, 0);\n let uint8Array;\n if (defined(arrayBuffer)) {\n uint8Array = new Uint8Array(arrayBuffer, byteOffset);\n }\n\n const subtree = new ImplicitSubtree(\n content._resource,\n json,\n uint8Array,\n content._implicitTileset,\n content._implicitCoordinates\n );\n\n content._implicitSubtree = subtree;\n return subtree.readyPromise.then(function () {\n expandSubtree(content, subtree);\n return content;\n });\n}\n\n/**\n * Expand a single subtree placeholder tile. This transcodes the subtree into\n * a tree of {@link Cesium3DTile}. The root of this tree is stored in\n * the placeholder tile's children array. This method also creates placeholder\n * tiles for the child subtrees to be lazily expanded as needed.\n *\n * @param {Implicit3DTileContent} content The content\n * @param {ImplicitSubtree} subtree The parsed subtree\n * @private\n */\nfunction expandSubtree(content, subtree) {\n const placeholderTile = content._tile;\n\n // Parse the tiles inside this immediate subtree\n const childIndex = content._implicitCoordinates.childIndex;\n const results = transcodeSubtreeTiles(\n content,\n subtree,\n placeholderTile,\n childIndex\n );\n\n const statistics = content._tileset.statistics;\n\n // Link the new subtree to the existing placeholder tile.\n placeholderTile.children.push(results.rootTile);\n statistics.numberOfTilesTotal++;\n\n // for each child subtree, make new placeholder tiles\n const childSubtrees = listChildSubtrees(content, subtree, results.bottomRow);\n for (let i = 0; i < childSubtrees.length; i++) {\n const subtreeLocator = childSubtrees[i];\n const leafTile = subtreeLocator.tile;\n const implicitChildTile = makePlaceholderChildSubtree(\n content,\n leafTile,\n subtreeLocator.childIndex\n );\n leafTile.children.push(implicitChildTile);\n statistics.numberOfTilesTotal++;\n }\n}\n\n/**\n * A pair of (tile, childIndex) used for finding child subtrees.\n *\n * @typedef {Object} ChildSubtreeLocator\n * @property {Cesium3DTile} tile One of the tiles in the bottommost row of the subtree.\n * @property {Number} childIndex The morton index of the child tile relative to its parent\n * @private\n */\n\n/**\n * Determine what child subtrees exist and return a list of information\n *\n * @param {Implicit3DTileContent} content The implicit content\n * @param {ImplicitSubtree} subtree The subtree for looking up availability\n * @param {Array<Cesium3DTile|undefined>} bottomRow The bottom row of tiles in a transcoded subtree\n * @returns {ChildSubtreeLocator[]} A list of identifiers for the child subtrees.\n * @private\n */\nfunction listChildSubtrees(content, subtree, bottomRow) {\n const results = [];\n const branchingFactor = content._implicitTileset.branchingFactor;\n for (let i = 0; i < bottomRow.length; i++) {\n const leafTile = bottomRow[i];\n if (!defined(leafTile)) {\n continue;\n }\n\n for (let j = 0; j < branchingFactor; j++) {\n const index = i * branchingFactor + j;\n if (subtree.childSubtreeIsAvailableAtIndex(index)) {\n results.push({\n tile: leafTile,\n childIndex: j,\n });\n }\n }\n }\n return results;\n}\n\n/**\n * Results of transcodeSubtreeTiles, containing the root tile of the\n * subtree and the bottom row of nodes for further processing.\n *\n * @typedef {Object} TranscodedSubtree\n * @property {Cesium3DTile} rootTile The transcoded root tile of the subtree\n * @property {Array<Cesium3DTile|undefined>} bottomRow The bottom row of transcoded tiles. This is helpful for processing child subtrees\n * @private\n */\n\n/**\n * Transcode the implicitly-defined tiles within this subtree and generate\n * explicit {@link Cesium3DTile} objects. This function only transcode tiles,\n * child subtrees are handled separately.\n *\n * @param {Implicit3DTileContent} content The implicit content\n * @param {ImplicitSubtree} subtree The subtree to get availability information\n * @param {Cesium3DTile} placeholderTile The placeholder tile, used for constructing the subtree root tile\n * @param {Number} childIndex The Morton index of the root tile relative to parentOfRootTile\n * @returns {TranscodedSubtree} The newly created subtree of tiles\n * @private\n */\nfunction transcodeSubtreeTiles(content, subtree, placeholderTile, childIndex) {\n const rootBitIndex = 0;\n const rootParentIsPlaceholder = true;\n const rootTile = deriveChildTile(\n content,\n subtree,\n placeholderTile,\n childIndex,\n rootBitIndex,\n rootParentIsPlaceholder\n );\n\n const statistics = content._tileset.statistics;\n\n // Sliding window over the levels of the tree.\n // Each row is branchingFactor * length of previous row\n // Tiles within a row are ordered by Morton index.\n let parentRow = [rootTile];\n let currentRow = [];\n\n const implicitTileset = content._implicitTileset;\n for (let level = 1; level < implicitTileset.subtreeLevels; level++) {\n const levelOffset = subtree.getLevelOffset(level);\n const numberOfChildren = implicitTileset.branchingFactor * parentRow.length;\n for (\n let childMortonIndex = 0;\n childMortonIndex < numberOfChildren;\n childMortonIndex++\n ) {\n const childBitIndex = levelOffset + childMortonIndex;\n\n if (!subtree.tileIsAvailableAtIndex(childBitIndex)) {\n currentRow.push(undefined);\n continue;\n }\n\n const parentMortonIndex = subtree.getParentMortonIndex(childMortonIndex);\n const parentTile = parentRow[parentMortonIndex];\n const childChildIndex =\n childMortonIndex % implicitTileset.branchingFactor;\n const childTile = deriveChildTile(\n content,\n subtree,\n parentTile,\n childChildIndex,\n childBitIndex\n );\n parentTile.children.push(childTile);\n statistics.numberOfTilesTotal++;\n currentRow.push(childTile);\n }\n\n parentRow = currentRow;\n currentRow = [];\n }\n\n return {\n rootTile: rootTile,\n // At the end of the last loop, bottomRow was moved to parentRow\n bottomRow: parentRow,\n };\n}\n\nfunction getGeometricError(tileMetadata, implicitTileset, implicitCoordinates) {\n const semantic = MetadataSemantic.TILE_GEOMETRIC_ERROR;\n\n if (defined(tileMetadata) && tileMetadata.hasPropertyBySemantic(semantic)) {\n return tileMetadata.getPropertyBySemantic(semantic);\n }\n\n return (\n implicitTileset.geometricError / Math.pow(2, implicitCoordinates.level)\n );\n}\n\n/**\n * Given a parent tile and information about which child to create, derive\n * the properties of the child tile implicitly.\n * <p>\n * This creates a real tile for rendering, not a placeholder tile like some of\n * the other methods of ImplicitTileset.\n * </p>\n *\n * @param {Implicit3DTileContent} implicitContent The implicit content\n * @param {ImplicitSubtree} subtree The subtree the child tile belongs to\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @param {Number} childBitIndex The index of the child tile within the tile's availability information.\n * @param {Boolean} [parentIsPlaceholderTile=false] True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @returns {Cesium3DTile} The new child tile.\n * @private\n */\nfunction deriveChildTile(\n implicitContent,\n subtree,\n parentTile,\n childIndex,\n childBitIndex,\n parentIsPlaceholderTile\n) {\n const implicitTileset = implicitContent._implicitTileset;\n let implicitCoordinates;\n if (defaultValue(parentIsPlaceholderTile, false)) {\n implicitCoordinates = parentTile.implicitCoordinates;\n } else {\n implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(\n childIndex\n );\n }\n\n // Parse metadata and bounding volume semantics at the beginning\n // as the bounding volumes are needed below.\n let tileMetadata;\n let tileBounds;\n let contentBounds;\n if (defined(subtree.tilePropertyTableJson)) {\n tileMetadata = subtree.getTileMetadataView(implicitCoordinates);\n\n const boundingVolumeSemantics = parseBoundingVolumeSemantics(tileMetadata);\n tileBounds = boundingVolumeSemantics.tile;\n contentBounds = boundingVolumeSemantics.content;\n }\n\n // Content is not loaded at this point, so this flag is set for future reference.\n const contentPropertyTableJsons = subtree.contentPropertyTableJsons;\n const length = contentPropertyTableJsons.length;\n let hasImplicitContentMetadata = false;\n for (let i = 0; i < length; i++) {\n if (subtree.contentIsAvailableAtCoordinates(implicitCoordinates, i)) {\n hasImplicitContentMetadata = true;\n break;\n }\n }\n\n const boundingVolume = getTileBoundingVolume(\n implicitTileset,\n implicitCoordinates,\n childIndex,\n parentIsPlaceholderTile,\n parentTile,\n tileBounds\n );\n\n const contentJsons = [];\n for (let i = 0; i < implicitTileset.contentCount; i++) {\n if (!subtree.contentIsAvailableAtIndex(childBitIndex, i)) {\n continue;\n }\n const childContentTemplate = implicitTileset.contentUriTemplates[i];\n const childContentUri = childContentTemplate.getDerivedResource({\n templateValues: implicitCoordinates.getTemplateValues(),\n }).url;\n const contentJson = {\n uri: childContentUri,\n };\n\n const contentBoundingVolume = getContentBoundingVolume(\n boundingVolume,\n contentBounds\n );\n\n if (defined(contentBoundingVolume)) {\n contentJson.boundingVolume = contentBoundingVolume;\n }\n\n // combine() is used to pass through any additional properties the\n // user specified such as extras or extensions\n contentJsons.push(combine(contentJson, implicitTileset.contentHeaders[i]));\n }\n\n const childGeometricError = getGeometricError(\n tileMetadata,\n implicitTileset,\n implicitCoordinates\n );\n\n const tileJson = {\n boundingVolume: boundingVolume,\n geometricError: childGeometricError,\n refine: implicitTileset.refine,\n contents: contentJsons,\n };\n\n // combine() is used to pass through any additional properties the\n // user specified such as extras or extensions.\n const deep = true;\n const rootHeader = clone(implicitTileset.tileHeader, deep);\n delete rootHeader.boundingVolume;\n delete rootHeader.transform;\n const combinedTileJson = combine(tileJson, rootHeader, deep);\n\n const childTile = makeTile(\n implicitContent,\n implicitTileset.baseResource,\n combinedTileJson,\n parentTile\n );\n\n childTile.implicitCoordinates = implicitCoordinates;\n childTile.implicitSubtree = subtree;\n childTile.metadata = tileMetadata;\n childTile.hasImplicitContentMetadata = hasImplicitContentMetadata;\n\n return childTile;\n}\n\n/**\n * Checks whether the bounding volume's heights can be updated.\n * Returns true if the minimumHeight/maximumHeight parameter\n * is defined and the bounding volume is a region or S2 cell.\n *\n * @param {Object} [boundingVolume] The bounding volume\n * @param {Object} [tileBounds] The tile bounds\n * @param {Number} [tileBounds.minimumHeight] The minimum height\n * @param {Number} [tileBounds.maximumHeight] The maximum height\n * @returns {Boolean} Whether the bounding volume's heights can be updated\n * @private\n */\nfunction canUpdateHeights(boundingVolume, tileBounds) {\n return (\n defined(boundingVolume) &&\n defined(tileBounds) &&\n (defined(tileBounds.minimumHeight) || defined(tileBounds.maximumHeight)) &&\n (hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\") ||\n defined(boundingVolume.region))\n );\n}\n\n/**\n * Update the minimum and maximum height of the bounding volume.\n * This is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined and the\n * bounding volume is a region or S2 cell.\n *\n * @param {Object} boundingVolume The bounding volume\n * @param {Object} [tileBounds] The tile bounds\n * @param {Number} [tileBounds.minimumHeight] The new minimum height\n * @param {Number} [tileBounds.maximumHeight] The new maximum height\n * @private\n */\nfunction updateHeights(boundingVolume, tileBounds) {\n if (!defined(tileBounds)) {\n return;\n }\n\n if (hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\")) {\n updateS2CellHeights(\n boundingVolume.extensions[\"3DTILES_bounding_volume_S2\"],\n tileBounds.minimumHeight,\n tileBounds.maximumHeight\n );\n } else if (defined(boundingVolume.region)) {\n updateRegionHeights(\n boundingVolume.region,\n tileBounds.minimumHeight,\n tileBounds.maximumHeight\n );\n }\n}\n\n/**\n * For a bounding region, update the minimum and maximum height. This\n * is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined.\n *\n * @param {Array} region A 6-element array describing the bounding region\n * @param {Number} [minimumHeight] The new minimum height\n * @param {Number} [maximumHeight] The new maximum height\n * @private\n */\nfunction updateRegionHeights(region, minimumHeight, maximumHeight) {\n if (defined(minimumHeight)) {\n region[4] = minimumHeight;\n }\n\n if (defined(maximumHeight)) {\n region[5] = maximumHeight;\n }\n}\n\n/**\n * For a bounding S2 cell, update the minimum and maximum height. This\n * is typically used to tighten a bounding volume using the\n * <code>TILE_MINIMUM_HEIGHT</code> and <code>TILE_MAXIMUM_HEIGHT</code>\n * semantics. Heights are only updated if the respective\n * minimumHeight/maximumHeight parameter is defined.\n *\n * @param {Object} s2CellVolume An object describing the S2 cell\n * @param {Number} [minimumHeight] The new minimum height\n * @param {Number} [maximumHeight] The new maximum height\n * @private\n */\nfunction updateS2CellHeights(s2CellVolume, minimumHeight, maximumHeight) {\n if (defined(minimumHeight)) {\n s2CellVolume.minimumHeight = minimumHeight;\n }\n\n if (defined(maximumHeight)) {\n s2CellVolume.maximumHeight = maximumHeight;\n }\n}\n\n/**\n * Gets the tile's bounding volume, which may be specified via\n * metadata semantics such as TILE_BOUNDING_BOX or implicitly\n * derived from the implicit root tile's bounding volume.\n * <p>\n * Priority of bounding volume types:\n * <ol>\n * <li>Explicit min/max height\n * <ol>\n * <li>With explicit region</li>\n * <li>With implicit S2</li>\n * <li>With implicit region</li>\n * </ol>\n * </li>\n * <li>Explicit box</li>\n * <li>Explicit region</li>\n * <li>Explicit sphere</li>\n * <li>Implicit S2</li>\n * <li>Implicit box</li>\n * <li>Implicit region</li>\n * </ol>\n * </p>\n *\n * @param {ImplicitTileset} implicitTileset The implicit tileset struct which holds the root bounding volume\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the child tile\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @param {Boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {Object} [tileBounds] The tile bounds\n * @returns {Object} An object containing the JSON for a bounding volume\n * @private\n */\nfunction getTileBoundingVolume(\n implicitTileset,\n implicitCoordinates,\n childIndex,\n parentIsPlaceholderTile,\n parentTile,\n tileBounds\n) {\n let boundingVolume;\n\n if (\n !defined(tileBounds) ||\n !defined(tileBounds.boundingVolume) ||\n (!canUpdateHeights(tileBounds.boundingVolume, tileBounds) &&\n canUpdateHeights(implicitTileset.boundingVolume, tileBounds))\n ) {\n boundingVolume = deriveBoundingVolume(\n implicitTileset,\n implicitCoordinates,\n childIndex,\n defaultValue(parentIsPlaceholderTile, false),\n parentTile\n );\n } else {\n boundingVolume = tileBounds.boundingVolume;\n }\n\n // The TILE_MINIMUM_HEIGHT and TILE_MAXIMUM_HEIGHT metadata semantics\n // can be used to tighten the bounding volume\n updateHeights(boundingVolume, tileBounds);\n\n return boundingVolume;\n}\n\n/**\n * Gets the content bounding volume, which may be specified via\n * metadata semantics such as CONTENT_BOUNDING_BOX.\n * <p>\n * Priority of bounding volume types:\n * <ol>\n * <li>Explicit min/max height\n * <ol>\n * <li>With explicit region</li>\n * <li>With tile bounding volume (S2 or region)</li>\n * </ol>\n * </li>\n * <li>Explicit box</li>\n * <li>Explicit region</li>\n * <li>Explicit sphere</li>\n * <li>Tile bounding volume (when content.boundingVolume is undefined)</li>\n * </ol>\n * </p>\n *\n * @param {Object} tileBoundingVolume An object containing the JSON for the tile's bounding volume\n * @param {Object} [contentBounds] The content bounds\n * @returns {Object|undefined} An object containing the JSON for a bounding volume, or <code>undefined</code> if there is no bounding volume\n * @private\n */\nfunction getContentBoundingVolume(tileBoundingVolume, contentBounds) {\n // content bounding volumes can only be specified via\n // metadata semantics such as CONTENT_BOUNDING_BOX\n let contentBoundingVolume;\n if (defined(contentBounds)) {\n contentBoundingVolume = contentBounds.boundingVolume;\n }\n\n // The CONTENT_MINIMUM_HEIGHT and CONTENT_MAXIMUM_HEIGHT metadata semantics\n // can be used to tighten the bounding volume\n if (canUpdateHeights(contentBoundingVolume, contentBounds)) {\n updateHeights(contentBoundingVolume, contentBounds);\n } else if (canUpdateHeights(tileBoundingVolume, contentBounds)) {\n contentBoundingVolume = clone(tileBoundingVolume, true);\n updateHeights(contentBoundingVolume, contentBounds);\n }\n\n return contentBoundingVolume;\n}\n\n/**\n * Given the coordinates of a tile, derive its bounding volume from the root.\n *\n * @param {ImplicitTileset} implicitTileset The implicit tileset struct which holds the root bounding volume\n * @param {ImplicitTileCoordinates} implicitCoordinates The coordinates of the child tile\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @param {Boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @returns {Object} An object containing the JSON for a bounding volume\n * @private\n */\nfunction deriveBoundingVolume(\n implicitTileset,\n implicitCoordinates,\n childIndex,\n parentIsPlaceholderTile,\n parentTile\n) {\n const rootBoundingVolume = implicitTileset.boundingVolume;\n\n if (hasExtension(rootBoundingVolume, \"3DTILES_bounding_volume_S2\")) {\n return deriveBoundingVolumeS2(\n parentIsPlaceholderTile,\n parentTile,\n childIndex,\n implicitCoordinates.level,\n implicitCoordinates.x,\n implicitCoordinates.y,\n implicitCoordinates.z\n );\n }\n\n if (defined(rootBoundingVolume.region)) {\n const childRegion = deriveBoundingRegion(\n rootBoundingVolume.region,\n implicitCoordinates.level,\n implicitCoordinates.x,\n implicitCoordinates.y,\n implicitCoordinates.z\n );\n\n return {\n region: childRegion,\n };\n }\n\n const childBox = deriveBoundingBox(\n rootBoundingVolume.box,\n implicitCoordinates.level,\n implicitCoordinates.x,\n implicitCoordinates.y,\n implicitCoordinates.z\n );\n\n return {\n box: childBox,\n };\n}\n\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (x, y), leaving the z axis unchanged.\n * </p>\n *\n * @param {Boolean} parentIsPlaceholderTile True if parentTile is a placeholder tile. This is true for the root of each subtree.\n * @param {Cesium3DTile} parentTile The parent of the new child tile\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @param {Number} level The level of the descendant tile relative to the root implicit tile\n * @param {Number} x The x coordinate of the descendant tile\n * @param {Number} y The y coordinate of the descendant tile\n * @param {Number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {Object} An object with the 3DTILES_bounding_volume_S2 extension.\n * @private\n */\nfunction deriveBoundingVolumeS2(\n parentIsPlaceholderTile,\n parentTile,\n childIndex,\n level,\n x,\n y,\n z\n) {\n const boundingVolumeS2 = parentTile._boundingVolume;\n\n // Handle the placeholder tile case, where we just duplicate the placeholder's bounding volume.\n if (parentIsPlaceholderTile) {\n return {\n extensions: {\n \"3DTILES_bounding_volume_S2\": {\n token: S2Cell.getTokenFromId(boundingVolumeS2.s2Cell._cellId),\n minimumHeight: boundingVolumeS2.minimumHeight,\n maximumHeight: boundingVolumeS2.maximumHeight,\n },\n },\n };\n }\n\n // Extract the first 3 face bits from the 64-bit S2 cell ID.\n // eslint-disable-next-line no-undef\n const face = Number(parentTile._boundingVolume.s2Cell._cellId >> BigInt(61));\n // The Hilbert curve is rotated for the \"odd\" faces on the S2 Earthcube.\n // See http://s2geometry.io/devguide/img/s2cell_global.jpg\n const position =\n face % 2 === 0\n ? HilbertOrder.encode2D(level, x, y)\n : HilbertOrder.encode2D(level, y, x);\n // eslint-disable-next-line no-undef\n const cell = S2Cell.fromFacePositionLevel(face, BigInt(position), level);\n\n let minHeight, maxHeight;\n if (defined(z)) {\n const midpointHeight =\n (boundingVolumeS2.maximumHeight + boundingVolumeS2.minimumHeight) / 2;\n minHeight =\n childIndex < 4 ? boundingVolumeS2.minimumHeight : midpointHeight;\n maxHeight =\n childIndex < 4 ? midpointHeight : boundingVolumeS2.maximumHeight;\n } else {\n minHeight = boundingVolumeS2.minimumHeight;\n maxHeight = boundingVolumeS2.maximumHeight;\n }\n\n return {\n extensions: {\n \"3DTILES_bounding_volume_S2\": {\n token: S2Cell.getTokenFromId(cell._cellId),\n minimumHeight: minHeight,\n maximumHeight: maxHeight,\n },\n },\n };\n}\n\nconst scratchScaleFactors = new Cartesian3();\nconst scratchRootCenter = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchHalfAxes = new Matrix3();\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (x, y), leaving the z axis unchanged.\n * </p>\n * <p>\n * This computes the child volume directly from the root bounding volume rather\n * than recursively subdividing to minimize floating point error.\n * </p>\n *\n * @param {Number[]} rootBox An array of 12 numbers representing the bounding box of the root tile\n * @param {Number} level The level of the descendant tile relative to the root implicit tile\n * @param {Number} x The x coordinate of the descendant tile\n * @param {Number} y The y coordinate of the descendant tile\n * @param {Number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {Number[]} An array of 12 numbers representing the bounding box of the descendant tile.\n * @private\n */\nfunction deriveBoundingBox(rootBox, level, x, y, z) {\n if (level === 0) {\n return rootBox;\n }\n\n const rootCenter = Cartesian3.unpack(rootBox, 0, scratchRootCenter);\n const rootHalfAxes = Matrix3.unpack(rootBox, 3, scratchHalfAxes);\n\n const tileScale = Math.pow(2, -level);\n const modelSpaceX = -1 + (2 * x + 1) * tileScale;\n const modelSpaceY = -1 + (2 * y + 1) * tileScale;\n\n let modelSpaceZ = 0;\n const scaleFactors = Cartesian3.fromElements(\n tileScale,\n tileScale,\n 1,\n scratchScaleFactors\n );\n\n if (defined(z)) {\n modelSpaceZ = -1 + (2 * z + 1) * tileScale;\n scaleFactors.z = tileScale;\n }\n\n let center = Cartesian3.fromElements(\n modelSpaceX,\n modelSpaceY,\n modelSpaceZ,\n scratchCenter\n );\n center = Matrix3.multiplyByVector(rootHalfAxes, center, scratchCenter);\n center = Cartesian3.add(center, rootCenter, scratchCenter);\n\n let halfAxes = Matrix3.clone(rootHalfAxes);\n halfAxes = Matrix3.multiplyByScale(halfAxes, scaleFactors, halfAxes);\n\n const childBox = new Array(12);\n Cartesian3.pack(center, childBox);\n Matrix3.pack(halfAxes, childBox, 3);\n return childBox;\n}\n\nconst scratchRectangle = new Rectangle();\n/**\n * Derive a bounding volume for a descendant tile (child, grandchild, etc.),\n * assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])\n * coordinates are given to select the descendant tile and compute its position\n * and dimensions.\n * <p>\n * If z is present, octree subdivision is used. Otherwise, quadtree subdivision\n * is used. Quadtrees are always divided at the midpoint of the the horizontal\n * dimensions, i.e. (mid_longitude, mid_latitude), leaving the height values\n * unchanged.\n * </p>\n * <p>\n * This computes the child volume directly from the root bounding volume rather\n * than recursively subdividing to minimize floating point error.\n * </p>\n * @param {Number[]} rootRegion An array of 6 numbers representing the root implicit tile\n * @param {Number} level The level of the descendant tile relative to the root implicit tile\n * @param {Number} x The x coordinate of the descendant tile\n * @param {Number} y The x coordinate of the descendant tile\n * @param {Number} [z] The z coordinate of the descendant tile (octree only)\n * @returns {Number[]} An array of 6 numbers representing the bounding region of the descendant tile\n * @private\n */\nfunction deriveBoundingRegion(rootRegion, level, x, y, z) {\n if (level === 0) {\n return rootRegion.slice();\n }\n\n const rectangle = Rectangle.unpack(rootRegion, 0, scratchRectangle);\n const rootMinimumHeight = rootRegion[4];\n const rootMaximumHeight = rootRegion[5];\n const tileScale = Math.pow(2, -level);\n\n const childWidth = tileScale * rectangle.width;\n const west = CesiumMath.negativePiToPi(rectangle.west + x * childWidth);\n const east = CesiumMath.negativePiToPi(west + childWidth);\n\n const childHeight = tileScale * rectangle.height;\n const south = CesiumMath.negativePiToPi(rectangle.south + y * childHeight);\n const north = CesiumMath.negativePiToPi(south + childHeight);\n\n // Height is only subdivided for octrees; It remains constant for quadtrees.\n let minimumHeight = rootMinimumHeight;\n let maximumHeight = rootMaximumHeight;\n if (defined(z)) {\n const childThickness = tileScale * (rootMaximumHeight - rootMinimumHeight);\n minimumHeight += z * childThickness;\n maximumHeight = minimumHeight + childThickness;\n }\n\n return [west, south, east, north, minimumHeight, maximumHeight];\n}\n\n/**\n * Create a placeholder 3D Tile whose content will be an Implicit3DTileContent\n * for lazy evaluation of a child subtree.\n *\n * @param {Implicit3DTileContent} content The content object.\n * @param {Cesium3DTile} parentTile The parent of the new child subtree.\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @returns {Cesium3DTile} The new placeholder tile\n * @private\n */\nfunction makePlaceholderChildSubtree(content, parentTile, childIndex) {\n const implicitTileset = content._implicitTileset;\n const implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(\n childIndex\n );\n\n const childBoundingVolume = deriveBoundingVolume(\n implicitTileset,\n implicitCoordinates,\n childIndex,\n false,\n parentTile\n );\n\n // Ignore tile metadata when computing geometric error for the placeholder tile\n // since the child subtree's metadata hasn't been loaded yet.\n // The actual geometric error will be computed in deriveChildTile.\n const childGeometricError = getGeometricError(\n undefined,\n implicitTileset,\n implicitCoordinates\n );\n\n const childContentUri = implicitTileset.subtreeUriTemplate.getDerivedResource(\n {\n templateValues: implicitCoordinates.getTemplateValues(),\n }\n ).url;\n const tileJson = {\n boundingVolume: childBoundingVolume,\n geometricError: childGeometricError,\n refine: implicitTileset.refine,\n contents: [\n {\n uri: childContentUri,\n },\n ],\n };\n\n const tile = makeTile(\n content,\n implicitTileset.baseResource,\n tileJson,\n parentTile\n );\n tile.implicitTileset = implicitTileset;\n tile.implicitCoordinates = implicitCoordinates;\n return tile;\n}\n\n/**\n * Make a {@link Cesium3DTile}. This uses the content's tile's constructor instead\n * of importing Cesium3DTile. This is to avoid a circular dependency between\n * this file and Cesium3DTile.js\n * @param {Implicit3DTileContent} content The implicit content\n * @param {Resource} baseResource The base resource for the tileset\n * @param {Object} tileJson The JSON header for the tile\n * @param {Cesium3DTile} parentTile The parent of the new tile\n * @returns {Cesium3DTile} The newly created tile.\n * @private\n */\nfunction makeTile(content, baseResource, tileJson, parentTile) {\n const Cesium3DTile = content._tile.constructor;\n return new Cesium3DTile(content._tileset, baseResource, tileJson, parentTile);\n}\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Implicit3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n * @private\n */\nImplicit3DTileContent.prototype.hasProperty = function (batchId, name) {\n return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Implicit3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n * @private\n */\nImplicit3DTileContent.prototype.getFeature = function (batchId) {\n return undefined;\n};\n\nImplicit3DTileContent.prototype.applyDebugSettings = function (\n enabled,\n color\n) {};\n\nImplicit3DTileContent.prototype.applyStyle = function (style) {};\n\nImplicit3DTileContent.prototype.update = function (tileset, frameState) {};\n\nImplicit3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nImplicit3DTileContent.prototype.destroy = function () {\n this._implicitSubtree =\n this._implicitSubtree && this._implicitSubtree.destroy();\n return destroyObject(this);\n};\n\n// Exposed for testing\nImplicit3DTileContent._deriveBoundingBox = deriveBoundingBox;\nImplicit3DTileContent._deriveBoundingRegion = deriveBoundingRegion;\nImplicit3DTileContent._deriveBoundingVolumeS2 = deriveBoundingVolumeS2;\n\nexport default Implicit3DTileContent;\n", "/**\n * Determines if and how a glTF animation is looped.\n *\n * @enum {Number}\n *\n * @see ModelAnimationCollection#add\n */\nconst ModelAnimationLoop = {\n /**\n * Play the animation once; do not loop it.\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * Loop the animation playing it from the start immediately after it stops.\n *\n * @type {Number}\n * @constant\n */\n REPEAT: 1,\n\n /**\n * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.\n *\n * @type {Number}\n * @constant\n */\n MIRRORED_REPEAT: 2,\n};\nexport default Object.freeze(ModelAnimationLoop);\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.\n * Compatible with mathematics functions in {@link Plane}\n *\n * @alias ClippingPlane\n * @constructor\n *\n * @param {Cartesian3} normal The plane's normal (normalized).\n * @param {Number} distance The shortest distance from the origin to the plane. The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on. If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n */\nfunction ClippingPlane(normal, distance) {\n this._distance = distance;\n this._normal = new UpdateChangedCartesian3(normal, this);\n this.onChangeCallback = undefined;\n this.index = -1; // to be set by ClippingPlaneCollection\n}\n\nObject.defineProperties(ClippingPlane.prototype, {\n /**\n * The shortest distance from the origin to the plane. The sign of\n * <code>distance</code> determines which side of the plane the origin\n * is on. If <code>distance</code> is positive, the origin is in the half-space\n * in the direction of the normal; if negative, the origin is in the half-space\n * opposite to the normal; if zero, the plane passes through the origin.\n *\n * @type {Number}\n * @memberof ClippingPlane.prototype\n */\n distance: {\n get: function () {\n return this._distance;\n },\n set: function (value) {\nif (defined(this.onChangeCallback) && value !== this._distance) {\n this.onChangeCallback(this.index);\n }\n this._distance = value;\n },\n },\n /**\n * The plane's normal.\n *\n * @type {Cartesian3}\n * @memberof ClippingPlane.prototype\n */\n normal: {\n get: function () {\n return this._normal;\n },\n set: function (value) {\nif (\n defined(this.onChangeCallback) &&\n !Cartesian3.equals(this._normal._cartesian3, value)\n ) {\n this.onChangeCallback(this.index);\n }\n // Set without firing callback again\n Cartesian3.clone(value, this._normal._cartesian3);\n },\n },\n});\n\n/**\n * Create a ClippingPlane from a Plane object.\n *\n * @param {Plane} plane The plane containing parameters to copy\n * @param {ClippingPlane} [result] The object on which to store the result\n * @returns {ClippingPlane} The ClippingPlane generated from the plane's parameters.\n */\nClippingPlane.fromPlane = function (plane, result) {\n if (!defined(result)) {\n result = new ClippingPlane(plane.normal, plane.distance);\n } else {\n result.normal = plane.normal;\n result.distance = plane.distance;\n }\n return result;\n};\n\n/**\n * Clones the ClippingPlane without setting its ownership.\n * @param {ClippingPlane} clippingPlane The ClippingPlane to be cloned\n * @param {ClippingPlane} [result] The object on which to store the cloned parameters.\n * @returns {ClippingPlane} a clone of the input ClippingPlane\n */\nClippingPlane.clone = function (clippingPlane, result) {\n if (!defined(result)) {\n return new ClippingPlane(clippingPlane.normal, clippingPlane.distance);\n }\n result.normal = clippingPlane.normal;\n result.distance = clippingPlane.distance;\n return result;\n};\n\n/**\n * Wrapper on Cartesian3 that allows detection of Plane changes from \"members of members,\" for example:\n *\n * const clippingPlane = new ClippingPlane(...);\n * clippingPlane.normal.z = -1.0;\n *\n * @private\n */\nfunction UpdateChangedCartesian3(normal, clippingPlane) {\n this._clippingPlane = clippingPlane;\n this._cartesian3 = Cartesian3.clone(normal);\n}\n\nObject.defineProperties(UpdateChangedCartesian3.prototype, {\n x: {\n get: function () {\n return this._cartesian3.x;\n },\n set: function (value) {\nif (\n defined(this._clippingPlane.onChangeCallback) &&\n value !== this._cartesian3.x\n ) {\n this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n }\n this._cartesian3.x = value;\n },\n },\n y: {\n get: function () {\n return this._cartesian3.y;\n },\n set: function (value) {\nif (\n defined(this._clippingPlane.onChangeCallback) &&\n value !== this._cartesian3.y\n ) {\n this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n }\n this._cartesian3.y = value;\n },\n },\n z: {\n get: function () {\n return this._cartesian3.z;\n },\n set: function (value) {\nif (\n defined(this._clippingPlane.onChangeCallback) &&\n value !== this._cartesian3.z\n ) {\n this._clippingPlane.onChangeCallback(this._clippingPlane.index);\n }\n this._cartesian3.z = value;\n },\n },\n});\nexport default ClippingPlane;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Plane from \"../Core/Plane.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport ClippingPlane from \"./ClippingPlane.js\";\n\n/**\n * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the\n * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.\n * <p>\n * In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip\n * through the center of the object.\n * </p>\n * <p>\n * For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead.\n * </p>\n *\n * @alias ClippingPlaneCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {ClippingPlane[]} [options.planes=[]] An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.\n * @param {Boolean} [options.enabled=true] Determines whether the clipping planes are active.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.\n * @param {Boolean} [options.unionClippingRegions=false] If true, a region will be clipped if it is on the outside of any plane in the collection. Otherwise, a region will only be clipped if it is on the outside of every plane.\n * @param {Color} [options.edgeColor=Color.WHITE] The color applied to highlight the edge along which an object is clipped.\n * @param {Number} [options.edgeWidth=0.0] The width, in pixels, of the highlight applied to the edge along which an object is clipped.\n *\n * @demo {@link https://sandcastle.cesium.com/?src=3D%20Tiles%20Clipping%20Planes.html|Clipping 3D Tiles and glTF models.}\n * @demo {@link https://sandcastle.cesium.com/?src=Terrain%20Clipping%20Planes.html|Clipping the Globe.}\n *\n * @example\n * // This clipping plane's distance is positive, which means its normal\n * // is facing the origin. This will clip everything that is behind\n * // the plane, which is anything with y coordinate < -5.\n * const clippingPlanes = new Cesium.ClippingPlaneCollection({\n * planes : [\n * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)\n * ],\n * });\n * // Create an entity and attach the ClippingPlaneCollection to the model.\n * const entity = viewer.entities.add({\n * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),\n * model : {\n * uri : 'model.gltf',\n * minimumPixelSize : 128,\n * maximumScale : 20000,\n * clippingPlanes : clippingPlanes\n * }\n * });\n * viewer.zoomTo(entity);\n */\nfunction ClippingPlaneCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._planes = [];\n\n // Do partial texture updates if just one plane is dirty.\n // If many planes are dirty, refresh the entire texture.\n this._dirtyIndex = -1;\n this._multipleDirtyPlanes = false;\n\n this._enabled = defaultValue(options.enabled, true);\n\n /**\n * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes\n * original coordinate system.\n *\n * @type {Matrix4}\n * @default Matrix4.IDENTITY\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n\n /**\n * The color applied to highlight the edge along which an object is clipped.\n *\n * @type {Color}\n * @default Color.WHITE\n */\n this.edgeColor = Color.clone(defaultValue(options.edgeColor, Color.WHITE));\n\n /**\n * The width, in pixels, of the highlight applied to the edge along which an object is clipped.\n *\n * @type {Number}\n * @default 0.0\n */\n this.edgeWidth = defaultValue(options.edgeWidth, 0.0);\n\n /**\n * An event triggered when a new clipping plane is added to the collection. Event handlers\n * are passed the new plane and the index at which it was added.\n * @type {Event}\n * @default Event()\n */\n this.planeAdded = new Event();\n\n /**\n * An event triggered when a new clipping plane is removed from the collection. Event handlers\n * are passed the new plane and the index from which it was removed.\n * @type {Event}\n * @default Event()\n */\n this.planeRemoved = new Event();\n\n // If this ClippingPlaneCollection has an owner, only its owner should update or destroy it.\n // This is because in a Cesium3DTileset multiple models may reference the tileset's ClippingPlaneCollection.\n this._owner = undefined;\n\n const unionClippingRegions = defaultValue(\n options.unionClippingRegions,\n false\n );\n this._unionClippingRegions = unionClippingRegions;\n this._testIntersection = unionClippingRegions\n ? unionIntersectFunction\n : defaultIntersectFunction;\n\n this._uint8View = undefined;\n this._float32View = undefined;\n\n this._clippingPlanesTexture = undefined;\n\n // Add each ClippingPlane object.\n const planes = options.planes;\n if (defined(planes)) {\n const planesLength = planes.length;\n for (let i = 0; i < planesLength; ++i) {\n this.add(planes[i]);\n }\n }\n}\n\nfunction unionIntersectFunction(value) {\n return value === Intersect.OUTSIDE;\n}\n\nfunction defaultIntersectFunction(value) {\n return value === Intersect.INSIDE;\n}\n\nObject.defineProperties(ClippingPlaneCollection.prototype, {\n /**\n * Returns the number of planes in this collection. This is commonly used with\n * {@link ClippingPlaneCollection#get} to iterate over all the planes\n * in the collection.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._planes.length;\n },\n },\n\n /**\n * If true, a region will be clipped if it is on the outside of any plane in the\n * collection. Otherwise, a region will only be clipped if it is on the\n * outside of every plane.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @type {Boolean}\n * @default false\n */\n unionClippingRegions: {\n get: function () {\n return this._unionClippingRegions;\n },\n set: function (value) {\n if (this._unionClippingRegions === value) {\n return;\n }\n this._unionClippingRegions = value;\n this._testIntersection = value\n ? unionIntersectFunction\n : defaultIntersectFunction;\n },\n },\n\n /**\n * If true, clipping will be enabled.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @type {Boolean}\n * @default true\n */\n enabled: {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n if (this._enabled === value) {\n return;\n }\n this._enabled = value;\n },\n },\n\n /**\n * Returns a texture containing packed, untransformed clipping planes.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n texture: {\n get: function () {\n return this._clippingPlanesTexture;\n },\n },\n\n /**\n * A reference to the ClippingPlaneCollection's owner, if any.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @readonly\n * @private\n */\n owner: {\n get: function () {\n return this._owner;\n },\n },\n\n /**\n * Returns a Number encapsulating the state for this ClippingPlaneCollection.\n *\n * Clipping mode is encoded in the sign of the number, which is just the plane count.\n * If this value changes, then shader regeneration is necessary.\n *\n * @memberof ClippingPlaneCollection.prototype\n * @returns {Number} A Number that describes the ClippingPlaneCollection's state.\n * @readonly\n * @private\n */\n clippingPlanesState: {\n get: function () {\n return this._unionClippingRegions\n ? this._planes.length\n : -this._planes.length;\n },\n },\n});\n\nfunction setIndexDirty(collection, index) {\n // If there's already a different _dirtyIndex set, more than one plane has changed since update.\n // Entire texture must be reloaded\n collection._multipleDirtyPlanes =\n collection._multipleDirtyPlanes ||\n (collection._dirtyIndex !== -1 && collection._dirtyIndex !== index);\n collection._dirtyIndex = index;\n}\n\n/**\n * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering\n * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify\n * how modify the clipping behavior of multiple planes.\n *\n * @param {ClippingPlane} plane The ClippingPlane to add to the collection.\n *\n * @see ClippingPlaneCollection#unionClippingRegions\n * @see ClippingPlaneCollection#remove\n * @see ClippingPlaneCollection#removeAll\n */\nClippingPlaneCollection.prototype.add = function (plane) {\n const newPlaneIndex = this._planes.length;\n\n const that = this;\n plane.onChangeCallback = function (index) {\n setIndexDirty(that, index);\n };\n plane.index = newPlaneIndex;\n\n setIndexDirty(this, newPlaneIndex);\n this._planes.push(plane);\n this.planeAdded.raiseEvent(plane, newPlaneIndex);\n};\n\n/**\n * Returns the plane in the collection at the specified index. Indices are zero-based\n * and increase as planes are added. Removing a plane shifts all planes after\n * it to the left, changing their indices. This function is commonly used with\n * {@link ClippingPlaneCollection#length} to iterate over all the planes\n * in the collection.\n *\n * @param {Number} index The zero-based index of the plane.\n * @returns {ClippingPlane} The ClippingPlane at the specified index.\n *\n * @see ClippingPlaneCollection#length\n */\nClippingPlaneCollection.prototype.get = function (index) {\n return this._planes[index];\n};\n\nfunction indexOf(planes, plane) {\n const length = planes.length;\n for (let i = 0; i < length; ++i) {\n if (Plane.equals(planes[i], plane)) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.\n *\n * @param {ClippingPlane} [clippingPlane] The ClippingPlane to check for.\n * @returns {Boolean} true if this collection contains the ClippingPlane, false otherwise.\n *\n * @see ClippingPlaneCollection#get\n */\nClippingPlaneCollection.prototype.contains = function (clippingPlane) {\n return indexOf(this._planes, clippingPlane) !== -1;\n};\n\n/**\n * Removes the first occurrence of the given ClippingPlane from the collection.\n *\n * @param {ClippingPlane} clippingPlane\n * @returns {Boolean} <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.\n *\n * @see ClippingPlaneCollection#add\n * @see ClippingPlaneCollection#contains\n * @see ClippingPlaneCollection#removeAll\n */\nClippingPlaneCollection.prototype.remove = function (clippingPlane) {\n const planes = this._planes;\n const index = indexOf(planes, clippingPlane);\n\n if (index === -1) {\n return false;\n }\n\n // Unlink this ClippingPlaneCollection from the ClippingPlane\n if (clippingPlane instanceof ClippingPlane) {\n clippingPlane.onChangeCallback = undefined;\n clippingPlane.index = -1;\n }\n\n // Shift and update indices\n const length = planes.length - 1;\n for (let i = index; i < length; ++i) {\n const planeToKeep = planes[i + 1];\n planes[i] = planeToKeep;\n if (planeToKeep instanceof ClippingPlane) {\n planeToKeep.index = i;\n }\n }\n\n // Indicate planes texture is dirty\n this._multipleDirtyPlanes = true;\n planes.length = length;\n\n this.planeRemoved.raiseEvent(clippingPlane, index);\n\n return true;\n};\n\n/**\n * Removes all planes from the collection.\n *\n * @see ClippingPlaneCollection#add\n * @see ClippingPlaneCollection#remove\n */\nClippingPlaneCollection.prototype.removeAll = function () {\n // Dereference this ClippingPlaneCollection from all ClippingPlanes\n const planes = this._planes;\n const planesCount = planes.length;\n for (let i = 0; i < planesCount; ++i) {\n const plane = planes[i];\n if (plane instanceof ClippingPlane) {\n plane.onChangeCallback = undefined;\n plane.index = -1;\n }\n this.planeRemoved.raiseEvent(plane, i);\n }\n this._multipleDirtyPlanes = true;\n this._planes = [];\n};\n\nconst distanceEncodeScratch = new Cartesian4();\nconst oct32EncodeScratch = new Cartesian4();\nfunction packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) {\n const uint8View = clippingPlaneCollection._uint8View;\n const planes = clippingPlaneCollection._planes;\n let byteIndex = 0;\n for (let i = startIndex; i < endIndex; ++i) {\n const plane = planes[i];\n\n const oct32Normal = AttributeCompression.octEncodeToCartesian4(\n plane.normal,\n oct32EncodeScratch\n );\n uint8View[byteIndex] = oct32Normal.x;\n uint8View[byteIndex + 1] = oct32Normal.y;\n uint8View[byteIndex + 2] = oct32Normal.z;\n uint8View[byteIndex + 3] = oct32Normal.w;\n\n const encodedDistance = Cartesian4.packFloat(\n plane.distance,\n distanceEncodeScratch\n );\n uint8View[byteIndex + 4] = encodedDistance.x;\n uint8View[byteIndex + 5] = encodedDistance.y;\n uint8View[byteIndex + 6] = encodedDistance.z;\n uint8View[byteIndex + 7] = encodedDistance.w;\n\n byteIndex += 8;\n }\n}\n\n// Pack starting at the beginning of the buffer to allow partial update\nfunction packPlanesAsFloats(clippingPlaneCollection, startIndex, endIndex) {\n const float32View = clippingPlaneCollection._float32View;\n const planes = clippingPlaneCollection._planes;\n\n let floatIndex = 0;\n for (let i = startIndex; i < endIndex; ++i) {\n const plane = planes[i];\n const normal = plane.normal;\n\n float32View[floatIndex] = normal.x;\n float32View[floatIndex + 1] = normal.y;\n float32View[floatIndex + 2] = normal.z;\n float32View[floatIndex + 3] = plane.distance;\n\n floatIndex += 4; // each plane is 4 floats\n }\n}\n\nfunction computeTextureResolution(pixelsNeeded, result) {\n const maxSize = ContextLimits.maximumTextureSize;\n result.x = Math.min(pixelsNeeded, maxSize);\n result.y = Math.ceil(pixelsNeeded / result.x);\n return result;\n}\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * build the resources for clipping planes.\n * <p>\n * Do not call this function directly.\n * </p>\n */\nClippingPlaneCollection.prototype.update = function (frameState) {\n let clippingPlanesTexture = this._clippingPlanesTexture;\n const context = frameState.context;\n const useFloatTexture = ClippingPlaneCollection.useFloatTexture(context);\n\n // Compute texture requirements for current planes\n // In RGBA FLOAT, A plane is 4 floats packed to a RGBA.\n // In RGBA UNSIGNED_BYTE, A plane is a float in [0, 1) packed to RGBA and an Oct32 quantized normal,\n // so 8 bits or 2 pixels in RGBA.\n const pixelsNeeded = useFloatTexture ? this.length : this.length * 2;\n\n if (defined(clippingPlanesTexture)) {\n const currentPixelCount =\n clippingPlanesTexture.width * clippingPlanesTexture.height;\n // Recreate the texture to double current requirement if it isn't big enough or is 4 times larger than it needs to be.\n // Optimization note: this isn't exactly the classic resizeable array algorithm\n // * not necessarily checking for resize after each add/remove operation\n // * random-access deletes instead of just pops\n // * alloc ops likely more expensive than demonstrable via big-O analysis\n if (\n currentPixelCount < pixelsNeeded ||\n pixelsNeeded < 0.25 * currentPixelCount\n ) {\n clippingPlanesTexture.destroy();\n clippingPlanesTexture = undefined;\n this._clippingPlanesTexture = undefined;\n }\n }\n\n // If there are no clipping planes, there's nothing to update.\n if (this.length === 0) {\n return;\n }\n\n if (!defined(clippingPlanesTexture)) {\n const requiredResolution = computeTextureResolution(\n pixelsNeeded,\n textureResolutionScratch\n );\n // Allocate twice as much space as needed to avoid frequent texture reallocation.\n // Allocate in the Y direction, since texture may be as wide as context texture support.\n requiredResolution.y *= 2;\n\n if (useFloatTexture) {\n clippingPlanesTexture = new Texture({\n context: context,\n width: requiredResolution.x,\n height: requiredResolution.y,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.FLOAT,\n sampler: Sampler.NEAREST,\n flipY: false,\n });\n this._float32View = new Float32Array(\n requiredResolution.x * requiredResolution.y * 4\n );\n } else {\n clippingPlanesTexture = new Texture({\n context: context,\n width: requiredResolution.x,\n height: requiredResolution.y,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n sampler: Sampler.NEAREST,\n flipY: false,\n });\n this._uint8View = new Uint8Array(\n requiredResolution.x * requiredResolution.y * 4\n );\n }\n\n this._clippingPlanesTexture = clippingPlanesTexture;\n this._multipleDirtyPlanes = true;\n }\n\n const dirtyIndex = this._dirtyIndex;\n if (!this._multipleDirtyPlanes && dirtyIndex === -1) {\n return;\n }\n if (!this._multipleDirtyPlanes) {\n // partial updates possible\n let offsetX = 0;\n let offsetY = 0;\n if (useFloatTexture) {\n offsetY = Math.floor(dirtyIndex / clippingPlanesTexture.width);\n offsetX = Math.floor(dirtyIndex - offsetY * clippingPlanesTexture.width);\n\n packPlanesAsFloats(this, dirtyIndex, dirtyIndex + 1);\n clippingPlanesTexture.copyFrom({\n source: {\n width: 1,\n height: 1,\n arrayBufferView: this._float32View,\n },\n xOffset: offsetX,\n yOffset: offsetY,\n });\n } else {\n offsetY = Math.floor((dirtyIndex * 2) / clippingPlanesTexture.width);\n offsetX = Math.floor(\n dirtyIndex * 2 - offsetY * clippingPlanesTexture.width\n );\n packPlanesAsUint8(this, dirtyIndex, dirtyIndex + 1);\n clippingPlanesTexture.copyFrom({\n source: {\n width: 2,\n height: 1,\n arrayBufferView: this._uint8View,\n },\n xOffset: offsetX,\n yOffset: offsetY,\n });\n }\n } else if (useFloatTexture) {\n packPlanesAsFloats(this, 0, this._planes.length);\n clippingPlanesTexture.copyFrom({\n source: {\n width: clippingPlanesTexture.width,\n height: clippingPlanesTexture.height,\n arrayBufferView: this._float32View,\n },\n });\n } else {\n packPlanesAsUint8(this, 0, this._planes.length);\n clippingPlanesTexture.copyFrom({\n source: {\n width: clippingPlanesTexture.width,\n height: clippingPlanesTexture.height,\n arrayBufferView: this._uint8View,\n },\n });\n }\n\n this._multipleDirtyPlanes = false;\n this._dirtyIndex = -1;\n};\n\nconst scratchMatrix = new Matrix4();\nconst scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);\n/**\n * Determines the type intersection with the planes of this ClippingPlaneCollection instance and the specified {@link TileBoundingVolume}.\n * @private\n *\n * @param {Object} tileBoundingVolume The volume to determine the intersection with the planes.\n * @param {Matrix4} [transform] An optional, additional matrix to transform the plane to world coordinates.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the planes\n * the normal is pointing and should be entirely rendered, {@link Intersect.OUTSIDE}\n * if the entire volume is on the opposite side and should be clipped, and\n * {@link Intersect.INTERSECTING} if the volume intersects the planes.\n */\nClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = function (\n tileBoundingVolume,\n transform\n) {\n const planes = this._planes;\n const length = planes.length;\n\n let modelMatrix = this.modelMatrix;\n if (defined(transform)) {\n modelMatrix = Matrix4.multiply(transform, modelMatrix, scratchMatrix);\n }\n\n // If the collection is not set to union the clipping regions, the volume must be outside of all planes to be\n // considered completely clipped. If the collection is set to union the clipping regions, if the volume can be\n // outside any the planes, it is considered completely clipped.\n // Lastly, if not completely clipped, if any plane is intersecting, more calculations must be performed.\n let intersection = Intersect.INSIDE;\n if (!this.unionClippingRegions && length > 0) {\n intersection = Intersect.OUTSIDE;\n }\n\n for (let i = 0; i < length; ++i) {\n const plane = planes[i];\n\n Plane.transform(plane, modelMatrix, scratchPlane); // ClippingPlane can be used for Plane math\n\n const value = tileBoundingVolume.intersectPlane(scratchPlane);\n if (value === Intersect.INTERSECTING) {\n intersection = value;\n } else if (this._testIntersection(value)) {\n return value;\n }\n }\n\n return intersection;\n};\n\n/**\n * Sets the owner for the input ClippingPlaneCollection if there wasn't another owner.\n * Destroys the owner's previous ClippingPlaneCollection if setting is successful.\n *\n * @param {ClippingPlaneCollection} [clippingPlaneCollection] A ClippingPlaneCollection (or undefined) being attached to an object\n * @param {Object} owner An Object that should receive the new ClippingPlaneCollection\n * @param {String} key The Key for the Object to reference the ClippingPlaneCollection\n * @private\n */\nClippingPlaneCollection.setOwner = function (\n clippingPlaneCollection,\n owner,\n key\n) {\n // Don't destroy the ClippingPlaneCollection if it is already owned by newOwner\n if (clippingPlaneCollection === owner[key]) {\n return;\n }\n // Destroy the existing ClippingPlaneCollection, if any\n owner[key] = owner[key] && owner[key].destroy();\n if (defined(clippingPlaneCollection)) {\nclippingPlaneCollection._owner = owner;\n owner[key] = clippingPlaneCollection;\n }\n};\n\n/**\n * Function for checking if the context will allow clipping planes with floating point textures.\n *\n * @param {Context} context The Context that will contain clipped objects and clipping textures.\n * @returns {Boolean} <code>true</code> if floating point textures can be used for clipping planes.\n * @private\n */\nClippingPlaneCollection.useFloatTexture = function (context) {\n return context.floatingPointTexture;\n};\n\n/**\n * Function for getting the clipping plane collection's texture resolution.\n * If the ClippingPlaneCollection hasn't been updated, returns the resolution that will be\n * allocated based on the current plane count.\n *\n * @param {ClippingPlaneCollection} clippingPlaneCollection The clipping plane collection\n * @param {Context} context The rendering context\n * @param {Cartesian2} result A Cartesian2 for the result.\n * @returns {Cartesian2} The required resolution.\n * @private\n */\nClippingPlaneCollection.getTextureResolution = function (\n clippingPlaneCollection,\n context,\n result\n) {\n const texture = clippingPlaneCollection.texture;\n if (defined(texture)) {\n result.x = texture.width;\n result.y = texture.height;\n return result;\n }\n\n const pixelsNeeded = ClippingPlaneCollection.useFloatTexture(context)\n ? clippingPlaneCollection.length\n : clippingPlaneCollection.length * 2;\n const requiredResolution = computeTextureResolution(pixelsNeeded, result);\n\n // Allocate twice as much space as needed to avoid frequent texture reallocation.\n requiredResolution.y *= 2;\n return requiredResolution;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ClippingPlaneCollection#destroy\n */\nClippingPlaneCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * clippingPlanes = clippingPlanes && clippingPlanes.destroy();\n *\n * @see ClippingPlaneCollection#isDestroyed\n */\nClippingPlaneCollection.prototype.destroy = function () {\n this._clippingPlanesTexture =\n this._clippingPlanesTexture && this._clippingPlanesTexture.destroy();\n return destroyObject(this);\n};\nexport default ClippingPlaneCollection;\n", "import CesiumMath from \"../Core/Math.js\";\n\n/**\n * Defines different modes for blending between a target color and a primitive's source color.\n *\n * HIGHLIGHT multiplies the source color by the target color\n * REPLACE replaces the source color with the target color\n * MIX blends the source color and target color together\n *\n * @enum {Number}\n *\n * @see Model.colorBlendMode\n */\nconst ColorBlendMode = {\n HIGHLIGHT: 0,\n REPLACE: 1,\n MIX: 2,\n};\n\n/**\n * @private\n */\nColorBlendMode.getColorBlend = function (colorBlendMode, colorBlendAmount) {\n if (colorBlendMode === ColorBlendMode.HIGHLIGHT) {\n return 0.0;\n } else if (colorBlendMode === ColorBlendMode.REPLACE) {\n return 1.0;\n } else if (colorBlendMode === ColorBlendMode.MIX) {\n // The value 0.0 is reserved for highlight, so clamp to just above 0.0.\n return CesiumMath.clamp(colorBlendAmount, CesiumMath.EPSILON4, 1.0);\n }\n};\nexport default Object.freeze(ColorBlendMode);\n", "/**\n * An enum describing the type of motion that is defined by an articulation stage\n * in the AGI_articulations extension.\n *\n * @alias {ArticulationStageType}\n * @enum {String}\n *\n * @private\n */\nconst ArticulationStageType = {\n XTRANSLATE: \"xTranslate\",\n YTRANSLATE: \"yTranslate\",\n ZTRANSLATE: \"zTranslate\",\n XROTATE: \"xRotate\",\n YROTATE: \"yRotate\",\n ZROTATE: \"zRotate\",\n XSCALE: \"xScale\",\n YSCALE: \"yScale\",\n ZSCALE: \"zScale\",\n UNIFORMSCALE: \"uniformScale\",\n};\n\nexport default Object.freeze(ArticulationStageType);\n", "/**\n * An enum describing the type of interpolation used in a glTF animation.\n *\n * @enum {Number}\n *\n * @private\n */\nconst InterpolationType = {\n STEP: 0,\n LINEAR: 1,\n CUBICSPLINE: 2,\n};\n\nexport default Object.freeze(InterpolationType);\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * A table for storing free-form JSON metadata, as in the 3D Tiles batch table.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.count The number of entities in the table.\n * @param {Object.<String, Array>} options.properties The JSON representation of the metadata table. All the arrays must have exactly options.count elements.\n *\n * @alias JsonMetadataTable\n * @constructor\n * @private\n */\n\n// An empty class is used because JsonMetadataTable is an older type of metadata table\n// that does not have a class definition.\nconst emptyClass = {};\n\nfunction JsonMetadataTable(options) {\n this._count = options.count;\n this._properties = clone(options.properties, true);\n}\n\n/**\n * Returns whether the table has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the table has this property.\n * @private\n */\nJsonMetadataTable.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, emptyClass);\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nJsonMetadataTable.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, emptyClass, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n *\n * @param {Number} index The index of the entity.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the entity does not have this property.\n *\n * @exception {DeveloperError} index is out of bounds\n * @private\n */\nJsonMetadataTable.prototype.getProperty = function (index, propertyId) {\n const property = this._properties[propertyId];\n if (defined(property)) {\n return clone(property[index], true);\n }\n\n return undefined;\n};\n\n/**\n * Sets the value of the property with the given ID. If the property did not\n * exist, it will be created.\n *\n * @param {Number} index The index of the entity.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} index is out of bounds\n * @private\n */\nJsonMetadataTable.prototype.setProperty = function (index, propertyId, value) {\n let property = this._properties[propertyId];\n if (!defined(property)) {\n // Property does not exist. Create it.\n property = new Array(this._count);\n this._properties[propertyId] = property;\n }\n\n property[index] = clone(value, true);\n};\n\nexport default JsonMetadataTable;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport defined from \"../Core/defined.js\";\nimport JsonMetadataTable from \"./JsonMetadataTable.js\";\n\n/**\n * A property table for use with the <code>EXT_structural_metadata</code> extension or\n * legacy <code>EXT_feature_metadata</code> glTF extension. It also includes some\n * options to be compatible with the 3D Tiles 1.0 batch table.\n * <p>\n * For batch tables, properties are resolved in the following order:\n * </p>\n * <ol>\n * <li>binary properties from options.metadataTable</li>\n * <li>JSON properties from options.jsonMetadataTable</li>\n * <li>batch table hierarchy properties from options.batchTableHierarchy</li>\n * </ol>\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} [options.name] Human-readable name to describe the table\n * @param {String|Number} [options.id] A unique id to identify the property table, useful for debugging. For <code>EXT_structural_metadata</code>, this is the array index in the property tables array, for <code>EXT_feature_metadata</code> this is the dictionary key in the property tables dictionary.\n * @param {Number} options.count The number of features in the table.\n * @param {MetadataTable} [options.metadataTable] A table of binary properties.\n * @param {JsonMetadataTable} [options.jsonMetadataTable] For compatibility with the old batch table, free-form JSON properties can be passed in.\n * @param {BatchTableHierarchy} [options.batchTableHierarchy] For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, a hierarchy can be provided.\n * @param {Object} [options.extras] Extra user-defined properties\n * @param {Object} [options.extensions] An object containing extensions\n *\n * @alias PropertyTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTable(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._name = options.name;\n this._id = options.id;\n this._count = options.count;\n this._extras = options.extras;\n this._extensions = options.extensions;\n this._metadataTable = options.metadataTable;\n this._jsonMetadataTable = options.jsonMetadataTable;\n this._batchTableHierarchy = options.batchTableHierarchy;\n}\n\nObject.defineProperties(PropertyTable.prototype, {\n /**\n * A human-readable name for this table\n *\n * @memberof PropertyTable.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * An identifier for this table. Useful for debugging.\n *\n * @memberof PropertyTable.prototype\n * @type {String|Number}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * The number of features in the table.\n *\n * @memberof PropertyTable.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n count: {\n get: function () {\n return this._count;\n },\n },\n\n /**\n * The class that properties conform to.\n *\n * @memberof PropertyTable.prototype\n * @type {MetadataClass}\n * @readonly\n */\n class: {\n get: function () {\n if (defined(this._metadataTable)) {\n return this._metadataTable.class;\n }\n\n return undefined;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof PropertyTable.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof PropertyTable.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n\n /**\n * Get the total amount of binary metadata stored in memory. This does\n * not include JSON metadata\n *\n * @memberof PropertyTable.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n byteLength: {\n get: function () {\n let totalByteLength = 0;\n if (defined(this._metadataTable)) {\n totalByteLength += this._metadataTable.byteLength;\n }\n\n if (defined(this._batchTableHierarchy)) {\n totalByteLength += this._batchTableHierarchy.byteLength;\n }\n\n return totalByteLength;\n },\n },\n});\n\n/**\n * Returns whether the feature has this property. For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, this is computed for a specific feature.\n *\n * @param {Number} index The index of the feature.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the feature has this property.\n * @private\n */\nPropertyTable.prototype.hasProperty = function (index, propertyId) {\n if (\n defined(this._metadataTable) &&\n this._metadataTable.hasProperty(propertyId)\n ) {\n return true;\n }\n\n if (\n defined(this._batchTableHierarchy) &&\n this._batchTableHierarchy.hasProperty(index, propertyId)\n ) {\n return true;\n }\n\n if (\n defined(this._jsonMetadataTable) &&\n this._jsonMetadataTable.hasProperty(propertyId)\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Returns whether the feature has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the feature has a property with the given semantic.\n * @private\n */\nPropertyTable.prototype.hasPropertyBySemantic = function (index, semantic) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.hasPropertyBySemantic(semantic);\n }\n\n return false;\n};\n\n/**\n * Returns whether any feature has this property.\n * This is mainly useful for checking whether a property exists in the class\n * hierarchy when using the <code>3DTILES_batch_table_hierarchy</code> extension.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether any feature has this property.\n * @private\n */\nPropertyTable.prototype.propertyExists = function (propertyId) {\n if (\n defined(this._metadataTable) &&\n this._metadataTable.hasProperty(propertyId)\n ) {\n return true;\n }\n\n if (\n defined(this._batchTableHierarchy) &&\n this._batchTableHierarchy.propertyExists(propertyId)\n ) {\n return true;\n }\n\n if (\n defined(this._jsonMetadataTable) &&\n this._jsonMetadataTable.hasProperty(propertyId)\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Returns whether any feature has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether any feature has a property with the given semantic.\n * @private\n */\nPropertyTable.prototype.propertyExistsBySemantic = function (semantic) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.hasPropertyBySemantic(semantic);\n }\n\n return false;\n};\n\nconst scratchResults = [];\n\n/**\n * Returns an array of property IDs. For compatibility with the <code>3DTILES_batch_table_hierarchy</code> extension, this is computed for a specific feature.\n *\n * @param {Number} index The index of the feature.\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nPropertyTable.prototype.getPropertyIds = function (index, results) {\n results = defined(results) ? results : [];\n results.length = 0;\n\n if (defined(this._metadataTable)) {\n // concat in place to avoid unnecessary array allocation\n results.push.apply(\n results,\n this._metadataTable.getPropertyIds(scratchResults)\n );\n }\n\n if (defined(this._batchTableHierarchy)) {\n results.push.apply(\n results,\n this._batchTableHierarchy.getPropertyIds(index, scratchResults)\n );\n }\n\n if (defined(this._jsonMetadataTable)) {\n results.push.apply(\n results,\n this._jsonMetadataTable.getPropertyIds(scratchResults)\n );\n }\n\n return results;\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {Number} index The index of the feature.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n */\nPropertyTable.prototype.getProperty = function (index, propertyId) {\n let result;\n if (defined(this._metadataTable)) {\n result = this._metadataTable.getProperty(index, propertyId);\n if (defined(result)) {\n return result;\n }\n }\n\n if (defined(this._batchTableHierarchy)) {\n result = this._batchTableHierarchy.getProperty(index, propertyId);\n if (defined(result)) {\n return result;\n }\n }\n\n if (defined(this._jsonMetadataTable)) {\n result = this._jsonMetadataTable.getProperty(index, propertyId);\n if (defined(result)) {\n return result;\n }\n }\n\n return undefined;\n};\n\n/**\n * Sets the value of the property with the given ID. If the property did not\n * exist, it will be created as a JSON metadata property\n *\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {Number} index The index of the feature.\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @private\n */\nPropertyTable.prototype.setProperty = function (index, propertyId, value) {\n if (\n defined(this._metadataTable) &&\n this._metadataTable.setProperty(index, propertyId, value)\n ) {\n return;\n }\n\n if (\n defined(this._batchTableHierarchy) &&\n this._batchTableHierarchy.setProperty(index, propertyId, value)\n ) {\n return;\n }\n\n // Ensure we have a table for JSON properties\n if (!defined(this._jsonMetadataTable)) {\n this._jsonMetadataTable = new JsonMetadataTable({\n count: this._count,\n properties: {},\n });\n }\n\n // JsonMetadataTable will handle creating a new property at runtime.\n this._jsonMetadataTable.setProperty(index, propertyId, value);\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {Number} index The index of the feature.\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this semantic.\n * @private\n */\nPropertyTable.prototype.getPropertyBySemantic = function (index, semantic) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.getPropertyBySemantic(index, semantic);\n }\n\n return undefined;\n};\n\n/**\n * Sets the value of the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {Number} index The index of the feature.\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nPropertyTable.prototype.setPropertyBySemantic = function (\n index,\n semantic,\n value\n) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.setPropertyBySemantic(index, semantic, value);\n }\n\n return false;\n};\n\n/**\n * Returns a typed array containing the property values for a given propertyId.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not store\n * values in typed arrays.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nPropertyTable.prototype.getPropertyTypedArray = function (propertyId) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.getPropertyTypedArray(propertyId);\n }\n\n return undefined;\n};\n\n/**\n * Returns a typed array containing the property values for the property with the given semantic.\n * <p>\n * This only operates on the underlying {@link MetadataTable} (if present) as\n * {@link JsonMetadataTable} and {@link BatchTableHierarchy} do not have\n * semantics.\n * </p>\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The typed array containing the property values or <code>undefined</code> if the property values are not stored in a typed array.\n *\n * @private\n */\nPropertyTable.prototype.getPropertyTypedArrayBySemantic = function (semantic) {\n if (defined(this._metadataTable)) {\n return this._metadataTable.getPropertyTypedArrayBySemantic(semantic);\n }\n\n return undefined;\n};\n\nfunction checkFeatureId(featureId, featuresLength) {\n if (!defined(featureId) || featureId < 0 || featureId >= featuresLength) {\n throw new DeveloperError(\n `featureId is required and must be between zero and featuresLength - 1 (${featuresLength}` -\n +\").\"\n );\n }\n}\n\nPropertyTable.prototype.isClass = function (featureId, className) {\n const hierarchy = this._batchTableHierarchy;\n if (!defined(hierarchy)) {\n return false;\n }\n\n return hierarchy.isClass(featureId, className);\n};\n\nPropertyTable.prototype.isExactClass = function (featureId, className) {\n return this.getExactClassName(featureId) === className;\n};\n\nPropertyTable.prototype.getExactClassName = function (featureId) {\n const hierarchy = this._batchTableHierarchy;\n if (!defined(hierarchy)) {\n return undefined;\n }\n\n return hierarchy.getClassName(featureId);\n};\n\nexport default PropertyTable;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport MetadataType from \"./MetadataType.js\";\nimport MetadataComponentType from \"./MetadataComponentType.js\";\n\n/**\n * A property in a property texture.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n * @param {Object.<Number, Texture>} options.textures An object mapping texture IDs to {@link Texture} objects.\n *\n * @alias PropertyTextureProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTextureProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const property = options.property;\n const classProperty = options.classProperty;\n const textures = options.textures;\n\n // in EXT_structural_metadata, the property is a valid glTF textureInfo\n const channels = defined(property.channels) ? property.channels : [0];\n const textureInfo = property;\n const textureReader = GltfLoaderUtil.createModelTextureReader({\n textureInfo: textureInfo,\n channels: reformatChannels(channels),\n texture: textures[textureInfo.index],\n });\n\n this._min = property.min;\n this._max = property.max;\n\n let offset = property.offset;\n let scale = property.scale;\n\n // This needs to be set before handling default values\n const hasValueTransform =\n classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n // If the property attribute does not define an offset/scale, it inherits from\n // the class property. The class property handles setting the default of\n // identity: (offset 0, scale 1) with the same scalar/vector/matrix types.\n // array types are disallowed by the spec.\n offset = defaultValue(offset, classProperty.offset);\n scale = defaultValue(scale, classProperty.scale);\n\n // offset and scale are applied on the GPU, so unpack the values\n // as math types we can use in uniform callbacks.\n offset = classProperty.unpackVectorAndMatrixTypes(offset);\n scale = classProperty.unpackVectorAndMatrixTypes(scale);\n\n this._offset = offset;\n this._scale = scale;\n this._hasValueTransform = hasValueTransform;\n\n this._textureReader = textureReader;\n this._classProperty = classProperty;\n this._extras = property.extras;\n this._extensions = property.extensions;\n}\n\nObject.defineProperties(PropertyTextureProperty.prototype, {\n /**\n * The texture reader.\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {ModelComponents.TextureReader}\n * @readonly\n * @private\n */\n textureReader: {\n get: function () {\n return this._textureReader;\n },\n },\n\n /**\n * True if offset/scale should be applied. If both offset/scale were\n * undefined, they default to identity so this property is set false\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n hasValueTransform: {\n get: function () {\n return this._hasValueTransform;\n },\n },\n\n /**\n * The offset to be added to property values as part of the value transform.\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @readonly\n * @private\n */\n offset: {\n get: function () {\n return this._offset;\n },\n },\n\n /**\n * The scale to be multiplied to property values as part of the value transform.\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @readonly\n * @private\n */\n scale: {\n get: function () {\n return this._scale;\n },\n },\n\n /**\n * The properties inherited from this property's class\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {MetadataClassProperty}\n * @readonly\n * @private\n */\n classProperty: {\n get: function () {\n return this._classProperty;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof PropertyTextureProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nPropertyTextureProperty.prototype.isGpuCompatible = function () {\n const classProperty = this._classProperty;\n const type = classProperty.type;\n const componentType = classProperty.componentType;\n\n if (classProperty.isArray) {\n // only support arrays of 1-4 UINT8 scalars (normalized or unnormalized)\n return (\n !classProperty.isVariableLengthArray &&\n classProperty.arrayLength <= 4 &&\n type === MetadataType.SCALAR &&\n componentType === MetadataComponentType.UINT8\n );\n }\n\n if (MetadataType.isVectorType(type) || type === MetadataType.SCALAR) {\n return componentType === MetadataComponentType.UINT8;\n }\n\n // For this initial implementation, only UINT8-based properties\n // are supported.\n return false;\n};\n\nconst floatTypesByComponentCount = [undefined, \"float\", \"vec2\", \"vec3\", \"vec4\"];\nconst integerTypesByComponentCount = [\n undefined,\n \"int\",\n \"ivec2\",\n \"ivec3\",\n \"ivec4\",\n];\nPropertyTextureProperty.prototype.getGlslType = function () {\n const classProperty = this._classProperty;\n\n let componentCount = MetadataType.getComponentCount(classProperty.type);\n if (classProperty.isArray) {\n // fixed-sized arrays of length 2-4 UINT8s are represented as vectors as the\n // shader since those are more useful in GLSL.\n componentCount = classProperty.arrayLength;\n }\n\n // Normalized UINT8 properties are float types in the shader\n if (classProperty.normalized) {\n return floatTypesByComponentCount[componentCount];\n }\n\n // other UINT8-based properties are represented as integer types.\n return integerTypesByComponentCount[componentCount];\n};\n\nPropertyTextureProperty.prototype.unpackInShader = function (packedValueGlsl) {\n const classProperty = this._classProperty;\n\n // no unpacking needed if for normalized types\n if (classProperty.normalized) {\n return packedValueGlsl;\n }\n\n // integer types are read from the texture as normalized float values.\n // these need to be rescaled to [0, 255] and cast to the appropriate integer\n // type.\n const glslType = this.getGlslType();\n return `${glslType}(255.0 * ${packedValueGlsl})`;\n};\n\n/**\n * Reformat from an array of channel indices like <code>[0, 1]</code> to a\n * string of channels as would be used in GLSL swizzling (e.g. \"rg\")\n *\n * @param {Number[]} channels the channel indices\n * @return {String} The channels as a string of \"r\", \"g\", \"b\" or \"a\" characters.\n * @private\n */\nfunction reformatChannels(channels) {\n return channels\n .map(function (channelIndex) {\n return \"rgba\".charAt(channelIndex);\n })\n .join(\"\");\n}\n\nexport default PropertyTextureProperty;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTextureProperty from \"./PropertyTextureProperty.js\";\n\n/**\n * A property texture.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} [options.name] Optional human-readable name to describe the texture\n * @param {String|Number} [options.id] A unique id to identify the property texture, useful for debugging. For <code>EXT_structural_metadata</code>, this is the array index in the property textures array, for <code>EXT_feature_metadata</code> this is the dictionary key in the property textures dictionary.\n * @param {Object} options.propertyTexture The property texture JSON, following the EXT_structural_metadata schema.\n * @param {MetadataClass} options.class The class that properties conform to.\n * @param {Object.<String, Texture>} options.textures An object mapping texture IDs to {@link Texture} objects.\n *\n * @alias PropertyTexture\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyTexture(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const propertyTexture = options.propertyTexture;\n const classDefinition = options.class;\n const textures = options.textures;\n\n const extensions = propertyTexture.extensions;\n const extras = propertyTexture.extras;\n\n const properties = {};\n if (defined(propertyTexture.properties)) {\n for (const propertyId in propertyTexture.properties) {\n if (propertyTexture.properties.hasOwnProperty(propertyId)) {\n properties[propertyId] = new PropertyTextureProperty({\n property: propertyTexture.properties[propertyId],\n classProperty: classDefinition.properties[propertyId],\n textures: textures,\n });\n }\n }\n }\n\n this._name = options.name;\n this._id = options.id;\n this._class = classDefinition;\n this._properties = properties;\n this._extras = extras;\n this._extensions = extensions;\n}\n\nObject.defineProperties(PropertyTexture.prototype, {\n /**\n * A human-readable name for this texture\n *\n * @memberof PropertyTexture.prototype\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * An identifier for this texture. Useful for debugging.\n *\n * @memberof PropertyTexture.prototype\n * @type {String|Number}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * The class that properties conform to.\n *\n * @memberof PropertyTexture.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * The properties in this property texture.\n *\n * @memberof PropertyTexture.prototype\n *\n * @type {PropertyTextureProperty}\n * @readonly\n * @private\n */\n properties: {\n get: function () {\n return this._properties;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof PropertyTexture.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof PropertyTexture.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Gets the property with the given property ID.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {PropertyTextureProperty|undefined} The property, or <code>undefined</code> if the property does not exist.\n * @private\n */\nPropertyTexture.prototype.getProperty = function (propertyId) {\n return this._properties[propertyId];\n};\n\nexport default PropertyTexture;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A property in a property attribute from EXT_structural_metadata.\n *\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.property The property JSON object.\n * @param {MetadataClassProperty} options.classProperty The class property.\n *\n * @alias PropertyAttributeProperty\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyAttributeProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const property = options.property;\n const classProperty = options.classProperty;\n\n this._attribute = property.attribute;\n this._classProperty = classProperty;\n this._min = property.min;\n this._max = property.max;\n\n let offset = property.offset;\n let scale = property.scale;\n\n // This needs to be set before handling default values\n const hasValueTransform =\n classProperty.hasValueTransform || defined(offset) || defined(scale);\n\n // If the property attribute does not define an offset/scale, it inherits from\n // the class property. The class property handles setting the default of\n // identity: (offset 0, scale 1) with the same scalar/vector/matrix types.\n // array types are disallowed by the spec.\n offset = defaultValue(offset, classProperty.offset);\n scale = defaultValue(scale, classProperty.scale);\n\n // offset and scale are applied on the GPU, so unpack the values\n // as math types we can use in uniform callbacks.\n offset = classProperty.unpackVectorAndMatrixTypes(offset);\n scale = classProperty.unpackVectorAndMatrixTypes(scale);\n\n this._offset = offset;\n this._scale = scale;\n this._hasValueTransform = hasValueTransform;\n\n this._extras = property.extras;\n this._extensions = property.extensions;\n}\n\nObject.defineProperties(PropertyAttributeProperty.prototype, {\n /**\n * The attribute semantic\n *\n * @memberof PropertyAttributeProperty.prototype\n * @type {String}\n * @readonly\n * @private\n */\n attribute: {\n get: function () {\n return this._attribute;\n },\n },\n\n /**\n * True if offset/scale should be applied. If both offset/scale were\n * undefined, they default to identity so this property is set false\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n hasValueTransform: {\n get: function () {\n return this._hasValueTransform;\n },\n },\n\n /**\n * The offset to be added to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @readonly\n * @private\n */\n offset: {\n get: function () {\n return this._offset;\n },\n },\n\n /**\n * The scale to be multiplied to property values as part of the value transform.\n *\n * @memberof MetadataClassProperty.prototype\n * @type {Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}\n * @readonly\n * @private\n */\n scale: {\n get: function () {\n return this._scale;\n },\n },\n\n /**\n * The properties inherited from this property's class\n *\n * @memberof PropertyAttributeProperty.prototype\n * @type {MetadataClassProperty}\n * @readonly\n * @private\n */\n classProperty: {\n get: function () {\n return this._classProperty;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof PropertyAttributeProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof PropertyAttributeProperty.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nexport default PropertyAttributeProperty;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyAttributeProperty from \"./PropertyAttributeProperty.js\";\n\n/**\n * A property attribute; a collection of per-point properties stored as custom\n * vertex attributes.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} [options.name] Optional human-readable name to describe the attribute\n * @param {Number} [options.id] A unique id to identify the property attribute, useful for debugging. This is the array index in the property attributes array\n * @param {Object} options.propertyAttribute The property attribute JSON, following the EXT_structural_metadata schema.\n * @param {MetadataClass} options.class The class that properties conform to.\n *\n * @alias PropertyAttribute\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction PropertyAttribute(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const propertyAttribute = options.propertyAttribute;\n const classDefinition = options.class;\n\n const properties = {};\n if (defined(propertyAttribute.properties)) {\n for (const propertyId in propertyAttribute.properties) {\n if (propertyAttribute.properties.hasOwnProperty(propertyId)) {\n properties[propertyId] = new PropertyAttributeProperty({\n property: propertyAttribute.properties[propertyId],\n classProperty: classDefinition.properties[propertyId],\n });\n }\n }\n }\n\n this._name = options.name;\n this._id = options.id;\n this._class = classDefinition;\n this._properties = properties;\n this._extras = propertyAttribute.extras;\n this._extensions = propertyAttribute.extensions;\n}\n\nObject.defineProperties(PropertyAttribute.prototype, {\n /**\n * A human-readable name for this attribute\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * An identifier for this attribute. Useful for debugging.\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {String|Number}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * The class that properties conform to.\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * The properties in this property attribute.\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {Object.<String, PropertyAttributeProperty>}\n * @readonly\n * @private\n */\n properties: {\n get: function () {\n return this._properties;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof PropertyAttribute.prototype\n *\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Gets the property with the given property ID.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {PropertyAttributeProperty|undefined} The property, or <code>undefined</code> if the property does not exist.\n * @private\n */\nPropertyAttribute.prototype.getProperty = function (propertyId) {\n return this._properties[propertyId];\n};\n\nexport default PropertyAttribute;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * An object containing structural metadata.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadatas|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {PropertyTable[]} [options.propertyTables] An array of property table objects. For the legacy <code>EXT_feature_metadata</code> extension, this is sorted by the key in the propertyTables dictionary\n * @param {PropertyTexture[]} [options.propertyTextures] An array of property texture objects. For the legacy <code>EXT_feature_metadata</code> extension, this is sorted by the key in the propertyTextures dictionary\n * @param {PropertyAttribute[]} [options.propertyAttributes] An array of property attribute objects. This is new in <code>EXT_structural_metadata</code>\n * @param {Object} [options.statistics] Statistics about metadata\n * @param {Object} [options.extras] Extra user-defined properties\n * @param {Object} [options.extensions] An object containing extensions\n *\n * @alias StructuralMetadata\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction StructuralMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._schema = options.schema;\n const propertyTables = options.propertyTables;\n this._propertyTableCount = defined(propertyTables)\n ? propertyTables.length\n : 0;\n this._propertyTables = propertyTables;\n this._propertyTextures = options.propertyTextures;\n this._propertyAttributes = options.propertyAttributes;\n this._statistics = options.statistics;\n this._extras = options.extras;\n this._extensions = options.extensions;\n}\n\nObject.defineProperties(StructuralMetadata.prototype, {\n /**\n * Schema containing classes and enums.\n *\n * @memberof StructuralMetadata.prototype\n * @type {MetadataSchema}\n * @readonly\n * @private\n */\n schema: {\n get: function () {\n return this._schema;\n },\n },\n\n /**\n * Statistics about the metadata.\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.schema.json|statistics schema reference} for the full set of properties.\n * </p>\n *\n * @memberof StructuralMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n statistics: {\n get: function () {\n return this._statistics;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof StructuralMetadata.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof StructuralMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n\n /**\n * Number of property tables in the metadata.\n *\n * @memberof StructuralMetadata.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n propertyTableCount: {\n get: function () {\n return this._propertyTableCount;\n },\n },\n\n /**\n * The property tables in the metadata.\n *\n * @memberof StructuralMetadata.prototype\n * @type {PropertyTable[]}\n * @readonly\n * @private\n */\n propertyTables: {\n get: function () {\n return this._propertyTables;\n },\n },\n\n /**\n * The property textures in the metadata.\n *\n * @memberof StructuralMetadata.prototype\n * @type {PropertyTexture[]}\n * @readonly\n * @private\n */\n propertyTextures: {\n get: function () {\n return this._propertyTextures;\n },\n },\n\n /**\n * The property attributes from the structural metadata extension\n *\n * @memberof StructuralMetadata.prototype\n * @type {PropertyAttribute[]}\n * @readonly\n * @private\n */\n propertyAttributes: {\n get: function () {\n return this._propertyAttributes;\n },\n },\n\n /**\n * Total size in bytes across all property tables\n *\n * @memberof StructuralMetadata.prototype\n * @type {Number}\n * @readonly\n * @private\n */\n propertyTablesByteLength: {\n get: function () {\n if (!defined(this._propertyTables)) {\n return 0;\n }\n\n let totalByteLength = 0;\n const length = this._propertyTables.length;\n for (let i = 0; i < length; i++) {\n totalByteLength += this._propertyTables[i].byteLength;\n }\n\n return totalByteLength;\n },\n },\n});\n\n/**\n * Gets the property table with the given ID.\n * <p>\n * For the legacy <code>EXT_feature_metadata</code>, textures are stored in an array sorted\n * by the key in the propertyTables dictionary.\n * </p>\n *\n * @param {Number} propertyTableId The property table ID.\n * @returns {PropertyTable} The property table.\n * @private\n */\nStructuralMetadata.prototype.getPropertyTable = function (propertyTableId) {\n return this._propertyTables[propertyTableId];\n};\n\n/**\n * Gets the property texture with the given ID.\n * <p>\n * For the legacy <code>EXT_feature_metadata</code>, textures are stored in an array sorted\n * by the key in the propertyTextures dictionary.\n * </p>\n *\n * @param {Number} propertyTextureId The index into the property textures array.\n * @returns {PropertyTexture} The property texture\n * @private\n */\nStructuralMetadata.prototype.getPropertyTexture = function (propertyTextureId) {\n return this._propertyTextures[propertyTextureId];\n};\n\n/**\n * Gets the property attribute with the given ID. This concept is new in\n * EXT_structural_metadata\n *\n * @param {Number} propertyAttributeId The index into the property attributes array.\n * @returns {PropertyAttribute} The property attribute\n * @private\n */\nStructuralMetadata.prototype.getPropertyAttribute = function (\n propertyAttributeId\n) {\n return this._propertyAttributes[propertyAttributeId];\n};\n\nexport default StructuralMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport PropertyTexture from \"./PropertyTexture.js\";\nimport PropertyAttribute from \"./PropertyAttribute.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\n\n/**\n * Parse the <code>EXT_structural_metadata</code> glTF extension to create a\n * structural metadata object.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.extension The extension JSON object.\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {Object.<String, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n * @param {Object.<String, Texture>} [options.textures] An object mapping texture IDs to {@link Texture} objects.\n * @return {StructuralMetadata} A structural metadata object\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseStructuralMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const extension = options.extension;\n\n // The calling code is responsible for loading the schema.\n // This keeps metadata parsing synchronous.\n const schema = options.schema;\n\n const propertyTables = [];\n if (defined(extension.propertyTables)) {\n for (let i = 0; i < extension.propertyTables.length; i++) {\n const propertyTable = extension.propertyTables[i];\n const classDefinition = schema.classes[propertyTable.class];\n const metadataTable = new MetadataTable({\n count: propertyTable.count,\n properties: propertyTable.properties,\n class: classDefinition,\n bufferViews: options.bufferViews,\n });\n propertyTables.push(\n new PropertyTable({\n id: i,\n name: propertyTable.name,\n count: propertyTable.count,\n metadataTable: metadataTable,\n extras: propertyTable.extras,\n extensions: propertyTable.extensions,\n })\n );\n }\n }\n\n const propertyTextures = [];\n if (defined(extension.propertyTextures)) {\n for (let i = 0; i < extension.propertyTextures.length; i++) {\n const propertyTexture = extension.propertyTextures[i];\n propertyTextures.push(\n new PropertyTexture({\n id: i,\n name: propertyTexture.name,\n propertyTexture: propertyTexture,\n class: schema.classes[propertyTexture.class],\n textures: options.textures,\n })\n );\n }\n }\n\n const propertyAttributes = [];\n if (defined(extension.propertyAttributes)) {\n for (let i = 0; i < extension.propertyAttributes.length; i++) {\n const propertyAttribute = extension.propertyAttributes[i];\n propertyAttributes.push(\n new PropertyAttribute({\n id: i,\n name: propertyAttribute.name,\n class: schema.classes[propertyAttribute.class],\n propertyAttribute: propertyAttribute,\n })\n );\n }\n }\n\n return new StructuralMetadata({\n schema: schema,\n propertyTables: propertyTables,\n propertyTextures: propertyTextures,\n propertyAttributes: propertyAttributes,\n statistics: extension.statistics,\n extras: extension.extras,\n extensions: extension.extensions,\n });\n}\n\nexport default parseStructuralMetadata;\n", "import Check from \"../Core/Check.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport PropertyTexture from \"./PropertyTexture.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport MetadataTable from \"./MetadataTable.js\";\n\n/**\n * Parse the <code>EXT_feature_metadata</code> glTF extension to create a\n * structural metadata object.\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.extension The extension JSON object.\n * @param {MetadataSchema} options.schema The parsed schema.\n * @param {Object.<String, Uint8Array>} [options.bufferViews] An object mapping bufferView IDs to Uint8Array objects.\n * @param {Object.<String, Texture>} [options.textures] An object mapping texture IDs to {@link Texture} objects.\n * @return {StructuralMetadata} A structural metadata object\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseFeatureMetadataLegacy(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const extension = options.extension;\n\n // The calling code is responsible for loading the schema.\n // This keeps metadata parsing synchronous.\n const schema = options.schema;\n\n let i;\n const propertyTables = [];\n let sortedIds;\n if (defined(extension.featureTables)) {\n // Store textures in an array sorted by the dictionary keys. This\n // allows compatibility with the newer EXT_structural_metadata extension\n // which is array-based.\n sortedIds = Object.keys(extension.featureTables).sort();\n for (i = 0; i < sortedIds.length; i++) {\n const featureTableId = sortedIds[i];\n const featureTable = extension.featureTables[featureTableId];\n const classDefinition = schema.classes[featureTable.class];\n\n const metadataTable = new MetadataTable({\n count: featureTable.count,\n properties: featureTable.properties,\n class: classDefinition,\n bufferViews: options.bufferViews,\n });\n\n propertyTables.push(\n new PropertyTable({\n id: featureTableId,\n count: featureTable.count,\n metadataTable: metadataTable,\n extras: featureTable.extras,\n extensions: featureTable.extensions,\n })\n );\n }\n }\n\n const propertyTextures = [];\n if (defined(extension.featureTextures)) {\n // Store textures in an array sorted by the dictionary keys. This\n // allows compatibility with the newer EXT_structural_metadata extension\n // which is array-based.\n sortedIds = Object.keys(extension.featureTextures).sort();\n for (i = 0; i < sortedIds.length; i++) {\n const featureTextureId = sortedIds[i];\n const featureTexture = extension.featureTextures[featureTextureId];\n propertyTextures.push(\n new PropertyTexture({\n id: featureTextureId,\n propertyTexture: transcodeToPropertyTexture(featureTexture),\n class: schema.classes[featureTexture.class],\n textures: options.textures,\n })\n );\n }\n }\n\n return new StructuralMetadata({\n schema: schema,\n propertyTables: propertyTables,\n propertyTextures: propertyTextures,\n statistics: extension.statistics,\n extras: extension.extras,\n extensions: extension.extensions,\n });\n}\n\nfunction transcodeToPropertyTexture(featureTexture) {\n const propertyTexture = {\n class: featureTexture.class,\n properties: {},\n };\n\n const properties = featureTexture.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const oldProperty = properties[propertyId];\n const property = {\n // EXT_structural_metadata uses numeric channel indices instead of\n // a string of channel letters like \"rgba\".\n channels: reformatChannels(oldProperty.channels),\n extras: oldProperty.extras,\n extensions: oldProperty.extensions,\n };\n\n // EXT_feature_metadata puts the textureInfo in property.texture.\n // EXT_structural_metadata flattens this structure; essentially a\n // textureInfo + channels\n propertyTexture.properties[propertyId] = combine(\n oldProperty.texture,\n property,\n true\n );\n }\n }\n\n return propertyTexture;\n}\n\nfunction reformatChannels(channelsString) {\n const length = channelsString.length;\n const result = new Array(length);\n for (let i = 0; i < length; i++) {\n result[i] = \"rgba\".indexOf(channelsString[i]);\n }\n return result;\n}\n\nexport default parseFeatureMetadataLegacy;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport parseStructuralMetadata from \"./parseStructuralMetadata.js\";\nimport parseFeatureMetadataLegacy from \"./parseFeatureMetadataLegacy.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport ResourceLoaderState from \"./ResourceLoaderState.js\";\n\n/**\n * Loads glTF structural metadata\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfStructuralMetadataLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.gltf The glTF JSON.\n * @param {String} [options.extension] The <code>EXT_structural_metadata</code> extension object. If this is undefined, then extensionLegacy must be defined.\n * @param {String} [options.extensionLegacy] The legacy <code>EXT_feature_metadata</code> extension for backwards compatibility.\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF.\n * @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.\n * @param {FrameState} options.frameState The frame state.\n * @param {String} [options.cacheKey] The cache key of the resource.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction GltfStructuralMetadataLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltf = options.gltf;\n const extension = options.extension;\n const extensionLegacy = options.extensionLegacy;\n const gltfResource = options.gltfResource;\n const baseResource = options.baseResource;\n const supportedImageFormats = options.supportedImageFormats;\n const frameState = options.frameState;\n const cacheKey = options.cacheKey;\n const asynchronous = defaultValue(options.asynchronous, true);\n\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._gltf = gltf;\n this._extension = extension;\n this._extensionLegacy = extensionLegacy;\n this._supportedImageFormats = supportedImageFormats;\n this._frameState = frameState;\n this._cacheKey = cacheKey;\n this._asynchronous = asynchronous;\n this._bufferViewLoaders = [];\n this._textureLoaders = [];\n this._schemaLoader = undefined;\n this._structuralMetadata = undefined;\n this._state = ResourceLoaderState.UNLOADED;\n this._promise = undefined;\n}\n\nif (defined(Object.create)) {\n GltfStructuralMetadataLoader.prototype = Object.create(\n ResourceLoader.prototype\n );\n GltfStructuralMetadataLoader.prototype.constructor = GltfStructuralMetadataLoader;\n}\n\nObject.defineProperties(GltfStructuralMetadataLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfStructuralMetadataLoader.prototype\n *\n * @type {Promise.<GltfStructuralMetadataLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfStructuralMetadataLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return this._cacheKey;\n },\n },\n /**\n * The parsed structural metadata\n *\n * @memberof GltfStructuralMetadataLoader.prototype\n *\n * @type {StructuralMetadata}\n * @readonly\n * @private\n */\n structuralMetadata: {\n get: function () {\n return this._structuralMetadata;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfStructuralMetadataLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.load = function () {\n const bufferViewsPromise = loadBufferViews(this);\n const texturesPromise = loadTextures(this);\n const schemaPromise = loadSchema(this);\n\n this._gltf = undefined; // No longer need to hold onto the glTF\n this._state = ResourceLoaderState.LOADING;\n\n const that = this;\n\n this._promise = Promise.all([\n bufferViewsPromise,\n texturesPromise,\n schemaPromise,\n ])\n .then(function (results) {\n if (that.isDestroyed()) {\n return;\n }\n const bufferViews = results[0];\n const textures = results[1];\n const schema = results[2];\n\n if (defined(that._extension)) {\n that._structuralMetadata = parseStructuralMetadata({\n extension: that._extension,\n schema: schema,\n bufferViews: bufferViews,\n textures: textures,\n });\n } else {\n that._structuralMetadata = parseFeatureMetadataLegacy({\n extension: that._extensionLegacy,\n schema: schema,\n bufferViews: bufferViews,\n textures: textures,\n });\n }\n that._state = ResourceLoaderState.READY;\n return that;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n that.unload();\n that._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load structural metadata\";\n return Promise.reject(that.getError(errorMessage, error));\n });\n};\n\nfunction gatherBufferViewIdsFromProperties(properties, bufferViewIdSet) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const values = property.values;\n const arrayOffsets = property.arrayOffsets;\n const stringOffsets = property.stringOffsets;\n\n // Using an object like a mathematical set\n if (defined(values)) {\n bufferViewIdSet[values] = true;\n }\n if (defined(arrayOffsets)) {\n bufferViewIdSet[arrayOffsets] = true;\n }\n if (defined(stringOffsets)) {\n bufferViewIdSet[stringOffsets] = true;\n }\n }\n }\n}\n\nfunction gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const bufferView = property.bufferView;\n const arrayOffsetBufferView = property.arrayOffsetBufferView;\n const stringOffsetBufferView = property.stringOffsetBufferView;\n\n // Using an object like a mathematical set\n if (defined(bufferView)) {\n bufferViewIdSet[bufferView] = true;\n }\n if (defined(arrayOffsetBufferView)) {\n bufferViewIdSet[arrayOffsetBufferView] = true;\n }\n if (defined(stringOffsetBufferView)) {\n bufferViewIdSet[stringOffsetBufferView] = true;\n }\n }\n }\n}\n\nfunction gatherUsedBufferViewIds(extension) {\n const propertyTables = extension.propertyTables;\n const bufferViewIdSet = {};\n if (defined(propertyTables)) {\n for (let i = 0; i < propertyTables.length; i++) {\n const propertyTable = propertyTables[i];\n gatherBufferViewIdsFromProperties(\n propertyTable.properties,\n bufferViewIdSet\n );\n }\n }\n return bufferViewIdSet;\n}\n\nfunction gatherUsedBufferViewIdsLegacy(extensionLegacy) {\n const featureTables = extensionLegacy.featureTables;\n\n const bufferViewIdSet = {};\n if (defined(featureTables)) {\n for (const featureTableId in featureTables) {\n if (featureTables.hasOwnProperty(featureTableId)) {\n const featureTable = featureTables[featureTableId];\n const properties = featureTable.properties;\n if (defined(properties)) {\n gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet);\n }\n }\n }\n }\n return bufferViewIdSet;\n}\n\nfunction loadBufferViews(structuralMetadataLoader) {\n let bufferViewIds;\n if (defined(structuralMetadataLoader._extension)) {\n bufferViewIds = gatherUsedBufferViewIds(\n structuralMetadataLoader._extension\n );\n } else {\n bufferViewIds = gatherUsedBufferViewIdsLegacy(\n structuralMetadataLoader._extensionLegacy\n );\n }\n\n // Load the buffer views\n const bufferViewPromises = [];\n const bufferViewLoaders = {};\n for (const bufferViewId in bufferViewIds) {\n if (bufferViewIds.hasOwnProperty(bufferViewId)) {\n const bufferViewLoader = ResourceCache.loadBufferView({\n gltf: structuralMetadataLoader._gltf,\n bufferViewId: parseInt(bufferViewId),\n gltfResource: structuralMetadataLoader._gltfResource,\n baseResource: structuralMetadataLoader._baseResource,\n });\n bufferViewPromises.push(bufferViewLoader.promise);\n structuralMetadataLoader._bufferViewLoaders.push(bufferViewLoader);\n bufferViewLoaders[bufferViewId] = bufferViewLoader;\n }\n }\n\n // Return a promise to a map of buffer view IDs to typed arrays\n return Promise.all(bufferViewPromises).then(function () {\n const bufferViews = {};\n for (const bufferViewId in bufferViewLoaders) {\n if (bufferViewLoaders.hasOwnProperty(bufferViewId)) {\n const bufferViewLoader = bufferViewLoaders[bufferViewId];\n // Copy the typed array and let the underlying ArrayBuffer be freed\n const bufferViewTypedArray = new Uint8Array(\n bufferViewLoader.typedArray\n );\n bufferViews[bufferViewId] = bufferViewTypedArray;\n }\n }\n\n // Buffer views can be unloaded after the data has been copied\n unloadBufferViews(structuralMetadataLoader);\n\n return bufferViews;\n });\n}\n\nfunction gatherUsedTextureIds(structuralMetadataExtension) {\n // Gather the used textures\n const textureIds = {};\n const propertyTextures = structuralMetadataExtension.propertyTextures;\n if (defined(propertyTextures)) {\n for (let i = 0; i < propertyTextures.length; i++) {\n const propertyTexture = propertyTextures[i];\n const properties = propertyTexture.properties;\n if (defined(properties)) {\n gatherTextureIdsFromProperties(properties, textureIds);\n }\n }\n }\n return textureIds;\n}\n\nfunction gatherTextureIdsFromProperties(properties, textureIds) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n // in EXT_structural_metadata the property is a valid textureInfo.\n const textureInfo = properties[propertyId];\n textureIds[textureInfo.index] = textureInfo;\n }\n }\n}\n\nfunction gatherUsedTextureIdsLegacy(extensionLegacy) {\n // Gather the used textures\n const textureIds = {};\n const featureTextures = extensionLegacy.featureTextures;\n if (defined(featureTextures)) {\n for (const featureTextureId in featureTextures) {\n if (featureTextures.hasOwnProperty(featureTextureId)) {\n const featureTexture = featureTextures[featureTextureId];\n const properties = featureTexture.properties;\n if (defined(properties)) {\n gatherTextureIdsFromPropertiesLegacy(properties, textureIds);\n }\n }\n }\n }\n\n return textureIds;\n}\n\nfunction gatherTextureIdsFromPropertiesLegacy(properties, textureIds) {\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const textureInfo = property.texture;\n textureIds[textureInfo.index] = textureInfo;\n }\n }\n}\n\nfunction loadTextures(structuralMetadataLoader) {\n let textureIds;\n if (defined(structuralMetadataLoader._extension)) {\n textureIds = gatherUsedTextureIds(structuralMetadataLoader._extension);\n } else {\n textureIds = gatherUsedTextureIdsLegacy(\n structuralMetadataLoader._extensionLegacy\n );\n }\n\n const gltf = structuralMetadataLoader._gltf;\n const gltfResource = structuralMetadataLoader._gltfResource;\n const baseResource = structuralMetadataLoader._baseResource;\n const supportedImageFormats = structuralMetadataLoader._supportedImageFormats;\n const frameState = structuralMetadataLoader._frameState;\n const asynchronous = structuralMetadataLoader._asynchronous;\n\n // Load the textures\n const texturePromises = [];\n const textureLoaders = {};\n for (const textureId in textureIds) {\n if (textureIds.hasOwnProperty(textureId)) {\n const textureLoader = ResourceCache.loadTexture({\n gltf: gltf,\n textureInfo: textureIds[textureId],\n gltfResource: gltfResource,\n baseResource: baseResource,\n supportedImageFormats: supportedImageFormats,\n frameState: frameState,\n asynchronous: asynchronous,\n });\n texturePromises.push(textureLoader.promise);\n structuralMetadataLoader._textureLoaders.push(textureLoader);\n textureLoaders[textureId] = textureLoader;\n }\n }\n\n // Return a promise to a map of texture IDs to Texture objects\n return Promise.all(texturePromises).then(function () {\n const textures = {};\n for (const textureId in textureLoaders) {\n if (textureLoaders.hasOwnProperty(textureId)) {\n const textureLoader = textureLoaders[textureId];\n textures[textureId] = textureLoader.texture;\n }\n }\n return textures;\n });\n}\n\nfunction loadSchema(structuralMetadataLoader) {\n const extension = defaultValue(\n structuralMetadataLoader._extension,\n structuralMetadataLoader._extensionLegacy\n );\n\n let schemaLoader;\n if (defined(extension.schemaUri)) {\n const resource = structuralMetadataLoader._baseResource.getDerivedResource({\n url: extension.schemaUri,\n });\n schemaLoader = ResourceCache.loadSchema({\n resource: resource,\n });\n } else {\n schemaLoader = ResourceCache.loadSchema({\n schema: extension.schema,\n });\n }\n\n structuralMetadataLoader._schemaLoader = schemaLoader;\n\n return schemaLoader.promise.then(function (schemaLoader) {\n return schemaLoader.schema;\n });\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.process = function (frameState) {\n if (this._state !== ResourceLoaderState.LOADING) {\n return;\n }\n\n const textureLoaders = this._textureLoaders;\n const textureLoadersLength = textureLoaders.length;\n\n for (let i = 0; i < textureLoadersLength; ++i) {\n const textureLoader = textureLoaders[i];\n textureLoader.process(frameState);\n }\n};\n\nfunction unloadBufferViews(structuralMetadataLoader) {\n const bufferViewLoaders = structuralMetadataLoader._bufferViewLoaders;\n const bufferViewLoadersLength = bufferViewLoaders.length;\n for (let i = 0; i < bufferViewLoadersLength; ++i) {\n ResourceCache.unload(bufferViewLoaders[i]);\n }\n structuralMetadataLoader._bufferViewLoaders.length = 0;\n}\n\nfunction unloadTextures(structuralMetadataLoader) {\n const textureLoaders = structuralMetadataLoader._textureLoaders;\n const textureLoadersLength = textureLoaders.length;\n for (let i = 0; i < textureLoadersLength; ++i) {\n ResourceCache.unload(textureLoaders[i]);\n }\n structuralMetadataLoader._textureLoaders.length = 0;\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfStructuralMetadataLoader.prototype.unload = function () {\n unloadBufferViews(this);\n unloadTextures(this);\n\n if (defined(this._schemaLoader)) {\n ResourceCache.unload(this._schemaLoader);\n }\n this._schemaLoader = undefined;\n\n this._structuralMetadata = undefined;\n};\n\nexport default GltfStructuralMetadataLoader;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An enum describing the built-in vertex attribute semantics.\n *\n * @enum {String}\n *\n * @private\n */\nconst VertexAttributeSemantic = {\n /**\n * Per-vertex position.\n *\n * @type {String}\n * @constant\n */\n POSITION: \"POSITION\",\n\n /**\n * Per-vertex normal.\n *\n * @type {String}\n * @constant\n */\n NORMAL: \"NORMAL\",\n\n /**\n * Per-vertex tangent.\n *\n * @type {String}\n * @constant\n */\n TANGENT: \"TANGENT\",\n\n /**\n * Per-vertex texture coordinates.\n *\n * @type {String}\n * @constant\n */\n TEXCOORD: \"TEXCOORD\",\n\n /**\n * Per-vertex color.\n *\n * @type {String}\n * @constant\n */\n COLOR: \"COLOR\",\n\n /**\n * Per-vertex joint IDs for skinning.\n *\n * @type {String}\n * @constant\n */\n JOINTS: \"JOINTS\",\n\n /**\n * Per-vertex joint weights for skinning.\n *\n * @type {String}\n * @constant\n */\n WEIGHTS: \"WEIGHTS\",\n\n /**\n * Per-vertex feature ID.\n *\n * @type {String}\n * @constant\n */\n FEATURE_ID: \"_FEATURE_ID\",\n};\n\nfunction semanticToVariableName(semantic) {\n switch (semantic) {\n case VertexAttributeSemantic.POSITION:\n return \"positionMC\";\n case VertexAttributeSemantic.NORMAL:\n return \"normalMC\";\n case VertexAttributeSemantic.TANGENT:\n return \"tangentMC\";\n case VertexAttributeSemantic.TEXCOORD:\n return \"texCoord\";\n case VertexAttributeSemantic.COLOR:\n return \"color\";\n case VertexAttributeSemantic.JOINTS:\n return \"joints\";\n case VertexAttributeSemantic.WEIGHTS:\n return \"weights\";\n case VertexAttributeSemantic.FEATURE_ID:\n return \"featureId\";\n}\n}\n\n/**\n * Returns whether the vertex attribute semantic can have a set index.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n *\n * @returns {Boolean} Whether the semantic can have a set index.\n *\n * @private\n */\nVertexAttributeSemantic.hasSetIndex = function (semantic) {\n switch (semantic) {\n case VertexAttributeSemantic.POSITION:\n case VertexAttributeSemantic.NORMAL:\n case VertexAttributeSemantic.TANGENT:\n return false;\n case VertexAttributeSemantic.TEXCOORD:\n case VertexAttributeSemantic.COLOR:\n case VertexAttributeSemantic.JOINTS:\n case VertexAttributeSemantic.WEIGHTS:\n case VertexAttributeSemantic.FEATURE_ID:\n return true;\n}\n};\n\n/**\n * Gets the vertex attribute semantic matching the glTF semantic.\n *\n * @param {String} gltfSemantic The glTF semantic.\n *\n * @returns {VertexAttributeSemantic|undefined} The vertex attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nVertexAttributeSemantic.fromGltfSemantic = function (gltfSemantic) {\n let semantic = gltfSemantic;\n\n // Strip the set index from the semantic\n const setIndexRegex = /^(\\w+)_\\d+$/;\n const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n if (setIndexMatch !== null) {\n semantic = setIndexMatch[1];\n }\n\n switch (semantic) {\n case \"POSITION\":\n return VertexAttributeSemantic.POSITION;\n case \"NORMAL\":\n return VertexAttributeSemantic.NORMAL;\n case \"TANGENT\":\n return VertexAttributeSemantic.TANGENT;\n case \"TEXCOORD\":\n return VertexAttributeSemantic.TEXCOORD;\n case \"COLOR\":\n return VertexAttributeSemantic.COLOR;\n case \"JOINTS\":\n return VertexAttributeSemantic.JOINTS;\n case \"WEIGHTS\":\n return VertexAttributeSemantic.WEIGHTS;\n case \"_FEATURE_ID\":\n return VertexAttributeSemantic.FEATURE_ID;\n }\n\n return undefined;\n};\n\n/**\n * Gets the vertex attribute semantic matching the pnts semantic.\n *\n * @param {String} pntsSemantic The pnts semantic.\n *\n * @returns {VertexAttributeSemantic|undefined} The vertex attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nVertexAttributeSemantic.fromPntsSemantic = function (pntsSemantic) {\n switch (pntsSemantic) {\n case \"POSITION\":\n case \"POSITION_QUANTIZED\":\n return VertexAttributeSemantic.POSITION;\n case \"RGBA\":\n case \"RGB\":\n case \"RGB565\":\n return VertexAttributeSemantic.COLOR;\n case \"NORMAL\":\n case \"NORMAL_OCT16P\":\n return VertexAttributeSemantic.NORMAL;\n case \"BATCH_ID\":\n return VertexAttributeSemantic.FEATURE_ID;\n}\n};\n\n/**\n * Gets the GLSL type (such as <code>vec3</code> or <code>int</code>) for the\n * given vertex attribute.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n *\n * @returns {String} The shader type.\n *\n * @private\n */\nVertexAttributeSemantic.getGlslType = function (semantic) {\n switch (semantic) {\n case VertexAttributeSemantic.POSITION:\n case VertexAttributeSemantic.NORMAL:\n case VertexAttributeSemantic.TANGENT:\n return \"vec3\";\n case VertexAttributeSemantic.TEXCOORD:\n return \"vec2\";\n case VertexAttributeSemantic.COLOR:\n return \"vec4\";\n case VertexAttributeSemantic.JOINTS:\n return \"ivec4\";\n case VertexAttributeSemantic.WEIGHTS:\n return \"vec4\";\n case VertexAttributeSemantic.FEATURE_ID:\n return \"int\";\n}\n};\n\n/**\n * Gets the variable name for the given semantic and set index.\n *\n * @param {VertexAttributeSemantic} semantic The semantic.\n * @param {Number} [setIndex] The set index.\n *\n * @returns {String} The variable name.\n *\n * @private\n */\nVertexAttributeSemantic.getVariableName = function (semantic, setIndex) {\n let variableName = semanticToVariableName(semantic);\n if (defined(setIndex)) {\n variableName += `_${setIndex}`;\n }\n return variableName;\n};\n\nexport default Object.freeze(VertexAttributeSemantic);\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Axis from \"../Axis.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport CullFace from \"../CullFace.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\n\n/**\n * Utility functions for {@link Model}.\n *\n * @private\n */\nfunction ModelUtility() {}\n\n/**\n * Create a function for reporting when a model fails to load\n *\n * @param {Model} model The model to report about\n * @param {String} type The type of object to report about\n * @param {String} path The URI of the model file\n * @returns {Function} An error function that throws an error for the failed model\n *\n * @private\n */\nModelUtility.getFailedLoadFunction = function (model, type, path) {\n return function (error) {\n let message = `Failed to load ${type}: ${path}`;\n if (defined(error)) {\n message += `\\n${error.message}`;\n }\n\n const runtimeError = new RuntimeError(message);\n if (defined(error)) {\n // the original call stack is often more useful than the new error's stack,\n // so add the information here\n runtimeError.stack = `Original stack:\\n${error.stack}\\nHandler stack:\\n${runtimeError.stack}`;\n }\n\n return Promise.reject(runtimeError);\n };\n};\n\n/**\n * Get a transformation matrix from a node in the model.\n *\n * @param {ModelComponents.Node} node The node components\n * @returns {Matrix4} The computed transformation matrix. If no transformation matrix or parameters are specified, this will be the identity matrix.\n *\n * @private\n */\nModelUtility.getNodeTransform = function (node) {\n if (defined(node.matrix)) {\n return node.matrix;\n }\n\n return Matrix4.fromTranslationQuaternionRotationScale(\n defined(node.translation) ? node.translation : Cartesian3.ZERO,\n defined(node.rotation) ? node.rotation : Quaternion.IDENTITY,\n defined(node.scale) ? node.scale : Cartesian3.ONE\n );\n};\n\n/**\n * Find an attribute by semantic such as POSITION or TANGENT.\n *\n * @param {ModelComponents.Primitive|ModelComponents.Instances} object The primitive components or instances object\n * @param {VertexAttributeSemantic|InstanceAttributeSemantic} semantic The semantic to search for\n * @param {Number} [setIndex] The set index of the semantic. May be undefined for some semantics (POSITION, NORMAL, TRANSLATION, ROTATION, for example)\n * @return {ModelComponents.Attribute} The selected attribute, or undefined if not found.\n *\n * @private\n */\nModelUtility.getAttributeBySemantic = function (object, semantic, setIndex) {\n const attributes = object.attributes;\n const attributesLength = attributes.length;\n for (let i = 0; i < attributesLength; ++i) {\n const attribute = attributes[i];\n const matchesSetIndex = defined(setIndex)\n ? attribute.setIndex === setIndex\n : true;\n if (attribute.semantic === semantic && matchesSetIndex) {\n return attribute;\n }\n }\n\n return undefined;\n};\n\n/**\n * Similar to getAttributeBySemantic, but search using the name field only,\n * as custom attributes do not have a semantic.\n *\n * @param {ModelComponents.Primitive|ModelComponents.Instances} object The primitive components or instances object\n * @param {String} name The name of the attribute as it appears in the model file.\n * @return {ModelComponents.Attribute} The selected attribute, or undefined if not found.\n *\n * @private\n */\nModelUtility.getAttributeByName = function (object, name) {\n const attributes = object.attributes;\n const attributesLength = attributes.length;\n for (let i = 0; i < attributesLength; ++i) {\n const attribute = attributes[i];\n if (attribute.name === name) {\n return attribute;\n }\n }\n\n return undefined;\n};\n\n/**\n * Find a feature ID from an array with label or positionalLabel matching the\n * given label\n * @param {Array.<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture>} featureIds\n * @param {String} label the label to search for\n * @returns {ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture} The feature ID set if found, otherwise <code>undefined</code>\n *\n * @private\n */\nModelUtility.getFeatureIdsByLabel = function (featureIds, label) {\n for (let i = 0; i < featureIds.length; i++) {\n const featureIdSet = featureIds[i];\n if (\n featureIdSet.positionalLabel === label ||\n featureIdSet.label === label\n ) {\n return featureIdSet;\n }\n }\n\n return undefined;\n};\n\nModelUtility.hasQuantizedAttributes = function (attributes) {\n if (!defined(attributes)) {\n return false;\n }\n\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n if (defined(attribute.quantization)) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * @param {ModelComponents.Attribute} attribute\n *\n * @private\n */\nModelUtility.getAttributeInfo = function (attribute) {\n const semantic = attribute.semantic;\n const setIndex = attribute.setIndex;\n\n let variableName;\n let hasSemantic = false;\n if (defined(semantic)) {\n variableName = VertexAttributeSemantic.getVariableName(semantic, setIndex);\n hasSemantic = true;\n } else {\n variableName = attribute.name;\n // According to the glTF 2.0 spec, custom attributes must be prepended with\n // an underscore.\n variableName = variableName.replace(/^_/, \"\");\n variableName = variableName.toLowerCase();\n }\n\n const isVertexColor = /^color_\\d+$/.test(variableName);\n const attributeType = attribute.type;\n let glslType = AttributeType.getGlslType(attributeType);\n\n // color_n can be either a vec3 or a vec4. But in GLSL we can always use\n // attribute vec4 since GLSL promotes vec3 attribute data to vec4 with\n // the .a channel set to 1.0.\n if (isVertexColor) {\n glslType = \"vec4\";\n }\n\n const isQuantized = defined(attribute.quantization);\n let quantizedGlslType;\n if (isQuantized) {\n // The quantized color_n attribute also is promoted to a vec4 in the shader\n quantizedGlslType = isVertexColor\n ? \"vec4\"\n : AttributeType.getGlslType(attribute.quantization.type);\n }\n\n return {\n attribute: attribute,\n isQuantized: isQuantized,\n variableName: variableName,\n hasSemantic: hasSemantic,\n glslType: glslType,\n quantizedGlslType: quantizedGlslType,\n };\n};\n\nconst cartesianMaxScratch = new Cartesian3();\nconst cartesianMinScratch = new Cartesian3();\n\n/**\n * Get the minimum and maximum values for a primitive's POSITION attribute.\n * This is used to compute the bounding sphere of the primitive, as well as\n * the bounding sphere of the whole model.\n *\n * @param {ModelComponents.Primitive} primitive The primitive components.\n * @param {Cartesian3} [instancingTranslationMin] The component-wise minimum value of the instancing translation attribute.\n * @param {Cartesian3} [instancingTranslationMax] The component-wise maximum value of the instancing translation attribute.\n *\n * @returns {Object} An object containing the minimum and maximum position values.\n *\n * @private\n */\nModelUtility.getPositionMinMax = function (\n primitive,\n instancingTranslationMin,\n instancingTranslationMax\n) {\n const positionGltfAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n \"POSITION\"\n );\n\n let positionMax = positionGltfAttribute.max;\n let positionMin = positionGltfAttribute.min;\n\n if (defined(instancingTranslationMax) && defined(instancingTranslationMin)) {\n positionMin = Cartesian3.add(\n positionMin,\n instancingTranslationMin,\n cartesianMinScratch\n );\n positionMax = Cartesian3.add(\n positionMax,\n instancingTranslationMax,\n cartesianMaxScratch\n );\n }\n\n return {\n min: positionMin,\n max: positionMax,\n };\n};\n\n/**\n * Model matrices in a model file (e.g. glTF) are typically in a different\n * coordinate system, such as with y-up instead of z-up in 3D Tiles.\n * This function returns a matrix that will correct this such that z is up,\n * and x is forward.\n *\n * @param {Axis} upAxis The original up direction\n * @param {Axis} forwardAxis The original forward direction\n * @param {Matrix4} result The matrix in which to store the result.\n * @returns {Matrix4} The axis correction matrix\n *\n * @private\n */\nModelUtility.getAxisCorrectionMatrix = function (upAxis, forwardAxis, result) {\n result = Matrix4.clone(Matrix4.IDENTITY, result);\n\n if (upAxis === Axis.Y) {\n result = Matrix4.clone(Axis.Y_UP_TO_Z_UP, result);\n } else if (upAxis === Axis.X) {\n result = Matrix4.clone(Axis.X_UP_TO_Z_UP, result);\n }\n\n if (forwardAxis === Axis.Z) {\n // glTF 2.0 has a Z-forward convention that must be adapted here to X-forward.\n result = Matrix4.multiplyTransformation(result, Axis.Z_UP_TO_X_UP, result);\n }\n\n return result;\n};\n\nconst scratchMatrix3 = new Matrix3();\n\n/**\n * Get the cull face to use in the command's render state.\n * <p>\n * From the glTF spec section 3.7.4:\n * When a mesh primitive uses any triangle-based topology (i.e., triangles,\n * triangle strip, or triangle fan), the determinant of the node\u2019s global\n * transform defines the winding order of that primitive. If the determinant\n * is a positive value, the winding order triangle faces is counterclockwise;\n * in the opposite case, the winding order is clockwise.\n * </p>\n *\n * @param {Matrix4} modelMatrix The model matrix\n * @param {PrimitiveType} primitiveType The primitive type\n * @returns {CullFace} The cull face\n *\n * @private\n */\nModelUtility.getCullFace = function (modelMatrix, primitiveType) {\n if (!PrimitiveType.isTriangles(primitiveType)) {\n return CullFace.BACK;\n }\n\n const matrix3 = Matrix4.getMatrix3(modelMatrix, scratchMatrix3);\n return Matrix3.determinant(matrix3) < 0.0 ? CullFace.FRONT : CullFace.BACK;\n};\n\n/**\n * Sanitize the identifier to be used in a GLSL shader. The identifier\n * is sanitized as follows:\n * - Replace all sequences of non-alphanumeric characters with a single `_`.\n * - If the gl_ prefix is present, remove it. The prefix is reserved in GLSL.\n * - If the identifier starts with a digit, prefix it with an underscore.\n *\n * @example\n * // Returns \"customProperty\"\n * ModelUtility.sanitizeGlslIdentifier(\"gl_customProperty\");\n *\n * @example\n * // Returns \"_1234\"\n * ModelUtility.sanitizeGlslIdentifier(\"1234\");\n *\n * @param {String} identifier The original identifier.\n *\n * @returns {String} The sanitized version of the identifier.\n */\nModelUtility.sanitizeGlslIdentifier = function (identifier) {\n // Remove non-alphanumeric characters and replace with a single underscore.\n // This regex is designed so that the result won't have multiple underscores\n // in a row.\n let sanitizedIdentifier = identifier.replaceAll(/[^A-Za-z0-9]+/g, \"_\");\n // Remove the gl_ prefix if present.\n sanitizedIdentifier = sanitizedIdentifier.replace(/^gl_/, \"\");\n // Add an underscore if first character is a digit.\n if (/^\\d/.test(sanitizedIdentifier)) {\n sanitizedIdentifier = `_${sanitizedIdentifier}`;\n }\n\n return sanitizedIdentifier;\n};\n\nModelUtility.supportedExtensions = {\n AGI_articulations: true,\n CESIUM_primitive_outline: true,\n CESIUM_RTC: true,\n EXT_feature_metadata: true,\n EXT_instance_features: true,\n EXT_mesh_features: true,\n EXT_mesh_gpu_instancing: true,\n EXT_meshopt_compression: true,\n EXT_structural_metadata: true,\n EXT_texture_webp: true,\n KHR_blend: true,\n KHR_draco_mesh_compression: true,\n KHR_techniques_webgl: true,\n KHR_materials_common: true,\n KHR_materials_pbrSpecularGlossiness: true,\n KHR_materials_unlit: true,\n KHR_mesh_quantization: true,\n KHR_texture_basisu: true,\n KHR_texture_transform: true,\n WEB3D_quantized_attributes: true,\n};\n\n/**\n * Checks whether or not the extensions required by the glTF are\n * supported. If an unsupported extension is found, this throws\n * a {@link RuntimeError} with the extension name.\n *\n * @param {Array<String>} extensionsRequired The extensionsRequired array in the glTF.\n */\nModelUtility.checkSupportedExtensions = function (extensionsRequired) {\n const length = extensionsRequired.length;\n for (let i = 0; i < length; i++) {\n const extension = extensionsRequired[i];\n if (!ModelUtility.supportedExtensions[extension]) {\n throw new RuntimeError(`Unsupported glTF Extension: ${extension}`);\n }\n }\n};\n\nexport default ModelUtility;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * An enum describing the built-in instance attribute semantics.\n *\n * @enum {String}\n *\n * @private\n */\nconst InstanceAttributeSemantic = {\n /**\n * Per-instance translation.\n *\n * @type {String}\n * @constant\n */\n TRANSLATION: \"TRANSLATION\",\n\n /**\n * Per-instance rotation.\n *\n * @type {String}\n * @constant\n */\n ROTATION: \"ROTATION\",\n\n /**\n * Per-instance scale.\n *\n * @type {String}\n * @constant\n */\n SCALE: \"SCALE\",\n\n /**\n * Per-instance feature ID.\n *\n * @type {String}\n * @constant\n */\n FEATURE_ID: \"_FEATURE_ID\",\n};\n\n/**\n * Gets the instance attribute semantic matching the glTF attribute semantic.\n *\n * @returns {InstanceAttributeSemantic} The instance attribute semantic, or undefined if there is no match.\n *\n * @private\n */\nInstanceAttributeSemantic.fromGltfSemantic = function (gltfSemantic) {\nlet semantic = gltfSemantic;\n\n // Strip the set index from the semantic\n const setIndexRegex = /^(\\w+)_\\d+$/;\n const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n if (setIndexMatch !== null) {\n semantic = setIndexMatch[1];\n }\n\n switch (semantic) {\n case \"TRANSLATION\":\n return InstanceAttributeSemantic.TRANSLATION;\n case \"ROTATION\":\n return InstanceAttributeSemantic.ROTATION;\n case \"SCALE\":\n return InstanceAttributeSemantic.SCALE;\n case \"_FEATURE_ID\":\n return InstanceAttributeSemantic.FEATURE_ID;\n }\n\n return undefined;\n};\n\nexport default Object.freeze(InstanceAttributeSemantic);\n", "import Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport PixelFormat from \"../../Core/PixelFormat.js\";\nimport ContextLimits from \"../../Renderer/ContextLimits.js\";\nimport Sampler from \"../../Renderer/Sampler.js\";\nimport Texture from \"../../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n// glTF does not allow an index value of 65535 because this is the primitive\n// restart value in some APIs.\nconst MAX_GLTF_UINT16_INDEX = 65534;\nconst MAX_GLTF_UINT8_INDEX = 255;\n\n/**\n * A class to handle the low-level details of processing indices and vertex\n * attributes for the CESIUM_primitive_outline extension.\n * <p>\n * To render outlines, a lookup texture is used 3 times, once per edge of a\n * triangle. In order to render correctly, all three vertices must agree on the\n * same ordering of the three edges when computing outline (texture)\n * coordinates. Sometimes this is not possible, as a vertex shared between\n * multiple triangles may become overly constrained. In such cases, vertices are\n * copied and indices are updated until valid outline coordinates can be\n * defined.\n * </p>\n *\n * @see {@link https://www.researchgate.net/publication/220067637_Fast_and_versatile_texture-based_wireframe_rendering|Fast and versatile texture-based wireframe rendering}\n *\n * @alias PrimitiveOutlineGenerator\n * @constructor\n *\n * @param {Number} options Object with the following properties:\n * @param {Uint8Array|Uint16Array|Uint32Array} options.triangleIndices The original triangle indices of the primitive. The constructor takes ownership of this typed array as it will be modified internally. Use the updatedTriangleIndices getter to get the final result.\n * @param {Number[]} options.outlineIndices The indices of edges in the triangle from the CESIUM_primitive_outline extension\n * @param {Number} options.originalVertexCount The original number of vertices in the primitive\n * @example\n * // The constructor will compute the updated indices and generate outline\n * // coordinates.\n * const outlineGenerator = new PrimitiveOutlineGenerator({\n * triangleIndices: primitive.indices.typedArray,\n * outlineIndices: outlineIndices,\n * originalVertexCount: primitive.attributes[0].count\n * });\n *\n * // Caller must update the indices (the data type may have been upgraded!)\n * primitive.indices.typedArray = outlineGenerator.updatedTriangleIndices;\n * primitive.indices.indexDatatype =\n * IndexDatatype.fromTypedArray(primitive.indices.typedArray);\n *\n * // Create a new attribute for the generated outline coordinates\n * primitive.outlineCoordinates = new ModelComponents.Attribute();\n * // ... initialize as a vec3 attribute\n * primitive.outlineCoordinates.typedArray =\n * outlineGenerator.outlineCoordinates;\n *\n * // Updating an attribute\n * const attribute = primitive.attributes[i];\n * attribute.typedArray = outlineGenerator.updateAttribute(\n * attribute.typedArray\n * );\n *\n * @private\n */\nfunction PrimitiveOutlineGenerator(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const triangleIndices = options.triangleIndices;\n const outlineIndices = options.outlineIndices;\n const originalVertexCount = options.originalVertexCount;\n\n /**\n * The triangle indices. It will be modified in place.\n *\n * @type {Uint8Array|Uint16Array|Uint32Array}\n *\n * @private\n */\n this._triangleIndices = triangleIndices;\n\n /**\n * How many vertices were originally in the primitive\n *\n * @type {Number}\n *\n * @private\n */\n this._originalVertexCount = originalVertexCount;\n\n /**\n * The outline indices represent edges of the primitive's triangle mesh where\n * outlines must be drawn. This is stored as a hash set for efficient\n * checks of whether an edge is present.\n *\n * @type {EdgeSet}\n *\n * @private\n */\n this._edges = new EdgeSet(outlineIndices, originalVertexCount);\n\n /**\n * The typed array that will store the outline texture coordinates\n * once computed. This typed array should be turned into a vertex attribute\n * when rendering outlines.\n *\n * @type {Float32Array}\n *\n * @private\n */\n this._outlineCoordinatesTypedArray = undefined;\n\n /**\n * Array containing the indices of any vertices that must be copied and\n * appended to the list.\n *\n * @type {Number[]}\n *\n * @private\n */\n this._extraVertices = [];\n\n initialize(this);\n}\n\nObject.defineProperties(PrimitiveOutlineGenerator.prototype, {\n /**\n * The updated triangle indices after generating outlines. The caller is for\n * responsible for updating the primitive's indices to use this array.\n *\n * @memberof PrimitiveOutlineGenerator.prototype\n *\n * @type {Uint8Array|Uint16Array|Uint32Array}\n * @readonly\n *\n * @private\n */\n updatedTriangleIndices: {\n get: function () {\n return this._triangleIndices;\n },\n },\n\n /**\n * The computed outline coordinates. The caller is responsible for\n * turning this into a vec3 attribute for rendering.\n *\n * @memberof PrimitiveOutlineGenerator.prototype\n *\n * @type {Float32Array}\n * @readonly\n *\n * @private\n */\n outlineCoordinates: {\n get: function () {\n return this._outlineCoordinatesTypedArray;\n },\n },\n});\n\n/**\n * Initialize the outline generator from the CESIUM_primitive_outline\n * extension data. This updates the triangle indices and generates outline\n * coordinates, but does not update other attributes (see\n * {@link PrimitiveOutlineGenerator#updateAttribute})\n *\n * @param {PrimitiveOutlineGenerator} outlineGenerator The outline generator\n *\n * @private\n */\nfunction initialize(outlineGenerator) {\n // triangle indices may be extended from 16-bits to 32 bits if needed.\n let triangleIndices = outlineGenerator._triangleIndices;\n\n const edges = outlineGenerator._edges;\n const outlineCoordinates = [];\n const extraVertices = outlineGenerator._extraVertices;\n const vertexCount = outlineGenerator._originalVertexCount;\n\n // Dictionary of unmatchable vertex index -> copied vertex index. This is\n // used so we don't copy the same vertex more than necessary.\n const vertexCopies = {};\n\n // For each triangle, adjust vertex data so that the correct edges are outlined.\n for (let i = 0; i < triangleIndices.length; i += 3) {\n let i0 = triangleIndices[i];\n let i1 = triangleIndices[i + 1];\n let i2 = triangleIndices[i + 2];\n\n // Check which edges need to be outlined based on the contents of the\n // outline indices from the extension.\n const all = false; // set this to true to draw a full wireframe.\n const hasEdge01 = all || edges.hasEdge(i0, i1);\n const hasEdge12 = all || edges.hasEdge(i1, i2);\n const hasEdge20 = all || edges.hasEdge(i2, i0);\n\n // Attempt to compute outline coordinates. If no consistent ordering of\n // edges can be computed (due to constraints from adjacent faces), the\n // first attempt may fail. In such cases, make a copy of a vertex and\n // try again. This relaxes the constraints, so the while loop will\n // eventually finish.\n let unmatchableVertexIndex = matchAndStoreCoordinates(\n outlineCoordinates,\n i0,\n i1,\n i2,\n hasEdge01,\n hasEdge12,\n hasEdge20\n );\n while (defined(unmatchableVertexIndex)) {\n // Copy the unmatchable index and try again.\n let copy = vertexCopies[unmatchableVertexIndex];\n\n // Only copy if we haven't already\n if (!defined(copy)) {\n // The new vertex will appear at the end of the vertex list\n copy = vertexCount + extraVertices.length;\n\n // Sometimes the copied vertex will in turn be a copy, so search\n // for the original one\n let original = unmatchableVertexIndex;\n while (original >= vertexCount) {\n original = extraVertices[original - vertexCount];\n }\n\n // Store the original vertex that needs to be copied\n extraVertices.push(original);\n\n // mark that we've seen this unmatchable vertex before so we don't\n // copy it multiple times.\n vertexCopies[unmatchableVertexIndex] = copy;\n }\n\n // Corner case: copying a vertex may overflow the range of an\n // 8- or 16- bit index buffer, so upgrade to a larger data type.\n if (\n copy > MAX_GLTF_UINT16_INDEX &&\n (triangleIndices instanceof Uint16Array ||\n triangleIndices instanceof Uint8Array)\n ) {\n triangleIndices = new Uint32Array(triangleIndices);\n } else if (\n copy > MAX_GLTF_UINT8_INDEX &&\n triangleIndices instanceof Uint8Array\n ) {\n triangleIndices = new Uint16Array(triangleIndices);\n }\n\n // Update the triangle indices buffer to use the copied vertex instead\n // of the original one.\n if (unmatchableVertexIndex === i0) {\n i0 = copy;\n triangleIndices[i] = copy;\n } else if (unmatchableVertexIndex === i1) {\n i1 = copy;\n triangleIndices[i + 1] = copy;\n } else {\n i2 = copy;\n triangleIndices[i + 2] = copy;\n }\n\n // Attempt to generate outline coordinates again. This is more likely\n // to succeed since the copied vertex has no constraints on which order\n // of the 3 edges to use.\n unmatchableVertexIndex = matchAndStoreCoordinates(\n outlineCoordinates,\n i0,\n i1,\n i2,\n hasEdge01,\n hasEdge12,\n hasEdge20\n );\n }\n }\n\n // Store the triangle indices in case we had to expand to 32-bit indices\n outlineGenerator._triangleIndices = triangleIndices;\n outlineGenerator._outlineCoordinatesTypedArray = new Float32Array(\n outlineCoordinates\n );\n}\n\n/**\n * This function attempts to compute a valid ordering of edges for this triangle\n * and if found, computes outline coordinates for the three vertices. If not\n * possible, one of the vertices is returned so it can be copied.\n *\n * @param {Number[]} outlineCoordinates An array to store the computed outline coordinates. There are 3 components per vertex. This will be modified in place.\n * @param {Number} i0 The index of the first vertex of the triangle.\n * @param {Number} i1 The index of the second vertex of the triangle.\n * @param {Number} i2 The index of the third vertex of the triangle.\n * @param {Boolean} hasEdge01 Whether there is an outline edge between vertices 0 and 1 of the triangle\n * @param {Boolean} hasEdge12 Whether there is an outline edge between vertices 1 and 2 of the triangle\n * @param {Boolean} hasEdge20 Whether there is an outline edge between vertices 2 and 0 of the triangle\n * @returns {Number} If it's not possible to compute consistent outline coordinates for this triangle, the index of the most constrained vertex of i0, i1 and i2 is returned. Otherwise, this function returns undefined to indicate a successful match.\n *\n * @private\n */\nfunction matchAndStoreCoordinates(\n outlineCoordinates,\n i0,\n i1,\n i2,\n hasEdge01,\n hasEdge12,\n hasEdge20\n) {\n const a0 = hasEdge20 ? 1.0 : 0.0;\n const b0 = hasEdge01 ? 1.0 : 0.0;\n const c0 = 0.0;\n\n const i0Mask = computeOrderMask(outlineCoordinates, i0, a0, b0, c0);\n if (i0Mask === 0) {\n return i0;\n }\n\n const a1 = 0.0;\n const b1 = hasEdge01 ? 1.0 : 0.0;\n const c1 = hasEdge12 ? 1.0 : 0.0;\n\n const i1Mask = computeOrderMask(outlineCoordinates, i1, a1, b1, c1);\n if (i1Mask === 0) {\n return i1;\n }\n\n const a2 = hasEdge20 ? 1.0 : 0.0;\n const b2 = 0.0;\n const c2 = hasEdge12 ? 1.0 : 0.0;\n\n const i2Mask = computeOrderMask(outlineCoordinates, i2, a2, b2, c2);\n if (i2Mask === 0) {\n return i2;\n }\n\n const workingOrders = i0Mask & i1Mask & i2Mask;\n\n let a, b, c;\n\n if (workingOrders & (1 << 0)) {\n // 0 - abc\n a = 0;\n b = 1;\n c = 2;\n } else if (workingOrders & (1 << 1)) {\n // 1 - acb\n a = 0;\n c = 1;\n b = 2;\n } else if (workingOrders & (1 << 2)) {\n // 2 - bac\n b = 0;\n a = 1;\n c = 2;\n } else if (workingOrders & (1 << 3)) {\n // 3 - bca\n b = 0;\n c = 1;\n a = 2;\n } else if (workingOrders & (1 << 4)) {\n // 4 - cab\n c = 0;\n a = 1;\n b = 2;\n } else if (workingOrders & (1 << 5)) {\n // 5 - cba\n c = 0;\n b = 1;\n a = 2;\n } else {\n // No ordering works. Report the most constrained vertex (i.e. the one with\n // fewest valid orderings) as unmatched so we copy that one.\n const i0ValidOrderCount = popcount6Bit(i0Mask);\n const i1ValidOrderCount = popcount6Bit(i1Mask);\n const i2ValidOrderCount = popcount6Bit(i2Mask);\n if (\n i0ValidOrderCount < i1ValidOrderCount &&\n i0ValidOrderCount < i2ValidOrderCount\n ) {\n return i0;\n } else if (i1ValidOrderCount < i2ValidOrderCount) {\n return i1;\n }\n return i2;\n }\n\n // We found a valid ordering of the edges, so store the outline coordinates\n // for this triangle.\n const i0Start = i0 * 3;\n outlineCoordinates[i0Start + a] = a0;\n outlineCoordinates[i0Start + b] = b0;\n outlineCoordinates[i0Start + c] = c0;\n\n const i1Start = i1 * 3;\n outlineCoordinates[i1Start + a] = a1;\n outlineCoordinates[i1Start + b] = b1;\n outlineCoordinates[i1Start + c] = c1;\n\n const i2Start = i2 * 3;\n outlineCoordinates[i2Start + a] = a2;\n outlineCoordinates[i2Start + b] = b2;\n outlineCoordinates[i2Start + c] = c2;\n\n // successful match\n return undefined;\n}\n\n/**\n * Each vertex has three coordinates, a, b, and c.\n * a is the coordinate that applies to edge 2-0 for the vertex.\n * b is the coordinate that applies to edge 0-1 for the vertex.\n * c is the coordinate that applies to edge 1-2 for the vertex.\n *\n * A single triangle with all edges highlighted:\n *\n * | a | b | c |\n * | 1 | 1 | 0 |\n * 0\n * / \\\n * / \\\n * edge 0-1 / \\ edge 2-0\n * / \\\n * / \\\n * | a | b | c | 1-----------2 | a | b | c |\n * | 0 | 1 | 1 | edge 1-2 | 1 | 0 | 1 |\n *\n * There are 6 possible orderings of coordinates a, b, and c:\n * 0 - abc\n * 1 - acb\n * 2 - bac\n * 3 - bca\n * 4 - cab\n * 5 - cba\n *\n * All vertices must use the _same ordering_ for the edges to be rendered\n * correctly. So we compute a bitmask for each vertex, where the bit at\n * each position indicates whether that ordering works (i.e. doesn't\n * conflict with already-assigned coordinates) for that vertex.\n *\n * Then we can find an ordering that works for all three vertices with a\n * bitwise AND.\n *\n * @param {Number[]} outlineCoordinates The array of outline coordinates\n * @param {Number} vertexIndex The index of the vertex to compute the mask for\n * @param {Number} a The outline coordinate for edge 2-0\n * @param {Number} b The outline coordinate for edge 0-1\n * @param {Number} c The outline coordinate for edge 1-2\n * @returns {Number} A bitmask with 6 bits where a 1 indicates the corresponding ordering is valid.\n *\n * @private\n */\nfunction computeOrderMask(outlineCoordinates, vertexIndex, a, b, c) {\n const startIndex = vertexIndex * 3;\n const first = outlineCoordinates[startIndex];\n const second = outlineCoordinates[startIndex + 1];\n const third = outlineCoordinates[startIndex + 2];\n\n // If one coordinate is undefined, they all are since matchAndStoreCoordinates sets\n // all 3 components at once. In this case, all orderings are fine.\n if (!defined(first)) {\n return 0b111111;\n }\n\n return (\n ((first === a && second === b && third === c) << 0) |\n ((first === a && second === c && third === b) << 1) |\n ((first === b && second === a && third === c) << 2) |\n ((first === b && second === c && third === a) << 3) |\n ((first === c && second === a && third === b) << 4) |\n ((first === c && second === b && third === a) << 5)\n );\n}\n\n/**\n * Compute the popcount for 6-bit integers (values 0-63). This is the\n * number of 1s in the binary representation of the value.\n *\n * @param {Number} value The value to compute the popcount for\n * @returns {Number} The number of 1s in the binary representation of value\n *\n * @private\n */\nfunction popcount6Bit(value) {\n return (\n (value & 1) +\n ((value >> 1) & 1) +\n ((value >> 2) & 1) +\n ((value >> 3) & 1) +\n ((value >> 4) & 1) +\n ((value >> 5) & 1)\n );\n}\n\n/**\n * After computing the outline coordinates, some vertices may need to be\n * copied and appended to the end of the list of vertices. This function updates\n * a typed array for a single attribute (e.g. POSITION or NORMAL).\n *\n * @param {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array} attributeTypedArray The attribute values to update. This function takes ownership of this typed array\n * @returns {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array} A new typed array that contains the existing attribute values, plus any copied values at the end.\n *\n * @private\n */\nPrimitiveOutlineGenerator.prototype.updateAttribute = function (\n attributeTypedArray\n) {\n const extraVertices = this._extraVertices;\n\n const originalLength = attributeTypedArray.length;\n\n // This is a stride in number of typed elements. For example, a VEC3 would\n // have a stride of 3 (floats)\n const stride = originalLength / this._originalVertexCount;\n\n const extraVerticesLength = extraVertices.length;\n\n // Make a larger typed array of the same type as the input\n const ArrayType = attributeTypedArray.constructor;\n const result = new ArrayType(\n attributeTypedArray.length + extraVerticesLength * stride\n );\n\n // Copy original vertices\n result.set(attributeTypedArray);\n\n // Copy the vertices added for outlining\n for (let i = 0; i < extraVerticesLength; i++) {\n const sourceIndex = extraVertices[i] * stride;\n const resultIndex = originalLength + i * stride;\n for (let j = 0; j < stride; j++) {\n result[resultIndex + j] = result[sourceIndex + j];\n }\n }\n\n return result;\n};\n\n/**\n * Create a mip-mapped lookup texture for rendering outlines. The texture is\n * constant, so it is cached on the context.\n *\n * @param {Context} context The context to use for creating the texture\n * @returns {Texture} The outline lookup texture.\n *\n * @private\n */\nPrimitiveOutlineGenerator.createTexture = function (context) {\n let cache = context.cache.modelOutliningCache;\n if (!defined(cache)) {\n cache = context.cache.modelOutliningCache = {};\n }\n\n if (defined(cache.outlineTexture)) {\n return cache.outlineTexture;\n }\n\n const maxSize = Math.min(4096, ContextLimits.maximumTextureSize);\n\n let size = maxSize;\n const levelZero = createMipLevel(size);\n\n const mipLevels = [];\n\n while (size > 1) {\n size >>= 1;\n mipLevels.push(createMipLevel(size));\n }\n\n const texture = new Texture({\n context: context,\n source: {\n arrayBufferView: levelZero,\n mipLevels: mipLevels,\n },\n width: maxSize,\n height: 1,\n pixelFormat: PixelFormat.LUMINANCE,\n sampler: new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,\n magnificationFilter: TextureMagnificationFilter.LINEAR,\n }),\n });\n\n cache.outlineTexture = texture;\n\n return texture;\n};\n\n/**\n * Create an outline lookup texture for a single mip level. This is a texture of\n * mostly 0 values, except for the last value which is brighter to indicate\n * the outline.\n *\n * @param {Number} size The width of the texture for this mip level\n * @returns {Uint8Array} A typed array containing the texels of the mip level\n *\n * @private\n */\nfunction createMipLevel(size) {\n const texture = new Uint8Array(size);\n\n // This lookup texture creates an outline with width 0.75 px in screen space.\n texture[size - 1] = 192;\n\n // As we reach the top of the mip pyramid, a single set pixel becomes a\n // significant portion of the texture. This doesn't look great when zoomed\n // out, so attenuate the value by 50% at each level.\n if (size === 8) {\n texture[size - 1] = 96;\n } else if (size === 4) {\n texture[size - 1] = 48;\n } else if (size === 2) {\n texture[size - 1] = 24;\n } else if (size === 1) {\n texture[size - 1] = 12;\n }\n return texture;\n}\n\n/**\n * A hash set that provides quick lookups of whether an edge exists between\n * two vertices.\n *\n * @alias EdgeSet\n * @constructor\n *\n * @param {Number[]} edgeIndices An array of vertex indices with an even number of elements where each pair of indices defines an edge.\n * @param {Number} originalVertexCount The original number of vertices. This is used for computing a hash function.\n *\n * @private\n */\nfunction EdgeSet(edgeIndices, originalVertexCount) {\n /**\n * Original number of vertices in the primitive. This is used for computing\n * the hash key\n *\n * @type {Number}\n *\n * @private\n */\n this._originalVertexCount = originalVertexCount;\n\n /**\n * The internal hash set used to store the edges. Edges are hashed as follows:\n * <p>\n * smallerVertexIndex * originalVertexCount + biggerVertexIndex\n * <p>\n * @type {Set}\n *\n * @private\n */\n this._edges = new Set();\n for (let i = 0; i < edgeIndices.length; i += 2) {\n const a = edgeIndices[i];\n const b = edgeIndices[i + 1];\n const small = Math.min(a, b);\n const big = Math.max(a, b);\n const hash = small * this._originalVertexCount + big;\n this._edges.add(hash);\n }\n}\n\n/**\n * Check if an edge exists in the set. The order of the input vertices does\n * not matter.\n * @param {Number} a The first index\n * @param {Number} b The second index\n * @returns {Boolean} true if there is an edge between a and b\n *\n * @private\n */\nEdgeSet.prototype.hasEdge = function (a, b) {\n const small = Math.min(a, b);\n const big = Math.max(a, b);\n const hash = small * this._originalVertexCount + big;\n return this._edges.has(hash);\n};\n\nexport default PrimitiveOutlineGenerator;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport PrimitiveOutlineGenerator from \"./Model/PrimitiveOutlineGenerator.js\";\n\n/**\n * Simple struct for tracking whether an attribute will be loaded as a buffer\n * or typed array after post-processing.\n *\n * @alias PrimitiveLoadPlan.AttributeLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Attribute} attribute The attribute to be updated\n *\n * @private\n */\nfunction AttributeLoadPlan(attribute) {\n /**\n * The attribute to track.\n *\n * @type {ModelComponents.Attribute}\n * @readonly\n * @private\n */\n this.attribute = attribute;\n\n /**\n * Whether the attribute will be loaded as a GPU buffer by the time\n * {@link PrimitiveLoadPlan#postProcess} is finished.\n *\n * @type {Boolean}\n * @private\n */\n this.loadBuffer = false;\n\n /**\n * Whether the attribute will be loaded as a packed typed array by the time\n * {@link PrimitiveLoadPlan#postProcess} is finished.\n *\n * @type {Boolean}\n * @private\n */\n this.loadTypedArray = false;\n}\n\n/**\n * Simple struct for tracking whether an index buffer will be loaded as a buffer\n * or typed array after post-processing.\n *\n * @alias PrimitiveLoadPlan.IndicesLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Indices} indices The indices to be updated\n *\n * @private\n */\nfunction IndicesLoadPlan(indices) {\n /**\n * The indices to track.\n *\n * @type {ModelComponents.Indices}\n * @readonly\n * @private\n */\n this.indices = indices;\n\n /**\n * Whether the indices will be loaded as a GPU buffer by the time\n * {@link PrimitiveLoadPlan#postProcess} is finished.\n *\n * @type {Boolean}\n * @private\n */\n this.loadBuffer = false;\n\n /**\n * Whether the indices will be loaded as a typed array copy of the GPU\n * buffer by the time {@link PrimitiveLoadPlan#postProcess} is finished.\n *\n * @type {Boolean}\n * @private\n */\n this.loadTypedArray = false;\n}\n\n/**\n * Primitives may need post-processing steps after their attributes and indices\n * have loaded, such as generating outlines for the CESIUM_primitive_outline glTF\n * extension. This object tracks what indices and attributes need to be\n * post-processed.\n *\n * @alias PrimitiveLoadPlan\n * @constructor\n *\n * @param {ModelComponents.Primitive} primitive The primitive to track\n *\n * @private\n */\nfunction PrimitiveLoadPlan(primitive) {\n /**\n * The primitive to track.\n *\n * @type {ModelComponents.Primitive}\n * @readonly\n * @private\n */\n this.primitive = primitive;\n\n /**\n * A flat list of attributes that need to be post-processed. This includes\n * both regular attributes and morph target attributes.\n *\n * @type {PrimitiveLoadPlan.AttributeLoadPlan[]}\n * @private\n */\n this.attributePlans = [];\n\n /**\n * Information about the triangle indices that need to be post-processed,\n * if they exist.\n *\n * @type {PrimitiveLoadPlan.IndicesLoadPlan}\n * @private\n */\n this.indicesPlan = undefined;\n\n /**\n * Set this true to indicate that the primitive has the\n * CESIUM_primitive_outline extension and needs to be post-processed\n *\n * @type {Boolean}\n * @private\n */\n this.needsOutlines = false;\n\n /**\n * The outline edge indices from the CESIUM_primitive_outline extension\n *\n * @type {Number[]}\n * @private\n */\n this.outlineIndices = undefined;\n}\n\n/**\n * Apply post-processing steps that may modify geometry such as generating\n * outline coordinates. If no post-processing steps are needed, this function\n * is a no-op.\n *\n * @param {Context} context The context for generating buffers on the GPU\n */\nPrimitiveLoadPlan.prototype.postProcess = function (context) {\n // Handle CESIUM_primitive_outline. This modifies indices and attributes and\n // also generates a new attribute for the outline coordinates. These steps\n // are synchronous.\n if (this.needsOutlines) {\n generateOutlines(this);\n generateBuffers(this, context);\n }\n};\n\nfunction generateOutlines(loadPlan) {\n const primitive = loadPlan.primitive;\n const indices = primitive.indices;\n\n const vertexCount = primitive.attributes[0].count;\n\n const generator = new PrimitiveOutlineGenerator({\n triangleIndices: indices.typedArray,\n outlineIndices: loadPlan.outlineIndices,\n originalVertexCount: vertexCount,\n });\n\n // The generator modifies/adds indices. In some uncommon cases it may have\n // to upgrade to 16- or 32-bit indices so the datatype may change.\n indices.typedArray = generator.updatedTriangleIndices;\n indices.indexDatatype = IndexDatatype.fromTypedArray(indices.typedArray);\n\n // The outline generator creates a new attribute for the outline coordinates\n // that are used with a lookup texture.\n const outlineCoordinates = makeOutlineCoordinatesAttribute(\n generator.outlineCoordinates\n );\n const outlineCoordinatesPlan = new AttributeLoadPlan(outlineCoordinates);\n outlineCoordinatesPlan.loadBuffer = true;\n outlineCoordinatesPlan.loadTypedArray = false;\n loadPlan.attributePlans.push(outlineCoordinatesPlan);\n primitive.outlineCoordinates = outlineCoordinatesPlan.attribute;\n\n // Some vertices may be copied due to the addition of the new attribute\n // which may have multiple values at a vertex depending on the face\n const attributePlans = loadPlan.attributePlans;\n const attributesLength = loadPlan.attributePlans.length;\n for (let i = 0; i < attributesLength; i++) {\n const attribute = attributePlans[i].attribute;\n attribute.typedArray = generator.updateAttribute(attribute.typedArray);\n }\n}\n\nfunction makeOutlineCoordinatesAttribute(outlineCoordinatesTypedArray) {\n const attribute = new ModelComponents.Attribute();\n attribute.name = \"_OUTLINE_COORDINATES\";\n attribute.typedArray = outlineCoordinatesTypedArray;\n attribute.componentDatatype = ComponentDatatype.FLOAT;\n attribute.type = AttributeType.VEC3;\n attribute.normalized = false;\n attribute.count = outlineCoordinatesTypedArray.length / 3;\n\n return attribute;\n}\n\nfunction generateBuffers(loadPlan, context) {\n generateAttributeBuffers(loadPlan.attributePlans, context);\n\n if (defined(loadPlan.indicesPlan)) {\n generateIndexBuffers(loadPlan.indicesPlan, context);\n }\n}\n\nfunction generateAttributeBuffers(attributePlans, context) {\n const attributesLength = attributePlans.length;\n for (let i = 0; i < attributesLength; i++) {\n const attributePlan = attributePlans[i];\n const attribute = attributePlan.attribute;\n const typedArray = attribute.typedArray;\n\n if (attributePlan.loadBuffer) {\n const buffer = Buffer.createVertexBuffer({\n typedArray: typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n });\n buffer.vertexArrayDestroyable = false;\n attribute.buffer = buffer;\n }\n\n if (!attributePlan.loadTypedArray) {\n attribute.typedArray = undefined;\n }\n }\n}\n\nfunction generateIndexBuffers(indicesPlan, context) {\n const indices = indicesPlan.indices;\n if (indicesPlan.loadBuffer) {\n const buffer = Buffer.createIndexBuffer({\n typedArray: indices.typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: indices.indexDatatype,\n });\n indices.buffer = buffer;\n buffer.vertexArrayDestroyable = false;\n }\n\n if (!indicesPlan.loadTypedArray) {\n indices.typedArray = undefined;\n }\n}\n\nPrimitiveLoadPlan.AttributeLoadPlan = AttributeLoadPlan;\nPrimitiveLoadPlan.IndicesLoadPlan = IndicesLoadPlan;\nexport default PrimitiveLoadPlan;\n", "import defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Image formats supported by the browser.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.webp=false] Whether the browser supports WebP images.\n * @param {Boolean} [options.basis=false] Whether the browser supports compressed textures required to view KTX2 + Basis Universal images.\n *\n * @private\n */\nfunction SupportedImageFormats(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this.webp = defaultValue(options.webp, false);\n this.basis = defaultValue(options.basis, false);\n}\n\nexport default SupportedImageFormats;\n", "import ArticulationStageType from \"../Core/ArticulationStageType.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport InterpolationType from \"../Core/InterpolationType.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport getAccessorByteStride from \"./GltfPipeline/getAccessorByteStride.js\";\nimport getComponentReader from \"./GltfPipeline/getComponentReader.js\";\nimport numberOfComponentsForType from \"./GltfPipeline/numberOfComponentsForType.js\";\nimport GltfStructuralMetadataLoader from \"./GltfStructuralMetadataLoader.js\";\nimport ModelUtility from \"./Model/ModelUtility.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport Axis from \"./Axis.js\";\nimport GltfLoaderUtil from \"./GltfLoaderUtil.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport InstanceAttributeSemantic from \"./InstanceAttributeSemantic.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport PrimitiveLoadPlan from \"./PrimitiveLoadPlan.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport ResourceLoader from \"./ResourceLoader.js\";\nimport SupportedImageFormats from \"./SupportedImageFormats.js\";\nimport VertexAttributeSemantic from \"./VertexAttributeSemantic.js\";\n\nconst Attribute = ModelComponents.Attribute;\nconst Indices = ModelComponents.Indices;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst FeatureIdTexture = ModelComponents.FeatureIdTexture;\nconst FeatureIdImplicitRange = ModelComponents.FeatureIdImplicitRange;\nconst MorphTarget = ModelComponents.MorphTarget;\nconst Primitive = ModelComponents.Primitive;\nconst Instances = ModelComponents.Instances;\nconst Skin = ModelComponents.Skin;\nconst Node = ModelComponents.Node;\nconst AnimatedPropertyType = ModelComponents.AnimatedPropertyType;\nconst AnimationSampler = ModelComponents.AnimationSampler;\nconst AnimationTarget = ModelComponents.AnimationTarget;\nconst AnimationChannel = ModelComponents.AnimationChannel;\nconst Animation = ModelComponents.Animation;\nconst ArticulationStage = ModelComponents.ArticulationStage;\nconst Articulation = ModelComponents.Articulation;\nconst Asset = ModelComponents.Asset;\nconst Scene = ModelComponents.Scene;\nconst Components = ModelComponents.Components;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\nconst SpecularGlossiness = ModelComponents.SpecularGlossiness;\nconst Material = ModelComponents.Material;\n\n/**\n * States of the glTF loading process. These states also apply to\n * asynchronous texture loading unless otherwise noted\n *\n * @enum {Number}\n *\n * @private\n */\nconst GltfLoaderState = {\n /**\n * The initial state of the glTF loader before load() is called.\n *\n * @type {Number}\n * @constant\n *\n * @private\n */\n NOT_LOADED: 0,\n /**\n * The state of the loader while waiting for the glTF JSON loader promise\n * to resolve.\n *\n * @type {Number}\n * @constant\n *\n * @private\n */\n LOADING: 1,\n /**\n * The state of the loader once the glTF JSON is loaded but before\n * process() is called.\n *\n * @type {Number}\n * @constant\n */\n LOADED: 2,\n /**\n * The state of the loader while parsing the glTF and creating GPU resources\n * as needed.\n *\n * @type {Number}\n * @constant\n */\n PROCESSING: 3,\n /**\n * For some features like handling CESIUM_primitive_outlines, the geometry\n * must be modified after it is loaded. The post-processing state handles\n * any geometry modification (if needed).\n * <p>\n * This state is not used for asynchronous texture loading.\n * </p>\n *\n * @type {Number}\n * @constant\n */\n POST_PROCESSING: 4,\n /**\n * Once the processing/post-processing states are finished, the loader\n * enters the processed state (sometimes from a promise chain). The next\n * call to process() will advance to the ready state.\n *\n * @type {Number}\n * @constant\n */\n PROCESSED: 5,\n /**\n * When the loader reaches the ready state, the loaders' promise will be\n * resolved.\n *\n * @type {Number}\n * @constant\n */\n READY: 6,\n /**\n * If an error occurs at any point, the loader switches to the failed state.\n *\n * @type {Number}\n * @constant\n */\n FAILED: 7,\n /**\n * If unload() is called, the loader switches to the unloaded state.\n *\n * @type {Number}\n * @constant\n */\n UNLOADED: 8,\n};\n\n/**\n * Loads a glTF model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GltfLoader\n * @constructor\n * @augments ResourceLoader\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.gltfResource The {@link Resource} containing the glTF. This is often the path of the .gltf or .glb file, but may also be the path of the .b3dm, .i3dm, or .cmpt file containing the embedded glb. .cmpt resources should have a URI fragment indicating the index of the inner content to which the glb belongs in order to individually identify the glb in the cache, e.g. http://example.com/tile.cmpt#index=2.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Uint8Array} [options.typedArray] The typed array containing the glTF contents, e.g. from a .b3dm, .i3dm, or .cmpt file.\n * @param {Object} [options.gltfJson] A parsed glTF JSON file instead of passing it in as a typed array.\n * @param {Boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.\n * @param {Boolean} [options.loadAttributesAsTypedArray=false] Load all attributes and indices as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {Boolean} [options.loadAttributesFor2D=false] If <code>true</code>, load the positions buffer and any instanced attribute buffers as typed arrays for accurately projecting models to 2D.\n * @param {Boolean} [options.loadIndicesForWireframe=false] If <code>true</code>, load the index buffer as both a buffer and typed array. The latter is useful for creating wireframe indices in WebGL1.\n * @param {Boolean} [options.loadPrimitiveOutline=true] If <code>true</code>, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n * @param {Boolean} [options.loadForClassification=false] If <code>true</code> and if the model has feature IDs, load the feature IDs and indices as typed arrays. This is useful for batching features for classification.\n * @param {Boolean} [options.renameBatchIdSemantic=false] If <code>true</code>, rename _BATCHID or BATCHID to _FEATURE_ID_0. This is used for .b3dm models\n * @private\n */\nfunction GltfLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const gltfResource = options.gltfResource;\n let baseResource = options.baseResource;\n const typedArray = options.typedArray;\n const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n const asynchronous = defaultValue(options.asynchronous, true);\n const incrementallyLoadTextures = defaultValue(\n options.incrementallyLoadTextures,\n true\n );\n const upAxis = defaultValue(options.upAxis, Axis.Y);\n const forwardAxis = defaultValue(options.forwardAxis, Axis.Z);\n const loadAttributesAsTypedArray = defaultValue(\n options.loadAttributesAsTypedArray,\n false\n );\n const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n const loadIndicesForWireframe = defaultValue(\n options.loadIndicesForWireframe,\n false\n );\n const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n const loadForClassification = defaultValue(\n options.loadForClassification,\n false\n );\n const renameBatchIdSemantic = defaultValue(\n options.renameBatchIdSemantic,\n false\n );\n\n baseResource = defined(baseResource) ? baseResource : gltfResource.clone();\n\n this._gltfJson = options.gltfJson;\n this._gltfResource = gltfResource;\n this._baseResource = baseResource;\n this._typedArray = typedArray;\n this._releaseGltfJson = releaseGltfJson;\n this._asynchronous = asynchronous;\n this._incrementallyLoadTextures = incrementallyLoadTextures;\n this._upAxis = upAxis;\n this._forwardAxis = forwardAxis;\n this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n this._loadAttributesFor2D = loadAttributesFor2D;\n this._loadIndicesForWireframe = loadIndicesForWireframe;\n this._loadPrimitiveOutline = loadPrimitiveOutline;\n this._loadForClassification = loadForClassification;\n this._renameBatchIdSemantic = renameBatchIdSemantic;\n\n // This flag will be set in parse() if the KHR_mesh_quantization extension is\n // present in extensionsRequired. This flag is used later when parsing\n // attributes. When the extension is present, attributes may be stored as\n // quantized integer values instead of floats.\n this._hasKhrMeshQuantization = false;\n\n // When loading EXT_feature_metadata, the feature tables and textures\n // are now stored as arrays like the newer EXT_structural_metadata extension.\n // This requires sorting the dictionary keys for a consistent ordering.\n this._sortedPropertyTableIds = undefined;\n this._sortedFeatureTextureIds = undefined;\n\n this._gltfJsonLoader = undefined;\n this._state = GltfLoaderState.NOT_LOADED;\n this._textureState = GltfLoaderState.NOT_LOADED;\n this._promise = undefined;\n this._texturesLoadedPromise = undefined;\n this._process = function (loader, frameState) {};\n this._processTextures = function (loader, frameState) {};\n\n // Information about whether to load primitives as typed arrays or buffers,\n // and whether post-processing is needed after loading (e.g. for\n // generating outlines)\n this._primitiveLoadPlans = [];\n\n // Loaders that need to be processed before the glTF becomes ready\n this._loaderPromises = [];\n this._textureLoaders = [];\n this._texturesPromises = [];\n this._bufferViewLoaders = [];\n this._geometryLoaders = [];\n this._structuralMetadataLoader = undefined;\n\n // In some cases where geometry post-processing is needed (like generating\n // outlines) new attributes are added that may have GPU resources attached.\n // The GltfLoader will own the resources and store them here.\n this._postProcessBuffers = [];\n\n // Loaded results\n this._components = undefined;\n}\n\nif (defined(Object.create)) {\n GltfLoader.prototype = Object.create(ResourceLoader.prototype);\n GltfLoader.prototype.constructor = GltfLoader;\n}\n\nObject.defineProperties(GltfLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof GltfLoader.prototype\n *\n * @type {Promise.<GltfLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GltfLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return undefined;\n },\n },\n /**\n * The loaded components.\n *\n * @memberof GltfLoader.prototype\n *\n * @type {ModelComponents.Components}\n * @readonly\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n\n /**\n * A promise that resolves when all textures are loaded.\n * When <code>incrementallyLoadTextures</code> is true this may resolve after\n * <code>promise</code> resolves.\n *\n * @memberof GltfLoader.prototype\n *\n * @type {Promise<void>}\n * @readonly\n * @private\n */\n texturesLoadedPromise: {\n get: function () {\n return this._texturesLoadedPromise;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GltfLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGltfLoader.prototype.load = function () {\n const gltfJsonLoader = ResourceCache.loadGltfJson({\n gltfResource: this._gltfResource,\n baseResource: this._baseResource,\n typedArray: this._typedArray,\n gltfJson: this._gltfJson,\n });\n\n this._gltfJsonLoader = gltfJsonLoader;\n this._state = GltfLoaderState.LOADING;\n this._textureState = GltfLoaderState.LOADING;\n\n const that = this;\n let textureProcessPromise;\n const processPromise = new Promise(function (resolve, reject) {\n textureProcessPromise = new Promise(function (\n resolveTextures,\n rejectTextures\n ) {\n that._process = function (loader, frameState) {\n if (!FeatureDetection.supportsWebP.initialized) {\n FeatureDetection.supportsWebP.initialize();\n return;\n }\n\n if (loader._state === GltfLoaderState.LOADED) {\n loader._state = GltfLoaderState.PROCESSING;\n\n const supportedImageFormats = new SupportedImageFormats({\n webp: FeatureDetection.supportsWebP(),\n basis: frameState.context.supportsBasis,\n });\n\n let gltf;\n if (defined(loader._gltfJsonLoader)) {\n gltf = loader._gltfJsonLoader.gltf;\n } else {\n gltf = loader._gltfJson;\n }\n\n // Parse the glTF which populates the loaders arrays. The promise will\n // resolve once all the loaders are ready (i.e. all external resources\n // have been fetched and all GPU resources have been created). Loaders that\n // create GPU resources need to be processed every frame until they become\n // ready since the JobScheduler is not able to execute all jobs in a single\n // frame. Also note that it's fine to call process before a loader is ready\n // to process; nothing will happen.\n parse(\n loader,\n gltf,\n supportedImageFormats,\n frameState,\n reject,\n rejectTextures\n );\n\n if (defined(loader._gltfJsonLoader) && loader._releaseGltfJson) {\n // Check that the glTF JSON loader is still defined before trying to unload it.\n // It may be undefined if the ready promise rejects immediately (which can happen in unit tests)\n ResourceCache.unload(loader._gltfJsonLoader);\n loader._gltfJsonLoader = undefined;\n }\n }\n\n if (loader._state === GltfLoaderState.PROCESSING) {\n processLoaders(loader, frameState);\n }\n\n if (loader._state === GltfLoaderState.POST_PROCESSING) {\n postProcessGeometry(loader, frameState.context);\n loader._state = GltfLoaderState.PROCESSED;\n }\n\n if (loader._state === GltfLoaderState.PROCESSED) {\n // The buffer views can be unloaded once the data is copied.\n unloadBufferViews(loader);\n\n // Similarly, if the glTF was loaded from a typed array, release the memory\n loader._typedArray = undefined;\n\n loader._state = GltfLoaderState.READY;\n resolve(loader);\n }\n };\n\n that._processTextures = function (loader, frameState) {\n if (loader._textureState === GltfLoaderState.LOADED) {\n loader._textureState = GltfLoaderState.PROCESSING;\n }\n\n if (loader._textureState === GltfLoaderState.PROCESSING) {\n let i;\n const textureLoaders = loader._textureLoaders;\n const textureLoadersLength = textureLoaders.length;\n for (i = 0; i < textureLoadersLength; ++i) {\n textureLoaders[i].process(frameState);\n }\n }\n\n if (loader._textureState === GltfLoaderState.PROCESSED) {\n loader._textureState = GltfLoaderState.READY;\n resolveTextures(loader);\n }\n };\n });\n });\n\n this._promise = gltfJsonLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n that._state = GltfLoaderState.LOADED;\n that._textureState = GltfLoaderState.LOADED;\n\n return processPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n that._state = GltfLoaderState.FAILED;\n that._textureState = GltfLoaderState.FAILED;\n return handleError(that, error);\n });\n\n this._texturesLoadedPromise = textureProcessPromise.catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n\n that._textureState = GltfLoaderState.FAILED;\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction handleError(gltfLoader, error) {\n gltfLoader.unload();\n const errorMessage = \"Failed to load glTF\";\n error = gltfLoader.getError(errorMessage, error);\n return Promise.reject(error);\n}\n\nfunction processLoaders(loader, frameState) {\n const bufferViewLoaders = loader._bufferViewLoaders;\n const bufferViewLoadersLength = bufferViewLoaders.length;\n for (let i = 0; i < bufferViewLoadersLength; ++i) {\n bufferViewLoaders[i].process(frameState);\n }\n\n const geometryLoaders = loader._geometryLoaders;\n const geometryLoadersLength = geometryLoaders.length;\n for (let i = 0; i < geometryLoadersLength; ++i) {\n geometryLoaders[i].process(frameState);\n }\n\n if (defined(loader._structuralMetadataLoader)) {\n loader._structuralMetadataLoader.process(frameState);\n }\n}\n\nfunction postProcessGeometry(loader, context) {\n // Apply post-processing steps on geometry such as\n // updating attributes for rendering outlines.\n const loadPlans = loader._primitiveLoadPlans;\n const length = loadPlans.length;\n for (let i = 0; i < length; i++) {\n const loadPlan = loadPlans[i];\n loadPlan.postProcess(context);\n\n if (loadPlan.needsOutlines) {\n // The glTF loader takes ownership of any buffers generated in the\n // post-process stage since they were created after the geometry loaders\n // finished. This way they can be destroyed when the loader is destroyed.\n gatherPostProcessBuffers(loader, loadPlan);\n }\n }\n}\n\nfunction gatherPostProcessBuffers(loader, primitiveLoadPlan) {\n const buffers = loader._postProcessBuffers;\n const primitive = primitiveLoadPlan.primitive;\n\n const outlineCoordinates = primitive.outlineCoordinates;\n if (defined(outlineCoordinates)) {\n // outline coordinates are always loaded as a buffer.\n buffers.push(outlineCoordinates.buffer);\n }\n\n // to do post-processing, all the attributes are loaded as typed arrays\n // so if a buffer exists, it was newly generated\n const attributes = primitive.attributes;\n const length = attributes.length;\n for (let i = 0; i < length; i++) {\n const attribute = attributes[i];\n if (defined(attribute.buffer)) {\n buffers.push(attribute.buffer);\n }\n }\n\n // Similarly for the indices.\n const indices = primitive.indices;\n if (defined(indices) && defined(indices.buffer)) {\n buffers.push(indices.buffer);\n }\n}\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGltfLoader.prototype.process = function (frameState) {\n this._process(this, frameState);\n // Since textures can be loaded independently and are handled through a separate promise, they are processed in their own function\n this._processTextures(this, frameState);\n};\n\nfunction loadVertexBuffer(\n loader,\n gltf,\n accessorId,\n semantic,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n) {\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n\n const vertexBufferLoader = ResourceCache.loadVertexBuffer({\n gltf: gltf,\n gltfResource: loader._gltfResource,\n baseResource: loader._baseResource,\n frameState: frameState,\n bufferViewId: bufferViewId,\n draco: draco,\n attributeSemantic: semantic,\n accessorId: accessorId,\n asynchronous: loader._asynchronous,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n loader._geometryLoaders.push(vertexBufferLoader);\n\n return vertexBufferLoader;\n}\n\nfunction loadIndexBuffer(\n loader,\n gltf,\n accessorId,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n) {\n const indexBufferLoader = ResourceCache.loadIndexBuffer({\n gltf: gltf,\n accessorId: accessorId,\n gltfResource: loader._gltfResource,\n baseResource: loader._baseResource,\n frameState: frameState,\n draco: draco,\n asynchronous: loader._asynchronous,\n loadBuffer: loadBuffer,\n loadTypedArray: loadTypedArray,\n });\n\n loader._geometryLoaders.push(indexBufferLoader);\n\n return indexBufferLoader;\n}\n\nfunction loadBufferView(loader, gltf, bufferViewId) {\n const bufferViewLoader = ResourceCache.loadBufferView({\n gltf: gltf,\n bufferViewId: bufferViewId,\n gltfResource: loader._gltfResource,\n baseResource: loader._baseResource,\n });\n\n loader._bufferViewLoaders.push(bufferViewLoader);\n\n return bufferViewLoader;\n}\n\nfunction getPackedTypedArray(gltf, accessor, bufferViewTypedArray) {\n let byteOffset = accessor.byteOffset;\n const byteStride = getAccessorByteStride(gltf, accessor);\n const count = accessor.count;\n const componentCount = numberOfComponentsForType(accessor.type);\n const componentType = accessor.componentType;\n const componentByteLength = ComponentDatatype.getSizeInBytes(componentType);\n const defaultByteStride = componentByteLength * componentCount;\n const componentsLength = count * componentCount;\n\n if (byteStride === defaultByteStride) {\n // Copy the typed array and let the underlying ArrayBuffer be freed\n bufferViewTypedArray = new Uint8Array(bufferViewTypedArray);\n return ComponentDatatype.createArrayBufferView(\n componentType,\n bufferViewTypedArray.buffer,\n bufferViewTypedArray.byteOffset + byteOffset,\n componentsLength\n );\n }\n\n const accessorTypedArray = ComponentDatatype.createTypedArray(\n componentType,\n componentsLength\n );\n\n const dataView = new DataView(bufferViewTypedArray.buffer);\n const components = new Array(componentCount);\n const componentReader = getComponentReader(accessor.componentType);\n byteOffset = bufferViewTypedArray.byteOffset + byteOffset;\n\n for (let i = 0; i < count; ++i) {\n componentReader(\n dataView,\n byteOffset,\n componentCount,\n componentByteLength,\n components\n );\n for (let j = 0; j < componentCount; ++j) {\n accessorTypedArray[i * componentCount + j] = components[j];\n }\n byteOffset += byteStride;\n }\n\n return accessorTypedArray;\n}\n\nfunction loadDefaultAccessorValues(accessor, values) {\n const accessorType = accessor.type;\n if (accessorType === AttributeType.SCALAR) {\n return values.fill(0);\n }\n\n const MathType = AttributeType.getMathType(accessorType);\n return values.fill(MathType.clone(MathType.ZERO));\n}\n\nfunction loadAccessorValues(accessor, typedArray, values, useQuaternion) {\n const accessorType = accessor.type;\n const accessorCount = accessor.count;\n\n if (accessorType === AttributeType.SCALAR) {\n for (let i = 0; i < accessorCount; i++) {\n values[i] = typedArray[i];\n }\n } else if (accessorType === AttributeType.VEC4 && useQuaternion) {\n for (let i = 0; i < accessorCount; i++) {\n values[i] = Quaternion.unpack(typedArray, i * 4);\n }\n } else {\n const MathType = AttributeType.getMathType(accessorType);\n const numberOfComponents = AttributeType.getNumberOfComponents(\n accessorType\n );\n\n for (let i = 0; i < accessorCount; i++) {\n values[i] = MathType.unpack(typedArray, i * numberOfComponents);\n }\n }\n\n return values;\n}\n\nfunction loadAccessor(loader, gltf, accessorId, useQuaternion) {\n const accessor = gltf.accessors[accessorId];\n const accessorCount = accessor.count;\n const values = new Array(accessorCount);\n\n const bufferViewId = accessor.bufferView;\n if (defined(bufferViewId)) {\n const bufferViewLoader = loadBufferView(loader, gltf, bufferViewId);\n const promise = bufferViewLoader.promise.then(function (bufferViewLoader) {\n if (loader.isDestroyed()) {\n return;\n }\n const bufferViewTypedArray = bufferViewLoader.typedArray;\n const typedArray = getPackedTypedArray(\n gltf,\n accessor,\n bufferViewTypedArray\n );\n\n useQuaternion = defaultValue(useQuaternion, false);\n loadAccessorValues(accessor, typedArray, values, useQuaternion);\n });\n loader._loaderPromises.push(promise);\n\n return values;\n }\n\n return loadDefaultAccessorValues(accessor, values);\n}\n\nfunction fromArray(MathType, values) {\n if (!defined(values)) {\n return undefined;\n }\n\n if (MathType === Number) {\n return values[0];\n }\n\n return MathType.unpack(values);\n}\n\nfunction getDefault(MathType) {\n if (MathType === Number) {\n return 0.0;\n }\n\n return new MathType(); // defaults to 0.0 for all types\n}\n\nfunction getQuantizationDivisor(componentDatatype) {\n switch (componentDatatype) {\n case ComponentDatatype.BYTE:\n return 127;\n case ComponentDatatype.UNSIGNED_BYTE:\n return 255;\n case ComponentDatatype.SHORT:\n return 32767;\n case ComponentDatatype.UNSIGNED_SHORT:\n return 65535;\n default:\n return 1.0;\n }\n}\n\nconst minimumBoundsByType = {\n VEC2: new Cartesian2(-1.0, -1.0),\n VEC3: new Cartesian3(-1.0, -1.0, -1.0),\n VEC4: new Cartesian4(-1.0, -1.0, -1.0, -1.0),\n};\n\nfunction dequantizeMinMax(attribute, VectorType) {\n const divisor = getQuantizationDivisor(attribute.componentDatatype);\n const minimumBound = minimumBoundsByType[attribute.type];\n\n // dequantized = max(quantized / divisor, -1.0)\n let min = attribute.min;\n if (defined(min)) {\n min = VectorType.divideByScalar(min, divisor, min);\n min = VectorType.maximumByComponent(min, minimumBound, min);\n }\n\n let max = attribute.max;\n if (defined(max)) {\n max = VectorType.divideByScalar(max, divisor, max);\n max = VectorType.maximumByComponent(max, minimumBound, max);\n }\n\n attribute.min = min;\n attribute.max = max;\n}\n\nfunction setQuantizationFromWeb3dQuantizedAttributes(\n extension,\n attribute,\n MathType\n) {\n const decodeMatrix = extension.decodeMatrix;\n const decodedMin = fromArray(MathType, extension.decodedMin);\n const decodedMax = fromArray(MathType, extension.decodedMax);\n\n if (defined(decodedMin) && defined(decodedMax)) {\n attribute.min = decodedMin;\n attribute.max = decodedMax;\n }\n\n const quantization = new ModelComponents.Quantization();\n quantization.componentDatatype = attribute.componentDatatype;\n quantization.type = attribute.type;\n\n if (decodeMatrix.length === 4) {\n quantization.quantizedVolumeOffset = decodeMatrix[2];\n quantization.quantizedVolumeStepSize = decodeMatrix[0];\n } else if (decodeMatrix.length === 9) {\n quantization.quantizedVolumeOffset = new Cartesian2(\n decodeMatrix[6],\n decodeMatrix[7]\n );\n quantization.quantizedVolumeStepSize = new Cartesian2(\n decodeMatrix[0],\n decodeMatrix[4]\n );\n } else if (decodeMatrix.length === 16) {\n quantization.quantizedVolumeOffset = new Cartesian3(\n decodeMatrix[12],\n decodeMatrix[13],\n decodeMatrix[14]\n );\n quantization.quantizedVolumeStepSize = new Cartesian3(\n decodeMatrix[0],\n decodeMatrix[5],\n decodeMatrix[10]\n );\n } else if (decodeMatrix.length === 25) {\n quantization.quantizedVolumeOffset = new Cartesian4(\n decodeMatrix[20],\n decodeMatrix[21],\n decodeMatrix[22],\n decodeMatrix[23]\n );\n quantization.quantizedVolumeStepSize = new Cartesian4(\n decodeMatrix[0],\n decodeMatrix[6],\n decodeMatrix[12],\n decodeMatrix[18]\n );\n }\n\n attribute.quantization = quantization;\n}\n\nfunction createAttribute(\n gltf,\n accessorId,\n name,\n semantic,\n setIndex,\n hasKhrMeshQuantization\n) {\n const accessor = gltf.accessors[accessorId];\n const MathType = AttributeType.getMathType(accessor.type);\n const normalized = defaultValue(accessor.normalized, false);\n\n const attribute = new Attribute();\n attribute.name = name;\n attribute.semantic = semantic;\n attribute.setIndex = setIndex;\n attribute.constant = getDefault(MathType);\n attribute.componentDatatype = accessor.componentType;\n attribute.normalized = normalized;\n attribute.count = accessor.count;\n attribute.type = accessor.type;\n attribute.min = fromArray(MathType, accessor.min);\n attribute.max = fromArray(MathType, accessor.max);\n attribute.byteOffset = accessor.byteOffset;\n attribute.byteStride = getAccessorByteStride(gltf, accessor);\n\n if (hasExtension(accessor, \"WEB3D_quantized_attributes\")) {\n setQuantizationFromWeb3dQuantizedAttributes(\n accessor.extensions.WEB3D_quantized_attributes,\n attribute,\n MathType\n );\n }\n\n const isQuantizable =\n attribute.semantic === VertexAttributeSemantic.POSITION ||\n attribute.semantic === VertexAttributeSemantic.NORMAL ||\n attribute.semantic === VertexAttributeSemantic.TANGENT ||\n attribute.semantic === VertexAttributeSemantic.TEXCOORD;\n\n // In the glTF 2.0 spec, min and max are not affected by the normalized flag.\n // However, for KHR_mesh_quantization, min and max must be dequantized for\n // normalized values, else the bounding sphere will be computed incorrectly.\n if (hasKhrMeshQuantization && normalized && isQuantizable) {\n dequantizeMinMax(attribute, MathType);\n }\n\n return attribute;\n}\n\nfunction getSetIndex(gltfSemantic) {\n const setIndexRegex = /^\\w+_(\\d+)$/;\n const setIndexMatch = setIndexRegex.exec(gltfSemantic);\n if (setIndexMatch !== null) {\n return parseInt(setIndexMatch[1]);\n }\n return undefined;\n}\n\nconst scratchSemanticInfo = {\n gltfSemantic: undefined,\n renamedSemantic: undefined,\n modelSemantic: undefined,\n};\n\nfunction getSemanticInfo(loader, semanticType, gltfSemantic) {\n // For .b3dm, rename _BATCHID (or the legacy BATCHID) to _FEATURE_ID_0\n // in the generated model components for compatibility with EXT_mesh_features\n let renamedSemantic = gltfSemantic;\n if (\n loader._renameBatchIdSemantic &&\n (gltfSemantic === \"_BATCHID\" || gltfSemantic === \"BATCHID\")\n ) {\n renamedSemantic = \"_FEATURE_ID_0\";\n }\n\n const modelSemantic = semanticType.fromGltfSemantic(renamedSemantic);\n\n const semanticInfo = scratchSemanticInfo;\n semanticInfo.gltfSemantic = gltfSemantic;\n semanticInfo.renamedSemantic = renamedSemantic;\n semanticInfo.modelSemantic = modelSemantic;\n\n return semanticInfo;\n}\n\nfunction isClassificationAttribute(attributeSemantic) {\n // Classification models only use the position, texcoord, and feature ID attributes.\n const isPositionAttribute =\n attributeSemantic === VertexAttributeSemantic.POSITION;\n const isFeatureIdAttribute =\n attributeSemantic === VertexAttributeSemantic.FEATURE_ID;\n const isTexcoordAttribute =\n attributeSemantic === VertexAttributeSemantic.TEXCOORD;\n\n return isPositionAttribute || isFeatureIdAttribute || isTexcoordAttribute;\n}\n\nfunction finalizeDracoAttribute(\n attribute,\n vertexBufferLoader,\n loadBuffer,\n loadTypedArray\n) {\n // The accessor's byteOffset and byteStride should be ignored for draco.\n // Each attribute is tightly packed in its own buffer after decode.\n attribute.byteOffset = 0;\n attribute.byteStride = undefined;\n attribute.quantization = vertexBufferLoader.quantization;\n\n if (loadBuffer) {\n attribute.buffer = vertexBufferLoader.buffer;\n }\n\n if (loadTypedArray) {\n const componentDatatype = defined(vertexBufferLoader.quantization)\n ? vertexBufferLoader.quantization.componentDatatype\n : attribute.componentDatatype;\n\n attribute.typedArray = ComponentDatatype.createArrayBufferView(\n componentDatatype,\n vertexBufferLoader.typedArray.buffer\n );\n }\n}\n\nfunction finalizeAttribute(\n gltf,\n accessor,\n attribute,\n vertexBufferLoader,\n loadBuffer,\n loadTypedArray\n) {\n if (loadBuffer) {\n attribute.buffer = vertexBufferLoader.buffer;\n }\n\n if (loadTypedArray) {\n const bufferViewTypedArray = vertexBufferLoader.typedArray;\n attribute.typedArray = getPackedTypedArray(\n gltf,\n accessor,\n bufferViewTypedArray\n );\n\n if (!loadBuffer) {\n // If the buffer isn't loaded, then the accessor's byteOffset and\n // byteStride should be ignored, since values are only available in a\n // tightly packed typed array\n attribute.byteOffset = 0;\n attribute.byteStride = undefined;\n }\n }\n}\n\nfunction loadAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n) {\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n\n const gltfSemantic = semanticInfo.gltfSemantic;\n const renamedSemantic = semanticInfo.renamedSemantic;\n const modelSemantic = semanticInfo.modelSemantic;\n\n const setIndex = defined(modelSemantic)\n ? getSetIndex(renamedSemantic)\n : undefined;\n\n const name = gltfSemantic;\n const attribute = createAttribute(\n gltf,\n accessorId,\n name,\n modelSemantic,\n setIndex,\n loader._hasKhrMeshQuantization\n );\n\n if (!defined(draco) && !defined(bufferViewId)) {\n return attribute;\n }\n\n const vertexBufferLoader = loadVertexBuffer(\n loader,\n gltf,\n accessorId,\n gltfSemantic,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n );\n const promise = vertexBufferLoader.promise.then(function (\n vertexBufferLoader\n ) {\n if (loader.isDestroyed()) {\n return;\n }\n\n if (\n defined(draco) &&\n defined(draco.attributes) &&\n defined(draco.attributes[gltfSemantic])\n ) {\n finalizeDracoAttribute(\n attribute,\n vertexBufferLoader,\n loadBuffer,\n loadTypedArray\n );\n } else {\n finalizeAttribute(\n gltf,\n accessor,\n attribute,\n vertexBufferLoader,\n loadBuffer,\n loadTypedArray\n );\n }\n });\n\n loader._loaderPromises.push(promise);\n\n return attribute;\n}\n\nfunction loadVertexAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n draco,\n hasInstances,\n needsPostProcessing,\n frameState\n) {\n const modelSemantic = semanticInfo.modelSemantic;\n\n const isPositionAttribute =\n modelSemantic === VertexAttributeSemantic.POSITION;\n const isFeatureIdAttribute =\n modelSemantic === VertexAttributeSemantic.FEATURE_ID;\n\n const loadTypedArrayFor2D =\n isPositionAttribute &&\n !hasInstances &&\n loader._loadAttributesFor2D &&\n !frameState.scene3DOnly;\n\n const loadTypedArrayForClassification =\n loader._loadForClassification && isFeatureIdAttribute;\n\n // Whether the final output should be a buffer or typed array\n // after loading and post-processing.\n const outputTypedArrayOnly = loader._loadAttributesAsTypedArray;\n const outputBuffer = !outputTypedArrayOnly;\n const outputTypedArray =\n outputTypedArrayOnly ||\n loadTypedArrayFor2D ||\n loadTypedArrayForClassification;\n\n // Determine what to load right now:\n //\n // - If post-processing is needed, load a packed typed array for\n // further processing, and defer the buffer loading until later.\n // - On the other hand, if post-processing is not needed,\n // set the load flags directly\n const loadBuffer = needsPostProcessing ? false : outputBuffer;\n const loadTypedArray = needsPostProcessing ? true : outputTypedArray;\n\n const attribute = loadAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n );\n\n const attributePlan = new PrimitiveLoadPlan.AttributeLoadPlan(attribute);\n attributePlan.loadBuffer = outputBuffer;\n attributePlan.loadTypedArray = outputTypedArray;\n\n return attributePlan;\n}\n\nfunction loadInstancedAttribute(\n loader,\n gltf,\n accessorId,\n attributes,\n gltfSemantic,\n frameState\n) {\n const hasRotation = defined(attributes.ROTATION);\n const hasTranslationMinMax =\n defined(attributes.TRANSLATION) &&\n defined(gltf.accessors[attributes.TRANSLATION].min) &&\n defined(gltf.accessors[attributes.TRANSLATION].max);\n\n const semanticInfo = getSemanticInfo(\n loader,\n InstanceAttributeSemantic,\n gltfSemantic\n );\n const modelSemantic = semanticInfo.modelSemantic;\n\n const isTransformAttribute =\n modelSemantic === InstanceAttributeSemantic.TRANSLATION ||\n modelSemantic === InstanceAttributeSemantic.ROTATION ||\n modelSemantic === InstanceAttributeSemantic.SCALE;\n const isTranslationAttribute =\n modelSemantic === InstanceAttributeSemantic.TRANSLATION;\n\n // Load the attributes as typed arrays only if:\n // - loadAttributesAsTypedArray is true\n // - the instances have rotations. This only applies to the transform attributes,\n // since The instance matrices are computed on the CPU. This avoids the\n // expensive quaternion -> rotation matrix conversion in the shader.\n // - GPU instancing is not supported.\n const loadAsTypedArrayOnly =\n loader._loadAttributesAsTypedArray ||\n (hasRotation && isTransformAttribute) ||\n !frameState.context.instancedArrays;\n\n const loadBuffer = !loadAsTypedArrayOnly;\n\n // Load the translations as a typed array in addition to the buffer if\n // - the accessor does not have a min and max. The values will be used\n // for computing an accurate bounding volume.\n // - the model will be projected to 2D.\n const loadFor2D = loader._loadAttributesFor2D && !frameState.scene3DOnly;\n const loadTranslationAsTypedArray =\n isTranslationAttribute && (!hasTranslationMinMax || loadFor2D);\n\n const loadTypedArray = loadAsTypedArrayOnly || loadTranslationAsTypedArray;\n\n // Don't pass in draco object since instanced attributes can't be draco compressed\n return loadAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n undefined,\n loadBuffer,\n loadTypedArray,\n frameState\n );\n}\n\nfunction loadIndices(\n loader,\n gltf,\n accessorId,\n draco,\n hasFeatureIds,\n needsPostProcessing,\n frameState\n) {\n const accessor = gltf.accessors[accessorId];\n const bufferViewId = accessor.bufferView;\n\n if (!defined(draco) && !defined(bufferViewId)) {\n return undefined;\n }\n\n const indices = new Indices();\n indices.count = accessor.count;\n\n const loadAttributesAsTypedArray = loader._loadAttributesAsTypedArray;\n // Load the index buffer as a typed array to generate wireframes in WebGL1.\n const loadForWireframe =\n loader._loadIndicesForWireframe && !frameState.context.webgl2;\n\n // Load the index buffer as a typed array to batch features together for classification.\n const loadForClassification = loader._loadForClassification && hasFeatureIds;\n\n // Whether the final output should be a buffer or typed array\n // after loading and post-processing.\n const outputTypedArrayOnly = loadAttributesAsTypedArray;\n const outputBuffer = !outputTypedArrayOnly;\n const outputTypedArray =\n loadAttributesAsTypedArray || loadForWireframe || loadForClassification;\n\n // Determine what to load right now:\n //\n // - If post-processing is needed, load a packed typed array for\n // further processing, and defer the buffer loading until later.\n // - On the other hand, if post-processing is not needed, set the load\n // flags directly\n const loadBuffer = needsPostProcessing ? false : outputBuffer;\n const loadTypedArray = needsPostProcessing ? true : outputTypedArray;\n\n const indexBufferLoader = loadIndexBuffer(\n loader,\n gltf,\n accessorId,\n draco,\n loadBuffer,\n loadTypedArray,\n frameState\n );\n\n const promise = indexBufferLoader.promise.then(function (indexBufferLoader) {\n if (loader.isDestroyed()) {\n return;\n }\n\n indices.indexDatatype = indexBufferLoader.indexDatatype;\n\n indices.buffer = indexBufferLoader.buffer;\n indices.typedArray = indexBufferLoader.typedArray;\n });\n\n loader._loaderPromises.push(promise);\n\n const indicesPlan = new PrimitiveLoadPlan.IndicesLoadPlan(indices);\n indicesPlan.loadBuffer = outputBuffer;\n indicesPlan.loadTypedArray = outputTypedArray;\n\n return indicesPlan;\n}\n\nfunction loadTexture(\n loader,\n gltf,\n textureInfo,\n supportedImageFormats,\n frameState,\n samplerOverride\n) {\n const imageId = GltfLoaderUtil.getImageIdFromTexture({\n gltf: gltf,\n textureId: textureInfo.index,\n supportedImageFormats: supportedImageFormats,\n });\n\n if (!defined(imageId)) {\n return undefined;\n }\n\n const textureLoader = ResourceCache.loadTexture({\n gltf: gltf,\n textureInfo: textureInfo,\n gltfResource: loader._gltfResource,\n baseResource: loader._baseResource,\n supportedImageFormats: supportedImageFormats,\n frameState: frameState,\n asynchronous: loader._asynchronous,\n });\n\n loader._textureLoaders.push(textureLoader);\n\n const textureReader = GltfLoaderUtil.createModelTextureReader({\n textureInfo: textureInfo,\n });\n\n const promise = textureLoader.promise.then(function (textureLoader) {\n if (loader.isUnloaded() || loader.isDestroyed()) {\n return;\n }\n textureReader.texture = textureLoader.texture;\n if (defined(samplerOverride)) {\n textureReader.texture.sampler = samplerOverride;\n }\n });\n\n loader._texturesPromises.push(promise);\n\n return textureReader;\n}\n\nfunction loadMaterial(\n loader,\n gltf,\n gltfMaterial,\n supportedImageFormats,\n frameState\n) {\n const material = new Material();\n\n const extensions = defaultValue(\n gltfMaterial.extensions,\n defaultValue.EMPTY_OBJECT\n );\n const pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness;\n const pbrMetallicRoughness = gltfMaterial.pbrMetallicRoughness;\n\n material.unlit = defined(extensions.KHR_materials_unlit);\n\n if (defined(pbrSpecularGlossiness)) {\n const specularGlossiness = new SpecularGlossiness();\n material.specularGlossiness = specularGlossiness;\n\n if (defined(pbrSpecularGlossiness.diffuseTexture)) {\n specularGlossiness.diffuseTexture = loadTexture(\n loader,\n gltf,\n pbrSpecularGlossiness.diffuseTexture,\n supportedImageFormats,\n frameState\n );\n }\n if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) {\n specularGlossiness.specularGlossinessTexture = loadTexture(\n loader,\n gltf,\n pbrSpecularGlossiness.specularGlossinessTexture,\n supportedImageFormats,\n frameState\n );\n }\n }\n specularGlossiness.diffuseFactor = fromArray(\n Cartesian4,\n pbrSpecularGlossiness.diffuseFactor\n );\n specularGlossiness.specularFactor = fromArray(\n Cartesian3,\n pbrSpecularGlossiness.specularFactor\n );\n specularGlossiness.glossinessFactor =\n pbrSpecularGlossiness.glossinessFactor;\n material.pbrSpecularGlossiness = pbrSpecularGlossiness;\n } else if (defined(pbrMetallicRoughness)) {\n const metallicRoughness = new MetallicRoughness();\n\n if (defined(pbrMetallicRoughness.baseColorTexture)) {\n metallicRoughness.baseColorTexture = loadTexture(\n loader,\n gltf,\n pbrMetallicRoughness.baseColorTexture,\n supportedImageFormats,\n frameState\n );\n }\n if (defined(pbrMetallicRoughness.metallicRoughnessTexture)) {\n metallicRoughness.metallicRoughnessTexture = loadTexture(\n loader,\n gltf,\n pbrMetallicRoughness.metallicRoughnessTexture,\n supportedImageFormats,\n frameState\n );\n }\n metallicRoughness.baseColorFactor = fromArray(\n Cartesian4,\n pbrMetallicRoughness.baseColorFactor\n );\n metallicRoughness.metallicFactor = pbrMetallicRoughness.metallicFactor;\n metallicRoughness.roughnessFactor = pbrMetallicRoughness.roughnessFactor;\n material.metallicRoughness = metallicRoughness;\n }\n\n // Top level textures\n if (defined(gltfMaterial.emissiveTexture)) {\n material.emissiveTexture = loadTexture(\n loader,\n gltf,\n gltfMaterial.emissiveTexture,\n supportedImageFormats,\n frameState\n );\n }\n // Normals aren't used for classification, so don't load the normal texture.\n if (defined(gltfMaterial.normalTexture) && !loader._loadForClassification) {\n material.normalTexture = loadTexture(\n loader,\n gltf,\n gltfMaterial.normalTexture,\n supportedImageFormats,\n frameState\n );\n }\n if (defined(gltfMaterial.occlusionTexture)) {\n material.occlusionTexture = loadTexture(\n loader,\n gltf,\n gltfMaterial.occlusionTexture,\n supportedImageFormats,\n frameState\n );\n }\n material.emissiveFactor = fromArray(Cartesian3, gltfMaterial.emissiveFactor);\n material.alphaMode = gltfMaterial.alphaMode;\n material.alphaCutoff = gltfMaterial.alphaCutoff;\n material.doubleSided = gltfMaterial.doubleSided;\n\n return material;\n}\n\n// for EXT_mesh_features\nfunction loadFeatureIdAttribute(featureIds, positionalLabel) {\n const featureIdAttribute = new FeatureIdAttribute();\n featureIdAttribute.featureCount = featureIds.featureCount;\n featureIdAttribute.nullFeatureId = featureIds.nullFeatureId;\n featureIdAttribute.propertyTableId = featureIds.propertyTable;\n featureIdAttribute.setIndex = featureIds.attribute;\n featureIdAttribute.label = featureIds.label;\n featureIdAttribute.positionalLabel = positionalLabel;\n return featureIdAttribute;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdAttributeLegacy(\n gltfFeatureIdAttribute,\n featureTableId,\n featureCount,\n positionalLabel\n) {\n const featureIdAttribute = new FeatureIdAttribute();\n const featureIds = gltfFeatureIdAttribute.featureIds;\n featureIdAttribute.featureCount = featureCount;\n featureIdAttribute.propertyTableId = featureTableId;\n featureIdAttribute.setIndex = getSetIndex(featureIds.attribute);\n featureIdAttribute.positionalLabel = positionalLabel;\n return featureIdAttribute;\n}\n\n// implicit ranges do not exist in EXT_mesh_features and EXT_instance_features,\n// but both default to the vertex/instance ID which is like\n// an implicit range of {offset: 0, repeat: 1}\nfunction loadDefaultFeatureIds(featureIds, positionalLabel) {\n const featureIdRange = new FeatureIdImplicitRange();\n featureIdRange.propertyTableId = featureIds.propertyTable;\n featureIdRange.featureCount = featureIds.featureCount;\n featureIdRange.nullFeatureId = featureIds.nullFeatureId;\n featureIdRange.label = featureIds.label;\n featureIdRange.positionalLabel = positionalLabel;\n featureIdRange.offset = 0;\n featureIdRange.repeat = 1;\n return featureIdRange;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdImplicitRangeLegacy(\n gltfFeatureIdAttribute,\n featureTableId,\n featureCount,\n positionalLabel\n) {\n const featureIdRange = new FeatureIdImplicitRange();\n const featureIds = gltfFeatureIdAttribute.featureIds;\n featureIdRange.propertyTableId = featureTableId;\n featureIdRange.featureCount = featureCount;\n\n // constant/divisor was renamed to offset/repeat\n featureIdRange.offset = defaultValue(featureIds.constant, 0);\n // The default is now undefined\n const divisor = defaultValue(featureIds.divisor, 0);\n featureIdRange.repeat = divisor === 0 ? undefined : divisor;\n\n featureIdRange.positionalLabel = positionalLabel;\n return featureIdRange;\n}\n\n// for EXT_mesh_features\nfunction loadFeatureIdTexture(\n loader,\n gltf,\n gltfFeatureIdTexture,\n supportedImageFormats,\n frameState,\n positionalLabel\n) {\n const featureIdTexture = new FeatureIdTexture();\n\n featureIdTexture.featureCount = gltfFeatureIdTexture.featureCount;\n featureIdTexture.nullFeatureId = gltfFeatureIdTexture.nullFeatureId;\n featureIdTexture.propertyTableId = gltfFeatureIdTexture.propertyTable;\n featureIdTexture.label = gltfFeatureIdTexture.label;\n featureIdTexture.positionalLabel = positionalLabel;\n\n const textureInfo = gltfFeatureIdTexture.texture;\n featureIdTexture.textureReader = loadTexture(\n loader,\n gltf,\n textureInfo,\n supportedImageFormats,\n frameState,\n Sampler.NEAREST // Feature ID textures require nearest sampling\n );\n\n // Though the new channel index is more future-proof, this implementation\n // only supports RGBA textures. At least for now, the string representation\n // is more useful for generating shader code.\n const channels = defined(textureInfo.channels) ? textureInfo.channels : [0];\n const channelString = channels\n .map(function (channelIndex) {\n return \"rgba\".charAt(channelIndex);\n })\n .join(\"\");\n featureIdTexture.textureReader.channels = channelString;\n\n return featureIdTexture;\n}\n\n// for backwards compatibility with EXT_feature_metadata\nfunction loadFeatureIdTextureLegacy(\n loader,\n gltf,\n gltfFeatureIdTexture,\n featureTableId,\n supportedImageFormats,\n frameState,\n featureCount,\n positionalLabel\n) {\n const featureIdTexture = new FeatureIdTexture();\n const featureIds = gltfFeatureIdTexture.featureIds;\n const textureInfo = featureIds.texture;\n featureIdTexture.featureCount = featureCount;\n featureIdTexture.propertyTableId = featureTableId;\n featureIdTexture.textureReader = loadTexture(\n loader,\n gltf,\n textureInfo,\n supportedImageFormats,\n frameState,\n Sampler.NEAREST // Feature ID textures require nearest sampling\n );\n\n featureIdTexture.textureReader.channels = featureIds.channels;\n featureIdTexture.positionalLabel = positionalLabel;\n\n return featureIdTexture;\n}\n\nfunction loadMorphTarget(\n loader,\n gltf,\n target,\n needsPostProcessing,\n primitiveLoadPlan,\n frameState\n) {\n const morphTarget = new MorphTarget();\n\n // Don't pass in draco object since morph targets can't be draco compressed\n const draco = undefined;\n const hasInstances = false;\n\n for (const semantic in target) {\n if (target.hasOwnProperty(semantic)) {\n const accessorId = target[semantic];\n\n const semanticInfo = getSemanticInfo(\n loader,\n VertexAttributeSemantic,\n semantic\n );\n\n const attributePlan = loadVertexAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n draco,\n hasInstances,\n needsPostProcessing,\n frameState\n );\n morphTarget.attributes.push(attributePlan.attribute);\n\n // The load plan doesn't need to distinguish morph target attributes from\n // regular attributes\n primitiveLoadPlan.attributePlans.push(attributePlan);\n }\n }\n\n return morphTarget;\n}\n\nfunction loadPrimitive(\n loader,\n gltf,\n gltfPrimitive,\n hasInstances,\n supportedImageFormats,\n frameState\n) {\n const primitive = new Primitive();\n const primitivePlan = new PrimitiveLoadPlan(primitive);\n loader._primitiveLoadPlans.push(primitivePlan);\n\n const materialId = gltfPrimitive.material;\n if (defined(materialId)) {\n primitive.material = loadMaterial(\n loader,\n gltf,\n gltf.materials[materialId],\n supportedImageFormats,\n frameState\n );\n }\n\n const extensions = defaultValue(\n gltfPrimitive.extensions,\n defaultValue.EMPTY_OBJECT\n );\n\n let needsPostProcessing = false;\n const outlineExtension = extensions.CESIUM_primitive_outline;\n if (loader._loadPrimitiveOutline && defined(outlineExtension)) {\n needsPostProcessing = true;\n primitivePlan.needsOutlines = true;\n primitivePlan.outlineIndices = loadPrimitiveOutline(\n loader,\n gltf,\n outlineExtension,\n primitivePlan\n );\n }\n\n const loadForClassification = loader._loadForClassification;\n const draco = extensions.KHR_draco_mesh_compression;\n\n let hasFeatureIds = false;\n const attributes = gltfPrimitive.attributes;\n if (defined(attributes)) {\n for (const semantic in attributes) {\n if (attributes.hasOwnProperty(semantic)) {\n const accessorId = attributes[semantic];\n const semanticInfo = getSemanticInfo(\n loader,\n VertexAttributeSemantic,\n semantic\n );\n\n const modelSemantic = semanticInfo.modelSemantic;\n if (\n loadForClassification &&\n !isClassificationAttribute(modelSemantic)\n ) {\n continue;\n }\n\n if (modelSemantic === VertexAttributeSemantic.FEATURE_ID) {\n hasFeatureIds = true;\n }\n\n const attributePlan = loadVertexAttribute(\n loader,\n gltf,\n accessorId,\n semanticInfo,\n draco,\n hasInstances,\n needsPostProcessing,\n frameState\n );\n\n primitivePlan.attributePlans.push(attributePlan);\n primitive.attributes.push(attributePlan.attribute);\n }\n }\n }\n\n const targets = gltfPrimitive.targets;\n // Morph targets are disabled for classification models.\n if (defined(targets) && !loadForClassification) {\n const targetsLength = targets.length;\n for (let i = 0; i < targetsLength; ++i) {\n primitive.morphTargets.push(\n loadMorphTarget(\n loader,\n gltf,\n targets[i],\n needsPostProcessing,\n primitivePlan,\n frameState\n )\n );\n }\n }\n\n const indices = gltfPrimitive.indices;\n if (defined(indices)) {\n const indicesPlan = loadIndices(\n loader,\n gltf,\n indices,\n draco,\n hasFeatureIds,\n needsPostProcessing,\n frameState\n );\n\n if (defined(indicesPlan)) {\n primitivePlan.indicesPlan = indicesPlan;\n primitive.indices = indicesPlan.indices;\n }\n }\n\n // With the latest revision, feature IDs are defined in EXT_mesh_features\n // while EXT_structural_metadata is for defining property textures and\n // property mappings. In the legacy EXT_feature_metadata, these concepts\n // were all in one extension.\n const structuralMetadata = extensions.EXT_structural_metadata;\n const meshFeatures = extensions.EXT_mesh_features;\n const featureMetadataLegacy = extensions.EXT_feature_metadata;\n const hasFeatureMetadataLegacy = defined(featureMetadataLegacy);\n\n // Load feature Ids\n if (defined(meshFeatures)) {\n loadPrimitiveFeatures(\n loader,\n gltf,\n primitive,\n meshFeatures,\n supportedImageFormats,\n frameState\n );\n } else if (hasFeatureMetadataLegacy) {\n loadPrimitiveFeaturesLegacy(\n loader,\n gltf,\n primitive,\n featureMetadataLegacy,\n supportedImageFormats,\n frameState\n );\n }\n\n // Load structural metadata\n if (defined(structuralMetadata)) {\n loadPrimitiveMetadata(primitive, structuralMetadata);\n } else if (hasFeatureMetadataLegacy) {\n loadPrimitiveMetadataLegacy(loader, primitive, featureMetadataLegacy);\n }\n\n const primitiveType = gltfPrimitive.mode;\n if (loadForClassification && primitiveType !== PrimitiveType.TRIANGLES) {\n throw new RuntimeError(\n \"Only triangle meshes can be used for classification.\"\n );\n }\n primitive.primitiveType = primitiveType;\n\n return primitive;\n}\n\nfunction loadPrimitiveOutline(loader, gltf, outlineExtension) {\n const accessorId = outlineExtension.indices;\n const useQuaternion = false;\n return loadAccessor(loader, gltf, accessorId, useQuaternion);\n}\n\n// For EXT_mesh_features\nfunction loadPrimitiveFeatures(\n loader,\n gltf,\n primitive,\n meshFeaturesExtension,\n supportedImageFormats,\n frameState\n) {\n let featureIdsArray;\n if (\n defined(meshFeaturesExtension) &&\n defined(meshFeaturesExtension.featureIds)\n ) {\n featureIdsArray = meshFeaturesExtension.featureIds;\n } else {\n featureIdsArray = [];\n }\n\n for (let i = 0; i < featureIdsArray.length; i++) {\n const featureIds = featureIdsArray[i];\n const label = `featureId_${i}`;\n\n let featureIdComponent;\n if (defined(featureIds.texture)) {\n featureIdComponent = loadFeatureIdTexture(\n loader,\n gltf,\n featureIds,\n supportedImageFormats,\n frameState,\n label\n );\n } else if (defined(featureIds.attribute)) {\n featureIdComponent = loadFeatureIdAttribute(featureIds, label);\n } else {\n // default to vertex ID, in other words an implicit range with\n // offset: 0, repeat: 1\n featureIdComponent = loadDefaultFeatureIds(featureIds, label);\n }\n\n primitive.featureIds.push(featureIdComponent);\n }\n}\n\n// For EXT_feature_metadata\nfunction loadPrimitiveFeaturesLegacy(\n loader,\n gltf,\n primitive,\n metadataExtension,\n supportedImageFormats,\n frameState\n) {\n // For looking up the featureCount for each set of feature IDs\n const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;\n\n let nextFeatureIdIndex = 0;\n\n // Feature ID Attributes\n const featureIdAttributes = metadataExtension.featureIdAttributes;\n if (defined(featureIdAttributes)) {\n const featureIdAttributesLength = featureIdAttributes.length;\n for (let i = 0; i < featureIdAttributesLength; ++i) {\n const featureIdAttribute = featureIdAttributes[i];\n const featureTableId = featureIdAttribute.featureTable;\n const propertyTableId = loader._sortedPropertyTableIds.indexOf(\n featureTableId\n );\n const featureCount = featureTables[featureTableId].count;\n const label = `featureId_${nextFeatureIdIndex}`;\n nextFeatureIdIndex++;\n\n let featureIdComponent;\n if (defined(featureIdAttribute.featureIds.attribute)) {\n featureIdComponent = loadFeatureIdAttributeLegacy(\n featureIdAttribute,\n propertyTableId,\n featureCount,\n label\n );\n } else {\n featureIdComponent = loadFeatureIdImplicitRangeLegacy(\n featureIdAttribute,\n propertyTableId,\n featureCount,\n label\n );\n }\n primitive.featureIds.push(featureIdComponent);\n }\n }\n\n // Feature ID Textures\n const featureIdTextures = metadataExtension.featureIdTextures;\n if (defined(featureIdTextures)) {\n const featureIdTexturesLength = featureIdTextures.length;\n for (let i = 0; i < featureIdTexturesLength; ++i) {\n const featureIdTexture = featureIdTextures[i];\n const featureTableId = featureIdTexture.featureTable;\n const propertyTableId = loader._sortedPropertyTableIds.indexOf(\n featureTableId\n );\n const featureCount = featureTables[featureTableId].count;\n const featureIdLabel = `featureId_${nextFeatureIdIndex}`;\n nextFeatureIdIndex++;\n\n const featureIdComponent = loadFeatureIdTextureLegacy(\n loader,\n gltf,\n featureIdTexture,\n propertyTableId,\n supportedImageFormats,\n frameState,\n featureCount,\n featureIdLabel\n );\n // Feature ID textures are added after feature ID attributes in the list\n primitive.featureIds.push(featureIdComponent);\n }\n }\n}\n\n// For primitive-level EXT_structural_metadata\nfunction loadPrimitiveMetadata(primitive, structuralMetadataExtension) {\n if (!defined(structuralMetadataExtension)) {\n return;\n }\n\n // Property Textures\n if (defined(structuralMetadataExtension.propertyTextures)) {\n primitive.propertyTextureIds = structuralMetadataExtension.propertyTextures;\n }\n\n // Property Attributes\n if (defined(structuralMetadataExtension.propertyAttributes)) {\n primitive.propertyAttributeIds =\n structuralMetadataExtension.propertyAttributes;\n }\n}\n\n// For EXT_feature_metadata\nfunction loadPrimitiveMetadataLegacy(loader, primitive, metadataExtension) {\n // Feature Textures\n if (defined(metadataExtension.featureTextures)) {\n // feature textures are now identified by an integer index. To convert the\n // string IDs to integers, find their place in the sorted list of feature\n // table names\n primitive.propertyTextureIds = metadataExtension.featureTextures.map(\n function (id) {\n return loader._sortedFeatureTextureIds.indexOf(id);\n }\n );\n }\n}\n\nfunction loadInstances(loader, gltf, nodeExtensions, frameState) {\n const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;\n\n const instances = new Instances();\n const attributes = instancingExtension.attributes;\n if (defined(attributes)) {\n for (const semantic in attributes) {\n if (attributes.hasOwnProperty(semantic)) {\n const accessorId = attributes[semantic];\n instances.attributes.push(\n loadInstancedAttribute(\n loader,\n gltf,\n accessorId,\n attributes,\n semantic,\n frameState\n )\n );\n }\n }\n }\n\n const instancingExtExtensions = defaultValue(\n instancingExtension.extensions,\n defaultValue.EMPTY_OBJECT\n );\n const instanceFeatures = nodeExtensions.EXT_instance_features;\n const featureMetadataLegacy = instancingExtExtensions.EXT_feature_metadata;\n\n if (defined(instanceFeatures)) {\n loadInstanceFeatures(instances, instanceFeatures);\n } else if (defined(featureMetadataLegacy)) {\n loadInstanceFeaturesLegacy(\n gltf,\n instances,\n featureMetadataLegacy,\n loader._sortedPropertyTableIds\n );\n }\n\n return instances;\n}\n\n// For EXT_mesh_features\nfunction loadInstanceFeatures(instances, instanceFeaturesExtension) {\n // feature IDs are required in EXT_instance_features\n const featureIdsArray = instanceFeaturesExtension.featureIds;\n\n for (let i = 0; i < featureIdsArray.length; i++) {\n const featureIds = featureIdsArray[i];\n const label = `instanceFeatureId_${i}`;\n\n let featureIdComponent;\n if (defined(featureIds.attribute)) {\n featureIdComponent = loadFeatureIdAttribute(featureIds, label);\n } else {\n // in EXT_instance_features, the default is to assign IDs by instance\n // ID. This can be expressed with offset: 0, repeat: 1\n featureIdComponent = loadDefaultFeatureIds(featureIds, label);\n }\n\n instances.featureIds.push(featureIdComponent);\n }\n}\n\n// For backwards-compatibility with EXT_feature_metadata\nfunction loadInstanceFeaturesLegacy(\n gltf,\n instances,\n metadataExtension,\n sortedPropertyTableIds\n) {\n // For looking up the featureCount for each set of feature IDs\n const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;\n\n const featureIdAttributes = metadataExtension.featureIdAttributes;\n if (defined(featureIdAttributes)) {\n const featureIdAttributesLength = featureIdAttributes.length;\n for (let i = 0; i < featureIdAttributesLength; ++i) {\n const featureIdAttribute = featureIdAttributes[i];\n const featureTableId = featureIdAttribute.featureTable;\n const propertyTableId = sortedPropertyTableIds.indexOf(featureTableId);\n const featureCount = featureTables[featureTableId].count;\n const label = `instanceFeatureId_${i}`;\n\n let featureIdComponent;\n if (defined(featureIdAttribute.featureIds.attribute)) {\n featureIdComponent = loadFeatureIdAttributeLegacy(\n featureIdAttribute,\n propertyTableId,\n featureCount,\n label\n );\n } else {\n featureIdComponent = loadFeatureIdImplicitRangeLegacy(\n featureIdAttribute,\n propertyTableId,\n featureCount,\n label\n );\n }\n instances.featureIds.push(featureIdComponent);\n }\n }\n}\n\nfunction loadNode(loader, gltf, gltfNode, supportedImageFormats, frameState) {\n const node = new Node();\n\n node.name = gltfNode.name;\n\n node.matrix = fromArray(Matrix4, gltfNode.matrix);\n node.translation = fromArray(Cartesian3, gltfNode.translation);\n node.rotation = fromArray(Quaternion, gltfNode.rotation);\n node.scale = fromArray(Cartesian3, gltfNode.scale);\n\n const nodeExtensions = defaultValue(\n gltfNode.extensions,\n defaultValue.EMPTY_OBJECT\n );\n const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;\n const articulationsExtension = nodeExtensions.AGI_articulations;\n\n if (defined(instancingExtension)) {\n if (loader._loadForClassification) {\n throw new RuntimeError(\n \"Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.\"\n );\n }\n node.instances = loadInstances(loader, gltf, nodeExtensions, frameState);\n }\n\n if (defined(articulationsExtension)) {\n node.articulationName = articulationsExtension.articulationName;\n }\n\n const meshId = gltfNode.mesh;\n if (defined(meshId)) {\n const mesh = gltf.meshes[meshId];\n const primitives = mesh.primitives;\n const primitivesLength = primitives.length;\n for (let i = 0; i < primitivesLength; ++i) {\n node.primitives.push(\n loadPrimitive(\n loader,\n gltf,\n primitives[i],\n defined(node.instances),\n supportedImageFormats,\n frameState\n )\n );\n }\n\n // If the node has no weights array, it will look for the weights array provided\n // by the mesh. If both are undefined, it will default to an array of zero weights.\n const morphWeights = defaultValue(gltfNode.weights, mesh.weights);\n const targets = node.primitives[0].morphTargets;\n const targetsLength = targets.length;\n\n // Since meshes are not stored as separate components, the mesh weights will still\n // be stored at the node level.\n node.morphWeights = defined(morphWeights)\n ? morphWeights.slice()\n : new Array(targetsLength).fill(0.0);\n }\n\n return node;\n}\n\nfunction loadNodes(loader, gltf, supportedImageFormats, frameState) {\n if (!defined(gltf.nodes)) {\n return [];\n }\n\n let i;\n let j;\n\n const nodesLength = gltf.nodes.length;\n const nodes = new Array(nodesLength);\n for (i = 0; i < nodesLength; ++i) {\n const node = loadNode(\n loader,\n gltf,\n gltf.nodes[i],\n supportedImageFormats,\n frameState\n );\n node.index = i;\n nodes[i] = node;\n }\n\n for (i = 0; i < nodesLength; ++i) {\n const childrenNodeIds = gltf.nodes[i].children;\n if (defined(childrenNodeIds)) {\n const childrenLength = childrenNodeIds.length;\n for (j = 0; j < childrenLength; ++j) {\n nodes[i].children.push(nodes[childrenNodeIds[j]]);\n }\n }\n }\n\n return nodes;\n}\n\nfunction loadSkin(loader, gltf, gltfSkin, nodes) {\n const skin = new Skin();\n\n const jointIds = gltfSkin.joints;\n const jointsLength = jointIds.length;\n const joints = new Array(jointsLength);\n for (let i = 0; i < jointsLength; ++i) {\n joints[i] = nodes[jointIds[i]];\n }\n skin.joints = joints;\n\n const inverseBindMatricesAccessorId = gltfSkin.inverseBindMatrices;\n if (defined(inverseBindMatricesAccessorId)) {\n skin.inverseBindMatrices = loadAccessor(\n loader,\n gltf,\n inverseBindMatricesAccessorId\n );\n } else {\n skin.inverseBindMatrices = new Array(jointsLength).fill(Matrix4.IDENTITY);\n }\n\n return skin;\n}\n\nfunction loadSkins(loader, gltf, nodes) {\n const gltfSkins = gltf.skins;\n\n // Skins are disabled for classification models.\n if (loader._loadForClassification || !defined(gltfSkins)) {\n return [];\n }\n\n const skinsLength = gltf.skins.length;\n const skins = new Array(skinsLength);\n for (let i = 0; i < skinsLength; ++i) {\n const skin = loadSkin(loader, gltf, gltf.skins[i], nodes);\n skin.index = i;\n skins[i] = skin;\n }\n\n const nodesLength = nodes.length;\n for (let i = 0; i < nodesLength; ++i) {\n const skinId = gltf.nodes[i].skin;\n if (defined(skinId)) {\n nodes[i].skin = skins[skinId];\n }\n }\n\n return skins;\n}\n\nfunction loadStructuralMetadata(\n loader,\n gltf,\n extension,\n extensionLegacy,\n supportedImageFormats,\n frameState\n) {\n const structuralMetadataLoader = new GltfStructuralMetadataLoader({\n gltf: gltf,\n extension: extension,\n extensionLegacy: extensionLegacy,\n gltfResource: loader._gltfResource,\n baseResource: loader._baseResource,\n supportedImageFormats: supportedImageFormats,\n frameState: frameState,\n asynchronous: loader._asynchronous,\n });\n structuralMetadataLoader.load();\n\n loader._structuralMetadataLoader = structuralMetadataLoader;\n\n return structuralMetadataLoader;\n}\n\nfunction loadAnimationSampler(loader, gltf, gltfSampler) {\n const animationSampler = new AnimationSampler();\n\n const inputAccessorId = gltfSampler.input;\n animationSampler.input = loadAccessor(loader, gltf, inputAccessorId);\n\n const gltfInterpolation = gltfSampler.interpolation;\n animationSampler.interpolation = defaultValue(\n InterpolationType[gltfInterpolation],\n InterpolationType.LINEAR\n );\n\n const outputAccessorId = gltfSampler.output;\n animationSampler.output = loadAccessor(loader, gltf, outputAccessorId, true);\n\n return animationSampler;\n}\n\nfunction loadAnimationTarget(gltfTarget, nodes) {\n const animationTarget = new AnimationTarget();\n\n const nodeIndex = gltfTarget.node;\n // If the node isn't defined, the animation channel should be ignored.\n // It's easiest to signal this by returning undefined.\n if (!defined(nodeIndex)) {\n return undefined;\n }\n\n animationTarget.node = nodes[nodeIndex];\n\n const path = gltfTarget.path.toUpperCase();\n animationTarget.path = AnimatedPropertyType[path];\n\n return animationTarget;\n}\n\nfunction loadAnimationChannel(gltfChannel, samplers, nodes) {\n const animationChannel = new AnimationChannel();\n\n const samplerIndex = gltfChannel.sampler;\n animationChannel.sampler = samplers[samplerIndex];\n animationChannel.target = loadAnimationTarget(gltfChannel.target, nodes);\n\n return animationChannel;\n}\n\nfunction loadAnimation(loader, gltf, gltfAnimation, nodes) {\n let i;\n\n const animation = new Animation();\n animation.name = gltfAnimation.name;\n\n const gltfSamplers = gltfAnimation.samplers;\n const samplersLength = gltfSamplers.length;\n\n const samplers = new Array(samplersLength);\n for (i = 0; i < samplersLength; i++) {\n const sampler = loadAnimationSampler(loader, gltf, gltfSamplers[i]);\n sampler.index = i;\n samplers[i] = sampler;\n }\n\n const gltfChannels = gltfAnimation.channels;\n const channelsLength = gltfChannels.length;\n\n const channels = new Array(channelsLength);\n for (i = 0; i < channelsLength; i++) {\n channels[i] = loadAnimationChannel(gltfChannels[i], samplers, nodes);\n }\n\n animation.samplers = samplers;\n animation.channels = channels;\n\n return animation;\n}\n\nfunction loadAnimations(loader, gltf, nodes) {\n const gltfAnimations = gltf.animations;\n\n // Animations are disabled for classification models.\n if (loader._loadForClassification || !defined(gltfAnimations)) {\n return [];\n }\n\n const animationsLength = gltf.animations.length;\n const animations = new Array(animationsLength);\n for (let i = 0; i < animationsLength; ++i) {\n const animation = loadAnimation(loader, gltf, gltf.animations[i], nodes);\n animation.index = i;\n animations[i] = animation;\n }\n\n return animations;\n}\n\nfunction loadArticulationStage(gltfStage) {\n const stage = new ArticulationStage();\n stage.name = gltfStage.name;\n\n const type = gltfStage.type.toUpperCase();\n stage.type = ArticulationStageType[type];\n\n stage.minimumValue = gltfStage.minimumValue;\n stage.maximumValue = gltfStage.maximumValue;\n stage.initialValue = gltfStage.initialValue;\n\n return stage;\n}\n\nfunction loadArticulation(gltfArticulation) {\n const articulation = new Articulation();\n articulation.name = gltfArticulation.name;\n\n const gltfStages = gltfArticulation.stages;\n const gltfStagesLength = gltfStages.length;\n\n const stages = new Array(gltfStagesLength);\n for (let i = 0; i < gltfStagesLength; i++) {\n const stage = loadArticulationStage(gltfStages[i]);\n stages[i] = stage;\n }\n\n articulation.stages = stages;\n\n return articulation;\n}\n\nfunction loadArticulations(gltf) {\n const extensions = defaultValue(gltf.extensions, defaultValue.EMPTY_OBJECT);\n const articulationsExtension = extensions.AGI_articulations;\n\n if (!defined(articulationsExtension)) {\n return [];\n }\n\n const gltfArticulations = articulationsExtension.articulations;\n if (!defined(gltfArticulations)) {\n return [];\n }\n\n const gltfArticulationsLength = gltfArticulations.length;\n const articulations = new Array(gltfArticulationsLength);\n for (let i = 0; i < gltfArticulationsLength; i++) {\n const articulation = loadArticulation(gltfArticulations[i]);\n articulations[i] = articulation;\n }\n\n return articulations;\n}\n\nfunction getSceneNodeIds(gltf) {\n let nodesIds;\n if (defined(gltf.scenes) && defined(gltf.scene)) {\n nodesIds = gltf.scenes[gltf.scene].nodes;\n }\n nodesIds = defaultValue(nodesIds, gltf.nodes);\n nodesIds = defined(nodesIds) ? nodesIds : [];\n return nodesIds;\n}\n\nfunction loadScene(gltf, nodes) {\n const scene = new Scene();\n const sceneNodeIds = getSceneNodeIds(gltf);\n scene.nodes = sceneNodeIds.map(function (sceneNodeId) {\n return nodes[sceneNodeId];\n });\n return scene;\n}\n\nconst scratchCenter = new Cartesian3();\n\nfunction parse(\n loader,\n gltf,\n supportedImageFormats,\n frameState,\n rejectPromise,\n rejectTexturesPromise\n) {\n const version = gltf.asset.version;\n if (version !== \"1.0\" && version !== \"2.0\") {\n const url = loader._gltfResource.url;\n throw new RuntimeError(\n `Failed to load ${url}: \\nUnsupported glTF version: ${version}`\n );\n }\n const extensionsRequired = gltf.extensionsRequired;\n if (defined(extensionsRequired)) {\n ModelUtility.checkSupportedExtensions(extensionsRequired);\n\n // Check for the KHR_mesh_quantization extension here, it will be used later\n // in loadAttribute().\n loader._hasKhrMeshQuantization = extensionsRequired.includes(\n \"KHR_mesh_quantization\"\n );\n }\n\n const extensions = defaultValue(gltf.extensions, defaultValue.EMPTY_OBJECT);\n const structuralMetadataExtension = extensions.EXT_structural_metadata;\n const featureMetadataExtensionLegacy = extensions.EXT_feature_metadata;\n const cesiumRtcExtension = extensions.CESIUM_RTC;\n\n if (defined(featureMetadataExtensionLegacy)) {\n // If the old EXT_feature_metadata extension is present, sort the IDs of the\n // feature tables and feature textures so we don't have to do this once\n // per primitive.\n //\n // This must run before loadNodes so these IDs are available when\n // attributes are processed.\n const featureTables = featureMetadataExtensionLegacy.featureTables;\n const featureTextures = featureMetadataExtensionLegacy.featureTextures;\n const allPropertyTableIds = defined(featureTables) ? featureTables : [];\n const allFeatureTextureIds = defined(featureTextures)\n ? featureTextures\n : [];\n loader._sortedPropertyTableIds = Object.keys(allPropertyTableIds).sort();\n loader._sortedFeatureTextureIds = Object.keys(allFeatureTextureIds).sort();\n }\n\n const nodes = loadNodes(loader, gltf, supportedImageFormats, frameState);\n const skins = loadSkins(loader, gltf, nodes);\n const animations = loadAnimations(loader, gltf, nodes);\n const articulations = loadArticulations(gltf);\n const scene = loadScene(gltf, nodes);\n\n const components = new Components();\n const asset = new Asset();\n const copyright = gltf.asset.copyright;\n if (defined(copyright)) {\n const credits = copyright.split(\";\").map(function (string) {\n return new Credit(string.trim());\n });\n asset.credits = credits;\n }\n\n components.asset = asset;\n components.scene = scene;\n components.nodes = nodes;\n components.skins = skins;\n components.animations = animations;\n components.articulations = articulations;\n components.upAxis = loader._upAxis;\n components.forwardAxis = loader._forwardAxis;\n\n if (defined(cesiumRtcExtension)) {\n // CESIUM_RTC is almost always WGS84 coordinates so no axis conversion needed\n const center = Cartesian3.fromArray(\n cesiumRtcExtension.center,\n 0,\n scratchCenter\n );\n components.transform = Matrix4.fromTranslation(\n center,\n components.transform\n );\n }\n\n loader._components = components;\n\n // Load structural metadata (property tables and property textures)\n if (\n defined(structuralMetadataExtension) ||\n defined(featureMetadataExtensionLegacy)\n ) {\n const structuralMetadataLoader = loadStructuralMetadata(\n loader,\n gltf,\n structuralMetadataExtension,\n featureMetadataExtensionLegacy,\n supportedImageFormats,\n frameState\n );\n const promise = structuralMetadataLoader.promise.then(function (\n structuralMetadataLoader\n ) {\n if (loader.isDestroyed()) {\n return;\n }\n components.structuralMetadata =\n structuralMetadataLoader.structuralMetadata;\n });\n loader._loaderPromises.push(promise);\n }\n\n // Gather promises and reject if any promises fail.\n const readyPromises = [];\n readyPromises.push.apply(readyPromises, loader._loaderPromises);\n\n if (!loader._incrementallyLoadTextures) {\n readyPromises.push.apply(readyPromises, loader._texturesPromises);\n }\n\n Promise.all(readyPromises)\n .then(function () {\n if (loader.isDestroyed()) {\n return;\n }\n loader._state = GltfLoaderState.POST_PROCESSING;\n })\n .catch(rejectPromise);\n\n // Separate promise will resolve once textures are loaded.\n Promise.all(loader._texturesPromises)\n .then(function () {\n if (loader.isDestroyed()) {\n return;\n }\n\n // post processing only applies for geometry\n loader._textureState = GltfLoaderState.PROCESSED;\n })\n .catch(rejectTexturesPromise);\n}\n\nfunction unloadTextures(loader) {\n const textureLoaders = loader._textureLoaders;\n const textureLoadersLength = textureLoaders.length;\n for (let i = 0; i < textureLoadersLength; ++i) {\n ResourceCache.unload(textureLoaders[i]);\n }\n loader._textureLoaders.length = 0;\n}\n\nfunction unloadBufferViews(loader) {\n const bufferViewLoaders = loader._bufferViewLoaders;\n const bufferViewLoadersLength = bufferViewLoaders.length;\n for (let i = 0; i < bufferViewLoadersLength; ++i) {\n ResourceCache.unload(bufferViewLoaders[i]);\n }\n loader._bufferViewLoaders.length = 0;\n}\n\nfunction unloadGeometry(loader) {\n const geometryLoaders = loader._geometryLoaders;\n const geometryLoadersLength = geometryLoaders.length;\n for (let i = 0; i < geometryLoadersLength; ++i) {\n ResourceCache.unload(geometryLoaders[i]);\n }\n loader._geometryLoaders.length = 0;\n}\n\nfunction unloadGeneratedAttributes(loader) {\n const buffers = loader._postProcessBuffers;\n const length = buffers.length;\n for (let i = 0; i < length; i++) {\n const buffer = buffers[i];\n if (!buffer.isDestroyed()) {\n buffer.destroy();\n }\n }\n buffers.length = 0;\n}\n\nfunction unloadStructuralMetadata(loader) {\n if (defined(loader._structuralMetadataLoader)) {\n loader._structuralMetadataLoader.destroy();\n loader._structuralMetadataLoader = undefined;\n }\n}\n\n/**\n * Returns whether the resource has been unloaded.\n * @private\n */\nGltfLoader.prototype.isUnloaded = function () {\n return this._state === GltfLoaderState.UNLOADED;\n};\n\n/**\n * Unloads the resource.\n * @private\n */\nGltfLoader.prototype.unload = function () {\n if (defined(this._gltfJsonLoader)) {\n ResourceCache.unload(this._gltfJsonLoader);\n }\n this._gltfJsonLoader = undefined;\n\n unloadTextures(this);\n unloadBufferViews(this);\n unloadGeometry(this);\n unloadGeneratedAttributes(this);\n unloadStructuralMetadata(this);\n\n this._components = undefined;\n this._typedArray = undefined;\n this._state = GltfLoaderState.UNLOADED;\n};\n\nexport default GltfLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\n\nfunction attachTexture(framebuffer, attachment, texture) {\n const gl = framebuffer._gl;\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n attachment,\n texture._target,\n texture._texture,\n 0\n );\n}\n\nfunction attachRenderbuffer(framebuffer, attachment, renderbuffer) {\n const gl = framebuffer._gl;\n gl.framebufferRenderbuffer(\n gl.FRAMEBUFFER,\n attachment,\n gl.RENDERBUFFER,\n renderbuffer._getRenderbuffer()\n );\n}\n\n/**\n * Creates a framebuffer with optional initial color, depth, and stencil attachments.\n * Framebuffers are used for render-to-texture effects; they allow us to render to\n * textures in one pass, and read from it in a later pass.\n *\n * @param {Object} options The initial framebuffer attachments as shown in the example below. <code>context</code> is required. The possible properties are <code>colorTextures</code>, <code>colorRenderbuffers</code>, <code>depthTexture</code>, <code>depthRenderbuffer</code>, <code>stencilRenderbuffer</code>, <code>depthStencilTexture</code>, <code>depthStencilRenderbuffer</code>, and <code>destroyAttachments</code>.\n *\n * @exception {DeveloperError} Cannot have both color texture and color renderbuffer attachments.\n * @exception {DeveloperError} Cannot have both a depth texture and depth renderbuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth and depth-stencil renderbuffer.\n * @exception {DeveloperError} Cannot have both a stencil and depth-stencil renderbuffer.\n * @exception {DeveloperError} Cannot have both a depth and stencil renderbuffer.\n * @exception {DeveloperError} The color-texture pixel-format must be a color format.\n * @exception {DeveloperError} The depth-texture pixel-format must be DEPTH_COMPONENT.\n * @exception {DeveloperError} The depth-stencil-texture pixel-format must be DEPTH_STENCIL.\n * @exception {DeveloperError} The number of color attachments exceeds the number supported.\n * @exception {DeveloperError} The color-texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension.\n * @exception {DeveloperError} The color-texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions.\n *\n * @example\n * // Create a framebuffer with color and depth texture attachments.\n * const width = context.canvas.clientWidth;\n * const height = context.canvas.clientHeight;\n * const framebuffer = new Framebuffer({\n * context : context,\n * colorTextures : [new Texture({\n * context : context,\n * width : width,\n * height : height,\n * pixelFormat : PixelFormat.RGBA\n * })],\n * depthTexture : new Texture({\n * context : context,\n * width : width,\n * height : height,\n * pixelFormat : PixelFormat.DEPTH_COMPONENT,\n * pixelDatatype : PixelDatatype.UNSIGNED_SHORT\n * })\n * });\n *\n * @private\n * @constructor\n */\nfunction Framebuffer(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const gl = context._gl;\n const maximumColorAttachments = ContextLimits.maximumColorAttachments;\n\n this._gl = gl;\n this._framebuffer = gl.createFramebuffer();\n\n this._colorTextures = [];\n this._colorRenderbuffers = [];\n this._activeColorAttachments = [];\n\n this._depthTexture = undefined;\n this._depthRenderbuffer = undefined;\n this._stencilRenderbuffer = undefined;\n this._depthStencilTexture = undefined;\n this._depthStencilRenderbuffer = undefined;\n\n /**\n * When true, the framebuffer owns its attachments so they will be destroyed when\n * {@link Framebuffer#destroy} is called or when a new attachment is assigned\n * to an attachment point.\n *\n * @type {Boolean}\n * @default true\n *\n * @see Framebuffer#destroy\n */\n this.destroyAttachments = defaultValue(options.destroyAttachments, true);\n\n // Throw if a texture and renderbuffer are attached to the same point. This won't\n // cause a WebGL error (because only one will be attached), but is likely a developer error.\n\n // Avoid errors defined in Section 6.5 of the WebGL spec\n const depthAttachment =\n defined(options.depthTexture) || defined(options.depthRenderbuffer);\n const depthStencilAttachment =\n defined(options.depthStencilTexture) ||\n defined(options.depthStencilRenderbuffer);\n\n ///////////////////////////////////////////////////////////////////\n\n this._bind();\n\n let texture;\n let renderbuffer;\n let i;\n let length;\n let attachmentEnum;\n\n if (defined(options.colorTextures)) {\n const textures = options.colorTextures;\n length = this._colorTextures.length = this._activeColorAttachments.length =\n textures.length;\n\n for (i = 0; i < length; ++i) {\n texture = textures[i];\n\n attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;\n attachTexture(this, attachmentEnum, texture);\n this._activeColorAttachments[i] = attachmentEnum;\n this._colorTextures[i] = texture;\n }\n }\n\n if (defined(options.colorRenderbuffers)) {\n const renderbuffers = options.colorRenderbuffers;\n length = this._colorRenderbuffers.length = this._activeColorAttachments.length =\n renderbuffers.length;\n\n for (i = 0; i < length; ++i) {\n renderbuffer = renderbuffers[i];\n attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;\n attachRenderbuffer(this, attachmentEnum, renderbuffer);\n this._activeColorAttachments[i] = attachmentEnum;\n this._colorRenderbuffers[i] = renderbuffer;\n }\n }\n\n if (defined(options.depthTexture)) {\n texture = options.depthTexture;\n\n attachTexture(this, this._gl.DEPTH_ATTACHMENT, texture);\n this._depthTexture = texture;\n }\n\n if (defined(options.depthRenderbuffer)) {\n renderbuffer = options.depthRenderbuffer;\n attachRenderbuffer(this, this._gl.DEPTH_ATTACHMENT, renderbuffer);\n this._depthRenderbuffer = renderbuffer;\n }\n\n if (defined(options.stencilRenderbuffer)) {\n renderbuffer = options.stencilRenderbuffer;\n attachRenderbuffer(this, this._gl.STENCIL_ATTACHMENT, renderbuffer);\n this._stencilRenderbuffer = renderbuffer;\n }\n\n if (defined(options.depthStencilTexture)) {\n texture = options.depthStencilTexture;\n\n attachTexture(this, this._gl.DEPTH_STENCIL_ATTACHMENT, texture);\n this._depthStencilTexture = texture;\n }\n\n if (defined(options.depthStencilRenderbuffer)) {\n renderbuffer = options.depthStencilRenderbuffer;\n attachRenderbuffer(this, this._gl.DEPTH_STENCIL_ATTACHMENT, renderbuffer);\n this._depthStencilRenderbuffer = renderbuffer;\n }\n\n this._unBind();\n}\n\nObject.defineProperties(Framebuffer.prototype, {\n /**\n * The status of the framebuffer. If the status is not WebGLConstants.FRAMEBUFFER_COMPLETE,\n * a {@link DeveloperError} will be thrown when attempting to render to the framebuffer.\n * @memberof Framebuffer.prototype\n * @type {Number}\n */\n status: {\n get: function () {\n this._bind();\n const status = this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);\n this._unBind();\n return status;\n },\n },\n numberOfColorAttachments: {\n get: function () {\n return this._activeColorAttachments.length;\n },\n },\n depthTexture: {\n get: function () {\n return this._depthTexture;\n },\n },\n depthRenderbuffer: {\n get: function () {\n return this._depthRenderbuffer;\n },\n },\n stencilRenderbuffer: {\n get: function () {\n return this._stencilRenderbuffer;\n },\n },\n depthStencilTexture: {\n get: function () {\n return this._depthStencilTexture;\n },\n },\n depthStencilRenderbuffer: {\n get: function () {\n return this._depthStencilRenderbuffer;\n },\n },\n\n /**\n * True if the framebuffer has a depth attachment. Depth attachments include\n * depth and depth-stencil textures, and depth and depth-stencil renderbuffers. When\n * rendering to a framebuffer, a depth attachment is required for the depth test to have effect.\n * @memberof Framebuffer.prototype\n * @type {Boolean}\n */\n hasDepthAttachment: {\n get: function () {\n return !!(\n this.depthTexture ||\n this.depthRenderbuffer ||\n this.depthStencilTexture ||\n this.depthStencilRenderbuffer\n );\n },\n },\n});\n\nFramebuffer.prototype._bind = function () {\n const gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype._unBind = function () {\n const gl = this._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n};\n\nFramebuffer.prototype.bindDraw = function () {\n const gl = this._gl;\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype.bindRead = function () {\n const gl = this._gl;\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this._framebuffer);\n};\n\nFramebuffer.prototype._getActiveColorAttachments = function () {\n return this._activeColorAttachments;\n};\n\nFramebuffer.prototype.getColorTexture = function (index) {\n return this._colorTextures[index];\n};\n\nFramebuffer.prototype.getColorRenderbuffer = function (index) {\n return this._colorRenderbuffers[index];\n};\n\nFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nFramebuffer.prototype.destroy = function () {\n if (this.destroyAttachments) {\n // If the color texture is a cube map face, it is owned by the cube map, and will not be destroyed.\n let i = 0;\n const textures = this._colorTextures;\n let length = textures.length;\n for (; i < length; ++i) {\n const texture = textures[i];\n if (defined(texture)) {\n texture.destroy();\n }\n }\n\n const renderbuffers = this._colorRenderbuffers;\n length = renderbuffers.length;\n for (i = 0; i < length; ++i) {\n const renderbuffer = renderbuffers[i];\n if (defined(renderbuffer)) {\n renderbuffer.destroy();\n }\n }\n\n this._depthTexture = this._depthTexture && this._depthTexture.destroy();\n this._depthRenderbuffer =\n this._depthRenderbuffer && this._depthRenderbuffer.destroy();\n this._stencilRenderbuffer =\n this._stencilRenderbuffer && this._stencilRenderbuffer.destroy();\n this._depthStencilTexture =\n this._depthStencilTexture && this._depthStencilTexture.destroy();\n this._depthStencilRenderbuffer =\n this._depthStencilRenderbuffer &&\n this._depthStencilRenderbuffer.destroy();\n }\n\n this._gl.deleteFramebuffer(this._framebuffer);\n return destroyObject(this);\n};\nexport default Framebuffer;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Framebuffer from \"./Framebuffer.js\";\n\n/**\n * Creates a multisampling wrapper around two framebuffers with optional initial\n * color and depth-stencil attachments. The first framebuffer has multisampled\n * renderbuffer attachments and is bound to READ_FRAMEBUFFER during the blit. The\n * second is bound to DRAW_FRAMEBUFFER during the blit, and has texture attachments\n * to store the copied pixels.\n *\n * @param {Object} options The initial framebuffer attachments. <code>context</code>, <code>width</code>, and <code>height</code> are required. The possible properties are <code>colorTextures</code>, <code>colorRenderbuffers</code>, <code>depthStencilTexture</code>, <code>depthStencilRenderbuffer</code>, and <code>destroyAttachments</code>.\n *\n * @exception {DeveloperError} Both color renderbuffer and texture attachments must be provided.\n * @exception {DeveloperError} Both depth-stencil renderbuffer and texture attachments must be provided.\n *\n * @private\n * @constructor\n */\nfunction MultisampleFramebuffer(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const width = options.width;\n const height = options.height;\nthis._width = width;\n this._height = height;\n\n const colorRenderbuffers = options.colorRenderbuffers;\n const colorTextures = options.colorTextures;\n if (defined(colorRenderbuffers) !== defined(colorTextures)) {\n throw new DeveloperError(\n \"Both color renderbuffer and texture attachments must be provided.\"\n );\n }\n\n const depthStencilRenderbuffer = options.depthStencilRenderbuffer;\n const depthStencilTexture = options.depthStencilTexture;\n if (defined(depthStencilRenderbuffer) !== defined(depthStencilTexture)) {\n throw new DeveloperError(\n \"Both depth-stencil renderbuffer and texture attachments must be provided.\"\n );\n }\n\n this._renderFramebuffer = new Framebuffer({\n context: context,\n colorRenderbuffers: colorRenderbuffers,\n depthStencilRenderbuffer: depthStencilRenderbuffer,\n destroyAttachments: options.destroyAttachments,\n });\n this._colorFramebuffer = new Framebuffer({\n context: context,\n colorTextures: colorTextures,\n depthStencilTexture: depthStencilTexture,\n destroyAttachments: options.destroyAttachments,\n });\n}\n\nMultisampleFramebuffer.prototype.getRenderFramebuffer = function () {\n return this._renderFramebuffer;\n};\n\nMultisampleFramebuffer.prototype.getColorFramebuffer = function () {\n return this._colorFramebuffer;\n};\n\nMultisampleFramebuffer.prototype.blitFramebuffers = function (\n context,\n blitStencil\n) {\n this._renderFramebuffer.bindRead();\n this._colorFramebuffer.bindDraw();\n const gl = context._gl;\n let mask = 0;\n if (this._colorFramebuffer._colorTextures.length > 0) {\n mask |= gl.COLOR_BUFFER_BIT;\n }\n if (defined(this._colorFramebuffer.depthStencilTexture)) {\n mask |= gl.DEPTH_BUFFER_BIT | (blitStencil ? gl.STENCIL_BUFFER_BIT : 0);\n }\n gl.blitFramebuffer(\n 0,\n 0,\n this._width,\n this._height,\n 0,\n 0,\n this._width,\n this._height,\n mask,\n gl.NEAREST\n );\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n};\n\nMultisampleFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nMultisampleFramebuffer.prototype.destroy = function () {\n this._renderFramebuffer.destroy();\n this._colorFramebuffer.destroy();\n return destroyObject(this);\n};\n\nexport default MultisampleFramebuffer;\n", "import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * @private\n */\nconst RenderbufferFormat = {\n RGBA4: WebGLConstants.RGBA4,\n RGBA8: WebGLConstants.RGBA8,\n RGBA16F: WebGLConstants.RGBA16F,\n RGBA32F: WebGLConstants.RGBA32F,\n RGB5_A1: WebGLConstants.RGB5_A1,\n RGB565: WebGLConstants.RGB565,\n DEPTH_COMPONENT16: WebGLConstants.DEPTH_COMPONENT16,\n STENCIL_INDEX8: WebGLConstants.STENCIL_INDEX8,\n DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL,\n DEPTH24_STENCIL8: WebGLConstants.DEPTH24_STENCIL8,\n\n validate: function (renderbufferFormat) {\n return (\n renderbufferFormat === RenderbufferFormat.RGBA4 ||\n renderbufferFormat === RenderbufferFormat.RGBA8 ||\n renderbufferFormat === RenderbufferFormat.RGBA16F ||\n renderbufferFormat === RenderbufferFormat.RGBA32F ||\n renderbufferFormat === RenderbufferFormat.RGB5_A1 ||\n renderbufferFormat === RenderbufferFormat.RGB565 ||\n renderbufferFormat === RenderbufferFormat.DEPTH_COMPONENT16 ||\n renderbufferFormat === RenderbufferFormat.STENCIL_INDEX8 ||\n renderbufferFormat === RenderbufferFormat.DEPTH_STENCIL ||\n renderbufferFormat === RenderbufferFormat.DEPTH24_STENCIL8\n );\n },\n\n getColorFormat: function (datatype) {\n if (datatype === WebGLConstants.FLOAT) {\n return RenderbufferFormat.RGBA32F;\n } else if (datatype === WebGLConstants.HALF_FLOAT_OES) {\n return RenderbufferFormat.RGBA16F;\n }\n return RenderbufferFormat.RGBA8;\n },\n};\nexport default Object.freeze(RenderbufferFormat);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport RenderbufferFormat from \"./RenderbufferFormat.js\";\n\n/**\n * @private\n */\nfunction Renderbuffer(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const context = options.context;\n const gl = context._gl;\n const maximumRenderbufferSize = ContextLimits.maximumRenderbufferSize;\n\n const format = defaultValue(options.format, RenderbufferFormat.RGBA4);\n const width = defined(options.width) ? options.width : gl.drawingBufferWidth;\n const height = defined(options.height)\n ? options.height\n : gl.drawingBufferHeight;\n const numSamples = defaultValue(options.numSamples, 1);\n\n this._gl = gl;\n this._format = format;\n this._width = width;\n this._height = height;\n this._renderbuffer = this._gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, this._renderbuffer);\n if (numSamples > 1) {\n gl.renderbufferStorageMultisample(\n gl.RENDERBUFFER,\n numSamples,\n format,\n width,\n height\n );\n } else {\n gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height);\n }\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n}\n\nObject.defineProperties(Renderbuffer.prototype, {\n format: {\n get: function () {\n return this._format;\n },\n },\n width: {\n get: function () {\n return this._width;\n },\n },\n height: {\n get: function () {\n return this._height;\n },\n },\n});\n\nRenderbuffer.prototype._getRenderbuffer = function () {\n return this._renderbuffer;\n};\n\nRenderbuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nRenderbuffer.prototype.destroy = function () {\n this._gl.deleteRenderbuffer(this._renderbuffer);\n return destroyObject(this);\n};\nexport default Renderbuffer;\n", "import Framebuffer from \"./Framebuffer.js\";\nimport MultisampleFramebuffer from \"./MultisampleFramebuffer.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport Renderbuffer from \"./Renderbuffer.js\";\nimport RenderbufferFormat from \"./RenderbufferFormat.js\";\nimport Sampler from \"./Sampler.js\";\nimport Texture from \"./Texture.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\n\n/**\n * Creates a wrapper object around a framebuffer and its resources.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} [options.numSamples=1] The multisampling rate of the render targets. Requires a WebGL2 context.\n * @param {Number} [options.colorAttachmentsLength=1] The number of color attachments this FramebufferManager will create.\n * @param {Boolean} [options.color=true] Whether the FramebufferManager will use color attachments.\n * @param {Boolean} [options.depth=false] Whether the FramebufferManager will use depth attachments.\n * @param {Boolean} [options.depthStencil=false] Whether the FramebufferManager will use depth-stencil attachments.\n * @param {Boolean} [options.supportsDepthTexture=false] Whether the FramebufferManager will create a depth texture when the extension is supported.\n * @param {Boolean} [options.createColorAttachments=true] Whether the FramebufferManager will construct its own color attachments.\n * @param {Boolean} [options.createDepthAttachments=true] Whether the FramebufferManager will construct its own depth attachments.\n * @param {PixelDatatype} [options.pixelDatatype=undefined] The default pixel datatype to use when creating color attachments.\n * @param {PixelFormat} [options.pixelFormat=undefined] The default pixel format to use when creating color attachments.\n *\n * @exception {DeveloperError} Must enable at least one type of framebuffer attachment.\n * @exception {DeveloperError} Cannot have both a depth and depth-stencil attachment.\n *\n * @private\n * @constructor\n */\nfunction FramebufferManager(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._numSamples = defaultValue(options.numSamples, 1);\n this._colorAttachmentsLength = defaultValue(\n options.colorAttachmentsLength,\n 1\n );\n\n this._color = defaultValue(options.color, true);\n this._depth = defaultValue(options.depth, false);\n this._depthStencil = defaultValue(options.depthStencil, false);\n this._supportsDepthTexture = defaultValue(\n options.supportsDepthTexture,\n false\n );\n this._createColorAttachments = defaultValue(\n options.createColorAttachments,\n true\n );\n this._createDepthAttachments = defaultValue(\n options.createDepthAttachments,\n true\n );\n\n this._pixelDatatype = options.pixelDatatype;\n this._pixelFormat = options.pixelFormat;\n\n this._width = undefined;\n this._height = undefined;\n\n this._framebuffer = undefined;\n this._multisampleFramebuffer = undefined;\n this._colorTextures = undefined;\n if (this._color) {\n this._colorTextures = new Array(this._colorAttachmentsLength);\n this._colorRenderbuffers = new Array(this._colorAttachmentsLength);\n }\n this._colorRenderbuffer = undefined;\n this._depthStencilRenderbuffer = undefined;\n this._depthStencilTexture = undefined;\n this._depthRenderbuffer = undefined;\n this._depthTexture = undefined;\n\n this._attachmentsDirty = false;\n}\n\nObject.defineProperties(FramebufferManager.prototype, {\n framebuffer: {\n get: function () {\n if (this._numSamples > 1) {\n return this._multisampleFramebuffer.getRenderFramebuffer();\n }\n return this._framebuffer;\n },\n },\n numSamples: {\n get: function () {\n return this._numSamples;\n },\n },\n status: {\n get: function () {\n return this.framebuffer.status;\n },\n },\n});\n\nFramebufferManager.prototype.isDirty = function (\n width,\n height,\n numSamples,\n pixelDatatype,\n pixelFormat\n) {\n numSamples = defaultValue(numSamples, 1);\n const dimensionChanged = this._width !== width || this._height !== height;\n const samplesChanged = this._numSamples !== numSamples;\n const pixelChanged =\n (defined(pixelDatatype) && this._pixelDatatype !== pixelDatatype) ||\n (defined(pixelFormat) && this._pixelFormat !== pixelFormat);\n const framebufferDefined =\n numSamples === 1\n ? defined(this._framebuffer)\n : defined(this._multisampleFramebuffer);\n\n return (\n this._attachmentsDirty ||\n dimensionChanged ||\n samplesChanged ||\n pixelChanged ||\n !framebufferDefined ||\n (this._color && !defined(this._colorTextures[0]))\n );\n};\n\nFramebufferManager.prototype.update = function (\n context,\n width,\n height,\n numSamples,\n pixelDatatype,\n pixelFormat\n) {\nnumSamples = context.msaa ? defaultValue(numSamples, 1) : 1;\n pixelDatatype = defaultValue(\n pixelDatatype,\n this._color\n ? defaultValue(this._pixelDatatype, PixelDatatype.UNSIGNED_BYTE)\n : undefined\n );\n pixelFormat = defaultValue(\n pixelFormat,\n this._color ? defaultValue(this._pixelFormat, PixelFormat.RGBA) : undefined\n );\n\n if (this.isDirty(width, height, numSamples, pixelDatatype, pixelFormat)) {\n this.destroy();\n this._width = width;\n this._height = height;\n this._numSamples = numSamples;\n this._pixelDatatype = pixelDatatype;\n this._pixelFormat = pixelFormat;\n this._attachmentsDirty = false;\n\n // Create color texture\n if (this._color && this._createColorAttachments) {\n for (let i = 0; i < this._colorAttachmentsLength; ++i) {\n this._colorTextures[i] = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: pixelFormat,\n pixelDatatype: pixelDatatype,\n sampler: Sampler.NEAREST,\n });\n if (this._numSamples > 1) {\n const format = RenderbufferFormat.getColorFormat(pixelDatatype);\n this._colorRenderbuffers[i] = new Renderbuffer({\n context: context,\n width: width,\n height: height,\n format: format,\n numSamples: this._numSamples,\n });\n }\n }\n }\n\n // Create depth stencil texture or renderbuffer\n if (this._depthStencil && this._createDepthAttachments) {\n if (this._supportsDepthTexture && context.depthTexture) {\n this._depthStencilTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: PixelFormat.DEPTH_STENCIL,\n pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n sampler: Sampler.NEAREST,\n });\n if (this._numSamples > 1) {\n this._depthStencilRenderbuffer = new Renderbuffer({\n context: context,\n width: width,\n height: height,\n format: RenderbufferFormat.DEPTH24_STENCIL8,\n numSamples: this._numSamples,\n });\n }\n } else {\n this._depthStencilRenderbuffer = new Renderbuffer({\n context: context,\n width: width,\n height: height,\n format: RenderbufferFormat.DEPTH_STENCIL,\n });\n }\n }\n\n // Create depth texture\n if (this._depth && this._createDepthAttachments) {\n if (this._supportsDepthTexture && context.depthTexture) {\n this._depthTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: PixelFormat.DEPTH_COMPONENT,\n pixelDatatype: PixelDatatype.UNSIGNED_INT,\n sampler: Sampler.NEAREST,\n });\n } else {\n this._depthRenderbuffer = new Renderbuffer({\n context: context,\n width: width,\n height: height,\n format: RenderbufferFormat.DEPTH_COMPONENT16,\n });\n }\n }\n\n if (this._numSamples > 1) {\n this._multisampleFramebuffer = new MultisampleFramebuffer({\n context: context,\n width: this._width,\n height: this._height,\n colorTextures: this._colorTextures,\n colorRenderbuffers: this._colorRenderbuffers,\n depthStencilTexture: this._depthStencilTexture,\n depthStencilRenderbuffer: this._depthStencilRenderbuffer,\n destroyAttachments: false,\n });\n } else {\n this._framebuffer = new Framebuffer({\n context: context,\n colorTextures: this._colorTextures,\n depthTexture: this._depthTexture,\n depthRenderbuffer: this._depthRenderbuffer,\n depthStencilTexture: this._depthStencilTexture,\n depthStencilRenderbuffer: this._depthStencilRenderbuffer,\n destroyAttachments: false,\n });\n }\n }\n};\n\nFramebufferManager.prototype.getColorTexture = function (index) {\n index = defaultValue(index, 0);\nreturn this._colorTextures[index];\n};\n\nFramebufferManager.prototype.setColorTexture = function (texture, index) {\n index = defaultValue(index, 0);\nthis._attachmentsDirty = texture !== this._colorTextures[index];\n this._colorTextures[index] = texture;\n};\n\nFramebufferManager.prototype.getColorRenderbuffer = function (index) {\n index = defaultValue(index, 0);\nreturn this._colorRenderbuffers[index];\n};\n\nFramebufferManager.prototype.setColorRenderbuffer = function (\n renderbuffer,\n index\n) {\n index = defaultValue(index, 0);\nthis._attachmentsDirty = renderbuffer !== this._colorRenderbuffers[index];\n this._colorRenderbuffers[index] = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthRenderbuffer = function () {\n return this._depthRenderbuffer;\n};\n\nFramebufferManager.prototype.setDepthRenderbuffer = function (renderbuffer) {\nthis._attachmentsDirty = renderbuffer !== this._depthRenderbuffer;\n this._depthRenderbuffer = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthTexture = function () {\n return this._depthTexture;\n};\n\nFramebufferManager.prototype.setDepthTexture = function (texture) {\nthis._attachmentsDirty = texture !== this._depthTexture;\n this._depthTexture = texture;\n};\n\nFramebufferManager.prototype.getDepthStencilRenderbuffer = function () {\n return this._depthStencilRenderbuffer;\n};\n\nFramebufferManager.prototype.setDepthStencilRenderbuffer = function (\n renderbuffer\n) {\nthis._attachmentsDirty = renderbuffer !== this._depthStencilRenderbuffer;\n this._depthStencilRenderbuffer = renderbuffer;\n};\n\nFramebufferManager.prototype.getDepthStencilTexture = function () {\n return this._depthStencilTexture;\n};\n\nFramebufferManager.prototype.setDepthStencilTexture = function (texture) {\nthis._attachmentsDirty = texture !== this._depthStencilTexture;\n this._depthStencilTexture = texture;\n};\n\nFramebufferManager.prototype.prepareTextures = function (context, blitStencil) {\n if (this._numSamples > 1) {\n this._multisampleFramebuffer.blitFramebuffers(context, blitStencil);\n }\n};\n\nFramebufferManager.prototype.clear = function (\n context,\n clearCommand,\n passState\n) {\n const framebuffer = clearCommand.framebuffer;\n clearCommand.framebuffer = this.framebuffer;\n clearCommand.execute(context, passState);\n clearCommand.framebuffer = framebuffer;\n};\n\nFramebufferManager.prototype.destroyFramebuffer = function () {\n this._framebuffer = this._framebuffer && this._framebuffer.destroy();\n this._multisampleFramebuffer =\n this._multisampleFramebuffer && this._multisampleFramebuffer.destroy();\n};\n\nFramebufferManager.prototype.destroy = function () {\n if (this._color) {\n let i;\n const length = this._colorTextures.length;\n for (i = 0; i < length; ++i) {\n const texture = this._colorTextures[i];\n if (this._createColorAttachments) {\n if (defined(texture) && !texture.isDestroyed()) {\n this._colorTextures[i].destroy();\n this._colorTextures[i] = undefined;\n }\n }\n if (defined(texture) && texture.isDestroyed()) {\n this._colorTextures[i] = undefined;\n }\n const renderbuffer = this._colorRenderbuffers[i];\n if (this._createColorAttachments) {\n if (defined(renderbuffer) && !renderbuffer.isDestroyed()) {\n this._colorRenderbuffers[i].destroy();\n this._colorRenderbuffers[i] = undefined;\n }\n }\n if (defined(renderbuffer) && renderbuffer.isDestroyed()) {\n this._colorRenderbuffers[i] = undefined;\n }\n }\n }\n\n if (this._depthStencil) {\n if (this._createDepthAttachments) {\n this._depthStencilTexture =\n this._depthStencilTexture && this._depthStencilTexture.destroy();\n this._depthStencilRenderbuffer =\n this._depthStencilRenderbuffer &&\n this._depthStencilRenderbuffer.destroy();\n }\n if (\n defined(this._depthStencilTexture) &&\n this._depthStencilTexture.isDestroyed()\n ) {\n this._depthStencilTexture = undefined;\n }\n if (\n defined(this._depthStencilRenderbuffer) &&\n this._depthStencilRenderbuffer.isDestroyed()\n ) {\n this._depthStencilRenderbuffer = undefined;\n }\n }\n\n if (this._depth) {\n if (this._createDepthAttachments) {\n this._depthTexture = this._depthTexture && this._depthTexture.destroy();\n this._depthRenderbuffer =\n this._depthRenderbuffer && this._depthRenderbuffer.destroy();\n }\n if (defined(this._depthTexture) && this._depthTexture.isDestroyed()) {\n this._depthTexture = undefined;\n }\n if (\n defined(this._depthRenderbuffer) &&\n this._depthRenderbuffer.isDestroyed()\n ) {\n this._depthRenderbuffer = undefined;\n }\n }\n\n this.destroyFramebuffer();\n};\nexport default FramebufferManager;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#extension GL_EXT_frag_depth : enable\\n\\\nuniform sampler2D u_pointCloud_colorGBuffer;\\n\\\nuniform sampler2D u_pointCloud_depthGBuffer;\\n\\\nuniform vec2 u_distanceAndEdlStrength;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvec2 neighborContribution(float log2Depth, vec2 offset)\\n\\\n{\\n\\\nfloat dist = u_distanceAndEdlStrength.x;\\n\\\nvec2 texCoordOrig = v_textureCoordinates + offset * dist;\\n\\\nvec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\\n\\\nvec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\\n\\\nfloat depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\\n\\\nfloat depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\\n\\\nif (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\\n\\\nreturn vec2(0.0);\\n\\\n}\\n\\\nfloat depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\\n\\\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\\n\\\neyeCoordinate /= eyeCoordinate.w;\\n\\\nfloat log2Depth = log2(-eyeCoordinate.z);\\n\\\nif (depthOrLogDepth == 0.0)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\\n\\\nvec2 texelSize = 1.0 / czm_viewport.zw;\\n\\\nvec2 responseAndCount = vec2(0.0);\\n\\\nresponseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\\n\\\nresponseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\\n\\\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\\n\\\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\\n\\\nfloat response = responseAndCount.x / responseAndCount.y;\\n\\\nfloat strength = u_distanceAndEdlStrength.y;\\n\\\nfloat shade = exp(-response * 300.0 * strength);\\n\\\ncolor.rgb *= shade;\\n\\\ngl_FragColor = vec4(color);\\n\\\ngl_FragDepthEXT = depthOrLogDepth;\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BlendingState from \"../Scene/BlendingState.js\";\nimport StencilConstants from \"../Scene/StencilConstants.js\";\nimport PointCloudEyeDomeLightingShader from \"../Shaders/PostProcessStages/PointCloudEyeDomeLighting.js\";\n\n/**\n * Eye dome lighting. Does not support points with per-point translucency, but does allow translucent styling against the globe.\n * Requires support for EXT_frag_depth and WEBGL_draw_buffers extensions in WebGL 1.0.\n *\n * @private\n */\nfunction PointCloudEyeDomeLighting() {\n this._framebuffer = new FramebufferManager({\n colorAttachmentsLength: 2,\n depth: true,\n supportsDepthTexture: true,\n });\n\n this._drawCommand = undefined;\n this._clearCommand = undefined;\n\n this._strength = 1.0;\n this._radius = 1.0;\n}\n\nObject.defineProperties(PointCloudEyeDomeLighting.prototype, {\n framebuffer: {\n get: function () {\n return this._framebuffer.framebuffer;\n },\n },\n colorGBuffer: {\n get: function () {\n return this._framebuffer.getColorTexture(0);\n },\n },\n depthGBuffer: {\n get: function () {\n return this._framebuffer.getColorTexture(1);\n },\n },\n});\n\nfunction destroyFramebuffer(processor) {\n processor._framebuffer.destroy();\n processor._drawCommand = undefined;\n processor._clearCommand = undefined;\n}\n\nconst distanceAndEdlStrengthScratch = new Cartesian2();\n\nfunction createCommands(processor, context) {\n const blendFS = new ShaderSource({\n defines: [\"LOG_DEPTH_WRITE\"],\n sources: [PointCloudEyeDomeLightingShader],\n });\n\n const blendUniformMap = {\n u_pointCloud_colorGBuffer: function () {\n return processor.colorGBuffer;\n },\n u_pointCloud_depthGBuffer: function () {\n return processor.depthGBuffer;\n },\n u_distanceAndEdlStrength: function () {\n distanceAndEdlStrengthScratch.x = processor._radius;\n distanceAndEdlStrengthScratch.y = processor._strength;\n return distanceAndEdlStrengthScratch;\n },\n };\n\n const blendRenderState = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n depthMask: true,\n depthTest: {\n enabled: true,\n },\n stencilTest: StencilConstants.setCesium3DTileBit(),\n stencilMask: StencilConstants.CESIUM_3D_TILE_MASK,\n });\n\n processor._drawCommand = context.createViewportQuadCommand(blendFS, {\n uniformMap: blendUniformMap,\n renderState: blendRenderState,\n pass: Pass.CESIUM_3D_TILE,\n owner: processor,\n });\n\n processor._clearCommand = new ClearCommand({\n framebuffer: processor.framebuffer,\n color: new Color(0.0, 0.0, 0.0, 0.0),\n depth: 1.0,\n renderState: RenderState.fromCache(),\n pass: Pass.CESIUM_3D_TILE,\n owner: processor,\n });\n}\n\nfunction createResources(processor, context) {\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n processor._framebuffer.update(context, width, height);\n createCommands(processor, context);\n}\n\nfunction isSupported(context) {\n return context.drawBuffers && context.fragmentDepth;\n}\n\nPointCloudEyeDomeLighting.isSupported = isSupported;\n\nfunction getECShaderProgram(context, shaderProgram) {\n let shader = context.shaderCache.getDerivedShaderProgram(shaderProgram, \"EC\");\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n\n const fs = shaderProgram.fragmentShaderSource.clone();\n\n fs.sources = fs.sources.map(function (source) {\n source = ShaderSource.replaceMain(\n source,\n \"czm_point_cloud_post_process_main\"\n );\n source = source.replace(/gl_FragColor/g, \"gl_FragData[0]\");\n return source;\n });\n\n fs.sources.unshift(\"#extension GL_EXT_draw_buffers : enable \\n\");\n fs.sources.push(\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_point_cloud_post_process_main(); \\n\" +\n \"#ifdef LOG_DEPTH\\n\" +\n \" czm_writeLogDepth();\\n\" +\n \" gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \\n\" +\n \"#else\\n\" +\n \" gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\\n\" +\n \"#endif\\n\" +\n \"}\"\n );\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"EC\",\n {\n vertexShaderSource: shaderProgram.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nPointCloudEyeDomeLighting.prototype.update = function (\n frameState,\n commandStart,\n pointCloudShading,\n boundingVolume\n) {\n if (!isSupported(frameState.context)) {\n return;\n }\n\n this._strength = pointCloudShading.eyeDomeLightingStrength;\n this._radius =\n pointCloudShading.eyeDomeLightingRadius * frameState.pixelRatio;\n\n createResources(this, frameState.context);\n\n // Hijack existing point commands to render into an offscreen FBO.\n let i;\n const commandList = frameState.commandList;\n const commandEnd = commandList.length;\n\n for (i = commandStart; i < commandEnd; ++i) {\n const command = commandList[i];\n if (\n command.primitiveType !== PrimitiveType.POINTS ||\n command.pass === Pass.TRANSLUCENT\n ) {\n continue;\n }\n\n let derivedCommand;\n let originalShaderProgram;\n\n let derivedCommandObject = command.derivedCommands.pointCloudProcessor;\n if (defined(derivedCommandObject)) {\n derivedCommand = derivedCommandObject.command;\n originalShaderProgram = derivedCommandObject.originalShaderProgram;\n }\n\n if (\n !defined(derivedCommand) ||\n command.dirty ||\n originalShaderProgram !== command.shaderProgram ||\n derivedCommand.framebuffer !== this.framebuffer\n ) {\n // Prevent crash when tiles out-of-view come in-view during context size change or\n // when the underlying shader changes while EDL is disabled\n derivedCommand = DrawCommand.shallowClone(command, derivedCommand);\n derivedCommand.framebuffer = this.framebuffer;\n derivedCommand.shaderProgram = getECShaderProgram(\n frameState.context,\n command.shaderProgram\n );\n derivedCommand.castShadows = false;\n derivedCommand.receiveShadows = false;\n\n if (!defined(derivedCommandObject)) {\n derivedCommandObject = {\n command: derivedCommand,\n originalShaderProgram: command.shaderProgram,\n };\n command.derivedCommands.pointCloudProcessor = derivedCommandObject;\n }\n\n derivedCommandObject.originalShaderProgram = command.shaderProgram;\n }\n\n commandList[i] = derivedCommand;\n }\n\n const clearCommand = this._clearCommand;\n const blendCommand = this._drawCommand;\n\n blendCommand.boundingVolume = boundingVolume;\n\n // Blend EDL into the main FBO\n commandList.push(blendCommand);\n commandList.push(clearCommand);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PointCloudEyeDomeLighting#destroy\n */\nPointCloudEyeDomeLighting.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * processor = processor && processor.destroy();\n *\n * @see PointCloudEyeDomeLighting#isDestroyed\n */\nPointCloudEyeDomeLighting.prototype.destroy = function () {\n destroyFramebuffer(this);\n return destroyObject(this);\n};\nexport default PointCloudEyeDomeLighting;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\n\n/**\n * Options for performing point attenuation based on geometric error when rendering\n * point clouds using 3D Tiles.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.attenuation=false] Perform point attenuation based on geometric error.\n * @param {Number} [options.geometricErrorScale=1.0] Scale to be applied to each tile's geometric error.\n * @param {Number} [options.maximumAttenuation] Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.\n * @param {Number} [options.baseResolution] Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.\n * @param {Boolean} [options.eyeDomeLighting=true] When true, use eye dome lighting when drawing with point attenuation.\n * @param {Number} [options.eyeDomeLightingStrength=1.0] Increasing this value increases contrast on slopes and edges.\n * @param {Number} [options.eyeDomeLightingRadius=1.0] Increase the thickness of contours from eye dome lighting.\n * @param {Boolean} [options.backFaceCulling=false] Determines whether back-facing points are hidden. This option works only if data has normals included.\n * @param {Boolean} [options.normalShading=true] Determines whether a point cloud that contains normals is shaded by the scene's light source.\n *\n * @alias PointCloudShading\n * @constructor\n */\nfunction PointCloudShading(options) {\n const pointCloudShading = defaultValue(options, {});\n\n /**\n * Perform point attenuation based on geometric error.\n * @type {Boolean}\n * @default false\n */\n this.attenuation = defaultValue(pointCloudShading.attenuation, false);\n\n /**\n * Scale to be applied to the geometric error before computing attenuation.\n * @type {Number}\n * @default 1.0\n */\n this.geometricErrorScale = defaultValue(\n pointCloudShading.geometricErrorScale,\n 1.0\n );\n\n /**\n * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.\n * @type {Number}\n */\n this.maximumAttenuation = pointCloudShading.maximumAttenuation;\n\n /**\n * Average base resolution for the dataset in meters.\n * Used in place of geometric error when geometric error is 0.\n * If undefined, an approximation will be computed for each tile that has geometric error of 0.\n * @type {Number}\n */\n this.baseResolution = pointCloudShading.baseResolution;\n\n /**\n * Use eye dome lighting when drawing with point attenuation\n * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,\n * otherwise eye dome lighting is ignored.\n *\n * @type {Boolean}\n * @default true\n */\n this.eyeDomeLighting = defaultValue(pointCloudShading.eyeDomeLighting, true);\n\n /**\n * Eye dome lighting strength (apparent contrast)\n * @type {Number}\n * @default 1.0\n */\n this.eyeDomeLightingStrength = defaultValue(\n pointCloudShading.eyeDomeLightingStrength,\n 1.0\n );\n\n /**\n * Thickness of contours from eye dome lighting\n * @type {Number}\n * @default 1.0\n */\n this.eyeDomeLightingRadius = defaultValue(\n pointCloudShading.eyeDomeLightingRadius,\n 1.0\n );\n\n /**\n * Determines whether back-facing points are hidden.\n * This option works only if data has normals included.\n *\n * @type {Boolean}\n * @default false\n */\n this.backFaceCulling = defaultValue(pointCloudShading.backFaceCulling, false);\n\n /**\n * Determines whether a point cloud that contains normals is shaded by the scene's light source.\n *\n * @type {Boolean}\n * @default true\n */\n this.normalShading = defaultValue(pointCloudShading.normalShading, true);\n}\n\n/**\n * Determines if point cloud shading is supported.\n *\n * @param {Scene} scene The scene.\n * @returns {Boolean} <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>\n */\nPointCloudShading.isSupported = function (scene) {\n return PointCloudEyeDomeLighting.isSupported(scene.context);\n};\nexport default PointCloudShading;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Functions that do scene-dependent transforms between rendering-related coordinate systems.\n *\n * @namespace SceneTransforms\n */\nconst SceneTransforms = {};\n\nconst actualPositionScratch = new Cartesian4(0, 0, 0, 1);\nlet positionCC = new Cartesian4();\nconst scratchViewport = new BoundingRectangle();\n\nconst scratchWindowCoord0 = new Cartesian2();\nconst scratchWindowCoord1 = new Cartesian2();\n\n/**\n * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an\n * HTML element at the same screen position as an object in the scene.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nSceneTransforms.wgs84ToWindowCoordinates = function (scene, position, result) {\n return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(\n scene,\n position,\n Cartesian3.ZERO,\n result\n );\n};\n\nconst scratchCartesian4 = new Cartesian4();\nconst scratchEyeOffset = new Cartesian3();\n\nfunction worldToClip(position, eyeOffset, camera, result) {\n const viewMatrix = camera.viewMatrix;\n\n const positionEC = Matrix4.multiplyByVector(\n viewMatrix,\n Cartesian4.fromElements(\n position.x,\n position.y,\n position.z,\n 1,\n scratchCartesian4\n ),\n scratchCartesian4\n );\n\n const zEyeOffset = Cartesian3.multiplyComponents(\n eyeOffset,\n Cartesian3.normalize(positionEC, scratchEyeOffset),\n scratchEyeOffset\n );\n positionEC.x += eyeOffset.x + zEyeOffset.x;\n positionEC.y += eyeOffset.y + zEyeOffset.y;\n positionEC.z += zEyeOffset.z;\n\n return Matrix4.multiplyByVector(\n camera.frustum.projectionMatrix,\n positionEC,\n result\n );\n}\n\nconst scratchMaxCartographic = new Cartographic(\n Math.PI,\n CesiumMath.PI_OVER_TWO\n);\nconst scratchProjectedCartesian = new Cartesian3();\nconst scratchCameraPosition = new Cartesian3();\n\n/**\n * @private\n */\nSceneTransforms.wgs84WithEyeOffsetToWindowCoordinates = function (\n scene,\n position,\n eyeOffset,\n result\n) {\n // Transform for 3D, 2D, or Columbus view\n const frameState = scene.frameState;\n const actualPosition = SceneTransforms.computeActualWgs84Position(\n frameState,\n position,\n actualPositionScratch\n );\n\n if (!defined(actualPosition)) {\n return undefined;\n }\n\n // Assuming viewport takes up the entire canvas...\n const canvas = scene.canvas;\n const viewport = scratchViewport;\n viewport.x = 0;\n viewport.y = 0;\n viewport.width = canvas.clientWidth;\n viewport.height = canvas.clientHeight;\n\n const camera = scene.camera;\n let cameraCentered = false;\n\n if (frameState.mode === SceneMode.SCENE2D) {\n const projection = scene.mapProjection;\n const maxCartographic = scratchMaxCartographic;\n const maxCoord = projection.project(\n maxCartographic,\n scratchProjectedCartesian\n );\n\n const cameraPosition = Cartesian3.clone(\n camera.position,\n scratchCameraPosition\n );\n const frustum = camera.frustum.clone();\n\n const viewportTransformation = Matrix4.computeViewportTransformation(\n viewport,\n 0.0,\n 1.0,\n new Matrix4()\n );\n const projectionMatrix = camera.frustum.projectionMatrix;\n\n const x = camera.positionWC.y;\n const eyePoint = Cartesian3.fromElements(\n CesiumMath.sign(x) * maxCoord.x - x,\n 0.0,\n -camera.positionWC.x\n );\n const windowCoordinates = Transforms.pointToGLWindowCoordinates(\n projectionMatrix,\n viewportTransformation,\n eyePoint\n );\n\n if (\n x === 0.0 ||\n windowCoordinates.x <= 0.0 ||\n windowCoordinates.x >= canvas.clientWidth\n ) {\n cameraCentered = true;\n } else {\n if (windowCoordinates.x > canvas.clientWidth * 0.5) {\n viewport.width = windowCoordinates.x;\n\n camera.frustum.right = maxCoord.x - x;\n\n positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n SceneTransforms.clipToGLWindowCoordinates(\n viewport,\n positionCC,\n scratchWindowCoord0\n );\n\n viewport.x += windowCoordinates.x;\n\n camera.position.x = -camera.position.x;\n\n const right = camera.frustum.right;\n camera.frustum.right = -camera.frustum.left;\n camera.frustum.left = -right;\n\n positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n SceneTransforms.clipToGLWindowCoordinates(\n viewport,\n positionCC,\n scratchWindowCoord1\n );\n } else {\n viewport.x += windowCoordinates.x;\n viewport.width -= windowCoordinates.x;\n\n camera.frustum.left = -maxCoord.x - x;\n\n positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n SceneTransforms.clipToGLWindowCoordinates(\n viewport,\n positionCC,\n scratchWindowCoord0\n );\n\n viewport.x = viewport.x - viewport.width;\n\n camera.position.x = -camera.position.x;\n\n const left = camera.frustum.left;\n camera.frustum.left = -camera.frustum.right;\n camera.frustum.right = -left;\n\n positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n SceneTransforms.clipToGLWindowCoordinates(\n viewport,\n positionCC,\n scratchWindowCoord1\n );\n }\n\n Cartesian3.clone(cameraPosition, camera.position);\n camera.frustum = frustum.clone();\n\n result = Cartesian2.clone(scratchWindowCoord0, result);\n if (result.x < 0.0 || result.x > canvas.clientWidth) {\n result.x = scratchWindowCoord1.x;\n }\n }\n }\n\n if (frameState.mode !== SceneMode.SCENE2D || cameraCentered) {\n // View-projection matrix to transform from world coordinates to clip coordinates\n positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);\n if (\n positionCC.z < 0 &&\n !(camera.frustum instanceof OrthographicFrustum) &&\n !(camera.frustum instanceof OrthographicOffCenterFrustum)\n ) {\n return undefined;\n }\n\n result = SceneTransforms.clipToGLWindowCoordinates(\n viewport,\n positionCC,\n result\n );\n }\n\n result.y = canvas.clientHeight - result.y;\n return result;\n};\n\n/**\n * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different\n * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nSceneTransforms.wgs84ToDrawingBufferCoordinates = function (\n scene,\n position,\n result\n) {\n result = SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n if (!defined(result)) {\n return undefined;\n }\n\n return SceneTransforms.transformWindowToDrawingBuffer(scene, result, result);\n};\n\nconst projectedPosition = new Cartesian3();\nconst positionInCartographic = new Cartographic();\n\n/**\n * @private\n */\nSceneTransforms.computeActualWgs84Position = function (\n frameState,\n position,\n result\n) {\n const mode = frameState.mode;\n\n if (mode === SceneMode.SCENE3D) {\n return Cartesian3.clone(position, result);\n }\n\n const projection = frameState.mapProjection;\n const cartographic = projection.ellipsoid.cartesianToCartographic(\n position,\n positionInCartographic\n );\n if (!defined(cartographic)) {\n return undefined;\n }\n\n projection.project(cartographic, projectedPosition);\n\n if (mode === SceneMode.COLUMBUS_VIEW) {\n return Cartesian3.fromElements(\n projectedPosition.z,\n projectedPosition.x,\n projectedPosition.y,\n result\n );\n }\n\n if (mode === SceneMode.SCENE2D) {\n return Cartesian3.fromElements(\n 0.0,\n projectedPosition.x,\n projectedPosition.y,\n result\n );\n }\n\n // mode === SceneMode.MORPHING\n const morphTime = frameState.morphTime;\n return Cartesian3.fromElements(\n CesiumMath.lerp(projectedPosition.z, position.x, morphTime),\n CesiumMath.lerp(projectedPosition.x, position.y, morphTime),\n CesiumMath.lerp(projectedPosition.y, position.z, morphTime),\n result\n );\n};\n\nconst positionNDC = new Cartesian3();\nconst positionWC = new Cartesian3();\nconst viewportTransform = new Matrix4();\n\n/**\n * @private\n */\nSceneTransforms.clipToGLWindowCoordinates = function (\n viewport,\n position,\n result\n) {\n // Perspective divide to transform from clip coordinates to normalized device coordinates\n Cartesian3.divideByScalar(position, position.w, positionNDC);\n\n // Viewport transform to transform from clip coordinates to window coordinates\n Matrix4.computeViewportTransformation(viewport, 0.0, 1.0, viewportTransform);\n Matrix4.multiplyByPoint(viewportTransform, positionNDC, positionWC);\n\n return Cartesian2.fromCartesian3(positionWC, result);\n};\n\n/**\n * @private\n */\nSceneTransforms.transformWindowToDrawingBuffer = function (\n scene,\n windowPosition,\n result\n) {\n const canvas = scene.canvas;\n const xScale = scene.drawingBufferWidth / canvas.clientWidth;\n const yScale = scene.drawingBufferHeight / canvas.clientHeight;\n return Cartesian2.fromElements(\n windowPosition.x * xScale,\n windowPosition.y * yScale,\n result\n );\n};\n\nconst scratchNDC = new Cartesian4();\nconst scratchWorldCoords = new Cartesian4();\n\n/**\n * @private\n */\nSceneTransforms.drawingBufferToWgs84Coordinates = function (\n scene,\n drawingBufferPosition,\n depth,\n result\n) {\n const context = scene.context;\n const uniformState = context.uniformState;\n\n const currentFrustum = uniformState.currentFrustum;\n const near = currentFrustum.x;\n const far = currentFrustum.y;\n\n if (scene.frameState.useLogDepth) {\n // transforming logarithmic depth of form\n // log2(z + 1) / log2( far + 1);\n // to perspective form\n // (far - far * near / z) / (far - near)\n const log2Depth = depth * uniformState.log2FarDepthFromNearPlusOne;\n const depthFromNear = Math.pow(2.0, log2Depth) - 1.0;\n depth = (far * (1.0 - near / (depthFromNear + near))) / (far - near);\n }\n\n const viewport = scene.view.passState.viewport;\n const ndc = Cartesian4.clone(Cartesian4.UNIT_W, scratchNDC);\n ndc.x = ((drawingBufferPosition.x - viewport.x) / viewport.width) * 2.0 - 1.0;\n ndc.y =\n ((drawingBufferPosition.y - viewport.y) / viewport.height) * 2.0 - 1.0;\n ndc.z = depth * 2.0 - 1.0;\n ndc.w = 1.0;\n\n let worldCoords;\n let frustum = scene.camera.frustum;\n if (!defined(frustum.fovy)) {\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n worldCoords = scratchWorldCoords;\n worldCoords.x =\n (ndc.x * (frustum.right - frustum.left) + frustum.left + frustum.right) *\n 0.5;\n worldCoords.y =\n (ndc.y * (frustum.top - frustum.bottom) + frustum.bottom + frustum.top) *\n 0.5;\n worldCoords.z = (ndc.z * (near - far) - near - far) * 0.5;\n worldCoords.w = 1.0;\n\n worldCoords = Matrix4.multiplyByVector(\n uniformState.inverseView,\n worldCoords,\n worldCoords\n );\n } else {\n worldCoords = Matrix4.multiplyByVector(\n uniformState.inverseViewProjection,\n ndc,\n scratchWorldCoords\n );\n\n // Reverse perspective divide\n const w = 1.0 / worldCoords.w;\n Cartesian3.multiplyByScalar(worldCoords, w, worldCoords);\n }\n return Cartesian3.fromCartesian4(worldCoords, result);\n};\nexport default SceneTransforms;\n", "/**\n * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}.\n *\n * @enum {Number}\n *\n * @see ImageryLayer#splitDirection\n * @see Cesium3DTileset#splitDirection\n */\nconst SplitDirection = {\n /**\n * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}.\n *\n * @type {Number}\n * @constant\n */\n LEFT: -1.0,\n\n /**\n * Always display the primitive or ImageryLayer.\n *\n * @type {Number}\n * @constant\n */\n NONE: 0.0,\n\n /**\n * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}.\n *\n * @type {Number}\n * @constant\n */\n RIGHT: 1.0,\n};\nexport default Object.freeze(SplitDirection);\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Handles parsing of a Batched 3D Model.\n *\n * @namespace B3dmParser\n * @private\n */\nconst B3dmParser = {};\nB3dmParser._deprecationWarning = deprecationWarning;\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel|Batched 3D Model}.\n *\n * @private\n *\n * @param {ArrayBuffer} arrayBuffer The array buffer containing the b3dm.\n * @param {Number} [byteOffset=0] The byte offset of the beginning of the b3dm in the array buffer.\n * @returns {Object} Returns an object with the batch length, feature table (binary and json), batch table (binary and json) and glTF parts of the b3dm.\n */\nB3dmParser.parse = function (arrayBuffer, byteOffset) {\n const byteStart = defaultValue(byteOffset, 0);\n byteOffset = byteStart;\n\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Batched 3D Model version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n const byteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n let featureTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n let featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n let batchTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n let batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n let batchLength;\n\n // Legacy header #1: [batchLength] [batchTableByteLength]\n // Legacy header #2: [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]\n // Current header: [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength]\n // If the header is in the first legacy format 'batchTableJsonByteLength' will be the start of the JSON string (a quotation mark) or the glTF magic.\n // Accordingly its first byte will be either 0x22 or 0x67, and so the minimum uint32 expected is 0x22000000 = 570425344 = 570MB. It is unlikely that the feature table JSON will exceed this length.\n // The check for the second legacy format is similar, except it checks 'batchTableBinaryByteLength' instead\n if (batchTableJsonByteLength >= 570425344) {\n // First legacy check\n byteOffset -= sizeOfUint32 * 2;\n batchLength = featureTableJsonByteLength;\n batchTableJsonByteLength = featureTableBinaryByteLength;\n batchTableBinaryByteLength = 0;\n featureTableJsonByteLength = 0;\n featureTableBinaryByteLength = 0;\n B3dmParser._deprecationWarning(\n \"b3dm-legacy-header\",\n \"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.\"\n );\n } else if (batchTableBinaryByteLength >= 570425344) {\n // Second legacy check\n byteOffset -= sizeOfUint32;\n batchLength = batchTableJsonByteLength;\n batchTableJsonByteLength = featureTableJsonByteLength;\n batchTableBinaryByteLength = featureTableBinaryByteLength;\n featureTableJsonByteLength = 0;\n featureTableBinaryByteLength = 0;\n B3dmParser._deprecationWarning(\n \"b3dm-legacy-header\",\n \"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.\"\n );\n }\n\n let featureTableJson;\n if (featureTableJsonByteLength === 0) {\n featureTableJson = {\n BATCH_LENGTH: defaultValue(batchLength, 0),\n };\n } else {\n featureTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n featureTableJsonByteLength\n );\n byteOffset += featureTableJsonByteLength;\n }\n\n const featureTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n featureTableBinaryByteLength\n );\n byteOffset += featureTableBinaryByteLength;\n\n let batchTableJson;\n let batchTableBinary;\n if (batchTableJsonByteLength > 0) {\n // PERFORMANCE_IDEA: is it possible to allocate this on-demand? Perhaps keep the\n // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n //\n // We could also make another request for it, but that would make the property set/get\n // API async, and would double the number of numbers in some cases.\n batchTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n batchTableJsonByteLength\n );\n byteOffset += batchTableJsonByteLength;\n\n if (batchTableBinaryByteLength > 0) {\n // Has a batch table binary\n batchTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n batchTableBinaryByteLength\n );\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n byteOffset += batchTableBinaryByteLength;\n }\n }\n\n const gltfByteLength = byteStart + byteLength - byteOffset;\n if (gltfByteLength === 0) {\n throw new RuntimeError(\"glTF byte length must be greater than 0.\");\n }\n\n let gltfView;\n if (byteOffset % 4 === 0) {\n gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);\n } else {\n // Create a copy of the glb so that it is 4-byte aligned\n B3dmParser._deprecationWarning(\n \"b3dm-glb-unaligned\",\n \"The embedded glb is not aligned to a 4-byte boundary.\"\n );\n gltfView = new Uint8Array(\n uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)\n );\n }\n\n return {\n batchLength: batchLength,\n featureTableJson: featureTableJson,\n featureTableBinary: featureTableBinary,\n batchTableJson: batchTableJson,\n batchTableBinary: batchTableBinary,\n gltf: gltfView,\n };\n};\n\nexport default B3dmParser;\n", "import ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTileFeatureTable(featureTableJson, featureTableBinary) {\n this.json = featureTableJson;\n this.buffer = featureTableBinary;\n this._cachedTypedArrays = {};\n this.featuresLength = 0;\n}\n\nfunction getTypedArrayFromBinary(\n featureTable,\n semantic,\n componentType,\n componentLength,\n count,\n byteOffset\n) {\n const cachedTypedArrays = featureTable._cachedTypedArrays;\n let typedArray = cachedTypedArrays[semantic];\n if (!defined(typedArray)) {\n typedArray = ComponentDatatype.createArrayBufferView(\n componentType,\n featureTable.buffer.buffer,\n featureTable.buffer.byteOffset + byteOffset,\n count * componentLength\n );\n cachedTypedArrays[semantic] = typedArray;\n }\n return typedArray;\n}\n\nfunction getTypedArrayFromArray(featureTable, semantic, componentType, array) {\n const cachedTypedArrays = featureTable._cachedTypedArrays;\n let typedArray = cachedTypedArrays[semantic];\n if (!defined(typedArray)) {\n typedArray = ComponentDatatype.createTypedArray(componentType, array);\n cachedTypedArrays[semantic] = typedArray;\n }\n return typedArray;\n}\n\nCesium3DTileFeatureTable.prototype.getGlobalProperty = function (\n semantic,\n componentType,\n componentLength\n) {\n const jsonValue = this.json[semantic];\n if (!defined(jsonValue)) {\n return undefined;\n }\n\n if (defined(jsonValue.byteOffset)) {\n componentType = defaultValue(componentType, ComponentDatatype.UNSIGNED_INT);\n componentLength = defaultValue(componentLength, 1);\n return getTypedArrayFromBinary(\n this,\n semantic,\n componentType,\n componentLength,\n 1,\n jsonValue.byteOffset\n );\n }\n\n return jsonValue;\n};\n\nCesium3DTileFeatureTable.prototype.hasProperty = function (semantic) {\n return defined(this.json[semantic]);\n};\n\nCesium3DTileFeatureTable.prototype.getPropertyArray = function (\n semantic,\n componentType,\n componentLength\n) {\n const jsonValue = this.json[semantic];\n if (!defined(jsonValue)) {\n return undefined;\n }\n\n if (defined(jsonValue.byteOffset)) {\n if (defined(jsonValue.componentType)) {\n componentType = ComponentDatatype.fromName(jsonValue.componentType);\n }\n return getTypedArrayFromBinary(\n this,\n semantic,\n componentType,\n componentLength,\n this.featuresLength,\n jsonValue.byteOffset\n );\n }\n\n return getTypedArrayFromArray(this, semantic, componentType, jsonValue);\n};\n\nCesium3DTileFeatureTable.prototype.getProperty = function (\n semantic,\n componentType,\n componentLength,\n featureId,\n result\n) {\n const jsonValue = this.json[semantic];\n if (!defined(jsonValue)) {\n return undefined;\n }\n\n const typedArray = this.getPropertyArray(\n semantic,\n componentType,\n componentLength\n );\n\n if (componentLength === 1) {\n return typedArray[featureId];\n }\n\n for (let i = 0; i < componentLength; ++i) {\n result[i] = typedArray[componentLength * featureId + i];\n }\n\n return result;\n};\nexport default Cesium3DTileFeatureTable;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport BatchTableHierarchy from \"./BatchTableHierarchy.js\";\nimport StructuralMetadata from \"./StructuralMetadata.js\";\nimport PropertyAttribute from \"./PropertyAttribute.js\";\nimport PropertyTable from \"./PropertyTable.js\";\nimport getBinaryAccessor from \"./getBinaryAccessor.js\";\nimport JsonMetadataTable from \"./JsonMetadataTable.js\";\nimport MetadataClass from \"./MetadataClass.js\";\nimport MetadataSchema from \"./MetadataSchema.js\";\nimport MetadataTable from \"./MetadataTable.js\";\nimport ModelComponents from \"./ModelComponents.js\";\nimport ModelUtility from \"./Model/ModelUtility.js\";\n\n/**\n * An object that parses the the 3D Tiles 1.0 batch table and transcodes it to\n * be compatible with structural metadata from the <code>EXT_structural_metadata</code> glTF extension\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} for glTF.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.count The number of features in the batch table.\n * @param {Object} options.batchTable The batch table JSON\n * @param {Uint8Array} [options.binaryBody] The batch table binary body\n * @param {Boolean} [options.parseAsPropertyAttributes=false] If true, binary properties are parsed as property attributes instead of a property table. This is used for .pnts models for GPU styling.\n * @param {ModelComponents.Attribute[]} [options.customAttributeOutput] Pass in an empty array here and this method will populate it with a list of custom attributes that will store the values of the property attributes. The attributes will be created with typed arrays, the caller is responsible for uploading them to the GPU. This option is required when options.parseAsPropertyAttributes is true.\n * @return {StructuralMetadata} A transcoded structural metadata object\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction parseBatchTable(options) {\n const featureCount = options.count;\n const batchTable = options.batchTable;\n const binaryBody = options.binaryBody;\n const parseAsPropertyAttributes = defaultValue(\n options.parseAsPropertyAttributes,\n false\n );\n const customAttributeOutput = options.customAttributeOutput;\n\n // divide properties into binary, json and hierarchy\n const partitionResults = partitionProperties(batchTable);\n\n let jsonMetadataTable;\n if (defined(partitionResults.jsonProperties)) {\n jsonMetadataTable = new JsonMetadataTable({\n count: featureCount,\n properties: partitionResults.jsonProperties,\n });\n }\n\n let hierarchy;\n if (defined(partitionResults.hierarchy)) {\n hierarchy = new BatchTableHierarchy({\n extension: partitionResults.hierarchy,\n binaryBody: binaryBody,\n });\n }\n\n const className = MetadataClass.BATCH_TABLE_CLASS_NAME;\n const binaryProperties = partitionResults.binaryProperties;\n\n let metadataTable;\n let propertyAttributes;\n let transcodedSchema;\n if (parseAsPropertyAttributes) {\n const attributeResults = transcodeBinaryPropertiesAsPropertyAttributes(\n featureCount,\n className,\n binaryProperties,\n binaryBody,\n customAttributeOutput\n );\n transcodedSchema = attributeResults.transcodedSchema;\n const propertyAttribute = new PropertyAttribute({\n propertyAttribute: attributeResults.propertyAttributeJson,\n class: attributeResults.transcodedClass,\n });\n\n propertyAttributes = [propertyAttribute];\n } else {\n const binaryResults = transcodeBinaryProperties(\n featureCount,\n className,\n binaryProperties,\n binaryBody\n );\n transcodedSchema = binaryResults.transcodedSchema;\n const featureTableJson = binaryResults.featureTableJson;\n metadataTable = new MetadataTable({\n count: featureTableJson.count,\n properties: featureTableJson.properties,\n class: binaryResults.transcodedClass,\n bufferViews: binaryResults.bufferViewsTypedArrays,\n });\n propertyAttributes = [];\n }\n\n const propertyTables = [];\n if (\n defined(metadataTable) ||\n defined(jsonMetadataTable) ||\n defined(hierarchy)\n ) {\n const propertyTable = new PropertyTable({\n id: 0,\n name: \"Batch Table\",\n count: featureCount,\n metadataTable: metadataTable,\n jsonMetadataTable: jsonMetadataTable,\n batchTableHierarchy: hierarchy,\n });\n propertyTables.push(propertyTable);\n }\n\n const metadataOptions = {\n schema: transcodedSchema,\n propertyTables: propertyTables,\n propertyAttributes: propertyAttributes,\n extensions: partitionResults.extensions,\n extras: partitionResults.extras,\n };\n\n return new StructuralMetadata(metadataOptions);\n}\n\n/**\n * Divide the batch table's properties into binary, JSON and hierarchy\n * extension as each is handled separately\n *\n * @param {Object} batchTable The batch table JSON\n * @returns {Object} The batch table divided into binary, JSON and hierarchy portions. Extras and extensions are also divided out for ease of processing.\n *\n * @private\n */\nfunction partitionProperties(batchTable) {\n const legacyHierarchy = batchTable.HIERARCHY;\n const extras = batchTable.extras;\n const extensions = batchTable.extensions;\n\n let hierarchyExtension;\n if (defined(legacyHierarchy)) {\n parseBatchTable._deprecationWarning(\n \"batchTableHierarchyExtension\",\n \"The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead.\"\n );\n hierarchyExtension = legacyHierarchy;\n } else if (defined(extensions)) {\n hierarchyExtension = extensions[\"3DTILES_batch_table_hierarchy\"];\n }\n\n // A JsonMetadataTable is only allocated as needed.\n let jsonProperties;\n // A MetadataTable or PropertyAttribute will always be created, even if\n // there are no properties.\n const binaryProperties = {};\n for (const propertyId in batchTable) {\n if (\n !batchTable.hasOwnProperty(propertyId) ||\n // these cases were handled above;\n propertyId === \"HIERARCHY\" ||\n propertyId === \"extensions\" ||\n propertyId === \"extras\"\n ) {\n continue;\n }\n\n const property = batchTable[propertyId];\n if (Array.isArray(property)) {\n jsonProperties = defined(jsonProperties) ? jsonProperties : {};\n jsonProperties[propertyId] = property;\n } else {\n binaryProperties[propertyId] = property;\n }\n }\n\n return {\n binaryProperties: binaryProperties,\n jsonProperties: jsonProperties,\n hierarchy: hierarchyExtension,\n extras: extras,\n extensions: extensions,\n };\n}\n\n/**\n * Transcode the binary properties of the batch table to be compatible with\n * <code>EXT_structural_metadata</code>\n *\n * @param {Number} featureCount The number of features in the batch table\n * @param {String} className The name of the metadata class to be created.\n * @param {Object.<String, Object>} binaryProperties A dictionary of property ID to property definition\n * @param {Uint8Array} [binaryBody] The binary body of the batch table\n * @return {Object} Transcoded data needed for constructing a {@link StructuralMetadata} object.\n *\n * @private\n */\nfunction transcodeBinaryProperties(\n featureCount,\n className,\n binaryProperties,\n binaryBody\n) {\n const classProperties = {};\n const featureTableProperties = {};\n const bufferViewsTypedArrays = {};\n let bufferViewCount = 0;\n for (const propertyId in binaryProperties) {\n if (!binaryProperties.hasOwnProperty(propertyId)) {\n continue;\n }\n\n if (!defined(binaryBody)) {\n throw new RuntimeError(\n `Property ${propertyId} requires a batch table binary.`\n );\n }\n\n const property = binaryProperties[propertyId];\n const binaryAccessor = getBinaryAccessor(property);\n\n featureTableProperties[propertyId] = {\n bufferView: bufferViewCount,\n };\n\n classProperties[propertyId] = transcodePropertyType(property);\n\n bufferViewsTypedArrays[\n bufferViewCount\n ] = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + property.byteOffset,\n featureCount\n );\n\n bufferViewCount++;\n }\n\n const schemaJson = {\n classes: {},\n };\n schemaJson.classes[className] = {\n properties: classProperties,\n };\n\n const transcodedSchema = new MetadataSchema(schemaJson);\n\n const featureTableJson = {\n class: className,\n count: featureCount,\n properties: featureTableProperties,\n };\n\n return {\n featureTableJson: featureTableJson,\n bufferViewsTypedArrays: bufferViewsTypedArrays,\n transcodedSchema: transcodedSchema,\n transcodedClass: transcodedSchema.classes[className],\n };\n}\n\nfunction transcodeBinaryPropertiesAsPropertyAttributes(\n featureCount,\n className,\n binaryProperties,\n binaryBody,\n customAttributeOutput\n) {\n const classProperties = {};\n const propertyAttributeProperties = {};\n let nextPlaceholderId = 0;\n\n for (const propertyId in binaryProperties) {\n if (!binaryProperties.hasOwnProperty(propertyId)) {\n continue;\n }\n\n // For draco-compressed attributes from .pnts files, the results will be\n // stored in separate typed arrays. These will be used in place of the\n // binary body\n const property = binaryProperties[propertyId];\n if (!defined(binaryBody) && !defined(property.typedArray)) {\n throw new RuntimeError(\n `Property ${propertyId} requires a batch table binary.`\n );\n }\n\n let sanitizedPropertyId = ModelUtility.sanitizeGlslIdentifier(propertyId);\n\n // If the sanitized string is empty or a duplicate, use a placeholder\n // name instead. This will work for styling, but it may lead to undefined\n // behavior in CustomShader, since\n // - different tiles may pick a different placeholder ID due to the\n // collection being unordered\n // - different tiles may have different number of properties.\n if (\n sanitizedPropertyId === \"\" ||\n classProperties.hasOwnProperty(sanitizedPropertyId)\n ) {\n sanitizedPropertyId = `property_${nextPlaceholderId}`;\n nextPlaceholderId++;\n }\n\n const classProperty = transcodePropertyType(property);\n classProperty.name = propertyId;\n classProperties[sanitizedPropertyId] = classProperty;\n\n // Extract the typed array and create a custom attribute as a typed array.\n // The caller must add the results to the ModelComponents, and upload the\n // typed array to the GPU. The attribute name is converted to all capitals\n // and underscores, like a glTF custom attribute.\n //\n // For example, if the original property ID was 'Temperature \u2103', the result\n // is _TEMPERATURE\n let customAttributeName = sanitizedPropertyId.toUpperCase();\n if (!customAttributeName.startsWith(\"_\")) {\n customAttributeName = `_${customAttributeName}`;\n }\n\n // for .pnts with draco compression, property.typedArray is used\n // instead of the binary body.\n let attributeTypedArray = property.typedArray;\n if (!defined(attributeTypedArray)) {\n const binaryAccessor = getBinaryAccessor(property);\n attributeTypedArray = binaryAccessor.createArrayBufferView(\n binaryBody.buffer,\n binaryBody.byteOffset + property.byteOffset,\n featureCount\n );\n }\n\n const attribute = new ModelComponents.Attribute();\n attribute.name = customAttributeName;\n attribute.count = featureCount;\n attribute.type = property.type;\n attribute.componentDatatype = ComponentDatatype.fromTypedArray(\n attributeTypedArray\n );\n attribute.typedArray = attributeTypedArray;\n customAttributeOutput.push(attribute);\n\n // Refer to the custom attribute name from the property attribute\n propertyAttributeProperties[sanitizedPropertyId] = {\n attribute: customAttributeName,\n };\n }\n\n const schemaJson = {\n classes: {},\n };\n schemaJson.classes[className] = {\n properties: classProperties,\n };\n\n const transcodedSchema = new MetadataSchema(schemaJson);\n\n const propertyAttributeJson = {\n properties: propertyAttributeProperties,\n };\n\n return {\n class: className,\n propertyAttributeJson: propertyAttributeJson,\n transcodedSchema: transcodedSchema,\n transcodedClass: transcodedSchema.classes[className],\n };\n}\n\n/**\n * Given a property definition from the batch table, compute the equivalent\n * <code>EXT_structural_metadata</code> type definition\n *\n * @param {Object} property The batch table property definition\n * @return {Object} The corresponding structural metadata property definition\n * @private\n */\nfunction transcodePropertyType(property) {\n const componentType = transcodeComponentType(property.componentType);\n\n return {\n type: property.type,\n componentType: componentType,\n };\n}\n\n/**\n * Convert the component type of a batch table property to the corresponding\n * type used with structural metadata\n *\n * @property {String} componentType the batch table's component type\n * @return {String} The corresponding structural metadata data type\n *\n * @private\n */\nfunction transcodeComponentType(componentType) {\n switch (componentType) {\n case \"BYTE\":\n return \"INT8\";\n case \"UNSIGNED_BYTE\":\n return \"UINT8\";\n case \"SHORT\":\n return \"INT16\";\n case \"UNSIGNED_SHORT\":\n return \"UINT16\";\n case \"INT\":\n return \"INT32\";\n case \"UNSIGNED_INT\":\n return \"UINT32\";\n case \"FLOAT\":\n return \"FLOAT32\";\n case \"DOUBLE\":\n return \"FLOAT64\";\n }\n}\n\n// exposed for testing\nparseBatchTable._deprecationWarning = deprecationWarning;\n\nexport default parseBatchTable;\n", "import Axis from \"../Axis.js\";\nimport B3dmParser from \"../B3dmParser.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cesium3DTileFeatureTable from \"../Cesium3DTileFeatureTable.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport MetadataClass from \"../MetadataClass.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst B3dmLoaderState = {\n UNLOADED: 0,\n LOADING: 1,\n PROCESSING: 2,\n READY: 3,\n FAILED: 4,\n};\n\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\n\n/**\n * Loads a Batched 3D Model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias B3dmLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.b3dmResource The {@link Resource} containing the b3dm.\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the b3dm contents.\n * @param {Number} [options.byteOffset] The byte offset to the beginning of the b3dm contents in the array buffer.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.X] The forward-axis of the glTF model.\n * @param {Boolean} [options.loadAttributesAsTypedArray=false] If <code>true</code>, load all attributes as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {Boolean} [options.loadAttributesFor2D=false] If <code>true</code>, load the positions buffer and any instanced attribute buffers as typed arrays for accurately projecting models to 2D.\n * @param {Boolean} [options.loadIndicesForWireframe=false] If <code>true</code>, load the index buffer as a typed array. This is useful for creating wireframe indices in WebGL1.\n * @param {Boolean} [options.loadPrimitiveOutline=true] If <code>true</code>, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n * @param {Boolean} [options.loadForClassification=false] If <code>true</code> and if the model has feature IDs, load the feature IDs and indices as typed arrays. This is useful for batching features for classification.\n * */\nfunction B3dmLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const b3dmResource = options.b3dmResource;\n let baseResource = options.baseResource;\n const arrayBuffer = options.arrayBuffer;\n const byteOffset = defaultValue(options.byteOffset, 0);\n const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n const asynchronous = defaultValue(options.asynchronous, true);\n const incrementallyLoadTextures = defaultValue(\n options.incrementallyLoadTextures,\n true\n );\n const upAxis = defaultValue(options.upAxis, Axis.Y);\n const forwardAxis = defaultValue(options.forwardAxis, Axis.X);\n const loadAttributesAsTypedArray = defaultValue(\n options.loadAttributesAsTypedArray,\n false\n );\n const loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n const loadIndicesForWireframe = defaultValue(\n options.loadIndicesForWireframe,\n false\n );\n const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n const loadForClassification = defaultValue(\n options.loadForClassification,\n false\n );\n\n baseResource = defined(baseResource) ? baseResource : b3dmResource.clone();\n\n this._b3dmResource = b3dmResource;\n this._baseResource = baseResource;\n this._arrayBuffer = arrayBuffer;\n this._byteOffset = byteOffset;\n this._releaseGltfJson = releaseGltfJson;\n this._asynchronous = asynchronous;\n this._incrementallyLoadTextures = incrementallyLoadTextures;\n this._upAxis = upAxis;\n this._forwardAxis = forwardAxis;\n this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n this._loadAttributesFor2D = loadAttributesFor2D;\n this._loadIndicesForWireframe = loadIndicesForWireframe;\n this._loadPrimitiveOutline = loadPrimitiveOutline;\n this._loadForClassification = loadForClassification;\n\n this._state = B3dmLoaderState.UNLOADED;\n\n this._promise = undefined;\n\n this._gltfLoader = undefined;\n\n // Loaded results.\n this._batchLength = 0;\n this._propertyTable = undefined;\n\n // The batch table object contains a json and a binary component access using keys of the same name.\n this._batchTable = undefined;\n this._components = undefined;\n this._transform = Matrix4.IDENTITY;\n}\n\nif (defined(Object.create)) {\n B3dmLoader.prototype = Object.create(ResourceLoader.prototype);\n B3dmLoader.prototype.constructor = B3dmLoader;\n}\n\nObject.defineProperties(B3dmLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof B3dmLoader.prototype\n *\n * @type {Promise.<B3dmLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n\n /**\n * A promise that resolves when all textures are loaded.\n * When <code>incrementallyLoadTextures</code> is true this may resolve after\n * <code>promise</code> resolves.\n *\n * @memberof B3dmLoader.prototype\n *\n * @type {Promise}\n * @readonly\n * @private\n */\n texturesLoadedPromise: {\n get: function () {\n return this._gltfLoader.texturesLoadedPromise;\n },\n },\n /**\n * The cache key of the resource\n *\n * @memberof B3dmLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * The loaded components.\n *\n * @memberof B3dmLoader.prototype\n *\n * @type {ModelComponents.Components}\n * @readonly\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<B3dmLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nB3dmLoader.prototype.load = function () {\n const b3dm = B3dmParser.parse(this._arrayBuffer, this._byteOffset);\n\n let batchLength = b3dm.batchLength;\n const featureTableJson = b3dm.featureTableJson;\n const featureTableBinary = b3dm.featureTableBinary;\n const batchTableJson = b3dm.batchTableJson;\n const batchTableBinary = b3dm.batchTableBinary;\n\n const featureTable = new Cesium3DTileFeatureTable(\n featureTableJson,\n featureTableBinary\n );\n batchLength = featureTable.getGlobalProperty(\"BATCH_LENGTH\");\n // Set batch length.\n this._batchLength = batchLength;\n // Set the RTC Center transform, if present.\n const rtcCenter = featureTable.getGlobalProperty(\n \"RTC_CENTER\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (defined(rtcCenter)) {\n this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter));\n }\n\n this._batchTable = {\n json: batchTableJson,\n binary: batchTableBinary,\n };\n\n const gltfLoader = new GltfLoader({\n typedArray: b3dm.gltf,\n upAxis: this._upAxis,\n forwardAxis: this._forwardAxis,\n gltfResource: this._b3dmResource,\n baseResource: this._baseResource,\n releaseGltfJson: this._releaseGltfJson,\n incrementallyLoadTextures: this._incrementallyLoadTextures,\n loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,\n loadAttributesFor2D: this._loadAttributesFor2D,\n loadIndicesForWireframe: this._loadIndicesForWireframe,\n loadPrimitiveOutline: this._loadPrimitiveOutline,\n loadForClassification: this._loadForClassification,\n renameBatchIdSemantic: true,\n });\n\n this._gltfLoader = gltfLoader;\n this._state = B3dmLoaderState.LOADING;\n\n const that = this;\n gltfLoader.load();\n this._promise = gltfLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n\n const components = gltfLoader.components;\n\n // Combine the RTC_CENTER transform from the b3dm and the CESIUM_RTC\n // transform from the glTF. In practice usually only one or the\n // other is supplied. If they don't exist the transforms will\n // be identity matrices.\n components.transform = Matrix4.multiplyTransformation(\n that._transform,\n components.transform,\n components.transform\n );\n createStructuralMetadata(that, components);\n that._components = components;\n\n // Now that we have the parsed components, we can release the array buffer\n that._arrayBuffer = undefined;\n\n that._state = B3dmLoaderState.READY;\n return that;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction handleError(b3dmLoader, error) {\n b3dmLoader.unload();\n b3dmLoader._state = B3dmLoaderState.FAILED;\n const errorMessage = \"Failed to load b3dm\";\n error = b3dmLoader.getError(errorMessage, error);\n return Promise.reject(error);\n}\n\nB3dmLoader.prototype.process = function (frameState) {\n if (this._state === B3dmLoaderState.LOADING) {\n this._state = B3dmLoaderState.PROCESSING;\n }\n\n if (this._state === B3dmLoaderState.PROCESSING) {\n this._gltfLoader.process(frameState);\n }\n};\n\nfunction createStructuralMetadata(loader, components) {\n const batchTable = loader._batchTable;\n const batchLength = loader._batchLength;\n\n if (batchLength === 0) {\n return;\n }\n\n let structuralMetadata;\n if (defined(batchTable.json)) {\n // Add the structural metadata from the batch table to the model components.\n structuralMetadata = parseBatchTable({\n count: batchLength,\n batchTable: batchTable.json,\n binaryBody: batchTable.binary,\n });\n } else {\n // If batch table is not defined, create a property table without any properties.\n const emptyPropertyTable = new PropertyTable({\n name: MetadataClass.BATCH_TABLE_CLASS_NAME,\n count: batchLength,\n });\n structuralMetadata = new StructuralMetadata({\n schema: {},\n propertyTables: [emptyPropertyTable],\n });\n }\n\n // Add the feature ID attribute to the primitives.\n const nodes = components.scene.nodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n processNode(nodes[i]);\n }\n components.structuralMetadata = structuralMetadata;\n}\n\n// Recursive function to add the feature ID attribute to all primitives that have a feature ID vertex attribute.\nfunction processNode(node) {\n const childrenLength = node.children.length;\n for (let i = 0; i < childrenLength; i++) {\n processNode(node.children[i]);\n }\n\n const primitivesLength = node.primitives.length;\n for (let i = 0; i < primitivesLength; i++) {\n const primitive = node.primitives[i];\n const featureIdVertexAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.FEATURE_ID\n );\n if (defined(featureIdVertexAttribute)) {\n featureIdVertexAttribute.setIndex = 0;\n const featureIdAttribute = new FeatureIdAttribute();\n featureIdAttribute.propertyTableId = 0;\n featureIdAttribute.setIndex = 0;\n featureIdAttribute.positionalLabel = \"featureId_0\";\n primitive.featureIds.push(featureIdAttribute);\n }\n }\n}\n\nB3dmLoader.prototype.unload = function () {\n if (defined(this._gltfLoader)) {\n this._gltfLoader.unload();\n }\n\n this._components = undefined;\n this._arrayBuffer = undefined;\n};\n\nexport default B3dmLoader;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Ellipsoid from \"../../Core/Ellipsoid.js\";\nimport IndexDatatype from \"../../Core/IndexDatatype.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport JsonMetadataTable from \"../JsonMetadataTable.js\";\nimport MetadataSchema from \"../MetadataSchema.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\n\n/**\n * Loads a GeoJson model as part of the <code>MAXAR_content_geojson</code> extension with the following constraints:\n * <ul>\n * <li>The top level GeoJSON type must be FeatureCollection or Feature.</li>\n * <li>The geometry types must be LineString, MultiLineString, MultiPolygon, Polygon, MultiPoint, or Point.</li>\n * <li>Polygon and polyline geometries are converted to geodesic lines.</li>\n * <li>Only WGS84 geographic coordinates are supported.</li>\n * </ul>\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias GeoJsonLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.geoJson The GeoJson object.\n */\nfunction GeoJsonLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._geoJson = options.geoJson;\n this._promise = undefined;\n this._process = function (loader, frameState) {};\n this._components = undefined;\n}\n\nif (defined(Object.create)) {\n GeoJsonLoader.prototype = Object.create(ResourceLoader.prototype);\n GeoJsonLoader.prototype.constructor = GeoJsonLoader;\n}\n\nObject.defineProperties(GeoJsonLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource has not yet started loading.\n *\n * @memberof GeoJsonLoader.prototype\n *\n * @type {Promise.<GeoJsonLoader>|Undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource.\n *\n * @memberof GeoJsonLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return undefined;\n },\n },\n /**\n * The loaded components.\n *\n * @memberof GeoJsonLoader.prototype\n *\n * @type {ModelComponents.Components}\n * @readonly\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<GeoJsonLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nGeoJsonLoader.prototype.load = function () {\n const loader = this;\n const promise = new Promise(function (resolve) {\n loader._process = function (loader, frameState) {\n if (defined(loader._components)) {\n return;\n }\n\n loader._components = parse(loader._geoJson, frameState);\n loader._geoJson = undefined;\n resolve(loader);\n };\n });\n\n this._promise = promise;\n return promise;\n};\n\n/**\n * Processes the resource until it becomes ready.\n *\n * @param {FrameState} frameState The frame state.\n * @private\n */\nGeoJsonLoader.prototype.process = function (frameState) {\n this._process(this, frameState);\n};\n\nfunction ParsedFeature() {\n this.lines = undefined;\n this.points = undefined;\n this.properties = undefined;\n}\n\nfunction ParseResult() {\n this.features = [];\n}\n\nfunction parsePosition(position) {\n const x = position[0];\n const y = position[1];\n const z = defaultValue(position[2], 0.0);\n return new Cartesian3(x, y, z);\n}\n\nfunction parseLineString(coordinates) {\n const positionsLength = coordinates.length;\n const line = new Array(positionsLength);\n for (let i = 0; i < positionsLength; i++) {\n line[i] = parsePosition(coordinates[i]);\n }\n const lines = [line];\n return lines;\n}\n\nfunction parseMultiLineString(coordinates) {\n const linesLength = coordinates.length;\n const lines = new Array(linesLength);\n for (let i = 0; i < linesLength; i++) {\n lines[i] = parseLineString(coordinates[i])[0];\n }\n return lines;\n}\n\nfunction parsePolygon(coordinates) {\n // Treat exterior polygon and interior polygons as lines\n const linesLength = coordinates.length;\n const lines = new Array(linesLength);\n for (let i = 0; i < linesLength; i++) {\n lines[i] = parseLineString(coordinates[i])[0];\n }\n return lines;\n}\n\nfunction parseMultiPolygon(coordinates) {\n const polygonsLength = coordinates.length;\n const lines = [];\n for (let i = 0; i < polygonsLength; i++) {\n Array.prototype.push.apply(lines, parsePolygon(coordinates[i]));\n }\n return lines;\n}\n\nfunction parsePoint(coordinates) {\n return [parsePosition(coordinates)];\n}\n\nfunction parseMultiPoint(coordinates) {\n const pointsLength = coordinates.length;\n const points = new Array(pointsLength);\n for (let i = 0; i < pointsLength; i++) {\n points[i] = parsePosition(coordinates[i]);\n }\n return points;\n}\n\nconst geometryTypes = {\n LineString: parseLineString,\n MultiLineString: parseMultiLineString,\n MultiPolygon: parseMultiPolygon,\n Polygon: parsePolygon,\n MultiPoint: parseMultiPoint,\n Point: parsePoint,\n};\n\nconst primitiveTypes = {\n LineString: PrimitiveType.LINES,\n MultiLineString: PrimitiveType.LINES,\n MultiPolygon: PrimitiveType.LINES,\n Polygon: PrimitiveType.LINES,\n MultiPoint: PrimitiveType.POINTS,\n Point: PrimitiveType.POINTS,\n};\n\nfunction parseFeature(feature, result) {\n if (!defined(feature.geometry)) {\n return;\n }\n\n const geometryType = feature.geometry.type;\n const geometryFunction = geometryTypes[geometryType];\n const primitiveType = primitiveTypes[geometryType];\n const coordinates = feature.geometry.coordinates;\n\n if (!defined(geometryFunction)) {\n return;\n }\n\n if (!defined(coordinates)) {\n return;\n }\n\n const parsedFeature = new ParsedFeature();\n\n if (primitiveType === PrimitiveType.LINES) {\n parsedFeature.lines = geometryFunction(coordinates);\n } else if (primitiveType === PrimitiveType.POINTS) {\n parsedFeature.points = geometryFunction(coordinates);\n }\n\n parsedFeature.properties = feature.properties;\n\n result.features.push(parsedFeature);\n}\n\nfunction parseFeatureCollection(featureCollection, result) {\n const features = featureCollection.features;\n const featuresLength = features.length;\n for (let i = 0; i < featuresLength; i++) {\n parseFeature(features[i], result);\n }\n}\n\nconst geoJsonObjectTypes = {\n FeatureCollection: parseFeatureCollection,\n Feature: parseFeature,\n};\n\nconst scratchCartesian = new Cartesian3();\n\nfunction createLinesPrimitive(features, toLocal, frameState) {\n // Count the number of vertices and indices\n let vertexCount = 0;\n let indexCount = 0;\n\n const featureCount = features.length;\n\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n if (defined(feature.lines)) {\n const linesLength = feature.lines.length;\n for (let j = 0; j < linesLength; j++) {\n const line = feature.lines[j];\n vertexCount += line.length;\n indexCount += (line.length - 1) * 2;\n }\n }\n }\n\n // Allocate typed arrays\n const positionsTypedArray = new Float32Array(vertexCount * 3);\n const featureIdsTypedArray = new Float32Array(vertexCount);\n const indicesTypedArray = IndexDatatype.createTypedArray(\n vertexCount,\n indexCount\n );\n const indexDatatype = IndexDatatype.fromTypedArray(indicesTypedArray);\n\n // Process the data. Convert positions to local ENU. Generate indices.\n const localMin = new Cartesian3(\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY\n );\n\n const localMax = new Cartesian3(\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY\n );\n\n let vertexCounter = 0;\n let segmentCounter = 0;\n\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n\n if (!defined(feature.lines)) {\n continue;\n }\n\n const linesLength = feature.lines.length;\n for (let j = 0; j < linesLength; j++) {\n const line = feature.lines[j];\n const positionsLength = line.length;\n for (let k = 0; k < positionsLength; k++) {\n const cartographic = line[k];\n const globalCartesian = Cartesian3.fromDegrees(\n cartographic.x,\n cartographic.y,\n cartographic.z,\n Ellipsoid.WGS84,\n scratchCartesian\n );\n const localCartesian = Matrix4.multiplyByPoint(\n toLocal,\n globalCartesian,\n scratchCartesian\n );\n\n Cartesian3.minimumByComponent(localMin, localCartesian, localMin);\n Cartesian3.maximumByComponent(localMax, localCartesian, localMax);\n\n Cartesian3.pack(localCartesian, positionsTypedArray, vertexCounter * 3);\n\n featureIdsTypedArray[vertexCounter] = i;\n\n if (k < positionsLength - 1) {\n indicesTypedArray[segmentCounter * 2] = vertexCounter;\n indicesTypedArray[segmentCounter * 2 + 1] = vertexCounter + 1;\n segmentCounter++;\n }\n\n vertexCounter++;\n }\n }\n }\n\n // Create GPU buffers\n const positionBuffer = Buffer.createVertexBuffer({\n typedArray: positionsTypedArray,\n context: frameState.context,\n usage: BufferUsage.STATIC_DRAW,\n });\n positionBuffer.vertexArrayDestroyable = false;\n\n const featureIdBuffer = Buffer.createVertexBuffer({\n typedArray: featureIdsTypedArray,\n context: frameState.context,\n usage: BufferUsage.STATIC_DRAW,\n });\n featureIdBuffer.vertexArrayDestroyable = false;\n\n const indexBuffer = Buffer.createIndexBuffer({\n typedArray: indicesTypedArray,\n context: frameState.context,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: indexDatatype,\n });\n indexBuffer.vertexArrayDestroyable = false;\n\n // Create ModelComponents\n const positionAttribute = new ModelComponents.Attribute();\n positionAttribute.semantic = VertexAttributeSemantic.POSITION;\n positionAttribute.componentDatatype = ComponentDatatype.FLOAT;\n positionAttribute.type = AttributeType.VEC3;\n positionAttribute.count = vertexCount;\n positionAttribute.min = localMin;\n positionAttribute.max = localMax;\n positionAttribute.buffer = positionBuffer;\n\n const featureIdAttribute = new ModelComponents.Attribute();\n featureIdAttribute.semantic = VertexAttributeSemantic.FEATURE_ID;\n featureIdAttribute.setIndex = 0;\n featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n featureIdAttribute.type = AttributeType.SCALAR;\n featureIdAttribute.count = vertexCount;\n featureIdAttribute.buffer = featureIdBuffer;\n\n const attributes = [positionAttribute, featureIdAttribute];\n\n const material = new ModelComponents.Material();\n material.unlit = true;\n\n const indices = new ModelComponents.Indices();\n indices.indexDatatype = indexDatatype;\n indices.count = indicesTypedArray.length;\n indices.buffer = indexBuffer;\n\n const featureId = new ModelComponents.FeatureIdAttribute();\n featureId.featureCount = featureCount;\n featureId.propertyTableId = 0;\n featureId.setIndex = 0;\n featureId.positionalLabel = \"featureId_0\";\n\n const featureIds = [featureId];\n\n const primitive = new ModelComponents.Primitive();\n primitive.attributes = attributes;\n primitive.indices = indices;\n primitive.featureIds = featureIds;\n primitive.primitiveType = PrimitiveType.LINES;\n primitive.material = material;\n\n return primitive;\n}\n\nfunction createPointsPrimitive(features, toLocal, frameState) {\n // Count the number of vertices\n let vertexCount = 0;\n\n const featureCount = features.length;\n\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n if (defined(feature.points)) {\n vertexCount += feature.points.length;\n }\n }\n\n // Allocate typed arrays\n const positionsTypedArray = new Float32Array(vertexCount * 3);\n const featureIdsTypedArray = new Float32Array(vertexCount);\n\n // Process the data. Convert positions to local ENU.\n const localMin = new Cartesian3(\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY\n );\n\n const localMax = new Cartesian3(\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY\n );\n\n let vertexCounter = 0;\n\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n\n if (!defined(feature.points)) {\n continue;\n }\n\n const pointsLength = feature.points.length;\n for (let j = 0; j < pointsLength; j++) {\n const cartographic = feature.points[j];\n const globalCartesian = Cartesian3.fromDegrees(\n cartographic.x,\n cartographic.y,\n cartographic.z,\n Ellipsoid.WGS84,\n scratchCartesian\n );\n const localCartesian = Matrix4.multiplyByPoint(\n toLocal,\n globalCartesian,\n scratchCartesian\n );\n\n Cartesian3.minimumByComponent(localMin, localCartesian, localMin);\n Cartesian3.maximumByComponent(localMax, localCartesian, localMax);\n\n Cartesian3.pack(localCartesian, positionsTypedArray, vertexCounter * 3);\n\n featureIdsTypedArray[vertexCounter] = i;\n\n vertexCounter++;\n }\n }\n\n // Create GPU buffers\n const positionBuffer = Buffer.createVertexBuffer({\n typedArray: positionsTypedArray,\n context: frameState.context,\n usage: BufferUsage.STATIC_DRAW,\n });\n positionBuffer.vertexArrayDestroyable = false;\n\n const featureIdBuffer = Buffer.createVertexBuffer({\n typedArray: featureIdsTypedArray,\n context: frameState.context,\n usage: BufferUsage.STATIC_DRAW,\n });\n featureIdBuffer.vertexArrayDestroyable = false;\n\n // Create ModelComponents\n const positionAttribute = new ModelComponents.Attribute();\n positionAttribute.semantic = VertexAttributeSemantic.POSITION;\n positionAttribute.componentDatatype = ComponentDatatype.FLOAT;\n positionAttribute.type = AttributeType.VEC3;\n positionAttribute.count = vertexCount;\n positionAttribute.min = localMin;\n positionAttribute.max = localMax;\n positionAttribute.buffer = positionBuffer;\n\n const featureIdAttribute = new ModelComponents.Attribute();\n featureIdAttribute.semantic = VertexAttributeSemantic.FEATURE_ID;\n featureIdAttribute.setIndex = 0;\n featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n featureIdAttribute.type = AttributeType.SCALAR;\n featureIdAttribute.count = vertexCount;\n featureIdAttribute.buffer = featureIdBuffer;\n\n const attributes = [positionAttribute, featureIdAttribute];\n\n const material = new ModelComponents.Material();\n material.unlit = true;\n\n const featureId = new ModelComponents.FeatureIdAttribute();\n featureId.featureCount = featureCount;\n featureId.propertyTableId = 0;\n featureId.setIndex = 0;\n featureId.positionalLabel = \"featureId_0\";\n\n const featureIds = [featureId];\n\n const primitive = new ModelComponents.Primitive();\n primitive.attributes = attributes;\n primitive.featureIds = featureIds;\n primitive.primitiveType = PrimitiveType.POINTS;\n primitive.material = material;\n\n return primitive;\n}\n\nfunction parse(geoJson, frameState) {\n const result = new ParseResult();\n\n // Parse the GeoJSON\n const parseFunction = geoJsonObjectTypes[geoJson.type];\n if (defined(parseFunction)) {\n parseFunction(geoJson, result);\n }\n\n const features = result.features;\n const featureCount = features.length;\n\n if (featureCount === 0) {\n throw new RuntimeError(\"GeoJSON must have at least one feature\");\n }\n\n // Allocate space for property values\n const properties = {};\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n const featureProperties = defaultValue(\n feature.properties,\n defaultValue.EMPTY_OBJECT\n );\n for (const propertyId in featureProperties) {\n if (featureProperties.hasOwnProperty(propertyId)) {\n if (!defined(properties[propertyId])) {\n properties[propertyId] = new Array(featureCount);\n }\n }\n }\n }\n\n // Fill in the property values. Default to empty string for undefined values.\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const value = defaultValue(feature.properties[propertyId], \"\");\n properties[propertyId][i] = value;\n }\n }\n }\n\n const jsonMetadataTable = new JsonMetadataTable({\n count: featureCount,\n properties: properties,\n });\n\n const propertyTable = new PropertyTable({\n id: 0,\n count: featureCount,\n jsonMetadataTable: jsonMetadataTable,\n });\n const propertyTables = [propertyTable];\n\n const schema = new MetadataSchema({});\n\n const structuralMetadata = new StructuralMetadata({\n schema: schema,\n propertyTables: propertyTables,\n });\n\n // Find the cartographic bounding box\n const cartographicMin = new Cartesian3(\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY\n );\n\n const cartographicMax = new Cartesian3(\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY\n );\n\n let hasLines = false;\n let hasPoints = false;\n\n for (let i = 0; i < featureCount; i++) {\n const feature = features[i];\n if (defined(feature.lines)) {\n hasLines = true;\n const linesLength = feature.lines.length;\n for (let j = 0; j < linesLength; j++) {\n const line = feature.lines[j];\n const positionsLength = line.length;\n for (let k = 0; k < positionsLength; k++) {\n Cartesian3.minimumByComponent(\n cartographicMin,\n line[k],\n cartographicMin\n );\n Cartesian3.maximumByComponent(\n cartographicMax,\n line[k],\n cartographicMax\n );\n }\n }\n }\n\n if (defined(feature.points)) {\n hasPoints = true;\n const pointsLength = feature.points.length;\n for (let j = 0; j < pointsLength; j++) {\n const point = feature.points[j];\n Cartesian3.minimumByComponent(cartographicMin, point, cartographicMin);\n Cartesian3.maximumByComponent(cartographicMax, point, cartographicMax);\n }\n }\n }\n\n // Compute the ENU matrix\n const cartographicCenter = Cartesian3.midpoint(\n cartographicMin,\n cartographicMax,\n new Cartesian3()\n );\n const ecefCenter = Cartesian3.fromDegrees(\n cartographicCenter.x,\n cartographicCenter.y,\n cartographicCenter.z,\n Ellipsoid.WGS84,\n new Cartesian3()\n );\n const toGlobal = Transforms.eastNorthUpToFixedFrame(\n ecefCenter,\n Ellipsoid.WGS84,\n new Matrix4()\n );\n const toLocal = Matrix4.inverseTransformation(toGlobal, new Matrix4());\n\n const primitives = [];\n\n if (hasLines) {\n primitives.push(createLinesPrimitive(features, toLocal, frameState));\n }\n\n if (hasPoints) {\n primitives.push(createPointsPrimitive(features, toLocal, frameState));\n }\n\n const node = new ModelComponents.Node();\n node.index = 0;\n node.primitives = primitives;\n\n const nodes = [node];\n\n const scene = new ModelComponents.Scene();\n scene.nodes = nodes;\n\n const components = new ModelComponents.Components();\n components.scene = scene;\n components.nodes = nodes;\n components.transform = toGlobal;\n components.structuralMetadata = structuralMetadata;\n\n return components;\n}\n\n/**\n * Unloads the resource.\n * @private\n */\nGeoJsonLoader.prototype.unload = function () {\n this._components = undefined;\n};\n\nexport default GeoJsonLoader;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Handles parsing of an Instanced 3D Model.\n *\n * @namespace I3dmParser\n * @private\n */\nconst I3dmParser = {};\nI3dmParser._deprecationWarning = deprecationWarning;\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Instanced3DModel|Instanced 3D Model}.\n *\n * @private\n *\n * @param {ArrayBuffer} arrayBuffer The array buffer containing the i3dm.\n * @param {Number} [byteOffset=0] The byte offset of the beginning of the i3dm in the array buffer.\n * @returns {Object} Returns an object with the glTF format, feature table (binary and json), batch table (binary and json) and glTF parts of the i3dm.\n */\nI3dmParser.parse = function (arrayBuffer, byteOffset) {\n const byteStart = defaultValue(byteOffset, 0);\n byteOffset = byteStart;\n\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Instanced 3D Model version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n const byteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const featureTableJsonByteLength = view.getUint32(byteOffset, true);\n if (featureTableJsonByteLength === 0) {\n throw new RuntimeError(\n \"featureTableJsonByteLength is zero, the feature table must be defined.\"\n );\n }\n byteOffset += sizeOfUint32;\n\n const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const batchTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const gltfFormat = view.getUint32(byteOffset, true);\n if (gltfFormat !== 1 && gltfFormat !== 0) {\n throw new RuntimeError(\n `Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${gltfFormat} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n const featureTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n featureTableJsonByteLength\n );\n byteOffset += featureTableJsonByteLength;\n\n const featureTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n featureTableBinaryByteLength\n );\n byteOffset += featureTableBinaryByteLength;\n\n let batchTableJson;\n let batchTableBinary;\n if (batchTableJsonByteLength > 0) {\n batchTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n batchTableJsonByteLength\n );\n byteOffset += batchTableJsonByteLength;\n\n if (batchTableBinaryByteLength > 0) {\n // Has a batch table binary\n batchTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n batchTableBinaryByteLength\n );\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n byteOffset += batchTableBinaryByteLength;\n }\n }\n\n const gltfByteLength = byteStart + byteLength - byteOffset;\n if (gltfByteLength === 0) {\n throw new RuntimeError(\"glTF byte length must be greater than 0.\");\n }\n\n let gltfView;\n if (byteOffset % 4 === 0) {\n gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);\n } else {\n // Create a copy of the glb so that it is 4-byte aligned\n I3dmParser._deprecationWarning(\n \"i3dm-glb-unaligned\",\n \"The embedded glb is not aligned to a 4-byte boundary.\"\n );\n gltfView = new Uint8Array(\n uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)\n );\n }\n\n return {\n gltfFormat: gltfFormat,\n featureTableJson: featureTableJson,\n featureTableBinary: featureTableBinary,\n batchTableJson: batchTableJson,\n batchTableBinary: batchTableBinary,\n gltf: gltfView,\n };\n};\n\nexport default I3dmParser;\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Ellipsoid from \"../../Core/Ellipsoid.js\";\nimport getStringFromTypedArray from \"../../Core/getStringFromTypedArray.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport Axis from \"../Axis.js\";\nimport Cesium3DTileFeatureTable from \"../Cesium3DTileFeatureTable.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport InstanceAttributeSemantic from \"../InstanceAttributeSemantic.js\";\nimport I3dmParser from \"../I3dmParser.js\";\nimport MetadataClass from \"../MetadataClass.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport PropertyTable from \"../PropertyTable.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\n\nconst I3dmLoaderState = {\n NOT_LOADED: 0,\n LOADING: 1,\n PROCESSING: 2,\n POST_PROCESSING: 3,\n READY: 4,\n FAILED: 5,\n UNLOADED: 6,\n};\n\nconst Attribute = ModelComponents.Attribute;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst Instances = ModelComponents.Instances;\n\n/**\n * Loads an Instanced 3D Model.\n * <p>\n * Implements the {@link ResourceLoader} interface.\n * </p>\n *\n * @alias I3dmLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource} options.i3dmResource The {@link Resource} containing the i3dm.\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the i3dm contents.\n * @param {Number} [options.byteOffset=0] The byte offset to the beginning of the i3dm contents in the array buffer.\n * @param {Resource} [options.baseResource] The {@link Resource} that paths in the glTF JSON are relative to.\n * @param {Boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {Boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.\n * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the glTF is loaded.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.X] The forward-axis of the glTF model.\n * @param {Boolean} [options.loadAttributesAsTypedArray=false] Load all attributes as typed arrays instead of GPU buffers. If the attributes are interleaved in the glTF they will be de-interleaved in the typed array.\n * @param {Boolean} [options.loadIndicesForWireframe=false] Load the index buffer as a typed array so wireframe indices can be created for WebGL1.\n * @param {Boolean} [options.loadPrimitiveOutline=true] If true, load outlines from the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time.\n */\nfunction I3dmLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const i3dmResource = options.i3dmResource;\n const arrayBuffer = options.arrayBuffer;\n let baseResource = options.baseResource;\n const byteOffset = defaultValue(options.byteOffset, 0);\n const releaseGltfJson = defaultValue(options.releaseGltfJson, false);\n const asynchronous = defaultValue(options.asynchronous, true);\n const incrementallyLoadTextures = defaultValue(\n options.incrementallyLoadTextures,\n true\n );\n const upAxis = defaultValue(options.upAxis, Axis.Y);\n const forwardAxis = defaultValue(options.forwardAxis, Axis.X);\n const loadAttributesAsTypedArray = defaultValue(\n options.loadAttributesAsTypedArray,\n false\n );\n const loadIndicesForWireframe = defaultValue(\n options.loadIndicesForWireframe,\n false\n );\n const loadPrimitiveOutline = defaultValue(options.loadPrimitiveOutline, true);\n\n baseResource = defined(baseResource) ? baseResource : i3dmResource.clone();\n\n this._i3dmResource = i3dmResource;\n this._baseResource = baseResource;\n this._arrayBuffer = arrayBuffer;\n this._byteOffset = byteOffset;\n this._releaseGltfJson = releaseGltfJson;\n this._asynchronous = asynchronous;\n this._incrementallyLoadTextures = incrementallyLoadTextures;\n this._upAxis = upAxis;\n this._forwardAxis = forwardAxis;\n this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;\n this._loadIndicesForWireframe = loadIndicesForWireframe;\n this._loadPrimitiveOutline = loadPrimitiveOutline;\n\n this._state = I3dmLoaderState.NOT_LOADED;\n this._promise = undefined;\n\n this._gltfLoader = undefined;\n this._gltfLoaderPromise = undefined;\n this._process = function (loader, frameState) {};\n this._postProcess = function (loader, frameState) {};\n\n // Instanced attributes are initially parsed as typed arrays, but if they\n // do not need to be further processed (e.g. turned into transform matrices),\n // it is more efficient to turn them into buffers. The I3dmLoader will own the\n // resources and store them here.\n this._buffers = [];\n this._components = undefined;\n\n this._transform = Matrix4.IDENTITY;\n this._batchTable = undefined;\n this._featureTable = undefined;\n this._instancesLength = 0;\n}\n\nif (defined(Object.create)) {\n I3dmLoader.prototype = Object.create(ResourceLoader.prototype);\n I3dmLoader.prototype.constructor = I3dmLoader;\n}\n\nObject.defineProperties(I3dmLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof I3dmLoader.prototype\n *\n * @type {Promise.<I3dmLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n\n /**\n * A promise that resolves when all textures are loaded.\n * When <code>incrementallyLoadTextures</code> is true this may resolve after\n * <code>promise</code> resolves.\n *\n * @memberof I3dmLoader.prototype\n *\n * @type {Promise}\n * @readonly\n * @private\n */\n texturesLoadedPromise: {\n get: function () {\n return this._gltfLoader.texturesLoadedPromise;\n },\n },\n /**\n * The cache key of the resource\n *\n * @memberof I3dmLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * The loaded components.\n *\n * @memberof I3dmLoader.prototype\n *\n * @type {ModelComponents.Components}\n * @default {@link Matrix4.IDENTITY}\n * @readonly\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<I3dmLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nI3dmLoader.prototype.load = function () {\n // Parse the i3dm into its various sections.\n const i3dm = I3dmParser.parse(this._arrayBuffer, this._byteOffset);\n\n const featureTableJson = i3dm.featureTableJson;\n const featureTableBinary = i3dm.featureTableBinary;\n const batchTableJson = i3dm.batchTableJson;\n const batchTableBinary = i3dm.batchTableBinary;\n const gltfFormat = i3dm.gltfFormat;\n\n // Generate the feature table.\n const featureTable = new Cesium3DTileFeatureTable(\n featureTableJson,\n featureTableBinary\n );\n this._featureTable = featureTable;\n\n // Get the number of instances in the i3dm.\n const instancesLength = featureTable.getGlobalProperty(\"INSTANCES_LENGTH\");\n featureTable.featuresLength = instancesLength;\n if (!defined(instancesLength)) {\n throw new RuntimeError(\n \"Feature table global property: INSTANCES_LENGTH must be defined\"\n );\n }\n this._instancesLength = instancesLength;\n\n // Get the RTC center, if available, and set the loader's transform.\n const rtcCenter = featureTable.getGlobalProperty(\n \"RTC_CENTER\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (defined(rtcCenter)) {\n this._transform = Matrix4.fromTranslation(Cartesian3.fromArray(rtcCenter));\n }\n\n // Save the batch table section to use for StructuralMetadata generation.\n this._batchTable = {\n json: batchTableJson,\n binary: batchTableBinary,\n };\n\n const loaderOptions = {\n upAxis: this._upAxis,\n forwardAxis: this._forwardAxis,\n releaseGltfJson: this._releaseGltfJson,\n incrementallyLoadTextures: this._incrementallyLoadTextures,\n loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,\n loadIndicesForWireframe: this._loadIndicesForWireframe,\n loadPrimitiveOutline: this._loadPrimitiveOutline,\n };\n\n if (gltfFormat === 0) {\n let gltfUrl = getStringFromTypedArray(i3dm.gltf);\n\n // We need to remove padding from the end of the model URL in case this tile was part of a composite tile.\n // This removes all white space and null characters from the end of the string.\n gltfUrl = gltfUrl.replace(/[\\s\\0]+$/, \"\");\n const gltfResource = this._baseResource.getDerivedResource({\n url: gltfUrl,\n });\n loaderOptions.gltfResource = gltfResource;\n loaderOptions.baseResource = gltfResource;\n } else {\n loaderOptions.gltfResource = this._i3dmResource;\n loaderOptions.typedArray = i3dm.gltf;\n }\n\n // Create the GltfLoader, update the state and load the glTF.\n const gltfLoader = new GltfLoader(loaderOptions);\n\n this._gltfLoader = gltfLoader;\n this._state = I3dmLoaderState.LOADING;\n\n gltfLoader.load();\n\n const that = this;\n const processPromise = new Promise(function (resolve) {\n that._process = function (loader, frameState) {\n loader._gltfLoader.process(frameState);\n };\n\n that._postProcess = function (loader, frameState) {\n const gltfLoader = loader._gltfLoader;\n const components = gltfLoader.components;\n\n // Combine the RTC_CENTER transform from the i3dm and the CESIUM_RTC\n // transform from the glTF. In practice CESIUM_RTC is not set for\n // instanced models but multiply the transforms just in case.\n components.transform = Matrix4.multiplyTransformation(\n loader._transform,\n components.transform,\n components.transform\n );\n\n createInstances(loader, components, frameState);\n createStructuralMetadata(loader, components);\n loader._components = components;\n\n // Now that we have the parsed components, we can release the array buffer\n loader._arrayBuffer = undefined;\n\n loader._state = I3dmLoaderState.READY;\n resolve(loader);\n };\n });\n\n this._promise = gltfLoader.promise\n .then(function () {\n if (that.isDestroyed()) {\n return;\n }\n that._state = I3dmLoaderState.POST_PROCESSING;\n\n return processPromise;\n })\n .catch(function (error) {\n if (that.isDestroyed()) {\n return;\n }\n return handleError(that, error);\n });\n\n return this._promise;\n};\n\nfunction handleError(i3dmLoader, error) {\n i3dmLoader.unload();\n i3dmLoader._state = I3dmLoaderState.FAILED;\n const errorMessage = \"Failed to load i3dm\";\n error = i3dmLoader.getError(errorMessage, error);\n return Promise.reject(error);\n}\n\nI3dmLoader.prototype.process = function (frameState) {\n if (this._state === I3dmLoaderState.LOADING) {\n this._state = I3dmLoaderState.PROCESSING;\n }\n\n if (this._state === I3dmLoaderState.PROCESSING) {\n this._process(this, frameState);\n }\n\n if (this._state === I3dmLoaderState.POST_PROCESSING) {\n this._postProcess(this, frameState);\n }\n};\n\nfunction createStructuralMetadata(loader, components) {\n const batchTable = loader._batchTable;\n const instancesLength = loader._instancesLength;\n\n if (instancesLength === 0) {\n return;\n }\n\n let structuralMetadata;\n if (defined(batchTable.json)) {\n // Add the structural metadata from the batch table to the model components.\n structuralMetadata = parseBatchTable({\n count: instancesLength,\n batchTable: batchTable.json,\n binaryBody: batchTable.binary,\n });\n } else {\n // If batch table is not defined, create a property table without any properties.\n const emptyPropertyTable = new PropertyTable({\n name: MetadataClass.BATCH_TABLE_CLASS_NAME,\n count: instancesLength,\n });\n structuralMetadata = new StructuralMetadata({\n schema: {},\n propertyTables: [emptyPropertyTable],\n });\n }\n\n components.structuralMetadata = structuralMetadata;\n}\n\nconst positionScratch = new Cartesian3();\nconst propertyScratch1 = new Array(4);\nconst transformScratch = new Matrix4();\n\nfunction createInstances(loader, components, frameState) {\n let i;\n const featureTable = loader._featureTable;\n const instancesLength = loader._instancesLength;\n\n if (instancesLength === 0) {\n return;\n }\n\n const rtcCenter = featureTable.getGlobalProperty(\n \"RTC_CENTER\",\n ComponentDatatype.FLOAT,\n 3\n );\n\n const eastNorthUp = featureTable.getGlobalProperty(\"EAST_NORTH_UP\");\n const hasRotation =\n featureTable.hasProperty(\"NORMAL_UP\") ||\n featureTable.hasProperty(\"NORMAL_UP_OCT32P\") ||\n eastNorthUp;\n\n const hasScale =\n featureTable.hasProperty(\"SCALE\") ||\n featureTable.hasProperty(\"SCALE_NON_UNIFORM\");\n\n const translationTypedArray = getPositions(featureTable, instancesLength);\n let rotationTypedArray;\n if (hasRotation) {\n rotationTypedArray = new Float32Array(4 * instancesLength);\n }\n let scaleTypedArray;\n if (hasScale) {\n scaleTypedArray = new Float32Array(3 * instancesLength);\n }\n const featureIdArray = new Float32Array(instancesLength);\n\n const instancePositions = Cartesian3.unpackArray(translationTypedArray);\n let instancePosition = new Cartesian3();\n\n const instanceNormalRight = new Cartesian3();\n const instanceNormalUp = new Cartesian3();\n const instanceNormalForward = new Cartesian3();\n const instanceRotation = new Matrix3();\n const instanceQuaternion = new Quaternion();\n const instanceQuaternionArray = new Array(4);\n\n const instanceScale = new Cartesian3();\n const instanceScaleArray = new Array(3);\n\n const instanceTransform = new Matrix4();\n\n // For I3DMs that do not define an RTC center, we manually compute a BoundingSphere and store\n // positions relative to the center, to be uploaded to the GPU. This avoids jittering at higher\n // precisions.\n if (!defined(rtcCenter)) {\n const positionBoundingSphere = BoundingSphere.fromPoints(instancePositions);\n\n for (i = 0; i < instancePositions.length; i++) {\n Cartesian3.subtract(\n instancePositions[i],\n positionBoundingSphere.center,\n positionScratch\n );\n\n translationTypedArray[3 * i + 0] = positionScratch.x;\n translationTypedArray[3 * i + 1] = positionScratch.y;\n translationTypedArray[3 * i + 2] = positionScratch.z;\n }\n\n // Set the center of the bounding sphere as the RTC center transform.\n const centerTransform = Matrix4.fromTranslation(\n positionBoundingSphere.center,\n transformScratch\n );\n\n // Combine the center transform and the CESIUM_RTC transform from the glTF.\n // In practice CESIUM_RTC is not set for instanced models but multiply the\n // transforms just in case.\n components.transform = Matrix4.multiplyTransformation(\n centerTransform,\n components.transform,\n components.transform\n );\n }\n\n for (i = 0; i < instancesLength; i++) {\n // Get the instance position\n instancePosition = Cartesian3.clone(instancePositions[i]);\n\n if (defined(rtcCenter)) {\n Cartesian3.add(\n instancePosition,\n Cartesian3.unpack(rtcCenter),\n instancePosition\n );\n }\n\n // Get the instance rotation, if present\n if (hasRotation) {\n processRotation(\n featureTable,\n eastNorthUp,\n i,\n instanceQuaternion,\n instancePosition,\n instanceNormalUp,\n instanceNormalRight,\n instanceNormalForward,\n instanceRotation,\n instanceTransform\n );\n Quaternion.pack(instanceQuaternion, instanceQuaternionArray, 0);\n rotationTypedArray[4 * i + 0] = instanceQuaternionArray[0];\n rotationTypedArray[4 * i + 1] = instanceQuaternionArray[1];\n rotationTypedArray[4 * i + 2] = instanceQuaternionArray[2];\n rotationTypedArray[4 * i + 3] = instanceQuaternionArray[3];\n }\n\n // Get the instance scale, if present\n if (hasScale) {\n processScale(featureTable, i, instanceScale);\n Cartesian3.pack(instanceScale, instanceScaleArray, 0);\n scaleTypedArray[3 * i + 0] = instanceScaleArray[0];\n scaleTypedArray[3 * i + 1] = instanceScaleArray[1];\n scaleTypedArray[3 * i + 2] = instanceScaleArray[2];\n }\n\n // Get the batchId\n let batchId = featureTable.getProperty(\n \"BATCH_ID\",\n ComponentDatatype.UNSIGNED_SHORT,\n 1,\n i\n );\n if (!defined(batchId)) {\n // If BATCH_ID semantic is undefined, batchId is just the instance number\n batchId = i;\n }\n featureIdArray[i] = batchId;\n }\n\n // Create instances.\n const instances = new Instances();\n instances.transformInWorldSpace = true;\n const buffers = loader._buffers;\n\n // Create translation vertex attribute.\n const translationAttribute = new Attribute();\n translationAttribute.name = \"Instance Translation\";\n translationAttribute.semantic = InstanceAttributeSemantic.TRANSLATION;\n translationAttribute.componentDatatype = ComponentDatatype.FLOAT;\n translationAttribute.type = AttributeType.VEC3;\n translationAttribute.count = instancesLength;\n // The min / max values of the translation attribute need to be computed\n // by the model pipeline, so so a pointer to the typed array is stored.\n translationAttribute.typedArray = translationTypedArray;\n // If there is no rotation attribute, however, the translations can also be\n // loaded as a buffer to prevent additional resource creation in the pipeline.\n if (!hasRotation) {\n const buffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: translationTypedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n // Destruction of resources is handled by I3dmLoader.unload().\n buffer.vertexArrayDestroyable = false;\n buffers.push(buffer);\n\n translationAttribute.buffer = buffer;\n }\n\n instances.attributes.push(translationAttribute);\n\n // Create rotation vertex attribute.\n if (hasRotation) {\n const rotationAttribute = new Attribute();\n rotationAttribute.name = \"Instance Rotation\";\n rotationAttribute.semantic = InstanceAttributeSemantic.ROTATION;\n rotationAttribute.componentDatatype = ComponentDatatype.FLOAT;\n rotationAttribute.type = AttributeType.VEC4;\n rotationAttribute.count = instancesLength;\n rotationAttribute.typedArray = rotationTypedArray;\n instances.attributes.push(rotationAttribute);\n }\n\n // Create scale vertex attribute.\n if (hasScale) {\n const scaleAttribute = new Attribute();\n scaleAttribute.name = \"Instance Scale\";\n scaleAttribute.semantic = InstanceAttributeSemantic.SCALE;\n scaleAttribute.componentDatatype = ComponentDatatype.FLOAT;\n scaleAttribute.type = AttributeType.VEC3;\n scaleAttribute.count = instancesLength;\n if (hasRotation) {\n // If rotations are present, all transform attributes are loaded\n // as typed arrays to compute transform matrices for the model.\n scaleAttribute.typedArray = scaleTypedArray;\n } else {\n const buffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: scaleTypedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n // Destruction of resources is handled by I3dmLoader.unload().\n buffer.vertexArrayDestroyable = false;\n buffers.push(buffer);\n\n scaleAttribute.buffer = buffer;\n }\n\n instances.attributes.push(scaleAttribute);\n }\n\n // Create feature ID vertex attribute.\n const featureIdAttribute = new Attribute();\n featureIdAttribute.name = \"Instance Feature ID\";\n featureIdAttribute.setIndex = 0;\n featureIdAttribute.semantic = InstanceAttributeSemantic.FEATURE_ID;\n featureIdAttribute.componentDatatype = ComponentDatatype.FLOAT;\n featureIdAttribute.type = AttributeType.SCALAR;\n featureIdAttribute.count = instancesLength;\n const buffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: featureIdArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n // Destruction of resources is handled by I3dmLoader.unload().\n buffer.vertexArrayDestroyable = false;\n buffers.push(buffer);\n featureIdAttribute.buffer = buffer;\n\n instances.attributes.push(featureIdAttribute);\n\n // Create feature ID attribute.\n const featureIdInstanceAttribute = new FeatureIdAttribute();\n featureIdInstanceAttribute.propertyTableId = 0;\n featureIdInstanceAttribute.setIndex = 0;\n featureIdInstanceAttribute.positionalLabel = \"instanceFeatureId_0\";\n instances.featureIds.push(featureIdInstanceAttribute);\n\n // Apply instancing to every node that has at least one primitive.\n const nodes = components.nodes;\n const nodesLength = nodes.length;\n let makeInstancesCopy = false;\n for (i = 0; i < nodesLength; i++) {\n const node = nodes[i];\n if (node.primitives.length > 0) {\n // If the instances have not been assigned to a node already, assign\n // it to the first node encountered. Otherwise, make a copy of them\n // for each subsequent node.\n node.instances = makeInstancesCopy\n ? createInstancesCopy(instances)\n : instances;\n\n makeInstancesCopy = true;\n }\n }\n}\n\n/**\n * Returns a copy of the instances that contains shallow copies of the instanced\n * attributes. That is, the instances and attribute objects will be new copies,\n * but they will point to the same buffers and typed arrays. This is so each\n * node can manage memory separately, such that unloading memory for one\n * node does not unload it for another.\n *\n * @returns {ModelComponents.Instances}\n *\n * @private\n */\nfunction createInstancesCopy(instances) {\n const instancesCopy = new Instances();\n instancesCopy.transformInWorldSpace = instances.transformInWorldSpace;\n\n const attributes = instances.attributes;\n const attributesLength = attributes.length;\n\n for (let i = 0; i < attributesLength; i++) {\n const attributeCopy = clone(attributes[i], false);\n instancesCopy.attributes.push(attributeCopy);\n }\n\n instancesCopy.featureIds = instances.featureIds;\n\n return instancesCopy;\n}\n\n/**\n * Returns a typed array of positions from the i3dm's feature table. The positions\n * returned are dequantized, if dequantization is applied.\n *\n * @private\n */\nfunction getPositions(featureTable, instancesLength) {\n if (featureTable.hasProperty(\"POSITION\")) {\n // Handle positions.\n return featureTable.getPropertyArray(\n \"POSITION\",\n ComponentDatatype.FLOAT,\n 3\n );\n } else if (featureTable.hasProperty(\"POSITION_QUANTIZED\")) {\n // Handle quantized positions.\n const quantizedPositions = featureTable.getPropertyArray(\n \"POSITION_QUANTIZED\",\n ComponentDatatype.UNSIGNED_SHORT,\n 3\n );\n\n const quantizedVolumeOffset = featureTable.getGlobalProperty(\n \"QUANTIZED_VOLUME_OFFSET\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (!defined(quantizedVolumeOffset)) {\n throw new RuntimeError(\n \"Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.\"\n );\n }\n\n const quantizedVolumeScale = featureTable.getGlobalProperty(\n \"QUANTIZED_VOLUME_SCALE\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (!defined(quantizedVolumeScale)) {\n throw new RuntimeError(\n \"Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.\"\n );\n }\n\n const decodedPositions = new Float32Array(quantizedPositions.length);\n for (let i = 0; i < quantizedPositions.length / 3; i++) {\n for (let j = 0; j < 3; j++) {\n const index = 3 * i + j;\n decodedPositions[index] =\n (quantizedPositions[index] / 65535.0) * quantizedVolumeScale[j] +\n quantizedVolumeOffset[j];\n }\n }\n\n return decodedPositions;\n\n // eslint-disable-next-line no-else-return\n } else {\n throw new RuntimeError(\n \"Either POSITION or POSITION_QUANTIZED must be defined for each instance.\"\n );\n }\n}\n\nconst propertyScratch2 = new Array(4);\nfunction processRotation(\n featureTable,\n eastNorthUp,\n i,\n instanceQuaternion,\n instancePosition,\n instanceNormalUp,\n instanceNormalRight,\n instanceNormalForward,\n instanceRotation,\n instanceTransform\n) {\n // Get the instance rotation\n const normalUp = featureTable.getProperty(\n \"NORMAL_UP\",\n ComponentDatatype.FLOAT,\n 3,\n i,\n propertyScratch1\n );\n const normalRight = featureTable.getProperty(\n \"NORMAL_RIGHT\",\n ComponentDatatype.FLOAT,\n 3,\n i,\n propertyScratch2\n );\n let hasCustomOrientation = false;\n if (defined(normalUp)) {\n if (!defined(normalRight)) {\n throw new RuntimeError(\n \"To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.\"\n );\n }\n Cartesian3.unpack(normalUp, 0, instanceNormalUp);\n Cartesian3.unpack(normalRight, 0, instanceNormalRight);\n hasCustomOrientation = true;\n } else {\n const octNormalUp = featureTable.getProperty(\n \"NORMAL_UP_OCT32P\",\n ComponentDatatype.UNSIGNED_SHORT,\n 2,\n i,\n propertyScratch1\n );\n const octNormalRight = featureTable.getProperty(\n \"NORMAL_RIGHT_OCT32P\",\n ComponentDatatype.UNSIGNED_SHORT,\n 2,\n i,\n propertyScratch2\n );\n if (defined(octNormalUp)) {\n if (!defined(octNormalRight)) {\n throw new RuntimeError(\n \"To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.\"\n );\n }\n AttributeCompression.octDecodeInRange(\n octNormalUp[0],\n octNormalUp[1],\n 65535,\n instanceNormalUp\n );\n AttributeCompression.octDecodeInRange(\n octNormalRight[0],\n octNormalRight[1],\n 65535,\n instanceNormalRight\n );\n hasCustomOrientation = true;\n } else if (eastNorthUp) {\n Transforms.eastNorthUpToFixedFrame(\n instancePosition,\n Ellipsoid.WGS84,\n instanceTransform\n );\n Matrix4.getMatrix3(instanceTransform, instanceRotation);\n } else {\n Matrix3.clone(Matrix3.IDENTITY, instanceRotation);\n }\n }\n if (hasCustomOrientation) {\n Cartesian3.cross(\n instanceNormalRight,\n instanceNormalUp,\n instanceNormalForward\n );\n Cartesian3.normalize(instanceNormalForward, instanceNormalForward);\n Matrix3.setColumn(\n instanceRotation,\n 0,\n instanceNormalRight,\n instanceRotation\n );\n Matrix3.setColumn(instanceRotation, 1, instanceNormalUp, instanceRotation);\n Matrix3.setColumn(\n instanceRotation,\n 2,\n instanceNormalForward,\n instanceRotation\n );\n }\n Quaternion.fromRotationMatrix(instanceRotation, instanceQuaternion);\n}\n\nfunction processScale(featureTable, i, instanceScale) {\n instanceScale = Cartesian3.fromElements(1.0, 1.0, 1.0, instanceScale);\n const scale = featureTable.getProperty(\n \"SCALE\",\n ComponentDatatype.FLOAT,\n 1,\n i\n );\n if (defined(scale)) {\n Cartesian3.multiplyByScalar(instanceScale, scale, instanceScale);\n }\n const nonUniformScale = featureTable.getProperty(\n \"SCALE_NON_UNIFORM\",\n ComponentDatatype.FLOAT,\n 3,\n i,\n propertyScratch1\n );\n if (defined(nonUniformScale)) {\n instanceScale.x *= nonUniformScale[0];\n instanceScale.y *= nonUniformScale[1];\n instanceScale.z *= nonUniformScale[2];\n }\n}\n\nfunction unloadBuffers(loader) {\n const buffers = loader._buffers;\n const length = buffers.length;\n for (let i = 0; i < length; i++) {\n const buffer = buffers[i];\n if (!buffer.isDestroyed()) {\n buffer.destroy();\n }\n }\n buffers.length = 0;\n}\n\nI3dmLoader.prototype.isUnloaded = function () {\n return this._state === I3dmLoaderState.UNLOADED;\n};\n\nI3dmLoader.prototype.unload = function () {\n if (defined(this._gltfLoader)) {\n this._gltfLoader.unload();\n }\n\n unloadBuffers(this);\n\n this._components = undefined;\n this._arrayBuffer = undefined;\n this._state = I3dmLoaderState.UNLOADED;\n};\n\nexport default I3dmLoader;\n", "/**\n * @private\n */\nconst ModelAnimationState = {\n STOPPED: 0,\n ANIMATING: 1,\n};\n\nexport default Object.freeze(ModelAnimationState);\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport CesiumMath from \"./Math.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * Creates a curve parameterized and evaluated by time. This type describes an interface\n * and is not intended to be instantiated directly.\n *\n * @alias Spline\n * @constructor\n *\n * @see CatmullRomSpline\n * @see LinearSpline\n * @see HermiteSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction Spline() {\n /**\n * An array of times for the control points.\n * @type {Number[]}\n * @default undefined\n */\n this.times = undefined;\n\n /**\n * An array of control points.\n * @type {Cartesian3[]|Quaternion[]}\n * @default undefined\n */\n this.points = undefined;\n\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Gets the type of the point. This helps a spline determine how to interpolate\n * and return its values.\n *\n * @param {Number|Cartesian3|Quaternion} point\n * @returns {*} The type of the point.\n *\n * @exception {DeveloperError} value must be a Cartesian3, Quaternion, or Number.\n *\n * @private\n */\nSpline.getPointType = function (point) {\n if (typeof point === \"number\") {\n return Number;\n }\n if (point instanceof Cartesian3) {\n return Cartesian3;\n }\n if (point instanceof Quaternion) {\n return Quaternion;\n }\n\n};\n\n/**\n * Evaluates the curve at a given time.\n * @function\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion|Number[]} [result] The object onto which to store the result.\n * @returns {Cartesian3|Quaternion|Number[]} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nSpline.prototype.evaluate = DeveloperError.throwInstantiationError;\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n *\n * @param {Number} time The time.\n * @param {Number} startIndex The index from which to start the search.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nSpline.prototype.findTimeInterval = function (time, startIndex) {\n const times = this.times;\n const length = times.length;\n\n // Take advantage of temporal coherence by checking current, next and previous intervals\n // for containment of time.\n startIndex = defaultValue(startIndex, 0);\n\n if (time >= times[startIndex]) {\n if (startIndex + 1 < length && time < times[startIndex + 1]) {\n return startIndex;\n } else if (startIndex + 2 < length && time < times[startIndex + 2]) {\n return startIndex + 1;\n }\n } else if (startIndex - 1 >= 0 && time >= times[startIndex - 1]) {\n return startIndex - 1;\n }\n\n // The above failed so do a linear search. For the use cases so far, the\n // length of the list is less than 10. In the future, if there is a bottle neck,\n // it might be here.\n\n let i;\n if (time > times[startIndex]) {\n for (i = startIndex; i < length - 1; ++i) {\n if (time >= times[i] && time < times[i + 1]) {\n break;\n }\n }\n } else {\n for (i = startIndex - 1; i >= 0; --i) {\n if (time >= times[i] && time < times[i + 1]) {\n break;\n }\n }\n }\n\n if (i === length - 1) {\n i = length - 2;\n }\n\n return i;\n};\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around the animation period.\n */\nSpline.prototype.wrapTime = function (time) {\n const times = this.times;\n const timeEnd = times[times.length - 1];\n const timeStart = times[0];\n const timeStretch = timeEnd - timeStart;\n let divs;\n if (time < timeStart) {\n divs = Math.floor((timeStart - time) / timeStretch) + 1;\n time += divs * timeStretch;\n }\n if (time > timeEnd) {\n divs = Math.floor((time - timeEnd) / timeStretch) + 1;\n time -= divs * timeStretch;\n }\n return time;\n};\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nSpline.prototype.clampTime = function (time) {\n const times = this.times;\n return CesiumMath.clamp(time, times[0], times[times.length - 1]);\n};\n\nexport default Spline;\n", "import Check from \"./Check.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that evaluates to a constant value. Although this follows the {@link Spline} interface,\n * it does not maintain an internal array of times since its value never changes.\n *\n * @alias ConstantSpline\n * @constructor\n *\n * @param {Number|Cartesian3|Quaternion} value The constant value that the spline evaluates to.\n *\n * @example\n * const position = new Cesium.Cartesian3(1.0, 2.0, 3.0);\n * const spline = new Cesium.ConstantSpline(position);\n *\n * const p0 = spline.evaluate(0.0);\n *\n * @see LinearSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction ConstantSpline(value) {\n this._value = value;\n this._valueType = Spline.getPointType(value);\n}\n\nObject.defineProperties(ConstantSpline.prototype, {\n /**\n * The constant value that the spline evaluates to.\n *\n * @memberof ConstantSpline.prototype\n *\n * @type {Number|Cartesian3|Quaternion}\n * @readonly\n */\n value: {\n get: function () {\n return this._value;\n },\n },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n *\n * Since a constant spline has no internal times array, this will throw an error.\n * @function\n *\n * @param {Number} time The time.\n *\n * @exception {DeveloperError} findTimeInterval cannot be called on a ConstantSpline.\n */\nConstantSpline.prototype.findTimeInterval = function (time) {\n};\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nConstantSpline.prototype.wrapTime = function (time) {\n return 0.0;\n};\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nConstantSpline.prototype.clampTime = function (time) {\n return 0.0;\n};\n\n/**\n * Evaluates the curve at a given time.\n * @function\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion} [result] The object onto which to store the result.\n * @returns {Number|Cartesian3|Quaternion} The modified result parameter or the value that the constant spline represents.\n */\nConstantSpline.prototype.evaluate = function (time, result) {\n const value = this._value;\n const ValueType = this._valueType;\n\n if (ValueType === Number) {\n return value;\n }\n\n return ValueType.clone(value, result);\n};\n\nexport default ConstantSpline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that uses piecewise linear interpolation to create a curve.\n *\n * @alias LinearSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n * The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Number[]|Cartesian3[]} options.points The array of control points.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.LinearSpline({\n * times : times,\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction LinearSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const points = options.points;\n const times = options.times;\n\n this._times = times;\n this._points = points;\n this._pointType = Spline.getPointType(points[0]);\n\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(LinearSpline.prototype, {\n /**\n * An array of times for the control points.\n *\n * @memberof LinearSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of {@link Cartesian3} control points.\n *\n * @memberof LinearSpline.prototype\n *\n * @type {Number[]|Cartesian3[]}\n * @readonly\n */\n points: {\n get: function () {\n return this._points;\n },\n },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nLinearSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nLinearSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nLinearSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Number|Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nLinearSpline.prototype.evaluate = function (time, result) {\n const points = this.points;\n const times = this.times;\n\n const i = (this._lastTimeIndex = this.findTimeInterval(\n time,\n this._lastTimeIndex\n ));\n const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n const PointType = this._pointType;\n if (PointType === Number) {\n return (1.0 - u) * points[i] + u * points[i + 1];\n }\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n return Cartesian3.lerp(points[i], points[i + 1], u, result);\n};\n\nexport default LinearSpline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve\n * a system of linear equations where the coefficient matrix is a tridiagonal matrix.\n *\n * @namespace TridiagonalSystemSolver\n */\nconst TridiagonalSystemSolver = {};\n\n/**\n * Solves a tridiagonal system of linear equations.\n *\n * @param {Number[]} diagonal An array with length <code>n</code> that contains the diagonal of the coefficient matrix.\n * @param {Number[]} lower An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.\n * @param {Number[]} upper An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.\n * @param {Cartesian3[]} right An array of Cartesians with length <code>n</code> that is the right side of the system of equations.\n *\n * @exception {DeveloperError} diagonal and right must have the same lengths.\n * @exception {DeveloperError} lower and upper must have the same lengths.\n * @exception {DeveloperError} lower and upper must be one less than the length of diagonal.\n *\n * @performance Linear time.\n *\n * @example\n * const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];\n * const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];\n * const upperDiagonal = [1.0, 1.0, 1.0, 1.0];\n * const rightHandSide = [\n * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),\n * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),\n * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),\n * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),\n * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)\n * ];\n *\n * const solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);\n *\n * @returns {Cartesian3[]} An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.\n */\nTridiagonalSystemSolver.solve = function (lower, diagonal, upper, right) {\n const c = new Array(upper.length);\n const d = new Array(right.length);\n const x = new Array(right.length);\n\n let i;\n for (i = 0; i < d.length; i++) {\n d[i] = new Cartesian3();\n x[i] = new Cartesian3();\n }\n\n c[0] = upper[0] / diagonal[0];\n d[0] = Cartesian3.multiplyByScalar(right[0], 1.0 / diagonal[0], d[0]);\n\n let scalar;\n for (i = 1; i < c.length; ++i) {\n scalar = 1.0 / (diagonal[i] - c[i - 1] * lower[i - 1]);\n c[i] = upper[i] * scalar;\n d[i] = Cartesian3.subtract(\n right[i],\n Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),\n d[i]\n );\n d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]);\n }\n\n scalar = 1.0 / (diagonal[i] - c[i - 1] * lower[i - 1]);\n d[i] = Cartesian3.subtract(\n right[i],\n Cartesian3.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),\n d[i]\n );\n d[i] = Cartesian3.multiplyByScalar(d[i], scalar, d[i]);\n\n x[x.length - 1] = d[d.length - 1];\n for (i = x.length - 2; i >= 0; --i) {\n x[i] = Cartesian3.subtract(\n d[i],\n Cartesian3.multiplyByScalar(x[i + 1], c[i], x[i]),\n x[i]\n );\n }\n\n return x;\n};\nexport default TridiagonalSystemSolver;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport LinearSpline from \"./LinearSpline.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Spline from \"./Spline.js\";\nimport TridiagonalSystemSolver from \"./TridiagonalSystemSolver.js\";\n\nconst scratchLower = [];\nconst scratchDiagonal = [];\nconst scratchUpper = [];\nconst scratchRight = [];\n\nfunction generateClamped(points, firstTangent, lastTangent) {\n const l = scratchLower;\n const u = scratchUpper;\n const d = scratchDiagonal;\n const r = scratchRight;\n\n l.length = u.length = points.length - 1;\n d.length = r.length = points.length;\n\n let i;\n l[0] = d[0] = 1.0;\n u[0] = 0.0;\n\n let right = r[0];\n if (!defined(right)) {\n right = r[0] = new Cartesian3();\n }\n Cartesian3.clone(firstTangent, right);\n\n for (i = 1; i < l.length - 1; ++i) {\n l[i] = u[i] = 1.0;\n d[i] = 4.0;\n\n right = r[i];\n if (!defined(right)) {\n right = r[i] = new Cartesian3();\n }\n Cartesian3.subtract(points[i + 1], points[i - 1], right);\n Cartesian3.multiplyByScalar(right, 3.0, right);\n }\n\n l[i] = 0.0;\n u[i] = 1.0;\n d[i] = 4.0;\n\n right = r[i];\n if (!defined(right)) {\n right = r[i] = new Cartesian3();\n }\n Cartesian3.subtract(points[i + 1], points[i - 1], right);\n Cartesian3.multiplyByScalar(right, 3.0, right);\n\n d[i + 1] = 1.0;\n right = r[i + 1];\n if (!defined(right)) {\n right = r[i + 1] = new Cartesian3();\n }\n Cartesian3.clone(lastTangent, right);\n\n return TridiagonalSystemSolver.solve(l, d, u, r);\n}\n\nfunction generateNatural(points) {\n const l = scratchLower;\n const u = scratchUpper;\n const d = scratchDiagonal;\n const r = scratchRight;\n\n l.length = u.length = points.length - 1;\n d.length = r.length = points.length;\n\n let i;\n l[0] = u[0] = 1.0;\n d[0] = 2.0;\n\n let right = r[0];\n if (!defined(right)) {\n right = r[0] = new Cartesian3();\n }\n Cartesian3.subtract(points[1], points[0], right);\n Cartesian3.multiplyByScalar(right, 3.0, right);\n\n for (i = 1; i < l.length; ++i) {\n l[i] = u[i] = 1.0;\n d[i] = 4.0;\n\n right = r[i];\n if (!defined(right)) {\n right = r[i] = new Cartesian3();\n }\n Cartesian3.subtract(points[i + 1], points[i - 1], right);\n Cartesian3.multiplyByScalar(right, 3.0, right);\n }\n\n d[i] = 2.0;\n\n right = r[i];\n if (!defined(right)) {\n right = r[i] = new Cartesian3();\n }\n Cartesian3.subtract(points[i], points[i - 1], right);\n Cartesian3.multiplyByScalar(right, 3.0, right);\n\n return TridiagonalSystemSolver.solve(l, d, u, r);\n}\n\n/**\n * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times\n * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming\n * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and\n * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,\n * respectively.\n *\n * @alias HermiteSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n * The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3[]} options.inTangents The array of incoming tangents at each control point.\n * @param {Cartesian3[]} options.outTangents The array of outgoing tangents at each control point.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n * @exception {DeveloperError} inTangents and outTangents must have a length equal to points.length - 1.\n * @exception {DeveloperError} inTangents and outTangents must be of the same type as points.\n *\n * @example\n * // Create a G<sup>1</sup> continuous Hermite spline\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.HermiteSpline({\n * times : times,\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ],\n * outTangents : [\n * new Cesium.Cartesian3(1125196, -161816, 270551),\n * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),\n * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),\n * new Cesium.Cartesian3(-890902.5, 408999.5, -447115)\n * ],\n * inTangents : [\n * new Cesium.Cartesian3(-1993381, -731813, 368057),\n * new Cesium.Cartesian3(-4193834, 96759, -585367),\n * new Cesium.Cartesian3(-1781805, 817999, -894230),\n * new Cesium.Cartesian3(1165345, 112641, 47281)\n * ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see LinearSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction HermiteSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const points = options.points;\n const times = options.times;\n const inTangents = options.inTangents;\n const outTangents = options.outTangents;\n\n this._times = times;\n this._points = points;\n this._pointType = Spline.getPointType(points[0]);\n this._inTangents = inTangents;\n this._outTangents = outTangents;\n\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(HermiteSpline.prototype, {\n /**\n * An array of times for the control points.\n *\n * @memberof HermiteSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of control points.\n *\n * @memberof HermiteSpline.prototype\n *\n * @type {Cartesian3[]}\n * @readonly\n */\n points: {\n get: function () {\n return this._points;\n },\n },\n\n /**\n * An array of incoming tangents at each control point.\n *\n * @memberof HermiteSpline.prototype\n *\n * @type {Cartesian3[]}\n * @readonly\n */\n inTangents: {\n get: function () {\n return this._inTangents;\n },\n },\n\n /**\n * An array of outgoing tangents at each control point.\n *\n * @memberof HermiteSpline.prototype\n *\n * @type {Cartesian3[]}\n * @readonly\n */\n outTangents: {\n get: function () {\n return this._outTangents;\n },\n },\n});\n\n/**\n * Creates a spline where the tangents at each control point are the same.\n * The curves are guaranteed to be at least in the class C<sup>1</sup>.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times The array of control point times.\n * @param {Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3[]} options.tangents The array of tangents at the control points.\n * @returns {HermiteSpline} A hermite spline.\n *\n * @exception {DeveloperError} points, times and tangents are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times, points and tangents must have the same length.\n *\n * @example\n * const points = [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ];\n *\n * // Add tangents\n * const tangents = new Array(points.length);\n * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);\n * const temp = new Cesium.Cartesian3();\n * for (let i = 1; i < tangents.length - 1; ++i) {\n * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());\n * }\n * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);\n *\n * const spline = Cesium.HermiteSpline.createC1({\n * times : times,\n * points : points,\n * tangents : tangents\n * });\n */\nHermiteSpline.createC1 = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const times = options.times;\n const points = options.points;\n const tangents = options.tangents;\n\n const outTangents = tangents.slice(0, tangents.length - 1);\n const inTangents = tangents.slice(1, tangents.length);\n\n return new HermiteSpline({\n times: times,\n points: points,\n inTangents: inTangents,\n outTangents: outTangents,\n });\n};\n\n/**\n * Creates a natural cubic spline. The tangents at the control points are generated\n * to create a curve in the class C<sup>2</sup>.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times The array of control point times.\n * @param {Cartesian3[]} options.points The array of control points.\n * @returns {HermiteSpline|LinearSpline} A hermite spline, or a linear spline if less than 3 control points were given.\n *\n * @exception {DeveloperError} points and times are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n * @example\n * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.\n * const spline = Cesium.HermiteSpline.createNaturalCubic({\n * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ]\n * });\n */\nHermiteSpline.createNaturalCubic = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const times = options.times;\n const points = options.points;\n\n if (points.length < 3) {\n return new LinearSpline({\n points: points,\n times: times,\n });\n }\n\n const tangents = generateNatural(points);\n const outTangents = tangents.slice(0, tangents.length - 1);\n const inTangents = tangents.slice(1, tangents.length);\n\n return new HermiteSpline({\n times: times,\n points: points,\n inTangents: inTangents,\n outTangents: outTangents,\n });\n};\n\n/**\n * Creates a clamped cubic spline. The tangents at the interior control points are generated\n * to create a curve in the class C<sup>2</sup>.\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times The array of control point times.\n * @param {Number[]|Cartesian3[]} options.points The array of control points.\n * @param {Cartesian3} options.firstTangent The outgoing tangent of the first control point.\n * @param {Cartesian3} options.lastTangent The incoming tangent of the last control point.\n * @returns {HermiteSpline|LinearSpline} A hermite spline, or a linear spline if less than 3 control points were given.\n *\n * @exception {DeveloperError} points, times, firstTangent and lastTangent are required.\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n * @exception {DeveloperError} firstTangent and lastTangent must be of the same type as points.\n *\n * @example\n * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.\n * const spline = Cesium.HermiteSpline.createClampedCubic({\n * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ],\n * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),\n * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)\n * });\n */\nHermiteSpline.createClampedCubic = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const times = options.times;\n const points = options.points;\n const firstTangent = options.firstTangent;\n const lastTangent = options.lastTangent;\n\n const PointType = Spline.getPointType(points[0]);\n\n if (points.length < 3) {\n return new LinearSpline({\n points: points,\n times: times,\n });\n }\n\n const tangents = generateClamped(points, firstTangent, lastTangent);\n const outTangents = tangents.slice(0, tangents.length - 1);\n const inTangents = tangents.slice(1, tangents.length);\n\n return new HermiteSpline({\n times: times,\n points: points,\n inTangents: inTangents,\n outTangents: outTangents,\n });\n};\n\n//prettier-ignore\nHermiteSpline.hermiteCoefficientMatrix = new Matrix4(\n 2.0, -3.0, 0.0, 1.0,\n -2.0, 3.0, 0.0, 0.0,\n 1.0, -2.0, 1.0, 0.0,\n 1.0, -1.0, 0.0, 0.0\n);\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nHermiteSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\nconst scratchTimeVec = new Cartesian4();\nconst scratchTemp = new Cartesian3();\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nHermiteSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nHermiteSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nHermiteSpline.prototype.evaluate = function (time, result) {\n const points = this.points;\n const times = this.times;\n const inTangents = this.inTangents;\n const outTangents = this.outTangents;\n\n this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);\n const i = this._lastTimeIndex;\n\n const timesDelta = times[i + 1] - times[i];\n const u = (time - times[i]) / timesDelta;\n\n const timeVec = scratchTimeVec;\n timeVec.z = u;\n timeVec.y = u * u;\n timeVec.x = timeVec.y * u;\n timeVec.w = 1.0;\n\n // Coefficients are returned in the following order:\n // start, end, out-tangent, in-tangent\n const coefs = Matrix4.multiplyByVector(\n HermiteSpline.hermiteCoefficientMatrix,\n timeVec,\n timeVec\n );\n\n // Multiply the out-tangent and in-tangent values by the time delta.\n coefs.z *= timesDelta;\n coefs.w *= timesDelta;\n\n const PointType = this._pointType;\n\n if (PointType === Number) {\n return (\n points[i] * coefs.x +\n points[i + 1] * coefs.y +\n outTangents[i] * coefs.z +\n inTangents[i] * coefs.w\n );\n }\n\n if (!defined(result)) {\n result = new PointType();\n }\n\n result = PointType.multiplyByScalar(points[i], coefs.x, result);\n PointType.multiplyByScalar(points[i + 1], coefs.y, scratchTemp);\n PointType.add(result, scratchTemp, result);\n PointType.multiplyByScalar(outTangents[i], coefs.z, scratchTemp);\n PointType.add(result, scratchTemp, result);\n PointType.multiplyByScalar(inTangents[i], coefs.w, scratchTemp);\n return PointType.add(result, scratchTemp, result);\n};\nexport default HermiteSpline;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that is composed of piecewise constants representing a step function.\n *\n * @alias SteppedSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Number[]|Cartesian3[]|Quaternion[]} options.points The array of control points.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const spline = new Cesium.SteppedSpline({\n * times : times,\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ]\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see CatmullRomSpline\n * @see HermiteSpline\n * @see LinearSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction SteppedSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const points = options.points;\n const times = options.times;\n\n this._times = times;\n this._points = points;\n this._pointType = Spline.getPointType(points[0]);\n\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(SteppedSpline.prototype, {\n /**\n * An array of times for the control points.\n *\n * @memberof SteppedSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of control points.\n *\n * @memberof SteppedSpline.prototype\n *\n * @type {Number[]|Cartesian3[]|Quaternion[]}\n * @readonly\n */\n points: {\n get: function () {\n return this._points;\n },\n },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @param {Number} startIndex The index from which to start the search.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nSteppedSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nSteppedSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nSteppedSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3|Quaternion} [result] The object onto which to store the result.\n * @returns {Number|Cartesian3|Quaternion} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nSteppedSpline.prototype.evaluate = function (time, result) {\n const points = this.points;\n\n this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);\n const i = this._lastTimeIndex;\n\n const PointType = this._pointType;\n if (PointType === Number) {\n return points[i];\n }\n\n if (!defined(result)) {\n result = new PointType();\n }\n\n return PointType.clone(points[i], result);\n};\n\nexport default SteppedSpline;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Spline from \"./Spline.js\";\n\nfunction createEvaluateFunction(spline) {\n const points = spline.points;\n const times = spline.times;\n\n // use slerp interpolation\n return function (time, result) {\n if (!defined(result)) {\n result = new Quaternion();\n }\n const i = (spline._lastTimeIndex = spline.findTimeInterval(\n time,\n spline._lastTimeIndex\n ));\n const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n const q0 = points[i];\n const q1 = points[i + 1];\n\n return Quaternion.fastSlerp(q0, q1, u, result);\n };\n}\n\n/**\n * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.\n * The generated curve is in the class C<sup>1</sup>.\n *\n * @alias QuaternionSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n * The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Quaternion[]} options.points The array of {@link Quaternion} control points.\n *\n * @exception {DeveloperError} points and times are required\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see LinearSpline\n * @see MorphWeightSpline\n */\nfunction QuaternionSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const points = options.points;\n const times = options.times;\n\n this._times = times;\n this._points = points;\n\n this._evaluateFunction = createEvaluateFunction(this);\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(QuaternionSpline.prototype, {\n /**\n * An array of times for the control points.\n *\n * @memberof QuaternionSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of {@link Quaternion} control points.\n *\n * @memberof QuaternionSpline.prototype\n *\n * @type {Quaternion[]}\n * @readonly\n */\n points: {\n get: function () {\n return this._points;\n },\n },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nQuaternionSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nQuaternionSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nQuaternionSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Quaternion} [result] The object onto which to store the result.\n * @returns {Quaternion} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nQuaternionSpline.prototype.evaluate = function (time, result) {\n return this._evaluateFunction(time, result);\n};\nexport default QuaternionSpline;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport ConstantSpline from \"../../Core/ConstantSpline.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport HermiteSpline from \"../../Core/HermiteSpline.js\";\nimport InterpolationType from \"../../Core/InterpolationType.js\";\nimport LinearSpline from \"../../Core/LinearSpline.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport SteppedSpline from \"../../Core/SteppedSpline.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport QuaternionSpline from \"../../Core/QuaternionSpline.js\";\n\nconst AnimatedPropertyType = ModelComponents.AnimatedPropertyType;\n\n/**\n * A runtime animation channel for a {@link ModelAnimation}. An animation\n * channel is responsible for interpolating between the keyframe values of an animated\n * property, then applying the change to the target node.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.AnimationChannel} options.channel The corresponding animation channel components from the 3D model.\n * @param {ModelAnimation} options.runtimeAnimation The runtime animation containing this channel.\n * @param {ModelRuntimeNode} options.runtimeNode The runtime node that this channel will animate.\n *\n * @alias ModelAnimationChannel\n * @constructor\n *\n * @private\n */\nfunction ModelAnimationChannel(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const channel = options.channel;\n const runtimeAnimation = options.runtimeAnimation;\n const runtimeNode = options.runtimeNode;\n this._channel = channel;\n this._runtimeAnimation = runtimeAnimation;\n this._runtimeNode = runtimeNode;\n\n // An animation channel can have multiple splines if it animates\n // a node's morph weights, which will involve multiple morph targets.\n this._splines = [];\n this._path = undefined;\n\n initialize(this);\n}\n\nObject.defineProperties(ModelAnimationChannel.prototype, {\n /**\n * The glTF animation channel.\n *\n * @memberof ModelAnimationChannel.prototype\n *\n * @type {ModelComponents.AnimationChannel}\n * @readonly\n *\n * @private\n */\n channel: {\n get: function () {\n return this._channel;\n },\n },\n\n /**\n * The runtime animation that owns this channel.\n *\n * @memberof ModelAnimationChannel.prototype\n *\n * @type {ModelAnimation}\n * @readonly\n *\n * @private\n */\n runtimeAnimation: {\n get: function () {\n return this._runtimeAnimation;\n },\n },\n\n /**\n * The runtime node that this channel animates.\n *\n * @memberof ModelAnimationChannel.prototype\n *\n * @type {ModelRuntimeNode}\n * @readonly\n *\n * @private\n */\n runtimeNode: {\n get: function () {\n return this._runtimeNode;\n },\n },\n\n /**\n * The splines used to evaluate this animation channel.\n *\n * @memberof ModelAnimationChannel.prototype\n *\n * @type {Spline[]}\n * @readonly\n *\n * @private\n */\n splines: {\n get: function () {\n return this._splines;\n },\n },\n});\n\nfunction createCubicSpline(times, points) {\n const cubicPoints = [];\n const inTangents = [];\n const outTangents = [];\n\n const length = points.length;\n for (let i = 0; i < length; i += 3) {\n inTangents.push(points[i]);\n cubicPoints.push(points[i + 1]);\n outTangents.push(points[i + 2]);\n }\n\n // Remove the first in-tangent and last out-tangent, since they\n // are not used in the spline calculations\n inTangents.splice(0, 1);\n outTangents.length = outTangents.length - 1;\n\n return new HermiteSpline({\n times: times,\n points: cubicPoints,\n inTangents: inTangents,\n outTangents: outTangents,\n });\n}\n\nfunction createSpline(times, points, interpolation, path) {\n if (times.length === 1 && points.length === 1) {\n return new ConstantSpline(points[0]);\n }\n\n switch (interpolation) {\n case InterpolationType.STEP:\n return new SteppedSpline({\n times: times,\n points: points,\n });\n case InterpolationType.CUBICSPLINE:\n return createCubicSpline(times, points);\n case InterpolationType.LINEAR:\n if (path === AnimatedPropertyType.ROTATION) {\n return new QuaternionSpline({\n times: times,\n points: points,\n });\n }\n return new LinearSpline({\n times: times,\n points: points,\n });\n }\n}\n\nfunction createSplines(times, points, interpolation, path, count) {\n const splines = [];\n if (path === AnimatedPropertyType.WEIGHTS) {\n const pointsLength = points.length;\n // Get the number of keyframes in each weight's output.\n const outputLength = pointsLength / count;\n\n // Iterate over the array using the number of morph targets in the model.\n let targetIndex, i;\n for (targetIndex = 0; targetIndex < count; targetIndex++) {\n const output = new Array(outputLength);\n\n // Weights are ordered such that they are keyframed in the order in which\n // their targets appear the glTF. For example, the weights of three targets\n // may appear as [w(0,0), w(0,1), w(0,2), w(1,0), w(1,1), w(1,2) ...],\n // where i and j in w(i,j) are the time indices and target indices, respectively.\n\n // However, for morph targets with cubic interpolation, the data is stored per\n // keyframe in the order [a1, a2, ..., an, v1, v2, ... vn, b1, b2, ..., bn],\n // where ai, vi, and bi are the in-tangent, property, and out-tangents of\n // the ith morph target respectively.\n let pointsIndex = targetIndex;\n if (interpolation === InterpolationType.CUBICSPLINE) {\n for (i = 0; i < outputLength; i += 3) {\n output[i] = points[pointsIndex];\n output[i + 1] = points[pointsIndex + count];\n output[i + 2] = points[pointsIndex + 2 * count];\n pointsIndex += count * 3;\n }\n } else {\n for (i = 0; i < outputLength; i++) {\n output[i] = points[pointsIndex];\n pointsIndex += count;\n }\n }\n\n splines.push(createSpline(times, output, interpolation, path));\n }\n } else {\n splines.push(createSpline(times, points, interpolation, path));\n }\n\n return splines;\n}\n\nlet scratchVariable;\n\nfunction initialize(runtimeChannel) {\n const channel = runtimeChannel._channel;\n\n const sampler = channel.sampler;\n const times = sampler.input;\n const points = sampler.output;\n\n const interpolation = sampler.interpolation;\n const target = channel.target;\n const path = target.path;\n\n const runtimeNode = runtimeChannel._runtimeNode;\n const count = defined(runtimeNode.morphWeights)\n ? runtimeNode.morphWeights.length\n : 1;\n const splines = createSplines(times, points, interpolation, path, count);\n\n runtimeChannel._splines = splines;\n runtimeChannel._path = path;\n\n switch (path) {\n case AnimatedPropertyType.TRANSLATION:\n case AnimatedPropertyType.SCALE:\n scratchVariable = new Cartesian3();\n break;\n case AnimatedPropertyType.ROTATION:\n scratchVariable = new Quaternion();\n break;\n case AnimatedPropertyType.WEIGHTS:\n // This is unused when setting a node's morph weights.\n break;\n }\n}\n\n/**\n * Animates the target node property based on its spline.\n *\n * @param {Number} time The local animation time.\n *\n * @private\n */\nModelAnimationChannel.prototype.animate = function (time) {\n const splines = this._splines;\n const path = this._path;\n const model = this._runtimeAnimation.model;\n const runtimeNode = this._runtimeNode;\n\n // Weights are handled differently than the other properties because\n // they need to be updated in place.\n if (path === AnimatedPropertyType.WEIGHTS) {\n const morphWeights = runtimeNode.morphWeights;\n const length = morphWeights.length;\n for (let i = 0; i < length; i++) {\n const spline = splines[i];\n const localAnimationTime = model.clampAnimations\n ? spline.clampTime(time)\n : spline.wrapTime(time);\n morphWeights[i] = spline.evaluate(localAnimationTime);\n }\n } else if (runtimeNode.userAnimated) {\n // If the node is being animated externally, ignore the glTF animation.\n return;\n } else {\n const spline = splines[0];\n const localAnimationTime = model.clampAnimations\n ? spline.clampTime(time)\n : spline.wrapTime(time);\n\n // This sets the translate, rotate, and scale properties.\n runtimeNode[path] = spline.evaluate(localAnimationTime, scratchVariable);\n }\n};\n\nexport default ModelAnimationChannel;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Event from \"../../Core/Event.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport ModelAnimationLoop from \"../ModelAnimationLoop.js\";\nimport ModelAnimationState from \"../ModelAnimationState.js\";\nimport ModelAnimationChannel from \"./ModelAnimationChannel.js\";\n\n/**\n * <div class=\"notice\">\n * Create animations by calling {@link ModelAnimationCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * An active animation derived from a glTF asset. An active animation is an\n * animation that is either currently playing or scheduled to be played due to\n * being added to a model's {@link ModelAnimationCollection}. An active animation\n * is an instance of an animation; for example, there can be multiple active\n * animations for the same glTF animation, each with a different start time.\n *\n * @alias ModelAnimation\n * @internalConstructor\n * @class\n *\n * @see ModelAnimationCollection#add\n */\nfunction ModelAnimation(model, animation, options) {\n this._animation = animation;\n this._name = animation.name;\n this._runtimeChannels = undefined;\n\n this._startTime = JulianDate.clone(options.startTime);\n this._delay = defaultValue(options.delay, 0.0); // in seconds\n this._stopTime = JulianDate.clone(options.stopTime);\n\n /**\n * When <code>true</code>, the animation is removed after it stops playing.\n * This is slightly more efficient that not removing it, but if, for example,\n * time is reversed, the animation is not played again.\n *\n * @type {Boolean}\n * @default false\n */\n this.removeOnStop = defaultValue(options.removeOnStop, false);\n this._multiplier = defaultValue(options.multiplier, 1.0);\n this._reverse = defaultValue(options.reverse, false);\n this._loop = defaultValue(options.loop, ModelAnimationLoop.NONE);\n this._animationTime = options.animationTime;\n this._prevAnimationDelta = undefined;\n\n /**\n * The event fired when this animation is started. This can be used, for\n * example, to play a sound or start a particle system, when the animation starts.\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * animation.start.addEventListener(function(model, animation) {\n * console.log(`Animation started: ${animation.name}`);\n * });\n */\n this.start = new Event();\n\n /**\n * The event fired when on each frame when this animation is updated. The\n * current time of the animation, relative to the glTF animation time span, is\n * passed to the event, which allows, for example, starting new animations at a\n * specific time relative to a playing animation.\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * animation.update.addEventListener(function(model, animation, time) {\n * console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`);\n * });\n */\n this.update = new Event();\n\n /**\n * The event fired when this animation is stopped. This can be used, for\n * example, to play a sound or start a particle system, when the animation stops.\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * animation.stop.addEventListener(function(model, animation) {\n * console.log(`Animation stopped: ${animation.name}`);\n * });\n */\n this.stop = new Event();\n\n this._state = ModelAnimationState.STOPPED;\n\n // Set during animation update\n this._computedStartTime = undefined;\n this._duration = undefined;\n\n // To avoid allocations in ModelAnimationCollection.update\n const that = this;\n this._raiseStartEvent = function () {\n that.start.raiseEvent(model, that);\n };\n this._updateEventTime = 0.0;\n this._raiseUpdateEvent = function () {\n that.update.raiseEvent(model, that, that._updateEventTime);\n };\n this._raiseStopEvent = function () {\n that.stop.raiseEvent(model, that);\n };\n\n this._model = model;\n\n this._localStartTime = undefined;\n this._localStopTime = undefined;\n\n initialize(this);\n}\n\nObject.defineProperties(ModelAnimation.prototype, {\n /**\n * The glTF animation.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {ModelComponents.Animation}\n * @readonly\n *\n * @private\n */\n animation: {\n get: function () {\n return this._animation;\n },\n },\n\n /**\n * The name that identifies this animation in the model, if it exists.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {String}\n * @readonly\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The runtime animation channels for this animation.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {ModelAnimationChannel[]}\n * @readonly\n *\n * @private\n */\n runtimeChannels: {\n get: function () {\n return this._runtimeChannels;\n },\n },\n\n /**\n * The {@link Model} that owns this animation.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Model}\n * @readonly\n *\n * @private\n */\n model: {\n get: function () {\n return this._model;\n },\n },\n\n /**\n * The starting point of the animation in local animation time. This is the minimum\n * time value across all of the keyframes belonging to this animation.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n localStartTime: {\n get: function () {\n return this._localStartTime;\n },\n },\n\n /**\n * The stopping point of the animation in local animation time. This is the maximum\n * time value across all of the keyframes belonging to this animation.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n localStopTime: {\n get: function () {\n return this._localStopTime;\n },\n },\n\n /**\n * The scene time to start playing this animation. When this is <code>undefined</code>,\n * the animation starts at the next frame.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {JulianDate}\n * @readonly\n *\n * @default undefined\n */\n startTime: {\n get: function () {\n return this._startTime;\n },\n },\n\n /**\n * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default undefined\n */\n delay: {\n get: function () {\n return this._delay;\n },\n },\n\n /**\n * The scene time to stop playing this animation. When this is <code>undefined</code>,\n * the animation is played for its full duration and perhaps repeated depending on\n * {@link ModelAnimation#loop}.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {JulianDate}\n * @readonly\n *\n * @default undefined\n */\n stopTime: {\n get: function () {\n return this._stopTime;\n },\n },\n\n /**\n * Values greater than <code>1.0</code> increase the speed that the animation is played relative\n * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of\n * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene\n * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation\n * will play in one second even if <code>multiplier</code> is <code>1.0</code>.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @default 1.0\n */\n multiplier: {\n get: function () {\n return this._multiplier;\n },\n },\n\n /**\n * When <code>true</code>, the animation is played in reverse.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n reverse: {\n get: function () {\n return this._reverse;\n },\n },\n\n /**\n * Determines if and how the animation is looped.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {ModelAnimationLoop}\n * @readonly\n *\n * @default {@link ModelAnimationLoop.NONE}\n */\n loop: {\n get: function () {\n return this._loop;\n },\n },\n\n /**\n * If this is defined, it will be used to compute the local animation time\n * instead of the scene's time.\n *\n * @memberof ModelAnimation.prototype\n *\n * @type {ModelAnimation.AnimationTimeCallback}\n * @default undefined\n */\n animationTime: {\n get: function () {\n return this._animationTime;\n },\n },\n});\n\nfunction initialize(runtimeAnimation) {\n let localStartTime = Number.MAX_VALUE;\n let localStopTime = -Number.MAX_VALUE;\n\n const sceneGraph = runtimeAnimation._model.sceneGraph;\n const animation = runtimeAnimation._animation;\n const channels = animation.channels;\n const length = channels.length;\n\n const runtimeChannels = [];\n for (let i = 0; i < length; i++) {\n const channel = channels[i];\n const target = channel.target;\n\n // Ignore this channel if the target is invalid, i.e. if the node\n // it references doesn't exist.\n if (!defined(target)) {\n continue;\n }\n\n const nodeIndex = target.node.index;\n const runtimeNode = sceneGraph._runtimeNodes[nodeIndex];\n\n const runtimeChannel = new ModelAnimationChannel({\n channel: channel,\n runtimeAnimation: runtimeAnimation,\n runtimeNode: runtimeNode,\n });\n\n const times = channel.sampler.input;\n localStartTime = Math.min(localStartTime, times[0]);\n localStopTime = Math.max(localStopTime, times[times.length - 1]);\n\n runtimeChannels.push(runtimeChannel);\n }\n\n runtimeAnimation._runtimeChannels = runtimeChannels;\n runtimeAnimation._localStartTime = localStartTime;\n runtimeAnimation._localStopTime = localStopTime;\n}\n\n/**\n * Evaluate all animation channels to advance this animation.\n *\n * @param {Number} time The local animation time.\n *\n * @private\n */\nModelAnimation.prototype.animate = function (time) {\n const runtimeChannels = this._runtimeChannels;\n const length = runtimeChannels.length;\n for (let i = 0; i < length; i++) {\n runtimeChannels[i].animate(time);\n }\n};\n\n/**\n * A function used to compute the local animation time for a ModelAnimation.\n * @callback ModelAnimation.AnimationTimeCallback\n *\n * @param {Number} duration The animation's original duration in seconds.\n * @param {Number} seconds The seconds since the animation started, in scene time.\n * @returns {Number} Returns the local animation time.\n *\n * @example\n * // Use real time for model animation (assuming animateWhilePaused was set to true)\n * function animationTime(duration) {\n * return Date.now() / 1000 / duration;\n * }\n *\n * @example\n * // Offset the phase of the animation, so it starts halfway through its cycle.\n * function animationTime(duration, seconds) {\n * return seconds / duration + 0.5;\n * }\n */\nexport default ModelAnimation;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Event from \"../../Core/Event.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport ModelAnimation from \"./ModelAnimation.js\";\nimport ModelAnimationLoop from \".././ModelAnimationLoop.js\";\nimport ModelAnimationState from \".././ModelAnimationState.js\";\n\n/**\n * <div class=\"notice\">\n * Access a model's animations {@link Model#activeAnimations}. Do not call the constructor directly\n * </div>\n *\n * A collection of active model animations.\n *\n * @alias ModelAnimationCollection\n * @internalConstructor\n * @class\n *\n * @see Model#activeAnimations\n */\nfunction ModelAnimationCollection(model) {\n /**\n * The event fired when an animation is added to the collection. This can be used, for\n * example, to keep a UI in sync.\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {\n * console.log(`Animation added: ${animation.name}`);\n * });\n */\n this.animationAdded = new Event();\n\n /**\n * The event fired when an animation is removed from the collection. This can be used, for\n * example, to keep a UI in sync.\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {\n * console.log(`Animation removed: ${animation.name}`);\n * });\n */\n this.animationRemoved = new Event();\n\n /**\n * When true, the animation will play even when the scene time is paused. However,\n * whether animation takes place will depend on the animationTime functions assigned\n * to the model's animations. By default, this is based on scene time, so models using\n * the default will not animate regardless of this setting.\n *\n * @type {Boolean}\n * @default false\n */\n this.animateWhilePaused = false;\n\n this._model = model;\n this._runtimeAnimations = [];\n this._previousTime = undefined;\n}\n\nObject.defineProperties(ModelAnimationCollection.prototype, {\n /**\n * The number of animations in the collection.\n *\n * @memberof ModelAnimationCollection.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._runtimeAnimations.length;\n },\n },\n\n /**\n * The model that owns this animation collection.\n *\n * @memberof ModelAnimationCollection.prototype\n *\n * @type {Model}\n * @readonly\n */\n model: {\n get: function () {\n return this._model;\n },\n },\n});\n\nfunction addAnimation(collection, animation, options) {\n const model = collection._model;\n const runtimeAnimation = new ModelAnimation(model, animation, options);\n collection._runtimeAnimations.push(runtimeAnimation);\n collection.animationAdded.raiseEvent(model, runtimeAnimation);\n return runtimeAnimation;\n}\n\n/**\n * Creates and adds an animation with the specified initial properties to the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} [options.name] The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.\n * @param {Number} [options.index] The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.\n * @param {JulianDate} [options.startTime] The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.\n * @param {Number} [options.delay=0.0] The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {JulianDate} [options.stopTime] The scene time to stop playing the animation. When this is <code>undefined</code>, the animation is played for its full duration.\n * @param {Boolean} [options.removeOnStop=false] When <code>true</code>, the animation is removed after it stops playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {Number} [options.multiplier=1.0] Values greater than <code>1.0</code> increase the speed that the animation is played relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.\n * @param {Boolean} [options.reverse=false] When <code>true</code>, the animation is played in reverse.\n * @param {ModelAnimationLoop} [options.loop=ModelAnimationLoop.NONE] Determines if and how the animation is looped.\n * @param {ModelAnimation.AnimationTimeCallback} [options.animationTime=undefined] If defined, computes the local animation time for this animation.\n * @returns {ModelAnimation} The animation that was added to the collection.\n *\n * @exception {DeveloperError} Animations are not loaded. Wait for the {@link Model#readyPromise} to resolve.\n * @exception {DeveloperError} options.name must be a valid animation name.\n * @exception {DeveloperError} options.index must be a valid animation index.\n * @exception {DeveloperError} Either options.name or options.index must be defined.\n * @exception {DeveloperError} options.multiplier must be greater than zero.\n *\n * @example\n * // Example 1. Add an animation by name\n * model.activeAnimations.add({\n * name : 'animation name'\n * });\n *\n * @example\n * // Example 2. Add an animation by index\n * model.activeAnimations.add({\n * index : 0\n * });\n *\n * @example\n * // Example 3. Add an animation and provide all properties and events\n * const startTime = Cesium.JulianDate.now();\n *\n * const animation = model.activeAnimations.add({\n * name : 'another animation name',\n * startTime : startTime,\n * delay : 0.0, // Play at startTime (default)\n * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),\n * removeOnStop : false, // Do not remove when animation stops (default)\n * multiplier : 2.0, // Play at double speed\n * reverse : true, // Play in reverse\n * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation\n * });\n *\n * animation.start.addEventListener(function(model, animation) {\n * console.log(`Animation started: ${animation.name}`);\n * });\n * animation.update.addEventListener(function(model, animation, time) {\n * console.log(`Animation updated: ${animation.name}. glTF animation time: ${time}`);\n * });\n * animation.stop.addEventListener(function(model, animation) {\n * console.log(`Animation stopped: ${animation.name}`);\n * });\n */\nModelAnimationCollection.prototype.add = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const model = this._model;\n\n const animations = model.sceneGraph.components.animations;\n\n let index = options.index;\n if (defined(index)) {\n return addAnimation(this, animations[index], options);\n }\n\n // Find the index of the animation with the given name\n const length = animations.length;\n for (let i = 0; i < length; ++i) {\n if (animations[i].name === options.name) {\n index = i;\n break;\n }\n }\n\n return addAnimation(this, animations[index], options);\n};\n\n/**\n * Creates and adds animations with the specified initial properties to the collection\n * for all animations in the model.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.\n * </p>\n *\n * @param {Object} [options] Object with the following properties:\n * @param {JulianDate} [options.startTime] The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.\n * @param {Number} [options.delay=0.0] The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {JulianDate} [options.stopTime] The scene time to stop playing the animations. When this is <code>undefined</code>, the animations are played for its full duration.\n * @param {Boolean} [options.removeOnStop=false] When <code>true</code>, the animations are removed after they stop playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.\n * @param {Number} [options.multiplier=1.0] Values greater than <code>1.0</code> increase the speed that the animations play relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.\n * @param {Boolean} [options.reverse=false] When <code>true</code>, the animations are played in reverse.\n * @param {ModelAnimationLoop} [options.loop=ModelAnimationLoop.NONE] Determines if and how the animations are looped.\n * @param {ModelAnimation.AnimationTimeCallback} [options.animationTime=undefined] If defined, computes the local animation time for all of the animations.\n * @returns {ModelAnimation[]} An array of {@link ModelAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty.\n *\n * @exception {DeveloperError} Animations are not loaded. Wait for the {@link Model#readyPromise} to resolve.\n * @exception {DeveloperError} options.multiplier must be greater than zero.\n *\n * @example\n * model.activeAnimations.addAll({\n * multiplier : 0.5, // Play at half-speed\n * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations\n * });\n */\nModelAnimationCollection.prototype.addAll = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const model = this._model;\n\n const animations = model.sceneGraph.components.animations;\n\n const addedAnimations = [];\n const length = animations.length;\n for (let i = 0; i < length; ++i) {\n const animation = addAnimation(this, animations[i], options);\n addedAnimations.push(animation);\n }\n return addedAnimations;\n};\n\n/**\n * Removes an animation from the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.\n * </p>\n * <p>\n * An animation can also be implicitly removed from the collection by setting {@link ModelAnimationCollection#removeOnStop} to\n * <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.\n * </p>\n *\n * @param {ModelAnimation} runtimeAnimation The runtime animation to remove.\n * @returns {Boolean} <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.\n *\n * @example\n * const a = model.activeAnimations.add({\n * name : 'animation name'\n * });\n * model.activeAnimations.remove(a); // Returns true\n */\nModelAnimationCollection.prototype.remove = function (runtimeAnimation) {\n if (!defined(runtimeAnimation)) {\n return false;\n }\n\n const animations = this._runtimeAnimations;\n const i = animations.indexOf(runtimeAnimation);\n if (i !== -1) {\n animations.splice(i, 1);\n this.animationRemoved.raiseEvent(this._model, runtimeAnimation);\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all animations from the collection.\n * <p>\n * This raises the {@link ModelAnimationCollection#animationRemoved} event for each\n * animation so, for example, a UI can stay in sync.\n * </p>\n */\nModelAnimationCollection.prototype.removeAll = function () {\n const model = this._model;\n const animations = this._runtimeAnimations;\n const length = animations.length;\n\n this._runtimeAnimations.length = 0;\n\n for (let i = 0; i < length; ++i) {\n this.animationRemoved.raiseEvent(model, animations[i]);\n }\n};\n\n/**\n * Determines whether this collection contains a given animation.\n *\n * @param {ModelAnimation} runtimeAnimation The runtime animation to check for.\n * @returns {Boolean} <code>true</code> if this collection contains the animation, <code>false</code> otherwise.\n */\nModelAnimationCollection.prototype.contains = function (runtimeAnimation) {\n if (defined(runtimeAnimation)) {\n return this._runtimeAnimations.indexOf(runtimeAnimation) !== -1;\n }\n\n return false;\n};\n\n/**\n * Returns the animation in the collection at the specified index. Indices are zero-based\n * and increase as animations are added. Removing an animation shifts all animations after\n * it to the left, changing their indices. This function is commonly used to iterate over\n * all the animations in the collection.\n *\n * @param {Number} index The zero-based index of the animation.\n * @returns {ModelAnimation} The runtime animation at the specified index.\n *\n * @example\n * // Output the names of all the animations in the collection.\n * const animations = model.activeAnimations;\n * const length = animations.length;\n * for (let i = 0; i < length; ++i) {\n * console.log(animations.get(i).name);\n * }\n */\nModelAnimationCollection.prototype.get = function (index) {\n return this._runtimeAnimations[index];\n};\n\nconst animationsToRemove = [];\n\nfunction createAnimationRemovedFunction(\n modelAnimationCollection,\n model,\n animation\n) {\n return function () {\n modelAnimationCollection.animationRemoved.raiseEvent(model, animation);\n };\n}\n\n/**\n * Updates the runtime animations in this collection, removing any animations\n * that have stopped.\n *\n * @param {FrameState} frameState The current frame state.\n * @returns {Boolean} <code>true</code> if an animation played during this update, <code>false</code> otherwise.\n *\n * @private\n */\nModelAnimationCollection.prototype.update = function (frameState) {\n const runtimeAnimations = this._runtimeAnimations;\n let length = runtimeAnimations.length;\n\n if (length === 0) {\n this._previousTime = undefined;\n return false;\n }\n\n if (\n !this.animateWhilePaused &&\n JulianDate.equals(frameState.time, this._previousTime)\n ) {\n return false;\n }\n this._previousTime = JulianDate.clone(frameState.time, this._previousTime);\n\n let animationOccurred = false;\n const sceneTime = frameState.time;\n const model = this._model;\n\n for (let i = 0; i < length; ++i) {\n const runtimeAnimation = runtimeAnimations[i];\n\n if (!defined(runtimeAnimation._computedStartTime)) {\n runtimeAnimation._computedStartTime = JulianDate.addSeconds(\n defaultValue(runtimeAnimation.startTime, sceneTime),\n runtimeAnimation.delay,\n new JulianDate()\n );\n }\n\n if (!defined(runtimeAnimation._duration)) {\n runtimeAnimation._duration =\n runtimeAnimation.localStopTime * (1.0 / runtimeAnimation.multiplier);\n }\n\n const startTime = runtimeAnimation._computedStartTime;\n const duration = runtimeAnimation._duration;\n const stopTime = runtimeAnimation.stopTime;\n\n const pastStartTime = JulianDate.lessThanOrEquals(startTime, sceneTime);\n const reachedStopTime =\n defined(stopTime) && JulianDate.greaterThan(sceneTime, stopTime);\n\n // [0.0, 1.0] normalized local animation time\n let delta = 0.0;\n if (duration !== 0.0) {\n const seconds = JulianDate.secondsDifference(\n reachedStopTime ? stopTime : sceneTime,\n startTime\n );\n delta = defined(runtimeAnimation._animationTime)\n ? runtimeAnimation._animationTime(duration, seconds)\n : seconds / duration;\n }\n\n // Play animation if\n // * we are after the start time or the animation is being repeated, and\n // * before the end of the animation's duration or the animation is being repeated, and\n // * we did not reach a user-provided stop time.\n\n const repeat =\n runtimeAnimation.loop === ModelAnimationLoop.REPEAT ||\n runtimeAnimation.loop === ModelAnimationLoop.MIRRORED_REPEAT;\n\n const play =\n (pastStartTime || (repeat && !defined(runtimeAnimation.startTime))) &&\n (delta <= 1.0 || repeat) &&\n !reachedStopTime;\n\n if (delta === runtimeAnimation._prevAnimationDelta) {\n const animationStopped =\n runtimeAnimation._state === ModelAnimationState.STOPPED;\n // no change to delta, and no change to the animation state means we can\n // skip the update this time around.\n if (play !== animationStopped) {\n continue;\n }\n }\n runtimeAnimation._prevAnimationDelta = delta;\n\n // If it IS, or WAS, animating...\n if (play || runtimeAnimation._state === ModelAnimationState.ANIMATING) {\n // ...transition from STOPPED to ANIMATING\n if (play && runtimeAnimation._state === ModelAnimationState.STOPPED) {\n runtimeAnimation._state = ModelAnimationState.ANIMATING;\n if (runtimeAnimation.start.numberOfListeners > 0) {\n frameState.afterRender.push(runtimeAnimation._raiseStartEvent);\n }\n }\n\n // Truncate to [0.0, 1.0] for repeating animations\n if (runtimeAnimation.loop === ModelAnimationLoop.REPEAT) {\n delta = delta - Math.floor(delta);\n } else if (runtimeAnimation.loop === ModelAnimationLoop.MIRRORED_REPEAT) {\n const floor = Math.floor(delta);\n const fract = delta - floor;\n // When odd use (1.0 - fract) to mirror repeat\n delta = floor % 2 === 1.0 ? 1.0 - fract : fract;\n }\n\n if (runtimeAnimation.reverse) {\n delta = 1.0 - delta;\n }\n\n let localAnimationTime = delta * duration * runtimeAnimation.multiplier;\n // Clamp in case floating-point roundoff goes outside the animation's first or last keyframe\n localAnimationTime = CesiumMath.clamp(\n localAnimationTime,\n runtimeAnimation.localStartTime,\n runtimeAnimation.localStopTime\n );\n\n runtimeAnimation.animate(localAnimationTime);\n\n if (runtimeAnimation.update.numberOfListeners > 0) {\n runtimeAnimation._updateEventTime = localAnimationTime;\n frameState.afterRender.push(runtimeAnimation._raiseUpdateEvent);\n }\n animationOccurred = true;\n\n if (!play) {\n // transition from ANIMATING to STOPPED\n runtimeAnimation._state = ModelAnimationState.STOPPED;\n if (runtimeAnimation.stop.numberOfListeners > 0) {\n frameState.afterRender.push(runtimeAnimation._raiseStopEvent);\n }\n\n if (runtimeAnimation.removeOnStop) {\n animationsToRemove.push(runtimeAnimation);\n }\n }\n }\n }\n\n // Remove animations that stopped\n length = animationsToRemove.length;\n for (let j = 0; j < length; ++j) {\n const animationToRemove = animationsToRemove[j];\n runtimeAnimations.splice(runtimeAnimations.indexOf(animationToRemove), 1);\n frameState.afterRender.push(\n createAnimationRemovedFunction(this, model, animationToRemove)\n );\n }\n animationsToRemove.length = 0;\n\n return animationOccurred;\n};\n\nexport default ModelAnimationCollection;\n", "import Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * A feature of a {@link Model}.\n * <p>\n * Provides access to a feature's properties stored in the model's feature table.\n * </p>\n * <p>\n * Modifications to a <code>ModelFeature</code> object have the lifetime of the model.\n * </p>\n * <p>\n * Do not construct this directly. Access it through picking using {@link Scene#pick}.\n * </p>\n *\n * @alias ModelFeature\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Model} options.model The model the feature belongs to.\n * @param {Number} options.featureId The unique integral identifier for this feature.\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n * const feature = scene.pick(movement.endPosition);\n * if (feature instanceof Cesium.ModelFeature) {\n * console.log(feature);\n * }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n *\n */\nfunction ModelFeature(options) {\n this._model = options.model;\n\n // This ModelFeatureTable is not documented as an option since it is\n // part of the private API and should not appear in the documentation.\n this._featureTable = options.featureTable;\n\n this._featureId = options.featureId;\n this._color = undefined; // for calling getColor\n}\n\nObject.defineProperties(ModelFeature.prototype, {\n /**\n * Gets or sets if the feature will be shown. This is set for all features\n * when a style's show is evaluated.\n *\n * @memberof ModelFeature.prototype\n *\n * @type {Boolean}\n *\n * @default true\n */\n show: {\n get: function () {\n return this._featureTable.getShow(this._featureId);\n },\n set: function (value) {\n this._featureTable.setShow(this._featureId, value);\n },\n },\n\n /**\n * Gets or sets the highlight color multiplied with the feature's color. When\n * this is white, the feature's color is not changed. This is set for all features\n * when a style's color is evaluated.\n *\n * @memberof ModelFeature.prototype\n *\n * @type {Color}\n *\n * @default {@link Color.WHITE}\n */\n color: {\n get: function () {\n if (!defined(this._color)) {\n this._color = new Color();\n }\n return this._featureTable.getColor(this._featureId, this._color);\n },\n set: function (value) {\n this._featureTable.setColor(this._featureId, value);\n },\n },\n /**\n * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n * the model containing the feature.\n *\n * @memberof ModelFeature.prototype\n *\n * @type {Model}\n *\n * @readonly\n * @private\n */\n primitive: {\n get: function () {\n return this._model;\n },\n },\n\n /**\n * The {@link ModelFeatureTable} that this feature belongs to.\n *\n * @memberof ModelFeature.prototype\n *\n * @type {ModelFeatureTable}\n *\n * @readonly\n * @private\n */\n featureTable: {\n get: function () {\n return this._featureTable;\n },\n },\n\n /**\n * Get the feature ID associated with this feature. For 3D Tiles 1.0, the\n * batch ID is returned. For EXT_mesh_features, this is the feature ID from\n * the selected feature ID set.\n *\n * @memberof ModelFeature.prototype\n *\n * @type {Number}\n *\n * @readonly\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n featureId: {\n get: function () {\n return this._featureId;\n },\n },\n});\n\n/**\n * Returns whether the feature contains this property.\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {Boolean} Whether the feature contains this property.\n */\nModelFeature.prototype.hasProperty = function (name) {\n return this._featureTable.hasProperty(this._featureId, name);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n * const propertyId = propertyIds[i];\n * console.log(propertyId + ': ' + feature.getProperty(propertyId));\n * }\n */\nModelFeature.prototype.getProperty = function (name) {\n return this._featureTable.getProperty(this._featureId, name);\n};\n\n/**\n * Returns a copy of the feature's property with the given name, examining all\n * the metadata from the EXT_structural_metadata and legacy EXT_feature_metadata glTF\n * extensions. Metadata is checked against name from most specific to most\n * general and the first match is returned. Metadata is checked in this order:\n * <ol>\n * <li>structural metadata property by semantic</li>\n * <li>structural metadata property by property ID</li>\n * </ol>\n * <p>\n * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the\n * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.\n * </p>\n *\n * @param {String} name The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.\n * @return {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nModelFeature.prototype.getPropertyInherited = function (name) {\n if (this._featureTable.hasPropertyBySemantic(this._featureId, name)) {\n return this._featureTable.getPropertyBySemantic(this._featureId, name);\n }\n\n return this._featureTable.getProperty(this._featureId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The IDs of the feature's properties.\n */\nModelFeature.prototype.getPropertyIds = function (results) {\n return this._featureTable.getPropertyIds(results);\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n *\n * @param {String} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n * console.log('already clicked');\n * } else {\n * feature.setProperty(name, true);\n * console.log('first click');\n * }\n */\nModelFeature.prototype.setProperty = function (name, value) {\n return this._featureTable.setProperty(this._featureId, name, value);\n};\n\nexport default ModelFeature;\n", "/**\n * An enum describing what commands (opaque or translucent) are required by\n * a {@link Cesium3DTileStyle}.\n *\n * @enum {Number}\n * @private\n */\nconst StyleCommandsNeeded = {\n ALL_OPAQUE: 0,\n ALL_TRANSLUCENT: 1,\n OPAQUE_AND_TRANSLUCENT: 2,\n};\n\n/**\n * @private\n */\nStyleCommandsNeeded.getStyleCommandsNeeded = function (\n featuresLength,\n translucentFeaturesLength\n) {\n if (translucentFeaturesLength === 0) {\n return StyleCommandsNeeded.ALL_OPAQUE;\n } else if (translucentFeaturesLength === featuresLength) {\n return StyleCommandsNeeded.ALL_TRANSLUCENT;\n }\n return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;\n};\n\nexport default Object.freeze(StyleCommandsNeeded);\n", "import Check from \"../../Core/Check.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\n\n/**\n * An enum to distinguish the different uses for {@link Model},\n * which include individual glTF models, and various 3D Tiles formats\n * (including glTF via <code>3DTILES_content_gltf</code>).\n *\n * @enum {String}\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst ModelType = {\n /**\n * An individual glTF model.\n * <p>\n * Not to be confused with {@link ModelType.TILE_GLTF}\n * which is for 3D Tiles\n * </p>\n *\n * @type {String}\n * @constant\n */\n GLTF: \"GLTF\",\n /**\n * A glTF model used as tile content in a 3D Tileset via\n * <code>3DTILES_content_gltf</code>.\n * <p>\n * Not to be confused with {@link ModelType.GLTF}\n * which is for individual models\n * </p>\n *\n * @type {String}\n * @constant\n */\n TILE_GLTF: \"TILE_GLTF\",\n /**\n * A 3D Tiles 1.0 Batched 3D Model\n *\n * @type {String}\n * @constant\n */\n TILE_B3DM: \"B3DM\",\n /**\n * A 3D Tiles 1.0 Instanced 3D Model\n *\n * @type {String}\n * @constant\n */\n TILE_I3DM: \"I3DM\",\n /**\n * A 3D Tiles 1.0 Point Cloud\n *\n * @type {String}\n * @constant\n */\n TILE_PNTS: \"PNTS\",\n\n /**\n * GeoJSON content for <code>MAXAR_content_geojson</code> extension\n *\n * @type {String}\n * @constant\n */\n TILE_GEOJSON: \"TILE_GEOJSON\",\n};\n\n/**\n * Check if a model is used for 3D Tiles.\n * @param {ModelType} modelType The type of model\n * @returns {Boolean} <code>true</code> if the model is a 3D Tiles format, <code>false</code> otherwise\n */\nModelType.is3DTiles = function (modelType) {\n switch (modelType) {\n case ModelType.TILE_GLTF:\n case ModelType.TILE_B3DM:\n case ModelType.TILE_I3DM:\n case ModelType.TILE_PNTS:\n case ModelType.TILE_GEOJSON:\n return true;\n case ModelType.GLTF:\n return false;\n}\n};\n\nexport default Object.freeze(ModelType);\n", "import BatchTexture from \"../BatchTexture.js\";\nimport Cesium3DTileFeature from \"../Cesium3DTileFeature.js\";\nimport Check from \"../../Core/Check.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport ModelFeature from \"./ModelFeature.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\nimport ModelType from \"./ModelType.js\";\n\n/**\n * Manages the {@link ModelFeature}s in a {@link Model}.\n * Extracts the properties from a {@link PropertyTable}.\n *\n * @param {Object} options An object containing the following options:\n * @param {Model} options.model The model that owns this feature table.\n * @param {PropertyTable} options.propertyTable The property table from the model used to initialize the model.\n *\n * @alias ModelFeatureTable\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ModelFeatureTable(options) {\n const model = options.model;\n const propertyTable = options.propertyTable;\n\n this._propertyTable = propertyTable;\n this._model = model;\n\n this._features = undefined;\n this._featuresLength = 0;\n\n this._batchTexture = undefined;\n\n this._styleCommandsNeededDirty = false;\n this._styleCommandsNeeded = StyleCommandsNeeded.ALL_OPAQUE;\n\n initialize(this);\n}\n\nObject.defineProperties(ModelFeatureTable.prototype, {\n /**\n * The batch texture created for the features in this table.\n *\n * @memberof ModelFeatureTable.prototype\n *\n * @type {BatchTexture}\n * @readonly\n *\n * @private\n */\n batchTexture: {\n get: function () {\n return this._batchTexture;\n },\n },\n\n /**\n * The number of features in this table.\n *\n * @memberof ModelFeatureTable.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n featuresLength: {\n get: function () {\n return this._featuresLength;\n },\n },\n\n /**\n * Size of the batch texture. This does not count the property table size\n * as that is counted separately through StructuralMetadata.\n *\n * @memberof ModelFeatureTable.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n batchTextureByteLength: {\n get: function () {\n if (defined(this._batchTexture)) {\n return this._batchTexture.byteLength;\n }\n\n return 0;\n },\n },\n\n /**\n * A flag to indicate whether or not the types of style commands needed by this feature table have changed.\n *\n * @memberof ModelFeatureTable.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n styleCommandsNeededDirty: {\n get: function () {\n return this._styleCommandsNeededDirty;\n },\n },\n});\n\nfunction initialize(modelFeatureTable) {\n const model = modelFeatureTable._model;\n const is3DTiles = ModelType.is3DTiles(model.type);\n\n const featuresLength = modelFeatureTable._propertyTable.count;\n if (featuresLength === 0) {\n return;\n }\n\n let i;\n const features = new Array(featuresLength);\n if (is3DTiles) {\n const content = model.content;\n for (i = 0; i < featuresLength; i++) {\n features[i] = new Cesium3DTileFeature(content, i);\n }\n } else {\n for (i = 0; i < featuresLength; i++) {\n features[i] = new ModelFeature({\n model: model,\n featureId: i,\n featureTable: modelFeatureTable,\n });\n }\n }\n\n modelFeatureTable._features = features;\n modelFeatureTable._featuresLength = featuresLength;\n\n modelFeatureTable._batchTexture = new BatchTexture({\n featuresLength: featuresLength,\n owner: modelFeatureTable,\n statistics: is3DTiles ? model.content.tileset.statistics : undefined,\n });\n}\n\n/**\n * Creates/updates the batch texture.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelFeatureTable.prototype.update = function (frameState) {\n // Assume the number of translucent features has not changed.\n this._styleCommandsNeededDirty = false;\n this._batchTexture.update(undefined, frameState);\n\n const currentStyleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded(\n this._featuresLength,\n this._batchTexture.translucentFeaturesLength\n );\n\n if (this._styleCommandsNeeded !== currentStyleCommandsNeeded) {\n this._styleCommandsNeededDirty = true;\n this._styleCommandsNeeded = currentStyleCommandsNeeded;\n }\n};\n\nModelFeatureTable.prototype.setShow = function (featureId, show) {\n this._batchTexture.setShow(featureId, show);\n};\n\nModelFeatureTable.prototype.setAllShow = function (show) {\n this._batchTexture.setAllShow(show);\n};\n\nModelFeatureTable.prototype.getShow = function (featureId) {\n return this._batchTexture.getShow(featureId);\n};\n\nModelFeatureTable.prototype.setColor = function (featureId, color) {\n this._batchTexture.setColor(featureId, color);\n};\n\nModelFeatureTable.prototype.setAllColor = function (color) {\n this._batchTexture.setAllColor(color);\n};\n\nModelFeatureTable.prototype.getColor = function (featureId, result) {\n return this._batchTexture.getColor(featureId, result);\n};\n\nModelFeatureTable.prototype.getPickColor = function (featureId) {\n return this._batchTexture.getPickColor(featureId);\n};\n\nModelFeatureTable.prototype.getFeature = function (featureId) {\n return this._features[featureId];\n};\n\nModelFeatureTable.prototype.hasProperty = function (featureId, propertyName) {\n return this._propertyTable.hasProperty(featureId, propertyName);\n};\n\nModelFeatureTable.prototype.hasPropertyBySemantic = function (\n featureId,\n propertyName\n) {\n return this._propertyTable.hasPropertyBySemantic(featureId, propertyName);\n};\n\nModelFeatureTable.prototype.getProperty = function (featureId, name) {\n return this._propertyTable.getProperty(featureId, name);\n};\n\nModelFeatureTable.prototype.getPropertyBySemantic = function (\n featureId,\n semantic\n) {\n return this._propertyTable.getPropertyBySemantic(featureId, semantic);\n};\n\nModelFeatureTable.prototype.getPropertyIds = function (results) {\n return this._propertyTable.getPropertyIds(results);\n};\n\nModelFeatureTable.prototype.setProperty = function (featureId, name, value) {\n return this._propertyTable.setProperty(featureId, name, value);\n};\n\nModelFeatureTable.prototype.isClass = function (featureId, className) {\n return this._propertyTable.isClass(featureId, className);\n};\n\nModelFeatureTable.prototype.isExactClass = function (featureId, className) {\n return this._propertyTable.isExactClass(featureId, className);\n};\n\nModelFeatureTable.prototype.getExactClassName = function (featureId) {\n return this._propertyTable.getExactClassName(featureId);\n};\n\nconst scratchColor = new Color();\n/**\n * @private\n */\nModelFeatureTable.prototype.applyStyle = function (style) {\n if (!defined(style)) {\n this.setAllColor(BatchTexture.DEFAULT_COLOR_VALUE);\n this.setAllShow(BatchTexture.DEFAULT_SHOW_VALUE);\n return;\n }\n\n for (let i = 0; i < this._featuresLength; i++) {\n const feature = this.getFeature(i);\n const color = defined(style.color)\n ? defaultValue(\n style.color.evaluateColor(feature, scratchColor),\n BatchTexture.DEFAULT_COLOR_VALUE\n )\n : BatchTexture.DEFAULT_COLOR_VALUE;\n const show = defined(style.show)\n ? defaultValue(\n style.show.evaluate(feature),\n BatchTexture.DEFAULT_SHOW_VALUE\n )\n : BatchTexture.DEFAULT_SHOW_VALUE;\n\n this.setColor(i, color);\n this.setShow(i, show);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ModelFeatureTable#destroy\n * @private\n */\nModelFeatureTable.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * e = e && e.destroy();\n *\n * @see ModelFeatureTable#isDestroyed\n * @private\n */\nModelFeatureTable.prototype.destroy = function (frameState) {\n this._batchTexture = this._batchTexture && this._batchTexture.destroy();\n destroyObject(this);\n};\n\nexport default ModelFeatureTable;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT)\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\n#endif\\n\\\nczm_modelMaterial defaultModelMaterial()\\n\\\n{\\n\\\nczm_modelMaterial material;\\n\\\nmaterial.diffuse = vec3(0.0);\\n\\\nmaterial.specular = vec3(1.0);\\n\\\nmaterial.roughness = 1.0;\\n\\\nmaterial.occlusion = 1.0;\\n\\\nmaterial.normalEC = vec3(0.0, 0.0, 1.0);\\n\\\nmaterial.emissive = vec3(0.0);\\n\\\nmaterial.alpha = 1.0;\\n\\\nreturn material;\\n\\\n}\\n\\\nvec4 handleAlpha(vec3 color, float alpha)\\n\\\n{\\n\\\n#ifdef ALPHA_MODE_MASK\\n\\\nif (alpha < u_alphaCutoff) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\nreturn vec4(color, alpha);\\n\\\n}\\n\\\nSelectedFeature selectedFeature;\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef HAS_MODEL_SPLITTER\\n\\\nmodelSplitterStage();\\n\\\n#endif\\n\\\nczm_modelMaterial material = defaultModelMaterial();\\n\\\nProcessedAttributes attributes;\\n\\\ngeometryStage(attributes);\\n\\\nFeatureIds featureIds;\\n\\\nfeatureIdStage(featureIds, attributes);\\n\\\nMetadata metadata;\\n\\\nMetadataClass metadataClass;\\n\\\nMetadataStatistics metadataStatistics;\\n\\\nmetadataStage(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n#ifdef HAS_SELECTED_FEATURE_ID\\n\\\nselectedFeatureIdStage(selectedFeature, featureIds);\\n\\\n#endif\\n\\\n#ifndef CUSTOM_SHADER_REPLACE_MATERIAL\\n\\\nmaterialStage(material, attributes, selectedFeature);\\n\\\n#endif\\n\\\n#ifdef HAS_CUSTOM_FRAGMENT_SHADER\\n\\\ncustomShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);\\n\\\n#endif\\n\\\nlightingStage(material, attributes);\\n\\\n#ifdef HAS_SELECTED_FEATURE_ID\\n\\\ncpuStylingStage(material, selectedFeature);\\n\\\n#endif\\n\\\n#ifdef HAS_MODEL_COLOR\\n\\\nmodelColorStage(material);\\n\\\n#endif\\n\\\n#ifdef HAS_PRIMITIVE_OUTLINE\\n\\\nprimitiveOutlineStage(material);\\n\\\n#endif\\n\\\nvec4 color = handleAlpha(material.diffuse, material.alpha);\\n\\\n#ifdef HAS_CLIPPING_PLANES\\n\\\nmodelClippingPlanesStage(color);\\n\\\n#endif\\n\\\n#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)\\n\\\nsilhouetteStage(color);\\n\\\n#endif\\n\\\ngl_FragColor = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"precision highp float;\\n\\\nczm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {\\n\\\nczm_modelVertexOutput vsOutput;\\n\\\nvsOutput.positionMC = positionMC;\\n\\\nvsOutput.pointSize = 1.0;\\n\\\nreturn vsOutput;\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\nProcessedAttributes attributes;\\n\\\ninitializeAttributes(attributes);\\n\\\n#ifdef USE_DEQUANTIZATION\\n\\\ndequantizationStage(attributes);\\n\\\n#endif\\n\\\n#ifdef HAS_MORPH_TARGETS\\n\\\nmorphTargetsStage(attributes);\\n\\\n#endif\\n\\\n#ifdef HAS_SKINNING\\n\\\nskinningStage(attributes);\\n\\\n#endif\\n\\\n#ifdef HAS_PRIMITIVE_OUTLINE\\n\\\nprimitiveOutlineStage();\\n\\\n#endif\\n\\\n#ifdef HAS_BITANGENTS\\n\\\nattributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);\\n\\\n#endif\\n\\\nFeatureIds featureIds;\\n\\\nfeatureIdStage(featureIds, attributes);\\n\\\n#ifdef HAS_SELECTED_FEATURE_ID\\n\\\nSelectedFeature feature;\\n\\\nselectedFeatureIdStage(feature, featureIds);\\n\\\ncpuStylingStage(attributes.positionMC, feature);\\n\\\n#endif\\n\\\n#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\\n\\\nmat4 modelView = czm_modelView3D;\\n\\\nmat3 normal = czm_normal3D;\\n\\\n#else\\n\\\nmat4 modelView = czm_modelView;\\n\\\nmat3 normal = czm_normal;\\n\\\n#endif\\n\\\n#ifdef HAS_INSTANCING\\n\\\n#ifdef USE_LEGACY_INSTANCING\\n\\\nmat4 instanceModelView;\\n\\\nmat3 instanceModelViewInverseTranspose;\\n\\\nlegacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);\\n\\\nmodelView = instanceModelView;\\n\\\nnormal = instanceModelViewInverseTranspose;\\n\\\n#else\\n\\\ninstancingStage(attributes);\\n\\\n#endif\\n\\\n#ifdef USE_PICKING\\n\\\nv_pickColor = a_pickColor;\\n\\\n#endif\\n\\\n#endif\\n\\\nMetadata metadata;\\n\\\nMetadataClass metadataClass;\\n\\\nMetadataStatistics metadataStatistics;\\n\\\nmetadataStage(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n#ifdef HAS_CUSTOM_VERTEX_SHADER\\n\\\nczm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);\\n\\\ncustomShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);\\n\\\n#endif\\n\\\nvec4 positionClip = geometryStage(attributes, modelView, normal);\\n\\\n#ifdef HAS_SILHOUETTE\\n\\\nsilhouetteStage(attributes, positionClip);\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\\n\\\nfloat show = pointCloudShowStylingStage(attributes, metadata);\\n\\\n#else\\n\\\nfloat show = 1.0;\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\\n\\\nshow *= pointCloudBackFaceCullingStage();\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\nv_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);\\n\\\n#endif\\n\\\n#ifdef PRIMITIVE_TYPE_POINTS\\n\\\n#ifdef HAS_CUSTOM_VERTEX_SHADER\\n\\\ngl_PointSize = vsOutput.pointSize;\\n\\\n#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\\n\\\ngl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\\n\\\n#else\\n\\\ngl_PointSize = 1.0;\\n\\\n#endif\\n\\\ngl_PointSize *= show;\\n\\\n#endif\\n\\\ngl_Position = show * positionClip;\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport ClassificationType from \"../ClassificationType.js\";\nimport DepthFunction from \"../DepthFunction.js\";\nimport StencilConstants from \"../StencilConstants.js\";\nimport StencilFunction from \"../StencilFunction.js\";\nimport StencilOperation from \"../StencilOperation.js\";\n\n/**\n * A wrapper around the draw commands used to render a classification model,\n * i.e. a {@link Model} that classifies another asset. This manages the\n * derived commands and returns only the necessary commands depending on the\n * given frame state.\n *\n * @param {Object} options An object containing the following options:\n * @param {DrawCommand} options.command The draw command from which to derive other commands from.\n * @param {PrimitiveRenderResources} options.primitiveRenderResources The render resources of the primitive associated with the command.\n *\n * @alias ClassificationModelDrawCommand\n * @constructor\n *\n * @private\n */\nfunction ClassificationModelDrawCommand(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const command = options.command;\n const renderResources = options.primitiveRenderResources;\n\n const model = renderResources.model;\n\n this._command = command;\n this._model = model;\n this._runtimePrimitive = renderResources.runtimePrimitive;\n\n // Classification models aren't supported in 2D mode, so there's no need to\n // duplicate the model matrix for each derived command.\n this._modelMatrix = command.modelMatrix;\n this._boundingVolume = command.boundingVolume;\n this._cullFace = command.renderState.cull.face;\n\n const type = model.classificationType;\n this._classificationType = type;\n\n // ClassificationType has three values: terrain only, 3D Tiles only, or both.\n this._classifiesTerrain = type !== ClassificationType.CESIUM_3D_TILE;\n this._classifies3DTiles = type !== ClassificationType.TERRAIN;\n\n this._useDebugWireframe = model._enableDebugWireframe && model.debugWireframe;\n this._pickId = renderResources.pickId;\n\n this._commandListTerrain = [];\n this._commandList3DTiles = [];\n this._commandListIgnoreShow = []; // Used for inverted classification.\n this._commandListDebugWireframe = [];\n\n this._commandListTerrainPicking = [];\n this._commandList3DTilesPicking = [];\n\n initialize(this);\n}\n\nfunction getStencilDepthRenderState(stencilFunction) {\n return {\n colorMask: {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n },\n stencilTest: {\n enabled: true,\n frontFunction: stencilFunction,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.DECREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: stencilFunction,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.INCREMENT_WRAP,\n zPass: StencilOperation.KEEP,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS_OR_EQUAL,\n },\n depthMask: false,\n };\n}\n\nconst colorRenderState = {\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n};\n\nconst pickRenderState = {\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n backFunction: StencilFunction.NOT_EQUAL,\n backOperation: {\n fail: StencilOperation.ZERO,\n zFail: StencilOperation.ZERO,\n zPass: StencilOperation.ZERO,\n },\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n depthTest: {\n enabled: false,\n },\n depthMask: false,\n};\n\nconst scratchDerivedCommands = [];\n\nfunction initialize(drawCommand) {\n const command = drawCommand._command;\n const derivedCommands = scratchDerivedCommands;\n\n // If debug wireframe is enabled, don't derive any new commands.\n // Render normally in the opaque pass.\n if (drawCommand._useDebugWireframe) {\n command.pass = Pass.OPAQUE;\n\n derivedCommands.length = 0;\n derivedCommands.push(command);\n\n drawCommand._commandListDebugWireframe = createBatchCommands(\n drawCommand,\n derivedCommands,\n drawCommand._commandListDebugWireframe\n );\n\n const commandList = drawCommand._commandListDebugWireframe;\n const length = commandList.length;\n for (let i = 0; i < length; i++) {\n // The lengths / offsets of the batches have to be adjusted for wireframe.\n // Only PrimitiveType.TRIANGLES is allowed for classification, so this\n // just requires doubling the values for the batches.\n const command = commandList[i];\n command.count *= 2;\n command.offset *= 2;\n }\n\n return;\n }\n\n const model = drawCommand.model;\n const allowPicking = model.allowPicking;\n\n if (drawCommand._classifiesTerrain) {\n const pass = Pass.TERRAIN_CLASSIFICATION;\n const stencilDepthCommand = deriveStencilDepthCommand(command, pass);\n const colorCommand = deriveColorCommand(command, pass);\n\n derivedCommands.length = 0;\n derivedCommands.push(stencilDepthCommand, colorCommand);\n\n drawCommand._commandListTerrain = createBatchCommands(\n drawCommand,\n derivedCommands,\n drawCommand._commandListTerrain\n );\n\n if (allowPicking) {\n drawCommand._commandListTerrainPicking = createPickCommands(\n drawCommand,\n derivedCommands,\n drawCommand._commandListTerrainPicking\n );\n }\n }\n\n if (drawCommand._classifies3DTiles) {\n const pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n const stencilDepthCommand = deriveStencilDepthCommand(command, pass);\n const colorCommand = deriveColorCommand(command, pass);\n\n derivedCommands.length = 0;\n derivedCommands.push(stencilDepthCommand, colorCommand);\n\n drawCommand._commandList3DTiles = createBatchCommands(\n drawCommand,\n derivedCommands,\n drawCommand._commandList3DTiles\n );\n\n if (allowPicking) {\n drawCommand._commandList3DTilesPicking = createPickCommands(\n drawCommand,\n derivedCommands,\n drawCommand._commandList3DTilesPicking\n );\n }\n }\n}\n\nfunction createBatchCommands(drawCommand, derivedCommands, result) {\n const runtimePrimitive = drawCommand._runtimePrimitive;\n const batchLengths = runtimePrimitive.batchLengths;\n const batchOffsets = runtimePrimitive.batchOffsets;\n\n const numBatches = batchLengths.length;\n const numDerivedCommands = derivedCommands.length;\n for (let i = 0; i < numBatches; i++) {\n const batchLength = batchLengths[i];\n const batchOffset = batchOffsets[i];\n // For multiple derived commands (e.g. stencil and color commands),\n // they must be added in a certain order even within the batches.\n for (let j = 0; j < numDerivedCommands; j++) {\n const derivedCommand = derivedCommands[j];\n const batchCommand = DrawCommand.shallowClone(derivedCommand);\n batchCommand.count = batchLength;\n batchCommand.offset = batchOffset;\n result.push(batchCommand);\n }\n }\n\n return result;\n}\n\nfunction deriveStencilDepthCommand(command, pass) {\n const stencilDepthCommand = DrawCommand.shallowClone(command);\n stencilDepthCommand.cull = false;\n stencilDepthCommand.pass = pass;\n\n const stencilFunction =\n pass === Pass.TERRAIN_CLASSIFICATION\n ? StencilFunction.ALWAYS\n : StencilFunction.EQUAL;\n const renderState = getStencilDepthRenderState(stencilFunction);\n stencilDepthCommand.renderState = RenderState.fromCache(renderState);\n\n return stencilDepthCommand;\n}\n\nfunction deriveColorCommand(command, pass) {\n const colorCommand = DrawCommand.shallowClone(command);\n colorCommand.cull = false;\n colorCommand.pass = pass;\n\n colorCommand.renderState = RenderState.fromCache(colorRenderState);\n\n return colorCommand;\n}\n\nconst scratchPickCommands = [];\n\nfunction createPickCommands(drawCommand, derivedCommands, commandList) {\n const renderState = RenderState.fromCache(pickRenderState);\n const stencilDepthCommand = derivedCommands[0];\n const colorCommand = derivedCommands[1];\n\n const pickStencilDepthCommand = DrawCommand.shallowClone(stencilDepthCommand);\n pickStencilDepthCommand.cull = true;\n pickStencilDepthCommand.pickOnly = true;\n\n const pickColorCommand = DrawCommand.shallowClone(colorCommand);\n pickColorCommand.cull = true;\n pickColorCommand.pickOnly = true;\n pickColorCommand.renderState = renderState;\n pickColorCommand.pickId = drawCommand._pickId;\n\n const pickCommands = scratchPickCommands;\n pickCommands.length = 0;\n pickCommands.push(pickStencilDepthCommand, pickColorCommand);\n\n return createBatchCommands(drawCommand, pickCommands, commandList);\n}\n\nObject.defineProperties(ClassificationModelDrawCommand.prototype, {\n /**\n * The main draw command that the other commands are derived from.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {DrawCommand}\n *\n * @readonly\n * @private\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n\n /**\n * The runtime primitive that the draw command belongs to.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {ModelRuntimePrimitive}\n *\n * @readonly\n * @private\n */\n runtimePrimitive: {\n get: function () {\n return this._runtimePrimitive;\n },\n },\n\n /**\n * The batch lengths used to generate multiple draw commands.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {Number[]}\n *\n * @readonly\n * @private\n */\n batchLengths: {\n get: function () {\n return this._runtimePrimitive.batchLengths;\n },\n },\n\n /**\n * The batch offsets used to generate multiple draw commands.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {Number[]}\n *\n * @readonly\n * @private\n */\n batchOffsets: {\n get: function () {\n return this._runtimePrimitive.batchOffsets;\n },\n },\n\n /**\n * The model that the draw command belongs to.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {Model}\n *\n * @readonly\n * @private\n */\n model: {\n get: function () {\n return this._model;\n },\n },\n\n /**\n * The classification type of the model that this draw command belongs to.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {ClassificationType}\n *\n * @readonly\n * @private\n */\n classificationType: {\n get: function () {\n return this._classificationType;\n },\n },\n\n /**\n * The current model matrix applied to the draw commands.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {Matrix4}\n *\n * @readonly\n * @private\n */\n modelMatrix: {\n get: function () {\n return this._modelMatrix;\n },\n set: function (value) {\n this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n const boundingSphere = this._runtimePrimitive.boundingSphere;\n this._boundingVolume = BoundingSphere.transform(\n boundingSphere,\n this._modelMatrix,\n this._boundingVolume\n );\n },\n },\n\n /**\n * The bounding volume of the main draw command. This is equivalent\n * to the primitive's bounding sphere transformed by the draw\n * command's model matrix.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {BoundingSphere}\n *\n * @readonly\n * @private\n */\n boundingVolume: {\n get: function () {\n return this._boundingVolume;\n },\n },\n\n /**\n * Culling is disabled for classification models, so this has no effect on\n * how the model renders. This only exists to match the interface of\n * {@link ModelDrawCommand}.\n *\n * @memberof ClassificationModelDrawCommand.prototype\n * @type {CullFace}\n *\n * @private\n */\n cullFace: {\n get: function () {\n return this._cullFace;\n },\n set: function (value) {\n this._cullFace = value;\n },\n },\n});\n\n/**\n * Pushes the draw commands necessary to render the primitive.\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the draw commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nClassificationModelDrawCommand.prototype.pushCommands = function (\n frameState,\n result\n) {\n const passes = frameState.passes;\n if (passes.render) {\n if (this._useDebugWireframe) {\n result.push.apply(result, this._commandListDebugWireframe);\n return;\n }\n\n if (this._classifiesTerrain) {\n result.push.apply(result, this._commandListTerrain);\n }\n\n if (this._classifies3DTiles) {\n result.push.apply(result, this._commandList3DTiles);\n }\n\n const useIgnoreShowCommands =\n frameState.invertClassification && this._classifies3DTiles;\n\n if (useIgnoreShowCommands) {\n if (this._commandListIgnoreShow.length === 0) {\n const pass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;\n const command = deriveStencilDepthCommand(this._command, pass);\n\n const derivedCommands = scratchDerivedCommands;\n derivedCommands.length = 0;\n derivedCommands.push(command);\n\n this._commandListIgnoreShow = createBatchCommands(\n this,\n derivedCommands,\n this._commandListIgnoreShow\n );\n }\n\n result.push.apply(result, this._commandListIgnoreShow);\n }\n }\n\n if (passes.pick) {\n if (this._classifiesTerrain) {\n result.push.apply(result, this._commandListTerrainPicking);\n }\n\n if (this._classifies3DTiles) {\n result.push.apply(result, this._commandList3DTilesPicking);\n }\n }\n\n return result;\n};\n\nexport default ClassificationModelDrawCommand;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../../Core/Cartesian2.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport CullFace from \"../CullFace.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport StencilConstants from \"../StencilConstants.js\";\nimport StencilFunction from \"../StencilFunction.js\";\nimport StencilOperation from \"../StencilOperation.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\n\n/**\n * A wrapper around the draw commands used to render a {@link ModelRuntimePrimitive}.\n * This manages the derived commands and pushes only the necessary commands depending\n * on the given frame state.\n *\n * @param {Object} options An object containing the following options:\n * @param {DrawCommand} options.command The draw command from which to derive other commands from.\n * @param {PrimitiveRenderResources} options.primitiveRenderResources The render resources of the primitive associated with the command.\n *\n * @alias ModelDrawCommand\n * @constructor\n *\n * @private\n */\nfunction ModelDrawCommand(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const command = options.command;\n const renderResources = options.primitiveRenderResources;\n\n const model = renderResources.model;\n this._model = model;\n\n const runtimePrimitive = renderResources.runtimePrimitive;\n this._runtimePrimitive = runtimePrimitive;\n\n // If the command is translucent, or if the primitive's material is\n // double-sided, then back-face culling is automatically disabled for\n // the command. The user value for back-face culling will be ignored.\n const isTranslucent = command.pass === Pass.TRANSLUCENT;\n const isDoubleSided = runtimePrimitive.primitive.material.doubleSided;\n const usesBackFaceCulling = !isDoubleSided && !isTranslucent;\n const hasSilhouette = renderResources.hasSilhouette;\n\n // If the command was already translucent, there's no need to derive a new\n // translucent command. As of now, a style can't change an originally\n // translucent feature to opaque since the style's alpha is modulated,\n // not replaced. When this changes, we need to derive new opaque commands\n // in initialize().\n //\n // Silhouettes for primitives with both opaque and translucent features\n // are not yet supported.\n const needsTranslucentCommand = !isTranslucent && !hasSilhouette;\n\n const needsSkipLevelOfDetailCommands =\n renderResources.hasSkipLevelOfDetail && !isTranslucent;\n\n const needsSilhouetteCommands = hasSilhouette;\n\n this._command = command;\n\n // None of the derived commands (non-2D) use a different model matrix\n // or bounding volume than the original, so they all point to the\n // ModelDrawCommand's copy to save update time and memory.\n this._modelMatrix = Matrix4.clone(command.modelMatrix);\n this._boundingVolume = BoundingSphere.clone(command.boundingVolume);\n\n // The 2D model matrix depends on the frame state's map projection,\n // so it must be updated when the commands are handled in pushCommands.\n this._modelMatrix2D = new Matrix4();\n this._boundingVolume2D = new BoundingSphere();\n this._modelMatrix2DDirty = false;\n\n this._backFaceCulling = command.renderState.cull.enabled;\n this._cullFace = command.renderState.cull.face;\n this._shadows = model.shadows;\n this._debugShowBoundingVolume = command.debugShowBoundingVolume;\n\n this._usesBackFaceCulling = usesBackFaceCulling;\n this._needsTranslucentCommand = needsTranslucentCommand;\n this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;\n this._needsSilhouetteCommands = needsSilhouetteCommands;\n\n // Derived commands\n this._originalCommand = undefined;\n this._translucentCommand = undefined;\n this._skipLodBackfaceCommand = undefined;\n this._skipLodStencilCommand = undefined;\n this._silhouetteModelCommand = undefined;\n this._silhouetteColorCommand = undefined;\n\n // All derived commands (including 2D commands)\n this._derivedCommands = [];\n this._has2DCommands = false;\n\n initialize(this);\n}\n\nfunction ModelDerivedCommand(options) {\n // The DrawCommand managed by this derived command.\n this.command = options.command;\n\n // These control whether the derived command should update the\n // values of the DrawCommand for the corresponding properties.\n this.updateShadows = options.updateShadows;\n this.updateBackFaceCulling = options.updateBackFaceCulling;\n this.updateCullFace = options.updateCullFace;\n this.updateDebugShowBoundingVolume = options.updateDebugShowBoundingVolume;\n\n // Whether this ModelDerivedCommand is in 2D.\n this.is2D = defaultValue(options.is2D, false);\n\n // A ModelDerivedCommand that is the 2D version of this one.\n this.derivedCommand2D = undefined;\n}\n\nModelDerivedCommand.clone = function (derivedCommand) {\n return new ModelDerivedCommand({\n command: derivedCommand.command,\n updateShadows: derivedCommand.updateShadows,\n updateBackFaceCulling: derivedCommand.updateBackFaceCulling,\n updateCullFace: derivedCommand.updateCullFace,\n updateDebugShowBoundingVolume: derivedCommand.updateDebugShowBoundingVolume,\n is2D: derivedCommand.is2D,\n derivedCommand2D: derivedCommand.derivedCommand2D,\n });\n};\n\nfunction initialize(drawCommand) {\n const command = drawCommand._command;\n command.modelMatrix = drawCommand._modelMatrix;\n command.boundingVolume = drawCommand._boundingVolume;\n\n const model = drawCommand._model;\n const usesBackFaceCulling = drawCommand._usesBackFaceCulling;\n const derivedCommands = drawCommand._derivedCommands;\n\n drawCommand._originalCommand = new ModelDerivedCommand({\n command: command,\n updateShadows: true,\n updateBackFaceCulling: usesBackFaceCulling,\n updateCullFace: usesBackFaceCulling,\n updateDebugShowBoundingVolume: true,\n is2D: false,\n });\n\n derivedCommands.push(drawCommand._originalCommand);\n\n if (drawCommand._needsTranslucentCommand) {\n drawCommand._translucentCommand = new ModelDerivedCommand({\n command: deriveTranslucentCommand(command),\n updateShadows: true,\n updateBackFaceCulling: false,\n updateCullFace: false,\n updateDebugShowBoundingVolume: true,\n });\n\n derivedCommands.push(drawCommand._translucentCommand);\n }\n\n if (drawCommand._needsSkipLevelOfDetailCommands) {\n drawCommand._skipLodBackfaceCommand = new ModelDerivedCommand({\n command: deriveSkipLodBackfaceCommand(command),\n updateShadows: false,\n updateBackFaceCulling: false,\n updateCullFace: usesBackFaceCulling,\n updateDebugShowBoundingVolume: false,\n });\n\n drawCommand._skipLodStencilCommand = new ModelDerivedCommand({\n command: deriveSkipLodStencilCommand(command, model),\n updateShadows: true,\n updateBackFaceCulling: usesBackFaceCulling,\n updateCullFace: usesBackFaceCulling,\n updateDebugShowBoundingVolume: true,\n });\n\n derivedCommands.push(drawCommand._skipLodBackfaceCommand);\n derivedCommands.push(drawCommand._skipLodStencilCommand);\n }\n\n if (drawCommand._needsSilhouetteCommands) {\n drawCommand._silhouetteModelCommand = new ModelDerivedCommand({\n command: deriveSilhouetteModelCommand(command, model),\n updateShadows: true,\n updateBackFaceCulling: usesBackFaceCulling,\n updateCullFace: usesBackFaceCulling,\n updateDebugShowBoundingVolume: true,\n });\n\n drawCommand._silhouetteColorCommand = new ModelDerivedCommand({\n command: deriveSilhouetteColorCommand(command, model),\n updateShadows: false,\n updateBackFaceCulling: false,\n updateCullFace: false,\n updateDebugShowBoundingVolume: false,\n });\n\n derivedCommands.push(drawCommand._silhouetteModelCommand);\n derivedCommands.push(drawCommand._silhouetteColorCommand);\n }\n}\n\nObject.defineProperties(ModelDrawCommand.prototype, {\n /**\n * The main draw command that the other commands are derived from.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {DrawCommand}\n *\n * @readonly\n * @private\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n\n /**\n * The runtime primitive that the draw command belongs to.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {ModelRuntimePrimitive}\n *\n * @readonly\n * @private\n */\n runtimePrimitive: {\n get: function () {\n return this._runtimePrimitive;\n },\n },\n\n /**\n * The model that the draw command belongs to.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {Model}\n *\n * @readonly\n * @private\n */\n model: {\n get: function () {\n return this._model;\n },\n },\n\n /**\n * The primitive type of the draw command.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {PrimitiveType}\n *\n * @readonly\n * @private\n */\n primitiveType: {\n get: function () {\n return this._command.primitiveType;\n },\n },\n\n /**\n * The current model matrix applied to the draw commands. If there are\n * 2D draw commands, their model matrix will be derived from the 3D one.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {Matrix4}\n *\n * @readonly\n * @private\n */\n modelMatrix: {\n get: function () {\n return this._modelMatrix;\n },\n set: function (value) {\n this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n this._modelMatrix2DDirty = true;\n\n this._boundingVolume = BoundingSphere.transform(\n this.runtimePrimitive.boundingSphere,\n this._modelMatrix,\n this._boundingVolume\n );\n },\n },\n\n /**\n * The bounding volume of the main draw command. This is equivalent\n * to the primitive's bounding sphere transformed by the draw\n * command's model matrix.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {BoundingSphere}\n *\n * @readonly\n * @private\n */\n boundingVolume: {\n get: function () {\n return this._boundingVolume;\n },\n },\n\n /**\n * Whether the geometry casts or receives shadows from light sources.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {ShadowMode}\n *\n * @private\n */\n shadows: {\n get: function () {\n return this._shadows;\n },\n set: function (value) {\n this._shadows = value;\n updateShadows(this);\n },\n },\n\n /**\n * Whether to cull back-facing geometry. When true, back face culling is\n * determined by the material's doubleSided property; when false, back face\n * culling is disabled. Back faces are not culled if the command is\n * translucent.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {Boolean}\n *\n * @private\n */\n backFaceCulling: {\n get: function () {\n return this._backFaceCulling;\n },\n set: function (value) {\n if (this._backFaceCulling === value) {\n return;\n }\n\n this._backFaceCulling = value;\n updateBackFaceCulling(this);\n },\n },\n\n /**\n * Determines which faces to cull, if culling is enabled.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {CullFace}\n *\n * @private\n */\n cullFace: {\n get: function () {\n return this._cullFace;\n },\n set: function (value) {\n if (this._cullFace === value) {\n return;\n }\n\n this._cullFace = value;\n updateCullFace(this);\n },\n },\n\n /**\n * Whether to draw the bounding sphere associated with this draw command.\n *\n * @memberof ModelDrawCommand.prototype\n * @type {Boolean}\n *\n * @private\n */\n debugShowBoundingVolume: {\n get: function () {\n return this._debugShowBoundingVolume;\n },\n set: function (value) {\n if (this._debugShowBoundingVolume === value) {\n return;\n }\n\n this._debugShowBoundingVolume = value;\n updateDebugShowBoundingVolume(this);\n },\n },\n});\n\nfunction updateModelMatrix2D(drawCommand, frameState) {\n const modelMatrix = drawCommand._modelMatrix;\n drawCommand._modelMatrix2D = Matrix4.clone(\n modelMatrix,\n drawCommand._modelMatrix2D\n );\n\n // Change the translation's y-component so it appears on the opposite side\n // of the map.\n drawCommand._modelMatrix2D[13] -=\n CesiumMath.sign(modelMatrix[13]) *\n 2.0 *\n CesiumMath.PI *\n frameState.mapProjection.ellipsoid.maximumRadius;\n\n drawCommand._boundingVolume2D = BoundingSphere.transform(\n drawCommand.runtimePrimitive.boundingSphere,\n drawCommand._modelMatrix2D,\n drawCommand._boundingVolume2D\n );\n}\n\nfunction updateShadows(drawCommand) {\n const shadows = drawCommand.shadows;\n const castShadows = ShadowMode.castShadows(shadows);\n const receiveShadows = ShadowMode.receiveShadows(shadows);\n\n const derivedCommands = drawCommand._derivedCommands;\n const length = derivedCommands.length;\n\n for (let i = 0; i < length; ++i) {\n const derivedCommand = derivedCommands[i];\n if (derivedCommand.updateShadows) {\n const command = derivedCommand.command;\n command.castShadows = castShadows;\n command.receiveShadows = receiveShadows;\n }\n }\n}\n\nfunction updateBackFaceCulling(drawCommand) {\n const backFaceCulling = drawCommand.backFaceCulling;\n\n const derivedCommands = drawCommand._derivedCommands;\n const length = derivedCommands.length;\n\n for (let i = 0; i < length; ++i) {\n const derivedCommand = derivedCommands[i];\n if (derivedCommand.updateBackFaceCulling) {\n const command = derivedCommand.command;\n const renderState = clone(command.renderState, true);\n renderState.cull.enabled = backFaceCulling;\n command.renderState = RenderState.fromCache(renderState);\n }\n }\n}\n\nfunction updateCullFace(drawCommand) {\n const cullFace = drawCommand.cullFace;\n\n const derivedCommands = drawCommand._derivedCommands;\n const length = derivedCommands.length;\n\n for (let i = 0; i < length; ++i) {\n const derivedCommand = derivedCommands[i];\n if (derivedCommand.updateCullFace) {\n const command = derivedCommand.command;\n const renderState = clone(command.renderState, true);\n renderState.cull.face = cullFace;\n command.renderState = RenderState.fromCache(renderState);\n }\n }\n}\n\nfunction updateDebugShowBoundingVolume(drawCommand) {\n const debugShowBoundingVolume = drawCommand.debugShowBoundingVolume;\n\n const derivedCommands = drawCommand._derivedCommands;\n const length = derivedCommands.length;\n\n for (let i = 0; i < length; ++i) {\n const derivedCommand = derivedCommands[i];\n if (derivedCommand.updateDebugShowBoundingVolume) {\n const command = derivedCommand.command;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n }\n }\n}\n\n/**\n * Pushes the draw commands necessary to render the primitive.\n * This does not include the draw commands that render its silhouette.\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the draw commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nModelDrawCommand.prototype.pushCommands = function (frameState, result) {\n const use2D = shouldUse2DCommands(this, frameState);\n\n if (use2D && !this._has2DCommands) {\n derive2DCommands(this);\n this._has2DCommands = true;\n this._modelMatrix2DDirty = true;\n }\n\n if (this._modelMatrix2DDirty) {\n updateModelMatrix2D(this, frameState);\n this._modelMatrix2DDirty = false;\n }\n\n const styleCommandsNeeded = this.model.styleCommandsNeeded;\n if (this._needsTranslucentCommand && defined(styleCommandsNeeded)) {\n // StyleCommandsNeeded has three values: all opaque, all translucent, or both.\n if (styleCommandsNeeded !== StyleCommandsNeeded.ALL_OPAQUE) {\n pushCommand(result, this._translucentCommand, use2D);\n }\n\n // Continue only if opaque commands are needed.\n if (styleCommandsNeeded === StyleCommandsNeeded.ALL_TRANSLUCENT) {\n return;\n }\n }\n\n if (this._needsSkipLevelOfDetailCommands) {\n const content = this._model.content;\n const tileset = content.tileset;\n const tile = content.tile;\n\n const hasMixedContent = tileset._hasMixedContent;\n const finalResolution = tile._finalResolution;\n\n if (hasMixedContent) {\n if (!finalResolution) {\n pushCommand(\n tileset._backfaceCommands,\n this._skipLodBackfaceCommand,\n use2D\n );\n }\n\n updateSkipLodStencilCommand(this, tile, use2D);\n pushCommand(result, this._skipLodStencilCommand, use2D);\n return;\n }\n }\n\n if (this._needsSilhouetteCommands) {\n pushCommand(result, this._silhouetteModelCommand, use2D);\n return;\n }\n\n pushCommand(result, this._originalCommand, use2D);\n\n return result;\n};\n\n/**\n * Pushes the draw commands necessary to render the silhouette. These should\n * be added to the command list after the draw commands of all primitives\n * in the model have been added. This way, the silhouette won't render on\n * top of the model.\n * <p>\n * This should only be called after pushCommands() has been invoked for\n * the ModelDrawCommand this frame. Otherwise, the silhouette commands may\n * not have been derived for 2D. The model matrix will also not have been\n * updated for 2D commands.\n * </p>\n *\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} result The array to push the silhouette commands to.\n *\n * @returns {DrawCommand[]} The modified result parameter.\n *\n * @private\n */\nModelDrawCommand.prototype.pushSilhouetteCommands = function (\n frameState,\n result\n) {\n const use2D = shouldUse2DCommands(this, frameState);\n pushCommand(result, this._silhouetteColorCommand, use2D);\n\n return result;\n};\n\nfunction pushCommand(commandList, derivedCommand, use2D) {\n commandList.push(derivedCommand.command);\n if (use2D) {\n commandList.push(derivedCommand.derivedCommand2D.command);\n }\n}\n\nfunction shouldUse2DCommands(drawCommand, frameState) {\n if (frameState.mode !== SceneMode.SCENE2D || drawCommand.model._projectTo2D) {\n return false;\n }\n\n // The draw command's bounding sphere might cause primitives not to render\n // over the IDL, even if they are part of the same model. Use the scene graph's\n // bounding sphere instead.\n const model = drawCommand.model;\n const boundingSphere = model.sceneGraph._boundingSphere2D;\n\n const left = boundingSphere.center.y - boundingSphere.radius;\n const right = boundingSphere.center.y + boundingSphere.radius;\n const idl2D =\n frameState.mapProjection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n return (left < idl2D && right > idl2D) || (left < -idl2D && right > -idl2D);\n}\n\nfunction derive2DCommand(drawCommand, derivedCommand) {\n if (!defined(derivedCommand)) {\n return;\n }\n\n // If the model crosses the IDL in 2D, it will be drawn in one viewport but get\n // clipped by the other viewport. We create a second command that translates\n // the model matrix to the opposite side of the map so the part that was clipped\n // in one viewport is drawn in the other.\n const derivedCommand2D = ModelDerivedCommand.clone(derivedCommand);\n\n const command2D = DrawCommand.shallowClone(derivedCommand.command);\n command2D.modelMatrix = drawCommand._modelMatrix2D;\n command2D.boundingVolume = drawCommand._boundingVolume2D;\n\n derivedCommand2D.command = command2D;\n derivedCommand2D.updateShadows = false; // Shadows are disabled for 2D\n derivedCommand2D.is2D = true;\n\n derivedCommand.derivedCommand2D = derivedCommand2D;\n drawCommand._derivedCommands.push(derivedCommand2D);\n\n return derivedCommand2D;\n}\n\nfunction derive2DCommands(drawCommand) {\n derive2DCommand(drawCommand, drawCommand._originalCommand);\n derive2DCommand(drawCommand, drawCommand._translucentCommand);\n derive2DCommand(drawCommand, drawCommand._skipLodBackfaceCommand);\n derive2DCommand(drawCommand, drawCommand._skipLodStencilCommand);\n derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);\n derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);\n}\n\nfunction deriveTranslucentCommand(command) {\n const derivedCommand = DrawCommand.shallowClone(command);\n derivedCommand.pass = Pass.TRANSLUCENT;\n const rs = clone(command.renderState, true);\n rs.cull.enabled = false;\n rs.depthMask = false;\n rs.blending = BlendingState.ALPHA_BLEND;\n derivedCommand.renderState = RenderState.fromCache(rs);\n\n return derivedCommand;\n}\n\nfunction deriveSilhouetteModelCommand(command, model) {\n // Wrap around after exceeding the 8-bit stencil limit.\n // The reference is unique to each model until this point.\n const stencilReference = model._silhouetteId % 255;\n const silhouetteModelCommand = DrawCommand.shallowClone(command);\n const renderState = clone(command.renderState, true);\n\n // Write the reference value into the stencil buffer.\n renderState.stencilTest = {\n enabled: true,\n frontFunction: WebGLConstants.ALWAYS,\n backFunction: WebGLConstants.ALWAYS,\n reference: stencilReference,\n mask: ~0,\n frontOperation: {\n fail: WebGLConstants.KEEP,\n zFail: WebGLConstants.KEEP,\n zPass: WebGLConstants.REPLACE,\n },\n backOperation: {\n fail: WebGLConstants.KEEP,\n zFail: WebGLConstants.KEEP,\n zPass: WebGLConstants.REPLACE,\n },\n };\n\n if (model.isInvisible()) {\n renderState.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n }\n\n silhouetteModelCommand.renderState = RenderState.fromCache(renderState);\n\n return silhouetteModelCommand;\n}\n\nfunction deriveSilhouetteColorCommand(command, model) {\n // Wrap around after exceeding the 8-bit stencil limit.\n // The reference is unique to each model until this point.\n const stencilReference = model._silhouetteId % 255;\n const silhouetteColorCommand = DrawCommand.shallowClone(command);\n const renderState = clone(command.renderState, true);\n renderState.cull.enabled = false;\n\n // Render the silhouette in the translucent pass if either the command\n // pass or the silhouette color is translucent. This will account for\n // translucent model color, since ModelColorPipelineStage sets the pass\n // to translucent.\n const silhouetteTranslucent =\n command.pass === Pass.TRANSLUCENT || model.silhouetteColor.alpha < 1.0;\n if (silhouetteTranslucent) {\n silhouetteColorCommand.pass = Pass.TRANSLUCENT;\n renderState.depthMask = false;\n renderState.blending = BlendingState.ALPHA_BLEND;\n }\n\n // Only render the pixels of the silhouette that don't conflict with\n // the stencil buffer. This way, the silhouette doesn't render over\n // the original model.\n renderState.stencilTest = {\n enabled: true,\n frontFunction: WebGLConstants.NOTEQUAL,\n backFunction: WebGLConstants.NOTEQUAL,\n reference: stencilReference,\n mask: ~0,\n frontOperation: {\n fail: WebGLConstants.KEEP,\n zFail: WebGLConstants.KEEP,\n zPass: WebGLConstants.KEEP,\n },\n backOperation: {\n fail: WebGLConstants.KEEP,\n zFail: WebGLConstants.KEEP,\n zPass: WebGLConstants.KEEP,\n },\n };\n\n const uniformMap = clone(command.uniformMap);\n uniformMap.model_silhouettePass = function () {\n return true;\n };\n\n silhouetteColorCommand.renderState = RenderState.fromCache(renderState);\n silhouetteColorCommand.uniformMap = uniformMap;\n silhouetteColorCommand.castShadows = false;\n silhouetteColorCommand.receiveShadows = false;\n\n return silhouetteColorCommand;\n}\n\nfunction updateSkipLodStencilCommand(drawCommand, tile, use2D) {\n const stencilDerivedComand = drawCommand._skipLodStencilCommand;\n const stencilCommand = stencilDerivedComand.command;\n\n const selectionDepth = tile._selectionDepth;\n const lastSelectionDepth = getLastSelectionDepth(stencilCommand);\n\n if (selectionDepth !== lastSelectionDepth) {\n const skipLodStencilReference = getStencilReference(selectionDepth);\n const renderState = clone(stencilCommand.renderState, true);\n renderState.stencilTest.reference = skipLodStencilReference;\n stencilCommand.renderState = RenderState.fromCache(renderState);\n\n if (use2D) {\n stencilDerivedComand.derivedCommand2D.renderState = renderState;\n }\n }\n}\n\nfunction getLastSelectionDepth(stencilCommand) {\n // Isolate the selection depth from the stencil reference.\n const reference = stencilCommand.renderState.stencilTest.reference;\n return (\n (reference & StencilConstants.SKIP_LOD_MASK) >>>\n StencilConstants.SKIP_LOD_BIT_SHIFT\n );\n}\n\nfunction getStencilReference(selectionDepth) {\n // Stencil test is masked to the most significant 3 bits so the reference is shifted.\n // Writes 0 for the terrain bit.\n return (\n StencilConstants.CESIUM_3D_TILE_MASK |\n (selectionDepth << StencilConstants.SKIP_LOD_BIT_SHIFT)\n );\n}\n\nfunction deriveSkipLodBackfaceCommand(command) {\n // Write just backface depth of unresolved tiles so resolved stenciled tiles\n // do not appear in front.\n const backfaceCommand = DrawCommand.shallowClone(command);\n const renderState = clone(command.renderState, true);\n renderState.cull.enabled = true;\n renderState.cull.face = CullFace.FRONT;\n // Back faces do not need to write color.\n renderState.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n // Push back face depth away from the camera so it is less likely that back faces and front faces of the same tile\n // intersect and overlap. This helps avoid flickering for very thin double-sided walls.\n renderState.polygonOffset = {\n enabled: true,\n factor: 5.0,\n units: 5.0,\n };\n\n // The stencil test is set in TilesetPipelineStage.\n\n const uniformMap = clone(backfaceCommand.uniformMap);\n const polygonOffset = new Cartesian2(5.0, 5.0);\n\n uniformMap.u_polygonOffset = function () {\n return polygonOffset;\n };\n\n backfaceCommand.renderState = RenderState.fromCache(renderState);\n backfaceCommand.uniformMap = uniformMap;\n backfaceCommand.castShadows = false;\n backfaceCommand.receiveShadows = false;\n\n return backfaceCommand;\n}\n\nfunction deriveSkipLodStencilCommand(command) {\n // Tiles only draw if their selection depth is >= the tile drawn already. They write their\n // selection depth to the stencil buffer to prevent ancestor tiles from drawing on top\n const stencilCommand = DrawCommand.shallowClone(command);\n const renderState = clone(command.renderState, true);\n // The stencil reference is updated dynamically; see updateSkipLodStencilCommand().\n renderState.stencilTest.enabled = true;\n renderState.stencilTest.mask = StencilConstants.SKIP_LOD_MASK;\n renderState.stencilTest.reference = StencilConstants.CESIUM_3D_TILE_MASK;\n renderState.stencilTest.frontFunction = StencilFunction.GREATER_OR_EQUAL;\n renderState.stencilTest.frontOperation.zPass = StencilOperation.REPLACE;\n renderState.stencilTest.backFunction = StencilFunction.GREATER_OR_EQUAL;\n renderState.stencilTest.backOperation.zPass = StencilOperation.REPLACE;\n renderState.stencilMask =\n StencilConstants.CESIUM_3D_TILE_MASK | StencilConstants.SKIP_LOD_MASK;\n\n stencilCommand.renderState = RenderState.fromCache(renderState);\n\n return stencilCommand;\n}\n\nexport default ModelDrawCommand;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport clone from \"../../Core/clone.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport DrawCommand from \"../../Renderer/DrawCommand.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport VertexArray from \"../../Renderer/VertexArray.js\";\nimport ModelFS from \"../../Shaders/Model/ModelFS.js\";\nimport ModelVS from \"../../Shaders/Model/ModelVS.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport ClassificationModelDrawCommand from \"./ClassificationModelDrawCommand.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelDrawCommand from \"./ModelDrawCommand.js\";\n\n/**\n * Builds the {@link ModelDrawCommand} for a {@link ModelRuntimePrimitive}\n * using its render resources. If the model classifies another asset, it\n * builds a {@link ClassificationModelDrawCommand} instead.\n *\n * @param {PrimitiveRenderResources} primitiveRenderResources The render resources for a primitive.\n * @param {FrameState} frameState The frame state for creating GPU resources.\n *\n * @returns {ModelDrawCommand|ClassificationModelDrawCommand} The generated ModelDrawCommand or ClassificationModelDrawCommand.\n *\n * @private\n */\nfunction buildDrawCommand(primitiveRenderResources, frameState) {\n const shaderBuilder = primitiveRenderResources.shaderBuilder;\n shaderBuilder.addVertexLines(ModelVS);\n shaderBuilder.addFragmentLines(ModelFS);\n\n const indexBuffer = getIndexBuffer(primitiveRenderResources);\n\n const vertexArray = new VertexArray({\n context: frameState.context,\n indexBuffer: indexBuffer,\n attributes: primitiveRenderResources.attributes,\n });\n\n const model = primitiveRenderResources.model;\n model._pipelineResources.push(vertexArray);\n\n const shaderProgram = shaderBuilder.buildShaderProgram(frameState.context);\n model._pipelineResources.push(shaderProgram);\n\n const pass = primitiveRenderResources.alphaOptions.pass;\n const sceneGraph = model.sceneGraph;\n\n const modelMatrix = Matrix4.multiplyTransformation(\n sceneGraph.computedModelMatrix,\n primitiveRenderResources.runtimeNode.computedTransform,\n new Matrix4()\n );\n\n let boundingSphere;\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n !frameState.scene3DOnly &&\n model._projectTo2D\n ) {\n const runtimePrimitive = primitiveRenderResources.runtimePrimitive;\n boundingSphere = runtimePrimitive.boundingSphere2D;\n } else {\n boundingSphere = BoundingSphere.transform(\n primitiveRenderResources.boundingSphere,\n modelMatrix,\n primitiveRenderResources.boundingSphere\n );\n }\n\n // Initialize render state with default values\n let renderState = clone(\n RenderState.fromCache(primitiveRenderResources.renderStateOptions),\n true\n );\n\n renderState.cull.face = ModelUtility.getCullFace(\n modelMatrix,\n primitiveRenderResources.primitiveType\n );\n renderState = RenderState.fromCache(renderState);\n\n const hasClassification = defined(model.classificationType);\n const castShadows = hasClassification\n ? false\n : ShadowMode.castShadows(model.shadows);\n const receiveShadows = hasClassification\n ? false\n : ShadowMode.receiveShadows(model.shadows);\n // Pick IDs are only added to specific draw commands for classification.\n // This behavior is handled by ClassificationModelDrawCommand.\n const pickId = hasClassification\n ? undefined\n : primitiveRenderResources.pickId;\n\n const command = new DrawCommand({\n boundingVolume: boundingSphere,\n modelMatrix: modelMatrix,\n uniformMap: primitiveRenderResources.uniformMap,\n renderState: renderState,\n vertexArray: vertexArray,\n shaderProgram: shaderProgram,\n cull: model.cull,\n pass: pass,\n count: primitiveRenderResources.count,\n owner: model,\n pickId: pickId,\n instanceCount: primitiveRenderResources.instanceCount,\n primitiveType: primitiveRenderResources.primitiveType,\n debugShowBoundingVolume: model.debugShowBoundingVolume,\n castShadows: castShadows,\n receiveShadows: receiveShadows,\n });\n\n if (hasClassification) {\n return new ClassificationModelDrawCommand({\n primitiveRenderResources: primitiveRenderResources,\n command: command,\n });\n }\n\n return new ModelDrawCommand({\n primitiveRenderResources: primitiveRenderResources,\n command: command,\n });\n}\n\n/**\n * @private\n */\nfunction getIndexBuffer(primitiveRenderResources) {\n const wireframeIndexBuffer = primitiveRenderResources.wireframeIndexBuffer;\n if (defined(wireframeIndexBuffer)) {\n return wireframeIndexBuffer;\n }\n\n const indices = primitiveRenderResources.indices;\n if (!defined(indices)) {\n return undefined;\n }\n\n return indices.buffer;\n}\n\nexport default buildDrawCommand;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * An enum describing whether a variable should be added to the\n * vertex shader, the fragment shader, or both.\n *\n * @private\n */\nconst ShaderDestination = {\n VERTEX: 0,\n FRAGMENT: 1,\n BOTH: 2,\n};\n\n/**\n * Check if a variable should be included in the vertex shader.\n *\n * @param {ShaderDestination} destination The ShaderDestination to check\n * @return {Boolean} <code>true</code> if the variable appears in the vertex shader, or <code>false</code> otherwise\n * @private\n */\nShaderDestination.includesVertexShader = function (destination) {\n return (\n destination === ShaderDestination.VERTEX ||\n destination === ShaderDestination.BOTH\n );\n};\n\n/**\n * Check if a variable should be included in the vertex shader.\n *\n * @param {ShaderDestination} destination The ShaderDestination to check\n * @return {Boolean} <code>true</code> if the variable appears in the vertex shader, or <code>false</code> otherwise\n * @private\n */\nShaderDestination.includesFragmentShader = function (destination) {\n//\n return (\n destination === ShaderDestination.FRAGMENT ||\n destination === ShaderDestination.BOTH\n );\n};\n\nexport default Object.freeze(ShaderDestination);\n", "import combine from \"../../Core/combine.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Cartesian2 from \"../../Core/Cartesian2.js\";\nimport StencilConstants from \"../StencilConstants.js\";\n\n/**\n * The tileset pipeline stage is responsible for updating the model with behavior\n * specific to 3D Tiles.\n *\n * @namespace TilesetPipelineStage\n *\n * @private\n */\nconst TilesetPipelineStage = {\n name: \"TilesetPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>adds a define to the fragment shader to indicate that the model uses polygon offset for the skipLevelOfDetail optimization</li>\n * <li>adds a function to the uniform map to supply polygon offset values for the skipLevelOfDetail optimization</li>\n * <li>sets stencil values that enable classification on 3D Tiles</li>\n * </ul>\n *\n * <p>\n * See {@link ModelDrawCommand} for the corresponding skipLevelOfDetail derived commands.\n * </p>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {ModelExperimental} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nTilesetPipelineStage.process = function (renderResources, model, frameState) {\n if (model.hasSkipLevelOfDetail(frameState)) {\n // Make the log-depth depth fragment write account for the polygon offset, too.\n // Otherwise, the back face commands will cause the higher resolution\n // tiles to disappear.\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addDefine(\n \"POLYGON_OFFSET\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n // This value will be overriden by the depth-only back face derived command.\n // We just prepare it in advance so we don't have to recompile the shader.\n // We don't add a uniform declaration through ShaderBuilder because\n // this is included in writeLogDepth.glsl\n const uniformMap = {\n u_polygonOffset: function () {\n return Cartesian2.ZERO;\n },\n };\n\n renderResources.uniformMap = combine(\n uniformMap,\n renderResources.uniformMap\n );\n renderResources.hasSkipLevelOfDetail = true;\n }\n\n // Set stencil values for classification on 3D Tiles. This is applied to all\n // of the derived commands, not just the back-face derived command.\n const renderStateOptions = renderResources.renderStateOptions;\n renderStateOptions.stencilTest = StencilConstants.setCesium3DTileBit();\n renderStateOptions.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n};\n\nexport default TilesetPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec3 proceduralIBL(\\n\\\nvec3 positionEC,\\n\\\nvec3 normalEC,\\n\\\nvec3 lightDirectionEC,\\n\\\nvec3 lightColorHdr,\\n\\\nczm_pbrParameters pbrParameters\\n\\\n) {\\n\\\nvec3 v = -positionEC;\\n\\\nvec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\\n\\\nvec3 vWC = -normalize(positionWC);\\n\\\nvec3 l = normalize(lightDirectionEC);\\n\\\nvec3 n = normalEC;\\n\\\nvec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\\n\\\nfloat NdotL = clamp(dot(n, l), 0.001, 1.0);\\n\\\nfloat NdotV = abs(dot(n, v)) + 0.001;\\n\\\nfloat vertexRadius = length(positionWC);\\n\\\nfloat horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\\n\\\nfloat reflectionDotNadir = dot(r, normalize(positionWC));\\n\\\nr.x = -r.x;\\n\\\nr = -normalize(czm_temeToPseudoFixed * r);\\n\\\nr.x = -r.x;\\n\\\nvec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\nfloat roughness = pbrParameters.roughness;\\n\\\nvec3 specularColor = pbrParameters.f0;\\n\\\nfloat inverseRoughness = 1.04 - roughness;\\n\\\ninverseRoughness *= inverseRoughness;\\n\\\nvec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\\n\\\nfloat atmosphereHeight = 0.05;\\n\\\nfloat blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\\n\\\nfloat blendRegionOffset = roughness * -1.0;\\n\\\nfloat farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\nfloat aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\nfloat farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\\n\\\nfloat smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\\n\\\nvec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\\n\\\nvec3 nadirColor = belowHorizonColor * 0.5;\\n\\\nvec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\\n\\\nvec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\\n\\\nvec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\\n\\\nvec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\\n\\\nfloat diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\\n\\\nfloat diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\\n\\\nvec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\\n\\\nfloat notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\\n\\\nvec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\\n\\\nspecularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\\n\\\nspecularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\\n\\\n#ifdef USE_SUN_LUMINANCE\\n\\\nfloat LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);\\n\\\nfloat S = acos(LdotZenith);\\n\\\nfloat NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);\\n\\\nfloat gamma = acos(NdotL);\\n\\\nfloat numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\\n\\\nfloat denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\\n\\\nfloat luminance = model_luminanceAtZenith * (numerator / denominator);\\n\\\n#endif\\n\\\nvec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\\n\\\nvec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);\\n\\\nfloat maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\\n\\\nvec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\\n\\\niblColor *= lightColor;\\n\\\n#ifdef USE_SUN_LUMINANCE\\n\\\niblColor *= luminance;\\n\\\n#endif\\n\\\nreturn iblColor;\\n\\\n}\\n\\\nvec3 textureIBL(\\n\\\nvec3 positionEC,\\n\\\nvec3 normalEC,\\n\\\nvec3 lightDirectionEC,\\n\\\nczm_pbrParameters pbrParameters\\n\\\n) {\\n\\\nvec3 diffuseColor = pbrParameters.diffuseColor;\\n\\\nfloat roughness = pbrParameters.roughness;\\n\\\nvec3 specularColor = pbrParameters.f0;\\n\\\nvec3 v = -positionEC;\\n\\\nvec3 n = normalEC;\\n\\\nvec3 l = normalize(lightDirectionEC);\\n\\\nvec3 h = normalize(v + l);\\n\\\nfloat NdotV = abs(dot(n, v)) + 0.001;\\n\\\nfloat VdotH = clamp(dot(v, h), 0.0, 1.0);\\n\\\nconst mat3 yUpToZUp = mat3(\\n\\\n-1.0, 0.0, 0.0,\\n\\\n0.0, 0.0, -1.0,\\n\\\n0.0, 1.0, 0.0\\n\\\n);\\n\\\nvec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n)));\\n\\\n#ifdef DIFFUSE_IBL\\n\\\n#ifdef CUSTOM_SPHERICAL_HARMONICS\\n\\\nvec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);\\n\\\n#else\\n\\\nvec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);\\n\\\n#endif\\n\\\n#else\\n\\\nvec3 diffuseIrradiance = vec3(0.0);\\n\\\n#endif\\n\\\n#ifdef SPECULAR_IBL\\n\\\nvec3 r0 = specularColor.rgb;\\n\\\nfloat reflectance = max(max(r0.r, r0.g), r0.b);\\n\\\nvec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\\n\\\nvec3 F = fresnelSchlick2(r0, r90, VdotH);\\n\\\nvec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\\n\\\n#ifdef CUSTOM_SPECULAR_IBL\\n\\\nvec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);\\n\\\n#else\\n\\\nvec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\\n\\\n#endif\\n\\\nspecularIBL *= F * brdfLut.x + brdfLut.y;\\n\\\n#else\\n\\\nvec3 specularIBL = vec3(0.0);\\n\\\n#endif\\n\\\nreturn diffuseColor * diffuseIrradiance + specularColor * specularIBL;\\n\\\n}\\n\\\nvec3 imageBasedLightingStage(\\n\\\nvec3 positionEC,\\n\\\nvec3 normalEC,\\n\\\nvec3 lightDirectionEC,\\n\\\nvec3 lightColorHdr,\\n\\\nczm_pbrParameters pbrParameters\\n\\\n) {\\n\\\n#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\\n\\\nreturn textureIBL(\\n\\\npositionEC,\\n\\\nnormalEC,\\n\\\nlightDirectionEC,\\n\\\npbrParameters\\n\\\n);\\n\\\n#else\\n\\\nreturn proceduralIBL(\\n\\\npositionEC,\\n\\\nnormalEC,\\n\\\nlightDirectionEC,\\n\\\nlightColorHdr,\\n\\\npbrParameters\\n\\\n);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ImageBasedLightingStageFS from \"../../Shaders/Model/ImageBasedLightingStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport OctahedralProjectedCubeMap from \"../OctahedralProjectedCubeMap.js\";\n\nconst ImageBasedLightingPipelineStage = {\n name: \"ImageBasedLightingPipelineStage\", // Helps with debugging\n};\n\nImageBasedLightingPipelineStage.process = function (\n renderResources,\n model,\n frameState\n) {\n const imageBasedLighting = model.imageBasedLighting;\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"USE_IBL_LIGHTING\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"vec2\",\n \"model_iblFactor\",\n ShaderDestination.FRAGMENT\n );\n\n if (OctahedralProjectedCubeMap.isSupported(frameState.context)) {\n const addMatrix =\n imageBasedLighting.useSphericalHarmonics ||\n imageBasedLighting.useSpecularEnvironmentMaps ||\n imageBasedLighting.enabled;\n if (addMatrix) {\n shaderBuilder.addUniform(\n \"mat3\",\n \"model_iblReferenceFrameMatrix\",\n ShaderDestination.FRAGMENT\n );\n }\n\n if (defined(imageBasedLighting.sphericalHarmonicCoefficients)) {\n shaderBuilder.addDefine(\n \"DIFFUSE_IBL\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addDefine(\n \"CUSTOM_SPHERICAL_HARMONICS\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"vec3\",\n \"model_sphericalHarmonicCoefficients[9]\",\n ShaderDestination.FRAGMENT\n );\n } else if (imageBasedLighting.useDefaultSphericalHarmonics) {\n shaderBuilder.addDefine(\n \"DIFFUSE_IBL\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n if (\n defined(imageBasedLighting.specularEnvironmentMapAtlas) &&\n imageBasedLighting.specularEnvironmentMapAtlas.ready\n ) {\n shaderBuilder.addDefine(\n \"SPECULAR_IBL\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addDefine(\n \"CUSTOM_SPECULAR_IBL\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"sampler2D\",\n \"model_specularEnvironmentMaps\",\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"vec2\",\n \"model_specularEnvironmentMapsSize\",\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"float\",\n \"model_specularEnvironmentMapsMaximumLOD\",\n ShaderDestination.FRAGMENT\n );\n } else if (model.useDefaultSpecularMaps) {\n shaderBuilder.addDefine(\n \"SPECULAR_IBL\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n }\n\n if (defined(imageBasedLighting.luminanceAtZenith)) {\n shaderBuilder.addDefine(\n \"USE_SUN_LUMINANCE\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"float\",\n \"model_luminanceAtZenith\",\n ShaderDestination.FRAGMENT\n );\n }\n\n shaderBuilder.addFragmentLines(ImageBasedLightingStageFS);\n\n const uniformMap = {\n model_iblFactor: function () {\n return imageBasedLighting.imageBasedLightingFactor;\n },\n model_iblReferenceFrameMatrix: function () {\n return model._iblReferenceFrameMatrix;\n },\n model_luminanceAtZenith: function () {\n return imageBasedLighting.luminanceAtZenith;\n },\n model_sphericalHarmonicCoefficients: function () {\n return imageBasedLighting.sphericalHarmonicCoefficients;\n },\n model_specularEnvironmentMaps: function () {\n return imageBasedLighting.specularEnvironmentMapAtlas.texture;\n },\n model_specularEnvironmentMapsSize: function () {\n return imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions;\n },\n model_specularEnvironmentMapsMaximumLOD: function () {\n return imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel;\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nexport default ImageBasedLightingPipelineStage;\n", "import ArticulationStageType from \"../../Core/ArticulationStageType.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\n\nconst articulationEpsilon = CesiumMath.EPSILON16;\n\n/**\n * An in-memory representation of an articulation stage belonging to a\n * {@link ModelArticulation}.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.ArticulationStage} options.stage The articulation stage components from the 3D model.\n * @param {ModelArticulation} options.runtimeArticulation The runtime articulation that this stage belongs to.\n *\n * @alias ModelArticulationStage\n * @constructor\n *\n * @private\n */\nfunction ModelArticulationStage(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const stage = options.stage;\n const runtimeArticulation = options.runtimeArticulation;\n this._stage = stage;\n this._runtimeArticulation = runtimeArticulation;\n\n this._name = stage.name;\n this._type = stage.type;\n this._minimumValue = stage.minimumValue;\n this._maximumValue = stage.maximumValue;\n this._currentValue = stage.initialValue;\n}\n\nObject.defineProperties(ModelArticulationStage.prototype, {\n /**\n * The internal articulation stage that this runtime stage represents.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {ModelComponents.ArticulationStage}\n * @readonly\n *\n * @private\n */\n stage: {\n get: function () {\n return this._stage;\n },\n },\n\n /**\n * The runtime articulation that this stage belongs to.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {ModelArticulation}\n * @readonly\n *\n * @private\n */\n runtimeArticulation: {\n get: function () {\n return this._runtimeArticulation;\n },\n },\n\n /**\n * The name of this articulation stage.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {String}\n * @readonly\n *\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The type of this articulation stage. This specifies which of the\n * node's properties is modified by the stage's value.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {ArticulationStageType}\n * @readonly\n *\n * @private\n */\n type: {\n get: function () {\n return this._type;\n },\n },\n\n /**\n * The minimum value of this articulation stage.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {Number}\n * @readonly\n *\n * @private\n */\n minimumValue: {\n get: function () {\n return this._minimumValue;\n },\n },\n\n /**\n * The maximum value of this articulation stage.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {Number}\n * @readonly\n *\n * @private\n */\n maximumValue: {\n get: function () {\n return this._maximumValue;\n },\n },\n\n /**\n * The current value of this articulation stage.\n *\n * @memberof ModelArticulationStage.prototype\n * @type {Number}\n *\n * @private\n */\n currentValue: {\n get: function () {\n return this._currentValue;\n },\n set: function (value) {\n value = CesiumMath.clamp(value, this.minimumValue, this.maximumValue);\n if (\n !CesiumMath.equalsEpsilon(\n this._currentValue,\n value,\n articulationEpsilon\n )\n ) {\n this._currentValue = value;\n this.runtimeArticulation._dirty = true;\n }\n },\n },\n});\n\nconst scratchArticulationCartesian = new Cartesian3();\nconst scratchArticulationRotation = new Matrix3();\n\n/**\n * Modifies a Matrix4 by applying a transformation for a given value of a stage.\n * Note that the <code>result</code> parameter is not just a container for the\n * returned value. The incoming value of <code>result</code> is part of the\n * computation itself. Various stages of an articulation can be multiplied\n * together, so their transformations are all merged into a composite Matrix4\n * representing them all.\n *\n * @param {Matrix4} result The matrix to be modified.\n * @returns {Matrix4} The transformed matrix as requested by the articulation stage.\n *\n * @private\n */\nModelArticulationStage.prototype.applyStageToMatrix = function (result) {\n const type = this.type;\n const value = this.currentValue;\n const cartesian = scratchArticulationCartesian;\n let rotation;\n switch (type) {\n case ArticulationStageType.XROTATE:\n rotation = Matrix3.fromRotationX(\n CesiumMath.toRadians(value),\n scratchArticulationRotation\n );\n result = Matrix4.multiplyByMatrix3(result, rotation, result);\n break;\n case ArticulationStageType.YROTATE:\n rotation = Matrix3.fromRotationY(\n CesiumMath.toRadians(value),\n scratchArticulationRotation\n );\n result = Matrix4.multiplyByMatrix3(result, rotation, result);\n break;\n case ArticulationStageType.ZROTATE:\n rotation = Matrix3.fromRotationZ(\n CesiumMath.toRadians(value),\n scratchArticulationRotation\n );\n result = Matrix4.multiplyByMatrix3(result, rotation, result);\n break;\n case ArticulationStageType.XTRANSLATE:\n cartesian.x = value;\n cartesian.y = 0.0;\n cartesian.z = 0.0;\n result = Matrix4.multiplyByTranslation(result, cartesian, result);\n break;\n case ArticulationStageType.YTRANSLATE:\n cartesian.x = 0.0;\n cartesian.y = value;\n cartesian.z = 0.0;\n result = Matrix4.multiplyByTranslation(result, cartesian, result);\n break;\n case ArticulationStageType.ZTRANSLATE:\n cartesian.x = 0.0;\n cartesian.y = 0.0;\n cartesian.z = value;\n result = Matrix4.multiplyByTranslation(result, cartesian, result);\n break;\n case ArticulationStageType.XSCALE:\n cartesian.x = value;\n cartesian.y = 1.0;\n cartesian.z = 1.0;\n result = Matrix4.multiplyByScale(result, cartesian, result);\n break;\n case ArticulationStageType.YSCALE:\n cartesian.x = 1.0;\n cartesian.y = value;\n cartesian.z = 1.0;\n result = Matrix4.multiplyByScale(result, cartesian, result);\n break;\n case ArticulationStageType.ZSCALE:\n cartesian.x = 1.0;\n cartesian.y = 1.0;\n cartesian.z = value;\n result = Matrix4.multiplyByScale(result, cartesian, result);\n break;\n case ArticulationStageType.UNIFORMSCALE:\n result = Matrix4.multiplyByUniformScale(result, value, result);\n break;\n default:\n break;\n }\n\n return result;\n};\n\nexport default ModelArticulationStage;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelArticulationStage from \"./ModelArticulationStage.js\";\n\n/**\n * An in-memory representation of an articulation that affects nodes in the\n * {@link ModelSceneGraph}. This is defined in a model by the\n * <code>AGI_articulations</code> extension.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.Articulation} options.articulation The articulation components from the 3D model.\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this articulation belongs to.\n *\n * @alias ModelArticulation\n * @constructor\n *\n * @private\n */\nfunction ModelArticulation(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const articulation = options.articulation;\n const sceneGraph = options.sceneGraph;\n this._articulation = articulation;\n this._sceneGraph = sceneGraph;\n\n this._name = articulation.name;\n this._runtimeStages = [];\n this._runtimeStagesByName = {};\n\n // Will be populated as the runtime nodes are created\n this._runtimeNodes = [];\n\n // Set to true so that the first call to\n // ModelSceneGraph.applyArticulations will work.\n this._dirty = true;\n\n initialize(this);\n}\n\nObject.defineProperties(ModelArticulation.prototype, {\n /**\n * The internal articulation that this runtime articulation represents.\n *\n * @memberof ModelArticulation.prototype\n * @type {ModelComponents.Articulation}\n * @readonly\n *\n * @private\n */\n articulation: {\n get: function () {\n return this._articulation;\n },\n },\n\n /**\n * The scene graph that this articulation belongs to.\n *\n * @memberof ModelArticulation.prototype\n * @type {ModelSceneGraph}\n * @readonly\n *\n * @private\n */\n sceneGraph: {\n get: function () {\n return this._sceneGraph;\n },\n },\n\n /**\n * The name of this articulation.\n *\n * @memberof ModelArticulation.prototype\n * @type {String}\n * @readonly\n *\n * @private\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * The runtime stages that belong to this articulation.\n *\n * @memberof ModelArticulation.prototype\n * @type {ModelArticulationStage[]}\n * @readonly\n *\n * @private\n */\n runtimeStages: {\n get: function () {\n return this._runtimeStages;\n },\n },\n\n /**\n * The runtime nodes that are affected by this articulation.\n *\n * @memberof ModelArticulation.prototype\n * @type {ModelRuntimeNode[]}\n * @readonly\n *\n * @private\n */\n runtimeNodes: {\n get: function () {\n return this._runtimeNodes;\n },\n },\n});\n\nfunction initialize(runtimeArticulation) {\n const articulation = runtimeArticulation.articulation;\n\n const stages = articulation.stages;\n const length = stages.length;\n\n const runtimeStages = runtimeArticulation._runtimeStages;\n const runtimeStagesByName = runtimeArticulation._runtimeStagesByName;\n for (let i = 0; i < length; i++) {\n const stage = stages[i];\n const runtimeStage = new ModelArticulationStage({\n stage: stage,\n runtimeArticulation: runtimeArticulation,\n });\n\n // Store the stages in an array to preserve the order in which\n // they appeared in the 3D model.\n runtimeStages.push(runtimeStage);\n\n // Store the stages in a dictionary for retrieval by name.\n const stageName = stage.name;\n runtimeStagesByName[stageName] = runtimeStage;\n }\n}\n\n/**\n * Sets the current value of an articulation stage.\n *\n * @param {String} stageName The name of the articulation stage.\n * @param {Number} value The numeric value of this stage of the articulation.\n *\n * @private\n */\nModelArticulation.prototype.setArticulationStage = function (stageName, value) {\n const stage = this._runtimeStagesByName[stageName];\n if (defined(stage)) {\n stage.currentValue = value;\n }\n};\n\nconst scratchArticulationMatrix = new Matrix4();\nconst scratchNodeMatrix = new Matrix4();\n\n/**\n * Applies the chain of articulation stages to the transform of each node that\n * participates in the articulation. This only recomputes the node transforms\n * if any stage in the articulation has been modified.\n * <p>\n * Note that this will overwrite any existing transformations on participating\n * nodes.\n * </p>\n *\n * @private\n */\nModelArticulation.prototype.apply = function () {\n if (!this._dirty) {\n return;\n }\n this._dirty = false;\n\n let articulationMatrix = Matrix4.clone(\n Matrix4.IDENTITY,\n scratchArticulationMatrix\n );\n\n let i;\n const stages = this._runtimeStages;\n const stagesLength = stages.length;\n\n // Compute the result of the articulation stages...\n for (i = 0; i < stagesLength; i++) {\n const stage = stages[i];\n articulationMatrix = stage.applyStageToMatrix(articulationMatrix);\n }\n\n // ...then apply it to the transforms of the affected nodes.\n const nodes = this._runtimeNodes;\n const nodesLength = nodes.length;\n for (i = 0; i < nodesLength; i++) {\n const node = nodes[i];\n const transform = Matrix4.multiplyTransformation(\n node.originalTransform,\n articulationMatrix,\n scratchNodeMatrix\n );\n node.transform = transform;\n }\n};\n\nexport default ModelArticulation;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void modelColorStage(inout czm_modelMaterial material)\\n\\\n{\\n\\\nmaterial.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);\\n\\\nfloat highlight = ceil(model_colorBlend);\\n\\\nmaterial.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);\\n\\\nmaterial.alpha *= model_color.a;\\n\\\n}\\n\\\n\";\n", "import ColorBlendMode from \"../ColorBlendMode.js\";\nimport combine from \"../../Core/combine.js\";\nimport ModelColorStageFS from \"../../Shaders/Model/ModelColorStageFS.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model color pipeline stage is responsible for handling the application of a static color to the model.\n *\n * @namespace ModelColorPipelineStage\n *\n * @private\n */\nconst ModelColorPipelineStage = {\n name: \"ModelColorPipelineStage\", // Helps with debugging\n\n COLOR_UNIFORM_NAME: \"model_color\",\n COLOR_BLEND_UNIFORM_NAME: \"model_colorBlend\",\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>adds a define to the fragment shader to indicate that the model has a color</li>\n * <li>adds a function to the fragment shader to apply the color to the model's base color</li>\n * <li>adds the uniforms for the fragment shader for the model's color and blending properties</li>\n * <li>updates the pass type in the render resources based on translucency of the model's color</li>\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelColorPipelineStage.process = function (\n renderResources,\n model,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"HAS_MODEL_COLOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addFragmentLines(ModelColorStageFS);\n\n const stageUniforms = {};\n\n // Pass the model's color as a uniform. Set the pass type to translucent, if needed.\n const color = model.color;\n\n if (color.alpha === 0.0 && !model.hasSilhouette(frameState)) {\n renderResources.renderStateOptions.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n }\n\n if (color.alpha < 1.0) {\n renderResources.alphaOptions.pass = Pass.TRANSLUCENT;\n }\n\n shaderBuilder.addUniform(\n \"vec4\",\n ModelColorPipelineStage.COLOR_UNIFORM_NAME,\n ShaderDestination.FRAGMENT\n );\n stageUniforms[ModelColorPipelineStage.COLOR_UNIFORM_NAME] = function () {\n return model.color;\n };\n\n // Create a colorBlend from the model's colorBlendMode and colorBlendAmount and pass it as a uniform.\n shaderBuilder.addUniform(\n \"float\",\n ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME,\n ShaderDestination.FRAGMENT\n );\n stageUniforms[\n ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME\n ] = function () {\n return ColorBlendMode.getColorBlend(\n model.colorBlendMode,\n model.colorBlendAmount\n );\n };\n\n renderResources.uniformMap = combine(\n stageUniforms,\n renderResources.uniformMap\n );\n};\n\nexport default ModelColorPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE\\n\\\nvec4 getClippingPlane(\\n\\\nhighp sampler2D packedClippingPlanes,\\n\\\nint clippingPlaneNumber,\\n\\\nmat4 transform\\n\\\n) {\\n\\\nint pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;\\n\\\nint pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\nfloat pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\nfloat pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\\n\\\nfloat u = (float(pixX) + 0.5) * pixelWidth;\\n\\\nfloat v = (float(pixY) + 0.5) * pixelHeight;\\n\\\nvec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\\n\\\nreturn czm_transformPlane(plane, transform);\\n\\\n}\\n\\\n#else\\n\\\nvec4 getClippingPlane(\\n\\\nhighp sampler2D packedClippingPlanes,\\n\\\nint clippingPlaneNumber,\\n\\\nmat4 transform\\n\\\n) {\\n\\\nint clippingPlaneStartIndex = clippingPlaneNumber * 2;\\n\\\nint pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;\\n\\\nint pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\nfloat pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\\n\\\nfloat pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\\n\\\nfloat u = (float(pixX) + 0.5) * pixelWidth;\\n\\\nfloat v = (float(pixY) + 0.5) * pixelHeight;\\n\\\nvec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\\n\\\nvec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\\n\\\nvec4 plane;\\n\\\nplane.xyz = czm_octDecode(oct, 65535.0);\\n\\\nplane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));\\n\\\nreturn czm_transformPlane(plane, transform);\\n\\\n}\\n\\\n#endif\\n\\\nfloat clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {\\n\\\nvec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\\\nvec3 clipNormal = vec3(0.0);\\n\\\nvec3 clipPosition = vec3(0.0);\\n\\\nfloat pixelWidth = czm_metersPerPixel(position);\\n\\\n#ifdef UNION_CLIPPING_REGIONS\\n\\\nfloat clipAmount;\\n\\\n#else\\n\\\nfloat clipAmount = 0.0;\\n\\\nbool clipped = true;\\n\\\n#endif\\n\\\nfor (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {\\n\\\nvec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n\\\nclipNormal = clippingPlane.xyz;\\n\\\nclipPosition = -clippingPlane.w * clipNormal;\\n\\\nfloat amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n\\\n#ifdef UNION_CLIPPING_REGIONS\\n\\\nclipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\\n\\\nif (amount <= 0.0) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\nclipAmount = max(amount, clipAmount);\\n\\\nclipped = clipped && (amount <= 0.0);\\n\\\n#endif\\n\\\n}\\n\\\n#ifndef UNION_CLIPPING_REGIONS\\n\\\nif (clipped) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\nreturn clipAmount;\\n\\\n}\\n\\\nvoid modelClippingPlanesStage(inout vec4 color)\\n\\\n{\\n\\\nfloat clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);\\n\\\nvec4 clippingPlanesEdgeColor = vec4(1.0);\\n\\\nclippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;\\n\\\nfloat clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;\\n\\\nif (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {\\n\\\ncolor = clippingPlanesEdgeColor;\\n\\\n}\\n\\\n}\\n\\\n\";\n", "import Cartesian2 from \"../../Core/Cartesian2.js\";\nimport ClippingPlaneCollection from \"../ClippingPlaneCollection.js\";\nimport combine from \"../../Core/combine.js\";\nimport Color from \"../../Core/Color.js\";\nimport ModelClippingPlanesStageFS from \"../../Shaders/Model/ModelClippingPlanesStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model clipping planes stage is responsible for applying clipping planes to the model.\n *\n * @namespace ModelClippingPlanesPipelineStage\n *\n * @private\n */\nconst ModelClippingPlanesPipelineStage = {\n name: \"ModelClippingPlanesPipelineStage\", // Helps with debugging\n};\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>adds a define to the fragment shader to indicate that the model has clipping planes</li>\n * <li>adds the defines to the fragment shader for parameters related to clipping planes, such as the number of planes</li>\n * <li>adds a function to the fragment shader to apply the clipping planes to the model's base color</li>\n * <li>adds the uniforms for the fragment shader for the clipping plane texture and matrix</li>\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelClippingPlanesPipelineStage.process = function (\n renderResources,\n model,\n frameState\n) {\n const clippingPlanes = model.clippingPlanes;\n const context = frameState.context;\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"HAS_CLIPPING_PLANES\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addDefine(\n \"CLIPPING_PLANES_LENGTH\",\n clippingPlanes.length,\n ShaderDestination.FRAGMENT\n );\n\n if (clippingPlanes.unionClippingRegions) {\n shaderBuilder.addDefine(\n \"UNION_CLIPPING_REGIONS\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n if (ClippingPlaneCollection.useFloatTexture(context)) {\n shaderBuilder.addDefine(\n \"USE_CLIPPING_PLANES_FLOAT_TEXTURE\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const textureResolution = ClippingPlaneCollection.getTextureResolution(\n clippingPlanes,\n context,\n textureResolutionScratch\n );\n\n shaderBuilder.addDefine(\n \"CLIPPING_PLANES_TEXTURE_WIDTH\",\n textureResolution.x,\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addDefine(\n \"CLIPPING_PLANES_TEXTURE_HEIGHT\",\n textureResolution.y,\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addUniform(\n \"sampler2D\",\n \"model_clippingPlanes\",\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"vec4\",\n \"model_clippingPlanesEdgeStyle\",\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"mat4\",\n \"model_clippingPlanesMatrix\",\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addFragmentLines(ModelClippingPlanesStageFS);\n\n const uniformMap = {\n model_clippingPlanes: function () {\n return clippingPlanes.texture;\n },\n model_clippingPlanesEdgeStyle: function () {\n const style = Color.clone(clippingPlanes.edgeColor);\n style.alpha = clippingPlanes.edgeWidth;\n return style;\n },\n model_clippingPlanesMatrix: function () {\n return model._clippingPlanesMatrix;\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nexport default ModelClippingPlanesPipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport defined from \"../../Core/defined.js\";\n\n/**\n * <div class=\"notice\">\n * Use {@link Model#getNode} to get a node from a loaded model. Do not call the constructor directly.\n * </div>\n *\n * A model node with a modifiable transform to allow users to define their\n * own animations. While a model's asset can contain animations that target\n * a node's transform, this class allows users to change a node's transform\n * externally. In this way, animation can be driven by another source, not\n * just by the model's asset.\n *\n * @alias ModelNode\n * @internalConstructor\n * @class\n *\n * @example\n * const node = model.getNode(\"Hand\");\n * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);\n *\n * @see Model#getNode\n */\nfunction ModelNode(model, runtimeNode) {\nthis._model = model;\n this._runtimeNode = runtimeNode;\n}\n\nObject.defineProperties(ModelNode.prototype, {\n /**\n * The value of the <code>name</code> property of this node.\n *\n * @memberof ModelNode.prototype\n *\n * @type {String}\n * @readonly\n */\n name: {\n get: function () {\n return this._runtimeNode._name;\n },\n },\n\n /**\n * The index of the node in the glTF.\n *\n * @memberof ModelNode.prototype\n *\n * @type {Number}\n * @readonly\n */\n id: {\n get: function () {\n return this._runtimeNode._id;\n },\n },\n\n /**\n * Determines if this node and its children will be shown.\n *\n * @memberof ModelNode.prototype\n * @type {Boolean}\n *\n * @default true\n */\n show: {\n get: function () {\n return this._runtimeNode.show;\n },\n set: function (value) {\n this._runtimeNode.show = value;\n },\n },\n\n /**\n * The node's 4x4 matrix transform from its local coordinates to\n * its parent's. Setting the matrix to undefined will restore the\n * node's original transform, and allow the node to be animated by\n * any animations in the model again.\n * <p>\n * For changes to take effect, this property must be assigned to;\n * setting individual elements of the matrix will not work.\n * </p>\n *\n * @memberof ModelNode.prototype\n * @type {Matrix4}\n */\n matrix: {\n get: function () {\n return this._runtimeNode.transform;\n },\n set: function (value) {\n if (defined(value)) {\n this._runtimeNode.transform = value;\n this._runtimeNode.userAnimated = true;\n this._model._userAnimationDirty = true;\n } else {\n this._runtimeNode.transform = this.originalMatrix;\n this._runtimeNode.userAnimated = false;\n }\n },\n },\n\n /**\n * Gets the node's original 4x4 matrix transform from its local\n * coordinates to its parent's, without any node transformations\n * or articulations applied.\n *\n * @memberof ModelNode.prototype\n * @type {Matrix4}\n */\n originalMatrix: {\n get: function () {\n return this._runtimeNode.originalTransform;\n },\n },\n});\n\nexport default ModelNode;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"mat4 getInstancingTransform()\\n\\\n{\\n\\\nmat4 instancingTransform;\\n\\\n#ifdef HAS_INSTANCE_MATRICES\\n\\\ninstancingTransform = mat4(\\n\\\na_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0,\\n\\\na_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0,\\n\\\na_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0,\\n\\\na_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0\\n\\\n);\\n\\\n#else\\n\\\nvec3 translation = vec3(0.0, 0.0, 0.0);\\n\\\nvec3 scale = vec3(1.0, 1.0, 1.0);\\n\\\n#ifdef HAS_INSTANCE_TRANSLATION\\n\\\ntranslation = a_instanceTranslation;\\n\\\n#endif\\n\\\n#ifdef HAS_INSTANCE_SCALE\\n\\\nscale = a_instanceScale;\\n\\\n#endif\\n\\\ninstancingTransform = mat4(\\n\\\nscale.x, 0.0, 0.0, 0.0,\\n\\\n0.0, scale.y, 0.0, 0.0,\\n\\\n0.0, 0.0, scale.z, 0.0,\\n\\\ntranslation.x, translation.y, translation.z, 1.0\\n\\\n);\\n\\\n#endif\\n\\\nreturn instancingTransform;\\n\\\n}\\n\\\n#ifdef USE_2D_INSTANCING\\n\\\nmat4 getInstancingTransform2D()\\n\\\n{\\n\\\nmat4 instancingTransform2D;\\n\\\n#ifdef HAS_INSTANCE_MATRICES\\n\\\ninstancingTransform2D = mat4(\\n\\\na_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0,\\n\\\na_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0,\\n\\\na_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0,\\n\\\na_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0\\n\\\n);\\n\\\n#else\\n\\\nvec3 translation2D = vec3(0.0, 0.0, 0.0);\\n\\\nvec3 scale = vec3(1.0, 1.0, 1.0);\\n\\\n#ifdef HAS_INSTANCE_TRANSLATION\\n\\\ntranslation2D = a_instanceTranslation2D;\\n\\\n#endif\\n\\\n#ifdef HAS_INSTANCE_SCALE\\n\\\nscale = a_instanceScale;\\n\\\n#endif\\n\\\ninstancingTransform2D = mat4(\\n\\\nscale.x, 0.0, 0.0, 0.0,\\n\\\n0.0, scale.y, 0.0, 0.0,\\n\\\n0.0, 0.0, scale.z, 0.0,\\n\\\ntranslation2D.x, translation2D.y, translation2D.z, 1.0\\n\\\n);\\n\\\n#endif\\n\\\nreturn instancingTransform2D;\\n\\\n}\\n\\\n#endif\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void instancingStage(inout ProcessedAttributes attributes)\\n\\\n{\\n\\\nvec3 positionMC = attributes.positionMC;\\n\\\nmat4 instancingTransform = getInstancingTransform();\\n\\\nattributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;\\n\\\n#ifdef HAS_NORMALS\\n\\\nvec3 normalMC = attributes.normalMC;\\n\\\nattributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;\\n\\\n#endif\\n\\\n#ifdef USE_2D_INSTANCING\\n\\\nmat4 instancingTransform2D = getInstancingTransform2D();\\n\\\nattributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void legacyInstancingStage(\\n\\\ninout ProcessedAttributes attributes,\\n\\\nout mat4 instanceModelView,\\n\\\nout mat3 instanceModelViewInverseTranspose)\\n\\\n{\\n\\\nvec3 positionMC = attributes.positionMC;\\n\\\nmat4 instancingTransform = getInstancingTransform();\\n\\\nmat4 instanceModel = instancingTransform * u_instance_nodeTransform;\\n\\\ninstanceModelView = u_instance_modifiedModelView;\\n\\\ninstanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);\\n\\\nattributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;\\n\\\n#ifdef USE_2D_INSTANCING\\n\\\nmat4 instancingTransform2D = getInstancingTransform2D();\\n\\\nattributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport clone from \"../../Core/clone.js\";\nimport combine from \"../../Core/combine.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport InstancingStageCommon from \"../../Shaders/Model/InstancingStageCommon.js\";\nimport InstancingStageVS from \"../../Shaders/Model/InstancingStageVS.js\";\nimport LegacyInstancingStageVS from \"../../Shaders/Model/LegacyInstancingStageVS.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport InstanceAttributeSemantic from \"../InstanceAttributeSemantic.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\nconst modelViewScratch = new Matrix4();\nconst nodeTransformScratch = new Matrix4();\nconst modelView2DScratch = new Matrix4();\n\n/**\n * The instancing pipeline stage is responsible for handling GPU mesh instancing at the node\n * level.\n *\n * @namespace InstancingPipelineStage\n * @private\n */\nconst InstancingPipelineStage = {\n name: \"InstancingPipelineStage\", // Helps with debugging\n\n // Expose some methods for testing\n _getInstanceTransformsAsMatrices: getInstanceTransformsAsMatrices,\n _transformsToTypedArray: transformsToTypedArray,\n};\n\n/**\n * Process a node. This modifies the following parts of the render resources:\n * <ul>\n * <li> creates buffers for the typed arrays of each attribute, if they do not yet exist\n * <li> adds attribute declarations for the instancing vertex attributes in the vertex shader</li>\n * <li> sets the instancing translation min and max to compute an accurate bounding volume</li>\n * </ul>\n *\n * If the scene is in either 2D or CV mode, this stage also:\n * <ul>\n * <li> adds additional attributes for the transformation attributes projected to 2D\n * <li> adds a flag to the shader to use the 2D instanced attributes\n * <li> adds a uniform for the view model matrix in 2D\n * </ul>\n *\n * @param {NodeRenderResources} renderResources The render resources for this node.\n * @param {ModelComponents.Node} node The node.\n * @param {FrameState} frameState The frame state.\n */\nInstancingPipelineStage.process = function (renderResources, node, frameState) {\n const instances = node.instances;\n const count = instances.attributes[0].count;\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addDefine(\"HAS_INSTANCING\");\n shaderBuilder.addVertexLines(InstancingStageCommon);\n\n const model = renderResources.model;\n const sceneGraph = model.sceneGraph;\n const runtimeNode = renderResources.runtimeNode;\n\n const use2D =\n frameState.mode !== SceneMode.SCENE3D &&\n !frameState.scene3DOnly &&\n model._projectTo2D;\n\n const instancingVertexAttributes = [];\n\n processTransformAttributes(\n renderResources,\n frameState,\n instances,\n instancingVertexAttributes,\n use2D\n );\n\n processFeatureIdAttributes(\n renderResources,\n frameState,\n instances,\n instancingVertexAttributes\n );\n\n const uniformMap = {};\n\n if (instances.transformInWorldSpace) {\n shaderBuilder.addDefine(\n \"USE_LEGACY_INSTANCING\",\n undefined,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addUniform(\n \"mat4\",\n \"u_instance_modifiedModelView\",\n ShaderDestination.VERTEX\n );\n shaderBuilder.addUniform(\n \"mat4\",\n \"u_instance_nodeTransform\",\n ShaderDestination.VERTEX\n );\n\n // The i3dm format applies the instancing transforms in world space.\n // Instancing matrices come from a vertex attribute rather than a\n // uniform, and they are multiplied in the middle of the modelView matrix\n // product. This means czm_modelView can't be used. Instead, we split the\n // matrix into two parts, modifiedModelView and nodeTransform, and handle\n // this in LegacyInstancingStageVS.glsl. Conceptually the product looks like\n // this:\n //\n // modelView = u_modifiedModelView * a_instanceTransform * u_nodeTransform\n uniformMap.u_instance_modifiedModelView = function () {\n // Model matrix without the node hierarchy or axis correction\n // (see u_instance_nodeTransform).\n let modifiedModelMatrix = Matrix4.multiplyTransformation(\n // For 3D Tiles, model.modelMatrix is the computed tile\n // transform (which includes tileset.modelMatrix). This always applies\n // for i3dm, since such models are always part of a tileset.\n model.modelMatrix,\n // For i3dm models, components.transform contains the RTC_CENTER\n // translation.\n sceneGraph.components.transform,\n modelViewScratch\n );\n\n if (use2D) {\n // If projectTo2D is enabled, the 2D view matrix\n // will be accounted for in the u_modelView2D\n // uniform.\n //\n // modifiedModelView = view3D * modifiedModel\n return Matrix4.multiplyTransformation(\n frameState.context.uniformState.view3D,\n modifiedModelMatrix,\n modelViewScratch\n );\n }\n\n // For projection to 2D without projectTo2D enabled,\n // project the model matrix to 2D.\n if (frameState.mode !== SceneMode.SCENE3D) {\n modifiedModelMatrix = Transforms.basisTo2D(\n frameState.mapProjection,\n modifiedModelMatrix,\n modelViewScratch\n );\n }\n\n // modifiedModelView = view * modifiedModel\n return Matrix4.multiplyTransformation(\n frameState.context.uniformState.view,\n modifiedModelMatrix,\n modelViewScratch\n );\n };\n\n uniformMap.u_instance_nodeTransform = function () {\n // nodeTransform = axisCorrection * nodeHierarchyTransform\n return Matrix4.multiplyTransformation(\n // glTF y-up to 3D Tiles z-up\n sceneGraph.axisCorrectionMatrix,\n // This transforms from the node's coordinate system to the root\n // of the node hierarchy\n runtimeNode.computedTransform,\n nodeTransformScratch\n );\n };\n\n shaderBuilder.addVertexLines(LegacyInstancingStageVS);\n } else {\n shaderBuilder.addVertexLines(InstancingStageVS);\n }\n\n if (use2D) {\n shaderBuilder.addDefine(\n \"USE_2D_INSTANCING\",\n undefined,\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addUniform(\"mat4\", \"u_modelView2D\", ShaderDestination.VERTEX);\n\n const context = frameState.context;\n const modelMatrix2D = Matrix4.fromTranslation(\n runtimeNode.instancingReferencePoint2D,\n new Matrix4()\n );\n\n uniformMap.u_modelView2D = function () {\n return Matrix4.multiplyTransformation(\n context.uniformState.view,\n modelMatrix2D,\n modelView2DScratch\n );\n };\n }\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n\n renderResources.instanceCount = count;\n renderResources.attributes.push.apply(\n renderResources.attributes,\n instancingVertexAttributes\n );\n};\n\nconst projectedTransformScratch = new Matrix4();\nconst projectedPositionScratch = new Cartesian3();\n\nfunction projectTransformTo2D(\n transform,\n modelMatrix,\n nodeTransform,\n frameState,\n result\n) {\n let projectedTransform = Matrix4.multiplyTransformation(\n modelMatrix,\n transform,\n projectedTransformScratch\n );\n\n projectedTransform = Matrix4.multiplyTransformation(\n projectedTransform,\n nodeTransform,\n projectedTransformScratch\n );\n\n result = Transforms.basisTo2D(\n frameState.mapProjection,\n projectedTransform,\n result\n );\n\n return result;\n}\n\nfunction projectPositionTo2D(\n position,\n modelMatrix,\n nodeTransform,\n frameState,\n result\n) {\n const translationMatrix = Matrix4.fromTranslation(\n position,\n projectedTransformScratch\n );\n\n let projectedTransform = Matrix4.multiplyTransformation(\n modelMatrix,\n translationMatrix,\n projectedTransformScratch\n );\n\n projectedTransform = Matrix4.multiplyTransformation(\n projectedTransform,\n nodeTransform,\n projectedTransformScratch\n );\n\n const finalPosition = Matrix4.getTranslation(\n projectedTransform,\n projectedPositionScratch\n );\n\n result = SceneTransforms.computeActualWgs84Position(\n frameState,\n finalPosition,\n result\n );\n\n return result;\n}\n\nfunction getModelMatrixAndNodeTransform(\n renderResources,\n modelMatrix,\n nodeComputedTransform\n) {\n const model = renderResources.model;\n const sceneGraph = model.sceneGraph;\n\n const instances = renderResources.runtimeNode.node.instances;\n if (instances.transformInWorldSpace) {\n // Replicate the multiplication order in LegacyInstancingStageVS.\n modelMatrix = Matrix4.multiplyTransformation(\n model.modelMatrix,\n sceneGraph.components.transform,\n modelMatrix\n );\n\n nodeComputedTransform = Matrix4.multiplyTransformation(\n sceneGraph.axisCorrectionMatrix,\n renderResources.runtimeNode.computedTransform,\n nodeComputedTransform\n );\n } else {\n // The node transform should be pre-multiplied with the instancing transform.\n modelMatrix = Matrix4.clone(sceneGraph.computedModelMatrix, modelMatrix);\n modelMatrix = Matrix4.multiplyTransformation(\n modelMatrix,\n renderResources.runtimeNode.computedTransform,\n modelMatrix\n );\n\n nodeComputedTransform = Matrix4.clone(\n Matrix4.IDENTITY,\n nodeComputedTransform\n );\n }\n}\n\nconst modelMatrixScratch = new Matrix4();\nconst nodeComputedTransformScratch = new Matrix4();\nconst transformScratch = new Matrix4();\nconst positionScratch = new Cartesian3();\n\nfunction projectTransformsTo2D(\n transforms,\n renderResources,\n frameState,\n result\n) {\n const modelMatrix = modelMatrixScratch;\n const nodeComputedTransform = nodeComputedTransformScratch;\n\n getModelMatrixAndNodeTransform(\n renderResources,\n modelMatrix,\n nodeComputedTransform\n );\n\n const runtimeNode = renderResources.runtimeNode;\n const referencePoint = runtimeNode.instancingReferencePoint2D;\n\n const count = transforms.length;\n for (let i = 0; i < count; i++) {\n const transform = transforms[i];\n\n const projectedTransform = projectTransformTo2D(\n transform,\n modelMatrix,\n nodeComputedTransform,\n frameState,\n transformScratch\n );\n\n const position = Matrix4.getTranslation(\n projectedTransform,\n positionScratch\n );\n\n const finalTranslation = Cartesian3.subtract(\n position,\n referencePoint,\n position\n );\n\n result[i] = Matrix4.setTranslation(\n projectedTransform,\n finalTranslation,\n result[i]\n );\n }\n\n return result;\n}\n\nfunction projectTranslationsTo2D(\n translations,\n renderResources,\n frameState,\n result\n) {\n const modelMatrix = modelMatrixScratch;\n const nodeComputedTransform = nodeComputedTransformScratch;\n\n getModelMatrixAndNodeTransform(\n renderResources,\n modelMatrix,\n nodeComputedTransform\n );\n\n const runtimeNode = renderResources.runtimeNode;\n const referencePoint = runtimeNode.instancingReferencePoint2D;\n const count = translations.length;\n for (let i = 0; i < count; i++) {\n const translation = translations[i];\n\n const projectedPosition = projectPositionTo2D(\n translation,\n modelMatrix,\n nodeComputedTransform,\n frameState,\n translation\n );\n\n result[i] = Cartesian3.subtract(\n projectedPosition,\n referencePoint,\n result[i]\n );\n }\n\n return result;\n}\n\nconst scratchProjectedMin = new Cartesian3();\nconst scratchProjectedMax = new Cartesian3();\n\nfunction computeReferencePoint2D(renderResources, frameState) {\n // Compute the reference point by averaging the instancing translation\n // min / max values after they are projected to 2D.\n const runtimeNode = renderResources.runtimeNode;\n const modelMatrix = renderResources.model.sceneGraph.computedModelMatrix;\n const transformedPositionMin = Matrix4.multiplyByPoint(\n modelMatrix,\n runtimeNode.instancingTranslationMin,\n scratchProjectedMin\n );\n\n const projectedMin = SceneTransforms.computeActualWgs84Position(\n frameState,\n transformedPositionMin,\n transformedPositionMin\n );\n\n const transformedPositionMax = Matrix4.multiplyByPoint(\n modelMatrix,\n runtimeNode.instancingTranslationMax,\n scratchProjectedMax\n );\n\n const projectedMax = SceneTransforms.computeActualWgs84Position(\n frameState,\n transformedPositionMax,\n transformedPositionMax\n );\n\n runtimeNode.instancingReferencePoint2D = Cartesian3.lerp(\n projectedMin,\n projectedMax,\n 0.5,\n new Cartesian3()\n );\n}\n\nfunction transformsToTypedArray(transforms) {\n const elements = 12;\n const count = transforms.length;\n const transformsTypedArray = new Float32Array(count * elements);\n\n for (let i = 0; i < count; i++) {\n const transform = transforms[i];\n const offset = elements * i;\n\n transformsTypedArray[offset + 0] = transform[0];\n transformsTypedArray[offset + 1] = transform[4];\n transformsTypedArray[offset + 2] = transform[8];\n transformsTypedArray[offset + 3] = transform[12];\n transformsTypedArray[offset + 4] = transform[1];\n transformsTypedArray[offset + 5] = transform[5];\n transformsTypedArray[offset + 6] = transform[9];\n transformsTypedArray[offset + 7] = transform[13];\n transformsTypedArray[offset + 8] = transform[2];\n transformsTypedArray[offset + 9] = transform[6];\n transformsTypedArray[offset + 10] = transform[10];\n transformsTypedArray[offset + 11] = transform[14];\n }\n\n return transformsTypedArray;\n}\n\nfunction translationsToTypedArray(translations) {\n const elements = 3;\n const count = translations.length;\n const transationsTypedArray = new Float32Array(count * elements);\n\n for (let i = 0; i < count; i++) {\n const translation = translations[i];\n const offset = elements * i;\n\n transationsTypedArray[offset + 0] = translation[0];\n transationsTypedArray[offset + 1] = translation[4];\n transationsTypedArray[offset + 2] = translation[8];\n }\n\n return transationsTypedArray;\n}\n\nconst translationScratch = new Cartesian3();\nconst rotationScratch = new Quaternion();\nconst scaleScratch = new Cartesian3();\n\nfunction getInstanceTransformsAsMatrices(instances, count, renderResources) {\n const transforms = new Array(count);\n\n const translationAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.TRANSLATION\n );\n const rotationAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.ROTATION\n );\n const scaleAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.SCALE\n );\n\n const instancingTranslationMax = new Cartesian3(\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n -Number.MAX_VALUE\n );\n const instancingTranslationMin = new Cartesian3(\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n Number.MAX_VALUE\n );\n\n const hasTranslation = defined(translationAttribute);\n const hasRotation = defined(rotationAttribute);\n const hasScale = defined(scaleAttribute);\n\n // Translations get initialized to (0, 0, 0).\n const translationTypedArray = hasTranslation\n ? translationAttribute.typedArray\n : new Float32Array(count * 3);\n\n // Rotations get initialized to (0, 0, 0, 0).\n // The w-component is set to 1 in the loop below.\n let rotationTypedArray = hasRotation\n ? rotationAttribute.typedArray\n : new Float32Array(count * 4);\n\n // The rotation attribute may be normalized\n if (hasRotation && rotationAttribute.normalized) {\n rotationTypedArray = AttributeCompression.dequantize(\n rotationTypedArray,\n rotationAttribute.componentDatatype,\n rotationAttribute.type,\n count\n );\n }\n\n // Scales get initialized to (1, 1, 1).\n let scaleTypedArray;\n if (hasScale) {\n scaleTypedArray = scaleAttribute.typedArray;\n } else {\n scaleTypedArray = new Float32Array(count * 3);\n scaleTypedArray.fill(1);\n }\n\n for (let i = 0; i < count; i++) {\n const translation = new Cartesian3(\n translationTypedArray[i * 3],\n translationTypedArray[i * 3 + 1],\n translationTypedArray[i * 3 + 2],\n translationScratch\n );\n\n Cartesian3.maximumByComponent(\n instancingTranslationMax,\n translation,\n instancingTranslationMax\n );\n Cartesian3.minimumByComponent(\n instancingTranslationMin,\n translation,\n instancingTranslationMin\n );\n\n const rotation = new Quaternion(\n rotationTypedArray[i * 4],\n rotationTypedArray[i * 4 + 1],\n rotationTypedArray[i * 4 + 2],\n hasRotation ? rotationTypedArray[i * 4 + 3] : 1,\n rotationScratch\n );\n\n const scale = new Cartesian3(\n scaleTypedArray[i * 3],\n scaleTypedArray[i * 3 + 1],\n scaleTypedArray[i * 3 + 2],\n scaleScratch\n );\n\n const transform = Matrix4.fromTranslationQuaternionRotationScale(\n translation,\n rotation,\n scale,\n new Matrix4()\n );\n\n transforms[i] = transform;\n }\n\n const runtimeNode = renderResources.runtimeNode;\n runtimeNode.instancingTranslationMin = instancingTranslationMin;\n runtimeNode.instancingTranslationMax = instancingTranslationMax;\n\n // Unload the typed arrays. These are just pointers to the arrays\n // in the vertex buffer loader.\n if (hasTranslation) {\n translationAttribute.typedArray = undefined;\n }\n if (hasRotation) {\n rotationAttribute.typedArray = undefined;\n }\n if (hasScale) {\n scaleAttribute.typedArray = undefined;\n }\n\n return transforms;\n}\n\nfunction getInstanceTranslationsAsCartesian3s(\n translationAttribute,\n count,\n renderResources\n) {\n const instancingTranslations = new Array(count);\n const translationTypedArray = translationAttribute.typedArray;\n\n const instancingTranslationMin = new Cartesian3(\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n Number.MAX_VALUE\n );\n const instancingTranslationMax = new Cartesian3(\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n -Number.MAX_VALUE\n );\n\n for (let i = 0; i < count; i++) {\n const translation = new Cartesian3(\n translationTypedArray[i * 3],\n translationTypedArray[i * 3 + 1],\n translationTypedArray[i * 3 + 2]\n );\n\n instancingTranslations[i] = translation;\n\n Cartesian3.minimumByComponent(\n instancingTranslationMin,\n translation,\n instancingTranslationMin\n );\n Cartesian3.maximumByComponent(\n instancingTranslationMax,\n translation,\n instancingTranslationMax\n );\n }\n\n const runtimeNode = renderResources.runtimeNode;\n runtimeNode.instancingTranslationMin = instancingTranslationMin;\n runtimeNode.instancingTranslationMax = instancingTranslationMax;\n\n // Unload the typed array. This is just a pointer to the array\n // in the vertex buffer loader.\n translationAttribute.typedArray = undefined;\n\n return instancingTranslations;\n}\n\nfunction createVertexBuffer(typedArray, frameState) {\n const buffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n\n // Destruction of resources allocated by the Model\n // is handled by Model.destroy().\n buffer.vertexArrayDestroyable = false;\n\n return buffer;\n}\n\nfunction processTransformAttributes(\n renderResources,\n frameState,\n instances,\n instancingVertexAttributes,\n use2D\n) {\n const rotationAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.ROTATION\n );\n\n // Only use matrices for the transforms if the rotation attribute is defined.\n if (defined(rotationAttribute)) {\n processTransformMatrixAttributes(\n renderResources,\n instances,\n instancingVertexAttributes,\n frameState,\n use2D\n );\n } else {\n processTransformVec3Attributes(\n renderResources,\n instances,\n instancingVertexAttributes,\n frameState,\n use2D\n );\n }\n}\n\nfunction processTransformMatrixAttributes(\n renderResources,\n instances,\n instancingVertexAttributes,\n frameState,\n use2D\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const count = instances.attributes[0].count;\n\n const model = renderResources.model;\n const runtimeNode = renderResources.runtimeNode;\n\n shaderBuilder.addDefine(\"HAS_INSTANCE_MATRICES\");\n const attributeString = \"Transform\";\n\n let transforms;\n let buffer = runtimeNode.instancingTransformsBuffer;\n if (!defined(buffer)) {\n // This function computes the transforms, sets the translation min / max,\n // and unloads the typed arrays associated with the attributes.\n transforms = getInstanceTransformsAsMatrices(\n instances,\n count,\n renderResources\n );\n\n const transformsTypedArray = transformsToTypedArray(transforms);\n buffer = createVertexBuffer(transformsTypedArray, frameState);\n model._modelResources.push(buffer);\n\n runtimeNode.instancingTransformsBuffer = buffer;\n }\n\n processMatrixAttributes(\n renderResources,\n buffer,\n instancingVertexAttributes,\n attributeString\n );\n\n if (!use2D) {\n return;\n }\n\n // Force the scene mode to be CV. In 2D, projected positions will have\n // an x-coordinate of 0, which eliminates the height data that is\n // necessary for rendering in CV mode.\n const frameStateCV = clone(frameState);\n frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n // To prevent jitter, the positions are defined relative to a common\n // reference point. For convenience, this is the center of the instanced\n // translation bounds projected to 2D.\n computeReferencePoint2D(renderResources, frameStateCV);\n\n let buffer2D = runtimeNode.instancingTransformsBuffer2D;\n if (!defined(buffer2D)) {\n const projectedTransforms = projectTransformsTo2D(\n transforms,\n renderResources,\n frameStateCV,\n transforms\n );\n const projectedTypedArray = transformsToTypedArray(projectedTransforms);\n\n // This memory is counted during the statistics stage at the end\n // of the pipeline.\n buffer2D = createVertexBuffer(projectedTypedArray, frameState);\n model._modelResources.push(buffer2D);\n\n runtimeNode.instancingTransformsBuffer2D = buffer2D;\n }\n\n const attributeString2D = \"Transform2D\";\n processMatrixAttributes(\n renderResources,\n buffer2D,\n instancingVertexAttributes,\n attributeString2D\n );\n}\n\nfunction processTransformVec3Attributes(\n renderResources,\n instances,\n instancingVertexAttributes,\n frameState,\n use2D\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const runtimeNode = renderResources.runtimeNode;\n const translationAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.TRANSLATION\n );\n const scaleAttribute = ModelUtility.getAttributeBySemantic(\n instances,\n InstanceAttributeSemantic.SCALE\n );\n\n if (defined(scaleAttribute)) {\n shaderBuilder.addDefine(\"HAS_INSTANCE_SCALE\");\n const attributeString = \"Scale\";\n\n // Instanced scale attributes are loaded as buffers only.\n processVec3Attribute(\n renderResources,\n scaleAttribute.buffer,\n scaleAttribute.byteOffset,\n scaleAttribute.byteStride,\n instancingVertexAttributes,\n attributeString\n );\n }\n\n if (!defined(translationAttribute)) {\n return;\n }\n\n let instancingTranslations;\n const typedArray = translationAttribute.typedArray;\n if (defined(typedArray)) {\n // This function computes and set the translation min / max, and unloads\n // the typed array associated with the attribute.\n // The translations are also returned in case they're used for 2D projection.\n instancingTranslations = getInstanceTranslationsAsCartesian3s(\n translationAttribute,\n translationAttribute.count,\n renderResources\n );\n } else if (!defined(runtimeNode.instancingTranslationMin)) {\n runtimeNode.instancingTranslationMin = translationAttribute.min;\n runtimeNode.instancingTranslationMax = translationAttribute.max;\n }\n\n shaderBuilder.addDefine(\"HAS_INSTANCE_TRANSLATION\");\n const attributeString = \"Translation\";\n\n processVec3Attribute(\n renderResources,\n translationAttribute.buffer,\n translationAttribute.byteOffset,\n translationAttribute.byteStride,\n instancingVertexAttributes,\n attributeString\n );\n\n if (!use2D) {\n return;\n }\n\n // Force the scene mode to be CV. In 2D, projected positions will have\n // an x-coordinate of 0, which eliminates the height data that is\n // necessary for rendering in CV mode.\n const frameStateCV = clone(frameState);\n frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n // To prevent jitter, the positions are defined relative to a common\n // reference point. For convenience, this is the center of the instanced\n // translation bounds projected to 2D.\n computeReferencePoint2D(renderResources, frameStateCV);\n\n let buffer2D = runtimeNode.instancingTranslationBuffer2D;\n\n if (!defined(buffer2D)) {\n const projectedTranslations = projectTranslationsTo2D(\n instancingTranslations,\n renderResources,\n frameStateCV,\n instancingTranslations\n );\n const projectedTypedArray = translationsToTypedArray(projectedTranslations);\n\n // This memory is counted during the statistics stage at the end\n // of the pipeline.\n buffer2D = createVertexBuffer(projectedTypedArray, frameState);\n renderResources.model._modelResources.push(buffer2D);\n\n runtimeNode.instancingTranslationBuffer2D = buffer2D;\n }\n\n const byteOffset = 0;\n const byteStride = undefined;\n\n const attributeString2D = \"Translation2D\";\n processVec3Attribute(\n renderResources,\n buffer2D,\n byteOffset,\n byteStride,\n instancingVertexAttributes,\n attributeString2D\n );\n}\n\nfunction processMatrixAttributes(\n renderResources,\n buffer,\n instancingVertexAttributes,\n attributeString\n) {\n const vertexSizeInFloats = 12;\n const componentByteSize = ComponentDatatype.getSizeInBytes(\n ComponentDatatype.FLOAT\n );\n const strideInBytes = componentByteSize * vertexSizeInFloats;\n\n const matrixAttributes = [\n {\n index: renderResources.attributeIndex++,\n vertexBuffer: buffer,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: strideInBytes,\n instanceDivisor: 1,\n },\n {\n index: renderResources.attributeIndex++,\n vertexBuffer: buffer,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n normalize: false,\n offsetInBytes: componentByteSize * 4,\n strideInBytes: strideInBytes,\n instanceDivisor: 1,\n },\n {\n index: renderResources.attributeIndex++,\n vertexBuffer: buffer,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n normalize: false,\n offsetInBytes: componentByteSize * 8,\n strideInBytes: strideInBytes,\n instanceDivisor: 1,\n },\n ];\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row0`);\n shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row1`);\n shaderBuilder.addAttribute(\"vec4\", `a_instancing${attributeString}Row2`);\n\n instancingVertexAttributes.push.apply(\n instancingVertexAttributes,\n matrixAttributes\n );\n}\n\nfunction processVec3Attribute(\n renderResources,\n buffer,\n byteOffset,\n byteStride,\n instancingVertexAttributes,\n attributeString\n) {\n instancingVertexAttributes.push({\n index: renderResources.attributeIndex++,\n vertexBuffer: buffer,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n normalize: false,\n offsetInBytes: byteOffset,\n strideInBytes: byteStride,\n instanceDivisor: 1,\n });\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addAttribute(\"vec3\", `a_instance${attributeString}`);\n}\n\nfunction processFeatureIdAttributes(\n renderResources,\n frameState,\n instances,\n instancingVertexAttributes\n) {\n const attributes = instances.attributes;\n const shaderBuilder = renderResources.shaderBuilder;\n\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n if (attribute.semantic !== InstanceAttributeSemantic.FEATURE_ID) {\n continue;\n }\n\n if (\n attribute.setIndex >= renderResources.featureIdVertexAttributeSetIndex\n ) {\n renderResources.featureIdVertexAttributeSetIndex = attribute.setIndex + 1;\n }\n\n instancingVertexAttributes.push({\n index: renderResources.attributeIndex++,\n vertexBuffer: attribute.buffer,\n componentsPerAttribute: AttributeType.getNumberOfComponents(\n attribute.type\n ),\n componentDatatype: attribute.componentDatatype,\n normalize: false,\n offsetInBytes: attribute.byteOffset,\n strideInBytes: attribute.byteStride,\n instanceDivisor: 1,\n });\n\n shaderBuilder.addAttribute(\n \"float\",\n `a_instanceFeatureId_${attribute.setIndex}`\n );\n }\n}\n\nexport default InstancingPipelineStage;\n", "import Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SceneMode from \"../SceneMode.js\";\n\n/**\n * The model matrix update stage is responsible for updating the model matrices and bounding volumes of the draw commands.\n *\n * @namespace ModelMatrixUpdateStage\n *\n * @private\n */\nconst ModelMatrixUpdateStage = {};\nModelMatrixUpdateStage.name = \"ModelMatrixUpdateStage\"; // Helps with debugging\n\n/**\n * Processes a runtime node. This modifies the following parts of the scene graph and draw commands:\n * <ul>\n * <li>updates the transforms the children of any nodes with a dirty transform</li>\n * <li>updates the model matrix of each draw command in each primitive of the the dirty nodes and their children</li>\n * <li>updates the bounding volume of each draw command in each primitive of the the dirty nodes and their children</li>\n * </ul>\n *\n * @param {ModelRuntimeNode} runtimeNode\n * @param {ModelSceneGraph} sceneGraph\n * @param {FrameState} frameState\n *\n * @private\n */\nModelMatrixUpdateStage.update = function (runtimeNode, sceneGraph, frameState) {\n // Skip the update stage if the model is being projected to 2D\n const use2D = frameState.mode !== SceneMode.SCENE3D;\n if (use2D && sceneGraph._model._projectTo2D) {\n return;\n }\n\n if (runtimeNode._transformDirty) {\n const modelMatrix = use2D\n ? sceneGraph._computedModelMatrix2D\n : sceneGraph._computedModelMatrix;\n\n updateRuntimeNode(\n runtimeNode,\n sceneGraph,\n modelMatrix,\n runtimeNode.transformToRoot\n );\n runtimeNode._transformDirty = false;\n }\n};\n\n/**\n * Recursively update all child runtime nodes and their runtime primitives.\n *\n * @private\n */\nfunction updateRuntimeNode(\n runtimeNode,\n sceneGraph,\n modelMatrix,\n transformToRoot\n) {\n let i;\n\n // Apply the current node's transform to the end of the chain\n transformToRoot = Matrix4.multiplyTransformation(\n transformToRoot,\n runtimeNode.transform,\n new Matrix4()\n );\n\n runtimeNode.updateComputedTransform();\n\n const primitivesLength = runtimeNode.runtimePrimitives.length;\n for (i = 0; i < primitivesLength; i++) {\n const runtimePrimitive = runtimeNode.runtimePrimitives[i];\n const drawCommand = runtimePrimitive.drawCommand;\n drawCommand.modelMatrix = Matrix4.multiplyTransformation(\n modelMatrix,\n transformToRoot,\n drawCommand.modelMatrix\n );\n drawCommand.cullFace = ModelUtility.getCullFace(\n drawCommand.modelMatrix,\n drawCommand.primitiveType\n );\n }\n\n const childrenLength = runtimeNode.children.length;\n for (i = 0; i < childrenLength; i++) {\n const childRuntimeNode = sceneGraph._runtimeNodes[runtimeNode.children[i]];\n\n // Update transformToRoot to accommodate changes in the transforms of this node and its ancestors\n childRuntimeNode._transformToRoot = Matrix4.clone(\n transformToRoot,\n childRuntimeNode._transformToRoot\n );\n\n updateRuntimeNode(\n childRuntimeNode,\n sceneGraph,\n modelMatrix,\n transformToRoot\n );\n childRuntimeNode._transformDirty = false;\n }\n}\n\nexport default ModelMatrixUpdateStage;\n", "import defined from \"../../Core/defined.js\";\n\n/**\n * The node statistics update stage updates memory usage statistics for a Model\n * on the node level. This counts the binary resources that exist for the\n * lifetime of the Model (e.g. attributes loaded by GltfLoader). It does not\n * count resources that are created every time the pipeline is run.\n * The individual pipeline stages are responsible for keeping track of any\n * additional memory they allocate.\n *\n * @namespace NodeStatisticsPipelineStage\n *\n * @private\n */\nconst NodeStatisticsPipelineStage = {\n name: \"NodeStatisticsPipelineStage\", // Helps with debugging\n\n // Expose some methods for testing\n _countInstancingAttributes: countInstancingAttributes,\n _countGeneratedBuffers: countGeneratedBuffers,\n};\n\nNodeStatisticsPipelineStage.process = function (\n renderResources,\n node,\n frameState\n) {\n const statistics = renderResources.model.statistics;\n const instances = node.instances;\n const runtimeNode = renderResources.runtimeNode;\n\n countInstancingAttributes(statistics, instances);\n countGeneratedBuffers(statistics, runtimeNode);\n};\n\nfunction countInstancingAttributes(statistics, instances) {\n if (!defined(instances)) {\n return;\n }\n\n const attributes = instances.attributes;\n const length = attributes.length;\n for (let i = 0; i < length; i++) {\n const attribute = attributes[i];\n if (defined(attribute.buffer)) {\n // Any typed arrays should have been unloaded before this stage.\n const hasCpuCopy = false;\n statistics.addBuffer(attribute.buffer, hasCpuCopy);\n }\n }\n}\n\nfunction countGeneratedBuffers(statistics, runtimeNode) {\n if (defined(runtimeNode.instancingTransformsBuffer)) {\n // The typed array containing the computed transforms isn't saved\n // after the buffer is created.\n const hasCpuCopy = false;\n statistics.addBuffer(runtimeNode.instancingTransformsBuffer, hasCpuCopy);\n }\n if (defined(runtimeNode.instancingTransformsBuffer2D)) {\n // The typed array containing the computed 2D transforms isn't saved\n // after the buffer is created.\n const hasCpuCopy = false;\n statistics.addBuffer(runtimeNode.instancingTransformsBuffer2D, hasCpuCopy);\n }\n\n if (defined(runtimeNode.instancingTranslationBuffer2D)) {\n // The typed array containing the computed 2D translations isn't saved\n // after the buffer is created.\n const hasCpuCopy = false;\n statistics.addBuffer(runtimeNode.instancingTranslationBuffer2D, hasCpuCopy);\n }\n}\n\nexport default NodeStatisticsPipelineStage;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport TranslationRotationScale from \"../../Core/TranslationRotationScale.js\";\nimport Quaternion from \"../../Core/Quaternion.js\";\nimport InstancingPipelineStage from \"./InstancingPipelineStage.js\";\nimport ModelMatrixUpdateStage from \"./ModelMatrixUpdateStage.js\";\nimport NodeStatisticsPipelineStage from \"./NodeStatisticsPipelineStage.js\";\n\n/**\n * An in-memory representation of a node as part of the {@link ModelSceneGraph}.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.Node} options.node The corresponding node components from the 3D model.\n * @param {Matrix4} options.transform The transform of this node, excluding transforms from the node's ancestors or children.\n * @param {Matrix4} options.transformToRoot The product of the transforms of all the node's ancestors, excluding the node's own transform.\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this node belongs to.\n * @param {Number[]} options.children The indices of the children of this node in the runtime nodes array of the scene graph.\n *\n * @alias ModelRuntimeNode\n * @constructor\n *\n * @private\n */\nfunction ModelRuntimeNode(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const node = options.node;\n const transform = options.transform;\n const transformToRoot = options.transformToRoot;\n const sceneGraph = options.sceneGraph;\n const children = options.children;\n\n this._node = node;\n this._name = node.name;\n this._id = node.index;\n this._sceneGraph = sceneGraph;\n this._children = children;\n\n this._originalTransform = Matrix4.clone(transform, this._originalTransform);\n this._transform = Matrix4.clone(transform, this._transform);\n this._transformToRoot = Matrix4.clone(transformToRoot, this._transformToRoot);\n\n this._computedTransform = new Matrix4(); // Computed in initialize()\n this._transformDirty = false;\n\n // Used for animation\n this._transformParameters = undefined;\n this._morphWeights = [];\n\n // Will be set by the scene graph after the skins have been created\n this._runtimeSkin = undefined;\n this._computedJointMatrices = [];\n\n /**\n * Whether or not to show this node and its children. This can be toggled\n * by the user through {@link ModelNode}.\n *\n * @type {Boolean}\n *\n * @default true\n *\n * @private\n */\n this.show = true;\n\n /**\n * Whether or not this node is animated by the user. This is set by the\n * corresponding {@link ModelNode} when the user supplies their\n * own transform. If this is true, the node will ignore animations in the\n * model's asset.\n *\n * @type {Boolean}\n *\n * @private\n */\n this.userAnimated = false;\n\n /**\n * Pipeline stages to apply across all the mesh primitives of this node.\n * This is an array of classes, each with a static method called\n * <code>process()</code>.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.pipelineStages = [];\n\n /**\n * The mesh primitives that belong to this node.\n *\n * @type {ModelRuntimePrimitive[]}\n * @readonly\n *\n * @private\n */\n this.runtimePrimitives = [];\n\n /**\n * Update stages to apply to this node.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.updateStages = [];\n\n /**\n * The component-wise minimum value of the translations of the instances.\n * This value is set by InstancingPipelineStage.\n *\n * @type {Cartesian3}\n *\n * @private\n */\n this.instancingTranslationMin = undefined;\n\n /**\n * The component-wise maximum value of the translations of the instances.\n * This value is set by InstancingPipelineStage.\n *\n * @type {Cartesian3}\n *\n * @private\n */\n this.instancingTranslationMax = undefined;\n\n /**\n * A buffer containing the instanced transforms. The memory is managed\n * by Model; this is just a reference.\n *\n * @type {Buffer}\n *\n * @private\n */\n this.instancingTransformsBuffer = undefined;\n\n /**\n * A buffer containing the instanced transforms projected to 2D world\n * coordinates. Used for rendering in 2D / CV mode. The memory is managed\n * by Model; this is just a reference.\n *\n * @type {Buffer}\n *\n * @private\n */\n this.instancingTransformsBuffer2D = undefined;\n\n /**\n * A buffer containing the instanced translation values for the node if\n * it is instanced. Used for rendering in 2D / CV mode. The memory is\n * managed by Model; this is just a reference.\n *\n * @type {Buffer}\n *\n * @private\n */\n this.instancingTranslationBuffer2D = undefined;\n\n /**\n * If the model is instanced and projected to 2D, the reference point is the\n * average of the instancing translation max and min. The 2D translations are\n * defined relative to this point to avoid precision issues on the GPU.\n * <p>\n * This value is set by InstancingPipelineStage.\n * </p>\n *\n * @type {Cartesian3}\n *\n * @private\n */\n this.instancingReferencePoint2D = undefined;\n\n initialize(this);\n}\n\nObject.defineProperties(ModelRuntimeNode.prototype, {\n /**\n * The internal node this runtime node represents.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {ModelComponents.Node}\n * @readonly\n *\n * @private\n */\n node: {\n get: function () {\n return this._node;\n },\n },\n /**\n * The scene graph this node belongs to.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {ModelSceneGraph}\n * @readonly\n *\n * @private\n */\n sceneGraph: {\n get: function () {\n return this._sceneGraph;\n },\n },\n\n /**\n * The indices of the children of this node in the scene graph.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Number[]}\n * @readonly\n *\n * @private\n */\n children: {\n get: function () {\n return this._children;\n },\n },\n\n /**\n * The node's local space transform. This can be changed externally via\n * the corresponding {@link ModelNode}, such that animation can be\n * driven by another source, not just an animation in the model's asset.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Matrix4}\n *\n * @private\n */\n transform: {\n get: function () {\n return this._transform;\n },\n set: function (value) {\n this._transformDirty = true;\n this._transform = Matrix4.clone(value, this._transform);\n },\n },\n\n /**\n * The transforms of all the node's ancestors, not including this node's\n * transform.\n *\n * @see ModelRuntimeNode#computedTransform\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @private\n */\n transformToRoot: {\n get: function () {\n return this._transformToRoot;\n },\n },\n\n /**\n * A transform from the node's local space to the model's scene graph space.\n * This is the product of transformToRoot * transform.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @private\n */\n computedTransform: {\n get: function () {\n return this._computedTransform;\n },\n },\n\n /**\n * The node's original transform, as specified in the model.\n * Does not include transformations from the node's ancestors.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @private\n */\n originalTransform: {\n get: function () {\n return this._originalTransform;\n },\n },\n\n /**\n * The node's local space translation. This is used internally to allow\n * animations in the model's asset to affect the node's properties.\n *\n * If the node's transformation was originally described using a matrix\n * in the model, then this will return undefined.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Cartesian3}\n *\n * @exception {DeveloperError} The translation of a node cannot be set if it was defined using a matrix in the model's asset.\n *\n * @private\n */\n translation: {\n get: function () {\n return defined(this._transformParameters)\n ? this._transformParameters.translation\n : undefined;\n },\n set: function (value) {\n const transformParameters = this._transformParameters;\n const currentTranslation = transformParameters.translation;\n if (Cartesian3.equals(currentTranslation, value)) {\n return;\n }\n\n transformParameters.translation = Cartesian3.clone(\n value,\n transformParameters.translation\n );\n\n updateTransformFromParameters(this, transformParameters);\n },\n },\n\n /**\n * The node's local space rotation. This is used internally to allow\n * animations in the model's asset to affect the node's properties.\n *\n * If the node's transformation was originally described using a matrix\n * in the model, then this will return undefined.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Quaternion}\n *\n * @exception {DeveloperError} The rotation of a node cannot be set if it was defined using a matrix in the model's asset.\n *\n * @private\n */\n rotation: {\n get: function () {\n return defined(this._transformParameters)\n ? this._transformParameters.rotation\n : undefined;\n },\n set: function (value) {\n const transformParameters = this._transformParameters;\n const currentRotation = transformParameters.rotation;\n if (Quaternion.equals(currentRotation, value)) {\n return;\n }\n\n transformParameters.rotation = Quaternion.clone(\n value,\n transformParameters.rotation\n );\n\n updateTransformFromParameters(this, transformParameters);\n },\n },\n\n /**\n * The node's local space scale. This is used internally to allow\n * animations in the model's asset to affect the node's properties.\n *\n * If the node's transformation was originally described using a matrix\n * in the model, then this will return undefined.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Cartesian3}\n *\n * @exception {DeveloperError} The scale of a node cannot be set if it was defined using a matrix in the model's asset.\n * @private\n */\n scale: {\n get: function () {\n return defined(this._transformParameters)\n ? this._transformParameters.scale\n : undefined;\n },\n set: function (value) {\n const transformParameters = this._transformParameters;\nconst currentScale = transformParameters.scale;\n if (Cartesian3.equals(currentScale, value)) {\n return;\n }\n\n transformParameters.scale = Cartesian3.clone(\n value,\n transformParameters.scale\n );\n\n updateTransformFromParameters(this, transformParameters);\n },\n },\n\n /**\n * The node's morph weights. This is used internally to allow animations\n * in the model's asset to affect the node's properties.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Number[]}\n *\n * @private\n */\n morphWeights: {\n get: function () {\n return this._morphWeights;\n },\n set: function (value) {\n const valueLength = value.length;\nfor (let i = 0; i < valueLength; i++) {\n this._morphWeights[i] = value[i];\n }\n },\n },\n\n /**\n * The skin applied to this node, if it exists.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {ModelSkin}\n * @readonly\n *\n * @private\n */\n runtimeSkin: {\n get: function () {\n return this._runtimeSkin;\n },\n },\n\n /**\n * The computed joint matrices of this node, derived from its skin.\n *\n * @memberof ModelRuntimeNode.prototype\n * @type {Matrix4[]}\n * @readonly\n *\n * @private\n */\n computedJointMatrices: {\n get: function () {\n return this._computedJointMatrices;\n },\n },\n});\n\nfunction initialize(runtimeNode) {\n const transform = runtimeNode.transform;\n const transformToRoot = runtimeNode.transformToRoot;\n const computedTransform = runtimeNode._computedTransform;\n runtimeNode._computedTransform = Matrix4.multiply(\n transformToRoot,\n transform,\n computedTransform\n );\n\n const node = runtimeNode.node;\n if (!defined(node.matrix)) {\n runtimeNode._transformParameters = new TranslationRotationScale(\n node.translation,\n node.rotation,\n node.scale\n );\n }\n\n if (defined(node.morphWeights)) {\n runtimeNode._morphWeights = node.morphWeights.slice();\n }\n\n // If this node is affected by an articulation from the AGI_articulations\n // extension, add this node to its list of affected nodes.\n const articulationName = node.articulationName;\n if (defined(articulationName)) {\n const sceneGraph = runtimeNode.sceneGraph;\n const runtimeArticulations = sceneGraph._runtimeArticulations;\n\n const runtimeArticulation = runtimeArticulations[articulationName];\n if (defined(runtimeArticulation)) {\n runtimeArticulation.runtimeNodes.push(runtimeNode);\n }\n }\n}\n\nfunction updateTransformFromParameters(runtimeNode, transformParameters) {\n runtimeNode._transformDirty = true;\n\n runtimeNode._transform = Matrix4.fromTranslationRotationScale(\n transformParameters,\n runtimeNode._transform\n );\n}\n\n/**\n * Returns the child with the given index.\n *\n * @param {Number} index The index of the child.\n *\n * @returns {ModelRuntimeNode}\n *\n * @example\n * // Iterate through all children of a runtime node.\n * for (let i = 0; i < runtimeNode.children.length; i++)\n * {\n * const childNode = runtimeNode.getChild(i);\n * }\n *\n * @private\n */\nModelRuntimeNode.prototype.getChild = function (index) {\n return this.sceneGraph._runtimeNodes[this.children[index]];\n};\n\n/**\n * Configure the node pipeline stages. If the pipeline needs to be re-run, call\n * this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @private\n */\nModelRuntimeNode.prototype.configurePipeline = function () {\n const node = this.node;\n const pipelineStages = this.pipelineStages;\n pipelineStages.length = 0;\n const updateStages = this.updateStages;\n updateStages.length = 0;\n\n if (defined(node.instances)) {\n pipelineStages.push(InstancingPipelineStage);\n }\n\n pipelineStages.push(NodeStatisticsPipelineStage);\n\n updateStages.push(ModelMatrixUpdateStage);\n};\n\n/**\n * Updates the computed transform used for rendering and instancing.\n *\n * @private\n */\nModelRuntimeNode.prototype.updateComputedTransform = function () {\n this._computedTransform = Matrix4.multiply(\n this._transformToRoot,\n this._transform,\n this._computedTransform\n );\n};\n\n/**\n * Updates the joint matrices for this node, where each matrix is computed as\n * computedJointMatrix = nodeWorldTransform^(-1) * skinJointMatrix.\n *\n * @private\n */\nModelRuntimeNode.prototype.updateJointMatrices = function () {\n const runtimeSkin = this._runtimeSkin;\n if (!defined(runtimeSkin)) {\n return;\n }\n\n runtimeSkin.updateJointMatrices();\n\n const computedJointMatrices = this._computedJointMatrices;\n const skinJointMatrices = runtimeSkin.jointMatrices;\n const length = skinJointMatrices.length;\n\n for (let i = 0; i < length; i++) {\n if (!defined(computedJointMatrices[i])) {\n computedJointMatrices[i] = new Matrix4();\n }\n\n const nodeWorldTransform = Matrix4.multiplyTransformation(\n this.transformToRoot,\n this.transform,\n computedJointMatrices[i]\n );\n\n const inverseNodeWorldTransform = Matrix4.inverseTransformation(\n nodeWorldTransform,\n computedJointMatrices[i]\n );\n\n computedJointMatrices[i] = Matrix4.multiplyTransformation(\n inverseNodeWorldTransform,\n skinJointMatrices[i],\n computedJointMatrices[i]\n );\n }\n};\n\nexport default ModelRuntimeNode;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport BlendingState from \"../BlendingState.js\";\nimport Pass from \"../../Renderer/Pass.js\";\n\n/**\n * A pipeline stage for configuring the alpha options for handling translucency.\n *\n * @namespace MaterialPipelineStage\n *\n * @private\n */\nconst AlphaPipelineStage = {\n name: \"AlphaPipelineStage\", // Helps with debugging\n};\n\nAlphaPipelineStage.process = function (renderResources, primitive, frameState) {\n const alphaOptions = renderResources.alphaOptions;\n\n // Ensure the pass is defined\n const model = renderResources.model;\n alphaOptions.pass = defaultValue(alphaOptions.pass, model.opaquePass);\n\n const renderStateOptions = renderResources.renderStateOptions;\n if (alphaOptions.pass === Pass.TRANSLUCENT) {\n renderStateOptions.cull.enabled = false;\n renderStateOptions.depthMask = false;\n renderStateOptions.blending = BlendingState.ALPHA_BLEND;\n }\n\n const shaderBuilder = renderResources.shaderBuilder;\n const uniformMap = renderResources.uniformMap;\n\n if (defined(alphaOptions.alphaCutoff)) {\n shaderBuilder.addDefine(\n \"ALPHA_MODE_MASK\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addUniform(\n \"float\",\n \"u_alphaCutoff\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_alphaCutoff = function () {\n return alphaOptions.alphaCutoff;\n };\n }\n};\n\nexport default AlphaPipelineStage;\n", "import combine from \"../../Core/combine.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * The batch texture stage is responsible for setting up the batch texture for the primitive.\n *\n * @namespace BatchTexturePipelineStage\n * @private\n */\nconst BatchTexturePipelineStage = {\n name: \"BatchTexturePipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. This modifies the following parts of the render resources:\n * <ul>\n * <li>adds uniforms for the batch texture</li>\n * <li>adds defines for multiline batch textures</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nBatchTexturePipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const batchTextureUniforms = {};\n\n const model = renderResources.model;\n\n const featureTable = model.featureTables[model.featureTableId];\n\n // Number of features in the feature table.\n const featuresLength = featureTable.featuresLength;\n shaderBuilder.addUniform(\"int\", \"model_featuresLength\");\n batchTextureUniforms.model_featuresLength = function () {\n return featuresLength;\n };\n\n // Batch texture\n const batchTexture = featureTable.batchTexture;\n shaderBuilder.addUniform(\"sampler2D\", \"model_batchTexture\");\n batchTextureUniforms.model_batchTexture = function () {\n return defaultValue(batchTexture.batchTexture, batchTexture.defaultTexture);\n };\n\n // Batch texture step size\n shaderBuilder.addUniform(\"vec4\", \"model_textureStep\");\n batchTextureUniforms.model_textureStep = function () {\n return batchTexture.textureStep;\n };\n\n // Batch texture dimensions\n if (batchTexture.textureDimensions.y > 1) {\n shaderBuilder.addDefine(\"MULTILINE_BATCH_TEXTURE\");\n shaderBuilder.addUniform(\"vec2\", \"model_textureDimensions\");\n batchTextureUniforms.model_textureDimensions = function () {\n return batchTexture.textureDimensions;\n };\n }\n\n renderResources.uniformMap = combine(\n batchTextureUniforms,\n renderResources.uniformMap\n );\n};\n\nexport default BatchTexturePipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The classification pipeline stage is responsible for batching features\n * together to be rendered by the {@link ClassificationModelDrawCommand}.\n *\n * @namespace ClassificationPipelineStage\n *\n * @private\n */\nconst ClassificationPipelineStage = {\n name: \"ClassificationPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>adds a define to the shader to indicate that the primitive classifies other assets</li>\n * <li>adds arrays containing batch lengths and offsets to the primitive's resources\n * </ul>\n *\n * <p>\n * See {@link ClassificationModelDrawCommand} for the use of the batch offsets and lengths.\n * </p>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nClassificationPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"HAS_CLASSIFICATION\",\n undefined,\n ShaderDestination.BOTH\n );\n\n const runtimePrimitive = renderResources.runtimePrimitive;\n\n if (!defined(runtimePrimitive.batchLengths)) {\n createClassificationBatches(primitive, runtimePrimitive);\n }\n};\n\nfunction createClassificationBatches(primitive, runtimePrimitive) {\n const positionAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.POSITION\n );\n\n if (!defined(positionAttribute)) {\n throw new RuntimeError(\n \"Primitives must have a position attribute to be used for classification.\"\n );\n }\n\n let indicesArray;\n const indices = primitive.indices;\n const hasIndices = defined(indices);\n if (hasIndices) {\n indicesArray = indices.typedArray;\n // Unload the typed array. This is just a pointer to the array in\n // the index buffer loader.\n indices.typedArray = undefined;\n }\n\n const count = hasIndices ? indices.count : positionAttribute.count;\n const featureIdAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.FEATURE_ID,\n 0\n );\n\n // If there are no feature IDs, render the primitive in a single batch.\n if (!defined(featureIdAttribute)) {\n runtimePrimitive.batchLengths = [count];\n runtimePrimitive.batchOffsets = [0];\n\n return;\n }\n\n const featureIds = featureIdAttribute.typedArray;\n // Unload the typed array. This is just a pointer to the array in\n // the vertex buffer loader, so if the typed array is shared by\n // multiple primitives (i.e. multiple instances of the same mesh),\n // this will not affect the other primitives.\n featureIdAttribute.typedArray = undefined;\n\n const batchLengths = [];\n const batchOffsets = [0];\n\n const firstIndex = hasIndices ? indicesArray[0] : 0;\n let currentBatchId = featureIds[firstIndex];\n let currentOffset = 0;\n\n for (let i = 1; i < count; i++) {\n const index = hasIndices ? indicesArray[i] : i;\n const batchId = featureIds[index];\n\n if (batchId !== currentBatchId) {\n // Store the length of this batch and begin counting the next one.\n const batchLength = i - currentOffset;\n const newOffset = i;\n\n batchLengths.push(batchLength);\n batchOffsets.push(newOffset);\n\n currentOffset = newOffset;\n currentBatchId = batchId;\n }\n }\n\n const finalBatchLength = count - currentOffset;\n batchLengths.push(finalBatchLength);\n\n runtimePrimitive.batchLengths = batchLengths;\n runtimePrimitive.batchOffsets = batchOffsets;\n}\n\nexport default ClassificationPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void filterByPassType(inout vec3 positionMC, vec4 featureColor)\\n\\\n{\\n\\\nbool styleTranslucent = (featureColor.a != 1.0);\\n\\\nif (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\\n\\\n{\\n\\\n#ifdef HAS_SILHOUETTE\\n\\\npositionMC *= float(model_silhouettePass);\\n\\\n#else\\n\\\npositionMC *= 0.0;\\n\\\n#endif\\n\\\n}\\n\\\nelse if (czm_pass != czm_passTranslucent && styleTranslucent)\\n\\\n{\\n\\\npositionMC *= 0.0;\\n\\\n}\\n\\\n}\\n\\\nvoid cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)\\n\\\n{\\n\\\nfloat show = ceil(feature.color.a);\\n\\\npositionMC *= show;\\n\\\n#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)\\n\\\nfilterByPassType(positionMC, feature.color);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void filterByPassType(vec4 featureColor)\\n\\\n{\\n\\\nbool styleTranslucent = (featureColor.a != 1.0);\\n\\\nif (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\\n\\\n{\\n\\\n#ifdef HAS_SILHOUETTE\\n\\\nif(!model_silhouettePass) {\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\ndiscard;\\n\\\n#endif\\n\\\n}\\n\\\nelse if (czm_pass != czm_passTranslucent && styleTranslucent)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n}\\n\\\nvoid cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)\\n\\\n{\\n\\\nvec4 featureColor = feature.color;\\n\\\nif (featureColor.a == 0.0)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)\\n\\\nfilterByPassType(featureColor);\\n\\\n#endif\\n\\\nfeatureColor = czm_gammaCorrect(featureColor);\\n\\\n#ifdef HAS_CLASSIFICATION\\n\\\nmaterial.diffuse = featureColor.rgb * featureColor.a;\\n\\\n#else\\n\\\nfloat highlight = ceil(model_colorBlend);\\n\\\nmaterial.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);\\n\\\n#endif\\n\\\nmaterial.alpha *= featureColor.a;\\n\\\n}\\n\\\n\";\n", "import ColorBlendMode from \"../ColorBlendMode.js\";\nimport CPUStylingStageVS from \"../../Shaders/Model/CPUStylingStageVS.js\";\nimport CPUStylingStageFS from \"../../Shaders/Model/CPUStylingStageFS.js\";\nimport defined from \"../../Core/defined.js\";\nimport ModelColorPipelineStage from \"./ModelColorPipelineStage.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The CPU styling stage is responsible for ensuring that the feature's color\n * is applied at runtime.\n *\n * @namespace CPUStylingPipelineStage\n *\n * @private\n */\nconst CPUStylingPipelineStage = {\n name: \"CPUStylingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. This modifies the following parts of the render resources:\n * <ul>\n * <li>adds the styling code to both the vertex and fragment shaders</li>\n * <li>adds the define to trigger the stage's shader functions</li>\n * <li>adds a uniform with the model's color blend mode and amount</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCPUStylingPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const model = renderResources.model;\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addVertexLines(CPUStylingStageVS);\n shaderBuilder.addFragmentLines(CPUStylingStageFS);\n shaderBuilder.addDefine(\"USE_CPU_STYLING\", undefined, ShaderDestination.BOTH);\n\n // These uniforms may have already been added by the ModelColorStage\n // if a static color is applied.\n if (!defined(model.color)) {\n shaderBuilder.addUniform(\n \"float\",\n ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME,\n ShaderDestination.FRAGMENT\n );\n renderResources.uniformMap[\n ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME\n ] = function () {\n return ColorBlendMode.getColorBlend(\n model.colorBlendMode,\n model.colorBlendAmount\n );\n };\n }\n\n shaderBuilder.addUniform(\n \"bool\",\n \"model_commandTranslucent\",\n ShaderDestination.BOTH\n );\n renderResources.uniformMap.model_commandTranslucent = function () {\n // Always check the current value, because custom shaders may\n // change the value with the translucencyMode parameter\n return renderResources.alphaOptions.pass === Pass.TRANSLUCENT;\n };\n};\n\nexport default CPUStylingPipelineStage;\n", "/**\n * An enum describing how the {@link CustomShader} will be added to the\n * fragment shader. This determines how the shader interacts with the material.\n *\n * @enum {String}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst CustomShaderMode = {\n /**\n * The custom shader will be used to modify the results of the material stage\n * before lighting is applied.\n *\n * @type {String}\n * @constant\n */\n MODIFY_MATERIAL: \"MODIFY_MATERIAL\",\n /**\n * The custom shader will be used instead of the material stage. This is a hint\n * to optimize out the material processing code.\n *\n * @type {String}\n * @constant\n */\n REPLACE_MATERIAL: \"REPLACE_MATERIAL\",\n};\n\n/**\n * Convert the shader mode to an uppercase identifier for use in GLSL define\n * directives. For example: <code>#define CUSTOM_SHADER_MODIFY_MATERIAL</code>\n * @param {CustomShaderMode} customShaderMode The shader mode\n * @return {String} The name of the GLSL macro to use\n *\n * @private\n */\nCustomShaderMode.getDefineName = function (customShaderMode) {\n return `CUSTOM_SHADER_${customShaderMode}`;\n};\n\nexport default Object.freeze(CustomShaderMode);\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void customShaderStage(\\n\\\ninout czm_modelVertexOutput vsOutput,\\n\\\ninout ProcessedAttributes attributes,\\n\\\nFeatureIds featureIds,\\n\\\nMetadata metadata,\\n\\\nMetadataClass metadataClass,\\n\\\nMetadataStatistics metadataStatistics\\n\\\n) {\\n\\\nVertexInput vsInput;\\n\\\ninitializeInputStruct(vsInput, attributes);\\n\\\nvsInput.featureIds = featureIds;\\n\\\nvsInput.metadata = metadata;\\n\\\nvsInput.metadataClass = metadataClass;\\n\\\nvsInput.metadataStatistics = metadataStatistics;\\n\\\nvertexMain(vsInput, vsOutput);\\n\\\nattributes.positionMC = vsOutput.positionMC;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void customShaderStage(\\n\\\ninout czm_modelMaterial material,\\n\\\nProcessedAttributes attributes,\\n\\\nFeatureIds featureIds,\\n\\\nMetadata metadata,\\n\\\nMetadataClass metadataClass,\\n\\\nMetadataStatistics metadataStatistics\\n\\\n) {\\n\\\nFragmentInput fsInput;\\n\\\ninitializeInputStruct(fsInput, attributes);\\n\\\nfsInput.featureIds = featureIds;\\n\\\nfsInput.metadata = metadata;\\n\\\nfsInput.metadataClass = metadataClass;\\n\\\nfsInput.metadataStatistics = metadataStatistics;\\n\\\nfragmentMain(fsInput, material);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\\n\\\ninitializeFeatureIds(featureIds, attributes);\\n\\\ninitializeFeatureIdAliases(featureIds);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)\\n\\\n{\\n\\\ninitializeFeatureIds(featureIds, attributes);\\n\\\ninitializeFeatureIdAliases(featureIds);\\n\\\nsetFeatureIdVaryings();\\n\\\n}\\n\\\n\";\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport FeatureIdStageFS from \"../../Shaders/Model/FeatureIdStageFS.js\";\nimport FeatureIdStageVS from \"../../Shaders/Model/FeatureIdStageVS.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The feature ID pipeline stage is responsible for processing feature IDs\n * (both attributes and textures), updating the shader in preparation for\n * custom shaders, picking, and/or styling.\n *\n * @namespace FeatureIdPipelineStage\n * @private\n */\nconst FeatureIdPipelineStage = {\n name: \"FeatureIdPipelineStage\", // Helps with debugging\n\n STRUCT_ID_FEATURE_IDS_VS: \"FeatureIdsVS\",\n STRUCT_ID_FEATURE_IDS_FS: \"FeatureIdsFS\",\n STRUCT_NAME_FEATURE_IDS: \"FeatureIds\",\n FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS: \"initializeFeatureIdsVS\",\n FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS: \"initializeFeatureIdsFS\",\n FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS: \"initializeFeatureIdAliasesVS\",\n FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS: \"initializeFeatureIdAliasesFS\",\n FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:\n \"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)\",\n FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:\n \"void initializeFeatureIdAliases(inout FeatureIds featureIds)\",\n FUNCTION_ID_SET_FEATURE_ID_VARYINGS: \"setFeatureIdVaryings\",\n FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS: \"void setFeatureIdVaryings()\",\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n * <li>Adds the FeatureIds struct and corresponding initialization functions in the vertex and fragment shader</li>\n * <li>For each feature ID attribute, the attributes were already uploaded in the geometry stage, so just update the shader code </li>\n * <li>For each feature ID implicit range, a new attribute is created and uploaded to the GPU since gl_VertexID is not available in WebGL 1. The shader is updated with an attribute, varying, and initialization code.</li>\n * <li>For each feature ID texture, the texture is added to the uniform map, and shader code is added to perform the texture read.</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nFeatureIdPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n declareStructsAndFunctions(shaderBuilder);\n\n const instances = renderResources.runtimeNode.node.instances;\n if (defined(instances)) {\n processInstanceFeatureIds(renderResources, instances, frameState);\n }\n processPrimitiveFeatureIds(renderResources, primitive, frameState);\n\n shaderBuilder.addVertexLines(FeatureIdStageVS);\n shaderBuilder.addFragmentLines(FeatureIdStageFS);\n};\n\nfunction declareStructsAndFunctions(shaderBuilder) {\n // Declare the FeatureIds struct. The vertex shader will only use\n // feature ID attributes, while the fragment shader will also use\n // feature ID textures.\n shaderBuilder.addStruct(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStruct(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n ShaderDestination.FRAGMENT\n );\n\n // declare the initializeFeatureIds() function. The details may differ\n // between vertex and fragment shader\n shaderBuilder.addFunction(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addFunction(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,\n ShaderDestination.FRAGMENT\n );\n\n // declare the initializeFeatureIdAliases() function. The details may differ\n // between vertex and fragment shader\n shaderBuilder.addFunction(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,\n FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addFunction(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,\n FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,\n ShaderDestination.FRAGMENT\n );\n\n // declare the setFeatureIdVaryings() function in the vertex shader only\n shaderBuilder.addFunction(\n FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,\n ShaderDestination.VERTEX\n );\n}\n\nfunction processInstanceFeatureIds(renderResources, instances, frameState) {\n const featureIdsArray = instances.featureIds;\n const count = instances.attributes[0].count;\n\n for (let i = 0; i < featureIdsArray.length; i++) {\n const featureIds = featureIdsArray[i];\n const variableName = featureIds.positionalLabel;\n\n if (featureIds instanceof ModelComponents.FeatureIdAttribute) {\n processInstanceAttribute(renderResources, featureIds, variableName);\n } else {\n const instanceDivisor = 1;\n processImplicitRange(\n renderResources,\n featureIds,\n variableName,\n count,\n instanceDivisor,\n frameState\n );\n }\n\n const label = featureIds.label;\n if (defined(label)) {\n addAlias(renderResources, variableName, label, ShaderDestination.BOTH);\n }\n }\n}\n\nfunction processPrimitiveFeatureIds(renderResources, primitive, frameState) {\n const featureIdsArray = primitive.featureIds;\n const positionAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.POSITION\n );\n const count = positionAttribute.count;\n\n for (let i = 0; i < featureIdsArray.length; i++) {\n const featureIds = featureIdsArray[i];\n const variableName = featureIds.positionalLabel;\n\n let aliasDestination = ShaderDestination.BOTH;\n if (featureIds instanceof ModelComponents.FeatureIdAttribute) {\n processAttribute(renderResources, featureIds, variableName);\n } else if (featureIds instanceof ModelComponents.FeatureIdImplicitRange) {\n processImplicitRange(\n renderResources,\n featureIds,\n variableName,\n count,\n undefined,\n frameState\n );\n } else {\n processTexture(renderResources, featureIds, variableName, i, frameState);\n aliasDestination = ShaderDestination.FRAGMENT;\n }\n\n const label = featureIds.label;\n if (defined(label)) {\n addAlias(renderResources, variableName, label, aliasDestination);\n }\n }\n}\n\nfunction processInstanceAttribute(\n renderResources,\n featureIdAttribute,\n variableName\n) {\n // Add a field to the FeatureIds struct.\n // Example:\n // struct FeatureIds {\n // ...\n // int instanceFeatureId_n;\n // ...\n // }\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n \"int\",\n variableName\n );\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n \"int\",\n variableName\n );\n\n // Initialize the field from the corresponding attribute.\n // Example: featureIds.instanceFeatureId_n = int(czm_round(attributes.instanceFeatureId_0));\n const setIndex = featureIdAttribute.setIndex;\n const prefix = variableName.replace(/_\\d+$/, \"_\");\n\n const attributeName = `a_${prefix}${setIndex}`;\n const varyingName = `v_${prefix}${setIndex}`;\n const vertexLine = `featureIds.${variableName} = int(czm_round(${attributeName}));`;\n const fragmentLine = `featureIds.${variableName} = int(czm_round(${varyingName}));`;\n\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n [vertexLine]\n );\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n [fragmentLine]\n );\n\n // Instanced attributes don't normally need varyings, so add one here\n shaderBuilder.addVarying(\"float\", varyingName);\n\n // The varying needs initialization in the vertex shader\n // Example:\n // v_instanceFeatureId_n = a_instanceFeatureId_n;\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n [`${varyingName} = ${attributeName};`]\n );\n}\n\nfunction processAttribute(renderResources, featureIdAttribute, variableName) {\n // Add a field to the FeatureIds struct.\n // Example:\n // struct FeatureIds {\n // ...\n // int featureId_n;\n // ...\n // }\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n \"int\",\n variableName\n );\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n \"int\",\n variableName\n );\n\n // Initialize the field from the corresponding attribute.\n // Example: featureIds.featureId_n = attributes.featureId_0;\n // Since this uses the ProcessedAttributes struct, the line is the same\n // for both vertex and fragment shader.\n const setIndex = featureIdAttribute.setIndex;\n const prefix = variableName.replace(/_\\d+$/, \"_\");\n\n const initializationLines = [\n `featureIds.${variableName} = int(czm_round(attributes.${prefix}${setIndex}));`,\n ];\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n initializationLines\n );\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n initializationLines\n );\n}\n\nfunction processImplicitRange(\n renderResources,\n implicitFeatureIds,\n variableName,\n count,\n instanceDivisor,\n frameState\n) {\n // Generate a vertex attribute for the implicit IDs since WebGL 1 does not\n // support gl_VertexID\n generateImplicitFeatureIdAttribute(\n renderResources,\n implicitFeatureIds,\n count,\n instanceDivisor,\n frameState\n );\n\n // Declare the vertex attribute in the shader\n // Example: attribute float a_implicit_feature_id_n;\n const shaderBuilder = renderResources.shaderBuilder;\n const implicitAttributeName = `a_implicit_${variableName}`;\n shaderBuilder.addAttribute(\"float\", implicitAttributeName);\n\n // Also declare the corresponding varyings\n // Example: varying float v_implicit_feature_id_n;\n const implicitVaryingName = `v_implicit_${variableName}`;\n shaderBuilder.addVarying(\"float\", implicitVaryingName);\n\n // Add a field to the FeatureIds struct.\n // Example:\n // struct FeatureIds {\n // ...\n // int featureId_n;\n // ...\n // }\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n \"int\",\n variableName\n );\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n \"int\",\n variableName\n );\n\n // The varying needs initialization in the vertex shader\n // Example:\n // v_implicit_featureId_n = a_implicit_featureId_n;\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,\n [`${implicitVaryingName} = ${implicitAttributeName};`]\n );\n\n // Initialize the field from the generated attribute/varying.\n // Example:\n // featureIds.featureId_n = a_implicit_featureId_n; (VS)\n // featureIds.featureId_n = v_implicit_featureId_n; (FS)\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,\n [`featureIds.${variableName} = int(czm_round(${implicitAttributeName}));`]\n );\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n [`featureIds.${variableName} = int(czm_round(${implicitVaryingName}));`]\n );\n}\n\nfunction processTexture(\n renderResources,\n featureIdTexture,\n variableName,\n index,\n frameState\n) {\n // Create the feature ID texture uniform. The index matches the index from\n // the featureIds array, even if this is not consecutive.\n const uniformName = `u_featureIdTexture_${index}`;\n const uniformMap = renderResources.uniformMap;\n const textureReader = featureIdTexture.textureReader;\n uniformMap[uniformName] = function () {\n return defaultValue(\n textureReader.texture,\n frameState.context.defaultTexture\n );\n };\n\n const channels = textureReader.channels;\n\n // Add a field to the FeatureIds struct in the fragment shader only\n // Example:\n // struct FeatureIds {\n // ...\n // int featureId_n;\n // ...\n // }\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n \"int\",\n variableName\n );\n\n // Declare the uniform in the fragment shader\n shaderBuilder.addUniform(\n \"sampler2D\",\n uniformName,\n ShaderDestination.FRAGMENT\n );\n\n // Read one or more channels from the texture\n // example: texture2D(u_featureIdTexture_0, v_texCoord_1).rg\n const texCoord = `v_texCoord_${textureReader.texCoord}`;\n const textureRead = `texture2D(${uniformName}, ${texCoord}).${channels}`;\n\n // Finally, assign to the struct field. Example:\n // featureIds.featureId_0 = unpacked;\n const initializationLine = `featureIds.${variableName} = czm_unpackUint(${textureRead});`;\n\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,\n [initializationLine]\n );\n}\n\nfunction addAlias(renderResources, variableName, alias, shaderDestination) {\n // Add a field to the FeatureIds struct.\n // Example:\n // struct FeatureIds {\n // ...\n // int alias;\n // ...\n // }\n const shaderBuilder = renderResources.shaderBuilder;\n const updateVS = ShaderDestination.includesVertexShader(shaderDestination);\n if (updateVS) {\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,\n \"int\",\n alias\n );\n }\n shaderBuilder.addStructField(\n FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,\n \"int\",\n alias\n );\n\n // Initialize the field from the original variable\n // Example: featureIds.alias = featureIds.featureId_n;\n const initializationLines = [\n `featureIds.${alias} = featureIds.${variableName};`,\n ];\n if (updateVS) {\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,\n initializationLines\n );\n }\n shaderBuilder.addFunctionLines(\n FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,\n initializationLines\n );\n}\n\nfunction generateImplicitFeatureIdAttribute(\n renderResources,\n implicitFeatureIds,\n count,\n instanceDivisor,\n frameState\n) {\n const model = renderResources.model;\n let vertexBuffer;\n let value;\n if (defined(implicitFeatureIds.repeat)) {\n const typedArray = generateImplicitFeatureIdTypedArray(\n implicitFeatureIds,\n count\n );\n vertexBuffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n vertexBuffer.vertexArrayDestroyable = false;\n model._pipelineResources.push(vertexBuffer);\n const hasCpuCopy = false;\n model.statistics.addBuffer(vertexBuffer, hasCpuCopy);\n } else {\n value = [implicitFeatureIds.offset];\n }\n\n const generatedFeatureIdAttribute = {\n index: renderResources.attributeIndex++,\n instanceDivisor: instanceDivisor,\n value: value,\n vertexBuffer: vertexBuffer,\n normalize: false,\n componentsPerAttribute: 1,\n componentDatatype: ComponentDatatype.FLOAT,\n strideInBytes: ComponentDatatype.getSizeInBytes(ComponentDatatype.FLOAT),\n offsetInBytes: 0,\n };\n\n renderResources.attributes.push(generatedFeatureIdAttribute);\n}\n\n/**\n * Generates a typed array for implicit feature IDs\n * @private\n */\nfunction generateImplicitFeatureIdTypedArray(implicitFeatureIds, count) {\n const offset = implicitFeatureIds.offset;\n const repeat = implicitFeatureIds.repeat;\n\n const typedArray = new Float32Array(count);\n for (let i = 0; i < count; i++) {\n typedArray[i] = offset + Math.floor(i / repeat);\n }\n\n return typedArray;\n}\n\nexport default FeatureIdPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void metadataStage(\\n\\\nout Metadata metadata,\\n\\\nout MetadataClass metadataClass,\\n\\\nout MetadataStatistics metadataStatistics,\\n\\\nProcessedAttributes attributes\\n\\\n)\\n\\\n{\\n\\\ninitializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void metadataStage(\\n\\\nout Metadata metadata,\\n\\\nout MetadataClass metadataClass,\\n\\\nout MetadataStatistics metadataStatistics,\\n\\\nProcessedAttributes attributes\\n\\\n)\\n\\\n{\\n\\\ninitializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\\n\\\nsetMetadataVaryings();\\n\\\n}\\n\\\n\";\n", "import defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport MetadataStageFS from \"../../Shaders/Model/MetadataStageFS.js\";\nimport MetadataStageVS from \"../../Shaders/Model/MetadataStageVS.js\";\nimport MetadataType from \"../MetadataType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The metadata pipeline stage processes metadata properties from\n * EXT_structural_metadata and inserts them into a struct in the shader.\n * This struct will be used by {@link CustomShaderPipelineStage} to allow the\n * user to access metadata using {@link CustomShader}\n *\n * @namespace MetadataPipelineStage\n *\n * @private\n */\nconst MetadataPipelineStage = {\n name: \"MetadataPipelineStage\",\n\n STRUCT_ID_METADATA_VS: \"MetadataVS\",\n STRUCT_ID_METADATA_FS: \"MetadataFS\",\n STRUCT_NAME_METADATA: \"Metadata\",\n\n STRUCT_ID_METADATA_CLASS_VS: \"MetadataClassVS\",\n STRUCT_ID_METADATA_CLASS_FS: \"MetadataClassFS\",\n STRUCT_NAME_METADATA_CLASS: \"MetadataClass\",\n\n STRUCT_ID_METADATA_STATISTICS_VS: \"MetadataStatisticsVS\",\n STRUCT_ID_METADATA_STATISTICS_FS: \"MetadataStatisticsFS\",\n STRUCT_NAME_METADATA_STATISTICS: \"MetadataStatistics\",\n\n FUNCTION_ID_INITIALIZE_METADATA_VS: \"initializeMetadataVS\",\n FUNCTION_ID_INITIALIZE_METADATA_FS: \"initializeMetadataFS\",\n FUNCTION_SIGNATURE_INITIALIZE_METADATA:\n \"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)\",\n FUNCTION_ID_SET_METADATA_VARYINGS: \"setMetadataVaryings\",\n FUNCTION_SIGNATURE_SET_METADATA_VARYINGS: \"void setMetadataVaryings()\",\n\n // Metadata class and statistics fields:\n // - some must be renamed to avoid reserved words\n // - some always have float/vec values, even for integer/ivec property types\n METADATA_CLASS_FIELDS: [\n { specName: \"noData\", shaderName: \"noData\" },\n { specName: \"default\", shaderName: \"defaultValue\" },\n { specName: \"min\", shaderName: \"minValue\" },\n { specName: \"max\", shaderName: \"maxValue\" },\n ],\n METADATA_STATISTICS_FIELDS: [\n { specName: \"min\", shaderName: \"minValue\" },\n { specName: \"max\", shaderName: \"maxValue\" },\n { specName: \"mean\", shaderName: \"mean\", type: \"float\" },\n { specName: \"median\", shaderName: \"median\" },\n {\n specName: \"standardDeviation\",\n shaderName: \"standardDeviation\",\n type: \"float\",\n },\n { specName: \"variance\", shaderName: \"variance\", type: \"float\" },\n { specName: \"sum\", shaderName: \"sum\" },\n ],\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n * <li>Adds a Metadata struct to the shader</li>\n * <li>If the primitive has structural metadata, properties are added to the Metadata struct</li>\n * <li>dynamic functions are added to the shader to initialize the metadata properties</li>\n * <li>Adds uniforms for property textures to the uniform map as needed</li>\n * <li>Adds uniforms for offset/scale to the uniform map as needed</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state\n * @private\n */\nMetadataPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const { shaderBuilder, model } = renderResources;\n const { structuralMetadata = {}, content } = model;\n const statistics = content?.tileset.metadataExtension?.statistics;\n\n const propertyAttributesInfo = getPropertyAttributesInfo(\n structuralMetadata.propertyAttributes,\n primitive,\n statistics\n );\n const propertyTexturesInfo = getPropertyTexturesInfo(\n structuralMetadata.propertyTextures,\n statistics\n );\n\n // Declare <type>MetadataClass and <type>MetadataStatistics structs as needed\n const allPropertyInfos = propertyAttributesInfo.concat(propertyTexturesInfo);\n declareMetadataTypeStructs(shaderBuilder, allPropertyInfos);\n\n // Always declare the Metadata, MetadataClass, and MetadataStatistics structs\n // and the initializeMetadata() function, even if not used\n declareStructsAndFunctions(shaderBuilder);\n shaderBuilder.addVertexLines(MetadataStageVS);\n shaderBuilder.addFragmentLines(MetadataStageFS);\n\n for (let i = 0; i < propertyAttributesInfo.length; i++) {\n const info = propertyAttributesInfo[i];\n processPropertyAttributeProperty(renderResources, info);\n }\n for (let i = 0; i < propertyTexturesInfo.length; i++) {\n const info = propertyTexturesInfo[i];\n processPropertyTextureProperty(renderResources, info);\n }\n};\n\n/**\n * Collect info about all properties of all propertyAttributes, and\n * return as a flattened Array\n * @param {PropertyAttribute[]} propertyAttributes The PropertyAttributes with properties to be described\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {Object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyAttributeProperty\n * @private\n */\nfunction getPropertyAttributesInfo(propertyAttributes, primitive, statistics) {\n if (!defined(propertyAttributes)) {\n return [];\n }\n return propertyAttributes.flatMap((propertyAttribute) =>\n getPropertyAttributeInfo(propertyAttribute, primitive, statistics)\n );\n}\n\n/**\n * Collect info about the properties of a single PropertyAttribute\n * @param {PropertyAttribute} propertyAttribute The PropertyAttribute with properties to be described\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {Object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyAttributeProperty\n * @private\n */\nfunction getPropertyAttributeInfo(propertyAttribute, primitive, statistics) {\n const {\n getAttributeByName,\n getAttributeInfo,\n sanitizeGlslIdentifier,\n } = ModelUtility;\n\n const classId = propertyAttribute.class.id;\n const classStatistics = statistics?.classes[classId];\n\n const propertiesArray = Object.entries(propertyAttribute.properties);\n const infoArray = new Array(propertiesArray.length);\n\n for (let i = 0; i < propertiesArray.length; i++) {\n const [propertyId, property] = propertiesArray[i];\n const modelAttribute = getAttributeByName(primitive, property.attribute);\n const { glslType, variableName } = getAttributeInfo(modelAttribute);\n\n infoArray[i] = {\n metadataVariable: sanitizeGlslIdentifier(propertyId),\n property,\n type: property.classProperty.type,\n glslType,\n variableName,\n propertyStatistics: classStatistics?.properties[propertyId],\n shaderDestination: ShaderDestination.BOTH,\n };\n }\n\n return infoArray;\n}\n\n/**\n * Collect info about all properties of all propertyTextures, and\n * return as a flattened Array\n * @param {PropertyTexture[]} propertyTextures The PropertyTextures with properties to be described\n * @param {Object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyTextureProperty\n * @private\n */\nfunction getPropertyTexturesInfo(propertyTextures, statistics) {\n if (!defined(propertyTextures)) {\n return [];\n }\n return propertyTextures.flatMap((propertyTexture) =>\n getPropertyTextureInfo(propertyTexture, statistics)\n );\n}\n\n/**\n * Collect info about the properties of a single PropertyTexture\n * @param {PropertyTexture} propertyTexture The PropertyTexture with properties to be described\n * @param {Object} [statistics] Statistics about the properties (if the model is from a 3DTiles tileset)\n * @returns {Object[]} An array of objects containing information about each PropertyTextureProperty\n * @private\n */\nfunction getPropertyTextureInfo(propertyTexture, statistics) {\n const { sanitizeGlslIdentifier } = ModelUtility;\n\n const classId = propertyTexture.class.id;\n const classStatistics = statistics?.classes[classId];\n\n const propertiesArray = Object.entries(\n propertyTexture.properties\n ).filter(([id, property]) => property.isGpuCompatible());\n const infoArray = new Array(propertiesArray.length);\n\n for (let i = 0; i < propertiesArray.length; i++) {\n const [propertyId, property] = propertiesArray[i];\n\n infoArray[i] = {\n metadataVariable: sanitizeGlslIdentifier(propertyId),\n property,\n type: property.classProperty.type,\n glslType: property.getGlslType(),\n propertyStatistics: classStatistics?.properties[propertyId],\n shaderDestination: ShaderDestination.FRAGMENT,\n };\n }\n\n return infoArray;\n}\n\n/**\n * Declare <type>MetadataClass structs in the shader for each PropertyAttributeProperty and PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {Object[]} propertyInfos Information about the PropertyAttributeProperties and PropertyTextureProperties\n * @private\n */\nfunction declareMetadataTypeStructs(shaderBuilder, propertyInfos) {\n const classTypes = new Set();\n const statisticsTypes = new Set();\n\n for (let i = 0; i < propertyInfos.length; i++) {\n const { type, glslType, propertyStatistics } = propertyInfos[i];\n classTypes.add(glslType);\n if (!defined(propertyStatistics)) {\n continue;\n }\n if (type !== MetadataType.ENUM) {\n statisticsTypes.add(glslType);\n }\n }\n\n const classFields = MetadataPipelineStage.METADATA_CLASS_FIELDS;\n for (const metadataType of classTypes) {\n const classStructName = `${metadataType}MetadataClass`;\n declareTypeStruct(classStructName, metadataType, classFields);\n }\n\n const statisticsFields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;\n for (const metadataType of statisticsTypes) {\n const statisticsStructName = `${metadataType}MetadataStatistics`;\n declareTypeStruct(statisticsStructName, metadataType, statisticsFields);\n }\n\n function declareTypeStruct(structName, type, fields) {\n shaderBuilder.addStruct(structName, structName, ShaderDestination.BOTH);\n\n for (let i = 0; i < fields.length; i++) {\n const { shaderName } = fields[i];\n const shaderType =\n fields[i].type === \"float\" ? convertToFloatComponents(type) : type;\n shaderBuilder.addStructField(structName, shaderType, shaderName);\n }\n }\n}\n\nconst floatConversions = {\n int: \"float\",\n ivec2: \"vec2\",\n ivec3: \"vec3\",\n ivec4: \"vec4\",\n};\n\n/**\n * For a type with integer components, find a corresponding float-component type\n * @param {String} type The name of a GLSL type with integer components\n * @returns {String} The name of a GLSL type of the same dimension with float components, if available; otherwise the input type\n * @private\n */\nfunction convertToFloatComponents(type) {\n const converted = floatConversions[type];\n return defined(converted) ? converted : type;\n}\n\n/**\n * Declare the main Metadata, MetadataClass, and MetadataStatistics structs\n * and the initializeMetadata() function.\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @private\n */\nfunction declareStructsAndFunctions(shaderBuilder) {\n // Declare the Metadata struct.\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_VS,\n MetadataPipelineStage.STRUCT_NAME_METADATA,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n MetadataPipelineStage.STRUCT_NAME_METADATA,\n ShaderDestination.FRAGMENT\n );\n\n // Declare the MetadataClass struct\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,\n MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,\n MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n ShaderDestination.FRAGMENT\n );\n\n // Declare the MetadataStatistics struct\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,\n MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStruct(\n MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,\n MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n ShaderDestination.FRAGMENT\n );\n\n // declare the initializeMetadata() function. The details may differ\n // between vertex and fragment shader\n shaderBuilder.addFunction(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addFunction(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,\n ShaderDestination.FRAGMENT\n );\n\n // declare the setMetadataVaryings() function in the vertex shader only.\n shaderBuilder.addFunction(\n MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS,\n MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,\n ShaderDestination.VERTEX\n );\n}\n\n/**\n * Update the shader for a single PropertyAttributeProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {Object} propertyInfo Info about the PropertyAttributeProperty\n * @private\n */\nfunction processPropertyAttributeProperty(renderResources, propertyInfo) {\n addPropertyAttributePropertyMetadata(renderResources, propertyInfo);\n addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);\n addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);\n}\n\n/**\n * Add fields to the Metadata struct, and metadata value assignments to the\n * initializeMetadata function, for a PropertyAttributeProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {Object} propertyInfo Info about the PropertyAttributeProperty\n * @private\n */\nfunction addPropertyAttributePropertyMetadata(renderResources, propertyInfo) {\n const { shaderBuilder } = renderResources;\n const { metadataVariable, property, glslType } = propertyInfo;\n\n const valueExpression = addValueTransformUniforms({\n valueExpression: `attributes.${propertyInfo.variableName}`,\n renderResources: renderResources,\n glslType: glslType,\n metadataVariable: metadataVariable,\n shaderDestination: ShaderDestination.BOTH,\n property: property,\n });\n\n // declare the struct field\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_VS,\n glslType,\n metadataVariable\n );\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n glslType,\n metadataVariable\n );\n\n // assign the result to the metadata struct property.\n const initializationLine = `metadata.${metadataVariable} = ${valueExpression};`;\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n [initializationLine]\n );\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n [initializationLine]\n );\n}\n\n/**\n * Update the shader for a single PropertyTextureProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {Object[]} propertyInfo Info about the PropertyTextureProperty\n * @private\n */\nfunction processPropertyTextureProperty(renderResources, propertyInfo) {\n addPropertyTexturePropertyMetadata(renderResources, propertyInfo);\n addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);\n addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);\n}\n\n/**\n * Add fields to the Metadata struct, and metadata value expressions to the\n * initializeMetadata function, for a PropertyTextureProperty\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {Object} propertyInfo Info about the PropertyTextureProperty\n * @private\n */\nfunction addPropertyTexturePropertyMetadata(renderResources, propertyInfo) {\n const { shaderBuilder, uniformMap } = renderResources;\n const { metadataVariable, glslType, property } = propertyInfo;\n\n const { texCoord, channels, index, texture } = property.textureReader;\n const textureUniformName = `u_propertyTexture_${index}`;\n\n // Property texture properties may share the same physical texture, so only\n // add the texture uniform the first time we encounter it.\n if (!uniformMap.hasOwnProperty(textureUniformName)) {\n shaderBuilder.addUniform(\n \"sampler2D\",\n textureUniformName,\n ShaderDestination.FRAGMENT\n );\n uniformMap[textureUniformName] = () => texture;\n }\n\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_FS,\n glslType,\n metadataVariable\n );\n\n // Get a GLSL expression for the value of the property\n const texCoordVariable = `attributes.texCoord_${texCoord}`;\n const valueExpression = `texture2D(${textureUniformName}, ${texCoordVariable}).${channels}`;\n\n // Some types need an unpacking step or two. For example, since texture reads\n // are always normalized, UINT8 (not normalized) properties need to be\n // un-normalized in the shader.\n const unpackedValue = property.unpackInShader(valueExpression);\n\n const transformedValue = addValueTransformUniforms({\n valueExpression: unpackedValue,\n renderResources: renderResources,\n glslType: glslType,\n metadataVariable: metadataVariable,\n shaderDestination: ShaderDestination.FRAGMENT,\n property: property,\n });\n\n const initializationLine = `metadata.${metadataVariable} = ${transformedValue};`;\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n [initializationLine]\n );\n}\n\n/**\n * Add fields to the MetadataClass struct, and metadataClass value expressions\n * to the initializeMetadata function, for a PropertyAttributeProperty or\n * PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {Object} propertyInfo Info about the PropertyAttributeProperty or PropertyTextureProperty\n * @private\n */\nfunction addPropertyMetadataClass(shaderBuilder, propertyInfo) {\n const { classProperty } = propertyInfo.property;\n const { metadataVariable, glslType, shaderDestination } = propertyInfo;\n\n // Construct assignment statements to set values in the metadataClass struct\n const assignments = getStructAssignments(\n MetadataPipelineStage.METADATA_CLASS_FIELDS,\n classProperty,\n `metadataClass.${metadataVariable}`,\n glslType\n );\n\n // Struct field: Prefix to get the appropriate <type>MetadataClass struct\n const metadataType = `${glslType}MetadataClass`;\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,\n metadataType,\n metadataVariable\n );\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n assignments\n );\n if (!ShaderDestination.includesVertexShader(shaderDestination)) {\n return;\n }\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,\n metadataType,\n metadataVariable\n );\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n assignments\n );\n}\n\n/**\n * Add fields to the MetadataStatistics struct, and metadataStatistics value\n * expressions to the initializeMetadata function, for a\n * PropertyAttributeProperty or PropertyTextureProperty\n * @param {ShaderBuilder} shaderBuilder The shader builder for the primitive\n * @param {Object} propertyInfo Info about the PropertyAttributeProperty or PropertyTextureProperty\n * @private\n */\nfunction addPropertyMetadataStatistics(shaderBuilder, propertyInfo) {\n const { propertyStatistics } = propertyInfo;\n if (!defined(propertyStatistics)) {\n return;\n }\n const { metadataVariable, type, glslType } = propertyInfo;\n if (type === MetadataType.ENUM) {\n // enums have an \"occurrences\" statistic which is not implemented yet\n return;\n }\n\n // Construct assignment statements to set values in the metadataStatistics struct\n const fields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;\n const struct = `metadataStatistics.${metadataVariable}`;\n const assignments = getStructAssignments(\n fields,\n propertyStatistics,\n struct,\n glslType\n );\n\n // Struct field: Prefix to get the appropriate <type>MetadataStatistics struct\n const statisticsType = `${glslType}MetadataStatistics`;\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,\n statisticsType,\n metadataVariable\n );\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,\n assignments\n );\n if (!ShaderDestination.includesVertexShader(propertyInfo.shaderDestination)) {\n return;\n }\n shaderBuilder.addStructField(\n MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,\n statisticsType,\n metadataVariable\n );\n shaderBuilder.addFunctionLines(\n MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,\n assignments\n );\n}\n\n/**\n * Construct GLSL assignment statements to set metadata spec values in a struct\n * @param {Object[]} fieldNames An object with the following properties:\n * @param {String} fieldNames[].specName The name of the property in the spec\n * @param {String} fieldNames[].shaderName The name of the property in the shader\n * @param {Object} values A source of property values, keyed on fieldNames[].specName\n * @param {String} struct The name of the struct to which values will be assigned\n * @param {String} type The type of the values to be assigned\n * @returns {Array.<{name: String, value}>} Objects containing the property name (in the shader) and a GLSL assignment statement for the property value\n * @private\n */\nfunction getStructAssignments(fieldNames, values, struct, type) {\n return defined(values)\n ? fieldNames.map(constructAssignment).filter(defined)\n : [];\n\n function constructAssignment(field) {\n const value = values[field.specName];\n if (defined(value)) {\n return `${struct}.${field.shaderName} = ${type}(${value});`;\n }\n }\n}\n\n/**\n * Handle offset/scale transform for a property value\n * This wraps the GLSL value expression with a czm_valueTransform() call\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.valueExpression The GLSL value expression without the transform\n * @param {String} options.metadataVariable The name of the GLSL variable that will contain the property value\n * @param {String} options.glslType The GLSL type of the variable\n * @param {ShaderDestination} options.shaderDestination Which shader(s) use this variable\n * @param {PrimitiveRenderResources} options.renderResources The render resources for this primitive\n * @param {(PropertyAttributeProperty|PropertyTextureProperty)} options.property The property from which the value is derived\n * @returns {String} A wrapped GLSL value expression\n * @private\n */\nfunction addValueTransformUniforms(options) {\n const { valueExpression, property } = options;\n\n if (!property.hasValueTransform) {\n return valueExpression;\n }\n\n const metadataVariable = options.metadataVariable;\n const offsetUniformName = `u_${metadataVariable}_offset`;\n const scaleUniformName = `u_${metadataVariable}_scale`;\n\n const { shaderBuilder, uniformMap } = options.renderResources;\n const { glslType, shaderDestination } = options;\n shaderBuilder.addUniform(glslType, offsetUniformName, shaderDestination);\n shaderBuilder.addUniform(glslType, scaleUniformName, shaderDestination);\n\n const { offset, scale } = property;\n uniformMap[offsetUniformName] = () => offset;\n uniformMap[scaleUniformName] = () => scale;\n\n return `czm_valueTransform(${offsetUniformName}, ${scaleUniformName}, ${valueExpression})`;\n}\n\nexport default MetadataPipelineStage;\n", "/**\n * An enum for controling how {@link CustomShader} handles translucency compared with the original\n * primitive.\n *\n * @enum {Number}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst CustomShaderTranslucencyMode = {\n /**\n * Inherit translucency settings from the primitive's material. If the primitive used a\n * translucent material, the custom shader will also be considered translucent. If the primitive\n * used an opaque material, the custom shader will be considered opaque.\n *\n * @type {Number}\n * @constant\n */\n INHERIT: 0,\n /**\n * Force the primitive to render the primitive as opaque, ignoring any material settings.\n *\n * @type {Number}\n * @constant\n */\n OPAQUE: 1,\n /**\n * Force the primitive to render the primitive as translucent, ignoring any material settings.\n *\n * @type {Number}\n * @constant\n */\n TRANSLUCENT: 2,\n};\n\nexport default Object.freeze(CustomShaderTranslucencyMode);\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport oneTimeWarning from \"../../Core/oneTimeWarning.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport CustomShaderStageVS from \"../../Shaders/Model/CustomShaderStageVS.js\";\nimport CustomShaderStageFS from \"../../Shaders/Model/CustomShaderStageFS.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport FeatureIdPipelineStage from \"./FeatureIdPipelineStage.js\";\nimport MetadataPipelineStage from \"./MetadataPipelineStage.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport CustomShaderTranslucencyMode from \"./CustomShaderTranslucencyMode.js\";\n\n/**\n * The custom shader pipeline stage takes GLSL callbacks from the\n * {@link CustomShader} and inserts them into the overall shader code for the\n * {@link Model}. The input to the callback is a struct with many\n * properties that depend on the attributes of the primitive. This shader code\n * is automatically generated by this stage.\n *\n * @namespace CustomShaderPipelineStage\n *\n * @private\n */\nconst CustomShaderPipelineStage = {\n name: \"CustomShaderPipelineStage\", // Helps with debugging\n\n STRUCT_ID_ATTRIBUTES_VS: \"AttributesVS\",\n STRUCT_ID_ATTRIBUTES_FS: \"AttributesFS\",\n STRUCT_NAME_ATTRIBUTES: \"Attributes\",\n STRUCT_ID_VERTEX_INPUT: \"VertexInput\",\n STRUCT_NAME_VERTEX_INPUT: \"VertexInput\",\n STRUCT_ID_FRAGMENT_INPUT: \"FragmentInput\",\n STRUCT_NAME_FRAGMENT_INPUT: \"FragmentInput\",\n FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS: \"initializeInputStructVS\",\n FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:\n \"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)\",\n FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS: \"initializeInputStructFS\",\n FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:\n \"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)\",\n\n // Expose method for testing.\n _oneTimeWarning: oneTimeWarning,\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n * <li>Modifies the shader to include the custom shader code to the vertex and fragment shaders</li>\n * <li>Modifies the shader to include automatically-generated structs that serve as input to the custom shader callbacks </li>\n * <li>Modifies the shader to include any additional user-defined uniforms</li>\n * <li>Modifies the shader to include any additional user-defined varyings</li>\n * <li>Adds any user-defined uniforms to the uniform map</li>\n * <li>If the user specified a lighting model, the settings are overridden in the render resources</li>\n * </ul>\n * <p>\n * This pipeline stage is designed to fail gracefully where possible. If the\n * primitive does not have the right attributes to satisfy the shader code,\n * defaults will be inferred (when reasonable to do so). If not, the custom\n * shader will be disabled.\n * <p>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state.\n * @private\n */\nCustomShaderPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const customShader = renderResources.model.customShader;\n\n // Check the lighting model and translucent options first, as sometimes\n // these are used even if there is no vertex or fragment shader text.\n\n // if present, the lighting model overrides the material's lighting model.\n if (defined(customShader.lightingModel)) {\n renderResources.lightingOptions.lightingModel = customShader.lightingModel;\n }\n\n const alphaOptions = renderResources.alphaOptions;\n if (\n customShader.translucencyMode === CustomShaderTranslucencyMode.TRANSLUCENT\n ) {\n alphaOptions.pass = Pass.TRANSLUCENT;\n } else if (\n customShader.translucencyMode === CustomShaderTranslucencyMode.OPAQUE\n ) {\n // Use the default opqaue pass (either OPAQUE or 3D_TILES), regardless of whether\n // the material pipeline stage used translucent. The default is configured\n // in AlphaPipelineStage\n alphaOptions.pass = undefined;\n }\n // For CustomShaderTranslucencyMode.INHERIT, do not modify alphaOptions.pass\n\n // Generate lines of code for the shader, but don't add them to the shader\n // yet.\n const generatedCode = generateShaderLines(customShader, primitive);\n\n // In some corner cases, the primitive may not be compatible with the\n // shader. In this case, skip the custom shader.\n if (!generatedCode.customShaderEnabled) {\n return;\n }\n addLinesToShader(shaderBuilder, customShader, generatedCode);\n\n // the input to the fragment shader may include a low-precision ECEF position\n if (generatedCode.shouldComputePositionWC) {\n shaderBuilder.addDefine(\n \"COMPUTE_POSITION_WC_CUSTOM_SHADER\",\n undefined,\n ShaderDestination.BOTH\n );\n }\n\n if (defined(customShader.vertexShaderText)) {\n shaderBuilder.addDefine(\n \"HAS_CUSTOM_VERTEX_SHADER\",\n undefined,\n ShaderDestination.VERTEX\n );\n }\n\n if (defined(customShader.fragmentShaderText)) {\n shaderBuilder.addDefine(\n \"HAS_CUSTOM_FRAGMENT_SHADER\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n // add defines like CUSTOM_SHADER_MODIFY_MATERIAL\n const shaderModeDefine = CustomShaderMode.getDefineName(customShader.mode);\n shaderBuilder.addDefine(\n shaderModeDefine,\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const uniforms = customShader.uniforms;\n for (const uniformName in uniforms) {\n if (uniforms.hasOwnProperty(uniformName)) {\n const uniform = uniforms[uniformName];\n shaderBuilder.addUniform(uniform.type, uniformName);\n }\n }\n\n const varyings = customShader.varyings;\n for (const varyingName in varyings) {\n if (varyings.hasOwnProperty(varyingName)) {\n const varyingType = varyings[varyingName];\n shaderBuilder.addVarying(varyingType, varyingName);\n }\n }\n\n renderResources.uniformMap = combine(\n renderResources.uniformMap,\n customShader.uniformMap\n );\n};\n\nfunction getAttributesByName(attributes) {\n const names = {};\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n const attributeInfo = ModelUtility.getAttributeInfo(attribute);\n\n names[attributeInfo.variableName] = attributeInfo;\n }\n return names;\n}\n\n// GLSL types of standard attribute types when uniquely defined\nconst attributeTypeLUT = {\n position: \"vec3\",\n normal: \"vec3\",\n tangent: \"vec3\",\n bitangent: \"vec3\",\n texCoord: \"vec2\",\n color: \"vec4\",\n joints: \"ivec4\",\n weights: \"vec4\",\n};\n\n// Corresponding attribute values\nconst attributeDefaultValueLUT = {\n position: \"vec3(0.0)\",\n normal: \"vec3(0.0, 0.0, 1.0)\",\n tangent: \"vec3(1.0, 0.0, 0.0)\",\n bitangent: \"vec3(0.0, 1.0, 0.0)\",\n texCoord: \"vec2(0.0)\",\n color: \"vec4(1.0)\",\n joints: \"ivec4(0)\",\n weights: \"vec4(0.0)\",\n};\n\nfunction inferAttributeDefaults(attributeName) {\n // remove trailing set indices. E.g. \"texCoord_0\" -> \"texCoord\"\n let trimmed = attributeName.replace(/_[0-9]+$/, \"\");\n // also remove the MC/EC since they will have the same default value\n trimmed = trimmed.replace(/(MC|EC)$/, \"\");\n\n const glslType = attributeTypeLUT[trimmed];\n const value = attributeDefaultValueLUT[trimmed];\n\n // - _CUSTOM_ATTRIBUTE has an unknown type.\n if (!defined(glslType)) {\n return undefined;\n }\n\n return {\n attributeField: [glslType, attributeName],\n value: value,\n };\n}\n\nfunction generateVertexShaderLines(\n customShader,\n attributesByName,\n vertexLines\n) {\n const categories = partitionAttributes(\n attributesByName,\n customShader.usedVariablesVertex.attributeSet,\n false\n );\n const addToShader = categories.addToShader;\n const needsDefault = categories.missingAttributes;\n\n let variableName;\n let vertexInitialization;\n const attributeFields = [];\n const initializationLines = [];\n for (variableName in addToShader) {\n if (addToShader.hasOwnProperty(variableName)) {\n const attributeInfo = addToShader[variableName];\n const attributeField = [attributeInfo.glslType, variableName];\n attributeFields.push(attributeField);\n\n // Initializing attribute structs are just a matter of copying the\n // attribute or varying: E.g.:\n // \" vsInput.attributes.position = a_position;\"\n vertexInitialization = `vsInput.attributes.${variableName} = attributes.${variableName};`;\n initializationLines.push(vertexInitialization);\n }\n }\n\n for (let i = 0; i < needsDefault.length; i++) {\n variableName = needsDefault[i];\n const attributeDefaults = inferAttributeDefaults(variableName);\n if (!defined(attributeDefaults)) {\n CustomShaderPipelineStage._oneTimeWarning(\n \"CustomShaderPipelineStage.incompatiblePrimitiveVS\",\n `Primitive is missing attribute ${variableName}, disabling custom vertex shader`\n );\n // This primitive isn't compatible with the shader. Return early\n // to skip the vertex shader\n return;\n }\n\n attributeFields.push(attributeDefaults.attributeField);\n vertexInitialization = `vsInput.attributes.${variableName} = ${attributeDefaults.value};`;\n initializationLines.push(vertexInitialization);\n }\n\n vertexLines.enabled = true;\n vertexLines.attributeFields = attributeFields;\n vertexLines.initializationLines = initializationLines;\n}\n\nfunction generatePositionBuiltins(customShader) {\n const attributeFields = [];\n const initializationLines = [];\n const usedVariables = customShader.usedVariablesFragment.attributeSet;\n\n // Model space position is the same position as in the glTF accessor,\n // this is already added to the shader with other attributes.\n\n // World coordinates in ECEF coordinates. Note that this is\n // low precision (32-bit floats) on the GPU.\n if (usedVariables.hasOwnProperty(\"positionWC\")) {\n attributeFields.push([\"vec3\", \"positionWC\"]);\n initializationLines.push(\n \"fsInput.attributes.positionWC = attributes.positionWC;\"\n );\n }\n\n // position in eye coordinates\n if (usedVariables.hasOwnProperty(\"positionEC\")) {\n attributeFields.push([\"vec3\", \"positionEC\"]);\n initializationLines.push(\n \"fsInput.attributes.positionEC = attributes.positionEC;\"\n );\n }\n\n return {\n attributeFields: attributeFields,\n initializationLines: initializationLines,\n };\n}\n\nfunction generateFragmentShaderLines(\n customShader,\n attributesByName,\n fragmentLines\n) {\n const categories = partitionAttributes(\n attributesByName,\n customShader.usedVariablesFragment.attributeSet,\n true\n );\n const addToShader = categories.addToShader;\n const needsDefault = categories.missingAttributes;\n\n let variableName;\n let fragmentInitialization;\n const attributeFields = [];\n const initializationLines = [];\n for (variableName in addToShader) {\n if (addToShader.hasOwnProperty(variableName)) {\n const attributeInfo = addToShader[variableName];\n\n const attributeField = [attributeInfo.glslType, variableName];\n attributeFields.push(attributeField);\n\n // Initializing attribute structs are just a matter of copying the\n // value from the processed attributes\n // \" fsInput.attributes.positionMC = attributes.positionMC;\"\n fragmentInitialization = `fsInput.attributes.${variableName} = attributes.${variableName};`;\n initializationLines.push(fragmentInitialization);\n }\n }\n\n for (let i = 0; i < needsDefault.length; i++) {\n variableName = needsDefault[i];\n const attributeDefaults = inferAttributeDefaults(variableName);\n if (!defined(attributeDefaults)) {\n CustomShaderPipelineStage._oneTimeWarning(\n \"CustomShaderPipelineStage.incompatiblePrimitiveFS\",\n `Primitive is missing attribute ${variableName}, disabling custom fragment shader.`\n );\n\n // This primitive isn't compatible with the shader. Return early\n // so the fragment shader is skipped\n return;\n }\n\n attributeFields.push(attributeDefaults.attributeField);\n fragmentInitialization = `fsInput.attributes.${variableName} = ${attributeDefaults.value};`;\n initializationLines.push(fragmentInitialization);\n }\n\n // Built-ins for positions in various coordinate systems.\n const positionBuiltins = generatePositionBuiltins(customShader);\n\n fragmentLines.enabled = true;\n fragmentLines.attributeFields = attributeFields.concat(\n positionBuiltins.attributeFields\n );\n fragmentLines.initializationLines = positionBuiltins.initializationLines.concat(\n initializationLines\n );\n}\n\n// These attributes are derived from positionMC, and are handled separately\n// from other attributes\nconst builtinAttributes = {\n positionWC: true,\n positionEC: true,\n};\n\nfunction partitionAttributes(\n primitiveAttributes,\n shaderAttributeSet,\n isFragmentShader\n) {\n // shaderAttributes = set of all attributes used in the shader\n // primitiveAttributes = set of all the primitive's attributes\n // partition into three categories:\n // - addToShader = shaderAttributes intersect primitiveAttributes\n // - missingAttributes = shaderAttributes - primitiveAttributes - builtinAttributes\n // - unneededAttributes = (primitiveAttributes - shaderAttributes) U builtinAttributes\n //\n // addToShader are attributes that should be added to the shader.\n // missingAttributes are attributes for which we need to provide a default value\n // unneededAttributes are other attributes that can be skipped.\n\n let renamed;\n let attributeName;\n const addToShader = {};\n for (attributeName in primitiveAttributes) {\n if (primitiveAttributes.hasOwnProperty(attributeName)) {\n const attribute = primitiveAttributes[attributeName];\n\n // normals and tangents are in model coordinates in the attributes but\n // in eye coordinates in the fragment shader.\n renamed = attributeName;\n if (isFragmentShader && attributeName === \"normalMC\") {\n renamed = \"normalEC\";\n } else if (isFragmentShader && attributeName === \"tangentMC\") {\n renamed = \"tangentEC\";\n }\n\n if (shaderAttributeSet.hasOwnProperty(renamed)) {\n addToShader[renamed] = attribute;\n }\n }\n }\n\n const missingAttributes = [];\n for (attributeName in shaderAttributeSet) {\n if (shaderAttributeSet.hasOwnProperty(attributeName)) {\n if (builtinAttributes.hasOwnProperty(attributeName)) {\n // Builtins are handled separately from attributes, so skip them here\n continue;\n }\n\n // normals and tangents are in model coordinates in the attributes but\n // in eye coordinates in the fragment shader.\n renamed = attributeName;\n if (isFragmentShader && attributeName === \"normalEC\") {\n renamed = \"normalMC\";\n } else if (isFragmentShader && attributeName === \"tangentEC\") {\n renamed = \"tangentMC\";\n }\n\n if (!primitiveAttributes.hasOwnProperty(renamed)) {\n missingAttributes.push(attributeName);\n }\n }\n }\n\n return {\n addToShader: addToShader,\n missingAttributes: missingAttributes,\n };\n}\n\nfunction generateShaderLines(customShader, primitive) {\n // Assume shader code is disabled unless proven otherwise\n const vertexLines = {\n enabled: false,\n };\n const fragmentLines = {\n enabled: false,\n };\n\n // Attempt to generate vertex and fragment shader lines before adding any\n // code to the shader.\n const attributesByName = getAttributesByName(primitive.attributes);\n if (defined(customShader.vertexShaderText)) {\n generateVertexShaderLines(customShader, attributesByName, vertexLines);\n }\n\n if (defined(customShader.fragmentShaderText)) {\n generateFragmentShaderLines(customShader, attributesByName, fragmentLines);\n }\n\n // positionWC must be computed in the vertex shader\n // for use in the fragmentShader. However, this can be skipped if:\n // - positionWC isn't used in the fragment shader\n // - or the fragment shader is disabled\n const attributeSetFS = customShader.usedVariablesFragment.attributeSet;\n const shouldComputePositionWC =\n attributeSetFS.hasOwnProperty(\"positionWC\") && fragmentLines.enabled;\n\n // Return any generated shader code along with some flags to indicate which\n // defines should be added.\n return {\n vertexLines: vertexLines,\n fragmentLines: fragmentLines,\n vertexLinesEnabled: vertexLines.enabled,\n fragmentLinesEnabled: fragmentLines.enabled,\n customShaderEnabled: vertexLines.enabled || fragmentLines.enabled,\n shouldComputePositionWC: shouldComputePositionWC,\n };\n}\n\nfunction addVertexLinesToShader(shaderBuilder, vertexLines) {\n // Vertex Lines ---------------------------------------------------------\n\n let i;\n let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS;\n shaderBuilder.addStruct(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n ShaderDestination.VERTEX\n );\n\n const attributeFields = vertexLines.attributeFields;\n for (i = 0; i < attributeFields.length; i++) {\n const field = attributeFields[i];\n const glslType = field[0];\n const variableName = field[1];\n shaderBuilder.addStructField(structId, glslType, variableName);\n }\n\n // This could be hard-coded, but the symmetry with other structs makes unit\n // tests more convenient\n structId = CustomShaderPipelineStage.STRUCT_ID_VERTEX_INPUT;\n shaderBuilder.addStruct(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_VERTEX_INPUT,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStructField(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n \"attributes\"\n );\n // Add FeatureIds struct from the Feature ID stage\n shaderBuilder.addStructField(\n structId,\n FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n \"featureIds\"\n );\n // Add Metadata struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA,\n \"metadata\"\n );\n // Add MetadataClass struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n \"metadataClass\"\n );\n // Add MetadataStatistics struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n \"metadataStatistics\"\n );\n\n const functionId =\n CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;\n shaderBuilder.addFunction(\n functionId,\n CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,\n ShaderDestination.VERTEX\n );\n\n const initializationLines = vertexLines.initializationLines;\n shaderBuilder.addFunctionLines(functionId, initializationLines);\n}\n\nfunction addFragmentLinesToShader(shaderBuilder, fragmentLines) {\n let i;\n let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS;\n shaderBuilder.addStruct(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n ShaderDestination.FRAGMENT\n );\n\n let field;\n let glslType;\n let variableName;\n const attributeFields = fragmentLines.attributeFields;\n for (i = 0; i < attributeFields.length; i++) {\n field = attributeFields[i];\n glslType = field[0];\n variableName = field[1];\n shaderBuilder.addStructField(structId, glslType, variableName);\n }\n\n structId = CustomShaderPipelineStage.STRUCT_ID_FRAGMENT_INPUT;\n shaderBuilder.addStruct(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_FRAGMENT_INPUT,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addStructField(\n structId,\n CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,\n \"attributes\"\n );\n // Add FeatureIds struct from the Feature ID stage\n shaderBuilder.addStructField(\n structId,\n FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,\n \"featureIds\"\n );\n // Add Metadata struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA,\n \"metadata\"\n );\n // Add MetadataClass struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,\n \"metadataClass\"\n );\n // Add MetadataStatistics struct from the metadata stage\n shaderBuilder.addStructField(\n structId,\n MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,\n \"metadataStatistics\"\n );\n\n const functionId =\n CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;\n shaderBuilder.addFunction(\n functionId,\n CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,\n ShaderDestination.FRAGMENT\n );\n\n const initializationLines = fragmentLines.initializationLines;\n shaderBuilder.addFunctionLines(functionId, initializationLines);\n}\n\nconst scratchShaderLines = [];\n\nfunction addLinesToShader(shaderBuilder, customShader, generatedCode) {\n const vertexLines = generatedCode.vertexLines;\n const shaderLines = scratchShaderLines;\n\n if (vertexLines.enabled) {\n addVertexLinesToShader(shaderBuilder, vertexLines);\n\n shaderLines.length = 0;\n shaderLines.push(\n \"#line 0\",\n customShader.vertexShaderText,\n CustomShaderStageVS\n );\n\n shaderBuilder.addVertexLines(shaderLines);\n }\n\n const fragmentLines = generatedCode.fragmentLines;\n if (fragmentLines.enabled) {\n addFragmentLinesToShader(shaderBuilder, fragmentLines);\n\n shaderLines.length = 0;\n shaderLines.push(\n \"#line 0\",\n customShader.fragmentShaderText,\n CustomShaderStageFS\n );\n\n shaderBuilder.addFragmentLines(shaderLines);\n }\n}\n\nexport default CustomShaderPipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The dequantization stage generates shader code to dequantize attributes\n * in the vertex shader\n *\n * @namespace DequantizationPipelineStage\n *\n * @private\n */\nconst DequantizationPipelineStage = {\n name: \"DequantizationPipelineStage\", // Helps with debugging\n\n FUNCTION_ID_DEQUANTIZATION_STAGE_VS: \"dequantizationStage\",\n FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:\n \"void dequantizationStage(inout ProcessedAttributes attributes)\",\n};\n\n/**\n * Process a primitive with quantized attributes. This stage modifies the\n * following parts of the render resources:\n * <ul>\n * <li>generates dequantization function and adds it to the shader</li>\n * <li>adds any uniforms needed for dequantization to the shader and uniform map</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nDequantizationPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const model = renderResources.model;\n const hasClassification = defined(model.classificationType);\n\n shaderBuilder.addDefine(\n \"USE_DEQUANTIZATION\",\n undefined,\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addFunction(\n DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,\n DequantizationPipelineStage.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,\n ShaderDestination.VERTEX\n );\n\n const attributes = primitive.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n const quantization = attribute.quantization;\n if (!defined(quantization)) {\n // Non-quantized attributes were already handled in GeometryPipelineStage\n continue;\n }\n\n // Only the position and texcoord attributes are used for classification models.\n const isPositionAttribute =\n attribute.semantic === VertexAttributeSemantic.POSITION;\n const isTexcoordAttribute =\n attribute.semantic === VertexAttributeSemantic.TEXCOORD;\n if (hasClassification && !isPositionAttribute && !isTexcoordAttribute) {\n continue;\n }\n\n const attributeInfo = ModelUtility.getAttributeInfo(attribute);\n updateDequantizationFunction(shaderBuilder, attributeInfo);\n addDequantizationUniforms(renderResources, attributeInfo);\n }\n};\n\nfunction addDequantizationUniforms(renderResources, attributeInfo) {\n const shaderBuilder = renderResources.shaderBuilder;\n const uniformMap = renderResources.uniformMap;\n const variableName = attributeInfo.variableName;\n const quantization = attributeInfo.attribute.quantization;\n\n if (quantization.octEncoded) {\n const normalizationRange = `model_normalizationRange_${variableName}`;\n shaderBuilder.addUniform(\n \"float\",\n normalizationRange,\n ShaderDestination.VERTEX\n );\n uniformMap[normalizationRange] = function () {\n return quantization.normalizationRange;\n };\n } else {\n const offset = `model_quantizedVolumeOffset_${variableName}`;\n const stepSize = `model_quantizedVolumeStepSize_${variableName}`;\n const glslType = attributeInfo.glslType;\n shaderBuilder.addUniform(glslType, offset, ShaderDestination.VERTEX);\n shaderBuilder.addUniform(glslType, stepSize, ShaderDestination.VERTEX);\n\n let quantizedVolumeOffset = quantization.quantizedVolumeOffset;\n let quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;\n\n // COLOR_n is promoted to a vec4 in the shader, so the alpha value\n // defaults to 1. For correctness, the quantization uniforms must be\n // promoted to vec4s. The alpha values are chosen so the alpha\n // dequantization is the identity, i.e. 0.0 + 1.0 * color.a\n if (/^color_\\d+$/.test(variableName)) {\n quantizedVolumeOffset = promoteToVec4(quantizedVolumeOffset, 0);\n quantizedVolumeStepSize = promoteToVec4(quantizedVolumeStepSize, 1);\n }\n\n uniformMap[offset] = function () {\n return quantizedVolumeOffset;\n };\n\n uniformMap[stepSize] = function () {\n return quantizedVolumeStepSize;\n };\n }\n}\n\nfunction promoteToVec4(value, defaultAlpha) {\n if (value instanceof Cartesian4) {\n return value;\n }\n\n return new Cartesian4(value.x, value.y, value.z, defaultAlpha);\n}\n\nfunction updateDequantizationFunction(shaderBuilder, attributeInfo) {\n const variableName = attributeInfo.variableName;\n const quantization = attributeInfo.attribute.quantization;\n\n let line;\n if (quantization.octEncoded) {\n line = generateOctDecodeLine(variableName, quantization);\n } else {\n line = generateDequantizeLine(variableName);\n }\n\n shaderBuilder.addFunctionLines(\n DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,\n [line]\n );\n}\n\nfunction generateOctDecodeLine(variableName, quantization) {\n const structField = `attributes.${variableName}`;\n\n const quantizedAttribute = `a_quantized_${variableName}`;\n const normalizationRange = `model_normalizationRange_${variableName}`;\n\n // Draco stores things as .zxy instead of xyz, so be explicit about the\n // swizzle to avoid confusion\n const swizzle = quantization.octEncodedZXY ? \".zxy\" : \".xyz\";\n\n // This generates lines such as:\n // attributes.normal = czm_octDecode(a_quantized_normal, model_normalizationRange_normal).zxy;\n return `${structField} = czm_octDecode(${quantizedAttribute}, ${normalizationRange})${swizzle};`;\n}\n\nfunction generateDequantizeLine(variableName) {\n const structField = `attributes.${variableName}`;\n const quantizedAttribute = `a_quantized_${variableName}`;\n const offset = `model_quantizedVolumeOffset_${variableName}`;\n const stepSize = `model_quantizedVolumeStepSize_${variableName}`;\n\n // This generates lines such as:\n // attributes.texCoord_0 = model_quantizedVolumeOffset_texCoord_0 + a_quantized_texCoord_0 * model_quantizedVolumeStepSize;\n return `${structField} = ${offset} + ${quantizedAttribute} * ${stepSize};`;\n}\n\nexport default DequantizationPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void geometryStage(out ProcessedAttributes attributes)\\n\\\n{\\n\\\nattributes.positionMC = v_positionMC;\\n\\\nattributes.positionEC = v_positionEC;\\n\\\n#ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER\\n\\\nattributes.positionWC = v_positionWC;\\n\\\n#endif\\n\\\n#ifdef HAS_NORMALS\\n\\\nattributes.normalEC = normalize(v_normalEC);\\n\\\n#endif\\n\\\n#ifdef HAS_TANGENTS\\n\\\nattributes.tangentEC = normalize(v_tangentEC);\\n\\\n#endif\\n\\\n#ifdef HAS_BITANGENTS\\n\\\nattributes.bitangentEC = normalize(v_bitangentEC);\\n\\\n#endif\\n\\\nsetDynamicVaryings(attributes);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)\\n\\\n{\\n\\\nvec4 computedPosition;\\n\\\nvec3 positionMC = attributes.positionMC;\\n\\\nv_positionMC = positionMC;\\n\\\nv_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;\\n\\\n#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\\n\\\nvec3 position2D = attributes.position2D;\\n\\\nvec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;\\n\\\ncomputedPosition = czm_projection * vec4(positionEC, 1.0);\\n\\\n#else\\n\\\ncomputedPosition = czm_projection * vec4(v_positionEC, 1.0);\\n\\\n#endif\\n\\\n#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)\\n\\\nv_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\\n\\\n#endif\\n\\\n#ifdef HAS_NORMALS\\n\\\nv_normalEC = normalize(normal * attributes.normalMC);\\n\\\n#endif\\n\\\n#ifdef HAS_TANGENTS\\n\\\nv_tangentEC = normalize(normal * attributes.tangentMC);\\n\\\n#endif\\n\\\n#ifdef HAS_BITANGENTS\\n\\\nv_bitangentEC = normalize(normal * attributes.bitangentMC);\\n\\\n#endif\\n\\\nsetDynamicVaryings(attributes);\\n\\\nreturn computedPosition;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"vec2 computeSt(float featureId)\\n\\\n{\\n\\\nfloat stepX = model_textureStep.x;\\n\\\nfloat centerX = model_textureStep.y;\\n\\\n#ifdef MULTILINE_BATCH_TEXTURE\\n\\\nfloat stepY = model_textureStep.z;\\n\\\nfloat centerY = model_textureStep.w;\\n\\\nfloat xId = mod(featureId, model_textureDimensions.x);\\n\\\nfloat yId = floor(featureId / model_textureDimensions.x);\\n\\\nreturn vec2(centerX + (xId * stepX), centerY + (yId * stepY));\\n\\\n#else\\n\\\nreturn vec2(centerX + (featureId * stepX), 0.5);\\n\\\n#endif\\n\\\n}\\n\\\nvoid selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\\n\\\n{\\n\\\nint featureId = featureIds.SELECTED_FEATURE_ID;\\n\\\nif (featureId < model_featuresLength)\\n\\\n{\\n\\\nvec2 featureSt = computeSt(float(featureId));\\n\\\nfeature.id = featureId;\\n\\\nfeature.st = featureSt;\\n\\\nfeature.color = texture2D(model_batchTexture, featureSt);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfeature.id = model_featuresLength + 1;\\n\\\nfeature.st = vec2(0.0);\\n\\\nfeature.color = vec4(1.0);\\n\\\n}\\n\\\n#ifdef HAS_NULL_FEATURE_ID\\n\\\nif (featureId == model_nullFeatureId) {\\n\\\nfeature.id = featureId;\\n\\\nfeature.st = vec2(0.0);\\n\\\nfeature.color = vec4(1.0);\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport SelectedFeatureIdStageCommon from \"../../Shaders/Model/SelectedFeatureIdStageCommon.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The selected feature ID pipeline stage is responsible for handling the\n * set of feature IDs selected for styling/picking.\n *\n * @namespace SelectedFeatureIdPipelineStage\n * @private\n */\nconst SelectedFeatureIdPipelineStage = {\n name: \"SelectedFeatureIdPipelineStage\", // Helps with debugging\n\n STRUCT_ID_SELECTED_FEATURE: \"SelectedFeature\",\n STRUCT_NAME_SELECTED_FEATURE: \"SelectedFeature\",\n FUNCTION_ID_FEATURE_VARYINGS_VS: \"updateFeatureStructVS\",\n FUNCTION_ID_FEATURE_VARYINGS_FS: \"updateFeatureStructFS\",\n FUNCTION_SIGNATURE_UPDATE_FEATURE:\n \"void updateFeatureStruct(inout SelectedFeature feature)\",\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n * <li>sets the defines for the feature ID attribute to use for styling/picking</li>\n * <li>adds fields to the SelectedFeature struct in the shader</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nSelectedFeatureIdPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n renderResources.hasPropertyTable = true;\n\n const model = renderResources.model;\n const node = renderResources.runtimeNode.node;\n const selectedFeatureIds = getSelectedFeatureIds(model, node, primitive);\n const shaderDestination = selectedFeatureIds.shaderDestination;\n\n shaderBuilder.addDefine(\n \"HAS_SELECTED_FEATURE_ID\",\n undefined,\n shaderDestination\n );\n\n // Add a define to insert the variable to use.\n // Example: #define SELECTED_FEATURE_ID featureId_1\n // This corresponds to featureIds.featureId_1\n shaderBuilder.addDefine(\n \"SELECTED_FEATURE_ID\",\n selectedFeatureIds.variableName,\n shaderDestination\n );\n\n // Add a define to the shader to distinguish feature ID attributes from\n // textures. This is needed for determining where to filter features\n // by pass type.\n shaderBuilder.addDefine(\n selectedFeatureIds.featureIdDefine,\n undefined,\n shaderDestination\n );\n\n updateFeatureStruct(shaderBuilder);\n\n const nullFeatureId = selectedFeatureIds.featureIds.nullFeatureId;\n const uniformMap = renderResources.uniformMap;\n if (defined(nullFeatureId)) {\n shaderBuilder.addDefine(\n \"HAS_NULL_FEATURE_ID\",\n undefined,\n shaderDestination\n );\n shaderBuilder.addUniform(\"int\", \"model_nullFeatureId\", shaderDestination);\n uniformMap.model_nullFeatureId = function () {\n return nullFeatureId;\n };\n }\n\n if (selectedFeatureIds.shaderDestination === ShaderDestination.BOTH) {\n shaderBuilder.addVertexLines(SelectedFeatureIdStageCommon);\n }\n shaderBuilder.addFragmentLines(SelectedFeatureIdStageCommon);\n};\n\nfunction getFeatureIdDefine(featureIds) {\n if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n return \"HAS_SELECTED_FEATURE_ID_TEXTURE\";\n }\n\n return \"HAS_SELECTED_FEATURE_ID_ATTRIBUTE\";\n}\n\nfunction getShaderDestination(featureIds) {\n // Feature ID textures are only supported in the fragment shader.\n if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n return ShaderDestination.FRAGMENT;\n }\n\n return ShaderDestination.BOTH;\n}\n\nfunction getSelectedFeatureIds(model, node, primitive) {\n let variableName;\n let featureIds;\n // Check instances first, as this is the most specific type of\n // feature ID\n if (defined(node.instances)) {\n featureIds = ModelUtility.getFeatureIdsByLabel(\n node.instances.featureIds,\n model.instanceFeatureIdLabel\n );\n\n if (defined(featureIds)) {\n // Either label could be used here, but prefer label as it may be more\n // meaningful when debugging\n variableName = defaultValue(featureIds.label, featureIds.positionalLabel);\n return {\n featureIds: featureIds,\n variableName: variableName,\n shaderDestination: getShaderDestination(featureIds),\n featureIdDefine: getFeatureIdDefine(featureIds),\n };\n }\n }\n\n featureIds = ModelUtility.getFeatureIdsByLabel(\n primitive.featureIds,\n model.featureIdLabel\n );\n // again, prefer label for being more descriptive\n variableName = defaultValue(featureIds.label, featureIds.positionalLabel);\n return {\n featureIds: featureIds,\n variableName: variableName,\n shaderDestination: getShaderDestination(featureIds),\n featureIdDefine: getFeatureIdDefine(featureIds),\n };\n}\n\n/**\n * Populate the \"SelectedFeature\" struct in the shaders that holds information about the \"active\" (used for picking/styling) feature.\n * The struct is always added to the shader by the GeometryPipelineStage (required for compilation). The SelectedFeature struct looks\n * as follows:\n *\n * struct SelectedFeature {\n * int id;\n * vec2 st;\n * vec4 color;\n * }\n *\n * @private\n */\nfunction updateFeatureStruct(shaderBuilder) {\n shaderBuilder.addStructField(\n SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n \"int\",\n \"id\"\n );\n\n shaderBuilder.addStructField(\n SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n \"vec2\",\n \"st\"\n );\n\n shaderBuilder.addStructField(\n SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n \"vec4\",\n \"color\"\n );\n}\n\nexport default SelectedFeatureIdPipelineStage;\n", "import ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport GeometryStageFS from \"../../Shaders/Model/GeometryStageFS.js\";\nimport GeometryStageVS from \"../../Shaders/Model/GeometryStageVS.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SelectedFeatureIdPipelineStage from \"./SelectedFeatureIdPipelineStage.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The geometry pipeline stage processes the vertex attributes of a primitive.\n *\n * @namespace GeometryPipelineStage\n *\n * @private\n */\nconst GeometryPipelineStage = {\n name: \"GeometryPipelineStage\", // Helps with debugging\n\n STRUCT_ID_PROCESSED_ATTRIBUTES_VS: \"ProcessedAttributesVS\",\n STRUCT_ID_PROCESSED_ATTRIBUTES_FS: \"ProcessedAttributesFS\",\n STRUCT_NAME_PROCESSED_ATTRIBUTES: \"ProcessedAttributes\",\n FUNCTION_ID_INITIALIZE_ATTRIBUTES: \"initializeAttributes\",\n FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:\n \"void initializeAttributes(out ProcessedAttributes attributes)\",\n FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS: \"setDynamicVaryingsVS\",\n FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS: \"setDynamicVaryingsFS\",\n FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:\n \"void setDynamicVaryings(inout ProcessedAttributes attributes)\",\n};\n\n/**\n * This pipeline stage processes the vertex attributes of a primitive,\n * adding attribute declarations to the shaders, adding attribute objects to the\n * render resources, and setting define flags as needed.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n * <li> adds attribute and varying declarations for the vertex attributes in the vertex and fragment shaders\n * <li> creates the objects required to create VertexArrays\n * <li> sets the flag for point primitive types\n * </ul>\n *\n * If the scene is in either 2D or CV mode, this stage also:\n * <ul>\n * <li> adds a struct field for the 2D positions\n * <li> adds an additional attribute object and declaration if the node containing this primitive is not instanced\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nGeometryPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const model = renderResources.model;\n\n // These structs are similar, though the fragment shader version has a couple\n // additional fields.\n shaderBuilder.addStruct(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,\n \"ProcessedAttributes\",\n ShaderDestination.VERTEX\n );\n shaderBuilder.addStruct(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n \"ProcessedAttributes\",\n ShaderDestination.FRAGMENT\n );\n\n // The Feature struct is always added since it's required for compilation.\n // It may be unused if features are not present.\n shaderBuilder.addStruct(\n SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,\n SelectedFeatureIdPipelineStage.STRUCT_NAME_SELECTED_FEATURE,\n ShaderDestination.BOTH\n );\n\n // This initialization function is only needed in the vertex shader,\n // it assigns the non-quantized attribute struct fields from the\n // physical attributes\n shaderBuilder.addFunction(\n GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES,\n GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,\n ShaderDestination.VERTEX\n );\n\n // Positions in other coordinate systems need more variables\n shaderBuilder.addVarying(\"vec3\", \"v_positionWC\");\n shaderBuilder.addVarying(\"vec3\", \"v_positionEC\");\n shaderBuilder.addStructField(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n \"vec3\",\n \"positionWC\"\n );\n shaderBuilder.addStructField(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n \"vec3\",\n \"positionEC\"\n );\n\n // Though they have identical signatures, the implementation is different\n // between vertex and fragment shaders. The VS stores attributes in\n // varyings, while the FS unpacks the varyings for use by other stages.\n shaderBuilder.addFunction(\n GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,\n GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addFunction(\n GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,\n GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,\n ShaderDestination.FRAGMENT\n );\n\n // .pnts point clouds store sRGB color rather than linear color\n const modelType = model.type;\n if (modelType === ModelType.TILE_PNTS) {\n shaderBuilder.addDefine(\n \"HAS_SRGB_COLOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n // Attributes, structs, and functions will need to be modified for 2D / CV.\n const use2D =\n frameState.mode !== SceneMode.SCENE3D &&\n !frameState.scene3DOnly &&\n model._projectTo2D;\n\n // If the model is instanced, the work for 2D projection will have been done\n // in InstancingPipelineStage. The attribute struct will be updated with\n // position2D, but nothing else should be modified.\n const instanced = defined(renderResources.runtimeNode.node.instances);\n\n // If the scene is in 3D or the model is instanced, the 2D position attribute\n // is not needed, so don't increment attributeIndex.\n const incrementIndexFor2D = use2D && !instanced;\n const length = primitive.attributes.length;\n for (let i = 0; i < length; i++) {\n const attribute = primitive.attributes[i];\n const attributeLocationCount = AttributeType.getAttributeLocationCount(\n attribute.type\n );\n\n const isPositionAttribute =\n attribute.semantic === VertexAttributeSemantic.POSITION;\n\n let index;\n if (attributeLocationCount > 1) {\n index = renderResources.attributeIndex;\n renderResources.attributeIndex += attributeLocationCount;\n } else if (isPositionAttribute && !incrementIndexFor2D) {\n index = 0;\n } else {\n index = renderResources.attributeIndex++;\n }\n\n processAttribute(\n renderResources,\n attribute,\n index,\n attributeLocationCount,\n use2D,\n instanced\n );\n }\n\n handleBitangents(shaderBuilder, primitive.attributes);\n\n if (primitive.primitiveType === PrimitiveType.POINTS) {\n shaderBuilder.addDefine(\"PRIMITIVE_TYPE_POINTS\");\n }\n\n shaderBuilder.addVertexLines(GeometryStageVS);\n shaderBuilder.addFragmentLines(GeometryStageFS);\n};\n\nfunction processAttribute(\n renderResources,\n attribute,\n attributeIndex,\n attributeLocationCount,\n use2D,\n instanced\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const attributeInfo = ModelUtility.getAttributeInfo(attribute);\n\n // This indicates to only modify the resources for 2D if the model is\n // not instanced.\n const modifyFor2D = use2D && !instanced;\n\n if (attributeLocationCount > 1) {\n // Matrices are stored as multiple attributes, one per column vector.\n addMatrixAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex,\n attributeLocationCount\n );\n } else {\n addAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex,\n modifyFor2D\n );\n }\n\n addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D);\n addVaryingDeclaration(shaderBuilder, attributeInfo);\n\n // For common attributes like normals and tangents, the code is\n // already in GeometryStageVS, we just need to enable it.\n if (defined(attribute.semantic)) {\n addSemanticDefine(shaderBuilder, attribute);\n }\n\n // Dynamically generate GLSL code for the current attribute.\n // For 2D projection, the position2D field will always be added\n // to the attributes struct, even if the model is instanced.\n updateAttributesStruct(shaderBuilder, attributeInfo, use2D);\n updateInitializeAttributesFunction(shaderBuilder, attributeInfo, modifyFor2D);\n updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo);\n}\n\nfunction addSemanticDefine(shaderBuilder, attribute) {\n const semantic = attribute.semantic;\n const setIndex = attribute.setIndex;\n switch (semantic) {\n case VertexAttributeSemantic.NORMAL:\n shaderBuilder.addDefine(\"HAS_NORMALS\");\n break;\n case VertexAttributeSemantic.TANGENT:\n shaderBuilder.addDefine(\"HAS_TANGENTS\");\n break;\n case VertexAttributeSemantic.FEATURE_ID:\n // `_FEATURE_ID starts with an underscore so no need to double the\n // underscore.\n shaderBuilder.addDefine(`HAS${semantic}_${setIndex}`);\n break;\n case VertexAttributeSemantic.TEXCOORD:\n case VertexAttributeSemantic.COLOR:\n shaderBuilder.addDefine(`HAS_${semantic}_${setIndex}`);\n }\n}\n\nfunction addAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex,\n modifyFor2D\n) {\n const quantization = attribute.quantization;\n let type;\n let componentDatatype;\n if (defined(quantization)) {\n type = quantization.type;\n componentDatatype = quantization.componentDatatype;\n } else {\n type = attribute.type;\n componentDatatype = attribute.componentDatatype;\n }\n\n const semantic = attribute.semantic;\n const setIndex = attribute.setIndex;\n if (\n semantic === VertexAttributeSemantic.FEATURE_ID &&\n setIndex >= renderResources.featureIdVertexAttributeSetIndex\n ) {\n renderResources.featureIdVertexAttributeSetIndex = setIndex + 1;\n }\n\n // The position attribute should always be in the first index.\n const isPositionAttribute = semantic === VertexAttributeSemantic.POSITION;\n const index = isPositionAttribute ? 0 : attributeIndex;\n const componentsPerAttribute = AttributeType.getNumberOfComponents(type);\n\n const vertexAttribute = {\n index: index,\n value: defined(attribute.buffer) ? undefined : attribute.constant,\n vertexBuffer: attribute.buffer,\n count: attribute.count,\n componentsPerAttribute: componentsPerAttribute,\n componentDatatype: componentDatatype,\n offsetInBytes: attribute.byteOffset,\n strideInBytes: attribute.byteStride,\n normalize: attribute.normalized,\n };\n\n renderResources.attributes.push(vertexAttribute);\n\n if (!isPositionAttribute || !modifyFor2D) {\n return;\n }\n\n // Add an additional attribute for the projected positions in 2D / CV.\n const buffer2D = renderResources.runtimePrimitive.positionBuffer2D;\n const positionAttribute2D = {\n index: attributeIndex,\n vertexBuffer: buffer2D,\n count: attribute.count,\n componentsPerAttribute: componentsPerAttribute,\n componentDatatype: ComponentDatatype.FLOAT, // Projected positions will always be floats.\n offsetInBytes: 0,\n strideInBytes: undefined,\n normalize: attribute.normalized,\n };\n\n renderResources.attributes.push(positionAttribute2D);\n}\n\nfunction addMatrixAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex,\n columnCount\n) {\n const quantization = attribute.quantization;\n let type;\n let componentDatatype;\n if (defined(quantization)) {\n type = quantization.type;\n componentDatatype = quantization.componentDatatype;\n } else {\n type = attribute.type;\n componentDatatype = attribute.componentDatatype;\n }\n\n const normalized = attribute.normalized;\n\n // componentCount is either 4, 9 or 16\n const componentCount = AttributeType.getNumberOfComponents(type);\n // componentsPerColumn is either 2, 3, or 4\n const componentsPerColumn = componentCount / columnCount;\n\n const componentSizeInBytes = ComponentDatatype.getSizeInBytes(\n componentDatatype\n );\n\n const columnLengthInBytes = componentsPerColumn * componentSizeInBytes;\n\n // The stride between corresponding columns of two matrices is constant\n // regardless of where you start\n const strideInBytes = attribute.byteStride;\n\n for (let i = 0; i < columnCount; i++) {\n const offsetInBytes = attribute.byteOffset + i * columnLengthInBytes;\n\n // upload a single column vector.\n const columnAttribute = {\n index: attributeIndex + i,\n vertexBuffer: attribute.buffer,\n componentsPerAttribute: componentsPerColumn,\n componentDatatype: componentDatatype,\n offsetInBytes: offsetInBytes,\n strideInBytes: strideInBytes,\n normalize: normalized,\n };\n\n renderResources.attributes.push(columnAttribute);\n }\n}\n\nfunction addVaryingDeclaration(shaderBuilder, attributeInfo) {\n const variableName = attributeInfo.variableName;\n let varyingName = `v_${variableName}`;\n\n let glslType;\n if (variableName === \"normalMC\") {\n // though the attribute is in model coordinates, the varying is\n // in eye coordinates.\n varyingName = \"v_normalEC\";\n glslType = attributeInfo.glslType;\n } else if (variableName === \"tangentMC\") {\n // Tangent's glslType is vec4, but in the shader it is split into\n // vec3 tangent and vec3 bitangent\n glslType = \"vec3\";\n // like normalMC, the varying is converted to eye coordinates\n varyingName = \"v_tangentEC\";\n } else {\n glslType = attributeInfo.glslType;\n }\n\n shaderBuilder.addVarying(glslType, varyingName);\n}\n\nfunction addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D) {\n const semantic = attributeInfo.attribute.semantic;\n const variableName = attributeInfo.variableName;\n\n let attributeName;\n let glslType;\n if (attributeInfo.isQuantized) {\n attributeName = `a_quantized_${variableName}`;\n glslType = attributeInfo.quantizedGlslType;\n } else {\n attributeName = `a_${variableName}`;\n glslType = attributeInfo.glslType;\n }\n\n const isPosition = semantic === VertexAttributeSemantic.POSITION;\n if (isPosition) {\n shaderBuilder.setPositionAttribute(glslType, attributeName);\n } else {\n shaderBuilder.addAttribute(glslType, attributeName);\n }\n\n if (isPosition && modifyFor2D) {\n shaderBuilder.addAttribute(\"vec3\", \"a_position2D\");\n }\n}\n\nfunction updateAttributesStruct(shaderBuilder, attributeInfo, use2D) {\n const vsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS;\n const fsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS;\n const variableName = attributeInfo.variableName;\n\n if (variableName === \"tangentMC\") {\n // The w component of the tangent is only used for computing the bitangent,\n // so it can be separated from the other tangent components.\n shaderBuilder.addStructField(vsStructId, \"vec3\", \"tangentMC\");\n shaderBuilder.addStructField(vsStructId, \"float\", \"tangentSignMC\");\n // The tangent is in model coordinates in the vertex shader\n // but in eye space in the fragment coordinates\n shaderBuilder.addStructField(fsStructId, \"vec3\", \"tangentEC\");\n } else if (variableName === \"normalMC\") {\n // Normals are in model coordinates in the vertex shader but in eye\n // coordinates in the fragment shader\n shaderBuilder.addStructField(vsStructId, \"vec3\", \"normalMC\");\n shaderBuilder.addStructField(fsStructId, \"vec3\", \"normalEC\");\n } else {\n shaderBuilder.addStructField(\n vsStructId,\n attributeInfo.glslType,\n variableName\n );\n shaderBuilder.addStructField(\n fsStructId,\n attributeInfo.glslType,\n variableName\n );\n }\n\n if (variableName === \"positionMC\" && use2D) {\n shaderBuilder.addStructField(vsStructId, \"vec3\", \"position2D\");\n }\n}\n\nfunction updateInitializeAttributesFunction(\n shaderBuilder,\n attributeInfo,\n use2D\n) {\n const functionId = GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES;\n const variableName = attributeInfo.variableName;\n\n // If the scene is in 2D / CV mode, this line should always be added\n // regardless of whether the data is quantized.\n const use2DPosition = variableName === \"positionMC\" && use2D;\n if (use2DPosition) {\n const line = \"attributes.position2D = a_position2D;\";\n shaderBuilder.addFunctionLines(functionId, [line]);\n }\n\n if (attributeInfo.isQuantized) {\n // Skip initialization, it will be handled in the dequantization stage.\n return;\n }\n\n const lines = [];\n if (variableName === \"tangentMC\") {\n lines.push(\"attributes.tangentMC = a_tangentMC.xyz;\");\n lines.push(\"attributes.tangentSignMC = a_tangentMC.w;\");\n } else {\n lines.push(`attributes.${variableName} = a_${variableName};`);\n }\n\n shaderBuilder.addFunctionLines(functionId, lines);\n}\n\nfunction updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo) {\n const semantic = attributeInfo.attribute.semantic;\n const setIndex = attributeInfo.attribute.setIndex;\n if (defined(semantic) && !defined(setIndex)) {\n // positions, normals, and tangents are handled statically in\n // GeometryStageVS\n return;\n }\n\n // In the vertex shader, we want things like\n // v_texCoord_1 = attributes.texCoord_1;\n let functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS;\n const variableName = attributeInfo.variableName;\n let line = `v_${variableName} = attributes.${variableName};`;\n shaderBuilder.addFunctionLines(functionId, [line]);\n\n // In the fragment shader, we do the opposite:\n // attributes.texCoord_1 = v_texCoord_1;\n functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS;\n line = `attributes.${variableName} = v_${variableName};`;\n shaderBuilder.addFunctionLines(functionId, [line]);\n}\n\nfunction handleBitangents(shaderBuilder, attributes) {\n let hasNormals = false;\n let hasTangents = false;\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n if (attribute.semantic === VertexAttributeSemantic.NORMAL) {\n hasNormals = true;\n } else if (attribute.semantic === VertexAttributeSemantic.TANGENT) {\n hasTangents = true;\n }\n }\n\n // Bitangents are only defined if we have normals and tangents\n if (!hasNormals || !hasTangents) {\n return;\n }\n\n shaderBuilder.addDefine(\"HAS_BITANGENTS\");\n\n shaderBuilder.addVarying(\"vec3\", \"v_bitangentEC\");\n shaderBuilder.addStructField(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,\n \"vec3\",\n \"bitangentMC\"\n );\n shaderBuilder.addStructField(\n GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,\n \"vec3\",\n \"bitangentEC\"\n );\n}\n\nexport default GeometryPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef LIGHTING_PBR\\n\\\nvec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)\\n\\\n{\\n\\\nczm_pbrParameters pbrParameters;\\n\\\npbrParameters.diffuseColor = inputMaterial.diffuse;\\n\\\npbrParameters.f0 = inputMaterial.specular;\\n\\\npbrParameters.roughness = inputMaterial.roughness;\\n\\\n#ifdef USE_CUSTOM_LIGHT_COLOR\\n\\\nvec3 lightColorHdr = model_lightColorHdr;\\n\\\n#else\\n\\\nvec3 lightColorHdr = czm_lightColorHdr;\\n\\\n#endif\\n\\\nvec3 color = inputMaterial.diffuse;\\n\\\n#ifdef HAS_NORMALS\\n\\\ncolor = czm_pbrLighting(\\n\\\nattributes.positionEC,\\n\\\ninputMaterial.normalEC,\\n\\\nczm_lightDirectionEC,\\n\\\nlightColorHdr,\\n\\\npbrParameters\\n\\\n);\\n\\\n#ifdef USE_IBL_LIGHTING\\n\\\ncolor += imageBasedLightingStage(\\n\\\nattributes.positionEC,\\n\\\ninputMaterial.normalEC,\\n\\\nczm_lightDirectionEC,\\n\\\nlightColorHdr,\\n\\\npbrParameters\\n\\\n);\\n\\\n#endif\\n\\\n#endif\\n\\\ncolor *= inputMaterial.occlusion;\\n\\\ncolor += inputMaterial.emissive;\\n\\\n#ifndef HDR\\n\\\ncolor = czm_acesTonemapping(color);\\n\\\n#endif\\n\\\nreturn color;\\n\\\n}\\n\\\n#endif\\n\\\nvoid lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)\\n\\\n{\\n\\\nvec3 color = vec3(0.0);\\n\\\n#ifdef LIGHTING_PBR\\n\\\ncolor = computePbrLighting(material, attributes);\\n\\\n#else // unlit\\n\\\ncolor = material.diffuse;\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\n#elif !defined(HDR)\\n\\\ncolor = czm_linearToSrgb(color);\\n\\\n#endif\\n\\\nmaterial.diffuse = color;\\n\\\n}\\n\\\n\";\n", "/**\n * The lighting model to use for lighting a {@link Model}.\n *\n * @enum {Number}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst LightingModel = {\n /**\n * Use unlit shading, i.e. skip lighting calculations. The model's\n * diffuse color (assumed to be linear RGB, not sRGB) is used directly\n * when computing <code>gl_FragColor</code>. The alpha mode is still\n * applied.\n *\n * @type {Number}\n * @constant\n */\n UNLIT: 0,\n /**\n * Use physically-based rendering lighting calculations. This includes\n * both PBR metallic roughness and PBR specular glossiness. Image-based\n * lighting is also applied when possible.\n *\n * @type {Number}\n * @constant\n */\n PBR: 1,\n};\n\nexport default Object.freeze(LightingModel);\n", "import defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport LightingStageFS from \"../../Shaders/Model/LightingStageFS.js\";\nimport LightingModel from \"./LightingModel.js\";\n\n/**\n * The lighting pipeline stage is responsible for taking a material and rendering\n * it with a lighting model such as physically based rendering (PBR) or unlit\n * shading\n *\n * @namespace LightingPipelineStage\n *\n * @private\n */\nconst LightingPipelineStage = {\n name: \"LightingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n * <li>modifies the shader to include the lighting stage</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n *\n * @private\n */\nLightingPipelineStage.process = function (renderResources, primitive) {\n const model = renderResources.model;\n const lightingOptions = renderResources.lightingOptions;\n const shaderBuilder = renderResources.shaderBuilder;\n\n if (defined(model.lightColor)) {\n shaderBuilder.addDefine(\n \"USE_CUSTOM_LIGHT_COLOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addUniform(\n \"vec3\",\n \"model_lightColorHdr\",\n ShaderDestination.FRAGMENT\n );\n\n const uniformMap = renderResources.uniformMap;\n uniformMap.model_lightColorHdr = function () {\n return model.lightColor;\n };\n }\n\n // The lighting model is always set by the material. However, custom shaders\n // can override this.\n const lightingModel = lightingOptions.lightingModel;\n\n if (lightingModel === LightingModel.PBR) {\n shaderBuilder.addDefine(\n \"LIGHTING_PBR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n } else {\n shaderBuilder.addDefine(\n \"LIGHTING_UNLIT\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n shaderBuilder.addFragmentLines(LightingStageFS);\n};\n\nexport default LightingPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"bool isDefaultStyleColor(vec3 color)\\n\\\n{\\n\\\nreturn all(greaterThan(color, vec3(1.0 - czm_epsilon3)));\\n\\\n}\\n\\\nvec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)\\n\\\n{\\n\\\nvec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);\\n\\\nvec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;\\n\\\nreturn color;\\n\\\n}\\n\\\nvec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)\\n\\\n{\\n\\\nreturn vec2(textureTransform * vec3(texCoord, 1.0));\\n\\\n}\\n\\\n#ifdef HAS_NORMALS\\n\\\nvec3 computeNormal(ProcessedAttributes attributes)\\n\\\n{\\n\\\nvec3 ng = attributes.normalEC;\\n\\\nvec3 normal = ng;\\n\\\n#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\\n\\\nvec2 normalTexCoords = TEXCOORD_NORMAL;\\n\\\n#ifdef HAS_NORMAL_TEXTURE_TRANSFORM\\n\\\nnormalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);\\n\\\n#endif\\n\\\n#ifdef HAS_BITANGENTS\\n\\\nvec3 t = attributes.tangentEC;\\n\\\nvec3 b = attributes.bitangentEC;\\n\\\nmat3 tbn = mat3(t, b, ng);\\n\\\nvec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\\n\\\nnormal = normalize(tbn * (2.0 * n - 1.0));\\n\\\n#elif defined(GL_OES_standard_derivatives)\\n\\\nvec3 positionEC = attributes.positionEC;\\n\\\nvec3 pos_dx = dFdx(positionEC);\\n\\\nvec3 pos_dy = dFdy(positionEC);\\n\\\nvec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));\\n\\\nvec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));\\n\\\nvec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\\n\\\nt = normalize(t - ng * dot(ng, t));\\n\\\nvec3 b = normalize(cross(ng, t));\\n\\\nmat3 tbn = mat3(t, b, ng);\\n\\\nvec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\\n\\\nnormal = normalize(tbn * (2.0 * n - 1.0));\\n\\\n#endif\\n\\\n#endif\\n\\\n#ifdef HAS_DOUBLE_SIDED_MATERIAL\\n\\\nif (czm_backFacing()) {\\n\\\nnormal = -normal;\\n\\\n}\\n\\\n#endif\\n\\\nreturn normal;\\n\\\n}\\n\\\n#endif\\n\\\nvoid materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)\\n\\\n{\\n\\\n#ifdef HAS_NORMALS\\n\\\nmaterial.normalEC = computeNormal(attributes);\\n\\\n#endif\\n\\\nvec4 baseColorWithAlpha = vec4(1.0);\\n\\\n#ifdef HAS_BASE_COLOR_TEXTURE\\n\\\nvec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;\\n\\\n#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM\\n\\\nbaseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\\n\\\n#endif\\n\\\nbaseColorWithAlpha = czm_srgbToLinear(texture2D(u_baseColorTexture, baseColorTexCoords));\\n\\\n#ifdef HAS_BASE_COLOR_FACTOR\\n\\\nbaseColorWithAlpha *= u_baseColorFactor;\\n\\\n#endif\\n\\\n#elif defined(HAS_BASE_COLOR_FACTOR)\\n\\\nbaseColorWithAlpha = u_baseColorFactor;\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\nbaseColorWithAlpha = v_pointCloudColor;\\n\\\n#elif defined(HAS_COLOR_0)\\n\\\nvec4 color = attributes.color_0;\\n\\\n#ifdef HAS_SRGB_COLOR\\n\\\ncolor = czm_srgbToLinear(color);\\n\\\n#endif\\n\\\nbaseColorWithAlpha *= color;\\n\\\n#endif\\n\\\nmaterial.diffuse = baseColorWithAlpha.rgb;\\n\\\nmaterial.alpha = baseColorWithAlpha.a;\\n\\\n#ifdef USE_CPU_STYLING\\n\\\nmaterial.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\\n\\\n#endif\\n\\\n#ifdef HAS_OCCLUSION_TEXTURE\\n\\\nvec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\\n\\\n#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\\n\\\nocclusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\\n\\\n#endif\\n\\\nmaterial.occlusion = texture2D(u_occlusionTexture, occlusionTexCoords).r;\\n\\\n#endif\\n\\\n#ifdef HAS_EMISSIVE_TEXTURE\\n\\\nvec2 emissiveTexCoords = TEXCOORD_EMISSIVE;\\n\\\n#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM\\n\\\nemissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\\n\\\n#endif\\n\\\nvec3 emissive = czm_srgbToLinear(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);\\n\\\n#ifdef HAS_EMISSIVE_FACTOR\\n\\\nemissive *= u_emissiveFactor;\\n\\\n#endif\\n\\\nmaterial.emissive = emissive;\\n\\\n#elif defined(HAS_EMISSIVE_FACTOR)\\n\\\nmaterial.emissive = u_emissiveFactor;\\n\\\n#endif\\n\\\n#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\\n\\\n#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE\\n\\\nvec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;\\n\\\n#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM\\n\\\nspecularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\\n\\\n#endif\\n\\\nvec4 specularGlossiness = czm_srgbToLinear(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));\\n\\\nvec3 specular = specularGlossiness.rgb;\\n\\\nfloat glossiness = specularGlossiness.a;\\n\\\n#ifdef HAS_SPECULAR_FACTOR\\n\\\nspecular *= u_specularFactor;\\n\\\n#endif\\n\\\n#ifdef HAS_GLOSSINESS_FACTOR\\n\\\nglossiness *= u_glossinessFactor;\\n\\\n#endif\\n\\\n#else\\n\\\n#ifdef HAS_SPECULAR_FACTOR\\n\\\nvec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\\n\\\n#else\\n\\\nvec3 specular = vec3(1.0);\\n\\\n#endif\\n\\\n#ifdef HAS_GLOSSINESS_FACTOR\\n\\\nfloat glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\\n\\\n#else\\n\\\nfloat glossiness = 1.0;\\n\\\n#endif\\n\\\n#endif\\n\\\n#ifdef HAS_DIFFUSE_TEXTURE\\n\\\nvec2 diffuseTexCoords = TEXCOORD_DIFFUSE;\\n\\\n#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM\\n\\\ndiffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\\n\\\n#endif\\n\\\nvec4 diffuse = czm_srgbToLinear(texture2D(u_diffuseTexture, diffuseTexCoords));\\n\\\n#ifdef HAS_DIFFUSE_FACTOR\\n\\\ndiffuse *= u_diffuseFactor;\\n\\\n#endif\\n\\\n#elif defined(HAS_DIFFUSE_FACTOR)\\n\\\nvec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\\n\\\n#else\\n\\\nvec4 diffuse = vec4(1.0);\\n\\\n#endif\\n\\\nczm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(\\n\\\ndiffuse.rgb,\\n\\\nspecular,\\n\\\nglossiness\\n\\\n);\\n\\\nmaterial.diffuse = parameters.diffuseColor;\\n\\\nmaterial.alpha = diffuse.a;\\n\\\nmaterial.specular = parameters.f0;\\n\\\nmaterial.roughness = parameters.roughness;\\n\\\n#elif defined(LIGHTING_PBR)\\n\\\n#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE\\n\\\nvec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;\\n\\\n#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM\\n\\\nmetallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\\n\\\n#endif\\n\\\nvec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\\n\\\nfloat metalness = clamp(metallicRoughness.b, 0.0, 1.0);\\n\\\nfloat roughness = clamp(metallicRoughness.g, 0.04, 1.0);\\n\\\n#ifdef HAS_METALLIC_FACTOR\\n\\\nmetalness *= u_metallicFactor;\\n\\\n#endif\\n\\\n#ifdef HAS_ROUGHNESS_FACTOR\\n\\\nroughness *= u_roughnessFactor;\\n\\\n#endif\\n\\\n#else\\n\\\n#ifdef HAS_METALLIC_FACTOR\\n\\\nfloat metalness = clamp(u_metallicFactor, 0.0, 1.0);\\n\\\n#else\\n\\\nfloat metalness = 1.0;\\n\\\n#endif\\n\\\n#ifdef HAS_ROUGHNESS_FACTOR\\n\\\nfloat roughness = clamp(u_roughnessFactor, 0.04, 1.0);\\n\\\n#else\\n\\\nfloat roughness = 1.0;\\n\\\n#endif\\n\\\n#endif\\n\\\nczm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(\\n\\\nmaterial.diffuse,\\n\\\nmetalness,\\n\\\nroughness\\n\\\n);\\n\\\nmaterial.diffuse = parameters.diffuseColor;\\n\\\nmaterial.specular = parameters.f0;\\n\\\nmaterial.roughness = parameters.roughness;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport MaterialStageFS from \"../../Shaders/Model/MaterialStageFS.js\";\nimport AlphaMode from \"../AlphaMode.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport LightingModel from \"./LightingModel.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\nconst Material = ModelComponents.Material;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\nconst SpecularGlossiness = ModelComponents.SpecularGlossiness;\n\n/**\n * The material pipeline stage processes textures and other uniforms needed\n * to render a primitive. This handles the following material types:\n * <ul>\n * <li>Basic glTF materials (PBR metallic roughness model)</li>\n * <li>The `KHR_materials_pbrSpecularGlossiness` glTF extension</li>\n * <li>The `KHR_materials_unlit` glTF extension</li>\n * </ul>\n *\n * @namespace MaterialPipelineStage\n *\n * @private\n */\nconst MaterialPipelineStage = {\n name: \"MaterialPipelineStage\", // Helps with debugging\n\n // Expose some methods for testing\n _processTexture: processTexture,\n _processTextureTransform: processTextureTransform,\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n * <li>Modifies the shader to include the material processing stage</li>\n * <li>Modifies the shader to include additional uniforms for textures and other rendering details</li>\n * <li>Modifies the lighting options to set either PBR or unlit lighting</li>\n * <li>Sets the render state for back-face culling</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state.\n * @private\n */\nMaterialPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n // gltf-pipeline automatically creates a default material so this will always\n // be defined.\n const material = primitive.material;\n const model = renderResources.model;\n\n // Classification models only use position and feature ID attributes,\n // so textures should be disabled to avoid compile errors.\n const hasClassification = defined(model.classificationType);\n const disableTextures = hasClassification;\n\n const uniformMap = renderResources.uniformMap;\n const shaderBuilder = renderResources.shaderBuilder;\n\n // When textures are loaded incrementally, fall back to a default 1x1 texture\n const defaultTexture = frameState.context.defaultTexture;\n const defaultNormalTexture = frameState.context.defaultNormalTexture;\n const defaultEmissiveTexture = frameState.context.defaultEmissiveTexture;\n\n processMaterialUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n defaultNormalTexture,\n defaultEmissiveTexture,\n disableTextures\n );\n\n if (defined(material.specularGlossiness)) {\n processSpecularGlossinessUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n disableTextures\n );\n } else {\n processMetallicRoughnessUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n disableTextures\n );\n }\n\n // If the primitive does not have normals, fall back to unlit lighting.\n const hasNormals = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.NORMAL\n );\n\n // Classification models will be rendered as unlit.\n const lightingOptions = renderResources.lightingOptions;\n if (material.unlit || !hasNormals || hasClassification) {\n lightingOptions.lightingModel = LightingModel.UNLIT;\n } else {\n lightingOptions.lightingModel = LightingModel.PBR;\n }\n\n // Configure back-face culling\n const cull = model.backFaceCulling && !material.doubleSided;\n renderResources.renderStateOptions.cull.enabled = cull;\n\n const alphaOptions = renderResources.alphaOptions;\n if (material.alphaMode === AlphaMode.BLEND) {\n alphaOptions.pass = Pass.TRANSLUCENT;\n } else if (material.alphaMode === AlphaMode.MASK) {\n alphaOptions.alphaCutoff = material.alphaCutoff;\n }\n\n shaderBuilder.addFragmentLines(MaterialStageFS);\n\n if (material.doubleSided) {\n shaderBuilder.addDefine(\n \"HAS_DOUBLE_SIDED_MATERIAL\",\n undefined,\n ShaderDestination.BOTH\n );\n }\n};\n\n/**\n * Process a single texture transformation and add it to the shader and uniform map.\n *\n * @param {ShaderBuilder} shaderBuilder The shader builder to modify\n * @param {Object.<String, Function>} uniformMap The uniform map to modify.\n * @param {ModelComponents.TextureReader} textureReader The texture to add to the shader\n * @param {String} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>\n * @param {String} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, \"BASE_COLOR\" or \"EMISSIVE\"\n *\n * @private\n */\nfunction processTextureTransform(\n shaderBuilder,\n uniformMap,\n textureReader,\n uniformName,\n defineName\n) {\n // Add a define to enable the texture transformation code in the shader.\n const transformDefine = `HAS_${defineName}_TEXTURE_TRANSFORM`;\n shaderBuilder.addDefine(\n transformDefine,\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n // Add a uniform for the transformation matrix\n const transformUniformName = `${uniformName}Transform`;\n shaderBuilder.addUniform(\n \"mat3\",\n transformUniformName,\n ShaderDestination.FRAGMENT\n );\n uniformMap[transformUniformName] = function () {\n return textureReader.transform;\n };\n}\n\n/**\n * Process a single texture and add it to the shader and uniform map.\n *\n * @param {ShaderBuilder} shaderBuilder The shader builder to modify\n * @param {Object.<String, Function>} uniformMap The uniform map to modify.\n * @param {ModelComponents.TextureReader} textureReader The texture to add to the shader\n * @param {String} uniformName The name of the sampler uniform such as <code>u_baseColorTexture</code>\n * @param {String} defineName The name of the texture for use in the defines, minus any prefix or suffix. For example, \"BASE_COLOR\" or \"EMISSIVE\"\n *\n * @private\n */\nfunction processTexture(\n shaderBuilder,\n uniformMap,\n textureReader,\n uniformName,\n defineName,\n defaultTexture\n) {\n // Add a uniform for the texture itself\n shaderBuilder.addUniform(\n \"sampler2D\",\n uniformName,\n ShaderDestination.FRAGMENT\n );\n uniformMap[uniformName] = function () {\n return defaultValue(textureReader.texture, defaultTexture);\n };\n\n // Add a #define directive to enable using the texture in the shader\n const textureDefine = `HAS_${defineName}_TEXTURE`;\n shaderBuilder.addDefine(textureDefine, undefined, ShaderDestination.FRAGMENT);\n\n // Add a #define to tell the shader which texture coordinates varying to use.\n const texCoordIndex = textureReader.texCoord;\n const texCoordVarying = `v_texCoord_${texCoordIndex}`;\n const texCoordDefine = `TEXCOORD_${defineName}`;\n shaderBuilder.addDefine(\n texCoordDefine,\n texCoordVarying,\n ShaderDestination.FRAGMENT\n );\n\n // Some textures have matrix transforms (e.g. for texture atlases). Add those\n // to the shader if present.\n const textureTransform = textureReader.transform;\n if (\n defined(textureTransform) &&\n !Matrix3.equals(textureTransform, Matrix3.IDENTITY)\n ) {\n processTextureTransform(\n shaderBuilder,\n uniformMap,\n textureReader,\n uniformName,\n defineName\n );\n }\n}\n\nfunction processMaterialUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n defaultNormalTexture,\n defaultEmissiveTexture,\n disableTextures\n) {\n const emissiveTexture = material.emissiveTexture;\n if (defined(emissiveTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n emissiveTexture,\n \"u_emissiveTexture\",\n \"EMISSIVE\",\n defaultEmissiveTexture\n );\n }\n\n const emissiveFactor = material.emissiveFactor;\n if (\n defined(emissiveFactor) &&\n !Cartesian3.equals(emissiveFactor, Material.DEFAULT_EMISSIVE_FACTOR)\n ) {\n shaderBuilder.addUniform(\n \"vec3\",\n \"u_emissiveFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_emissiveFactor = function () {\n return material.emissiveFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_EMISSIVE_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const normalTexture = material.normalTexture;\n if (defined(normalTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n normalTexture,\n \"u_normalTexture\",\n \"NORMAL\",\n defaultNormalTexture\n );\n }\n\n const occlusionTexture = material.occlusionTexture;\n if (defined(occlusionTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n occlusionTexture,\n \"u_occlusionTexture\",\n \"OCCLUSION\",\n defaultTexture\n );\n }\n}\n\nfunction processSpecularGlossinessUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n disableTextures\n) {\n const specularGlossiness = material.specularGlossiness;\n shaderBuilder.addDefine(\n \"USE_SPECULAR_GLOSSINESS\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n const diffuseTexture = specularGlossiness.diffuseTexture;\n if (defined(diffuseTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n diffuseTexture,\n \"u_diffuseTexture\",\n \"DIFFUSE\",\n defaultTexture\n );\n }\n\n const diffuseFactor = specularGlossiness.diffuseFactor;\n if (\n defined(diffuseFactor) &&\n !Cartesian4.equals(diffuseFactor, SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR)\n ) {\n shaderBuilder.addUniform(\n \"vec4\",\n \"u_diffuseFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_diffuseFactor = function () {\n return specularGlossiness.diffuseFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_DIFFUSE_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const specularGlossinessTexture =\n specularGlossiness.specularGlossinessTexture;\n if (defined(specularGlossinessTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n specularGlossinessTexture,\n \"u_specularGlossinessTexture\",\n \"SPECULAR_GLOSSINESS\",\n defaultTexture\n );\n }\n\n const specularFactor = specularGlossiness.specularFactor;\n if (\n defined(specularFactor) &&\n !Cartesian3.equals(\n specularFactor,\n SpecularGlossiness.DEFAULT_SPECULAR_FACTOR\n )\n ) {\n shaderBuilder.addUniform(\n \"vec3\",\n \"u_specularFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_specularFactor = function () {\n return specularGlossiness.specularFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_SPECULAR_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const glossinessFactor = specularGlossiness.glossinessFactor;\n if (\n defined(glossinessFactor) &&\n glossinessFactor !== SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR\n ) {\n shaderBuilder.addUniform(\n \"float\",\n \"u_glossinessFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_glossinessFactor = function () {\n return specularGlossiness.glossinessFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_GLOSSINESS_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n}\n\nfunction processMetallicRoughnessUniforms(\n material,\n uniformMap,\n shaderBuilder,\n defaultTexture,\n disableTextures\n) {\n const metallicRoughness = material.metallicRoughness;\n shaderBuilder.addDefine(\n \"USE_METALLIC_ROUGHNESS\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n const baseColorTexture = metallicRoughness.baseColorTexture;\n if (defined(baseColorTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n baseColorTexture,\n \"u_baseColorTexture\",\n \"BASE_COLOR\",\n defaultTexture\n );\n }\n\n const baseColorFactor = metallicRoughness.baseColorFactor;\n if (\n defined(baseColorFactor) &&\n !Cartesian4.equals(\n baseColorFactor,\n MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR\n )\n ) {\n shaderBuilder.addUniform(\n \"vec4\",\n \"u_baseColorFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_baseColorFactor = function () {\n return metallicRoughness.baseColorFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_BASE_COLOR_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const metallicRoughnessTexture = metallicRoughness.metallicRoughnessTexture;\n if (defined(metallicRoughnessTexture) && !disableTextures) {\n processTexture(\n shaderBuilder,\n uniformMap,\n metallicRoughnessTexture,\n \"u_metallicRoughnessTexture\",\n \"METALLIC_ROUGHNESS\",\n defaultTexture\n );\n }\n\n const metallicFactor = metallicRoughness.metallicFactor;\n if (\n defined(metallicFactor) &&\n metallicFactor !== MetallicRoughness.DEFAULT_METALLIC_FACTOR\n ) {\n shaderBuilder.addUniform(\n \"float\",\n \"u_metallicFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_metallicFactor = function () {\n return metallicRoughness.metallicFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_METALLIC_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n\n const roughnessFactor = metallicRoughness.roughnessFactor;\n if (\n defined(roughnessFactor) &&\n roughnessFactor !== MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR\n ) {\n shaderBuilder.addUniform(\n \"float\",\n \"u_roughnessFactor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.u_roughnessFactor = function () {\n return metallicRoughness.roughnessFactor;\n };\n shaderBuilder.addDefine(\n \"HAS_ROUGHNESS_FACTOR\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n }\n}\n\nexport default MaterialPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void morphTargetsStage(inout ProcessedAttributes attributes)\\n\\\n{\\n\\\nvec3 positionMC = attributes.positionMC;\\n\\\nattributes.positionMC = getMorphedPosition(positionMC);\\n\\\n#ifdef HAS_NORMALS\\n\\\nvec3 normalMC = attributes.normalMC;\\n\\\nattributes.normalMC = getMorphedNormal(normalMC);\\n\\\n#endif\\n\\\n#ifdef HAS_TANGENTS\\n\\\nvec3 tangentMC = attributes.tangentMC;\\n\\\nattributes.tangentMC = getMorphedTangent(tangentMC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import AttributeType from \"../AttributeType.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport MorphTargetsStageVS from \"../../Shaders/Model/MorphTargetsStageVS.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The morph targets pipeline stage processes the morph targets and weights of a primitive.\n *\n * @namespace MorphTargetsPipelineStage\n *\n * @private\n */\nconst MorphTargetsPipelineStage = {\n name: \"MorphTargetsPipelineStage\", // Helps with debugging\n\n FUNCTION_ID_GET_MORPHED_POSITION: \"getMorphedPosition\",\n FUNCTION_SIGNATURE_GET_MORPHED_POSITION:\n \"vec3 getMorphedPosition(in vec3 position)\",\n FUNCTION_ID_GET_MORPHED_NORMAL: \"getMorphedNormal\",\n FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:\n \"vec3 getMorphedNormal(in vec3 normal)\",\n FUNCTION_ID_GET_MORPHED_TANGENT: \"getMorphedTangent\",\n FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:\n \"vec3 getMorphedTangent(in vec3 tangent)\",\n};\n\n/**\n * This pipeline stage processes the morph targets and weights of a primitive,\n * adding the relevant attribute declarations and functions to the shaders.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n * <li> adds attribute declarations for the morph targets in the vertex shader\n * <li> adds the uniform declaration for the morph weights in the vertex shader\n * <li> adds functions to apply the morphs in the vertex shader\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n *\n * @private\n */\nMorphTargetsPipelineStage.process = function (renderResources, primitive) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"HAS_MORPH_TARGETS\",\n undefined,\n ShaderDestination.VERTEX\n );\n\n addGetMorphedAttributeFunctionDeclarations(shaderBuilder);\n\n const morphTargetsLength = primitive.morphTargets.length;\n for (let i = 0; i < morphTargetsLength; i++) {\n const attributes = primitive.morphTargets[i].attributes;\n\n const attributesLength = attributes.length;\n for (let j = 0; j < attributesLength; j++) {\n const attribute = attributes[j];\n const semantic = attribute.semantic;\n\n // Cesium only supports morph targets for positions, normals, and tangents\n if (\n semantic !== VertexAttributeSemantic.POSITION &&\n semantic !== VertexAttributeSemantic.NORMAL &&\n semantic !== VertexAttributeSemantic.TANGENT\n ) {\n continue;\n }\n\n processMorphTargetAttribute(\n renderResources,\n attribute,\n renderResources.attributeIndex,\n i\n );\n renderResources.attributeIndex++;\n }\n }\n\n addGetMorphedAttributeFunctionReturns(shaderBuilder);\n\n const weights = renderResources.runtimeNode.morphWeights;\n const weightsLength = weights.length;\n shaderBuilder.addUniform(\n \"float\",\n `u_morphWeights[${weightsLength}]`,\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addVertexLines(MorphTargetsStageVS);\n\n const uniformMap = {\n u_morphWeights: function () {\n return renderResources.runtimeNode.morphWeights;\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nconst scratchAttributeInfo = {\n attributeString: undefined,\n functionId: undefined,\n};\n\nfunction processMorphTargetAttribute(\n renderResources,\n attribute,\n attributeIndex,\n morphTargetIndex\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n addMorphTargetAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex\n );\n\n const attributeInfo = getMorphTargetAttributeInfo(\n attribute,\n scratchAttributeInfo\n );\n\n addMorphTargetAttributeDeclarationAndFunctionLine(\n shaderBuilder,\n attributeInfo,\n morphTargetIndex\n );\n}\n\nfunction addMorphTargetAttributeToRenderResources(\n renderResources,\n attribute,\n attributeIndex\n) {\n const vertexAttribute = {\n index: attributeIndex,\n value: defined(attribute.buffer) ? undefined : attribute.constant,\n vertexBuffer: attribute.buffer,\n componentsPerAttribute: AttributeType.getNumberOfComponents(attribute.type),\n componentDatatype: attribute.componentDatatype,\n offsetInBytes: attribute.byteOffset,\n strideInBytes: attribute.byteStride,\n normalize: attribute.normalized,\n };\n\n renderResources.attributes.push(vertexAttribute);\n}\n\nfunction getMorphTargetAttributeInfo(attribute, result) {\n const semantic = attribute.semantic;\n switch (semantic) {\n case VertexAttributeSemantic.POSITION:\n result.attributeString = \"Position\";\n result.functionId =\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION;\n break;\n case VertexAttributeSemantic.NORMAL:\n result.attributeString = \"Normal\";\n result.functionId =\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL;\n break;\n case VertexAttributeSemantic.TANGENT:\n result.attributeString = \"Tangent\";\n result.functionId =\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT;\n break;\n default:\n break;\n }\n return result;\n}\n\nfunction addMorphTargetAttributeDeclarationAndFunctionLine(\n shaderBuilder,\n attributeInfo,\n morphTargetIndex\n) {\n const attributeString = attributeInfo.attributeString;\n const attributeName = `a_target${attributeString}_${morphTargetIndex}`;\n const line = `morphed${attributeString} += u_morphWeights[${morphTargetIndex}] * a_target${attributeString}_${morphTargetIndex};`;\n shaderBuilder.addAttribute(\"vec3\", attributeName);\n shaderBuilder.addFunctionLines(attributeInfo.functionId, [line]);\n}\n\nfunction addGetMorphedAttributeFunctionDeclarations(shaderBuilder) {\n shaderBuilder.addFunction(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,\n ShaderDestination.VERTEX\n );\n\n const positionLine = \"vec3 morphedPosition = position;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n [positionLine]\n );\n\n shaderBuilder.addFunction(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,\n ShaderDestination.VERTEX\n );\n\n const normalLine = \"vec3 morphedNormal = normal;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n [normalLine]\n );\n\n shaderBuilder.addFunction(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,\n ShaderDestination.VERTEX\n );\n\n const tangentLine = \"vec3 morphedTangent = tangent;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n [tangentLine]\n );\n}\n\nfunction addGetMorphedAttributeFunctionReturns(shaderBuilder) {\n const positionLine = \"return morphedPosition;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,\n [positionLine]\n );\n\n const normalLine = \"return morphedNormal;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,\n [normalLine]\n );\n\n const tangentLine = \"return morphedTangent;\";\n shaderBuilder.addFunctionLines(\n MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,\n [tangentLine]\n );\n}\n\nexport default MorphTargetsPipelineStage;\n", "import Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport Color from \"../../Core/Color.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The picking pipeline stage is responsible for handling picking of primitives.\n *\n * @namespace PickingPipelineStage\n * @private\n */\nconst PickingPipelineStage = {\n name: \"PickingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render resources:\n * <ul>\n * <li>adds attribute and varying declaration for the pick color vertex attribute in the vertex shader for instanced meshes</li>\n * <li>adds declaration for the pick color uniform for non-instanced meshes</li>\n * <li>adds defines in the shader for when picking is enabled</li>\n * <li>creates the pick ID objects in the context</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n */\nPickingPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const context = frameState.context;\n const runtimeNode = renderResources.runtimeNode;\n const shaderBuilder = renderResources.shaderBuilder;\n const model = renderResources.model;\n const instances = runtimeNode.node.instances;\n\n if (renderResources.hasPropertyTable) {\n processPickTexture(renderResources, primitive, instances, context);\n } else if (defined(instances)) {\n // For instanced meshes, a pick color vertex attribute is used.\n processInstancedPickIds(renderResources, context);\n } else {\n // For non-instanced meshes, a pick color uniform is used.\n const pickObject = buildPickObject(renderResources);\n\n const pickId = context.createPickId(pickObject);\n model._pipelineResources.push(pickId);\n model._pickIds.push(pickId);\n\n shaderBuilder.addUniform(\n \"vec4\",\n \"czm_pickColor\",\n ShaderDestination.FRAGMENT\n );\n\n const uniformMap = renderResources.uniformMap;\n uniformMap.czm_pickColor = function () {\n return pickId.color;\n };\n\n renderResources.pickId = \"czm_pickColor\";\n }\n};\n\n/**\n * @private\n */\nfunction buildPickObject(renderResources, instanceId) {\n const model = renderResources.model;\n\n // Primitives that wrap Model may define the pickObject differently.\n if (defined(model.pickObject)) {\n return model.pickObject;\n }\n\n const detailPickObject = {\n model: model,\n node: renderResources.runtimeNode,\n primitive: renderResources.runtimePrimitive,\n };\n\n let pickObject;\n\n if (ModelType.is3DTiles(model.type)) {\n // For 3D Tiles, the pick object's content and primitive are set to the Cesium3DTileContent that owns the model\n // and the tileset it belongs to, respectively. The detail pick object is returned under the detail key.\n const content = model.content;\n pickObject = {\n content: content,\n primitive: content.tileset,\n detail: detailPickObject,\n };\n } else {\n // For models, the model itself is returned as the primitive, with the detail pick object under the detail key.\n pickObject = {\n primitive: model,\n detail: detailPickObject,\n };\n }\n\n pickObject.id = model.id;\n\n if (defined(instanceId)) {\n // For instanced models, an instanceId property is added to the pick object.\n pickObject.instanceId = instanceId;\n }\n\n return pickObject;\n}\n\nfunction processPickTexture(renderResources, primitive, instances) {\n const model = renderResources.model;\n let featureTableId;\n let featureIdAttribute;\n const featureIdLabel = model.featureIdLabel;\n const instanceFeatureIdLabel = model.instanceFeatureIdLabel;\n\n if (defined(model.featureTableId)) {\n // Extract the Feature Table ID from the Cesium3DTileContent.\n featureTableId = model.featureTableId;\n } else if (defined(instances)) {\n // Extract the Feature Table ID from the instanced Feature ID attributes.\n featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n instances.featureIds,\n instanceFeatureIdLabel\n );\n featureTableId = featureIdAttribute.propertyTableId;\n } else {\n // Extract the Feature Table ID from the primitive Feature ID attributes.\n featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n primitive.featureIds,\n featureIdLabel\n );\n featureTableId = featureIdAttribute.propertyTableId;\n }\n\n const featureTable = model.featureTables[featureTableId];\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addUniform(\n \"sampler2D\",\n \"model_pickTexture\",\n ShaderDestination.FRAGMENT\n );\n\n const batchTexture = featureTable.batchTexture;\n renderResources.uniformMap.model_pickTexture = function () {\n return defaultValue(batchTexture.pickTexture, batchTexture.defaultTexture);\n };\n\n // The feature ID is ignored if it is greater than the number of features.\n renderResources.pickId =\n \"((selectedFeature.id < int(model_featuresLength)) ? texture2D(model_pickTexture, selectedFeature.st) : vec4(0.0))\";\n}\n\nfunction processInstancedPickIds(renderResources, context) {\n const instanceCount = renderResources.instanceCount;\n const pickIds = new Array(instanceCount);\n const pickIdsTypedArray = new Uint8Array(instanceCount * 4);\n\n const model = renderResources.model;\n\n const pipelineResources = model._pipelineResources;\n for (let i = 0; i < instanceCount; i++) {\n const pickObject = buildPickObject(renderResources, i);\n\n const pickId = context.createPickId(pickObject);\n pipelineResources.push(pickId);\n pickIds[i] = pickId;\n\n const pickColor = pickId.color;\n pickIdsTypedArray[i * 4 + 0] = Color.floatToByte(pickColor.red);\n pickIdsTypedArray[i * 4 + 1] = Color.floatToByte(pickColor.green);\n pickIdsTypedArray[i * 4 + 2] = Color.floatToByte(pickColor.blue);\n pickIdsTypedArray[i * 4 + 3] = Color.floatToByte(pickColor.alpha);\n }\n\n model._pickIds = pickIds;\n\n const pickIdsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: pickIdsTypedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n // Destruction of resources allocated by the Model\n // is handled by Model.destroyPipelineResources().\n pickIdsBuffer.vertexArrayDestroyable = false;\n const hasCpuCopy = false;\n model.statistics.addBuffer(pickIdsBuffer, hasCpuCopy);\n pipelineResources.push(pickIdsBuffer);\n\n const pickIdsVertexAttribute = {\n index: renderResources.attributeIndex++,\n vertexBuffer: pickIdsBuffer,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n normalize: true,\n offsetInBytes: 0,\n strideInBytes: 0,\n instanceDivisor: 1,\n };\n\n renderResources.attributes.push(pickIdsVertexAttribute);\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addDefine(\"USE_PICKING\", undefined, ShaderDestination.BOTH);\n shaderBuilder.addAttribute(\"vec4\", \"a_pickColor\");\n shaderBuilder.addVarying(\"vec4\", \"v_pickColor\");\n renderResources.pickId = \"v_pickColor\";\n}\n\nexport default PickingPipelineStage;\n", "/**\n * The refinement approach for a tile.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#refinement|Refinement}\n * in the 3D Tiles spec.\n * </p>\n *\n * @enum {Number}\n *\n * @private\n */\nconst Cesium3DTileRefine = {\n /**\n * Render this tile and, if it doesn't meet the screen space error, also refine to its children.\n *\n * @type {Number}\n * @constant\n */\n ADD: 0,\n\n /**\n * Render this tile or, if it doesn't meet the screen space error, refine to its descendants instead.\n *\n * @type {Number}\n * @constant\n */\n REPLACE: 1,\n};\nexport default Object.freeze(Cesium3DTileRefine);\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float getPointSizeFromAttenuation(vec3 positionEC) {\\n\\\nfloat pointSize = model_pointCloudParameters.x;\\n\\\nfloat geometricError = model_pointCloudParameters.y;\\n\\\nfloat depthMultiplier = model_pointCloudParameters.z;\\n\\\nfloat depth = -positionEC.z;\\n\\\nreturn min((geometricError / depth) * depthMultiplier, pointSize);\\n\\\n}\\n\\\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\\n\\\nfloat pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\nfloat tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\nreturn float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\\n\\\nvec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\nfloat tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\nreturn getColorFromStyle(attributes, metadata, tiles3d_tileset_time);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE\\n\\\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\nfloat tiles3d_tileset_time = model_pointCloudParameters.w;\\n\\\nreturn float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));\\n\\\n}\\n\\\n#elif defined(HAS_POINT_CLOUD_ATTENUATION)\\n\\\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\\n\\\nreturn getPointSizeFromAttenuation(v_positionEC);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\\n\\\nfloat pointCloudBackFaceCullingStage() {\\n\\\n#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)\\n\\\nreturn step(-v_normalEC.z, 0.0);\\n\\\n#else\\n\\\nreturn 1.0;\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n\";\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartesian4 from \"../../Core/Cartesian4.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Cesium3DTileRefine from \"../Cesium3DTileRefine.js\";\nimport clone from \"../../Core/clone.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport OrthographicFrustum from \"../../Core/OrthographicFrustum.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport PointCloudStylingStageVS from \"../../Shaders/Model/PointCloudStylingStageVS.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst scratchUniform = new Cartesian4();\n\n/**\n * The point cloud styling stage is responsible for applying color,\n * size, and show styles to point clouds at runtime. It also handles\n * point cloud shading provided by either the model or the tileset that\n * owns it. Point cloud shading is only applied if no point size style\n * is provided.\n *\n * @namespace PointCloudStylingPipelineStage\n *\n * @private\n */\nconst PointCloudStylingPipelineStage = {\n name: \"PointCloudStylingPipelineStage\", // Helps with debugging\n};\n\n/**\n * Processes a primitive. If the model that owns it has a style, then\n * this stage modifies the following parts of the render resources:\n * <ul>\n * <li>adds the styling functions to the vertex shaders</li>\n * <li>adds a define to compute the position in world coordinates</li>\n * <li>adds a varying to compute point cloud color</li>\n * </ul>\n *\n * If the model has point cloud shading, then this stage modifies the following\n * part of the render resources:\n * <ul>\n * <li>adds vertex shader code to compute attenuation and update gl_PointSize</li>\n * <li>updates the uniform map to pass in point cloud parameters</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nPointCloudStylingPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const model = renderResources.model;\n const style = model.style;\n\n // Point cloud styling will only be applied on the GPU if there is\n // no batch table. If a batch table exists, then:\n // - the property attribute will not be defined\n // - the model will be using a feature table\n\n const structuralMetadata = model.structuralMetadata;\n const propertyAttributes = defined(structuralMetadata)\n ? structuralMetadata.propertyAttributes\n : undefined;\n\n const hasFeatureTable =\n defined(model.featureTableId) &&\n model.featureTables[model.featureTableId].featuresLength > 0;\n\n const hasBatchTable = !defined(propertyAttributes) && hasFeatureTable;\n\n if (defined(style) && !hasBatchTable) {\n const variableSubstitutionMap = getVariableSubstitutionMap(\n propertyAttributes\n );\n const shaderFunctionInfo = getStyleShaderFunctionInfo(\n style,\n variableSubstitutionMap\n );\n addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo);\n\n const propertyNames = getPropertyNames(shaderFunctionInfo);\n\n const usesNormalSemantic = propertyNames.indexOf(\"normalMC\") >= 0;\n const hasNormals = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.NORMAL\n );\n\n if (usesNormalSemantic && !hasNormals) {\n throw new RuntimeError(\n \"Style references the NORMAL semantic but the point cloud does not have normals\"\n );\n }\n\n shaderBuilder.addDefine(\n \"COMPUTE_POSITION_WC_STYLE\",\n undefined,\n ShaderDestination.VERTEX\n );\n\n // If the style is translucent, the alpha options must be adjusted.\n const styleTranslucent = shaderFunctionInfo.styleTranslucent;\n if (styleTranslucent) {\n renderResources.alphaOptions.pass = Pass.TRANSLUCENT;\n }\n }\n\n const pointCloudShading = model.pointCloudShading;\n if (pointCloudShading.attenuation) {\n shaderBuilder.addDefine(\n \"HAS_POINT_CLOUD_ATTENUATION\",\n undefined,\n ShaderDestination.VERTEX\n );\n }\n\n if (pointCloudShading.backFaceCulling) {\n shaderBuilder.addDefine(\n \"HAS_POINT_CLOUD_BACK_FACE_CULLING\",\n undefined,\n ShaderDestination.VERTEX\n );\n }\n\n let content;\n let is3DTiles;\n let usesAddRefinement;\n\n if (ModelType.is3DTiles(model.type)) {\n is3DTiles = true;\n content = model.content;\n usesAddRefinement = content.tile.refine === Cesium3DTileRefine.ADD;\n }\n\n shaderBuilder.addUniform(\n \"vec4\",\n \"model_pointCloudParameters\",\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addVertexLines(PointCloudStylingStageVS);\n\n const uniformMap = renderResources.uniformMap;\n uniformMap.model_pointCloudParameters = function () {\n const vec4 = scratchUniform;\n\n // Point size\n let defaultPointSize = 1.0;\n if (is3DTiles) {\n defaultPointSize = usesAddRefinement\n ? 5.0\n : content.tileset.maximumScreenSpaceError;\n }\n vec4.x = defaultValue(\n pointCloudShading.maximumAttenuation,\n defaultPointSize\n );\n vec4.x *= frameState.pixelRatio;\n\n // Geometric error\n const geometricError = getGeometricError(\n renderResources,\n primitive,\n pointCloudShading,\n content\n );\n vec4.y = geometricError * pointCloudShading.geometricErrorScale;\n\n const context = frameState.context;\n const frustum = frameState.camera.frustum;\n let depthMultiplier;\n\n // Attenuation is maximumAttenuation in 2D/ortho\n if (\n frameState.mode === SceneMode.SCENE2D ||\n frustum instanceof OrthographicFrustum\n ) {\n depthMultiplier = Number.POSITIVE_INFINITY;\n } else {\n depthMultiplier =\n context.drawingBufferHeight / frameState.camera.frustum.sseDenominator;\n }\n\n // Depth multiplier\n vec4.z = depthMultiplier;\n\n // Time\n if (is3DTiles) {\n vec4.w = content.tileset.timeSinceLoad;\n }\n\n return vec4;\n };\n};\n\nconst scratchDimensions = new Cartesian3();\nfunction getGeometricError(\n renderResources,\n primitive,\n pointCloudShading,\n content\n) {\n if (defined(content)) {\n const geometricError = content.tile.geometricError;\n\n if (geometricError > 0) {\n return geometricError;\n }\n }\n\n if (defined(pointCloudShading.baseResolution)) {\n return pointCloudShading.baseResolution;\n }\n\n const positionAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.POSITION\n );\n const pointsLength = positionAttribute.count;\n\n // Estimate the geometric error\n const nodeTransform = renderResources.runtimeNode.transform;\n let dimensions = Cartesian3.subtract(\n positionAttribute.max,\n positionAttribute.min,\n scratchDimensions\n );\n // dimensions is a vector, as it is a subtraction between two points\n dimensions = Matrix4.multiplyByPointAsVector(\n nodeTransform,\n dimensions,\n scratchDimensions\n );\n const volume = dimensions.x * dimensions.y * dimensions.z;\n const geometricErrorEstimate = CesiumMath.cbrt(volume / pointsLength);\n return geometricErrorEstimate;\n}\n\nconst scratchShaderFunctionInfo = {\n colorStyleFunction: undefined,\n showStyleFunction: undefined,\n pointSizeStyleFunction: undefined,\n styleTranslucent: false,\n};\n\nconst builtinVariableSubstitutionMap = {\n POSITION: \"attributes.positionMC\",\n POSITION_ABSOLUTE: \"v_positionWC\",\n COLOR: \"attributes.color_0\",\n NORMAL: \"attributes.normalMC\",\n};\n\nfunction getVariableSubstitutionMap(propertyAttributes) {\n const variableSubstitutionMap = clone(builtinVariableSubstitutionMap);\n\n if (!defined(propertyAttributes)) {\n return variableSubstitutionMap;\n }\n\n for (let i = 0; i < propertyAttributes.length; i++) {\n const propertyAttribute = propertyAttributes[i];\n const properties = propertyAttribute.properties;\n for (const propertyId in properties) {\n // The property ID was already sanitized for GLSL by PntsLoader.\n if (properties.hasOwnProperty(propertyId)) {\n variableSubstitutionMap[propertyId] = `metadata.${propertyId}`;\n }\n }\n }\n\n return variableSubstitutionMap;\n}\nconst parameterList =\n \"ProcessedAttributes attributes, \" +\n \"Metadata metadata, \" +\n \"float tiles3d_tileset_time\";\n\nfunction getStyleShaderFunctionInfo(style, variableSubstitutionMap) {\n const info = scratchShaderFunctionInfo;\n const shaderState = {\n translucent: false,\n };\n\n info.colorStyleFunction = style.getColorShaderFunction(\n `getColorFromStyle(${parameterList})`,\n variableSubstitutionMap,\n shaderState\n );\n info.showStyleFunction = style.getShowShaderFunction(\n `getShowFromStyle(${parameterList})`,\n variableSubstitutionMap,\n shaderState\n );\n info.pointSizeStyleFunction = style.getPointSizeShaderFunction(\n `getPointSizeFromStyle(${parameterList})`,\n variableSubstitutionMap,\n shaderState\n );\n info.styleTranslucent =\n defined(info.colorStyleFunction) && shaderState.translucent;\n\n return info;\n}\n\nfunction addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) {\n const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;\n if (defined(colorStyleFunction)) {\n shaderBuilder.addDefine(\n \"HAS_POINT_CLOUD_COLOR_STYLE\",\n undefined,\n ShaderDestination.BOTH\n );\n shaderBuilder.addVertexLines(colorStyleFunction);\n\n // The point cloud may not necessarily have a color attribute.\n // Use a custom varying to account for this.\n shaderBuilder.addVarying(\"vec4\", \"v_pointCloudColor\");\n }\n\n const showStyleFunction = shaderFunctionInfo.showStyleFunction;\n if (defined(showStyleFunction)) {\n shaderBuilder.addDefine(\n \"HAS_POINT_CLOUD_SHOW_STYLE\",\n undefined,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addVertexLines(showStyleFunction);\n }\n\n const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;\n if (defined(pointSizeStyleFunction)) {\n shaderBuilder.addDefine(\n \"HAS_POINT_CLOUD_POINT_SIZE_STYLE\",\n undefined,\n ShaderDestination.VERTEX\n );\n shaderBuilder.addVertexLines(pointSizeStyleFunction);\n }\n}\n\n/**\n * Gets all the built-in property names used by the given style\n * function.\n *\n * @param {Function} source The style function.\n * @param {String[]} propertyNames The array of property names to add to.\n *\n * @private\n */\nfunction getBuiltinPropertyNames(source, propertyNames) {\n const regex = /attributes\\.(\\w+)/g;\n let matches = regex.exec(source);\n while (matches !== null) {\n const name = matches[1];\n // Add the property name if it isn't already in the array.\n if (propertyNames.indexOf(name) === -1) {\n propertyNames.push(name);\n }\n matches = regex.exec(source);\n }\n}\n\nfunction getPropertyNames(shaderFunctionInfo) {\n const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;\n const showStyleFunction = shaderFunctionInfo.showStyleFunction;\n const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;\n\n // Get the properties in use by the style.\n const builtinPropertyNames = [];\n\n if (defined(colorStyleFunction)) {\n getBuiltinPropertyNames(colorStyleFunction, builtinPropertyNames);\n }\n if (defined(showStyleFunction)) {\n getBuiltinPropertyNames(showStyleFunction, builtinPropertyNames);\n }\n if (defined(pointSizeStyleFunction)) {\n getBuiltinPropertyNames(pointSizeStyleFunction, builtinPropertyNames);\n }\n\n return builtinPropertyNames;\n}\n\nexport default PointCloudStylingPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void primitiveOutlineStage() {\\n\\\nv_outlineCoordinates = a_outlineCoordinates;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void primitiveOutlineStage(inout czm_modelMaterial material) {\\n\\\nif (!model_showOutline) {\\n\\\nreturn;\\n\\\n}\\n\\\nfloat outlineX =\\n\\\ntexture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\\n\\\nfloat outlineY =\\n\\\ntexture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\\n\\\nfloat outlineZ =\\n\\\ntexture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\\n\\\nfloat outlineness = max(outlineX, max(outlineY, outlineZ));\\n\\\nmaterial.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\\n\\\n}\\n\\\n\";\n", "import AttributeType from \"../AttributeType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport PrimitiveOutlineGenerator from \"./PrimitiveOutlineGenerator.js\";\nimport PrimitiveOutlineStageVS from \"../../Shaders/Model/PrimitiveOutlineStageVS.js\";\nimport PrimitiveOutlineStageFS from \"../../Shaders/Model/PrimitiveOutlineStageFS.js\";\n\n/**\n * The primitive outline pipeline stage configures the shader to render outlines\n * from the CESIUM_primitive_outline extension.\n *\n * @namespace PrimitiveOutlinePipelineStage\n *\n * @private\n */\nconst PrimitiveOutlinePipelineStage = {\n name: \"PrimitiveOutlinePipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the following parts of the render\n * resources:\n * <ul>\n * <li>Declares a new attribute for the outline (texture) coordinates</li>\n * <li>Adds shader code to overlay outlines on the primitive after lighting computations</li>\n * <li>Add uniforms for showing the outline and changing its color</li>\n * </ul>\n * @param {PrimitiveRenderResources} renderResources The render resources for the primitive\n * @param {ModelComponents.Primitive} primitive The primitive to be rendered\n * @param {FrameState} frameState The frame state\n * @private\n */\nPrimitiveOutlinePipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n const uniformMap = renderResources.uniformMap;\n\n shaderBuilder.addDefine(\n \"HAS_PRIMITIVE_OUTLINE\",\n undefined,\n ShaderDestination.BOTH\n );\n\n shaderBuilder.addAttribute(\"vec3\", \"a_outlineCoordinates\");\n shaderBuilder.addVarying(\"vec3\", \"v_outlineCoordinates\");\n\n const outlineCoordinates = primitive.outlineCoordinates;\n const vertexAttribute = {\n index: renderResources.attributeIndex++,\n vertexBuffer: outlineCoordinates.buffer,\n componentsPerAttribute: AttributeType.getNumberOfComponents(\n outlineCoordinates.type\n ),\n componentDatatype: outlineCoordinates.componentDatatype,\n offsetInBytes: outlineCoordinates.byteOffset,\n strideInBytes: outlineCoordinates.byteStride,\n normalize: outlineCoordinates.normalized,\n };\n renderResources.attributes.push(vertexAttribute);\n\n shaderBuilder.addUniform(\n \"sampler2D\",\n \"model_outlineTexture\",\n ShaderDestination.FRAGMENT\n );\n\n // This automatically handles caching the texture on the context\n const outlineTexture = PrimitiveOutlineGenerator.createTexture(\n frameState.context\n );\n uniformMap.model_outlineTexture = function () {\n return outlineTexture;\n };\n\n const model = renderResources.model;\n shaderBuilder.addUniform(\n \"vec4\",\n \"model_outlineColor\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.model_outlineColor = function () {\n return model.outlineColor;\n };\n shaderBuilder.addUniform(\n \"bool\",\n \"model_showOutline\",\n ShaderDestination.FRAGMENT\n );\n uniformMap.model_showOutline = function () {\n return model.showOutline;\n };\n\n shaderBuilder.addVertexLines(PrimitiveOutlineStageVS);\n shaderBuilder.addFragmentLines(PrimitiveOutlineStageFS);\n};\n\nexport default PrimitiveOutlinePipelineStage;\n", "import defined from \"../../Core/defined.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport ModelUtility from \"./ModelUtility.js\";\n\n/**\n * The primitive statistics update stage updates memory usage statistics\n * on the primitive level. This counts the binary resources that exist\n * for the lifetime of the Model (e.g. attributes and textures\n * loaded by GltfLoader). It does not count resources that are created\n * every time the pipeline is run. The individual pipeline stages are\n * responsible for tracking the additional memory they allocate.\n *\n * @namespace PrimitiveStatisticsPipelineStage\n *\n * @private\n */\nconst PrimitiveStatisticsPipelineStage = {\n name: \"PrimitiveStatisticsPipelineStage\", // Helps with debugging\n\n // Expose some methods for testing\n _countGeometry: countGeometry,\n _count2DPositions: count2DPositions,\n _countMorphTargetAttributes: countMorphTargetAttributes,\n _countMaterialTextures: countMaterialTextures,\n _countFeatureIdTextures: countFeatureIdTextures,\n _countBinaryMetadata: countBinaryMetadata,\n};\n\nPrimitiveStatisticsPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const model = renderResources.model;\n const statistics = model.statistics;\n\n countGeometry(statistics, primitive);\n count2DPositions(statistics, renderResources.runtimePrimitive);\n countMorphTargetAttributes(statistics, primitive);\n countMaterialTextures(statistics, primitive.material);\n countFeatureIdTextures(statistics, primitive.featureIds);\n countBinaryMetadata(statistics, model);\n\n // The following stages handle their own memory statistics, since all their\n // resources are generated each time draw commands are built:\n //\n // - PickingPipelineStage\n // - WireframePipelineStage\n // - InstancingPipelineStage\n // - FeatureIdPipelineStage (feature ID implicit ranges only)\n};\n\nfunction countGeometry(statistics, primitive) {\n const indicesCount = defined(primitive.indices)\n ? primitive.indices.count\n : ModelUtility.getAttributeBySemantic(primitive, \"POSITION\").count;\n\n const primitiveType = primitive.primitiveType;\n\n if (primitiveType === PrimitiveType.POINTS) {\n statistics.pointsLength += indicesCount;\n } else if (PrimitiveType.isTriangles(primitiveType)) {\n statistics.trianglesLength += countTriangles(primitiveType, indicesCount);\n }\n\n const attributes = primitive.attributes;\n const length = attributes.length;\n for (let i = 0; i < length; i++) {\n const attribute = attributes[i];\n if (defined(attribute.buffer)) {\n const hasCpuCopy = defined(attribute.typedArray);\n statistics.addBuffer(attribute.buffer, hasCpuCopy);\n }\n }\n\n const outlineCoordinates = primitive.outlineCoordinates;\n if (defined(outlineCoordinates) && defined(outlineCoordinates.buffer)) {\n const hasCpuCopy = false;\n statistics.addBuffer(outlineCoordinates.buffer, hasCpuCopy);\n }\n\n const indices = primitive.indices;\n if (defined(indices) && defined(indices.buffer)) {\n // Wireframe mode will have both GPU and CPU copies\n const hasCpuCopy = defined(indices.typedArray);\n statistics.addBuffer(indices.buffer, hasCpuCopy);\n }\n}\n\nfunction countTriangles(primitiveType, indicesCount) {\n switch (primitiveType) {\n case PrimitiveType.TRIANGLES:\n return indicesCount / 3;\n case PrimitiveType.TRIANGLE_STRIP:\n case PrimitiveType.TRIANGLE_FAN:\n return Math.max(indicesCount - 2, 0);\n default:\n return 0;\n }\n}\n\nfunction count2DPositions(statistics, runtimePrimitive) {\n const buffer2D = runtimePrimitive.positionBuffer2D;\n\n // The 2D buffer is only created the first time the scene switches to 2D mode.\n // This means there's two main cases for accounting for 2D positions:\n // 1. The scene was in 3D mode so positions were never generated from\n // positionAttribute.typedArray. In this case, countGeometry() will\n // detect the typed array and set hasCpuCopy = true. No memory is counted\n // here.\n // 2. The scene was in 2D mode so positions were generated as a buffer.\n // Even though the typed array was unlinked from the attribute, it still\n // exists in the loader so we count it here.\n if (defined(buffer2D)) {\n const hasCpuCopy = true;\n statistics.addBuffer(buffer2D, hasCpuCopy);\n }\n}\n\nfunction countMorphTargetAttributes(statistics, primitive) {\n const morphTargets = primitive.morphTargets;\n if (!defined(morphTargets)) {\n return;\n }\n\n const hasCpuCopy = false;\n const morphTargetsLength = morphTargets.length;\n for (let i = 0; i < morphTargetsLength; i++) {\n const attributes = morphTargets[i].attributes;\n\n const attributesLength = attributes.length;\n for (let j = 0; j < attributesLength; j++) {\n const attribute = attributes[j];\n\n if (defined(attribute.buffer)) {\n statistics.addBuffer(attribute.buffer, hasCpuCopy);\n }\n }\n }\n}\n\nfunction countMaterialTextures(statistics, material) {\n // gltf-pipeline provides a default material so material will always be\n // defined.\n const textureReaders = getAllTextureReaders(material);\n const length = textureReaders.length;\n for (let i = 0; i < length; i++) {\n const textureReader = textureReaders[i];\n // If textures were loaded asynchronously, the texture may not be available\n // the first time this is run.\n if (defined(textureReader) && defined(textureReader.texture)) {\n statistics.addTexture(textureReader.texture);\n }\n }\n}\n\nfunction getAllTextureReaders(material) {\n const metallicRoughness = material.metallicRoughness;\n const textureReaders = [\n material.emissiveTexture,\n material.normalTexture,\n material.occlusionTexture,\n metallicRoughness.baseColorTexture,\n metallicRoughness.metallicRoughnessTexture,\n ];\n\n const specularGlossiness = material.specularGlossiness;\n if (defined(specularGlossiness)) {\n textureReaders.push(specularGlossiness.diffuseTexture);\n textureReaders.push(specularGlossiness.specularGlossinessTexture);\n }\n\n return textureReaders;\n}\n\nfunction countFeatureIdTextures(statistics, featureIdSets) {\n // Feature ID attributes are handled by countGeometry()\n\n // Feature ID implicit ranges are handled in the FeatureIdPipelineStage,\n // as they only are created as-needed.\n\n const length = featureIdSets.length;\n for (let i = 0; i < length; i++) {\n const featureIds = featureIdSets[i];\n if (featureIds instanceof ModelComponents.FeatureIdTexture) {\n const textureReader = featureIds.textureReader;\n if (defined(textureReader.texture)) {\n statistics.addTexture(textureReader.texture);\n }\n }\n }\n}\n\nfunction countBinaryMetadata(statistics, model) {\n // Add metadata memory to the statistics. Note that feature ID memory is\n // handled by the Feature ID pipeline stage.\n const structuralMetadata = model.structuralMetadata;\n if (defined(structuralMetadata)) {\n // Property textures are added to the texture memory count. If textures\n // are loaded asynchronously, this may add 0 to the total. The pipeline\n // will be re-run when textures are loaded for an accurate count.\n countPropertyTextures(statistics, structuralMetadata);\n\n // Property tables are accounted for here.\n statistics.propertyTablesByteLength +=\n structuralMetadata.propertyTablesByteLength;\n\n // Skip property attributes since those are handled in countGeometry().\n }\n\n // Model feature tables also have batch and pick textures that need to be\n // counted.\n const featureTables = model.featureTables;\n if (!defined(featureTables)) {\n return;\n }\n\n const length = featureTables.length;\n for (let i = 0; i < length; i++) {\n const featureTable = featureTables[i];\n\n // This does not include the property table memory, since\n // it is counted through the structuralMetadata above.\n statistics.addBatchTexture(featureTable.batchTexture);\n }\n}\n\nfunction countPropertyTextures(statistics, structuralMetadata) {\n const propertyTextures = structuralMetadata.propertyTextures;\n if (!defined(propertyTextures)) {\n return;\n }\n\n // Loop over the property textures from here so we can use\n // statistics.addTexture() which avoids double-counting shared textures.\n const texturesLength = propertyTextures.length;\n for (let i = 0; i < texturesLength; i++) {\n const propertyTexture = propertyTextures[i];\n const properties = propertyTexture.properties;\n for (const propertyId in properties) {\n if (properties.hasOwnProperty(propertyId)) {\n const property = properties[propertyId];\n const textureReader = property.textureReader;\n if (defined(textureReader.texture)) {\n statistics.addTexture(textureReader.texture);\n }\n }\n }\n }\n}\n\nexport default PrimitiveStatisticsPipelineStage;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport clone from \"../../Core/clone.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\n\nconst scratchModelMatrix = new Matrix4();\nconst scratchModelView2D = new Matrix4();\n\n/**\n * The scene mode 2D stage generates resources for rendering a primitive in 2D / CV mode.\n *\n * @namespace SceneMode2DPipelineStage\n *\n * @private\n */\nconst SceneMode2DPipelineStage = {\n name: \"SceneMode2DPipelineStage\", // Helps with debugging\n};\n\n/**\n * This pipeline stage processes the position attribute of a primitive and adds the relevant\n * define and uniform matrix to the shader. It also generates new resources for the primitive\n * in 2D. These resources persist in the runtime primitive so that the typed array used to\n * store the positional data can be freed.\n *\n * This stage must go before the GeometryPipelineStage in the primitive pipeline.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n * <li> creates a vertex buffer for the positions of the primitive projected to 2D\n * <li> creates the bounding sphere for the primitive in 2D\n * <li> adds a flag to the shader to use 2D positions\n * <li> adds a uniform for the view model matrix in 2D\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\n\nSceneMode2DPipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n const positionAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.POSITION\n );\n\n const shaderBuilder = renderResources.shaderBuilder;\n const model = renderResources.model;\n const modelMatrix = model.sceneGraph.computedModelMatrix;\n const nodeComputedTransform = renderResources.runtimeNode.computedTransform;\n const computedModelMatrix = Matrix4.multiplyTransformation(\n modelMatrix,\n nodeComputedTransform,\n scratchModelMatrix\n );\n\n const boundingSphere2D = computeBoundingSphere2D(\n renderResources,\n computedModelMatrix,\n frameState\n );\n\n const runtimePrimitive = renderResources.runtimePrimitive;\n runtimePrimitive.boundingSphere2D = boundingSphere2D;\n\n // If the model is instanced, 2D projection will be handled in the\n // InstancingPipelineStage.\n const instances = renderResources.runtimeNode.node.instances;\n if (defined(instances)) {\n return;\n }\n\n // If the typed array of the position attribute exists, then\n // the positions haven't been projected to 2D yet.\n if (defined(positionAttribute.typedArray)) {\n const buffer2D = createPositionBufferFor2D(\n positionAttribute,\n computedModelMatrix,\n boundingSphere2D,\n frameState\n );\n\n // Since this buffer will persist even if the pipeline is re-run,\n // its memory will be counted in PrimitiveStatisticsPipelineStage\n runtimePrimitive.positionBuffer2D = buffer2D;\n model._modelResources.push(buffer2D);\n\n // Unload the typed array. This is just a pointer to the array in\n // the vertex buffer loader, so if the typed array is shared by\n // multiple primitives (i.e. multiple instances of the same mesh),\n // this will not affect the other primitives.\n positionAttribute.typedArray = undefined;\n }\n\n shaderBuilder.addDefine(\n \"USE_2D_POSITIONS\",\n undefined,\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addUniform(\"mat4\", \"u_modelView2D\", ShaderDestination.VERTEX);\n\n const modelMatrix2D = Matrix4.fromTranslation(\n boundingSphere2D.center,\n new Matrix4()\n );\n\n const context = frameState.context;\n const uniformMap = {\n u_modelView2D: function () {\n return Matrix4.multiplyTransformation(\n context.uniformState.view,\n modelMatrix2D,\n scratchModelView2D\n );\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nconst scratchProjectedMin = new Cartesian3();\nconst scratchProjectedMax = new Cartesian3();\n\nfunction computeBoundingSphere2D(renderResources, modelMatrix, frameState) {\n // Compute the bounding sphere in 2D.\n const transformedPositionMin = Matrix4.multiplyByPoint(\n modelMatrix,\n renderResources.positionMin,\n scratchProjectedMin\n );\n\n const projectedMin = SceneTransforms.computeActualWgs84Position(\n frameState,\n transformedPositionMin,\n transformedPositionMin\n );\n\n const transformedPositionMax = Matrix4.multiplyByPoint(\n modelMatrix,\n renderResources.positionMax,\n scratchProjectedMax\n );\n\n const projectedMax = SceneTransforms.computeActualWgs84Position(\n frameState,\n transformedPositionMax,\n transformedPositionMax\n );\n\n return BoundingSphere.fromCornerPoints(\n projectedMin,\n projectedMax,\n new BoundingSphere()\n );\n}\n\nconst scratchPosition = new Cartesian3();\n\nfunction dequantizePositionsTypedArray(typedArray, quantization) {\n // Draco compression is normally handled in the dequantization stage\n // in the shader, but it must be decoded here in order to project\n // the positions to 2D / CV.\n const length = typedArray.length;\n const dequantizedArray = new Float32Array(length);\n const quantizedVolumeOffset = quantization.quantizedVolumeOffset;\n const quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;\n for (let i = 0; i < length; i += 3) {\n const initialPosition = Cartesian3.fromArray(\n typedArray,\n i,\n scratchPosition\n );\n const scaledPosition = Cartesian3.multiplyComponents(\n initialPosition,\n quantizedVolumeStepSize,\n initialPosition\n );\n const dequantizedPosition = Cartesian3.add(\n scaledPosition,\n quantizedVolumeOffset,\n scaledPosition\n );\n\n dequantizedArray[i] = dequantizedPosition.x;\n dequantizedArray[i + 1] = dequantizedPosition.y;\n dequantizedArray[i + 2] = dequantizedPosition.z;\n }\n\n return dequantizedArray;\n}\n\nfunction createPositionsTypedArrayFor2D(\n attribute,\n modelMatrix,\n referencePoint,\n frameState\n) {\n let result;\n if (defined(attribute.quantization)) {\n // Dequantize the positions if necessary.\n result = dequantizePositionsTypedArray(\n attribute.typedArray,\n attribute.quantization\n );\n } else {\n result = attribute.typedArray.slice();\n }\n\n const startIndex = attribute.byteOffset / Float32Array.BYTES_PER_ELEMENT;\n const length = result.length;\n const stride = defined(attribute.byteStride)\n ? attribute.byteStride / Float32Array.BYTES_PER_ELEMENT\n : 3;\n\n for (let i = startIndex; i < length; i += stride) {\n const initialPosition = Cartesian3.fromArray(result, i, scratchPosition);\n if (\n isNaN(initialPosition.x) ||\n isNaN(initialPosition.y) ||\n isNaN(initialPosition.z)\n ) {\n continue;\n }\n\n const transformedPosition = Matrix4.multiplyByPoint(\n modelMatrix,\n initialPosition,\n initialPosition\n );\n\n const projectedPosition = SceneTransforms.computeActualWgs84Position(\n frameState,\n transformedPosition,\n transformedPosition\n );\n\n const relativePosition = Cartesian3.subtract(\n projectedPosition,\n referencePoint,\n projectedPosition\n );\n\n result[i] = relativePosition.x;\n result[i + 1] = relativePosition.y;\n result[i + 2] = relativePosition.z;\n }\n\n return result;\n}\n\nfunction createPositionBufferFor2D(\n positionAttribute,\n modelMatrix,\n boundingSphere2D,\n frameState\n) {\n // Force the scene mode to be CV. In 2D, projected positions will have\n // an x-coordinate of 0, which eliminates the height data that is\n // necessary for rendering in CV mode.\n const frameStateCV = clone(frameState);\n frameStateCV.mode = SceneMode.COLUMBUS_VIEW;\n\n // To prevent jitter, the positions are defined relative to a common\n // reference point. For convenience, this is the center of the\n // primitive's bounding sphere in 2D.\n const referencePoint = boundingSphere2D.center;\n const projectedPositions = createPositionsTypedArrayFor2D(\n positionAttribute,\n modelMatrix,\n referencePoint,\n frameStateCV\n );\n\n // Put the resulting data in a GPU buffer.\n const buffer = Buffer.createVertexBuffer({\n context: frameState.context,\n typedArray: projectedPositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n buffer.vertexArrayDestroyable = false;\n\n return buffer;\n}\n\nexport default SceneMode2DPipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void skinningStage(inout ProcessedAttributes attributes)\\n\\\n{\\n\\\nmat4 skinningMatrix = getSkinningMatrix();\\n\\\nmat3 skinningMatrixMat3 = mat3(skinningMatrix);\\n\\\nvec4 positionMC = vec4(attributes.positionMC, 1.0);\\n\\\nattributes.positionMC = vec3(skinningMatrix * positionMC);\\n\\\n#ifdef HAS_NORMALS\\n\\\nvec3 normalMC = attributes.normalMC;\\n\\\nattributes.normalMC = skinningMatrixMat3 * normalMC;\\n\\\n#endif\\n\\\n#ifdef HAS_TANGENTS\\n\\\nvec3 tangentMC = attributes.tangentMC;\\n\\\nattributes.tangentMC = skinningMatrixMat3 * tangentMC;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport SkinningStageVS from \"../../Shaders/Model/SkinningStageVS.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\n/**\n * The skinning pipeline stage processes the joint matrices of a skinned primitive.\n *\n * @namespace SkinningPipelineStage\n *\n * @private\n */\n\nconst SkinningPipelineStage = {\n name: \"SkinningPipelineStage\", // Helps with debugging\n\n FUNCTION_ID_GET_SKINNING_MATRIX: \"getSkinningMatrix\",\n FUNCTION_SIGNATURE_GET_SKINNING_MATRIX: \"mat4 getSkinningMatrix()\",\n};\n\n/**\n * This pipeline stage processes the joint matrices of a skinned primitive, adding\n * the relevant functions and uniforms to the shaders. The joint and weight attributes\n * themselves are processed in the geometry pipeline stage.\n *\n * Processes a primitive. This stage modifies the following parts of the render resources:\n * <ul>\n * <li> adds the uniform declaration for the joint matrices in the vertex shader</li>\n * <li> adds the function to compute the skinning matrix in the vertex shader</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this primitive.\n * @param {ModelComponents.Primitive} primitive The primitive.\n * @private\n */\nSkinningPipelineStage.process = function (renderResources, primitive) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\"HAS_SKINNING\", undefined, ShaderDestination.VERTEX);\n addGetSkinningMatrixFunction(shaderBuilder, primitive);\n\n const runtimeNode = renderResources.runtimeNode;\n const jointMatrices = runtimeNode.computedJointMatrices;\n\n shaderBuilder.addUniform(\n \"mat4\",\n `u_jointMatrices[${jointMatrices.length}]`,\n ShaderDestination.VERTEX\n );\n\n shaderBuilder.addVertexLines(SkinningStageVS);\n\n const uniformMap = {\n u_jointMatrices: function () {\n return runtimeNode.computedJointMatrices;\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n};\n\nfunction getMaximumAttributeSetIndex(primitive) {\n let setIndex = -1;\n const attributes = primitive.attributes;\n const length = attributes.length;\n for (let i = 0; i < length; i++) {\n const attribute = attributes[i];\n const isJointsOrWeights =\n attribute.semantic === VertexAttributeSemantic.JOINTS ||\n attribute.semantic === VertexAttributeSemantic.WEIGHTS;\n\n if (!isJointsOrWeights) {\n continue;\n }\n\n setIndex = Math.max(setIndex, attribute.setIndex);\n }\n\n return setIndex;\n}\n\nfunction addGetSkinningMatrixFunction(shaderBuilder, primitive) {\n shaderBuilder.addFunction(\n SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n SkinningPipelineStage.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,\n ShaderDestination.VERTEX\n );\n\n const initialLine = \"mat4 skinnedMatrix = mat4(0);\";\n shaderBuilder.addFunctionLines(\n SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n [initialLine]\n );\n\n let setIndex;\n let componentIndex;\n const componentStrings = [\"x\", \"y\", \"z\", \"w\"];\n const maximumSetIndex = getMaximumAttributeSetIndex(primitive);\n for (setIndex = 0; setIndex <= maximumSetIndex; setIndex++) {\n for (componentIndex = 0; componentIndex <= 3; componentIndex++) {\n const component = componentStrings[componentIndex];\n // Example: skinnedMatrix += a_weights_0.x * u_jointMatrices[int(a_joints_0.x)];\n const line = `skinnedMatrix += a_weights_${setIndex}.${component} * u_jointMatrices[int(a_joints_${setIndex}.${component})];`;\n shaderBuilder.addFunctionLines(\n SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n [line]\n );\n }\n }\n\n const returnLine = \"return skinnedMatrix;\";\n shaderBuilder.addFunctionLines(\n SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,\n [returnLine]\n );\n}\n\nexport default SkinningPipelineStage;\n", "import defined from \"./defined.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\n/**\n * Functions for generating indices for model wireframes. The indices are\n * outputted as typed arrays, which can then be put into buffers for rendering.\n *\n * @namespace WireframeIndexGenerator\n * @private\n */\nconst WireframeIndexGenerator = {};\n\nfunction createWireframeFromTriangles(vertexCount) {\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n vertexCount * 2\n );\n const length = vertexCount;\n let index = 0;\n for (let i = 0; i < length; i += 3) {\n wireframeIndices[index++] = i;\n wireframeIndices[index++] = i + 1;\n wireframeIndices[index++] = i + 1;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = i;\n }\n\n return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleIndices(vertexCount, originalIndices) {\n const originalIndicesCount = originalIndices.length;\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n originalIndicesCount * 2\n );\n let index = 0;\n for (let i = 0; i < originalIndicesCount; i += 3) {\n const point0 = originalIndices[i];\n const point1 = originalIndices[i + 1];\n const point2 = originalIndices[i + 2];\n\n wireframeIndices[index++] = point0;\n wireframeIndices[index++] = point1;\n wireframeIndices[index++] = point1;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = point0;\n }\n\n return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleStrip(vertexCount) {\n const numberOfTriangles = vertexCount - 2;\n const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n wireframeIndicesCount\n );\n let index = 0;\n\n // Handle the first edge\n wireframeIndices[index++] = 0;\n wireframeIndices[index++] = 1;\n\n // Add two edges for every triangle in the strip\n for (let i = 0; i < numberOfTriangles; i++) {\n wireframeIndices[index++] = i + 1;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = i;\n }\n\n return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleStripIndices(vertexCount, originalIndices) {\n const originalIndicesCount = originalIndices.length;\n const numberOfTriangles = originalIndicesCount - 2;\n const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n wireframeIndicesCount\n );\n let index = 0;\n\n // Handle the first edge\n wireframeIndices[index++] = originalIndices[0];\n wireframeIndices[index++] = originalIndices[1];\n\n // Add two edges for every triangle in the strip\n for (let i = 0; i < numberOfTriangles; i++) {\n const point0 = originalIndices[i];\n const point1 = originalIndices[i + 1];\n const point2 = originalIndices[i + 2];\n\n wireframeIndices[index++] = point1;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = point0;\n }\n\n return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleFan(vertexCount) {\n const numberOfTriangles = vertexCount - 2;\n const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n wireframeIndicesCount\n );\n let index = 0;\n\n // Handle the first edge\n wireframeIndices[index++] = 0;\n wireframeIndices[index++] = 1;\n\n // Add two edges for every triangle in the fan\n for (let i = 0; i < numberOfTriangles; i++) {\n wireframeIndices[index++] = i + 1;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = i + 2;\n wireframeIndices[index++] = 0;\n }\n\n return wireframeIndices;\n}\n\nfunction createWireframeFromTriangleFanIndices(vertexCount, originalIndices) {\n const originalIndicesCount = originalIndices.length;\n const numberOfTriangles = originalIndicesCount - 2;\n const wireframeIndicesCount = 2 + numberOfTriangles * 4;\n const wireframeIndices = IndexDatatype.createTypedArray(\n vertexCount,\n wireframeIndicesCount\n );\n let index = 0;\n\n // Handle the first edge\n const firstPoint = originalIndices[0];\n wireframeIndices[index++] = firstPoint;\n wireframeIndices[index++] = originalIndices[1];\n\n // Add two edges for every triangle in the fan\n for (let i = 0; i < numberOfTriangles; i++) {\n const point1 = originalIndices[i + 1];\n const point2 = originalIndices[i + 2];\n\n wireframeIndices[index++] = point1;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = point2;\n wireframeIndices[index++] = firstPoint;\n }\n\n return wireframeIndices;\n}\n\n/**\n * Generates a wireframe index buffer for a primitive, either by reindexing the existing indices\n * or creating them from scratch if the model had none.\n *\n * @param {PrimitiveType} primitiveType The primitive type.\n * @param {Number} vertexCount The number of vertices in the primitive.\n * @param {Uint8Array|Uint16Array|Uint32Array} [originalIndices] A typed array containing the original indices of the primitive.\n *\n * @return {Uint16Array|Uint32Array} A typed array with the wireframe indices, or undefined if the primitive type does not use triangles.\n *\n * @private\n */\nWireframeIndexGenerator.createWireframeIndices = function (\n primitiveType,\n vertexCount,\n originalIndices\n) {\n const hasOriginalIndices = defined(originalIndices);\n if (primitiveType === PrimitiveType.TRIANGLES) {\n return hasOriginalIndices\n ? createWireframeFromTriangleIndices(vertexCount, originalIndices)\n : createWireframeFromTriangles(vertexCount);\n }\n\n if (primitiveType === PrimitiveType.TRIANGLE_STRIP) {\n return hasOriginalIndices\n ? createWireframeFromTriangleStripIndices(vertexCount, originalIndices)\n : createWireframeFromTriangleStrip(vertexCount);\n }\n\n if (primitiveType === PrimitiveType.TRIANGLE_FAN) {\n return hasOriginalIndices\n ? createWireframeFromTriangleFanIndices(vertexCount, originalIndices)\n : createWireframeFromTriangleFan(vertexCount);\n }\n\n return undefined;\n};\n\n/**\n * Gets the number of indices in the wireframe index buffer of a primitive type.\n *\n * @param {PrimitiveType} primitiveType The primitive type.\n * @param {Number} originalCount The original number of vertices or indices in the primitive.\n * @return {Number} The number of indices in the primitive's wireframe.\n *\n * @private\n */\nWireframeIndexGenerator.getWireframeIndicesCount = function (\n primitiveType,\n originalCount\n) {\n // For TRIANGLES, the wireframe takes every triangle (i.e. three of the original\n // indices) and turns it into lines. Each triangle has three lines, and each line\n // requires two indices, so the final count is twice the original.\n if (primitiveType === PrimitiveType.TRIANGLES) {\n return originalCount * 2;\n }\n\n // For TRIANGLE_STRIP and TRIANGLE_FAN, the number of triangles in the primitive\n // is equal to the total number of vertices minus two. This is because after the\n // first edge is specified by the first two indices, every point afterwards\n // contributes two more edges with two of the previous points, forming a new triangle.\n // Each of these edges requires two indices, so each triangle in the primitive\n // results in four indices in addition to the first two.\n if (\n primitiveType === PrimitiveType.TRIANGLE_STRIP ||\n primitiveType === PrimitiveType.TRIANGLE_FAN\n ) {\n const numberOfTriangles = originalCount - 2;\n return 2 + numberOfTriangles * 4;\n }\n\n return originalCount;\n};\n\nexport default WireframeIndexGenerator;\n", "import Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport defined from \"../../Core/defined.js\";\nimport IndexDatatype from \"../../Core/IndexDatatype.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\nimport WireframeIndexGenerator from \"../../Core/WireframeIndexGenerator.js\";\n\n/**\n * The wireframe pipeline stage generates a new index buffer for rendering the\n * structure of the mesh with gl.LINES.\n *\n * @namespace WireframePipelineStage\n * @private\n */\nconst WireframePipelineStage = {\n name: \"WireframePipelineStage\", // Helps with debugging\n};\n\n/**\n * Process a primitive. This modifies the render resources as follows:\n * <ul>\n * <li>Adds a define to the fragment shader to prevent extra shading of the lines.</li>\n * <li>Adds a separate index buffer for wireframe indices</li>\n * <li>Updates the primitive type and count for rendering with gl.LINES</li>\n * </ul>\n *\n * @param {PrimitiveRenderResources} renderResources The render resources for this node\n * @param {ModelComponents.primitive} primitive The primitive\n * @param {FrameState} frameState The frame state\n */\nWireframePipelineStage.process = function (\n renderResources,\n primitive,\n frameState\n) {\n // Applying normal mapping to the lines will result in rendering\n // errors on Linux. This define is added to disable normal\n // mapping in the shader.\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addDefine(\n \"HAS_WIREFRAME\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n\n const model = renderResources.model;\n const wireframeIndexBuffer = createWireframeIndexBuffer(\n primitive,\n renderResources.indices,\n frameState\n );\n model._pipelineResources.push(wireframeIndexBuffer);\n renderResources.wireframeIndexBuffer = wireframeIndexBuffer;\n\n // We only need to count memory for the generated buffer. In WebGL 1, the CPU\n // copy of the original indices is already counted in the geometry stage,\n // and in WebGL 2, the CPU copy of the original indices (generated from the\n // data of the original buffer) is discarded after generating the wireframe\n // indices.\n const hasCpuCopy = false;\n model.statistics.addBuffer(wireframeIndexBuffer, hasCpuCopy);\n\n // Update render resources so we render LINES with the correct index count\n const originalPrimitiveType = renderResources.primitiveType;\n const originalCount = renderResources.count;\n renderResources.primitiveType = PrimitiveType.LINES;\n renderResources.count = WireframeIndexGenerator.getWireframeIndicesCount(\n originalPrimitiveType,\n originalCount\n );\n};\n\nfunction createWireframeIndexBuffer(primitive, indices, frameState) {\n const positionAttribute = ModelUtility.getAttributeBySemantic(\n primitive,\n VertexAttributeSemantic.POSITION\n );\n const vertexCount = positionAttribute.count;\n const webgl2 = frameState.context.webgl2;\n\n let originalIndices;\n if (defined(indices)) {\n const indicesBuffer = indices.buffer;\n const indicesCount = indices.count;\n if (defined(indicesBuffer) && webgl2) {\n const useUint8Array = indicesBuffer.sizeInBytes === indicesCount;\n originalIndices = useUint8Array\n ? new Uint8Array(indicesCount)\n : IndexDatatype.createTypedArray(vertexCount, indicesCount);\n\n indicesBuffer.getBufferData(originalIndices);\n } else {\n originalIndices = indices.typedArray;\n }\n }\n\n const primitiveType = primitive.primitiveType;\n const wireframeIndices = WireframeIndexGenerator.createWireframeIndices(\n primitiveType,\n vertexCount,\n originalIndices\n );\n const indexDatatype = IndexDatatype.fromSizeInBytes(\n wireframeIndices.BYTES_PER_ELEMENT\n );\n\n return Buffer.createIndexBuffer({\n context: frameState.context,\n typedArray: wireframeIndices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: indexDatatype,\n });\n}\n\nexport default WireframePipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport AlphaPipelineStage from \"./AlphaPipelineStage.js\";\nimport BatchTexturePipelineStage from \"./BatchTexturePipelineStage.js\";\nimport ClassificationPipelineStage from \"./ClassificationPipelineStage.js\";\nimport CPUStylingPipelineStage from \"./CPUStylingPipelineStage.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport CustomShaderPipelineStage from \"./CustomShaderPipelineStage.js\";\nimport DequantizationPipelineStage from \"./DequantizationPipelineStage.js\";\nimport FeatureIdPipelineStage from \"./FeatureIdPipelineStage.js\";\nimport GeometryPipelineStage from \"./GeometryPipelineStage.js\";\nimport LightingPipelineStage from \"./LightingPipelineStage.js\";\nimport MaterialPipelineStage from \"./MaterialPipelineStage.js\";\nimport MetadataPipelineStage from \"./MetadataPipelineStage.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport MorphTargetsPipelineStage from \"./MorphTargetsPipelineStage.js\";\nimport PickingPipelineStage from \"./PickingPipelineStage.js\";\nimport PointCloudStylingPipelineStage from \"./PointCloudStylingPipelineStage.js\";\nimport PrimitiveOutlinePipelineStage from \"./PrimitiveOutlinePipelineStage.js\";\nimport PrimitiveStatisticsPipelineStage from \"./PrimitiveStatisticsPipelineStage.js\";\nimport SceneMode2DPipelineStage from \"./SceneMode2DPipelineStage.js\";\nimport SelectedFeatureIdPipelineStage from \"./SelectedFeatureIdPipelineStage.js\";\nimport SkinningPipelineStage from \"./SkinningPipelineStage.js\";\nimport WireframePipelineStage from \"./WireframePipelineStage.js\";\n\n/**\n * In memory representation of a single primitive, that is, a primitive\n * and its corresponding mesh.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.Primitive} options.primitive The primitive component.\n * @param {ModelComponents.Node} options.node The node that this primitive belongs to.\n * @param {Model} options.model The {@link Model} this primitive belongs to.\n *\n * @alias ModelRuntimePrimitive\n * @constructor\n *\n * @private\n */\nfunction ModelRuntimePrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const primitive = options.primitive;\n const node = options.node;\n const model = options.model;\n /**\n * The primitive component associated with this primitive.\n *\n * @type {ModelComponents.Primitive}\n *\n * @private\n */\n this.primitive = primitive;\n\n /**\n * A reference to the node this primitive belongs to.\n *\n * @type {ModelComponents.Node}\n *\n * @private\n */\n this.node = node;\n\n /**\n * A reference to the model\n *\n * @type {Model}\n *\n * @private\n */\n this.model = model;\n\n /**\n * Pipeline stages to apply to this primitive. This\n * is an array of classes, each with a static method called\n * <code>process()</code>\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.pipelineStages = [];\n\n /**\n * The generated {@link ModelDrawCommand} or {@link ClassificationModelDrawCommand}\n * associated with this primitive.\n *\n * @type {ModelDrawCommand|ClassificationModelDrawCommand}\n *\n * @private\n */\n this.drawCommand = undefined;\n\n /**\n * The bounding sphere of this primitive in object-space.\n *\n * @type {BoundingSphere}\n *\n * @private\n */\n this.boundingSphere = undefined;\n\n /**\n * The bounding sphere of this primitive in 2D world space.\n *\n * @type {BoundingSphere}\n *\n * @private\n */\n this.boundingSphere2D = undefined;\n\n /**\n * A buffer containing the primitive's positions projected to 2D world\n * coordinates. This is generated by SceneMode2DPipelineStage and used for\n * rendering in 2D / CV mode. The memory is managed by Model; this is just\n * a reference.\n *\n * @type {Buffer}\n *\n * @private\n */\n this.positionBuffer2D = undefined;\n\n /**\n * An array containing the lengths of the vertex batches for classification.\n * Vertices with the same feature ID are batched together, and each batch is\n * drawn with a different draw command in order to properly classify other\n * assets.\n * <p>\n * This is generated by ClassificationPipelineStage. The memory is managed by\n * Model; this is just a reference.\n * </p>\n *\n * @type {Number[]}\n *\n * @private\n */\n this.batchLengths = undefined;\n\n /**\n * An array containing the offsets of the vertex batches for classification.\n * Vertices with the same feature ID are batched together, and each batch is\n * drawn with a different draw command in order to properly classify other\n * assets.\n * <p>\n * This is generated by ClassificationPipelineStage. The memory is managed by\n * Model; this is just a reference.\n * </p>\n *\n * @type {Number[]}\n *\n * @private\n */\n this.batchOffsets = undefined;\n\n /**\n * Update stages to apply to this primitive.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.updateStages = [];\n}\n\n/**\n * Configure the primitive pipeline stages. If the pipeline needs to be re-run,\n * call this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelRuntimePrimitive.prototype.configurePipeline = function (frameState) {\n const pipelineStages = this.pipelineStages;\n pipelineStages.length = 0;\n\n const primitive = this.primitive;\n const node = this.node;\n const model = this.model;\n\n const customShader = model.customShader;\n const style = model.style;\n\n const useWebgl2 = frameState.context.webgl2;\n const mode = frameState.mode;\n const use2D =\n mode !== SceneMode.SCENE3D && !frameState.scene3DOnly && model._projectTo2D;\n\n const hasMorphTargets =\n defined(primitive.morphTargets) && primitive.morphTargets.length > 0;\n const hasSkinning = defined(node.skin);\n const hasCustomShader = defined(customShader);\n const hasCustomFragmentShader =\n hasCustomShader && defined(customShader.fragmentShaderText);\n const materialsEnabled =\n !hasCustomFragmentShader ||\n customShader.mode !== CustomShaderMode.REPLACE_MATERIAL;\n const hasQuantization = ModelUtility.hasQuantizedAttributes(\n primitive.attributes\n );\n const generateWireframeIndices =\n model.debugWireframe &&\n PrimitiveType.isTriangles(primitive.primitiveType) &&\n // Generating index buffers for wireframes is always possible in WebGL2.\n // However, this will only work in WebGL1 if the model was constructed with\n // enableDebugWireframe set to true.\n (model._enableDebugWireframe || useWebgl2);\n\n const pointCloudShading = model.pointCloudShading;\n const hasAttenuation =\n defined(pointCloudShading) && pointCloudShading.attenuation;\n const hasPointCloudBackFaceCulling =\n defined(pointCloudShading) && pointCloudShading.backFaceCulling;\n const hasPointCloudStyle =\n primitive.primitiveType === PrimitiveType.POINTS &&\n (defined(style) || hasAttenuation || hasPointCloudBackFaceCulling);\n\n const hasOutlines =\n model._enableShowOutline && defined(primitive.outlineCoordinates);\n\n const featureIdFlags = inspectFeatureIds(model, node, primitive);\n\n const hasClassification = defined(model.classificationType);\n\n // Start of pipeline -----------------------------------------------------\n if (use2D) {\n pipelineStages.push(SceneMode2DPipelineStage);\n }\n\n pipelineStages.push(GeometryPipelineStage);\n\n if (generateWireframeIndices) {\n pipelineStages.push(WireframePipelineStage);\n }\n\n if (hasClassification) {\n pipelineStages.push(ClassificationPipelineStage);\n }\n\n if (hasMorphTargets) {\n pipelineStages.push(MorphTargetsPipelineStage);\n }\n\n if (hasSkinning) {\n pipelineStages.push(SkinningPipelineStage);\n }\n\n if (hasPointCloudStyle) {\n pipelineStages.push(PointCloudStylingPipelineStage);\n }\n\n if (hasQuantization) {\n pipelineStages.push(DequantizationPipelineStage);\n }\n\n if (materialsEnabled) {\n pipelineStages.push(MaterialPipelineStage);\n }\n\n // These stages are always run to ensure structs\n // are declared to avoid compilation errors.\n pipelineStages.push(FeatureIdPipelineStage);\n pipelineStages.push(MetadataPipelineStage);\n\n if (featureIdFlags.hasPropertyTable) {\n pipelineStages.push(SelectedFeatureIdPipelineStage);\n pipelineStages.push(BatchTexturePipelineStage);\n pipelineStages.push(CPUStylingPipelineStage);\n }\n\n if (hasCustomShader) {\n pipelineStages.push(CustomShaderPipelineStage);\n }\n\n pipelineStages.push(LightingPipelineStage);\n\n if (model.allowPicking) {\n pipelineStages.push(PickingPipelineStage);\n }\n\n if (hasOutlines) {\n pipelineStages.push(PrimitiveOutlinePipelineStage);\n }\n\n pipelineStages.push(AlphaPipelineStage);\n\n pipelineStages.push(PrimitiveStatisticsPipelineStage);\n\n return;\n};\n\nfunction inspectFeatureIds(model, node, primitive) {\n let featureIds;\n // Check instances first, as this is the most specific type of\n // feature ID\n if (defined(node.instances)) {\n featureIds = ModelUtility.getFeatureIdsByLabel(\n node.instances.featureIds,\n model.instanceFeatureIdLabel\n );\n\n if (defined(featureIds)) {\n return {\n hasFeatureIds: true,\n hasPropertyTable: defined(featureIds.propertyTableId),\n };\n }\n }\n\n featureIds = ModelUtility.getFeatureIdsByLabel(\n primitive.featureIds,\n model.featureIdLabel\n );\n if (defined(featureIds)) {\n return {\n hasFeatureIds: true,\n hasPropertyTable: defined(featureIds.propertyTableId),\n };\n }\n\n return {\n hasFeatureIds: false,\n hasPropertyTable: false,\n };\n}\n\nexport default ModelRuntimePrimitive;\n", "import Matrix4 from \"../../Core/Matrix4.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\n\n/**\n * An in-memory representation of a skin that affects nodes in the {@link ModelSceneGraph}.\n * Skins should only be initialized after all of the {@link ModelRuntimeNode}s have been instantiated\n * by the scene graph.\n *\n * @param {Object} options An object containing the following options:\n * @param {ModelComponents.Skin} options.skin The corresponding skin components from the 3D model\n * @param {ModelSceneGraph} options.sceneGraph The scene graph this skin belongs to.\n *\n * @alias ModelSkin\n * @constructor\n *\n * @private\n */\nfunction ModelSkin(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._sceneGraph = options.sceneGraph;\n const skin = options.skin;\n\n this._skin = skin;\n\n this._inverseBindMatrices = undefined;\n this._joints = [];\n this._jointMatrices = [];\n\n initialize(this);\n}\n\nObject.defineProperties(ModelSkin.prototype, {\n /**\n * The internal skin this runtime skin represents.\n *\n * @memberof ModelSkin.prototype\n * @type {ModelComponents.Skin}\n * @readonly\n *\n * @private\n */\n skin: {\n get: function () {\n return this._skin;\n },\n },\n\n /**\n * The scene graph this skin belongs to.\n *\n * @memberof ModelSkin.prototype\n * @type {ModelSceneGraph}\n * @readonly\n *\n * @private\n */\n sceneGraph: {\n get: function () {\n return this._sceneGraph;\n },\n },\n\n /**\n * The inverse bind matrices of the skin.\n *\n * @memberof ModelSkin.prototype\n * @type {Matrix4[]}\n * @readonly\n *\n * @private\n */\n inverseBindMatrices: {\n get: function () {\n return this._inverseBindMatrices;\n },\n },\n\n /**\n * The joints of the skin.\n *\n * @memberof ModelSkin.prototype\n * @type {ModelRuntimeNode[]}\n * @readonly\n *\n * @private\n */\n joints: {\n get: function () {\n return this._joints;\n },\n },\n\n /**\n * The joint matrices for the skin, where each joint matrix is computed as\n * jointMatrix = jointWorldTransform * inverseBindMatrix.\n *\n * Each node that references this skin is responsible for pre-multiplying its inverse\n * world transform to the joint matrices for its own use.\n *\n * @memberof ModelSkin.prototype\n * @type {Matrix4[]}\n * @readonly\n *\n * @private\n */\n jointMatrices: {\n get: function () {\n return this._jointMatrices;\n },\n },\n});\n\nfunction initialize(runtimeSkin) {\n const skin = runtimeSkin.skin;\n const inverseBindMatrices = skin.inverseBindMatrices;\n runtimeSkin._inverseBindMatrices = inverseBindMatrices;\n\n const joints = skin.joints;\n const length = joints.length;\n\n const runtimeNodes = runtimeSkin.sceneGraph._runtimeNodes;\n const runtimeJoints = runtimeSkin.joints;\n const runtimeJointMatrices = runtimeSkin._jointMatrices;\n for (let i = 0; i < length; i++) {\n const jointIndex = joints[i].index;\n const runtimeNode = runtimeNodes[jointIndex];\n runtimeJoints.push(runtimeNode);\n\n const inverseBindMatrix = inverseBindMatrices[i];\n const jointMatrix = computeJointMatrix(\n runtimeNode,\n inverseBindMatrix,\n new Matrix4()\n );\n runtimeJointMatrices.push(jointMatrix);\n }\n}\n\nfunction computeJointMatrix(joint, inverseBindMatrix, result) {\n const jointWorldTransform = Matrix4.multiplyTransformation(\n joint.transformToRoot,\n joint.transform,\n result\n );\n\n result = Matrix4.multiplyTransformation(\n jointWorldTransform,\n inverseBindMatrix,\n result\n );\n\n return result;\n}\n\n/**\n * Updates the joint matrices for the skin.\n *\n * @private\n */\nModelSkin.prototype.updateJointMatrices = function () {\n const jointMatrices = this._jointMatrices;\n const length = jointMatrices.length;\n for (let i = 0; i < length; i++) {\n const joint = this.joints[i];\n const inverseBindMatrix = this.inverseBindMatrices[i];\n jointMatrices[i] = computeJointMatrix(\n joint,\n inverseBindMatrix,\n jointMatrices[i]\n );\n }\n};\n\nexport default ModelSkin;\n", "/**\n * Options for configuring the {@link AlphaPipelineStage}\n *\n * @alias ModelAlphaOptions\n * @constructor\n *\n * @private\n */\nfunction ModelAlphaOptions() {\n /**\n * Which render pass will render the model.\n *\n * @type {Pass}\n * @private\n */\n this.pass = undefined;\n /**\n * Determines the alpha threshold below which fragments are discarded\n *\n * @type {Number}\n * @private\n */\n this.alphaCutoff = undefined;\n}\n\nexport default ModelAlphaOptions;\n", "/**\n * A utility for dynamically-generating a GLSL struct.\n *\n * @alias ShaderStruct\n * @constructor\n *\n * @see {@link ShaderBuilder}\n * @param {String} name The name of the struct as it will appear in the shader.\n * @example\n * // Generate the struct:\n * //\n * // struct Attributes\n * // {\n * // vec3 position;\n * // vec3 normal;\n * // vec2 texCoord;\n * // };\n * const struct = new ShaderStruct(\"Attributes\");\n * struct.addField(\"vec3\", \"position\");\n * struct.addField(\"vec3\", \"normal\");\n * struct.addField(\"vec2\", \"texCoord\");\n * const generatedLines = struct.generateGlslLines();\n *\n * @private\n */\nfunction ShaderStruct(name) {\n this.name = name;\n this.fields = [];\n}\n\n/**\n * Add a field to the struct\n * @param {String} type The type of the struct field\n * @param {String} identifier The identifier of the struct field\n */\nShaderStruct.prototype.addField = function (type, identifier) {\n const field = ` ${type} ${identifier};`;\n this.fields.push(field);\n};\n\n/**\n * Generate a list of lines of GLSL code for use with {@link ShaderBuilder}\n * @return {String[]} The generated GLSL code.\n */\nShaderStruct.prototype.generateGlslLines = function () {\n let fields = this.fields;\n if (fields.length === 0) {\n // GLSL requires structs to have at least one field\n fields = [\" float _empty;\"];\n }\n\n return [].concat(`struct ${this.name}`, \"{\", fields, \"};\");\n};\n\nexport default ShaderStruct;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A utility for dynamically-generating a GLSL function\n *\n * @alias ShaderFunction\n * @constructor\n *\n * @see {@link ShaderBuilder}\n * @param {String} signature The full signature of the function as it will appear in the shader. Do not include the curly braces.\n * @example\n * // generate the following function\n * //\n * // void assignVaryings(vec3 position)\n * // {\n * // v_positionEC = (czm_modelView * vec4(a_position, 1.0)).xyz;\n * // v_texCoord = a_texCoord;\n * // }\n * const signature = \"void assignVaryings(vec3 position)\";\n * const func = new ShaderFunction(signature);\n * func.addLine(\"v_positionEC = (czm_modelView * vec4(a_position, 1.0)).xyz;\");\n * func.addLine(\"v_texCoord = a_texCoord;\");\n * const generatedLines = func.generateGlslLines();\n *\n * @private\n */\nfunction ShaderFunction(signature) {\n this.signature = signature;\n this.body = [];\n}\n\n/**\n * Adds one or more lines to the body of the function\n * @param {String|String[]} lines One or more lines of GLSL code to add to the function body. Do not include any preceding or ending whitespace, but do include the semicolon for each line.\n */\nShaderFunction.prototype.addLines = function (lines) {\nconst body = this.body;\n\n // Indent the body of the function by 4 spaces\n if (Array.isArray(lines)) {\n const length = lines.length;\n for (let i = 0; i < length; i++) {\n body.push(` ${lines[i]}`);\n }\n } else {\n // Single string case\n body.push(` ${lines}`);\n }\n};\n\n/**\n * Generate lines of GLSL code for use with {@link ShaderBuilder}\n * @return {String[]}\n */\nShaderFunction.prototype.generateGlslLines = function () {\n return [].concat(this.signature, \"{\", this.body, \"}\");\n};\n\nexport default ShaderFunction;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport ShaderDestination from \"./ShaderDestination.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport ShaderSource from \"./ShaderSource.js\";\nimport ShaderStruct from \"./ShaderStruct.js\";\nimport ShaderFunction from \"./ShaderFunction.js\";\n\n/**\n * An object that makes it easier to build the text of a {@link ShaderProgram}. This tracks GLSL code for both the vertex shader and the fragment shader.\n * <p>\n * For vertex shaders, the shader builder tracks a list of <code>#defines</code>,\n * a list of attributes, a list of uniforms, and a list of shader lines. It also\n * tracks the location of each attribute so the caller can easily build the {@link VertexArray}\n * </p>\n * <p>\n * For fragment shaders, the shader builder tracks a list of <code>#defines</code>,\n * a list of attributes, a list of uniforms, and a list of shader lines.\n * </p>\n *\n * @alias ShaderBuilder\n * @constructor\n *\n * @example\n * const shaderBuilder = new ShaderBuilder();\n * shaderBuilder.addDefine(\"SOLID_COLOR\", undefined, ShaderDestination.FRAGMENT);\n * shaderBuilder.addUniform(\"vec3\", \"u_color\", ShaderDestination.FRAGMENT);\n * shaderBuilder.addVarying(\"vec3\", v_color\");\n * // These locations can be used when creating the VertexArray\n * const positionLocation = shaderBuilder.addPositionAttribute(\"vec3\", \"a_position\");\n * const colorLocation = shaderBuilder.addAttribute(\"vec3\", \"a_color\");\n * shaderBuilder.addVertexLines([\n * \"void main()\",\n * \"{\",\n * \" v_color = a_color;\",\n * \" gl_Position = vec4(a_position, 1.0);\",\n * \"}\"\n * ]);\n * shaderBuilder.addFragmentLines([\n * \"void main()\",\n * \"{\",\n * \" #ifdef SOLID_COLOR\",\n * \" gl_FragColor = vec4(u_color, 1.0);\",\n * \" #else\",\n * \" gl_FragColor = vec4(v_color, 1.0);\",\n * \" #endif\",\n * \"}\"\n * ]);\n * const shaderProgram = shaderBuilder.build(context);\n *\n * @private\n */\nfunction ShaderBuilder() {\n // Some WebGL implementations require attribute 0 to always\n // be active, so the position attribute is tracked separately\n this._positionAttributeLine = undefined;\n this._nextAttributeLocation = 1;\n this._attributeLocations = {};\n this._attributeLines = [];\n\n // Dynamically-generated structs and functions\n // these are dictionaries of id -> ShaderStruct or ShaderFunction respectively\n this._structs = {};\n this._functions = {};\n\n this._vertexShaderParts = {\n defineLines: [],\n uniformLines: [],\n shaderLines: [],\n varyingLines: [],\n // identifiers of structs/functions to include, listed in insertion order\n structIds: [],\n functionIds: [],\n };\n this._fragmentShaderParts = {\n defineLines: [],\n uniformLines: [],\n shaderLines: [],\n varyingLines: [],\n // identifiers of structs/functions to include, listed in insertion order\n structIds: [],\n functionIds: [],\n };\n}\n\nObject.defineProperties(ShaderBuilder.prototype, {\n /**\n * Get a dictionary of attribute names to the integer location in\n * the vertex shader.\n *\n * @memberof ShaderBuilder.prototype\n * @type {Object.<String, Number>}\n * @readonly\n * @private\n */\n attributeLocations: {\n get: function () {\n return this._attributeLocations;\n },\n },\n});\n\n/**\n * Add a <code>#define</code> macro to one or both of the shaders. These lines\n * will appear at the top of the final shader source.\n *\n * @param {String} identifier An identifier for the macro. Identifiers must use uppercase letters with underscores to be consistent with Cesium's style guide.\n * @param {String} [value] The value of the macro. If undefined, the define will not include a value. The value will be converted to GLSL code via <code>toString()</code>\n * @param {ShaderDestination} [destination=ShaderDestination.BOTH] Whether the define appears in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // creates the line \"#define ENABLE_LIGHTING\" in both shaders\n * shaderBuilder.addDefine(\"ENABLE_LIGHTING\");\n * // creates the line \"#define PI 3.141592\" in the fragment shader\n * shaderBuilder.addDefine(\"PI\", 3.141593, ShaderDestination.FRAGMENT);\n */\nShaderBuilder.prototype.addDefine = function (identifier, value, destination) {\n destination = defaultValue(destination, ShaderDestination.BOTH);\n\n // The ShaderSource created in build() will add the #define part\n let line = identifier;\n if (defined(value)) {\n line += ` ${value.toString()}`;\n }\n\n if (ShaderDestination.includesVertexShader(destination)) {\n this._vertexShaderParts.defineLines.push(line);\n }\n\n if (ShaderDestination.includesFragmentShader(destination)) {\n this._fragmentShaderParts.defineLines.push(line);\n }\n};\n\n/**\n * Add a new dynamically-generated struct to the shader\n * @param {String} structId A unique ID to identify this struct in {@link ShaderBuilder#addStructField}\n * @param {String} structName The name of the struct as it will appear in the shader.\n * @param {ShaderDestination} destination Whether the struct will appear in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // generates the following struct in the fragment shader\n * // struct TestStruct\n * // {\n * // };\n * shaderBuilder.addStruct(\"testStructId\", \"TestStruct\", ShaderDestination.FRAGMENT);\n */\nShaderBuilder.prototype.addStruct = function (\n structId,\n structName,\n destination\n) {\nthis._structs[structId] = new ShaderStruct(structName);\n if (ShaderDestination.includesVertexShader(destination)) {\n this._vertexShaderParts.structIds.push(structId);\n }\n\n if (ShaderDestination.includesFragmentShader(destination)) {\n this._fragmentShaderParts.structIds.push(structId);\n }\n};\n\n/**\n * Add a field to a dynamically-generated struct.\n * @param {String} structId The ID of the struct. This must be created first with {@link ShaderBuilder#addStruct}\n * @param {String} type The GLSL type of the field\n * @param {String} identifier The identifier of the field.\n *\n * @example\n * // generates the following struct in the fragment shader\n * // struct TestStruct\n * // {\n * // float minimum;\n * // float maximum;\n * // };\n * shaderBuilder.addStruct(\"testStructId\", \"TestStruct\", ShaderDestination.FRAGMENT);\n * shaderBuilder.addStructField(\"testStructId\", \"float\", \"maximum\");\n * shaderBuilder.addStructField(\"testStructId\", \"float\", \"minimum\");\n */\nShaderBuilder.prototype.addStructField = function (structId, type, identifier) {\nthis._structs[structId].addField(type, identifier);\n};\n\n/**\n * Add a new dynamically-generated function to the shader.\n * @param {String} functionName The name of the function. This will be used to identify the function in {@link ShaderBuilder#addFunctionLines}.\n * @param {String} signature The full signature of the function as it will appear in the shader. Do not include the curly braces.\n * @param {ShaderDestination} destination Whether the struct will appear in the vertex shader, the fragment shader, or both.\n * @example\n * // generates the following function in the vertex shader\n * // vec3 testFunction(float parameter)\n * // {\n * // }\n * shaderBuilder.addStruct(\"testFunction\", \"vec3 testFunction(float parameter)\", ShaderDestination.VERTEX);\n */\nShaderBuilder.prototype.addFunction = function (\n functionName,\n signature,\n destination\n) {\nthis._functions[functionName] = new ShaderFunction(signature);\n\n if (ShaderDestination.includesVertexShader(destination)) {\n this._vertexShaderParts.functionIds.push(functionName);\n }\n\n if (ShaderDestination.includesFragmentShader(destination)) {\n this._fragmentShaderParts.functionIds.push(functionName);\n }\n};\n\n/**\n * Add lines to a dynamically-generated function\n * @param {String} functionName The name of the function. This must be created beforehand using {@link ShaderBuilder#addFunction}\n * @param {String|String[]} lines One or more lines of GLSL code to add to the function body. Do not include any preceding or ending whitespace, but do include the semicolon for each line.\n *\n * @example\n * // generates the following function in the vertex shader\n * // vec3 testFunction(float parameter)\n * // {\n * // float signed = 2.0 * parameter - 1.0;\n * // return vec3(signed, 0.0, 0.0);\n * // }\n * shaderBuilder.addStruct(\"testFunction\", \"vec3 testFunction(float parameter)\", ShaderDestination.VERTEX);\n * shaderBuilder.addFunctionLines(\"testFunction\", [\n * \"float signed = 2.0 * parameter - 1.0;\",\n * \"return vec3(parameter);\"\n * ]);\n */\nShaderBuilder.prototype.addFunctionLines = function (functionName, lines) {\nthis._functions[functionName].addLines(lines);\n};\n\n/**\n * Add a uniform declaration to one or both of the shaders. These lines\n * will appear grouped near the top of the final shader source.\n *\n * @param {String} type The GLSL type of the uniform.\n * @param {String} identifier An identifier for the uniform. Identifiers must begin with <code>u_</code> to be consistent with Cesium's style guide.\n * @param {ShaderDestination} [destination=ShaderDestination.BOTH] Whether the uniform appears in the vertex shader, the fragment shader, or both.\n *\n * @example\n * // creates the line \"uniform vec3 u_resolution;\"\n * shaderBuilder.addUniform(\"vec3\", \"u_resolution\", ShaderDestination.FRAGMENT);\n * // creates the line \"uniform float u_time;\" in both shaders\n * shaderBuilder.addUniform(\"float\", \"u_time\", ShaderDestination.BOTH);\n */\nShaderBuilder.prototype.addUniform = function (type, identifier, destination) {\n destination = defaultValue(destination, ShaderDestination.BOTH);\n const line = `uniform ${type} ${identifier};`;\n\n if (ShaderDestination.includesVertexShader(destination)) {\n this._vertexShaderParts.uniformLines.push(line);\n }\n\n if (ShaderDestination.includesFragmentShader(destination)) {\n this._fragmentShaderParts.uniformLines.push(line);\n }\n};\n\n/**\n * Add a position attribute declaration to the vertex shader. These lines\n * will appear grouped near the top of the final shader source.\n * <p>\n * Some WebGL implementations require attribute 0 to be enabled, so this is\n * reserved for the position attribute. For all other attributes, see\n * {@link ShaderBuilder#addAttribute}\n * </p>\n *\n * @param {String} type The GLSL type of the attribute\n * @param {String} identifier An identifier for the attribute. Identifiers must begin with <code>a_</code> to be consistent with Cesium's style guide.\n * @return {Number} The integer location of the attribute. This location can be used when creating attributes for a {@link VertexArray}. This will always be 0.\n *\n * @example\n * // creates the line \"attribute vec3 a_position;\"\n * shaderBuilder.setPositionAttribute(\"vec3\", \"a_position\");\n */\nShaderBuilder.prototype.setPositionAttribute = function (type, identifier) {\n this._positionAttributeLine = `attribute ${type} ${identifier};`;\n\n // Some WebGL implementations require attribute 0 to always be active, so\n // this builder assumes the position will always go in location 0\n this._attributeLocations[identifier] = 0;\n return 0;\n};\n\n/**\n * Add an attribute declaration to the vertex shader. These lines\n * will appear grouped near the top of the final shader source.\n * <p>\n * Some WebGL implementations require attribute 0 to be enabled, so this is\n * reserved for the position attribute. See {@link ShaderBuilder#setPositionAttribute}\n * </p>\n *\n * @param {String} type The GLSL type of the attribute\n * @param {String} identifier An identifier for the attribute. Identifiers must begin with <code>a_</code> to be consistent with Cesium's style guide.\n * @return {Number} The integer location of the attribute. This location can be used when creating attributes for a {@link VertexArray}\n *\n * @example\n * // creates the line \"attribute vec2 a_texCoord0;\" in the vertex shader\n * shaderBuilder.addAttribute(\"vec2\", \"a_texCoord0\");\n */\nShaderBuilder.prototype.addAttribute = function (type, identifier) {\n const line = `attribute ${type} ${identifier};`;\n this._attributeLines.push(line);\n\n const location = this._nextAttributeLocation;\n this._attributeLocations[identifier] = location;\n\n // Most attributes only require a single attribute location, but matrices\n // require more.\n this._nextAttributeLocation += getAttributeLocationCount(type);\n return location;\n};\n\n/**\n * Add a varying declaration to both the vertex and fragment shaders.\n *\n * @param {String} type The GLSL type of the varying\n * @param {String} identifier An identifier for the varying. Identifiers must begin with <code>v_</code> to be consistent with Cesium's style guide.\n *\n * @example\n * // creates the line \"varying vec3 v_color;\" in both shaders\n * shaderBuilder.addVarying(\"vec3\", \"v_color\");\n */\nShaderBuilder.prototype.addVarying = function (type, identifier) {\n const line = `varying ${type} ${identifier};`;\n this._vertexShaderParts.varyingLines.push(line);\n this._fragmentShaderParts.varyingLines.push(line);\n};\n\n/**\n * Appends lines of GLSL code to the vertex shader\n *\n * @param {String|String[]} lines One or more lines to add to the end of the vertex shader source\n *\n * @example\n * shaderBuilder.addVertexLines([\n * \"void main()\",\n * \"{\",\n * \" v_color = a_color;\",\n * \" gl_Position = vec4(a_position, 1.0);\",\n * \"}\"\n * ]);\n */\nShaderBuilder.prototype.addVertexLines = function (lines) {\n const vertexLines = this._vertexShaderParts.shaderLines;\n if (Array.isArray(lines)) {\n vertexLines.push.apply(vertexLines, lines);\n } else {\n // Single string case\n vertexLines.push(lines);\n }\n};\n\n/**\n * Appends lines of GLSL code to the fragment shader\n *\n * @param {String[]} lines The lines to add to the end of the fragment shader source\n *\n * @example\n * shaderBuilder.addFragmentLines([\n * \"void main()\",\n * \"{\",\n * \" #ifdef SOLID_COLOR\",\n * \" gl_FragColor = vec4(u_color, 1.0);\",\n * \" #else\",\n * \" gl_FragColor = vec4(v_color, 1.0);\",\n * \" #endif\",\n * \"}\"\n * ]);\n */\nShaderBuilder.prototype.addFragmentLines = function (lines) {\n const fragmentLines = this._fragmentShaderParts.shaderLines;\n if (Array.isArray(lines)) {\n fragmentLines.push.apply(fragmentLines, lines);\n } else {\n // Single string case\n fragmentLines.push(lines);\n }\n};\n\n/**\n * Builds the {@link ShaderProgram} from the pieces added by the other methods.\n * Call this one time at the end of modifying the shader through the other\n * methods in this class.\n *\n * @param {Context} context The context to use for creating the shader.\n * @return {ShaderProgram} A shader program to use for rendering.\n *\n * @example\n * const shaderProgram = shaderBuilder.buildShaderProgram(context);\n */\nShaderBuilder.prototype.buildShaderProgram = function (context) {\n const positionAttribute = defined(this._positionAttributeLine)\n ? [this._positionAttributeLine]\n : [];\n\n const structLines = generateStructLines(this);\n const functionLines = generateFunctionLines(this);\n\n // Lines are joined here so the ShaderSource\n // generates a single #line 0 directive\n const vertexLines = positionAttribute\n .concat(\n this._attributeLines,\n this._vertexShaderParts.uniformLines,\n this._vertexShaderParts.varyingLines,\n structLines.vertexLines,\n functionLines.vertexLines,\n this._vertexShaderParts.shaderLines\n )\n .join(\"\\n\");\n const vertexShaderSource = new ShaderSource({\n defines: this._vertexShaderParts.defineLines,\n sources: [vertexLines],\n });\n\n const fragmentLines = this._fragmentShaderParts.uniformLines\n .concat(\n this._fragmentShaderParts.varyingLines,\n structLines.fragmentLines,\n functionLines.fragmentLines,\n this._fragmentShaderParts.shaderLines\n )\n .join(\"\\n\");\n const fragmentShaderSource = new ShaderSource({\n defines: this._fragmentShaderParts.defineLines,\n sources: [fragmentLines],\n });\n\n return ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vertexShaderSource,\n fragmentShaderSource: fragmentShaderSource,\n attributeLocations: this._attributeLocations,\n });\n};\n\nShaderBuilder.prototype.clone = function () {\n return clone(this, true);\n};\n\nfunction generateStructLines(shaderBuilder) {\n const vertexLines = [];\n const fragmentLines = [];\n\n let i;\n let structIds = shaderBuilder._vertexShaderParts.structIds;\n let structId;\n let struct;\n let structLines;\n for (i = 0; i < structIds.length; i++) {\n structId = structIds[i];\n struct = shaderBuilder._structs[structId];\n structLines = struct.generateGlslLines();\n vertexLines.push.apply(vertexLines, structLines);\n }\n\n structIds = shaderBuilder._fragmentShaderParts.structIds;\n for (i = 0; i < structIds.length; i++) {\n structId = structIds[i];\n struct = shaderBuilder._structs[structId];\n structLines = struct.generateGlslLines();\n fragmentLines.push.apply(fragmentLines, structLines);\n }\n\n return {\n vertexLines: vertexLines,\n fragmentLines: fragmentLines,\n };\n}\n\nfunction getAttributeLocationCount(glslType) {\n switch (glslType) {\n case \"mat2\":\n return 2;\n case \"mat3\":\n return 3;\n case \"mat4\":\n return 4;\n default:\n return 1;\n }\n}\n\nfunction generateFunctionLines(shaderBuilder) {\n const vertexLines = [];\n const fragmentLines = [];\n\n let i;\n let functionIds = shaderBuilder._vertexShaderParts.functionIds;\n let functionId;\n let func;\n let functionLines;\n for (i = 0; i < functionIds.length; i++) {\n functionId = functionIds[i];\n func = shaderBuilder._functions[functionId];\n functionLines = func.generateGlslLines();\n vertexLines.push.apply(vertexLines, functionLines);\n }\n\n functionIds = shaderBuilder._fragmentShaderParts.functionIds;\n for (i = 0; i < functionIds.length; i++) {\n functionId = functionIds[i];\n func = shaderBuilder._functions[functionId];\n functionLines = func.generateGlslLines();\n fragmentLines.push.apply(fragmentLines, functionLines);\n }\n\n return {\n vertexLines: vertexLines,\n fragmentLines: fragmentLines,\n };\n}\n\nexport default ShaderBuilder;\n", "import Check from \"../../Core/Check.js\";\nimport ModelAlphaOptions from \"./ModelAlphaOptions.js\";\nimport RenderState from \"../../Renderer/RenderState.js\";\nimport ShaderBuilder from \"../../Renderer/ShaderBuilder.js\";\nimport DepthFunction from \"../DepthFunction.js\";\n\n/**\n * Model render resources are for setting details that are consistent across\n * the entire model.\n *\n * @constructor\n * @param {Model} model The model that will be rendered\n *\n * @private\n */\nfunction ModelRenderResources(model) {\n /**\n * An object used to build a shader incrementally. Each pipeline stage\n * may add lines of shader code to this object.\n *\n * @type {ShaderBuilder}\n * @readonly\n *\n * @private\n */\n this.shaderBuilder = new ShaderBuilder();\n\n /**\n * A reference to the model.\n *\n * @type {Model}\n * @readonly\n *\n * @private\n */\n this.model = model;\n\n /**\n * A dictionary mapping uniform name to functions that return the uniform\n * values.\n *\n * @type {Object.<String, Function>}\n * @readonly\n *\n * @private\n */\n this.uniformMap = {};\n\n /**\n * Options for configuring the alpha stage such as pass and alpha cutoff.\n *\n * @type {ModelAlphaOptions}\n * @readonly\n *\n * @private\n */\n this.alphaOptions = new ModelAlphaOptions();\n\n /**\n * An object storing options for creating a {@link RenderState}.\n * The pipeline stages simply set the options, the render state is created\n * when the {@link DrawCommand} is constructed.\n *\n * @type {Object}\n * @readonly\n *\n * @private\n */\n this.renderStateOptions = RenderState.getState(\n RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS_OR_EQUAL,\n },\n })\n );\n\n /**\n * Whether the model has a silhouette. This value indicates what draw commands\n * are needed and is set by ModelSilhouettePipelineStage.\n *\n * @type {Boolean}\n * @default false\n *\n * @private\n */\n this.hasSilhouette = false;\n\n /**\n * Whether the model is part of a tileset that uses the skipLevelOfDetail\n * optimization. This value indicates what draw commands are needed and\n * is set by TilesetPipelineStage.\n *\n * @type {Boolean}\n * @default false\n *\n * @private\n */\n this.hasSkipLevelOfDetail = false;\n}\n\nexport default ModelRenderResources;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void silhouetteStage(inout vec4 color) {\\n\\\nif(model_silhouettePass) {\\n\\\ncolor = czm_gammaCorrect(model_silhouetteColor);\\n\\\n}\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {\\n\\\n#ifdef HAS_NORMALS\\n\\\nif(model_silhouettePass) {\\n\\\nvec3 normal = normalize(czm_normal3D * attributes.normalMC);\\n\\\nnormal.x *= czm_projection[0][0];\\n\\\nnormal.y *= czm_projection[1][1];\\n\\\npositionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\nimport ModelSilhouetteStageFS from \"../../Shaders/Model/ModelSilhouetteStageFS.js\";\nimport ModelSilhouetteStageVS from \"../../Shaders/Model/ModelSilhouetteStageVS.js\";\n\n/**\n * The model silhouette pipeline stage is responsible applying silhouettes to the model.\n *\n * @namespace ModelSilhouettePipelineStage\n *\n * @private\n */\nconst ModelSilhouettePipelineStage = {\n name: \"ModelSilhouettePipelineStage\", // Helps with debugging\n};\n\n/**\n * Tracks how many silhouettes have been created. This value is used to\n * assign a reference number to the stencil.\n *\n * @type {Number}\n * @private\n */\nModelSilhouettePipelineStage.silhouettesLength = 0;\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>defines the silhouette ID for the model, if it doesn't yet exist\n * <li>adds a define to the shaders to indicate that the model uses silhouettes</li>\n * <li>adds a function to the vertex shader to create the silhouette around the model</li>\n * <li>adds a function to the fragment shader to apply color to the silhouette</li>\n * <li>adds the uniforms to the shaders for the corresponding silhouette properties</li>\n * <li>adds a uniform to distinguish which draw command is used to render the silhouette</li>\n * <li>sets a variable in the render resources denoting whether the model has a silhouette</li>\n * </ul>\n *\n * <p>\n * Note that the model must have a normal attribute in order to use silhouettes. The flag for this is\n * added to the shader in GeometryPipelineStage.\n * </p>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelSilhouettePipelineStage.process = function (\n renderResources,\n model,\n frameState\n) {\n if (!defined(model._silhouetteId)) {\n model._silhouetteId = ++ModelSilhouettePipelineStage.silhouettesLength;\n }\n\n const shaderBuilder = renderResources.shaderBuilder;\n shaderBuilder.addDefine(\"HAS_SILHOUETTE\", undefined, ShaderDestination.BOTH);\n\n shaderBuilder.addVertexLines(ModelSilhouetteStageVS);\n shaderBuilder.addFragmentLines(ModelSilhouetteStageFS);\n\n shaderBuilder.addUniform(\n \"vec4\",\n \"model_silhouetteColor\",\n ShaderDestination.FRAGMENT\n );\n\n shaderBuilder.addUniform(\n \"float\",\n \"model_silhouetteSize\",\n ShaderDestination.VERTEX\n );\n\n // Rendering silhouettes requires two draw commands:\n // - First, the model is rendered as normal, writing to the stencil buffer.\n // - Second, the silhouette is drawn, and the stencil buffer is used to cutout\n // the part that overlaps the regular model.\n //\n // To avoid creating a second shader program to handle silhouettes, a uniform\n // is used to distinguish between the two draw commands. The second command will set\n // this uniform true, such that only it applies the silhouette stage.\n shaderBuilder.addUniform(\n \"bool\",\n \"model_silhouettePass\",\n ShaderDestination.BOTH\n );\n\n const uniformMap = {\n model_silhouetteColor: function () {\n return model.silhouetteColor;\n },\n model_silhouetteSize: function () {\n return model.silhouetteSize;\n },\n model_silhouettePass: function () {\n // This will be set to true by the draw command that draws the silhouette.\n return false;\n },\n };\n\n renderResources.uniformMap = combine(uniformMap, renderResources.uniformMap);\n renderResources.hasSilhouette = true;\n};\n\nexport default ModelSilhouettePipelineStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void modelSplitterStage()\\n\\\n{\\n\\\n#ifndef SHADOW_MAP\\n\\\nif (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\\n\\\nif (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import combine from \"../../Core/combine.js\";\nimport ModelSplitterStageFS from \"../../Shaders/Model/ModelSplitterStageFS.js\";\nimport ShaderDestination from \"../../Renderer/ShaderDestination.js\";\n\n/**\n * The model splitting pipeline stage is responsible for discarding fragments on the wrong side of the splitter.\n *\n * @namespace ModelSplitterPipelineStage\n *\n * @private\n */\nconst ModelSplitterPipelineStage = {\n name: \"ModelSplitterPipelineStage\", // Helps with debugging\n\n SPLIT_DIRECTION_UNIFORM_NAME: \"model_splitDirection\",\n};\n\n/**\n * Process a model. This modifies the following parts of the render resources:\n *\n * <ul>\n * <li>adds a define to the fragment shader to indicate that the model is split</li>\n * <li>adds a function to the fragment shader to discard the fragment if it's on the wrong side of the splitter.</li>\n * <li>adds a uniform indicating the \"splitDirection\" (side of the screen on which to show the model)\n *</ul>\n *\n * @param {ModelRenderResources} renderResources The render resources for this model.\n * @param {Model} model The model.\n * @param {FrameState} frameState The frameState.\n *\n * @private\n */\nModelSplitterPipelineStage.process = function (\n renderResources,\n model,\n frameState\n) {\n const shaderBuilder = renderResources.shaderBuilder;\n\n shaderBuilder.addDefine(\n \"HAS_MODEL_SPLITTER\",\n undefined,\n ShaderDestination.FRAGMENT\n );\n shaderBuilder.addFragmentLines(ModelSplitterStageFS);\n\n const stageUniforms = {};\n\n shaderBuilder.addUniform(\n \"float\",\n ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME,\n ShaderDestination.FRAGMENT\n );\n stageUniforms[\n ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME\n ] = function () {\n return model.splitDirection;\n };\n\n renderResources.uniformMap = combine(\n stageUniforms,\n renderResources.uniformMap\n );\n};\n\nexport default ModelSplitterPipelineStage;\n", "import Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\n\n/**\n * A model is made up of one or more nodes in the scene graph. Some details\n * such as instancing are computed on a per-node basis. This class provides\n * a place to store such details. It also inherits some properties from\n * the model render resources.\n *\n * @constructor\n *\n * @param {ModelRenderResources} modelRenderResources The model resources to inherit\n * @param {ModelRuntimeNode} runtimeNode The in-memory representation of the scene graph node.\n *\n * @private\n */\nfunction NodeRenderResources(modelRenderResources, runtimeNode) {\n // Properties inherited from the ModelRenderResources.\n /**\n * A reference to the model. Inherited from the model render resources.\n *\n * @type {Model}\n * @readonly\n *\n * @private\n */\n this.model = modelRenderResources.model;\n /**\n * An object used to build a shader incrementally. This is cloned from the\n * model render resources because each node can compute a different shader.\n *\n * @type {ShaderBuilder}\n * @readonly\n *\n * @private\n */\n this.shaderBuilder = modelRenderResources.shaderBuilder.clone();\n\n /**\n * A dictionary mapping uniform name to functions that return the uniform\n * values. Inherited from the model render resources.\n *\n * @type {Object.<String, Function>}\n * @readonly\n *\n * @private\n */\n this.uniformMap = clone(modelRenderResources.uniformMap);\n\n /**\n * Options for configuring the alpha stage such as pass and alpha cutoff.\n * Inherited from the model render resources.\n *\n * @type {ModelAlphaOptions}\n * @readonly\n *\n * @private\n */\n this.alphaOptions = clone(modelRenderResources.alphaOptions);\n\n /**\n * An object storing options for creating a {@link RenderState}.\n * The pipeline stages simply set the options, the render state is created\n * when the {@link DrawCommand} is constructed. Inherited from the model\n * render resources.\n *\n * @type {Object}\n * @readonly\n *\n * @private\n */\n this.renderStateOptions = clone(\n modelRenderResources.renderStateOptions,\n true\n );\n\n /**\n * Whether the model has a silhouette. This value indicates what draw commands\n * are needed. Inherited from the model render resources.\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasSilhouette = modelRenderResources.hasSilhouette;\n\n /**\n * Whether the model is part of a tileset that uses the skipLevelOfDetail\n * optimization. This value indicates what draw commands are needed.\n * Inherited from the model render resources.\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasSkipLevelOfDetail = modelRenderResources.hasSkipLevelOfDetail;\n\n // Other properties.\n /**\n * A reference to the runtime node\n *\n * @type {ModelRuntimeNode}\n * @readonly\n *\n * @private\n */\n this.runtimeNode = runtimeNode;\n\n /**\n * An array of objects describing vertex attributes that will eventually\n * be used to create a {@link VertexArray} for the draw command. Attributes\n * at the node level may be needed for extensions such as EXT_mesh_gpu_instancing.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.attributes = [];\n\n /**\n * The index to give to the next vertex attribute added to the attributes array.\n * POSITION takes index 0.\n *\n * @type {Number}\n *\n * @private\n */\n this.attributeIndex = 1;\n\n /**\n * The set index to assign to feature ID vertex attribute(s) created from the\n * offset/repeat in the feature ID attribute.\n *\n * @type {Number}\n * @default 0\n *\n * @private\n */\n this.featureIdVertexAttributeSetIndex = 0;\n\n /**\n * The number of instances. This value is set by InstancingPipelineStage.\n *\n * @type {Number}\n * @default 0\n *\n * @private\n */\n this.instanceCount = 0;\n}\n\nexport default NodeRenderResources;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport LightingModel from \"./LightingModel.js\";\n\n/**\n * Options for configuring the {@link LightingPipelineStage}\n *\n * @param {Object} options An object containing the following options\n * @param {LightingModel} [options.lightingModel=LightingModel.UNLIT] The lighting model to use\n *\n * @alias ModelLightingOptions\n * @constructor\n *\n * @private\n */\nfunction ModelLightingOptions(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The lighting model to use, such as UNLIT or PBR. This is determined by\n * the primitive's material.\n *\n * @type {LightingModel}\n *\n * @private\n */\n this.lightingModel = defaultValue(options.lightingModel, LightingModel.UNLIT);\n}\n\nexport default ModelLightingOptions;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport clone from \"../../Core/clone.js\";\nimport defined from \"../../Core/defined.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelLightingOptions from \"./ModelLightingOptions.js\";\n\n/**\n * Each node may have many mesh primitives. Most model pipeline stages operate\n * at the primitive level. Again, properties are inherited from the parent.\n *\n * @param {NodeRenderResources} nodeRenderResources The node resources to inherit from\n * @param {ModelRuntimePrimitive} runtimePrimitive The primitive.\n *\n * @private\n */\nfunction PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {\n // Properties inherited from NodeRenderResources.\n /**\n * A reference to the model. Inherited from the node render resources.\n *\n * @type {Model}\n * @readonly\n *\n * @private\n */\n this.model = nodeRenderResources.model;\n\n /**\n * A reference to the runtime node. Inherited from the node render resources.\n *\n * @type {ModelRuntimeNode}\n * @readonly\n *\n * @private\n */\n this.runtimeNode = nodeRenderResources.runtimeNode;\n\n /**\n * The vertex attributes. This is shallow cloned from the node render\n * resources as the primitive will add additional properties.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.attributes = nodeRenderResources.attributes.slice();\n\n /**\n * The index to give to the next vertex attribute added to the attributes\n * array. POSITION takes index 0. Inherited from the node render resources.\n *\n * @type {Number}\n *\n * @private\n */\n this.attributeIndex = nodeRenderResources.attributeIndex;\n\n /**\n * The set index to assign to feature ID vertex attribute(s) created from the\n * offset/repeat in the feature ID attribute. Inherited from the node render\n * resources.\n *\n * @type {Number}\n *\n * @private\n */\n this.featureIdVertexAttributeSetIndex =\n nodeRenderResources.featureIdVertexAttributeSetIndex;\n\n /**\n * A dictionary mapping uniform name to functions that return the uniform\n * values. Inherited from the node render resources.\n *\n * @type {Object.<String, Function>}\n * @readonly\n *\n * @private\n */\n this.uniformMap = clone(nodeRenderResources.uniformMap);\n\n /**\n * Options for configuring the alpha stage such as pass and alpha cutoff.\n * Inherited from the node render resources.\n *\n * @type {ModelAlphaOptions}\n * @readonly\n *\n * @private\n */\n this.alphaOptions = clone(nodeRenderResources.alphaOptions);\n\n /**\n * An object storing options for creating a {@link RenderState}.\n * The pipeline stages simply set the options; the actual render state\n * is created when the {@link DrawCommand} is constructed. Inherited from\n * the node render resources.\n *\n * @type {Object}\n * @readonly\n *\n * @private\n */\n this.renderStateOptions = clone(nodeRenderResources.renderStateOptions, true);\n\n /**\n * Whether the model has a silhouette. This value indicates what draw commands\n * are needed. Inherited from the node render resources.\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasSilhouette = nodeRenderResources.hasSilhouette;\n\n /**\n * Whether the model is part of a tileset that uses the skipLevelOfDetail\n * optimization. This value indicates what draw commands are needed.\n * Inherited from the node render resources.\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasSkipLevelOfDetail = nodeRenderResources.hasSkipLevelOfDetail;\n\n /**\n * An object used to build a shader incrementally. This is cloned from the\n * node render resources because each primitive can compute a different shader.\n *\n * @type {ShaderBuilder}\n * @readonly\n *\n * @private\n */\n this.shaderBuilder = nodeRenderResources.shaderBuilder.clone();\n\n /**\n * The number of instances. Default is 0, if instancing is not used.\n * Inherited from the node render resources.\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n this.instanceCount = nodeRenderResources.instanceCount;\n\n // Other properties\n /**\n * A reference to the runtime primitive.\n *\n * @type {ModelRuntimePrimitive}\n * @readonly\n *\n * @private\n */\n this.runtimePrimitive = runtimePrimitive;\n\n /**\n * The primitive associated with the render resources.\n *\n * @type {ModelComponents.Primitive}\n * @readonly\n *\n * @private\n */\n const primitive = runtimePrimitive.primitive;\n\n /**\n * The number of indices in the primitive. The interpretation of this\n * depends on the primitive type.\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n this.count = defined(primitive.indices)\n ? primitive.indices.count\n : ModelUtility.getAttributeBySemantic(primitive, \"POSITION\").count;\n\n /**\n * Whether or not this primitive has a property table for storing metadata.\n * When present, picking and styling can use this. This value is set by\n * SelectedFeatureIdPipelineStage.\n *\n * @type {Boolean}\n * @default false\n *\n * @private\n */\n this.hasPropertyTable = false;\n\n /**\n * The indices for this primitive.\n *\n * @type {ModelComponents.Indices}\n * @readonly\n *\n * @private\n */\n this.indices = primitive.indices;\n\n /**\n * Additional index buffer for wireframe mode (if enabled). This value is set\n * by WireframePipelineStage.\n *\n * @type {Buffer}\n * @readonly\n *\n * @private\n */\n this.wireframeIndexBuffer = undefined;\n\n /**\n * The primitive type such as TRIANGLES or POINTS.\n *\n * @type {PrimitiveType}\n * @readonly\n *\n * @private\n */\n this.primitiveType = primitive.primitiveType;\n\n const positionMinMax = ModelUtility.getPositionMinMax(\n primitive,\n this.runtimeNode.instancingTranslationMin,\n this.runtimeNode.instancingTranslationMax\n );\n\n /**\n * The minimum position value for this primitive.\n *\n * @type {Cartesian3}\n * @readonly\n *\n * @private\n */\n this.positionMin = Cartesian3.clone(positionMinMax.min, new Cartesian3());\n\n /**\n * The maximum position value for this primitive.\n *\n * @type {Cartesian3}\n * @readonly\n *\n * @private\n */\n this.positionMax = Cartesian3.clone(positionMinMax.max, new Cartesian3());\n\n /**\n * The bounding sphere that contains all the vertices in this primitive.\n *\n * @type {BoundingSphere}\n * @readonly\n *\n * @private\n */\n this.boundingSphere = BoundingSphere.fromCornerPoints(\n this.positionMin,\n this.positionMax,\n new BoundingSphere()\n );\n\n /**\n * Options for configuring the lighting stage, such as selecting between\n * unlit and PBR shading.\n *\n * @type {ModelLightingOptions}\n * @readonly\n *\n * @private\n */\n this.lightingOptions = new ModelLightingOptions();\n\n /**\n * The shader variable to use for picking. If picking is enabled, this value\n * is set by PickingPipelineStage.\n *\n * @type {String}\n *\n * @private\n */\n this.pickId = undefined;\n}\n\nexport default PrimitiveRenderResources;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Transforms from \"../../Core/Transforms.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SplitDirection from \"../SplitDirection.js\";\nimport buildDrawCommand from \"./buildDrawCommand.js\";\nimport TilesetPipelineStage from \"./TilesetPipelineStage.js\";\nimport ImageBasedLightingPipelineStage from \"./ImageBasedLightingPipelineStage.js\";\nimport ModelArticulation from \"./ModelArticulation.js\";\nimport ModelColorPipelineStage from \"./ModelColorPipelineStage.js\";\nimport ModelClippingPlanesPipelineStage from \"./ModelClippingPlanesPipelineStage.js\";\nimport ModelNode from \"./ModelNode.js\";\nimport ModelRuntimeNode from \"./ModelRuntimeNode.js\";\nimport ModelRuntimePrimitive from \"./ModelRuntimePrimitive.js\";\nimport ModelSkin from \"./ModelSkin.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport ModelRenderResources from \"./ModelRenderResources.js\";\nimport ModelSilhouettePipelineStage from \"./ModelSilhouettePipelineStage.js\";\nimport ModelSplitterPipelineStage from \"./ModelSplitterPipelineStage.js\";\nimport ModelType from \"./ModelType.js\";\nimport NodeRenderResources from \"./NodeRenderResources.js\";\nimport PrimitiveRenderResources from \"./PrimitiveRenderResources.js\";\n\n/**\n * An in memory representation of the scene graph for a {@link Model}\n *\n * @param {Object} options An object containing the following options\n * @param {Model} options.model The model this scene graph belongs to\n * @param {ModelComponents} options.modelComponents The model components describing the model\n *\n * @alias ModelSceneGraph\n * @constructor\n *\n * @private\n */\nfunction ModelSceneGraph(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const components = options.modelComponents;\n\n /**\n * A reference to the {@link Model} that owns this scene graph.\n *\n * @type {Model}\n * @readonly\n *\n * @private\n */\n this._model = options.model;\n\n /**\n * The model components that represent the contents of the 3D model file.\n *\n * @type {ModelComponents}\n * @readonly\n *\n * @private\n */\n this._components = components;\n\n /**\n * Pipeline stages to apply across the model.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this._pipelineStages = [];\n\n /**\n * Update stages to apply across the model.\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this._updateStages = [];\n\n /**\n * The runtime nodes that make up the scene graph\n *\n * @type {ModelRuntimeNode[]}\n * @readonly\n *\n * @private\n */\n this._runtimeNodes = [];\n\n /**\n * The indices of the root nodes in the runtime nodes array.\n *\n * @type {Number[]}\n * @readonly\n *\n * @private\n */\n this._rootNodes = [];\n\n /**\n * The indices of the skinned nodes in the runtime nodes array. These refer\n * to the nodes that will be manipulated by their skin, as opposed to the nodes\n * acting as joints for the skin.\n *\n * @type {Number[]}\n * @readonly\n *\n * @private\n */\n this._skinnedNodes = [];\n\n /**\n * The runtime skins that affect nodes in the scene graph.\n *\n * @type {ModelSkin[]}\n * @readonly\n *\n * @private\n */\n this._runtimeSkins = [];\n\n /**\n * Pipeline stages to apply to this model. This\n * is an array of classes, each with a static method called\n * <code>process()</code>\n *\n * @type {Object[]}\n * @readonly\n *\n * @private\n */\n this.modelPipelineStages = [];\n\n // The scene graph's bounding sphere is model space, so that\n // the model's bounding sphere can be recomputed when given a\n // new model matrix.\n this._boundingSphere = undefined;\n\n // The 2D bounding sphere is in world space. This is checked\n // by the draw commands to see if the model is over the IDL,\n // and if so, renders the primitives using extra commands.\n this._boundingSphere2D = undefined;\n\n this._computedModelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n this._computedModelMatrix2D = Matrix4.clone(Matrix4.IDENTITY);\n\n this._axisCorrectionMatrix = ModelUtility.getAxisCorrectionMatrix(\n components.upAxis,\n components.forwardAxis,\n new Matrix4()\n );\n\n // Store articulations from the AGI_articulations extension\n // by name in a dictionary for easy retrieval.\n this._runtimeArticulations = {};\n\n initialize(this);\n}\n\nObject.defineProperties(ModelSceneGraph.prototype, {\n /**\n * The model components this scene graph represents.\n *\n * @type {ModelComponents}\n * @readonly\n *\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n\n /**\n * The axis-corrected model matrix.\n *\n * @type {Matrix4}\n * @readonly\n *\n * @private\n */\n computedModelMatrix: {\n get: function () {\n return this._computedModelMatrix;\n },\n },\n\n /**\n * A matrix to correct from y-up in some model formats (e.g. glTF) to the\n * z-up coordinate system Cesium uses.\n *\n * @type {Matrix4}\n * @readonly\n *\n * @private\n */\n axisCorrectionMatrix: {\n get: function () {\n return this._axisCorrectionMatrix;\n },\n },\n\n /**\n * The bounding sphere containing all the primitives in the scene graph\n * in model space.\n *\n * @type {BoundingSphere}\n * @readonly\n *\n * @private\n */\n boundingSphere: {\n get: function () {\n return this._boundingSphere;\n },\n },\n});\n\nfunction initialize(sceneGraph) {\n const components = sceneGraph._components;\n const scene = components.scene;\n const model = sceneGraph._model;\n\n // If the model has a height reference that modifies the model matrix,\n // it will be accounted for in updateModelMatrix.\n const modelMatrix = model.modelMatrix;\n computeModelMatrix(sceneGraph, modelMatrix);\n\n const articulations = components.articulations;\n const articulationsLength = articulations.length;\n\n const runtimeArticulations = sceneGraph._runtimeArticulations;\n for (let i = 0; i < articulationsLength; i++) {\n const articulation = articulations[i];\n const runtimeArticulation = new ModelArticulation({\n articulation: articulation,\n sceneGraph: sceneGraph,\n });\n\n const name = runtimeArticulation.name;\n runtimeArticulations[name] = runtimeArticulation;\n }\n\n const nodes = components.nodes;\n const nodesLength = nodes.length;\n\n // Initialize this array to be the same size as the nodes array in\n // the model file. This is so the node indices remain the same. However,\n // only nodes reachable from the scene's root node will be populated, the\n // rest will be undefined\n sceneGraph._runtimeNodes = new Array(nodesLength);\n\n const rootNodes = scene.nodes;\n const rootNodesLength = rootNodes.length;\n const transformToRoot = Matrix4.IDENTITY;\n for (let i = 0; i < rootNodesLength; i++) {\n const rootNode = scene.nodes[i];\n\n const rootNodeIndex = traverseAndCreateSceneGraph(\n sceneGraph,\n rootNode,\n transformToRoot\n );\n\n sceneGraph._rootNodes.push(rootNodeIndex);\n }\n\n // Handle skins after all runtime nodes are created\n const skins = components.skins;\n const runtimeSkins = sceneGraph._runtimeSkins;\n\n const skinsLength = skins.length;\n for (let i = 0; i < skinsLength; i++) {\n const skin = skins[i];\n runtimeSkins.push(\n new ModelSkin({\n skin: skin,\n sceneGraph: sceneGraph,\n })\n );\n }\n\n const skinnedNodes = sceneGraph._skinnedNodes;\n const skinnedNodesLength = skinnedNodes.length;\n for (let i = 0; i < skinnedNodesLength; i++) {\n const skinnedNodeIndex = skinnedNodes[i];\n const skinnedNode = sceneGraph._runtimeNodes[skinnedNodeIndex];\n\n // Use the index of the skin in the model components to find\n // the corresponding runtime skin.\n const skin = nodes[skinnedNodeIndex].skin;\n const skinIndex = skin.index;\n\n skinnedNode._runtimeSkin = runtimeSkins[skinIndex];\n skinnedNode.updateJointMatrices();\n }\n\n // Ensure articulations are applied with their initial values to their target nodes.\n sceneGraph.applyArticulations();\n}\n\nfunction computeModelMatrix(sceneGraph, modelMatrix) {\n const components = sceneGraph._components;\n const model = sceneGraph._model;\n\n sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation(\n modelMatrix,\n components.transform,\n sceneGraph._computedModelMatrix\n );\n\n sceneGraph._computedModelMatrix = Matrix4.multiplyTransformation(\n sceneGraph._computedModelMatrix,\n sceneGraph._axisCorrectionMatrix,\n sceneGraph._computedModelMatrix\n );\n\n sceneGraph._computedModelMatrix = Matrix4.multiplyByUniformScale(\n sceneGraph._computedModelMatrix,\n model.computedScale,\n sceneGraph._computedModelMatrix\n );\n}\n\nconst scratchComputedTranslation = new Cartesian3();\n\nfunction computeModelMatrix2D(sceneGraph, frameState) {\n const computedModelMatrix = sceneGraph._computedModelMatrix;\n const translation = Matrix4.getTranslation(\n computedModelMatrix,\n scratchComputedTranslation\n );\n\n if (!Cartesian3.equals(translation, Cartesian3.ZERO)) {\n sceneGraph._computedModelMatrix2D = Transforms.basisTo2D(\n frameState.mapProjection,\n computedModelMatrix,\n sceneGraph._computedModelMatrix2D\n );\n } else {\n const center = sceneGraph.boundingSphere.center;\n const to2D = Transforms.wgs84To2DModelMatrix(\n frameState.mapProjection,\n center,\n sceneGraph._computedModelMatrix2D\n );\n sceneGraph._computedModelMatrix2D = Matrix4.multiply(\n to2D,\n computedModelMatrix,\n sceneGraph._computedModelMatrix2D\n );\n }\n\n sceneGraph._boundingSphere2D = BoundingSphere.transform(\n sceneGraph._boundingSphere,\n sceneGraph._computedModelMatrix2D,\n sceneGraph._boundingSphere2D\n );\n}\n\n/**\n * Recursively traverse through the nodes in the scene graph to create\n * their runtime versions, using a post-order depth-first traversal.\n *\n * @param {ModelSceneGraph} sceneGraph The scene graph\n * @param {ModelComponents.Node} node The current node\n * @param {Matrix4} transformToRoot The transforms of this node's ancestors.\n * @returns {Number} The index of this node in the runtimeNodes array.\n *\n * @private\n */\nfunction traverseAndCreateSceneGraph(sceneGraph, node, transformToRoot) {\n // The indices of the children of this node in the runtimeNodes array.\n const childrenIndices = [];\n const transform = ModelUtility.getNodeTransform(node);\n\n // Traverse through scene graph.\n const childrenLength = node.children.length;\n for (let i = 0; i < childrenLength; i++) {\n const childNode = node.children[i];\n const childNodeTransformToRoot = Matrix4.multiplyTransformation(\n transformToRoot,\n transform,\n new Matrix4()\n );\n\n const childIndex = traverseAndCreateSceneGraph(\n sceneGraph,\n childNode,\n childNodeTransformToRoot\n );\n childrenIndices.push(childIndex);\n }\n\n // Process node and mesh primitives.\n const runtimeNode = new ModelRuntimeNode({\n node: node,\n transform: transform,\n transformToRoot: transformToRoot,\n children: childrenIndices,\n sceneGraph: sceneGraph,\n });\n\n const primitivesLength = node.primitives.length;\n for (let i = 0; i < primitivesLength; i++) {\n runtimeNode.runtimePrimitives.push(\n new ModelRuntimePrimitive({\n primitive: node.primitives[i],\n node: node,\n model: sceneGraph._model,\n })\n );\n }\n\n const index = node.index;\n sceneGraph._runtimeNodes[index] = runtimeNode;\n if (defined(node.skin)) {\n sceneGraph._skinnedNodes.push(index);\n }\n\n // Create and store the public version of the runtime node.\n const name = node.name;\n if (defined(name)) {\n const model = sceneGraph._model;\n const publicNode = new ModelNode(model, runtimeNode);\n model._nodesByName[name] = publicNode;\n }\n\n return index;\n}\n\nconst scratchModelPositionMin = new Cartesian3();\nconst scratchModelPositionMax = new Cartesian3();\nconst scratchPrimitivePositionMin = new Cartesian3();\nconst scratchPrimitivePositionMax = new Cartesian3();\n/**\n * Generates the {@link ModelDrawCommand} for each primitive in the model.\n * If the model is used for classification, a {@link ClassificationModelDrawCommand}\n * is generated for each primitive instead.\n *\n * @param {FrameState} frameState The current frame state. This is needed to\n * allocate GPU resources as needed.\n *\n * @private\n */\nModelSceneGraph.prototype.buildDrawCommands = function (frameState) {\n const model = this._model;\n const modelRenderResources = new ModelRenderResources(model);\n\n // Reset the memory counts before running the pipeline\n model.statistics.clear();\n\n this.configurePipeline(frameState);\n const modelPipelineStages = this.modelPipelineStages;\n\n let i, j, k;\n for (i = 0; i < modelPipelineStages.length; i++) {\n const modelPipelineStage = modelPipelineStages[i];\n modelPipelineStage.process(modelRenderResources, model, frameState);\n }\n\n const modelPositionMin = Cartesian3.fromElements(\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n scratchModelPositionMin\n );\n const modelPositionMax = Cartesian3.fromElements(\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n scratchModelPositionMax\n );\n\n for (i = 0; i < this._runtimeNodes.length; i++) {\n const runtimeNode = this._runtimeNodes[i];\n\n // If a node in the model was unreachable from the scene graph, there will\n // be no corresponding runtime node and therefore should be skipped.\n if (!defined(runtimeNode)) {\n continue;\n }\n\n runtimeNode.configurePipeline();\n const nodePipelineStages = runtimeNode.pipelineStages;\n\n const nodeRenderResources = new NodeRenderResources(\n modelRenderResources,\n runtimeNode\n );\n\n for (j = 0; j < nodePipelineStages.length; j++) {\n const nodePipelineStage = nodePipelineStages[j];\n\n nodePipelineStage.process(\n nodeRenderResources,\n runtimeNode.node,\n frameState\n );\n }\n\n const nodeTransform = runtimeNode.computedTransform;\n for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {\n const runtimePrimitive = runtimeNode.runtimePrimitives[j];\n\n runtimePrimitive.configurePipeline(frameState);\n const primitivePipelineStages = runtimePrimitive.pipelineStages;\n\n const primitiveRenderResources = new PrimitiveRenderResources(\n nodeRenderResources,\n runtimePrimitive\n );\n\n for (k = 0; k < primitivePipelineStages.length; k++) {\n const primitivePipelineStage = primitivePipelineStages[k];\n\n primitivePipelineStage.process(\n primitiveRenderResources,\n runtimePrimitive.primitive,\n frameState\n );\n }\n\n runtimePrimitive.boundingSphere = BoundingSphere.clone(\n primitiveRenderResources.boundingSphere,\n new BoundingSphere()\n );\n\n const primitivePositionMin = Matrix4.multiplyByPoint(\n nodeTransform,\n primitiveRenderResources.positionMin,\n scratchPrimitivePositionMin\n );\n const primitivePositionMax = Matrix4.multiplyByPoint(\n nodeTransform,\n primitiveRenderResources.positionMax,\n scratchPrimitivePositionMax\n );\n\n Cartesian3.minimumByComponent(\n modelPositionMin,\n primitivePositionMin,\n modelPositionMin\n );\n Cartesian3.maximumByComponent(\n modelPositionMax,\n primitivePositionMax,\n modelPositionMax\n );\n\n const drawCommand = buildDrawCommand(\n primitiveRenderResources,\n frameState\n );\n runtimePrimitive.drawCommand = drawCommand;\n }\n }\n\n this._boundingSphere = BoundingSphere.fromCornerPoints(\n modelPositionMin,\n modelPositionMax,\n new BoundingSphere()\n );\n\n this._boundingSphere = BoundingSphere.transformWithoutScale(\n this._boundingSphere,\n this._axisCorrectionMatrix,\n this._boundingSphere\n );\n\n this._boundingSphere = BoundingSphere.transform(\n this._boundingSphere,\n this._components.transform,\n this._boundingSphere\n );\n\n model._boundingSphere = BoundingSphere.transform(\n this._boundingSphere,\n model.modelMatrix,\n model._boundingSphere\n );\n\n model._initialRadius = model._boundingSphere.radius;\n model._boundingSphere.radius *= model._clampedScale;\n};\n\n/**\n * Configure the model pipeline stages. If the pipeline needs to be re-run, call\n * this method again to ensure the correct sequence of pipeline stages are\n * used.\n *\n * @private\n */\nModelSceneGraph.prototype.configurePipeline = function (frameState) {\n const modelPipelineStages = this.modelPipelineStages;\n modelPipelineStages.length = 0;\n\n const model = this._model;\n\n if (defined(model.color)) {\n modelPipelineStages.push(ModelColorPipelineStage);\n }\n\n // Skip these pipeline stages for classification models.\n if (defined(model.classificationType)) {\n return;\n }\n\n if (model.imageBasedLighting.enabled) {\n modelPipelineStages.push(ImageBasedLightingPipelineStage);\n }\n\n if (model.isClippingEnabled()) {\n modelPipelineStages.push(ModelClippingPlanesPipelineStage);\n }\n\n if (model.hasSilhouette(frameState)) {\n modelPipelineStages.push(ModelSilhouettePipelineStage);\n }\n\n if (\n defined(model.splitDirection) &&\n model.splitDirection !== SplitDirection.NONE\n ) {\n modelPipelineStages.push(ModelSplitterPipelineStage);\n }\n\n if (ModelType.is3DTiles(model.type)) {\n modelPipelineStages.push(TilesetPipelineStage);\n }\n};\n\nModelSceneGraph.prototype.update = function (frameState, updateForAnimations) {\n let i, j, k;\n\n for (i = 0; i < this._runtimeNodes.length; i++) {\n const runtimeNode = this._runtimeNodes[i];\n\n // If a node in the model was unreachable from the scene graph, there will\n // be no corresponding runtime node and therefore should be skipped.\n if (!defined(runtimeNode)) {\n continue;\n }\n\n for (j = 0; j < runtimeNode.updateStages.length; j++) {\n const nodeUpdateStage = runtimeNode.updateStages[j];\n nodeUpdateStage.update(runtimeNode, this, frameState);\n }\n\n const disableAnimations =\n frameState.mode !== SceneMode.SCENE3D && this._model._projectTo2D;\n if (updateForAnimations && !disableAnimations) {\n this.updateJointMatrices();\n }\n\n for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {\n const runtimePrimitive = runtimeNode.runtimePrimitives[j];\n for (k = 0; k < runtimePrimitive.updateStages.length; k++) {\n const stage = runtimePrimitive.updateStages[k];\n stage.update(runtimePrimitive, this);\n }\n }\n }\n};\n\nModelSceneGraph.prototype.updateModelMatrix = function (\n modelMatrix,\n frameState\n) {\n computeModelMatrix(this, modelMatrix);\n if (frameState.mode !== SceneMode.SCENE3D) {\n computeModelMatrix2D(this, frameState);\n }\n\n // Mark all root nodes as dirty. Any and all children will be\n // affected recursively in the update stage.\n const rootNodes = this._rootNodes;\n for (let i = 0; i < rootNodes.length; i++) {\n const node = this._runtimeNodes[rootNodes[i]];\n node._transformDirty = true;\n }\n};\n\n/**\n * Updates the joint matrices for the skins and nodes of the model.\n *\n * @private\n */\nModelSceneGraph.prototype.updateJointMatrices = function () {\n const skinnedNodes = this._skinnedNodes;\n const length = skinnedNodes.length;\n\n for (let i = 0; i < length; i++) {\n const nodeIndex = skinnedNodes[i];\n const runtimeNode = this._runtimeNodes[nodeIndex];\n runtimeNode.updateJointMatrices();\n }\n};\n\n/**\n * A callback to be applied once at each runtime primitive in the\n * scene graph\n * @callback traverseSceneGraphCallback\n *\n * @param {ModelRuntimePrimitive} runtimePrimitive The runtime primitive for the current step of the traversal\n * @param {Object} [options] A dictionary of additional options to be passed to the callback, or undefined if the callback does not need any additional information.\n *\n * @private\n */\n\n/**\n * Recursively traverse through the runtime nodes in the scene graph\n * using a post-order depth-first traversal to perform a callback on\n * their runtime primitives.\n *\n * @param {ModelSceneGraph} sceneGraph The scene graph.\n * @param {ModelRuntimeNode} runtimeNode The current runtime node.\n * @param {Boolean} visibleNodesOnly Whether to only traverse nodes that are visible.\n * @param {traverseSceneGraphCallback} callback The callback to perform on the runtime primitives of the node.\n * @param {Object} [callbackOptions] A dictionary of additional options to be passed to the callback, if needed.\n *\n * @private\n */\nfunction traverseSceneGraph(\n sceneGraph,\n runtimeNode,\n visibleNodesOnly,\n callback,\n callbackOptions\n) {\n if (visibleNodesOnly && !runtimeNode.show) {\n return;\n }\n\n const childrenLength = runtimeNode.children.length;\n for (let i = 0; i < childrenLength; i++) {\n const childRuntimeNode = runtimeNode.getChild(i);\n traverseSceneGraph(\n sceneGraph,\n childRuntimeNode,\n visibleNodesOnly,\n callback,\n callbackOptions\n );\n }\n\n const runtimePrimitives = runtimeNode.runtimePrimitives;\n const runtimePrimitivesLength = runtimePrimitives.length;\n for (let j = 0; j < runtimePrimitivesLength; j++) {\n const runtimePrimitive = runtimePrimitives[j];\n callback(runtimePrimitive, callbackOptions);\n }\n}\n\nfunction forEachRuntimePrimitive(\n sceneGraph,\n visibleNodesOnly,\n callback,\n callbackOptions\n) {\n const rootNodes = sceneGraph._rootNodes;\n const rootNodesLength = rootNodes.length;\n for (let i = 0; i < rootNodesLength; i++) {\n const rootNodeIndex = rootNodes[i];\n const runtimeNode = sceneGraph._runtimeNodes[rootNodeIndex];\n traverseSceneGraph(\n sceneGraph,\n runtimeNode,\n visibleNodesOnly,\n callback,\n callbackOptions\n );\n }\n}\n\nconst scratchBackFaceCullingOptions = {\n backFaceCulling: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes the back-face culling setting.\n *\n * @param {Boolean} backFaceCulling The new value for the back-face culling setting.\n *\n * @private\n */\nModelSceneGraph.prototype.updateBackFaceCulling = function (backFaceCulling) {\n const backFaceCullingOptions = scratchBackFaceCullingOptions;\n backFaceCullingOptions.backFaceCulling = backFaceCulling;\n forEachRuntimePrimitive(\n this,\n false,\n updatePrimitiveBackFaceCulling,\n backFaceCullingOptions\n );\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveBackFaceCulling(runtimePrimitive, options) {\n const drawCommand = runtimePrimitive.drawCommand;\n drawCommand.backFaceCulling = options.backFaceCulling;\n}\n\nconst scratchShadowOptions = {\n shadowMode: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes the shadow settings.\n *\n * @param {ShadowMode} shadowMode The new shadow settings.\n *\n * @private\n */\nModelSceneGraph.prototype.updateShadows = function (shadowMode) {\n const shadowOptions = scratchShadowOptions;\n shadowOptions.shadowMode = shadowMode;\n forEachRuntimePrimitive(this, false, updatePrimitiveShadows, shadowOptions);\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveShadows(runtimePrimitive, options) {\n const drawCommand = runtimePrimitive.drawCommand;\n drawCommand.shadows = options.shadowMode;\n}\n\nconst scratchShowBoundingVolumeOptions = {\n debugShowBoundingVolume: undefined,\n};\n\n/**\n * Traverses through all draw commands and changes whether to show the debug bounding volume.\n *\n * @param {Boolean} debugShowBoundingVolume The new value for showing the debug bounding volume.\n *\n * @private\n */\nModelSceneGraph.prototype.updateShowBoundingVolume = function (\n debugShowBoundingVolume\n) {\n const showBoundingVolumeOptions = scratchShowBoundingVolumeOptions;\n showBoundingVolumeOptions.debugShowBoundingVolume = debugShowBoundingVolume;\n\n forEachRuntimePrimitive(\n this,\n false,\n updatePrimitiveShowBoundingVolume,\n showBoundingVolumeOptions\n );\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {\n const drawCommand = runtimePrimitive.drawCommand;\n drawCommand.debugShowBoundingVolume = options.debugShowBoundingVolume;\n}\n\nconst scratchSilhouetteCommands = [];\nconst scratchPushDrawCommandOptions = {\n frameState: undefined,\n hasSilhouette: undefined,\n};\n\n/**\n * Traverses through the scene graph and pushes the draw commands associated\n * with each primitive to the frame state's command list.\n *\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nModelSceneGraph.prototype.pushDrawCommands = function (frameState) {\n // If a model has silhouettes, the commands that draw the silhouettes for\n // each primitive can only be invoked after the entire model has drawn.\n // Otherwise, the silhouette may draw on top of the model. This requires\n // gathering the original commands and the silhouette commands separately.\n const silhouetteCommands = scratchSilhouetteCommands;\n silhouetteCommands.length = 0;\n\n // Since this function is called each frame, the options object is\n // preallocated in a scratch variable\n const pushDrawCommandOptions = scratchPushDrawCommandOptions;\n pushDrawCommandOptions.hasSilhouette = this._model.hasSilhouette(frameState);\n pushDrawCommandOptions.frameState = frameState;\n\n forEachRuntimePrimitive(\n this,\n true,\n pushPrimitiveDrawCommands,\n pushDrawCommandOptions\n );\n\n frameState.commandList.push.apply(frameState.commandList, silhouetteCommands);\n};\n\n// Callback is defined here to avoid allocating a closure in the render loop\nfunction pushPrimitiveDrawCommands(runtimePrimitive, options) {\n const frameState = options.frameState;\n const hasSilhouette = options.hasSilhouette;\n\n const passes = frameState.passes;\n const silhouetteCommands = scratchSilhouetteCommands;\n const primitiveDrawCommand = runtimePrimitive.drawCommand;\n\n primitiveDrawCommand.pushCommands(frameState, frameState.commandList);\n\n // If a model has silhouettes, the commands that draw the silhouettes for\n // each primitive can only be invoked after the entire model has drawn.\n // Otherwise, the silhouette may draw on top of the model. This requires\n // gathering the original commands and the silhouette commands separately.\n if (hasSilhouette && !passes.pick) {\n primitiveDrawCommand.pushSilhouetteCommands(frameState, silhouetteCommands);\n }\n}\n\n/**\n * Sets the current value of an articulation stage.\n *\n * @param {String} articulationStageKey The name of the articulation, a space, and the name of the stage.\n * @param {Number} value The numeric value of this stage of the articulation.\n *\n * @private\n */\nModelSceneGraph.prototype.setArticulationStage = function (\n articulationStageKey,\n value\n) {\n const names = articulationStageKey.split(\" \");\n if (names.length !== 2) {\n return;\n }\n\n const articulationName = names[0];\n const stageName = names[1];\n\n const runtimeArticulation = this._runtimeArticulations[articulationName];\n if (defined(runtimeArticulation)) {\n runtimeArticulation.setArticulationStage(stageName, value);\n }\n};\n\n/**\n * Applies any modified articulation stages to the matrix of each node that participates\n * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.\n *\n * @private\n */\nModelSceneGraph.prototype.applyArticulations = function () {\n const runtimeArticulations = this._runtimeArticulations;\n for (const articulationName in runtimeArticulations) {\n if (runtimeArticulations.hasOwnProperty(articulationName)) {\n const articulation = runtimeArticulations[articulationName];\n articulation.apply();\n }\n }\n};\n\nexport default ModelSceneGraph;\n", "import AssociativeArray from \"../../Core/AssociativeArray.js\";\nimport Check from \"../../Core/Check.js\";\n\n/**\n * Rendering statistics for a single model.\n *\n * @alias ModelStatistics\n * @constructor\n *\n * @see Cesium3DTilesetStatistics\n *\n * @private\n */\nfunction ModelStatistics() {\n /**\n * Total number of points across all POINTS primitives in this model.\n *\n * @type {Number}\n * @private\n */\n this.pointsLength = 0;\n\n /**\n * Total number of triangles across all TRIANGLES, TRIANGLE_STRIP or\n * TRIANGLE_FAN primitives in this model.\n *\n * @type {Number}\n * @private\n */\n this.trianglesLength = 0;\n\n /**\n * Total size of all geometry buffers in bytes. This accounts for the vertex\n * attributes (which includes feature IDs and property attributes) and index\n * buffers of all the model's primitives. Any attributes generated by the\n * pipeline are included in this total.\n *\n * @type {Number}\n * @private\n */\n this.geometryByteLength = 0;\n\n /**\n * Total size of all textures in bytes. This includes materials,\n * feature ID textures, and property textures.\n *\n * @type {Number}\n * @private\n */\n this.texturesByteLength = 0;\n\n /**\n * Total size of property tables. This excludes the batch textures used for\n * picking and styling.\n *\n * @type {Number}\n * @private\n */\n this.propertyTablesByteLength = 0;\n\n // Sets of buffers and textures that have already been counted.\n // This is to prevent double-counting cached assets.\n this._bufferIdSet = {};\n this._textureIdSet = {};\n\n // Associated array of batch textures that have already been counted.\n // This allows for quick look-up to check if a texture has been counted,\n // while also allowing for dynamic texture counting.\n this._batchTextureIdMap = new AssociativeArray();\n}\n\nObject.defineProperties(ModelStatistics.prototype, {\n /**\n * Total size of the batch textures used for picking and styling.\n * Batch textures are created asynchronously, so this iterates\n * over the textures to ensure their memory values are accurate.\n *\n * @memberof ModelStatistics.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n batchTexturesByteLength: {\n get: function () {\n const length = this._batchTextureIdMap.length;\n const values = this._batchTextureIdMap.values;\n\n let memory = 0;\n for (let i = 0; i < length; i++) {\n memory += values[i].byteLength;\n }\n\n return memory;\n },\n },\n});\n\n/**\n * Reset the memory counts for this model. This should be called each time the\n * draw command pipeline is rebuilt.\n *\n * @private\n */\nModelStatistics.prototype.clear = function () {\n this.pointsLength = 0;\n this.trianglesLength = 0;\n this.geometryByteLength = 0;\n this.texturesByteLength = 0;\n this.propertyTablesByteLength = 0;\n\n this._bufferIdSet = {};\n this._textureIdSet = {};\n this._batchTextureIdMap.removeAll();\n};\n\n/**\n * Counts the given buffer's memory in bytes. If a buffer has\n * already been counted by these statistics, it will not be\n * counted again.\n *\n * @param {Buffer} buffer The GPU buffer associated with the model.\n * @param {Boolean} hasCpuCopy Whether the buffer has a copy on the CPU via typed array.\n *\n * @private\n */\nModelStatistics.prototype.addBuffer = function (buffer, hasCpuCopy) {\n if (!this._bufferIdSet.hasOwnProperty(buffer._id)) {\n // If there's a CPU copy, count the memory twice.\n const copies = hasCpuCopy ? 2 : 1;\n this.geometryByteLength += buffer.sizeInBytes * copies;\n }\n\n // Simulate set insertion.\n this._bufferIdSet[buffer._id] = true;\n};\n\n/**\n * Counts the given texture's memory in bytes. If a texture has\n * already been counted by these statistics, it will not be\n * counted again.\n * <p>\n * This is used to count the materials and property textures of\n * a model. Batch textures function differently and are counted\n * using <code>addBatchTexture</code> instead.\n * </p>\n *\n * @param {Texture} texture The texture associated with the model.\n *\n * @private\n */\nModelStatistics.prototype.addTexture = function (texture) {\n if (!this._textureIdSet.hasOwnProperty(texture._id)) {\n this.texturesByteLength += texture.sizeInBytes;\n }\n\n // Simulate set insertion.\n this._textureIdSet[texture._id] = true;\n};\n\n/**\n * Counts the batch texture's memory in bytes. If a batch texture\n * has already been counted by these statistics, it will not be\n * counted again.\n * <p>\n * Batch textures are handled differently than other textures. They\n * include the batch and pick textures for the feature table, which\n * are created dynamically. As such, they may not have both textures\n * loaded by the time they are added to the statistics. Their memory\n * will thus be counted dynamically.\n * </p>\n *\n * @param {BatchTexture} batchTexture The batch texture associated with the model.\n *\n * @private\n */\nModelStatistics.prototype.addBatchTexture = function (batchTexture) {\n if (!this._batchTextureIdMap.contains(batchTexture._id)) {\n this._batchTextureIdMap.set(batchTexture._id, batchTexture);\n }\n};\n\nexport default ModelStatistics;\n", "import AttributeCompression from \"../../Core/AttributeCompression.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Color from \"../../Core/Color.js\";\nimport Check from \"../../Core/Check.js\";\nimport ComponentDatatype from \"../../Core/ComponentDatatype.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport PrimitiveType from \"../../Core/PrimitiveType.js\";\nimport WebGLConstants from \"../../Core/WebGLConstants.js\";\nimport MersenneTwister from \"mersenne-twister\";\nimport Buffer from \"../../Renderer/Buffer.js\";\nimport BufferUsage from \"../../Renderer/BufferUsage.js\";\nimport AlphaMode from \"../AlphaMode.js\";\nimport AttributeType from \"../AttributeType.js\";\nimport Axis from \"../Axis.js\";\nimport parseBatchTable from \"../parseBatchTable.js\";\nimport DracoLoader from \"../DracoLoader.js\";\nimport StructuralMetadata from \"../StructuralMetadata.js\";\nimport ResourceLoader from \"../ResourceLoader.js\";\nimport ModelComponents from \"../ModelComponents.js\";\nimport PntsParser from \"../PntsParser.js\";\nimport ResourceLoaderState from \"../ResourceLoaderState.js\";\nimport VertexAttributeSemantic from \"../VertexAttributeSemantic.js\";\n\nconst Components = ModelComponents.Components;\nconst Scene = ModelComponents.Scene;\nconst Node = ModelComponents.Node;\nconst Primitive = ModelComponents.Primitive;\nconst Attribute = ModelComponents.Attribute;\nconst Quantization = ModelComponents.Quantization;\nconst FeatureIdAttribute = ModelComponents.FeatureIdAttribute;\nconst Material = ModelComponents.Material;\nconst MetallicRoughness = ModelComponents.MetallicRoughness;\n\n/**\n * Loads a .pnts point cloud and transcodes it into a {@link ModelComponents}\n *\n * @alias PntsLoader\n * @constructor\n * @augments ResourceLoader\n * @private\n *\n * @param {Object} options An object containing the following properties\n * @param {ArrayBuffer} options.arrayBuffer The array buffer of the pnts contents\n * @param {Number} [options.byteOffset] The byte offset to the beginning of the pnts contents in the array buffer\n * @param {Boolean} [options.loadAttributesFor2D=false] If true, load the positions buffer as a typed array for accurately projecting models to 2D.\n */\nfunction PntsLoader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const arrayBuffer = options.arrayBuffer;\n const byteOffset = defaultValue(options.byteOffset, 0);\n\n this._arrayBuffer = arrayBuffer;\n this._byteOffset = byteOffset;\n this._loadAttributesFor2D = defaultValue(options.loadAttributesFor2D, false);\n\n this._parsedContent = undefined;\n this._decodePromise = undefined;\n this._decodedAttributes = undefined;\n\n this._promise = undefined;\n this._process = function (frameState) {};\n this._state = ResourceLoaderState.UNLOADED;\n this._buffers = [];\n\n // The batch table object contains a json and a binary component access using keys of the same name.\n this._components = undefined;\n this._transform = Matrix4.IDENTITY;\n}\n\nif (defined(Object.create)) {\n PntsLoader.prototype = Object.create(ResourceLoader.prototype);\n PntsLoader.prototype.constructor = PntsLoader;\n}\n\nObject.defineProperties(PntsLoader.prototype, {\n /**\n * A promise that resolves to the resource when the resource is ready, or undefined if the resource hasn't started loading.\n *\n * @memberof PntsLoader.prototype\n *\n * @type {Promise.<PntsLoader>|undefined}\n * @readonly\n * @private\n */\n promise: {\n get: function () {\n return this._promise;\n },\n },\n /**\n * The cache key of the resource\n *\n * @memberof PntsLoader.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n cacheKey: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * The loaded components.\n *\n * @memberof PntsLoader.prototype\n *\n * @type {ModelComponents.Components}\n * @readonly\n * @private\n */\n components: {\n get: function () {\n return this._components;\n },\n },\n\n /**\n * A world-space transform to apply to the primitives.\n * See {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud#global-semantics}\n *\n * @memberof PntsLoader.prototype\n *\n * @type {Matrix4}\n * @readonly\n * @private\n */\n transform: {\n get: function () {\n return this._transform;\n },\n },\n});\n\n/**\n * Loads the resource.\n * @returns {Promise.<PntsLoader>} A promise which resolves to the loader when the resource loading is completed.\n * @private\n */\nPntsLoader.prototype.load = function () {\n this._parsedContent = PntsParser.parse(this._arrayBuffer, this._byteOffset);\n this._state = ResourceLoaderState.PROCESSING;\n\n const loader = this;\n this._promise = new Promise(function (resolve, reject) {\n loader._process = function (frameState) {\n if (loader._state === ResourceLoaderState.PROCESSING) {\n if (defined(loader._decodePromise)) {\n return;\n }\n\n const decodePromise = decodeDraco(loader, frameState.context);\n if (defined(decodePromise)) {\n decodePromise.then(resolve).catch(reject);\n }\n }\n };\n });\n};\n\nPntsLoader.prototype.process = function (frameState) {\n this._process(frameState);\n};\n\nfunction decodeDraco(loader, context) {\n const parsedContent = loader._parsedContent;\n const draco = parsedContent.draco;\n\n let decodePromise;\n if (!defined(draco)) {\n // The draco extension wasn't present,\n decodePromise = Promise.resolve();\n } else {\n decodePromise = DracoLoader.decodePointCloud(draco, context);\n }\n\n if (!defined(decodePromise)) {\n // Could not schedule Draco decoding this frame.\n return;\n }\n\n loader._decodePromise = decodePromise;\n return decodePromise\n .then(function (decodeDracoResult) {\n if (loader.isDestroyed()) {\n return;\n }\n\n if (defined(decodeDracoResult)) {\n processDracoAttributes(loader, draco, decodeDracoResult);\n }\n makeComponents(loader, context);\n loader._state = ResourceLoaderState.READY;\n return loader;\n })\n .catch(function (error) {\n loader.unload();\n loader._state = ResourceLoaderState.FAILED;\n const errorMessage = \"Failed to load Draco pnts\";\n return Promise.reject(loader.getError(errorMessage, error));\n });\n}\n\nfunction processDracoAttributes(loader, draco, result) {\n loader._state = ResourceLoaderState.READY;\n const parsedContent = loader._parsedContent;\n\n let attribute;\n if (defined(result.POSITION)) {\n attribute = {\n name: \"POSITION\",\n semantic: VertexAttributeSemantic.POSITION,\n typedArray: result.POSITION.array,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n isQuantized: false,\n };\n\n if (defined(result.POSITION.data.quantization)) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n const quantization = result.POSITION.data.quantization;\n const range = quantization.range;\n const quantizedVolumeScale = Cartesian3.fromElements(range, range, range);\n const quantizedVolumeOffset = Cartesian3.unpack(quantization.minValues);\n const quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n\n attribute.isQuantized = true;\n attribute.quantizedRange = quantizedRange;\n attribute.quantizedVolumeOffset = quantizedVolumeOffset;\n attribute.quantizedVolumeScale = quantizedVolumeScale;\n attribute.quantizedComponentDatatype =\n quantizedRange <= 255\n ? ComponentDatatype.UNSIGNED_BYTE\n : ComponentDatatype.UNSIGNED_SHORT;\n attribute.quantizedType = AttributeType.VEC3;\n }\n\n parsedContent.positions = attribute;\n }\n\n if (defined(result.NORMAL)) {\n attribute = {\n name: \"NORMAL\",\n semantic: VertexAttributeSemantic.NORMAL,\n typedArray: result.NORMAL.array,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n isQuantized: false,\n octEncoded: false,\n octEncodedZXY: false,\n };\n\n if (defined(result.NORMAL.data.quantization)) {\n const octEncodedRange =\n (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n attribute.quantizedRange = octEncodedRange;\n attribute.octEncoded = true;\n attribute.octEncodedZXY = true;\n attribute.quantizedComponentDatatype = ComponentDatatype.UNSIGNED_BYTE;\n attribute.quantizedType = AttributeType.VEC2;\n }\n\n parsedContent.normals = attribute;\n }\n\n if (defined(result.RGBA)) {\n parsedContent.colors = {\n name: \"COLOR\",\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n typedArray: result.RGBA.array,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n type: AttributeType.VEC4,\n normalized: true,\n isTranslucent: true,\n };\n } else if (defined(result.RGB)) {\n parsedContent.colors = {\n name: \"COLOR\",\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n typedArray: result.RGB.array,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n type: AttributeType.VEC3,\n normalized: true,\n isTranslucent: false,\n };\n }\n\n // Transcode Batch ID (3D Tiles 1.0) -> Feature ID (3D Tiles Next)\n if (defined(result.BATCH_ID)) {\n const batchIds = result.BATCH_ID.array;\n parsedContent.batchIds = {\n name: \"_FEATURE_ID\",\n semantic: VertexAttributeSemantic.FEATURE_ID,\n setIndex: 0,\n typedArray: batchIds,\n componentDatatype: ComponentDatatype.fromTypedArray(batchIds),\n type: AttributeType.SCALAR,\n };\n }\n\n let batchTableJson = parsedContent.batchTableJson;\n\n const batchTableProperties = draco.batchTableProperties;\n for (const name in batchTableProperties) {\n if (batchTableProperties.hasOwnProperty(name)) {\n const property = result[name];\n\n if (!defined(batchTableJson)) {\n batchTableJson = {};\n }\n\n parsedContent.hasDracoBatchTable = true;\n\n const data = property.data;\n batchTableJson[name] = {\n byteOffset: data.byteOffset,\n // Draco returns the results like glTF values, but here\n // we want to transcode to a batch table. It's redundant\n // but necessary to use parseBatchTable()\n type: transcodeAttributeType(data.componentsPerAttribute),\n componentType: transcodeComponentType(data.componentDatatype),\n // Each property is stored as a separate typed array, so\n // store it here. parseBatchTable() will check for this\n // instead of the entire binary body.\n typedArray: property.array,\n };\n }\n }\n parsedContent.batchTableJson = batchTableJson;\n}\n\nfunction transcodeAttributeType(componentsPerAttribute) {\n switch (componentsPerAttribute) {\n case 1:\n return \"SCALAR\";\n case 2:\n return \"VEC2\";\n case 3:\n return \"VEC3\";\n case 4:\n return \"VEC4\";\n}\n}\n\nfunction transcodeComponentType(value) {\n switch (value) {\n case WebGLConstants.BYTE:\n return \"BYTE\";\n case WebGLConstants.UNSIGNED_BYTE:\n return \"UNSIGNED_BYTE\";\n case WebGLConstants.SHORT:\n return \"SHORT\";\n case WebGLConstants.UNSIGNED_SHORT:\n return \"UNSIGNED_SHORT\";\n case WebGLConstants.INT:\n return \"INT\";\n case WebGLConstants.UNSIGNED_INT:\n return \"UNSIGNED_INT\";\n case WebGLConstants.DOUBLE:\n return \"DOUBLE\";\n case WebGLConstants.FLOAT:\n return \"FLOAT\";\n}\n}\n\nfunction makeAttribute(loader, attributeInfo, context) {\n let typedArray = attributeInfo.typedArray;\n let quantization;\n if (attributeInfo.octEncoded) {\n quantization = new Quantization();\n quantization.octEncoded = attributeInfo.octEncoded;\n quantization.octEncodedZXY = attributeInfo.octEncodedZXY;\n quantization.normalizationRange = attributeInfo.quantizedRange;\n quantization.type = attributeInfo.quantizedType;\n quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;\n }\n if (attributeInfo.isQuantized) {\n quantization = new Quantization();\n const normalizationRange = attributeInfo.quantizedRange;\n quantization.normalizationRange = normalizationRange;\n // volume offset sometimes requires 64-bit precision so this is handled\n // in the components.transform matrix.\n quantization.quantizedVolumeOffset = Cartesian3.ZERO;\n const quantizedVolumeDimensions = attributeInfo.quantizedVolumeScale;\n quantization.quantizedVolumeDimensions = quantizedVolumeDimensions;\n quantization.quantizedVolumeStepSize = Cartesian3.divideByScalar(\n quantizedVolumeDimensions,\n normalizationRange,\n new Cartesian3()\n );\n quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;\n quantization.type = attributeInfo.quantizedType;\n }\n\n const attribute = new Attribute();\n attribute.name = attributeInfo.name;\n attribute.semantic = attributeInfo.semantic;\n attribute.setIndex = attributeInfo.setIndex;\n attribute.componentDatatype = attributeInfo.componentDatatype;\n attribute.type = attributeInfo.type;\n attribute.normalized = defaultValue(attributeInfo.normalized, false);\n attribute.min = attributeInfo.min;\n attribute.max = attributeInfo.max;\n attribute.quantization = quantization;\n\n if (attributeInfo.isRGB565) {\n typedArray = AttributeCompression.decodeRGB565(typedArray);\n }\n\n if (defined(attributeInfo.constantColor)) {\n const packedColor = new Array(4);\n attribute.constant = Color.pack(attributeInfo.constantColor, packedColor);\n } else {\n const buffer = Buffer.createVertexBuffer({\n typedArray: typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n });\n buffer.vertexArrayDestroyable = false;\n loader._buffers.push(buffer);\n attribute.buffer = buffer;\n }\n\n const loadAttributesFor2D = loader._loadAttributesFor2D;\n if (\n attribute.semantic === VertexAttributeSemantic.POSITION &&\n loadAttributesFor2D\n ) {\n attribute.typedArray = typedArray;\n }\n\n return attribute;\n}\n\nlet randomNumberGenerator;\nlet randomValues;\n\nfunction getRandomValues(samplesLength) {\n // Use same random values across all runs\n if (!defined(randomValues)) {\n // Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n // See https://github.com/CesiumGS/cesium/issues/9730\n randomNumberGenerator = new MersenneTwister(0);\n randomValues = new Array(samplesLength);\n for (let i = 0; i < samplesLength; ++i) {\n randomValues[i] = randomNumberGenerator.random();\n }\n }\n return randomValues;\n}\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nfunction computeApproximateExtrema(positions) {\n const positionsArray = positions.typedArray;\n const maximumSamplesLength = 20;\n const pointsLength = positionsArray.length / 3;\n const samplesLength = Math.min(pointsLength, maximumSamplesLength);\n const randomValues = getRandomValues(maximumSamplesLength);\n const maxValue = Number.MAX_VALUE;\n const minValue = -Number.MAX_VALUE;\n let min = Cartesian3.fromElements(maxValue, maxValue, maxValue, scratchMin);\n let max = Cartesian3.fromElements(minValue, minValue, minValue, scratchMax);\n let i;\n let index;\n let position;\n if (positions.isQuantized) {\n // The quantized volume offset is not used here since it will become part of\n // the model matrix.\n min = Cartesian3.ZERO;\n max = positions.quantizedVolumeScale;\n } else {\n for (i = 0; i < samplesLength; ++i) {\n index = Math.floor(randomValues[i] * pointsLength);\n position = Cartesian3.unpack(positionsArray, index * 3, scratchPosition);\n\n Cartesian3.minimumByComponent(min, position, min);\n Cartesian3.maximumByComponent(max, position, max);\n }\n }\n\n positions.min = Cartesian3.clone(min);\n positions.max = Cartesian3.clone(max);\n}\n\n// By default, point clouds are rendered as dark gray.\nconst defaultColorAttribute = {\n name: VertexAttributeSemantic.COLOR,\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n constantColor: Color.DARKGRAY,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC4,\n isQuantized: false,\n isTranslucent: false,\n};\n\nfunction makeAttributes(loader, parsedContent, context) {\n const attributes = [];\n let attribute;\n const positions = parsedContent.positions;\n if (defined(positions)) {\n computeApproximateExtrema(positions);\n attribute = makeAttribute(loader, positions, context);\n attribute.count = parsedContent.pointsLength;\n attributes.push(attribute);\n }\n\n if (defined(parsedContent.normals)) {\n attribute = makeAttribute(loader, parsedContent.normals, context);\n attributes.push(attribute);\n }\n\n if (defined(parsedContent.colors)) {\n attribute = makeAttribute(loader, parsedContent.colors, context);\n attributes.push(attribute);\n } else {\n attribute = makeAttribute(loader, defaultColorAttribute, context);\n attributes.push(attribute);\n }\n\n if (defined(parsedContent.batchIds)) {\n attribute = makeAttribute(loader, parsedContent.batchIds, context);\n attributes.push(attribute);\n }\n\n return attributes;\n}\n\nfunction makeStructuralMetadata(parsedContent, customAttributeOutput) {\n const batchLength = parsedContent.batchLength;\n const pointsLength = parsedContent.pointsLength;\n const batchTableBinary = parsedContent.batchTableBinary;\n\n // If there are batch IDs, parse as a property table. Otherwise, parse\n // as property attributes.\n const parseAsPropertyAttributes = !defined(parsedContent.batchIds);\n\n if (defined(batchTableBinary) || parsedContent.hasDracoBatchTable) {\n const count = defaultValue(batchLength, pointsLength);\n return parseBatchTable({\n count: count,\n batchTable: parsedContent.batchTableJson,\n binaryBody: batchTableBinary,\n parseAsPropertyAttributes: parseAsPropertyAttributes,\n customAttributeOutput: customAttributeOutput,\n });\n }\n\n return new StructuralMetadata({\n schema: {},\n propertyTables: [],\n });\n}\n\nfunction makeComponents(loader, context) {\n const parsedContent = loader._parsedContent;\n\n const metallicRoughness = new MetallicRoughness();\n metallicRoughness.metallicFactor = 0;\n metallicRoughness.roughnessFactor = 0.9;\n\n const material = new Material();\n material.metallicRoughness = metallicRoughness;\n\n const colors = parsedContent.colors;\n if (defined(colors) && colors.isTranslucent) {\n material.alphaMode = AlphaMode.BLEND;\n }\n\n // Render point clouds as unlit, unless normals are present, in which case\n // render as a PBR material.\n const isUnlit = !defined(parsedContent.normals);\n material.unlit = isUnlit;\n\n const primitive = new Primitive();\n primitive.attributes = makeAttributes(loader, parsedContent, context);\n primitive.primitiveType = PrimitiveType.POINTS;\n primitive.material = material;\n\n if (defined(parsedContent.batchIds)) {\n const featureIdAttribute = new FeatureIdAttribute();\n featureIdAttribute.propertyTableId = 0;\n featureIdAttribute.setIndex = 0;\n featureIdAttribute.positionalLabel = \"featureId_0\";\n primitive.featureIds.push(featureIdAttribute);\n }\n\n const node = new Node();\n node.index = 0;\n node.primitives = [primitive];\n\n const scene = new Scene();\n scene.nodes = [node];\n scene.upAxis = Axis.Z;\n scene.forwardAxis = Axis.X;\n\n const components = new Components();\n components.scene = scene;\n components.nodes = [node];\n\n // Per-point features will be parsed as property attributes and handled on\n // the GPU since CPU styling would be too expensive. However, if batch IDs\n // exist, features will be parsed as a property table.\n //\n // Property attributes refer to a custom attribute that will\n // store the values; such attributes will be populated in this array\n // as needed.\n const customAttributeOutput = [];\n components.structuralMetadata = makeStructuralMetadata(\n parsedContent,\n customAttributeOutput\n );\n\n if (customAttributeOutput.length > 0) {\n addPropertyAttributesToPrimitive(\n loader,\n primitive,\n customAttributeOutput,\n context\n );\n }\n\n if (defined(parsedContent.rtcCenter)) {\n components.transform = Matrix4.multiplyByTranslation(\n components.transform,\n parsedContent.rtcCenter,\n components.transform\n );\n }\n\n const positions = parsedContent.positions;\n if (defined(positions) && positions.isQuantized) {\n // The volume offset is sometimes in ECEF, so this is applied here rather\n // than the dequantization shader to avoid jitter\n components.transform = Matrix4.multiplyByTranslation(\n components.transform,\n positions.quantizedVolumeOffset,\n components.transform\n );\n }\n\n loader._components = components;\n\n // Free the parsed content and array buffer so we don't hold onto the large arrays.\n loader._parsedContent = undefined;\n loader._arrayBuffer = undefined;\n}\n\nfunction addPropertyAttributesToPrimitive(\n loader,\n primitive,\n customAttributes,\n context\n) {\n const attributes = primitive.attributes;\n\n const length = customAttributes.length;\n for (let i = 0; i < length; i++) {\n const customAttribute = customAttributes[i];\n\n // Upload the typed array to the GPU and free the CPU copy.\n const buffer = Buffer.createVertexBuffer({\n typedArray: customAttribute.typedArray,\n context: context,\n usage: BufferUsage.STATIC_DRAW,\n });\n buffer.vertexArrayDestroyable = false;\n loader._buffers.push(buffer);\n customAttribute.buffer = buffer;\n customAttribute.typedArray = undefined;\n\n attributes.push(customAttribute);\n }\n\n // The batch table is always transcoded as a single property attribute, so\n // it will always be index 0\n primitive.propertyAttributeIds = [0];\n}\n\nPntsLoader.prototype.unload = function () {\n const buffers = this._buffers;\n for (let i = 0; i < buffers.length; i++) {\n buffers[i].destroy();\n }\n buffers.length = 0;\n\n this._components = undefined;\n this._parsedContent = undefined;\n this._arrayBuffer = undefined;\n};\n\nexport default PntsLoader;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport AttributeType from \"./AttributeType.js\";\nimport Cesium3DTileFeatureTable from \"./Cesium3DTileFeatureTable.js\";\nimport VertexAttributeSemantic from \"./VertexAttributeSemantic.js\";\n\n/**\n * Handles parsing of a Point Cloud\n *\n * @namespace PntsParser\n * @private\n */\nconst PntsParser = {};\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\n/**\n * Parses the contents of a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud|Point Cloud}.\n *\n * @private\n *\n * @param {*} arrayBuffer The array buffer containing the pnts\n * @param {*} [byteOffset=0] The byte offset of the beginning of the pnts in the array buffer\n * @returns {Object} An object containing a parsed representation of the point cloud\n */\nPntsParser.parse = function (arrayBuffer, byteOffset) {\n byteOffset = defaultValue(byteOffset, 0);\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Point Cloud tile version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n // Skip byteLength\n byteOffset += sizeOfUint32;\n\n const featureTableJsonByteLength = view.getUint32(byteOffset, true);\n if (featureTableJsonByteLength === 0) {\n throw new RuntimeError(\n \"Feature table must have a byte length greater than zero\"\n );\n }\n byteOffset += sizeOfUint32;\n\n const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const batchTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const featureTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n featureTableJsonByteLength\n );\n byteOffset += featureTableJsonByteLength;\n\n const featureTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n featureTableBinaryByteLength\n );\n byteOffset += featureTableBinaryByteLength;\n\n // Get the batch table JSON and binary\n let batchTableJson;\n let batchTableBinary;\n if (batchTableJsonByteLength > 0) {\n // Has a batch table JSON\n batchTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n batchTableJsonByteLength\n );\n byteOffset += batchTableJsonByteLength;\n\n if (batchTableBinaryByteLength > 0) {\n // Has a batch table binary\n batchTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n batchTableBinaryByteLength\n );\n byteOffset += batchTableBinaryByteLength;\n }\n }\n\n const featureTable = new Cesium3DTileFeatureTable(\n featureTableJson,\n featureTableBinary\n );\n\n const pointsLength = featureTable.getGlobalProperty(\"POINTS_LENGTH\");\n featureTable.featuresLength = pointsLength;\n\n if (!defined(pointsLength)) {\n throw new RuntimeError(\n \"Feature table global property: POINTS_LENGTH must be defined\"\n );\n }\n\n let rtcCenter = featureTable.getGlobalProperty(\n \"RTC_CENTER\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (defined(rtcCenter)) {\n rtcCenter = Cartesian3.unpack(rtcCenter);\n }\n\n // Start with the draco compressed properties and add in uncompressed\n // properties.\n const parsedContent = parseDracoProperties(featureTable, batchTableJson);\n parsedContent.rtcCenter = rtcCenter;\n parsedContent.pointsLength = pointsLength;\n\n if (!parsedContent.hasPositions) {\n const positions = parsePositions(featureTable);\n parsedContent.positions = positions;\n parsedContent.hasPositions =\n parsedContent.hasPositions || defined(positions);\n }\n\n if (!parsedContent.hasPositions) {\n throw new RuntimeError(\n \"Either POSITION or POSITION_QUANTIZED must be defined.\"\n );\n }\n\n if (!parsedContent.hasNormals) {\n const normals = parseNormals(featureTable);\n parsedContent.normals = normals;\n parsedContent.hasNormals = parsedContent.hasNormals || defined(normals);\n }\n\n if (!parsedContent.hasColors) {\n const colors = parseColors(featureTable);\n parsedContent.colors = colors;\n parsedContent.hasColors = parsedContent.hasColors || defined(colors);\n parsedContent.hasConstantColor = defined(parsedContent.constantColor);\n parsedContent.isTranslucent = defined(colors) && colors.isTranslucent;\n }\n\n if (!parsedContent.hasBatchIds) {\n const batchIds = parseBatchIds(featureTable);\n parsedContent.batchIds = batchIds;\n parsedContent.hasBatchIds = parsedContent.hasBatchIds || defined(batchIds);\n }\n\n if (parsedContent.hasBatchIds) {\n const batchLength = featureTable.getGlobalProperty(\"BATCH_LENGTH\");\n if (!defined(batchLength)) {\n throw new RuntimeError(\n \"Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.\"\n );\n }\n parsedContent.batchLength = batchLength;\n }\n\n if (defined(batchTableBinary)) {\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n parsedContent.batchTableJson = batchTableJson;\n parsedContent.batchTableBinary = batchTableBinary;\n }\n\n return parsedContent;\n};\n\nfunction parseDracoProperties(featureTable, batchTableJson) {\n const featureTableJson = featureTable.json;\n let dracoBuffer;\n let dracoFeatureTableProperties;\n let dracoBatchTableProperties;\n\n const featureTableDraco = defined(featureTableJson.extensions)\n ? featureTableJson.extensions[\"3DTILES_draco_point_compression\"]\n : undefined;\n const batchTableDraco =\n defined(batchTableJson) && defined(batchTableJson.extensions)\n ? batchTableJson.extensions[\"3DTILES_draco_point_compression\"]\n : undefined;\n\n if (defined(batchTableDraco)) {\n dracoBatchTableProperties = batchTableDraco.properties;\n }\n\n let hasPositions;\n let hasColors;\n let hasNormals;\n let hasBatchIds;\n let isTranslucent;\n if (defined(featureTableDraco)) {\n dracoFeatureTableProperties = featureTableDraco.properties;\n const dracoByteOffset = featureTableDraco.byteOffset;\n const dracoByteLength = featureTableDraco.byteLength;\n if (\n !defined(dracoFeatureTableProperties) ||\n !defined(dracoByteOffset) ||\n !defined(dracoByteLength)\n ) {\n throw new RuntimeError(\n \"Draco properties, byteOffset, and byteLength must be defined\"\n );\n }\n dracoBuffer = featureTable.buffer.slice(\n dracoByteOffset,\n dracoByteOffset + dracoByteLength\n );\n hasPositions = defined(dracoFeatureTableProperties.POSITION);\n hasColors =\n defined(dracoFeatureTableProperties.RGB) ||\n defined(dracoFeatureTableProperties.RGBA);\n hasNormals = defined(dracoFeatureTableProperties.NORMAL);\n hasBatchIds = defined(dracoFeatureTableProperties.BATCH_ID);\n isTranslucent = defined(dracoFeatureTableProperties.RGBA);\n }\n\n let draco;\n if (defined(dracoBuffer)) {\n draco = {\n buffer: dracoBuffer,\n featureTableProperties: dracoFeatureTableProperties,\n batchTableProperties: dracoBatchTableProperties,\n properties: combine(\n dracoFeatureTableProperties,\n dracoBatchTableProperties\n ),\n dequantizeInShader: true,\n };\n }\n\n return {\n draco: draco,\n hasPositions: hasPositions,\n hasColors: hasColors,\n isTranslucent: isTranslucent,\n hasNormals: hasNormals,\n hasBatchIds: hasBatchIds,\n };\n}\n\nfunction parsePositions(featureTable) {\n const featureTableJson = featureTable.json;\n\n let positions;\n if (defined(featureTableJson.POSITION)) {\n positions = featureTable.getPropertyArray(\n \"POSITION\",\n ComponentDatatype.FLOAT,\n 3\n );\n\n return {\n name: VertexAttributeSemantic.POSITION,\n semantic: VertexAttributeSemantic.POSITION,\n typedArray: positions,\n isQuantized: false,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n };\n } else if (defined(featureTableJson.POSITION_QUANTIZED)) {\n positions = featureTable.getPropertyArray(\n \"POSITION_QUANTIZED\",\n ComponentDatatype.UNSIGNED_SHORT,\n 3\n );\n\n const quantizedVolumeScale = featureTable.getGlobalProperty(\n \"QUANTIZED_VOLUME_SCALE\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (!defined(quantizedVolumeScale)) {\n throw new RuntimeError(\n \"Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.\"\n );\n }\n const quantizedRange = (1 << 16) - 1;\n\n const quantizedVolumeOffset = featureTable.getGlobalProperty(\n \"QUANTIZED_VOLUME_OFFSET\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (!defined(quantizedVolumeOffset)) {\n throw new RuntimeError(\n \"Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.\"\n );\n }\n\n return {\n name: VertexAttributeSemantic.POSITION,\n semantic: VertexAttributeSemantic.POSITION,\n typedArray: positions,\n isQuantized: true,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n quantizedRange: quantizedRange,\n quantizedVolumeOffset: Cartesian3.unpack(quantizedVolumeOffset),\n quantizedVolumeScale: Cartesian3.unpack(quantizedVolumeScale),\n quantizedComponentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n quantizedType: AttributeType.VEC3,\n };\n }\n}\n\nfunction parseColors(featureTable) {\n const featureTableJson = featureTable.json;\n\n let colors;\n if (defined(featureTableJson.RGBA)) {\n colors = featureTable.getPropertyArray(\n \"RGBA\",\n ComponentDatatype.UNSIGNED_BYTE,\n 4\n );\n return {\n name: VertexAttributeSemantic.COLOR,\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n typedArray: colors,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n type: AttributeType.VEC4,\n normalized: true,\n isRGB565: false,\n isTranslucent: true,\n };\n } else if (defined(featureTableJson.RGB)) {\n colors = featureTable.getPropertyArray(\n \"RGB\",\n ComponentDatatype.UNSIGNED_BYTE,\n 3\n );\n return {\n name: \"COLOR\",\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n typedArray: colors,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n type: AttributeType.VEC3,\n normalized: true,\n isRGB565: false,\n isTranslucent: false,\n };\n } else if (defined(featureTableJson.RGB565)) {\n colors = featureTable.getPropertyArray(\n \"RGB565\",\n ComponentDatatype.UNSIGNED_SHORT,\n 1\n );\n return {\n name: \"COLOR\",\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n typedArray: colors,\n // These settings are for the Model implementation\n // which decodes on the CPU and uploads a VEC3 of float colors.\n // PointCloud does the decoding on the GPU so uploads a\n // UNSIGNED_SHORT instead.\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n normalized: false,\n isRGB565: true,\n isTranslucent: false,\n };\n } else if (defined(featureTableJson.CONSTANT_RGBA)) {\n const constantRGBA = featureTable.getGlobalProperty(\n \"CONSTANT_RGBA\",\n ComponentDatatype.UNSIGNED_BYTE,\n 4\n );\n\n const alpha = constantRGBA[3];\n const constantColor = Color.fromBytes(\n constantRGBA[0],\n constantRGBA[1],\n constantRGBA[2],\n alpha\n );\n\n const isTranslucent = alpha < 255;\n return {\n name: VertexAttributeSemantic.COLOR,\n semantic: VertexAttributeSemantic.COLOR,\n setIndex: 0,\n constantColor: constantColor,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC4,\n isQuantized: false,\n isTranslucent: isTranslucent,\n };\n }\n\n return undefined;\n}\n\nfunction parseNormals(featureTable) {\n const featureTableJson = featureTable.json;\n let normals;\n if (defined(featureTableJson.NORMAL)) {\n normals = featureTable.getPropertyArray(\n \"NORMAL\",\n ComponentDatatype.FLOAT,\n 3\n );\n return {\n name: VertexAttributeSemantic.NORMAL,\n semantic: VertexAttributeSemantic.NORMAL,\n typedArray: normals,\n octEncoded: false,\n octEncodedZXY: false,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n };\n } else if (defined(featureTableJson.NORMAL_OCT16P)) {\n normals = featureTable.getPropertyArray(\n \"NORMAL_OCT16P\",\n ComponentDatatype.UNSIGNED_BYTE,\n 2\n );\n const quantizationBits = 8;\n return {\n name: VertexAttributeSemantic.NORMAL,\n semantic: VertexAttributeSemantic.NORMAL,\n typedArray: normals,\n octEncoded: true,\n octEncodedZXY: false,\n quantizedRange: (1 << quantizationBits) - 1,\n quantizedType: AttributeType.VEC2,\n quantizedComponentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentDatatype: ComponentDatatype.FLOAT,\n type: AttributeType.VEC3,\n };\n }\n\n return undefined;\n}\n\nfunction parseBatchIds(featureTable) {\n const featureTableJson = featureTable.json;\n if (defined(featureTableJson.BATCH_ID)) {\n const batchIds = featureTable.getPropertyArray(\n \"BATCH_ID\",\n ComponentDatatype.UNSIGNED_SHORT,\n 1\n );\n return {\n name: VertexAttributeSemantic.FEATURE_ID,\n semantic: VertexAttributeSemantic.FEATURE_ID,\n setIndex: 0,\n typedArray: batchIds,\n componentDatatype: ComponentDatatype.fromTypedArray(batchIds),\n type: AttributeType.SCALAR,\n };\n }\n\n return undefined;\n}\n\nexport default PntsParser;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartographic from \"../../Core/Cartographic.js\";\nimport Check from \"../../Core/Check.js\";\nimport Credit from \"../../Core/Credit.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DistanceDisplayCondition from \"../../Core/DistanceDisplayCondition.js\";\nimport Matrix3 from \"../../Core/Matrix3.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Resource from \"../../Core/Resource.js\";\nimport RuntimeError from \"../../Core/RuntimeError.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ClippingPlaneCollection from \"../ClippingPlaneCollection.js\";\nimport ColorBlendMode from \"../ColorBlendMode.js\";\nimport GltfLoader from \"../GltfLoader.js\";\nimport HeightReference from \"../HeightReference.js\";\nimport ImageBasedLighting from \"../ImageBasedLighting.js\";\nimport PointCloudShading from \"../PointCloudShading.js\";\nimport SceneMode from \"../SceneMode.js\";\nimport SceneTransforms from \"../SceneTransforms.js\";\nimport ShadowMode from \"../ShadowMode.js\";\nimport SplitDirection from \"../SplitDirection.js\";\nimport B3dmLoader from \"./B3dmLoader.js\";\nimport GeoJsonLoader from \"./GeoJsonLoader.js\";\nimport I3dmLoader from \"./I3dmLoader.js\";\nimport ModelAnimationCollection from \"./ModelAnimationCollection.js\";\nimport ModelFeatureTable from \"./ModelFeatureTable.js\";\nimport ModelSceneGraph from \"./ModelSceneGraph.js\";\nimport ModelStatistics from \"./ModelStatistics.js\";\nimport ModelType from \"./ModelType.js\";\nimport ModelUtility from \"./ModelUtility.js\";\nimport oneTimeWarning from \"../../Core/oneTimeWarning.js\";\nimport PntsLoader from \"./PntsLoader.js\";\nimport StyleCommandsNeeded from \"./StyleCommandsNeeded.js\";\n\n/**\n * <div class=\"notice\">\n * To construct a Model, call {@link Model.fromGltf}. Do not call the constructor directly.\n * </div>\n * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.\n * <p>\n * Cesium supports glTF assets with the following extensions:\n * <ul>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}\n * </li>\n * <li>\n * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC}\n * </li>\n * </ul>\n * </p>\n * <p>\n * Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions\n * for maximum compatibility. This is because some samplers require power of 2 textures ({@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL|Using textures in WebGL})\n * and KHR_texture_basisu requires multiple of 4 dimensions ({@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md#additional-requirements|KHR_texture_basisu additional requirements}).\n * </p>\n *\n * @alias Model\n * @internalConstructor\n *\n * @privateParam {ResourceLoader} options.loader The loader used to load resources for this model.\n * @privateParam {ModelType} options.type Type of this model, to distinguish individual glTF files from 3D Tiles internally. \n * @privateParam {Object} options Object with the following properties:\n * @privateParam {Resource} options.resource The Resource to the 3D model.\n * @privateParam {Boolean} [options.show=true] Whether or not to render the model.\n * @privateParam {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.\n * @privateParam {Number} [options.scale=1.0] A uniform scale applied to this model.\n * @privateParam {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.\n * @privateParam {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @privateParam {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.\n * @privateParam {Boolean} [options.allowPicking=true] When <code>true</code>, each primitive is pickable with {@link Scene#pick}.\n * @privateParam {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n * @privateParam {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from light sources.\n * @privateParam {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.\n * @privateParam {Boolean} [options.enableDebugWireframe=false] For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.\n * @privateParam {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.\n * @privateParam {Boolean} [options.cull=true] Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.\n * @privateParam {Boolean} [options.opaquePass=Pass.OPAQUE] The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n * @privateParam {CustomShader} [options.customShader] A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.\n * @privateParam {Cesium3DTileContent} [options.content] The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.\n * @privateParam {HeightReference} [options.heightReference=HeightReference.NONE] Determines how the model is drawn relative to terrain.\n * @privateParam {Scene} [options.scene] Must be passed in for models that use the height reference property.\n * @privateParam {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.\n * @privateParam {Color} [options.color] A color that blends with the model's rendered color.\n * @privateParam {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.\n * @privateParam {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @privateParam {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.\n * @privateParam {Number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.\n * @privateParam {Boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @privateParam {Boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @privateParam {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @privateParam {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @privateParam {Cartesian3} [options.lightColor] The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @privateParam {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting on this model.\n * @privateParam {Boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.\n * @privateParam {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n * @privateParam {Boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this model on screen.\n * @privateParam {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this model.\n * @privateParam {Boolean} [options.projectTo2D=false] Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded.\n * @privateParam {String|Number} [options.featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @privateParam {String|Number} [options.instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @privateParam {Object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.\n * @privateParam {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.\n \n *\n * @see Model.fromGltf\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=3D%20Models.html|Cesium Sandcastle Models Demo}\n */\nfunction Model(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n /**\n * The loader used to load resources for this model.\n *\n * @type {ResourceLoader}\n * @private\n */\n this._loader = options.loader;\n this._resource = options.resource;\n\n /**\n * Type of this model, to distinguish individual glTF files from 3D Tiles\n * internally.\n *\n * @type {ModelType}\n * @readonly\n *\n * @private\n */\n this.type = defaultValue(options.type, ModelType.GLTF);\n\n /**\n * The 4x4 transformation matrix that transforms the model from model to world coordinates.\n * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n * \n * @type {Matrix4}\n\n * @default {@link Matrix4.IDENTITY}\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = Matrix4.clone(this.modelMatrix);\n this._scale = defaultValue(options.scale, 1.0);\n\n this._minimumPixelSize = defaultValue(options.minimumPixelSize, 0.0);\n\n this._maximumScale = options.maximumScale;\n\n /**\n * The scale value after being clamped by the maximum scale parameter.\n * Used to adjust bounding spheres without repeated calculation.\n *\n * @type {Number}\n * @private\n */\n this._clampedScale = defined(this._maximumScale)\n ? Math.min(this._scale, this._maximumScale)\n : this._scale;\n\n this._computedScale = this._clampedScale;\n\n /**\n * Whether or not the ModelSceneGraph should call updateModelMatrix.\n * This will be true if any of the model matrix, scale, minimum pixel size, or maximum scale are dirty.\n *\n * @type {Number}\n * @private\n */\n this._updateModelMatrix = false;\n\n /**\n * If defined, this matrix is used to transform miscellaneous properties like\n * clipping planes and image-based lighting instead of the modelMatrix. This is\n * so that when models are part of a tileset, these properties get transformed\n * relative to a common reference (such as the root).\n *\n * @type {Matrix4}\n * @private\n */\n this.referenceMatrix = undefined;\n this._iblReferenceFrameMatrix = Matrix3.clone(Matrix3.IDENTITY); // Derived from reference matrix and the current view matrix\n\n this._resourcesLoaded = false;\n this._drawCommandsBuilt = false;\n\n this._ready = false;\n this._customShader = options.customShader;\n this._content = options.content;\n\n this._texturesLoaded = false;\n this._defaultTexture = undefined;\n\n this._activeAnimations = new ModelAnimationCollection(this);\n this._clampAnimations = defaultValue(options.clampAnimations, true);\n\n // This flag is true when the Cesium API, not a glTF animation, changes\n // the transform of a node in the model.\n this._userAnimationDirty = false;\n\n this._id = options.id;\n this._idDirty = false;\n\n this._color = Color.clone(options.color);\n this._colorBlendMode = defaultValue(\n options.colorBlendMode,\n ColorBlendMode.HIGHLIGHT\n );\n this._colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);\n\n const silhouetteColor = defaultValue(options.silhouetteColor, Color.RED);\n this._silhouetteColor = Color.clone(silhouetteColor);\n this._silhouetteSize = defaultValue(options.silhouetteSize, 0.0);\n this._silhouetteDirty = false;\n\n // If silhouettes are used for the model, this will be set to the number\n // of the stencil buffer used for rendering the silhouette. This is set\n // by ModelSilhouettePipelineStage, not by Model itself.\n this._silhouetteId = undefined;\n\n this._cull = defaultValue(options.cull, true);\n this._opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);\n this._allowPicking = defaultValue(options.allowPicking, true);\n this._show = defaultValue(options.show, true);\n\n this._style = undefined;\n this._styleDirty = false;\n this._styleCommandsNeeded = undefined;\n\n let featureIdLabel = defaultValue(options.featureIdLabel, \"featureId_0\");\n if (typeof featureIdLabel === \"number\") {\n featureIdLabel = `featureId_${featureIdLabel}`;\n }\n this._featureIdLabel = featureIdLabel;\n\n let instanceFeatureIdLabel = defaultValue(\n options.instanceFeatureIdLabel,\n \"instanceFeatureId_0\"\n );\n if (typeof instanceFeatureIdLabel === \"number\") {\n instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;\n }\n this._instanceFeatureIdLabel = instanceFeatureIdLabel;\n\n this._featureTables = [];\n this._featureTableId = undefined;\n this._featureTableIdDirty = true;\n\n // Keeps track of resources that need to be destroyed when the draw commands are reset.\n this._pipelineResources = [];\n\n // Keeps track of resources that need to be destroyed when the Model is destroyed.\n this._modelResources = [];\n\n // Keeps track of the pick IDs for this model. These are stored and destroyed in the\n // pipeline resources array; the purpose of this array is to separate them from other\n // resources and update their ID objects when necessary.\n this._pickIds = [];\n\n // The model's bounding sphere and its initial radius are computed\n // in ModelSceneGraph.\n this._boundingSphere = new BoundingSphere();\n this._initialRadius = undefined;\n\n this._heightReference = defaultValue(\n options.heightReference,\n HeightReference.NONE\n );\n this._heightDirty = this._heightReference !== HeightReference.NONE;\n this._removeUpdateHeightCallback = undefined;\n\n this._clampedModelMatrix = undefined; // For use with height reference\n\n const scene = options.scene;\n if (defined(scene) && defined(scene.terrainProviderChanged)) {\n this._terrainProviderChangedCallback = scene.terrainProviderChanged.addEventListener(\n function () {\n this._heightDirty = true;\n },\n this\n );\n }\n this._scene = scene;\n\n this._distanceDisplayCondition = options.distanceDisplayCondition;\n\n const pointCloudShading = new PointCloudShading(options.pointCloudShading);\n this._pointCloudShading = pointCloudShading;\n this._attenuation = pointCloudShading.attenuation;\n this._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;\n\n // If the given clipping planes don't have an owner, make this model its owner.\n // Otherwise, the clipping planes are passed down from a tileset.\n const clippingPlanes = options.clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.owner === undefined) {\n ClippingPlaneCollection.setOwner(clippingPlanes, this, \"_clippingPlanes\");\n } else {\n this._clippingPlanes = clippingPlanes;\n }\n this._clippingPlanesState = 0; // If this value changes, the shaders need to be regenerated.\n this._clippingPlanesMatrix = Matrix4.clone(Matrix4.IDENTITY); // Derived from reference matrix and the current view matrix\n\n this._lightColor = Cartesian3.clone(options.lightColor);\n\n this._imageBasedLighting = defined(options.imageBasedLighting)\n ? options.imageBasedLighting\n : new ImageBasedLighting();\n this._shouldDestroyImageBasedLighting = !defined(options.imageBasedLighting);\n\n this._backFaceCulling = defaultValue(options.backFaceCulling, true);\n this._backFaceCullingDirty = false;\n\n this._shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n this._shadowsDirty = false;\n\n this._debugShowBoundingVolumeDirty = false;\n this._debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n this._enableDebugWireframe = defaultValue(\n options.enableDebugWireframe,\n false\n );\n this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n this._debugWireframe = defaultValue(options.debugWireframe, false);\n\n // Warning for improper setup of debug wireframe\n if (\n this._debugWireframe === true &&\n this._enableDebugWireframe === false &&\n this.type === ModelType.GLTF\n ) {\n oneTimeWarning(\n \"model-debug-wireframe-ignored\",\n \"enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.\"\n );\n }\n\n // Credit specified by the user.\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n\n this._credit = credit;\n\n // Credits to be added from the Resource (if it is an IonResource)\n this._resourceCredits = [];\n\n // Credits parsed from the glTF by GltfLoader.\n this._gltfCredits = [];\n\n this._showCreditsOnScreen = defaultValue(options.showCreditsOnScreen, false);\n this._showCreditsOnScreenDirty = true;\n\n this._splitDirection = defaultValue(\n options.splitDirection,\n SplitDirection.NONE\n );\n\n this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n\n /**\n * Whether to display the outline for models using the\n * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.\n * When true, outlines are displayed. When false, outlines are not displayed.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.showOutline = defaultValue(options.showOutline, true);\n\n /**\n * The color to use when rendering outlines.\n *\n * @type {Color}\n *\n * @default Color.BLACK\n */\n this.outlineColor = defaultValue(options.outlineColor, Color.BLACK);\n\n this._classificationType = options.classificationType;\n\n this._statistics = new ModelStatistics();\n\n this._sceneMode = undefined;\n this._projectTo2D = defaultValue(options.projectTo2D, false);\n\n this._skipLevelOfDetail = false;\n this._ignoreCommands = defaultValue(options.ignoreCommands, false);\n\n this._completeLoad = function (model, frameState) {};\n this._texturesLoadedPromise = undefined;\n this._readyPromise = initialize(this);\n\n this._sceneGraph = undefined;\n this._nodesByName = {}; // Stores the nodes by their names in the glTF.\n\n /**\n * Used for picking primitives that wrap a model.\n *\n * @private\n */\n this.pickObject = options.pickObject;\n}\n\nfunction createModelFeatureTables(model, structuralMetadata) {\n const featureTables = model._featureTables;\n\n const propertyTables = structuralMetadata.propertyTables;\n const length = propertyTables.length;\n for (let i = 0; i < length; i++) {\n const propertyTable = propertyTables[i];\n const modelFeatureTable = new ModelFeatureTable({\n model: model,\n propertyTable: propertyTable,\n });\n\n featureTables.push(modelFeatureTable);\n }\n\n return featureTables;\n}\n\nfunction selectFeatureTableId(components, model) {\n const featureIdLabel = model._featureIdLabel;\n const instanceFeatureIdLabel = model._instanceFeatureIdLabel;\n\n let i, j;\n let featureIdAttribute;\n\n let node;\n // Scan the nodes till we find one with instances, get the feature table ID\n // if the feature ID attribute of the user-selected index is present.\n for (i = 0; i < components.nodes.length; i++) {\n node = components.nodes[i];\n if (defined(node.instances)) {\n featureIdAttribute = ModelUtility.getFeatureIdsByLabel(\n node.instances.featureIds,\n instanceFeatureIdLabel\n );\n if (\n defined(featureIdAttribute) &&\n defined(featureIdAttribute.propertyTableId)\n ) {\n return featureIdAttribute.propertyTableId;\n }\n }\n }\n\n // Scan the primitives till we find one with textures or attributes, get the feature table ID\n // if the feature ID attribute/texture of the user-selected index is present.\n for (i = 0; i < components.nodes.length; i++) {\n node = components.nodes[i];\n for (j = 0; j < node.primitives.length; j++) {\n const primitive = node.primitives[j];\n const featureIds = ModelUtility.getFeatureIdsByLabel(\n primitive.featureIds,\n featureIdLabel\n );\n\n if (defined(featureIds)) {\n return featureIds.propertyTableId;\n }\n }\n }\n\n // If there's only one feature table, then select it by default. This is\n // to ensure backwards compatibility with the older handling of b3dm models.\n if (model._featureTables.length === 1) {\n return 0;\n }\n}\n\n/**\n * Returns whether the alpha state has changed between invisible,\n * translucent, or opaque.\n *\n * @private\n */\nfunction isColorAlphaDirty(currentColor, previousColor) {\n if (!defined(currentColor) && !defined(previousColor)) {\n return false;\n }\n\n if (defined(currentColor) !== defined(previousColor)) {\n return true;\n }\n\n const currentAlpha = currentColor.alpha;\n const previousAlpha = previousColor.alpha;\n return (\n Math.floor(currentAlpha) !== Math.floor(previousAlpha) ||\n Math.ceil(currentAlpha) !== Math.ceil(previousAlpha)\n );\n}\n\nfunction initialize(model) {\n const loader = model._loader;\n const resource = model._resource;\n\n loader.load();\n\n const loaderPromise = loader.promise.then(function (loader) {\n // If the model is destroyed before the promise resolves, then\n // the loader will have been destroyed as well. Return early.\n if (!defined(loader)) {\n return;\n }\n\n const components = loader.components;\n if (!defined(components)) {\n if (loader.isUnloaded()) {\n return;\n }\n\n throw new RuntimeError(\"Failed to load model.\");\n }\n\n const structuralMetadata = components.structuralMetadata;\n\n if (\n defined(structuralMetadata) &&\n structuralMetadata.propertyTableCount > 0\n ) {\n createModelFeatureTables(model, structuralMetadata);\n }\n\n const sceneGraph = new ModelSceneGraph({\n model: model,\n modelComponents: components,\n });\n\n model._sceneGraph = sceneGraph;\n model._gltfCredits = sceneGraph.components.asset.credits;\n\n const resourceCredits = model._resource.credits;\n if (defined(resourceCredits)) {\n const length = resourceCredits.length;\n for (let i = 0; i < length; i++) {\n model._resourceCredits.push(resourceCredits[i]);\n }\n }\n\n model._resourcesLoaded = true;\n });\n\n // Transcoded .pnts models do not have textures\n const texturesLoadedPromise = defaultValue(\n loader.texturesLoadedPromise,\n Promise.resolve()\n );\n model._texturesLoadedPromise = texturesLoadedPromise\n .then(function () {\n // If the model was destroyed while loading textures, return.\n if (!defined(model) || model.isDestroyed()) {\n return;\n }\n\n model._texturesLoaded = true;\n\n // Re-run the pipeline so texture memory statistics are re-computed\n if (loader._incrementallyLoadTextures) {\n model.resetDrawCommands();\n }\n })\n .catch(ModelUtility.getFailedLoadFunction(model, \"model\", resource));\n\n const promise = new Promise(function (resolve, reject) {\n model._completeLoad = function (model, frameState) {\n // Set the model as ready after the first frame render since the user might set up events subscribed to\n // the post render event, and the model may not be ready for those past the first frame.\n frameState.afterRender.push(function () {\n model._ready = true;\n resolve(model);\n });\n };\n });\n\n return loaderPromise\n .then(function () {\n return promise;\n })\n .catch(ModelUtility.getFailedLoadFunction(model, \"model\", resource));\n}\n\nObject.defineProperties(Model.prototype, {\n /**\n * When <code>true</code>, this model is ready to render, i.e., the external binary, image,\n * and shader files were downloaded and the WebGL resources were created. This is set to\n * <code>true</code> right before {@link Model#readyPromise} is resolved.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets the promise that will be resolved when this model is ready to render, i.e. when the external resources\n * have been downloaded and the WebGL resources are created.\n * <p>\n * This promise is resolved at the end of the frame before the first frame the model is rendered in.\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {Promise.<Model>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * A promise that resolves when all textures are loaded.\n * When <code>incrementallyLoadTextures</code> is true this may resolve after\n * <code>promise</code> resolves.\n *\n * @memberof Model.prototype\n *\n * @type {Promise<void>}\n * @readonly\n *\n * @private\n */\n texturesLoadedPromise: {\n get: function () {\n return this._texturesLoadedPromise;\n },\n },\n\n /**\n * @private\n */\n loader: {\n get: function () {\n return this._loader;\n },\n },\n\n /**\n * Get the estimated memory usage statistics for this model.\n *\n * @memberof Model.prototype\n *\n * @type {ModelStatistics}\n * @readonly\n *\n * @private\n */\n statistics: {\n get: function () {\n return this._statistics;\n },\n },\n\n /**\n * The currently playing glTF animations.\n *\n * @memberof Model.prototype\n *\n * @type {ModelAnimationCollection}\n * @readonly\n */\n activeAnimations: {\n get: function () {\n return this._activeAnimations;\n },\n },\n\n /**\n * Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n *\n * @memberof Model.prototype\n * @type {Boolean}\n *\n * @default true\n */\n clampAnimations: {\n get: function () {\n return this._clampAnimations;\n },\n set: function (value) {\n this._clampAnimations = value;\n },\n },\n\n /**\n * Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property\n * will always be false, since the 3D Tiles culling system is used.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n cull: {\n get: function () {\n return this._cull;\n },\n },\n\n /**\n * The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n *\n * @memberof Model.prototype\n *\n * @type {Pass}\n * @readonly\n *\n * @private\n */\n opaquePass: {\n get: function () {\n return this._opaquePass;\n },\n },\n\n /**\n * Point cloud shading settings for controlling point cloud attenuation\n * and lighting. For 3D Tiles, this is inherited from the\n * {@link Cesium3DTileset}.\n *\n * @memberof Model.prototype\n *\n * @type {PointCloudShading}\n */\n pointCloudShading: {\n get: function () {\n return this._pointCloudShading;\n },\n set: function (value) {\nif (value !== this._pointCloudShading) {\n this.resetDrawCommands();\n }\n this._pointCloudShading = value;\n },\n },\n\n /**\n * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle}\n * may lead to undefined behavior.\n *\n * @memberof Model.prototype\n *\n * @type {CustomShader}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n customShader: {\n get: function () {\n return this._customShader;\n },\n set: function (value) {\n if (value !== this._customShader) {\n this.resetDrawCommands();\n }\n this._customShader = value;\n },\n },\n\n /**\n * The scene graph of this model.\n *\n * @memberof Model.prototype\n *\n * @type {ModelSceneGraph}\n * @private\n */\n sceneGraph: {\n get: function () {\n return this._sceneGraph;\n },\n },\n\n /**\n * The tile content this model belongs to, if it is loaded as part of a {@link Cesium3DTileset}.\n *\n * @memberof Model.prototype\n *\n * @type {Cesium3DTileContent}\n * @readonly\n *\n * @private\n */\n content: {\n get: function () {\n return this._content;\n },\n },\n\n /**\n * The height reference of the model, which determines how the model is drawn\n * relative to terrain.\n *\n * @memberof Model.prototype\n *\n * @type {HeightReference}\n * @default {HeightReference.NONE}\n *\n */\n heightReference: {\n get: function () {\n return this._heightReference;\n },\n set: function (value) {\n if (value !== this._heightReference) {\n this._heightDirty = true;\n }\n this._heightReference = value;\n },\n },\n\n /**\n * Gets or sets the distance display condition, which specifies at what distance\n * from the camera this model will be displayed.\n *\n * @memberof Model.prototype\n *\n * @type {DistanceDisplayCondition}\n *\n * @default undefined\n *\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\nthis._distanceDisplayCondition = DistanceDisplayCondition.clone(\n value,\n this._distanceDisplayCondition\n );\n },\n },\n\n /**\n * The structural metadata from the EXT_structural_metadata extension\n *\n * @memberof Model.prototype\n *\n * @type {StructuralMetadata}\n * @readonly\n *\n * @private\n */\n structuralMetadata: {\n get: function () {\n return this._sceneGraph.components.structuralMetadata;\n },\n },\n\n /**\n * The ID for the feature table to use for picking and styling in this model.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n *\n * @private\n */\n featureTableId: {\n get: function () {\n return this._featureTableId;\n },\n set: function (value) {\n this._featureTableId = value;\n },\n },\n\n /**\n * The feature tables for this model.\n *\n * @memberof Model.prototype\n *\n * @type {Array}\n * @readonly\n *\n * @private\n */\n featureTables: {\n get: function () {\n return this._featureTables;\n },\n set: function (value) {\n this._featureTables = value;\n },\n },\n\n /**\n * A user-defined object that is returned when the model is picked.\n *\n * @memberof Model.prototype\n *\n * @type {Object}\n *\n * @default undefined\n *\n * @see Scene#pick\n */\n id: {\n get: function () {\n return this._id;\n },\n set: function (value) {\n if (value !== this._id) {\n this._idDirty = true;\n }\n\n this._id = value;\n },\n },\n\n /**\n * When <code>true</code>, each primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n allowPicking: {\n get: function () {\n return this._allowPicking;\n },\n },\n\n /**\n * The style to apply to the features in the model. Cannot be applied if a {@link CustomShader} is also applied.\n *\n * @memberof Model.prototype\n *\n * @type {Cesium3DTileStyle}\n */\n style: {\n get: function () {\n return this._style;\n },\n set: function (value) {\n this._style = value;\n this._styleDirty = true;\n },\n },\n\n /**\n * The color to blend with the model's rendered color.\n *\n * @memberof Model.prototype\n *\n * @type {Color}\n *\n * @default undefined\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n if (isColorAlphaDirty(value, this._color)) {\n this.resetDrawCommands();\n }\n this._color = Color.clone(value, this._color);\n },\n },\n\n /**\n * Defines how the color blends with the model.\n *\n * @memberof Model.prototype\n *\n * @type {Cesium3DTileColorBlendMode|ColorBlendMode}\n *\n * @default ColorBlendMode.HIGHLIGHT\n */\n colorBlendMode: {\n get: function () {\n return this._colorBlendMode;\n },\n set: function (value) {\n this._colorBlendMode = value;\n },\n },\n\n /**\n * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n *\n * @default 0.5\n */\n colorBlendAmount: {\n get: function () {\n return this._colorBlendAmount;\n },\n set: function (value) {\n this._colorBlendAmount = value;\n },\n },\n\n /**\n * The silhouette color.\n *\n * @memberof Model.prototype\n *\n * @type {Color}\n *\n * @default Color.RED\n */\n silhouetteColor: {\n get: function () {\n return this._silhouetteColor;\n },\n set: function (value) {\n if (!Color.equals(value, this._silhouetteColor)) {\n const alphaDirty = isColorAlphaDirty(value, this._silhouetteColor);\n this._silhouetteDirty = this._silhouetteDirty || alphaDirty;\n }\n\n this._silhouetteColor = Color.clone(value, this._silhouetteColor);\n },\n },\n\n /**\n * The size of the silhouette in pixels.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n *\n * @default 0.0\n */\n silhouetteSize: {\n get: function () {\n return this._silhouetteSize;\n },\n set: function (value) {\n if (value !== this._silhouetteSize) {\n const currentSize = this._silhouetteSize;\n const sizeDirty =\n (value > 0.0 && currentSize === 0.0) ||\n (value === 0.0 && currentSize > 0.0);\n this._silhouetteDirty = this._silhouetteDirty || sizeDirty;\n\n // Back-face culling needs to be updated in case the silhouette size\n // is greater than zero.\n this._backFaceCullingDirty = this._backFaceCullingDirty || sizeDirty;\n }\n\n this._silhouetteSize = value;\n },\n },\n\n /**\n * Gets the model's bounding sphere in world space. This does not take into account\n * glTF animations, skins, or morph targets. It also does not account for\n * {@link Model#minimumPixelSize}.\n *\n * @memberof Model.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n const modelMatrix = defined(this._clampedModelMatrix)\n ? this._clampedModelMatrix\n : this.modelMatrix;\n updateBoundingSphere(this, modelMatrix);\n\n return this._boundingSphere;\n },\n },\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the model.\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n *\n * @default false\n */\n debugShowBoundingVolume: {\n get: function () {\n return this._debugShowBoundingVolume;\n },\n set: function (value) {\n if (this._debugShowBoundingVolume !== value) {\n this._debugShowBoundingVolumeDirty = true;\n }\n this._debugShowBoundingVolume = value;\n },\n },\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the model in wireframe.\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n *\n * @default false\n */\n debugWireframe: {\n get: function () {\n return this._debugWireframe;\n },\n set: function (value) {\n if (this._debugWireframe !== value) {\n this.resetDrawCommands();\n }\n this._debugWireframe = value;\n\n // Warning for improper setup of debug wireframe\n if (\n this._debugWireframe === true &&\n this._enableDebugWireframe === false &&\n this.type === ModelType.GLTF\n ) {\n oneTimeWarning(\n \"model-debug-wireframe-ignored\",\n \"enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.\"\n );\n }\n },\n },\n\n /**\n * Whether or not to render the model.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n *\n * @default true\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n this._show = value;\n },\n },\n\n /**\n * Label of the feature ID set to use for picking and styling.\n * <p>\n * For EXT_mesh_features, this is the feature ID's label property, or\n * \"featureId_N\" (where N is the index in the featureIds array) when not\n * specified. EXT_feature_metadata did not have a label field, so such\n * feature ID sets are always labeled \"featureId_N\" where N is the index in\n * the list of all feature Ids, where feature ID attributes are listed before\n * feature ID textures.\n * </p>\n * <p>\n * If featureIdLabel is set to an integer N, it is converted to\n * the string \"featureId_N\" automatically. If both per-primitive and\n * per-instance feature IDs are present, the instance feature IDs take\n * priority.\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {String}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n featureIdLabel: {\n get: function () {\n return this._featureIdLabel;\n },\n set: function (value) {\n // indices get converted into featureId_N\n if (typeof value === \"number\") {\n value = `featureId_${value}`;\n }\n\n if (value !== this._featureIdLabel) {\n this._featureTableIdDirty = true;\n }\n\n this._featureIdLabel = value;\n },\n },\n\n /**\n * Label of the instance feature ID set used for picking and styling.\n * <p>\n * If instanceFeatureIdLabel is set to an integer N, it is converted to\n * the string \"instanceFeatureId_N\" automatically.\n * If both per-primitive and per-instance feature IDs are present, the\n * instance feature IDs take priority.\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {String}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n instanceFeatureIdLabel: {\n get: function () {\n return this._instanceFeatureIdLabel;\n },\n set: function (value) {\n // indices get converted into instanceFeatureId_N\n if (typeof value === \"number\") {\n value = `instanceFeatureId_${value}`;\n }\n\n if (value !== this._instanceFeatureIdLabel) {\n this._featureTableIdDirty = true;\n }\n\n this._instanceFeatureIdLabel = value;\n },\n },\n\n /**\n * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n *\n * @memberof Model.prototype\n *\n * @type {ClippingPlaneCollection}\n */\n clippingPlanes: {\n get: function () {\n return this._clippingPlanes;\n },\n set: function (value) {\n if (value !== this._clippingPlanes) {\n // Handle destroying old clipping planes, new clipping planes ownership\n ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n this.resetDrawCommands();\n }\n },\n },\n\n /**\n * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * <p>\n * Disabling additional light sources by setting\n * <code>model.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>\n * will make the model much darker. Here, increasing the intensity of the light source will make the model brighter.\n * </p>\n * @memberof Model.prototype\n *\n * @type {Cartesian3}\n *\n * @default undefined\n */\n lightColor: {\n get: function () {\n return this._lightColor;\n },\n set: function (value) {\n if (defined(value) !== defined(this._lightColor)) {\n this.resetDrawCommands();\n }\n\n this._lightColor = Cartesian3.clone(value, this._lightColor);\n },\n },\n\n /**\n * The properties for managing image-based lighting on this model.\n *\n * @memberof Model.prototype\n *\n * @type {ImageBasedLighting}\n */\n imageBasedLighting: {\n get: function () {\n return this._imageBasedLighting;\n },\n set: function (value) {\n if (value !== this._imageBasedLighting) {\n if (\n this._shouldDestroyImageBasedLighting &&\n !this._imageBasedLighting.isDestroyed()\n ) {\n this._imageBasedLighting.destroy();\n }\n this._imageBasedLighting = value;\n this._shouldDestroyImageBasedLighting = false;\n this.resetDrawCommands();\n }\n },\n },\n\n /**\n * Whether to cull back-facing geometry. When true, back face culling is\n * determined by the material's doubleSided property; when false, back face\n * culling is disabled. Back faces are not culled if {@link Model#color}\n * is translucent or {@link Model#silhouetteSize} is greater than 0.0.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n *\n * @default true\n */\n backFaceCulling: {\n get: function () {\n return this._backFaceCulling;\n },\n set: function (value) {\n if (value !== this._backFaceCulling) {\n this._backFaceCullingDirty = true;\n }\n\n this._backFaceCulling = value;\n },\n },\n\n /**\n * A uniform scale applied to this model before the {@link Model#modelMatrix}.\n * Values greater than <code>1.0</code> increase the size of the model; values\n * less than <code>1.0</code> decrease.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n *\n * @default 1.0\n */\n scale: {\n get: function () {\n return this._scale;\n },\n set: function (value) {\n if (value !== this._scale) {\n this._updateModelMatrix = true;\n }\n this._scale = value;\n },\n },\n\n /**\n * The true scale of the model after being affected by the model's scale,\n * minimum pixel size, and maximum scale parameters.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n computedScale: {\n get: function () {\n return this._computedScale;\n },\n },\n\n /**\n * The approximate minimum pixel size of the model regardless of zoom.\n * This can be used to ensure that a model is visible even when the viewer\n * zooms out. When <code>0.0</code>, no minimum size is enforced.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n *\n * @default 0.0\n */\n minimumPixelSize: {\n get: function () {\n return this._minimumPixelSize;\n },\n set: function (value) {\n if (value !== this._minimumPixelSize) {\n this._updateModelMatrix = true;\n }\n this._minimumPixelSize = value;\n },\n },\n\n /**\n * The maximum scale size for a model. This can be used to give\n * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model\n * is never an unreasonable scale.\n *\n * @memberof Model.prototype\n *\n * @type {Number}\n */\n maximumScale: {\n get: function () {\n return this._maximumScale;\n },\n set: function (value) {\n if (value !== this._maximumScale) {\n this._updateModelMatrix = true;\n }\n this._maximumScale = value;\n },\n },\n\n /**\n * Determines whether the model casts or receives shadows from light sources.\n\n * @memberof Model.prototype\n *\n * @type {ShadowMode}\n *\n * @default ShadowMode.ENABLED\n */\n shadows: {\n get: function () {\n return this._shadows;\n },\n set: function (value) {\n if (value !== this._shadows) {\n this._shadowsDirty = true;\n }\n\n this._shadows = value;\n },\n },\n\n /**\n * Gets the credit that will be displayed for the model.\n *\n * @memberof Model.prototype\n *\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets or sets whether the credits of the model will be displayed\n * on the screen.\n *\n * @memberof Model.prototype\n *\n * @type {Boolean}\n *\n * @default false\n */\n showCreditsOnScreen: {\n get: function () {\n return this._showCreditsOnScreen;\n },\n set: function (value) {\n if (this._showCreditsOnScreen !== value) {\n this._showCreditsOnScreenDirty = true;\n }\n\n this._showCreditsOnScreen = value;\n },\n },\n\n /**\n * The {@link SplitDirection} to apply to this model.\n *\n * @memberof Model.prototype\n *\n * @type {SplitDirection}\n *\n * @default {@link SplitDirection.NONE}\n */\n splitDirection: {\n get: function () {\n return this._splitDirection;\n },\n set: function (value) {\n if (this._splitDirection !== value) {\n this.resetDrawCommands();\n }\n this._splitDirection = value;\n },\n },\n\n /**\n * Gets the model's classification type. This determines whether terrain,\n * 3D Tiles, or both will be classified by this model.\n * <p>\n * Additionally, there are a few requirements/limitations:\n * <ul>\n * <li>The glTF cannot contain morph targets, skins, or animations.</li>\n * <li>The glTF cannot contain the <code>EXT_mesh_gpu_instancing</code> extension.</li>\n * <li>Only meshes with TRIANGLES can be used to classify other assets.</li>\n * <li>The position attribute is required.</li>\n * <li>If feature IDs and an index buffer are both present, all indices with the same feature id must occupy contiguous sections of the index buffer.</li>\n * <li>If feature IDs are present without an index buffer, all positions with the same feature id must occupy contiguous sections of the position buffer.</li>\n * </ul>\n * </p>\n *\n * @memberof Model.prototype\n *\n * @type {ClassificationType}\n * @default undefined\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n * @readonly\n */\n classificationType: {\n get: function () {\n return this._classificationType;\n },\n },\n\n /**\n * Reference to the pick IDs. This is only used internally, e.g. for\n * per-feature post-processing in {@link PostProcessStage}.\n *\n * @memberof Model.prototype\n *\n * @type {PickId[]}\n * @readonly\n *\n * @private\n */\n pickIds: {\n get: function () {\n return this._pickIds;\n },\n },\n\n /**\n * The {@link StyleCommandsNeeded} for the style currently applied to\n * the features in the model. This is used internally by the {@link ModelDrawCommand}\n * when determining which commands to submit in an update.\n *\n * @memberof Model.prototype\n *\n * @type {StyleCommandsNeeded}\n * @readonly\n *\n * @private\n */\n styleCommandsNeeded: {\n get: function () {\n return this._styleCommandsNeeded;\n },\n },\n});\n\n/**\n * Returns the node with the given <code>name</code> in the glTF. This is used to\n * modify a node's transform for user-defined animation.\n *\n * @param {String} name The name of the node in the glTF.\n * @returns {ModelNode} The node, or <code>undefined</code> if no node with the <code>name</code> exists.\n *\n * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.\n *\n * @example\n * // Apply non-uniform scale to node \"Hand\"\n * const node = model.getNode(\"Hand\");\n * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);\n */\nModel.prototype.getNode = function (name) {\n return this._nodesByName[name];\n};\n\n/**\n * Sets the current value of an articulation stage. After setting one or\n * multiple stage values, call Model.applyArticulations() to\n * cause the node matrices to be recalculated.\n *\n * @param {String} articulationStageKey The name of the articulation, a space, and the name of the stage.\n * @param {Number} value The numeric value of this stage of the articulation.\n *\n * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.\n *\n * @see Model#applyArticulations\n *\n * @example\n * // Sets the value of the stage named \"MoveX\" belonging to the articulation named \"SampleArticulation\"\n * model.setArticulationStage(\"SampleArticulation MoveX\", 50.0);\n */\nModel.prototype.setArticulationStage = function (articulationStageKey, value) {\n this._sceneGraph.setArticulationStage(articulationStageKey, value);\n};\n\n/**\n * Applies any modified articulation stages to the matrix of each node that\n * participates in any articulation. Note that this will overwrite any node\n * transformations on participating nodes.\n *\n * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.\n */\nModel.prototype.applyArticulations = function () {\n this._sceneGraph.applyArticulations();\n};\n\n/**\n * Marks the model's {@link Model#style} as dirty, which forces all features\n * to re-evaluate the style in the next frame the model is visible.\n */\nModel.prototype.makeStyleDirty = function () {\n this._styleDirty = true;\n};\n\n/**\n * Resets the draw commands for this model.\n *\n * @private\n */\nModel.prototype.resetDrawCommands = function () {\n this._drawCommandsBuilt = false;\n};\n\nconst scratchIBLReferenceFrameMatrix4 = new Matrix4();\nconst scratchIBLReferenceFrameMatrix3 = new Matrix3();\nconst scratchClippingPlanesMatrix = new Matrix4();\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} Failed to load external reference.\n */\nModel.prototype.update = function (frameState) {\n // Keep processing the model every frame until the main resources\n // (buffer views) and textures (which may be loaded asynchronously)\n // are processed.\n processLoader(this, frameState);\n\n // A custom shader may have to load texture uniforms.\n updateCustomShader(this, frameState);\n\n // The image-based lighting may have to load texture uniforms\n // for specular maps.\n updateImageBasedLighting(this, frameState);\n\n // Short-circuit if the model resources aren't ready or the scene\n // is currently morphing.\n if (!this._resourcesLoaded || frameState.mode === SceneMode.MORPHING) {\n return;\n }\n\n updateFeatureTableId(this);\n updateStyle(this);\n updateFeatureTables(this, frameState);\n updatePointCloudShading(this);\n updateSilhouette(this, frameState);\n updateSkipLevelOfDetail(this, frameState);\n updateClippingPlanes(this, frameState);\n updateSceneMode(this, frameState);\n\n this._defaultTexture = frameState.context.defaultTexture;\n\n buildDrawCommands(this, frameState);\n updateModelMatrix(this, frameState);\n\n // Many features (e.g. image-based lighting, clipping planes) depend on the model\n // matrix being updated for the current height reference, so update it first.\n updateClamping(this);\n\n updateBoundingSphereAndScale(this, frameState);\n updateReferenceMatrices(this, frameState);\n\n // This check occurs after the bounding sphere has been updated so that\n // zooming to the bounding sphere can account for any modifications\n // from the clamp-to-ground setting.\n const model = this;\n if (!model._ready) {\n model._completeLoad(model, frameState);\n\n // Don't render until the next frame after the ready promise is resolved\n return;\n }\n\n updatePickIds(this);\n\n // Update the scene graph and draw commands for any changes in model's properties\n // (e.g. model matrix, back-face culling)\n updateSceneGraph(this, frameState);\n updateShowCreditsOnScreen(this);\n submitDrawCommands(this, frameState);\n};\n\nfunction processLoader(model, frameState) {\n if (!model._resourcesLoaded || !model._texturesLoaded) {\n model._loader.process(frameState);\n }\n}\n\nfunction updateCustomShader(model, frameState) {\n if (defined(model._customShader)) {\n model._customShader.update(frameState);\n }\n}\n\nfunction updateImageBasedLighting(model, frameState) {\n model._imageBasedLighting.update(frameState);\n if (model._imageBasedLighting.shouldRegenerateShaders) {\n model.resetDrawCommands();\n }\n}\n\nfunction updateFeatureTableId(model) {\n if (!model._featureTableIdDirty) {\n return;\n }\n model._featureTableIdDirty = false;\n\n const components = model._sceneGraph.components;\n const structuralMetadata = components.structuralMetadata;\n\n if (\n defined(structuralMetadata) &&\n structuralMetadata.propertyTableCount > 0\n ) {\n model.featureTableId = selectFeatureTableId(components, model);\n\n // Mark the style dirty to re-apply it and reflect the new feature ID table.\n model._styleDirty = true;\n\n // Trigger a rebuild of the draw commands.\n model.resetDrawCommands();\n }\n}\n\nfunction updateStyle(model) {\n if (model._styleDirty) {\n model.applyStyle(model._style);\n model._styleDirty = false;\n }\n}\n\nfunction updateFeatureTables(model, frameState) {\n const featureTables = model._featureTables;\n const length = featureTables.length;\n\n let styleCommandsNeededDirty = false;\n for (let i = 0; i < length; i++) {\n featureTables[i].update(frameState);\n // Check if the types of style commands needed have changed and trigger a reset of the draw commands\n // to ensure that translucent and opaque features are handled in the correct passes.\n if (featureTables[i].styleCommandsNeededDirty) {\n styleCommandsNeededDirty = true;\n }\n }\n\n if (styleCommandsNeededDirty) {\n updateStyleCommandsNeeded(model);\n }\n}\n\nfunction updateStyleCommandsNeeded(model) {\n const featureTable = model.featureTables[model.featureTableId];\n model._styleCommandsNeeded = StyleCommandsNeeded.getStyleCommandsNeeded(\n featureTable.featuresLength,\n featureTable.batchTexture.translucentFeaturesLength\n );\n}\n\nfunction updatePointCloudShading(model) {\n const pointCloudShading = model.pointCloudShading;\n\n // Check if the shader needs to be updated for point cloud attenuation\n // settings.\n if (pointCloudShading.attenuation !== model._attenuation) {\n model.resetDrawCommands();\n model._attenuation = pointCloudShading.attenuation;\n }\n\n if (pointCloudShading.backFaceCulling !== model._pointCloudBackFaceCulling) {\n model.resetDrawCommands();\n model._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;\n }\n}\n\nfunction updateSilhouette(model, frameState) {\n if (model._silhouetteDirty) {\n // Only rebuild draw commands if silhouettes are supported in the first place.\n if (supportsSilhouettes(frameState)) {\n model.resetDrawCommands();\n }\n\n model._silhouetteDirty = false;\n }\n}\n\nfunction updateSkipLevelOfDetail(model, frameState) {\n const skipLevelOfDetail = model.hasSkipLevelOfDetail(frameState);\n if (skipLevelOfDetail !== model._skipLevelOfDetail) {\n model.resetDrawCommands();\n model._skipLevelOfDetail = skipLevelOfDetail;\n }\n}\n\nfunction updateClippingPlanes(model, frameState) {\n // Update the clipping planes collection / state for this model to detect any changes.\n let currentClippingPlanesState = 0;\n if (model.isClippingEnabled()) {\n if (model._clippingPlanes.owner === model) {\n model._clippingPlanes.update(frameState);\n }\n currentClippingPlanesState = model._clippingPlanes.clippingPlanesState;\n }\n\n if (currentClippingPlanesState !== model._clippingPlanesState) {\n model.resetDrawCommands();\n model._clippingPlanesState = currentClippingPlanesState;\n }\n}\n\nfunction updateSceneMode(model, frameState) {\n if (frameState.mode !== model._sceneMode) {\n if (model._projectTo2D) {\n model.resetDrawCommands();\n } else {\n model._updateModelMatrix = true;\n }\n model._sceneMode = frameState.mode;\n }\n}\n\nfunction buildDrawCommands(model, frameState) {\n if (!model._drawCommandsBuilt) {\n model.destroyPipelineResources();\n model._sceneGraph.buildDrawCommands(frameState);\n model._drawCommandsBuilt = true;\n }\n}\n\nfunction updateModelMatrix(model, frameState) {\n // This is done without a dirty flag so that the model matrix can be updated in-place\n // without needing to use a setter.\n if (!Matrix4.equals(model.modelMatrix, model._modelMatrix)) {\nmodel._updateModelMatrix = true;\n model._modelMatrix = Matrix4.clone(model.modelMatrix, model._modelMatrix);\n }\n}\n\nconst scratchPosition = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nfunction updateClamping(model) {\n if (\n !model._updateModelMatrix &&\n !model._heightDirty &&\n model._minimumPixelSize === 0.0\n ) {\n return;\n }\n\n if (defined(model._removeUpdateHeightCallback)) {\n model._removeUpdateHeightCallback();\n model._removeUpdateHeightCallback = undefined;\n }\n\n const scene = model._scene;\n if (\n !defined(scene) ||\n !defined(scene.globe) ||\n model.heightReference === HeightReference.NONE\n ) {\nmodel._clampedModelMatrix = undefined;\n return;\n }\n\n const globe = scene.globe;\n const ellipsoid = globe.ellipsoid;\n\n // Compute cartographic position so we don't recompute every update\n const modelMatrix = model.modelMatrix;\n scratchPosition.x = modelMatrix[12];\n scratchPosition.y = modelMatrix[13];\n scratchPosition.z = modelMatrix[14];\n const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition);\n\n if (!defined(model._clampedModelMatrix)) {\n model._clampedModelMatrix = Matrix4.clone(modelMatrix, new Matrix4());\n }\n\n // Install callback to handle updating of terrain tiles\n const surface = globe._surface;\n model._removeUpdateHeightCallback = surface.updateHeight(\n cartoPosition,\n getUpdateHeightCallback(model, ellipsoid, cartoPosition)\n );\n\n // Set the correct height now\n const height = globe.getHeight(cartoPosition);\n if (defined(height)) {\n // Get callback with cartoPosition being the non-clamped position\n const callback = getUpdateHeightCallback(model, ellipsoid, cartoPosition);\n\n // Compute the clamped cartesian and call updateHeight callback\n Cartographic.clone(cartoPosition, scratchCartographic);\n scratchCartographic.height = height;\n ellipsoid.cartographicToCartesian(scratchCartographic, scratchPosition);\n callback(scratchPosition);\n }\n\n model._heightDirty = false;\n model._updateModelMatrix = true;\n}\n\nfunction updateBoundingSphereAndScale(model, frameState) {\n if (!model._updateModelMatrix && model._minimumPixelSize === 0.0) {\n return;\n }\n\n const modelMatrix = defined(model._clampedModelMatrix)\n ? model._clampedModelMatrix\n : model.modelMatrix;\n\n updateBoundingSphere(model, modelMatrix);\n updateComputedScale(model, modelMatrix, frameState);\n}\n\nfunction updateBoundingSphere(model, modelMatrix) {\n model._boundingSphere = BoundingSphere.transform(\n model._sceneGraph.boundingSphere,\n modelMatrix,\n model._boundingSphere\n );\n\n model._clampedScale = defined(model._maximumScale)\n ? Math.min(model._scale, model._maximumScale)\n : model._scale;\n\n model._boundingSphere.radius = model._initialRadius * model._clampedScale;\n}\n\nfunction updateComputedScale(model, modelMatrix, frameState) {\n let scale = model.scale;\n\n if (model.minimumPixelSize !== 0.0 && !model._projectTo2D) {\n // Compute size of bounding sphere in pixels\n const context = frameState.context;\n const maxPixelSize = Math.max(\n context.drawingBufferWidth,\n context.drawingBufferHeight\n );\n scratchPosition.x = modelMatrix[12];\n scratchPosition.y = modelMatrix[13];\n scratchPosition.z = modelMatrix[14];\n\n if (model._sceneMode !== SceneMode.SCENE3D) {\n SceneTransforms.computeActualWgs84Position(\n frameState,\n scratchPosition,\n scratchPosition\n );\n }\n\n const radius = model._boundingSphere.radius;\n const metersPerPixel = scaleInPixels(scratchPosition, radius, frameState);\n\n // metersPerPixel is always > 0.0\n const pixelsPerMeter = 1.0 / metersPerPixel;\n const diameterInPixels = Math.min(\n pixelsPerMeter * (2.0 * radius),\n maxPixelSize\n );\n\n // Maintain model's minimum pixel size\n if (diameterInPixels < model.minimumPixelSize) {\n scale =\n (model.minimumPixelSize * metersPerPixel) /\n (2.0 * model._initialRadius);\n }\n }\n\n model._computedScale = defined(model.maximumScale)\n ? Math.min(model.maximumScale, scale)\n : scale;\n}\n\nfunction updatePickIds(model) {\n if (!model._idDirty) {\n return;\n }\n model._idDirty = false;\n\n const id = model._id;\n const pickIds = model._pickIds;\n const length = pickIds.length;\n for (let i = 0; i < length; ++i) {\n pickIds[i].object.id = id;\n }\n}\n\nfunction updateReferenceMatrices(model, frameState) {\n const modelMatrix = defined(model._clampedModelMatrix)\n ? model._clampedModelMatrix\n : model.modelMatrix;\n const referenceMatrix = defaultValue(model.referenceMatrix, modelMatrix);\n const context = frameState.context;\n\n const ibl = model._imageBasedLighting;\n if (ibl.useSphericalHarmonicCoefficients || ibl.useSpecularEnvironmentMaps) {\n let iblReferenceFrameMatrix3 = scratchIBLReferenceFrameMatrix3;\n let iblReferenceFrameMatrix4 = scratchIBLReferenceFrameMatrix4;\n\n iblReferenceFrameMatrix4 = Matrix4.multiply(\n context.uniformState.view3D,\n referenceMatrix,\n iblReferenceFrameMatrix4\n );\n iblReferenceFrameMatrix3 = Matrix4.getMatrix3(\n iblReferenceFrameMatrix4,\n iblReferenceFrameMatrix3\n );\n iblReferenceFrameMatrix3 = Matrix3.getRotation(\n iblReferenceFrameMatrix3,\n iblReferenceFrameMatrix3\n );\n model._iblReferenceFrameMatrix = Matrix3.transpose(\n iblReferenceFrameMatrix3,\n model._iblReferenceFrameMatrix\n );\n }\n\n if (model.isClippingEnabled()) {\n let clippingPlanesMatrix = scratchClippingPlanesMatrix;\n clippingPlanesMatrix = Matrix4.multiply(\n context.uniformState.view3D,\n referenceMatrix,\n clippingPlanesMatrix\n );\n clippingPlanesMatrix = Matrix4.multiply(\n clippingPlanesMatrix,\n model._clippingPlanes.modelMatrix,\n clippingPlanesMatrix\n );\n model._clippingPlanesMatrix = Matrix4.inverseTranspose(\n clippingPlanesMatrix,\n model._clippingPlanesMatrix\n );\n }\n}\n\nfunction updateSceneGraph(model, frameState) {\n const sceneGraph = model._sceneGraph;\n if (model._updateModelMatrix || model._minimumPixelSize !== 0.0) {\n const modelMatrix = defined(model._clampedModelMatrix)\n ? model._clampedModelMatrix\n : model.modelMatrix;\n sceneGraph.updateModelMatrix(modelMatrix, frameState);\n model._updateModelMatrix = false;\n }\n\n if (model._backFaceCullingDirty) {\n sceneGraph.updateBackFaceCulling(model._backFaceCulling);\n model._backFaceCullingDirty = false;\n }\n\n if (model._shadowsDirty) {\n sceneGraph.updateShadows(model._shadows);\n model._shadowsDirty = false;\n }\n\n if (model._debugShowBoundingVolumeDirty) {\n sceneGraph.updateShowBoundingVolume(model._debugShowBoundingVolume);\n model._debugShowBoundingVolumeDirty = false;\n }\n\n let updateForAnimations = false;\n // Animations are disabled for classification models.\n if (!defined(model.classificationType)) {\n updateForAnimations =\n model._userAnimationDirty || model._activeAnimations.update(frameState);\n }\n sceneGraph.update(frameState, updateForAnimations);\n model._userAnimationDirty = false;\n}\n\nfunction updateShowCreditsOnScreen(model) {\n if (!model._showCreditsOnScreenDirty) {\n return;\n }\n model._showCreditsOnScreenDirty = false;\n\n const showOnScreen = model._showCreditsOnScreen;\n if (defined(model._credit)) {\n model._credit.showOnScreen = showOnScreen;\n }\n\n const resourceCredits = model._resourceCredits;\n const resourceCreditsLength = resourceCredits.length;\n for (let i = 0; i < resourceCreditsLength; i++) {\n resourceCredits[i].showOnScreen = showOnScreen;\n }\n\n const gltfCredits = model._gltfCredits;\n const gltfCreditsLength = gltfCredits.length;\n for (let i = 0; i < gltfCreditsLength; i++) {\n gltfCredits[i].showOnScreen = showOnScreen;\n }\n}\n\nfunction submitDrawCommands(model, frameState) {\n // Check that show is true after draw commands are built;\n // we want the user to be able to instantly see the model\n // when show is set to true.\n\n const displayConditionPassed = passesDistanceDisplayCondition(\n model,\n frameState\n );\n\n const invisible = model.isInvisible();\n const silhouette = model.hasSilhouette(frameState);\n\n // If the model is invisible but has a silhouette, it still\n // needs to draw in order to write to the stencil buffer and\n // render the silhouette.\n const showModel =\n model._show &&\n model._computedScale !== 0 &&\n displayConditionPassed &&\n (!invisible || silhouette);\n\n const passes = frameState.passes;\n const submitCommandsForPass =\n passes.render || (passes.pick && model.allowPicking);\n\n if (showModel && !model._ignoreCommands && submitCommandsForPass) {\n addCreditsToCreditDisplay(model, frameState);\n model._sceneGraph.pushDrawCommands(frameState);\n }\n}\n\nconst scratchBoundingSphere = new BoundingSphere();\n\nfunction scaleInPixels(positionWC, radius, frameState) {\n scratchBoundingSphere.center = positionWC;\n scratchBoundingSphere.radius = radius;\n return frameState.camera.getPixelSize(\n scratchBoundingSphere,\n frameState.context.drawingBufferWidth,\n frameState.context.drawingBufferHeight\n );\n}\n\nfunction getUpdateHeightCallback(model, ellipsoid, cartoPosition) {\n return function (clampedPosition) {\n if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {\n const clampedCart = ellipsoid.cartesianToCartographic(\n clampedPosition,\n scratchCartographic\n );\n clampedCart.height += cartoPosition.height;\n ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);\n }\n\n const clampedModelMatrix = model._clampedModelMatrix;\n\n // Modify clamped model matrix to use new height\n Matrix4.clone(model.modelMatrix, clampedModelMatrix);\n clampedModelMatrix[12] = clampedPosition.x;\n clampedModelMatrix[13] = clampedPosition.y;\n clampedModelMatrix[14] = clampedPosition.z;\n\n model._heightDirty = true;\n };\n}\n\nconst scratchDisplayConditionCartesian = new Cartesian3();\n\nfunction passesDistanceDisplayCondition(model, frameState) {\n const condition = model.distanceDisplayCondition;\n if (!defined(condition)) {\n return true;\n }\n\n const nearSquared = condition.near * condition.near;\n const farSquared = condition.far * condition.far;\n let distanceSquared;\n\n if (frameState.mode === SceneMode.SCENE2D) {\n const frustum2DWidth =\n frameState.camera.frustum.right - frameState.camera.frustum.left;\n const distance = frustum2DWidth * 0.5;\n distanceSquared = distance * distance;\n } else {\n // Distance to center of primitive's reference frame\n const position = Matrix4.getTranslation(\n model.modelMatrix,\n scratchDisplayConditionCartesian\n );\n\n // This will project the position if the scene is in Columbus View,\n // but leave the position as-is in 3D mode.\n SceneTransforms.computeActualWgs84Position(frameState, position, position);\n\n distanceSquared = Cartesian3.distanceSquared(\n position,\n frameState.camera.positionWC\n );\n }\n\n return distanceSquared >= nearSquared && distanceSquared <= farSquared;\n}\n\nfunction addCreditsToCreditDisplay(model, frameState) {\n const creditDisplay = frameState.creditDisplay;\n // Add all credits to the credit display.\n const credit = model._credit;\n if (defined(credit)) {\n creditDisplay.addCredit(credit);\n }\n\n const resourceCredits = model._resourceCredits;\n const resourceCreditsLength = resourceCredits.length;\n for (let c = 0; c < resourceCreditsLength; c++) {\n creditDisplay.addCredit(resourceCredits[c]);\n }\n\n const gltfCredits = model._gltfCredits;\n const gltfCreditsLength = gltfCredits.length;\n for (let c = 0; c < gltfCreditsLength; c++) {\n creditDisplay.addCredit(gltfCredits[c]);\n }\n}\n\n/**\n * Gets whether or not the model is translucent based on its assigned model color.\n * If the model color's alpha is equal to zero, then it is considered invisible,\n * not translucent.\n *\n * @returns {Boolean} <code>true</code> if the model is translucent, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.isTranslucent = function () {\n const color = this.color;\n return defined(color) && color.alpha > 0.0 && color.alpha < 1.0;\n};\n\n/**\n * Gets whether or not the model is invisible, i.e. if the model color's alpha\n * is equal to zero.\n *\n * @returns {Boolean} <code>true</code> if the model is invisible, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.isInvisible = function () {\n const color = this.color;\n return defined(color) && color.alpha === 0.0;\n};\n\nfunction supportsSilhouettes(frameState) {\n return frameState.context.stencilBuffer;\n}\n\n/**\n * Gets whether or not the model has a silhouette. This accounts for whether\n * silhouettes are supported (i.e. the context supports stencil buffers).\n * <p>\n * If the model classifies another model, its silhouette will be disabled.\n * </p>\n *\n * @param {FrameState} The frame state.\n * @returns {Boolean} <code>true</code> if the model has silhouettes, otherwise <code>false</code>.\n * @private\n */\nModel.prototype.hasSilhouette = function (frameState) {\n return (\n supportsSilhouettes(frameState) &&\n this._silhouetteSize > 0.0 &&\n this._silhouetteColor.alpha > 0.0 &&\n !defined(this._classificationType)\n );\n};\n\nfunction supportsSkipLevelOfDetail(frameState) {\n return frameState.context.stencilBuffer;\n}\n\n/**\n * Gets whether or not the model is part of a tileset that uses the\n * skipLevelOfDetail optimization. This accounts for whether skipLevelOfDetail\n * is supported (i.e. the context supports stencil buffers).\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Boolean} <code>true</code> if the model is part of a tileset that uses the skipLevelOfDetail optimization, <code>false</code> otherwise.\n * @private\n */\nModel.prototype.hasSkipLevelOfDetail = function (frameState) {\n const is3DTiles = ModelType.is3DTiles(this.type);\n if (!is3DTiles) {\n return false;\n }\n\n const tileset = this._content.tileset;\n return supportsSkipLevelOfDetail(frameState) && tileset.skipLevelOfDetail;\n};\n\n/**\n * Gets whether or not clipping planes are enabled for this model.\n *\n * @returns {Boolean} <code>true</code> if clipping planes are enabled for this model, <code>false</code>.\n * @private\n */\nModel.prototype.isClippingEnabled = function () {\n const clippingPlanes = this._clippingPlanes;\n return (\n defined(clippingPlanes) &&\n clippingPlanes.enabled &&\n clippingPlanes.length !== 0\n );\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Model#destroy\n */\nModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * model = model && model.destroy();\n *\n * @see Model#isDestroyed\n */\nModel.prototype.destroy = function () {\n const loader = this._loader;\n if (defined(loader)) {\n loader.destroy();\n }\n\n const featureTables = this._featureTables;\n if (defined(featureTables)) {\n const length = featureTables.length;\n for (let i = 0; i < length; i++) {\n featureTables[i].destroy();\n }\n }\n\n this.destroyPipelineResources();\n this.destroyModelResources();\n\n // Remove callbacks for height reference behavior.\n if (defined(this._removeUpdateHeightCallback)) {\n this._removeUpdateHeightCallback();\n this._removeUpdateHeightCallback = undefined;\n }\n\n if (defined(this._terrainProviderChangedCallback)) {\n this._terrainProviderChangedCallback();\n this._terrainProviderChangedCallback = undefined;\n }\n\n // Only destroy the ClippingPlaneCollection if this is the owner.\n const clippingPlaneCollection = this._clippingPlanes;\n if (\n defined(clippingPlaneCollection) &&\n !clippingPlaneCollection.isDestroyed() &&\n clippingPlaneCollection.owner === this\n ) {\n clippingPlaneCollection.destroy();\n }\n this._clippingPlanes = undefined;\n\n // Only destroy the ImageBasedLighting if this is the owner.\n if (\n this._shouldDestroyImageBasedLighting &&\n !this._imageBasedLighting.isDestroyed()\n ) {\n this._imageBasedLighting.destroy();\n }\n this._imageBasedLighting = undefined;\n\n destroyObject(this);\n};\n\n/**\n * Destroys resources generated in the pipeline stages\n * that must be destroyed when draw commands are rebuilt.\n * @private\n */\nModel.prototype.destroyPipelineResources = function () {\n const resources = this._pipelineResources;\n for (let i = 0; i < resources.length; i++) {\n resources[i].destroy();\n }\n this._pipelineResources.length = 0;\n this._pickIds.length = 0;\n};\n\n/**\n * Destroys resources generated in the pipeline stages\n * that exist for the lifetime of the model.\n * @private\n */\nModel.prototype.destroyModelResources = function () {\n const resources = this._modelResources;\n for (let i = 0; i < resources.length; i++) {\n resources[i].destroy();\n }\n this._modelResources.length = 0;\n};\n\n/**\n * <p>\n * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,\n * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.\n * </p>\n * <p>\n * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.\n *\n * @param {Object} options Object with the following properties:\n * @param {String|Resource} options.url The url to the .gltf or .glb file.\n * @param {String|Resource} [options.basePath=''] The base path that paths in the glTF JSON are relative to.\n * @param {Boolean} [options.show=true] Whether or not to render the model.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.\n * @param {Number} [options.scale=1.0] A uniform scale applied to this model.\n * @param {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.\n * @param {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.\n * @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.\n * @param {Boolean} [options.allowPicking=true] When <code>true</code>, each primitive is pickable with {@link Scene#pick}.\n * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.\n * @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.\n * @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.\n * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from light sources.\n * @param {Boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.\n * @param {Boolean} [options.enableDebugWireframe=false] For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.\n * @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.\n * @param {Boolean} [options.cull=true] Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.\n * @param {Boolean} [options.opaquePass=Pass.OPAQUE] The pass to use in the {@link DrawCommand} for the opaque portions of the model.\n * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.\n * @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.\n * @param {CustomShader} [options.customShader] A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.\n * @param {Cesium3DTileContent} [options.content] The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.\n * @param {HeightReference} [options.heightReference=HeightReference.NONE] Determines how the model is drawn relative to terrain.\n * @param {Scene} [options.scene] Must be passed in for models that use the height reference property.\n * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.\n * @param {Color} [options.color] A color that blends with the model's rendered color.\n * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.\n * @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.\n * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.\n * @param {Number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.\n * @param {Boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @param {Boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @param {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model.\n * @param {Cartesian3} [options.lightColor] The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.\n * @param {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting on this model.\n * @param {Boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.\n * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n * @param {Boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this model on screen.\n * @param {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this model.\n * @param {Boolean} [options.projectTo2D=false] Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded.\n * @param {String|Number} [options.featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {String|Number} [options.instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {Object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.\n * @param {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.\n *\n * @returns {Model} The newly created model.\n */\nModel.fromGltf = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n // options.gltf is used internally for 3D Tiles. It can be a Resource, a URL\n // to a glTF/glb file, a binary glTF buffer, or a JSON object containing the\n // glTF contents.\n const gltf = defaultValue(options.url, options.gltf);\n\n const loaderOptions = {\n releaseGltfJson: options.releaseGltfJson,\n asynchronous: options.asynchronous,\n incrementallyLoadTextures: options.incrementallyLoadTextures,\n upAxis: options.upAxis,\n forwardAxis: options.forwardAxis,\n loadAttributesFor2D: options.projectTo2D,\n loadIndicesForWireframe: options.enableDebugWireframe,\n loadPrimitiveOutline: options.enableShowOutline,\n loadForClassification: defined(options.classificationType),\n };\n\n const basePath = defaultValue(options.basePath, \"\");\n const baseResource = Resource.createIfNeeded(basePath);\n\n if (defined(gltf.asset)) {\n loaderOptions.gltfJson = gltf;\n loaderOptions.baseResource = baseResource;\n loaderOptions.gltfResource = baseResource;\n } else if (gltf instanceof Uint8Array) {\n loaderOptions.typedArray = gltf;\n loaderOptions.baseResource = baseResource;\n loaderOptions.gltfResource = baseResource;\n } else {\n loaderOptions.gltfResource = Resource.createIfNeeded(gltf);\n }\n\n const loader = new GltfLoader(loaderOptions);\n\n const is3DTiles = defined(options.content);\n const type = is3DTiles ? ModelType.TILE_GLTF : ModelType.GLTF;\n\n const modelOptions = makeModelOptions(loader, type, options);\n modelOptions.resource = loaderOptions.gltfResource;\n\n const model = new Model(modelOptions);\n\n return model;\n};\n\n/*\n * @private\n */\nModel.fromB3dm = function (options) {\n const loaderOptions = {\n b3dmResource: options.resource,\n arrayBuffer: options.arrayBuffer,\n byteOffset: options.byteOffset,\n releaseGltfJson: options.releaseGltfJson,\n asynchronous: options.asynchronous,\n incrementallyLoadTextures: options.incrementallyLoadTextures,\n upAxis: options.upAxis,\n forwardAxis: options.forwardAxis,\n loadAttributesFor2D: options.projectTo2D,\n loadIndicesForWireframe: options.enableDebugWireframe,\n loadPrimitiveOutline: options.enableShowOutline,\n loadForClassification: defined(options.classificationType),\n };\n\n const loader = new B3dmLoader(loaderOptions);\n\n const modelOptions = makeModelOptions(loader, ModelType.TILE_B3DM, options);\n const model = new Model(modelOptions);\n return model;\n};\n\n/**\n * @private\n */\nModel.fromPnts = function (options) {\n const loaderOptions = {\n arrayBuffer: options.arrayBuffer,\n byteOffset: options.byteOffset,\n loadAttributesFor2D: options.projectTo2D,\n };\n const loader = new PntsLoader(loaderOptions);\n\n const modelOptions = makeModelOptions(loader, ModelType.TILE_PNTS, options);\n const model = new Model(modelOptions);\n return model;\n};\n\n/*\n * @private\n */\nModel.fromI3dm = function (options) {\n const loaderOptions = {\n i3dmResource: options.resource,\n arrayBuffer: options.arrayBuffer,\n byteOffset: options.byteOffset,\n releaseGltfJson: options.releaseGltfJson,\n asynchronous: options.asynchronous,\n incrementallyLoadTextures: options.incrementallyLoadTextures,\n upAxis: options.upAxis,\n forwardAxis: options.forwardAxis,\n loadAttributesFor2D: options.projectTo2D,\n loadIndicesForWireframe: options.enableDebugWireframe,\n loadPrimitiveOutline: options.enableShowOutline,\n };\n const loader = new I3dmLoader(loaderOptions);\n\n const modelOptions = makeModelOptions(loader, ModelType.TILE_I3DM, options);\n const model = new Model(modelOptions);\n return model;\n};\n\n/*\n * @private\n */\nModel.fromGeoJson = function (options) {\n const loaderOptions = {\n geoJson: options.geoJson,\n };\n const loader = new GeoJsonLoader(loaderOptions);\n const modelOptions = makeModelOptions(\n loader,\n ModelType.TILE_GEOJSON,\n options\n );\n const model = new Model(modelOptions);\n return model;\n};\n\n/**\n * @private\n */\nModel.prototype.applyColorAndShow = function (style) {\n const previousColor = this._color;\n const hasColorStyle = defined(style) && defined(style.color);\n const hasShowStyle = defined(style) && defined(style.show);\n\n this._color = hasColorStyle\n ? style.color.evaluateColor(undefined, this._color)\n : Color.clone(Color.WHITE, this._color);\n this._show = hasShowStyle ? style.show.evaluate(undefined) : true;\n\n if (isColorAlphaDirty(previousColor, this._color)) {\n this.resetDrawCommands();\n }\n};\n\n/**\n * @private\n */\nModel.prototype.applyStyle = function (style) {\n const isPnts = this.type === ModelType.TILE_PNTS;\n\n const hasFeatureTable =\n defined(this.featureTableId) &&\n this.featureTables[this.featureTableId].featuresLength > 0;\n\n const propertyAttributes = defined(this.structuralMetadata)\n ? this.structuralMetadata.propertyAttributes\n : undefined;\n const hasPropertyAttributes =\n defined(propertyAttributes) && defined(propertyAttributes[0]);\n\n // Point clouds will be styled on the GPU unless they contain a batch table.\n // That is, CPU styling will not be applied if:\n // - points have no metadata at all, or\n // - points have metadata stored as a property attribute\n if (isPnts && (!hasFeatureTable || hasPropertyAttributes)) {\n // Commands are rebuilt for point cloud styling since the new style may\n // contain different shader functions.\n this.resetDrawCommands();\n return;\n }\n\n // The style is only set by the ModelFeatureTable. If there are no features,\n // the color and show from the style are directly applied.\n if (hasFeatureTable) {\n const featureTable = this.featureTables[this.featureTableId];\n featureTable.applyStyle(style);\n updateStyleCommandsNeeded(this, style);\n } else {\n this.applyColorAndShow(style);\n this._styleCommandsNeeded = undefined;\n }\n};\n\nfunction makeModelOptions(loader, modelType, options) {\n return {\n loader: loader,\n type: modelType,\n resource: options.resource,\n show: options.show,\n modelMatrix: options.modelMatrix,\n scale: options.scale,\n minimumPixelSize: options.minimumPixelSize,\n maximumScale: options.maximumScale,\n id: options.id,\n allowPicking: options.allowPicking,\n clampAnimations: options.clampAnimations,\n shadows: options.shadows,\n debugShowBoundingVolume: options.debugShowBoundingVolume,\n enableDebugWireframe: options.enableDebugWireframe,\n debugWireframe: options.debugWireframe,\n cull: options.cull,\n opaquePass: options.opaquePass,\n customShader: options.customShader,\n content: options.content,\n heightReference: options.heightReference,\n scene: options.scene,\n distanceDisplayCondition: options.distanceDisplayCondition,\n color: options.color,\n colorBlendAmount: options.colorBlendAmount,\n colorBlendMode: options.colorBlendMode,\n silhouetteColor: options.silhouetteColor,\n silhouetteSize: options.silhouetteSize,\n enableShowOutline: options.enableShowOutline,\n showOutline: options.showOutline,\n outlineColor: options.outlineColor,\n clippingPlanes: options.clippingPlanes,\n lightColor: options.lightColor,\n imageBasedLighting: options.imageBasedLighting,\n backFaceCulling: options.backFaceCulling,\n credit: options.credit,\n showCreditsOnScreen: options.showCreditsOnScreen,\n splitDirection: options.splitDirection,\n projectTo2D: options.projectTo2D,\n featureIdLabel: options.featureIdLabel,\n instanceFeatureIdLabel: options.instanceFeatureIdLabel,\n pointCloudShading: options.pointCloudShading,\n classificationType: options.classificationType,\n pickObject: options.pickObject,\n };\n}\n\nexport default Model;\n", "import Color from \"../../Core/Color.js\";\nimport combine from \"../../Core/combine.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Pass from \"../../Renderer/Pass.js\";\nimport ModelAnimationLoop from \"../ModelAnimationLoop.js\";\nimport Model from \"./Model.js\";\n\n/**\n * Represents the contents of a glTF, glb or\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel|Batched 3D Model}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n * @alias Model3DTileContent\n * @constructor\n * @private\n */\nfunction Model3DTileContent(tileset, tile, resource) {\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n\n this._model = undefined;\n this._readyPromise = undefined;\n this._metadata = undefined;\n this._group = undefined;\n}\n\nObject.defineProperties(Model3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n const model = this._model;\n const featureTables = model.featureTables;\n const featureTableId = model.featureTableId;\n\n if (defined(featureTables) && defined(featureTables[featureTableId])) {\n return featureTables[featureTableId].featuresLength;\n }\n\n return 0;\n },\n },\n\n pointsLength: {\n get: function () {\n return this._model.statistics.pointsLength;\n },\n },\n\n trianglesLength: {\n get: function () {\n return this._model.statistics.trianglesLength;\n },\n },\n\n geometryByteLength: {\n get: function () {\n return this._model.statistics.geometryByteLength;\n },\n },\n\n texturesByteLength: {\n get: function () {\n return this._model.statistics.texturesByteLength;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n const statistics = this._model.statistics;\n return (\n statistics.propertyTablesByteLength + statistics.batchTexturesByteLength\n );\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._resource.getUrlComponent(true);\n },\n },\n\n batchTable: {\n get: function () {\n const model = this._model;\n const featureTables = model.featureTables;\n const featureTableId = model.featureTableId;\n\n if (defined(featureTables) && defined(featureTables[featureTableId])) {\n return featureTables[featureTableId];\n }\n\n return undefined;\n },\n },\n\n metadata: {\n get: function () {\n return this._metadata;\n },\n set: function (value) {\n this._metadata = value;\n },\n },\n\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n },\n },\n});\n\nModel3DTileContent.prototype.getFeature = function (featureId) {\n const model = this._model;\n const featureTableId = model.featureTableId;\n\n const featureTable = model.featureTables[featureTableId];\n\nreturn featureTable.getFeature(featureId);\n};\n\nModel3DTileContent.prototype.hasProperty = function (featureId, name) {\n const model = this._model;\n const featureTableId = model.featureTableId;\n if (!defined(featureTableId)) {\n return false;\n }\n\n const featureTable = model.featureTables[featureTableId];\n return featureTable.hasProperty(featureId, name);\n};\n\nModel3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n color = enabled ? color : Color.WHITE;\n if (this.featuresLength === 0) {\n this._model.color = color;\n } else if (defined(this.batchTable)) {\n this.batchTable.setAllColor(color);\n }\n};\n\nModel3DTileContent.prototype.applyStyle = function (style) {\n // the setter will call model.applyStyle()\n this._model.style = style;\n};\n\nModel3DTileContent.prototype.update = function (tileset, frameState) {\n const model = this._model;\n const tile = this._tile;\n\n model.colorBlendAmount = tileset.colorBlendAmount;\n model.colorBlendMode = tileset.colorBlendMode;\n model.modelMatrix = tile.computedTransform;\n model.customShader = tileset.customShader;\n model.featureIdLabel = tileset.featureIdLabel;\n model.instanceFeatureIdLabel = tileset.instanceFeatureIdLabel;\n model.lightColor = tileset.lightColor;\n model.imageBasedLighting = tileset.imageBasedLighting;\n model.backFaceCulling = tileset.backFaceCulling;\n model.shadows = tileset.shadows;\n model.showCreditsOnScreen = tileset.showCreditsOnScreen;\n model.splitDirection = tileset.splitDirection;\n model.debugWireframe = tileset.debugWireframe;\n model.showOutline = tileset.showOutline;\n model.outlineColor = tileset.outlineColor;\n model.pointCloudShading = tileset.pointCloudShading;\n\n // Updating clipping planes requires more effort because of ownership checks\n const tilesetClippingPlanes = tileset.clippingPlanes;\n model.referenceMatrix = tileset.clippingPlanesOriginMatrix;\n if (defined(tilesetClippingPlanes) && tile.clippingPlanesDirty) {\n // Dereference the clipping planes from the model if they are irrelevant.\n model._clippingPlanes =\n tilesetClippingPlanes.enabled && tile._isClipped\n ? tilesetClippingPlanes\n : undefined;\n }\n\n // If the model references a different ClippingPlaneCollection from the tileset,\n // update the model to use the new ClippingPlaneCollection.\n if (\n defined(tilesetClippingPlanes) &&\n defined(model._clippingPlanes) &&\n model._clippingPlanes !== tilesetClippingPlanes\n ) {\n model._clippingPlanes = tilesetClippingPlanes;\n model._clippingPlanesState = 0;\n }\n\n model.update(frameState);\n};\n\nModel3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nModel3DTileContent.prototype.destroy = function () {\n this._model = this._model && this._model.destroy();\n return destroyObject(this);\n};\n\nModel3DTileContent.fromGltf = function (tileset, tile, resource, gltf) {\n const content = new Model3DTileContent(tileset, tile, resource);\n\n const additionalOptions = {\n gltf: gltf,\n basePath: resource,\n };\n\n const modelOptions = makeModelOptions(\n tileset,\n tile,\n content,\n additionalOptions\n );\n\n const classificationType = tileset.vectorClassificationOnly\n ? undefined\n : tileset.classificationType;\n\n modelOptions.classificationType = classificationType;\n\n const model = Model.fromGltf(modelOptions);\n content._model = model;\n // Include the animation setup in the ready promise to avoid an uncaught exception\n content._readyPromise = model.readyPromise.then(function (model) {\n model.activeAnimations.addAll({\n loop: ModelAnimationLoop.REPEAT,\n });\n return model;\n });\n\n return content;\n};\n\nModel3DTileContent.fromB3dm = function (\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n) {\n const content = new Model3DTileContent(tileset, tile, resource);\n\n const additionalOptions = {\n arrayBuffer: arrayBuffer,\n byteOffset: byteOffset,\n resource: resource,\n };\n\n const modelOptions = makeModelOptions(\n tileset,\n tile,\n content,\n additionalOptions\n );\n\n const classificationType = tileset.vectorClassificationOnly\n ? undefined\n : tileset.classificationType;\n\n modelOptions.classificationType = classificationType;\n\n const model = Model.fromB3dm(modelOptions);\n content._model = model;\n // Include the animation setup in the ready promise to avoid an uncaught exception\n content._readyPromise = model.readyPromise.then(function (model) {\n model.activeAnimations.addAll({\n loop: ModelAnimationLoop.REPEAT,\n });\n return model;\n });\n\n return content;\n};\n\nModel3DTileContent.fromI3dm = function (\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n) {\n const content = new Model3DTileContent(tileset, tile, resource);\n\n const additionalOptions = {\n arrayBuffer: arrayBuffer,\n byteOffset: byteOffset,\n resource: resource,\n };\n\n const modelOptions = makeModelOptions(\n tileset,\n tile,\n content,\n additionalOptions\n );\n\n const model = Model.fromI3dm(modelOptions);\n content._model = model;\n // Include the animation setup in the ready promise to avoid an uncaught exception\n content._readyPromise = model.readyPromise.then(function (model) {\n model.activeAnimations.addAll({\n loop: ModelAnimationLoop.REPEAT,\n });\n return model;\n });\n\n return content;\n};\n\nModel3DTileContent.fromPnts = function (\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n) {\n const content = new Model3DTileContent(tileset, tile, resource);\n\n const additionalOptions = {\n arrayBuffer: arrayBuffer,\n byteOffset: byteOffset,\n resource: resource,\n };\n\n const modelOptions = makeModelOptions(\n tileset,\n tile,\n content,\n additionalOptions\n );\n const model = Model.fromPnts(modelOptions);\n content._model = model;\n content._readyPromise = model.readyPromise;\n\n return content;\n};\n\nModel3DTileContent.fromGeoJson = function (tileset, tile, resource, geoJson) {\n const content = new Model3DTileContent(tileset, tile, resource);\n\n const additionalOptions = {\n geoJson: geoJson,\n resource: resource,\n };\n\n const modelOptions = makeModelOptions(\n tileset,\n tile,\n content,\n additionalOptions\n );\n const model = Model.fromGeoJson(modelOptions);\n content._model = model;\n content._readyPromise = model.readyPromise;\n\n return content;\n};\n\nfunction makeModelOptions(tileset, tile, content, additionalOptions) {\n const mainOptions = {\n cull: false, // The model is already culled by 3D Tiles\n releaseGltfJson: true, // Models are unique and will not benefit from caching so save memory\n opaquePass: Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass\n modelMatrix: tile.computedTransform,\n upAxis: tileset._modelUpAxis,\n forwardAxis: tileset._modelForwardAxis,\n incrementallyLoadTextures: false,\n customShader: tileset.customShader,\n content: content,\n colorBlendMode: tileset.colorBlendMode,\n colorBlendAmount: tileset.colorBlendAmount,\n lightColor: tileset.lightColor,\n imageBasedLighting: tileset.imageBasedLighting,\n featureIdLabel: tileset.featureIdLabel,\n instanceFeatureIdLabel: tileset.instanceFeatureIdLabel,\n pointCloudShading: tileset.pointCloudShading,\n clippingPlanes: tileset.clippingPlanes,\n backFaceCulling: tileset.backFaceCulling,\n shadows: tileset.shadows,\n showCreditsOnScreen: tileset.showCreditsOnScreen,\n splitDirection: tileset.splitDirection,\n enableDebugWireframe: tileset._enableDebugWireframe,\n debugWireframe: tileset.debugWireframe,\n projectTo2D: tileset._projectTo2D,\n enableShowOutline: tileset._enableShowOutline,\n showOutline: tileset.showOutline,\n outlineColor: tileset.outlineColor,\n };\n\n return combine(additionalOptions, mainOptions);\n}\n\nexport default Model3DTileContent;\n", "import destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * Represents content for a tile in a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset whose\n * content points to another 3D Tiles tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Tileset3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Tileset3DTileContent(tileset, tile, resource, json) {\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n\n this.featurePropertiesDirty = false;\n\n this._metadata = undefined;\n this._group = undefined;\n\n this._readyPromise = initialize(this, json);\n}\n\nObject.defineProperties(Tileset3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n return 0;\n },\n },\n\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n trianglesLength: {\n get: function () {\n return 0;\n },\n },\n\n geometryByteLength: {\n get: function () {\n return 0;\n },\n },\n\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n return 0;\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._resource.getUrlComponent(true);\n },\n },\n\n batchTable: {\n get: function () {\n return undefined;\n },\n },\n\n metadata: {\n get: function () {\n return this._metadata;\n },\n set: function (value) {\n this._metadata = value;\n },\n },\n\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n },\n },\n});\n\nfunction initialize(content, json) {\n content._tileset.loadTileset(content._resource, json, content._tile);\n return Promise.resolve(content);\n}\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Tileset3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n */\nTileset3DTileContent.prototype.hasProperty = function (batchId, name) {\n return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Tileset3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n */\nTileset3DTileContent.prototype.getFeature = function (batchId) {\n return undefined;\n};\n\nTileset3DTileContent.prototype.applyDebugSettings = function (\n enabled,\n color\n) {};\n\nTileset3DTileContent.prototype.applyStyle = function (style) {};\n\nTileset3DTileContent.prototype.update = function (tileset, frameState) {};\n\nTileset3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nTileset3DTileContent.prototype.destroy = function () {\n return destroyObject(this);\n};\nexport default Tileset3DTileContent;\n", "import Check from \"../Core/Check.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Buffer from \"./Buffer.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport VertexArray from \"./VertexArray.js\";\n\n/**\n * @private\n */\nfunction VertexArrayFacade(context, attributes, sizeInVertices, instanced) {\n const attrs = VertexArrayFacade._verifyAttributes(attributes);\n sizeInVertices = defaultValue(sizeInVertices, 0);\n const precreatedAttributes = [];\n const attributesByUsage = {};\n let attributesForUsage;\n let usage;\n\n // Bucket the attributes by usage.\n const length = attrs.length;\n for (let i = 0; i < length; ++i) {\n const attribute = attrs[i];\n\n // If the attribute already has a vertex buffer, we do not need\n // to manage a vertex buffer or typed array for it.\n if (attribute.vertexBuffer) {\n precreatedAttributes.push(attribute);\n continue;\n }\n\n usage = attribute.usage;\n attributesForUsage = attributesByUsage[usage];\n if (!defined(attributesForUsage)) {\n attributesForUsage = attributesByUsage[usage] = [];\n }\n\n attributesForUsage.push(attribute);\n }\n\n // A function to sort attributes by the size of their components. From left to right, a vertex\n // stores floats, shorts, and then bytes.\n function compare(left, right) {\n return (\n ComponentDatatype.getSizeInBytes(right.componentDatatype) -\n ComponentDatatype.getSizeInBytes(left.componentDatatype)\n );\n }\n\n this._allBuffers = [];\n\n for (usage in attributesByUsage) {\n if (attributesByUsage.hasOwnProperty(usage)) {\n attributesForUsage = attributesByUsage[usage];\n\n attributesForUsage.sort(compare);\n const vertexSizeInBytes = VertexArrayFacade._vertexSizeInBytes(\n attributesForUsage\n );\n\n const bufferUsage = attributesForUsage[0].usage;\n\n const buffer = {\n vertexSizeInBytes: vertexSizeInBytes,\n vertexBuffer: undefined,\n usage: bufferUsage,\n needsCommit: false,\n arrayBuffer: undefined,\n arrayViews: VertexArrayFacade._createArrayViews(\n attributesForUsage,\n vertexSizeInBytes\n ),\n };\n\n this._allBuffers.push(buffer);\n }\n }\n\n this._size = 0;\n this._instanced = defaultValue(instanced, false);\n\n this._precreated = precreatedAttributes;\n this._context = context;\n\n this.writers = undefined;\n this.va = undefined;\n\n this.resize(sizeInVertices);\n}\nVertexArrayFacade._verifyAttributes = function (attributes) {\n const attrs = [];\n\n for (let i = 0; i < attributes.length; ++i) {\n const attribute = attributes[i];\n\n const attr = {\n index: defaultValue(attribute.index, i),\n enabled: defaultValue(attribute.enabled, true),\n componentsPerAttribute: attribute.componentsPerAttribute,\n componentDatatype: defaultValue(\n attribute.componentDatatype,\n ComponentDatatype.FLOAT\n ),\n normalize: defaultValue(attribute.normalize, false),\n\n // There will be either a vertexBuffer or an [optional] usage.\n vertexBuffer: attribute.vertexBuffer,\n usage: defaultValue(attribute.usage, BufferUsage.STATIC_DRAW),\n };\n attrs.push(attr);\n\n}\n\n // Verify all attribute names are unique.\n const uniqueIndices = new Array(attrs.length);\n for (let j = 0; j < attrs.length; ++j) {\n const currentAttr = attrs[j];\n const index = currentAttr.index;\nuniqueIndices[index] = true;\n }\n\n return attrs;\n};\n\nVertexArrayFacade._vertexSizeInBytes = function (attributes) {\n let sizeInBytes = 0;\n\n const length = attributes.length;\n for (let i = 0; i < length; ++i) {\n const attribute = attributes[i];\n sizeInBytes +=\n attribute.componentsPerAttribute *\n ComponentDatatype.getSizeInBytes(attribute.componentDatatype);\n }\n\n const maxComponentSizeInBytes =\n length > 0\n ? ComponentDatatype.getSizeInBytes(attributes[0].componentDatatype)\n : 0; // Sorted by size\n const remainder =\n maxComponentSizeInBytes > 0 ? sizeInBytes % maxComponentSizeInBytes : 0;\n const padding = remainder === 0 ? 0 : maxComponentSizeInBytes - remainder;\n sizeInBytes += padding;\n\n return sizeInBytes;\n};\n\nVertexArrayFacade._createArrayViews = function (attributes, vertexSizeInBytes) {\n const views = [];\n let offsetInBytes = 0;\n\n const length = attributes.length;\n for (let i = 0; i < length; ++i) {\n const attribute = attributes[i];\n const componentDatatype = attribute.componentDatatype;\n\n views.push({\n index: attribute.index,\n enabled: attribute.enabled,\n componentsPerAttribute: attribute.componentsPerAttribute,\n componentDatatype: componentDatatype,\n normalize: attribute.normalize,\n\n offsetInBytes: offsetInBytes,\n vertexSizeInComponentType:\n vertexSizeInBytes / ComponentDatatype.getSizeInBytes(componentDatatype),\n\n view: undefined,\n });\n\n offsetInBytes +=\n attribute.componentsPerAttribute *\n ComponentDatatype.getSizeInBytes(componentDatatype);\n }\n\n return views;\n};\n\n/**\n * Invalidates writers. Can't render again until commit is called.\n */\nVertexArrayFacade.prototype.resize = function (sizeInVertices) {\n this._size = sizeInVertices;\n\n const allBuffers = this._allBuffers;\n this.writers = [];\n\n for (let i = 0, len = allBuffers.length; i < len; ++i) {\n const buffer = allBuffers[i];\n\n VertexArrayFacade._resize(buffer, this._size);\n\n // Reserving invalidates the writers, so if client's cache them, they need to invalidate their cache.\n VertexArrayFacade._appendWriters(this.writers, buffer);\n }\n\n // VAs are recreated next time commit is called.\n destroyVA(this);\n};\n\nVertexArrayFacade._resize = function (buffer, size) {\n if (buffer.vertexSizeInBytes > 0) {\n // Create larger array buffer\n const arrayBuffer = new ArrayBuffer(size * buffer.vertexSizeInBytes);\n\n // Copy contents from previous array buffer\n if (defined(buffer.arrayBuffer)) {\n const destView = new Uint8Array(arrayBuffer);\n const sourceView = new Uint8Array(buffer.arrayBuffer);\n const sourceLength = sourceView.length;\n for (let j = 0; j < sourceLength; ++j) {\n destView[j] = sourceView[j];\n }\n }\n\n // Create typed views into the new array buffer\n const views = buffer.arrayViews;\n const length = views.length;\n for (let i = 0; i < length; ++i) {\n const view = views[i];\n view.view = ComponentDatatype.createArrayBufferView(\n view.componentDatatype,\n arrayBuffer,\n view.offsetInBytes\n );\n }\n\n buffer.arrayBuffer = arrayBuffer;\n }\n};\n\nconst createWriters = [\n // 1 component per attribute\n function (buffer, view, vertexSizeInComponentType) {\n return function (index, attribute) {\n view[index * vertexSizeInComponentType] = attribute;\n buffer.needsCommit = true;\n };\n },\n\n // 2 component per attribute\n function (buffer, view, vertexSizeInComponentType) {\n return function (index, component0, component1) {\n const i = index * vertexSizeInComponentType;\n view[i] = component0;\n view[i + 1] = component1;\n buffer.needsCommit = true;\n };\n },\n\n // 3 component per attribute\n function (buffer, view, vertexSizeInComponentType) {\n return function (index, component0, component1, component2) {\n const i = index * vertexSizeInComponentType;\n view[i] = component0;\n view[i + 1] = component1;\n view[i + 2] = component2;\n buffer.needsCommit = true;\n };\n },\n\n // 4 component per attribute\n function (buffer, view, vertexSizeInComponentType) {\n return function (index, component0, component1, component2, component3) {\n const i = index * vertexSizeInComponentType;\n view[i] = component0;\n view[i + 1] = component1;\n view[i + 2] = component2;\n view[i + 3] = component3;\n buffer.needsCommit = true;\n };\n },\n];\n\nVertexArrayFacade._appendWriters = function (writers, buffer) {\n const arrayViews = buffer.arrayViews;\n const length = arrayViews.length;\n for (let i = 0; i < length; ++i) {\n const arrayView = arrayViews[i];\n writers[arrayView.index] = createWriters[\n arrayView.componentsPerAttribute - 1\n ](buffer, arrayView.view, arrayView.vertexSizeInComponentType);\n }\n};\n\nVertexArrayFacade.prototype.commit = function (indexBuffer) {\n let recreateVA = false;\n\n const allBuffers = this._allBuffers;\n let buffer;\n let i;\n let length;\n\n for (i = 0, length = allBuffers.length; i < length; ++i) {\n buffer = allBuffers[i];\n recreateVA = commit(this, buffer) || recreateVA;\n }\n\n ///////////////////////////////////////////////////////////////////////\n\n if (recreateVA || !defined(this.va)) {\n destroyVA(this);\n const va = (this.va = []);\n\n const chunkSize = CesiumMath.SIXTY_FOUR_KILOBYTES - 4; // The 65535 index is reserved for primitive restart. Reserve the last 4 indices so that billboard quads are not broken up.\n const numberOfVertexArrays =\n defined(indexBuffer) && !this._instanced\n ? Math.ceil(this._size / chunkSize)\n : 1;\n for (let k = 0; k < numberOfVertexArrays; ++k) {\n let attributes = [];\n for (i = 0, length = allBuffers.length; i < length; ++i) {\n buffer = allBuffers[i];\n const offset = k * (buffer.vertexSizeInBytes * chunkSize);\n VertexArrayFacade._appendAttributes(\n attributes,\n buffer,\n offset,\n this._instanced\n );\n }\n\n attributes = attributes.concat(this._precreated);\n\n va.push({\n va: new VertexArray({\n context: this._context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n }),\n indicesCount:\n 1.5 *\n (k !== numberOfVertexArrays - 1 ? chunkSize : this._size % chunkSize),\n // TODO: not hardcode 1.5, this assumes 6 indices per 4 vertices (as for Billboard quads).\n });\n }\n }\n};\n\nfunction commit(vertexArrayFacade, buffer) {\n if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {\n buffer.needsCommit = false;\n\n const vertexBuffer = buffer.vertexBuffer;\n const vertexBufferSizeInBytes =\n vertexArrayFacade._size * buffer.vertexSizeInBytes;\n const vertexBufferDefined = defined(vertexBuffer);\n if (\n !vertexBufferDefined ||\n vertexBuffer.sizeInBytes < vertexBufferSizeInBytes\n ) {\n if (vertexBufferDefined) {\n vertexBuffer.destroy();\n }\n buffer.vertexBuffer = Buffer.createVertexBuffer({\n context: vertexArrayFacade._context,\n typedArray: buffer.arrayBuffer,\n usage: buffer.usage,\n });\n buffer.vertexBuffer.vertexArrayDestroyable = false;\n\n return true; // Created new vertex buffer\n }\n\n buffer.vertexBuffer.copyFromArrayView(buffer.arrayBuffer);\n }\n\n return false; // Did not create new vertex buffer\n}\n\nVertexArrayFacade._appendAttributes = function (\n attributes,\n buffer,\n vertexBufferOffset,\n instanced\n) {\n const arrayViews = buffer.arrayViews;\n const length = arrayViews.length;\n for (let i = 0; i < length; ++i) {\n const view = arrayViews[i];\n\n attributes.push({\n index: view.index,\n enabled: view.enabled,\n componentsPerAttribute: view.componentsPerAttribute,\n componentDatatype: view.componentDatatype,\n normalize: view.normalize,\n vertexBuffer: buffer.vertexBuffer,\n offsetInBytes: vertexBufferOffset + view.offsetInBytes,\n strideInBytes: buffer.vertexSizeInBytes,\n instanceDivisor: instanced ? 1 : 0,\n });\n }\n};\n\nVertexArrayFacade.prototype.subCommit = function (\n offsetInVertices,\n lengthInVertices\n) {\n const allBuffers = this._allBuffers;\n for (let i = 0, len = allBuffers.length; i < len; ++i) {\n subCommit(allBuffers[i], offsetInVertices, lengthInVertices);\n }\n};\n\nfunction subCommit(buffer, offsetInVertices, lengthInVertices) {\n if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {\n const byteOffset = buffer.vertexSizeInBytes * offsetInVertices;\n const byteLength = buffer.vertexSizeInBytes * lengthInVertices;\n\n // PERFORMANCE_IDEA: If we want to get really crazy, we could consider updating\n // individual attributes instead of the entire (sub-)vertex.\n //\n // PERFORMANCE_IDEA: Does creating the typed view add too much GC overhead?\n buffer.vertexBuffer.copyFromArrayView(\n new Uint8Array(buffer.arrayBuffer, byteOffset, byteLength),\n byteOffset\n );\n }\n}\n\nVertexArrayFacade.prototype.endSubCommits = function () {\n const allBuffers = this._allBuffers;\n\n for (let i = 0, len = allBuffers.length; i < len; ++i) {\n allBuffers[i].needsCommit = false;\n }\n};\n\nfunction destroyVA(vertexArrayFacade) {\n const va = vertexArrayFacade.va;\n if (!defined(va)) {\n return;\n }\n\n const length = va.length;\n for (let i = 0; i < length; ++i) {\n va[i].va.destroy();\n }\n\n vertexArrayFacade.va = undefined;\n}\n\nVertexArrayFacade.prototype.isDestroyed = function () {\n return false;\n};\n\nVertexArrayFacade.prototype.destroy = function () {\n const allBuffers = this._allBuffers;\n for (let i = 0, len = allBuffers.length; i < len; ++i) {\n const buffer = allBuffers[i];\n buffer.vertexBuffer = buffer.vertexBuffer && buffer.vertexBuffer.destroy();\n }\n\n destroyVA(this);\n\n return destroyObject(this);\n};\nexport default VertexArrayFacade;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_OES_standard_derivatives\\n\\\n#extension GL_OES_standard_derivatives : enable\\n\\\n#endif\\n\\\nuniform sampler2D u_atlas;\\n\\\n#ifdef VECTOR_TILE\\n\\\nuniform vec4 u_highlightColor;\\n\\\n#endif\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvarying vec4 v_pickColor;\\n\\\nvarying vec4 v_color;\\n\\\n#ifdef SDF\\n\\\nvarying vec4 v_outlineColor;\\n\\\nvarying float v_outlineWidth;\\n\\\n#endif\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nvarying vec4 v_textureCoordinateBounds;\\n\\\nvarying vec4 v_originTextureCoordinateAndTranslate;\\n\\\nvarying vec4 v_compressed;\\n\\\nvarying mat2 v_rotationMatrix;\\n\\\nconst float SHIFT_LEFT12 = 4096.0;\\n\\\nconst float SHIFT_LEFT1 = 2.0;\\n\\\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\\n\\\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\\n\\\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\\n\\\n{\\n\\\nvec2 lookupVector = imageSize * (depthLookupST - adjustedST);\\n\\\nlookupVector = v_rotationMatrix * lookupVector;\\n\\\nvec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));\\n\\\nvec2 translation = v_originTextureCoordinateAndTranslate.zw;\\n\\\nif (applyTranslate)\\n\\\n{\\n\\\ntranslation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\\n\\\n}\\n\\\nvec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\\n\\\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));\\n\\\nif (logDepthOrDepth == 0.0)\\n\\\n{\\n\\\nreturn 0.0;\\n\\\n}\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\nreturn eyeCoordinate.z / eyeCoordinate.w;\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef SDF\\n\\\nfloat getDistance(vec2 position)\\n\\\n{\\n\\\nreturn texture2D(u_atlas, position).r;\\n\\\n}\\n\\\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\\n\\\n{\\n\\\nfloat distance = getDistance(position);\\n\\\nif (outlineWidth > 0.0)\\n\\\n{\\n\\\nfloat outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\\n\\\nfloat outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\\n\\\nvec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\\n\\\nfloat alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\\n\\\nreturn vec4(sdfColor.rgb, sdfColor.a * alpha);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nfloat alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\\n\\\nreturn vec4(v_color.rgb, v_color.a * alpha);\\n\\\n}\\n\\\n}\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 color = texture2D(u_atlas, v_textureCoordinates);\\n\\\n#ifdef SDF\\n\\\nfloat outlineWidth = v_outlineWidth;\\n\\\nvec4 outlineColor = v_outlineColor;\\n\\\nfloat distance = getDistance(v_textureCoordinates);\\n\\\n#ifdef GL_OES_standard_derivatives\\n\\\nfloat smoothing = fwidth(distance);\\n\\\nvec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\\n\\\nvec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\\n\\\nvec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\nvec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\nvec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\nvec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\\n\\\ncolor = (center + color1 + color2 + color3 + color4)/5.0;\\n\\\n#else\\n\\\nfloat smoothing = 1.0/32.0;\\n\\\ncolor = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\\n\\\n#endif\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\n#else\\n\\\ncolor = czm_gammaCorrect(color);\\n\\\ncolor *= czm_gammaCorrect(v_color);\\n\\\n#endif\\n\\\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\\n\\\nif (color.a < 0.005)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\n#ifdef OPAQUE\\n\\\nif (color.a < 0.995)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\nif (color.a >= 0.995)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\n#endif\\n\\\n#ifdef VECTOR_TILE\\n\\\ncolor *= u_highlightColor;\\n\\\n#endif\\n\\\ngl_FragColor = color;\\n\\\n#ifdef LOG_DEPTH\\n\\\nczm_writeLogDepth();\\n\\\n#endif\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nfloat temp = v_compressed.y;\\n\\\ntemp = temp * SHIFT_RIGHT1;\\n\\\nfloat temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\\n\\\nbool enableDepthTest = temp2 != 0.0;\\n\\\nbool applyTranslate = floor(temp) != 0.0;\\n\\\nif (enableDepthTest) {\\n\\\ntemp = v_compressed.z;\\n\\\ntemp = temp * SHIFT_RIGHT12;\\n\\\nvec2 dimensions;\\n\\\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\ndimensions.x = floor(temp);\\n\\\ntemp = v_compressed.w;\\n\\\ntemp = temp * SHIFT_RIGHT12;\\n\\\nvec2 imageSize;\\n\\\nimageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\nimageSize.x = floor(temp);\\n\\\nvec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\\n\\\nadjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\\n\\\nfloat epsilonEyeDepth = v_compressed.x + czm_epsilon1;\\n\\\nfloat globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\\n\\\nif (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\\n\\\n{\\n\\\nfloat globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);\\n\\\nif (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\\n\\\n{\\n\\\nfloat globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);\\n\\\nif (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef INSTANCED\\n\\\nattribute vec2 direction;\\n\\\n#endif\\n\\\nattribute vec4 positionHighAndScale;\\n\\\nattribute vec4 positionLowAndRotation;\\n\\\nattribute vec4 compressedAttribute0;\\n\\\nattribute vec4 compressedAttribute1;\\n\\\nattribute vec4 compressedAttribute2;\\n\\\nattribute vec4 eyeOffset;\\n\\\nattribute vec4 scaleByDistance;\\n\\\nattribute vec4 pixelOffsetScaleByDistance;\\n\\\nattribute vec4 compressedAttribute3;\\n\\\nattribute vec2 sdf;\\n\\\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\\n\\\nattribute vec4 textureCoordinateBoundsOrLabelTranslate;\\n\\\n#endif\\n\\\n#ifdef VECTOR_TILE\\n\\\nattribute float a_batchId;\\n\\\n#endif\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nvarying vec4 v_textureCoordinateBounds;\\n\\\nvarying vec4 v_originTextureCoordinateAndTranslate;\\n\\\nvarying vec4 v_compressed;\\n\\\nvarying mat2 v_rotationMatrix;\\n\\\n#endif\\n\\\nvarying vec4 v_pickColor;\\n\\\nvarying vec4 v_color;\\n\\\n#ifdef SDF\\n\\\nvarying vec4 v_outlineColor;\\n\\\nvarying float v_outlineWidth;\\n\\\n#endif\\n\\\nconst float UPPER_BOUND = 32768.0;\\n\\\nconst float SHIFT_LEFT16 = 65536.0;\\n\\\nconst float SHIFT_LEFT12 = 4096.0;\\n\\\nconst float SHIFT_LEFT8 = 256.0;\\n\\\nconst float SHIFT_LEFT7 = 128.0;\\n\\\nconst float SHIFT_LEFT5 = 32.0;\\n\\\nconst float SHIFT_LEFT3 = 8.0;\\n\\\nconst float SHIFT_LEFT2 = 4.0;\\n\\\nconst float SHIFT_LEFT1 = 2.0;\\n\\\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\\n\\\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\\n\\\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\\n\\\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\\n\\\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\\n\\\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\\n\\\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\\n\\\nvec4 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)\\n\\\n{\\n\\\nvec2 halfSize = imageSize * scale * 0.5;\\n\\\nhalfSize *= ((direction * 2.0) - 1.0);\\n\\\nvec2 originTranslate = origin * abs(halfSize);\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\nif (validAlignedAxis || rotation != 0.0)\\n\\\n{\\n\\\nfloat angle = rotation;\\n\\\nif (validAlignedAxis)\\n\\\n{\\n\\\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\\n\\\nangle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\\n\\\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\\n\\\n}\\n\\\nfloat cosTheta = cos(angle);\\n\\\nfloat sinTheta = sin(angle);\\n\\\nrotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\\n\\\nhalfSize = rotationMatrix * halfSize;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nrotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\\n\\\n}\\n\\\n#endif\\n\\\nmpp = czm_metersPerPixel(positionEC);\\n\\\npositionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\\n\\\npositionEC.xy += (translate + pixelOffset) * mpp;\\n\\\nreturn positionEC;\\n\\\n}\\n\\\n#ifdef VERTEX_DEPTH_CHECK\\n\\\nfloat getGlobeDepth(vec4 positionEC)\\n\\\n{\\n\\\nvec4 posWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\nfloat globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\\n\\\nif (globeDepth == 0.0)\\n\\\n{\\n\\\nreturn 0.0;\\n\\\n}\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\\n\\\nreturn eyeCoordinate.z / eyeCoordinate.w;\\n\\\n}\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionHigh = positionHighAndScale.xyz;\\n\\\nvec3 positionLow = positionLowAndRotation.xyz;\\n\\\nfloat scale = positionHighAndScale.w;\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\nfloat rotation = positionLowAndRotation.w;\\n\\\n#else\\n\\\nfloat rotation = 0.0;\\n\\\n#endif\\n\\\nfloat compressed = compressedAttribute0.x;\\n\\\nvec2 pixelOffset;\\n\\\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\\n\\\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\\n\\\npixelOffset.x -= UPPER_BOUND;\\n\\\nvec2 origin;\\n\\\norigin.x = floor(compressed * SHIFT_RIGHT5);\\n\\\ncompressed -= origin.x * SHIFT_LEFT5;\\n\\\norigin.y = floor(compressed * SHIFT_RIGHT3);\\n\\\ncompressed -= origin.y * SHIFT_LEFT3;\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nvec2 depthOrigin = origin.xy;\\n\\\n#endif\\n\\\norigin -= vec2(1.0);\\n\\\nfloat show = floor(compressed * SHIFT_RIGHT2);\\n\\\ncompressed -= show * SHIFT_LEFT2;\\n\\\n#ifdef INSTANCED\\n\\\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\\n\\\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\\n\\\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\\n\\\n#else\\n\\\nvec2 direction;\\n\\\ndirection.x = floor(compressed * SHIFT_RIGHT1);\\n\\\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\\n\\\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\\n\\\n#endif\\n\\\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\\n\\\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\\n\\\nvec2 translate;\\n\\\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\\n\\\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\\n\\\ntranslate.x = floor(temp) - UPPER_BOUND;\\n\\\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntranslate.y -= UPPER_BOUND;\\n\\\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\\n\\\nfloat temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\\n\\\nvec2 imageSize = vec2(floor(temp), temp2);\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nfloat labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\\n\\\nfloat applyTranslate = 0.0;\\n\\\nif (labelHorizontalOrigin != 0.0)\\n\\\n{\\n\\\napplyTranslate = 1.0;\\n\\\nlabelHorizontalOrigin -= 2.0;\\n\\\ndepthOrigin.x = labelHorizontalOrigin + 1.0;\\n\\\n}\\n\\\ndepthOrigin = vec2(1.0) - (depthOrigin * 0.5);\\n\\\n#endif\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\nvec4 translucencyByDistance;\\n\\\ntranslucencyByDistance.x = compressedAttribute1.z;\\n\\\ntranslucencyByDistance.z = compressedAttribute1.w;\\n\\\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\\n\\\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n#endif\\n\\\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\\n\\\ntemp = compressedAttribute3.w;\\n\\\ntemp = temp * SHIFT_RIGHT12;\\n\\\nvec2 dimensions;\\n\\\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\\n\\\ndimensions.x = floor(temp);\\n\\\n#endif\\n\\\n#ifdef ALIGNED_AXIS\\n\\\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\\n\\\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\\n\\\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\\n\\\n#else\\n\\\nvec3 alignedAxis = vec3(0.0);\\n\\\nbool validAlignedAxis = false;\\n\\\n#endif\\n\\\nvec4 pickColor;\\n\\\nvec4 color;\\n\\\ntemp = compressedAttribute2.y;\\n\\\ntemp = temp * SHIFT_RIGHT8;\\n\\\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\npickColor.r = floor(temp);\\n\\\ntemp = compressedAttribute2.x;\\n\\\ntemp = temp * SHIFT_RIGHT8;\\n\\\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ncolor.r = floor(temp);\\n\\\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\\n\\\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\npickColor /= 255.0;\\n\\\ncolor.a = floor(temp);\\n\\\ncolor /= 255.0;\\n\\\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\nvec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\\n\\\nfloat eyeDepth = positionEC.z;\\n\\\n#endif\\n\\\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\\n\\\npositionEC.xyz *= show;\\n\\\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\\n\\\nfloat lengthSq;\\n\\\nif (czm_sceneMode == czm_sceneMode2D)\\n\\\n{\\n\\\nlengthSq = czm_eyeHeight2D.y;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef EYE_DISTANCE_SCALING\\n\\\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\\n\\\nscale *= distanceScale;\\n\\\ntranslate *= distanceScale;\\n\\\nif (scale == 0.0)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\n}\\n\\\n#endif\\n\\\nfloat translucency = 1.0;\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\\n\\\nif (translucency == 0.0)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\\n\\\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\\n\\\npixelOffset *= pixelOffsetScale;\\n\\\n#endif\\n\\\n#ifdef DISTANCE_DISPLAY_CONDITION\\n\\\nfloat nearSq = compressedAttribute3.x;\\n\\\nfloat farSq = compressedAttribute3.y;\\n\\\nif (lengthSq < nearSq || lengthSq > farSq)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\n}\\n\\\n#endif\\n\\\nmat2 rotationMatrix;\\n\\\nfloat mpp;\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\nfloat disableDepthTestDistance = compressedAttribute3.z;\\n\\\n#endif\\n\\\n#ifdef VERTEX_DEPTH_CHECK\\n\\\nif (lengthSq < disableDepthTestDistance) {\\n\\\nfloat depthsilon = 10.0;\\n\\\nvec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\\n\\\nvec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\nfloat globeDepth1 = getGlobeDepth(pEC1);\\n\\\nif (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\\n\\\n{\\n\\\nvec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\nfloat globeDepth2 = getGlobeDepth(pEC2);\\n\\\nif (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\\n\\\n{\\n\\\nvec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\nfloat globeDepth3 = getGlobeDepth(pEC3);\\n\\\nif (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n#endif\\n\\\npositionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\\n\\\ngl_Position = czm_projection * positionEC;\\n\\\nv_textureCoordinates = textureCoordinates;\\n\\\n#ifdef LOG_DEPTH\\n\\\nczm_vertexLogDepth();\\n\\\n#endif\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\\n\\\n{\\n\\\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\\n\\\n}\\n\\\nif (disableDepthTestDistance != 0.0)\\n\\\n{\\n\\\nfloat zclip = gl_Position.z / gl_Position.w;\\n\\\nbool clipped = (zclip < -1.0 || zclip > 1.0);\\n\\\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\\n\\\n{\\n\\\ngl_Position.z = -gl_Position.w;\\n\\\n#ifdef LOG_DEPTH\\n\\\nv_depthFromNearPlusOne = 1.0;\\n\\\n#endif\\n\\\n}\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef FRAGMENT_DEPTH_CHECK\\n\\\nif (sizeInMeters) {\\n\\\ntranslate /= mpp;\\n\\\ndimensions /= mpp;\\n\\\nimageSize /= mpp;\\n\\\n}\\n\\\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\\n\\\nv_rotationMatrix = rotationMatrix;\\n\\\n#else\\n\\\nv_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\\n\\\n#endif\\n\\\nfloat enableDepthCheck = 0.0;\\n\\\nif (lengthSq < disableDepthTestDistance)\\n\\\n{\\n\\\nenableDepthCheck = 1.0;\\n\\\n}\\n\\\nfloat dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\\n\\\nfloat dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\\n\\\nfloat iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\\n\\\nfloat ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\\n\\\nv_compressed.x = eyeDepth;\\n\\\nv_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\\n\\\nv_compressed.z = dw * SHIFT_LEFT12 + dh;\\n\\\nv_compressed.w = iw * SHIFT_LEFT12 + ih;\\n\\\nv_originTextureCoordinateAndTranslate.xy = depthOrigin;\\n\\\nv_originTextureCoordinateAndTranslate.zw = translate;\\n\\\nv_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\\n\\\n#endif\\n\\\n#ifdef SDF\\n\\\nvec4 outlineColor;\\n\\\nfloat outlineWidth;\\n\\\ntemp = sdf.x;\\n\\\ntemp = temp * SHIFT_RIGHT8;\\n\\\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\noutlineColor.r = floor(temp);\\n\\\ntemp = sdf.y;\\n\\\ntemp = temp * SHIFT_RIGHT8;\\n\\\nfloat temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\noutlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\noutlineColor.a = floor(temp);\\n\\\noutlineColor /= 255.0;\\n\\\nv_outlineWidth = outlineWidth / 255.0;\\n\\\nv_outlineColor = outlineColor;\\n\\\nv_outlineColor.a *= translucency;\\n\\\n#endif\\n\\\nv_pickColor = pickColor;\\n\\\nv_color = color;\\n\\\nv_color.a *= translucency;\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Resource from \"../Core/Resource.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\n/**\n * <div class=\"notice\">\n * A billboard is created and its initial\n * properties are set by calling {@link BillboardCollection#add}. Do not call the constructor directly.\n * </div>\n * A viewport-aligned image positioned in the 3D scene, that is created\n * and rendered using a {@link BillboardCollection}.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n *\n * @alias Billboard\n *\n * @performance Reading a property, e.g., {@link Billboard#show}, is constant time.\n * Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link BillboardCollection#update} is called. The per-billboard traffic is\n * the same regardless of how many properties were updated. If most billboards in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link BillboardCollection#removeAll}\n * and add new billboards instead of modifying each one.\n *\n * @exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see BillboardCollection\n * @see BillboardCollection#add\n * @see Label\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n */\nfunction Billboard(options, billboardCollection) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let translucencyByDistance = options.translucencyByDistance;\n let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;\n let scaleByDistance = options.scaleByDistance;\n let distanceDisplayCondition = options.distanceDisplayCondition;\n if (defined(translucencyByDistance)) {\ntranslucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n }\n if (defined(pixelOffsetScaleByDistance)) {\npixelOffsetScaleByDistance = NearFarScalar.clone(\n pixelOffsetScaleByDistance\n );\n }\n if (defined(scaleByDistance)) {\nscaleByDistance = NearFarScalar.clone(scaleByDistance);\n }\n if (defined(distanceDisplayCondition)) {\ndistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition\n );\n }\n\n this._show = defaultValue(options.show, true);\n this._position = Cartesian3.clone(\n defaultValue(options.position, Cartesian3.ZERO)\n );\n this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D\n this._pixelOffset = Cartesian2.clone(\n defaultValue(options.pixelOffset, Cartesian2.ZERO)\n );\n this._translate = new Cartesian2(0.0, 0.0); // used by labels for glyph vertex translation\n this._eyeOffset = Cartesian3.clone(\n defaultValue(options.eyeOffset, Cartesian3.ZERO)\n );\n this._heightReference = defaultValue(\n options.heightReference,\n HeightReference.NONE\n );\n this._verticalOrigin = defaultValue(\n options.verticalOrigin,\n VerticalOrigin.CENTER\n );\n this._horizontalOrigin = defaultValue(\n options.horizontalOrigin,\n HorizontalOrigin.CENTER\n );\n this._scale = defaultValue(options.scale, 1.0);\n this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n this._rotation = defaultValue(options.rotation, 0.0);\n this._alignedAxis = Cartesian3.clone(\n defaultValue(options.alignedAxis, Cartesian3.ZERO)\n );\n this._width = options.width;\n this._height = options.height;\n this._scaleByDistance = scaleByDistance;\n this._translucencyByDistance = translucencyByDistance;\n this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;\n this._sizeInMeters = defaultValue(options.sizeInMeters, false);\n this._distanceDisplayCondition = distanceDisplayCondition;\n this._disableDepthTestDistance = options.disableDepthTestDistance;\n this._id = options.id;\n this._collection = defaultValue(options.collection, billboardCollection);\n\n this._pickId = undefined;\n this._pickPrimitive = defaultValue(options._pickPrimitive, this);\n this._billboardCollection = billboardCollection;\n this._dirty = false;\n this._index = -1; //Used only by BillboardCollection\n this._batchIndex = undefined; // Used only by Vector3DTilePoints and BillboardCollection\n\n this._imageIndex = -1;\n this._imageIndexPromise = undefined;\n this._imageId = undefined;\n this._image = undefined;\n this._imageSubRegion = undefined;\n this._imageWidth = undefined;\n this._imageHeight = undefined;\n\n this._labelDimensions = undefined;\n this._labelHorizontalOrigin = undefined;\n this._labelTranslate = undefined;\n\n const image = options.image;\n let imageId = options.imageId;\n if (defined(image)) {\n if (!defined(imageId)) {\n if (typeof image === \"string\") {\n imageId = image;\n } else if (defined(image.src)) {\n imageId = image.src;\n } else {\n imageId = createGuid();\n }\n }\n\n this._imageId = imageId;\n this._image = image;\n }\n\n if (defined(options.imageSubRegion)) {\n this._imageId = imageId;\n this._imageSubRegion = options.imageSubRegion;\n }\n\n if (defined(this._billboardCollection._textureAtlas)) {\n this._loadImage();\n }\n\n this._actualClampedPosition = undefined;\n this._removeCallbackFunc = undefined;\n this._mode = SceneMode.SCENE3D;\n\n this._clusterShow = true;\n this._outlineColor = Color.clone(\n defaultValue(options.outlineColor, Color.BLACK)\n );\n this._outlineWidth = defaultValue(options.outlineWidth, 0.0);\n\n this._updateClamping();\n}\n\nconst SHOW_INDEX = (Billboard.SHOW_INDEX = 0);\nconst POSITION_INDEX = (Billboard.POSITION_INDEX = 1);\nconst PIXEL_OFFSET_INDEX = (Billboard.PIXEL_OFFSET_INDEX = 2);\nconst EYE_OFFSET_INDEX = (Billboard.EYE_OFFSET_INDEX = 3);\nconst HORIZONTAL_ORIGIN_INDEX = (Billboard.HORIZONTAL_ORIGIN_INDEX = 4);\nconst VERTICAL_ORIGIN_INDEX = (Billboard.VERTICAL_ORIGIN_INDEX = 5);\nconst SCALE_INDEX = (Billboard.SCALE_INDEX = 6);\nconst IMAGE_INDEX_INDEX = (Billboard.IMAGE_INDEX_INDEX = 7);\nconst COLOR_INDEX = (Billboard.COLOR_INDEX = 8);\nconst ROTATION_INDEX = (Billboard.ROTATION_INDEX = 9);\nconst ALIGNED_AXIS_INDEX = (Billboard.ALIGNED_AXIS_INDEX = 10);\nconst SCALE_BY_DISTANCE_INDEX = (Billboard.SCALE_BY_DISTANCE_INDEX = 11);\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = (Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX = 12);\nconst PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = (Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = 13);\nconst DISTANCE_DISPLAY_CONDITION = (Billboard.DISTANCE_DISPLAY_CONDITION = 14);\nconst DISABLE_DEPTH_DISTANCE = (Billboard.DISABLE_DEPTH_DISTANCE = 15);\nBillboard.TEXTURE_COORDINATE_BOUNDS = 16;\nconst SDF_INDEX = (Billboard.SDF_INDEX = 17);\nBillboard.NUMBER_OF_PROPERTIES = 18;\n\nfunction makeDirty(billboard, propertyChanged) {\n const billboardCollection = billboard._billboardCollection;\n if (defined(billboardCollection)) {\n billboardCollection._updateBillboard(billboard, propertyChanged);\n billboard._dirty = true;\n }\n}\n\nObject.defineProperties(Billboard.prototype, {\n /**\n * Determines if this billboard will be shown. Use this to hide or show a billboard, instead\n * of removing it and re-adding it to the collection.\n * @memberof Billboard.prototype\n * @type {Boolean}\n * @default true\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (this._show !== value) {\n this._show = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the Cartesian position of this billboard.\n * @memberof Billboard.prototype\n * @type {Cartesian3}\n */\n position: {\n get: function () {\n return this._position;\n },\n set: function (value) {\n const position = this._position;\n if (!Cartesian3.equals(position, value)) {\n Cartesian3.clone(value, position);\n Cartesian3.clone(value, this._actualPosition);\n this._updateClamping();\n makeDirty(this, POSITION_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the height reference of this billboard.\n * @memberof Billboard.prototype\n * @type {HeightReference}\n * @default HeightReference.NONE\n */\n heightReference: {\n get: function () {\n return this._heightReference;\n },\n set: function (value) {\n const heightReference = this._heightReference;\n if (value !== heightReference) {\n this._heightReference = value;\n this._updateClamping();\n makeDirty(this, POSITION_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used\n * to align multiple billboards and labels at the same position, e.g., an image and text. The\n * screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>\n * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n * </tr></table>\n * The billboard's origin is indicated by the yellow point.\n * </div>\n * @memberof Billboard.prototype\n * @type {Cartesian2}\n */\n pixelOffset: {\n get: function () {\n return this._pixelOffset;\n },\n set: function (value) {\n const pixelOffset = this._pixelOffset;\n if (!Cartesian2.equals(pixelOffset, value)) {\n Cartesian2.clone(value, pixelOffset);\n makeDirty(this, PIXEL_OFFSET_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.\n * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,\n * scaleByDistance will be disabled.\n * @memberof Billboard.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a billboard's scaleByDistance to scale by 1.5 when the\n * // camera is 1500 meters from the billboard and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable scaling by distance\n * b.scaleByDistance = undefined;\n */\n scaleByDistance: {\n get: function () {\n return this._scaleByDistance;\n },\n set: function (value) {\n const scaleByDistance = this._scaleByDistance;\n if (!NearFarScalar.equals(scaleByDistance, value)) {\n this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n makeDirty(this, SCALE_BY_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.\n * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,\n * translucencyByDistance will be disabled.\n * @memberof Billboard.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a billboard's translucency to 1.0 when the\n * // camera is 1500 meters from the billboard and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable translucency by distance\n * b.translucencyByDistance = undefined;\n */\n translucencyByDistance: {\n get: function () {\n return this._translucencyByDistance;\n },\n set: function (value) {\n const translucencyByDistance = this._translucencyByDistance;\n if (!NearFarScalar.equals(translucencyByDistance, value)) {\n this._translucencyByDistance = NearFarScalar.clone(\n value,\n translucencyByDistance\n );\n makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.\n * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,\n * pixelOffsetScaleByDistance will be disabled.\n * @memberof Billboard.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a billboard's pixel offset scale to 0.0 when the\n * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels\n * // in the y direction the camera distance approaches 8.0e6 meters.\n * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);\n * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);\n *\n * @example\n * // Example 2.\n * // disable pixel offset by distance\n * b.pixelOffsetScaleByDistance = undefined;\n */\n pixelOffsetScaleByDistance: {\n get: function () {\n return this._pixelOffsetScaleByDistance;\n },\n set: function (value) {\n const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) {\n this._pixelOffsetScaleByDistance = NearFarScalar.clone(\n value,\n pixelOffsetScaleByDistance\n );\n makeDirty(this, PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed\n * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and\n * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,\n * which is typically meters.\n * <br /><br />\n * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to\n * arrange a billboard above its corresponding 3D model.\n * <br /><br />\n * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always\n * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n * </tr></table>\n * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n * </div>\n * @memberof Billboard.prototype\n * @type {Cartesian3}\n */\n eyeOffset: {\n get: function () {\n return this._eyeOffset;\n },\n set: function (value) {\n const eyeOffset = this._eyeOffset;\n if (!Cartesian3.equals(eyeOffset, value)) {\n Cartesian3.clone(value, eyeOffset);\n makeDirty(this, EYE_OFFSET_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the horizontal origin of this billboard, which determines if the billboard is\n * to the left, center, or right of its anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n * </div>\n * @memberof Billboard.prototype\n * @type {HorizontalOrigin}\n * @example\n * // Use a bottom, left origin\n * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;\n * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n */\n horizontalOrigin: {\n get: function () {\n return this._horizontalOrigin;\n },\n set: function (value) {\n if (this._horizontalOrigin !== value) {\n this._horizontalOrigin = value;\n makeDirty(this, HORIZONTAL_ORIGIN_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the vertical origin of this billboard, which determines if the billboard is\n * to the above, below, or at the center of its anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n * </div>\n * @memberof Billboard.prototype\n * @type {VerticalOrigin}\n * @example\n * // Use a bottom, left origin\n * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;\n * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;\n */\n verticalOrigin: {\n get: function () {\n return this._verticalOrigin;\n },\n set: function (value) {\n if (this._verticalOrigin !== value) {\n this._verticalOrigin = value;\n makeDirty(this, VERTICAL_ORIGIN_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.\n * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than\n * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks\n * the billboard.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>\n * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n * and <code>2.0</code>.\n * </div>\n * @memberof Billboard.prototype\n * @type {Number}\n */\n scale: {\n get: function () {\n return this._scale;\n },\n set: function (value) {\n if (this._scale !== value) {\n this._scale = value;\n makeDirty(this, SCALE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,\n * the same white texture may be used by many different billboards, each with a different color, to create\n * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.\n * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>\n * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>\n * </tr></table>\n * </div>\n * <br />\n * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,\n * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>\n * (no intensity) to <code>1.0</code> (full intensity).\n * @memberof Billboard.prototype\n * @type {Color}\n *\n * @example\n * // Example 1. Assign yellow.\n * b.color = Cesium.Color.YELLOW;\n *\n * @example\n * // Example 2. Make a billboard 50% translucent.\n * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n const color = this._color;\n if (!Color.equals(color, value)) {\n Color.clone(value, color);\n makeDirty(this, COLOR_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the rotation angle in radians.\n * @memberof Billboard.prototype\n * @type {Number}\n */\n rotation: {\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n makeDirty(this, ROTATION_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.\n * The default is the zero vector, which means the billboard is aligned to the screen up vector.\n * @memberof Billboard.prototype\n * @type {Cartesian3}\n * @example\n * // Example 1.\n * // Have the billboard up vector point north\n * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;\n *\n * @example\n * // Example 2.\n * // Have the billboard point east.\n * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;\n * billboard.rotation = -Cesium.Math.PI_OVER_TWO;\n *\n * @example\n * // Example 3.\n * // Reset the aligned axis\n * billboard.alignedAxis = Cesium.Cartesian3.ZERO;\n */\n alignedAxis: {\n get: function () {\n return this._alignedAxis;\n },\n set: function (value) {\n const alignedAxis = this._alignedAxis;\n if (!Cartesian3.equals(alignedAxis, value)) {\n Cartesian3.clone(value, alignedAxis);\n makeDirty(this, ALIGNED_AXIS_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets a width for the billboard. If undefined, the image width will be used.\n * @memberof Billboard.prototype\n * @type {Number}\n */\n width: {\n get: function () {\n return defaultValue(this._width, this._imageWidth);\n },\n set: function (value) {\nif (this._width !== value) {\n this._width = value;\n makeDirty(this, IMAGE_INDEX_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets a height for the billboard. If undefined, the image height will be used.\n * @memberof Billboard.prototype\n * @type {Number}\n */\n height: {\n get: function () {\n return defaultValue(this._height, this._imageHeight);\n },\n set: function (value) {\nif (this._height !== value) {\n this._height = value;\n makeDirty(this, IMAGE_INDEX_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;\n * otherwise, the size is in pixels.\n * @memberof Billboard.prototype\n * @type {Boolean}\n * @default false\n */\n sizeInMeters: {\n get: function () {\n return this._sizeInMeters;\n },\n set: function (value) {\nif (this._sizeInMeters !== value) {\n this._sizeInMeters = value;\n makeDirty(this, COLOR_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.\n * @memberof Billboard.prototype\n * @type {DistanceDisplayCondition}\n * @default undefined\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\n if (\n !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n ) {\nthis._distanceDisplayCondition = DistanceDisplayCondition.clone(\n value,\n this._distanceDisplayCondition\n );\n makeDirty(this, DISTANCE_DISPLAY_CONDITION);\n }\n },\n },\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof Billboard.prototype\n * @type {Number}\n */\n disableDepthTestDistance: {\n get: function () {\n return this._disableDepthTestDistance;\n },\n set: function (value) {\nif (this._disableDepthTestDistance !== value) {\n this._disableDepthTestDistance = value;\n makeDirty(this, DISABLE_DEPTH_DISTANCE);\n }\n },\n },\n\n /**\n * Gets or sets the user-defined object returned when the billboard is picked.\n * @memberof Billboard.prototype\n * @type {Object}\n */\n id: {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this._id = value;\n if (defined(this._pickId)) {\n this._pickId.object.id = value;\n }\n },\n },\n\n /**\n * The primitive to return when picking this billboard.\n * @memberof Billboard.prototype\n * @private\n */\n pickPrimitive: {\n get: function () {\n return this._pickPrimitive;\n },\n set: function (value) {\n this._pickPrimitive = value;\n if (defined(this._pickId)) {\n this._pickId.object.primitive = value;\n }\n },\n },\n\n /**\n * @private\n */\n pickId: {\n get: function () {\n return this._pickId;\n },\n },\n\n /**\n * <p>\n * Gets or sets the image to be used for this billboard. If a texture has already been created for the\n * given image, the existing texture is used.\n * </p>\n * <p>\n * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,\n * a canvas, or another billboard's image property (from the same billboard collection).\n * </p>\n *\n * @memberof Billboard.prototype\n * @type {String}\n * @example\n * // load an image from a URL\n * b.image = 'some/image/url.png';\n *\n * // assuming b1 and b2 are billboards in the same billboard collection,\n * // use the same image for both billboards.\n * b2.image = b1.image;\n */\n image: {\n get: function () {\n return this._imageId;\n },\n set: function (value) {\n if (!defined(value)) {\n this._imageIndex = -1;\n this._imageSubRegion = undefined;\n this._imageId = undefined;\n this._image = undefined;\n this._imageIndexPromise = undefined;\n makeDirty(this, IMAGE_INDEX_INDEX);\n } else if (typeof value === \"string\") {\n this.setImage(value, value);\n } else if (value instanceof Resource) {\n this.setImage(value.url, value);\n } else if (defined(value.src)) {\n this.setImage(value.src, value);\n } else {\n this.setImage(createGuid(), value);\n }\n },\n },\n\n /**\n * When <code>true</code>, this billboard is ready to render, i.e., the image\n * has been downloaded and the WebGL resources are created.\n *\n * @memberof Billboard.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n ready: {\n get: function () {\n return this._imageIndex !== -1;\n },\n },\n\n /**\n * Keeps track of the position of the billboard based on the height reference.\n * @memberof Billboard.prototype\n * @type {Cartesian3}\n * @private\n */\n _clampedPosition: {\n get: function () {\n return this._actualClampedPosition;\n },\n set: function (value) {\n this._actualClampedPosition = Cartesian3.clone(\n value,\n this._actualClampedPosition\n );\n makeDirty(this, POSITION_INDEX);\n },\n },\n\n /**\n * Determines whether or not this billboard will be shown or hidden because it was clustered.\n * @memberof Billboard.prototype\n * @type {Boolean}\n * @private\n */\n clusterShow: {\n get: function () {\n return this._clusterShow;\n },\n set: function (value) {\n if (this._clusterShow !== value) {\n this._clusterShow = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n\n /**\n * The outline color of this Billboard. Effective only for SDF billboards like Label glyphs.\n * @memberof Billboard.prototype\n * @type {Color}\n * @private\n */\n outlineColor: {\n get: function () {\n return this._outlineColor;\n },\n set: function (value) {\n const outlineColor = this._outlineColor;\n if (!Color.equals(outlineColor, value)) {\n Color.clone(value, outlineColor);\n makeDirty(this, SDF_INDEX);\n }\n },\n },\n\n /**\n * The outline width of this Billboard in pixels. Effective only for SDF billboards like Label glyphs.\n * @memberof Billboard.prototype\n * @type {Number}\n * @private\n */\n outlineWidth: {\n get: function () {\n return this._outlineWidth;\n },\n set: function (value) {\n if (this._outlineWidth !== value) {\n this._outlineWidth = value;\n makeDirty(this, SDF_INDEX);\n }\n },\n },\n});\n\nBillboard.prototype.getPickId = function (context) {\n if (!defined(this._pickId)) {\n this._pickId = context.createPickId({\n primitive: this._pickPrimitive,\n collection: this._collection,\n id: this._id,\n });\n }\n\n return this._pickId;\n};\n\nBillboard.prototype._updateClamping = function () {\n Billboard._updateClamping(this._billboardCollection, this);\n};\n\nconst scratchCartographic = new Cartographic();\nconst scratchPosition = new Cartesian3();\n\nBillboard._updateClamping = function (collection, owner) {\n const scene = collection._scene;\n if (!defined(scene) || !defined(scene.globe)) {\nreturn;\n }\n\n const globe = scene.globe;\n const ellipsoid = globe.ellipsoid;\n const surface = globe._surface;\n\n const mode = scene.frameState.mode;\n\n const modeChanged = mode !== owner._mode;\n owner._mode = mode;\n\n if (\n (owner._heightReference === HeightReference.NONE || modeChanged) &&\n defined(owner._removeCallbackFunc)\n ) {\n owner._removeCallbackFunc();\n owner._removeCallbackFunc = undefined;\n owner._clampedPosition = undefined;\n }\n\n if (\n owner._heightReference === HeightReference.NONE ||\n !defined(owner._position)\n ) {\n return;\n }\n\n const position = ellipsoid.cartesianToCartographic(owner._position);\n if (!defined(position)) {\n owner._actualClampedPosition = undefined;\n return;\n }\n\n if (defined(owner._removeCallbackFunc)) {\n owner._removeCallbackFunc();\n }\n\n function updateFunction(clampedPosition) {\n if (owner._heightReference === HeightReference.RELATIVE_TO_GROUND) {\n if (owner._mode === SceneMode.SCENE3D) {\n const clampedCart = ellipsoid.cartesianToCartographic(\n clampedPosition,\n scratchCartographic\n );\n clampedCart.height += position.height;\n ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);\n } else {\n clampedPosition.x += position.height;\n }\n }\n owner._clampedPosition = Cartesian3.clone(\n clampedPosition,\n owner._clampedPosition\n );\n }\n owner._removeCallbackFunc = surface.updateHeight(position, updateFunction);\n\n Cartographic.clone(position, scratchCartographic);\n const height = globe.getHeight(position);\n if (defined(height)) {\n scratchCartographic.height = height;\n }\n\n ellipsoid.cartographicToCartesian(scratchCartographic, scratchPosition);\n\n updateFunction(scratchPosition);\n};\n\nBillboard.prototype._loadImage = function () {\n const atlas = this._billboardCollection._textureAtlas;\n\n const imageId = this._imageId;\n const image = this._image;\n const imageSubRegion = this._imageSubRegion;\n let imageIndexPromise;\n\n const that = this;\n function completeImageLoad(index) {\n if (\n that._imageId !== imageId ||\n that._image !== image ||\n !BoundingRectangle.equals(that._imageSubRegion, imageSubRegion)\n ) {\n // another load occurred before this one finished, ignore the index\n return;\n }\n\n // fill in imageWidth and imageHeight\n const textureCoordinates = atlas.textureCoordinates[index];\n that._imageWidth = atlas.texture.width * textureCoordinates.width;\n that._imageHeight = atlas.texture.height * textureCoordinates.height;\n\n that._imageIndex = index;\n that._ready = true;\n that._image = undefined;\n that._imageIndexPromise = undefined;\n makeDirty(that, IMAGE_INDEX_INDEX);\n }\n\n if (defined(image)) {\n // No need to wait on imageIndexPromise since these have already been added to the atlas\n const index = atlas.getImageIndex(imageId);\n if (defined(index)) {\n completeImageLoad(index);\n return;\n }\n\n imageIndexPromise = atlas.addImage(imageId, image);\n }\n if (defined(imageSubRegion)) {\n imageIndexPromise = atlas.addSubRegion(imageId, imageSubRegion);\n }\n\n this._imageIndexPromise = imageIndexPromise;\n\n if (!defined(imageIndexPromise)) {\n return;\n }\n\n imageIndexPromise.then(completeImageLoad).catch(function (error) {\n console.error(`Error loading image for billboard: ${error}`);\n that._imageIndexPromise = undefined;\n });\n};\n\n/**\n * <p>\n * Sets the image to be used for this billboard. If a texture has already been created for the\n * given id, the existing texture is used.\n * </p>\n * <p>\n * This function is useful for dynamically creating textures that are shared across many billboards.\n * Only the first billboard will actually call the function and create the texture, while subsequent\n * billboards created with the same id will simply re-use the existing texture.\n * </p>\n * <p>\n * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.\n * </p>\n *\n * @param {String} id The id of the image. This can be any string that uniquely identifies the image.\n * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Billboard.CreateImageCallback} image The image to load. This parameter\n * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,\n * or a function which will be called to create the image if it hasn't been loaded already.\n * @example\n * // create a billboard image dynamically\n * function drawImage(id) {\n * // create and draw an image using a canvas\n * const canvas = document.createElement('canvas');\n * const context2D = canvas.getContext('2d');\n * // ... draw image\n * return canvas;\n * }\n * // drawImage will be called to create the texture\n * b.setImage('myImage', drawImage);\n *\n * // subsequent billboards created in the same collection using the same id will use the existing\n * // texture, without the need to create the canvas or draw the image\n * b2.setImage('myImage', drawImage);\n */\nBillboard.prototype.setImage = function (id, image) {\n if (this._imageId === id) {\n return;\n }\n\n this._imageIndex = -1;\n this._imageSubRegion = undefined;\n this._imageId = id;\n this._image = image;\n\n if (defined(this._billboardCollection._textureAtlas)) {\n this._loadImage();\n }\n};\n\n/**\n * Uses a sub-region of the image with the given id as the image for this billboard,\n * measured in pixels from the bottom-left.\n *\n * @param {String} id The id of the image to use.\n * @param {BoundingRectangle} subRegion The sub-region of the image.\n *\n * @exception {RuntimeError} image with id must be in the atlas\n */\nBillboard.prototype.setImageSubRegion = function (id, subRegion) {\n if (\n this._imageId === id &&\n BoundingRectangle.equals(this._imageSubRegion, subRegion)\n ) {\n return;\n }\n\n this._imageIndex = -1;\n this._imageId = id;\n this._imageSubRegion = BoundingRectangle.clone(subRegion);\n\n if (defined(this._billboardCollection._textureAtlas)) {\n this._loadImage();\n }\n};\n\nBillboard.prototype._setTranslate = function (value) {\n const translate = this._translate;\n if (!Cartesian2.equals(translate, value)) {\n Cartesian2.clone(value, translate);\n makeDirty(this, PIXEL_OFFSET_INDEX);\n }\n};\n\nBillboard.prototype._getActualPosition = function () {\n return defined(this._clampedPosition)\n ? this._clampedPosition\n : this._actualPosition;\n};\n\nBillboard.prototype._setActualPosition = function (value) {\n if (!defined(this._clampedPosition)) {\n Cartesian3.clone(value, this._actualPosition);\n }\n makeDirty(this, POSITION_INDEX);\n};\n\nconst tempCartesian3 = new Cartesian4();\nBillboard._computeActualPosition = function (\n billboard,\n position,\n frameState,\n modelMatrix\n) {\n if (defined(billboard._clampedPosition)) {\n if (frameState.mode !== billboard._mode) {\n billboard._updateClamping();\n }\n return billboard._clampedPosition;\n } else if (frameState.mode === SceneMode.SCENE3D) {\n return position;\n }\n\n Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);\n return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);\n};\n\nconst scratchCartesian3 = new Cartesian3();\n\n// This function is basically a stripped-down JavaScript version of BillboardCollectionVS.glsl\nBillboard._computeScreenSpacePosition = function (\n modelMatrix,\n position,\n eyeOffset,\n pixelOffset,\n scene,\n result\n) {\n // Model to world coordinates\n const positionWorld = Matrix4.multiplyByPoint(\n modelMatrix,\n position,\n scratchCartesian3\n );\n\n // World to window coordinates\n const positionWC = SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(\n scene,\n positionWorld,\n eyeOffset,\n result\n );\n if (!defined(positionWC)) {\n return undefined;\n }\n\n // Apply pixel offset\n Cartesian2.add(positionWC, pixelOffset, positionWC);\n\n return positionWC;\n};\n\nconst scratchPixelOffset = new Cartesian2(0.0, 0.0);\n\n/**\n * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the billboard.\n *\n * @exception {DeveloperError} Billboard must be in a collection.\n *\n * @example\n * console.log(b.computeScreenSpacePosition(scene).toString());\n *\n * @see Billboard#eyeOffset\n * @see Billboard#pixelOffset\n */\nBillboard.prototype.computeScreenSpacePosition = function (scene, result) {\n const billboardCollection = this._billboardCollection;\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n // pixel offset for screen space computation is the pixelOffset + screen space translate\n Cartesian2.clone(this._pixelOffset, scratchPixelOffset);\n Cartesian2.add(scratchPixelOffset, this._translate, scratchPixelOffset);\n\n let modelMatrix = billboardCollection.modelMatrix;\n let position = this._position;\n if (defined(this._clampedPosition)) {\n position = this._clampedPosition;\n if (scene.mode !== SceneMode.SCENE3D) {\n // position needs to be in world coordinates\n const projection = scene.mapProjection;\n const ellipsoid = projection.ellipsoid;\n const cart = projection.unproject(position, scratchCartographic);\n position = ellipsoid.cartographicToCartesian(cart, scratchCartesian3);\n modelMatrix = Matrix4.IDENTITY;\n }\n }\n\n const windowCoordinates = Billboard._computeScreenSpacePosition(\n modelMatrix,\n position,\n this._eyeOffset,\n scratchPixelOffset,\n scene,\n result\n );\n return windowCoordinates;\n};\n\n/**\n * Gets a billboard's screen space bounding box centered around screenSpacePosition.\n * @param {Billboard} billboard The billboard to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nBillboard.getScreenSpaceBoundingBox = function (\n billboard,\n screenSpacePosition,\n result\n) {\n let width = billboard.width;\n let height = billboard.height;\n\n const scale = billboard.scale;\n width *= scale;\n height *= scale;\n\n let x = screenSpacePosition.x;\n if (billboard.horizontalOrigin === HorizontalOrigin.RIGHT) {\n x -= width;\n } else if (billboard.horizontalOrigin === HorizontalOrigin.CENTER) {\n x -= width * 0.5;\n }\n\n let y = screenSpacePosition.y;\n if (\n billboard.verticalOrigin === VerticalOrigin.BOTTOM ||\n billboard.verticalOrigin === VerticalOrigin.BASELINE\n ) {\n y -= height;\n } else if (billboard.verticalOrigin === VerticalOrigin.CENTER) {\n y -= height * 0.5;\n }\n\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n result.x = x;\n result.y = y;\n result.width = width;\n result.height = height;\n\n return result;\n};\n\n/**\n * Determines if this billboard equals another billboard. Billboards are equal if all their properties\n * are equal. Billboards in different collections can be equal.\n *\n * @param {Billboard} other The billboard to compare for equality.\n * @returns {Boolean} <code>true</code> if the billboards are equal; otherwise, <code>false</code>.\n */\nBillboard.prototype.equals = function (other) {\n return (\n this === other ||\n (defined(other) &&\n this._id === other._id &&\n Cartesian3.equals(this._position, other._position) &&\n this._imageId === other._imageId &&\n this._show === other._show &&\n this._scale === other._scale &&\n this._verticalOrigin === other._verticalOrigin &&\n this._horizontalOrigin === other._horizontalOrigin &&\n this._heightReference === other._heightReference &&\n BoundingRectangle.equals(this._imageSubRegion, other._imageSubRegion) &&\n Color.equals(this._color, other._color) &&\n Cartesian2.equals(this._pixelOffset, other._pixelOffset) &&\n Cartesian2.equals(this._translate, other._translate) &&\n Cartesian3.equals(this._eyeOffset, other._eyeOffset) &&\n NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n NearFarScalar.equals(\n this._translucencyByDistance,\n other._translucencyByDistance\n ) &&\n NearFarScalar.equals(\n this._pixelOffsetScaleByDistance,\n other._pixelOffsetScaleByDistance\n ) &&\n DistanceDisplayCondition.equals(\n this._distanceDisplayCondition,\n other._distanceDisplayCondition\n ) &&\n this._disableDepthTestDistance === other._disableDepthTestDistance)\n );\n};\n\nBillboard.prototype._destroy = function () {\n if (defined(this._customData)) {\n this._billboardCollection._scene.globe._surface.removeTileCustomData(\n this._customData\n );\n this._customData = undefined;\n }\n\n if (defined(this._removeCallbackFunc)) {\n this._removeCallbackFunc();\n this._removeCallbackFunc = undefined;\n }\n\n this.image = undefined;\n this._pickId = this._pickId && this._pickId.destroy();\n this._billboardCollection = undefined;\n};\n\n/**\n * A function that creates an image.\n * @callback Billboard.CreateImageCallback\n * @param {String} id The identifier of the image to load.\n * @returns {HTMLImageElement|HTMLCanvasElement|Promise<HTMLImageElement|HTMLCanvasElement>} The image, or a promise that will resolve to an image.\n */\nexport default Billboard;\n", "/**\n * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.\n *\n * @enum {Number}\n */\nconst BlendOption = {\n /**\n * The billboards, points, or labels in the collection are completely opaque.\n * @type {Number}\n * @constant\n */\n OPAQUE: 0,\n\n /**\n * The billboards, points, or labels in the collection are completely translucent.\n * @type {Number}\n * @constant\n */\n TRANSLUCENT: 1,\n\n /**\n * The billboards, points, or labels in the collection are both opaque and translucent.\n * @type {Number}\n * @constant\n */\n OPAQUE_AND_TRANSLUCENT: 2,\n};\nexport default Object.freeze(BlendOption);\n", "/**\n * Settings for the generation of signed distance field glyphs\n *\n * @private\n */\nconst SDFSettings = {\n /**\n * The font size in pixels\n *\n * @type {Number}\n * @constant\n */\n FONT_SIZE: 48.0,\n\n /**\n * Whitespace padding around glyphs.\n *\n * @type {Number}\n * @constant\n */\n PADDING: 10.0,\n\n /**\n * How many pixels around the glyph shape to use for encoding distance\n *\n * @type {Number}\n * @constant\n */\n RADIUS: 8.0,\n\n /**\n * How much of the radius (relative) is used for the inside part the glyph.\n *\n * @type {Number}\n * @constant\n */\n CUTOFF: 0.25,\n};\nexport default Object.freeze(SDFSettings);\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport Texture from \"../Renderer/Texture.js\";\n\n// The atlas is made up of regions of space called nodes that contain images or child nodes.\nfunction TextureAtlasNode(\n bottomLeft,\n topRight,\n childNode1,\n childNode2,\n imageIndex\n) {\n this.bottomLeft = defaultValue(bottomLeft, Cartesian2.ZERO);\n this.topRight = defaultValue(topRight, Cartesian2.ZERO);\n this.childNode1 = childNode1;\n this.childNode2 = childNode2;\n this.imageIndex = imageIndex;\n}\n\nconst defaultInitialSize = new Cartesian2(16.0, 16.0);\n\n/**\n * A TextureAtlas stores multiple images in one square texture and keeps\n * track of the texture coordinates for each image. TextureAtlas is dynamic,\n * meaning new images can be added at any point in time.\n * Texture coordinates are subject to change if the texture atlas resizes, so it is\n * important to check {@link TextureAtlas#getGUID} before using old values.\n *\n * @alias TextureAtlas\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Scene} options.context The context in which the texture gets created.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] The pixel format of the texture.\n * @param {Number} [options.borderWidthInPixels=1] The amount of spacing between adjacent images in pixels.\n * @param {Cartesian2} [options.initialSize=new Cartesian2(16.0, 16.0)] The initial side lengths of the texture.\n *\n * @exception {DeveloperError} borderWidthInPixels must be greater than or equal to zero.\n * @exception {DeveloperError} initialSize must be greater than zero.\n *\n * @private\n */\nfunction TextureAtlas(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const borderWidthInPixels = defaultValue(options.borderWidthInPixels, 1.0);\n const initialSize = defaultValue(options.initialSize, defaultInitialSize);\n\n this._context = options.context;\n this._pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n this._borderWidthInPixels = borderWidthInPixels;\n this._textureCoordinates = [];\n this._guid = createGuid();\n this._idHash = {};\n this._indexHash = {};\n this._initialSize = initialSize;\n\n this._root = undefined;\n}\n\nObject.defineProperties(TextureAtlas.prototype, {\n /**\n * The amount of spacing between adjacent images in pixels.\n * @memberof TextureAtlas.prototype\n * @type {Number}\n */\n borderWidthInPixels: {\n get: function () {\n return this._borderWidthInPixels;\n },\n },\n\n /**\n * An array of {@link BoundingRectangle} texture coordinate regions for all the images in the texture atlas.\n * The x and y values of the rectangle correspond to the bottom-left corner of the texture coordinate.\n * The coordinates are in the order that the corresponding images were added to the atlas.\n * @memberof TextureAtlas.prototype\n * @type {BoundingRectangle[]}\n */\n textureCoordinates: {\n get: function () {\n return this._textureCoordinates;\n },\n },\n\n /**\n * The texture that all of the images are being written to.\n * @memberof TextureAtlas.prototype\n * @type {Texture}\n */\n texture: {\n get: function () {\n if (!defined(this._texture)) {\n this._texture = new Texture({\n context: this._context,\n width: this._initialSize.x,\n height: this._initialSize.y,\n pixelFormat: this._pixelFormat,\n });\n }\n return this._texture;\n },\n },\n\n /**\n * The number of images in the texture atlas. This value increases\n * every time addImage or addImages is called.\n * Texture coordinates are subject to change if the texture atlas resizes, so it is\n * important to check {@link TextureAtlas#getGUID} before using old values.\n * @memberof TextureAtlas.prototype\n * @type {Number}\n */\n numberOfImages: {\n get: function () {\n return this._textureCoordinates.length;\n },\n },\n\n /**\n * The atlas' globally unique identifier (GUID).\n * The GUID changes whenever the texture atlas is modified.\n * Classes that use a texture atlas should check if the GUID\n * has changed before processing the atlas data.\n * @memberof TextureAtlas.prototype\n * @type {String}\n */\n guid: {\n get: function () {\n return this._guid;\n },\n },\n});\n\n// Builds a larger texture and copies the old texture into the new one.\nfunction resizeAtlas(textureAtlas, image) {\n const context = textureAtlas._context;\n const numImages = textureAtlas.numberOfImages;\n const scalingFactor = 2.0;\n const borderWidthInPixels = textureAtlas._borderWidthInPixels;\n if (numImages > 0) {\n const oldAtlasWidth = textureAtlas._texture.width;\n const oldAtlasHeight = textureAtlas._texture.height;\n const atlasWidth =\n scalingFactor * (oldAtlasWidth + image.width + borderWidthInPixels);\n const atlasHeight =\n scalingFactor * (oldAtlasHeight + image.height + borderWidthInPixels);\n const widthRatio = oldAtlasWidth / atlasWidth;\n const heightRatio = oldAtlasHeight / atlasHeight;\n\n // Create new node structure, putting the old root node in the bottom left.\n const nodeBottomRight = new TextureAtlasNode(\n new Cartesian2(oldAtlasWidth + borderWidthInPixels, borderWidthInPixels),\n new Cartesian2(atlasWidth, oldAtlasHeight)\n );\n const nodeBottomHalf = new TextureAtlasNode(\n new Cartesian2(),\n new Cartesian2(atlasWidth, oldAtlasHeight),\n textureAtlas._root,\n nodeBottomRight\n );\n const nodeTopHalf = new TextureAtlasNode(\n new Cartesian2(borderWidthInPixels, oldAtlasHeight + borderWidthInPixels),\n new Cartesian2(atlasWidth, atlasHeight)\n );\n const nodeMain = new TextureAtlasNode(\n new Cartesian2(),\n new Cartesian2(atlasWidth, atlasHeight),\n nodeBottomHalf,\n nodeTopHalf\n );\n\n // Resize texture coordinates.\n for (let i = 0; i < textureAtlas._textureCoordinates.length; i++) {\n const texCoord = textureAtlas._textureCoordinates[i];\n if (defined(texCoord)) {\n texCoord.x *= widthRatio;\n texCoord.y *= heightRatio;\n texCoord.width *= widthRatio;\n texCoord.height *= heightRatio;\n }\n }\n\n // Copy larger texture.\n const newTexture = new Texture({\n context: textureAtlas._context,\n width: atlasWidth,\n height: atlasHeight,\n pixelFormat: textureAtlas._pixelFormat,\n });\n\n const framebuffer = new Framebuffer({\n context: context,\n colorTextures: [textureAtlas._texture],\n destroyAttachments: false,\n });\n\n framebuffer._bind();\n newTexture.copyFromFramebuffer(0, 0, 0, 0, atlasWidth, atlasHeight);\n framebuffer._unBind();\n framebuffer.destroy();\n textureAtlas._texture =\n textureAtlas._texture && textureAtlas._texture.destroy();\n textureAtlas._texture = newTexture;\n textureAtlas._root = nodeMain;\n } else {\n // First image exceeds initialSize\n let initialWidth = scalingFactor * (image.width + 2 * borderWidthInPixels);\n let initialHeight =\n scalingFactor * (image.height + 2 * borderWidthInPixels);\n if (initialWidth < textureAtlas._initialSize.x) {\n initialWidth = textureAtlas._initialSize.x;\n }\n if (initialHeight < textureAtlas._initialSize.y) {\n initialHeight = textureAtlas._initialSize.y;\n }\n textureAtlas._texture =\n textureAtlas._texture && textureAtlas._texture.destroy();\n textureAtlas._texture = new Texture({\n context: textureAtlas._context,\n width: initialWidth,\n height: initialHeight,\n pixelFormat: textureAtlas._pixelFormat,\n });\n textureAtlas._root = new TextureAtlasNode(\n new Cartesian2(borderWidthInPixels, borderWidthInPixels),\n new Cartesian2(initialWidth, initialHeight)\n );\n }\n}\n\n// A recursive function that finds the best place to insert\n// a new image based on existing image 'nodes'.\n// Inspired by: http://blackpawn.com/texts/lightmaps/default.html\nfunction findNode(textureAtlas, node, image) {\n if (!defined(node)) {\n return undefined;\n }\n\n // If a leaf node\n if (!defined(node.childNode1) && !defined(node.childNode2)) {\n // Node already contains an image, don't add to it.\n if (defined(node.imageIndex)) {\n return undefined;\n }\n\n const nodeWidth = node.topRight.x - node.bottomLeft.x;\n const nodeHeight = node.topRight.y - node.bottomLeft.y;\n const widthDifference = nodeWidth - image.width;\n const heightDifference = nodeHeight - image.height;\n\n // Node is smaller than the image.\n if (widthDifference < 0 || heightDifference < 0) {\n return undefined;\n }\n\n // If the node is the same size as the image, return the node\n if (widthDifference === 0 && heightDifference === 0) {\n return node;\n }\n\n // Vertical split (childNode1 = left half, childNode2 = right half).\n if (widthDifference > heightDifference) {\n node.childNode1 = new TextureAtlasNode(\n new Cartesian2(node.bottomLeft.x, node.bottomLeft.y),\n new Cartesian2(node.bottomLeft.x + image.width, node.topRight.y)\n );\n // Only make a second child if the border gives enough space.\n const childNode2BottomLeftX =\n node.bottomLeft.x + image.width + textureAtlas._borderWidthInPixels;\n if (childNode2BottomLeftX < node.topRight.x) {\n node.childNode2 = new TextureAtlasNode(\n new Cartesian2(childNode2BottomLeftX, node.bottomLeft.y),\n new Cartesian2(node.topRight.x, node.topRight.y)\n );\n }\n }\n // Horizontal split (childNode1 = bottom half, childNode2 = top half).\n else {\n node.childNode1 = new TextureAtlasNode(\n new Cartesian2(node.bottomLeft.x, node.bottomLeft.y),\n new Cartesian2(node.topRight.x, node.bottomLeft.y + image.height)\n );\n // Only make a second child if the border gives enough space.\n const childNode2BottomLeftY =\n node.bottomLeft.y + image.height + textureAtlas._borderWidthInPixels;\n if (childNode2BottomLeftY < node.topRight.y) {\n node.childNode2 = new TextureAtlasNode(\n new Cartesian2(node.bottomLeft.x, childNode2BottomLeftY),\n new Cartesian2(node.topRight.x, node.topRight.y)\n );\n }\n }\n return findNode(textureAtlas, node.childNode1, image);\n }\n\n // If not a leaf node\n return (\n findNode(textureAtlas, node.childNode1, image) ||\n findNode(textureAtlas, node.childNode2, image)\n );\n}\n\n// Adds image of given index to the texture atlas. Called from addImage and addImages.\nfunction addImage(textureAtlas, image, index) {\n const node = findNode(textureAtlas, textureAtlas._root, image);\n if (defined(node)) {\n // Found a node that can hold the image.\n node.imageIndex = index;\n\n // Add texture coordinate and write to texture\n const atlasWidth = textureAtlas._texture.width;\n const atlasHeight = textureAtlas._texture.height;\n const nodeWidth = node.topRight.x - node.bottomLeft.x;\n const nodeHeight = node.topRight.y - node.bottomLeft.y;\n const x = node.bottomLeft.x / atlasWidth;\n const y = node.bottomLeft.y / atlasHeight;\n const w = nodeWidth / atlasWidth;\n const h = nodeHeight / atlasHeight;\n textureAtlas._textureCoordinates[index] = new BoundingRectangle(x, y, w, h);\n textureAtlas._texture.copyFrom({\n source: image,\n xOffset: node.bottomLeft.x,\n yOffset: node.bottomLeft.y,\n });\n } else {\n // No node found, must resize the texture atlas.\n resizeAtlas(textureAtlas, image);\n addImage(textureAtlas, image, index);\n }\n\n textureAtlas._guid = createGuid();\n}\n\nfunction getIndex(atlas, image) {\n if (!defined(atlas) || atlas.isDestroyed()) {\n return -1;\n }\n\n const index = atlas.numberOfImages;\n\n addImage(atlas, image, index);\n\n return index;\n}\n\n/**\n * If the image is already in the atlas, the existing index is returned. Otherwise, the result is undefined.\n *\n * @param {String} id An identifier to detect whether the image already exists in the atlas.\n * @returns {Number|undefined} The image index, or undefined if the image does not exist in the atlas.\n */\nTextureAtlas.prototype.getImageIndex = function (id) {\n return this._indexHash[id];\n};\n\n/**\n * Adds an image to the atlas synchronously. If the image is already in the atlas, the atlas is unchanged and\n * the existing index is used.\n *\n * @param {String} id An identifier to detect whether the image already exists in the atlas.\n * @param {HTMLImageElement|HTMLCanvasElement} image An image or canvas to add to the texture atlas.\n * @returns {Number} The image index.\n */\nTextureAtlas.prototype.addImageSync = function (id, image) {\n let index = this._indexHash[id];\n if (defined(index)) {\n // we're already aware of this source\n return index;\n }\n\n index = getIndex(this, image);\n // store the promise\n this._idHash[id] = Promise.resolve(index);\n this._indexHash[id] = index;\n // but return the value synchronously\n return index;\n};\n\n/**\n * Adds an image to the atlas. If the image is already in the atlas, the atlas is unchanged and\n * the existing index is used.\n *\n * @param {String} id An identifier to detect whether the image already exists in the atlas.\n * @param {HTMLImageElement|HTMLCanvasElement|String|Resource|Promise|TextureAtlas.CreateImageCallback} image An image or canvas to add to the texture atlas,\n * or a URL to an Image, or a Promise for an image, or a function that creates an image.\n * @returns {Promise.<Number>} A Promise for the image index.\n */\nTextureAtlas.prototype.addImage = function (id, image) {\n let indexPromise = this._idHash[id];\n if (defined(indexPromise)) {\n // we're already aware of this source\n return indexPromise;\n }\n\n // not in atlas, create the promise for the index\n\n if (typeof image === \"function\") {\n // if image is a function, call it\n image = image(id);\n} else if (typeof image === \"string\" || image instanceof Resource) {\n // Get a resource\n const resource = Resource.createIfNeeded(image);\n image = resource.fetchImage();\n }\n\n const that = this;\n indexPromise = Promise.resolve(image).then(function (image) {\n const index = getIndex(that, image);\n that._indexHash[id] = index;\n return index;\n });\n\n // store the promise\n this._idHash[id] = indexPromise;\n\n return indexPromise;\n};\n\n/**\n * Add a sub-region of an existing atlas image as additional image indices.\n *\n * @param {String} id The identifier of the existing image.\n * @param {BoundingRectangle} subRegion An {@link BoundingRectangle} sub-region measured in pixels from the bottom-left.\n *\n * @returns {Promise.<Number>} A Promise for the image index.\n */\nTextureAtlas.prototype.addSubRegion = function (id, subRegion) {\n const indexPromise = this._idHash[id];\n if (!defined(indexPromise)) {\n throw new RuntimeError(`image with id \"${id}\" not found in the atlas.`);\n }\n\n const that = this;\n return Promise.resolve(indexPromise).then(function (index) {\n if (index === -1) {\n // the atlas is destroyed\n return -1;\n }\n const atlasWidth = that._texture.width;\n const atlasHeight = that._texture.height;\n const numImages = that.numberOfImages;\n\n const baseRegion = that._textureCoordinates[index];\n const x = baseRegion.x + subRegion.x / atlasWidth;\n const y = baseRegion.y + subRegion.y / atlasHeight;\n const w = subRegion.width / atlasWidth;\n const h = subRegion.height / atlasHeight;\n that._textureCoordinates.push(new BoundingRectangle(x, y, w, h));\n that._guid = createGuid();\n\n return numImages;\n });\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TextureAtlas#destroy\n */\nTextureAtlas.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * atlas = atlas && atlas.destroy();\n *\n * @see TextureAtlas#isDestroyed\n */\nTextureAtlas.prototype.destroy = function () {\n this._texture = this._texture && this._texture.destroy();\n return destroyObject(this);\n};\n\n/**\n * A function that creates an image.\n * @callback TextureAtlas.CreateImageCallback\n * @param {String} id The identifier of the image to load.\n * @returns {HTMLImageElement|Promise<HTMLImageElement>} The image, or a promise that will resolve to an image.\n */\nexport default TextureAtlas;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport BillboardCollectionFS from \"../Shaders/BillboardCollectionFS.js\";\nimport BillboardCollectionVS from \"../Shaders/BillboardCollectionVS.js\";\nimport Billboard from \"./Billboard.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport TextureAtlas from \"./TextureAtlas.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\nconst SHOW_INDEX = Billboard.SHOW_INDEX;\nconst POSITION_INDEX = Billboard.POSITION_INDEX;\nconst PIXEL_OFFSET_INDEX = Billboard.PIXEL_OFFSET_INDEX;\nconst EYE_OFFSET_INDEX = Billboard.EYE_OFFSET_INDEX;\nconst HORIZONTAL_ORIGIN_INDEX = Billboard.HORIZONTAL_ORIGIN_INDEX;\nconst VERTICAL_ORIGIN_INDEX = Billboard.VERTICAL_ORIGIN_INDEX;\nconst SCALE_INDEX = Billboard.SCALE_INDEX;\nconst IMAGE_INDEX_INDEX = Billboard.IMAGE_INDEX_INDEX;\nconst COLOR_INDEX = Billboard.COLOR_INDEX;\nconst ROTATION_INDEX = Billboard.ROTATION_INDEX;\nconst ALIGNED_AXIS_INDEX = Billboard.ALIGNED_AXIS_INDEX;\nconst SCALE_BY_DISTANCE_INDEX = Billboard.SCALE_BY_DISTANCE_INDEX;\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX;\nconst PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX =\n Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION_INDEX = Billboard.DISTANCE_DISPLAY_CONDITION;\nconst DISABLE_DEPTH_DISTANCE = Billboard.DISABLE_DEPTH_DISTANCE;\nconst TEXTURE_COORDINATE_BOUNDS = Billboard.TEXTURE_COORDINATE_BOUNDS;\nconst SDF_INDEX = Billboard.SDF_INDEX;\nconst NUMBER_OF_PROPERTIES = Billboard.NUMBER_OF_PROPERTIES;\n\nlet attributeLocations;\n\nconst attributeLocationsBatched = {\n positionHighAndScale: 0,\n positionLowAndRotation: 1,\n compressedAttribute0: 2, // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates\n compressedAttribute1: 3, // aligned axis, translucency by distance, image width\n compressedAttribute2: 4, // image height, color, pick color, size in meters, valid aligned axis, 13 bits free\n eyeOffset: 5, // 4 bytes free\n scaleByDistance: 6,\n pixelOffsetScaleByDistance: 7,\n compressedAttribute3: 8,\n textureCoordinateBoundsOrLabelTranslate: 9,\n a_batchId: 10,\n sdf: 11,\n};\n\nconst attributeLocationsInstanced = {\n direction: 0,\n positionHighAndScale: 1,\n positionLowAndRotation: 2, // texture offset in w\n compressedAttribute0: 3,\n compressedAttribute1: 4,\n compressedAttribute2: 5,\n eyeOffset: 6, // texture range in w\n scaleByDistance: 7,\n pixelOffsetScaleByDistance: 8,\n compressedAttribute3: 9,\n textureCoordinateBoundsOrLabelTranslate: 10,\n a_batchId: 11,\n sdf: 12,\n};\n\n/**\n * A renderable collection of billboards. Billboards are viewport-aligned\n * images positioned in the 3D scene.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.png' width='400' height='300' /><br />\n * Example billboards\n * </div>\n * <br /><br />\n * Billboards are added and removed from the collection using {@link BillboardCollection#add}\n * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures\n * for images with the same identifier.\n *\n * @alias BillboardCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The billboard blending option. The default\n * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {Boolean} [options.show=true] Determines if the billboards in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many billboards, to\n * many collections with only a few billboards each. Organize collections so that billboards\n * with the same update frequency are in the same collection, i.e., billboards that do not\n * change should be in one collection; billboards that change every frame should be in another\n * collection; and so on.\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#remove\n * @see Billboard\n * @see LabelCollection\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Billboards.html|Cesium Sandcastle Billboard Demo}\n *\n * @example\n * // Create a billboard collection with two billboards\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n * billboards.add({\n * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n * image : 'url/to/image'\n * });\n * billboards.add({\n * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n * image : 'url/to/another/image'\n * });\n */\nfunction BillboardCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._scene = options.scene;\n this._batchTable = options.batchTable;\n\n this._textureAtlas = undefined;\n this._textureAtlasGUID = undefined;\n this._destroyTextureAtlas = true;\n this._sp = undefined;\n this._spTranslucent = undefined;\n this._rsOpaque = undefined;\n this._rsTranslucent = undefined;\n this._vaf = undefined;\n\n this._billboards = [];\n this._billboardsToUpdate = [];\n this._billboardsToUpdateIndex = 0;\n this._billboardsRemoved = false;\n this._createVertexArray = false;\n\n this._shaderRotation = false;\n this._compiledShaderRotation = false;\n\n this._shaderAlignedAxis = false;\n this._compiledShaderAlignedAxis = false;\n\n this._shaderScaleByDistance = false;\n this._compiledShaderScaleByDistance = false;\n\n this._shaderTranslucencyByDistance = false;\n this._compiledShaderTranslucencyByDistance = false;\n\n this._shaderPixelOffsetScaleByDistance = false;\n this._compiledShaderPixelOffsetScaleByDistance = false;\n\n this._shaderDistanceDisplayCondition = false;\n this._compiledShaderDistanceDisplayCondition = false;\n\n this._shaderDisableDepthDistance = false;\n this._compiledShaderDisableDepthDistance = false;\n\n this._shaderClampToGround = false;\n this._compiledShaderClampToGround = false;\n\n this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n this._maxSize = 0.0;\n this._maxEyeOffset = 0.0;\n this._maxScale = 1.0;\n this._maxPixelOffset = 0.0;\n this._allHorizontalCenter = true;\n this._allVerticalCenter = true;\n this._allSizedInMeters = true;\n\n this._baseVolume = new BoundingSphere();\n this._baseVolumeWC = new BoundingSphere();\n this._baseVolume2D = new BoundingSphere();\n this._boundingVolume = new BoundingSphere();\n this._boundingVolumeDirty = false;\n\n this._colorCommands = [];\n\n /**\n * Determines if billboards in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.\n * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type {Matrix4}\n * @default {@link Matrix4.IDENTITY}\n *\n *\n * @example\n * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n * billboards.add({\n * image : 'url/to/image',\n * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center\n * });\n * billboards.add({\n * image : 'url/to/image',\n * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east\n * });\n * billboards.add({\n * image : 'url/to/image',\n * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north\n * });\n * billboards.add({\n * image : 'url/to/image',\n * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up\n * });\n *\n * @see Transforms.eastNorthUpToFixedFrame\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the texture atlas for this BillboardCollection as a fullscreen quad.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowTextureAtlas = defaultValue(\n options.debugShowTextureAtlas,\n false\n );\n\n /**\n * The billboard blending option. The default is used for rendering both opaque and translucent billboards.\n * However, if either all of the billboards are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n * performance by up to 2x.\n * @type {BlendOption}\n * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n */\n this.blendOption = defaultValue(\n options.blendOption,\n BlendOption.OPAQUE_AND_TRANSLUCENT\n );\n this._blendOption = undefined;\n\n this._mode = SceneMode.SCENE3D;\n\n // The buffer usage for each attribute is determined based on the usage of the attribute over time.\n this._buffersUsage = [\n BufferUsage.STATIC_DRAW, // SHOW_INDEX\n BufferUsage.STATIC_DRAW, // POSITION_INDEX\n BufferUsage.STATIC_DRAW, // PIXEL_OFFSET_INDEX\n BufferUsage.STATIC_DRAW, // EYE_OFFSET_INDEX\n BufferUsage.STATIC_DRAW, // HORIZONTAL_ORIGIN_INDEX\n BufferUsage.STATIC_DRAW, // VERTICAL_ORIGIN_INDEX\n BufferUsage.STATIC_DRAW, // SCALE_INDEX\n BufferUsage.STATIC_DRAW, // IMAGE_INDEX_INDEX\n BufferUsage.STATIC_DRAW, // COLOR_INDEX\n BufferUsage.STATIC_DRAW, // ROTATION_INDEX\n BufferUsage.STATIC_DRAW, // ALIGNED_AXIS_INDEX\n BufferUsage.STATIC_DRAW, // SCALE_BY_DISTANCE_INDEX\n BufferUsage.STATIC_DRAW, // TRANSLUCENCY_BY_DISTANCE_INDEX\n BufferUsage.STATIC_DRAW, // PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX\n BufferUsage.STATIC_DRAW, // DISTANCE_DISPLAY_CONDITION_INDEX\n BufferUsage.STATIC_DRAW, // TEXTURE_COORDINATE_BOUNDS\n ];\n\n this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints\n\n const that = this;\n this._uniforms = {\n u_atlas: function () {\n return that._textureAtlas.texture;\n },\n u_highlightColor: function () {\n return that._highlightColor;\n },\n };\n\n const scene = this._scene;\n if (defined(scene) && defined(scene.terrainProviderChanged)) {\n this._removeCallbackFunc = scene.terrainProviderChanged.addEventListener(\n function () {\n const billboards = this._billboards;\n const length = billboards.length;\n for (let i = 0; i < length; ++i) {\n if (defined(billboards[i])) {\n billboards[i]._updateClamping();\n }\n }\n },\n this\n );\n }\n}\n\nObject.defineProperties(BillboardCollection.prototype, {\n /**\n * Returns the number of billboards in this collection. This is commonly used with\n * {@link BillboardCollection#get} to iterate over all the billboards\n * in the collection.\n * @memberof BillboardCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n removeBillboards(this);\n return this._billboards.length;\n },\n },\n\n /**\n * Gets or sets the textureAtlas.\n * @memberof BillboardCollection.prototype\n * @type {TextureAtlas}\n * @private\n */\n textureAtlas: {\n get: function () {\n return this._textureAtlas;\n },\n set: function (value) {\n if (this._textureAtlas !== value) {\n this._textureAtlas =\n this._destroyTextureAtlas &&\n this._textureAtlas &&\n this._textureAtlas.destroy();\n this._textureAtlas = value;\n this._createVertexArray = true; // New per-billboard texture coordinates\n }\n },\n },\n\n /**\n * Gets or sets a value which determines if the texture atlas is\n * destroyed when the collection is destroyed.\n *\n * If the texture atlas is used by more than one collection, set this to <code>false</code>,\n * and explicitly destroy the atlas to avoid attempting to destroy it multiple times.\n *\n * @memberof BillboardCollection.prototype\n * @type {Boolean}\n * @private\n *\n * @example\n * // Set destroyTextureAtlas\n * // Destroy a billboard collection but not its texture atlas.\n *\n * const atlas = new TextureAtlas({\n * scene : scene,\n * images : images\n * });\n * billboards.textureAtlas = atlas;\n * billboards.destroyTextureAtlas = false;\n * billboards = billboards.destroy();\n * console.log(atlas.isDestroyed()); // False\n */\n destroyTextureAtlas: {\n get: function () {\n return this._destroyTextureAtlas;\n },\n set: function (value) {\n this._destroyTextureAtlas = value;\n },\n },\n});\n\nfunction destroyBillboards(billboards) {\n const length = billboards.length;\n for (let i = 0; i < length; ++i) {\n if (billboards[i]) {\n billboards[i]._destroy();\n }\n }\n}\n\n/**\n * Creates and adds a billboard with the specified initial properties to the collection.\n * The added billboard is returned so it can be modified or removed from the collection later.\n *\n * @param {Object}[options] A template describing the billboard's properties as shown in Example 1.\n * @returns {Billboard} The billboard that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, add as many billboards as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1: Add a billboard, specifying all the default values.\n * const b = billboards.add({\n * show : true,\n * position : Cesium.Cartesian3.ZERO,\n * pixelOffset : Cesium.Cartesian2.ZERO,\n * eyeOffset : Cesium.Cartesian3.ZERO,\n * heightReference : Cesium.HeightReference.NONE,\n * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,\n * verticalOrigin : Cesium.VerticalOrigin.CENTER,\n * scale : 1.0,\n * image : 'url/to/image',\n * imageSubRegion : undefined,\n * color : Cesium.Color.WHITE,\n * id : undefined,\n * rotation : 0.0,\n * alignedAxis : Cesium.Cartesian3.ZERO,\n * width : undefined,\n * height : undefined,\n * scaleByDistance : undefined,\n * translucencyByDistance : undefined,\n * pixelOffsetScaleByDistance : undefined,\n * sizeInMeters : false,\n * distanceDisplayCondition : undefined\n * });\n *\n * @example\n * // Example 2: Specify only the billboard's cartographic position.\n * const b = billboards.add({\n * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see BillboardCollection#remove\n * @see BillboardCollection#removeAll\n */\nBillboardCollection.prototype.add = function (options) {\n const billboard = new Billboard(options, this);\n billboard._index = this._billboards.length;\n\n this._billboards.push(billboard);\n this._createVertexArray = true;\n\n return billboard;\n};\n\n/**\n * Removes a billboard from the collection.\n *\n * @param {Billboard} billboard The billboard to remove.\n * @returns {Boolean} <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, remove as many billboards as possible before calling <code>update</code>.\n * If you intend to temporarily hide a billboard, it is usually more efficient to call\n * {@link Billboard#show} instead of removing and re-adding the billboard.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const b = billboards.add(...);\n * billboards.remove(b); // Returns true\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#removeAll\n * @see Billboard#show\n */\nBillboardCollection.prototype.remove = function (billboard) {\n if (this.contains(billboard)) {\n this._billboards[billboard._index] = undefined; // Removed later\n this._billboardsRemoved = true;\n this._createVertexArray = true;\n billboard._destroy();\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all billboards from the collection.\n *\n * @performance <code>O(n)</code>. It is more efficient to remove all the billboards\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * billboards.add(...);\n * billboards.add(...);\n * billboards.removeAll();\n *\n * @see BillboardCollection#add\n * @see BillboardCollection#remove\n */\nBillboardCollection.prototype.removeAll = function () {\n destroyBillboards(this._billboards);\n this._billboards = [];\n this._billboardsToUpdate = [];\n this._billboardsToUpdateIndex = 0;\n this._billboardsRemoved = false;\n\n this._createVertexArray = true;\n};\n\nfunction removeBillboards(billboardCollection) {\n if (billboardCollection._billboardsRemoved) {\n billboardCollection._billboardsRemoved = false;\n\n const newBillboards = [];\n const billboards = billboardCollection._billboards;\n const length = billboards.length;\n for (let i = 0, j = 0; i < length; ++i) {\n const billboard = billboards[i];\n if (defined(billboard)) {\n billboard._index = j++;\n newBillboards.push(billboard);\n }\n }\n\n billboardCollection._billboards = newBillboards;\n }\n}\n\nBillboardCollection.prototype._updateBillboard = function (\n billboard,\n propertyChanged\n) {\n if (!billboard._dirty) {\n this._billboardsToUpdate[this._billboardsToUpdateIndex++] = billboard;\n }\n\n ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given billboard.\n *\n * @param {Billboard} [billboard] The billboard to check for.\n * @returns {Boolean} true if this collection contains the billboard, false otherwise.\n *\n * @see BillboardCollection#get\n */\nBillboardCollection.prototype.contains = function (billboard) {\n return defined(billboard) && billboard._billboardCollection === this;\n};\n\n/**\n * Returns the billboard in the collection at the specified index. Indices are zero-based\n * and increase as billboards are added. Removing a billboard shifts all billboards after\n * it to the left, changing their indices. This function is commonly used with\n * {@link BillboardCollection#length} to iterate over all the billboards\n * in the collection.\n *\n * @param {Number} index The zero-based index of the billboard.\n * @returns {Billboard} The billboard at the specified index.\n *\n * @performance Expected constant time. If billboards were removed from the collection and\n * {@link BillboardCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every billboard in the collection\n * const len = billboards.length;\n * for (let i = 0; i < len; ++i) {\n * const b = billboards.get(i);\n * b.show = !b.show;\n * }\n *\n * @see BillboardCollection#length\n */\nBillboardCollection.prototype.get = function (index) {\n removeBillboards(this);\n return this._billboards[index];\n};\n\nlet getIndexBuffer;\n\nfunction getIndexBufferBatched(context) {\n const sixteenK = 16 * 1024;\n\n let indexBuffer = context.cache.billboardCollection_indexBufferBatched;\n if (defined(indexBuffer)) {\n return indexBuffer;\n }\n\n // Subtract 6 because the last index is reserverd for primitive restart.\n // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.18\n const length = sixteenK * 6 - 6;\n const indices = new Uint16Array(length);\n for (let i = 0, j = 0; i < length; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n\n indices[i + 3] = j + 0;\n indices[i + 4] = j + 2;\n indices[i + 5] = j + 3;\n }\n\n // PERFORMANCE_IDEA: Should we reference count billboard collections, and eventually delete this?\n // Is this too much memory to allocate up front? Should we dynamically grow it?\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n indexBuffer.vertexArrayDestroyable = false;\n context.cache.billboardCollection_indexBufferBatched = indexBuffer;\n return indexBuffer;\n}\n\nfunction getIndexBufferInstanced(context) {\n let indexBuffer = context.cache.billboardCollection_indexBufferInstanced;\n if (defined(indexBuffer)) {\n return indexBuffer;\n }\n\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n indexBuffer.vertexArrayDestroyable = false;\n context.cache.billboardCollection_indexBufferInstanced = indexBuffer;\n return indexBuffer;\n}\n\nfunction getVertexBufferInstanced(context) {\n let vertexBuffer = context.cache.billboardCollection_vertexBufferInstanced;\n if (defined(vertexBuffer)) {\n return vertexBuffer;\n }\n\n vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: new Float32Array([0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]),\n usage: BufferUsage.STATIC_DRAW,\n });\n\n vertexBuffer.vertexArrayDestroyable = false;\n context.cache.billboardCollection_vertexBufferInstanced = vertexBuffer;\n return vertexBuffer;\n}\n\nBillboardCollection.prototype.computeNewBuffersUsage = function () {\n const buffersUsage = this._buffersUsage;\n let usageChanged = false;\n\n const properties = this._propertiesChanged;\n for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n const newUsage =\n properties[k] === 0 ? BufferUsage.STATIC_DRAW : BufferUsage.STREAM_DRAW;\n usageChanged = usageChanged || buffersUsage[k] !== newUsage;\n buffersUsage[k] = newUsage;\n }\n\n return usageChanged;\n};\n\nfunction createVAF(\n context,\n numberOfBillboards,\n buffersUsage,\n instanced,\n batchTable,\n sdf\n) {\n const attributes = [\n {\n index: attributeLocations.positionHighAndScale,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[POSITION_INDEX],\n },\n {\n index: attributeLocations.positionLowAndRotation,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[POSITION_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute0,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[PIXEL_OFFSET_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute1,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute2,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[COLOR_INDEX],\n },\n {\n index: attributeLocations.eyeOffset,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[EYE_OFFSET_INDEX],\n },\n {\n index: attributeLocations.scaleByDistance,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[SCALE_BY_DISTANCE_INDEX],\n },\n {\n index: attributeLocations.pixelOffsetScaleByDistance,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute3,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX],\n },\n {\n index: attributeLocations.textureCoordinateBoundsOrLabelTranslate,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[TEXTURE_COORDINATE_BOUNDS],\n },\n ];\n\n // Instancing requires one non-instanced attribute.\n if (instanced) {\n attributes.push({\n index: attributeLocations.direction,\n componentsPerAttribute: 2,\n componentDatatype: ComponentDatatype.FLOAT,\n vertexBuffer: getVertexBufferInstanced(context),\n });\n }\n\n if (defined(batchTable)) {\n attributes.push({\n index: attributeLocations.a_batchId,\n componentsPerAttribute: 1,\n componentDatatype: ComponentDatatype.FLOAT,\n bufferUsage: BufferUsage.STATIC_DRAW,\n });\n }\n\n if (sdf) {\n attributes.push({\n index: attributeLocations.sdf,\n componentsPerAttribute: 2,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[SDF_INDEX],\n });\n }\n\n // When instancing is enabled, only one vertex is needed for each billboard.\n const sizeInVertices = instanced\n ? numberOfBillboards\n : 4 * numberOfBillboards;\n return new VertexArrayFacade(context, attributes, sizeInVertices, instanced);\n}\n\n///////////////////////////////////////////////////////////////////////////\n\n// Four vertices per billboard. Each has the same position, etc., but a different screen-space direction vector.\n\n// PERFORMANCE_IDEA: Save memory if a property is the same for all billboards, use a latched attribute state,\n// instead of storing it in a vertex buffer.\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionScaleAndRotation(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const positionHighWriter =\n vafWriters[attributeLocations.positionHighAndScale];\n const positionLowWriter =\n vafWriters[attributeLocations.positionLowAndRotation];\n const position = billboard._getActualPosition();\n\n if (billboardCollection._mode === SceneMode.SCENE3D) {\n BoundingSphere.expand(\n billboardCollection._baseVolume,\n position,\n billboardCollection._baseVolume\n );\n billboardCollection._boundingVolumeDirty = true;\n }\n\n EncodedCartesian3.fromCartesian(position, writePositionScratch);\n const scale = billboard.scale;\n const rotation = billboard.rotation;\n\n if (rotation !== 0.0) {\n billboardCollection._shaderRotation = true;\n }\n\n billboardCollection._maxScale = Math.max(\n billboardCollection._maxScale,\n scale\n );\n\n const high = writePositionScratch.high;\n const low = writePositionScratch.low;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n positionHighWriter(i, high.x, high.y, high.z, scale);\n positionLowWriter(i, low.x, low.y, low.z, rotation);\n } else {\n i = billboard._index * 4;\n positionHighWriter(i + 0, high.x, high.y, high.z, scale);\n positionHighWriter(i + 1, high.x, high.y, high.z, scale);\n positionHighWriter(i + 2, high.x, high.y, high.z, scale);\n positionHighWriter(i + 3, high.x, high.y, high.z, scale);\n\n positionLowWriter(i + 0, low.x, low.y, low.z, rotation);\n positionLowWriter(i + 1, low.x, low.y, low.z, rotation);\n positionLowWriter(i + 2, low.x, low.y, low.z, rotation);\n positionLowWriter(i + 3, low.x, low.y, low.z, rotation);\n }\n}\n\nconst scratchCartesian2 = new Cartesian2();\n\nconst UPPER_BOUND = 32768.0; // 2^15\n\nconst LEFT_SHIFT16 = 65536.0; // 2^16\nconst LEFT_SHIFT12 = 4096.0; // 2^12\nconst LEFT_SHIFT8 = 256.0; // 2^8\nconst LEFT_SHIFT7 = 128.0;\nconst LEFT_SHIFT5 = 32.0;\nconst LEFT_SHIFT3 = 8.0;\nconst LEFT_SHIFT2 = 4.0;\n\nconst RIGHT_SHIFT8 = 1.0 / 256.0;\n\nconst LOWER_LEFT = 0.0;\nconst LOWER_RIGHT = 2.0;\nconst UPPER_RIGHT = 3.0;\nconst UPPER_LEFT = 1.0;\n\nfunction writeCompressedAttrib0(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.compressedAttribute0];\n const pixelOffset = billboard.pixelOffset;\n const pixelOffsetX = pixelOffset.x;\n const pixelOffsetY = pixelOffset.y;\n\n const translate = billboard._translate;\n const translateX = translate.x;\n const translateY = translate.y;\n\n billboardCollection._maxPixelOffset = Math.max(\n billboardCollection._maxPixelOffset,\n Math.abs(pixelOffsetX + translateX),\n Math.abs(-pixelOffsetY + translateY)\n );\n\n const horizontalOrigin = billboard.horizontalOrigin;\n let verticalOrigin = billboard._verticalOrigin;\n let show = billboard.show && billboard.clusterShow;\n\n // If the color alpha is zero, do not show this billboard. This lets us avoid providing\n // color during the pick pass and also eliminates a discard in the fragment shader.\n if (billboard.color.alpha === 0.0) {\n show = false;\n }\n\n // Raw billboards don't distinguish between BASELINE and BOTTOM, only LabelCollection does that.\n if (verticalOrigin === VerticalOrigin.BASELINE) {\n verticalOrigin = VerticalOrigin.BOTTOM;\n }\n\n billboardCollection._allHorizontalCenter =\n billboardCollection._allHorizontalCenter &&\n horizontalOrigin === HorizontalOrigin.CENTER;\n billboardCollection._allVerticalCenter =\n billboardCollection._allVerticalCenter &&\n verticalOrigin === VerticalOrigin.CENTER;\n\n let bottomLeftX = 0;\n let bottomLeftY = 0;\n let width = 0;\n let height = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n bottomLeftX = imageRectangle.x;\n bottomLeftY = imageRectangle.y;\n width = imageRectangle.width;\n height = imageRectangle.height;\n }\n const topRightX = bottomLeftX + width;\n const topRightY = bottomLeftY + height;\n\n let compressed0 =\n Math.floor(\n CesiumMath.clamp(pixelOffsetX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n ) * LEFT_SHIFT7;\n compressed0 += (horizontalOrigin + 1.0) * LEFT_SHIFT5;\n compressed0 += (verticalOrigin + 1.0) * LEFT_SHIFT3;\n compressed0 += (show ? 1.0 : 0.0) * LEFT_SHIFT2;\n\n let compressed1 =\n Math.floor(\n CesiumMath.clamp(pixelOffsetY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n ) * LEFT_SHIFT8;\n let compressed2 =\n Math.floor(\n CesiumMath.clamp(translateX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND\n ) * LEFT_SHIFT8;\n\n const tempTanslateY =\n (CesiumMath.clamp(translateY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND) *\n RIGHT_SHIFT8;\n const upperTranslateY = Math.floor(tempTanslateY);\n const lowerTranslateY = Math.floor(\n (tempTanslateY - upperTranslateY) * LEFT_SHIFT8\n );\n\n compressed1 += upperTranslateY;\n compressed2 += lowerTranslateY;\n\n scratchCartesian2.x = bottomLeftX;\n scratchCartesian2.y = bottomLeftY;\n const compressedTexCoordsLL = AttributeCompression.compressTextureCoordinates(\n scratchCartesian2\n );\n scratchCartesian2.x = topRightX;\n const compressedTexCoordsLR = AttributeCompression.compressTextureCoordinates(\n scratchCartesian2\n );\n scratchCartesian2.y = topRightY;\n const compressedTexCoordsUR = AttributeCompression.compressTextureCoordinates(\n scratchCartesian2\n );\n scratchCartesian2.x = bottomLeftX;\n const compressedTexCoordsUL = AttributeCompression.compressTextureCoordinates(\n scratchCartesian2\n );\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, compressed0, compressed1, compressed2, compressedTexCoordsLL);\n } else {\n i = billboard._index * 4;\n writer(\n i + 0,\n compressed0 + LOWER_LEFT,\n compressed1,\n compressed2,\n compressedTexCoordsLL\n );\n writer(\n i + 1,\n compressed0 + LOWER_RIGHT,\n compressed1,\n compressed2,\n compressedTexCoordsLR\n );\n writer(\n i + 2,\n compressed0 + UPPER_RIGHT,\n compressed1,\n compressed2,\n compressedTexCoordsUR\n );\n writer(\n i + 3,\n compressed0 + UPPER_LEFT,\n compressed1,\n compressed2,\n compressedTexCoordsUL\n );\n }\n}\n\nfunction writeCompressedAttrib1(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.compressedAttribute1];\n const alignedAxis = billboard.alignedAxis;\n if (!Cartesian3.equals(alignedAxis, Cartesian3.ZERO)) {\n billboardCollection._shaderAlignedAxis = true;\n }\n\n let near = 0.0;\n let nearValue = 1.0;\n let far = 1.0;\n let farValue = 1.0;\n\n const translucency = billboard.translucencyByDistance;\n if (defined(translucency)) {\n near = translucency.near;\n nearValue = translucency.nearValue;\n far = translucency.far;\n farValue = translucency.farValue;\n\n if (nearValue !== 1.0 || farValue !== 1.0) {\n // translucency by distance calculation in shader need not be enabled\n // until a billboard with near and far !== 1.0 is found\n billboardCollection._shaderTranslucencyByDistance = true;\n }\n }\n\n let width = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n width = imageRectangle.width;\n }\n\n const textureWidth = billboardCollection._textureAtlas.texture.width;\n const imageWidth = Math.round(\n defaultValue(billboard.width, textureWidth * width)\n );\n billboardCollection._maxSize = Math.max(\n billboardCollection._maxSize,\n imageWidth\n );\n\n let compressed0 = CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT16);\n let compressed1 = 0.0;\n\n if (\n Math.abs(Cartesian3.magnitudeSquared(alignedAxis) - 1.0) <\n CesiumMath.EPSILON6\n ) {\n compressed1 = AttributeCompression.octEncodeFloat(alignedAxis);\n }\n\n nearValue = CesiumMath.clamp(nearValue, 0.0, 1.0);\n nearValue = nearValue === 1.0 ? 255.0 : (nearValue * 255.0) | 0;\n compressed0 = compressed0 * LEFT_SHIFT8 + nearValue;\n\n farValue = CesiumMath.clamp(farValue, 0.0, 1.0);\n farValue = farValue === 1.0 ? 255.0 : (farValue * 255.0) | 0;\n compressed1 = compressed1 * LEFT_SHIFT8 + farValue;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, compressed0, compressed1, near, far);\n } else {\n i = billboard._index * 4;\n writer(i + 0, compressed0, compressed1, near, far);\n writer(i + 1, compressed0, compressed1, near, far);\n writer(i + 2, compressed0, compressed1, near, far);\n writer(i + 3, compressed0, compressed1, near, far);\n }\n}\n\nfunction writeCompressedAttrib2(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.compressedAttribute2];\n const color = billboard.color;\n const pickColor = !defined(billboardCollection._batchTable)\n ? billboard.getPickId(frameState.context).color\n : Color.WHITE;\n const sizeInMeters = billboard.sizeInMeters ? 1.0 : 0.0;\n const validAlignedAxis =\n Math.abs(Cartesian3.magnitudeSquared(billboard.alignedAxis) - 1.0) <\n CesiumMath.EPSILON6\n ? 1.0\n : 0.0;\n\n billboardCollection._allSizedInMeters =\n billboardCollection._allSizedInMeters && sizeInMeters === 1.0;\n\n let height = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n height = imageRectangle.height;\n }\n\n const dimensions = billboardCollection._textureAtlas.texture.dimensions;\n const imageHeight = Math.round(\n defaultValue(billboard.height, dimensions.y * height)\n );\n billboardCollection._maxSize = Math.max(\n billboardCollection._maxSize,\n imageHeight\n );\n let labelHorizontalOrigin = defaultValue(\n billboard._labelHorizontalOrigin,\n -2\n );\n labelHorizontalOrigin += 2;\n const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin;\n\n let red = Color.floatToByte(color.red);\n let green = Color.floatToByte(color.green);\n let blue = Color.floatToByte(color.blue);\n const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n red = Color.floatToByte(pickColor.red);\n green = Color.floatToByte(pickColor.green);\n blue = Color.floatToByte(pickColor.blue);\n const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n let compressed2 =\n Color.floatToByte(color.alpha) * LEFT_SHIFT16 +\n Color.floatToByte(pickColor.alpha) * LEFT_SHIFT8;\n compressed2 += sizeInMeters * 2.0 + validAlignedAxis;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, compressed0, compressed1, compressed2, compressed3);\n } else {\n i = billboard._index * 4;\n writer(i + 0, compressed0, compressed1, compressed2, compressed3);\n writer(i + 1, compressed0, compressed1, compressed2, compressed3);\n writer(i + 2, compressed0, compressed1, compressed2, compressed3);\n writer(i + 3, compressed0, compressed1, compressed2, compressed3);\n }\n}\n\nfunction writeEyeOffset(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.eyeOffset];\n const eyeOffset = billboard.eyeOffset;\n\n // For billboards that are clamped to ground, move it slightly closer to the camera\n let eyeOffsetZ = eyeOffset.z;\n if (billboard._heightReference !== HeightReference.NONE) {\n eyeOffsetZ *= 1.005;\n }\n billboardCollection._maxEyeOffset = Math.max(\n billboardCollection._maxEyeOffset,\n Math.abs(eyeOffset.x),\n Math.abs(eyeOffset.y),\n Math.abs(eyeOffsetZ)\n );\n\n if (billboardCollection._instanced) {\n let width = 0;\n let height = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n width = imageRectangle.width;\n height = imageRectangle.height;\n }\n\n scratchCartesian2.x = width;\n scratchCartesian2.y = height;\n const compressedTexCoordsRange = AttributeCompression.compressTextureCoordinates(\n scratchCartesian2\n );\n\n i = billboard._index;\n writer(i, eyeOffset.x, eyeOffset.y, eyeOffsetZ, compressedTexCoordsRange);\n } else {\n i = billboard._index * 4;\n writer(i + 0, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n writer(i + 1, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n writer(i + 2, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n writer(i + 3, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0.0);\n }\n}\n\nfunction writeScaleByDistance(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.scaleByDistance];\n let near = 0.0;\n let nearValue = 1.0;\n let far = 1.0;\n let farValue = 1.0;\n\n const scale = billboard.scaleByDistance;\n if (defined(scale)) {\n near = scale.near;\n nearValue = scale.nearValue;\n far = scale.far;\n farValue = scale.farValue;\n\n if (nearValue !== 1.0 || farValue !== 1.0) {\n // scale by distance calculation in shader need not be enabled\n // until a billboard with near and far !== 1.0 is found\n billboardCollection._shaderScaleByDistance = true;\n }\n }\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, near, nearValue, far, farValue);\n } else {\n i = billboard._index * 4;\n writer(i + 0, near, nearValue, far, farValue);\n writer(i + 1, near, nearValue, far, farValue);\n writer(i + 2, near, nearValue, far, farValue);\n writer(i + 3, near, nearValue, far, farValue);\n }\n}\n\nfunction writePixelOffsetScaleByDistance(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.pixelOffsetScaleByDistance];\n let near = 0.0;\n let nearValue = 1.0;\n let far = 1.0;\n let farValue = 1.0;\n\n const pixelOffsetScale = billboard.pixelOffsetScaleByDistance;\n if (defined(pixelOffsetScale)) {\n near = pixelOffsetScale.near;\n nearValue = pixelOffsetScale.nearValue;\n far = pixelOffsetScale.far;\n farValue = pixelOffsetScale.farValue;\n\n if (nearValue !== 1.0 || farValue !== 1.0) {\n // pixelOffsetScale by distance calculation in shader need not be enabled\n // until a billboard with near and far !== 1.0 is found\n billboardCollection._shaderPixelOffsetScaleByDistance = true;\n }\n }\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, near, nearValue, far, farValue);\n } else {\n i = billboard._index * 4;\n writer(i + 0, near, nearValue, far, farValue);\n writer(i + 1, near, nearValue, far, farValue);\n writer(i + 2, near, nearValue, far, farValue);\n writer(i + 3, near, nearValue, far, farValue);\n }\n}\n\nfunction writeCompressedAttribute3(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n let i;\n const writer = vafWriters[attributeLocations.compressedAttribute3];\n let near = 0.0;\n let far = Number.MAX_VALUE;\n\n const distanceDisplayCondition = billboard.distanceDisplayCondition;\n if (defined(distanceDisplayCondition)) {\n near = distanceDisplayCondition.near;\n far = distanceDisplayCondition.far;\n\n near *= near;\n far *= far;\n\n billboardCollection._shaderDistanceDisplayCondition = true;\n }\n\n let disableDepthTestDistance = billboard.disableDepthTestDistance;\n const clampToGround =\n billboard.heightReference === HeightReference.CLAMP_TO_GROUND &&\n frameState.context.depthTexture;\n if (!defined(disableDepthTestDistance)) {\n disableDepthTestDistance = clampToGround ? 5000.0 : 0.0;\n }\n\n disableDepthTestDistance *= disableDepthTestDistance;\n if (clampToGround || disableDepthTestDistance > 0.0) {\n billboardCollection._shaderDisableDepthDistance = true;\n if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {\n disableDepthTestDistance = -1.0;\n }\n }\n\n let imageHeight;\n let imageWidth;\n\n if (!defined(billboard._labelDimensions)) {\n let height = 0;\n let width = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n height = imageRectangle.height;\n width = imageRectangle.width;\n }\n\n imageHeight = Math.round(\n defaultValue(\n billboard.height,\n billboardCollection._textureAtlas.texture.dimensions.y * height\n )\n );\n\n const textureWidth = billboardCollection._textureAtlas.texture.width;\n imageWidth = Math.round(\n defaultValue(billboard.width, textureWidth * width)\n );\n } else {\n imageWidth = billboard._labelDimensions.x;\n imageHeight = billboard._labelDimensions.y;\n }\n\n const w = Math.floor(CesiumMath.clamp(imageWidth, 0.0, LEFT_SHIFT12));\n const h = Math.floor(CesiumMath.clamp(imageHeight, 0.0, LEFT_SHIFT12));\n const dimensions = w * LEFT_SHIFT12 + h;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, near, far, disableDepthTestDistance, dimensions);\n } else {\n i = billboard._index * 4;\n writer(i + 0, near, far, disableDepthTestDistance, dimensions);\n writer(i + 1, near, far, disableDepthTestDistance, dimensions);\n writer(i + 2, near, far, disableDepthTestDistance, dimensions);\n writer(i + 3, near, far, disableDepthTestDistance, dimensions);\n }\n}\n\nfunction writeTextureCoordinateBoundsOrLabelTranslate(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n if (billboard.heightReference === HeightReference.CLAMP_TO_GROUND) {\n const scene = billboardCollection._scene;\n const context = frameState.context;\n const globeTranslucent = frameState.globeTranslucencyState.translucent;\n const depthTestAgainstTerrain =\n defined(scene.globe) && scene.globe.depthTestAgainstTerrain;\n\n // Only do manual depth test if the globe is opaque and writes depth\n billboardCollection._shaderClampToGround =\n context.depthTexture && !globeTranslucent && depthTestAgainstTerrain;\n }\n let i;\n const writer =\n vafWriters[attributeLocations.textureCoordinateBoundsOrLabelTranslate];\n\n if (ContextLimits.maximumVertexTextureImageUnits > 0) {\n //write _labelTranslate, used by depth testing in the vertex shader\n let translateX = 0;\n let translateY = 0;\n if (defined(billboard._labelTranslate)) {\n translateX = billboard._labelTranslate.x;\n translateY = billboard._labelTranslate.y;\n }\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, translateX, translateY, 0.0, 0.0);\n } else {\n i = billboard._index * 4;\n writer(i + 0, translateX, translateY, 0.0, 0.0);\n writer(i + 1, translateX, translateY, 0.0, 0.0);\n writer(i + 2, translateX, translateY, 0.0, 0.0);\n writer(i + 3, translateX, translateY, 0.0, 0.0);\n }\n return;\n }\n\n //write texture coordinate bounds, used by depth testing in fragment shader\n let minX = 0;\n let minY = 0;\n let width = 0;\n let height = 0;\n const index = billboard._imageIndex;\n if (index !== -1) {\n const imageRectangle = textureAtlasCoordinates[index];\n\n minX = imageRectangle.x;\n minY = imageRectangle.y;\n width = imageRectangle.width;\n height = imageRectangle.height;\n }\n const maxX = minX + width;\n const maxY = minY + height;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, minX, minY, maxX, maxY);\n } else {\n i = billboard._index * 4;\n writer(i + 0, minX, minY, maxX, maxY);\n writer(i + 1, minX, minY, maxX, maxY);\n writer(i + 2, minX, minY, maxX, maxY);\n writer(i + 3, minX, minY, maxX, maxY);\n }\n}\n\nfunction writeBatchId(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n if (!defined(billboardCollection._batchTable)) {\n return;\n }\n\n const writer = vafWriters[attributeLocations.a_batchId];\n const id = billboard._batchIndex;\n\n let i;\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, id);\n } else {\n i = billboard._index * 4;\n writer(i + 0, id);\n writer(i + 1, id);\n writer(i + 2, id);\n writer(i + 3, id);\n }\n}\n\nfunction writeSDF(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n if (!billboardCollection._sdf) {\n return;\n }\n\n let i;\n const writer = vafWriters[attributeLocations.sdf];\n\n const outlineColor = billboard.outlineColor;\n const outlineWidth = billboard.outlineWidth;\n\n const red = Color.floatToByte(outlineColor.red);\n const green = Color.floatToByte(outlineColor.green);\n const blue = Color.floatToByte(outlineColor.blue);\n const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n // Compute the relative outline distance\n const outlineDistance = outlineWidth / SDFSettings.RADIUS;\n const compressed1 =\n Color.floatToByte(outlineColor.alpha) * LEFT_SHIFT16 +\n Color.floatToByte(outlineDistance) * LEFT_SHIFT8;\n\n if (billboardCollection._instanced) {\n i = billboard._index;\n writer(i, compressed0, compressed1);\n } else {\n i = billboard._index * 4;\n writer(i + 0, compressed0 + LOWER_LEFT, compressed1);\n writer(i + 1, compressed0 + LOWER_RIGHT, compressed1);\n writer(i + 2, compressed0 + UPPER_RIGHT, compressed1);\n writer(i + 3, compressed0 + UPPER_LEFT, compressed1);\n }\n}\n\nfunction writeBillboard(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n) {\n writePositionScaleAndRotation(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeCompressedAttrib0(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeCompressedAttrib1(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeCompressedAttrib2(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeEyeOffset(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeScaleByDistance(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writePixelOffsetScaleByDistance(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeCompressedAttribute3(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeTextureCoordinateBoundsOrLabelTranslate(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeBatchId(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n writeSDF(\n billboardCollection,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n}\n\nfunction recomputeActualPositions(\n billboardCollection,\n billboards,\n length,\n frameState,\n modelMatrix,\n recomputeBoundingVolume\n) {\n let boundingVolume;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingVolume = billboardCollection._baseVolume;\n billboardCollection._boundingVolumeDirty = true;\n } else {\n boundingVolume = billboardCollection._baseVolume2D;\n }\n\n const positions = [];\n for (let i = 0; i < length; ++i) {\n const billboard = billboards[i];\n const position = billboard.position;\n const actualPosition = Billboard._computeActualPosition(\n billboard,\n position,\n frameState,\n modelMatrix\n );\n if (defined(actualPosition)) {\n billboard._setActualPosition(actualPosition);\n\n if (recomputeBoundingVolume) {\n positions.push(actualPosition);\n } else {\n BoundingSphere.expand(boundingVolume, actualPosition, boundingVolume);\n }\n }\n }\n\n if (recomputeBoundingVolume) {\n BoundingSphere.fromPoints(positions, boundingVolume);\n }\n}\n\nfunction updateMode(billboardCollection, frameState) {\n const mode = frameState.mode;\n\n const billboards = billboardCollection._billboards;\n const billboardsToUpdate = billboardCollection._billboardsToUpdate;\n const modelMatrix = billboardCollection._modelMatrix;\n\n if (\n billboardCollection._createVertexArray ||\n billboardCollection._mode !== mode ||\n (mode !== SceneMode.SCENE3D &&\n !Matrix4.equals(modelMatrix, billboardCollection.modelMatrix))\n ) {\n billboardCollection._mode = mode;\n Matrix4.clone(billboardCollection.modelMatrix, modelMatrix);\n billboardCollection._createVertexArray = true;\n\n if (\n mode === SceneMode.SCENE3D ||\n mode === SceneMode.SCENE2D ||\n mode === SceneMode.COLUMBUS_VIEW\n ) {\n recomputeActualPositions(\n billboardCollection,\n billboards,\n billboards.length,\n frameState,\n modelMatrix,\n true\n );\n }\n } else if (mode === SceneMode.MORPHING) {\n recomputeActualPositions(\n billboardCollection,\n billboards,\n billboards.length,\n frameState,\n modelMatrix,\n true\n );\n } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) {\n recomputeActualPositions(\n billboardCollection,\n billboardsToUpdate,\n billboardCollection._billboardsToUpdateIndex,\n frameState,\n modelMatrix,\n false\n );\n }\n}\n\nfunction updateBoundingVolume(collection, frameState, boundingVolume) {\n let pixelScale = 1.0;\n if (!collection._allSizedInMeters || collection._maxPixelOffset !== 0.0) {\n pixelScale = frameState.camera.getPixelSize(\n boundingVolume,\n frameState.context.drawingBufferWidth,\n frameState.context.drawingBufferHeight\n );\n }\n\n let size = pixelScale * collection._maxScale * collection._maxSize * 2.0;\n if (collection._allHorizontalCenter && collection._allVerticalCenter) {\n size *= 0.5;\n }\n\n const offset =\n pixelScale * collection._maxPixelOffset + collection._maxEyeOffset;\n boundingVolume.radius += size + offset;\n}\n\nfunction createDebugCommand(billboardCollection, context) {\n const fs =\n \"uniform sampler2D billboard_texture; \\n\" +\n \"varying vec2 v_textureCoordinates; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \\n\" +\n \"} \\n\";\n\n const drawCommand = context.createViewportQuadCommand(fs, {\n uniformMap: {\n billboard_texture: function () {\n return billboardCollection._textureAtlas.texture;\n },\n },\n });\n drawCommand.pass = Pass.OVERLAY;\n return drawCommand;\n}\n\nconst scratchWriterArray = [];\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} image with id must be in the atlas.\n */\nBillboardCollection.prototype.update = function (frameState) {\n removeBillboards(this);\n\n if (!this.show) {\n return;\n }\n\n let billboards = this._billboards;\n let billboardsLength = billboards.length;\n\n const context = frameState.context;\n this._instanced = context.instancedArrays;\n attributeLocations = this._instanced\n ? attributeLocationsInstanced\n : attributeLocationsBatched;\n getIndexBuffer = this._instanced\n ? getIndexBufferInstanced\n : getIndexBufferBatched;\n\n let textureAtlas = this._textureAtlas;\n if (!defined(textureAtlas)) {\n textureAtlas = this._textureAtlas = new TextureAtlas({\n context: context,\n });\n\n for (let ii = 0; ii < billboardsLength; ++ii) {\n billboards[ii]._loadImage();\n }\n }\n\n const textureAtlasCoordinates = textureAtlas.textureCoordinates;\n if (textureAtlasCoordinates.length === 0) {\n // Can't write billboard vertices until we have texture coordinates\n // provided by a texture atlas\n return;\n }\n\n updateMode(this, frameState);\n\n billboards = this._billboards;\n billboardsLength = billboards.length;\n const billboardsToUpdate = this._billboardsToUpdate;\n const billboardsToUpdateLength = this._billboardsToUpdateIndex;\n\n const properties = this._propertiesChanged;\n\n const textureAtlasGUID = textureAtlas.guid;\n const createVertexArray =\n this._createVertexArray || this._textureAtlasGUID !== textureAtlasGUID;\n this._textureAtlasGUID = textureAtlasGUID;\n\n let vafWriters;\n const pass = frameState.passes;\n const picking = pass.pick;\n\n // PERFORMANCE_IDEA: Round robin multiple buffers.\n if (createVertexArray || (!picking && this.computeNewBuffersUsage())) {\n this._createVertexArray = false;\n\n for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n properties[k] = 0;\n }\n\n this._vaf = this._vaf && this._vaf.destroy();\n\n if (billboardsLength > 0) {\n // PERFORMANCE_IDEA: Instead of creating a new one, resize like std::vector.\n this._vaf = createVAF(\n context,\n billboardsLength,\n this._buffersUsage,\n this._instanced,\n this._batchTable,\n this._sdf\n );\n vafWriters = this._vaf.writers;\n\n // Rewrite entire buffer if billboards were added or removed.\n for (let i = 0; i < billboardsLength; ++i) {\n const billboard = this._billboards[i];\n billboard._dirty = false; // In case it needed an update.\n writeBillboard(\n this,\n frameState,\n textureAtlasCoordinates,\n vafWriters,\n billboard\n );\n }\n\n // Different billboard collections share the same index buffer.\n this._vaf.commit(getIndexBuffer(context));\n }\n\n this._billboardsToUpdateIndex = 0;\n } else if (billboardsToUpdateLength > 0) {\n // Billboards were modified, but none were added or removed.\n const writers = scratchWriterArray;\n writers.length = 0;\n\n if (\n properties[POSITION_INDEX] ||\n properties[ROTATION_INDEX] ||\n properties[SCALE_INDEX]\n ) {\n writers.push(writePositionScaleAndRotation);\n }\n\n if (\n properties[IMAGE_INDEX_INDEX] ||\n properties[PIXEL_OFFSET_INDEX] ||\n properties[HORIZONTAL_ORIGIN_INDEX] ||\n properties[VERTICAL_ORIGIN_INDEX] ||\n properties[SHOW_INDEX]\n ) {\n writers.push(writeCompressedAttrib0);\n if (this._instanced) {\n writers.push(writeEyeOffset);\n }\n }\n\n if (\n properties[IMAGE_INDEX_INDEX] ||\n properties[ALIGNED_AXIS_INDEX] ||\n properties[TRANSLUCENCY_BY_DISTANCE_INDEX]\n ) {\n writers.push(writeCompressedAttrib1);\n writers.push(writeCompressedAttrib2);\n }\n\n if (properties[IMAGE_INDEX_INDEX] || properties[COLOR_INDEX]) {\n writers.push(writeCompressedAttrib2);\n }\n\n if (properties[EYE_OFFSET_INDEX]) {\n writers.push(writeEyeOffset);\n }\n\n if (properties[SCALE_BY_DISTANCE_INDEX]) {\n writers.push(writeScaleByDistance);\n }\n\n if (properties[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX]) {\n writers.push(writePixelOffsetScaleByDistance);\n }\n\n if (\n properties[DISTANCE_DISPLAY_CONDITION_INDEX] ||\n properties[DISABLE_DEPTH_DISTANCE] ||\n properties[IMAGE_INDEX_INDEX] ||\n properties[POSITION_INDEX]\n ) {\n writers.push(writeCompressedAttribute3);\n }\n\n if (properties[IMAGE_INDEX_INDEX] || properties[POSITION_INDEX]) {\n writers.push(writeTextureCoordinateBoundsOrLabelTranslate);\n }\n\n if (properties[SDF_INDEX]) {\n writers.push(writeSDF);\n }\n\n const numWriters = writers.length;\n vafWriters = this._vaf.writers;\n\n if (billboardsToUpdateLength / billboardsLength > 0.1) {\n // If more than 10% of billboard change, rewrite the entire buffer.\n\n // PERFORMANCE_IDEA: I totally made up 10% :).\n\n for (let m = 0; m < billboardsToUpdateLength; ++m) {\n const b = billboardsToUpdate[m];\n b._dirty = false;\n\n for (let n = 0; n < numWriters; ++n) {\n writers[n](this, frameState, textureAtlasCoordinates, vafWriters, b);\n }\n }\n this._vaf.commit(getIndexBuffer(context));\n } else {\n for (let h = 0; h < billboardsToUpdateLength; ++h) {\n const bb = billboardsToUpdate[h];\n bb._dirty = false;\n\n for (let o = 0; o < numWriters; ++o) {\n writers[o](this, frameState, textureAtlasCoordinates, vafWriters, bb);\n }\n\n if (this._instanced) {\n this._vaf.subCommit(bb._index, 1);\n } else {\n this._vaf.subCommit(bb._index * 4, 4);\n }\n }\n this._vaf.endSubCommits();\n }\n\n this._billboardsToUpdateIndex = 0;\n }\n\n // If the number of total billboards ever shrinks considerably\n // Truncate billboardsToUpdate so that we free memory that we're\n // not going to be using.\n if (billboardsToUpdateLength > billboardsLength * 1.5) {\n billboardsToUpdate.length = billboardsLength;\n }\n\n if (!defined(this._vaf) || !defined(this._vaf.va)) {\n return;\n }\n\n if (this._boundingVolumeDirty) {\n this._boundingVolumeDirty = false;\n BoundingSphere.transform(\n this._baseVolume,\n this.modelMatrix,\n this._baseVolumeWC\n );\n }\n\n let boundingVolume;\n let modelMatrix = Matrix4.IDENTITY;\n if (frameState.mode === SceneMode.SCENE3D) {\n modelMatrix = this.modelMatrix;\n boundingVolume = BoundingSphere.clone(\n this._baseVolumeWC,\n this._boundingVolume\n );\n } else {\n boundingVolume = BoundingSphere.clone(\n this._baseVolume2D,\n this._boundingVolume\n );\n }\n updateBoundingVolume(this, frameState, boundingVolume);\n\n const blendOptionChanged = this._blendOption !== this.blendOption;\n this._blendOption = this.blendOption;\n\n if (blendOptionChanged) {\n if (\n this._blendOption === BlendOption.OPAQUE ||\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n ) {\n this._rsOpaque = RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: WebGLConstants.LESS,\n },\n depthMask: true,\n });\n } else {\n this._rsOpaque = undefined;\n }\n\n // If OPAQUE_AND_TRANSLUCENT is in use, only the opaque pass gets the benefit of the depth buffer,\n // not the translucent pass. Otherwise, if the TRANSLUCENT pass is on its own, it turns on\n // a depthMask in lieu of full depth sorting (because it has opaque-ish fragments that look bad in OIT).\n // When the TRANSLUCENT depth mask is in use, label backgrounds require the depth func to be LEQUAL.\n const useTranslucentDepthMask =\n this._blendOption === BlendOption.TRANSLUCENT;\n\n if (\n this._blendOption === BlendOption.TRANSLUCENT ||\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n ) {\n this._rsTranslucent = RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: useTranslucentDepthMask\n ? WebGLConstants.LEQUAL\n : WebGLConstants.LESS,\n },\n depthMask: useTranslucentDepthMask,\n blending: BlendingState.ALPHA_BLEND,\n });\n } else {\n this._rsTranslucent = undefined;\n }\n }\n\n this._shaderDisableDepthDistance =\n this._shaderDisableDepthDistance ||\n frameState.minimumDisableDepthTestDistance !== 0.0;\n\n let vsSource;\n let fsSource;\n let vs;\n let fs;\n let vertDefines;\n\n const supportVSTextureReads =\n ContextLimits.maximumVertexTextureImageUnits > 0;\n\n if (\n blendOptionChanged ||\n this._shaderRotation !== this._compiledShaderRotation ||\n this._shaderAlignedAxis !== this._compiledShaderAlignedAxis ||\n this._shaderScaleByDistance !== this._compiledShaderScaleByDistance ||\n this._shaderTranslucencyByDistance !==\n this._compiledShaderTranslucencyByDistance ||\n this._shaderPixelOffsetScaleByDistance !==\n this._compiledShaderPixelOffsetScaleByDistance ||\n this._shaderDistanceDisplayCondition !==\n this._compiledShaderDistanceDisplayCondition ||\n this._shaderDisableDepthDistance !==\n this._compiledShaderDisableDepthDistance ||\n this._shaderClampToGround !== this._compiledShaderClampToGround ||\n this._sdf !== this._compiledSDF\n ) {\n vsSource = BillboardCollectionVS;\n fsSource = BillboardCollectionFS;\n\n vertDefines = [];\n if (defined(this._batchTable)) {\n vertDefines.push(\"VECTOR_TILE\");\n vsSource = this._batchTable.getVertexShaderCallback(\n false,\n \"a_batchId\",\n undefined\n )(vsSource);\n fsSource = this._batchTable.getFragmentShaderCallback(\n false,\n undefined\n )(fsSource);\n }\n\n vs = new ShaderSource({\n defines: vertDefines,\n sources: [vsSource],\n });\n if (this._instanced) {\n vs.defines.push(\"INSTANCED\");\n }\n if (this._shaderRotation) {\n vs.defines.push(\"ROTATION\");\n }\n if (this._shaderAlignedAxis) {\n vs.defines.push(\"ALIGNED_AXIS\");\n }\n if (this._shaderScaleByDistance) {\n vs.defines.push(\"EYE_DISTANCE_SCALING\");\n }\n if (this._shaderTranslucencyByDistance) {\n vs.defines.push(\"EYE_DISTANCE_TRANSLUCENCY\");\n }\n if (this._shaderPixelOffsetScaleByDistance) {\n vs.defines.push(\"EYE_DISTANCE_PIXEL_OFFSET\");\n }\n if (this._shaderDistanceDisplayCondition) {\n vs.defines.push(\"DISTANCE_DISPLAY_CONDITION\");\n }\n if (this._shaderDisableDepthDistance) {\n vs.defines.push(\"DISABLE_DEPTH_DISTANCE\");\n }\n if (this._shaderClampToGround) {\n if (supportVSTextureReads) {\n vs.defines.push(\"VERTEX_DEPTH_CHECK\");\n } else {\n vs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n }\n }\n\n const sdfEdge = 1.0 - SDFSettings.CUTOFF;\n\n if (this._sdf) {\n vs.defines.push(\"SDF\");\n }\n\n const vectorFragDefine = defined(this._batchTable) ? \"VECTOR_TILE\" : \"\";\n\n if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) {\n fs = new ShaderSource({\n defines: [\"OPAQUE\", vectorFragDefine],\n sources: [fsSource],\n });\n if (this._shaderClampToGround) {\n if (supportVSTextureReads) {\n fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n } else {\n fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n }\n }\n\n if (this._sdf) {\n fs.defines.push(\"SDF\");\n fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n }\n\n this._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n fs = new ShaderSource({\n defines: [\"TRANSLUCENT\", vectorFragDefine],\n sources: [fsSource],\n });\n if (this._shaderClampToGround) {\n if (supportVSTextureReads) {\n fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n } else {\n fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n }\n }\n if (this._sdf) {\n fs.defines.push(\"SDF\");\n fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n }\n this._spTranslucent = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._spTranslucent,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n if (this._blendOption === BlendOption.OPAQUE) {\n fs = new ShaderSource({\n defines: [vectorFragDefine],\n sources: [fsSource],\n });\n if (this._shaderClampToGround) {\n if (supportVSTextureReads) {\n fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n } else {\n fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n }\n }\n if (this._sdf) {\n fs.defines.push(\"SDF\");\n fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n }\n this._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n if (this._blendOption === BlendOption.TRANSLUCENT) {\n fs = new ShaderSource({\n defines: [vectorFragDefine],\n sources: [fsSource],\n });\n if (this._shaderClampToGround) {\n if (supportVSTextureReads) {\n fs.defines.push(\"VERTEX_DEPTH_CHECK\");\n } else {\n fs.defines.push(\"FRAGMENT_DEPTH_CHECK\");\n }\n }\n if (this._sdf) {\n fs.defines.push(\"SDF\");\n fs.defines.push(`SDF_EDGE ${sdfEdge}`);\n }\n this._spTranslucent = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._spTranslucent,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n this._compiledShaderRotation = this._shaderRotation;\n this._compiledShaderAlignedAxis = this._shaderAlignedAxis;\n this._compiledShaderScaleByDistance = this._shaderScaleByDistance;\n this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;\n this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance;\n this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;\n this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;\n this._compiledShaderClampToGround = this._shaderClampToGround;\n this._compiledSDF = this._sdf;\n }\n\n const commandList = frameState.commandList;\n\n if (pass.render || pass.pick) {\n const colorList = this._colorCommands;\n\n const opaque = this._blendOption === BlendOption.OPAQUE;\n const opaqueAndTranslucent =\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT;\n\n const va = this._vaf.va;\n const vaLength = va.length;\n\n let uniforms = this._uniforms;\n let pickId;\n if (defined(this._batchTable)) {\n uniforms = this._batchTable.getUniformMapCallback()(uniforms);\n pickId = this._batchTable.getPickId();\n } else {\n pickId = \"v_pickColor\";\n }\n\n colorList.length = vaLength;\n const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;\n for (let j = 0; j < totalLength; ++j) {\n let command = colorList[j];\n if (!defined(command)) {\n command = colorList[j] = new DrawCommand();\n }\n\n const opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0);\n\n command.pass =\n opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT;\n command.owner = this;\n\n const index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j;\n command.boundingVolume = boundingVolume;\n command.modelMatrix = modelMatrix;\n command.count = va[index].indicesCount;\n command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;\n command.uniformMap = uniforms;\n command.vertexArray = va[index].va;\n command.renderState = opaqueCommand\n ? this._rsOpaque\n : this._rsTranslucent;\n command.debugShowBoundingVolume = this.debugShowBoundingVolume;\n command.pickId = pickId;\n\n if (this._instanced) {\n command.count = 6;\n command.instanceCount = billboardsLength;\n }\n\n commandList.push(command);\n }\n\n if (this.debugShowTextureAtlas) {\n if (!defined(this.debugCommand)) {\n this.debugCommand = createDebugCommand(this, frameState.context);\n }\n\n commandList.push(this.debugCommand);\n }\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see BillboardCollection#destroy\n */\nBillboardCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * billboards = billboards && billboards.destroy();\n *\n * @see BillboardCollection#isDestroyed\n */\nBillboardCollection.prototype.destroy = function () {\n if (defined(this._removeCallbackFunc)) {\n this._removeCallbackFunc();\n this._removeCallbackFunc = undefined;\n }\n\n this._textureAtlas =\n this._destroyTextureAtlas &&\n this._textureAtlas &&\n this._textureAtlas.destroy();\n this._sp = this._sp && this._sp.destroy();\n this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();\n this._vaf = this._vaf && this._vaf.destroy();\n destroyBillboards(this._billboards);\n\n return destroyObject(this);\n};\nexport default BillboardCollection;\n", "/**\n * Creates a {@link createBillboardPointCallback.CanvasFunction} that will create a canvas with a point.\n *\n * @param {Number} centerAlpha The alpha of the center of the point. The value must be in the range [0.0, 1.0].\n * @param {String} cssColor The CSS color string.\n * @param {String} cssOutlineColor The CSS color of the point outline.\n * @param {Number} cssOutlineWidth The width of the outline in pixels.\n * @param {Number} pixelSize The size of the point in pixels.\n * @return {createBillboardPointCallback.CanvasFunction} The function that will return a canvas with the point drawn on it.\n *\n * @private\n */\nfunction createBillboardPointCallback(\n centerAlpha,\n cssColor,\n cssOutlineColor,\n cssOutlineWidth,\n pixelSize\n) {\n return function () {\n const canvas = document.createElement(\"canvas\");\n\n const length = pixelSize + 2 * cssOutlineWidth;\n canvas.height = canvas.width = length;\n\n const context2D = canvas.getContext(\"2d\");\n context2D.clearRect(0, 0, length, length);\n\n if (cssOutlineWidth !== 0) {\n context2D.beginPath();\n context2D.arc(length / 2, length / 2, length / 2, 0, 2 * Math.PI, true);\n context2D.closePath();\n context2D.fillStyle = cssOutlineColor;\n context2D.fill();\n // Punch a hole in the center if needed.\n if (centerAlpha < 1.0) {\n context2D.save();\n context2D.globalCompositeOperation = \"destination-out\";\n context2D.beginPath();\n context2D.arc(\n length / 2,\n length / 2,\n pixelSize / 2,\n 0,\n 2 * Math.PI,\n true\n );\n context2D.closePath();\n context2D.fillStyle = \"black\";\n context2D.fill();\n context2D.restore();\n }\n }\n\n context2D.beginPath();\n context2D.arc(length / 2, length / 2, pixelSize / 2, 0, 2 * Math.PI, true);\n context2D.closePath();\n context2D.fillStyle = cssColor;\n context2D.fill();\n\n return canvas;\n };\n}\n\n/**\n * A function that returns a canvas containing an image of a point.\n * @callback createBillboardPointCallback.CanvasFunction\n * @returns {HTMLCanvasElement} The result of the calculation.\n */\nexport default createBillboardPointCallback;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport createBillboardPointCallback from \"./createBillboardPointCallback.js\";\n\n/**\n * A point feature of a {@link Cesium3DTileset}.\n * <p>\n * Provides access to a feature's properties stored in the tile's batch table, as well\n * as the ability to show/hide a feature and change its point properties\n * </p>\n * <p>\n * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's\n * content. If the tile's content is unloaded, e.g., due to it going out of view and needing\n * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any\n * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.\n * </p>\n * <p>\n * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}\n * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.\n * </p>\n *\n * @alias Cesium3DTilePointFeature\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * // On mouse over, display all the properties for a feature in the console log.\n * handler.setInputAction(function(movement) {\n * const feature = scene.pick(movement.endPosition);\n * if (feature instanceof Cesium.Cesium3DTilePointFeature) {\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n * const propertyId = propertyIds[i];\n * console.log(`{propertyId}: ${feature.getProperty(propertyId)}`);\n * }\n * }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nfunction Cesium3DTilePointFeature(\n content,\n batchId,\n billboard,\n label,\n polyline\n) {\n this._content = content;\n this._billboard = billboard;\n this._label = label;\n this._polyline = polyline;\n\n this._batchId = batchId;\n this._billboardImage = undefined;\n this._billboardColor = undefined;\n this._billboardOutlineColor = undefined;\n this._billboardOutlineWidth = undefined;\n this._billboardSize = undefined;\n this._pointSize = undefined;\n this._color = undefined;\n this._pointSize = undefined;\n this._pointOutlineColor = undefined;\n this._pointOutlineWidth = undefined;\n this._heightOffset = undefined;\n\n this._pickIds = new Array(3);\n\n setBillboardImage(this);\n}\n\nconst scratchCartographic = new Cartographic();\n\nObject.defineProperties(Cesium3DTilePointFeature.prototype, {\n /**\n * Gets or sets if the feature will be shown. This is set for all features\n * when a style's show is evaluated.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Boolean}\n *\n * @default true\n */\n show: {\n get: function () {\n return this._label.show;\n },\n set: function (value) {\n this._label.show = value;\n this._billboard.show = value;\n this._polyline.show = value;\n },\n },\n\n /**\n * Gets or sets the color of the point of this feature.\n * <p>\n * Only applied when <code>image</code> is <code>undefined</code>.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n this._color = Color.clone(value, this._color);\n setBillboardImage(this);\n },\n },\n\n /**\n * Gets or sets the point size of this feature.\n * <p>\n * Only applied when <code>image</code> is <code>undefined</code>.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Number}\n */\n pointSize: {\n get: function () {\n return this._pointSize;\n },\n set: function (value) {\n this._pointSize = value;\n setBillboardImage(this);\n },\n },\n\n /**\n * Gets or sets the point outline color of this feature.\n * <p>\n * Only applied when <code>image</code> is <code>undefined</code>.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n pointOutlineColor: {\n get: function () {\n return this._pointOutlineColor;\n },\n set: function (value) {\n this._pointOutlineColor = Color.clone(value, this._pointOutlineColor);\n setBillboardImage(this);\n },\n },\n\n /**\n * Gets or sets the point outline width in pixels of this feature.\n * <p>\n * Only applied when <code>image</code> is <code>undefined</code>.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Number}\n */\n pointOutlineWidth: {\n get: function () {\n return this._pointOutlineWidth;\n },\n set: function (value) {\n this._pointOutlineWidth = value;\n setBillboardImage(this);\n },\n },\n\n /**\n * Gets or sets the label color of this feature.\n * <p>\n * The color will be applied to the label if <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n labelColor: {\n get: function () {\n return this._label.fillColor;\n },\n set: function (value) {\n this._label.fillColor = value;\n this._polyline.show = this._label.show && value.alpha > 0.0;\n },\n },\n\n /**\n * Gets or sets the label outline color of this feature.\n * <p>\n * The outline color will be applied to the label if <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n labelOutlineColor: {\n get: function () {\n return this._label.outlineColor;\n },\n set: function (value) {\n this._label.outlineColor = value;\n },\n },\n\n /**\n * Gets or sets the outline width in pixels of this feature.\n * <p>\n * The outline width will be applied to the point if <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Number}\n */\n labelOutlineWidth: {\n get: function () {\n return this._label.outlineWidth;\n },\n set: function (value) {\n this._label.outlineWidth = value;\n },\n },\n\n /**\n * Gets or sets the font of this feature.\n * <p>\n * Only applied when the <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {String}\n */\n font: {\n get: function () {\n return this._label.font;\n },\n set: function (value) {\n this._label.font = value;\n },\n },\n\n /**\n * Gets or sets the fill and outline style of this feature.\n * <p>\n * Only applied when <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {LabelStyle}\n */\n labelStyle: {\n get: function () {\n return this._label.style;\n },\n set: function (value) {\n this._label.style = value;\n },\n },\n\n /**\n * Gets or sets the text for this feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {String}\n */\n labelText: {\n get: function () {\n return this._label.text;\n },\n set: function (value) {\n if (!defined(value)) {\n value = \"\";\n }\n this._label.text = value;\n },\n },\n\n /**\n * Gets or sets the background color of the text for this feature.\n * <p>\n * Only applied when <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n backgroundColor: {\n get: function () {\n return this._label.backgroundColor;\n },\n set: function (value) {\n this._label.backgroundColor = value;\n },\n },\n\n /**\n * Gets or sets the background padding of the text for this feature.\n * <p>\n * Only applied when <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Cartesian2}\n */\n backgroundPadding: {\n get: function () {\n return this._label.backgroundPadding;\n },\n set: function (value) {\n this._label.backgroundPadding = value;\n },\n },\n\n /**\n * Gets or sets whether to display the background of the text for this feature.\n * <p>\n * Only applied when <code>labelText</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Boolean}\n */\n backgroundEnabled: {\n get: function () {\n return this._label.showBackground;\n },\n set: function (value) {\n this._label.showBackground = value;\n },\n },\n\n /**\n * Gets or sets the near and far scaling properties for this feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {NearFarScalar}\n */\n scaleByDistance: {\n get: function () {\n return this._label.scaleByDistance;\n },\n set: function (value) {\n this._label.scaleByDistance = value;\n this._billboard.scaleByDistance = value;\n },\n },\n\n /**\n * Gets or sets the near and far translucency properties for this feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {NearFarScalar}\n */\n translucencyByDistance: {\n get: function () {\n return this._label.translucencyByDistance;\n },\n set: function (value) {\n this._label.translucencyByDistance = value;\n this._billboard.translucencyByDistance = value;\n },\n },\n\n /**\n * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {DistanceDisplayCondition}\n */\n distanceDisplayCondition: {\n get: function () {\n return this._label.distanceDisplayCondition;\n },\n set: function (value) {\n this._label.distanceDisplayCondition = value;\n this._polyline.distanceDisplayCondition = value;\n this._billboard.distanceDisplayCondition = value;\n },\n },\n\n /**\n * Gets or sets the height offset in meters of this feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Number}\n */\n heightOffset: {\n get: function () {\n return this._heightOffset;\n },\n set: function (value) {\n const offset = defaultValue(this._heightOffset, 0.0);\n\n const ellipsoid = this._content.tileset.ellipsoid;\n const cart = ellipsoid.cartesianToCartographic(\n this._billboard.position,\n scratchCartographic\n );\n cart.height = cart.height - offset + value;\n const newPosition = ellipsoid.cartographicToCartesian(cart);\n\n this._billboard.position = newPosition;\n this._label.position = this._billboard.position;\n this._polyline.positions = [this._polyline.positions[0], newPosition];\n\n this._heightOffset = value;\n },\n },\n\n /**\n * Gets or sets whether the anchor line is displayed.\n * <p>\n * Only applied when <code>heightOffset</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Boolean}\n */\n anchorLineEnabled: {\n get: function () {\n return this._polyline.show;\n },\n set: function (value) {\n this._polyline.show = value;\n },\n },\n\n /**\n * Gets or sets the color for the anchor line.\n * <p>\n * Only applied when <code>heightOffset</code> is defined.\n * </p>\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Color}\n */\n anchorLineColor: {\n get: function () {\n return this._polyline.material.uniforms.color;\n },\n set: function (value) {\n this._polyline.material.uniforms.color = Color.clone(\n value,\n this._polyline.material.uniforms.color\n );\n },\n },\n\n /**\n * Gets or sets the image of this feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {String}\n */\n image: {\n get: function () {\n return this._billboardImage;\n },\n set: function (value) {\n const imageChanged = this._billboardImage !== value;\n this._billboardImage = value;\n if (imageChanged) {\n setBillboardImage(this);\n }\n },\n },\n\n /**\n * Gets or sets the distance where depth testing will be disabled.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Number}\n */\n disableDepthTestDistance: {\n get: function () {\n return this._label.disableDepthTestDistance;\n },\n set: function (value) {\n this._label.disableDepthTestDistance = value;\n this._billboard.disableDepthTestDistance = value;\n },\n },\n\n /**\n * Gets or sets the horizontal origin of this point, which determines if the point is\n * to the left, center, or right of its anchor position.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {HorizontalOrigin}\n */\n horizontalOrigin: {\n get: function () {\n return this._billboard.horizontalOrigin;\n },\n set: function (value) {\n this._billboard.horizontalOrigin = value;\n },\n },\n\n /**\n * Gets or sets the vertical origin of this point, which determines if the point is\n * to the bottom, center, or top of its anchor position.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {VerticalOrigin}\n */\n verticalOrigin: {\n get: function () {\n return this._billboard.verticalOrigin;\n },\n set: function (value) {\n this._billboard.verticalOrigin = value;\n },\n },\n\n /**\n * Gets or sets the horizontal origin of this point's text, which determines if the point's text is\n * to the left, center, or right of its anchor position.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {HorizontalOrigin}\n */\n labelHorizontalOrigin: {\n get: function () {\n return this._label.horizontalOrigin;\n },\n set: function (value) {\n this._label.horizontalOrigin = value;\n },\n },\n\n /**\n * Get or sets the vertical origin of this point's text, which determines if the point's text is\n * to the bottom, center, top, or baseline of it's anchor point.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {VerticalOrigin}\n */\n labelVerticalOrigin: {\n get: function () {\n return this._label.verticalOrigin;\n },\n set: function (value) {\n this._label.verticalOrigin = value;\n },\n },\n\n /**\n * Gets the content of the tile containing the feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Cesium3DTileContent}\n *\n * @readonly\n * @private\n */\n content: {\n get: function () {\n return this._content;\n },\n },\n\n /**\n * Gets the tileset containing the feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Cesium3DTileset}\n *\n * @readonly\n */\n tileset: {\n get: function () {\n return this._content.tileset;\n },\n },\n\n /**\n * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns\n * the tileset containing the feature.\n *\n * @memberof Cesium3DTilePointFeature.prototype\n *\n * @type {Cesium3DTileset}\n *\n * @readonly\n */\n primitive: {\n get: function () {\n return this._content.tileset;\n },\n },\n\n /**\n * @private\n */\n pickIds: {\n get: function () {\n const ids = this._pickIds;\n ids[0] = this._billboard.pickId;\n ids[1] = this._label.pickId;\n ids[2] = this._polyline.pickId;\n return ids;\n },\n },\n});\n\nCesium3DTilePointFeature.defaultColor = Color.WHITE;\nCesium3DTilePointFeature.defaultPointOutlineColor = Color.BLACK;\nCesium3DTilePointFeature.defaultPointOutlineWidth = 0.0;\nCesium3DTilePointFeature.defaultPointSize = 8.0;\n\nfunction setBillboardImage(feature) {\n const b = feature._billboard;\n if (defined(feature._billboardImage) && feature._billboardImage !== b.image) {\n b.image = feature._billboardImage;\n return;\n }\n\n if (defined(feature._billboardImage)) {\n return;\n }\n\n const newColor = defaultValue(\n feature._color,\n Cesium3DTilePointFeature.defaultColor\n );\n const newOutlineColor = defaultValue(\n feature._pointOutlineColor,\n Cesium3DTilePointFeature.defaultPointOutlineColor\n );\n const newOutlineWidth = defaultValue(\n feature._pointOutlineWidth,\n Cesium3DTilePointFeature.defaultPointOutlineWidth\n );\n const newPointSize = defaultValue(\n feature._pointSize,\n Cesium3DTilePointFeature.defaultPointSize\n );\n\n const currentColor = feature._billboardColor;\n const currentOutlineColor = feature._billboardOutlineColor;\n const currentOutlineWidth = feature._billboardOutlineWidth;\n const currentPointSize = feature._billboardSize;\n\n if (\n Color.equals(newColor, currentColor) &&\n Color.equals(newOutlineColor, currentOutlineColor) &&\n newOutlineWidth === currentOutlineWidth &&\n newPointSize === currentPointSize\n ) {\n return;\n }\n\n feature._billboardColor = Color.clone(newColor, feature._billboardColor);\n feature._billboardOutlineColor = Color.clone(\n newOutlineColor,\n feature._billboardOutlineColor\n );\n feature._billboardOutlineWidth = newOutlineWidth;\n feature._billboardSize = newPointSize;\n\n const centerAlpha = newColor.alpha;\n const cssColor = newColor.toCssColorString();\n const cssOutlineColor = newOutlineColor.toCssColorString();\n const textureId = JSON.stringify([\n cssColor,\n newPointSize,\n cssOutlineColor,\n newOutlineWidth,\n ]);\n\n b.setImage(\n textureId,\n createBillboardPointCallback(\n centerAlpha,\n cssColor,\n cssOutlineColor,\n newOutlineWidth,\n newPointSize\n )\n );\n}\n\n/**\n * Returns whether the feature contains this property. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {Boolean} Whether the feature contains this property.\n */\nCesium3DTilePointFeature.prototype.hasProperty = function (name) {\n return this._content.batchTable.hasProperty(this._batchId, name);\n};\n\n/**\n * Returns an array of property IDs for the feature. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The IDs of the feature's properties.\n */\nCesium3DTilePointFeature.prototype.getPropertyIds = function (results) {\n return this._content.batchTable.getPropertyIds(this._batchId, results);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's\n * class and inherited classes when using a batch table hierarchy.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy}\n *\n * @param {String} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n *\n * @example\n * // Display all the properties for a feature in the console log.\n * const propertyIds = feature.getPropertyIds();\n * const length = propertyIds.length;\n * for (let i = 0; i < length; ++i) {\n * const propertyId = propertyIds[i];\n * console.log(`{propertyId} : ${feature.getProperty(propertyId)}`);\n * }\n */\nCesium3DTilePointFeature.prototype.getProperty = function (name) {\n return this._content.batchTable.getProperty(this._batchId, name);\n};\n\n/**\n * Returns a copy of the value of the feature's property with the given name.\n * If the feature is contained within a tileset that has metadata (3D Tiles 1.1)\n * or uses the <code>3DTILES_metadata</code> extension, tileset, group and tile metadata is\n * inherited.\n * <p>\n * To resolve name conflicts, this method resolves names from most specific to\n * least specific by metadata granularity in the order: feature, tile, group,\n * tileset. Within each granularity, semantics are resolved first, then other\n * properties.\n * </p>\n * @param {String} name The case-sensitive name of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the feature does not have this property.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nCesium3DTilePointFeature.prototype.getPropertyInherited = function (name) {\n return Cesium3DTileFeature.getPropertyInherited(\n this._content,\n this._batchId,\n name\n );\n};\n\n/**\n * Sets the value of the feature's property with the given name.\n * <p>\n * If a property with the given name doesn't exist, it is created.\n * </p>\n *\n * @param {String} name The case-sensitive name of the property.\n * @param {*} value The value of the property that will be copied.\n *\n * @exception {DeveloperError} Inherited batch table hierarchy property is read only.\n *\n * @example\n * const height = feature.getProperty('Height'); // e.g., the height of a building\n *\n * @example\n * const name = 'clicked';\n * if (feature.getProperty(name)) {\n * console.log('already clicked');\n * } else {\n * feature.setProperty(name, true);\n * console.log('first click');\n * }\n */\nCesium3DTilePointFeature.prototype.setProperty = function (name, value) {\n this._content.batchTable.setProperty(this._batchId, name, value);\n\n // PERFORMANCE_IDEA: Probably overkill, but maybe only mark the tile dirty if the\n // property is in one of the style's expressions or - if it can be done quickly -\n // if the new property value changed the result of an expression.\n this._content.featurePropertiesDirty = true;\n};\n\n/**\n * Returns whether the feature's class name equals <code>className</code>. Unlike {@link Cesium3DTilePointFeature#isClass}\n * this function only checks the feature's exact class and not inherited classes.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {String} className The name to check against.\n * @returns {Boolean} Whether the feature's class name equals <code>className</code>\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.isExactClass = function (className) {\n return this._content.batchTable.isExactClass(this._batchId, className);\n};\n\n/**\n * Returns whether the feature's class or any inherited classes are named <code>className</code>.\n * <p>\n * This function returns <code>false</code> if no batch table hierarchy is present.\n * </p>\n *\n * @param {String} className The name to check against.\n * @returns {Boolean} Whether the feature's class or inherited classes are named <code>className</code>\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.isClass = function (className) {\n return this._content.batchTable.isClass(this._batchId, className);\n};\n\n/**\n * Returns the feature's class name.\n * <p>\n * This function returns <code>undefined</code> if no batch table hierarchy is present.\n * </p>\n *\n * @returns {String} The feature's class name.\n *\n * @private\n */\nCesium3DTilePointFeature.prototype.getExactClassName = function () {\n return this._content.batchTable.getExactClassName(this._batchId);\n};\nexport default Cesium3DTilePointFeature;\n", "import Color from \"./Color.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nfunction measureText(context2D, textString, font, stroke, fill) {\n const metrics = context2D.measureText(textString);\n const isSpace = !/\\S/.test(textString);\n\n if (!isSpace) {\n const fontSize = document.defaultView\n .getComputedStyle(context2D.canvas)\n .getPropertyValue(\"font-size\")\n .replace(\"px\", \"\");\n const canvas = document.createElement(\"canvas\");\n const padding = 100;\n const width = (metrics.width + padding) | 0;\n const height = 3 * fontSize;\n const baseline = height / 2;\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext(\"2d\");\n ctx.font = font;\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width + 1, canvas.height + 1);\n\n if (stroke) {\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = context2D.lineWidth;\n ctx.strokeText(textString, padding / 2, baseline);\n }\n\n if (fill) {\n ctx.fillStyle = \"black\";\n ctx.fillText(textString, padding / 2, baseline);\n }\n\n // Context image data has width * height * 4 elements, because\n // each pixel's R, G, B and A are consecutive values in the array.\n const pixelData = ctx.getImageData(0, 0, width, height).data;\n const length = pixelData.length;\n const width4 = width * 4;\n let i, j;\n\n let ascent, descent;\n // Find the number of rows (from the top) until the first non-white pixel\n for (i = 0; i < length; ++i) {\n if (pixelData[i] !== 255) {\n ascent = (i / width4) | 0;\n break;\n }\n }\n\n // Find the number of rows (from the bottom) until the first non-white pixel\n for (i = length - 1; i >= 0; --i) {\n if (pixelData[i] !== 255) {\n descent = (i / width4) | 0;\n break;\n }\n }\n\n let minx = -1;\n // For each column, for each row, check for first non-white pixel\n for (i = 0; i < width && minx === -1; ++i) {\n for (j = 0; j < height; ++j) {\n const pixelIndex = i * 4 + j * width4;\n if (\n pixelData[pixelIndex] !== 255 ||\n pixelData[pixelIndex + 1] !== 255 ||\n pixelData[pixelIndex + 2] !== 255 ||\n pixelData[pixelIndex + 3] !== 255\n ) {\n minx = i;\n break;\n }\n }\n }\n\n return {\n width: metrics.width,\n height: descent - ascent,\n ascent: baseline - ascent,\n descent: descent - baseline,\n minx: minx - padding / 2,\n };\n }\n\n return {\n width: metrics.width,\n height: 0,\n ascent: 0,\n descent: 0,\n minx: 0,\n };\n}\n\nlet imageSmoothingEnabledName;\n\n/**\n * Writes the given text into a new canvas. The canvas will be sized to fit the text.\n * If text is blank, returns undefined.\n *\n * @param {String} text The text to write.\n * @param {Object} [options] Object with the following properties:\n * @param {String} [options.font='10px sans-serif'] The CSS font to use.\n * @param {String} [options.textBaseline='bottom'] The baseline of the text.\n * @param {Boolean} [options.fill=true] Whether to fill the text.\n * @param {Boolean} [options.stroke=false] Whether to stroke the text.\n * @param {Color} [options.fillColor=Color.WHITE] The fill color.\n * @param {Color} [options.strokeColor=Color.BLACK] The stroke color.\n * @param {Number} [options.strokeWidth=1] The stroke width.\n * @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas.\n * @param {Number} [options.padding=0] The pixel size of the padding to add around the text.\n * @returns {HTMLCanvasElement|undefined} A new canvas with the given text drawn into it. The dimensions object\n * from measureText will also be added to the returned canvas. If text is\n * blank, returns undefined.\n * @function writeTextToCanvas\n */\nfunction writeTextToCanvas(text, options) {\nif (text === \"\") {\n return undefined;\n }\n\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const font = defaultValue(options.font, \"10px sans-serif\");\n const stroke = defaultValue(options.stroke, false);\n const fill = defaultValue(options.fill, true);\n const strokeWidth = defaultValue(options.strokeWidth, 1);\n const backgroundColor = defaultValue(\n options.backgroundColor,\n Color.TRANSPARENT\n );\n const padding = defaultValue(options.padding, 0);\n const doublePadding = padding * 2.0;\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n canvas.style.font = font;\n const context2D = canvas.getContext(\"2d\");\n\n if (!defined(imageSmoothingEnabledName)) {\n if (defined(context2D.imageSmoothingEnabled)) {\n imageSmoothingEnabledName = \"imageSmoothingEnabled\";\n } else if (defined(context2D.mozImageSmoothingEnabled)) {\n imageSmoothingEnabledName = \"mozImageSmoothingEnabled\";\n } else if (defined(context2D.webkitImageSmoothingEnabled)) {\n imageSmoothingEnabledName = \"webkitImageSmoothingEnabled\";\n } else if (defined(context2D.msImageSmoothingEnabled)) {\n imageSmoothingEnabledName = \"msImageSmoothingEnabled\";\n }\n }\n\n context2D.font = font;\n context2D.lineJoin = \"round\";\n context2D.lineWidth = strokeWidth;\n context2D[imageSmoothingEnabledName] = false;\n\n // in order for measureText to calculate style, the canvas has to be\n // (temporarily) added to the DOM.\n canvas.style.visibility = \"hidden\";\n document.body.appendChild(canvas);\n\n const dimensions = measureText(context2D, text, font, stroke, fill);\n // Set canvas.dimensions to be accessed in LabelCollection\n canvas.dimensions = dimensions;\n\n document.body.removeChild(canvas);\n canvas.style.visibility = \"\";\n\n // Some characters, such as the letter j, have a non-zero starting position.\n // This value is used for kerning later, but we need to take it into account\n // now in order to draw the text completely on the canvas\n const x = -dimensions.minx;\n\n // Expand the width to include the starting position.\n const width = Math.ceil(dimensions.width) + x + doublePadding;\n\n // While the height of the letter is correct, we need to adjust\n // where we start drawing it so that letters like j and y properly dip\n // below the line.\n\n const height = dimensions.height + doublePadding;\n const baseline = height - dimensions.ascent + padding;\n const y = height - baseline + doublePadding;\n\n canvas.width = width;\n canvas.height = height;\n\n // Properties must be explicitly set again after changing width and height\n context2D.font = font;\n context2D.lineJoin = \"round\";\n context2D.lineWidth = strokeWidth;\n context2D[imageSmoothingEnabledName] = false;\n\n // Draw background\n if (backgroundColor !== Color.TRANSPARENT) {\n context2D.fillStyle = backgroundColor.toCssColorString();\n context2D.fillRect(0, 0, canvas.width, canvas.height);\n }\n\n if (stroke) {\n const strokeColor = defaultValue(options.strokeColor, Color.BLACK);\n context2D.strokeStyle = strokeColor.toCssColorString();\n context2D.strokeText(text, x + padding, y);\n }\n\n if (fill) {\n const fillColor = defaultValue(options.fillColor, Color.WHITE);\n context2D.fillStyle = fillColor.toCssColorString();\n context2D.fillText(text, x + padding, y);\n }\n\n return canvas;\n}\nexport default writeTextToCanvas;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport writeTextToCanvas from \"../Core/writeTextToCanvas.js\";\nimport bitmapSDF from \"bitmap-sdf\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport Label from \"./Label.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport TextureAtlas from \"./TextureAtlas.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\nimport GraphemeSplitter from \"grapheme-splitter\";\n\n// A glyph represents a single character in a particular label. It may or may\n// not have a billboard, depending on whether the texture info has an index into\n// the the label collection's texture atlas. Invisible characters have no texture, and\n// no billboard. However, it always has a valid dimensions object.\nfunction Glyph() {\n this.textureInfo = undefined;\n this.dimensions = undefined;\n this.billboard = undefined;\n}\n\n// GlyphTextureInfo represents a single character, drawn in a particular style,\n// shared and reference counted across all labels. It may or may not have an\n// index into the label collection's texture atlas, depending on whether the character\n// has both width and height, but it always has a valid dimensions object.\nfunction GlyphTextureInfo(labelCollection, index, dimensions) {\n this.labelCollection = labelCollection;\n this.index = index;\n this.dimensions = dimensions;\n}\n\n// Traditionally, leading is %20 of the font size.\nconst defaultLineSpacingPercent = 1.2;\nconst whitePixelCanvasId = \"ID_WHITE_PIXEL\";\nconst whitePixelSize = new Cartesian2(4, 4);\nconst whitePixelBoundingRegion = new BoundingRectangle(1, 1, 1, 1);\n\nfunction addWhitePixelCanvas(textureAtlas) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = whitePixelSize.x;\n canvas.height = whitePixelSize.y;\n\n const context2D = canvas.getContext(\"2d\");\n context2D.fillStyle = \"#fff\";\n context2D.fillRect(0, 0, canvas.width, canvas.height);\n\n // Canvas operations take a frame to draw. Use the asynchronous add function which resolves a promise and allows the draw to complete,\n // but there's no need to wait on the promise before operation can continue\n textureAtlas.addImage(whitePixelCanvasId, canvas);\n}\n\n// reusable object for calling writeTextToCanvas\nconst writeTextToCanvasParameters = {};\nfunction createGlyphCanvas(\n character,\n font,\n fillColor,\n outlineColor,\n outlineWidth,\n style,\n verticalOrigin\n) {\n writeTextToCanvasParameters.font = font;\n writeTextToCanvasParameters.fillColor = fillColor;\n writeTextToCanvasParameters.strokeColor = outlineColor;\n writeTextToCanvasParameters.strokeWidth = outlineWidth;\n // Setting the padding to something bigger is necessary to get enough space for the outlining.\n writeTextToCanvasParameters.padding = SDFSettings.PADDING;\n\n if (verticalOrigin === VerticalOrigin.CENTER) {\n writeTextToCanvasParameters.textBaseline = \"middle\";\n } else if (verticalOrigin === VerticalOrigin.TOP) {\n writeTextToCanvasParameters.textBaseline = \"top\";\n } else {\n // VerticalOrigin.BOTTOM and VerticalOrigin.BASELINE\n writeTextToCanvasParameters.textBaseline = \"bottom\";\n }\n\n writeTextToCanvasParameters.fill =\n style === LabelStyle.FILL || style === LabelStyle.FILL_AND_OUTLINE;\n writeTextToCanvasParameters.stroke =\n style === LabelStyle.OUTLINE || style === LabelStyle.FILL_AND_OUTLINE;\n writeTextToCanvasParameters.backgroundColor = Color.BLACK;\n\n return writeTextToCanvas(character, writeTextToCanvasParameters);\n}\n\nfunction unbindGlyph(labelCollection, glyph) {\n glyph.textureInfo = undefined;\n glyph.dimensions = undefined;\n\n const billboard = glyph.billboard;\n if (defined(billboard)) {\n billboard.show = false;\n billboard.image = undefined;\n if (defined(billboard._removeCallbackFunc)) {\n billboard._removeCallbackFunc();\n billboard._removeCallbackFunc = undefined;\n }\n labelCollection._spareBillboards.push(billboard);\n glyph.billboard = undefined;\n }\n}\n\nfunction addGlyphToTextureAtlas(textureAtlas, id, canvas, glyphTextureInfo) {\n glyphTextureInfo.index = textureAtlas.addImageSync(id, canvas);\n}\n\nconst splitter = new GraphemeSplitter();\n\nfunction rebindAllGlyphs(labelCollection, label) {\n const text = label._renderedText;\n const graphemes = splitter.splitGraphemes(text);\n const textLength = graphemes.length;\n const glyphs = label._glyphs;\n const glyphsLength = glyphs.length;\n\n let glyph;\n let glyphIndex;\n let textIndex;\n\n // Compute a font size scale relative to the sdf font generated size.\n label._relativeSize = label._fontSize / SDFSettings.FONT_SIZE;\n\n // if we have more glyphs than needed, unbind the extras.\n if (textLength < glyphsLength) {\n for (glyphIndex = textLength; glyphIndex < glyphsLength; ++glyphIndex) {\n unbindGlyph(labelCollection, glyphs[glyphIndex]);\n }\n }\n\n // presize glyphs to match the new text length\n glyphs.length = textLength;\n\n const showBackground =\n label._showBackground && text.split(\"\\n\").join(\"\").length > 0;\n let backgroundBillboard = label._backgroundBillboard;\n const backgroundBillboardCollection =\n labelCollection._backgroundBillboardCollection;\n if (!showBackground) {\n if (defined(backgroundBillboard)) {\n backgroundBillboardCollection.remove(backgroundBillboard);\n label._backgroundBillboard = backgroundBillboard = undefined;\n }\n } else {\n if (!defined(backgroundBillboard)) {\n backgroundBillboard = backgroundBillboardCollection.add({\n collection: labelCollection,\n image: whitePixelCanvasId,\n imageSubRegion: whitePixelBoundingRegion,\n });\n label._backgroundBillboard = backgroundBillboard;\n }\n\n backgroundBillboard.color = label._backgroundColor;\n backgroundBillboard.show = label._show;\n backgroundBillboard.position = label._position;\n backgroundBillboard.eyeOffset = label._eyeOffset;\n backgroundBillboard.pixelOffset = label._pixelOffset;\n backgroundBillboard.horizontalOrigin = HorizontalOrigin.LEFT;\n backgroundBillboard.verticalOrigin = label._verticalOrigin;\n backgroundBillboard.heightReference = label._heightReference;\n backgroundBillboard.scale = label.totalScale;\n backgroundBillboard.pickPrimitive = label;\n backgroundBillboard.id = label._id;\n backgroundBillboard.translucencyByDistance = label._translucencyByDistance;\n backgroundBillboard.pixelOffsetScaleByDistance =\n label._pixelOffsetScaleByDistance;\n backgroundBillboard.scaleByDistance = label._scaleByDistance;\n backgroundBillboard.distanceDisplayCondition =\n label._distanceDisplayCondition;\n backgroundBillboard.disableDepthTestDistance =\n label._disableDepthTestDistance;\n }\n\n const glyphTextureCache = labelCollection._glyphTextureCache;\n\n // walk the text looking for new characters (creating new glyphs for each)\n // or changed characters (rebinding existing glyphs)\n for (textIndex = 0; textIndex < textLength; ++textIndex) {\n const character = graphemes[textIndex];\n const verticalOrigin = label._verticalOrigin;\n\n const id = JSON.stringify([\n character,\n label._fontFamily,\n label._fontStyle,\n label._fontWeight,\n +verticalOrigin,\n ]);\n\n let glyphTextureInfo = glyphTextureCache[id];\n if (!defined(glyphTextureInfo)) {\n const glyphFont = `${label._fontStyle} ${label._fontWeight} ${SDFSettings.FONT_SIZE}px ${label._fontFamily}`;\n\n const canvas = createGlyphCanvas(\n character,\n glyphFont,\n Color.WHITE,\n Color.WHITE,\n 0.0,\n LabelStyle.FILL,\n verticalOrigin\n );\n\n glyphTextureInfo = new GlyphTextureInfo(\n labelCollection,\n -1,\n canvas.dimensions\n );\n glyphTextureCache[id] = glyphTextureInfo;\n\n if (canvas.width > 0 && canvas.height > 0) {\n const sdfValues = bitmapSDF(canvas, {\n cutoff: SDFSettings.CUTOFF,\n radius: SDFSettings.RADIUS,\n });\n\n const ctx = canvas.getContext(\"2d\");\n const canvasWidth = canvas.width;\n const canvasHeight = canvas.height;\n const imgData = ctx.getImageData(0, 0, canvasWidth, canvasHeight);\n for (let i = 0; i < canvasWidth; i++) {\n for (let j = 0; j < canvasHeight; j++) {\n const baseIndex = j * canvasWidth + i;\n const alpha = sdfValues[baseIndex] * 255;\n const imageIndex = baseIndex * 4;\n imgData.data[imageIndex + 0] = alpha;\n imgData.data[imageIndex + 1] = alpha;\n imgData.data[imageIndex + 2] = alpha;\n imgData.data[imageIndex + 3] = alpha;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n if (character !== \" \") {\n addGlyphToTextureAtlas(\n labelCollection._textureAtlas,\n id,\n canvas,\n glyphTextureInfo\n );\n }\n }\n }\n\n glyph = glyphs[textIndex];\n\n if (defined(glyph)) {\n // clean up leftover information from the previous glyph\n if (glyphTextureInfo.index === -1) {\n // no texture, and therefore no billboard, for this glyph.\n // so, completely unbind glyph.\n unbindGlyph(labelCollection, glyph);\n } else if (defined(glyph.textureInfo)) {\n // we have a texture and billboard. If we had one before, release\n // our reference to that texture info, but reuse the billboard.\n glyph.textureInfo = undefined;\n }\n } else {\n // create a glyph object\n glyph = new Glyph();\n glyphs[textIndex] = glyph;\n }\n\n glyph.textureInfo = glyphTextureInfo;\n glyph.dimensions = glyphTextureInfo.dimensions;\n\n // if we have a texture, configure the existing billboard, or obtain one\n if (glyphTextureInfo.index !== -1) {\n let billboard = glyph.billboard;\n const spareBillboards = labelCollection._spareBillboards;\n if (!defined(billboard)) {\n if (spareBillboards.length > 0) {\n billboard = spareBillboards.pop();\n } else {\n billboard = labelCollection._billboardCollection.add({\n collection: labelCollection,\n });\n billboard._labelDimensions = new Cartesian2();\n billboard._labelTranslate = new Cartesian2();\n }\n glyph.billboard = billboard;\n }\n\n billboard.show = label._show;\n billboard.position = label._position;\n billboard.eyeOffset = label._eyeOffset;\n billboard.pixelOffset = label._pixelOffset;\n billboard.horizontalOrigin = HorizontalOrigin.LEFT;\n billboard.verticalOrigin = label._verticalOrigin;\n billboard.heightReference = label._heightReference;\n billboard.scale = label.totalScale;\n billboard.pickPrimitive = label;\n billboard.id = label._id;\n billboard.image = id;\n billboard.translucencyByDistance = label._translucencyByDistance;\n billboard.pixelOffsetScaleByDistance = label._pixelOffsetScaleByDistance;\n billboard.scaleByDistance = label._scaleByDistance;\n billboard.distanceDisplayCondition = label._distanceDisplayCondition;\n billboard.disableDepthTestDistance = label._disableDepthTestDistance;\n billboard._batchIndex = label._batchIndex;\n billboard.outlineColor = label.outlineColor;\n if (label.style === LabelStyle.FILL_AND_OUTLINE) {\n billboard.color = label._fillColor;\n billboard.outlineWidth = label.outlineWidth;\n } else if (label.style === LabelStyle.FILL) {\n billboard.color = label._fillColor;\n billboard.outlineWidth = 0.0;\n } else if (label.style === LabelStyle.OUTLINE) {\n billboard.color = Color.TRANSPARENT;\n billboard.outlineWidth = label.outlineWidth;\n }\n }\n }\n\n // changing glyphs will cause the position of the\n // glyphs to change, since different characters have different widths\n label._repositionAllGlyphs = true;\n}\n\nfunction calculateWidthOffset(lineWidth, horizontalOrigin, backgroundPadding) {\n if (horizontalOrigin === HorizontalOrigin.CENTER) {\n return -lineWidth / 2;\n } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n return -(lineWidth + backgroundPadding.x);\n }\n return backgroundPadding.x;\n}\n\n// reusable Cartesian2 instances\nconst glyphPixelOffset = new Cartesian2();\nconst scratchBackgroundPadding = new Cartesian2();\n\nfunction repositionAllGlyphs(label) {\n const glyphs = label._glyphs;\n const text = label._renderedText;\n let glyph;\n let dimensions;\n let lastLineWidth = 0;\n let maxLineWidth = 0;\n const lineWidths = [];\n let maxGlyphDescent = Number.NEGATIVE_INFINITY;\n let maxGlyphY = 0;\n let numberOfLines = 1;\n let glyphIndex;\n const glyphLength = glyphs.length;\n\n const backgroundBillboard = label._backgroundBillboard;\n const backgroundPadding = Cartesian2.clone(\n defined(backgroundBillboard) ? label._backgroundPadding : Cartesian2.ZERO,\n scratchBackgroundPadding\n );\n\n // We need to scale the background padding, which is specified in pixels by the inverse of the relative size so it is scaled properly.\n backgroundPadding.x /= label._relativeSize;\n backgroundPadding.y /= label._relativeSize;\n\n for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n if (text.charAt(glyphIndex) === \"\\n\") {\n lineWidths.push(lastLineWidth);\n ++numberOfLines;\n lastLineWidth = 0;\n } else {\n glyph = glyphs[glyphIndex];\n dimensions = glyph.dimensions;\n maxGlyphY = Math.max(maxGlyphY, dimensions.height - dimensions.descent);\n maxGlyphDescent = Math.max(maxGlyphDescent, dimensions.descent);\n\n //Computing the line width must also account for the kerning that occurs between letters.\n lastLineWidth += dimensions.width - dimensions.minx;\n if (glyphIndex < glyphLength - 1) {\n lastLineWidth += glyphs[glyphIndex + 1].dimensions.minx;\n }\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n }\n }\n lineWidths.push(lastLineWidth);\n const maxLineHeight = maxGlyphY + maxGlyphDescent;\n\n const scale = label.totalScale;\n const horizontalOrigin = label._horizontalOrigin;\n const verticalOrigin = label._verticalOrigin;\n let lineIndex = 0;\n let lineWidth = lineWidths[lineIndex];\n let widthOffset = calculateWidthOffset(\n lineWidth,\n horizontalOrigin,\n backgroundPadding\n );\n const lineSpacing =\n (defined(label._lineHeight)\n ? label._lineHeight\n : defaultLineSpacingPercent * label._fontSize) / label._relativeSize;\n const otherLinesHeight = lineSpacing * (numberOfLines - 1);\n let totalLineWidth = maxLineWidth;\n let totalLineHeight = maxLineHeight + otherLinesHeight;\n\n if (defined(backgroundBillboard)) {\n totalLineWidth += backgroundPadding.x * 2;\n totalLineHeight += backgroundPadding.y * 2;\n backgroundBillboard._labelHorizontalOrigin = horizontalOrigin;\n }\n\n glyphPixelOffset.x = widthOffset * scale;\n glyphPixelOffset.y = 0;\n\n let firstCharOfLine = true;\n\n let lineOffsetY = 0;\n for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n if (text.charAt(glyphIndex) === \"\\n\") {\n ++lineIndex;\n lineOffsetY += lineSpacing;\n lineWidth = lineWidths[lineIndex];\n widthOffset = calculateWidthOffset(\n lineWidth,\n horizontalOrigin,\n backgroundPadding\n );\n glyphPixelOffset.x = widthOffset * scale;\n firstCharOfLine = true;\n } else {\n glyph = glyphs[glyphIndex];\n dimensions = glyph.dimensions;\n\n if (verticalOrigin === VerticalOrigin.TOP) {\n glyphPixelOffset.y =\n dimensions.height - maxGlyphY - backgroundPadding.y;\n glyphPixelOffset.y += SDFSettings.PADDING;\n } else if (verticalOrigin === VerticalOrigin.CENTER) {\n glyphPixelOffset.y =\n (otherLinesHeight + dimensions.height - maxGlyphY) / 2;\n } else if (verticalOrigin === VerticalOrigin.BASELINE) {\n glyphPixelOffset.y = otherLinesHeight;\n glyphPixelOffset.y -= SDFSettings.PADDING;\n } else {\n // VerticalOrigin.BOTTOM\n glyphPixelOffset.y =\n otherLinesHeight + maxGlyphDescent + backgroundPadding.y;\n glyphPixelOffset.y -= SDFSettings.PADDING;\n }\n glyphPixelOffset.y =\n (glyphPixelOffset.y - dimensions.descent - lineOffsetY) * scale;\n\n // Handle any offsets for the first character of the line since the bounds might not be right on the bottom left pixel.\n if (firstCharOfLine) {\n glyphPixelOffset.x -= SDFSettings.PADDING * scale;\n firstCharOfLine = false;\n }\n\n if (defined(glyph.billboard)) {\n glyph.billboard._setTranslate(glyphPixelOffset);\n glyph.billboard._labelDimensions.x = totalLineWidth;\n glyph.billboard._labelDimensions.y = totalLineHeight;\n glyph.billboard._labelHorizontalOrigin = horizontalOrigin;\n }\n\n //Compute the next x offset taking into account the kerning performed\n //on both the current letter as well as the next letter to be drawn\n //as well as any applied scale.\n if (glyphIndex < glyphLength - 1) {\n const nextGlyph = glyphs[glyphIndex + 1];\n glyphPixelOffset.x +=\n (dimensions.width - dimensions.minx + nextGlyph.dimensions.minx) *\n scale;\n }\n }\n }\n\n if (defined(backgroundBillboard) && text.split(\"\\n\").join(\"\").length > 0) {\n if (horizontalOrigin === HorizontalOrigin.CENTER) {\n widthOffset = -maxLineWidth / 2 - backgroundPadding.x;\n } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n widthOffset = -(maxLineWidth + backgroundPadding.x * 2);\n } else {\n widthOffset = 0;\n }\n glyphPixelOffset.x = widthOffset * scale;\n\n if (verticalOrigin === VerticalOrigin.TOP) {\n glyphPixelOffset.y = maxLineHeight - maxGlyphY - maxGlyphDescent;\n } else if (verticalOrigin === VerticalOrigin.CENTER) {\n glyphPixelOffset.y = (maxLineHeight - maxGlyphY) / 2 - maxGlyphDescent;\n } else if (verticalOrigin === VerticalOrigin.BASELINE) {\n glyphPixelOffset.y = -backgroundPadding.y - maxGlyphDescent;\n } else {\n // VerticalOrigin.BOTTOM\n glyphPixelOffset.y = 0;\n }\n glyphPixelOffset.y = glyphPixelOffset.y * scale;\n\n backgroundBillboard.width = totalLineWidth;\n backgroundBillboard.height = totalLineHeight;\n backgroundBillboard._setTranslate(glyphPixelOffset);\n backgroundBillboard._labelTranslate = Cartesian2.clone(\n glyphPixelOffset,\n backgroundBillboard._labelTranslate\n );\n }\n\n if (label.heightReference === HeightReference.CLAMP_TO_GROUND) {\n for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {\n glyph = glyphs[glyphIndex];\n const billboard = glyph.billboard;\n if (defined(billboard)) {\n billboard._labelTranslate = Cartesian2.clone(\n glyphPixelOffset,\n billboard._labelTranslate\n );\n }\n }\n }\n}\n\nfunction destroyLabel(labelCollection, label) {\n const glyphs = label._glyphs;\n for (let i = 0, len = glyphs.length; i < len; ++i) {\n unbindGlyph(labelCollection, glyphs[i]);\n }\n if (defined(label._backgroundBillboard)) {\n labelCollection._backgroundBillboardCollection.remove(\n label._backgroundBillboard\n );\n label._backgroundBillboard = undefined;\n }\n label._labelCollection = undefined;\n\n if (defined(label._removeCallbackFunc)) {\n label._removeCallbackFunc();\n }\n\n destroyObject(label);\n}\n\n/**\n * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.\n * Each label can have a different font, color, scale, etc.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Label.png' width='400' height='300' /><br />\n * Example labels\n * </div>\n * <br /><br />\n * Labels are added and removed from the collection using {@link LabelCollection#add}\n * and {@link LabelCollection#remove}.\n *\n * @alias LabelCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each label from model to world coordinates.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Scene} [options.scene] Must be passed in for labels that use the height reference property or will be depth tested against the globe.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The label blending option. The default\n * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {Boolean} [options.show=true] Determines if the labels in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many labels, to\n * many collections with only a few labels each. Avoid having collections where some\n * labels change every frame and others do not; instead, create one or more collections\n * for static labels, and one or more collections for dynamic labels.\n *\n * @see LabelCollection#add\n * @see LabelCollection#remove\n * @see Label\n * @see BillboardCollection\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n *\n * @example\n * // Create a label collection with two labels\n * const labels = scene.primitives.add(new Cesium.LabelCollection());\n * labels.add({\n * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n * text : 'A label'\n * });\n * labels.add({\n * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n * text : 'Another label'\n * });\n */\nfunction LabelCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._scene = options.scene;\n this._batchTable = options.batchTable;\n\n this._textureAtlas = undefined;\n this._backgroundTextureAtlas = undefined;\n\n this._backgroundBillboardCollection = new BillboardCollection({\n scene: this._scene,\n });\n this._backgroundBillboardCollection.destroyTextureAtlas = false;\n\n this._billboardCollection = new BillboardCollection({\n scene: this._scene,\n batchTable: this._batchTable,\n });\n this._billboardCollection.destroyTextureAtlas = false;\n this._billboardCollection._sdf = true;\n\n this._spareBillboards = [];\n this._glyphTextureCache = {};\n this._labels = [];\n this._labelsToUpdate = [];\n this._totalGlyphCount = 0;\n\n this._highlightColor = Color.clone(Color.WHITE); // Only used by Vector3DTilePoints\n\n /**\n * Determines if labels in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.\n * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type Matrix4\n * @default {@link Matrix4.IDENTITY}\n *\n * @example\n * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n * labels.add({\n * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),\n * text : 'Center'\n * });\n * labels.add({\n * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),\n * text : 'East'\n * });\n * labels.add({\n * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),\n * text : 'North'\n * });\n * labels.add({\n * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),\n * text : 'Up'\n * });\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * The label blending option. The default is used for rendering both opaque and translucent labels.\n * However, if either all of the labels are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n * performance by up to 2x.\n * @type {BlendOption}\n * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n */\n this.blendOption = defaultValue(\n options.blendOption,\n BlendOption.OPAQUE_AND_TRANSLUCENT\n );\n}\n\nObject.defineProperties(LabelCollection.prototype, {\n /**\n * Returns the number of labels in this collection. This is commonly used with\n * {@link LabelCollection#get} to iterate over all the labels\n * in the collection.\n * @memberof LabelCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n return this._labels.length;\n },\n },\n});\n\n/**\n * Creates and adds a label with the specified initial properties to the collection.\n * The added label is returned so it can be modified or removed from the collection later.\n *\n * @param {Object} [options] A template describing the label's properties as shown in Example 1.\n * @returns {Label} The label that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten; this operations is <code>O(n)</code> and also incurs\n * CPU to GPU overhead. For best performance, add as many billboards as possible before\n * calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1: Add a label, specifying all the default values.\n * const l = labels.add({\n * show : true,\n * position : Cesium.Cartesian3.ZERO,\n * text : '',\n * font : '30px sans-serif',\n * fillColor : Cesium.Color.WHITE,\n * outlineColor : Cesium.Color.BLACK,\n * outlineWidth : 1.0,\n * showBackground : false,\n * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),\n * backgroundPadding : new Cesium.Cartesian2(7, 5),\n * style : Cesium.LabelStyle.FILL,\n * pixelOffset : Cesium.Cartesian2.ZERO,\n * eyeOffset : Cesium.Cartesian3.ZERO,\n * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,\n * verticalOrigin : Cesium.VerticalOrigin.BASELINE,\n * scale : 1.0,\n * translucencyByDistance : undefined,\n * pixelOffsetScaleByDistance : undefined,\n * heightReference : HeightReference.NONE,\n * distanceDisplayCondition : undefined\n * });\n *\n * @example\n * // Example 2: Specify only the label's cartographic position,\n * // text, and font.\n * const l = labels.add({\n * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),\n * text : 'Hello World',\n * font : '24px Helvetica',\n * });\n *\n * @see LabelCollection#remove\n * @see LabelCollection#removeAll\n */\nLabelCollection.prototype.add = function (options) {\n const label = new Label(options, this);\n\n this._labels.push(label);\n this._labelsToUpdate.push(label);\n\n return label;\n};\n\n/**\n * Removes a label from the collection. Once removed, a label is no longer usable.\n *\n * @param {Label} label The label to remove.\n * @returns {Boolean} <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, remove as many labels as possible before calling <code>update</code>.\n * If you intend to temporarily hide a label, it is usually more efficient to call\n * {@link Label#show} instead of removing and re-adding the label.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const l = labels.add(...);\n * labels.remove(l); // Returns true\n *\n * @see LabelCollection#add\n * @see LabelCollection#removeAll\n * @see Label#show\n */\nLabelCollection.prototype.remove = function (label) {\n if (defined(label) && label._labelCollection === this) {\n const index = this._labels.indexOf(label);\n if (index !== -1) {\n this._labels.splice(index, 1);\n destroyLabel(this, label);\n return true;\n }\n }\n return false;\n};\n\n/**\n * Removes all labels from the collection.\n *\n * @performance <code>O(n)</code>. It is more efficient to remove all the labels\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * labels.add(...);\n * labels.add(...);\n * labels.removeAll();\n *\n * @see LabelCollection#add\n * @see LabelCollection#remove\n */\nLabelCollection.prototype.removeAll = function () {\n const labels = this._labels;\n\n for (let i = 0, len = labels.length; i < len; ++i) {\n destroyLabel(this, labels[i]);\n }\n\n labels.length = 0;\n};\n\n/**\n * Check whether this collection contains a given label.\n *\n * @param {Label} label The label to check for.\n * @returns {Boolean} true if this collection contains the label, false otherwise.\n *\n * @see LabelCollection#get\n *\n */\nLabelCollection.prototype.contains = function (label) {\n return defined(label) && label._labelCollection === this;\n};\n\n/**\n * Returns the label in the collection at the specified index. Indices are zero-based\n * and increase as labels are added. Removing a label shifts all labels after\n * it to the left, changing their indices. This function is commonly used with\n * {@link LabelCollection#length} to iterate over all the labels\n * in the collection.\n *\n * @param {Number} index The zero-based index of the billboard.\n *\n * @returns {Label} The label at the specified index.\n *\n * @performance Expected constant time. If labels were removed from the collection and\n * {@link Scene#render} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every label in the collection\n * const len = labels.length;\n * for (let i = 0; i < len; ++i) {\n * const l = billboards.get(i);\n * l.show = !l.show;\n * }\n *\n * @see LabelCollection#length\n */\nLabelCollection.prototype.get = function (index) {\n return this._labels[index];\n};\n\n/**\n * @private\n *\n */\nLabelCollection.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const billboardCollection = this._billboardCollection;\n const backgroundBillboardCollection = this._backgroundBillboardCollection;\n\n billboardCollection.modelMatrix = this.modelMatrix;\n billboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;\n backgroundBillboardCollection.modelMatrix = this.modelMatrix;\n backgroundBillboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;\n\n const context = frameState.context;\n\n if (!defined(this._textureAtlas)) {\n this._textureAtlas = new TextureAtlas({\n context: context,\n });\n billboardCollection.textureAtlas = this._textureAtlas;\n }\n\n if (!defined(this._backgroundTextureAtlas)) {\n this._backgroundTextureAtlas = new TextureAtlas({\n context: context,\n initialSize: whitePixelSize,\n });\n backgroundBillboardCollection.textureAtlas = this._backgroundTextureAtlas;\n addWhitePixelCanvas(this._backgroundTextureAtlas);\n }\n\n const len = this._labelsToUpdate.length;\n for (let i = 0; i < len; ++i) {\n const label = this._labelsToUpdate[i];\n if (label.isDestroyed()) {\n continue;\n }\n\n const preUpdateGlyphCount = label._glyphs.length;\n\n if (label._rebindAllGlyphs) {\n rebindAllGlyphs(this, label);\n label._rebindAllGlyphs = false;\n }\n\n if (label._repositionAllGlyphs) {\n repositionAllGlyphs(label);\n label._repositionAllGlyphs = false;\n }\n\n const glyphCountDifference = label._glyphs.length - preUpdateGlyphCount;\n this._totalGlyphCount += glyphCountDifference;\n }\n\n const blendOption =\n backgroundBillboardCollection.length > 0\n ? BlendOption.TRANSLUCENT\n : this.blendOption;\n billboardCollection.blendOption = blendOption;\n backgroundBillboardCollection.blendOption = blendOption;\n\n billboardCollection._highlightColor = this._highlightColor;\n backgroundBillboardCollection._highlightColor = this._highlightColor;\n\n this._labelsToUpdate.length = 0;\n backgroundBillboardCollection.update(frameState);\n billboardCollection.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see LabelCollection#destroy\n */\nLabelCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * labels = labels && labels.destroy();\n *\n * @see LabelCollection#isDestroyed\n */\nLabelCollection.prototype.destroy = function () {\n this.removeAll();\n this._billboardCollection = this._billboardCollection.destroy();\n this._textureAtlas = this._textureAtlas && this._textureAtlas.destroy();\n this._backgroundBillboardCollection = this._backgroundBillboardCollection.destroy();\n this._backgroundTextureAtlas =\n this._backgroundTextureAtlas && this._backgroundTextureAtlas.destroy();\n\n return destroyObject(this);\n};\nexport default LabelCollection;\n", "/**\n * Describes how to draw a label.\n *\n * @enum {Number}\n *\n * @see Label#style\n */\nconst LabelStyle = {\n /**\n * Fill the text of the label, but do not outline.\n *\n * @type {Number}\n * @constant\n */\n FILL: 0,\n\n /**\n * Outline the text of the label, but do not fill.\n *\n * @type {Number}\n * @constant\n */\n OUTLINE: 1,\n\n /**\n * Fill and outline the text of the label.\n *\n * @type {Number}\n * @constant\n */\n FILL_AND_OUTLINE: 2,\n};\nexport default Object.freeze(LabelStyle);\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Billboard from \"./Billboard.js\";\nimport HeightReference from \"./HeightReference.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport SDFSettings from \"./SDFSettings.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\nconst fontInfoCache = {};\nlet fontInfoCacheLength = 0;\nconst fontInfoCacheMaxSize = 256;\nconst defaultBackgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\nconst defaultBackgroundPadding = new Cartesian2(7, 5);\n\nconst textTypes = Object.freeze({\n LTR: 0,\n RTL: 1,\n WEAK: 2,\n BRACKETS: 3,\n});\n\nfunction rebindAllGlyphs(label) {\n if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {\n // only push label if it's not already been marked dirty\n label._labelCollection._labelsToUpdate.push(label);\n }\n label._rebindAllGlyphs = true;\n}\n\nfunction repositionAllGlyphs(label) {\n if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {\n // only push label if it's not already been marked dirty\n label._labelCollection._labelsToUpdate.push(label);\n }\n label._repositionAllGlyphs = true;\n}\n\nfunction getCSSValue(element, property) {\n return document.defaultView\n .getComputedStyle(element, null)\n .getPropertyValue(property);\n}\n\nfunction parseFont(label) {\n let fontInfo = fontInfoCache[label._font];\n if (!defined(fontInfo)) {\n const div = document.createElement(\"div\");\n div.style.position = \"absolute\";\n div.style.opacity = 0;\n div.style.font = label._font;\n document.body.appendChild(div);\n\n let lineHeight = parseFloat(getCSSValue(div, \"line-height\"));\n if (isNaN(lineHeight)) {\n // line-height isn't a number, i.e. 'normal'; apply default line-spacing\n lineHeight = undefined;\n }\n\n fontInfo = {\n family: getCSSValue(div, \"font-family\"),\n size: getCSSValue(div, \"font-size\").replace(\"px\", \"\"),\n style: getCSSValue(div, \"font-style\"),\n weight: getCSSValue(div, \"font-weight\"),\n lineHeight: lineHeight,\n };\n\n document.body.removeChild(div);\n if (fontInfoCacheLength < fontInfoCacheMaxSize) {\n fontInfoCache[label._font] = fontInfo;\n fontInfoCacheLength++;\n }\n }\n label._fontFamily = fontInfo.family;\n label._fontSize = fontInfo.size;\n label._fontStyle = fontInfo.style;\n label._fontWeight = fontInfo.weight;\n label._lineHeight = fontInfo.lineHeight;\n}\n\n/**\n * <div class=\"notice\">\n * Create labels by calling {@link LabelCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * @alias Label\n * @internalConstructor\n * @class\n *\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see LabelCollection\n * @see LabelCollection#add\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Labels.html|Cesium Sandcastle Labels Demo}\n */\nfunction Label(options, labelCollection) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let translucencyByDistance = options.translucencyByDistance;\n let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;\n let scaleByDistance = options.scaleByDistance;\n let distanceDisplayCondition = options.distanceDisplayCondition;\n if (defined(translucencyByDistance)) {\ntranslucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n }\n if (defined(pixelOffsetScaleByDistance)) {\npixelOffsetScaleByDistance = NearFarScalar.clone(\n pixelOffsetScaleByDistance\n );\n }\n if (defined(scaleByDistance)) {\nscaleByDistance = NearFarScalar.clone(scaleByDistance);\n }\n if (defined(distanceDisplayCondition)) {\ndistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition\n );\n }\n\n this._renderedText = undefined;\n this._text = undefined;\n this._show = defaultValue(options.show, true);\n this._font = defaultValue(options.font, \"30px sans-serif\");\n this._fillColor = Color.clone(defaultValue(options.fillColor, Color.WHITE));\n this._outlineColor = Color.clone(\n defaultValue(options.outlineColor, Color.BLACK)\n );\n this._outlineWidth = defaultValue(options.outlineWidth, 1.0);\n this._showBackground = defaultValue(options.showBackground, false);\n this._backgroundColor = Color.clone(\n defaultValue(options.backgroundColor, defaultBackgroundColor)\n );\n this._backgroundPadding = Cartesian2.clone(\n defaultValue(options.backgroundPadding, defaultBackgroundPadding)\n );\n this._style = defaultValue(options.style, LabelStyle.FILL);\n this._verticalOrigin = defaultValue(\n options.verticalOrigin,\n VerticalOrigin.BASELINE\n );\n this._horizontalOrigin = defaultValue(\n options.horizontalOrigin,\n HorizontalOrigin.LEFT\n );\n this._pixelOffset = Cartesian2.clone(\n defaultValue(options.pixelOffset, Cartesian2.ZERO)\n );\n this._eyeOffset = Cartesian3.clone(\n defaultValue(options.eyeOffset, Cartesian3.ZERO)\n );\n this._position = Cartesian3.clone(\n defaultValue(options.position, Cartesian3.ZERO)\n );\n this._scale = defaultValue(options.scale, 1.0);\n this._id = options.id;\n this._translucencyByDistance = translucencyByDistance;\n this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;\n this._scaleByDistance = scaleByDistance;\n this._heightReference = defaultValue(\n options.heightReference,\n HeightReference.NONE\n );\n this._distanceDisplayCondition = distanceDisplayCondition;\n this._disableDepthTestDistance = options.disableDepthTestDistance;\n\n this._labelCollection = labelCollection;\n this._glyphs = [];\n this._backgroundBillboard = undefined;\n this._batchIndex = undefined; // Used only by Vector3DTilePoints and BillboardCollection\n\n this._rebindAllGlyphs = true;\n this._repositionAllGlyphs = true;\n\n this._actualClampedPosition = undefined;\n this._removeCallbackFunc = undefined;\n this._mode = undefined;\n\n this._clusterShow = true;\n\n this.text = defaultValue(options.text, \"\");\n\n this._relativeSize = 1.0;\n\n parseFont(this);\n\n this._updateClamping();\n}\n\nObject.defineProperties(Label.prototype, {\n /**\n * Determines if this label will be shown. Use this to hide or show a label, instead\n * of removing it and re-adding it to the collection.\n * @memberof Label.prototype\n * @type {Boolean}\n * @default true\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (this._show !== value) {\n this._show = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const billboard = glyphs[i].billboard;\n if (defined(billboard)) {\n billboard.show = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.show = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets the Cartesian position of this label.\n * @memberof Label.prototype\n * @type {Cartesian3}\n */\n position: {\n get: function () {\n return this._position;\n },\n set: function (value) {\n const position = this._position;\n if (!Cartesian3.equals(position, value)) {\n Cartesian3.clone(value, position);\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const billboard = glyphs[i].billboard;\n if (defined(billboard)) {\n billboard.position = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.position = value;\n }\n\n this._updateClamping();\n }\n },\n },\n\n /**\n * Gets or sets the height reference of this billboard.\n * @memberof Label.prototype\n * @type {HeightReference}\n * @default HeightReference.NONE\n */\n heightReference: {\n get: function () {\n return this._heightReference;\n },\n set: function (value) {\n if (value !== this._heightReference) {\n this._heightReference = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const billboard = glyphs[i].billboard;\n if (defined(billboard)) {\n billboard.heightReference = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.heightReference = value;\n }\n\n repositionAllGlyphs(this);\n\n this._updateClamping();\n }\n },\n },\n\n /**\n * Gets or sets the text of this label.\n * @memberof Label.prototype\n * @type {String}\n */\n text: {\n get: function () {\n return this._text;\n },\n set: function (value) {\n if (this._text !== value) {\n this._text = value;\n\n // Strip soft-hyphen (auto-wrap) characters from input string\n const renderedValue = value.replace(/\\u00ad/g, \"\");\n this._renderedText = Label.enableRightToLeftDetection\n ? reverseRtl(renderedValue)\n : renderedValue;\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.\n * @memberof Label.prototype\n * @type {String}\n * @default '30px sans-serif'\n * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-styles|HTML canvas 2D context text styles}\n */\n font: {\n get: function () {\n return this._font;\n },\n set: function (value) {\n if (this._font !== value) {\n this._font = value;\n rebindAllGlyphs(this);\n parseFont(this);\n }\n },\n },\n\n /**\n * Gets or sets the fill color of this label.\n * @memberof Label.prototype\n * @type {Color}\n * @default Color.WHITE\n * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n */\n fillColor: {\n get: function () {\n return this._fillColor;\n },\n set: function (value) {\n const fillColor = this._fillColor;\n if (!Color.equals(fillColor, value)) {\n Color.clone(value, fillColor);\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the outline color of this label.\n * @memberof Label.prototype\n * @type {Color}\n * @default Color.BLACK\n * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n */\n outlineColor: {\n get: function () {\n return this._outlineColor;\n },\n set: function (value) {\n const outlineColor = this._outlineColor;\n if (!Color.equals(outlineColor, value)) {\n Color.clone(value, outlineColor);\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the outline width of this label.\n * @memberof Label.prototype\n * @type {Number}\n * @default 1.0\n * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles|HTML canvas 2D context fill and stroke styles}\n */\n outlineWidth: {\n get: function () {\n return this._outlineWidth;\n },\n set: function (value) {\n if (this._outlineWidth !== value) {\n this._outlineWidth = value;\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Determines if a background behind this label will be shown.\n * @memberof Label.prototype\n * @default false\n * @type {Boolean}\n */\n showBackground: {\n get: function () {\n return this._showBackground;\n },\n set: function (value) {\n if (this._showBackground !== value) {\n this._showBackground = value;\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the background color of this label.\n * @memberof Label.prototype\n * @type {Color}\n * @default new Color(0.165, 0.165, 0.165, 0.8)\n */\n backgroundColor: {\n get: function () {\n return this._backgroundColor;\n },\n set: function (value) {\n const backgroundColor = this._backgroundColor;\n if (!Color.equals(backgroundColor, value)) {\n Color.clone(value, backgroundColor);\n\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.color = backgroundColor;\n }\n }\n },\n },\n\n /**\n * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value\n * controls horizontal padding, and the <code>y</code> value controls vertical padding.\n * @memberof Label.prototype\n * @type {Cartesian2}\n * @default new Cartesian2(7, 5)\n */\n backgroundPadding: {\n get: function () {\n return this._backgroundPadding;\n },\n set: function (value) {\n const backgroundPadding = this._backgroundPadding;\n if (!Cartesian2.equals(backgroundPadding, value)) {\n Cartesian2.clone(value, backgroundPadding);\n repositionAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the style of this label.\n * @memberof Label.prototype\n * @type {LabelStyle}\n * @default LabelStyle.FILL\n */\n style: {\n get: function () {\n return this._style;\n },\n set: function (value) {\n if (this._style !== value) {\n this._style = value;\n rebindAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used\n * to align multiple labels and billboards at the same position, e.g., an image and text. The\n * screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>\n * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>\n * </tr></table>\n * The label's origin is indicated by the yellow point.\n * </div>\n * @memberof Label.prototype\n * @type {Cartesian2}\n * @default Cartesian2.ZERO\n */\n pixelOffset: {\n get: function () {\n return this._pixelOffset;\n },\n set: function (value) {\n const pixelOffset = this._pixelOffset;\n if (!Cartesian2.equals(pixelOffset, value)) {\n Cartesian2.clone(value, pixelOffset);\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.pixelOffset = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.pixelOffset = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.\n * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,\n * translucencyByDistance will be disabled.\n * @memberof Label.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a label's translucencyByDistance to 1.0 when the\n * // camera is 1500 meters from the label and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable translucency by distance\n * text.translucencyByDistance = undefined;\n */\n translucencyByDistance: {\n get: function () {\n return this._translucencyByDistance;\n },\n set: function (value) {\n const translucencyByDistance = this._translucencyByDistance;\n if (!NearFarScalar.equals(translucencyByDistance, value)) {\n this._translucencyByDistance = NearFarScalar.clone(\n value,\n translucencyByDistance\n );\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.translucencyByDistance = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.translucencyByDistance = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.\n * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,\n * pixelOffsetScaleByDistance will be disabled.\n * @memberof Label.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a label's pixel offset scale to 0.0 when the\n * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels\n * // in the y direction the camera distance approaches 8.0e6 meters.\n * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);\n * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);\n *\n * @example\n * // Example 2.\n * // disable pixel offset by distance\n * text.pixelOffsetScaleByDistance = undefined;\n */\n pixelOffsetScaleByDistance: {\n get: function () {\n return this._pixelOffsetScaleByDistance;\n },\n set: function (value) {\n const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;\n if (!NearFarScalar.equals(pixelOffsetScaleByDistance, value)) {\n this._pixelOffsetScaleByDistance = NearFarScalar.clone(\n value,\n pixelOffsetScaleByDistance\n );\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.pixelOffsetScaleByDistance = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.pixelOffsetScaleByDistance = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.\n * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,\n * scaleByDistance will be disabled.\n * @memberof Label.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a label's scaleByDistance to scale by 1.5 when the\n * // camera is 1500 meters from the label and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable scaling by distance\n * label.scaleByDistance = undefined;\n */\n scaleByDistance: {\n get: function () {\n return this._scaleByDistance;\n },\n set: function (value) {\n const scaleByDistance = this._scaleByDistance;\n if (!NearFarScalar.equals(scaleByDistance, value)) {\n this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.scaleByDistance = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.scaleByDistance = value;\n }\n }\n },\n },\n\n /**\n * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed\n * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and\n * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,\n * which is typically meters.\n * <br /><br />\n * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to\n * arrange a label above its corresponding 3D model.\n * <br /><br />\n * Below, the label is positioned at the center of the Earth but an eye offset makes it always\n * appear on top of the Earth regardless of the viewer's or Earth's orientation.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>\n * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>\n * </tr></table>\n * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />\n * </div>\n * @memberof Label.prototype\n * @type {Cartesian3}\n * @default Cartesian3.ZERO\n */\n eyeOffset: {\n get: function () {\n return this._eyeOffset;\n },\n set: function (value) {\n const eyeOffset = this._eyeOffset;\n if (!Cartesian3.equals(eyeOffset, value)) {\n Cartesian3.clone(value, eyeOffset);\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.eyeOffset = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.eyeOffset = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets the horizontal origin of this label, which determines if the label is drawn\n * to the left, center, or right of its anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />\n * </div>\n * @memberof Label.prototype\n * @type {HorizontalOrigin}\n * @default HorizontalOrigin.LEFT\n * @example\n * // Use a top, right origin\n * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;\n * l.verticalOrigin = Cesium.VerticalOrigin.TOP;\n */\n horizontalOrigin: {\n get: function () {\n return this._horizontalOrigin;\n },\n set: function (value) {\n if (this._horizontalOrigin !== value) {\n this._horizontalOrigin = value;\n repositionAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the vertical origin of this label, which determines if the label is\n * to the above, below, or at the center of its anchor position.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />\n * </div>\n * @memberof Label.prototype\n * @type {VerticalOrigin}\n * @default VerticalOrigin.BASELINE\n * @example\n * // Use a top, right origin\n * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;\n * l.verticalOrigin = Cesium.VerticalOrigin.TOP;\n */\n verticalOrigin: {\n get: function () {\n return this._verticalOrigin;\n },\n set: function (value) {\n if (this._verticalOrigin !== value) {\n this._verticalOrigin = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.verticalOrigin = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.verticalOrigin = value;\n }\n\n repositionAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets or sets the uniform scale that is multiplied with the label's size in pixels.\n * A scale of <code>1.0</code> does not change the size of the label; a scale greater than\n * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks\n * the label.\n * <br /><br />\n * Applying a large scale value may pixelate the label. To make text larger without pixelation,\n * use a larger font size when calling {@link Label#font} instead.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>\n * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,\n * and <code>2.0</code>.\n * </div>\n * @memberof Label.prototype\n * @type {Number}\n * @default 1.0\n */\n scale: {\n get: function () {\n return this._scale;\n },\n set: function (value) {\n if (this._scale !== value) {\n this._scale = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.scale = value * this._relativeSize;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.scale = value * this._relativeSize;\n }\n\n repositionAllGlyphs(this);\n }\n },\n },\n\n /**\n * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size\n * of the desired font compared to the generated glyph size.\n * @memberof Label.prototype\n * @type {Number}\n * @default 1.0\n */\n totalScale: {\n get: function () {\n return this._scale * this._relativeSize;\n },\n },\n\n /**\n * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.\n * @memberof Label.prototype\n * @type {DistanceDisplayCondition}\n * @default undefined\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\nif (\n !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n ) {\n this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n value,\n this._distanceDisplayCondition\n );\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.distanceDisplayCondition = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.distanceDisplayCondition = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof Label.prototype\n * @type {Number}\n */\n disableDepthTestDistance: {\n get: function () {\n return this._disableDepthTestDistance;\n },\n set: function (value) {\n if (this._disableDepthTestDistance !== value) {\nthis._disableDepthTestDistance = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.disableDepthTestDistance = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.disableDepthTestDistance = value;\n }\n }\n },\n },\n\n /**\n * Gets or sets the user-defined value returned when the label is picked.\n * @memberof Label.prototype\n * @type {*}\n */\n id: {\n get: function () {\n return this._id;\n },\n set: function (value) {\n if (this._id !== value) {\n this._id = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.id = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.id = value;\n }\n }\n },\n },\n\n /**\n * @private\n */\n pickId: {\n get: function () {\n if (this._glyphs.length === 0 || !defined(this._glyphs[0].billboard)) {\n return undefined;\n }\n return this._glyphs[0].billboard.pickId;\n },\n },\n\n /**\n * Keeps track of the position of the label based on the height reference.\n * @memberof Label.prototype\n * @type {Cartesian3}\n * @private\n */\n _clampedPosition: {\n get: function () {\n return this._actualClampedPosition;\n },\n set: function (value) {\n this._actualClampedPosition = Cartesian3.clone(\n value,\n this._actualClampedPosition\n );\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n // Set all the private values here, because we already clamped to ground\n // so we don't want to do it again for every glyph\n glyph.billboard._clampedPosition = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard._clampedPosition = value;\n }\n },\n },\n\n /**\n * Determines whether or not this label will be shown or hidden because it was clustered.\n * @memberof Label.prototype\n * @type {Boolean}\n * @default true\n * @private\n */\n clusterShow: {\n get: function () {\n return this._clusterShow;\n },\n set: function (value) {\n if (this._clusterShow !== value) {\n this._clusterShow = value;\n\n const glyphs = this._glyphs;\n for (let i = 0, len = glyphs.length; i < len; i++) {\n const glyph = glyphs[i];\n if (defined(glyph.billboard)) {\n glyph.billboard.clusterShow = value;\n }\n }\n const backgroundBillboard = this._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n backgroundBillboard.clusterShow = value;\n }\n }\n },\n },\n});\n\nLabel.prototype._updateClamping = function () {\n Billboard._updateClamping(this._labelCollection, this);\n};\n\n/**\n * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene the label is in.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the label.\n *\n *\n * @example\n * console.log(l.computeScreenSpacePosition(scene).toString());\n *\n * @see Label#eyeOffset\n * @see Label#pixelOffset\n */\nLabel.prototype.computeScreenSpacePosition = function (scene, result) {\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const labelCollection = this._labelCollection;\n const modelMatrix = labelCollection.modelMatrix;\n const actualPosition = defined(this._actualClampedPosition)\n ? this._actualClampedPosition\n : this._position;\n\n const windowCoordinates = Billboard._computeScreenSpacePosition(\n modelMatrix,\n actualPosition,\n this._eyeOffset,\n this._pixelOffset,\n scene,\n result\n );\n return windowCoordinates;\n};\n\n/**\n * Gets a label's screen space bounding box centered around screenSpacePosition.\n * @param {Label} label The label to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nLabel.getScreenSpaceBoundingBox = function (\n label,\n screenSpacePosition,\n result\n) {\n let x = 0;\n let y = 0;\n let width = 0;\n let height = 0;\n const scale = label.totalScale;\n\n const backgroundBillboard = label._backgroundBillboard;\n if (defined(backgroundBillboard)) {\n x = screenSpacePosition.x + backgroundBillboard._translate.x;\n y = screenSpacePosition.y - backgroundBillboard._translate.y;\n width = backgroundBillboard.width * scale;\n height = backgroundBillboard.height * scale;\n\n if (\n label.verticalOrigin === VerticalOrigin.BOTTOM ||\n label.verticalOrigin === VerticalOrigin.BASELINE\n ) {\n y -= height;\n } else if (label.verticalOrigin === VerticalOrigin.CENTER) {\n y -= height * 0.5;\n }\n } else {\n x = Number.POSITIVE_INFINITY;\n y = Number.POSITIVE_INFINITY;\n let maxX = 0;\n let maxY = 0;\n const glyphs = label._glyphs;\n const length = glyphs.length;\n for (let i = 0; i < length; ++i) {\n const glyph = glyphs[i];\n const billboard = glyph.billboard;\n if (!defined(billboard)) {\n continue;\n }\n\n const glyphX = screenSpacePosition.x + billboard._translate.x;\n let glyphY = screenSpacePosition.y - billboard._translate.y;\n const glyphWidth = glyph.dimensions.width * scale;\n const glyphHeight = glyph.dimensions.height * scale;\n\n if (\n label.verticalOrigin === VerticalOrigin.BOTTOM ||\n label.verticalOrigin === VerticalOrigin.BASELINE\n ) {\n glyphY -= glyphHeight;\n } else if (label.verticalOrigin === VerticalOrigin.CENTER) {\n glyphY -= glyphHeight * 0.5;\n }\n\n if (label._verticalOrigin === VerticalOrigin.TOP) {\n glyphY += SDFSettings.PADDING * scale;\n } else if (\n label._verticalOrigin === VerticalOrigin.BOTTOM ||\n label._verticalOrigin === VerticalOrigin.BASELINE\n ) {\n glyphY -= SDFSettings.PADDING * scale;\n }\n\n x = Math.min(x, glyphX);\n y = Math.min(y, glyphY);\n maxX = Math.max(maxX, glyphX + glyphWidth);\n maxY = Math.max(maxY, glyphY + glyphHeight);\n }\n\n width = maxX - x;\n height = maxY - y;\n }\n\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n result.x = x;\n result.y = y;\n result.width = width;\n result.height = height;\n\n return result;\n};\n\n/**\n * Determines if this label equals another label. Labels are equal if all their properties\n * are equal. Labels in different collections can be equal.\n *\n * @param {Label} other The label to compare for equality.\n * @returns {Boolean} <code>true</code> if the labels are equal; otherwise, <code>false</code>.\n */\nLabel.prototype.equals = function (other) {\n return (\n this === other ||\n (defined(other) &&\n this._show === other._show &&\n this._scale === other._scale &&\n this._outlineWidth === other._outlineWidth &&\n this._showBackground === other._showBackground &&\n this._style === other._style &&\n this._verticalOrigin === other._verticalOrigin &&\n this._horizontalOrigin === other._horizontalOrigin &&\n this._heightReference === other._heightReference &&\n this._renderedText === other._renderedText &&\n this._font === other._font &&\n Cartesian3.equals(this._position, other._position) &&\n Color.equals(this._fillColor, other._fillColor) &&\n Color.equals(this._outlineColor, other._outlineColor) &&\n Color.equals(this._backgroundColor, other._backgroundColor) &&\n Cartesian2.equals(this._backgroundPadding, other._backgroundPadding) &&\n Cartesian2.equals(this._pixelOffset, other._pixelOffset) &&\n Cartesian3.equals(this._eyeOffset, other._eyeOffset) &&\n NearFarScalar.equals(\n this._translucencyByDistance,\n other._translucencyByDistance\n ) &&\n NearFarScalar.equals(\n this._pixelOffsetScaleByDistance,\n other._pixelOffsetScaleByDistance\n ) &&\n NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n DistanceDisplayCondition.equals(\n this._distanceDisplayCondition,\n other._distanceDisplayCondition\n ) &&\n this._disableDepthTestDistance === other._disableDepthTestDistance &&\n this._id === other._id)\n );\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nLabel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages\n * @memberof Label\n * @type {Boolean}\n * @default false\n *\n * @example\n * // Example 1.\n * // Set a label's rightToLeft before init\n * Cesium.Label.enableRightToLeftDetection = true;\n * const myLabelEntity = viewer.entities.add({\n * label: {\n * id: 'my label',\n * text: '\u05D6\u05D4 \u05D8\u05E7\u05E1\u05D8 \u05D1\u05E2\u05D1\u05E8\u05D9\u05EA \\n \u05D5\u05E2\u05DB\u05E9\u05D9\u05D5 \u05D9\u05D5\u05E8\u05D3\u05D9\u05DD \u05E9\u05D5\u05E8\u05D4',\n * }\n * });\n *\n * @example\n * // Example 2.\n * const myLabelEntity = viewer.entities.add({\n * label: {\n * id: 'my label',\n * text: 'English text'\n * }\n * });\n * // Set a label's rightToLeft after init\n * Cesium.Label.enableRightToLeftDetection = true;\n * myLabelEntity.text = '\u05D8\u05E7\u05E1\u05D8 \u05D7\u05D3\u05E9';\n */\nLabel.enableRightToLeftDetection = false;\n\nfunction convertTextToTypes(text, rtlChars) {\n const ltrChars = /[a-zA-Z0-9]/;\n const bracketsChars = /[()[\\]{}<>]/;\n const parsedText = [];\n let word = \"\";\n let lastType = textTypes.LTR;\n let currentType = \"\";\n const textLength = text.length;\n for (let textIndex = 0; textIndex < textLength; ++textIndex) {\n const character = text.charAt(textIndex);\n if (rtlChars.test(character)) {\n currentType = textTypes.RTL;\n } else if (ltrChars.test(character)) {\n currentType = textTypes.LTR;\n } else if (bracketsChars.test(character)) {\n currentType = textTypes.BRACKETS;\n } else {\n currentType = textTypes.WEAK;\n }\n\n if (textIndex === 0) {\n lastType = currentType;\n }\n\n if (lastType === currentType && currentType !== textTypes.BRACKETS) {\n word += character;\n } else {\n if (word !== \"\") {\n parsedText.push({ Type: lastType, Word: word });\n }\n lastType = currentType;\n word = character;\n }\n }\n parsedText.push({ Type: currentType, Word: word });\n return parsedText;\n}\n\nfunction reverseWord(word) {\n return word.split(\"\").reverse().join(\"\");\n}\n\nfunction spliceWord(result, pointer, word) {\n return result.slice(0, pointer) + word + result.slice(pointer);\n}\n\nfunction reverseBrackets(bracket) {\n switch (bracket) {\n case \"(\":\n return \")\";\n case \")\":\n return \"(\";\n case \"[\":\n return \"]\";\n case \"]\":\n return \"[\";\n case \"{\":\n return \"}\";\n case \"}\":\n return \"{\";\n case \"<\":\n return \">\";\n case \">\":\n return \"<\";\n }\n}\n\n//To add another language, simply add its Unicode block range(s) to the below regex.\nconst hebrew = \"\\u05D0-\\u05EA\";\nconst arabic = \"\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\";\nconst rtlChars = new RegExp(`[${hebrew}${arabic}]`);\n\n/**\n *\n * @param {String} value the text to parse and reorder\n * @returns {String} the text as rightToLeft direction\n * @private\n */\nfunction reverseRtl(value) {\n const texts = value.split(\"\\n\");\n let result = \"\";\n for (let i = 0; i < texts.length; i++) {\n const text = texts[i];\n // first character of the line is a RTL character, so need to manage different cases\n const rtlDir = rtlChars.test(text.charAt(0));\n const parsedText = convertTextToTypes(text, rtlChars);\n\n let splicePointer = 0;\n let line = \"\";\n for (let wordIndex = 0; wordIndex < parsedText.length; ++wordIndex) {\n const subText = parsedText[wordIndex];\n const reverse =\n subText.Type === textTypes.BRACKETS\n ? reverseBrackets(subText.Word)\n : reverseWord(subText.Word);\n if (rtlDir) {\n if (subText.Type === textTypes.RTL) {\n line = reverse + line;\n splicePointer = 0;\n } else if (subText.Type === textTypes.LTR) {\n line = spliceWord(line, splicePointer, subText.Word);\n splicePointer += subText.Word.length;\n } else if (\n subText.Type === textTypes.WEAK ||\n subText.Type === textTypes.BRACKETS\n ) {\n // current word is weak, last one was bracket\n if (\n subText.Type === textTypes.WEAK &&\n parsedText[wordIndex - 1].Type === textTypes.BRACKETS\n ) {\n line = reverse + line;\n }\n // current word is weak or bracket, last one was rtl\n else if (parsedText[wordIndex - 1].Type === textTypes.RTL) {\n line = reverse + line;\n splicePointer = 0;\n }\n // current word is weak or bracket, there is at least one more word\n else if (parsedText.length > wordIndex + 1) {\n // next word is rtl\n if (parsedText[wordIndex + 1].Type === textTypes.RTL) {\n line = reverse + line;\n splicePointer = 0;\n } else {\n line = spliceWord(line, splicePointer, subText.Word);\n splicePointer += subText.Word.length;\n }\n }\n // current word is weak or bracket, and it the last in this line\n else {\n line = spliceWord(line, 0, reverse);\n }\n }\n }\n // ltr line, rtl word\n else if (subText.Type === textTypes.RTL) {\n line = spliceWord(line, splicePointer, reverse);\n }\n // ltr line, ltr word\n else if (subText.Type === textTypes.LTR) {\n line += subText.Word;\n splicePointer = line.length;\n }\n // ltr line, weak or bracket word\n else if (\n subText.Type === textTypes.WEAK ||\n subText.Type === textTypes.BRACKETS\n ) {\n // not first word in line\n if (wordIndex > 0) {\n // last word was rtl\n if (parsedText[wordIndex - 1].Type === textTypes.RTL) {\n // there is at least one more word\n if (parsedText.length > wordIndex + 1) {\n // next word is rtl\n if (parsedText[wordIndex + 1].Type === textTypes.RTL) {\n line = spliceWord(line, splicePointer, reverse);\n } else {\n line += subText.Word;\n splicePointer = line.length;\n }\n } else {\n line += subText.Word;\n }\n } else {\n line += subText.Word;\n splicePointer = line.length;\n }\n } else {\n line += subText.Word;\n splicePointer = line.length;\n }\n }\n }\n\n result += line;\n if (i < texts.length - 1) {\n result += \"\\n\";\n }\n }\n return result;\n}\nexport default Label;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec3 position2DHigh;\\n\\\nattribute vec3 position2DLow;\\n\\\nattribute vec3 prevPosition3DHigh;\\n\\\nattribute vec3 prevPosition3DLow;\\n\\\nattribute vec3 prevPosition2DHigh;\\n\\\nattribute vec3 prevPosition2DLow;\\n\\\nattribute vec3 nextPosition3DHigh;\\n\\\nattribute vec3 nextPosition3DLow;\\n\\\nattribute vec3 nextPosition2DHigh;\\n\\\nattribute vec3 nextPosition2DLow;\\n\\\nattribute vec4 texCoordExpandAndBatchIndex;\\n\\\nvarying vec2 v_st;\\n\\\nvarying float v_width;\\n\\\nvarying vec4 v_pickColor;\\n\\\nvarying float v_polylineAngle;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat texCoord = texCoordExpandAndBatchIndex.x;\\n\\\nfloat expandDir = texCoordExpandAndBatchIndex.y;\\n\\\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\\n\\\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\\n\\\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\\n\\\nfloat width = widthAndShow.x + 0.5;\\n\\\nfloat show = widthAndShow.y;\\n\\\nif (width < 1.0)\\n\\\n{\\n\\\nshow = 0.0;\\n\\\n}\\n\\\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\\n\\\nvec4 p, prev, next;\\n\\\nif (czm_morphTime == 1.0)\\n\\\n{\\n\\\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\\n\\\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\\n\\\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\\n\\\n}\\n\\\nelse if (czm_morphTime == 0.0)\\n\\\n{\\n\\\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\\n\\\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\\n\\\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\np = czm_columbusViewMorph(\\n\\\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\\n\\\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\\n\\\nczm_morphTime);\\n\\\nprev = czm_columbusViewMorph(\\n\\\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\\n\\\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\\n\\\nczm_morphTime);\\n\\\nnext = czm_columbusViewMorph(\\n\\\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\\n\\\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\\n\\\nczm_morphTime);\\n\\\n}\\n\\\n#ifdef DISTANCE_DISPLAY_CONDITION\\n\\\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\\n\\\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\\n\\\nvec3 centerLow = centerLowAndRadius.xyz;\\n\\\nfloat radius = centerLowAndRadius.w;\\n\\\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\\n\\\nfloat lengthSq;\\n\\\nif (czm_sceneMode == czm_sceneMode2D)\\n\\\n{\\n\\\nlengthSq = czm_eyeHeight2D.y;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\\n\\\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\\n\\\n}\\n\\\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\\n\\\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\\n\\\nif (lengthSq < nearSq || lengthSq > farSq)\\n\\\n{\\n\\\nshow = 0.0;\\n\\\n}\\n\\\n#endif\\n\\\nfloat polylineAngle;\\n\\\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\\n\\\ngl_Position = czm_viewportOrthographic * positionWC * show;\\n\\\nv_st.s = texCoord;\\n\\\nv_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\\n\\\nv_width = width;\\n\\\nv_pickColor = pickColor;\\n\\\nv_polylineAngle = polylineAngle;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport IntersectionTests from \"./IntersectionTests.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Plane from \"./Plane.js\";\n\n/**\n * @private\n */\nconst PolylinePipeline = {};\n\nPolylinePipeline.numberOfPoints = function (p0, p1, minDistance) {\n const distance = Cartesian3.distance(p0, p1);\n return Math.ceil(distance / minDistance);\n};\n\nPolylinePipeline.numberOfPointsRhumbLine = function (p0, p1, granularity) {\n const radiansDistanceSquared =\n Math.pow(p0.longitude - p1.longitude, 2) +\n Math.pow(p0.latitude - p1.latitude, 2);\n\n return Math.max(\n 1,\n Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))\n );\n};\n\nconst cartoScratch = new Cartographic();\nPolylinePipeline.extractHeights = function (positions, ellipsoid) {\n const length = positions.length;\n const heights = new Array(length);\n for (let i = 0; i < length; i++) {\n const p = positions[i];\n heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;\n }\n return heights;\n};\n\nconst wrapLongitudeInversMatrix = new Matrix4();\nconst wrapLongitudeOrigin = new Cartesian3();\nconst wrapLongitudeXZNormal = new Cartesian3();\nconst wrapLongitudeXZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst wrapLongitudeYZNormal = new Cartesian3();\nconst wrapLongitudeYZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst wrapLongitudeIntersection = new Cartesian3();\nconst wrapLongitudeOffset = new Cartesian3();\n\nconst subdivideHeightsScratchArray = [];\n\nfunction subdivideHeights(numPoints, h0, h1) {\n const heights = subdivideHeightsScratchArray;\n heights.length = numPoints;\n\n let i;\n if (h0 === h1) {\n for (i = 0; i < numPoints; i++) {\n heights[i] = h0;\n }\n return heights;\n }\n\n const dHeight = h1 - h0;\n const heightPerVertex = dHeight / numPoints;\n\n for (i = 0; i < numPoints; i++) {\n const h = h0 + i * heightPerVertex;\n heights[i] = h;\n }\n\n return heights;\n}\n\nconst carto1 = new Cartographic();\nconst carto2 = new Cartographic();\nconst cartesian = new Cartesian3();\nconst scaleFirst = new Cartesian3();\nconst scaleLast = new Cartesian3();\nconst ellipsoidGeodesic = new EllipsoidGeodesic();\nlet ellipsoidRhumb = new EllipsoidRhumbLine();\n\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\n//Result includes p1, but not include p2. This function is called for a sequence of line segments,\n//and this prevents duplication of end point.\nfunction generateCartesianArc(\n p0,\n p1,\n minDistance,\n ellipsoid,\n h0,\n h1,\n array,\n offset\n) {\n const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);\n const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);\n const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\n const start = ellipsoid.cartesianToCartographic(first, carto1);\n const end = ellipsoid.cartesianToCartographic(last, carto2);\n const heights = subdivideHeights(numPoints, h0, h1);\n\n ellipsoidGeodesic.setEndPoints(start, end);\n const surfaceDistanceBetweenPoints =\n ellipsoidGeodesic.surfaceDistance / numPoints;\n\n let index = offset;\n start.height = h0;\n let cart = ellipsoid.cartographicToCartesian(start, cartesian);\n Cartesian3.pack(cart, array, index);\n index += 3;\n\n for (let i = 1; i < numPoints; i++) {\n const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\n i * surfaceDistanceBetweenPoints,\n carto2\n );\n carto.height = heights[i];\n cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n Cartesian3.pack(cart, array, index);\n index += 3;\n }\n\n return index;\n}\n\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\n//Result includes p1, but not include p2. This function is called for a sequence of line segments,\n//and this prevents duplication of end point.\nfunction generateCartesianRhumbArc(\n p0,\n p1,\n granularity,\n ellipsoid,\n h0,\n h1,\n array,\n offset\n) {\n const start = ellipsoid.cartesianToCartographic(p0, carto1);\n const end = ellipsoid.cartesianToCartographic(p1, carto2);\n const numPoints = PolylinePipeline.numberOfPointsRhumbLine(\n start,\n end,\n granularity\n );\n start.height = 0.0;\n end.height = 0.0;\n const heights = subdivideHeights(numPoints, h0, h1);\n\n if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {\n ellipsoidRhumb = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n }\n ellipsoidRhumb.setEndPoints(start, end);\n const surfaceDistanceBetweenPoints =\n ellipsoidRhumb.surfaceDistance / numPoints;\n\n let index = offset;\n start.height = h0;\n let cart = ellipsoid.cartographicToCartesian(start, cartesian);\n Cartesian3.pack(cart, array, index);\n index += 3;\n\n for (let i = 1; i < numPoints; i++) {\n const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(\n i * surfaceDistanceBetweenPoints,\n carto2\n );\n carto.height = heights[i];\n cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n Cartesian3.pack(cart, array, index);\n index += 3;\n }\n\n return index;\n}\n\n/**\n * Breaks a {@link Polyline} into segments such that it does not cross the ±180 degree meridian of an ellipsoid.\n *\n * @param {Cartesian3[]} positions The polyline's Cartesian positions.\n * @param {Matrix4} [modelMatrix=Matrix4.IDENTITY] The polyline's model matrix. Assumed to be an affine\n * transformation matrix, where the upper left 3x3 elements are a rotation matrix, and\n * the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1].\n * The matrix is not verified to be in the proper form.\n * @returns {Object} An object with a <code>positions</code> property that is an array of positions and a\n * <code>segments</code> property.\n *\n *\n * @example\n * const polylines = new Cesium.PolylineCollection();\n * const polyline = polylines.add(...);\n * const positions = polyline.positions;\n * const modelMatrix = polylines.modelMatrix;\n * const segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);\n *\n * @see PolygonPipeline.wrapLongitude\n * @see Polyline\n * @see PolylineCollection\n */\nPolylinePipeline.wrapLongitude = function (positions, modelMatrix) {\n const cartesians = [];\n const segments = [];\n\n if (defined(positions) && positions.length > 0) {\n modelMatrix = defaultValue(modelMatrix, Matrix4.IDENTITY);\n const inverseModelMatrix = Matrix4.inverseTransformation(\n modelMatrix,\n wrapLongitudeInversMatrix\n );\n\n const origin = Matrix4.multiplyByPoint(\n inverseModelMatrix,\n Cartesian3.ZERO,\n wrapLongitudeOrigin\n );\n const xzNormal = Cartesian3.normalize(\n Matrix4.multiplyByPointAsVector(\n inverseModelMatrix,\n Cartesian3.UNIT_Y,\n wrapLongitudeXZNormal\n ),\n wrapLongitudeXZNormal\n );\n const xzPlane = Plane.fromPointNormal(\n origin,\n xzNormal,\n wrapLongitudeXZPlane\n );\n const yzNormal = Cartesian3.normalize(\n Matrix4.multiplyByPointAsVector(\n inverseModelMatrix,\n Cartesian3.UNIT_X,\n wrapLongitudeYZNormal\n ),\n wrapLongitudeYZNormal\n );\n const yzPlane = Plane.fromPointNormal(\n origin,\n yzNormal,\n wrapLongitudeYZPlane\n );\n\n let count = 1;\n cartesians.push(Cartesian3.clone(positions[0]));\n let prev = cartesians[0];\n\n const length = positions.length;\n for (let i = 1; i < length; ++i) {\n const cur = positions[i];\n\n // intersects the IDL if either endpoint is on the negative side of the yz-plane\n if (\n Plane.getPointDistance(yzPlane, prev) < 0.0 ||\n Plane.getPointDistance(yzPlane, cur) < 0.0\n ) {\n // and intersects the xz-plane\n const intersection = IntersectionTests.lineSegmentPlane(\n prev,\n cur,\n xzPlane,\n wrapLongitudeIntersection\n );\n if (defined(intersection)) {\n // move point on the xz-plane slightly away from the plane\n const offset = Cartesian3.multiplyByScalar(\n xzNormal,\n 5.0e-9,\n wrapLongitudeOffset\n );\n if (Plane.getPointDistance(xzPlane, prev) < 0.0) {\n Cartesian3.negate(offset, offset);\n }\n\n cartesians.push(\n Cartesian3.add(intersection, offset, new Cartesian3())\n );\n segments.push(count + 1);\n\n Cartesian3.negate(offset, offset);\n cartesians.push(\n Cartesian3.add(intersection, offset, new Cartesian3())\n );\n count = 1;\n }\n }\n\n cartesians.push(Cartesian3.clone(positions[i]));\n count++;\n\n prev = cur;\n }\n\n segments.push(count);\n }\n\n return {\n positions: cartesians,\n lengths: segments,\n };\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions.\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 40.0,\n * -100.0, 38.0,\n * -105.0, 35.0,\n * -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateArc({\n * positons: positions\n * });\n */\nPolylinePipeline.generateArc = function (options) {\n if (!defined(options)) {\n options = {};\n }\n const positions = options.positions;\n const length = positions.length;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n let height = defaultValue(options.height, 0);\n const hasHeightArray = Array.isArray(height);\n\n if (length < 1) {\n return [];\n } else if (length === 1) {\n const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\n height = hasHeightArray ? height[0] : height;\n if (height !== 0) {\n const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\n Cartesian3.multiplyByScalar(n, height, n);\n Cartesian3.add(p, n, p);\n }\n\n return [p.x, p.y, p.z];\n }\n\n let minDistance = options.minDistance;\n if (!defined(minDistance)) {\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n minDistance = CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\n }\n\n let numPoints = 0;\n let i;\n\n for (i = 0; i < length - 1; i++) {\n numPoints += PolylinePipeline.numberOfPoints(\n positions[i],\n positions[i + 1],\n minDistance\n );\n }\n\n const arrayLength = (numPoints + 1) * 3;\n const newPositions = new Array(arrayLength);\n let offset = 0;\n\n for (i = 0; i < length - 1; i++) {\n const p0 = positions[i];\n const p1 = positions[i + 1];\n\n const h0 = hasHeightArray ? height[i] : height;\n const h1 = hasHeightArray ? height[i + 1] : height;\n\n offset = generateCartesianArc(\n p0,\n p1,\n minDistance,\n ellipsoid,\n h0,\n h1,\n newPositions,\n offset\n );\n }\n\n subdivideHeightsScratchArray.length = 0;\n\n const lastPoint = positions[length - 1];\n const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\n carto.height = hasHeightArray ? height[length - 1] : height;\n const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n Cartesian3.pack(cart, newPositions, arrayLength - 3);\n\n return newPositions;\n};\n\nconst scratchCartographic0 = new Cartographic();\nconst scratchCartographic1 = new Cartographic();\n\n/**\n * Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 40.0,\n * -100.0, 38.0,\n * -105.0, 35.0,\n * -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({\n * positons: positions\n * });\n */\nPolylinePipeline.generateRhumbArc = function (options) {\n if (!defined(options)) {\n options = {};\n }\n const positions = options.positions;\n const length = positions.length;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n let height = defaultValue(options.height, 0);\n const hasHeightArray = Array.isArray(height);\n\n if (length < 1) {\n return [];\n } else if (length === 1) {\n const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\n height = hasHeightArray ? height[0] : height;\n if (height !== 0) {\n const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\n Cartesian3.multiplyByScalar(n, height, n);\n Cartesian3.add(p, n, p);\n }\n\n return [p.x, p.y, p.z];\n }\n\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n\n let numPoints = 0;\n let i;\n\n let c0 = ellipsoid.cartesianToCartographic(\n positions[0],\n scratchCartographic0\n );\n let c1;\n for (i = 0; i < length - 1; i++) {\n c1 = ellipsoid.cartesianToCartographic(\n positions[i + 1],\n scratchCartographic1\n );\n numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);\n c0 = Cartographic.clone(c1, scratchCartographic0);\n }\n\n const arrayLength = (numPoints + 1) * 3;\n const newPositions = new Array(arrayLength);\n let offset = 0;\n\n for (i = 0; i < length - 1; i++) {\n const p0 = positions[i];\n const p1 = positions[i + 1];\n\n const h0 = hasHeightArray ? height[i] : height;\n const h1 = hasHeightArray ? height[i + 1] : height;\n\n offset = generateCartesianRhumbArc(\n p0,\n p1,\n granularity,\n ellipsoid,\n h0,\n h1,\n newPositions,\n offset\n );\n }\n\n subdivideHeightsScratchArray.length = 0;\n\n const lastPoint = positions[length - 1];\n const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\n carto.height = hasHeightArray ? height[length - 1] : height;\n const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\n Cartesian3.pack(cart, newPositions, arrayLength - 3);\n\n return newPositions;\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 40.0,\n * -100.0, 38.0,\n * -105.0, 35.0,\n * -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({\n * positons: positions\n * });\n */\nPolylinePipeline.generateCartesianArc = function (options) {\n const numberArray = PolylinePipeline.generateArc(options);\n const size = numberArray.length / 3;\n const newPositions = new Array(size);\n for (let i = 0; i < size; i++) {\n newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\n }\n return newPositions;\n};\n\n/**\n * Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\n *\n * @example\n * const positions = Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 40.0,\n * -100.0, 38.0,\n * -105.0, 35.0,\n * -100.0, 32.0\n * ]);\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({\n * positons: positions\n * });\n */\nPolylinePipeline.generateCartesianRhumbArc = function (options) {\n const numberArray = PolylinePipeline.generateRhumbArc(options);\n const size = numberArray.length / 3;\n const newPositions = new Array(size);\n for (let i = 0; i < size; i++) {\n newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\n }\n return newPositions;\n};\nexport default PolylinePipeline;\n", "import arrayRemoveDuplicates from \"../Core/arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PolylinePipeline from \"../Core/PolylinePipeline.js\";\nimport Material from \"./Material.js\";\n\n/**\n * <div class=\"notice\">\n * Create this by calling {@link PolylineCollection#add}. Do not call the constructor directly.\n * </div>\n *\n * A renderable polyline.\n *\n * @alias Polyline\n * @internalConstructor\n * @class\n *\n * @privateParam {Object} options Object with the following properties:\n * @privateParam {Boolean} [options.show=true] <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.\n * @privateParam {Number} [options.width=1.0] The width of the polyline in pixels.\n * @privateParam {Boolean} [options.loop=false] Whether a line segment will be added between the last and first line positions to make this line a loop.\n * @privateParam {Material} [options.material=Material.ColorType] The material.\n * @privateParam {Cartesian3[]} [options.positions] The positions.\n * @privateParam {Object} [options.id] The user-defined object to be returned when this polyline is picked.\n * @privateParam {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this polyline will be displayed.\n * @privateParam {PolylineCollection} polylineCollection The renderable polyline collection.\n *\n * @see PolylineCollection\n *\n */\nfunction Polyline(options, polylineCollection) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._show = defaultValue(options.show, true);\n this._width = defaultValue(options.width, 1.0);\n this._loop = defaultValue(options.loop, false);\n this._distanceDisplayCondition = options.distanceDisplayCondition;\n\n this._material = options.material;\n if (!defined(this._material)) {\n this._material = Material.fromType(Material.ColorType, {\n color: new Color(1.0, 1.0, 1.0, 1.0),\n });\n }\n\n let positions = options.positions;\n if (!defined(positions)) {\n positions = [];\n }\n\n this._positions = positions;\n this._actualPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n\n if (this._loop && this._actualPositions.length > 2) {\n if (this._actualPositions === this._positions) {\n this._actualPositions = positions.slice();\n }\n this._actualPositions.push(Cartesian3.clone(this._actualPositions[0]));\n }\n\n this._length = this._actualPositions.length;\n this._id = options.id;\n\n let modelMatrix;\n if (defined(polylineCollection)) {\n modelMatrix = Matrix4.clone(polylineCollection.modelMatrix);\n }\n\n this._modelMatrix = modelMatrix;\n this._segments = PolylinePipeline.wrapLongitude(\n this._actualPositions,\n modelMatrix\n );\n\n this._actualLength = undefined;\n\n // eslint-disable-next-line no-use-before-define\n this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n this._polylineCollection = polylineCollection;\n this._dirty = false;\n this._pickId = undefined;\n this._boundingVolume = BoundingSphere.fromPoints(this._actualPositions);\n this._boundingVolumeWC = BoundingSphere.transform(\n this._boundingVolume,\n this._modelMatrix\n );\n this._boundingVolume2D = new BoundingSphere(); // modified in PolylineCollection\n}\n\nconst POSITION_INDEX = (Polyline.POSITION_INDEX = 0);\nconst SHOW_INDEX = (Polyline.SHOW_INDEX = 1);\nconst WIDTH_INDEX = (Polyline.WIDTH_INDEX = 2);\nconst MATERIAL_INDEX = (Polyline.MATERIAL_INDEX = 3);\nconst POSITION_SIZE_INDEX = (Polyline.POSITION_SIZE_INDEX = 4);\nconst DISTANCE_DISPLAY_CONDITION = (Polyline.DISTANCE_DISPLAY_CONDITION = 5);\nconst NUMBER_OF_PROPERTIES = (Polyline.NUMBER_OF_PROPERTIES = 6);\n\nfunction makeDirty(polyline, propertyChanged) {\n ++polyline._propertiesChanged[propertyChanged];\n const polylineCollection = polyline._polylineCollection;\n if (defined(polylineCollection)) {\n polylineCollection._updatePolyline(polyline, propertyChanged);\n polyline._dirty = true;\n }\n}\n\nObject.defineProperties(Polyline.prototype, {\n /**\n * Determines if this polyline will be shown. Use this to hide or show a polyline, instead\n * of removing it and re-adding it to the collection.\n * @memberof Polyline.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (value !== this._show) {\n this._show = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the positions of the polyline.\n * @memberof Polyline.prototype\n * @type {Cartesian3[]}\n * @example\n * polyline.positions = Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 10.0, 0.0,\n * 0.0, 20.0\n * ]);\n */\n positions: {\n get: function () {\n return this._positions;\n },\n set: function (value) {\n let positions = arrayRemoveDuplicates(value, Cartesian3.equalsEpsilon);\n\n if (this._loop && positions.length > 2) {\n if (positions === value) {\n positions = value.slice();\n }\n positions.push(Cartesian3.clone(positions[0]));\n }\n\n if (\n this._actualPositions.length !== positions.length ||\n this._actualPositions.length !== this._length\n ) {\n makeDirty(this, POSITION_SIZE_INDEX);\n }\n\n this._positions = value;\n this._actualPositions = positions;\n this._length = positions.length;\n this._boundingVolume = BoundingSphere.fromPoints(\n this._actualPositions,\n this._boundingVolume\n );\n this._boundingVolumeWC = BoundingSphere.transform(\n this._boundingVolume,\n this._modelMatrix,\n this._boundingVolumeWC\n );\n makeDirty(this, POSITION_INDEX);\n\n this.update();\n },\n },\n\n /**\n * Gets or sets the surface appearance of the polyline. This can be one of several built-in {@link Material} objects or a custom material, scripted with\n * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n * @memberof Polyline.prototype\n * @type {Material}\n */\n material: {\n get: function () {\n return this._material;\n },\n set: function (material) {\n if (this._material !== material) {\n this._material = material;\n makeDirty(this, MATERIAL_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the width of the polyline.\n * @memberof Polyline.prototype\n * @type {Number}\n */\n width: {\n get: function () {\n return this._width;\n },\n set: function (value) {\n const width = this._width;\n if (value !== width) {\n this._width = value;\n makeDirty(this, WIDTH_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets whether a line segment will be added between the first and last polyline positions.\n * @memberof Polyline.prototype\n * @type {Boolean}\n */\n loop: {\n get: function () {\n return this._loop;\n },\n set: function (value) {\n if (value !== this._loop) {\n let positions = this._actualPositions;\n if (value) {\n if (\n positions.length > 2 &&\n !Cartesian3.equals(positions[0], positions[positions.length - 1])\n ) {\n if (positions.length === this._positions.length) {\n this._actualPositions = positions = this._positions.slice();\n }\n positions.push(Cartesian3.clone(positions[0]));\n }\n } else if (\n positions.length > 2 &&\n Cartesian3.equals(positions[0], positions[positions.length - 1])\n ) {\n if (positions.length - 1 === this._positions.length) {\n this._actualPositions = this._positions;\n } else {\n positions.pop();\n }\n }\n\n this._loop = value;\n makeDirty(this, POSITION_SIZE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the user-defined value returned when the polyline is picked.\n * @memberof Polyline.prototype\n * @type {*}\n */\n id: {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this._id = value;\n if (defined(this._pickId)) {\n this._pickId.object.id = value;\n }\n },\n },\n\n /**\n * @private\n */\n pickId: {\n get: function () {\n return this._pickId;\n },\n },\n\n /**\n * Gets the destruction status of this polyline\n * @memberof Polyline.prototype\n * @type {Boolean}\n * @default false\n * @private\n */\n isDestroyed: {\n get: function () {\n return !defined(this._polylineCollection);\n },\n },\n\n /**\n * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.\n * @memberof Polyline.prototype\n * @type {DistanceDisplayCondition}\n * @default undefined\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\nif (\n !DistanceDisplayCondition.equals(value, this._distanceDisplayCondition)\n ) {\n this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n value,\n this._distanceDisplayCondition\n );\n makeDirty(this, DISTANCE_DISPLAY_CONDITION);\n }\n },\n },\n});\n\n/**\n * @private\n */\nPolyline.prototype.update = function () {\n let modelMatrix = Matrix4.IDENTITY;\n if (defined(this._polylineCollection)) {\n modelMatrix = this._polylineCollection.modelMatrix;\n }\n\n const segmentPositionsLength = this._segments.positions.length;\n const segmentLengths = this._segments.lengths;\n\n const positionsChanged =\n this._propertiesChanged[POSITION_INDEX] > 0 ||\n this._propertiesChanged[POSITION_SIZE_INDEX] > 0;\n if (!Matrix4.equals(modelMatrix, this._modelMatrix) || positionsChanged) {\n this._segments = PolylinePipeline.wrapLongitude(\n this._actualPositions,\n modelMatrix\n );\n this._boundingVolumeWC = BoundingSphere.transform(\n this._boundingVolume,\n modelMatrix,\n this._boundingVolumeWC\n );\n }\n\n this._modelMatrix = Matrix4.clone(modelMatrix, this._modelMatrix);\n\n if (this._segments.positions.length !== segmentPositionsLength) {\n // number of positions changed\n makeDirty(this, POSITION_SIZE_INDEX);\n } else {\n const length = segmentLengths.length;\n for (let i = 0; i < length; ++i) {\n if (segmentLengths[i] !== this._segments.lengths[i]) {\n // indices changed\n makeDirty(this, POSITION_SIZE_INDEX);\n break;\n }\n }\n }\n};\n\n/**\n * @private\n */\nPolyline.prototype.getPickId = function (context) {\n if (!defined(this._pickId)) {\n this._pickId = context.createPickId({\n primitive: this,\n collection: this._polylineCollection,\n id: this._id,\n });\n }\n return this._pickId;\n};\n\nPolyline.prototype._clean = function () {\n this._dirty = false;\n const properties = this._propertiesChanged;\n for (let k = 0; k < NUMBER_OF_PROPERTIES - 1; ++k) {\n properties[k] = 0;\n }\n};\n\nPolyline.prototype._destroy = function () {\n this._pickId = this._pickId && this._pickId.destroy();\n this._material = this._material && this._material.destroy();\n this._polylineCollection = undefined;\n};\nexport default Polyline;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Plane from \"../Core/Plane.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport PolylineFS from \"../Shaders/PolylineFS.js\";\nimport PolylineVS from \"../Shaders/PolylineVS.js\";\nimport BatchTable from \"./BatchTable.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Material from \"./Material.js\";\nimport Polyline from \"./Polyline.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst SHOW_INDEX = Polyline.SHOW_INDEX;\nconst WIDTH_INDEX = Polyline.WIDTH_INDEX;\nconst POSITION_INDEX = Polyline.POSITION_INDEX;\nconst MATERIAL_INDEX = Polyline.MATERIAL_INDEX;\n//POSITION_SIZE_INDEX is needed for when the polyline's position array changes size.\n//When it does, we need to recreate the indicesBuffer.\nconst POSITION_SIZE_INDEX = Polyline.POSITION_SIZE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION = Polyline.DISTANCE_DISPLAY_CONDITION;\nconst NUMBER_OF_PROPERTIES = Polyline.NUMBER_OF_PROPERTIES;\n\nconst attributeLocations = {\n texCoordExpandAndBatchIndex: 0,\n position3DHigh: 1,\n position3DLow: 2,\n position2DHigh: 3,\n position2DLow: 4,\n prevPosition3DHigh: 5,\n prevPosition3DLow: 6,\n prevPosition2DHigh: 7,\n prevPosition2DLow: 8,\n nextPosition3DHigh: 9,\n nextPosition3DLow: 10,\n nextPosition2DHigh: 11,\n nextPosition2DLow: 12,\n};\n\n/**\n * A renderable collection of polylines.\n * <br /><br />\n * <div align=\"center\">\n * <img src=\"Images/Polyline.png\" width=\"400\" height=\"300\" /><br />\n * Example polylines\n * </div>\n * <br /><br />\n * Polylines are added and removed from the collection using {@link PolylineCollection#add}\n * and {@link PolylineCollection#remove}.\n *\n * @alias PolylineCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each polyline from model to world coordinates.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {Boolean} [options.show=true] Determines if the polylines in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many polylines, to\n * many collections with only a few polylines each. Organize collections so that polylines\n * with the same update frequency are in the same collection, i.e., polylines that do not\n * change should be in one collection; polylines that change every frame should be in another\n * collection; and so on.\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#remove\n * @see Polyline\n * @see LabelCollection\n *\n * @example\n * // Create a polyline collection with two polylines\n * const polylines = new Cesium.PolylineCollection();\n * polylines.add({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -75.10, 39.57,\n * -77.02, 38.53,\n * -80.50, 35.14,\n * -80.12, 25.46]),\n * width : 2\n * });\n *\n * polylines.add({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -73.10, 37.57,\n * -75.02, 36.53,\n * -78.50, 33.14,\n * -78.12, 23.46]),\n * width : 4\n * });\n */\nfunction PolylineCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Determines if polylines in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.\n * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type {Matrix4}\n * @default {@link Matrix4.IDENTITY}\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n this._opaqueRS = undefined;\n this._translucentRS = undefined;\n\n this._colorCommands = [];\n\n this._polylinesUpdated = false;\n this._polylinesRemoved = false;\n this._createVertexArray = false;\n this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n this._polylines = [];\n this._polylineBuckets = {};\n\n // The buffer usage is determined based on the usage of the attribute over time.\n this._positionBufferUsage = {\n bufferUsage: BufferUsage.STATIC_DRAW,\n frameCount: 0,\n };\n\n this._mode = undefined;\n\n this._polylinesToUpdate = [];\n this._vertexArrays = [];\n this._positionBuffer = undefined;\n this._texCoordExpandAndBatchIndexBuffer = undefined;\n\n this._batchTable = undefined;\n this._createBatchTable = false;\n\n // Only used by Vector3DTilePoints\n this._useHighlightColor = false;\n this._highlightColor = Color.clone(Color.WHITE);\n\n const that = this;\n this._uniformMap = {\n u_highlightColor: function () {\n return that._highlightColor;\n },\n };\n}\n\nObject.defineProperties(PolylineCollection.prototype, {\n /**\n * Returns the number of polylines in this collection. This is commonly used with\n * {@link PolylineCollection#get} to iterate over all the polylines\n * in the collection.\n * @memberof PolylineCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n removePolylines(this);\n return this._polylines.length;\n },\n },\n});\n\n/**\n * Creates and adds a polyline with the specified initial properties to the collection.\n * The added polyline is returned so it can be modified or removed from the collection later.\n *\n * @param {Object}[options] A template describing the polyline's properties as shown in Example 1.\n * @returns {Polyline} The polyline that was added to the collection.\n *\n * @performance After calling <code>add</code>, {@link PolylineCollection#update} is called and\n * the collection's vertex buffer is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.\n * For best performance, add as many polylines as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1: Add a polyline, specifying all the default values.\n * const p = polylines.add({\n * show : true,\n * positions : ellipsoid.cartographicArrayToCartesianArray([\n Cesium.Cartographic.fromDegrees(-75.10, 39.57),\n Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),\n * width : 1\n * });\n *\n * @see PolylineCollection#remove\n * @see PolylineCollection#removeAll\n * @see PolylineCollection#update\n */\nPolylineCollection.prototype.add = function (options) {\n const p = new Polyline(options, this);\n p._index = this._polylines.length;\n this._polylines.push(p);\n this._createVertexArray = true;\n this._createBatchTable = true;\n return p;\n};\n\n/**\n * Removes a polyline from the collection.\n *\n * @param {Polyline} polyline The polyline to remove.\n * @returns {Boolean} <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.\n *\n * @performance After calling <code>remove</code>, {@link PolylineCollection#update} is called and\n * the collection's vertex buffer is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead.\n * For best performance, remove as many polylines as possible before calling <code>update</code>.\n * If you intend to temporarily hide a polyline, it is usually more efficient to call\n * {@link Polyline#show} instead of removing and re-adding the polyline.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const p = polylines.add(...);\n * polylines.remove(p); // Returns true\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#removeAll\n * @see PolylineCollection#update\n * @see Polyline#show\n */\nPolylineCollection.prototype.remove = function (polyline) {\n if (this.contains(polyline)) {\n this._polylinesRemoved = true;\n this._createVertexArray = true;\n this._createBatchTable = true;\n if (defined(polyline._bucket)) {\n const bucket = polyline._bucket;\n bucket.shaderProgram =\n bucket.shaderProgram && bucket.shaderProgram.destroy();\n }\n polyline._destroy();\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all polylines from the collection.\n *\n * @performance <code>O(n)</code>. It is more efficient to remove all the polylines\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * polylines.add(...);\n * polylines.add(...);\n * polylines.removeAll();\n *\n * @see PolylineCollection#add\n * @see PolylineCollection#remove\n * @see PolylineCollection#update\n */\nPolylineCollection.prototype.removeAll = function () {\n releaseShaders(this);\n destroyPolylines(this);\n this._polylineBuckets = {};\n this._polylinesRemoved = false;\n this._polylines.length = 0;\n this._polylinesToUpdate.length = 0;\n this._createVertexArray = true;\n};\n\n/**\n * Determines if this collection contains the specified polyline.\n *\n * @param {Polyline} polyline The polyline to check for.\n * @returns {Boolean} true if this collection contains the polyline, false otherwise.\n *\n * @see PolylineCollection#get\n */\nPolylineCollection.prototype.contains = function (polyline) {\n return defined(polyline) && polyline._polylineCollection === this;\n};\n\n/**\n * Returns the polyline in the collection at the specified index. Indices are zero-based\n * and increase as polylines are added. Removing a polyline shifts all polylines after\n * it to the left, changing their indices. This function is commonly used with\n * {@link PolylineCollection#length} to iterate over all the polylines\n * in the collection.\n *\n * @param {Number} index The zero-based index of the polyline.\n * @returns {Polyline} The polyline at the specified index.\n *\n * @performance If polylines were removed from the collection and\n * {@link PolylineCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * // Toggle the show property of every polyline in the collection\n * const len = polylines.length;\n * for (let i = 0; i < len; ++i) {\n * const p = polylines.get(i);\n * p.show = !p.show;\n * }\n *\n * @see PolylineCollection#length\n */\nPolylineCollection.prototype.get = function (index) {\n removePolylines(this);\n return this._polylines[index];\n};\n\nfunction createBatchTable(collection, context) {\n if (defined(collection._batchTable)) {\n collection._batchTable.destroy();\n }\n\n const attributes = [\n {\n functionName: \"batchTable_getWidthAndShow\",\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 2,\n },\n {\n functionName: \"batchTable_getPickColor\",\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 4,\n normalize: true,\n },\n {\n functionName: \"batchTable_getCenterHigh\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n functionName: \"batchTable_getCenterLowAndRadius\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n },\n {\n functionName: \"batchTable_getDistanceDisplayCondition\",\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n },\n ];\n\n collection._batchTable = new BatchTable(\n context,\n attributes,\n collection._polylines.length\n );\n}\n\nconst scratchUpdatePolylineEncodedCartesian = new EncodedCartesian3();\nconst scratchUpdatePolylineCartesian4 = new Cartesian4();\nconst scratchNearFarCartesian2 = new Cartesian2();\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {RuntimeError} 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.\n */\nPolylineCollection.prototype.update = function (frameState) {\n removePolylines(this);\n\n if (this._polylines.length === 0 || !this.show) {\n return;\n }\n\n updateMode(this, frameState);\n\n const context = frameState.context;\n const projection = frameState.mapProjection;\n let polyline;\n let properties = this._propertiesChanged;\n\n if (this._createBatchTable) {\n if (ContextLimits.maximumVertexTextureImageUnits === 0) {\n throw new RuntimeError(\n \"Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.\"\n );\n }\n createBatchTable(this, context);\n this._createBatchTable = false;\n }\n\n if (this._createVertexArray || computeNewBuffersUsage(this)) {\n createVertexArrays(this, context, projection);\n } else if (this._polylinesUpdated) {\n // Polylines were modified, but no polylines were added or removed.\n const polylinesToUpdate = this._polylinesToUpdate;\n if (this._mode !== SceneMode.SCENE3D) {\n const updateLength = polylinesToUpdate.length;\n for (let i = 0; i < updateLength; ++i) {\n polyline = polylinesToUpdate[i];\n polyline.update();\n }\n }\n\n // if a polyline's positions size changes, we need to recreate the vertex arrays and vertex buffers because the indices will be different.\n // if a polyline's material changes, we need to recreate the VAOs and VBOs because they will be batched differently.\n if (properties[POSITION_SIZE_INDEX] || properties[MATERIAL_INDEX]) {\n createVertexArrays(this, context, projection);\n } else {\n const length = polylinesToUpdate.length;\n const polylineBuckets = this._polylineBuckets;\n for (let ii = 0; ii < length; ++ii) {\n polyline = polylinesToUpdate[ii];\n properties = polyline._propertiesChanged;\n const bucket = polyline._bucket;\n let index = 0;\n for (const x in polylineBuckets) {\n if (polylineBuckets.hasOwnProperty(x)) {\n if (polylineBuckets[x] === bucket) {\n if (properties[POSITION_INDEX]) {\n bucket.writeUpdate(\n index,\n polyline,\n this._positionBuffer,\n projection\n );\n }\n break;\n }\n index += polylineBuckets[x].lengthOfPositions;\n }\n }\n\n if (properties[SHOW_INDEX] || properties[WIDTH_INDEX]) {\n this._batchTable.setBatchedAttribute(\n polyline._index,\n 0,\n new Cartesian2(polyline._width, polyline._show)\n );\n }\n\n if (this._batchTable.attributes.length > 2) {\n if (properties[POSITION_INDEX] || properties[POSITION_SIZE_INDEX]) {\n const boundingSphere =\n frameState.mode === SceneMode.SCENE2D\n ? polyline._boundingVolume2D\n : polyline._boundingVolumeWC;\n const encodedCenter = EncodedCartesian3.fromCartesian(\n boundingSphere.center,\n scratchUpdatePolylineEncodedCartesian\n );\n const low = Cartesian4.fromElements(\n encodedCenter.low.x,\n encodedCenter.low.y,\n encodedCenter.low.z,\n boundingSphere.radius,\n scratchUpdatePolylineCartesian4\n );\n this._batchTable.setBatchedAttribute(\n polyline._index,\n 2,\n encodedCenter.high\n );\n this._batchTable.setBatchedAttribute(polyline._index, 3, low);\n }\n\n if (properties[DISTANCE_DISPLAY_CONDITION]) {\n const nearFarCartesian = scratchNearFarCartesian2;\n nearFarCartesian.x = 0.0;\n nearFarCartesian.y = Number.MAX_VALUE;\n\n const distanceDisplayCondition = polyline.distanceDisplayCondition;\n if (defined(distanceDisplayCondition)) {\n nearFarCartesian.x = distanceDisplayCondition.near;\n nearFarCartesian.y = distanceDisplayCondition.far;\n }\n\n this._batchTable.setBatchedAttribute(\n polyline._index,\n 4,\n nearFarCartesian\n );\n }\n }\n\n polyline._clean();\n }\n }\n polylinesToUpdate.length = 0;\n this._polylinesUpdated = false;\n }\n\n properties = this._propertiesChanged;\n for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n properties[k] = 0;\n }\n\n let modelMatrix = Matrix4.IDENTITY;\n if (frameState.mode === SceneMode.SCENE3D) {\n modelMatrix = this.modelMatrix;\n }\n\n const pass = frameState.passes;\n const useDepthTest = frameState.morphTime !== 0.0;\n\n if (\n !defined(this._opaqueRS) ||\n this._opaqueRS.depthTest.enabled !== useDepthTest\n ) {\n this._opaqueRS = RenderState.fromCache({\n depthMask: useDepthTest,\n depthTest: {\n enabled: useDepthTest,\n },\n });\n }\n\n if (\n !defined(this._translucentRS) ||\n this._translucentRS.depthTest.enabled !== useDepthTest\n ) {\n this._translucentRS = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n depthMask: !useDepthTest,\n depthTest: {\n enabled: useDepthTest,\n },\n });\n }\n\n this._batchTable.update(frameState);\n\n if (pass.render || pass.pick) {\n const colorList = this._colorCommands;\n createCommandLists(this, frameState, colorList, modelMatrix);\n }\n};\n\nconst boundingSphereScratch = new BoundingSphere();\nconst boundingSphereScratch2 = new BoundingSphere();\n\nfunction createCommandLists(\n polylineCollection,\n frameState,\n commands,\n modelMatrix\n) {\n const context = frameState.context;\n const commandList = frameState.commandList;\n\n const commandsLength = commands.length;\n let commandIndex = 0;\n let cloneBoundingSphere = true;\n\n const vertexArrays = polylineCollection._vertexArrays;\n const debugShowBoundingVolume = polylineCollection.debugShowBoundingVolume;\n\n const batchTable = polylineCollection._batchTable;\n const uniformCallback = batchTable.getUniformMapCallback();\n\n const length = vertexArrays.length;\n for (let m = 0; m < length; ++m) {\n const va = vertexArrays[m];\n const buckets = va.buckets;\n const bucketLength = buckets.length;\n\n for (let n = 0; n < bucketLength; ++n) {\n const bucketLocator = buckets[n];\n\n let offset = bucketLocator.offset;\n const sp = bucketLocator.bucket.shaderProgram;\n\n const polylines = bucketLocator.bucket.polylines;\n const polylineLength = polylines.length;\n let currentId;\n let currentMaterial;\n let count = 0;\n let command;\n let uniformMap;\n\n for (let s = 0; s < polylineLength; ++s) {\n const polyline = polylines[s];\n const mId = createMaterialId(polyline._material);\n if (mId !== currentId) {\n if (defined(currentId) && count > 0) {\n const translucent = currentMaterial.isTranslucent();\n\n if (commandIndex >= commandsLength) {\n command = new DrawCommand({\n owner: polylineCollection,\n });\n commands.push(command);\n } else {\n command = commands[commandIndex];\n }\n\n ++commandIndex;\n\n uniformMap = combine(\n uniformCallback(currentMaterial._uniforms),\n polylineCollection._uniformMap\n );\n\n command.boundingVolume = BoundingSphere.clone(\n boundingSphereScratch,\n command.boundingVolume\n );\n command.modelMatrix = modelMatrix;\n command.shaderProgram = sp;\n command.vertexArray = va.va;\n command.renderState = translucent\n ? polylineCollection._translucentRS\n : polylineCollection._opaqueRS;\n command.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n command.pickId = \"v_pickColor\";\n\n command.uniformMap = uniformMap;\n command.count = count;\n command.offset = offset;\n\n offset += count;\n count = 0;\n cloneBoundingSphere = true;\n\n commandList.push(command);\n }\n\n currentMaterial = polyline._material;\n currentMaterial.update(context);\n currentId = mId;\n }\n\n const locators = polyline._locatorBuckets;\n const locatorLength = locators.length;\n for (let t = 0; t < locatorLength; ++t) {\n const locator = locators[t];\n if (locator.locator === bucketLocator) {\n count += locator.count;\n }\n }\n\n let boundingVolume;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingVolume = polyline._boundingVolumeWC;\n } else if (frameState.mode === SceneMode.COLUMBUS_VIEW) {\n boundingVolume = polyline._boundingVolume2D;\n } else if (frameState.mode === SceneMode.SCENE2D) {\n if (defined(polyline._boundingVolume2D)) {\n boundingVolume = BoundingSphere.clone(\n polyline._boundingVolume2D,\n boundingSphereScratch2\n );\n boundingVolume.center.x = 0.0;\n }\n } else if (\n defined(polyline._boundingVolumeWC) &&\n defined(polyline._boundingVolume2D)\n ) {\n boundingVolume = BoundingSphere.union(\n polyline._boundingVolumeWC,\n polyline._boundingVolume2D,\n boundingSphereScratch2\n );\n }\n\n if (cloneBoundingSphere) {\n cloneBoundingSphere = false;\n BoundingSphere.clone(boundingVolume, boundingSphereScratch);\n } else {\n BoundingSphere.union(\n boundingVolume,\n boundingSphereScratch,\n boundingSphereScratch\n );\n }\n }\n\n if (defined(currentId) && count > 0) {\n if (commandIndex >= commandsLength) {\n command = new DrawCommand({\n owner: polylineCollection,\n });\n commands.push(command);\n } else {\n command = commands[commandIndex];\n }\n\n ++commandIndex;\n\n uniformMap = combine(\n uniformCallback(currentMaterial._uniforms),\n polylineCollection._uniformMap\n );\n\n command.boundingVolume = BoundingSphere.clone(\n boundingSphereScratch,\n command.boundingVolume\n );\n command.modelMatrix = modelMatrix;\n command.shaderProgram = sp;\n command.vertexArray = va.va;\n command.renderState = currentMaterial.isTranslucent()\n ? polylineCollection._translucentRS\n : polylineCollection._opaqueRS;\n command.pass = currentMaterial.isTranslucent()\n ? Pass.TRANSLUCENT\n : Pass.OPAQUE;\n command.debugShowBoundingVolume = debugShowBoundingVolume;\n command.pickId = \"v_pickColor\";\n\n command.uniformMap = uniformMap;\n command.count = count;\n command.offset = offset;\n\n cloneBoundingSphere = true;\n\n commandList.push(command);\n }\n\n currentId = undefined;\n }\n }\n\n commands.length = commandIndex;\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PolylineCollection#destroy\n */\nPolylineCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * polylines = polylines && polylines.destroy();\n *\n * @see PolylineCollection#isDestroyed\n */\nPolylineCollection.prototype.destroy = function () {\n destroyVertexArrays(this);\n releaseShaders(this);\n destroyPolylines(this);\n this._batchTable = this._batchTable && this._batchTable.destroy();\n return destroyObject(this);\n};\n\nfunction computeNewBuffersUsage(collection) {\n let usageChanged = false;\n const properties = collection._propertiesChanged;\n const bufferUsage = collection._positionBufferUsage;\n if (properties[POSITION_INDEX]) {\n if (bufferUsage.bufferUsage !== BufferUsage.STREAM_DRAW) {\n usageChanged = true;\n bufferUsage.bufferUsage = BufferUsage.STREAM_DRAW;\n bufferUsage.frameCount = 100;\n } else {\n bufferUsage.frameCount = 100;\n }\n } else if (bufferUsage.bufferUsage !== BufferUsage.STATIC_DRAW) {\n if (bufferUsage.frameCount === 0) {\n usageChanged = true;\n bufferUsage.bufferUsage = BufferUsage.STATIC_DRAW;\n } else {\n bufferUsage.frameCount--;\n }\n }\n\n return usageChanged;\n}\n\nconst emptyVertexBuffer = [0.0, 0.0, 0.0];\n\nfunction createVertexArrays(collection, context, projection) {\n collection._createVertexArray = false;\n releaseShaders(collection);\n destroyVertexArrays(collection);\n sortPolylinesIntoBuckets(collection);\n\n //stores all of the individual indices arrays.\n const totalIndices = [[]];\n let indices = totalIndices[0];\n\n const batchTable = collection._batchTable;\n const useHighlightColor = collection._useHighlightColor;\n\n //used to determine the vertexBuffer offset if the indicesArray goes over 64k.\n //if it's the same polyline while it goes over 64k, the offset needs to backtrack componentsPerAttribute * componentDatatype bytes\n //so that the polyline looks contiguous.\n //if the polyline ends at the 64k mark, then the offset is just 64k * componentsPerAttribute * componentDatatype\n const vertexBufferOffset = [0];\n let offset = 0;\n const vertexArrayBuckets = [[]];\n let totalLength = 0;\n const polylineBuckets = collection._polylineBuckets;\n let x;\n let bucket;\n for (x in polylineBuckets) {\n if (polylineBuckets.hasOwnProperty(x)) {\n bucket = polylineBuckets[x];\n bucket.updateShader(context, batchTable, useHighlightColor);\n totalLength += bucket.lengthOfPositions;\n }\n }\n\n if (totalLength > 0) {\n const mode = collection._mode;\n\n const positionArray = new Float32Array(6 * totalLength * 3);\n const texCoordExpandAndBatchIndexArray = new Float32Array(totalLength * 4);\n let position3DArray;\n\n let positionIndex = 0;\n let colorIndex = 0;\n let texCoordExpandAndBatchIndexIndex = 0;\n for (x in polylineBuckets) {\n if (polylineBuckets.hasOwnProperty(x)) {\n bucket = polylineBuckets[x];\n bucket.write(\n positionArray,\n texCoordExpandAndBatchIndexArray,\n positionIndex,\n colorIndex,\n texCoordExpandAndBatchIndexIndex,\n batchTable,\n context,\n projection\n );\n\n if (mode === SceneMode.MORPHING) {\n if (!defined(position3DArray)) {\n position3DArray = new Float32Array(6 * totalLength * 3);\n }\n bucket.writeForMorph(position3DArray, positionIndex);\n }\n\n const bucketLength = bucket.lengthOfPositions;\n positionIndex += 6 * bucketLength * 3;\n colorIndex += bucketLength * 4;\n texCoordExpandAndBatchIndexIndex += bucketLength * 4;\n offset = bucket.updateIndices(\n totalIndices,\n vertexBufferOffset,\n vertexArrayBuckets,\n offset\n );\n }\n }\n\n const positionBufferUsage = collection._positionBufferUsage.bufferUsage;\n const texCoordExpandAndBatchIndexBufferUsage = BufferUsage.STATIC_DRAW;\n\n collection._positionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: positionArray,\n usage: positionBufferUsage,\n });\n let position3DBuffer;\n if (defined(position3DArray)) {\n position3DBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: position3DArray,\n usage: positionBufferUsage,\n });\n }\n collection._texCoordExpandAndBatchIndexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: texCoordExpandAndBatchIndexArray,\n usage: texCoordExpandAndBatchIndexBufferUsage,\n });\n\n const positionSizeInBytes = 3 * Float32Array.BYTES_PER_ELEMENT;\n const texCoordExpandAndBatchIndexSizeInBytes =\n 4 * Float32Array.BYTES_PER_ELEMENT;\n\n let vbo = 0;\n const numberOfIndicesArrays = totalIndices.length;\n for (let k = 0; k < numberOfIndicesArrays; ++k) {\n indices = totalIndices[k];\n\n if (indices.length > 0) {\n const indicesArray = new Uint16Array(indices);\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indicesArray,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n vbo += vertexBufferOffset[k];\n\n const positionHighOffset =\n 6 *\n (k * (positionSizeInBytes * CesiumMath.SIXTY_FOUR_KILOBYTES) -\n vbo * positionSizeInBytes); //componentsPerAttribute(3) * componentDatatype(4)\n const positionLowOffset = positionSizeInBytes + positionHighOffset;\n const prevPositionHighOffset = positionSizeInBytes + positionLowOffset;\n const prevPositionLowOffset =\n positionSizeInBytes + prevPositionHighOffset;\n const nextPositionHighOffset =\n positionSizeInBytes + prevPositionLowOffset;\n const nextPositionLowOffset =\n positionSizeInBytes + nextPositionHighOffset;\n const vertexTexCoordExpandAndBatchIndexBufferOffset =\n k *\n (texCoordExpandAndBatchIndexSizeInBytes *\n CesiumMath.SIXTY_FOUR_KILOBYTES) -\n vbo * texCoordExpandAndBatchIndexSizeInBytes;\n\n const attributes = [\n {\n index: attributeLocations.position3DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: positionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.position3DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: positionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.position2DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: positionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.position2DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: positionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.prevPosition3DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: prevPositionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.prevPosition3DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: prevPositionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.prevPosition2DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: prevPositionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.prevPosition2DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: prevPositionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.nextPosition3DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: nextPositionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.nextPosition3DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: nextPositionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.nextPosition2DHigh,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: nextPositionHighOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.nextPosition2DLow,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n offsetInBytes: nextPositionLowOffset,\n strideInBytes: 6 * positionSizeInBytes,\n },\n {\n index: attributeLocations.texCoordExpandAndBatchIndex,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n vertexBuffer: collection._texCoordExpandAndBatchIndexBuffer,\n offsetInBytes: vertexTexCoordExpandAndBatchIndexBufferOffset,\n },\n ];\n\n let bufferProperty3D;\n let buffer3D;\n let buffer2D;\n let bufferProperty2D;\n\n if (mode === SceneMode.SCENE3D) {\n buffer3D = collection._positionBuffer;\n bufferProperty3D = \"vertexBuffer\";\n buffer2D = emptyVertexBuffer;\n bufferProperty2D = \"value\";\n } else if (\n mode === SceneMode.SCENE2D ||\n mode === SceneMode.COLUMBUS_VIEW\n ) {\n buffer3D = emptyVertexBuffer;\n bufferProperty3D = \"value\";\n buffer2D = collection._positionBuffer;\n bufferProperty2D = \"vertexBuffer\";\n } else {\n buffer3D = position3DBuffer;\n bufferProperty3D = \"vertexBuffer\";\n buffer2D = collection._positionBuffer;\n bufferProperty2D = \"vertexBuffer\";\n }\n\n attributes[0][bufferProperty3D] = buffer3D;\n attributes[1][bufferProperty3D] = buffer3D;\n attributes[2][bufferProperty2D] = buffer2D;\n attributes[3][bufferProperty2D] = buffer2D;\n attributes[4][bufferProperty3D] = buffer3D;\n attributes[5][bufferProperty3D] = buffer3D;\n attributes[6][bufferProperty2D] = buffer2D;\n attributes[7][bufferProperty2D] = buffer2D;\n attributes[8][bufferProperty3D] = buffer3D;\n attributes[9][bufferProperty3D] = buffer3D;\n attributes[10][bufferProperty2D] = buffer2D;\n attributes[11][bufferProperty2D] = buffer2D;\n\n const va = new VertexArray({\n context: context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n });\n collection._vertexArrays.push({\n va: va,\n buckets: vertexArrayBuckets[k],\n });\n }\n }\n }\n}\n\nfunction replacer(key, value) {\n if (value instanceof Texture) {\n return value.id;\n }\n\n return value;\n}\n\nconst scratchUniformArray = [];\nfunction createMaterialId(material) {\n const uniforms = Material._uniformList[material.type];\n const length = uniforms.length;\n scratchUniformArray.length = 2.0 * length;\n\n let index = 0;\n for (let i = 0; i < length; ++i) {\n const uniform = uniforms[i];\n scratchUniformArray[index] = uniform;\n scratchUniformArray[index + 1] = material._uniforms[uniform]();\n index += 2;\n }\n\n return `${material.type}:${JSON.stringify(scratchUniformArray, replacer)}`;\n}\n\nfunction sortPolylinesIntoBuckets(collection) {\n const mode = collection._mode;\n const modelMatrix = collection._modelMatrix;\n\n const polylineBuckets = (collection._polylineBuckets = {});\n const polylines = collection._polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n const p = polylines[i];\n if (p._actualPositions.length > 1) {\n p.update();\n const material = p.material;\n let value = polylineBuckets[material.type];\n if (!defined(value)) {\n value = polylineBuckets[material.type] = new PolylineBucket(\n material,\n mode,\n modelMatrix\n );\n }\n value.addPolyline(p);\n }\n }\n}\n\nfunction updateMode(collection, frameState) {\n const mode = frameState.mode;\n\n if (\n collection._mode !== mode ||\n !Matrix4.equals(collection._modelMatrix, collection.modelMatrix)\n ) {\n collection._mode = mode;\n collection._modelMatrix = Matrix4.clone(collection.modelMatrix);\n collection._createVertexArray = true;\n }\n}\n\nfunction removePolylines(collection) {\n if (collection._polylinesRemoved) {\n collection._polylinesRemoved = false;\n const definedPolylines = [];\n const definedPolylinesToUpdate = [];\n let polyIndex = 0;\n let polyline;\n\n const length = collection._polylines.length;\n for (let i = 0; i < length; ++i) {\n polyline = collection._polylines[i];\n if (!polyline.isDestroyed) {\n polyline._index = polyIndex++;\n definedPolylinesToUpdate.push(polyline);\n definedPolylines.push(polyline);\n }\n }\n\n collection._polylines = definedPolylines;\n collection._polylinesToUpdate = definedPolylinesToUpdate;\n }\n}\n\nfunction releaseShaders(collection) {\n const polylines = collection._polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n if (!polylines[i].isDestroyed) {\n const bucket = polylines[i]._bucket;\n if (defined(bucket)) {\n bucket.shaderProgram =\n bucket.shaderProgram && bucket.shaderProgram.destroy();\n }\n }\n }\n}\n\nfunction destroyVertexArrays(collection) {\n const length = collection._vertexArrays.length;\n for (let t = 0; t < length; ++t) {\n collection._vertexArrays[t].va.destroy();\n }\n collection._vertexArrays.length = 0;\n}\n\nPolylineCollection.prototype._updatePolyline = function (\n polyline,\n propertyChanged\n) {\n this._polylinesUpdated = true;\n if (!polyline._dirty) {\n this._polylinesToUpdate.push(polyline);\n }\n ++this._propertiesChanged[propertyChanged];\n};\n\nfunction destroyPolylines(collection) {\n const polylines = collection._polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n if (!polylines[i].isDestroyed) {\n polylines[i]._destroy();\n }\n }\n}\n\nfunction VertexArrayBucketLocator(count, offset, bucket) {\n this.count = count;\n this.offset = offset;\n this.bucket = bucket;\n}\n\nfunction PolylineBucket(material, mode, modelMatrix) {\n this.polylines = [];\n this.lengthOfPositions = 0;\n this.material = material;\n this.shaderProgram = undefined;\n this.mode = mode;\n this.modelMatrix = modelMatrix;\n}\n\nPolylineBucket.prototype.addPolyline = function (p) {\n const polylines = this.polylines;\n polylines.push(p);\n p._actualLength = this.getPolylinePositionsLength(p);\n this.lengthOfPositions += p._actualLength;\n p._bucket = this;\n};\n\nPolylineBucket.prototype.updateShader = function (\n context,\n batchTable,\n useHighlightColor\n) {\n if (defined(this.shaderProgram)) {\n return;\n }\n\n const defines = [\"DISTANCE_DISPLAY_CONDITION\"];\n if (useHighlightColor) {\n defines.push(\"VECTOR_TILE\");\n }\n\n // Check for use of v_polylineAngle in material shader\n if (\n this.material.shaderSource.search(/varying\\s+float\\s+v_polylineAngle;/g) !==\n -1\n ) {\n defines.push(\"POLYLINE_DASH\");\n }\n\n if (!FeatureDetection.isInternetExplorer()) {\n defines.push(\"CLIP_POLYLINE\");\n }\n\n const fs = new ShaderSource({\n defines: defines,\n sources: [\n \"varying vec4 v_pickColor;\\n\",\n this.material.shaderSource,\n PolylineFS,\n ],\n });\n\n const vsSource = batchTable.getVertexShaderCallback()(PolylineVS);\n const vs = new ShaderSource({\n defines: defines,\n sources: [PolylineCommon, vsSource],\n });\n\n this.shaderProgram = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n};\n\nfunction intersectsIDL(polyline) {\n return (\n Cartesian3.dot(Cartesian3.UNIT_X, polyline._boundingVolume.center) < 0 ||\n polyline._boundingVolume.intersectPlane(Plane.ORIGIN_ZX_PLANE) ===\n Intersect.INTERSECTING\n );\n}\n\nPolylineBucket.prototype.getPolylinePositionsLength = function (polyline) {\n let length;\n if (this.mode === SceneMode.SCENE3D || !intersectsIDL(polyline)) {\n length = polyline._actualPositions.length;\n return length * 4.0 - 4.0;\n }\n\n let count = 0;\n const segmentLengths = polyline._segments.lengths;\n length = segmentLengths.length;\n for (let i = 0; i < length; ++i) {\n count += segmentLengths[i] * 4.0 - 4.0;\n }\n\n return count;\n};\n\nconst scratchWritePosition = new Cartesian3();\nconst scratchWritePrevPosition = new Cartesian3();\nconst scratchWriteNextPosition = new Cartesian3();\nconst scratchWriteVector = new Cartesian3();\nconst scratchPickColorCartesian = new Cartesian4();\nconst scratchWidthShowCartesian = new Cartesian2();\n\nPolylineBucket.prototype.write = function (\n positionArray,\n texCoordExpandAndBatchIndexArray,\n positionIndex,\n colorIndex,\n texCoordExpandAndBatchIndexIndex,\n batchTable,\n context,\n projection\n) {\n const mode = this.mode;\n const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n const polylines = this.polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n const polyline = polylines[i];\n const width = polyline.width;\n const show = polyline.show && width > 0.0;\n const polylineBatchIndex = polyline._index;\n const segments = this.getSegments(polyline, projection);\n const positions = segments.positions;\n const lengths = segments.lengths;\n const positionsLength = positions.length;\n\n const pickColor = polyline.getPickId(context).color;\n\n let segmentIndex = 0;\n let count = 0;\n let position;\n\n for (let j = 0; j < positionsLength; ++j) {\n if (j === 0) {\n if (polyline._loop) {\n position = positions[positionsLength - 2];\n } else {\n position = scratchWriteVector;\n Cartesian3.subtract(positions[0], positions[1], position);\n Cartesian3.add(positions[0], position, position);\n }\n } else {\n position = positions[j - 1];\n }\n\n Cartesian3.clone(position, scratchWritePrevPosition);\n Cartesian3.clone(positions[j], scratchWritePosition);\n\n if (j === positionsLength - 1) {\n if (polyline._loop) {\n position = positions[1];\n } else {\n position = scratchWriteVector;\n Cartesian3.subtract(\n positions[positionsLength - 1],\n positions[positionsLength - 2],\n position\n );\n Cartesian3.add(positions[positionsLength - 1], position, position);\n }\n } else {\n position = positions[j + 1];\n }\n\n Cartesian3.clone(position, scratchWriteNextPosition);\n\n const segmentLength = lengths[segmentIndex];\n if (j === count + segmentLength) {\n count += segmentLength;\n ++segmentIndex;\n }\n\n const segmentStart = j - count === 0;\n const segmentEnd = j === count + lengths[segmentIndex] - 1;\n\n if (mode === SceneMode.SCENE2D) {\n scratchWritePrevPosition.z = 0.0;\n scratchWritePosition.z = 0.0;\n scratchWriteNextPosition.z = 0.0;\n }\n\n if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n if (\n (segmentStart || segmentEnd) &&\n maxLon - Math.abs(scratchWritePosition.x) < 1.0\n ) {\n if (\n (scratchWritePosition.x < 0.0 &&\n scratchWritePrevPosition.x > 0.0) ||\n (scratchWritePosition.x > 0.0 && scratchWritePrevPosition.x < 0.0)\n ) {\n Cartesian3.clone(scratchWritePosition, scratchWritePrevPosition);\n }\n\n if (\n (scratchWritePosition.x < 0.0 &&\n scratchWriteNextPosition.x > 0.0) ||\n (scratchWritePosition.x > 0.0 && scratchWriteNextPosition.x < 0.0)\n ) {\n Cartesian3.clone(scratchWritePosition, scratchWriteNextPosition);\n }\n }\n }\n\n const startK = segmentStart ? 2 : 0;\n const endK = segmentEnd ? 2 : 4;\n\n for (let k = startK; k < endK; ++k) {\n EncodedCartesian3.writeElements(\n scratchWritePosition,\n positionArray,\n positionIndex\n );\n EncodedCartesian3.writeElements(\n scratchWritePrevPosition,\n positionArray,\n positionIndex + 6\n );\n EncodedCartesian3.writeElements(\n scratchWriteNextPosition,\n positionArray,\n positionIndex + 12\n );\n\n const direction = k - 2 < 0 ? -1.0 : 1.0;\n texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex] =\n j / (positionsLength - 1); // s tex coord\n texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 1] =\n 2 * (k % 2) - 1; // expand direction\n texCoordExpandAndBatchIndexArray[\n texCoordExpandAndBatchIndexIndex + 2\n ] = direction;\n texCoordExpandAndBatchIndexArray[\n texCoordExpandAndBatchIndexIndex + 3\n ] = polylineBatchIndex;\n\n positionIndex += 6 * 3;\n texCoordExpandAndBatchIndexIndex += 4;\n }\n }\n\n const colorCartesian = scratchPickColorCartesian;\n colorCartesian.x = Color.floatToByte(pickColor.red);\n colorCartesian.y = Color.floatToByte(pickColor.green);\n colorCartesian.z = Color.floatToByte(pickColor.blue);\n colorCartesian.w = Color.floatToByte(pickColor.alpha);\n\n const widthShowCartesian = scratchWidthShowCartesian;\n widthShowCartesian.x = width;\n widthShowCartesian.y = show ? 1.0 : 0.0;\n\n const boundingSphere =\n mode === SceneMode.SCENE2D\n ? polyline._boundingVolume2D\n : polyline._boundingVolumeWC;\n const encodedCenter = EncodedCartesian3.fromCartesian(\n boundingSphere.center,\n scratchUpdatePolylineEncodedCartesian\n );\n const high = encodedCenter.high;\n const low = Cartesian4.fromElements(\n encodedCenter.low.x,\n encodedCenter.low.y,\n encodedCenter.low.z,\n boundingSphere.radius,\n scratchUpdatePolylineCartesian4\n );\n\n const nearFarCartesian = scratchNearFarCartesian2;\n nearFarCartesian.x = 0.0;\n nearFarCartesian.y = Number.MAX_VALUE;\n\n const distanceDisplayCondition = polyline.distanceDisplayCondition;\n if (defined(distanceDisplayCondition)) {\n nearFarCartesian.x = distanceDisplayCondition.near;\n nearFarCartesian.y = distanceDisplayCondition.far;\n }\n\n batchTable.setBatchedAttribute(polylineBatchIndex, 0, widthShowCartesian);\n batchTable.setBatchedAttribute(polylineBatchIndex, 1, colorCartesian);\n\n if (batchTable.attributes.length > 2) {\n batchTable.setBatchedAttribute(polylineBatchIndex, 2, high);\n batchTable.setBatchedAttribute(polylineBatchIndex, 3, low);\n batchTable.setBatchedAttribute(polylineBatchIndex, 4, nearFarCartesian);\n }\n }\n};\n\nconst morphPositionScratch = new Cartesian3();\nconst morphPrevPositionScratch = new Cartesian3();\nconst morphNextPositionScratch = new Cartesian3();\nconst morphVectorScratch = new Cartesian3();\n\nPolylineBucket.prototype.writeForMorph = function (\n positionArray,\n positionIndex\n) {\n const modelMatrix = this.modelMatrix;\n const polylines = this.polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n const polyline = polylines[i];\n const positions = polyline._segments.positions;\n const lengths = polyline._segments.lengths;\n const positionsLength = positions.length;\n\n let segmentIndex = 0;\n let count = 0;\n\n for (let j = 0; j < positionsLength; ++j) {\n let prevPosition;\n if (j === 0) {\n if (polyline._loop) {\n prevPosition = positions[positionsLength - 2];\n } else {\n prevPosition = morphVectorScratch;\n Cartesian3.subtract(positions[0], positions[1], prevPosition);\n Cartesian3.add(positions[0], prevPosition, prevPosition);\n }\n } else {\n prevPosition = positions[j - 1];\n }\n\n prevPosition = Matrix4.multiplyByPoint(\n modelMatrix,\n prevPosition,\n morphPrevPositionScratch\n );\n\n const position = Matrix4.multiplyByPoint(\n modelMatrix,\n positions[j],\n morphPositionScratch\n );\n\n let nextPosition;\n if (j === positionsLength - 1) {\n if (polyline._loop) {\n nextPosition = positions[1];\n } else {\n nextPosition = morphVectorScratch;\n Cartesian3.subtract(\n positions[positionsLength - 1],\n positions[positionsLength - 2],\n nextPosition\n );\n Cartesian3.add(\n positions[positionsLength - 1],\n nextPosition,\n nextPosition\n );\n }\n } else {\n nextPosition = positions[j + 1];\n }\n\n nextPosition = Matrix4.multiplyByPoint(\n modelMatrix,\n nextPosition,\n morphNextPositionScratch\n );\n\n const segmentLength = lengths[segmentIndex];\n if (j === count + segmentLength) {\n count += segmentLength;\n ++segmentIndex;\n }\n\n const segmentStart = j - count === 0;\n const segmentEnd = j === count + lengths[segmentIndex] - 1;\n\n const startK = segmentStart ? 2 : 0;\n const endK = segmentEnd ? 2 : 4;\n\n for (let k = startK; k < endK; ++k) {\n EncodedCartesian3.writeElements(position, positionArray, positionIndex);\n EncodedCartesian3.writeElements(\n prevPosition,\n positionArray,\n positionIndex + 6\n );\n EncodedCartesian3.writeElements(\n nextPosition,\n positionArray,\n positionIndex + 12\n );\n\n positionIndex += 6 * 3;\n }\n }\n }\n};\n\nconst scratchSegmentLengths = new Array(1);\n\nPolylineBucket.prototype.updateIndices = function (\n totalIndices,\n vertexBufferOffset,\n vertexArrayBuckets,\n offset\n) {\n let vaCount = vertexArrayBuckets.length - 1;\n let bucketLocator = new VertexArrayBucketLocator(0, offset, this);\n vertexArrayBuckets[vaCount].push(bucketLocator);\n let count = 0;\n let indices = totalIndices[totalIndices.length - 1];\n let indicesCount = 0;\n if (indices.length > 0) {\n indicesCount = indices[indices.length - 1] + 1;\n }\n const polylines = this.polylines;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n const polyline = polylines[i];\n polyline._locatorBuckets = [];\n\n let segments;\n if (this.mode === SceneMode.SCENE3D) {\n segments = scratchSegmentLengths;\n const positionsLength = polyline._actualPositions.length;\n if (positionsLength > 0) {\n segments[0] = positionsLength;\n } else {\n continue;\n }\n } else {\n segments = polyline._segments.lengths;\n }\n\n const numberOfSegments = segments.length;\n if (numberOfSegments > 0) {\n let segmentIndexCount = 0;\n for (let j = 0; j < numberOfSegments; ++j) {\n const segmentLength = segments[j] - 1.0;\n for (let k = 0; k < segmentLength; ++k) {\n if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {\n polyline._locatorBuckets.push({\n locator: bucketLocator,\n count: segmentIndexCount,\n });\n segmentIndexCount = 0;\n vertexBufferOffset.push(4);\n indices = [];\n totalIndices.push(indices);\n indicesCount = 0;\n bucketLocator.count = count;\n count = 0;\n offset = 0;\n bucketLocator = new VertexArrayBucketLocator(0, 0, this);\n vertexArrayBuckets[++vaCount] = [bucketLocator];\n }\n\n indices.push(indicesCount, indicesCount + 2, indicesCount + 1);\n indices.push(indicesCount + 1, indicesCount + 2, indicesCount + 3);\n\n segmentIndexCount += 6;\n count += 6;\n offset += 6;\n indicesCount += 4;\n }\n }\n\n polyline._locatorBuckets.push({\n locator: bucketLocator,\n count: segmentIndexCount,\n });\n\n if (indicesCount + 4 > CesiumMath.SIXTY_FOUR_KILOBYTES) {\n vertexBufferOffset.push(0);\n indices = [];\n totalIndices.push(indices);\n indicesCount = 0;\n bucketLocator.count = count;\n offset = 0;\n count = 0;\n bucketLocator = new VertexArrayBucketLocator(0, 0, this);\n vertexArrayBuckets[++vaCount] = [bucketLocator];\n }\n }\n polyline._clean();\n }\n bucketLocator.count = count;\n return offset;\n};\n\nPolylineBucket.prototype.getPolylineStartIndex = function (polyline) {\n const polylines = this.polylines;\n let positionIndex = 0;\n const length = polylines.length;\n for (let i = 0; i < length; ++i) {\n const p = polylines[i];\n if (p === polyline) {\n break;\n }\n positionIndex += p._actualLength;\n }\n return positionIndex;\n};\n\nconst scratchSegments = {\n positions: undefined,\n lengths: undefined,\n};\nconst scratchLengths = new Array(1);\nconst pscratch = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nPolylineBucket.prototype.getSegments = function (polyline, projection) {\n let positions = polyline._actualPositions;\n\n if (this.mode === SceneMode.SCENE3D) {\n scratchLengths[0] = positions.length;\n scratchSegments.positions = positions;\n scratchSegments.lengths = scratchLengths;\n return scratchSegments;\n }\n\n if (intersectsIDL(polyline)) {\n positions = polyline._segments.positions;\n }\n\n const ellipsoid = projection.ellipsoid;\n const newPositions = [];\n const modelMatrix = this.modelMatrix;\n const length = positions.length;\n let position;\n let p = pscratch;\n\n for (let n = 0; n < length; ++n) {\n position = positions[n];\n p = Matrix4.multiplyByPoint(modelMatrix, position, p);\n newPositions.push(\n projection.project(\n ellipsoid.cartesianToCartographic(p, scratchCartographic)\n )\n );\n }\n\n if (newPositions.length > 0) {\n polyline._boundingVolume2D = BoundingSphere.fromPoints(\n newPositions,\n polyline._boundingVolume2D\n );\n const center2D = polyline._boundingVolume2D.center;\n polyline._boundingVolume2D.center = new Cartesian3(\n center2D.z,\n center2D.x,\n center2D.y\n );\n }\n\n scratchSegments.positions = newPositions;\n scratchSegments.lengths = polyline._segments.lengths;\n return scratchSegments;\n};\n\nlet scratchPositionsArray;\n\nPolylineBucket.prototype.writeUpdate = function (\n index,\n polyline,\n positionBuffer,\n projection\n) {\n const mode = this.mode;\n const maxLon = projection.ellipsoid.maximumRadius * CesiumMath.PI;\n\n let positionsLength = polyline._actualLength;\n if (positionsLength) {\n index += this.getPolylineStartIndex(polyline);\n\n let positionArray = scratchPositionsArray;\n const positionsArrayLength = 6 * positionsLength * 3;\n\n if (\n !defined(positionArray) ||\n positionArray.length < positionsArrayLength\n ) {\n positionArray = scratchPositionsArray = new Float32Array(\n positionsArrayLength\n );\n } else if (positionArray.length > positionsArrayLength) {\n positionArray = new Float32Array(\n positionArray.buffer,\n 0,\n positionsArrayLength\n );\n }\n\n const segments = this.getSegments(polyline, projection);\n const positions = segments.positions;\n const lengths = segments.lengths;\n\n let positionIndex = 0;\n let segmentIndex = 0;\n let count = 0;\n let position;\n\n positionsLength = positions.length;\n for (let i = 0; i < positionsLength; ++i) {\n if (i === 0) {\n if (polyline._loop) {\n position = positions[positionsLength - 2];\n } else {\n position = scratchWriteVector;\n Cartesian3.subtract(positions[0], positions[1], position);\n Cartesian3.add(positions[0], position, position);\n }\n } else {\n position = positions[i - 1];\n }\n\n Cartesian3.clone(position, scratchWritePrevPosition);\n Cartesian3.clone(positions[i], scratchWritePosition);\n\n if (i === positionsLength - 1) {\n if (polyline._loop) {\n position = positions[1];\n } else {\n position = scratchWriteVector;\n Cartesian3.subtract(\n positions[positionsLength - 1],\n positions[positionsLength - 2],\n position\n );\n Cartesian3.add(positions[positionsLength - 1], position, position);\n }\n } else {\n position = positions[i + 1];\n }\n\n Cartesian3.clone(position, scratchWriteNextPosition);\n\n const segmentLength = lengths[segmentIndex];\n if (i === count + segmentLength) {\n count += segmentLength;\n ++segmentIndex;\n }\n\n const segmentStart = i - count === 0;\n const segmentEnd = i === count + lengths[segmentIndex] - 1;\n\n if (mode === SceneMode.SCENE2D) {\n scratchWritePrevPosition.z = 0.0;\n scratchWritePosition.z = 0.0;\n scratchWriteNextPosition.z = 0.0;\n }\n\n if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n if (\n (segmentStart || segmentEnd) &&\n maxLon - Math.abs(scratchWritePosition.x) < 1.0\n ) {\n if (\n (scratchWritePosition.x < 0.0 &&\n scratchWritePrevPosition.x > 0.0) ||\n (scratchWritePosition.x > 0.0 && scratchWritePrevPosition.x < 0.0)\n ) {\n Cartesian3.clone(scratchWritePosition, scratchWritePrevPosition);\n }\n\n if (\n (scratchWritePosition.x < 0.0 &&\n scratchWriteNextPosition.x > 0.0) ||\n (scratchWritePosition.x > 0.0 && scratchWriteNextPosition.x < 0.0)\n ) {\n Cartesian3.clone(scratchWritePosition, scratchWriteNextPosition);\n }\n }\n }\n\n const startJ = segmentStart ? 2 : 0;\n const endJ = segmentEnd ? 2 : 4;\n\n for (let j = startJ; j < endJ; ++j) {\n EncodedCartesian3.writeElements(\n scratchWritePosition,\n positionArray,\n positionIndex\n );\n EncodedCartesian3.writeElements(\n scratchWritePrevPosition,\n positionArray,\n positionIndex + 6\n );\n EncodedCartesian3.writeElements(\n scratchWriteNextPosition,\n positionArray,\n positionIndex + 12\n );\n positionIndex += 6 * 3;\n }\n }\n\n positionBuffer.copyFromArrayView(\n positionArray,\n 6 * 3 * Float32Array.BYTES_PER_ELEMENT * index\n );\n }\n};\nexport default PolylineCollection;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport Cesium3DTilePointFeature from \"./Cesium3DTilePointFeature.js\";\nimport HorizontalOrigin from \"./HorizontalOrigin.js\";\nimport LabelCollection from \"./LabelCollection.js\";\nimport LabelStyle from \"./LabelStyle.js\";\nimport PolylineCollection from \"./PolylineCollection.js\";\nimport VerticalOrigin from \"./VerticalOrigin.js\";\n\n/**\n * Creates a batch of points or billboards and labels.\n *\n * @alias Vector3DTilePoints\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polygons.\n * @param {Number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {Number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polygons.\n * @param {Uint16Array} options.batchIds The batch ids for each polygon.\n *\n * @private\n */\nfunction Vector3DTilePoints(options) {\n // released after the first update\n this._positions = options.positions;\n\n this._batchTable = options.batchTable;\n this._batchIds = options.batchIds;\n\n this._rectangle = options.rectangle;\n this._minHeight = options.minimumHeight;\n this._maxHeight = options.maximumHeight;\n\n this._billboardCollection = new BillboardCollection({\n batchTable: options.batchTable,\n });\n this._labelCollection = new LabelCollection({\n batchTable: options.batchTable,\n });\n this._polylineCollection = new PolylineCollection();\n this._polylineCollection._useHighlightColor = true;\n\n this._verticesPromise = undefined;\n this._packedBuffer = undefined;\n\n this._ready = false;\n this._update = function (points, frameState) {};\n this._readyPromise = initialize(this);\n}\n\nObject.defineProperties(Vector3DTilePoints.prototype, {\n /**\n * Gets the number of points.\n *\n * @memberof Vector3DTilePoints.prototype\n *\n * @type {Number}\n * @readonly\n */\n pointsLength: {\n get: function () {\n return this._billboardCollection.length;\n },\n },\n\n /**\n * Gets the texture atlas memory in bytes.\n *\n * @memberof Vector3DTilePoints.prototype\n *\n * @type {Number}\n * @readonly\n */\n texturesByteLength: {\n get: function () {\n const billboardSize = this._billboardCollection.textureAtlas.texture\n .sizeInBytes;\n const labelSize = this._labelCollection._textureAtlas.texture.sizeInBytes;\n return billboardSize + labelSize;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Vector3DTilePoints.prototype\n * @type {Promise<void>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction packBuffer(points, ellipsoid) {\n const rectangle = points._rectangle;\n const minimumHeight = points._minHeight;\n const maximumHeight = points._maxHeight;\n\n const packedLength = 2 + Rectangle.packedLength + Ellipsoid.packedLength;\n const packedBuffer = new Float64Array(packedLength);\n\n let offset = 0;\n packedBuffer[offset++] = minimumHeight;\n packedBuffer[offset++] = maximumHeight;\n\n Rectangle.pack(rectangle, packedBuffer, offset);\n offset += Rectangle.packedLength;\n\n Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n\n return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n \"createVectorTilePoints\",\n 5\n);\nconst scratchPosition = new Cartesian3();\n\nfunction createPoints(points, ellipsoid) {\n let positions;\n if (!defined(points._verticesPromise)) {\n positions = points._positions;\n let packedBuffer = points._packedBuffer;\n\n if (!defined(packedBuffer)) {\n // Copy because they may be the views on the same buffer.\n positions = points._positions = positions.slice();\n points._batchIds = points._batchIds.slice();\n\n packedBuffer = points._packedBuffer = packBuffer(points, ellipsoid);\n }\n\n const transferrableObjects = [positions.buffer, packedBuffer.buffer];\n const parameters = {\n positions: positions.buffer,\n packedBuffer: packedBuffer.buffer,\n };\n\n const verticesPromise = (points._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n parameters,\n transferrableObjects\n ));\n if (!defined(verticesPromise)) {\n // Postponed\n return;\n }\n\n return verticesPromise.then(function (result) {\n points._positions = new Float64Array(result.positions);\n const billboardCollection = points._billboardCollection;\n const labelCollection = points._labelCollection;\n const polylineCollection = points._polylineCollection;\n positions = points._positions;\n const batchIds = points._batchIds;\n const numberOfPoints = positions.length / 3;\n\n for (let i = 0; i < numberOfPoints; ++i) {\n const id = batchIds[i];\n\n const position = Cartesian3.unpack(positions, i * 3, scratchPosition);\n\n const b = billboardCollection.add();\n b.position = position;\n b._batchIndex = id;\n\n const l = labelCollection.add();\n l.text = \" \";\n l.position = position;\n l._batchIndex = id;\n\n const p = polylineCollection.add();\n p.positions = [Cartesian3.clone(position), Cartesian3.clone(position)];\n }\n\n points._positions = undefined;\n points._packedBuffer = undefined;\n points._ready = true;\n });\n }\n}\n\n/**\n * Creates features for each point and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the point features will be placed.\n */\nVector3DTilePoints.prototype.createFeatures = function (content, features) {\n const billboardCollection = this._billboardCollection;\n const labelCollection = this._labelCollection;\n const polylineCollection = this._polylineCollection;\n\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n\n const billboard = billboardCollection.get(i);\n const label = labelCollection.get(i);\n const polyline = polylineCollection.get(i);\n\n features[batchId] = new Cesium3DTilePointFeature(\n content,\n batchId,\n billboard,\n label,\n polyline\n );\n }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePoints.prototype.applyDebugSettings = function (enabled, color) {\n if (enabled) {\n Color.clone(color, this._billboardCollection._highlightColor);\n Color.clone(color, this._labelCollection._highlightColor);\n Color.clone(color, this._polylineCollection._highlightColor);\n } else {\n Color.clone(Color.WHITE, this._billboardCollection._highlightColor);\n Color.clone(Color.WHITE, this._labelCollection._highlightColor);\n Color.clone(Color.WHITE, this._polylineCollection._highlightColor);\n }\n};\n\nfunction clearStyle(polygons, features) {\n const batchIds = polygons._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.show = true;\n feature.pointSize = Cesium3DTilePointFeature.defaultPointSize;\n feature.color = Cesium3DTilePointFeature.defaultColor;\n feature.pointOutlineColor =\n Cesium3DTilePointFeature.defaultPointOutlineColor;\n feature.pointOutlineWidth =\n Cesium3DTilePointFeature.defaultPointOutlineWidth;\n feature.labelColor = Color.WHITE;\n feature.labelOutlineColor = Color.WHITE;\n feature.labelOutlineWidth = 1.0;\n feature.font = \"30px sans-serif\";\n feature.labelStyle = LabelStyle.FILL;\n feature.labelText = undefined;\n feature.backgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\n feature.backgroundPadding = new Cartesian2(7, 5);\n feature.backgroundEnabled = false;\n feature.scaleByDistance = undefined;\n feature.translucencyByDistance = undefined;\n feature.distanceDisplayCondition = undefined;\n feature.heightOffset = 0.0;\n feature.anchorLineEnabled = false;\n feature.anchorLineColor = Color.WHITE;\n feature.image = undefined;\n feature.disableDepthTestDistance = 0.0;\n feature.horizontalOrigin = HorizontalOrigin.CENTER;\n feature.verticalOrigin = VerticalOrigin.CENTER;\n feature.labelHorizontalOrigin = HorizontalOrigin.RIGHT;\n feature.labelVerticalOrigin = VerticalOrigin.BASELINE;\n }\n}\n\nconst scratchColor = new Color();\nconst scratchColor2 = new Color();\nconst scratchColor3 = new Color();\nconst scratchColor4 = new Color();\nconst scratchColor5 = new Color();\nconst scratchColor6 = new Color();\nconst scratchScaleByDistance = new NearFarScalar();\nconst scratchTranslucencyByDistance = new NearFarScalar();\nconst scratchDistanceDisplayCondition = new DistanceDisplayCondition();\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePoints.prototype.applyStyle = function (style, features) {\n if (!defined(style)) {\n clearStyle(this, features);\n return;\n }\n\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n if (defined(style.show)) {\n feature.show = style.show.evaluate(feature);\n }\n\n if (defined(style.pointSize)) {\n feature.pointSize = style.pointSize.evaluate(feature);\n }\n\n if (defined(style.color)) {\n feature.color = style.color.evaluateColor(feature, scratchColor);\n }\n\n if (defined(style.pointOutlineColor)) {\n feature.pointOutlineColor = style.pointOutlineColor.evaluateColor(\n feature,\n scratchColor2\n );\n }\n\n if (defined(style.pointOutlineWidth)) {\n feature.pointOutlineWidth = style.pointOutlineWidth.evaluate(feature);\n }\n\n if (defined(style.labelColor)) {\n feature.labelColor = style.labelColor.evaluateColor(\n feature,\n scratchColor3\n );\n }\n\n if (defined(style.labelOutlineColor)) {\n feature.labelOutlineColor = style.labelOutlineColor.evaluateColor(\n feature,\n scratchColor4\n );\n }\n\n if (defined(style.labelOutlineWidth)) {\n feature.labelOutlineWidth = style.labelOutlineWidth.evaluate(feature);\n }\n\n if (defined(style.font)) {\n feature.font = style.font.evaluate(feature);\n }\n\n if (defined(style.labelStyle)) {\n feature.labelStyle = style.labelStyle.evaluate(feature);\n }\n\n if (defined(style.labelText)) {\n feature.labelText = style.labelText.evaluate(feature);\n } else {\n feature.labelText = undefined;\n }\n\n if (defined(style.backgroundColor)) {\n feature.backgroundColor = style.backgroundColor.evaluateColor(\n feature,\n scratchColor5\n );\n }\n\n if (defined(style.backgroundPadding)) {\n feature.backgroundPadding = style.backgroundPadding.evaluate(feature);\n }\n\n if (defined(style.backgroundEnabled)) {\n feature.backgroundEnabled = style.backgroundEnabled.evaluate(feature);\n }\n\n if (defined(style.scaleByDistance)) {\n const scaleByDistanceCart4 = style.scaleByDistance.evaluate(feature);\n scratchScaleByDistance.near = scaleByDistanceCart4.x;\n scratchScaleByDistance.nearValue = scaleByDistanceCart4.y;\n scratchScaleByDistance.far = scaleByDistanceCart4.z;\n scratchScaleByDistance.farValue = scaleByDistanceCart4.w;\n feature.scaleByDistance = scratchScaleByDistance;\n } else {\n feature.scaleByDistance = undefined;\n }\n\n if (defined(style.translucencyByDistance)) {\n const translucencyByDistanceCart4 = style.translucencyByDistance.evaluate(\n feature\n );\n scratchTranslucencyByDistance.near = translucencyByDistanceCart4.x;\n scratchTranslucencyByDistance.nearValue = translucencyByDistanceCart4.y;\n scratchTranslucencyByDistance.far = translucencyByDistanceCart4.z;\n scratchTranslucencyByDistance.farValue = translucencyByDistanceCart4.w;\n feature.translucencyByDistance = scratchTranslucencyByDistance;\n } else {\n feature.translucencyByDistance = undefined;\n }\n\n if (defined(style.distanceDisplayCondition)) {\n const distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate(\n feature\n );\n scratchDistanceDisplayCondition.near = distanceDisplayConditionCart2.x;\n scratchDistanceDisplayCondition.far = distanceDisplayConditionCart2.y;\n feature.distanceDisplayCondition = scratchDistanceDisplayCondition;\n } else {\n feature.distanceDisplayCondition = undefined;\n }\n\n if (defined(style.heightOffset)) {\n feature.heightOffset = style.heightOffset.evaluate(feature);\n }\n\n if (defined(style.anchorLineEnabled)) {\n feature.anchorLineEnabled = style.anchorLineEnabled.evaluate(feature);\n }\n\n if (defined(style.anchorLineColor)) {\n feature.anchorLineColor = style.anchorLineColor.evaluateColor(\n feature,\n scratchColor6\n );\n }\n\n if (defined(style.image)) {\n feature.image = style.image.evaluate(feature);\n } else {\n feature.image = undefined;\n }\n\n if (defined(style.disableDepthTestDistance)) {\n feature.disableDepthTestDistance = style.disableDepthTestDistance.evaluate(\n feature\n );\n }\n\n if (defined(style.horizontalOrigin)) {\n feature.horizontalOrigin = style.horizontalOrigin.evaluate(feature);\n }\n\n if (defined(style.verticalOrigin)) {\n feature.verticalOrigin = style.verticalOrigin.evaluate(feature);\n }\n\n if (defined(style.labelHorizontalOrigin)) {\n feature.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate(\n feature\n );\n }\n\n if (defined(style.labelVerticalOrigin)) {\n feature.labelVerticalOrigin = style.labelVerticalOrigin.evaluate(feature);\n }\n }\n};\n\nfunction initialize(points) {\n return new Promise(function (resolve, reject) {\n points._update = function (points, frameState) {\n const promise = createPoints(points, frameState.mapProjection.ellipsoid);\n\n if (points._ready) {\n points._polylineCollection.update(frameState);\n points._billboardCollection.update(frameState);\n points._labelCollection.update(frameState);\n }\n\n if (!defined(promise)) {\n return;\n }\n\n promise\n .then(function () {\n resolve();\n })\n .catch(function (e) {\n reject(e);\n });\n };\n });\n}\n\n/**\n * @private\n */\nVector3DTilePoints.prototype.update = function (frameState) {\n this._update(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePoints.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePoints.prototype.destroy = function () {\n this._billboardCollection =\n this._billboardCollection && this._billboardCollection.destroy();\n this._labelCollection =\n this._labelCollection && this._labelCollection.destroy();\n this._polylineCollection =\n this._polylineCollection && this._polylineCollection.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTilePoints;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport Vector3DTileBatch from \"./Vector3DTileBatch.js\";\nimport Vector3DTilePrimitive from \"./Vector3DTilePrimitive.js\";\n\n/**\n * Creates a batch of pre-triangulated polygons draped on terrain and/or 3D Tiles.\n *\n * @alias Vector3DTilePolygons\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Float32Array|Uint16Array} options.positions The positions of the polygons. The positions must be contiguous\n * so that the positions for polygon n are in [c, c + counts[n]] where c = sum{counts[0], counts[n - 1]} and they are the outer ring of\n * the polygon in counter-clockwise order.\n * @param {Uint32Array} options.counts The number of positions in the each polygon.\n * @param {Uint32Array} options.indices The indices of the triangulated polygons. The indices must be contiguous so that\n * the indices for polygon n are in [i, i + indexCounts[n]] where i = sum{indexCounts[0], indexCounts[n - 1]}.\n * @param {Uint32Array} options.indexCounts The number of indices for each polygon.\n * @param {Number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {Number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Float32Array} [options.polygonMinimumHeights] An array containing the minimum heights for each polygon.\n * @param {Float32Array} [options.polygonMaximumHeights] An array containing the maximum heights for each polygon.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polygons.\n * @param {Uint16Array} options.batchIds The batch ids for each polygon.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of polygons.\n *\n * @private\n */\nfunction Vector3DTilePolygons(options) {\n // All of the private properties will be released except _readyPromise\n // and _primitive after the Vector3DTilePrimitive is created.\n this._batchTable = options.batchTable;\n\n this._batchIds = options.batchIds;\n this._positions = options.positions;\n this._counts = options.counts;\n\n this._indices = options.indices;\n this._indexCounts = options.indexCounts;\n this._indexOffsets = undefined;\n\n this._batchTableColors = undefined;\n this._packedBuffer = undefined;\n\n this._batchedPositions = undefined;\n this._transferrableBatchIds = undefined;\n this._vertexBatchIds = undefined;\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._minimumHeight = options.minimumHeight;\n this._maximumHeight = options.maximumHeight;\n this._polygonMinimumHeights = options.polygonMinimumHeights;\n this._polygonMaximumHeights = options.polygonMaximumHeights;\n this._center = defaultValue(options.center, Cartesian3.ZERO);\n this._rectangle = options.rectangle;\n\n this._center = undefined;\n\n this._boundingVolume = options.boundingVolume;\n this._boundingVolumes = undefined;\n\n this._batchedIndices = undefined;\n\n this._ready = false;\n this._update = function (polygons, frameState) {};\n this._readyPromise = initialize(this);\n this._verticesPromise = undefined;\n\n this._primitive = undefined;\n\n /**\n * Draws the wireframe of the classification meshes.\n * @type {Boolean}\n * @default false\n */\n this.debugWireframe = false;\n\n /**\n * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.\n * @type {Boolean}\n * @default false\n */\n this.forceRebatch = false;\n\n /**\n * What this tile will classify.\n * @type {ClassificationType}\n * @default ClassificationType.BOTH\n */\n this.classificationType = ClassificationType.BOTH;\n}\n\nObject.defineProperties(Vector3DTilePolygons.prototype, {\n /**\n * Gets the number of triangles.\n *\n * @memberof Vector3DTilePolygons.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n get: function () {\n if (defined(this._primitive)) {\n return this._primitive.trianglesLength;\n }\n return 0;\n },\n },\n\n /**\n * Gets the geometry memory in bytes.\n *\n * @memberof Vector3DTilePolygons.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n get: function () {\n if (defined(this._primitive)) {\n return this._primitive.geometryByteLength;\n }\n return 0;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Vector3DTilePolygons.prototype\n * @type {Promise<void>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction packBuffer(polygons) {\n const packedBuffer = new Float64Array(\n 3 +\n Cartesian3.packedLength +\n Ellipsoid.packedLength +\n Rectangle.packedLength\n );\n\n let offset = 0;\n packedBuffer[offset++] = polygons._indices.BYTES_PER_ELEMENT;\n\n packedBuffer[offset++] = polygons._minimumHeight;\n packedBuffer[offset++] = polygons._maximumHeight;\n\n Cartesian3.pack(polygons._center, packedBuffer, offset);\n offset += Cartesian3.packedLength;\n\n Ellipsoid.pack(polygons._ellipsoid, packedBuffer, offset);\n offset += Ellipsoid.packedLength;\n\n Rectangle.pack(polygons._rectangle, packedBuffer, offset);\n\n return packedBuffer;\n}\n\nfunction unpackBuffer(polygons, packedBuffer) {\n let offset = 1;\n\n const numBVS = packedBuffer[offset++];\n const bvs = (polygons._boundingVolumes = new Array(numBVS));\n\n for (let i = 0; i < numBVS; ++i) {\n bvs[i] = OrientedBoundingBox.unpack(packedBuffer, offset);\n offset += OrientedBoundingBox.packedLength;\n }\n\n const numBatchedIndices = packedBuffer[offset++];\n const bis = (polygons._batchedIndices = new Array(numBatchedIndices));\n\n for (let j = 0; j < numBatchedIndices; ++j) {\n const color = Color.unpack(packedBuffer, offset);\n offset += Color.packedLength;\n\n const indexOffset = packedBuffer[offset++];\n const count = packedBuffer[offset++];\n\n const length = packedBuffer[offset++];\n const batchIds = new Array(length);\n\n for (let k = 0; k < length; ++k) {\n batchIds[k] = packedBuffer[offset++];\n }\n\n bis[j] = new Vector3DTileBatch({\n color: color,\n offset: indexOffset,\n count: count,\n batchIds: batchIds,\n });\n }\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n \"createVectorTilePolygons\",\n 5\n);\nconst scratchColor = new Color();\n\nfunction createPrimitive(polygons) {\n if (defined(polygons._primitive)) {\n return;\n }\n\n if (!defined(polygons._verticesPromise)) {\n let positions = polygons._positions;\n let counts = polygons._counts;\n let indexCounts = polygons._indexCounts;\n let indices = polygons._indices;\n\n let batchIds = polygons._transferrableBatchIds;\n let batchTableColors = polygons._batchTableColors;\n\n let packedBuffer = polygons._packedBuffer;\n\n if (!defined(batchTableColors)) {\n // Copy because they may be the views on the same buffer.\n positions = polygons._positions = polygons._positions.slice();\n counts = polygons._counts = polygons._counts.slice();\n indexCounts = polygons._indexCounts = polygons._indexCounts.slice();\n indices = polygons._indices = polygons._indices.slice();\n\n polygons._center = polygons._ellipsoid.cartographicToCartesian(\n Rectangle.center(polygons._rectangle)\n );\n\n batchIds = polygons._transferrableBatchIds = new Uint32Array(\n polygons._batchIds\n );\n batchTableColors = polygons._batchTableColors = new Uint32Array(\n batchIds.length\n );\n const batchTable = polygons._batchTable;\n\n const length = batchTableColors.length;\n for (let i = 0; i < length; ++i) {\n const color = batchTable.getColor(i, scratchColor);\n batchTableColors[i] = color.toRgba();\n }\n\n packedBuffer = polygons._packedBuffer = packBuffer(polygons);\n }\n\n const transferrableObjects = [\n positions.buffer,\n counts.buffer,\n indexCounts.buffer,\n indices.buffer,\n batchIds.buffer,\n batchTableColors.buffer,\n packedBuffer.buffer,\n ];\n const parameters = {\n packedBuffer: packedBuffer.buffer,\n positions: positions.buffer,\n counts: counts.buffer,\n indexCounts: indexCounts.buffer,\n indices: indices.buffer,\n batchIds: batchIds.buffer,\n batchTableColors: batchTableColors.buffer,\n };\n\n let minimumHeights = polygons._polygonMinimumHeights;\n let maximumHeights = polygons._polygonMaximumHeights;\n if (defined(minimumHeights) && defined(maximumHeights)) {\n minimumHeights = minimumHeights.slice();\n maximumHeights = maximumHeights.slice();\n\n transferrableObjects.push(minimumHeights.buffer, maximumHeights.buffer);\n parameters.minimumHeights = minimumHeights;\n parameters.maximumHeights = maximumHeights;\n }\n\n const verticesPromise = (polygons._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n parameters,\n transferrableObjects\n ));\n if (!defined(verticesPromise)) {\n // Postponed\n return;\n }\n\n return verticesPromise.then(function (result) {\n polygons._positions = undefined;\n polygons._counts = undefined;\n polygons._polygonMinimumHeights = undefined;\n polygons._polygonMaximumHeights = undefined;\n\n const packedBuffer = new Float64Array(result.packedBuffer);\n const indexDatatype = packedBuffer[0];\n unpackBuffer(polygons, packedBuffer);\n\n polygons._indices =\n IndexDatatype.getSizeInBytes(indexDatatype) === 2\n ? new Uint16Array(result.indices)\n : new Uint32Array(result.indices);\n polygons._indexOffsets = new Uint32Array(result.indexOffsets);\n polygons._indexCounts = new Uint32Array(result.indexCounts);\n\n // will be released\n polygons._batchedPositions = new Float32Array(result.positions);\n polygons._vertexBatchIds = new Uint16Array(result.batchIds);\n\n polygons._ready = true;\n });\n }\n}\n\nfunction finishPrimitive(polygons) {\n if (polygons._ready && !defined(polygons._primitive)) {\n polygons._primitive = new Vector3DTilePrimitive({\n batchTable: polygons._batchTable,\n positions: polygons._batchedPositions,\n batchIds: polygons._batchIds,\n vertexBatchIds: polygons._vertexBatchIds,\n indices: polygons._indices,\n indexOffsets: polygons._indexOffsets,\n indexCounts: polygons._indexCounts,\n batchedIndices: polygons._batchedIndices,\n boundingVolume: polygons._boundingVolume,\n boundingVolumes: polygons._boundingVolumes,\n center: polygons._center,\n });\n\n polygons._batchTable = undefined;\n polygons._batchIds = undefined;\n polygons._positions = undefined;\n polygons._counts = undefined;\n polygons._indices = undefined;\n polygons._indexCounts = undefined;\n polygons._indexOffsets = undefined;\n polygons._batchTableColors = undefined;\n polygons._packedBuffer = undefined;\n polygons._batchedPositions = undefined;\n polygons._transferrableBatchIds = undefined;\n polygons._vertexBatchIds = undefined;\n polygons._ellipsoid = undefined;\n polygons._minimumHeight = undefined;\n polygons._maximumHeight = undefined;\n polygons._polygonMinimumHeights = undefined;\n polygons._polygonMaximumHeights = undefined;\n polygons._center = undefined;\n polygons._rectangle = undefined;\n polygons._boundingVolume = undefined;\n polygons._boundingVolumes = undefined;\n polygons._batchedIndices = undefined;\n polygons._verticesPromise = undefined;\n }\n}\n\n/**\n * Creates features for each polygon and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePolygons.prototype.createFeatures = function (content, features) {\n this._primitive.createFeatures(content, features);\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polygon batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePolygons.prototype.applyDebugSettings = function (enabled, color) {\n this._primitive.applyDebugSettings(enabled, color);\n};\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePolygons.prototype.applyStyle = function (style, features) {\n this._primitive.applyStyle(style, features);\n};\n\n/**\n * Call when updating the color of a polygon with batchId changes color. The polygons will need to be re-batched\n * on the next update.\n *\n * @param {Number} batchId The batch id of the polygon whose color has changed.\n * @param {Color} color The new polygon color.\n */\nVector3DTilePolygons.prototype.updateCommands = function (batchId, color) {\n this._primitive.updateCommands(batchId, color);\n};\n\nfunction initialize(polygons) {\n return new Promise(function (resolve, reject) {\n polygons._update = function (polygons, frameState) {\n const promise = createPrimitive(polygons);\n\n if (polygons._ready) {\n polygons._primitive.debugWireframe = polygons.debugWireframe;\n polygons._primitive.forceRebatch = polygons.forceRebatch;\n polygons._primitive.classificationType = polygons.classificationType;\n polygons._primitive.update(frameState);\n }\n\n if (!defined(promise)) {\n return;\n }\n\n promise\n .then(function () {\n finishPrimitive(polygons);\n resolve(polygons);\n })\n .catch(function (e) {\n reject(e);\n });\n };\n });\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePolygons.prototype.update = function (frameState) {\n this._update(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePolygons.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePolygons.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTilePolygons;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 currentPosition;\\n\\\nattribute vec4 previousPosition;\\n\\\nattribute vec4 nextPosition;\\n\\\nattribute vec2 expandAndWidth;\\n\\\nattribute float a_batchId;\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat expandDir = expandAndWidth.x;\\n\\\nfloat width = abs(expandAndWidth.y) + 0.5;\\n\\\nbool usePrev = expandAndWidth.y < 0.0;\\n\\\nvec4 p = u_modifiedModelView * currentPosition;\\n\\\nvec4 prev = u_modifiedModelView * previousPosition;\\n\\\nvec4 next = u_modifiedModelView * nextPosition;\\n\\\nfloat angle;\\n\\\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\\n\\\ngl_Position = czm_viewportOrthographic * positionWC;\\n\\\n}\\n\\\n\";\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Vector3DTilePolylinesVS from \"../Shaders/Vector3DTilePolylinesVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\n\n/**\n * Creates a batch of polylines that have been subdivided to be draped on terrain.\n *\n * @alias Vector3DTilePolylines\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polylines\n * @param {Uint32Array} options.counts The number or positions in the each polyline.\n * @param {Uint16Array} options.widths The width of each polyline.\n * @param {Number} options.minimumHeight The minimum height of the terrain covered by the tile.\n * @param {Number} options.maximumHeight The maximum height of the terrain covered by the tile.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polylines.\n * @param {Uint16Array} options.batchIds The batch ids for each polyline.\n * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of polylines.\n * @param {Boolean} options.keepDecodedPositions Whether to keep decoded positions in memory.\n *\n * @private\n */\nfunction Vector3DTilePolylines(options) {\n // these arrays are all released after the first update.\n this._positions = options.positions;\n this._widths = options.widths;\n this._counts = options.counts;\n this._batchIds = options.batchIds;\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._minimumHeight = options.minimumHeight;\n this._maximumHeight = options.maximumHeight;\n this._center = options.center;\n this._rectangle = options.rectangle;\n\n this._boundingVolume = options.boundingVolume;\n this._batchTable = options.batchTable;\n\n this._va = undefined;\n this._sp = undefined;\n this._rs = undefined;\n this._uniformMap = undefined;\n this._command = undefined;\n\n this._transferrableBatchIds = undefined;\n this._packedBuffer = undefined;\n\n this._keepDecodedPositions = options.keepDecodedPositions;\n this._decodedPositions = undefined;\n this._decodedPositionOffsets = undefined;\n\n this._currentPositions = undefined;\n this._previousPositions = undefined;\n this._nextPositions = undefined;\n this._expandAndWidth = undefined;\n this._vertexBatchIds = undefined;\n this._indices = undefined;\n\n this._constantColor = Color.clone(Color.WHITE);\n this._highlightColor = this._constantColor;\n\n this._trianglesLength = 0;\n this._geometryByteLength = 0;\n\n this._ready = false;\n this._update = function (polylines, frameState) {};\n this._readyPromise = initialize(this);\n\n this._verticesPromise = undefined;\n}\n\nObject.defineProperties(Vector3DTilePolylines.prototype, {\n /**\n * Gets the number of triangles.\n *\n * @memberof Vector3DTilePolylines.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n get: function () {\n return this._trianglesLength;\n },\n },\n\n /**\n * Gets the geometry memory in bytes.\n *\n * @memberof Vector3DTilePolylines.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n get: function () {\n return this._geometryByteLength;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Vector3DTilePolylines.prototype\n * @type {Promise<void>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction packBuffer(polylines) {\n const rectangle = polylines._rectangle;\n const minimumHeight = polylines._minimumHeight;\n const maximumHeight = polylines._maximumHeight;\n const ellipsoid = polylines._ellipsoid;\n const center = polylines._center;\n\n const packedLength =\n 2 +\n Rectangle.packedLength +\n Ellipsoid.packedLength +\n Cartesian3.packedLength;\n const packedBuffer = new Float64Array(packedLength);\n\n let offset = 0;\n packedBuffer[offset++] = minimumHeight;\n packedBuffer[offset++] = maximumHeight;\n\n Rectangle.pack(rectangle, packedBuffer, offset);\n offset += Rectangle.packedLength;\n\n Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n offset += Ellipsoid.packedLength;\n\n Cartesian3.pack(center, packedBuffer, offset);\n\n return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n \"createVectorTilePolylines\",\n 5\n);\nconst attributeLocations = {\n previousPosition: 0,\n currentPosition: 1,\n nextPosition: 2,\n expandAndWidth: 3,\n a_batchId: 4,\n};\n\nfunction createVertexArray(polylines, context) {\n if (defined(polylines._va)) {\n return;\n }\n\n if (!defined(polylines._verticesPromise)) {\n let positions = polylines._positions;\n let widths = polylines._widths;\n let counts = polylines._counts;\n let batchIds = polylines._transferrableBatchIds;\n\n let packedBuffer = polylines._packedBuffer;\n\n if (!defined(packedBuffer)) {\n // Copy because they may be the views on the same buffer.\n positions = polylines._positions = positions.slice();\n widths = polylines._widths = widths.slice();\n counts = polylines._counts = counts.slice();\n\n batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();\n\n packedBuffer = polylines._packedBuffer = packBuffer(polylines);\n }\n\n const transferrableObjects = [\n positions.buffer,\n widths.buffer,\n counts.buffer,\n batchIds.buffer,\n packedBuffer.buffer,\n ];\n const parameters = {\n positions: positions.buffer,\n widths: widths.buffer,\n counts: counts.buffer,\n batchIds: batchIds.buffer,\n packedBuffer: packedBuffer.buffer,\n keepDecodedPositions: polylines._keepDecodedPositions,\n };\n\n const verticesPromise = (polylines._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n parameters,\n transferrableObjects\n ));\n if (!defined(verticesPromise)) {\n // Postponed\n return;\n }\n\n return verticesPromise.then(function (result) {\n if (polylines._keepDecodedPositions) {\n polylines._decodedPositions = new Float64Array(result.decodedPositions);\n polylines._decodedPositionOffsets = new Uint32Array(\n result.decodedPositionOffsets\n );\n }\n\n polylines._currentPositions = new Float32Array(result.currentPositions);\n polylines._previousPositions = new Float32Array(result.previousPositions);\n polylines._nextPositions = new Float32Array(result.nextPositions);\n polylines._expandAndWidth = new Float32Array(result.expandAndWidth);\n polylines._vertexBatchIds = new Uint16Array(result.batchIds);\n\n const indexDatatype = result.indexDatatype;\n polylines._indices =\n indexDatatype === IndexDatatype.UNSIGNED_SHORT\n ? new Uint16Array(result.indices)\n : new Uint32Array(result.indices);\n\n polylines._ready = true;\n });\n }\n}\n\nfunction finishVertexArray(polylines, context) {\n if (polylines._ready && !defined(polylines._va)) {\n const curPositions = polylines._currentPositions;\n const prevPositions = polylines._previousPositions;\n const nextPositions = polylines._nextPositions;\n const expandAndWidth = polylines._expandAndWidth;\n const vertexBatchIds = polylines._vertexBatchIds;\n const indices = polylines._indices;\n\n let byteLength =\n prevPositions.byteLength +\n curPositions.byteLength +\n nextPositions.byteLength;\n byteLength +=\n expandAndWidth.byteLength +\n vertexBatchIds.byteLength +\n indices.byteLength;\n polylines._trianglesLength = indices.length / 3;\n polylines._geometryByteLength = byteLength;\n\n const prevPositionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: prevPositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const curPositionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: curPositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const nextPositionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: nextPositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const expandAndWidthBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: expandAndWidth,\n usage: BufferUsage.STATIC_DRAW,\n });\n const idBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: vertexBatchIds,\n usage: BufferUsage.STATIC_DRAW,\n });\n\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype:\n indices.BYTES_PER_ELEMENT === 2\n ? IndexDatatype.UNSIGNED_SHORT\n : IndexDatatype.UNSIGNED_INT,\n });\n\n const vertexAttributes = [\n {\n index: attributeLocations.previousPosition,\n vertexBuffer: prevPositionBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n index: attributeLocations.currentPosition,\n vertexBuffer: curPositionBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n index: attributeLocations.nextPosition,\n vertexBuffer: nextPositionBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n index: attributeLocations.expandAndWidth,\n vertexBuffer: expandAndWidthBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n },\n {\n index: attributeLocations.a_batchId,\n vertexBuffer: idBuffer,\n componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n componentsPerAttribute: 1,\n },\n ];\n\n polylines._va = new VertexArray({\n context: context,\n attributes: vertexAttributes,\n indexBuffer: indexBuffer,\n });\n\n polylines._positions = undefined;\n polylines._widths = undefined;\n polylines._counts = undefined;\n\n polylines._ellipsoid = undefined;\n polylines._minimumHeight = undefined;\n polylines._maximumHeight = undefined;\n polylines._rectangle = undefined;\n\n polylines._transferrableBatchIds = undefined;\n polylines._packedBuffer = undefined;\n\n polylines._currentPositions = undefined;\n polylines._previousPositions = undefined;\n polylines._nextPositions = undefined;\n polylines._expandAndWidth = undefined;\n polylines._vertexBatchIds = undefined;\n polylines._indices = undefined;\n }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n if (defined(primitive._uniformMap)) {\n return;\n }\n\n primitive._uniformMap = {\n u_modifiedModelView: function () {\n const viewMatrix = context.uniformState.view;\n Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n Matrix4.multiplyByPoint(\n modifiedModelViewScratch,\n primitive._center,\n rtcScratch\n );\n Matrix4.setTranslation(\n modifiedModelViewScratch,\n rtcScratch,\n modifiedModelViewScratch\n );\n return modifiedModelViewScratch;\n },\n u_highlightColor: function () {\n return primitive._highlightColor;\n },\n };\n}\n\nfunction createRenderStates(primitive) {\n if (defined(primitive._rs)) {\n return;\n }\n\n const polygonOffset = {\n enabled: true,\n factor: -5.0,\n units: -5.0,\n };\n\n primitive._rs = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n depthMask: false,\n depthTest: {\n enabled: true,\n },\n polygonOffset: polygonOffset,\n });\n}\n\nconst PolylineFS =\n \"uniform vec4 u_highlightColor; \\n\" +\n \"void main()\\n\" +\n \"{\\n\" +\n \" gl_FragColor = u_highlightColor;\\n\" +\n \"}\\n\";\n\nfunction createShaders(primitive, context) {\n if (defined(primitive._sp)) {\n return;\n }\n\n const batchTable = primitive._batchTable;\n\n const vsSource = batchTable.getVertexShaderCallback(\n false,\n \"a_batchId\",\n undefined\n )(Vector3DTilePolylinesVS);\n const fsSource = batchTable.getFragmentShaderCallback(\n false,\n undefined,\n false\n )(PolylineFS);\n\n const vs = new ShaderSource({\n defines: [\n \"VECTOR_TILE\",\n !FeatureDetection.isInternetExplorer() ? \"CLIP_POLYLINE\" : \"\",\n ],\n sources: [PolylineCommon, vsSource],\n });\n const fs = new ShaderSource({\n defines: [\"VECTOR_TILE\"],\n sources: [fsSource],\n });\n\n primitive._sp = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n}\n\nfunction queueCommands(primitive, frameState) {\n if (!defined(primitive._command)) {\n const uniformMap = primitive._batchTable.getUniformMapCallback()(\n primitive._uniformMap\n );\n primitive._command = new DrawCommand({\n owner: primitive,\n vertexArray: primitive._va,\n renderState: primitive._rs,\n shaderProgram: primitive._sp,\n uniformMap: uniformMap,\n boundingVolume: primitive._boundingVolume,\n pass: Pass.TRANSLUCENT,\n pickId: primitive._batchTable.getPickId(),\n });\n }\n\n frameState.commandList.push(primitive._command);\n}\n\nVector3DTilePolylines.getPolylinePositions = function (polylines, batchId) {\n const batchIds = polylines._batchIds;\n const positions = polylines._decodedPositions;\n const offsets = polylines._decodedPositionOffsets;\n\n if (!defined(batchIds) || !defined(positions)) {\n return undefined;\n }\n\n let i;\n let j;\n const polylinesLength = batchIds.length;\n let positionsLength = 0;\n let resultCounter = 0;\n\n for (i = 0; i < polylinesLength; ++i) {\n if (batchIds[i] === batchId) {\n positionsLength += offsets[i + 1] - offsets[i];\n }\n }\n\n if (positionsLength === 0) {\n return undefined;\n }\n\n const results = new Float64Array(positionsLength * 3);\n\n for (i = 0; i < polylinesLength; ++i) {\n if (batchIds[i] === batchId) {\n const offset = offsets[i];\n const count = offsets[i + 1] - offset;\n for (j = 0; j < count; ++j) {\n const decodedOffset = (offset + j) * 3;\n results[resultCounter++] = positions[decodedOffset];\n results[resultCounter++] = positions[decodedOffset + 1];\n results[resultCounter++] = positions[decodedOffset + 2];\n }\n }\n }\n\n return results;\n};\n\n/**\n * Get the polyline positions for the given feature.\n *\n * @param {Number} batchId The batch ID of the feature.\n */\nVector3DTilePolylines.prototype.getPositions = function (batchId) {\n return Vector3DTilePolylines.getPolylinePositions(this, batchId);\n};\n\n/**\n * Creates features for each polyline and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTilePolylines.prototype.createFeatures = function (content, features) {\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n features[batchId] = new Cesium3DTileFeature(content, batchId);\n }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polyline batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTilePolylines.prototype.applyDebugSettings = function (enabled, color) {\n this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n const batchIds = polygons._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.show = true;\n feature.color = Color.WHITE;\n }\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The array of features.\n */\nVector3DTilePolylines.prototype.applyStyle = function (style, features) {\n if (!defined(style)) {\n clearStyle(this, features);\n return;\n }\n\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.color = defined(style.color)\n ? style.color.evaluateColor(feature, scratchColor)\n : DEFAULT_COLOR_VALUE;\n feature.show = defined(style.show)\n ? style.show.evaluate(feature)\n : DEFAULT_SHOW_VALUE;\n }\n};\n\nfunction initialize(polylines) {\n return new Promise(function (resolve, reject) {\n polylines._update = function (polylines, frameState) {\n const context = frameState.context;\n const promise = createVertexArray(polylines, context);\n createUniformMap(polylines, context);\n createShaders(polylines, context);\n createRenderStates(polylines);\n\n if (polylines._ready) {\n const passes = frameState.passes;\n if (passes.render || passes.pick) {\n queueCommands(polylines, frameState);\n }\n }\n\n if (!defined(promise)) {\n return;\n }\n\n promise\n .then(function () {\n finishVertexArray(polylines, context);\n resolve();\n })\n .catch(function (e) {\n reject(e);\n });\n };\n });\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTilePolylines.prototype.update = function (frameState) {\n this._update(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTilePolylines.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTilePolylines.prototype.destroy = function () {\n this._va = this._va && this._va.destroy();\n this._sp = this._sp && this._sp.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTilePolylines;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 startEllipsoidNormal;\\n\\\nattribute vec3 endEllipsoidNormal;\\n\\\nattribute vec4 startPositionAndHeight;\\n\\\nattribute vec4 endPositionAndHeight;\\n\\\nattribute vec4 startFaceNormalAndVertexCorner;\\n\\\nattribute vec4 endFaceNormalAndHalfWidth;\\n\\\nattribute float a_batchId;\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\nuniform vec2 u_minimumMaximumVectorHeights;\\n\\\nvarying vec4 v_startPlaneEC;\\n\\\nvarying vec4 v_endPlaneEC;\\n\\\nvarying vec4 v_rightPlaneEC;\\n\\\nvarying float v_halfWidth;\\n\\\nvarying vec3 v_volumeUpEC;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251);\\n\\\nfloat isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd));\\n\\\nvec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\\n\\\nvec3 right = normalize(cross(forward, startEllipsoidNormal));\\n\\\nvec4 position = vec4(startPositionAndHeight.xyz, 1.0);\\n\\\nposition.xyz += forward * isEnd;\\n\\\nv_volumeUpEC = czm_normal * normalize(cross(right, forward));\\n\\\nfloat offset;\\n\\\nvec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\\n\\\noffset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\\n\\\noffset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\\n\\\nposition.xyz += offset * ellipsoidNormal;\\n\\\nposition = u_modifiedModelView * position;\\n\\\nright = czm_normal * right;\\n\\\nvec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\\n\\\nscratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\\n\\\nvec3 miterPushNormal = czm_normal * normalize(scratchNormal);\\n\\\noffset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position));\\n\\\noffset = offset / dot(miterPushNormal, right);\\n\\\nposition.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\\n\\\ngl_Position = czm_depthClamp(czm_projection * position);\\n\\\nposition = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\\n\\\nvec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\\n\\\nv_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\\n\\\nv_rightPlaneEC = vec4(right, -dot(right, position.xyz));\\n\\\nposition = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\\n\\\nvec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\\n\\\nv_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\\n\\\nv_halfWidth = endFaceNormalAndHalfWidth.w;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef GL_EXT_frag_depth\\n\\\n#extension GL_EXT_frag_depth : enable\\n\\\n#endif\\n\\\nvarying vec4 v_startPlaneEC;\\n\\\nvarying vec4 v_endPlaneEC;\\n\\\nvarying vec4 v_rightPlaneEC;\\n\\\nvarying float v_halfWidth;\\n\\\nvarying vec3 v_volumeUpEC;\\n\\\nuniform vec4 u_highlightColor;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\\n\\\nif (logDepthOrDepth == 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\ngl_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\\n\\\nreturn;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\ndiscard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n}\\n\\\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\\n\\\neyeCoordinate /= eyeCoordinate.w;\\n\\\nfloat halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\\n\\\nhalfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\\n\\\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\\n\\\nfloat distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\\n\\\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\\n\\\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\\n\\\n#ifdef DEBUG_SHOW_VOLUME\\n\\\ngl_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\\n\\\nreturn;\\n\\\n#else // DEBUG_SHOW_VOLUME\\n\\\ndiscard;\\n\\\n#endif // DEBUG_SHOW_VOLUME\\n\\\n}\\n\\\ngl_FragColor = u_highlightColor;\\n\\\nczm_writeDepthClamp();\\n\\\n}\\n\\\n\";\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport PolylineCommon from \"../Shaders/PolylineCommon.js\";\nimport Vector3DTileClampedPolylinesVS from \"../Shaders/Vector3DTileClampedPolylinesVS.js\";\nimport Vector3DTileClampedPolylinesFS from \"../Shaders/Vector3DTileClampedPolylinesFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport ClassificationType from \"./ClassificationType.js\";\nimport CullFace from \"./CullFace.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\nimport Vector3DTilePolylines from \"./Vector3DTilePolylines.js\";\n\n/**\n * Creates a batch of polylines as volumes with shader-adjustable width.\n *\n * @alias Vector3DTileClampedPolylines\n * @constructor\n *\n * @param {Object} options An object with following properties:\n * @param {Uint16Array} options.positions The positions of the polylines\n * @param {Uint32Array} options.counts The number or positions in the each polyline.\n * @param {Uint16Array} options.widths The width of each polyline.\n * @param {Number} options.minimumHeight The minimum height of the tile's region.\n * @param {Number} options.maximumHeight The maximum height of the tile's region.\n * @param {Rectangle} options.rectangle The rectangle containing the tile.\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The RTC center.\n * @param {Cesium3DTileBatchTable} options.batchTable The batch table for the tile containing the batched polylines.\n * @param {Uint16Array} options.batchIds The batch ids for each polyline.\n * @param {ClassificationType} options.classificationType The classification type.\n * @param {Boolean} options.keepDecodedPositions Whether to keep decoded positions in memory.\n *\n * @private\n */\nfunction Vector3DTileClampedPolylines(options) {\n // these arrays hold data from the tile payload\n // and are all released after the first update.\n this._positions = options.positions;\n this._widths = options.widths;\n this._counts = options.counts;\n this._batchIds = options.batchIds;\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._minimumHeight = options.minimumHeight;\n this._maximumHeight = options.maximumHeight;\n this._center = options.center;\n this._rectangle = options.rectangle;\n\n this._batchTable = options.batchTable;\n\n this._va = undefined;\n this._sp = undefined;\n this._rs = undefined;\n this._uniformMap = undefined;\n this._command = undefined;\n\n this._transferrableBatchIds = undefined;\n this._packedBuffer = undefined;\n this._minimumMaximumVectorHeights = new Cartesian2(\n ApproximateTerrainHeights._defaultMinTerrainHeight,\n ApproximateTerrainHeights._defaultMaxTerrainHeight\n );\n this._boundingVolume = OrientedBoundingBox.fromRectangle(\n options.rectangle,\n ApproximateTerrainHeights._defaultMinTerrainHeight,\n ApproximateTerrainHeights._defaultMaxTerrainHeight,\n this._ellipsoid\n );\n this._classificationType = options.classificationType;\n\n this._keepDecodedPositions = options.keepDecodedPositions;\n this._decodedPositions = undefined;\n this._decodedPositionOffsets = undefined;\n\n // Fat vertices - all information for each volume packed to a vec3 and 5 vec4s\n this._startEllipsoidNormals = undefined;\n this._endEllipsoidNormals = undefined;\n this._startPositionAndHeights = undefined;\n this._startFaceNormalAndVertexCornerIds = undefined;\n this._endPositionAndHeights = undefined;\n this._endFaceNormalAndHalfWidths = undefined;\n this._vertexBatchIds = undefined;\n\n this._indices = undefined;\n\n this._constantColor = Color.clone(Color.WHITE);\n this._highlightColor = this._constantColor;\n\n this._trianglesLength = 0;\n this._geometryByteLength = 0;\n\n this._ready = false;\n this._update = function (polylines, frameState) {};\n this._readyPromise = initialize(this);\n this._verticesPromise = undefined;\n}\n\nObject.defineProperties(Vector3DTileClampedPolylines.prototype, {\n /**\n * Gets the number of triangles.\n *\n * @memberof Vector3DTileClampedPolylines.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n get: function () {\n return this._trianglesLength;\n },\n },\n\n /**\n * Gets the geometry memory in bytes.\n *\n * @memberof Vector3DTileClampedPolylines.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n get: function () {\n return this._geometryByteLength;\n },\n },\n\n /**\n * Gets a promise that resolves when the primitive is ready to render.\n * @memberof Vector3DTileClampedPolylines.prototype\n * @type {Promise}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction updateMinimumMaximumHeights(polylines, rectangle, ellipsoid) {\n const result = ApproximateTerrainHeights.getMinimumMaximumHeights(\n rectangle,\n ellipsoid\n );\n const min = result.minimumTerrainHeight;\n const max = result.maximumTerrainHeight;\n const minimumMaximumVectorHeights = polylines._minimumMaximumVectorHeights;\n minimumMaximumVectorHeights.x = min;\n minimumMaximumVectorHeights.y = max;\n\n const obb = polylines._boundingVolume;\n const rect = polylines._rectangle;\n OrientedBoundingBox.fromRectangle(rect, min, max, ellipsoid, obb);\n}\n\nfunction packBuffer(polylines) {\n const rectangle = polylines._rectangle;\n const minimumHeight = polylines._minimumHeight;\n const maximumHeight = polylines._maximumHeight;\n const ellipsoid = polylines._ellipsoid;\n const center = polylines._center;\n\n const packedLength =\n 2 +\n Rectangle.packedLength +\n Ellipsoid.packedLength +\n Cartesian3.packedLength;\n const packedBuffer = new Float64Array(packedLength);\n\n let offset = 0;\n packedBuffer[offset++] = minimumHeight;\n packedBuffer[offset++] = maximumHeight;\n\n Rectangle.pack(rectangle, packedBuffer, offset);\n offset += Rectangle.packedLength;\n\n Ellipsoid.pack(ellipsoid, packedBuffer, offset);\n offset += Ellipsoid.packedLength;\n\n Cartesian3.pack(center, packedBuffer, offset);\n\n return packedBuffer;\n}\n\nconst createVerticesTaskProcessor = new TaskProcessor(\n \"createVectorTileClampedPolylines\"\n);\nconst attributeLocations = {\n startEllipsoidNormal: 0,\n endEllipsoidNormal: 1,\n startPositionAndHeight: 2,\n endPositionAndHeight: 3,\n startFaceNormalAndVertexCorner: 4,\n endFaceNormalAndHalfWidth: 5,\n a_batchId: 6,\n};\n\nfunction createVertexArray(polylines, context) {\n if (defined(polylines._va)) {\n return;\n }\n\n if (!defined(polylines._verticesPromise)) {\n let positions = polylines._positions;\n let widths = polylines._widths;\n let counts = polylines._counts;\n let batchIds = polylines._transferrableBatchIds;\n\n let packedBuffer = polylines._packedBuffer;\n\n if (!defined(packedBuffer)) {\n // Copy because they may be the views on the same buffer.\n positions = polylines._positions = positions.slice();\n widths = polylines._widths = widths.slice();\n counts = polylines._counts = counts.slice();\n\n batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();\n\n packedBuffer = polylines._packedBuffer = packBuffer(polylines);\n }\n\n const transferrableObjects = [\n positions.buffer,\n widths.buffer,\n counts.buffer,\n batchIds.buffer,\n packedBuffer.buffer,\n ];\n const parameters = {\n positions: positions.buffer,\n widths: widths.buffer,\n counts: counts.buffer,\n batchIds: batchIds.buffer,\n packedBuffer: packedBuffer.buffer,\n keepDecodedPositions: polylines._keepDecodedPositions,\n };\n\n const verticesPromise = (polylines._verticesPromise = createVerticesTaskProcessor.scheduleTask(\n parameters,\n transferrableObjects\n ));\n if (!defined(verticesPromise)) {\n // Postponed\n return;\n }\n\n return verticesPromise.then(function (result) {\n if (polylines._keepDecodedPositions) {\n polylines._decodedPositions = new Float64Array(result.decodedPositions);\n polylines._decodedPositionOffsets = new Uint32Array(\n result.decodedPositionOffsets\n );\n }\n\n polylines._startEllipsoidNormals = new Float32Array(\n result.startEllipsoidNormals\n );\n polylines._endEllipsoidNormals = new Float32Array(\n result.endEllipsoidNormals\n );\n polylines._startPositionAndHeights = new Float32Array(\n result.startPositionAndHeights\n );\n polylines._startFaceNormalAndVertexCornerIds = new Float32Array(\n result.startFaceNormalAndVertexCornerIds\n );\n polylines._endPositionAndHeights = new Float32Array(\n result.endPositionAndHeights\n );\n polylines._endFaceNormalAndHalfWidths = new Float32Array(\n result.endFaceNormalAndHalfWidths\n );\n polylines._vertexBatchIds = new Uint16Array(result.vertexBatchIds);\n\n const indexDatatype = result.indexDatatype;\n polylines._indices =\n indexDatatype === IndexDatatype.UNSIGNED_SHORT\n ? new Uint16Array(result.indices)\n : new Uint32Array(result.indices);\n\n polylines._ready = true;\n });\n }\n}\n\nfunction finishVertexArray(polylines, context) {\n if (polylines._ready && !defined(polylines._va)) {\n const startEllipsoidNormals = polylines._startEllipsoidNormals;\n const endEllipsoidNormals = polylines._endEllipsoidNormals;\n const startPositionAndHeights = polylines._startPositionAndHeights;\n const endPositionAndHeights = polylines._endPositionAndHeights;\n const startFaceNormalAndVertexCornerIds =\n polylines._startFaceNormalAndVertexCornerIds;\n const endFaceNormalAndHalfWidths = polylines._endFaceNormalAndHalfWidths;\n const batchIdAttribute = polylines._vertexBatchIds;\n\n const indices = polylines._indices;\n\n let byteLength =\n startEllipsoidNormals.byteLength + endEllipsoidNormals.byteLength;\n byteLength +=\n startPositionAndHeights.byteLength + endPositionAndHeights.byteLength;\n byteLength +=\n startFaceNormalAndVertexCornerIds.byteLength +\n endFaceNormalAndHalfWidths.byteLength;\n byteLength += batchIdAttribute.byteLength + indices.byteLength;\n\n polylines._trianglesLength = indices.length / 3;\n polylines._geometryByteLength = byteLength;\n\n const startEllipsoidNormalsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: startEllipsoidNormals,\n usage: BufferUsage.STATIC_DRAW,\n });\n const endEllipsoidNormalsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: endEllipsoidNormals,\n usage: BufferUsage.STATIC_DRAW,\n });\n const startPositionAndHeightsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: startPositionAndHeights,\n usage: BufferUsage.STATIC_DRAW,\n });\n const endPositionAndHeightsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: endPositionAndHeights,\n usage: BufferUsage.STATIC_DRAW,\n });\n const startFaceNormalAndVertexCornerIdsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: startFaceNormalAndVertexCornerIds,\n usage: BufferUsage.STATIC_DRAW,\n });\n const endFaceNormalAndHalfWidthsBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: endFaceNormalAndHalfWidths,\n usage: BufferUsage.STATIC_DRAW,\n });\n const batchIdAttributeBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: batchIdAttribute,\n usage: BufferUsage.STATIC_DRAW,\n });\n\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype:\n indices.BYTES_PER_ELEMENT === 2\n ? IndexDatatype.UNSIGNED_SHORT\n : IndexDatatype.UNSIGNED_INT,\n });\n\n const vertexAttributes = [\n {\n index: attributeLocations.startEllipsoidNormal,\n vertexBuffer: startEllipsoidNormalsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n index: attributeLocations.endEllipsoidNormal,\n vertexBuffer: endEllipsoidNormalsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n },\n {\n index: attributeLocations.startPositionAndHeight,\n vertexBuffer: startPositionAndHeightsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n },\n {\n index: attributeLocations.endPositionAndHeight,\n vertexBuffer: endPositionAndHeightsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n },\n {\n index: attributeLocations.startFaceNormalAndVertexCorner,\n vertexBuffer: startFaceNormalAndVertexCornerIdsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n },\n {\n index: attributeLocations.endFaceNormalAndHalfWidth,\n vertexBuffer: endFaceNormalAndHalfWidthsBuffer,\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 4,\n },\n {\n index: attributeLocations.a_batchId,\n vertexBuffer: batchIdAttributeBuffer,\n componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n componentsPerAttribute: 1,\n },\n ];\n\n polylines._va = new VertexArray({\n context: context,\n attributes: vertexAttributes,\n indexBuffer: indexBuffer,\n });\n\n polylines._positions = undefined;\n polylines._widths = undefined;\n polylines._counts = undefined;\n\n polylines._ellipsoid = undefined;\n polylines._minimumHeight = undefined;\n polylines._maximumHeight = undefined;\n polylines._rectangle = undefined;\n\n polylines._transferrableBatchIds = undefined;\n polylines._packedBuffer = undefined;\n\n polylines._startEllipsoidNormals = undefined;\n polylines._endEllipsoidNormals = undefined;\n polylines._startPositionAndHeights = undefined;\n polylines._startFaceNormalAndVertexCornerIds = undefined;\n polylines._endPositionAndHeights = undefined;\n polylines._endFaceNormalAndHalfWidths = undefined;\n polylines._vertexBatchIds = undefined;\n\n polylines._indices = undefined;\n }\n}\n\nconst modifiedModelViewScratch = new Matrix4();\nconst rtcScratch = new Cartesian3();\n\nfunction createUniformMap(primitive, context) {\n if (defined(primitive._uniformMap)) {\n return;\n }\n\n primitive._uniformMap = {\n u_modifiedModelView: function () {\n const viewMatrix = context.uniformState.view;\n Matrix4.clone(viewMatrix, modifiedModelViewScratch);\n Matrix4.multiplyByPoint(\n modifiedModelViewScratch,\n primitive._center,\n rtcScratch\n );\n Matrix4.setTranslation(\n modifiedModelViewScratch,\n rtcScratch,\n modifiedModelViewScratch\n );\n return modifiedModelViewScratch;\n },\n u_highlightColor: function () {\n return primitive._highlightColor;\n },\n u_minimumMaximumVectorHeights: function () {\n return primitive._minimumMaximumVectorHeights;\n },\n };\n}\n\nfunction getRenderState(mask3DTiles) {\n /**\n * Cull front faces of each volume (relative to camera) to prevent\n * classification drawing from both the front and back faces, double-draw.\n * The geometry is \"inverted\" (inside-out winding order for the indices) but\n * the vertex shader seems to re-invert so that the triangles face \"out\" again.\n * So cull FRONT faces.\n */\n return RenderState.fromCache({\n cull: {\n enabled: true,\n face: CullFace.FRONT,\n },\n blending: BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,\n depthMask: false,\n stencilTest: {\n enabled: mask3DTiles,\n frontFunction: StencilFunction.EQUAL,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: StencilFunction.EQUAL,\n backOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n });\n}\n\nfunction createRenderStates(primitive) {\n if (defined(primitive._rs)) {\n return;\n }\n\n primitive._rs = getRenderState(false);\n primitive._rs3DTiles = getRenderState(true);\n}\n\nfunction createShaders(primitive, context) {\n if (defined(primitive._sp)) {\n return;\n }\n\n const batchTable = primitive._batchTable;\n\n const vsSource = batchTable.getVertexShaderCallback(\n false,\n \"a_batchId\",\n undefined\n )(Vector3DTileClampedPolylinesVS);\n const fsSource = batchTable.getFragmentShaderCallback(\n false,\n undefined,\n true\n )(Vector3DTileClampedPolylinesFS);\n\n const vs = new ShaderSource({\n defines: [\n \"VECTOR_TILE\",\n !FeatureDetection.isInternetExplorer() ? \"CLIP_POLYLINE\" : \"\",\n ],\n sources: [PolylineCommon, vsSource],\n });\n const fs = new ShaderSource({\n defines: [\"VECTOR_TILE\"],\n sources: [fsSource],\n });\n\n primitive._sp = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n}\n\nfunction queueCommands(primitive, frameState) {\n let command = primitive._command;\n if (!defined(primitive._command)) {\n const uniformMap = primitive._batchTable.getUniformMapCallback()(\n primitive._uniformMap\n );\n command = primitive._command = new DrawCommand({\n owner: primitive,\n vertexArray: primitive._va,\n renderState: primitive._rs,\n shaderProgram: primitive._sp,\n uniformMap: uniformMap,\n boundingVolume: primitive._boundingVolume,\n pass: Pass.TERRAIN_CLASSIFICATION,\n pickId: primitive._batchTable.getPickId(),\n });\n\n const derivedTilesetCommand = DrawCommand.shallowClone(\n command,\n command.derivedCommands.tileset\n );\n derivedTilesetCommand.renderState = primitive._rs3DTiles;\n derivedTilesetCommand.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;\n command.derivedCommands.tileset = derivedTilesetCommand;\n }\n\n const classificationType = primitive._classificationType;\n if (\n classificationType === ClassificationType.TERRAIN ||\n classificationType === ClassificationType.BOTH\n ) {\n frameState.commandList.push(command);\n }\n if (\n classificationType === ClassificationType.CESIUM_3D_TILE ||\n classificationType === ClassificationType.BOTH\n ) {\n frameState.commandList.push(command.derivedCommands.tileset);\n }\n}\n\n/**\n * Get the polyline positions for the given feature.\n *\n * @param {Number} batchId The batch ID of the feature.\n */\nVector3DTileClampedPolylines.prototype.getPositions = function (batchId) {\n return Vector3DTilePolylines.getPolylinePositions(this, batchId);\n};\n\n/**\n * Creates features for each polyline and places it at the batch id index of features.\n *\n * @param {Vector3DTileContent} content The vector tile content.\n * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.\n */\nVector3DTileClampedPolylines.prototype.createFeatures = function (\n content,\n features\n) {\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n features[batchId] = new Cesium3DTileFeature(content, batchId);\n }\n};\n\n/**\n * Colors the entire tile when enabled is true. The resulting color will be (polyline batch table color * color).\n *\n * @param {Boolean} enabled Whether to enable debug coloring.\n * @param {Color} color The debug color.\n */\nVector3DTileClampedPolylines.prototype.applyDebugSettings = function (\n enabled,\n color\n) {\n this._highlightColor = enabled ? color : this._constantColor;\n};\n\nfunction clearStyle(polygons, features) {\n const batchIds = polygons._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.show = true;\n feature.color = Color.WHITE;\n }\n}\n\nconst scratchColor = new Color();\n\nconst DEFAULT_COLOR_VALUE = Color.WHITE;\nconst DEFAULT_SHOW_VALUE = true;\n\n/**\n * Apply a style to the content.\n *\n * @param {Cesium3DTileStyle} style The style.\n * @param {Cesium3DTileFeature[]} features The dictionary of features.\n */\nVector3DTileClampedPolylines.prototype.applyStyle = function (style, features) {\n if (!defined(style)) {\n clearStyle(this, features);\n return;\n }\n\n const batchIds = this._batchIds;\n const length = batchIds.length;\n for (let i = 0; i < length; ++i) {\n const batchId = batchIds[i];\n const feature = features[batchId];\n\n feature.color = defined(style.color)\n ? style.color.evaluateColor(feature, scratchColor)\n : DEFAULT_COLOR_VALUE;\n feature.show = defined(style.show)\n ? style.show.evaluate(feature)\n : DEFAULT_SHOW_VALUE;\n }\n};\n\nfunction initialize(polylines) {\n return ApproximateTerrainHeights.initialize().then(function () {\n updateMinimumMaximumHeights(\n polylines,\n polylines._rectangle,\n polylines._ellipsoid\n );\n\n return new Promise(function (resolve, reject) {\n polylines._update = function (polylines, frameState) {\n const context = frameState.context;\n const promise = createVertexArray(polylines, context);\n createUniformMap(polylines, context);\n createShaders(polylines, context);\n createRenderStates(polylines);\n\n if (polylines._ready) {\n const passes = frameState.passes;\n if (passes.render || passes.pick) {\n queueCommands(polylines, frameState);\n }\n }\n\n if (!defined(promise)) {\n return;\n }\n\n promise\n .then(function () {\n finishVertexArray(polylines, context);\n resolve(polylines);\n })\n .catch(function (e) {\n reject(e);\n });\n };\n });\n });\n}\n\n/**\n * Updates the batches and queues the commands for rendering.\n *\n * @param {FrameState} frameState The current frame state.\n */\nVector3DTileClampedPolylines.prototype.update = function (frameState) {\n this._update(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nVector3DTileClampedPolylines.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVector3DTileClampedPolylines.prototype.destroy = function () {\n this._va = this._va && this._va.destroy();\n this._sp = this._sp && this._sp.destroy();\n return destroyObject(this);\n};\nexport default Vector3DTileClampedPolylines;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst maxShort = 32767;\n\nconst scratchBVCartographic = new Cartographic();\nconst scratchEncodedPosition = new Cartesian3();\n\nfunction decodeVectorPolylinePositions(\n positions,\n rectangle,\n minimumHeight,\n maximumHeight,\n ellipsoid\n) {\n const positionsLength = positions.length / 3;\n const uBuffer = positions.subarray(0, positionsLength);\n const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);\n const heightBuffer = positions.subarray(\n 2 * positionsLength,\n 3 * positionsLength\n );\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\n\n const decoded = new Float64Array(positions.length);\n for (let i = 0; i < positionsLength; ++i) {\n const u = uBuffer[i];\n const v = vBuffer[i];\n const h = heightBuffer[i];\n\n const lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);\n const lat = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);\n const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);\n\n const cartographic = Cartographic.fromRadians(\n lon,\n lat,\n alt,\n scratchBVCartographic\n );\n const decodedPosition = ellipsoid.cartographicToCartesian(\n cartographic,\n scratchEncodedPosition\n );\n Cartesian3.pack(decodedPosition, decoded, i * 3);\n }\n return decoded;\n}\nexport default decodeVectorPolylinePositions;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport Cesium3DTileFeatureTable from \"./Cesium3DTileFeatureTable.js\";\nimport Vector3DTilePoints from \"./Vector3DTilePoints.js\";\nimport Vector3DTilePolygons from \"./Vector3DTilePolygons.js\";\nimport Vector3DTilePolylines from \"./Vector3DTilePolylines.js\";\nimport Vector3DTileClampedPolylines from \"./Vector3DTileClampedPolylines.js\";\nimport decodeVectorPolylinePositions from \"../Core/decodeVectorPolylinePositions.js\";\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/vctr/TileFormats/VectorData|Vector}\n * tile in a {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Vector3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Vector3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset) {\n this._tileset = tileset;\n this._tile = tile;\n this._resource = resource;\n\n this._polygons = undefined;\n this._polylines = undefined;\n this._points = undefined;\n\n this._metadata = undefined;\n\n this._batchTable = undefined;\n this._features = undefined;\n\n /**\n * Part of the {@link Cesium3DTileContent} interface.\n */\n this.featurePropertiesDirty = false;\n this._group = undefined;\n\n initialize(this, arrayBuffer, byteOffset);\n}\n\nObject.defineProperties(Vector3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n return defined(this._batchTable) ? this._batchTable.featuresLength : 0;\n },\n },\n\n pointsLength: {\n get: function () {\n if (defined(this._points)) {\n return this._points.pointsLength;\n }\n return 0;\n },\n },\n\n trianglesLength: {\n get: function () {\n let trianglesLength = 0;\n if (defined(this._polygons)) {\n trianglesLength += this._polygons.trianglesLength;\n }\n if (defined(this._polylines)) {\n trianglesLength += this._polylines.trianglesLength;\n }\n return trianglesLength;\n },\n },\n\n geometryByteLength: {\n get: function () {\n let geometryByteLength = 0;\n if (defined(this._polygons)) {\n geometryByteLength += this._polygons.geometryByteLength;\n }\n if (defined(this._polylines)) {\n geometryByteLength += this._polylines.geometryByteLength;\n }\n return geometryByteLength;\n },\n },\n\n texturesByteLength: {\n get: function () {\n if (defined(this._points)) {\n return this._points.texturesByteLength;\n }\n return 0;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n return defined(this._batchTable)\n ? this._batchTable.batchTableByteLength\n : 0;\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n const pointsPromise = defined(this._points)\n ? this._points.readyPromise\n : undefined;\n const polygonPromise = defined(this._polygons)\n ? this._polygons.readyPromise\n : undefined;\n const polylinePromise = defined(this._polylines)\n ? this._polylines.readyPromise\n : undefined;\n\n const that = this;\n return Promise.all([pointsPromise, polygonPromise, polylinePromise]).then(\n function () {\n return that;\n }\n );\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return this._resource.getUrlComponent(true);\n },\n },\n\n metadata: {\n get: function () {\n return this._metadata;\n },\n set: function (value) {\n this._metadata = value;\n },\n },\n\n batchTable: {\n get: function () {\n return this._batchTable;\n },\n },\n\n group: {\n get: function () {\n return this._group;\n },\n set: function (value) {\n this._group = value;\n },\n },\n});\n\nfunction createColorChangedCallback(content) {\n return function (batchId, color) {\n if (defined(content._polygons)) {\n content._polygons.updateCommands(batchId, color);\n }\n };\n}\n\nfunction getBatchIds(featureTableJson, featureTableBinary) {\n let polygonBatchIds;\n let polylineBatchIds;\n let pointBatchIds;\n let i;\n\n const numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);\n const numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);\n const numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);\n\n if (numberOfPolygons > 0 && defined(featureTableJson.POLYGON_BATCH_IDS)) {\n const polygonBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.POLYGON_BATCH_IDS.byteOffset;\n polygonBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n polygonBatchIdsByteOffset,\n numberOfPolygons\n );\n }\n\n if (numberOfPolylines > 0 && defined(featureTableJson.POLYLINE_BATCH_IDS)) {\n const polylineBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.POLYLINE_BATCH_IDS.byteOffset;\n polylineBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n polylineBatchIdsByteOffset,\n numberOfPolylines\n );\n }\n\n if (numberOfPoints > 0 && defined(featureTableJson.POINT_BATCH_IDS)) {\n const pointBatchIdsByteOffset =\n featureTableBinary.byteOffset +\n featureTableJson.POINT_BATCH_IDS.byteOffset;\n pointBatchIds = new Uint16Array(\n featureTableBinary.buffer,\n pointBatchIdsByteOffset,\n numberOfPoints\n );\n }\n\n const atLeastOneDefined =\n defined(polygonBatchIds) ||\n defined(polylineBatchIds) ||\n defined(pointBatchIds);\n const atLeastOneUndefined =\n (numberOfPolygons > 0 && !defined(polygonBatchIds)) ||\n (numberOfPolylines > 0 && !defined(polylineBatchIds)) ||\n (numberOfPoints > 0 && !defined(pointBatchIds));\n\n if (atLeastOneDefined && atLeastOneUndefined) {\n throw new RuntimeError(\n \"If one group of batch ids is defined, then all batch ids must be defined.\"\n );\n }\n\n const allUndefinedBatchIds =\n !defined(polygonBatchIds) &&\n !defined(polylineBatchIds) &&\n !defined(pointBatchIds);\n if (allUndefinedBatchIds) {\n let id = 0;\n if (!defined(polygonBatchIds) && numberOfPolygons > 0) {\n polygonBatchIds = new Uint16Array(numberOfPolygons);\n for (i = 0; i < numberOfPolygons; ++i) {\n polygonBatchIds[i] = id++;\n }\n }\n if (!defined(polylineBatchIds) && numberOfPolylines > 0) {\n polylineBatchIds = new Uint16Array(numberOfPolylines);\n for (i = 0; i < numberOfPolylines; ++i) {\n polylineBatchIds[i] = id++;\n }\n }\n if (!defined(pointBatchIds) && numberOfPoints > 0) {\n pointBatchIds = new Uint16Array(numberOfPoints);\n for (i = 0; i < numberOfPoints; ++i) {\n pointBatchIds[i] = id++;\n }\n }\n }\n\n return {\n polygons: polygonBatchIds,\n polylines: polylineBatchIds,\n points: pointBatchIds,\n };\n}\n\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\n\nfunction createFloatingPolylines(options) {\n return new Vector3DTilePolylines(options);\n}\n\nfunction createClampedPolylines(options) {\n return new Vector3DTileClampedPolylines(options);\n}\n\nfunction initialize(content, arrayBuffer, byteOffset) {\n byteOffset = defaultValue(byteOffset, 0);\n\n const uint8Array = new Uint8Array(arrayBuffer);\n const view = new DataView(arrayBuffer);\n byteOffset += sizeOfUint32; // Skip magic number\n\n const version = view.getUint32(byteOffset, true);\n if (version !== 1) {\n throw new RuntimeError(\n `Only Vector tile version 1 is supported. Version ${version} is not.`\n );\n }\n byteOffset += sizeOfUint32;\n\n const byteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n if (byteLength === 0) {\n return Promise.resolve(content);\n }\n\n const featureTableJSONByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n if (featureTableJSONByteLength === 0) {\n throw new RuntimeError(\n \"Feature table must have a byte length greater than zero\"\n );\n }\n\n const featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const batchTableJSONByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const indicesByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const positionByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const polylinePositionByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n const pointsPositionByteLength = view.getUint32(byteOffset, true);\n byteOffset += sizeOfUint32;\n\n const featureTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n featureTableJSONByteLength\n );\n byteOffset += featureTableJSONByteLength;\n\n const featureTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n featureTableBinaryByteLength\n );\n byteOffset += featureTableBinaryByteLength;\n\n let batchTableJson;\n let batchTableBinary;\n if (batchTableJSONByteLength > 0) {\n // PERFORMANCE_IDEA: is it possible to allocate this on-demand? Perhaps keep the\n // arraybuffer/string compressed in memory and then decompress it when it is first accessed.\n //\n // We could also make another request for it, but that would make the property set/get\n // API async, and would double the number of numbers in some cases.\n batchTableJson = getJsonFromTypedArray(\n uint8Array,\n byteOffset,\n batchTableJSONByteLength\n );\n byteOffset += batchTableJSONByteLength;\n\n if (batchTableBinaryByteLength > 0) {\n // Has a batch table binary\n batchTableBinary = new Uint8Array(\n arrayBuffer,\n byteOffset,\n batchTableBinaryByteLength\n );\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n byteOffset += batchTableBinaryByteLength;\n }\n }\n\n const numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);\n const numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);\n const numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);\n const totalPrimitives = numberOfPolygons + numberOfPolylines + numberOfPoints;\n\n const batchTable = new Cesium3DTileBatchTable(\n content,\n totalPrimitives,\n batchTableJson,\n batchTableBinary,\n createColorChangedCallback(content)\n );\n content._batchTable = batchTable;\n\n if (totalPrimitives === 0) {\n return;\n }\n\n const featureTable = new Cesium3DTileFeatureTable(\n featureTableJson,\n featureTableBinary\n );\n const region = featureTable.getGlobalProperty(\"REGION\");\n if (!defined(region)) {\n throw new RuntimeError(\n \"Feature table global property: REGION must be defined\"\n );\n }\n const rectangle = Rectangle.unpack(region);\n const minHeight = region[4];\n const maxHeight = region[5];\n\n const modelMatrix = content._tile.computedTransform;\n\n let center = featureTable.getGlobalProperty(\n \"RTC_CENTER\",\n ComponentDatatype.FLOAT,\n 3\n );\n if (defined(center)) {\n center = Cartesian3.unpack(center);\n Matrix4.multiplyByPoint(modelMatrix, center, center);\n } else {\n center = Rectangle.center(rectangle);\n center.height = CesiumMath.lerp(minHeight, maxHeight, 0.5);\n center = Ellipsoid.WGS84.cartographicToCartesian(center);\n }\n\n const batchIds = getBatchIds(featureTableJson, featureTableBinary);\n byteOffset += (4 - (byteOffset % 4)) % 4;\n\n if (numberOfPolygons > 0) {\n featureTable.featuresLength = numberOfPolygons;\n\n const polygonCounts = defaultValue(\n featureTable.getPropertyArray(\n \"POLYGON_COUNTS\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ),\n featureTable.getPropertyArray(\n \"POLYGON_COUNT\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ) // Workaround for old vector tilesets using the non-plural name\n );\n\n if (!defined(polygonCounts)) {\n throw new RuntimeError(\n \"Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0\"\n );\n }\n\n const polygonIndexCounts = defaultValue(\n featureTable.getPropertyArray(\n \"POLYGON_INDEX_COUNTS\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ),\n featureTable.getPropertyArray(\n \"POLYGON_INDEX_COUNT\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ) // Workaround for old vector tilesets using the non-plural name\n );\n\n if (!defined(polygonIndexCounts)) {\n throw new RuntimeError(\n \"Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0\"\n );\n }\n\n // Use the counts array to determine how many position values we want. If we used the byte length then\n // zero padding values would be included and cause the delta zig-zag decoding to fail\n const numPolygonPositions = polygonCounts.reduce(function (total, count) {\n return total + count * 2;\n }, 0);\n\n const numPolygonIndices = polygonIndexCounts.reduce(function (\n total,\n count\n ) {\n return total + count;\n },\n 0);\n\n const indices = new Uint32Array(arrayBuffer, byteOffset, numPolygonIndices);\n byteOffset += indicesByteLength;\n\n const polygonPositions = new Uint16Array(\n arrayBuffer,\n byteOffset,\n numPolygonPositions\n );\n byteOffset += positionByteLength;\n\n let polygonMinimumHeights;\n let polygonMaximumHeights;\n if (\n defined(featureTableJson.POLYGON_MINIMUM_HEIGHTS) &&\n defined(featureTableJson.POLYGON_MAXIMUM_HEIGHTS)\n ) {\n polygonMinimumHeights = featureTable.getPropertyArray(\n \"POLYGON_MINIMUM_HEIGHTS\",\n ComponentDatatype.FLOAT,\n 1\n );\n polygonMaximumHeights = featureTable.getPropertyArray(\n \"POLYGON_MAXIMUM_HEIGHTS\",\n ComponentDatatype.FLOAT,\n 1\n );\n }\n\n content._polygons = new Vector3DTilePolygons({\n positions: polygonPositions,\n counts: polygonCounts,\n indexCounts: polygonIndexCounts,\n indices: indices,\n minimumHeight: minHeight,\n maximumHeight: maxHeight,\n polygonMinimumHeights: polygonMinimumHeights,\n polygonMaximumHeights: polygonMaximumHeights,\n center: center,\n rectangle: rectangle,\n boundingVolume: content.tile.boundingVolume.boundingVolume,\n batchTable: batchTable,\n batchIds: batchIds.polygons,\n modelMatrix: modelMatrix,\n });\n }\n\n if (numberOfPolylines > 0) {\n featureTable.featuresLength = numberOfPolylines;\n\n const polylineCounts = defaultValue(\n featureTable.getPropertyArray(\n \"POLYLINE_COUNTS\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ),\n featureTable.getPropertyArray(\n \"POLYLINE_COUNT\",\n ComponentDatatype.UNSIGNED_INT,\n 1\n ) // Workaround for old vector tilesets using the non-plural name\n );\n\n if (!defined(polylineCounts)) {\n throw new RuntimeError(\n \"Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0\"\n );\n }\n\n let widths = featureTable.getPropertyArray(\n \"POLYLINE_WIDTHS\",\n ComponentDatatype.UNSIGNED_SHORT,\n 1\n );\n if (!defined(widths)) {\n widths = new Uint16Array(numberOfPolylines);\n for (let i = 0; i < numberOfPolylines; ++i) {\n widths[i] = 2.0;\n }\n }\n\n // Use the counts array to determine how many position values we want. If we used the byte length then\n // zero padding values would be included and cause the delta zig-zag decoding to fail\n const numPolylinePositions = polylineCounts.reduce(function (total, count) {\n return total + count * 3;\n }, 0);\n const polylinePositions = new Uint16Array(\n arrayBuffer,\n byteOffset,\n numPolylinePositions\n );\n byteOffset += polylinePositionByteLength;\n\n const tileset = content._tileset;\n const examineVectorLinesFunction = tileset.examineVectorLinesFunction;\n if (defined(examineVectorLinesFunction)) {\n const decodedPositions = decodeVectorPolylinePositions(\n new Uint16Array(polylinePositions),\n rectangle,\n minHeight,\n maxHeight,\n Ellipsoid.WGS84\n );\n examineVectorLines(\n decodedPositions,\n polylineCounts,\n batchIds.polylines,\n batchTable,\n content.url,\n examineVectorLinesFunction\n );\n }\n\n let createPolylines = createFloatingPolylines;\n if (defined(tileset.classificationType)) {\n createPolylines = createClampedPolylines;\n }\n\n content._polylines = createPolylines({\n positions: polylinePositions,\n widths: widths,\n counts: polylineCounts,\n batchIds: batchIds.polylines,\n minimumHeight: minHeight,\n maximumHeight: maxHeight,\n center: center,\n rectangle: rectangle,\n boundingVolume: content.tile.boundingVolume.boundingVolume,\n batchTable: batchTable,\n classificationType: tileset.classificationType,\n keepDecodedPositions: tileset.vectorKeepDecodedPositions,\n });\n }\n\n if (numberOfPoints > 0) {\n const pointPositions = new Uint16Array(\n arrayBuffer,\n byteOffset,\n numberOfPoints * 3\n );\n byteOffset += pointsPositionByteLength;\n content._points = new Vector3DTilePoints({\n positions: pointPositions,\n batchIds: batchIds.points,\n minimumHeight: minHeight,\n maximumHeight: maxHeight,\n rectangle: rectangle,\n batchTable: batchTable,\n });\n }\n\n return Promise.resolve(content);\n}\n\nfunction createFeatures(content) {\n const featuresLength = content.featuresLength;\n if (!defined(content._features) && featuresLength > 0) {\n const features = new Array(featuresLength);\n\n if (defined(content._polygons)) {\n content._polygons.createFeatures(content, features);\n }\n if (defined(content._polylines)) {\n content._polylines.createFeatures(content, features);\n }\n if (defined(content._points)) {\n content._points.createFeatures(content, features);\n }\n content._features = features;\n }\n}\n\nVector3DTileContent.prototype.hasProperty = function (batchId, name) {\n return this._batchTable.hasProperty(batchId, name);\n};\n\nVector3DTileContent.prototype.getFeature = function (batchId) {\n if (!defined(this._features)) {\n createFeatures(this);\n }\n\n return this._features[batchId];\n};\n\nVector3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n if (defined(this._polygons)) {\n this._polygons.applyDebugSettings(enabled, color);\n }\n if (defined(this._polylines)) {\n this._polylines.applyDebugSettings(enabled, color);\n }\n if (defined(this._points)) {\n this._points.applyDebugSettings(enabled, color);\n }\n};\n\nVector3DTileContent.prototype.applyStyle = function (style) {\n if (!defined(this._features)) {\n createFeatures(this);\n }\n if (defined(this._polygons)) {\n this._polygons.applyStyle(style, this._features);\n }\n if (defined(this._polylines)) {\n this._polylines.applyStyle(style, this._features);\n }\n if (defined(this._points)) {\n this._points.applyStyle(style, this._features);\n }\n};\n\nVector3DTileContent.prototype.update = function (tileset, frameState) {\n let ready = true;\n if (defined(this._polygons)) {\n this._polygons.classificationType = this._tileset.classificationType;\n this._polygons.debugWireframe = this._tileset.debugWireframe;\n this._polygons.update(frameState);\n ready = ready && this._polygons._ready;\n }\n if (defined(this._polylines)) {\n this._polylines.update(frameState);\n ready = ready && this._polylines._ready;\n }\n if (defined(this._points)) {\n this._points.update(frameState);\n ready = ready && this._points._ready;\n }\n if (defined(this._batchTable) && ready) {\n if (!defined(this._features)) {\n createFeatures(this);\n }\n this._batchTable.update(tileset, frameState);\n }\n};\n\nVector3DTileContent.prototype.getPolylinePositions = function (batchId) {\n const polylines = this._polylines;\n if (!defined(polylines)) {\n return undefined;\n }\n\n return polylines.getPositions(batchId);\n};\n\nVector3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nVector3DTileContent.prototype.destroy = function () {\n this._polygons = this._polygons && this._polygons.destroy();\n this._polylines = this._polylines && this._polylines.destroy();\n this._points = this._points && this._points.destroy();\n this._batchTable = this._batchTable && this._batchTable.destroy();\n return destroyObject(this);\n};\n\nfunction examineVectorLines(\n positions,\n counts,\n batchIds,\n batchTable,\n url,\n callback\n) {\n const countsLength = counts.length;\n let polylineStart = 0;\n for (let i = 0; i < countsLength; i++) {\n const count = counts[i] * 3;\n const linePositions = positions.slice(polylineStart, polylineStart + count);\n polylineStart += count;\n\n callback(linePositions, batchIds[i], url, batchTable);\n }\n}\n\nexport default Vector3DTileContent;\n", "import Composite3DTileContent from \"./Composite3DTileContent.js\";\nimport Geometry3DTileContent from \"./Geometry3DTileContent.js\";\nimport Implicit3DTileContent from \"./Implicit3DTileContent.js\";\nimport Model3DTileContent from \"./Model/Model3DTileContent.js\";\nimport Tileset3DTileContent from \"./Tileset3DTileContent.js\";\nimport Vector3DTileContent from \"./Vector3DTileContent.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\n\n/**\n * Maps a tile's magic field in its header to a new content object for the tile's payload.\n *\n * @private\n */\nconst Cesium3DTileContentFactory = {\n b3dm: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return Model3DTileContent.fromB3dm(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n );\n },\n pnts: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return Model3DTileContent.fromPnts(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n );\n },\n i3dm: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return Model3DTileContent.fromI3dm(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n );\n },\n cmpt: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n // Send in the factory in order to avoid a cyclical dependency\n return new Composite3DTileContent(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset,\n Cesium3DTileContentFactory\n );\n },\n externalTileset: function (tileset, tile, resource, json) {\n return new Tileset3DTileContent(tileset, tile, resource, json);\n },\n geom: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return new Geometry3DTileContent(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n );\n },\n vctr: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return new Vector3DTileContent(\n tileset,\n tile,\n resource,\n arrayBuffer,\n byteOffset\n );\n },\n subt: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n return new Implicit3DTileContent(\n tileset,\n tile,\n resource,\n undefined,\n arrayBuffer,\n byteOffset\n );\n },\n subtreeJson: function (tileset, tile, resource, json) {\n return new Implicit3DTileContent(tileset, tile, resource, json);\n },\n glb: function (tileset, tile, resource, arrayBuffer, byteOffset) {\n const arrayBufferByteLength = arrayBuffer.byteLength;\n if (arrayBufferByteLength < 12) {\n throw new RuntimeError(\"Invalid glb content\");\n }\n const dataView = new DataView(arrayBuffer, byteOffset);\n const byteLength = dataView.getUint32(8, true);\n const glb = new Uint8Array(arrayBuffer, byteOffset, byteLength);\n return Model3DTileContent.fromGltf(tileset, tile, resource, glb);\n },\n gltf: function (tileset, tile, resource, json) {\n return Model3DTileContent.fromGltf(tileset, tile, resource, json);\n },\n geoJson: function (tileset, tile, resource, json) {\n return Model3DTileContent.fromGeoJson(tileset, tile, resource, json);\n },\n};\nexport default Cesium3DTileContentFactory;\n", "/**\n * @private\n */\nconst Cesium3DTileContentState = {\n UNLOADED: 0, // Has never been requested\n LOADING: 1, // Is waiting on a pending request\n PROCESSING: 2, // Request received. Contents are being processed for rendering. Depending on the content, it might make its own requests for external data.\n READY: 3, // Ready to render.\n EXPIRED: 4, // Is expired and will be unloaded once new content is loaded.\n FAILED: 5, // Request failed.\n};\nexport default Object.freeze(Cesium3DTileContentState);\n", "/**\n * An enum to indicate the different types of {@link Cesium3DTileContent}.\n * For binary files, the enum value is the magic number of the binary file\n * unless otherwise noted. For JSON files, the enum value is a unique name\n * for internal use.\n *\n * @enum {String}\n * @see Cesium3DTileContent\n *\n * @private\n */\nconst Cesium3DTileContentType = {\n /**\n * A Batched 3D Model. This is a binary format with\n * magic number <code>b3dm</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n BATCHED_3D_MODEL: \"b3dm\",\n /**\n * An Instanced 3D Model. This is a binary format with magic number\n * <code>i3dm</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n INSTANCED_3D_MODEL: \"i3dm\",\n /**\n * A Composite model. This is a binary format with magic number\n * <code>cmpt</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n COMPOSITE: \"cmpt\",\n /**\n * A Point Cloud model. This is a binary format with magic number\n * <code>pnts</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n POINT_CLOUD: \"pnts\",\n /**\n * Vector tiles. This is a binary format with magic number\n * <code>vctr</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n VECTOR: \"vctr\",\n /**\n * Geometry tiles. This is a binary format with magic number\n * <code>geom</code>\n *\n * @type {String}\n * @constant\n * @private\n */\n GEOMETRY: \"geom\",\n /**\n * A glTF model in JSON + external BIN form. This is treated\n * as a JSON format.\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n GLTF: \"gltf\",\n /**\n * The binary form of a glTF file. Internally, the magic number is\n * changed from <code>glTF</code> to <code>glb</code> to distinguish it from\n * the JSON glTF format.\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n GLTF_BINARY: \"glb\",\n /**\n * For implicit tiling, availability bitstreams are stored in binary subtree files.\n * The magic number is <code>subt</code>\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n IMPLICIT_SUBTREE: \"subt\",\n /**\n * For implicit tiling. Subtrees can also be represented as JSON files.\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n IMPLICIT_SUBTREE_JSON: \"subtreeJson\",\n /**\n * Contents can reference another tileset.json to use\n * as an external tileset. This is a JSON-based format.\n *\n * @type {String}\n * @constant\n * @private\n */\n EXTERNAL_TILESET: \"externalTileset\",\n /**\n * Multiple contents are handled separately from the other content types\n * due to differences in request scheduling.\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n MULTIPLE_CONTENT: \"multipleContent\",\n /**\n * GeoJSON content for <code>MAXAR_content_geojson</code> extension.\n *\n * @type {String}\n * @constant\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n GEOJSON: \"geoJson\",\n};\n\n/**\n * Check if a content is one of the supported binary formats. Otherwise,\n * the caller can assume a JSON format.\n * @param {Cesium3DTileContentType} contentType The content type of the content payload.\n * @return {Boolean} <code>true</code> if the content type is a binary format, or <code>false</code> if the content type is a JSON format.\n * @private\n */\nCesium3DTileContentType.isBinaryFormat = function (contentType) {\n switch (contentType) {\n case Cesium3DTileContentType.BATCHED_3D_MODEL:\n case Cesium3DTileContentType.INSTANCED_3D_MODEL:\n case Cesium3DTileContentType.COMPOSITE:\n case Cesium3DTileContentType.POINT_CLOUD:\n case Cesium3DTileContentType.VECTOR:\n case Cesium3DTileContentType.GEOMETRY:\n case Cesium3DTileContentType.IMPLICIT_SUBTREE:\n case Cesium3DTileContentType.GLTF_BINARY:\n return true;\n default:\n return false;\n }\n};\n\nexport default Object.freeze(Cesium3DTileContentType);\n", "/**\n * Hint defining optimization support for a 3D tile\n *\n * @enum {Number}\n *\n * @private\n */\nconst Cesium3DTileOptimizationHint = {\n NOT_COMPUTED: -1,\n USE_OPTIMIZATION: 1,\n SKIP_OPTIMIZATION: 0,\n};\nexport default Object.freeze(Cesium3DTileOptimizationHint);\n", "import Intersect from \"../Core/Intersect.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\n\n/**\n * Traversal that loads all leaves that intersect the camera frustum.\n * Used to determine ray-tileset intersections during a pickFromRayMostDetailed call.\n *\n * @private\n */\nfunction Cesium3DTilesetMostDetailedTraversal() {}\n\nconst traversal = {\n stack: new ManagedArray(),\n stackMaximumLength: 0,\n};\n\nCesium3DTilesetMostDetailedTraversal.selectTiles = function (\n tileset,\n frameState\n) {\n tileset._selectedTiles.length = 0;\n tileset._requestedTiles.length = 0;\n tileset._hasMixedContent = false;\n\n let ready = true;\n\n const root = tileset.root;\n root.updateVisibility(frameState);\n\n if (!isVisible(root)) {\n return ready;\n }\n\n const stack = traversal.stack;\n stack.push(tileset.root);\n\n while (stack.length > 0) {\n traversal.stackMaximumLength = Math.max(\n traversal.stackMaximumLength,\n stack.length\n );\n\n const tile = stack.pop();\n const add = tile.refine === Cesium3DTileRefine.ADD;\n const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n const traverse = canTraverse(tileset, tile);\n\n if (traverse) {\n updateAndPushChildren(tileset, tile, stack, frameState);\n }\n\n if (add || (replace && !traverse)) {\n loadTile(tileset, tile);\n touchTile(tileset, tile, frameState);\n selectDesiredTile(tileset, tile, frameState);\n\n if (!hasEmptyContent(tile) && !tile.contentAvailable) {\n ready = false;\n }\n }\n\n visitTile(tileset);\n }\n\n traversal.stack.trim(traversal.stackMaximumLength);\n\n return ready;\n};\n\nfunction isVisible(tile) {\n return tile._visible && tile._inRequestVolume;\n}\n\nfunction hasEmptyContent(tile) {\n return (\n tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent\n );\n}\n\nfunction hasUnloadedContent(tile) {\n return !hasEmptyContent(tile) && tile.contentUnloaded;\n}\n\nfunction canTraverse(tileset, tile) {\n if (tile.children.length === 0) {\n return false;\n }\n\n if (tile.hasTilesetContent || tile.hasImplicitContent) {\n // Traverse external tileset to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n\n if (tile.hasEmptyContent) {\n return true;\n }\n\n return true; // Keep traversing until a leave is hit\n}\n\nfunction updateAndPushChildren(tileset, tile, stack, frameState) {\n const children = tile.children;\n const length = children.length;\n\n for (let i = 0; i < length; ++i) {\n const child = children[i];\n child.updateVisibility(frameState);\n if (isVisible(child)) {\n stack.push(child);\n }\n }\n}\n\nfunction loadTile(tileset, tile) {\n if (hasUnloadedContent(tile) || tile.contentExpired) {\n tile._priority = 0.0; // Highest priority\n tileset._requestedTiles.push(tile);\n }\n}\n\nfunction touchTile(tileset, tile, frameState) {\n if (tile._touchedFrame === frameState.frameNumber) {\n // Prevents another pass from touching the frame again\n return;\n }\n tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n}\n\nfunction visitTile(tileset) {\n ++tileset.statistics.visited;\n}\n\nfunction selectDesiredTile(tileset, tile, frameState) {\n if (\n tile.contentAvailable &&\n tile.contentVisibility(frameState) !== Intersect.OUTSIDE\n ) {\n tileset._selectedTiles.push(tile);\n }\n}\nexport default Cesium3DTilesetMostDetailedTraversal;\n", "import defined from \"../Core/defined.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTilesetTraversal() {}\n\nfunction isVisible(tile) {\n return tile._visible && tile._inRequestVolume;\n}\n\nconst traversal = {\n stack: new ManagedArray(),\n stackMaximumLength: 0,\n};\n\nconst emptyTraversal = {\n stack: new ManagedArray(),\n stackMaximumLength: 0,\n};\n\nconst descendantTraversal = {\n stack: new ManagedArray(),\n stackMaximumLength: 0,\n};\n\nconst selectionTraversal = {\n stack: new ManagedArray(),\n stackMaximumLength: 0,\n ancestorStack: new ManagedArray(),\n ancestorStackMaximumLength: 0,\n};\n\nconst descendantSelectionDepth = 2;\n\nCesium3DTilesetTraversal.selectTiles = function (tileset, frameState) {\n tileset._requestedTiles.length = 0;\n\n if (tileset.debugFreezeFrame) {\n return;\n }\n\n tileset._selectedTiles.length = 0;\n tileset._selectedTilesToStyle.length = 0;\n tileset._emptyTiles.length = 0;\n tileset._hasMixedContent = false;\n\n const root = tileset.root;\n updateTile(tileset, root, frameState);\n\n // The root tile is not visible\n if (!isVisible(root)) {\n return;\n }\n\n // The tileset doesn't meet the SSE requirement, therefore the tree does not need to be rendered\n if (\n root.getScreenSpaceError(frameState, true) <=\n tileset._maximumScreenSpaceError\n ) {\n return;\n }\n\n if (!skipLevelOfDetail(tileset)) {\n executeBaseTraversal(tileset, root, frameState);\n } else if (tileset.immediatelyLoadDesiredLevelOfDetail) {\n executeSkipTraversal(tileset, root, frameState);\n } else {\n executeBaseAndSkipTraversal(tileset, root, frameState);\n }\n\n traversal.stack.trim(traversal.stackMaximumLength);\n emptyTraversal.stack.trim(emptyTraversal.stackMaximumLength);\n descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength);\n selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength);\n selectionTraversal.ancestorStack.trim(\n selectionTraversal.ancestorStackMaximumLength\n );\n\n // Update the priority for any requests found during traversal\n // Update after traversal so that min and max values can be used to normalize priority values\n const requestedTiles = tileset._requestedTiles;\n const length = requestedTiles.length;\n for (let i = 0; i < length; ++i) {\n requestedTiles[i].updatePriority();\n }\n};\n\nfunction executeBaseTraversal(tileset, root, frameState) {\n const baseScreenSpaceError = tileset._maximumScreenSpaceError;\n const maximumScreenSpaceError = tileset._maximumScreenSpaceError;\n executeTraversal(\n tileset,\n root,\n baseScreenSpaceError,\n maximumScreenSpaceError,\n frameState\n );\n}\n\nfunction executeSkipTraversal(tileset, root, frameState) {\n const baseScreenSpaceError = Number.MAX_VALUE;\n const maximumScreenSpaceError = tileset._maximumScreenSpaceError;\n executeTraversal(\n tileset,\n root,\n baseScreenSpaceError,\n maximumScreenSpaceError,\n frameState\n );\n traverseAndSelect(tileset, root, frameState);\n}\n\nfunction executeBaseAndSkipTraversal(tileset, root, frameState) {\n const baseScreenSpaceError = Math.max(\n tileset.baseScreenSpaceError,\n tileset.maximumScreenSpaceError\n );\n const maximumScreenSpaceError = tileset.maximumScreenSpaceError;\n executeTraversal(\n tileset,\n root,\n baseScreenSpaceError,\n maximumScreenSpaceError,\n frameState\n );\n traverseAndSelect(tileset, root, frameState);\n}\n\nfunction skipLevelOfDetail(tileset) {\n return tileset._skipLevelOfDetail;\n}\n\nfunction addEmptyTile(tileset, tile) {\n tileset._emptyTiles.push(tile);\n}\n\nfunction selectTile(tileset, tile, frameState) {\n if (tile.contentVisibility(frameState) !== Intersect.OUTSIDE) {\n const tileContent = tile.content;\n if (tileContent.featurePropertiesDirty) {\n // A feature's property in this tile changed, the tile needs to be re-styled.\n tileContent.featurePropertiesDirty = false;\n tile.lastStyleTime = 0; // Force applying the style to this tile\n tileset._selectedTilesToStyle.push(tile);\n } else if (tile._selectedFrame < frameState.frameNumber - 1) {\n // Tile is newly selected; it is selected this frame, but was not selected last frame.\n tileset._selectedTilesToStyle.push(tile);\n }\n tile._selectedFrame = frameState.frameNumber;\n tileset._selectedTiles.push(tile);\n }\n}\n\nfunction selectDescendants(tileset, root, frameState) {\n const stack = descendantTraversal.stack;\n stack.push(root);\n while (stack.length > 0) {\n descendantTraversal.stackMaximumLength = Math.max(\n descendantTraversal.stackMaximumLength,\n stack.length\n );\n const tile = stack.pop();\n const children = tile.children;\n const childrenLength = children.length;\n for (let i = 0; i < childrenLength; ++i) {\n const child = children[i];\n if (isVisible(child)) {\n if (child.contentAvailable) {\n updateTile(tileset, child, frameState);\n touchTile(tileset, child, frameState);\n selectTile(tileset, child, frameState);\n } else if (child._depth - root._depth < descendantSelectionDepth) {\n // Continue traversing, but not too far\n stack.push(child);\n }\n }\n }\n }\n}\n\nfunction selectDesiredTile(tileset, tile, frameState) {\n if (!skipLevelOfDetail(tileset)) {\n if (tile.contentAvailable) {\n // The tile can be selected right away and does not require traverseAndSelect\n selectTile(tileset, tile, frameState);\n }\n return;\n }\n\n // If this tile is not loaded attempt to select its ancestor instead\n const loadedTile = tile.contentAvailable\n ? tile\n : tile._ancestorWithContentAvailable;\n if (defined(loadedTile)) {\n // Tiles will actually be selected in traverseAndSelect\n loadedTile._shouldSelect = true;\n } else {\n // If no ancestors are ready traverse down and select tiles to minimize empty regions.\n // This happens often for immediatelyLoadDesiredLevelOfDetail where parent tiles are not necessarily loaded before zooming out.\n selectDescendants(tileset, tile, frameState);\n }\n}\n\nfunction visitTile(tileset, tile, frameState) {\n ++tileset._statistics.visited;\n tile._visitedFrame = frameState.frameNumber;\n}\n\nfunction touchTile(tileset, tile, frameState) {\n if (tile._touchedFrame === frameState.frameNumber) {\n // Prevents another pass from touching the frame again\n return;\n }\n tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n}\n\nfunction updateMinimumMaximumPriority(tileset, tile) {\n tileset._maximumPriority.distance = Math.max(\n tile._priorityHolder._distanceToCamera,\n tileset._maximumPriority.distance\n );\n tileset._minimumPriority.distance = Math.min(\n tile._priorityHolder._distanceToCamera,\n tileset._minimumPriority.distance\n );\n tileset._maximumPriority.depth = Math.max(\n tile._depth,\n tileset._maximumPriority.depth\n );\n tileset._minimumPriority.depth = Math.min(\n tile._depth,\n tileset._minimumPriority.depth\n );\n tileset._maximumPriority.foveatedFactor = Math.max(\n tile._priorityHolder._foveatedFactor,\n tileset._maximumPriority.foveatedFactor\n );\n tileset._minimumPriority.foveatedFactor = Math.min(\n tile._priorityHolder._foveatedFactor,\n tileset._minimumPriority.foveatedFactor\n );\n tileset._maximumPriority.reverseScreenSpaceError = Math.max(\n tile._priorityReverseScreenSpaceError,\n tileset._maximumPriority.reverseScreenSpaceError\n );\n tileset._minimumPriority.reverseScreenSpaceError = Math.min(\n tile._priorityReverseScreenSpaceError,\n tileset._minimumPriority.reverseScreenSpaceError\n );\n}\n\nfunction isOnScreenLongEnough(tileset, tile, frameState) {\n // Prevent unnecessary loads while camera is moving by getting the ratio of travel distance to tile size.\n if (!tileset._cullRequestsWhileMoving) {\n return true;\n }\n\n const sphere = tile.boundingSphere;\n const diameter = Math.max(sphere.radius * 2.0, 1.0);\n\n const camera = frameState.camera;\n const deltaMagnitude =\n camera.positionWCDeltaMagnitude !== 0.0\n ? camera.positionWCDeltaMagnitude\n : camera.positionWCDeltaMagnitudeLastFrame;\n const movementRatio =\n (tileset.cullRequestsWhileMovingMultiplier * deltaMagnitude) / diameter; // How do n frames of this movement compare to the tile's physical size.\n return movementRatio < 1.0;\n}\n\nfunction loadTile(tileset, tile, frameState) {\n if (\n tile._requestedFrame === frameState.frameNumber ||\n (!hasUnloadedContent(tile) && !tile.contentExpired)\n ) {\n return;\n }\n\n if (!isOnScreenLongEnough(tileset, tile, frameState)) {\n return;\n }\n\n const cameraHasNotStoppedMovingLongEnough =\n frameState.camera.timeSinceMoved < tileset.foveatedTimeDelay;\n if (tile.priorityDeferred && cameraHasNotStoppedMovingLongEnough) {\n return;\n }\n\n tile._requestedFrame = frameState.frameNumber;\n tileset._requestedTiles.push(tile);\n}\n\nfunction updateVisibility(tileset, tile, frameState) {\n if (tile._updatedVisibilityFrame === tileset._updatedVisibilityFrame) {\n // Return early if visibility has already been checked during the traversal.\n // The visibility may have already been checked if the cullWithChildrenBounds optimization is used.\n return;\n }\n\n tile.updateVisibility(frameState);\n tile._updatedVisibilityFrame = tileset._updatedVisibilityFrame;\n}\n\nfunction anyChildrenVisible(tileset, tile, frameState) {\n let anyVisible = false;\n const children = tile.children;\n const length = children.length;\n for (let i = 0; i < length; ++i) {\n const child = children[i];\n updateVisibility(tileset, child, frameState);\n anyVisible = anyVisible || isVisible(child);\n }\n return anyVisible;\n}\n\nfunction meetsScreenSpaceErrorEarly(tileset, tile, frameState) {\n const parent = tile.parent;\n if (\n !defined(parent) ||\n parent.hasTilesetContent ||\n parent.hasImplicitContent ||\n parent.refine !== Cesium3DTileRefine.ADD\n ) {\n return false;\n }\n\n // Use parent's geometric error with child's box to see if the tile already meet the SSE\n return (\n tile.getScreenSpaceError(frameState, true) <=\n tileset._maximumScreenSpaceError\n );\n}\n\nfunction updateTileVisibility(tileset, tile, frameState) {\n updateVisibility(tileset, tile, frameState);\n\n if (!isVisible(tile)) {\n return;\n }\n\n const hasChildren = tile.children.length > 0;\n if ((tile.hasTilesetContent || tile.hasImplicitContent) && hasChildren) {\n // Use the root tile's visibility instead of this tile's visibility.\n // The root tile may be culled by the children bounds optimization in which\n // case this tile should also be culled.\n const child = tile.children[0];\n updateTileVisibility(tileset, child, frameState);\n tile._visible = child._visible;\n return;\n }\n\n if (meetsScreenSpaceErrorEarly(tileset, tile, frameState)) {\n tile._visible = false;\n return;\n }\n\n // Optimization - if none of the tile's children are visible then this tile isn't visible\n const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n const useOptimization =\n tile._optimChildrenWithinParent ===\n Cesium3DTileOptimizationHint.USE_OPTIMIZATION;\n if (replace && useOptimization && hasChildren) {\n if (!anyChildrenVisible(tileset, tile, frameState)) {\n ++tileset._statistics.numberOfTilesCulledWithChildrenUnion;\n tile._visible = false;\n return;\n }\n }\n}\n\nfunction updateTile(tileset, tile, frameState) {\n // Reset some of the tile's flags and re-evaluate visibility\n updateTileVisibility(tileset, tile, frameState);\n tile.updateExpiration();\n\n // Request priority\n tile._wasMinPriorityChild = false;\n tile._priorityHolder = tile;\n updateMinimumMaximumPriority(tileset, tile);\n\n // SkipLOD\n tile._shouldSelect = false;\n tile._finalResolution = true;\n}\n\nfunction updateTileAncestorContentLinks(tile, frameState) {\n tile._ancestorWithContent = undefined;\n tile._ancestorWithContentAvailable = undefined;\n\n const parent = tile.parent;\n if (defined(parent)) {\n // ancestorWithContent is an ancestor that has content or has the potential to have\n // content. Used in conjunction with tileset.skipLevels to know when to skip a tile.\n // ancestorWithContentAvailable is an ancestor that is rendered if a desired tile is not loaded.\n const hasContent =\n !hasUnloadedContent(parent) ||\n parent._requestedFrame === frameState.frameNumber;\n tile._ancestorWithContent = hasContent\n ? parent\n : parent._ancestorWithContent;\n tile._ancestorWithContentAvailable = parent.contentAvailable\n ? parent\n : parent._ancestorWithContentAvailable; // Links a descendant up to its contentAvailable ancestor as the traversal progresses.\n }\n}\n\nfunction hasEmptyContent(tile) {\n return (\n tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent\n );\n}\n\nfunction hasUnloadedContent(tile) {\n return !hasEmptyContent(tile) && tile.contentUnloaded;\n}\n\nfunction reachedSkippingThreshold(tileset, tile) {\n const ancestor = tile._ancestorWithContent;\n return (\n !tileset.immediatelyLoadDesiredLevelOfDetail &&\n (tile._priorityProgressiveResolutionScreenSpaceErrorLeaf ||\n (defined(ancestor) &&\n tile._screenSpaceError <\n ancestor._screenSpaceError / tileset.skipScreenSpaceErrorFactor &&\n tile._depth > ancestor._depth + tileset.skipLevels))\n );\n}\n\nfunction sortChildrenByDistanceToCamera(a, b) {\n // Sort by farthest child first since this is going on a stack\n if (b._distanceToCamera === 0 && a._distanceToCamera === 0) {\n return b._centerZDepth - a._centerZDepth;\n }\n\n return b._distanceToCamera - a._distanceToCamera;\n}\n\nfunction updateAndPushChildren(tileset, tile, stack, frameState) {\n let i;\n const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n const children = tile.children;\n const length = children.length;\n\n for (i = 0; i < length; ++i) {\n updateTile(tileset, children[i], frameState);\n }\n\n // Sort by distance to take advantage of early Z and reduce artifacts for skipLevelOfDetail\n children.sort(sortChildrenByDistanceToCamera);\n\n // For traditional replacement refinement only refine if all children are loaded.\n // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n const checkRefines =\n !skipLevelOfDetail(tileset) && replace && !hasEmptyContent(tile);\n let refines = true;\n\n let anyChildrenVisible = false;\n\n // Determining min child\n let minIndex = -1;\n let minimumPriority = Number.MAX_VALUE;\n\n let child;\n for (i = 0; i < length; ++i) {\n child = children[i];\n if (isVisible(child)) {\n stack.push(child);\n if (child._foveatedFactor < minimumPriority) {\n minIndex = i;\n minimumPriority = child._foveatedFactor;\n }\n anyChildrenVisible = true;\n } else if (checkRefines || tileset.loadSiblings) {\n // Keep non-visible children loaded since they are still needed before the parent can refine.\n // Or loadSiblings is true so always load tiles regardless of visibility.\n if (child._foveatedFactor < minimumPriority) {\n minIndex = i;\n minimumPriority = child._foveatedFactor;\n }\n loadTile(tileset, child, frameState);\n touchTile(tileset, child, frameState);\n }\n if (checkRefines) {\n let childRefines;\n if (!child._inRequestVolume) {\n childRefines = false;\n } else if (hasEmptyContent(child)) {\n childRefines = executeEmptyTraversal(tileset, child, frameState);\n } else {\n childRefines = child.contentAvailable;\n }\n refines = refines && childRefines;\n }\n }\n\n if (!anyChildrenVisible) {\n refines = false;\n }\n\n if (minIndex !== -1 && !skipLevelOfDetail(tileset) && replace) {\n // An ancestor will hold the _foveatedFactor and _distanceToCamera for descendants between itself and its highest priority descendant. Siblings of a min children along the way use this ancestor as their priority holder as well.\n // Priority of all tiles that refer to the _foveatedFactor and _distanceToCamera stored in the common ancestor will be differentiated based on their _depth.\n const minPriorityChild = children[minIndex];\n minPriorityChild._wasMinPriorityChild = true;\n const priorityHolder =\n (tile._wasMinPriorityChild || tile === tileset.root) &&\n minimumPriority <= tile._priorityHolder._foveatedFactor\n ? tile._priorityHolder\n : tile; // This is where priority dependency chains are wired up or started anew.\n priorityHolder._foveatedFactor = Math.min(\n minPriorityChild._foveatedFactor,\n priorityHolder._foveatedFactor\n );\n priorityHolder._distanceToCamera = Math.min(\n minPriorityChild._distanceToCamera,\n priorityHolder._distanceToCamera\n );\n\n for (i = 0; i < length; ++i) {\n child = children[i];\n child._priorityHolder = priorityHolder;\n }\n }\n\n return refines;\n}\n\nfunction inBaseTraversal(tileset, tile, baseScreenSpaceError) {\n if (!skipLevelOfDetail(tileset)) {\n return true;\n }\n if (tileset.immediatelyLoadDesiredLevelOfDetail) {\n return false;\n }\n if (!defined(tile._ancestorWithContent)) {\n // Include root or near-root tiles in the base traversal so there is something to select up to\n return true;\n }\n if (tile._screenSpaceError === 0.0) {\n // If a leaf, use parent's SSE\n return tile.parent._screenSpaceError > baseScreenSpaceError;\n }\n return tile._screenSpaceError > baseScreenSpaceError;\n}\n\nfunction canTraverse(tileset, tile) {\n if (tile.children.length === 0) {\n return false;\n }\n if (tile.hasTilesetContent || tile.hasImplicitContent) {\n // Traverse external tileset to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n return tile._screenSpaceError > tileset._maximumScreenSpaceError;\n}\n\nfunction executeTraversal(\n tileset,\n root,\n baseScreenSpaceError,\n maximumScreenSpaceError,\n frameState\n) {\n // Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n // If skipLevelOfDetail is off then a tile does not refine until all children are loaded.\n // This is the traditional replacement refinement approach and is called the base traversal.\n // Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n // all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n // and rendering children and parent tiles simultaneously.\n const stack = traversal.stack;\n stack.push(root);\n\n while (stack.length > 0) {\n traversal.stackMaximumLength = Math.max(\n traversal.stackMaximumLength,\n stack.length\n );\n\n const tile = stack.pop();\n\n updateTileAncestorContentLinks(tile, frameState);\n const baseTraversal = inBaseTraversal(tileset, tile, baseScreenSpaceError);\n const add = tile.refine === Cesium3DTileRefine.ADD;\n const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n const parent = tile.parent;\n const parentRefines = !defined(parent) || parent._refines;\n let refines = false;\n\n if (canTraverse(tileset, tile)) {\n refines =\n updateAndPushChildren(tileset, tile, stack, frameState) &&\n parentRefines;\n }\n\n const stoppedRefining = !refines && parentRefines;\n\n if (hasEmptyContent(tile)) {\n // Add empty tile just to show its debug bounding volume\n // If the tile has tileset content load the external tileset\n // If the tile cannot refine further select its nearest loaded ancestor\n addEmptyTile(tileset, tile, frameState);\n loadTile(tileset, tile, frameState);\n if (stoppedRefining) {\n selectDesiredTile(tileset, tile, frameState);\n }\n } else if (add) {\n // Additive tiles are always loaded and selected\n selectDesiredTile(tileset, tile, frameState);\n loadTile(tileset, tile, frameState);\n } else if (replace) {\n if (baseTraversal) {\n // Always load tiles in the base traversal\n // Select tiles that can't refine further\n loadTile(tileset, tile, frameState);\n if (stoppedRefining) {\n selectDesiredTile(tileset, tile, frameState);\n }\n } else if (stoppedRefining) {\n // In skip traversal, load and select tiles that can't refine further\n selectDesiredTile(tileset, tile, frameState);\n loadTile(tileset, tile, frameState);\n } else if (reachedSkippingThreshold(tileset, tile)) {\n // In skip traversal, load tiles that aren't skipped. In practice roughly half the tiles stay unloaded.\n loadTile(tileset, tile, frameState);\n }\n }\n\n visitTile(tileset, tile, frameState);\n touchTile(tileset, tile, frameState);\n tile._refines = refines;\n }\n}\n\nfunction executeEmptyTraversal(tileset, root, frameState) {\n // Depth-first traversal that checks if all nearest descendants with content are loaded. Ignores visibility.\n let allDescendantsLoaded = true;\n const stack = emptyTraversal.stack;\n stack.push(root);\n\n while (stack.length > 0) {\n emptyTraversal.stackMaximumLength = Math.max(\n emptyTraversal.stackMaximumLength,\n stack.length\n );\n\n const tile = stack.pop();\n const children = tile.children;\n const childrenLength = children.length;\n\n // Only traverse if the tile is empty - traversal stop at descendants with content\n const emptyContent = hasEmptyContent(tile);\n const traverse = emptyContent && canTraverse(tileset, tile);\n const emptyLeaf = emptyContent && tile.children.length === 0;\n\n // Traversal stops but the tile does not have content yet\n // There will be holes if the parent tries to refine to its children, so don't refine\n // One exception: a parent may refine even if one of its descendants is an empty leaf\n if (!traverse && !tile.contentAvailable && !emptyLeaf) {\n allDescendantsLoaded = false;\n }\n\n updateTile(tileset, tile, frameState);\n if (!isVisible(tile)) {\n // Load tiles that aren't visible since they are still needed for the parent to refine\n loadTile(tileset, tile, frameState);\n touchTile(tileset, tile, frameState);\n }\n\n if (traverse) {\n for (let i = 0; i < childrenLength; ++i) {\n const child = children[i];\n stack.push(child);\n }\n }\n }\n\n return allDescendantsLoaded;\n}\n\n/**\n * Traverse the tree and check if their selected frame is the current frame. If so, add it to a selection queue.\n * This is a preorder traversal so children tiles are selected before ancestor tiles.\n *\n * The reason for the preorder traversal is so that tiles can easily be marked with their\n * selection depth. A tile's _selectionDepth is its depth in the tree where all non-selected tiles are removed.\n * This property is important for use in the stencil test because we want to render deeper tiles on top of their\n * ancestors. If a tileset is very deep, the depth is unlikely to fit into the stencil buffer.\n *\n * We want to select children before their ancestors because there is no guarantee on the relationship between\n * the children's z-depth and the ancestor's z-depth. We cannot rely on Z because we want the child to appear on top\n * of ancestor regardless of true depth. The stencil tests used require children to be drawn first.\n *\n * NOTE: 3D Tiles uses 3 bits from the stencil buffer meaning this will not work when there is a chain of\n * selected tiles that is deeper than 7. This is not very likely.\n * @private\n */\nfunction traverseAndSelect(tileset, root, frameState) {\n const stack = selectionTraversal.stack;\n const ancestorStack = selectionTraversal.ancestorStack;\n let lastAncestor;\n\n stack.push(root);\n\n while (stack.length > 0 || ancestorStack.length > 0) {\n selectionTraversal.stackMaximumLength = Math.max(\n selectionTraversal.stackMaximumLength,\n stack.length\n );\n selectionTraversal.ancestorStackMaximumLength = Math.max(\n selectionTraversal.ancestorStackMaximumLength,\n ancestorStack.length\n );\n\n if (ancestorStack.length > 0) {\n const waitingTile = ancestorStack.peek();\n if (waitingTile._stackLength === stack.length) {\n ancestorStack.pop();\n if (waitingTile !== lastAncestor) {\n waitingTile._finalResolution = false;\n }\n selectTile(tileset, waitingTile, frameState);\n continue;\n }\n }\n\n const tile = stack.pop();\n if (!defined(tile)) {\n // stack is empty but ancestorStack isn't\n continue;\n }\n\n const add = tile.refine === Cesium3DTileRefine.ADD;\n const shouldSelect = tile._shouldSelect;\n const children = tile.children;\n const childrenLength = children.length;\n const traverse = canTraverse(tileset, tile);\n\n if (shouldSelect) {\n if (add) {\n selectTile(tileset, tile, frameState);\n } else {\n tile._selectionDepth = ancestorStack.length;\n if (tile._selectionDepth > 0) {\n tileset._hasMixedContent = true;\n }\n lastAncestor = tile;\n if (!traverse) {\n selectTile(tileset, tile, frameState);\n continue;\n }\n ancestorStack.push(tile);\n tile._stackLength = stack.length;\n }\n }\n\n if (traverse) {\n for (let i = 0; i < childrenLength; ++i) {\n const child = children[i];\n if (isVisible(child)) {\n stack.push(child);\n }\n }\n }\n }\n}\nexport default Cesium3DTilesetTraversal;\n", "import Cesium3DTilesetMostDetailedTraversal from \"./Cesium3DTilesetMostDetailedTraversal.js\";\nimport Cesium3DTilesetTraversal from \"./Cesium3DTilesetTraversal.js\";\n\n/**\n * The pass in which a 3D Tileset is updated.\n *\n * @private\n */\nconst Cesium3DTilePass = {\n RENDER: 0,\n PICK: 1,\n SHADOW: 2,\n PRELOAD: 3,\n PRELOAD_FLIGHT: 4,\n REQUEST_RENDER_MODE_DEFER_CHECK: 5,\n MOST_DETAILED_PRELOAD: 6,\n MOST_DETAILED_PICK: 7,\n NUMBER_OF_PASSES: 8,\n};\n\nconst passOptions = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);\n\npassOptions[Cesium3DTilePass.RENDER] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: true,\n requestTiles: true,\n ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.PICK] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: false,\n requestTiles: false,\n ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.SHADOW] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: false,\n requestTiles: true,\n ignoreCommands: false,\n});\n\npassOptions[Cesium3DTilePass.PRELOAD] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: false,\n requestTiles: true,\n ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: false,\n requestTiles: true,\n ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = Object.freeze({\n traversal: Cesium3DTilesetTraversal,\n isRender: false,\n requestTiles: true,\n ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = Object.freeze({\n traversal: Cesium3DTilesetMostDetailedTraversal,\n isRender: false,\n requestTiles: true,\n ignoreCommands: true,\n});\n\npassOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = Object.freeze({\n traversal: Cesium3DTilesetMostDetailedTraversal,\n isRender: false,\n requestTiles: false,\n ignoreCommands: false,\n});\n\nCesium3DTilePass.getPassOptions = function (pass) {\n return passOptions[pass];\n};\nexport default Object.freeze(Cesium3DTilePass);\n", "import destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Represents empty content for tiles in a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles} tileset that\n * do not have content, e.g., because they are used to optimize hierarchical culling.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @alias Empty3DTileContent\n * @constructor\n *\n * @private\n */\nfunction Empty3DTileContent(tileset, tile) {\n this._tileset = tileset;\n this._tile = tile;\n\n this.featurePropertiesDirty = false;\n}\n\nObject.defineProperties(Empty3DTileContent.prototype, {\n featuresLength: {\n get: function () {\n return 0;\n },\n },\n\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n trianglesLength: {\n get: function () {\n return 0;\n },\n },\n\n geometryByteLength: {\n get: function () {\n return 0;\n },\n },\n\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n batchTableByteLength: {\n get: function () {\n return 0;\n },\n },\n\n innerContents: {\n get: function () {\n return undefined;\n },\n },\n\n readyPromise: {\n get: function () {\n return undefined;\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n url: {\n get: function () {\n return undefined;\n },\n },\n\n metadata: {\n get: function () {\n return undefined;\n },\n set: function (value) {\n},\n },\n\n batchTable: {\n get: function () {\n return undefined;\n },\n },\n\n group: {\n get: function () {\n return undefined;\n },\n set: function (value) {\n},\n },\n});\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>\n * always returns <code>false</code> since a tile of this type does not have any features.\n */\nEmpty3DTileContent.prototype.hasProperty = function (batchId, name) {\n return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Empty3DTileContent</code>\n * always returns <code>undefined</code> since a tile of this type does not have any features.\n */\nEmpty3DTileContent.prototype.getFeature = function (batchId) {\n return undefined;\n};\n\nEmpty3DTileContent.prototype.applyDebugSettings = function (enabled, color) {};\n\nEmpty3DTileContent.prototype.applyStyle = function (style) {};\n\nEmpty3DTileContent.prototype.update = function (tileset, frameState) {};\n\nEmpty3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nEmpty3DTileContent.prototype.destroy = function () {\n return destroyObject(this);\n};\nexport default Empty3DTileContent;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about the content of a 3D Tile. This represents the content metadata JSON (3D Tiles 1.1)\n * or the <code>3DTILES_metadata</code> extension on a single {@link Cesium3DTileContent}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.content Either the content metadata JSON (3D Tiles 1.1) or the extension JSON attached to the content.\n * @param {MetadataClass} options.class The class that the content metadata conforms to.\n *\n * @alias ContentMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ContentMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const content = options.content;\n const metadataClass = options.class;\n\n this._class = metadataClass;\n this._properties = content.properties;\n this._extensions = content.extensions;\n this._extras = content.extras;\n}\n\nObject.defineProperties(ContentMetadata.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof ContentMetadata.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof ContentMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof ContentMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the content has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the content has this property.\n * @private\n */\nContentMetadata.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the content has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the content has a property with the given semantic.\n * @private\n */\nContentMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nContentMetadata.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the content does not have this property.\n * @private\n */\nContentMetadata.prototype.getProperty = function (propertyId) {\n return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nContentMetadata.prototype.setProperty = function (propertyId, value) {\n return MetadataEntity.setProperty(\n propertyId,\n value,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the content does not have this semantic.\n * @private\n */\nContentMetadata.prototype.getPropertyBySemantic = function (semantic) {\n return MetadataEntity.getPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nContentMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n return MetadataEntity.setPropertyBySemantic(\n semantic,\n value,\n this._properties,\n this._class\n );\n};\n\nexport default ContentMetadata;\n", "import ContentMetadata from \"./ContentMetadata.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\n/**\n * Check if a content has metadata, either defined in its metadata field (3D Tiles 1.1) or in\n * the <code>3DTILES_metadata</code> extension. If defined, get the content metadata\n * with the corresponding class.\n *\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for content metadata\n * @param {Object} contentHeader the JSON header for a {@link Cesium3DTileContent}\n * @return {ContentMetadata} the content metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findContentMetadata(tileset, contentHeader) {\n const metadataJson = hasExtension(contentHeader, \"3DTILES_metadata\")\n ? contentHeader.extensions[\"3DTILES_metadata\"]\n : contentHeader.metadata;\n\n if (!defined(metadataJson)) {\n return undefined;\n }\n\n if (!defined(tileset.schema)) {\n findContentMetadata._oneTimeWarning(\n \"findContentMetadata-missing-root-schema\",\n \"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.\"\n );\n return undefined;\n }\n\n const classes = defaultValue(\n tileset.schema.classes,\n defaultValue.EMPTY_OBJECT\n );\n if (defined(metadataJson.class)) {\n const contentClass = classes[metadataJson.class];\n return new ContentMetadata({\n content: metadataJson,\n class: contentClass,\n });\n }\n\n return undefined;\n}\n\n// Exposed for testing\nfindContentMetadata._oneTimeWarning = oneTimeWarning;\nexport default findContentMetadata;\n", "import defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\n\n/**\n * Check if a content has metadata, either defined in its metadata field (3D Tiles 1.1)\n * or in the <code>3DTILES_metadata</code> extension. If so, look up the group with the\n * corresponding ID.\n *\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for group metadata\n * @param {Object} contentHeader the JSON header for a {@link Cesium3DTileContent}\n * @return {GroupMetadata} the group metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findGroupMetadata(tileset, contentHeader) {\n const metadataExtension = tileset.metadataExtension;\n if (!defined(metadataExtension)) {\n return undefined;\n }\n const groups = metadataExtension.groups;\n\n const group = hasExtension(contentHeader, \"3DTILES_metadata\")\n ? contentHeader.extensions[\"3DTILES_metadata\"].group\n : contentHeader.group;\n\n if (typeof group === \"number\") {\n return groups[group];\n }\n\n const index = metadataExtension.groupIds.findIndex(function (id) {\n return id === group;\n });\n\n return index >= 0 ? groups[index] : undefined;\n}\n\nexport default findGroupMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about a 3D Tile. This represents the tile metadata JSON (3D Tiles 1.1)\n * or the <code>3DTILES_metadata</code> extension on a single {@link Cesium3DTile}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.tile Either the tile metadata JSON (3D Tiles 1.1), or the extension JSON attached to the tile.\n * @param {MetadataClass} options.class The class that the tile metadata conforms to.\n *\n * @alias TileMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TileMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const tile = options.tile;\n const metadataClass = options.class;\n\n this._class = metadataClass;\n this._properties = tile.properties;\n this._extensions = tile.extensions;\n this._extras = tile.extras;\n}\n\nObject.defineProperties(TileMetadata.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof TileMetadata.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof TileMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof TileMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the tile has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the tile has this property.\n * @private\n */\nTileMetadata.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the tile has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the tile has a property with the given semantic.\n * @private\n */\nTileMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nTileMetadata.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this property.\n * @private\n */\nTileMetadata.prototype.getProperty = function (propertyId) {\n return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTileMetadata.prototype.setProperty = function (propertyId, value) {\n return MetadataEntity.setProperty(\n propertyId,\n value,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tile does not have this semantic.\n * @private\n */\nTileMetadata.prototype.getPropertyBySemantic = function (semantic) {\n return MetadataEntity.getPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTileMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n return MetadataEntity.setPropertyBySemantic(\n semantic,\n value,\n this._properties,\n this._class\n );\n};\n\nexport default TileMetadata;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport TileMetadata from \"./TileMetadata.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\n/**\n * Check if a tile has metadata, either defined in its metadata field (3D Tiles 1.1)\n * or in the <code>3DTILES_metadata</code> extension. If defined, get the tile metadata\n * with the corresponding class.\n * <p>\n * This assumes that tileset.metadata has been created before any tiles are constructed.\n * </p>\n * @function\n *\n * @param {Cesium3DTileset} tileset The tileset to query for tile metadata\n * @param {Object} tileHeader the JSON header for a {@link Cesium3DTile}\n * @return {TileMetadata} the tile metadata, or <code>undefined</code> if not found\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction findTileMetadata(tileset, tileHeader) {\n const metadataJson = hasExtension(tileHeader, \"3DTILES_metadata\")\n ? tileHeader.extensions[\"3DTILES_metadata\"]\n : tileHeader.metadata;\n\n if (!defined(metadataJson)) {\n return undefined;\n }\n\n if (!defined(tileset.schema)) {\n findTileMetadata._oneTimeWarning(\n \"findTileMetadata-missing-root-schema\",\n \"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.\"\n );\n return undefined;\n }\n\n const classes = defaultValue(\n tileset.schema.classes,\n defaultValue.EMPTY_OBJECT\n );\n if (defined(metadataJson.class)) {\n const tileClass = classes[metadataJson.class];\n return new TileMetadata({\n tile: metadataJson,\n class: tileClass,\n });\n }\n\n return undefined;\n}\n\n// Exposed for testing\nfindTileMetadata._oneTimeWarning = oneTimeWarning;\nexport default findTileMetadata;\n", "import defined from \"../Core/defined.js\";\nimport getJsonFromTypedArray from \"../Core/getJsonFromTypedArray.js\";\nimport getMagic from \"../Core/getMagic.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\n\n/**\n * Results of the preprocess3DTileContent() function. This includes the\n * {@link Cesium3DTileContentType} and the payload. The payload is either\n * binary or JSON depending on the content type.\n *\n * @typedef {Object} PreprocessedContent\n * @property {Cesium3DTileContentType} contentType The type of the content\n * @property {Uint8Array} [binaryPayload] For binary files, the payload is returned as a typed array with byteOffset of 0\n * @property {Object} [jsonPayload] For JSON files, the results are returned as a JSON object.\n * @private\n */\n\n/**\n * Preprocess a {@link Cesium3DTileContent}, to determine the type of content\n * and to parse JSON files into objects.\n *\n * @param {ArrayBuffer} arrayBuffer The raw binary payload\n * @return {PreprocessedContent}\n * @private\n */\nfunction preprocess3DTileContent(arrayBuffer) {\n const uint8Array = new Uint8Array(arrayBuffer);\n let contentType = getMagic(uint8Array);\n\n // We use glTF for JSON glTF files. For binary glTF, we rename this\n // to glb to disambiguate\n if (contentType === \"glTF\") {\n contentType = \"glb\";\n }\n\n if (Cesium3DTileContentType.isBinaryFormat(contentType)) {\n return {\n // For binary files, the enum value is the magic number\n contentType: contentType,\n binaryPayload: uint8Array,\n };\n }\n\n const json = getJsonContent(uint8Array);\n if (defined(json.root)) {\n // Most likely a tileset JSON\n return {\n contentType: Cesium3DTileContentType.EXTERNAL_TILESET,\n jsonPayload: json,\n };\n }\n\n if (defined(json.asset)) {\n // Most likely a glTF. Tileset JSON also has an \"asset\" property\n // so this check needs to happen second\n return {\n contentType: Cesium3DTileContentType.GLTF,\n jsonPayload: json,\n };\n }\n\n if (defined(json.tileAvailability)) {\n // Most likely a subtree JSON.\n return {\n contentType: Cesium3DTileContentType.IMPLICIT_SUBTREE_JSON,\n jsonPayload: json,\n };\n }\n\n if (defined(json.type)) {\n // Most likely a GeoJSON\n return {\n contentType: Cesium3DTileContentType.GEOJSON,\n jsonPayload: json,\n };\n }\n\n throw new RuntimeError(\"Invalid tile content.\");\n}\n\nfunction getJsonContent(uint8Array) {\n let json;\n\n try {\n json = getJsonFromTypedArray(uint8Array);\n } catch (error) {\n throw new RuntimeError(\"Invalid tile content.\");\n }\n\n return json;\n}\n\nexport default preprocess3DTileContent;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DContentGroup from \"./Cesium3DContentGroup.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\nimport Cesium3DTileContentFactory from \"./Cesium3DTileContentFactory.js\";\nimport findContentMetadata from \"./findContentMetadata.js\";\nimport findGroupMetadata from \"./findGroupMetadata.js\";\nimport preprocess3DTileContent from \"./preprocess3DTileContent.js\";\n\n/**\n * A collection of contents for tiles that have multiple contents, either via the tile JSON (3D Tiles 1.1) or the <code>3DTILES_multiple_contents</code> extension.\n * <p>\n * Implements the {@link Cesium3DTileContent} interface.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_multiple_contents|3DTILES_multiple_contents extension}\n *\n * @alias Multiple3DTileContent\n * @constructor\n *\n * @param {Cesium3DTileset} tileset The tileset this content belongs to\n * @param {Cesium3DTile} tile The content this content belongs to\n * @param {Resource} tilesetResource The resource that points to the tileset. This will be used to derive each inner content's resource.\n * @param {Object} contentsJson Either the tile JSON containing the contents array (3D Tiles 1.1), or <code>3DTILES_multiple_contents</code> extension JSON\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Multiple3DTileContent(tileset, tile, tilesetResource, contentsJson) {\n this._tileset = tileset;\n this._tile = tile;\n this._tilesetResource = tilesetResource;\n this._contents = [];\n this._contentsCreated = false;\n\n // An older version of 3DTILES_multiple_contents used \"content\" instead of \"contents\"\n const contentHeaders = defined(contentsJson.contents)\n ? contentsJson.contents\n : contentsJson.content;\n\n this._innerContentHeaders = contentHeaders;\n this._requestsInFlight = 0;\n\n // How many times cancelPendingRequests() has been called. This is\n // used to help short-circuit computations after a tile was canceled.\n this._cancelCount = 0;\n\n const contentCount = this._innerContentHeaders.length;\n this._arrayFetchPromises = new Array(contentCount);\n this._requests = new Array(contentCount);\n\n this._innerContentResources = new Array(contentCount);\n this._serverKeys = new Array(contentCount);\n\n for (let i = 0; i < contentCount; i++) {\n const contentResource = tilesetResource.getDerivedResource({\n url: contentHeaders[i].uri,\n });\n\n const serverKey = RequestScheduler.getServerKey(\n contentResource.getUrlComponent()\n );\n\n this._innerContentResources[i] = contentResource;\n this._serverKeys[i] = serverKey;\n }\n\n // undefined until the first time requests are scheduled\n this._contentsFetchedPromise = undefined;\n}\n\nObject.defineProperties(Multiple3DTileContent.prototype, {\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code> checks if any of the inner contents have dirty featurePropertiesDirty.\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Boolean}\n *\n * @private\n */\n featurePropertiesDirty: {\n get: function () {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n if (contents[i].featurePropertiesDirty) {\n return true;\n }\n }\n\n return false;\n },\n set: function (value) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].featurePropertiesDirty = value;\n }\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>featuresLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n featuresLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead, call <code>pointsLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n pointsLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>trianglesLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n trianglesLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>geometryByteLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n geometryByteLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>texturesByteLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n texturesByteLength: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>0</code>. Instead call <code>batchTableByteLength</code> for a specific inner content.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @private\n */\n batchTableByteLength: {\n get: function () {\n return 0;\n },\n },\n\n innerContents: {\n get: function () {\n return this._contents;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. This behaves\n * differently for <code>Multiple3DTileContent</code>: it returns\n * undefined if the inner contents have not yet been created. This\n * is handled specially in {@link Cesium3DTile}.\n *\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Promise.<Cesium3DTileContent>|undefined}\n * @readonly\n *\n * @private\n */\n readyPromise: {\n get: function () {\n // The contents haven't been created yet, short-circuit. The tile\n // will handle this as a special case\n if (!this._contentsCreated) {\n return undefined;\n }\n\n const readyPromises = this._contents.map(function (content) {\n return content.readyPromise;\n });\n\n const that = this;\n return Promise.all(readyPromises).then(function () {\n return that;\n });\n },\n },\n\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n tile: {\n get: function () {\n return this._tile;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface.\n * Unlike other content types, <code>Multiple3DTileContent</code> does not\n * have a single URL, so this returns undefined.\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {String}\n * @readonly\n * @private\n */\n url: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>metadata</code> for a specific inner content.\n * @memberof Multiple3DTileContent.prototype\n * @private\n */\n metadata: {\n get: function () {\n return undefined;\n },\n set: function () {\n},\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>batchTable</code> for a specific inner content.\n * @memberof Multiple3DTileContent.prototype\n * @private\n */\n batchTable: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>group</code> for a specific inner content.\n * @memberof Multiple3DTileContent.prototype\n * @private\n */\n group: {\n get: function () {\n return undefined;\n },\n set: function () {\n},\n },\n\n /**\n * Get an array of the inner content URLs, regardless of whether they've\n * been fetched or not. This is intended for use with\n * {@link Cesium3DTileset#debugShowUrl}.\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {String[]}\n * @readonly\n * @private\n */\n innerContentUrls: {\n get: function () {\n return this._innerContentHeaders.map(function (contentHeader) {\n return contentHeader.uri;\n });\n },\n },\n\n /**\n * A promise that resolves when all of the inner contents have been fetched.\n * This promise is undefined until the first frame where all array buffer\n * requests have been scheduled.\n * @memberof Multiple3DTileContent.prototype\n *\n * @type {Promise}\n * @private\n */\n contentsFetchedPromise: {\n get: function () {\n return this._contentsFetchedPromise;\n },\n },\n});\n\nfunction updatePendingRequests(multipleContents, deltaRequestCount) {\n multipleContents._requestsInFlight += deltaRequestCount;\n multipleContents.tileset.statistics.numberOfPendingRequests += deltaRequestCount;\n}\n\nfunction cancelPendingRequests(multipleContents, originalContentState) {\n multipleContents._cancelCount++;\n\n // reset the tile's content state to try again later.\n multipleContents._tile._contentState = originalContentState;\n\n const statistics = multipleContents.tileset.statistics;\n\n statistics.numberOfPendingRequests -= multipleContents._requestsInFlight;\n statistics.numberOfAttemptedRequests += multipleContents._requestsInFlight;\n multipleContents._requestsInFlight = 0;\n\n // Discard the request promises.\n const contentCount = multipleContents._innerContentHeaders.length;\n multipleContents._arrayFetchPromises = new Array(contentCount);\n}\n\n/**\n * Request the inner contents of this <code>Multiple3DTileContent</code>. This must be called once a frame until\n * {@link Multiple3DTileContent#contentsFetchedPromise} is defined. This promise\n * becomes available as soon as all requests are scheduled.\n * <p>\n * This method also updates the tile statistics' pending request count if the\n * requests are successfully scheduled.\n * </p>\n *\n * @return {Number} The number of attempted requests that were unable to be scheduled.\n * @private\n */\nMultiple3DTileContent.prototype.requestInnerContents = function () {\n // It's possible for these promises to leak content array buffers if the\n // camera moves before they all are scheduled. To prevent this leak, check\n // if we can schedule all the requests at once. If not, no requests are\n // scheduled\n if (!canScheduleAllRequests(this._serverKeys)) {\n return this._serverKeys.length;\n }\n\n const contentHeaders = this._innerContentHeaders;\n updatePendingRequests(this, contentHeaders.length);\n\n for (let i = 0; i < contentHeaders.length; i++) {\n // The cancel count is needed to avoid a race condition where a content\n // is canceled multiple times.\n this._arrayFetchPromises[i] = requestInnerContent(\n this,\n i,\n this._cancelCount,\n this._tile._contentState\n );\n }\n\n this._contentsFetchedPromise = createInnerContents(this);\n\n return 0;\n};\n\n/**\n * Check if all requests for inner contents can be scheduled at once. This is slower, but it avoids a potential memory leak.\n * @param {String[]} serverKeys The server keys for all of the inner contents\n * @return {Boolean} True if the request scheduler has enough open slots for all inner contents\n * @private\n */\nfunction canScheduleAllRequests(serverKeys) {\n const requestCountsByServer = {};\n for (let i = 0; i < serverKeys.length; i++) {\n const serverKey = serverKeys[i];\n if (defined(requestCountsByServer[serverKey])) {\n requestCountsByServer[serverKey]++;\n } else {\n requestCountsByServer[serverKey] = 1;\n }\n }\n\n for (const key in requestCountsByServer) {\n if (\n requestCountsByServer.hasOwnProperty(key) &&\n !RequestScheduler.serverHasOpenSlots(key, requestCountsByServer[key])\n ) {\n return false;\n }\n }\n return RequestScheduler.heapHasOpenSlots(serverKeys.length);\n}\n\nfunction requestInnerContent(\n multipleContents,\n index,\n originalCancelCount,\n originalContentState\n) {\n // it is important to clone here. The fetchArrayBuffer() below here uses\n // throttling, but other uses of the resources do not.\n const contentResource = multipleContents._innerContentResources[\n index\n ].clone();\n const tile = multipleContents.tile;\n\n // Always create a new request. If the tile gets canceled, this\n // avoids getting stuck in the canceled state.\n const priorityFunction = function () {\n return tile._priority;\n };\n const serverKey = multipleContents._serverKeys[index];\n const request = new Request({\n throttle: true,\n throttleByServer: true,\n type: RequestType.TILES3D,\n priorityFunction: priorityFunction,\n serverKey: serverKey,\n });\n contentResource.request = request;\n multipleContents._requests[index] = request;\n\n const promise = contentResource.fetchArrayBuffer();\n if (!defined(promise)) {\n return Promise.resolve(undefined);\n }\n\n return promise\n .then(function (arrayBuffer) {\n // Short circuit if another inner content was canceled.\n if (originalCancelCount < multipleContents._cancelCount) {\n return undefined;\n }\n\n updatePendingRequests(multipleContents, -1);\n return arrayBuffer;\n })\n .catch(function (error) {\n // Short circuit if another inner content was canceled.\n if (originalCancelCount < multipleContents._cancelCount) {\n return undefined;\n }\n\n if (contentResource.request.state === RequestState.CANCELLED) {\n cancelPendingRequests(multipleContents, originalContentState);\n return undefined;\n }\n\n updatePendingRequests(multipleContents, -1);\n handleInnerContentFailed(multipleContents, index, error);\n });\n}\n\nfunction createInnerContents(multipleContents) {\n const originalCancelCount = multipleContents._cancelCount;\n return Promise.all(multipleContents._arrayFetchPromises).then(function (\n arrayBuffers\n ) {\n // Short circuit if inner contents were canceled\n if (originalCancelCount < multipleContents._cancelCount) {\n return undefined;\n }\n\n const contents = arrayBuffers.map(function (arrayBuffer, i) {\n if (!defined(arrayBuffer)) {\n // Content was not fetched. The error was handled in\n // the fetch promise. Return undefined to indicate partial failure.\n return undefined;\n }\n\n return createInnerContent(multipleContents, arrayBuffer, i);\n });\n\n // Even if we had a partial success, mark that we finished creating\n // contents\n multipleContents._contentsCreated = true;\n multipleContents._contents = contents.filter(defined);\n });\n}\n\nfunction createInnerContent(multipleContents, arrayBuffer, index) {\n const preprocessed = preprocess3DTileContent(arrayBuffer);\n\n if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) {\n const error = new RuntimeError(\n \"External tilesets are disallowed inside multiple contents\"\n );\n\n return handleInnerContentFailed(multipleContents, index, error);\n }\n\n multipleContents._disableSkipLevelOfDetail =\n multipleContents._disableSkipLevelOfDetail ||\n preprocessed.contentType === Cesium3DTileContentType.GEOMETRY ||\n preprocessed.contentType === Cesium3DTileContentType.VECTOR;\n\n const tileset = multipleContents._tileset;\n const resource = multipleContents._innerContentResources[index];\n const tile = multipleContents._tile;\n\n let content;\n const contentFactory = Cesium3DTileContentFactory[preprocessed.contentType];\n if (defined(preprocessed.binaryPayload)) {\n content = contentFactory(\n tileset,\n tile,\n resource,\n preprocessed.binaryPayload.buffer,\n 0\n );\n } else {\n // JSON formats\n content = contentFactory(tileset, tile, resource, preprocessed.jsonPayload);\n }\n\n const contentHeader = multipleContents._innerContentHeaders[index];\n\n if (tile.hasImplicitContentMetadata) {\n const subtree = tile.implicitSubtree;\n const coordinates = tile.implicitCoordinates;\n content.metadata = subtree.getContentMetadataView(coordinates, index);\n } else if (!tile.hasImplicitContent) {\n content.metadata = findContentMetadata(tileset, contentHeader);\n }\n\n const groupMetadata = findGroupMetadata(tileset, contentHeader);\n if (defined(groupMetadata)) {\n content.group = new Cesium3DContentGroup({\n metadata: groupMetadata,\n });\n }\n return content;\n}\n\nfunction handleInnerContentFailed(multipleContents, index, error) {\n const tileset = multipleContents._tileset;\n const url = multipleContents._innerContentResources[index].url;\n const message = defined(error.message) ? error.message : error.toString();\n if (tileset.tileFailed.numberOfListeners > 0) {\n tileset.tileFailed.raiseEvent({\n url: url,\n message: message,\n });\n } else {\n console.log(`A content failed to load: ${url}`);\n console.log(`Error: ${message}`);\n }\n}\n\n/**\n * Cancel all requests for inner contents. This is called by the tile\n * when a tile goes out of view.\n *\n * @private\n */\nMultiple3DTileContent.prototype.cancelRequests = function () {\n for (let i = 0; i < this._requests.length; i++) {\n const request = this._requests[i];\n if (defined(request)) {\n request.cancel();\n }\n }\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>false</code>. Instead call <code>hasProperty</code> for a specific inner content\n * @private\n */\nMultiple3DTileContent.prototype.hasProperty = function (batchId, name) {\n return false;\n};\n\n/**\n * Part of the {@link Cesium3DTileContent} interface. <code>Multiple3DTileContent</code>\n * always returns <code>undefined</code>. Instead call <code>getFeature</code> for a specific inner content\n * @private\n */\nMultiple3DTileContent.prototype.getFeature = function (batchId) {\n return undefined;\n};\n\nMultiple3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].applyDebugSettings(enabled, color);\n }\n};\n\nMultiple3DTileContent.prototype.applyStyle = function (style) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].applyStyle(style);\n }\n};\n\nMultiple3DTileContent.prototype.update = function (tileset, frameState) {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].update(tileset, frameState);\n }\n};\n\nMultiple3DTileContent.prototype.isDestroyed = function () {\n return false;\n};\n\nMultiple3DTileContent.prototype.destroy = function () {\n const contents = this._contents;\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n contents[i].destroy();\n }\n return destroyObject(this);\n};\n\nexport default Multiple3DTileContent;\n", "import earcut from \"earcut\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nconst scaleToGeodeticHeightN = new Cartesian3();\nconst scaleToGeodeticHeightP = new Cartesian3();\n\n/**\n * @private\n */\nconst PolygonPipeline = {};\n\n/**\n * @exception {DeveloperError} At least three positions are required.\n */\nPolygonPipeline.computeArea2D = function (positions) {\n const length = positions.length;\n let area = 0.0;\n\n for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\n const v0 = positions[i0];\n const v1 = positions[i1];\n\n area += v0.x * v1.y - v1.x * v0.y;\n }\n\n return area * 0.5;\n};\n\n/**\n * @returns {WindingOrder} The winding order.\n *\n * @exception {DeveloperError} At least three positions are required.\n */\nPolygonPipeline.computeWindingOrder2D = function (positions) {\n const area = PolygonPipeline.computeArea2D(positions);\n return area > 0.0 ? WindingOrder.COUNTER_CLOCKWISE : WindingOrder.CLOCKWISE;\n};\n\n/**\n * Triangulate a polygon.\n *\n * @param {Cartesian2[]} positions Cartesian2 array containing the vertices of the polygon\n * @param {Number[]} [holes] An array of the staring indices of the holes.\n * @returns {Number[]} Index array representing triangles that fill the polygon\n */\nPolygonPipeline.triangulate = function (positions, holes) {\n const flattenedPositions = Cartesian2.packArray(positions);\n return earcut(flattenedPositions, holes, 2);\n};\n\nconst subdivisionV0Scratch = new Cartesian3();\nconst subdivisionV1Scratch = new Cartesian3();\nconst subdivisionV2Scratch = new Cartesian3();\nconst subdivisionS0Scratch = new Cartesian3();\nconst subdivisionS1Scratch = new Cartesian3();\nconst subdivisionS2Scratch = new Cartesian3();\nconst subdivisionMidScratch = new Cartesian3();\nconst subdivisionT0Scratch = new Cartesian2();\nconst subdivisionT1Scratch = new Cartesian2();\nconst subdivisionT2Scratch = new Cartesian2();\nconst subdivisionTexcoordMidScratch = new Cartesian2();\n\n/**\n * Subdivides positions and raises points to the surface of the ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\n * @param {Number[]} indices An array of indices that determines the triangles in the polygon.\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\n * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n *\n * @exception {DeveloperError} At least three indices are required.\n * @exception {DeveloperError} The number of indices must be divisable by three.\n * @exception {DeveloperError} Granularity must be greater than zero.\n */\nPolygonPipeline.computeSubdivision = function (\n ellipsoid,\n positions,\n indices,\n texcoords,\n granularity\n) {\n granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\n\n const hasTexcoords = defined(texcoords);\n\n // triangles that need (or might need) to be subdivided.\n const triangles = indices.slice(0);\n\n // New positions due to edge splits are appended to the positions list.\n let i;\n const length = positions.length;\n const subdividedPositions = new Array(length * 3);\n const subdividedTexcoords = new Array(length * 2);\n let q = 0;\n let p = 0;\n for (i = 0; i < length; i++) {\n const item = positions[i];\n subdividedPositions[q++] = item.x;\n subdividedPositions[q++] = item.y;\n subdividedPositions[q++] = item.z;\n\n if (hasTexcoords) {\n const texcoordItem = texcoords[i];\n subdividedTexcoords[p++] = texcoordItem.x;\n subdividedTexcoords[p++] = texcoordItem.y;\n }\n }\n\n const subdividedIndices = [];\n\n // Used to make sure shared edges are not split more than once.\n const edges = {};\n\n const radius = ellipsoid.maximumRadius;\n const minDistance = CesiumMath.chordLength(granularity, radius);\n const minDistanceSqrd = minDistance * minDistance;\n\n while (triangles.length > 0) {\n const i2 = triangles.pop();\n const i1 = triangles.pop();\n const i0 = triangles.pop();\n\n const v0 = Cartesian3.fromArray(\n subdividedPositions,\n i0 * 3,\n subdivisionV0Scratch\n );\n const v1 = Cartesian3.fromArray(\n subdividedPositions,\n i1 * 3,\n subdivisionV1Scratch\n );\n const v2 = Cartesian3.fromArray(\n subdividedPositions,\n i2 * 3,\n subdivisionV2Scratch\n );\n\n let t0, t1, t2;\n if (hasTexcoords) {\n t0 = Cartesian2.fromArray(\n subdividedTexcoords,\n i0 * 2,\n subdivisionT0Scratch\n );\n t1 = Cartesian2.fromArray(\n subdividedTexcoords,\n i1 * 2,\n subdivisionT1Scratch\n );\n t2 = Cartesian2.fromArray(\n subdividedTexcoords,\n i2 * 2,\n subdivisionT2Scratch\n );\n }\n\n const s0 = Cartesian3.multiplyByScalar(\n Cartesian3.normalize(v0, subdivisionS0Scratch),\n radius,\n subdivisionS0Scratch\n );\n const s1 = Cartesian3.multiplyByScalar(\n Cartesian3.normalize(v1, subdivisionS1Scratch),\n radius,\n subdivisionS1Scratch\n );\n const s2 = Cartesian3.multiplyByScalar(\n Cartesian3.normalize(v2, subdivisionS2Scratch),\n radius,\n subdivisionS2Scratch\n );\n\n const g0 = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(s0, s1, subdivisionMidScratch)\n );\n const g1 = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(s1, s2, subdivisionMidScratch)\n );\n const g2 = Cartesian3.magnitudeSquared(\n Cartesian3.subtract(s2, s0, subdivisionMidScratch)\n );\n\n const max = Math.max(g0, g1, g2);\n let edge;\n let mid;\n let midTexcoord;\n\n // if the max length squared of a triangle edge is greater than the chord length of squared\n // of the granularity, subdivide the triangle\n if (max > minDistanceSqrd) {\n if (g0 === max) {\n edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = Cartesian3.add(v0, v1, subdivisionMidScratch);\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\n subdividedPositions.push(mid.x, mid.y, mid.z);\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i0, i, i2);\n triangles.push(i, i1, i2);\n } else if (g1 === max) {\n edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = Cartesian3.add(v1, v2, subdivisionMidScratch);\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\n subdividedPositions.push(mid.x, mid.y, mid.z);\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i1, i, i0);\n triangles.push(i, i2, i0);\n } else if (g2 === max) {\n edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = Cartesian3.add(v2, v0, subdivisionMidScratch);\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\n subdividedPositions.push(mid.x, mid.y, mid.z);\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i2, i, i1);\n triangles.push(i, i0, i1);\n }\n } else {\n subdividedIndices.push(i0);\n subdividedIndices.push(i1);\n subdividedIndices.push(i2);\n }\n }\n\n const geometryOptions = {\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: subdividedPositions,\n }),\n },\n indices: subdividedIndices,\n primitiveType: PrimitiveType.TRIANGLES,\n };\n\n if (hasTexcoords) {\n geometryOptions.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: subdividedTexcoords,\n });\n }\n\n return new Geometry(geometryOptions);\n};\n\nconst subdivisionC0Scratch = new Cartographic();\nconst subdivisionC1Scratch = new Cartographic();\nconst subdivisionC2Scratch = new Cartographic();\nconst subdivisionCartographicScratch = new Cartographic();\n\n/**\n * Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\n * @param {Number[]} indices An array of indices that determines the triangles in the polygon.\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\n * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n *\n * @exception {DeveloperError} At least three indices are required.\n * @exception {DeveloperError} The number of indices must be divisable by three.\n * @exception {DeveloperError} Granularity must be greater than zero.\n */\nPolygonPipeline.computeRhumbLineSubdivision = function (\n ellipsoid,\n positions,\n indices,\n texcoords,\n granularity\n) {\n granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\n\n const hasTexcoords = defined(texcoords);\n\n // triangles that need (or might need) to be subdivided.\n const triangles = indices.slice(0);\n\n // New positions due to edge splits are appended to the positions list.\n let i;\n const length = positions.length;\n const subdividedPositions = new Array(length * 3);\n const subdividedTexcoords = new Array(length * 2);\n let q = 0;\n let p = 0;\n for (i = 0; i < length; i++) {\n const item = positions[i];\n subdividedPositions[q++] = item.x;\n subdividedPositions[q++] = item.y;\n subdividedPositions[q++] = item.z;\n\n if (hasTexcoords) {\n const texcoordItem = texcoords[i];\n subdividedTexcoords[p++] = texcoordItem.x;\n subdividedTexcoords[p++] = texcoordItem.y;\n }\n }\n\n const subdividedIndices = [];\n\n // Used to make sure shared edges are not split more than once.\n const edges = {};\n\n const radius = ellipsoid.maximumRadius;\n const minDistance = CesiumMath.chordLength(granularity, radius);\n\n const rhumb0 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n const rhumb1 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n const rhumb2 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\n\n while (triangles.length > 0) {\n const i2 = triangles.pop();\n const i1 = triangles.pop();\n const i0 = triangles.pop();\n\n const v0 = Cartesian3.fromArray(\n subdividedPositions,\n i0 * 3,\n subdivisionV0Scratch\n );\n const v1 = Cartesian3.fromArray(\n subdividedPositions,\n i1 * 3,\n subdivisionV1Scratch\n );\n const v2 = Cartesian3.fromArray(\n subdividedPositions,\n i2 * 3,\n subdivisionV2Scratch\n );\n\n let t0, t1, t2;\n if (hasTexcoords) {\n t0 = Cartesian2.fromArray(\n subdividedTexcoords,\n i0 * 2,\n subdivisionT0Scratch\n );\n t1 = Cartesian2.fromArray(\n subdividedTexcoords,\n i1 * 2,\n subdivisionT1Scratch\n );\n t2 = Cartesian2.fromArray(\n subdividedTexcoords,\n i2 * 2,\n subdivisionT2Scratch\n );\n }\n\n const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);\n const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);\n const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);\n\n rhumb0.setEndPoints(c0, c1);\n const g0 = rhumb0.surfaceDistance;\n rhumb1.setEndPoints(c1, c2);\n const g1 = rhumb1.surfaceDistance;\n rhumb2.setEndPoints(c2, c0);\n const g2 = rhumb2.surfaceDistance;\n\n const max = Math.max(g0, g1, g2);\n let edge;\n let mid;\n let midHeight;\n let midCartesian3;\n let midTexcoord;\n\n // if the max length squared of a triangle edge is greater than granularity, subdivide the triangle\n if (max > minDistance) {\n if (g0 === max) {\n edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = rhumb0.interpolateUsingFraction(\n 0.5,\n subdivisionCartographicScratch\n );\n midHeight = (c0.height + c1.height) * 0.5;\n midCartesian3 = Cartesian3.fromRadians(\n mid.longitude,\n mid.latitude,\n midHeight,\n ellipsoid,\n subdivisionMidScratch\n );\n subdividedPositions.push(\n midCartesian3.x,\n midCartesian3.y,\n midCartesian3.z\n );\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i0, i, i2);\n triangles.push(i, i1, i2);\n } else if (g1 === max) {\n edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = rhumb1.interpolateUsingFraction(\n 0.5,\n subdivisionCartographicScratch\n );\n midHeight = (c1.height + c2.height) * 0.5;\n midCartesian3 = Cartesian3.fromRadians(\n mid.longitude,\n mid.latitude,\n midHeight,\n ellipsoid,\n subdivisionMidScratch\n );\n subdividedPositions.push(\n midCartesian3.x,\n midCartesian3.y,\n midCartesian3.z\n );\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i1, i, i0);\n triangles.push(i, i2, i0);\n } else if (g2 === max) {\n edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\n\n i = edges[edge];\n if (!defined(i)) {\n mid = rhumb2.interpolateUsingFraction(\n 0.5,\n subdivisionCartographicScratch\n );\n midHeight = (c2.height + c0.height) * 0.5;\n midCartesian3 = Cartesian3.fromRadians(\n mid.longitude,\n mid.latitude,\n midHeight,\n ellipsoid,\n subdivisionMidScratch\n );\n subdividedPositions.push(\n midCartesian3.x,\n midCartesian3.y,\n midCartesian3.z\n );\n i = subdividedPositions.length / 3 - 1;\n edges[edge] = i;\n\n if (hasTexcoords) {\n midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\n }\n }\n\n triangles.push(i2, i, i1);\n triangles.push(i, i0, i1);\n }\n } else {\n subdividedIndices.push(i0);\n subdividedIndices.push(i1);\n subdividedIndices.push(i2);\n }\n }\n\n const geometryOptions = {\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: subdividedPositions,\n }),\n },\n indices: subdividedIndices,\n primitiveType: PrimitiveType.TRIANGLES,\n };\n\n if (hasTexcoords) {\n geometryOptions.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: subdividedTexcoords,\n });\n }\n\n return new Geometry(geometryOptions);\n};\n\n/**\n * Scales each position of a geometry's position attribute to a height, in place.\n *\n * @param {Number[]} positions The array of numbers representing the positions to be scaled\n * @param {Number} [height=0.0] The desired height to add to the positions\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\n * @param {Boolean} [scaleToSurface=true] <code>true</code> if the positions need to be scaled to the surface before the height is added.\n * @returns {Number[]} The input array of positions, scaled to height\n */\nPolygonPipeline.scaleToGeodeticHeight = function (\n positions,\n height,\n ellipsoid,\n scaleToSurface\n) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n let n = scaleToGeodeticHeightN;\n let p = scaleToGeodeticHeightP;\n\n height = defaultValue(height, 0.0);\n scaleToSurface = defaultValue(scaleToSurface, true);\n\n if (defined(positions)) {\n const length = positions.length;\n\n for (let i = 0; i < length; i += 3) {\n Cartesian3.fromArray(positions, i, p);\n\n if (scaleToSurface) {\n p = ellipsoid.scaleToGeodeticSurface(p, p);\n }\n\n if (height !== 0) {\n n = ellipsoid.geodeticSurfaceNormal(p, n);\n\n Cartesian3.multiplyByScalar(n, height, n);\n Cartesian3.add(p, n, p);\n }\n\n positions[i] = p.x;\n positions[i + 1] = p.y;\n positions[i + 2] = p.z;\n }\n }\n\n return positions;\n};\nexport default PolygonPipeline;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Rectangle from \"./Rectangle.js\";\n\nconst cos = Math.cos;\nconst sin = Math.sin;\nconst sqrt = Math.sqrt;\n\n/**\n * @private\n */\nconst RectangleGeometryLibrary = {};\n\n/**\n * @private\n */\nRectangleGeometryLibrary.computePosition = function (\n computedOptions,\n ellipsoid,\n computeST,\n row,\n col,\n position,\n st\n) {\n const radiiSquared = ellipsoid.radiiSquared;\n const nwCorner = computedOptions.nwCorner;\n const rectangle = computedOptions.boundingRectangle;\n\n let stLatitude =\n nwCorner.latitude -\n computedOptions.granYCos * row +\n col * computedOptions.granXSin;\n const cosLatitude = cos(stLatitude);\n const nZ = sin(stLatitude);\n const kZ = radiiSquared.z * nZ;\n\n let stLongitude =\n nwCorner.longitude +\n row * computedOptions.granYSin +\n col * computedOptions.granXCos;\n const nX = cosLatitude * cos(stLongitude);\n const nY = cosLatitude * sin(stLongitude);\n\n const kX = radiiSquared.x * nX;\n const kY = radiiSquared.y * nY;\n\n const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\n\n position.x = kX / gamma;\n position.y = kY / gamma;\n position.z = kZ / gamma;\n\n if (computeST) {\n const stNwCorner = computedOptions.stNwCorner;\n if (defined(stNwCorner)) {\n stLatitude =\n stNwCorner.latitude -\n computedOptions.stGranYCos * row +\n col * computedOptions.stGranXSin;\n stLongitude =\n stNwCorner.longitude +\n row * computedOptions.stGranYSin +\n col * computedOptions.stGranXCos;\n\n st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;\n st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;\n } else {\n st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;\n st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;\n }\n }\n};\n\nconst rotationMatrixScratch = new Matrix2();\nlet nwCartesian = new Cartesian3();\nconst centerScratch = new Cartographic();\nlet centerCartesian = new Cartesian3();\nconst proj = new GeographicProjection();\n\nfunction getRotationOptions(\n nwCorner,\n rotation,\n granularityX,\n granularityY,\n center,\n width,\n height\n) {\n const cosRotation = Math.cos(rotation);\n const granYCos = granularityY * cosRotation;\n const granXCos = granularityX * cosRotation;\n\n const sinRotation = Math.sin(rotation);\n const granYSin = granularityY * sinRotation;\n const granXSin = granularityX * sinRotation;\n\n nwCartesian = proj.project(nwCorner, nwCartesian);\n\n nwCartesian = Cartesian3.subtract(nwCartesian, centerCartesian, nwCartesian);\n const rotationMatrix = Matrix2.fromRotation(rotation, rotationMatrixScratch);\n nwCartesian = Matrix2.multiplyByVector(\n rotationMatrix,\n nwCartesian,\n nwCartesian\n );\n nwCartesian = Cartesian3.add(nwCartesian, centerCartesian, nwCartesian);\n nwCorner = proj.unproject(nwCartesian, nwCorner);\n\n width -= 1;\n height -= 1;\n\n const latitude = nwCorner.latitude;\n const latitude0 = latitude + width * granXSin;\n const latitude1 = latitude - granYCos * height;\n const latitude2 = latitude - granYCos * height + width * granXSin;\n\n const north = Math.max(latitude, latitude0, latitude1, latitude2);\n const south = Math.min(latitude, latitude0, latitude1, latitude2);\n\n const longitude = nwCorner.longitude;\n const longitude0 = longitude + width * granXCos;\n const longitude1 = longitude + height * granYSin;\n const longitude2 = longitude + height * granYSin + width * granXCos;\n\n const east = Math.max(longitude, longitude0, longitude1, longitude2);\n const west = Math.min(longitude, longitude0, longitude1, longitude2);\n\n return {\n north: north,\n south: south,\n east: east,\n west: west,\n granYCos: granYCos,\n granYSin: granYSin,\n granXCos: granXCos,\n granXSin: granXSin,\n nwCorner: nwCorner,\n };\n}\n\n/**\n * @private\n */\nRectangleGeometryLibrary.computeOptions = function (\n rectangle,\n granularity,\n rotation,\n stRotation,\n boundingRectangleScratch,\n nwCornerResult,\n stNwCornerResult\n) {\n let east = rectangle.east;\n let west = rectangle.west;\n let north = rectangle.north;\n let south = rectangle.south;\n\n let northCap = false;\n let southCap = false;\n\n if (north === CesiumMath.PI_OVER_TWO) {\n northCap = true;\n }\n if (south === -CesiumMath.PI_OVER_TWO) {\n southCap = true;\n }\n\n let dx;\n const dy = north - south;\n if (west > east) {\n dx = CesiumMath.TWO_PI - west + east;\n } else {\n dx = east - west;\n }\n\n const width = Math.ceil(dx / granularity) + 1;\n const height = Math.ceil(dy / granularity) + 1;\n const granularityX = dx / (width - 1);\n const granularityY = dy / (height - 1);\n\n const nwCorner = Rectangle.northwest(rectangle, nwCornerResult);\n const center = Rectangle.center(rectangle, centerScratch);\n if (rotation !== 0 || stRotation !== 0) {\n if (center.longitude < nwCorner.longitude) {\n center.longitude += CesiumMath.TWO_PI;\n }\n centerCartesian = proj.project(center, centerCartesian);\n }\n\n const granYCos = granularityY;\n const granXCos = granularityX;\n const granYSin = 0.0;\n const granXSin = 0.0;\n\n const boundingRectangle = Rectangle.clone(\n rectangle,\n boundingRectangleScratch\n );\n\n const computedOptions = {\n granYCos: granYCos,\n granYSin: granYSin,\n granXCos: granXCos,\n granXSin: granXSin,\n nwCorner: nwCorner,\n boundingRectangle: boundingRectangle,\n width: width,\n height: height,\n northCap: northCap,\n southCap: southCap,\n };\n\n if (rotation !== 0) {\n const rotationOptions = getRotationOptions(\n nwCorner,\n rotation,\n granularityX,\n granularityY,\n center,\n width,\n height\n );\n north = rotationOptions.north;\n south = rotationOptions.south;\n east = rotationOptions.east;\n west = rotationOptions.west;\n\ncomputedOptions.granYCos = rotationOptions.granYCos;\n computedOptions.granYSin = rotationOptions.granYSin;\n computedOptions.granXCos = rotationOptions.granXCos;\n computedOptions.granXSin = rotationOptions.granXSin;\n\n boundingRectangle.north = north;\n boundingRectangle.south = south;\n boundingRectangle.east = east;\n boundingRectangle.west = west;\n }\n\n if (stRotation !== 0) {\n rotation = rotation - stRotation;\n const stNwCorner = Rectangle.northwest(boundingRectangle, stNwCornerResult);\n\n const stRotationOptions = getRotationOptions(\n stNwCorner,\n rotation,\n granularityX,\n granularityY,\n center,\n width,\n height\n );\n\n computedOptions.stGranYCos = stRotationOptions.granYCos;\n computedOptions.stGranXCos = stRotationOptions.granXCos;\n computedOptions.stGranYSin = stRotationOptions.granYSin;\n computedOptions.stGranXSin = stRotationOptions.granXSin;\n computedOptions.stNwCorner = stNwCorner;\n computedOptions.stWest = stRotationOptions.west;\n computedOptions.stSouth = stRotationOptions.south;\n }\n\n return computedOptions;\n};\nexport default RectangleGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\n\nconst bottomBoundingSphere = new BoundingSphere();\nconst topBoundingSphere = new BoundingSphere();\nconst positionScratch = new Cartesian3();\nconst rectangleScratch = new Rectangle();\n\nfunction constructRectangle(geometry, computedOptions) {\n const ellipsoid = geometry._ellipsoid;\n const height = computedOptions.height;\n const width = computedOptions.width;\n const northCap = computedOptions.northCap;\n const southCap = computedOptions.southCap;\n\n let rowHeight = height;\n let widthMultiplier = 2;\n let size = 0;\n let corners = 4;\n if (northCap) {\n widthMultiplier -= 1;\n rowHeight -= 1;\n size += 1;\n corners -= 2;\n }\n if (southCap) {\n widthMultiplier -= 1;\n rowHeight -= 1;\n size += 1;\n corners -= 2;\n }\n size += widthMultiplier * width + 2 * rowHeight - corners;\n\n const positions = new Float64Array(size * 3);\n\n let posIndex = 0;\n let row = 0;\n let col;\n const position = positionScratch;\n if (northCap) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n row,\n 0,\n position\n );\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n } else {\n for (col = 0; col < width; col++) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n row,\n col,\n position\n );\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n }\n }\n\n col = width - 1;\n for (row = 1; row < height; row++) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n row,\n col,\n position\n );\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n }\n\n row = height - 1;\n if (!southCap) {\n // if southCap is true, we dont need to add any more points because the south pole point was added by the iteration above\n for (col = width - 2; col >= 0; col--) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n row,\n col,\n position\n );\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n }\n }\n\n col = 0;\n for (row = height - 2; row > 0; row--) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n row,\n col,\n position\n );\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n }\n\n const indicesSize = (positions.length / 3) * 2;\n const indices = IndexDatatype.createTypedArray(\n positions.length / 3,\n indicesSize\n );\n\n let index = 0;\n for (let i = 0; i < positions.length / 3 - 1; i++) {\n indices[index++] = i;\n indices[index++] = i + 1;\n }\n indices[index++] = positions.length / 3 - 1;\n indices[index++] = 0;\n\n const geo = new Geometry({\n attributes: new GeometryAttributes(),\n primitiveType: PrimitiveType.LINES,\n });\n\n geo.attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n geo.indices = indices;\n\n return geo;\n}\n\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\n const surfaceHeight = rectangleGeometry._surfaceHeight;\n const extrudedHeight = rectangleGeometry._extrudedHeight;\n const ellipsoid = rectangleGeometry._ellipsoid;\n const minHeight = extrudedHeight;\n const maxHeight = surfaceHeight;\n const geo = constructRectangle(rectangleGeometry, computedOptions);\n\n const height = computedOptions.height;\n const width = computedOptions.width;\n\n const topPositions = PolygonPipeline.scaleToGeodeticHeight(\n geo.attributes.position.values,\n maxHeight,\n ellipsoid,\n false\n );\n let length = topPositions.length;\n const positions = new Float64Array(length * 2);\n positions.set(topPositions);\n const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\n geo.attributes.position.values,\n minHeight,\n ellipsoid\n );\n positions.set(bottomPositions, length);\n geo.attributes.position.values = positions;\n\n const northCap = computedOptions.northCap;\n const southCap = computedOptions.southCap;\n let corners = 4;\n if (northCap) {\n corners -= 1;\n }\n if (southCap) {\n corners -= 1;\n }\n\n const indicesSize = (positions.length / 3 + corners) * 2;\n const indices = IndexDatatype.createTypedArray(\n positions.length / 3,\n indicesSize\n );\n length = positions.length / 6;\n let index = 0;\n for (let i = 0; i < length - 1; i++) {\n indices[index++] = i;\n indices[index++] = i + 1;\n indices[index++] = i + length;\n indices[index++] = i + length + 1;\n }\n indices[index++] = length - 1;\n indices[index++] = 0;\n indices[index++] = length + length - 1;\n indices[index++] = length;\n\n indices[index++] = 0;\n indices[index++] = length;\n\n let bottomCorner;\n if (northCap) {\n bottomCorner = height - 1;\n } else {\n const topRightCorner = width - 1;\n indices[index++] = topRightCorner;\n indices[index++] = topRightCorner + length;\n bottomCorner = width + height - 2;\n }\n\n indices[index++] = bottomCorner;\n indices[index++] = bottomCorner + length;\n\n if (!southCap) {\n const bottomLeftCorner = width + bottomCorner - 1;\n indices[index++] = bottomLeftCorner;\n indices[index] = bottomLeftCorner + length;\n }\n\n geo.indices = indices;\n\n return geo;\n}\n\n/**\n * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.\n *\n * @alias RectangleOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\n *\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>rectangle.south</code>.\n *\n * @see RectangleOutlineGeometry#createGeometry\n *\n * @example\n * const rectangle = new Cesium.RectangleOutlineGeometry({\n * ellipsoid : Cesium.Ellipsoid.WGS84,\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n * height : 10000.0\n * });\n * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);\n */\nfunction RectangleOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const rectangle = options.rectangle;\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const rotation = defaultValue(options.rotation, 0.0);\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._rectangle = Rectangle.clone(rectangle);\n this._granularity = granularity;\n this._ellipsoid = ellipsoid;\n this._surfaceHeight = Math.max(height, extrudedHeight);\n this._rotation = rotation;\n this._extrudedHeight = Math.min(height, extrudedHeight);\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createRectangleOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nRectangleOutlineGeometry.packedLength =\n Rectangle.packedLength + Ellipsoid.packedLength + 5;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {RectangleOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nRectangleOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Rectangle.pack(value._rectangle, array, startingIndex);\n startingIndex += Rectangle.packedLength;\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._surfaceHeight;\n array[startingIndex++] = value._rotation;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchRectangle = new Rectangle();\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n rectangle: scratchRectangle,\n ellipsoid: scratchEllipsoid,\n granularity: undefined,\n height: undefined,\n rotation: undefined,\n extrudedHeight: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {RectangleOutlineGeometry} [result] The object into which to store the result.\n * @returns {RectangleOutlineGeometry} The modified result parameter or a new Quaternion instance if one was not provided.\n */\nRectangleOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\n startingIndex += Rectangle.packedLength;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const granularity = array[startingIndex++];\n const height = array[startingIndex++];\n const rotation = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.granularity = granularity;\n scratchOptions.height = height;\n scratchOptions.rotation = rotation;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return new RectangleOutlineGeometry(scratchOptions);\n }\n\n result._rectangle = Rectangle.clone(rectangle, result._rectangle);\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._surfaceHeight = height;\n result._rotation = rotation;\n result._extrudedHeight = extrudedHeight;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\nconst nwScratch = new Cartographic();\n/**\n * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.\n *\n * @param {RectangleOutlineGeometry} rectangleGeometry A description of the rectangle outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n *\n * @exception {DeveloperError} Rotated rectangle is invalid.\n */\nRectangleOutlineGeometry.createGeometry = function (rectangleGeometry) {\n const rectangle = rectangleGeometry._rectangle;\n const ellipsoid = rectangleGeometry._ellipsoid;\n const computedOptions = RectangleGeometryLibrary.computeOptions(\n rectangle,\n rectangleGeometry._granularity,\n rectangleGeometry._rotation,\n 0,\n rectangleScratch,\n nwScratch\n );\n\n let geometry;\n let boundingSphere;\n\n if (\n CesiumMath.equalsEpsilon(\n rectangle.north,\n rectangle.south,\n CesiumMath.EPSILON10\n ) ||\n CesiumMath.equalsEpsilon(\n rectangle.east,\n rectangle.west,\n CesiumMath.EPSILON10\n )\n ) {\n return undefined;\n }\n\n const surfaceHeight = rectangleGeometry._surfaceHeight;\n const extrudedHeight = rectangleGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n surfaceHeight,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n let offsetValue;\n if (extrude) {\n geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\n if (defined(rectangleGeometry._offsetAttribute)) {\n const size = geometry.attributes.position.values.length / 3;\n let offsetAttribute = new Uint8Array(size);\n if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else {\n offsetValue =\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n });\n }\n const topBS = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n surfaceHeight,\n topBoundingSphere\n );\n const bottomBS = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n extrudedHeight,\n bottomBoundingSphere\n );\n boundingSphere = BoundingSphere.union(topBS, bottomBS);\n } else {\n geometry = constructRectangle(rectangleGeometry, computedOptions);\n geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n geometry.attributes.position.values,\n surfaceHeight,\n ellipsoid,\n false\n );\n\n if (defined(rectangleGeometry._offsetAttribute)) {\n const length = geometry.attributes.position.values.length;\n offsetValue =\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n boundingSphere = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n surfaceHeight\n );\n }\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: boundingSphere,\n offsetAttribute: rectangleGeometry._offsetAttribute,\n });\n};\nexport default RectangleOutlineGeometry;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Plane from \"../Core/Plane.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RectangleOutlineGeometry from \"../Core/RectangleOutlineGeometry.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * A tile bounding volume specified as a longitude/latitude/height region.\n * @alias TileBoundingRegion\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Rectangle} options.rectangle The rectangle specifying the longitude and latitude range of the region.\n * @param {Number} [options.minimumHeight=0.0] The minimum height of the region.\n * @param {Number} [options.maximumHeight=0.0] The maximum height of the region.\n * @param {Ellipsoid} [options.ellipsoid=Cesium.Ellipsoid.WGS84] The ellipsoid.\n * @param {Boolean} [options.computeBoundingVolumes=true] True to compute the {@link TileBoundingRegion#boundingVolume} and\n * {@link TileBoundingVolume#boundingSphere}. If false, these properties will be undefined.\n *\n * @private\n */\nfunction TileBoundingRegion(options) {\n this.rectangle = Rectangle.clone(options.rectangle);\n this.minimumHeight = defaultValue(options.minimumHeight, 0.0);\n this.maximumHeight = defaultValue(options.maximumHeight, 0.0);\n\n /**\n * The world coordinates of the southwest corner of the tile's rectangle.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.southwestCornerCartesian = new Cartesian3();\n\n /**\n * The world coordinates of the northeast corner of the tile's rectangle.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.northeastCornerCartesian = new Cartesian3();\n\n /**\n * A normal that, along with southwestCornerCartesian, defines a plane at the western edge of\n * the tile. Any position above (in the direction of the normal) this plane is outside the tile.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.westNormal = new Cartesian3();\n\n /**\n * A normal that, along with southwestCornerCartesian, defines a plane at the southern edge of\n * the tile. Any position above (in the direction of the normal) this plane is outside the tile.\n * Because points of constant latitude do not necessary lie in a plane, positions below this\n * plane are not necessarily inside the tile, but they are close.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.southNormal = new Cartesian3();\n\n /**\n * A normal that, along with northeastCornerCartesian, defines a plane at the eastern edge of\n * the tile. Any position above (in the direction of the normal) this plane is outside the tile.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.eastNormal = new Cartesian3();\n\n /**\n * A normal that, along with northeastCornerCartesian, defines a plane at the eastern edge of\n * the tile. Any position above (in the direction of the normal) this plane is outside the tile.\n * Because points of constant latitude do not necessary lie in a plane, positions below this\n * plane are not necessarily inside the tile, but they are close.\n *\n * @type {Cartesian3}\n * @default Cartesian3()\n */\n this.northNormal = new Cartesian3();\n\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n computeBox(this, options.rectangle, ellipsoid);\n\n this._orientedBoundingBox = undefined;\n this._boundingSphere = undefined;\n\n if (defaultValue(options.computeBoundingVolumes, true)) {\n this.computeBoundingVolumes(ellipsoid);\n }\n}\n\nObject.defineProperties(TileBoundingRegion.prototype, {\n /**\n * The underlying bounding volume\n *\n * @memberof TileBoundingRegion.prototype\n *\n * @type {Object}\n * @readonly\n */\n boundingVolume: {\n get: function () {\n return this._orientedBoundingBox;\n },\n },\n /**\n * The underlying bounding sphere\n *\n * @memberof TileBoundingRegion.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n return this._boundingSphere;\n },\n },\n});\n\nTileBoundingRegion.prototype.computeBoundingVolumes = function (ellipsoid) {\n // An oriented bounding box that encloses this tile's region. This is used to calculate tile visibility.\n this._orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n this.rectangle,\n this.minimumHeight,\n this.maximumHeight,\n ellipsoid\n );\n\n this._boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n this._orientedBoundingBox\n );\n};\n\nconst cartesian3Scratch = new Cartesian3();\nconst cartesian3Scratch2 = new Cartesian3();\nconst cartesian3Scratch3 = new Cartesian3();\nconst westNormalScratch = new Cartesian3();\nconst eastWestNormalScratch = new Cartesian3();\nconst westernMidpointScratch = new Cartesian3();\nconst easternMidpointScratch = new Cartesian3();\nconst cartographicScratch = new Cartographic();\nconst planeScratch = new Plane(Cartesian3.UNIT_X, 0.0);\nconst rayScratch = new Ray();\n\nfunction computeBox(tileBB, rectangle, ellipsoid) {\n ellipsoid.cartographicToCartesian(\n Rectangle.southwest(rectangle),\n tileBB.southwestCornerCartesian\n );\n ellipsoid.cartographicToCartesian(\n Rectangle.northeast(rectangle),\n tileBB.northeastCornerCartesian\n );\n\n // The middle latitude on the western edge.\n cartographicScratch.longitude = rectangle.west;\n cartographicScratch.latitude = (rectangle.south + rectangle.north) * 0.5;\n cartographicScratch.height = 0.0;\n const westernMidpointCartesian = ellipsoid.cartographicToCartesian(\n cartographicScratch,\n westernMidpointScratch\n );\n\n // Compute the normal of the plane on the western edge of the tile.\n const westNormal = Cartesian3.cross(\n westernMidpointCartesian,\n Cartesian3.UNIT_Z,\n westNormalScratch\n );\n Cartesian3.normalize(westNormal, tileBB.westNormal);\n\n // The middle latitude on the eastern edge.\n cartographicScratch.longitude = rectangle.east;\n const easternMidpointCartesian = ellipsoid.cartographicToCartesian(\n cartographicScratch,\n easternMidpointScratch\n );\n\n // Compute the normal of the plane on the eastern edge of the tile.\n const eastNormal = Cartesian3.cross(\n Cartesian3.UNIT_Z,\n easternMidpointCartesian,\n cartesian3Scratch\n );\n Cartesian3.normalize(eastNormal, tileBB.eastNormal);\n\n let westVector = Cartesian3.subtract(\n westernMidpointCartesian,\n easternMidpointCartesian,\n cartesian3Scratch\n );\n\n if (Cartesian3.magnitude(westVector) === 0.0) {\n westVector = Cartesian3.clone(westNormal, westVector);\n }\n\n const eastWestNormal = Cartesian3.normalize(\n westVector,\n eastWestNormalScratch\n );\n\n // Compute the normal of the plane bounding the southern edge of the tile.\n const south = rectangle.south;\n let southSurfaceNormal;\n\n if (south > 0.0) {\n // Compute a plane that doesn't cut through the tile.\n cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;\n cartographicScratch.latitude = south;\n const southCenterCartesian = ellipsoid.cartographicToCartesian(\n cartographicScratch,\n rayScratch.origin\n );\n Cartesian3.clone(eastWestNormal, rayScratch.direction);\n const westPlane = Plane.fromPointNormal(\n tileBB.southwestCornerCartesian,\n tileBB.westNormal,\n planeScratch\n );\n // Find a point that is on the west and the south planes\n IntersectionTests.rayPlane(\n rayScratch,\n westPlane,\n tileBB.southwestCornerCartesian\n );\n southSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n southCenterCartesian,\n cartesian3Scratch2\n );\n } else {\n southSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n Rectangle.southeast(rectangle),\n cartesian3Scratch2\n );\n }\n const southNormal = Cartesian3.cross(\n southSurfaceNormal,\n westVector,\n cartesian3Scratch3\n );\n Cartesian3.normalize(southNormal, tileBB.southNormal);\n\n // Compute the normal of the plane bounding the northern edge of the tile.\n const north = rectangle.north;\n let northSurfaceNormal;\n\n if (north < 0.0) {\n // Compute a plane that doesn't cut through the tile.\n cartographicScratch.longitude = (rectangle.west + rectangle.east) * 0.5;\n cartographicScratch.latitude = north;\n const northCenterCartesian = ellipsoid.cartographicToCartesian(\n cartographicScratch,\n rayScratch.origin\n );\n Cartesian3.negate(eastWestNormal, rayScratch.direction);\n const eastPlane = Plane.fromPointNormal(\n tileBB.northeastCornerCartesian,\n tileBB.eastNormal,\n planeScratch\n );\n // Find a point that is on the east and the north planes\n IntersectionTests.rayPlane(\n rayScratch,\n eastPlane,\n tileBB.northeastCornerCartesian\n );\n northSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n northCenterCartesian,\n cartesian3Scratch2\n );\n } else {\n northSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n Rectangle.northwest(rectangle),\n cartesian3Scratch2\n );\n }\n const northNormal = Cartesian3.cross(\n westVector,\n northSurfaceNormal,\n cartesian3Scratch3\n );\n Cartesian3.normalize(northNormal, tileBB.northNormal);\n}\n\nconst southwestCornerScratch = new Cartesian3();\nconst northeastCornerScratch = new Cartesian3();\nconst negativeUnitY = new Cartesian3(0.0, -1.0, 0.0);\nconst negativeUnitZ = new Cartesian3(0.0, 0.0, -1.0);\nconst vectorScratch = new Cartesian3();\n\nfunction distanceToCameraRegion(tileBB, frameState) {\n const camera = frameState.camera;\n const cameraCartesianPosition = camera.positionWC;\n const cameraCartographicPosition = camera.positionCartographic;\n\n let result = 0.0;\n if (!Rectangle.contains(tileBB.rectangle, cameraCartographicPosition)) {\n let southwestCornerCartesian = tileBB.southwestCornerCartesian;\n let northeastCornerCartesian = tileBB.northeastCornerCartesian;\n let westNormal = tileBB.westNormal;\n let southNormal = tileBB.southNormal;\n let eastNormal = tileBB.eastNormal;\n let northNormal = tileBB.northNormal;\n\n if (frameState.mode !== SceneMode.SCENE3D) {\n southwestCornerCartesian = frameState.mapProjection.project(\n Rectangle.southwest(tileBB.rectangle),\n southwestCornerScratch\n );\n southwestCornerCartesian.z = southwestCornerCartesian.y;\n southwestCornerCartesian.y = southwestCornerCartesian.x;\n southwestCornerCartesian.x = 0.0;\n northeastCornerCartesian = frameState.mapProjection.project(\n Rectangle.northeast(tileBB.rectangle),\n northeastCornerScratch\n );\n northeastCornerCartesian.z = northeastCornerCartesian.y;\n northeastCornerCartesian.y = northeastCornerCartesian.x;\n northeastCornerCartesian.x = 0.0;\n westNormal = negativeUnitY;\n eastNormal = Cartesian3.UNIT_Y;\n southNormal = negativeUnitZ;\n northNormal = Cartesian3.UNIT_Z;\n }\n\n const vectorFromSouthwestCorner = Cartesian3.subtract(\n cameraCartesianPosition,\n southwestCornerCartesian,\n vectorScratch\n );\n const distanceToWestPlane = Cartesian3.dot(\n vectorFromSouthwestCorner,\n westNormal\n );\n const distanceToSouthPlane = Cartesian3.dot(\n vectorFromSouthwestCorner,\n southNormal\n );\n\n const vectorFromNortheastCorner = Cartesian3.subtract(\n cameraCartesianPosition,\n northeastCornerCartesian,\n vectorScratch\n );\n const distanceToEastPlane = Cartesian3.dot(\n vectorFromNortheastCorner,\n eastNormal\n );\n const distanceToNorthPlane = Cartesian3.dot(\n vectorFromNortheastCorner,\n northNormal\n );\n\n if (distanceToWestPlane > 0.0) {\n result += distanceToWestPlane * distanceToWestPlane;\n } else if (distanceToEastPlane > 0.0) {\n result += distanceToEastPlane * distanceToEastPlane;\n }\n\n if (distanceToSouthPlane > 0.0) {\n result += distanceToSouthPlane * distanceToSouthPlane;\n } else if (distanceToNorthPlane > 0.0) {\n result += distanceToNorthPlane * distanceToNorthPlane;\n }\n }\n\n let cameraHeight;\n let minimumHeight;\n let maximumHeight;\n if (frameState.mode === SceneMode.SCENE3D) {\n cameraHeight = cameraCartographicPosition.height;\n minimumHeight = tileBB.minimumHeight;\n maximumHeight = tileBB.maximumHeight;\n } else {\n cameraHeight = cameraCartesianPosition.x;\n minimumHeight = 0.0;\n maximumHeight = 0.0;\n }\n\n if (cameraHeight > maximumHeight) {\n const distanceAboveTop = cameraHeight - maximumHeight;\n result += distanceAboveTop * distanceAboveTop;\n } else if (cameraHeight < minimumHeight) {\n const distanceBelowBottom = minimumHeight - cameraHeight;\n result += distanceBelowBottom * distanceBelowBottom;\n }\n\n return Math.sqrt(result);\n}\n\n/**\n * Gets the distance from the camera to the closest point on the tile. This is used for level of detail selection.\n *\n * @param {FrameState} frameState The state information of the current rendering frame.\n * @returns {Number} The distance from the camera to the closest point on the tile, in meters.\n */\nTileBoundingRegion.prototype.distanceToCamera = function (frameState) {\n const regionResult = distanceToCameraRegion(this, frameState);\n if (\n frameState.mode === SceneMode.SCENE3D &&\n defined(this._orientedBoundingBox)\n ) {\n const obbResult = Math.sqrt(\n this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)\n );\n return Math.max(regionResult, obbResult);\n }\n return regionResult;\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nTileBoundingRegion.prototype.intersectPlane = function (plane) {\nreturn this._orientedBoundingBox.intersectPlane(plane);\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding region.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n *\n * @private\n */\nTileBoundingRegion.prototype.createDebugVolume = function (color) {\n const modelMatrix = new Matrix4.clone(Matrix4.IDENTITY);\n const geometry = new RectangleOutlineGeometry({\n rectangle: this.rectangle,\n height: this.minimumHeight,\n extrudedHeight: this.maximumHeight,\n });\n const instance = new GeometryInstance({\n geometry: geometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n return new Primitive({\n geometryInstances: instance,\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n};\nexport default TileBoundingRegion;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\n\n/**\n * @private\n */\nconst CoplanarPolygonGeometryLibrary = {};\n\nconst scratchIntersectionPoint = new Cartesian3();\nconst scratchXAxis = new Cartesian3();\nconst scratchYAxis = new Cartesian3();\nconst scratchZAxis = new Cartesian3();\nconst obbScratch = new OrientedBoundingBox();\n\nCoplanarPolygonGeometryLibrary.validOutline = function (positions) {\n const orientedBoundingBox = OrientedBoundingBox.fromPoints(\n positions,\n obbScratch\n );\n const halfAxes = orientedBoundingBox.halfAxes;\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n const xMag = Cartesian3.magnitude(xAxis);\n const yMag = Cartesian3.magnitude(yAxis);\n const zMag = Cartesian3.magnitude(zAxis);\n\n // If all the points are on a line return undefined because we can't draw a polygon\n return !(\n (xMag === 0 && (yMag === 0 || zMag === 0)) ||\n (yMag === 0 && zMag === 0)\n );\n};\n\n// call after removeDuplicates\nCoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function (\n positions,\n centerResult,\n planeAxis1Result,\n planeAxis2Result\n) {\n const orientedBoundingBox = OrientedBoundingBox.fromPoints(\n positions,\n obbScratch\n );\n const halfAxes = orientedBoundingBox.halfAxes;\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\n\n const xMag = Cartesian3.magnitude(xAxis);\n const yMag = Cartesian3.magnitude(yAxis);\n const zMag = Cartesian3.magnitude(zAxis);\n const min = Math.min(xMag, yMag, zMag);\n\n // If all the points are on a line return undefined because we can't draw a polygon\n if (\n (xMag === 0 && (yMag === 0 || zMag === 0)) ||\n (yMag === 0 && zMag === 0)\n ) {\n return false;\n }\n\n let planeAxis1;\n let planeAxis2;\n\n if (min === yMag || min === zMag) {\n planeAxis1 = xAxis;\n }\n if (min === xMag) {\n planeAxis1 = yAxis;\n } else if (min === zMag) {\n planeAxis2 = yAxis;\n }\n if (min === xMag || min === yMag) {\n planeAxis2 = zAxis;\n }\n\n Cartesian3.normalize(planeAxis1, planeAxis1Result);\n Cartesian3.normalize(planeAxis2, planeAxis2Result);\n Cartesian3.clone(orientedBoundingBox.center, centerResult);\n return true;\n};\n\nfunction projectTo2D(position, center, axis1, axis2, result) {\n const v = Cartesian3.subtract(position, center, scratchIntersectionPoint);\n const x = Cartesian3.dot(axis1, v);\n const y = Cartesian3.dot(axis2, v);\n\n return Cartesian2.fromElements(x, y, result);\n}\n\nCoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function (\n center,\n axis1,\n axis2\n) {\n return function (positions) {\n const positionResults = new Array(positions.length);\n for (let i = 0; i < positions.length; i++) {\n positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);\n }\n\n return positionResults;\n };\n};\n\nCoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function (\n center,\n axis1,\n axis2\n) {\n return function (position, result) {\n return projectTo2D(position, center, axis1, axis2, result);\n };\n};\nexport default CoplanarPolygonGeometryLibrary;\n", "/**\n * A queue that can enqueue items at the end, and dequeue items from the front.\n *\n * @alias Queue\n * @constructor\n */\nfunction Queue() {\n this._array = [];\n this._offset = 0;\n this._length = 0;\n}\n\nObject.defineProperties(Queue.prototype, {\n /**\n * The length of the queue.\n *\n * @memberof Queue.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._length;\n },\n },\n});\n\n/**\n * Enqueues the specified item.\n *\n * @param {*} item The item to enqueue.\n */\nQueue.prototype.enqueue = function (item) {\n this._array.push(item);\n this._length++;\n};\n\n/**\n * Dequeues an item. Returns undefined if the queue is empty.\n *\n * @returns {*} The the dequeued item.\n */\nQueue.prototype.dequeue = function () {\n if (this._length === 0) {\n return undefined;\n }\n\n const array = this._array;\n let offset = this._offset;\n const item = array[offset];\n array[offset] = undefined;\n\n offset++;\n if (offset > 10 && offset * 2 > array.length) {\n //compact array\n this._array = array.slice(offset);\n offset = 0;\n }\n\n this._offset = offset;\n this._length--;\n\n return item;\n};\n\n/**\n * Returns the item at the front of the queue. Returns undefined if the queue is empty.\n *\n * @returns {*} The item at the front of the queue.\n */\nQueue.prototype.peek = function () {\n if (this._length === 0) {\n return undefined;\n }\n\n return this._array[this._offset];\n};\n\n/**\n * Check whether this queue contains the specified item.\n *\n * @param {*} item The item to search for.\n */\nQueue.prototype.contains = function (item) {\n return this._array.indexOf(item) !== -1;\n};\n\n/**\n * Remove all items from the queue.\n */\nQueue.prototype.clear = function () {\n this._array.length = this._offset = this._length = 0;\n};\n\n/**\n * Sort the items in the queue in-place.\n *\n * @param {Queue.Comparator} compareFunction A function that defines the sort order.\n */\nQueue.prototype.sort = function (compareFunction) {\n if (this._offset > 0) {\n //compact array\n this._array = this._array.slice(this._offset);\n this._offset = 0;\n }\n\n this._array.sort(compareFunction);\n};\n\n/**\n * A function used to compare two items while sorting a queue.\n * @callback Queue.Comparator\n *\n * @param {*} a An item in the array.\n * @param {*} b An item in the array.\n * @returns {Number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n * a positive value if <code>a</code> is greater than <code>b</code>, or\n * 0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b) {\n * return a - b;\n * }\n */\nexport default Queue;\n", "import ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Queue from \"./Queue.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\n/**\n * @private\n */\nconst PolygonGeometryLibrary = {};\n\nPolygonGeometryLibrary.computeHierarchyPackedLength = function (\n polygonHierarchy,\n CartesianX\n) {\n let numComponents = 0;\n const stack = [polygonHierarchy];\n while (stack.length > 0) {\n const hierarchy = stack.pop();\n if (!defined(hierarchy)) {\n continue;\n }\n\n numComponents += 2;\n\n const positions = hierarchy.positions;\n const holes = hierarchy.holes;\n\n if (defined(positions) && positions.length > 0) {\n numComponents += positions.length * CartesianX.packedLength;\n }\n\n if (defined(holes)) {\n const length = holes.length;\n for (let i = 0; i < length; ++i) {\n stack.push(holes[i]);\n }\n }\n }\n\n return numComponents;\n};\n\nPolygonGeometryLibrary.packPolygonHierarchy = function (\n polygonHierarchy,\n array,\n startingIndex,\n CartesianX\n) {\n const stack = [polygonHierarchy];\n while (stack.length > 0) {\n const hierarchy = stack.pop();\n if (!defined(hierarchy)) {\n continue;\n }\n\n const positions = hierarchy.positions;\n const holes = hierarchy.holes;\n\n array[startingIndex++] = defined(positions) ? positions.length : 0;\n array[startingIndex++] = defined(holes) ? holes.length : 0;\n\n if (defined(positions)) {\n const positionsLength = positions.length;\n for (\n let i = 0;\n i < positionsLength;\n ++i, startingIndex += CartesianX.packedLength\n ) {\n CartesianX.pack(positions[i], array, startingIndex);\n }\n }\n\n if (defined(holes)) {\n const holesLength = holes.length;\n for (let j = 0; j < holesLength; ++j) {\n stack.push(holes[j]);\n }\n }\n }\n\n return startingIndex;\n};\n\nPolygonGeometryLibrary.unpackPolygonHierarchy = function (\n array,\n startingIndex,\n CartesianX\n) {\n const positionsLength = array[startingIndex++];\n const holesLength = array[startingIndex++];\n\n const positions = new Array(positionsLength);\n const holes = holesLength > 0 ? new Array(holesLength) : undefined;\n\n for (\n let i = 0;\n i < positionsLength;\n ++i, startingIndex += CartesianX.packedLength\n ) {\n positions[i] = CartesianX.unpack(array, startingIndex);\n }\n\n for (let j = 0; j < holesLength; ++j) {\n holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n CartesianX\n );\n startingIndex = holes[j].startingIndex;\n delete holes[j].startingIndex;\n }\n\n return {\n positions: positions,\n holes: holes,\n startingIndex: startingIndex,\n };\n};\n\nconst distance2DScratch = new Cartesian2();\nfunction getPointAtDistance2D(p0, p1, distance, length) {\n Cartesian2.subtract(p1, p0, distance2DScratch);\n Cartesian2.multiplyByScalar(\n distance2DScratch,\n distance / length,\n distance2DScratch\n );\n Cartesian2.add(p0, distance2DScratch, distance2DScratch);\n return [distance2DScratch.x, distance2DScratch.y];\n}\n\nconst distanceScratch = new Cartesian3();\nfunction getPointAtDistance(p0, p1, distance, length) {\n Cartesian3.subtract(p1, p0, distanceScratch);\n Cartesian3.multiplyByScalar(\n distanceScratch,\n distance / length,\n distanceScratch\n );\n Cartesian3.add(p0, distanceScratch, distanceScratch);\n return [distanceScratch.x, distanceScratch.y, distanceScratch.z];\n}\n\nPolygonGeometryLibrary.subdivideLineCount = function (p0, p1, minDistance) {\n const distance = Cartesian3.distance(p0, p1);\n const n = distance / minDistance;\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n return Math.pow(2, countDivide);\n};\n\nconst scratchCartographic0 = new Cartographic();\nconst scratchCartographic1 = new Cartographic();\nconst scratchCartographic2 = new Cartographic();\nconst scratchCartesian0 = new Cartesian3();\nconst scratchRhumbLine = new EllipsoidRhumbLine();\nPolygonGeometryLibrary.subdivideRhumbLineCount = function (\n ellipsoid,\n p0,\n p1,\n minDistance\n) {\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\n const n = rhumb.surfaceDistance / minDistance;\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n return Math.pow(2, countDivide);\n};\n\n/**\n * Subdivides texture coordinates based on the subdivision of the associated world positions.\n *\n * @param {Cartesian2} t0 First texture coordinate.\n * @param {Cartesian2} t1 Second texture coordinate.\n * @param {Cartesian3} p0 First world position.\n * @param {Cartesian3} p1 Second world position.\n * @param {Number} minDistance Minimum distance for a segment.\n * @param {Array<Cartesian2>} result The subdivided texture coordinates.\n *\n * @private\n */\nPolygonGeometryLibrary.subdivideTexcoordLine = function (\n t0,\n t1,\n p0,\n p1,\n minDistance,\n result\n) {\n // Compute the number of subdivisions.\n const subdivisions = PolygonGeometryLibrary.subdivideLineCount(\n p0,\n p1,\n minDistance\n );\n\n // Compute the distance between each subdivided point.\n const length2D = Cartesian2.distance(t0, t1);\n const distanceBetweenCoords = length2D / subdivisions;\n\n // Resize the result array.\n const texcoords = result;\n texcoords.length = subdivisions * 2;\n\n // Compute texture coordinates using linear interpolation.\n let index = 0;\n for (let i = 0; i < subdivisions; i++) {\n const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\n texcoords[index++] = t[0];\n texcoords[index++] = t[1];\n }\n\n return texcoords;\n};\n\nPolygonGeometryLibrary.subdivideLine = function (p0, p1, minDistance, result) {\n const numVertices = PolygonGeometryLibrary.subdivideLineCount(\n p0,\n p1,\n minDistance\n );\n const length = Cartesian3.distance(p0, p1);\n const distanceBetweenVertices = length / numVertices;\n\n if (!defined(result)) {\n result = [];\n }\n\n const positions = result;\n positions.length = numVertices * 3;\n\n let index = 0;\n for (let i = 0; i < numVertices; i++) {\n const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);\n positions[index++] = p[0];\n positions[index++] = p[1];\n positions[index++] = p[2];\n }\n\n return positions;\n};\n\n/**\n * Subdivides texture coordinates based on the subdivision of the associated world positions using a rhumb line.\n *\n * @param {Cartesian2} t0 First texture coordinate.\n * @param {Cartesian2} t1 Second texture coordinate.\n * @param {Ellipsoid} ellipsoid The ellipsoid.\n * @param {Cartesian3} p0 First world position.\n * @param {Cartesian3} p1 Second world position.\n * @param {Number} minDistance Minimum distance for a segment.\n * @param {Array<Cartesian2>} result The subdivided texture coordinates.\n *\n * @private\n */\nPolygonGeometryLibrary.subdivideTexcoordRhumbLine = function (\n t0,\n t1,\n ellipsoid,\n p0,\n p1,\n minDistance,\n result\n) {\n // Compute the surface distance.\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n scratchRhumbLine.setEndPoints(c0, c1);\n const n = scratchRhumbLine.surfaceDistance / minDistance;\n\n // Compute the number of subdivisions.\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n const subdivisions = Math.pow(2, countDivide);\n\n // Compute the distance between each subdivided point.\n const length2D = Cartesian2.distance(t0, t1);\n const distanceBetweenCoords = length2D / subdivisions;\n\n // Resize the result array.\n const texcoords = result;\n texcoords.length = subdivisions * 2;\n\n // Compute texture coordinates using linear interpolation.\n let index = 0;\n for (let i = 0; i < subdivisions; i++) {\n const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\n texcoords[index++] = t[0];\n texcoords[index++] = t[1];\n }\n\n return texcoords;\n};\n\nPolygonGeometryLibrary.subdivideRhumbLine = function (\n ellipsoid,\n p0,\n p1,\n minDistance,\n result\n) {\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\n const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\n\n const n = rhumb.surfaceDistance / minDistance;\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\n const numVertices = Math.pow(2, countDivide);\n const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;\n\n if (!defined(result)) {\n result = [];\n }\n\n const positions = result;\n positions.length = numVertices * 3;\n\n let index = 0;\n for (let i = 0; i < numVertices; i++) {\n const c = rhumb.interpolateUsingSurfaceDistance(\n i * distanceBetweenVertices,\n scratchCartographic2\n );\n const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);\n positions[index++] = p.x;\n positions[index++] = p.y;\n positions[index++] = p.z;\n }\n\n return positions;\n};\n\nconst scaleToGeodeticHeightN1 = new Cartesian3();\nconst scaleToGeodeticHeightN2 = new Cartesian3();\nconst scaleToGeodeticHeightP1 = new Cartesian3();\nconst scaleToGeodeticHeightP2 = new Cartesian3();\n\nPolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function (\n geometry,\n maxHeight,\n minHeight,\n ellipsoid,\n perPositionHeight\n) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n const n1 = scaleToGeodeticHeightN1;\n let n2 = scaleToGeodeticHeightN2;\n const p = scaleToGeodeticHeightP1;\n let p2 = scaleToGeodeticHeightP2;\n\n if (\n defined(geometry) &&\n defined(geometry.attributes) &&\n defined(geometry.attributes.position)\n ) {\n const positions = geometry.attributes.position.values;\n const length = positions.length / 2;\n\n for (let i = 0; i < length; i += 3) {\n Cartesian3.fromArray(positions, i, p);\n\n ellipsoid.geodeticSurfaceNormal(p, n1);\n p2 = ellipsoid.scaleToGeodeticSurface(p, p2);\n n2 = Cartesian3.multiplyByScalar(n1, minHeight, n2);\n n2 = Cartesian3.add(p2, n2, n2);\n positions[i + length] = n2.x;\n positions[i + 1 + length] = n2.y;\n positions[i + 2 + length] = n2.z;\n\n if (perPositionHeight) {\n p2 = Cartesian3.clone(p, p2);\n }\n n2 = Cartesian3.multiplyByScalar(n1, maxHeight, n2);\n n2 = Cartesian3.add(p2, n2, n2);\n positions[i] = n2.x;\n positions[i + 1] = n2.y;\n positions[i + 2] = n2.z;\n }\n }\n return geometry;\n};\n\nPolygonGeometryLibrary.polygonOutlinesFromHierarchy = function (\n polygonHierarchy,\n scaleToEllipsoidSurface,\n ellipsoid\n) {\n // create from a polygon hierarchy\n // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\n const polygons = [];\n const queue = new Queue();\n queue.enqueue(polygonHierarchy);\n let i;\n let j;\n let length;\n while (queue.length !== 0) {\n const outerNode = queue.dequeue();\n let outerRing = outerNode.positions;\n if (scaleToEllipsoidSurface) {\n length = outerRing.length;\n for (i = 0; i < length; i++) {\n ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\n }\n }\n outerRing = arrayRemoveDuplicates(\n outerRing,\n Cartesian3.equalsEpsilon,\n true\n );\n if (outerRing.length < 3) {\n continue;\n }\n\n const numChildren = outerNode.holes ? outerNode.holes.length : 0;\n // The outer polygon contains inner polygons\n for (i = 0; i < numChildren; i++) {\n const hole = outerNode.holes[i];\n let holePositions = hole.positions;\n if (scaleToEllipsoidSurface) {\n length = holePositions.length;\n for (j = 0; j < length; ++j) {\n ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\n }\n }\n holePositions = arrayRemoveDuplicates(\n holePositions,\n Cartesian3.equalsEpsilon,\n true\n );\n if (holePositions.length < 3) {\n continue;\n }\n polygons.push(holePositions);\n\n let numGrandchildren = 0;\n if (defined(hole.holes)) {\n numGrandchildren = hole.holes.length;\n }\n\n for (j = 0; j < numGrandchildren; j++) {\n queue.enqueue(hole.holes[j]);\n }\n }\n\n polygons.push(outerRing);\n }\n\n return polygons;\n};\n\nPolygonGeometryLibrary.polygonsFromHierarchy = function (\n polygonHierarchy,\n keepDuplicates,\n projectPointsTo2D,\n scaleToEllipsoidSurface,\n ellipsoid\n) {\n // create from a polygon hierarchy\n // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\n const hierarchy = [];\n const polygons = [];\n\n const queue = new Queue();\n queue.enqueue(polygonHierarchy);\n\n while (queue.length !== 0) {\n const outerNode = queue.dequeue();\n let outerRing = outerNode.positions;\n const holes = outerNode.holes;\n\n let i;\n let length;\n if (scaleToEllipsoidSurface) {\n length = outerRing.length;\n for (i = 0; i < length; i++) {\n ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\n }\n }\n\n if (!keepDuplicates) {\n outerRing = arrayRemoveDuplicates(\n outerRing,\n Cartesian3.equalsEpsilon,\n true\n );\n }\n if (outerRing.length < 3) {\n continue;\n }\n\n let positions2D = projectPointsTo2D(outerRing);\n if (!defined(positions2D)) {\n continue;\n }\n const holeIndices = [];\n\n let originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n positions2D\n );\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n positions2D.reverse();\n outerRing = outerRing.slice().reverse();\n }\n\n let positions = outerRing.slice();\n const numChildren = defined(holes) ? holes.length : 0;\n const polygonHoles = [];\n let j;\n\n for (i = 0; i < numChildren; i++) {\n const hole = holes[i];\n let holePositions = hole.positions;\n if (scaleToEllipsoidSurface) {\n length = holePositions.length;\n for (j = 0; j < length; ++j) {\n ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\n }\n }\n\n if (!keepDuplicates) {\n holePositions = arrayRemoveDuplicates(\n holePositions,\n Cartesian3.equalsEpsilon,\n true\n );\n }\n if (holePositions.length < 3) {\n continue;\n }\n\n const holePositions2D = projectPointsTo2D(holePositions);\n if (!defined(holePositions2D)) {\n continue;\n }\n\n originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n holePositions2D\n );\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n holePositions2D.reverse();\n holePositions = holePositions.slice().reverse();\n }\n\n polygonHoles.push(holePositions);\n holeIndices.push(positions.length);\n positions = positions.concat(holePositions);\n positions2D = positions2D.concat(holePositions2D);\n\n let numGrandchildren = 0;\n if (defined(hole.holes)) {\n numGrandchildren = hole.holes.length;\n }\n\n for (j = 0; j < numGrandchildren; j++) {\n queue.enqueue(hole.holes[j]);\n }\n }\n\n hierarchy.push({\n outerRing: outerRing,\n holes: polygonHoles,\n });\n polygons.push({\n positions: positions,\n positions2D: positions2D,\n holes: holeIndices,\n });\n }\n\n return {\n hierarchy: hierarchy,\n polygons: polygons,\n };\n};\n\nconst computeBoundingRectangleCartesian2 = new Cartesian2();\nconst computeBoundingRectangleCartesian3 = new Cartesian3();\nconst computeBoundingRectangleQuaternion = new Quaternion();\nconst computeBoundingRectangleMatrix3 = new Matrix3();\nPolygonGeometryLibrary.computeBoundingRectangle = function (\n planeNormal,\n projectPointTo2D,\n positions,\n angle,\n result\n) {\n const rotation = Quaternion.fromAxisAngle(\n planeNormal,\n angle,\n computeBoundingRectangleQuaternion\n );\n const textureMatrix = Matrix3.fromQuaternion(\n rotation,\n computeBoundingRectangleMatrix3\n );\n\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n const length = positions.length;\n for (let i = 0; i < length; ++i) {\n const p = Cartesian3.clone(\n positions[i],\n computeBoundingRectangleCartesian3\n );\n Matrix3.multiplyByVector(textureMatrix, p, p);\n const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);\n\n if (defined(st)) {\n minX = Math.min(minX, st.x);\n maxX = Math.max(maxX, st.x);\n\n minY = Math.min(minY, st.y);\n maxY = Math.max(maxY, st.y);\n }\n }\n\n result.x = minX;\n result.y = minY;\n result.width = maxX - minX;\n result.height = maxY - minY;\n return result;\n};\n\nPolygonGeometryLibrary.createGeometryFromPositions = function (\n ellipsoid,\n polygon,\n textureCoordinates,\n granularity,\n perPositionHeight,\n vertexFormat,\n arcType\n) {\n let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\n\n /* If polygon is completely unrenderable, just use the first three vertices */\n if (indices.length < 3) {\n indices = [0, 1, 2];\n }\n\n const positions = polygon.positions;\n\n const hasTexcoords = defined(textureCoordinates);\n const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\n\n if (perPositionHeight) {\n const length = positions.length;\n const flattenedPositions = new Array(length * 3);\n let index = 0;\n for (let i = 0; i < length; i++) {\n const p = positions[i];\n flattenedPositions[index++] = p.x;\n flattenedPositions[index++] = p.y;\n flattenedPositions[index++] = p.z;\n }\n\n const geometryOptions = {\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: flattenedPositions,\n }),\n },\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n };\n\n if (hasTexcoords) {\n geometryOptions.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: Cartesian2.packArray(texcoords),\n });\n }\n\n const geometry = new Geometry(geometryOptions);\n\n if (vertexFormat.normal) {\n return GeometryPipeline.computeNormal(geometry);\n }\n\n return geometry;\n }\n\n if (arcType === ArcType.GEODESIC) {\n return PolygonPipeline.computeSubdivision(\n ellipsoid,\n positions,\n indices,\n texcoords,\n granularity\n );\n } else if (arcType === ArcType.RHUMB) {\n return PolygonPipeline.computeRhumbLineSubdivision(\n ellipsoid,\n positions,\n indices,\n texcoords,\n granularity\n );\n }\n};\n\nconst computeWallTexcoordsSubdivided = [];\nconst computeWallIndicesSubdivided = [];\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\n\nPolygonGeometryLibrary.computeWallGeometry = function (\n positions,\n textureCoordinates,\n ellipsoid,\n granularity,\n perPositionHeight,\n arcType\n) {\n let edgePositions;\n let topEdgeLength;\n let i;\n let p1;\n let p2;\n let t1;\n let t2;\n let edgeTexcoords;\n let topEdgeTexcoordLength;\n\n let length = positions.length;\n let index = 0;\n let textureIndex = 0;\n\n const hasTexcoords = defined(textureCoordinates);\n const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\n\n if (!perPositionHeight) {\n const minDistance = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n\n let numVertices = 0;\n if (arcType === ArcType.GEODESIC) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n } else if (arcType === ArcType.RHUMB) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n ellipsoid,\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n }\n\n topEdgeLength = (numVertices + length) * 3;\n edgePositions = new Array(topEdgeLength * 2);\n\n if (hasTexcoords) {\n topEdgeTexcoordLength = (numVertices + length) * 2;\n edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\n }\n\n for (i = 0; i < length; i++) {\n p1 = positions[i];\n p2 = positions[(i + 1) % length];\n\n let tempPositions;\n let tempTexcoords;\n\n if (hasTexcoords) {\n t1 = texcoords[i];\n t2 = texcoords[(i + 1) % length];\n }\n\n if (arcType === ArcType.GEODESIC) {\n tempPositions = PolygonGeometryLibrary.subdivideLine(\n p1,\n p2,\n minDistance,\n computeWallIndicesSubdivided\n );\n if (hasTexcoords) {\n tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(\n t1,\n t2,\n p1,\n p2,\n minDistance,\n computeWallTexcoordsSubdivided\n );\n }\n } else if (arcType === ArcType.RHUMB) {\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n ellipsoid,\n p1,\n p2,\n minDistance,\n computeWallIndicesSubdivided\n );\n if (hasTexcoords) {\n tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(\n t1,\n t2,\n ellipsoid,\n p1,\n p2,\n minDistance,\n computeWallTexcoordsSubdivided\n );\n }\n }\n const tempPositionsLength = tempPositions.length;\n for (let j = 0; j < tempPositionsLength; ++j, ++index) {\n edgePositions[index] = tempPositions[j];\n edgePositions[index + topEdgeLength] = tempPositions[j];\n }\n\n edgePositions[index] = p2.x;\n edgePositions[index + topEdgeLength] = p2.x;\n ++index;\n\n edgePositions[index] = p2.y;\n edgePositions[index + topEdgeLength] = p2.y;\n ++index;\n\n edgePositions[index] = p2.z;\n edgePositions[index + topEdgeLength] = p2.z;\n ++index;\n\n if (hasTexcoords) {\n const tempTexcoordsLength = tempTexcoords.length;\n for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {\n edgeTexcoords[textureIndex] = tempTexcoords[k];\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] =\n tempTexcoords[k];\n }\n\n edgeTexcoords[textureIndex] = t2.x;\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;\n ++textureIndex;\n\n edgeTexcoords[textureIndex] = t2.y;\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;\n ++textureIndex;\n }\n }\n } else {\n topEdgeLength = length * 3 * 2;\n edgePositions = new Array(topEdgeLength * 2);\n\n if (hasTexcoords) {\n topEdgeTexcoordLength = length * 2 * 2;\n edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\n }\n\n for (i = 0; i < length; i++) {\n p1 = positions[i];\n p2 = positions[(i + 1) % length];\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;\n ++index;\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;\n ++index;\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;\n ++index;\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;\n ++index;\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;\n ++index;\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;\n ++index;\n\n if (hasTexcoords) {\n t1 = texcoords[i];\n t2 = texcoords[(i + 1) % length];\n edgeTexcoords[textureIndex] = edgeTexcoords[\n textureIndex + topEdgeTexcoordLength\n ] = t1.x;\n ++textureIndex;\n edgeTexcoords[textureIndex] = edgeTexcoords[\n textureIndex + topEdgeTexcoordLength\n ] = t1.y;\n ++textureIndex;\n edgeTexcoords[textureIndex] = edgeTexcoords[\n textureIndex + topEdgeTexcoordLength\n ] = t2.x;\n ++textureIndex;\n edgeTexcoords[textureIndex] = edgeTexcoords[\n textureIndex + topEdgeTexcoordLength\n ] = t2.y;\n ++textureIndex;\n }\n }\n }\n\n length = edgePositions.length;\n const indices = IndexDatatype.createTypedArray(\n length / 3,\n length - positions.length * 6\n );\n let edgeIndex = 0;\n length /= 6;\n\n for (i = 0; i < length; i++) {\n const UL = i;\n const UR = UL + 1;\n const LL = UL + length;\n const LR = LL + 1;\n\n p1 = Cartesian3.fromArray(edgePositions, UL * 3, p1Scratch);\n p2 = Cartesian3.fromArray(edgePositions, UR * 3, p2Scratch);\n if (\n Cartesian3.equalsEpsilon(\n p1,\n p2,\n CesiumMath.EPSILON10,\n CesiumMath.EPSILON10\n )\n ) {\n //skip corner\n continue;\n }\n\n indices[edgeIndex++] = UL;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = UR;\n indices[edgeIndex++] = UR;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = LR;\n }\n\n const geometryOptions = {\n attributes: new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: edgePositions,\n }),\n }),\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n };\n\n if (hasTexcoords) {\n geometryOptions.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: edgeTexcoords,\n });\n }\n\n const geometry = new Geometry(geometryOptions);\n\n return geometry;\n};\nexport default PolygonGeometryLibrary;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nfunction createGeometryFromPositions(positions) {\n const length = positions.length;\n const flatPositions = new Float64Array(length * 3);\n const indices = IndexDatatype.createTypedArray(length, length * 2);\n\n let positionIndex = 0;\n let index = 0;\n\n for (let i = 0; i < length; i++) {\n const position = positions[i];\n flatPositions[positionIndex++] = position.x;\n flatPositions[positionIndex++] = position.y;\n flatPositions[positionIndex++] = position.z;\n\n indices[index++] = i;\n indices[index++] = (i + 1) % length;\n }\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: flatPositions,\n }),\n });\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n });\n}\n\n/**\n * A description of the outline of a polygon composed of arbitrary coplanar positions.\n *\n * @alias CoplanarPolygonOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n *\n * @see CoplanarPolygonOutlineGeometry.createGeometry\n *\n * @example\n * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n * -90.0, 30.0, 0.0,\n * -90.0, 30.0, 1000.0,\n * -80.0, 30.0, 1000.0,\n * -80.0, 30.0, 0.0\n * ])\n * });\n * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);\n */\nfunction CoplanarPolygonOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const polygonHierarchy = options.polygonHierarchy;\n this._polygonHierarchy = polygonHierarchy;\n this._workerName = \"createCoplanarPolygonOutlineGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n PolygonGeometryLibrary.computeHierarchyPackedLength(\n polygonHierarchy,\n Cartesian3\n ) + 1;\n}\n\n/**\n * A description of a coplanar polygon outline from an array of positions.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @returns {CoplanarPolygonOutlineGeometry}\n */\nCoplanarPolygonOutlineGeometry.fromPositions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const newOptions = {\n polygonHierarchy: {\n positions: options.positions,\n },\n };\n return new CoplanarPolygonOutlineGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CoplanarPolygonOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCoplanarPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._polygonHierarchy,\n array,\n startingIndex,\n Cartesian3\n );\n\n array[startingIndex] = value.packedLength;\n\n return array;\n};\n\nconst scratchOptions = {\n polygonHierarchy: {},\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CoplanarPolygonOutlineGeometry} [result] The object into which to store the result.\n * @returns {CoplanarPolygonOutlineGeometry} The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.\n */\nCoplanarPolygonOutlineGeometry.unpack = function (\n array,\n startingIndex,\n result\n) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian3\n );\n startingIndex = polygonHierarchy.startingIndex;\n delete polygonHierarchy.startingIndex;\n const packedLength = array[startingIndex];\n\n if (!defined(result)) {\n result = new CoplanarPolygonOutlineGeometry(scratchOptions);\n }\n\n result._polygonHierarchy = polygonHierarchy;\n result.packedLength = packedLength;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {CoplanarPolygonOutlineGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\n\n let outerPositions = polygonHierarchy.positions;\n outerPositions = arrayRemoveDuplicates(\n outerPositions,\n Cartesian3.equalsEpsilon,\n true\n );\n if (outerPositions.length < 3) {\n return;\n }\n const isValid = CoplanarPolygonGeometryLibrary.validOutline(outerPositions);\n if (!isValid) {\n return undefined;\n }\n\n const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\n polygonHierarchy,\n false\n );\n\n if (polygons.length === 0) {\n return undefined;\n }\n\n const geometries = [];\n\n for (let i = 0; i < polygons.length; i++) {\n const geometryInstance = new GeometryInstance({\n geometry: createGeometryFromPositions(polygons[i]),\n });\n geometries.push(geometryInstance);\n }\n\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\n const boundingSphere = BoundingSphere.fromPoints(polygonHierarchy.positions);\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: boundingSphere,\n });\n};\nexport default CoplanarPolygonOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Plane from \"../Core/Plane.js\";\nimport CoplanarPolygonOutlineGeometry from \"../Core/CoplanarPolygonOutlineGeometry.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport S2Cell from \"../Core/S2Cell.js\";\nlet centerCartographicScratch = new Cartographic();\n/**\n * A tile bounding volume specified as an S2 cell token with minimum and maximum heights.\n * The bounding volume is a k DOP. A k-DOP is the Boolean intersection of extents along k directions.\n *\n * @alias TileBoundingS2Cell\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.token The token of the S2 cell.\n * @param {Number} [options.minimumHeight=0.0] The minimum height of the bounding volume.\n * @param {Number} [options.maximumHeight=0.0] The maximum height of the bounding volume.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid.\n * @param {Boolean} [options.computeBoundingVolumes=true] True to compute the {@link TileBoundingS2Cell#boundingVolume} and\n * {@link TileBoundingS2Cell#boundingSphere}. If false, these properties will be undefined.\n *\n * @private\n */\nfunction TileBoundingS2Cell(options) {\n const s2Cell = S2Cell.fromToken(options.token);\n const minimumHeight = defaultValue(options.minimumHeight, 0.0);\n const maximumHeight = defaultValue(options.maximumHeight, 0.0);\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n this.s2Cell = s2Cell;\n this.minimumHeight = minimumHeight;\n this.maximumHeight = maximumHeight;\n this.ellipsoid = ellipsoid;\n\n const boundingPlanes = computeBoundingPlanes(\n s2Cell,\n minimumHeight,\n maximumHeight,\n ellipsoid\n );\n this._boundingPlanes = boundingPlanes;\n\n // Pre-compute vertices to speed up the plane intersection test.\n const vertices = computeVertices(boundingPlanes);\n this._vertices = vertices;\n\n // Pre-compute edge normals to speed up the point-polygon distance check in distanceToCamera.\n this._edgeNormals = new Array(6);\n\n this._edgeNormals[0] = computeEdgeNormals(\n boundingPlanes[0],\n vertices.slice(0, 4)\n );\n let i;\n // Based on the way the edge normals are computed, the edge normals all point away from the \"face\"\n // of the polyhedron they surround, except the plane for the top plane. Therefore, we negate the normals\n // for the top plane.\n for (i = 0; i < 4; i++) {\n this._edgeNormals[0][i] = Cartesian3.negate(\n this._edgeNormals[0][i],\n this._edgeNormals[0][i]\n );\n }\n\n this._edgeNormals[1] = computeEdgeNormals(\n boundingPlanes[1],\n vertices.slice(4, 8)\n );\n for (i = 0; i < 4; i++) {\n // For each plane, iterate through the vertices in CCW order.\n this._edgeNormals[2 + i] = computeEdgeNormals(boundingPlanes[2 + i], [\n vertices[i % 4],\n vertices[(i + 1) % 4],\n vertices[4 + ((i + 1) % 4)],\n vertices[4 + i],\n ]);\n }\n\n this._planeVertices = [\n this._vertices.slice(0, 4),\n this._vertices.slice(4, 8),\n ];\n for (i = 0; i < 4; i++) {\n this._planeVertices.push([\n this._vertices[i % 4],\n this._vertices[(i + 1) % 4],\n this._vertices[4 + ((i + 1) % 4)],\n this._vertices[4 + i],\n ]);\n }\n\n const center = s2Cell.getCenter();\n centerCartographicScratch = ellipsoid.cartesianToCartographic(\n center,\n centerCartographicScratch\n );\n centerCartographicScratch.height = (maximumHeight + minimumHeight) / 2;\n this.center = ellipsoid.cartographicToCartesian(\n centerCartographicScratch,\n center\n );\n\n this._boundingSphere = BoundingSphere.fromPoints(vertices);\n}\n\nconst centerGeodeticNormalScratch = new Cartesian3();\nconst topCartographicScratch = new Cartographic();\nconst topScratch = new Cartesian3();\nconst vertexCartographicScratch = new Cartographic();\nconst vertexScratch = new Cartesian3();\nconst vertexGeodeticNormalScratch = new Cartesian3();\nconst sideNormalScratch = new Cartesian3();\nconst sideScratch = new Cartesian3();\n/**\n * Computes bounding planes of the kDOP.\n * @private\n */\nfunction computeBoundingPlanes(\n s2Cell,\n minimumHeight,\n maximumHeight,\n ellipsoid\n) {\n const planes = new Array(6);\n const centerPoint = s2Cell.getCenter();\n\n // Compute top plane.\n // - Get geodetic surface normal at the center of the S2 cell.\n // - Get center point at maximum height of bounding volume.\n // - Create top plane from surface normal and top point.\n const centerSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n centerPoint,\n centerGeodeticNormalScratch\n );\n const topCartographic = ellipsoid.cartesianToCartographic(\n centerPoint,\n topCartographicScratch\n );\n topCartographic.height = maximumHeight;\n const top = ellipsoid.cartographicToCartesian(topCartographic, topScratch);\n const topPlane = Plane.fromPointNormal(top, centerSurfaceNormal);\n planes[0] = topPlane;\n\n // Compute bottom plane.\n // - Iterate through bottom vertices\n // - Get distance from vertex to top plane\n // - Find longest distance from vertex to top plane\n // - Translate top plane by the distance\n let maxDistance = 0;\n let i;\n const vertices = [];\n let vertex, vertexCartographic;\n for (i = 0; i < 4; i++) {\n vertex = s2Cell.getVertex(i);\n vertices[i] = vertex;\n vertexCartographic = ellipsoid.cartesianToCartographic(\n vertex,\n vertexCartographicScratch\n );\n vertexCartographic.height = minimumHeight;\n const distance = Plane.getPointDistance(\n topPlane,\n ellipsoid.cartographicToCartesian(vertexCartographic, vertexScratch)\n );\n if (distance < maxDistance) {\n maxDistance = distance;\n }\n }\n const bottomPlane = Plane.clone(topPlane);\n // Negate the normal of the bottom plane since we want all normals to point \"outwards\".\n bottomPlane.normal = Cartesian3.negate(\n bottomPlane.normal,\n bottomPlane.normal\n );\n bottomPlane.distance = bottomPlane.distance * -1 + maxDistance;\n planes[1] = bottomPlane;\n\n // Compute side planes.\n // - Iterate through vertices (in CCW order, by default)\n // - Get a vertex and another vertex adjacent to it.\n // - Compute geodetic surface normal at one vertex.\n // - Compute vector between vertices.\n // - Compute normal of side plane. (cross product of top dir and side dir)\n for (i = 0; i < 4; i++) {\n vertex = vertices[i];\n const adjacentVertex = vertices[(i + 1) % 4];\n const geodeticNormal = ellipsoid.geodeticSurfaceNormal(\n vertex,\n vertexGeodeticNormalScratch\n );\n const side = Cartesian3.subtract(adjacentVertex, vertex, sideScratch);\n let sideNormal = Cartesian3.cross(side, geodeticNormal, sideNormalScratch);\n sideNormal = Cartesian3.normalize(sideNormal, sideNormal);\n planes[2 + i] = Plane.fromPointNormal(vertex, sideNormal);\n }\n\n return planes;\n}\n\nlet n0Scratch = new Cartesian3();\nlet n1Scratch = new Cartesian3();\nlet n2Scratch = new Cartesian3();\nlet x0Scratch = new Cartesian3();\nlet x1Scratch = new Cartesian3();\nlet x2Scratch = new Cartesian3();\nconst t0Scratch = new Cartesian3();\nconst t1Scratch = new Cartesian3();\nconst t2Scratch = new Cartesian3();\nlet f0Scratch = new Cartesian3();\nlet f1Scratch = new Cartesian3();\nlet f2Scratch = new Cartesian3();\nlet sScratch = new Cartesian3();\nconst matrixScratch = new Matrix3();\n/**\n * Computes intersection of 3 planes.\n * @private\n */\nfunction computeIntersection(p0, p1, p2) {\n n0Scratch = p0.normal;\n n1Scratch = p1.normal;\n n2Scratch = p2.normal;\n\n x0Scratch = Cartesian3.multiplyByScalar(p0.normal, -p0.distance, x0Scratch);\n x1Scratch = Cartesian3.multiplyByScalar(p1.normal, -p1.distance, x1Scratch);\n x2Scratch = Cartesian3.multiplyByScalar(p2.normal, -p2.distance, x2Scratch);\n\n f0Scratch = Cartesian3.multiplyByScalar(\n Cartesian3.cross(n1Scratch, n2Scratch, t0Scratch),\n Cartesian3.dot(x0Scratch, n0Scratch),\n f0Scratch\n );\n f1Scratch = Cartesian3.multiplyByScalar(\n Cartesian3.cross(n2Scratch, n0Scratch, t1Scratch),\n Cartesian3.dot(x1Scratch, n1Scratch),\n f1Scratch\n );\n f2Scratch = Cartesian3.multiplyByScalar(\n Cartesian3.cross(n0Scratch, n1Scratch, t2Scratch),\n Cartesian3.dot(x2Scratch, n2Scratch),\n f2Scratch\n );\n\n matrixScratch[0] = n0Scratch.x;\n matrixScratch[1] = n1Scratch.x;\n matrixScratch[2] = n2Scratch.x;\n matrixScratch[3] = n0Scratch.y;\n matrixScratch[4] = n1Scratch.y;\n matrixScratch[5] = n2Scratch.y;\n matrixScratch[6] = n0Scratch.z;\n matrixScratch[7] = n1Scratch.z;\n matrixScratch[8] = n2Scratch.z;\n const determinant = Matrix3.determinant(matrixScratch);\n sScratch = Cartesian3.add(f0Scratch, f1Scratch, sScratch);\n sScratch = Cartesian3.add(sScratch, f2Scratch, sScratch);\n return new Cartesian3(\n sScratch.x / determinant,\n sScratch.y / determinant,\n sScratch.z / determinant\n );\n}\n/**\n * Compute the vertices of the kDOP.\n * @private\n */\nfunction computeVertices(boundingPlanes) {\n const vertices = new Array(8);\n for (let i = 0; i < 4; i++) {\n // Vertices on the top plane.\n vertices[i] = computeIntersection(\n boundingPlanes[0],\n boundingPlanes[2 + ((i + 3) % 4)],\n boundingPlanes[2 + (i % 4)]\n );\n // Vertices on the bottom plane.\n vertices[i + 4] = computeIntersection(\n boundingPlanes[1],\n boundingPlanes[2 + ((i + 3) % 4)],\n boundingPlanes[2 + (i % 4)]\n );\n }\n return vertices;\n}\n\nlet edgeScratch = new Cartesian3();\nlet edgeNormalScratch = new Cartesian3();\n/**\n * Compute edge normals on a plane.\n * @private\n */\nfunction computeEdgeNormals(plane, vertices) {\n const edgeNormals = [];\n for (let i = 0; i < 4; i++) {\n edgeScratch = Cartesian3.subtract(\n vertices[(i + 1) % 4],\n vertices[i],\n edgeScratch\n );\n edgeNormalScratch = Cartesian3.cross(\n plane.normal,\n edgeScratch,\n edgeNormalScratch\n );\n edgeNormalScratch = Cartesian3.normalize(\n edgeNormalScratch,\n edgeNormalScratch\n );\n edgeNormals[i] = Cartesian3.clone(edgeNormalScratch);\n }\n return edgeNormals;\n}\n\nObject.defineProperties(TileBoundingS2Cell.prototype, {\n /**\n * The underlying bounding volume.\n *\n * @memberof TileOrientedBoundingBox.prototype\n *\n * @type {Object}\n * @readonly\n */\n boundingVolume: {\n get: function () {\n return this;\n },\n },\n /**\n * The underlying bounding sphere.\n *\n * @memberof TileOrientedBoundingBox.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n return this._boundingSphere;\n },\n },\n});\n\nconst facePointScratch = new Cartesian3();\n/**\n * The distance to point check for this kDOP involves checking the signed distance of the point to each bounding\n * plane. A plane qualifies for a distance check if the point being tested against is in the half-space in the direction\n * of the normal i.e. if the signed distance of the point from the plane is greater than 0.\n *\n * There are 4 possible cases for a point if it is outside the polyhedron:\n *\n * \\ X / X \\ / \\ / \\ /\n * ---\\---------/--- ---\\---------/--- ---X---------/--- ---\\---------/---\n * \\ / \\ / \\ / \\ /\n * ---\\-----/--- ---\\-----/--- ---\\-----/--- ---\\-----/---\n * \\ / \\ / \\ / \\ /\n * \\ /\n * \\\n * / \\\n * / X \\\n *\n * I II III IV\n *\n * Case I: There is only one plane selected.\n * In this case, we project the point onto the plane and do a point polygon distance check to find the closest point on the polygon.\n * The point may lie inside the \"face\" of the polygon or outside. If it is outside, we need to determine which edges to test against.\n *\n * Case II: There are two planes selected.\n * In this case, the point will lie somewhere on the line created at the intersection of the selected planes or one of the planes.\n *\n * Case III: There are three planes selected.\n * In this case, the point will lie on the vertex, at the intersection of the selected planes.\n *\n * Case IV: There are more than three planes selected.\n * Since we are on an ellipsoid, this will only happen in the bottom plane, which is what we will use for the distance test.\n */\nTileBoundingS2Cell.prototype.distanceToCamera = function (frameState) {\n const point = frameState.camera.positionWC;\n\n const selectedPlaneIndices = [];\n const vertices = [];\n let edgeNormals;\n\n if (Plane.getPointDistance(this._boundingPlanes[0], point) > 0) {\n selectedPlaneIndices.push(0);\n vertices.push(this._planeVertices[0]);\n edgeNormals = this._edgeNormals[0];\n } else if (Plane.getPointDistance(this._boundingPlanes[1], point) > 0) {\n selectedPlaneIndices.push(1);\n vertices.push(this._planeVertices[1]);\n edgeNormals = this._edgeNormals[1];\n }\n\n let i;\n let sidePlaneIndex;\n for (i = 0; i < 4; i++) {\n sidePlaneIndex = 2 + i;\n if (\n Plane.getPointDistance(this._boundingPlanes[sidePlaneIndex], point) > 0\n ) {\n selectedPlaneIndices.push(sidePlaneIndex);\n // Store vertices in CCW order.\n vertices.push(this._planeVertices[sidePlaneIndex]);\n edgeNormals = this._edgeNormals[sidePlaneIndex];\n }\n }\n\n // Check if inside all planes.\n if (selectedPlaneIndices.length === 0) {\n return 0.0;\n }\n\n // We use the skip variable when the side plane indices are non-consecutive.\n let facePoint;\n let selectedPlane;\n if (selectedPlaneIndices.length === 1) {\n // Handles Case I\n selectedPlane = this._boundingPlanes[selectedPlaneIndices[0]];\n facePoint = closestPointPolygon(\n Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch),\n vertices[0],\n selectedPlane,\n edgeNormals\n );\n\n return Cartesian3.distance(facePoint, point);\n } else if (selectedPlaneIndices.length === 2) {\n // Handles Case II\n // Since we are on the ellipsoid, the dihedral angle between a top plane and a side plane\n // will always be acute, so we can do a faster check there.\n if (selectedPlaneIndices[0] === 0) {\n const edge = [\n this._vertices[\n 4 * selectedPlaneIndices[0] + (selectedPlaneIndices[1] - 2)\n ],\n this._vertices[\n 4 * selectedPlaneIndices[0] + ((selectedPlaneIndices[1] - 2 + 1) % 4)\n ],\n ];\n facePoint = closestPointLineSegment(point, edge[0], edge[1]);\n return Cartesian3.distance(facePoint, point);\n }\n let minimumDistance = Number.MAX_VALUE;\n let distance;\n for (i = 0; i < 2; i++) {\n selectedPlane = this._boundingPlanes[selectedPlaneIndices[i]];\n facePoint = closestPointPolygon(\n Plane.projectPointOntoPlane(selectedPlane, point, facePointScratch),\n vertices[i],\n selectedPlane,\n this._edgeNormals[selectedPlaneIndices[i]]\n );\n\n distance = Cartesian3.distanceSquared(facePoint, point);\n if (distance < minimumDistance) {\n minimumDistance = distance;\n }\n }\n return Math.sqrt(minimumDistance);\n } else if (selectedPlaneIndices.length > 3) {\n // Handles Case IV\n facePoint = closestPointPolygon(\n Plane.projectPointOntoPlane(\n this._boundingPlanes[1],\n point,\n facePointScratch\n ),\n this._planeVertices[1],\n this._boundingPlanes[1],\n this._edgeNormals[1]\n );\n return Cartesian3.distance(facePoint, point);\n }\n\n // Handles Case III\n const skip =\n selectedPlaneIndices[1] === 2 && selectedPlaneIndices[2] === 5 ? 0 : 1;\n\n // Vertex is on top plane.\n if (selectedPlaneIndices[0] === 0) {\n return Cartesian3.distance(\n point,\n this._vertices[(selectedPlaneIndices[1] - 2 + skip) % 4]\n );\n }\n\n // Vertex is on bottom plane.\n return Cartesian3.distance(\n point,\n this._vertices[4 + ((selectedPlaneIndices[1] - 2 + skip) % 4)]\n );\n};\n\nconst dScratch = new Cartesian3();\nconst pL0Scratch = new Cartesian3();\n/**\n * Finds point on a line segment closest to a given point.\n * @private\n */\nfunction closestPointLineSegment(p, l0, l1) {\n const d = Cartesian3.subtract(l1, l0, dScratch);\n const pL0 = Cartesian3.subtract(p, l0, pL0Scratch);\n let t = Cartesian3.dot(d, pL0);\n\n if (t <= 0) {\n return l0;\n }\n\n const dMag = Cartesian3.dot(d, d);\n if (t >= dMag) {\n return l1;\n }\n\n t = t / dMag;\n return new Cartesian3(\n (1 - t) * l0.x + t * l1.x,\n (1 - t) * l0.y + t * l1.y,\n (1 - t) * l0.z + t * l1.z\n );\n}\n\nconst edgePlaneScratch = new Plane(Cartesian3.UNIT_X, 0.0);\n/**\n * Finds closes point on the polygon, created by the given vertices, from\n * a point. The test point and the polygon are all on the same plane.\n * @private\n */\nfunction closestPointPolygon(p, vertices, plane, edgeNormals) {\n let minDistance = Number.MAX_VALUE;\n let distance;\n let closestPoint;\n let closestPointOnEdge;\n\n for (let i = 0; i < vertices.length; i++) {\n const edgePlane = Plane.fromPointNormal(\n vertices[i],\n edgeNormals[i],\n edgePlaneScratch\n );\n const edgePlaneDistance = Plane.getPointDistance(edgePlane, p);\n\n // Skip checking against the edge if the point is not in the half-space that the\n // edgePlane's normal points towards i.e. if the edgePlane is facing away from the point.\n if (edgePlaneDistance < 0) {\n continue;\n }\n\n closestPointOnEdge = closestPointLineSegment(\n p,\n vertices[i],\n vertices[(i + 1) % 4]\n );\n\n distance = Cartesian3.distance(p, closestPointOnEdge);\n if (distance < minDistance) {\n minDistance = distance;\n closestPoint = closestPointOnEdge;\n }\n }\n\n if (!defined(closestPoint)) {\n return p;\n }\n return closestPoint;\n}\n\n/**\n * Determines which side of a plane this volume is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire volume is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the volume\n * intersects the plane.\n */\nTileBoundingS2Cell.prototype.intersectPlane = function (plane) {\n let plusCount = 0;\n let negCount = 0;\n for (let i = 0; i < this._vertices.length; i++) {\n const distanceToPlane =\n Cartesian3.dot(plane.normal, this._vertices[i]) + plane.distance;\n if (distanceToPlane < 0) {\n negCount++;\n } else {\n plusCount++;\n }\n }\n\n if (plusCount === this._vertices.length) {\n return Intersect.INSIDE;\n } else if (negCount === this._vertices.length) {\n return Intersect.OUTSIDE;\n }\n return Intersect.INTERSECTING;\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding\n * volume.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingS2Cell.prototype.createDebugVolume = function (color) {\n const modelMatrix = new Matrix4.clone(Matrix4.IDENTITY);\n const topPlanePolygon = new CoplanarPolygonOutlineGeometry({\n polygonHierarchy: {\n positions: this._planeVertices[0],\n },\n });\n const topPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n topPlanePolygon\n );\n const topPlaneInstance = new GeometryInstance({\n geometry: topPlaneGeometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n const bottomPlanePolygon = new CoplanarPolygonOutlineGeometry({\n polygonHierarchy: {\n positions: this._planeVertices[1],\n },\n });\n const bottomPlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n bottomPlanePolygon\n );\n const bottomPlaneInstance = new GeometryInstance({\n geometry: bottomPlaneGeometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n const sideInstances = [];\n for (let i = 0; i < 4; i++) {\n const sidePlanePolygon = new CoplanarPolygonOutlineGeometry({\n polygonHierarchy: {\n positions: this._planeVertices[2 + i],\n },\n });\n const sidePlaneGeometry = CoplanarPolygonOutlineGeometry.createGeometry(\n sidePlanePolygon\n );\n sideInstances[i] = new GeometryInstance({\n geometry: sidePlaneGeometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n }\n\n return new Primitive({\n geometryInstances: [\n sideInstances[0],\n sideInstances[1],\n sideInstances[2],\n sideInstances[3],\n bottomPlaneInstance,\n topPlaneInstance,\n ],\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n};\n\nexport default TileBoundingS2Cell;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\nconst cos = Math.cos;\nconst sin = Math.sin;\n\n/**\n * A description of the outline of an ellipsoid centered at the origin.\n *\n * @alias EllipsoidOutlineGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\n * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines).\n * @param {Number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines).\n * @param {Number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature.\n *\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\n *\n * @example\n * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({\n * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),\n * stackPartitions: 6,\n * slicePartitions: 5\n * });\n * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);\n */\nfunction EllipsoidOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const radii = defaultValue(options.radii, defaultRadii);\n const innerRadii = defaultValue(options.innerRadii, radii);\n const minimumClock = defaultValue(options.minimumClock, 0.0);\n const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\n const minimumCone = defaultValue(options.minimumCone, 0.0);\n const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\n const stackPartitions = Math.round(defaultValue(options.stackPartitions, 10));\n const slicePartitions = Math.round(defaultValue(options.slicePartitions, 8));\n const subdivisions = Math.round(defaultValue(options.subdivisions, 128));\n\n this._radii = Cartesian3.clone(radii);\n this._innerRadii = Cartesian3.clone(innerRadii);\n this._minimumClock = minimumClock;\n this._maximumClock = maximumClock;\n this._minimumCone = minimumCone;\n this._maximumCone = maximumCone;\n this._stackPartitions = stackPartitions;\n this._slicePartitions = slicePartitions;\n this._subdivisions = subdivisions;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createEllipsoidOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nEllipsoidOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 8;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipsoidOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nEllipsoidOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._radii, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n Cartesian3.pack(value._innerRadii, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n array[startingIndex++] = value._minimumClock;\n array[startingIndex++] = value._maximumClock;\n array[startingIndex++] = value._minimumCone;\n array[startingIndex++] = value._maximumCone;\n array[startingIndex++] = value._stackPartitions;\n array[startingIndex++] = value._slicePartitions;\n array[startingIndex++] = value._subdivisions;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchRadii = new Cartesian3();\nconst scratchInnerRadii = new Cartesian3();\nconst scratchOptions = {\n radii: scratchRadii,\n innerRadii: scratchInnerRadii,\n minimumClock: undefined,\n maximumClock: undefined,\n minimumCone: undefined,\n maximumCone: undefined,\n stackPartitions: undefined,\n slicePartitions: undefined,\n subdivisions: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipsoidOutlineGeometry} [result] The object into which to store the result.\n * @returns {EllipsoidOutlineGeometry} The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.\n */\nEllipsoidOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\n startingIndex += Cartesian3.packedLength;\n\n const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\n startingIndex += Cartesian3.packedLength;\n\n const minimumClock = array[startingIndex++];\n const maximumClock = array[startingIndex++];\n const minimumCone = array[startingIndex++];\n const maximumCone = array[startingIndex++];\n const stackPartitions = array[startingIndex++];\n const slicePartitions = array[startingIndex++];\n const subdivisions = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.minimumClock = minimumClock;\n scratchOptions.maximumClock = maximumClock;\n scratchOptions.minimumCone = minimumCone;\n scratchOptions.maximumCone = maximumCone;\n scratchOptions.stackPartitions = stackPartitions;\n scratchOptions.slicePartitions = slicePartitions;\n scratchOptions.subdivisions = subdivisions;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new EllipsoidOutlineGeometry(scratchOptions);\n }\n\n result._radii = Cartesian3.clone(radii, result._radii);\n result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\n result._minimumClock = minimumClock;\n result._maximumClock = maximumClock;\n result._minimumCone = minimumCone;\n result._maximumCone = maximumCone;\n result._stackPartitions = stackPartitions;\n result._slicePartitions = slicePartitions;\n result._subdivisions = subdivisions;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipsoidOutlineGeometry} ellipsoidGeometry A description of the ellipsoid outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipsoidOutlineGeometry.createGeometry = function (ellipsoidGeometry) {\n const radii = ellipsoidGeometry._radii;\n if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\n return;\n }\n\n const innerRadii = ellipsoidGeometry._innerRadii;\n if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\n return;\n }\n\n const minimumClock = ellipsoidGeometry._minimumClock;\n const maximumClock = ellipsoidGeometry._maximumClock;\n const minimumCone = ellipsoidGeometry._minimumCone;\n const maximumCone = ellipsoidGeometry._maximumCone;\n const subdivisions = ellipsoidGeometry._subdivisions;\n const ellipsoid = Ellipsoid.fromCartesian3(radii);\n\n // Add an extra slice and stack to remain consistent with EllipsoidGeometry\n let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\n let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\n\n slicePartitions = Math.round(\n (slicePartitions * Math.abs(maximumClock - minimumClock)) /\n CesiumMath.TWO_PI\n );\n stackPartitions = Math.round(\n (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\n );\n\n if (slicePartitions < 2) {\n slicePartitions = 2;\n }\n if (stackPartitions < 2) {\n stackPartitions = 2;\n }\n\n let extraIndices = 0;\n let vertexMultiplier = 1.0;\n const hasInnerSurface =\n innerRadii.x !== radii.x ||\n innerRadii.y !== radii.y ||\n innerRadii.z !== radii.z;\n let isTopOpen = false;\n let isBotOpen = false;\n if (hasInnerSurface) {\n vertexMultiplier = 2.0;\n // Add 2x slicePartitions to connect the top/bottom of the outer to\n // the top/bottom of the inner\n if (minimumCone > 0.0) {\n isTopOpen = true;\n extraIndices += slicePartitions;\n }\n if (maximumCone < Math.PI) {\n isBotOpen = true;\n extraIndices += slicePartitions;\n }\n }\n\n const vertexCount =\n subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);\n const positions = new Float64Array(vertexCount * 3);\n\n // Multiply by two because two points define each line segment\n const numIndices =\n 2 *\n (vertexCount +\n extraIndices -\n (slicePartitions + stackPartitions) * vertexMultiplier);\n const indices = IndexDatatype.createTypedArray(vertexCount, numIndices);\n\n let i;\n let j;\n let theta;\n let phi;\n let index = 0;\n\n // Calculate sin/cos phi\n const sinPhi = new Array(stackPartitions);\n const cosPhi = new Array(stackPartitions);\n for (i = 0; i < stackPartitions; i++) {\n phi =\n minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1);\n sinPhi[i] = sin(phi);\n cosPhi[i] = cos(phi);\n }\n\n // Calculate sin/cos theta\n const sinTheta = new Array(subdivisions);\n const cosTheta = new Array(subdivisions);\n for (i = 0; i < subdivisions; i++) {\n theta =\n minimumClock + (i * (maximumClock - minimumClock)) / (subdivisions - 1);\n sinTheta[i] = sin(theta);\n cosTheta[i] = cos(theta);\n }\n\n // Calculate the latitude lines on the outer surface\n for (i = 0; i < stackPartitions; i++) {\n for (j = 0; j < subdivisions; j++) {\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = radii.z * cosPhi[i];\n }\n }\n\n // Calculate the latitude lines on the inner surface\n if (hasInnerSurface) {\n for (i = 0; i < stackPartitions; i++) {\n for (j = 0; j < subdivisions; j++) {\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = innerRadii.z * cosPhi[i];\n }\n }\n }\n\n // Calculate sin/cos phi\n sinPhi.length = subdivisions;\n cosPhi.length = subdivisions;\n for (i = 0; i < subdivisions; i++) {\n phi = minimumCone + (i * (maximumCone - minimumCone)) / (subdivisions - 1);\n sinPhi[i] = sin(phi);\n cosPhi[i] = cos(phi);\n }\n\n // Calculate sin/cos theta for each slice partition\n sinTheta.length = slicePartitions;\n cosTheta.length = slicePartitions;\n for (i = 0; i < slicePartitions; i++) {\n theta =\n minimumClock +\n (i * (maximumClock - minimumClock)) / (slicePartitions - 1);\n sinTheta[i] = sin(theta);\n cosTheta[i] = cos(theta);\n }\n\n // Calculate the longitude lines on the outer surface\n for (i = 0; i < subdivisions; i++) {\n for (j = 0; j < slicePartitions; j++) {\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = radii.z * cosPhi[i];\n }\n }\n\n // Calculate the longitude lines on the inner surface\n if (hasInnerSurface) {\n for (i = 0; i < subdivisions; i++) {\n for (j = 0; j < slicePartitions; j++) {\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = innerRadii.z * cosPhi[i];\n }\n }\n }\n\n // Create indices for the latitude lines\n index = 0;\n for (i = 0; i < stackPartitions * vertexMultiplier; i++) {\n const topOffset = i * subdivisions;\n for (j = 0; j < subdivisions - 1; j++) {\n indices[index++] = topOffset + j;\n indices[index++] = topOffset + j + 1;\n }\n }\n\n // Create indices for the outer longitude lines\n let offset = stackPartitions * subdivisions * vertexMultiplier;\n for (i = 0; i < slicePartitions; i++) {\n for (j = 0; j < subdivisions - 1; j++) {\n indices[index++] = offset + i + j * slicePartitions;\n indices[index++] = offset + i + (j + 1) * slicePartitions;\n }\n }\n\n // Create indices for the inner longitude lines\n if (hasInnerSurface) {\n offset =\n stackPartitions * subdivisions * vertexMultiplier +\n slicePartitions * subdivisions;\n for (i = 0; i < slicePartitions; i++) {\n for (j = 0; j < subdivisions - 1; j++) {\n indices[index++] = offset + i + j * slicePartitions;\n indices[index++] = offset + i + (j + 1) * slicePartitions;\n }\n }\n }\n\n if (hasInnerSurface) {\n let outerOffset = stackPartitions * subdivisions * vertexMultiplier;\n let innerOffset = outerOffset + subdivisions * slicePartitions;\n if (isTopOpen) {\n // Draw lines from the top of the inner surface to the top of the outer surface\n for (i = 0; i < slicePartitions; i++) {\n indices[index++] = outerOffset + i;\n indices[index++] = innerOffset + i;\n }\n }\n\n if (isBotOpen) {\n // Draw lines from the top of the inner surface to the top of the outer surface\n outerOffset += subdivisions * slicePartitions - slicePartitions;\n innerOffset += subdivisions * slicePartitions - slicePartitions;\n for (i = 0; i < slicePartitions; i++) {\n indices[index++] = outerOffset + i;\n indices[index++] = innerOffset + i;\n }\n }\n }\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n }),\n });\n\n if (defined(ellipsoidGeometry._offsetAttribute)) {\n const length = positions.length;\n const offsetValue =\n ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: BoundingSphere.fromEllipsoid(ellipsoid),\n offsetAttribute: ellipsoidGeometry._offsetAttribute,\n });\n};\nexport default EllipsoidOutlineGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipsoidOutlineGeometry from \"./EllipsoidOutlineGeometry.js\";\n\n/**\n * A description of the outline of a sphere.\n *\n * @alias SphereOutlineGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.radius=1.0] The radius of the sphere.\n * @param {Number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines).\n * @param {Number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines).\n * @param {Number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .\n *\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\n *\n * @example\n * const sphere = new Cesium.SphereOutlineGeometry({\n * radius : 100.0,\n * stackPartitions : 6,\n * slicePartitions: 5\n * });\n * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);\n */\nfunction SphereOutlineGeometry(options) {\n const radius = defaultValue(options.radius, 1.0);\n const radii = new Cartesian3(radius, radius, radius);\n const ellipsoidOptions = {\n radii: radii,\n stackPartitions: options.stackPartitions,\n slicePartitions: options.slicePartitions,\n subdivisions: options.subdivisions,\n };\n\n this._ellipsoidGeometry = new EllipsoidOutlineGeometry(ellipsoidOptions);\n this._workerName = \"createSphereOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nSphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SphereOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nSphereOutlineGeometry.pack = function (value, array, startingIndex) {\n return EllipsoidOutlineGeometry.pack(\n value._ellipsoidGeometry,\n array,\n startingIndex\n );\n};\n\nconst scratchEllipsoidGeometry = new EllipsoidOutlineGeometry();\nconst scratchOptions = {\n radius: undefined,\n radii: new Cartesian3(),\n stackPartitions: undefined,\n slicePartitions: undefined,\n subdivisions: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SphereOutlineGeometry} [result] The object into which to store the result.\n * @returns {SphereOutlineGeometry} The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.\n */\nSphereOutlineGeometry.unpack = function (array, startingIndex, result) {\n const ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(\n array,\n startingIndex,\n scratchEllipsoidGeometry\n );\n scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\n scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\n scratchOptions.subdivisions = ellipsoidGeometry._subdivisions;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipsoidGeometry._radii.x;\n return new SphereOutlineGeometry(scratchOptions);\n }\n\n Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\n result._ellipsoidGeometry = new EllipsoidOutlineGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.\n *\n * @param {SphereOutlineGeometry} sphereGeometry A description of the sphere outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSphereOutlineGeometry.createGeometry = function (sphereGeometry) {\n return EllipsoidOutlineGeometry.createGeometry(\n sphereGeometry._ellipsoidGeometry\n );\n};\nexport default SphereOutlineGeometry;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * A tile bounding volume specified as a sphere.\n * @alias TileBoundingSphere\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.\n * @param {Number} [radius=0.0] The radius of the bounding sphere.\n *\n * @private\n */\nfunction TileBoundingSphere(center, radius) {\n if (radius === 0) {\n radius = CesiumMath.EPSILON7;\n }\n this._boundingSphere = new BoundingSphere(center, radius);\n}\n\nObject.defineProperties(TileBoundingSphere.prototype, {\n /**\n * The center of the bounding sphere\n *\n * @memberof TileBoundingSphere.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n center: {\n get: function () {\n return this._boundingSphere.center;\n },\n },\n\n /**\n * The radius of the bounding sphere\n *\n * @memberof TileBoundingSphere.prototype\n *\n * @type {Number}\n * @readonly\n */\n radius: {\n get: function () {\n return this._boundingSphere.radius;\n },\n },\n\n /**\n * The underlying bounding volume\n *\n * @memberof TileBoundingSphere.prototype\n *\n * @type {Object}\n * @readonly\n */\n boundingVolume: {\n get: function () {\n return this._boundingSphere;\n },\n },\n /**\n * The underlying bounding sphere\n *\n * @memberof TileBoundingSphere.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n return this._boundingSphere;\n },\n },\n});\n\n/**\n * Computes the distance between this bounding sphere and the camera attached to frameState.\n *\n * @param {FrameState} frameState The frameState to which the camera is attached.\n * @returns {Number} The distance between the camera and the bounding sphere in meters. Returns 0 if the camera is inside the bounding volume.\n *\n */\nTileBoundingSphere.prototype.distanceToCamera = function (frameState) {\nconst boundingSphere = this._boundingSphere;\n return Math.max(\n 0.0,\n Cartesian3.distance(boundingSphere.center, frameState.camera.positionWC) -\n boundingSphere.radius\n );\n};\n\n/**\n * Determines which side of a plane this sphere is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\n * intersects the plane.\n */\nTileBoundingSphere.prototype.intersectPlane = function (plane) {\nreturn BoundingSphere.intersectPlane(this._boundingSphere, plane);\n};\n\n/**\n * Update the bounding sphere after the tile is transformed.\n *\n * @param {Cartesian3} center The center of the bounding sphere.\n * @param {Number} radius The radius of the bounding sphere.\n */\nTileBoundingSphere.prototype.update = function (center, radius) {\n Cartesian3.clone(center, this._boundingSphere.center);\n this._boundingSphere.radius = radius;\n};\n\n/**\n * Creates a debug primitive that shows the outline of the sphere.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingSphere.prototype.createDebugVolume = function (color) {\nconst geometry = new SphereOutlineGeometry({\n radius: this.radius,\n });\n const modelMatrix = Matrix4.fromTranslation(\n this.center,\n new Matrix4.clone(Matrix4.IDENTITY)\n );\n const instance = new GeometryInstance({\n geometry: geometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n return new Primitive({\n geometryInstances: instance,\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n};\nexport default TileBoundingSphere;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\nconst scratchU = new Cartesian3();\nconst scratchV = new Cartesian3();\nconst scratchW = new Cartesian3();\nconst scratchCartesian = new Cartesian3();\n\nfunction computeMissingVector(a, b, result) {\n result = Cartesian3.cross(a, b, result);\n const magnitude = Cartesian3.magnitude(result);\n return Cartesian3.multiplyByScalar(\n result,\n CesiumMath.EPSILON7 / magnitude,\n result\n );\n}\n\nfunction findOrthogonalVector(a, result) {\n const temp = Cartesian3.normalize(a, scratchCartesian);\n const b = Cartesian3.equalsEpsilon(\n temp,\n Cartesian3.UNIT_X,\n CesiumMath.EPSILON6\n )\n ? Cartesian3.UNIT_Y\n : Cartesian3.UNIT_X;\n return computeMissingVector(a, b, result);\n}\n\nfunction checkHalfAxes(halfAxes) {\n let u = Matrix3.getColumn(halfAxes, 0, scratchU);\n let v = Matrix3.getColumn(halfAxes, 1, scratchV);\n let w = Matrix3.getColumn(halfAxes, 2, scratchW);\n\n const uZero = Cartesian3.equals(u, Cartesian3.ZERO);\n const vZero = Cartesian3.equals(v, Cartesian3.ZERO);\n const wZero = Cartesian3.equals(w, Cartesian3.ZERO);\n\n if (!uZero && !vZero && !wZero) {\n return halfAxes;\n }\n if (uZero && vZero && wZero) {\n halfAxes[0] = CesiumMath.EPSILON7;\n halfAxes[4] = CesiumMath.EPSILON7;\n halfAxes[8] = CesiumMath.EPSILON7;\n return halfAxes;\n }\n if (uZero && !vZero && !wZero) {\n u = computeMissingVector(v, w, u);\n } else if (!uZero && vZero && !wZero) {\n v = computeMissingVector(u, w, v);\n } else if (!uZero && !vZero && wZero) {\n w = computeMissingVector(v, u, w);\n } else if (!uZero) {\n v = findOrthogonalVector(u, v);\n w = computeMissingVector(v, u, w);\n } else if (!vZero) {\n u = findOrthogonalVector(v, u);\n w = computeMissingVector(v, u, w);\n } else if (!wZero) {\n u = findOrthogonalVector(w, u);\n v = computeMissingVector(w, u, v);\n }\n\n Matrix3.setColumn(halfAxes, 0, u, halfAxes);\n Matrix3.setColumn(halfAxes, 1, v, halfAxes);\n Matrix3.setColumn(halfAxes, 2, w, halfAxes);\n\n return halfAxes;\n}\n\n/**\n * A tile bounding volume specified as an oriented bounding box.\n * @alias TileOrientedBoundingBox\n * @constructor\n *\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.\n * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.\n * Equivalently, the transformation matrix, to rotate and scale a 2x2x2\n * cube centered at the origin.\n *\n * @private\n */\nfunction TileOrientedBoundingBox(center, halfAxes) {\n halfAxes = checkHalfAxes(halfAxes);\n this._orientedBoundingBox = new OrientedBoundingBox(center, halfAxes);\n this._boundingSphere = BoundingSphere.fromOrientedBoundingBox(\n this._orientedBoundingBox\n );\n}\n\nObject.defineProperties(TileOrientedBoundingBox.prototype, {\n /**\n * The underlying bounding volume.\n *\n * @memberof TileOrientedBoundingBox.prototype\n *\n * @type {Object}\n * @readonly\n */\n boundingVolume: {\n get: function () {\n return this._orientedBoundingBox;\n },\n },\n /**\n * The underlying bounding sphere.\n *\n * @memberof TileOrientedBoundingBox.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n return this._boundingSphere;\n },\n },\n});\n\n/**\n * Computes the distance between this bounding box and the camera attached to frameState.\n *\n * @param {FrameState} frameState The frameState to which the camera is attached.\n * @returns {Number} The distance between the camera and the bounding box in meters. Returns 0 if the camera is inside the bounding volume.\n */\nTileOrientedBoundingBox.prototype.distanceToCamera = function (frameState) {\nreturn Math.sqrt(\n this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)\n );\n};\n\n/**\n * Determines which side of a plane this box is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\n * intersects the plane.\n */\nTileOrientedBoundingBox.prototype.intersectPlane = function (plane) {\nreturn this._orientedBoundingBox.intersectPlane(plane);\n};\n\n/**\n * Update the bounding box after the tile is transformed.\n *\n * @param {Cartesian3} center The center of the box.\n * @param {Matrix3} halfAxes The three orthogonal half-axes of the bounding box.\n * Equivalently, the transformation matrix, to rotate and scale a 2x2x2\n * cube centered at the origin.\n */\nTileOrientedBoundingBox.prototype.update = function (center, halfAxes) {\n Cartesian3.clone(center, this._orientedBoundingBox.center);\n halfAxes = checkHalfAxes(halfAxes);\n Matrix3.clone(halfAxes, this._orientedBoundingBox.halfAxes);\n BoundingSphere.fromOrientedBoundingBox(\n this._orientedBoundingBox,\n this._boundingSphere\n );\n};\n\n/**\n * Creates a debug primitive that shows the outline of the box.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileOrientedBoundingBox.prototype.createDebugVolume = function (color) {\n const geometry = new BoxOutlineGeometry({\n // Make a 2x2x2 cube\n minimum: new Cartesian3(-1.0, -1.0, -1.0),\n maximum: new Cartesian3(1.0, 1.0, 1.0),\n });\n const modelMatrix = Matrix4.fromRotationTranslation(\n this.boundingVolume.halfAxes,\n this.boundingVolume.center\n );\n const instance = new GeometryInstance({\n geometry: geometry,\n id: \"outline\",\n modelMatrix: modelMatrix,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n return new Primitive({\n geometryInstances: instance,\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n};\nexport default TileOrientedBoundingBox;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Cesium3DContentGroup from \"./Cesium3DContentGroup.js\";\nimport Cesium3DTileContentFactory from \"./Cesium3DTileContentFactory.js\";\nimport Cesium3DTileContentState from \"./Cesium3DTileContentState.js\";\nimport Cesium3DTileContentType from \"./Cesium3DTileContentType.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Empty3DTileContent from \"./Empty3DTileContent.js\";\nimport findContentMetadata from \"./findContentMetadata.js\";\nimport findGroupMetadata from \"./findGroupMetadata.js\";\nimport findTileMetadata from \"./findTileMetadata.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport Multiple3DTileContent from \"./Multiple3DTileContent.js\";\nimport preprocess3DTileContent from \"./preprocess3DTileContent.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileBoundingS2Cell from \"./TileBoundingS2Cell.js\";\nimport TileBoundingSphere from \"./TileBoundingSphere.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\nimport Pass from \"../Renderer/Pass.js\";\n\n/**\n * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;\n * the content is loaded on-demand when needed based on the view.\n * <p>\n * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.\n * </p>\n *\n * @alias Cesium3DTile\n * @constructor\n */\nfunction Cesium3DTile(tileset, baseResource, header, parent) {\n this._tileset = tileset;\n this._header = header;\n\n const hasContentsArray = defined(header.contents);\n const hasMultipleContents =\n (hasContentsArray && header.contents.length > 1) ||\n hasExtension(header, \"3DTILES_multiple_contents\");\n\n // In the 1.0 schema, content is stored in tile.content instead of tile.contents\n const contentHeader =\n hasContentsArray && !hasMultipleContents\n ? header.contents[0]\n : header.content;\n\n this._contentHeader = contentHeader;\n\n /**\n * The local transform of this tile.\n * @type {Matrix4}\n */\n this.transform = defined(header.transform)\n ? Matrix4.unpack(header.transform)\n : Matrix4.clone(Matrix4.IDENTITY);\n\n const parentTransform = defined(parent)\n ? parent.computedTransform\n : tileset.modelMatrix;\n const computedTransform = Matrix4.multiply(\n parentTransform,\n this.transform,\n new Matrix4()\n );\n\n const parentInitialTransform = defined(parent)\n ? parent._initialTransform\n : Matrix4.IDENTITY;\n this._initialTransform = Matrix4.multiply(\n parentInitialTransform,\n this.transform,\n new Matrix4()\n );\n\n /**\n * The final computed transform of this tile.\n * @type {Matrix4}\n * @readonly\n */\n this.computedTransform = computedTransform;\n\n this._boundingVolume = this.createBoundingVolume(\n header.boundingVolume,\n computedTransform\n );\n this._boundingVolume2D = undefined;\n\n let contentBoundingVolume;\n\n if (defined(contentHeader) && defined(contentHeader.boundingVolume)) {\n // Non-leaf tiles may have a content bounding-volume, which is a tight-fit bounding volume\n // around only the features in the tile. This box is useful for culling for rendering,\n // but not for culling for traversing the tree since it does not guarantee spatial coherence, i.e.,\n // since it only bounds features in the tile, not the entire tile, children may be\n // outside of this box.\n contentBoundingVolume = this.createBoundingVolume(\n contentHeader.boundingVolume,\n computedTransform\n );\n }\n this._contentBoundingVolume = contentBoundingVolume;\n this._contentBoundingVolume2D = undefined;\n\n let viewerRequestVolume;\n if (defined(header.viewerRequestVolume)) {\n viewerRequestVolume = this.createBoundingVolume(\n header.viewerRequestVolume,\n computedTransform\n );\n }\n this._viewerRequestVolume = viewerRequestVolume;\n\n /**\n * The error, in meters, introduced if this tile is rendered and its children are not.\n * This is used to compute screen space error, i.e., the error measured in pixels.\n *\n * @type {Number}\n * @readonly\n */\n this.geometricError = header.geometricError;\n this._geometricError = header.geometricError;\n\n if (!defined(this._geometricError)) {\n this._geometricError = defined(parent)\n ? parent.geometricError\n : tileset._geometricError;\n Cesium3DTile._deprecationWarning(\n \"geometricErrorUndefined\",\n \"Required property geometricError is undefined for this tile. Using parent's geometric error instead.\"\n );\n }\n\n this.updateGeometricErrorScale();\n\n let refine;\n if (defined(header.refine)) {\n if (header.refine === \"replace\" || header.refine === \"add\") {\n Cesium3DTile._deprecationWarning(\n \"lowercase-refine\",\n `This tile uses a lowercase refine \"${\n header.refine\n }\". Instead use \"${header.refine.toUpperCase()}\".`\n );\n }\n refine =\n header.refine.toUpperCase() === \"REPLACE\"\n ? Cesium3DTileRefine.REPLACE\n : Cesium3DTileRefine.ADD;\n } else if (defined(parent)) {\n // Inherit from parent tile if omitted.\n refine = parent.refine;\n } else {\n refine = Cesium3DTileRefine.REPLACE;\n }\n\n /**\n * Specifies the type of refinement that is used when traversing this tile for rendering.\n *\n * @type {Cesium3DTileRefine}\n * @readonly\n * @private\n */\n this.refine = refine;\n\n /**\n * Gets the tile's children.\n *\n * @type {Cesium3DTile[]}\n * @readonly\n */\n this.children = [];\n\n /**\n * This tile's parent or <code>undefined</code> if this tile is the root.\n * <p>\n * When a tile's content points to an external tileset JSON file, the external tileset's\n * root tile's parent is not <code>undefined</code>; instead, the parent references\n * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.\n * </p>\n *\n * @type {Cesium3DTile}\n * @readonly\n */\n this.parent = parent;\n\n let content;\n let hasEmptyContent = false;\n let contentState;\n let contentResource;\n let serverKey;\n\n baseResource = Resource.createIfNeeded(baseResource);\n\n if (hasMultipleContents) {\n contentState = Cesium3DTileContentState.UNLOADED;\n // Each content may have its own URI, but they all need to be resolved\n // relative to the tileset, so the base resource is used.\n contentResource = baseResource.clone();\n } else if (defined(contentHeader)) {\n let contentHeaderUri = contentHeader.uri;\n if (defined(contentHeader.url)) {\n Cesium3DTile._deprecationWarning(\n \"contentUrl\",\n 'This tileset JSON uses the \"content.url\" property which has been deprecated. Use \"content.uri\" instead.'\n );\n contentHeaderUri = contentHeader.url;\n }\n if (contentHeaderUri === \"\") {\n Cesium3DTile._deprecationWarning(\n \"contentUriEmpty\",\n \"content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead\"\n );\n content = new Empty3DTileContent(tileset, this);\n hasEmptyContent = true;\n contentState = Cesium3DTileContentState.READY;\n } else {\n contentState = Cesium3DTileContentState.UNLOADED;\n contentResource = baseResource.getDerivedResource({\n url: contentHeaderUri,\n });\n serverKey = RequestScheduler.getServerKey(\n contentResource.getUrlComponent()\n );\n }\n } else {\n content = new Empty3DTileContent(tileset, this);\n hasEmptyContent = true;\n contentState = Cesium3DTileContentState.READY;\n }\n\n this._content = content;\n this._contentResource = contentResource;\n this._contentState = contentState;\n this._contentReadyToProcessPromise = undefined;\n this._contentReadyPromise = undefined;\n this._expiredContent = undefined;\n\n this._serverKey = serverKey;\n\n /**\n * When <code>true</code>, the tile has no content.\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasEmptyContent = hasEmptyContent;\n\n /**\n * When <code>true</code>, the tile's content points to an external tileset.\n * <p>\n * This is <code>false</code> until the tile's content is loaded.\n * </p>\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasTilesetContent = false;\n\n /**\n * When <code>true</code>, the tile's content is an implicit tileset.\n * <p>\n * This is <code>false</code> until the tile's implicit content is loaded.\n * </p>\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.hasImplicitContent = false;\n\n /**\n * When <code>true</code>, the tile contains content metadata from implicit tiling. This flag is set\n * for tiles transcoded by <code>Implicit3DTileContent</code>.\n * <p>\n * This is <code>false</code> until the tile's content is loaded.\n * </p>\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.hasImplicitContentMetadata = false;\n\n /**\n * When <code>true</code>, the tile has multiple contents, either in the tile JSON (3D Tiles 1.1)\n * or via the <code>3DTILES_multiple_contents</code> extension.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_multiple_contents|3DTILES_multiple_contents extension}\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n this.hasMultipleContents = hasMultipleContents;\n\n /**\n * When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,\n * this stores a {@link TileMetadata} object for accessing tile metadata.\n *\n * @type {TileMetadata}\n * @readonly\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.metadata = findTileMetadata(tileset, header);\n\n /**\n * The node in the tileset's LRU cache, used to determine when to unload a tile's content.\n *\n * See {@link Cesium3DTilesetCache}\n *\n * @type {DoublyLinkedListNode}\n * @readonly\n *\n * @private\n */\n this.cacheNode = undefined;\n\n const expire = header.expire;\n let expireDuration;\n let expireDate;\n if (defined(expire)) {\n expireDuration = expire.duration;\n if (defined(expire.date)) {\n expireDate = JulianDate.fromIso8601(expire.date);\n }\n }\n\n /**\n * The time in seconds after the tile's content is ready when the content expires and new content is requested.\n *\n * @type {Number}\n */\n this.expireDuration = expireDuration;\n\n /**\n * The date when the content expires and new content is requested.\n *\n * @type {JulianDate}\n */\n this.expireDate = expireDate;\n\n /**\n * The time when a style was last applied to this tile.\n *\n * @type {Number}\n *\n * @private\n */\n this.lastStyleTime = 0.0;\n\n /**\n * Marks whether the tile's children bounds are fully contained within the tile's bounds\n *\n * @type {Cesium3DTileOptimizationHint}\n *\n * @private\n */\n this._optimChildrenWithinParent = Cesium3DTileOptimizationHint.NOT_COMPUTED;\n\n /**\n * Tracks if the tile's relationship with a ClippingPlaneCollection has changed with regards\n * to the ClippingPlaneCollection's state.\n *\n * @type {Boolean}\n *\n * @private\n */\n this.clippingPlanesDirty = false;\n\n /**\n * Tracks if the tile's request should be deferred until all non-deferred\n * tiles load.\n *\n * @type {Boolean}\n *\n * @private\n */\n this.priorityDeferred = false;\n\n /**\n * For implicit tiling, an ImplicitTileset object will be attached to a\n * placeholder tile with either implicit tiling in the JSON (3D Tiles 1.1)\n * or the <code>3DTILES_implicit_tiling</code> extension.\n * This way the {@link Implicit3DTileContent} can access the tile later once the content is fetched.\n *\n * @type {ImplicitTileset|undefined}\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.implicitTileset = undefined;\n\n /**\n * For implicit tiling, the (level, x, y, [z]) coordinates within the\n * implicit tileset are stored in the tile.\n *\n * @type {ImplicitTileCoordinates|undefined}\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.implicitCoordinates = undefined;\n\n /**\n * For implicit tiling, each transcoded tile will hold a weak reference to\n * the {@link ImplicitSubtree}.\n *\n * @type {ImplicitSubtree|undefined}\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n this.implicitSubtree = undefined;\n\n // Members that are updated every frame for tree traversal and rendering optimizations:\n this._distanceToCamera = 0.0;\n this._centerZDepth = 0.0;\n this._screenSpaceError = 0.0;\n this._screenSpaceErrorProgressiveResolution = 0.0; // The screen space error at a given screen height of tileset.progressiveResolutionHeightFraction * screenHeight\n this._visibilityPlaneMask = 0;\n this._visible = false;\n this._inRequestVolume = false;\n\n this._finalResolution = true;\n this._depth = 0;\n this._stackLength = 0;\n this._selectionDepth = 0;\n\n this._updatedVisibilityFrame = 0;\n this._touchedFrame = 0;\n this._visitedFrame = 0;\n this._selectedFrame = 0;\n this._requestedFrame = 0;\n this._ancestorWithContent = undefined;\n this._ancestorWithContentAvailable = undefined;\n this._refines = false;\n this._shouldSelect = false;\n this._isClipped = true;\n this._clippingPlanesState = 0; // encapsulates (_isClipped, clippingPlanes.enabled) and number/function\n this._debugBoundingVolume = undefined;\n this._debugContentBoundingVolume = undefined;\n this._debugViewerRequestVolume = undefined;\n this._debugColor = Color.fromRandom({ alpha: 1.0 });\n this._debugColorizeTiles = false;\n\n this._priority = 0.0; // The priority used for request sorting\n this._priorityHolder = this; // Reference to the ancestor up the tree that holds the _foveatedFactor and _distanceToCamera for all tiles in the refinement chain.\n this._priorityProgressiveResolution = false;\n this._priorityProgressiveResolutionScreenSpaceErrorLeaf = false;\n this._priorityReverseScreenSpaceError = 0.0;\n this._foveatedFactor = 0.0;\n this._wasMinPriorityChild = false; // Needed for knowing when to continue a refinement chain. Gets reset in updateTile in traversal and gets set in updateAndPushChildren in traversal.\n\n this._loadTimestamp = new JulianDate();\n\n this._commandsLength = 0;\n\n this._color = undefined;\n this._colorDirty = false;\n\n this._request = undefined;\n}\n\n// This can be overridden for testing purposes\nCesium3DTile._deprecationWarning = deprecationWarning;\n\nObject.defineProperties(Cesium3DTile.prototype, {\n /**\n * The tileset containing this tile.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Cesium3DTileset}\n * @readonly\n */\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n /**\n * The tile's content. This represents the actual tile's payload,\n * not the content's metadata in the tileset JSON file.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Cesium3DTileContent}\n * @readonly\n */\n content: {\n get: function () {\n return this._content;\n },\n },\n\n /**\n * Get the tile's bounding volume.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {TileBoundingVolume}\n * @readonly\n * @private\n */\n boundingVolume: {\n get: function () {\n return this._boundingVolume;\n },\n },\n\n /**\n * Get the bounding volume of the tile's contents. This defaults to the\n * tile's bounding volume when the content's bounding volume is\n * <code>undefined</code>.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {TileBoundingVolume}\n * @readonly\n * @private\n */\n contentBoundingVolume: {\n get: function () {\n return defaultValue(this._contentBoundingVolume, this._boundingVolume);\n },\n },\n\n /**\n * Get the bounding sphere derived from the tile's bounding volume.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n return this._boundingVolume.boundingSphere;\n },\n },\n\n /**\n * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.\n * Returns <code>undefined</code> if <code>extras</code> does not exist.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {*}\n * @readonly\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}\n */\n extras: {\n get: function () {\n return this._header.extras;\n },\n },\n\n /**\n * Gets or sets the tile's highlight color.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Color}\n *\n * @default {@link Color.WHITE}\n *\n * @private\n */\n color: {\n get: function () {\n if (!defined(this._color)) {\n this._color = new Color();\n }\n return Color.clone(this._color);\n },\n set: function (value) {\n this._color = Color.clone(value, this._color);\n this._colorDirty = true;\n },\n },\n\n /**\n * Determines if the tile has available content to render. <code>true</code> if the tile's\n * content is ready or if it has expired content that renders while new content loads; otherwise,\n * <code>false</code>.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n contentAvailable: {\n get: function () {\n return (\n (this.contentReady &&\n !this.hasEmptyContent &&\n !this.hasTilesetContent &&\n !this.hasImplicitContent) ||\n (defined(this._expiredContent) && !this.contentFailed)\n );\n },\n },\n\n /**\n * Determines if the tile's content is ready. This is automatically <code>true</code> for\n * tile's with empty content.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n contentReady: {\n get: function () {\n return this._contentState === Cesium3DTileContentState.READY;\n },\n },\n\n /**\n * Determines if the tile's content has not be requested. <code>true</code> if tile's\n * content has not be requested; otherwise, <code>false</code>.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n contentUnloaded: {\n get: function () {\n return this._contentState === Cesium3DTileContentState.UNLOADED;\n },\n },\n\n /**\n * Determines if the tile's content is expired. <code>true</code> if tile's\n * content is expired; otherwise, <code>false</code>.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n contentExpired: {\n get: function () {\n return this._contentState === Cesium3DTileContentState.EXPIRED;\n },\n },\n\n /**\n * Determines if the tile's content failed to load. <code>true</code> if the tile's\n * content failed to load; otherwise, <code>false</code>.\n *\n * @memberof Cesium3DTile.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @private\n */\n contentFailed: {\n get: function () {\n return this._contentState === Cesium3DTileContentState.FAILED;\n },\n },\n\n /**\n * Gets the promise that will be resolved when the tile's content is ready to process.\n * This happens after the content is downloaded but before the content is ready\n * to render.\n * <p>\n * The promise remains <code>undefined</code> until the tile's content is requested.\n * </p>\n *\n * @type {Promise.<Cesium3DTileContent>}\n * @readonly\n *\n * @private\n */\n contentReadyToProcessPromise: {\n get: function () {\n return this._contentReadyToProcessPromise;\n },\n },\n\n /**\n * Gets the promise that will be resolved when the tile's content is ready to render.\n * <p>\n * The promise remains <code>undefined</code> until the tile's content is requested.\n * </p>\n *\n * @type {Promise.<Cesium3DTileContent>}\n * @readonly\n *\n * @private\n */\n contentReadyPromise: {\n get: function () {\n return this._contentReadyPromise;\n },\n },\n\n /**\n * Returns the number of draw commands used by this tile.\n *\n * @readonly\n *\n * @private\n */\n commandsLength: {\n get: function () {\n return this._commandsLength;\n },\n },\n});\n\nconst scratchCartesian = new Cartesian3();\nfunction isPriorityDeferred(tile, frameState) {\n const tileset = tile._tileset;\n\n // If closest point on line is inside the sphere then set foveatedFactor to 0. Otherwise, the dot product is with the line from camera to the point on the sphere that is closest to the line.\n const camera = frameState.camera;\n const boundingSphere = tile.boundingSphere;\n const radius = boundingSphere.radius;\n const scaledCameraDirection = Cartesian3.multiplyByScalar(\n camera.directionWC,\n tile._centerZDepth,\n scratchCartesian\n );\n const closestPointOnLine = Cartesian3.add(\n camera.positionWC,\n scaledCameraDirection,\n scratchCartesian\n );\n // The distance from the camera's view direction to the tile.\n const toLine = Cartesian3.subtract(\n closestPointOnLine,\n boundingSphere.center,\n scratchCartesian\n );\n const distanceToCenterLine = Cartesian3.magnitude(toLine);\n const notTouchingSphere = distanceToCenterLine > radius;\n\n // If camera's direction vector is inside the bounding sphere then consider\n // this tile right along the line of sight and set _foveatedFactor to 0.\n // Otherwise,_foveatedFactor is one minus the dot product of the camera's direction\n // and the vector between the camera and the point on the bounding sphere closest to the view line.\n if (notTouchingSphere) {\n const toLineNormalized = Cartesian3.normalize(toLine, scratchCartesian);\n const scaledToLine = Cartesian3.multiplyByScalar(\n toLineNormalized,\n radius,\n scratchCartesian\n );\n const closestOnSphere = Cartesian3.add(\n boundingSphere.center,\n scaledToLine,\n scratchCartesian\n );\n const toClosestOnSphere = Cartesian3.subtract(\n closestOnSphere,\n camera.positionWC,\n scratchCartesian\n );\n const toClosestOnSphereNormalize = Cartesian3.normalize(\n toClosestOnSphere,\n scratchCartesian\n );\n tile._foveatedFactor =\n 1.0 -\n Math.abs(Cartesian3.dot(camera.directionWC, toClosestOnSphereNormalize));\n } else {\n tile._foveatedFactor = 0.0;\n }\n\n // Skip this feature if: non-skipLevelOfDetail and replace refine, if the foveated settings are turned off, if tile is progressive resolution and replace refine and skipLevelOfDetail (will help get rid of ancestor artifacts faster)\n // Or if the tile is a preload of any kind\n const replace = tile.refine === Cesium3DTileRefine.REPLACE;\n const skipLevelOfDetail = tileset._skipLevelOfDetail;\n if (\n (replace && !skipLevelOfDetail) ||\n !tileset.foveatedScreenSpaceError ||\n tileset.foveatedConeSize === 1.0 ||\n (tile._priorityProgressiveResolution && replace && skipLevelOfDetail) ||\n tileset._pass === Cesium3DTilePass.PRELOAD_FLIGHT ||\n tileset._pass === Cesium3DTilePass.PRELOAD\n ) {\n return false;\n }\n\n const maximumFovatedFactor = 1.0 - Math.cos(camera.frustum.fov * 0.5); // 0.14 for fov = 60. NOTE very hard to defer vertically foveated tiles since max is based on fovy (which is fov). Lowering the 0.5 to a smaller fraction of the screen height will start to defer vertically foveated tiles.\n const foveatedConeFactor = tileset.foveatedConeSize * maximumFovatedFactor;\n\n // If it's inside the user-defined view cone, then it should not be deferred.\n if (tile._foveatedFactor <= foveatedConeFactor) {\n return false;\n }\n\n // Relax SSE based on how big the angle is between the tile and the edge of the foveated cone.\n const range = maximumFovatedFactor - foveatedConeFactor;\n const normalizedFoveatedFactor = CesiumMath.clamp(\n (tile._foveatedFactor - foveatedConeFactor) / range,\n 0.0,\n 1.0\n );\n const sseRelaxation = tileset.foveatedInterpolationCallback(\n tileset.foveatedMinimumScreenSpaceErrorRelaxation,\n tileset.maximumScreenSpaceError,\n normalizedFoveatedFactor\n );\n const sse =\n tile._screenSpaceError === 0.0 && defined(tile.parent)\n ? tile.parent._screenSpaceError * 0.5\n : tile._screenSpaceError;\n\n return tileset.maximumScreenSpaceError - sseRelaxation <= sse;\n}\n\nconst scratchJulianDate = new JulianDate();\n\n/**\n * Get the tile's screen space error.\n *\n * @private\n */\nCesium3DTile.prototype.getScreenSpaceError = function (\n frameState,\n useParentGeometricError,\n progressiveResolutionHeightFraction\n) {\n const tileset = this._tileset;\n const heightFraction = defaultValue(progressiveResolutionHeightFraction, 1.0);\n const parentGeometricError = defined(this.parent)\n ? this.parent.geometricError\n : tileset._geometricError;\n const geometricError = useParentGeometricError\n ? parentGeometricError\n : this.geometricError;\n if (geometricError === 0.0) {\n // Leaf tiles do not have any error so save the computation\n return 0.0;\n }\n const camera = frameState.camera;\n let frustum = camera.frustum;\n const context = frameState.context;\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight * heightFraction;\n let error;\n if (\n frameState.mode === SceneMode.SCENE2D ||\n frustum instanceof OrthographicFrustum\n ) {\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n const pixelSize =\n Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) /\n Math.max(width, height);\n error = geometricError / pixelSize;\n } else {\n // Avoid divide by zero when viewer is inside the tile\n const distance = Math.max(this._distanceToCamera, CesiumMath.EPSILON7);\n const sseDenominator = camera.frustum.sseDenominator;\n error = (geometricError * height) / (distance * sseDenominator);\n if (tileset.dynamicScreenSpaceError) {\n const density = tileset._dynamicScreenSpaceErrorComputedDensity;\n const factor = tileset.dynamicScreenSpaceErrorFactor;\n const dynamicError = CesiumMath.fog(distance, density) * factor;\n error -= dynamicError;\n }\n }\n\n error /= frameState.pixelRatio;\n\n return error;\n};\n\nfunction isPriorityProgressiveResolution(tileset, tile) {\n if (\n tileset.progressiveResolutionHeightFraction <= 0.0 ||\n tileset.progressiveResolutionHeightFraction > 0.5\n ) {\n return false;\n }\n\n let isProgressiveResolutionTile =\n tile._screenSpaceErrorProgressiveResolution >\n tileset._maximumScreenSpaceError; // Mark non-SSE leaves\n tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = false; // Needed for skipLOD\n const parent = tile.parent;\n const maximumScreenSpaceError = tileset._maximumScreenSpaceError;\n const tilePasses =\n tile._screenSpaceErrorProgressiveResolution <= maximumScreenSpaceError;\n const parentFails =\n defined(parent) &&\n parent._screenSpaceErrorProgressiveResolution > maximumScreenSpaceError;\n if (tilePasses && parentFails) {\n // A progressive resolution SSE leaf, promote its priority as well\n tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = true;\n isProgressiveResolutionTile = true;\n }\n return isProgressiveResolutionTile;\n}\n\nfunction getPriorityReverseScreenSpaceError(tileset, tile) {\n const parent = tile.parent;\n const useParentScreenSpaceError =\n defined(parent) &&\n (!tileset._skipLevelOfDetail ||\n tile._screenSpaceError === 0.0 ||\n parent.hasTilesetContent ||\n parent.hasImplicitContent);\n const screenSpaceError = useParentScreenSpaceError\n ? parent._screenSpaceError\n : tile._screenSpaceError;\n return tileset.root._screenSpaceError - screenSpaceError;\n}\n\n/**\n * Update the tile's visibility.\n *\n * @private\n */\nCesium3DTile.prototype.updateVisibility = function (frameState) {\n const parent = this.parent;\n const tileset = this._tileset;\n const parentTransform = defined(parent)\n ? parent.computedTransform\n : tileset.modelMatrix;\n const parentVisibilityPlaneMask = defined(parent)\n ? parent._visibilityPlaneMask\n : CullingVolume.MASK_INDETERMINATE;\n this.updateTransform(parentTransform);\n this._distanceToCamera = this.distanceToTile(frameState);\n this._centerZDepth = this.distanceToTileCenter(frameState);\n this._screenSpaceError = this.getScreenSpaceError(frameState, false);\n this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError(\n frameState,\n false,\n tileset.progressiveResolutionHeightFraction\n );\n this._visibilityPlaneMask = this.visibility(\n frameState,\n parentVisibilityPlaneMask\n ); // Use parent's plane mask to speed up visibility test\n this._visible = this._visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;\n this._inRequestVolume = this.insideViewerRequestVolume(frameState);\n this._priorityReverseScreenSpaceError = getPriorityReverseScreenSpaceError(\n tileset,\n this\n );\n this._priorityProgressiveResolution = isPriorityProgressiveResolution(\n tileset,\n this\n );\n this.priorityDeferred = isPriorityDeferred(this, frameState);\n};\n\n/**\n * Update whether the tile has expired.\n *\n * @private\n */\nCesium3DTile.prototype.updateExpiration = function () {\n if (\n defined(this.expireDate) &&\n this.contentReady &&\n !this.hasEmptyContent &&\n !this.hasMultipleContents\n ) {\n const now = JulianDate.now(scratchJulianDate);\n if (JulianDate.lessThan(this.expireDate, now)) {\n this._contentState = Cesium3DTileContentState.EXPIRED;\n this._expiredContent = this._content;\n }\n }\n};\n\nfunction updateExpireDate(tile) {\n if (defined(tile.expireDuration)) {\n const expireDurationDate = JulianDate.now(scratchJulianDate);\n JulianDate.addSeconds(\n expireDurationDate,\n tile.expireDuration,\n expireDurationDate\n );\n\n if (defined(tile.expireDate)) {\n if (JulianDate.lessThan(tile.expireDate, expireDurationDate)) {\n JulianDate.clone(expireDurationDate, tile.expireDate);\n }\n } else {\n tile.expireDate = JulianDate.clone(expireDurationDate);\n }\n }\n}\n\nfunction createPriorityFunction(tile) {\n return function () {\n return tile._priority;\n };\n}\n\n/**\n * Requests the tile's content.\n * <p>\n * The request may not be made if the Cesium Request Scheduler can't prioritize it.\n * </p>\n *\n * @return {Number} The number of requests that were attempted but not scheduled.\n * @private\n */\nCesium3DTile.prototype.requestContent = function () {\n // empty contents don't require any HTTP requests\n if (this.hasEmptyContent) {\n return 0;\n }\n\n if (this.hasMultipleContents) {\n return requestMultipleContents(this);\n }\n\n return requestSingleContent(this);\n};\n\n/**\n * Multiple {@link Cesium3DTileContent}s are allowed within a single tile either through\n * the tile JSON (3D Tiles 1.1) or the <code>3DTILES_multiple_contents</code> extension.\n * Due to differences in request scheduling, this is handled separately.\n * <p>\n * This implementation of multiple contents does not\n * support tile expiry like requestSingleContent does. If this changes,\n * note that the resource.setQueryParameters() details must go inside {@link Multiple3DTileContent} since that is per-request.\n * </p>\n *\n * @private\n */\nfunction requestMultipleContents(tile) {\n let multipleContents = tile._content;\n const tileset = tile._tileset;\n\n if (!defined(multipleContents)) {\n // Create the content object immediately, it will handle scheduling\n // requests for inner contents.\n const contentsJson = hasExtension(tile._header, \"3DTILES_multiple_contents\")\n ? tile._header.extensions[\"3DTILES_multiple_contents\"]\n : tile._header;\n\n multipleContents = new Multiple3DTileContent(\n tileset,\n tile,\n tile._contentResource.clone(),\n contentsJson\n );\n tile._content = multipleContents;\n }\n\n const backloggedRequestCount = multipleContents.requestInnerContents();\n if (backloggedRequestCount > 0) {\n return backloggedRequestCount;\n }\n\n tile._contentState = Cesium3DTileContentState.LOADING;\n const contentReadyToProcessPromise = multipleContents.contentsFetchedPromise.then(\n function () {\n if (\n tile._contentState !== Cesium3DTileContentState.LOADING ||\n !defined(multipleContents.readyPromise)\n ) {\n // The tile or one of the inner content requests was canceled,\n // short circuit.\n return;\n }\n\n if (tile.isDestroyed()) {\n multipleContentFailed(\n tile,\n tileset,\n \"Tile was unloaded while content was loading\"\n );\n return;\n }\n\n tile._contentState = Cesium3DTileContentState.PROCESSING;\n return multipleContents;\n }\n );\n tile._contentReadyToProcessPromise = contentReadyToProcessPromise;\n tile._contentReadyPromise = contentReadyToProcessPromise\n .then(function (content) {\n if (!defined(content)) {\n // request was canceled, short circuit.\n return;\n }\n\n return multipleContents.readyPromise;\n })\n .then(function (content) {\n if (!defined(content)) {\n // tile was canceled, short circuit.\n return;\n }\n\n if (tile.isDestroyed()) {\n multipleContentFailed(\n tile,\n tileset,\n \"Tile was unloaded while content was processing\"\n );\n return;\n }\n\n // Refresh style for expired content\n tile._selectedFrame = 0;\n tile.lastStyleTime = 0.0;\n\n JulianDate.now(tile._loadTimestamp);\n tile._contentState = Cesium3DTileContentState.READY;\n return content;\n })\n .catch(function (error) {\n multipleContentFailed(tile, tileset, error);\n });\n\n return 0;\n}\n\nfunction multipleContentFailed(tile, tileset, error) {\n // note: The Multiple3DTileContent handles decrementing the number of pending\n // requests if the state is LOADING.\n if (tile._contentState === Cesium3DTileContentState.PROCESSING) {\n --tileset.statistics.numberOfTilesProcessing;\n }\n\n tile._contentState = Cesium3DTileContentState.FAILED;\n}\n\nfunction requestSingleContent(tile) {\n // it is important to clone here. The fetchArrayBuffer() below uses\n // throttling, but other uses of the resources do not.\n const resource = tile._contentResource.clone();\n const expired = tile.contentExpired;\n if (expired) {\n // Append a query parameter of the tile expiration date to prevent caching\n resource.setQueryParameters({\n expired: tile.expireDate.toString(),\n });\n }\n\n const request = new Request({\n throttle: true,\n throttleByServer: true,\n type: RequestType.TILES3D,\n priorityFunction: createPriorityFunction(tile),\n serverKey: tile._serverKey,\n });\n\n tile._request = request;\n resource.request = request;\n\n const promise = resource.fetchArrayBuffer();\n if (!defined(promise)) {\n return 1;\n }\n\n const previousState = tile._contentState;\n const tileset = tile._tileset;\n tile._contentState = Cesium3DTileContentState.LOADING;\n ++tileset.statistics.numberOfPendingRequests;\n const contentReadyToProcessPromise = promise.then(function (arrayBuffer) {\n if (tile.isDestroyed()) {\n // Tile is unloaded before the content finishes loading\n singleContentFailed(tile, tileset);\n return;\n }\n\n const content = makeContent(tile, arrayBuffer);\n\n if (expired) {\n tile.expireDate = undefined;\n }\n\n tile._content = content;\n tile._contentState = Cesium3DTileContentState.PROCESSING;\n return content;\n });\n tile._contentReadyToProcessPromise = contentReadyToProcessPromise;\n tile._contentReadyPromise = contentReadyToProcessPromise\n .then(function (content) {\n if (!defined(content)) {\n return;\n }\n\n --tileset.statistics.numberOfPendingRequests;\n return content.readyPromise;\n })\n .then(function (content) {\n if (!defined(content)) {\n return;\n }\n\n if (tile.isDestroyed()) {\n // Tile is unloaded before the content finishes processing\n singleContentFailed(tile, tileset);\n return;\n }\n updateExpireDate(tile);\n\n // Refresh style for expired content\n tile._selectedFrame = 0;\n tile.lastStyleTime = 0.0;\n\n JulianDate.now(tile._loadTimestamp);\n tile._contentState = Cesium3DTileContentState.READY;\n return content;\n })\n .catch(function (error) {\n if (request.state === RequestState.CANCELLED) {\n // Cancelled due to low priority - try again later.\n tile._contentState = previousState;\n --tileset.statistics.numberOfPendingRequests;\n ++tileset.statistics.numberOfAttemptedRequests;\n return Promise.reject(\"Cancelled\");\n }\n singleContentFailed(tile, tileset);\n return Promise.reject(error);\n });\n\n return 0;\n}\n\nfunction singleContentFailed(tile, tileset) {\n if (tile._contentState === Cesium3DTileContentState.PROCESSING) {\n --tileset.statistics.numberOfTilesProcessing;\n } else {\n --tileset.statistics.numberOfPendingRequests;\n }\n tile._contentState = Cesium3DTileContentState.FAILED;\n}\n\n/**\n * Given a downloaded content payload, construct a {@link Cesium3DTileContent}.\n * <p>\n * This is only used for single contents.\n * </p>\n *\n * @param {Cesium3DTile} tile The tile\n * @param {ArrayBuffer} arrayBuffer The downloaded payload containing data for the content\n * @return {Cesium3DTileContent} A content object\n * @private\n */\nfunction makeContent(tile, arrayBuffer) {\n const preprocessed = preprocess3DTileContent(arrayBuffer);\n\n // Vector and Geometry tile rendering do not support the skip LOD optimization.\n const tileset = tile._tileset;\n tileset._disableSkipLevelOfDetail =\n tileset._disableSkipLevelOfDetail ||\n preprocessed.contentType === Cesium3DTileContentType.GEOMETRY ||\n preprocessed.contentType === Cesium3DTileContentType.VECTOR;\n\n if (\n preprocessed.contentType === Cesium3DTileContentType.IMPLICIT_SUBTREE ||\n preprocessed.contentType === Cesium3DTileContentType.IMPLICIT_SUBTREE_JSON\n ) {\n tile.hasImplicitContent = true;\n }\n\n if (preprocessed.contentType === Cesium3DTileContentType.EXTERNAL_TILESET) {\n tile.hasTilesetContent = true;\n }\n\n let content;\n const contentFactory = Cesium3DTileContentFactory[preprocessed.contentType];\n if (defined(preprocessed.binaryPayload)) {\n content = contentFactory(\n tileset,\n tile,\n tile._contentResource,\n preprocessed.binaryPayload.buffer,\n 0\n );\n } else {\n // JSON formats\n content = contentFactory(\n tileset,\n tile,\n tile._contentResource,\n preprocessed.jsonPayload\n );\n }\n\n const contentHeader = tile._contentHeader;\n\n if (tile.hasImplicitContentMetadata) {\n const subtree = tile.implicitSubtree;\n const coordinates = tile.implicitCoordinates;\n content.metadata = subtree.getContentMetadataView(coordinates, 0);\n } else if (!tile.hasImplicitContent) {\n content.metadata = findContentMetadata(tileset, contentHeader);\n }\n\n const groupMetadata = findGroupMetadata(tileset, contentHeader);\n if (defined(groupMetadata)) {\n content.group = new Cesium3DContentGroup({\n metadata: groupMetadata,\n });\n }\n\n return content;\n}\n\n/**\n * Cancel requests for the tile's contents. This is called when the tile\n * goes out of view.\n *\n * @private\n */\nCesium3DTile.prototype.cancelRequests = function () {\n if (this.hasMultipleContents) {\n this._content.cancelRequests();\n } else {\n this._request.cancel();\n }\n};\n\n/**\n * Unloads the tile's content.\n *\n * @private\n */\nCesium3DTile.prototype.unloadContent = function () {\n if (\n this.hasEmptyContent ||\n this.hasTilesetContent ||\n this.hasImplicitContent\n ) {\n return;\n }\n\n this._content = this._content && this._content.destroy();\n this._contentState = Cesium3DTileContentState.UNLOADED;\n this._contentReadyToProcessPromise = undefined;\n this._contentReadyPromise = undefined;\n\n this.lastStyleTime = 0.0;\n this.clippingPlanesDirty = this._clippingPlanesState === 0;\n this._clippingPlanesState = 0;\n\n this._debugColorizeTiles = false;\n\n this._debugBoundingVolume =\n this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n this._debugContentBoundingVolume =\n this._debugContentBoundingVolume &&\n this._debugContentBoundingVolume.destroy();\n this._debugViewerRequestVolume =\n this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n};\n\nconst scratchProjectedBoundingSphere = new BoundingSphere();\n\nfunction getBoundingVolume(tile, frameState) {\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n !defined(tile._boundingVolume2D)\n ) {\n const boundingSphere = tile._boundingVolume.boundingSphere;\n const sphere = BoundingSphere.projectTo2D(\n boundingSphere,\n frameState.mapProjection,\n scratchProjectedBoundingSphere\n );\n tile._boundingVolume2D = new TileBoundingSphere(\n sphere.center,\n sphere.radius\n );\n }\n\n return frameState.mode !== SceneMode.SCENE3D\n ? tile._boundingVolume2D\n : tile._boundingVolume;\n}\n\nfunction getContentBoundingVolume(tile, frameState) {\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n !defined(tile._contentBoundingVolume2D)\n ) {\n const boundingSphere = tile._contentBoundingVolume.boundingSphere;\n const sphere = BoundingSphere.projectTo2D(\n boundingSphere,\n frameState.mapProjection,\n scratchProjectedBoundingSphere\n );\n tile._contentBoundingVolume2D = new TileBoundingSphere(\n sphere.center,\n sphere.radius\n );\n }\n return frameState.mode !== SceneMode.SCENE3D\n ? tile._contentBoundingVolume2D\n : tile._contentBoundingVolume;\n}\n\n/**\n * Determines whether the tile's bounding volume intersects the culling volume.\n *\n * @param {FrameState} frameState The frame state.\n * @param {Number} parentVisibilityPlaneMask The parent's plane mask to speed up the visibility check.\n * @returns {Number} A plane mask as described above in {@link CullingVolume#computeVisibilityWithPlaneMask}.\n *\n * @private\n */\nCesium3DTile.prototype.visibility = function (\n frameState,\n parentVisibilityPlaneMask\n) {\n const cullingVolume = frameState.cullingVolume;\n const boundingVolume = getBoundingVolume(this, frameState);\n\n const tileset = this._tileset;\n const clippingPlanes = tileset.clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n boundingVolume,\n tileset.clippingPlanesOriginMatrix\n );\n this._isClipped = intersection !== Intersect.INSIDE;\n if (intersection === Intersect.OUTSIDE) {\n return CullingVolume.MASK_OUTSIDE;\n }\n }\n\n return cullingVolume.computeVisibilityWithPlaneMask(\n boundingVolume,\n parentVisibilityPlaneMask\n );\n};\n\n/**\n * Assuming the tile's bounding volume intersects the culling volume, determines\n * whether the tile's content's bounding volume intersects the culling volume.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Intersect} The result of the intersection: the tile's content is completely outside, completely inside, or intersecting the culling volume.\n *\n * @private\n */\nCesium3DTile.prototype.contentVisibility = function (frameState) {\n // Assumes the tile's bounding volume intersects the culling volume already, so\n // just return Intersect.INSIDE if there is no content bounding volume.\n if (!defined(this._contentBoundingVolume)) {\n return Intersect.INSIDE;\n }\n\n if (this._visibilityPlaneMask === CullingVolume.MASK_INSIDE) {\n // The tile's bounding volume is completely inside the culling volume so\n // the content bounding volume must also be inside.\n return Intersect.INSIDE;\n }\n\n // PERFORMANCE_IDEA: is it possible to burn less CPU on this test since we know the\n // tile's (not the content's) bounding volume intersects the culling volume?\n const cullingVolume = frameState.cullingVolume;\n const boundingVolume = getContentBoundingVolume(this, frameState);\n\n const tileset = this._tileset;\n const clippingPlanes = tileset.clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n boundingVolume,\n tileset.clippingPlanesOriginMatrix\n );\n this._isClipped = intersection !== Intersect.INSIDE;\n if (intersection === Intersect.OUTSIDE) {\n return Intersect.OUTSIDE;\n }\n }\n\n return cullingVolume.computeVisibility(boundingVolume);\n};\n\n/**\n * Computes the (potentially approximate) distance from the closest point of the tile's bounding volume to the camera.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Number} The distance, in meters, or zero if the camera is inside the bounding volume.\n *\n * @private\n */\nCesium3DTile.prototype.distanceToTile = function (frameState) {\n const boundingVolume = getBoundingVolume(this, frameState);\n return boundingVolume.distanceToCamera(frameState);\n};\n\nconst scratchToTileCenter = new Cartesian3();\n\n/**\n * Computes the distance from the center of the tile's bounding volume to the camera's plane defined by its position and view direction.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Number} The distance, in meters.\n *\n * @private\n */\nCesium3DTile.prototype.distanceToTileCenter = function (frameState) {\n const tileBoundingVolume = getBoundingVolume(this, frameState);\n const boundingVolume = tileBoundingVolume.boundingVolume; // Gets the underlying OrientedBoundingBox or BoundingSphere\n const toCenter = Cartesian3.subtract(\n boundingVolume.center,\n frameState.camera.positionWC,\n scratchToTileCenter\n );\n return Cartesian3.dot(frameState.camera.directionWC, toCenter);\n};\n\n/**\n * Checks if the camera is inside the viewer request volume.\n *\n * @param {FrameState} frameState The frame state.\n * @returns {Boolean} Whether the camera is inside the volume.\n *\n * @private\n */\nCesium3DTile.prototype.insideViewerRequestVolume = function (frameState) {\n const viewerRequestVolume = this._viewerRequestVolume;\n return (\n !defined(viewerRequestVolume) ||\n viewerRequestVolume.distanceToCamera(frameState) === 0.0\n );\n};\n\nconst scratchMatrix = new Matrix3();\nconst scratchScale = new Cartesian3();\nconst scratchHalfAxes = new Matrix3();\nconst scratchCenter = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratchOrientedBoundingBox = new OrientedBoundingBox();\nconst scratchTransform = new Matrix4();\n\nfunction createBox(box, transform, result) {\n let center = Cartesian3.fromElements(box[0], box[1], box[2], scratchCenter);\n let halfAxes = Matrix3.fromArray(box, 3, scratchHalfAxes);\n\n // Find the transformed center and halfAxes\n center = Matrix4.multiplyByPoint(transform, center, center);\n const rotationScale = Matrix4.getMatrix3(transform, scratchMatrix);\n halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);\n\n if (defined(result)) {\n result.update(center, halfAxes);\n return result;\n }\n return new TileOrientedBoundingBox(center, halfAxes);\n}\n\nfunction createBoxFromTransformedRegion(\n region,\n transform,\n initialTransform,\n result\n) {\n const rectangle = Rectangle.unpack(region, 0, scratchRectangle);\n const minimumHeight = region[4];\n const maximumHeight = region[5];\n\n const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n rectangle,\n minimumHeight,\n maximumHeight,\n Ellipsoid.WGS84,\n scratchOrientedBoundingBox\n );\n let center = orientedBoundingBox.center;\n let halfAxes = orientedBoundingBox.halfAxes;\n\n // A region bounding volume is not transformed by the transform in the tileset JSON,\n // but may be transformed by additional transforms applied in Cesium.\n // This is why the transform is calculated as the difference between the initial transform and the current transform.\n transform = Matrix4.multiplyTransformation(\n transform,\n Matrix4.inverseTransformation(initialTransform, scratchTransform),\n scratchTransform\n );\n center = Matrix4.multiplyByPoint(transform, center, center);\n const rotationScale = Matrix4.getMatrix3(transform, scratchMatrix);\n halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);\n\n if (defined(result) && result instanceof TileOrientedBoundingBox) {\n result.update(center, halfAxes);\n return result;\n }\n\n return new TileOrientedBoundingBox(center, halfAxes);\n}\n\nfunction createRegion(region, transform, initialTransform, result) {\n if (\n !Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)\n ) {\n return createBoxFromTransformedRegion(\n region,\n transform,\n initialTransform,\n result\n );\n }\n\n if (defined(result)) {\n return result;\n }\n\n const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);\n\n return new TileBoundingRegion({\n rectangle: rectangleRegion,\n minimumHeight: region[4],\n maximumHeight: region[5],\n });\n}\n\nfunction createSphere(sphere, transform, result) {\n let center = Cartesian3.fromElements(\n sphere[0],\n sphere[1],\n sphere[2],\n scratchCenter\n );\n let radius = sphere[3];\n\n // Find the transformed center and radius\n center = Matrix4.multiplyByPoint(transform, center, center);\n const scale = Matrix4.getScale(transform, scratchScale);\n const uniformScale = Cartesian3.maximumComponent(scale);\n radius *= uniformScale;\n\n if (defined(result)) {\n result.update(center, radius);\n return result;\n }\n return new TileBoundingSphere(center, radius);\n}\n\n/**\n * Create a bounding volume from the tile's bounding volume header.\n *\n * @param {Object} boundingVolumeHeader The tile's bounding volume header.\n * @param {Matrix4} transform The transform to apply to the bounding volume.\n * @param {TileBoundingVolume} [result] The object onto which to store the result.\n *\n * @returns {TileBoundingVolume} The modified result parameter or a new TileBoundingVolume instance if none was provided.\n *\n * @private\n */\nCesium3DTile.prototype.createBoundingVolume = function (\n boundingVolumeHeader,\n transform,\n result\n) {\n if (!defined(boundingVolumeHeader)) {\n throw new RuntimeError(\"boundingVolume must be defined\");\n }\n\n if (hasExtension(boundingVolumeHeader, \"3DTILES_bounding_volume_S2\")) {\n return new TileBoundingS2Cell(\n boundingVolumeHeader.extensions[\"3DTILES_bounding_volume_S2\"]\n );\n }\n\n if (defined(boundingVolumeHeader.box)) {\n return createBox(boundingVolumeHeader.box, transform, result);\n }\n if (defined(boundingVolumeHeader.region)) {\n return createRegion(\n boundingVolumeHeader.region,\n transform,\n this._initialTransform,\n result\n );\n }\n if (defined(boundingVolumeHeader.sphere)) {\n return createSphere(boundingVolumeHeader.sphere, transform, result);\n }\n throw new RuntimeError(\n \"boundingVolume must contain a sphere, region, or box\"\n );\n};\n\n/**\n * Update the tile's transform. The transform is applied to the tile's bounding volumes.\n *\n * @private\n */\nCesium3DTile.prototype.updateTransform = function (parentTransform) {\n parentTransform = defaultValue(parentTransform, Matrix4.IDENTITY);\n const computedTransform = Matrix4.multiply(\n parentTransform,\n this.transform,\n scratchTransform\n );\n const transformChanged = !Matrix4.equals(\n computedTransform,\n this.computedTransform\n );\n\n if (!transformChanged) {\n return;\n }\n\n Matrix4.clone(computedTransform, this.computedTransform);\n\n // Update the bounding volumes\n const header = this._header;\n const contentHeader = this._contentHeader;\n this._boundingVolume = this.createBoundingVolume(\n header.boundingVolume,\n this.computedTransform,\n this._boundingVolume\n );\n if (defined(this._contentBoundingVolume)) {\n this._contentBoundingVolume = this.createBoundingVolume(\n contentHeader.boundingVolume,\n this.computedTransform,\n this._contentBoundingVolume\n );\n }\n if (defined(this._viewerRequestVolume)) {\n this._viewerRequestVolume = this.createBoundingVolume(\n header.viewerRequestVolume,\n this.computedTransform,\n this._viewerRequestVolume\n );\n }\n\n this.updateGeometricErrorScale();\n\n // Destroy the debug bounding volumes. They will be generated fresh.\n this._debugBoundingVolume =\n this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n this._debugContentBoundingVolume =\n this._debugContentBoundingVolume &&\n this._debugContentBoundingVolume.destroy();\n this._debugViewerRequestVolume =\n this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n};\n\nCesium3DTile.prototype.updateGeometricErrorScale = function () {\n const scale = Matrix4.getScale(this.computedTransform, scratchScale);\n const uniformScale = Cartesian3.maximumComponent(scale);\n this.geometricError = this._geometricError * uniformScale;\n};\n\nfunction applyDebugSettings(tile, tileset, frameState, passOptions) {\n if (!passOptions.isRender) {\n return;\n }\n\n const hasContentBoundingVolume =\n defined(tile._contentHeader) && defined(tile._contentHeader.boundingVolume);\n const empty =\n tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent;\n\n const showVolume =\n tileset.debugShowBoundingVolume ||\n (tileset.debugShowContentBoundingVolume && !hasContentBoundingVolume);\n if (showVolume) {\n let color;\n if (!tile._finalResolution) {\n color = Color.YELLOW;\n } else if (empty) {\n color = Color.DARKGRAY;\n } else {\n color = Color.WHITE;\n }\n if (!defined(tile._debugBoundingVolume)) {\n tile._debugBoundingVolume = tile._boundingVolume.createDebugVolume(color);\n }\n tile._debugBoundingVolume.update(frameState);\n const attributes = tile._debugBoundingVolume.getGeometryInstanceAttributes(\n \"outline\"\n );\n attributes.color = ColorGeometryInstanceAttribute.toValue(\n color,\n attributes.color\n );\n } else if (!showVolume && defined(tile._debugBoundingVolume)) {\n tile._debugBoundingVolume = tile._debugBoundingVolume.destroy();\n }\n\n if (tileset.debugShowContentBoundingVolume && hasContentBoundingVolume) {\n if (!defined(tile._debugContentBoundingVolume)) {\n tile._debugContentBoundingVolume = tile._contentBoundingVolume.createDebugVolume(\n Color.BLUE\n );\n }\n tile._debugContentBoundingVolume.update(frameState);\n } else if (\n !tileset.debugShowContentBoundingVolume &&\n defined(tile._debugContentBoundingVolume)\n ) {\n tile._debugContentBoundingVolume = tile._debugContentBoundingVolume.destroy();\n }\n\n if (\n tileset.debugShowViewerRequestVolume &&\n defined(tile._viewerRequestVolume)\n ) {\n if (!defined(tile._debugViewerRequestVolume)) {\n tile._debugViewerRequestVolume = tile._viewerRequestVolume.createDebugVolume(\n Color.YELLOW\n );\n }\n tile._debugViewerRequestVolume.update(frameState);\n } else if (\n !tileset.debugShowViewerRequestVolume &&\n defined(tile._debugViewerRequestVolume)\n ) {\n tile._debugViewerRequestVolume = tile._debugViewerRequestVolume.destroy();\n }\n\n const debugColorizeTilesOn =\n (tileset.debugColorizeTiles && !tile._debugColorizeTiles) ||\n defined(tileset._heatmap.tilePropertyName);\n const debugColorizeTilesOff =\n !tileset.debugColorizeTiles && tile._debugColorizeTiles;\n\n if (debugColorizeTilesOn) {\n tileset._heatmap.colorize(tile, frameState); // Skipped if tileset._heatmap.tilePropertyName is undefined\n tile._debugColorizeTiles = true;\n tile.color = tile._debugColor;\n } else if (debugColorizeTilesOff) {\n tile._debugColorizeTiles = false;\n tile.color = Color.WHITE;\n }\n\n if (tile._colorDirty) {\n tile._colorDirty = false;\n tile._content.applyDebugSettings(true, tile._color);\n }\n\n if (debugColorizeTilesOff) {\n tileset.makeStyleDirty(); // Re-apply style now that colorize is switched off\n }\n}\n\nfunction updateContent(tile, tileset, frameState) {\n const content = tile._content;\n const expiredContent = tile._expiredContent;\n\n // expired content is not supported for multiple contents\n if (!tile.hasMultipleContents && defined(expiredContent)) {\n if (!tile.contentReady) {\n // Render the expired content while the content loads\n expiredContent.update(tileset, frameState);\n return;\n }\n\n // New content is ready, destroy expired content\n tile._expiredContent.destroy();\n tile._expiredContent = undefined;\n }\n\n content.update(tileset, frameState);\n}\n\nfunction updateClippingPlanes(tile, tileset) {\n // Compute and compare ClippingPlanes state:\n // - enabled-ness - are clipping planes enabled? is this tile clipped?\n // - clipping plane count\n // - clipping function (union v. intersection)\n const clippingPlanes = tileset.clippingPlanes;\n let currentClippingPlanesState = 0;\n if (defined(clippingPlanes) && tile._isClipped && clippingPlanes.enabled) {\n currentClippingPlanesState = clippingPlanes.clippingPlanesState;\n }\n // If clippingPlaneState for tile changed, mark clippingPlanesDirty so content can update\n if (currentClippingPlanesState !== tile._clippingPlanesState) {\n tile._clippingPlanesState = currentClippingPlanesState;\n tile.clippingPlanesDirty = true;\n }\n}\n\n/**\n * Get the draw commands needed to render this tile.\n *\n * @private\n */\nCesium3DTile.prototype.update = function (tileset, frameState, passOptions) {\n const commandStart = frameState.commandList.length;\n\n updateClippingPlanes(this, tileset);\n applyDebugSettings(this, tileset, frameState, passOptions);\n updateContent(this, tileset, frameState);\n\n const commandEnd = frameState.commandList.length;\n const commandsLength = commandEnd - commandStart;\n this._commandsLength = commandsLength;\n\n for (let i = 0; i < commandsLength; ++i) {\n const command = frameState.commandList[commandStart + i];\n const translucent = command.pass === Pass.TRANSLUCENT;\n command.depthForTranslucentClassification = translucent;\n }\n\n this.clippingPlanesDirty = false; // reset after content update\n};\n\nconst scratchCommandList = [];\n\n/**\n * Processes the tile's content, e.g., create WebGL resources, to move from the PROCESSING to READY state.\n *\n * @param {Cesium3DTileset} tileset The tileset containing this tile.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCesium3DTile.prototype.process = function (tileset, frameState) {\n const savedCommandList = frameState.commandList;\n frameState.commandList = scratchCommandList;\n\n this._content.update(tileset, frameState);\n\n scratchCommandList.length = 0;\n frameState.commandList = savedCommandList;\n};\n\nfunction isolateDigits(normalizedValue, numberOfDigits, leftShift) {\n const scaled = normalizedValue * Math.pow(10, numberOfDigits);\n const integer = parseInt(scaled);\n return integer * Math.pow(10, leftShift);\n}\n\nfunction priorityNormalizeAndClamp(value, minimum, maximum) {\n return Math.max(\n CesiumMath.normalize(value, minimum, maximum) - CesiumMath.EPSILON7,\n 0.0\n ); // Subtract epsilon since we only want decimal digits present in the output.\n}\n\n/**\n * Sets the priority of the tile based on distance and depth\n * @private\n */\nCesium3DTile.prototype.updatePriority = function () {\n const tileset = this.tileset;\n const preferLeaves = tileset.preferLeaves;\n const minimumPriority = tileset._minimumPriority;\n const maximumPriority = tileset._maximumPriority;\n\n // Combine priority systems together by mapping them into a base 10 number where each priority controls a specific set of digits in the number.\n // For number priorities, map them to a 0.xxxxx number then left shift it up into a set number of digits before the decimal point. Chop of the fractional part then left shift again into the position it needs to go.\n // For blending number priorities, normalize them to 0-1 and interpolate to get a combined 0-1 number, then proceed as normal.\n // Booleans can just be 0 or 10^leftshift.\n // Think of digits as penalties since smaller numbers are higher priority. If a tile has some large quantity or has a flag raised it's (usually) penalized for it, expressed as a higher number for the digit.\n // Priority number format: preloadFlightDigits(1) | foveatedDeferDigits(1) | foveatedDigits(4) | preloadProgressiveResolutionDigits(1) | preferredSortingDigits(4) . depthDigits(the decimal digits)\n // Certain flags like preferLeaves will flip / turn off certain digits to get desired load order.\n\n // Setup leftShifts, digit counts, and scales (for booleans)\n const digitsForANumber = 4;\n const digitsForABoolean = 1;\n\n const preferredSortingLeftShift = 0;\n const preferredSortingDigitsCount = digitsForANumber;\n\n const foveatedLeftShift =\n preferredSortingLeftShift + preferredSortingDigitsCount;\n const foveatedDigitsCount = digitsForANumber;\n\n const preloadProgressiveResolutionLeftShift =\n foveatedLeftShift + foveatedDigitsCount;\n const preloadProgressiveResolutionDigitsCount = digitsForABoolean;\n const preloadProgressiveResolutionScale = Math.pow(\n 10,\n preloadProgressiveResolutionLeftShift\n );\n\n const foveatedDeferLeftShift =\n preloadProgressiveResolutionLeftShift +\n preloadProgressiveResolutionDigitsCount;\n const foveatedDeferDigitsCount = digitsForABoolean;\n const foveatedDeferScale = Math.pow(10, foveatedDeferLeftShift);\n\n const preloadFlightLeftShift =\n foveatedDeferLeftShift + foveatedDeferDigitsCount;\n const preloadFlightScale = Math.pow(10, preloadFlightLeftShift);\n\n // Compute the digits for each priority\n let depthDigits = priorityNormalizeAndClamp(\n this._depth,\n minimumPriority.depth,\n maximumPriority.depth\n );\n depthDigits = preferLeaves ? 1.0 - depthDigits : depthDigits;\n\n // Map 0-1 then convert to digit. Include a distance sort when doing non-skipLOD and replacement refinement, helps things like non-skipLOD photogrammetry\n const useDistance =\n !tileset._skipLevelOfDetail && this.refine === Cesium3DTileRefine.REPLACE;\n const normalizedPreferredSorting = useDistance\n ? priorityNormalizeAndClamp(\n this._priorityHolder._distanceToCamera,\n minimumPriority.distance,\n maximumPriority.distance\n )\n : priorityNormalizeAndClamp(\n this._priorityReverseScreenSpaceError,\n minimumPriority.reverseScreenSpaceError,\n maximumPriority.reverseScreenSpaceError\n );\n const preferredSortingDigits = isolateDigits(\n normalizedPreferredSorting,\n preferredSortingDigitsCount,\n preferredSortingLeftShift\n );\n\n const preloadProgressiveResolutionDigits = this._priorityProgressiveResolution\n ? 0\n : preloadProgressiveResolutionScale;\n\n const normalizedFoveatedFactor = priorityNormalizeAndClamp(\n this._priorityHolder._foveatedFactor,\n minimumPriority.foveatedFactor,\n maximumPriority.foveatedFactor\n );\n const foveatedDigits = isolateDigits(\n normalizedFoveatedFactor,\n foveatedDigitsCount,\n foveatedLeftShift\n );\n\n const foveatedDeferDigits = this.priorityDeferred ? foveatedDeferScale : 0;\n\n const preloadFlightDigits =\n tileset._pass === Cesium3DTilePass.PRELOAD_FLIGHT ? 0 : preloadFlightScale;\n\n // Get the final base 10 number\n this._priority =\n depthDigits +\n preferredSortingDigits +\n preloadProgressiveResolutionDigits +\n foveatedDigits +\n foveatedDeferDigits +\n preloadFlightDigits;\n};\n\n/**\n * @private\n */\nCesium3DTile.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * @private\n */\nCesium3DTile.prototype.destroy = function () {\n // For the interval between new content being requested and downloaded, expiredContent === content, so don't destroy twice\n this._content = this._content && this._content.destroy();\n this._expiredContent =\n this._expiredContent &&\n !this._expiredContent.isDestroyed() &&\n this._expiredContent.destroy();\n this._debugBoundingVolume =\n this._debugBoundingVolume && this._debugBoundingVolume.destroy();\n this._debugContentBoundingVolume =\n this._debugContentBoundingVolume &&\n this._debugContentBoundingVolume.destroy();\n this._debugViewerRequestVolume =\n this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();\n return destroyObject(this);\n};\nexport default Cesium3DTile;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about a group of {@link Cesium3DTileContent}\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.id The ID of the group.\n * @param {Object} options.group The group JSON object.\n * @param {MetadataClass} options.class The class that group metadata conforms to.\n *\n * @alias GroupMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction GroupMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const id = options.id;\n const group = options.group;\n const metadataClass = options.class;\n\n const properties = defined(group.properties) ? group.properties : {};\n\n this._class = metadataClass;\n this._properties = properties;\n this._id = id;\n this._extras = group.extras;\n this._extensions = group.extensions;\n}\n\nObject.defineProperties(GroupMetadata.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof GroupMetadata.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * The ID of the group.\n *\n * @memberof GroupMetadata.prototype\n * @type {String}\n * @readonly\n * @private\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof GroupMetadata.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof GroupMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the group has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the group has this property.\n * @private\n */\nGroupMetadata.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the group has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the group has a property with the given semantic.\n * @private\n */\nGroupMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nGroupMetadata.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the group does not have this property.\n * @private\n */\nGroupMetadata.prototype.getProperty = function (propertyId) {\n return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nGroupMetadata.prototype.setProperty = function (propertyId, value) {\n return MetadataEntity.setProperty(\n propertyId,\n value,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the group does not have this semantic.\n * @private\n */\nGroupMetadata.prototype.getPropertyBySemantic = function (semantic) {\n return MetadataEntity.getPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nGroupMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n return MetadataEntity.setPropertyBySemantic(\n semantic,\n value,\n this._properties,\n this._class\n );\n};\n\nexport default GroupMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport MetadataEntity from \"./MetadataEntity.js\";\n\n/**\n * Metadata about the tileset.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.tileset The tileset metadata JSON object.\n * @param {MetadataClass} options.class The class that tileset metadata conforms to.\n *\n * @alias TilesetMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TilesetMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const tileset = options.tileset;\n const metadataClass = options.class;\n\n const properties = defined(tileset.properties) ? tileset.properties : {};\n\n this._class = metadataClass;\n this._properties = properties;\n this._extras = tileset.extras;\n this._extensions = tileset.extensions;\n}\n\nObject.defineProperties(TilesetMetadata.prototype, {\n /**\n * The class that properties conform to.\n *\n * @memberof TilesetMetadata.prototype\n * @type {MetadataClass}\n * @readonly\n * @private\n */\n class: {\n get: function () {\n return this._class;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof TilesetMetadata.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof TilesetMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\n/**\n * Returns whether the tileset has this property.\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {Boolean} Whether the tileset has this property.\n * @private\n */\nTilesetMetadata.prototype.hasProperty = function (propertyId) {\n return MetadataEntity.hasProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Returns whether the tileset has a property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {Boolean} Whether the tileset has a property with the given semantic.\n * @private\n */\nTilesetMetadata.prototype.hasPropertyBySemantic = function (semantic) {\n return MetadataEntity.hasPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns an array of property IDs.\n *\n * @param {String[]} [results] An array into which to store the results.\n * @returns {String[]} The property IDs.\n * @private\n */\nTilesetMetadata.prototype.getPropertyIds = function (results) {\n return MetadataEntity.getPropertyIds(this._properties, this._class, results);\n};\n\n/**\n * Returns a copy of the value of the property with the given ID.\n * <p>\n * If the property is normalized the normalized value is returned.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tileset does not have this property.\n * @private\n */\nTilesetMetadata.prototype.getProperty = function (propertyId) {\n return MetadataEntity.getProperty(propertyId, this._properties, this._class);\n};\n\n/**\n * Sets the value of the property with the given ID.\n * <p>\n * If the property is normalized a normalized value must be provided to this function.\n * </p>\n *\n * @param {String} propertyId The case-sensitive ID of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTilesetMetadata.prototype.setProperty = function (propertyId, value) {\n return MetadataEntity.setProperty(\n propertyId,\n value,\n this._properties,\n this._class\n );\n};\n\n/**\n * Returns a copy of the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @returns {*} The value of the property or <code>undefined</code> if the tileset does not have this semantic.\n * @private\n */\nTilesetMetadata.prototype.getPropertyBySemantic = function (semantic) {\n return MetadataEntity.getPropertyBySemantic(\n semantic,\n this._properties,\n this._class\n );\n};\n\n/**\n * Sets the value of the property with the given semantic.\n *\n * @param {String} semantic The case-sensitive semantic of the property.\n * @param {*} value The value of the property that will be copied.\n * @returns {Boolean} <code>true</code> if the property was set, <code>false</code> otherwise.\n * @private\n */\nTilesetMetadata.prototype.setPropertyBySemantic = function (semantic, value) {\n return MetadataEntity.setPropertyBySemantic(\n semantic,\n value,\n this._properties,\n this._class\n );\n};\n\nexport default TilesetMetadata;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport GroupMetadata from \"./GroupMetadata.js\";\nimport TilesetMetadata from \"./TilesetMetadata.js\";\n\n/**\n * An object containing metadata about a 3D Tileset.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension} for 3D Tiles.\n * </p>\n * <p>\n * This object represents the tileset JSON (3D Tiles 1.1) or the <code>3DTILES_metadata</code> object that contains\n * the schema ({@link MetadataSchema}), tileset metadata ({@link TilesetMetadata}), group metadata (dictionary of {@link GroupMetadata}), and metadata statistics (dictionary)\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} options.metadataJson Either the tileset JSON (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension object that contains the tileset metadata.\n * @param {MetadataSchema} options.schema The parsed schema.\n *\n * @alias Cesium3DTilesetMetadata\n * @constructor\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction Cesium3DTilesetMetadata(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const metadataJson = options.metadataJson;\n\n // The calling code is responsible for loading the schema.\n // This keeps metadata parsing synchronous.\n const schema = options.schema;\n\n // An older schema stored the tileset metadata in the \"tileset\" property.\n const metadata = defaultValue(metadataJson.metadata, metadataJson.tileset);\n\n let tileset;\n if (defined(metadata)) {\n tileset = new TilesetMetadata({\n tileset: metadata,\n class: schema.classes[metadata.class],\n });\n }\n\n let groupIds = [];\n const groups = [];\n const groupsJson = metadataJson.groups;\n if (Array.isArray(groupsJson)) {\n const length = groupsJson.length;\n for (let i = 0; i < length; i++) {\n const group = groupsJson[i];\n groups.push(\n new GroupMetadata({\n group: group,\n class: schema.classes[group.class],\n })\n );\n }\n } else if (defined(groupsJson)) {\n // An older version of group metadata stored groups in a dictionary\n // instead of an array.\n groupIds = Object.keys(groupsJson).sort();\n const length = groupIds.length;\n for (let i = 0; i < length; i++) {\n const groupId = groupIds[i];\n if (groupsJson.hasOwnProperty(groupId)) {\n const group = groupsJson[groupId];\n groups.push(\n new GroupMetadata({\n id: groupId,\n group: groupsJson[groupId],\n class: schema.classes[group.class],\n })\n );\n }\n }\n }\n\n this._schema = schema;\n this._groups = groups;\n this._groupIds = groupIds;\n this._tileset = tileset;\n\n this._statistics = metadataJson.statistics;\n this._extras = metadataJson.extras;\n this._extensions = metadataJson.extensions;\n}\n\nObject.defineProperties(Cesium3DTilesetMetadata.prototype, {\n /**\n * Schema containing classes and enums.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {MetadataSchema}\n * @readonly\n * @private\n */\n schema: {\n get: function () {\n return this._schema;\n },\n },\n\n /**\n * Metadata about groups of content.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {GroupMetadata[]}\n * @readonly\n * @private\n */\n groups: {\n get: function () {\n return this._groups;\n },\n },\n\n /**\n * The IDs of the group metadata in the corresponding groups dictionary.\n * Only populated if using the legacy schema.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {String[]}\n * @readonly\n * @private\n */\n groupIds: {\n get: function () {\n return this._groupIds;\n },\n },\n\n /**\n * Metadata about the tileset as a whole.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {TilesetMetadata}\n * @readonly\n * @private\n */\n tileset: {\n get: function () {\n return this._tileset;\n },\n },\n\n /**\n * Statistics about the metadata.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_metadata/schema/statistics.schema.json|statistics schema reference}\n * in the 3D Tiles spec for the full set of properties.\n * </p>\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n statistics: {\n get: function () {\n return this._statistics;\n },\n },\n\n /**\n * Extras in the JSON object.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {*}\n * @readonly\n * @private\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * Extensions in the JSON object.\n *\n * @memberof Cesium3DTilesetMetadata.prototype\n * @type {Object}\n * @readonly\n * @private\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n});\n\nexport default Cesium3DTilesetMetadata;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Cesium3DTileOptimizationHint from \"./Cesium3DTileOptimizationHint.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\n\n/**\n * Utility functions for computing optimization hints for a {@link Cesium3DTileset}.\n *\n * @namespace Cesium3DTileOptimizations\n *\n * @private\n */\nconst Cesium3DTileOptimizations = {};\n\nconst scratchAxis = new Cartesian3();\n\n/**\n * Evaluates support for the childrenWithinParent optimization. This is used to more tightly cull tilesets if\n * children bounds are fully contained within the parent. Currently, support for the optimization only works for\n * oriented bounding boxes, so both the child and parent tile must be either a {@link TileOrientedBoundingBox} or\n * {@link TileBoundingRegion}. The purpose of this check is to prevent use of a culling optimization when the child\n * bounds exceed those of the parent. If the child bounds are greater, it is more likely that the optimization will\n * waste CPU cycles. Bounding spheres are not supported for the reason that the child bounds can very often be\n * partially outside of the parent bounds.\n *\n * @param {Cesium3DTile} tile The tile to check.\n * @returns {Boolean} Whether the childrenWithinParent optimization is supported.\n */\nCesium3DTileOptimizations.checkChildrenWithinParent = function (tile) {\n const children = tile.children;\n const length = children.length;\n\n // Check if the parent has an oriented bounding box.\n const boundingVolume = tile.boundingVolume;\n if (\n boundingVolume instanceof TileOrientedBoundingBox ||\n boundingVolume instanceof TileBoundingRegion\n ) {\n const orientedBoundingBox = boundingVolume._orientedBoundingBox;\n tile._optimChildrenWithinParent =\n Cesium3DTileOptimizationHint.USE_OPTIMIZATION;\n for (let i = 0; i < length; ++i) {\n const child = children[i];\n\n // Check if the child has an oriented bounding box.\n const childBoundingVolume = child.boundingVolume;\n if (\n !(\n childBoundingVolume instanceof TileOrientedBoundingBox ||\n childBoundingVolume instanceof TileBoundingRegion\n )\n ) {\n // Do not support if the parent and child both do not have oriented bounding boxes.\n tile._optimChildrenWithinParent =\n Cesium3DTileOptimizationHint.SKIP_OPTIMIZATION;\n break;\n }\n\n const childOrientedBoundingBox = childBoundingVolume._orientedBoundingBox;\n\n // Compute the axis from the parent to the child.\n const axis = Cartesian3.subtract(\n childOrientedBoundingBox.center,\n orientedBoundingBox.center,\n scratchAxis\n );\n const axisLength = Cartesian3.magnitude(axis);\n Cartesian3.divideByScalar(axis, axisLength, axis);\n\n // Project the bounding box of the parent onto the axis. Because the axis is a ray from the parent\n // to the child, the projection parameterized along the ray will be (+/- proj1).\n const proj1 =\n Math.abs(orientedBoundingBox.halfAxes[0] * axis.x) +\n Math.abs(orientedBoundingBox.halfAxes[1] * axis.y) +\n Math.abs(orientedBoundingBox.halfAxes[2] * axis.z) +\n Math.abs(orientedBoundingBox.halfAxes[3] * axis.x) +\n Math.abs(orientedBoundingBox.halfAxes[4] * axis.y) +\n Math.abs(orientedBoundingBox.halfAxes[5] * axis.z) +\n Math.abs(orientedBoundingBox.halfAxes[6] * axis.x) +\n Math.abs(orientedBoundingBox.halfAxes[7] * axis.y) +\n Math.abs(orientedBoundingBox.halfAxes[8] * axis.z);\n\n // Project the bounding box of the child onto the axis. Because the axis is a ray from the parent\n // to the child, the projection parameterized along the ray will be (+/- proj2) + axis.length.\n const proj2 =\n Math.abs(childOrientedBoundingBox.halfAxes[0] * axis.x) +\n Math.abs(childOrientedBoundingBox.halfAxes[1] * axis.y) +\n Math.abs(childOrientedBoundingBox.halfAxes[2] * axis.z) +\n Math.abs(childOrientedBoundingBox.halfAxes[3] * axis.x) +\n Math.abs(childOrientedBoundingBox.halfAxes[4] * axis.y) +\n Math.abs(childOrientedBoundingBox.halfAxes[5] * axis.z) +\n Math.abs(childOrientedBoundingBox.halfAxes[6] * axis.x) +\n Math.abs(childOrientedBoundingBox.halfAxes[7] * axis.y) +\n Math.abs(childOrientedBoundingBox.halfAxes[8] * axis.z);\n\n // If the child extends the parent's bounds, the optimization is not valid and we skip it.\n if (proj1 <= proj2 + axisLength) {\n tile._optimChildrenWithinParent =\n Cesium3DTileOptimizationHint.SKIP_OPTIMIZATION;\n break;\n }\n }\n }\n\n return (\n tile._optimChildrenWithinParent ===\n Cesium3DTileOptimizationHint.USE_OPTIMIZATION\n );\n};\nexport default Cesium3DTileOptimizations;\n", "import defined from \"./defined.js\";\n\n/**\n * @private\n */\nfunction DoublyLinkedList() {\n this.head = undefined;\n this.tail = undefined;\n this._length = 0;\n}\n\nObject.defineProperties(DoublyLinkedList.prototype, {\n length: {\n get: function () {\n return this._length;\n },\n },\n});\n\n/**\n * @private\n */\nfunction DoublyLinkedListNode(item, previous, next) {\n this.item = item;\n this.previous = previous;\n this.next = next;\n}\n\n/**\n * Adds the item to the end of the list\n * @param {*} [item]\n * @return {DoublyLinkedListNode}\n */\nDoublyLinkedList.prototype.add = function (item) {\n const node = new DoublyLinkedListNode(item, this.tail, undefined);\n\n if (defined(this.tail)) {\n this.tail.next = node;\n this.tail = node;\n } else {\n this.head = node;\n this.tail = node;\n }\n\n ++this._length;\n\n return node;\n};\n\nfunction remove(list, node) {\n if (defined(node.previous) && defined(node.next)) {\n node.previous.next = node.next;\n node.next.previous = node.previous;\n } else if (defined(node.previous)) {\n // Remove last node\n node.previous.next = undefined;\n list.tail = node.previous;\n } else if (defined(node.next)) {\n // Remove first node\n node.next.previous = undefined;\n list.head = node.next;\n } else {\n // Remove last node in the linked list\n list.head = undefined;\n list.tail = undefined;\n }\n\n node.next = undefined;\n node.previous = undefined;\n}\n\n/**\n * Removes the given node from the list\n * @param {DoublyLinkedListNode} node\n */\nDoublyLinkedList.prototype.remove = function (node) {\n if (!defined(node)) {\n return;\n }\n\n remove(this, node);\n\n --this._length;\n};\n\n/**\n * Moves nextNode after node\n * @param {DoublyLinkedListNode} node\n * @param {DoublyLinkedListNode} nextNode\n */\nDoublyLinkedList.prototype.splice = function (node, nextNode) {\n if (node === nextNode) {\n return;\n }\n\n // Remove nextNode, then insert after node\n remove(this, nextNode);\n\n const oldNodeNext = node.next;\n node.next = nextNode;\n\n // nextNode is the new tail\n if (this.tail === node) {\n this.tail = nextNode;\n } else {\n oldNodeNext.previous = nextNode;\n }\n\n nextNode.next = oldNodeNext;\n nextNode.previous = node;\n};\nexport default DoublyLinkedList;\n", "import defined from \"../Core/defined.js\";\nimport DoublyLinkedList from \"../Core/DoublyLinkedList.js\";\n\n/**\n * Stores tiles with content loaded.\n *\n * @private\n */\nfunction Cesium3DTilesetCache() {\n // [head, sentinel) -> tiles that weren't selected this frame and may be removed from the cache\n // (sentinel, tail] -> tiles that were selected this frame\n this._list = new DoublyLinkedList();\n this._sentinel = this._list.add();\n this._trimTiles = false;\n}\n\nCesium3DTilesetCache.prototype.reset = function () {\n // Move sentinel node to the tail so, at the start of the frame, all tiles\n // may be potentially replaced. Tiles are moved to the right of the sentinel\n // when they are selected so they will not be replaced.\n this._list.splice(this._list.tail, this._sentinel);\n};\n\nCesium3DTilesetCache.prototype.touch = function (tile) {\n const node = tile.cacheNode;\n if (defined(node)) {\n this._list.splice(this._sentinel, node);\n }\n};\n\nCesium3DTilesetCache.prototype.add = function (tile) {\n if (!defined(tile.cacheNode)) {\n tile.cacheNode = this._list.add(tile);\n }\n};\n\nCesium3DTilesetCache.prototype.unloadTile = function (\n tileset,\n tile,\n unloadCallback\n) {\n const node = tile.cacheNode;\n if (!defined(node)) {\n return;\n }\n\n this._list.remove(node);\n tile.cacheNode = undefined;\n unloadCallback(tileset, tile);\n};\n\nCesium3DTilesetCache.prototype.unloadTiles = function (\n tileset,\n unloadCallback\n) {\n const trimTiles = this._trimTiles;\n this._trimTiles = false;\n\n const list = this._list;\n\n const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;\n\n // Traverse the list only to the sentinel since tiles/nodes to the\n // right of the sentinel were used this frame.\n //\n // The sub-list to the left of the sentinel is ordered from LRU to MRU.\n const sentinel = this._sentinel;\n let node = list.head;\n while (\n node !== sentinel &&\n (tileset.totalMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)\n ) {\n const tile = node.item;\n node = node.next;\n this.unloadTile(tileset, tile, unloadCallback);\n }\n};\n\nCesium3DTilesetCache.prototype.trim = function () {\n this._trimTiles = true;\n};\nexport default Cesium3DTilesetCache;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A heatmap colorizer in a {@link Cesium3DTileset}. A tileset can colorize its visible tiles in a heatmap style.\n *\n * @alias Cesium3DTilesetHeatmap\n * @constructor\n * @private\n */\nfunction Cesium3DTilesetHeatmap(tilePropertyName) {\n /**\n * The tile variable to track for heatmap colorization.\n * Tile's will be colorized relative to the other visible tile's values for this variable.\n *\n * @type {String}\n */\n this.tilePropertyName = tilePropertyName;\n\n // Members that are updated every time a tile is colorized\n this._minimum = Number.MAX_VALUE;\n this._maximum = -Number.MAX_VALUE;\n\n // Members that are updated once every frame\n this._previousMinimum = Number.MAX_VALUE;\n this._previousMaximum = -Number.MAX_VALUE;\n\n // If defined uses a reference minimum maximum to colorize by instead of using last frames minimum maximum of rendered tiles.\n // For example, the _loadTimestamp can get a better colorization using setReferenceMinimumMaximum in order to take accurate colored timing diffs of various scenes.\n this._referenceMinimum = {};\n this._referenceMaximum = {};\n}\n\n/**\n * Convert to a usable heatmap value (i.e. a number). Ensures that tile values that aren't stored as numbers can be used for colorization.\n * @private\n */\nfunction getHeatmapValue(tileValue, tilePropertyName) {\n let value;\n if (tilePropertyName === \"_loadTimestamp\") {\n value = JulianDate.toDate(tileValue).getTime();\n } else {\n value = tileValue;\n }\n return value;\n}\n\n/**\n * Sets the reference minimum and maximum for the variable name. Converted to numbers before they are stored.\n *\n * @param {Object} minimum The minimum reference value.\n * @param {Object} maximum The maximum reference value.\n * @param {String} tilePropertyName The tile variable that will use these reference values when it is colorized.\n */\nCesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum = function (\n minimum,\n maximum,\n tilePropertyName\n) {\n this._referenceMinimum[tilePropertyName] = getHeatmapValue(\n minimum,\n tilePropertyName\n );\n this._referenceMaximum[tilePropertyName] = getHeatmapValue(\n maximum,\n tilePropertyName\n );\n};\n\nfunction getHeatmapValueAndUpdateMinimumMaximum(heatmap, tile) {\n const tilePropertyName = heatmap.tilePropertyName;\n if (defined(tilePropertyName)) {\n const heatmapValue = getHeatmapValue(\n tile[tilePropertyName],\n tilePropertyName\n );\n if (!defined(heatmapValue)) {\n heatmap.tilePropertyName = undefined;\n return heatmapValue;\n }\n heatmap._maximum = Math.max(heatmapValue, heatmap._maximum);\n heatmap._minimum = Math.min(heatmapValue, heatmap._minimum);\n return heatmapValue;\n }\n}\n\nconst heatmapColors = [\n new Color(0.1, 0.1, 0.1, 1), // Dark Gray\n new Color(0.153, 0.278, 0.878, 1), // Blue\n new Color(0.827, 0.231, 0.49, 1), // Pink\n new Color(0.827, 0.188, 0.22, 1), // Red\n new Color(1.0, 0.592, 0.259, 1), // Orange\n new Color(1.0, 0.843, 0.0, 1),\n]; // Yellow\n/**\n * Colorize the tile in heat map style based on where it lies within the minimum maximum window.\n * Heatmap colors are black, blue, pink, red, orange, yellow. 'Cold' or low numbers will be black and blue, 'Hot' or high numbers will be orange and yellow,\n * @param {Cesium3DTile} tile The tile to colorize relative to last frame's minimum and maximum values of all visible tiles.\n * @param {FrameState} frameState The frame state.\n */\nCesium3DTilesetHeatmap.prototype.colorize = function (tile, frameState) {\n const tilePropertyName = this.tilePropertyName;\n if (\n !defined(tilePropertyName) ||\n !tile.contentAvailable ||\n tile._selectedFrame !== frameState.frameNumber\n ) {\n return;\n }\n\n const heatmapValue = getHeatmapValueAndUpdateMinimumMaximum(this, tile);\n const minimum = this._previousMinimum;\n const maximum = this._previousMaximum;\n\n if (minimum === Number.MAX_VALUE || maximum === -Number.MAX_VALUE) {\n return;\n }\n\n // Shift the minimum maximum window down to 0\n const shiftedMax = maximum - minimum + CesiumMath.EPSILON7; // Prevent divide by 0\n const shiftedValue = CesiumMath.clamp(\n heatmapValue - minimum,\n 0.0,\n shiftedMax\n );\n\n // Get position between minimum and maximum and convert that to a position in the color array\n const zeroToOne = shiftedValue / shiftedMax;\n const lastIndex = heatmapColors.length - 1.0;\n const colorPosition = zeroToOne * lastIndex;\n\n // Take floor and ceil of the value to get the two colors to lerp between, lerp using the fractional portion\n const colorPositionFloor = Math.floor(colorPosition);\n const colorPositionCeil = Math.ceil(colorPosition);\n const t = colorPosition - colorPositionFloor;\n const colorZero = heatmapColors[colorPositionFloor];\n const colorOne = heatmapColors[colorPositionCeil];\n\n // Perform the lerp\n const finalColor = Color.clone(Color.WHITE);\n finalColor.red = CesiumMath.lerp(colorZero.red, colorOne.red, t);\n finalColor.green = CesiumMath.lerp(colorZero.green, colorOne.green, t);\n finalColor.blue = CesiumMath.lerp(colorZero.blue, colorOne.blue, t);\n tile._debugColor = finalColor;\n};\n\n/**\n * Resets the tracked minimum maximum values for heatmap colorization. Happens right before tileset traversal.\n */\nCesium3DTilesetHeatmap.prototype.resetMinimumMaximum = function () {\n // For heat map colorization\n const tilePropertyName = this.tilePropertyName;\n if (defined(tilePropertyName)) {\n const referenceMinimum = this._referenceMinimum[tilePropertyName];\n const referenceMaximum = this._referenceMaximum[tilePropertyName];\n const useReference = defined(referenceMinimum) && defined(referenceMaximum);\n this._previousMinimum = useReference ? referenceMinimum : this._minimum;\n this._previousMaximum = useReference ? referenceMaximum : this._maximum;\n this._minimum = Number.MAX_VALUE;\n this._maximum = -Number.MAX_VALUE;\n }\n};\nexport default Cesium3DTilesetHeatmap;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTilesetStatistics() {\n // Rendering statistics\n this.selected = 0;\n this.visited = 0;\n // Loading statistics\n this.numberOfCommands = 0;\n this.numberOfAttemptedRequests = 0;\n this.numberOfPendingRequests = 0;\n this.numberOfTilesProcessing = 0;\n this.numberOfTilesWithContentReady = 0; // Number of tiles with content loaded, does not include empty tiles\n this.numberOfTilesTotal = 0; // Number of tiles in tileset JSON (and other tileset JSON files as they are loaded)\n this.numberOfLoadedTilesTotal = 0; // Running total of loaded tiles for the lifetime of the session\n // Features statistics\n this.numberOfFeaturesSelected = 0; // Number of features rendered\n this.numberOfFeaturesLoaded = 0; // Number of features in memory\n this.numberOfPointsSelected = 0;\n this.numberOfPointsLoaded = 0;\n this.numberOfTrianglesSelected = 0;\n // Styling statistics\n this.numberOfTilesStyled = 0;\n this.numberOfFeaturesStyled = 0;\n // Optimization statistics\n this.numberOfTilesCulledWithChildrenUnion = 0;\n // Memory statistics\n this.geometryByteLength = 0;\n this.texturesByteLength = 0;\n this.batchTableByteLength = 0; // batch textures and any binary metadata properties not otherwise accounted for\n}\n\nCesium3DTilesetStatistics.prototype.clear = function () {\n this.selected = 0;\n this.visited = 0;\n this.numberOfCommands = 0;\n this.numberOfAttemptedRequests = 0;\n this.numberOfFeaturesSelected = 0;\n this.numberOfPointsSelected = 0;\n this.numberOfTrianglesSelected = 0;\n this.numberOfTilesStyled = 0;\n this.numberOfFeaturesStyled = 0;\n this.numberOfTilesCulledWithChildrenUnion = 0;\n};\n\nfunction updatePointAndFeatureCounts(statistics, content, decrement, load) {\n const contents = content.innerContents;\n const pointsLength = content.pointsLength;\n const trianglesLength = content.trianglesLength;\n const featuresLength = content.featuresLength;\n const geometryByteLength = content.geometryByteLength;\n const texturesByteLength = content.texturesByteLength;\n const batchTableByteLength = content.batchTableByteLength;\n\n if (load) {\n statistics.numberOfFeaturesLoaded += decrement\n ? -featuresLength\n : featuresLength;\n statistics.numberOfPointsLoaded += decrement ? -pointsLength : pointsLength;\n statistics.geometryByteLength += decrement\n ? -geometryByteLength\n : geometryByteLength;\n statistics.texturesByteLength += decrement\n ? -texturesByteLength\n : texturesByteLength;\n statistics.batchTableByteLength += decrement\n ? -batchTableByteLength\n : batchTableByteLength;\n } else {\n statistics.numberOfFeaturesSelected += decrement\n ? -featuresLength\n : featuresLength;\n statistics.numberOfPointsSelected += decrement\n ? -pointsLength\n : pointsLength;\n statistics.numberOfTrianglesSelected += decrement\n ? -trianglesLength\n : trianglesLength;\n }\n\n if (defined(contents)) {\n const length = contents.length;\n for (let i = 0; i < length; ++i) {\n updatePointAndFeatureCounts(statistics, contents[i], decrement, load);\n }\n }\n}\n\nCesium3DTilesetStatistics.prototype.incrementSelectionCounts = function (\n content\n) {\n updatePointAndFeatureCounts(this, content, false, false);\n};\n\nCesium3DTilesetStatistics.prototype.incrementLoadCounts = function (content) {\n updatePointAndFeatureCounts(this, content, false, true);\n};\n\nCesium3DTilesetStatistics.prototype.decrementLoadCounts = function (content) {\n updatePointAndFeatureCounts(this, content, true, true);\n};\n\nCesium3DTilesetStatistics.clone = function (statistics, result) {\n result.selected = statistics.selected;\n result.visited = statistics.visited;\n result.numberOfCommands = statistics.numberOfCommands;\n result.selected = statistics.selected;\n result.numberOfAttemptedRequests = statistics.numberOfAttemptedRequests;\n result.numberOfPendingRequests = statistics.numberOfPendingRequests;\n result.numberOfTilesProcessing = statistics.numberOfTilesProcessing;\n result.numberOfTilesWithContentReady =\n statistics.numberOfTilesWithContentReady;\n result.numberOfTilesTotal = statistics.numberOfTilesTotal;\n result.numberOfFeaturesSelected = statistics.numberOfFeaturesSelected;\n result.numberOfFeaturesLoaded = statistics.numberOfFeaturesLoaded;\n result.numberOfPointsSelected = statistics.numberOfPointsSelected;\n result.numberOfPointsLoaded = statistics.numberOfPointsLoaded;\n result.numberOfTrianglesSelected = statistics.numberOfTrianglesSelected;\n result.numberOfTilesStyled = statistics.numberOfTilesStyled;\n result.numberOfFeaturesStyled = statistics.numberOfFeaturesStyled;\n result.numberOfTilesCulledWithChildrenUnion =\n statistics.numberOfTilesCulledWithChildrenUnion;\n result.geometryByteLength = statistics.geometryByteLength;\n result.texturesByteLength = statistics.texturesByteLength;\n result.batchTableByteLength = statistics.batchTableByteLength;\n};\nexport default Cesium3DTilesetStatistics;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction Cesium3DTileStyleEngine() {\n this._style = undefined; // The style provided by the user\n this._styleDirty = false; // true when the style is reassigned\n this._lastStyleTime = 0; // The \"time\" when the last style was assigned\n}\n\nObject.defineProperties(Cesium3DTileStyleEngine.prototype, {\n style: {\n get: function () {\n return this._style;\n },\n set: function (value) {\n if (value === this._style) {\n return;\n }\n this._style = value;\n this._styleDirty = true;\n },\n },\n});\n\nCesium3DTileStyleEngine.prototype.makeDirty = function () {\n this._styleDirty = true;\n};\n\nCesium3DTileStyleEngine.prototype.resetDirty = function () {\n this._styleDirty = false;\n};\n\nCesium3DTileStyleEngine.prototype.applyStyle = function (tileset) {\n if (!tileset.ready) {\n return;\n }\n\n if (defined(this._style) && !this._style._ready) {\n return;\n }\n\n const styleDirty = this._styleDirty;\n\n if (styleDirty) {\n // Increase \"time\", so the style is applied to all visible tiles\n ++this._lastStyleTime;\n }\n\n const lastStyleTime = this._lastStyleTime;\n const statistics = tileset._statistics;\n\n // If a new style was assigned, loop through all the visible tiles; otherwise, loop through\n // only the tiles that are newly visible, i.e., they are visible this frame, but were not\n // visible last frame. In many cases, the newly selected tiles list will be short or empty.\n const tiles = styleDirty\n ? tileset._selectedTiles\n : tileset._selectedTilesToStyle;\n // PERFORMANCE_IDEA: does mouse-over picking basically trash this? We need to style on\n // pick, for example, because a feature's show may be false.\n\n const length = tiles.length;\n for (let i = 0; i < length; ++i) {\n const tile = tiles[i];\n if (tile.lastStyleTime !== lastStyleTime) {\n // Apply the style to this tile if it wasn't already applied because:\n // 1) the user assigned a new style to the tileset\n // 2) this tile is now visible, but it wasn't visible when the style was first assigned\n const content = tile.content;\n tile.lastStyleTime = lastStyleTime;\n content.applyStyle(this._style);\n statistics.numberOfFeaturesStyled += content.featuresLength;\n ++statistics.numberOfTilesStyled;\n }\n }\n};\nexport default Cesium3DTileStyleEngine;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\n\n/**\n * An ImplicitTileset is a simple struct that stores information about the\n * structure of a single implicit tileset. This includes template URIs for\n * locating resources, details from the implicit root tile (bounding volume,\n * geometricError, etc.), and details about the subtrees (e.g. subtreeLevels,\n * subdivisionScheme).\n *\n * @alias ImplicitTileset\n * @constructor\n *\n * @param {Resource} baseResource The base resource for the tileset\n * @param {Object} tileJson The JSON header of the tile with either implicit tiling (3D Tiles 1.1) or the 3DTILES_implicit_tiling extension.\n * @param {MetadataSchema} [metadataSchema] The metadata schema containing the implicit tile metadata class.\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitTileset(baseResource, tileJson, metadataSchema) {\n const implicitTiling = hasExtension(tileJson, \"3DTILES_implicit_tiling\")\n ? tileJson.extensions[\"3DTILES_implicit_tiling\"]\n : tileJson.implicitTiling;\n\n /**\n * The base resource for the tileset. This is stored here as it is needed\n * later when expanding Implicit3DTileContents so tile URLs are relative\n * to the tileset, not the subtree file.\n *\n * @type {Resource}\n * @readonly\n * @private\n */\n this.baseResource = baseResource;\n\n /**\n * The geometric error of the root tile\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.geometricError = tileJson.geometricError;\n\n /**\n * The metadata schema containing the implicit tile metadata class.\n *\n * @type {MetadataSchema|undefined}\n * @readonly\n * @private\n */\n this.metadataSchema = metadataSchema;\n\n const boundingVolume = tileJson.boundingVolume;\n if (\n !defined(boundingVolume.box) &&\n !defined(boundingVolume.region) &&\n !hasExtension(boundingVolume, \"3DTILES_bounding_volume_S2\")\n ) {\n throw new RuntimeError(\n \"Only box, region and 3DTILES_bounding_volume_S2 are supported for implicit tiling\"\n );\n }\n\n /**\n * The JSON representation of a bounding volume. This is either a box or a\n * region.\n *\n * @type {Object}\n * @readonly\n * @private\n */\n this.boundingVolume = boundingVolume;\n\n /**\n * The refine strategy as a string, either 'ADD' or 'REPLACE'\n *\n * @type {String}\n * @readonly\n * @private\n */\n this.refine = tileJson.refine;\n\n /**\n * Template URI for the subtree resources, e.g.\n * <code>https://example.com/{level}/{x}/{y}.subtree</code>\n *\n * @type {Resource}\n * @readonly\n * @private\n */\n\n this.subtreeUriTemplate = new Resource({ url: implicitTiling.subtrees.uri });\n\n /**\n * Template URIs for locating content resources, e.g.\n * <code>https://example.com/{level}/{x}/{y}.b3dm</code>.\n * <p>\n * This is an array to support multiple contents.\n * </p>\n *\n * @type {Resource[]}\n * @readonly\n * @private\n */\n this.contentUriTemplates = [];\n\n /**\n * Store a copy of the content headers, so properties such as\n * <code>extras</code> or <code>extensions</code> are preserved when\n * {@link Cesium3DTile}s are created for each tile.\n * <p>\n * This is an array to support multiple contents.\n * </p>\n *\n * @type {Object[]}\n * @readonly\n * @private\n */\n this.contentHeaders = [];\n\n const contentHeaders = gatherContentHeaders(tileJson);\n for (let i = 0; i < contentHeaders.length; i++) {\n const contentHeader = contentHeaders[i];\n this.contentHeaders.push(clone(contentHeader, true));\n const contentResource = new Resource({ url: contentHeader.uri });\n this.contentUriTemplates.push(contentResource);\n }\n\n /**\n * The maximum number of contents as well as content availability bitstreams.\n * This is used for loop bounds when checking content availability.\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.contentCount = this.contentHeaders.length;\n\n /**\n * Stores a copy of the root implicit tile's JSON header. This is used\n * as a template for creating {@link Cesium3DTile}s. The following properties\n * are removed:\n *\n * <ul>\n * <li><code>tile.implicitTiling</code> to prevent infinite loops of implicit tiling</li>\n * <li><code>tile.extensions[\"3DTILES_implicit_tiling\"]</code>, if used instead of tile.implicitTiling</li>\n * <li><code>tile.contents</code>, since contents are handled separately</li>\n * <li><code>tile.content</code>, if used instead of tile.contents</li>\n * <li><code>tile.extensions[\"3DTILES_multiple_contents\"]</code>, if used instead of tile.contents or tile.content</li>\n * </ul>\n *\n * @type {Object}\n * @readonly\n * @private\n */\n this.tileHeader = makeTileHeaderTemplate(tileJson);\n\n /**\n * The subdivision scheme for this implicit tileset; either OCTREE or QUADTREE\n *\n * @type {ImplicitSubdivisionScheme}\n * @readonly\n * @private\n */\n this.subdivisionScheme =\n ImplicitSubdivisionScheme[implicitTiling.subdivisionScheme];\n\n /**\n * The branching factor for this tileset. Either 4 for quadtrees or 8 for\n * octrees.\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.branchingFactor = ImplicitSubdivisionScheme.getBranchingFactor(\n this.subdivisionScheme\n );\n\n /**\n * How many distinct levels within each subtree. For example, a quadtree\n * with subtreeLevels = 2 will have 5 nodes per quadtree (1 root + 4 children)\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.subtreeLevels = implicitTiling.subtreeLevels;\n\n /**\n * The number of levels containing available tiles in the tileset.\n *\n * @type {Number}\n * @readonly\n * @private\n */\n if (defined(implicitTiling.availableLevels)) {\n this.availableLevels = implicitTiling.availableLevels;\n } else {\n this.availableLevels = implicitTiling.maximumLevel + 1;\n }\n}\n\n/**\n * Gather JSON headers for all contents in the tile.\n * This handles both regular tiles and tiles with multiple contents, either\n * in the contents array (3D Tiles 1.1) or the `3DTILES_multiple_contents` extension\n *\n * @param {Object} tileJson The JSON header of the tile with either implicit tiling (3D Tiles 1.1) or the 3DTILES_implicit_tiling extension.\n * @return {Object[]} An array of JSON headers for the contents of each tile\n * @private\n */\nfunction gatherContentHeaders(tileJson) {\n if (hasExtension(tileJson, \"3DTILES_multiple_contents\")) {\n const extension = tileJson.extensions[\"3DTILES_multiple_contents\"];\n return defined(extension.contents) ? extension.contents : extension.content;\n }\n\n if (defined(tileJson.contents)) {\n return tileJson.contents;\n }\n\n if (defined(tileJson.content)) {\n return [tileJson.content];\n }\n\n return [];\n}\n\nfunction makeTileHeaderTemplate(tileJson) {\n const template = clone(tileJson, true);\n\n // Remove the implicit tiling extension to prevent infinite loops,\n // as well as content-related properties since content is handled separately\n if (defined(template.extensions)) {\n delete template.extensions[\"3DTILES_implicit_tiling\"];\n delete template.extensions[\"3DTILES_multiple_contents\"];\n\n // if there are no other extensions, remove the extensions property to\n // keep each tile simple\n if (Object.keys(template.extensions).length === 0) {\n delete template.extensions;\n }\n }\n\n delete template.implicitTiling;\n delete template.contents;\n delete template.content;\n\n return template;\n}\n\nexport default ImplicitTileset;\n", "import Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Morton Order (aka Z-Order Curve) helper functions.\n * @see {@link https://en.wikipedia.org/wiki/Z-order_curve}\n *\n * @namespace MortonOrder\n * @private\n */\nconst MortonOrder = {};\n\n/**\n * Inserts one 0 bit of spacing between a number's bits. This is the opposite of removeOneSpacing.\n *\n * Example:\n * input: 6\n * input (binary): 110\n * output (binary): 10100\n * ^ ^ (added)\n * output: 20\n *\n * @private\n * @param {Number} v A 16-bit unsigned integer.\n * @returns {Number} A 32-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n * @private\n */\nfunction insertOneSpacing(v) {\n v = (v ^ (v << 8)) & 0x00ff00ff;\n v = (v ^ (v << 4)) & 0x0f0f0f0f;\n v = (v ^ (v << 2)) & 0x33333333;\n v = (v ^ (v << 1)) & 0x55555555;\n return v;\n}\n\n/**\n * Inserts two 0 bits of spacing between a number's bits. This is the opposite of removeTwoSpacing.\n *\n * Example:\n * input: 6\n * input (binary): 110\n * output (binary): 1001000\n * ^^ ^^ (added)\n * output: 72\n *\n * @private\n * @param {Number} v A 10-bit unsigned integer.\n * @returns {Number} A 30-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction insertTwoSpacing(v) {\n v = (v ^ (v << 16)) & 0x030000ff;\n v = (v ^ (v << 8)) & 0x0300f00f;\n v = (v ^ (v << 4)) & 0x030c30c3;\n v = (v ^ (v << 2)) & 0x09249249;\n return v;\n}\n\n/**\n * Removes one bit of spacing between bits. This is the opposite of insertOneSpacing.\n *\n * Example:\n * input: 20\n * input (binary): 10100\n * ^ ^ (removed)\n * output (binary): 110\n * output: 6\n *\n * @private\n * @param {Number} v A 32-bit unsigned integer.\n * @returns {Number} A 16-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction removeOneSpacing(v) {\n v &= 0x55555555;\n v = (v ^ (v >> 1)) & 0x33333333;\n v = (v ^ (v >> 2)) & 0x0f0f0f0f;\n v = (v ^ (v >> 4)) & 0x00ff00ff;\n v = (v ^ (v >> 8)) & 0x0000ffff;\n return v;\n}\n\n/**\n * Removes two bits of spacing between bits. This is the opposite of insertTwoSpacing.\n *\n * Example:\n * input: 72\n * input (binary): 1001000\n * ^^ ^^ (removed)\n * output (binary): 110\n * output: 6\n *\n * @private\n * @param {Number} v A 30-bit unsigned integer.\n * @returns {Number} A 10-bit unsigned integer.\n * @see {@link https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/}\n */\nfunction removeTwoSpacing(v) {\n v &= 0x09249249;\n v = (v ^ (v >> 2)) & 0x030c30c3;\n v = (v ^ (v >> 4)) & 0x0300f00f;\n v = (v ^ (v >> 8)) & 0xff0000ff;\n v = (v ^ (v >> 16)) & 0x000003ff;\n return v;\n}\n\n/**\n * Computes the Morton index from 2D coordinates. This is equivalent to interleaving their bits.\n * The inputs must be 16-bit unsigned integers (resulting in 32-bit Morton index) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {Number} x The X coordinate in the range [0, (2^16)-1].\n * @param {Number} y The Y coordinate in the range [0, (2^16)-1].\n * @returns {Number} The Morton index.\n * @private\n */\nMortonOrder.encode2D = function (x, y) {\n // Note: JavaScript bitwise operations return signed 32-bit integers, so the\n // final result needs to be reintepreted as an unsigned integer using >>> 0.\n // This is not needed for encode3D because the result is guaranteed to be at most\n // 30 bits and thus will always be interpreted as an unsigned value.\n return (insertOneSpacing(x) | (insertOneSpacing(y) << 1)) >>> 0;\n};\n\n/**\n * Computes the 2D coordinates from a Morton index. This is equivalent to deinterleaving their bits.\n * The input must be a 32-bit unsigned integer (resulting in 16 bits per coordinate) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {Number} mortonIndex The Morton index in the range [0, (2^32)-1].\n * @param {Number[]} [result] The array onto which to store the result.\n * @returns {Number[]} An array containing the 2D coordinates correspoding to the Morton index.\n * @private\n */\nMortonOrder.decode2D = function (mortonIndex, result) {\n if (!defined(result)) {\n result = new Array(2);\n }\n\n result[0] = removeOneSpacing(mortonIndex);\n result[1] = removeOneSpacing(mortonIndex >> 1);\n return result;\n};\n\n/**\n * Computes the Morton index from 3D coordinates. This is equivalent to interleaving their bits.\n * The inputs must be 10-bit unsigned integers (resulting in 30-bit Morton index) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {Number} x The X coordinate in the range [0, (2^10)-1].\n * @param {Number} y The Y coordinate in the range [0, (2^10)-1].\n * @param {Number} z The Z coordinate in the range [0, (2^10)-1].\n * @returns {Number} The Morton index.\n * @private\n */\nMortonOrder.encode3D = function (x, y, z) {\n return (\n insertTwoSpacing(x) |\n (insertTwoSpacing(y) << 1) |\n (insertTwoSpacing(z) << 2)\n );\n};\n\n/**\n * Computes the 3D coordinates from a Morton index. This is equivalent to deinterleaving their bits.\n * The input must be a 30-bit unsigned integer (resulting in 10 bits per coordinate) due to 32-bit bitwise operator limitation in JavaScript.\n *\n * @param {Number} mortonIndex The Morton index in the range [0, (2^30)-1].\n * @param {Number[]} [result] The array onto which to store the result.\n * @returns {Number[]} An array containing the 3D coordinates corresponding to the Morton index.\n * @private\n */\nMortonOrder.decode3D = function (mortonIndex, result) {\n if (!defined(result)) {\n result = new Array(3);\n }\n\n result[0] = removeTwoSpacing(mortonIndex);\n result[1] = removeTwoSpacing(mortonIndex >> 1);\n result[2] = removeTwoSpacing(mortonIndex >> 2);\n return result;\n};\n\nexport default MortonOrder;\n", "import CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport MortonOrder from \"../Core/MortonOrder.js\";\nimport ImplicitSubdivisionScheme from \"./ImplicitSubdivisionScheme.js\";\n\n/**\n * The coordinates for a tile in an implicit tileset. The coordinates\n * are (level, x, y) for quadtrees or (level, x, y, z) for octrees.\n * <p>\n * Level numbers are 0-indexed and typically start at the root of the implicit\n * tileset (the tile with either implicitTiling in its JSON (3D Tiles 1.1) or\n * the <code>3DTILES_implicit_tiling</code> extension).\n * This object can also represent the relative offset from one set of coordinates\n * to another. See {@link ImplicitTileCoordinates#getOffsetCoordinates}. The term\n * local coordinates refers to coordinates that are relative to the root of a\n * subtree and the term global coordinates refers to coordinates relative to the\n * root of an implicit tileset.\n * </p>\n * <p>\n * For box bounding volumes, x, y, z increase along the +x, +y, and +z\n * directions defined by the half axes.\n * </p>\n * <p>\n * For region bounding volumes, x increases in the +longitude direction, y\n * increases in the +latitude direction, and z increases in the +height\n * direction.\n * </p>\n * <p>\n * Care must be taken when converting between implicit coordinates and Morton\n * indices because there is a 16-bit limit on {@link MortonOrder#encode2D} and\n * a 10-bit limit on {@link MortonOrder#encode3D}. Typically these conversions\n * should be done on local coordinates, not global coordinates, and the maximum\n * number of levels in the subtree should be 15 for quadtree and 9 for octree (to\n * account for the extra level needed by child subtree coordinates).\n * </p>\n *\n * @alias ImplicitTileCoordinates\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {ImplicitSubdivisionScheme} options.subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {Number} options.subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {Number} options.level The level of a tile relative to the tile with the extension\n * @param {Number} options.x The x coordinate of the tile\n * @param {Number} options.y The y coordinate of the tile\n * @param {Number} [options.z] The z coordinate of the tile. Only required when options.subdivisionScheme is ImplicitSubdivisionScheme.OCTREE\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction ImplicitTileCoordinates(options) {\n /**\n * Whether the tileset is a quadtree or octree\n *\n * @type {ImplicitSubdivisionScheme}\n * @readonly\n * @private\n */\n this.subdivisionScheme = options.subdivisionScheme;\n\n /**\n * The number of distinct levels within the coordinate's subtree\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.subtreeLevels = options.subtreeLevels;\n\n /**\n * Level of this tile, relative to the tile with implicit tiling in its JSON\n * (3D Tiles 1.1) or the <code>3DTILES_implicit_tiling</code> extension.\n * Level numbers start at 0.\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.level = options.level;\n\n /**\n * X coordinate of this tile\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.x = options.x;\n\n /**\n * Y coordinate of this tile\n *\n * @type {Number}\n * @readonly\n * @private\n */\n this.y = options.y;\n\n /**\n * Z coordinate of this tile. Only defined for octrees.\n *\n * @type {Number|undefined}\n * @readonly\n * @private\n */\n this.z = undefined;\n if (options.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n this.z = options.z;\n }\n}\n\nObject.defineProperties(ImplicitTileCoordinates.prototype, {\n /**\n * An index in the range of [0, branchingFactor) that indicates\n * which child of the parent cell these coordinates correspond to.\n * This can be viewed as a morton index within the parent tile.\n * <p>\n * This is the last 3 bits of the morton index of the tile, but it can\n * be computed more directly by concatenating the bits [z0] y0 x0\n * </p>\n *\n * @type {Number}\n * @readonly\n * @private\n */\n childIndex: {\n get: function () {\n let childIndex = 0;\n childIndex |= this.x & 1;\n childIndex |= (this.y & 1) << 1;\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n childIndex |= (this.z & 1) << 2;\n }\n\n return childIndex;\n },\n },\n\n /**\n * Get the Morton index for this tile within the current level by interleaving\n * the bits of the x, y and z coordinates.\n *\n * @type {Number}\n * @readonly\n * @private\n */\n mortonIndex: {\n get: function () {\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n return MortonOrder.encode3D(this.x, this.y, this.z);\n }\n return MortonOrder.encode2D(this.x, this.y);\n },\n },\n\n /**\n * Get the tile index by adding the Morton index to the level offset\n *\n * @type {Number}\n * @readonly\n * @private\n */\n tileIndex: {\n get: function () {\n const levelOffset =\n this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE\n ? // (8^N - 1) / (8-1)\n ((1 << (3 * this.level)) - 1) / 7\n : // (4^N - 1) / (4-1)\n ((1 << (2 * this.level)) - 1) / 3;\n\n const mortonIndex = this.mortonIndex;\n return levelOffset + mortonIndex;\n },\n },\n});\n\n/**\n * Check that the two coordinates are compatible\n * @param {ImplicitTileCoordinates} a\n * @param {ImplicitTileCoordinates} b\n * @private\n */\nfunction checkMatchingSubtreeShape(a, b) {\n if (a.subdivisionScheme !== b.subdivisionScheme) {\n throw new DeveloperError(\"coordinates must have same subdivisionScheme\");\n }\n if (a.subtreeLevels !== b.subtreeLevels) {\n throw new DeveloperError(\"coordinates must have same subtreeLevels\");\n }\n}\n\n/**\n * Compute the coordinates of a tile deeper in the tree with a (level, x, y, [z]) relative offset.\n *\n * @param {ImplicitTileCoordinates} offsetCoordinates The offset from the ancestor\n * @returns {ImplicitTileCoordinates} The coordinates of the descendant\n * @private\n */\nImplicitTileCoordinates.prototype.getDescendantCoordinates = function (\n offsetCoordinates\n) {\n const descendantLevel = this.level + offsetCoordinates.level;\n const descendantX = (this.x << offsetCoordinates.level) + offsetCoordinates.x;\n const descendantY = (this.y << offsetCoordinates.level) + offsetCoordinates.y;\n\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n const descendantZ =\n (this.z << offsetCoordinates.level) + offsetCoordinates.z;\n\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: descendantLevel,\n x: descendantX,\n y: descendantY,\n z: descendantZ,\n });\n }\n\n // Quadtree\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: descendantLevel,\n x: descendantX,\n y: descendantY,\n });\n};\n\n/**\n * Compute the coordinates of a tile higher up in the tree by going up a number of levels.\n *\n * @param {Number} offsetLevels The number of levels to go up in the tree\n * @returns {ImplicitTileCoordinates} The coordinates of the ancestor\n * @private\n */\nImplicitTileCoordinates.prototype.getAncestorCoordinates = function (\n offsetLevels\n) {\n const divisor = 1 << offsetLevels;\n const ancestorLevel = this.level - offsetLevels;\n const ancestorX = Math.floor(this.x / divisor);\n const ancestorY = Math.floor(this.y / divisor);\n\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n const ancestorZ = Math.floor(this.z / divisor);\n\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: ancestorLevel,\n x: ancestorX,\n y: ancestorY,\n z: ancestorZ,\n });\n }\n\n // Quadtree\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: ancestorLevel,\n x: ancestorX,\n y: ancestorY,\n });\n};\n\n/**\n * Compute the (level, x, y, [z]) offset to a descendant\n *\n * @param {ImplicitTileCoordinates} descendantCoordinates The descendant coordinates\n * @returns {ImplicitTileCoordinates} The offset between the ancestor and the descendant\n */\nImplicitTileCoordinates.prototype.getOffsetCoordinates = function (\n descendantCoordinates\n) {\n const offsetLevel = descendantCoordinates.level - this.level;\n const dimensionAtOffsetLevel = 1 << offsetLevel;\n\n const offsetX = descendantCoordinates.x % dimensionAtOffsetLevel;\n const offsetY = descendantCoordinates.y % dimensionAtOffsetLevel;\n\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n const offsetZ = descendantCoordinates.z % dimensionAtOffsetLevel;\n\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: offsetLevel,\n x: offsetX,\n y: offsetY,\n z: offsetZ,\n });\n }\n\n // Quadtree\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: offsetLevel,\n x: offsetX,\n y: offsetY,\n });\n};\n\n/**\n * Given the morton index of the child, compute the coordinates of the child.\n * This is a special case of {@link ImplicitTileCoordinates#getDescendantCoordinates}.\n *\n * @param {Number} childIndex The morton index of the child tile relative to its parent\n * @returns {ImplicitTileCoordinates} The tile coordinates of the child\n * @private\n */\nImplicitTileCoordinates.prototype.getChildCoordinates = function (childIndex) {\n const level = this.level + 1;\n const x = 2 * this.x + (childIndex % 2);\n const y = 2 * this.y + (Math.floor(childIndex / 2) % 2);\n\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n const z = 2 * this.z + (Math.floor(childIndex / 4) % 2);\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: level,\n x: x,\n y: y,\n z: z,\n });\n }\n\n // Quadtree\n return new ImplicitTileCoordinates({\n subdivisionScheme: this.subdivisionScheme,\n subtreeLevels: this.subtreeLevels,\n level: level,\n x: x,\n y: y,\n });\n};\n\n/**\n * Get the coordinates of the subtree that contains this tile. If the tile is\n * the root of the subtree, the root of the subtree is returned.\n *\n * @returns {ImplicitTileCoordinates} The subtree that contains this tile\n * @private\n */\nImplicitTileCoordinates.prototype.getSubtreeCoordinates = function () {\n return this.getAncestorCoordinates(this.level % this.subtreeLevels);\n};\n\n/**\n * Get the coordinates of the parent subtree that contains this tile\n *\n * @returns {ImplicitTileCoordinates} The parent subtree that contains this tile\n * @private\n */\nImplicitTileCoordinates.prototype.getParentSubtreeCoordinates = function () {\n return this.getAncestorCoordinates(\n (this.level % this.subtreeLevels) + this.subtreeLevels\n );\n};\n\n/**\n * Returns whether this tile is an ancestor of another tile\n *\n * @param {ImplicitTileCoordinates} descendantCoordinates the descendant coordinates\n * @returns {Boolean} <code>true</code> if this tile is an ancestor of the other tile\n * @private\n */\nImplicitTileCoordinates.prototype.isAncestor = function (\n descendantCoordinates\n) {\n const levelDifference = descendantCoordinates.level - this.level;\n if (levelDifference <= 0) {\n return false;\n }\n\n const ancestorX = descendantCoordinates.x >> levelDifference;\n const ancestorY = descendantCoordinates.y >> levelDifference;\n const isAncestorX = this.x === ancestorX;\n const isAncestorY = this.y === ancestorY;\n\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n const ancestorZ = descendantCoordinates.z >> levelDifference;\n const isAncestorZ = this.z === ancestorZ;\n return isAncestorX && isAncestorY && isAncestorZ;\n }\n\n // Quadtree\n return isAncestorX && isAncestorY;\n};\n\n/**\n * Returns whether the provided coordinates are equal to this coordinate\n *\n * @param {ImplicitTileCoordinates} otherCoordinates the other coordinates\n * @returns {Boolean} <code>true</code> if the coordinates are equal\n * @private\n */\nImplicitTileCoordinates.prototype.isEqual = function (otherCoordinates) {\n return (\n this.subdivisionScheme === otherCoordinates.subdivisionScheme &&\n this.subtreeLevels === otherCoordinates.subtreeLevels &&\n this.level === otherCoordinates.level &&\n this.x === otherCoordinates.x &&\n this.y === otherCoordinates.y &&\n (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE\n ? this.z === otherCoordinates.z\n : true)\n );\n};\n\n/**\n * Returns whether this tile is the root of the implicit tileset\n *\n * @returns {Boolean} <code>true</code> if this tile is the root\n * @private\n */\nImplicitTileCoordinates.prototype.isImplicitTilesetRoot = function () {\n return this.level === 0;\n};\n\n/**\n * Returns whether this tile is the root of the subtree\n *\n * @returns {Boolean} <code>true</code> if this tile is the root of the subtree\n * @private\n */\nImplicitTileCoordinates.prototype.isSubtreeRoot = function () {\n return this.level % this.subtreeLevels === 0;\n};\n\n/**\n * Returns whether this tile is on the last row of tiles in the subtree\n *\n * @returns {Boolean} <code>true</code> if this tile is on the last row of tiles in the subtree\n * @private\n */\nImplicitTileCoordinates.prototype.isBottomOfSubtree = function () {\n return this.level % this.subtreeLevels === this.subtreeLevels - 1;\n};\n\n/**\n * Get a dictionary of values for templating into an implicit template URI.\n *\n * @returns {Object} An object suitable for use with {@link Resource#getDerivedResource}\n * @private\n */\nImplicitTileCoordinates.prototype.getTemplateValues = function () {\n const values = {\n level: this.level,\n x: this.x,\n y: this.y,\n };\n if (this.subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n values.z = this.z;\n }\n\n return values;\n};\n\nconst scratchCoordinatesArray = [0, 0, 0];\n\n/**\n * Given a level number, morton index, and whether the tileset is an\n * octree/quadtree, compute the (level, x, y, [z]) coordinates\n *\n * @param {ImplicitSubdivisionScheme} subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {Number} subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {Number} level The level of the tree\n * @param {Number} mortonIndex The morton index of the tile.\n * @returns {ImplicitTileCoordinates} The coordinates of the tile with the given Morton index\n * @private\n */\nImplicitTileCoordinates.fromMortonIndex = function (\n subdivisionScheme,\n subtreeLevels,\n level,\n mortonIndex\n) {\n let coordinatesArray;\n if (subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n coordinatesArray = MortonOrder.decode3D(\n mortonIndex,\n scratchCoordinatesArray\n );\n return new ImplicitTileCoordinates({\n subdivisionScheme: subdivisionScheme,\n subtreeLevels: subtreeLevels,\n level: level,\n x: coordinatesArray[0],\n y: coordinatesArray[1],\n z: coordinatesArray[2],\n });\n }\n\n coordinatesArray = MortonOrder.decode2D(mortonIndex, scratchCoordinatesArray);\n return new ImplicitTileCoordinates({\n subdivisionScheme: subdivisionScheme,\n subtreeLevels: subtreeLevels,\n level: level,\n x: coordinatesArray[0],\n y: coordinatesArray[1],\n });\n};\n\n/**\n * Given a tile index and whether the tileset is an octree/quadtree, compute\n * the (level, x, y, [z]) coordinates\n *\n * @param {ImplicitSubdivisionScheme} subdivisionScheme Whether the coordinates are for a quadtree or octree\n * @param {Number} subtreeLevels The number of distinct levels within the coordinate's subtree\n * @param {Number} tileIndex The tile's index\n * @returns {ImplicitTileCoordinates} The coordinates of the tile with the given tile index\n * @private\n */\nImplicitTileCoordinates.fromTileIndex = function (\n subdivisionScheme,\n subtreeLevels,\n tileIndex\n) {\n let level;\n let levelOffset;\n let mortonIndex;\n\n if (subdivisionScheme === ImplicitSubdivisionScheme.OCTREE) {\n // Node count up to octree level: (8^L - 1) / (8-1)\n // (8^L - 1) / (8-1) <= X < (8^(L+1) - 1) / (8-1)\n // 8^L <= (7x + 1) < 8^(L+1)\n // L <= log8(7x + 1) < L + 1\n // L = floor(log8(7x + 1))\n // L = floor(log2(7x + 1) / log2(8))\n // L = floor(log2(7x + 1) / 3)\n level = Math.floor(CesiumMath.log2(7 * tileIndex + 1) / 3);\n levelOffset = ((1 << (3 * level)) - 1) / 7;\n mortonIndex = tileIndex - levelOffset;\n } else {\n // Node count up to quadtree level: (4^L - 1) / (4-1)\n // (4^L - 1) / (4-1) <= X < (4^(L+1) - 1) / (4-1)\n // 4^L <= (3x + 1) < 4^(L+1)\n // L <= log4(3x + 1) < L + 1\n // L = floor(log4(3x + 1))\n // L = floor(log2(3x + 1) / log2(4))\n // L = floor(log2(3x + 1) / 2)\n level = Math.floor(CesiumMath.log2(3 * tileIndex + 1) / 2);\n levelOffset = ((1 << (2 * level)) - 1) / 3;\n mortonIndex = tileIndex - levelOffset;\n }\n\n return ImplicitTileCoordinates.fromMortonIndex(\n subdivisionScheme,\n subtreeLevels,\n level,\n mortonIndex\n );\n};\n\nexport default ImplicitTileCoordinates;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport deprecationWarning from \"../Core/deprecationWarning.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ImageBasedLighting from \"./ImageBasedLighting.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport ManagedArray from \"../Core/ManagedArray.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Axis from \"./Axis.js\";\nimport Cesium3DTile from \"./Cesium3DTile.js\";\nimport Cesium3DTileColorBlendMode from \"./Cesium3DTileColorBlendMode.js\";\nimport Cesium3DTileContentState from \"./Cesium3DTileContentState.js\";\nimport Cesium3DTilesetMetadata from \"./Cesium3DTilesetMetadata.js\";\nimport Cesium3DTileOptimizations from \"./Cesium3DTileOptimizations.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTileRefine from \"./Cesium3DTileRefine.js\";\nimport Cesium3DTilesetCache from \"./Cesium3DTilesetCache.js\";\nimport Cesium3DTilesetHeatmap from \"./Cesium3DTilesetHeatmap.js\";\nimport Cesium3DTilesetStatistics from \"./Cesium3DTilesetStatistics.js\";\nimport Cesium3DTileStyleEngine from \"./Cesium3DTileStyleEngine.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport hasExtension from \"./hasExtension.js\";\nimport ImplicitTileset from \"./ImplicitTileset.js\";\nimport ImplicitTileCoordinates from \"./ImplicitTileCoordinates.js\";\nimport LabelCollection from \"./LabelCollection.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\nimport PointCloudShading from \"./PointCloudShading.js\";\nimport ResourceCache from \"./ResourceCache.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileBoundingSphere from \"./TileBoundingSphere.js\";\nimport TileOrientedBoundingBox from \"./TileOrientedBoundingBox.js\";\n\n/**\n * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},\n * used for streaming massive heterogeneous 3D geospatial datasets.\n *\n * @alias Cesium3DTileset\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String|Promise<Resource>|Promise<String>} options.url The url to a tileset JSON file.\n * @param {Boolean} [options.show=true] Determines if the tileset will be shown.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the tileset's root tile.\n * @param {Axis} [options.modelUpAxis=Axis.Y] Which axis is considered up when loading models for tile contents.\n * @param {Axis} [options.modelForwardAxis=Axis.X] Which axis is considered forward when loading models for tile contents.\n * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the tileset casts or receives shadows from light sources.\n * @param {Number} [options.maximumScreenSpaceError=16] The maximum screen space error used to drive level of detail refinement.\n * @param {Number} [options.maximumMemoryUsage=512] The maximum amount of memory in MB that can be used by the tileset.\n * @param {Boolean} [options.cullWithChildrenBounds=true] Optimization option. Whether to cull tiles using the union of their children bounding volumes.\n * @param {Boolean} [options.cullRequestsWhileMoving=true] Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.\n * @param {Number} [options.cullRequestsWhileMovingMultiplier=60.0] Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.\n * @param {Boolean} [options.preloadWhenHidden=false] Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.\n * @param {Boolean} [options.preloadFlightDestinations=true] Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.\n * @param {Boolean} [options.preferLeaves=false] Optimization option. Prefer loading of leaves first.\n * @param {Boolean} [options.dynamicScreenSpaceError=false] Optimization option. Reduce the screen space error for tiles that are further away from the camera.\n * @param {Number} [options.dynamicScreenSpaceErrorDensity=0.00278] Density used to adjust the dynamic screen space error, similar to fog density.\n * @param {Number} [options.dynamicScreenSpaceErrorFactor=4.0] A factor used to increase the computed dynamic screen space error.\n * @param {Number} [options.dynamicScreenSpaceErrorHeightFalloff=0.25] A ratio of the tileset's height at which the density starts to falloff.\n * @param {Number} [options.progressiveResolutionHeightFraction=0.3] Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.\n * @param {Boolean} [options.foveatedScreenSpaceError=true] Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.\n * @param {Number} [options.foveatedConeSize=0.1] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.\n * @param {Number} [options.foveatedMinimumScreenSpaceErrorRelaxation=0.0] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.\n * @param {Cesium3DTileset.foveatedInterpolationCallback} [options.foveatedInterpolationCallback=Math.lerp] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}\n * @param {Number} [options.foveatedTimeDelay=0.2] Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.\n * @param {Boolean} [options.skipLevelOfDetail=false] Optimization option. Determines if level of detail skipping should be applied during the traversal.\n * @param {Number} [options.baseScreenSpaceError=1024] When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail.\n * @param {Number} [options.skipScreenSpaceErrorFactor=16] When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load.\n * @param {Number} [options.skipLevels=1] When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.\n * @param {Boolean} [options.immediatelyLoadDesiredLevelOfDetail=false] When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.\n * @param {Boolean} [options.loadSiblings=false] When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.\n * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n * @param {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid determining the size and shape of the globe.\n * @param {Object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.\n * @param {Cartesian3} [options.lightColor] The light color when shading models. When <code>undefined</code> the scene's light color is used instead.\n * @param {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting for this tileset.\n * @param {Boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.\n * @param {Boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set to false to avoid the additional processing of geometry at load time. When false, the showOutlines and outlineColor options are ignored.\n * @param {Boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.\n * @param {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.\n * @param {Boolean} [options.vectorClassificationOnly=false] Indicates that only the tileset's vector tiles should be used for classification.\n * @param {Boolean} [options.vectorKeepDecodedPositions=false] Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.\n * @param {String|Number} [options.featureIdLabel=\"featureId_0\"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or \"featureId_N\" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled \"featureId_N\" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string \"featureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {String|Number} [options.instanceFeatureIdLabel=\"instanceFeatureId_0\"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string \"instanceFeatureId_N\" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.\n * @param {Boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.\n * @param {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.\n * @param {Boolean} [options.projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has loaded.\n * @param {String} [options.debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.\n * @param {Boolean} [options.debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.\n * @param {Boolean} [options.debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.\n * @param {Boolean} [options.enableDebugWireframe] For debugging only. This must be true for debugWireframe to work in WebGL1. This cannot be set after the tileset has loaded.\n * @param {Boolean} [options.debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile.\n * @param {Boolean} [options.debugShowContentBoundingVolume=false] For debugging only. When true, renders the bounding volume for each tile's content.\n * @param {Boolean} [options.debugShowViewerRequestVolume=false] For debugging only. When true, renders the viewer request volume for each tile.\n * @param {Boolean} [options.debugShowGeometricError=false] For debugging only. When true, draws labels to indicate the geometric error of each tile.\n * @param {Boolean} [options.debugShowRenderingStatistics=false] For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.\n * @param {Boolean} [options.debugShowMemoryUsage=false] For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.\n * @param {Boolean} [options.debugShowUrl=false] For debugging only. When true, draws labels to indicate the url of each tile.\n *\n * @exception {DeveloperError} The tileset must be 3D Tiles version 0.0 or 1.0.\n *\n * @example\n * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({\n * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'\n * }));\n *\n * @example\n * // Common setting for the skipLevelOfDetail optimization\n * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({\n * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',\n * skipLevelOfDetail : true,\n * baseScreenSpaceError : 1024,\n * skipScreenSpaceErrorFactor : 16,\n * skipLevels : 1,\n * immediatelyLoadDesiredLevelOfDetail : false,\n * loadSiblings : false,\n * cullWithChildrenBounds : true\n * }));\n *\n * @example\n * // Common settings for the dynamicScreenSpaceError optimization\n * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({\n * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',\n * dynamicScreenSpaceError : true,\n * dynamicScreenSpaceErrorDensity : 0.00278,\n * dynamicScreenSpaceErrorFactor : 4.0,\n * dynamicScreenSpaceErrorHeightFalloff : 0.25\n * }));\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles specification}\n */\nfunction Cesium3DTileset(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._url = undefined;\n this._basePath = undefined;\n this._root = undefined;\n this._resource = undefined;\n this._asset = undefined; // Metadata for the entire tileset\n this._properties = undefined; // Metadata for per-model/point/etc properties\n this._geometricError = undefined; // Geometric error when the tree is not rendered at all\n this._extensionsUsed = undefined;\n this._extensions = undefined;\n this._modelUpAxis = undefined;\n this._modelForwardAxis = undefined;\n this._cache = new Cesium3DTilesetCache();\n this._processingQueue = [];\n this._selectedTiles = [];\n this._emptyTiles = [];\n this._requestedTiles = [];\n this._selectedTilesToStyle = [];\n this._loadTimestamp = undefined;\n this._timeSinceLoad = 0.0;\n this._updatedVisibilityFrame = 0;\n this._updatedModelMatrixFrame = 0;\n this._modelMatrixChanged = false;\n this._previousModelMatrix = undefined;\n this._extras = undefined;\n this._credits = undefined;\n\n this._showCreditsOnScreen = defaultValue(options.showCreditsOnScreen, false);\n\n this._cullWithChildrenBounds = defaultValue(\n options.cullWithChildrenBounds,\n true\n );\n this._allTilesAdditive = true;\n\n this._hasMixedContent = false;\n\n this._stencilClearCommand = undefined;\n this._backfaceCommands = new ManagedArray();\n\n this._maximumScreenSpaceError = defaultValue(\n options.maximumScreenSpaceError,\n 16\n );\n this._maximumMemoryUsage = defaultValue(options.maximumMemoryUsage, 512);\n\n this._styleEngine = new Cesium3DTileStyleEngine();\n this._styleApplied = false;\n\n this._modelMatrix = defined(options.modelMatrix)\n ? Matrix4.clone(options.modelMatrix)\n : Matrix4.clone(Matrix4.IDENTITY);\n\n this._statistics = new Cesium3DTilesetStatistics();\n this._statisticsLast = new Cesium3DTilesetStatistics();\n this._statisticsPerPass = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);\n\n for (let i = 0; i < Cesium3DTilePass.NUMBER_OF_PASSES; ++i) {\n this._statisticsPerPass[i] = new Cesium3DTilesetStatistics();\n }\n\n this._requestedTilesInFlight = [];\n\n this._maximumPriority = {\n foveatedFactor: -Number.MAX_VALUE,\n depth: -Number.MAX_VALUE,\n distance: -Number.MAX_VALUE,\n reverseScreenSpaceError: -Number.MAX_VALUE,\n };\n this._minimumPriority = {\n foveatedFactor: Number.MAX_VALUE,\n depth: Number.MAX_VALUE,\n distance: Number.MAX_VALUE,\n reverseScreenSpaceError: Number.MAX_VALUE,\n };\n this._heatmap = new Cesium3DTilesetHeatmap(\n options.debugHeatmapTilePropertyName\n );\n\n /**\n * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.\n *\n * @type {Boolean}\n * @default true\n */\n this.cullRequestsWhileMoving = defaultValue(\n options.cullRequestsWhileMoving,\n true\n );\n this._cullRequestsWhileMoving = false;\n\n /**\n * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.\n *\n * @type {Number}\n * @default 60.0\n */\n this.cullRequestsWhileMovingMultiplier = defaultValue(\n options.cullRequestsWhileMovingMultiplier,\n 60.0\n );\n\n /**\n * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.\n *\n * @type {Number}\n * @default 0.3\n */\n this.progressiveResolutionHeightFraction = CesiumMath.clamp(\n defaultValue(options.progressiveResolutionHeightFraction, 0.3),\n 0.0,\n 0.5\n );\n\n /**\n * Optimization option. Prefer loading of leaves first.\n *\n * @type {Boolean}\n * @default false\n */\n this.preferLeaves = defaultValue(options.preferLeaves, false);\n\n this._tilesLoaded = false;\n this._initialTilesLoaded = false;\n\n this._tileDebugLabels = undefined;\n\n this._classificationType = options.classificationType;\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n this._initialClippingPlanesOriginMatrix = Matrix4.IDENTITY; // Computed from the tileset JSON.\n this._clippingPlanesOriginMatrix = undefined; // Combines the above with any run-time transforms.\n this._clippingPlanesOriginMatrixDirty = true;\n\n this._vectorClassificationOnly = defaultValue(\n options.vectorClassificationOnly,\n false\n );\n\n this._vectorKeepDecodedPositions = defaultValue(\n options.vectorKeepDecodedPositions,\n false\n );\n\n /**\n * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.\n *\n * @type {Boolean}\n * @default false\n */\n this.preloadWhenHidden = defaultValue(options.preloadWhenHidden, false);\n\n /**\n * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.\n *\n * @type {Boolean}\n * @default true\n */\n this.preloadFlightDestinations = defaultValue(\n options.preloadFlightDestinations,\n true\n );\n this._pass = undefined; // Cesium3DTilePass\n\n /**\n * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further\n * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer\n * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.\n * The algorithm is biased towards \"street views\" where the camera is close to the ground plane of the tileset and looking\n * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.\n *\n * @type {Boolean}\n * @default false\n */\n this.dynamicScreenSpaceError = defaultValue(\n options.dynamicScreenSpaceError,\n false\n );\n\n /**\n * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the\n * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all\n * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.\n *\n * @type {Boolean}\n * @default true\n */\n this.foveatedScreenSpaceError = defaultValue(\n options.foveatedScreenSpaceError,\n true\n );\n this._foveatedConeSize = defaultValue(options.foveatedConeSize, 0.1);\n this._foveatedMinimumScreenSpaceErrorRelaxation = defaultValue(\n options.foveatedMinimumScreenSpaceErrorRelaxation,\n 0.0\n );\n\n /**\n * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,\n * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.\n *\n * @type {Cesium3DTileset.foveatedInterpolationCallback}\n */\n this.foveatedInterpolationCallback = defaultValue(\n options.foveatedInterpolationCallback,\n CesiumMath.lerp\n );\n\n /**\n * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control\n * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.\n * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.\n * Setting this to 0.0 will immediately request all tiles in any given view.\n *\n * @type {Number}\n * @default 0.2\n */\n this.foveatedTimeDelay = defaultValue(options.foveatedTimeDelay, 0.2);\n\n /**\n * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this\n * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.\n * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.\n * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles\n * beyond a certain distance all roughly having an error of 1.0.\n * <p>\n * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the\n * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.\n * </p>\n * <p>\n * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.\n * It is analogous to moving fog closer to the camera.\n * </p>\n *\n * @type {Number}\n * @default 0.00278\n */\n this.dynamicScreenSpaceErrorDensity = 0.00278;\n\n /**\n * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles\n * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.\n *\n * @type {Number}\n * @default 4.0\n */\n this.dynamicScreenSpaceErrorFactor = 4.0;\n\n /**\n * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the\n * full computed density is applied, otherwise the density falls off. This has the effect of higher density at\n * street level views.\n * <p>\n * Valid values are between 0.0 and 1.0.\n * </p>\n *\n * @type {Number}\n * @default 0.25\n */\n this.dynamicScreenSpaceErrorHeightFalloff = 0.25;\n\n this._dynamicScreenSpaceErrorComputedDensity = 0.0; // Updated based on the camera position and direction\n\n /**\n * Determines whether the tileset casts or receives shadows from light sources.\n * <p>\n * Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view.\n * </p>\n * <p>\n * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.\n * </p>\n *\n * @type {ShadowMode}\n * @default ShadowMode.ENABLED\n */\n this.shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n\n /**\n * Determines if the tileset will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from\n * the original feature, e.g. glTF material or per-point color in the tile.\n *\n * @type {Cesium3DTileColorBlendMode}\n * @default Cesium3DTileColorBlendMode.HIGHLIGHT\n */\n this.colorBlendMode = Cesium3DTileColorBlendMode.HIGHLIGHT;\n\n /**\n * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.\n * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between\n * resulting in a mix of the source color and feature color.\n *\n * @type {Number}\n * @default 0.5\n */\n this.colorBlendAmount = 0.5;\n\n this._pointCloudShading = new PointCloudShading(options.pointCloudShading);\n this._pointCloudEyeDomeLighting = new PointCloudEyeDomeLighting();\n\n /**\n * The event fired to indicate progress of loading new tiles. This event is fired when a new tile\n * is requested, when a requested tile is finished downloading, and when a downloaded tile has been\n * processed and is ready to render.\n * <p>\n * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles\n * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.\n * </p>\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {\n * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {\n * console.log('Stopped loading');\n * return;\n * }\n *\n * console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);\n * });\n */\n this.loadProgress = new Event();\n\n /**\n * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset\n * is completely loaded for this view.\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.allTilesLoaded.addEventListener(function() {\n * console.log('All tiles are loaded');\n * });\n *\n * @see Cesium3DTileset#tilesLoaded\n */\n this.allTilesLoaded = new Event();\n\n /**\n * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event\n * is fired once when all tiles in the initial view are loaded.\n * <p>\n * This event is fired at the end of the frame after the scene is rendered.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.initialTilesLoaded.addEventListener(function() {\n * console.log('Initial tiles are loaded');\n * });\n *\n * @see Cesium3DTileset#allTilesLoaded\n */\n this.initialTilesLoaded = new Event();\n\n /**\n * The event fired to indicate that a tile's content was loaded.\n * <p>\n * The loaded {@link Cesium3DTile} is passed to the event listener.\n * </p>\n * <p>\n * This event is fired during the tileset traversal while the frame is being rendered\n * so that updates to the tile take effect in the same frame. Do not create or modify\n * Cesium entities or primitives during the event listener.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.tileLoad.addEventListener(function(tile) {\n * console.log('A tile was loaded.');\n * });\n */\n this.tileLoad = new Event();\n\n /**\n * The event fired to indicate that a tile's content was unloaded.\n * <p>\n * The unloaded {@link Cesium3DTile} is passed to the event listener.\n * </p>\n * <p>\n * This event is fired immediately before the tile's content is unloaded while the frame is being\n * rendered so that the event listener has access to the tile's content. Do not create\n * or modify Cesium entities or primitives during the event listener.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.tileUnload.addEventListener(function(tile) {\n * console.log('A tile was unloaded from the cache.');\n * });\n *\n * @see Cesium3DTileset#maximumMemoryUsage\n * @see Cesium3DTileset#trimLoadedTiles\n */\n this.tileUnload = new Event();\n\n /**\n * The event fired to indicate that a tile's content failed to load.\n * <p>\n * If there are no event listeners, error messages will be logged to the console.\n * </p>\n * <p>\n * The error object passed to the listener contains two properties:\n * <ul>\n * <li><code>url</code>: the url of the failed tile.</li>\n * <li><code>message</code>: the error message.</li>\n * </ul>\n * <p>\n * If multiple contents are present, this event is raised once per inner content with errors.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.tileFailed.addEventListener(function(error) {\n * console.log(`An error occurred loading tile: ${error.url}`);\n * console.log(`Error: ${error.message}`);\n * });\n */\n this.tileFailed = new Event();\n\n /**\n * This event fires once for each visible tile in a frame. This can be used to manually\n * style a tileset.\n * <p>\n * The visible {@link Cesium3DTile} is passed to the event listener.\n * </p>\n * <p>\n * This event is fired during the tileset traversal while the frame is being rendered\n * so that updates to the tile take effect in the same frame. Do not create or modify\n * Cesium entities or primitives during the event listener.\n * </p>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * tileset.tileVisible.addEventListener(function(tile) {\n * if (tile.content instanceof Cesium.Model3DTileContent) {\n * console.log('A 3D model tile is visible.');\n * }\n * });\n *\n * @example\n * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.\n * tileset.style = new Cesium.Cesium3DTileStyle({\n * color : 'color(\"red\")'\n * });\n * tileset.tileVisible.addEventListener(function(tile) {\n * const content = tile.content;\n * const featuresLength = content.featuresLength;\n * for (let i = 0; i < featuresLength; i+=2) {\n * content.getFeature(i).color = Cesium.Color.fromRandom();\n * }\n * });\n */\n this.tileVisible = new Event();\n\n /**\n * Optimization option. Determines if level of detail skipping should be applied during the traversal.\n * <p>\n * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require\n * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped\n * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when\n * using this optimization.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.skipLevelOfDetail = defaultValue(options.skipLevelOfDetail, false);\n this._skipLevelOfDetail = this.skipLevelOfDetail;\n this._disableSkipLevelOfDetail = false;\n\n /**\n * The screen space error that must be reached before skipping levels of detail.\n * <p>\n * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n * </p>\n *\n * @type {Number}\n * @default 1024\n */\n this.baseScreenSpaceError = defaultValue(options.baseScreenSpaceError, 1024);\n\n /**\n * Multiplier defining the minimum screen space error to skip.\n * For example, if a tile has screen space error of 100, no tiles will be loaded unless they\n * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.\n * <p>\n * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n * </p>\n *\n * @type {Number}\n * @default 16\n */\n this.skipScreenSpaceErrorFactor = defaultValue(\n options.skipScreenSpaceErrorFactor,\n 16\n );\n\n /**\n * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.\n * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.\n * <p>\n * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n * </p>\n *\n * @type {Number}\n * @default 1\n */\n this.skipLevels = defaultValue(options.skipLevels, 1);\n\n /**\n * When true, only tiles that meet the maximum screen space error will ever be downloaded.\n * Skipping factors are ignored and just the desired tiles are loaded.\n * <p>\n * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.immediatelyLoadDesiredLevelOfDetail = defaultValue(\n options.immediatelyLoadDesiredLevelOfDetail,\n false\n );\n\n /**\n * Determines whether siblings of visible tiles are always downloaded during traversal.\n * This may be useful for ensuring that tiles are already available when the viewer turns left/right.\n * <p>\n * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.loadSiblings = defaultValue(options.loadSiblings, false);\n\n this._clippingPlanes = undefined;\n this.clippingPlanes = options.clippingPlanes;\n\n if (defined(options.imageBasedLighting)) {\n this._imageBasedLighting = options.imageBasedLighting;\n this._shouldDestroyImageBasedLighting = false;\n } else {\n this._imageBasedLighting = new ImageBasedLighting();\n this._shouldDestroyImageBasedLighting = true;\n }\n\n /**\n * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.\n * <p>\n * For example, disabling additional light sources by setting\n * <code>tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>\n * will make the tileset much darker. Here, increasing the intensity of the light source will make the tileset brighter.\n * </p>\n *\n * @type {Cartesian3}\n * @default undefined\n */\n this.lightColor = options.lightColor;\n\n /**\n * Whether to cull back-facing geometry. When true, back face culling is determined\n * by the glTF material's doubleSided property; when false, back face culling is disabled.\n *\n * @type {Boolean}\n * @default true\n */\n this.backFaceCulling = defaultValue(options.backFaceCulling, true);\n\n this._enableShowOutline = defaultValue(options.enableShowOutline, true);\n\n /**\n * Whether to display the outline for models using the\n * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.\n * When true, outlines are displayed. When false, outlines are not displayed.\n *\n * @type {Boolean}\n * @default true\n */\n this.showOutline = defaultValue(options.showOutline, true);\n\n /**\n * The color to use when rendering outlines.\n *\n * @type {Color}\n * @default Color.BLACK\n */\n this.outlineColor = defaultValue(options.outlineColor, Color.BLACK);\n\n /**\n * The {@link SplitDirection} to apply to this tileset.\n *\n * @type {SplitDirection}\n * @default {@link SplitDirection.NONE}\n */\n this.splitDirection = defaultValue(\n options.splitDirection,\n SplitDirection.NONE\n );\n\n this._projectTo2D = defaultValue(options.projectTo2D, false);\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * Determines if only the tiles from last frame should be used for rendering. This\n * effectively \"freezes\" the tileset to the previous frame so it is possible to zoom\n * out and see what was rendered.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugFreezeFrame = defaultValue(options.debugFreezeFrame, false);\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, assigns a random color to each tile. This is useful for visualizing\n * what features belong to what tiles, especially with additive refinement where features\n * from parent tiles may be interleaved with features from child tiles.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugColorizeTiles = defaultValue(options.debugColorizeTiles, false);\n\n this._enableDebugWireframe = defaultValue(\n options.enableDebugWireframe,\n false\n );\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, renders each tile's content as a wireframe.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugWireframe = defaultValue(options.debugWireframe, false);\n\n // Warning for improper setup of debug wireframe\n if (this.debugWireframe === true && this._enableDebugWireframe === false) {\n oneTimeWarning(\n \"tileset-debug-wireframe-ignored\",\n \"enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored.\"\n );\n }\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, renders the bounding volume for each visible tile. The bounding volume is\n * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the\n * screen space error and are still refining to their descendants are yellow.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, renders the bounding volume for each visible tile's content. The bounding volume is\n * blue if the tile has a content bounding volume; otherwise it is red.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowContentBoundingVolume = defaultValue(\n options.debugShowContentBoundingVolume,\n false\n );\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, renders the viewer request volume for each tile.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowViewerRequestVolume = defaultValue(\n options.debugShowViewerRequestVolume,\n false\n );\n\n this._tileDebugLabels = undefined;\n this.debugPickedTileLabelOnly = false;\n this.debugPickedTile = undefined;\n this.debugPickPosition = undefined;\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, draws labels to indicate the geometric error of each tile.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowGeometricError = defaultValue(\n options.debugShowGeometricError,\n false\n );\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowRenderingStatistics = defaultValue(\n options.debugShowRenderingStatistics,\n false\n );\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, draws labels to indicate the geometry and texture memory usage of each tile.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowMemoryUsage = defaultValue(options.debugShowMemoryUsage, false);\n\n /**\n * This property is for debugging only; it is not optimized for production use.\n * <p>\n * When true, draws labels to indicate the url of each tile.\n * </p>\n *\n * @type {Boolean}\n * @default false\n */\n this.debugShowUrl = defaultValue(options.debugShowUrl, false);\n\n /**\n * Function for examining vector lines as they are being streamed.\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @type {Function}\n */\n this.examineVectorLinesFunction = undefined;\n\n // this is the underlying Cesium3DTileMetadata object, whether it came from\n // the 3DTILES_metadata extension or a 3D Tiles 1.1 tileset JSON. Getters\n // like tileset.metadata and tileset.schema will delegate to this object.\n this._metadataExtension = undefined;\n\n this._customShader = options.customShader;\n\n let featureIdLabel = defaultValue(options.featureIdLabel, \"featureId_0\");\n if (typeof featureIdLabel === \"number\") {\n featureIdLabel = `featureId_${featureIdLabel}`;\n }\n this._featureIdLabel = featureIdLabel;\n\n let instanceFeatureIdLabel = defaultValue(\n options.instanceFeatureIdLabel,\n \"instanceFeatureId_0\"\n );\n if (typeof instanceFeatureIdLabel === \"number\") {\n instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;\n }\n this._instanceFeatureIdLabel = instanceFeatureIdLabel;\n\n this._schemaLoader = undefined;\n\n const that = this;\n let resource;\n this._readyPromise = Promise.resolve(options.url)\n .then(function (url) {\n let basePath;\n resource = Resource.createIfNeeded(url);\n that._resource = resource;\n\n // ion resources have a credits property we can use for additional attribution.\n that._credits = resource.credits;\n\n if (resource.extension === \"json\") {\n basePath = resource.getBaseUri(true);\n } else if (resource.isDataUri) {\n basePath = \"\";\n }\n\n that._url = resource.url;\n that._basePath = basePath;\n\n return Cesium3DTileset.loadJson(resource);\n })\n .then(function (tilesetJson) {\n if (that.isDestroyed()) {\n return;\n }\n\n // This needs to be called before loadTileset() so tile metadata\n // can be initialized synchronously in the Cesium3DTile constructor\n return processMetadataExtension(that, tilesetJson);\n })\n .then(function (tilesetJson) {\n if (that.isDestroyed()) {\n return;\n }\n\n that._root = that.loadTileset(resource, tilesetJson);\n\n // Handle legacy gltfUpAxis option\n const gltfUpAxis = defined(tilesetJson.asset.gltfUpAxis)\n ? Axis.fromName(tilesetJson.asset.gltfUpAxis)\n : Axis.Y;\n const modelUpAxis = defaultValue(options.modelUpAxis, gltfUpAxis);\n const modelForwardAxis = defaultValue(options.modelForwardAxis, Axis.X);\n\n const asset = tilesetJson.asset;\n that._asset = asset;\n that._properties = tilesetJson.properties;\n that._geometricError = tilesetJson.geometricError;\n that._extensionsUsed = tilesetJson.extensionsUsed;\n that._extensions = tilesetJson.extensions;\n that._modelUpAxis = modelUpAxis;\n that._modelForwardAxis = modelForwardAxis;\n that._extras = tilesetJson.extras;\n\n const extras = asset.extras;\n if (\n defined(extras) &&\n defined(extras.cesium) &&\n defined(extras.cesium.credits)\n ) {\n const extraCredits = extras.cesium.credits;\n let credits = that._credits;\n if (!defined(credits)) {\n credits = [];\n that._credits = credits;\n }\n for (let i = 0; i < extraCredits.length; ++i) {\n const credit = extraCredits[i];\n credits.push(new Credit(credit.html, that._showCreditsOnScreen));\n }\n }\n\n // Save the original, untransformed bounding volume position so we can apply\n // the tile transform and model matrix at run time\n const boundingVolume = that._root.createBoundingVolume(\n tilesetJson.root.boundingVolume,\n Matrix4.IDENTITY\n );\n const clippingPlanesOrigin = boundingVolume.boundingSphere.center;\n // If this origin is above the surface of the earth\n // we want to apply an ENU orientation as our best guess of orientation.\n // Otherwise, we assume it gets its position/orientation completely from the\n // root tile transform and the tileset's model matrix\n const originCartographic = that._ellipsoid.cartesianToCartographic(\n clippingPlanesOrigin\n );\n if (\n defined(originCartographic) &&\n originCartographic.height >\n ApproximateTerrainHeights._defaultMinTerrainHeight\n ) {\n that._initialClippingPlanesOriginMatrix = Transforms.eastNorthUpToFixedFrame(\n clippingPlanesOrigin\n );\n }\n that._clippingPlanesOriginMatrix = Matrix4.clone(\n that._initialClippingPlanesOriginMatrix\n );\n\n return that;\n });\n}\n\nObject.defineProperties(Cesium3DTileset.prototype, {\n /**\n * NOTE: This getter exists so that `Picking.js` can differentiate between\n * PrimitiveCollection and Cesium3DTileset objects without inflating\n * the size of the module via `instanceof Cesium3DTileset`\n * @private\n */\n isCesium3DTileset: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets the tileset's asset object property, which contains metadata about the tileset.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference}\n * in the 3D Tiles spec for the full set of properties.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n */\n asset: {\n get: function () {\n return this._asset;\n },\n },\n\n /**\n * Gets the tileset's extensions object property.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n */\n extensions: {\n get: function () {\n return this._extensions;\n },\n },\n\n /**\n * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {ClippingPlaneCollection}\n */\n clippingPlanes: {\n get: function () {\n return this._clippingPlanes;\n },\n set: function (value) {\n ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n },\n },\n\n /**\n * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.\n * <p>\n * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference}\n * in the 3D Tiles spec for the full set of properties.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n *\n * @example\n * console.log(`Maximum building height: ${tileset.properties.height.maximum}`);\n * console.log(`Minimum building height: ${tileset.properties.height.minimum}`);\n *\n * @see Cesium3DTileFeature#getProperty\n * @see Cesium3DTileFeature#setProperty\n */\n properties: {\n get: function () {\n return this._properties;\n },\n },\n\n /**\n * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.\n * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n ready: {\n get: function () {\n return defined(this._root);\n },\n },\n\n /**\n * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.\n * <p>\n * This promise is resolved at the end of the frame before the first frame the tileset is rendered in.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Promise.<Cesium3DTileset>}\n * @readonly\n *\n * @example\n * tileset.readyPromise.then(function(tileset) {\n * // tile.properties is not defined until readyPromise resolves.\n * const properties = tileset.properties;\n * if (Cesium.defined(properties)) {\n * for (const name in properties) {\n * console.log(properties[name]);\n * }\n * }\n * });\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is\n * completely loaded for this view.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n *\n * @see Cesium3DTileset#allTilesLoaded\n */\n tilesLoaded: {\n get: function () {\n return this._tilesLoaded;\n },\n },\n\n /**\n * The resource used to fetch the tileset JSON file\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Resource}\n * @readonly\n */\n resource: {\n get: function () {\n return this._resource;\n },\n },\n\n /**\n * The base path that non-absolute paths in tileset JSON file are relative to.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {String}\n * @readonly\n * @deprecated\n */\n basePath: {\n get: function () {\n deprecationWarning(\n \"Cesium3DTileset.basePath\",\n \"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.\"\n );\n return this._basePath;\n },\n },\n\n /**\n * The style, defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},\n * applied to each feature in the tileset.\n * <p>\n * Assign <code>undefined</code> to remove the style, which will restore the visual\n * appearance of the tileset to its default when no style was applied.\n * </p>\n * <p>\n * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}\n * event is raised, so code in <code>tileVisible</code> can manually set a feature's\n * properties (e.g. color and show) after the style is applied. When\n * a new style is assigned any manually set properties are overwritten.\n * </p>\n * <p>\n * Use an always \"true\" condition to specify the Color for all objects that are not\n * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White\n * will be used. Similarly, use an always \"true\" condition to specify the show property\n * for all objects that are not overridden by pre-existing conditions. Otherwise, the\n * default show value true will be used.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Cesium3DTileStyle|undefined}\n *\n * @default undefined\n *\n * @example\n * tileset.style = new Cesium.Cesium3DTileStyle({\n * color : {\n * conditions : [\n * ['${Height} >= 100', 'color(\"purple\", 0.5)'],\n * ['${Height} >= 50', 'color(\"red\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * },\n * show : '${Height} > 0',\n * meta : {\n * description : '\"Building id ${id} has height ${Height}.\"'\n * }\n * });\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n */\n style: {\n get: function () {\n return this._styleEngine.style;\n },\n set: function (value) {\n this._styleEngine.style = value;\n },\n },\n\n /**\n * A custom shader to apply to all tiles in the tileset. Only used for\n * contents that use {@link Model}. Using custom shaders with a\n * {@link Cesium3DTileStyle} may lead to undefined behavior.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {CustomShader|undefined}\n *\n * @default undefined\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n customShader: {\n get: function () {\n return this._customShader;\n },\n set: function (value) {\n this._customShader = value;\n },\n },\n\n /**\n * The tileset's schema, groups, tileset metadata and other details from the\n * 3DTILES_metadata extension or a 3D Tiles 1.1 tileset JSON. This getter is\n * for internal use by other classes.\n *\n * @memberof Cesium3DTileset.prototype\n * @type {Cesium3DTilesetMetadata}\n * @private\n * @readonly\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n metadataExtension: {\n get: function () {\n return this._metadataExtension;\n },\n },\n\n /**\n * The metadata properties attached to the tileset as a whole.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {TilesetMetadata}\n * @private\n * @readonly\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n metadata: {\n get: function () {\n if (defined(this._metadataExtension)) {\n return this._metadataExtension.tileset;\n }\n\n return undefined;\n },\n },\n\n /**\n * The metadata schema used in this tileset. Shorthand for\n * <code>tileset.metadataExtension.schema</code>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {MetadataSchema}\n * @private\n * @readonly\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n schema: {\n get: function () {\n if (defined(this._metadataExtension)) {\n return this._metadataExtension.schema;\n }\n\n return undefined;\n },\n },\n\n /**\n * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile\n * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.\n * <p>\n * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a\n * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds\n * <code>maximumScreenSpaceError</code> the tile refines to its descendants.\n * </p>\n * <p>\n * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.\n * Higher values provide better performance but lower visual quality.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @default 16\n *\n * @exception {DeveloperError} <code>maximumScreenSpaceError</code> must be greater than or equal to zero.\n */\n maximumScreenSpaceError: {\n get: function () {\n return this._maximumScreenSpaceError;\n },\n set: function (value) {\n this._maximumScreenSpaceError = value;\n },\n },\n\n /**\n * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from\n * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also\n * includes per-point metadata.\n * <p>\n * Tiles not in view are unloaded to enforce this.\n * </p>\n * <p>\n * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.\n * </p>\n * <p>\n * If tiles sized more than <code>maximumMemoryUsage</code> are needed\n * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},\n * for the current view, then the memory usage of the tiles loaded will exceed\n * <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but\n * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When\n * these tiles go out of view, they will be unloaded.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @default 512\n *\n * @exception {DeveloperError} <code>maximumMemoryUsage</code> must be greater than or equal to zero.\n * @see Cesium3DTileset#totalMemoryUsageInBytes\n */\n maximumMemoryUsage: {\n get: function () {\n return this._maximumMemoryUsage;\n },\n set: function (value) {\n this._maximumMemoryUsage = value;\n },\n },\n\n /**\n * Options for controlling point size based on geometric error and eye dome lighting.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {PointCloudShading}\n */\n pointCloudShading: {\n get: function () {\n return this._pointCloudShading;\n },\n set: function (value) {\nthis._pointCloudShading = value;\n },\n },\n\n /**\n * The root tile.\n *\n * @memberOf Cesium3DTileset.prototype\n *\n * @type {Cesium3DTile}\n * @readonly\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n */\n root: {\n get: function () {\n return this._root;\n },\n },\n\n /**\n * The tileset's bounding sphere.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n *\n * @example\n * const tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({\n * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'\n * }));\n *\n * tileset.readyPromise.then(function(tileset) {\n * // Set the camera to view the newly added tileset\n * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));\n * });\n */\n boundingSphere: {\n get: function () {\n this._root.updateTransform(this._modelMatrix);\n return this._root.boundingSphere;\n },\n },\n\n /**\n * A 4x4 transformation matrix that transforms the entire tileset.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Matrix4}\n * @default Matrix4.IDENTITY\n *\n * @example\n * // Adjust a tileset's height from the globe's surface.\n * const heightOffset = 20.0;\n * const boundingSphere = tileset.boundingSphere;\n * const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);\n * const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);\n * const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);\n * const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());\n * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);\n */\n modelMatrix: {\n get: function () {\n return this._modelMatrix;\n },\n set: function (value) {\n this._modelMatrix = Matrix4.clone(value, this._modelMatrix);\n },\n },\n\n /**\n * Returns the time, in milliseconds, since the tileset was loaded and first updated.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @readonly\n */\n timeSinceLoad: {\n get: function () {\n return this._timeSinceLoad;\n },\n },\n\n /**\n * The total amount of GPU memory in bytes used by the tileset. This value is estimated from\n * geometry, texture, batch table textures, and binary metadata of loaded tiles.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see Cesium3DTileset#maximumMemoryUsage\n */\n totalMemoryUsageInBytes: {\n get: function () {\n const statistics = this._statistics;\n return (\n statistics.texturesByteLength +\n statistics.geometryByteLength +\n statistics.batchTableByteLength\n );\n },\n },\n\n /**\n * @private\n */\n clippingPlanesOriginMatrix: {\n get: function () {\n if (!defined(this._clippingPlanesOriginMatrix)) {\n return Matrix4.IDENTITY;\n }\n\n if (this._clippingPlanesOriginMatrixDirty) {\n Matrix4.multiply(\n this.root.computedTransform,\n this._initialClippingPlanesOriginMatrix,\n this._clippingPlanesOriginMatrix\n );\n this._clippingPlanesOriginMatrixDirty = false;\n }\n\n return this._clippingPlanesOriginMatrix;\n },\n },\n\n /**\n * @private\n */\n styleEngine: {\n get: function () {\n return this._styleEngine;\n },\n },\n\n /**\n * @private\n */\n statistics: {\n get: function () {\n return this._statistics;\n },\n },\n\n /**\n * Determines whether terrain, 3D Tiles, or both will be classified by this tileset.\n * <p>\n * This option is only applied to tilesets containing batched 3D models,\n * glTF content, geometry data, or vector data. Even when undefined, vector\n * and geometry data must render as classifications and will default to\n * rendering on both terrain and other 3D Tiles tilesets.\n * </p>\n * <p>\n * When enabled for batched 3D model and glTF tilesets, there are a few\n * requirements/limitations on the glTF:\n * <ul>\n * <li>The glTF cannot contain morph targets, skins, or animations.</li>\n * <li>The glTF cannot contain the <code>EXT_mesh_gpu_instancing</code> extension.</li>\n * <li>Only meshes with TRIANGLES can be used to classify other assets.</li>\n * <li>The <code>POSITION</code> semantic is required.</li>\n * <li>If <code>_BATCHID</code>s and an index buffer are both present, all indices with the same batch id must occupy contiguous sections of the index buffer.</li>\n * <li>If <code>_BATCHID</code>s are present with no index buffer, all positions with the same batch id must occupy contiguous sections of the position buffer.</li>\n * </ul>\n * </p>\n * <p>\n * Additionally, classification is not supported for points or instanced 3D\n * models.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {ClassificationType}\n * @default undefined\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n * @readonly\n */\n classificationType: {\n get: function () {\n return this._classificationType;\n },\n },\n\n /**\n * Gets an ellipsoid describing the shape of the globe.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.\n * Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}.\n * Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @default 0.3\n */\n foveatedConeSize: {\n get: function () {\n return this._foveatedConeSize;\n },\n set: function (value) {\n this._foveatedConeSize = value;\n },\n },\n\n /**\n * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.\n * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Number}\n * @default 0.0\n */\n foveatedMinimumScreenSpaceErrorRelaxation: {\n get: function () {\n return this._foveatedMinimumScreenSpaceErrorRelaxation;\n },\n set: function (value) {\n this._foveatedMinimumScreenSpaceErrorRelaxation = value;\n },\n },\n\n /**\n * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.\n * Returns <code>undefined</code> if <code>extras</code> does not exist.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @exception {DeveloperError} The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.\n *\n * @type {*}\n * @readonly\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#specifying-extensions-and-application-specific-extras|Extras in the 3D Tiles specification.}\n */\n extras: {\n get: function () {\n return this._extras;\n },\n },\n\n /**\n * The properties for managing image-based lighting on this tileset.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {ImageBasedLighting}\n */\n imageBasedLighting: {\n get: function () {\n return this._imageBasedLighting;\n },\n set: function (value) {\nif (value !== this._imageBasedLighting) {\n if (\n this._shouldDestroyImageBasedLighting &&\n !this._imageBasedLighting.isDestroyed()\n ) {\n this._imageBasedLighting.destroy();\n }\n this._imageBasedLighting = value;\n this._shouldDestroyImageBasedLighting = false;\n }\n },\n },\n\n /**\n * Indicates that only the tileset's vector tiles should be used for classification.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @type {Boolean}\n * @default false\n */\n vectorClassificationOnly: {\n get: function () {\n return this._vectorClassificationOnly;\n },\n },\n\n /**\n * Whether vector tiles should keep decoded positions in memory.\n * This is used with {@link Cesium3DTileFeature.getPolylinePositions}.\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @type {Boolean}\n * @default false\n */\n vectorKeepDecodedPositions: {\n get: function () {\n return this._vectorKeepDecodedPositions;\n },\n },\n\n /**\n * Determines whether the credits of the tileset will be displayed on the screen\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {Boolean}\n * @default false\n */\n showCreditsOnScreen: {\n get: function () {\n return this._showCreditsOnScreen;\n },\n set: function (value) {\n this._showCreditsOnScreen = value;\n },\n },\n\n /**\n * Label of the feature ID set to use for picking and styling.\n * <p>\n * For EXT_mesh_features, this is the feature ID's label property, or\n * \"featureId_N\" (where N is the index in the featureIds array) when not\n * specified. EXT_feature_metadata did not have a label field, so such\n * feature ID sets are always labeled \"featureId_N\" where N is the index in\n * the list of all feature Ids, where feature ID attributes are listed before\n * feature ID textures.\n * </p>\n * <p>\n * If featureIdLabel is set to an integer N, it is converted to\n * the string \"featureId_N\" automatically. If both per-primitive and\n * per-instance feature IDs are present, the instance feature IDs take\n * priority.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {String}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n featureIdLabel: {\n get: function () {\n return this._featureIdLabel;\n },\n set: function (value) {\n // indices get converted into featureId_N\n if (typeof value === \"number\") {\n value = `featureId_${value}`;\n }\n\n this._featureIdLabel = value;\n },\n },\n\n /**\n * Label of the instance feature ID set used for picking and styling.\n * <p>\n * If instanceFeatureIdLabel is set to an integer N, it is converted to\n * the string \"instanceFeatureId_N\" automatically.\n * If both per-primitive and per-instance feature IDs are present, the\n * instance feature IDs take priority.\n * </p>\n *\n * @memberof Cesium3DTileset.prototype\n *\n * @type {String}\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n instanceFeatureIdLabel: {\n get: function () {\n return this._instanceFeatureIdLabel;\n },\n set: function (value) {\n // indices get converted into instanceFeatureId_N\n if (typeof value === \"number\") {\n value = `instanceFeatureId_${value}`;\n }\n\n this._instanceFeatureIdLabel = value;\n },\n },\n});\n\n/**\n * Provides a hook to override the method used to request the tileset json\n * useful when fetching tilesets from remote servers\n * @param {Resource|String} tilesetUrl The url of the json file to be fetched\n * @returns {Promise.<Object>} A promise that resolves with the fetched json data\n */\nCesium3DTileset.loadJson = function (tilesetUrl) {\n const resource = Resource.createIfNeeded(tilesetUrl);\n return resource.fetchJson();\n};\n\n/**\n * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all\n * features to re-evaluate the style in the next frame each is visible.\n */\nCesium3DTileset.prototype.makeStyleDirty = function () {\n this._styleEngine.makeDirty();\n};\n\n/**\n * Loads the main tileset JSON file or a tileset JSON file referenced from a tile.\n *\n * @private\n */\nCesium3DTileset.prototype.loadTileset = function (\n resource,\n tilesetJson,\n parentTile\n) {\n const asset = tilesetJson.asset;\n if (!defined(asset)) {\n throw new RuntimeError(\"Tileset must have an asset property.\");\n }\n if (\n asset.version !== \"0.0\" &&\n asset.version !== \"1.0\" &&\n asset.version !== \"1.1\"\n ) {\n throw new RuntimeError(\n \"The tileset must be 3D Tiles version 0.0, 1.0, or 1.1\"\n );\n }\n\n if (defined(tilesetJson.extensionsRequired)) {\n Cesium3DTileset.checkSupportedExtensions(tilesetJson.extensionsRequired);\n }\n\n const statistics = this._statistics;\n\n const tilesetVersion = asset.tilesetVersion;\n if (defined(tilesetVersion)) {\n // Append the tileset version to the resource\n this._basePath += `?v=${tilesetVersion}`;\n resource = resource.clone();\n resource.setQueryParameters({ v: tilesetVersion });\n }\n\n // A tileset JSON file referenced from a tile may exist in a different directory than the root tileset.\n // Get the basePath relative to the external tileset.\n const rootTile = makeTile(this, resource, tilesetJson.root, parentTile);\n\n // If there is a parentTile, add the root of the currently loading tileset\n // to parentTile's children, and update its _depth.\n if (defined(parentTile)) {\n parentTile.children.push(rootTile);\n rootTile._depth = parentTile._depth + 1;\n }\n\n const stack = [];\n stack.push(rootTile);\n\n while (stack.length > 0) {\n const tile = stack.pop();\n ++statistics.numberOfTilesTotal;\n this._allTilesAdditive =\n this._allTilesAdditive && tile.refine === Cesium3DTileRefine.ADD;\n const children = tile._header.children;\n if (defined(children)) {\n const length = children.length;\n for (let i = 0; i < length; ++i) {\n const childHeader = children[i];\n const childTile = makeTile(this, resource, childHeader, tile);\n tile.children.push(childTile);\n childTile._depth = tile._depth + 1;\n stack.push(childTile);\n }\n }\n\n if (this._cullWithChildrenBounds) {\n Cesium3DTileOptimizations.checkChildrenWithinParent(tile);\n }\n }\n\n return rootTile;\n};\n\n/**\n * Make a {@link Cesium3DTile} for a specific tile. If the tile's header has implicit\n * tiling (3D Tiles 1.1) or uses the <code>3DTILES_implicit_tiling</code> extension,\n * it creates a placeholder tile instead for lazy evaluation of the implicit tileset.\n *\n * @param {Cesium3DTileset} tileset The tileset\n * @param {Resource} baseResource The base resource for the tileset\n * @param {Object} tileHeader The JSON header for the tile\n * @param {Cesium3DTile} [parentTile] The parent tile of the new tile\n * @returns {Cesium3DTile} The newly created tile\n *\n * @private\n */\nfunction makeTile(tileset, baseResource, tileHeader, parentTile) {\n const hasImplicitTiling =\n defined(tileHeader.implicitTiling) ||\n hasExtension(tileHeader, \"3DTILES_implicit_tiling\");\n\n if (hasImplicitTiling) {\n const metadataSchema = tileset.schema;\n\n const implicitTileset = new ImplicitTileset(\n baseResource,\n tileHeader,\n metadataSchema\n );\n const rootCoordinates = new ImplicitTileCoordinates({\n subdivisionScheme: implicitTileset.subdivisionScheme,\n subtreeLevels: implicitTileset.subtreeLevels,\n level: 0,\n x: 0,\n y: 0,\n // The constructor will only use this for octrees.\n z: 0,\n });\n\n // Create a placeholder Cesium3DTile that has an ImplicitTileset\n // object and whose content will resolve to an Implicit3DTileContent\n const contentUri = implicitTileset.subtreeUriTemplate.getDerivedResource({\n templateValues: rootCoordinates.getTemplateValues(),\n }).url;\n\n const deepCopy = true;\n const tileJson = clone(tileHeader, deepCopy);\n // Replace contents with the subtree\n tileJson.contents = [\n {\n uri: contentUri,\n },\n ];\n\n delete tileJson.content;\n\n // The placeholder tile does not have any extensions. If there are any\n // extensions beyond 3DTILES_implicit_tiling, Implicit3DTileContent will\n // copy them to the transcoded tiles.\n delete tileJson.extensions;\n\n const tile = new Cesium3DTile(tileset, baseResource, tileJson, parentTile);\n tile.implicitTileset = implicitTileset;\n tile.implicitCoordinates = rootCoordinates;\n return tile;\n }\n\n return new Cesium3DTile(tileset, baseResource, tileHeader, parentTile);\n}\n\n/**\n * If tileset metadata is present, initialize the {@link Cesium3DTilesetMetadata}\n * instance. This is asynchronous since metadata schemas may be external.\n *\n * @param {Cesium3DTileset} tileset The tileset\n * @param {Object} tilesetJson The tileset JSON\n * @return {Promise<Object>} A promise that resolves to tilesetJson for chaining.\n * @private\n */\nfunction processMetadataExtension(tileset, tilesetJson) {\n const metadataJson = hasExtension(tilesetJson, \"3DTILES_metadata\")\n ? tilesetJson.extensions[\"3DTILES_metadata\"]\n : tilesetJson;\n\n let schemaLoader;\n if (defined(metadataJson.schemaUri)) {\n const resource = tileset._resource.getDerivedResource({\n url: metadataJson.schemaUri,\n });\n schemaLoader = ResourceCache.loadSchema({\n resource: resource,\n });\n } else if (defined(metadataJson.schema)) {\n schemaLoader = ResourceCache.loadSchema({\n schema: metadataJson.schema,\n });\n } else {\n return Promise.resolve(tilesetJson);\n }\n\n tileset._schemaLoader = schemaLoader;\n\n return schemaLoader.promise.then(function (schemaLoader) {\n tileset._metadataExtension = new Cesium3DTilesetMetadata({\n schema: schemaLoader.schema,\n metadataJson: metadataJson,\n });\n\n return tilesetJson;\n });\n}\n\nconst scratchPositionNormal = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchMatrix = new Matrix4();\nconst scratchCenter = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nconst scratchDirection = new Cartesian3();\n\nfunction updateDynamicScreenSpaceError(tileset, frameState) {\n let up;\n let direction;\n let height;\n let minimumHeight;\n let maximumHeight;\n\n const camera = frameState.camera;\n const root = tileset._root;\n const tileBoundingVolume = root.contentBoundingVolume;\n\n if (tileBoundingVolume instanceof TileBoundingRegion) {\n up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);\n direction = camera.directionWC;\n height = camera.positionCartographic.height;\n minimumHeight = tileBoundingVolume.minimumHeight;\n maximumHeight = tileBoundingVolume.maximumHeight;\n } else {\n // Transform camera position and direction into the local coordinate system of the tileset\n const transformLocal = Matrix4.inverseTransformation(\n root.computedTransform,\n scratchMatrix\n );\n const ellipsoid = frameState.mapProjection.ellipsoid;\n const boundingVolume = tileBoundingVolume.boundingVolume;\n const centerLocal = Matrix4.multiplyByPoint(\n transformLocal,\n boundingVolume.center,\n scratchCenter\n );\n if (Cartesian3.magnitude(centerLocal) > ellipsoid.minimumRadius) {\n // The tileset is defined in WGS84. Approximate the minimum and maximum height.\n const centerCartographic = Cartographic.fromCartesian(\n centerLocal,\n ellipsoid,\n scratchCartographic\n );\n up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);\n direction = camera.directionWC;\n height = camera.positionCartographic.height;\n minimumHeight = 0.0;\n maximumHeight = centerCartographic.height * 2.0;\n } else {\n // The tileset is defined in local coordinates (z-up)\n const positionLocal = Matrix4.multiplyByPoint(\n transformLocal,\n camera.positionWC,\n scratchPosition\n );\n up = Cartesian3.UNIT_Z;\n direction = Matrix4.multiplyByPointAsVector(\n transformLocal,\n camera.directionWC,\n scratchDirection\n );\n direction = Cartesian3.normalize(direction, direction);\n height = positionLocal.z;\n if (tileBoundingVolume instanceof TileOrientedBoundingBox) {\n // Assuming z-up, the last component stores the half-height of the box\n const boxHeight = root._header.boundingVolume.box[11];\n minimumHeight = centerLocal.z - boxHeight;\n maximumHeight = centerLocal.z + boxHeight;\n } else if (tileBoundingVolume instanceof TileBoundingSphere) {\n const radius = boundingVolume.radius;\n minimumHeight = centerLocal.z - radius;\n maximumHeight = centerLocal.z + radius;\n }\n }\n }\n\n // The range where the density starts to lessen. Start at the quarter height of the tileset.\n const heightFalloff = tileset.dynamicScreenSpaceErrorHeightFalloff;\n const heightClose =\n minimumHeight + (maximumHeight - minimumHeight) * heightFalloff;\n const heightFar = maximumHeight;\n\n const t = CesiumMath.clamp(\n (height - heightClose) / (heightFar - heightClose),\n 0.0,\n 1.0\n );\n\n // Increase density as the camera tilts towards the horizon\n const dot = Math.abs(Cartesian3.dot(direction, up));\n let horizonFactor = 1.0 - dot;\n\n // Weaken the horizon factor as the camera height increases, implying the camera is further away from the tileset.\n // The goal is to increase density for the \"street view\", not when viewing the tileset from a distance.\n horizonFactor = horizonFactor * (1.0 - t);\n\n let density = tileset.dynamicScreenSpaceErrorDensity;\n density *= horizonFactor;\n\n tileset._dynamicScreenSpaceErrorComputedDensity = density;\n}\n\n///////////////////////////////////////////////////////////////////////////\n\nfunction requestContent(tileset, tile) {\n if (tile.hasEmptyContent) {\n return;\n }\n\n const statistics = tileset._statistics;\n const expired = tile.contentExpired;\n const attemptedRequests = tile.requestContent();\n\n if (attemptedRequests > 0) {\n statistics.numberOfAttemptedRequests += attemptedRequests;\n return;\n }\n\n if (expired) {\n if (tile.hasTilesetContent || tile.hasImplicitContent) {\n destroySubtree(tileset, tile);\n } else {\n statistics.decrementLoadCounts(tile.content);\n --statistics.numberOfTilesWithContentReady;\n }\n }\n\n tileset._requestedTilesInFlight.push(tile);\n\n tile.contentReadyToProcessPromise\n .then(addToProcessingQueue(tileset, tile))\n .catch(function (e) {\n // Any error will propagate through contentReadyPromise and will be handled below\n });\n tile.contentReadyPromise\n .then(handleTileSuccess(tileset, tile))\n .catch(handleTileFailure(tileset, tile));\n}\n\nfunction sortRequestByPriority(a, b) {\n return a._priority - b._priority;\n}\n\n/**\n * Perform any pass invariant tasks here. Called after the render pass.\n * @private\n */\nCesium3DTileset.prototype.postPassesUpdate = function (frameState) {\n if (!this.ready) {\n return;\n }\n\n cancelOutOfViewRequests(this, frameState);\n raiseLoadProgressEvent(this, frameState);\n this._cache.unloadTiles(this, unloadTile);\n\n // If the style wasn't able to be applied this frame (for example,\n // the tileset was hidden), keep it dirty so the engine can try\n // to apply the style next frame.\n if (this._styleApplied) {\n this._styleEngine.resetDirty();\n }\n this._styleApplied = false;\n};\n\n/**\n * Perform any pass invariant tasks here. Called before any passes are executed.\n * @private\n */\nCesium3DTileset.prototype.prePassesUpdate = function (frameState) {\n if (!this.ready) {\n return;\n }\n\n processTiles(this, frameState);\n\n // Update clipping planes\n const clippingPlanes = this._clippingPlanes;\n this._clippingPlanesOriginMatrixDirty = true;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n clippingPlanes.update(frameState);\n }\n\n if (!defined(this._loadTimestamp)) {\n this._loadTimestamp = JulianDate.clone(frameState.time);\n }\n this._timeSinceLoad = Math.max(\n JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000,\n 0.0\n );\n\n this._skipLevelOfDetail =\n this.skipLevelOfDetail &&\n !defined(this._classificationType) &&\n !this._disableSkipLevelOfDetail &&\n !this._allTilesAdditive;\n\n if (this.dynamicScreenSpaceError) {\n updateDynamicScreenSpaceError(this, frameState);\n }\n\n if (frameState.newFrame) {\n this._cache.reset();\n }\n};\n\nfunction cancelOutOfViewRequests(tileset, frameState) {\n const requestedTilesInFlight = tileset._requestedTilesInFlight;\n let removeCount = 0;\n const length = requestedTilesInFlight.length;\n for (let i = 0; i < length; ++i) {\n const tile = requestedTilesInFlight[i];\n\n // NOTE: This is framerate dependant so make sure the threshold check is small\n const outOfView = frameState.frameNumber - tile._touchedFrame >= 1;\n if (tile._contentState !== Cesium3DTileContentState.LOADING) {\n // No longer fetching from host, don't need to track it anymore. Gets marked as LOADING in Cesium3DTile::requestContent().\n ++removeCount;\n continue;\n } else if (outOfView) {\n // RequestScheduler will take care of cancelling it\n tile.cancelRequests();\n ++removeCount;\n continue;\n }\n\n if (removeCount > 0) {\n requestedTilesInFlight[i - removeCount] = tile;\n }\n }\n\n requestedTilesInFlight.length -= removeCount;\n}\n\nfunction requestTiles(tileset, isAsync) {\n // Sort requests by priority before making any requests.\n // This makes it less likely that requests will be cancelled after being issued.\n const requestedTiles = tileset._requestedTiles;\n const length = requestedTiles.length;\n requestedTiles.sort(sortRequestByPriority);\n for (let i = 0; i < length; ++i) {\n requestContent(tileset, requestedTiles[i]);\n }\n}\n\nfunction addToProcessingQueue(tileset, tile) {\n return function () {\n tileset._processingQueue.push(tile);\n\n ++tileset._statistics.numberOfTilesProcessing;\n };\n}\n\nfunction handleTileFailure(tileset, tile) {\n return function (error) {\n if (tile._contentState !== Cesium3DTileContentState.FAILED) {\n // If the tile has not failed, the request has been rejected this frame, but will be retried. Do not bubble up the error.\n return;\n }\n\n const url = tile._contentResource.url;\n const message = defined(error.message) ? error.message : error.toString();\n if (tileset.tileFailed.numberOfListeners > 0) {\n tileset.tileFailed.raiseEvent({\n url: url,\n message: message,\n });\n } else {\n console.log(`A 3D tile failed to load: ${url}`);\n console.log(`Error: ${message}`);\n }\n };\n}\n\nfunction handleTileSuccess(tileset, tile) {\n return function (content) {\n --tileset._statistics.numberOfTilesProcessing;\n\n if (!defined(content)) {\n // A request was cancelled. Do not update successful statistics. The request will be retried.\n return;\n }\n\n if (!tile.hasTilesetContent && !tile.hasImplicitContent) {\n // RESEARCH_IDEA: ability to unload tiles (without content) for an\n // external tileset when all the tiles are unloaded.\n tileset._statistics.incrementLoadCounts(tile.content);\n ++tileset._statistics.numberOfTilesWithContentReady;\n ++tileset._statistics.numberOfLoadedTilesTotal;\n\n // Add to the tile cache. Previously expired tiles are already in the cache and won't get re-added.\n tileset._cache.add(tile);\n }\n\n tileset.tileLoad.raiseEvent(tile);\n };\n}\n\nfunction filterProcessingQueue(tileset) {\n const tiles = tileset._processingQueue;\n const length = tiles.length;\n\n let removeCount = 0;\n for (let i = 0; i < length; ++i) {\n const tile = tiles[i];\n if (tile._contentState !== Cesium3DTileContentState.PROCESSING) {\n ++removeCount;\n continue;\n }\n if (removeCount > 0) {\n tiles[i - removeCount] = tile;\n }\n }\n tiles.length -= removeCount;\n}\n\nfunction processTiles(tileset, frameState) {\n filterProcessingQueue(tileset);\n const tiles = tileset._processingQueue;\n const length = tiles.length;\n // Process tiles in the PROCESSING state so they will eventually move to the READY state.\n for (let i = 0; i < length; ++i) {\n tiles[i].process(tileset, frameState);\n }\n}\n\n///////////////////////////////////////////////////////////////////////////\n\nconst scratchCartesian = new Cartesian3();\n\nconst stringOptions = {\n maximumFractionDigits: 3,\n};\n\nfunction formatMemoryString(memorySizeInBytes) {\n const memoryInMegabytes = memorySizeInBytes / 1048576;\n if (memoryInMegabytes < 1.0) {\n return memoryInMegabytes.toLocaleString(undefined, stringOptions);\n }\n return Math.round(memoryInMegabytes).toLocaleString();\n}\n\nfunction computeTileLabelPosition(tile) {\n const boundingVolume = tile.boundingVolume.boundingVolume;\n const halfAxes = boundingVolume.halfAxes;\n const radius = boundingVolume.radius;\n\n let position = Cartesian3.clone(boundingVolume.center, scratchCartesian);\n if (defined(halfAxes)) {\n position.x += 0.75 * (halfAxes[0] + halfAxes[3] + halfAxes[6]);\n position.y += 0.75 * (halfAxes[1] + halfAxes[4] + halfAxes[7]);\n position.z += 0.75 * (halfAxes[2] + halfAxes[5] + halfAxes[8]);\n } else if (defined(radius)) {\n let normal = Cartesian3.normalize(boundingVolume.center, scratchCartesian);\n normal = Cartesian3.multiplyByScalar(\n normal,\n 0.75 * radius,\n scratchCartesian\n );\n position = Cartesian3.add(normal, boundingVolume.center, scratchCartesian);\n }\n return position;\n}\n\nfunction addTileDebugLabel(tile, tileset, position) {\n let labelString = \"\";\n let attributes = 0;\n\n if (tileset.debugShowGeometricError) {\n labelString += `\\nGeometric error: ${tile.geometricError}`;\n attributes++;\n }\n\n if (tileset.debugShowRenderingStatistics) {\n labelString += `\\nCommands: ${tile.commandsLength}`;\n attributes++;\n\n // Don't display number of points or triangles if 0.\n const numberOfPoints = tile.content.pointsLength;\n if (numberOfPoints > 0) {\n labelString += `\\nPoints: ${tile.content.pointsLength}`;\n attributes++;\n }\n\n const numberOfTriangles = tile.content.trianglesLength;\n if (numberOfTriangles > 0) {\n labelString += `\\nTriangles: ${tile.content.trianglesLength}`;\n attributes++;\n }\n\n labelString += `\\nFeatures: ${tile.content.featuresLength}`;\n attributes++;\n }\n\n if (tileset.debugShowMemoryUsage) {\n labelString += `\\nTexture Memory: ${formatMemoryString(\n tile.content.texturesByteLength\n )}`;\n labelString += `\\nGeometry Memory: ${formatMemoryString(\n tile.content.geometryByteLength\n )}`;\n attributes += 2;\n }\n\n if (tileset.debugShowUrl) {\n if (tile.hasMultipleContents) {\n labelString += \"\\nUrls:\";\n const urls = tile.content.innerContentUrls;\n for (let i = 0; i < urls.length; i++) {\n labelString += `\\n- ${urls[i]}`;\n }\n attributes += urls.length;\n } else {\n labelString += `\\nUrl: ${tile._contentHeader.uri}`;\n attributes++;\n }\n }\n\n const newLabel = {\n text: labelString.substring(1),\n position: position,\n font: `${19 - attributes}px sans-serif`,\n showBackground: true,\n disableDepthTestDistance: Number.POSITIVE_INFINITY,\n };\n\n return tileset._tileDebugLabels.add(newLabel);\n}\n\nfunction updateTileDebugLabels(tileset, frameState) {\n let i;\n let tile;\n const selectedTiles = tileset._selectedTiles;\n const selectedLength = selectedTiles.length;\n const emptyTiles = tileset._emptyTiles;\n const emptyLength = emptyTiles.length;\n tileset._tileDebugLabels.removeAll();\n\n if (tileset.debugPickedTileLabelOnly) {\n if (defined(tileset.debugPickedTile)) {\n const position = defined(tileset.debugPickPosition)\n ? tileset.debugPickPosition\n : computeTileLabelPosition(tileset.debugPickedTile);\n const label = addTileDebugLabel(\n tileset.debugPickedTile,\n tileset,\n position\n );\n label.pixelOffset = new Cartesian2(15, -15); // Offset to avoid picking the label.\n }\n } else {\n for (i = 0; i < selectedLength; ++i) {\n tile = selectedTiles[i];\n addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));\n }\n for (i = 0; i < emptyLength; ++i) {\n tile = emptyTiles[i];\n if (tile.hasTilesetContent || tile.hasImplicitContent) {\n addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));\n }\n }\n }\n tileset._tileDebugLabels.update(frameState);\n}\n\nfunction updateTiles(tileset, frameState, passOptions) {\n tileset._styleEngine.applyStyle(tileset);\n tileset._styleApplied = true;\n\n const isRender = passOptions.isRender;\n const statistics = tileset._statistics;\n const commandList = frameState.commandList;\n const numberOfInitialCommands = commandList.length;\n const selectedTiles = tileset._selectedTiles;\n const selectedLength = selectedTiles.length;\n const emptyTiles = tileset._emptyTiles;\n const emptyLength = emptyTiles.length;\n const tileVisible = tileset.tileVisible;\n let i;\n let tile;\n\n const bivariateVisibilityTest =\n tileset._skipLevelOfDetail &&\n tileset._hasMixedContent &&\n frameState.context.stencilBuffer &&\n selectedLength > 0;\n\n tileset._backfaceCommands.length = 0;\n\n if (bivariateVisibilityTest) {\n if (!defined(tileset._stencilClearCommand)) {\n tileset._stencilClearCommand = new ClearCommand({\n stencil: 0,\n pass: Pass.CESIUM_3D_TILE,\n renderState: RenderState.fromCache({\n stencilMask: StencilConstants.SKIP_LOD_MASK,\n }),\n });\n }\n commandList.push(tileset._stencilClearCommand);\n }\n\n const lengthBeforeUpdate = commandList.length;\n for (i = 0; i < selectedLength; ++i) {\n tile = selectedTiles[i];\n // Raise the tileVisible event before update in case the tileVisible event\n // handler makes changes that update needs to apply to WebGL resources\n if (isRender) {\n tileVisible.raiseEvent(tile);\n }\n tile.update(tileset, frameState, passOptions);\n statistics.incrementSelectionCounts(tile.content);\n ++statistics.selected;\n }\n for (i = 0; i < emptyLength; ++i) {\n tile = emptyTiles[i];\n tile.update(tileset, frameState, passOptions);\n }\n\n let addedCommandsLength = commandList.length - lengthBeforeUpdate;\n\n tileset._backfaceCommands.trim();\n\n if (bivariateVisibilityTest) {\n /*\n * Consider 'effective leaf' tiles as selected tiles that have no selected descendants. They may have children,\n * but they are currently our effective leaves because they do not have selected descendants. These tiles\n * are those where with tile._finalResolution === true.\n * Let 'unresolved' tiles be those with tile._finalResolution === false.\n *\n * 1. Render just the backfaces of unresolved tiles in order to lay down z\n * 2. Render all frontfaces wherever tile._selectionDepth > stencilBuffer.\n * Replace stencilBuffer with tile._selectionDepth, when passing the z test.\n * Because children are always drawn before ancestors {@link Cesium3DTilesetTraversal#traverseAndSelect},\n * this effectively draws children first and does not draw ancestors if a descendant has already\n * been drawn at that pixel.\n * Step 1 prevents child tiles from appearing on top when they are truly behind ancestor content.\n * If they are behind the backfaces of the ancestor, then they will not be drawn.\n *\n * NOTE: Step 2 sometimes causes visual artifacts when backfacing child content has some faces that\n * partially face the camera and are inside of the ancestor content. Because they are inside, they will\n * not be culled by the depth writes in Step 1, and because they partially face the camera, the stencil tests\n * will draw them on top of the ancestor content.\n *\n * NOTE: Because we always render backfaces of unresolved tiles, if the camera is looking at the backfaces\n * of an object, they will always be drawn while loading, even if backface culling is enabled.\n */\n\n const backfaceCommands = tileset._backfaceCommands.values;\n const backfaceCommandsLength = backfaceCommands.length;\n\n commandList.length += backfaceCommandsLength;\n\n // copy commands to the back of the commandList\n for (i = addedCommandsLength - 1; i >= 0; --i) {\n commandList[lengthBeforeUpdate + backfaceCommandsLength + i] =\n commandList[lengthBeforeUpdate + i];\n }\n\n // move backface commands to the front of the commandList\n for (i = 0; i < backfaceCommandsLength; ++i) {\n commandList[lengthBeforeUpdate + i] = backfaceCommands[i];\n }\n }\n\n // Number of commands added by each update above\n addedCommandsLength = commandList.length - numberOfInitialCommands;\n statistics.numberOfCommands = addedCommandsLength;\n\n // Only run EDL if simple attenuation is on\n if (\n isRender &&\n tileset.pointCloudShading.attenuation &&\n tileset.pointCloudShading.eyeDomeLighting &&\n addedCommandsLength > 0\n ) {\n tileset._pointCloudEyeDomeLighting.update(\n frameState,\n numberOfInitialCommands,\n tileset.pointCloudShading,\n tileset.boundingSphere\n );\n }\n\n if (isRender) {\n if (\n tileset.debugShowGeometricError ||\n tileset.debugShowRenderingStatistics ||\n tileset.debugShowMemoryUsage ||\n tileset.debugShowUrl\n ) {\n if (!defined(tileset._tileDebugLabels)) {\n tileset._tileDebugLabels = new LabelCollection();\n }\n updateTileDebugLabels(tileset, frameState);\n } else {\n tileset._tileDebugLabels =\n tileset._tileDebugLabels && tileset._tileDebugLabels.destroy();\n }\n }\n}\n\nconst scratchStack = [];\n\nfunction destroySubtree(tileset, tile) {\n const root = tile;\n const stack = scratchStack;\n stack.push(tile);\n while (stack.length > 0) {\n tile = stack.pop();\n const children = tile.children;\n const length = children.length;\n for (let i = 0; i < length; ++i) {\n stack.push(children[i]);\n }\n if (tile !== root) {\n destroyTile(tileset, tile);\n --tileset._statistics.numberOfTilesTotal;\n }\n }\n root.children = [];\n}\n\nfunction unloadTile(tileset, tile) {\n tileset.tileUnload.raiseEvent(tile);\n tileset._statistics.decrementLoadCounts(tile.content);\n --tileset._statistics.numberOfTilesWithContentReady;\n tile.unloadContent();\n}\n\nfunction destroyTile(tileset, tile) {\n tileset._cache.unloadTile(tileset, tile, unloadTile);\n tile.destroy();\n}\n\n/**\n * Unloads all tiles that weren't selected the previous frame. This can be used to\n * explicitly manage the tile cache and reduce the total number of tiles loaded below\n * {@link Cesium3DTileset#maximumMemoryUsage}.\n * <p>\n * Tile unloads occur at the next frame to keep all the WebGL delete calls\n * within the render loop.\n * </p>\n */\nCesium3DTileset.prototype.trimLoadedTiles = function () {\n this._cache.trim();\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nfunction raiseLoadProgressEvent(tileset, frameState) {\n const statistics = tileset._statistics;\n const statisticsLast = tileset._statisticsLast;\n\n const numberOfPendingRequests = statistics.numberOfPendingRequests;\n const numberOfTilesProcessing = statistics.numberOfTilesProcessing;\n const lastNumberOfPendingRequest = statisticsLast.numberOfPendingRequests;\n const lastNumberOfTilesProcessing = statisticsLast.numberOfTilesProcessing;\n\n Cesium3DTilesetStatistics.clone(statistics, statisticsLast);\n\n const progressChanged =\n numberOfPendingRequests !== lastNumberOfPendingRequest ||\n numberOfTilesProcessing !== lastNumberOfTilesProcessing;\n\n if (progressChanged) {\n frameState.afterRender.push(function () {\n tileset.loadProgress.raiseEvent(\n numberOfPendingRequests,\n numberOfTilesProcessing\n );\n });\n }\n\n tileset._tilesLoaded =\n statistics.numberOfPendingRequests === 0 &&\n statistics.numberOfTilesProcessing === 0 &&\n statistics.numberOfAttemptedRequests === 0;\n\n // Events are raised (added to the afterRender queue) here since promises\n // may resolve outside of the update loop that then raise events, e.g.,\n // model's readyPromise.\n if (progressChanged && tileset._tilesLoaded) {\n frameState.afterRender.push(function () {\n tileset.allTilesLoaded.raiseEvent();\n });\n if (!tileset._initialTilesLoaded) {\n tileset._initialTilesLoaded = true;\n frameState.afterRender.push(function () {\n tileset.initialTilesLoaded.raiseEvent();\n });\n }\n }\n}\n\nfunction resetMinimumMaximum(tileset) {\n tileset._heatmap.resetMinimumMaximum();\n tileset._minimumPriority.depth = Number.MAX_VALUE;\n tileset._maximumPriority.depth = -Number.MAX_VALUE;\n tileset._minimumPriority.foveatedFactor = Number.MAX_VALUE;\n tileset._maximumPriority.foveatedFactor = -Number.MAX_VALUE;\n tileset._minimumPriority.distance = Number.MAX_VALUE;\n tileset._maximumPriority.distance = -Number.MAX_VALUE;\n tileset._minimumPriority.reverseScreenSpaceError = Number.MAX_VALUE;\n tileset._maximumPriority.reverseScreenSpaceError = -Number.MAX_VALUE;\n}\n\nfunction detectModelMatrixChanged(tileset, frameState) {\n if (\n frameState.frameNumber !== tileset._updatedModelMatrixFrame ||\n !defined(tileset._previousModelMatrix)\n ) {\n tileset._updatedModelMatrixFrame = frameState.frameNumber;\n tileset._modelMatrixChanged = !Matrix4.equals(\n tileset.modelMatrix,\n tileset._previousModelMatrix\n );\n if (tileset._modelMatrixChanged) {\n tileset._previousModelMatrix = Matrix4.clone(\n tileset.modelMatrix,\n tileset._previousModelMatrix\n );\n }\n }\n}\n\n///////////////////////////////////////////////////////////////////////////\n\nfunction update(tileset, frameState, passStatistics, passOptions) {\n if (frameState.mode === SceneMode.MORPHING) {\n return false;\n }\n\n if (!tileset.ready) {\n return false;\n }\n\n const statistics = tileset._statistics;\n statistics.clear();\n\n const isRender = passOptions.isRender;\n\n // Resets the visibility check for each pass\n ++tileset._updatedVisibilityFrame;\n\n // Update any tracked min max values\n resetMinimumMaximum(tileset);\n\n detectModelMatrixChanged(tileset, frameState);\n tileset._cullRequestsWhileMoving =\n tileset.cullRequestsWhileMoving && !tileset._modelMatrixChanged;\n\n const ready = passOptions.traversal.selectTiles(tileset, frameState);\n\n if (passOptions.requestTiles) {\n requestTiles(tileset);\n }\n\n updateTiles(tileset, frameState, passOptions);\n\n // Update pass statistics\n Cesium3DTilesetStatistics.clone(statistics, passStatistics);\n\n if (isRender) {\n const credits = tileset._credits;\n if (defined(credits) && statistics.selected !== 0) {\n const length = credits.length;\n for (let i = 0; i < length; ++i) {\n const credit = credits[i];\n credit.showOnScreen = tileset._showCreditsOnScreen;\n frameState.creditDisplay.addCredit(credit);\n }\n }\n }\n\n return ready;\n}\n\n/**\n * @private\n */\nCesium3DTileset.prototype.update = function (frameState) {\n this.updateForPass(frameState, frameState.tilesetPassState);\n};\n\n/**\n * @private\n */\nCesium3DTileset.prototype.updateForPass = function (\n frameState,\n tilesetPassState\n) {\n const pass = tilesetPassState.pass;\n if (\n (pass === Cesium3DTilePass.PRELOAD &&\n (!this.preloadWhenHidden || this.show)) ||\n (pass === Cesium3DTilePass.PRELOAD_FLIGHT &&\n (!this.preloadFlightDestinations ||\n (!this.show && !this.preloadWhenHidden))) ||\n (pass === Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK &&\n ((!this._cullRequestsWhileMoving && this.foveatedTimeDelay <= 0) ||\n !this.show))\n ) {\n return;\n }\n\n const originalCommandList = frameState.commandList;\n const originalCamera = frameState.camera;\n const originalCullingVolume = frameState.cullingVolume;\n\n tilesetPassState.ready = false;\n\n const passOptions = Cesium3DTilePass.getPassOptions(pass);\n const ignoreCommands = passOptions.ignoreCommands;\n\n const commandList = defaultValue(\n tilesetPassState.commandList,\n originalCommandList\n );\n const commandStart = commandList.length;\n\n frameState.commandList = commandList;\n frameState.camera = defaultValue(tilesetPassState.camera, originalCamera);\n frameState.cullingVolume = defaultValue(\n tilesetPassState.cullingVolume,\n originalCullingVolume\n );\n\n const passStatistics = this._statisticsPerPass[pass];\n\n if (this.show || ignoreCommands) {\n this._pass = pass;\n tilesetPassState.ready = update(\n this,\n frameState,\n passStatistics,\n passOptions\n );\n }\n\n if (ignoreCommands) {\n commandList.length = commandStart;\n }\n\n frameState.commandList = originalCommandList;\n frameState.camera = originalCamera;\n frameState.cullingVolume = originalCullingVolume;\n};\n\n/**\n * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.\n * @param {String} extensionName The name of the extension to check.\n *\n * @returns {Boolean} <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.\n */\nCesium3DTileset.prototype.hasExtension = function (extensionName) {\n if (!defined(this._extensionsUsed)) {\n return false;\n }\n\n return this._extensionsUsed.indexOf(extensionName) > -1;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Cesium3DTileset#destroy\n */\nCesium3DTileset.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * tileset = tileset && tileset.destroy();\n *\n * @see Cesium3DTileset#isDestroyed\n */\nCesium3DTileset.prototype.destroy = function () {\n this._tileDebugLabels =\n this._tileDebugLabels && this._tileDebugLabels.destroy();\n this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n\n if (defined(this._schemaLoader)) {\n ResourceCache.unload(this._schemaLoader);\n }\n\n // Traverse the tree and destroy all tiles\n if (defined(this._root)) {\n const stack = scratchStack;\n stack.push(this._root);\n\n while (stack.length > 0) {\n const tile = stack.pop();\n tile.destroy();\n\n const children = tile.children;\n const length = children.length;\n for (let i = 0; i < length; ++i) {\n stack.push(children[i]);\n }\n }\n }\n this._root = undefined;\n\n if (\n this._shouldDestroyImageBasedLighting &&\n !this._imageBasedLighting.isDestroyed()\n ) {\n this._imageBasedLighting.destroy();\n }\n this._imageBasedLighting = undefined;\n\n return destroyObject(this);\n};\n\nCesium3DTileset.supportedExtensions = {\n \"3DTILES_metadata\": true,\n \"3DTILES_implicit_tiling\": true,\n \"3DTILES_content_gltf\": true,\n \"3DTILES_multiple_contents\": true,\n \"3DTILES_bounding_volume_S2\": true,\n \"3DTILES_batch_table_hierarchy\": true,\n \"3DTILES_draco_point_compression\": true,\n MAXAR_content_geojson: true,\n};\n\n/**\n * Checks to see if a given extension is supported by Cesium3DTileset. If\n * the extension is not supported by Cesium3DTileset, it throws a RuntimeError.\n *\n * @param {Object} extensionsRequired The extensions we wish to check\n *\n * @private\n */\nCesium3DTileset.checkSupportedExtensions = function (extensionsRequired) {\n for (let i = 0; i < extensionsRequired.length; i++) {\n if (!Cesium3DTileset.supportedExtensions[extensionsRequired[i]]) {\n throw new RuntimeError(\n `Unsupported 3D Tiles Extension: ${extensionsRequired[i]}`\n );\n }\n }\n};\n\n/**\n * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone,\n * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.\n *\n * @callback Cesium3DTileset.foveatedInterpolationCallback\n * @default Math.lerp\n *\n * @param {Number} p The start value to interpolate.\n * @param {Number} q The end value to interpolate.\n * @param {Number} time The time of interpolation generally in the range <code>[0.0, 1.0]</code>.\n * @returns {Number} The interpolated value.\n */\nexport default Cesium3DTileset;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport Cesium3DTileset from \"../Scene/Cesium3DTileset.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst modelMatrixScratch = new Matrix4();\n\n/**\n * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.\n * @alias Cesium3DTilesetVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction Cesium3DTilesetVisualizer(scene, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n Cesium3DTilesetVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._scene = scene;\n this._primitives = scene.primitives;\n this._entityCollection = entityCollection;\n this._tilesetHash = {};\n this._entitiesToVisualize = new AssociativeArray();\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates models created this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nCesium3DTilesetVisualizer.prototype.update = function (time) {\n const entities = this._entitiesToVisualize.values;\n const tilesetHash = this._tilesetHash;\n const primitives = this._primitives;\n\n for (let i = 0, len = entities.length; i < len; i++) {\n const entity = entities[i];\n const tilesetGraphics = entity._tileset;\n\n let resource;\n let tilesetData = tilesetHash[entity.id];\n const show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n Property.getValueOrDefault(tilesetGraphics._show, time, true);\n\n let modelMatrix;\n if (show) {\n modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch);\n resource = Resource.createIfNeeded(\n Property.getValueOrUndefined(tilesetGraphics._uri, time)\n );\n }\n\n if (!show) {\n if (defined(tilesetData)) {\n tilesetData.tilesetPrimitive.show = false;\n }\n continue;\n }\n\n let tileset = defined(tilesetData)\n ? tilesetData.tilesetPrimitive\n : undefined;\n if (!defined(tileset) || resource.url !== tilesetData.url) {\n if (defined(tileset)) {\n primitives.removeAndDestroy(tileset);\n delete tilesetHash[entity.id];\n }\n tileset = new Cesium3DTileset({\n url: resource,\n });\n tileset.id = entity;\n primitives.add(tileset);\n\n tilesetData = {\n tilesetPrimitive: tileset,\n url: resource.url,\n loadFail: false,\n };\n tilesetHash[entity.id] = tilesetData;\n\n checkLoad(tileset, entity, tilesetHash);\n }\n\n tileset.show = true;\n if (defined(modelMatrix)) {\n tileset.modelMatrix = modelMatrix;\n }\n tileset.maximumScreenSpaceError = Property.getValueOrDefault(\n tilesetGraphics.maximumScreenSpaceError,\n time,\n tileset.maximumScreenSpaceError\n );\n }\n\n return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nCesium3DTilesetVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nCesium3DTilesetVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n Cesium3DTilesetVisualizer.prototype._onCollectionChanged,\n this\n );\n const entities = this._entitiesToVisualize.values;\n const tilesetHash = this._tilesetHash;\n const primitives = this._primitives;\n for (let i = entities.length - 1; i > -1; i--) {\n removeTileset(this, entities[i], tilesetHash, primitives);\n }\n return destroyObject(this);\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nCesium3DTilesetVisualizer.prototype.getBoundingSphere = function (\n entity,\n result\n) {\n const tilesetData = this._tilesetHash[entity.id];\n if (!defined(tilesetData) || tilesetData.loadFail) {\n return BoundingSphereState.FAILED;\n }\n\n const primitive = tilesetData.tilesetPrimitive;\n if (!defined(primitive) || !primitive.show) {\n return BoundingSphereState.FAILED;\n }\n\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n\n BoundingSphere.clone(primitive.boundingSphere, result);\n\n return BoundingSphereState.DONE;\n};\n\n/**\n * @private\n */\nCesium3DTilesetVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n const entities = this._entitiesToVisualize;\n const tilesetHash = this._tilesetHash;\n const primitives = this._primitives;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._tileset)) {\n entities.set(entity.id, entity);\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._tileset)) {\n entities.set(entity.id, entity);\n } else {\n removeTileset(this, entity, tilesetHash, primitives);\n entities.remove(entity.id);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n removeTileset(this, entity, tilesetHash, primitives);\n entities.remove(entity.id);\n }\n};\n\nfunction removeTileset(visualizer, entity, tilesetHash, primitives) {\n const tilesetData = tilesetHash[entity.id];\n if (defined(tilesetData)) {\n primitives.removeAndDestroy(tilesetData.tilesetPrimitive);\n delete tilesetHash[entity.id];\n }\n}\n\nfunction checkLoad(primitive, entity, tilesetHash) {\n primitive.readyPromise.catch(function (error) {\n console.error(error);\n tilesetHash[entity.id].loadFail = true;\n });\n}\nexport default Cesium3DTilesetVisualizer;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultEvenColor = Color.WHITE;\nconst defaultOddColor = Color.BLACK;\nconst defaultRepeat = new Cartesian2(2.0, 2.0);\n\n/**\n * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.\n * @alias CheckerboardMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.\n * @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.\n * @param {Property|Cartesian2} [options.repeat=new Cartesian2(2.0, 2.0)] A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.\n */\nfunction CheckerboardMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._evenColor = undefined;\n this._evenColorSubscription = undefined;\n this._oddColor = undefined;\n this._oddColorSubscription = undefined;\n this._repeat = undefined;\n this._repeatSubscription = undefined;\n\n this.evenColor = options.evenColor;\n this.oddColor = options.oddColor;\n this.repeat = options.repeat;\n}\n\nObject.defineProperties(CheckerboardMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof CheckerboardMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._evenColor) && //\n Property.isConstant(this._oddColor) && //\n Property.isConstant(this._repeat)\n );\n },\n },\n\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof CheckerboardMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the Property specifying the first {@link Color}.\n * @memberof CheckerboardMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n evenColor: createPropertyDescriptor(\"evenColor\"),\n\n /**\n * Gets or sets the Property specifying the second {@link Color}.\n * @memberof CheckerboardMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n oddColor: createPropertyDescriptor(\"oddColor\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.\n * @memberof CheckerboardMaterialProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(2.0, 2.0)\n */\n repeat: createPropertyDescriptor(\"repeat\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nCheckerboardMaterialProperty.prototype.getType = function (time) {\n return \"Checkerboard\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCheckerboardMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.lightColor = Property.getValueOrClonedDefault(\n this._evenColor,\n time,\n defaultEvenColor,\n result.lightColor\n );\n result.darkColor = Property.getValueOrClonedDefault(\n this._oddColor,\n time,\n defaultOddColor,\n result.darkColor\n );\n result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat);\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCheckerboardMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof CheckerboardMaterialProperty && //\n Property.equals(this._evenColor, other._evenColor) && //\n Property.equals(this._oddColor, other._oddColor) && //\n Property.equals(this._repeat, other._repeat))\n );\n};\nexport default CheckerboardMaterialProperty;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport Entity from \"./Entity.js\";\n\nconst entityOptionsScratch = {\n id: undefined,\n};\n\nfunction fireChangedEvent(collection) {\n if (collection._firing) {\n collection._refire = true;\n return;\n }\n\n if (collection._suspendCount === 0) {\n const added = collection._addedEntities;\n const removed = collection._removedEntities;\n const changed = collection._changedEntities;\n if (changed.length !== 0 || added.length !== 0 || removed.length !== 0) {\n collection._firing = true;\n do {\n collection._refire = false;\n const addedArray = added.values.slice(0);\n const removedArray = removed.values.slice(0);\n const changedArray = changed.values.slice(0);\n\n added.removeAll();\n removed.removeAll();\n changed.removeAll();\n collection._collectionChanged.raiseEvent(\n collection,\n addedArray,\n removedArray,\n changedArray\n );\n } while (collection._refire);\n collection._firing = false;\n }\n }\n}\n\n/**\n * An observable collection of {@link Entity} instances where each entity has a unique id.\n * @alias EntityCollection\n * @constructor\n *\n * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.\n */\nfunction EntityCollection(owner) {\n this._owner = owner;\n this._entities = new AssociativeArray();\n this._addedEntities = new AssociativeArray();\n this._removedEntities = new AssociativeArray();\n this._changedEntities = new AssociativeArray();\n this._suspendCount = 0;\n this._collectionChanged = new Event();\n this._id = createGuid();\n this._show = true;\n this._firing = false;\n this._refire = false;\n}\n\n/**\n * Prevents {@link EntityCollection#collectionChanged} events from being raised\n * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which\n * point a single event will be raised that covers all suspended operations.\n * This allows for many items to be added and removed efficiently.\n * This function can be safely called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n */\nEntityCollection.prototype.suspendEvents = function () {\n this._suspendCount++;\n};\n\n/**\n * Resumes raising {@link EntityCollection#collectionChanged} events immediately\n * when an item is added or removed. Any modifications made while while events were suspended\n * will be triggered as a single event when this function is called.\n * This function is reference counted and can safely be called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n *\n * @exception {DeveloperError} resumeEvents can not be called before suspendEvents.\n */\nEntityCollection.prototype.resumeEvents = function () {\n this._suspendCount--;\n fireChangedEvent(this);\n};\n\n/**\n * The signature of the event generated by {@link EntityCollection#collectionChanged}.\n * @callback EntityCollection.CollectionChangedEventCallback\n *\n * @param {EntityCollection} collection The collection that triggered the event.\n * @param {Entity[]} added The array of {@link Entity} instances that have been added to the collection.\n * @param {Entity[]} removed The array of {@link Entity} instances that have been removed from the collection.\n * @param {Entity[]} changed The array of {@link Entity} instances that have been modified.\n */\n\nObject.defineProperties(EntityCollection.prototype, {\n /**\n * Gets the event that is fired when entities are added or removed from the collection.\n * The generated event is a {@link EntityCollection.CollectionChangedEventCallback}.\n * @memberof EntityCollection.prototype\n * @readonly\n * @type {Event<EntityCollection.CollectionChangedEventCallback>}\n */\n collectionChanged: {\n get: function () {\n return this._collectionChanged;\n },\n },\n /**\n * Gets a globally unique identifier for this collection.\n * @memberof EntityCollection.prototype\n * @readonly\n * @type {String}\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * Gets the array of Entity instances in the collection.\n * This array should not be modified directly.\n * @memberof EntityCollection.prototype\n * @readonly\n * @type {Entity[]}\n */\n values: {\n get: function () {\n return this._entities.values;\n },\n },\n /**\n * Gets whether or not this entity collection should be\n * displayed. When true, each entity is only displayed if\n * its own show property is also true.\n * @memberof EntityCollection.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (value === this._show) {\n return;\n }\n\n //Since entity.isShowing includes the EntityCollection.show state\n //in its calculation, we need to loop over the entities array\n //twice, once to get the old showing value and a second time\n //to raise the changed event.\n this.suspendEvents();\n\n let i;\n const oldShows = [];\n const entities = this._entities.values;\n const entitiesLength = entities.length;\n\n for (i = 0; i < entitiesLength; i++) {\n oldShows.push(entities[i].isShowing);\n }\n\n this._show = value;\n\n for (i = 0; i < entitiesLength; i++) {\n const oldShow = oldShows[i];\n const entity = entities[i];\n if (oldShow !== entity.isShowing) {\n entity.definitionChanged.raiseEvent(\n entity,\n \"isShowing\",\n entity.isShowing,\n oldShow\n );\n }\n }\n\n this.resumeEvents();\n },\n },\n /**\n * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.\n * @memberof EntityCollection.prototype\n * @readonly\n * @type {DataSource|CompositeEntityCollection}\n */\n owner: {\n get: function () {\n return this._owner;\n },\n },\n});\n\n/**\n * Computes the maximum availability of the entities in the collection.\n * If the collection contains a mix of infinitely available data and non-infinite data,\n * it will return the interval pertaining to the non-infinite data only. If all\n * data is infinite, an infinite interval will be returned.\n *\n * @returns {TimeInterval} The availability of entities in the collection.\n */\nEntityCollection.prototype.computeAvailability = function () {\n let startTime = Iso8601.MAXIMUM_VALUE;\n let stopTime = Iso8601.MINIMUM_VALUE;\n const entities = this._entities.values;\n for (let i = 0, len = entities.length; i < len; i++) {\n const entity = entities[i];\n const availability = entity.availability;\n if (defined(availability)) {\n const start = availability.start;\n const stop = availability.stop;\n if (\n JulianDate.lessThan(start, startTime) &&\n !start.equals(Iso8601.MINIMUM_VALUE)\n ) {\n startTime = start;\n }\n if (\n JulianDate.greaterThan(stop, stopTime) &&\n !stop.equals(Iso8601.MAXIMUM_VALUE)\n ) {\n stopTime = stop;\n }\n }\n }\n\n if (Iso8601.MAXIMUM_VALUE.equals(startTime)) {\n startTime = Iso8601.MINIMUM_VALUE;\n }\n if (Iso8601.MINIMUM_VALUE.equals(stopTime)) {\n stopTime = Iso8601.MAXIMUM_VALUE;\n }\n return new TimeInterval({\n start: startTime,\n stop: stopTime,\n });\n};\n\n/**\n * Add an entity to the collection.\n *\n * @param {Entity | Entity.ConstructorOptions} entity The entity to be added.\n * @returns {Entity} The entity that was added.\n * @exception {DeveloperError} An entity with <entity.id> already exists in this collection.\n */\nEntityCollection.prototype.add = function (entity) {\n if (!(entity instanceof Entity)) {\n entity = new Entity(entity);\n }\n\n const id = entity.id;\n const entities = this._entities;\n if (entities.contains(id)) {\n throw new RuntimeError(\n `An entity with id ${id} already exists in this collection.`\n );\n }\n\n entity.entityCollection = this;\n entities.set(id, entity);\n\n if (!this._removedEntities.remove(id)) {\n this._addedEntities.set(id, entity);\n }\n entity.definitionChanged.addEventListener(\n EntityCollection.prototype._onEntityDefinitionChanged,\n this\n );\n\n fireChangedEvent(this);\n return entity;\n};\n\n/**\n * Removes an entity from the collection.\n *\n * @param {Entity} entity The entity to be removed.\n * @returns {Boolean} true if the item was removed, false if it did not exist in the collection.\n */\nEntityCollection.prototype.remove = function (entity) {\n if (!defined(entity)) {\n return false;\n }\n return this.removeById(entity.id);\n};\n\n/**\n * Returns true if the provided entity is in this collection, false otherwise.\n *\n * @param {Entity} entity The entity.\n * @returns {Boolean} true if the provided entity is in this collection, false otherwise.\n */\nEntityCollection.prototype.contains = function (entity) {\nreturn this._entities.get(entity.id) === entity;\n};\n\n/**\n * Removes an entity with the provided id from the collection.\n *\n * @param {String} id The id of the entity to remove.\n * @returns {Boolean} true if the item was removed, false if no item with the provided id existed in the collection.\n */\nEntityCollection.prototype.removeById = function (id) {\n if (!defined(id)) {\n return false;\n }\n\n const entities = this._entities;\n const entity = entities.get(id);\n if (!this._entities.remove(id)) {\n return false;\n }\n\n if (!this._addedEntities.remove(id)) {\n this._removedEntities.set(id, entity);\n this._changedEntities.remove(id);\n }\n this._entities.remove(id);\n entity.definitionChanged.removeEventListener(\n EntityCollection.prototype._onEntityDefinitionChanged,\n this\n );\n fireChangedEvent(this);\n\n return true;\n};\n\n/**\n * Removes all Entities from the collection.\n */\nEntityCollection.prototype.removeAll = function () {\n //The event should only contain items added before events were suspended\n //and the contents of the collection.\n const entities = this._entities;\n const entitiesLength = entities.length;\n const array = entities.values;\n\n const addedEntities = this._addedEntities;\n const removed = this._removedEntities;\n\n for (let i = 0; i < entitiesLength; i++) {\n const existingItem = array[i];\n const existingItemId = existingItem.id;\n const addedItem = addedEntities.get(existingItemId);\n if (!defined(addedItem)) {\n existingItem.definitionChanged.removeEventListener(\n EntityCollection.prototype._onEntityDefinitionChanged,\n this\n );\n removed.set(existingItemId, existingItem);\n }\n }\n\n entities.removeAll();\n addedEntities.removeAll();\n this._changedEntities.removeAll();\n fireChangedEvent(this);\n};\n\n/**\n * Gets an entity with the specified id.\n *\n * @param {String} id The id of the entity to retrieve.\n * @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.\n */\nEntityCollection.prototype.getById = function (id) {\n return this._entities.get(id);\n};\n\n/**\n * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.\n *\n * @param {String} id The id of the entity to retrieve or create.\n * @returns {Entity} The new or existing object.\n */\nEntityCollection.prototype.getOrCreateEntity = function (id) {\n let entity = this._entities.get(id);\n if (!defined(entity)) {\n entityOptionsScratch.id = id;\n entity = new Entity(entityOptionsScratch);\n this.add(entity);\n }\n return entity;\n};\n\nEntityCollection.prototype._onEntityDefinitionChanged = function (entity) {\n const id = entity.id;\n if (!this._addedEntities.contains(id)) {\n this._changedEntities.set(id, entity);\n }\n fireChangedEvent(this);\n};\nexport default EntityCollection;\n", "import createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Entity from \"./Entity.js\";\nimport EntityCollection from \"./EntityCollection.js\";\n\nconst entityOptionsScratch = {\n id: undefined,\n};\nconst entityIdScratch = new Array(2);\n\nfunction clean(entity) {\n const propertyNames = entity.propertyNames;\n const propertyNamesLength = propertyNames.length;\n for (let i = 0; i < propertyNamesLength; i++) {\n entity[propertyNames[i]] = undefined;\n }\n entity._name = undefined;\n entity._availability = undefined;\n}\n\nfunction subscribeToEntity(that, eventHash, collectionId, entity) {\n entityIdScratch[0] = collectionId;\n entityIdScratch[1] = entity.id;\n eventHash[\n JSON.stringify(entityIdScratch)\n ] = entity.definitionChanged.addEventListener(\n CompositeEntityCollection.prototype._onDefinitionChanged,\n that\n );\n}\n\nfunction unsubscribeFromEntity(that, eventHash, collectionId, entity) {\n entityIdScratch[0] = collectionId;\n entityIdScratch[1] = entity.id;\n const id = JSON.stringify(entityIdScratch);\n eventHash[id]();\n eventHash[id] = undefined;\n}\n\nfunction recomposite(that) {\n that._shouldRecomposite = true;\n if (that._suspendCount !== 0) {\n return;\n }\n\n const collections = that._collections;\n const collectionsLength = collections.length;\n\n const collectionsCopy = that._collectionsCopy;\n const collectionsCopyLength = collectionsCopy.length;\n\n let i;\n let entity;\n let entities;\n let iEntities;\n let collection;\n const composite = that._composite;\n const newEntities = new EntityCollection(that);\n const eventHash = that._eventHash;\n let collectionId;\n\n for (i = 0; i < collectionsCopyLength; i++) {\n collection = collectionsCopy[i];\n collection.collectionChanged.removeEventListener(\n CompositeEntityCollection.prototype._onCollectionChanged,\n that\n );\n entities = collection.values;\n collectionId = collection.id;\n for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {\n entity = entities[iEntities];\n unsubscribeFromEntity(that, eventHash, collectionId, entity);\n }\n }\n\n for (i = collectionsLength - 1; i >= 0; i--) {\n collection = collections[i];\n collection.collectionChanged.addEventListener(\n CompositeEntityCollection.prototype._onCollectionChanged,\n that\n );\n\n //Merge all of the existing entities.\n entities = collection.values;\n collectionId = collection.id;\n for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {\n entity = entities[iEntities];\n subscribeToEntity(that, eventHash, collectionId, entity);\n\n let compositeEntity = newEntities.getById(entity.id);\n if (!defined(compositeEntity)) {\n compositeEntity = composite.getById(entity.id);\n if (!defined(compositeEntity)) {\n entityOptionsScratch.id = entity.id;\n compositeEntity = new Entity(entityOptionsScratch);\n } else {\n clean(compositeEntity);\n }\n newEntities.add(compositeEntity);\n }\n compositeEntity.merge(entity);\n }\n }\n that._collectionsCopy = collections.slice(0);\n\n composite.suspendEvents();\n composite.removeAll();\n const newEntitiesArray = newEntities.values;\n for (i = 0; i < newEntitiesArray.length; i++) {\n composite.add(newEntitiesArray[i]);\n }\n composite.resumeEvents();\n}\n\n/**\n * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.\n * If a Entity with the same ID exists in multiple collections, it is non-destructively\n * merged into a single new entity instance. If an entity has the same property in multiple\n * collections, the property of the Entity in the last collection of the list it\n * belongs to is used. CompositeEntityCollection can be used almost anywhere that a\n * EntityCollection is used.\n *\n * @alias CompositeEntityCollection\n * @constructor\n *\n * @param {EntityCollection[]} [collections] The initial list of EntityCollection instances to merge.\n * @param {DataSource|CompositeEntityCollection} [owner] The data source (or composite entity collection) which created this collection.\n */\nfunction CompositeEntityCollection(collections, owner) {\n this._owner = owner;\n this._composite = new EntityCollection(this);\n this._suspendCount = 0;\n this._collections = defined(collections) ? collections.slice() : [];\n this._collectionsCopy = [];\n this._id = createGuid();\n this._eventHash = {};\n recomposite(this);\n this._shouldRecomposite = false;\n}\n\nObject.defineProperties(CompositeEntityCollection.prototype, {\n /**\n * Gets the event that is fired when entities are added or removed from the collection.\n * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.\n * @memberof CompositeEntityCollection.prototype\n * @readonly\n * @type {Event}\n */\n collectionChanged: {\n get: function () {\n return this._composite._collectionChanged;\n },\n },\n /**\n * Gets a globally unique identifier for this collection.\n * @memberof CompositeEntityCollection.prototype\n * @readonly\n * @type {String}\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * Gets the array of Entity instances in the collection.\n * This array should not be modified directly.\n * @memberof CompositeEntityCollection.prototype\n * @readonly\n * @type {Entity[]}\n */\n values: {\n get: function () {\n return this._composite.values;\n },\n },\n /**\n * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.\n * @memberof CompositeEntityCollection.prototype\n * @readonly\n * @type {DataSource|CompositeEntityCollection}\n */\n owner: {\n get: function () {\n return this._owner;\n },\n },\n});\n\n/**\n * Adds a collection to the composite.\n *\n * @param {EntityCollection} collection the collection to add.\n * @param {Number} [index] the index to add the collection at. If omitted, the collection will\n * added on top of all existing collections.\n *\n * @exception {DeveloperError} index, if supplied, must be greater than or equal to zero and less than or equal to the number of collections.\n */\nCompositeEntityCollection.prototype.addCollection = function (\n collection,\n index\n) {\n const hasIndex = defined(index);\n if (!hasIndex) {\n index = this._collections.length;\n this._collections.push(collection);\n } else {\n this._collections.splice(index, 0, collection);\n }\n\n recomposite(this);\n};\n\n/**\n * Removes a collection from this composite, if present.\n *\n * @param {EntityCollection} collection The collection to remove.\n * @returns {Boolean} true if the collection was in the composite and was removed,\n * false if the collection was not in the composite.\n */\nCompositeEntityCollection.prototype.removeCollection = function (collection) {\n const index = this._collections.indexOf(collection);\n if (index !== -1) {\n this._collections.splice(index, 1);\n recomposite(this);\n return true;\n }\n return false;\n};\n\n/**\n * Removes all collections from this composite.\n */\nCompositeEntityCollection.prototype.removeAllCollections = function () {\n this._collections.length = 0;\n recomposite(this);\n};\n\n/**\n * Checks to see if the composite contains a given collection.\n *\n * @param {EntityCollection} collection the collection to check for.\n * @returns {Boolean} true if the composite contains the collection, false otherwise.\n */\nCompositeEntityCollection.prototype.containsCollection = function (collection) {\n return this._collections.indexOf(collection) !== -1;\n};\n\n/**\n * Returns true if the provided entity is in this collection, false otherwise.\n *\n * @param {Entity} entity The entity.\n * @returns {Boolean} true if the provided entity is in this collection, false otherwise.\n */\nCompositeEntityCollection.prototype.contains = function (entity) {\n return this._composite.contains(entity);\n};\n\n/**\n * Determines the index of a given collection in the composite.\n *\n * @param {EntityCollection} collection The collection to find the index of.\n * @returns {Number} The index of the collection in the composite, or -1 if the collection does not exist in the composite.\n */\nCompositeEntityCollection.prototype.indexOfCollection = function (collection) {\n return this._collections.indexOf(collection);\n};\n\n/**\n * Gets a collection by index from the composite.\n *\n * @param {Number} index the index to retrieve.\n */\nCompositeEntityCollection.prototype.getCollection = function (index) {\n return this._collections[index];\n};\n\n/**\n * Gets the number of collections in this composite.\n */\nCompositeEntityCollection.prototype.getCollectionsLength = function () {\n return this._collections.length;\n};\n\nfunction getCollectionIndex(collections, collection) {\n const index = collections.indexOf(collection);\n\n return index;\n}\n\nfunction swapCollections(composite, i, j) {\n const arr = composite._collections;\n i = CesiumMath.clamp(i, 0, arr.length - 1);\n j = CesiumMath.clamp(j, 0, arr.length - 1);\n\n if (i === j) {\n return;\n }\n\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n\n recomposite(composite);\n}\n\n/**\n * Raises a collection up one position in the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.raiseCollection = function (collection) {\n const index = getCollectionIndex(this._collections, collection);\n swapCollections(this, index, index + 1);\n};\n\n/**\n * Lowers a collection down one position in the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.lowerCollection = function (collection) {\n const index = getCollectionIndex(this._collections, collection);\n swapCollections(this, index, index - 1);\n};\n\n/**\n * Raises a collection to the top of the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.raiseCollectionToTop = function (\n collection\n) {\n const index = getCollectionIndex(this._collections, collection);\n if (index === this._collections.length - 1) {\n return;\n }\n this._collections.splice(index, 1);\n this._collections.push(collection);\n\n recomposite(this);\n};\n\n/**\n * Lowers a collection to the bottom of the composite.\n *\n * @param {EntityCollection} collection the collection to move.\n *\n * @exception {DeveloperError} collection is not in this composite.\n */\nCompositeEntityCollection.prototype.lowerCollectionToBottom = function (\n collection\n) {\n const index = getCollectionIndex(this._collections, collection);\n if (index === 0) {\n return;\n }\n this._collections.splice(index, 1);\n this._collections.splice(0, 0, collection);\n\n recomposite(this);\n};\n\n/**\n * Prevents {@link EntityCollection#collectionChanged} events from being raised\n * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which\n * point a single event will be raised that covers all suspended operations.\n * This allows for many items to be added and removed efficiently.\n * While events are suspended, recompositing of the collections will\n * also be suspended, as this can be a costly operation.\n * This function can be safely called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n */\nCompositeEntityCollection.prototype.suspendEvents = function () {\n this._suspendCount++;\n this._composite.suspendEvents();\n};\n\n/**\n * Resumes raising {@link EntityCollection#collectionChanged} events immediately\n * when an item is added or removed. Any modifications made while while events were suspended\n * will be triggered as a single event when this function is called. This function also ensures\n * the collection is recomposited if events are also resumed.\n * This function is reference counted and can safely be called multiple times as long as there\n * are corresponding calls to {@link EntityCollection#resumeEvents}.\n *\n * @exception {DeveloperError} resumeEvents can not be called before suspendEvents.\n */\nCompositeEntityCollection.prototype.resumeEvents = function () {\n this._suspendCount--;\n // recomposite before triggering events (but only if required for performance) that might depend on a composited collection\n if (this._shouldRecomposite && this._suspendCount === 0) {\n recomposite(this);\n this._shouldRecomposite = false;\n }\n\n this._composite.resumeEvents();\n};\n\n/**\n * Computes the maximum availability of the entities in the collection.\n * If the collection contains a mix of infinitely available data and non-infinite data,\n * It will return the interval pertaining to the non-infinite data only. If all\n * data is infinite, an infinite interval will be returned.\n *\n * @returns {TimeInterval} The availability of entities in the collection.\n */\nCompositeEntityCollection.prototype.computeAvailability = function () {\n return this._composite.computeAvailability();\n};\n\n/**\n * Gets an entity with the specified id.\n *\n * @param {String} id The id of the entity to retrieve.\n * @returns {Entity|undefined} The entity with the provided id or undefined if the id did not exist in the collection.\n */\nCompositeEntityCollection.prototype.getById = function (id) {\n return this._composite.getById(id);\n};\n\nCompositeEntityCollection.prototype._onCollectionChanged = function (\n collection,\n added,\n removed\n) {\n const collections = this._collectionsCopy;\n const collectionsLength = collections.length;\n const composite = this._composite;\n composite.suspendEvents();\n\n let i;\n let q;\n let entity;\n let compositeEntity;\n const removedLength = removed.length;\n const eventHash = this._eventHash;\n const collectionId = collection.id;\n for (i = 0; i < removedLength; i++) {\n const removedEntity = removed[i];\n unsubscribeFromEntity(this, eventHash, collectionId, removedEntity);\n\n const removedId = removedEntity.id;\n //Check if the removed entity exists in any of the remaining collections\n //If so, we clean and remerge it.\n for (q = collectionsLength - 1; q >= 0; q--) {\n entity = collections[q].getById(removedId);\n if (defined(entity)) {\n if (!defined(compositeEntity)) {\n compositeEntity = composite.getById(removedId);\n clean(compositeEntity);\n }\n compositeEntity.merge(entity);\n }\n }\n //We never retrieved the compositeEntity, which means it no longer\n //exists in any of the collections, remove it from the composite.\n if (!defined(compositeEntity)) {\n composite.removeById(removedId);\n }\n compositeEntity = undefined;\n }\n\n const addedLength = added.length;\n for (i = 0; i < addedLength; i++) {\n const addedEntity = added[i];\n subscribeToEntity(this, eventHash, collectionId, addedEntity);\n\n const addedId = addedEntity.id;\n //We know the added entity exists in at least one collection,\n //but we need to check all collections and re-merge in order\n //to maintain the priority of properties.\n for (q = collectionsLength - 1; q >= 0; q--) {\n entity = collections[q].getById(addedId);\n if (defined(entity)) {\n if (!defined(compositeEntity)) {\n compositeEntity = composite.getById(addedId);\n if (!defined(compositeEntity)) {\n entityOptionsScratch.id = addedId;\n compositeEntity = new Entity(entityOptionsScratch);\n composite.add(compositeEntity);\n } else {\n clean(compositeEntity);\n }\n }\n compositeEntity.merge(entity);\n }\n }\n compositeEntity = undefined;\n }\n\n composite.resumeEvents();\n};\n\nCompositeEntityCollection.prototype._onDefinitionChanged = function (\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n const collections = this._collections;\n const composite = this._composite;\n\n const collectionsLength = collections.length;\n const id = entity.id;\n const compositeEntity = composite.getById(id);\n let compositeProperty = compositeEntity[propertyName];\n const newProperty = !defined(compositeProperty);\n\n let firstTime = true;\n for (let q = collectionsLength - 1; q >= 0; q--) {\n const innerEntity = collections[q].getById(entity.id);\n if (defined(innerEntity)) {\n const property = innerEntity[propertyName];\n if (defined(property)) {\n if (firstTime) {\n firstTime = false;\n //We only want to clone if the property is also mergeable.\n //This ensures that leaf properties are referenced and not copied,\n //which is the entire point of compositing.\n if (defined(property.merge) && defined(property.clone)) {\n compositeProperty = property.clone(compositeProperty);\n } else {\n compositeProperty = property;\n break;\n }\n }\n compositeProperty.merge(property);\n }\n }\n }\n\n if (\n newProperty &&\n compositeEntity.propertyNames.indexOf(propertyName) === -1\n ) {\n compositeEntity.addProperty(propertyName);\n }\n\n compositeEntity[propertyName] = compositeProperty;\n};\nexport default CompositeEntityCollection;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A convenience object that simplifies the common pattern of attaching event listeners\n * to several events, then removing all those listeners at once later, for example, in\n * a destroy method.\n *\n * @alias EventHelper\n * @constructor\n *\n *\n * @example\n * const helper = new Cesium.EventHelper();\n *\n * helper.add(someObject.event, listener1, this);\n * helper.add(otherObject.event, listener2, this);\n *\n * // later...\n * helper.removeAll();\n *\n * @see Event\n */\nfunction EventHelper() {\n this._removalFunctions = [];\n}\n\n/**\n * Adds a listener to an event, and records the registration to be cleaned up later.\n *\n * @param {Event} event The event to attach to.\n * @param {Function} listener The function to be executed when the event is raised.\n * @param {Object} [scope] An optional object scope to serve as the <code>this</code>\n * pointer in which the listener function will execute.\n * @returns {EventHelper.RemoveCallback} A function that will remove this event listener when invoked.\n *\n * @see Event#addEventListener\n */\nEventHelper.prototype.add = function (event, listener, scope) {\n const removalFunction = event.addEventListener(listener, scope);\n this._removalFunctions.push(removalFunction);\n\n const that = this;\n return function () {\n removalFunction();\n const removalFunctions = that._removalFunctions;\n removalFunctions.splice(removalFunctions.indexOf(removalFunction), 1);\n };\n};\n\n/**\n * Unregisters all previously added listeners.\n *\n * @see Event#removeEventListener\n */\nEventHelper.prototype.removeAll = function () {\n const removalFunctions = this._removalFunctions;\n for (let i = 0, len = removalFunctions.length; i < len; ++i) {\n removalFunctions[i]();\n }\n removalFunctions.length = 0;\n};\n\n/**\n * A function that removes a listener.\n * @callback EventHelper.RemoveCallback\n */\nexport default EventHelper;\n", "import binarySearch from \"./binarySearch.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport GregorianDate from \"./GregorianDate.js\";\nimport isLeapYear from \"./isLeapYear.js\";\nimport Iso8601 from \"./Iso8601.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport TimeInterval from \"./TimeInterval.js\";\n\nfunction compareIntervalStartTimes(left, right) {\n return JulianDate.compare(left.start, right.start);\n}\n\n/**\n * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.\n * @alias TimeIntervalCollection\n * @constructor\n *\n * @param {TimeInterval[]} [intervals] An array of intervals to add to the collection.\n */\nfunction TimeIntervalCollection(intervals) {\n this._intervals = [];\n this._changedEvent = new Event();\n\n if (defined(intervals)) {\n const length = intervals.length;\n for (let i = 0; i < length; i++) {\n this.addInterval(intervals[i]);\n }\n }\n}\n\nObject.defineProperties(TimeIntervalCollection.prototype, {\n /**\n * Gets an event that is raised whenever the collection of intervals change.\n * @memberof TimeIntervalCollection.prototype\n * @type {Event}\n * @readonly\n */\n changedEvent: {\n get: function () {\n return this._changedEvent;\n },\n },\n\n /**\n * Gets the start time of the collection.\n * @memberof TimeIntervalCollection.prototype\n * @type {JulianDate}\n * @readonly\n */\n start: {\n get: function () {\n const intervals = this._intervals;\n return intervals.length === 0 ? undefined : intervals[0].start;\n },\n },\n\n /**\n * Gets whether or not the start time is included in the collection.\n * @memberof TimeIntervalCollection.prototype\n * @type {Boolean}\n * @readonly\n */\n isStartIncluded: {\n get: function () {\n const intervals = this._intervals;\n return intervals.length === 0 ? false : intervals[0].isStartIncluded;\n },\n },\n\n /**\n * Gets the stop time of the collection.\n * @memberof TimeIntervalCollection.prototype\n * @type {JulianDate}\n * @readonly\n */\n stop: {\n get: function () {\n const intervals = this._intervals;\n const length = intervals.length;\n return length === 0 ? undefined : intervals[length - 1].stop;\n },\n },\n\n /**\n * Gets whether or not the stop time is included in the collection.\n * @memberof TimeIntervalCollection.prototype\n * @type {Boolean}\n * @readonly\n */\n isStopIncluded: {\n get: function () {\n const intervals = this._intervals;\n const length = intervals.length;\n return length === 0 ? false : intervals[length - 1].isStopIncluded;\n },\n },\n\n /**\n * Gets the number of intervals in the collection.\n * @memberof TimeIntervalCollection.prototype\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._intervals.length;\n },\n },\n\n /**\n * Gets whether or not the collection is empty.\n * @memberof TimeIntervalCollection.prototype\n * @type {Boolean}\n * @readonly\n */\n isEmpty: {\n get: function () {\n return this._intervals.length === 0;\n },\n },\n});\n\n/**\n * Compares this instance against the provided instance componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {TimeIntervalCollection} [right] The right hand side collection.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollection.prototype.equals = function (right, dataComparer) {\n if (this === right) {\n return true;\n }\n if (!(right instanceof TimeIntervalCollection)) {\n return false;\n }\n const intervals = this._intervals;\n const rightIntervals = right._intervals;\n const length = intervals.length;\n if (length !== rightIntervals.length) {\n return false;\n }\n for (let i = 0; i < length; i++) {\n if (!TimeInterval.equals(intervals[i], rightIntervals[i], dataComparer)) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Gets the interval at the specified index.\n *\n * @param {Number} index The index of the interval to retrieve.\n * @returns {TimeInterval|undefined} The interval at the specified index, or <code>undefined</code> if no interval exists as that index.\n */\nTimeIntervalCollection.prototype.get = function (index) {\n return this._intervals[index];\n};\n\n/**\n * Removes all intervals from the collection.\n */\nTimeIntervalCollection.prototype.removeAll = function () {\n if (this._intervals.length > 0) {\n this._intervals.length = 0;\n this._changedEvent.raiseEvent(this);\n }\n};\n\n/**\n * Finds and returns the interval that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {TimeInterval|undefined} The interval containing the specified date, <code>undefined</code> if no such interval exists.\n */\nTimeIntervalCollection.prototype.findIntervalContainingDate = function (date) {\n const index = this.indexOf(date);\n return index >= 0 ? this._intervals[index] : undefined;\n};\n\n/**\n * Finds and returns the data for the interval that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {Object} The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.\n */\nTimeIntervalCollection.prototype.findDataForIntervalContainingDate = function (\n date\n) {\n const index = this.indexOf(date);\n return index >= 0 ? this._intervals[index].data : undefined;\n};\n\n/**\n * Checks if the specified date is inside this collection.\n *\n * @param {JulianDate} julianDate The date to check.\n * @returns {Boolean} <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.\n */\nTimeIntervalCollection.prototype.contains = function (julianDate) {\n return this.indexOf(julianDate) >= 0;\n};\n\nconst indexOfScratch = new TimeInterval();\n\n/**\n * Finds and returns the index of the interval in the collection that contains the specified date.\n *\n * @param {JulianDate} date The date to search for.\n * @returns {Number} The index of the interval that contains the specified date, if no such interval exists,\n * it returns a negative number which is the bitwise complement of the index of the next interval that\n * starts after the date, or if no interval starts after the specified date, the bitwise complement of\n * the length of the collection.\n */\nTimeIntervalCollection.prototype.indexOf = function (date) {\n const intervals = this._intervals;\n indexOfScratch.start = date;\n indexOfScratch.stop = date;\n let index = binarySearch(\n intervals,\n indexOfScratch,\n compareIntervalStartTimes\n );\n if (index >= 0) {\n if (intervals[index].isStartIncluded) {\n return index;\n }\n\n if (\n index > 0 &&\n intervals[index - 1].stop.equals(date) &&\n intervals[index - 1].isStopIncluded\n ) {\n return index - 1;\n }\n return ~index;\n }\n\n index = ~index;\n if (\n index > 0 &&\n index - 1 < intervals.length &&\n TimeInterval.contains(intervals[index - 1], date)\n ) {\n return index - 1;\n }\n return ~index;\n};\n\n/**\n * Returns the first interval in the collection that matches the specified parameters.\n * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {JulianDate} [options.start] The start time of the interval.\n * @param {JulianDate} [options.stop] The stop time of the interval.\n * @param {Boolean} [options.isStartIncluded] <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded] <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.\n * @returns {TimeInterval|undefined} The first interval in the collection that matches the specified parameters.\n */\nTimeIntervalCollection.prototype.findInterval = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const start = options.start;\n const stop = options.stop;\n const isStartIncluded = options.isStartIncluded;\n const isStopIncluded = options.isStopIncluded;\n\n const intervals = this._intervals;\n for (let i = 0, len = intervals.length; i < len; i++) {\n const interval = intervals[i];\n if (\n (!defined(start) || interval.start.equals(start)) &&\n (!defined(stop) || interval.stop.equals(stop)) &&\n (!defined(isStartIncluded) ||\n interval.isStartIncluded === isStartIncluded) &&\n (!defined(isStopIncluded) || interval.isStopIncluded === isStopIncluded)\n ) {\n return intervals[i];\n }\n }\n return undefined;\n};\n\n/**\n * Adds an interval to the collection, merging intervals that contain the same data and\n * splitting intervals of different data as needed in order to maintain a non-overlapping collection.\n * The data in the new interval takes precedence over any existing intervals in the collection.\n *\n * @param {TimeInterval} interval The interval to add.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n */\nTimeIntervalCollection.prototype.addInterval = function (\n interval,\n dataComparer\n) {\n if (interval.isEmpty) {\n return;\n }\n\n const intervals = this._intervals;\n\n // Handle the common case quickly: we're adding a new interval which is after all existing intervals.\n if (\n intervals.length === 0 ||\n JulianDate.greaterThan(interval.start, intervals[intervals.length - 1].stop)\n ) {\n intervals.push(interval);\n this._changedEvent.raiseEvent(this);\n return;\n }\n\n // Keep the list sorted by the start date\n let index = binarySearch(intervals, interval, compareIntervalStartTimes);\n if (index < 0) {\n index = ~index;\n } else {\n // interval's start date exactly equals the start date of at least one interval in the collection.\n // It could actually equal the start date of two intervals if one of them does not actually\n // include the date. In that case, the binary search could have found either. We need to\n // look at the surrounding intervals and their IsStartIncluded properties in order to make sure\n // we're working with the correct interval.\n\n // eslint-disable-next-line no-lonely-if\n if (\n index > 0 &&\n interval.isStartIncluded &&\n intervals[index - 1].isStartIncluded &&\n intervals[index - 1].start.equals(interval.start)\n ) {\n --index;\n } else if (\n index < intervals.length &&\n !interval.isStartIncluded &&\n intervals[index].isStartIncluded &&\n intervals[index].start.equals(interval.start)\n ) {\n ++index;\n }\n }\n\n let comparison;\n if (index > 0) {\n // Not the first thing in the list, so see if the interval before this one\n // overlaps this one.\n\n comparison = JulianDate.compare(intervals[index - 1].stop, interval.start);\n if (\n comparison > 0 ||\n (comparison === 0 &&\n (intervals[index - 1].isStopIncluded || interval.isStartIncluded))\n ) {\n // There is an overlap\n if (\n defined(dataComparer)\n ? dataComparer(intervals[index - 1].data, interval.data)\n : intervals[index - 1].data === interval.data\n ) {\n // Overlapping intervals have the same data, so combine them\n if (JulianDate.greaterThan(interval.stop, intervals[index - 1].stop)) {\n interval = new TimeInterval({\n start: intervals[index - 1].start,\n stop: interval.stop,\n isStartIncluded: intervals[index - 1].isStartIncluded,\n isStopIncluded: interval.isStopIncluded,\n data: interval.data,\n });\n } else {\n interval = new TimeInterval({\n start: intervals[index - 1].start,\n stop: intervals[index - 1].stop,\n isStartIncluded: intervals[index - 1].isStartIncluded,\n isStopIncluded:\n intervals[index - 1].isStopIncluded ||\n (interval.stop.equals(intervals[index - 1].stop) &&\n interval.isStopIncluded),\n data: interval.data,\n });\n }\n intervals.splice(index - 1, 1);\n --index;\n } else {\n // Overlapping intervals have different data. The new interval\n // being added 'wins' so truncate the previous interval.\n // If the existing interval extends past the end of the new one,\n // split the existing interval into two intervals.\n comparison = JulianDate.compare(\n intervals[index - 1].stop,\n interval.stop\n );\n if (\n comparison > 0 ||\n (comparison === 0 &&\n intervals[index - 1].isStopIncluded &&\n !interval.isStopIncluded)\n ) {\n intervals.splice(\n index,\n 0,\n new TimeInterval({\n start: interval.stop,\n stop: intervals[index - 1].stop,\n isStartIncluded: !interval.isStopIncluded,\n isStopIncluded: intervals[index - 1].isStopIncluded,\n data: intervals[index - 1].data,\n })\n );\n }\n intervals[index - 1] = new TimeInterval({\n start: intervals[index - 1].start,\n stop: interval.start,\n isStartIncluded: intervals[index - 1].isStartIncluded,\n isStopIncluded: !interval.isStartIncluded,\n data: intervals[index - 1].data,\n });\n }\n }\n }\n\n while (index < intervals.length) {\n // Not the last thing in the list, so see if the intervals after this one overlap this one.\n comparison = JulianDate.compare(interval.stop, intervals[index].start);\n if (\n comparison > 0 ||\n (comparison === 0 &&\n (interval.isStopIncluded || intervals[index].isStartIncluded))\n ) {\n // There is an overlap\n if (\n defined(dataComparer)\n ? dataComparer(intervals[index].data, interval.data)\n : intervals[index].data === interval.data\n ) {\n // Overlapping intervals have the same data, so combine them\n interval = new TimeInterval({\n start: interval.start,\n stop: JulianDate.greaterThan(intervals[index].stop, interval.stop)\n ? intervals[index].stop\n : interval.stop,\n isStartIncluded: interval.isStartIncluded,\n isStopIncluded: JulianDate.greaterThan(\n intervals[index].stop,\n interval.stop\n )\n ? intervals[index].isStopIncluded\n : interval.isStopIncluded,\n data: interval.data,\n });\n intervals.splice(index, 1);\n } else {\n // Overlapping intervals have different data. The new interval\n // being added 'wins' so truncate the next interval.\n intervals[index] = new TimeInterval({\n start: interval.stop,\n stop: intervals[index].stop,\n isStartIncluded: !interval.isStopIncluded,\n isStopIncluded: intervals[index].isStopIncluded,\n data: intervals[index].data,\n });\n\n if (intervals[index].isEmpty) {\n intervals.splice(index, 1);\n } else {\n // Found a partial span, so it is not possible for the next\n // interval to be spanned at all. Stop looking.\n break;\n }\n }\n } else {\n // Found the last one we're spanning, so stop looking.\n break;\n }\n }\n\n // Add the new interval\n intervals.splice(index, 0, interval);\n this._changedEvent.raiseEvent(this);\n};\n\n/**\n * Removes the specified interval from this interval collection, creating a hole over the specified interval.\n * The data property of the input interval is ignored.\n *\n * @param {TimeInterval} interval The interval to remove.\n * @returns {Boolean} <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.\n */\nTimeIntervalCollection.prototype.removeInterval = function (interval) {\n if (interval.isEmpty) {\n return false;\n }\n\n const intervals = this._intervals;\n\n let index = binarySearch(intervals, interval, compareIntervalStartTimes);\n if (index < 0) {\n index = ~index;\n }\n\n let result = false;\n\n // Check for truncation of the end of the previous interval.\n if (\n index > 0 &&\n (JulianDate.greaterThan(intervals[index - 1].stop, interval.start) ||\n (intervals[index - 1].stop.equals(interval.start) &&\n intervals[index - 1].isStopIncluded &&\n interval.isStartIncluded))\n ) {\n result = true;\n\n if (\n JulianDate.greaterThan(intervals[index - 1].stop, interval.stop) ||\n (intervals[index - 1].isStopIncluded &&\n !interval.isStopIncluded &&\n intervals[index - 1].stop.equals(interval.stop))\n ) {\n // Break the existing interval into two pieces\n intervals.splice(\n index,\n 0,\n new TimeInterval({\n start: interval.stop,\n stop: intervals[index - 1].stop,\n isStartIncluded: !interval.isStopIncluded,\n isStopIncluded: intervals[index - 1].isStopIncluded,\n data: intervals[index - 1].data,\n })\n );\n }\n intervals[index - 1] = new TimeInterval({\n start: intervals[index - 1].start,\n stop: interval.start,\n isStartIncluded: intervals[index - 1].isStartIncluded,\n isStopIncluded: !interval.isStartIncluded,\n data: intervals[index - 1].data,\n });\n }\n\n // Check if the Start of the current interval should remain because interval.start is the same but\n // it is not included.\n if (\n index < intervals.length &&\n !interval.isStartIncluded &&\n intervals[index].isStartIncluded &&\n interval.start.equals(intervals[index].start)\n ) {\n result = true;\n\n intervals.splice(\n index,\n 0,\n new TimeInterval({\n start: intervals[index].start,\n stop: intervals[index].start,\n isStartIncluded: true,\n isStopIncluded: true,\n data: intervals[index].data,\n })\n );\n ++index;\n }\n\n // Remove any intervals that are completely overlapped by the input interval.\n while (\n index < intervals.length &&\n JulianDate.greaterThan(interval.stop, intervals[index].stop)\n ) {\n result = true;\n intervals.splice(index, 1);\n }\n\n // Check for the case where the input interval ends on the same date\n // as an existing interval.\n if (index < intervals.length && interval.stop.equals(intervals[index].stop)) {\n result = true;\n\n if (!interval.isStopIncluded && intervals[index].isStopIncluded) {\n // Last point of interval should remain because the stop date is included in\n // the existing interval but is not included in the input interval.\n if (\n index + 1 < intervals.length &&\n intervals[index + 1].start.equals(interval.stop) &&\n intervals[index].data === intervals[index + 1].data\n ) {\n // Combine single point with the next interval\n intervals.splice(index, 1);\n intervals[index] = new TimeInterval({\n start: intervals[index].start,\n stop: intervals[index].stop,\n isStartIncluded: true,\n isStopIncluded: intervals[index].isStopIncluded,\n data: intervals[index].data,\n });\n } else {\n intervals[index] = new TimeInterval({\n start: interval.stop,\n stop: interval.stop,\n isStartIncluded: true,\n isStopIncluded: true,\n data: intervals[index].data,\n });\n }\n } else {\n // Interval is completely overlapped\n intervals.splice(index, 1);\n }\n }\n\n // Truncate any partially-overlapped intervals.\n if (\n index < intervals.length &&\n (JulianDate.greaterThan(interval.stop, intervals[index].start) ||\n (interval.stop.equals(intervals[index].start) &&\n interval.isStopIncluded &&\n intervals[index].isStartIncluded))\n ) {\n result = true;\n intervals[index] = new TimeInterval({\n start: interval.stop,\n stop: intervals[index].stop,\n isStartIncluded: !interval.isStopIncluded,\n isStopIncluded: intervals[index].isStopIncluded,\n data: intervals[index].data,\n });\n }\n\n if (result) {\n this._changedEvent.raiseEvent(this);\n }\n\n return result;\n};\n\n/**\n * Creates a new instance that is the intersection of this collection and the provided collection.\n *\n * @param {TimeIntervalCollection} other The collection to intersect with.\n * @param {TimeInterval.DataComparer} [dataComparer] A function which compares the data of the two intervals. If omitted, reference equality is used.\n * @param {TimeInterval.MergeCallback} [mergeCallback] A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.\n * @returns {TimeIntervalCollection} A new TimeIntervalCollection which is the intersection of this collection and the provided collection.\n */\nTimeIntervalCollection.prototype.intersect = function (\n other,\n dataComparer,\n mergeCallback\n) {\n const result = new TimeIntervalCollection();\n let left = 0;\n let right = 0;\n const intervals = this._intervals;\n const otherIntervals = other._intervals;\n\n while (left < intervals.length && right < otherIntervals.length) {\n const leftInterval = intervals[left];\n const rightInterval = otherIntervals[right];\n if (JulianDate.lessThan(leftInterval.stop, rightInterval.start)) {\n ++left;\n } else if (JulianDate.lessThan(rightInterval.stop, leftInterval.start)) {\n ++right;\n } else {\n // The following will return an intersection whose data is 'merged' if the callback is defined\n if (\n defined(mergeCallback) ||\n (defined(dataComparer) &&\n dataComparer(leftInterval.data, rightInterval.data)) ||\n (!defined(dataComparer) && rightInterval.data === leftInterval.data)\n ) {\n const intersection = TimeInterval.intersect(\n leftInterval,\n rightInterval,\n new TimeInterval(),\n mergeCallback\n );\n if (!intersection.isEmpty) {\n // Since we start with an empty collection for 'result', and there are no overlapping intervals in 'this' (as a rule),\n // the 'intersection' will never overlap with a previous interval in 'result'. So, no need to do any additional 'merging'.\n result.addInterval(intersection, dataComparer);\n }\n }\n\n if (\n JulianDate.lessThan(leftInterval.stop, rightInterval.stop) ||\n (leftInterval.stop.equals(rightInterval.stop) &&\n !leftInterval.isStopIncluded &&\n rightInterval.isStopIncluded)\n ) {\n ++left;\n } else {\n ++right;\n }\n }\n }\n return result;\n};\n\n/**\n * Creates a new instance from a JulianDate array.\n *\n * @param {Object} options Object with the following properties:\n * @param {JulianDate[]} options.julianDates An array of ISO 8601 dates.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.\n * @param {Boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromJulianDateArray = function (options, result) {\n if (!defined(result)) {\n result = new TimeIntervalCollection();\n }\n\n const julianDates = options.julianDates;\n const length = julianDates.length;\n const dataCallback = options.dataCallback;\n\n const isStartIncluded = defaultValue(options.isStartIncluded, true);\n const isStopIncluded = defaultValue(options.isStopIncluded, true);\n const leadingInterval = defaultValue(options.leadingInterval, false);\n const trailingInterval = defaultValue(options.trailingInterval, false);\n let interval;\n\n // Add a default interval, which will only end up being used up to first interval\n let startIndex = 0;\n if (leadingInterval) {\n ++startIndex;\n interval = new TimeInterval({\n start: Iso8601.MINIMUM_VALUE,\n stop: julianDates[0],\n isStartIncluded: true,\n isStopIncluded: !isStartIncluded,\n });\n interval.data = defined(dataCallback)\n ? dataCallback(interval, result.length)\n : result.length;\n result.addInterval(interval);\n }\n\n for (let i = 0; i < length - 1; ++i) {\n let startDate = julianDates[i];\n const endDate = julianDates[i + 1];\n\n interval = new TimeInterval({\n start: startDate,\n stop: endDate,\n isStartIncluded: result.length === startIndex ? isStartIncluded : true,\n isStopIncluded: i === length - 2 ? isStopIncluded : false,\n });\n interval.data = defined(dataCallback)\n ? dataCallback(interval, result.length)\n : result.length;\n result.addInterval(interval);\n\n startDate = endDate;\n }\n\n if (trailingInterval) {\n interval = new TimeInterval({\n start: julianDates[length - 1],\n stop: Iso8601.MAXIMUM_VALUE,\n isStartIncluded: !isStopIncluded,\n isStopIncluded: true,\n });\n interval.data = defined(dataCallback)\n ? dataCallback(interval, result.length)\n : result.length;\n result.addInterval(interval);\n }\n\n return result;\n};\n\nconst scratchGregorianDate = new GregorianDate();\nconst monthLengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n * Adds duration represented as a GregorianDate to a JulianDate\n *\n * @param {JulianDate} julianDate The date.\n * @param {GregorianDate} duration An duration represented as a GregorianDate.\n * @param {JulianDate} result An existing instance to use for the result.\n * @returns {JulianDate} The modified result parameter.\n *\n * @private\n */\nfunction addToDate(julianDate, duration, result) {\n if (!defined(result)) {\n result = new JulianDate();\n }\n JulianDate.toGregorianDate(julianDate, scratchGregorianDate);\n\n let millisecond = scratchGregorianDate.millisecond + duration.millisecond;\n let second = scratchGregorianDate.second + duration.second;\n let minute = scratchGregorianDate.minute + duration.minute;\n let hour = scratchGregorianDate.hour + duration.hour;\n let day = scratchGregorianDate.day + duration.day;\n let month = scratchGregorianDate.month + duration.month;\n let year = scratchGregorianDate.year + duration.year;\n\n if (millisecond >= 1000) {\n second += Math.floor(millisecond / 1000);\n millisecond = millisecond % 1000;\n }\n\n if (second >= 60) {\n minute += Math.floor(second / 60);\n second = second % 60;\n }\n\n if (minute >= 60) {\n hour += Math.floor(minute / 60);\n minute = minute % 60;\n }\n\n if (hour >= 24) {\n day += Math.floor(hour / 24);\n hour = hour % 24;\n }\n\n // If days is greater than the month's length we need to remove those number of days,\n // readjust month and year and repeat until days is less than the month's length.\n monthLengths[2] = isLeapYear(year) ? 29 : 28;\n while (day > monthLengths[month] || month >= 13) {\n if (day > monthLengths[month]) {\n day -= monthLengths[month];\n ++month;\n }\n\n if (month >= 13) {\n --month;\n year += Math.floor(month / 12);\n month = month % 12;\n ++month;\n }\n\n monthLengths[2] = isLeapYear(year) ? 29 : 28;\n }\n\n scratchGregorianDate.millisecond = millisecond;\n scratchGregorianDate.second = second;\n scratchGregorianDate.minute = minute;\n scratchGregorianDate.hour = hour;\n scratchGregorianDate.day = day;\n scratchGregorianDate.month = month;\n scratchGregorianDate.year = year;\n\n return JulianDate.fromGregorianDate(scratchGregorianDate, result);\n}\n\nconst scratchJulianDate = new JulianDate();\nconst durationRegex = /P(?:([\\d.,]+)Y)?(?:([\\d.,]+)M)?(?:([\\d.,]+)W)?(?:([\\d.,]+)D)?(?:T(?:([\\d.,]+)H)?(?:([\\d.,]+)M)?(?:([\\d.,]+)S)?)?/;\n\n/**\n * Parses ISO8601 duration string\n *\n * @param {String} iso8601 An ISO 8601 duration.\n * @param {GregorianDate} result An existing instance to use for the result.\n * @returns {Boolean} True is parsing succeeded, false otherwise\n *\n * @private\n */\nfunction parseDuration(iso8601, result) {\n if (!defined(iso8601) || iso8601.length === 0) {\n return false;\n }\n\n // Reset object\n result.year = 0;\n result.month = 0;\n result.day = 0;\n result.hour = 0;\n result.minute = 0;\n result.second = 0;\n result.millisecond = 0;\n\n if (iso8601[0] === \"P\") {\n const matches = iso8601.match(durationRegex);\n if (!defined(matches)) {\n return false;\n }\n if (defined(matches[1])) {\n // Years\n result.year = Number(matches[1].replace(\",\", \".\"));\n }\n if (defined(matches[2])) {\n // Months\n result.month = Number(matches[2].replace(\",\", \".\"));\n }\n if (defined(matches[3])) {\n // Weeks\n result.day = Number(matches[3].replace(\",\", \".\")) * 7;\n }\n if (defined(matches[4])) {\n // Days\n result.day += Number(matches[4].replace(\",\", \".\"));\n }\n if (defined(matches[5])) {\n // Hours\n result.hour = Number(matches[5].replace(\",\", \".\"));\n }\n if (defined(matches[6])) {\n // Weeks\n result.minute = Number(matches[6].replace(\",\", \".\"));\n }\n if (defined(matches[7])) {\n // Seconds\n const seconds = Number(matches[7].replace(\",\", \".\"));\n result.second = Math.floor(seconds);\n result.millisecond = (seconds % 1) * 1000;\n }\n } else {\n // They can technically specify the duration as a normal date with some caveats. Try our best to load it.\n if (iso8601[iso8601.length - 1] !== \"Z\") {\n // It's not a date, its a duration, so it always has to be UTC\n iso8601 += \"Z\";\n }\n JulianDate.toGregorianDate(\n JulianDate.fromIso8601(iso8601, scratchJulianDate),\n result\n );\n }\n\n // A duration of 0 will cause an infinite loop, so just make sure something is non-zero\n return (\n result.year ||\n result.month ||\n result.day ||\n result.hour ||\n result.minute ||\n result.second ||\n result.millisecond\n );\n}\n\nconst scratchDuration = new GregorianDate();\n/**\n * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.iso8601 An ISO 8601 interval.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.\n * @param {Boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601 = function (options, result) {\n const dates = options.iso8601.split(\"/\");\n const start = JulianDate.fromIso8601(dates[0]);\n const stop = JulianDate.fromIso8601(dates[1]);\n const julianDates = [];\n\n if (!parseDuration(dates[2], scratchDuration)) {\n julianDates.push(start, stop);\n } else {\n let date = JulianDate.clone(start);\n julianDates.push(date);\n while (JulianDate.compare(date, stop) < 0) {\n date = addToDate(date, scratchDuration);\n const afterStop = JulianDate.compare(stop, date) <= 0;\n if (afterStop) {\n JulianDate.clone(stop, date);\n }\n\n julianDates.push(date);\n }\n }\n\n return TimeIntervalCollection.fromJulianDateArray(\n {\n julianDates: julianDates,\n isStartIncluded: options.isStartIncluded,\n isStopIncluded: options.isStopIncluded,\n leadingInterval: options.leadingInterval,\n trailingInterval: options.trailingInterval,\n dataCallback: options.dataCallback,\n },\n result\n );\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.\n *\n * @param {Object} options Object with the following properties:\n * @param {String[]} options.iso8601Dates An array of ISO 8601 dates.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.\n * @param {Boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601DateArray = function (options, result) {\n return TimeIntervalCollection.fromJulianDateArray(\n {\n julianDates: options.iso8601Dates.map(function (date) {\n return JulianDate.fromIso8601(date);\n }),\n isStartIncluded: options.isStartIncluded,\n isStopIncluded: options.isStopIncluded,\n leadingInterval: options.leadingInterval,\n trailingInterval: options.trailingInterval,\n dataCallback: options.dataCallback,\n },\n result\n );\n};\n\n/**\n * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.\n *\n * @param {Object} options Object with the following properties:\n * @param {JulianDate} options.epoch An date that the durations are relative to.\n * @param {String} options.iso8601Durations An array of ISO 8601 durations.\n * @param {Boolean} [options.relativeToPrevious=false] <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.\n * @param {Boolean} [options.isStartIncluded=true] <code>true</code> if start time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.isStopIncluded=true] <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.\n * @param {Boolean} [options.leadingInterval=false] <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.\n * @param {Boolean} [options.trailingInterval=false] <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.\n * @param {Function} [options.dataCallback] A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.\n * @param {TimeIntervalCollection} [result] An existing instance to use for the result.\n * @returns {TimeIntervalCollection} The modified result parameter or a new instance if none was provided.\n */\nTimeIntervalCollection.fromIso8601DurationArray = function (options, result) {\n const epoch = options.epoch;\n const iso8601Durations = options.iso8601Durations;\n const relativeToPrevious = defaultValue(options.relativeToPrevious, false);\n const julianDates = [];\n let date, previousDate;\n\n const length = iso8601Durations.length;\n for (let i = 0; i < length; ++i) {\n // Allow a duration of 0 on the first iteration, because then it is just the epoch\n if (parseDuration(iso8601Durations[i], scratchDuration) || i === 0) {\n if (relativeToPrevious && defined(previousDate)) {\n date = addToDate(previousDate, scratchDuration);\n } else {\n date = addToDate(epoch, scratchDuration);\n }\n julianDates.push(date);\n previousDate = date;\n }\n }\n\n return TimeIntervalCollection.fromJulianDateArray(\n {\n julianDates: julianDates,\n isStartIncluded: options.isStartIncluded,\n isStopIncluded: options.isStopIncluded,\n leadingInterval: options.leadingInterval,\n trailingInterval: options.trailingInterval,\n dataCallback: options.dataCallback,\n },\n result\n );\n};\nexport default TimeIntervalCollection;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport Property from \"./Property.js\";\n\nfunction subscribeAll(property, eventHelper, definitionChanged, intervals) {\n function callback() {\n definitionChanged.raiseEvent(property);\n }\n const items = [];\n eventHelper.removeAll();\n const length = intervals.length;\n for (let i = 0; i < length; i++) {\n const interval = intervals.get(i);\n if (defined(interval.data) && items.indexOf(interval.data) === -1) {\n eventHelper.add(interval.data.definitionChanged, callback);\n }\n }\n}\n\n/**\n * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the\n * data property of each {@link TimeInterval} is another Property instance which is\n * evaluated at the provided time.\n *\n * @alias CompositeProperty\n * @constructor\n *\n *\n * @example\n * const constantProperty = ...;\n * const sampledProperty = ...;\n *\n * //Create a composite property from two previously defined properties\n * //where the property is valid on August 1st, 2012 and uses a constant\n * //property for the first half of the day and a sampled property for the\n * //remaining half.\n * const composite = new Cesium.CompositeProperty();\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',\n * data : constantProperty\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',\n * isStartIncluded : false,\n * isStopIncluded : false,\n * data : sampledProperty\n * }));\n *\n * @see CompositeMaterialProperty\n * @see CompositePositionProperty\n */\nfunction CompositeProperty() {\n this._eventHelper = new EventHelper();\n this._definitionChanged = new Event();\n this._intervals = new TimeIntervalCollection();\n this._intervals.changedEvent.addEventListener(\n CompositeProperty.prototype._intervalsChanged,\n this\n );\n}\n\nObject.defineProperties(CompositeProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof CompositeProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._intervals.isEmpty;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value.\n * @memberof CompositeProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the interval collection.\n * @memberof CompositeProperty.prototype\n *\n * @type {TimeIntervalCollection}\n */\n intervals: {\n get: function () {\n return this._intervals;\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositeProperty.prototype.getValue = function (time, result) {\n const innerProperty = this._intervals.findDataForIntervalContainingDate(time);\n if (defined(innerProperty)) {\n return innerProperty.getValue(time, result);\n }\n return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositeProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof CompositeProperty && //\n this._intervals.equals(other._intervals, Property.equals))\n );\n};\n\n/**\n * @private\n */\nCompositeProperty.prototype._intervalsChanged = function () {\n subscribeAll(\n this,\n this._eventHelper,\n this._definitionChanged,\n this._intervals\n );\n this._definitionChanged.raiseEvent(this);\n};\nexport default CompositeProperty;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link CompositeProperty} which is also a {@link MaterialProperty}.\n *\n * @alias CompositeMaterialProperty\n * @constructor\n */\nfunction CompositeMaterialProperty() {\n this._definitionChanged = new Event();\n this._composite = new CompositeProperty();\n this._composite.definitionChanged.addEventListener(\n CompositeMaterialProperty.prototype._raiseDefinitionChanged,\n this\n );\n}\n\nObject.defineProperties(CompositeMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof CompositeMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._composite.isConstant;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value.\n * @memberof CompositeMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the interval collection.\n * @memberof CompositeMaterialProperty.prototype\n *\n * @type {TimeIntervalCollection}\n */\n intervals: {\n get: function () {\n return this._composite._intervals;\n },\n },\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nCompositeMaterialProperty.prototype.getType = function (time) {\n const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n time\n );\n if (defined(innerProperty)) {\n return innerProperty.getType(time);\n }\n return undefined;\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositeMaterialProperty.prototype.getValue = function (time, result) {\n const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n time\n );\n if (defined(innerProperty)) {\n return innerProperty.getValue(time, result);\n }\n return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositeMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof CompositeMaterialProperty && //\n this._composite.equals(other._composite, Property.equals))\n );\n};\n\n/**\n * @private\n */\nCompositeMaterialProperty.prototype._raiseDefinitionChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default CompositeMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link CompositeProperty} which is also a {@link PositionProperty}.\n *\n * @alias CompositePositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction CompositePositionProperty(referenceFrame) {\n this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n this._definitionChanged = new Event();\n this._composite = new CompositeProperty();\n this._composite.definitionChanged.addEventListener(\n CompositePositionProperty.prototype._raiseDefinitionChanged,\n this\n );\n}\n\nObject.defineProperties(CompositePositionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof CompositePositionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._composite.isConstant;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value.\n * @memberof CompositePositionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the interval collection.\n * @memberof CompositePositionProperty.prototype\n *\n * @type {TimeIntervalCollection}\n */\n intervals: {\n get: function () {\n return this._composite.intervals;\n },\n },\n /**\n * Gets or sets the reference frame which this position presents itself as.\n * Each PositionProperty making up this object has it's own reference frame,\n * so this property merely exposes a \"preferred\" reference frame for clients\n * to use.\n * @memberof CompositePositionProperty.prototype\n *\n * @type {ReferenceFrame}\n */\n referenceFrame: {\n get: function () {\n return this._referenceFrame;\n },\n set: function (value) {\n this._referenceFrame = value;\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositePositionProperty.prototype.getValue = function (time, result) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nCompositePositionProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(\n time\n );\n if (defined(innerProperty)) {\n return innerProperty.getValueInReferenceFrame(time, referenceFrame, result);\n }\n return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nCompositePositionProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof CompositePositionProperty && //\n this._referenceFrame === other._referenceFrame && //\n this._composite.equals(other._composite, Property.equals))\n );\n};\n\n/**\n * @private\n */\nCompositePositionProperty.prototype._raiseDefinitionChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default CompositePositionProperty;\n", "/**\n * Style options for corners.\n *\n * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}\n * demonstrates the three corner types, as used by {@link CorridorGraphics}.\n *\n * @enum {Number}\n */\nconst CornerType = {\n /**\n * <img src=\"Images/CornerTypeRounded.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n *\n * Corner has a smooth edge.\n * @type {Number}\n * @constant\n */\n ROUNDED: 0,\n\n /**\n * <img src=\"Images/CornerTypeMitered.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n *\n * Corner point is the intersection of adjacent edges.\n * @type {Number}\n * @constant\n */\n MITERED: 1,\n\n /**\n * <img src=\"Images/CornerTypeBeveled.png\" style=\"vertical-align: middle;\" width=\"186\" height=\"189\" />\n *\n * Corner is clipped.\n * @type {Number}\n * @constant\n */\n BEVELED: 2,\n};\nexport default Object.freeze(CornerType);\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport CornerType from \"./CornerType.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Transforms from \"./Transforms.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\n\nconst scratch2Array = [new Cartesian3(), new Cartesian3()];\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\nconst scratchCartesian6 = new Cartesian3();\nconst scratchCartesian7 = new Cartesian3();\nconst scratchCartesian8 = new Cartesian3();\nconst scratchCartesian9 = new Cartesian3();\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\n\n/**\n * @private\n */\nconst PolylineVolumeGeometryLibrary = {};\n\nlet cartographic = new Cartographic();\nfunction scaleToSurface(positions, ellipsoid) {\n const heights = new Array(positions.length);\n for (let i = 0; i < positions.length; i++) {\n const pos = positions[i];\n cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);\n heights[i] = cartographic.height;\n positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);\n }\n return heights;\n}\n\nfunction subdivideHeights(points, h0, h1, granularity) {\n const p0 = points[0];\n const p1 = points[1];\n const angleBetween = Cartesian3.angleBetween(p0, p1);\n const numPoints = Math.ceil(angleBetween / granularity);\n const heights = new Array(numPoints);\n let i;\n if (h0 === h1) {\n for (i = 0; i < numPoints; i++) {\n heights[i] = h0;\n }\n heights.push(h1);\n return heights;\n }\n\n const dHeight = h1 - h0;\n const heightPerVertex = dHeight / numPoints;\n\n for (i = 1; i < numPoints; i++) {\n const h = h0 + i * heightPerVertex;\n heights[i] = h;\n }\n\n heights[0] = h0;\n heights.push(h1);\n return heights;\n}\n\nconst nextScratch = new Cartesian3();\nconst prevScratch = new Cartesian3();\n\nfunction computeRotationAngle(start, end, position, ellipsoid) {\n const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\n const next = tangentPlane.projectPointOntoPlane(\n Cartesian3.add(position, start, nextScratch),\n nextScratch\n );\n const prev = tangentPlane.projectPointOntoPlane(\n Cartesian3.add(position, end, prevScratch),\n prevScratch\n );\n const angle = Cartesian2.angleBetween(next, prev);\n\n return prev.x * next.y - prev.y * next.x >= 0.0 ? -angle : angle;\n}\n\nconst negativeX = new Cartesian3(-1, 0, 0);\nlet transform = new Matrix4();\nconst translation = new Matrix4();\nlet rotationZ = new Matrix3();\nconst scaleMatrix = Matrix3.IDENTITY.clone();\nconst westScratch = new Cartesian3();\nconst finalPosScratch = new Cartesian4();\nconst heightCartesian = new Cartesian3();\nfunction addPosition(\n center,\n left,\n shape,\n finalPositions,\n ellipsoid,\n height,\n xScalar,\n repeat\n) {\n let west = westScratch;\n let finalPosition = finalPosScratch;\n transform = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, transform);\n\n west = Matrix4.multiplyByPointAsVector(transform, negativeX, west);\n west = Cartesian3.normalize(west, west);\n const angle = computeRotationAngle(west, left, center, ellipsoid);\n rotationZ = Matrix3.fromRotationZ(angle, rotationZ);\n\n heightCartesian.z = height;\n transform = Matrix4.multiplyTransformation(\n transform,\n Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation),\n transform\n );\n const scale = scaleMatrix;\n scale[0] = xScalar;\n\n for (let j = 0; j < repeat; j++) {\n for (let i = 0; i < shape.length; i += 3) {\n finalPosition = Cartesian3.fromArray(shape, i, finalPosition);\n finalPosition = Matrix3.multiplyByVector(\n scale,\n finalPosition,\n finalPosition\n );\n finalPosition = Matrix4.multiplyByPoint(\n transform,\n finalPosition,\n finalPosition\n );\n finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);\n }\n }\n\n return finalPositions;\n}\n\nconst centerScratch = new Cartesian3();\nfunction addPositions(\n centers,\n left,\n shape,\n finalPositions,\n ellipsoid,\n heights,\n xScalar\n) {\n for (let i = 0; i < centers.length; i += 3) {\n const center = Cartesian3.fromArray(centers, i, centerScratch);\n finalPositions = addPosition(\n center,\n left,\n shape,\n finalPositions,\n ellipsoid,\n heights[i / 3],\n xScalar,\n 1\n );\n }\n return finalPositions;\n}\n\nfunction convertShapeTo3DDuplicate(shape2D, boundingRectangle) {\n //orientate 2D shape to XZ plane center at (0, 0, 0), duplicate points\n const length = shape2D.length;\n const shape = new Array(length * 6);\n let index = 0;\n const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\n const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\n\n let point = shape2D[0];\n shape[index++] = point.x - xOffset;\n shape[index++] = 0.0;\n shape[index++] = point.y - yOffset;\n for (let i = 1; i < length; i++) {\n point = shape2D[i];\n const x = point.x - xOffset;\n const z = point.y - yOffset;\n shape[index++] = x;\n shape[index++] = 0.0;\n shape[index++] = z;\n\n shape[index++] = x;\n shape[index++] = 0.0;\n shape[index++] = z;\n }\n point = shape2D[0];\n shape[index++] = point.x - xOffset;\n shape[index++] = 0.0;\n shape[index++] = point.y - yOffset;\n\n return shape;\n}\n\nfunction convertShapeTo3D(shape2D, boundingRectangle) {\n //orientate 2D shape to XZ plane center at (0, 0, 0)\n const length = shape2D.length;\n const shape = new Array(length * 3);\n let index = 0;\n const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\n const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\n\n for (let i = 0; i < length; i++) {\n shape[index++] = shape2D[i].x - xOffset;\n shape[index++] = 0;\n shape[index++] = shape2D[i].y - yOffset;\n }\n\n return shape;\n}\n\nconst quaterion = new Quaternion();\nconst startPointScratch = new Cartesian3();\nconst rotMatrix = new Matrix3();\nfunction computeRoundCorner(\n pivot,\n startPoint,\n endPoint,\n cornerType,\n leftIsOutside,\n ellipsoid,\n finalPositions,\n shape,\n height,\n duplicatePoints\n) {\n const angle = Cartesian3.angleBetween(\n Cartesian3.subtract(startPoint, pivot, scratch1),\n Cartesian3.subtract(endPoint, pivot, scratch2)\n );\n const granularity =\n cornerType === CornerType.BEVELED\n ? 0\n : Math.ceil(angle / CesiumMath.toRadians(5));\n\n let m;\n if (leftIsOutside) {\n m = Matrix3.fromQuaternion(\n Quaternion.fromAxisAngle(\n Cartesian3.negate(pivot, scratch1),\n angle / (granularity + 1),\n quaterion\n ),\n rotMatrix\n );\n } else {\n m = Matrix3.fromQuaternion(\n Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),\n rotMatrix\n );\n }\n\n let left;\n let surfacePoint;\n startPoint = Cartesian3.clone(startPoint, startPointScratch);\n if (granularity > 0) {\n const repeat = duplicatePoints ? 2 : 1;\n for (let i = 0; i < granularity; i++) {\n startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\n left = Cartesian3.subtract(startPoint, pivot, scratch1);\n left = Cartesian3.normalize(left, left);\n if (!leftIsOutside) {\n left = Cartesian3.negate(left, left);\n }\n surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\n finalPositions = addPosition(\n surfacePoint,\n left,\n shape,\n finalPositions,\n ellipsoid,\n height,\n 1,\n repeat\n );\n }\n } else {\n left = Cartesian3.subtract(startPoint, pivot, scratch1);\n left = Cartesian3.normalize(left, left);\n if (!leftIsOutside) {\n left = Cartesian3.negate(left, left);\n }\n surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\n finalPositions = addPosition(\n surfacePoint,\n left,\n shape,\n finalPositions,\n ellipsoid,\n height,\n 1,\n 1\n );\n\n endPoint = Cartesian3.clone(endPoint, startPointScratch);\n left = Cartesian3.subtract(endPoint, pivot, scratch1);\n left = Cartesian3.normalize(left, left);\n if (!leftIsOutside) {\n left = Cartesian3.negate(left, left);\n }\n surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);\n finalPositions = addPosition(\n surfacePoint,\n left,\n shape,\n finalPositions,\n ellipsoid,\n height,\n 1,\n 1\n );\n }\n\n return finalPositions;\n}\n\nPolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function (\n shapePositions\n) {\n const length = shapePositions.length;\n const cleanedPositions = [];\n for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\n const v0 = shapePositions[i0];\n const v1 = shapePositions[i1];\n\n if (!Cartesian2.equals(v0, v1)) {\n cleanedPositions.push(v1); // Shallow copy!\n }\n }\n\n return cleanedPositions;\n};\n\nPolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function (\n forward,\n backward,\n position,\n ellipsoid\n) {\n const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\n const next = tangentPlane.projectPointOntoPlane(\n Cartesian3.add(position, forward, nextScratch),\n nextScratch\n );\n const prev = tangentPlane.projectPointOntoPlane(\n Cartesian3.add(position, backward, prevScratch),\n prevScratch\n );\n\n return prev.x * next.y - prev.y * next.x >= 0.0;\n};\n\nconst scratchForwardProjection = new Cartesian3();\nconst scratchBackwardProjection = new Cartesian3();\n\nPolylineVolumeGeometryLibrary.computePositions = function (\n positions,\n shape2D,\n boundingRectangle,\n geometry,\n duplicatePoints\n) {\n const ellipsoid = geometry._ellipsoid;\n const heights = scaleToSurface(positions, ellipsoid);\n const granularity = geometry._granularity;\n const cornerType = geometry._cornerType;\n const shapeForSides = duplicatePoints\n ? convertShapeTo3DDuplicate(shape2D, boundingRectangle)\n : convertShapeTo3D(shape2D, boundingRectangle);\n const shapeForEnds = duplicatePoints\n ? convertShapeTo3D(shape2D, boundingRectangle)\n : undefined;\n const heightOffset = boundingRectangle.height / 2;\n const width = boundingRectangle.width / 2;\n let length = positions.length;\n let finalPositions = [];\n let ends = duplicatePoints ? [] : undefined;\n\n let forward = scratchCartesian1;\n let backward = scratchCartesian2;\n let cornerDirection = scratchCartesian3;\n let surfaceNormal = scratchCartesian4;\n let pivot = scratchCartesian5;\n let start = scratchCartesian6;\n let end = scratchCartesian7;\n let left = scratchCartesian8;\n let previousPosition = scratchCartesian9;\n\n let position = positions[0];\n let nextPosition = positions[1];\n surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\n forward = Cartesian3.subtract(nextPosition, position, forward);\n forward = Cartesian3.normalize(forward, forward);\n left = Cartesian3.cross(surfaceNormal, forward, left);\n left = Cartesian3.normalize(left, left);\n let h0 = heights[0];\n let h1 = heights[1];\n if (duplicatePoints) {\n ends = addPosition(\n position,\n left,\n shapeForEnds,\n ends,\n ellipsoid,\n h0 + heightOffset,\n 1,\n 1\n );\n }\n previousPosition = Cartesian3.clone(position, previousPosition);\n position = nextPosition;\n backward = Cartesian3.negate(forward, backward);\n let subdividedHeights;\n let subdividedPositions;\n for (let i = 1; i < length - 1; i++) {\n const repeat = duplicatePoints ? 2 : 1;\n nextPosition = positions[i + 1];\n if (position.equals(nextPosition)) {\n oneTimeWarning(\n \"Positions are too close and are considered equivalent with rounding error.\"\n );\n continue;\n }\n forward = Cartesian3.subtract(nextPosition, position, forward);\n forward = Cartesian3.normalize(forward, forward);\n cornerDirection = Cartesian3.add(forward, backward, cornerDirection);\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\n\n const forwardProjection = Cartesian3.multiplyByScalar(\n surfaceNormal,\n Cartesian3.dot(forward, surfaceNormal),\n scratchForwardProjection\n );\n Cartesian3.subtract(forward, forwardProjection, forwardProjection);\n Cartesian3.normalize(forwardProjection, forwardProjection);\n\n const backwardProjection = Cartesian3.multiplyByScalar(\n surfaceNormal,\n Cartesian3.dot(backward, surfaceNormal),\n scratchBackwardProjection\n );\n Cartesian3.subtract(backward, backwardProjection, backwardProjection);\n Cartesian3.normalize(backwardProjection, backwardProjection);\n\n const doCorner = !CesiumMath.equalsEpsilon(\n Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\n 1.0,\n CesiumMath.EPSILON7\n );\n\n if (doCorner) {\n cornerDirection = Cartesian3.cross(\n cornerDirection,\n surfaceNormal,\n cornerDirection\n );\n cornerDirection = Cartesian3.cross(\n surfaceNormal,\n cornerDirection,\n cornerDirection\n );\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n const scalar =\n 1 /\n Math.max(\n 0.25,\n Cartesian3.magnitude(\n Cartesian3.cross(cornerDirection, backward, scratch1)\n )\n );\n const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\n forward,\n backward,\n position,\n ellipsoid\n );\n if (leftIsOutside) {\n pivot = Cartesian3.add(\n position,\n Cartesian3.multiplyByScalar(\n cornerDirection,\n scalar * width,\n cornerDirection\n ),\n pivot\n );\n start = Cartesian3.add(\n pivot,\n Cartesian3.multiplyByScalar(left, width, start),\n start\n );\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\n subdividedHeights = subdivideHeights(\n scratch2Array,\n h0 + heightOffset,\n h1 + heightOffset,\n granularity\n );\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scratch2Array,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n finalPositions = addPositions(\n subdividedPositions,\n left,\n shapeForSides,\n finalPositions,\n ellipsoid,\n subdividedHeights,\n 1\n );\n left = Cartesian3.cross(surfaceNormal, forward, left);\n left = Cartesian3.normalize(left, left);\n end = Cartesian3.add(\n pivot,\n Cartesian3.multiplyByScalar(left, width, end),\n end\n );\n if (\n cornerType === CornerType.ROUNDED ||\n cornerType === CornerType.BEVELED\n ) {\n computeRoundCorner(\n pivot,\n start,\n end,\n cornerType,\n leftIsOutside,\n ellipsoid,\n finalPositions,\n shapeForSides,\n h1 + heightOffset,\n duplicatePoints\n );\n } else {\n cornerDirection = Cartesian3.negate(cornerDirection, cornerDirection);\n finalPositions = addPosition(\n position,\n cornerDirection,\n shapeForSides,\n finalPositions,\n ellipsoid,\n h1 + heightOffset,\n scalar,\n repeat\n );\n }\n previousPosition = Cartesian3.clone(end, previousPosition);\n } else {\n pivot = Cartesian3.add(\n position,\n Cartesian3.multiplyByScalar(\n cornerDirection,\n scalar * width,\n cornerDirection\n ),\n pivot\n );\n start = Cartesian3.add(\n pivot,\n Cartesian3.multiplyByScalar(left, -width, start),\n start\n );\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\n subdividedHeights = subdivideHeights(\n scratch2Array,\n h0 + heightOffset,\n h1 + heightOffset,\n granularity\n );\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scratch2Array,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n finalPositions = addPositions(\n subdividedPositions,\n left,\n shapeForSides,\n finalPositions,\n ellipsoid,\n subdividedHeights,\n 1\n );\n left = Cartesian3.cross(surfaceNormal, forward, left);\n left = Cartesian3.normalize(left, left);\n end = Cartesian3.add(\n pivot,\n Cartesian3.multiplyByScalar(left, -width, end),\n end\n );\n if (\n cornerType === CornerType.ROUNDED ||\n cornerType === CornerType.BEVELED\n ) {\n computeRoundCorner(\n pivot,\n start,\n end,\n cornerType,\n leftIsOutside,\n ellipsoid,\n finalPositions,\n shapeForSides,\n h1 + heightOffset,\n duplicatePoints\n );\n } else {\n finalPositions = addPosition(\n position,\n cornerDirection,\n shapeForSides,\n finalPositions,\n ellipsoid,\n h1 + heightOffset,\n scalar,\n repeat\n );\n }\n previousPosition = Cartesian3.clone(end, previousPosition);\n }\n backward = Cartesian3.negate(forward, backward);\n } else {\n finalPositions = addPosition(\n previousPosition,\n left,\n shapeForSides,\n finalPositions,\n ellipsoid,\n h0 + heightOffset,\n 1,\n 1\n );\n previousPosition = position;\n }\n h0 = h1;\n h1 = heights[i + 1];\n position = nextPosition;\n }\n\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\n scratch2Array[1] = Cartesian3.clone(position, scratch2Array[1]);\n subdividedHeights = subdivideHeights(\n scratch2Array,\n h0 + heightOffset,\n h1 + heightOffset,\n granularity\n );\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scratch2Array,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n finalPositions = addPositions(\n subdividedPositions,\n left,\n shapeForSides,\n finalPositions,\n ellipsoid,\n subdividedHeights,\n 1\n );\n if (duplicatePoints) {\n ends = addPosition(\n position,\n left,\n shapeForEnds,\n ends,\n ellipsoid,\n h1 + heightOffset,\n 1,\n 1\n );\n }\n\n length = finalPositions.length;\n const posLength = duplicatePoints ? length + ends.length : length;\n const combinedPositions = new Float64Array(posLength);\n combinedPositions.set(finalPositions);\n if (duplicatePoints) {\n combinedPositions.set(ends, length);\n }\n\n return combinedPositions;\n};\nexport default PolylineVolumeGeometryLibrary;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport CornerType from \"./CornerType.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * @private\n */\nconst CorridorGeometryLibrary = {};\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\nconst scratch3 = new Cartesian3();\nconst scratch4 = new Cartesian3();\n\nconst scaleArray2 = [new Cartesian3(), new Cartesian3()];\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\nconst cartesian4 = new Cartesian3();\nconst cartesian5 = new Cartesian3();\nconst cartesian6 = new Cartesian3();\nconst cartesian7 = new Cartesian3();\nconst cartesian8 = new Cartesian3();\nconst cartesian9 = new Cartesian3();\nconst cartesian10 = new Cartesian3();\n\nconst quaterion = new Quaternion();\nconst rotMatrix = new Matrix3();\nfunction computeRoundCorner(\n cornerPoint,\n startPoint,\n endPoint,\n cornerType,\n leftIsOutside\n) {\n const angle = Cartesian3.angleBetween(\n Cartesian3.subtract(startPoint, cornerPoint, scratch1),\n Cartesian3.subtract(endPoint, cornerPoint, scratch2)\n );\n const granularity =\n cornerType === CornerType.BEVELED\n ? 1\n : Math.ceil(angle / CesiumMath.toRadians(5)) + 1;\n\n const size = granularity * 3;\n const array = new Array(size);\n\n array[size - 3] = endPoint.x;\n array[size - 2] = endPoint.y;\n array[size - 1] = endPoint.z;\n\n let m;\n if (leftIsOutside) {\n m = Matrix3.fromQuaternion(\n Quaternion.fromAxisAngle(\n Cartesian3.negate(cornerPoint, scratch1),\n angle / granularity,\n quaterion\n ),\n rotMatrix\n );\n } else {\n m = Matrix3.fromQuaternion(\n Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion),\n rotMatrix\n );\n }\n\n let index = 0;\n startPoint = Cartesian3.clone(startPoint, scratch1);\n for (let i = 0; i < granularity; i++) {\n startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\n array[index++] = startPoint.x;\n array[index++] = startPoint.y;\n array[index++] = startPoint.z;\n }\n\n return array;\n}\n\nfunction addEndCaps(calculatedPositions) {\n let cornerPoint = cartesian1;\n let startPoint = cartesian2;\n let endPoint = cartesian3;\n\n let leftEdge = calculatedPositions[1];\n startPoint = Cartesian3.fromArray(\n calculatedPositions[1],\n leftEdge.length - 3,\n startPoint\n );\n endPoint = Cartesian3.fromArray(calculatedPositions[0], 0, endPoint);\n cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\n const firstEndCap = computeRoundCorner(\n cornerPoint,\n startPoint,\n endPoint,\n CornerType.ROUNDED,\n false\n );\n\n const length = calculatedPositions.length - 1;\n const rightEdge = calculatedPositions[length - 1];\n leftEdge = calculatedPositions[length];\n startPoint = Cartesian3.fromArray(\n rightEdge,\n rightEdge.length - 3,\n startPoint\n );\n endPoint = Cartesian3.fromArray(leftEdge, 0, endPoint);\n cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\n const lastEndCap = computeRoundCorner(\n cornerPoint,\n startPoint,\n endPoint,\n CornerType.ROUNDED,\n false\n );\n\n return [firstEndCap, lastEndCap];\n}\n\nfunction computeMiteredCorner(\n position,\n leftCornerDirection,\n lastPoint,\n leftIsOutside\n) {\n let cornerPoint = scratch1;\n if (leftIsOutside) {\n cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\n } else {\n leftCornerDirection = Cartesian3.negate(\n leftCornerDirection,\n leftCornerDirection\n );\n cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\n }\n return [\n cornerPoint.x,\n cornerPoint.y,\n cornerPoint.z,\n lastPoint.x,\n lastPoint.y,\n lastPoint.z,\n ];\n}\n\nfunction addShiftedPositions(positions, left, scalar, calculatedPositions) {\n const rightPositions = new Array(positions.length);\n const leftPositions = new Array(positions.length);\n const scaledLeft = Cartesian3.multiplyByScalar(left, scalar, scratch1);\n const scaledRight = Cartesian3.negate(scaledLeft, scratch2);\n let rightIndex = 0;\n let leftIndex = positions.length - 1;\n\n for (let i = 0; i < positions.length; i += 3) {\n const pos = Cartesian3.fromArray(positions, i, scratch3);\n const rightPos = Cartesian3.add(pos, scaledRight, scratch4);\n rightPositions[rightIndex++] = rightPos.x;\n rightPositions[rightIndex++] = rightPos.y;\n rightPositions[rightIndex++] = rightPos.z;\n\n const leftPos = Cartesian3.add(pos, scaledLeft, scratch4);\n leftPositions[leftIndex--] = leftPos.z;\n leftPositions[leftIndex--] = leftPos.y;\n leftPositions[leftIndex--] = leftPos.x;\n }\n calculatedPositions.push(rightPositions, leftPositions);\n\n return calculatedPositions;\n}\n\n/**\n * @private\n */\nCorridorGeometryLibrary.addAttribute = function (\n attribute,\n value,\n front,\n back\n) {\n const x = value.x;\n const y = value.y;\n const z = value.z;\n if (defined(front)) {\n attribute[front] = x;\n attribute[front + 1] = y;\n attribute[front + 2] = z;\n }\n if (defined(back)) {\n attribute[back] = z;\n attribute[back - 1] = y;\n attribute[back - 2] = x;\n }\n};\n\nconst scratchForwardProjection = new Cartesian3();\nconst scratchBackwardProjection = new Cartesian3();\n\n/**\n * @private\n */\nCorridorGeometryLibrary.computePositions = function (params) {\n const granularity = params.granularity;\n const positions = params.positions;\n const ellipsoid = params.ellipsoid;\n const width = params.width / 2;\n const cornerType = params.cornerType;\n const saveAttributes = params.saveAttributes;\n let normal = cartesian1;\n let forward = cartesian2;\n let backward = cartesian3;\n let left = cartesian4;\n let cornerDirection = cartesian5;\n let startPoint = cartesian6;\n let previousPos = cartesian7;\n let rightPos = cartesian8;\n let leftPos = cartesian9;\n let center = cartesian10;\n let calculatedPositions = [];\n const calculatedLefts = saveAttributes ? [] : undefined;\n const calculatedNormals = saveAttributes ? [] : undefined;\n let position = positions[0]; //add first point\n let nextPosition = positions[1];\n\n forward = Cartesian3.normalize(\n Cartesian3.subtract(nextPosition, position, forward),\n forward\n );\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);\n if (saveAttributes) {\n calculatedLefts.push(left.x, left.y, left.z);\n calculatedNormals.push(normal.x, normal.y, normal.z);\n }\n previousPos = Cartesian3.clone(position, previousPos);\n position = nextPosition;\n backward = Cartesian3.negate(forward, backward);\n\n let subdividedPositions;\n const corners = [];\n let i;\n const length = positions.length;\n for (i = 1; i < length - 1; i++) {\n // add middle points and corners\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n nextPosition = positions[i + 1];\n forward = Cartesian3.normalize(\n Cartesian3.subtract(nextPosition, position, forward),\n forward\n );\n cornerDirection = Cartesian3.normalize(\n Cartesian3.add(forward, backward, cornerDirection),\n cornerDirection\n );\n\n const forwardProjection = Cartesian3.multiplyByScalar(\n normal,\n Cartesian3.dot(forward, normal),\n scratchForwardProjection\n );\n Cartesian3.subtract(forward, forwardProjection, forwardProjection);\n Cartesian3.normalize(forwardProjection, forwardProjection);\n\n const backwardProjection = Cartesian3.multiplyByScalar(\n normal,\n Cartesian3.dot(backward, normal),\n scratchBackwardProjection\n );\n Cartesian3.subtract(backward, backwardProjection, backwardProjection);\n Cartesian3.normalize(backwardProjection, backwardProjection);\n\n const doCorner = !CesiumMath.equalsEpsilon(\n Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\n 1.0,\n CesiumMath.EPSILON7\n );\n\n if (doCorner) {\n cornerDirection = Cartesian3.cross(\n cornerDirection,\n normal,\n cornerDirection\n );\n cornerDirection = Cartesian3.cross(\n normal,\n cornerDirection,\n cornerDirection\n );\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\n const scalar =\n width /\n Math.max(\n 0.25,\n Cartesian3.magnitude(\n Cartesian3.cross(cornerDirection, backward, scratch1)\n )\n );\n const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\n forward,\n backward,\n position,\n ellipsoid\n );\n cornerDirection = Cartesian3.multiplyByScalar(\n cornerDirection,\n scalar,\n cornerDirection\n );\n if (leftIsOutside) {\n rightPos = Cartesian3.add(position, cornerDirection, rightPos);\n center = Cartesian3.add(\n rightPos,\n Cartesian3.multiplyByScalar(left, width, center),\n center\n );\n leftPos = Cartesian3.add(\n rightPos,\n Cartesian3.multiplyByScalar(left, width * 2, leftPos),\n leftPos\n );\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scaleArray2,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n calculatedPositions = addShiftedPositions(\n subdividedPositions,\n left,\n width,\n calculatedPositions\n );\n if (saveAttributes) {\n calculatedLefts.push(left.x, left.y, left.z);\n calculatedNormals.push(normal.x, normal.y, normal.z);\n }\n startPoint = Cartesian3.clone(leftPos, startPoint);\n left = Cartesian3.normalize(\n Cartesian3.cross(normal, forward, left),\n left\n );\n leftPos = Cartesian3.add(\n rightPos,\n Cartesian3.multiplyByScalar(left, width * 2, leftPos),\n leftPos\n );\n previousPos = Cartesian3.add(\n rightPos,\n Cartesian3.multiplyByScalar(left, width, previousPos),\n previousPos\n );\n if (\n cornerType === CornerType.ROUNDED ||\n cornerType === CornerType.BEVELED\n ) {\n corners.push({\n leftPositions: computeRoundCorner(\n rightPos,\n startPoint,\n leftPos,\n cornerType,\n leftIsOutside\n ),\n });\n } else {\n corners.push({\n leftPositions: computeMiteredCorner(\n position,\n Cartesian3.negate(cornerDirection, cornerDirection),\n leftPos,\n leftIsOutside\n ),\n });\n }\n } else {\n leftPos = Cartesian3.add(position, cornerDirection, leftPos);\n center = Cartesian3.add(\n leftPos,\n Cartesian3.negate(\n Cartesian3.multiplyByScalar(left, width, center),\n center\n ),\n center\n );\n rightPos = Cartesian3.add(\n leftPos,\n Cartesian3.negate(\n Cartesian3.multiplyByScalar(left, width * 2, rightPos),\n rightPos\n ),\n rightPos\n );\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scaleArray2,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n calculatedPositions = addShiftedPositions(\n subdividedPositions,\n left,\n width,\n calculatedPositions\n );\n if (saveAttributes) {\n calculatedLefts.push(left.x, left.y, left.z);\n calculatedNormals.push(normal.x, normal.y, normal.z);\n }\n startPoint = Cartesian3.clone(rightPos, startPoint);\n left = Cartesian3.normalize(\n Cartesian3.cross(normal, forward, left),\n left\n );\n rightPos = Cartesian3.add(\n leftPos,\n Cartesian3.negate(\n Cartesian3.multiplyByScalar(left, width * 2, rightPos),\n rightPos\n ),\n rightPos\n );\n previousPos = Cartesian3.add(\n leftPos,\n Cartesian3.negate(\n Cartesian3.multiplyByScalar(left, width, previousPos),\n previousPos\n ),\n previousPos\n );\n if (\n cornerType === CornerType.ROUNDED ||\n cornerType === CornerType.BEVELED\n ) {\n corners.push({\n rightPositions: computeRoundCorner(\n leftPos,\n startPoint,\n rightPos,\n cornerType,\n leftIsOutside\n ),\n });\n } else {\n corners.push({\n rightPositions: computeMiteredCorner(\n position,\n cornerDirection,\n rightPos,\n leftIsOutside\n ),\n });\n }\n }\n backward = Cartesian3.negate(forward, backward);\n }\n position = nextPosition;\n }\n\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\n scaleArray2[1] = Cartesian3.clone(position, scaleArray2[1]);\n subdividedPositions = PolylinePipeline.generateArc({\n positions: scaleArray2,\n granularity: granularity,\n ellipsoid: ellipsoid,\n });\n calculatedPositions = addShiftedPositions(\n subdividedPositions,\n left,\n width,\n calculatedPositions\n );\n if (saveAttributes) {\n calculatedLefts.push(left.x, left.y, left.z);\n calculatedNormals.push(normal.x, normal.y, normal.z);\n }\n\n let endPositions;\n if (cornerType === CornerType.ROUNDED) {\n endPositions = addEndCaps(calculatedPositions);\n }\n\n return {\n positions: calculatedPositions,\n corners: corners,\n lefts: calculatedLefts,\n normals: calculatedNormals,\n endPositions: endPositions,\n };\n};\nexport default CorridorGeometryLibrary;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\nconst cartesian4 = new Cartesian3();\nconst cartesian5 = new Cartesian3();\nconst cartesian6 = new Cartesian3();\n\nconst scratch1 = new Cartesian3();\nconst scratch2 = new Cartesian3();\n\nfunction scaleToSurface(positions, ellipsoid) {\n for (let i = 0; i < positions.length; i++) {\n positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\n }\n return positions;\n}\n\nfunction addNormals(attr, normal, left, front, back, vertexFormat) {\n const normals = attr.normals;\n const tangents = attr.tangents;\n const bitangents = attr.bitangents;\n const forward = Cartesian3.normalize(\n Cartesian3.cross(left, normal, scratch1),\n scratch1\n );\n if (vertexFormat.normal) {\n CorridorGeometryLibrary.addAttribute(normals, normal, front, back);\n }\n if (vertexFormat.tangent) {\n CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);\n }\n if (vertexFormat.bitangent) {\n CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);\n }\n}\n\nfunction combine(computedPositions, vertexFormat, ellipsoid) {\n const positions = computedPositions.positions;\n const corners = computedPositions.corners;\n const endPositions = computedPositions.endPositions;\n const computedLefts = computedPositions.lefts;\n const computedNormals = computedPositions.normals;\n const attributes = new GeometryAttributes();\n let corner;\n let leftCount = 0;\n let rightCount = 0;\n let i;\n let indicesLength = 0;\n let length;\n for (i = 0; i < positions.length; i += 2) {\n length = positions[i].length - 3;\n leftCount += length; //subtracting 3 to account for duplicate points at corners\n indicesLength += length * 2;\n rightCount += positions[i + 1].length - 3;\n }\n leftCount += 3; //add back count for end positions\n rightCount += 3;\n for (i = 0; i < corners.length; i++) {\n corner = corners[i];\n const leftSide = corners[i].leftPositions;\n if (defined(leftSide)) {\n length = leftSide.length;\n leftCount += length;\n indicesLength += length;\n } else {\n length = corners[i].rightPositions.length;\n rightCount += length;\n indicesLength += length;\n }\n }\n\n const addEndPositions = defined(endPositions);\n let endPositionLength;\n if (addEndPositions) {\n endPositionLength = endPositions[0].length - 3;\n leftCount += endPositionLength;\n rightCount += endPositionLength;\n endPositionLength /= 3;\n indicesLength += endPositionLength * 6;\n }\n const size = leftCount + rightCount;\n const finalPositions = new Float64Array(size);\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size)\n : undefined;\n const attr = {\n normals: normals,\n tangents: tangents,\n bitangents: bitangents,\n };\n let front = 0;\n let back = size - 1;\n let UL, LL, UR, LR;\n let normal = cartesian1;\n let left = cartesian2;\n let rightPos, leftPos;\n const halfLength = endPositionLength / 2;\n\n const indices = IndexDatatype.createTypedArray(size / 3, indicesLength);\n let index = 0;\n if (addEndPositions) {\n // add rounded end\n leftPos = cartesian3;\n rightPos = cartesian4;\n const firstEndPositions = endPositions[0];\n normal = Cartesian3.fromArray(computedNormals, 0, normal);\n left = Cartesian3.fromArray(computedLefts, 0, left);\n for (i = 0; i < halfLength; i++) {\n leftPos = Cartesian3.fromArray(\n firstEndPositions,\n (halfLength - 1 - i) * 3,\n leftPos\n );\n rightPos = Cartesian3.fromArray(\n firstEndPositions,\n (halfLength + i) * 3,\n rightPos\n );\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n leftPos,\n undefined,\n back\n );\n addNormals(attr, normal, left, front, back, vertexFormat);\n\n LL = front / 3;\n LR = LL + 1;\n UL = (back - 2) / 3;\n UR = UL - 1;\n indices[index++] = UL;\n indices[index++] = LL;\n indices[index++] = UR;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n }\n\n let posIndex = 0;\n let compIndex = 0;\n let rightEdge = positions[posIndex++]; //add first two edges\n let leftEdge = positions[posIndex++];\n finalPositions.set(rightEdge, front);\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\n\n left = Cartesian3.fromArray(computedLefts, compIndex, left);\n let rightNormal;\n let leftNormal;\n length = leftEdge.length - 3;\n for (i = 0; i < length; i += 3) {\n rightNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(rightEdge, i, scratch1),\n scratch1\n );\n leftNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(leftEdge, length - i, scratch2),\n scratch2\n );\n normal = Cartesian3.normalize(\n Cartesian3.add(rightNormal, leftNormal, normal),\n normal\n );\n addNormals(attr, normal, left, front, back, vertexFormat);\n\n LL = front / 3;\n LR = LL + 1;\n UL = (back - 2) / 3;\n UR = UL - 1;\n indices[index++] = UL;\n indices[index++] = LL;\n indices[index++] = UR;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n\n rightNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(rightEdge, length, scratch1),\n scratch1\n );\n leftNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(leftEdge, length, scratch2),\n scratch2\n );\n normal = Cartesian3.normalize(\n Cartesian3.add(rightNormal, leftNormal, normal),\n normal\n );\n compIndex += 3;\n for (i = 0; i < corners.length; i++) {\n let j;\n corner = corners[i];\n const l = corner.leftPositions;\n const r = corner.rightPositions;\n let pivot;\n let start;\n let outsidePoint = cartesian6;\n let previousPoint = cartesian3;\n let nextPoint = cartesian4;\n normal = Cartesian3.fromArray(computedNormals, compIndex, normal);\n if (defined(l)) {\n addNormals(attr, normal, left, undefined, back, vertexFormat);\n back -= 3;\n pivot = LR;\n start = UR;\n for (j = 0; j < l.length / 3; j++) {\n outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\n indices[index++] = pivot;\n indices[index++] = start - j - 1;\n indices[index++] = start - j;\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n outsidePoint,\n undefined,\n back\n );\n previousPoint = Cartesian3.fromArray(\n finalPositions,\n (start - j - 1) * 3,\n previousPoint\n );\n nextPoint = Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);\n left = Cartesian3.normalize(\n Cartesian3.subtract(previousPoint, nextPoint, left),\n left\n );\n addNormals(attr, normal, left, undefined, back, vertexFormat);\n back -= 3;\n }\n outsidePoint = Cartesian3.fromArray(\n finalPositions,\n pivot * 3,\n outsidePoint\n );\n previousPoint = Cartesian3.subtract(\n Cartesian3.fromArray(finalPositions, start * 3, previousPoint),\n outsidePoint,\n previousPoint\n );\n nextPoint = Cartesian3.subtract(\n Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),\n outsidePoint,\n nextPoint\n );\n left = Cartesian3.normalize(\n Cartesian3.add(previousPoint, nextPoint, left),\n left\n );\n addNormals(attr, normal, left, front, undefined, vertexFormat);\n front += 3;\n } else {\n addNormals(attr, normal, left, front, undefined, vertexFormat);\n front += 3;\n pivot = UR;\n start = LR;\n for (j = 0; j < r.length / 3; j++) {\n outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\n indices[index++] = pivot;\n indices[index++] = start + j;\n indices[index++] = start + j + 1;\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n outsidePoint,\n front\n );\n previousPoint = Cartesian3.fromArray(\n finalPositions,\n pivot * 3,\n previousPoint\n );\n nextPoint = Cartesian3.fromArray(\n finalPositions,\n (start + j) * 3,\n nextPoint\n );\n left = Cartesian3.normalize(\n Cartesian3.subtract(previousPoint, nextPoint, left),\n left\n );\n addNormals(attr, normal, left, front, undefined, vertexFormat);\n front += 3;\n }\n outsidePoint = Cartesian3.fromArray(\n finalPositions,\n pivot * 3,\n outsidePoint\n );\n previousPoint = Cartesian3.subtract(\n Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),\n outsidePoint,\n previousPoint\n );\n nextPoint = Cartesian3.subtract(\n Cartesian3.fromArray(finalPositions, start * 3, nextPoint),\n outsidePoint,\n nextPoint\n );\n left = Cartesian3.normalize(\n Cartesian3.negate(Cartesian3.add(nextPoint, previousPoint, left), left),\n left\n );\n addNormals(attr, normal, left, undefined, back, vertexFormat);\n back -= 3;\n }\n rightEdge = positions[posIndex++];\n leftEdge = positions[posIndex++];\n rightEdge.splice(0, 3); //remove duplicate points added by corner\n leftEdge.splice(leftEdge.length - 3, 3);\n finalPositions.set(rightEdge, front);\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\n length = leftEdge.length - 3;\n\n compIndex += 3;\n left = Cartesian3.fromArray(computedLefts, compIndex, left);\n for (j = 0; j < leftEdge.length; j += 3) {\n rightNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(rightEdge, j, scratch1),\n scratch1\n );\n leftNormal = ellipsoid.geodeticSurfaceNormal(\n Cartesian3.fromArray(leftEdge, length - j, scratch2),\n scratch2\n );\n normal = Cartesian3.normalize(\n Cartesian3.add(rightNormal, leftNormal, normal),\n normal\n );\n addNormals(attr, normal, left, front, back, vertexFormat);\n\n LR = front / 3;\n LL = LR - 1;\n UR = (back - 2) / 3;\n UL = UR + 1;\n indices[index++] = UL;\n indices[index++] = LL;\n indices[index++] = UR;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n front -= 3;\n back += 3;\n }\n normal = Cartesian3.fromArray(\n computedNormals,\n computedNormals.length - 3,\n normal\n );\n addNormals(attr, normal, left, front, back, vertexFormat);\n\n if (addEndPositions) {\n // add rounded end\n front += 3;\n back -= 3;\n leftPos = cartesian3;\n rightPos = cartesian4;\n const lastEndPositions = endPositions[1];\n for (i = 0; i < halfLength; i++) {\n leftPos = Cartesian3.fromArray(\n lastEndPositions,\n (endPositionLength - i - 1) * 3,\n leftPos\n );\n rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n leftPos,\n undefined,\n back\n );\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n addNormals(attr, normal, left, front, back, vertexFormat);\n\n LR = front / 3;\n LL = LR - 1;\n UR = (back - 2) / 3;\n UL = UR + 1;\n indices[index++] = UL;\n indices[index++] = LL;\n indices[index++] = UR;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n }\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: finalPositions,\n });\n\n if (vertexFormat.st) {\n const st = new Float32Array((size / 3) * 2);\n let rightSt;\n let leftSt;\n let stIndex = 0;\n if (addEndPositions) {\n leftCount /= 3;\n rightCount /= 3;\n const theta = Math.PI / (endPositionLength + 1);\n leftSt = 1 / (leftCount - endPositionLength + 1);\n rightSt = 1 / (rightCount - endPositionLength + 1);\n let a;\n const halfEndPos = endPositionLength / 2;\n for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {\n // lower left rounded end\n a = CesiumMath.PI_OVER_TWO + theta * i;\n st[stIndex++] = rightSt * (1 + Math.cos(a));\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\n }\n for (i = 1; i < rightCount - endPositionLength + 1; i++) {\n // bottom edge\n st[stIndex++] = i * rightSt;\n st[stIndex++] = 0;\n }\n for (i = endPositionLength; i > halfEndPos; i--) {\n // lower right rounded end\n a = CesiumMath.PI_OVER_TWO - i * theta;\n st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\n }\n for (i = halfEndPos; i > 0; i--) {\n // upper right rounded end\n a = CesiumMath.PI_OVER_TWO - theta * i;\n st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\n }\n for (i = leftCount - endPositionLength; i > 0; i--) {\n // top edge\n st[stIndex++] = i * leftSt;\n st[stIndex++] = 1;\n }\n for (i = 1; i < halfEndPos + 1; i++) {\n // upper left rounded end\n a = CesiumMath.PI_OVER_TWO + theta * i;\n st[stIndex++] = leftSt * (1 + Math.cos(a));\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\n }\n } else {\n leftCount /= 3;\n rightCount /= 3;\n leftSt = 1 / (leftCount - 1);\n rightSt = 1 / (rightCount - 1);\n for (i = 0; i < rightCount; i++) {\n // bottom edge\n st[stIndex++] = i * rightSt;\n st[stIndex++] = 0;\n }\n for (i = leftCount; i > 0; i--) {\n // top edge\n st[stIndex++] = (i - 1) * leftSt;\n st[stIndex++] = 1;\n }\n }\n\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: st,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attr.normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attr.tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attr.bitangents,\n });\n }\n\n return {\n attributes: attributes,\n indices: indices,\n };\n}\n\nfunction extrudedAttributes(attributes, vertexFormat) {\n if (\n !vertexFormat.normal &&\n !vertexFormat.tangent &&\n !vertexFormat.bitangent &&\n !vertexFormat.st\n ) {\n return attributes;\n }\n const positions = attributes.position.values;\n let topNormals;\n let topBitangents;\n if (vertexFormat.normal || vertexFormat.bitangent) {\n topNormals = attributes.normal.values;\n topBitangents = attributes.bitangent.values;\n }\n const size = attributes.position.values.length / 18;\n const threeSize = size * 3;\n const twoSize = size * 2;\n const sixSize = threeSize * 2;\n let i;\n if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {\n const normals = vertexFormat.normal\n ? new Float32Array(threeSize * 6)\n : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(threeSize * 6)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(threeSize * 6)\n : undefined;\n let topPosition = cartesian1;\n let bottomPosition = cartesian2;\n let previousPosition = cartesian3;\n let normal = cartesian4;\n let tangent = cartesian5;\n let bitangent = cartesian6;\n let attrIndex = sixSize;\n for (i = 0; i < threeSize; i += 3) {\n const attrIndexOffset = attrIndex + sixSize;\n topPosition = Cartesian3.fromArray(positions, i, topPosition);\n bottomPosition = Cartesian3.fromArray(\n positions,\n i + threeSize,\n bottomPosition\n );\n previousPosition = Cartesian3.fromArray(\n positions,\n (i + 3) % threeSize,\n previousPosition\n );\n bottomPosition = Cartesian3.subtract(\n bottomPosition,\n topPosition,\n bottomPosition\n );\n previousPosition = Cartesian3.subtract(\n previousPosition,\n topPosition,\n previousPosition\n );\n normal = Cartesian3.normalize(\n Cartesian3.cross(bottomPosition, previousPosition, normal),\n normal\n );\n if (vertexFormat.normal) {\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);\n CorridorGeometryLibrary.addAttribute(\n normals,\n normal,\n attrIndexOffset + 3\n );\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);\n }\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n bitangent = Cartesian3.fromArray(topNormals, i, bitangent);\n if (vertexFormat.bitangent) {\n CorridorGeometryLibrary.addAttribute(\n bitangents,\n bitangent,\n attrIndexOffset\n );\n CorridorGeometryLibrary.addAttribute(\n bitangents,\n bitangent,\n attrIndexOffset + 3\n );\n CorridorGeometryLibrary.addAttribute(\n bitangents,\n bitangent,\n attrIndex\n );\n CorridorGeometryLibrary.addAttribute(\n bitangents,\n bitangent,\n attrIndex + 3\n );\n }\n\n if (vertexFormat.tangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(bitangent, normal, tangent),\n tangent\n );\n CorridorGeometryLibrary.addAttribute(\n tangents,\n tangent,\n attrIndexOffset\n );\n CorridorGeometryLibrary.addAttribute(\n tangents,\n tangent,\n attrIndexOffset + 3\n );\n CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);\n CorridorGeometryLibrary.addAttribute(\n tangents,\n tangent,\n attrIndex + 3\n );\n }\n }\n attrIndex += 6;\n }\n\n if (vertexFormat.normal) {\n normals.set(topNormals); //top\n for (i = 0; i < threeSize; i += 3) {\n //bottom normals\n normals[i + threeSize] = -topNormals[i];\n normals[i + threeSize + 1] = -topNormals[i + 1];\n normals[i + threeSize + 2] = -topNormals[i + 2];\n }\n attributes.normal.values = normals;\n } else {\n attributes.normal = undefined;\n }\n\n if (vertexFormat.bitangent) {\n bitangents.set(topBitangents); //top\n bitangents.set(topBitangents, threeSize); //bottom\n attributes.bitangent.values = bitangents;\n } else {\n attributes.bitangent = undefined;\n }\n\n if (vertexFormat.tangent) {\n const topTangents = attributes.tangent.values;\n tangents.set(topTangents); //top\n tangents.set(topTangents, threeSize); //bottom\n attributes.tangent.values = tangents;\n }\n }\n if (vertexFormat.st) {\n const topSt = attributes.st.values;\n const st = new Float32Array(twoSize * 6);\n st.set(topSt); //top\n st.set(topSt, twoSize); //bottom\n let index = twoSize * 2;\n\n for (let j = 0; j < 2; j++) {\n st[index++] = topSt[0];\n st[index++] = topSt[1];\n for (i = 2; i < twoSize; i += 2) {\n const s = topSt[i];\n const t = topSt[i + 1];\n st[index++] = s;\n st[index++] = t;\n st[index++] = s;\n st[index++] = t;\n }\n st[index++] = topSt[0];\n st[index++] = topSt[1];\n }\n attributes.st.values = st;\n }\n\n return attributes;\n}\n\nfunction addWallPositions(positions, index, wallPositions) {\n wallPositions[index++] = positions[0];\n wallPositions[index++] = positions[1];\n wallPositions[index++] = positions[2];\n for (let i = 3; i < positions.length; i += 3) {\n const x = positions[i];\n const y = positions[i + 1];\n const z = positions[i + 2];\n wallPositions[index++] = x;\n wallPositions[index++] = y;\n wallPositions[index++] = z;\n wallPositions[index++] = x;\n wallPositions[index++] = y;\n wallPositions[index++] = z;\n }\n wallPositions[index++] = positions[0];\n wallPositions[index++] = positions[1];\n wallPositions[index++] = positions[2];\n\n return wallPositions;\n}\n\nfunction computePositionsExtruded(params, vertexFormat) {\n const topVertexFormat = new VertexFormat({\n position: vertexFormat.position,\n normal:\n vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,\n tangent: vertexFormat.tangent,\n bitangent: vertexFormat.normal || vertexFormat.bitangent,\n st: vertexFormat.st,\n });\n const ellipsoid = params.ellipsoid;\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\n const attr = combine(computedPositions, topVertexFormat, ellipsoid);\n const height = params.height;\n const extrudedHeight = params.extrudedHeight;\n let attributes = attr.attributes;\n const indices = attr.indices;\n let positions = attributes.position.values;\n let length = positions.length;\n const newPositions = new Float64Array(length * 6);\n let extrudedPositions = new Float64Array(length);\n extrudedPositions.set(positions);\n let wallPositions = new Float64Array(length * 4);\n\n positions = PolygonPipeline.scaleToGeodeticHeight(\n positions,\n height,\n ellipsoid\n );\n wallPositions = addWallPositions(positions, 0, wallPositions);\n extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\n extrudedPositions,\n extrudedHeight,\n ellipsoid\n );\n wallPositions = addWallPositions(\n extrudedPositions,\n length * 2,\n wallPositions\n );\n newPositions.set(positions);\n newPositions.set(extrudedPositions, length);\n newPositions.set(wallPositions, length * 2);\n attributes.position.values = newPositions;\n\n attributes = extrudedAttributes(attributes, vertexFormat);\n let i;\n const size = length / 3;\n if (params.shadowVolume) {\n const topNormals = attributes.normal.values;\n length = topNormals.length;\n\n let extrudeNormals = new Float32Array(length * 6);\n for (i = 0; i < length; i++) {\n topNormals[i] = -topNormals[i];\n }\n //only get normals for bottom layer that's going to be pushed down\n extrudeNormals.set(topNormals, length); //bottom face\n extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall\n attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: extrudeNormals,\n });\n if (!vertexFormat.normal) {\n attributes.normal = undefined;\n }\n }\n if (defined(params.offsetAttribute)) {\n let applyOffset = new Uint8Array(size * 6);\n if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\n applyOffset = applyOffset\n .fill(1, 0, size) // top face\n .fill(1, size * 2, size * 4); // top wall\n } else {\n const applyOffsetValue =\n params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n applyOffset = applyOffset.fill(applyOffsetValue);\n }\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n const iLength = indices.length;\n const twoSize = size + size;\n const newIndices = IndexDatatype.createTypedArray(\n newPositions.length / 3,\n iLength * 2 + twoSize * 3\n );\n newIndices.set(indices);\n let index = iLength;\n for (i = 0; i < iLength; i += 3) {\n // bottom indices\n const v0 = indices[i];\n const v1 = indices[i + 1];\n const v2 = indices[i + 2];\n newIndices[index++] = v2 + size;\n newIndices[index++] = v1 + size;\n newIndices[index++] = v0 + size;\n }\n\n let UL, LL, UR, LR;\n\n for (i = 0; i < twoSize; i += 2) {\n //wall indices\n UL = i + twoSize;\n LL = UL + twoSize;\n UR = UL + 1;\n LR = LL + 1;\n newIndices[index++] = UL;\n newIndices[index++] = LL;\n newIndices[index++] = UR;\n newIndices[index++] = UR;\n newIndices[index++] = LL;\n newIndices[index++] = LR;\n }\n\n return {\n attributes: attributes,\n indices: newIndices,\n };\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n\nfunction computeOffsetPoints(\n position1,\n position2,\n ellipsoid,\n halfWidth,\n min,\n max\n) {\n // Compute direction of offset the point\n const direction = Cartesian3.subtract(\n position2,\n position1,\n scratchCartesian1\n );\n Cartesian3.normalize(direction, direction);\n const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);\n const offsetDirection = Cartesian3.cross(\n direction,\n normal,\n scratchCartesian1\n );\n Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);\n\n let minLat = min.latitude;\n let minLon = min.longitude;\n let maxLat = max.latitude;\n let maxLon = max.longitude;\n\n // Compute 2 offset points\n Cartesian3.add(position1, offsetDirection, scratchCartesian2);\n ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\n\n let lat = scratchCartographic.latitude;\n let lon = scratchCartographic.longitude;\n minLat = Math.min(minLat, lat);\n minLon = Math.min(minLon, lon);\n maxLat = Math.max(maxLat, lat);\n maxLon = Math.max(maxLon, lon);\n\n Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);\n ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\n\n lat = scratchCartographic.latitude;\n lon = scratchCartographic.longitude;\n minLat = Math.min(minLat, lat);\n minLon = Math.min(minLon, lon);\n maxLat = Math.max(maxLat, lat);\n maxLon = Math.max(maxLon, lon);\n\n min.latitude = minLat;\n min.longitude = minLon;\n max.latitude = maxLat;\n max.longitude = maxLon;\n}\n\nconst scratchCartesianOffset = new Cartesian3();\nconst scratchCartesianEnds = new Cartesian3();\nconst scratchCartographicMin = new Cartographic();\nconst scratchCartographicMax = new Cartographic();\n\nfunction computeRectangle(positions, ellipsoid, width, cornerType, result) {\n positions = scaleToSurface(positions, ellipsoid);\n const cleanPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n const length = cleanPositions.length;\n if (length < 2 || width <= 0) {\n return new Rectangle();\n }\n const halfWidth = width * 0.5;\n\n scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;\n scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;\n scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;\n scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;\n\n let lat, lon;\n if (cornerType === CornerType.ROUNDED) {\n // Compute start cap\n const first = cleanPositions[0];\n Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);\n Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\n Cartesian3.multiplyByScalar(\n scratchCartesianOffset,\n halfWidth,\n scratchCartesianOffset\n );\n Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);\n\n ellipsoid.cartesianToCartographic(\n scratchCartesianEnds,\n scratchCartographic\n );\n lat = scratchCartographic.latitude;\n lon = scratchCartographic.longitude;\n scratchCartographicMin.latitude = Math.min(\n scratchCartographicMin.latitude,\n lat\n );\n scratchCartographicMin.longitude = Math.min(\n scratchCartographicMin.longitude,\n lon\n );\n scratchCartographicMax.latitude = Math.max(\n scratchCartographicMax.latitude,\n lat\n );\n scratchCartographicMax.longitude = Math.max(\n scratchCartographicMax.longitude,\n lon\n );\n }\n\n // Compute the rest\n for (let i = 0; i < length - 1; ++i) {\n computeOffsetPoints(\n cleanPositions[i],\n cleanPositions[i + 1],\n ellipsoid,\n halfWidth,\n scratchCartographicMin,\n scratchCartographicMax\n );\n }\n\n // Compute ending point\n const last = cleanPositions[length - 1];\n Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);\n Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\n Cartesian3.multiplyByScalar(\n scratchCartesianOffset,\n halfWidth,\n scratchCartesianOffset\n );\n Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);\n computeOffsetPoints(\n last,\n scratchCartesianEnds,\n ellipsoid,\n halfWidth,\n scratchCartographicMin,\n scratchCartographicMax\n );\n\n if (cornerType === CornerType.ROUNDED) {\n // Compute end cap\n ellipsoid.cartesianToCartographic(\n scratchCartesianEnds,\n scratchCartographic\n );\n lat = scratchCartographic.latitude;\n lon = scratchCartographic.longitude;\n scratchCartographicMin.latitude = Math.min(\n scratchCartographicMin.latitude,\n lat\n );\n scratchCartographicMin.longitude = Math.min(\n scratchCartographicMin.longitude,\n lon\n );\n scratchCartographicMax.latitude = Math.max(\n scratchCartographicMax.latitude,\n lat\n );\n scratchCartographicMax.longitude = Math.max(\n scratchCartographicMax.longitude,\n lon\n );\n }\n\n const rectangle = defined(result) ? result : new Rectangle();\n rectangle.north = scratchCartographicMax.latitude;\n rectangle.south = scratchCartographicMin.latitude;\n rectangle.east = scratchCartographicMax.longitude;\n rectangle.west = scratchCartographicMin.longitude;\n\n return rectangle;\n}\n\n/**\n * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias CorridorGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\n * @param {Number} options.width The distance between the edges of the corridor in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see CorridorGeometry.createGeometry\n * @see Packable\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}\n *\n * @example\n * const corridor = new Cesium.CorridorGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\n * width : 100000\n * });\n */\nfunction CorridorGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n const width = options.width;\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._positions = positions;\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._vertexFormat = VertexFormat.clone(\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n );\n this._width = width;\n this._height = Math.max(height, extrudedHeight);\n this._extrudedHeight = Math.min(height, extrudedHeight);\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._shadowVolume = defaultValue(options.shadowVolume, false);\n this._workerName = \"createCorridorGeometry\";\n this._offsetAttribute = options.offsetAttribute;\n this._rectangle = undefined;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n 1 +\n positions.length * Cartesian3.packedLength +\n Ellipsoid.packedLength +\n VertexFormat.packedLength +\n 7;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CorridorGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCorridorGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const positions = value._positions;\n const length = positions.length;\n array[startingIndex++] = length;\n\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._width;\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._cornerType;\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n positions: undefined,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n width: undefined,\n height: undefined,\n extrudedHeight: undefined,\n cornerType: undefined,\n granularity: undefined,\n shadowVolume: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CorridorGeometry} [result] The object into which to store the result.\n * @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.\n */\nCorridorGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const length = array[startingIndex++];\n const positions = new Array(length);\n\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const width = array[startingIndex++];\n const height = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const cornerType = array[startingIndex++];\n const granularity = array[startingIndex++];\n const shadowVolume = array[startingIndex++] === 1.0;\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.positions = positions;\n scratchOptions.width = width;\n scratchOptions.height = height;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.cornerType = cornerType;\n scratchOptions.granularity = granularity;\n scratchOptions.shadowVolume = shadowVolume;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return new CorridorGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._width = width;\n result._height = height;\n result._extrudedHeight = extrudedHeight;\n result._cornerType = cornerType;\n result._granularity = granularity;\n result._shadowVolume = shadowVolume;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the bounding rectangle given the provided options\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\n * @param {Number} options.width The distance between the edges of the corridor in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle.\n */\nCorridorGeometry.computeRectangle = function (options, result) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n const width = options.width;\n\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n\n return computeRectangle(positions, ellipsoid, width, cornerType, result);\n};\n\n/**\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\n *\n * @param {CorridorGeometry} corridorGeometry A description of the corridor.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCorridorGeometry.createGeometry = function (corridorGeometry) {\n let positions = corridorGeometry._positions;\n const width = corridorGeometry._width;\n const ellipsoid = corridorGeometry._ellipsoid;\n\n positions = scaleToSurface(positions, ellipsoid);\n const cleanPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n\n if (cleanPositions.length < 2 || width <= 0) {\n return;\n }\n\n const height = corridorGeometry._height;\n const extrudedHeight = corridorGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n height,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n\n const vertexFormat = corridorGeometry._vertexFormat;\n const params = {\n ellipsoid: ellipsoid,\n positions: cleanPositions,\n width: width,\n cornerType: corridorGeometry._cornerType,\n granularity: corridorGeometry._granularity,\n saveAttributes: true,\n };\n let attr;\n if (extrude) {\n params.height = height;\n params.extrudedHeight = extrudedHeight;\n params.shadowVolume = corridorGeometry._shadowVolume;\n params.offsetAttribute = corridorGeometry._offsetAttribute;\n attr = computePositionsExtruded(params, vertexFormat);\n } else {\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\n attr = combine(computedPositions, vertexFormat, ellipsoid);\n attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n attr.attributes.position.values,\n height,\n ellipsoid\n );\n\n if (defined(corridorGeometry._offsetAttribute)) {\n const applyOffsetValue =\n corridorGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const length = attr.attributes.position.values.length;\n const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);\n attr.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n }\n const attributes = attr.attributes;\n const boundingSphere = BoundingSphere.fromVertices(\n attributes.position.values,\n undefined,\n 3\n );\n if (!vertexFormat.position) {\n attr.attributes.position.values = undefined;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: attr.indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: boundingSphere,\n offsetAttribute: corridorGeometry._offsetAttribute,\n });\n};\n\n/**\n * @private\n */\nCorridorGeometry.createShadowVolume = function (\n corridorGeometry,\n minHeightFunc,\n maxHeightFunc\n) {\n const granularity = corridorGeometry._granularity;\n const ellipsoid = corridorGeometry._ellipsoid;\n\n const minHeight = minHeightFunc(granularity, ellipsoid);\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n return new CorridorGeometry({\n positions: corridorGeometry._positions,\n width: corridorGeometry._width,\n cornerType: corridorGeometry._cornerType,\n ellipsoid: ellipsoid,\n granularity: granularity,\n extrudedHeight: minHeight,\n height: maxHeight,\n vertexFormat: VertexFormat.POSITION_ONLY,\n shadowVolume: true,\n });\n};\n\nObject.defineProperties(CorridorGeometry.prototype, {\n /**\n * @private\n */\n rectangle: {\n get: function () {\n if (!defined(this._rectangle)) {\n this._rectangle = computeRectangle(\n this._positions,\n this._ellipsoid,\n this._width,\n this._cornerType\n );\n }\n return this._rectangle;\n },\n },\n /**\n * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.\n *\n * Corridors don't support stRotation,\n * so just return the corners of the original system.\n * @private\n */\n textureCoordinateRotationPoints: {\n get: function () {\n return [0, 0, 0, 1, 1, 0];\n },\n },\n});\nexport default CorridorGeometry;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst cartesian1 = new Cartesian3();\nconst cartesian2 = new Cartesian3();\nconst cartesian3 = new Cartesian3();\n\nfunction scaleToSurface(positions, ellipsoid) {\n for (let i = 0; i < positions.length; i++) {\n positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\n }\n return positions;\n}\n\nfunction combine(computedPositions, cornerType) {\n const wallIndices = [];\n const positions = computedPositions.positions;\n const corners = computedPositions.corners;\n const endPositions = computedPositions.endPositions;\n const attributes = new GeometryAttributes();\n let corner;\n let leftCount = 0;\n let rightCount = 0;\n let i;\n let indicesLength = 0;\n let length;\n for (i = 0; i < positions.length; i += 2) {\n length = positions[i].length - 3;\n leftCount += length; //subtracting 3 to account for duplicate points at corners\n indicesLength += (length / 3) * 4;\n rightCount += positions[i + 1].length - 3;\n }\n leftCount += 3; //add back count for end positions\n rightCount += 3;\n for (i = 0; i < corners.length; i++) {\n corner = corners[i];\n const leftSide = corners[i].leftPositions;\n if (defined(leftSide)) {\n length = leftSide.length;\n leftCount += length;\n indicesLength += (length / 3) * 2;\n } else {\n length = corners[i].rightPositions.length;\n rightCount += length;\n indicesLength += (length / 3) * 2;\n }\n }\n\n const addEndPositions = defined(endPositions);\n let endPositionLength;\n if (addEndPositions) {\n endPositionLength = endPositions[0].length - 3;\n leftCount += endPositionLength;\n rightCount += endPositionLength;\n endPositionLength /= 3;\n indicesLength += endPositionLength * 4;\n }\n const size = leftCount + rightCount;\n const finalPositions = new Float64Array(size);\n let front = 0;\n let back = size - 1;\n let UL, LL, UR, LR;\n let rightPos, leftPos;\n const halfLength = endPositionLength / 2;\n\n const indices = IndexDatatype.createTypedArray(size / 3, indicesLength + 4);\n let index = 0;\n\n indices[index++] = front / 3;\n indices[index++] = (back - 2) / 3;\n if (addEndPositions) {\n // add rounded end\n wallIndices.push(front / 3);\n leftPos = cartesian1;\n rightPos = cartesian2;\n const firstEndPositions = endPositions[0];\n for (i = 0; i < halfLength; i++) {\n leftPos = Cartesian3.fromArray(\n firstEndPositions,\n (halfLength - 1 - i) * 3,\n leftPos\n );\n rightPos = Cartesian3.fromArray(\n firstEndPositions,\n (halfLength + i) * 3,\n rightPos\n );\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n leftPos,\n undefined,\n back\n );\n\n LL = front / 3;\n LR = LL + 1;\n UL = (back - 2) / 3;\n UR = UL - 1;\n indices[index++] = UL;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n }\n\n let posIndex = 0;\n let rightEdge = positions[posIndex++]; //add first two edges\n let leftEdge = positions[posIndex++];\n finalPositions.set(rightEdge, front);\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\n\n length = leftEdge.length - 3;\n wallIndices.push(front / 3, (back - 2) / 3);\n for (i = 0; i < length; i += 3) {\n LL = front / 3;\n LR = LL + 1;\n UL = (back - 2) / 3;\n UR = UL - 1;\n indices[index++] = UL;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n\n for (i = 0; i < corners.length; i++) {\n let j;\n corner = corners[i];\n const l = corner.leftPositions;\n const r = corner.rightPositions;\n let start;\n let outsidePoint = cartesian3;\n if (defined(l)) {\n back -= 3;\n start = UR;\n wallIndices.push(LR);\n for (j = 0; j < l.length / 3; j++) {\n outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\n indices[index++] = start - j - 1;\n indices[index++] = start - j;\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n outsidePoint,\n undefined,\n back\n );\n back -= 3;\n }\n wallIndices.push(start - Math.floor(l.length / 6));\n if (cornerType === CornerType.BEVELED) {\n wallIndices.push((back - 2) / 3 + 1);\n }\n front += 3;\n } else {\n front += 3;\n start = LR;\n wallIndices.push(UR);\n for (j = 0; j < r.length / 3; j++) {\n outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\n indices[index++] = start + j;\n indices[index++] = start + j + 1;\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n outsidePoint,\n front\n );\n front += 3;\n }\n wallIndices.push(start + Math.floor(r.length / 6));\n if (cornerType === CornerType.BEVELED) {\n wallIndices.push(front / 3 - 1);\n }\n back -= 3;\n }\n rightEdge = positions[posIndex++];\n leftEdge = positions[posIndex++];\n rightEdge.splice(0, 3); //remove duplicate points added by corner\n leftEdge.splice(leftEdge.length - 3, 3);\n finalPositions.set(rightEdge, front);\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\n length = leftEdge.length - 3;\n\n for (j = 0; j < leftEdge.length; j += 3) {\n LR = front / 3;\n LL = LR - 1;\n UR = (back - 2) / 3;\n UL = UR + 1;\n indices[index++] = UL;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n front += 3;\n back -= 3;\n }\n front -= 3;\n back += 3;\n wallIndices.push(front / 3, (back - 2) / 3);\n }\n\n if (addEndPositions) {\n // add rounded end\n front += 3;\n back -= 3;\n leftPos = cartesian1;\n rightPos = cartesian2;\n const lastEndPositions = endPositions[1];\n for (i = 0; i < halfLength; i++) {\n leftPos = Cartesian3.fromArray(\n lastEndPositions,\n (endPositionLength - i - 1) * 3,\n leftPos\n );\n rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\n CorridorGeometryLibrary.addAttribute(\n finalPositions,\n leftPos,\n undefined,\n back\n );\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\n\n LR = front / 3;\n LL = LR - 1;\n UR = (back - 2) / 3;\n UL = UR + 1;\n indices[index++] = UL;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n\n front += 3;\n back -= 3;\n }\n\n wallIndices.push(front / 3);\n } else {\n wallIndices.push(front / 3, (back - 2) / 3);\n }\n indices[index++] = front / 3;\n indices[index++] = (back - 2) / 3;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: finalPositions,\n });\n\n return {\n attributes: attributes,\n indices: indices,\n wallIndices: wallIndices,\n };\n}\n\nfunction computePositionsExtruded(params) {\n const ellipsoid = params.ellipsoid;\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\n const attr = combine(computedPositions, params.cornerType);\n const wallIndices = attr.wallIndices;\n const height = params.height;\n const extrudedHeight = params.extrudedHeight;\n const attributes = attr.attributes;\n const indices = attr.indices;\n let positions = attributes.position.values;\n let length = positions.length;\n let extrudedPositions = new Float64Array(length);\n extrudedPositions.set(positions);\n const newPositions = new Float64Array(length * 2);\n\n positions = PolygonPipeline.scaleToGeodeticHeight(\n positions,\n height,\n ellipsoid\n );\n extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\n extrudedPositions,\n extrudedHeight,\n ellipsoid\n );\n newPositions.set(positions);\n newPositions.set(extrudedPositions, length);\n attributes.position.values = newPositions;\n\n length /= 3;\n if (defined(params.offsetAttribute)) {\n let applyOffset = new Uint8Array(length * 2);\n if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\n applyOffset = applyOffset.fill(1, 0, length);\n } else {\n const applyOffsetValue =\n params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n applyOffset = applyOffset.fill(applyOffsetValue);\n }\n\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n let i;\n const iLength = indices.length;\n const newIndices = IndexDatatype.createTypedArray(\n newPositions.length / 3,\n (iLength + wallIndices.length) * 2\n );\n newIndices.set(indices);\n let index = iLength;\n for (i = 0; i < iLength; i += 2) {\n // bottom indices\n const v0 = indices[i];\n const v1 = indices[i + 1];\n newIndices[index++] = v0 + length;\n newIndices[index++] = v1 + length;\n }\n\n let UL, LL;\n for (i = 0; i < wallIndices.length; i++) {\n //wall indices\n UL = wallIndices[i];\n LL = UL + length;\n newIndices[index++] = UL;\n newIndices[index++] = LL;\n }\n\n return {\n attributes: attributes,\n indices: newIndices,\n };\n}\n\n/**\n * A description of a corridor outline.\n *\n * @alias CorridorOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.\n * @param {Number} options.width The distance between the edges of the corridor outline.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.\n * @param {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see CorridorOutlineGeometry.createGeometry\n *\n * @example\n * const corridor = new Cesium.CorridorOutlineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\n * width : 100000\n * });\n */\nfunction CorridorOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n const width = options.width;\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._positions = positions;\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._width = width;\n this._height = Math.max(height, extrudedHeight);\n this._extrudedHeight = Math.min(height, extrudedHeight);\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createCorridorOutlineGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + 6;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CorridorOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCorridorOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const positions = value._positions;\n const length = positions.length;\n array[startingIndex++] = length;\n\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._width;\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._cornerType;\n array[startingIndex++] = value._granularity;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n positions: undefined,\n ellipsoid: scratchEllipsoid,\n width: undefined,\n height: undefined,\n extrudedHeight: undefined,\n cornerType: undefined,\n granularity: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CorridorOutlineGeometry} [result] The object into which to store the result.\n * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.\n */\nCorridorOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const length = array[startingIndex++];\n const positions = new Array(length);\n\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const width = array[startingIndex++];\n const height = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const cornerType = array[startingIndex++];\n const granularity = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.positions = positions;\n scratchOptions.width = width;\n scratchOptions.height = height;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.cornerType = cornerType;\n scratchOptions.granularity = granularity;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new CorridorOutlineGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._width = width;\n result._height = height;\n result._extrudedHeight = extrudedHeight;\n result._cornerType = cornerType;\n result._granularity = granularity;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\n *\n * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) {\n let positions = corridorOutlineGeometry._positions;\n const width = corridorOutlineGeometry._width;\n const ellipsoid = corridorOutlineGeometry._ellipsoid;\n\n positions = scaleToSurface(positions, ellipsoid);\n const cleanPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n\n if (cleanPositions.length < 2 || width <= 0) {\n return;\n }\n\n const height = corridorOutlineGeometry._height;\n const extrudedHeight = corridorOutlineGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n height,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n\n const params = {\n ellipsoid: ellipsoid,\n positions: cleanPositions,\n width: width,\n cornerType: corridorOutlineGeometry._cornerType,\n granularity: corridorOutlineGeometry._granularity,\n saveAttributes: false,\n };\n let attr;\n if (extrude) {\n params.height = height;\n params.extrudedHeight = extrudedHeight;\n params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;\n attr = computePositionsExtruded(params);\n } else {\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\n attr = combine(computedPositions, params.cornerType);\n attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n attr.attributes.position.values,\n height,\n ellipsoid\n );\n\n if (defined(corridorOutlineGeometry._offsetAttribute)) {\n const length = attr.attributes.position.values.length;\n const offsetValue =\n corridorOutlineGeometry._offsetAttribute ===\n GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attr.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n }\n const attributes = attr.attributes;\n const boundingSphere = BoundingSphere.fromVertices(\n attributes.position.values,\n undefined,\n 3\n );\n\n return new Geometry({\n attributes: attributes,\n indices: attr.indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: boundingSphere,\n offsetAttribute: corridorOutlineGeometry._offsetAttribute,\n });\n};\nexport default CorridorOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport TerrainOffsetProperty from \"./TerrainOffsetProperty.js\";\n\nconst defaultZIndex = new ConstantProperty(0);\n\n/**\n * An abstract class for updating ground geometry entities.\n * @constructor\n * @alias GroundGeometryUpdater\n * @param {Object} options An object with the following properties:\n * @param {Entity} options.entity The entity containing the geometry to be visualized.\n * @param {Scene} options.scene The scene where visualization is taking place.\n * @param {Object} options.geometryOptions Options for the geometry\n * @param {String} options.geometryPropertyName The geometry property name\n * @param {String[]} options.observedPropertyNames The entity properties this geometry cares about\n */\nfunction GroundGeometryUpdater(options) {\n GeometryUpdater.call(this, options);\n\n this._zIndex = 0;\n this._terrainOffsetProperty = undefined;\n}\n\nif (defined(Object.create)) {\n GroundGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n GroundGeometryUpdater.prototype.constructor = GroundGeometryUpdater;\n}\n\nObject.defineProperties(GroundGeometryUpdater.prototype, {\n /**\n * Gets the zindex\n * @type {Number}\n * @memberof GroundGeometryUpdater.prototype\n * @readonly\n */\n zIndex: {\n get: function () {\n return this._zIndex;\n },\n },\n\n /**\n * Gets the terrain offset property\n * @type {TerrainOffsetProperty}\n * @memberof GroundGeometryUpdater.prototype\n * @readonly\n * @private\n */\n terrainOffsetProperty: {\n get: function () {\n return this._terrainOffsetProperty;\n },\n },\n});\n\nGroundGeometryUpdater.prototype._isOnTerrain = function (entity, geometry) {\n return (\n this._fillEnabled &&\n !defined(geometry.height) &&\n !defined(geometry.extrudedHeight) &&\n GroundPrimitive.isSupported(this._scene)\n );\n};\n\nGroundGeometryUpdater.prototype._getIsClosed = function (options) {\n const height = options.height;\n const extrudedHeight = options.extrudedHeight;\n return height === 0 || (defined(extrudedHeight) && extrudedHeight !== height);\n};\n\nGroundGeometryUpdater.prototype._computeCenter =\n DeveloperError.throwInstantiationError;\n\nGroundGeometryUpdater.prototype._onEntityPropertyChanged = function (\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n GeometryUpdater.prototype._onEntityPropertyChanged.call(\n this,\n entity,\n propertyName,\n newValue,\n oldValue\n );\n if (this._observedPropertyNames.indexOf(propertyName) === -1) {\n return;\n }\n\n const geometry = this._entity[this._geometryPropertyName];\n if (!defined(geometry)) {\n return;\n }\n if (\n defined(geometry.zIndex) &&\n (defined(geometry.height) || defined(geometry.extrudedHeight))\n ) {\n oneTimeWarning(oneTimeWarning.geometryZIndex);\n }\n\n this._zIndex = defaultValue(geometry.zIndex, defaultZIndex);\n\n if (defined(this._terrainOffsetProperty)) {\n this._terrainOffsetProperty.destroy();\n this._terrainOffsetProperty = undefined;\n }\n\n const heightReferenceProperty = geometry.heightReference;\n const extrudedHeightReferenceProperty = geometry.extrudedHeightReference;\n\n if (\n defined(heightReferenceProperty) ||\n defined(extrudedHeightReferenceProperty)\n ) {\n const centerPosition = new CallbackProperty(\n this._computeCenter.bind(this),\n !this._dynamic\n );\n this._terrainOffsetProperty = new TerrainOffsetProperty(\n this._scene,\n centerPosition,\n heightReferenceProperty,\n extrudedHeightReferenceProperty\n );\n }\n};\n\n/**\n * Destroys and resources used by the object. Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nGroundGeometryUpdater.prototype.destroy = function () {\n if (defined(this._terrainOffsetProperty)) {\n this._terrainOffsetProperty.destroy();\n this._terrainOffsetProperty = undefined;\n }\n\n GeometryUpdater.prototype.destroy.call(this);\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.getGeometryHeight = function (height, heightReference) {\nif (!defined(height)) {\n if (heightReference !== HeightReference.NONE) {\n oneTimeWarning(oneTimeWarning.geometryHeightReference);\n }\n return;\n }\n\n if (heightReference !== HeightReference.CLAMP_TO_GROUND) {\n return height;\n }\n return 0.0;\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.getGeometryExtrudedHeight = function (\n extrudedHeight,\n extrudedHeightReference\n) {\nif (!defined(extrudedHeight)) {\n if (extrudedHeightReference !== HeightReference.NONE) {\n oneTimeWarning(oneTimeWarning.geometryExtrudedHeightReference);\n }\n return;\n }\n if (extrudedHeightReference !== HeightReference.CLAMP_TO_GROUND) {\n return extrudedHeight;\n }\n\n return GroundGeometryUpdater.CLAMP_TO_GROUND;\n};\n\n/**\n * @private\n */\nGroundGeometryUpdater.CLAMP_TO_GROUND = \"clamp\";\n\n/**\n * @private\n */\nGroundGeometryUpdater.computeGeometryOffsetAttribute = function (\n height,\n heightReference,\n extrudedHeight,\n extrudedHeightReference\n) {\n if (!defined(height) || !defined(heightReference)) {\n heightReference = HeightReference.NONE;\n }\n if (!defined(extrudedHeight) || !defined(extrudedHeightReference)) {\n extrudedHeightReference = HeightReference.NONE;\n }\n let n = 0;\n if (heightReference !== HeightReference.NONE) {\n n++;\n }\n if (extrudedHeightReference === HeightReference.RELATIVE_TO_GROUND) {\n n++;\n }\n if (n === 2) {\n return GeometryOffsetAttribute.ALL;\n }\n if (n === 1) {\n return GeometryOffsetAttribute.TOP;\n }\n\n return undefined;\n};\nexport default GroundGeometryUpdater;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CorridorGeometry from \"../Core/CorridorGeometry.js\";\nimport CorridorOutlineGeometry from \"../Core/CorridorOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\n\nfunction CorridorGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.positions = undefined;\n this.width = undefined;\n this.cornerType = undefined;\n this.height = undefined;\n this.extrudedHeight = undefined;\n this.granularity = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for corridors.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias CorridorGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction CorridorGeometryUpdater(entity, scene) {\n GroundGeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new CorridorGeometryOptions(entity),\n geometryPropertyName: \"corridor\",\n observedPropertyNames: [\"availability\", \"corridor\"],\n });\n\n this._onEntityPropertyChanged(entity, \"corridor\", entity.corridor, undefined);\n}\n\nif (defined(Object.create)) {\n CorridorGeometryUpdater.prototype = Object.create(\n GroundGeometryUpdater.prototype\n );\n CorridorGeometryUpdater.prototype.constructor = CorridorGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nCorridorGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n ),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n this._distanceDisplayConditionProperty.getValue(time)\n ),\n offset: undefined,\n color: undefined,\n };\n\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new CorridorGeometry(this._options),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nCorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n this._distanceDisplayConditionProperty.getValue(time)\n ),\n offset: undefined,\n };\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new CorridorOutlineGeometry(this._options),\n attributes: attributes,\n });\n};\n\nCorridorGeometryUpdater.prototype._computeCenter = function (time, result) {\n const positions = Property.getValueOrUndefined(\n this._entity.corridor.positions,\n time\n );\n if (!defined(positions) || positions.length === 0) {\n return;\n }\n return Cartesian3.clone(\n positions[Math.floor(positions.length / 2.0)],\n result\n );\n};\n\nCorridorGeometryUpdater.prototype._isHidden = function (entity, corridor) {\n return (\n !defined(corridor.positions) ||\n !defined(corridor.width) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, corridor)\n );\n};\n\nCorridorGeometryUpdater.prototype._isDynamic = function (entity, corridor) {\n return (\n !corridor.positions.isConstant || //\n !Property.isConstant(corridor.height) || //\n !Property.isConstant(corridor.extrudedHeight) || //\n !Property.isConstant(corridor.granularity) || //\n !Property.isConstant(corridor.width) || //\n !Property.isConstant(corridor.outlineWidth) || //\n !Property.isConstant(corridor.cornerType) || //\n !Property.isConstant(corridor.zIndex) || //\n (this._onTerrain &&\n !Property.isConstant(this._materialProperty) &&\n !(this._materialProperty instanceof ColorMaterialProperty))\n );\n};\n\nCorridorGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n corridor\n) {\n let heightValue = Property.getValueOrUndefined(\n corridor.height,\n Iso8601.MINIMUM_VALUE\n );\n const heightReferenceValue = Property.getValueOrDefault(\n corridor.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n corridor.extrudedHeight,\n Iso8601.MINIMUM_VALUE\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n corridor.extrudedHeightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n const options = this._options;\n options.vertexFormat =\n this._materialProperty instanceof ColorMaterialProperty\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.positions = corridor.positions.getValue(\n Iso8601.MINIMUM_VALUE,\n options.positions\n );\n options.width = corridor.width.getValue(Iso8601.MINIMUM_VALUE);\n options.granularity = Property.getValueOrUndefined(\n corridor.granularity,\n Iso8601.MINIMUM_VALUE\n );\n options.cornerType = Property.getValueOrUndefined(\n corridor.cornerType,\n Iso8601.MINIMUM_VALUE\n );\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n CorridorGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\n\nCorridorGeometryUpdater.DynamicGeometryUpdater = DynamicCorridorGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicCorridorGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicCorridorGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicCorridorGeometryUpdater.prototype.constructor = DynamicCorridorGeometryUpdater;\n}\n\nDynamicCorridorGeometryUpdater.prototype._isHidden = function (\n entity,\n corridor,\n time\n) {\n const options = this._options;\n return (\n !defined(options.positions) ||\n !defined(options.width) ||\n DynamicGeometryUpdater.prototype._isHidden.call(\n this,\n entity,\n corridor,\n time\n )\n );\n};\n\nDynamicCorridorGeometryUpdater.prototype._setOptions = function (\n entity,\n corridor,\n time\n) {\n const options = this._options;\n let heightValue = Property.getValueOrUndefined(corridor.height, time);\n const heightReferenceValue = Property.getValueOrDefault(\n corridor.heightReference,\n time,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n corridor.extrudedHeight,\n time\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n corridor.extrudedHeightReference,\n time,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n options.positions = Property.getValueOrUndefined(corridor.positions, time);\n options.width = Property.getValueOrUndefined(corridor.width, time);\n options.granularity = Property.getValueOrUndefined(\n corridor.granularity,\n time\n );\n options.cornerType = Property.getValueOrUndefined(corridor.cornerType, time);\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n CorridorGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\nexport default CorridorGeometryUpdater;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines the interface for data sources, which turn arbitrary data into a\n * {@link EntityCollection} for generic consumption. This object is an interface\n * for documentation purposes and is not intended to be instantiated directly.\n * @alias DataSource\n * @constructor\n *\n * @see Entity\n * @see DataSourceDisplay\n */\nfunction DataSource() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(DataSource.prototype, {\n /**\n * Gets a human-readable name for this instance.\n * @memberof DataSource.prototype\n * @type {String}\n */\n name: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the preferred clock settings for this data source.\n * @memberof DataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof DataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets a value indicating if the data source is currently loading data.\n * @memberof DataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof DataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof DataSource.prototype\n * @type {Event<function(this, RequestErrorEvent)>}\n */\n errorEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets an event that will be raised when the value of isLoading changes.\n * @memberof DataSource.prototype\n * @type {Event<function(this, boolean)>}\n */\n loadingEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof DataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof DataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Updates the data source to the provided time. This function is optional and\n * is not required to be implemented. It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nDataSource.prototype.update = function (time) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * @private\n */\nDataSource.setLoading = function (dataSource, isLoading) {\n if (dataSource._isLoading !== isLoading) {\n if (isLoading) {\n dataSource._entityCollection.suspendEvents();\n } else {\n dataSource._entityCollection.resumeEvents();\n }\n dataSource._isLoading = isLoading;\n dataSource._loading.raiseEvent(dataSource, isLoading);\n }\n};\nexport default DataSource;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Determine whether or not other objects are visible or hidden behind the visible horizon defined by\n * an {@link Ellipsoid} and a camera position. The ellipsoid is assumed to be located at the\n * origin of the coordinate system. This class uses the algorithm described in the\n * {@link https://cesium.com/blog/2013/04/25/Horizon-culling/|Horizon Culling} blog post.\n *\n * @alias EllipsoidalOccluder\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to use as an occluder.\n * @param {Cartesian3} [cameraPosition] The coordinate of the viewer/camera. If this parameter is not\n * specified, {@link EllipsoidalOccluder#cameraPosition} must be called before\n * testing visibility.\n *\n * @constructor\n *\n * @example\n * // Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.\n * const cameraPosition = new Cesium.Cartesian3(5.0, 6.0, 7.0);\n * const occluderEllipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(occluderEllipsoid, cameraPosition);\n *\n * @private\n */\nfunction EllipsoidalOccluder(ellipsoid, cameraPosition) {\n this._ellipsoid = ellipsoid;\n this._cameraPosition = new Cartesian3();\n this._cameraPositionInScaledSpace = new Cartesian3();\n this._distanceToLimbInScaledSpaceSquared = 0.0;\n\n // cameraPosition fills in the above values\n if (defined(cameraPosition)) {\n this.cameraPosition = cameraPosition;\n }\n}\n\nObject.defineProperties(EllipsoidalOccluder.prototype, {\n /**\n * Gets the occluding ellipsoid.\n * @memberof EllipsoidalOccluder.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n /**\n * Gets or sets the position of the camera.\n * @memberof EllipsoidalOccluder.prototype\n * @type {Cartesian3}\n */\n cameraPosition: {\n get: function () {\n return this._cameraPosition;\n },\n set: function (cameraPosition) {\n // See https://cesium.com/blog/2013/04/25/Horizon-culling/\n const ellipsoid = this._ellipsoid;\n const cv = ellipsoid.transformPositionToScaledSpace(\n cameraPosition,\n this._cameraPositionInScaledSpace\n );\n const vhMagnitudeSquared = Cartesian3.magnitudeSquared(cv) - 1.0;\n\n Cartesian3.clone(cameraPosition, this._cameraPosition);\n this._cameraPositionInScaledSpace = cv;\n this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;\n },\n },\n});\n\nconst scratchCartesian = new Cartesian3();\n\n/**\n * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {Cartesian3} occludee The point to test for visibility.\n * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\n * const point = new Cesium.Cartesian3(0, -3, -3);\n * occluder.isPointVisible(point); //returns true\n */\nEllipsoidalOccluder.prototype.isPointVisible = function (occludee) {\n const ellipsoid = this._ellipsoid;\n const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\n occludee,\n scratchCartesian\n );\n return isScaledSpacePointVisible(\n occludeeScaledSpacePosition,\n this._cameraPositionInScaledSpace,\n this._distanceToLimbInScaledSpaceSquared\n );\n};\n\n/**\n * Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the\n * occluder. To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid\n * into the scaled space, call {@link Ellipsoid#transformPositionToScaledSpace}.\n *\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space.\n * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\n * const point = new Cesium.Cartesian3(0, -3, -3);\n * const scaledSpacePoint = ellipsoid.transformPositionToScaledSpace(point);\n * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true\n */\nEllipsoidalOccluder.prototype.isScaledSpacePointVisible = function (\n occludeeScaledSpacePosition\n) {\n return isScaledSpacePointVisible(\n occludeeScaledSpacePosition,\n this._cameraPositionInScaledSpace,\n this._distanceToLimbInScaledSpaceSquared\n );\n};\n\nconst scratchCameraPositionInScaledSpaceShrunk = new Cartesian3();\n\n/**\n * Similar to {@link EllipsoidalOccluder#isScaledSpacePointVisible} except tests against an\n * ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. This is intended to be used with points generated by\n * {@link EllipsoidalOccluder#computeHorizonCullingPointPossiblyUnderEllipsoid} or\n * {@link EllipsoidalOccluder#computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space of the possibly-shrunk ellipsoid.\n * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n */\nEllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function (\n occludeeScaledSpacePosition,\n minimumHeight\n) {\n const ellipsoid = this._ellipsoid;\n let vhMagnitudeSquared;\n let cv;\n\n if (\n defined(minimumHeight) &&\n minimumHeight < 0.0 &&\n ellipsoid.minimumRadius > -minimumHeight\n ) {\n // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot.\n cv = scratchCameraPositionInScaledSpaceShrunk;\n cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight);\n cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight);\n cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight);\n vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0;\n } else {\n cv = this._cameraPositionInScaledSpace;\n vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;\n }\n\n return isScaledSpacePointVisible(\n occludeeScaledSpacePosition,\n cv,\n vhMagnitudeSquared\n );\n};\n\n/**\n * Computes a point that can be used for horizon culling from a list of positions. If the point is below\n * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point\n * is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n * A reasonable direction to use is the direction from the center of the ellipsoid to\n * the center of the bounding sphere computed from the positions. The direction need not\n * be normalized.\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\n * ellipsoid's axes.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPoint = function (\n directionToPoint,\n positions,\n result\n) {\n return computeHorizonCullingPointFromPositions(\n this._ellipsoid,\n directionToPoint,\n positions,\n result\n );\n};\n\nconst scratchEllipsoidShrunk = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\n\n/**\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPoint} except computes the culling\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n * A reasonable direction to use is the direction from the center of the ellipsoid to\n * the center of the bounding sphere computed from the positions. The direction need not\n * be normalized.\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\n * ellipsoid's axes.\n * @param {Number} [minimumHeight] The minimum height of all positions. If this value is undefined, all positions are assumed to be above the ellipsoid.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function (\n directionToPoint,\n positions,\n minimumHeight,\n result\n) {\n const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\n this._ellipsoid,\n minimumHeight,\n scratchEllipsoidShrunk\n );\n return computeHorizonCullingPointFromPositions(\n possiblyShrunkEllipsoid,\n directionToPoint,\n positions,\n result\n );\n};\n/**\n * Computes a point that can be used for horizon culling from a list of positions. If the point is below\n * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point\n * is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n * A reasonable direction to use is the direction from the center of the ellipsoid to\n * the center of the bounding sphere computed from the positions. The direction need not\n * be normalized.\n * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\n * ellipsoid's axes.\n * @param {Number} [stride=3]\n * @param {Cartesian3} [center=Cartesian3.ZERO]\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function (\n directionToPoint,\n vertices,\n stride,\n center,\n result\n) {\n return computeHorizonCullingPointFromVertices(\n this._ellipsoid,\n directionToPoint,\n vertices,\n stride,\n center,\n result\n );\n};\n\n/**\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPointFromVertices} except computes the culling\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\n *\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\n * A reasonable direction to use is the direction from the center of the ellipsoid to\n * the center of the bounding sphere computed from the positions. The direction need not\n * be normalized.\n * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\n * ellipsoid's axes.\n * @param {Number} [stride=3]\n * @param {Cartesian3} [center=Cartesian3.ZERO]\n * @param {Number} [minimumHeight] The minimum height of all vertices. If this value is undefined, all vertices are assumed to be above the ellipsoid.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function (\n directionToPoint,\n vertices,\n stride,\n center,\n minimumHeight,\n result\n) {\n const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\n this._ellipsoid,\n minimumHeight,\n scratchEllipsoidShrunk\n );\n return computeHorizonCullingPointFromVertices(\n possiblyShrunkEllipsoid,\n directionToPoint,\n vertices,\n stride,\n center,\n result\n );\n};\n\nconst subsampleScratch = [];\n\n/**\n * Computes a point that can be used for horizon culling of a rectangle. If the point is below\n * the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well.\n * The returned point is expressed in the ellipsoid-scaled space and is suitable for use with\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\n *\n * @param {Rectangle} rectangle The rectangle for which to compute the horizon culling point.\n * @param {Ellipsoid} ellipsoid The ellipsoid on which the rectangle is defined. This may be different from\n * the ellipsoid used by this instance for occlusion testing.\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\n */\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function (\n rectangle,\n ellipsoid,\n result\n) {\n const positions = Rectangle.subsample(\n rectangle,\n ellipsoid,\n 0.0,\n subsampleScratch\n );\n const bs = BoundingSphere.fromPoints(positions);\n\n // If the bounding sphere center is too close to the center of the occluder, it doesn't make\n // sense to try to horizon cull it.\n if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {\n return undefined;\n }\n\n return this.computeHorizonCullingPoint(bs.center, positions, result);\n};\n\nconst scratchEllipsoidShrunkRadii = new Cartesian3();\n\nfunction getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) {\n if (\n defined(minimumHeight) &&\n minimumHeight < 0.0 &&\n ellipsoid.minimumRadius > -minimumHeight\n ) {\n const ellipsoidShrunkRadii = Cartesian3.fromElements(\n ellipsoid.radii.x + minimumHeight,\n ellipsoid.radii.y + minimumHeight,\n ellipsoid.radii.z + minimumHeight,\n scratchEllipsoidShrunkRadii\n );\n ellipsoid = Ellipsoid.fromCartesian3(ellipsoidShrunkRadii, result);\n }\n return ellipsoid;\n}\n\nfunction computeHorizonCullingPointFromPositions(\n ellipsoid,\n directionToPoint,\n positions,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\n ellipsoid,\n directionToPoint\n );\n let resultMagnitude = 0.0;\n\n for (let i = 0, len = positions.length; i < len; ++i) {\n const position = positions[i];\n const candidateMagnitude = computeMagnitude(\n ellipsoid,\n position,\n scaledSpaceDirectionToPoint\n );\n if (candidateMagnitude < 0.0) {\n // all points should face the same direction, but this one doesn't, so return undefined\n return undefined;\n }\n resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\n }\n\n return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\n}\n\nconst positionScratch = new Cartesian3();\n\nfunction computeHorizonCullingPointFromVertices(\n ellipsoid,\n directionToPoint,\n vertices,\n stride,\n center,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n stride = defaultValue(stride, 3);\n center = defaultValue(center, Cartesian3.ZERO);\n const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\n ellipsoid,\n directionToPoint\n );\n let resultMagnitude = 0.0;\n\n for (let i = 0, len = vertices.length; i < len; i += stride) {\n positionScratch.x = vertices[i] + center.x;\n positionScratch.y = vertices[i + 1] + center.y;\n positionScratch.z = vertices[i + 2] + center.z;\n\n const candidateMagnitude = computeMagnitude(\n ellipsoid,\n positionScratch,\n scaledSpaceDirectionToPoint\n );\n if (candidateMagnitude < 0.0) {\n // all points should face the same direction, but this one doesn't, so return undefined\n return undefined;\n }\n resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\n }\n\n return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\n}\n\nfunction isScaledSpacePointVisible(\n occludeeScaledSpacePosition,\n cameraPositionInScaledSpace,\n distanceToLimbInScaledSpaceSquared\n) {\n // See https://cesium.com/blog/2013/04/25/Horizon-culling/\n const cv = cameraPositionInScaledSpace;\n const vhMagnitudeSquared = distanceToLimbInScaledSpaceSquared;\n const vt = Cartesian3.subtract(\n occludeeScaledSpacePosition,\n cv,\n scratchCartesian\n );\n const vtDotVc = -Cartesian3.dot(vt, cv);\n // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and\n // in this case, set the culling plane to be on V.\n const isOccluded =\n vhMagnitudeSquared < 0\n ? vtDotVc > 0\n : vtDotVc > vhMagnitudeSquared &&\n (vtDotVc * vtDotVc) / Cartesian3.magnitudeSquared(vt) >\n vhMagnitudeSquared;\n return !isOccluded;\n}\n\nconst scaledSpaceScratch = new Cartesian3();\nconst directionScratch = new Cartesian3();\n\nfunction computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {\n const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\n position,\n scaledSpaceScratch\n );\n let magnitudeSquared = Cartesian3.magnitudeSquared(scaledSpacePosition);\n let magnitude = Math.sqrt(magnitudeSquared);\n const direction = Cartesian3.divideByScalar(\n scaledSpacePosition,\n magnitude,\n directionScratch\n );\n\n // For the purpose of this computation, points below the ellipsoid are consider to be on it instead.\n magnitudeSquared = Math.max(1.0, magnitudeSquared);\n magnitude = Math.max(1.0, magnitude);\n\n const cosAlpha = Cartesian3.dot(direction, scaledSpaceDirectionToPoint);\n const sinAlpha = Cartesian3.magnitude(\n Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction)\n );\n const cosBeta = 1.0 / magnitude;\n const sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta;\n\n return 1.0 / (cosAlpha * cosBeta - sinAlpha * sinBeta);\n}\n\nfunction magnitudeToPoint(\n scaledSpaceDirectionToPoint,\n resultMagnitude,\n result\n) {\n // The horizon culling point is undefined if there were no positions from which to compute it,\n // the directionToPoint is pointing opposite all of the positions, or if we computed NaN or infinity.\n if (\n resultMagnitude <= 0.0 ||\n resultMagnitude === 1.0 / 0.0 ||\n resultMagnitude !== resultMagnitude\n ) {\n return undefined;\n }\n\n return Cartesian3.multiplyByScalar(\n scaledSpaceDirectionToPoint,\n resultMagnitude,\n result\n );\n}\n\nconst directionToPointScratch = new Cartesian3();\n\nfunction computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {\n if (Cartesian3.equals(directionToPoint, Cartesian3.ZERO)) {\n return directionToPoint;\n }\n\n ellipsoid.transformPositionToScaledSpace(\n directionToPoint,\n directionToPointScratch\n );\n return Cartesian3.normalize(directionToPointScratch, directionToPointScratch);\n}\nexport default EllipsoidalOccluder;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\n\n/**\n * <div class=\"notice\">\n * A point is created and its initial properties are set by calling {@link PointPrimitiveCollection#add}. Do not call the constructor directly.\n * </div>\n * A graphical point positioned in the 3D scene, that is created\n * and rendered using a {@link PointPrimitiveCollection}.\n *\n * @alias PointPrimitive\n *\n * @performance Reading a property, e.g., {@link PointPrimitive#show}, is constant time.\n * Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link PointPrimitiveCollection#update} is called. The per-pointPrimitive traffic is\n * the same regardless of how many properties were updated. If most pointPrimitives in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link PointPrimitiveCollection#removeAll}\n * and add new pointPrimitives instead of modifying each one.\n *\n * @exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near\n * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near\n * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near\n *\n * @see PointPrimitiveCollection\n * @see PointPrimitiveCollection#add\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Points.html|Cesium Sandcastle Points Demo}\n */\nfunction PointPrimitive(options, pointPrimitiveCollection) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let translucencyByDistance = options.translucencyByDistance;\n let scaleByDistance = options.scaleByDistance;\n let distanceDisplayCondition = options.distanceDisplayCondition;\n if (defined(translucencyByDistance)) {\ntranslucencyByDistance = NearFarScalar.clone(translucencyByDistance);\n }\n if (defined(scaleByDistance)) {\nscaleByDistance = NearFarScalar.clone(scaleByDistance);\n }\n if (defined(distanceDisplayCondition)) {\ndistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition\n );\n }\n\n this._show = defaultValue(options.show, true);\n this._position = Cartesian3.clone(\n defaultValue(options.position, Cartesian3.ZERO)\n );\n this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D\n this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n this._outlineColor = Color.clone(\n defaultValue(options.outlineColor, Color.TRANSPARENT)\n );\n this._outlineWidth = defaultValue(options.outlineWidth, 0.0);\n this._pixelSize = defaultValue(options.pixelSize, 10.0);\n this._scaleByDistance = scaleByDistance;\n this._translucencyByDistance = translucencyByDistance;\n this._distanceDisplayCondition = distanceDisplayCondition;\n this._disableDepthTestDistance = defaultValue(\n options.disableDepthTestDistance,\n 0.0\n );\n this._id = options.id;\n this._collection = defaultValue(options.collection, pointPrimitiveCollection);\n\n this._clusterShow = true;\n\n this._pickId = undefined;\n this._pointPrimitiveCollection = pointPrimitiveCollection;\n this._dirty = false;\n this._index = -1; //Used only by PointPrimitiveCollection\n}\n\nconst SHOW_INDEX = (PointPrimitive.SHOW_INDEX = 0);\nconst POSITION_INDEX = (PointPrimitive.POSITION_INDEX = 1);\nconst COLOR_INDEX = (PointPrimitive.COLOR_INDEX = 2);\nconst OUTLINE_COLOR_INDEX = (PointPrimitive.OUTLINE_COLOR_INDEX = 3);\nconst OUTLINE_WIDTH_INDEX = (PointPrimitive.OUTLINE_WIDTH_INDEX = 4);\nconst PIXEL_SIZE_INDEX = (PointPrimitive.PIXEL_SIZE_INDEX = 5);\nconst SCALE_BY_DISTANCE_INDEX = (PointPrimitive.SCALE_BY_DISTANCE_INDEX = 6);\nconst TRANSLUCENCY_BY_DISTANCE_INDEX = (PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7);\nconst DISTANCE_DISPLAY_CONDITION_INDEX = (PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8);\nconst DISABLE_DEPTH_DISTANCE_INDEX = (PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9);\nPointPrimitive.NUMBER_OF_PROPERTIES = 10;\n\nfunction makeDirty(pointPrimitive, propertyChanged) {\n const pointPrimitiveCollection = pointPrimitive._pointPrimitiveCollection;\n if (defined(pointPrimitiveCollection)) {\n pointPrimitiveCollection._updatePointPrimitive(\n pointPrimitive,\n propertyChanged\n );\n pointPrimitive._dirty = true;\n }\n}\n\nObject.defineProperties(PointPrimitive.prototype, {\n /**\n * Determines if this point will be shown. Use this to hide or show a point, instead\n * of removing it and re-adding it to the collection.\n * @memberof PointPrimitive.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (this._show !== value) {\n this._show = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the Cartesian position of this point.\n * @memberof PointPrimitive.prototype\n * @type {Cartesian3}\n */\n position: {\n get: function () {\n return this._position;\n },\n set: function (value) {\n const position = this._position;\n if (!Cartesian3.equals(position, value)) {\n Cartesian3.clone(value, position);\n Cartesian3.clone(value, this._actualPosition);\n\n makeDirty(this, POSITION_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.\n * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale\n * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,\n * scaleByDistance will be disabled.\n * @memberof PointPrimitive.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a pointPrimitive's scaleByDistance to scale to 15 when the\n * // camera is 1500 meters from the pointPrimitive and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable scaling by distance\n * p.scaleByDistance = undefined;\n */\n scaleByDistance: {\n get: function () {\n return this._scaleByDistance;\n },\n set: function (value) {\n const scaleByDistance = this._scaleByDistance;\n if (!NearFarScalar.equals(scaleByDistance, value)) {\n this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);\n makeDirty(this, SCALE_BY_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.\n * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,\n * translucencyByDistance will be disabled.\n * @memberof PointPrimitive.prototype\n * @type {NearFarScalar}\n *\n * @example\n * // Example 1.\n * // Set a point's translucency to 1.0 when the\n * // camera is 1500 meters from the point and disappear as\n * // the camera distance approaches 8.0e6 meters.\n * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);\n *\n * @example\n * // Example 2.\n * // disable translucency by distance\n * p.translucencyByDistance = undefined;\n */\n translucencyByDistance: {\n get: function () {\n return this._translucencyByDistance;\n },\n set: function (value) {\n const translucencyByDistance = this._translucencyByDistance;\n if (!NearFarScalar.equals(translucencyByDistance, value)) {\n this._translucencyByDistance = NearFarScalar.clone(\n value,\n translucencyByDistance\n );\n makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the inner size of the point in pixels.\n * @memberof PointPrimitive.prototype\n * @type {Number}\n */\n pixelSize: {\n get: function () {\n return this._pixelSize;\n },\n set: function (value) {\n if (this._pixelSize !== value) {\n this._pixelSize = value;\n makeDirty(this, PIXEL_SIZE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the inner color of the point.\n * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,\n * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>\n * (no intensity) to <code>1.0</code> (full intensity).\n * @memberof PointPrimitive.prototype\n * @type {Color}\n *\n * @example\n * // Example 1. Assign yellow.\n * p.color = Cesium.Color.YELLOW;\n *\n * @example\n * // Example 2. Make a pointPrimitive 50% translucent.\n * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n const color = this._color;\n if (!Color.equals(color, value)) {\n Color.clone(value, color);\n makeDirty(this, COLOR_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the outline color of the point.\n * @memberof PointPrimitive.prototype\n * @type {Color}\n */\n outlineColor: {\n get: function () {\n return this._outlineColor;\n },\n set: function (value) {\n const outlineColor = this._outlineColor;\n if (!Color.equals(outlineColor, value)) {\n Color.clone(value, outlineColor);\n makeDirty(this, OUTLINE_COLOR_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the outline width in pixels. This width adds to pixelSize,\n * increasing the total size of the point.\n * @memberof PointPrimitive.prototype\n * @type {Number}\n */\n outlineWidth: {\n get: function () {\n return this._outlineWidth;\n },\n set: function (value) {\n if (this._outlineWidth !== value) {\n this._outlineWidth = value;\n makeDirty(this, OUTLINE_WIDTH_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.\n * @memberof PointPrimitive.prototype\n * @type {DistanceDisplayCondition}\n * @default undefined\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\nif (\n !DistanceDisplayCondition.equals(this._distanceDisplayCondition, value)\n ) {\n this._distanceDisplayCondition = DistanceDisplayCondition.clone(\n value,\n this._distanceDisplayCondition\n );\n makeDirty(this, DISTANCE_DISPLAY_CONDITION_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.\n * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.\n * @memberof PointPrimitive.prototype\n * @type {Number}\n * @default 0.0\n */\n disableDepthTestDistance: {\n get: function () {\n return this._disableDepthTestDistance;\n },\n set: function (value) {\n if (this._disableDepthTestDistance !== value) {\nthis._disableDepthTestDistance = value;\n makeDirty(this, DISABLE_DEPTH_DISTANCE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the user-defined value returned when the point is picked.\n * @memberof PointPrimitive.prototype\n * @type {*}\n */\n id: {\n get: function () {\n return this._id;\n },\n set: function (value) {\n this._id = value;\n if (defined(this._pickId)) {\n this._pickId.object.id = value;\n }\n },\n },\n\n /**\n * @private\n */\n pickId: {\n get: function () {\n return this._pickId;\n },\n },\n\n /**\n * Determines whether or not this point will be shown or hidden because it was clustered.\n * @memberof PointPrimitive.prototype\n * @type {Boolean}\n * @private\n */\n clusterShow: {\n get: function () {\n return this._clusterShow;\n },\n set: function (value) {\n if (this._clusterShow !== value) {\n this._clusterShow = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n});\n\nPointPrimitive.prototype.getPickId = function (context) {\n if (!defined(this._pickId)) {\n this._pickId = context.createPickId({\n primitive: this,\n collection: this._collection,\n id: this._id,\n });\n }\n\n return this._pickId;\n};\n\nPointPrimitive.prototype._getActualPosition = function () {\n return this._actualPosition;\n};\n\nPointPrimitive.prototype._setActualPosition = function (value) {\n Cartesian3.clone(value, this._actualPosition);\n makeDirty(this, POSITION_INDEX);\n};\n\nconst tempCartesian3 = new Cartesian4();\nPointPrimitive._computeActualPosition = function (\n position,\n frameState,\n modelMatrix\n) {\n if (frameState.mode === SceneMode.SCENE3D) {\n return position;\n }\n\n Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);\n return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);\n};\n\nconst scratchCartesian4 = new Cartesian4();\n\n// This function is basically a stripped-down JavaScript version of PointPrimitiveCollectionVS.glsl\nPointPrimitive._computeScreenSpacePosition = function (\n modelMatrix,\n position,\n scene,\n result\n) {\n // Model to world coordinates\n const positionWorld = Matrix4.multiplyByVector(\n modelMatrix,\n Cartesian4.fromElements(\n position.x,\n position.y,\n position.z,\n 1,\n scratchCartesian4\n ),\n scratchCartesian4\n );\n const positionWC = SceneTransforms.wgs84ToWindowCoordinates(\n scene,\n positionWorld,\n result\n );\n return positionWC;\n};\n\n/**\n * Computes the screen-space position of the point's origin.\n * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from\n * left to right, and <code>y</code> increases from top to bottom.\n *\n * @param {Scene} scene The scene.\n * @param {Cartesian2} [result] The object onto which to store the result.\n * @returns {Cartesian2} The screen-space position of the point.\n *\n * @exception {DeveloperError} PointPrimitive must be in a collection.\n *\n * @example\n * console.log(p.computeScreenSpacePosition(scene).toString());\n */\nPointPrimitive.prototype.computeScreenSpacePosition = function (scene, result) {\n const pointPrimitiveCollection = this._pointPrimitiveCollection;\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n const modelMatrix = pointPrimitiveCollection.modelMatrix;\n const windowCoordinates = PointPrimitive._computeScreenSpacePosition(\n modelMatrix,\n this._actualPosition,\n scene,\n result\n );\n if (!defined(windowCoordinates)) {\n return undefined;\n }\n\n windowCoordinates.y = scene.canvas.clientHeight - windowCoordinates.y;\n return windowCoordinates;\n};\n\n/**\n * Gets a point's screen space bounding box centered around screenSpacePosition.\n * @param {PointPrimitive} point The point to get the screen space bounding box for.\n * @param {Cartesian2} screenSpacePosition The screen space center of the label.\n * @param {BoundingRectangle} [result] The object onto which to store the result.\n * @returns {BoundingRectangle} The screen space bounding box.\n *\n * @private\n */\nPointPrimitive.getScreenSpaceBoundingBox = function (\n point,\n screenSpacePosition,\n result\n) {\n const size = point.pixelSize;\n const halfSize = size * 0.5;\n\n const x = screenSpacePosition.x - halfSize;\n const y = screenSpacePosition.y - halfSize;\n const width = size;\n const height = size;\n\n if (!defined(result)) {\n result = new BoundingRectangle();\n }\n\n result.x = x;\n result.y = y;\n result.width = width;\n result.height = height;\n\n return result;\n};\n\n/**\n * Determines if this point equals another point. Points are equal if all their properties\n * are equal. Points in different collections can be equal.\n *\n * @param {PointPrimitive} other The point to compare for equality.\n * @returns {Boolean} <code>true</code> if the points are equal; otherwise, <code>false</code>.\n */\nPointPrimitive.prototype.equals = function (other) {\n return (\n this === other ||\n (defined(other) &&\n this._id === other._id &&\n Cartesian3.equals(this._position, other._position) &&\n Color.equals(this._color, other._color) &&\n this._pixelSize === other._pixelSize &&\n this._outlineWidth === other._outlineWidth &&\n this._show === other._show &&\n Color.equals(this._outlineColor, other._outlineColor) &&\n NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&\n NearFarScalar.equals(\n this._translucencyByDistance,\n other._translucencyByDistance\n ) &&\n DistanceDisplayCondition.equals(\n this._distanceDisplayCondition,\n other._distanceDisplayCondition\n ) &&\n this._disableDepthTestDistance === other._disableDepthTestDistance)\n );\n};\n\nPointPrimitive.prototype._destroy = function () {\n this._pickId = this._pickId && this._pickId.destroy();\n this._pointPrimitiveCollection = undefined;\n};\nexport default PointPrimitive;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec4 v_color;\\n\\\nvarying vec4 v_outlineColor;\\n\\\nvarying float v_innerPercent;\\n\\\nvarying float v_pixelDistance;\\n\\\nvarying vec4 v_pickColor;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\\n\\\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\\n\\\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\\n\\\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\\n\\\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\\n\\\ncolor.a *= wholeAlpha;\\n\\\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\\n\\\nif (color.a < 0.005)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\n#ifdef OPAQUE\\n\\\nif (color.a < 0.995)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\nif (color.a >= 0.995)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\n#endif\\n\\\ngl_FragColor = czm_gammaCorrect(color);\\n\\\nczm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform float u_maxTotalPointSize;\\n\\\nattribute vec4 positionHighAndSize;\\n\\\nattribute vec4 positionLowAndOutline;\\n\\\nattribute vec4 compressedAttribute0;\\n\\\nattribute vec4 compressedAttribute1;\\n\\\nattribute vec4 scaleByDistance;\\n\\\nattribute vec3 distanceDisplayConditionAndDisableDepth;\\n\\\nvarying vec4 v_color;\\n\\\nvarying vec4 v_outlineColor;\\n\\\nvarying float v_innerPercent;\\n\\\nvarying float v_pixelDistance;\\n\\\nvarying vec4 v_pickColor;\\n\\\nconst float SHIFT_LEFT8 = 256.0;\\n\\\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 positionHigh = positionHighAndSize.xyz;\\n\\\nvec3 positionLow = positionLowAndOutline.xyz;\\n\\\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\\n\\\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\\n\\\nfloat outlinePercent = outlineWidthBothSides / totalSize;\\n\\\ntotalSize *= czm_pixelRatio;\\n\\\ntotalSize += 3.0;\\n\\\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\\n\\\nfloat show = floor(temp);\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\nvec4 translucencyByDistance;\\n\\\ntranslucencyByDistance.x = compressedAttribute1.z;\\n\\\ntranslucencyByDistance.z = compressedAttribute1.w;\\n\\\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\\n\\\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\\n\\\n#endif\\n\\\nvec4 color;\\n\\\nvec4 outlineColor;\\n\\\nvec4 pickColor;\\n\\\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\\n\\\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\npickColor.r = floor(temp);\\n\\\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\\n\\\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ncolor.r = floor(temp);\\n\\\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\\n\\\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\noutlineColor.r = floor(temp);\\n\\\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\\n\\\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\npickColor = pickColor / 255.0;\\n\\\ntemp = floor(temp) * SHIFT_RIGHT8;\\n\\\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\\n\\\noutlineColor /= 255.0;\\n\\\ncolor.a = floor(temp);\\n\\\ncolor /= 255.0;\\n\\\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\nvec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\\n\\\nfloat lengthSq;\\n\\\nif (czm_sceneMode == czm_sceneMode2D)\\n\\\n{\\n\\\nlengthSq = czm_eyeHeight2D.y;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef EYE_DISTANCE_SCALING\\n\\\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\\n\\\n#endif\\n\\\ntotalSize = min(totalSize, u_maxTotalPointSize);\\n\\\nif (totalSize < 1.0)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\ntotalSize = 1.0;\\n\\\n}\\n\\\nfloat translucency = 1.0;\\n\\\n#ifdef EYE_DISTANCE_TRANSLUCENCY\\n\\\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\\n\\\nif (translucency < 0.004)\\n\\\n{\\n\\\npositionEC.xyz = vec3(0.0);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef DISTANCE_DISPLAY_CONDITION\\n\\\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\\n\\\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\\n\\\nif (lengthSq < nearSq || lengthSq > farSq) {\\n\\\npositionEC.xyz = vec3(0.0, 0.0, 1.0);\\n\\\n}\\n\\\n#endif\\n\\\ngl_Position = czm_projection * positionEC;\\n\\\nczm_vertexLogDepth();\\n\\\n#ifdef DISABLE_DEPTH_DISTANCE\\n\\\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\\n\\\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\\n\\\n{\\n\\\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\\n\\\n}\\n\\\nif (disableDepthTestDistance != 0.0)\\n\\\n{\\n\\\nfloat zclip = gl_Position.z / gl_Position.w;\\n\\\nbool clipped = (zclip < -1.0 || zclip > 1.0);\\n\\\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\\n\\\n{\\n\\\ngl_Position.z = -gl_Position.w;\\n\\\n#ifdef LOG_DEPTH\\n\\\nczm_vertexLogDepth(vec4(czm_currentFrustum.x));\\n\\\n#endif\\n\\\n}\\n\\\n}\\n\\\n#endif\\n\\\nv_color = color;\\n\\\nv_color.a *= translucency * show;\\n\\\nv_outlineColor = outlineColor;\\n\\\nv_outlineColor.a *= translucency * show;\\n\\\nv_innerPercent = 1.0 - outlinePercent;\\n\\\nv_pixelDistance = 2.0 / totalSize;\\n\\\ngl_PointSize = totalSize * show;\\n\\\ngl_Position *= show;\\n\\\nv_pickColor = pickColor;\\n\\\n}\\n\\\n\";\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport PointPrimitiveCollectionFS from \"../Shaders/PointPrimitiveCollectionFS.js\";\nimport PointPrimitiveCollectionVS from \"../Shaders/PointPrimitiveCollectionVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport BlendOption from \"./BlendOption.js\";\nimport PointPrimitive from \"./PointPrimitive.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst SHOW_INDEX = PointPrimitive.SHOW_INDEX;\nconst POSITION_INDEX = PointPrimitive.POSITION_INDEX;\nconst COLOR_INDEX = PointPrimitive.COLOR_INDEX;\nconst OUTLINE_COLOR_INDEX = PointPrimitive.OUTLINE_COLOR_INDEX;\nconst OUTLINE_WIDTH_INDEX = PointPrimitive.OUTLINE_WIDTH_INDEX;\nconst PIXEL_SIZE_INDEX = PointPrimitive.PIXEL_SIZE_INDEX;\nconst SCALE_BY_DISTANCE_INDEX = PointPrimitive.SCALE_BY_DISTANCE_INDEX;\nconst TRANSLUCENCY_BY_DISTANCE_INDEX =\n PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX;\nconst DISTANCE_DISPLAY_CONDITION_INDEX =\n PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX;\nconst DISABLE_DEPTH_DISTANCE_INDEX =\n PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX;\nconst NUMBER_OF_PROPERTIES = PointPrimitive.NUMBER_OF_PROPERTIES;\n\nconst attributeLocations = {\n positionHighAndSize: 0,\n positionLowAndOutline: 1,\n compressedAttribute0: 2, // color, outlineColor, pick color\n compressedAttribute1: 3, // show, translucency by distance, some free space\n scaleByDistance: 4,\n distanceDisplayConditionAndDisableDepth: 5,\n};\n\n/**\n * A renderable collection of points.\n * <br /><br />\n * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}\n * and {@link PointPrimitiveCollection#remove}.\n *\n * @alias PointPrimitiveCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each point from model to world coordinates.\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The point blending option. The default\n * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.\n * @param {Boolean} [options.show=true] Determines if the primitives in the collection will be shown.\n *\n * @performance For best performance, prefer a few collections, each with many points, to\n * many collections with only a few points each. Organize collections so that points\n * with the same update frequency are in the same collection, i.e., points that do not\n * change should be in one collection; points that change every frame should be in another\n * collection; and so on.\n *\n *\n * @example\n * // Create a pointPrimitive collection with two points\n * const points = scene.primitives.add(new Cesium.PointPrimitiveCollection());\n * points.add({\n * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n * color : Cesium.Color.YELLOW\n * });\n * points.add({\n * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n * color : Cesium.Color.CYAN\n * });\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#remove\n * @see PointPrimitive\n */\nfunction PointPrimitiveCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._sp = undefined;\n this._spTranslucent = undefined;\n this._rsOpaque = undefined;\n this._rsTranslucent = undefined;\n this._vaf = undefined;\n\n this._pointPrimitives = [];\n this._pointPrimitivesToUpdate = [];\n this._pointPrimitivesToUpdateIndex = 0;\n this._pointPrimitivesRemoved = false;\n this._createVertexArray = false;\n\n this._shaderScaleByDistance = false;\n this._compiledShaderScaleByDistance = false;\n\n this._shaderTranslucencyByDistance = false;\n this._compiledShaderTranslucencyByDistance = false;\n\n this._shaderDistanceDisplayCondition = false;\n this._compiledShaderDistanceDisplayCondition = false;\n\n this._shaderDisableDepthDistance = false;\n this._compiledShaderDisableDepthDistance = false;\n\n this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n this._maxPixelSize = 1.0;\n\n this._baseVolume = new BoundingSphere();\n this._baseVolumeWC = new BoundingSphere();\n this._baseVolume2D = new BoundingSphere();\n this._boundingVolume = new BoundingSphere();\n this._boundingVolumeDirty = false;\n\n this._colorCommands = [];\n\n /**\n * Determines if primitives in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.\n * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type {Matrix4}\n * @default {@link Matrix4.IDENTITY}\n *\n *\n * @example\n * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\n * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);\n * pointPrimitives.add({\n * color : Cesium.Color.ORANGE,\n * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center\n * });\n * pointPrimitives.add({\n * color : Cesium.Color.YELLOW,\n * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east\n * });\n * pointPrimitives.add({\n * color : Cesium.Color.GREEN,\n * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north\n * });\n * pointPrimitives.add({\n * color : Cesium.Color.CYAN,\n * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up\n * });\n *\n * @see Transforms.eastNorthUpToFixedFrame\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * The point blending option. The default is used for rendering both opaque and translucent points.\n * However, if either all of the points are completely opaque or all are completely translucent,\n * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve\n * performance by up to 2x.\n * @type {BlendOption}\n * @default BlendOption.OPAQUE_AND_TRANSLUCENT\n */\n this.blendOption = defaultValue(\n options.blendOption,\n BlendOption.OPAQUE_AND_TRANSLUCENT\n );\n this._blendOption = undefined;\n\n this._mode = SceneMode.SCENE3D;\n this._maxTotalPointSize = 1;\n\n // The buffer usage for each attribute is determined based on the usage of the attribute over time.\n this._buffersUsage = [\n BufferUsage.STATIC_DRAW, // SHOW_INDEX\n BufferUsage.STATIC_DRAW, // POSITION_INDEX\n BufferUsage.STATIC_DRAW, // COLOR_INDEX\n BufferUsage.STATIC_DRAW, // OUTLINE_COLOR_INDEX\n BufferUsage.STATIC_DRAW, // OUTLINE_WIDTH_INDEX\n BufferUsage.STATIC_DRAW, // PIXEL_SIZE_INDEX\n BufferUsage.STATIC_DRAW, // SCALE_BY_DISTANCE_INDEX\n BufferUsage.STATIC_DRAW, // TRANSLUCENCY_BY_DISTANCE_INDEX\n BufferUsage.STATIC_DRAW, // DISTANCE_DISPLAY_CONDITION_INDEX\n ];\n\n const that = this;\n this._uniforms = {\n u_maxTotalPointSize: function () {\n return that._maxTotalPointSize;\n },\n };\n}\n\nObject.defineProperties(PointPrimitiveCollection.prototype, {\n /**\n * Returns the number of points in this collection. This is commonly used with\n * {@link PointPrimitiveCollection#get} to iterate over all the points\n * in the collection.\n * @memberof PointPrimitiveCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n removePointPrimitives(this);\n return this._pointPrimitives.length;\n },\n },\n});\n\nfunction destroyPointPrimitives(pointPrimitives) {\n const length = pointPrimitives.length;\n for (let i = 0; i < length; ++i) {\n if (pointPrimitives[i]) {\n pointPrimitives[i]._destroy();\n }\n }\n}\n\n/**\n * Creates and adds a point with the specified initial properties to the collection.\n * The added point is returned so it can be modified or removed from the collection later.\n *\n * @param {Object}[options] A template describing the point's properties as shown in Example 1.\n * @returns {PointPrimitive} The point that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, add as many pointPrimitives as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1: Add a point, specifying all the default values.\n * const p = pointPrimitives.add({\n * show : true,\n * position : Cesium.Cartesian3.ZERO,\n * pixelSize : 10.0,\n * color : Cesium.Color.WHITE,\n * outlineColor : Cesium.Color.TRANSPARENT,\n * outlineWidth : 0.0,\n * id : undefined\n * });\n *\n * @example\n * // Example 2: Specify only the point's cartographic position.\n * const p = pointPrimitives.add({\n * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see PointPrimitiveCollection#remove\n * @see PointPrimitiveCollection#removeAll\n */\nPointPrimitiveCollection.prototype.add = function (options) {\n const p = new PointPrimitive(options, this);\n p._index = this._pointPrimitives.length;\n\n this._pointPrimitives.push(p);\n this._createVertexArray = true;\n\n return p;\n};\n\n/**\n * Removes a point from the collection.\n *\n * @param {PointPrimitive} pointPrimitive The point to remove.\n * @returns {Boolean} <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.\n *\n * @performance Calling <code>remove</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, remove as many points as possible before calling <code>update</code>.\n * If you intend to temporarily hide a point, it is usually more efficient to call\n * {@link PointPrimitive#show} instead of removing and re-adding the point.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const p = pointPrimitives.add(...);\n * pointPrimitives.remove(p); // Returns true\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#removeAll\n * @see PointPrimitive#show\n */\nPointPrimitiveCollection.prototype.remove = function (pointPrimitive) {\n if (this.contains(pointPrimitive)) {\n this._pointPrimitives[pointPrimitive._index] = null; // Removed later\n this._pointPrimitivesRemoved = true;\n this._createVertexArray = true;\n pointPrimitive._destroy();\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all points from the collection.\n *\n * @performance <code>O(n)</code>. It is more efficient to remove all the points\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * pointPrimitives.add(...);\n * pointPrimitives.add(...);\n * pointPrimitives.removeAll();\n *\n * @see PointPrimitiveCollection#add\n * @see PointPrimitiveCollection#remove\n */\nPointPrimitiveCollection.prototype.removeAll = function () {\n destroyPointPrimitives(this._pointPrimitives);\n this._pointPrimitives = [];\n this._pointPrimitivesToUpdate = [];\n this._pointPrimitivesToUpdateIndex = 0;\n this._pointPrimitivesRemoved = false;\n\n this._createVertexArray = true;\n};\n\nfunction removePointPrimitives(pointPrimitiveCollection) {\n if (pointPrimitiveCollection._pointPrimitivesRemoved) {\n pointPrimitiveCollection._pointPrimitivesRemoved = false;\n\n const newPointPrimitives = [];\n const pointPrimitives = pointPrimitiveCollection._pointPrimitives;\n const length = pointPrimitives.length;\n for (let i = 0, j = 0; i < length; ++i) {\n const pointPrimitive = pointPrimitives[i];\n if (pointPrimitive) {\n pointPrimitive._index = j++;\n newPointPrimitives.push(pointPrimitive);\n }\n }\n\n pointPrimitiveCollection._pointPrimitives = newPointPrimitives;\n }\n}\n\nPointPrimitiveCollection.prototype._updatePointPrimitive = function (\n pointPrimitive,\n propertyChanged\n) {\n if (!pointPrimitive._dirty) {\n this._pointPrimitivesToUpdate[\n this._pointPrimitivesToUpdateIndex++\n ] = pointPrimitive;\n }\n\n ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given point.\n *\n * @param {PointPrimitive} [pointPrimitive] The point to check for.\n * @returns {Boolean} true if this collection contains the point, false otherwise.\n *\n * @see PointPrimitiveCollection#get\n */\nPointPrimitiveCollection.prototype.contains = function (pointPrimitive) {\n return (\n defined(pointPrimitive) && pointPrimitive._pointPrimitiveCollection === this\n );\n};\n\n/**\n * Returns the point in the collection at the specified index. Indices are zero-based\n * and increase as points are added. Removing a point shifts all points after\n * it to the left, changing their indices. This function is commonly used with\n * {@link PointPrimitiveCollection#length} to iterate over all the points\n * in the collection.\n *\n * @param {Number} index The zero-based index of the point.\n * @returns {PointPrimitive} The point at the specified index.\n *\n * @performance Expected constant time. If points were removed from the collection and\n * {@link PointPrimitiveCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every point in the collection\n * const len = pointPrimitives.length;\n * for (let i = 0; i < len; ++i) {\n * const p = pointPrimitives.get(i);\n * p.show = !p.show;\n * }\n *\n * @see PointPrimitiveCollection#length\n */\nPointPrimitiveCollection.prototype.get = function (index) {\n removePointPrimitives(this);\n return this._pointPrimitives[index];\n};\n\nPointPrimitiveCollection.prototype.computeNewBuffersUsage = function () {\n const buffersUsage = this._buffersUsage;\n let usageChanged = false;\n\n const properties = this._propertiesChanged;\n for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n const newUsage =\n properties[k] === 0 ? BufferUsage.STATIC_DRAW : BufferUsage.STREAM_DRAW;\n usageChanged = usageChanged || buffersUsage[k] !== newUsage;\n buffersUsage[k] = newUsage;\n }\n\n return usageChanged;\n};\n\nfunction createVAF(context, numberOfPointPrimitives, buffersUsage) {\n return new VertexArrayFacade(\n context,\n [\n {\n index: attributeLocations.positionHighAndSize,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[POSITION_INDEX],\n },\n {\n index: attributeLocations.positionLowAndShow,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[POSITION_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute0,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[COLOR_INDEX],\n },\n {\n index: attributeLocations.compressedAttribute1,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX],\n },\n {\n index: attributeLocations.scaleByDistance,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[SCALE_BY_DISTANCE_INDEX],\n },\n {\n index: attributeLocations.distanceDisplayConditionAndDisableDepth,\n componentsPerAttribute: 3,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX],\n },\n ],\n numberOfPointPrimitives\n ); // 1 vertex per pointPrimitive\n}\n\n///////////////////////////////////////////////////////////////////////////\n\n// PERFORMANCE_IDEA: Save memory if a property is the same for all pointPrimitives, use a latched attribute state,\n// instead of storing it in a vertex buffer.\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionSizeAndOutline(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n const i = pointPrimitive._index;\n const position = pointPrimitive._getActualPosition();\n\n if (pointPrimitiveCollection._mode === SceneMode.SCENE3D) {\n BoundingSphere.expand(\n pointPrimitiveCollection._baseVolume,\n position,\n pointPrimitiveCollection._baseVolume\n );\n pointPrimitiveCollection._boundingVolumeDirty = true;\n }\n\n EncodedCartesian3.fromCartesian(position, writePositionScratch);\n const pixelSize = pointPrimitive.pixelSize;\n const outlineWidth = pointPrimitive.outlineWidth;\n\n pointPrimitiveCollection._maxPixelSize = Math.max(\n pointPrimitiveCollection._maxPixelSize,\n pixelSize + outlineWidth\n );\n\n const positionHighWriter = vafWriters[attributeLocations.positionHighAndSize];\n const high = writePositionScratch.high;\n positionHighWriter(i, high.x, high.y, high.z, pixelSize);\n\n const positionLowWriter =\n vafWriters[attributeLocations.positionLowAndOutline];\n const low = writePositionScratch.low;\n positionLowWriter(i, low.x, low.y, low.z, outlineWidth);\n}\n\nconst LEFT_SHIFT16 = 65536.0; // 2^16\nconst LEFT_SHIFT8 = 256.0; // 2^8\n\nfunction writeCompressedAttrib0(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n const i = pointPrimitive._index;\n\n const color = pointPrimitive.color;\n const pickColor = pointPrimitive.getPickId(context).color;\n const outlineColor = pointPrimitive.outlineColor;\n\n let red = Color.floatToByte(color.red);\n let green = Color.floatToByte(color.green);\n let blue = Color.floatToByte(color.blue);\n const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n red = Color.floatToByte(outlineColor.red);\n green = Color.floatToByte(outlineColor.green);\n blue = Color.floatToByte(outlineColor.blue);\n const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n red = Color.floatToByte(pickColor.red);\n green = Color.floatToByte(pickColor.green);\n blue = Color.floatToByte(pickColor.blue);\n const compressed2 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;\n\n const compressed3 =\n Color.floatToByte(color.alpha) * LEFT_SHIFT16 +\n Color.floatToByte(outlineColor.alpha) * LEFT_SHIFT8 +\n Color.floatToByte(pickColor.alpha);\n\n const writer = vafWriters[attributeLocations.compressedAttribute0];\n writer(i, compressed0, compressed1, compressed2, compressed3);\n}\n\nfunction writeCompressedAttrib1(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n const i = pointPrimitive._index;\n\n let near = 0.0;\n let nearValue = 1.0;\n let far = 1.0;\n let farValue = 1.0;\n\n const translucency = pointPrimitive.translucencyByDistance;\n if (defined(translucency)) {\n near = translucency.near;\n nearValue = translucency.nearValue;\n far = translucency.far;\n farValue = translucency.farValue;\n\n if (nearValue !== 1.0 || farValue !== 1.0) {\n // translucency by distance calculation in shader need not be enabled\n // until a pointPrimitive with near and far !== 1.0 is found\n pointPrimitiveCollection._shaderTranslucencyByDistance = true;\n }\n }\n\n let show = pointPrimitive.show && pointPrimitive.clusterShow;\n\n // If the color alphas are zero, do not show this pointPrimitive. This lets us avoid providing\n // color during the pick pass and also eliminates a discard in the fragment shader.\n if (\n pointPrimitive.color.alpha === 0.0 &&\n pointPrimitive.outlineColor.alpha === 0.0\n ) {\n show = false;\n }\n\n nearValue = CesiumMath.clamp(nearValue, 0.0, 1.0);\n nearValue = nearValue === 1.0 ? 255.0 : (nearValue * 255.0) | 0;\n const compressed0 = (show ? 1.0 : 0.0) * LEFT_SHIFT8 + nearValue;\n\n farValue = CesiumMath.clamp(farValue, 0.0, 1.0);\n farValue = farValue === 1.0 ? 255.0 : (farValue * 255.0) | 0;\n const compressed1 = farValue;\n\n const writer = vafWriters[attributeLocations.compressedAttribute1];\n writer(i, compressed0, compressed1, near, far);\n}\n\nfunction writeScaleByDistance(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n const i = pointPrimitive._index;\n const writer = vafWriters[attributeLocations.scaleByDistance];\n let near = 0.0;\n let nearValue = 1.0;\n let far = 1.0;\n let farValue = 1.0;\n\n const scale = pointPrimitive.scaleByDistance;\n if (defined(scale)) {\n near = scale.near;\n nearValue = scale.nearValue;\n far = scale.far;\n farValue = scale.farValue;\n\n if (nearValue !== 1.0 || farValue !== 1.0) {\n // scale by distance calculation in shader need not be enabled\n // until a pointPrimitive with near and far !== 1.0 is found\n pointPrimitiveCollection._shaderScaleByDistance = true;\n }\n }\n\n writer(i, near, nearValue, far, farValue);\n}\n\nfunction writeDistanceDisplayConditionAndDepthDisable(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n const i = pointPrimitive._index;\n const writer =\n vafWriters[attributeLocations.distanceDisplayConditionAndDisableDepth];\n let near = 0.0;\n let far = Number.MAX_VALUE;\n\n const distanceDisplayCondition = pointPrimitive.distanceDisplayCondition;\n if (defined(distanceDisplayCondition)) {\n near = distanceDisplayCondition.near;\n far = distanceDisplayCondition.far;\n\n near *= near;\n far *= far;\n\n pointPrimitiveCollection._shaderDistanceDisplayCondition = true;\n }\n\n let disableDepthTestDistance = pointPrimitive.disableDepthTestDistance;\n disableDepthTestDistance *= disableDepthTestDistance;\n if (disableDepthTestDistance > 0.0) {\n pointPrimitiveCollection._shaderDisableDepthDistance = true;\n if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {\n disableDepthTestDistance = -1.0;\n }\n }\n\n writer(i, near, far, disableDepthTestDistance);\n}\n\nfunction writePointPrimitive(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n) {\n writePositionSizeAndOutline(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n );\n writeCompressedAttrib0(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n );\n writeCompressedAttrib1(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n );\n writeScaleByDistance(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n );\n writeDistanceDisplayConditionAndDepthDisable(\n pointPrimitiveCollection,\n context,\n vafWriters,\n pointPrimitive\n );\n}\n\nfunction recomputeActualPositions(\n pointPrimitiveCollection,\n pointPrimitives,\n length,\n frameState,\n modelMatrix,\n recomputeBoundingVolume\n) {\n let boundingVolume;\n if (frameState.mode === SceneMode.SCENE3D) {\n boundingVolume = pointPrimitiveCollection._baseVolume;\n pointPrimitiveCollection._boundingVolumeDirty = true;\n } else {\n boundingVolume = pointPrimitiveCollection._baseVolume2D;\n }\n\n const positions = [];\n for (let i = 0; i < length; ++i) {\n const pointPrimitive = pointPrimitives[i];\n const position = pointPrimitive.position;\n const actualPosition = PointPrimitive._computeActualPosition(\n position,\n frameState,\n modelMatrix\n );\n if (defined(actualPosition)) {\n pointPrimitive._setActualPosition(actualPosition);\n\n if (recomputeBoundingVolume) {\n positions.push(actualPosition);\n } else {\n BoundingSphere.expand(boundingVolume, actualPosition, boundingVolume);\n }\n }\n }\n\n if (recomputeBoundingVolume) {\n BoundingSphere.fromPoints(positions, boundingVolume);\n }\n}\n\nfunction updateMode(pointPrimitiveCollection, frameState) {\n const mode = frameState.mode;\n\n const pointPrimitives = pointPrimitiveCollection._pointPrimitives;\n const pointPrimitivesToUpdate =\n pointPrimitiveCollection._pointPrimitivesToUpdate;\n const modelMatrix = pointPrimitiveCollection._modelMatrix;\n\n if (\n pointPrimitiveCollection._createVertexArray ||\n pointPrimitiveCollection._mode !== mode ||\n (mode !== SceneMode.SCENE3D &&\n !Matrix4.equals(modelMatrix, pointPrimitiveCollection.modelMatrix))\n ) {\n pointPrimitiveCollection._mode = mode;\n Matrix4.clone(pointPrimitiveCollection.modelMatrix, modelMatrix);\n pointPrimitiveCollection._createVertexArray = true;\n\n if (\n mode === SceneMode.SCENE3D ||\n mode === SceneMode.SCENE2D ||\n mode === SceneMode.COLUMBUS_VIEW\n ) {\n recomputeActualPositions(\n pointPrimitiveCollection,\n pointPrimitives,\n pointPrimitives.length,\n frameState,\n modelMatrix,\n true\n );\n }\n } else if (mode === SceneMode.MORPHING) {\n recomputeActualPositions(\n pointPrimitiveCollection,\n pointPrimitives,\n pointPrimitives.length,\n frameState,\n modelMatrix,\n true\n );\n } else if (mode === SceneMode.SCENE2D || mode === SceneMode.COLUMBUS_VIEW) {\n recomputeActualPositions(\n pointPrimitiveCollection,\n pointPrimitivesToUpdate,\n pointPrimitiveCollection._pointPrimitivesToUpdateIndex,\n frameState,\n modelMatrix,\n false\n );\n }\n}\n\nfunction updateBoundingVolume(collection, frameState, boundingVolume) {\n const pixelSize = frameState.camera.getPixelSize(\n boundingVolume,\n frameState.context.drawingBufferWidth,\n frameState.context.drawingBufferHeight\n );\n const size = pixelSize * collection._maxPixelSize;\n boundingVolume.radius += size;\n}\n\nconst scratchWriterArray = [];\n\n/**\n * @private\n */\nPointPrimitiveCollection.prototype.update = function (frameState) {\n removePointPrimitives(this);\n\n if (!this.show) {\n return;\n }\n\n this._maxTotalPointSize = ContextLimits.maximumAliasedPointSize;\n\n updateMode(this, frameState);\n\n const pointPrimitives = this._pointPrimitives;\n const pointPrimitivesLength = pointPrimitives.length;\n const pointPrimitivesToUpdate = this._pointPrimitivesToUpdate;\n const pointPrimitivesToUpdateLength = this._pointPrimitivesToUpdateIndex;\n\n const properties = this._propertiesChanged;\n\n const createVertexArray = this._createVertexArray;\n\n let vafWriters;\n const context = frameState.context;\n const pass = frameState.passes;\n const picking = pass.pick;\n\n // PERFORMANCE_IDEA: Round robin multiple buffers.\n if (createVertexArray || (!picking && this.computeNewBuffersUsage())) {\n this._createVertexArray = false;\n\n for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {\n properties[k] = 0;\n }\n\n this._vaf = this._vaf && this._vaf.destroy();\n\n if (pointPrimitivesLength > 0) {\n // PERFORMANCE_IDEA: Instead of creating a new one, resize like std::vector.\n this._vaf = createVAF(context, pointPrimitivesLength, this._buffersUsage);\n vafWriters = this._vaf.writers;\n\n // Rewrite entire buffer if pointPrimitives were added or removed.\n for (let i = 0; i < pointPrimitivesLength; ++i) {\n const pointPrimitive = this._pointPrimitives[i];\n pointPrimitive._dirty = false; // In case it needed an update.\n writePointPrimitive(this, context, vafWriters, pointPrimitive);\n }\n\n this._vaf.commit();\n }\n\n this._pointPrimitivesToUpdateIndex = 0;\n } else if (pointPrimitivesToUpdateLength > 0) {\n // PointPrimitives were modified, but none were added or removed.\n const writers = scratchWriterArray;\n writers.length = 0;\n\n if (\n properties[POSITION_INDEX] ||\n properties[OUTLINE_WIDTH_INDEX] ||\n properties[PIXEL_SIZE_INDEX]\n ) {\n writers.push(writePositionSizeAndOutline);\n }\n\n if (properties[COLOR_INDEX] || properties[OUTLINE_COLOR_INDEX]) {\n writers.push(writeCompressedAttrib0);\n }\n\n if (properties[SHOW_INDEX] || properties[TRANSLUCENCY_BY_DISTANCE_INDEX]) {\n writers.push(writeCompressedAttrib1);\n }\n\n if (properties[SCALE_BY_DISTANCE_INDEX]) {\n writers.push(writeScaleByDistance);\n }\n\n if (\n properties[DISTANCE_DISPLAY_CONDITION_INDEX] ||\n properties[DISABLE_DEPTH_DISTANCE_INDEX]\n ) {\n writers.push(writeDistanceDisplayConditionAndDepthDisable);\n }\n\n const numWriters = writers.length;\n\n vafWriters = this._vaf.writers;\n\n if (pointPrimitivesToUpdateLength / pointPrimitivesLength > 0.1) {\n // If more than 10% of pointPrimitive change, rewrite the entire buffer.\n\n // PERFORMANCE_IDEA: I totally made up 10% :).\n\n for (let m = 0; m < pointPrimitivesToUpdateLength; ++m) {\n const b = pointPrimitivesToUpdate[m];\n b._dirty = false;\n\n for (let n = 0; n < numWriters; ++n) {\n writers[n](this, context, vafWriters, b);\n }\n }\n this._vaf.commit();\n } else {\n for (let h = 0; h < pointPrimitivesToUpdateLength; ++h) {\n const bb = pointPrimitivesToUpdate[h];\n bb._dirty = false;\n\n for (let o = 0; o < numWriters; ++o) {\n writers[o](this, context, vafWriters, bb);\n }\n this._vaf.subCommit(bb._index, 1);\n }\n this._vaf.endSubCommits();\n }\n\n this._pointPrimitivesToUpdateIndex = 0;\n }\n\n // If the number of total pointPrimitives ever shrinks considerably\n // Truncate pointPrimitivesToUpdate so that we free memory that we're\n // not going to be using.\n if (pointPrimitivesToUpdateLength > pointPrimitivesLength * 1.5) {\n pointPrimitivesToUpdate.length = pointPrimitivesLength;\n }\n\n if (!defined(this._vaf) || !defined(this._vaf.va)) {\n return;\n }\n\n if (this._boundingVolumeDirty) {\n this._boundingVolumeDirty = false;\n BoundingSphere.transform(\n this._baseVolume,\n this.modelMatrix,\n this._baseVolumeWC\n );\n }\n\n let boundingVolume;\n let modelMatrix = Matrix4.IDENTITY;\n if (frameState.mode === SceneMode.SCENE3D) {\n modelMatrix = this.modelMatrix;\n boundingVolume = BoundingSphere.clone(\n this._baseVolumeWC,\n this._boundingVolume\n );\n } else {\n boundingVolume = BoundingSphere.clone(\n this._baseVolume2D,\n this._boundingVolume\n );\n }\n updateBoundingVolume(this, frameState, boundingVolume);\n\n const blendOptionChanged = this._blendOption !== this.blendOption;\n this._blendOption = this.blendOption;\n\n if (blendOptionChanged) {\n if (\n this._blendOption === BlendOption.OPAQUE ||\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n ) {\n this._rsOpaque = RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: WebGLConstants.LEQUAL,\n },\n depthMask: true,\n });\n } else {\n this._rsOpaque = undefined;\n }\n\n if (\n this._blendOption === BlendOption.TRANSLUCENT ||\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT\n ) {\n this._rsTranslucent = RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: WebGLConstants.LEQUAL,\n },\n depthMask: false,\n blending: BlendingState.ALPHA_BLEND,\n });\n } else {\n this._rsTranslucent = undefined;\n }\n }\n\n this._shaderDisableDepthDistance =\n this._shaderDisableDepthDistance ||\n frameState.minimumDisableDepthTestDistance !== 0.0;\n let vs;\n let fs;\n\n if (\n blendOptionChanged ||\n (this._shaderScaleByDistance && !this._compiledShaderScaleByDistance) ||\n (this._shaderTranslucencyByDistance &&\n !this._compiledShaderTranslucencyByDistance) ||\n (this._shaderDistanceDisplayCondition &&\n !this._compiledShaderDistanceDisplayCondition) ||\n this._shaderDisableDepthDistance !==\n this._compiledShaderDisableDepthDistance\n ) {\n vs = new ShaderSource({\n sources: [PointPrimitiveCollectionVS],\n });\n if (this._shaderScaleByDistance) {\n vs.defines.push(\"EYE_DISTANCE_SCALING\");\n }\n if (this._shaderTranslucencyByDistance) {\n vs.defines.push(\"EYE_DISTANCE_TRANSLUCENCY\");\n }\n if (this._shaderDistanceDisplayCondition) {\n vs.defines.push(\"DISTANCE_DISPLAY_CONDITION\");\n }\n if (this._shaderDisableDepthDistance) {\n vs.defines.push(\"DISABLE_DEPTH_DISTANCE\");\n }\n\n if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) {\n fs = new ShaderSource({\n defines: [\"OPAQUE\"],\n sources: [PointPrimitiveCollectionFS],\n });\n this._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n fs = new ShaderSource({\n defines: [\"TRANSLUCENT\"],\n sources: [PointPrimitiveCollectionFS],\n });\n this._spTranslucent = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._spTranslucent,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n if (this._blendOption === BlendOption.OPAQUE) {\n fs = new ShaderSource({\n sources: [PointPrimitiveCollectionFS],\n });\n this._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n if (this._blendOption === BlendOption.TRANSLUCENT) {\n fs = new ShaderSource({\n sources: [PointPrimitiveCollectionFS],\n });\n this._spTranslucent = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._spTranslucent,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n }\n\n this._compiledShaderScaleByDistance = this._shaderScaleByDistance;\n this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;\n this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;\n this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;\n }\n\n let va;\n let vaLength;\n let command;\n let j;\n\n const commandList = frameState.commandList;\n\n if (pass.render || picking) {\n const colorList = this._colorCommands;\n\n const opaque = this._blendOption === BlendOption.OPAQUE;\n const opaqueAndTranslucent =\n this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT;\n\n va = this._vaf.va;\n vaLength = va.length;\n\n colorList.length = vaLength;\n const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;\n for (j = 0; j < totalLength; ++j) {\n const opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0);\n\n command = colorList[j];\n if (!defined(command)) {\n command = colorList[j] = new DrawCommand();\n }\n\n command.primitiveType = PrimitiveType.POINTS;\n command.pass =\n opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT;\n command.owner = this;\n\n const index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j;\n command.boundingVolume = boundingVolume;\n command.modelMatrix = modelMatrix;\n command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;\n command.uniformMap = this._uniforms;\n command.vertexArray = va[index].va;\n command.renderState = opaqueCommand\n ? this._rsOpaque\n : this._rsTranslucent;\n command.debugShowBoundingVolume = this.debugShowBoundingVolume;\n command.pickId = \"v_pickColor\";\n\n commandList.push(command);\n }\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PointPrimitiveCollection#destroy\n */\nPointPrimitiveCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * pointPrimitives = pointPrimitives && pointPrimitives.destroy();\n *\n * @see PointPrimitiveCollection#isDestroyed\n */\nPointPrimitiveCollection.prototype.destroy = function () {\n this._sp = this._sp && this._sp.destroy();\n this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();\n this._spPick = this._spPick && this._spPick.destroy();\n this._vaf = this._vaf && this._vaf.destroy();\n destroyPointPrimitives(this._pointPrimitives);\n\n return destroyObject(this);\n};\nexport default PointPrimitiveCollection;\n", "\nexport default function sortKD(ids, coords, nodeSize, left, right, depth) {\n if (right - left <= nodeSize) return;\n\n const m = (left + right) >> 1;\n\n select(ids, coords, m, left, right, depth % 2);\n\n sortKD(ids, coords, nodeSize, left, m - 1, depth + 1);\n sortKD(ids, coords, nodeSize, m + 1, right, depth + 1);\n}\n\nfunction select(ids, coords, k, left, right, inc) {\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n select(ids, coords, k, newLeft, newRight, inc);\n }\n\n const t = coords[2 * k + inc];\n let i = left;\n let j = right;\n\n swapItem(ids, coords, left, k);\n if (coords[2 * right + inc] > t) swapItem(ids, coords, left, right);\n\n while (i < j) {\n swapItem(ids, coords, i, j);\n i++;\n j--;\n while (coords[2 * i + inc] < t) i++;\n while (coords[2 * j + inc] > t) j--;\n }\n\n if (coords[2 * left + inc] === t) swapItem(ids, coords, left, j);\n else {\n j++;\n swapItem(ids, coords, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swapItem(ids, coords, i, j) {\n swap(ids, i, j);\n swap(coords, 2 * i, 2 * j);\n swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n", "\nexport default function range(ids, coords, minX, minY, maxX, maxY, nodeSize) {\n const stack = [0, ids.length - 1, 0];\n const result = [];\n let x, y;\n\n while (stack.length) {\n const axis = stack.pop();\n const right = stack.pop();\n const left = stack.pop();\n\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n x = coords[2 * i];\n y = coords[2 * i + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n }\n continue;\n }\n\n const m = Math.floor((left + right) / 2);\n\n x = coords[2 * m];\n y = coords[2 * m + 1];\n\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n const nextAxis = (axis + 1) % 2;\n\n if (axis === 0 ? minX <= x : minY <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(nextAxis);\n }\n if (axis === 0 ? maxX >= x : maxY >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(nextAxis);\n }\n }\n\n return result;\n}\n", "\nexport default function within(ids, coords, qx, qy, r, nodeSize) {\n const stack = [0, ids.length - 1, 0];\n const result = [];\n const r2 = r * r;\n\n while (stack.length) {\n const axis = stack.pop();\n const right = stack.pop();\n const left = stack.pop();\n\n if (right - left <= nodeSize) {\n for (let i = left; i <= right; i++) {\n if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n }\n continue;\n }\n\n const m = Math.floor((left + right) / 2);\n\n const x = coords[2 * m];\n const y = coords[2 * m + 1];\n\n if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n const nextAxis = (axis + 1) % 2;\n\n if (axis === 0 ? qx - r <= x : qy - r <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(nextAxis);\n }\n if (axis === 0 ? qx + r >= x : qy + r >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(nextAxis);\n }\n }\n\n return result;\n}\n\nfunction sqDist(ax, ay, bx, by) {\n const dx = ax - bx;\n const dy = ay - by;\n return dx * dx + dy * dy;\n}\n", "\nimport sort from './sort';\nimport range from './range';\nimport within from './within';\n\nconst defaultGetX = p => p[0];\nconst defaultGetY = p => p[1];\n\nexport default class KDBush {\n constructor(points, getX = defaultGetX, getY = defaultGetY, nodeSize = 64, ArrayType = Float64Array) {\n this.nodeSize = nodeSize;\n this.points = points;\n\n const IndexArrayType = points.length < 65536 ? Uint16Array : Uint32Array;\n\n const ids = this.ids = new IndexArrayType(points.length);\n const coords = this.coords = new ArrayType(points.length * 2);\n\n for (let i = 0; i < points.length; i++) {\n ids[i] = i;\n coords[2 * i] = getX(points[i]);\n coords[2 * i + 1] = getY(points[i]);\n }\n\n sort(ids, coords, nodeSize, 0, ids.length - 1, 0);\n }\n\n range(minX, minY, maxX, maxY) {\n return range(this.ids, this.coords, minX, minY, maxX, maxY, this.nodeSize);\n }\n\n within(x, y, r) {\n return within(this.ids, this.coords, x, y, r, this.nodeSize);\n }\n}\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\nimport Event from \"../Core/Event.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Billboard from \"../Scene/Billboard.js\";\nimport BillboardCollection from \"../Scene/BillboardCollection.js\";\nimport Label from \"../Scene/Label.js\";\nimport LabelCollection from \"../Scene/LabelCollection.js\";\nimport PointPrimitive from \"../Scene/PointPrimitive.js\";\nimport PointPrimitiveCollection from \"../Scene/PointPrimitiveCollection.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport KDBush from \"kdbush\";\n\n/**\n * Defines how screen space objects (billboards, points, labels) are clustered.\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Boolean} [options.enabled=false] Whether or not to enable clustering.\n * @param {Number} [options.pixelRange=80] The pixel range to extend the screen space bounding box.\n * @param {Number} [options.minimumClusterSize=2] The minimum number of screen space objects that can be clustered.\n * @param {Boolean} [options.clusterBillboards=true] Whether or not to cluster the billboards of an entity.\n * @param {Boolean} [options.clusterLabels=true] Whether or not to cluster the labels of an entity.\n * @param {Boolean} [options.clusterPoints=true] Whether or not to cluster the points of an entity.\n * @param {Boolean} [options.show=true] Determines if the entities in the cluster will be shown.\n *\n * @alias EntityCluster\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Clustering.html|Cesium Sandcastle Clustering Demo}\n */\nfunction EntityCluster(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._enabled = defaultValue(options.enabled, false);\n this._pixelRange = defaultValue(options.pixelRange, 80);\n this._minimumClusterSize = defaultValue(options.minimumClusterSize, 2);\n this._clusterBillboards = defaultValue(options.clusterBillboards, true);\n this._clusterLabels = defaultValue(options.clusterLabels, true);\n this._clusterPoints = defaultValue(options.clusterPoints, true);\n\n this._labelCollection = undefined;\n this._billboardCollection = undefined;\n this._pointCollection = undefined;\n\n this._clusterBillboardCollection = undefined;\n this._clusterLabelCollection = undefined;\n this._clusterPointCollection = undefined;\n\n this._collectionIndicesByEntity = {};\n\n this._unusedLabelIndices = [];\n this._unusedBillboardIndices = [];\n this._unusedPointIndices = [];\n\n this._previousClusters = [];\n this._previousHeight = undefined;\n\n this._enabledDirty = false;\n this._clusterDirty = false;\n\n this._cluster = undefined;\n this._removeEventListener = undefined;\n\n this._clusterEvent = new Event();\n\n /**\n * Determines if entities in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n}\n\nfunction getX(point) {\n return point.coord.x;\n}\n\nfunction getY(point) {\n return point.coord.y;\n}\n\nfunction expandBoundingBox(bbox, pixelRange) {\n bbox.x -= pixelRange;\n bbox.y -= pixelRange;\n bbox.width += pixelRange * 2.0;\n bbox.height += pixelRange * 2.0;\n}\n\nconst labelBoundingBoxScratch = new BoundingRectangle();\n\nfunction getBoundingBox(item, coord, pixelRange, entityCluster, result) {\n if (defined(item._labelCollection) && entityCluster._clusterLabels) {\n result = Label.getScreenSpaceBoundingBox(item, coord, result);\n } else if (\n defined(item._billboardCollection) &&\n entityCluster._clusterBillboards\n ) {\n result = Billboard.getScreenSpaceBoundingBox(item, coord, result);\n } else if (\n defined(item._pointPrimitiveCollection) &&\n entityCluster._clusterPoints\n ) {\n result = PointPrimitive.getScreenSpaceBoundingBox(item, coord, result);\n }\n\n expandBoundingBox(result, pixelRange);\n\n if (\n entityCluster._clusterLabels &&\n !defined(item._labelCollection) &&\n defined(item.id) &&\n hasLabelIndex(entityCluster, item.id.id) &&\n defined(item.id._label)\n ) {\n const labelIndex =\n entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;\n const label = entityCluster._labelCollection.get(labelIndex);\n const labelBBox = Label.getScreenSpaceBoundingBox(\n label,\n coord,\n labelBoundingBoxScratch\n );\n expandBoundingBox(labelBBox, pixelRange);\n result = BoundingRectangle.union(result, labelBBox, result);\n }\n\n return result;\n}\n\nfunction addNonClusteredItem(item, entityCluster) {\n item.clusterShow = true;\n\n if (\n !defined(item._labelCollection) &&\n defined(item.id) &&\n hasLabelIndex(entityCluster, item.id.id) &&\n defined(item.id._label)\n ) {\n const labelIndex =\n entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;\n const label = entityCluster._labelCollection.get(labelIndex);\n label.clusterShow = true;\n }\n}\n\nfunction addCluster(position, numPoints, ids, entityCluster) {\n const cluster = {\n billboard: entityCluster._clusterBillboardCollection.add(),\n label: entityCluster._clusterLabelCollection.add(),\n point: entityCluster._clusterPointCollection.add(),\n };\n\n cluster.billboard.show = false;\n cluster.point.show = false;\n cluster.label.show = true;\n cluster.label.text = numPoints.toLocaleString();\n cluster.label.id = ids;\n cluster.billboard.position = cluster.label.position = cluster.point.position = position;\n\n entityCluster._clusterEvent.raiseEvent(ids, cluster);\n}\n\nfunction hasLabelIndex(entityCluster, entityId) {\n return (\n defined(entityCluster) &&\n defined(entityCluster._collectionIndicesByEntity[entityId]) &&\n defined(entityCluster._collectionIndicesByEntity[entityId].labelIndex)\n );\n}\n\nfunction getScreenSpacePositions(\n collection,\n points,\n scene,\n occluder,\n entityCluster\n) {\n if (!defined(collection)) {\n return;\n }\n\n const length = collection.length;\n for (let i = 0; i < length; ++i) {\n const item = collection.get(i);\n item.clusterShow = false;\n\n if (\n !item.show ||\n (entityCluster._scene.mode === SceneMode.SCENE3D &&\n !occluder.isPointVisible(item.position))\n ) {\n continue;\n }\n\n const canClusterLabels =\n entityCluster._clusterLabels && defined(item._labelCollection);\n const canClusterBillboards =\n entityCluster._clusterBillboards && defined(item.id._billboard);\n const canClusterPoints =\n entityCluster._clusterPoints && defined(item.id._point);\n if (canClusterLabels && (canClusterPoints || canClusterBillboards)) {\n continue;\n }\n\n const coord = item.computeScreenSpacePosition(scene);\n if (!defined(coord)) {\n continue;\n }\n\n points.push({\n index: i,\n collection: collection,\n clustered: false,\n coord: coord,\n });\n }\n}\n\nconst pointBoundinRectangleScratch = new BoundingRectangle();\nconst totalBoundingRectangleScratch = new BoundingRectangle();\nconst neighborBoundingRectangleScratch = new BoundingRectangle();\n\nfunction createDeclutterCallback(entityCluster) {\n return function (amount) {\n if ((defined(amount) && amount < 0.05) || !entityCluster.enabled) {\n return;\n }\n\n const scene = entityCluster._scene;\n\n const labelCollection = entityCluster._labelCollection;\n const billboardCollection = entityCluster._billboardCollection;\n const pointCollection = entityCluster._pointCollection;\n\n if (\n (!defined(labelCollection) &&\n !defined(billboardCollection) &&\n !defined(pointCollection)) ||\n (!entityCluster._clusterBillboards &&\n !entityCluster._clusterLabels &&\n !entityCluster._clusterPoints)\n ) {\n return;\n }\n\n let clusteredLabelCollection = entityCluster._clusterLabelCollection;\n let clusteredBillboardCollection =\n entityCluster._clusterBillboardCollection;\n let clusteredPointCollection = entityCluster._clusterPointCollection;\n\n if (defined(clusteredLabelCollection)) {\n clusteredLabelCollection.removeAll();\n } else {\n clusteredLabelCollection = entityCluster._clusterLabelCollection = new LabelCollection(\n {\n scene: scene,\n }\n );\n }\n\n if (defined(clusteredBillboardCollection)) {\n clusteredBillboardCollection.removeAll();\n } else {\n clusteredBillboardCollection = entityCluster._clusterBillboardCollection = new BillboardCollection(\n {\n scene: scene,\n }\n );\n }\n\n if (defined(clusteredPointCollection)) {\n clusteredPointCollection.removeAll();\n } else {\n clusteredPointCollection = entityCluster._clusterPointCollection = new PointPrimitiveCollection();\n }\n\n const pixelRange = entityCluster._pixelRange;\n const minimumClusterSize = entityCluster._minimumClusterSize;\n\n const clusters = entityCluster._previousClusters;\n const newClusters = [];\n\n const previousHeight = entityCluster._previousHeight;\n const currentHeight = scene.camera.positionCartographic.height;\n\n const ellipsoid = scene.mapProjection.ellipsoid;\n const cameraPosition = scene.camera.positionWC;\n const occluder = new EllipsoidalOccluder(ellipsoid, cameraPosition);\n\n const points = [];\n if (entityCluster._clusterLabels) {\n getScreenSpacePositions(\n labelCollection,\n points,\n scene,\n occluder,\n entityCluster\n );\n }\n if (entityCluster._clusterBillboards) {\n getScreenSpacePositions(\n billboardCollection,\n points,\n scene,\n occluder,\n entityCluster\n );\n }\n if (entityCluster._clusterPoints) {\n getScreenSpacePositions(\n pointCollection,\n points,\n scene,\n occluder,\n entityCluster\n );\n }\n\n let i;\n let j;\n let length;\n let bbox;\n let neighbors;\n let neighborLength;\n let neighborIndex;\n let neighborPoint;\n let ids;\n let numPoints;\n\n let collection;\n let collectionIndex;\n\n const index = new KDBush(points, getX, getY, 64, Int32Array);\n\n if (currentHeight < previousHeight) {\n length = clusters.length;\n for (i = 0; i < length; ++i) {\n const cluster = clusters[i];\n\n if (!occluder.isPointVisible(cluster.position)) {\n continue;\n }\n\n const coord = Billboard._computeScreenSpacePosition(\n Matrix4.IDENTITY,\n cluster.position,\n Cartesian3.ZERO,\n Cartesian2.ZERO,\n scene\n );\n if (!defined(coord)) {\n continue;\n }\n\n const factor = 1.0 - currentHeight / previousHeight;\n let width = (cluster.width = cluster.width * factor);\n let height = (cluster.height = cluster.height * factor);\n\n width = Math.max(width, cluster.minimumWidth);\n height = Math.max(height, cluster.minimumHeight);\n\n const minX = coord.x - width * 0.5;\n const minY = coord.y - height * 0.5;\n const maxX = coord.x + width;\n const maxY = coord.y + height;\n\n neighbors = index.range(minX, minY, maxX, maxY);\n neighborLength = neighbors.length;\n numPoints = 0;\n ids = [];\n\n for (j = 0; j < neighborLength; ++j) {\n neighborIndex = neighbors[j];\n neighborPoint = points[neighborIndex];\n if (!neighborPoint.clustered) {\n ++numPoints;\n\n collection = neighborPoint.collection;\n collectionIndex = neighborPoint.index;\n ids.push(collection.get(collectionIndex).id);\n }\n }\n\n if (numPoints >= minimumClusterSize) {\n addCluster(cluster.position, numPoints, ids, entityCluster);\n newClusters.push(cluster);\n\n for (j = 0; j < neighborLength; ++j) {\n points[neighbors[j]].clustered = true;\n }\n }\n }\n }\n\n length = points.length;\n for (i = 0; i < length; ++i) {\n const point = points[i];\n if (point.clustered) {\n continue;\n }\n\n point.clustered = true;\n\n collection = point.collection;\n collectionIndex = point.index;\n\n const item = collection.get(collectionIndex);\n bbox = getBoundingBox(\n item,\n point.coord,\n pixelRange,\n entityCluster,\n pointBoundinRectangleScratch\n );\n const totalBBox = BoundingRectangle.clone(\n bbox,\n totalBoundingRectangleScratch\n );\n\n neighbors = index.range(\n bbox.x,\n bbox.y,\n bbox.x + bbox.width,\n bbox.y + bbox.height\n );\n neighborLength = neighbors.length;\n\n const clusterPosition = Cartesian3.clone(item.position);\n numPoints = 1;\n ids = [item.id];\n\n for (j = 0; j < neighborLength; ++j) {\n neighborIndex = neighbors[j];\n neighborPoint = points[neighborIndex];\n if (!neighborPoint.clustered) {\n const neighborItem = neighborPoint.collection.get(\n neighborPoint.index\n );\n const neighborBBox = getBoundingBox(\n neighborItem,\n neighborPoint.coord,\n pixelRange,\n entityCluster,\n neighborBoundingRectangleScratch\n );\n\n Cartesian3.add(\n neighborItem.position,\n clusterPosition,\n clusterPosition\n );\n\n BoundingRectangle.union(totalBBox, neighborBBox, totalBBox);\n ++numPoints;\n\n ids.push(neighborItem.id);\n }\n }\n\n if (numPoints >= minimumClusterSize) {\n const position = Cartesian3.multiplyByScalar(\n clusterPosition,\n 1.0 / numPoints,\n clusterPosition\n );\n addCluster(position, numPoints, ids, entityCluster);\n newClusters.push({\n position: position,\n width: totalBBox.width,\n height: totalBBox.height,\n minimumWidth: bbox.width,\n minimumHeight: bbox.height,\n });\n\n for (j = 0; j < neighborLength; ++j) {\n points[neighbors[j]].clustered = true;\n }\n } else {\n addNonClusteredItem(item, entityCluster);\n }\n }\n\n if (clusteredLabelCollection.length === 0) {\n clusteredLabelCollection.destroy();\n entityCluster._clusterLabelCollection = undefined;\n }\n\n if (clusteredBillboardCollection.length === 0) {\n clusteredBillboardCollection.destroy();\n entityCluster._clusterBillboardCollection = undefined;\n }\n\n if (clusteredPointCollection.length === 0) {\n clusteredPointCollection.destroy();\n entityCluster._clusterPointCollection = undefined;\n }\n\n entityCluster._previousClusters = newClusters;\n entityCluster._previousHeight = currentHeight;\n };\n}\n\nEntityCluster.prototype._initialize = function (scene) {\n this._scene = scene;\n\n const cluster = createDeclutterCallback(this);\n this._cluster = cluster;\n this._removeEventListener = scene.camera.changed.addEventListener(cluster);\n};\n\nObject.defineProperties(EntityCluster.prototype, {\n /**\n * Gets or sets whether clustering is enabled.\n * @memberof EntityCluster.prototype\n * @type {Boolean}\n */\n enabled: {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this._enabledDirty = value !== this._enabled;\n this._enabled = value;\n },\n },\n /**\n * Gets or sets the pixel range to extend the screen space bounding box.\n * @memberof EntityCluster.prototype\n * @type {Number}\n */\n pixelRange: {\n get: function () {\n return this._pixelRange;\n },\n set: function (value) {\n this._clusterDirty = this._clusterDirty || value !== this._pixelRange;\n this._pixelRange = value;\n },\n },\n /**\n * Gets or sets the minimum number of screen space objects that can be clustered.\n * @memberof EntityCluster.prototype\n * @type {Number}\n */\n minimumClusterSize: {\n get: function () {\n return this._minimumClusterSize;\n },\n set: function (value) {\n this._clusterDirty =\n this._clusterDirty || value !== this._minimumClusterSize;\n this._minimumClusterSize = value;\n },\n },\n /**\n * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.\n * @memberof EntityCluster.prototype\n * @type {Event<EntityCluster.newClusterCallback>}\n */\n clusterEvent: {\n get: function () {\n return this._clusterEvent;\n },\n },\n /**\n * Gets or sets whether clustering billboard entities is enabled.\n * @memberof EntityCluster.prototype\n * @type {Boolean}\n */\n clusterBillboards: {\n get: function () {\n return this._clusterBillboards;\n },\n set: function (value) {\n this._clusterDirty =\n this._clusterDirty || value !== this._clusterBillboards;\n this._clusterBillboards = value;\n },\n },\n /**\n * Gets or sets whether clustering labels entities is enabled.\n * @memberof EntityCluster.prototype\n * @type {Boolean}\n */\n clusterLabels: {\n get: function () {\n return this._clusterLabels;\n },\n set: function (value) {\n this._clusterDirty = this._clusterDirty || value !== this._clusterLabels;\n this._clusterLabels = value;\n },\n },\n /**\n * Gets or sets whether clustering point entities is enabled.\n * @memberof EntityCluster.prototype\n * @type {Boolean}\n */\n clusterPoints: {\n get: function () {\n return this._clusterPoints;\n },\n set: function (value) {\n this._clusterDirty = this._clusterDirty || value !== this._clusterPoints;\n this._clusterPoints = value;\n },\n },\n});\n\nfunction createGetEntity(\n collectionProperty,\n CollectionConstructor,\n unusedIndicesProperty,\n entityIndexProperty\n) {\n return function (entity) {\n let collection = this[collectionProperty];\n\n if (!defined(this._collectionIndicesByEntity)) {\n this._collectionIndicesByEntity = {};\n }\n\n let entityIndices = this._collectionIndicesByEntity[entity.id];\n\n if (!defined(entityIndices)) {\n entityIndices = this._collectionIndicesByEntity[entity.id] = {\n billboardIndex: undefined,\n labelIndex: undefined,\n pointIndex: undefined,\n };\n }\n\n if (defined(collection) && defined(entityIndices[entityIndexProperty])) {\n return collection.get(entityIndices[entityIndexProperty]);\n }\n\n if (!defined(collection)) {\n collection = this[collectionProperty] = new CollectionConstructor({\n scene: this._scene,\n });\n }\n\n let index;\n let entityItem;\n\n const unusedIndices = this[unusedIndicesProperty];\n if (unusedIndices.length > 0) {\n index = unusedIndices.pop();\n entityItem = collection.get(index);\n } else {\n entityItem = collection.add();\n index = collection.length - 1;\n }\n\n entityIndices[entityIndexProperty] = index;\n\n const that = this;\n Promise.resolve().then(function () {\n that._clusterDirty = true;\n });\n\n return entityItem;\n };\n}\n\nfunction removeEntityIndicesIfUnused(entityCluster, entityId) {\n const indices = entityCluster._collectionIndicesByEntity[entityId];\n\n if (\n !defined(indices.billboardIndex) &&\n !defined(indices.labelIndex) &&\n !defined(indices.pointIndex)\n ) {\n delete entityCluster._collectionIndicesByEntity[entityId];\n }\n}\n\n/**\n * Returns a new {@link Label}.\n * @param {Entity} entity The entity that will use the returned {@link Label} for visualization.\n * @returns {Label} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getLabel = createGetEntity(\n \"_labelCollection\",\n LabelCollection,\n \"_unusedLabelIndices\",\n \"labelIndex\"\n);\n\n/**\n * Removes the {@link Label} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Label} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removeLabel = function (entity) {\n const entityIndices =\n this._collectionIndicesByEntity &&\n this._collectionIndicesByEntity[entity.id];\n if (\n !defined(this._labelCollection) ||\n !defined(entityIndices) ||\n !defined(entityIndices.labelIndex)\n ) {\n return;\n }\n\n const index = entityIndices.labelIndex;\n entityIndices.labelIndex = undefined;\n removeEntityIndicesIfUnused(this, entity.id);\n\n const label = this._labelCollection.get(index);\n label.show = false;\n label.text = \"\";\n label.id = undefined;\n\n this._unusedLabelIndices.push(index);\n\n this._clusterDirty = true;\n};\n\n/**\n * Returns a new {@link Billboard}.\n * @param {Entity} entity The entity that will use the returned {@link Billboard} for visualization.\n * @returns {Billboard} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getBillboard = createGetEntity(\n \"_billboardCollection\",\n BillboardCollection,\n \"_unusedBillboardIndices\",\n \"billboardIndex\"\n);\n\n/**\n * Removes the {@link Billboard} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Billboard} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removeBillboard = function (entity) {\n const entityIndices =\n this._collectionIndicesByEntity &&\n this._collectionIndicesByEntity[entity.id];\n if (\n !defined(this._billboardCollection) ||\n !defined(entityIndices) ||\n !defined(entityIndices.billboardIndex)\n ) {\n return;\n }\n\n const index = entityIndices.billboardIndex;\n entityIndices.billboardIndex = undefined;\n removeEntityIndicesIfUnused(this, entity.id);\n\n const billboard = this._billboardCollection.get(index);\n billboard.id = undefined;\n billboard.show = false;\n billboard.image = undefined;\n\n this._unusedBillboardIndices.push(index);\n\n this._clusterDirty = true;\n};\n\n/**\n * Returns a new {@link Point}.\n * @param {Entity} entity The entity that will use the returned {@link Point} for visualization.\n * @returns {Point} The label that will be used to visualize an entity.\n *\n * @private\n */\nEntityCluster.prototype.getPoint = createGetEntity(\n \"_pointCollection\",\n PointPrimitiveCollection,\n \"_unusedPointIndices\",\n \"pointIndex\"\n);\n\n/**\n * Removes the {@link Point} associated with an entity so it can be reused by another entity.\n * @param {Entity} entity The entity that will uses the returned {@link Point} for visualization.\n *\n * @private\n */\nEntityCluster.prototype.removePoint = function (entity) {\n const entityIndices =\n this._collectionIndicesByEntity &&\n this._collectionIndicesByEntity[entity.id];\n if (\n !defined(this._pointCollection) ||\n !defined(entityIndices) ||\n !defined(entityIndices.pointIndex)\n ) {\n return;\n }\n\n const index = entityIndices.pointIndex;\n entityIndices.pointIndex = undefined;\n removeEntityIndicesIfUnused(this, entity.id);\n\n const point = this._pointCollection.get(index);\n point.show = false;\n point.id = undefined;\n\n this._unusedPointIndices.push(index);\n\n this._clusterDirty = true;\n};\n\nfunction disableCollectionClustering(collection) {\n if (!defined(collection)) {\n return;\n }\n\n const length = collection.length;\n for (let i = 0; i < length; ++i) {\n collection.get(i).clusterShow = true;\n }\n}\n\nfunction updateEnable(entityCluster) {\n if (entityCluster.enabled) {\n return;\n }\n\n if (defined(entityCluster._clusterLabelCollection)) {\n entityCluster._clusterLabelCollection.destroy();\n }\n if (defined(entityCluster._clusterBillboardCollection)) {\n entityCluster._clusterBillboardCollection.destroy();\n }\n if (defined(entityCluster._clusterPointCollection)) {\n entityCluster._clusterPointCollection.destroy();\n }\n\n entityCluster._clusterLabelCollection = undefined;\n entityCluster._clusterBillboardCollection = undefined;\n entityCluster._clusterPointCollection = undefined;\n\n disableCollectionClustering(entityCluster._labelCollection);\n disableCollectionClustering(entityCluster._billboardCollection);\n disableCollectionClustering(entityCluster._pointCollection);\n}\n\n/**\n * Gets the draw commands for the clustered billboards/points/labels if enabled, otherwise,\n * queues the draw commands for billboards/points/labels created for entities.\n * @private\n */\nEntityCluster.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n // If clustering is enabled before the label collection is updated,\n // the glyphs haven't been created so the screen space bounding boxes\n // are incorrect.\n let commandList;\n if (\n defined(this._labelCollection) &&\n this._labelCollection.length > 0 &&\n this._labelCollection.get(0)._glyphs.length === 0\n ) {\n commandList = frameState.commandList;\n frameState.commandList = [];\n this._labelCollection.update(frameState);\n frameState.commandList = commandList;\n }\n\n // If clustering is enabled before the billboard collection is updated,\n // the images haven't been added to the image atlas so the screen space bounding boxes\n // are incorrect.\n if (\n defined(this._billboardCollection) &&\n this._billboardCollection.length > 0 &&\n !defined(this._billboardCollection.get(0).width)\n ) {\n commandList = frameState.commandList;\n frameState.commandList = [];\n this._billboardCollection.update(frameState);\n frameState.commandList = commandList;\n }\n\n if (this._enabledDirty) {\n this._enabledDirty = false;\n updateEnable(this);\n this._clusterDirty = true;\n }\n\n if (this._clusterDirty) {\n this._clusterDirty = false;\n this._cluster();\n }\n\n if (defined(this._clusterLabelCollection)) {\n this._clusterLabelCollection.update(frameState);\n }\n if (defined(this._clusterBillboardCollection)) {\n this._clusterBillboardCollection.update(frameState);\n }\n if (defined(this._clusterPointCollection)) {\n this._clusterPointCollection.update(frameState);\n }\n\n if (defined(this._labelCollection)) {\n this._labelCollection.update(frameState);\n }\n if (defined(this._billboardCollection)) {\n this._billboardCollection.update(frameState);\n }\n if (defined(this._pointCollection)) {\n this._pointCollection.update(frameState);\n }\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed\n * from a data source collection and added to another.\n * </p>\n */\nEntityCluster.prototype.destroy = function () {\n this._labelCollection =\n this._labelCollection && this._labelCollection.destroy();\n this._billboardCollection =\n this._billboardCollection && this._billboardCollection.destroy();\n this._pointCollection =\n this._pointCollection && this._pointCollection.destroy();\n\n this._clusterLabelCollection =\n this._clusterLabelCollection && this._clusterLabelCollection.destroy();\n this._clusterBillboardCollection =\n this._clusterBillboardCollection &&\n this._clusterBillboardCollection.destroy();\n this._clusterPointCollection =\n this._clusterPointCollection && this._clusterPointCollection.destroy();\n\n if (defined(this._removeEventListener)) {\n this._removeEventListener();\n this._removeEventListener = undefined;\n }\n\n this._labelCollection = undefined;\n this._billboardCollection = undefined;\n this._pointCollection = undefined;\n\n this._clusterBillboardCollection = undefined;\n this._clusterLabelCollection = undefined;\n this._clusterPointCollection = undefined;\n\n this._collectionIndicesByEntity = undefined;\n\n this._unusedLabelIndices = [];\n this._unusedBillboardIndices = [];\n this._unusedPointIndices = [];\n\n this._previousClusters = [];\n this._previousHeight = undefined;\n\n this._enabledDirty = false;\n this._pixelRangeDirty = false;\n this._minimumClusterSizeDirty = false;\n\n return undefined;\n};\n\n/**\n * A event listener function used to style clusters.\n * @callback EntityCluster.newClusterCallback\n *\n * @param {Entity[]} clusteredEntities An array of the entities contained in the cluster.\n * @param {Object} cluster An object containing the Billboard, Label, and Point\n * primitives that represent this cluster of entities.\n * @param {Billboard} cluster.billboard\n * @param {Label} cluster.label\n * @param {PointPrimitive} cluster.point\n *\n * @example\n * // The default cluster values.\n * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {\n * cluster.label.show = true;\n * cluster.label.text = entities.length.toLocaleString();\n * });\n */\nexport default EntityCluster;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport DataSource from \"./DataSource.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\n\n/**\n * A {@link DataSource} implementation which can be used to manually manage a group of entities.\n *\n * @alias CustomDataSource\n * @constructor\n *\n * @param {String} [name] A human-readable name for this instance.\n *\n * @example\n * const dataSource = new Cesium.CustomDataSource('myData');\n *\n * const entity = dataSource.entities.add({\n * position : Cesium.Cartesian3.fromDegrees(1, 2, 0),\n * billboard : {\n * image : 'image.png'\n * }\n * });\n *\n * viewer.dataSources.add(dataSource);\n */\nfunction CustomDataSource(name) {\n this._name = name;\n this._clock = undefined;\n this._changed = new Event();\n this._error = new Event();\n this._isLoading = false;\n this._loading = new Event();\n this._entityCollection = new EntityCollection(this);\n this._entityCluster = new EntityCluster();\n}\n\nObject.defineProperties(CustomDataSource.prototype, {\n /**\n * Gets or sets a human-readable name for this instance.\n * @memberof CustomDataSource.prototype\n * @type {String}\n */\n name: {\n get: function () {\n return this._name;\n },\n set: function (value) {\n if (this._name !== value) {\n this._name = value;\n this._changed.raiseEvent(this);\n }\n },\n },\n /**\n * Gets or sets the clock for this instance.\n * @memberof CustomDataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n set: function (value) {\n if (this._clock !== value) {\n this._clock = value;\n this._changed.raiseEvent(this);\n }\n },\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof CustomDataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: function () {\n return this._entityCollection;\n },\n },\n /**\n * Gets or sets whether the data source is currently loading data.\n * @memberof CustomDataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: function () {\n return this._isLoading;\n },\n set: function (value) {\n DataSource.setLoading(this, value);\n },\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof CustomDataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: function () {\n return this._changed;\n },\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof CustomDataSource.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._error;\n },\n },\n /**\n * Gets an event that will be raised when the data source either starts or stops loading.\n * @memberof CustomDataSource.prototype\n * @type {Event}\n */\n loadingEvent: {\n get: function () {\n return this._loading;\n },\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof CustomDataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._entityCollection.show;\n },\n set: function (value) {\n this._entityCollection.show = value;\n },\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof CustomDataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: function () {\n return this._entityCluster;\n },\n set: function (value) {\nthis._entityCluster = value;\n },\n },\n});\n\n/**\n * Updates the data source to the provided time. This function is optional and\n * is not required to be implemented. It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nCustomDataSource.prototype.update = function (time) {\n return true;\n};\n\nexport default CustomDataSource;\n", "import CesiumMath from \"./Math.js\";\n\n/**\n * @private\n */\nconst CylinderGeometryLibrary = {};\n\n/**\n * @private\n */\nCylinderGeometryLibrary.computePositions = function (\n length,\n topRadius,\n bottomRadius,\n slices,\n fill\n) {\n const topZ = length * 0.5;\n const bottomZ = -topZ;\n\n const twoSlice = slices + slices;\n const size = fill ? 2 * twoSlice : twoSlice;\n const positions = new Float64Array(size * 3);\n let i;\n let index = 0;\n let tbIndex = 0;\n const bottomOffset = fill ? twoSlice * 3 : 0;\n const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;\n\n for (i = 0; i < slices; i++) {\n const angle = (i / slices) * CesiumMath.TWO_PI;\n const x = Math.cos(angle);\n const y = Math.sin(angle);\n const bottomX = x * bottomRadius;\n const bottomY = y * bottomRadius;\n const topX = x * topRadius;\n const topY = y * topRadius;\n\n positions[tbIndex + bottomOffset] = bottomX;\n positions[tbIndex + bottomOffset + 1] = bottomY;\n positions[tbIndex + bottomOffset + 2] = bottomZ;\n\n positions[tbIndex + topOffset] = topX;\n positions[tbIndex + topOffset + 1] = topY;\n positions[tbIndex + topOffset + 2] = topZ;\n tbIndex += 3;\n if (fill) {\n positions[index++] = bottomX;\n positions[index++] = bottomY;\n positions[index++] = bottomZ;\n positions[index++] = topX;\n positions[index++] = topY;\n positions[index++] = topZ;\n }\n }\n\n return positions;\n};\nexport default CylinderGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst radiusScratch = new Cartesian2();\nconst normalScratch = new Cartesian3();\nconst bitangentScratch = new Cartesian3();\nconst tangentScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\n\n/**\n * A description of a cylinder.\n *\n * @alias CylinderGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.length The length of the cylinder.\n * @param {Number} options.topRadius The radius of the top of the cylinder.\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderGeometry({\n * length: 200000,\n * topRadius: 80000,\n * bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);\n */\nfunction CylinderGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const length = options.length;\n const topRadius = options.topRadius;\n const bottomRadius = options.bottomRadius;\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n const slices = defaultValue(options.slices, 128);\n\n this._length = length;\n this._topRadius = topRadius;\n this._bottomRadius = bottomRadius;\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._slices = slices;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createCylinderGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCylinderGeometry.packedLength = VertexFormat.packedLength + 5;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCylinderGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._length;\n array[startingIndex++] = value._topRadius;\n array[startingIndex++] = value._bottomRadius;\n array[startingIndex++] = value._slices;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n vertexFormat: scratchVertexFormat,\n length: undefined,\n topRadius: undefined,\n bottomRadius: undefined,\n slices: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CylinderGeometry} [result] The object into which to store the result.\n * @returns {CylinderGeometry} The modified result parameter or a new CylinderGeometry instance if one was not provided.\n */\nCylinderGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const length = array[startingIndex++];\n const topRadius = array[startingIndex++];\n const bottomRadius = array[startingIndex++];\n const slices = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.length = length;\n scratchOptions.topRadius = topRadius;\n scratchOptions.bottomRadius = bottomRadius;\n scratchOptions.slices = slices;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new CylinderGeometry(scratchOptions);\n }\n\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._length = length;\n result._topRadius = topRadius;\n result._bottomRadius = bottomRadius;\n result._slices = slices;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.\n *\n * @param {CylinderGeometry} cylinderGeometry A description of the cylinder.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCylinderGeometry.createGeometry = function (cylinderGeometry) {\n let length = cylinderGeometry._length;\n const topRadius = cylinderGeometry._topRadius;\n const bottomRadius = cylinderGeometry._bottomRadius;\n const vertexFormat = cylinderGeometry._vertexFormat;\n const slices = cylinderGeometry._slices;\n\n if (\n length <= 0 ||\n topRadius < 0 ||\n bottomRadius < 0 ||\n (topRadius === 0 && bottomRadius === 0)\n ) {\n return;\n }\n\n const twoSlices = slices + slices;\n const threeSlices = slices + twoSlices;\n const numVertices = twoSlices + twoSlices;\n\n const positions = CylinderGeometryLibrary.computePositions(\n length,\n topRadius,\n bottomRadius,\n slices,\n true\n );\n\n const st = vertexFormat.st ? new Float32Array(numVertices * 2) : undefined;\n const normals = vertexFormat.normal\n ? new Float32Array(numVertices * 3)\n : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(numVertices * 3)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(numVertices * 3)\n : undefined;\n\n let i;\n const computeNormal =\n vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;\n\n if (computeNormal) {\n const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;\n\n let normalIndex = 0;\n let tangentIndex = 0;\n let bitangentIndex = 0;\n\n const theta = Math.atan2(bottomRadius - topRadius, length);\n const normal = normalScratch;\n normal.z = Math.sin(theta);\n const normalScale = Math.cos(theta);\n let tangent = tangentScratch;\n let bitangent = bitangentScratch;\n\n for (i = 0; i < slices; i++) {\n const angle = (i / slices) * CesiumMath.TWO_PI;\n const x = normalScale * Math.cos(angle);\n const y = normalScale * Math.sin(angle);\n if (computeNormal) {\n normal.x = x;\n normal.y = y;\n\n if (computeTangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\n tangent\n );\n }\n\n if (vertexFormat.normal) {\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n }\n\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n }\n }\n }\n\n for (i = 0; i < slices; i++) {\n if (vertexFormat.normal) {\n normals[normalIndex++] = 0;\n normals[normalIndex++] = 0;\n normals[normalIndex++] = -1;\n }\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = 1;\n tangents[tangentIndex++] = 0;\n tangents[tangentIndex++] = 0;\n }\n if (vertexFormat.bitangent) {\n bitangents[bitangentIndex++] = 0;\n bitangents[bitangentIndex++] = -1;\n bitangents[bitangentIndex++] = 0;\n }\n }\n\n for (i = 0; i < slices; i++) {\n if (vertexFormat.normal) {\n normals[normalIndex++] = 0;\n normals[normalIndex++] = 0;\n normals[normalIndex++] = 1;\n }\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = 1;\n tangents[tangentIndex++] = 0;\n tangents[tangentIndex++] = 0;\n }\n if (vertexFormat.bitangent) {\n bitangents[bitangentIndex++] = 0;\n bitangents[bitangentIndex++] = 1;\n bitangents[bitangentIndex++] = 0;\n }\n }\n }\n\n const numIndices = 12 * slices - 12;\n const indices = IndexDatatype.createTypedArray(numVertices, numIndices);\n let index = 0;\n let j = 0;\n for (i = 0; i < slices - 1; i++) {\n indices[index++] = j;\n indices[index++] = j + 2;\n indices[index++] = j + 3;\n\n indices[index++] = j;\n indices[index++] = j + 3;\n indices[index++] = j + 1;\n\n j += 2;\n }\n\n indices[index++] = twoSlices - 2;\n indices[index++] = 0;\n indices[index++] = 1;\n indices[index++] = twoSlices - 2;\n indices[index++] = 1;\n indices[index++] = twoSlices - 1;\n\n for (i = 1; i < slices - 1; i++) {\n indices[index++] = twoSlices + i + 1;\n indices[index++] = twoSlices + i;\n indices[index++] = twoSlices;\n }\n\n for (i = 1; i < slices - 1; i++) {\n indices[index++] = threeSlices;\n indices[index++] = threeSlices + i;\n indices[index++] = threeSlices + i + 1;\n }\n\n let textureCoordIndex = 0;\n if (vertexFormat.st) {\n const rad = Math.max(topRadius, bottomRadius);\n for (i = 0; i < numVertices; i++) {\n const position = Cartesian3.fromArray(positions, i * 3, positionScratch);\n st[textureCoordIndex++] = (position.x + rad) / (2.0 * rad);\n st[textureCoordIndex++] = (position.y + rad) / (2.0 * rad);\n }\n }\n\n const attributes = new GeometryAttributes();\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: st,\n });\n }\n\n radiusScratch.x = length * 0.5;\n radiusScratch.y = Math.max(bottomRadius, topRadius);\n\n const boundingSphere = new BoundingSphere(\n Cartesian3.ZERO,\n Cartesian2.magnitude(radiusScratch)\n );\n\n if (defined(cylinderGeometry._offsetAttribute)) {\n length = positions.length;\n const offsetValue =\n cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: boundingSphere,\n offsetAttribute: cylinderGeometry._offsetAttribute,\n });\n};\n\nlet unitCylinderGeometry;\n\n/**\n * Returns the geometric representation of a unit cylinder, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nCylinderGeometry.getUnitCylinder = function () {\n if (!defined(unitCylinderGeometry)) {\n unitCylinderGeometry = CylinderGeometry.createGeometry(\n new CylinderGeometry({\n topRadius: 1.0,\n bottomRadius: 1.0,\n length: 1.0,\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n }\n return unitCylinderGeometry;\n};\nexport default CylinderGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst radiusScratch = new Cartesian2();\n\n/**\n * A description of the outline of a cylinder.\n *\n * @alias CylinderOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number} options.length The length of the cylinder.\n * @param {Number} options.topRadius The radius of the top of the cylinder.\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.\n *\n * @exception {DeveloperError} options.length must be greater than 0.\n * @exception {DeveloperError} options.topRadius must be greater than 0.\n * @exception {DeveloperError} options.bottomRadius must be greater than 0.\n * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\n *\n * @see CylinderOutlineGeometry.createGeometry\n *\n * @example\n * // create cylinder geometry\n * const cylinder = new Cesium.CylinderOutlineGeometry({\n * length: 200000,\n * topRadius: 80000,\n * bottomRadius: 200000,\n * });\n * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);\n */\nfunction CylinderOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const length = options.length;\n const topRadius = options.topRadius;\n const bottomRadius = options.bottomRadius;\n const slices = defaultValue(options.slices, 128);\n const numberOfVerticalLines = Math.max(\n defaultValue(options.numberOfVerticalLines, 16),\n 0\n );\n\n this._length = length;\n this._topRadius = topRadius;\n this._bottomRadius = bottomRadius;\n this._slices = slices;\n this._numberOfVerticalLines = numberOfVerticalLines;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createCylinderOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCylinderOutlineGeometry.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CylinderOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCylinderOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value._length;\n array[startingIndex++] = value._topRadius;\n array[startingIndex++] = value._bottomRadius;\n array[startingIndex++] = value._slices;\n array[startingIndex++] = value._numberOfVerticalLines;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchOptions = {\n length: undefined,\n topRadius: undefined,\n bottomRadius: undefined,\n slices: undefined,\n numberOfVerticalLines: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CylinderOutlineGeometry} [result] The object into which to store the result.\n * @returns {CylinderOutlineGeometry} The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.\n */\nCylinderOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const length = array[startingIndex++];\n const topRadius = array[startingIndex++];\n const bottomRadius = array[startingIndex++];\n const slices = array[startingIndex++];\n const numberOfVerticalLines = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.length = length;\n scratchOptions.topRadius = topRadius;\n scratchOptions.bottomRadius = bottomRadius;\n scratchOptions.slices = slices;\n scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new CylinderOutlineGeometry(scratchOptions);\n }\n\n result._length = length;\n result._topRadius = topRadius;\n result._bottomRadius = bottomRadius;\n result._slices = slices;\n result._numberOfVerticalLines = numberOfVerticalLines;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.\n *\n * @param {CylinderOutlineGeometry} cylinderGeometry A description of the cylinder outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCylinderOutlineGeometry.createGeometry = function (cylinderGeometry) {\n let length = cylinderGeometry._length;\n const topRadius = cylinderGeometry._topRadius;\n const bottomRadius = cylinderGeometry._bottomRadius;\n const slices = cylinderGeometry._slices;\n const numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;\n\n if (\n length <= 0 ||\n topRadius < 0 ||\n bottomRadius < 0 ||\n (topRadius === 0 && bottomRadius === 0)\n ) {\n return;\n }\n\n const numVertices = slices * 2;\n\n const positions = CylinderGeometryLibrary.computePositions(\n length,\n topRadius,\n bottomRadius,\n slices,\n false\n );\n let numIndices = slices * 2;\n let numSide;\n if (numberOfVerticalLines > 0) {\n const numSideLines = Math.min(numberOfVerticalLines, slices);\n numSide = Math.round(slices / numSideLines);\n numIndices += numSideLines;\n }\n\n const indices = IndexDatatype.createTypedArray(numVertices, numIndices * 2);\n let index = 0;\n let i;\n for (i = 0; i < slices - 1; i++) {\n indices[index++] = i;\n indices[index++] = i + 1;\n indices[index++] = i + slices;\n indices[index++] = i + 1 + slices;\n }\n\n indices[index++] = slices - 1;\n indices[index++] = 0;\n indices[index++] = slices + slices - 1;\n indices[index++] = slices;\n\n if (numberOfVerticalLines > 0) {\n for (i = 0; i < slices; i += numSide) {\n indices[index++] = i;\n indices[index++] = i + slices;\n }\n }\n\n const attributes = new GeometryAttributes();\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n radiusScratch.x = length * 0.5;\n radiusScratch.y = Math.max(bottomRadius, topRadius);\n\n const boundingSphere = new BoundingSphere(\n Cartesian3.ZERO,\n Cartesian2.magnitude(radiusScratch)\n );\n\n if (defined(cylinderGeometry._offsetAttribute)) {\n length = positions.length;\n const offsetValue =\n cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: boundingSphere,\n offsetAttribute: cylinderGeometry._offsetAttribute,\n });\n};\nexport default CylinderOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CylinderGeometry from \"../Core/CylinderGeometry.js\";\nimport CylinderOutlineGeometry from \"../Core/CylinderOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport Property from \"./Property.js\";\n\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction CylinderGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.length = undefined;\n this.topRadius = undefined;\n this.bottomRadius = undefined;\n this.slices = undefined;\n this.numberOfVerticalLines = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for cylinders.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias CylinderGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction CylinderGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new CylinderGeometryOptions(entity),\n geometryPropertyName: \"cylinder\",\n observedPropertyNames: [\n \"availability\",\n \"position\",\n \"orientation\",\n \"cylinder\",\n ],\n });\n\n this._onEntityPropertyChanged(entity, \"cylinder\", entity.cylinder, undefined);\n}\n\nif (defined(Object.create)) {\n CylinderGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n CylinderGeometryUpdater.prototype.constructor = CylinderGeometryUpdater;\n}\n\nObject.defineProperties(CylinderGeometryUpdater.prototype, {\n /**\n * Gets the terrain offset property\n * @type {TerrainOffsetProperty}\n * @memberof CylinderGeometryUpdater.prototype\n * @readonly\n * @private\n */\n terrainOffsetProperty: {\n get: function () {\n return this._terrainOffsetProperty;\n },\n },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nCylinderGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n\n const attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: undefined,\n offset: undefined,\n };\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new CylinderGeometry(this._options),\n modelMatrix: entity.computeModelMatrixForHeightReference(\n time,\n entity.cylinder.heightReference,\n this._options.length * 0.5,\n this._scene.mapProjection.ellipsoid\n ),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nCylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new CylinderOutlineGeometry(this._options),\n modelMatrix: entity.computeModelMatrixForHeightReference(\n time,\n entity.cylinder.heightReference,\n this._options.length * 0.5,\n this._scene.mapProjection.ellipsoid\n ),\n attributes: attributes,\n });\n};\n\nCylinderGeometryUpdater.prototype._computeCenter = function (time, result) {\n return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nCylinderGeometryUpdater.prototype._isHidden = function (entity, cylinder) {\n return (\n !defined(entity.position) ||\n !defined(cylinder.length) ||\n !defined(cylinder.topRadius) ||\n !defined(cylinder.bottomRadius) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, cylinder)\n );\n};\n\nCylinderGeometryUpdater.prototype._isDynamic = function (entity, cylinder) {\n return (\n !entity.position.isConstant || //\n !Property.isConstant(entity.orientation) || //\n !cylinder.length.isConstant || //\n !cylinder.topRadius.isConstant || //\n !cylinder.bottomRadius.isConstant || //\n !Property.isConstant(cylinder.slices) || //\n !Property.isConstant(cylinder.outlineWidth) || //\n !Property.isConstant(cylinder.numberOfVerticalLines)\n );\n};\n\nCylinderGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n cylinder\n) {\n const heightReference = Property.getValueOrDefault(\n cylinder.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n const options = this._options;\n options.vertexFormat =\n this._materialProperty instanceof ColorMaterialProperty\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.length = cylinder.length.getValue(Iso8601.MINIMUM_VALUE);\n options.topRadius = cylinder.topRadius.getValue(Iso8601.MINIMUM_VALUE);\n options.bottomRadius = cylinder.bottomRadius.getValue(Iso8601.MINIMUM_VALUE);\n options.slices = Property.getValueOrUndefined(\n cylinder.slices,\n Iso8601.MINIMUM_VALUE\n );\n options.numberOfVerticalLines = Property.getValueOrUndefined(\n cylinder.numberOfVerticalLines,\n Iso8601.MINIMUM_VALUE\n );\n options.offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n};\n\nCylinderGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nCylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicCylinderGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicCylinderGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicCylinderGeometryUpdater.prototype.constructor = DynamicCylinderGeometryUpdater;\n}\n\nDynamicCylinderGeometryUpdater.prototype._isHidden = function (\n entity,\n cylinder,\n time\n) {\n const options = this._options;\n const position = Property.getValueOrUndefined(\n entity.position,\n time,\n positionScratch\n );\n return (\n !defined(position) ||\n !defined(options.length) ||\n !defined(options.topRadius) || //\n !defined(options.bottomRadius) ||\n DynamicGeometryUpdater.prototype._isHidden.call(\n this,\n entity,\n cylinder,\n time\n )\n );\n};\n\nDynamicCylinderGeometryUpdater.prototype._setOptions = function (\n entity,\n cylinder,\n time\n) {\n const heightReference = Property.getValueOrDefault(\n cylinder.heightReference,\n time,\n HeightReference.NONE\n );\n const options = this._options;\n options.length = Property.getValueOrUndefined(cylinder.length, time);\n options.topRadius = Property.getValueOrUndefined(cylinder.topRadius, time);\n options.bottomRadius = Property.getValueOrUndefined(\n cylinder.bottomRadius,\n time\n );\n options.slices = Property.getValueOrUndefined(cylinder.slices, time);\n options.numberOfVerticalLines = Property.getValueOrUndefined(\n cylinder.numberOfVerticalLines,\n time\n );\n options.offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n};\nexport default CylinderGeometryUpdater;\n", "/**\n * Constants used by {@link Clock#tick} to determine behavior\n * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.\n *\n * @enum {Number}\n *\n * @see Clock\n * @see ClockStep\n */\nconst ClockRange = {\n /**\n * {@link Clock#tick} will always advances the clock in its current direction.\n *\n * @type {Number}\n * @constant\n */\n UNBOUNDED: 0,\n\n /**\n * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,\n * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.\n *\n * @type {Number}\n * @constant\n */\n CLAMPED: 1,\n\n /**\n * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance\n * {@link Clock#currentTime} to the opposite end of the interval. When\n * time is moving backwards, {@link Clock#tick} will not advance past\n * {@link Clock#startTime}\n *\n * @type {Number}\n * @constant\n */\n LOOP_STOP: 2,\n};\nexport default Object.freeze(ClockRange);\n", "/**\n * Constants to determine how much time advances with each call\n * to {@link Clock#tick}.\n *\n * @enum {Number}\n *\n * @see Clock\n * @see ClockRange\n */\nconst ClockStep = {\n /**\n * {@link Clock#tick} advances the current time by a fixed step,\n * which is the number of seconds specified by {@link Clock#multiplier}.\n *\n * @type {Number}\n * @constant\n */\n TICK_DEPENDENT: 0,\n\n /**\n * {@link Clock#tick} advances the current time by the amount of system\n * time elapsed since the previous call multiplied by {@link Clock#multiplier}.\n *\n * @type {Number}\n * @constant\n */\n SYSTEM_CLOCK_MULTIPLIER: 1,\n\n /**\n * {@link Clock#tick} sets the clock to the current system time;\n * ignoring all other settings.\n *\n * @type {Number}\n * @constant\n */\n SYSTEM_CLOCK: 2,\n};\nexport default Object.freeze(ClockStep);\n", "/**\n * Constants to determine how an interpolated value is extrapolated\n * when querying outside the bounds of available data.\n *\n * @enum {Number}\n *\n * @see SampledProperty\n */\nconst ExtrapolationType = {\n /**\n * No extrapolation occurs.\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * The first or last value is used when outside the range of sample data.\n *\n * @type {Number}\n * @constant\n */\n HOLD: 1,\n\n /**\n * The value is extrapolated.\n *\n * @type {Number}\n * @constant\n */\n EXTRAPOLATE: 2,\n};\nexport default Object.freeze(ExtrapolationType);\n", "import Uri from \"urijs\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Given a URI, returns the last segment of the URI, removing any path or query information.\n * @function getFilenameFromUri\n *\n * @param {String} uri The Uri.\n * @returns {String} The last segment of the Uri.\n *\n * @example\n * //fileName will be\"simple.czml\";\n * const fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');\n */\nfunction getFilenameFromUri(uri) {\n const uriObject = new Uri(uri);\n uriObject.normalize();\n let path = uriObject.path();\n const index = path.lastIndexOf(\"/\");\n if (index !== -1) {\n path = path.substr(index + 1);\n }\n return path;\n}\nexport default getFilenameFromUri;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\n\nconst factorial = CesiumMath.factorial;\n\nfunction calculateCoefficientTerm(\n x,\n zIndices,\n xTable,\n derivOrder,\n termOrder,\n reservedIndices\n) {\n let result = 0;\n let reserved;\n let i;\n let j;\n\n if (derivOrder > 0) {\n for (i = 0; i < termOrder; i++) {\n reserved = false;\n for (j = 0; j < reservedIndices.length && !reserved; j++) {\n if (i === reservedIndices[j]) {\n reserved = true;\n }\n }\n\n if (!reserved) {\n reservedIndices.push(i);\n result += calculateCoefficientTerm(\n x,\n zIndices,\n xTable,\n derivOrder - 1,\n termOrder,\n reservedIndices\n );\n reservedIndices.splice(reservedIndices.length - 1, 1);\n }\n }\n\n return result;\n }\n\n result = 1;\n for (i = 0; i < termOrder; i++) {\n reserved = false;\n for (j = 0; j < reservedIndices.length && !reserved; j++) {\n if (i === reservedIndices[j]) {\n reserved = true;\n }\n }\n\n if (!reserved) {\n result *= x - xTable[zIndices[i]];\n }\n }\n\n return result;\n}\n\n/**\n * An {@link InterpolationAlgorithm} for performing Hermite interpolation.\n *\n * @namespace HermitePolynomialApproximation\n */\nconst HermitePolynomialApproximation = {\n type: \"Hermite\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n *\n * @param {Number} degree The desired degree of interpolation.\n * @param {Number} [inputOrder=0] The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).\n * @returns {Number} The number of required data points needed for the desired degree of interpolation.\n * @exception {DeveloperError} degree must be 0 or greater.\n * @exception {DeveloperError} inputOrder must be 0 or greater.\n */\nHermitePolynomialApproximation.getRequiredDataPoints = function (\n degree,\n inputOrder\n) {\n inputOrder = defaultValue(inputOrder, 0);\n\n return Math.max(Math.floor((degree + 1) / (inputOrder + 1)), 2);\n};\n\n/**\n * Interpolates values using Hermite Polynomial Approximation.\n *\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number[]} [result] An existing array into which to store the result.\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nHermitePolynomialApproximation.interpolateOrderZero = function (\n x,\n xTable,\n yTable,\n yStride,\n result\n) {\n if (!defined(result)) {\n result = new Array(yStride);\n }\n\n let i;\n let j;\n let d;\n let s;\n let len;\n let index;\n const length = xTable.length;\n const coefficients = new Array(yStride);\n\n for (i = 0; i < yStride; i++) {\n result[i] = 0;\n\n const l = new Array(length);\n coefficients[i] = l;\n for (j = 0; j < length; j++) {\n l[j] = [];\n }\n }\n\n const zIndicesLength = length,\n zIndices = new Array(zIndicesLength);\n\n for (i = 0; i < zIndicesLength; i++) {\n zIndices[i] = i;\n }\n\n let highestNonZeroCoef = length - 1;\n for (s = 0; s < yStride; s++) {\n for (j = 0; j < zIndicesLength; j++) {\n index = zIndices[j] * yStride + s;\n coefficients[s][0].push(yTable[index]);\n }\n\n for (i = 1; i < zIndicesLength; i++) {\n let nonZeroCoefficients = false;\n for (j = 0; j < zIndicesLength - i; j++) {\n const zj = xTable[zIndices[j]];\n const zn = xTable[zIndices[j + i]];\n\n let numerator;\n if (zn - zj <= 0) {\n index = zIndices[j] * yStride + yStride * i + s;\n numerator = yTable[index];\n coefficients[s][i].push(numerator / factorial(i));\n } else {\n numerator = coefficients[s][i - 1][j + 1] - coefficients[s][i - 1][j];\n coefficients[s][i].push(numerator / (zn - zj));\n }\n nonZeroCoefficients = nonZeroCoefficients || numerator !== 0;\n }\n\n if (!nonZeroCoefficients) {\n highestNonZeroCoef = i - 1;\n }\n }\n }\n\n for (d = 0, len = 0; d <= len; d++) {\n for (i = d; i <= highestNonZeroCoef; i++) {\n const tempTerm = calculateCoefficientTerm(x, zIndices, xTable, d, i, []);\n for (s = 0; s < yStride; s++) {\n const coeff = coefficients[s][i][0];\n result[s + d * yStride] += coeff * tempTerm;\n }\n }\n }\n\n return result;\n};\n\nconst arrayScratch = [];\n\n/**\n * Interpolates values using Hermite Polynomial Approximation.\n *\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number} inputOrder The number of derivatives supplied for input.\n * @param {Number} outputOrder The number of derivatives desired for output.\n * @param {Number[]} [result] An existing array into which to store the result.\n *\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nHermitePolynomialApproximation.interpolate = function (\n x,\n xTable,\n yTable,\n yStride,\n inputOrder,\n outputOrder,\n result\n) {\n const resultLength = yStride * (outputOrder + 1);\n if (!defined(result)) {\n result = new Array(resultLength);\n }\n for (let r = 0; r < resultLength; r++) {\n result[r] = 0;\n }\n\n const length = xTable.length;\n // The zIndices array holds copies of the addresses of the xTable values\n // in the range we're looking at. Even though this just holds information already\n // available in xTable this is a much more convenient format.\n const zIndices = new Array(length * (inputOrder + 1));\n let i;\n for (i = 0; i < length; i++) {\n for (let j = 0; j < inputOrder + 1; j++) {\n zIndices[i * (inputOrder + 1) + j] = i;\n }\n }\n\n const zIndiceslength = zIndices.length;\n const coefficients = arrayScratch;\n const highestNonZeroCoef = fillCoefficientList(\n coefficients,\n zIndices,\n xTable,\n yTable,\n yStride,\n inputOrder\n );\n const reservedIndices = [];\n\n const tmp = (zIndiceslength * (zIndiceslength + 1)) / 2;\n const loopStop = Math.min(highestNonZeroCoef, outputOrder);\n for (let d = 0; d <= loopStop; d++) {\n for (i = d; i <= highestNonZeroCoef; i++) {\n reservedIndices.length = 0;\n const tempTerm = calculateCoefficientTerm(\n x,\n zIndices,\n xTable,\n d,\n i,\n reservedIndices\n );\n const dimTwo = Math.floor((i * (1 - i)) / 2) + zIndiceslength * i;\n\n for (let s = 0; s < yStride; s++) {\n const dimOne = Math.floor(s * tmp);\n const coef = coefficients[dimOne + dimTwo];\n result[s + d * yStride] += coef * tempTerm;\n }\n }\n }\n\n return result;\n};\n\nfunction fillCoefficientList(\n coefficients,\n zIndices,\n xTable,\n yTable,\n yStride,\n inputOrder\n) {\n let j;\n let index;\n let highestNonZero = -1;\n const zIndiceslength = zIndices.length;\n const tmp = (zIndiceslength * (zIndiceslength + 1)) / 2;\n\n for (let s = 0; s < yStride; s++) {\n const dimOne = Math.floor(s * tmp);\n\n for (j = 0; j < zIndiceslength; j++) {\n index = zIndices[j] * yStride * (inputOrder + 1) + s;\n coefficients[dimOne + j] = yTable[index];\n }\n\n for (let i = 1; i < zIndiceslength; i++) {\n let coefIndex = 0;\n const dimTwo = Math.floor((i * (1 - i)) / 2) + zIndiceslength * i;\n let nonZeroCoefficients = false;\n\n for (j = 0; j < zIndiceslength - i; j++) {\n const zj = xTable[zIndices[j]];\n const zn = xTable[zIndices[j + i]];\n\n let numerator;\n let coefficient;\n if (zn - zj <= 0) {\n index = zIndices[j] * yStride * (inputOrder + 1) + yStride * i + s;\n numerator = yTable[index];\n coefficient = numerator / CesiumMath.factorial(i);\n coefficients[dimOne + dimTwo + coefIndex] = coefficient;\n coefIndex++;\n } else {\n const dimTwoMinusOne =\n Math.floor(((i - 1) * (2 - i)) / 2) + zIndiceslength * (i - 1);\n numerator =\n coefficients[dimOne + dimTwoMinusOne + j + 1] -\n coefficients[dimOne + dimTwoMinusOne + j];\n coefficient = numerator / (zn - zj);\n coefficients[dimOne + dimTwo + coefIndex] = coefficient;\n coefIndex++;\n }\n nonZeroCoefficients = nonZeroCoefficients || numerator !== 0.0;\n }\n\n if (nonZeroCoefficients) {\n highestNonZero = Math.max(highestNonZero, i);\n }\n }\n }\n\n return highestNonZero;\n}\nexport default HermitePolynomialApproximation;\n", "import defined from \"./defined.js\";\n\n/**\n * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.\n *\n * @namespace LagrangePolynomialApproximation\n */\nconst LagrangePolynomialApproximation = {\n type: \"Lagrange\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n *\n * @param {Number} degree The desired degree of interpolation.\n * @returns {Number} The number of required data points needed for the desired degree of interpolation.\n */\nLagrangePolynomialApproximation.getRequiredDataPoints = function (degree) {\n return Math.max(degree + 1.0, 2);\n};\n\n/**\n * Interpolates values using Lagrange Polynomial Approximation.\n *\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number[]} [result] An existing array into which to store the result.\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nLagrangePolynomialApproximation.interpolateOrderZero = function (\n x,\n xTable,\n yTable,\n yStride,\n result\n) {\n if (!defined(result)) {\n result = new Array(yStride);\n }\n\n let i;\n let j;\n const length = xTable.length;\n\n for (i = 0; i < yStride; i++) {\n result[i] = 0;\n }\n\n for (i = 0; i < length; i++) {\n let coefficient = 1;\n\n for (j = 0; j < length; j++) {\n if (j !== i) {\n const diffX = xTable[i] - xTable[j];\n coefficient *= (x - xTable[j]) / diffX;\n }\n }\n\n for (j = 0; j < yStride; j++) {\n result[j] += coefficient * yTable[i * yStride + j];\n }\n }\n\n return result;\n};\nexport default LagrangePolynomialApproximation;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * An {@link InterpolationAlgorithm} for performing linear interpolation.\n *\n * @namespace LinearApproximation\n */\nconst LinearApproximation = {\n type: \"Linear\",\n};\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n * Since linear interpolation can only generate a first degree polynomial, this function\n * always returns 2.\n * @param {Number} degree The desired degree of interpolation.\n * @returns {Number} This function always returns 2.\n *\n */\nLinearApproximation.getRequiredDataPoints = function (degree) {\n return 2;\n};\n\n/**\n * Interpolates values using linear approximation.\n *\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number[]} [result] An existing array into which to store the result.\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nLinearApproximation.interpolateOrderZero = function (\n x,\n xTable,\n yTable,\n yStride,\n result\n) {\n if (!defined(result)) {\n result = new Array(yStride);\n }\n\n let i;\n let y0;\n let y1;\n const x0 = xTable[0];\n const x1 = xTable[1];\n\n for (i = 0; i < yStride; i++) {\n y0 = yTable[i];\n y1 = yTable[i + yStride];\n result[i] = ((y1 - y0) * x + x1 * y0 - x0 * y1) / (x1 - x0);\n }\n\n return result;\n};\nexport default LinearApproximation;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * A set of curvilinear 3-dimensional coordinates.\n *\n * @alias Spherical\n * @constructor\n *\n * @param {Number} [clock=0.0] The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [cone=0.0] The angular coordinate measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [magnitude=1.0] The linear coordinate measured from the origin.\n */\nfunction Spherical(clock, cone, magnitude) {\n /**\n * The clock component.\n * @type {Number}\n * @default 0.0\n */\n this.clock = defaultValue(clock, 0.0);\n /**\n * The cone component.\n * @type {Number}\n * @default 0.0\n */\n this.cone = defaultValue(cone, 0.0);\n /**\n * The magnitude component.\n * @type {Number}\n * @default 1.0\n */\n this.magnitude = defaultValue(magnitude, 1.0);\n}\n\n/**\n * Converts the provided Cartesian3 into Spherical coordinates.\n *\n * @param {Cartesian3} cartesian3 The Cartesian3 to be converted to Spherical.\n * @param {Spherical} [result] The object in which the result will be stored, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter, or a new instance if one was not provided.\n */\nSpherical.fromCartesian3 = function (cartesian3, result) {\n const x = cartesian3.x;\n const y = cartesian3.y;\n const z = cartesian3.z;\n const radialSquared = x * x + y * y;\n\n if (!defined(result)) {\n result = new Spherical();\n }\n\n result.clock = Math.atan2(y, x);\n result.cone = Math.atan2(Math.sqrt(radialSquared), z);\n result.magnitude = Math.sqrt(radialSquared + z * z);\n return result;\n};\n\n/**\n * Creates a duplicate of a Spherical.\n *\n * @param {Spherical} spherical The spherical to clone.\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)\n */\nSpherical.clone = function (spherical, result) {\n if (!defined(spherical)) {\n return undefined;\n }\n\n if (!defined(result)) {\n return new Spherical(spherical.clock, spherical.cone, spherical.magnitude);\n }\n\n result.clock = spherical.clock;\n result.cone = spherical.cone;\n result.magnitude = spherical.magnitude;\n return result;\n};\n\n/**\n * Computes the normalized version of the provided spherical.\n *\n * @param {Spherical} spherical The spherical to be normalized.\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined.\n */\nSpherical.normalize = function (spherical, result) {\n if (!defined(result)) {\n return new Spherical(spherical.clock, spherical.cone, 1.0);\n }\n\n result.clock = spherical.clock;\n result.cone = spherical.cone;\n result.magnitude = 1.0;\n return result;\n};\n\n/**\n * Returns true if the first spherical is equal to the second spherical, false otherwise.\n *\n * @param {Spherical} left The first Spherical to be compared.\n * @param {Spherical} right The second Spherical to be compared.\n * @returns {Boolean} true if the first spherical is equal to the second spherical, false otherwise.\n */\nSpherical.equals = function (left, right) {\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n left.clock === right.clock &&\n left.cone === right.cone &&\n left.magnitude === right.magnitude)\n );\n};\n\n/**\n * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.\n *\n * @param {Spherical} left The first Spherical to be compared.\n * @param {Spherical} right The second Spherical to be compared.\n * @param {Number} [epsilon=0.0] The epsilon to compare against.\n * @returns {Boolean} true if the first spherical is within the provided epsilon of the second spherical, false otherwise.\n */\nSpherical.equalsEpsilon = function (left, right, epsilon) {\n epsilon = defaultValue(epsilon, 0.0);\n return (\n left === right ||\n (defined(left) &&\n defined(right) &&\n Math.abs(left.clock - right.clock) <= epsilon &&\n Math.abs(left.cone - right.cone) <= epsilon &&\n Math.abs(left.magnitude - right.magnitude) <= epsilon)\n );\n};\n\n/**\n * Returns true if this spherical is equal to the provided spherical, false otherwise.\n *\n * @param {Spherical} other The Spherical to be compared.\n * @returns {Boolean} true if this spherical is equal to the provided spherical, false otherwise.\n */\nSpherical.prototype.equals = function (other) {\n return Spherical.equals(this, other);\n};\n\n/**\n * Creates a duplicate of this Spherical.\n *\n * @param {Spherical} [result] The object to store the result into, if undefined a new instance will be created.\n * @returns {Spherical} The modified result parameter or a new instance if result was undefined.\n */\nSpherical.prototype.clone = function (result) {\n return Spherical.clone(this, result);\n};\n\n/**\n * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.\n *\n * @param {Spherical} other The Spherical to be compared.\n * @param {Number} epsilon The epsilon to compare against.\n * @returns {Boolean} true if this spherical is within the provided epsilon of the provided spherical, false otherwise.\n */\nSpherical.prototype.equalsEpsilon = function (other, epsilon) {\n return Spherical.equalsEpsilon(this, other, epsilon);\n};\n\n/**\n * Returns a string representing this instance in the format (clock, cone, magnitude).\n *\n * @returns {String} A string representing this instance.\n */\nSpherical.prototype.toString = function () {\n return `(${this.clock}, ${this.cone}, ${this.magnitude})`;\n};\nexport default Spherical;\n", "import ArcType from \"../Core/ArcType.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport Color from \"../Core/Color.js\";\nimport CornerType from \"../Core/CornerType.js\";\nimport Credit from \"../Core/Credit.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ExtrapolationType from \"../Core/ExtrapolationType.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport HermitePolynomialApproximation from \"../Core/HermitePolynomialApproximation.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport LagrangePolynomialApproximation from \"../Core/LagrangePolynomialApproximation.js\";\nimport LinearApproximation from \"../Core/LinearApproximation.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Spherical from \"../Core/Spherical.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport ColorBlendMode from \"../Scene/ColorBlendMode.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport Uri from \"urijs\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport BoxGraphics from \"./BoxGraphics.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport CheckerboardMaterialProperty from \"./CheckerboardMaterialProperty.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport CompositeMaterialProperty from \"./CompositeMaterialProperty.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport CompositeProperty from \"./CompositeProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport CorridorGraphics from \"./CorridorGraphics.js\";\nimport CylinderGraphics from \"./CylinderGraphics.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport EllipseGraphics from \"./EllipseGraphics.js\";\nimport EllipsoidGraphics from \"./EllipsoidGraphics.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport GridMaterialProperty from \"./GridMaterialProperty.js\";\nimport ImageMaterialProperty from \"./ImageMaterialProperty.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport NodeTransformationProperty from \"./NodeTransformationProperty.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PointGraphics from \"./PointGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineArrowMaterialProperty from \"./PolylineArrowMaterialProperty.js\";\nimport PolylineDashMaterialProperty from \"./PolylineDashMaterialProperty.js\";\nimport PolylineGlowMaterialProperty from \"./PolylineGlowMaterialProperty.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineOutlineMaterialProperty from \"./PolylineOutlineMaterialProperty.js\";\nimport PolylineVolumeGraphics from \"./PolylineVolumeGraphics.js\";\nimport PositionPropertyArray from \"./PositionPropertyArray.js\";\nimport Property from \"./Property.js\";\nimport PropertyArray from \"./PropertyArray.js\";\nimport PropertyBag from \"./PropertyBag.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport Rotation from \"./Rotation.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport SampledProperty from \"./SampledProperty.js\";\nimport StripeMaterialProperty from \"./StripeMaterialProperty.js\";\nimport StripeOrientation from \"./StripeOrientation.js\";\nimport TimeIntervalCollectionPositionProperty from \"./TimeIntervalCollectionPositionProperty.js\";\nimport TimeIntervalCollectionProperty from \"./TimeIntervalCollectionProperty.js\";\nimport VelocityOrientationProperty from \"./VelocityOrientationProperty.js\";\nimport VelocityVectorProperty from \"./VelocityVectorProperty.js\";\nimport WallGraphics from \"./WallGraphics.js\";\nimport Cesium3DTilesetGraphics from \"./Cesium3DTilesetGraphics.js\";\n\n// A marker type to distinguish CZML properties where we need to end up with a unit vector.\n// The data is still loaded into Cartesian3 objects but they are normalized.\nfunction UnitCartesian3() {}\nUnitCartesian3.packedLength = Cartesian3.packedLength;\nUnitCartesian3.unpack = Cartesian3.unpack;\nUnitCartesian3.pack = Cartesian3.pack;\n\n// As a side note, for the purposes of CZML, Quaternion always indicates a unit quaternion.\n\nlet currentId;\n\nfunction createReferenceProperty(entityCollection, referenceString) {\n if (referenceString[0] === \"#\") {\n referenceString = currentId + referenceString;\n }\n return ReferenceProperty.fromString(entityCollection, referenceString);\n}\n\nfunction createSpecializedProperty(type, entityCollection, packetData) {\n if (defined(packetData.reference)) {\n return createReferenceProperty(entityCollection, packetData.reference);\n }\n\n if (defined(packetData.velocityReference)) {\n const referenceProperty = createReferenceProperty(\n entityCollection,\n packetData.velocityReference\n );\n switch (type) {\n case Cartesian3:\n case UnitCartesian3:\n return new VelocityVectorProperty(\n referenceProperty,\n type === UnitCartesian3\n );\n case Quaternion:\n return new VelocityOrientationProperty(referenceProperty);\n }\n }\n\n throw new RuntimeError(`${JSON.stringify(packetData)} is not valid CZML.`);\n}\n\nfunction createAdapterProperty(property, adapterFunction) {\n return new CallbackProperty(function (time, result) {\n return adapterFunction(property.getValue(time, result));\n }, property.isConstant);\n}\n\nconst scratchCartesian = new Cartesian3();\nconst scratchSpherical = new Spherical();\nconst scratchCartographic = new Cartographic();\nconst scratchTimeInterval = new TimeInterval();\nconst scratchQuaternion = new Quaternion();\n\nfunction unwrapColorInterval(czmlInterval) {\n let rgbaf = czmlInterval.rgbaf;\n if (defined(rgbaf)) {\n return rgbaf;\n }\n\n const rgba = czmlInterval.rgba;\n if (!defined(rgba)) {\n return undefined;\n }\n\n const length = rgba.length;\n if (length === Color.packedLength) {\n return [\n Color.byteToFloat(rgba[0]),\n Color.byteToFloat(rgba[1]),\n Color.byteToFloat(rgba[2]),\n Color.byteToFloat(rgba[3]),\n ];\n }\n\n rgbaf = new Array(length);\n for (let i = 0; i < length; i += 5) {\n rgbaf[i] = rgba[i];\n rgbaf[i + 1] = Color.byteToFloat(rgba[i + 1]);\n rgbaf[i + 2] = Color.byteToFloat(rgba[i + 2]);\n rgbaf[i + 3] = Color.byteToFloat(rgba[i + 3]);\n rgbaf[i + 4] = Color.byteToFloat(rgba[i + 4]);\n }\n return rgbaf;\n}\n\nfunction unwrapUriInterval(czmlInterval, sourceUri) {\n const uri = defaultValue(czmlInterval.uri, czmlInterval);\n if (defined(sourceUri)) {\n return sourceUri.getDerivedResource({\n url: uri,\n });\n }\n\n return Resource.createIfNeeded(uri);\n}\n\nfunction unwrapRectangleInterval(czmlInterval) {\n let wsen = czmlInterval.wsen;\n if (defined(wsen)) {\n return wsen;\n }\n\n const wsenDegrees = czmlInterval.wsenDegrees;\n if (!defined(wsenDegrees)) {\n return undefined;\n }\n\n const length = wsenDegrees.length;\n if (length === Rectangle.packedLength) {\n return [\n CesiumMath.toRadians(wsenDegrees[0]),\n CesiumMath.toRadians(wsenDegrees[1]),\n CesiumMath.toRadians(wsenDegrees[2]),\n CesiumMath.toRadians(wsenDegrees[3]),\n ];\n }\n\n wsen = new Array(length);\n for (let i = 0; i < length; i += 5) {\n wsen[i] = wsenDegrees[i];\n wsen[i + 1] = CesiumMath.toRadians(wsenDegrees[i + 1]);\n wsen[i + 2] = CesiumMath.toRadians(wsenDegrees[i + 2]);\n wsen[i + 3] = CesiumMath.toRadians(wsenDegrees[i + 3]);\n wsen[i + 4] = CesiumMath.toRadians(wsenDegrees[i + 4]);\n }\n return wsen;\n}\n\nfunction convertUnitSphericalToCartesian(unitSpherical) {\n const length = unitSpherical.length;\n scratchSpherical.magnitude = 1.0;\n if (length === 2) {\n scratchSpherical.clock = unitSpherical[0];\n scratchSpherical.cone = unitSpherical[1];\n Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n }\n\n const result = new Array((length / 3) * 4);\n for (let i = 0, j = 0; i < length; i += 3, j += 4) {\n result[j] = unitSpherical[i];\n\n scratchSpherical.clock = unitSpherical[i + 1];\n scratchSpherical.cone = unitSpherical[i + 2];\n Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n\n result[j + 1] = scratchCartesian.x;\n result[j + 2] = scratchCartesian.y;\n result[j + 3] = scratchCartesian.z;\n }\n return result;\n}\n\nfunction convertSphericalToCartesian(spherical) {\n const length = spherical.length;\n if (length === 3) {\n scratchSpherical.clock = spherical[0];\n scratchSpherical.cone = spherical[1];\n scratchSpherical.magnitude = spherical[2];\n Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n }\n\n const result = new Array(length);\n for (let i = 0; i < length; i += 4) {\n result[i] = spherical[i];\n\n scratchSpherical.clock = spherical[i + 1];\n scratchSpherical.cone = spherical[i + 2];\n scratchSpherical.magnitude = spherical[i + 3];\n Cartesian3.fromSpherical(scratchSpherical, scratchCartesian);\n\n result[i + 1] = scratchCartesian.x;\n result[i + 2] = scratchCartesian.y;\n result[i + 3] = scratchCartesian.z;\n }\n return result;\n}\n\nfunction convertCartographicRadiansToCartesian(cartographicRadians) {\n const length = cartographicRadians.length;\n if (length === 3) {\n scratchCartographic.longitude = cartographicRadians[0];\n scratchCartographic.latitude = cartographicRadians[1];\n scratchCartographic.height = cartographicRadians[2];\n Ellipsoid.WGS84.cartographicToCartesian(\n scratchCartographic,\n scratchCartesian\n );\n return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n }\n\n const result = new Array(length);\n for (let i = 0; i < length; i += 4) {\n result[i] = cartographicRadians[i];\n\n scratchCartographic.longitude = cartographicRadians[i + 1];\n scratchCartographic.latitude = cartographicRadians[i + 2];\n scratchCartographic.height = cartographicRadians[i + 3];\n Ellipsoid.WGS84.cartographicToCartesian(\n scratchCartographic,\n scratchCartesian\n );\n\n result[i + 1] = scratchCartesian.x;\n result[i + 2] = scratchCartesian.y;\n result[i + 3] = scratchCartesian.z;\n }\n return result;\n}\n\nfunction convertCartographicDegreesToCartesian(cartographicDegrees) {\n const length = cartographicDegrees.length;\n if (length === 3) {\n scratchCartographic.longitude = CesiumMath.toRadians(\n cartographicDegrees[0]\n );\n scratchCartographic.latitude = CesiumMath.toRadians(cartographicDegrees[1]);\n scratchCartographic.height = cartographicDegrees[2];\n Ellipsoid.WGS84.cartographicToCartesian(\n scratchCartographic,\n scratchCartesian\n );\n return [scratchCartesian.x, scratchCartesian.y, scratchCartesian.z];\n }\n\n const result = new Array(length);\n for (let i = 0; i < length; i += 4) {\n result[i] = cartographicDegrees[i];\n\n scratchCartographic.longitude = CesiumMath.toRadians(\n cartographicDegrees[i + 1]\n );\n scratchCartographic.latitude = CesiumMath.toRadians(\n cartographicDegrees[i + 2]\n );\n scratchCartographic.height = cartographicDegrees[i + 3];\n Ellipsoid.WGS84.cartographicToCartesian(\n scratchCartographic,\n scratchCartesian\n );\n\n result[i + 1] = scratchCartesian.x;\n result[i + 2] = scratchCartesian.y;\n result[i + 3] = scratchCartesian.z;\n }\n return result;\n}\n\nfunction unwrapCartesianInterval(czmlInterval) {\n const cartesian = czmlInterval.cartesian;\n if (defined(cartesian)) {\n return cartesian;\n }\n\n const cartesianVelocity = czmlInterval.cartesianVelocity;\n if (defined(cartesianVelocity)) {\n return cartesianVelocity;\n }\n\n const unitCartesian = czmlInterval.unitCartesian;\n if (defined(unitCartesian)) {\n return unitCartesian;\n }\n\n const unitSpherical = czmlInterval.unitSpherical;\n if (defined(unitSpherical)) {\n return convertUnitSphericalToCartesian(unitSpherical);\n }\n\n const spherical = czmlInterval.spherical;\n if (defined(spherical)) {\n return convertSphericalToCartesian(spherical);\n }\n\n const cartographicRadians = czmlInterval.cartographicRadians;\n if (defined(cartographicRadians)) {\n return convertCartographicRadiansToCartesian(cartographicRadians);\n }\n\n const cartographicDegrees = czmlInterval.cartographicDegrees;\n if (defined(cartographicDegrees)) {\n return convertCartographicDegreesToCartesian(cartographicDegrees);\n }\n\n throw new RuntimeError(\n `${JSON.stringify(czmlInterval)} is not a valid CZML interval.`\n );\n}\n\nfunction normalizePackedCartesianArray(array, startingIndex) {\n Cartesian3.unpack(array, startingIndex, scratchCartesian);\n Cartesian3.normalize(scratchCartesian, scratchCartesian);\n Cartesian3.pack(scratchCartesian, array, startingIndex);\n}\n\nfunction unwrapUnitCartesianInterval(czmlInterval) {\n const cartesian = unwrapCartesianInterval(czmlInterval);\n if (cartesian.length === 3) {\n normalizePackedCartesianArray(cartesian, 0);\n return cartesian;\n }\n\n for (let i = 1; i < cartesian.length; i += 4) {\n normalizePackedCartesianArray(cartesian, i);\n }\n\n return cartesian;\n}\n\nfunction normalizePackedQuaternionArray(array, startingIndex) {\n Quaternion.unpack(array, startingIndex, scratchQuaternion);\n Quaternion.normalize(scratchQuaternion, scratchQuaternion);\n Quaternion.pack(scratchQuaternion, array, startingIndex);\n}\n\nfunction unwrapQuaternionInterval(czmlInterval) {\n const unitQuaternion = czmlInterval.unitQuaternion;\n if (defined(unitQuaternion)) {\n if (unitQuaternion.length === 4) {\n normalizePackedQuaternionArray(unitQuaternion, 0);\n return unitQuaternion;\n }\n\n for (let i = 1; i < unitQuaternion.length; i += 5) {\n normalizePackedQuaternionArray(unitQuaternion, i);\n }\n }\n return unitQuaternion;\n}\n\nfunction getPropertyType(czmlInterval) {\n // The associations in this function need to be kept in sync with the\n // associations in unwrapInterval.\n\n // Intentionally omitted due to conficts in CZML property names:\n // * Image (conflicts with Uri)\n // * Rotation (conflicts with Number)\n //\n // cartesianVelocity is also omitted due to incomplete support for\n // derivative information in CZML properties.\n // (Currently cartesianVelocity is hacked directly into the position processing code)\n if (typeof czmlInterval === \"boolean\") {\n return Boolean;\n } else if (typeof czmlInterval === \"number\") {\n return Number;\n } else if (typeof czmlInterval === \"string\") {\n return String;\n } else if (czmlInterval.hasOwnProperty(\"array\")) {\n return Array;\n } else if (czmlInterval.hasOwnProperty(\"boolean\")) {\n return Boolean;\n } else if (czmlInterval.hasOwnProperty(\"boundingRectangle\")) {\n return BoundingRectangle;\n } else if (czmlInterval.hasOwnProperty(\"cartesian2\")) {\n return Cartesian2;\n } else if (\n czmlInterval.hasOwnProperty(\"cartesian\") ||\n czmlInterval.hasOwnProperty(\"spherical\") ||\n czmlInterval.hasOwnProperty(\"cartographicRadians\") ||\n czmlInterval.hasOwnProperty(\"cartographicDegrees\")\n ) {\n return Cartesian3;\n } else if (\n czmlInterval.hasOwnProperty(\"unitCartesian\") ||\n czmlInterval.hasOwnProperty(\"unitSpherical\")\n ) {\n return UnitCartesian3;\n } else if (\n czmlInterval.hasOwnProperty(\"rgba\") ||\n czmlInterval.hasOwnProperty(\"rgbaf\")\n ) {\n return Color;\n } else if (czmlInterval.hasOwnProperty(\"arcType\")) {\n return ArcType;\n } else if (czmlInterval.hasOwnProperty(\"classificationType\")) {\n return ClassificationType;\n } else if (czmlInterval.hasOwnProperty(\"colorBlendMode\")) {\n return ColorBlendMode;\n } else if (czmlInterval.hasOwnProperty(\"cornerType\")) {\n return CornerType;\n } else if (czmlInterval.hasOwnProperty(\"heightReference\")) {\n return HeightReference;\n } else if (czmlInterval.hasOwnProperty(\"horizontalOrigin\")) {\n return HorizontalOrigin;\n } else if (czmlInterval.hasOwnProperty(\"date\")) {\n return JulianDate;\n } else if (czmlInterval.hasOwnProperty(\"labelStyle\")) {\n return LabelStyle;\n } else if (czmlInterval.hasOwnProperty(\"number\")) {\n return Number;\n } else if (czmlInterval.hasOwnProperty(\"nearFarScalar\")) {\n return NearFarScalar;\n } else if (czmlInterval.hasOwnProperty(\"distanceDisplayCondition\")) {\n return DistanceDisplayCondition;\n } else if (\n czmlInterval.hasOwnProperty(\"object\") ||\n czmlInterval.hasOwnProperty(\"value\")\n ) {\n return Object;\n } else if (czmlInterval.hasOwnProperty(\"unitQuaternion\")) {\n return Quaternion;\n } else if (czmlInterval.hasOwnProperty(\"shadowMode\")) {\n return ShadowMode;\n } else if (czmlInterval.hasOwnProperty(\"string\")) {\n return String;\n } else if (czmlInterval.hasOwnProperty(\"stripeOrientation\")) {\n return StripeOrientation;\n } else if (\n czmlInterval.hasOwnProperty(\"wsen\") ||\n czmlInterval.hasOwnProperty(\"wsenDegrees\")\n ) {\n return Rectangle;\n } else if (czmlInterval.hasOwnProperty(\"uri\")) {\n return Uri;\n } else if (czmlInterval.hasOwnProperty(\"verticalOrigin\")) {\n return VerticalOrigin;\n }\n // fallback case\n return Object;\n}\n\nfunction unwrapInterval(type, czmlInterval, sourceUri) {\n // The associations in this function need to be kept in sync with the\n // associations in getPropertyType\n switch (type) {\n case ArcType:\n return ArcType[defaultValue(czmlInterval.arcType, czmlInterval)];\n case Array:\n return czmlInterval.array;\n case Boolean:\n return defaultValue(czmlInterval[\"boolean\"], czmlInterval);\n case BoundingRectangle:\n return czmlInterval.boundingRectangle;\n case Cartesian2:\n return czmlInterval.cartesian2;\n case Cartesian3:\n return unwrapCartesianInterval(czmlInterval);\n case UnitCartesian3:\n return unwrapUnitCartesianInterval(czmlInterval);\n case Color:\n return unwrapColorInterval(czmlInterval);\n case ClassificationType:\n return ClassificationType[\n defaultValue(czmlInterval.classificationType, czmlInterval)\n ];\n case ColorBlendMode:\n return ColorBlendMode[\n defaultValue(czmlInterval.colorBlendMode, czmlInterval)\n ];\n case CornerType:\n return CornerType[defaultValue(czmlInterval.cornerType, czmlInterval)];\n case HeightReference:\n return HeightReference[\n defaultValue(czmlInterval.heightReference, czmlInterval)\n ];\n case HorizontalOrigin:\n return HorizontalOrigin[\n defaultValue(czmlInterval.horizontalOrigin, czmlInterval)\n ];\n case Image:\n return unwrapUriInterval(czmlInterval, sourceUri);\n case JulianDate:\n return JulianDate.fromIso8601(\n defaultValue(czmlInterval.date, czmlInterval)\n );\n case LabelStyle:\n return LabelStyle[defaultValue(czmlInterval.labelStyle, czmlInterval)];\n case Number:\n return defaultValue(czmlInterval.number, czmlInterval);\n case NearFarScalar:\n return czmlInterval.nearFarScalar;\n case DistanceDisplayCondition:\n return czmlInterval.distanceDisplayCondition;\n case Object:\n return defaultValue(\n defaultValue(czmlInterval.object, czmlInterval.value),\n czmlInterval\n );\n case Quaternion:\n return unwrapQuaternionInterval(czmlInterval);\n case Rotation:\n return defaultValue(czmlInterval.number, czmlInterval);\n case ShadowMode:\n return ShadowMode[\n defaultValue(\n defaultValue(czmlInterval.shadowMode, czmlInterval.shadows),\n czmlInterval\n )\n ];\n case String:\n return defaultValue(czmlInterval.string, czmlInterval);\n case StripeOrientation:\n return StripeOrientation[\n defaultValue(czmlInterval.stripeOrientation, czmlInterval)\n ];\n case Rectangle:\n return unwrapRectangleInterval(czmlInterval);\n case Uri:\n return unwrapUriInterval(czmlInterval, sourceUri);\n case VerticalOrigin:\n return VerticalOrigin[\n defaultValue(czmlInterval.verticalOrigin, czmlInterval)\n ];\n default:\n throw new RuntimeError(type);\n }\n}\n\nconst interpolators = {\n HERMITE: HermitePolynomialApproximation,\n LAGRANGE: LagrangePolynomialApproximation,\n LINEAR: LinearApproximation,\n};\n\nfunction updateInterpolationSettings(packetData, property) {\n const interpolationAlgorithm = packetData.interpolationAlgorithm;\n const interpolationDegree = packetData.interpolationDegree;\n if (defined(interpolationAlgorithm) || defined(interpolationDegree)) {\n property.setInterpolationOptions({\n interpolationAlgorithm: interpolators[interpolationAlgorithm],\n interpolationDegree: interpolationDegree,\n });\n }\n\n const forwardExtrapolationType = packetData.forwardExtrapolationType;\n if (defined(forwardExtrapolationType)) {\n property.forwardExtrapolationType =\n ExtrapolationType[forwardExtrapolationType];\n }\n\n const forwardExtrapolationDuration = packetData.forwardExtrapolationDuration;\n if (defined(forwardExtrapolationDuration)) {\n property.forwardExtrapolationDuration = forwardExtrapolationDuration;\n }\n\n const backwardExtrapolationType = packetData.backwardExtrapolationType;\n if (defined(backwardExtrapolationType)) {\n property.backwardExtrapolationType =\n ExtrapolationType[backwardExtrapolationType];\n }\n\n const backwardExtrapolationDuration =\n packetData.backwardExtrapolationDuration;\n if (defined(backwardExtrapolationDuration)) {\n property.backwardExtrapolationDuration = backwardExtrapolationDuration;\n }\n}\n\nconst iso8601Scratch = {\n iso8601: undefined,\n};\n\nfunction intervalFromString(intervalString) {\n if (!defined(intervalString)) {\n return undefined;\n }\n iso8601Scratch.iso8601 = intervalString;\n return TimeInterval.fromIso8601(iso8601Scratch);\n}\n\nfunction wrapPropertyInInfiniteInterval(property) {\n const interval = Iso8601.MAXIMUM_INTERVAL.clone();\n interval.data = property;\n return interval;\n}\n\nfunction convertPropertyToComposite(property) {\n // Create the composite and add the old property, wrapped in an infinite interval.\n const composite = new CompositeProperty();\n composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n return composite;\n}\n\nfunction convertPositionPropertyToComposite(property) {\n // Create the composite and add the old property, wrapped in an infinite interval.\n const composite = new CompositePositionProperty(property.referenceFrame);\n composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n return composite;\n}\n\nfunction processProperty(\n type,\n object,\n propertyName,\n packetData,\n constrainedInterval,\n sourceUri,\n entityCollection\n) {\n let combinedInterval = intervalFromString(packetData.interval);\n if (defined(constrainedInterval)) {\n if (defined(combinedInterval)) {\n combinedInterval = TimeInterval.intersect(\n combinedInterval,\n constrainedInterval,\n scratchTimeInterval\n );\n } else {\n combinedInterval = constrainedInterval;\n }\n }\n\n let packedLength;\n let unwrappedInterval;\n let unwrappedIntervalLength;\n\n // CZML properties can be defined in many ways. Most ways represent a structure for\n // encoding a single value (number, string, cartesian, etc.) Regardless of the value type,\n // if it encodes a single value it will get loaded into a ConstantProperty eventually.\n // Alternatively, there are ways of defining a property that require specialized\n // client-side representation. Currently, these are ReferenceProperty,\n // and client-side velocity computation properties such as VelocityVectorProperty.\n const isValue =\n !defined(packetData.reference) && !defined(packetData.velocityReference);\n const hasInterval =\n defined(combinedInterval) &&\n !combinedInterval.equals(Iso8601.MAXIMUM_INTERVAL);\n\n if (packetData.delete === true) {\n // If deleting this property for all time, we can simply set to undefined and return.\n if (!hasInterval) {\n object[propertyName] = undefined;\n return;\n }\n\n // Deleting depends on the type of property we have.\n return removePropertyData(object[propertyName], combinedInterval);\n }\n\n let isSampled = false;\n\n if (isValue) {\n unwrappedInterval = unwrapInterval(type, packetData, sourceUri);\n if (!defined(unwrappedInterval)) {\n // not a known value type, bail\n return;\n }\n packedLength = defaultValue(type.packedLength, 1);\n unwrappedIntervalLength = defaultValue(unwrappedInterval.length, 1);\n isSampled =\n !defined(packetData.array) &&\n typeof unwrappedInterval !== \"string\" &&\n unwrappedIntervalLength > packedLength &&\n type !== Object;\n }\n\n // Rotation is a special case because it represents a native type (Number)\n // and therefore does not need to be unpacked when loaded as a constant value.\n const needsUnpacking = typeof type.unpack === \"function\" && type !== Rotation;\n\n // Any time a constant value is assigned, it completely blows away anything else.\n if (!isSampled && !hasInterval) {\n if (isValue) {\n object[propertyName] = new ConstantProperty(\n needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval\n );\n } else {\n object[propertyName] = createSpecializedProperty(\n type,\n entityCollection,\n packetData\n );\n }\n return;\n }\n\n let property = object[propertyName];\n\n let epoch;\n const packetEpoch = packetData.epoch;\n if (defined(packetEpoch)) {\n epoch = JulianDate.fromIso8601(packetEpoch);\n }\n\n // Without an interval, any sampled value is infinite, meaning it completely\n // replaces any non-sampled property that may exist.\n if (isSampled && !hasInterval) {\n if (!(property instanceof SampledProperty)) {\n object[propertyName] = property = new SampledProperty(type);\n }\n property.addSamplesPackedArray(unwrappedInterval, epoch);\n updateInterpolationSettings(packetData, property);\n return;\n }\n\n let interval;\n\n // A constant value with an interval is normally part of a TimeIntervalCollection,\n // However, if the current property is not a time-interval collection, we need\n // to turn it into a Composite, preserving the old data with the new interval.\n if (!isSampled && hasInterval) {\n // Create a new interval for the constant value.\n combinedInterval = combinedInterval.clone();\n if (isValue) {\n combinedInterval.data = needsUnpacking\n ? type.unpack(unwrappedInterval, 0)\n : unwrappedInterval;\n } else {\n combinedInterval.data = createSpecializedProperty(\n type,\n entityCollection,\n packetData\n );\n }\n\n // If no property exists, simply use a new interval collection\n if (!defined(property)) {\n object[propertyName] = property = isValue\n ? new TimeIntervalCollectionProperty()\n : new CompositeProperty();\n }\n\n if (isValue && property instanceof TimeIntervalCollectionProperty) {\n // If we created a collection, or it already was one, use it.\n property.intervals.addInterval(combinedInterval);\n } else if (property instanceof CompositeProperty) {\n // If the collection was already a CompositeProperty, use it.\n if (isValue) {\n combinedInterval.data = new ConstantProperty(combinedInterval.data);\n }\n property.intervals.addInterval(combinedInterval);\n } else {\n // Otherwise, create a CompositeProperty but preserve the existing data.\n object[propertyName] = property = convertPropertyToComposite(property);\n\n // Change the new data to a ConstantProperty and add it.\n if (isValue) {\n combinedInterval.data = new ConstantProperty(combinedInterval.data);\n }\n property.intervals.addInterval(combinedInterval);\n }\n\n return;\n }\n\n // isSampled && hasInterval\n if (!defined(property)) {\n object[propertyName] = property = new CompositeProperty();\n }\n\n // Create a CompositeProperty but preserve the existing data.\n if (!(property instanceof CompositeProperty)) {\n object[propertyName] = property = convertPropertyToComposite(property);\n }\n\n // Check if the interval already exists in the composite.\n const intervals = property.intervals;\n interval = intervals.findInterval(combinedInterval);\n if (!defined(interval) || !(interval.data instanceof SampledProperty)) {\n // If not, create a SampledProperty for it.\n interval = combinedInterval.clone();\n interval.data = new SampledProperty(type);\n intervals.addInterval(interval);\n }\n interval.data.addSamplesPackedArray(unwrappedInterval, epoch);\n updateInterpolationSettings(packetData, interval.data);\n}\n\nfunction removePropertyData(property, interval) {\n if (property instanceof SampledProperty) {\n property.removeSamples(interval);\n return;\n } else if (property instanceof TimeIntervalCollectionProperty) {\n property.intervals.removeInterval(interval);\n return;\n } else if (property instanceof CompositeProperty) {\n const intervals = property.intervals;\n for (let i = 0; i < intervals.length; ++i) {\n const intersection = TimeInterval.intersect(\n intervals.get(i),\n interval,\n scratchTimeInterval\n );\n if (!intersection.isEmpty) {\n // remove data from the contained properties\n removePropertyData(intersection.data, interval);\n }\n }\n // remove the intervals from the composite\n intervals.removeInterval(interval);\n return;\n }\n}\n\nfunction processPacketData(\n type,\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, len = packetData.length; i < len; ++i) {\n processProperty(\n type,\n object,\n propertyName,\n packetData[i],\n interval,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processProperty(\n type,\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processPositionProperty(\n object,\n propertyName,\n packetData,\n constrainedInterval,\n sourceUri,\n entityCollection\n) {\n let combinedInterval = intervalFromString(packetData.interval);\n if (defined(constrainedInterval)) {\n if (defined(combinedInterval)) {\n combinedInterval = TimeInterval.intersect(\n combinedInterval,\n constrainedInterval,\n scratchTimeInterval\n );\n } else {\n combinedInterval = constrainedInterval;\n }\n }\n\n const numberOfDerivatives = defined(packetData.cartesianVelocity) ? 1 : 0;\n const packedLength = Cartesian3.packedLength * (numberOfDerivatives + 1);\n let unwrappedInterval;\n let unwrappedIntervalLength;\n const isValue = !defined(packetData.reference);\n const hasInterval =\n defined(combinedInterval) &&\n !combinedInterval.equals(Iso8601.MAXIMUM_INTERVAL);\n\n if (packetData.delete === true) {\n // If deleting this property for all time, we can simply set to undefined and return.\n if (!hasInterval) {\n object[propertyName] = undefined;\n return;\n }\n\n // Deleting depends on the type of property we have.\n return removePositionPropertyData(object[propertyName], combinedInterval);\n }\n\n let referenceFrame;\n let isSampled = false;\n\n if (isValue) {\n if (defined(packetData.referenceFrame)) {\n referenceFrame = ReferenceFrame[packetData.referenceFrame];\n }\n referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n unwrappedInterval = unwrapCartesianInterval(packetData);\n unwrappedIntervalLength = defaultValue(unwrappedInterval.length, 1);\n isSampled = unwrappedIntervalLength > packedLength;\n }\n\n // Any time a constant value is assigned, it completely blows away anything else.\n if (!isSampled && !hasInterval) {\n if (isValue) {\n object[propertyName] = new ConstantPositionProperty(\n Cartesian3.unpack(unwrappedInterval),\n referenceFrame\n );\n } else {\n object[propertyName] = createReferenceProperty(\n entityCollection,\n packetData.reference\n );\n }\n return;\n }\n\n let property = object[propertyName];\n\n let epoch;\n const packetEpoch = packetData.epoch;\n if (defined(packetEpoch)) {\n epoch = JulianDate.fromIso8601(packetEpoch);\n }\n\n // Without an interval, any sampled value is infinite, meaning it completely\n // replaces any non-sampled property that may exist.\n if (isSampled && !hasInterval) {\n if (\n !(property instanceof SampledPositionProperty) ||\n (defined(referenceFrame) && property.referenceFrame !== referenceFrame)\n ) {\n object[propertyName] = property = new SampledPositionProperty(\n referenceFrame,\n numberOfDerivatives\n );\n }\n property.addSamplesPackedArray(unwrappedInterval, epoch);\n updateInterpolationSettings(packetData, property);\n return;\n }\n\n let interval;\n\n // A constant value with an interval is normally part of a TimeIntervalCollection,\n // However, if the current property is not a time-interval collection, we need\n // to turn it into a Composite, preserving the old data with the new interval.\n if (!isSampled && hasInterval) {\n // Create a new interval for the constant value.\n combinedInterval = combinedInterval.clone();\n if (isValue) {\n combinedInterval.data = Cartesian3.unpack(unwrappedInterval);\n } else {\n combinedInterval.data = createReferenceProperty(\n entityCollection,\n packetData.reference\n );\n }\n\n // If no property exists, simply use a new interval collection\n if (!defined(property)) {\n if (isValue) {\n property = new TimeIntervalCollectionPositionProperty(referenceFrame);\n } else {\n property = new CompositePositionProperty(referenceFrame);\n }\n object[propertyName] = property;\n }\n\n if (\n isValue &&\n property instanceof TimeIntervalCollectionPositionProperty &&\n defined(referenceFrame) &&\n property.referenceFrame === referenceFrame\n ) {\n // If we create a collection, or it already existed, use it.\n property.intervals.addInterval(combinedInterval);\n } else if (property instanceof CompositePositionProperty) {\n // If the collection was already a CompositePositionProperty, use it.\n if (isValue) {\n combinedInterval.data = new ConstantPositionProperty(\n combinedInterval.data,\n referenceFrame\n );\n }\n property.intervals.addInterval(combinedInterval);\n } else {\n // Otherwise, create a CompositePositionProperty but preserve the existing data.\n object[propertyName] = property = convertPositionPropertyToComposite(\n property\n );\n\n // Change the new data to a ConstantPositionProperty and add it.\n if (isValue) {\n combinedInterval.data = new ConstantPositionProperty(\n combinedInterval.data,\n referenceFrame\n );\n }\n property.intervals.addInterval(combinedInterval);\n }\n\n return;\n }\n\n // isSampled && hasInterval\n if (!defined(property)) {\n object[propertyName] = property = new CompositePositionProperty(\n referenceFrame\n );\n } else if (!(property instanceof CompositePositionProperty)) {\n // Create a CompositeProperty but preserve the existing data.\n object[propertyName] = property = convertPositionPropertyToComposite(\n property\n );\n }\n\n // Check if the interval already exists in the composite.\n const intervals = property.intervals;\n interval = intervals.findInterval(combinedInterval);\n if (\n !defined(interval) ||\n !(interval.data instanceof SampledPositionProperty) ||\n (defined(referenceFrame) && interval.data.referenceFrame !== referenceFrame)\n ) {\n // If not, create a SampledPositionProperty for it.\n interval = combinedInterval.clone();\n interval.data = new SampledPositionProperty(\n referenceFrame,\n numberOfDerivatives\n );\n intervals.addInterval(interval);\n }\n interval.data.addSamplesPackedArray(unwrappedInterval, epoch);\n updateInterpolationSettings(packetData, interval.data);\n}\n\nfunction removePositionPropertyData(property, interval) {\n if (property instanceof SampledPositionProperty) {\n property.removeSamples(interval);\n return;\n } else if (property instanceof TimeIntervalCollectionPositionProperty) {\n property.intervals.removeInterval(interval);\n return;\n } else if (property instanceof CompositePositionProperty) {\n const intervals = property.intervals;\n for (let i = 0; i < intervals.length; ++i) {\n const intersection = TimeInterval.intersect(\n intervals.get(i),\n interval,\n scratchTimeInterval\n );\n if (!intersection.isEmpty) {\n // remove data from the contained properties\n removePositionPropertyData(intersection.data, interval);\n }\n }\n // remove the intervals from the composite\n intervals.removeInterval(interval);\n return;\n }\n}\n\nfunction processPositionPacketData(\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, len = packetData.length; i < len; ++i) {\n processPositionProperty(\n object,\n propertyName,\n packetData[i],\n interval,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processPositionProperty(\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processShapePacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n if (defined(packetData.references)) {\n processReferencesArrayPacketData(\n object,\n propertyName,\n packetData.references,\n packetData.interval,\n entityCollection,\n PropertyArray,\n CompositeProperty\n );\n } else {\n if (defined(packetData.cartesian2)) {\n packetData.array = Cartesian2.unpackArray(packetData.cartesian2);\n } else if (defined(packetData.cartesian)) {\n // for backwards compatibility, also accept `cartesian`\n packetData.array = Cartesian2.unpackArray(packetData.cartesian);\n }\n\n if (defined(packetData.array)) {\n processPacketData(\n Array,\n object,\n propertyName,\n packetData,\n undefined,\n undefined,\n entityCollection\n );\n }\n }\n}\n\nfunction processMaterialProperty(\n object,\n propertyName,\n packetData,\n constrainedInterval,\n sourceUri,\n entityCollection\n) {\n let combinedInterval = intervalFromString(packetData.interval);\n if (defined(constrainedInterval)) {\n if (defined(combinedInterval)) {\n combinedInterval = TimeInterval.intersect(\n combinedInterval,\n constrainedInterval,\n scratchTimeInterval\n );\n } else {\n combinedInterval = constrainedInterval;\n }\n }\n\n let property = object[propertyName];\n let existingMaterial;\n let existingInterval;\n\n if (defined(combinedInterval)) {\n if (!(property instanceof CompositeMaterialProperty)) {\n property = new CompositeMaterialProperty();\n object[propertyName] = property;\n }\n //See if we already have data at that interval.\n const thisIntervals = property.intervals;\n existingInterval = thisIntervals.findInterval({\n start: combinedInterval.start,\n stop: combinedInterval.stop,\n });\n if (defined(existingInterval)) {\n //We have an interval, but we need to make sure the\n //new data is the same type of material as the old data.\n existingMaterial = existingInterval.data;\n } else {\n //If not, create it.\n existingInterval = combinedInterval.clone();\n thisIntervals.addInterval(existingInterval);\n }\n } else {\n existingMaterial = property;\n }\n\n let materialData;\n if (defined(packetData.solidColor)) {\n if (!(existingMaterial instanceof ColorMaterialProperty)) {\n existingMaterial = new ColorMaterialProperty();\n }\n materialData = packetData.solidColor;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n undefined,\n entityCollection\n );\n } else if (defined(packetData.grid)) {\n if (!(existingMaterial instanceof GridMaterialProperty)) {\n existingMaterial = new GridMaterialProperty();\n }\n materialData = packetData.grid;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"cellAlpha\",\n materialData.cellAlpha,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n existingMaterial,\n \"lineCount\",\n materialData.lineCount,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n existingMaterial,\n \"lineThickness\",\n materialData.lineThickness,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n existingMaterial,\n \"lineOffset\",\n materialData.lineOffset,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.image)) {\n if (!(existingMaterial instanceof ImageMaterialProperty)) {\n existingMaterial = new ImageMaterialProperty();\n }\n materialData = packetData.image;\n processPacketData(\n Image,\n existingMaterial,\n \"image\",\n materialData.image,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n existingMaterial,\n \"repeat\",\n materialData.repeat,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n existingMaterial,\n \"transparent\",\n materialData.transparent,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.stripe)) {\n if (!(existingMaterial instanceof StripeMaterialProperty)) {\n existingMaterial = new StripeMaterialProperty();\n }\n materialData = packetData.stripe;\n processPacketData(\n StripeOrientation,\n existingMaterial,\n \"orientation\",\n materialData.orientation,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"evenColor\",\n materialData.evenColor,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"oddColor\",\n materialData.oddColor,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"offset\",\n materialData.offset,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"repeat\",\n materialData.repeat,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.polylineOutline)) {\n if (!(existingMaterial instanceof PolylineOutlineMaterialProperty)) {\n existingMaterial = new PolylineOutlineMaterialProperty();\n }\n materialData = packetData.polylineOutline;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"outlineColor\",\n materialData.outlineColor,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"outlineWidth\",\n materialData.outlineWidth,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.polylineGlow)) {\n if (!(existingMaterial instanceof PolylineGlowMaterialProperty)) {\n existingMaterial = new PolylineGlowMaterialProperty();\n }\n materialData = packetData.polylineGlow;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"glowPower\",\n materialData.glowPower,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"taperPower\",\n materialData.taperPower,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.polylineArrow)) {\n if (!(existingMaterial instanceof PolylineArrowMaterialProperty)) {\n existingMaterial = new PolylineArrowMaterialProperty();\n }\n materialData = packetData.polylineArrow;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n undefined,\n entityCollection\n );\n } else if (defined(packetData.polylineDash)) {\n if (!(existingMaterial instanceof PolylineDashMaterialProperty)) {\n existingMaterial = new PolylineDashMaterialProperty();\n }\n materialData = packetData.polylineDash;\n processPacketData(\n Color,\n existingMaterial,\n \"color\",\n materialData.color,\n undefined,\n undefined,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"gapColor\",\n materialData.gapColor,\n undefined,\n undefined,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"dashLength\",\n materialData.dashLength,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n existingMaterial,\n \"dashPattern\",\n materialData.dashPattern,\n undefined,\n sourceUri,\n entityCollection\n );\n } else if (defined(packetData.checkerboard)) {\n if (!(existingMaterial instanceof CheckerboardMaterialProperty)) {\n existingMaterial = new CheckerboardMaterialProperty();\n }\n materialData = packetData.checkerboard;\n processPacketData(\n Color,\n existingMaterial,\n \"evenColor\",\n materialData.evenColor,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n existingMaterial,\n \"oddColor\",\n materialData.oddColor,\n undefined,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n existingMaterial,\n \"repeat\",\n materialData.repeat,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n\n if (defined(existingInterval)) {\n existingInterval.data = existingMaterial;\n } else {\n object[propertyName] = existingMaterial;\n }\n}\n\nfunction processMaterialPacketData(\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, len = packetData.length; i < len; ++i) {\n processMaterialProperty(\n object,\n propertyName,\n packetData[i],\n interval,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processMaterialProperty(\n object,\n propertyName,\n packetData,\n interval,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processName(entity, packet, entityCollection, sourceUri) {\n const nameData = packet.name;\n if (defined(nameData)) {\n entity.name = packet.name;\n }\n}\n\nfunction processDescription(entity, packet, entityCollection, sourceUri) {\n const descriptionData = packet.description;\n if (defined(descriptionData)) {\n processPacketData(\n String,\n entity,\n \"description\",\n descriptionData,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processPosition(entity, packet, entityCollection, sourceUri) {\n const positionData = packet.position;\n if (defined(positionData)) {\n processPositionPacketData(\n entity,\n \"position\",\n positionData,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processViewFrom(entity, packet, entityCollection, sourceUri) {\n const viewFromData = packet.viewFrom;\n if (defined(viewFromData)) {\n processPacketData(\n Cartesian3,\n entity,\n \"viewFrom\",\n viewFromData,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processOrientation(entity, packet, entityCollection, sourceUri) {\n const orientationData = packet.orientation;\n if (defined(orientationData)) {\n processPacketData(\n Quaternion,\n entity,\n \"orientation\",\n orientationData,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processProperties(entity, packet, entityCollection, sourceUri) {\n const propertiesData = packet.properties;\n if (defined(propertiesData)) {\n if (!defined(entity.properties)) {\n entity.properties = new PropertyBag();\n }\n\n // We cannot simply call processPacketData(entity, 'properties', propertyData, undefined, sourceUri, entityCollection)\n // because each property of \"properties\" may vary separately.\n // The properties will be accessible as entity.properties.myprop.getValue(time).\n\n for (const key in propertiesData) {\n if (propertiesData.hasOwnProperty(key)) {\n if (!entity.properties.hasProperty(key)) {\n entity.properties.addProperty(key);\n }\n\n const propertyData = propertiesData[key];\n if (Array.isArray(propertyData)) {\n for (let i = 0, len = propertyData.length; i < len; ++i) {\n processProperty(\n getPropertyType(propertyData[i]),\n entity.properties,\n key,\n propertyData[i],\n undefined,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processProperty(\n getPropertyType(propertyData),\n entity.properties,\n key,\n propertyData,\n undefined,\n sourceUri,\n entityCollection\n );\n }\n }\n }\n }\n}\n\nfunction processReferencesArrayPacketData(\n object,\n propertyName,\n references,\n interval,\n entityCollection,\n PropertyArrayType,\n CompositePropertyArrayType\n) {\n const properties = references.map(function (reference) {\n return createReferenceProperty(entityCollection, reference);\n });\n\n if (defined(interval)) {\n interval = intervalFromString(interval);\n let property = object[propertyName];\n if (!(property instanceof CompositePropertyArrayType)) {\n // If the property was not already a CompositeProperty,\n // create a CompositeProperty but preserve the existing data.\n\n // Create the composite and add the old property, wrapped in an infinite interval.\n const composite = new CompositePropertyArrayType();\n composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));\n\n object[propertyName] = property = composite;\n }\n\n interval.data = new PropertyArrayType(properties);\n property.intervals.addInterval(interval);\n } else {\n object[propertyName] = new PropertyArrayType(properties);\n }\n}\n\nfunction processArrayPacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n const references = packetData.references;\n if (defined(references)) {\n processReferencesArrayPacketData(\n object,\n propertyName,\n references,\n packetData.interval,\n entityCollection,\n PropertyArray,\n CompositeProperty\n );\n } else {\n processPacketData(\n Array,\n object,\n propertyName,\n packetData,\n undefined,\n undefined,\n entityCollection\n );\n }\n}\n\nfunction processArray(object, propertyName, packetData, entityCollection) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, length = packetData.length; i < length; ++i) {\n processArrayPacketData(\n object,\n propertyName,\n packetData[i],\n entityCollection\n );\n }\n } else {\n processArrayPacketData(object, propertyName, packetData, entityCollection);\n }\n}\n\nfunction processPositionArrayPacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n const references = packetData.references;\n if (defined(references)) {\n processReferencesArrayPacketData(\n object,\n propertyName,\n references,\n packetData.interval,\n entityCollection,\n PositionPropertyArray,\n CompositePositionProperty\n );\n } else {\n if (defined(packetData.cartesian)) {\n packetData.array = Cartesian3.unpackArray(packetData.cartesian);\n } else if (defined(packetData.cartographicRadians)) {\n packetData.array = Cartesian3.fromRadiansArrayHeights(\n packetData.cartographicRadians\n );\n } else if (defined(packetData.cartographicDegrees)) {\n packetData.array = Cartesian3.fromDegreesArrayHeights(\n packetData.cartographicDegrees\n );\n }\n\n if (defined(packetData.array)) {\n processPacketData(\n Array,\n object,\n propertyName,\n packetData,\n undefined,\n undefined,\n entityCollection\n );\n }\n }\n}\n\nfunction processPositionArray(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, length = packetData.length; i < length; ++i) {\n processPositionArrayPacketData(\n object,\n propertyName,\n packetData[i],\n entityCollection\n );\n }\n } else {\n processPositionArrayPacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n );\n }\n}\n\nfunction unpackCartesianArray(array) {\n return Cartesian3.unpackArray(array);\n}\n\nfunction unpackCartographicRadiansArray(array) {\n return Cartesian3.fromRadiansArrayHeights(array);\n}\n\nfunction unpackCartographicDegreesArray(array) {\n return Cartesian3.fromDegreesArrayHeights(array);\n}\n\nfunction processPositionArrayOfArraysPacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n const references = packetData.references;\n if (defined(references)) {\n const properties = references.map(function (referenceArray) {\n const tempObj = {};\n processReferencesArrayPacketData(\n tempObj,\n \"positions\",\n referenceArray,\n packetData.interval,\n entityCollection,\n PositionPropertyArray,\n CompositePositionProperty\n );\n return tempObj.positions;\n });\n object[propertyName] = new PositionPropertyArray(properties);\n } else {\n if (defined(packetData.cartesian)) {\n packetData.array = packetData.cartesian.map(unpackCartesianArray);\n } else if (defined(packetData.cartographicRadians)) {\n packetData.array = packetData.cartographicRadians.map(\n unpackCartographicRadiansArray\n );\n } else if (defined(packetData.cartographicDegrees)) {\n packetData.array = packetData.cartographicDegrees.map(\n unpackCartographicDegreesArray\n );\n }\n\n if (defined(packetData.array)) {\n processPacketData(\n Array,\n object,\n propertyName,\n packetData,\n undefined,\n undefined,\n entityCollection\n );\n }\n }\n}\n\nfunction processPositionArrayOfArrays(\n object,\n propertyName,\n packetData,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, length = packetData.length; i < length; ++i) {\n processPositionArrayOfArraysPacketData(\n object,\n propertyName,\n packetData[i],\n entityCollection\n );\n }\n } else {\n processPositionArrayOfArraysPacketData(\n object,\n propertyName,\n packetData,\n entityCollection\n );\n }\n}\n\nfunction processShape(object, propertyName, packetData, entityCollection) {\n if (!defined(packetData)) {\n return;\n }\n\n if (Array.isArray(packetData)) {\n for (let i = 0, length = packetData.length; i < length; i++) {\n processShapePacketData(\n object,\n propertyName,\n packetData[i],\n entityCollection\n );\n }\n } else {\n processShapePacketData(object, propertyName, packetData, entityCollection);\n }\n}\n\nfunction processAvailability(entity, packet, entityCollection, sourceUri) {\n const packetData = packet.availability;\n if (!defined(packetData)) {\n return;\n }\n\n let intervals;\n if (Array.isArray(packetData)) {\n for (let i = 0, len = packetData.length; i < len; ++i) {\n if (!defined(intervals)) {\n intervals = new TimeIntervalCollection();\n }\n intervals.addInterval(intervalFromString(packetData[i]));\n }\n } else {\n intervals = new TimeIntervalCollection();\n intervals.addInterval(intervalFromString(packetData));\n }\n entity.availability = intervals;\n}\n\nfunction processAlignedAxis(\n billboard,\n packetData,\n interval,\n sourceUri,\n entityCollection\n) {\n if (!defined(packetData)) {\n return;\n }\n\n processPacketData(\n UnitCartesian3,\n billboard,\n \"alignedAxis\",\n packetData,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processBillboard(entity, packet, entityCollection, sourceUri) {\n const billboardData = packet.billboard;\n if (!defined(billboardData)) {\n return;\n }\n\n const interval = intervalFromString(billboardData.interval);\n let billboard = entity.billboard;\n if (!defined(billboard)) {\n entity.billboard = billboard = new BillboardGraphics();\n }\n\n processPacketData(\n Boolean,\n billboard,\n \"show\",\n billboardData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Image,\n billboard,\n \"image\",\n billboardData.image,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n billboard,\n \"scale\",\n billboardData.scale,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n billboard,\n \"pixelOffset\",\n billboardData.pixelOffset,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n billboard,\n \"eyeOffset\",\n billboardData.eyeOffset,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HorizontalOrigin,\n billboard,\n \"horizontalOrigin\",\n billboardData.horizontalOrigin,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n VerticalOrigin,\n billboard,\n \"verticalOrigin\",\n billboardData.verticalOrigin,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n billboard,\n \"heightReference\",\n billboardData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n billboard,\n \"color\",\n billboardData.color,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n billboard,\n \"rotation\",\n billboardData.rotation,\n interval,\n sourceUri,\n entityCollection\n );\n processAlignedAxis(\n billboard,\n billboardData.alignedAxis,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n billboard,\n \"sizeInMeters\",\n billboardData.sizeInMeters,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n billboard,\n \"width\",\n billboardData.width,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n billboard,\n \"height\",\n billboardData.height,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n billboard,\n \"scaleByDistance\",\n billboardData.scaleByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n billboard,\n \"translucencyByDistance\",\n billboardData.translucencyByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n billboard,\n \"pixelOffsetScaleByDistance\",\n billboardData.pixelOffsetScaleByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n BoundingRectangle,\n billboard,\n \"imageSubRegion\",\n billboardData.imageSubRegion,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n billboard,\n \"distanceDisplayCondition\",\n billboardData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n billboard,\n \"disableDepthTestDistance\",\n billboardData.disableDepthTestDistance,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processBox(entity, packet, entityCollection, sourceUri) {\n const boxData = packet.box;\n if (!defined(boxData)) {\n return;\n }\n\n const interval = intervalFromString(boxData.interval);\n let box = entity.box;\n if (!defined(box)) {\n entity.box = box = new BoxGraphics();\n }\n\n processPacketData(\n Boolean,\n box,\n \"show\",\n boxData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n box,\n \"dimensions\",\n boxData.dimensions,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n box,\n \"heightReference\",\n boxData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n box,\n \"fill\",\n boxData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n box,\n \"material\",\n boxData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n box,\n \"outline\",\n boxData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n box,\n \"outlineColor\",\n boxData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n box,\n \"outlineWidth\",\n boxData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n box,\n \"shadows\",\n boxData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n box,\n \"distanceDisplayCondition\",\n boxData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processCorridor(entity, packet, entityCollection, sourceUri) {\n const corridorData = packet.corridor;\n if (!defined(corridorData)) {\n return;\n }\n\n const interval = intervalFromString(corridorData.interval);\n let corridor = entity.corridor;\n if (!defined(corridor)) {\n entity.corridor = corridor = new CorridorGraphics();\n }\n\n processPacketData(\n Boolean,\n corridor,\n \"show\",\n corridorData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPositionArray(\n corridor,\n \"positions\",\n corridorData.positions,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"width\",\n corridorData.width,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"height\",\n corridorData.height,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n corridor,\n \"heightReference\",\n corridorData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"extrudedHeight\",\n corridorData.extrudedHeight,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n corridor,\n \"extrudedHeightReference\",\n corridorData.extrudedHeightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n CornerType,\n corridor,\n \"cornerType\",\n corridorData.cornerType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"granularity\",\n corridorData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n corridor,\n \"fill\",\n corridorData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n corridor,\n \"material\",\n corridorData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n corridor,\n \"outline\",\n corridorData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n corridor,\n \"outlineColor\",\n corridorData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"outlineWidth\",\n corridorData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n corridor,\n \"shadows\",\n corridorData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n corridor,\n \"distanceDisplayCondition\",\n corridorData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ClassificationType,\n corridor,\n \"classificationType\",\n corridorData.classificationType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n corridor,\n \"zIndex\",\n corridorData.zIndex,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processCylinder(entity, packet, entityCollection, sourceUri) {\n const cylinderData = packet.cylinder;\n if (!defined(cylinderData)) {\n return;\n }\n\n const interval = intervalFromString(cylinderData.interval);\n let cylinder = entity.cylinder;\n if (!defined(cylinder)) {\n entity.cylinder = cylinder = new CylinderGraphics();\n }\n\n processPacketData(\n Boolean,\n cylinder,\n \"show\",\n cylinderData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"length\",\n cylinderData.length,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"topRadius\",\n cylinderData.topRadius,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"bottomRadius\",\n cylinderData.bottomRadius,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n cylinder,\n \"heightReference\",\n cylinderData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n cylinder,\n \"fill\",\n cylinderData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n cylinder,\n \"material\",\n cylinderData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n cylinder,\n \"outline\",\n cylinderData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n cylinder,\n \"outlineColor\",\n cylinderData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"outlineWidth\",\n cylinderData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"numberOfVerticalLines\",\n cylinderData.numberOfVerticalLines,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n cylinder,\n \"slices\",\n cylinderData.slices,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n cylinder,\n \"shadows\",\n cylinderData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n cylinder,\n \"distanceDisplayCondition\",\n cylinderData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processDocument(packet, dataSource) {\n const version = packet.version;\n if (defined(version)) {\n if (typeof version === \"string\") {\n const tokens = version.split(\".\");\n if (tokens.length === 2) {\n if (tokens[0] !== \"1\") {\n throw new RuntimeError(\"Cesium only supports CZML version 1.\");\n }\n dataSource._version = version;\n }\n }\n }\n\n if (!defined(dataSource._version)) {\n throw new RuntimeError(\n \"CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.\"\n );\n }\n\n const documentPacket = dataSource._documentPacket;\n\n if (defined(packet.name)) {\n documentPacket.name = packet.name;\n }\n\n const clockPacket = packet.clock;\n if (defined(clockPacket)) {\n const clock = documentPacket.clock;\n if (!defined(clock)) {\n documentPacket.clock = {\n interval: clockPacket.interval,\n currentTime: clockPacket.currentTime,\n range: clockPacket.range,\n step: clockPacket.step,\n multiplier: clockPacket.multiplier,\n };\n } else {\n clock.interval = defaultValue(clockPacket.interval, clock.interval);\n clock.currentTime = defaultValue(\n clockPacket.currentTime,\n clock.currentTime\n );\n clock.range = defaultValue(clockPacket.range, clock.range);\n clock.step = defaultValue(clockPacket.step, clock.step);\n clock.multiplier = defaultValue(clockPacket.multiplier, clock.multiplier);\n }\n }\n}\n\nfunction processEllipse(entity, packet, entityCollection, sourceUri) {\n const ellipseData = packet.ellipse;\n if (!defined(ellipseData)) {\n return;\n }\n\n const interval = intervalFromString(ellipseData.interval);\n let ellipse = entity.ellipse;\n if (!defined(ellipse)) {\n entity.ellipse = ellipse = new EllipseGraphics();\n }\n\n processPacketData(\n Boolean,\n ellipse,\n \"show\",\n ellipseData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"semiMajorAxis\",\n ellipseData.semiMajorAxis,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"semiMinorAxis\",\n ellipseData.semiMinorAxis,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"height\",\n ellipseData.height,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n ellipse,\n \"heightReference\",\n ellipseData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"extrudedHeight\",\n ellipseData.extrudedHeight,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n ellipse,\n \"extrudedHeightReference\",\n ellipseData.extrudedHeightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n ellipse,\n \"rotation\",\n ellipseData.rotation,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n ellipse,\n \"stRotation\",\n ellipseData.stRotation,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"granularity\",\n ellipseData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n ellipse,\n \"fill\",\n ellipseData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n ellipse,\n \"material\",\n ellipseData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n ellipse,\n \"outline\",\n ellipseData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n ellipse,\n \"outlineColor\",\n ellipseData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"outlineWidth\",\n ellipseData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"numberOfVerticalLines\",\n ellipseData.numberOfVerticalLines,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n ellipse,\n \"shadows\",\n ellipseData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n ellipse,\n \"distanceDisplayCondition\",\n ellipseData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ClassificationType,\n ellipse,\n \"classificationType\",\n ellipseData.classificationType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipse,\n \"zIndex\",\n ellipseData.zIndex,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processEllipsoid(entity, packet, entityCollection, sourceUri) {\n const ellipsoidData = packet.ellipsoid;\n if (!defined(ellipsoidData)) {\n return;\n }\n\n const interval = intervalFromString(ellipsoidData.interval);\n let ellipsoid = entity.ellipsoid;\n if (!defined(ellipsoid)) {\n entity.ellipsoid = ellipsoid = new EllipsoidGraphics();\n }\n\n processPacketData(\n Boolean,\n ellipsoid,\n \"show\",\n ellipsoidData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n ellipsoid,\n \"radii\",\n ellipsoidData.radii,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n ellipsoid,\n \"innerRadii\",\n ellipsoidData.innerRadii,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"minimumClock\",\n ellipsoidData.minimumClock,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"maximumClock\",\n ellipsoidData.maximumClock,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"minimumCone\",\n ellipsoidData.minimumCone,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"maximumCone\",\n ellipsoidData.maximumCone,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n ellipsoid,\n \"heightReference\",\n ellipsoidData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n ellipsoid,\n \"fill\",\n ellipsoidData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n ellipsoid,\n \"material\",\n ellipsoidData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n ellipsoid,\n \"outline\",\n ellipsoidData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n ellipsoid,\n \"outlineColor\",\n ellipsoidData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"outlineWidth\",\n ellipsoidData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"stackPartitions\",\n ellipsoidData.stackPartitions,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"slicePartitions\",\n ellipsoidData.slicePartitions,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n ellipsoid,\n \"subdivisions\",\n ellipsoidData.subdivisions,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n ellipsoid,\n \"shadows\",\n ellipsoidData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n ellipsoid,\n \"distanceDisplayCondition\",\n ellipsoidData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processLabel(entity, packet, entityCollection, sourceUri) {\n const labelData = packet.label;\n if (!defined(labelData)) {\n return;\n }\n\n const interval = intervalFromString(labelData.interval);\n let label = entity.label;\n if (!defined(label)) {\n entity.label = label = new LabelGraphics();\n }\n\n processPacketData(\n Boolean,\n label,\n \"show\",\n labelData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n String,\n label,\n \"text\",\n labelData.text,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n String,\n label,\n \"font\",\n labelData.font,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n LabelStyle,\n label,\n \"style\",\n labelData.style,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n label,\n \"scale\",\n labelData.scale,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n label,\n \"showBackground\",\n labelData.showBackground,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n label,\n \"backgroundColor\",\n labelData.backgroundColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n label,\n \"backgroundPadding\",\n labelData.backgroundPadding,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian2,\n label,\n \"pixelOffset\",\n labelData.pixelOffset,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n label,\n \"eyeOffset\",\n labelData.eyeOffset,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HorizontalOrigin,\n label,\n \"horizontalOrigin\",\n labelData.horizontalOrigin,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n VerticalOrigin,\n label,\n \"verticalOrigin\",\n labelData.verticalOrigin,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n label,\n \"heightReference\",\n labelData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n label,\n \"fillColor\",\n labelData.fillColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n label,\n \"outlineColor\",\n labelData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n label,\n \"outlineWidth\",\n labelData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n label,\n \"translucencyByDistance\",\n labelData.translucencyByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n label,\n \"pixelOffsetScaleByDistance\",\n labelData.pixelOffsetScaleByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n label,\n \"scaleByDistance\",\n labelData.scaleByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n label,\n \"distanceDisplayCondition\",\n labelData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n label,\n \"disableDepthTestDistance\",\n labelData.disableDepthTestDistance,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processModel(entity, packet, entityCollection, sourceUri) {\n const modelData = packet.model;\n if (!defined(modelData)) {\n return;\n }\n\n const interval = intervalFromString(modelData.interval);\n let model = entity.model;\n if (!defined(model)) {\n entity.model = model = new ModelGraphics();\n }\n\n processPacketData(\n Boolean,\n model,\n \"show\",\n modelData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Uri,\n model,\n \"uri\",\n modelData.gltf,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n model,\n \"scale\",\n modelData.scale,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n model,\n \"minimumPixelSize\",\n modelData.minimumPixelSize,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n model,\n \"maximumScale\",\n modelData.maximumScale,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n model,\n \"incrementallyLoadTextures\",\n modelData.incrementallyLoadTextures,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n model,\n \"runAnimations\",\n modelData.runAnimations,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n model,\n \"clampAnimations\",\n modelData.clampAnimations,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n model,\n \"shadows\",\n modelData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n model,\n \"heightReference\",\n modelData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n model,\n \"silhouetteColor\",\n modelData.silhouetteColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n model,\n \"silhouetteSize\",\n modelData.silhouetteSize,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n model,\n \"color\",\n modelData.color,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ColorBlendMode,\n model,\n \"colorBlendMode\",\n modelData.colorBlendMode,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n model,\n \"colorBlendAmount\",\n modelData.colorBlendAmount,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n model,\n \"distanceDisplayCondition\",\n modelData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n\n let i, len;\n const nodeTransformationsData = modelData.nodeTransformations;\n if (defined(nodeTransformationsData)) {\n if (Array.isArray(nodeTransformationsData)) {\n for (i = 0, len = nodeTransformationsData.length; i < len; ++i) {\n processNodeTransformations(\n model,\n nodeTransformationsData[i],\n interval,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processNodeTransformations(\n model,\n nodeTransformationsData,\n interval,\n sourceUri,\n entityCollection\n );\n }\n }\n\n const articulationsData = modelData.articulations;\n if (defined(articulationsData)) {\n if (Array.isArray(articulationsData)) {\n for (i = 0, len = articulationsData.length; i < len; ++i) {\n processArticulations(\n model,\n articulationsData[i],\n interval,\n sourceUri,\n entityCollection\n );\n }\n } else {\n processArticulations(\n model,\n articulationsData,\n interval,\n sourceUri,\n entityCollection\n );\n }\n }\n}\n\nfunction processNodeTransformations(\n model,\n nodeTransformationsData,\n constrainedInterval,\n sourceUri,\n entityCollection\n) {\n let combinedInterval = intervalFromString(nodeTransformationsData.interval);\n if (defined(constrainedInterval)) {\n if (defined(combinedInterval)) {\n combinedInterval = TimeInterval.intersect(\n combinedInterval,\n constrainedInterval,\n scratchTimeInterval\n );\n } else {\n combinedInterval = constrainedInterval;\n }\n }\n\n let nodeTransformations = model.nodeTransformations;\n const nodeNames = Object.keys(nodeTransformationsData);\n for (let i = 0, len = nodeNames.length; i < len; ++i) {\n const nodeName = nodeNames[i];\n if (nodeName === \"interval\") {\n continue;\n }\n\n const nodeTransformationData = nodeTransformationsData[nodeName];\n if (!defined(nodeTransformationData)) {\n continue;\n }\n\n if (!defined(nodeTransformations)) {\n model.nodeTransformations = nodeTransformations = new PropertyBag();\n }\n\n if (!nodeTransformations.hasProperty(nodeName)) {\n nodeTransformations.addProperty(nodeName);\n }\n\n let nodeTransformation = nodeTransformations[nodeName];\n if (!defined(nodeTransformation)) {\n nodeTransformations[\n nodeName\n ] = nodeTransformation = new NodeTransformationProperty();\n }\n\n processPacketData(\n Cartesian3,\n nodeTransformation,\n \"translation\",\n nodeTransformationData.translation,\n combinedInterval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Quaternion,\n nodeTransformation,\n \"rotation\",\n nodeTransformationData.rotation,\n combinedInterval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Cartesian3,\n nodeTransformation,\n \"scale\",\n nodeTransformationData.scale,\n combinedInterval,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processArticulations(\n model,\n articulationsData,\n constrainedInterval,\n sourceUri,\n entityCollection\n) {\n let combinedInterval = intervalFromString(articulationsData.interval);\n if (defined(constrainedInterval)) {\n if (defined(combinedInterval)) {\n combinedInterval = TimeInterval.intersect(\n combinedInterval,\n constrainedInterval,\n scratchTimeInterval\n );\n } else {\n combinedInterval = constrainedInterval;\n }\n }\n\n let articulations = model.articulations;\n const keys = Object.keys(articulationsData);\n for (let i = 0, len = keys.length; i < len; ++i) {\n const key = keys[i];\n if (key === \"interval\") {\n continue;\n }\n\n const articulationStageData = articulationsData[key];\n if (!defined(articulationStageData)) {\n continue;\n }\n\n if (!defined(articulations)) {\n model.articulations = articulations = new PropertyBag();\n }\n\n if (!articulations.hasProperty(key)) {\n articulations.addProperty(key);\n }\n\n processPacketData(\n Number,\n articulations,\n key,\n articulationStageData,\n combinedInterval,\n sourceUri,\n entityCollection\n );\n }\n}\n\nfunction processPath(entity, packet, entityCollection, sourceUri) {\n const pathData = packet.path;\n if (!defined(pathData)) {\n return;\n }\n\n const interval = intervalFromString(pathData.interval);\n let path = entity.path;\n if (!defined(path)) {\n entity.path = path = new PathGraphics();\n }\n\n processPacketData(\n Boolean,\n path,\n \"show\",\n pathData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n path,\n \"leadTime\",\n pathData.leadTime,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n path,\n \"trailTime\",\n pathData.trailTime,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n path,\n \"width\",\n pathData.width,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n path,\n \"resolution\",\n pathData.resolution,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n path,\n \"material\",\n pathData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n path,\n \"distanceDisplayCondition\",\n pathData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processPoint(entity, packet, entityCollection, sourceUri) {\n const pointData = packet.point;\n if (!defined(pointData)) {\n return;\n }\n\n const interval = intervalFromString(pointData.interval);\n let point = entity.point;\n if (!defined(point)) {\n entity.point = point = new PointGraphics();\n }\n\n processPacketData(\n Boolean,\n point,\n \"show\",\n pointData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n point,\n \"pixelSize\",\n pointData.pixelSize,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n point,\n \"heightReference\",\n pointData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n point,\n \"color\",\n pointData.color,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n point,\n \"outlineColor\",\n pointData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n point,\n \"outlineWidth\",\n pointData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n point,\n \"scaleByDistance\",\n pointData.scaleByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n NearFarScalar,\n point,\n \"translucencyByDistance\",\n pointData.translucencyByDistance,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n point,\n \"distanceDisplayCondition\",\n pointData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n point,\n \"disableDepthTestDistance\",\n pointData.disableDepthTestDistance,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction PolygonHierarchyProperty(polygon) {\n this.polygon = polygon;\n this._definitionChanged = new Event();\n}\n\nObject.defineProperties(PolygonHierarchyProperty.prototype, {\n isConstant: {\n get: function () {\n const positions = this.polygon._positions;\n const holes = this.polygon._holes;\n return (\n (!defined(positions) || positions.isConstant) &&\n (!defined(holes) || holes.isConstant)\n );\n },\n },\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\nPolygonHierarchyProperty.prototype.getValue = function (time, result) {\n let positions;\n if (defined(this.polygon._positions)) {\n positions = this.polygon._positions.getValue(time);\n }\n\n let holes;\n if (defined(this.polygon._holes)) {\n holes = this.polygon._holes.getValue(time);\n if (defined(holes)) {\n holes = holes.map(function (holePositions) {\n return new PolygonHierarchy(holePositions);\n });\n }\n }\n\n if (!defined(result)) {\n return new PolygonHierarchy(positions, holes);\n }\n\n result.positions = positions;\n result.holes = holes;\n return result;\n};\n\nPolygonHierarchyProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof PolygonHierarchyProperty &&\n Property.equals(this.polygon._positions, other.polygon._positions) &&\n Property.equals(this.polygon._holes, other.polygon._holes))\n );\n};\n\nfunction processPolygon(entity, packet, entityCollection, sourceUri) {\n const polygonData = packet.polygon;\n if (!defined(polygonData)) {\n return;\n }\n\n const interval = intervalFromString(polygonData.interval);\n let polygon = entity.polygon;\n if (!defined(polygon)) {\n entity.polygon = polygon = new PolygonGraphics();\n }\n\n processPacketData(\n Boolean,\n polygon,\n \"show\",\n polygonData.show,\n interval,\n sourceUri,\n entityCollection\n );\n\n // adapt 'position' property producing Cartesian[]\n // and 'holes' property producing Cartesian[][]\n // to a single property producing PolygonHierarchy\n processPositionArray(\n polygon,\n \"_positions\",\n polygonData.positions,\n entityCollection\n );\n processPositionArrayOfArrays(\n polygon,\n \"_holes\",\n polygonData.holes,\n entityCollection\n );\n if (defined(polygon._positions) || defined(polygon._holes)) {\n polygon.hierarchy = new PolygonHierarchyProperty(polygon);\n }\n\n processPacketData(\n Number,\n polygon,\n \"height\",\n polygonData.height,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n polygon,\n \"heightReference\",\n polygonData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polygon,\n \"extrudedHeight\",\n polygonData.extrudedHeight,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n polygon,\n \"extrudedHeightReference\",\n polygonData.extrudedHeightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n polygon,\n \"stRotation\",\n polygonData.stRotation,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polygon,\n \"granularity\",\n polygonData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polygon,\n \"fill\",\n polygonData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n polygon,\n \"material\",\n polygonData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polygon,\n \"outline\",\n polygonData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n polygon,\n \"outlineColor\",\n polygonData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polygon,\n \"outlineWidth\",\n polygonData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polygon,\n \"perPositionHeight\",\n polygonData.perPositionHeight,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polygon,\n \"closeTop\",\n polygonData.closeTop,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polygon,\n \"closeBottom\",\n polygonData.closeBottom,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ArcType,\n polygon,\n \"arcType\",\n polygonData.arcType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n polygon,\n \"shadows\",\n polygonData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n polygon,\n \"distanceDisplayCondition\",\n polygonData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ClassificationType,\n polygon,\n \"classificationType\",\n polygonData.classificationType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polygon,\n \"zIndex\",\n polygonData.zIndex,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction adaptFollowSurfaceToArcType(followSurface) {\n return followSurface ? ArcType.GEODESIC : ArcType.NONE;\n}\n\nfunction processPolyline(entity, packet, entityCollection, sourceUri) {\n const polylineData = packet.polyline;\n if (!defined(polylineData)) {\n return;\n }\n\n const interval = intervalFromString(polylineData.interval);\n let polyline = entity.polyline;\n if (!defined(polyline)) {\n entity.polyline = polyline = new PolylineGraphics();\n }\n\n processPacketData(\n Boolean,\n polyline,\n \"show\",\n polylineData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPositionArray(\n polyline,\n \"positions\",\n polylineData.positions,\n entityCollection\n );\n processPacketData(\n Number,\n polyline,\n \"width\",\n polylineData.width,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polyline,\n \"granularity\",\n polylineData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n polyline,\n \"material\",\n polylineData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n polyline,\n \"depthFailMaterial\",\n polylineData.depthFailMaterial,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ArcType,\n polyline,\n \"arcType\",\n polylineData.arcType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polyline,\n \"clampToGround\",\n polylineData.clampToGround,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n polyline,\n \"shadows\",\n polylineData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n polyline,\n \"distanceDisplayCondition\",\n polylineData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ClassificationType,\n polyline,\n \"classificationType\",\n polylineData.classificationType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polyline,\n \"zIndex\",\n polylineData.zIndex,\n interval,\n sourceUri,\n entityCollection\n );\n\n // for backwards compatibility, adapt CZML followSurface to arcType.\n if (defined(polylineData.followSurface) && !defined(polylineData.arcType)) {\n const tempObj = {};\n processPacketData(\n Boolean,\n tempObj,\n \"followSurface\",\n polylineData.followSurface,\n interval,\n sourceUri,\n entityCollection\n );\n polyline.arcType = createAdapterProperty(\n tempObj.followSurface,\n adaptFollowSurfaceToArcType\n );\n }\n}\n\nfunction processPolylineVolume(entity, packet, entityCollection, sourceUri) {\n const polylineVolumeData = packet.polylineVolume;\n if (!defined(polylineVolumeData)) {\n return;\n }\n\n const interval = intervalFromString(polylineVolumeData.interval);\n let polylineVolume = entity.polylineVolume;\n if (!defined(polylineVolume)) {\n entity.polylineVolume = polylineVolume = new PolylineVolumeGraphics();\n }\n\n processPositionArray(\n polylineVolume,\n \"positions\",\n polylineVolumeData.positions,\n entityCollection\n );\n processShape(\n polylineVolume,\n \"shape\",\n polylineVolumeData.shape,\n entityCollection\n );\n processPacketData(\n Boolean,\n polylineVolume,\n \"show\",\n polylineVolumeData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n CornerType,\n polylineVolume,\n \"cornerType\",\n polylineVolumeData.cornerType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polylineVolume,\n \"fill\",\n polylineVolumeData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n polylineVolume,\n \"material\",\n polylineVolumeData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n polylineVolume,\n \"outline\",\n polylineVolumeData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n polylineVolume,\n \"outlineColor\",\n polylineVolumeData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polylineVolume,\n \"outlineWidth\",\n polylineVolumeData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n polylineVolume,\n \"granularity\",\n polylineVolumeData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n polylineVolume,\n \"shadows\",\n polylineVolumeData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n polylineVolume,\n \"distanceDisplayCondition\",\n polylineVolumeData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processRectangle(entity, packet, entityCollection, sourceUri) {\n const rectangleData = packet.rectangle;\n if (!defined(rectangleData)) {\n return;\n }\n\n const interval = intervalFromString(rectangleData.interval);\n let rectangle = entity.rectangle;\n if (!defined(rectangle)) {\n entity.rectangle = rectangle = new RectangleGraphics();\n }\n\n processPacketData(\n Boolean,\n rectangle,\n \"show\",\n rectangleData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rectangle,\n rectangle,\n \"coordinates\",\n rectangleData.coordinates,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n rectangle,\n \"height\",\n rectangleData.height,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n rectangle,\n \"heightReference\",\n rectangleData.heightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n rectangle,\n \"extrudedHeight\",\n rectangleData.extrudedHeight,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n HeightReference,\n rectangle,\n \"extrudedHeightReference\",\n rectangleData.extrudedHeightReference,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n rectangle,\n \"rotation\",\n rectangleData.rotation,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Rotation,\n rectangle,\n \"stRotation\",\n rectangleData.stRotation,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n rectangle,\n \"granularity\",\n rectangleData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n rectangle,\n \"fill\",\n rectangleData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n rectangle,\n \"material\",\n rectangleData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n rectangle,\n \"outline\",\n rectangleData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n rectangle,\n \"outlineColor\",\n rectangleData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n rectangle,\n \"outlineWidth\",\n rectangleData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n rectangle,\n \"shadows\",\n rectangleData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n rectangle,\n \"distanceDisplayCondition\",\n rectangleData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ClassificationType,\n rectangle,\n \"classificationType\",\n rectangleData.classificationType,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n rectangle,\n \"zIndex\",\n rectangleData.zIndex,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processTileset(entity, packet, entityCollection, sourceUri) {\n const tilesetData = packet.tileset;\n if (!defined(tilesetData)) {\n return;\n }\n\n const interval = intervalFromString(tilesetData.interval);\n let tileset = entity.tileset;\n if (!defined(tileset)) {\n entity.tileset = tileset = new Cesium3DTilesetGraphics();\n }\n\n processPacketData(\n Boolean,\n tileset,\n \"show\",\n tilesetData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Uri,\n tileset,\n \"uri\",\n tilesetData.uri,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n tileset,\n \"maximumScreenSpaceError\",\n tilesetData.maximumScreenSpaceError,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processWall(entity, packet, entityCollection, sourceUri) {\n const wallData = packet.wall;\n if (!defined(wallData)) {\n return;\n }\n\n const interval = intervalFromString(wallData.interval);\n let wall = entity.wall;\n if (!defined(wall)) {\n entity.wall = wall = new WallGraphics();\n }\n\n processPacketData(\n Boolean,\n wall,\n \"show\",\n wallData.show,\n interval,\n sourceUri,\n entityCollection\n );\n processPositionArray(wall, \"positions\", wallData.positions, entityCollection);\n processArray(\n wall,\n \"minimumHeights\",\n wallData.minimumHeights,\n entityCollection\n );\n processArray(\n wall,\n \"maximumHeights\",\n wallData.maximumHeights,\n entityCollection\n );\n processPacketData(\n Number,\n wall,\n \"granularity\",\n wallData.granularity,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n wall,\n \"fill\",\n wallData.fill,\n interval,\n sourceUri,\n entityCollection\n );\n processMaterialPacketData(\n wall,\n \"material\",\n wallData.material,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Boolean,\n wall,\n \"outline\",\n wallData.outline,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Color,\n wall,\n \"outlineColor\",\n wallData.outlineColor,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n Number,\n wall,\n \"outlineWidth\",\n wallData.outlineWidth,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n ShadowMode,\n wall,\n \"shadows\",\n wallData.shadows,\n interval,\n sourceUri,\n entityCollection\n );\n processPacketData(\n DistanceDisplayCondition,\n wall,\n \"distanceDisplayCondition\",\n wallData.distanceDisplayCondition,\n interval,\n sourceUri,\n entityCollection\n );\n}\n\nfunction processCzmlPacket(\n packet,\n entityCollection,\n updaterFunctions,\n sourceUri,\n dataSource\n) {\n let objectId = packet.id;\n if (!defined(objectId)) {\n objectId = createGuid();\n }\n\n currentId = objectId;\n\n if (!defined(dataSource._version) && objectId !== \"document\") {\n throw new RuntimeError(\n \"The first CZML packet is required to be the document object.\"\n );\n }\n\n if (packet[\"delete\"] === true) {\n entityCollection.removeById(objectId);\n } else if (objectId === \"document\") {\n processDocument(packet, dataSource);\n } else {\n const entity = entityCollection.getOrCreateEntity(objectId);\n\n const parentId = packet.parent;\n if (defined(parentId)) {\n entity.parent = entityCollection.getOrCreateEntity(parentId);\n }\n\n for (let i = updaterFunctions.length - 1; i > -1; i--) {\n updaterFunctions[i](entity, packet, entityCollection, sourceUri);\n }\n }\n\n currentId = undefined;\n}\n\nfunction updateClock(dataSource) {\n let clock;\n const clockPacket = dataSource._documentPacket.clock;\n if (!defined(clockPacket)) {\n if (!defined(dataSource._clock)) {\n const availability = dataSource._entityCollection.computeAvailability();\n if (!availability.start.equals(Iso8601.MINIMUM_VALUE)) {\n const startTime = availability.start;\n const stopTime = availability.stop;\n const totalSeconds = JulianDate.secondsDifference(stopTime, startTime);\n const multiplier = Math.round(totalSeconds / 120.0);\n\n clock = new DataSourceClock();\n clock.startTime = JulianDate.clone(startTime);\n clock.stopTime = JulianDate.clone(stopTime);\n clock.clockRange = ClockRange.LOOP_STOP;\n clock.multiplier = multiplier;\n clock.currentTime = JulianDate.clone(startTime);\n clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n dataSource._clock = clock;\n return true;\n }\n }\n return false;\n }\n\n if (defined(dataSource._clock)) {\n clock = dataSource._clock.clone();\n } else {\n clock = new DataSourceClock();\n clock.startTime = Iso8601.MINIMUM_VALUE.clone();\n clock.stopTime = Iso8601.MAXIMUM_VALUE.clone();\n clock.currentTime = Iso8601.MINIMUM_VALUE.clone();\n clock.clockRange = ClockRange.LOOP_STOP;\n clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n clock.multiplier = 1.0;\n }\n\n const interval = intervalFromString(clockPacket.interval);\n if (defined(interval)) {\n clock.startTime = interval.start;\n clock.stopTime = interval.stop;\n }\n\n if (defined(clockPacket.currentTime)) {\n clock.currentTime = JulianDate.fromIso8601(clockPacket.currentTime);\n }\n if (defined(clockPacket.range)) {\n clock.clockRange = defaultValue(\n ClockRange[clockPacket.range],\n ClockRange.LOOP_STOP\n );\n }\n if (defined(clockPacket.step)) {\n clock.clockStep = defaultValue(\n ClockStep[clockPacket.step],\n ClockStep.SYSTEM_CLOCK_MULTIPLIER\n );\n }\n if (defined(clockPacket.multiplier)) {\n clock.multiplier = clockPacket.multiplier;\n }\n\n if (!clock.equals(dataSource._clock)) {\n dataSource._clock = clock.clone(dataSource._clock);\n return true;\n }\n\n return false;\n}\n\nfunction load(dataSource, czml, options, clear) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let promise = czml;\n let sourceUri = options.sourceUri;\n\n // User specified credit\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n dataSource._credit = credit;\n\n // If the czml is a URL\n if (typeof czml === \"string\" || czml instanceof Resource) {\n czml = Resource.createIfNeeded(czml);\n promise = czml.fetchJson();\n sourceUri = defaultValue(sourceUri, czml.clone());\n\n // Add resource credits to our list of credits to display\n const resourceCredits = dataSource._resourceCredits;\n const credits = czml.credits;\n if (defined(credits)) {\n const length = credits.length;\n for (let i = 0; i < length; i++) {\n resourceCredits.push(credits[i]);\n }\n }\n }\n\n sourceUri = Resource.createIfNeeded(sourceUri);\n\n DataSource.setLoading(dataSource, true);\n\n return Promise.resolve(promise)\n .then(function (czml) {\n return loadCzml(dataSource, czml, sourceUri, clear);\n })\n .catch(function (error) {\n DataSource.setLoading(dataSource, false);\n dataSource._error.raiseEvent(dataSource, error);\n console.log(error);\n return Promise.reject(error);\n });\n}\n\nfunction loadCzml(dataSource, czml, sourceUri, clear) {\n DataSource.setLoading(dataSource, true);\n const entityCollection = dataSource._entityCollection;\n\n if (clear) {\n dataSource._version = undefined;\n dataSource._documentPacket = new DocumentPacket();\n entityCollection.removeAll();\n }\n\n CzmlDataSource._processCzml(\n czml,\n entityCollection,\n sourceUri,\n undefined,\n dataSource\n );\n\n let raiseChangedEvent = updateClock(dataSource);\n\n const documentPacket = dataSource._documentPacket;\n if (\n defined(documentPacket.name) &&\n dataSource._name !== documentPacket.name\n ) {\n dataSource._name = documentPacket.name;\n raiseChangedEvent = true;\n } else if (!defined(dataSource._name) && defined(sourceUri)) {\n dataSource._name = getFilenameFromUri(sourceUri.getUrlComponent());\n raiseChangedEvent = true;\n }\n\n DataSource.setLoading(dataSource, false);\n if (raiseChangedEvent) {\n dataSource._changed.raiseEvent(dataSource);\n }\n\n return dataSource;\n}\n\nfunction DocumentPacket() {\n this.name = undefined;\n this.clock = undefined;\n}\n\n/**\n * @typedef {Object} CzmlDataSource.LoadOptions\n *\n * Initialization options for the <code>load</code> method.\n *\n * @property {Resource|string} [sourceUri] Overrides the url to use for resolving relative links.\n * @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.\n * @alias CzmlDataSource\n * @constructor\n *\n * @param {String} [name] An optional name for the data source. This value will be overwritten if a loaded document contains a name.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=CZML.html|Cesium Sandcastle CZML Demo}\n */\nfunction CzmlDataSource(name) {\n this._name = name;\n this._changed = new Event();\n this._error = new Event();\n this._isLoading = false;\n this._loading = new Event();\n this._clock = undefined;\n this._documentPacket = new DocumentPacket();\n this._version = undefined;\n this._entityCollection = new EntityCollection(this);\n this._entityCluster = new EntityCluster();\n this._credit = undefined;\n this._resourceCredits = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided CZML data.\n *\n * @param {Resource|String|Object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<CzmlDataSource>} A promise that resolves to the new instance once the data is processed.\n */\nCzmlDataSource.load = function (czml, options) {\n return new CzmlDataSource().load(czml, options);\n};\n\nObject.defineProperties(CzmlDataSource.prototype, {\n /**\n * Gets a human-readable name for this instance.\n * @memberof CzmlDataSource.prototype\n * @type {String}\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * Gets the clock settings defined by the loaded CZML. If no clock is explicitly\n * defined in the CZML, the combined availability of all objects is returned. If\n * only static data exists, this value is undefined.\n * @memberof CzmlDataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof CzmlDataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: function () {\n return this._entityCollection;\n },\n },\n /**\n * Gets a value indicating if the data source is currently loading data.\n * @memberof CzmlDataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: function () {\n return this._isLoading;\n },\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof CzmlDataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: function () {\n return this._changed;\n },\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof CzmlDataSource.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._error;\n },\n },\n /**\n * Gets an event that will be raised when the data source either starts or stops loading.\n * @memberof CzmlDataSource.prototype\n * @type {Event}\n */\n loadingEvent: {\n get: function () {\n return this._loading;\n },\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof CzmlDataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._entityCollection.show;\n },\n set: function (value) {\n this._entityCollection.show = value;\n },\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof CzmlDataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: function () {\n return this._entityCluster;\n },\n set: function (value) {\nthis._entityCluster = value;\n },\n },\n /**\n * Gets the credit that will be displayed for the data source\n * @memberof CzmlDataSource.prototype\n * @type {Credit}\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n});\n\n/**\n * @callback CzmlDataSource.UpdaterFunction\n *\n * A CZML processing function that adds or updates entities in the provided\n * collection based on the provided CZML packet.\n *\n * @param {Entity} entity\n * @param {Object} packet\n * @param {EntityCollection} entityCollection\n * @param {string} sourceUri\n */\n\n/**\n * Gets the array of CZML processing functions.\n * @memberof CzmlDataSource\n * @type {Array.<CzmlDataSource.UpdaterFunction>}\n */\nCzmlDataSource.updaters = [\n processBillboard, //\n processBox, //\n processCorridor, //\n processCylinder, //\n processEllipse, //\n processEllipsoid, //\n processLabel, //\n processModel, //\n processName, //\n processDescription, //\n processPath, //\n processPoint, //\n processPolygon, //\n processPolyline, //\n processPolylineVolume, //\n processProperties, //\n processRectangle, //\n processPosition, //\n processTileset, //\n processViewFrom, //\n processWall, //\n processOrientation, //\n processAvailability,\n];\n\n/**\n * Processes the provided url or CZML object without clearing any existing data.\n *\n * @param {Resource|String|Object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<CzmlDataSource>} A promise that resolves to this instances once the data is processed.\n */\nCzmlDataSource.prototype.process = function (czml, options) {\n return load(this, czml, options, false);\n};\n\n/**\n * Loads the provided url or CZML object, replacing any existing data.\n *\n * @param {Resource|String|Object} czml A url or CZML object to be processed.\n * @param {CzmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<CzmlDataSource>} A promise that resolves to this instances once the data is processed.\n */\nCzmlDataSource.prototype.load = function (czml, options) {\n return load(this, czml, options, true);\n};\n\n/**\n * Updates the data source to the provided time. This function is optional and\n * is not required to be implemented. It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nCzmlDataSource.prototype.update = function (time) {\n return true;\n};\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link Property} from a CZML packet.\n * @function\n *\n * @param {Function} type The constructor function for the property being processed.\n * @param {Object} object The object on which the property will be added or updated.\n * @param {String} propertyName The name of the property on the object.\n * @param {Object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {String} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processPacketData = processPacketData;\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link PositionProperty} from a CZML packet.\n * @function\n *\n * @param {Object} object The object on which the property will be added or updated.\n * @param {String} propertyName The name of the property on the object.\n * @param {Object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {String} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processPositionPacketData = processPositionPacketData;\n\n/**\n * A helper function used by custom CZML updater functions\n * which creates or updates a {@link MaterialProperty} from a CZML packet.\n * @function\n *\n * @param {Object} object The object on which the property will be added or updated.\n * @param {String} propertyName The name of the property on the object.\n * @param {Object} packetData The CZML packet being processed.\n * @param {TimeInterval} interval A constraining interval for which the data is valid.\n * @param {String} sourceUri The originating uri of the data being processed.\n * @param {EntityCollection} entityCollection The collection being processsed.\n */\nCzmlDataSource.processMaterialPacketData = processMaterialPacketData;\n\nCzmlDataSource._processCzml = function (\n czml,\n entityCollection,\n sourceUri,\n updaterFunctions,\n dataSource\n) {\n updaterFunctions = defaultValue(updaterFunctions, CzmlDataSource.updaters);\n\n if (Array.isArray(czml)) {\n for (let i = 0, len = czml.length; i < len; ++i) {\n processCzmlPacket(\n czml[i],\n entityCollection,\n updaterFunctions,\n sourceUri,\n dataSource\n );\n }\n } else {\n processCzmlPacket(\n czml,\n entityCollection,\n updaterFunctions,\n sourceUri,\n dataSource\n );\n }\n};\nexport default CzmlDataSource;\n", "/**\n * Gets a timestamp that can be used in measuring the time between events. Timestamps\n * are expressed in milliseconds, but it is not specified what the milliseconds are\n * measured from. This function uses performance.now() if it is available, or Date.now()\n * otherwise.\n *\n * @function getTimestamp\n *\n * @returns {Number} The timestamp in milliseconds since some unspecified reference time.\n */\nlet getTimestamp;\n\nif (\n typeof performance !== \"undefined\" &&\n typeof performance.now === \"function\" &&\n isFinite(performance.now())\n) {\n getTimestamp = function () {\n return performance.now();\n };\n} else {\n getTimestamp = function () {\n return Date.now();\n };\n}\nexport default getTimestamp;\n", "import ClockRange from \"./ClockRange.js\";\nimport ClockStep from \"./ClockStep.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport getTimestamp from \"./getTimestamp.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * A simple clock for keeping track of simulated time.\n *\n * @alias Clock\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {JulianDate} [options.startTime] The start time of the clock.\n * @param {JulianDate} [options.stopTime] The stop time of the clock.\n * @param {JulianDate} [options.currentTime] The current time.\n * @param {Number} [options.multiplier=1.0] Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.\n * @param {ClockStep} [options.clockStep=ClockStep.SYSTEM_CLOCK_MULTIPLIER] Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.\n * @param {ClockRange} [options.clockRange=ClockRange.UNBOUNDED] Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.\n * @param {Boolean} [options.canAnimate=true] Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, for example. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n * @param {Boolean} [options.shouldAnimate=false] Indicates whether {@link Clock#tick} should attempt to advance time. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n *\n * @exception {DeveloperError} startTime must come before stopTime.\n *\n *\n * @example\n * // Create a clock that loops on Christmas day 2013 and runs in real-time.\n * const clock = new Cesium.Clock({\n * startTime : Cesium.JulianDate.fromIso8601(\"2013-12-25\"),\n * currentTime : Cesium.JulianDate.fromIso8601(\"2013-12-25\"),\n * stopTime : Cesium.JulianDate.fromIso8601(\"2013-12-26\"),\n * clockRange : Cesium.ClockRange.LOOP_STOP,\n * clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER\n * });\n *\n * @see ClockStep\n * @see ClockRange\n * @see JulianDate\n */\nfunction Clock(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let currentTime = options.currentTime;\n let startTime = options.startTime;\n let stopTime = options.stopTime;\n\n if (!defined(currentTime)) {\n // if not specified, current time is the start time,\n // or if that is not specified, 1 day before the stop time,\n // or if that is not specified, then now.\n if (defined(startTime)) {\n currentTime = JulianDate.clone(startTime);\n } else if (defined(stopTime)) {\n currentTime = JulianDate.addDays(stopTime, -1.0, new JulianDate());\n } else {\n currentTime = JulianDate.now();\n }\n } else {\n currentTime = JulianDate.clone(currentTime);\n }\n\n if (!defined(startTime)) {\n // if not specified, start time is the current time\n // (as determined above)\n startTime = JulianDate.clone(currentTime);\n } else {\n startTime = JulianDate.clone(startTime);\n }\n\n if (!defined(stopTime)) {\n // if not specified, stop time is 1 day after the start time\n // (as determined above)\n stopTime = JulianDate.addDays(startTime, 1.0, new JulianDate());\n } else {\n stopTime = JulianDate.clone(stopTime);\n }\n\n /**\n * The start time of the clock.\n * @type {JulianDate}\n */\n this.startTime = startTime;\n\n /**\n * The stop time of the clock.\n * @type {JulianDate}\n */\n this.stopTime = stopTime;\n\n /**\n * Determines how the clock should behave when\n * {@link Clock#startTime} or {@link Clock#stopTime}\n * is reached.\n * @type {ClockRange}\n * @default {@link ClockRange.UNBOUNDED}\n */\n this.clockRange = defaultValue(options.clockRange, ClockRange.UNBOUNDED);\n\n /**\n * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,\n * for example. The clock will only advance time when both\n * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n * @type {Boolean}\n * @default true\n */\n this.canAnimate = defaultValue(options.canAnimate, true);\n\n /**\n * An {@link Event} that is fired whenever {@link Clock#tick} is called.\n * @type {Event}\n */\n this.onTick = new Event();\n /**\n * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.\n * @type {Event}\n */\n this.onStop = new Event();\n\n this._currentTime = undefined;\n this._multiplier = undefined;\n this._clockStep = undefined;\n this._shouldAnimate = undefined;\n this._lastSystemTime = getTimestamp();\n\n // set values using the property setters to\n // make values consistent.\n\n this.currentTime = currentTime;\n this.multiplier = defaultValue(options.multiplier, 1.0);\n this.shouldAnimate = defaultValue(options.shouldAnimate, false);\n this.clockStep = defaultValue(\n options.clockStep,\n ClockStep.SYSTEM_CLOCK_MULTIPLIER\n );\n}\n\nObject.defineProperties(Clock.prototype, {\n /**\n * The current time.\n * Changing this property will change\n * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n * @memberof Clock.prototype\n * @type {JulianDate}\n */\n currentTime: {\n get: function () {\n return this._currentTime;\n },\n set: function (value) {\n if (JulianDate.equals(this._currentTime, value)) {\n return;\n }\n\n if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n }\n\n this._currentTime = value;\n },\n },\n\n /**\n * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.\n * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.\n * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the\n * elapsed system time since the last call to {@link Clock#tick}.\n * Changing this property will change\n * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n * @memberof Clock.prototype\n * @type {Number}\n * @default 1.0\n */\n multiplier: {\n get: function () {\n return this._multiplier;\n },\n set: function (value) {\n if (this._multiplier === value) {\n return;\n }\n\n if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n }\n\n this._multiplier = value;\n },\n },\n\n /**\n * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.\n * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set\n * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and\n * {@link Clock#currentTime} to the current system clock time.\n * @memberof Clock.prototype\n * @type ClockStep\n * @default {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}\n */\n clockStep: {\n get: function () {\n return this._clockStep;\n },\n set: function (value) {\n if (value === ClockStep.SYSTEM_CLOCK) {\n this._multiplier = 1.0;\n this._shouldAnimate = true;\n this._currentTime = JulianDate.now();\n }\n\n this._clockStep = value;\n },\n },\n\n /**\n * Indicates whether {@link Clock#tick} should attempt to advance time.\n * The clock will only advance time when both\n * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.\n * Changing this property will change\n * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to\n * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.\n * @memberof Clock.prototype\n * @type {Boolean}\n * @default false\n */\n shouldAnimate: {\n get: function () {\n return this._shouldAnimate;\n },\n set: function (value) {\n if (this._shouldAnimate === value) {\n return;\n }\n\n if (this._clockStep === ClockStep.SYSTEM_CLOCK) {\n this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n }\n\n this._shouldAnimate = value;\n },\n },\n});\n\n/**\n * Advances the clock from the current time based on the current configuration options.\n * tick should be called every frame, regardless of whether animation is taking place\n * or not. To control animation, use the {@link Clock#shouldAnimate} property.\n *\n * @returns {JulianDate} The new value of the {@link Clock#currentTime} property.\n */\nClock.prototype.tick = function () {\n const currentSystemTime = getTimestamp();\n let currentTime = JulianDate.clone(this._currentTime);\n\n if (this.canAnimate && this._shouldAnimate) {\n const clockStep = this._clockStep;\n if (clockStep === ClockStep.SYSTEM_CLOCK) {\n currentTime = JulianDate.now(currentTime);\n } else {\n const multiplier = this._multiplier;\n\n if (clockStep === ClockStep.TICK_DEPENDENT) {\n currentTime = JulianDate.addSeconds(\n currentTime,\n multiplier,\n currentTime\n );\n } else {\n const milliseconds = currentSystemTime - this._lastSystemTime;\n currentTime = JulianDate.addSeconds(\n currentTime,\n multiplier * (milliseconds / 1000.0),\n currentTime\n );\n }\n\n const clockRange = this.clockRange;\n const startTime = this.startTime;\n const stopTime = this.stopTime;\n\n if (clockRange === ClockRange.CLAMPED) {\n if (JulianDate.lessThan(currentTime, startTime)) {\n currentTime = JulianDate.clone(startTime, currentTime);\n } else if (JulianDate.greaterThan(currentTime, stopTime)) {\n currentTime = JulianDate.clone(stopTime, currentTime);\n this.onStop.raiseEvent(this);\n }\n } else if (clockRange === ClockRange.LOOP_STOP) {\n if (JulianDate.lessThan(currentTime, startTime)) {\n currentTime = JulianDate.clone(startTime, currentTime);\n }\n while (JulianDate.greaterThan(currentTime, stopTime)) {\n currentTime = JulianDate.addSeconds(\n startTime,\n JulianDate.secondsDifference(currentTime, stopTime),\n currentTime\n );\n this.onStop.raiseEvent(this);\n }\n }\n }\n }\n\n this._currentTime = currentTime;\n this._lastSystemTime = currentSystemTime;\n this.onTick.raiseEvent(this);\n return currentTime;\n};\nexport default Clock;\n", "import Clock from \"../Core/Clock.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport createRawPropertyDescriptor from \"./createRawPropertyDescriptor.js\";\n\n/**\n * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied\n * to the {@link Clock} when the DataSource is loaded.\n *\n * @alias DataSourceClock\n * @constructor\n */\nfunction DataSourceClock() {\n this._definitionChanged = new Event();\n this._startTime = undefined;\n this._stopTime = undefined;\n this._currentTime = undefined;\n this._clockRange = undefined;\n this._clockStep = undefined;\n this._multiplier = undefined;\n}\n\nObject.defineProperties(DataSourceClock.prototype, {\n /**\n * Gets the event that is raised whenever a new property is assigned.\n * @memberof DataSourceClock.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the desired start time of the clock.\n * See {@link Clock#startTime}.\n * @memberof DataSourceClock.prototype\n * @type {JulianDate}\n */\n startTime: createRawPropertyDescriptor(\"startTime\"),\n\n /**\n * Gets or sets the desired stop time of the clock.\n * See {@link Clock#stopTime}.\n * @memberof DataSourceClock.prototype\n * @type {JulianDate}\n */\n stopTime: createRawPropertyDescriptor(\"stopTime\"),\n\n /**\n * Gets or sets the desired current time when this data source is loaded.\n * See {@link Clock#currentTime}.\n * @memberof DataSourceClock.prototype\n * @type {JulianDate}\n */\n currentTime: createRawPropertyDescriptor(\"currentTime\"),\n\n /**\n * Gets or sets the desired clock range setting.\n * See {@link Clock#clockRange}.\n * @memberof DataSourceClock.prototype\n * @type {ClockRange}\n */\n clockRange: createRawPropertyDescriptor(\"clockRange\"),\n\n /**\n * Gets or sets the desired clock step setting.\n * See {@link Clock#clockStep}.\n * @memberof DataSourceClock.prototype\n * @type {ClockStep}\n */\n clockStep: createRawPropertyDescriptor(\"clockStep\"),\n\n /**\n * Gets or sets the desired clock multiplier.\n * See {@link Clock#multiplier}.\n * @memberof DataSourceClock.prototype\n * @type {Number}\n */\n multiplier: createRawPropertyDescriptor(\"multiplier\"),\n});\n\n/**\n * Duplicates a DataSourceClock instance.\n *\n * @param {DataSourceClock} [result] The object onto which to store the result.\n * @returns {DataSourceClock} The modified result parameter or a new instance if one was not provided.\n */\nDataSourceClock.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new DataSourceClock();\n }\n result.startTime = this.startTime;\n result.stopTime = this.stopTime;\n result.currentTime = this.currentTime;\n result.clockRange = this.clockRange;\n result.clockStep = this.clockStep;\n result.multiplier = this.multiplier;\n return result;\n};\n\n/**\n * Returns true if this DataSourceClock is equivalent to the other\n *\n * @param {DataSourceClock} other The other DataSourceClock to compare to.\n * @returns {Boolean} <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.\n */\nDataSourceClock.prototype.equals = function (other) {\n return (\n this === other ||\n (defined(other) &&\n JulianDate.equals(this.startTime, other.startTime) &&\n JulianDate.equals(this.stopTime, other.stopTime) &&\n JulianDate.equals(this.currentTime, other.currentTime) &&\n this.clockRange === other.clockRange &&\n this.clockStep === other.clockStep &&\n this.multiplier === other.multiplier)\n );\n};\n\n/**\n * Assigns each unassigned property on this object to the value\n * of the same property on the provided source object.\n *\n * @param {DataSourceClock} source The object to be merged into this object.\n */\nDataSourceClock.prototype.merge = function (source) {\n this.startTime = defaultValue(this.startTime, source.startTime);\n this.stopTime = defaultValue(this.stopTime, source.stopTime);\n this.currentTime = defaultValue(this.currentTime, source.currentTime);\n this.clockRange = defaultValue(this.clockRange, source.clockRange);\n this.clockStep = defaultValue(this.clockStep, source.clockStep);\n this.multiplier = defaultValue(this.multiplier, source.multiplier);\n};\n\n/**\n * Gets the value of this clock instance as a {@link Clock} object.\n *\n * @returns {Clock} The modified result parameter or a new instance if one was not provided.\n */\nDataSourceClock.prototype.getValue = function (result) {\n if (!defined(result)) {\n result = new Clock();\n }\n result.startTime = defaultValue(this.startTime, result.startTime);\n result.stopTime = defaultValue(this.stopTime, result.stopTime);\n result.currentTime = defaultValue(this.currentTime, result.currentTime);\n result.clockRange = defaultValue(this.clockRange, result.clockRange);\n result.multiplier = defaultValue(this.multiplier, result.multiplier);\n result.clockStep = defaultValue(this.clockStep, result.clockStep);\n return result;\n};\nexport default DataSourceClock;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultCellAlpha = 0.1;\nconst defaultLineCount = new Cartesian2(8, 8);\nconst defaultLineOffset = new Cartesian2(0, 0);\nconst defaultLineThickness = new Cartesian2(1, 1);\n\n/**\n * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.\n * @alias GridMaterialProperty\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the grid {@link Color}.\n * @param {Property|Number} [options.cellAlpha=0.1] A numeric Property specifying cell alpha values.\n * @param {Property|Cartesian2} [options.lineCount=new Cartesian2(8, 8)] A {@link Cartesian2} Property specifying the number of grid lines along each axis.\n * @param {Property|Cartesian2} [options.lineThickness=new Cartesian2(1.0, 1.0)] A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.\n * @param {Property|Cartesian2} [options.lineOffset=new Cartesian2(0.0, 0.0)] A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.\n *\n * @constructor\n */\nfunction GridMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this._cellAlpha = undefined;\n this._cellAlphaSubscription = undefined;\n this._lineCount = undefined;\n this._lineCountSubscription = undefined;\n this._lineThickness = undefined;\n this._lineThicknessSubscription = undefined;\n this._lineOffset = undefined;\n this._lineOffsetSubscription = undefined;\n\n this.color = options.color;\n this.cellAlpha = options.cellAlpha;\n this.lineCount = options.lineCount;\n this.lineThickness = options.lineThickness;\n this.lineOffset = options.lineOffset;\n}\n\nObject.defineProperties(GridMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof GridMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._color) &&\n Property.isConstant(this._cellAlpha) &&\n Property.isConstant(this._lineCount) &&\n Property.isConstant(this._lineThickness) &&\n Property.isConstant(this._lineOffset)\n );\n },\n },\n\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof GridMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the Property specifying the grid {@link Color}.\n * @memberof GridMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the numeric Property specifying cell alpha values.\n * @memberof GridMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 0.1\n */\n cellAlpha: createPropertyDescriptor(\"cellAlpha\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.\n * @memberof GridMaterialProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(8.0, 8.0)\n */\n lineCount: createPropertyDescriptor(\"lineCount\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.\n * @memberof GridMaterialProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(1.0, 1.0)\n */\n lineThickness: createPropertyDescriptor(\"lineThickness\"),\n\n /**\n * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.\n * @memberof GridMaterialProperty.prototype\n * @type {Property|undefined}\n * @default new Cartesian2(0.0, 0.0)\n */\n lineOffset: createPropertyDescriptor(\"lineOffset\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nGridMaterialProperty.prototype.getType = function (time) {\n return \"Grid\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nGridMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n defaultColor,\n result.color\n );\n result.cellAlpha = Property.getValueOrDefault(\n this._cellAlpha,\n time,\n defaultCellAlpha\n );\n result.lineCount = Property.getValueOrClonedDefault(\n this._lineCount,\n time,\n defaultLineCount,\n result.lineCount\n );\n result.lineThickness = Property.getValueOrClonedDefault(\n this._lineThickness,\n time,\n defaultLineThickness,\n result.lineThickness\n );\n result.lineOffset = Property.getValueOrClonedDefault(\n this._lineOffset,\n time,\n defaultLineOffset,\n result.lineOffset\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nGridMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof GridMaterialProperty && //\n Property.equals(this._color, other._color) && //\n Property.equals(this._cellAlpha, other._cellAlpha) && //\n Property.equals(this._lineCount, other._lineCount) && //\n Property.equals(this._lineThickness, other._lineThickness) && //\n Property.equals(this._lineOffset, other._lineOffset))\n );\n};\nexport default GridMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.\n *\n * @param {Property|Color} [color=Color.WHITE] The {@link Color} Property to be used.\n *\n * @alias PolylineArrowMaterialProperty\n * @constructor\n */\nfunction PolylineArrowMaterialProperty(color) {\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n\n this.color = color;\n}\n\nObject.defineProperties(PolylineArrowMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof PolylineArrowMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return Property.isConstant(this._color);\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof PolylineArrowMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the {@link Color} {@link Property}.\n * @memberof PolylineArrowMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nPolylineArrowMaterialProperty.prototype.getType = function (time) {\n return \"PolylineArrow\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineArrowMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n Color.WHITE,\n result.color\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineArrowMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PolylineArrowMaterialProperty && //\n Property.equals(this._color, other._color))\n );\n};\nexport default PolylineArrowMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultGapColor = Color.TRANSPARENT;\nconst defaultDashLength = 16.0;\nconst defaultDashPattern = 255.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.\n * @alias PolylineDashMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|Color} [options.gapColor=Color.TRANSPARENT] A Property specifying the {@link Color} of the gaps in the line.\n * @param {Property|Number} [options.dashLength=16.0] A numeric Property specifying the length of the dash pattern in pixels.\n * @param {Property|Number} [options.dashPattern=255.0] A numeric Property specifying a 16 bit pattern for the dash\n */\nfunction PolylineDashMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this._gapColor = undefined;\n this._gapColorSubscription = undefined;\n this._dashLength = undefined;\n this._dashLengthSubscription = undefined;\n this._dashPattern = undefined;\n this._dashPatternSubscription = undefined;\n\n this.color = options.color;\n this.gapColor = options.gapColor;\n this.dashLength = options.dashLength;\n this.dashPattern = options.dashPattern;\n}\n\nObject.defineProperties(PolylineDashMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._color) &&\n Property.isConstant(this._gapColor) &&\n Property.isConstant(this._dashLength) &&\n Property.isConstant(this._dashPattern)\n );\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the Property specifying the {@link Color} of the line.\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Property|undefined}\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the gaps in the line.\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Property|undefined}\n */\n gapColor: createPropertyDescriptor(\"gapColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the length of a dash cycle\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Property|undefined}\n */\n dashLength: createPropertyDescriptor(\"dashLength\"),\n\n /**\n * Gets or sets the numeric Property specifying a dash pattern\n * @memberof PolylineDashMaterialProperty.prototype\n * @type {Property|undefined}\n */\n dashPattern: createPropertyDescriptor(\"dashPattern\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nPolylineDashMaterialProperty.prototype.getType = function (time) {\n return \"PolylineDash\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineDashMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n defaultColor,\n result.color\n );\n result.gapColor = Property.getValueOrClonedDefault(\n this._gapColor,\n time,\n defaultGapColor,\n result.gapColor\n );\n result.dashLength = Property.getValueOrDefault(\n this._dashLength,\n time,\n defaultDashLength,\n result.dashLength\n );\n result.dashPattern = Property.getValueOrDefault(\n this._dashPattern,\n time,\n defaultDashPattern,\n result.dashPattern\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineDashMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PolylineDashMaterialProperty &&\n Property.equals(this._color, other._color) &&\n Property.equals(this._gapColor, other._gapColor) &&\n Property.equals(this._dashLength, other._dashLength) &&\n Property.equals(this._dashPattern, other._dashPattern))\n );\n};\nexport default PolylineDashMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultGlowPower = 0.25;\nconst defaultTaperPower = 1.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.\n * @alias PolylineGlowMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|Number} [options.glowPower=0.25] A numeric Property specifying the strength of the glow, as a percentage of the total line width.\n * @param {Property|Number} [options.taperPower=1.0] A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.\n */\nfunction PolylineGlowMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this._glowPower = undefined;\n this._glowPowerSubscription = undefined;\n this._taperPower = undefined;\n this._taperPowerSubscription = undefined;\n\n this.color = options.color;\n this.glowPower = options.glowPower;\n this.taperPower = options.taperPower;\n}\n\nObject.defineProperties(PolylineGlowMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof PolylineGlowMaterialProperty.prototype\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._color) && Property.isConstant(this._glow)\n );\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof PolylineGlowMaterialProperty.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the Property specifying the {@link Color} of the line.\n * @memberof PolylineGlowMaterialProperty.prototype\n * @type {Property|undefined}\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).\n * @memberof PolylineGlowMaterialProperty.prototype\n * @type {Property|undefined}\n */\n glowPower: createPropertyDescriptor(\"glowPower\"),\n\n /**\n * Gets or sets the numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.\n * @memberof PolylineGlowMaterialProperty.prototype\n * @type {Property|undefined}\n */\n taperPower: createPropertyDescriptor(\"taperPower\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nPolylineGlowMaterialProperty.prototype.getType = function (time) {\n return \"PolylineGlow\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineGlowMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n defaultColor,\n result.color\n );\n result.glowPower = Property.getValueOrDefault(\n this._glowPower,\n time,\n defaultGlowPower,\n result.glowPower\n );\n result.taperPower = Property.getValueOrDefault(\n this._taperPower,\n time,\n defaultTaperPower,\n result.taperPower\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineGlowMaterialProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof PolylineGlowMaterialProperty &&\n Property.equals(this._color, other._color) &&\n Property.equals(this._glowPower, other._glowPower) &&\n Property.equals(this._taperPower, other._taperPower))\n );\n};\nexport default PolylineGlowMaterialProperty;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 1.0;\n\n/**\n * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.\n * @alias PolylineOutlineMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|Color} [options.color=Color.WHITE] A Property specifying the {@link Color} of the line.\n * @param {Property|Color} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.\n * @param {Property|Number} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline, in pixels.\n */\nfunction PolylineOutlineMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this._outlineColor = undefined;\n this._outlineColorSubscription = undefined;\n this._outlineWidth = undefined;\n this._outlineWidthSubscription = undefined;\n\n this.color = options.color;\n this.outlineColor = options.outlineColor;\n this.outlineWidth = options.outlineWidth;\n}\n\nObject.defineProperties(PolylineOutlineMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof PolylineOutlineMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._color) &&\n Property.isConstant(this._outlineColor) &&\n Property.isConstant(this._outlineWidth)\n );\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof PolylineOutlineMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the Property specifying the {@link Color} of the line.\n * @memberof PolylineOutlineMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n color: createPropertyDescriptor(\"color\"),\n\n /**\n * Gets or sets the Property specifying the {@link Color} of the outline.\n * @memberof PolylineOutlineMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n outlineColor: createPropertyDescriptor(\"outlineColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the width of the outline.\n * @memberof PolylineOutlineMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n outlineWidth: createPropertyDescriptor(\"outlineWidth\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nPolylineOutlineMaterialProperty.prototype.getType = function (time) {\n return \"PolylineOutline\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPolylineOutlineMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(\n this._color,\n time,\n defaultColor,\n result.color\n );\n result.outlineColor = Property.getValueOrClonedDefault(\n this._outlineColor,\n time,\n defaultOutlineColor,\n result.outlineColor\n );\n result.outlineWidth = Property.getValueOrDefault(\n this._outlineWidth,\n time,\n defaultOutlineWidth\n );\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPolylineOutlineMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PolylineOutlineMaterialProperty && //\n Property.equals(this._color, other._color) && //\n Property.equals(this._outlineColor, other._outlineColor) && //\n Property.equals(this._outlineWidth, other._outlineWidth))\n );\n};\nexport default PolylineOutlineMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is an array whose items are the computed value\n * of other PositionProperty instances.\n *\n * @alias PositionPropertyArray\n * @constructor\n *\n * @param {Property[]} [value] An array of Property instances.\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction PositionPropertyArray(value, referenceFrame) {\n this._value = undefined;\n this._definitionChanged = new Event();\n this._eventHelper = new EventHelper();\n this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n this.setValue(value);\n}\n\nObject.defineProperties(PositionPropertyArray.prototype, {\n /**\n * Gets a value indicating if this property is constant. This property\n * is considered constant if all property items in the array are constant.\n * @memberof PositionPropertyArray.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n const value = this._value;\n if (!defined(value)) {\n return true;\n }\n\n const length = value.length;\n for (let i = 0; i < length; i++) {\n if (!Property.isConstant(value[i])) {\n return false;\n }\n }\n return true;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value or one of the properties in the array also changes.\n * @memberof PositionPropertyArray.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the reference frame in which the position is defined.\n * @memberof PositionPropertyArray.prototype\n * @type {ReferenceFrame}\n * @default ReferenceFrame.FIXED;\n */\n referenceFrame: {\n get: function () {\n return this._referenceFrame;\n },\n },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3[]} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionPropertyArray.prototype.getValue = function (time, result) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3[]} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nPositionPropertyArray.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n const value = this._value;\n if (!defined(value)) {\n return undefined;\n }\n\n const length = value.length;\n if (!defined(result)) {\n result = new Array(length);\n }\n let i = 0;\n let x = 0;\n while (i < length) {\n const property = value[i];\n const itemValue = property.getValueInReferenceFrame(\n time,\n referenceFrame,\n result[i]\n );\n if (defined(itemValue)) {\n result[x] = itemValue;\n x++;\n }\n i++;\n }\n result.length = x;\n return result;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Property[]} value An array of Property instances.\n */\nPositionPropertyArray.prototype.setValue = function (value) {\n const eventHelper = this._eventHelper;\n eventHelper.removeAll();\n\n if (defined(value)) {\n this._value = value.slice();\n const length = value.length;\n for (let i = 0; i < length; i++) {\n const property = value[i];\n if (defined(property)) {\n eventHelper.add(\n property.definitionChanged,\n PositionPropertyArray.prototype._raiseDefinitionChanged,\n this\n );\n }\n }\n } else {\n this._value = undefined;\n }\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPositionPropertyArray.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PositionPropertyArray && //\n this._referenceFrame === other._referenceFrame && //\n Property.arrayEquals(this._value, other._value))\n );\n};\n\nPositionPropertyArray.prototype._raiseDefinitionChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default PositionPropertyArray;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} whose value is an array whose items are the computed value\n * of other property instances.\n *\n * @alias PropertyArray\n * @constructor\n *\n * @param {Property[]} [value] An array of Property instances.\n */\nfunction PropertyArray(value) {\n this._value = undefined;\n this._definitionChanged = new Event();\n this._eventHelper = new EventHelper();\n this.setValue(value);\n}\n\nObject.defineProperties(PropertyArray.prototype, {\n /**\n * Gets a value indicating if this property is constant. This property\n * is considered constant if all property items in the array are constant.\n * @memberof PropertyArray.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n const value = this._value;\n if (!defined(value)) {\n return true;\n }\n const length = value.length;\n for (let i = 0; i < length; i++) {\n if (!Property.isConstant(value[i])) {\n return false;\n }\n }\n return true;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value or one of the properties in the array also changes.\n * @memberof PropertyArray.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n});\n\n/**\n * Gets the value of the property.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object[]} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object[]} The modified result parameter, which is an array of values produced by evaluating each of the contained properties at the given time or a new instance if the result parameter was not supplied.\n */\nPropertyArray.prototype.getValue = function (time, result) {\n const value = this._value;\n if (!defined(value)) {\n return undefined;\n }\n\n const length = value.length;\n if (!defined(result)) {\n result = new Array(length);\n }\n let i = 0;\n let x = 0;\n while (i < length) {\n const property = this._value[i];\n const itemValue = property.getValue(time, result[i]);\n if (defined(itemValue)) {\n result[x] = itemValue;\n x++;\n }\n i++;\n }\n result.length = x;\n return result;\n};\n\n/**\n * Sets the value of the property.\n *\n * @param {Property[]} value An array of Property instances.\n */\nPropertyArray.prototype.setValue = function (value) {\n const eventHelper = this._eventHelper;\n eventHelper.removeAll();\n\n if (defined(value)) {\n this._value = value.slice();\n const length = value.length;\n for (let i = 0; i < length; i++) {\n const property = value[i];\n if (defined(property)) {\n eventHelper.add(\n property.definitionChanged,\n PropertyArray.prototype._raiseDefinitionChanged,\n this\n );\n }\n }\n } else {\n this._value = undefined;\n }\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nPropertyArray.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof PropertyArray && //\n Property.arrayEquals(this._value, other._value))\n );\n};\n\nPropertyArray.prototype._raiseDefinitionChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default PropertyArray;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Property from \"./Property.js\";\n\nfunction resolve(that) {\n let targetProperty = that._targetProperty;\n\n if (!defined(targetProperty)) {\n let targetEntity = that._targetEntity;\n\n if (!defined(targetEntity)) {\n targetEntity = that._targetCollection.getById(that._targetId);\n\n if (!defined(targetEntity)) {\n // target entity not found\n that._targetEntity = that._targetProperty = undefined;\n return;\n }\n\n // target entity was found. listen for changes to entity definition\n targetEntity.definitionChanged.addEventListener(\n ReferenceProperty.prototype._onTargetEntityDefinitionChanged,\n that\n );\n that._targetEntity = targetEntity;\n }\n\n // walk the list of property names and resolve properties\n const targetPropertyNames = that._targetPropertyNames;\n targetProperty = that._targetEntity;\n for (\n let i = 0, len = targetPropertyNames.length;\n i < len && defined(targetProperty);\n ++i\n ) {\n targetProperty = targetProperty[targetPropertyNames[i]];\n }\n\n // target property may or may not be defined, depending on if it was found\n that._targetProperty = targetProperty;\n }\n\n return targetProperty;\n}\n\n/**\n * A {@link Property} which transparently links to another property on a provided object.\n *\n * @alias ReferenceProperty\n * @constructor\n *\n * @param {EntityCollection} targetCollection The entity collection which will be used to resolve the reference.\n * @param {String} targetId The id of the entity which is being referenced.\n * @param {String[]} targetPropertyNames The names of the property on the target entity which we will use.\n *\n * @example\n * const collection = new Cesium.EntityCollection();\n *\n * //Create a new entity and assign a billboard scale.\n * const object1 = new Cesium.Entity({id:'object1'});\n * object1.billboard = new Cesium.BillboardGraphics();\n * object1.billboard.scale = new Cesium.ConstantProperty(2.0);\n * collection.add(object1);\n *\n * //Create a second entity and reference the scale from the first one.\n * const object2 = new Cesium.Entity({id:'object2'});\n * object2.model = new Cesium.ModelGraphics();\n * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);\n * collection.add(object2);\n *\n * //Create a third object, but use the fromString helper function.\n * const object3 = new Cesium.Entity({id:'object3'});\n * object3.billboard = new Cesium.BillboardGraphics();\n * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');\n * collection.add(object3);\n *\n * //You can refer to an entity with a # or . in id and property names by escaping them.\n * const object4 = new Cesium.Entity({id:'#object.4'});\n * object4.billboard = new Cesium.BillboardGraphics();\n * object4.billboard.scale = new Cesium.ConstantProperty(2.0);\n * collection.add(object4);\n *\n * const object5 = new Cesium.Entity({id:'object5'});\n * object5.billboard = new Cesium.BillboardGraphics();\n * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\\\#object\\\\.4#billboard.scale');\n * collection.add(object5);\n */\nfunction ReferenceProperty(targetCollection, targetId, targetPropertyNames) {\n this._targetCollection = targetCollection;\n this._targetId = targetId;\n this._targetPropertyNames = targetPropertyNames;\n this._targetProperty = undefined;\n this._targetEntity = undefined;\n this._definitionChanged = new Event();\n\n targetCollection.collectionChanged.addEventListener(\n ReferenceProperty.prototype._onCollectionChanged,\n this\n );\n}\n\nObject.defineProperties(ReferenceProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * @memberof ReferenceProperty.prototype\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return Property.isConstant(resolve(this));\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever the referenced property's definition is changed.\n * @memberof ReferenceProperty.prototype\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the reference frame that the position is defined in.\n * This property is only valid if the referenced property is a {@link PositionProperty}.\n * @memberof ReferenceProperty.prototype\n * @type {ReferenceFrame}\n * @readonly\n */\n referenceFrame: {\n get: function () {\n const target = resolve(this);\n return defined(target) ? target.referenceFrame : undefined;\n },\n },\n /**\n * Gets the id of the entity being referenced.\n * @memberof ReferenceProperty.prototype\n * @type {String}\n * @readonly\n */\n targetId: {\n get: function () {\n return this._targetId;\n },\n },\n /**\n * Gets the collection containing the entity being referenced.\n * @memberof ReferenceProperty.prototype\n * @type {EntityCollection}\n * @readonly\n */\n targetCollection: {\n get: function () {\n return this._targetCollection;\n },\n },\n /**\n * Gets the array of property names used to retrieve the referenced property.\n * @memberof ReferenceProperty.prototype\n * @type {String[]}\n * @readonly\n */\n targetPropertyNames: {\n get: function () {\n return this._targetPropertyNames;\n },\n },\n /**\n * Gets the resolved instance of the underlying referenced property.\n * @memberof ReferenceProperty.prototype\n * @type {Property|undefined}\n * @readonly\n */\n resolvedProperty: {\n get: function () {\n return resolve(this);\n },\n },\n});\n\n/**\n * Creates a new instance given the entity collection that will\n * be used to resolve it and a string indicating the target entity id and property.\n * The format of the string is \"objectId#foo.bar\", where # separates the id from\n * property path and . separates sub-properties. If the reference identifier or\n * or any sub-properties contains a # . or \\ they must be escaped.\n *\n * @param {EntityCollection} targetCollection\n * @param {String} referenceString\n * @returns {ReferenceProperty} A new instance of ReferenceProperty.\n *\n * @exception {DeveloperError} invalid referenceString.\n */\nReferenceProperty.fromString = function (targetCollection, referenceString) {\n let identifier;\n const values = [];\n\n let inIdentifier = true;\n let isEscaped = false;\n let token = \"\";\n for (let i = 0; i < referenceString.length; ++i) {\n const c = referenceString.charAt(i);\n\n if (isEscaped) {\n token += c;\n isEscaped = false;\n } else if (c === \"\\\\\") {\n isEscaped = true;\n } else if (inIdentifier && c === \"#\") {\n identifier = token;\n inIdentifier = false;\n token = \"\";\n } else if (!inIdentifier && c === \".\") {\n values.push(token);\n token = \"\";\n } else {\n token += c;\n }\n }\n values.push(token);\n\n return new ReferenceProperty(targetCollection, identifier, values);\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nReferenceProperty.prototype.getValue = function (time, result) {\n const target = resolve(this);\n return defined(target) ? target.getValue(time, result) : undefined;\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n * This method is only valid if the property being referenced is a {@link PositionProperty}.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nReferenceProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n const target = resolve(this);\n return defined(target)\n ? target.getValueInReferenceFrame(time, referenceFrame, result)\n : undefined;\n};\n\n/**\n * Gets the {@link Material} type at the provided time.\n * This method is only valid if the property being referenced is a {@link MaterialProperty}.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nReferenceProperty.prototype.getType = function (time) {\n const target = resolve(this);\n return defined(target) ? target.getType(time) : undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nReferenceProperty.prototype.equals = function (other) {\n if (this === other) {\n return true;\n }\n\n const names = this._targetPropertyNames;\n const otherNames = other._targetPropertyNames;\n\n if (\n this._targetCollection !== other._targetCollection || //\n this._targetId !== other._targetId || //\n names.length !== otherNames.length\n ) {\n return false;\n }\n\n const length = this._targetPropertyNames.length;\n for (let i = 0; i < length; i++) {\n if (names[i] !== otherNames[i]) {\n return false;\n }\n }\n\n return true;\n};\n\nReferenceProperty.prototype._onTargetEntityDefinitionChanged = function (\n targetEntity,\n name,\n value,\n oldValue\n) {\n if (defined(this._targetProperty) && this._targetPropertyNames[0] === name) {\n this._targetProperty = undefined;\n this._definitionChanged.raiseEvent(this);\n }\n};\n\nReferenceProperty.prototype._onCollectionChanged = function (\n collection,\n added,\n removed\n) {\n let targetEntity = this._targetEntity;\n if (defined(targetEntity) && removed.indexOf(targetEntity) !== -1) {\n targetEntity.definitionChanged.removeEventListener(\n ReferenceProperty.prototype._onTargetEntityDefinitionChanged,\n this\n );\n this._targetEntity = this._targetProperty = undefined;\n } else if (!defined(targetEntity)) {\n targetEntity = resolve(this);\n if (defined(targetEntity)) {\n this._definitionChanged.raiseEvent(this);\n }\n }\n};\nexport default ReferenceProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * Represents a {@link Packable} number that always interpolates values\n * towards the shortest angle of rotation. This object is never used directly\n * but is instead passed to the constructor of {@link SampledProperty}\n * in order to represent a two-dimensional angle of rotation.\n *\n * @interface Rotation\n *\n *\n * @example\n * const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');\n * const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');\n * const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');\n *\n * const property = new Cesium.SampledProperty(Cesium.Rotation);\n * property.addSample(time1, 0);\n * property.addSample(time3, Cesium.Math.toRadians(350));\n *\n * //Getting the value at time2 will equal 355 degrees instead\n * //of 175 degrees (which is what you get if you construct\n * //a SampledProperty(Number) instead. Note, the actual\n * //return value is in radians, not degrees.\n * property.getValue(time2);\n *\n * @see PackableForInterpolation\n */\nconst Rotation = {\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n packedLength: 1,\n\n /**\n * Stores the provided instance into the provided array.\n *\n * @param {Rotation} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\n pack: function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n array[startingIndex] = value;\n\n return array;\n },\n\n /**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Rotation} [result] The object into which to store the result.\n * @returns {Rotation} The modified result parameter or a new Rotation instance if one was not provided.\n */\n unpack: function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n return array[startingIndex];\n },\n\n /**\n * Converts a packed array into a form suitable for interpolation.\n *\n * @param {Number[]} packedArray The packed array.\n * @param {Number} [startingIndex=0] The index of the first element to be converted.\n * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted.\n * @param {Number[]} [result] The object into which to store the result.\n */\n convertPackedArrayForInterpolation: function (\n packedArray,\n startingIndex,\n lastIndex,\n result\n ) {\n if (!defined(result)) {\n result = [];\n }\n\n startingIndex = defaultValue(startingIndex, 0);\n lastIndex = defaultValue(lastIndex, packedArray.length);\n\n let previousValue;\n for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {\n const value = packedArray[startingIndex + i];\n if (i === 0 || Math.abs(previousValue - value) < Math.PI) {\n result[i] = value;\n } else {\n result[i] = value - CesiumMath.TWO_PI;\n }\n previousValue = value;\n }\n },\n\n /**\n * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.\n *\n * @param {Number[]} array The array previously packed for interpolation.\n * @param {Number[]} sourceArray The original packed array.\n * @param {Number} [firstIndex=0] The firstIndex used to convert the array.\n * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n * @param {Rotation} [result] The object into which to store the result.\n * @returns {Rotation} The modified result parameter or a new Rotation instance if one was not provided.\n */\n unpackInterpolationResult: function (\n array,\n sourceArray,\n firstIndex,\n lastIndex,\n result\n ) {\n result = array[0];\n if (result < 0) {\n return result + CesiumMath.TWO_PI;\n }\n return result;\n },\n};\nexport default Rotation;\n", "import binarySearch from \"../Core/binarySearch.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ExtrapolationType from \"../Core/ExtrapolationType.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport LinearApproximation from \"../Core/LinearApproximation.js\";\n\nconst PackableNumber = {\n packedLength: 1,\n pack: function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n array[startingIndex] = value;\n },\n unpack: function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n return array[startingIndex];\n },\n};\n\n//We can't use splice for inserting new elements because function apply can't handle\n//a huge number of arguments. See https://code.google.com/p/chromium/issues/detail?id=56588\nfunction arrayInsert(array, startIndex, items) {\n let i;\n const arrayLength = array.length;\n const itemsLength = items.length;\n const newLength = arrayLength + itemsLength;\n\n array.length = newLength;\n if (arrayLength !== startIndex) {\n let q = arrayLength - 1;\n for (i = newLength - 1; i >= startIndex; i--) {\n array[i] = array[q--];\n }\n }\n\n for (i = 0; i < itemsLength; i++) {\n array[startIndex++] = items[i];\n }\n}\n\nfunction convertDate(date, epoch) {\n if (date instanceof JulianDate) {\n return date;\n }\n if (typeof date === \"string\") {\n return JulianDate.fromIso8601(date);\n }\n return JulianDate.addSeconds(epoch, date, new JulianDate());\n}\n\nconst timesSpliceArgs = [];\nconst valuesSpliceArgs = [];\n\nfunction mergeNewSamples(epoch, times, values, newData, packedLength) {\n let newDataIndex = 0;\n let i;\n let prevItem;\n let timesInsertionPoint;\n let valuesInsertionPoint;\n let currentTime;\n let nextTime;\n\n while (newDataIndex < newData.length) {\n currentTime = convertDate(newData[newDataIndex], epoch);\n timesInsertionPoint = binarySearch(times, currentTime, JulianDate.compare);\n let timesSpliceArgsCount = 0;\n let valuesSpliceArgsCount = 0;\n\n if (timesInsertionPoint < 0) {\n //Doesn't exist, insert as many additional values as we can.\n timesInsertionPoint = ~timesInsertionPoint;\n\n valuesInsertionPoint = timesInsertionPoint * packedLength;\n prevItem = undefined;\n nextTime = times[timesInsertionPoint];\n while (newDataIndex < newData.length) {\n currentTime = convertDate(newData[newDataIndex], epoch);\n if (\n (defined(prevItem) &&\n JulianDate.compare(prevItem, currentTime) >= 0) ||\n (defined(nextTime) && JulianDate.compare(currentTime, nextTime) >= 0)\n ) {\n break;\n }\n timesSpliceArgs[timesSpliceArgsCount++] = currentTime;\n newDataIndex = newDataIndex + 1;\n for (i = 0; i < packedLength; i++) {\n valuesSpliceArgs[valuesSpliceArgsCount++] = newData[newDataIndex];\n newDataIndex = newDataIndex + 1;\n }\n prevItem = currentTime;\n }\n\n if (timesSpliceArgsCount > 0) {\n valuesSpliceArgs.length = valuesSpliceArgsCount;\n arrayInsert(values, valuesInsertionPoint, valuesSpliceArgs);\n\n timesSpliceArgs.length = timesSpliceArgsCount;\n arrayInsert(times, timesInsertionPoint, timesSpliceArgs);\n }\n } else {\n //Found an exact match\n for (i = 0; i < packedLength; i++) {\n newDataIndex++;\n values[timesInsertionPoint * packedLength + i] = newData[newDataIndex];\n }\n newDataIndex++;\n }\n }\n}\n\n/**\n * A {@link Property} whose value is interpolated for a given time from the\n * provided set of samples and specified interpolation algorithm and degree.\n * @alias SampledProperty\n * @constructor\n *\n * @param {Number|Packable} type The type of property.\n * @param {Packable[]} [derivativeTypes] When supplied, indicates that samples will contain derivative information of the specified types.\n *\n *\n * @example\n * //Create a linearly interpolated Cartesian2\n * const property = new Cesium.SampledProperty(Cesium.Cartesian2);\n *\n * //Populate it with data\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));\n *\n * //Retrieve an interpolated value\n * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));\n *\n * @example\n * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation\n * const property = new Cesium.SampledProperty(Number);\n * property.setInterpolationOptions({\n * interpolationDegree : 3,\n * interpolationAlgorithm : Cesium.HermitePolynomialApproximation\n * });\n *\n * //Populate it with data\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);\n *\n * //Samples can be added in any order.\n * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);\n *\n * //Retrieve an interpolated value\n * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));\n *\n * @see SampledPositionProperty\n */\nfunction SampledProperty(type, derivativeTypes) {\n let innerType = type;\n if (innerType === Number) {\n innerType = PackableNumber;\n }\n let packedLength = innerType.packedLength;\n let packedInterpolationLength = defaultValue(\n innerType.packedInterpolationLength,\n packedLength\n );\n\n let inputOrder = 0;\n let innerDerivativeTypes;\n if (defined(derivativeTypes)) {\n const length = derivativeTypes.length;\n innerDerivativeTypes = new Array(length);\n for (let i = 0; i < length; i++) {\n let derivativeType = derivativeTypes[i];\n if (derivativeType === Number) {\n derivativeType = PackableNumber;\n }\n const derivativePackedLength = derivativeType.packedLength;\n packedLength += derivativePackedLength;\n packedInterpolationLength += defaultValue(\n derivativeType.packedInterpolationLength,\n derivativePackedLength\n );\n innerDerivativeTypes[i] = derivativeType;\n }\n inputOrder = length;\n }\n\n this._type = type;\n this._innerType = innerType;\n this._interpolationDegree = 1;\n this._interpolationAlgorithm = LinearApproximation;\n this._numberOfPoints = 0;\n this._times = [];\n this._values = [];\n this._xTable = [];\n this._yTable = [];\n this._packedLength = packedLength;\n this._packedInterpolationLength = packedInterpolationLength;\n this._updateTableLength = true;\n this._interpolationResult = new Array(packedInterpolationLength);\n this._definitionChanged = new Event();\n this._derivativeTypes = derivativeTypes;\n this._innerDerivativeTypes = innerDerivativeTypes;\n this._inputOrder = inputOrder;\n this._forwardExtrapolationType = ExtrapolationType.NONE;\n this._forwardExtrapolationDuration = 0;\n this._backwardExtrapolationType = ExtrapolationType.NONE;\n this._backwardExtrapolationDuration = 0;\n}\n\nObject.defineProperties(SampledProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof SampledProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._values.length === 0;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof SampledProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the type of property.\n * @memberof SampledProperty.prototype\n * @type {*}\n */\n type: {\n get: function () {\n return this._type;\n },\n },\n /**\n * Gets the derivative types used by this property.\n * @memberof SampledProperty.prototype\n * @type {Packable[]}\n */\n derivativeTypes: {\n get: function () {\n return this._derivativeTypes;\n },\n },\n /**\n * Gets the degree of interpolation to perform when retrieving a value.\n * @memberof SampledProperty.prototype\n * @type {Number}\n * @default 1\n */\n interpolationDegree: {\n get: function () {\n return this._interpolationDegree;\n },\n },\n /**\n * Gets the interpolation algorithm to use when retrieving a value.\n * @memberof SampledProperty.prototype\n * @type {InterpolationAlgorithm}\n * @default LinearApproximation\n */\n interpolationAlgorithm: {\n get: function () {\n return this._interpolationAlgorithm;\n },\n },\n /**\n * Gets or sets the type of extrapolation to perform when a value\n * is requested at a time after any available samples.\n * @memberof SampledProperty.prototype\n * @type {ExtrapolationType}\n * @default ExtrapolationType.NONE\n */\n forwardExtrapolationType: {\n get: function () {\n return this._forwardExtrapolationType;\n },\n set: function (value) {\n if (this._forwardExtrapolationType !== value) {\n this._forwardExtrapolationType = value;\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n /**\n * Gets or sets the amount of time to extrapolate forward before\n * the property becomes undefined. A value of 0 will extrapolate forever.\n * @memberof SampledProperty.prototype\n * @type {Number}\n * @default 0\n */\n forwardExtrapolationDuration: {\n get: function () {\n return this._forwardExtrapolationDuration;\n },\n set: function (value) {\n if (this._forwardExtrapolationDuration !== value) {\n this._forwardExtrapolationDuration = value;\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n /**\n * Gets or sets the type of extrapolation to perform when a value\n * is requested at a time before any available samples.\n * @memberof SampledProperty.prototype\n * @type {ExtrapolationType}\n * @default ExtrapolationType.NONE\n */\n backwardExtrapolationType: {\n get: function () {\n return this._backwardExtrapolationType;\n },\n set: function (value) {\n if (this._backwardExtrapolationType !== value) {\n this._backwardExtrapolationType = value;\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n /**\n * Gets or sets the amount of time to extrapolate backward\n * before the property becomes undefined. A value of 0 will extrapolate forever.\n * @memberof SampledProperty.prototype\n * @type {Number}\n * @default 0\n */\n backwardExtrapolationDuration: {\n get: function () {\n return this._backwardExtrapolationDuration;\n },\n set: function (value) {\n if (this._backwardExtrapolationDuration !== value) {\n this._backwardExtrapolationDuration = value;\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledProperty.prototype.getValue = function (time, result) {\n const times = this._times;\n const timesLength = times.length;\n if (timesLength === 0) {\n return undefined;\n }\n\n let timeout;\n const innerType = this._innerType;\n const values = this._values;\n let index = binarySearch(times, time, JulianDate.compare);\n\n if (index < 0) {\n index = ~index;\n\n if (index === 0) {\n const startTime = times[index];\n timeout = this._backwardExtrapolationDuration;\n if (\n this._backwardExtrapolationType === ExtrapolationType.NONE ||\n (timeout !== 0 &&\n JulianDate.secondsDifference(startTime, time) > timeout)\n ) {\n return undefined;\n }\n if (this._backwardExtrapolationType === ExtrapolationType.HOLD) {\n return innerType.unpack(values, 0, result);\n }\n }\n\n if (index >= timesLength) {\n index = timesLength - 1;\n const endTime = times[index];\n timeout = this._forwardExtrapolationDuration;\n if (\n this._forwardExtrapolationType === ExtrapolationType.NONE ||\n (timeout !== 0 && JulianDate.secondsDifference(time, endTime) > timeout)\n ) {\n return undefined;\n }\n if (this._forwardExtrapolationType === ExtrapolationType.HOLD) {\n index = timesLength - 1;\n return innerType.unpack(values, index * innerType.packedLength, result);\n }\n }\n\n const xTable = this._xTable;\n const yTable = this._yTable;\n const interpolationAlgorithm = this._interpolationAlgorithm;\n const packedInterpolationLength = this._packedInterpolationLength;\n const inputOrder = this._inputOrder;\n\n if (this._updateTableLength) {\n this._updateTableLength = false;\n const numberOfPoints = Math.min(\n interpolationAlgorithm.getRequiredDataPoints(\n this._interpolationDegree,\n inputOrder\n ),\n timesLength\n );\n if (numberOfPoints !== this._numberOfPoints) {\n this._numberOfPoints = numberOfPoints;\n xTable.length = numberOfPoints;\n yTable.length = numberOfPoints * packedInterpolationLength;\n }\n }\n\n const degree = this._numberOfPoints - 1;\n if (degree < 1) {\n return undefined;\n }\n\n let firstIndex = 0;\n let lastIndex = timesLength - 1;\n const pointsInCollection = lastIndex - firstIndex + 1;\n\n if (pointsInCollection >= degree + 1) {\n let computedFirstIndex = index - ((degree / 2) | 0) - 1;\n if (computedFirstIndex < firstIndex) {\n computedFirstIndex = firstIndex;\n }\n let computedLastIndex = computedFirstIndex + degree;\n if (computedLastIndex > lastIndex) {\n computedLastIndex = lastIndex;\n computedFirstIndex = computedLastIndex - degree;\n if (computedFirstIndex < firstIndex) {\n computedFirstIndex = firstIndex;\n }\n }\n\n firstIndex = computedFirstIndex;\n lastIndex = computedLastIndex;\n }\n const length = lastIndex - firstIndex + 1;\n\n // Build the tables\n for (let i = 0; i < length; ++i) {\n xTable[i] = JulianDate.secondsDifference(\n times[firstIndex + i],\n times[lastIndex]\n );\n }\n\n if (!defined(innerType.convertPackedArrayForInterpolation)) {\n let destinationIndex = 0;\n const packedLength = this._packedLength;\n let sourceIndex = firstIndex * packedLength;\n const stop = (lastIndex + 1) * packedLength;\n\n while (sourceIndex < stop) {\n yTable[destinationIndex] = values[sourceIndex];\n sourceIndex++;\n destinationIndex++;\n }\n } else {\n innerType.convertPackedArrayForInterpolation(\n values,\n firstIndex,\n lastIndex,\n yTable\n );\n }\n\n // Interpolate!\n const x = JulianDate.secondsDifference(time, times[lastIndex]);\n let interpolationResult;\n if (inputOrder === 0 || !defined(interpolationAlgorithm.interpolate)) {\n interpolationResult = interpolationAlgorithm.interpolateOrderZero(\n x,\n xTable,\n yTable,\n packedInterpolationLength,\n this._interpolationResult\n );\n } else {\n const yStride = Math.floor(packedInterpolationLength / (inputOrder + 1));\n interpolationResult = interpolationAlgorithm.interpolate(\n x,\n xTable,\n yTable,\n yStride,\n inputOrder,\n inputOrder,\n this._interpolationResult\n );\n }\n\n if (!defined(innerType.unpackInterpolationResult)) {\n return innerType.unpack(interpolationResult, 0, result);\n }\n return innerType.unpackInterpolationResult(\n interpolationResult,\n values,\n firstIndex,\n lastIndex,\n result\n );\n }\n return innerType.unpack(values, index * this._packedLength, result);\n};\n\n/**\n * Sets the algorithm and degree to use when interpolating a value.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {InterpolationAlgorithm} [options.interpolationAlgorithm] The new interpolation algorithm. If undefined, the existing property will be unchanged.\n * @param {Number} [options.interpolationDegree] The new interpolation degree. If undefined, the existing property will be unchanged.\n */\nSampledProperty.prototype.setInterpolationOptions = function (options) {\n if (!defined(options)) {\n return;\n }\n\n let valuesChanged = false;\n\n const interpolationAlgorithm = options.interpolationAlgorithm;\n const interpolationDegree = options.interpolationDegree;\n\n if (\n defined(interpolationAlgorithm) &&\n this._interpolationAlgorithm !== interpolationAlgorithm\n ) {\n this._interpolationAlgorithm = interpolationAlgorithm;\n valuesChanged = true;\n }\n\n if (\n defined(interpolationDegree) &&\n this._interpolationDegree !== interpolationDegree\n ) {\n this._interpolationDegree = interpolationDegree;\n valuesChanged = true;\n }\n\n if (valuesChanged) {\n this._updateTableLength = true;\n this._definitionChanged.raiseEvent(this);\n }\n};\n\n/**\n * Adds a new sample.\n *\n * @param {JulianDate} time The sample time.\n * @param {Packable} value The value at the provided time.\n * @param {Packable[]} [derivatives] The array of derivatives at the provided time.\n */\nSampledProperty.prototype.addSample = function (time, value, derivatives) {\n const innerDerivativeTypes = this._innerDerivativeTypes;\n const hasDerivatives = defined(innerDerivativeTypes);\n\n const innerType = this._innerType;\n const data = [];\n data.push(time);\n innerType.pack(value, data, data.length);\n\n if (hasDerivatives) {\n const derivativesLength = innerDerivativeTypes.length;\n for (let x = 0; x < derivativesLength; x++) {\n innerDerivativeTypes[x].pack(derivatives[x], data, data.length);\n }\n }\n mergeNewSamples(\n undefined,\n this._times,\n this._values,\n data,\n this._packedLength\n );\n this._updateTableLength = true;\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Adds an array of samples.\n *\n * @param {JulianDate[]} times An array of JulianDate instances where each index is a sample time.\n * @param {Packable[]} values The array of values, where each value corresponds to the provided times index.\n * @param {Array[]} [derivativeValues] An array where each item is the array of derivatives at the equivalent time index.\n *\n * @exception {DeveloperError} times and values must be the same length.\n * @exception {DeveloperError} times and derivativeValues must be the same length.\n */\nSampledProperty.prototype.addSamples = function (\n times,\n values,\n derivativeValues\n) {\n const innerDerivativeTypes = this._innerDerivativeTypes;\n const hasDerivatives = defined(innerDerivativeTypes);\n\n const innerType = this._innerType;\n const length = times.length;\n const data = [];\n for (let i = 0; i < length; i++) {\n data.push(times[i]);\n innerType.pack(values[i], data, data.length);\n\n if (hasDerivatives) {\n const derivatives = derivativeValues[i];\n const derivativesLength = innerDerivativeTypes.length;\n for (let x = 0; x < derivativesLength; x++) {\n innerDerivativeTypes[x].pack(derivatives[x], data, data.length);\n }\n }\n }\n mergeNewSamples(\n undefined,\n this._times,\n this._values,\n data,\n this._packedLength\n );\n this._updateTableLength = true;\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Adds samples as a single packed array where each new sample is represented as a date,\n * followed by the packed representation of the corresponding value and derivatives.\n *\n * @param {Number[]} packedSamples The array of packed samples.\n * @param {JulianDate} [epoch] If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.\n */\nSampledProperty.prototype.addSamplesPackedArray = function (\n packedSamples,\n epoch\n) {\n mergeNewSamples(\n epoch,\n this._times,\n this._values,\n packedSamples,\n this._packedLength\n );\n this._updateTableLength = true;\n this._definitionChanged.raiseEvent(this);\n};\n\n/**\n * Removes a sample at the given time, if present.\n *\n * @param {JulianDate} time The sample time.\n * @returns {Boolean} <code>true</code> if a sample at time was removed, <code>false</code> otherwise.\n */\nSampledProperty.prototype.removeSample = function (time) {\n const index = binarySearch(this._times, time, JulianDate.compare);\n if (index < 0) {\n return false;\n }\n removeSamples(this, index, 1);\n return true;\n};\n\nfunction removeSamples(property, startIndex, numberToRemove) {\n const packedLength = property._packedLength;\n property._times.splice(startIndex, numberToRemove);\n property._values.splice(\n startIndex * packedLength,\n numberToRemove * packedLength\n );\n property._updateTableLength = true;\n property._definitionChanged.raiseEvent(property);\n}\n\n/**\n * Removes all samples for the given time interval.\n *\n * @param {TimeInterval} time The time interval for which to remove all samples.\n */\nSampledProperty.prototype.removeSamples = function (timeInterval) {\n const times = this._times;\n let startIndex = binarySearch(times, timeInterval.start, JulianDate.compare);\n if (startIndex < 0) {\n startIndex = ~startIndex;\n } else if (!timeInterval.isStartIncluded) {\n ++startIndex;\n }\n let stopIndex = binarySearch(times, timeInterval.stop, JulianDate.compare);\n if (stopIndex < 0) {\n stopIndex = ~stopIndex;\n } else if (timeInterval.isStopIncluded) {\n ++stopIndex;\n }\n\n removeSamples(this, startIndex, stopIndex - startIndex);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nSampledProperty.prototype.equals = function (other) {\n if (this === other) {\n return true;\n }\n if (!defined(other)) {\n return false;\n }\n\n if (\n this._type !== other._type || //\n this._interpolationDegree !== other._interpolationDegree || //\n this._interpolationAlgorithm !== other._interpolationAlgorithm\n ) {\n return false;\n }\n\n const derivativeTypes = this._derivativeTypes;\n const hasDerivatives = defined(derivativeTypes);\n const otherDerivativeTypes = other._derivativeTypes;\n const otherHasDerivatives = defined(otherDerivativeTypes);\n if (hasDerivatives !== otherHasDerivatives) {\n return false;\n }\n\n let i;\n let length;\n if (hasDerivatives) {\n length = derivativeTypes.length;\n if (length !== otherDerivativeTypes.length) {\n return false;\n }\n\n for (i = 0; i < length; i++) {\n if (derivativeTypes[i] !== otherDerivativeTypes[i]) {\n return false;\n }\n }\n }\n\n const times = this._times;\n const otherTimes = other._times;\n length = times.length;\n\n if (length !== otherTimes.length) {\n return false;\n }\n\n for (i = 0; i < length; i++) {\n if (!JulianDate.equals(times[i], otherTimes[i])) {\n return false;\n }\n }\n\n const values = this._values;\n const otherValues = other._values;\n length = values.length;\n\n //Since time lengths are equal, values length and other length are guaranteed to be equal.\n for (i = 0; i < length; i++) {\n if (values[i] !== otherValues[i]) {\n return false;\n }\n }\n\n return true;\n};\n\n//Exposed for testing.\nSampledProperty._mergeNewSamples = mergeNewSamples;\nexport default SampledProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport PositionProperty from \"./PositionProperty.js\";\nimport Property from \"./Property.js\";\nimport SampledProperty from \"./SampledProperty.js\";\n\n/**\n * A {@link SampledProperty} which is also a {@link PositionProperty}.\n *\n * @alias SampledPositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n * @param {Number} [numberOfDerivatives=0] The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...\n */\nfunction SampledPositionProperty(referenceFrame, numberOfDerivatives) {\n numberOfDerivatives = defaultValue(numberOfDerivatives, 0);\n\n let derivativeTypes;\n if (numberOfDerivatives > 0) {\n derivativeTypes = new Array(numberOfDerivatives);\n for (let i = 0; i < numberOfDerivatives; i++) {\n derivativeTypes[i] = Cartesian3;\n }\n }\n\n this._numberOfDerivatives = numberOfDerivatives;\n this._property = new SampledProperty(Cartesian3, derivativeTypes);\n this._definitionChanged = new Event();\n this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n\n this._property._definitionChanged.addEventListener(function () {\n this._definitionChanged.raiseEvent(this);\n }, this);\n}\n\nObject.defineProperties(SampledPositionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof SampledPositionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._property.isConstant;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof SampledPositionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the reference frame in which the position is defined.\n * @memberof SampledPositionProperty.prototype\n * @type {ReferenceFrame}\n * @default ReferenceFrame.FIXED;\n */\n referenceFrame: {\n get: function () {\n return this._referenceFrame;\n },\n },\n /**\n * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.\n * @memberof SampledPositionProperty.prototype\n *\n * @type {Number}\n * @default 1\n * @readonly\n */\n interpolationDegree: {\n get: function () {\n return this._property.interpolationDegree;\n },\n },\n /**\n * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.\n * @memberof SampledPositionProperty.prototype\n *\n * @type {InterpolationAlgorithm}\n * @default LinearApproximation\n * @readonly\n */\n interpolationAlgorithm: {\n get: function () {\n return this._property.interpolationAlgorithm;\n },\n },\n /**\n * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.\n * @memberof SampledPositionProperty.prototype\n *\n * @type {Number}\n * @default 0\n */\n numberOfDerivatives: {\n get: function () {\n return this._numberOfDerivatives;\n },\n },\n /**\n * Gets or sets the type of extrapolation to perform when a value\n * is requested at a time after any available samples.\n * @memberof SampledPositionProperty.prototype\n * @type {ExtrapolationType}\n * @default ExtrapolationType.NONE\n */\n forwardExtrapolationType: {\n get: function () {\n return this._property.forwardExtrapolationType;\n },\n set: function (value) {\n this._property.forwardExtrapolationType = value;\n },\n },\n /**\n * Gets or sets the amount of time to extrapolate forward before\n * the property becomes undefined. A value of 0 will extrapolate forever.\n * @memberof SampledPositionProperty.prototype\n * @type {Number}\n * @default 0\n */\n forwardExtrapolationDuration: {\n get: function () {\n return this._property.forwardExtrapolationDuration;\n },\n set: function (value) {\n this._property.forwardExtrapolationDuration = value;\n },\n },\n /**\n * Gets or sets the type of extrapolation to perform when a value\n * is requested at a time before any available samples.\n * @memberof SampledPositionProperty.prototype\n * @type {ExtrapolationType}\n * @default ExtrapolationType.NONE\n */\n backwardExtrapolationType: {\n get: function () {\n return this._property.backwardExtrapolationType;\n },\n set: function (value) {\n this._property.backwardExtrapolationType = value;\n },\n },\n /**\n * Gets or sets the amount of time to extrapolate backward\n * before the property becomes undefined. A value of 0 will extrapolate forever.\n * @memberof SampledPositionProperty.prototype\n * @type {Number}\n * @default 0\n */\n backwardExtrapolationDuration: {\n get: function () {\n return this._property.backwardExtrapolationDuration;\n },\n set: function (value) {\n this._property.backwardExtrapolationDuration = value;\n },\n },\n});\n\n/**\n * Gets the position at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledPositionProperty.prototype.getValue = function (time, result) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the position at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nSampledPositionProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n result = this._property.getValue(time, result);\n if (defined(result)) {\n return PositionProperty.convertToReferenceFrame(\n time,\n result,\n this._referenceFrame,\n referenceFrame,\n result\n );\n }\n return undefined;\n};\n\n/**\n * Sets the algorithm and degree to use when interpolating a position.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {InterpolationAlgorithm} [options.interpolationAlgorithm] The new interpolation algorithm. If undefined, the existing property will be unchanged.\n * @param {Number} [options.interpolationDegree] The new interpolation degree. If undefined, the existing property will be unchanged.\n */\nSampledPositionProperty.prototype.setInterpolationOptions = function (options) {\n this._property.setInterpolationOptions(options);\n};\n\n/**\n * Adds a new sample.\n *\n * @param {JulianDate} time The sample time.\n * @param {Cartesian3} position The position at the provided time.\n * @param {Cartesian3[]} [derivatives] The array of derivative values at the provided time.\n */\nSampledPositionProperty.prototype.addSample = function (\n time,\n position,\n derivatives\n) {\n const numberOfDerivatives = this._numberOfDerivatives;\nthis._property.addSample(time, position, derivatives);\n};\n\n/**\n * Adds multiple samples via parallel arrays.\n *\n * @param {JulianDate[]} times An array of JulianDate instances where each index is a sample time.\n * @param {Cartesian3[]} positions An array of Cartesian3 position instances, where each value corresponds to the provided time index.\n * @param {Array[]} [derivatives] An array where each value is another array containing derivatives for the corresponding time index.\n *\n * @exception {DeveloperError} All arrays must be the same length.\n */\nSampledPositionProperty.prototype.addSamples = function (\n times,\n positions,\n derivatives\n) {\n this._property.addSamples(times, positions, derivatives);\n};\n\n/**\n * Adds samples as a single packed array where each new sample is represented as a date,\n * followed by the packed representation of the corresponding value and derivatives.\n *\n * @param {Number[]} packedSamples The array of packed samples.\n * @param {JulianDate} [epoch] If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.\n */\nSampledPositionProperty.prototype.addSamplesPackedArray = function (\n packedSamples,\n epoch\n) {\n this._property.addSamplesPackedArray(packedSamples, epoch);\n};\n\n/**\n * Removes a sample at the given time, if present.\n *\n * @param {JulianDate} time The sample time.\n * @returns {Boolean} <code>true</code> if a sample at time was removed, <code>false</code> otherwise.\n */\nSampledPositionProperty.prototype.removeSample = function (time) {\n return this._property.removeSample(time);\n};\n\n/**\n * Removes all samples for the given time interval.\n *\n * @param {TimeInterval} time The time interval for which to remove all samples.\n */\nSampledPositionProperty.prototype.removeSamples = function (timeInterval) {\n this._property.removeSamples(timeInterval);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nSampledPositionProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof SampledPositionProperty &&\n Property.equals(this._property, other._property) && //\n this._referenceFrame === other._referenceFrame)\n );\n};\nexport default SampledPositionProperty;\n", "/**\n * Defined the orientation of stripes in {@link StripeMaterialProperty}.\n *\n * @enum {Number}\n */\nconst StripeOrientation = {\n /**\n * Horizontal orientation.\n * @type {Number}\n */\n HORIZONTAL: 0,\n\n /**\n * Vertical orientation.\n * @type {Number}\n */\n VERTICAL: 1,\n};\nexport default Object.freeze(StripeOrientation);\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport createPropertyDescriptor from \"./createPropertyDescriptor.js\";\nimport Property from \"./Property.js\";\nimport StripeOrientation from \"./StripeOrientation.js\";\n\nconst defaultOrientation = StripeOrientation.HORIZONTAL;\nconst defaultEvenColor = Color.WHITE;\nconst defaultOddColor = Color.BLACK;\nconst defaultOffset = 0;\nconst defaultRepeat = 1;\n\n/**\n * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.\n * @alias StripeMaterialProperty\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Property|StripeOrientation} [options.orientation=StripeOrientation.HORIZONTAL] A Property specifying the {@link StripeOrientation}.\n * @param {Property|Color} [options.evenColor=Color.WHITE] A Property specifying the first {@link Color}.\n * @param {Property|Color} [options.oddColor=Color.BLACK] A Property specifying the second {@link Color}.\n * @param {Property|Number} [options.offset=0] A numeric Property specifying how far into the pattern to start the material.\n * @param {Property|Number} [options.repeat=1] A numeric Property specifying how many times the stripes repeat.\n */\nfunction StripeMaterialProperty(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._definitionChanged = new Event();\n this._orientation = undefined;\n this._orientationSubscription = undefined;\n this._evenColor = undefined;\n this._evenColorSubscription = undefined;\n this._oddColor = undefined;\n this._oddColorSubscription = undefined;\n this._offset = undefined;\n this._offsetSubscription = undefined;\n this._repeat = undefined;\n this._repeatSubscription = undefined;\n\n this.orientation = options.orientation;\n this.evenColor = options.evenColor;\n this.oddColor = options.oddColor;\n this.offset = options.offset;\n this.repeat = options.repeat;\n}\n\nObject.defineProperties(StripeMaterialProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof StripeMaterialProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return (\n Property.isConstant(this._orientation) && //\n Property.isConstant(this._evenColor) && //\n Property.isConstant(this._oddColor) && //\n Property.isConstant(this._offset) && //\n Property.isConstant(this._repeat)\n );\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof StripeMaterialProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n\n /**\n * Gets or sets the Property specifying the {@link StripeOrientation}/\n * @memberof StripeMaterialProperty.prototype\n * @type {Property|undefined}\n * @default StripeOrientation.HORIZONTAL\n */\n orientation: createPropertyDescriptor(\"orientation\"),\n\n /**\n * Gets or sets the Property specifying the first {@link Color}.\n * @memberof StripeMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.WHITE\n */\n evenColor: createPropertyDescriptor(\"evenColor\"),\n\n /**\n * Gets or sets the Property specifying the second {@link Color}.\n * @memberof StripeMaterialProperty.prototype\n * @type {Property|undefined}\n * @default Color.BLACK\n */\n oddColor: createPropertyDescriptor(\"oddColor\"),\n\n /**\n * Gets or sets the numeric Property specifying the point into the pattern\n * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning\n * of the odd color, 2.0 being the even color again, and any multiple or fractional values\n * being in between.\n * @memberof StripeMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 0.0\n */\n offset: createPropertyDescriptor(\"offset\"),\n\n /**\n * Gets or sets the numeric Property specifying how many times the stripes repeat.\n * @memberof StripeMaterialProperty.prototype\n * @type {Property|undefined}\n * @default 1.0\n */\n repeat: createPropertyDescriptor(\"repeat\"),\n});\n\n/**\n * Gets the {@link Material} type at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the type.\n * @returns {String} The type of material.\n */\nStripeMaterialProperty.prototype.getType = function (time) {\n return \"Stripe\";\n};\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nStripeMaterialProperty.prototype.getValue = function (time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.horizontal =\n Property.getValueOrDefault(this._orientation, time, defaultOrientation) ===\n StripeOrientation.HORIZONTAL;\n result.evenColor = Property.getValueOrClonedDefault(\n this._evenColor,\n time,\n defaultEvenColor,\n result.evenColor\n );\n result.oddColor = Property.getValueOrClonedDefault(\n this._oddColor,\n time,\n defaultOddColor,\n result.oddColor\n );\n result.offset = Property.getValueOrDefault(this._offset, time, defaultOffset);\n result.repeat = Property.getValueOrDefault(this._repeat, time, defaultRepeat);\n return result;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nStripeMaterialProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof StripeMaterialProperty && //\n Property.equals(this._orientation, other._orientation) && //\n Property.equals(this._evenColor, other._evenColor) && //\n Property.equals(this._oddColor, other._oddColor) && //\n Property.equals(this._offset, other._offset) && //\n Property.equals(this._repeat, other._repeat))\n );\n};\nexport default StripeMaterialProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport PositionProperty from \"./PositionProperty.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.\n *\n * @alias TimeIntervalCollectionPositionProperty\n * @constructor\n *\n * @param {ReferenceFrame} [referenceFrame=ReferenceFrame.FIXED] The reference frame in which the position is defined.\n */\nfunction TimeIntervalCollectionPositionProperty(referenceFrame) {\n this._definitionChanged = new Event();\n this._intervals = new TimeIntervalCollection();\n this._intervals.changedEvent.addEventListener(\n TimeIntervalCollectionPositionProperty.prototype._intervalsChanged,\n this\n );\n this._referenceFrame = defaultValue(referenceFrame, ReferenceFrame.FIXED);\n}\n\nObject.defineProperties(TimeIntervalCollectionPositionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof TimeIntervalCollectionPositionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._intervals.isEmpty;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is considered to have changed if a call to getValue would return\n * a different result for the same time.\n * @memberof TimeIntervalCollectionPositionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the interval collection.\n * @memberof TimeIntervalCollectionPositionProperty.prototype\n * @type {TimeIntervalCollection}\n * @readonly\n */\n intervals: {\n get: function () {\n return this._intervals;\n },\n },\n /**\n * Gets the reference frame in which the position is defined.\n * @memberof TimeIntervalCollectionPositionProperty.prototype\n * @type {ReferenceFrame}\n * @readonly\n * @default ReferenceFrame.FIXED;\n */\n referenceFrame: {\n get: function () {\n return this._referenceFrame;\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time in the fixed frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionPositionProperty.prototype.getValue = function (\n time,\n result\n) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\n/**\n * Gets the value of the property at the provided time and in the provided reference frame.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3 | undefined} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n const position = this._intervals.findDataForIntervalContainingDate(time);\n if (defined(position)) {\n return PositionProperty.convertToReferenceFrame(\n time,\n position,\n this._referenceFrame,\n referenceFrame,\n result\n );\n }\n return undefined;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollectionPositionProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof TimeIntervalCollectionPositionProperty && //\n this._intervals.equals(other._intervals, Property.equals) && //\n this._referenceFrame === other._referenceFrame)\n );\n};\n\n/**\n * @private\n */\nTimeIntervalCollectionPositionProperty.prototype._intervalsChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default TimeIntervalCollectionPositionProperty;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the\n * data property of each {@link TimeInterval} represents the value at time.\n *\n * @alias TimeIntervalCollectionProperty\n * @constructor\n *\n * @example\n * //Create a Cartesian2 interval property which contains data on August 1st, 2012\n * //and uses a different value every 6 hours.\n * const composite = new Cesium.TimeIntervalCollectionProperty();\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',\n * isStartIncluded : true,\n * isStopIncluded : false,\n * data : new Cesium.Cartesian2(2.0, 3.4)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',\n * isStartIncluded : true,\n * isStopIncluded : false,\n * data : new Cesium.Cartesian2(12.0, 2.7)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',\n * isStartIncluded : true,\n * isStopIncluded : false,\n * data : new Cesium.Cartesian2(5.0, 12.4)\n * }));\n * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({\n * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',\n * isStartIncluded : true,\n * isStopIncluded : true,\n * data : new Cesium.Cartesian2(85.0, 4.1)\n * }));\n */\nfunction TimeIntervalCollectionProperty() {\n this._definitionChanged = new Event();\n this._intervals = new TimeIntervalCollection();\n this._intervals.changedEvent.addEventListener(\n TimeIntervalCollectionProperty.prototype._intervalsChanged,\n this\n );\n}\n\nObject.defineProperties(TimeIntervalCollectionProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant. A property is considered\n * constant if getValue always returns the same result for the current definition.\n * @memberof TimeIntervalCollectionProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return this._intervals.isEmpty;\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * The definition is changed whenever setValue is called with data different\n * than the current value.\n * @memberof TimeIntervalCollectionProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets the interval collection.\n * @memberof TimeIntervalCollectionProperty.prototype\n *\n * @type {TimeIntervalCollection}\n * @readonly\n */\n intervals: {\n get: function () {\n return this._intervals;\n },\n },\n});\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve the value.\n * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nTimeIntervalCollectionProperty.prototype.getValue = function (time, result) {\n const value = this._intervals.findDataForIntervalContainingDate(time);\n if (defined(value) && typeof value.clone === \"function\") {\n return value.clone(result);\n }\n return value;\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nTimeIntervalCollectionProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof TimeIntervalCollectionProperty && //\n this._intervals.equals(other._intervals, Property.equals))\n );\n};\n\n/**\n * @private\n */\nTimeIntervalCollectionProperty.prototype._intervalsChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default TimeIntervalCollectionProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Property from \"./Property.js\";\n\n/**\n * A {@link Property} which evaluates to a {@link Cartesian3} vector\n * based on the velocity of the provided {@link PositionProperty}.\n *\n * @alias VelocityVectorProperty\n * @constructor\n *\n * @param {PositionProperty} [position] The position property used to compute the velocity.\n * @param {Boolean} [normalize=true] Whether to normalize the computed velocity vector.\n *\n * @example\n * //Create an entity with a billboard rotated to match its velocity.\n * const position = new Cesium.SampledProperty();\n * position.addSamples(...);\n * const entity = viewer.entities.add({\n * position : position,\n * billboard : {\n * image : 'image.png',\n * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector\n * }\n * }));\n */\nfunction VelocityVectorProperty(position, normalize) {\n this._position = undefined;\n this._subscription = undefined;\n this._definitionChanged = new Event();\n this._normalize = defaultValue(normalize, true);\n\n this.position = position;\n}\n\nObject.defineProperties(VelocityVectorProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * @memberof VelocityVectorProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return Property.isConstant(this._position);\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * @memberof VelocityVectorProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the position property used to compute the velocity vector.\n * @memberof VelocityVectorProperty.prototype\n *\n * @type {Property|undefined}\n */\n position: {\n get: function () {\n return this._position;\n },\n set: function (value) {\n const oldValue = this._position;\n if (oldValue !== value) {\n if (defined(oldValue)) {\n this._subscription();\n }\n\n this._position = value;\n\n if (defined(value)) {\n this._subscription = value._definitionChanged.addEventListener(\n function () {\n this._definitionChanged.raiseEvent(this);\n },\n this\n );\n }\n\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n /**\n * Gets or sets whether the vector produced by this property\n * will be normalized or not.\n * @memberof VelocityVectorProperty.prototype\n *\n * @type {Boolean}\n */\n normalize: {\n get: function () {\n return this._normalize;\n },\n set: function (value) {\n if (this._normalize === value) {\n return;\n }\n\n this._normalize = value;\n this._definitionChanged.raiseEvent(this);\n },\n },\n});\n\nconst position1Scratch = new Cartesian3();\nconst position2Scratch = new Cartesian3();\nconst timeScratch = new JulianDate();\nconst step = 1.0 / 60.0;\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value.\n * @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nVelocityVectorProperty.prototype.getValue = function (time, result) {\n return this._getValue(time, result);\n};\n\n/**\n * @private\n */\nVelocityVectorProperty.prototype._getValue = function (\n time,\n velocityResult,\n positionResult\n) {\n if (!defined(velocityResult)) {\n velocityResult = new Cartesian3();\n }\n\n const property = this._position;\n if (Property.isConstant(property)) {\n return this._normalize\n ? undefined\n : Cartesian3.clone(Cartesian3.ZERO, velocityResult);\n }\n\n let position1 = property.getValue(time, position1Scratch);\n let position2 = property.getValue(\n JulianDate.addSeconds(time, step, timeScratch),\n position2Scratch\n );\n\n //If we don't have a position for now, return undefined.\n if (!defined(position1)) {\n return undefined;\n }\n\n //If we don't have a position for now + step, see if we have a position for now - step.\n if (!defined(position2)) {\n position2 = position1;\n position1 = property.getValue(\n JulianDate.addSeconds(time, -step, timeScratch),\n position2Scratch\n );\n\n if (!defined(position1)) {\n return undefined;\n }\n }\n\n if (Cartesian3.equals(position1, position2)) {\n return this._normalize\n ? undefined\n : Cartesian3.clone(Cartesian3.ZERO, velocityResult);\n }\n\n if (defined(positionResult)) {\n position1.clone(positionResult);\n }\n\n const velocity = Cartesian3.subtract(position2, position1, velocityResult);\n if (this._normalize) {\n return Cartesian3.normalize(velocity, velocityResult);\n }\n\n return Cartesian3.divideByScalar(velocity, step, velocityResult);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nVelocityVectorProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof VelocityVectorProperty &&\n Property.equals(this._position, other._position))\n );\n};\nexport default VelocityVectorProperty;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Property from \"./Property.js\";\nimport VelocityVectorProperty from \"./VelocityVectorProperty.js\";\n\n/**\n * A {@link Property} which evaluates to a {@link Quaternion} rotation\n * based on the velocity of the provided {@link PositionProperty}.\n *\n * @alias VelocityOrientationProperty\n * @constructor\n *\n * @param {PositionProperty} [position] The position property used to compute the orientation.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine which way is up.\n *\n * @example\n * //Create an entity with position and orientation.\n * const position = new Cesium.SampledProperty();\n * position.addSamples(...);\n * const entity = viewer.entities.add({\n * position : position,\n * orientation : new Cesium.VelocityOrientationProperty(position)\n * }));\n */\nfunction VelocityOrientationProperty(position, ellipsoid) {\n this._velocityVectorProperty = new VelocityVectorProperty(position, true);\n this._subscription = undefined;\n this._ellipsoid = undefined;\n this._definitionChanged = new Event();\n\n this.ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n const that = this;\n this._velocityVectorProperty.definitionChanged.addEventListener(function () {\n that._definitionChanged.raiseEvent(that);\n });\n}\n\nObject.defineProperties(VelocityOrientationProperty.prototype, {\n /**\n * Gets a value indicating if this property is constant.\n * @memberof VelocityOrientationProperty.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isConstant: {\n get: function () {\n return Property.isConstant(this._velocityVectorProperty);\n },\n },\n /**\n * Gets the event that is raised whenever the definition of this property changes.\n * @memberof VelocityOrientationProperty.prototype\n *\n * @type {Event}\n * @readonly\n */\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n /**\n * Gets or sets the position property used to compute orientation.\n * @memberof VelocityOrientationProperty.prototype\n *\n * @type {Property|undefined}\n */\n position: {\n get: function () {\n return this._velocityVectorProperty.position;\n },\n set: function (value) {\n this._velocityVectorProperty.position = value;\n },\n },\n /**\n * Gets or sets the ellipsoid used to determine which way is up.\n * @memberof VelocityOrientationProperty.prototype\n *\n * @type {Property|undefined}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n set: function (value) {\n const oldValue = this._ellipsoid;\n if (oldValue !== value) {\n this._ellipsoid = value;\n this._definitionChanged.raiseEvent(this);\n }\n },\n },\n});\n\nconst positionScratch = new Cartesian3();\nconst velocityScratch = new Cartesian3();\nconst rotationScratch = new Matrix3();\n\n/**\n * Gets the value of the property at the provided time.\n *\n * @param {JulianDate} [time] The time for which to retrieve the value.\n * @param {Quaternion} [result] The object to store the value into, if omitted, a new instance is created and returned.\n * @returns {Quaternion} The modified result parameter or a new instance if the result parameter was not supplied.\n */\nVelocityOrientationProperty.prototype.getValue = function (time, result) {\n const velocity = this._velocityVectorProperty._getValue(\n time,\n velocityScratch,\n positionScratch\n );\n\n if (!defined(velocity)) {\n return undefined;\n }\n\n Transforms.rotationMatrixFromPositionVelocity(\n positionScratch,\n velocity,\n this._ellipsoid,\n rotationScratch\n );\n return Quaternion.fromRotationMatrix(rotationScratch, result);\n};\n\n/**\n * Compares this property to the provided property and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {Property} [other] The other property.\n * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.\n */\nVelocityOrientationProperty.prototype.equals = function (other) {\n return (\n this === other || //\n (other instanceof VelocityOrientationProperty &&\n Property.equals(\n this._velocityVectorProperty,\n other._velocityVectorProperty\n ) &&\n (this._ellipsoid === other._ellipsoid ||\n this._ellipsoid.equals(other._ellipsoid)))\n );\n};\nexport default VelocityOrientationProperty;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A collection of {@link DataSource} instances.\n * @alias DataSourceCollection\n * @constructor\n */\nfunction DataSourceCollection() {\n this._dataSources = [];\n this._dataSourceAdded = new Event();\n this._dataSourceRemoved = new Event();\n this._dataSourceMoved = new Event();\n}\n\nObject.defineProperties(DataSourceCollection.prototype, {\n /**\n * Gets the number of data sources in this collection.\n * @memberof DataSourceCollection.prototype\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._dataSources.length;\n },\n },\n\n /**\n * An event that is raised when a data source is added to the collection.\n * Event handlers are passed the data source that was added.\n * @memberof DataSourceCollection.prototype\n * @type {Event}\n * @readonly\n */\n dataSourceAdded: {\n get: function () {\n return this._dataSourceAdded;\n },\n },\n\n /**\n * An event that is raised when a data source is removed from the collection.\n * Event handlers are passed the data source that was removed.\n * @memberof DataSourceCollection.prototype\n * @type {Event}\n * @readonly\n */\n dataSourceRemoved: {\n get: function () {\n return this._dataSourceRemoved;\n },\n },\n\n /**\n * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source\n * that was moved, its new index after the move, and its old index prior to the move.\n * @memberof DataSourceCollection.prototype\n * @type {Event}\n * @readonly\n */\n dataSourceMoved: {\n get: function () {\n return this._dataSourceMoved;\n },\n },\n});\n\n/**\n * Adds a data source to the collection.\n *\n * @param {DataSource|Promise.<DataSource>} dataSource A data source or a promise to a data source to add to the collection.\n * When passing a promise, the data source will not actually be added\n * to the collection until the promise resolves successfully.\n * @returns {Promise.<DataSource>} A Promise that resolves once the data source has been added to the collection.\n */\nDataSourceCollection.prototype.add = function (dataSource) {\n const that = this;\n const dataSources = this._dataSources;\n return Promise.resolve(dataSource).then(function (value) {\n //Only add the data source if removeAll has not been called\n //Since it was added.\n if (dataSources === that._dataSources) {\n that._dataSources.push(value);\n that._dataSourceAdded.raiseEvent(that, value);\n }\n return value;\n });\n};\n\n/**\n * Removes a data source from this collection, if present.\n *\n * @param {DataSource} dataSource The data source to remove.\n * @param {Boolean} [destroy=false] Whether to destroy the data source in addition to removing it.\n * @returns {Boolean} true if the data source was in the collection and was removed,\n * false if the data source was not in the collection.\n */\nDataSourceCollection.prototype.remove = function (dataSource, destroy) {\n destroy = defaultValue(destroy, false);\n\n const index = this._dataSources.indexOf(dataSource);\n if (index !== -1) {\n this._dataSources.splice(index, 1);\n this._dataSourceRemoved.raiseEvent(this, dataSource);\n\n if (destroy && typeof dataSource.destroy === \"function\") {\n dataSource.destroy();\n }\n\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all data sources from this collection.\n *\n * @param {Boolean} [destroy=false] whether to destroy the data sources in addition to removing them.\n */\nDataSourceCollection.prototype.removeAll = function (destroy) {\n destroy = defaultValue(destroy, false);\n\n const dataSources = this._dataSources;\n for (let i = 0, len = dataSources.length; i < len; ++i) {\n const dataSource = dataSources[i];\n this._dataSourceRemoved.raiseEvent(this, dataSource);\n\n if (destroy && typeof dataSource.destroy === \"function\") {\n dataSource.destroy();\n }\n }\n this._dataSources = [];\n};\n\n/**\n * Checks to see if the collection contains a given data source.\n *\n * @param {DataSource} dataSource The data source to check for.\n * @returns {Boolean} true if the collection contains the data source, false otherwise.\n */\nDataSourceCollection.prototype.contains = function (dataSource) {\n return this.indexOf(dataSource) !== -1;\n};\n\n/**\n * Determines the index of a given data source in the collection.\n *\n * @param {DataSource} dataSource The data source to find the index of.\n * @returns {Number} The index of the data source in the collection, or -1 if the data source does not exist in the collection.\n */\nDataSourceCollection.prototype.indexOf = function (dataSource) {\n return this._dataSources.indexOf(dataSource);\n};\n\n/**\n * Gets a data source by index from the collection.\n *\n * @param {Number} index the index to retrieve.\n * @returns {DataSource} The data source at the specified index.\n */\nDataSourceCollection.prototype.get = function (index) {\n return this._dataSources[index];\n};\n\n/**\n * Gets a data source by name from the collection.\n *\n * @param {String} name The name to retrieve.\n * @returns {DataSource[]} A list of all data sources matching the provided name.\n */\nDataSourceCollection.prototype.getByName = function (name) {\n return this._dataSources.filter(function (dataSource) {\n return dataSource.name === name;\n });\n};\n\nfunction getIndex(dataSources, dataSource) {\n const index = dataSources.indexOf(dataSource);\n\n return index;\n}\n\nfunction swapDataSources(collection, i, j) {\n const arr = collection._dataSources;\n const length = arr.length - 1;\n i = CesiumMath.clamp(i, 0, length);\n j = CesiumMath.clamp(j, 0, length);\n\n if (i === j) {\n return;\n }\n\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n\n collection.dataSourceMoved.raiseEvent(temp, j, i);\n}\n\n/**\n * Raises a data source up one position in the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.raise = function (dataSource) {\n const index = getIndex(this._dataSources, dataSource);\n swapDataSources(this, index, index + 1);\n};\n\n/**\n * Lowers a data source down one position in the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.lower = function (dataSource) {\n const index = getIndex(this._dataSources, dataSource);\n swapDataSources(this, index, index - 1);\n};\n\n/**\n * Raises a data source to the top of the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.raiseToTop = function (dataSource) {\n const index = getIndex(this._dataSources, dataSource);\n if (index === this._dataSources.length - 1) {\n return;\n }\n this._dataSources.splice(index, 1);\n this._dataSources.push(dataSource);\n\n this.dataSourceMoved.raiseEvent(\n dataSource,\n this._dataSources.length - 1,\n index\n );\n};\n\n/**\n * Lowers a data source to the bottom of the collection.\n *\n * @param {DataSource} dataSource The data source to move.\n *\n * @exception {DeveloperError} dataSource is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDataSourceCollection.prototype.lowerToBottom = function (dataSource) {\n const index = getIndex(this._dataSources, dataSource);\n if (index === 0) {\n return;\n }\n this._dataSources.splice(index, 1);\n this._dataSources.splice(0, 0, dataSource);\n\n this.dataSourceMoved.raiseEvent(dataSource, 0, index);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} true if this object was destroyed; otherwise, false.\n *\n * @see DataSourceCollection#destroy\n */\nDataSourceCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the resources held by all data sources in this collection. Explicitly destroying this\n * object allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector. Once this object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();\n *\n * @see DataSourceCollection#isDestroyed\n */\nDataSourceCollection.prototype.destroy = function () {\n this.removeAll(true);\n return destroyObject(this);\n};\nexport default DataSourceCollection;\n", "import createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A collection of primitives. This is most often used with {@link Scene#primitives},\n * but <code>PrimitiveCollection</code> is also a primitive itself so collections can\n * be added to collections forming a hierarchy.\n *\n * @alias PrimitiveCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.show=true] Determines if the primitives in the collection will be shown.\n * @param {Boolean} [options.destroyPrimitives=true] Determines if primitives in the collection are destroyed when they are removed.\n *\n * @example\n * const billboards = new Cesium.BillboardCollection();\n * const labels = new Cesium.LabelCollection();\n *\n * const collection = new Cesium.PrimitiveCollection();\n * collection.add(billboards);\n *\n * scene.primitives.add(collection); // Add collection\n * scene.primitives.add(labels); // Add regular primitive\n */\nfunction PrimitiveCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._primitives = [];\n this._guid = createGuid();\n\n // Used by the OrderedGroundPrimitiveCollection\n this._zIndex = undefined;\n\n /**\n * Determines if primitives in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * Determines if primitives in the collection are destroyed when they are removed by\n * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly\n * by {@link PrimitiveCollection#removeAll}.\n *\n * @type {Boolean}\n * @default true\n *\n * @example\n * // Example 1. Primitives are destroyed by default.\n * const primitives = new Cesium.PrimitiveCollection();\n * const labels = primitives.add(new Cesium.LabelCollection());\n * primitives = primitives.destroy();\n * const b = labels.isDestroyed(); // true\n *\n * @example\n * // Example 2. Do not destroy primitives in a collection.\n * const primitives = new Cesium.PrimitiveCollection();\n * primitives.destroyPrimitives = false;\n * const labels = primitives.add(new Cesium.LabelCollection());\n * primitives = primitives.destroy();\n * const b = labels.isDestroyed(); // false\n * labels = labels.destroy(); // explicitly destroy\n */\n this.destroyPrimitives = defaultValue(options.destroyPrimitives, true);\n}\n\nObject.defineProperties(PrimitiveCollection.prototype, {\n /**\n * Gets the number of primitives in the collection.\n *\n * @memberof PrimitiveCollection.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._primitives.length;\n },\n },\n});\n\n/**\n * Adds a primitive to the collection.\n *\n * @param {Object} primitive The primitive to add.\n * @param {Number} [index] The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.\n * @returns {Object} The primitive added to the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n */\nPrimitiveCollection.prototype.add = function (primitive, index) {\n const hasIndex = defined(index);\n\n const external = (primitive._external = primitive._external || {});\n const composites = (external._composites = external._composites || {});\n composites[this._guid] = {\n collection: this,\n };\n\n if (!hasIndex) {\n this._primitives.push(primitive);\n } else {\n this._primitives.splice(index, 0, primitive);\n }\n\n return primitive;\n};\n\n/**\n * Removes a primitive from the collection.\n *\n * @param {Object} [primitive] The primitive to remove.\n * @returns {Boolean} <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const billboards = scene.primitives.add(new Cesium.BillboardCollection());\n * scene.primitives.remove(billboards); // Returns true\n *\n * @see PrimitiveCollection#destroyPrimitives\n */\nPrimitiveCollection.prototype.remove = function (primitive) {\n // PERFORMANCE_IDEA: We can obviously make this a lot faster.\n if (this.contains(primitive)) {\n const index = this._primitives.indexOf(primitive);\n if (index !== -1) {\n this._primitives.splice(index, 1);\n\n delete primitive._external._composites[this._guid];\n\n if (this.destroyPrimitives) {\n primitive.destroy();\n }\n\n return true;\n }\n // else ... this is not possible, I swear.\n }\n\n return false;\n};\n\n/**\n * Removes and destroys a primitive, regardless of destroyPrimitives setting.\n * @private\n */\nPrimitiveCollection.prototype.removeAndDestroy = function (primitive) {\n const removed = this.remove(primitive);\n if (removed && !this.destroyPrimitives) {\n primitive.destroy();\n }\n return removed;\n};\n\n/**\n * Removes all primitives in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#destroyPrimitives\n */\nPrimitiveCollection.prototype.removeAll = function () {\n const primitives = this._primitives;\n const length = primitives.length;\n for (let i = 0; i < length; ++i) {\n delete primitives[i]._external._composites[this._guid];\n if (this.destroyPrimitives) {\n primitives[i].destroy();\n }\n }\n this._primitives = [];\n};\n\n/**\n * Determines if this collection contains a primitive.\n *\n * @param {Object} [primitive] The primitive to check for.\n * @returns {Boolean} <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#get\n */\nPrimitiveCollection.prototype.contains = function (primitive) {\n return !!(\n defined(primitive) &&\n primitive._external &&\n primitive._external._composites &&\n primitive._external._composites[this._guid]\n );\n};\n\nfunction getPrimitiveIndex(compositePrimitive, primitive) {\n return compositePrimitive._primitives.indexOf(primitive);\n}\n\n/**\n * Raises a primitive \"up one\" in the collection. If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive up one.\n *\n * @param {Object} [primitive] The primitive to raise.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#raiseToTop\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#lowerToBottom\n */\nPrimitiveCollection.prototype.raise = function (primitive) {\n if (defined(primitive)) {\n const index = getPrimitiveIndex(this, primitive);\n const primitives = this._primitives;\n\n if (index !== primitives.length - 1) {\n const p = primitives[index];\n primitives[index] = primitives[index + 1];\n primitives[index + 1] = p;\n }\n }\n};\n\n/**\n * Raises a primitive to the \"top\" of the collection. If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive to the top.\n *\n * @param {Object} [primitive] The primitive to raise the top.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#lowerToBottom\n */\nPrimitiveCollection.prototype.raiseToTop = function (primitive) {\n if (defined(primitive)) {\n const index = getPrimitiveIndex(this, primitive);\n const primitives = this._primitives;\n\n if (index !== primitives.length - 1) {\n // PERFORMANCE_IDEA: Could be faster\n primitives.splice(index, 1);\n primitives.push(primitive);\n }\n }\n};\n\n/**\n * Lowers a primitive \"down one\" in the collection. If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive down one.\n *\n * @param {Object} [primitive] The primitive to lower.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#lowerToBottom\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#raiseToTop\n */\nPrimitiveCollection.prototype.lower = function (primitive) {\n if (defined(primitive)) {\n const index = getPrimitiveIndex(this, primitive);\n const primitives = this._primitives;\n\n if (index !== 0) {\n const p = primitives[index];\n primitives[index] = primitives[index - 1];\n primitives[index - 1] = p;\n }\n }\n};\n\n/**\n * Lowers a primitive to the \"bottom\" of the collection. If all primitives in the collection are drawn\n * on the globe surface, this visually moves the primitive to the bottom.\n *\n * @param {Object} [primitive] The primitive to lower to the bottom.\n *\n * @exception {DeveloperError} primitive is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PrimitiveCollection#lower\n * @see PrimitiveCollection#raise\n * @see PrimitiveCollection#raiseToTop\n */\nPrimitiveCollection.prototype.lowerToBottom = function (primitive) {\n if (defined(primitive)) {\n const index = getPrimitiveIndex(this, primitive);\n const primitives = this._primitives;\n\n if (index !== 0) {\n // PERFORMANCE_IDEA: Could be faster\n primitives.splice(index, 1);\n primitives.unshift(primitive);\n }\n }\n};\n\n/**\n * Returns the primitive in the collection at the specified index.\n *\n * @param {Number} index The zero-based index of the primitive to return.\n * @returns {Object} The primitive at the <code>index</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every primitive in the collection.\n * const primitives = scene.primitives;\n * const length = primitives.length;\n * for (let i = 0; i < length; ++i) {\n * const p = primitives.get(i);\n * p.show = !p.show;\n * }\n *\n * @see PrimitiveCollection#length\n */\nPrimitiveCollection.prototype.get = function (index) {\n return this._primitives[index];\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const primitives = this._primitives;\n // Using primitives.length in the loop is a temporary workaround\n // to allow quadtree updates to add and remove primitives in\n // update(). This will be changed to manage added and removed lists.\n for (let i = 0; i < primitives.length; ++i) {\n primitives[i].update(frameState);\n }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.prePassesUpdate = function (frameState) {\n const primitives = this._primitives;\n // Using primitives.length in the loop is a temporary workaround\n // to allow quadtree updates to add and remove primitives in\n // update(). This will be changed to manage added and removed lists.\n for (let i = 0; i < primitives.length; ++i) {\n const primitive = primitives[i];\n if (defined(primitive.prePassesUpdate)) {\n primitive.prePassesUpdate(frameState);\n }\n }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.updateForPass = function (frameState, passState) {\n const primitives = this._primitives;\n // Using primitives.length in the loop is a temporary workaround\n // to allow quadtree updates to add and remove primitives in\n // update(). This will be changed to manage added and removed lists.\n for (let i = 0; i < primitives.length; ++i) {\n const primitive = primitives[i];\n if (defined(primitive.updateForPass)) {\n primitive.updateForPass(frameState, passState);\n }\n }\n};\n\n/**\n * @private\n */\nPrimitiveCollection.prototype.postPassesUpdate = function (frameState) {\n const primitives = this._primitives;\n // Using primitives.length in the loop is a temporary workaround\n // to allow quadtree updates to add and remove primitives in\n // update(). This will be changed to manage added and removed lists.\n for (let i = 0; i < primitives.length; ++i) {\n const primitive = primitives[i];\n if (defined(primitive.postPassesUpdate)) {\n primitive.postPassesUpdate(frameState);\n }\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see PrimitiveCollection#destroy\n */\nPrimitiveCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this\n * collection allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector to destroy this collection.\n * <br /><br />\n * Since destroying a collection destroys all the contained primitives, only destroy a collection\n * when you are sure no other code is still using any of the contained primitives.\n * <br /><br />\n * Once this collection is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitives = primitives && primitives.destroy();\n *\n * @see PrimitiveCollection#isDestroyed\n */\nPrimitiveCollection.prototype.destroy = function () {\n this.removeAll();\n return destroyObject(this);\n};\nexport default PrimitiveCollection;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\n\n/**\n * A primitive collection for helping maintain the order or ground primitives based on a z-index\n *\n * @private\n */\nfunction OrderedGroundPrimitiveCollection() {\n this._length = 0;\n this._collections = {};\n this._collectionsArray = [];\n\n this.show = true;\n}\n\nObject.defineProperties(OrderedGroundPrimitiveCollection.prototype, {\n /**\n * Gets the number of primitives in the collection.\n *\n * @memberof OrderedGroundPrimitiveCollection.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._length;\n },\n },\n});\n\n/**\n * Adds a primitive to the collection.\n *\n * @param {GroundPrimitive} primitive The primitive to add.\n * @param {Number} [zIndex = 0] The index of the primitive\n * @returns {GroundPrimitive} The primitive added to the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.add = function (primitive, zIndex) {\n zIndex = defaultValue(zIndex, 0);\n let collection = this._collections[zIndex];\n if (!defined(collection)) {\n collection = new PrimitiveCollection({ destroyPrimitives: false });\n collection._zIndex = zIndex;\n this._collections[zIndex] = collection;\n const array = this._collectionsArray;\n let i = 0;\n while (i < array.length && array[i]._zIndex < zIndex) {\n i++;\n }\n array.splice(i, 0, collection);\n }\n\n collection.add(primitive);\n this._length++;\n primitive._zIndex = zIndex;\n\n return primitive;\n};\n\n/**\n * Adjusts the z-index\n * @param {GroundPrimitive} primitive\n * @param {Number} zIndex\n */\nOrderedGroundPrimitiveCollection.prototype.set = function (primitive, zIndex) {\n if (zIndex === primitive._zIndex) {\n return primitive;\n }\n\n this.remove(primitive, true);\n this.add(primitive, zIndex);\n\n return primitive;\n};\n\n/**\n * Removes a primitive from the collection.\n *\n * @param {Object} primitive The primitive to remove.\n * @param {Boolean} [doNotDestroy = false]\n * @returns {Boolean} <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.remove = function (\n primitive,\n doNotDestroy\n) {\n if (this.contains(primitive)) {\n const index = primitive._zIndex;\n const collection = this._collections[index];\n let result;\n if (doNotDestroy) {\n result = collection.remove(primitive);\n } else {\n result = collection.removeAndDestroy(primitive);\n }\n\n if (result) {\n this._length--;\n }\n\n if (collection.length === 0) {\n this._collectionsArray.splice(\n this._collectionsArray.indexOf(collection),\n 1\n );\n this._collections[index] = undefined;\n collection.destroy();\n }\n\n return result;\n }\n\n return false;\n};\n\n/**\n * Removes all primitives in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see OrderedGroundPrimitiveCollection#destroyPrimitives\n */\nOrderedGroundPrimitiveCollection.prototype.removeAll = function () {\n const collections = this._collectionsArray;\n for (let i = 0; i < collections.length; i++) {\n const collection = collections[i];\n collection.destroyPrimitives = true;\n collection.destroy();\n }\n\n this._collections = {};\n this._collectionsArray = [];\n this._length = 0;\n};\n\n/**\n * Determines if this collection contains a primitive.\n *\n * @param {Object} primitive The primitive to check for.\n * @returns {Boolean} <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.\n */\nOrderedGroundPrimitiveCollection.prototype.contains = function (primitive) {\n if (!defined(primitive)) {\n return false;\n }\n const collection = this._collections[primitive._zIndex];\n return defined(collection) && collection.contains(primitive);\n};\n\n/**\n * @private\n */\nOrderedGroundPrimitiveCollection.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const collections = this._collectionsArray;\n for (let i = 0; i < collections.length; i++) {\n collections[i].update(frameState);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see OrderedGroundPrimitiveCollection#destroy\n */\nOrderedGroundPrimitiveCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this\n * collection allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector to destroy this collection.\n * <br /><br />\n * Since destroying a collection destroys all the contained primitives, only destroy a collection\n * when you are sure no other code is still using any of the contained primitives.\n * <br /><br />\n * Once this collection is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitives = primitives && primitives.destroy();\n *\n * @see OrderedGroundPrimitiveCollection#isDestroyed\n */\nOrderedGroundPrimitiveCollection.prototype.destroy = function () {\n this.removeAll();\n return destroyObject(this);\n};\nexport default OrderedGroundPrimitiveCollection;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport defined from \"../Core/defined.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\n\n/**\n * @private\n */\nfunction DynamicGeometryBatch(primitives, orderedGroundPrimitives) {\n this._primitives = primitives;\n this._orderedGroundPrimitives = orderedGroundPrimitives;\n this._dynamicUpdaters = new AssociativeArray();\n}\n\nDynamicGeometryBatch.prototype.add = function (time, updater) {\n this._dynamicUpdaters.set(\n updater.id,\n updater.createDynamicUpdater(\n this._primitives,\n this._orderedGroundPrimitives\n )\n );\n};\n\nDynamicGeometryBatch.prototype.remove = function (updater) {\n const id = updater.id;\n const dynamicUpdater = this._dynamicUpdaters.get(id);\n if (defined(dynamicUpdater)) {\n this._dynamicUpdaters.remove(id);\n dynamicUpdater.destroy();\n }\n};\n\nDynamicGeometryBatch.prototype.update = function (time) {\n const geometries = this._dynamicUpdaters.values;\n for (let i = 0, len = geometries.length; i < len; i++) {\n geometries[i].update(time);\n }\n return true;\n};\n\nDynamicGeometryBatch.prototype.removeAllPrimitives = function () {\n const geometries = this._dynamicUpdaters.values;\n for (let i = 0, len = geometries.length; i < len; i++) {\n geometries[i].destroy();\n }\n this._dynamicUpdaters.removeAll();\n};\n\nDynamicGeometryBatch.prototype.getBoundingSphere = function (updater, result) {\n updater = this._dynamicUpdaters.get(updater.id);\n if (defined(updater) && defined(updater.getBoundingSphere)) {\n return updater.getBoundingSphere(result);\n }\n return BoundingSphereState.FAILED;\n};\nexport default DynamicGeometryBatch;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst EllipseGeometryLibrary = {};\n\nconst rotAxis = new Cartesian3();\nconst tempVec = new Cartesian3();\nconst unitQuat = new Quaternion();\nconst rotMtx = new Matrix3();\n\nfunction pointOnEllipsoid(\n theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n result\n) {\n const azimuth = theta + rotation;\n\n Cartesian3.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);\n Cartesian3.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);\n Cartesian3.add(rotAxis, tempVec, rotAxis);\n\n let cosThetaSquared = Math.cos(theta);\n cosThetaSquared = cosThetaSquared * cosThetaSquared;\n\n let sinThetaSquared = Math.sin(theta);\n sinThetaSquared = sinThetaSquared * sinThetaSquared;\n\n const radius =\n ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);\n const angle = radius / mag;\n\n // Create the quaternion to rotate the position vector to the boundary of the ellipse.\n Quaternion.fromAxisAngle(rotAxis, angle, unitQuat);\n Matrix3.fromQuaternion(unitQuat, rotMtx);\n\n Matrix3.multiplyByVector(rotMtx, unitPos, result);\n Cartesian3.normalize(result, result);\n Cartesian3.multiplyByScalar(result, mag, result);\n return result;\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n/**\n * Returns the positions raised to the given heights\n * @private\n */\nEllipseGeometryLibrary.raisePositionsToHeight = function (\n positions,\n options,\n extrude\n) {\n const ellipsoid = options.ellipsoid;\n const height = options.height;\n const extrudedHeight = options.extrudedHeight;\n const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\n\n const finalPositions = new Float64Array(size * 3);\n\n const length = positions.length;\n const bottomOffset = extrude ? length : 0;\n for (let i = 0; i < length; i += 3) {\n const i1 = i + 1;\n const i2 = i + 2;\n\n const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n ellipsoid.scaleToGeodeticSurface(position, position);\n\n const extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\n const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\n const scaledNormal = Cartesian3.multiplyByScalar(\n normal,\n height,\n scratchCartesian3\n );\n Cartesian3.add(position, scaledNormal, position);\n\n if (extrude) {\n Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal);\n Cartesian3.add(extrudedPosition, scaledNormal, extrudedPosition);\n\n finalPositions[i + bottomOffset] = extrudedPosition.x;\n finalPositions[i1 + bottomOffset] = extrudedPosition.y;\n finalPositions[i2 + bottomOffset] = extrudedPosition.z;\n }\n\n finalPositions[i] = position.x;\n finalPositions[i1] = position.y;\n finalPositions[i2] = position.z;\n }\n\n return finalPositions;\n};\n\nconst unitPosScratch = new Cartesian3();\nconst eastVecScratch = new Cartesian3();\nconst northVecScratch = new Cartesian3();\n/**\n * Returns an array of positions that make up the ellipse.\n * @private\n */\nEllipseGeometryLibrary.computeEllipsePositions = function (\n options,\n addFillPositions,\n addEdgePositions\n) {\n const semiMinorAxis = options.semiMinorAxis;\n const semiMajorAxis = options.semiMajorAxis;\n const rotation = options.rotation;\n const center = options.center;\n\n // Computing the arc-length of the ellipse is too expensive to be practical. Estimating it using the\n // arc length of the sphere is too inaccurate and creates sharp edges when either the semi-major or\n // semi-minor axis is much bigger than the other. Instead, scale the angle delta to make\n // the distance along the ellipse boundary more closely match the granularity.\n const granularity = options.granularity * 8.0;\n\n const aSqr = semiMinorAxis * semiMinorAxis;\n const bSqr = semiMajorAxis * semiMajorAxis;\n const ab = semiMajorAxis * semiMinorAxis;\n\n const mag = Cartesian3.magnitude(center);\n\n const unitPos = Cartesian3.normalize(center, unitPosScratch);\n let eastVec = Cartesian3.cross(Cartesian3.UNIT_Z, center, eastVecScratch);\n eastVec = Cartesian3.normalize(eastVec, eastVec);\n const northVec = Cartesian3.cross(unitPos, eastVec, northVecScratch);\n\n // The number of points in the first quadrant\n let numPts = 1 + Math.ceil(CesiumMath.PI_OVER_TWO / granularity);\n\n const deltaTheta = CesiumMath.PI_OVER_TWO / (numPts - 1);\n let theta = CesiumMath.PI_OVER_TWO - numPts * deltaTheta;\n if (theta < 0.0) {\n numPts -= Math.ceil(Math.abs(theta) / deltaTheta);\n }\n\n // If the number of points were three, the ellipse\n // would be tessellated like below:\n //\n // *---*\n // / | \\ | \\\n // *---*---*---*\n // / | \\ | \\ | \\ | \\\n // / .*---*---*---*. \\\n // * ` | \\ | \\ | \\ | `*\n // \\`.*---*---*---*.`/\n // \\ | \\ | \\ | \\ | /\n // *---*---*---*\n // \\ | \\ | /\n // *---*\n // The first and last column have one position and fan to connect to the adjacent column.\n // Each other vertical column contains an even number of positions.\n const size = 2 * (numPts * (numPts + 2));\n const positions = addFillPositions ? new Array(size * 3) : undefined;\n let positionIndex = 0;\n let position = scratchCartesian1;\n let reflectedPosition = scratchCartesian2;\n\n const outerPositionsLength = numPts * 4 * 3;\n let outerRightIndex = outerPositionsLength - 1;\n let outerLeftIndex = 0;\n const outerPositions = addEdgePositions\n ? new Array(outerPositionsLength)\n : undefined;\n\n let i;\n let j;\n let numInterior;\n let t;\n let interiorPosition;\n\n // Compute points in the 'eastern' half of the ellipse\n theta = CesiumMath.PI_OVER_TWO;\n position = pointOnEllipsoid(\n theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n position\n );\n if (addFillPositions) {\n positions[positionIndex++] = position.x;\n positions[positionIndex++] = position.y;\n positions[positionIndex++] = position.z;\n }\n if (addEdgePositions) {\n outerPositions[outerRightIndex--] = position.z;\n outerPositions[outerRightIndex--] = position.y;\n outerPositions[outerRightIndex--] = position.x;\n }\n theta = CesiumMath.PI_OVER_TWO - deltaTheta;\n for (i = 1; i < numPts + 1; ++i) {\n position = pointOnEllipsoid(\n theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n position\n );\n reflectedPosition = pointOnEllipsoid(\n Math.PI - theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n reflectedPosition\n );\n\n if (addFillPositions) {\n positions[positionIndex++] = position.x;\n positions[positionIndex++] = position.y;\n positions[positionIndex++] = position.z;\n\n numInterior = 2 * i + 2;\n for (j = 1; j < numInterior - 1; ++j) {\n t = j / (numInterior - 1);\n interiorPosition = Cartesian3.lerp(\n position,\n reflectedPosition,\n t,\n scratchCartesian3\n );\n positions[positionIndex++] = interiorPosition.x;\n positions[positionIndex++] = interiorPosition.y;\n positions[positionIndex++] = interiorPosition.z;\n }\n\n positions[positionIndex++] = reflectedPosition.x;\n positions[positionIndex++] = reflectedPosition.y;\n positions[positionIndex++] = reflectedPosition.z;\n }\n\n if (addEdgePositions) {\n outerPositions[outerRightIndex--] = position.z;\n outerPositions[outerRightIndex--] = position.y;\n outerPositions[outerRightIndex--] = position.x;\n outerPositions[outerLeftIndex++] = reflectedPosition.x;\n outerPositions[outerLeftIndex++] = reflectedPosition.y;\n outerPositions[outerLeftIndex++] = reflectedPosition.z;\n }\n\n theta = CesiumMath.PI_OVER_TWO - (i + 1) * deltaTheta;\n }\n\n // Compute points in the 'western' half of the ellipse\n for (i = numPts; i > 1; --i) {\n theta = CesiumMath.PI_OVER_TWO - (i - 1) * deltaTheta;\n\n position = pointOnEllipsoid(\n -theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n position\n );\n reflectedPosition = pointOnEllipsoid(\n theta + Math.PI,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n reflectedPosition\n );\n\n if (addFillPositions) {\n positions[positionIndex++] = position.x;\n positions[positionIndex++] = position.y;\n positions[positionIndex++] = position.z;\n\n numInterior = 2 * (i - 1) + 2;\n for (j = 1; j < numInterior - 1; ++j) {\n t = j / (numInterior - 1);\n interiorPosition = Cartesian3.lerp(\n position,\n reflectedPosition,\n t,\n scratchCartesian3\n );\n positions[positionIndex++] = interiorPosition.x;\n positions[positionIndex++] = interiorPosition.y;\n positions[positionIndex++] = interiorPosition.z;\n }\n\n positions[positionIndex++] = reflectedPosition.x;\n positions[positionIndex++] = reflectedPosition.y;\n positions[positionIndex++] = reflectedPosition.z;\n }\n\n if (addEdgePositions) {\n outerPositions[outerRightIndex--] = position.z;\n outerPositions[outerRightIndex--] = position.y;\n outerPositions[outerRightIndex--] = position.x;\n outerPositions[outerLeftIndex++] = reflectedPosition.x;\n outerPositions[outerLeftIndex++] = reflectedPosition.y;\n outerPositions[outerLeftIndex++] = reflectedPosition.z;\n }\n }\n\n theta = CesiumMath.PI_OVER_TWO;\n position = pointOnEllipsoid(\n -theta,\n rotation,\n northVec,\n eastVec,\n aSqr,\n ab,\n bSqr,\n mag,\n unitPos,\n position\n );\n\n const r = {};\n if (addFillPositions) {\n positions[positionIndex++] = position.x;\n positions[positionIndex++] = position.y;\n positions[positionIndex++] = position.z;\n r.positions = positions;\n r.numPts = numPts;\n }\n if (addEdgePositions) {\n outerPositions[outerRightIndex--] = position.z;\n outerPositions[outerRightIndex--] = position.y;\n outerPositions[outerRightIndex--] = position.x;\n r.outerPositions = outerPositions;\n }\n\n return r;\n};\nexport default EllipseGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst texCoordScratch = new Cartesian2();\nconst textureMatrixScratch = new Matrix3();\nconst tangentMatrixScratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\n\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\n\nconst scratchCartographic = new Cartographic();\nconst projectedCenterScratch = new Cartesian3();\n\nconst scratchMinTexCoord = new Cartesian2();\nconst scratchMaxTexCoord = new Cartesian2();\n\nfunction computeTopBottomAttributes(positions, options, extrude) {\n const vertexFormat = options.vertexFormat;\n const center = options.center;\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const ellipsoid = options.ellipsoid;\n const stRotation = options.stRotation;\n const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\n const shadowVolume = options.shadowVolume;\n\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(size * 2)\n : undefined;\n const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(size * 3)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size * 3)\n : undefined;\n\n const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\n\n let textureCoordIndex = 0;\n\n // Raise positions to a height above the ellipsoid and compute the\n // texture coordinates, normals, tangents, and bitangents.\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n\n const projection = new GeographicProjection(ellipsoid);\n const projectedCenter = projection.project(\n ellipsoid.cartesianToCartographic(center, scratchCartographic),\n projectedCenterScratch\n );\n\n const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\n center,\n scratchCartesian1\n );\n ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\n\n let textureMatrix = textureMatrixScratch;\n let tangentMatrix = tangentMatrixScratch;\n if (stRotation !== 0) {\n let rotation = Quaternion.fromAxisAngle(\n geodeticNormal,\n stRotation,\n quaternionScratch\n );\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n rotation = Quaternion.fromAxisAngle(\n geodeticNormal,\n -stRotation,\n quaternionScratch\n );\n tangentMatrix = Matrix3.fromQuaternion(rotation, tangentMatrix);\n } else {\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n tangentMatrix = Matrix3.clone(Matrix3.IDENTITY, tangentMatrix);\n }\n\n const minTexCoord = Cartesian2.fromElements(\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n scratchMinTexCoord\n );\n const maxTexCoord = Cartesian2.fromElements(\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n scratchMaxTexCoord\n );\n\n let length = positions.length;\n const bottomOffset = extrude ? length : 0;\n const stOffset = (bottomOffset / 3) * 2;\n for (let i = 0; i < length; i += 3) {\n const i1 = i + 1;\n const i2 = i + 2;\n const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n\n if (vertexFormat.st) {\n const rotatedPoint = Matrix3.multiplyByVector(\n textureMatrix,\n position,\n scratchCartesian2\n );\n const projectedPoint = projection.project(\n ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\n scratchCartesian3\n );\n Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\n\n texCoordScratch.x =\n (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\n texCoordScratch.y =\n (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\n\n minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\n minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\n maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\n maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\n\n if (extrude) {\n textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\n textureCoordinates[textureCoordIndex + 1 + stOffset] =\n texCoordScratch.y;\n }\n\n textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\n textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\n }\n\n if (\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent ||\n shadowVolume\n ) {\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n\n if (shadowVolume) {\n extrudeNormals[i + bottomOffset] = -normal.x;\n extrudeNormals[i1 + bottomOffset] = -normal.y;\n extrudeNormals[i2 + bottomOffset] = -normal.z;\n }\n\n if (\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent\n ) {\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\n tangent\n );\n Matrix3.multiplyByVector(tangentMatrix, tangent, tangent);\n }\n if (vertexFormat.normal) {\n normals[i] = normal.x;\n normals[i1] = normal.y;\n normals[i2] = normal.z;\n if (extrude) {\n normals[i + bottomOffset] = -normal.x;\n normals[i1 + bottomOffset] = -normal.y;\n normals[i2 + bottomOffset] = -normal.z;\n }\n }\n\n if (vertexFormat.tangent) {\n tangents[i] = tangent.x;\n tangents[i1] = tangent.y;\n tangents[i2] = tangent.z;\n if (extrude) {\n tangents[i + bottomOffset] = -tangent.x;\n tangents[i1 + bottomOffset] = -tangent.y;\n tangents[i2 + bottomOffset] = -tangent.z;\n }\n }\n\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n bitangents[i] = bitangent.x;\n bitangents[i1] = bitangent.y;\n bitangents[i2] = bitangent.z;\n if (extrude) {\n bitangents[i + bottomOffset] = bitangent.x;\n bitangents[i1 + bottomOffset] = bitangent.y;\n bitangents[i2 + bottomOffset] = bitangent.z;\n }\n }\n }\n }\n }\n\n if (vertexFormat.st) {\n length = textureCoordinates.length;\n for (let k = 0; k < length; k += 2) {\n textureCoordinates[k] =\n (textureCoordinates[k] - minTexCoord.x) /\n (maxTexCoord.x - minTexCoord.x);\n textureCoordinates[k + 1] =\n (textureCoordinates[k + 1] - minTexCoord.y) /\n (maxTexCoord.y - minTexCoord.y);\n }\n }\n\n const attributes = new GeometryAttributes();\n\n if (vertexFormat.position) {\n const finalPositions = EllipseGeometryLibrary.raisePositionsToHeight(\n positions,\n options,\n extrude\n );\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: finalPositions,\n });\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (shadowVolume) {\n attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: extrudeNormals,\n });\n }\n\n if (extrude && defined(options.offsetAttribute)) {\n let offsetAttribute = new Uint8Array(size);\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else {\n const offsetValue =\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n });\n }\n\n return attributes;\n}\n\nfunction topIndices(numPts) {\n // numTriangles in half = 3 + 8 + 12 + ... = -1 + 4 + (4 + 4) + (4 + 4 + 4) + ... = -1 + 4 * (1 + 2 + 3 + ...)\n // = -1 + 4 * ((n * ( n + 1)) / 2)\n // total triangles = 2 * numTrangles in half\n // indices = total triangles * 3;\n // Substitute numPts for n above\n\n const indices = new Array(12 * (numPts * (numPts + 1)) - 6);\n let indicesIndex = 0;\n let prevIndex;\n let numInterior;\n let positionIndex;\n let i;\n let j;\n // Indices triangles to the 'right' of the north vector\n\n prevIndex = 0;\n positionIndex = 1;\n for (i = 0; i < 3; i++) {\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n\n for (i = 2; i < numPts + 1; ++i) {\n positionIndex = i * (i + 1) - 1;\n prevIndex = (i - 1) * i - 1;\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n\n numInterior = 2 * i;\n for (j = 0; j < numInterior - 1; ++j) {\n indices[indicesIndex++] = positionIndex;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n\n // Indices for center column of triangles\n numInterior = numPts * 2;\n ++positionIndex;\n ++prevIndex;\n for (i = 0; i < numInterior - 1; ++i) {\n indices[indicesIndex++] = positionIndex;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n\n indices[indicesIndex++] = positionIndex;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n\n // Reverse the process creating indices to the 'left' of the north vector\n ++prevIndex;\n for (i = numPts - 1; i > 1; --i) {\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n\n numInterior = 2 * i;\n for (j = 0; j < numInterior - 1; ++j) {\n indices[indicesIndex++] = positionIndex;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n\n indices[indicesIndex++] = positionIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = positionIndex++;\n }\n\n for (i = 0; i < 3; i++) {\n indices[indicesIndex++] = prevIndex++;\n indices[indicesIndex++] = prevIndex;\n indices[indicesIndex++] = positionIndex;\n }\n return indices;\n}\n\nlet boundingSphereCenter = new Cartesian3();\n\nfunction computeEllipse(options) {\n const center = options.center;\n boundingSphereCenter = Cartesian3.multiplyByScalar(\n options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\n options.height,\n boundingSphereCenter\n );\n boundingSphereCenter = Cartesian3.add(\n center,\n boundingSphereCenter,\n boundingSphereCenter\n );\n const boundingSphere = new BoundingSphere(\n boundingSphereCenter,\n options.semiMajorAxis\n );\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\n options,\n true,\n false\n );\n const positions = cep.positions;\n const numPts = cep.numPts;\n const attributes = computeTopBottomAttributes(positions, options, false);\n let indices = topIndices(numPts);\n indices = IndexDatatype.createTypedArray(positions.length / 3, indices);\n return {\n boundingSphere: boundingSphere,\n attributes: attributes,\n indices: indices,\n };\n}\n\nfunction computeWallAttributes(positions, options) {\n const vertexFormat = options.vertexFormat;\n const center = options.center;\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const ellipsoid = options.ellipsoid;\n const height = options.height;\n const extrudedHeight = options.extrudedHeight;\n const stRotation = options.stRotation;\n const size = (positions.length / 3) * 2;\n\n const finalPositions = new Float64Array(size * 3);\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(size * 2)\n : undefined;\n const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(size * 3)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size * 3)\n : undefined;\n\n const shadowVolume = options.shadowVolume;\n const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\n\n let textureCoordIndex = 0;\n\n // Raise positions to a height above the ellipsoid and compute the\n // texture coordinates, normals, tangents, and bitangents.\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n\n const projection = new GeographicProjection(ellipsoid);\n const projectedCenter = projection.project(\n ellipsoid.cartesianToCartographic(center, scratchCartographic),\n projectedCenterScratch\n );\n\n const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\n center,\n scratchCartesian1\n );\n ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\n const rotation = Quaternion.fromAxisAngle(\n geodeticNormal,\n stRotation,\n quaternionScratch\n );\n const textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrixScratch);\n\n const minTexCoord = Cartesian2.fromElements(\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n scratchMinTexCoord\n );\n const maxTexCoord = Cartesian2.fromElements(\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n scratchMaxTexCoord\n );\n\n let length = positions.length;\n const stOffset = (length / 3) * 2;\n for (let i = 0; i < length; i += 3) {\n const i1 = i + 1;\n const i2 = i + 2;\n let position = Cartesian3.fromArray(positions, i, scratchCartesian1);\n let extrudedPosition;\n\n if (vertexFormat.st) {\n const rotatedPoint = Matrix3.multiplyByVector(\n textureMatrix,\n position,\n scratchCartesian2\n );\n const projectedPoint = projection.project(\n ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\n scratchCartesian3\n );\n Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\n\n texCoordScratch.x =\n (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\n texCoordScratch.y =\n (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\n\n minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\n minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\n maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\n maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\n\n textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\n textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;\n\n textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\n textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\n }\n\n position = ellipsoid.scaleToGeodeticSurface(position, position);\n extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n\n if (shadowVolume) {\n extrudeNormals[i + length] = -normal.x;\n extrudeNormals[i1 + length] = -normal.y;\n extrudeNormals[i2 + length] = -normal.z;\n }\n\n let scaledNormal = Cartesian3.multiplyByScalar(\n normal,\n height,\n scratchCartesian4\n );\n position = Cartesian3.add(position, scaledNormal, position);\n scaledNormal = Cartesian3.multiplyByScalar(\n normal,\n extrudedHeight,\n scaledNormal\n );\n extrudedPosition = Cartesian3.add(\n extrudedPosition,\n scaledNormal,\n extrudedPosition\n );\n\n if (vertexFormat.position) {\n finalPositions[i + length] = extrudedPosition.x;\n finalPositions[i1 + length] = extrudedPosition.y;\n finalPositions[i2 + length] = extrudedPosition.z;\n\n finalPositions[i] = position.x;\n finalPositions[i1] = position.y;\n finalPositions[i2] = position.z;\n }\n\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n bitangent = Cartesian3.clone(normal, bitangent);\n const next = Cartesian3.fromArray(\n positions,\n (i + 3) % length,\n scratchCartesian4\n );\n Cartesian3.subtract(next, position, next);\n const bottom = Cartesian3.subtract(\n extrudedPosition,\n position,\n scratchCartesian3\n );\n\n normal = Cartesian3.normalize(\n Cartesian3.cross(bottom, next, normal),\n normal\n );\n\n if (vertexFormat.normal) {\n normals[i] = normal.x;\n normals[i1] = normal.y;\n normals[i2] = normal.z;\n\n normals[i + length] = normal.x;\n normals[i1 + length] = normal.y;\n normals[i2 + length] = normal.z;\n }\n\n if (vertexFormat.tangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(bitangent, normal, tangent),\n tangent\n );\n tangents[i] = tangent.x;\n tangents[i1] = tangent.y;\n tangents[i2] = tangent.z;\n\n tangents[i + length] = tangent.x;\n tangents[i + 1 + length] = tangent.y;\n tangents[i + 2 + length] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n bitangents[i] = bitangent.x;\n bitangents[i1] = bitangent.y;\n bitangents[i2] = bitangent.z;\n\n bitangents[i + length] = bitangent.x;\n bitangents[i1 + length] = bitangent.y;\n bitangents[i2 + length] = bitangent.z;\n }\n }\n }\n\n if (vertexFormat.st) {\n length = textureCoordinates.length;\n for (let k = 0; k < length; k += 2) {\n textureCoordinates[k] =\n (textureCoordinates[k] - minTexCoord.x) /\n (maxTexCoord.x - minTexCoord.x);\n textureCoordinates[k + 1] =\n (textureCoordinates[k + 1] - minTexCoord.y) /\n (maxTexCoord.y - minTexCoord.y);\n }\n }\n\n const attributes = new GeometryAttributes();\n\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: finalPositions,\n });\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (shadowVolume) {\n attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: extrudeNormals,\n });\n }\n\n if (defined(options.offsetAttribute)) {\n let offsetAttribute = new Uint8Array(size);\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else {\n const offsetValue =\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n });\n }\n\n return attributes;\n}\n\nfunction computeWallIndices(positions) {\n const length = positions.length / 3;\n const indices = IndexDatatype.createTypedArray(length, length * 6);\n let index = 0;\n for (let i = 0; i < length; i++) {\n const UL = i;\n const LL = i + length;\n const UR = (UL + 1) % length;\n const LR = UR + length;\n indices[index++] = UL;\n indices[index++] = LL;\n indices[index++] = UR;\n indices[index++] = UR;\n indices[index++] = LL;\n indices[index++] = LR;\n }\n\n return indices;\n}\n\nconst topBoundingSphere = new BoundingSphere();\nconst bottomBoundingSphere = new BoundingSphere();\n\nfunction computeExtrudedEllipse(options) {\n const center = options.center;\n const ellipsoid = options.ellipsoid;\n const semiMajorAxis = options.semiMajorAxis;\n let scaledNormal = Cartesian3.multiplyByScalar(\n ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\n options.height,\n scratchCartesian1\n );\n topBoundingSphere.center = Cartesian3.add(\n center,\n scaledNormal,\n topBoundingSphere.center\n );\n topBoundingSphere.radius = semiMajorAxis;\n\n scaledNormal = Cartesian3.multiplyByScalar(\n ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\n options.extrudedHeight,\n scaledNormal\n );\n bottomBoundingSphere.center = Cartesian3.add(\n center,\n scaledNormal,\n bottomBoundingSphere.center\n );\n bottomBoundingSphere.radius = semiMajorAxis;\n\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\n options,\n true,\n true\n );\n const positions = cep.positions;\n const numPts = cep.numPts;\n const outerPositions = cep.outerPositions;\n const boundingSphere = BoundingSphere.union(\n topBoundingSphere,\n bottomBoundingSphere\n );\n const topBottomAttributes = computeTopBottomAttributes(\n positions,\n options,\n true\n );\n let indices = topIndices(numPts);\n const length = indices.length;\n indices.length = length * 2;\n const posLength = positions.length / 3;\n for (let i = 0; i < length; i += 3) {\n indices[i + length] = indices[i + 2] + posLength;\n indices[i + 1 + length] = indices[i + 1] + posLength;\n indices[i + 2 + length] = indices[i] + posLength;\n }\n\n const topBottomIndices = IndexDatatype.createTypedArray(\n (posLength * 2) / 3,\n indices\n );\n\n const topBottomGeo = new Geometry({\n attributes: topBottomAttributes,\n indices: topBottomIndices,\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n const wallAttributes = computeWallAttributes(outerPositions, options);\n indices = computeWallIndices(outerPositions);\n const wallIndices = IndexDatatype.createTypedArray(\n (outerPositions.length * 2) / 3,\n indices\n );\n\n const wallGeo = new Geometry({\n attributes: wallAttributes,\n indices: wallIndices,\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n const geo = GeometryPipeline.combineInstances([\n new GeometryInstance({\n geometry: topBottomGeo,\n }),\n new GeometryInstance({\n geometry: wallGeo,\n }),\n ]);\n\n return {\n boundingSphere: boundingSphere,\n attributes: geo[0].attributes,\n indices: geo[0].indices,\n };\n}\n\nfunction computeRectangle(\n center,\n semiMajorAxis,\n semiMinorAxis,\n rotation,\n granularity,\n ellipsoid,\n result\n) {\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\n {\n center: center,\n semiMajorAxis: semiMajorAxis,\n semiMinorAxis: semiMinorAxis,\n rotation: rotation,\n granularity: granularity,\n },\n false,\n true\n );\n const positionsFlat = cep.outerPositions;\n const positionsCount = positionsFlat.length / 3;\n const positions = new Array(positionsCount);\n for (let i = 0; i < positionsCount; ++i) {\n positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\n }\n const rectangle = Rectangle.fromCartesianArray(positions, ellipsoid, result);\n // Rectangle width goes beyond 180 degrees when the ellipse crosses a pole.\n // When this happens, make the rectangle into a \"circle\" around the pole\n if (rectangle.width > CesiumMath.PI) {\n rectangle.north =\n rectangle.north > 0.0\n ? CesiumMath.PI_OVER_TWO - CesiumMath.EPSILON7\n : rectangle.north;\n rectangle.south =\n rectangle.south < 0.0\n ? CesiumMath.EPSILON7 - CesiumMath.PI_OVER_TWO\n : rectangle.south;\n rectangle.east = CesiumMath.PI;\n rectangle.west = -CesiumMath.PI;\n }\n return rectangle;\n}\n\n/**\n * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias EllipseGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\n * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n *\n * @example\n * // Create an ellipse.\n * const ellipse = new Cesium.EllipseGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n * semiMajorAxis : 500000.0,\n * semiMinorAxis : 300000.0,\n * rotation : Cesium.Math.toRadians(60.0)\n * });\n * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);\n *\n * @see EllipseGeometry.createGeometry\n */\nfunction EllipseGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const center = options.center;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._center = Cartesian3.clone(center);\n this._semiMajorAxis = semiMajorAxis;\n this._semiMinorAxis = semiMinorAxis;\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._rotation = defaultValue(options.rotation, 0.0);\n this._stRotation = defaultValue(options.stRotation, 0.0);\n this._height = Math.max(extrudedHeight, height);\n this._granularity = granularity;\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._extrudedHeight = Math.min(extrudedHeight, height);\n this._shadowVolume = defaultValue(options.shadowVolume, false);\n this._workerName = \"createEllipseGeometry\";\n this._offsetAttribute = options.offsetAttribute;\n\n this._rectangle = undefined;\n this._textureCoordinateRotationPoints = undefined;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nEllipseGeometry.packedLength =\n Cartesian3.packedLength +\n Ellipsoid.packedLength +\n VertexFormat.packedLength +\n 9;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipseGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nEllipseGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._center, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._semiMajorAxis;\n array[startingIndex++] = value._semiMinorAxis;\n array[startingIndex++] = value._rotation;\n array[startingIndex++] = value._stRotation;\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchCenter = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n center: scratchCenter,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n semiMajorAxis: undefined,\n semiMinorAxis: undefined,\n rotation: undefined,\n stRotation: undefined,\n height: undefined,\n granularity: undefined,\n extrudedHeight: undefined,\n shadowVolume: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipseGeometry} [result] The object into which to store the result.\n * @returns {EllipseGeometry} The modified result parameter or a new EllipseGeometry instance if one was not provided.\n */\nEllipseGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\n startingIndex += Cartesian3.packedLength;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const semiMajorAxis = array[startingIndex++];\n const semiMinorAxis = array[startingIndex++];\n const rotation = array[startingIndex++];\n const stRotation = array[startingIndex++];\n const height = array[startingIndex++];\n const granularity = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const shadowVolume = array[startingIndex++] === 1.0;\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.height = height;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.granularity = granularity;\n scratchOptions.stRotation = stRotation;\n scratchOptions.rotation = rotation;\n scratchOptions.semiMajorAxis = semiMajorAxis;\n scratchOptions.semiMinorAxis = semiMinorAxis;\n scratchOptions.shadowVolume = shadowVolume;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return new EllipseGeometry(scratchOptions);\n }\n\n result._center = Cartesian3.clone(center, result._center);\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._semiMajorAxis = semiMajorAxis;\n result._semiMinorAxis = semiMinorAxis;\n result._rotation = rotation;\n result._stRotation = stRotation;\n result._height = height;\n result._granularity = granularity;\n result._extrudedHeight = extrudedHeight;\n result._shadowVolume = shadowVolume;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the bounding rectangle based on the provided options\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\n * @param {Rectangle} [result] An object in which to store the result\n *\n * @returns {Rectangle} The result rectangle\n */\nEllipseGeometry.computeRectangle = function (options, result) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const center = options.center;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const rotation = defaultValue(options.rotation, 0.0);\n\n return computeRectangle(\n center,\n semiMajorAxis,\n semiMinorAxis,\n rotation,\n granularity,\n ellipsoid,\n result\n );\n};\n\n/**\n * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipseGeometry} ellipseGeometry A description of the ellipse.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipseGeometry.createGeometry = function (ellipseGeometry) {\n if (\n ellipseGeometry._semiMajorAxis <= 0.0 ||\n ellipseGeometry._semiMinorAxis <= 0.0\n ) {\n return;\n }\n\n const height = ellipseGeometry._height;\n const extrudedHeight = ellipseGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n height,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n\n ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\n ellipseGeometry._center,\n ellipseGeometry._center\n );\n const options = {\n center: ellipseGeometry._center,\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\n ellipsoid: ellipseGeometry._ellipsoid,\n rotation: ellipseGeometry._rotation,\n height: height,\n granularity: ellipseGeometry._granularity,\n vertexFormat: ellipseGeometry._vertexFormat,\n stRotation: ellipseGeometry._stRotation,\n };\n let geometry;\n if (extrude) {\n options.extrudedHeight = extrudedHeight;\n options.shadowVolume = ellipseGeometry._shadowVolume;\n options.offsetAttribute = ellipseGeometry._offsetAttribute;\n geometry = computeExtrudedEllipse(options);\n } else {\n geometry = computeEllipse(options);\n\n if (defined(ellipseGeometry._offsetAttribute)) {\n const length = geometry.attributes.position.values.length;\n const offsetValue =\n ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n }\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: geometry.boundingSphere,\n offsetAttribute: ellipseGeometry._offsetAttribute,\n });\n};\n\n/**\n * @private\n */\nEllipseGeometry.createShadowVolume = function (\n ellipseGeometry,\n minHeightFunc,\n maxHeightFunc\n) {\n const granularity = ellipseGeometry._granularity;\n const ellipsoid = ellipseGeometry._ellipsoid;\n\n const minHeight = minHeightFunc(granularity, ellipsoid);\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n return new EllipseGeometry({\n center: ellipseGeometry._center,\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\n ellipsoid: ellipsoid,\n rotation: ellipseGeometry._rotation,\n stRotation: ellipseGeometry._stRotation,\n granularity: granularity,\n extrudedHeight: minHeight,\n height: maxHeight,\n vertexFormat: VertexFormat.POSITION_ONLY,\n shadowVolume: true,\n });\n};\n\nfunction textureCoordinateRotationPoints(ellipseGeometry) {\n const stRotation = -ellipseGeometry._stRotation;\n if (stRotation === 0.0) {\n return [0, 0, 0, 1, 1, 0];\n }\n\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\n {\n center: ellipseGeometry._center,\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\n rotation: ellipseGeometry._rotation,\n granularity: ellipseGeometry._granularity,\n },\n false,\n true\n );\n const positionsFlat = cep.outerPositions;\n const positionsCount = positionsFlat.length / 3;\n const positions = new Array(positionsCount);\n for (let i = 0; i < positionsCount; ++i) {\n positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\n }\n\n const ellipsoid = ellipseGeometry._ellipsoid;\n const boundingRectangle = ellipseGeometry.rectangle;\n return Geometry._textureCoordinateRotationPoints(\n positions,\n stRotation,\n ellipsoid,\n boundingRectangle\n );\n}\n\nObject.defineProperties(EllipseGeometry.prototype, {\n /**\n * @private\n */\n rectangle: {\n get: function () {\n if (!defined(this._rectangle)) {\n this._rectangle = computeRectangle(\n this._center,\n this._semiMajorAxis,\n this._semiMinorAxis,\n this._rotation,\n this._granularity,\n this._ellipsoid\n );\n }\n return this._rectangle;\n },\n },\n /**\n * For remapping texture coordinates when rendering EllipseGeometries as GroundPrimitives.\n * @private\n */\n textureCoordinateRotationPoints: {\n get: function () {\n if (!defined(this._textureCoordinateRotationPoints)) {\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n this\n );\n }\n return this._textureCoordinateRotationPoints;\n },\n },\n});\nexport default EllipseGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nlet boundingSphereCenter = new Cartesian3();\n\nfunction computeEllipse(options) {\n const center = options.center;\n boundingSphereCenter = Cartesian3.multiplyByScalar(\n options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\n options.height,\n boundingSphereCenter\n );\n boundingSphereCenter = Cartesian3.add(\n center,\n boundingSphereCenter,\n boundingSphereCenter\n );\n const boundingSphere = new BoundingSphere(\n boundingSphereCenter,\n options.semiMajorAxis\n );\n const positions = EllipseGeometryLibrary.computeEllipsePositions(\n options,\n false,\n true\n ).outerPositions;\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: EllipseGeometryLibrary.raisePositionsToHeight(\n positions,\n options,\n false\n ),\n }),\n });\n\n const length = positions.length / 3;\n const indices = IndexDatatype.createTypedArray(length, length * 2);\n let index = 0;\n for (let i = 0; i < length; ++i) {\n indices[index++] = i;\n indices[index++] = (i + 1) % length;\n }\n\n return {\n boundingSphere: boundingSphere,\n attributes: attributes,\n indices: indices,\n };\n}\n\nconst topBoundingSphere = new BoundingSphere();\nconst bottomBoundingSphere = new BoundingSphere();\nfunction computeExtrudedEllipse(options) {\n const center = options.center;\n const ellipsoid = options.ellipsoid;\n const semiMajorAxis = options.semiMajorAxis;\n let scaledNormal = Cartesian3.multiplyByScalar(\n ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\n options.height,\n scratchCartesian1\n );\n topBoundingSphere.center = Cartesian3.add(\n center,\n scaledNormal,\n topBoundingSphere.center\n );\n topBoundingSphere.radius = semiMajorAxis;\n\n scaledNormal = Cartesian3.multiplyByScalar(\n ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\n options.extrudedHeight,\n scaledNormal\n );\n bottomBoundingSphere.center = Cartesian3.add(\n center,\n scaledNormal,\n bottomBoundingSphere.center\n );\n bottomBoundingSphere.radius = semiMajorAxis;\n\n let positions = EllipseGeometryLibrary.computeEllipsePositions(\n options,\n false,\n true\n ).outerPositions;\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: EllipseGeometryLibrary.raisePositionsToHeight(\n positions,\n options,\n true\n ),\n }),\n });\n\n positions = attributes.position.values;\n const boundingSphere = BoundingSphere.union(\n topBoundingSphere,\n bottomBoundingSphere\n );\n let length = positions.length / 3;\n\n if (defined(options.offsetAttribute)) {\n let applyOffset = new Uint8Array(length);\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n applyOffset = applyOffset.fill(1, 0, length / 2);\n } else {\n const offsetValue =\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n applyOffset = applyOffset.fill(offsetValue);\n }\n\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n let numberOfVerticalLines = defaultValue(options.numberOfVerticalLines, 16);\n numberOfVerticalLines = CesiumMath.clamp(\n numberOfVerticalLines,\n 0,\n length / 2\n );\n\n const indices = IndexDatatype.createTypedArray(\n length,\n length * 2 + numberOfVerticalLines * 2\n );\n\n length /= 2;\n let index = 0;\n let i;\n for (i = 0; i < length; ++i) {\n indices[index++] = i;\n indices[index++] = (i + 1) % length;\n indices[index++] = i + length;\n indices[index++] = ((i + 1) % length) + length;\n }\n\n let numSide;\n if (numberOfVerticalLines > 0) {\n const numSideLines = Math.min(numberOfVerticalLines, length);\n numSide = Math.round(length / numSideLines);\n\n const maxI = Math.min(numSide * numberOfVerticalLines, length);\n for (i = 0; i < maxI; i += numSide) {\n indices[index++] = i;\n indices[index++] = i + length;\n }\n }\n\n return {\n boundingSphere: boundingSphere,\n attributes: attributes,\n indices: indices,\n };\n}\n\n/**\n * A description of the outline of an ellipse on an ellipsoid.\n *\n * @alias EllipseOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\n * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\n * @param {Number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians.\n * @param {Number} [options.granularity=0.02] The angular distance between points on the ellipse in radians.\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.\n *\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see EllipseOutlineGeometry.createGeometry\n *\n * @example\n * const ellipse = new Cesium.EllipseOutlineGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n * semiMajorAxis : 500000.0,\n * semiMinorAxis : 300000.0,\n * rotation : Cesium.Math.toRadians(60.0)\n * });\n * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);\n */\nfunction EllipseOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const center = options.center;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._center = Cartesian3.clone(center);\n this._semiMajorAxis = semiMajorAxis;\n this._semiMinorAxis = semiMinorAxis;\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._rotation = defaultValue(options.rotation, 0.0);\n this._height = Math.max(extrudedHeight, height);\n this._granularity = granularity;\n this._extrudedHeight = Math.min(extrudedHeight, height);\n this._numberOfVerticalLines = Math.max(\n defaultValue(options.numberOfVerticalLines, 16),\n 0\n );\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createEllipseOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nEllipseOutlineGeometry.packedLength =\n Cartesian3.packedLength + Ellipsoid.packedLength + 8;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipseOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nEllipseOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._center, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._semiMajorAxis;\n array[startingIndex++] = value._semiMinorAxis;\n array[startingIndex++] = value._rotation;\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._numberOfVerticalLines;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchCenter = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchOptions = {\n center: scratchCenter,\n ellipsoid: scratchEllipsoid,\n semiMajorAxis: undefined,\n semiMinorAxis: undefined,\n rotation: undefined,\n height: undefined,\n granularity: undefined,\n extrudedHeight: undefined,\n numberOfVerticalLines: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipseOutlineGeometry} [result] The object into which to store the result.\n * @returns {EllipseOutlineGeometry} The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.\n */\nEllipseOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\n startingIndex += Cartesian3.packedLength;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const semiMajorAxis = array[startingIndex++];\n const semiMinorAxis = array[startingIndex++];\n const rotation = array[startingIndex++];\n const height = array[startingIndex++];\n const granularity = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const numberOfVerticalLines = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.height = height;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.granularity = granularity;\n scratchOptions.rotation = rotation;\n scratchOptions.semiMajorAxis = semiMajorAxis;\n scratchOptions.semiMinorAxis = semiMinorAxis;\n scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return new EllipseOutlineGeometry(scratchOptions);\n }\n\n result._center = Cartesian3.clone(center, result._center);\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._semiMajorAxis = semiMajorAxis;\n result._semiMinorAxis = semiMinorAxis;\n result._rotation = rotation;\n result._height = height;\n result._granularity = granularity;\n result._extrudedHeight = extrudedHeight;\n result._numberOfVerticalLines = numberOfVerticalLines;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipseOutlineGeometry} ellipseGeometry A description of the ellipse.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipseOutlineGeometry.createGeometry = function (ellipseGeometry) {\n if (\n ellipseGeometry._semiMajorAxis <= 0.0 ||\n ellipseGeometry._semiMinorAxis <= 0.0\n ) {\n return;\n }\n\n const height = ellipseGeometry._height;\n const extrudedHeight = ellipseGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n height,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n\n ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\n ellipseGeometry._center,\n ellipseGeometry._center\n );\n const options = {\n center: ellipseGeometry._center,\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\n ellipsoid: ellipseGeometry._ellipsoid,\n rotation: ellipseGeometry._rotation,\n height: height,\n granularity: ellipseGeometry._granularity,\n numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines,\n };\n let geometry;\n if (extrude) {\n options.extrudedHeight = extrudedHeight;\n options.offsetAttribute = ellipseGeometry._offsetAttribute;\n geometry = computeExtrudedEllipse(options);\n } else {\n geometry = computeEllipse(options);\n\n if (defined(ellipseGeometry._offsetAttribute)) {\n const length = geometry.attributes.position.values.length;\n const offsetValue =\n ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n }\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: geometry.boundingSphere,\n offsetAttribute: ellipseGeometry._offsetAttribute,\n });\n};\nexport default EllipseOutlineGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipseGeometry from \"../Core/EllipseGeometry.js\";\nimport EllipseOutlineGeometry from \"../Core/EllipseOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\n\nfunction EllipseGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.center = undefined;\n this.semiMajorAxis = undefined;\n this.semiMinorAxis = undefined;\n this.rotation = undefined;\n this.height = undefined;\n this.extrudedHeight = undefined;\n this.granularity = undefined;\n this.stRotation = undefined;\n this.numberOfVerticalLines = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for ellipses.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias EllipseGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction EllipseGeometryUpdater(entity, scene) {\n GroundGeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new EllipseGeometryOptions(entity),\n geometryPropertyName: \"ellipse\",\n observedPropertyNames: [\"availability\", \"position\", \"ellipse\"],\n });\n\n this._onEntityPropertyChanged(entity, \"ellipse\", entity.ellipse, undefined);\n}\n\nif (defined(Object.create)) {\n EllipseGeometryUpdater.prototype = Object.create(\n GroundGeometryUpdater.prototype\n );\n EllipseGeometryUpdater.prototype.constructor = EllipseGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nEllipseGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n ),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n this._distanceDisplayConditionProperty.getValue(time)\n ),\n offset: undefined,\n color: undefined,\n };\n\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new EllipseGeometry(this._options),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nEllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new EllipseOutlineGeometry(this._options),\n attributes: attributes,\n });\n};\n\nEllipseGeometryUpdater.prototype._computeCenter = function (time, result) {\n return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nEllipseGeometryUpdater.prototype._isHidden = function (entity, ellipse) {\n const position = entity.position;\n\n return (\n !defined(position) ||\n !defined(ellipse.semiMajorAxis) ||\n !defined(ellipse.semiMinorAxis) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, ellipse)\n );\n};\n\nEllipseGeometryUpdater.prototype._isDynamic = function (entity, ellipse) {\n return (\n !entity.position.isConstant || //\n !ellipse.semiMajorAxis.isConstant || //\n !ellipse.semiMinorAxis.isConstant || //\n !Property.isConstant(ellipse.rotation) || //\n !Property.isConstant(ellipse.height) || //\n !Property.isConstant(ellipse.extrudedHeight) || //\n !Property.isConstant(ellipse.granularity) || //\n !Property.isConstant(ellipse.stRotation) || //\n !Property.isConstant(ellipse.outlineWidth) || //\n !Property.isConstant(ellipse.numberOfVerticalLines) || //\n !Property.isConstant(ellipse.zIndex) || //\n (this._onTerrain &&\n !Property.isConstant(this._materialProperty) &&\n !(this._materialProperty instanceof ColorMaterialProperty))\n );\n};\n\nEllipseGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n ellipse\n) {\n let heightValue = Property.getValueOrUndefined(\n ellipse.height,\n Iso8601.MINIMUM_VALUE\n );\n const heightReferenceValue = Property.getValueOrDefault(\n ellipse.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n ellipse.extrudedHeight,\n Iso8601.MINIMUM_VALUE\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n ellipse.extrudedHeightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n const options = this._options;\n options.vertexFormat =\n this._materialProperty instanceof ColorMaterialProperty\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.center = entity.position.getValue(\n Iso8601.MINIMUM_VALUE,\n options.center\n );\n options.semiMajorAxis = ellipse.semiMajorAxis.getValue(\n Iso8601.MINIMUM_VALUE,\n options.semiMajorAxis\n );\n options.semiMinorAxis = ellipse.semiMinorAxis.getValue(\n Iso8601.MINIMUM_VALUE,\n options.semiMinorAxis\n );\n options.rotation = Property.getValueOrUndefined(\n ellipse.rotation,\n Iso8601.MINIMUM_VALUE\n );\n options.granularity = Property.getValueOrUndefined(\n ellipse.granularity,\n Iso8601.MINIMUM_VALUE\n );\n options.stRotation = Property.getValueOrUndefined(\n ellipse.stRotation,\n Iso8601.MINIMUM_VALUE\n );\n options.numberOfVerticalLines = Property.getValueOrUndefined(\n ellipse.numberOfVerticalLines,\n Iso8601.MINIMUM_VALUE\n );\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n EllipseGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\n\nEllipseGeometryUpdater.DynamicGeometryUpdater = DynamicEllipseGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicEllipseGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicEllipseGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicEllipseGeometryUpdater.prototype.constructor = DynamicEllipseGeometryUpdater;\n}\n\nDynamicEllipseGeometryUpdater.prototype._isHidden = function (\n entity,\n ellipse,\n time\n) {\n const options = this._options;\n return (\n !defined(options.center) ||\n !defined(options.semiMajorAxis) ||\n !defined(options.semiMinorAxis) ||\n DynamicGeometryUpdater.prototype._isHidden.call(this, entity, ellipse, time)\n );\n};\n\nDynamicEllipseGeometryUpdater.prototype._setOptions = function (\n entity,\n ellipse,\n time\n) {\n const options = this._options;\n let heightValue = Property.getValueOrUndefined(ellipse.height, time);\n const heightReferenceValue = Property.getValueOrDefault(\n ellipse.heightReference,\n time,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n ellipse.extrudedHeight,\n time\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n ellipse.extrudedHeightReference,\n time,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n options.center = Property.getValueOrUndefined(\n entity.position,\n time,\n options.center\n );\n options.semiMajorAxis = Property.getValueOrUndefined(\n ellipse.semiMajorAxis,\n time\n );\n options.semiMinorAxis = Property.getValueOrUndefined(\n ellipse.semiMinorAxis,\n time\n );\n options.rotation = Property.getValueOrUndefined(ellipse.rotation, time);\n options.granularity = Property.getValueOrUndefined(ellipse.granularity, time);\n options.stRotation = Property.getValueOrUndefined(ellipse.stRotation, time);\n options.numberOfVerticalLines = Property.getValueOrUndefined(\n ellipse.numberOfVerticalLines,\n time\n );\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n EllipseGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\nexport default EllipseGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst scratchNormalST = new Cartesian3();\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\n\nconst cos = Math.cos;\nconst sin = Math.sin;\n\n/**\n * A description of an ellipsoid centered at the origin.\n *\n * @alias EllipsoidGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\n * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\n * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\n * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\n * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\n *\n * @see EllipsoidGeometry#createGeometry\n *\n * @example\n * const ellipsoid = new Cesium.EllipsoidGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)\n * });\n * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);\n */\nfunction EllipsoidGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const radii = defaultValue(options.radii, defaultRadii);\n const innerRadii = defaultValue(options.innerRadii, radii);\n const minimumClock = defaultValue(options.minimumClock, 0.0);\n const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\n const minimumCone = defaultValue(options.minimumCone, 0.0);\n const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\n const stackPartitions = Math.round(defaultValue(options.stackPartitions, 64));\n const slicePartitions = Math.round(defaultValue(options.slicePartitions, 64));\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n this._radii = Cartesian3.clone(radii);\n this._innerRadii = Cartesian3.clone(innerRadii);\n this._minimumClock = minimumClock;\n this._maximumClock = maximumClock;\n this._minimumCone = minimumCone;\n this._maximumCone = maximumCone;\n this._stackPartitions = stackPartitions;\n this._slicePartitions = slicePartitions;\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createEllipsoidGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nEllipsoidGeometry.packedLength =\n 2 * Cartesian3.packedLength + VertexFormat.packedLength + 7;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {EllipsoidGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nEllipsoidGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Cartesian3.pack(value._radii, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n Cartesian3.pack(value._innerRadii, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._minimumClock;\n array[startingIndex++] = value._maximumClock;\n array[startingIndex++] = value._minimumCone;\n array[startingIndex++] = value._maximumCone;\n array[startingIndex++] = value._stackPartitions;\n array[startingIndex++] = value._slicePartitions;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchRadii = new Cartesian3();\nconst scratchInnerRadii = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n radii: scratchRadii,\n innerRadii: scratchInnerRadii,\n vertexFormat: scratchVertexFormat,\n minimumClock: undefined,\n maximumClock: undefined,\n minimumCone: undefined,\n maximumCone: undefined,\n stackPartitions: undefined,\n slicePartitions: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {EllipsoidGeometry} [result] The object into which to store the result.\n * @returns {EllipsoidGeometry} The modified result parameter or a new EllipsoidGeometry instance if one was not provided.\n */\nEllipsoidGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\n startingIndex += Cartesian3.packedLength;\n\n const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\n startingIndex += Cartesian3.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const minimumClock = array[startingIndex++];\n const maximumClock = array[startingIndex++];\n const minimumCone = array[startingIndex++];\n const maximumCone = array[startingIndex++];\n const stackPartitions = array[startingIndex++];\n const slicePartitions = array[startingIndex++];\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.minimumClock = minimumClock;\n scratchOptions.maximumClock = maximumClock;\n scratchOptions.minimumCone = minimumCone;\n scratchOptions.maximumCone = maximumCone;\n scratchOptions.stackPartitions = stackPartitions;\n scratchOptions.slicePartitions = slicePartitions;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n return new EllipsoidGeometry(scratchOptions);\n }\n\n result._radii = Cartesian3.clone(radii, result._radii);\n result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._minimumClock = minimumClock;\n result._maximumClock = maximumClock;\n result._minimumCone = minimumCone;\n result._maximumCone = maximumCone;\n result._stackPartitions = stackPartitions;\n result._slicePartitions = slicePartitions;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {EllipsoidGeometry} ellipsoidGeometry A description of the ellipsoid.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nEllipsoidGeometry.createGeometry = function (ellipsoidGeometry) {\n const radii = ellipsoidGeometry._radii;\n if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\n return;\n }\n\n const innerRadii = ellipsoidGeometry._innerRadii;\n if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\n return;\n }\n\n const minimumClock = ellipsoidGeometry._minimumClock;\n const maximumClock = ellipsoidGeometry._maximumClock;\n const minimumCone = ellipsoidGeometry._minimumCone;\n const maximumCone = ellipsoidGeometry._maximumCone;\n const vertexFormat = ellipsoidGeometry._vertexFormat;\n\n // Add an extra slice and stack so that the number of partitions is the\n // number of surfaces rather than the number of joints\n let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\n let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\n\n slicePartitions = Math.round(\n (slicePartitions * Math.abs(maximumClock - minimumClock)) /\n CesiumMath.TWO_PI\n );\n stackPartitions = Math.round(\n (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\n );\n\n if (slicePartitions < 2) {\n slicePartitions = 2;\n }\n if (stackPartitions < 2) {\n stackPartitions = 2;\n }\n\n let i;\n let j;\n let index = 0;\n\n // Create arrays for theta and phi. Duplicate first and last angle to\n // allow different normals at the intersections.\n const phis = [minimumCone];\n const thetas = [minimumClock];\n for (i = 0; i < stackPartitions; i++) {\n phis.push(\n minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1)\n );\n }\n phis.push(maximumCone);\n for (j = 0; j < slicePartitions; j++) {\n thetas.push(\n minimumClock + (j * (maximumClock - minimumClock)) / (slicePartitions - 1)\n );\n }\n thetas.push(maximumClock);\n const numPhis = phis.length;\n const numThetas = thetas.length;\n\n // Allow for extra indices if there is an inner surface and if we need\n // to close the sides if the clock range is not a full circle\n let extraIndices = 0;\n let vertexMultiplier = 1.0;\n const hasInnerSurface =\n innerRadii.x !== radii.x ||\n innerRadii.y !== radii.y ||\n innerRadii.z !== radii.z;\n let isTopOpen = false;\n let isBotOpen = false;\n let isClockOpen = false;\n if (hasInnerSurface) {\n vertexMultiplier = 2.0;\n if (minimumCone > 0.0) {\n isTopOpen = true;\n extraIndices += slicePartitions - 1;\n }\n if (maximumCone < Math.PI) {\n isBotOpen = true;\n extraIndices += slicePartitions - 1;\n }\n if ((maximumClock - minimumClock) % CesiumMath.TWO_PI) {\n isClockOpen = true;\n extraIndices += (stackPartitions - 1) * 2 + 1;\n } else {\n extraIndices += 1;\n }\n }\n\n const vertexCount = numThetas * numPhis * vertexMultiplier;\n const positions = new Float64Array(vertexCount * 3);\n const isInner = new Array(vertexCount).fill(false);\n const negateNormal = new Array(vertexCount).fill(false);\n\n // Multiply by 6 because there are two triangles per sector\n const indexCount = slicePartitions * stackPartitions * vertexMultiplier;\n const numIndices =\n 6 *\n (indexCount +\n extraIndices +\n 1 -\n (slicePartitions + stackPartitions) * vertexMultiplier);\n const indices = IndexDatatype.createTypedArray(indexCount, numIndices);\n\n const normals = vertexFormat.normal\n ? new Float32Array(vertexCount * 3)\n : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(vertexCount * 3)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(vertexCount * 3)\n : undefined;\n const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : undefined;\n\n // Calculate sin/cos phi\n const sinPhi = new Array(numPhis);\n const cosPhi = new Array(numPhis);\n for (i = 0; i < numPhis; i++) {\n sinPhi[i] = sin(phis[i]);\n cosPhi[i] = cos(phis[i]);\n }\n\n // Calculate sin/cos theta\n const sinTheta = new Array(numThetas);\n const cosTheta = new Array(numThetas);\n for (j = 0; j < numThetas; j++) {\n cosTheta[j] = cos(thetas[j]);\n sinTheta[j] = sin(thetas[j]);\n }\n\n // Create outer surface\n for (i = 0; i < numPhis; i++) {\n for (j = 0; j < numThetas; j++) {\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = radii.z * cosPhi[i];\n }\n }\n\n // Create inner surface\n let vertexIndex = vertexCount / 2.0;\n if (hasInnerSurface) {\n for (i = 0; i < numPhis; i++) {\n for (j = 0; j < numThetas; j++) {\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\n positions[index++] = innerRadii.z * cosPhi[i];\n\n // Keep track of which vertices are the inner and which ones\n // need the normal to be negated\n isInner[vertexIndex] = true;\n if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {\n negateNormal[vertexIndex] = true;\n }\n vertexIndex++;\n }\n }\n }\n\n // Create indices for outer surface\n index = 0;\n let topOffset;\n let bottomOffset;\n for (i = 1; i < numPhis - 2; i++) {\n topOffset = i * numThetas;\n bottomOffset = (i + 1) * numThetas;\n\n for (j = 1; j < numThetas - 2; j++) {\n indices[index++] = bottomOffset + j;\n indices[index++] = bottomOffset + j + 1;\n indices[index++] = topOffset + j + 1;\n\n indices[index++] = bottomOffset + j;\n indices[index++] = topOffset + j + 1;\n indices[index++] = topOffset + j;\n }\n }\n\n // Create indices for inner surface\n if (hasInnerSurface) {\n const offset = numPhis * numThetas;\n for (i = 1; i < numPhis - 2; i++) {\n topOffset = offset + i * numThetas;\n bottomOffset = offset + (i + 1) * numThetas;\n\n for (j = 1; j < numThetas - 2; j++) {\n indices[index++] = bottomOffset + j;\n indices[index++] = topOffset + j;\n indices[index++] = topOffset + j + 1;\n\n indices[index++] = bottomOffset + j;\n indices[index++] = topOffset + j + 1;\n indices[index++] = bottomOffset + j + 1;\n }\n }\n }\n\n let outerOffset;\n let innerOffset;\n if (hasInnerSurface) {\n if (isTopOpen) {\n // Connect the top of the inner surface to the top of the outer surface\n innerOffset = numPhis * numThetas;\n for (i = 1; i < numThetas - 2; i++) {\n indices[index++] = i;\n indices[index++] = i + 1;\n indices[index++] = innerOffset + i + 1;\n\n indices[index++] = i;\n indices[index++] = innerOffset + i + 1;\n indices[index++] = innerOffset + i;\n }\n }\n\n if (isBotOpen) {\n // Connect the bottom of the inner surface to the bottom of the outer surface\n outerOffset = numPhis * numThetas - numThetas;\n innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;\n for (i = 1; i < numThetas - 2; i++) {\n indices[index++] = outerOffset + i + 1;\n indices[index++] = outerOffset + i;\n indices[index++] = innerOffset + i;\n\n indices[index++] = outerOffset + i + 1;\n indices[index++] = innerOffset + i;\n indices[index++] = innerOffset + i + 1;\n }\n }\n }\n\n // Connect the edges if clock is not closed\n if (isClockOpen) {\n for (i = 1; i < numPhis - 2; i++) {\n innerOffset = numThetas * numPhis + numThetas * i;\n outerOffset = numThetas * i;\n indices[index++] = innerOffset;\n indices[index++] = outerOffset + numThetas;\n indices[index++] = outerOffset;\n\n indices[index++] = innerOffset;\n indices[index++] = innerOffset + numThetas;\n indices[index++] = outerOffset + numThetas;\n }\n\n for (i = 1; i < numPhis - 2; i++) {\n innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;\n outerOffset = numThetas * (i + 1) - 1;\n indices[index++] = outerOffset + numThetas;\n indices[index++] = innerOffset;\n indices[index++] = outerOffset;\n\n indices[index++] = outerOffset + numThetas;\n indices[index++] = innerOffset + numThetas;\n indices[index++] = innerOffset;\n }\n }\n\n const attributes = new GeometryAttributes();\n\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n }\n\n let stIndex = 0;\n let normalIndex = 0;\n let tangentIndex = 0;\n let bitangentIndex = 0;\n const vertexCountHalf = vertexCount / 2.0;\n\n let ellipsoid;\n const ellipsoidOuter = Ellipsoid.fromCartesian3(radii);\n const ellipsoidInner = Ellipsoid.fromCartesian3(innerRadii);\n\n if (\n vertexFormat.st ||\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent\n ) {\n for (i = 0; i < vertexCount; i++) {\n ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;\n const position = Cartesian3.fromArray(positions, i * 3, scratchPosition);\n const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\n if (negateNormal[i]) {\n Cartesian3.negate(normal, normal);\n }\n\n if (vertexFormat.st) {\n const normalST = Cartesian2.negate(normal, scratchNormalST);\n st[stIndex++] =\n Math.atan2(normalST.y, normalST.x) / CesiumMath.TWO_PI + 0.5;\n st[stIndex++] = Math.asin(normal.z) / Math.PI + 0.5;\n }\n\n if (vertexFormat.normal) {\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n }\n\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n const tangent = scratchTangent;\n\n // Use UNIT_X for the poles\n let tangetOffset = 0;\n let unit;\n if (isInner[i]) {\n tangetOffset = vertexCountHalf;\n }\n if (\n !isTopOpen &&\n i >= tangetOffset &&\n i < tangetOffset + numThetas * 2\n ) {\n unit = Cartesian3.UNIT_X;\n } else {\n unit = Cartesian3.UNIT_Z;\n }\n Cartesian3.cross(unit, normal, tangent);\n Cartesian3.normalize(tangent, tangent);\n\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n const bitangent = Cartesian3.cross(normal, tangent, scratchBitangent);\n Cartesian3.normalize(bitangent, bitangent);\n\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n }\n }\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: st,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n }\n\n if (defined(ellipsoidGeometry._offsetAttribute)) {\n const length = positions.length;\n const offsetValue =\n ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: BoundingSphere.fromEllipsoid(ellipsoidOuter),\n offsetAttribute: ellipsoidGeometry._offsetAttribute,\n });\n};\n\nlet unitEllipsoidGeometry;\n\n/**\n * Returns the geometric representation of a unit ellipsoid, including its vertices, indices, and a bounding sphere.\n * @returns {Geometry} The computed vertices and indices.\n *\n * @private\n */\nEllipsoidGeometry.getUnitEllipsoid = function () {\n if (!defined(unitEllipsoidGeometry)) {\n unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(\n new EllipsoidGeometry({\n radii: new Cartesian3(1.0, 1.0, 1.0),\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n }\n return unitEllipsoidGeometry;\n};\nexport default EllipsoidGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport EllipsoidOutlineGeometry from \"../Core/EllipsoidOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"../Core/GeometryOffsetAttribute.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport heightReferenceOnEntityPropertyChanged from \"./heightReferenceOnEntityPropertyChanged.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultOffset = Cartesian3.ZERO;\n\nconst offsetScratch = new Cartesian3();\nconst radiiScratch = new Cartesian3();\nconst innerRadiiScratch = new Cartesian3();\nconst scratchColor = new Color();\nconst unitSphere = new Cartesian3(1, 1, 1);\n\nfunction EllipsoidGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.radii = undefined;\n this.innerRadii = undefined;\n this.minimumClock = undefined;\n this.maximumClock = undefined;\n this.minimumCone = undefined;\n this.maximumCone = undefined;\n this.stackPartitions = undefined;\n this.slicePartitions = undefined;\n this.subdivisions = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for ellipsoids.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias EllipsoidGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction EllipsoidGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new EllipsoidGeometryOptions(entity),\n geometryPropertyName: \"ellipsoid\",\n observedPropertyNames: [\n \"availability\",\n \"position\",\n \"orientation\",\n \"ellipsoid\",\n ],\n });\n\n this._onEntityPropertyChanged(\n entity,\n \"ellipsoid\",\n entity.ellipsoid,\n undefined\n );\n}\n\nif (defined(Object.create)) {\n EllipsoidGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater;\n}\n\nObject.defineProperties(EllipsoidGeometryUpdater.prototype, {\n /**\n * Gets the terrain offset property\n * @type {TerrainOffsetProperty}\n * @memberof EllipsoidGeometryUpdater.prototype\n * @readonly\n * @private\n */\n terrainOffsetProperty: {\n get: function () {\n return this._terrainOffsetProperty;\n },\n },\n});\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @param {Boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance\n * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nEllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function (\n time,\n skipModelMatrix,\n modelMatrixResult\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n let color;\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n\n const attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: undefined,\n offset: undefined,\n };\n\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n attributes.color = color;\n }\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new EllipsoidGeometry(this._options),\n modelMatrix: skipModelMatrix\n ? undefined\n : entity.computeModelMatrixForHeightReference(\n time,\n entity.ellipsoid.heightReference,\n this._options.radii.z * 0.5,\n this._scene.mapProjection.ellipsoid,\n modelMatrixResult\n ),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @param {Boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance\n * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nEllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time,\n skipModelMatrix,\n modelMatrixResult\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new EllipsoidOutlineGeometry(this._options),\n modelMatrix: skipModelMatrix\n ? undefined\n : entity.computeModelMatrixForHeightReference(\n time,\n entity.ellipsoid.heightReference,\n this._options.radii.z * 0.5,\n this._scene.mapProjection.ellipsoid,\n modelMatrixResult\n ),\n attributes: attributes,\n });\n};\n\nEllipsoidGeometryUpdater.prototype._computeCenter = function (time, result) {\n return Property.getValueOrUndefined(this._entity.position, time, result);\n};\n\nEllipsoidGeometryUpdater.prototype._isHidden = function (entity, ellipsoid) {\n return (\n !defined(entity.position) ||\n !defined(ellipsoid.radii) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, ellipsoid)\n );\n};\n\nEllipsoidGeometryUpdater.prototype._isDynamic = function (entity, ellipsoid) {\n return (\n !entity.position.isConstant || //\n !Property.isConstant(entity.orientation) || //\n !ellipsoid.radii.isConstant || //\n !Property.isConstant(ellipsoid.innerRadii) || //\n !Property.isConstant(ellipsoid.stackPartitions) || //\n !Property.isConstant(ellipsoid.slicePartitions) || //\n !Property.isConstant(ellipsoid.outlineWidth) || //\n !Property.isConstant(ellipsoid.minimumClock) || //\n !Property.isConstant(ellipsoid.maximumClock) || //\n !Property.isConstant(ellipsoid.minimumCone) || //\n !Property.isConstant(ellipsoid.maximumCone) || //\n !Property.isConstant(ellipsoid.subdivisions)\n );\n};\n\nEllipsoidGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n ellipsoid\n) {\n const heightReference = Property.getValueOrDefault(\n ellipsoid.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n const options = this._options;\n options.vertexFormat =\n this._materialProperty instanceof ColorMaterialProperty\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.radii = ellipsoid.radii.getValue(\n Iso8601.MINIMUM_VALUE,\n options.radii\n );\n options.innerRadii = Property.getValueOrUndefined(\n ellipsoid.innerRadii,\n options.radii\n );\n options.minimumClock = Property.getValueOrUndefined(\n ellipsoid.minimumClock,\n Iso8601.MINIMUM_VALUE\n );\n options.maximumClock = Property.getValueOrUndefined(\n ellipsoid.maximumClock,\n Iso8601.MINIMUM_VALUE\n );\n options.minimumCone = Property.getValueOrUndefined(\n ellipsoid.minimumCone,\n Iso8601.MINIMUM_VALUE\n );\n options.maximumCone = Property.getValueOrUndefined(\n ellipsoid.maximumCone,\n Iso8601.MINIMUM_VALUE\n );\n options.stackPartitions = Property.getValueOrUndefined(\n ellipsoid.stackPartitions,\n Iso8601.MINIMUM_VALUE\n );\n options.slicePartitions = Property.getValueOrUndefined(\n ellipsoid.slicePartitions,\n Iso8601.MINIMUM_VALUE\n );\n options.subdivisions = Property.getValueOrUndefined(\n ellipsoid.subdivisions,\n Iso8601.MINIMUM_VALUE\n );\n options.offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n};\n\nEllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;\n\nEllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicEllipsoidGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n\n this._scene = geometryUpdater._scene;\n this._modelMatrix = new Matrix4();\n this._attributes = undefined;\n this._outlineAttributes = undefined;\n this._lastSceneMode = undefined;\n this._lastShow = undefined;\n this._lastOutlineShow = undefined;\n this._lastOutlineWidth = undefined;\n this._lastOutlineColor = undefined;\n this._lastOffset = new Cartesian3();\n this._material = {};\n}\n\nif (defined(Object.create)) {\n DynamicEllipsoidGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicEllipsoidGeometryUpdater.prototype.constructor = DynamicEllipsoidGeometryUpdater;\n}\n\nDynamicEllipsoidGeometryUpdater.prototype.update = function (time) {\n const entity = this._entity;\n const ellipsoid = entity.ellipsoid;\n if (\n !entity.isShowing ||\n !entity.isAvailable(time) ||\n !Property.getValueOrDefault(ellipsoid.show, time, true)\n ) {\n if (defined(this._primitive)) {\n this._primitive.show = false;\n }\n\n if (defined(this._outlinePrimitive)) {\n this._outlinePrimitive.show = false;\n }\n return;\n }\n\n const radii = Property.getValueOrUndefined(\n ellipsoid.radii,\n time,\n radiiScratch\n );\n let modelMatrix = defined(radii)\n ? entity.computeModelMatrixForHeightReference(\n time,\n ellipsoid.heightReference,\n radii.z * 0.5,\n this._scene.mapProjection.ellipsoid,\n this._modelMatrix\n )\n : undefined;\n if (!defined(modelMatrix) || !defined(radii)) {\n if (defined(this._primitive)) {\n this._primitive.show = false;\n }\n\n if (defined(this._outlinePrimitive)) {\n this._outlinePrimitive.show = false;\n }\n return;\n }\n\n //Compute attributes and material.\n const showFill = Property.getValueOrDefault(ellipsoid.fill, time, true);\n const showOutline = Property.getValueOrDefault(\n ellipsoid.outline,\n time,\n false\n );\n const outlineColor = Property.getValueOrClonedDefault(\n ellipsoid.outlineColor,\n time,\n Color.BLACK,\n scratchColor\n );\n const material = MaterialProperty.getValue(\n time,\n defaultValue(ellipsoid.material, defaultMaterial),\n this._material\n );\n\n // Check properties that could trigger a primitive rebuild.\n const innerRadii = Property.getValueOrUndefined(\n ellipsoid.innerRadii,\n time,\n innerRadiiScratch\n );\n const minimumClock = Property.getValueOrUndefined(\n ellipsoid.minimumClock,\n time\n );\n const maximumClock = Property.getValueOrUndefined(\n ellipsoid.maximumClock,\n time\n );\n const minimumCone = Property.getValueOrUndefined(ellipsoid.minimumCone, time);\n const maximumCone = Property.getValueOrUndefined(ellipsoid.maximumCone, time);\n const stackPartitions = Property.getValueOrUndefined(\n ellipsoid.stackPartitions,\n time\n );\n const slicePartitions = Property.getValueOrUndefined(\n ellipsoid.slicePartitions,\n time\n );\n const subdivisions = Property.getValueOrUndefined(\n ellipsoid.subdivisions,\n time\n );\n const outlineWidth = Property.getValueOrDefault(\n ellipsoid.outlineWidth,\n time,\n 1.0\n );\n const heightReference = Property.getValueOrDefault(\n ellipsoid.heightReference,\n time,\n HeightReference.NONE\n );\n const offsetAttribute =\n heightReference !== HeightReference.NONE\n ? GeometryOffsetAttribute.ALL\n : undefined;\n\n //In 3D we use a fast path by modifying Primitive.modelMatrix instead of regenerating the primitive every frame.\n //Also check for height reference because this method doesn't work when the height is relative to terrain.\n const sceneMode = this._scene.mode;\n const in3D =\n sceneMode === SceneMode.SCENE3D && heightReference === HeightReference.NONE;\n\n const options = this._options;\n\n const shadows = this._geometryUpdater.shadowsProperty.getValue(time);\n\n const distanceDisplayConditionProperty = this._geometryUpdater\n .distanceDisplayConditionProperty;\n const distanceDisplayCondition = distanceDisplayConditionProperty.getValue(\n time\n );\n\n const offset = Property.getValueOrDefault(\n this._geometryUpdater.terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n );\n\n //We only rebuild the primitive if something other than the radii has changed\n //For the radii, we use unit sphere and then deform it with a scale matrix.\n const rebuildPrimitives =\n !in3D ||\n this._lastSceneMode !== sceneMode ||\n !defined(this._primitive) || //\n options.stackPartitions !== stackPartitions ||\n options.slicePartitions !== slicePartitions || //\n (defined(innerRadii) &&\n !Cartesian3.equals(options.innerRadii !== innerRadii)) ||\n options.minimumClock !== minimumClock || //\n options.maximumClock !== maximumClock ||\n options.minimumCone !== minimumCone || //\n options.maximumCone !== maximumCone ||\n options.subdivisions !== subdivisions || //\n this._lastOutlineWidth !== outlineWidth ||\n options.offsetAttribute !== offsetAttribute;\n\n if (rebuildPrimitives) {\n const primitives = this._primitives;\n primitives.removeAndDestroy(this._primitive);\n primitives.removeAndDestroy(this._outlinePrimitive);\n this._primitive = undefined;\n this._outlinePrimitive = undefined;\n this._lastSceneMode = sceneMode;\n this._lastOutlineWidth = outlineWidth;\n\n options.stackPartitions = stackPartitions;\n options.slicePartitions = slicePartitions;\n options.subdivisions = subdivisions;\n options.offsetAttribute = offsetAttribute;\n options.radii = Cartesian3.clone(in3D ? unitSphere : radii, options.radii);\n if (defined(innerRadii)) {\n if (in3D) {\n const mag = Cartesian3.magnitude(radii);\n options.innerRadii = Cartesian3.fromElements(\n innerRadii.x / mag,\n innerRadii.y / mag,\n innerRadii.z / mag,\n options.innerRadii\n );\n } else {\n options.innerRadii = Cartesian3.clone(innerRadii, options.innerRadii);\n }\n } else {\n options.innerRadii = undefined;\n }\n options.minimumClock = minimumClock;\n options.maximumClock = maximumClock;\n options.minimumCone = minimumCone;\n options.maximumCone = maximumCone;\n\n const appearance = new MaterialAppearance({\n material: material,\n translucent: material.isTranslucent(),\n closed: true,\n });\n options.vertexFormat = appearance.vertexFormat;\n\n const fillInstance = this._geometryUpdater.createFillGeometryInstance(\n time,\n in3D,\n this._modelMatrix\n );\n\n this._primitive = primitives.add(\n new Primitive({\n geometryInstances: fillInstance,\n appearance: appearance,\n asynchronous: false,\n shadows: shadows,\n })\n );\n\n const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(\n time,\n in3D,\n this._modelMatrix\n );\n this._outlinePrimitive = primitives.add(\n new Primitive({\n geometryInstances: outlineInstance,\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: outlineInstance.attributes.color.value[3] !== 255,\n renderState: {\n lineWidth: this._geometryUpdater._scene.clampLineWidth(\n outlineWidth\n ),\n },\n }),\n asynchronous: false,\n shadows: shadows,\n })\n );\n\n this._lastShow = showFill;\n this._lastOutlineShow = showOutline;\n this._lastOutlineColor = Color.clone(outlineColor, this._lastOutlineColor);\n this._lastDistanceDisplayCondition = distanceDisplayCondition;\n this._lastOffset = Cartesian3.clone(offset, this._lastOffset);\n } else if (this._primitive.ready) {\n //Update attributes only.\n const primitive = this._primitive;\n const outlinePrimitive = this._outlinePrimitive;\n\n primitive.show = true;\n outlinePrimitive.show = true;\n primitive.appearance.material = material;\n\n let attributes = this._attributes;\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(entity);\n this._attributes = attributes;\n }\n if (showFill !== this._lastShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n showFill,\n attributes.show\n );\n this._lastShow = showFill;\n }\n\n let outlineAttributes = this._outlineAttributes;\n\n if (!defined(outlineAttributes)) {\n outlineAttributes = outlinePrimitive.getGeometryInstanceAttributes(\n entity\n );\n this._outlineAttributes = outlineAttributes;\n }\n\n if (showOutline !== this._lastOutlineShow) {\n outlineAttributes.show = ShowGeometryInstanceAttribute.toValue(\n showOutline,\n outlineAttributes.show\n );\n this._lastOutlineShow = showOutline;\n }\n\n if (!Color.equals(outlineColor, this._lastOutlineColor)) {\n outlineAttributes.color = ColorGeometryInstanceAttribute.toValue(\n outlineColor,\n outlineAttributes.color\n );\n Color.clone(outlineColor, this._lastOutlineColor);\n }\n\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n this._lastDistanceDisplayCondition\n )\n ) {\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n outlineAttributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n outlineAttributes.distanceDisplayCondition\n );\n DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n this._lastDistanceDisplayCondition\n );\n }\n\n if (!Cartesian3.equals(offset, this._lastOffset)) {\n attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n offset,\n attributes.offset\n );\n outlineAttributes.offset = OffsetGeometryInstanceAttribute.toValue(\n offset,\n attributes.offset\n );\n Cartesian3.clone(offset, this._lastOffset);\n }\n }\n\n if (in3D) {\n //Since we are scaling a unit sphere, we can't let any of the values go to zero.\n //Instead we clamp them to a small value. To the naked eye, this produces the same results\n //that you get passing EllipsoidGeometry a radii with a zero component.\n radii.x = Math.max(radii.x, 0.001);\n radii.y = Math.max(radii.y, 0.001);\n radii.z = Math.max(radii.z, 0.001);\n\n modelMatrix = Matrix4.multiplyByScale(modelMatrix, radii, modelMatrix);\n this._primitive.modelMatrix = modelMatrix;\n this._outlinePrimitive.modelMatrix = modelMatrix;\n }\n};\nexport default EllipsoidGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * Describes geometry representing a plane centered at the origin, with a unit width and length.\n *\n * @alias PlaneGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @example\n * const planeGeometry = new Cesium.PlaneGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY\n * });\n */\nfunction PlaneGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n this._vertexFormat = vertexFormat;\n this._workerName = \"createPlaneGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nPlaneGeometry.packedLength = VertexFormat.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PlaneGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPlaneGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n\n return array;\n};\n\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n vertexFormat: scratchVertexFormat,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PlaneGeometry} [result] The object into which to store the result.\n * @returns {PlaneGeometry} The modified result parameter or a new PlaneGeometry instance if one was not provided.\n */\nPlaneGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n\n if (!defined(result)) {\n return new PlaneGeometry(scratchOptions);\n }\n\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n\n return result;\n};\n\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\nconst max = new Cartesian3(0.5, 0.5, 0.0);\n\n/**\n * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.\n *\n * @param {PlaneGeometry} planeGeometry A description of the plane.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPlaneGeometry.createGeometry = function (planeGeometry) {\n const vertexFormat = planeGeometry._vertexFormat;\n\n const attributes = new GeometryAttributes();\n let indices;\n let positions;\n\n if (vertexFormat.position) {\n // 4 corner points. Duplicated 3 times each for each incident edge/face.\n positions = new Float64Array(4 * 3);\n\n // +z face\n positions[0] = min.x;\n positions[1] = min.y;\n positions[2] = 0.0;\n positions[3] = max.x;\n positions[4] = min.y;\n positions[5] = 0.0;\n positions[6] = max.x;\n positions[7] = max.y;\n positions[8] = 0.0;\n positions[9] = min.x;\n positions[10] = max.y;\n positions[11] = 0.0;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n if (vertexFormat.normal) {\n const normals = new Float32Array(4 * 3);\n\n // +z face\n normals[0] = 0.0;\n normals[1] = 0.0;\n normals[2] = 1.0;\n normals[3] = 0.0;\n normals[4] = 0.0;\n normals[5] = 1.0;\n normals[6] = 0.0;\n normals[7] = 0.0;\n normals[8] = 1.0;\n normals[9] = 0.0;\n normals[10] = 0.0;\n normals[11] = 1.0;\n\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.st) {\n const texCoords = new Float32Array(4 * 2);\n\n // +z face\n texCoords[0] = 0.0;\n texCoords[1] = 0.0;\n texCoords[2] = 1.0;\n texCoords[3] = 0.0;\n texCoords[4] = 1.0;\n texCoords[5] = 1.0;\n texCoords[6] = 0.0;\n texCoords[7] = 1.0;\n\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: texCoords,\n });\n }\n\n if (vertexFormat.tangent) {\n const tangents = new Float32Array(4 * 3);\n\n // +z face\n tangents[0] = 1.0;\n tangents[1] = 0.0;\n tangents[2] = 0.0;\n tangents[3] = 1.0;\n tangents[4] = 0.0;\n tangents[5] = 0.0;\n tangents[6] = 1.0;\n tangents[7] = 0.0;\n tangents[8] = 0.0;\n tangents[9] = 1.0;\n tangents[10] = 0.0;\n tangents[11] = 0.0;\n\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n const bitangents = new Float32Array(4 * 3);\n\n // +z face\n bitangents[0] = 0.0;\n bitangents[1] = 1.0;\n bitangents[2] = 0.0;\n bitangents[3] = 0.0;\n bitangents[4] = 1.0;\n bitangents[5] = 0.0;\n bitangents[6] = 0.0;\n bitangents[7] = 1.0;\n bitangents[8] = 0.0;\n bitangents[9] = 0.0;\n bitangents[10] = 1.0;\n bitangents[11] = 0.0;\n\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n // 2 triangles\n indices = new Uint16Array(2 * 3);\n\n // +z face\n indices[0] = 0;\n indices[1] = 1;\n indices[2] = 2;\n indices[3] = 0;\n indices[4] = 2;\n indices[5] = 3;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\n });\n};\nexport default PlaneGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\n/**\n * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.\n *\n * @alias PlaneOutlineGeometry\n * @constructor\n *\n */\nfunction PlaneOutlineGeometry() {\n this._workerName = \"createPlaneOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nPlaneOutlineGeometry.packedLength = 0;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PlaneOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n *\n * @returns {Number[]} The array that was packed into\n */\nPlaneOutlineGeometry.pack = function (value, array) {\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PlaneOutlineGeometry} [result] The object into which to store the result.\n * @returns {PlaneOutlineGeometry} The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.\n */\nPlaneOutlineGeometry.unpack = function (array, startingIndex, result) {\n if (!defined(result)) {\n return new PlaneOutlineGeometry();\n }\n\n return result;\n};\n\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\nconst max = new Cartesian3(0.5, 0.5, 0.0);\n\n/**\n * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.\n *\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPlaneOutlineGeometry.createGeometry = function () {\n const attributes = new GeometryAttributes();\n const indices = new Uint16Array(4 * 2);\n const positions = new Float64Array(4 * 3);\n\n positions[0] = min.x;\n positions[1] = min.y;\n positions[2] = min.z;\n positions[3] = max.x;\n positions[4] = min.y;\n positions[5] = min.z;\n positions[6] = max.x;\n positions[7] = max.y;\n positions[8] = min.z;\n positions[9] = min.x;\n positions[10] = max.y;\n positions[11] = min.z;\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n indices[0] = 0;\n indices[1] = 1;\n indices[2] = 1;\n indices[3] = 2;\n indices[4] = 2;\n indices[5] = 3;\n indices[6] = 3;\n indices[7] = 0;\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\n });\n};\nexport default PlaneOutlineGeometry;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PlaneGeometry from \"../Core/PlaneGeometry.js\";\nimport PlaneOutlineGeometry from \"../Core/PlaneOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst positionScratch = new Cartesian3();\nconst scratchColor = new Color();\n\nfunction PlaneGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.plane = undefined;\n this.dimensions = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for planes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PlaneGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PlaneGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new PlaneGeometryOptions(entity),\n geometryPropertyName: \"plane\",\n observedPropertyNames: [\"availability\", \"position\", \"orientation\", \"plane\"],\n });\n\n this._onEntityPropertyChanged(entity, \"plane\", entity.plane, undefined);\n}\n\nif (defined(Object.create)) {\n PlaneGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n PlaneGeometryUpdater.prototype.constructor = PlaneGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPlaneGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n let attributes;\n\n let color;\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: color,\n };\n } else {\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n };\n }\n\n const planeGraphics = entity.plane;\n const options = this._options;\n let modelMatrix = entity.computeModelMatrix(time);\n const plane = Property.getValueOrDefault(\n planeGraphics.plane,\n time,\n options.plane\n );\n const dimensions = Property.getValueOrUndefined(\n planeGraphics.dimensions,\n time,\n options.dimensions\n );\n\n options.plane = plane;\n options.dimensions = dimensions;\n\n modelMatrix = createPrimitiveMatrix(\n plane,\n dimensions,\n modelMatrix,\n modelMatrix\n );\n\n return new GeometryInstance({\n id: entity,\n geometry: new PlaneGeometry(this._options),\n modelMatrix: modelMatrix,\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const planeGraphics = entity.plane;\n const options = this._options;\n let modelMatrix = entity.computeModelMatrix(time);\n const plane = Property.getValueOrDefault(\n planeGraphics.plane,\n time,\n options.plane\n );\n const dimensions = Property.getValueOrUndefined(\n planeGraphics.dimensions,\n time,\n options.dimensions\n );\n\n options.plane = plane;\n options.dimensions = dimensions;\n\n modelMatrix = createPrimitiveMatrix(\n plane,\n dimensions,\n modelMatrix,\n modelMatrix\n );\n\n return new GeometryInstance({\n id: entity,\n geometry: new PlaneOutlineGeometry(),\n modelMatrix: modelMatrix,\n attributes: {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n },\n });\n};\n\nPlaneGeometryUpdater.prototype._isHidden = function (entity, plane) {\n return (\n !defined(plane.plane) ||\n !defined(plane.dimensions) ||\n !defined(entity.position) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, plane)\n );\n};\n\nPlaneGeometryUpdater.prototype._getIsClosed = function (options) {\n return false;\n};\n\nPlaneGeometryUpdater.prototype._isDynamic = function (entity, plane) {\n return (\n !entity.position.isConstant || //\n !Property.isConstant(entity.orientation) || //\n !plane.plane.isConstant || //\n !plane.dimensions.isConstant || //\n !Property.isConstant(plane.outlineWidth)\n );\n};\n\nPlaneGeometryUpdater.prototype._setStaticOptions = function (entity, plane) {\n const isColorMaterial =\n this._materialProperty instanceof ColorMaterialProperty;\n\n const options = this._options;\n options.vertexFormat = isColorMaterial\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.plane = plane.plane.getValue(Iso8601.MINIMUM_VALUE, options.plane);\n options.dimensions = plane.dimensions.getValue(\n Iso8601.MINIMUM_VALUE,\n options.dimensions\n );\n};\n\nPlaneGeometryUpdater.DynamicGeometryUpdater = DynamicPlaneGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicPlaneGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicPlaneGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicPlaneGeometryUpdater.prototype.constructor = DynamicPlaneGeometryUpdater;\n}\n\nDynamicPlaneGeometryUpdater.prototype._isHidden = function (\n entity,\n plane,\n time\n) {\n const options = this._options;\n const position = Property.getValueOrUndefined(\n entity.position,\n time,\n positionScratch\n );\n return (\n !defined(position) ||\n !defined(options.plane) ||\n !defined(options.dimensions) ||\n DynamicGeometryUpdater.prototype._isHidden.call(this, entity, plane, time)\n );\n};\n\nDynamicPlaneGeometryUpdater.prototype._setOptions = function (\n entity,\n plane,\n time\n) {\n const options = this._options;\n options.plane = Property.getValueOrDefault(plane.plane, time, options.plane);\n options.dimensions = Property.getValueOrUndefined(\n plane.dimensions,\n time,\n options.dimensions\n );\n};\n\nconst scratchAxis = new Cartesian3();\nconst scratchUp = new Cartesian3();\nconst scratchTranslation = new Cartesian3();\nconst scratchScale = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchRotationScale = new Matrix3();\nconst scratchLocalTransform = new Matrix4();\nfunction createPrimitiveMatrix(plane, dimensions, transform, result) {\n const normal = plane.normal;\n const distance = plane.distance;\n\n const translation = Cartesian3.multiplyByScalar(\n normal,\n -distance,\n scratchTranslation\n );\n\n let up = Cartesian3.clone(Cartesian3.UNIT_Z, scratchUp);\n if (\n CesiumMath.equalsEpsilon(\n Math.abs(Cartesian3.dot(up, normal)),\n 1.0,\n CesiumMath.EPSILON8\n )\n ) {\n up = Cartesian3.clone(Cartesian3.UNIT_Y, up);\n }\n\n const left = Cartesian3.cross(up, normal, scratchAxis);\n up = Cartesian3.cross(normal, left, up);\n Cartesian3.normalize(left, left);\n Cartesian3.normalize(up, up);\n\n const rotationMatrix = scratchRotation;\n Matrix3.setColumn(rotationMatrix, 0, left, rotationMatrix);\n Matrix3.setColumn(rotationMatrix, 1, up, rotationMatrix);\n Matrix3.setColumn(rotationMatrix, 2, normal, rotationMatrix);\n\n const scale = Cartesian3.fromElements(\n dimensions.x,\n dimensions.y,\n 1.0,\n scratchScale\n );\n const rotationScaleMatrix = Matrix3.multiplyByScale(\n rotationMatrix,\n scale,\n scratchRotationScale\n );\n\n const localTransform = Matrix4.fromRotationTranslation(\n rotationScaleMatrix,\n translation,\n scratchLocalTransform\n );\n return Matrix4.multiplyTransformation(transform, localTransform, result);\n}\n\n/**\n * @private\n */\nPlaneGeometryUpdater.createPrimitiveMatrix = createPrimitiveMatrix;\nexport default PlaneGeometryUpdater;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchPosition = new Cartesian3();\nconst scratchBR = new BoundingRectangle();\nconst stScratch = new Cartesian2();\nconst textureCoordinatesOrigin = new Cartesian2();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst centerScratch = new Cartesian3();\nconst axis1Scratch = new Cartesian3();\nconst axis2Scratch = new Cartesian3();\nconst quaternionScratch = new Quaternion();\nconst textureMatrixScratch = new Matrix3();\nconst tangentRotationScratch = new Matrix3();\nconst surfaceNormalScratch = new Cartesian3();\n\nfunction createGeometryFromPolygon(\n polygon,\n vertexFormat,\n boundingRectangle,\n stRotation,\n hardcodedTextureCoordinates,\n projectPointTo2D,\n normal,\n tangent,\n bitangent\n) {\n const positions = polygon.positions;\n let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\n\n /* If polygon is completely unrenderable, just use the first three vertices */\n if (indices.length < 3) {\n indices = [0, 1, 2];\n }\n\n const newIndices = IndexDatatype.createTypedArray(\n positions.length,\n indices.length\n );\n newIndices.set(indices);\n\n let textureMatrix = textureMatrixScratch;\n if (stRotation !== 0.0) {\n let rotation = Quaternion.fromAxisAngle(\n normal,\n stRotation,\n quaternionScratch\n );\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n rotation = Quaternion.fromAxisAngle(\n normal,\n -stRotation,\n quaternionScratch\n );\n const tangentRotation = Matrix3.fromQuaternion(\n rotation,\n tangentRotationScratch\n );\n\n tangent = Cartesian3.normalize(\n Matrix3.multiplyByVector(tangentRotation, tangent, tangent),\n tangent\n );\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n }\n }\n } else {\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n }\n\n const stOrigin = textureCoordinatesOrigin;\n if (vertexFormat.st) {\n stOrigin.x = boundingRectangle.x;\n stOrigin.y = boundingRectangle.y;\n }\n\n const length = positions.length;\n const size = length * 3;\n const flatPositions = new Float64Array(size);\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size)\n : undefined;\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(length * 2)\n : undefined;\n\n let positionIndex = 0;\n let normalIndex = 0;\n let bitangentIndex = 0;\n let tangentIndex = 0;\n let stIndex = 0;\n\n for (let i = 0; i < length; i++) {\n const position = positions[i];\n flatPositions[positionIndex++] = position.x;\n flatPositions[positionIndex++] = position.y;\n flatPositions[positionIndex++] = position.z;\n\n if (vertexFormat.st) {\n if (\n defined(hardcodedTextureCoordinates) &&\n hardcodedTextureCoordinates.positions.length === length\n ) {\n textureCoordinates[stIndex++] =\n hardcodedTextureCoordinates.positions[i].x;\n textureCoordinates[stIndex++] =\n hardcodedTextureCoordinates.positions[i].y;\n } else {\n const p = Matrix3.multiplyByVector(\n textureMatrix,\n position,\n scratchPosition\n );\n const st = projectPointTo2D(p, stScratch);\n Cartesian2.subtract(st, stOrigin, st);\n\n const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\n const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\n textureCoordinates[stIndex++] = stx;\n textureCoordinates[stIndex++] = sty;\n }\n }\n\n if (vertexFormat.normal) {\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n }\n\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n }\n }\n\n const attributes = new GeometryAttributes();\n\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: flatPositions,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n return new Geometry({\n attributes: attributes,\n indices: newIndices,\n primitiveType: PrimitiveType.TRIANGLES,\n });\n}\n\n/**\n * A description of a polygon composed of arbitrary coplanar positions.\n *\n * @alias CoplanarPolygonGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\n *\n * @example\n * const polygonGeometry = new Cesium.CoplanarPolygonGeometry({\n * polygonHierarchy: new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArrayHeights([\n * -90.0, 30.0, 0.0,\n * -90.0, 30.0, 300000.0,\n * -80.0, 30.0, 300000.0,\n * -80.0, 30.0, 0.0\n * ]))\n * });\n *\n */\nfunction CoplanarPolygonGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const polygonHierarchy = options.polygonHierarchy;\n const textureCoordinates = options.textureCoordinates;\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._polygonHierarchy = polygonHierarchy;\n this._stRotation = defaultValue(options.stRotation, 0.0);\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._workerName = \"createCoplanarPolygonGeometry\";\n this._textureCoordinates = textureCoordinates;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n PolygonGeometryLibrary.computeHierarchyPackedLength(\n polygonHierarchy,\n Cartesian3\n ) +\n VertexFormat.packedLength +\n Ellipsoid.packedLength +\n (defined(textureCoordinates)\n ? PolygonGeometryLibrary.computeHierarchyPackedLength(\n textureCoordinates,\n Cartesian2\n )\n : 1) +\n 2;\n}\n\n/**\n * A description of a coplanar polygon from an array of positions.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\n * @returns {CoplanarPolygonGeometry}\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * @see PolygonGeometry#createGeometry\n */\nCoplanarPolygonGeometry.fromPositions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const newOptions = {\n polygonHierarchy: {\n positions: options.positions,\n },\n vertexFormat: options.vertexFormat,\n stRotation: options.stRotation,\n ellipsoid: options.ellipsoid,\n textureCoordinates: options.textureCoordinates,\n };\n return new CoplanarPolygonGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CoplanarPolygonGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCoplanarPolygonGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._polygonHierarchy,\n array,\n startingIndex,\n Cartesian3\n );\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._stRotation;\n if (defined(value._textureCoordinates)) {\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._textureCoordinates,\n array,\n startingIndex,\n Cartesian2\n );\n } else {\n array[startingIndex++] = -1.0;\n }\n array[startingIndex++] = value.packedLength;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n polygonHierarchy: {},\n};\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CoplanarPolygonGeometry} [result] The object into which to store the result.\n * @returns {CoplanarPolygonGeometry} The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.\n */\nCoplanarPolygonGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian3\n );\n startingIndex = polygonHierarchy.startingIndex;\n delete polygonHierarchy.startingIndex;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const stRotation = array[startingIndex++];\n const textureCoordinates =\n array[startingIndex] === -1.0\n ? undefined\n : PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian2\n );\n if (defined(textureCoordinates)) {\n startingIndex = textureCoordinates.startingIndex;\n delete textureCoordinates.startingIndex;\n } else {\n startingIndex++;\n }\n const packedLength = array[startingIndex++];\n\n if (!defined(result)) {\n result = new CoplanarPolygonGeometry(scratchOptions);\n }\n\n result._polygonHierarchy = polygonHierarchy;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._stRotation = stRotation;\n result._textureCoordinates = textureCoordinates;\n result.packedLength = packedLength;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {CoplanarPolygonGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCoplanarPolygonGeometry.createGeometry = function (polygonGeometry) {\n const vertexFormat = polygonGeometry._vertexFormat;\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\n const stRotation = polygonGeometry._stRotation;\n const textureCoordinates = polygonGeometry._textureCoordinates;\n const hasTextureCoordinates = defined(textureCoordinates);\n\n let outerPositions = polygonHierarchy.positions;\n outerPositions = arrayRemoveDuplicates(\n outerPositions,\n Cartesian3.equalsEpsilon,\n true\n );\n if (outerPositions.length < 3) {\n return;\n }\n\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n let axis1 = axis1Scratch;\n const axis2 = axis2Scratch;\n\n const validGeometry = CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(\n outerPositions,\n centerScratch,\n axis1,\n axis2\n );\n if (!validGeometry) {\n return undefined;\n }\n\n normal = Cartesian3.cross(axis1, axis2, normal);\n normal = Cartesian3.normalize(normal, normal);\n\n if (\n !Cartesian3.equalsEpsilon(\n centerScratch,\n Cartesian3.ZERO,\n CesiumMath.EPSILON6\n )\n ) {\n const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(\n centerScratch,\n surfaceNormalScratch\n );\n if (Cartesian3.dot(normal, surfaceNormal) < 0) {\n normal = Cartesian3.negate(normal, normal);\n axis1 = Cartesian3.negate(axis1, axis1);\n }\n }\n\n const projectPoints = CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(\n centerScratch,\n axis1,\n axis2\n );\n const projectPoint = CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(\n centerScratch,\n axis1,\n axis2\n );\n\n if (vertexFormat.tangent) {\n tangent = Cartesian3.clone(axis1, tangent);\n }\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.clone(axis2, bitangent);\n }\n\n const results = PolygonGeometryLibrary.polygonsFromHierarchy(\n polygonHierarchy,\n hasTextureCoordinates,\n projectPoints,\n false\n );\n const hierarchy = results.hierarchy;\n const polygons = results.polygons;\n\n const dummyFunction = function (identity) {\n return identity;\n };\n\n const textureCoordinatePolygons = hasTextureCoordinates\n ? PolygonGeometryLibrary.polygonsFromHierarchy(\n textureCoordinates,\n true,\n dummyFunction,\n false\n ).polygons\n : undefined;\n\n if (hierarchy.length === 0) {\n return;\n }\n outerPositions = hierarchy[0].outerRing;\n\n const boundingSphere = BoundingSphere.fromPoints(outerPositions);\n const boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(\n normal,\n projectPoint,\n outerPositions,\n stRotation,\n scratchBR\n );\n\n const geometries = [];\n for (let i = 0; i < polygons.length; i++) {\n const geometryInstance = new GeometryInstance({\n geometry: createGeometryFromPolygon(\n polygons[i],\n vertexFormat,\n boundingRectangle,\n stRotation,\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n projectPoint,\n normal,\n tangent,\n bitangent\n ),\n });\n\n geometries.push(geometryInstance);\n }\n\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\n geometry.attributes.position.values = new Float64Array(\n geometry.attributes.position.values\n );\n geometry.indices = IndexDatatype.createTypedArray(\n geometry.attributes.position.values.length / 3,\n geometry.indices\n );\n\n const attributes = geometry.attributes;\n if (!vertexFormat.position) {\n delete attributes.position;\n }\n return new Geometry({\n attributes: attributes,\n indices: geometry.indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: boundingSphere,\n });\n};\nexport default CoplanarPolygonGeometry;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nconst scratchCarto1 = new Cartographic();\nconst scratchCarto2 = new Cartographic();\nfunction adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {\n const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);\n const height = carto1.height;\n const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);\n p1Carto.height = height;\n ellipsoid.cartographicToCartesian(p1Carto, p1);\n\n const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);\n p2Carto.height = height - 100;\n ellipsoid.cartographicToCartesian(p2Carto, p2);\n}\n\nconst scratchBoundingRectangle = new BoundingRectangle();\nconst scratchPosition = new Cartesian3();\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst p1Scratch = new Cartesian3();\nconst p2Scratch = new Cartesian3();\nlet scratchPerPosNormal = new Cartesian3();\nlet scratchPerPosTangent = new Cartesian3();\nlet scratchPerPosBitangent = new Cartesian3();\n\nconst appendTextureCoordinatesOrigin = new Cartesian2();\nconst appendTextureCoordinatesCartesian2 = new Cartesian2();\nconst appendTextureCoordinatesCartesian3 = new Cartesian3();\nconst appendTextureCoordinatesQuaternion = new Quaternion();\nconst appendTextureCoordinatesMatrix3 = new Matrix3();\nconst tangentMatrixScratch = new Matrix3();\n\nfunction computeAttributes(options) {\n const vertexFormat = options.vertexFormat;\n const geometry = options.geometry;\n const shadowVolume = options.shadowVolume;\n const flatPositions = geometry.attributes.position.values;\n const flatTexcoords = defined(geometry.attributes.st)\n ? geometry.attributes.st.values\n : undefined;\n\n let length = flatPositions.length;\n const wall = options.wall;\n const top = options.top || wall;\n const bottom = options.bottom || wall;\n if (\n vertexFormat.st ||\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent ||\n shadowVolume\n ) {\n // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.\n // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.\n const boundingRectangle = options.boundingRectangle;\n const tangentPlane = options.tangentPlane;\n const ellipsoid = options.ellipsoid;\n const stRotation = options.stRotation;\n const perPositionHeight = options.perPositionHeight;\n\n const origin = appendTextureCoordinatesOrigin;\n origin.x = boundingRectangle.x;\n origin.y = boundingRectangle.y;\n\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(2 * (length / 3))\n : undefined;\n let normals;\n if (vertexFormat.normal) {\n if (perPositionHeight && top && !wall) {\n normals = geometry.attributes.normal.values;\n } else {\n normals = new Float32Array(length);\n }\n }\n const tangents = vertexFormat.tangent\n ? new Float32Array(length)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(length)\n : undefined;\n const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;\n\n let textureCoordIndex = 0;\n let attrIndex = 0;\n\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n let recomputeNormal = true;\n\n let textureMatrix = appendTextureCoordinatesMatrix3;\n let tangentRotationMatrix = tangentMatrixScratch;\n if (stRotation !== 0.0) {\n let rotation = Quaternion.fromAxisAngle(\n tangentPlane._plane.normal,\n stRotation,\n appendTextureCoordinatesQuaternion\n );\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n rotation = Quaternion.fromAxisAngle(\n tangentPlane._plane.normal,\n -stRotation,\n appendTextureCoordinatesQuaternion\n );\n tangentRotationMatrix = Matrix3.fromQuaternion(\n rotation,\n tangentRotationMatrix\n );\n } else {\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\n tangentRotationMatrix = Matrix3.clone(\n Matrix3.IDENTITY,\n tangentRotationMatrix\n );\n }\n\n let bottomOffset = 0;\n let bottomOffset2 = 0;\n\n if (top && bottom) {\n bottomOffset = length / 2;\n bottomOffset2 = length / 3;\n\n length /= 2;\n }\n\n for (let i = 0; i < length; i += 3) {\n const position = Cartesian3.fromArray(\n flatPositions,\n i,\n appendTextureCoordinatesCartesian3\n );\n\n if (vertexFormat.st) {\n if (!defined(flatTexcoords)) {\n let p = Matrix3.multiplyByVector(\n textureMatrix,\n position,\n scratchPosition\n );\n p = ellipsoid.scaleToGeodeticSurface(p, p);\n const st = tangentPlane.projectPointOntoPlane(\n p,\n appendTextureCoordinatesCartesian2\n );\n Cartesian2.subtract(st, origin, st);\n\n const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\n const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\n if (bottom) {\n textureCoordinates[textureCoordIndex + bottomOffset2] = stx;\n textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;\n }\n if (top) {\n textureCoordinates[textureCoordIndex] = stx;\n textureCoordinates[textureCoordIndex + 1] = sty;\n }\n\n textureCoordIndex += 2;\n }\n }\n\n if (\n vertexFormat.normal ||\n vertexFormat.tangent ||\n vertexFormat.bitangent ||\n shadowVolume\n ) {\n const attrIndex1 = attrIndex + 1;\n const attrIndex2 = attrIndex + 2;\n\n if (wall) {\n if (i + 3 < length) {\n const p1 = Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);\n\n if (recomputeNormal) {\n const p2 = Cartesian3.fromArray(\n flatPositions,\n i + length,\n p2Scratch\n );\n if (perPositionHeight) {\n adjustPosHeightsForNormal(position, p1, p2, ellipsoid);\n }\n Cartesian3.subtract(p1, position, p1);\n Cartesian3.subtract(p2, position, p2);\n normal = Cartesian3.normalize(\n Cartesian3.cross(p2, p1, normal),\n normal\n );\n recomputeNormal = false;\n }\n\n if (Cartesian3.equalsEpsilon(p1, position, CesiumMath.EPSILON10)) {\n // if we've reached a corner\n recomputeNormal = true;\n }\n }\n\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);\n if (vertexFormat.tangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(bitangent, normal, tangent),\n tangent\n );\n }\n }\n } else {\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n if (perPositionHeight) {\n scratchPerPosNormal = Cartesian3.fromArray(\n normals,\n attrIndex,\n scratchPerPosNormal\n );\n scratchPerPosTangent = Cartesian3.cross(\n Cartesian3.UNIT_Z,\n scratchPerPosNormal,\n scratchPerPosTangent\n );\n scratchPerPosTangent = Cartesian3.normalize(\n Matrix3.multiplyByVector(\n tangentRotationMatrix,\n scratchPerPosTangent,\n scratchPerPosTangent\n ),\n scratchPerPosTangent\n );\n if (vertexFormat.bitangent) {\n scratchPerPosBitangent = Cartesian3.normalize(\n Cartesian3.cross(\n scratchPerPosNormal,\n scratchPerPosTangent,\n scratchPerPosBitangent\n ),\n scratchPerPosBitangent\n );\n }\n }\n\n tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\n tangent = Cartesian3.normalize(\n Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),\n tangent\n );\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n }\n }\n }\n\n if (vertexFormat.normal) {\n if (options.wall) {\n normals[attrIndex + bottomOffset] = normal.x;\n normals[attrIndex1 + bottomOffset] = normal.y;\n normals[attrIndex2 + bottomOffset] = normal.z;\n } else if (bottom) {\n normals[attrIndex + bottomOffset] = -normal.x;\n normals[attrIndex1 + bottomOffset] = -normal.y;\n normals[attrIndex2 + bottomOffset] = -normal.z;\n }\n\n if ((top && !perPositionHeight) || wall) {\n normals[attrIndex] = normal.x;\n normals[attrIndex1] = normal.y;\n normals[attrIndex2] = normal.z;\n }\n }\n\n if (shadowVolume) {\n if (wall) {\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\n }\n extrudeNormals[attrIndex + bottomOffset] = -normal.x;\n extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;\n extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;\n }\n\n if (vertexFormat.tangent) {\n if (options.wall) {\n tangents[attrIndex + bottomOffset] = tangent.x;\n tangents[attrIndex1 + bottomOffset] = tangent.y;\n tangents[attrIndex2 + bottomOffset] = tangent.z;\n } else if (bottom) {\n tangents[attrIndex + bottomOffset] = -tangent.x;\n tangents[attrIndex1 + bottomOffset] = -tangent.y;\n tangents[attrIndex2 + bottomOffset] = -tangent.z;\n }\n\n if (top) {\n if (perPositionHeight) {\n tangents[attrIndex] = scratchPerPosTangent.x;\n tangents[attrIndex1] = scratchPerPosTangent.y;\n tangents[attrIndex2] = scratchPerPosTangent.z;\n } else {\n tangents[attrIndex] = tangent.x;\n tangents[attrIndex1] = tangent.y;\n tangents[attrIndex2] = tangent.z;\n }\n }\n }\n\n if (vertexFormat.bitangent) {\n if (bottom) {\n bitangents[attrIndex + bottomOffset] = bitangent.x;\n bitangents[attrIndex1 + bottomOffset] = bitangent.y;\n bitangents[attrIndex2 + bottomOffset] = bitangent.z;\n }\n if (top) {\n if (perPositionHeight) {\n bitangents[attrIndex] = scratchPerPosBitangent.x;\n bitangents[attrIndex1] = scratchPerPosBitangent.y;\n bitangents[attrIndex2] = scratchPerPosBitangent.z;\n } else {\n bitangents[attrIndex] = bitangent.x;\n bitangents[attrIndex1] = bitangent.y;\n bitangents[attrIndex2] = bitangent.z;\n }\n }\n }\n attrIndex += 3;\n }\n }\n\n if (vertexFormat.st && !defined(flatTexcoords)) {\n geometry.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n if (vertexFormat.normal) {\n geometry.attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n geometry.attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n geometry.attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (shadowVolume) {\n geometry.attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: extrudeNormals,\n });\n }\n }\n\n if (options.extrude && defined(options.offsetAttribute)) {\n const size = flatPositions.length / 3;\n let offsetAttribute = new Uint8Array(size);\n\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\n if ((top && bottom) || wall) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else if (top) {\n offsetAttribute = offsetAttribute.fill(1);\n }\n } else {\n const offsetValue =\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n });\n }\n\n return geometry;\n}\n\nconst startCartographicScratch = new Cartographic();\nconst endCartographicScratch = new Cartographic();\nconst idlCross = {\n westOverIDL: 0.0,\n eastOverIDL: 0.0,\n};\nlet ellipsoidGeodesic = new EllipsoidGeodesic();\nfunction computeRectangle(positions, ellipsoid, arcType, granularity, result) {\n result = defaultValue(result, new Rectangle());\n if (!defined(positions) || positions.length < 3) {\n result.west = 0.0;\n result.north = 0.0;\n result.south = 0.0;\n result.east = 0.0;\n return result;\n }\n\n if (arcType === ArcType.RHUMB) {\n return Rectangle.fromCartesianArray(positions, ellipsoid, result);\n }\n\n if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {\n ellipsoidGeodesic = new EllipsoidGeodesic(undefined, undefined, ellipsoid);\n }\n\n result.west = Number.POSITIVE_INFINITY;\n result.east = Number.NEGATIVE_INFINITY;\n result.south = Number.POSITIVE_INFINITY;\n result.north = Number.NEGATIVE_INFINITY;\n\n idlCross.westOverIDL = Number.POSITIVE_INFINITY;\n idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;\n\n const inverseChordLength =\n 1.0 / CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\n const positionsLength = positions.length;\n let endCartographic = ellipsoid.cartesianToCartographic(\n positions[0],\n endCartographicScratch\n );\n let startCartographic = startCartographicScratch;\n let swap;\n\n for (let i = 1; i < positionsLength; i++) {\n swap = startCartographic;\n startCartographic = endCartographic;\n endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);\n ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\n interpolateAndGrowRectangle(\n ellipsoidGeodesic,\n inverseChordLength,\n result,\n idlCross\n );\n }\n\n swap = startCartographic;\n startCartographic = endCartographic;\n endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);\n ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\n interpolateAndGrowRectangle(\n ellipsoidGeodesic,\n inverseChordLength,\n result,\n idlCross\n );\n\n if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {\n result.west = idlCross.westOverIDL;\n result.east = idlCross.eastOverIDL;\n\n if (result.east > CesiumMath.PI) {\n result.east = result.east - CesiumMath.TWO_PI;\n }\n if (result.west > CesiumMath.PI) {\n result.west = result.west - CesiumMath.TWO_PI;\n }\n }\n\n return result;\n}\n\nconst interpolatedCartographicScratch = new Cartographic();\nfunction interpolateAndGrowRectangle(\n ellipsoidGeodesic,\n inverseChordLength,\n result,\n idlCross\n) {\n const segmentLength = ellipsoidGeodesic.surfaceDistance;\n\n const numPoints = Math.ceil(segmentLength * inverseChordLength);\n const subsegmentDistance =\n numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;\n let interpolationDistance = 0.0;\n\n for (let i = 0; i < numPoints; i++) {\n const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\n interpolationDistance,\n interpolatedCartographicScratch\n );\n interpolationDistance += subsegmentDistance;\n const longitude = interpolatedCartographic.longitude;\n const latitude = interpolatedCartographic.latitude;\n\n result.west = Math.min(result.west, longitude);\n result.east = Math.max(result.east, longitude);\n result.south = Math.min(result.south, latitude);\n result.north = Math.max(result.north, latitude);\n\n const lonAdjusted =\n longitude >= 0 ? longitude : longitude + CesiumMath.TWO_PI;\n idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);\n idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);\n }\n}\n\nconst createGeometryFromPositionsExtrudedPositions = [];\n\nfunction createGeometryFromPositionsExtruded(\n ellipsoid,\n polygon,\n textureCoordinates,\n granularity,\n hierarchy,\n perPositionHeight,\n closeTop,\n closeBottom,\n vertexFormat,\n arcType\n) {\n const geos = {\n walls: [],\n };\n let i;\n\n if (closeTop || closeBottom) {\n const topGeo = PolygonGeometryLibrary.createGeometryFromPositions(\n ellipsoid,\n polygon,\n textureCoordinates,\n granularity,\n perPositionHeight,\n vertexFormat,\n arcType\n );\n\n const edgePoints = topGeo.attributes.position.values;\n const indices = topGeo.indices;\n let numPositions;\n let newIndices;\n\n if (closeTop && closeBottom) {\n const topBottomPositions = edgePoints.concat(edgePoints);\n\n numPositions = topBottomPositions.length / 3;\n\n newIndices = IndexDatatype.createTypedArray(\n numPositions,\n indices.length * 2\n );\n newIndices.set(indices);\n const ilength = indices.length;\n\n const length = numPositions / 2;\n\n for (i = 0; i < ilength; i += 3) {\n const i0 = newIndices[i] + length;\n const i1 = newIndices[i + 1] + length;\n const i2 = newIndices[i + 2] + length;\n\n newIndices[i + ilength] = i2;\n newIndices[i + 1 + ilength] = i1;\n newIndices[i + 2 + ilength] = i0;\n }\n\n topGeo.attributes.position.values = topBottomPositions;\n if (perPositionHeight && vertexFormat.normal) {\n const normals = topGeo.attributes.normal.values;\n topGeo.attributes.normal.values = new Float32Array(\n topBottomPositions.length\n );\n topGeo.attributes.normal.values.set(normals);\n }\n\n if (vertexFormat.st && defined(textureCoordinates)) {\n const texcoords = topGeo.attributes.st.values;\n topGeo.attributes.st.values = new Float32Array(numPositions * 2);\n topGeo.attributes.st.values = texcoords.concat(texcoords);\n }\n\n topGeo.indices = newIndices;\n } else if (closeBottom) {\n numPositions = edgePoints.length / 3;\n newIndices = IndexDatatype.createTypedArray(numPositions, indices.length);\n\n for (i = 0; i < indices.length; i += 3) {\n newIndices[i] = indices[i + 2];\n newIndices[i + 1] = indices[i + 1];\n newIndices[i + 2] = indices[i];\n }\n\n topGeo.indices = newIndices;\n }\n\n geos.topAndBottom = new GeometryInstance({\n geometry: topGeo,\n });\n }\n\n let outerRing = hierarchy.outerRing;\n let tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);\n let positions2D = tangentPlane.projectPointsOntoPlane(\n outerRing,\n createGeometryFromPositionsExtrudedPositions\n );\n\n let windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\n if (windingOrder === WindingOrder.CLOCKWISE) {\n outerRing = outerRing.slice().reverse();\n }\n\n let wallGeo = PolygonGeometryLibrary.computeWallGeometry(\n outerRing,\n textureCoordinates,\n ellipsoid,\n granularity,\n perPositionHeight,\n arcType\n );\n geos.walls.push(\n new GeometryInstance({\n geometry: wallGeo,\n })\n );\n\n const holes = hierarchy.holes;\n for (i = 0; i < holes.length; i++) {\n let hole = holes[i];\n\n tangentPlane = EllipsoidTangentPlane.fromPoints(hole, ellipsoid);\n positions2D = tangentPlane.projectPointsOntoPlane(\n hole,\n createGeometryFromPositionsExtrudedPositions\n );\n\n windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\n if (windingOrder === WindingOrder.COUNTER_CLOCKWISE) {\n hole = hole.slice().reverse();\n }\n\n wallGeo = PolygonGeometryLibrary.computeWallGeometry(\n hole,\n textureCoordinates,\n ellipsoid,\n granularity,\n perPositionHeight,\n arcType\n );\n geos.walls.push(\n new GeometryInstance({\n geometry: wallGeo,\n })\n );\n }\n\n return geos;\n}\n\n/**\n * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias PolygonGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\n * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n *\n * @see PolygonGeometry#createGeometry\n * @see PolygonGeometry#fromPositions\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}\n *\n * @example\n * // 1. create a polygon from points\n * const polygon = new Cesium.PolygonGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * )\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * // 2. create a nested polygon with holes\n * const polygonWithHole = new Cesium.PolygonGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -109.0, 30.0,\n * -95.0, 30.0,\n * -95.0, 40.0,\n * -109.0, 40.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -107.0, 31.0,\n * -107.0, 39.0,\n * -97.0, 39.0,\n * -97.0, 31.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 33.0,\n * -99.0, 33.0,\n * -99.0, 37.0,\n * -105.0, 37.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -103.0, 34.0,\n * -101.0, 34.0,\n * -101.0, 36.0,\n * -103.0, 36.0\n * ])\n * )]\n * )]\n * )]\n * )\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);\n *\n * // 3. create extruded polygon\n * const extrudedPolygon = new Cesium.PolygonGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * ),\n * extrudedHeight: 300000\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);\n */\nfunction PolygonGeometry(options) {\n const polygonHierarchy = options.polygonHierarchy;\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const stRotation = defaultValue(options.stRotation, 0.0);\n const textureCoordinates = options.textureCoordinates;\n const perPositionHeight = defaultValue(options.perPositionHeight, false);\n const perPositionHeightExtrude =\n perPositionHeight && defined(options.extrudedHeight);\n let height = defaultValue(options.height, 0.0);\n let extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n if (!perPositionHeightExtrude) {\n const h = Math.max(height, extrudedHeight);\n extrudedHeight = Math.min(height, extrudedHeight);\n height = h;\n }\n\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._granularity = granularity;\n this._stRotation = stRotation;\n this._height = height;\n this._extrudedHeight = extrudedHeight;\n this._closeTop = defaultValue(options.closeTop, true);\n this._closeBottom = defaultValue(options.closeBottom, true);\n this._polygonHierarchy = polygonHierarchy;\n this._perPositionHeight = perPositionHeight;\n this._perPositionHeightExtrude = perPositionHeightExtrude;\n this._shadowVolume = defaultValue(options.shadowVolume, false);\n this._workerName = \"createPolygonGeometry\";\n this._offsetAttribute = options.offsetAttribute;\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n this._rectangle = undefined;\n this._textureCoordinateRotationPoints = undefined;\n this._textureCoordinates = textureCoordinates;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n PolygonGeometryLibrary.computeHierarchyPackedLength(\n polygonHierarchy,\n Cartesian3\n ) +\n Ellipsoid.packedLength +\n VertexFormat.packedLength +\n (textureCoordinates\n ? PolygonGeometryLibrary.computeHierarchyPackedLength(\n textureCoordinates,\n Cartesian2\n )\n : 1) +\n 12;\n}\n\n/**\n * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {Number} [options.height=0.0] The height of the polygon.\n * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\n * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\n * @returns {PolygonGeometry}\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.PolygonGeometry.fromPositions({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * });\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\n *\n * @see PolygonGeometry#createGeometry\n */\nPolygonGeometry.fromPositions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const newOptions = {\n polygonHierarchy: {\n positions: options.positions,\n },\n height: options.height,\n extrudedHeight: options.extrudedHeight,\n vertexFormat: options.vertexFormat,\n stRotation: options.stRotation,\n ellipsoid: options.ellipsoid,\n granularity: options.granularity,\n perPositionHeight: options.perPositionHeight,\n closeTop: options.closeTop,\n closeBottom: options.closeBottom,\n offsetAttribute: options.offsetAttribute,\n arcType: options.arcType,\n textureCoordinates: options.textureCoordinates,\n };\n return new PolygonGeometry(newOptions);\n};\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPolygonGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._polygonHierarchy,\n array,\n startingIndex,\n Cartesian3\n );\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._stRotation;\n array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\n array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\n array[startingIndex++] = value._closeTop ? 1.0 : 0.0;\n array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\n array[startingIndex++] = value._arcType;\n if (defined(value._textureCoordinates)) {\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._textureCoordinates,\n array,\n startingIndex,\n Cartesian2\n );\n } else {\n array[startingIndex++] = -1.0;\n }\n array[startingIndex++] = value.packedLength;\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\n\n//Only used to avoid inability to default construct.\nconst dummyOptions = {\n polygonHierarchy: {},\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonGeometry} [result] The object into which to store the result.\n */\nPolygonGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian3\n );\n startingIndex = polygonHierarchy.startingIndex;\n delete polygonHierarchy.startingIndex;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const height = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const granularity = array[startingIndex++];\n const stRotation = array[startingIndex++];\n const perPositionHeightExtrude = array[startingIndex++] === 1.0;\n const perPositionHeight = array[startingIndex++] === 1.0;\n const closeTop = array[startingIndex++] === 1.0;\n const closeBottom = array[startingIndex++] === 1.0;\n const shadowVolume = array[startingIndex++] === 1.0;\n const offsetAttribute = array[startingIndex++];\n const arcType = array[startingIndex++];\n const textureCoordinates =\n array[startingIndex] === -1.0\n ? undefined\n : PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian2\n );\n if (defined(textureCoordinates)) {\n startingIndex = textureCoordinates.startingIndex;\n delete textureCoordinates.startingIndex;\n } else {\n startingIndex++;\n }\n const packedLength = array[startingIndex++];\n\n if (!defined(result)) {\n result = new PolygonGeometry(dummyOptions);\n }\n\n result._polygonHierarchy = polygonHierarchy;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._height = height;\n result._extrudedHeight = extrudedHeight;\n result._granularity = granularity;\n result._stRotation = stRotation;\n result._perPositionHeightExtrude = perPositionHeightExtrude;\n result._perPositionHeight = perPositionHeight;\n result._closeTop = closeTop;\n result._closeBottom = closeBottom;\n result._shadowVolume = shadowVolume;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n result._arcType = arcType;\n result._textureCoordinates = textureCoordinates;\n result.packedLength = packedLength;\n\n return result;\n};\n\n/**\n * Returns the bounding rectangle given the provided options\n *\n * @param {Object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle\n */\nPolygonGeometry.computeRectangle = function (options, result) {\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n const polygonHierarchy = options.polygonHierarchy;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n return computeRectangle(\n polygonHierarchy.positions,\n ellipsoid,\n arcType,\n granularity,\n result\n );\n};\n\n/**\n * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolygonGeometry} polygonGeometry A description of the polygon.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolygonGeometry.createGeometry = function (polygonGeometry) {\n const vertexFormat = polygonGeometry._vertexFormat;\n const ellipsoid = polygonGeometry._ellipsoid;\n const granularity = polygonGeometry._granularity;\n const stRotation = polygonGeometry._stRotation;\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\n const perPositionHeight = polygonGeometry._perPositionHeight;\n const closeTop = polygonGeometry._closeTop;\n const closeBottom = polygonGeometry._closeBottom;\n const arcType = polygonGeometry._arcType;\n const textureCoordinates = polygonGeometry._textureCoordinates;\n\n const hasTextureCoordinates = defined(textureCoordinates);\n\n let outerPositions = polygonHierarchy.positions;\n if (outerPositions.length < 3) {\n return;\n }\n\n const tangentPlane = EllipsoidTangentPlane.fromPoints(\n outerPositions,\n ellipsoid\n );\n\n const results = PolygonGeometryLibrary.polygonsFromHierarchy(\n polygonHierarchy,\n hasTextureCoordinates,\n tangentPlane.projectPointsOntoPlane.bind(tangentPlane),\n !perPositionHeight,\n ellipsoid\n );\n\n const hierarchy = results.hierarchy;\n const polygons = results.polygons;\n\n const dummyFunction = function (identity) {\n return identity;\n };\n\n const textureCoordinatePolygons = hasTextureCoordinates\n ? PolygonGeometryLibrary.polygonsFromHierarchy(\n textureCoordinates,\n true,\n dummyFunction,\n false\n ).polygons\n : undefined;\n\n if (hierarchy.length === 0) {\n return;\n }\n\n outerPositions = hierarchy[0].outerRing;\n const boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(\n tangentPlane.plane.normal,\n tangentPlane.projectPointOntoPlane.bind(tangentPlane),\n outerPositions,\n stRotation,\n scratchBoundingRectangle\n );\n\n const geometries = [];\n\n const height = polygonGeometry._height;\n const extrudedHeight = polygonGeometry._extrudedHeight;\n const extrude =\n polygonGeometry._perPositionHeightExtrude ||\n !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\n\n const options = {\n perPositionHeight: perPositionHeight,\n vertexFormat: vertexFormat,\n geometry: undefined,\n tangentPlane: tangentPlane,\n boundingRectangle: boundingRectangle,\n ellipsoid: ellipsoid,\n stRotation: stRotation,\n textureCoordinates: undefined,\n bottom: false,\n top: true,\n wall: false,\n extrude: false,\n arcType: arcType,\n };\n\n let i;\n\n if (extrude) {\n options.extrude = true;\n options.top = closeTop;\n options.bottom = closeBottom;\n options.shadowVolume = polygonGeometry._shadowVolume;\n options.offsetAttribute = polygonGeometry._offsetAttribute;\n for (i = 0; i < polygons.length; i++) {\n const splitGeometry = createGeometryFromPositionsExtruded(\n ellipsoid,\n polygons[i],\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n granularity,\n hierarchy[i],\n perPositionHeight,\n closeTop,\n closeBottom,\n vertexFormat,\n arcType\n );\n\n let topAndBottom;\n if (closeTop && closeBottom) {\n topAndBottom = splitGeometry.topAndBottom;\n options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n topAndBottom.geometry,\n height,\n extrudedHeight,\n ellipsoid,\n perPositionHeight\n );\n } else if (closeTop) {\n topAndBottom = splitGeometry.topAndBottom;\n topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n topAndBottom.geometry.attributes.position.values,\n height,\n ellipsoid,\n !perPositionHeight\n );\n options.geometry = topAndBottom.geometry;\n } else if (closeBottom) {\n topAndBottom = splitGeometry.topAndBottom;\n topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n topAndBottom.geometry.attributes.position.values,\n extrudedHeight,\n ellipsoid,\n true\n );\n options.geometry = topAndBottom.geometry;\n }\n if (closeTop || closeBottom) {\n options.wall = false;\n topAndBottom.geometry = computeAttributes(options);\n geometries.push(topAndBottom);\n }\n\n const walls = splitGeometry.walls;\n options.wall = true;\n for (let k = 0; k < walls.length; k++) {\n const wall = walls[k];\n options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n wall.geometry,\n height,\n extrudedHeight,\n ellipsoid,\n perPositionHeight\n );\n wall.geometry = computeAttributes(options);\n geometries.push(wall);\n }\n }\n } else {\n for (i = 0; i < polygons.length; i++) {\n const geometryInstance = new GeometryInstance({\n geometry: PolygonGeometryLibrary.createGeometryFromPositions(\n ellipsoid,\n polygons[i],\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\n granularity,\n perPositionHeight,\n vertexFormat,\n arcType\n ),\n });\n geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n geometryInstance.geometry.attributes.position.values,\n height,\n ellipsoid,\n !perPositionHeight\n );\n options.geometry = geometryInstance.geometry;\n\n geometryInstance.geometry = computeAttributes(options);\n\n if (defined(polygonGeometry._offsetAttribute)) {\n const length =\n geometryInstance.geometry.attributes.position.values.length;\n const offsetValue =\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n {\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n }\n );\n }\n\n geometries.push(geometryInstance);\n }\n }\n\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\n geometry.attributes.position.values = new Float64Array(\n geometry.attributes.position.values\n );\n geometry.indices = IndexDatatype.createTypedArray(\n geometry.attributes.position.values.length / 3,\n geometry.indices\n );\n\n const attributes = geometry.attributes;\n const boundingSphere = BoundingSphere.fromVertices(\n attributes.position.values\n );\n\n if (!vertexFormat.position) {\n delete attributes.position;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: geometry.indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: boundingSphere,\n offsetAttribute: polygonGeometry._offsetAttribute,\n });\n};\n\n/**\n * @private\n */\nPolygonGeometry.createShadowVolume = function (\n polygonGeometry,\n minHeightFunc,\n maxHeightFunc\n) {\n const granularity = polygonGeometry._granularity;\n const ellipsoid = polygonGeometry._ellipsoid;\n\n const minHeight = minHeightFunc(granularity, ellipsoid);\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n return new PolygonGeometry({\n polygonHierarchy: polygonGeometry._polygonHierarchy,\n ellipsoid: ellipsoid,\n stRotation: polygonGeometry._stRotation,\n granularity: granularity,\n perPositionHeight: false,\n extrudedHeight: minHeight,\n height: maxHeight,\n vertexFormat: VertexFormat.POSITION_ONLY,\n shadowVolume: true,\n arcType: polygonGeometry._arcType,\n });\n};\n\nfunction textureCoordinateRotationPoints(polygonGeometry) {\n const stRotation = -polygonGeometry._stRotation;\n if (stRotation === 0.0) {\n return [0, 0, 0, 1, 1, 0];\n }\n const ellipsoid = polygonGeometry._ellipsoid;\n const positions = polygonGeometry._polygonHierarchy.positions;\n const boundingRectangle = polygonGeometry.rectangle;\n return Geometry._textureCoordinateRotationPoints(\n positions,\n stRotation,\n ellipsoid,\n boundingRectangle\n );\n}\n\nObject.defineProperties(PolygonGeometry.prototype, {\n /**\n * @private\n */\n rectangle: {\n get: function () {\n if (!defined(this._rectangle)) {\n const positions = this._polygonHierarchy.positions;\n this._rectangle = computeRectangle(\n positions,\n this._ellipsoid,\n this._arcType,\n this._granularity\n );\n }\n\n return this._rectangle;\n },\n },\n /**\n * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.\n * @private\n */\n textureCoordinateRotationPoints: {\n get: function () {\n if (!defined(this._textureCoordinateRotationPoints)) {\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n this\n );\n }\n return this._textureCoordinateRotationPoints;\n },\n },\n});\nexport default PolygonGeometry;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\nconst createGeometryFromPositionsPositions = [];\nconst createGeometryFromPositionsSubdivided = [];\n\nfunction createGeometryFromPositions(\n ellipsoid,\n positions,\n minDistance,\n perPositionHeight,\n arcType\n) {\n const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n const positions2D = tangentPlane.projectPointsOntoPlane(\n positions,\n createGeometryFromPositionsPositions\n );\n\n const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n positions2D\n );\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n positions2D.reverse();\n positions = positions.slice().reverse();\n }\n\n let subdividedPositions;\n let i;\n\n let length = positions.length;\n let index = 0;\n\n if (!perPositionHeight) {\n let numVertices = 0;\n if (arcType === ArcType.GEODESIC) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n } else if (arcType === ArcType.RHUMB) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n ellipsoid,\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n }\n subdividedPositions = new Float64Array(numVertices * 3);\n for (i = 0; i < length; i++) {\n let tempPositions;\n if (arcType === ArcType.GEODESIC) {\n tempPositions = PolygonGeometryLibrary.subdivideLine(\n positions[i],\n positions[(i + 1) % length],\n minDistance,\n createGeometryFromPositionsSubdivided\n );\n } else if (arcType === ArcType.RHUMB) {\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n ellipsoid,\n positions[i],\n positions[(i + 1) % length],\n minDistance,\n createGeometryFromPositionsSubdivided\n );\n }\n const tempPositionsLength = tempPositions.length;\n for (let j = 0; j < tempPositionsLength; ++j) {\n subdividedPositions[index++] = tempPositions[j];\n }\n }\n } else {\n subdividedPositions = new Float64Array(length * 2 * 3);\n for (i = 0; i < length; i++) {\n const p0 = positions[i];\n const p1 = positions[(i + 1) % length];\n subdividedPositions[index++] = p0.x;\n subdividedPositions[index++] = p0.y;\n subdividedPositions[index++] = p0.z;\n subdividedPositions[index++] = p1.x;\n subdividedPositions[index++] = p1.y;\n subdividedPositions[index++] = p1.z;\n }\n }\n\n length = subdividedPositions.length / 3;\n const indicesSize = length * 2;\n const indices = IndexDatatype.createTypedArray(length, indicesSize);\n index = 0;\n for (i = 0; i < length - 1; i++) {\n indices[index++] = i;\n indices[index++] = i + 1;\n }\n indices[index++] = length - 1;\n indices[index++] = 0;\n\n return new GeometryInstance({\n geometry: new Geometry({\n attributes: new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: subdividedPositions,\n }),\n }),\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n }),\n });\n}\n\nfunction createGeometryFromPositionsExtruded(\n ellipsoid,\n positions,\n minDistance,\n perPositionHeight,\n arcType\n) {\n const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n const positions2D = tangentPlane.projectPointsOntoPlane(\n positions,\n createGeometryFromPositionsPositions\n );\n\n const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\n positions2D\n );\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\n positions2D.reverse();\n positions = positions.slice().reverse();\n }\n\n let subdividedPositions;\n let i;\n\n let length = positions.length;\n const corners = new Array(length);\n let index = 0;\n\n if (!perPositionHeight) {\n let numVertices = 0;\n if (arcType === ArcType.GEODESIC) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n } else if (arcType === ArcType.RHUMB) {\n for (i = 0; i < length; i++) {\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\n ellipsoid,\n positions[i],\n positions[(i + 1) % length],\n minDistance\n );\n }\n }\n\n subdividedPositions = new Float64Array(numVertices * 3 * 2);\n for (i = 0; i < length; ++i) {\n corners[i] = index / 3;\n let tempPositions;\n if (arcType === ArcType.GEODESIC) {\n tempPositions = PolygonGeometryLibrary.subdivideLine(\n positions[i],\n positions[(i + 1) % length],\n minDistance,\n createGeometryFromPositionsSubdivided\n );\n } else if (arcType === ArcType.RHUMB) {\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\n ellipsoid,\n positions[i],\n positions[(i + 1) % length],\n minDistance,\n createGeometryFromPositionsSubdivided\n );\n }\n const tempPositionsLength = tempPositions.length;\n for (let j = 0; j < tempPositionsLength; ++j) {\n subdividedPositions[index++] = tempPositions[j];\n }\n }\n } else {\n subdividedPositions = new Float64Array(length * 2 * 3 * 2);\n for (i = 0; i < length; ++i) {\n corners[i] = index / 3;\n const p0 = positions[i];\n const p1 = positions[(i + 1) % length];\n\n subdividedPositions[index++] = p0.x;\n subdividedPositions[index++] = p0.y;\n subdividedPositions[index++] = p0.z;\n subdividedPositions[index++] = p1.x;\n subdividedPositions[index++] = p1.y;\n subdividedPositions[index++] = p1.z;\n }\n }\n\n length = subdividedPositions.length / (3 * 2);\n const cornersLength = corners.length;\n\n const indicesSize = (length * 2 + cornersLength) * 2;\n const indices = IndexDatatype.createTypedArray(\n length + cornersLength,\n indicesSize\n );\n\n index = 0;\n for (i = 0; i < length; ++i) {\n indices[index++] = i;\n indices[index++] = (i + 1) % length;\n indices[index++] = i + length;\n indices[index++] = ((i + 1) % length) + length;\n }\n\n for (i = 0; i < cornersLength; i++) {\n const corner = corners[i];\n indices[index++] = corner;\n indices[index++] = corner + length;\n }\n\n return new GeometryInstance({\n geometry: new Geometry({\n attributes: new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: subdividedPositions,\n }),\n }),\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n }),\n });\n}\n\n/**\n * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.\n *\n * @alias PolygonOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\n * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\n * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\n *\n * @see PolygonOutlineGeometry#createGeometry\n * @see PolygonOutlineGeometry#fromPositions\n *\n * @example\n * // 1. create a polygon outline from points\n * const polygon = new Cesium.PolygonOutlineGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * )\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\n *\n * // 2. create a nested polygon with holes outline\n * const polygonWithHole = new Cesium.PolygonOutlineGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -109.0, 30.0,\n * -95.0, 30.0,\n * -95.0, 40.0,\n * -109.0, 40.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -107.0, 31.0,\n * -107.0, 39.0,\n * -97.0, 39.0,\n * -97.0, 31.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -105.0, 33.0,\n * -99.0, 33.0,\n * -99.0, 37.0,\n * -105.0, 37.0\n * ]),\n * [new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -103.0, 34.0,\n * -101.0, 34.0,\n * -101.0, 36.0,\n * -103.0, 36.0\n * ])\n * )]\n * )]\n * )]\n * )\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);\n *\n * // 3. create extruded polygon outline\n * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({\n * polygonHierarchy : new Cesium.PolygonHierarchy(\n * Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * ),\n * extrudedHeight: 300000\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);\n */\nfunction PolygonOutlineGeometry(options) {\n const polygonHierarchy = options.polygonHierarchy;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const perPositionHeight = defaultValue(options.perPositionHeight, false);\n const perPositionHeightExtrude =\n perPositionHeight && defined(options.extrudedHeight);\n const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n\n let height = defaultValue(options.height, 0.0);\n let extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n if (!perPositionHeightExtrude) {\n const h = Math.max(height, extrudedHeight);\n extrudedHeight = Math.min(height, extrudedHeight);\n height = h;\n }\n\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._granularity = granularity;\n this._height = height;\n this._extrudedHeight = extrudedHeight;\n this._arcType = arcType;\n this._polygonHierarchy = polygonHierarchy;\n this._perPositionHeight = perPositionHeight;\n this._perPositionHeightExtrude = perPositionHeightExtrude;\n this._offsetAttribute = options.offsetAttribute;\n this._workerName = \"createPolygonOutlineGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n PolygonGeometryLibrary.computeHierarchyPackedLength(\n polygonHierarchy,\n Cartesian3\n ) +\n Ellipsoid.packedLength +\n 8;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolygonOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\n value._polygonHierarchy,\n array,\n startingIndex,\n Cartesian3\n );\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._height;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\n array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\n array[startingIndex++] = value._arcType;\n array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\n array[startingIndex] = value.packedLength;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst dummyOptions = {\n polygonHierarchy: {},\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolygonOutlineGeometry} [result] The object into which to store the result.\n * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.\n */\nPolygonOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\n array,\n startingIndex,\n Cartesian3\n );\n startingIndex = polygonHierarchy.startingIndex;\n delete polygonHierarchy.startingIndex;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const height = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const granularity = array[startingIndex++];\n const perPositionHeightExtrude = array[startingIndex++] === 1.0;\n const perPositionHeight = array[startingIndex++] === 1.0;\n const arcType = array[startingIndex++];\n const offsetAttribute = array[startingIndex++];\n const packedLength = array[startingIndex];\n\n if (!defined(result)) {\n result = new PolygonOutlineGeometry(dummyOptions);\n }\n\n result._polygonHierarchy = polygonHierarchy;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._height = height;\n result._extrudedHeight = extrudedHeight;\n result._granularity = granularity;\n result._perPositionHeight = perPositionHeight;\n result._perPositionHeightExtrude = perPositionHeightExtrude;\n result._arcType = arcType;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n result.packedLength = packedLength;\n\n return result;\n};\n\n/**\n * A description of a polygon outline from an array of positions.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\n * @param {Number} [options.height=0.0] The height of the polygon.\n * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.\n * @returns {PolygonOutlineGeometry}\n *\n *\n * @example\n * // create a polygon from points\n * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0,\n * -75.0, 30.0,\n * -70.0, 30.0,\n * -68.0, 40.0\n * ])\n * });\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\n *\n * @see PolygonOutlineGeometry#createGeometry\n */\nPolygonOutlineGeometry.fromPositions = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const newOptions = {\n polygonHierarchy: {\n positions: options.positions,\n },\n height: options.height,\n extrudedHeight: options.extrudedHeight,\n ellipsoid: options.ellipsoid,\n granularity: options.granularity,\n perPositionHeight: options.perPositionHeight,\n arcType: options.arcType,\n offsetAttribute: options.offsetAttribute,\n };\n return new PolygonOutlineGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolygonOutlineGeometry} polygonGeometry A description of the polygon outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\n const ellipsoid = polygonGeometry._ellipsoid;\n const granularity = polygonGeometry._granularity;\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\n const perPositionHeight = polygonGeometry._perPositionHeight;\n const arcType = polygonGeometry._arcType;\n\n const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\n polygonHierarchy,\n !perPositionHeight,\n ellipsoid\n );\n\n if (polygons.length === 0) {\n return undefined;\n }\n\n let geometryInstance;\n const geometries = [];\n const minDistance = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n\n const height = polygonGeometry._height;\n const extrudedHeight = polygonGeometry._extrudedHeight;\n const extrude =\n polygonGeometry._perPositionHeightExtrude ||\n !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\n let offsetValue;\n let i;\n if (extrude) {\n for (i = 0; i < polygons.length; i++) {\n geometryInstance = createGeometryFromPositionsExtruded(\n ellipsoid,\n polygons[i],\n minDistance,\n perPositionHeight,\n arcType\n );\n geometryInstance.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\n geometryInstance.geometry,\n height,\n extrudedHeight,\n ellipsoid,\n perPositionHeight\n );\n if (defined(polygonGeometry._offsetAttribute)) {\n const size =\n geometryInstance.geometry.attributes.position.values.length / 3;\n let offsetAttribute = new Uint8Array(size);\n if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else {\n offsetValue =\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n {\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n }\n );\n }\n geometries.push(geometryInstance);\n }\n } else {\n for (i = 0; i < polygons.length; i++) {\n geometryInstance = createGeometryFromPositions(\n ellipsoid,\n polygons[i],\n minDistance,\n perPositionHeight,\n arcType\n );\n geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n geometryInstance.geometry.attributes.position.values,\n height,\n ellipsoid,\n !perPositionHeight\n );\n\n if (defined(polygonGeometry._offsetAttribute)) {\n const length =\n geometryInstance.geometry.attributes.position.values.length;\n offsetValue =\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\n {\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n }\n );\n }\n\n geometries.push(geometryInstance);\n }\n }\n\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\n const boundingSphere = BoundingSphere.fromVertices(\n geometry.attributes.position.values\n );\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: boundingSphere,\n offsetAttribute: polygonGeometry._offsetAttribute,\n });\n};\nexport default PolygonOutlineGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport ArcType from \"../Core/ArcType.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport CoplanarPolygonGeometry from \"../Core/CoplanarPolygonGeometry.js\";\nimport CoplanarPolygonOutlineGeometry from \"../Core/CoplanarPolygonOutlineGeometry.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport EllipsoidTangentPlane from \"../Core/EllipsoidTangentPlane.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PolygonGeometry from \"../Core/PolygonGeometry.js\";\nimport PolygonOutlineGeometry from \"../Core/PolygonOutlineGeometry.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst heightAndPerPositionHeightWarning =\n \"Entity polygons cannot have both height and perPositionHeight. height will be ignored\";\nconst heightReferenceAndPerPositionHeightWarning =\n \"heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratch2DPositions = [];\nconst cart2Scratch = new Cartesian2();\n\nfunction PolygonGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.polygonHierarchy = undefined;\n this.perPositionHeight = undefined;\n this.closeTop = undefined;\n this.closeBottom = undefined;\n this.height = undefined;\n this.extrudedHeight = undefined;\n this.granularity = undefined;\n this.stRotation = undefined;\n this.offsetAttribute = undefined;\n this.arcType = undefined;\n this.textureCoordinates = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polygons.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolygonGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolygonGeometryUpdater(entity, scene) {\n GroundGeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new PolygonGeometryOptions(entity),\n geometryPropertyName: \"polygon\",\n observedPropertyNames: [\"availability\", \"polygon\"],\n });\n\n this._onEntityPropertyChanged(entity, \"polygon\", entity.polygon, undefined);\n}\n\nif (defined(Object.create)) {\n PolygonGeometryUpdater.prototype = Object.create(\n GroundGeometryUpdater.prototype\n );\n PolygonGeometryUpdater.prototype.constructor = PolygonGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolygonGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const options = this._options;\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n ),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n this._distanceDisplayConditionProperty.getValue(time)\n ),\n offset: undefined,\n color: undefined,\n };\n\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n if (defined(options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n let geometry;\n if (options.perPositionHeight && !defined(options.extrudedHeight)) {\n geometry = new CoplanarPolygonGeometry(options);\n } else {\n geometry = new PolygonGeometry(options);\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: geometry,\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const options = this._options;\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n\n if (defined(options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n let geometry;\n if (options.perPositionHeight && !defined(options.extrudedHeight)) {\n geometry = new CoplanarPolygonOutlineGeometry(options);\n } else {\n geometry = new PolygonOutlineGeometry(options);\n }\n return new GeometryInstance({\n id: entity,\n geometry: geometry,\n attributes: attributes,\n });\n};\n\nPolygonGeometryUpdater.prototype._computeCenter = function (time, result) {\n const hierarchy = Property.getValueOrUndefined(\n this._entity.polygon.hierarchy,\n time\n );\n if (!defined(hierarchy)) {\n return;\n }\n const positions = hierarchy.positions;\n if (positions.length === 0) {\n return;\n }\n const ellipsoid = this._scene.mapProjection.ellipsoid;\n\n const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\n const positions2D = tangentPlane.projectPointsOntoPlane(\n positions,\n scratch2DPositions\n );\n\n const length = positions2D.length;\n let area = 0;\n let j = length - 1;\n let centroid2D = new Cartesian2();\n for (let i = 0; i < length; j = i++) {\n const p1 = positions2D[i];\n const p2 = positions2D[j];\n const f = p1.x * p2.y - p2.x * p1.y;\n\n let sum = Cartesian2.add(p1, p2, cart2Scratch);\n sum = Cartesian2.multiplyByScalar(sum, f, sum);\n centroid2D = Cartesian2.add(centroid2D, sum, centroid2D);\n\n area += f;\n }\n\n const a = 1.0 / (area * 3.0);\n centroid2D = Cartesian2.multiplyByScalar(centroid2D, a, centroid2D);\n return tangentPlane.projectPointOntoEllipsoid(centroid2D, result);\n};\n\nPolygonGeometryUpdater.prototype._isHidden = function (entity, polygon) {\n return (\n !defined(polygon.hierarchy) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, polygon)\n );\n};\n\nPolygonGeometryUpdater.prototype._isOnTerrain = function (entity, polygon) {\n const onTerrain = GroundGeometryUpdater.prototype._isOnTerrain.call(\n this,\n entity,\n polygon\n );\n const perPositionHeightProperty = polygon.perPositionHeight;\n const perPositionHeightEnabled =\n defined(perPositionHeightProperty) &&\n (perPositionHeightProperty.isConstant\n ? perPositionHeightProperty.getValue(Iso8601.MINIMUM_VALUE)\n : true);\n return onTerrain && !perPositionHeightEnabled;\n};\n\nPolygonGeometryUpdater.prototype._isDynamic = function (entity, polygon) {\n return (\n !polygon.hierarchy.isConstant || //\n !Property.isConstant(polygon.height) || //\n !Property.isConstant(polygon.extrudedHeight) || //\n !Property.isConstant(polygon.granularity) || //\n !Property.isConstant(polygon.stRotation) || //\n !Property.isConstant(polygon.textureCoordinates) || //\n !Property.isConstant(polygon.outlineWidth) || //\n !Property.isConstant(polygon.perPositionHeight) || //\n !Property.isConstant(polygon.closeTop) || //\n !Property.isConstant(polygon.closeBottom) || //\n !Property.isConstant(polygon.zIndex) || //\n !Property.isConstant(polygon.arcType) || //\n (this._onTerrain &&\n !Property.isConstant(this._materialProperty) &&\n !(this._materialProperty instanceof ColorMaterialProperty))\n );\n};\n\nPolygonGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n polygon\n) {\n const isColorMaterial =\n this._materialProperty instanceof ColorMaterialProperty;\n\n const options = this._options;\n options.vertexFormat = isColorMaterial\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n\n const hierarchyValue = polygon.hierarchy.getValue(Iso8601.MINIMUM_VALUE);\n let heightValue = Property.getValueOrUndefined(\n polygon.height,\n Iso8601.MINIMUM_VALUE\n );\n const heightReferenceValue = Property.getValueOrDefault(\n polygon.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n polygon.extrudedHeight,\n Iso8601.MINIMUM_VALUE\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n polygon.extrudedHeightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n const perPositionHeightValue = Property.getValueOrDefault(\n polygon.perPositionHeight,\n Iso8601.MINIMUM_VALUE,\n false\n );\n\n heightValue = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n let offsetAttribute;\n if (perPositionHeightValue) {\n if (defined(heightValue)) {\n heightValue = undefined;\n oneTimeWarning(heightAndPerPositionHeightWarning);\n }\n if (\n heightReferenceValue !== HeightReference.NONE &&\n perPositionHeightValue\n ) {\n heightValue = undefined;\n oneTimeWarning(heightReferenceAndPerPositionHeightWarning);\n }\n } else {\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n }\n\n options.polygonHierarchy = hierarchyValue;\n options.granularity = Property.getValueOrUndefined(\n polygon.granularity,\n Iso8601.MINIMUM_VALUE\n );\n options.stRotation = Property.getValueOrUndefined(\n polygon.stRotation,\n Iso8601.MINIMUM_VALUE\n );\n options.perPositionHeight = perPositionHeightValue;\n options.closeTop = Property.getValueOrDefault(\n polygon.closeTop,\n Iso8601.MINIMUM_VALUE,\n true\n );\n options.closeBottom = Property.getValueOrDefault(\n polygon.closeBottom,\n Iso8601.MINIMUM_VALUE,\n true\n );\n options.offsetAttribute = offsetAttribute;\n options.height = heightValue;\n options.arcType = Property.getValueOrDefault(\n polygon.arcType,\n Iso8601.MINIMUM_VALUE,\n ArcType.GEODESIC\n );\n options.textureCoordinates = Property.getValueOrUndefined(\n polygon.textureCoordinates,\n Iso8601.MINIMUM_VALUE\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n PolygonGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\n\nPolygonGeometryUpdater.prototype._getIsClosed = function (options) {\n const height = options.height;\n const extrudedHeight = options.extrudedHeight;\n const isExtruded = defined(extrudedHeight) && extrudedHeight !== height;\n return (\n !options.perPositionHeight &&\n ((!isExtruded && height === 0) ||\n (isExtruded && options.closeTop && options.closeBottom))\n );\n};\n\nPolygonGeometryUpdater.DynamicGeometryUpdater = DyanmicPolygonGeometryUpdater;\n\n/**\n * @private\n */\nfunction DyanmicPolygonGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DyanmicPolygonGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DyanmicPolygonGeometryUpdater.prototype.constructor = DyanmicPolygonGeometryUpdater;\n}\n\nDyanmicPolygonGeometryUpdater.prototype._isHidden = function (\n entity,\n polygon,\n time\n) {\n return (\n !defined(this._options.polygonHierarchy) ||\n DynamicGeometryUpdater.prototype._isHidden.call(this, entity, polygon, time)\n );\n};\n\nDyanmicPolygonGeometryUpdater.prototype._setOptions = function (\n entity,\n polygon,\n time\n) {\n const options = this._options;\n\n options.polygonHierarchy = Property.getValueOrUndefined(\n polygon.hierarchy,\n time\n );\n\n let heightValue = Property.getValueOrUndefined(polygon.height, time);\n const heightReferenceValue = Property.getValueOrDefault(\n polygon.heightReference,\n time,\n HeightReference.NONE\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n polygon.extrudedHeightReference,\n time,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n polygon.extrudedHeight,\n time\n );\n const perPositionHeightValue = Property.getValueOrUndefined(\n polygon.perPositionHeight,\n time\n );\n\n heightValue = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n extrudedHeightReferenceValue\n );\n\n let offsetAttribute;\n if (perPositionHeightValue) {\n if (defined(heightValue)) {\n heightValue = undefined;\n oneTimeWarning(heightAndPerPositionHeightWarning);\n }\n if (\n heightReferenceValue !== HeightReference.NONE &&\n perPositionHeightValue\n ) {\n heightValue = undefined;\n oneTimeWarning(heightReferenceAndPerPositionHeightWarning);\n }\n } else {\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n }\n\n options.granularity = Property.getValueOrUndefined(polygon.granularity, time);\n options.stRotation = Property.getValueOrUndefined(polygon.stRotation, time);\n options.textureCoordinates = Property.getValueOrUndefined(\n polygon.textureCoordinates,\n time\n );\n options.perPositionHeight = Property.getValueOrUndefined(\n polygon.perPositionHeight,\n time\n );\n options.closeTop = Property.getValueOrDefault(polygon.closeTop, time, true);\n options.closeBottom = Property.getValueOrDefault(\n polygon.closeBottom,\n time,\n true\n );\n options.offsetAttribute = offsetAttribute;\n options.height = heightValue;\n options.arcType = Property.getValueOrDefault(\n polygon.arcType,\n time,\n ArcType.GEODESIC\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n PolygonGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\nexport default PolygonGeometryUpdater;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport oneTimeWarning from \"./oneTimeWarning.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nfunction computeAttributes(\n combinedPositions,\n shape,\n boundingRectangle,\n vertexFormat\n) {\n const attributes = new GeometryAttributes();\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: combinedPositions,\n });\n }\n const shapeLength = shape.length;\n const vertexCount = combinedPositions.length / 3;\n const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);\n const firstEndIndices = PolygonPipeline.triangulate(shape);\n\n const indicesCount =\n (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;\n const indices = IndexDatatype.createTypedArray(vertexCount, indicesCount);\n let i, j;\n let ll, ul, ur, lr;\n const offset = shapeLength * 2;\n let index = 0;\n for (i = 0; i < length - 1; i++) {\n for (j = 0; j < shapeLength - 1; j++) {\n ll = j * 2 + i * shapeLength * 2;\n lr = ll + offset;\n ul = ll + 1;\n ur = ul + offset;\n\n indices[index++] = ul;\n indices[index++] = ll;\n indices[index++] = ur;\n indices[index++] = ur;\n indices[index++] = ll;\n indices[index++] = lr;\n }\n ll = shapeLength * 2 - 2 + i * shapeLength * 2;\n ul = ll + 1;\n ur = ul + offset;\n lr = ll + offset;\n\n indices[index++] = ul;\n indices[index++] = ll;\n indices[index++] = ur;\n indices[index++] = ur;\n indices[index++] = ll;\n indices[index++] = lr;\n }\n\n if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {\n // st required for tangent/bitangent calculation\n const st = new Float32Array(vertexCount * 2);\n const lengthSt = 1 / (length - 1);\n const heightSt = 1 / boundingRectangle.height;\n const heightOffset = boundingRectangle.height / 2;\n let s, t;\n let stindex = 0;\n for (i = 0; i < length; i++) {\n s = i * lengthSt;\n t = heightSt * (shape[0].y + heightOffset);\n st[stindex++] = s;\n st[stindex++] = t;\n for (j = 1; j < shapeLength; j++) {\n t = heightSt * (shape[j].y + heightOffset);\n st[stindex++] = s;\n st[stindex++] = t;\n st[stindex++] = s;\n st[stindex++] = t;\n }\n t = heightSt * (shape[0].y + heightOffset);\n st[stindex++] = s;\n st[stindex++] = t;\n }\n for (j = 0; j < shapeLength; j++) {\n s = 0;\n t = heightSt * (shape[j].y + heightOffset);\n st[stindex++] = s;\n st[stindex++] = t;\n }\n for (j = 0; j < shapeLength; j++) {\n s = (length - 1) * lengthSt;\n t = heightSt * (shape[j].y + heightOffset);\n st[stindex++] = s;\n st[stindex++] = t;\n }\n\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: new Float32Array(st),\n });\n }\n\n const endOffset = vertexCount - shapeLength * 2;\n for (i = 0; i < firstEndIndices.length; i += 3) {\n const v0 = firstEndIndices[i] + endOffset;\n const v1 = firstEndIndices[i + 1] + endOffset;\n const v2 = firstEndIndices[i + 2] + endOffset;\n\n indices[index++] = v0;\n indices[index++] = v1;\n indices[index++] = v2;\n indices[index++] = v2 + shapeLength;\n indices[index++] = v1 + shapeLength;\n indices[index++] = v0 + shapeLength;\n }\n\n let geometry = new Geometry({\n attributes: attributes,\n indices: indices,\n boundingSphere: BoundingSphere.fromVertices(combinedPositions),\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n if (vertexFormat.normal) {\n geometry = GeometryPipeline.computeNormal(geometry);\n }\n\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n try {\n geometry = GeometryPipeline.computeTangentAndBitangent(geometry);\n } catch (e) {\n oneTimeWarning(\n \"polyline-volume-tangent-bitangent\",\n \"Unable to compute tangents and bitangents for polyline volume geometry\"\n );\n //TODO https://github.com/CesiumGS/cesium/issues/3609\n }\n\n if (!vertexFormat.tangent) {\n geometry.attributes.tangent = undefined;\n }\n if (!vertexFormat.bitangent) {\n geometry.attributes.bitangent = undefined;\n }\n if (!vertexFormat.st) {\n geometry.attributes.st = undefined;\n }\n }\n\n return geometry;\n}\n\n/**\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\n *\n * @alias PolylineVolumeGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.polylinePositions An array of {@link Cartesian3} positions that define the center of the polyline volume.\n * @param {Cartesian2[]} options.shapePositions An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see PolylineVolumeGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}\n *\n * @example\n * function computeCircle(radius) {\n * const positions = [];\n * for (let i = 0; i < 360; i++) {\n * const radians = Cesium.Math.toRadians(i);\n * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\n * }\n * return positions;\n * }\n *\n * const volume = new Cesium.PolylineVolumeGeometry({\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\n * polylinePositions : Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0\n * ]),\n * shapePositions : computeCircle(100000.0)\n * });\n */\nfunction PolylineVolumeGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.polylinePositions;\n const shape = options.shapePositions;\n\n this._positions = positions;\n this._shape = shape;\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n this._vertexFormat = VertexFormat.clone(\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n );\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._workerName = \"createPolylineVolumeGeometry\";\n\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\n numComponents += 1 + shape.length * Cartesian2.packedLength;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 2;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineVolumeGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPolylineVolumeGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const shape = value._shape;\n length = shape.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n Cartesian2.pack(shape[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._cornerType;\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n polylinePositions: undefined,\n shapePositions: undefined,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n cornerType: undefined,\n granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineVolumeGeometry} [result] The object into which to store the result.\n * @returns {PolylineVolumeGeometry} The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.\n */\nPolylineVolumeGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n const shape = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n shape[i] = Cartesian2.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const cornerType = array[startingIndex++];\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.polylinePositions = positions;\n scratchOptions.shapePositions = shape;\n scratchOptions.cornerType = cornerType;\n scratchOptions.granularity = granularity;\n return new PolylineVolumeGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._shape = shape;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._cornerType = cornerType;\n result._granularity = granularity;\n\n return result;\n};\n\nconst brScratch = new BoundingRectangle();\n\n/**\n * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineVolumeGeometry} polylineVolumeGeometry A description of the polyline volume.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) {\n const positions = polylineVolumeGeometry._positions;\n const cleanPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n let shape2D = polylineVolumeGeometry._shape;\n shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\n\n if (cleanPositions.length < 2 || shape2D.length < 3) {\n return undefined;\n }\n\n if (\n PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\n ) {\n shape2D.reverse();\n }\n const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\n\n const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\n cleanPositions,\n shape2D,\n boundingRectangle,\n polylineVolumeGeometry,\n true\n );\n return computeAttributes(\n computedPositions,\n shape2D,\n boundingRectangle,\n polylineVolumeGeometry._vertexFormat\n );\n};\nexport default PolylineVolumeGeometry;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingRectangle from \"./BoundingRectangle.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport CornerType from \"./CornerType.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WindingOrder from \"./WindingOrder.js\";\n\nfunction computeAttributes(positions, shape) {\n const attributes = new GeometryAttributes();\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n\n const shapeLength = shape.length;\n const vertexCount = attributes.position.values.length / 3;\n const positionLength = positions.length / 3;\n const shapeCount = positionLength / shapeLength;\n const indices = IndexDatatype.createTypedArray(\n vertexCount,\n 2 * shapeLength * (shapeCount + 1)\n );\n let i, j;\n let index = 0;\n i = 0;\n let offset = i * shapeLength;\n for (j = 0; j < shapeLength - 1; j++) {\n indices[index++] = j + offset;\n indices[index++] = j + offset + 1;\n }\n indices[index++] = shapeLength - 1 + offset;\n indices[index++] = offset;\n\n i = shapeCount - 1;\n offset = i * shapeLength;\n for (j = 0; j < shapeLength - 1; j++) {\n indices[index++] = j + offset;\n indices[index++] = j + offset + 1;\n }\n indices[index++] = shapeLength - 1 + offset;\n indices[index++] = offset;\n\n for (i = 0; i < shapeCount - 1; i++) {\n const firstOffset = shapeLength * i;\n const secondOffset = firstOffset + shapeLength;\n for (j = 0; j < shapeLength; j++) {\n indices[index++] = j + firstOffset;\n indices[index++] = j + secondOffset;\n }\n }\n\n const geometry = new Geometry({\n attributes: attributes,\n indices: IndexDatatype.createTypedArray(vertexCount, indices),\n boundingSphere: BoundingSphere.fromVertices(positions),\n primitiveType: PrimitiveType.LINES,\n });\n\n return geometry;\n}\n\n/**\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\n *\n * @alias PolylineVolumeOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.polylinePositions An array of positions that define the center of the polyline volume.\n * @param {Cartesian2[]} options.shapePositions An array of positions that define the shape to be extruded along the polyline\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\n *\n * @see PolylineVolumeOutlineGeometry#createGeometry\n *\n * @example\n * function computeCircle(radius) {\n * const positions = [];\n * for (let i = 0; i < 360; i++) {\n * const radians = Cesium.Math.toRadians(i);\n * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\n * }\n * return positions;\n * }\n *\n * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({\n * polylinePositions : Cesium.Cartesian3.fromDegreesArray([\n * -72.0, 40.0,\n * -70.0, 35.0\n * ]),\n * shapePositions : computeCircle(100000.0)\n * });\n */\nfunction PolylineVolumeOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.polylinePositions;\n const shape = options.shapePositions;\n\n this._positions = positions;\n this._shape = shape;\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._workerName = \"createPolylineVolumeOutlineGeometry\";\n\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\n numComponents += 1 + shape.length * Cartesian2.packedLength;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength = numComponents + Ellipsoid.packedLength + 2;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineVolumeOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPolylineVolumeOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const shape = value._shape;\n length = shape.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n Cartesian2.pack(shape[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._cornerType;\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n polylinePositions: undefined,\n shapePositions: undefined,\n ellipsoid: scratchEllipsoid,\n height: undefined,\n cornerType: undefined,\n granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineVolumeOutlineGeometry} [result] The object into which to store the result.\n * @returns {PolylineVolumeOutlineGeometry} The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.\n */\nPolylineVolumeOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n const shape = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\n shape[i] = Cartesian2.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const cornerType = array[startingIndex++];\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.polylinePositions = positions;\n scratchOptions.shapePositions = shape;\n scratchOptions.cornerType = cornerType;\n scratchOptions.granularity = granularity;\n return new PolylineVolumeOutlineGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._shape = shape;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._cornerType = cornerType;\n result._granularity = granularity;\n\n return result;\n};\n\nconst brScratch = new BoundingRectangle();\n\n/**\n * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineVolumeOutlineGeometry} polylineVolumeOutlineGeometry A description of the polyline volume outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineVolumeOutlineGeometry.createGeometry = function (\n polylineVolumeOutlineGeometry\n) {\n const positions = polylineVolumeOutlineGeometry._positions;\n const cleanPositions = arrayRemoveDuplicates(\n positions,\n Cartesian3.equalsEpsilon\n );\n let shape2D = polylineVolumeOutlineGeometry._shape;\n shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\n\n if (cleanPositions.length < 2 || shape2D.length < 3) {\n return undefined;\n }\n\n if (\n PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\n ) {\n shape2D.reverse();\n }\n const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\n\n const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\n cleanPositions,\n shape2D,\n boundingRectangle,\n polylineVolumeOutlineGeometry,\n false\n );\n return computeAttributes(computedPositions, shape2D);\n};\nexport default PolylineVolumeOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport PolylineVolumeGeometry from \"../Core/PolylineVolumeGeometry.js\";\nimport PolylineVolumeOutlineGeometry from \"../Core/PolylineVolumeOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\n\nfunction PolylineVolumeGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.polylinePositions = undefined;\n this.shapePositions = undefined;\n this.cornerType = undefined;\n this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polyline volumes.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolylineVolumeGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolylineVolumeGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new PolylineVolumeGeometryOptions(entity),\n geometryPropertyName: \"polylineVolume\",\n observedPropertyNames: [\"availability\", \"polylineVolume\"],\n });\n\n this._onEntityPropertyChanged(\n entity,\n \"polylineVolume\",\n entity.polylineVolume,\n undefined\n );\n}\n\nif (defined(Object.create)) {\n PolylineVolumeGeometryUpdater.prototype = Object.create(\n GeometryUpdater.prototype\n );\n PolylineVolumeGeometryUpdater.prototype.constructor = PolylineVolumeGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n let attributes;\n\n let color;\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: color,\n };\n } else {\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n };\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new PolylineVolumeGeometry(this._options),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n return new GeometryInstance({\n id: entity,\n geometry: new PolylineVolumeOutlineGeometry(this._options),\n attributes: {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n },\n });\n};\n\nPolylineVolumeGeometryUpdater.prototype._isHidden = function (\n entity,\n polylineVolume\n) {\n return (\n !defined(polylineVolume.positions) ||\n !defined(polylineVolume.shape) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, polylineVolume)\n );\n};\n\nPolylineVolumeGeometryUpdater.prototype._isDynamic = function (\n entity,\n polylineVolume\n) {\n return (\n !polylineVolume.positions.isConstant || //\n !polylineVolume.shape.isConstant || //\n !Property.isConstant(polylineVolume.granularity) || //\n !Property.isConstant(polylineVolume.outlineWidth) || //\n !Property.isConstant(polylineVolume.cornerType)\n );\n};\n\nPolylineVolumeGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n polylineVolume\n) {\n const granularity = polylineVolume.granularity;\n const cornerType = polylineVolume.cornerType;\n\n const options = this._options;\n const isColorMaterial =\n this._materialProperty instanceof ColorMaterialProperty;\n options.vertexFormat = isColorMaterial\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.polylinePositions = polylineVolume.positions.getValue(\n Iso8601.MINIMUM_VALUE,\n options.polylinePositions\n );\n options.shapePositions = polylineVolume.shape.getValue(\n Iso8601.MINIMUM_VALUE,\n options.shape\n );\n options.granularity = defined(granularity)\n ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n options.cornerType = defined(cornerType)\n ? cornerType.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n};\n\nPolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicPolylineVolumeGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicPolylineVolumeGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicPolylineVolumeGeometryUpdater.prototype.constructor = DynamicPolylineVolumeGeometryUpdater;\n}\n\nDynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function (\n entity,\n polylineVolume,\n time\n) {\n const options = this._options;\n return (\n !defined(options.polylinePositions) ||\n !defined(options.shapePositions) ||\n DynamicGeometryUpdater.prototype._isHidden.call(\n this,\n entity,\n polylineVolume,\n time\n )\n );\n};\n\nDynamicPolylineVolumeGeometryUpdater.prototype._setOptions = function (\n entity,\n polylineVolume,\n time\n) {\n const options = this._options;\n options.polylinePositions = Property.getValueOrUndefined(\n polylineVolume.positions,\n time,\n options.polylinePositions\n );\n options.shapePositions = Property.getValueOrUndefined(\n polylineVolume.shape,\n time\n );\n options.granularity = Property.getValueOrUndefined(\n polylineVolume.granularity,\n time\n );\n options.cornerType = Property.getValueOrUndefined(\n polylineVolume.cornerType,\n time\n );\n};\nexport default PolylineVolumeGeometryUpdater;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix2 from \"./Matrix2.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PolygonPipeline from \"./PolygonPipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst positionScratch = new Cartesian3();\nconst normalScratch = new Cartesian3();\nconst tangentScratch = new Cartesian3();\nconst bitangentScratch = new Cartesian3();\nconst rectangleScratch = new Rectangle();\nconst stScratch = new Cartesian2();\nconst bottomBoundingSphere = new BoundingSphere();\nconst topBoundingSphere = new BoundingSphere();\n\nfunction createAttributes(vertexFormat, attributes) {\n const geo = new Geometry({\n attributes: new GeometryAttributes(),\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n geo.attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: attributes.positions,\n });\n if (vertexFormat.normal) {\n geo.attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attributes.normals,\n });\n }\n if (vertexFormat.tangent) {\n geo.attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attributes.tangents,\n });\n }\n if (vertexFormat.bitangent) {\n geo.attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: attributes.bitangents,\n });\n }\n return geo;\n}\n\nfunction calculateAttributes(\n positions,\n vertexFormat,\n ellipsoid,\n tangentRotationMatrix\n) {\n const length = positions.length;\n\n const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\n const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(length)\n : undefined;\n\n let attrIndex = 0;\n const bitangent = bitangentScratch;\n const tangent = tangentScratch;\n let normal = normalScratch;\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n for (let i = 0; i < length; i += 3) {\n const p = Cartesian3.fromArray(positions, i, positionScratch);\n const attrIndex1 = attrIndex + 1;\n const attrIndex2 = attrIndex + 2;\n\n normal = ellipsoid.geodeticSurfaceNormal(p, normal);\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\n Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent);\n Cartesian3.normalize(tangent, tangent);\n\n if (vertexFormat.bitangent) {\n Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n }\n }\n\n if (vertexFormat.normal) {\n normals[attrIndex] = normal.x;\n normals[attrIndex1] = normal.y;\n normals[attrIndex2] = normal.z;\n }\n if (vertexFormat.tangent) {\n tangents[attrIndex] = tangent.x;\n tangents[attrIndex1] = tangent.y;\n tangents[attrIndex2] = tangent.z;\n }\n if (vertexFormat.bitangent) {\n bitangents[attrIndex] = bitangent.x;\n bitangents[attrIndex1] = bitangent.y;\n bitangents[attrIndex2] = bitangent.z;\n }\n attrIndex += 3;\n }\n }\n return createAttributes(vertexFormat, {\n positions: positions,\n normals: normals,\n tangents: tangents,\n bitangents: bitangents,\n });\n}\n\nconst v1Scratch = new Cartesian3();\nconst v2Scratch = new Cartesian3();\n\nfunction calculateAttributesWall(positions, vertexFormat, ellipsoid) {\n const length = positions.length;\n\n const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\n const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(length)\n : undefined;\n\n let normalIndex = 0;\n let tangentIndex = 0;\n let bitangentIndex = 0;\n let recomputeNormal = true;\n\n let bitangent = bitangentScratch;\n let tangent = tangentScratch;\n let normal = normalScratch;\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n for (let i = 0; i < length; i += 6) {\n const p = Cartesian3.fromArray(positions, i, positionScratch);\n const p1 = Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch);\n if (recomputeNormal) {\n const p2 = Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch);\n Cartesian3.subtract(p1, p, p1);\n Cartesian3.subtract(p2, p, p2);\n normal = Cartesian3.normalize(Cartesian3.cross(p2, p1, normal), normal);\n recomputeNormal = false;\n }\n\n if (Cartesian3.equalsEpsilon(p1, p, CesiumMath.EPSILON10)) {\n // if we've reached a corner\n recomputeNormal = true;\n }\n\n if (vertexFormat.tangent || vertexFormat.bitangent) {\n bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);\n if (vertexFormat.tangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.cross(bitangent, normal, tangent),\n tangent\n );\n }\n }\n\n if (vertexFormat.normal) {\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n }\n\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n }\n }\n }\n\n return createAttributes(vertexFormat, {\n positions: positions,\n normals: normals,\n tangents: tangents,\n bitangents: bitangents,\n });\n}\n\nfunction constructRectangle(rectangleGeometry, computedOptions) {\n const vertexFormat = rectangleGeometry._vertexFormat;\n const ellipsoid = rectangleGeometry._ellipsoid;\n const height = computedOptions.height;\n const width = computedOptions.width;\n const northCap = computedOptions.northCap;\n const southCap = computedOptions.southCap;\n\n let rowStart = 0;\n let rowEnd = height;\n let rowHeight = height;\n let size = 0;\n if (northCap) {\n rowStart = 1;\n rowHeight -= 1;\n size += 1;\n }\n if (southCap) {\n rowEnd -= 1;\n rowHeight -= 1;\n size += 1;\n }\n size += width * rowHeight;\n\n const positions = vertexFormat.position\n ? new Float64Array(size * 3)\n : undefined;\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(size * 2)\n : undefined;\n\n let posIndex = 0;\n let stIndex = 0;\n\n const position = positionScratch;\n const st = stScratch;\n\n let minX = Number.MAX_VALUE;\n let minY = Number.MAX_VALUE;\n let maxX = -Number.MAX_VALUE;\n let maxY = -Number.MAX_VALUE;\n\n for (let row = rowStart; row < rowEnd; ++row) {\n for (let col = 0; col < width; ++col) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n vertexFormat.st,\n row,\n col,\n position,\n st\n );\n\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n\n if (vertexFormat.st) {\n textureCoordinates[stIndex++] = st.x;\n textureCoordinates[stIndex++] = st.y;\n\n minX = Math.min(minX, st.x);\n minY = Math.min(minY, st.y);\n maxX = Math.max(maxX, st.x);\n maxY = Math.max(maxY, st.y);\n }\n }\n }\n if (northCap) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n vertexFormat.st,\n 0,\n 0,\n position,\n st\n );\n\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex++] = position.z;\n\n if (vertexFormat.st) {\n textureCoordinates[stIndex++] = st.x;\n textureCoordinates[stIndex++] = st.y;\n\n minX = st.x;\n minY = st.y;\n maxX = st.x;\n maxY = st.y;\n }\n }\n if (southCap) {\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n vertexFormat.st,\n height - 1,\n 0,\n position,\n st\n );\n\n positions[posIndex++] = position.x;\n positions[posIndex++] = position.y;\n positions[posIndex] = position.z;\n\n if (vertexFormat.st) {\n textureCoordinates[stIndex++] = st.x;\n textureCoordinates[stIndex] = st.y;\n\n minX = Math.min(minX, st.x);\n minY = Math.min(minY, st.y);\n maxX = Math.max(maxX, st.x);\n maxY = Math.max(maxY, st.y);\n }\n }\n\n if (\n vertexFormat.st &&\n (minX < 0.0 || minY < 0.0 || maxX > 1.0 || maxY > 1.0)\n ) {\n for (let k = 0; k < textureCoordinates.length; k += 2) {\n textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);\n textureCoordinates[k + 1] =\n (textureCoordinates[k + 1] - minY) / (maxY - minY);\n }\n }\n\n const geo = calculateAttributes(\n positions,\n vertexFormat,\n ellipsoid,\n computedOptions.tangentRotationMatrix\n );\n\n let indicesSize = 6 * (width - 1) * (rowHeight - 1);\n if (northCap) {\n indicesSize += 3 * (width - 1);\n }\n if (southCap) {\n indicesSize += 3 * (width - 1);\n }\n const indices = IndexDatatype.createTypedArray(size, indicesSize);\n let index = 0;\n let indicesIndex = 0;\n let i;\n for (i = 0; i < rowHeight - 1; ++i) {\n for (let j = 0; j < width - 1; ++j) {\n const upperLeft = index;\n const lowerLeft = upperLeft + width;\n const lowerRight = lowerLeft + 1;\n const upperRight = upperLeft + 1;\n indices[indicesIndex++] = upperLeft;\n indices[indicesIndex++] = lowerLeft;\n indices[indicesIndex++] = upperRight;\n indices[indicesIndex++] = upperRight;\n indices[indicesIndex++] = lowerLeft;\n indices[indicesIndex++] = lowerRight;\n ++index;\n }\n ++index;\n }\n if (northCap || southCap) {\n let northIndex = size - 1;\n const southIndex = size - 1;\n if (northCap && southCap) {\n northIndex = size - 2;\n }\n\n let p1;\n let p2;\n index = 0;\n\n if (northCap) {\n for (i = 0; i < width - 1; i++) {\n p1 = index;\n p2 = p1 + 1;\n indices[indicesIndex++] = northIndex;\n indices[indicesIndex++] = p1;\n indices[indicesIndex++] = p2;\n ++index;\n }\n }\n if (southCap) {\n index = (rowHeight - 1) * width;\n for (i = 0; i < width - 1; i++) {\n p1 = index;\n p2 = p1 + 1;\n indices[indicesIndex++] = p1;\n indices[indicesIndex++] = southIndex;\n indices[indicesIndex++] = p2;\n ++index;\n }\n }\n }\n\n geo.indices = indices;\n if (vertexFormat.st) {\n geo.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n return geo;\n}\n\nfunction addWallPositions(\n wallPositions,\n posIndex,\n i,\n topPositions,\n bottomPositions\n) {\n wallPositions[posIndex++] = topPositions[i];\n wallPositions[posIndex++] = topPositions[i + 1];\n wallPositions[posIndex++] = topPositions[i + 2];\n wallPositions[posIndex++] = bottomPositions[i];\n wallPositions[posIndex++] = bottomPositions[i + 1];\n wallPositions[posIndex] = bottomPositions[i + 2];\n return wallPositions;\n}\n\nfunction addWallTextureCoordinates(wallTextures, stIndex, i, st) {\n wallTextures[stIndex++] = st[i];\n wallTextures[stIndex++] = st[i + 1];\n wallTextures[stIndex++] = st[i];\n wallTextures[stIndex] = st[i + 1];\n return wallTextures;\n}\n\nconst scratchVertexFormat = new VertexFormat();\n\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\n const shadowVolume = rectangleGeometry._shadowVolume;\n const offsetAttributeValue = rectangleGeometry._offsetAttribute;\n const vertexFormat = rectangleGeometry._vertexFormat;\n const minHeight = rectangleGeometry._extrudedHeight;\n const maxHeight = rectangleGeometry._surfaceHeight;\n const ellipsoid = rectangleGeometry._ellipsoid;\n\n const height = computedOptions.height;\n const width = computedOptions.width;\n\n let i;\n\n if (shadowVolume) {\n const newVertexFormat = VertexFormat.clone(\n vertexFormat,\n scratchVertexFormat\n );\n newVertexFormat.normal = true;\n rectangleGeometry._vertexFormat = newVertexFormat;\n }\n\n const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);\n\n if (shadowVolume) {\n rectangleGeometry._vertexFormat = vertexFormat;\n }\n\n let topPositions = PolygonPipeline.scaleToGeodeticHeight(\n topBottomGeo.attributes.position.values,\n maxHeight,\n ellipsoid,\n false\n );\n topPositions = new Float64Array(topPositions);\n let length = topPositions.length;\n const newLength = length * 2;\n const positions = new Float64Array(newLength);\n positions.set(topPositions);\n const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\n topBottomGeo.attributes.position.values,\n minHeight,\n ellipsoid\n );\n positions.set(bottomPositions, length);\n topBottomGeo.attributes.position.values = positions;\n\n const normals = vertexFormat.normal ? new Float32Array(newLength) : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(newLength)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(newLength)\n : undefined;\n const textures = vertexFormat.st\n ? new Float32Array((newLength / 3) * 2)\n : undefined;\n let topSt;\n let topNormals;\n if (vertexFormat.normal) {\n topNormals = topBottomGeo.attributes.normal.values;\n normals.set(topNormals);\n for (i = 0; i < length; i++) {\n topNormals[i] = -topNormals[i];\n }\n normals.set(topNormals, length);\n topBottomGeo.attributes.normal.values = normals;\n }\n if (shadowVolume) {\n topNormals = topBottomGeo.attributes.normal.values;\n if (!vertexFormat.normal) {\n topBottomGeo.attributes.normal = undefined;\n }\n const extrudeNormals = new Float32Array(newLength);\n for (i = 0; i < length; i++) {\n topNormals[i] = -topNormals[i];\n }\n extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down\n topBottomGeo.attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: extrudeNormals,\n });\n }\n\n let offsetValue;\n const hasOffsets = defined(offsetAttributeValue);\n if (hasOffsets) {\n const size = (length / 3) * 2;\n let offsetAttribute = new Uint8Array(size);\n if (offsetAttributeValue === GeometryOffsetAttribute.TOP) {\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\n } else {\n offsetValue =\n offsetAttributeValue === GeometryOffsetAttribute.NONE ? 0 : 1;\n offsetAttribute = offsetAttribute.fill(offsetValue);\n }\n\n topBottomGeo.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: offsetAttribute,\n });\n }\n\n if (vertexFormat.tangent) {\n const topTangents = topBottomGeo.attributes.tangent.values;\n tangents.set(topTangents);\n for (i = 0; i < length; i++) {\n topTangents[i] = -topTangents[i];\n }\n tangents.set(topTangents, length);\n topBottomGeo.attributes.tangent.values = tangents;\n }\n if (vertexFormat.bitangent) {\n const topBitangents = topBottomGeo.attributes.bitangent.values;\n bitangents.set(topBitangents);\n bitangents.set(topBitangents, length);\n topBottomGeo.attributes.bitangent.values = bitangents;\n }\n if (vertexFormat.st) {\n topSt = topBottomGeo.attributes.st.values;\n textures.set(topSt);\n textures.set(topSt, (length / 3) * 2);\n topBottomGeo.attributes.st.values = textures;\n }\n\n const indices = topBottomGeo.indices;\n const indicesLength = indices.length;\n const posLength = length / 3;\n const newIndices = IndexDatatype.createTypedArray(\n newLength / 3,\n indicesLength * 2\n );\n newIndices.set(indices);\n for (i = 0; i < indicesLength; i += 3) {\n newIndices[i + indicesLength] = indices[i + 2] + posLength;\n newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;\n newIndices[i + 2 + indicesLength] = indices[i] + posLength;\n }\n topBottomGeo.indices = newIndices;\n\n const northCap = computedOptions.northCap;\n const southCap = computedOptions.southCap;\n\n let rowHeight = height;\n let widthMultiplier = 2;\n let perimeterPositions = 0;\n let corners = 4;\n let dupliateCorners = 4;\n if (northCap) {\n widthMultiplier -= 1;\n rowHeight -= 1;\n perimeterPositions += 1;\n corners -= 2;\n dupliateCorners -= 1;\n }\n if (southCap) {\n widthMultiplier -= 1;\n rowHeight -= 1;\n perimeterPositions += 1;\n corners -= 2;\n dupliateCorners -= 1;\n }\n perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;\n\n const wallCount = (perimeterPositions + dupliateCorners) * 2;\n\n let wallPositions = new Float64Array(wallCount * 3);\n const wallExtrudeNormals = shadowVolume\n ? new Float32Array(wallCount * 3)\n : undefined;\n let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : undefined;\n let wallTextures = vertexFormat.st\n ? new Float32Array(wallCount * 2)\n : undefined;\n\n const computeTopOffsets =\n offsetAttributeValue === GeometryOffsetAttribute.TOP;\n if (hasOffsets && !computeTopOffsets) {\n offsetValue = offsetAttributeValue === GeometryOffsetAttribute.ALL ? 1 : 0;\n wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);\n }\n\n let posIndex = 0;\n let stIndex = 0;\n let extrudeNormalIndex = 0;\n let wallOffsetIndex = 0;\n const area = width * rowHeight;\n let threeI;\n for (i = 0; i < area; i += width) {\n threeI = i * 3;\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n i * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n\n if (!southCap) {\n for (i = area - width; i < area; i++) {\n threeI = i * 3;\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n i * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n } else {\n const southIndex = northCap ? area + 1 : area;\n threeI = southIndex * 3;\n\n for (i = 0; i < 2; i++) {\n // duplicate corner points\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n southIndex * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n }\n\n for (i = area - 1; i > 0; i -= width) {\n threeI = i * 3;\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n i * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n\n if (!northCap) {\n for (i = width - 1; i >= 0; i--) {\n threeI = i * 3;\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n i * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n } else {\n const northIndex = area;\n threeI = northIndex * 3;\n\n for (i = 0; i < 2; i++) {\n // duplicate corner points\n wallPositions = addWallPositions(\n wallPositions,\n posIndex,\n threeI,\n topPositions,\n bottomPositions\n );\n posIndex += 6;\n if (vertexFormat.st) {\n wallTextures = addWallTextureCoordinates(\n wallTextures,\n stIndex,\n northIndex * 2,\n topSt\n );\n stIndex += 4;\n }\n if (shadowVolume) {\n extrudeNormalIndex += 3;\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\n }\n if (computeTopOffsets) {\n wallOffsetAttribute[wallOffsetIndex++] = 1;\n wallOffsetIndex += 1;\n }\n }\n }\n\n let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);\n\n if (vertexFormat.st) {\n geo.attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: wallTextures,\n });\n }\n if (shadowVolume) {\n geo.attributes.extrudeDirection = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: wallExtrudeNormals,\n });\n }\n if (hasOffsets) {\n geo.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: wallOffsetAttribute,\n });\n }\n\n const wallIndices = IndexDatatype.createTypedArray(\n wallCount,\n perimeterPositions * 6\n );\n\n let upperLeft;\n let lowerLeft;\n let lowerRight;\n let upperRight;\n length = wallPositions.length / 3;\n let index = 0;\n for (i = 0; i < length - 1; i += 2) {\n upperLeft = i;\n upperRight = (upperLeft + 2) % length;\n const p1 = Cartesian3.fromArray(wallPositions, upperLeft * 3, v1Scratch);\n const p2 = Cartesian3.fromArray(wallPositions, upperRight * 3, v2Scratch);\n if (Cartesian3.equalsEpsilon(p1, p2, CesiumMath.EPSILON10)) {\n continue;\n }\n lowerLeft = (upperLeft + 1) % length;\n lowerRight = (lowerLeft + 2) % length;\n wallIndices[index++] = upperLeft;\n wallIndices[index++] = lowerLeft;\n wallIndices[index++] = upperRight;\n wallIndices[index++] = upperRight;\n wallIndices[index++] = lowerLeft;\n wallIndices[index++] = lowerRight;\n }\n\n geo.indices = wallIndices;\n\n geo = GeometryPipeline.combineInstances([\n new GeometryInstance({\n geometry: topBottomGeo,\n }),\n new GeometryInstance({\n geometry: geo,\n }),\n ]);\n\n return geo[0];\n}\n\nconst scratchRectanglePoints = [\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n];\nconst nwScratch = new Cartographic();\nconst stNwScratch = new Cartographic();\nfunction computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {\n if (rotation === 0.0) {\n return Rectangle.clone(rectangle, result);\n }\n\n const computedOptions = RectangleGeometryLibrary.computeOptions(\n rectangle,\n granularity,\n rotation,\n 0,\n rectangleScratch,\n nwScratch\n );\n\n const height = computedOptions.height;\n const width = computedOptions.width;\n\n const positions = scratchRectanglePoints;\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n 0,\n 0,\n positions[0]\n );\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n 0,\n width - 1,\n positions[1]\n );\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n height - 1,\n 0,\n positions[2]\n );\n RectangleGeometryLibrary.computePosition(\n computedOptions,\n ellipsoid,\n false,\n height - 1,\n width - 1,\n positions[3]\n );\n\n return Rectangle.fromCartesianArray(positions, ellipsoid, result);\n}\n\n/**\n * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias RectangleGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\n *\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.south</code> must be in the interval [<code>-Pi/2</code>, <code>Pi/2</code>].\n * @exception {DeveloperError} <code>options.rectangle.east</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>].\n * @exception {DeveloperError} <code>options.rectangle.north</code> must be greater than <code>options.rectangle.south</code>.\n *\n * @see RectangleGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}\n *\n * @example\n * // 1. create a rectangle\n * const rectangle = new Cesium.RectangleGeometry({\n * ellipsoid : Cesium.Ellipsoid.WGS84,\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n * height : 10000.0\n * });\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\n *\n * // 2. create an extruded rectangle without a top\n * const rectangle = new Cesium.RectangleGeometry({\n * ellipsoid : Cesium.Ellipsoid.WGS84,\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\n * height : 10000.0,\n * extrudedHeight: 300000\n * });\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\n */\nfunction RectangleGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const rectangle = options.rectangle;\n\n const height = defaultValue(options.height, 0.0);\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\n\n this._rectangle = Rectangle.clone(rectangle);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._surfaceHeight = Math.max(height, extrudedHeight);\n this._rotation = defaultValue(options.rotation, 0.0);\n this._stRotation = defaultValue(options.stRotation, 0.0);\n this._vertexFormat = VertexFormat.clone(\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n );\n this._extrudedHeight = Math.min(height, extrudedHeight);\n this._shadowVolume = defaultValue(options.shadowVolume, false);\n this._workerName = \"createRectangleGeometry\";\n this._offsetAttribute = options.offsetAttribute;\n this._rotatedRectangle = undefined;\n\n this._textureCoordinateRotationPoints = undefined;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nRectangleGeometry.packedLength =\n Rectangle.packedLength +\n Ellipsoid.packedLength +\n VertexFormat.packedLength +\n 7;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {RectangleGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nRectangleGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n Rectangle.pack(value._rectangle, array, startingIndex);\n startingIndex += Rectangle.packedLength;\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._granularity;\n array[startingIndex++] = value._surfaceHeight;\n array[startingIndex++] = value._rotation;\n array[startingIndex++] = value._stRotation;\n array[startingIndex++] = value._extrudedHeight;\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\n\n return array;\n};\n\nconst scratchRectangle = new Rectangle();\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n rectangle: scratchRectangle,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n granularity: undefined,\n height: undefined,\n rotation: undefined,\n stRotation: undefined,\n extrudedHeight: undefined,\n shadowVolume: undefined,\n offsetAttribute: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {RectangleGeometry} [result] The object into which to store the result.\n * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided.\n */\nRectangleGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\n startingIndex += Rectangle.packedLength;\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const granularity = array[startingIndex++];\n const surfaceHeight = array[startingIndex++];\n const rotation = array[startingIndex++];\n const stRotation = array[startingIndex++];\n const extrudedHeight = array[startingIndex++];\n const shadowVolume = array[startingIndex++] === 1.0;\n const offsetAttribute = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.granularity = granularity;\n scratchOptions.height = surfaceHeight;\n scratchOptions.rotation = rotation;\n scratchOptions.stRotation = stRotation;\n scratchOptions.extrudedHeight = extrudedHeight;\n scratchOptions.shadowVolume = shadowVolume;\n scratchOptions.offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return new RectangleGeometry(scratchOptions);\n }\n\n result._rectangle = Rectangle.clone(rectangle, result._rectangle);\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._granularity = granularity;\n result._surfaceHeight = surfaceHeight;\n result._rotation = rotation;\n result._stRotation = stRotation;\n result._extrudedHeight = extrudedHeight;\n result._shadowVolume = shadowVolume;\n result._offsetAttribute =\n offsetAttribute === -1 ? undefined : offsetAttribute;\n\n return result;\n};\n\n/**\n * Computes the bounding rectangle based on the provided options\n *\n * @param {Object} options Object with the following properties:\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\n * @param {Rectangle} [result] An object in which to store the result.\n *\n * @returns {Rectangle} The result rectangle\n */\nRectangleGeometry.computeRectangle = function (options, result) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const rectangle = options.rectangle;\n\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n const rotation = defaultValue(options.rotation, 0.0);\n\n return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);\n};\n\nconst tangentRotationMatrixScratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\nconst centerScratch = new Cartographic();\n/**\n * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.\n *\n * @param {RectangleGeometry} rectangleGeometry A description of the rectangle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n *\n * @exception {DeveloperError} Rotated rectangle is invalid.\n */\nRectangleGeometry.createGeometry = function (rectangleGeometry) {\n if (\n CesiumMath.equalsEpsilon(\n rectangleGeometry._rectangle.north,\n rectangleGeometry._rectangle.south,\n CesiumMath.EPSILON10\n ) ||\n CesiumMath.equalsEpsilon(\n rectangleGeometry._rectangle.east,\n rectangleGeometry._rectangle.west,\n CesiumMath.EPSILON10\n )\n ) {\n return undefined;\n }\n\n let rectangle = rectangleGeometry._rectangle;\n const ellipsoid = rectangleGeometry._ellipsoid;\n const rotation = rectangleGeometry._rotation;\n const stRotation = rectangleGeometry._stRotation;\n const vertexFormat = rectangleGeometry._vertexFormat;\n\n const computedOptions = RectangleGeometryLibrary.computeOptions(\n rectangle,\n rectangleGeometry._granularity,\n rotation,\n stRotation,\n rectangleScratch,\n nwScratch,\n stNwScratch\n );\n\n const tangentRotationMatrix = tangentRotationMatrixScratch;\n if (stRotation !== 0 || rotation !== 0) {\n const center = Rectangle.center(rectangle, centerScratch);\n const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);\n Quaternion.fromAxisAngle(axis, -stRotation, quaternionScratch);\n Matrix3.fromQuaternion(quaternionScratch, tangentRotationMatrix);\n } else {\n Matrix3.clone(Matrix3.IDENTITY, tangentRotationMatrix);\n }\n\n const surfaceHeight = rectangleGeometry._surfaceHeight;\n const extrudedHeight = rectangleGeometry._extrudedHeight;\n const extrude = !CesiumMath.equalsEpsilon(\n surfaceHeight,\n extrudedHeight,\n 0,\n CesiumMath.EPSILON2\n );\n\n computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width;\n computedOptions.latScalar = 1.0 / rectangleGeometry._rectangle.height;\n computedOptions.tangentRotationMatrix = tangentRotationMatrix;\n\n let geometry;\n let boundingSphere;\n rectangle = rectangleGeometry._rectangle;\n if (extrude) {\n geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\n const topBS = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n surfaceHeight,\n topBoundingSphere\n );\n const bottomBS = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n extrudedHeight,\n bottomBoundingSphere\n );\n boundingSphere = BoundingSphere.union(topBS, bottomBS);\n } else {\n geometry = constructRectangle(rectangleGeometry, computedOptions);\n geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\n geometry.attributes.position.values,\n surfaceHeight,\n ellipsoid,\n false\n );\n\n if (defined(rectangleGeometry._offsetAttribute)) {\n const length = geometry.attributes.position.values.length;\n const offsetValue =\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\n ? 0\n : 1;\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\n geometry.attributes.applyOffset = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 1,\n values: applyOffset,\n });\n }\n\n boundingSphere = BoundingSphere.fromRectangle3D(\n rectangle,\n ellipsoid,\n surfaceHeight\n );\n }\n\n if (!vertexFormat.position) {\n delete geometry.attributes.position;\n }\n\n return new Geometry({\n attributes: geometry.attributes,\n indices: geometry.indices,\n primitiveType: geometry.primitiveType,\n boundingSphere: boundingSphere,\n offsetAttribute: rectangleGeometry._offsetAttribute,\n });\n};\n\n/**\n * @private\n */\nRectangleGeometry.createShadowVolume = function (\n rectangleGeometry,\n minHeightFunc,\n maxHeightFunc\n) {\n const granularity = rectangleGeometry._granularity;\n const ellipsoid = rectangleGeometry._ellipsoid;\n\n const minHeight = minHeightFunc(granularity, ellipsoid);\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n return new RectangleGeometry({\n rectangle: rectangleGeometry._rectangle,\n rotation: rectangleGeometry._rotation,\n ellipsoid: ellipsoid,\n stRotation: rectangleGeometry._stRotation,\n granularity: granularity,\n extrudedHeight: maxHeight,\n height: minHeight,\n vertexFormat: VertexFormat.POSITION_ONLY,\n shadowVolume: true,\n });\n};\n\nconst unrotatedTextureRectangleScratch = new Rectangle();\nconst points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];\nconst rotation2DScratch = new Matrix2();\nconst rectangleCenterScratch = new Cartographic();\n\nfunction textureCoordinateRotationPoints(rectangleGeometry) {\n if (rectangleGeometry._stRotation === 0.0) {\n return [0, 0, 0, 1, 1, 0];\n }\n\n const rectangle = Rectangle.clone(\n rectangleGeometry._rectangle,\n unrotatedTextureRectangleScratch\n );\n const granularity = rectangleGeometry._granularity;\n const ellipsoid = rectangleGeometry._ellipsoid;\n\n // Rotate to align the texture coordinates with ENU\n const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;\n\n const unrotatedTextureRectangle = computeRectangle(\n rectangle,\n granularity,\n rotation,\n ellipsoid,\n unrotatedTextureRectangleScratch\n );\n\n // Assume a computed \"east-north\" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`.\n // The \"desired\" texture coordinate system forms an oriented rectangle (un-oriented computed) around the geometry that completely and tightly bounds it.\n // We want to map from the \"east-north\" texture coordinate system into the \"desired\" system using a pair of lines (analagous planes in 2D)\n // Compute 3 corners of the \"desired\" texture coordinate system in \"east-north\" texture space by the following in cartographic space:\n // - rotate 3 of the corners in unrotatedTextureRectangle by stRotation around the center of the bounding rectangle\n // - apply the \"east-north\" system's normalization formula to the rotated cartographics, even though this is likely to produce values outside [0-1].\n // This gives us a set of points in the \"east-north\" texture coordinate system that can be used to map \"east-north\" texture coordinates to \"desired.\"\n\n const points2D = points2DScratch;\n points2D[0].x = unrotatedTextureRectangle.west;\n points2D[0].y = unrotatedTextureRectangle.south;\n\n points2D[1].x = unrotatedTextureRectangle.west;\n points2D[1].y = unrotatedTextureRectangle.north;\n\n points2D[2].x = unrotatedTextureRectangle.east;\n points2D[2].y = unrotatedTextureRectangle.south;\n\n const boundingRectangle = rectangleGeometry.rectangle;\n const toDesiredInComputed = Matrix2.fromRotation(\n rectangleGeometry._stRotation,\n rotation2DScratch\n );\n const boundingRectangleCenter = Rectangle.center(\n boundingRectangle,\n rectangleCenterScratch\n );\n\n for (let i = 0; i < 3; ++i) {\n const point2D = points2D[i];\n point2D.x -= boundingRectangleCenter.longitude;\n point2D.y -= boundingRectangleCenter.latitude;\n Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);\n point2D.x += boundingRectangleCenter.longitude;\n point2D.y += boundingRectangleCenter.latitude;\n\n // Convert point into east-north texture coordinate space\n point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;\n point2D.y =\n (point2D.y - boundingRectangle.south) / boundingRectangle.height;\n }\n\n const minXYCorner = points2D[0];\n const maxYCorner = points2D[1];\n const maxXCorner = points2D[2];\n const result = new Array(6);\n Cartesian2.pack(minXYCorner, result);\n Cartesian2.pack(maxYCorner, result, 2);\n Cartesian2.pack(maxXCorner, result, 4);\n return result;\n}\n\nObject.defineProperties(RectangleGeometry.prototype, {\n /**\n * @private\n */\n rectangle: {\n get: function () {\n if (!defined(this._rotatedRectangle)) {\n this._rotatedRectangle = computeRectangle(\n this._rectangle,\n this._granularity,\n this._rotation,\n this._ellipsoid\n );\n }\n return this._rotatedRectangle;\n },\n },\n /**\n * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.\n * This version permits skew in textures by computing offsets directly in cartographic space and\n * more accurately approximates rendering RectangleGeometries with height as standard Primitives.\n * @see Geometry#_textureCoordinateRotationPoints\n * @private\n */\n textureCoordinateRotationPoints: {\n get: function () {\n if (!defined(this._textureCoordinateRotationPoints)) {\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\n this\n );\n }\n return this._textureCoordinateRotationPoints;\n },\n },\n});\nexport default RectangleGeometry;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RectangleGeometry from \"../Core/RectangleGeometry.js\";\nimport RectangleOutlineGeometry from \"../Core/RectangleOutlineGeometry.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport GroundGeometryUpdater from \"./GroundGeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\nconst scratchRectangle = new Rectangle();\nconst scratchCenterRect = new Rectangle();\nconst scratchCarto = new Cartographic();\n\nfunction RectangleGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.rectangle = undefined;\n this.height = undefined;\n this.extrudedHeight = undefined;\n this.granularity = undefined;\n this.stRotation = undefined;\n this.rotation = undefined;\n this.offsetAttribute = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for rectangles.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias RectangleGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction RectangleGeometryUpdater(entity, scene) {\n GroundGeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new RectangleGeometryOptions(entity),\n geometryPropertyName: \"rectangle\",\n observedPropertyNames: [\"availability\", \"rectangle\"],\n });\n\n this._onEntityPropertyChanged(\n entity,\n \"rectangle\",\n entity.rectangle,\n undefined\n );\n}\n\nif (defined(Object.create)) {\n RectangleGeometryUpdater.prototype = Object.create(\n GroundGeometryUpdater.prototype\n );\n RectangleGeometryUpdater.prototype.constructor = RectangleGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nRectangleGeometryUpdater.prototype.createFillGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n ),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n this._distanceDisplayConditionProperty.getValue(time)\n ),\n offset: undefined,\n color: undefined,\n };\n\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new RectangleGeometry(this._options),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nRectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n const attributes = {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n offset: undefined,\n };\n\n if (defined(this._options.offsetAttribute)) {\n attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(\n Property.getValueOrDefault(\n this._terrainOffsetProperty,\n time,\n defaultOffset,\n offsetScratch\n )\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new RectangleOutlineGeometry(this._options),\n attributes: attributes,\n });\n};\n\nRectangleGeometryUpdater.prototype._computeCenter = function (time, result) {\n const rect = Property.getValueOrUndefined(\n this._entity.rectangle.coordinates,\n time,\n scratchCenterRect\n );\n if (!defined(rect)) {\n return;\n }\n const center = Rectangle.center(rect, scratchCarto);\n return Cartographic.toCartesian(center, Ellipsoid.WGS84, result);\n};\n\nRectangleGeometryUpdater.prototype._isHidden = function (entity, rectangle) {\n return (\n !defined(rectangle.coordinates) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, rectangle)\n );\n};\n\nRectangleGeometryUpdater.prototype._isDynamic = function (entity, rectangle) {\n return (\n !rectangle.coordinates.isConstant || //\n !Property.isConstant(rectangle.height) || //\n !Property.isConstant(rectangle.extrudedHeight) || //\n !Property.isConstant(rectangle.granularity) || //\n !Property.isConstant(rectangle.stRotation) || //\n !Property.isConstant(rectangle.rotation) || //\n !Property.isConstant(rectangle.outlineWidth) || //\n !Property.isConstant(rectangle.zIndex) || //\n (this._onTerrain &&\n !Property.isConstant(this._materialProperty) &&\n !(this._materialProperty instanceof ColorMaterialProperty))\n );\n};\n\nRectangleGeometryUpdater.prototype._setStaticOptions = function (\n entity,\n rectangle\n) {\n const isColorMaterial =\n this._materialProperty instanceof ColorMaterialProperty;\n\n let heightValue = Property.getValueOrUndefined(\n rectangle.height,\n Iso8601.MINIMUM_VALUE\n );\n const heightReferenceValue = Property.getValueOrDefault(\n rectangle.heightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n rectangle.extrudedHeight,\n Iso8601.MINIMUM_VALUE\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n rectangle.extrudedHeightReference,\n Iso8601.MINIMUM_VALUE,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n const options = this._options;\n options.vertexFormat = isColorMaterial\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.rectangle = rectangle.coordinates.getValue(\n Iso8601.MINIMUM_VALUE,\n options.rectangle\n );\n options.granularity = Property.getValueOrUndefined(\n rectangle.granularity,\n Iso8601.MINIMUM_VALUE\n );\n options.stRotation = Property.getValueOrUndefined(\n rectangle.stRotation,\n Iso8601.MINIMUM_VALUE\n );\n options.rotation = Property.getValueOrUndefined(\n rectangle.rotation,\n Iso8601.MINIMUM_VALUE\n );\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n RectangleGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\n\nRectangleGeometryUpdater.DynamicGeometryUpdater = DynamicRectangleGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicRectangleGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicRectangleGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicRectangleGeometryUpdater.prototype.constructor = DynamicRectangleGeometryUpdater;\n}\n\nDynamicRectangleGeometryUpdater.prototype._isHidden = function (\n entity,\n rectangle,\n time\n) {\n return (\n !defined(this._options.rectangle) ||\n DynamicGeometryUpdater.prototype._isHidden.call(\n this,\n entity,\n rectangle,\n time\n )\n );\n};\n\nDynamicRectangleGeometryUpdater.prototype._setOptions = function (\n entity,\n rectangle,\n time\n) {\n const options = this._options;\n let heightValue = Property.getValueOrUndefined(rectangle.height, time);\n const heightReferenceValue = Property.getValueOrDefault(\n rectangle.heightReference,\n time,\n HeightReference.NONE\n );\n let extrudedHeightValue = Property.getValueOrUndefined(\n rectangle.extrudedHeight,\n time\n );\n const extrudedHeightReferenceValue = Property.getValueOrDefault(\n rectangle.extrudedHeightReference,\n time,\n HeightReference.NONE\n );\n if (defined(extrudedHeightValue) && !defined(heightValue)) {\n heightValue = 0;\n }\n\n options.rectangle = Property.getValueOrUndefined(\n rectangle.coordinates,\n time,\n options.rectangle\n );\n options.granularity = Property.getValueOrUndefined(\n rectangle.granularity,\n time\n );\n options.stRotation = Property.getValueOrUndefined(rectangle.stRotation, time);\n options.rotation = Property.getValueOrUndefined(rectangle.rotation, time);\n options.offsetAttribute = GroundGeometryUpdater.computeGeometryOffsetAttribute(\n heightValue,\n heightReferenceValue,\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n options.height = GroundGeometryUpdater.getGeometryHeight(\n heightValue,\n heightReferenceValue\n );\n\n extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(\n extrudedHeightValue,\n extrudedHeightReferenceValue\n );\n if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) {\n extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(\n RectangleGeometry.computeRectangle(options, scratchRectangle)\n ).minimumTerrainHeight;\n }\n\n options.extrudedHeight = extrudedHeightValue;\n};\nexport default RectangleGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(\n primitives,\n translucent,\n appearanceType,\n depthFailAppearanceType,\n depthFailMaterialProperty,\n closed,\n shadows\n) {\n this.translucent = translucent;\n this.appearanceType = appearanceType;\n this.depthFailAppearanceType = depthFailAppearanceType;\n this.depthFailMaterialProperty = depthFailMaterialProperty;\n this.depthFailMaterial = undefined;\n this.closed = closed;\n this.shadows = shadows;\n this.primitives = primitives;\n this.createPrimitive = false;\n this.waitingOnCreate = false;\n this.primitive = undefined;\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.updaters = new AssociativeArray();\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n this.itemsToRemove = [];\n this.invalidated = false;\n\n let removeMaterialSubscription;\n if (defined(depthFailMaterialProperty)) {\n removeMaterialSubscription = depthFailMaterialProperty.definitionChanged.addEventListener(\n Batch.prototype.onMaterialChanged,\n this\n );\n }\n this.removeMaterialSubscription = removeMaterialSubscription;\n}\n\nBatch.prototype.onMaterialChanged = function () {\n this.invalidated = true;\n};\n\nBatch.prototype.isMaterial = function (updater) {\n const material = this.depthFailMaterialProperty;\n const updaterMaterial = updater.depthFailMaterialProperty;\n if (updaterMaterial === material) {\n return true;\n }\n if (defined(material)) {\n return material.equals(updaterMaterial);\n }\n return false;\n};\n\nBatch.prototype.add = function (updater, instance) {\n const id = updater.id;\n this.createPrimitive = true;\n this.geometry.set(id, instance);\n this.updaters.set(id, updater);\n if (\n !updater.hasConstantFill ||\n !updater.fillMaterialProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n !Property.isConstant(updater.terrainOffsetProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n this.showsUpdated.remove(id);\n }\n return true;\n }\n return false;\n};\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n let removedCount = 0;\n let primitive = this.primitive;\n const primitives = this.primitives;\n let i;\n\n if (this.createPrimitive) {\n const geometries = this.geometry.values;\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n primitives.remove(primitive);\n }\n }\n\n let depthFailAppearance;\n if (defined(this.depthFailAppearanceType)) {\n if (defined(this.depthFailMaterialProperty)) {\n this.depthFailMaterial = MaterialProperty.getValue(\n time,\n this.depthFailMaterialProperty,\n this.depthFailMaterial\n );\n }\n depthFailAppearance = new this.depthFailAppearanceType({\n material: this.depthFailMaterial,\n translucent: this.translucent,\n closed: this.closed,\n });\n }\n\n primitive = new Primitive({\n show: false,\n asynchronous: true,\n geometryInstances: geometries.slice(),\n appearance: new this.appearanceType({\n translucent: this.translucent,\n closed: this.closed,\n }),\n depthFailAppearance: depthFailAppearance,\n shadows: this.shadows,\n });\n primitives.add(primitive);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n primitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n this.waitingOnCreate = true;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n primitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n\n if (\n defined(this.depthFailAppearanceType) &&\n !(this.depthFailMaterialProperty instanceof ColorMaterialProperty)\n ) {\n this.depthFailMaterial = MaterialProperty.getValue(\n time,\n this.depthFailMaterialProperty,\n this.depthFailMaterial\n );\n this.primitive.depthFailAppearance.material = this.depthFailMaterial;\n }\n\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n const waitingOnCreate = this.waitingOnCreate;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {\n const colorProperty = updater.fillMaterialProperty.color;\n const resultColor = Property.getValueOrDefault(\n colorProperty,\n time,\n Color.WHITE,\n colorScratch\n );\n if (!Color.equals(attributes._lastColor, resultColor)) {\n attributes._lastColor = Color.clone(\n resultColor,\n attributes._lastColor\n );\n attributes.color = ColorGeometryInstanceAttribute.toValue(\n resultColor,\n attributes.color\n );\n if (\n (this.translucent && attributes.color[3] === 255) ||\n (!this.translucent && attributes.color[3] !== 255)\n ) {\n this.itemsToRemove[removedCount++] = updater;\n }\n }\n }\n\n if (\n defined(this.depthFailAppearanceType) &&\n updater.depthFailMaterialProperty instanceof ColorMaterialProperty &&\n (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)\n ) {\n const depthFailColorProperty = updater.depthFailMaterialProperty.color;\n const depthColor = Property.getValueOrDefault(\n depthFailColorProperty,\n time,\n Color.WHITE,\n colorScratch\n );\n if (!Color.equals(attributes._lastDepthFailColor, depthColor)) {\n attributes._lastDepthFailColor = Color.clone(\n depthColor,\n attributes._lastDepthFailColor\n );\n attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(\n depthColor,\n attributes.depthFailColor\n );\n }\n }\n\n const show =\n updater.entity.isShowing &&\n (updater.hasConstantFill || updater.isFilled(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n\n const offsetProperty = updater.terrainOffsetProperty;\n if (!Property.isConstant(offsetProperty)) {\n const offset = Property.getValueOrDefault(\n offsetProperty,\n time,\n defaultOffset,\n offsetScratch\n );\n if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n attributes._lastOffset = Cartesian3.clone(\n offset,\n attributes._lastOffset\n );\n attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n offset,\n attributes.offset\n );\n }\n }\n }\n\n this.updateShows(primitive);\n this.waitingOnCreate = false;\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n this.itemsToRemove.length = removedCount;\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = updater.entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n if (\n !defined(attributes) ||\n !defined(attributes.boundingSphere) || //\n (defined(attributes.show) && attributes.show[0] === 0)\n ) {\n return BoundingSphereState.FAILED;\n }\n attributes.boundingSphere.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n const primitive = this.primitive;\n const primitives = this.primitives;\n if (defined(primitive)) {\n primitives.remove(primitive);\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n }\n if (defined(this.removeMaterialSubscription)) {\n this.removeMaterialSubscription();\n }\n};\n\n/**\n * @private\n */\nfunction StaticGeometryColorBatch(\n primitives,\n appearanceType,\n depthFailAppearanceType,\n closed,\n shadows\n) {\n this._solidItems = [];\n this._translucentItems = [];\n this._primitives = primitives;\n this._appearanceType = appearanceType;\n this._depthFailAppearanceType = depthFailAppearanceType;\n this._closed = closed;\n this._shadows = shadows;\n}\n\nStaticGeometryColorBatch.prototype.add = function (time, updater) {\n let items;\n let translucent;\n const instance = updater.createFillGeometryInstance(time);\n if (instance.attributes.color.value[3] === 255) {\n items = this._solidItems;\n translucent = false;\n } else {\n items = this._translucentItems;\n translucent = true;\n }\n\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.isMaterial(updater)) {\n item.add(updater, instance);\n return;\n }\n }\n const batch = new Batch(\n this._primitives,\n translucent,\n this._appearanceType,\n this._depthFailAppearanceType,\n updater.depthFailMaterialProperty,\n this._closed,\n this._shadows\n );\n batch.add(updater, instance);\n items.push(batch);\n};\n\nfunction removeItem(items, updater) {\n const length = items.length;\n for (let i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.remove(updater)) {\n if (item.updaters.length === 0) {\n items.splice(i, 1);\n item.destroy();\n }\n return true;\n }\n }\n return false;\n}\n\nStaticGeometryColorBatch.prototype.remove = function (updater) {\n if (!removeItem(this._solidItems, updater)) {\n removeItem(this._translucentItems, updater);\n }\n};\n\nfunction moveItems(batch, items, time) {\n let itemsMoved = false;\n const length = items.length;\n for (let i = 0; i < length; ++i) {\n const item = items[i];\n const itemsToRemove = item.itemsToRemove;\n const itemsToMoveLength = itemsToRemove.length;\n if (itemsToMoveLength > 0) {\n for (i = 0; i < itemsToMoveLength; i++) {\n const updater = itemsToRemove[i];\n item.remove(updater);\n batch.add(time, updater);\n itemsMoved = true;\n }\n }\n }\n return itemsMoved;\n}\n\nfunction updateItems(batch, items, time, isUpdated) {\n let length = items.length;\n let i;\n for (i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.invalidated) {\n items.splice(i, 1);\n const updaters = item.updaters.values;\n const updatersLength = updaters.length;\n for (let h = 0; h < updatersLength; h++) {\n batch.add(time, updaters[h]);\n }\n item.destroy();\n }\n }\n\n length = items.length;\n for (i = 0; i < length; ++i) {\n isUpdated = items[i].update(time) && isUpdated;\n }\n return isUpdated;\n}\n\nStaticGeometryColorBatch.prototype.update = function (time) {\n //Perform initial update\n let isUpdated = updateItems(this, this._solidItems, time, true);\n isUpdated =\n updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;\n\n //If any items swapped between solid/translucent, we need to\n //move them between batches\n const solidsMoved = moveItems(this, this._solidItems, time);\n const translucentsMoved = moveItems(this, this._translucentItems, time);\n\n //If we moved anything around, we need to re-build the primitive\n if (solidsMoved || translucentsMoved) {\n isUpdated =\n updateItems(this, this._solidItems, time, isUpdated) && isUpdated;\n isUpdated =\n updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;\n }\n\n return isUpdated;\n};\n\nfunction getBoundingSphere(items, updater, result) {\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.contains(updater)) {\n return item.getBoundingSphere(updater, result);\n }\n }\n return BoundingSphereState.FAILED;\n}\n\nStaticGeometryColorBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n const boundingSphere = getBoundingSphere(this._solidItems, updater, result);\n if (boundingSphere === BoundingSphereState.FAILED) {\n return getBoundingSphere(this._translucentItems, updater, result);\n }\n return boundingSphere;\n};\n\nfunction removeAllPrimitives(items) {\n const length = items.length;\n for (let i = 0; i < length; i++) {\n items[i].destroy();\n }\n items.length = 0;\n}\n\nStaticGeometryColorBatch.prototype.removeAllPrimitives = function () {\n removeAllPrimitives(this._solidItems);\n removeAllPrimitives(this._translucentItems);\n};\nexport default StaticGeometryColorBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(\n primitives,\n appearanceType,\n materialProperty,\n depthFailAppearanceType,\n depthFailMaterialProperty,\n closed,\n shadows\n) {\n this.primitives = primitives;\n this.appearanceType = appearanceType;\n this.materialProperty = materialProperty;\n this.depthFailAppearanceType = depthFailAppearanceType;\n this.depthFailMaterialProperty = depthFailMaterialProperty;\n this.closed = closed;\n this.shadows = shadows;\n this.updaters = new AssociativeArray();\n this.createPrimitive = true;\n this.primitive = undefined;\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.material = undefined;\n this.depthFailMaterial = undefined;\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.invalidated = false;\n this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n Batch.prototype.onMaterialChanged,\n this\n );\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n}\n\nBatch.prototype.onMaterialChanged = function () {\n this.invalidated = true;\n};\n\nBatch.prototype.isMaterial = function (updater) {\n const material = this.materialProperty;\n const updaterMaterial = updater.fillMaterialProperty;\n const depthFailMaterial = this.depthFailMaterialProperty;\n const updaterDepthFailMaterial = updater.depthFailMaterialProperty;\n\n if (\n updaterMaterial === material &&\n updaterDepthFailMaterial === depthFailMaterial\n ) {\n return true;\n }\n let equals = defined(material) && material.equals(updaterMaterial);\n equals =\n ((!defined(depthFailMaterial) && !defined(updaterDepthFailMaterial)) ||\n (defined(depthFailMaterial) &&\n depthFailMaterial.equals(updaterDepthFailMaterial))) &&\n equals;\n return equals;\n};\n\nBatch.prototype.add = function (time, updater) {\n const id = updater.id;\n this.updaters.set(id, updater);\n this.geometry.set(id, updater.createFillGeometryInstance(time));\n if (\n !updater.hasConstantFill ||\n !updater.fillMaterialProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n !Property.isConstant(updater.terrainOffsetProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n this.showsUpdated.remove(id);\n }\n return true;\n }\n return false;\n};\n\nconst colorScratch = new Color();\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n let primitive = this.primitive;\n const primitives = this.primitives;\n const geometries = this.geometry.values;\n let i;\n\n if (this.createPrimitive) {\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n primitives.remove(primitive);\n }\n }\n\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n\n let depthFailAppearance;\n if (defined(this.depthFailMaterialProperty)) {\n this.depthFailMaterial = MaterialProperty.getValue(\n time,\n this.depthFailMaterialProperty,\n this.depthFailMaterial\n );\n depthFailAppearance = new this.depthFailAppearanceType({\n material: this.depthFailMaterial,\n translucent: this.depthFailMaterial.isTranslucent(),\n closed: this.closed,\n });\n }\n\n primitive = new Primitive({\n show: false,\n asynchronous: true,\n geometryInstances: geometries.slice(),\n appearance: new this.appearanceType({\n material: this.material,\n translucent: this.material.isTranslucent(),\n closed: this.closed,\n }),\n depthFailAppearance: depthFailAppearance,\n shadows: this.shadows,\n });\n\n primitives.add(primitive);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n primitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n primitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n this.primitive.appearance.material = this.material;\n\n if (\n defined(this.depthFailAppearanceType) &&\n !(this.depthFailMaterialProperty instanceof ColorMaterialProperty)\n ) {\n this.depthFailMaterial = MaterialProperty.getValue(\n time,\n this.depthFailMaterialProperty,\n this.depthFailMaterial\n );\n this.primitive.depthFailAppearance.material = this.depthFailMaterial;\n }\n\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n if (\n defined(this.depthFailAppearanceType) &&\n this.depthFailMaterialProperty instanceof ColorMaterialProperty &&\n !updater.depthFailMaterialProperty.isConstant\n ) {\n const depthFailColorProperty = updater.depthFailMaterialProperty.color;\n const depthFailColor = Property.getValueOrDefault(\n depthFailColorProperty,\n time,\n Color.WHITE,\n colorScratch\n );\n if (!Color.equals(attributes._lastDepthFailColor, depthFailColor)) {\n attributes._lastDepthFailColor = Color.clone(\n depthFailColor,\n attributes._lastDepthFailColor\n );\n attributes.depthFailColor = ColorGeometryInstanceAttribute.toValue(\n depthFailColor,\n attributes.depthFailColor\n );\n }\n }\n\n const show =\n entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n\n const offsetProperty = updater.terrainOffsetProperty;\n if (!Property.isConstant(offsetProperty)) {\n const offset = Property.getValueOrDefault(\n offsetProperty,\n time,\n defaultOffset,\n offsetScratch\n );\n if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n attributes._lastOffset = Cartesian3.clone(\n offset,\n attributes._lastOffset\n );\n attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n offset,\n attributes.offset\n );\n }\n }\n }\n\n this.updateShows(primitive);\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n if (\n !defined(attributes) ||\n !defined(attributes.boundingSphere) ||\n (defined(attributes.show) && attributes.show[0] === 0)\n ) {\n return BoundingSphereState.FAILED;\n }\n attributes.boundingSphere.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n const primitive = this.primitive;\n const primitives = this.primitives;\n if (defined(primitive)) {\n primitives.remove(primitive);\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n }\n this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGeometryPerMaterialBatch(\n primitives,\n appearanceType,\n depthFailAppearanceType,\n closed,\n shadows\n) {\n this._items = [];\n this._primitives = primitives;\n this._appearanceType = appearanceType;\n this._depthFailAppearanceType = depthFailAppearanceType;\n this._closed = closed;\n this._shadows = shadows;\n}\n\nStaticGeometryPerMaterialBatch.prototype.add = function (time, updater) {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.isMaterial(updater)) {\n item.add(time, updater);\n return;\n }\n }\n const batch = new Batch(\n this._primitives,\n this._appearanceType,\n updater.fillMaterialProperty,\n this._depthFailAppearanceType,\n updater.depthFailMaterialProperty,\n this._closed,\n this._shadows\n );\n batch.add(time, updater);\n items.push(batch);\n};\n\nStaticGeometryPerMaterialBatch.prototype.remove = function (updater) {\n const items = this._items;\n const length = items.length;\n for (let i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.remove(updater)) {\n if (item.updaters.length === 0) {\n items.splice(i, 1);\n item.destroy();\n }\n break;\n }\n }\n};\n\nStaticGeometryPerMaterialBatch.prototype.update = function (time) {\n let i;\n const items = this._items;\n const length = items.length;\n\n for (i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.invalidated) {\n items.splice(i, 1);\n const updaters = item.updaters.values;\n const updatersLength = updaters.length;\n for (let h = 0; h < updatersLength; h++) {\n this.add(time, updaters[h]);\n }\n item.destroy();\n }\n }\n\n let isUpdated = true;\n for (i = 0; i < items.length; i++) {\n isUpdated = items[i].update(time) && isUpdated;\n }\n return isUpdated;\n};\n\nStaticGeometryPerMaterialBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.contains(updater)) {\n return item.getBoundingSphere(updater, result);\n }\n }\n return BoundingSphereState.FAILED;\n};\n\nStaticGeometryPerMaterialBatch.prototype.removeAllPrimitives = function () {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n items[i].destroy();\n }\n this._items.length = 0;\n};\nexport default StaticGeometryPerMaterialBatch;\n", "import RBush from \"rbush\";\nimport Check from \"./Check.js\";\n\n/**\n * Wrapper around rbush for use with Rectangle types.\n * @private\n */\nfunction RectangleCollisionChecker() {\n this._tree = new RBush();\n}\n\nfunction RectangleWithId() {\n this.minX = 0.0;\n this.minY = 0.0;\n this.maxX = 0.0;\n this.maxY = 0.0;\n this.id = \"\";\n}\n\nRectangleWithId.fromRectangleAndId = function (id, rectangle, result) {\n result.minX = rectangle.west;\n result.minY = rectangle.south;\n result.maxX = rectangle.east;\n result.maxY = rectangle.north;\n result.id = id;\n return result;\n};\n\n/**\n * Insert a rectangle into the collision checker.\n *\n * @param {String} id Unique string ID for the rectangle being inserted.\n * @param {Rectangle} rectangle A Rectangle\n * @private\n */\nRectangleCollisionChecker.prototype.insert = function (id, rectangle) {\n const withId = RectangleWithId.fromRectangleAndId(\n id,\n rectangle,\n new RectangleWithId()\n );\n this._tree.insert(withId);\n};\n\nfunction idCompare(a, b) {\n return a.id === b.id;\n}\n\nconst removalScratch = new RectangleWithId();\n/**\n * Remove a rectangle from the collision checker.\n *\n * @param {String} id Unique string ID for the rectangle being removed.\n * @param {Rectangle} rectangle A Rectangle\n * @private\n */\nRectangleCollisionChecker.prototype.remove = function (id, rectangle) {\n const withId = RectangleWithId.fromRectangleAndId(\n id,\n rectangle,\n removalScratch\n );\n this._tree.remove(withId, idCompare);\n};\n\nconst collisionScratch = new RectangleWithId();\n/**\n * Checks if a given rectangle collides with any of the rectangles in the collection.\n *\n * @param {Rectangle} rectangle A Rectangle that should be checked against the rectangles in the collision checker.\n * @returns {Boolean} Whether the rectangle collides with any of the rectangles in the collision checker.\n */\nRectangleCollisionChecker.prototype.collides = function (rectangle) {\n const withId = RectangleWithId.fromRectangleAndId(\n \"\",\n rectangle,\n collisionScratch\n );\n return this._tree.collides(withId);\n};\nexport default RectangleCollisionChecker;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\nimport RectangleCollisionChecker from \"../Core/RectangleCollisionChecker.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\nfunction Batch(primitives, classificationType, color, zIndex) {\n this.primitives = primitives;\n this.zIndex = zIndex;\n this.classificationType = classificationType;\n this.color = color;\n this.createPrimitive = false;\n this.waitingOnCreate = false;\n this.primitive = undefined;\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.updaters = new AssociativeArray();\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n this.itemsToRemove = [];\n this.isDirty = false;\n this.rectangleCollisionCheck = new RectangleCollisionChecker();\n}\n\nBatch.prototype.overlapping = function (rectangle) {\n return this.rectangleCollisionCheck.collides(rectangle);\n};\n\nBatch.prototype.add = function (updater, instance) {\n const id = updater.id;\n this.createPrimitive = true;\n this.geometry.set(id, instance);\n this.updaters.set(id, updater);\n this.rectangleCollisionCheck.insert(id, instance.geometry.rectangle);\n if (\n !updater.hasConstantFill ||\n !updater.fillMaterialProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n const geometryInstance = this.geometry.get(id);\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.rectangleCollisionCheck.remove(\n id,\n geometryInstance.geometry.rectangle\n );\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n this.showsUpdated.remove(id);\n }\n return true;\n }\n return false;\n};\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n const removedCount = 0;\n let primitive = this.primitive;\n const primitives = this.primitives;\n let i;\n\n if (this.createPrimitive) {\n const geometries = this.geometry.values;\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n primitives.remove(primitive);\n }\n }\n\n primitive = new GroundPrimitive({\n show: false,\n asynchronous: true,\n geometryInstances: geometries.slice(),\n classificationType: this.classificationType,\n });\n primitives.add(primitive, this.zIndex);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n primitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n this.waitingOnCreate = true;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n primitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n const waitingOnCreate = this.waitingOnCreate;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {\n const colorProperty = updater.fillMaterialProperty.color;\n const fillColor = Property.getValueOrDefault(\n colorProperty,\n time,\n Color.WHITE,\n colorScratch\n );\n\n if (!Color.equals(attributes._lastColor, fillColor)) {\n attributes._lastColor = Color.clone(fillColor, attributes._lastColor);\n attributes.color = ColorGeometryInstanceAttribute.toValue(\n fillColor,\n attributes.color\n );\n }\n }\n\n const show =\n updater.entity.isShowing &&\n (updater.hasConstantFill || updater.isFilled(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n }\n\n this.updateShows(primitive);\n this.waitingOnCreate = false;\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n this.itemsToRemove.length = removedCount;\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = updater.entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n\n const bs = primitive.getBoundingSphere(updater.entity);\n if (!defined(bs)) {\n return BoundingSphereState.FAILED;\n }\n\n bs.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.removeAllPrimitives = function () {\n const primitives = this.primitives;\n\n const primitive = this.primitive;\n if (defined(primitive)) {\n primitives.remove(primitive);\n this.primitive = undefined;\n this.geometry.removeAll();\n this.updaters.removeAll();\n }\n\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n};\n\n/**\n * @private\n */\nfunction StaticGroundGeometryColorBatch(primitives, classificationType) {\n this._batches = [];\n this._primitives = primitives;\n this._classificationType = classificationType;\n}\n\nStaticGroundGeometryColorBatch.prototype.add = function (time, updater) {\n const instance = updater.createFillGeometryInstance(time);\n const batches = this._batches;\n const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n let batch;\n const length = batches.length;\n for (let i = 0; i < length; ++i) {\n const item = batches[i];\n if (\n item.zIndex === zIndex &&\n !item.overlapping(instance.geometry.rectangle)\n ) {\n batch = item;\n break;\n }\n }\n\n if (!defined(batch)) {\n batch = new Batch(\n this._primitives,\n this._classificationType,\n instance.attributes.color.value,\n zIndex\n );\n batches.push(batch);\n }\n batch.add(updater, instance);\n return batch;\n};\n\nStaticGroundGeometryColorBatch.prototype.remove = function (updater) {\n const batches = this._batches;\n const count = batches.length;\n for (let i = 0; i < count; ++i) {\n if (batches[i].remove(updater)) {\n return;\n }\n }\n};\n\nStaticGroundGeometryColorBatch.prototype.update = function (time) {\n let i;\n let updater;\n\n //Perform initial update\n let isUpdated = true;\n const batches = this._batches;\n const batchCount = batches.length;\n for (i = 0; i < batchCount; ++i) {\n isUpdated = batches[i].update(time) && isUpdated;\n }\n\n //If any items swapped between batches we need to move them\n for (i = 0; i < batchCount; ++i) {\n const oldBatch = batches[i];\n const itemsToRemove = oldBatch.itemsToRemove;\n const itemsToMoveLength = itemsToRemove.length;\n for (let j = 0; j < itemsToMoveLength; j++) {\n updater = itemsToRemove[j];\n oldBatch.remove(updater);\n const newBatch = this.add(time, updater);\n oldBatch.isDirty = true;\n newBatch.isDirty = true;\n }\n }\n\n //If we moved anything around, we need to re-build the primitive and remove empty batches\n for (i = batchCount - 1; i >= 0; --i) {\n const batch = batches[i];\n if (batch.isDirty) {\n isUpdated = batches[i].update(time) && isUpdated;\n batch.isDirty = false;\n }\n if (batch.geometry.length === 0) {\n batches.splice(i, 1);\n }\n }\n\n return isUpdated;\n};\n\nStaticGroundGeometryColorBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n const batches = this._batches;\n const batchCount = batches.length;\n for (let i = 0; i < batchCount; ++i) {\n const batch = batches[i];\n if (batch.contains(updater)) {\n return batch.getBoundingSphere(updater, result);\n }\n }\n\n return BoundingSphereState.FAILED;\n};\n\nStaticGroundGeometryColorBatch.prototype.removeAllPrimitives = function () {\n const batches = this._batches;\n const batchCount = batches.length;\n for (let i = 0; i < batchCount; ++i) {\n batches[i].removeAllPrimitives();\n }\n};\nexport default StaticGroundGeometryColorBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport RectangleCollisionChecker from \"../Core/RectangleCollisionChecker.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport ShadowVolumeAppearance from \"../Scene/ShadowVolumeAppearance.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\n// Encapsulates a Primitive and all the entities that it represents.\nfunction Batch(\n primitives,\n classificationType,\n appearanceType,\n materialProperty,\n usingSphericalTextureCoordinates,\n zIndex\n) {\n this.primitives = primitives; // scene level primitive collection\n this.classificationType = classificationType;\n this.appearanceType = appearanceType;\n this.materialProperty = materialProperty;\n this.updaters = new AssociativeArray();\n this.createPrimitive = true;\n this.primitive = undefined; // a GroundPrimitive encapsulating all the entities\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.material = undefined;\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.invalidated = false;\n this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n Batch.prototype.onMaterialChanged,\n this\n );\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n this.usingSphericalTextureCoordinates = usingSphericalTextureCoordinates;\n this.zIndex = zIndex;\n this.rectangleCollisionCheck = new RectangleCollisionChecker();\n}\n\nBatch.prototype.onMaterialChanged = function () {\n this.invalidated = true;\n};\n\nBatch.prototype.overlapping = function (rectangle) {\n return this.rectangleCollisionCheck.collides(rectangle);\n};\n\n// Check if the given updater's material is compatible with this batch\nBatch.prototype.isMaterial = function (updater) {\n const material = this.materialProperty;\n const updaterMaterial = updater.fillMaterialProperty;\n\n if (\n updaterMaterial === material ||\n (updaterMaterial instanceof ColorMaterialProperty &&\n material instanceof ColorMaterialProperty)\n ) {\n return true;\n }\n return defined(material) && material.equals(updaterMaterial);\n};\n\nBatch.prototype.add = function (time, updater, geometryInstance) {\n const id = updater.id;\n this.updaters.set(id, updater);\n this.geometry.set(id, geometryInstance);\n this.rectangleCollisionCheck.insert(id, geometryInstance.geometry.rectangle);\n // Updaters with dynamic attributes must be tracked separately, may exit the batch\n if (\n !updater.hasConstantFill ||\n !updater.fillMaterialProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n // Listen for show changes. These will be synchronized in updateShows.\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n const geometryInstance = this.geometry.get(id);\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.rectangleCollisionCheck.remove(\n id,\n geometryInstance.geometry.rectangle\n );\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n }\n return true;\n }\n return false;\n};\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n let primitive = this.primitive;\n const primitives = this.primitives;\n const geometries = this.geometry.values;\n let i;\n\n if (this.createPrimitive) {\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n // Keep a handle to the old primitive so it can be removed when the updated version is ready.\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n // For if the new primitive changes again before it is ready.\n primitives.remove(primitive);\n }\n }\n\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n\n primitive = new GroundPrimitive({\n show: false,\n asynchronous: true,\n geometryInstances: geometries.slice(),\n appearance: new this.appearanceType({\n material: this.material,\n // translucent and closed properties overridden\n }),\n classificationType: this.classificationType,\n });\n\n primitives.add(primitive, this.zIndex);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n primitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n primitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n this.primitive.appearance.material = this.material;\n\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show =\n entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n }\n\n this.updateShows(primitive);\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n if (\n !defined(attributes) ||\n !defined(attributes.boundingSphere) ||\n (defined(attributes.show) && attributes.show[0] === 0)\n ) {\n return BoundingSphereState.FAILED;\n }\n attributes.boundingSphere.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n const primitive = this.primitive;\n const primitives = this.primitives;\n if (defined(primitive)) {\n primitives.remove(primitive);\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n }\n this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGroundGeometryPerMaterialBatch(\n primitives,\n classificationType,\n appearanceType\n) {\n this._items = [];\n this._primitives = primitives;\n this._classificationType = classificationType;\n this._appearanceType = appearanceType;\n}\n\nStaticGroundGeometryPerMaterialBatch.prototype.add = function (time, updater) {\n const items = this._items;\n const length = items.length;\n const geometryInstance = updater.createFillGeometryInstance(time);\n const usingSphericalTextureCoordinates = ShadowVolumeAppearance.shouldUseSphericalCoordinates(\n geometryInstance.geometry.rectangle\n );\n const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n // Check if the Entity represented by the updater can be placed in an existing batch. Requirements:\n // * compatible material (same material or same color)\n // * same type of texture coordinates (spherical vs. planar)\n // * conservatively non-overlapping with any entities in the existing batch\n for (let i = 0; i < length; ++i) {\n const item = items[i];\n if (\n item.isMaterial(updater) &&\n item.usingSphericalTextureCoordinates ===\n usingSphericalTextureCoordinates &&\n item.zIndex === zIndex &&\n !item.overlapping(geometryInstance.geometry.rectangle)\n ) {\n item.add(time, updater, geometryInstance);\n return;\n }\n }\n // If a compatible batch wasn't found, create a new batch.\n const batch = new Batch(\n this._primitives,\n this._classificationType,\n this._appearanceType,\n updater.fillMaterialProperty,\n usingSphericalTextureCoordinates,\n zIndex\n );\n batch.add(time, updater, geometryInstance);\n items.push(batch);\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.remove = function (updater) {\n const items = this._items;\n const length = items.length;\n for (let i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.remove(updater)) {\n if (item.updaters.length === 0) {\n items.splice(i, 1);\n item.destroy();\n }\n break;\n }\n }\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.update = function (time) {\n let i;\n const items = this._items;\n const length = items.length;\n\n for (i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.invalidated) {\n items.splice(i, 1);\n const updaters = item.updaters.values;\n const updatersLength = updaters.length;\n for (let h = 0; h < updatersLength; h++) {\n this.add(time, updaters[h]);\n }\n item.destroy();\n }\n }\n\n let isUpdated = true;\n for (i = 0; i < items.length; i++) {\n isUpdated = items[i].update(time) && isUpdated;\n }\n return isUpdated;\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.contains(updater)) {\n return item.getBoundingSphere(updater, result);\n }\n }\n return BoundingSphereState.FAILED;\n};\n\nStaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives = function () {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n items[i].destroy();\n }\n this._items.length = 0;\n};\nexport default StaticGroundGeometryPerMaterialBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport Primitive from \"../Scene/Primitive.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst colorScratch = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\nconst defaultOffset = Cartesian3.ZERO;\nconst offsetScratch = new Cartesian3();\n\nfunction Batch(primitives, translucent, width, shadows) {\n this.translucent = translucent;\n this.width = width;\n this.shadows = shadows;\n this.primitives = primitives;\n this.createPrimitive = false;\n this.waitingOnCreate = false;\n this.primitive = undefined;\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.updaters = new AssociativeArray();\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.itemsToRemove = [];\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n}\nBatch.prototype.add = function (updater, instance) {\n const id = updater.id;\n this.createPrimitive = true;\n this.geometry.set(id, instance);\n this.updaters.set(id, updater);\n if (\n !updater.hasConstantOutline ||\n !updater.outlineColorProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty) ||\n !Property.isConstant(updater.terrainOffsetProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n this.showsUpdated.remove(id);\n }\n return true;\n }\n return false;\n};\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n let removedCount = 0;\n let primitive = this.primitive;\n const primitives = this.primitives;\n let i;\n\n if (this.createPrimitive) {\n const geometries = this.geometry.values;\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n primitives.remove(primitive);\n }\n }\n\n primitive = new Primitive({\n show: false,\n asynchronous: true,\n geometryInstances: geometries.slice(),\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: this.translucent,\n renderState: {\n lineWidth: this.width,\n },\n }),\n shadows: this.shadows,\n });\n\n primitives.add(primitive);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n primitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n this.waitingOnCreate = true;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n primitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n const waitingOnCreate = this.waitingOnCreate;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n if (!updater.outlineColorProperty.isConstant || waitingOnCreate) {\n const outlineColorProperty = updater.outlineColorProperty;\n const outlineColor = Property.getValueOrDefault(\n outlineColorProperty,\n time,\n Color.WHITE,\n colorScratch\n );\n if (!Color.equals(attributes._lastColor, outlineColor)) {\n attributes._lastColor = Color.clone(\n outlineColor,\n attributes._lastColor\n );\n attributes.color = ColorGeometryInstanceAttribute.toValue(\n outlineColor,\n attributes.color\n );\n if (\n (this.translucent && attributes.color[3] === 255) ||\n (!this.translucent && attributes.color[3] !== 255)\n ) {\n this.itemsToRemove[removedCount++] = updater;\n }\n }\n }\n\n const show =\n updater.entity.isShowing &&\n (updater.hasConstantOutline || updater.isOutlineVisible(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n\n const offsetProperty = updater.terrainOffsetProperty;\n if (!Property.isConstant(offsetProperty)) {\n const offset = Property.getValueOrDefault(\n offsetProperty,\n time,\n defaultOffset,\n offsetScratch\n );\n if (!Cartesian3.equals(offset, attributes._lastOffset)) {\n attributes._lastOffset = Cartesian3.clone(\n offset,\n attributes._lastOffset\n );\n attributes.offset = OffsetGeometryInstanceAttribute.toValue(\n offset,\n attributes.offset\n );\n }\n }\n }\n\n this.updateShows(primitive);\n this.waitingOnCreate = false;\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n\n this.itemsToRemove.length = removedCount;\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = updater.entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n if (\n !defined(attributes) ||\n !defined(attributes.boundingSphere) || //\n (defined(attributes.show) && attributes.show[0] === 0)\n ) {\n return BoundingSphereState.FAILED;\n }\n attributes.boundingSphere.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.removeAllPrimitives = function () {\n const primitives = this.primitives;\n\n const primitive = this.primitive;\n if (defined(primitive)) {\n primitives.remove(primitive);\n this.primitive = undefined;\n this.geometry.removeAll();\n this.updaters.removeAll();\n }\n\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n primitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n};\n\n/**\n * @private\n */\nfunction StaticOutlineGeometryBatch(primitives, scene, shadows) {\n this._primitives = primitives;\n this._scene = scene;\n this._shadows = shadows;\n this._solidBatches = new AssociativeArray();\n this._translucentBatches = new AssociativeArray();\n}\nStaticOutlineGeometryBatch.prototype.add = function (time, updater) {\n const instance = updater.createOutlineGeometryInstance(time);\n const width = this._scene.clampLineWidth(updater.outlineWidth);\n let batches;\n let batch;\n if (instance.attributes.color.value[3] === 255) {\n batches = this._solidBatches;\n batch = batches.get(width);\n if (!defined(batch)) {\n batch = new Batch(this._primitives, false, width, this._shadows);\n batches.set(width, batch);\n }\n batch.add(updater, instance);\n } else {\n batches = this._translucentBatches;\n batch = batches.get(width);\n if (!defined(batch)) {\n batch = new Batch(this._primitives, true, width, this._shadows);\n batches.set(width, batch);\n }\n batch.add(updater, instance);\n }\n};\n\nStaticOutlineGeometryBatch.prototype.remove = function (updater) {\n let i;\n\n const solidBatches = this._solidBatches.values;\n const solidBatchesLength = solidBatches.length;\n for (i = 0; i < solidBatchesLength; i++) {\n if (solidBatches[i].remove(updater)) {\n return;\n }\n }\n\n const translucentBatches = this._translucentBatches.values;\n const translucentBatchesLength = translucentBatches.length;\n for (i = 0; i < translucentBatchesLength; i++) {\n if (translucentBatches[i].remove(updater)) {\n return;\n }\n }\n};\n\nStaticOutlineGeometryBatch.prototype.update = function (time) {\n let i;\n let x;\n let updater;\n let batch;\n const solidBatches = this._solidBatches.values;\n const solidBatchesLength = solidBatches.length;\n const translucentBatches = this._translucentBatches.values;\n const translucentBatchesLength = translucentBatches.length;\n let itemsToRemove;\n let isUpdated = true;\n let needUpdate = false;\n\n do {\n needUpdate = false;\n for (x = 0; x < solidBatchesLength; x++) {\n batch = solidBatches[x];\n //Perform initial update\n isUpdated = batch.update(time);\n\n //If any items swapped between solid/translucent, we need to\n //move them between batches\n itemsToRemove = batch.itemsToRemove;\n const solidsToMoveLength = itemsToRemove.length;\n if (solidsToMoveLength > 0) {\n needUpdate = true;\n for (i = 0; i < solidsToMoveLength; i++) {\n updater = itemsToRemove[i];\n batch.remove(updater);\n this.add(time, updater);\n }\n }\n }\n for (x = 0; x < translucentBatchesLength; x++) {\n batch = translucentBatches[x];\n //Perform initial update\n isUpdated = batch.update(time);\n\n //If any items swapped between solid/translucent, we need to\n //move them between batches\n itemsToRemove = batch.itemsToRemove;\n const translucentToMoveLength = itemsToRemove.length;\n if (translucentToMoveLength > 0) {\n needUpdate = true;\n for (i = 0; i < translucentToMoveLength; i++) {\n updater = itemsToRemove[i];\n batch.remove(updater);\n this.add(time, updater);\n }\n }\n }\n } while (needUpdate);\n\n return isUpdated;\n};\n\nStaticOutlineGeometryBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n let i;\n\n const solidBatches = this._solidBatches.values;\n const solidBatchesLength = solidBatches.length;\n for (i = 0; i < solidBatchesLength; i++) {\n const solidBatch = solidBatches[i];\n if (solidBatch.contains(updater)) {\n return solidBatch.getBoundingSphere(updater, result);\n }\n }\n\n const translucentBatches = this._translucentBatches.values;\n const translucentBatchesLength = translucentBatches.length;\n for (i = 0; i < translucentBatchesLength; i++) {\n const translucentBatch = translucentBatches[i];\n if (translucentBatch.contains(updater)) {\n return translucentBatch.getBoundingSphere(updater, result);\n }\n }\n\n return BoundingSphereState.FAILED;\n};\n\nStaticOutlineGeometryBatch.prototype.removeAllPrimitives = function () {\n let i;\n\n const solidBatches = this._solidBatches.values;\n const solidBatchesLength = solidBatches.length;\n for (i = 0; i < solidBatchesLength; i++) {\n solidBatches[i].removeAllPrimitives();\n }\n\n const translucentBatches = this._translucentBatches.values;\n const translucentBatchesLength = translucentBatches.length;\n for (i = 0; i < translucentBatchesLength; i++) {\n translucentBatches[i].removeAllPrimitives();\n }\n};\nexport default StaticOutlineGeometryBatch;\n", "import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\n\n/**\n * @private\n */\nconst WallGeometryLibrary = {};\n\nfunction latLonEquals(c0, c1) {\n return (\n CesiumMath.equalsEpsilon(c0.latitude, c1.latitude, CesiumMath.EPSILON10) &&\n CesiumMath.equalsEpsilon(c0.longitude, c1.longitude, CesiumMath.EPSILON10)\n );\n}\n\nconst scratchCartographic1 = new Cartographic();\nconst scratchCartographic2 = new Cartographic();\nfunction removeDuplicates(ellipsoid, positions, topHeights, bottomHeights) {\n positions = arrayRemoveDuplicates(positions, Cartesian3.equalsEpsilon);\n\n const length = positions.length;\n if (length < 2) {\n return;\n }\n\n const hasBottomHeights = defined(bottomHeights);\n const hasTopHeights = defined(topHeights);\n\n const cleanedPositions = new Array(length);\n const cleanedTopHeights = new Array(length);\n const cleanedBottomHeights = new Array(length);\n\n const v0 = positions[0];\n cleanedPositions[0] = v0;\n\n const c0 = ellipsoid.cartesianToCartographic(v0, scratchCartographic1);\n if (hasTopHeights) {\n c0.height = topHeights[0];\n }\n\n cleanedTopHeights[0] = c0.height;\n\n if (hasBottomHeights) {\n cleanedBottomHeights[0] = bottomHeights[0];\n } else {\n cleanedBottomHeights[0] = 0.0;\n }\n\n const startTopHeight = cleanedTopHeights[0];\n const startBottomHeight = cleanedBottomHeights[0];\n let hasAllSameHeights = startTopHeight === startBottomHeight;\n\n let index = 1;\n for (let i = 1; i < length; ++i) {\n const v1 = positions[i];\n const c1 = ellipsoid.cartesianToCartographic(v1, scratchCartographic2);\n if (hasTopHeights) {\n c1.height = topHeights[i];\n }\n hasAllSameHeights = hasAllSameHeights && c1.height === 0;\n\n if (!latLonEquals(c0, c1)) {\n cleanedPositions[index] = v1; // Shallow copy!\n cleanedTopHeights[index] = c1.height;\n\n if (hasBottomHeights) {\n cleanedBottomHeights[index] = bottomHeights[i];\n } else {\n cleanedBottomHeights[index] = 0.0;\n }\n hasAllSameHeights =\n hasAllSameHeights &&\n cleanedTopHeights[index] === cleanedBottomHeights[index];\n\n Cartographic.clone(c1, c0);\n ++index;\n } else if (c0.height < c1.height) {\n // two adjacent positions are the same, so use whichever has the greater height\n cleanedTopHeights[index - 1] = c1.height;\n }\n }\n\n if (hasAllSameHeights || index < 2) {\n return;\n }\n\n cleanedPositions.length = index;\n cleanedTopHeights.length = index;\n cleanedBottomHeights.length = index;\n\n return {\n positions: cleanedPositions,\n topHeights: cleanedTopHeights,\n bottomHeights: cleanedBottomHeights,\n };\n}\n\nconst positionsArrayScratch = new Array(2);\nconst heightsArrayScratch = new Array(2);\nconst generateArcOptionsScratch = {\n positions: undefined,\n height: undefined,\n granularity: undefined,\n ellipsoid: undefined,\n};\n\n/**\n * @private\n */\nWallGeometryLibrary.computePositions = function (\n ellipsoid,\n wallPositions,\n maximumHeights,\n minimumHeights,\n granularity,\n duplicateCorners\n) {\n const o = removeDuplicates(\n ellipsoid,\n wallPositions,\n maximumHeights,\n minimumHeights\n );\n\n if (!defined(o)) {\n return;\n }\n\n wallPositions = o.positions;\n maximumHeights = o.topHeights;\n minimumHeights = o.bottomHeights;\n\n const length = wallPositions.length;\n const numCorners = length - 2;\n let topPositions;\n let bottomPositions;\n\n const minDistance = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n\n const generateArcOptions = generateArcOptionsScratch;\n generateArcOptions.minDistance = minDistance;\n generateArcOptions.ellipsoid = ellipsoid;\n\n if (duplicateCorners) {\n let count = 0;\n let i;\n\n for (i = 0; i < length - 1; i++) {\n count +=\n PolylinePipeline.numberOfPoints(\n wallPositions[i],\n wallPositions[i + 1],\n minDistance\n ) + 1;\n }\n\n topPositions = new Float64Array(count * 3);\n bottomPositions = new Float64Array(count * 3);\n\n const generateArcPositions = positionsArrayScratch;\n const generateArcHeights = heightsArrayScratch;\n generateArcOptions.positions = generateArcPositions;\n generateArcOptions.height = generateArcHeights;\n\n let offset = 0;\n for (i = 0; i < length - 1; i++) {\n generateArcPositions[0] = wallPositions[i];\n generateArcPositions[1] = wallPositions[i + 1];\n\n generateArcHeights[0] = maximumHeights[i];\n generateArcHeights[1] = maximumHeights[i + 1];\n\n const pos = PolylinePipeline.generateArc(generateArcOptions);\n topPositions.set(pos, offset);\n\n generateArcHeights[0] = minimumHeights[i];\n generateArcHeights[1] = minimumHeights[i + 1];\n\n bottomPositions.set(\n PolylinePipeline.generateArc(generateArcOptions),\n offset\n );\n\n offset += pos.length;\n }\n } else {\n generateArcOptions.positions = wallPositions;\n generateArcOptions.height = maximumHeights;\n topPositions = new Float64Array(\n PolylinePipeline.generateArc(generateArcOptions)\n );\n\n generateArcOptions.height = minimumHeights;\n bottomPositions = new Float64Array(\n PolylinePipeline.generateArc(generateArcOptions)\n );\n }\n\n return {\n bottomPositions: bottomPositions,\n topPositions: topPositions,\n numCorners: numCorners,\n };\n};\nexport default WallGeometryLibrary;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\n\nconst scratchCartesian3Position1 = new Cartesian3();\nconst scratchCartesian3Position2 = new Cartesian3();\nconst scratchCartesian3Position4 = new Cartesian3();\nconst scratchCartesian3Position5 = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n\n/**\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @alias WallGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number[]} [options.maximumHeights] An array parallel to <code>positions</code> that give the maximum height of the\n * wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {Number[]} [options.minimumHeights] An array parallel to <code>positions</code> that give the minimum height of the\n * wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\n *\n * @see WallGeometry#createGeometry\n * @see WallGeometry#fromConstantHeight\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}\n *\n * @example\n * // create a wall that spans from ground level to 10000 meters\n * const wall = new Cesium.WallGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n * 19.0, 47.0, 10000.0,\n * 19.0, 48.0, 10000.0,\n * 20.0, 48.0, 10000.0,\n * 20.0, 47.0, 10000.0,\n * 19.0, 47.0, 10000.0\n * ])\n * });\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\n */\nfunction WallGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const wallPositions = options.positions;\n const maximumHeights = options.maximumHeights;\n const minimumHeights = options.minimumHeights;\n\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n this._positions = wallPositions;\n this._minimumHeights = minimumHeights;\n this._maximumHeights = maximumHeights;\n this._vertexFormat = VertexFormat.clone(vertexFormat);\n this._granularity = granularity;\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._workerName = \"createWallGeometry\";\n\n let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\n if (defined(minimumHeights)) {\n numComponents += minimumHeights.length;\n }\n if (defined(maximumHeights)) {\n numComponents += maximumHeights.length;\n }\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 1;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {WallGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nWallGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const minimumHeights = value._minimumHeights;\n length = defined(minimumHeights) ? minimumHeights.length : 0;\n array[startingIndex++] = length;\n\n if (defined(minimumHeights)) {\n for (i = 0; i < length; ++i) {\n array[startingIndex++] = minimumHeights[i];\n }\n }\n\n const maximumHeights = value._maximumHeights;\n length = defined(maximumHeights) ? maximumHeights.length : 0;\n array[startingIndex++] = length;\n\n if (defined(maximumHeights)) {\n for (i = 0; i < length; ++i) {\n array[startingIndex++] = maximumHeights[i];\n }\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n positions: undefined,\n minimumHeights: undefined,\n maximumHeights: undefined,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {WallGeometry} [result] The object into which to store the result.\n * @returns {WallGeometry} The modified result parameter or a new WallGeometry instance if one was not provided.\n */\nWallGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n let minimumHeights;\n\n if (length > 0) {\n minimumHeights = new Array(length);\n for (i = 0; i < length; ++i) {\n minimumHeights[i] = array[startingIndex++];\n }\n }\n\n length = array[startingIndex++];\n let maximumHeights;\n\n if (length > 0) {\n maximumHeights = new Array(length);\n for (i = 0; i < length; ++i) {\n maximumHeights[i] = array[startingIndex++];\n }\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.positions = positions;\n scratchOptions.minimumHeights = minimumHeights;\n scratchOptions.maximumHeights = maximumHeights;\n scratchOptions.granularity = granularity;\n return new WallGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._minimumHeights = minimumHeights;\n result._maximumHeights = maximumHeights;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._granularity = granularity;\n\n return result;\n};\n\n/**\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the\n * wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the\n * wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @returns {WallGeometry}\n *\n *\n * @example\n * // create a wall that spans from 10000 meters to 20000 meters\n * const wall = Cesium.WallGeometry.fromConstantHeights({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 19.0, 47.0,\n * 19.0, 48.0,\n * 20.0, 48.0,\n * 20.0, 47.0,\n * 19.0, 47.0,\n * ]),\n * minimumHeight : 20000.0,\n * maximumHeight : 10000.0\n * });\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\n *\n * @see WallGeometry#createGeometry\n */\nWallGeometry.fromConstantHeights = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n\n let minHeights;\n let maxHeights;\n\n const min = options.minimumHeight;\n const max = options.maximumHeight;\n\n const doMin = defined(min);\n const doMax = defined(max);\n if (doMin || doMax) {\n const length = positions.length;\n minHeights = doMin ? new Array(length) : undefined;\n maxHeights = doMax ? new Array(length) : undefined;\n\n for (let i = 0; i < length; ++i) {\n if (doMin) {\n minHeights[i] = min;\n }\n\n if (doMax) {\n maxHeights[i] = max;\n }\n }\n }\n\n const newOptions = {\n positions: positions,\n maximumHeights: maxHeights,\n minimumHeights: minHeights,\n ellipsoid: options.ellipsoid,\n vertexFormat: options.vertexFormat,\n };\n return new WallGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.\n *\n * @param {WallGeometry} wallGeometry A description of the wall.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nWallGeometry.createGeometry = function (wallGeometry) {\n const wallPositions = wallGeometry._positions;\n const minimumHeights = wallGeometry._minimumHeights;\n const maximumHeights = wallGeometry._maximumHeights;\n const vertexFormat = wallGeometry._vertexFormat;\n const granularity = wallGeometry._granularity;\n const ellipsoid = wallGeometry._ellipsoid;\n\n const pos = WallGeometryLibrary.computePositions(\n ellipsoid,\n wallPositions,\n maximumHeights,\n minimumHeights,\n granularity,\n true\n );\n if (!defined(pos)) {\n return;\n }\n\n const bottomPositions = pos.bottomPositions;\n const topPositions = pos.topPositions;\n const numCorners = pos.numCorners;\n\n let length = topPositions.length;\n let size = length * 2;\n\n const positions = vertexFormat.position ? new Float64Array(size) : undefined;\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size)\n : undefined;\n const textureCoordinates = vertexFormat.st\n ? new Float32Array((size / 3) * 2)\n : undefined;\n\n let positionIndex = 0;\n let normalIndex = 0;\n let bitangentIndex = 0;\n let tangentIndex = 0;\n let stIndex = 0;\n\n // add lower and upper points one after the other, lower\n // points being even and upper points being odd\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n let recomputeNormal = true;\n length /= 3;\n let i;\n let s = 0;\n const ds = 1 / (length - numCorners - 1);\n for (i = 0; i < length; ++i) {\n const i3 = i * 3;\n const topPosition = Cartesian3.fromArray(\n topPositions,\n i3,\n scratchCartesian3Position1\n );\n const bottomPosition = Cartesian3.fromArray(\n bottomPositions,\n i3,\n scratchCartesian3Position2\n );\n if (vertexFormat.position) {\n // insert the lower point\n positions[positionIndex++] = bottomPosition.x;\n positions[positionIndex++] = bottomPosition.y;\n positions[positionIndex++] = bottomPosition.z;\n\n // insert the upper point\n positions[positionIndex++] = topPosition.x;\n positions[positionIndex++] = topPosition.y;\n positions[positionIndex++] = topPosition.z;\n }\n\n if (vertexFormat.st) {\n textureCoordinates[stIndex++] = s;\n textureCoordinates[stIndex++] = 0.0;\n\n textureCoordinates[stIndex++] = s;\n textureCoordinates[stIndex++] = 1.0;\n }\n\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\n let nextTop = Cartesian3.clone(\n Cartesian3.ZERO,\n scratchCartesian3Position5\n );\n const groundPosition = Cartesian3.subtract(\n topPosition,\n ellipsoid.geodeticSurfaceNormal(\n topPosition,\n scratchCartesian3Position2\n ),\n scratchCartesian3Position2\n );\n if (i + 1 < length) {\n nextTop = Cartesian3.fromArray(\n topPositions,\n i3 + 3,\n scratchCartesian3Position5\n );\n }\n\n if (recomputeNormal) {\n const scalednextPosition = Cartesian3.subtract(\n nextTop,\n topPosition,\n scratchCartesian3Position4\n );\n const scaledGroundPosition = Cartesian3.subtract(\n groundPosition,\n topPosition,\n scratchCartesian3Position1\n );\n normal = Cartesian3.normalize(\n Cartesian3.cross(scaledGroundPosition, scalednextPosition, normal),\n normal\n );\n recomputeNormal = false;\n }\n\n if (\n Cartesian3.equalsEpsilon(topPosition, nextTop, CesiumMath.EPSILON10)\n ) {\n recomputeNormal = true;\n } else {\n s += ds;\n if (vertexFormat.tangent) {\n tangent = Cartesian3.normalize(\n Cartesian3.subtract(nextTop, topPosition, tangent),\n tangent\n );\n }\n if (vertexFormat.bitangent) {\n bitangent = Cartesian3.normalize(\n Cartesian3.cross(normal, tangent, bitangent),\n bitangent\n );\n }\n }\n\n if (vertexFormat.normal) {\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n\n normals[normalIndex++] = normal.x;\n normals[normalIndex++] = normal.y;\n normals[normalIndex++] = normal.z;\n }\n\n if (vertexFormat.tangent) {\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n\n tangents[tangentIndex++] = tangent.x;\n tangents[tangentIndex++] = tangent.y;\n tangents[tangentIndex++] = tangent.z;\n }\n\n if (vertexFormat.bitangent) {\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n\n bitangents[bitangentIndex++] = bitangent.x;\n bitangents[bitangentIndex++] = bitangent.y;\n bitangents[bitangentIndex++] = bitangent.z;\n }\n }\n }\n\n const attributes = new GeometryAttributes();\n\n if (vertexFormat.position) {\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n });\n }\n\n if (vertexFormat.normal) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n\n if (vertexFormat.tangent) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n\n if (vertexFormat.bitangent) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: textureCoordinates,\n });\n }\n\n // prepare the side walls, two triangles for each wall\n //\n // A (i+1) B (i+3) E\n // +--------+-------+\n // | / | /| triangles: A C B\n // | / | / | B C D\n // | / | / |\n // | / | / |\n // | / | / |\n // | / | / |\n // +--------+-------+\n // C (i) D (i+2) F\n //\n\n const numVertices = size / 3;\n size -= 6 * (numCorners + 1);\n const indices = IndexDatatype.createTypedArray(numVertices, size);\n\n let edgeIndex = 0;\n for (i = 0; i < numVertices - 2; i += 2) {\n const LL = i;\n const LR = i + 2;\n const pl = Cartesian3.fromArray(\n positions,\n LL * 3,\n scratchCartesian3Position1\n );\n const pr = Cartesian3.fromArray(\n positions,\n LR * 3,\n scratchCartesian3Position2\n );\n if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\n continue;\n }\n const UL = i + 1;\n const UR = i + 3;\n\n indices[edgeIndex++] = UL;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = UR;\n indices[edgeIndex++] = UR;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = LR;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: new BoundingSphere.fromVertices(positions),\n });\n};\nexport default WallGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\n\nconst scratchCartesian3Position1 = new Cartesian3();\nconst scratchCartesian3Position2 = new Cartesian3();\n\n/**\n * A description of a wall outline. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @alias WallOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\n * @param {Number[]} [options.maximumHeights] An array parallel to <code>positions</code> that give the maximum height of the\n * wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {Number[]} [options.minimumHeights] An array parallel to <code>positions</code> that give the minimum height of the\n * wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n *\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\n *\n * @see WallGeometry#createGeometry\n * @see WallGeometry#fromConstantHeight\n *\n * @example\n * // create a wall outline that spans from ground level to 10000 meters\n * const wall = new Cesium.WallOutlineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\n * 19.0, 47.0, 10000.0,\n * 19.0, 48.0, 10000.0,\n * 20.0, 48.0, 10000.0,\n * 20.0, 47.0, 10000.0,\n * 19.0, 47.0, 10000.0\n * ])\n * });\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\n */\nfunction WallOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const wallPositions = options.positions;\n const maximumHeights = options.maximumHeights;\n const minimumHeights = options.minimumHeights;\n\n const granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n this._positions = wallPositions;\n this._minimumHeights = minimumHeights;\n this._maximumHeights = maximumHeights;\n this._granularity = granularity;\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\n this._workerName = \"createWallOutlineGeometry\";\n\n let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\n if (defined(minimumHeights)) {\n numComponents += minimumHeights.length;\n }\n if (defined(maximumHeights)) {\n numComponents += maximumHeights.length;\n }\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength = numComponents + Ellipsoid.packedLength + 1;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {WallOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nWallOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const minimumHeights = value._minimumHeights;\n length = defined(minimumHeights) ? minimumHeights.length : 0;\n array[startingIndex++] = length;\n\n if (defined(minimumHeights)) {\n for (i = 0; i < length; ++i) {\n array[startingIndex++] = minimumHeights[i];\n }\n }\n\n const maximumHeights = value._maximumHeights;\n length = defined(maximumHeights) ? maximumHeights.length : 0;\n array[startingIndex++] = length;\n\n if (defined(maximumHeights)) {\n for (i = 0; i < length; ++i) {\n array[startingIndex++] = maximumHeights[i];\n }\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchOptions = {\n positions: undefined,\n minimumHeights: undefined,\n maximumHeights: undefined,\n ellipsoid: scratchEllipsoid,\n granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {WallOutlineGeometry} [result] The object into which to store the result.\n * @returns {WallOutlineGeometry} The modified result parameter or a new WallOutlineGeometry instance if one was not provided.\n */\nWallOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n let minimumHeights;\n\n if (length > 0) {\n minimumHeights = new Array(length);\n for (i = 0; i < length; ++i) {\n minimumHeights[i] = array[startingIndex++];\n }\n }\n\n length = array[startingIndex++];\n let maximumHeights;\n\n if (length > 0) {\n maximumHeights = new Array(length);\n for (i = 0; i < length; ++i) {\n maximumHeights[i] = array[startingIndex++];\n }\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.positions = positions;\n scratchOptions.minimumHeights = minimumHeights;\n scratchOptions.maximumHeights = maximumHeights;\n scratchOptions.granularity = granularity;\n return new WallOutlineGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._minimumHeights = minimumHeights;\n result._maximumHeights = maximumHeights;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._granularity = granularity;\n\n return result;\n};\n\n/**\n * A description of a walloutline. A wall is defined by a series of points,\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\n * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the\n * wall at <code>positions</code>. If undefined, the height of each position in used.\n * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the\n * wall at <code>positions</code>. If undefined, the height at each position is 0.0.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\n * @returns {WallOutlineGeometry}\n *\n *\n * @example\n * // create a wall that spans from 10000 meters to 20000 meters\n * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 19.0, 47.0,\n * 19.0, 48.0,\n * 20.0, 48.0,\n * 20.0, 47.0,\n * 19.0, 47.0,\n * ]),\n * minimumHeight : 20000.0,\n * maximumHeight : 10000.0\n * });\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\n *\n * @see WallOutlineGeometry#createGeometry\n */\nWallOutlineGeometry.fromConstantHeights = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n\n let minHeights;\n let maxHeights;\n\n const min = options.minimumHeight;\n const max = options.maximumHeight;\n\n const doMin = defined(min);\n const doMax = defined(max);\n if (doMin || doMax) {\n const length = positions.length;\n minHeights = doMin ? new Array(length) : undefined;\n maxHeights = doMax ? new Array(length) : undefined;\n\n for (let i = 0; i < length; ++i) {\n if (doMin) {\n minHeights[i] = min;\n }\n\n if (doMax) {\n maxHeights[i] = max;\n }\n }\n }\n\n const newOptions = {\n positions: positions,\n maximumHeights: maxHeights,\n minimumHeights: minHeights,\n ellipsoid: options.ellipsoid,\n };\n return new WallOutlineGeometry(newOptions);\n};\n\n/**\n * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {WallOutlineGeometry} wallGeometry A description of the wall outline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nWallOutlineGeometry.createGeometry = function (wallGeometry) {\n const wallPositions = wallGeometry._positions;\n const minimumHeights = wallGeometry._minimumHeights;\n const maximumHeights = wallGeometry._maximumHeights;\n const granularity = wallGeometry._granularity;\n const ellipsoid = wallGeometry._ellipsoid;\n\n const pos = WallGeometryLibrary.computePositions(\n ellipsoid,\n wallPositions,\n maximumHeights,\n minimumHeights,\n granularity,\n false\n );\n if (!defined(pos)) {\n return;\n }\n\n const bottomPositions = pos.bottomPositions;\n const topPositions = pos.topPositions;\n\n let length = topPositions.length;\n let size = length * 2;\n\n const positions = new Float64Array(size);\n let positionIndex = 0;\n\n // add lower and upper points one after the other, lower\n // points being even and upper points being odd\n length /= 3;\n let i;\n for (i = 0; i < length; ++i) {\n const i3 = i * 3;\n const topPosition = Cartesian3.fromArray(\n topPositions,\n i3,\n scratchCartesian3Position1\n );\n const bottomPosition = Cartesian3.fromArray(\n bottomPositions,\n i3,\n scratchCartesian3Position2\n );\n\n // insert the lower point\n positions[positionIndex++] = bottomPosition.x;\n positions[positionIndex++] = bottomPosition.y;\n positions[positionIndex++] = bottomPosition.z;\n\n // insert the upper point\n positions[positionIndex++] = topPosition.x;\n positions[positionIndex++] = topPosition.y;\n positions[positionIndex++] = topPosition.z;\n }\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n }),\n });\n\n const numVertices = size / 3;\n size = 2 * numVertices - 4 + numVertices;\n const indices = IndexDatatype.createTypedArray(numVertices, size);\n\n let edgeIndex = 0;\n for (i = 0; i < numVertices - 2; i += 2) {\n const LL = i;\n const LR = i + 2;\n const pl = Cartesian3.fromArray(\n positions,\n LL * 3,\n scratchCartesian3Position1\n );\n const pr = Cartesian3.fromArray(\n positions,\n LR * 3,\n scratchCartesian3Position2\n );\n if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\n continue;\n }\n const UL = i + 1;\n const UR = i + 3;\n\n indices[edgeIndex++] = UL;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = UL;\n indices[edgeIndex++] = UR;\n indices[edgeIndex++] = LL;\n indices[edgeIndex++] = LR;\n }\n\n indices[edgeIndex++] = numVertices - 2;\n indices[edgeIndex++] = numVertices - 1;\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: new BoundingSphere.fromVertices(positions),\n });\n};\nexport default WallOutlineGeometry;\n", "import Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport WallGeometry from \"../Core/WallGeometry.js\";\nimport WallOutlineGeometry from \"../Core/WallOutlineGeometry.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryUpdater from \"./DynamicGeometryUpdater.js\";\nimport GeometryUpdater from \"./GeometryUpdater.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\n\nfunction WallGeometryOptions(entity) {\n this.id = entity;\n this.vertexFormat = undefined;\n this.positions = undefined;\n this.minimumHeights = undefined;\n this.maximumHeights = undefined;\n this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for walls.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias WallGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction WallGeometryUpdater(entity, scene) {\n GeometryUpdater.call(this, {\n entity: entity,\n scene: scene,\n geometryOptions: new WallGeometryOptions(entity),\n geometryPropertyName: \"wall\",\n observedPropertyNames: [\"availability\", \"wall\"],\n });\n\n this._onEntityPropertyChanged(entity, \"wall\", entity.wall, undefined);\n}\n\nif (defined(Object.create)) {\n WallGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);\n WallGeometryUpdater.prototype.constructor = WallGeometryUpdater;\n}\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nWallGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n\n let attributes;\n\n let color;\n const show = new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._fillProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n if (this._materialProperty instanceof ColorMaterialProperty) {\n let currentColor;\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n color: color,\n };\n } else {\n attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n };\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new WallGeometry(this._options),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nWallGeometryUpdater.prototype.createOutlineGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const outlineColor = Property.getValueOrDefault(\n this._outlineColorProperty,\n time,\n Color.BLACK,\n scratchColor\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n\n return new GeometryInstance({\n id: entity,\n geometry: new WallOutlineGeometry(this._options),\n attributes: {\n show: new ShowGeometryInstanceAttribute(\n isAvailable &&\n entity.isShowing &&\n this._showProperty.getValue(time) &&\n this._showOutlineProperty.getValue(time)\n ),\n color: ColorGeometryInstanceAttribute.fromColor(outlineColor),\n distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n ),\n },\n });\n};\n\nWallGeometryUpdater.prototype._isHidden = function (entity, wall) {\n return (\n !defined(wall.positions) ||\n GeometryUpdater.prototype._isHidden.call(this, entity, wall)\n );\n};\n\nWallGeometryUpdater.prototype._getIsClosed = function (options) {\n return false;\n};\n\nWallGeometryUpdater.prototype._isDynamic = function (entity, wall) {\n return (\n !wall.positions.isConstant || //\n !Property.isConstant(wall.minimumHeights) || //\n !Property.isConstant(wall.maximumHeights) || //\n !Property.isConstant(wall.outlineWidth) || //\n !Property.isConstant(wall.granularity)\n );\n};\n\nWallGeometryUpdater.prototype._setStaticOptions = function (entity, wall) {\n const minimumHeights = wall.minimumHeights;\n const maximumHeights = wall.maximumHeights;\n const granularity = wall.granularity;\n const isColorMaterial =\n this._materialProperty instanceof ColorMaterialProperty;\n\n const options = this._options;\n options.vertexFormat = isColorMaterial\n ? PerInstanceColorAppearance.VERTEX_FORMAT\n : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;\n options.positions = wall.positions.getValue(\n Iso8601.MINIMUM_VALUE,\n options.positions\n );\n options.minimumHeights = defined(minimumHeights)\n ? minimumHeights.getValue(Iso8601.MINIMUM_VALUE, options.minimumHeights)\n : undefined;\n options.maximumHeights = defined(maximumHeights)\n ? maximumHeights.getValue(Iso8601.MINIMUM_VALUE, options.maximumHeights)\n : undefined;\n options.granularity = defined(granularity)\n ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n};\n\nWallGeometryUpdater.DynamicGeometryUpdater = DynamicWallGeometryUpdater;\n\n/**\n * @private\n */\nfunction DynamicWallGeometryUpdater(\n geometryUpdater,\n primitives,\n groundPrimitives\n) {\n DynamicGeometryUpdater.call(\n this,\n geometryUpdater,\n primitives,\n groundPrimitives\n );\n}\n\nif (defined(Object.create)) {\n DynamicWallGeometryUpdater.prototype = Object.create(\n DynamicGeometryUpdater.prototype\n );\n DynamicWallGeometryUpdater.prototype.constructor = DynamicWallGeometryUpdater;\n}\n\nDynamicWallGeometryUpdater.prototype._isHidden = function (entity, wall, time) {\n return (\n !defined(this._options.positions) ||\n DynamicGeometryUpdater.prototype._isHidden.call(this, entity, wall, time)\n );\n};\n\nDynamicWallGeometryUpdater.prototype._setOptions = function (\n entity,\n wall,\n time\n) {\n const options = this._options;\n options.positions = Property.getValueOrUndefined(\n wall.positions,\n time,\n options.positions\n );\n options.minimumHeights = Property.getValueOrUndefined(\n wall.minimumHeights,\n time,\n options.minimumHeights\n );\n options.maximumHeights = Property.getValueOrUndefined(\n wall.maximumHeights,\n time,\n options.maximumHeights\n );\n options.granularity = Property.getValueOrUndefined(wall.granularity, time);\n};\nexport default WallGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport MaterialAppearance from \"../Scene/MaterialAppearance.js\";\nimport PerInstanceColorAppearance from \"../Scene/PerInstanceColorAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport BoxGeometryUpdater from \"./BoxGeometryUpdater.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport CorridorGeometryUpdater from \"./CorridorGeometryUpdater.js\";\nimport CylinderGeometryUpdater from \"./CylinderGeometryUpdater.js\";\nimport DynamicGeometryBatch from \"./DynamicGeometryBatch.js\";\nimport EllipseGeometryUpdater from \"./EllipseGeometryUpdater.js\";\nimport EllipsoidGeometryUpdater from \"./EllipsoidGeometryUpdater.js\";\nimport Entity from \"./Entity.js\";\nimport PlaneGeometryUpdater from \"./PlaneGeometryUpdater.js\";\nimport PolygonGeometryUpdater from \"./PolygonGeometryUpdater.js\";\nimport PolylineVolumeGeometryUpdater from \"./PolylineVolumeGeometryUpdater.js\";\nimport RectangleGeometryUpdater from \"./RectangleGeometryUpdater.js\";\nimport StaticGeometryColorBatch from \"./StaticGeometryColorBatch.js\";\nimport StaticGeometryPerMaterialBatch from \"./StaticGeometryPerMaterialBatch.js\";\nimport StaticGroundGeometryColorBatch from \"./StaticGroundGeometryColorBatch.js\";\nimport StaticGroundGeometryPerMaterialBatch from \"./StaticGroundGeometryPerMaterialBatch.js\";\nimport StaticOutlineGeometryBatch from \"./StaticOutlineGeometryBatch.js\";\nimport WallGeometryUpdater from \"./WallGeometryUpdater.js\";\n\nconst emptyArray = [];\n\nconst geometryUpdaters = [\n BoxGeometryUpdater,\n CylinderGeometryUpdater,\n CorridorGeometryUpdater,\n EllipseGeometryUpdater,\n EllipsoidGeometryUpdater,\n PlaneGeometryUpdater,\n PolygonGeometryUpdater,\n PolylineVolumeGeometryUpdater,\n RectangleGeometryUpdater,\n WallGeometryUpdater,\n];\n\nfunction GeometryUpdaterSet(entity, scene) {\n this.entity = entity;\n this.scene = scene;\n const updaters = new Array(geometryUpdaters.length);\n const geometryChanged = new Event();\n function raiseEvent(geometry) {\n geometryChanged.raiseEvent(geometry);\n }\n const eventHelper = new EventHelper();\n for (let i = 0; i < updaters.length; i++) {\n const updater = new geometryUpdaters[i](entity, scene);\n eventHelper.add(updater.geometryChanged, raiseEvent);\n updaters[i] = updater;\n }\n this.updaters = updaters;\n this.geometryChanged = geometryChanged;\n this.eventHelper = eventHelper;\n\n this._removeEntitySubscription = entity.definitionChanged.addEventListener(\n GeometryUpdaterSet.prototype._onEntityPropertyChanged,\n this\n );\n}\n\nGeometryUpdaterSet.prototype._onEntityPropertyChanged = function (\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n const updaters = this.updaters;\n for (let i = 0; i < updaters.length; i++) {\n updaters[i]._onEntityPropertyChanged(\n entity,\n propertyName,\n newValue,\n oldValue\n );\n }\n};\n\nGeometryUpdaterSet.prototype.forEach = function (callback) {\n const updaters = this.updaters;\n for (let i = 0; i < updaters.length; i++) {\n callback(updaters[i]);\n }\n};\n\nGeometryUpdaterSet.prototype.destroy = function () {\n this.eventHelper.removeAll();\n const updaters = this.updaters;\n for (let i = 0; i < updaters.length; i++) {\n updaters[i].destroy();\n }\n this._removeEntitySubscription();\n destroyObject(this);\n};\n\n/**\n * A general purpose visualizer for geometry represented by {@link Primitive} instances.\n * @alias GeometryVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n * @param {PrimitiveCollection} [primitives=scene.primitives] A collection to add primitives related to the entities\n * @param {PrimitiveCollection} [groundPrimitives=scene.groundPrimitives] A collection to add ground primitives related to the entities\n */\nfunction GeometryVisualizer(\n scene,\n entityCollection,\n primitives,\n groundPrimitives\n) {\n primitives = defaultValue(primitives, scene.primitives);\n groundPrimitives = defaultValue(groundPrimitives, scene.groundPrimitives);\n\n this._scene = scene;\n this._primitives = primitives;\n this._groundPrimitives = groundPrimitives;\n this._entityCollection = undefined;\n this._addedObjects = new AssociativeArray();\n this._removedObjects = new AssociativeArray();\n this._changedObjects = new AssociativeArray();\n\n const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n this._outlineBatches = new Array(numberOfShadowModes * 2);\n this._closedColorBatches = new Array(numberOfShadowModes * 2);\n this._closedMaterialBatches = new Array(numberOfShadowModes * 2);\n this._openColorBatches = new Array(numberOfShadowModes * 2);\n this._openMaterialBatches = new Array(numberOfShadowModes * 2);\n\n const supportsMaterialsforEntitiesOnTerrain = Entity.supportsMaterialsforEntitiesOnTerrain(\n scene\n );\n this._supportsMaterialsforEntitiesOnTerrain = supportsMaterialsforEntitiesOnTerrain;\n\n let i;\n for (i = 0; i < numberOfShadowModes; ++i) {\n this._outlineBatches[i] = new StaticOutlineGeometryBatch(\n primitives,\n scene,\n i,\n false\n );\n this._outlineBatches[\n numberOfShadowModes + i\n ] = new StaticOutlineGeometryBatch(primitives, scene, i, true);\n\n this._closedColorBatches[i] = new StaticGeometryColorBatch(\n primitives,\n PerInstanceColorAppearance,\n undefined,\n true,\n i,\n true\n );\n this._closedColorBatches[\n numberOfShadowModes + i\n ] = new StaticGeometryColorBatch(\n primitives,\n PerInstanceColorAppearance,\n undefined,\n true,\n i,\n false\n );\n\n this._closedMaterialBatches[i] = new StaticGeometryPerMaterialBatch(\n primitives,\n MaterialAppearance,\n undefined,\n true,\n i,\n true\n );\n this._closedMaterialBatches[\n numberOfShadowModes + i\n ] = new StaticGeometryPerMaterialBatch(\n primitives,\n MaterialAppearance,\n undefined,\n true,\n i,\n false\n );\n\n this._openColorBatches[i] = new StaticGeometryColorBatch(\n primitives,\n PerInstanceColorAppearance,\n undefined,\n false,\n i,\n true\n );\n this._openColorBatches[\n numberOfShadowModes + i\n ] = new StaticGeometryColorBatch(\n primitives,\n PerInstanceColorAppearance,\n undefined,\n false,\n i,\n false\n );\n\n this._openMaterialBatches[i] = new StaticGeometryPerMaterialBatch(\n primitives,\n MaterialAppearance,\n undefined,\n false,\n i,\n true\n );\n this._openMaterialBatches[\n numberOfShadowModes + i\n ] = new StaticGeometryPerMaterialBatch(\n primitives,\n MaterialAppearance,\n undefined,\n false,\n i,\n false\n );\n }\n\n const numberOfClassificationTypes =\n ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES;\n const groundColorBatches = new Array(numberOfClassificationTypes);\n const groundMaterialBatches = [];\n if (supportsMaterialsforEntitiesOnTerrain) {\n for (i = 0; i < numberOfClassificationTypes; ++i) {\n groundMaterialBatches.push(\n new StaticGroundGeometryPerMaterialBatch(\n groundPrimitives,\n i,\n MaterialAppearance\n )\n );\n groundColorBatches[i] = new StaticGroundGeometryColorBatch(\n groundPrimitives,\n i\n );\n }\n } else {\n for (i = 0; i < numberOfClassificationTypes; ++i) {\n groundColorBatches[i] = new StaticGroundGeometryColorBatch(\n groundPrimitives,\n i\n );\n }\n }\n\n this._groundColorBatches = groundColorBatches;\n this._groundMaterialBatches = groundMaterialBatches;\n\n this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives);\n\n this._batches = this._outlineBatches.concat(\n this._closedColorBatches,\n this._closedMaterialBatches,\n this._openColorBatches,\n this._openMaterialBatches,\n this._groundColorBatches,\n this._groundMaterialBatches,\n this._dynamicBatch\n );\n\n this._subscriptions = new AssociativeArray();\n this._updaterSets = new AssociativeArray();\n\n this._entityCollection = entityCollection;\n entityCollection.collectionChanged.addEventListener(\n GeometryVisualizer.prototype._onCollectionChanged,\n this\n );\n this._onCollectionChanged(\n entityCollection,\n entityCollection.values,\n emptyArray\n );\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} True if the visualizer successfully updated to the provided time,\n * false if the visualizer is waiting for asynchronous primitives to be created.\n */\nGeometryVisualizer.prototype.update = function (time) {\n const addedObjects = this._addedObjects;\n const added = addedObjects.values;\n const removedObjects = this._removedObjects;\n const removed = removedObjects.values;\n const changedObjects = this._changedObjects;\n const changed = changedObjects.values;\n\n let i;\n let entity;\n let id;\n let updaterSet;\n const that = this;\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n id = entity.id;\n updaterSet = this._updaterSets.get(id);\n\n //If in a single update, an entity gets removed and a new instance\n //re-added with the same id, the updater no longer tracks the\n //correct entity, we need to both remove the old one and\n //add the new one, which is done by pushing the entity\n //onto the removed/added lists.\n if (updaterSet.entity === entity) {\n updaterSet.forEach(function (updater) {\n that._removeUpdater(updater);\n that._insertUpdaterIntoBatch(time, updater);\n });\n } else {\n removed.push(entity);\n added.push(entity);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n id = entity.id;\n updaterSet = this._updaterSets.get(id);\n updaterSet.forEach(this._removeUpdater.bind(this));\n updaterSet.destroy();\n this._updaterSets.remove(id);\n this._subscriptions.get(id)();\n this._subscriptions.remove(id);\n }\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n id = entity.id;\n updaterSet = new GeometryUpdaterSet(entity, this._scene);\n this._updaterSets.set(id, updaterSet);\n updaterSet.forEach(function (updater) {\n that._insertUpdaterIntoBatch(time, updater);\n });\n this._subscriptions.set(\n id,\n updaterSet.geometryChanged.addEventListener(\n GeometryVisualizer._onGeometryChanged,\n this\n )\n );\n }\n\n addedObjects.removeAll();\n removedObjects.removeAll();\n changedObjects.removeAll();\n\n let isUpdated = true;\n const batches = this._batches;\n const length = batches.length;\n for (i = 0; i < length; i++) {\n isUpdated = batches[i].update(time) && isUpdated;\n }\n\n return isUpdated;\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nGeometryVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const boundingSpheres = getBoundingSphereArrayScratch;\n const tmp = getBoundingSphereBoundingSphereScratch;\n\n let count = 0;\n let state = BoundingSphereState.DONE;\n const batches = this._batches;\n const batchesLength = batches.length;\n\n const id = entity.id;\n const updaters = this._updaterSets.get(id).updaters;\n\n for (let j = 0; j < updaters.length; j++) {\n const updater = updaters[j];\n for (let i = 0; i < batchesLength; i++) {\n state = batches[i].getBoundingSphere(updater, tmp);\n if (state === BoundingSphereState.PENDING) {\n return BoundingSphereState.PENDING;\n } else if (state === BoundingSphereState.DONE) {\n boundingSpheres[count] = BoundingSphere.clone(\n tmp,\n boundingSpheres[count]\n );\n count++;\n }\n }\n }\n\n if (count === 0) {\n return BoundingSphereState.FAILED;\n }\n\n boundingSpheres.length = count;\n BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nGeometryVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nGeometryVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n GeometryVisualizer.prototype._onCollectionChanged,\n this\n );\n this._addedObjects.removeAll();\n this._removedObjects.removeAll();\n\n let i;\n const batches = this._batches;\n let length = batches.length;\n for (i = 0; i < length; i++) {\n batches[i].removeAllPrimitives();\n }\n\n const subscriptions = this._subscriptions.values;\n length = subscriptions.length;\n for (i = 0; i < length; i++) {\n subscriptions[i]();\n }\n this._subscriptions.removeAll();\n\n const updaterSets = this._updaterSets.values;\n length = updaterSets.length;\n for (i = 0; i < length; i++) {\n updaterSets[i].destroy();\n }\n this._updaterSets.removeAll();\n return destroyObject(this);\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._removeUpdater = function (updater) {\n //We don't keep track of which batch an updater is in, so just remove it from all of them.\n const batches = this._batches;\n const length = batches.length;\n for (let i = 0; i < length; i++) {\n batches[i].remove(updater);\n }\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._insertUpdaterIntoBatch = function (\n time,\n updater\n) {\n if (updater.isDynamic) {\n this._dynamicBatch.add(time, updater);\n return;\n }\n\n let shadows;\n if (updater.outlineEnabled || updater.fillEnabled) {\n shadows = updater.shadowsProperty.getValue(time);\n }\n\n const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n if (updater.outlineEnabled) {\n if (defined(updater.terrainOffsetProperty)) {\n this._outlineBatches[numberOfShadowModes + shadows].add(time, updater);\n } else {\n this._outlineBatches[shadows].add(time, updater);\n }\n }\n\n if (updater.fillEnabled) {\n if (updater.onTerrain) {\n const classificationType = updater.classificationTypeProperty.getValue(\n time\n );\n if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n this._groundColorBatches[classificationType].add(time, updater);\n } else {\n // If unsupported, updater will not be on terrain.\n this._groundMaterialBatches[classificationType].add(time, updater);\n }\n } else if (updater.isClosed) {\n if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n if (defined(updater.terrainOffsetProperty)) {\n this._closedColorBatches[numberOfShadowModes + shadows].add(\n time,\n updater\n );\n } else {\n this._closedColorBatches[shadows].add(time, updater);\n }\n } else if (defined(updater.terrainOffsetProperty)) {\n this._closedMaterialBatches[numberOfShadowModes + shadows].add(\n time,\n updater\n );\n } else {\n this._closedMaterialBatches[shadows].add(time, updater);\n }\n } else if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n if (defined(updater.terrainOffsetProperty)) {\n this._openColorBatches[numberOfShadowModes + shadows].add(\n time,\n updater\n );\n } else {\n this._openColorBatches[shadows].add(time, updater);\n }\n } else if (defined(updater.terrainOffsetProperty)) {\n this._openMaterialBatches[numberOfShadowModes + shadows].add(\n time,\n updater\n );\n } else {\n this._openMaterialBatches[shadows].add(time, updater);\n }\n }\n};\n\n/**\n * @private\n */\nGeometryVisualizer._onGeometryChanged = function (updater) {\n const removedObjects = this._removedObjects;\n const changedObjects = this._changedObjects;\n\n const entity = updater.entity;\n const id = entity.id;\n\n if (!defined(removedObjects.get(id)) && !defined(changedObjects.get(id))) {\n changedObjects.set(id, entity);\n }\n};\n\n/**\n * @private\n */\nGeometryVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed\n) {\n const addedObjects = this._addedObjects;\n const removedObjects = this._removedObjects;\n const changedObjects = this._changedObjects;\n\n let i;\n let id;\n let entity;\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n id = entity.id;\n if (!addedObjects.remove(id)) {\n removedObjects.set(id, entity);\n changedObjects.remove(id);\n }\n }\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n id = entity.id;\n if (removedObjects.remove(id)) {\n changedObjects.set(id, entity);\n } else {\n addedObjects.set(id, entity);\n }\n }\n};\nexport default GeometryVisualizer;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultScale = 1.0;\nconst defaultFont = \"30px sans-serif\";\nconst defaultStyle = LabelStyle.FILL;\nconst defaultFillColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 1.0;\nconst defaultShowBackground = false;\nconst defaultBackgroundColor = new Color(0.165, 0.165, 0.165, 0.8);\nconst defaultBackgroundPadding = new Cartesian2(7, 5);\nconst defaultPixelOffset = Cartesian2.ZERO;\nconst defaultEyeOffset = Cartesian3.ZERO;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultHorizontalOrigin = HorizontalOrigin.CENTER;\nconst defaultVerticalOrigin = VerticalOrigin.CENTER;\n\nconst positionScratch = new Cartesian3();\nconst fillColorScratch = new Color();\nconst outlineColorScratch = new Color();\nconst backgroundColorScratch = new Color();\nconst backgroundPaddingScratch = new Cartesian2();\nconst eyeOffsetScratch = new Cartesian3();\nconst pixelOffsetScratch = new Cartesian2();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst pixelOffsetScaleByDistanceScratch = new NearFarScalar();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n this.entity = entity;\n this.label = undefined;\n this.index = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps the {@link LabelGraphics} instance\n * in {@link Entity#label} to a {@link Label}.\n * @alias LabelVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction LabelVisualizer(entityCluster, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n LabelVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._cluster = entityCluster;\n this._entityCollection = entityCollection;\n this._items = new AssociativeArray();\n\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nLabelVisualizer.prototype.update = function (time) {\n const items = this._items.values;\n const cluster = this._cluster;\n\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const entity = item.entity;\n const labelGraphics = entity._label;\n let text;\n let label = item.label;\n let show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n Property.getValueOrDefault(labelGraphics._show, time, true);\n let position;\n if (show) {\n position = Property.getValueOrUndefined(\n entity._position,\n time,\n positionScratch\n );\n text = Property.getValueOrUndefined(labelGraphics._text, time);\n show = defined(position) && defined(text);\n }\n\n if (!show) {\n //don't bother creating or updating anything else\n returnPrimitive(item, entity, cluster);\n continue;\n }\n\n if (!Property.isConstant(entity._position)) {\n cluster._clusterDirty = true;\n }\n\n let updateClamping = false;\n const heightReference = Property.getValueOrDefault(\n labelGraphics._heightReference,\n time,\n defaultHeightReference\n );\n\n if (!defined(label)) {\n label = cluster.getLabel(entity);\n label.id = entity;\n item.label = label;\n\n // If this new label happens to have a position and height reference that match our new values,\n // label._updateClamping will not be called automatically. That's a problem because the clamped\n // height may be based on different terrain than is now loaded. So we'll manually call\n // _updateClamping below.\n updateClamping =\n Cartesian3.equals(label.position, position) &&\n label.heightReference === heightReference;\n }\n\n label.show = true;\n label.position = position;\n label.text = text;\n label.scale = Property.getValueOrDefault(\n labelGraphics._scale,\n time,\n defaultScale\n );\n label.font = Property.getValueOrDefault(\n labelGraphics._font,\n time,\n defaultFont\n );\n label.style = Property.getValueOrDefault(\n labelGraphics._style,\n time,\n defaultStyle\n );\n label.fillColor = Property.getValueOrDefault(\n labelGraphics._fillColor,\n time,\n defaultFillColor,\n fillColorScratch\n );\n label.outlineColor = Property.getValueOrDefault(\n labelGraphics._outlineColor,\n time,\n defaultOutlineColor,\n outlineColorScratch\n );\n label.outlineWidth = Property.getValueOrDefault(\n labelGraphics._outlineWidth,\n time,\n defaultOutlineWidth\n );\n label.showBackground = Property.getValueOrDefault(\n labelGraphics._showBackground,\n time,\n defaultShowBackground\n );\n label.backgroundColor = Property.getValueOrDefault(\n labelGraphics._backgroundColor,\n time,\n defaultBackgroundColor,\n backgroundColorScratch\n );\n label.backgroundPadding = Property.getValueOrDefault(\n labelGraphics._backgroundPadding,\n time,\n defaultBackgroundPadding,\n backgroundPaddingScratch\n );\n label.pixelOffset = Property.getValueOrDefault(\n labelGraphics._pixelOffset,\n time,\n defaultPixelOffset,\n pixelOffsetScratch\n );\n label.eyeOffset = Property.getValueOrDefault(\n labelGraphics._eyeOffset,\n time,\n defaultEyeOffset,\n eyeOffsetScratch\n );\n label.heightReference = heightReference;\n label.horizontalOrigin = Property.getValueOrDefault(\n labelGraphics._horizontalOrigin,\n time,\n defaultHorizontalOrigin\n );\n label.verticalOrigin = Property.getValueOrDefault(\n labelGraphics._verticalOrigin,\n time,\n defaultVerticalOrigin\n );\n label.translucencyByDistance = Property.getValueOrUndefined(\n labelGraphics._translucencyByDistance,\n time,\n translucencyByDistanceScratch\n );\n label.pixelOffsetScaleByDistance = Property.getValueOrUndefined(\n labelGraphics._pixelOffsetScaleByDistance,\n time,\n pixelOffsetScaleByDistanceScratch\n );\n label.scaleByDistance = Property.getValueOrUndefined(\n labelGraphics._scaleByDistance,\n time,\n scaleByDistanceScratch\n );\n label.distanceDisplayCondition = Property.getValueOrUndefined(\n labelGraphics._distanceDisplayCondition,\n time,\n distanceDisplayConditionScratch\n );\n label.disableDepthTestDistance = Property.getValueOrUndefined(\n labelGraphics._disableDepthTestDistance,\n time\n );\n\n if (updateClamping) {\n label._updateClamping();\n }\n }\n return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nLabelVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const item = this._items.get(entity.id);\n if (!defined(item) || !defined(item.label)) {\n return BoundingSphereState.FAILED;\n }\n\n const label = item.label;\n result.center = Cartesian3.clone(\n defaultValue(label._clampedPosition, label.position),\n result.center\n );\n result.radius = 0;\n return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nLabelVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nLabelVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n LabelVisualizer.prototype._onCollectionChanged,\n this\n );\n const entities = this._entityCollection.values;\n for (let i = 0; i < entities.length; i++) {\n this._cluster.removeLabel(entities[i]);\n }\n return destroyObject(this);\n};\n\nLabelVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n const items = this._items;\n const cluster = this._cluster;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._label) && defined(entity._position)) {\n items.set(entity.id, new EntityData(entity));\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._label) && defined(entity._position)) {\n if (!items.contains(entity.id)) {\n items.set(entity.id, new EntityData(entity));\n }\n } else {\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n if (defined(item)) {\n item.label = undefined;\n cluster.removeLabel(entity);\n }\n}\nexport default LabelVisualizer;\n", "import Check from \"./Check.js\";\n\n/**\n * Initiates a terrain height query for an array of {@link Cartographic} positions by\n * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation\n * matches the triangles used to render the terrain at the specified level. The query\n * happens asynchronously, so this function returns a promise that is resolved when\n * the query completes. Each point height is modified in place. If a height can not be\n * determined because no terrain data is available for the specified level at that location,\n * or another error occurs, the height is set to undefined. As is typical of the\n * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid\n * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other\n * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the\n * terrain level of detail as input, if you need to get the altitude of the terrain as precisely\n * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.\n *\n * @function sampleTerrain\n *\n * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights.\n * @param {Number} level The terrain level-of-detail from which to query terrain heights.\n * @param {Cartographic[]} positions The positions to update with terrain heights.\n * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed.\n *\n * @see sampleTerrainMostDetailed\n *\n * @example\n * // Query the terrain height of two Cartographic positions\n * const terrainProvider = Cesium.createWorldTerrain();\n * const positions = [\n * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),\n * Cesium.Cartographic.fromDegrees(87.0, 28.0)\n * ];\n * const promise = Cesium.sampleTerrain(terrainProvider, 11, positions);\n * Promise.resolve(promise).then(function(updatedPositions) {\n * // positions[0].height and positions[1].height have been updated.\n * // updatedPositions is just a reference to positions.\n * });\n */\nfunction sampleTerrain(terrainProvider, level, positions) {\n return terrainProvider.readyPromise.then(function () {\n return doSampling(terrainProvider, level, positions);\n });\n}\n\n/**\n * @param {Array.<Object>} tileRequests The mutated list of requests, the first one will be attempted\n * @param {Array.<Promise<void>>} results The list to put the result promises into\n * @returns {boolean} true if the request was made, and we are okay to attempt the next item immediately,\n * or false if we were throttled and should wait awhile before retrying.\n *\n * @private\n */\nfunction attemptConsumeNextQueueItem(tileRequests, results) {\n const tileRequest = tileRequests[0];\n const requestPromise = tileRequest.terrainProvider.requestTileGeometry(\n tileRequest.x,\n tileRequest.y,\n tileRequest.level\n );\n\n if (!requestPromise) {\n // getting back undefined instead of a promise indicates we should retry a bit later\n return false;\n }\n\n const promise = requestPromise\n .then(createInterpolateFunction(tileRequest))\n .catch(createMarkFailedFunction(tileRequest));\n\n // remove the request we've just done from the queue\n // and add its promise result to the result list\n tileRequests.shift();\n results.push(promise);\n\n // indicate we should synchronously attempt the next request as well\n return true;\n}\n\n/**\n * Wrap window.setTimeout in a Promise\n * @param {number} ms\n * @private\n */\nfunction delay(ms) {\n return new Promise(function (res) {\n setTimeout(res, ms);\n });\n}\n\n/**\n * Recursively consumes all the tileRequests until the list has been emptied\n * and a Promise of each result has been put into the results list\n * @param {Array.<Object>} tileRequests The list of requests desired to be made\n * @param {Array.<Promise<void>>} results The list to put all the result promises into\n * @returns {Promise<void>} A promise which resolves once all requests have been started\n *\n * @private\n */\nfunction drainTileRequestQueue(tileRequests, results) {\n // nothing left to do\n if (!tileRequests.length) {\n return Promise.resolve();\n }\n\n // consume an item from the queue, which will\n // mutate the request and result lists, and return true if we should\n // immediately attempt to consume the next item as well\n const success = attemptConsumeNextQueueItem(tileRequests, results);\n if (success) {\n return drainTileRequestQueue(tileRequests, results);\n }\n\n // wait a small fixed amount of time first, before retrying the same request again\n return delay(100).then(() => {\n return drainTileRequestQueue(tileRequests, results);\n });\n}\n\nfunction doSampling(terrainProvider, level, positions) {\n const tilingScheme = terrainProvider.tilingScheme;\n\n let i;\n\n // Sort points into a set of tiles\n const tileRequests = []; // Result will be an Array as it's easier to work with\n const tileRequestSet = {}; // A unique set\n for (i = 0; i < positions.length; ++i) {\n const xy = tilingScheme.positionToTileXY(positions[i], level);\n const key = xy.toString();\n\n if (!tileRequestSet.hasOwnProperty(key)) {\n // When tile is requested for the first time\n const value = {\n x: xy.x,\n y: xy.y,\n level: level,\n tilingScheme: tilingScheme,\n terrainProvider: terrainProvider,\n positions: [],\n };\n tileRequestSet[key] = value;\n tileRequests.push(value);\n }\n\n // Now append to array of points for the tile\n tileRequestSet[key].positions.push(positions[i]);\n }\n\n // create our list of result promises to be filled\n const tilePromises = [];\n return drainTileRequestQueue(tileRequests, tilePromises).then(function () {\n // now all the required requests have been started\n // we just wait for them all to finish\n return Promise.all(tilePromises).then(function () {\n return positions;\n });\n });\n}\n\n/**\n * Calls {@link TerrainData#interpolateHeight} on a given {@link TerrainData} for a given {@link Cartographic} and\n * will assign the height property if the return value is not undefined.\n *\n * If the return value is false; it's suggesting that you should call {@link TerrainData#createMesh} first.\n * @param {Cartographic} position The position to interpolate for and assign the height value to\n * @param {TerrainData} terrainData\n * @param {Rectangle} rectangle\n * @returns {Boolean} If the height was actually interpolated and assigned\n * @private\n */\nfunction interpolateAndAssignHeight(position, terrainData, rectangle) {\n const height = terrainData.interpolateHeight(\n rectangle,\n position.longitude,\n position.latitude\n );\n if (height === undefined) {\n // if height comes back as undefined, it may implicitly mean the terrain data\n // requires us to call TerrainData.createMesh() first (ArcGIS requires this in particular)\n // so we'll return false and do that next!\n return false;\n }\n position.height = height;\n return true;\n}\n\nfunction createInterpolateFunction(tileRequest) {\n const tilePositions = tileRequest.positions;\n const rectangle = tileRequest.tilingScheme.tileXYToRectangle(\n tileRequest.x,\n tileRequest.y,\n tileRequest.level\n );\n return function (terrainData) {\n let isMeshRequired = false;\n for (let i = 0; i < tilePositions.length; ++i) {\n const position = tilePositions[i];\n const isHeightAssigned = interpolateAndAssignHeight(\n position,\n terrainData,\n rectangle\n );\n // we've found a position which returned undefined - hinting to us\n // that we probably need to create a mesh for this terrain data.\n // so break out of this loop and create the mesh - then we'll interpolate all the heights again\n if (!isHeightAssigned) {\n isMeshRequired = true;\n break;\n }\n }\n\n if (!isMeshRequired) {\n // all position heights were interpolated - we don't need the mesh\n return Promise.resolve();\n }\n\n // create the mesh - and interpolate all the positions again\n // note: terrain exaggeration is not passed in - we are only interested in the raw data\n return terrainData\n .createMesh({\n tilingScheme: tileRequest.tilingScheme,\n x: tileRequest.x,\n y: tileRequest.y,\n level: tileRequest.level,\n // don't throttle this mesh creation because we've asked to sample these points;\n // so sample them! We don't care how many tiles that is!\n throttle: false,\n })\n .then(function () {\n // mesh has been created - so go through every position (maybe again)\n // and re-interpolate the heights - presumably using the mesh this time\n for (let i = 0; i < tilePositions.length; ++i) {\n const position = tilePositions[i];\n // if it doesn't work this time - that's fine, we tried.\n interpolateAndAssignHeight(position, terrainData, rectangle);\n }\n });\n };\n}\n\nfunction createMarkFailedFunction(tileRequest) {\n const tilePositions = tileRequest.positions;\n return function () {\n for (let i = 0; i < tilePositions.length; ++i) {\n const position = tilePositions[i];\n position.height = undefined;\n }\n };\n}\n\nexport default sampleTerrain;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport sampleTerrain from \"./sampleTerrain.js\";\n\nconst scratchCartesian2 = new Cartesian2();\n\n/**\n * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.\n *\n * @function sampleTerrainMostDetailed\n *\n * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights.\n * @param {Cartographic[]} positions The positions to update with terrain heights.\n * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed. This\n * promise will reject if the terrain provider's `availability` property is undefined.\n *\n * @example\n * // Query the terrain height of two Cartographic positions\n * const terrainProvider = Cesium.createWorldTerrain();\n * const positions = [\n * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),\n * Cesium.Cartographic.fromDegrees(87.0, 28.0)\n * ];\n * const promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);\n * Promise.resolve(promise).then(function(updatedPositions) {\n * // positions[0].height and positions[1].height have been updated.\n * // updatedPositions is just a reference to positions.\n * });\n */\nfunction sampleTerrainMostDetailed(terrainProvider, positions) {\n return terrainProvider.readyPromise.then(function () {\n const byLevel = [];\n const maxLevels = [];\n\n const availability = terrainProvider.availability;\n\n const promises = [];\n for (let i = 0; i < positions.length; ++i) {\n const position = positions[i];\n const maxLevel = availability.computeMaximumLevelAtPosition(position);\n maxLevels[i] = maxLevel;\n if (maxLevel === 0) {\n // This is a special case where we have a parent terrain and we are requesting\n // heights from an area that isn't covered by the top level terrain at all.\n // This will essentially trigger the loading of the parent terrains root tile\n terrainProvider.tilingScheme.positionToTileXY(\n position,\n 1,\n scratchCartesian2\n );\n const promise = terrainProvider.loadTileDataAvailability(\n scratchCartesian2.x,\n scratchCartesian2.y,\n 1\n );\n if (defined(promise)) {\n promises.push(promise);\n }\n }\n\n let atLevel = byLevel[maxLevel];\n if (!defined(atLevel)) {\n byLevel[maxLevel] = atLevel = [];\n }\n atLevel.push(position);\n }\n\n return Promise.all(promises)\n .then(function () {\n return Promise.all(\n byLevel.map(function (positionsAtLevel, index) {\n if (defined(positionsAtLevel)) {\n return sampleTerrain(terrainProvider, index, positionsAtLevel);\n }\n })\n );\n })\n .then(function () {\n const changedPositions = [];\n for (let i = 0; i < positions.length; ++i) {\n const position = positions[i];\n const maxLevel = availability.computeMaximumLevelAtPosition(position);\n\n if (maxLevel !== maxLevels[i]) {\n // Now that we loaded the max availability, a higher level has become available\n changedPositions.push(position);\n }\n }\n\n if (changedPositions.length > 0) {\n return sampleTerrainMostDetailed(terrainProvider, changedPositions);\n }\n })\n .then(function () {\n return positions;\n });\n });\n}\nexport default sampleTerrainMostDetailed;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ColorBlendMode from \"../Scene/ColorBlendMode.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport Model from \"../Scene/Model/Model.js\";\nimport ModelAnimationLoop from \"../Scene/ModelAnimationLoop.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\nimport sampleTerrainMostDetailed from \"../Core/sampleTerrainMostDetailed.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\n\nconst defaultScale = 1.0;\nconst defaultMinimumPixelSize = 0.0;\nconst defaultIncrementallyLoadTextures = true;\nconst defaultClampAnimations = true;\nconst defaultShadows = ShadowMode.ENABLED;\nconst defaultHeightReference = HeightReference.NONE;\nconst defaultSilhouetteColor = Color.RED;\nconst defaultSilhouetteSize = 0.0;\nconst defaultColor = Color.WHITE;\nconst defaultColorBlendMode = ColorBlendMode.HIGHLIGHT;\nconst defaultColorBlendAmount = 0.5;\nconst defaultImageBasedLightingFactor = new Cartesian2(1.0, 1.0);\n\nconst modelMatrixScratch = new Matrix4();\nconst nodeMatrixScratch = new Matrix4();\n\nconst scratchColor = new Color();\n/**\n * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.\n * @alias ModelVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction ModelVisualizer(scene, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n ModelVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._scene = scene;\n this._primitives = scene.primitives;\n this._entityCollection = entityCollection;\n this._modelHash = {};\n this._entitiesToVisualize = new AssociativeArray();\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates models created this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nModelVisualizer.prototype.update = function (time) {\n const entities = this._entitiesToVisualize.values;\n const modelHash = this._modelHash;\n const primitives = this._primitives;\n\n for (let i = 0, len = entities.length; i < len; i++) {\n const entity = entities[i];\n const modelGraphics = entity._model;\n\n let resource;\n let modelData = modelHash[entity.id];\n let show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n Property.getValueOrDefault(modelGraphics._show, time, true);\n\n let modelMatrix;\n if (show) {\n modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch);\n resource = Resource.createIfNeeded(\n Property.getValueOrUndefined(modelGraphics._uri, time)\n );\n show = defined(modelMatrix) && defined(resource);\n }\n\n if (!show) {\n if (defined(modelData)) {\n modelData.modelPrimitive.show = false;\n }\n continue;\n }\n\n let model = defined(modelData) ? modelData.modelPrimitive : undefined;\n if (!defined(model) || resource.url !== modelData.url) {\n if (defined(model)) {\n primitives.removeAndDestroy(model);\n delete modelHash[entity.id];\n }\n\n model = Model.fromGltf({\n url: resource,\n incrementallyLoadTextures: Property.getValueOrDefault(\n modelGraphics._incrementallyLoadTextures,\n time,\n defaultIncrementallyLoadTextures\n ),\n scene: this._scene,\n });\n model.id = entity;\n primitives.add(model);\n\n modelData = {\n modelPrimitive: model,\n url: resource.url,\n animationsRunning: false,\n nodeTransformationsScratch: {},\n articulationsScratch: {},\n loadFail: false,\n awaitingSampleTerrain: false,\n clampedBoundingSphere: undefined,\n sampleTerrainFailed: false,\n };\n modelHash[entity.id] = modelData;\n\n checkModelLoad(model, entity, modelHash);\n }\n\n model.show = true;\n model.scale = Property.getValueOrDefault(\n modelGraphics._scale,\n time,\n defaultScale\n );\n model.minimumPixelSize = Property.getValueOrDefault(\n modelGraphics._minimumPixelSize,\n time,\n defaultMinimumPixelSize\n );\n model.maximumScale = Property.getValueOrUndefined(\n modelGraphics._maximumScale,\n time\n );\n model.modelMatrix = Matrix4.clone(modelMatrix, model.modelMatrix);\n model.shadows = Property.getValueOrDefault(\n modelGraphics._shadows,\n time,\n defaultShadows\n );\n model.heightReference = Property.getValueOrDefault(\n modelGraphics._heightReference,\n time,\n defaultHeightReference\n );\n model.distanceDisplayCondition = Property.getValueOrUndefined(\n modelGraphics._distanceDisplayCondition,\n time\n );\n model.silhouetteColor = Property.getValueOrDefault(\n modelGraphics._silhouetteColor,\n time,\n defaultSilhouetteColor,\n scratchColor\n );\n model.silhouetteSize = Property.getValueOrDefault(\n modelGraphics._silhouetteSize,\n time,\n defaultSilhouetteSize\n );\n model.color = Property.getValueOrDefault(\n modelGraphics._color,\n time,\n defaultColor,\n scratchColor\n );\n model.colorBlendMode = Property.getValueOrDefault(\n modelGraphics._colorBlendMode,\n time,\n defaultColorBlendMode\n );\n model.colorBlendAmount = Property.getValueOrDefault(\n modelGraphics._colorBlendAmount,\n time,\n defaultColorBlendAmount\n );\n model.clippingPlanes = Property.getValueOrUndefined(\n modelGraphics._clippingPlanes,\n time\n );\n model.clampAnimations = Property.getValueOrDefault(\n modelGraphics._clampAnimations,\n time,\n defaultClampAnimations\n );\n model.imageBasedLighting.imageBasedLightingFactor = Property.getValueOrDefault(\n modelGraphics._imageBasedLightingFactor,\n time,\n defaultImageBasedLightingFactor\n );\n model.lightColor = Property.getValueOrUndefined(\n modelGraphics._lightColor,\n time\n );\n model.customShader = Property.getValueOrUndefined(\n modelGraphics._customShader,\n time\n );\n\n if (model.ready) {\n const runAnimations = Property.getValueOrDefault(\n modelGraphics._runAnimations,\n time,\n true\n );\n if (modelData.animationsRunning !== runAnimations) {\n if (runAnimations) {\n model.activeAnimations.addAll({\n loop: ModelAnimationLoop.REPEAT,\n });\n } else {\n model.activeAnimations.removeAll();\n }\n modelData.animationsRunning = runAnimations;\n }\n\n // Apply node transformations\n const nodeTransformations = Property.getValueOrUndefined(\n modelGraphics._nodeTransformations,\n time,\n modelData.nodeTransformationsScratch\n );\n if (defined(nodeTransformations)) {\n const nodeNames = Object.keys(nodeTransformations);\n for (\n let nodeIndex = 0, nodeLength = nodeNames.length;\n nodeIndex < nodeLength;\n ++nodeIndex\n ) {\n const nodeName = nodeNames[nodeIndex];\n\n const nodeTransformation = nodeTransformations[nodeName];\n if (!defined(nodeTransformation)) {\n continue;\n }\n\n const modelNode = model.getNode(nodeName);\n if (!defined(modelNode)) {\n continue;\n }\n\n const transformationMatrix = Matrix4.fromTranslationRotationScale(\n nodeTransformation,\n nodeMatrixScratch\n );\n modelNode.matrix = Matrix4.multiply(\n modelNode.originalMatrix,\n transformationMatrix,\n transformationMatrix\n );\n }\n }\n\n // Apply articulations\n let anyArticulationUpdated = false;\n const articulations = Property.getValueOrUndefined(\n modelGraphics._articulations,\n time,\n modelData.articulationsScratch\n );\n if (defined(articulations)) {\n const articulationStageKeys = Object.keys(articulations);\n for (\n let s = 0, numKeys = articulationStageKeys.length;\n s < numKeys;\n ++s\n ) {\n const key = articulationStageKeys[s];\n\n const articulationStageValue = articulations[key];\n if (!defined(articulationStageValue)) {\n continue;\n }\n\n anyArticulationUpdated = true;\n model.setArticulationStage(key, articulationStageValue);\n }\n }\n\n if (anyArticulationUpdated) {\n model.applyArticulations();\n }\n }\n }\n\n return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nModelVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nModelVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n ModelVisualizer.prototype._onCollectionChanged,\n this\n );\n const entities = this._entitiesToVisualize.values;\n const modelHash = this._modelHash;\n const primitives = this._primitives;\n for (let i = entities.length - 1; i > -1; i--) {\n removeModel(this, entities[i], modelHash, primitives);\n }\n return destroyObject(this);\n};\n\n// Used for testing.\nModelVisualizer._sampleTerrainMostDetailed = sampleTerrainMostDetailed;\n\nconst scratchPosition = new Cartesian3();\nconst scratchCartographic = new Cartographic();\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nModelVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const modelData = this._modelHash[entity.id];\n if (!defined(modelData) || modelData.loadFail) {\n return BoundingSphereState.FAILED;\n }\n\n const model = modelData.modelPrimitive;\n if (!defined(model) || !model.show) {\n return BoundingSphereState.FAILED;\n }\n\n if (!model.ready) {\n return BoundingSphereState.PENDING;\n }\n const scene = this._scene;\n const globe = scene.globe;\n const ellipsoid = globe.ellipsoid;\n const terrainProvider = globe.terrainProvider;\n\n const hasHeightReference = model.heightReference !== HeightReference.NONE;\n if (hasHeightReference) {\n // We cannot query the availability of the terrain provider till its ready, so the\n // bounding sphere state will remain pending till the terrain provider is ready.\n if (!terrainProvider.ready) {\n return BoundingSphereState.PENDING;\n }\n\n const modelMatrix = model.modelMatrix;\n scratchPosition.x = modelMatrix[12];\n scratchPosition.y = modelMatrix[13];\n scratchPosition.z = modelMatrix[14];\n const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition);\n\n // For a terrain provider that does not have availability, like the EllipsoidTerrainProvider,\n // we can directly assign the bounding sphere's center from model matrix's translation.\n if (!defined(terrainProvider.availability)) {\n // Regardless of what the original model's position is set to, for CLAMP_TO_GROUND, we reset it to 0\n // when computing the position to zoom/fly to.\n if (model.heightReference === HeightReference.CLAMP_TO_GROUND) {\n cartoPosition.height = 0;\n }\n\n const scratchPosition = ellipsoid.cartographicToCartesian(cartoPosition);\n BoundingSphere.clone(model.boundingSphere, result);\n result.center = scratchPosition;\n\n return BoundingSphereState.DONE;\n }\n\n // Otherwise, in the case of terrain providers with availability,\n // since the model's bounding sphere may be clamped to a lower LOD tile if\n // the camera is initially far away, we use sampleTerrainMostDetailed to estimate\n // where the bounding sphere should be and set that as the target bounding sphere\n // for the camera.\n let clampedBoundingSphere = this._modelHash[entity.id]\n .clampedBoundingSphere;\n\n // Check if the sample terrain function has failed.\n const sampleTerrainFailed = this._modelHash[entity.id].sampleTerrainFailed;\n if (sampleTerrainFailed) {\n this._modelHash[entity.id].sampleTerrainFailed = false;\n return BoundingSphereState.FAILED;\n }\n\n if (!defined(clampedBoundingSphere)) {\n clampedBoundingSphere = new BoundingSphere();\n\n // Since this function is called per-frame, we set a flag when sampleTerrainMostDetailed\n // is called and check for it to avoid calling it again.\n const awaitingSampleTerrain = this._modelHash[entity.id]\n .awaitingSampleTerrain;\n if (!awaitingSampleTerrain) {\n Cartographic.clone(cartoPosition, scratchCartographic);\n this._modelHash[entity.id].awaitingSampleTerrain = true;\n ModelVisualizer._sampleTerrainMostDetailed(terrainProvider, [\n scratchCartographic,\n ])\n .then((result) => {\n this._modelHash[entity.id].awaitingSampleTerrain = false;\n\n const updatedCartographic = result[0];\n if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {\n updatedCartographic.height += cartoPosition.height;\n }\n ellipsoid.cartographicToCartesian(\n updatedCartographic,\n scratchPosition\n );\n\n // Update the bounding sphere with the updated position.\n BoundingSphere.clone(model.boundingSphere, clampedBoundingSphere);\n clampedBoundingSphere.center = scratchPosition;\n\n this._modelHash[\n entity.id\n ].clampedBoundingSphere = BoundingSphere.clone(\n clampedBoundingSphere\n );\n })\n .catch((e) => {\n this._modelHash[entity.id].sampleTerrainFailed = true;\n this._modelHash[entity.id].awaitingSampleTerrain = false;\n });\n }\n\n // We will return the state as pending until the clamped bounding sphere is defined,\n // which happens when the sampleTerrainMostDetailed promise returns.\n return BoundingSphereState.PENDING;\n }\n\n BoundingSphere.clone(clampedBoundingSphere, result);\n // Reset the clamped bounding sphere.\n this._modelHash[entity.id].clampedBoundingSphere = undefined;\n return BoundingSphereState.DONE;\n }\n\n BoundingSphere.clone(model.boundingSphere, result);\n return BoundingSphereState.DONE;\n};\n\n/**\n * @private\n */\nModelVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n const entities = this._entitiesToVisualize;\n const modelHash = this._modelHash;\n const primitives = this._primitives;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._model) && defined(entity._position)) {\n entities.set(entity.id, entity);\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._model) && defined(entity._position)) {\n clearNodeTransformationsArticulationsScratch(entity, modelHash);\n entities.set(entity.id, entity);\n } else {\n removeModel(this, entity, modelHash, primitives);\n entities.remove(entity.id);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n removeModel(this, entity, modelHash, primitives);\n entities.remove(entity.id);\n }\n};\n\nfunction removeModel(visualizer, entity, modelHash, primitives) {\n const modelData = modelHash[entity.id];\n if (defined(modelData)) {\n primitives.removeAndDestroy(modelData.modelPrimitive);\n delete modelHash[entity.id];\n }\n}\n\nfunction clearNodeTransformationsArticulationsScratch(entity, modelHash) {\n const modelData = modelHash[entity.id];\n if (defined(modelData)) {\n modelData.nodeTransformationsScratch = {};\n modelData.articulationsScratch = {};\n }\n}\n\nfunction checkModelLoad(model, entity, modelHash) {\n model.readyPromise.catch(function (error) {\n console.error(error);\n modelHash[entity.id].loadFail = true;\n });\n}\nexport default ModelVisualizer;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Property from \"./Property.js\";\n\n/**\n * This is a temporary class for scaling position properties to the WGS84 surface.\n * It will go away or be refactored to support data with arbitrary height references.\n * @private\n */\nfunction ScaledPositionProperty(value) {\n this._definitionChanged = new Event();\n this._value = undefined;\n this._removeSubscription = undefined;\n this.setValue(value);\n}\n\nObject.defineProperties(ScaledPositionProperty.prototype, {\n isConstant: {\n get: function () {\n return Property.isConstant(this._value);\n },\n },\n definitionChanged: {\n get: function () {\n return this._definitionChanged;\n },\n },\n referenceFrame: {\n get: function () {\n return defined(this._value)\n ? this._value.referenceFrame\n : ReferenceFrame.FIXED;\n },\n },\n});\n\nScaledPositionProperty.prototype.getValue = function (time, result) {\n return this.getValueInReferenceFrame(time, ReferenceFrame.FIXED, result);\n};\n\nScaledPositionProperty.prototype.setValue = function (value) {\n if (this._value !== value) {\n this._value = value;\n\n if (defined(this._removeSubscription)) {\n this._removeSubscription();\n this._removeSubscription = undefined;\n }\n\n if (defined(value)) {\n this._removeSubscription = value.definitionChanged.addEventListener(\n this._raiseDefinitionChanged,\n this\n );\n }\n this._definitionChanged.raiseEvent(this);\n }\n};\n\nScaledPositionProperty.prototype.getValueInReferenceFrame = function (\n time,\n referenceFrame,\n result\n) {\n if (!defined(this._value)) {\n return undefined;\n }\n\n result = this._value.getValueInReferenceFrame(time, referenceFrame, result);\n return defined(result)\n ? Ellipsoid.WGS84.scaleToGeodeticSurface(result, result)\n : undefined;\n};\n\nScaledPositionProperty.prototype.equals = function (other) {\n return (\n this === other ||\n (other instanceof ScaledPositionProperty && this._value === other._value)\n );\n};\n\nScaledPositionProperty.prototype._raiseDefinitionChanged = function () {\n this._definitionChanged.raiseEvent(this);\n};\nexport default ScaledPositionProperty;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport PolylineCollection from \"../Scene/PolylineCollection.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\nimport TimeIntervalCollectionPositionProperty from \"./TimeIntervalCollectionPositionProperty.js\";\n\nconst defaultResolution = 60.0;\nconst defaultWidth = 1.0;\n\nconst scratchTimeInterval = new TimeInterval();\nconst subSampleCompositePropertyScratch = new TimeInterval();\nconst subSampleIntervalPropertyScratch = new TimeInterval();\n\nfunction EntityData(entity) {\n this.entity = entity;\n this.polyline = undefined;\n this.index = undefined;\n this.updater = undefined;\n}\n\nfunction subSampleSampledProperty(\n property,\n start,\n stop,\n times,\n updateTime,\n referenceFrame,\n maximumStep,\n startingIndex,\n result\n) {\n let r = startingIndex;\n //Always step exactly on start (but only use it if it exists.)\n let tmp;\n tmp = property.getValueInReferenceFrame(start, referenceFrame, result[r]);\n if (defined(tmp)) {\n result[r++] = tmp;\n }\n\n let steppedOnNow =\n !defined(updateTime) ||\n JulianDate.lessThanOrEquals(updateTime, start) ||\n JulianDate.greaterThanOrEquals(updateTime, stop);\n\n //Iterate over all interval times and add the ones that fall in our\n //time range. Note that times can contain data outside of\n //the intervals range. This is by design for use with interpolation.\n let t = 0;\n const len = times.length;\n let current = times[t];\n const loopStop = stop;\n let sampling = false;\n let sampleStepsToTake;\n let sampleStepsTaken;\n let sampleStepSize;\n\n while (t < len) {\n if (!steppedOnNow && JulianDate.greaterThanOrEquals(current, updateTime)) {\n tmp = property.getValueInReferenceFrame(\n updateTime,\n referenceFrame,\n result[r]\n );\n if (defined(tmp)) {\n result[r++] = tmp;\n }\n steppedOnNow = true;\n }\n if (\n JulianDate.greaterThan(current, start) &&\n JulianDate.lessThan(current, loopStop) &&\n !current.equals(updateTime)\n ) {\n tmp = property.getValueInReferenceFrame(\n current,\n referenceFrame,\n result[r]\n );\n if (defined(tmp)) {\n result[r++] = tmp;\n }\n }\n\n if (t < len - 1) {\n if (maximumStep > 0 && !sampling) {\n const next = times[t + 1];\n const secondsUntilNext = JulianDate.secondsDifference(next, current);\n sampling = secondsUntilNext > maximumStep;\n\n if (sampling) {\n sampleStepsToTake = Math.ceil(secondsUntilNext / maximumStep);\n sampleStepsTaken = 0;\n sampleStepSize = secondsUntilNext / Math.max(sampleStepsToTake, 2);\n sampleStepsToTake = Math.max(sampleStepsToTake - 1, 1);\n }\n }\n\n if (sampling && sampleStepsTaken < sampleStepsToTake) {\n current = JulianDate.addSeconds(\n current,\n sampleStepSize,\n new JulianDate()\n );\n sampleStepsTaken++;\n continue;\n }\n }\n sampling = false;\n t++;\n current = times[t];\n }\n\n //Always step exactly on stop (but only use it if it exists.)\n tmp = property.getValueInReferenceFrame(stop, referenceFrame, result[r]);\n if (defined(tmp)) {\n result[r++] = tmp;\n }\n\n return r;\n}\n\nfunction subSampleGenericProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n startingIndex,\n result\n) {\n let tmp;\n let i = 0;\n let index = startingIndex;\n let time = start;\n const stepSize = Math.max(maximumStep, 60);\n let steppedOnNow =\n !defined(updateTime) ||\n JulianDate.lessThanOrEquals(updateTime, start) ||\n JulianDate.greaterThanOrEquals(updateTime, stop);\n while (JulianDate.lessThan(time, stop)) {\n if (!steppedOnNow && JulianDate.greaterThanOrEquals(time, updateTime)) {\n steppedOnNow = true;\n tmp = property.getValueInReferenceFrame(\n updateTime,\n referenceFrame,\n result[index]\n );\n if (defined(tmp)) {\n result[index] = tmp;\n index++;\n }\n }\n tmp = property.getValueInReferenceFrame(\n time,\n referenceFrame,\n result[index]\n );\n if (defined(tmp)) {\n result[index] = tmp;\n index++;\n }\n i++;\n time = JulianDate.addSeconds(start, stepSize * i, new JulianDate());\n }\n //Always sample stop.\n tmp = property.getValueInReferenceFrame(stop, referenceFrame, result[index]);\n if (defined(tmp)) {\n result[index] = tmp;\n index++;\n }\n return index;\n}\n\nfunction subSampleIntervalProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n startingIndex,\n result\n) {\n subSampleIntervalPropertyScratch.start = start;\n subSampleIntervalPropertyScratch.stop = stop;\n\n let index = startingIndex;\n const intervals = property.intervals;\n for (let i = 0; i < intervals.length; i++) {\n const interval = intervals.get(i);\n if (\n !TimeInterval.intersect(\n interval,\n subSampleIntervalPropertyScratch,\n scratchTimeInterval\n ).isEmpty\n ) {\n let time = interval.start;\n if (!interval.isStartIncluded) {\n if (interval.isStopIncluded) {\n time = interval.stop;\n } else {\n time = JulianDate.addSeconds(\n interval.start,\n JulianDate.secondsDifference(interval.stop, interval.start) / 2,\n new JulianDate()\n );\n }\n }\n const tmp = property.getValueInReferenceFrame(\n time,\n referenceFrame,\n result[index]\n );\n if (defined(tmp)) {\n result[index] = tmp;\n index++;\n }\n }\n }\n return index;\n}\n\nfunction subSampleConstantProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n startingIndex,\n result\n) {\n const tmp = property.getValueInReferenceFrame(\n start,\n referenceFrame,\n result[startingIndex]\n );\n if (defined(tmp)) {\n result[startingIndex++] = tmp;\n }\n return startingIndex;\n}\n\nfunction subSampleCompositeProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n startingIndex,\n result\n) {\n subSampleCompositePropertyScratch.start = start;\n subSampleCompositePropertyScratch.stop = stop;\n\n let index = startingIndex;\n const intervals = property.intervals;\n for (let i = 0; i < intervals.length; i++) {\n const interval = intervals.get(i);\n if (\n !TimeInterval.intersect(\n interval,\n subSampleCompositePropertyScratch,\n scratchTimeInterval\n ).isEmpty\n ) {\n const intervalStart = interval.start;\n const intervalStop = interval.stop;\n\n let sampleStart = start;\n if (JulianDate.greaterThan(intervalStart, sampleStart)) {\n sampleStart = intervalStart;\n }\n\n let sampleStop = stop;\n if (JulianDate.lessThan(intervalStop, sampleStop)) {\n sampleStop = intervalStop;\n }\n\n index = reallySubSample(\n interval.data,\n sampleStart,\n sampleStop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n }\n }\n return index;\n}\n\nfunction reallySubSample(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n) {\n //Unwrap any references until we have the actual property.\n while (property instanceof ReferenceProperty) {\n property = property.resolvedProperty;\n }\n\n if (property instanceof SampledPositionProperty) {\n const times = property._property._times;\n index = subSampleSampledProperty(\n property,\n start,\n stop,\n times,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n } else if (property instanceof CompositePositionProperty) {\n index = subSampleCompositeProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n } else if (property instanceof TimeIntervalCollectionPositionProperty) {\n index = subSampleIntervalProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n } else if (\n property instanceof ConstantPositionProperty ||\n (property instanceof ScaledPositionProperty &&\n Property.isConstant(property))\n ) {\n index = subSampleConstantProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n } else {\n //Fallback to generic sampling.\n index = subSampleGenericProperty(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n index,\n result\n );\n }\n return index;\n}\n\nfunction subSample(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n result\n) {\n if (!defined(result)) {\n result = [];\n }\n\n const length = reallySubSample(\n property,\n start,\n stop,\n updateTime,\n referenceFrame,\n maximumStep,\n 0,\n result\n );\n result.length = length;\n return result;\n}\n\nconst toFixedScratch = new Matrix3();\nfunction PolylineUpdater(scene, referenceFrame) {\n this._unusedIndexes = [];\n this._polylineCollection = new PolylineCollection();\n this._scene = scene;\n this._referenceFrame = referenceFrame;\n scene.primitives.add(this._polylineCollection);\n}\n\nPolylineUpdater.prototype.update = function (time) {\n if (this._referenceFrame === ReferenceFrame.INERTIAL) {\n let toFixed = Transforms.computeIcrfToFixedMatrix(time, toFixedScratch);\n if (!defined(toFixed)) {\n toFixed = Transforms.computeTemeToPseudoFixedMatrix(time, toFixedScratch);\n }\n Matrix4.fromRotationTranslation(\n toFixed,\n Cartesian3.ZERO,\n this._polylineCollection.modelMatrix\n );\n }\n};\n\nPolylineUpdater.prototype.updateObject = function (time, item) {\n const entity = item.entity;\n const pathGraphics = entity._path;\n const positionProperty = entity._position;\n\n let sampleStart;\n let sampleStop;\n const showProperty = pathGraphics._show;\n let polyline = item.polyline;\n let show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n (!defined(showProperty) || showProperty.getValue(time));\n\n //While we want to show the path, there may not actually be anything to show\n //depending on lead/trail settings. Compute the interval of the path to\n //show and check against actual availability.\n if (show) {\n const leadTime = Property.getValueOrUndefined(pathGraphics._leadTime, time);\n const trailTime = Property.getValueOrUndefined(\n pathGraphics._trailTime,\n time\n );\n const availability = entity._availability;\n const hasAvailability = defined(availability);\n const hasLeadTime = defined(leadTime);\n const hasTrailTime = defined(trailTime);\n\n //Objects need to have either defined availability or both a lead and trail time in order to\n //draw a path (since we can't draw \"infinite\" paths.\n show = hasAvailability || (hasLeadTime && hasTrailTime);\n\n //The final step is to compute the actual start/stop times of the path to show.\n //If current time is outside of the availability interval, there's a chance that\n //we won't have to draw anything anyway.\n if (show) {\n if (hasTrailTime) {\n sampleStart = JulianDate.addSeconds(time, -trailTime, new JulianDate());\n }\n if (hasLeadTime) {\n sampleStop = JulianDate.addSeconds(time, leadTime, new JulianDate());\n }\n\n if (hasAvailability) {\n const start = availability.start;\n const stop = availability.stop;\n\n if (!hasTrailTime || JulianDate.greaterThan(start, sampleStart)) {\n sampleStart = start;\n }\n\n if (!hasLeadTime || JulianDate.lessThan(stop, sampleStop)) {\n sampleStop = stop;\n }\n }\n show = JulianDate.lessThan(sampleStart, sampleStop);\n }\n }\n\n if (!show) {\n //don't bother creating or updating anything else\n if (defined(polyline)) {\n this._unusedIndexes.push(item.index);\n item.polyline = undefined;\n polyline.show = false;\n item.index = undefined;\n }\n return;\n }\n\n if (!defined(polyline)) {\n const unusedIndexes = this._unusedIndexes;\n const length = unusedIndexes.length;\n if (length > 0) {\n const index = unusedIndexes.pop();\n polyline = this._polylineCollection.get(index);\n item.index = index;\n } else {\n item.index = this._polylineCollection.length;\n polyline = this._polylineCollection.add();\n }\n polyline.id = entity;\n item.polyline = polyline;\n }\n\n const resolution = Property.getValueOrDefault(\n pathGraphics._resolution,\n time,\n defaultResolution\n );\n\n polyline.show = true;\n polyline.positions = subSample(\n positionProperty,\n sampleStart,\n sampleStop,\n time,\n this._referenceFrame,\n resolution,\n polyline.positions.slice()\n );\n polyline.material = MaterialProperty.getValue(\n time,\n pathGraphics._material,\n polyline.material\n );\n polyline.width = Property.getValueOrDefault(\n pathGraphics._width,\n time,\n defaultWidth\n );\n polyline.distanceDisplayCondition = Property.getValueOrUndefined(\n pathGraphics._distanceDisplayCondition,\n time,\n polyline.distanceDisplayCondition\n );\n};\n\nPolylineUpdater.prototype.removeObject = function (item) {\n const polyline = item.polyline;\n if (defined(polyline)) {\n this._unusedIndexes.push(item.index);\n item.polyline = undefined;\n polyline.show = false;\n polyline.id = undefined;\n item.index = undefined;\n }\n};\n\nPolylineUpdater.prototype.destroy = function () {\n this._scene.primitives.remove(this._polylineCollection);\n return destroyObject(this);\n};\n\n/**\n * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.\n * @alias PathVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction PathVisualizer(scene, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n PathVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._scene = scene;\n this._updaters = {};\n this._entityCollection = entityCollection;\n this._items = new AssociativeArray();\n\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nPathVisualizer.prototype.update = function (time) {\n const updaters = this._updaters;\n for (const key in updaters) {\n if (updaters.hasOwnProperty(key)) {\n updaters[key].update(time);\n }\n }\n\n const items = this._items.values;\n if (\n items.length === 0 &&\n defined(this._updaters) &&\n Object.keys(this._updaters).length > 0\n ) {\n for (const u in updaters) {\n if (updaters.hasOwnProperty(u)) {\n updaters[u].destroy();\n }\n }\n this._updaters = {};\n }\n\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const entity = item.entity;\n const positionProperty = entity._position;\n\n const lastUpdater = item.updater;\n\n let frameToVisualize = ReferenceFrame.FIXED;\n if (this._scene.mode === SceneMode.SCENE3D) {\n frameToVisualize = positionProperty.referenceFrame;\n }\n\n let currentUpdater = this._updaters[frameToVisualize];\n\n if (lastUpdater === currentUpdater && defined(currentUpdater)) {\n currentUpdater.updateObject(time, item);\n continue;\n }\n\n if (defined(lastUpdater)) {\n lastUpdater.removeObject(item);\n }\n\n if (!defined(currentUpdater)) {\n currentUpdater = new PolylineUpdater(this._scene, frameToVisualize);\n currentUpdater.update(time);\n this._updaters[frameToVisualize] = currentUpdater;\n }\n\n item.updater = currentUpdater;\n if (defined(currentUpdater)) {\n currentUpdater.updateObject(time, item);\n }\n }\n return true;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nPathVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPathVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n PathVisualizer.prototype._onCollectionChanged,\n this\n );\n\n const updaters = this._updaters;\n for (const key in updaters) {\n if (updaters.hasOwnProperty(key)) {\n updaters[key].destroy();\n }\n }\n\n return destroyObject(this);\n};\n\nPathVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n let item;\n const items = this._items;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._path) && defined(entity._position)) {\n items.set(entity.id, new EntityData(entity));\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._path) && defined(entity._position)) {\n if (!items.contains(entity.id)) {\n items.set(entity.id, new EntityData(entity));\n }\n } else {\n item = items.get(entity.id);\n if (defined(item)) {\n if (defined(item.updater)) {\n item.updater.removeObject(item);\n }\n items.remove(entity.id);\n }\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n item = items.get(entity.id);\n if (defined(item)) {\n if (defined(item.updater)) {\n item.updater.removeObject(item);\n }\n items.remove(entity.id);\n }\n }\n};\n\n//for testing\nPathVisualizer._subSample = subSample;\nexport default PathVisualizer;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport createBillboardPointCallback from \"../Scene/createBillboardPointCallback.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport Property from \"./Property.js\";\n\nconst defaultColor = Color.WHITE;\nconst defaultOutlineColor = Color.BLACK;\nconst defaultOutlineWidth = 0.0;\nconst defaultPixelSize = 1.0;\nconst defaultDisableDepthTestDistance = 0.0;\n\nconst colorScratch = new Color();\nconst positionScratch = new Cartesian3();\nconst outlineColorScratch = new Color();\nconst scaleByDistanceScratch = new NearFarScalar();\nconst translucencyByDistanceScratch = new NearFarScalar();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\n\nfunction EntityData(entity) {\n this.entity = entity;\n this.pointPrimitive = undefined;\n this.billboard = undefined;\n this.color = undefined;\n this.outlineColor = undefined;\n this.pixelSize = undefined;\n this.outlineWidth = undefined;\n}\n\n/**\n * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.\n * @alias PointVisualizer\n * @constructor\n *\n * @param {EntityCluster} entityCluster The entity cluster to manage the collection of billboards and optionally cluster with other entities.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n */\nfunction PointVisualizer(entityCluster, entityCollection) {\n entityCollection.collectionChanged.addEventListener(\n PointVisualizer.prototype._onCollectionChanged,\n this\n );\n\n this._cluster = entityCluster;\n this._entityCollection = entityCollection;\n this._items = new AssociativeArray();\n this._onCollectionChanged(entityCollection, entityCollection.values, [], []);\n}\n\n/**\n * Updates the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} This function always returns true.\n */\nPointVisualizer.prototype.update = function (time) {\n const items = this._items.values;\n const cluster = this._cluster;\n for (let i = 0, len = items.length; i < len; i++) {\n const item = items[i];\n const entity = item.entity;\n const pointGraphics = entity._point;\n let pointPrimitive = item.pointPrimitive;\n let billboard = item.billboard;\n const heightReference = Property.getValueOrDefault(\n pointGraphics._heightReference,\n time,\n HeightReference.NONE\n );\n let show =\n entity.isShowing &&\n entity.isAvailable(time) &&\n Property.getValueOrDefault(pointGraphics._show, time, true);\n let position;\n if (show) {\n position = Property.getValueOrUndefined(\n entity._position,\n time,\n positionScratch\n );\n show = defined(position);\n }\n if (!show) {\n returnPrimitive(item, entity, cluster);\n continue;\n }\n\n if (!Property.isConstant(entity._position)) {\n cluster._clusterDirty = true;\n }\n\n let needsRedraw = false;\n let updateClamping = false;\n if (heightReference !== HeightReference.NONE && !defined(billboard)) {\n if (defined(pointPrimitive)) {\n returnPrimitive(item, entity, cluster);\n pointPrimitive = undefined;\n }\n\n billboard = cluster.getBillboard(entity);\n billboard.id = entity;\n billboard.image = undefined;\n item.billboard = billboard;\n needsRedraw = true;\n\n // If this new billboard happens to have a position and height reference that match our new values,\n // billboard._updateClamping will not be called automatically. That's a problem because the clamped\n // height may be based on different terrain than is now loaded. So we'll manually call\n // _updateClamping below.\n updateClamping =\n Cartesian3.equals(billboard.position, position) &&\n billboard.heightReference === heightReference;\n } else if (\n heightReference === HeightReference.NONE &&\n !defined(pointPrimitive)\n ) {\n if (defined(billboard)) {\n returnPrimitive(item, entity, cluster);\n billboard = undefined;\n }\n\n pointPrimitive = cluster.getPoint(entity);\n pointPrimitive.id = entity;\n item.pointPrimitive = pointPrimitive;\n }\n\n if (defined(pointPrimitive)) {\n pointPrimitive.show = true;\n pointPrimitive.position = position;\n pointPrimitive.scaleByDistance = Property.getValueOrUndefined(\n pointGraphics._scaleByDistance,\n time,\n scaleByDistanceScratch\n );\n pointPrimitive.translucencyByDistance = Property.getValueOrUndefined(\n pointGraphics._translucencyByDistance,\n time,\n translucencyByDistanceScratch\n );\n pointPrimitive.color = Property.getValueOrDefault(\n pointGraphics._color,\n time,\n defaultColor,\n colorScratch\n );\n pointPrimitive.outlineColor = Property.getValueOrDefault(\n pointGraphics._outlineColor,\n time,\n defaultOutlineColor,\n outlineColorScratch\n );\n pointPrimitive.outlineWidth = Property.getValueOrDefault(\n pointGraphics._outlineWidth,\n time,\n defaultOutlineWidth\n );\n pointPrimitive.pixelSize = Property.getValueOrDefault(\n pointGraphics._pixelSize,\n time,\n defaultPixelSize\n );\n pointPrimitive.distanceDisplayCondition = Property.getValueOrUndefined(\n pointGraphics._distanceDisplayCondition,\n time,\n distanceDisplayConditionScratch\n );\n pointPrimitive.disableDepthTestDistance = Property.getValueOrDefault(\n pointGraphics._disableDepthTestDistance,\n time,\n defaultDisableDepthTestDistance\n );\n } else if (defined(billboard)) {\n billboard.show = true;\n billboard.position = position;\n billboard.scaleByDistance = Property.getValueOrUndefined(\n pointGraphics._scaleByDistance,\n time,\n scaleByDistanceScratch\n );\n billboard.translucencyByDistance = Property.getValueOrUndefined(\n pointGraphics._translucencyByDistance,\n time,\n translucencyByDistanceScratch\n );\n billboard.distanceDisplayCondition = Property.getValueOrUndefined(\n pointGraphics._distanceDisplayCondition,\n time,\n distanceDisplayConditionScratch\n );\n billboard.disableDepthTestDistance = Property.getValueOrDefault(\n pointGraphics._disableDepthTestDistance,\n time,\n defaultDisableDepthTestDistance\n );\n billboard.heightReference = heightReference;\n\n const newColor = Property.getValueOrDefault(\n pointGraphics._color,\n time,\n defaultColor,\n colorScratch\n );\n const newOutlineColor = Property.getValueOrDefault(\n pointGraphics._outlineColor,\n time,\n defaultOutlineColor,\n outlineColorScratch\n );\n const newOutlineWidth = Math.round(\n Property.getValueOrDefault(\n pointGraphics._outlineWidth,\n time,\n defaultOutlineWidth\n )\n );\n let newPixelSize = Math.max(\n 1,\n Math.round(\n Property.getValueOrDefault(\n pointGraphics._pixelSize,\n time,\n defaultPixelSize\n )\n )\n );\n\n if (newOutlineWidth > 0) {\n billboard.scale = 1.0;\n needsRedraw =\n needsRedraw || //\n newOutlineWidth !== item.outlineWidth || //\n newPixelSize !== item.pixelSize || //\n !Color.equals(newColor, item.color) || //\n !Color.equals(newOutlineColor, item.outlineColor);\n } else {\n billboard.scale = newPixelSize / 50.0;\n newPixelSize = 50.0;\n needsRedraw =\n needsRedraw || //\n newOutlineWidth !== item.outlineWidth || //\n !Color.equals(newColor, item.color) || //\n !Color.equals(newOutlineColor, item.outlineColor);\n }\n\n if (needsRedraw) {\n item.color = Color.clone(newColor, item.color);\n item.outlineColor = Color.clone(newOutlineColor, item.outlineColor);\n item.pixelSize = newPixelSize;\n item.outlineWidth = newOutlineWidth;\n\n const centerAlpha = newColor.alpha;\n const cssColor = newColor.toCssColorString();\n const cssOutlineColor = newOutlineColor.toCssColorString();\n const textureId = JSON.stringify([\n cssColor,\n newPixelSize,\n cssOutlineColor,\n newOutlineWidth,\n ]);\n\n billboard.setImage(\n textureId,\n createBillboardPointCallback(\n centerAlpha,\n cssColor,\n cssOutlineColor,\n newOutlineWidth,\n newPixelSize\n )\n );\n }\n\n if (updateClamping) {\n billboard._updateClamping();\n }\n }\n }\n return true;\n};\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nPointVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const item = this._items.get(entity.id);\n if (\n !defined(item) ||\n !(defined(item.pointPrimitive) || defined(item.billboard))\n ) {\n return BoundingSphereState.FAILED;\n }\n\n if (defined(item.pointPrimitive)) {\n result.center = Cartesian3.clone(\n item.pointPrimitive.position,\n result.center\n );\n } else {\n const billboard = item.billboard;\n if (!defined(billboard._clampedPosition)) {\n return BoundingSphereState.PENDING;\n }\n result.center = Cartesian3.clone(billboard._clampedPosition, result.center);\n }\n\n result.radius = 0;\n return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nPointVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPointVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n PointVisualizer.prototype._onCollectionChanged,\n this\n );\n const entities = this._entityCollection.values;\n for (let i = 0; i < entities.length; i++) {\n this._cluster.removePoint(entities[i]);\n }\n return destroyObject(this);\n};\n\nPointVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed,\n changed\n) {\n let i;\n let entity;\n const items = this._items;\n const cluster = this._cluster;\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n if (defined(entity._point) && defined(entity._position)) {\n items.set(entity.id, new EntityData(entity));\n }\n }\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n if (defined(entity._point) && defined(entity._position)) {\n if (!items.contains(entity.id)) {\n items.set(entity.id, new EntityData(entity));\n }\n } else {\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n returnPrimitive(items.get(entity.id), entity, cluster);\n items.remove(entity.id);\n }\n};\n\nfunction returnPrimitive(item, entity, cluster) {\n if (defined(item)) {\n const pointPrimitive = item.pointPrimitive;\n if (defined(pointPrimitive)) {\n item.pointPrimitive = undefined;\n cluster.removePoint(entity);\n return;\n }\n const billboard = item.billboard;\n if (defined(billboard)) {\n item.billboard = undefined;\n cluster.removeBillboard(entity);\n }\n }\n}\nexport default PointVisualizer;\n", "import ArcType from \"./ArcType.js\";\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryType from \"./GeometryType.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchInterpolateColorsArray = [];\n\nfunction interpolateColors(p0, p1, color0, color1, numPoints) {\n const colors = scratchInterpolateColorsArray;\n colors.length = numPoints;\n let i;\n\n const r0 = color0.red;\n const g0 = color0.green;\n const b0 = color0.blue;\n const a0 = color0.alpha;\n\n const r1 = color1.red;\n const g1 = color1.green;\n const b1 = color1.blue;\n const a1 = color1.alpha;\n\n if (Color.equals(color0, color1)) {\n for (i = 0; i < numPoints; i++) {\n colors[i] = Color.clone(color0);\n }\n return colors;\n }\n\n const redPerVertex = (r1 - r0) / numPoints;\n const greenPerVertex = (g1 - g0) / numPoints;\n const bluePerVertex = (b1 - b0) / numPoints;\n const alphaPerVertex = (a1 - a0) / numPoints;\n\n for (i = 0; i < numPoints; i++) {\n colors[i] = new Color(\n r0 + i * redPerVertex,\n g0 + i * greenPerVertex,\n b0 + i * bluePerVertex,\n a0 + i * alphaPerVertex\n );\n }\n\n return colors;\n}\n\n/**\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\n * and each additional position defines a line segment from the previous position. The polyline is capable of\n * displaying with a material.\n *\n * @alias PolylineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\n * @param {Number} [options.width=1.0] The width in pixels.\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\n * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n *\n * @exception {DeveloperError} At least two positions are required.\n * @exception {DeveloperError} width must be greater than or equal to one.\n * @exception {DeveloperError} colors has an invalid length.\n *\n * @see PolylineGeometry#createGeometry\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}\n *\n * @example\n * // A polyline with two connected line segments\n * const polyline = new Cesium.PolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 5.0, 0.0,\n * 5.0, 5.0\n * ]),\n * width : 10.0\n * });\n * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);\n */\nfunction PolylineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n const colors = options.colors;\n const width = defaultValue(options.width, 1.0);\n const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\n\n this._positions = positions;\n this._colors = colors;\n this._width = width;\n this._colorsPerVertex = colorsPerVertex;\n this._vertexFormat = VertexFormat.clone(\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\n );\n\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._ellipsoid = Ellipsoid.clone(\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\n );\n this._workerName = \"createPolylineGeometry\";\n\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\n numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 4;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PolylineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPolylineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const colors = value._colors;\n length = defined(colors) ? colors.length : 0.0;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n Color.pack(colors[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n\n array[startingIndex++] = value._width;\n array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\n array[startingIndex++] = value._arcType;\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\nconst scratchVertexFormat = new VertexFormat();\nconst scratchOptions = {\n positions: undefined,\n colors: undefined,\n ellipsoid: scratchEllipsoid,\n vertexFormat: scratchVertexFormat,\n width: undefined,\n colorsPerVertex: undefined,\n arcType: undefined,\n granularity: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PolylineGeometry} [result] The object into which to store the result.\n * @returns {PolylineGeometry} The modified result parameter or a new PolylineGeometry instance if one was not provided.\n */\nPolylineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n const colors = length > 0 ? new Array(length) : undefined;\n\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n colors[i] = Color.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\n startingIndex += Ellipsoid.packedLength;\n\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n\n const width = array[startingIndex++];\n const colorsPerVertex = array[startingIndex++] === 1.0;\n const arcType = array[startingIndex++];\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n scratchOptions.positions = positions;\n scratchOptions.colors = colors;\n scratchOptions.width = width;\n scratchOptions.colorsPerVertex = colorsPerVertex;\n scratchOptions.arcType = arcType;\n scratchOptions.granularity = granularity;\n return new PolylineGeometry(scratchOptions);\n }\n\n result._positions = positions;\n result._colors = colors;\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._width = width;\n result._colorsPerVertex = colorsPerVertex;\n result._arcType = arcType;\n result._granularity = granularity;\n\n return result;\n};\n\nconst scratchCartesian3 = new Cartesian3();\nconst scratchPosition = new Cartesian3();\nconst scratchPrevPosition = new Cartesian3();\nconst scratchNextPosition = new Cartesian3();\n\n/**\n * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.\n *\n * @param {PolylineGeometry} polylineGeometry A description of the polyline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nPolylineGeometry.createGeometry = function (polylineGeometry) {\n const width = polylineGeometry._width;\n const vertexFormat = polylineGeometry._vertexFormat;\n let colors = polylineGeometry._colors;\n const colorsPerVertex = polylineGeometry._colorsPerVertex;\n const arcType = polylineGeometry._arcType;\n const granularity = polylineGeometry._granularity;\n const ellipsoid = polylineGeometry._ellipsoid;\n\n let i;\n let j;\n let k;\n\n const removedIndices = [];\n let positions = arrayRemoveDuplicates(\n polylineGeometry._positions,\n Cartesian3.equalsEpsilon,\n false,\n removedIndices\n );\n\n if (defined(colors) && removedIndices.length > 0) {\n let removedArrayIndex = 0;\n let nextRemovedIndex = removedIndices[0];\n colors = colors.filter(function (color, index) {\n let remove = false;\n if (colorsPerVertex) {\n remove =\n index === nextRemovedIndex || (index === 0 && nextRemovedIndex === 1);\n } else {\n remove = index + 1 === nextRemovedIndex;\n }\n\n if (remove) {\n removedArrayIndex++;\n nextRemovedIndex = removedIndices[removedArrayIndex];\n return false;\n }\n return true;\n });\n }\n\n let positionsLength = positions.length;\n\n // A width of a pixel or less is not a valid geometry, but in order to support external data\n // that may have errors we treat this as an empty geometry.\n if (positionsLength < 2 || width <= 0.0) {\n return undefined;\n }\n\n if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\n let subdivisionSize;\n let numberOfPointsFunction;\n if (arcType === ArcType.GEODESIC) {\n subdivisionSize = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n numberOfPointsFunction = PolylinePipeline.numberOfPoints;\n } else {\n subdivisionSize = granularity;\n numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\n }\n\n const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\n\n if (defined(colors)) {\n let colorLength = 1;\n for (i = 0; i < positionsLength - 1; ++i) {\n colorLength += numberOfPointsFunction(\n positions[i],\n positions[i + 1],\n subdivisionSize\n );\n }\n\n const newColors = new Array(colorLength);\n let newColorIndex = 0;\n\n for (i = 0; i < positionsLength - 1; ++i) {\n const p0 = positions[i];\n const p1 = positions[i + 1];\n const c0 = colors[i];\n\n const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);\n if (colorsPerVertex && i < colorLength) {\n const c1 = colors[i + 1];\n const interpolatedColors = interpolateColors(\n p0,\n p1,\n c0,\n c1,\n numColors\n );\n const interpolatedColorsLength = interpolatedColors.length;\n for (j = 0; j < interpolatedColorsLength; ++j) {\n newColors[newColorIndex++] = interpolatedColors[j];\n }\n } else {\n for (j = 0; j < numColors; ++j) {\n newColors[newColorIndex++] = Color.clone(c0);\n }\n }\n }\n\n newColors[newColorIndex] = Color.clone(colors[colors.length - 1]);\n colors = newColors;\n\n scratchInterpolateColorsArray.length = 0;\n }\n\n if (arcType === ArcType.GEODESIC) {\n positions = PolylinePipeline.generateCartesianArc({\n positions: positions,\n minDistance: subdivisionSize,\n ellipsoid: ellipsoid,\n height: heights,\n });\n } else {\n positions = PolylinePipeline.generateCartesianRhumbArc({\n positions: positions,\n granularity: subdivisionSize,\n ellipsoid: ellipsoid,\n height: heights,\n });\n }\n }\n\n positionsLength = positions.length;\n const size = positionsLength * 4.0 - 4.0;\n\n const finalPositions = new Float64Array(size * 3);\n const prevPositions = new Float64Array(size * 3);\n const nextPositions = new Float64Array(size * 3);\n const expandAndWidth = new Float32Array(size * 2);\n const st = vertexFormat.st ? new Float32Array(size * 2) : undefined;\n const finalColors = defined(colors) ? new Uint8Array(size * 4) : undefined;\n\n let positionIndex = 0;\n let expandAndWidthIndex = 0;\n let stIndex = 0;\n let colorIndex = 0;\n let position;\n\n for (j = 0; j < positionsLength; ++j) {\n if (j === 0) {\n position = scratchCartesian3;\n Cartesian3.subtract(positions[0], positions[1], position);\n Cartesian3.add(positions[0], position, position);\n } else {\n position = positions[j - 1];\n }\n\n Cartesian3.clone(position, scratchPrevPosition);\n Cartesian3.clone(positions[j], scratchPosition);\n\n if (j === positionsLength - 1) {\n position = scratchCartesian3;\n Cartesian3.subtract(\n positions[positionsLength - 1],\n positions[positionsLength - 2],\n position\n );\n Cartesian3.add(positions[positionsLength - 1], position, position);\n } else {\n position = positions[j + 1];\n }\n\n Cartesian3.clone(position, scratchNextPosition);\n\n let color0, color1;\n if (defined(finalColors)) {\n if (j !== 0 && !colorsPerVertex) {\n color0 = colors[j - 1];\n } else {\n color0 = colors[j];\n }\n\n if (j !== positionsLength - 1) {\n color1 = colors[j];\n }\n }\n\n const startK = j === 0 ? 2 : 0;\n const endK = j === positionsLength - 1 ? 2 : 4;\n\n for (k = startK; k < endK; ++k) {\n Cartesian3.pack(scratchPosition, finalPositions, positionIndex);\n Cartesian3.pack(scratchPrevPosition, prevPositions, positionIndex);\n Cartesian3.pack(scratchNextPosition, nextPositions, positionIndex);\n positionIndex += 3;\n\n const direction = k - 2 < 0 ? -1.0 : 1.0;\n expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1; // expand direction\n expandAndWidth[expandAndWidthIndex++] = direction * width;\n\n if (vertexFormat.st) {\n st[stIndex++] = j / (positionsLength - 1);\n st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0.0);\n }\n\n if (defined(finalColors)) {\n const color = k < 2 ? color0 : color1;\n\n finalColors[colorIndex++] = Color.floatToByte(color.red);\n finalColors[colorIndex++] = Color.floatToByte(color.green);\n finalColors[colorIndex++] = Color.floatToByte(color.blue);\n finalColors[colorIndex++] = Color.floatToByte(color.alpha);\n }\n }\n }\n\n const attributes = new GeometryAttributes();\n\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: finalPositions,\n });\n\n attributes.prevPosition = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: prevPositions,\n });\n\n attributes.nextPosition = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: nextPositions,\n });\n\n attributes.expandAndWidth = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: expandAndWidth,\n });\n\n if (vertexFormat.st) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: st,\n });\n }\n\n if (defined(finalColors)) {\n attributes.color = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 4,\n values: finalColors,\n normalize: true,\n });\n }\n\n const indices = IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);\n let index = 0;\n let indicesIndex = 0;\n const length = positionsLength - 1.0;\n for (j = 0; j < length; ++j) {\n indices[indicesIndex++] = index;\n indices[indicesIndex++] = index + 2;\n indices[indicesIndex++] = index + 1;\n\n indices[indicesIndex++] = index + 1;\n indices[indicesIndex++] = index + 2;\n indices[indicesIndex++] = index + 3;\n\n index += 4;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: BoundingSphere.fromPoints(positions),\n geometryType: GeometryType.POLYLINES,\n });\n};\nexport default PolylineGeometry;\n", "import ArcType from \"../Core/ArcType.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport Event from \"../Core/Event.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GroundPolylineGeometry from \"../Core/GroundPolylineGeometry.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PolylineGeometry from \"../Core/PolylineGeometry.js\";\nimport PolylinePipeline from \"../Core/PolylinePipeline.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Entity from \"../DataSources/Entity.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport PolylineCollection from \"../Scene/PolylineCollection.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst defaultZIndex = new ConstantProperty(0);\n\n//We use this object to create one polyline collection per-scene.\nconst polylineCollections = {};\n\nconst scratchColor = new Color();\nconst defaultMaterial = new ColorMaterialProperty(Color.WHITE);\nconst defaultShow = new ConstantProperty(true);\nconst defaultShadows = new ConstantProperty(ShadowMode.DISABLED);\nconst defaultDistanceDisplayCondition = new ConstantProperty(\n new DistanceDisplayCondition()\n);\nconst defaultClassificationType = new ConstantProperty(ClassificationType.BOTH);\n\nfunction GeometryOptions() {\n this.vertexFormat = undefined;\n this.positions = undefined;\n this.width = undefined;\n this.arcType = undefined;\n this.granularity = undefined;\n}\n\nfunction GroundGeometryOptions() {\n this.positions = undefined;\n this.width = undefined;\n this.arcType = undefined;\n this.granularity = undefined;\n}\n\n/**\n * A {@link GeometryUpdater} for polylines.\n * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.\n * @alias PolylineGeometryUpdater\n * @constructor\n *\n * @param {Entity} entity The entity containing the geometry to be visualized.\n * @param {Scene} scene The scene where visualization is taking place.\n */\nfunction PolylineGeometryUpdater(entity, scene) {\n this._entity = entity;\n this._scene = scene;\n this._entitySubscription = entity.definitionChanged.addEventListener(\n PolylineGeometryUpdater.prototype._onEntityPropertyChanged,\n this\n );\n this._fillEnabled = false;\n this._dynamic = false;\n this._geometryChanged = new Event();\n this._showProperty = undefined;\n this._materialProperty = undefined;\n this._shadowsProperty = undefined;\n this._distanceDisplayConditionProperty = undefined;\n this._classificationTypeProperty = undefined;\n this._depthFailMaterialProperty = undefined;\n this._geometryOptions = new GeometryOptions();\n this._groundGeometryOptions = new GroundGeometryOptions();\n this._id = `polyline-${entity.id}`;\n this._clampToGround = false;\n this._supportsPolylinesOnTerrain = Entity.supportsPolylinesOnTerrain(scene);\n\n this._zIndex = 0;\n\n this._onEntityPropertyChanged(entity, \"polyline\", entity.polyline, undefined);\n}\n\nObject.defineProperties(PolylineGeometryUpdater.prototype, {\n /**\n * Gets the unique ID associated with this updater\n * @memberof PolylineGeometryUpdater.prototype\n * @type {String}\n * @readonly\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n /**\n * Gets the entity associated with this geometry.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Entity}\n * @readonly\n */\n entity: {\n get: function () {\n return this._entity;\n },\n },\n /**\n * Gets a value indicating if the geometry has a fill component.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n fillEnabled: {\n get: function () {\n return this._fillEnabled;\n },\n },\n /**\n * Gets a value indicating if fill visibility varies with simulation time.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n hasConstantFill: {\n get: function () {\n return (\n !this._fillEnabled ||\n (!defined(this._entity.availability) &&\n Property.isConstant(this._showProperty))\n );\n },\n },\n /**\n * Gets the material property used to fill the geometry.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {MaterialProperty}\n * @readonly\n */\n fillMaterialProperty: {\n get: function () {\n return this._materialProperty;\n },\n },\n /**\n * Gets the material property used to fill the geometry when it fails the depth test.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {MaterialProperty}\n * @readonly\n */\n depthFailMaterialProperty: {\n get: function () {\n return this._depthFailMaterialProperty;\n },\n },\n /**\n * Gets a value indicating if the geometry has an outline component.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n outlineEnabled: {\n value: false,\n },\n /**\n * Gets a value indicating if outline visibility varies with simulation time.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n hasConstantOutline: {\n value: true,\n },\n /**\n * Gets the {@link Color} property for the geometry outline.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n outlineColorProperty: {\n value: undefined,\n },\n /**\n * Gets the property specifying whether the geometry\n * casts or receives shadows from light sources.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n shadowsProperty: {\n get: function () {\n return this._shadowsProperty;\n },\n },\n /**\n * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n distanceDisplayConditionProperty: {\n get: function () {\n return this._distanceDisplayConditionProperty;\n },\n },\n /**\n * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Property}\n * @readonly\n */\n classificationTypeProperty: {\n get: function () {\n return this._classificationTypeProperty;\n },\n },\n /**\n * Gets a value indicating if the geometry is time-varying.\n * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}\n * returned by GeometryUpdater#createDynamicUpdater.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isDynamic: {\n get: function () {\n return this._dynamic;\n },\n },\n /**\n * Gets a value indicating if the geometry is closed.\n * This property is only valid for static geometry.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n isClosed: {\n value: false,\n },\n /**\n * Gets an event that is raised whenever the public properties\n * of this updater change.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n geometryChanged: {\n get: function () {\n return this._geometryChanged;\n },\n },\n\n /**\n * Gets a value indicating if the path of the line.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {ArcType}\n * @readonly\n */\n arcType: {\n get: function () {\n return this._arcType;\n },\n },\n\n /**\n * Gets a value indicating if the geometry is clamped to the ground.\n * Returns false if polylines on terrain is not supported.\n * @memberof PolylineGeometryUpdater.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n clampToGround: {\n get: function () {\n return this._clampToGround && this._supportsPolylinesOnTerrain;\n },\n },\n\n /**\n * Gets the zindex\n * @type {Number}\n * @memberof PolylineGeometryUpdater.prototype\n * @readonly\n */\n zIndex: {\n get: function () {\n return this._zIndex;\n },\n },\n});\n\n/**\n * Checks if the geometry is outlined at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {Boolean} true if geometry is outlined at the provided time, false otherwise.\n */\nPolylineGeometryUpdater.prototype.isOutlineVisible = function (time) {\n return false;\n};\n\n/**\n * Checks if the geometry is filled at the provided time.\n *\n * @param {JulianDate} time The time for which to retrieve visibility.\n * @returns {Boolean} true if geometry is filled at the provided time, false otherwise.\n */\nPolylineGeometryUpdater.prototype.isFilled = function (time) {\n const entity = this._entity;\n const visible =\n this._fillEnabled &&\n entity.isAvailable(time) &&\n this._showProperty.getValue(time);\n return defaultValue(visible, false);\n};\n\n/**\n * Creates the geometry instance which represents the fill of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent a filled geometry.\n */\nPolylineGeometryUpdater.prototype.createFillGeometryInstance = function (time) {\n const entity = this._entity;\n const isAvailable = entity.isAvailable(time);\n const show = new ShowGeometryInstanceAttribute(\n isAvailable && entity.isShowing && this._showProperty.getValue(time)\n );\n const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(\n time\n );\n const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(\n distanceDisplayCondition\n );\n\n const attributes = {\n show: show,\n distanceDisplayCondition: distanceDisplayConditionAttribute,\n };\n\n let currentColor;\n if (this._materialProperty instanceof ColorMaterialProperty) {\n if (\n defined(this._materialProperty.color) &&\n (this._materialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._materialProperty.color.getValue(time, scratchColor);\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.color = ColorGeometryInstanceAttribute.fromColor(currentColor);\n }\n\n if (this.clampToGround) {\n return new GeometryInstance({\n id: entity,\n geometry: new GroundPolylineGeometry(this._groundGeometryOptions),\n attributes: attributes,\n });\n }\n\n if (\n defined(this._depthFailMaterialProperty) &&\n this._depthFailMaterialProperty instanceof ColorMaterialProperty\n ) {\n if (\n defined(this._depthFailMaterialProperty.color) &&\n (this._depthFailMaterialProperty.color.isConstant || isAvailable)\n ) {\n currentColor = this._depthFailMaterialProperty.color.getValue(\n time,\n scratchColor\n );\n }\n if (!defined(currentColor)) {\n currentColor = Color.WHITE;\n }\n attributes.depthFailColor = ColorGeometryInstanceAttribute.fromColor(\n currentColor\n );\n }\n\n return new GeometryInstance({\n id: entity,\n geometry: new PolylineGeometry(this._geometryOptions),\n attributes: attributes,\n });\n};\n\n/**\n * Creates the geometry instance which represents the outline of the geometry.\n *\n * @param {JulianDate} time The time to use when retrieving initial attribute values.\n * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.\n *\n * @exception {DeveloperError} This instance does not represent an outlined geometry.\n */\nPolylineGeometryUpdater.prototype.createOutlineGeometryInstance = function (\n time\n) {\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nPolylineGeometryUpdater.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys and resources used by the object. Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nPolylineGeometryUpdater.prototype.destroy = function () {\n this._entitySubscription();\n destroyObject(this);\n};\n\nPolylineGeometryUpdater.prototype._onEntityPropertyChanged = function (\n entity,\n propertyName,\n newValue,\n oldValue\n) {\n if (!(propertyName === \"availability\" || propertyName === \"polyline\")) {\n return;\n }\n\n const polyline = this._entity.polyline;\n\n if (!defined(polyline)) {\n if (this._fillEnabled) {\n this._fillEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n const positionsProperty = polyline.positions;\n\n const show = polyline.show;\n if (\n (defined(show) &&\n show.isConstant &&\n !show.getValue(Iso8601.MINIMUM_VALUE)) || //\n !defined(positionsProperty)\n ) {\n if (this._fillEnabled) {\n this._fillEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n const zIndex = polyline.zIndex;\n const material = defaultValue(polyline.material, defaultMaterial);\n const isColorMaterial = material instanceof ColorMaterialProperty;\n this._materialProperty = material;\n this._depthFailMaterialProperty = polyline.depthFailMaterial;\n this._showProperty = defaultValue(show, defaultShow);\n this._shadowsProperty = defaultValue(polyline.shadows, defaultShadows);\n this._distanceDisplayConditionProperty = defaultValue(\n polyline.distanceDisplayCondition,\n defaultDistanceDisplayCondition\n );\n this._classificationTypeProperty = defaultValue(\n polyline.classificationType,\n defaultClassificationType\n );\n this._fillEnabled = true;\n this._zIndex = defaultValue(zIndex, defaultZIndex);\n\n const width = polyline.width;\n const arcType = polyline.arcType;\n const clampToGround = polyline.clampToGround;\n const granularity = polyline.granularity;\n\n if (\n !positionsProperty.isConstant ||\n !Property.isConstant(width) ||\n !Property.isConstant(arcType) ||\n !Property.isConstant(granularity) ||\n !Property.isConstant(clampToGround) ||\n !Property.isConstant(zIndex)\n ) {\n if (!this._dynamic) {\n this._dynamic = true;\n this._geometryChanged.raiseEvent(this);\n }\n } else {\n const geometryOptions = this._geometryOptions;\n const positions = positionsProperty.getValue(\n Iso8601.MINIMUM_VALUE,\n geometryOptions.positions\n );\n\n //Because of the way we currently handle reference properties,\n //we can't automatically assume the positions are always valid.\n if (!defined(positions) || positions.length < 2) {\n if (this._fillEnabled) {\n this._fillEnabled = false;\n this._geometryChanged.raiseEvent(this);\n }\n return;\n }\n\n let vertexFormat;\n if (\n isColorMaterial &&\n (!defined(this._depthFailMaterialProperty) ||\n this._depthFailMaterialProperty instanceof ColorMaterialProperty)\n ) {\n vertexFormat = PolylineColorAppearance.VERTEX_FORMAT;\n } else {\n vertexFormat = PolylineMaterialAppearance.VERTEX_FORMAT;\n }\n\n geometryOptions.vertexFormat = vertexFormat;\n geometryOptions.positions = positions;\n geometryOptions.width = defined(width)\n ? width.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n geometryOptions.arcType = defined(arcType)\n ? arcType.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n geometryOptions.granularity = defined(granularity)\n ? granularity.getValue(Iso8601.MINIMUM_VALUE)\n : undefined;\n\n const groundGeometryOptions = this._groundGeometryOptions;\n groundGeometryOptions.positions = positions;\n groundGeometryOptions.width = geometryOptions.width;\n groundGeometryOptions.arcType = geometryOptions.arcType;\n groundGeometryOptions.granularity = geometryOptions.granularity;\n\n this._clampToGround = defined(clampToGround)\n ? clampToGround.getValue(Iso8601.MINIMUM_VALUE)\n : false;\n\n if (!this._clampToGround && defined(zIndex)) {\n oneTimeWarning(\n \"Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored.\"\n );\n }\n\n this._dynamic = false;\n this._geometryChanged.raiseEvent(this);\n }\n};\n\n/**\n * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.\n *\n * @param {PrimitiveCollection} primitives The primitive collection to use.\n * @param {PrimitiveCollection|OrderedGroundPrimitiveCollection} groundPrimitives The primitive collection to use for ordered ground primitives.\n * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.\n *\n * @exception {DeveloperError} This instance does not represent dynamic geometry.\n * @private\n */\nPolylineGeometryUpdater.prototype.createDynamicUpdater = function (\n primitives,\n groundPrimitives\n) {\n return new DynamicGeometryUpdater(primitives, groundPrimitives, this);\n};\n\n/**\n * @private\n */\nconst generateCartesianArcOptions = {\n positions: undefined,\n granularity: undefined,\n height: undefined,\n ellipsoid: undefined,\n};\n\nfunction DynamicGeometryUpdater(primitives, groundPrimitives, geometryUpdater) {\n this._line = undefined;\n this._primitives = primitives;\n this._groundPrimitives = groundPrimitives;\n this._groundPolylinePrimitive = undefined;\n this._material = undefined;\n this._geometryUpdater = geometryUpdater;\n this._positions = [];\n}\n\nfunction getLine(dynamicGeometryUpdater) {\n if (defined(dynamicGeometryUpdater._line)) {\n return dynamicGeometryUpdater._line;\n }\n\n const sceneId = dynamicGeometryUpdater._geometryUpdater._scene.id;\n let polylineCollection = polylineCollections[sceneId];\n const primitives = dynamicGeometryUpdater._primitives;\n if (!defined(polylineCollection) || polylineCollection.isDestroyed()) {\n polylineCollection = new PolylineCollection();\n polylineCollections[sceneId] = polylineCollection;\n primitives.add(polylineCollection);\n } else if (!primitives.contains(polylineCollection)) {\n primitives.add(polylineCollection);\n }\n\n const line = polylineCollection.add();\n line.id = dynamicGeometryUpdater._geometryUpdater._entity;\n dynamicGeometryUpdater._line = line;\n return line;\n}\n\nDynamicGeometryUpdater.prototype.update = function (time) {\n const geometryUpdater = this._geometryUpdater;\n const entity = geometryUpdater._entity;\n const polyline = entity.polyline;\n\n const positionsProperty = polyline.positions;\n let positions = Property.getValueOrUndefined(\n positionsProperty,\n time,\n this._positions\n );\n\n // Synchronize with geometryUpdater for GroundPolylinePrimitive\n geometryUpdater._clampToGround = Property.getValueOrDefault(\n polyline._clampToGround,\n time,\n false\n );\n geometryUpdater._groundGeometryOptions.positions = positions;\n geometryUpdater._groundGeometryOptions.width = Property.getValueOrDefault(\n polyline._width,\n time,\n 1\n );\n geometryUpdater._groundGeometryOptions.arcType = Property.getValueOrDefault(\n polyline._arcType,\n time,\n ArcType.GEODESIC\n );\n geometryUpdater._groundGeometryOptions.granularity = Property.getValueOrDefault(\n polyline._granularity,\n time,\n 9999\n );\n\n const groundPrimitives = this._groundPrimitives;\n\n if (defined(this._groundPolylinePrimitive)) {\n groundPrimitives.remove(this._groundPolylinePrimitive); // destroys by default\n this._groundPolylinePrimitive = undefined;\n }\n\n if (geometryUpdater.clampToGround) {\n if (\n !entity.isShowing ||\n !entity.isAvailable(time) ||\n !Property.getValueOrDefault(polyline._show, time, true)\n ) {\n return;\n }\n\n if (!defined(positions) || positions.length < 2) {\n return;\n }\n\n const fillMaterialProperty = geometryUpdater.fillMaterialProperty;\n let appearance;\n if (fillMaterialProperty instanceof ColorMaterialProperty) {\n appearance = new PolylineColorAppearance();\n } else {\n const material = MaterialProperty.getValue(\n time,\n fillMaterialProperty,\n this._material\n );\n appearance = new PolylineMaterialAppearance({\n material: material,\n translucent: material.isTranslucent(),\n });\n this._material = material;\n }\n\n this._groundPolylinePrimitive = groundPrimitives.add(\n new GroundPolylinePrimitive({\n geometryInstances: geometryUpdater.createFillGeometryInstance(time),\n appearance: appearance,\n classificationType: geometryUpdater.classificationTypeProperty.getValue(\n time\n ),\n asynchronous: false,\n }),\n Property.getValueOrUndefined(geometryUpdater.zIndex, time)\n );\n\n // Hide the polyline in the collection, if any\n if (defined(this._line)) {\n this._line.show = false;\n }\n return;\n }\n\n const line = getLine(this);\n\n if (\n !entity.isShowing ||\n !entity.isAvailable(time) ||\n !Property.getValueOrDefault(polyline._show, time, true)\n ) {\n line.show = false;\n return;\n }\n\n if (!defined(positions) || positions.length < 2) {\n line.show = false;\n return;\n }\n\n let arcType = ArcType.GEODESIC;\n arcType = Property.getValueOrDefault(polyline._arcType, time, arcType);\n\n const globe = geometryUpdater._scene.globe;\n if (arcType !== ArcType.NONE && defined(globe)) {\n generateCartesianArcOptions.ellipsoid = globe.ellipsoid;\n generateCartesianArcOptions.positions = positions;\n generateCartesianArcOptions.granularity = Property.getValueOrUndefined(\n polyline._granularity,\n time\n );\n generateCartesianArcOptions.height = PolylinePipeline.extractHeights(\n positions,\n globe.ellipsoid\n );\n if (arcType === ArcType.GEODESIC) {\n positions = PolylinePipeline.generateCartesianArc(\n generateCartesianArcOptions\n );\n } else {\n positions = PolylinePipeline.generateCartesianRhumbArc(\n generateCartesianArcOptions\n );\n }\n }\n\n line.show = true;\n line.positions = positions.slice();\n line.material = MaterialProperty.getValue(\n time,\n geometryUpdater.fillMaterialProperty,\n line.material\n );\n line.width = Property.getValueOrDefault(polyline._width, time, 1);\n line.distanceDisplayCondition = Property.getValueOrUndefined(\n polyline._distanceDisplayCondition,\n time,\n line.distanceDisplayCondition\n );\n};\n\nDynamicGeometryUpdater.prototype.getBoundingSphere = function (result) {\n if (!this._geometryUpdater.clampToGround) {\n const line = getLine(this);\n if (line.show && line.positions.length > 0) {\n BoundingSphere.fromPoints(line.positions, result);\n return BoundingSphereState.DONE;\n }\n } else {\n const groundPolylinePrimitive = this._groundPolylinePrimitive;\n if (\n defined(groundPolylinePrimitive) &&\n groundPolylinePrimitive.show &&\n groundPolylinePrimitive.ready\n ) {\n const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes(\n this._geometryUpdater._entity\n );\n if (defined(attributes) && defined(attributes.boundingSphere)) {\n BoundingSphere.clone(attributes.boundingSphere, result);\n return BoundingSphereState.DONE;\n }\n }\n\n if (defined(groundPolylinePrimitive) && !groundPolylinePrimitive.ready) {\n return BoundingSphereState.PENDING;\n }\n\n return BoundingSphereState.DONE;\n }\n\n return BoundingSphereState.FAILED;\n};\n\nDynamicGeometryUpdater.prototype.isDestroyed = function () {\n return false;\n};\n\nDynamicGeometryUpdater.prototype.destroy = function () {\n const geometryUpdater = this._geometryUpdater;\n const sceneId = geometryUpdater._scene.id;\n const polylineCollection = polylineCollections[sceneId];\n if (defined(polylineCollection)) {\n polylineCollection.remove(this._line);\n if (polylineCollection.length === 0) {\n this._primitives.removeAndDestroy(polylineCollection);\n delete polylineCollections[sceneId];\n }\n }\n if (defined(this._groundPolylinePrimitive)) {\n this._groundPrimitives.remove(this._groundPolylinePrimitive);\n }\n destroyObject(this);\n};\nexport default PolylineGeometryUpdater;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DistanceDisplayCondition from \"../Core/DistanceDisplayCondition.js\";\nimport DistanceDisplayConditionGeometryInstanceAttribute from \"../Core/DistanceDisplayConditionGeometryInstanceAttribute.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport MaterialProperty from \"./MaterialProperty.js\";\nimport Property from \"./Property.js\";\n\nconst scratchColor = new Color();\nconst distanceDisplayConditionScratch = new DistanceDisplayCondition();\nconst defaultDistanceDisplayCondition = new DistanceDisplayCondition();\n\n// Encapsulates a Primitive and all the entities that it represents.\nfunction Batch(\n orderedGroundPrimitives,\n classificationType,\n materialProperty,\n zIndex,\n asynchronous\n) {\n let appearanceType;\n if (materialProperty instanceof ColorMaterialProperty) {\n appearanceType = PolylineColorAppearance;\n } else {\n appearanceType = PolylineMaterialAppearance;\n }\n\n this.orderedGroundPrimitives = orderedGroundPrimitives; // scene level primitive collection\n this.classificationType = classificationType;\n this.appearanceType = appearanceType;\n this.materialProperty = materialProperty;\n this.updaters = new AssociativeArray();\n this.createPrimitive = true;\n this.primitive = undefined; // a GroundPolylinePrimitive encapsulating all the entities\n this.oldPrimitive = undefined;\n this.geometry = new AssociativeArray();\n this.material = undefined;\n this.updatersWithAttributes = new AssociativeArray();\n this.attributes = new AssociativeArray();\n this.invalidated = false;\n this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(\n Batch.prototype.onMaterialChanged,\n this\n );\n this.subscriptions = new AssociativeArray();\n this.showsUpdated = new AssociativeArray();\n this.zIndex = zIndex;\n\n this._asynchronous = asynchronous;\n}\n\nBatch.prototype.onMaterialChanged = function () {\n this.invalidated = true;\n};\n\n// Check if the given updater's material is compatible with this batch\nBatch.prototype.isMaterial = function (updater) {\n const material = this.materialProperty;\n const updaterMaterial = updater.fillMaterialProperty;\n\n if (\n updaterMaterial === material ||\n (updaterMaterial instanceof ColorMaterialProperty &&\n material instanceof ColorMaterialProperty)\n ) {\n return true;\n }\n return defined(material) && material.equals(updaterMaterial);\n};\n\nBatch.prototype.add = function (time, updater, geometryInstance) {\n const id = updater.id;\n this.updaters.set(id, updater);\n this.geometry.set(id, geometryInstance);\n // Updaters with dynamic attributes must be tracked separately, may exit the batch\n if (\n !updater.hasConstantFill ||\n !updater.fillMaterialProperty.isConstant ||\n !Property.isConstant(updater.distanceDisplayConditionProperty)\n ) {\n this.updatersWithAttributes.set(id, updater);\n } else {\n const that = this;\n // Listen for show changes. These will be synchronized in updateShows.\n this.subscriptions.set(\n id,\n updater.entity.definitionChanged.addEventListener(function (\n entity,\n propertyName,\n newValue,\n oldValue\n ) {\n if (propertyName === \"isShowing\") {\n that.showsUpdated.set(updater.id, updater);\n }\n })\n );\n }\n this.createPrimitive = true;\n};\n\nBatch.prototype.remove = function (updater) {\n const id = updater.id;\n this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;\n if (this.updaters.remove(id)) {\n this.updatersWithAttributes.remove(id);\n const unsubscribe = this.subscriptions.get(id);\n if (defined(unsubscribe)) {\n unsubscribe();\n this.subscriptions.remove(id);\n }\n return true;\n }\n return false;\n};\n\nBatch.prototype.update = function (time) {\n let isUpdated = true;\n let primitive = this.primitive;\n const orderedGroundPrimitives = this.orderedGroundPrimitives;\n const geometries = this.geometry.values;\n let i;\n\n if (this.createPrimitive) {\n const geometriesLength = geometries.length;\n if (geometriesLength > 0) {\n if (defined(primitive)) {\n // Keep a handle to the old primitive so it can be removed when the updated version is ready.\n if (!defined(this.oldPrimitive)) {\n this.oldPrimitive = primitive;\n } else {\n // For if the new primitive changes again before it is ready.\n orderedGroundPrimitives.remove(primitive);\n }\n }\n\n primitive = new GroundPolylinePrimitive({\n show: false,\n asynchronous: this._asynchronous,\n geometryInstances: geometries.slice(),\n appearance: new this.appearanceType(),\n classificationType: this.classificationType,\n });\n\n if (this.appearanceType === PolylineMaterialAppearance) {\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n primitive.appearance.material = this.material;\n }\n\n orderedGroundPrimitives.add(primitive, this.zIndex);\n isUpdated = false;\n } else {\n if (defined(primitive)) {\n orderedGroundPrimitives.remove(primitive);\n primitive = undefined;\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n orderedGroundPrimitives.remove(oldPrimitive);\n this.oldPrimitive = undefined;\n }\n }\n\n this.attributes.removeAll();\n this.primitive = primitive;\n this.createPrimitive = false;\n } else if (defined(primitive) && primitive.ready) {\n primitive.show = true;\n if (defined(this.oldPrimitive)) {\n orderedGroundPrimitives.remove(this.oldPrimitive);\n this.oldPrimitive = undefined;\n }\n\n if (this.appearanceType === PolylineMaterialAppearance) {\n this.material = MaterialProperty.getValue(\n time,\n this.materialProperty,\n this.material\n );\n this.primitive.appearance.material = this.material;\n }\n const updatersWithAttributes = this.updatersWithAttributes.values;\n const length = updatersWithAttributes.length;\n for (i = 0; i < length; i++) {\n const updater = updatersWithAttributes[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n if (!updater.fillMaterialProperty.isConstant) {\n const colorProperty = updater.fillMaterialProperty.color;\n const resultColor = Property.getValueOrDefault(\n colorProperty,\n time,\n Color.WHITE,\n scratchColor\n );\n if (!Color.equals(attributes._lastColor, resultColor)) {\n attributes._lastColor = Color.clone(\n resultColor,\n attributes._lastColor\n );\n attributes.color = ColorGeometryInstanceAttribute.toValue(\n resultColor,\n attributes.color\n );\n }\n }\n\n const show =\n entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n }\n\n const distanceDisplayConditionProperty =\n updater.distanceDisplayConditionProperty;\n if (!Property.isConstant(distanceDisplayConditionProperty)) {\n const distanceDisplayCondition = Property.getValueOrDefault(\n distanceDisplayConditionProperty,\n time,\n defaultDistanceDisplayCondition,\n distanceDisplayConditionScratch\n );\n if (\n !DistanceDisplayCondition.equals(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n )\n ) {\n attributes._lastDistanceDisplayCondition = DistanceDisplayCondition.clone(\n distanceDisplayCondition,\n attributes._lastDistanceDisplayCondition\n );\n attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(\n distanceDisplayCondition,\n attributes.distanceDisplayCondition\n );\n }\n }\n }\n\n this.updateShows(primitive);\n } else if (defined(primitive) && !primitive.ready) {\n isUpdated = false;\n }\n return isUpdated;\n};\n\nBatch.prototype.updateShows = function (primitive) {\n const showsUpdated = this.showsUpdated.values;\n const length = showsUpdated.length;\n for (let i = 0; i < length; i++) {\n const updater = showsUpdated[i];\n const entity = updater.entity;\n const instance = this.geometry.get(updater.id);\n\n let attributes = this.attributes.get(instance.id.id);\n if (!defined(attributes)) {\n attributes = primitive.getGeometryInstanceAttributes(instance.id);\n this.attributes.set(instance.id.id, attributes);\n }\n\n const show = entity.isShowing;\n const currentShow = attributes.show[0] === 1;\n if (show !== currentShow) {\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n show,\n attributes.show\n );\n instance.attributes.show.value[0] = attributes.show[0];\n }\n }\n this.showsUpdated.removeAll();\n};\n\nBatch.prototype.contains = function (updater) {\n return this.updaters.contains(updater.id);\n};\n\nBatch.prototype.getBoundingSphere = function (updater, result) {\n const primitive = this.primitive;\n if (!primitive.ready) {\n return BoundingSphereState.PENDING;\n }\n const attributes = primitive.getGeometryInstanceAttributes(updater.entity);\n if (\n !defined(attributes) ||\n !defined(attributes.boundingSphere) ||\n (defined(attributes.show) && attributes.show[0] === 0)\n ) {\n return BoundingSphereState.FAILED;\n }\n attributes.boundingSphere.clone(result);\n return BoundingSphereState.DONE;\n};\n\nBatch.prototype.destroy = function () {\n const primitive = this.primitive;\n const orderedGroundPrimitives = this.orderedGroundPrimitives;\n if (defined(primitive)) {\n orderedGroundPrimitives.remove(primitive);\n }\n const oldPrimitive = this.oldPrimitive;\n if (defined(oldPrimitive)) {\n orderedGroundPrimitives.remove(oldPrimitive);\n }\n this.removeMaterialSubscription();\n};\n\n/**\n * @private\n */\nfunction StaticGroundPolylinePerMaterialBatch(\n orderedGroundPrimitives,\n classificationType,\n asynchronous\n) {\n this._items = [];\n this._orderedGroundPrimitives = orderedGroundPrimitives;\n this._classificationType = classificationType;\n this._asynchronous = defaultValue(asynchronous, true);\n}\n\nStaticGroundPolylinePerMaterialBatch.prototype.add = function (time, updater) {\n const items = this._items;\n const length = items.length;\n const geometryInstance = updater.createFillGeometryInstance(time);\n const zIndex = Property.getValueOrDefault(updater.zIndex, 0);\n // Check if the Entity represented by the updater has the same material or a material representable with per-instance color.\n for (let i = 0; i < length; ++i) {\n const item = items[i];\n if (item.isMaterial(updater) && item.zIndex === zIndex) {\n item.add(time, updater, geometryInstance);\n return;\n }\n }\n // If a compatible batch wasn't found, create a new batch.\n const batch = new Batch(\n this._orderedGroundPrimitives,\n this._classificationType,\n updater.fillMaterialProperty,\n zIndex,\n this._asynchronous\n );\n batch.add(time, updater, geometryInstance);\n items.push(batch);\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.remove = function (updater) {\n const items = this._items;\n const length = items.length;\n for (let i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.remove(updater)) {\n if (item.updaters.length === 0) {\n items.splice(i, 1);\n item.destroy();\n }\n break;\n }\n }\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.update = function (time) {\n let i;\n const items = this._items;\n const length = items.length;\n\n for (i = length - 1; i >= 0; i--) {\n const item = items[i];\n if (item.invalidated) {\n items.splice(i, 1);\n const updaters = item.updaters.values;\n const updatersLength = updaters.length;\n for (let h = 0; h < updatersLength; h++) {\n this.add(time, updaters[h]);\n }\n item.destroy();\n }\n }\n\n let isUpdated = true;\n for (i = 0; i < items.length; i++) {\n isUpdated = items[i].update(time) && isUpdated;\n }\n return isUpdated;\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function (\n updater,\n result\n) {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n const item = items[i];\n if (item.contains(updater)) {\n return item.getBoundingSphere(updater, result);\n }\n }\n return BoundingSphereState.FAILED;\n};\n\nStaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives = function () {\n const items = this._items;\n const length = items.length;\n for (let i = 0; i < length; i++) {\n items[i].destroy();\n }\n this._items.length = 0;\n};\nexport default StaticGroundPolylinePerMaterialBatch;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClassificationType from \"../Scene/ClassificationType.js\";\nimport PolylineColorAppearance from \"../Scene/PolylineColorAppearance.js\";\nimport PolylineMaterialAppearance from \"../Scene/PolylineMaterialAppearance.js\";\nimport ShadowMode from \"../Scene/ShadowMode.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport DynamicGeometryBatch from \"./DynamicGeometryBatch.js\";\nimport PolylineGeometryUpdater from \"./PolylineGeometryUpdater.js\";\nimport StaticGeometryColorBatch from \"./StaticGeometryColorBatch.js\";\nimport StaticGeometryPerMaterialBatch from \"./StaticGeometryPerMaterialBatch.js\";\nimport StaticGroundPolylinePerMaterialBatch from \"./StaticGroundPolylinePerMaterialBatch.js\";\n\nconst emptyArray = [];\n\nfunction removeUpdater(that, updater) {\n //We don't keep track of which batch an updater is in, so just remove it from all of them.\n const batches = that._batches;\n const length = batches.length;\n for (let i = 0; i < length; i++) {\n batches[i].remove(updater);\n }\n}\n\nfunction insertUpdaterIntoBatch(that, time, updater) {\n if (updater.isDynamic) {\n that._dynamicBatch.add(time, updater);\n return;\n }\n\n if (updater.clampToGround && updater.fillEnabled) {\n // Also checks for support\n const classificationType = updater.classificationTypeProperty.getValue(\n time\n );\n that._groundBatches[classificationType].add(time, updater);\n return;\n }\n\n let shadows;\n if (updater.fillEnabled) {\n shadows = updater.shadowsProperty.getValue(time);\n }\n\n let multiplier = 0;\n if (defined(updater.depthFailMaterialProperty)) {\n multiplier =\n updater.depthFailMaterialProperty instanceof ColorMaterialProperty\n ? 1\n : 2;\n }\n\n let index;\n if (defined(shadows)) {\n index = shadows + multiplier * ShadowMode.NUMBER_OF_SHADOW_MODES;\n }\n\n if (updater.fillEnabled) {\n if (updater.fillMaterialProperty instanceof ColorMaterialProperty) {\n that._colorBatches[index].add(time, updater);\n } else {\n that._materialBatches[index].add(time, updater);\n }\n }\n}\n\n/**\n * A visualizer for polylines represented by {@link Primitive} instances.\n * @alias PolylineVisualizer\n * @constructor\n *\n * @param {Scene} scene The scene the primitives will be rendered in.\n * @param {EntityCollection} entityCollection The entityCollection to visualize.\n * @param {PrimitiveCollection} [primitives=scene.primitives] A collection to add primitives related to the entities\n * @param {PrimitiveCollection} [groundPrimitives=scene.groundPrimitives] A collection to add ground primitives related to the entities\n */\nfunction PolylineVisualizer(\n scene,\n entityCollection,\n primitives,\n groundPrimitives\n) {\n groundPrimitives = defaultValue(groundPrimitives, scene.groundPrimitives);\n primitives = defaultValue(primitives, scene.primitives);\n\n this._scene = scene;\n this._primitives = primitives;\n this._entityCollection = undefined;\n this._addedObjects = new AssociativeArray();\n this._removedObjects = new AssociativeArray();\n this._changedObjects = new AssociativeArray();\n\n let i;\n const numberOfShadowModes = ShadowMode.NUMBER_OF_SHADOW_MODES;\n this._colorBatches = new Array(numberOfShadowModes * 3);\n this._materialBatches = new Array(numberOfShadowModes * 3);\n\n for (i = 0; i < numberOfShadowModes; ++i) {\n this._colorBatches[i] = new StaticGeometryColorBatch(\n primitives,\n PolylineColorAppearance,\n undefined,\n false,\n i\n ); // no depth fail appearance\n this._materialBatches[i] = new StaticGeometryPerMaterialBatch(\n primitives,\n PolylineMaterialAppearance,\n undefined,\n false,\n i\n );\n\n this._colorBatches[i + numberOfShadowModes] = new StaticGeometryColorBatch(\n primitives,\n PolylineColorAppearance,\n PolylineColorAppearance,\n false,\n i\n ); //depth fail appearance variations\n this._materialBatches[\n i + numberOfShadowModes\n ] = new StaticGeometryPerMaterialBatch(\n primitives,\n PolylineMaterialAppearance,\n PolylineColorAppearance,\n false,\n i\n );\n\n this._colorBatches[\n i + numberOfShadowModes * 2\n ] = new StaticGeometryColorBatch(\n primitives,\n PolylineColorAppearance,\n PolylineMaterialAppearance,\n false,\n i\n );\n this._materialBatches[\n i + numberOfShadowModes * 2\n ] = new StaticGeometryPerMaterialBatch(\n primitives,\n PolylineMaterialAppearance,\n PolylineMaterialAppearance,\n false,\n i\n );\n }\n\n this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives);\n\n const numberOfClassificationTypes =\n ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES;\n this._groundBatches = new Array(numberOfClassificationTypes);\n\n for (i = 0; i < numberOfClassificationTypes; ++i) {\n this._groundBatches[i] = new StaticGroundPolylinePerMaterialBatch(\n groundPrimitives,\n i\n );\n }\n\n this._batches = this._colorBatches.concat(\n this._materialBatches,\n this._dynamicBatch,\n this._groundBatches\n );\n\n this._subscriptions = new AssociativeArray();\n this._updaters = new AssociativeArray();\n\n this._entityCollection = entityCollection;\n entityCollection.collectionChanged.addEventListener(\n PolylineVisualizer.prototype._onCollectionChanged,\n this\n );\n this._onCollectionChanged(\n entityCollection,\n entityCollection.values,\n emptyArray\n );\n}\n\n/**\n * Updates all of the primitives created by this visualizer to match their\n * Entity counterpart at the given time.\n *\n * @param {JulianDate} time The time to update to.\n * @returns {Boolean} True if the visualizer successfully updated to the provided time,\n * false if the visualizer is waiting for asynchronous primitives to be created.\n */\nPolylineVisualizer.prototype.update = function (time) {\n const addedObjects = this._addedObjects;\n const added = addedObjects.values;\n const removedObjects = this._removedObjects;\n const removed = removedObjects.values;\n const changedObjects = this._changedObjects;\n const changed = changedObjects.values;\n\n let i;\n let entity;\n let id;\n let updater;\n\n for (i = changed.length - 1; i > -1; i--) {\n entity = changed[i];\n id = entity.id;\n updater = this._updaters.get(id);\n\n //If in a single update, an entity gets removed and a new instance\n //re-added with the same id, the updater no longer tracks the\n //correct entity, we need to both remove the old one and\n //add the new one, which is done by pushing the entity\n //onto the removed/added lists.\n if (updater.entity === entity) {\n removeUpdater(this, updater);\n insertUpdaterIntoBatch(this, time, updater);\n } else {\n removed.push(entity);\n added.push(entity);\n }\n }\n\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n id = entity.id;\n updater = this._updaters.get(id);\n removeUpdater(this, updater);\n updater.destroy();\n this._updaters.remove(id);\n this._subscriptions.get(id)();\n this._subscriptions.remove(id);\n }\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n id = entity.id;\n updater = new PolylineGeometryUpdater(entity, this._scene);\n this._updaters.set(id, updater);\n insertUpdaterIntoBatch(this, time, updater);\n this._subscriptions.set(\n id,\n updater.geometryChanged.addEventListener(\n PolylineVisualizer._onGeometryChanged,\n this\n )\n );\n }\n\n addedObjects.removeAll();\n removedObjects.removeAll();\n changedObjects.removeAll();\n\n let isUpdated = true;\n const batches = this._batches;\n const length = batches.length;\n for (i = 0; i < length; i++) {\n isUpdated = batches[i].update(time) && isUpdated;\n }\n\n return isUpdated;\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nPolylineVisualizer.prototype.getBoundingSphere = function (entity, result) {\n const boundingSpheres = getBoundingSphereArrayScratch;\n const tmp = getBoundingSphereBoundingSphereScratch;\n\n let count = 0;\n let state = BoundingSphereState.DONE;\n const batches = this._batches;\n const batchesLength = batches.length;\n const updater = this._updaters.get(entity.id);\n for (let i = 0; i < batchesLength; i++) {\n state = batches[i].getBoundingSphere(updater, tmp);\n if (state === BoundingSphereState.PENDING) {\n return BoundingSphereState.PENDING;\n } else if (state === BoundingSphereState.DONE) {\n boundingSpheres[count] = BoundingSphere.clone(\n tmp,\n boundingSpheres[count]\n );\n count++;\n }\n }\n\n if (count === 0) {\n return BoundingSphereState.FAILED;\n }\n\n boundingSpheres.length = count;\n BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n return BoundingSphereState.DONE;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nPolylineVisualizer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes and destroys all primitives created by this instance.\n */\nPolylineVisualizer.prototype.destroy = function () {\n this._entityCollection.collectionChanged.removeEventListener(\n PolylineVisualizer.prototype._onCollectionChanged,\n this\n );\n this._addedObjects.removeAll();\n this._removedObjects.removeAll();\n\n let i;\n const batches = this._batches;\n let length = batches.length;\n for (i = 0; i < length; i++) {\n batches[i].removeAllPrimitives();\n }\n\n const subscriptions = this._subscriptions.values;\n length = subscriptions.length;\n for (i = 0; i < length; i++) {\n subscriptions[i]();\n }\n this._subscriptions.removeAll();\n return destroyObject(this);\n};\n\n/**\n * @private\n */\nPolylineVisualizer._onGeometryChanged = function (updater) {\n const removedObjects = this._removedObjects;\n const changedObjects = this._changedObjects;\n\n const entity = updater.entity;\n const id = entity.id;\n\n if (!defined(removedObjects.get(id)) && !defined(changedObjects.get(id))) {\n changedObjects.set(id, entity);\n }\n};\n\n/**\n * @private\n */\nPolylineVisualizer.prototype._onCollectionChanged = function (\n entityCollection,\n added,\n removed\n) {\n const addedObjects = this._addedObjects;\n const removedObjects = this._removedObjects;\n const changedObjects = this._changedObjects;\n\n let i;\n let id;\n let entity;\n for (i = removed.length - 1; i > -1; i--) {\n entity = removed[i];\n id = entity.id;\n if (!addedObjects.remove(id)) {\n removedObjects.set(id, entity);\n changedObjects.remove(id);\n }\n }\n\n for (i = added.length - 1; i > -1; i--) {\n entity = added[i];\n id = entity.id;\n if (removedObjects.remove(id)) {\n changedObjects.set(id, entity);\n } else {\n addedObjects.set(id, entity);\n }\n }\n};\nexport default PolylineVisualizer;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport GroundPolylinePrimitive from \"../Scene/GroundPolylinePrimitive.js\";\nimport GroundPrimitive from \"../Scene/GroundPrimitive.js\";\nimport OrderedGroundPrimitiveCollection from \"../Scene/OrderedGroundPrimitiveCollection.js\";\nimport PrimitiveCollection from \"../Scene/PrimitiveCollection.js\";\nimport BillboardVisualizer from \"./BillboardVisualizer.js\";\nimport BoundingSphereState from \"./BoundingSphereState.js\";\nimport CustomDataSource from \"./CustomDataSource.js\";\nimport GeometryVisualizer from \"./GeometryVisualizer.js\";\nimport LabelVisualizer from \"./LabelVisualizer.js\";\nimport ModelVisualizer from \"./ModelVisualizer.js\";\nimport Cesium3DTilesetVisualizer from \"./Cesium3DTilesetVisualizer.js\";\nimport PathVisualizer from \"./PathVisualizer.js\";\nimport PointVisualizer from \"./PointVisualizer.js\";\nimport PolylineVisualizer from \"./PolylineVisualizer.js\";\n\n/**\n * Visualizes a collection of {@link DataSource} instances.\n * @alias DataSourceDisplay\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Scene} options.scene The scene in which to display the data.\n * @param {DataSourceCollection} options.dataSourceCollection The data sources to display.\n * @param {DataSourceDisplay.VisualizersCallback} [options.visualizersCallback=DataSourceDisplay.defaultVisualizersCallback]\n * A function which creates an array of visualizers used for visualization.\n * If undefined, all standard visualizers are used.\n */\nfunction DataSourceDisplay(options) {\n GroundPrimitive.initializeTerrainHeights();\n GroundPolylinePrimitive.initializeTerrainHeights();\n\n const scene = options.scene;\n const dataSourceCollection = options.dataSourceCollection;\n\n this._eventHelper = new EventHelper();\n this._eventHelper.add(\n dataSourceCollection.dataSourceAdded,\n this._onDataSourceAdded,\n this\n );\n this._eventHelper.add(\n dataSourceCollection.dataSourceRemoved,\n this._onDataSourceRemoved,\n this\n );\n this._eventHelper.add(\n dataSourceCollection.dataSourceMoved,\n this._onDataSourceMoved,\n this\n );\n this._eventHelper.add(scene.postRender, this._postRender, this);\n\n this._dataSourceCollection = dataSourceCollection;\n this._scene = scene;\n this._visualizersCallback = defaultValue(\n options.visualizersCallback,\n DataSourceDisplay.defaultVisualizersCallback\n );\n\n let primitivesAdded = false;\n const primitives = new PrimitiveCollection();\n const groundPrimitives = new PrimitiveCollection();\n\n if (dataSourceCollection.length > 0) {\n scene.primitives.add(primitives);\n scene.groundPrimitives.add(groundPrimitives);\n primitivesAdded = true;\n }\n\n this._primitives = primitives;\n this._groundPrimitives = groundPrimitives;\n\n for (let i = 0, len = dataSourceCollection.length; i < len; i++) {\n this._onDataSourceAdded(dataSourceCollection, dataSourceCollection.get(i));\n }\n\n const defaultDataSource = new CustomDataSource();\n this._onDataSourceAdded(undefined, defaultDataSource);\n this._defaultDataSource = defaultDataSource;\n\n let removeDefaultDataSourceListener;\n let removeDataSourceCollectionListener;\n if (!primitivesAdded) {\n const that = this;\n const addPrimitives = function () {\n scene.primitives.add(primitives);\n scene.groundPrimitives.add(groundPrimitives);\n removeDefaultDataSourceListener();\n removeDataSourceCollectionListener();\n that._removeDefaultDataSourceListener = undefined;\n that._removeDataSourceCollectionListener = undefined;\n };\n removeDefaultDataSourceListener = defaultDataSource.entities.collectionChanged.addEventListener(\n addPrimitives\n );\n removeDataSourceCollectionListener = dataSourceCollection.dataSourceAdded.addEventListener(\n addPrimitives\n );\n }\n\n this._removeDefaultDataSourceListener = removeDefaultDataSourceListener;\n this._removeDataSourceCollectionListener = removeDataSourceCollectionListener;\n\n this._ready = false;\n}\n\n/**\n * Gets or sets the default function which creates an array of visualizers used for visualization.\n * By default, this function uses all standard visualizers.\n *\n * @type {DataSourceDisplay.VisualizersCallback}\n */\nDataSourceDisplay.defaultVisualizersCallback = function (\n scene,\n entityCluster,\n dataSource\n) {\n const entities = dataSource.entities;\n return [\n new BillboardVisualizer(entityCluster, entities),\n new GeometryVisualizer(\n scene,\n entities,\n dataSource._primitives,\n dataSource._groundPrimitives\n ),\n new LabelVisualizer(entityCluster, entities),\n new ModelVisualizer(scene, entities),\n new Cesium3DTilesetVisualizer(scene, entities),\n new PointVisualizer(entityCluster, entities),\n new PathVisualizer(scene, entities),\n new PolylineVisualizer(\n scene,\n entities,\n dataSource._primitives,\n dataSource._groundPrimitives\n ),\n ];\n};\n\nObject.defineProperties(DataSourceDisplay.prototype, {\n /**\n * Gets the scene associated with this display.\n * @memberof DataSourceDisplay.prototype\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n /**\n * Gets the collection of data sources to display.\n * @memberof DataSourceDisplay.prototype\n * @type {DataSourceCollection}\n */\n dataSources: {\n get: function () {\n return this._dataSourceCollection;\n },\n },\n /**\n * Gets the default data source instance which can be used to\n * manually create and visualize entities not tied to\n * a specific data source. This instance is always available\n * and does not appear in the list dataSources collection.\n * @memberof DataSourceDisplay.prototype\n * @type {CustomDataSource}\n */\n defaultDataSource: {\n get: function () {\n return this._defaultDataSource;\n },\n },\n\n /**\n * Gets a value indicating whether or not all entities in the data source are ready\n * @memberof DataSourceDisplay.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n});\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see DataSourceDisplay#destroy\n */\nDataSourceDisplay.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * dataSourceDisplay = dataSourceDisplay.destroy();\n *\n * @see DataSourceDisplay#isDestroyed\n */\nDataSourceDisplay.prototype.destroy = function () {\n this._eventHelper.removeAll();\n\n const dataSourceCollection = this._dataSourceCollection;\n for (let i = 0, length = dataSourceCollection.length; i < length; ++i) {\n this._onDataSourceRemoved(\n this._dataSourceCollection,\n dataSourceCollection.get(i)\n );\n }\n this._onDataSourceRemoved(undefined, this._defaultDataSource);\n\n if (defined(this._removeDefaultDataSourceListener)) {\n this._removeDefaultDataSourceListener();\n this._removeDataSourceCollectionListener();\n } else {\n this._scene.primitives.remove(this._primitives);\n this._scene.groundPrimitives.remove(this._groundPrimitives);\n }\n\n return destroyObject(this);\n};\n\n/**\n * Updates the display to the provided time.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if all data sources are ready to be displayed, false otherwise.\n */\nDataSourceDisplay.prototype.update = function (time) {\n if (!ApproximateTerrainHeights.initialized) {\n this._ready = false;\n return false;\n }\n\n let result = true;\n\n let i;\n let x;\n let visualizers;\n let vLength;\n const dataSources = this._dataSourceCollection;\n const length = dataSources.length;\n for (i = 0; i < length; i++) {\n const dataSource = dataSources.get(i);\n if (defined(dataSource.update)) {\n result = dataSource.update(time) && result;\n }\n\n visualizers = dataSource._visualizers;\n vLength = visualizers.length;\n for (x = 0; x < vLength; x++) {\n result = visualizers[x].update(time) && result;\n }\n }\n\n visualizers = this._defaultDataSource._visualizers;\n vLength = visualizers.length;\n for (x = 0; x < vLength; x++) {\n result = visualizers[x].update(time) && result;\n }\n\n this._ready = result;\n\n return result;\n};\n\nDataSourceDisplay.prototype._postRender = function () {\n // Adds credits for all datasources\n const frameState = this._scene.frameState;\n const dataSources = this._dataSourceCollection;\n const length = dataSources.length;\n for (let i = 0; i < length; i++) {\n const dataSource = dataSources.get(i);\n\n const credit = dataSource.credit;\n if (defined(credit)) {\n frameState.creditDisplay.addCredit(credit);\n }\n\n // Credits from the resource that the user can't remove\n const credits = dataSource._resourceCredits;\n if (defined(credits)) {\n const creditCount = credits.length;\n for (let c = 0; c < creditCount; c++) {\n frameState.creditDisplay.addCredit(credits[c]);\n }\n }\n }\n};\n\nconst getBoundingSphereArrayScratch = [];\nconst getBoundingSphereBoundingSphereScratch = new BoundingSphere();\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {Boolean} allowPartial If true, pending bounding spheres are ignored and an answer will be returned from the currently available data.\n * If false, the the function will halt and return pending if any of the bounding spheres are pending.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nDataSourceDisplay.prototype.getBoundingSphere = function (\n entity,\n allowPartial,\n result\n) {\n if (!this._ready) {\n return BoundingSphereState.PENDING;\n }\n\n let i;\n let length;\n let dataSource = this._defaultDataSource;\n if (!dataSource.entities.contains(entity)) {\n dataSource = undefined;\n\n const dataSources = this._dataSourceCollection;\n length = dataSources.length;\n for (i = 0; i < length; i++) {\n const d = dataSources.get(i);\n if (d.entities.contains(entity)) {\n dataSource = d;\n break;\n }\n }\n }\n\n if (!defined(dataSource)) {\n return BoundingSphereState.FAILED;\n }\n\n const boundingSpheres = getBoundingSphereArrayScratch;\n const tmp = getBoundingSphereBoundingSphereScratch;\n\n let count = 0;\n let state = BoundingSphereState.DONE;\n const visualizers = dataSource._visualizers;\n const visualizersLength = visualizers.length;\n\n for (i = 0; i < visualizersLength; i++) {\n const visualizer = visualizers[i];\n if (defined(visualizer.getBoundingSphere)) {\n state = visualizers[i].getBoundingSphere(entity, tmp);\n if (!allowPartial && state === BoundingSphereState.PENDING) {\n return BoundingSphereState.PENDING;\n } else if (state === BoundingSphereState.DONE) {\n boundingSpheres[count] = BoundingSphere.clone(\n tmp,\n boundingSpheres[count]\n );\n count++;\n }\n }\n }\n\n if (count === 0) {\n return BoundingSphereState.FAILED;\n }\n\n boundingSpheres.length = count;\n BoundingSphere.fromBoundingSpheres(boundingSpheres, result);\n return BoundingSphereState.DONE;\n};\n\nDataSourceDisplay.prototype._onDataSourceAdded = function (\n dataSourceCollection,\n dataSource\n) {\n const scene = this._scene;\n\n const displayPrimitives = this._primitives;\n const displayGroundPrimitives = this._groundPrimitives;\n\n const primitives = displayPrimitives.add(new PrimitiveCollection());\n const groundPrimitives = displayGroundPrimitives.add(\n new OrderedGroundPrimitiveCollection()\n );\n\n dataSource._primitives = primitives;\n dataSource._groundPrimitives = groundPrimitives;\n\n const entityCluster = dataSource.clustering;\n entityCluster._initialize(scene);\n\n primitives.add(entityCluster);\n\n dataSource._visualizers = this._visualizersCallback(\n scene,\n entityCluster,\n dataSource\n );\n};\n\nDataSourceDisplay.prototype._onDataSourceRemoved = function (\n dataSourceCollection,\n dataSource\n) {\n const displayPrimitives = this._primitives;\n const displayGroundPrimitives = this._groundPrimitives;\n\n const primitives = dataSource._primitives;\n const groundPrimitives = dataSource._groundPrimitives;\n\n const entityCluster = dataSource.clustering;\n primitives.remove(entityCluster);\n\n const visualizers = dataSource._visualizers;\n const length = visualizers.length;\n for (let i = 0; i < length; i++) {\n visualizers[i].destroy();\n }\n\n displayPrimitives.remove(primitives);\n displayGroundPrimitives.remove(groundPrimitives);\n\n dataSource._visualizers = undefined;\n};\n\nDataSourceDisplay.prototype._onDataSourceMoved = function (\n dataSource,\n newIndex,\n oldIndex\n) {\n const displayPrimitives = this._primitives;\n const displayGroundPrimitives = this._groundPrimitives;\n\n const primitives = dataSource._primitives;\n const groundPrimitives = dataSource._groundPrimitives;\n\n if (newIndex === oldIndex + 1) {\n displayPrimitives.raise(primitives);\n displayGroundPrimitives.raise(groundPrimitives);\n } else if (newIndex === oldIndex - 1) {\n displayPrimitives.lower(primitives);\n displayGroundPrimitives.lower(groundPrimitives);\n } else if (newIndex === 0) {\n displayPrimitives.lowerToBottom(primitives);\n displayGroundPrimitives.lowerToBottom(groundPrimitives);\n displayPrimitives.raise(primitives); // keep defaultDataSource primitives at index 0 since it's not in the collection\n displayGroundPrimitives.raise(groundPrimitives);\n } else {\n displayPrimitives.raiseToTop(primitives);\n displayGroundPrimitives.raiseToTop(groundPrimitives);\n }\n};\n\n/**\n * A function which creates an array of visualizers used for visualization.\n * @callback DataSourceDisplay.VisualizersCallback\n *\n * @param {Scene} scene The scene to create visualizers for.\n * @param {DataSource} dataSource The data source to create visualizers for.\n * @returns {Visualizer[]} An array of visualizers used for visualization.\n *\n * @example\n * function createVisualizers(scene, dataSource) {\n * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];\n * }\n */\nexport default DataSourceDisplay;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Defines a heading angle, pitch angle, and range in a local frame.\n * Heading is the rotation from the local north direction where a positive angle is increasing eastward.\n * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch\n * angles are below the plane. Range is the distance from the center of the frame.\n * @alias HeadingPitchRange\n * @constructor\n *\n * @param {Number} [heading=0.0] The heading angle in radians.\n * @param {Number} [pitch=0.0] The pitch angle in radians.\n * @param {Number} [range=0.0] The distance from the center in meters.\n */\nfunction HeadingPitchRange(heading, pitch, range) {\n /**\n * Heading is the rotation from the local north direction where a positive angle is increasing eastward.\n * @type {Number}\n * @default 0.0\n */\n this.heading = defaultValue(heading, 0.0);\n\n /**\n * Pitch is the rotation from the local xy-plane. Positive pitch angles\n * are above the plane. Negative pitch angles are below the plane.\n * @type {Number}\n * @default 0.0\n */\n this.pitch = defaultValue(pitch, 0.0);\n\n /**\n * Range is the distance from the center of the local frame.\n * @type {Number}\n * @default 0.0\n */\n this.range = defaultValue(range, 0.0);\n}\n\n/**\n * Duplicates a HeadingPitchRange instance.\n *\n * @param {HeadingPitchRange} hpr The HeadingPitchRange to duplicate.\n * @param {HeadingPitchRange} [result] The object onto which to store the result.\n * @returns {HeadingPitchRange} The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)\n */\nHeadingPitchRange.clone = function (hpr, result) {\n if (!defined(hpr)) {\n return undefined;\n }\n if (!defined(result)) {\n result = new HeadingPitchRange();\n }\n\n result.heading = hpr.heading;\n result.pitch = hpr.pitch;\n result.range = hpr.range;\n return result;\n};\nexport default HeadingPitchRange;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\n\nconst updateTransformMatrix3Scratch1 = new Matrix3();\nconst updateTransformMatrix3Scratch2 = new Matrix3();\nconst updateTransformMatrix3Scratch3 = new Matrix3();\nconst updateTransformMatrix4Scratch = new Matrix4();\nconst updateTransformCartesian3Scratch1 = new Cartesian3();\nconst updateTransformCartesian3Scratch2 = new Cartesian3();\nconst updateTransformCartesian3Scratch3 = new Cartesian3();\nconst updateTransformCartesian3Scratch4 = new Cartesian3();\nconst updateTransformCartesian3Scratch5 = new Cartesian3();\nconst updateTransformCartesian3Scratch6 = new Cartesian3();\nconst deltaTime = new JulianDate();\nconst northUpAxisFactor = 1.25; // times ellipsoid's maximum radius\n\nfunction updateTransform(\n that,\n camera,\n updateLookAt,\n saveCamera,\n positionProperty,\n time,\n ellipsoid\n) {\n const mode = that.scene.mode;\n let cartesian = positionProperty.getValue(time, that._lastCartesian);\n if (defined(cartesian)) {\n let hasBasis = false;\n let invertVelocity = false;\n let xBasis;\n let yBasis;\n let zBasis;\n\n if (mode === SceneMode.SCENE3D) {\n // The time delta was determined based on how fast satellites move compared to vehicles near the surface.\n // Slower moving vehicles will most likely default to east-north-up, while faster ones will be VVLH.\n JulianDate.addSeconds(time, 0.001, deltaTime);\n let deltaCartesian = positionProperty.getValue(\n deltaTime,\n updateTransformCartesian3Scratch1\n );\n\n // If no valid position at (time + 0.001), sample at (time - 0.001) and invert the vector\n if (!defined(deltaCartesian)) {\n JulianDate.addSeconds(time, -0.001, deltaTime);\n deltaCartesian = positionProperty.getValue(\n deltaTime,\n updateTransformCartesian3Scratch1\n );\n invertVelocity = true;\n }\n\n if (defined(deltaCartesian)) {\n let toInertial = Transforms.computeFixedToIcrfMatrix(\n time,\n updateTransformMatrix3Scratch1\n );\n let toInertialDelta = Transforms.computeFixedToIcrfMatrix(\n deltaTime,\n updateTransformMatrix3Scratch2\n );\n let toFixed;\n\n if (!defined(toInertial) || !defined(toInertialDelta)) {\n toFixed = Transforms.computeTemeToPseudoFixedMatrix(\n time,\n updateTransformMatrix3Scratch3\n );\n toInertial = Matrix3.transpose(\n toFixed,\n updateTransformMatrix3Scratch1\n );\n toInertialDelta = Transforms.computeTemeToPseudoFixedMatrix(\n deltaTime,\n updateTransformMatrix3Scratch2\n );\n Matrix3.transpose(toInertialDelta, toInertialDelta);\n } else {\n toFixed = Matrix3.transpose(\n toInertial,\n updateTransformMatrix3Scratch3\n );\n }\n\n const inertialCartesian = Matrix3.multiplyByVector(\n toInertial,\n cartesian,\n updateTransformCartesian3Scratch5\n );\n const inertialDeltaCartesian = Matrix3.multiplyByVector(\n toInertialDelta,\n deltaCartesian,\n updateTransformCartesian3Scratch6\n );\n\n Cartesian3.subtract(\n inertialCartesian,\n inertialDeltaCartesian,\n updateTransformCartesian3Scratch4\n );\n const inertialVelocity =\n Cartesian3.magnitude(updateTransformCartesian3Scratch4) * 1000.0; // meters/sec\n\n const mu = CesiumMath.GRAVITATIONALPARAMETER; // m^3 / sec^2\n const semiMajorAxis =\n -mu /\n (inertialVelocity * inertialVelocity -\n (2 * mu) / Cartesian3.magnitude(inertialCartesian));\n\n if (\n semiMajorAxis < 0 ||\n semiMajorAxis > northUpAxisFactor * ellipsoid.maximumRadius\n ) {\n // North-up viewing from deep space.\n\n // X along the nadir\n xBasis = updateTransformCartesian3Scratch2;\n Cartesian3.normalize(cartesian, xBasis);\n Cartesian3.negate(xBasis, xBasis);\n\n // Z is North\n zBasis = Cartesian3.clone(\n Cartesian3.UNIT_Z,\n updateTransformCartesian3Scratch3\n );\n\n // Y is along the cross of z and x (right handed basis / in the direction of motion)\n yBasis = Cartesian3.cross(\n zBasis,\n xBasis,\n updateTransformCartesian3Scratch1\n );\n if (Cartesian3.magnitude(yBasis) > CesiumMath.EPSILON7) {\n Cartesian3.normalize(xBasis, xBasis);\n Cartesian3.normalize(yBasis, yBasis);\n\n zBasis = Cartesian3.cross(\n xBasis,\n yBasis,\n updateTransformCartesian3Scratch3\n );\n Cartesian3.normalize(zBasis, zBasis);\n\n hasBasis = true;\n }\n } else if (\n !Cartesian3.equalsEpsilon(\n cartesian,\n deltaCartesian,\n CesiumMath.EPSILON7\n )\n ) {\n // Approximation of VVLH (Vehicle Velocity Local Horizontal) with the Z-axis flipped.\n\n // Z along the position\n zBasis = updateTransformCartesian3Scratch2;\n Cartesian3.normalize(inertialCartesian, zBasis);\n Cartesian3.normalize(inertialDeltaCartesian, inertialDeltaCartesian);\n\n // Y is along the angular momentum vector (e.g. \"orbit normal\")\n yBasis = Cartesian3.cross(\n zBasis,\n inertialDeltaCartesian,\n updateTransformCartesian3Scratch3\n );\n\n if (invertVelocity) {\n yBasis = Cartesian3.multiplyByScalar(yBasis, -1, yBasis);\n }\n\n if (\n !Cartesian3.equalsEpsilon(\n yBasis,\n Cartesian3.ZERO,\n CesiumMath.EPSILON7\n )\n ) {\n // X is along the cross of y and z (right handed basis / in the direction of motion)\n xBasis = Cartesian3.cross(\n yBasis,\n zBasis,\n updateTransformCartesian3Scratch1\n );\n\n Matrix3.multiplyByVector(toFixed, xBasis, xBasis);\n Matrix3.multiplyByVector(toFixed, yBasis, yBasis);\n Matrix3.multiplyByVector(toFixed, zBasis, zBasis);\n\n Cartesian3.normalize(xBasis, xBasis);\n Cartesian3.normalize(yBasis, yBasis);\n Cartesian3.normalize(zBasis, zBasis);\n\n hasBasis = true;\n }\n }\n }\n }\n\n if (defined(that.boundingSphere)) {\n cartesian = that.boundingSphere.center;\n }\n\n let position;\n let direction;\n let up;\n\n if (saveCamera) {\n position = Cartesian3.clone(\n camera.position,\n updateTransformCartesian3Scratch4\n );\n direction = Cartesian3.clone(\n camera.direction,\n updateTransformCartesian3Scratch5\n );\n up = Cartesian3.clone(camera.up, updateTransformCartesian3Scratch6);\n }\n\n const transform = updateTransformMatrix4Scratch;\n if (hasBasis) {\n transform[0] = xBasis.x;\n transform[1] = xBasis.y;\n transform[2] = xBasis.z;\n transform[3] = 0.0;\n transform[4] = yBasis.x;\n transform[5] = yBasis.y;\n transform[6] = yBasis.z;\n transform[7] = 0.0;\n transform[8] = zBasis.x;\n transform[9] = zBasis.y;\n transform[10] = zBasis.z;\n transform[11] = 0.0;\n transform[12] = cartesian.x;\n transform[13] = cartesian.y;\n transform[14] = cartesian.z;\n transform[15] = 0.0;\n } else {\n // Stationary or slow-moving, low-altitude objects use East-North-Up.\n Transforms.eastNorthUpToFixedFrame(cartesian, ellipsoid, transform);\n }\n\n camera._setTransform(transform);\n\n if (saveCamera) {\n Cartesian3.clone(position, camera.position);\n Cartesian3.clone(direction, camera.direction);\n Cartesian3.clone(up, camera.up);\n Cartesian3.cross(direction, up, camera.right);\n }\n }\n\n if (updateLookAt) {\n const offset =\n mode === SceneMode.SCENE2D ||\n Cartesian3.equals(that._offset3D, Cartesian3.ZERO)\n ? undefined\n : that._offset3D;\n camera.lookAtTransform(camera.transform, offset);\n }\n}\n\n/**\n * A utility object for tracking an entity with the camera.\n * @alias EntityView\n * @constructor\n *\n * @param {Entity} entity The entity to track with the camera.\n * @param {Scene} scene The scene to use.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use for orienting the camera.\n */\nfunction EntityView(entity, scene, ellipsoid) {\n /**\n * The entity to track with the camera.\n * @type {Entity}\n */\n this.entity = entity;\n\n /**\n * The scene in which to track the object.\n * @type {Scene}\n */\n this.scene = scene;\n\n /**\n * The ellipsoid to use for orienting the camera.\n * @type {Ellipsoid}\n */\n this.ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n /**\n * The bounding sphere of the object.\n * @type {BoundingSphere}\n */\n this.boundingSphere = undefined;\n\n // Shadow copies of the objects so we can detect changes.\n this._lastEntity = undefined;\n this._mode = undefined;\n\n this._lastCartesian = new Cartesian3();\n this._defaultOffset3D = undefined;\n\n this._offset3D = new Cartesian3();\n}\n\n// STATIC properties defined here, not per-instance.\nObject.defineProperties(EntityView, {\n /**\n * Gets or sets a camera offset that will be used to\n * initialize subsequent EntityViews.\n * @memberof EntityView\n * @type {Cartesian3}\n */\n defaultOffset3D: {\n get: function () {\n return this._defaultOffset3D;\n },\n set: function (vector) {\n this._defaultOffset3D = Cartesian3.clone(vector, new Cartesian3());\n },\n },\n});\n\n// Initialize the static property.\nEntityView.defaultOffset3D = new Cartesian3(-14000, 3500, 3500);\n\nconst scratchHeadingPitchRange = new HeadingPitchRange();\nconst scratchCartesian = new Cartesian3();\n\n/**\n * Should be called each animation frame to update the camera\n * to the latest settings.\n * @param {JulianDate} time The current animation time.\n * @param {BoundingSphere} [boundingSphere] bounding sphere of the object.\n */\nEntityView.prototype.update = function (time, boundingSphere) {\n const scene = this.scene;\n const ellipsoid = this.ellipsoid;\n const sceneMode = scene.mode;\n if (sceneMode === SceneMode.MORPHING) {\n return;\n }\n\n const entity = this.entity;\n const positionProperty = entity.position;\n if (!defined(positionProperty)) {\n return;\n }\n const objectChanged = entity !== this._lastEntity;\n const sceneModeChanged = sceneMode !== this._mode;\n\n const camera = scene.camera;\n\n let updateLookAt = objectChanged || sceneModeChanged;\n let saveCamera = true;\n\n if (objectChanged) {\n const viewFromProperty = entity.viewFrom;\n const hasViewFrom = defined(viewFromProperty);\n\n if (!hasViewFrom && defined(boundingSphere)) {\n // The default HPR is not ideal for high altitude objects so\n // we scale the pitch as we get further from the earth for a more\n // downward view.\n scratchHeadingPitchRange.pitch = -CesiumMath.PI_OVER_FOUR;\n scratchHeadingPitchRange.range = 0;\n const position = positionProperty.getValue(time, scratchCartesian);\n if (defined(position)) {\n const factor =\n 2 -\n 1 /\n Math.max(\n 1,\n Cartesian3.magnitude(position) / ellipsoid.maximumRadius\n );\n scratchHeadingPitchRange.pitch *= factor;\n }\n\n camera.viewBoundingSphere(boundingSphere, scratchHeadingPitchRange);\n this.boundingSphere = boundingSphere;\n updateLookAt = false;\n saveCamera = false;\n } else if (\n !hasViewFrom ||\n !defined(viewFromProperty.getValue(time, this._offset3D))\n ) {\n Cartesian3.clone(EntityView._defaultOffset3D, this._offset3D);\n }\n } else if (!sceneModeChanged && this._mode !== SceneMode.SCENE2D) {\n Cartesian3.clone(camera.position, this._offset3D);\n }\n\n this._lastEntity = entity;\n this._mode = sceneMode;\n\n updateTransform(\n this,\n camera,\n updateLookAt,\n saveCamera,\n positionProperty,\n time,\n ellipsoid\n );\n};\nexport default EntityView;\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\n\nconst MAX_BITS = 15;\nconst D_CODES = 30;\nconst BL_CODES = 19;\n\nconst LENGTH_CODES = 29;\nconst LITERALS = 256;\nconst L_CODES = (LITERALS + 1 + LENGTH_CODES);\nconst HEAP_SIZE = (2 * L_CODES + 1);\n\nconst END_BLOCK = 256;\n\n// Bit length codes must not exceed MAX_BL_BITS bits\nconst MAX_BL_BITS = 7;\n\n// repeat previous bit length 3-6 times (2 bits of repeat count)\nconst REP_3_6 = 16;\n\n// repeat a zero length 3-10 times (3 bits of repeat count)\nconst REPZ_3_10 = 17;\n\n// repeat a zero length 11-138 times (7 bits of repeat count)\nconst REPZ_11_138 = 18;\n\n// The lengths of the bit length codes are sent in order of decreasing\n// probability, to avoid transmitting the lengths for unused bit\n// length codes.\n\nconst Buf_size = 8 * 2;\n\n// JZlib version : \"1.0.2\"\nconst Z_DEFAULT_COMPRESSION = -1;\n\n// compression strategy\nconst Z_FILTERED = 1;\nconst Z_HUFFMAN_ONLY = 2;\nconst Z_DEFAULT_STRATEGY = 0;\n\nconst Z_NO_FLUSH = 0;\nconst Z_PARTIAL_FLUSH = 1;\nconst Z_FULL_FLUSH = 3;\nconst Z_FINISH = 4;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_BUF_ERROR = -5;\n\n// Tree\n\nfunction extractArray(array) {\n\treturn flatArray(array.map(([length, value]) => (new Array(length)).fill(value, 0, length)));\n}\n\nfunction flatArray(array) {\n\treturn array.reduce((a, b) => a.concat(Array.isArray(b) ? flatArray(b) : b), []);\n}\n\n// see definition of array dist_code below\nconst _dist_code = [0, 1, 2, 3].concat(...extractArray([\n\t[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],\n\t[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]\n]));\n\nfunction Tree() {\n\tconst that = this;\n\n\t// dyn_tree; // the dynamic tree\n\t// max_code; // largest code with non zero frequency\n\t// stat_desc; // the corresponding static tree\n\n\t// Compute the optimal bit lengths for a tree and update the total bit\n\t// length\n\t// for the current block.\n\t// IN assertion: the fields freq and dad are set, heap[heap_max] and\n\t// above are the tree nodes sorted by increasing frequency.\n\t// OUT assertions: the field len is set to the optimal bit length, the\n\t// array bl_count contains the frequencies for each bit length.\n\t// The length opt_len is updated; static_len is also updated if stree is\n\t// not null.\n\tfunction gen_bitlen(s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst extra = that.stat_desc.extra_bits;\n\t\tconst base = that.stat_desc.extra_base;\n\t\tconst max_length = that.stat_desc.max_length;\n\t\tlet h; // heap index\n\t\tlet n, m; // iterate over the tree elements\n\t\tlet bits; // bit length\n\t\tlet xbits; // extra bits\n\t\tlet f; // frequency\n\t\tlet overflow = 0; // number of elements with bit length too large\n\n\t\tfor (bits = 0; bits <= MAX_BITS; bits++)\n\t\t\ts.bl_count[bits] = 0;\n\n\t\t// In a first pass, compute the optimal bit lengths (which may\n\t\t// overflow in the case of the bit length tree).\n\t\ttree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap\n\n\t\tfor (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t\t\tn = s.heap[h];\n\t\t\tbits = tree[tree[n * 2 + 1] * 2 + 1] + 1;\n\t\t\tif (bits > max_length) {\n\t\t\t\tbits = max_length;\n\t\t\t\toverflow++;\n\t\t\t}\n\t\t\ttree[n * 2 + 1] = bits;\n\t\t\t// We overwrite tree[n*2+1] which is no longer needed\n\n\t\t\tif (n > that.max_code)\n\t\t\t\tcontinue; // not a leaf node\n\n\t\t\ts.bl_count[bits]++;\n\t\t\txbits = 0;\n\t\t\tif (n >= base)\n\t\t\t\txbits = extra[n - base];\n\t\t\tf = tree[n * 2];\n\t\t\ts.opt_len += f * (bits + xbits);\n\t\t\tif (stree)\n\t\t\t\ts.static_len += f * (stree[n * 2 + 1] + xbits);\n\t\t}\n\t\tif (overflow === 0)\n\t\t\treturn;\n\n\t\t// This happens for example on obj2 and pic of the Calgary corpus\n\t\t// Find the first bit length which could increase:\n\t\tdo {\n\t\t\tbits = max_length - 1;\n\t\t\twhile (s.bl_count[bits] === 0)\n\t\t\t\tbits--;\n\t\t\ts.bl_count[bits]--; // move one leaf down the tree\n\t\t\ts.bl_count[bits + 1] += 2; // move one overflow item as its brother\n\t\t\ts.bl_count[max_length]--;\n\t\t\t// The brother of the overflow item also moves one step up,\n\t\t\t// but this does not affect bl_count[max_length]\n\t\t\toverflow -= 2;\n\t\t} while (overflow > 0);\n\n\t\tfor (bits = max_length; bits !== 0; bits--) {\n\t\t\tn = s.bl_count[bits];\n\t\t\twhile (n !== 0) {\n\t\t\t\tm = s.heap[--h];\n\t\t\t\tif (m > that.max_code)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (tree[m * 2 + 1] != bits) {\n\t\t\t\t\ts.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];\n\t\t\t\t\ttree[m * 2 + 1] = bits;\n\t\t\t\t}\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reverse the first len bits of a code, using straightforward code (a\n\t// faster\n\t// method would use a table)\n\t// IN assertion: 1 <= len <= 15\n\tfunction bi_reverse(code, // the value to invert\n\t\tlen // its bit length\n\t) {\n\t\tlet res = 0;\n\t\tdo {\n\t\t\tres |= code & 1;\n\t\t\tcode >>>= 1;\n\t\t\tres <<= 1;\n\t\t} while (--len > 0);\n\t\treturn res >>> 1;\n\t}\n\n\t// Generate the codes for a given tree and bit counts (which need not be\n\t// optimal).\n\t// IN assertion: the array bl_count contains the bit length statistics for\n\t// the given tree and the field len is set for all tree elements.\n\t// OUT assertion: the field code is set for all tree elements of non\n\t// zero code length.\n\tfunction gen_codes(tree, // the tree to decorate\n\t\tmax_code, // largest code with non zero frequency\n\t\tbl_count // number of codes at each bit length\n\t) {\n\t\tconst next_code = []; // next code value for each\n\t\t// bit length\n\t\tlet code = 0; // running code value\n\t\tlet bits; // bit index\n\t\tlet n; // code index\n\t\tlet len;\n\n\t\t// The distribution counts are first used to generate the code values\n\t\t// without bit reversal.\n\t\tfor (bits = 1; bits <= MAX_BITS; bits++) {\n\t\t\tnext_code[bits] = code = ((code + bl_count[bits - 1]) << 1);\n\t\t}\n\n\t\t// Check that the bit counts in bl_count are consistent. The last code\n\t\t// must be all ones.\n\t\t// Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t\t// \"inconsistent bit counts\");\n\t\t// Tracev((stderr,\"gen_codes: max_code %d \", max_code));\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tlen = tree[n * 2 + 1];\n\t\t\tif (len === 0)\n\t\t\t\tcontinue;\n\t\t\t// Now reverse the bits\n\t\t\ttree[n * 2] = bi_reverse(next_code[len]++, len);\n\t\t}\n\t}\n\n\t// Construct one Huffman tree and assigns the code bit strings and lengths.\n\t// Update the total bit length for the current block.\n\t// IN assertion: the field freq is set for all tree elements.\n\t// OUT assertions: the fields len and code are set to the optimal bit length\n\t// and corresponding code. The length opt_len is updated; static_len is\n\t// also updated if stree is not null. The field max_code is set.\n\tthat.build_tree = function (s) {\n\t\tconst tree = that.dyn_tree;\n\t\tconst stree = that.stat_desc.static_tree;\n\t\tconst elems = that.stat_desc.elems;\n\t\tlet n, m; // iterate over heap elements\n\t\tlet max_code = -1; // largest code with non zero frequency\n\t\tlet node; // new node being created\n\n\t\t// Construct the initial heap, with least frequent element in\n\t\t// heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n\t\t// heap[0] is not used.\n\t\ts.heap_len = 0;\n\t\ts.heap_max = HEAP_SIZE;\n\n\t\tfor (n = 0; n < elems; n++) {\n\t\t\tif (tree[n * 2] !== 0) {\n\t\t\t\ts.heap[++s.heap_len] = max_code = n;\n\t\t\t\ts.depth[n] = 0;\n\t\t\t} else {\n\t\t\t\ttree[n * 2 + 1] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// The pkzip format requires that at least one distance code exists,\n\t\t// and that at least one bit should be sent even if there is only one\n\t\t// possible code. So to avoid special checks later on we force at least\n\t\t// two codes of non zero frequency.\n\t\twhile (s.heap_len < 2) {\n\t\t\tnode = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n\t\t\ttree[node * 2] = 1;\n\t\t\ts.depth[node] = 0;\n\t\t\ts.opt_len--;\n\t\t\tif (stree)\n\t\t\t\ts.static_len -= stree[node * 2 + 1];\n\t\t\t// node is 0 or 1 so it does not have extra bits\n\t\t}\n\t\tthat.max_code = max_code;\n\n\t\t// The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n\t\t// establish sub-heaps of increasing lengths:\n\n\t\tfor (n = Math.floor(s.heap_len / 2); n >= 1; n--)\n\t\t\ts.pqdownheap(tree, n);\n\n\t\t// Construct the Huffman tree by repeatedly combining the least two\n\t\t// frequent nodes.\n\n\t\tnode = elems; // next internal node of the tree\n\t\tdo {\n\t\t\t// n = node of least frequency\n\t\t\tn = s.heap[1];\n\t\t\ts.heap[1] = s.heap[s.heap_len--];\n\t\t\ts.pqdownheap(tree, 1);\n\t\t\tm = s.heap[1]; // m = node of next least frequency\n\n\t\t\ts.heap[--s.heap_max] = n; // keep the nodes sorted by frequency\n\t\t\ts.heap[--s.heap_max] = m;\n\n\t\t\t// Create a new node father of n and m\n\t\t\ttree[node * 2] = (tree[n * 2] + tree[m * 2]);\n\t\t\ts.depth[node] = Math.max(s.depth[n], s.depth[m]) + 1;\n\t\t\ttree[n * 2 + 1] = tree[m * 2 + 1] = node;\n\n\t\t\t// and insert the new node in the heap\n\t\t\ts.heap[1] = node++;\n\t\t\ts.pqdownheap(tree, 1);\n\t\t} while (s.heap_len >= 2);\n\n\t\ts.heap[--s.heap_max] = s.heap[1];\n\n\t\t// At this point, the fields freq and dad are set. We can now\n\t\t// generate the bit lengths.\n\n\t\tgen_bitlen(s);\n\n\t\t// The field len is now set, we can generate the bit codes\n\t\tgen_codes(tree, that.max_code, s.bl_count);\n\t};\n\n}\n\nTree._length_code = [0, 1, 2, 3, 4, 5, 6, 7].concat(...extractArray([\n\t[2, 8], [2, 9], [2, 10], [2, 11], [4, 12], [4, 13], [4, 14], [4, 15], [8, 16], [8, 17], [8, 18], [8, 19],\n\t[16, 20], [16, 21], [16, 22], [16, 23], [32, 24], [32, 25], [32, 26], [31, 27], [1, 28]]));\n\nTree.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];\n\nTree.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,\n\t24576];\n\n// Mapping from a distance to a distance code. dist is the distance - 1 and\n// must not have side effects. _dist_code[256] and _dist_code[257] are never\n// used.\nTree.d_code = function (dist) {\n\treturn ((dist) < 256 ? _dist_code[dist] : _dist_code[256 + ((dist) >>> 7)]);\n};\n\n// extra bits for each length code\nTree.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];\n\n// extra bits for each distance code\nTree.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];\n\n// extra bits for each bit length code\nTree.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];\n\nTree.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\n// StaticTree\n\nfunction StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {\n\tconst that = this;\n\tthat.static_tree = static_tree;\n\tthat.extra_bits = extra_bits;\n\tthat.extra_base = extra_base;\n\tthat.elems = elems;\n\tthat.max_length = max_length;\n}\n\nconst static_ltree2_first_part = [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,\n\t210, 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,\n\t214, 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,\n\t209, 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,\n\t213, 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,\n\t179, 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,\n\t59, 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,\n\t471, 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,\n\t351, 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,\n\t116, 3, 131, 67, 195, 35, 163, 99, 227];\nconst static_ltree2_second_part = extractArray([[144, 8], [112, 9], [24, 7], [8, 8]]);\nStaticTree.static_ltree = flatArray(static_ltree2_first_part.map((value, index) => [value, static_ltree2_second_part[index]]));\n\nconst static_dtree_first_part = [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];\nconst static_dtree_second_part = extractArray([[30, 5]]);\nStaticTree.static_dtree = flatArray(static_dtree_first_part.map((value, index) => [value, static_dtree_second_part[index]]));\n\nStaticTree.static_l_desc = new StaticTree(StaticTree.static_ltree, Tree.extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\nStaticTree.static_d_desc = new StaticTree(StaticTree.static_dtree, Tree.extra_dbits, 0, D_CODES, MAX_BITS);\n\nStaticTree.static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n// Deflate\n\nconst MAX_MEM_LEVEL = 9;\nconst DEF_MEM_LEVEL = 8;\n\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\tconst that = this;\n\tthat.good_length = good_length;\n\tthat.max_lazy = max_lazy;\n\tthat.nice_length = nice_length;\n\tthat.max_chain = max_chain;\n\tthat.func = func;\n}\n\nconst STORED = 0;\nconst FAST = 1;\nconst SLOW = 2;\nconst config_table = [\n\tnew Config(0, 0, 0, 0, STORED),\n\tnew Config(4, 4, 8, 4, FAST),\n\tnew Config(4, 5, 16, 8, FAST),\n\tnew Config(4, 6, 32, 32, FAST),\n\tnew Config(4, 4, 16, 16, SLOW),\n\tnew Config(8, 16, 32, 32, SLOW),\n\tnew Config(8, 16, 128, 128, SLOW),\n\tnew Config(8, 32, 128, 256, SLOW),\n\tnew Config(32, 128, 258, 1024, SLOW),\n\tnew Config(32, 258, 258, 4096, SLOW)\n];\n\nconst z_errmsg = [\"need dictionary\", // Z_NEED_DICT\n\t// 2\n\t\"stream end\", // Z_STREAM_END 1\n\t\"\", // Z_OK 0\n\t\"\", // Z_ERRNO (-1)\n\t\"stream error\", // Z_STREAM_ERROR (-2)\n\t\"data error\", // Z_DATA_ERROR (-3)\n\t\"\", // Z_MEM_ERROR (-4)\n\t\"buffer error\", // Z_BUF_ERROR (-5)\n\t\"\",// Z_VERSION_ERROR (-6)\n\t\"\"];\n\n// block not completed, need more input or more output\nconst NeedMore = 0;\n\n// block flush performed\nconst BlockDone = 1;\n\n// finish started, need only more output at next deflate\nconst FinishStarted = 2;\n\n// finish done, accept no more input or output\nconst FinishDone = 3;\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\n// The deflate compression method\nconst Z_DEFLATED = 8;\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nfunction smaller(tree, n, m, depth) {\n\tconst tn2 = tree[n * 2];\n\tconst tm2 = tree[m * 2];\n\treturn (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m]));\n}\n\nfunction Deflate() {\n\n\tconst that = this;\n\tlet strm; // pointer back to this zlib stream\n\tlet status; // as the name implies\n\t// pending_buf; // output still pending\n\tlet pending_buf_size; // size of pending_buf\n\t// pending_out; // next pending byte to output to the stream\n\t// pending; // nb of bytes in the pending buffer\n\n\t// dist_buf; // buffer for distances\n\t// lc_buf; // buffer for literals or lengths\n\t// To simplify the code, dist_buf and lc_buf have the same number of elements.\n\t// To use different lengths, an extra flag array would be necessary.\n\n\tlet last_flush; // value of flush param for previous deflate call\n\n\tlet w_size; // LZ77 win size (32K by default)\n\tlet w_bits; // log2(w_size) (8..16)\n\tlet w_mask; // w_size - 1\n\n\tlet win;\n\t// Sliding win. Input bytes are read into the second half of the win,\n\t// and move to the first half later to keep a dictionary of at least wSize\n\t// bytes. With this organization, matches are limited to a distance of\n\t// wSize-MAX_MATCH bytes, but this ensures that IO is always\n\t// performed with a length multiple of the block size. Also, it limits\n\t// the win size to 64K, which is quite useful on MSDOS.\n\t// To do: use the user input buffer as sliding win.\n\n\tlet window_size;\n\t// Actual size of win: 2*wSize, except when the user input buffer\n\t// is directly used as sliding win.\n\n\tlet prev;\n\t// Link to older string with same hash index. To limit the size of this\n\t// array to 64K, this link is maintained only for the last 32K strings.\n\t// An index in this array is thus a win index modulo 32K.\n\n\tlet head; // Heads of the hash chains or NIL.\n\n\tlet ins_h; // hash index of string to be inserted\n\tlet hash_size; // number of elements in hash table\n\tlet hash_bits; // log2(hash_size)\n\tlet hash_mask; // hash_size-1\n\n\t// Number of bits by which ins_h must be shifted at each input\n\t// step. It must be such that after MIN_MATCH steps, the oldest\n\t// byte no longer takes part in the hash key, that is:\n\t// hash_shift * MIN_MATCH >= hash_bits\n\tlet hash_shift;\n\n\t// Window position at the beginning of the current output block. Gets\n\t// negative when the win is moved backwards.\n\n\tlet block_start;\n\n\tlet match_length; // length of best match\n\tlet prev_match; // previous match\n\tlet match_available; // set if previous match exists\n\tlet strstart; // start of string to insert\n\tlet match_start; // start of matching string\n\tlet lookahead; // number of valid bytes ahead in win\n\n\t// Length of the best match at previous step. Matches not greater than this\n\t// are discarded. This is used in the lazy match evaluation.\n\tlet prev_length;\n\n\t// To speed up deflation, hash chains are never searched beyond this\n\t// length. A higher limit improves compression ratio but degrades the speed.\n\tlet max_chain_length;\n\n\t// Attempt to find a better match only when the current match is strictly\n\t// smaller than this value. This mechanism is used only for compression\n\t// levels >= 4.\n\tlet max_lazy_match;\n\n\t// Insert new strings in the hash table only if the match length is not\n\t// greater than this length. This saves time but degrades compression.\n\t// max_insert_length is used only for compression levels <= 3.\n\n\tlet level; // compression level (1..9)\n\tlet strategy; // favor or force Huffman coding\n\n\t// Use a faster search when the previous match is longer than this\n\tlet good_match;\n\n\t// Stop searching when current match exceeds this\n\tlet nice_match;\n\n\tlet dyn_ltree; // literal and length tree\n\tlet dyn_dtree; // distance tree\n\tlet bl_tree; // Huffman tree for bit lengths\n\n\tconst l_desc = new Tree(); // desc for literal tree\n\tconst d_desc = new Tree(); // desc for distance tree\n\tconst bl_desc = new Tree(); // desc for bit length tree\n\n\t// that.heap_len; // number of elements in the heap\n\t// that.heap_max; // element of largest frequency\n\t// The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n\t// The same heap array is used to build all trees.\n\n\t// Depth of each subtree used as tie breaker for trees of equal frequency\n\tthat.depth = [];\n\n\t// Size of match buffer for literals/lengths. There are 4 reasons for\n\t// limiting lit_bufsize to 64K:\n\t// - frequencies can be kept in 16 bit counters\n\t// - if compression is not successful for the first block, all input\n\t// data is still in the win so we can still emit a stored block even\n\t// when input comes from standard input. (This can also be done for\n\t// all blocks if lit_bufsize is not greater than 32K.)\n\t// - if compression is not successful for a file smaller than 64K, we can\n\t// even emit a stored file instead of a stored block (saving 5 bytes).\n\t// This is applicable only for zip (not gzip or zlib).\n\t// - creating new Huffman trees less frequently may not provide fast\n\t// adaptation to changes in the input data statistics. (Take for\n\t// example a binary file with poorly compressible code followed by\n\t// a highly compressible string table.) Smaller buffer sizes give\n\t// fast adaptation but have of course the overhead of transmitting\n\t// trees more frequently.\n\t// - I can't count above 4\n\tlet lit_bufsize;\n\n\tlet last_lit; // running index in dist_buf and lc_buf\n\n\t// that.opt_len; // bit length of current block with optimal trees\n\t// that.static_len; // bit length of current block with static trees\n\tlet matches; // number of string matches in current block\n\tlet last_eob_len; // bit length of EOB code for last block\n\n\t// Output buffer. bits are inserted starting at the bottom (least\n\t// significant bits).\n\tlet bi_buf;\n\n\t// Number of valid bits in bi_buf. All bits above the last valid bit\n\t// are always zero.\n\tlet bi_valid;\n\n\t// number of codes at each bit length for an optimal tree\n\tthat.bl_count = [];\n\n\t// heap used to build the Huffman trees\n\tthat.heap = [];\n\n\tdyn_ltree = [];\n\tdyn_dtree = [];\n\tbl_tree = [];\n\n\tfunction lm_init() {\n\t\twindow_size = 2 * w_size;\n\n\t\thead[hash_size - 1] = 0;\n\t\tfor (let i = 0; i < hash_size - 1; i++) {\n\t\t\thead[i] = 0;\n\t\t}\n\n\t\t// Set the default configuration parameters:\n\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\tgood_match = config_table[level].good_length;\n\t\tnice_match = config_table[level].nice_length;\n\t\tmax_chain_length = config_table[level].max_chain;\n\n\t\tstrstart = 0;\n\t\tblock_start = 0;\n\t\tlookahead = 0;\n\t\tmatch_length = prev_length = MIN_MATCH - 1;\n\t\tmatch_available = 0;\n\t\tins_h = 0;\n\t}\n\n\tfunction init_block() {\n\t\tlet i;\n\t\t// Initialize the trees.\n\t\tfor (i = 0; i < L_CODES; i++)\n\t\t\tdyn_ltree[i * 2] = 0;\n\t\tfor (i = 0; i < D_CODES; i++)\n\t\t\tdyn_dtree[i * 2] = 0;\n\t\tfor (i = 0; i < BL_CODES; i++)\n\t\t\tbl_tree[i * 2] = 0;\n\n\t\tdyn_ltree[END_BLOCK * 2] = 1;\n\t\tthat.opt_len = that.static_len = 0;\n\t\tlast_lit = matches = 0;\n\t}\n\n\t// Initialize the tree data structures for a new zlib stream.\n\tfunction tr_init() {\n\n\t\tl_desc.dyn_tree = dyn_ltree;\n\t\tl_desc.stat_desc = StaticTree.static_l_desc;\n\n\t\td_desc.dyn_tree = dyn_dtree;\n\t\td_desc.stat_desc = StaticTree.static_d_desc;\n\n\t\tbl_desc.dyn_tree = bl_tree;\n\t\tbl_desc.stat_desc = StaticTree.static_bl_desc;\n\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\t// Initialize the first block of the first file:\n\t\tinit_block();\n\t}\n\n\t// Restore the heap property by moving down the tree starting at node k,\n\t// exchanging a node with the smallest of its two sons if necessary,\n\t// stopping\n\t// when the heap property is re-established (each father smaller than its\n\t// two sons).\n\tthat.pqdownheap = function (tree, // the tree to restore\n\t\tk // node to move down\n\t) {\n\t\tconst heap = that.heap;\n\t\tconst v = heap[k];\n\t\tlet j = k << 1; // left son of k\n\t\twhile (j <= that.heap_len) {\n\t\t\t// Set j to the smallest of the two sons:\n\t\t\tif (j < that.heap_len && smaller(tree, heap[j + 1], heap[j], that.depth)) {\n\t\t\t\tj++;\n\t\t\t}\n\t\t\t// Exit if v is smaller than both sons\n\t\t\tif (smaller(tree, v, heap[j], that.depth))\n\t\t\t\tbreak;\n\n\t\t\t// Exchange v with the smallest son\n\t\t\theap[k] = heap[j];\n\t\t\tk = j;\n\t\t\t// And continue down the tree, setting j to the left son of k\n\t\t\tj <<= 1;\n\t\t}\n\t\theap[k] = v;\n\t};\n\n\t// Scan a literal or distance tree to determine the frequencies of the codes\n\t// in the bit length tree.\n\tfunction scan_tree(tree,// the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\t\ttree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n\n\t\tfor (let n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tbl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen)\n\t\t\t\t\tbl_tree[curlen * 2]++;\n\t\t\t\tbl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t\tbl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t\tbl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Construct the Huffman tree for the bit lengths and return the index in\n\t// bl_order of the last bit length code to send.\n\tfunction build_bl_tree() {\n\t\tlet max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbl_desc.build_tree(that);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t// counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts\n\t\tthat.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\n\t\treturn max_blindex;\n\t}\n\n\t// Output a byte on the stream.\n\t// IN assertion: there is enough room in pending_buf.\n\tfunction put_byte(p) {\n\t\tthat.pending_buf[that.pending++] = p;\n\t}\n\n\tfunction put_short(w) {\n\t\tput_byte(w & 0xff);\n\t\tput_byte((w >>> 8) & 0xff);\n\t}\n\n\tfunction putShortMSB(b) {\n\t\tput_byte((b >> 8) & 0xff);\n\t\tput_byte((b & 0xff) & 0xff);\n\t}\n\n\tfunction send_bits(value, length) {\n\t\tlet val;\n\t\tconst len = length;\n\t\tif (bi_valid > Buf_size - len) {\n\t\t\tval = value;\n\t\t\t// bi_buf |= (val << bi_valid);\n\t\t\tbi_buf |= ((val << bi_valid) & 0xffff);\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = val >>> (Buf_size - bi_valid);\n\t\t\tbi_valid += len - Buf_size;\n\t\t} else {\n\t\t\t// bi_buf |= (value) << bi_valid;\n\t\t\tbi_buf |= (((value) << bi_valid) & 0xffff);\n\t\t\tbi_valid += len;\n\t\t}\n\t}\n\n\tfunction send_code(c, tree) {\n\t\tconst c2 = c * 2;\n\t\tsend_bits(tree[c2] & 0xffff, tree[c2 + 1] & 0xffff);\n\t}\n\n\t// Send a literal or distance tree in compressed form, using the codes in\n\t// bl_tree.\n\tfunction send_tree(tree,// the tree to be sent\n\t\tmax_code // and its largest code of non zero frequency\n\t) {\n\t\tlet n; // iterates over all tree elements\n\t\tlet prevlen = -1; // last emitted length\n\t\tlet curlen; // length of current code\n\t\tlet nextlen = tree[0 * 2 + 1]; // length of next code\n\t\tlet count = 0; // repeat count of the current code\n\t\tlet max_count = 7; // max repeat count\n\t\tlet min_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tdo {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t} while (--count !== 0);\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen != prevlen) {\n\t\t\t\t\tsend_code(curlen, bl_tree);\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t\tsend_code(REP_3_6, bl_tree);\n\t\t\t\tsend_bits(count - 3, 2);\n\t\t\t} else if (count <= 10) {\n\t\t\t\tsend_code(REPZ_3_10, bl_tree);\n\t\t\t\tsend_bits(count - 3, 3);\n\t\t\t} else {\n\t\t\t\tsend_code(REPZ_11_138, bl_tree);\n\t\t\t\tsend_bits(count - 11, 7);\n\t\t\t}\n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Send the header for a block using dynamic Huffman trees: the counts, the\n\t// lengths of the bit length codes, the literal tree and the distance tree.\n\t// IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n\tfunction send_all_trees(lcodes, dcodes, blcodes) {\n\t\tlet rank; // index in bl_order\n\n\t\tsend_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n\t\tsend_bits(dcodes - 1, 5);\n\t\tsend_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n\t\tfor (rank = 0; rank < blcodes; rank++) {\n\t\t\tsend_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);\n\t\t}\n\t\tsend_tree(dyn_ltree, lcodes - 1); // literal tree\n\t\tsend_tree(dyn_dtree, dcodes - 1); // distance tree\n\t}\n\n\t// Flush the bit buffer, keeping at most 7 bits in it.\n\tfunction bi_flush() {\n\t\tif (bi_valid == 16) {\n\t\t\tput_short(bi_buf);\n\t\t\tbi_buf = 0;\n\t\t\tbi_valid = 0;\n\t\t} else if (bi_valid >= 8) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t\tbi_buf >>>= 8;\n\t\t\tbi_valid -= 8;\n\t\t}\n\t}\n\n\t// Send one empty static block to give enough lookahead for inflate.\n\t// This takes 10 bits, of which 7 may remain in the bit buffer.\n\t// The current inflate code requires 9 bits of lookahead. If the\n\t// last two codes for the previous block (real code plus EOB) were coded\n\t// on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode\n\t// the last real code. In this case we send two empty static blocks instead\n\t// of one. (There are no problems if the previous block is stored or fixed.)\n\t// To simplify the code, we assume the worst case of last real code encoded\n\t// on one bit only.\n\tfunction _tr_align() {\n\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\n\t\tbi_flush();\n\n\t\t// Of the 10 bits for the empty block, we have already sent\n\t\t// (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t// the EOB of the previous block) was thus at least one plus the length\n\t\t// of the EOB plus what we have just sent of the empty static block.\n\t\tif (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t}\n\t\tlast_eob_len = 7;\n\t}\n\n\t// Save the match info and tally the frequency counts. Return true if\n\t// the current block must be flushed.\n\tfunction _tr_tally(dist, // distance of matched string\n\t\tlc // match length-MIN_MATCH or unmatched char (if dist==0)\n\t) {\n\t\tlet out_length, in_length, dcode;\n\t\tthat.dist_buf[last_lit] = dist;\n\t\tthat.lc_buf[last_lit] = lc & 0xff;\n\t\tlast_lit++;\n\n\t\tif (dist === 0) {\n\t\t\t// lc is the unmatched char\n\t\t\tdyn_ltree[lc * 2]++;\n\t\t} else {\n\t\t\tmatches++;\n\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\tdist--; // dist = match distance - 1\n\t\t\tdyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;\n\t\t\tdyn_dtree[Tree.d_code(dist) * 2]++;\n\t\t}\n\n\t\tif ((last_lit & 0x1fff) === 0 && level > 2) {\n\t\t\t// Compute an upper bound for the compressed length\n\t\t\tout_length = last_lit * 8;\n\t\t\tin_length = strstart - block_start;\n\t\t\tfor (dcode = 0; dcode < D_CODES; dcode++) {\n\t\t\t\tout_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);\n\t\t\t}\n\t\t\tout_length >>>= 3;\n\t\t\tif ((matches < Math.floor(last_lit / 2)) && out_length < Math.floor(in_length / 2))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn (last_lit == lit_bufsize - 1);\n\t\t// We avoid equality with lit_bufsize because of wraparound at 64K\n\t\t// on 16 bit machines and because stored blocks are restricted to\n\t\t// 64K-1 bytes.\n\t}\n\n\t// Send the block data compressed using the given Huffman trees\n\tfunction compress_block(ltree, dtree) {\n\t\tlet dist; // distance of matched string\n\t\tlet lc; // match length or unmatched char (if dist === 0)\n\t\tlet lx = 0; // running index in dist_buf and lc_buf\n\t\tlet code; // the code to send\n\t\tlet extra; // number of extra bits to send\n\n\t\tif (last_lit !== 0) {\n\t\t\tdo {\n\t\t\t\tdist = that.dist_buf[lx];\n\t\t\t\tlc = that.lc_buf[lx];\n\t\t\t\tlx++;\n\n\t\t\t\tif (dist === 0) {\n\t\t\t\t\tsend_code(lc, ltree); // send a literal byte\n\t\t\t\t} else {\n\t\t\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\t\t\tcode = Tree._length_code[lc];\n\n\t\t\t\t\tsend_code(code + LITERALS + 1, ltree); // send the length\n\t\t\t\t\t// code\n\t\t\t\t\textra = Tree.extra_lbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tlc -= Tree.base_length[code];\n\t\t\t\t\t\tsend_bits(lc, extra); // send the extra length bits\n\t\t\t\t\t}\n\t\t\t\t\tdist--; // dist is now the match distance - 1\n\t\t\t\t\tcode = Tree.d_code(dist);\n\n\t\t\t\t\tsend_code(code, dtree); // send the distance code\n\t\t\t\t\textra = Tree.extra_dbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tdist -= Tree.base_dist[code];\n\t\t\t\t\t\tsend_bits(dist, extra); // send the extra distance bits\n\t\t\t\t\t}\n\t\t\t\t} // literal or match pair ?\n\t\t\t} while (lx < last_lit);\n\t\t}\n\n\t\tsend_code(END_BLOCK, ltree);\n\t\tlast_eob_len = ltree[END_BLOCK * 2 + 1];\n\t}\n\n\t// Flush the bit buffer and align the output on a byte boundary\n\tfunction bi_windup() {\n\t\tif (bi_valid > 8) {\n\t\t\tput_short(bi_buf);\n\t\t} else if (bi_valid > 0) {\n\t\t\tput_byte(bi_buf & 0xff);\n\t\t}\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t}\n\n\t// Copy a stored block, storing first the length and its\n\t// one's complement if requested.\n\tfunction copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t) {\n\t\tbi_windup(); // align on byte boundary\n\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\tif (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t}\n\n\t\tthat.pending_buf.set(win.subarray(buf, buf + len), that.pending);\n\t\tthat.pending += len;\n\t}\n\n\t// Send a stored block\n\tfunction _tr_stored_block(buf, // input block\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tsend_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type\n\t\tcopy_block(buf, stored_len, true); // with header\n\t}\n\n\t// Determine the best encoding for the current block: dynamic trees, static\n\t// trees or store, and output the encoded block to the zip file.\n\tfunction _tr_flush_block(buf, // input block, or NULL if too old\n\t\tstored_len, // length of input block\n\t\teof // true if this is the last block for a file\n\t) {\n\t\tlet opt_lenb, static_lenb;// opt_len and static_len in bytes\n\t\tlet max_blindex = 0; // index of last bit length code of non zero freq\n\n\t\t// Build the Huffman trees unless a stored block is forced\n\t\tif (level > 0) {\n\t\t\t// Construct the literal and distance trees\n\t\t\tl_desc.build_tree(that);\n\n\t\t\td_desc.build_tree(that);\n\n\t\t\t// At this point, opt_len and static_len are the total bit lengths\n\t\t\t// of\n\t\t\t// the compressed block data, excluding the tree representations.\n\n\t\t\t// Build the bit length tree for the above two trees, and get the\n\t\t\t// index\n\t\t\t// in bl_order of the last bit length code to send.\n\t\t\tmax_blindex = build_bl_tree();\n\n\t\t\t// Determine the best encoding. Compute first the block length in\n\t\t\t// bytes\n\t\t\topt_lenb = (that.opt_len + 3 + 7) >>> 3;\n\t\t\tstatic_lenb = (that.static_len + 3 + 7) >>> 3;\n\n\t\t\tif (static_lenb <= opt_lenb)\n\t\t\t\topt_lenb = static_lenb;\n\t\t} else {\n\t\t\topt_lenb = static_lenb = stored_len + 5; // force a stored block\n\t\t}\n\n\t\tif ((stored_len + 4 <= opt_lenb) && buf != -1) {\n\t\t\t// 4: two words for the lengths\n\t\t\t// The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes\n\t\t\t// since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\t_tr_stored_block(buf, stored_len, eof);\n\t\t} else if (static_lenb == opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tcompress_block(StaticTree.static_ltree, StaticTree.static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\t// The above check is made mod 2^32, for files larger than 512 MB\n\t\t// and uLong implemented on 32 bits.\n\n\t\tinit_block();\n\n\t\tif (eof) {\n\t\t\tbi_windup();\n\t\t}\n\t}\n\n\tfunction flush_block_only(eof) {\n\t\t_tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof);\n\t\tblock_start = strstart;\n\t\tstrm.flush_pending();\n\t}\n\n\t// Fill the win when the lookahead becomes insufficient.\n\t// Updates strstart and lookahead.\n\t//\n\t// IN assertion: lookahead < MIN_LOOKAHEAD\n\t// OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n\t// At least one byte has been read, or avail_in === 0; reads are\n\t// performed for at least two bytes (required for the zip translate_eol\n\t// option -- not supported here).\n\tfunction fill_window() {\n\t\tlet n, m;\n\t\tlet p;\n\t\tlet more; // Amount of free space at the end of the win.\n\n\t\tdo {\n\t\t\tmore = (window_size - lookahead - strstart);\n\n\t\t\t// Deal with !@#$% 64K limit:\n\t\t\tif (more === 0 && strstart === 0 && lookahead === 0) {\n\t\t\t\tmore = w_size;\n\t\t\t} else if (more == -1) {\n\t\t\t\t// Very unlikely, but possible on 16 bit machine if strstart ==\n\t\t\t\t// 0\n\t\t\t\t// and lookahead == 1 (input done one byte at time)\n\t\t\t\tmore--;\n\n\t\t\t\t// If the win is almost full and there is insufficient\n\t\t\t\t// lookahead,\n\t\t\t\t// move the upper half to the lower one to make room in the\n\t\t\t\t// upper half.\n\t\t\t} else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {\n\t\t\t\twin.set(win.subarray(w_size, w_size + w_size), 0);\n\n\t\t\t\tmatch_start -= w_size;\n\t\t\t\tstrstart -= w_size; // we now have strstart >= MAX_DIST\n\t\t\t\tblock_start -= w_size;\n\n\t\t\t\t// Slide the hash table (could be avoided with 32 bit values\n\t\t\t\t// at the expense of memory usage). We slide even when level ==\n\t\t\t\t// 0\n\t\t\t\t// to keep the hash table consistent if we switch back to level\n\t\t\t\t// > 0\n\t\t\t\t// later. (Using level 0 permanently is not an optimal usage of\n\t\t\t\t// zlib, so we don't care about this pathological case.)\n\n\t\t\t\tn = hash_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (head[--p] & 0xffff);\n\t\t\t\t\thead[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t} while (--n !== 0);\n\n\t\t\t\tn = w_size;\n\t\t\t\tp = n;\n\t\t\t\tdo {\n\t\t\t\t\tm = (prev[--p] & 0xffff);\n\t\t\t\t\tprev[p] = (m >= w_size ? m - w_size : 0);\n\t\t\t\t\t// If n is not on any hash chain, prev[n] is garbage but\n\t\t\t\t\t// its value will never be used.\n\t\t\t\t} while (--n !== 0);\n\t\t\t\tmore += w_size;\n\t\t\t}\n\n\t\t\tif (strm.avail_in === 0)\n\t\t\t\treturn;\n\n\t\t\t// If there was no sliding:\n\t\t\t// strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t\t\t// more == window_size - lookahead - strstart\n\t\t\t// => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t\t\t// => more >= window_size - 2*WSIZE + 2\n\t\t\t// In the BIG_MEM or MMAP case (not yet supported),\n\t\t\t// window_size == input_size + MIN_LOOKAHEAD &&\n\t\t\t// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t\t\t// Otherwise, window_size == 2*WSIZE so more >= 2.\n\t\t\t// If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\n\t\t\tn = strm.read_buf(win, strstart + lookahead, more);\n\t\t\tlookahead += n;\n\n\t\t\t// Initialize the hash value now that we have some input:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = win[strstart] & 0xff;\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t}\n\t\t\t// If the whole input has less than MIN_MATCH bytes, ins_h is\n\t\t\t// garbage,\n\t\t\t// but this is not important since only literal bytes will be\n\t\t\t// emitted.\n\t\t} while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);\n\t}\n\n\t// Copy without compression as much as possible from the input stream,\n\t// return\n\t// the current block state.\n\t// This function does not insert new strings in the dictionary since\n\t// uncompressible data is probably not useful. This function is used\n\t// only for the level=0 compression option.\n\t// NOTE: this function should be optimized to avoid extra copying from\n\t// win to pending_buf.\n\tfunction deflate_stored(flush) {\n\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\tlet max_block_size = 0xffff;\n\t\tlet max_start;\n\n\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t}\n\n\t\t// Copy as much as possible from input to output:\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Fill the win as much as possible:\n\t\t\tif (lookahead <= 1) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\treturn NeedMore;\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\tstrstart += lookahead;\n\t\t\tlookahead = 0;\n\n\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\tmax_start = block_start + max_block_size;\n\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\tstrstart = max_start;\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\n\t\t\t}\n\n\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t// negative and the data will be gone:\n\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0)\n\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction longest_match(cur_match) {\n\t\tlet chain_length = max_chain_length; // max hash chain length\n\t\tlet scan = strstart; // current string\n\t\tlet match; // matched string\n\t\tlet len; // length of current match\n\t\tlet best_len = prev_length; // best match length so far\n\t\tconst limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0;\n\t\tlet _nice_match = nice_match;\n\n\t\t// Stop when cur_match becomes <= limit. To simplify the code,\n\t\t// we prevent matches with the string of win index 0.\n\n\t\tconst wmask = w_mask;\n\n\t\tconst strend = strstart + MAX_MATCH;\n\t\tlet scan_end1 = win[scan + best_len - 1];\n\t\tlet scan_end = win[scan + best_len];\n\n\t\t// The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of\n\t\t// 16.\n\t\t// It is easy to get rid of this optimization if necessary.\n\n\t\t// Do not waste too much time if we already have a good match:\n\t\tif (prev_length >= good_match) {\n\t\t\tchain_length >>= 2;\n\t\t}\n\n\t\t// Do not look for matches beyond the end of the input. This is\n\t\t// necessary\n\t\t// to make deflate deterministic.\n\t\tif (_nice_match > lookahead)\n\t\t\t_nice_match = lookahead;\n\n\t\tdo {\n\t\t\tmatch = cur_match;\n\n\t\t\t// Skip to next match if the match length cannot increase\n\t\t\t// or if the match length is less than 2:\n\t\t\tif (win[match + best_len] != scan_end || win[match + best_len - 1] != scan_end1 || win[match] != win[scan]\n\t\t\t\t|| win[++match] != win[scan + 1])\n\t\t\t\tcontinue;\n\n\t\t\t// The check at best_len-1 can be removed because it will be made\n\t\t\t// again later. (This heuristic is not always a win.)\n\t\t\t// It is not necessary to compare scan[2] and match[2] since they\n\t\t\t// are always equal when the other bytes match, given that\n\t\t\t// the hash keys are equal and that HASH_BITS >= 8.\n\t\t\tscan += 2;\n\t\t\tmatch++;\n\n\t\t\t// We check for insufficient lookahead only every 8th comparison;\n\t\t\t// the 256th check will be made at strstart+258.\n\t\t\t// eslint-disable-next-line no-empty\n\t\t\tdo {\n\t\t\t\t// empty block\n\t\t\t} while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]\n\t\t\t&& win[++scan] == win[++match] && win[++scan] == win[++match] && scan < strend);\n\n\t\t\tlen = MAX_MATCH - (strend - scan);\n\t\t\tscan = strend - MAX_MATCH;\n\n\t\t\tif (len > best_len) {\n\t\t\t\tmatch_start = cur_match;\n\t\t\t\tbest_len = len;\n\t\t\t\tif (len >= _nice_match)\n\t\t\t\t\tbreak;\n\t\t\t\tscan_end1 = win[scan + best_len - 1];\n\t\t\t\tscan_end = win[scan + best_len];\n\t\t\t}\n\n\t\t} while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length !== 0);\n\n\t\tif (best_len <= lookahead)\n\t\t\treturn best_len;\n\t\treturn lookahead;\n\t}\n\n\t// Compress as much as possible from the input stream, return the current\n\t// block state.\n\t// This function does not perform lazy evaluation of matches and inserts\n\t// new strings in the dictionary only for unmatched strings or for short\n\t// matches. It is used only for the fast compression options.\n\tfunction deflate_fast(flush) {\n\t\t// short hash_head = 0; // head of the hash chain\n\t\tlet hash_head = 0; // head of the hash chain\n\t\tlet bflush; // set if current block must be flushed\n\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = win[strstart] & 0xff;\n\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t// not\n\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (bflush) {\n\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t}\n\n\t\tflush_block_only(flush == Z_FINISH);\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\t// Same as above, but achieves better compression. We use a lazy\n\t// evaluation for matches: a match is finally adopted only if there is\n\t// no better match at the next win position.\n\tfunction deflate_slow(flush) {\n\t\t// short hash_head = 0; // head of hash chain\n\t\tlet hash_head = 0; // head of hash chain\n\t\tlet bflush; // set if current block must be flushed\n\t\tlet max_insert;\n\n\t\t// Process the input block.\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\tfill_window();\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t\tif (lookahead === 0)\n\t\t\t\t\tbreak; // flush the current block\n\t\t\t}\n\n\t\t\t// Insert the string win[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\thead[ins_h] = strstart;\n\t\t\t}\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of win index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t}\n\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t// the hash table.\n\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\tprev_length -= 2;\n\t\t\t\tdo {\n\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t}\n\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\tmatch_available = 0;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\tstrstart++;\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\n\t\t\t\tif (bflush) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t}\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\treturn NeedMore;\n\t\t\t} else {\n\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t// the next step to decide.\n\n\t\t\t\tmatch_available = 1;\n\t\t\t\tstrstart++;\n\t\t\t\tlookahead--;\n\t\t\t}\n\t\t}\n\n\t\tif (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, win[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t}\n\t\tflush_block_only(flush == Z_FINISH);\n\n\t\tif (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH)\n\t\t\t\treturn FinishStarted;\n\t\t\telse\n\t\t\t\treturn NeedMore;\n\t\t}\n\n\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t}\n\n\tfunction deflateReset(strm) {\n\t\tstrm.total_in = strm.total_out = 0;\n\t\tstrm.msg = null; //\n\n\t\tthat.pending = 0;\n\t\tthat.pending_out = 0;\n\n\t\tstatus = BUSY_STATE;\n\n\t\tlast_flush = Z_NO_FLUSH;\n\n\t\ttr_init();\n\t\tlm_init();\n\t\treturn Z_OK;\n\t}\n\n\tthat.deflateInit = function (strm, _level, bits, _method, memLevel, _strategy) {\n\t\tif (!_method)\n\t\t\t_method = Z_DEFLATED;\n\t\tif (!memLevel)\n\t\t\tmemLevel = DEF_MEM_LEVEL;\n\t\tif (!_strategy)\n\t\t\t_strategy = Z_DEFAULT_STRATEGY;\n\n\t\t// byte[] my_version=ZLIB_VERSION;\n\n\t\t//\n\t\t// if (!version || version[0] != my_version[0]\n\t\t// || stream_size != sizeof(z_stream)) {\n\t\t// return Z_VERSION_ERROR;\n\t\t// }\n\n\t\tstrm.msg = null;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION)\n\t\t\t_level = 6;\n\n\t\tif (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0\n\t\t\t|| _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tstrm.dstate = that;\n\n\t\tw_bits = bits;\n\t\tw_size = 1 << w_bits;\n\t\tw_mask = w_size - 1;\n\n\t\thash_bits = memLevel + 7;\n\t\thash_size = 1 << hash_bits;\n\t\thash_mask = hash_size - 1;\n\t\thash_shift = Math.floor((hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n\t\twin = new Uint8Array(w_size * 2);\n\t\tprev = [];\n\t\thead = [];\n\n\t\tlit_bufsize = 1 << (memLevel + 6); // 16K elements by default\n\n\t\tthat.pending_buf = new Uint8Array(lit_bufsize * 4);\n\t\tpending_buf_size = lit_bufsize * 4;\n\n\t\tthat.dist_buf = new Uint16Array(lit_bufsize);\n\t\tthat.lc_buf = new Uint8Array(lit_bufsize);\n\n\t\tlevel = _level;\n\n\t\tstrategy = _strategy;\n\n\t\treturn deflateReset(strm);\n\t};\n\n\tthat.deflateEnd = function () {\n\t\tif (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\t// Deallocate in reverse order of allocations:\n\t\tthat.lc_buf = null;\n\t\tthat.dist_buf = null;\n\t\tthat.pending_buf = null;\n\t\thead = null;\n\t\tprev = null;\n\t\twin = null;\n\t\t// free\n\t\tthat.dstate = null;\n\t\treturn status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;\n\t};\n\n\tthat.deflateParams = function (strm, _level, _strategy) {\n\t\tlet err = Z_OK;\n\n\t\tif (_level == Z_DEFAULT_COMPRESSION) {\n\t\t\t_level = 6;\n\t\t}\n\t\tif (_level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (config_table[level].func != config_table[_level].func && strm.total_in !== 0) {\n\t\t\t// Flush the last buffer:\n\t\t\terr = strm.deflate(Z_PARTIAL_FLUSH);\n\t\t}\n\n\t\tif (level != _level) {\n\t\t\tlevel = _level;\n\t\t\tmax_lazy_match = config_table[level].max_lazy;\n\t\t\tgood_match = config_table[level].good_length;\n\t\t\tnice_match = config_table[level].nice_length;\n\t\t\tmax_chain_length = config_table[level].max_chain;\n\t\t}\n\t\tstrategy = _strategy;\n\t\treturn err;\n\t};\n\n\tthat.deflateSetDictionary = function (_strm, dictionary, dictLength) {\n\t\tlet length = dictLength;\n\t\tlet n, index = 0;\n\n\t\tif (!dictionary || status != INIT_STATE)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tif (length < MIN_MATCH)\n\t\t\treturn Z_OK;\n\t\tif (length > w_size - MIN_LOOKAHEAD) {\n\t\t\tlength = w_size - MIN_LOOKAHEAD;\n\t\t\tindex = dictLength - length; // use the tail of the dictionary\n\t\t}\n\t\twin.set(dictionary.subarray(index, index + length), 0);\n\n\t\tstrstart = length;\n\t\tblock_start = length;\n\n\t\t// Insert all strings in the hash table (except for the last two bytes).\n\t\t// s->lookahead stays null, so s->ins_h will be recomputed at the next\n\t\t// call of fill_window.\n\n\t\tins_h = win[0] & 0xff;\n\t\tins_h = (((ins_h) << hash_shift) ^ (win[1] & 0xff)) & hash_mask;\n\n\t\tfor (n = 0; n <= length - MIN_MATCH; n++) {\n\t\t\tins_h = (((ins_h) << hash_shift) ^ (win[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\tprev[n & w_mask] = head[ins_h];\n\t\t\thead[ins_h] = n;\n\t\t}\n\t\treturn Z_OK;\n\t};\n\n\tthat.deflate = function (_strm, flush) {\n\t\tlet i, header, level_flags, old_flush, bstate;\n\n\t\tif (flush > Z_FINISH || flush < 0) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\n\t\tif (!_strm.next_out || (!_strm.next_in && _strm.avail_in !== 0) || (status == FINISH_STATE && flush != Z_FINISH)) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_STREAM_ERROR)];\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tif (_strm.avail_out === 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\tstrm = _strm; // just in case\n\t\told_flush = last_flush;\n\t\tlast_flush = flush;\n\n\t\t// Write the zlib header\n\t\tif (status == INIT_STATE) {\n\t\t\theader = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8;\n\t\t\tlevel_flags = ((level - 1) & 0xff) >> 1;\n\n\t\t\tif (level_flags > 3)\n\t\t\t\tlevel_flags = 3;\n\t\t\theader |= (level_flags << 6);\n\t\t\tif (strstart !== 0)\n\t\t\t\theader |= PRESET_DICT;\n\t\t\theader += 31 - (header % 31);\n\n\t\t\tstatus = BUSY_STATE;\n\t\t\tputShortMSB(header);\n\t\t}\n\n\t\t// Flush as much pending output as possible\n\t\tif (that.pending !== 0) {\n\t\t\tstrm.flush_pending();\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t// console.log(\" avail_out==0\");\n\t\t\t\t// Since avail_out is 0, deflate will be called again with\n\t\t\t\t// more output space, but possibly with both pending and\n\t\t\t\t// avail_in equal to zero. There won't be anything to do,\n\t\t\t\t// but this is not an error situation so make sure we\n\t\t\t\t// return OK instead of BUF_ERROR at next call of deflate:\n\t\t\t\tlast_flush = -1;\n\t\t\t\treturn Z_OK;\n\t\t\t}\n\n\t\t\t// Make sure there is something to do and avoid duplicate\n\t\t\t// consecutive\n\t\t\t// flushes. For repeated and useless calls with Z_FINISH, we keep\n\t\t\t// returning Z_STREAM_END instead of Z_BUFF_ERROR.\n\t\t} else if (strm.avail_in === 0 && flush <= old_flush && flush != Z_FINISH) {\n\t\t\tstrm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// User must not provide more input after the first FINISH:\n\t\tif (status == FINISH_STATE && strm.avail_in !== 0) {\n\t\t\t_strm.msg = z_errmsg[Z_NEED_DICT - (Z_BUF_ERROR)];\n\t\t\treturn Z_BUF_ERROR;\n\t\t}\n\n\t\t// Start a new block or continue the current one.\n\t\tif (strm.avail_in !== 0 || lookahead !== 0 || (flush != Z_NO_FLUSH && status != FINISH_STATE)) {\n\t\t\tbstate = -1;\n\t\t\tswitch (config_table[level].func) {\n\t\t\t\tcase STORED:\n\t\t\t\t\tbstate = deflate_stored(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FAST:\n\t\t\t\t\tbstate = deflate_fast(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SLOW:\n\t\t\t\t\tbstate = deflate_slow(flush);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\n\t\t\tif (bstate == FinishStarted || bstate == FinishDone) {\n\t\t\t\tstatus = FINISH_STATE;\n\t\t\t}\n\t\t\tif (bstate == NeedMore || bstate == FinishStarted) {\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR next call, see above\n\t\t\t\t}\n\t\t\t\treturn Z_OK;\n\t\t\t\t// If flush != Z_NO_FLUSH && avail_out === 0, the next call\n\t\t\t\t// of deflate should use the same flush parameter to make sure\n\t\t\t\t// that the flush is complete. So we don't have to output an\n\t\t\t\t// empty block here, this will be done at next call. This also\n\t\t\t\t// ensures that for a very small output buffer, we emit at most\n\t\t\t\t// one empty block.\n\t\t\t}\n\n\t\t\tif (bstate == BlockDone) {\n\t\t\t\tif (flush == Z_PARTIAL_FLUSH) {\n\t\t\t\t\t_tr_align();\n\t\t\t\t} else { // FULL_FLUSH or SYNC_FLUSH\n\t\t\t\t\t_tr_stored_block(0, 0, false);\n\t\t\t\t\t// For a full flush, this empty block will be recognized\n\t\t\t\t\t// as a special marker by inflate_sync().\n\t\t\t\t\tif (flush == Z_FULL_FLUSH) {\n\t\t\t\t\t\t// state.head[s.hash_size-1]=0;\n\t\t\t\t\t\tfor (i = 0; i < hash_size/*-1*/; i++)\n\t\t\t\t\t\t\t// forget history\n\t\t\t\t\t\t\thead[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstrm.flush_pending();\n\t\t\t\tif (strm.avail_out === 0) {\n\t\t\t\t\tlast_flush = -1; // avoid BUF_ERROR at next call, see above\n\t\t\t\t\treturn Z_OK;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (flush != Z_FINISH)\n\t\t\treturn Z_OK;\n\t\treturn Z_STREAM_END;\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n\tconst that = this;\n\tthat.next_in_index = 0;\n\tthat.next_out_index = 0;\n\t// that.next_in; // next input byte\n\tthat.avail_in = 0; // number of bytes available at next_in\n\tthat.total_in = 0; // total nb of input bytes read so far\n\t// that.next_out; // next output byte should be put there\n\tthat.avail_out = 0; // remaining free space at next_out\n\tthat.total_out = 0; // total nb of bytes output so far\n\t// that.msg;\n\t// that.dstate;\n}\n\nZStream.prototype = {\n\tdeflateInit: function (level, bits) {\n\t\tconst that = this;\n\t\tthat.dstate = new Deflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.dstate.deflateInit(that, level, bits);\n\t},\n\n\tdeflate: function (flush) {\n\t\tconst that = this;\n\t\tif (!that.dstate) {\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\treturn that.dstate.deflate(that, flush);\n\t},\n\n\tdeflateEnd: function () {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.dstate.deflateEnd();\n\t\tthat.dstate = null;\n\t\treturn ret;\n\t},\n\n\tdeflateParams: function (level, strategy) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateParams(that, level, strategy);\n\t},\n\n\tdeflateSetDictionary: function (dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.dstate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.dstate.deflateSetDictionary(that, dictionary, dictLength);\n\t},\n\n\t// Read a new buffer from the current input stream, update the\n\t// total number of bytes read. All deflate() input goes through\n\t// this function so some applications may wish to modify it to avoid\n\t// allocating a large strm->next_in buffer and copying from it.\n\t// (See also flush_pending()).\n\tread_buf: function (buf, start, size) {\n\t\tconst that = this;\n\t\tlet len = that.avail_in;\n\t\tif (len > size)\n\t\t\tlen = size;\n\t\tif (len === 0)\n\t\t\treturn 0;\n\t\tthat.avail_in -= len;\n\t\tbuf.set(that.next_in.subarray(that.next_in_index, that.next_in_index + len), start);\n\t\tthat.next_in_index += len;\n\t\tthat.total_in += len;\n\t\treturn len;\n\t},\n\n\t// Flush as much pending output as possible. All deflate() output goes\n\t// through this function so some applications may wish to modify it\n\t// to avoid allocating a large strm->next_out buffer and copying into it.\n\t// (See also read_buf()).\n\tflush_pending: function () {\n\t\tconst that = this;\n\t\tlet len = that.dstate.pending;\n\n\t\tif (len > that.avail_out)\n\t\t\tlen = that.avail_out;\n\t\tif (len === 0)\n\t\t\treturn;\n\n\t\t// if (that.dstate.pending_buf.length <= that.dstate.pending_out || that.next_out.length <= that.next_out_index\n\t\t// || that.dstate.pending_buf.length < (that.dstate.pending_out + len) || that.next_out.length < (that.next_out_index +\n\t\t// len)) {\n\t\t// console.log(that.dstate.pending_buf.length + \", \" + that.dstate.pending_out + \", \" + that.next_out.length + \", \" +\n\t\t// that.next_out_index + \", \" + len);\n\t\t// console.log(\"avail_out=\" + that.avail_out);\n\t\t// }\n\n\t\tthat.next_out.set(that.dstate.pending_buf.subarray(that.dstate.pending_out, that.dstate.pending_out + len), that.next_out_index);\n\n\t\tthat.next_out_index += len;\n\t\tthat.dstate.pending_out += len;\n\t\tthat.total_out += len;\n\t\tthat.avail_out -= len;\n\t\tthat.dstate.pending -= len;\n\t\tif (that.dstate.pending === 0) {\n\t\t\tthat.dstate.pending_out = 0;\n\t\t}\n\t}\n};\n\n// Deflate\n\nfunction ZipDeflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = getMaximumCompressedSize(options && options.chunkSize ? options.chunkSize : 64 * 1024);\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet level = options ? options.level : Z_DEFAULT_COMPRESSION;\n\tif (typeof level == \"undefined\")\n\t\tlevel = Z_DEFAULT_COMPRESSION;\n\tz.deflateInit(level);\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tif (!data.length)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(flush);\n\t\t\tif (err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index == bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] || new Uint8Array(0);\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tlet err, array, bufferIndex = 0, bufferSize = 0;\n\t\tconst buffers = [];\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\terr = z.deflate(Z_FINISH);\n\t\t\tif (err != Z_STREAM_END && err != Z_OK)\n\t\t\t\tthrow new Error(\"deflating: \" + z.msg);\n\t\t\tif (bufsize - z.avail_out > 0)\n\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tz.deflateEnd();\n\t\tarray = new Uint8Array(bufferSize);\n\t\tbuffers.forEach(function (chunk) {\n\t\t\tarray.set(chunk, bufferIndex);\n\t\t\tbufferIndex += chunk.length;\n\t\t});\n\t\treturn array;\n\t};\n}\n\nfunction getMaximumCompressedSize(uncompressedSize) {\n\treturn uncompressedSize + (5 * (Math.floor(uncompressedSize / 16383) + 1));\n}\n\nexport default ZipDeflate;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc.\n * JZlib is based on zlib-1.1.3, so all credit should go authors\n * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)\n * and contributors of zlib.\n */\n\n// deno-lint-ignore-file no-this-alias prefer-const\n\n// Global\nconst MAX_BITS = 15;\n\nconst Z_OK = 0;\nconst Z_STREAM_END = 1;\nconst Z_NEED_DICT = 2;\nconst Z_STREAM_ERROR = -2;\nconst Z_DATA_ERROR = -3;\nconst Z_MEM_ERROR = -4;\nconst Z_BUF_ERROR = -5;\n\nconst inflate_mask = [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff,\n\t0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff];\n\nconst MANY = 1440;\n\n// JZlib version : \"1.0.2\"\nconst Z_NO_FLUSH = 0;\nconst Z_FINISH = 4;\n\n// InfTree\nconst fixed_bl = 9;\nconst fixed_bd = 5;\n\nconst fixed_tl = [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,\n\t0, 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,\n\t0, 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,\n\t0, 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,\n\t0, 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,\n\t35, 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,\n\t26, 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,\n\t7, 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,\n\t8, 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,\n\t8, 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,\n\t0, 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,\n\t81, 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,\n\t0, 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,\n\t84, 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,\n\t0, 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,\n\t80, 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,\n\t0, 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,\n\t0, 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,\n\t0, 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,\n\t193, 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,\n\t120, 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,\n\t227, 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,\n\t92, 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,\n\t249, 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,\n\t130, 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,\n\t181, 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,\n\t102, 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,\n\t221, 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,\n\t8, 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,\n\t147, 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,\n\t85, 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,\n\t235, 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,\n\t141, 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,\n\t167, 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,\n\t107, 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,\n\t207, 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,\n\t127, 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];\nconst fixed_td = [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,\n\t8193, 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,\n\t24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577];\n\n// Tables for deflate from PKZIP's appnote.txt.\nconst cplens = [ // Copy lengths for literal codes 257..285\n\t3, 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];\n\n// see note #13 above about 258\nconst cplext = [ // Extra bits for literal codes 257..285\n\t0, 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 // 112==invalid\n];\n\nconst cpdist = [ // Copy offsets for distance codes 0..29\n\t1, 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];\n\nconst cpdext = [ // Extra bits for distance codes\n\t0, 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];\n\n// If BMAX needs to be larger than 16, then h and x[] should be uLong.\nconst BMAX = 15; // maximum bit length of any code\n\nfunction InfTree() {\n\tconst that = this;\n\n\tlet hn; // hufts used in space\n\tlet v; // work area for huft_build\n\tlet c; // bit length count table\n\tlet r; // table entry for structure assignment\n\tlet u; // table stack\n\tlet x; // bit offsets, then code stack\n\n\tfunction huft_build(b, // code lengths in bits (all assumed <=\n\t\t// BMAX)\n\t\tbindex, n, // number of codes (assumed <= 288)\n\t\ts, // number of simple-valued codes (0..s-1)\n\t\td, // list of base values for non-simple codes\n\t\te, // list of extra bits for non-simple codes\n\t\tt, // result: starting table\n\t\tm, // maximum lookup bits, returns actual\n\t\thp,// space for trees\n\t\thn,// hufts used in space\n\t\tv // working area: values in order of bit length\n\t) {\n\t\t// Given a list of code lengths and a maximum table size, make a set of\n\t\t// tables to decode that set of codes. Return Z_OK on success,\n\t\t// Z_BUF_ERROR\n\t\t// if the given code set is incomplete (the tables are still built in\n\t\t// this\n\t\t// case), Z_DATA_ERROR if the input is invalid (an over-subscribed set\n\t\t// of\n\t\t// lengths), or Z_MEM_ERROR if not enough memory.\n\n\t\tlet a; // counter for codes of length k\n\t\tlet f; // i repeats in table every f entries\n\t\tlet g; // maximum code length\n\t\tlet h; // table level\n\t\tlet i; // counter, current code\n\t\tlet j; // counter\n\t\tlet k; // number of bits in current code\n\t\tlet l; // bits per table (returned in m)\n\t\tlet mask; // (1 << w) - 1, to avoid cc -O bug on HP\n\t\tlet p; // pointer into c[], b[], or v[]\n\t\tlet q; // points to current table\n\t\tlet w; // bits before this table == (l * h)\n\t\tlet xp; // pointer into x\n\t\tlet y; // number of dummy codes added\n\t\tlet z; // number of entries in current table\n\n\t\t// Generate counts for each bit length\n\n\t\tp = 0;\n\t\ti = n;\n\t\tdo {\n\t\t\tc[b[bindex + p]]++;\n\t\t\tp++;\n\t\t\ti--; // assume all entries <= BMAX\n\t\t} while (i !== 0);\n\n\t\tif (c[0] == n) { // null input--all zero length codes\n\t\t\tt[0] = -1;\n\t\t\tm[0] = 0;\n\t\t\treturn Z_OK;\n\t\t}\n\n\t\t// Find minimum and maximum length, bound *m by those\n\t\tl = m[0];\n\t\tfor (j = 1; j <= BMAX; j++)\n\t\t\tif (c[j] !== 0)\n\t\t\t\tbreak;\n\t\tk = j; // minimum code length\n\t\tif (l < j) {\n\t\t\tl = j;\n\t\t}\n\t\tfor (i = BMAX; i !== 0; i--) {\n\t\t\tif (c[i] !== 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tg = i; // maximum code length\n\t\tif (l > i) {\n\t\t\tl = i;\n\t\t}\n\t\tm[0] = l;\n\n\t\t// Adjust last length count to fill out codes, if needed\n\t\tfor (y = 1 << j; j < i; j++, y <<= 1) {\n\t\t\tif ((y -= c[j]) < 0) {\n\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t}\n\t\t}\n\t\tif ((y -= c[i]) < 0) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tc[i] += y;\n\n\t\t// Generate starting offsets into the value table for each length\n\t\tx[1] = j = 0;\n\t\tp = 1;\n\t\txp = 2;\n\t\twhile (--i !== 0) { // note that i == g from above\n\t\t\tx[xp] = (j += c[p]);\n\t\t\txp++;\n\t\t\tp++;\n\t\t}\n\n\t\t// Make a table of values in order of bit lengths\n\t\ti = 0;\n\t\tp = 0;\n\t\tdo {\n\t\t\tif ((j = b[bindex + p]) !== 0) {\n\t\t\t\tv[x[j]++] = i;\n\t\t\t}\n\t\t\tp++;\n\t\t} while (++i < n);\n\t\tn = x[g]; // set n to length of v\n\n\t\t// Generate the Huffman codes and for each, make the table entries\n\t\tx[0] = i = 0; // first Huffman code is zero\n\t\tp = 0; // grab values in bit order\n\t\th = -1; // no tables yet--level -1\n\t\tw = -l; // bits decoded == (l * h)\n\t\tu[0] = 0; // just to keep compilers happy\n\t\tq = 0; // ditto\n\t\tz = 0; // ditto\n\n\t\t// go through the bit lengths (k already is bits in shortest code)\n\t\tfor (; k <= g; k++) {\n\t\t\ta = c[k];\n\t\t\twhile (a-- !== 0) {\n\t\t\t\t// here i is the Huffman code of length k bits for value *p\n\t\t\t\t// make tables up to required level\n\t\t\t\twhile (k > w + l) {\n\t\t\t\t\th++;\n\t\t\t\t\tw += l; // previous table always l bits\n\t\t\t\t\t// compute minimum size table less than or equal to l bits\n\t\t\t\t\tz = g - w;\n\t\t\t\t\tz = (z > l) ? l : z; // table size upper limit\n\t\t\t\t\tif ((f = 1 << (j = k - w)) > a + 1) { // try a k-w bit table\n\t\t\t\t\t\t// too few codes for\n\t\t\t\t\t\t// k-w bit table\n\t\t\t\t\t\tf -= a + 1; // deduct codes from patterns left\n\t\t\t\t\t\txp = k;\n\t\t\t\t\t\tif (j < z) {\n\t\t\t\t\t\t\twhile (++j < z) { // try smaller tables up to z bits\n\t\t\t\t\t\t\t\tif ((f <<= 1) <= c[++xp])\n\t\t\t\t\t\t\t\t\tbreak; // enough codes to use up j bits\n\t\t\t\t\t\t\t\tf -= c[xp]; // else deduct codes from patterns\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tz = 1 << j; // table entries for j-bit table\n\n\t\t\t\t\t// allocate new table\n\t\t\t\t\tif (hn[0] + z > MANY) { // (note: doesn't matter for fixed)\n\t\t\t\t\t\treturn Z_DATA_ERROR; // overflow of MANY\n\t\t\t\t\t}\n\t\t\t\t\tu[h] = q = /* hp+ */hn[0]; // DEBUG\n\t\t\t\t\thn[0] += z;\n\n\t\t\t\t\t// connect to last table, if there is one\n\t\t\t\t\tif (h !== 0) {\n\t\t\t\t\t\tx[h] = i; // save pattern for backing up\n\t\t\t\t\t\tr[0] = /* (byte) */j; // bits in this table\n\t\t\t\t\t\tr[1] = /* (byte) */l; // bits to dump before this table\n\t\t\t\t\t\tj = i >>> (w - l);\n\t\t\t\t\t\tr[2] = /* (int) */(q - u[h - 1] - j); // offset to this table\n\t\t\t\t\t\thp.set(r, (u[h - 1] + j) * 3);\n\t\t\t\t\t\t// to\n\t\t\t\t\t\t// last\n\t\t\t\t\t\t// table\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt[0] = q; // first table is returned result\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set up table entry in r\n\t\t\t\tr[1] = /* (byte) */(k - w);\n\t\t\t\tif (p >= n) {\n\t\t\t\t\tr[0] = 128 + 64; // out of values--invalid code\n\t\t\t\t} else if (v[p] < s) {\n\t\t\t\t\tr[0] = /* (byte) */(v[p] < 256 ? 0 : 32 + 64); // 256 is\n\t\t\t\t\t// end-of-block\n\t\t\t\t\tr[2] = v[p++]; // simple code is just the value\n\t\t\t\t} else {\n\t\t\t\t\tr[0] = /* (byte) */(e[v[p] - s] + 16 + 64); // non-simple--look\n\t\t\t\t\t// up in lists\n\t\t\t\t\tr[2] = d[v[p++] - s];\n\t\t\t\t}\n\n\t\t\t\t// fill code-like entries with r\n\t\t\t\tf = 1 << (k - w);\n\t\t\t\tfor (j = i >>> w; j < z; j += f) {\n\t\t\t\t\thp.set(r, (q + j) * 3);\n\t\t\t\t}\n\n\t\t\t\t// backwards increment the k-bit code i\n\t\t\t\tfor (j = 1 << (k - 1); (i & j) !== 0; j >>>= 1) {\n\t\t\t\t\ti ^= j;\n\t\t\t\t}\n\t\t\t\ti ^= j;\n\n\t\t\t\t// backup over finished tables\n\t\t\t\tmask = (1 << w) - 1; // needed on HP, cc -O bug\n\t\t\t\twhile ((i & mask) != x[h]) {\n\t\t\t\t\th--; // don't need to update q\n\t\t\t\t\tw -= l;\n\t\t\t\t\tmask = (1 << w) - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return Z_BUF_ERROR if we were given an incomplete table\n\t\treturn y !== 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n\t}\n\n\tfunction initWorkArea(vsize) {\n\t\tlet i;\n\t\tif (!hn) {\n\t\t\thn = []; // []; //new Array(1);\n\t\t\tv = []; // new Array(vsize);\n\t\t\tc = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t\tr = []; // new Array(3);\n\t\t\tu = new Int32Array(BMAX); // new Array(BMAX);\n\t\t\tx = new Int32Array(BMAX + 1); // new Array(BMAX + 1);\n\t\t}\n\t\tif (v.length < vsize) {\n\t\t\tv = []; // new Array(vsize);\n\t\t}\n\t\tfor (i = 0; i < vsize; i++) {\n\t\t\tv[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < BMAX + 1; i++) {\n\t\t\tc[i] = 0;\n\t\t}\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tr[i] = 0;\n\t\t}\n\t\t// for(int i=0; i<BMAX; i++){u[i]=0;}\n\t\tu.set(c.subarray(0, BMAX), 0);\n\t\t// for(int i=0; i<BMAX+1; i++){x[i]=0;}\n\t\tx.set(c.subarray(0, BMAX + 1), 0);\n\t}\n\n\tthat.inflate_trees_bits = function (c, // 19 code lengths\n\t\tbb, // bits tree desired/actual depth\n\t\ttb, // bits tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\t\tinitWorkArea(19);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v);\n\n\t\tif (result == Z_DATA_ERROR) {\n\t\t\tz.msg = \"oversubscribed dynamic bit lengths tree\";\n\t\t} else if (result == Z_BUF_ERROR || bb[0] === 0) {\n\t\t\tz.msg = \"incomplete dynamic bit lengths tree\";\n\t\t\tresult = Z_DATA_ERROR;\n\t\t}\n\t\treturn result;\n\t};\n\n\tthat.inflate_trees_dynamic = function (nl, // number of literal/length codes\n\t\tnd, // number of distance codes\n\t\tc, // that many (total) code lengths\n\t\tbl, // literal desired/actual bit depth\n\t\tbd, // distance desired/actual bit depth\n\t\ttl, // literal/length tree result\n\t\ttd, // distance tree result\n\t\thp, // space for trees\n\t\tz // for messages\n\t) {\n\t\tlet result;\n\n\t\t// build literal/length tree\n\t\tinitWorkArea(288);\n\t\thn[0] = 0;\n\t\tresult = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v);\n\t\tif (result != Z_OK || bl[0] === 0) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed literal/length tree\";\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"incomplete literal/length tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t// build distance tree\n\t\tinitWorkArea(288);\n\t\tresult = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v);\n\n\t\tif (result != Z_OK || (bd[0] === 0 && nl > 257)) {\n\t\t\tif (result == Z_DATA_ERROR) {\n\t\t\t\tz.msg = \"oversubscribed distance tree\";\n\t\t\t} else if (result == Z_BUF_ERROR) {\n\t\t\t\tz.msg = \"incomplete distance tree\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t} else if (result != Z_MEM_ERROR) {\n\t\t\t\tz.msg = \"empty distance tree with lengths\";\n\t\t\t\tresult = Z_DATA_ERROR;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\treturn Z_OK;\n\t};\n\n}\n\nInfTree.inflate_trees_fixed = function (bl, // literal desired/actual bit depth\n\tbd, // distance desired/actual bit depth\n\ttl,// literal/length tree result\n\ttd// distance tree result\n) {\n\tbl[0] = fixed_bl;\n\tbd[0] = fixed_bd;\n\ttl[0] = fixed_tl;\n\ttd[0] = fixed_td;\n\treturn Z_OK;\n};\n\n// InfCodes\n\n// waiting for \"i:\"=input,\n// \"o:\"=output,\n// \"x:\"=nothing\nconst START = 0; // x: set up for LEN\nconst LEN = 1; // i: get length/literal/eob next\nconst LENEXT = 2; // i: getting length extra (have base)\nconst DIST = 3; // i: get distance next\nconst DISTEXT = 4;// i: getting distance extra\nconst COPY = 5; // o: copying bytes in win, waiting\n// for space\nconst LIT = 6; // o: got literal, waiting for output\n// space\nconst WASH = 7; // o: got eob, possibly still output\n// waiting\nconst END = 8; // x: got eob and all data flushed\nconst BADCODE = 9;// x: got error\n\nfunction InfCodes() {\n\tconst that = this;\n\n\tlet mode; // current inflate_codes mode\n\n\t// mode dependent information\n\tlet len = 0;\n\n\tlet tree; // pointer into tree\n\tlet tree_index = 0;\n\tlet need = 0; // bits needed\n\n\tlet lit = 0;\n\n\t// if EXT or COPY, where and how much\n\tlet get = 0; // bits to get for extra\n\tlet dist = 0; // distance back to copy from\n\n\tlet lbits = 0; // ltree bits decoded per branch\n\tlet dbits = 0; // dtree bits decoder per branch\n\tlet ltree; // literal/length/eob tree\n\tlet ltree_index = 0; // literal/length/eob tree\n\tlet dtree; // distance tree\n\tlet dtree_index = 0; // distance tree\n\n\t// Called with number of bytes left to write in win at least 258\n\t// (the maximum string length) and number of input bytes available\n\t// at least ten. The ten bytes are six bytes for the longest length/\n\t// distance pair plus four bytes for overloading the bit buffer.\n\n\tfunction inflate_fast(bl, bd, tl, tl_index, td, td_index, s, z) {\n\t\tlet t; // temporary pointer\n\t\tlet tp; // temporary pointer\n\t\tlet tp_index; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet ml; // mask for literal/length tree\n\t\tlet md; // mask for distance tree\n\t\tlet c; // bytes to copy\n\t\tlet d; // distance back to copy from\n\t\tlet r; // copy source pointer\n\n\t\tlet tp_index_t_3; // (tp_index+t)*3\n\n\t\t// load input, output, bit values\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// initialize masks\n\t\tml = inflate_mask[bl];\n\t\tmd = inflate_mask[bd];\n\n\t\t// do until not enough input or output space for fast loop\n\t\tdo { // assume called with m >= 258 && n >= 10\n\t\t\t// get literal/length code\n\t\t\twhile (k < (20)) { // max bits for literal/length code\n\t\t\t\tn--;\n\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\tk += 8;\n\t\t\t}\n\n\t\t\tt = b & ml;\n\t\t\ttp = tl;\n\t\t\ttp_index = tl_index;\n\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\tm--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdo {\n\n\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\te &= 15;\n\t\t\t\t\tc = tp[tp_index_t_3 + 2] + (/* (int) */b & inflate_mask[e]);\n\n\t\t\t\t\tb >>= e;\n\t\t\t\t\tk -= e;\n\n\t\t\t\t\t// decode distance base of block to copy\n\t\t\t\t\twhile (k < (15)) { // max bits for distance code\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tt = b & md;\n\t\t\t\t\ttp = td;\n\t\t\t\t\ttp_index = td_index;\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\te = tp[tp_index_t_3];\n\n\t\t\t\t\tdo {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\tif ((e & 16) !== 0) {\n\t\t\t\t\t\t\t// get extra bits to add to distance base\n\t\t\t\t\t\t\te &= 15;\n\t\t\t\t\t\t\twhile (k < (e)) { // get extra bits (up to 13)\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\td = tp[tp_index_t_3 + 2] + (b & inflate_mask[e]);\n\n\t\t\t\t\t\t\tb >>= (e);\n\t\t\t\t\t\t\tk -= (e);\n\n\t\t\t\t\t\t\t// do the copy\n\t\t\t\t\t\t\tm -= c;\n\t\t\t\t\t\t\tif (q >= d) { // offset before dest\n\t\t\t\t\t\t\t\t// just copy\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tif (q - r > 0 && 2 > (q - r)) {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // minimum\n\t\t\t\t\t\t\t\t\t// count is\n\t\t\t\t\t\t\t\t\t// three,\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++]; // so unroll\n\t\t\t\t\t\t\t\t\t// loop a\n\t\t\t\t\t\t\t\t\t// little\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + 2), q);\n\t\t\t\t\t\t\t\t\tq += 2;\n\t\t\t\t\t\t\t\t\tr += 2;\n\t\t\t\t\t\t\t\t\tc -= 2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else { // else offset after destination\n\t\t\t\t\t\t\t\tr = q - d;\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\tr += s.end; // force pointer in win\n\t\t\t\t\t\t\t\t} while (r < 0); // covers invalid distances\n\t\t\t\t\t\t\t\te = s.end - r;\n\t\t\t\t\t\t\t\tif (c > e) { // if source crosses,\n\t\t\t\t\t\t\t\t\tc -= e; // wrapped copy\n\t\t\t\t\t\t\t\t\tif (q - r > 0 && e > (q - r)) {\n\t\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t\t\t} while (--e !== 0);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + e), q);\n\t\t\t\t\t\t\t\t\t\tq += e;\n\t\t\t\t\t\t\t\t\t\tr += e;\n\t\t\t\t\t\t\t\t\t\te = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tr = 0; // copy rest from start of win\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// copy all or what's left\n\t\t\t\t\t\t\tif (q - r > 0 && c > (q - r)) {\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\ts.win[q++] = s.win[r++];\n\t\t\t\t\t\t\t\t} while (--c !== 0);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts.win.set(s.win.subarray(r, r + c), q);\n\t\t\t\t\t\t\t\tq += c;\n\t\t\t\t\t\t\t\tr += c;\n\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ((e & 64) === 0) {\n\t\t\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\t\t\te = tp[tp_index_t_3];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tz.msg = \"invalid distance code\";\n\n\t\t\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\t\t\tn += c;\n\t\t\t\t\t\t\tp -= c;\n\t\t\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\n\t\t\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t\t\t} while (true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ((e & 64) === 0) {\n\t\t\t\t\tt += tp[tp_index_t_3 + 2];\n\t\t\t\t\tt += (b & inflate_mask[e]);\n\t\t\t\t\ttp_index_t_3 = (tp_index + t) * 3;\n\t\t\t\t\tif ((e = tp[tp_index_t_3]) === 0) {\n\n\t\t\t\t\t\tb >>= (tp[tp_index_t_3 + 1]);\n\t\t\t\t\t\tk -= (tp[tp_index_t_3 + 1]);\n\n\t\t\t\t\t\ts.win[q++] = /* (byte) */tp[tp_index_t_3 + 2];\n\t\t\t\t\t\tm--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if ((e & 32) !== 0) {\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\t} else {\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\n\t\t\t\t\tc = z.avail_in - n;\n\t\t\t\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\t\t\t\tn += c;\n\t\t\t\t\tp -= c;\n\t\t\t\t\tk -= c << 3;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t} while (true);\n\t\t} while (m >= 258 && n >= 10);\n\n\t\t// not enough input or output--restore pointers and return\n\t\tc = z.avail_in - n;\n\t\tc = (k >> 3) < c ? k >> 3 : c;\n\t\tn += c;\n\t\tp -= c;\n\t\tk -= c << 3;\n\n\t\ts.bitb = b;\n\t\ts.bitk = k;\n\t\tz.avail_in = n;\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\ts.write = q;\n\n\t\treturn Z_OK;\n\t}\n\n\tthat.init = function (bl, bd, tl, tl_index, td, td_index) {\n\t\tmode = START;\n\t\tlbits = /* (byte) */bl;\n\t\tdbits = /* (byte) */bd;\n\t\tltree = tl;\n\t\tltree_index = tl_index;\n\t\tdtree = td;\n\t\tdtree_index = td_index;\n\t\ttree = null;\n\t};\n\n\tthat.proc = function (s, z, r) {\n\t\tlet j; // temporary storage\n\t\tlet tindex; // temporary pointer\n\t\tlet e; // extra bits or operation\n\t\tlet b = 0; // bit buffer\n\t\tlet k = 0; // bits in bit buffer\n\t\tlet p = 0; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\t\tlet f; // pointer to copy strings from\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = s.bitb;\n\t\tk = s.bitk;\n\t\tq = s.write;\n\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t// process input and output based on current state\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tswitch (mode) {\n\t\t\t\t// waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing\n\t\t\t\tcase START: // x: set up for LEN\n\t\t\t\t\tif (m >= 258 && n >= 10) {\n\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\tr = inflate_fast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, s, z);\n\n\t\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\t\tb = s.bitb;\n\t\t\t\t\t\tk = s.bitk;\n\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\tif (r != Z_OK) {\n\t\t\t\t\t\t\tmode = r == Z_STREAM_END ? WASH : BADCODE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tneed = lbits;\n\t\t\t\t\ttree = ltree;\n\t\t\t\t\ttree_index = ltree_index;\n\n\t\t\t\t\tmode = LEN;\n\t\t\t\t/* falls through */\n\t\t\t\tcase LEN: // i: get length/literal/eob next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>>= (tree[tindex + 1]);\n\t\t\t\t\tk -= (tree[tindex + 1]);\n\n\t\t\t\t\te = tree[tindex];\n\n\t\t\t\t\tif (e === 0) { // literal\n\t\t\t\t\t\tlit = tree[tindex + 2];\n\t\t\t\t\t\tmode = LIT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 16) !== 0) { // length\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tlen = tree[tindex + 2];\n\t\t\t\t\t\tmode = LENEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 32) !== 0) { // end of block\n\t\t\t\t\t\tmode = WASH;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid literal/length code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase LENEXT: // i: getting length extra (have base)\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tlen += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tneed = dbits;\n\t\t\t\t\ttree = dtree;\n\t\t\t\t\ttree_index = dtree_index;\n\t\t\t\t\tmode = DIST;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DIST: // i: get distance next\n\t\t\t\t\tj = need;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttindex = (tree_index + (b & inflate_mask[j])) * 3;\n\n\t\t\t\t\tb >>= tree[tindex + 1];\n\t\t\t\t\tk -= tree[tindex + 1];\n\n\t\t\t\t\te = (tree[tindex]);\n\t\t\t\t\tif ((e & 16) !== 0) { // distance\n\t\t\t\t\t\tget = e & 15;\n\t\t\t\t\t\tdist = tree[tindex + 2];\n\t\t\t\t\t\tmode = DISTEXT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((e & 64) === 0) { // next table\n\t\t\t\t\t\tneed = e;\n\t\t\t\t\t\ttree_index = tindex / 3 + tree[tindex + 2];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = BADCODE; // invalid code\n\t\t\t\t\tz.msg = \"invalid distance code\";\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase DISTEXT: // i: getting distance extra\n\t\t\t\t\tj = get;\n\n\t\t\t\t\twhile (k < (j)) {\n\t\t\t\t\t\tif (n !== 0)\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tdist += (b & inflate_mask[j]);\n\n\t\t\t\t\tb >>= j;\n\t\t\t\t\tk -= j;\n\n\t\t\t\t\tmode = COPY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase COPY: // o: copying bytes in win, waiting for space\n\t\t\t\t\tf = q - dist;\n\t\t\t\t\twhile (f < 0) { // modulo win size-\"while\" instead\n\t\t\t\t\t\tf += s.end; // of \"if\" handles invalid distances\n\t\t\t\t\t}\n\t\t\t\t\twhile (len !== 0) {\n\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ts.win[q++] = s.win[f++];\n\t\t\t\t\t\tm--;\n\n\t\t\t\t\t\tif (f == s.end)\n\t\t\t\t\t\t\tf = 0;\n\t\t\t\t\t\tlen--;\n\t\t\t\t\t}\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIT: // o: got literal, waiting for output space\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = s.write;\n\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\t\t\tif (q == s.end && s.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\ts.win[q++] = /* (byte) */lit;\n\t\t\t\t\tm--;\n\n\t\t\t\t\tmode = START;\n\t\t\t\t\tbreak;\n\t\t\t\tcase WASH: // o: got eob, possibly more output\n\t\t\t\t\tif (k > 7) { // return unused byte, if any\n\t\t\t\t\t\tk -= 8;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t\tp--; // can always return one\n\t\t\t\t\t}\n\n\t\t\t\t\ts.write = q;\n\t\t\t\t\tr = s.inflate_flush(z, r);\n\t\t\t\t\tq = s.write;\n\t\t\t\t\tm = q < s.read ? s.read - q - 1 : s.end - q;\n\n\t\t\t\t\tif (s.read != s.write) {\n\t\t\t\t\t\ts.bitb = b;\n\t\t\t\t\t\ts.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\ts.write = q;\n\t\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = END;\n\t\t\t\t/* falls through */\n\t\t\t\tcase END:\n\t\t\t\t\tr = Z_STREAM_END;\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tcase BADCODE: // x: got error\n\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\ts.bitb = b;\n\t\t\t\t\ts.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\ts.write = q;\n\t\t\t\t\treturn s.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function () {\n\t\t// ZFREE(z, c);\n\t};\n\n}\n\n// InfBlocks\n\n// Table for deflate from PKZIP's appnote.txt.\nconst border = [ // Order of the bit length code lengths\n\t16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];\n\nconst TYPE = 0; // get type bits (3, including end bit)\nconst LENS = 1; // get lengths for stored\nconst STORED = 2;// processing stored block\nconst TABLE = 3; // get table lengths\nconst BTREE = 4; // get bit lengths tree for a dynamic\n// block\nconst DTREE = 5; // get length, distance trees for a\n// dynamic block\nconst CODES = 6; // processing fixed or dynamic block\nconst DRY = 7; // output remaining win bytes\nconst DONELOCKS = 8; // finished last block, done\nconst BADBLOCKS = 9; // ot a data error--stuck here\n\nfunction InfBlocks(z, w) {\n\tconst that = this;\n\n\tlet mode = TYPE; // current inflate_block mode\n\n\tlet left = 0; // if STORED, bytes left to copy\n\n\tlet table = 0; // table lengths (14 bits)\n\tlet index = 0; // index into blens (or border)\n\tlet blens; // bit lengths of codes\n\tconst bb = [0]; // bit length tree depth\n\tconst tb = [0]; // bit length decoding tree\n\n\tconst codes = new InfCodes(); // if CODES, current state\n\n\tlet last = 0; // true if this block is the last block\n\n\tlet hufts = new Int32Array(MANY * 3); // single malloc for tree space\n\tconst check = 0; // check on output\n\tconst inftree = new InfTree();\n\n\tthat.bitk = 0; // bits in bit buffer\n\tthat.bitb = 0; // bit buffer\n\tthat.win = new Uint8Array(w); // sliding win\n\tthat.end = w; // one byte after sliding win\n\tthat.read = 0; // win read pointer\n\tthat.write = 0; // win write pointer\n\n\tthat.reset = function (z, c) {\n\t\tif (c)\n\t\t\tc[0] = check;\n\t\t// if (mode == BTREE || mode == DTREE) {\n\t\t// }\n\t\tif (mode == CODES) {\n\t\t\tcodes.free(z);\n\t\t}\n\t\tmode = TYPE;\n\t\tthat.bitk = 0;\n\t\tthat.bitb = 0;\n\t\tthat.read = that.write = 0;\n\t};\n\n\tthat.reset(z, null);\n\n\t// copy as much as possible from the sliding win to the output area\n\tthat.inflate_flush = function (z, r) {\n\t\tlet n;\n\t\tlet p;\n\t\tlet q;\n\n\t\t// local copies of source and destination pointers\n\t\tp = z.next_out_index;\n\t\tq = that.read;\n\n\t\t// compute number of bytes to copy as far as end of win\n\t\tn = /* (int) */((q <= that.write ? that.write : that.end) - q);\n\t\tif (n > z.avail_out)\n\t\t\tn = z.avail_out;\n\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\tr = Z_OK;\n\n\t\t// update counters\n\t\tz.avail_out -= n;\n\t\tz.total_out += n;\n\n\t\t// copy as far as end of win\n\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\tp += n;\n\t\tq += n;\n\n\t\t// see if more to copy at beginning of win\n\t\tif (q == that.end) {\n\t\t\t// wrap pointers\n\t\t\tq = 0;\n\t\t\tif (that.write == that.end)\n\t\t\t\tthat.write = 0;\n\n\t\t\t// compute bytes to copy\n\t\t\tn = that.write - q;\n\t\t\tif (n > z.avail_out)\n\t\t\t\tn = z.avail_out;\n\t\t\tif (n !== 0 && r == Z_BUF_ERROR)\n\t\t\t\tr = Z_OK;\n\n\t\t\t// update counters\n\t\t\tz.avail_out -= n;\n\t\t\tz.total_out += n;\n\n\t\t\t// copy\n\t\t\tz.next_out.set(that.win.subarray(q, q + n), p);\n\t\t\tp += n;\n\t\t\tq += n;\n\t\t}\n\n\t\t// update pointers\n\t\tz.next_out_index = p;\n\t\tthat.read = q;\n\n\t\t// done\n\t\treturn r;\n\t};\n\n\tthat.proc = function (z, r) {\n\t\tlet t; // temporary storage\n\t\tlet b; // bit buffer\n\t\tlet k; // bits in bit buffer\n\t\tlet p; // input data pointer\n\t\tlet n; // bytes available there\n\t\tlet q; // output win write pointer\n\t\tlet m; // bytes to end of win or read pointer\n\n\t\tlet i;\n\n\t\t// copy input/output information to locals (UPDATE macro restores)\n\t\t// {\n\t\tp = z.next_in_index;\n\t\tn = z.avail_in;\n\t\tb = that.bitb;\n\t\tk = that.bitk;\n\t\t// }\n\t\t// {\n\t\tq = that.write;\n\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t// }\n\n\t\t// process input based on current state\n\t\t// DEBUG dtree\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tlet bl, bd, tl, td, bl_, bd_, tl_, td_;\n\t\t\tswitch (mode) {\n\t\t\t\tcase TYPE:\n\n\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\t\t\t\t\tt = /* (int) */(b & 7);\n\t\t\t\t\tlast = t & 1;\n\n\t\t\t\t\tswitch (t >>> 1) {\n\t\t\t\t\t\tcase 0: // stored\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tt = k & 7; // go to byte boundary\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = LENS; // get length of stored block\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // fixed\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tbl = []; // new Array(1);\n\t\t\t\t\t\t\tbd = []; // new Array(1);\n\t\t\t\t\t\t\ttl = [[]]; // new Array(1);\n\t\t\t\t\t\t\ttd = [[]]; // new Array(1);\n\n\t\t\t\t\t\t\tInfTree.inflate_trees_fixed(bl, bd, tl, td);\n\t\t\t\t\t\t\tcodes.init(bl[0], bd[0], tl[0], 0, td[0], 0);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = CODES;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // dynamic\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t\tmode = TABLE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3: // illegal\n\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\tz.msg = \"invalid block type\";\n\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LENS:\n\n\t\t\t\t\twhile (k < (32)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"invalid stored block lengths\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tleft = (b & 0xffff);\n\t\t\t\t\tb = k = 0; // dump bits\n\t\t\t\t\tmode = left !== 0 ? STORED : (last !== 0 ? DRY : TYPE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase STORED:\n\t\t\t\t\tif (n === 0) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\t\t\tq = that.write;\n\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\tif (q == that.end && that.read !== 0) {\n\t\t\t\t\t\t\t\tq = 0;\n\t\t\t\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (m === 0) {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\n\t\t\t\t\tt = left;\n\t\t\t\t\tif (t > n)\n\t\t\t\t\t\tt = n;\n\t\t\t\t\tif (t > m)\n\t\t\t\t\t\tt = m;\n\t\t\t\t\tthat.win.set(z.read_buf(p, t), q);\n\t\t\t\t\tp += t;\n\t\t\t\t\tn -= t;\n\t\t\t\t\tq += t;\n\t\t\t\t\tm -= t;\n\t\t\t\t\tif ((left -= t) !== 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tmode = last !== 0 ? DRY : TYPE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TABLE:\n\n\t\t\t\t\twhile (k < (14)) {\n\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tn--;\n\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\tk += 8;\n\t\t\t\t\t}\n\n\t\t\t\t\ttable = t = (b & 0x3fff);\n\t\t\t\t\tif ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {\n\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\tz.msg = \"too many length or distance symbols\";\n\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tt = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n\t\t\t\t\tif (!blens || blens.length < t) {\n\t\t\t\t\t\tblens = []; // new Array(t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (i = 0; i < t; i++) {\n\t\t\t\t\t\t\tblens[i] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// {\n\t\t\t\t\tb >>>= (14);\n\t\t\t\t\tk -= (14);\n\t\t\t\t\t// }\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = BTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase BTREE:\n\t\t\t\t\twhile (index < 4 + (table >>> 10)) {\n\t\t\t\t\t\twhile (k < (3)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tblens[border[index++]] = b & 7;\n\n\t\t\t\t\t\t// {\n\t\t\t\t\t\tb >>>= (3);\n\t\t\t\t\t\tk -= (3);\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (index < 19) {\n\t\t\t\t\t\tblens[border[index++]] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbb[0] = 7;\n\t\t\t\t\tt = inftree.inflate_trees_bits(blens, bb, tb, hufts, z);\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tr = t;\n\t\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tmode = DTREE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DTREE:\n\t\t\t\t\t// eslint-disable-next-line no-constant-condition\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tt = table;\n\t\t\t\t\t\tif (index >= 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet j, c;\n\n\t\t\t\t\t\tt = bb[0];\n\n\t\t\t\t\t\twhile (k < (t)) {\n\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if (tb[0] == -1) {\n\t\t\t\t\t\t// System.err.println(\"null...\");\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\tt = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 1];\n\t\t\t\t\t\tc = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 2];\n\n\t\t\t\t\t\tif (c < 16) {\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\t\t\t\t\t\t\tblens[index++] = c;\n\t\t\t\t\t\t} else { // c == 16..18\n\t\t\t\t\t\t\ti = c == 18 ? 7 : c - 14;\n\t\t\t\t\t\t\tj = c == 18 ? 11 : 3;\n\n\t\t\t\t\t\t\twhile (k < (t + i)) {\n\t\t\t\t\t\t\t\tif (n !== 0) {\n\t\t\t\t\t\t\t\t\tr = Z_OK;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tn--;\n\t\t\t\t\t\t\t\tb |= (z.read_byte(p++) & 0xff) << k;\n\t\t\t\t\t\t\t\tk += 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tb >>>= (t);\n\t\t\t\t\t\t\tk -= (t);\n\n\t\t\t\t\t\t\tj += (b & inflate_mask[i]);\n\n\t\t\t\t\t\t\tb >>>= (i);\n\t\t\t\t\t\t\tk -= (i);\n\n\t\t\t\t\t\t\ti = index;\n\t\t\t\t\t\t\tt = table;\n\t\t\t\t\t\t\tif (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) {\n\t\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t\t\tz.msg = \"invalid bit length repeat\";\n\t\t\t\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tc = c == 16 ? blens[i - 1] : 0;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tblens[i++] = c;\n\t\t\t\t\t\t\t} while (--j !== 0);\n\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttb[0] = -1;\n\t\t\t\t\t// {\n\t\t\t\t\tbl_ = []; // new Array(1);\n\t\t\t\t\tbd_ = []; // new Array(1);\n\t\t\t\t\ttl_ = []; // new Array(1);\n\t\t\t\t\ttd_ = []; // new Array(1);\n\t\t\t\t\tbl_[0] = 9; // must be <= 9 for lookahead assumptions\n\t\t\t\t\tbd_[0] = 6; // must be <= 9 for lookahead assumptions\n\n\t\t\t\t\tt = table;\n\t\t\t\t\tt = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl_, bd_, tl_, td_, hufts, z);\n\n\t\t\t\t\tif (t != Z_OK) {\n\t\t\t\t\t\tif (t == Z_DATA_ERROR) {\n\t\t\t\t\t\t\tblens = null;\n\t\t\t\t\t\t\tmode = BADBLOCKS;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tr = t;\n\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tcodes.init(bl_[0], bd_[0], hufts, tl_[0], hufts, td_[0]);\n\t\t\t\t\t// }\n\t\t\t\t\tmode = CODES;\n\t\t\t\t/* falls through */\n\t\t\t\tcase CODES:\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\n\t\t\t\t\tif ((r = codes.proc(that, z, r)) != Z_STREAM_END) {\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tr = Z_OK;\n\t\t\t\t\tcodes.free(z);\n\n\t\t\t\t\tp = z.next_in_index;\n\t\t\t\t\tn = z.avail_in;\n\t\t\t\t\tb = that.bitb;\n\t\t\t\t\tk = that.bitk;\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\n\t\t\t\t\tif (last === 0) {\n\t\t\t\t\t\tmode = TYPE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tmode = DRY;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DRY:\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\tr = that.inflate_flush(z, r);\n\t\t\t\t\tq = that.write;\n\t\t\t\t\tm = /* (int) */(q < that.read ? that.read - q - 1 : that.end - q);\n\t\t\t\t\tif (that.read != that.write) {\n\t\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\t\tthat.write = q;\n\t\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\t\t}\n\t\t\t\t\tmode = DONELOCKS;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONELOCKS:\n\t\t\t\t\tr = Z_STREAM_END;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t\tcase BADBLOCKS:\n\t\t\t\t\tr = Z_DATA_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\n\t\t\t\tdefault:\n\t\t\t\t\tr = Z_STREAM_ERROR;\n\n\t\t\t\t\tthat.bitb = b;\n\t\t\t\t\tthat.bitk = k;\n\t\t\t\t\tz.avail_in = n;\n\t\t\t\t\tz.total_in += p - z.next_in_index;\n\t\t\t\t\tz.next_in_index = p;\n\t\t\t\t\tthat.write = q;\n\t\t\t\t\treturn that.inflate_flush(z, r);\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.free = function (z) {\n\t\tthat.reset(z, null);\n\t\tthat.win = null;\n\t\thufts = null;\n\t\t// ZFREE(z, s);\n\t};\n\n\tthat.set_dictionary = function (d, start, n) {\n\t\tthat.win.set(d.subarray(start, start + n), 0);\n\t\tthat.read = that.write = n;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH.\n\tthat.sync_point = function () {\n\t\treturn mode == LENS ? 1 : 0;\n\t};\n\n}\n\n// Inflate\n\n// preset dictionary flag in zlib header\nconst PRESET_DICT = 0x20;\n\nconst Z_DEFLATED = 8;\n\nconst METHOD = 0; // waiting for method byte\nconst FLAG = 1; // waiting for flag byte\nconst DICT4 = 2; // four dictionary check bytes to go\nconst DICT3 = 3; // three dictionary check bytes to go\nconst DICT2 = 4; // two dictionary check bytes to go\nconst DICT1 = 5; // one dictionary check byte to go\nconst DICT0 = 6; // waiting for inflateSetDictionary\nconst BLOCKS = 7; // decompressing blocks\nconst DONE = 12; // finished check, done\nconst BAD = 13; // got an error--stay here\n\nconst mark = [0, 0, 0xff, 0xff];\n\nfunction Inflate() {\n\tconst that = this;\n\n\tthat.mode = 0; // current inflate mode\n\n\t// mode dependent information\n\tthat.method = 0; // if FLAGS, method byte\n\n\t// if CHECK, check values to compare\n\tthat.was = [0]; // new Array(1); // computed check value\n\tthat.need = 0; // stream check value\n\n\t// if BAD, inflateSync's marker bytes count\n\tthat.marker = 0;\n\n\t// mode independent information\n\tthat.wbits = 0; // log2(win size) (8..15, defaults to 15)\n\n\t// this.blocks; // current inflate_blocks state\n\n\tfunction inflateReset(z) {\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\n\t\tz.total_in = z.total_out = 0;\n\t\tz.msg = null;\n\t\tz.istate.mode = BLOCKS;\n\t\tz.istate.blocks.reset(z, null);\n\t\treturn Z_OK;\n\t}\n\n\tthat.inflateEnd = function (z) {\n\t\tif (that.blocks)\n\t\t\tthat.blocks.free(z);\n\t\tthat.blocks = null;\n\t\t// ZFREE(z, z->state);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateInit = function (z, w) {\n\t\tz.msg = null;\n\t\tthat.blocks = null;\n\n\t\t// set win size\n\t\tif (w < 8 || w > 15) {\n\t\t\tthat.inflateEnd(z);\n\t\t\treturn Z_STREAM_ERROR;\n\t\t}\n\t\tthat.wbits = w;\n\n\t\tz.istate.blocks = new InfBlocks(z, 1 << w);\n\n\t\t// reset state\n\t\tinflateReset(z);\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflate = function (z, f) {\n\t\tlet r;\n\t\tlet b;\n\n\t\tif (!z || !z.istate || !z.next_in)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tf = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;\n\t\tr = Z_BUF_ERROR;\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tswitch (istate.mode) {\n\t\t\t\tcase METHOD:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tif (((istate.method = z.read_byte(z.next_in_index++)) & 0xf) != Z_DEFLATED) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"unknown compression method\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ((istate.method >> 4) + 8 > istate.wbits) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"invalid win size\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = FLAG;\n\t\t\t\t/* falls through */\n\t\t\t\tcase FLAG:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tb = (z.read_byte(z.next_in_index++)) & 0xff;\n\n\t\t\t\t\tif ((((istate.method << 8) + b) % 31) !== 0) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tz.msg = \"incorrect header check\";\n\t\t\t\t\t\tistate.marker = 5; // can't try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b & PRESET_DICT) === 0) {\n\t\t\t\t\t\tistate.mode = BLOCKS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tistate.mode = DICT4;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT4:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need = ((z.read_byte(z.next_in_index++) & 0xff) << 24) & 0xff000000;\n\t\t\t\t\tistate.mode = DICT3;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT3:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 16) & 0xff0000;\n\t\t\t\t\tistate.mode = DICT2;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT2:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += ((z.read_byte(z.next_in_index++) & 0xff) << 8) & 0xff00;\n\t\t\t\t\tistate.mode = DICT1;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DICT1:\n\n\t\t\t\t\tif (z.avail_in === 0)\n\t\t\t\t\t\treturn r;\n\t\t\t\t\tr = f;\n\n\t\t\t\t\tz.avail_in--;\n\t\t\t\t\tz.total_in++;\n\t\t\t\t\tistate.need += (z.read_byte(z.next_in_index++) & 0xff);\n\t\t\t\t\tistate.mode = DICT0;\n\t\t\t\t\treturn Z_NEED_DICT;\n\t\t\t\tcase DICT0:\n\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\tz.msg = \"need dictionary\";\n\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t\tcase BLOCKS:\n\n\t\t\t\t\tr = istate.blocks.proc(z, r);\n\t\t\t\t\tif (r == Z_DATA_ERROR) {\n\t\t\t\t\t\tistate.mode = BAD;\n\t\t\t\t\t\tistate.marker = 0; // can try inflateSync\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (r == Z_OK) {\n\t\t\t\t\t\tr = f;\n\t\t\t\t\t}\n\t\t\t\t\tif (r != Z_STREAM_END) {\n\t\t\t\t\t\treturn r;\n\t\t\t\t\t}\n\t\t\t\t\tr = f;\n\t\t\t\t\tistate.blocks.reset(z, istate.was);\n\t\t\t\t\tistate.mode = DONE;\n\t\t\t\t/* falls through */\n\t\t\t\tcase DONE:\n\t\t\t\t\tz.avail_in = 0;\n\t\t\t\t\treturn Z_STREAM_END;\n\t\t\t\tcase BAD:\n\t\t\t\t\treturn Z_DATA_ERROR;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Z_STREAM_ERROR;\n\t\t\t}\n\t\t}\n\t};\n\n\tthat.inflateSetDictionary = function (z, dictionary, dictLength) {\n\t\tlet index = 0, length = dictLength;\n\t\tif (!z || !z.istate || z.istate.mode != DICT0)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (length >= (1 << istate.wbits)) {\n\t\t\tlength = (1 << istate.wbits) - 1;\n\t\t\tindex = dictLength - length;\n\t\t}\n\t\tistate.blocks.set_dictionary(dictionary, index, length);\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\tthat.inflateSync = function (z) {\n\t\tlet n; // number of bytes to look at\n\t\tlet p; // pointer to bytes\n\t\tlet m; // number of marker bytes found in a row\n\t\tlet r, w; // temporaries to save total_in and total_out\n\n\t\t// set up\n\t\tif (!z || !z.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst istate = z.istate;\n\t\tif (istate.mode != BAD) {\n\t\t\tistate.mode = BAD;\n\t\t\tistate.marker = 0;\n\t\t}\n\t\tif ((n = z.avail_in) === 0)\n\t\t\treturn Z_BUF_ERROR;\n\t\tp = z.next_in_index;\n\t\tm = istate.marker;\n\n\t\t// search\n\t\twhile (n !== 0 && m < 4) {\n\t\t\tif (z.read_byte(p) == mark[m]) {\n\t\t\t\tm++;\n\t\t\t} else if (z.read_byte(p) !== 0) {\n\t\t\t\tm = 0;\n\t\t\t} else {\n\t\t\t\tm = 4 - m;\n\t\t\t}\n\t\t\tp++;\n\t\t\tn--;\n\t\t}\n\n\t\t// restore\n\t\tz.total_in += p - z.next_in_index;\n\t\tz.next_in_index = p;\n\t\tz.avail_in = n;\n\t\tistate.marker = m;\n\n\t\t// return no joy or set up to restart on a new block\n\t\tif (m != 4) {\n\t\t\treturn Z_DATA_ERROR;\n\t\t}\n\t\tr = z.total_in;\n\t\tw = z.total_out;\n\t\tinflateReset(z);\n\t\tz.total_in = r;\n\t\tz.total_out = w;\n\t\tistate.mode = BLOCKS;\n\t\treturn Z_OK;\n\t};\n\n\t// Returns true if inflate is currently at the end of a block generated\n\t// by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP\n\t// implementation to provide an additional safety check. PPP uses\n\t// Z_SYNC_FLUSH\n\t// but removes the length bytes of the resulting empty stored block. When\n\t// decompressing, PPP checks that at the end of input packet, inflate is\n\t// waiting for these length bytes.\n\tthat.inflateSyncPoint = function (z) {\n\t\tif (!z || !z.istate || !z.istate.blocks)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn z.istate.blocks.sync_point();\n\t};\n}\n\n// ZStream\n\nfunction ZStream() {\n}\n\nZStream.prototype = {\n\tinflateInit: function (bits) {\n\t\tconst that = this;\n\t\tthat.istate = new Inflate();\n\t\tif (!bits)\n\t\t\tbits = MAX_BITS;\n\t\treturn that.istate.inflateInit(that, bits);\n\t},\n\n\tinflate: function (f) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflate(that, f);\n\t},\n\n\tinflateEnd: function () {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\tconst ret = that.istate.inflateEnd(that);\n\t\tthat.istate = null;\n\t\treturn ret;\n\t},\n\n\tinflateSync: function () {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSync(that);\n\t},\n\tinflateSetDictionary: function (dictionary, dictLength) {\n\t\tconst that = this;\n\t\tif (!that.istate)\n\t\t\treturn Z_STREAM_ERROR;\n\t\treturn that.istate.inflateSetDictionary(that, dictionary, dictLength);\n\t},\n\tread_byte: function (start) {\n\t\tconst that = this;\n\t\treturn that.next_in[start];\n\t},\n\tread_buf: function (start, size) {\n\t\tconst that = this;\n\t\treturn that.next_in.subarray(start, start + size);\n\t}\n};\n\n// Inflater\n\nfunction ZipInflate(options) {\n\tconst that = this;\n\tconst z = new ZStream();\n\tconst bufsize = options && options.chunkSize ? Math.floor(options.chunkSize * 2) : 128 * 1024;\n\tconst flush = Z_NO_FLUSH;\n\tconst buf = new Uint8Array(bufsize);\n\tlet nomoreinput = false;\n\n\tz.inflateInit();\n\tz.next_out = buf;\n\n\tthat.append = function (data, onprogress) {\n\t\tconst buffers = [];\n\t\tlet err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;\n\t\tif (data.length === 0)\n\t\t\treturn;\n\t\tz.next_in_index = 0;\n\t\tz.next_in = data;\n\t\tz.avail_in = data.length;\n\t\tdo {\n\t\t\tz.next_out_index = 0;\n\t\t\tz.avail_out = bufsize;\n\t\t\tif ((z.avail_in === 0) && (!nomoreinput)) { // if buffer is empty and more input is available, refill it\n\t\t\t\tz.next_in_index = 0;\n\t\t\t\tnomoreinput = true;\n\t\t\t}\n\t\t\terr = z.inflate(flush);\n\t\t\tif (nomoreinput && (err === Z_BUF_ERROR)) {\n\t\t\t\tif (z.avail_in !== 0)\n\t\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\t} else if (err !== Z_OK && err !== Z_STREAM_END)\n\t\t\t\tthrow new Error(\"inflating: \" + z.msg);\n\t\t\tif ((nomoreinput || err === Z_STREAM_END) && (z.avail_in === data.length))\n\t\t\t\tthrow new Error(\"inflating: bad input\");\n\t\t\tif (z.next_out_index)\n\t\t\t\tif (z.next_out_index === bufsize)\n\t\t\t\t\tbuffers.push(new Uint8Array(buf));\n\t\t\t\telse\n\t\t\t\t\tbuffers.push(buf.slice(0, z.next_out_index));\n\t\t\tbufferSize += z.next_out_index;\n\t\t\tif (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {\n\t\t\t\tonprogress(z.next_in_index);\n\t\t\t\tlastIndex = z.next_in_index;\n\t\t\t}\n\t\t} while (z.avail_in > 0 || z.avail_out === 0);\n\t\tif (buffers.length > 1) {\n\t\t\tarray = new Uint8Array(bufferSize);\n\t\t\tbuffers.forEach(function (chunk) {\n\t\t\t\tarray.set(chunk, bufferIndex);\n\t\t\t\tbufferIndex += chunk.length;\n\t\t\t});\n\t\t} else {\n\t\t\tarray = buffers[0] || new Uint8Array(0);\n\t\t}\n\t\treturn array;\n\t};\n\tthat.flush = function () {\n\t\tz.inflateEnd();\n\t};\n}\n\nexport default ZipInflate;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global navigator */\n\nconst DEFAULT_CONFIGURATION = {\n\tchunkSize: 512 * 1024,\n\tmaxWorkers: (typeof navigator != \"undefined\" && navigator.hardwareConcurrency) || 2,\n\tterminateWorkerTimeout: 5000,\n\tuseWebWorkers: true,\n\tworkerScripts: undefined\n};\n\nconst config = Object.assign({}, DEFAULT_CONFIGURATION);\n\nexport {\n\tconfigure,\n\tgetConfiguration\n};\n\nfunction getConfiguration() {\n\treturn config;\n}\n\nfunction configure(configuration) {\n\tif (configuration.baseURL !== undefined) {\n\t\tconfig.baseURL = configuration.baseURL;\n\t}\n\tif (configuration.chunkSize !== undefined) {\n\t\tconfig.chunkSize = configuration.chunkSize;\n\t}\n\tif (configuration.maxWorkers !== undefined) {\n\t\tconfig.maxWorkers = configuration.maxWorkers;\n\t}\n\tif (configuration.terminateWorkerTimeout !== undefined) {\n\t\tconfig.terminateWorkerTimeout = configuration.terminateWorkerTimeout;\n\t}\n\tif (configuration.useWebWorkers !== undefined) {\n\t\tconfig.useWebWorkers = configuration.useWebWorkers;\n\t}\n\tif (configuration.Deflate !== undefined) {\n\t\tconfig.Deflate = configuration.Deflate;\n\t}\n\tif (configuration.Inflate !== undefined) {\n\t\tconfig.Inflate = configuration.Inflate;\n\t}\n\tif (configuration.workerScripts !== undefined) {\n\t\tif (configuration.workerScripts.deflate) {\n\t\t\tif (!Array.isArray(configuration.workerScripts.deflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.deflate must be an array\");\n\t\t\t}\n\t\t\tif (!config.workerScripts) {\n\t\t\t\tconfig.workerScripts = {};\n\t\t\t}\n\t\t\tconfig.workerScripts.deflate = configuration.workerScripts.deflate;\n\t\t}\n\t\tif (configuration.workerScripts.inflate) {\n\t\t\tif (!Array.isArray(configuration.workerScripts.inflate)) {\n\t\t\t\tthrow new Error(\"workerScripts.inflate must be an array\");\n\t\t\t}\n\t\t\tif (!config.workerScripts) {\n\t\t\t\tconfig.workerScripts = {};\n\t\t\t}\n\t\t\tconfig.workerScripts.inflate = configuration.workerScripts.inflate;\n\t\t}\n\t}\n}\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst table = [];\nfor (let i = 0; i < 256; i++) {\n\tlet t = i;\n\tfor (let j = 0; j < 8; j++) {\n\t\tif (t & 1) {\n\t\t\tt = (t >>> 1) ^ 0xEDB88320;\n\t\t} else {\n\t\t\tt = t >>> 1;\n\t\t}\n\t}\n\ttable[i] = t;\n}\n\nclass Crc32 {\n\n\tconstructor(crc) {\n\t\tthis.crc = crc || -1;\n\t}\n\n\tappend(data) {\n\t\tlet crc = this.crc | 0;\n\t\tfor (let offset = 0, length = data.length | 0; offset < length; offset++) {\n\t\t\tcrc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF];\n\t\t}\n\t\tthis.crc = crc;\n\t}\n\n\tget() {\n\t\treturn ~this.crc;\n\t}\n}\n\nexport default Crc32;", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextEncoder */\n\nexport default encodeText;\n\nfunction encodeText(value) {\n\tif (typeof TextEncoder == \"undefined\") {\n\t\tvalue = unescape(encodeURIComponent(value));\n\t\tconst result = new Uint8Array(value.length);\n\t\tfor (let i = 0; i < result.length; i++) {\n\t\t\tresult[i] = value.charCodeAt(i);\n\t\t}\n\t\treturn result;\n\t} else {\n\t\treturn new TextEncoder().encode(value);\n\t}\n}", "// Derived from https://github.com/xqdoo00o/jszip/blob/master/lib/sjcl.js and https://github.com/bitwiseshiftleft/sjcl\n\n/*// deno-lint-ignore-file no-this-alias *\n\n/*\n * SJCL is open. You can use, modify and redistribute it under a BSD\n * license or under the GNU GPL, version 2.0.\n */\n\n/** @fileOverview Javascript cryptography implementation.\n *\n * Crush to remove comments, shorten variable names and\n * generally reduce transmission size.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */\n\n/** @fileOverview Arrays of bits, encoded as arrays of Numbers.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bits, encoded as arrays of Numbers.\n * @namespace\n * @description\n * <p>\n * These objects are the currency accepted by SJCL's crypto functions.\n * </p>\n *\n * <p>\n * Most of our crypto primitives operate on arrays of 4-byte words internally,\n * but many of them can take arguments that are not a multiple of 4 bytes.\n * This library encodes arrays of bits (whose size need not be a multiple of 8\n * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an\n * array of words, 32 bits at a time. Since the words are double-precision\n * floating point numbers, they fit some extra data. We use this (in a private,\n * possibly-changing manner) to encode the number of bits actually present\n * in the last word of the array.\n * </p>\n *\n * <p>\n * Because bitwise ops clear this out-of-band data, these arrays can be passed\n * to ciphers like AES which want arrays of words.\n * </p>\n */\nconst bitArray = {\n\t/**\n\t * Concatenate two bit arrays.\n\t * @param {bitArray} a1 The first array.\n\t * @param {bitArray} a2 The second array.\n\t * @return {bitArray} The concatenation of a1 and a2.\n\t */\n\tconcat(a1, a2) {\n\t\tif (a1.length === 0 || a2.length === 0) {\n\t\t\treturn a1.concat(a2);\n\t\t}\n\n\t\tconst last = a1[a1.length - 1], shift = bitArray.getPartial(last);\n\t\tif (shift === 32) {\n\t\t\treturn a1.concat(a2);\n\t\t} else {\n\t\t\treturn bitArray._shiftRight(a2, shift, last | 0, a1.slice(0, a1.length - 1));\n\t\t}\n\t},\n\n\t/**\n\t * Find the length of an array of bits.\n\t * @param {bitArray} a The array.\n\t * @return {Number} The length of a, in bits.\n\t */\n\tbitLength(a) {\n\t\tconst l = a.length;\n\t\tif (l === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst x = a[l - 1];\n\t\treturn (l - 1) * 32 + bitArray.getPartial(x);\n\t},\n\n\t/**\n\t * Truncate an array.\n\t * @param {bitArray} a The array.\n\t * @param {Number} len The length to truncate to, in bits.\n\t * @return {bitArray} A new array, truncated to len bits.\n\t */\n\tclamp(a, len) {\n\t\tif (a.length * 32 < len) {\n\t\t\treturn a;\n\t\t}\n\t\ta = a.slice(0, Math.ceil(len / 32));\n\t\tconst l = a.length;\n\t\tlen = len & 31;\n\t\tif (l > 0 && len) {\n\t\t\ta[l - 1] = bitArray.partial(len, a[l - 1] & 0x80000000 >> (len - 1), 1);\n\t\t}\n\t\treturn a;\n\t},\n\n\t/**\n\t * Make a partial word for a bit array.\n\t * @param {Number} len The number of bits in the word.\n\t * @param {Number} x The bits.\n\t * @param {Number} [_end=0] Pass 1 if x has already been shifted to the high side.\n\t * @return {Number} The partial word.\n\t */\n\tpartial(len, x, _end) {\n\t\tif (len === 32) {\n\t\t\treturn x;\n\t\t}\n\t\treturn (_end ? x | 0 : x << (32 - len)) + len * 0x10000000000;\n\t},\n\n\t/**\n\t * Get the number of bits used by a partial word.\n\t * @param {Number} x The partial word.\n\t * @return {Number} The number of bits used by the partial word.\n\t */\n\tgetPartial(x) {\n\t\treturn Math.round(x / 0x10000000000) || 32;\n\t},\n\n\t/** Shift an array right.\n\t * @param {bitArray} a The array to shift.\n\t * @param {Number} shift The number of bits to shift.\n\t * @param {Number} [carry=0] A byte to carry in\n\t * @param {bitArray} [out=[]] An array to prepend to the output.\n\t * @private\n\t */\n\t_shiftRight(a, shift, carry, out) {\n\t\tif (out === undefined) {\n\t\t\tout = [];\n\t\t}\n\n\t\tfor (; shift >= 32; shift -= 32) {\n\t\t\tout.push(carry);\n\t\t\tcarry = 0;\n\t\t}\n\t\tif (shift === 0) {\n\t\t\treturn out.concat(a);\n\t\t}\n\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tout.push(carry | a[i] >>> shift);\n\t\t\tcarry = a[i] << (32 - shift);\n\t\t}\n\t\tconst last2 = a.length ? a[a.length - 1] : 0;\n\t\tconst shift2 = bitArray.getPartial(last2);\n\t\tout.push(bitArray.partial(shift + shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(), 1));\n\t\treturn out;\n\t}\n};\n\n/** @fileOverview Bit array codec implementations.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/**\n * Arrays of bytes\n * @namespace\n */\nconst codec = {\n\tbytes: {\n\t\t/** Convert from a bitArray to an array of bytes. */\n\t\tfromBits(arr) {\n\t\t\tconst bl = bitArray.bitLength(arr);\n\t\t\tconst byteLength = bl / 8;\n\t\t\tconst out = new Uint8Array(byteLength);\n\t\t\tlet tmp;\n\t\t\tfor (let i = 0; i < byteLength; i++) {\n\t\t\t\tif ((i & 3) === 0) {\n\t\t\t\t\ttmp = arr[i / 4];\n\t\t\t\t}\n\t\t\t\tout[i] = tmp >>> 24;\n\t\t\t\ttmp <<= 8;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t\t/** Convert from an array of bytes to a bitArray. */\n\t\ttoBits(bytes) {\n\t\t\tconst out = [];\n\t\t\tlet i;\n\t\t\tlet tmp = 0;\n\t\t\tfor (i = 0; i < bytes.length; i++) {\n\t\t\t\ttmp = tmp << 8 | bytes[i];\n\t\t\t\tif ((i & 3) === 3) {\n\t\t\t\t\tout.push(tmp);\n\t\t\t\t\ttmp = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i & 3) {\n\t\t\t\tout.push(bitArray.partial(8 * (i & 3), tmp));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t}\n};\n\nconst hash = {};\n\n/**\n * Context for a SHA-1 operation in progress.\n * @constructor\n */\nhash.sha1 = function (hash) {\n\tif (hash) {\n\t\tthis._h = hash._h.slice(0);\n\t\tthis._buffer = hash._buffer.slice(0);\n\t\tthis._length = hash._length;\n\t} else {\n\t\tthis.reset();\n\t}\n};\n\nhash.sha1.prototype = {\n\t/**\n\t * The hash's block size, in bits.\n\t * @constant\n\t */\n\tblockSize: 512,\n\n\t/**\n\t * Reset the hash state.\n\t * @return this\n\t */\n\treset: function () {\n\t\tconst sha1 = this;\n\t\tsha1._h = this._init.slice(0);\n\t\tsha1._buffer = [];\n\t\tsha1._length = 0;\n\t\treturn sha1;\n\t},\n\n\t/**\n\t * Input several words to the hash.\n\t * @param {bitArray|String} data the data to hash.\n\t * @return this\n\t */\n\tupdate: function (data) {\n\t\tconst sha1 = this;\n\t\tif (typeof data === \"string\") {\n\t\t\tdata = codec.utf8String.toBits(data);\n\t\t}\n\t\tconst b = sha1._buffer = bitArray.concat(sha1._buffer, data);\n\t\tconst ol = sha1._length;\n\t\tconst nl = sha1._length = ol + bitArray.bitLength(data);\n\t\tif (nl > 9007199254740991) {\n\t\t\tthrow new Error(\"Cannot hash more than 2^53 - 1 bits\");\n\t\t}\n\t\tconst c = new Uint32Array(b);\n\t\tlet j = 0;\n\t\tfor (let i = sha1.blockSize + ol - ((sha1.blockSize + ol) & (sha1.blockSize - 1)); i <= nl;\n\t\t\ti += sha1.blockSize) {\n\t\t\tsha1._block(c.subarray(16 * j, 16 * (j + 1)));\n\t\t\tj += 1;\n\t\t}\n\t\tb.splice(0, 16 * j);\n\t\treturn sha1;\n\t},\n\n\t/**\n\t * Complete hashing and output the hash value.\n\t * @return {bitArray} The hash value, an array of 5 big-endian words. TODO\n\t */\n\tfinalize: function () {\n\t\tconst sha1 = this;\n\t\tlet b = sha1._buffer;\n\t\tconst h = sha1._h;\n\n\t\t// Round out and push the buffer\n\t\tb = bitArray.concat(b, [bitArray.partial(1, 1)]);\n\t\t// Round out the buffer to a multiple of 16 words, less the 2 length words.\n\t\tfor (let i = b.length + 2; i & 15; i++) {\n\t\t\tb.push(0);\n\t\t}\n\n\t\t// append the length\n\t\tb.push(Math.floor(sha1._length / 0x100000000));\n\t\tb.push(sha1._length | 0);\n\n\t\twhile (b.length) {\n\t\t\tsha1._block(b.splice(0, 16));\n\t\t}\n\n\t\tsha1.reset();\n\t\treturn h;\n\t},\n\n\t/**\n\t * The SHA-1 initialization vector.\n\t * @private\n\t */\n\t_init: [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0],\n\n\t/**\n\t * The SHA-1 hash key.\n\t * @private\n\t */\n\t_key: [0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6],\n\n\t/**\n\t * The SHA-1 logical functions f(0), f(1), ..., f(79).\n\t * @private\n\t */\n\t_f: function (t, b, c, d) {\n\t\tif (t <= 19) {\n\t\t\treturn (b & c) | (~b & d);\n\t\t} else if (t <= 39) {\n\t\t\treturn b ^ c ^ d;\n\t\t} else if (t <= 59) {\n\t\t\treturn (b & c) | (b & d) | (c & d);\n\t\t} else if (t <= 79) {\n\t\t\treturn b ^ c ^ d;\n\t\t}\n\t},\n\n\t/**\n\t * Circular left-shift operator.\n\t * @private\n\t */\n\t_S: function (n, x) {\n\t\treturn (x << n) | (x >>> 32 - n);\n\t},\n\n\t/**\n\t * Perform one cycle of SHA-1.\n\t * @param {Uint32Array|bitArray} words one block of words.\n\t * @private\n\t */\n\t_block: function (words) {\n\t\tconst sha1 = this;\n\t\tconst h = sha1._h;\n\t\t// When words is passed to _block, it has 16 elements. SHA1 _block\n\t\t// function extends words with new elements (at the end there are 80 elements). \n\t\t// The problem is that if we use Uint32Array instead of Array, \n\t\t// the length of Uint32Array cannot be changed. Thus, we replace words with a \n\t\t// normal Array here.\n\t\tconst w = Array(80); // do not use Uint32Array here as the instantiation is slower\n\t\tfor (let j = 0; j < 16; j++) {\n\t\t\tw[j] = words[j];\n\t\t}\n\n\t\tlet a = h[0];\n\t\tlet b = h[1];\n\t\tlet c = h[2];\n\t\tlet d = h[3];\n\t\tlet e = h[4];\n\n\t\tfor (let t = 0; t <= 79; t++) {\n\t\t\tif (t >= 16) {\n\t\t\t\tw[t] = sha1._S(1, w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]);\n\t\t\t}\n\t\t\tconst tmp = (sha1._S(5, a) + sha1._f(t, b, c, d) + e + w[t] +\n\t\t\t\tsha1._key[Math.floor(t / 20)]) | 0;\n\t\t\te = d;\n\t\t\td = c;\n\t\t\tc = sha1._S(30, b);\n\t\t\tb = a;\n\t\t\ta = tmp;\n\t\t}\n\n\t\th[0] = (h[0] + a) | 0;\n\t\th[1] = (h[1] + b) | 0;\n\t\th[2] = (h[2] + c) | 0;\n\t\th[3] = (h[3] + d) | 0;\n\t\th[4] = (h[4] + e) | 0;\n\t}\n};\n\n/** @fileOverview Low-level AES implementation.\n *\n * This file contains a low-level implementation of AES, optimized for\n * size and for efficiency on several browsers. It is based on\n * OpenSSL's aes_core.c, a public-domain implementation by Vincent\n * Rijmen, Antoon Bosselaers and Paulo Barreto.\n *\n * An older version of this implementation is available in the public\n * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,\n * Stanford University 2008-2010 and BSD-licensed for liability\n * reasons.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\nconst cipher = {};\n\n/**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @constructor\n * @param {Array} key The key as an array of 4, 6 or 8 words.\n */\ncipher.aes = class {\n\tconstructor(key) {\n\t\t/**\n\t\t * The expanded S-box and inverse S-box tables. These will be computed\n\t\t * on the client so that we don't have to send them down the wire.\n\t\t *\n\t\t * There are two tables, _tables[0] is for encryption and\n\t\t * _tables[1] is for decryption.\n\t\t *\n\t\t * The first 4 sub-tables are the expanded S-box with MixColumns. The\n\t\t * last (_tables[01][4]) is the S-box itself.\n\t\t *\n\t\t * @private\n\t\t */\n\t\tconst aes = this;\n\t\taes._tables = [[[], [], [], [], []], [[], [], [], [], []]];\n\n\t\tif (!aes._tables[0][0][0]) {\n\t\t\taes._precompute();\n\t\t}\n\n\t\tconst sbox = aes._tables[0][4];\n\t\tconst decTable = aes._tables[1];\n\t\tconst keyLen = key.length;\n\n\t\tlet i, encKey, decKey, rcon = 1;\n\n\t\tif (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n\t\t\tthrow new Error(\"invalid aes key size\");\n\t\t}\n\n\t\taes._key = [encKey = key.slice(0), decKey = []];\n\n\t\t// schedule encryption keys\n\t\tfor (i = keyLen; i < 4 * keyLen + 28; i++) {\n\t\t\tlet tmp = encKey[i - 1];\n\n\t\t\t// apply sbox\n\t\t\tif (i % keyLen === 0 || (keyLen === 8 && i % keyLen === 4)) {\n\t\t\t\ttmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n\t\t\t\t// shift rows and add rcon\n\t\t\t\tif (i % keyLen === 0) {\n\t\t\t\t\ttmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n\t\t\t\t\trcon = rcon << 1 ^ (rcon >> 7) * 283;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tencKey[i] = encKey[i - keyLen] ^ tmp;\n\t\t}\n\n\t\t// schedule decryption keys\n\t\tfor (let j = 0; i; j++, i--) {\n\t\t\tconst tmp = encKey[j & 3 ? i : i - 4];\n\t\t\tif (i <= 4 || j < 4) {\n\t\t\t\tdecKey[j] = tmp;\n\t\t\t} else {\n\t\t\t\tdecKey[j] = decTable[0][sbox[tmp >>> 24]] ^\n\t\t\t\t\tdecTable[1][sbox[tmp >> 16 & 255]] ^\n\t\t\t\t\tdecTable[2][sbox[tmp >> 8 & 255]] ^\n\t\t\t\t\tdecTable[3][sbox[tmp & 255]];\n\t\t\t}\n\t\t}\n\t}\n\t// public\n\t/* Something like this might appear here eventually\n\tname: \"AES\",\n\tblockSize: 4,\n\tkeySizes: [4,6,8],\n\t*/\n\n\t/**\n\t * Encrypt an array of 4 big-endian words.\n\t * @param {Array} data The plaintext.\n\t * @return {Array} The ciphertext.\n\t */\n\tencrypt(data) {\n\t\treturn this._crypt(data, 0);\n\t}\n\n\t/**\n\t * Decrypt an array of 4 big-endian words.\n\t * @param {Array} data The ciphertext.\n\t * @return {Array} The plaintext.\n\t */\n\tdecrypt(data) {\n\t\treturn this._crypt(data, 1);\n\t}\n\n\t/**\n\t * Expand the S-box tables.\n\t *\n\t * @private\n\t */\n\t_precompute() {\n\t\tconst encTable = this._tables[0];\n\t\tconst decTable = this._tables[1];\n\t\tconst sbox = encTable[4];\n\t\tconst sboxInv = decTable[4];\n\t\tconst d = [];\n\t\tconst th = [];\n\t\tlet xInv, x2, x4, x8;\n\n\t\t// Compute double and third tables\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tth[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n\t\t}\n\n\t\tfor (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n\t\t\t// Compute sbox\n\t\t\tlet s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n\t\t\ts = s >> 8 ^ s & 255 ^ 99;\n\t\t\tsbox[x] = s;\n\t\t\tsboxInv[s] = x;\n\n\t\t\t// Compute MixColumns\n\t\t\tx8 = d[x4 = d[x2 = d[x]]];\n\t\t\tlet tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t\t\tlet tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n\t\t\tfor (let i = 0; i < 4; i++) {\n\t\t\t\tencTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n\t\t\t\tdecTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n\t\t\t}\n\t\t}\n\n\t\t// Compactify. Considerable speedup on Firefox.\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tencTable[i] = encTable[i].slice(0);\n\t\t\tdecTable[i] = decTable[i].slice(0);\n\t\t}\n\t}\n\n\t/**\n\t * Encryption and decryption core.\n\t * @param {Array} input Four words to be encrypted or decrypted.\n\t * @param dir The direction, 0 for encrypt and 1 for decrypt.\n\t * @return {Array} The four encrypted or decrypted words.\n\t * @private\n\t */\n\t_crypt(input, dir) {\n\t\tif (input.length !== 4) {\n\t\t\tthrow new Error(\"invalid aes block size\");\n\t\t}\n\n\t\tconst key = this._key[dir];\n\n\t\tconst nInnerRounds = key.length / 4 - 2;\n\t\tconst out = [0, 0, 0, 0];\n\t\tconst table = this._tables[dir];\n\n\t\t// load up the tables\n\t\tconst t0 = table[0];\n\t\tconst t1 = table[1];\n\t\tconst t2 = table[2];\n\t\tconst t3 = table[3];\n\t\tconst sbox = table[4];\n\n\t\t// state variables a,b,c,d are loaded with pre-whitened data\n\t\tlet a = input[0] ^ key[0];\n\t\tlet b = input[dir ? 3 : 1] ^ key[1];\n\t\tlet c = input[2] ^ key[2];\n\t\tlet d = input[dir ? 1 : 3] ^ key[3];\n\t\tlet kIndex = 4;\n\t\tlet a2, b2, c2;\n\n\t\t// Inner rounds. Cribbed from OpenSSL.\n\t\tfor (let i = 0; i < nInnerRounds; i++) {\n\t\t\ta2 = t0[a >>> 24] ^ t1[b >> 16 & 255] ^ t2[c >> 8 & 255] ^ t3[d & 255] ^ key[kIndex];\n\t\t\tb2 = t0[b >>> 24] ^ t1[c >> 16 & 255] ^ t2[d >> 8 & 255] ^ t3[a & 255] ^ key[kIndex + 1];\n\t\t\tc2 = t0[c >>> 24] ^ t1[d >> 16 & 255] ^ t2[a >> 8 & 255] ^ t3[b & 255] ^ key[kIndex + 2];\n\t\t\td = t0[d >>> 24] ^ t1[a >> 16 & 255] ^ t2[b >> 8 & 255] ^ t3[c & 255] ^ key[kIndex + 3];\n\t\t\tkIndex += 4;\n\t\t\ta = a2; b = b2; c = c2;\n\t\t}\n\n\t\t// Last round.\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tout[dir ? 3 & -i : i] =\n\t\t\t\tsbox[a >>> 24] << 24 ^\n\t\t\t\tsbox[b >> 16 & 255] << 16 ^\n\t\t\t\tsbox[c >> 8 & 255] << 8 ^\n\t\t\t\tsbox[d & 255] ^\n\t\t\t\tkey[kIndex++];\n\t\t\ta2 = a; a = b; b = c; c = d; d = a2;\n\t\t}\n\n\t\treturn out;\n\t}\n};\n\n/**\n * Random values\n * @namespace\n */\nconst random = {\n\t/** \n\t * Generate random words with pure js, cryptographically not as strong & safe as native implementation.\n\t * @param {TypedArray} typedArray The array to fill.\n\t * @return {TypedArray} The random values.\n\t */\n\tgetRandomValues(typedArray) {\n\t\tconst words = new Uint32Array(typedArray.buffer);\n\t\tconst r = (m_w) => {\n\t\t\tlet m_z = 0x3ade68b1;\n\t\t\tconst mask = 0xffffffff;\n\t\t\treturn function () {\n\t\t\t\tm_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t\t\t\tm_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t\t\t\tconst result = ((((m_z << 0x10) + m_w) & mask) / 0x100000000) + .5;\n\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\n\t\t\t};\n\t\t};\n\t\tfor (let i = 0, rcache; i < typedArray.length; i += 4) {\n\t\t\tconst _r = r((rcache || Math.random()) * 0x100000000);\n\t\t\trcache = _r() * 0x3ade67b7;\n\t\t\twords[i / 4] = (_r() * 0x100000000) | 0;\n\t\t}\n\t\treturn typedArray;\n\t}\n};\n\n/** @fileOverview CTR mode implementation.\n *\n * Special thanks to Roy Nicholson for pointing out a bug in our\n * implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** Brian Gladman's CTR Mode.\n* @constructor\n* @param {Object} _prf The aes instance to generate key.\n* @param {bitArray} _iv The iv for ctr mode, it must be 128 bits.\n*/\n\nconst mode = {};\n\n/**\n * Brian Gladman's CTR Mode.\n * @namespace\n */\nmode.ctrGladman = class {\n\tconstructor(prf, iv) {\n\t\tthis._prf = prf;\n\t\tthis._initIv = iv;\n\t\tthis._iv = iv;\n\t}\n\n\treset() {\n\t\tthis._iv = this._initIv;\n\t}\n\n\t/** Input some data to calculate.\n\t * @param {bitArray} data the data to process, it must be intergral multiple of 128 bits unless it's the last.\n\t */\n\tupdate(data) {\n\t\treturn this.calculate(this._prf, data, this._iv);\n\t}\n\n\tincWord(word) {\n\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tlet b1 = (word >> 16) & 0xff;\n\t\t\tlet b2 = (word >> 8) & 0xff;\n\t\t\tlet b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) { // overflow b1 \n\t\t\t\tb1 = 0;\n\t\t\t\tif (b2 === 0xff) {\n\t\t\t\t\tb2 = 0;\n\t\t\t\t\tif (b3 === 0xff) {\n\t\t\t\t\t\tb3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t++b3;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t++b2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t++b1;\n\t\t\t}\n\n\t\t\tword = 0;\n\t\t\tword += (b1 << 16);\n\t\t\tword += (b2 << 8);\n\t\t\tword += b3;\n\t\t} else {\n\t\t\tword += (0x01 << 24);\n\t\t}\n\t\treturn word;\n\t}\n\n\tincCounter(counter) {\n\t\tif ((counter[0] = this.incWord(counter[0])) === 0) {\n\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\tcounter[1] = this.incWord(counter[1]);\n\t\t}\n\t}\n\n\tcalculate(prf, data, iv) {\n\t\tlet l;\n\t\tif (!(l = data.length)) {\n\t\t\treturn [];\n\t\t}\n\t\tconst bl = bitArray.bitLength(data);\n\t\tfor (let i = 0; i < l; i += 4) {\n\t\t\tthis.incCounter(iv);\n\t\t\tconst e = prf.encrypt(iv);\n\t\t\tdata[i] ^= e[0];\n\t\t\tdata[i + 1] ^= e[1];\n\t\t\tdata[i + 2] ^= e[2];\n\t\t\tdata[i + 3] ^= e[3];\n\t\t}\n\t\treturn bitArray.clamp(data, bl);\n\t}\n};\n\nconst misc = {\n\timportKey(password) {\n\t\treturn new misc.hmacSha1(codec.bytes.toBits(password));\n\t},\n\tpbkdf2(prf, salt, count, length) {\n\t\tcount = count || 10000;\n\t\tif (length < 0 || count < 0) {\n\t\t\tthrow new Error(\"invalid params to pbkdf2\");\n\t\t}\n\t\tconst byteLength = ((length >> 5) + 1) << 2;\n\t\tlet u, ui, i, j, k;\n\t\tconst arrayBuffer = new ArrayBuffer(byteLength);\n\t\tconst out = new DataView(arrayBuffer);\n\t\tlet outLength = 0;\n\t\tconst b = bitArray;\n\t\tsalt = codec.bytes.toBits(salt);\n\t\tfor (k = 1; outLength < (byteLength || 1); k++) {\n\t\t\tu = ui = prf.encrypt(b.concat(salt, [k]));\n\t\t\tfor (i = 1; i < count; i++) {\n\t\t\t\tui = prf.encrypt(ui);\n\t\t\t\tfor (j = 0; j < ui.length; j++) {\n\t\t\t\t\tu[j] ^= ui[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (i = 0; outLength < (byteLength || 1) && i < u.length; i++) {\n\t\t\t\tout.setInt32(outLength, u[i]);\n\t\t\t\toutLength += 4;\n\t\t\t}\n\t\t}\n\t\treturn arrayBuffer.slice(0, length / 8);\n\t}\n};\n\n/** @fileOverview HMAC implementation.\n *\n * @author Emily Stark\n * @author Mike Hamburg\n * @author Dan Boneh\n */\n\n/** HMAC with the specified hash function.\n * @constructor\n * @param {bitArray} key the key for HMAC.\n * @param {Object} [Hash=hash.sha1] The hash function to use.\n */\nmisc.hmacSha1 = class {\n\n\tconstructor(key) {\n\t\tconst hmac = this;\n\t\tconst Hash = hmac._hash = hash.sha1;\n\t\tconst exKey = [[], []];\n\t\tconst bs = Hash.prototype.blockSize / 32;\n\t\thmac._baseHash = [new Hash(), new Hash()];\n\n\t\tif (key.length > bs) {\n\t\t\tkey = Hash.hash(key);\n\t\t}\n\n\t\tfor (let i = 0; i < bs; i++) {\n\t\t\texKey[0][i] = key[i] ^ 0x36363636;\n\t\t\texKey[1][i] = key[i] ^ 0x5C5C5C5C;\n\t\t}\n\n\t\thmac._baseHash[0].update(exKey[0]);\n\t\thmac._baseHash[1].update(exKey[1]);\n\t\thmac._resultHash = new Hash(hmac._baseHash[0]);\n\t}\n\treset() {\n\t\tconst hmac = this;\n\t\thmac._resultHash = new hmac._hash(hmac._baseHash[0]);\n\t\thmac._updated = false;\n\t}\n\n\tupdate(data) {\n\t\tconst hmac = this;\n\t\thmac._updated = true;\n\t\thmac._resultHash.update(data);\n\t}\n\n\tdigest() {\n\t\tconst hmac = this;\n\t\tconst w = hmac._resultHash.finalize();\n\t\tconst result = new (hmac._hash)(hmac._baseHash[1]).update(w).finalize();\n\n\t\thmac.reset();\n\n\t\treturn result;\n\t}\n\n\tencrypt(data) {\n\t\tif (!this._updated) {\n\t\t\tthis.update(data);\n\t\t\treturn this.digest(data);\n\t\t} else {\n\t\t\tthrow new Error(\"encrypt on already updated hmac called!\");\n\t\t}\n\t}\n};\n\nexport {\n\tcipher,\n\tcodec,\n\tmisc,\n\tmode,\n\trandom\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto */\n// deno-lint-ignore-file no-this-alias\n\nimport encodeText from \"./../util/encode-text.js\";\nimport { cipher, codec, misc, mode, random } from \"./sjcl.js\";\n\nconst ERR_INVALID_PASSWORD = \"Invalid pasword\";\nconst BLOCK_LENGTH = 16;\nconst RAW_FORMAT = \"raw\";\nconst PBKDF2_ALGORITHM = { name: \"PBKDF2\" };\nconst HASH_ALGORITHM = { name: \"HMAC\" };\nconst HASH_FUNCTION = \"SHA-1\";\nconst BASE_KEY_ALGORITHM = Object.assign({ hash: HASH_ALGORITHM }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_ALGORITHM = Object.assign({ iterations: 1000, hash: { name: HASH_FUNCTION } }, PBKDF2_ALGORITHM);\nconst DERIVED_BITS_USAGE = [\"deriveBits\"];\nconst SALT_LENGTH = [8, 12, 16];\nconst KEY_LENGTH = [16, 24, 32];\nconst SIGNATURE_LENGTH = 10;\nconst COUNTER_DEFAULT_VALUE = [0, 0, 0, 0];\nconst CRYPTO_API_SUPPORTED = typeof crypto != \"undefined\";\nconst SUBTLE_API_SUPPORTED = CRYPTO_API_SUPPORTED && typeof crypto.subtle != \"undefined\";\nconst codecBytes = codec.bytes;\nconst Aes = cipher.aes;\nconst CtrGladman = mode.ctrGladman;\nconst HmacSha1 = misc.hmacSha1;\nclass AESDecrypt {\n\n\tconstructor(password, signed, strength) {\n\t\tObject.assign(this, {\n\t\t\tpassword,\n\t\t\tsigned,\n\t\t\tstrength: strength - 1,\n\t\t\tpendingInput: new Uint8Array(0)\n\t\t});\n\t}\n\n\tasync append(input) {\n\t\tconst aesCrypto = this;\n\t\tif (aesCrypto.password) {\n\t\t\tconst preamble = subarray(input, 0, SALT_LENGTH[aesCrypto.strength] + 2);\n\t\t\tawait createDecryptionKeys(aesCrypto, preamble, aesCrypto.password);\n\t\t\taesCrypto.password = null;\n\t\t\taesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));\n\t\t\taesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);\n\t\t\tinput = subarray(input, SALT_LENGTH[aesCrypto.strength] + 2);\n\t\t}\n\t\tconst output = new Uint8Array(input.length - SIGNATURE_LENGTH - ((input.length - SIGNATURE_LENGTH) % BLOCK_LENGTH));\n\t\treturn append(aesCrypto, input, output, 0, SIGNATURE_LENGTH, true);\n\t}\n\n\tflush() {\n\t\tconst aesCrypto = this;\n\t\tconst pendingInput = aesCrypto.pendingInput;\n\t\tconst chunkToDecrypt = subarray(pendingInput, 0, pendingInput.length - SIGNATURE_LENGTH);\n\t\tconst originalSignature = subarray(pendingInput, pendingInput.length - SIGNATURE_LENGTH);\n\t\tlet decryptedChunkArray = new Uint8Array(0);\n\t\tif (chunkToDecrypt.length) {\n\t\t\tconst encryptedChunk = codecBytes.toBits(chunkToDecrypt);\n\t\t\taesCrypto.hmac.update(encryptedChunk);\n\t\t\tconst decryptedChunk = aesCrypto.aesCtrGladman.update(encryptedChunk);\n\t\t\tdecryptedChunkArray = codecBytes.fromBits(decryptedChunk);\n\t\t}\n\t\tlet valid = true;\n\t\tif (aesCrypto.signed) {\n\t\t\tconst signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);\n\t\t\tfor (let indexSignature = 0; indexSignature < SIGNATURE_LENGTH; indexSignature++) {\n\t\t\t\tif (signature[indexSignature] != originalSignature[indexSignature]) {\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tvalid,\n\t\t\tdata: decryptedChunkArray\n\t\t};\n\t}\n}\n\nclass AESEncrypt {\n\n\tconstructor(password, strength) {\n\t\tObject.assign(this, {\n\t\t\tpassword,\n\t\t\tstrength: strength - 1,\n\t\t\tpendingInput: new Uint8Array(0)\n\t\t});\n\t}\n\n\tasync append(input) {\n\t\tconst aesCrypto = this;\n\t\tlet preamble = new Uint8Array(0);\n\t\tif (aesCrypto.password) {\n\t\t\tpreamble = await createEncryptionKeys(aesCrypto, aesCrypto.password);\n\t\t\taesCrypto.password = null;\n\t\t\taesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));\n\t\t\taesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);\n\t\t}\n\t\tconst output = new Uint8Array(preamble.length + input.length - (input.length % BLOCK_LENGTH));\n\t\toutput.set(preamble, 0);\n\t\treturn append(aesCrypto, input, output, preamble.length, 0);\n\t}\n\n\tflush() {\n\t\tconst aesCrypto = this;\n\t\tlet encryptedChunkArray = new Uint8Array(0);\n\t\tif (aesCrypto.pendingInput.length) {\n\t\t\tconst encryptedChunk = aesCrypto.aesCtrGladman.update(codecBytes.toBits(aesCrypto.pendingInput));\n\t\t\taesCrypto.hmac.update(encryptedChunk);\n\t\t\tencryptedChunkArray = codecBytes.fromBits(encryptedChunk);\n\t\t}\n\t\tconst signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);\n\t\treturn {\n\t\t\tdata: concat(encryptedChunkArray, signature),\n\t\t\tsignature\n\t\t};\n\t}\n}\n\nexport {\n\tAESDecrypt,\n\tAESEncrypt,\n\tERR_INVALID_PASSWORD\n};\n\nfunction append(aesCrypto, input, output, paddingStart, paddingEnd, verifySignature) {\n\tconst inputLength = input.length - paddingEnd;\n\tif (aesCrypto.pendingInput.length) {\n\t\tinput = concat(aesCrypto.pendingInput, input);\n\t\toutput = expand(output, inputLength - (inputLength % BLOCK_LENGTH));\n\t}\n\tlet offset;\n\tfor (offset = 0; offset <= inputLength - BLOCK_LENGTH; offset += BLOCK_LENGTH) {\n\t\tconst inputChunk = codecBytes.toBits(subarray(input, offset, offset + BLOCK_LENGTH));\n\t\tif (verifySignature) {\n\t\t\taesCrypto.hmac.update(inputChunk);\n\t\t}\n\t\tconst outputChunk = aesCrypto.aesCtrGladman.update(inputChunk);\n\t\tif (!verifySignature) {\n\t\t\taesCrypto.hmac.update(outputChunk);\n\t\t}\n\t\toutput.set(codecBytes.fromBits(outputChunk), offset + paddingStart);\n\t}\n\taesCrypto.pendingInput = subarray(input, offset);\n\treturn output;\n}\n\nasync function createDecryptionKeys(decrypt, preambleArray, password) {\n\tawait createKeys(decrypt, password, subarray(preambleArray, 0, SALT_LENGTH[decrypt.strength]));\n\tconst passwordVerification = subarray(preambleArray, SALT_LENGTH[decrypt.strength]);\n\tconst passwordVerificationKey = decrypt.keys.passwordVerification;\n\tif (passwordVerificationKey[0] != passwordVerification[0] || passwordVerificationKey[1] != passwordVerification[1]) {\n\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t}\n}\n\nasync function createEncryptionKeys(encrypt, password) {\n\tconst salt = getRandomValues(new Uint8Array(SALT_LENGTH[encrypt.strength]));\n\tawait createKeys(encrypt, password, salt);\n\treturn concat(salt, encrypt.keys.passwordVerification);\n}\n\nasync function createKeys(target, password, salt) {\n\tconst encodedPassword = encodeText(password);\n\tconst basekey = await importKey(RAW_FORMAT, encodedPassword, BASE_KEY_ALGORITHM, false, DERIVED_BITS_USAGE);\n\tconst derivedBits = await deriveBits(Object.assign({ salt }, DERIVED_BITS_ALGORITHM), basekey, 8 * ((KEY_LENGTH[target.strength] * 2) + 2));\n\tconst compositeKey = new Uint8Array(derivedBits);\n\ttarget.keys = {\n\t\tkey: codecBytes.toBits(subarray(compositeKey, 0, KEY_LENGTH[target.strength])),\n\t\tauthentication: codecBytes.toBits(subarray(compositeKey, KEY_LENGTH[target.strength], KEY_LENGTH[target.strength] * 2)),\n\t\tpasswordVerification: subarray(compositeKey, KEY_LENGTH[target.strength] * 2)\n\t};\n}\n\nfunction getRandomValues(array) {\n\tif (CRYPTO_API_SUPPORTED && typeof crypto.getRandomValues == \"function\") {\n\t\treturn crypto.getRandomValues(array);\n\t} else {\n\t\treturn random.getRandomValues(array);\n\t}\n}\n\nfunction importKey(format, password, algorithm, extractable, keyUsages) {\n\tif (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.importKey == \"function\") {\n\t\treturn crypto.subtle.importKey(format, password, algorithm, extractable, keyUsages);\n\t} else {\n\t\treturn misc.importKey(password);\n\t}\n}\n\nasync function deriveBits(algorithm, baseKey, length) {\n\tif (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.deriveBits == \"function\") {\n\t\treturn await crypto.subtle.deriveBits(algorithm, baseKey, length);\n\t} else {\n\t\treturn misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);\n\t}\n}\n\nfunction concat(leftArray, rightArray) {\n\tlet array = leftArray;\n\tif (leftArray.length + rightArray.length) {\n\t\tarray = new Uint8Array(leftArray.length + rightArray.length);\n\t\tarray.set(leftArray, 0);\n\t\tarray.set(rightArray, leftArray.length);\n\t}\n\treturn array;\n}\n\nfunction expand(inputArray, length) {\n\tif (length && length > inputArray.length) {\n\t\tconst array = inputArray;\n\t\tinputArray = new Uint8Array(length);\n\t\tinputArray.set(array, 0);\n\t}\n\treturn inputArray;\n}\n\nfunction subarray(array, begin, end) {\n\treturn array.subarray(begin, end);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global crypto */\n// deno-lint-ignore-file no-this-alias\n\nimport Crc32 from \"./crc32.js\";\nimport { ERR_INVALID_PASSWORD } from \"./aes-crypto.js\";\n\nconst HEADER_LENGTH = 12;\n\nclass ZipCryptoDecrypt {\n\n\tconstructor(password, passwordVerification) {\n\t\tconst zipCrypto = this;\n\t\tObject.assign(zipCrypto, {\n\t\t\tpassword,\n\t\t\tpasswordVerification\n\t\t});\n\t\tcreateKeys(zipCrypto, password);\n\t}\n\n\tappend(input) {\n\t\tconst zipCrypto = this;\n\t\tif (zipCrypto.password) {\n\t\t\tconst decryptedHeader = decrypt(zipCrypto, input.subarray(0, HEADER_LENGTH));\n\t\t\tzipCrypto.password = null;\n\t\t\tif (decryptedHeader[HEADER_LENGTH - 1] != zipCrypto.passwordVerification) {\n\t\t\t\tthrow new Error(ERR_INVALID_PASSWORD);\n\t\t\t}\n\t\t\tinput = input.subarray(HEADER_LENGTH);\n\t\t}\n\t\treturn decrypt(zipCrypto, input);\n\t}\n\n\tflush() {\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\tdata: new Uint8Array(0)\n\t\t};\n\t}\n}\n\nclass ZipCryptoEncrypt {\n\n\tconstructor(password, passwordVerification) {\n\t\tconst zipCrypto = this;\n\t\tObject.assign(zipCrypto, {\n\t\t\tpassword,\n\t\t\tpasswordVerification\n\t\t});\n\t\tcreateKeys(zipCrypto, password);\n\t}\n\n\tappend(input) {\n\t\tconst zipCrypto = this;\n\t\tlet output;\n\t\tlet offset;\n\t\tif (zipCrypto.password) {\n\t\t\tzipCrypto.password = null;\n\t\t\tconst header = crypto.getRandomValues(new Uint8Array(HEADER_LENGTH));\n\t\t\theader[HEADER_LENGTH - 1] = zipCrypto.passwordVerification;\n\t\t\toutput = new Uint8Array(input.length + header.length);\n\t\t\toutput.set(encrypt(zipCrypto, header), 0);\n\t\t\toffset = HEADER_LENGTH;\n\t\t} else {\n\t\t\toutput = new Uint8Array(input.length);\n\t\t\toffset = 0;\n\t\t}\n\t\toutput.set(encrypt(zipCrypto, input), offset);\n\t\treturn output;\n\t}\n\n\tflush() {\n\t\treturn {\n\t\t\tdata: new Uint8Array(0)\n\t\t};\n\t}\n}\n\nexport {\n\tZipCryptoDecrypt,\n\tZipCryptoEncrypt,\n\tERR_INVALID_PASSWORD\n};\n\nfunction decrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, output[index]);\n\t}\n\treturn output;\n}\n\nfunction encrypt(target, input) {\n\tconst output = new Uint8Array(input.length);\n\tfor (let index = 0; index < input.length; index++) {\n\t\toutput[index] = getByte(target) ^ input[index];\n\t\tupdateKeys(target, input[index]);\n\t}\n\treturn output;\n}\n\nfunction createKeys(target, password) {\n\ttarget.keys = [0x12345678, 0x23456789, 0x34567890];\n\ttarget.crcKey0 = new Crc32(target.keys[0]);\n\ttarget.crcKey2 = new Crc32(target.keys[2]);\n\tfor (let index = 0; index < password.length; index++) {\n\t\tupdateKeys(target, password.charCodeAt(index));\n\t}\n}\n\nfunction updateKeys(target, byte) {\n\ttarget.crcKey0.append([byte]);\n\ttarget.keys[0] = ~target.crcKey0.get();\n\ttarget.keys[1] = getInt32(target.keys[1] + getInt8(target.keys[0]));\n\ttarget.keys[1] = getInt32(Math.imul(target.keys[1], 134775813) + 1);\n\ttarget.crcKey2.append([target.keys[1] >>> 24]);\n\ttarget.keys[2] = ~target.crcKey2.get();\n}\n\nfunction getByte(target) {\n\tconst temp = target.keys[2] | 2;\n\treturn getInt8(Math.imul(temp, (temp ^ 1)) >>> 8);\n}\n\nfunction getInt8(number) {\n\treturn number & 0xFF;\n}\n\nfunction getInt32(number) {\n\treturn number & 0xFFFFFFFF;\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// deno-lint-ignore-file no-this-alias\n\nimport Crc32 from \"./crc32.js\";\nimport { AESEncrypt, AESDecrypt, ERR_INVALID_PASSWORD } from \"./aes-crypto.js\";\nimport { ZipCryptoDecrypt, ZipCryptoEncrypt } from \"./zip-crypto.js\";\n\nconst CODEC_DEFLATE = \"deflate\";\nconst CODEC_INFLATE = \"inflate\";\nconst ERR_INVALID_SIGNATURE = \"Invalid signature\";\n\nclass Inflate {\n\n\tconstructor(codecConstructor, {\n\t\tsignature,\n\t\tpassword,\n\t\tsigned,\n\t\tcompressed,\n\t\tzipCrypto,\n\t\tpasswordVerification,\n\t\tencryptionStrength\n\t}, { chunkSize }) {\n\t\tconst encrypted = Boolean(password);\n\t\tObject.assign(this, {\n\t\t\tsignature,\n\t\t\tencrypted,\n\t\t\tsigned,\n\t\t\tcompressed,\n\t\t\tinflate: compressed && new codecConstructor({ chunkSize }),\n\t\t\tcrc32: signed && new Crc32(),\n\t\t\tzipCrypto,\n\t\t\tdecrypt: encrypted && zipCrypto ?\n\t\t\t\tnew ZipCryptoDecrypt(password, passwordVerification) :\n\t\t\t\tnew AESDecrypt(password, signed, encryptionStrength)\n\t\t});\n\t}\n\n\tasync append(data) {\n\t\tconst codec = this;\n\t\tif (codec.encrypted && data.length) {\n\t\t\tdata = await codec.decrypt.append(data);\n\t\t}\n\t\tif (codec.compressed && data.length) {\n\t\t\tdata = await codec.inflate.append(data);\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed && data.length) {\n\t\t\tcodec.crc32.append(data);\n\t\t}\n\t\treturn data;\n\t}\n\n\tasync flush() {\n\t\tconst codec = this;\n\t\tlet signature;\n\t\tlet data = new Uint8Array(0);\n\t\tif (codec.encrypted) {\n\t\t\tconst result = codec.decrypt.flush();\n\t\t\tif (!result.valid) {\n\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t}\n\t\t\tdata = result.data;\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed) {\n\t\t\tconst dataViewSignature = new DataView(new Uint8Array(4).buffer);\n\t\t\tsignature = codec.crc32.get();\n\t\t\tdataViewSignature.setUint32(0, signature);\n\t\t\tif (codec.signature != dataViewSignature.getUint32(0, false)) {\n\t\t\t\tthrow new Error(ERR_INVALID_SIGNATURE);\n\t\t\t}\n\t\t}\n\t\tif (codec.compressed) {\n\t\t\tdata = (await codec.inflate.append(data)) || new Uint8Array(0);\n\t\t\tawait codec.inflate.flush();\n\t\t}\n\t\treturn { data, signature };\n\t}\n}\n\nclass Deflate {\n\n\tconstructor(codecConstructor, {\n\t\tencrypted,\n\t\tsigned,\n\t\tcompressed,\n\t\tlevel,\n\t\tzipCrypto,\n\t\tpassword,\n\t\tpasswordVerification,\n\t\tencryptionStrength\n\t}, { chunkSize }) {\n\t\tObject.assign(this, {\n\t\t\tencrypted,\n\t\t\tsigned,\n\t\t\tcompressed,\n\t\t\tdeflate: compressed && new codecConstructor({ level: level || 5, chunkSize }),\n\t\t\tcrc32: signed && new Crc32(),\n\t\t\tzipCrypto,\n\t\t\tencrypt: encrypted && zipCrypto ?\n\t\t\t\tnew ZipCryptoEncrypt(password, passwordVerification) :\n\t\t\t\tnew AESEncrypt(password, encryptionStrength)\n\t\t});\n\t}\n\n\tasync append(inputData) {\n\t\tconst codec = this;\n\t\tlet data = inputData;\n\t\tif (codec.compressed && inputData.length) {\n\t\t\tdata = await codec.deflate.append(inputData);\n\t\t}\n\t\tif (codec.encrypted && data.length) {\n\t\t\tdata = await codec.encrypt.append(data);\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed && inputData.length) {\n\t\t\tcodec.crc32.append(inputData);\n\t\t}\n\t\treturn data;\n\t}\n\n\tasync flush() {\n\t\tconst codec = this;\n\t\tlet signature;\n\t\tlet data = new Uint8Array(0);\n\t\tif (codec.compressed) {\n\t\t\tdata = (await codec.deflate.flush()) || new Uint8Array(0);\n\t\t}\n\t\tif (codec.encrypted) {\n\t\t\tdata = await codec.encrypt.append(data);\n\t\t\tconst result = codec.encrypt.flush();\n\t\t\tsignature = result.signature;\n\t\t\tconst newData = new Uint8Array(data.length + result.data.length);\n\t\t\tnewData.set(data, 0);\n\t\t\tnewData.set(result.data, data.length);\n\t\t\tdata = newData;\n\t\t}\n\t\tif ((!codec.encrypted || codec.zipCrypto) && codec.signed) {\n\t\t\tsignature = codec.crc32.get();\n\t\t}\n\t\treturn { data, signature };\n\t}\n}\n\nexport {\n\tInflate,\n\tDeflate,\n\tcreateCodec,\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nfunction createCodec(codecConstructor, options, config) {\n\tif (options.codecType.startsWith(CODEC_DEFLATE)) {\n\t\treturn new Deflate(codecConstructor, options, config);\n\t} else if (options.codecType.startsWith(CODEC_INFLATE)) {\n\t\treturn new Inflate(codecConstructor, options, config);\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Worker, URL */\n\nimport { createCodec } from \"./codec.js\";\n\nconst MESSAGE_INIT = \"init\";\nconst MESSAGE_APPEND = \"append\";\nconst MESSAGE_FLUSH = \"flush\";\nconst MESSAGE_EVENT_TYPE = \"message\";\n\nlet classicWorkersSupported = true;\n\nexport default (workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts) => {\n\tObject.assign(workerData, {\n\t\tbusy: true,\n\t\tcodecConstructor,\n\t\toptions: Object.assign({}, options),\n\t\tscripts,\n\t\tterminate() {\n\t\t\tif (workerData.worker && !workerData.busy) {\n\t\t\t\tworkerData.worker.terminate();\n\t\t\t\tworkerData.interface = null;\n\t\t\t}\n\t\t},\n\t\tonTaskFinished() {\n\t\t\tworkerData.busy = false;\n\t\t\tonTaskFinished(workerData);\n\t\t}\n\t});\n\treturn webWorker ? createWebWorkerInterface(workerData, config) : createWorkerInterface(workerData, config);\n};\n\nfunction createWorkerInterface(workerData, config) {\n\tconst interfaceCodec = createCodec(workerData.codecConstructor, workerData.options, config);\n\treturn {\n\t\tasync append(data) {\n\t\t\ttry {\n\t\t\t\treturn await interfaceCodec.append(data);\n\t\t\t} catch (error) {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tasync flush() {\n\t\t\ttry {\n\t\t\t\treturn await interfaceCodec.flush();\n\t\t\t} finally {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t}\n\t\t},\n\t\tabort() {\n\t\t\tworkerData.onTaskFinished();\n\t\t}\n\t};\n}\n\nfunction createWebWorkerInterface(workerData, config) {\n\tlet messageTask;\n\tconst workerOptions = { type: \"module\" };\n\tif (!workerData.interface) {\n\t\tif (!classicWorkersSupported) {\n\t\t\tworkerData.worker = getWorker(workerOptions, config.baseURL);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tworkerData.worker = getWorker({}, config.baseURL);\n\t\t\t} catch (_error) {\n\t\t\t\tclassicWorkersSupported = false;\n\t\t\t\tworkerData.worker = getWorker(workerOptions, config.baseURL);\n\t\t\t}\n\t\t}\n\t\tworkerData.worker.addEventListener(MESSAGE_EVENT_TYPE, onMessage, false);\n\t\tworkerData.interface = {\n\t\t\tappend(data) {\n\t\t\t\treturn initAndSendMessage({ type: MESSAGE_APPEND, data });\n\t\t\t},\n\t\t\tflush() {\n\t\t\t\treturn initAndSendMessage({ type: MESSAGE_FLUSH });\n\t\t\t},\n\t\t\tabort() {\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t}\n\t\t};\n\t}\n\treturn workerData.interface;\n\n\tfunction getWorker(options, baseURL) {\n\t\tlet url, scriptUrl;\n\t\turl = workerData.scripts[0];\n\t\tif (typeof url == \"function\") {\n\t\t\turl = url();\n\t\t}\n\t\ttry {\n\t\t\tscriptUrl = new URL(url, baseURL);\n\t\t} catch (_error) {\n\t\t\tscriptUrl = url;\n\t\t}\n\t\treturn new Worker(scriptUrl, options);\n\t}\n\n\tasync function initAndSendMessage(message) {\n\t\tif (!messageTask) {\n\t\t\tconst options = workerData.options;\n\t\t\tconst scripts = workerData.scripts.slice(1);\n\t\t\tawait sendMessage({ scripts, type: MESSAGE_INIT, options, config: { chunkSize: config.chunkSize } });\n\t\t}\n\t\treturn sendMessage(message);\n\t}\n\n\tfunction sendMessage(message) {\n\t\tconst worker = workerData.worker;\n\t\tconst result = new Promise((resolve, reject) => messageTask = { resolve, reject });\n\t\ttry {\n\t\t\tif (message.data) {\n\t\t\t\ttry {\n\t\t\t\t\tmessage.data = message.data.buffer;\n\t\t\t\t\tworker.postMessage(message, [message.data]);\n\t\t\t\t} catch (_error) {\n\t\t\t\t\tworker.postMessage(message);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tworker.postMessage(message);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tmessageTask.reject(error);\n\t\t\tmessageTask = null;\n\t\t\tworkerData.onTaskFinished();\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction onMessage(event) {\n\t\tconst message = event.data;\n\t\tif (messageTask) {\n\t\t\tconst reponseError = message.error;\n\t\t\tconst type = message.type;\n\t\t\tif (reponseError) {\n\t\t\t\tconst error = new Error(reponseError.message);\n\t\t\t\terror.stack = reponseError.stack;\n\t\t\t\tmessageTask.reject(error);\n\t\t\t\tmessageTask = null;\n\t\t\t\tworkerData.onTaskFinished();\n\t\t\t} else if (type == MESSAGE_INIT || type == MESSAGE_FLUSH || type == MESSAGE_APPEND) {\n\t\t\t\tconst data = message.data;\n\t\t\t\tif (type == MESSAGE_FLUSH) {\n\t\t\t\t\tmessageTask.resolve({ data: new Uint8Array(data), signature: message.signature });\n\t\t\t\t\tmessageTask = null;\n\t\t\t\t\tworkerData.onTaskFinished();\n\t\t\t\t} else {\n\t\t\t\t\tmessageTask.resolve(data && new Uint8Array(data));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global setTimeout, clearTimeout */\n\nimport { CODEC_INFLATE, CODEC_DEFLATE, ERR_INVALID_SIGNATURE, ERR_INVALID_PASSWORD } from \"./codec.js\";\nimport getWorker from \"./codec-pool-worker.js\";\n\nlet pool = [];\nconst pendingRequests = [];\n\nexport {\n\tcreateCodec,\n\tterminateWorkers,\n\tCODEC_DEFLATE,\n\tCODEC_INFLATE,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nfunction createCodec(codecConstructor, options, config) {\n\tconst streamCopy = !options.compressed && !options.signed && !options.encrypted;\n\tconst webWorker = !streamCopy && (options.useWebWorkers || (options.useWebWorkers === undefined && config.useWebWorkers));\n\tconst scripts = webWorker && config.workerScripts ? config.workerScripts[options.codecType] : [];\n\tif (pool.length < config.maxWorkers) {\n\t\tconst workerData = {};\n\t\tpool.push(workerData);\n\t\treturn getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts);\n\t} else {\n\t\tconst workerData = pool.find(workerData => !workerData.busy);\n\t\tif (workerData) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\treturn getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts);\n\t\t} else {\n\t\t\treturn new Promise(resolve => pendingRequests.push({ resolve, codecConstructor, options, webWorker, scripts }));\n\t\t}\n\t}\n\n\tfunction onTaskFinished(workerData) {\n\t\tif (pendingRequests.length) {\n\t\t\tconst [{ resolve, codecConstructor, options, webWorker, scripts }] = pendingRequests.splice(0, 1);\n\t\t\tresolve(getWorker(workerData, codecConstructor, options, config, onTaskFinished, webWorker, scripts));\n\t\t} else if (workerData.worker) {\n\t\t\tclearTerminateTimeout(workerData);\n\t\t\tif (Number.isFinite(config.terminateWorkerTimeout) && config.terminateWorkerTimeout >= 0) {\n\t\t\t\tworkerData.terminateTimeout = setTimeout(() => {\n\t\t\t\t\tpool = pool.filter(data => data != workerData);\n\t\t\t\t\tworkerData.terminate();\n\t\t\t\t}, config.terminateWorkerTimeout);\n\t\t\t}\n\t\t} else {\n\t\t\tpool = pool.filter(data => data != workerData);\n\t\t}\n\t}\n}\n\nfunction clearTerminateTimeout(workerData) {\n\tif (workerData.terminateTimeout) {\n\t\tclearTimeout(workerData.terminateTimeout);\n\t\tworkerData.terminateTimeout = null;\n\t}\n}\n\nfunction terminateWorkers() {\n\tpool.forEach(workerData => {\n\t\tclearTerminateTimeout(workerData);\n\t\tworkerData.terminate();\n\t});\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst MINIMUM_CHUNK_SIZE = 64;\nconst ERR_ABORT = \"Abort error\";\n\nexport {\n\tERR_ABORT,\n\tprocessData\n};\n\nasync function processData(codec, reader, writer, offset, inputLengthGetter, config, options) {\n\tconst chunkSize = Math.max(config.chunkSize, MINIMUM_CHUNK_SIZE);\n\treturn processChunk();\n\n\tasync function processChunk(chunkOffset = 0, outputLength = 0) {\n\t\tconst signal = options.signal;\n\t\tconst inputLength = inputLengthGetter();\n\t\tif (chunkOffset < inputLength) {\n\t\t\ttestAborted(signal, codec);\n\t\t\tconst inputData = await reader.readUint8Array(chunkOffset + offset, Math.min(chunkSize, inputLength - chunkOffset));\n\t\t\tconst chunkLength = inputData.length;\n\t\t\ttestAborted(signal, codec);\n\t\t\tconst data = await codec.append(inputData);\n\t\t\ttestAborted(signal, codec);\n\t\t\toutputLength += await writeData(writer, data);\n\t\t\tif (options.onprogress) {\n\t\t\t\ttry {\n\t\t\t\t\toptions.onprogress(chunkOffset + chunkLength, inputLength);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn processChunk(chunkOffset + chunkSize, outputLength);\n\t\t} else {\n\t\t\tconst result = await codec.flush();\n\t\t\toutputLength += await writeData(writer, result.data);\n\t\t\treturn { signature: result.signature, length: outputLength };\n\t\t}\n\t}\n}\n\nfunction testAborted(signal, codec) {\n\tif (signal && signal.aborted) {\n\t\tcodec.abort();\n\t\tthrow new Error(ERR_ABORT);\n\t}\n}\n\nasync function writeData(writer, data) {\n\tif (data.length) {\n\t\tawait writer.writeUint8Array(data);\n\t}\n\treturn data.length;\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global Blob, FileReader, atob, btoa, XMLHttpRequest, document, fetch */\n\nconst ERR_HTTP_STATUS = \"HTTP error \";\nconst ERR_HTTP_RANGE = \"HTTP Range not supported\";\nconst ERR_NOT_SEEKABLE_READER = \"Reader is not seekable\";\n\nconst CONTENT_TYPE_TEXT_PLAIN = \"text/plain\";\nconst HTTP_HEADER_CONTENT_LENGTH = \"Content-Length\";\nconst HTTP_HEADER_CONTENT_RANGE = \"Content-Range\";\nconst HTTP_HEADER_ACCEPT_RANGES = \"Accept-Ranges\";\nconst HTTP_HEADER_RANGE = \"Range\";\nconst HTTP_METHOD_HEAD = \"HEAD\";\nconst HTTP_METHOD_GET = \"GET\";\nconst HTTP_RANGE_UNIT = \"bytes\";\n\nclass Stream {\n\n\tconstructor() {\n\t\tthis.size = 0;\n\t}\n\n\tinit() {\n\t\tthis.initialized = true;\n\t}\n}\n\nclass Reader extends Stream {\n}\n\nclass Writer extends Stream {\n\n\twriteUint8Array(array) {\n\t\tthis.size += array.length;\n\t}\n}\n\nclass TextReader extends Reader {\n\n\tconstructor(text) {\n\t\tsuper();\n\t\tthis.blobReader = new BlobReader(new Blob([text], { type: CONTENT_TYPE_TEXT_PLAIN }));\n\t}\n\n\tinit() {\n\t\tsuper.init();\n\t\tthis.blobReader.init();\n\t\tthis.size = this.blobReader.size;\n\t}\n\n\treadUint8Array(offset, length) {\n\t\treturn this.blobReader.readUint8Array(offset, length);\n\t}\n}\n\nclass TextWriter extends Writer {\n\n\tconstructor(encoding) {\n\t\tsuper();\n\t\tthis.encoding = encoding;\n\t\tthis.blob = new Blob([], { type: CONTENT_TYPE_TEXT_PLAIN });\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tthis.blob = new Blob([this.blob, array.buffer], { type: CONTENT_TYPE_TEXT_PLAIN });\n\t}\n\n\tgetData() {\n\t\tif (this.blob.text) {\n\t\t\treturn this.blob.text();\n\t\t} else {\n\t\t\tconst reader = new FileReader();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treader.onload = event => resolve(event.target.result);\n\t\t\t\treader.onerror = () => reject(reader.error);\n\t\t\t\treader.readAsText(this.blob, this.encoding);\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass Data64URIReader extends Reader {\n\n\tconstructor(dataURI) {\n\t\tsuper();\n\t\tthis.dataURI = dataURI;\n\t\tlet dataEnd = dataURI.length;\n\t\twhile (dataURI.charAt(dataEnd - 1) == \"=\") {\n\t\t\tdataEnd--;\n\t\t}\n\t\tthis.dataStart = dataURI.indexOf(\",\") + 1;\n\t\tthis.size = Math.floor((dataEnd - this.dataStart) * 0.75);\n\t}\n\n\treadUint8Array(offset, length) {\n\t\tconst dataArray = new Uint8Array(length);\n\t\tconst start = Math.floor(offset / 3) * 4;\n\t\tconst bytes = atob(this.dataURI.substring(start + this.dataStart, Math.ceil((offset + length) / 3) * 4 + this.dataStart));\n\t\tconst delta = offset - Math.floor(start / 4) * 3;\n\t\tfor (let indexByte = delta; indexByte < delta + length; indexByte++) {\n\t\t\tdataArray[indexByte - delta] = bytes.charCodeAt(indexByte);\n\t\t}\n\t\treturn dataArray;\n\t}\n}\n\nclass Data64URIWriter extends Writer {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tthis.data = \"data:\" + (contentType || \"\") + \";base64,\";\n\t\tthis.pending = [];\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tlet indexArray = 0;\n\t\tlet dataString = this.pending;\n\t\tconst delta = this.pending.length;\n\t\tthis.pending = \"\";\n\t\tfor (indexArray = 0; indexArray < (Math.floor((delta + array.length) / 3) * 3) - delta; indexArray++) {\n\t\t\tdataString += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tfor (; indexArray < array.length; indexArray++) {\n\t\t\tthis.pending += String.fromCharCode(array[indexArray]);\n\t\t}\n\t\tif (dataString.length > 2) {\n\t\t\tthis.data += btoa(dataString);\n\t\t} else {\n\t\t\tthis.pending = dataString;\n\t\t}\n\t}\n\n\tgetData() {\n\t\treturn this.data + btoa(this.pending);\n\t}\n}\n\nclass BlobReader extends Reader {\n\n\tconstructor(blob) {\n\t\tsuper();\n\t\tthis.blob = blob;\n\t\tthis.size = blob.size;\n\t}\n\n\tasync readUint8Array(offset, length) {\n\t\tif (this.blob.arrayBuffer) {\n\t\t\treturn new Uint8Array(await this.blob.slice(offset, offset + length).arrayBuffer());\n\t\t} else {\n\t\t\tconst reader = new FileReader();\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\treader.onload = event => resolve(new Uint8Array(event.target.result));\n\t\t\t\treader.onerror = () => reject(reader.error);\n\t\t\t\treader.readAsArrayBuffer(this.blob.slice(offset, offset + length));\n\t\t\t});\n\t\t}\n\t}\n}\n\nclass BlobWriter extends Writer {\n\n\tconstructor(contentType) {\n\t\tsuper();\n\t\tthis.contentType = contentType;\n\t\tthis.arrayBuffersMaxlength = 8;\n\t\tinitArrayBuffers(this);\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tif (this.arrayBuffers.length == this.arrayBuffersMaxlength) {\n\t\t\tflushArrayBuffers(this);\n\t\t}\n\t\tthis.arrayBuffers.push(array.buffer);\n\t}\n\n\tgetData() {\n\t\tif (!this.blob) {\n\t\t\tif (this.arrayBuffers.length) {\n\t\t\t\tflushArrayBuffers(this);\n\t\t\t}\n\t\t\tthis.blob = this.pendingBlob;\n\t\t\tinitArrayBuffers(this);\n\t\t}\n\t\treturn this.blob;\n\t}\n}\n\nfunction initArrayBuffers(blobWriter) {\n\tblobWriter.pendingBlob = new Blob([], { type: blobWriter.contentType });\n\tblobWriter.arrayBuffers = [];\n}\n\nfunction flushArrayBuffers(blobWriter) {\n\tblobWriter.pendingBlob = new Blob([blobWriter.pendingBlob, ...blobWriter.arrayBuffers], { type: blobWriter.contentType });\n\tblobWriter.arrayBuffers = [];\n}\n\nclass ReadableStreamReader {\n\n\tconstructor(readableStream) {\n\t\tthis.readableStream = readableStream;\n\t\tthis.reader = readableStream.getReader();\n\t\tthis.size = Infinity;\n\t\tthis.index = 0;\n\t\tthis.currentSize = 0;\n\t\tthis.pendingValue = new Uint8Array();\n\t}\n\n\tinit() {\n\t\tthis.initialized = true;\n\t}\n\n\tasync readUint8Array(index, length) {\n\t\tif (this.index != index) {\n\t\t\tthrow new Error(ERR_NOT_SEEKABLE_READER);\n\t\t}\n\t\tlet data = new Uint8Array(length);\n\t\tlet size = 0, done;\n\t\tdo {\n\t\t\tconst result = await this.reader.read();\n\t\t\tlet { value } = result;\n\t\t\tdone = result.done;\n\t\t\tif (value) {\n\t\t\t\tthis.currentSize += value.length;\n\t\t\t} else {\n\t\t\t\tvalue = this.pendingValue;\n\t\t\t\tthis.pendingValue = new Uint8Array();\n\t\t\t}\n\t\t\tif (this.pendingValue.length) {\n\t\t\t\tconst newValue = new Uint8Array(this.pendingValue.length + value.length);\n\t\t\t\tnewValue.set(this.pendingValue);\n\t\t\t\tnewValue.set(value, this.pendingValue.length);\n\t\t\t\tthis.pendingValue = new Uint8Array();\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif (size + value.length > length) {\n\t\t\t\tdata.set(value.subarray(0, length), size);\n\t\t\t\tthis.pendingValue = value.subarray(length);\n\t\t\t\tsize += length;\n\t\t\t} else {\n\t\t\t\tdata.set(value, size);\n\t\t\t\tsize += value.length;\n\t\t\t}\n\t\t} while (size < length && !done);\n\t\tif (done && this.size == Infinity) {\n\t\t\tthis.size = this.currentSize;\n\t\t}\n\t\tif (this.size < length) {\n\t\t\tdata = data.slice(0, this.size);\n\t\t\tlength = this.size;\n\t\t}\n\t\tthis.index += length;\n\t\treturn data;\n\t}\n}\n\nclass WritableStreamWriter extends Writer {\n\n\tconstructor(writableStream) {\n\t\tsuper();\n\t\tthis.writableStream = writableStream;\n\t\tthis.writer = writableStream.getWriter();\n\t}\n\n\tasync writeUint8Array(array) {\n\t\tawait this.writer.ready;\n\t\treturn this.writer.write(array);\n\t}\n\n\tasync getData() {\n\t\tawait this.writer.ready;\n\t\tawait this.writer.close();\n\t\treturn this.writableStream;\n\t}\n}\n\nclass FetchReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tthis.preventHeadRequest = options.preventHeadRequest;\n\t\tthis.useRangeHeader = options.useRangeHeader;\n\t\tthis.forceRangeRequests = options.forceRangeRequests;\n\t\tthis.options = Object.assign({}, options);\n\t\tdelete this.options.preventHeadRequest;\n\t\tdelete this.options.useRangeHeader;\n\t\tdelete this.options.forceRangeRequests;\n\t\tdelete this.options.useXHR;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait initHttpReader(this, sendFetchRequest, getFetchRequestData);\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendFetchRequest, getFetchRequestData);\n\t}\n}\n\nclass XHRReader extends Reader {\n\n\tconstructor(url, options) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tthis.preventHeadRequest = options.preventHeadRequest;\n\t\tthis.useRangeHeader = options.useRangeHeader;\n\t\tthis.forceRangeRequests = options.forceRangeRequests;\n\t\tthis.options = options;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait initHttpReader(this, sendXMLHttpRequest, getXMLHttpRequestData);\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn readUint8ArrayHttpReader(this, index, length, sendXMLHttpRequest, getXMLHttpRequestData);\n\t}\n}\n\nasync function initHttpReader(httpReader, sendRequest, getRequestData) {\n\tif (isHttpFamily(httpReader.url) && (httpReader.useRangeHeader || httpReader.forceRangeRequests)) {\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader));\n\t\tif (!httpReader.forceRangeRequests && response.headers.get(HTTP_HEADER_ACCEPT_RANGES) != HTTP_RANGE_UNIT) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t} else {\n\t\t\tlet contentSize;\n\t\t\tconst contentRangeHeader = response.headers.get(HTTP_HEADER_CONTENT_RANGE);\n\t\t\tif (contentRangeHeader) {\n\t\t\t\tconst splitHeader = contentRangeHeader.trim().split(/\\s*\\/\\s*/);\n\t\t\t\tif (splitHeader.length) {\n\t\t\t\t\tconst headerValue = splitHeader[1];\n\t\t\t\t\tif (headerValue && headerValue != \"*\") {\n\t\t\t\t\t\tcontentSize = Number(headerValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (contentSize === undefined) {\n\t\t\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t\t\t} else {\n\t\t\t\thttpReader.size = contentSize;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tawait getContentLength(httpReader, sendRequest, getRequestData);\n\t}\n}\n\nasync function readUint8ArrayHttpReader(httpReader, index, length, sendRequest, getRequestData) {\n\tif (httpReader.useRangeHeader || httpReader.forceRangeRequests) {\n\t\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, index, length));\n\t\tif (response.status != 206) {\n\t\t\tthrow new Error(ERR_HTTP_RANGE);\n\t\t}\n\t\treturn new Uint8Array(await response.arrayBuffer());\n\t} else {\n\t\tif (!httpReader.data) {\n\t\t\tawait getRequestData(httpReader, httpReader.options);\n\t\t}\n\t\treturn new Uint8Array(httpReader.data.subarray(index, index + length));\n\t}\n}\n\nfunction getRangeHeaders(httpReader, index = 0, length = 1) {\n\treturn Object.assign({}, getHeaders(httpReader), { [HTTP_HEADER_RANGE]: HTTP_RANGE_UNIT + \"=\" + index + \"-\" + (index + length - 1) });\n}\n\nfunction getHeaders(httpReader) {\n\tconst headers = httpReader.options.headers;\n\tif (headers) {\n\t\tif (Symbol.iterator in headers) {\n\t\t\treturn Object.fromEntries(headers);\n\t\t} else {\n\t\t\treturn headers;\n\t\t}\n\t}\n}\n\nasync function getFetchRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendFetchRequest);\n}\n\nasync function getXMLHttpRequestData(httpReader) {\n\tawait getRequestData(httpReader, sendXMLHttpRequest);\n}\n\nasync function getRequestData(httpReader, sendRequest) {\n\tconst response = await sendRequest(HTTP_METHOD_GET, httpReader, getHeaders(httpReader));\n\thttpReader.data = new Uint8Array(await response.arrayBuffer());\n\tif (!httpReader.size) {\n\t\thttpReader.size = httpReader.data.length;\n\t}\n}\n\nasync function getContentLength(httpReader, sendRequest, getRequestData) {\n\tif (httpReader.preventHeadRequest) {\n\t\tawait getRequestData(httpReader, httpReader.options);\n\t} else {\n\t\tconst response = await sendRequest(HTTP_METHOD_HEAD, httpReader, getHeaders(httpReader));\n\t\tconst contentLength = response.headers.get(HTTP_HEADER_CONTENT_LENGTH);\n\t\tif (contentLength) {\n\t\t\thttpReader.size = Number(contentLength);\n\t\t} else {\n\t\t\tawait getRequestData(httpReader, httpReader.options);\n\t\t}\n\t}\n}\n\nasync function sendFetchRequest(method, { options, url }, headers) {\n\tconst response = await fetch(url, Object.assign({}, options, { method, headers }));\n\tif (response.status < 400) {\n\t\treturn response;\n\t} else {\n\t\tthrow new Error(ERR_HTTP_STATUS + (response.statusText || response.status));\n\t}\n}\n\nfunction sendXMLHttpRequest(method, { url }, headers) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\trequest.addEventListener(\"load\", () => {\n\t\t\tif (request.status < 400) {\n\t\t\t\tconst headers = [];\n\t\t\t\trequest.getAllResponseHeaders().trim().split(/[\\r\\n]+/).forEach(header => {\n\t\t\t\t\tconst splitHeader = header.trim().split(/\\s*:\\s*/);\n\t\t\t\t\tsplitHeader[0] = splitHeader[0].trim().replace(/^[a-z]|-[a-z]/g, value => value.toUpperCase());\n\t\t\t\t\theaders.push(splitHeader);\n\t\t\t\t});\n\t\t\t\tresolve({\n\t\t\t\t\tstatus: request.status,\n\t\t\t\t\tarrayBuffer: () => request.response,\n\t\t\t\t\theaders: new Map(headers)\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(new Error(ERR_HTTP_STATUS + (request.statusText || request.status)));\n\t\t\t}\n\t\t}, false);\n\t\trequest.addEventListener(\"error\", event => reject(event.detail.error), false);\n\t\trequest.open(method, url);\n\t\tif (headers) {\n\t\t\tfor (const entry of Object.entries(headers)) {\n\t\t\t\trequest.setRequestHeader(entry[0], entry[1]);\n\t\t\t}\n\t\t}\n\t\trequest.responseType = \"arraybuffer\";\n\t\trequest.send();\n\t});\n}\n\nclass HttpReader extends Reader {\n\n\tconstructor(url, options = {}) {\n\t\tsuper();\n\t\tthis.url = url;\n\t\tif (options.useXHR) {\n\t\t\tthis.reader = new XHRReader(url, options);\n\t\t} else {\n\t\t\tthis.reader = new FetchReader(url, options);\n\t\t}\n\t}\n\n\tset size(value) {\n\t\t// ignored\n\t}\n\n\tget size() {\n\t\treturn this.reader.size;\n\t}\n\n\tasync init() {\n\t\tsuper.init();\n\t\tawait this.reader.init();\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.reader.readUint8Array(index, length);\n\t}\n}\n\nclass HttpRangeReader extends HttpReader {\n\n\tconstructor(url, options = {}) {\n\t\toptions.useRangeHeader = true;\n\t\tsuper(url, options);\n\t}\n}\n\n\nclass Uint8ArrayReader extends Reader {\n\n\tconstructor(array) {\n\t\tsuper();\n\t\tthis.array = array;\n\t\tthis.size = array.length;\n\t}\n\n\treadUint8Array(index, length) {\n\t\treturn this.array.slice(index, index + length);\n\t}\n}\n\nclass Uint8ArrayWriter extends Writer {\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.array = new Uint8Array(0);\n\t}\n\n\twriteUint8Array(array) {\n\t\tsuper.writeUint8Array(array);\n\t\tconst previousArray = this.array;\n\t\tthis.array = new Uint8Array(previousArray.length + array.length);\n\t\tthis.array.set(previousArray);\n\t\tthis.array.set(array, previousArray.length);\n\t}\n\n\tgetData() {\n\t\treturn this.array;\n\t}\n}\n\nfunction isHttpFamily(url) {\n\tif (typeof document != \"undefined\") {\n\t\tconst anchor = document.createElement(\"a\");\n\t\tanchor.href = url;\n\t\treturn anchor.protocol == \"http:\" || anchor.protocol == \"https:\";\n\t} else {\n\t\treturn /^https?:\\/\\//i.test(url);\n\t}\n}\n\nexport {\n\tReader,\n\tWriter,\n\tTextReader,\n\tTextWriter,\n\tData64URIReader,\n\tData64URIWriter,\n\tBlobReader,\n\tBlobWriter,\n\tUint8ArrayReader,\n\tUint8ArrayWriter,\n\tHttpReader,\n\tHttpRangeReader,\n\tReadableStreamReader,\n\tWritableStreamWriter,\n\tERR_HTTP_RANGE,\n\tERR_NOT_SEEKABLE_READER\n};\n", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst MAX_32_BITS = 0xffffffff;\nconst MAX_16_BITS = 0xffff;\nconst COMPRESSION_METHOD_DEFLATE = 0x08;\nconst COMPRESSION_METHOD_STORE = 0x00;\nconst COMPRESSION_METHOD_AES = 0x63;\n\nconst LOCAL_FILE_HEADER_SIGNATURE = 0x04034b50;\nconst DATA_DESCRIPTOR_RECORD_SIGNATURE = 0x08074b50;\nconst CENTRAL_FILE_HEADER_SIGNATURE = 0x02014b50;\nconst END_OF_CENTRAL_DIR_SIGNATURE = 0x06054b50;\nconst ZIP64_END_OF_CENTRAL_DIR_SIGNATURE = 0x06064b50;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE = 0x07064b50;\nconst END_OF_CENTRAL_DIR_LENGTH = 22;\nconst ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH = 20;\nconst ZIP64_END_OF_CENTRAL_DIR_LENGTH = 56;\nconst ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH = END_OF_CENTRAL_DIR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\nconst ZIP64_TOTAL_NUMBER_OF_DISKS = 1;\n\nconst EXTRAFIELD_TYPE_ZIP64 = 0x0001;\nconst EXTRAFIELD_TYPE_AES = 0x9901;\nconst EXTRAFIELD_TYPE_NTFS = 0x000a;\nconst EXTRAFIELD_TYPE_NTFS_TAG1 = 0x0001;\nconst EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP = 0x5455;\nconst EXTRAFIELD_TYPE_UNICODE_PATH = 0x7075;\nconst EXTRAFIELD_TYPE_UNICODE_COMMENT = 0x6375;\n\nconst BITFLAG_ENCRYPTED = 0x01;\nconst BITFLAG_LEVEL = 0x06;\nconst BITFLAG_DATA_DESCRIPTOR = 0x0008;\nconst BITFLAG_LANG_ENCODING_FLAG = 0x0800;\nconst FILE_ATTR_MSDOS_DIR_MASK = 0x10;\n\nconst VERSION_DEFLATE = 0x14;\nconst VERSION_ZIP64 = 0x2D;\nconst VERSION_AES = 0x33;\n\nconst DIRECTORY_SIGNATURE = \"/\";\n\nconst MAX_DATE = new Date(2107, 11, 31);\nconst MIN_DATE = new Date(1980, 0, 1);\n\nexport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tDATA_DESCRIPTOR_RECORD_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH,\n\tZIP64_TOTAL_NUMBER_OF_DISKS,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tVERSION_DEFLATE,\n\tVERSION_ZIP64,\n\tVERSION_AES,\n\tDIRECTORY_SIGNATURE,\n\tMIN_DATE,\n\tMAX_DATE\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst CP437 = \"\\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\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\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0 \".split(\"\");\n\nexport default stringValue => {\n\tlet result = \"\";\n\tfor (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {\n\t\tresult += CP437[stringValue[indexCharacter]];\n\t}\n\treturn result;\n};", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global TextDecoder, FileReader, Blob */\n\nimport decodeCP437 from \"./cp437-decode.js\";\n\nexport default decodeText;\n\nfunction decodeText(value, encoding) {\n\tif (encoding && encoding.trim().toLowerCase() == \"cp437\") {\n\t\treturn decodeCP437(value);\n\t} else if (typeof TextDecoder == \"undefined\") {\n\t\tconst fileReader = new FileReader();\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfileReader.onload = event => resolve(event.target.result);\n\t\t\tfileReader.onerror = () => reject(fileReader.error);\n\t\t\tfileReader.readAsText(new Blob([value]));\n\t\t});\n\t} else {\n\t\treturn new TextDecoder(encoding).decode(value);\n\t}\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst PROPERTY_NAMES = [\n\t\"filename\", \"rawFilename\", \"directory\", \"encrypted\", \"compressedSize\", \"uncompressedSize\",\n\t\"lastModDate\", \"rawLastModDate\", \"comment\", \"rawComment\", \"signature\", \"extraField\",\n\t\"rawExtraField\", \"bitFlag\", \"extraFieldZip64\", \"extraFieldUnicodePath\", \"extraFieldUnicodeComment\",\n\t\"extraFieldAES\", \"filenameUTF8\", \"commentUTF8\", \"offset\", \"zip64\", \"compressionMethod\",\n\t\"extraFieldNTFS\", \"lastAccessDate\", \"creationDate\", \"extraFieldExtendedTimestamp\",\n\t\"version\", \"versionMadeBy\", \"msDosCompatible\", \"internalFileAttribute\", \"externalFileAttribute\"];\n\nexport default class Entry {\n\n\tconstructor(data) {\n\t\tPROPERTY_NAMES.forEach(name => this[name] = data[name]);\n\t}\n\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global BigInt */\n\nimport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_UNICODE_PATH,\n\tEXTRAFIELD_TYPE_UNICODE_COMMENT,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_LEVEL,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tDIRECTORY_SIGNATURE\n} from \"./constants.js\";\nimport { getConfiguration } from \"./configuration.js\";\nimport { createCodec, CODEC_INFLATE, ERR_INVALID_SIGNATURE, ERR_INVALID_PASSWORD } from \"./codecs/codec-pool.js\";\nimport decodeText from \"./util/decode-text.js\";\nimport Crc32 from \"./codecs/crc32.js\";\nimport { processData } from \"./engine.js\";\nimport Entry from \"./zip-entry.js\";\n\nconst ERR_BAD_FORMAT = \"File format is not recognized\";\nconst ERR_EOCDR_NOT_FOUND = \"End of central directory not found\";\nconst ERR_EOCDR_ZIP64_NOT_FOUND = \"End of Zip64 central directory not found\";\nconst ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = \"End of Zip64 central directory locator not found\";\nconst ERR_CENTRAL_DIRECTORY_NOT_FOUND = \"Central directory header not found\";\nconst ERR_LOCAL_FILE_HEADER_NOT_FOUND = \"Local file header not found\";\nconst ERR_EXTRAFIELD_ZIP64_NOT_FOUND = \"Zip64 extra field not found\";\nconst ERR_ENCRYPTED = \"File contains encrypted entry\";\nconst ERR_UNSUPPORTED_ENCRYPTION = \"Encryption method not supported\";\nconst ERR_UNSUPPORTED_COMPRESSION = \"Compression method not supported\";\nconst CHARSET_UTF8 = \"utf-8\";\nconst CHARSET_CP437 = \"cp437\";\nconst ZIP64_PROPERTIES = [\"uncompressedSize\", \"compressedSize\", \"offset\"];\n\nclass ZipReader {\n\n\tconstructor(reader, options = {}) {\n\t\tObject.assign(this, {\n\t\t\treader,\n\t\t\toptions,\n\t\t\tconfig: getConfiguration()\n\t\t});\n\t}\n\n\tasync* getEntriesGenerator(options = {}) {\n\t\tconst zipReader = this;\n\t\tconst reader = zipReader.reader;\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tif (reader.size < END_OF_CENTRAL_DIR_LENGTH) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tconst endOfDirectoryInfo = await seekSignature(reader, END_OF_CENTRAL_DIR_SIGNATURE, reader.size, END_OF_CENTRAL_DIR_LENGTH, MAX_16_BITS * 16);\n\t\tif (!endOfDirectoryInfo) {\n\t\t\tthrow new Error(ERR_EOCDR_NOT_FOUND);\n\t\t}\n\t\tconst endOfDirectoryView = getDataView(endOfDirectoryInfo);\n\t\tlet directoryDataLength = getUint32(endOfDirectoryView, 12);\n\t\tlet directoryDataOffset = getUint32(endOfDirectoryView, 16);\n\t\tlet filesLength = getUint16(endOfDirectoryView, 8);\n\t\tlet prependedDataLength = 0;\n\t\tif (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || filesLength == MAX_16_BITS) {\n\t\t\tconst endOfDirectoryLocatorArray = await readUint8Array(reader, endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH);\n\t\t\tconst endOfDirectoryLocatorView = getDataView(endOfDirectoryLocatorArray);\n\t\t\tif (getUint32(endOfDirectoryLocatorView, 0) != ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_EOCDR_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t\tdirectoryDataOffset = getBigUint64(endOfDirectoryLocatorView, 8);\n\t\t\tlet endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);\n\t\t\tlet endOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH - ZIP64_END_OF_CENTRAL_DIR_LENGTH;\n\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\tprependedDataLength = directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\tendOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);\n\t\t\t\tendOfDirectoryView = getDataView(endOfDirectoryArray);\n\t\t\t}\n\t\t\tif (getUint32(endOfDirectoryView, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t\tfilesLength = getBigUint64(endOfDirectoryView, 32);\n\t\t\tdirectoryDataLength = getBigUint64(endOfDirectoryView, 40);\n\t\t\tdirectoryDataOffset -= directoryDataLength;\n\t\t}\n\t\tif (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tlet offset = 0;\n\t\tlet directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);\n\t\tlet directoryView = getDataView(directoryArray);\n\t\tif (directoryDataLength) {\n\t\t\tconst expectedDirectoryDataOffset = endOfDirectoryInfo.offset - directoryDataLength;\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {\n\t\t\t\tconst originalDirectoryDataOffset = directoryDataOffset;\n\t\t\t\tdirectoryDataOffset = expectedDirectoryDataOffset;\n\t\t\t\tprependedDataLength = directoryDataOffset - originalDirectoryDataOffset;\n\t\t\t\tdirectoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);\n\t\t\t\tdirectoryView = getDataView(directoryArray);\n\t\t\t}\n\t\t}\n\t\tif (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {\n\t\t\tthrow new Error(ERR_BAD_FORMAT);\n\t\t}\n\t\tfor (let indexFile = 0; indexFile < filesLength; indexFile++) {\n\t\t\tconst fileEntry = new ZipEntry(reader, zipReader.config, zipReader.options);\n\t\t\tif (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE) {\n\t\t\t\tthrow new Error(ERR_CENTRAL_DIRECTORY_NOT_FOUND);\n\t\t\t}\n\t\t\treadCommonHeader(fileEntry, directoryView, offset + 6);\n\t\t\tconst languageEncodingFlag = Boolean(fileEntry.bitFlag.languageEncodingFlag);\n\t\t\tconst filenameOffset = offset + 46;\n\t\t\tconst extraFieldOffset = filenameOffset + fileEntry.filenameLength;\n\t\t\tconst commentOffset = extraFieldOffset + fileEntry.extraFieldLength;\n\t\t\tconst versionMadeBy = getUint16(directoryView, offset + 4);\n\t\t\tconst msDosCompatible = (versionMadeBy & 0) == 0;\n\t\t\tObject.assign(fileEntry, {\n\t\t\t\tversionMadeBy,\n\t\t\t\tmsDosCompatible,\n\t\t\t\tcompressedSize: 0,\n\t\t\t\tuncompressedSize: 0,\n\t\t\t\tcommentLength: getUint16(directoryView, offset + 32),\n\t\t\t\tdirectory: msDosCompatible && ((getUint8(directoryView, offset + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK),\n\t\t\t\toffset: getUint32(directoryView, offset + 42) + prependedDataLength,\n\t\t\t\tinternalFileAttribute: getUint32(directoryView, offset + 34),\n\t\t\t\texternalFileAttribute: getUint32(directoryView, offset + 38),\n\t\t\t\trawFilename: directoryArray.subarray(filenameOffset, extraFieldOffset),\n\t\t\t\tfilenameUTF8: languageEncodingFlag,\n\t\t\t\tcommentUTF8: languageEncodingFlag,\n\t\t\t\trawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)\n\t\t\t});\n\t\t\tconst endOffset = commentOffset + fileEntry.commentLength;\n\t\t\tfileEntry.rawComment = directoryArray.subarray(commentOffset, endOffset);\n\t\t\tconst filenameEncoding = getOptionValue(zipReader, options, \"filenameEncoding\");\n\t\t\tconst commentEncoding = getOptionValue(zipReader, options, \"commentEncoding\");\n\t\t\tconst [filename, comment] = await Promise.all([\n\t\t\t\tdecodeText(fileEntry.rawFilename, fileEntry.filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),\n\t\t\t\tdecodeText(fileEntry.rawComment, fileEntry.commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)\n\t\t\t]);\n\t\t\tfileEntry.filename = filename;\n\t\t\tfileEntry.comment = comment;\n\t\t\tif (!fileEntry.directory && fileEntry.filename.endsWith(DIRECTORY_SIGNATURE)) {\n\t\t\t\tfileEntry.directory = true;\n\t\t\t}\n\t\t\tawait readCommonFooter(fileEntry, fileEntry, directoryView, offset + 6);\n\t\t\tconst entry = new Entry(fileEntry);\n\t\t\tentry.getData = (writer, options) => fileEntry.getData(writer, entry, options);\n\t\t\toffset = endOffset;\n\t\t\tif (options.onprogress) {\n\t\t\t\ttry {\n\t\t\t\t\toptions.onprogress(indexFile + 1, filesLength, new Entry(fileEntry));\n\t\t\t\t} catch (_error) {\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield entry;\n\t\t}\n\t\treturn true;\n\t}\n\n\tasync getEntries(options = {}) {\n\t\tconst entries = [];\n\t\tconst iter = this.getEntriesGenerator(options);\n\t\tlet curr = iter.next();\n\t\twhile(!(await curr).done) {\n\t\t\tentries.push((await curr).value);\n\t\t\tcurr = iter.next();\n\t\t}\n\t\treturn entries;\n\t}\n\n\tasync close() {\n\t}\n}\n\nexport {\n\tZipReader,\n\tERR_BAD_FORMAT,\n\tERR_EOCDR_NOT_FOUND,\n\tERR_EOCDR_ZIP64_NOT_FOUND,\n\tERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,\n\tERR_CENTRAL_DIRECTORY_NOT_FOUND,\n\tERR_LOCAL_FILE_HEADER_NOT_FOUND,\n\tERR_EXTRAFIELD_ZIP64_NOT_FOUND,\n\tERR_ENCRYPTED,\n\tERR_UNSUPPORTED_ENCRYPTION,\n\tERR_UNSUPPORTED_COMPRESSION,\n\tERR_INVALID_SIGNATURE,\n\tERR_INVALID_PASSWORD\n};\n\nclass ZipEntry {\n\n\tconstructor(reader, config, options) {\n\t\tObject.assign(this, {\n\t\t\treader,\n\t\t\tconfig,\n\t\t\toptions\n\t\t});\n\t}\n\n\tasync getData(writer, fileEntry, options = {}) {\n\t\tconst zipEntry = this;\n\t\tconst {\n\t\t\treader,\n\t\t\toffset,\n\t\t\textraFieldAES,\n\t\t\tcompressionMethod,\n\t\t\tconfig,\n\t\t\tbitFlag,\n\t\t\tsignature,\n\t\t\trawLastModDate,\n\t\t\tcompressedSize\n\t\t} = zipEntry;\n\t\tconst localDirectory = zipEntry.localDirectory = {};\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tlet dataArray = await readUint8Array(reader, offset, 30);\n\t\tconst dataView = getDataView(dataArray);\n\t\tlet password = getOptionValue(zipEntry, options, \"password\");\n\t\tpassword = password && password.length && password;\n\t\tif (extraFieldAES) {\n\t\t\tif (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t\t}\n\t\t}\n\t\tif (compressionMethod != COMPRESSION_METHOD_STORE && compressionMethod != COMPRESSION_METHOD_DEFLATE) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_COMPRESSION);\n\t\t}\n\t\tif (getUint32(dataView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {\n\t\t\tthrow new Error(ERR_LOCAL_FILE_HEADER_NOT_FOUND);\n\t\t}\n\t\treadCommonHeader(localDirectory, dataView, 4);\n\t\tdataArray = await readUint8Array(reader, offset, 30 + localDirectory.filenameLength + localDirectory.extraFieldLength);\n\t\tlocalDirectory.rawExtraField = dataArray.subarray(30 + localDirectory.filenameLength);\n\t\tawait readCommonFooter(zipEntry, localDirectory, dataView, 4);\n\t\tfileEntry.lastAccessDate = localDirectory.lastAccessDate;\n\t\tfileEntry.creationDate = localDirectory.creationDate;\n\t\tconst encrypted = zipEntry.encrypted && localDirectory.encrypted;\n\t\tconst zipCrypto = encrypted && !extraFieldAES;\n\t\tif (encrypted) {\n\t\t\tif (!zipCrypto && extraFieldAES.strength === undefined) {\n\t\t\t\tthrow new Error(ERR_UNSUPPORTED_ENCRYPTION);\n\t\t\t} else if (!password) {\n\t\t\t\tthrow new Error(ERR_ENCRYPTED);\n\t\t\t}\n\t\t}\n\t\tconst codec = await createCodec(config.Inflate, {\n\t\t\tcodecType: CODEC_INFLATE,\n\t\t\tpassword,\n\t\t\tzipCrypto,\n\t\t\tencryptionStrength: extraFieldAES && extraFieldAES.strength,\n\t\t\tsigned: getOptionValue(zipEntry, options, \"checkSignature\"),\n\t\t\tpasswordVerification: zipCrypto && (bitFlag.dataDescriptor ? ((rawLastModDate >>> 8) & 0xFF) : ((signature >>> 24) & 0xFF)),\n\t\t\tsignature,\n\t\t\tcompressed: compressionMethod != 0,\n\t\t\tencrypted,\n\t\t\tuseWebWorkers: getOptionValue(zipEntry, options, \"useWebWorkers\")\n\t\t}, config);\n\t\tif (!writer.initialized) {\n\t\t\tawait writer.init();\n\t\t}\n\t\tconst signal = getOptionValue(zipEntry, options, \"signal\");\n\t\tconst dataOffset = offset + 30 + localDirectory.filenameLength + localDirectory.extraFieldLength;\n\t\tawait processData(codec, reader, writer, dataOffset, () => compressedSize, config, { onprogress: options.onprogress, signal });\n\t\treturn writer.getData();\n\t}\n}\n\nfunction readCommonHeader(directory, dataView, offset) {\n\tconst rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset + 2);\n\tconst encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;\n\tconst rawLastModDate = getUint32(dataView, offset + 6);\n\tObject.assign(directory, {\n\t\tencrypted,\n\t\tversion: getUint16(dataView, offset),\n\t\tbitFlag: {\n\t\t\tlevel: (rawBitFlag & BITFLAG_LEVEL) >> 1,\n\t\t\tdataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,\n\t\t\tlanguageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG\n\t\t},\n\t\trawLastModDate,\n\t\tlastModDate: getDate(rawLastModDate),\n\t\tfilenameLength: getUint16(dataView, offset + 22),\n\t\textraFieldLength: getUint16(dataView, offset + 24)\n\t});\n}\n\nasync function readCommonFooter(fileEntry, directory, dataView, offset) {\n\tconst rawExtraField = directory.rawExtraField;\n\tconst extraField = directory.extraField = new Map();\n\tconst rawExtraFieldView = getDataView(new Uint8Array(rawExtraField));\n\tlet offsetExtraField = 0;\n\ttry {\n\t\twhile (offsetExtraField < rawExtraField.length) {\n\t\t\tconst type = getUint16(rawExtraFieldView, offsetExtraField);\n\t\t\tconst size = getUint16(rawExtraFieldView, offsetExtraField + 2);\n\t\t\textraField.set(type, {\n\t\t\t\ttype,\n\t\t\t\tdata: rawExtraField.slice(offsetExtraField + 4, offsetExtraField + 4 + size)\n\t\t\t});\n\t\t\toffsetExtraField += 4 + size;\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n\tconst compressionMethod = getUint16(dataView, offset + 4);\n\tdirectory.signature = getUint32(dataView, offset + 10);\n\tdirectory.uncompressedSize = getUint32(dataView, offset + 18);\n\tdirectory.compressedSize = getUint32(dataView, offset + 14);\n\tconst extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);\n\tif (extraFieldZip64) {\n\t\treadExtraFieldZip64(extraFieldZip64, directory);\n\t\tdirectory.extraFieldZip64 = extraFieldZip64;\n\t}\n\tconst extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);\n\tif (extraFieldUnicodePath) {\n\t\tawait readExtraFieldUnicode(extraFieldUnicodePath, \"filename\", \"rawFilename\", directory, fileEntry);\n\t\tdirectory.extraFieldUnicodePath = extraFieldUnicodePath;\n\t}\n\tconst extraFieldUnicodeComment = extraField.get(EXTRAFIELD_TYPE_UNICODE_COMMENT);\n\tif (extraFieldUnicodeComment) {\n\t\tawait readExtraFieldUnicode(extraFieldUnicodeComment, \"comment\", \"rawComment\", directory, fileEntry);\n\t\tdirectory.extraFieldUnicodeComment = extraFieldUnicodeComment;\n\t}\n\tconst extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);\n\tif (extraFieldAES) {\n\t\treadExtraFieldAES(extraFieldAES, directory, compressionMethod);\n\t\tdirectory.extraFieldAES = extraFieldAES;\n\t} else {\n\t\tdirectory.compressionMethod = compressionMethod;\n\t}\n\tconst extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);\n\tif (extraFieldNTFS) {\n\t\treadExtraFieldNTFS(extraFieldNTFS, directory);\n\t\tdirectory.extraFieldNTFS = extraFieldNTFS;\n\t}\n\tconst extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\tif (extraFieldExtendedTimestamp) {\n\t\treadExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory);\n\t\tdirectory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;\n\t}\n}\n\nfunction readExtraFieldZip64(extraFieldZip64, directory) {\n\tdirectory.zip64 = true;\n\tconst extraFieldView = getDataView(extraFieldZip64.data);\n\textraFieldZip64.values = [];\n\tfor (let indexValue = 0; indexValue < Math.floor(extraFieldZip64.data.length / 8); indexValue++) {\n\t\textraFieldZip64.values.push(getBigUint64(extraFieldView, 0 + indexValue * 8));\n\t}\n\tconst missingProperties = ZIP64_PROPERTIES.filter(propertyName => directory[propertyName] == MAX_32_BITS);\n\tfor (let indexMissingProperty = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {\n\t\textraFieldZip64[missingProperties[indexMissingProperty]] = extraFieldZip64.values[indexMissingProperty];\n\t}\n\tZIP64_PROPERTIES.forEach(propertyName => {\n\t\tif (directory[propertyName] == MAX_32_BITS) {\n\t\t\tif (extraFieldZip64[propertyName] !== undefined) {\n\t\t\t\tdirectory[propertyName] = extraFieldZip64[propertyName];\n\t\t\t} else {\n\t\t\t\tthrow new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);\n\t\t\t}\n\t\t}\n\t});\n}\n\nasync function readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {\n\tconst extraFieldView = getDataView(extraFieldUnicode.data);\n\textraFieldUnicode.version = getUint8(extraFieldView, 0);\n\textraFieldUnicode.signature = getUint32(extraFieldView, 1);\n\tconst crc32 = new Crc32();\n\tcrc32.append(fileEntry[rawPropertyName]);\n\tconst dataViewSignature = getDataView(new Uint8Array(4));\n\tdataViewSignature.setUint32(0, crc32.get(), true);\n\textraFieldUnicode[propertyName] = await decodeText(extraFieldUnicode.data.subarray(5));\n\textraFieldUnicode.valid = !fileEntry.bitFlag.languageEncodingFlag && extraFieldUnicode.signature == getUint32(dataViewSignature, 0);\n\tif (extraFieldUnicode.valid) {\n\t\tdirectory[propertyName] = extraFieldUnicode[propertyName];\n\t\tdirectory[propertyName + \"UTF8\"] = true;\n\t}\n}\n\nfunction readExtraFieldAES(extraFieldAES, directory, compressionMethod) {\n\tconst extraFieldView = getDataView(extraFieldAES.data);\n\textraFieldAES.vendorVersion = getUint8(extraFieldView, 0);\n\textraFieldAES.vendorId = getUint8(extraFieldView, 2);\n\tconst strength = getUint8(extraFieldView, 4);\n\textraFieldAES.strength = strength;\n\textraFieldAES.originalCompressionMethod = compressionMethod;\n\tdirectory.compressionMethod = extraFieldAES.compressionMethod = getUint16(extraFieldView, 5);\n}\n\nfunction readExtraFieldNTFS(extraFieldNTFS, directory) {\n\tconst extraFieldView = getDataView(extraFieldNTFS.data);\n\tlet offsetExtraField = 4;\n\tlet tag1Data;\n\ttry {\n\t\twhile (offsetExtraField < extraFieldNTFS.data.length && !tag1Data) {\n\t\t\tconst tagValue = getUint16(extraFieldView, offsetExtraField);\n\t\t\tconst attributeSize = getUint16(extraFieldView, offsetExtraField + 2);\n\t\t\tif (tagValue == EXTRAFIELD_TYPE_NTFS_TAG1) {\n\t\t\t\ttag1Data = extraFieldNTFS.data.slice(offsetExtraField + 4, offsetExtraField + 4 + attributeSize);\n\t\t\t}\n\t\t\toffsetExtraField += 4 + attributeSize;\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n\ttry {\n\t\tif (tag1Data && tag1Data.length == 24) {\n\t\t\tconst tag1View = getDataView(tag1Data);\n\t\t\tconst rawLastModDate = tag1View.getBigUint64(0, true);\n\t\t\tconst rawLastAccessDate = tag1View.getBigUint64(8, true);\n\t\t\tconst rawCreationDate = tag1View.getBigUint64(16, true);\n\t\t\tObject.assign(extraFieldNTFS, {\n\t\t\t\trawLastModDate,\n\t\t\t\trawLastAccessDate,\n\t\t\t\trawCreationDate\n\t\t\t});\n\t\t\tconst lastModDate = getDateNTFS(rawLastModDate);\n\t\t\tconst lastAccessDate = getDateNTFS(rawLastAccessDate);\n\t\t\tconst creationDate = getDateNTFS(rawCreationDate);\n\t\t\tconst extraFieldData = { lastModDate, lastAccessDate, creationDate };\n\t\t\tObject.assign(extraFieldNTFS, extraFieldData);\n\t\t\tObject.assign(directory, extraFieldData);\n\t\t}\n\t} catch (_error) {\n\t\t// ignored\n\t}\n}\n\nfunction readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory) {\n\tconst extraFieldView = getDataView(extraFieldExtendedTimestamp.data);\n\tconst flags = getUint8(extraFieldView, 0);\n\tconst timeProperties = [];\n\tconst timeRawProperties = [];\n\tif ((flags & 0x1) == 0x1) {\n\t\ttimeProperties.push(\"lastModDate\");\n\t\ttimeRawProperties.push(\"rawLastModDate\");\n\t}\n\tif ((flags & 0x2) == 0x2) {\n\t\ttimeProperties.push(\"lastAccessDate\");\n\t\ttimeRawProperties.push(\"rawLastAccessDate\");\n\t}\n\tif ((flags & 0x4) == 0x4) {\n\t\ttimeProperties.push(\"creationDate\");\n\t\ttimeRawProperties.push(\"rawCreationDate\");\n\t}\n\tlet offset = 1;\n\ttimeProperties.forEach((propertyName, indexProperty) => {\n\t\tif (extraFieldExtendedTimestamp.data.length >= offset + 4) {\n\t\t\tconst time = getUint32(extraFieldView, offset);\n\t\t\tdirectory[propertyName] = extraFieldExtendedTimestamp[propertyName] = new Date(time * 1000);\n\t\t\tconst rawPropertyName = timeRawProperties[indexProperty];\n\t\t\textraFieldExtendedTimestamp[rawPropertyName] = time;\n\t\t}\n\t\toffset += 4;\n\t});\n}\n\nasync function seekSignature(reader, signature, startOffset, minimumBytes, maximumLength) {\n\tconst signatureArray = new Uint8Array(4);\n\tconst signatureView = getDataView(signatureArray);\n\tsetUint32(signatureView, 0, signature);\n\tconst maximumBytes = minimumBytes + maximumLength;\n\treturn (await seek(minimumBytes)) || await seek(Math.min(maximumBytes, startOffset));\n\n\tasync function seek(length) {\n\t\tconst offset = startOffset - length;\n\t\tconst bytes = await readUint8Array(reader, offset, length);\n\t\tfor (let indexByte = bytes.length - minimumBytes; indexByte >= 0; indexByte--) {\n\t\t\tif (bytes[indexByte] == signatureArray[0] && bytes[indexByte + 1] == signatureArray[1] &&\n\t\t\t\tbytes[indexByte + 2] == signatureArray[2] && bytes[indexByte + 3] == signatureArray[3]) {\n\t\t\t\treturn {\n\t\t\t\t\toffset: offset + indexByte,\n\t\t\t\t\tbuffer: bytes.slice(indexByte, indexByte + minimumBytes).buffer\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getOptionValue(zipReader, options, name) {\n\treturn options[name] === undefined ? zipReader.options[name] : options[name];\n}\n\nfunction getDate(timeRaw) {\n\tconst date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;\n\ttry {\n\t\treturn new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);\n\t} catch (_error) {\n\t\t// ignored\n\t}\n}\n\nfunction getDateNTFS(timeRaw) {\n\treturn new Date((Number((timeRaw / BigInt(10000)) - BigInt(11644473600000))));\n}\n\nfunction getUint8(view, offset) {\n\treturn view.getUint8(offset);\n}\n\nfunction getUint16(view, offset) {\n\treturn view.getUint16(offset, true);\n}\n\nfunction getUint32(view, offset) {\n\treturn view.getUint32(offset, true);\n}\n\nfunction getBigUint64(view, offset) {\n\treturn Number(view.getBigUint64(offset, true));\n}\n\nfunction setUint32(view, offset, value) {\n\tview.setUint32(offset, value, true);\n}\n\nfunction getDataView(array) {\n\treturn new DataView(array.buffer);\n}\n\nfunction readUint8Array(reader, offset, size) {\n\treturn reader.readUint8Array(offset, size);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* global BigInt, FileReader */\n\nimport {\n\tMAX_32_BITS,\n\tMAX_16_BITS,\n\tCOMPRESSION_METHOD_DEFLATE,\n\tCOMPRESSION_METHOD_STORE,\n\tCOMPRESSION_METHOD_AES,\n\tLOCAL_FILE_HEADER_SIGNATURE,\n\tDATA_DESCRIPTOR_RECORD_SIGNATURE,\n\tCENTRAL_FILE_HEADER_SIGNATURE,\n\tEND_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,\n\tZIP64_END_OF_CENTRAL_DIR_SIGNATURE,\n\tZIP64_TOTAL_NUMBER_OF_DISKS,\n\tEXTRAFIELD_TYPE_AES,\n\tEXTRAFIELD_TYPE_ZIP64,\n\tEXTRAFIELD_TYPE_EXTENDED_TIMESTAMP,\n\tEXTRAFIELD_TYPE_NTFS,\n\tEXTRAFIELD_TYPE_NTFS_TAG1,\n\tEND_OF_CENTRAL_DIR_LENGTH,\n\tZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH,\n\tBITFLAG_ENCRYPTED,\n\tBITFLAG_DATA_DESCRIPTOR,\n\tBITFLAG_LANG_ENCODING_FLAG,\n\tFILE_ATTR_MSDOS_DIR_MASK,\n\tVERSION_DEFLATE,\n\tVERSION_ZIP64,\n\tVERSION_AES,\n\tDIRECTORY_SIGNATURE,\n\tMIN_DATE,\n\tMAX_DATE\n} from \"./constants.js\";\nimport { getConfiguration } from \"./configuration.js\";\nimport { CODEC_DEFLATE, createCodec } from \"./codecs/codec-pool.js\";\nimport encodeText from \"./util/encode-text.js\";\nimport { BlobWriter } from \"./io.js\";\nimport { processData } from \"./engine.js\";\nimport Entry from \"./zip-entry.js\";\n\nconst ERR_DUPLICATED_NAME = \"File already exists\";\nconst ERR_INVALID_COMMENT = \"Zip file comment exceeds 64KB\";\nconst ERR_INVALID_ENTRY_COMMENT = \"File entry comment exceeds 64KB\";\nconst ERR_INVALID_ENTRY_NAME = \"File entry name exceeds 64KB\";\nconst ERR_INVALID_VERSION = \"Version exceeds 65535\";\nconst ERR_INVALID_ENCRYPTION_STRENGTH = \"The strength must equal 1, 2, or 3\";\nconst ERR_INVALID_EXTRAFIELD_TYPE = \"Extra field type exceeds 65535\";\nconst ERR_INVALID_EXTRAFIELD_DATA = \"Extra field data exceeds 64KB\";\nconst ERR_UNSUPPORTED_FORMAT = \"Zip64 is not supported\";\n\nconst EXTRAFIELD_DATA_AES = new Uint8Array([0x07, 0x00, 0x02, 0x00, 0x41, 0x45, 0x03, 0x00, 0x00]);\nconst EXTRAFIELD_LENGTH_ZIP64 = 24;\n\nlet workers = 0;\n\nclass ZipWriter {\n\n\tconstructor(writer, options = {}) {\n\t\tObject.assign(this, {\n\t\t\twriter,\n\t\t\toptions,\n\t\t\tconfig: getConfiguration(),\n\t\t\tfiles: new Map(),\n\t\t\toffset: writer.size,\n\t\t\tpendingCompressedSize: 0,\n\t\t\tpendingEntries: [],\n\t\t\tpendingAddFileCalls: new Set()\n\t\t});\n\t}\n\n\tasync add(name = \"\", reader, options = {}) {\n\t\tconst zipWriter = this;\n\t\tif (workers < zipWriter.config.maxWorkers) {\n\t\t\tworkers++;\n\t\t\tlet promiseAddFile;\n\t\t\ttry {\n\t\t\t\tpromiseAddFile = addFile(zipWriter, name, reader, options);\n\t\t\t\tthis.pendingAddFileCalls.add(promiseAddFile);\n\t\t\t\treturn await promiseAddFile;\n\t\t\t} finally {\n\t\t\t\tthis.pendingAddFileCalls.delete(promiseAddFile);\n\t\t\t\tworkers--;\n\t\t\t\tconst pendingEntry = zipWriter.pendingEntries.shift();\n\t\t\t\tif (pendingEntry) {\n\t\t\t\t\tzipWriter.add(pendingEntry.name, pendingEntry.reader, pendingEntry.options)\n\t\t\t\t\t\t.then(pendingEntry.resolve)\n\t\t\t\t\t\t.catch(pendingEntry.reject);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Promise((resolve, reject) => zipWriter.pendingEntries.push({ name, reader, options, resolve, reject }));\n\t\t}\n\t}\n\n\tasync close(comment = new Uint8Array(0), options = {}) {\n\t\twhile (this.pendingAddFileCalls.size) {\n\t\t\tawait Promise.all(Array.from(this.pendingAddFileCalls));\n\t\t}\n\t\tawait closeFile(this, comment, options);\n\t\treturn this.writer.getData();\n\t}\n}\n\nexport {\n\tZipWriter,\n\tERR_DUPLICATED_NAME,\n\tERR_INVALID_COMMENT,\n\tERR_INVALID_ENTRY_NAME,\n\tERR_INVALID_ENTRY_COMMENT,\n\tERR_INVALID_VERSION,\n\tERR_INVALID_EXTRAFIELD_TYPE,\n\tERR_INVALID_EXTRAFIELD_DATA,\n\tERR_INVALID_ENCRYPTION_STRENGTH,\n\tERR_UNSUPPORTED_FORMAT\n};\n\nasync function addFile(zipWriter, name, reader, options) {\n\tname = name.trim();\n\tif (options.directory && (!name.endsWith(DIRECTORY_SIGNATURE))) {\n\t\tname += DIRECTORY_SIGNATURE;\n\t} else {\n\t\toptions.directory = name.endsWith(DIRECTORY_SIGNATURE);\n\t}\n\tif (zipWriter.files.has(name)) {\n\t\tthrow new Error(ERR_DUPLICATED_NAME);\n\t}\n\tconst rawFilename = encodeText(name);\n\tif (rawFilename.length > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_ENTRY_NAME);\n\t}\n\tconst comment = options.comment || \"\";\n\tconst rawComment = encodeText(comment);\n\tif (rawComment.length > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_ENTRY_COMMENT);\n\t}\n\tconst version = zipWriter.options.version || options.version || 0;\n\tif (version > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_VERSION);\n\t}\n\tconst versionMadeBy = zipWriter.options.versionMadeBy || options.versionMadeBy || 20;\n\tif (versionMadeBy > MAX_16_BITS) {\n\t\tthrow new Error(ERR_INVALID_VERSION);\n\t}\n\tconst lastModDate = getOptionValue(zipWriter, options, \"lastModDate\") || new Date();\n\tconst lastAccessDate = getOptionValue(zipWriter, options, \"lastAccessDate\");\n\tconst creationDate = getOptionValue(zipWriter, options, \"creationDate\");\n\tconst password = getOptionValue(zipWriter, options, \"password\");\n\tconst encryptionStrength = getOptionValue(zipWriter, options, \"encryptionStrength\") || 3;\n\tconst zipCrypto = getOptionValue(zipWriter, options, \"zipCrypto\");\n\tif (password !== undefined && encryptionStrength !== undefined && (encryptionStrength < 1 || encryptionStrength > 3)) {\n\t\tthrow new Error(ERR_INVALID_ENCRYPTION_STRENGTH);\n\t}\n\tlet rawExtraField = new Uint8Array(0);\n\tconst extraField = options.extraField;\n\tif (extraField) {\n\t\tlet extraFieldSize = 0;\n\t\tlet offset = 0;\n\t\textraField.forEach(data => extraFieldSize += 4 + data.length);\n\t\trawExtraField = new Uint8Array(extraFieldSize);\n\t\textraField.forEach((data, type) => {\n\t\t\tif (type > MAX_16_BITS) {\n\t\t\t\tthrow new Error(ERR_INVALID_EXTRAFIELD_TYPE);\n\t\t\t}\n\t\t\tif (data.length > MAX_16_BITS) {\n\t\t\t\tthrow new Error(ERR_INVALID_EXTRAFIELD_DATA);\n\t\t\t}\n\t\t\tarraySet(rawExtraField, new Uint16Array([type]), offset);\n\t\t\tarraySet(rawExtraField, new Uint16Array([data.length]), offset + 2);\n\t\t\tarraySet(rawExtraField, data, offset + 4);\n\t\t\toffset += 4 + data.length;\n\t\t});\n\t}\n\tlet extendedTimestamp = getOptionValue(zipWriter, options, \"extendedTimestamp\");\n\tif (extendedTimestamp === undefined) {\n\t\textendedTimestamp = true;\n\t}\n\tlet maximumCompressedSize = 0;\n\tlet keepOrder = getOptionValue(zipWriter, options, \"keepOrder\");\n\tif (keepOrder === undefined) {\n\t\tkeepOrder = true;\n\t}\n\tlet uncompressedSize = 0;\n\tlet msDosCompatible = getOptionValue(zipWriter, options, \"msDosCompatible\");\n\tif (msDosCompatible === undefined) {\n\t\tmsDosCompatible = true;\n\t}\n\tconst internalFileAttribute = getOptionValue(zipWriter, options, \"internalFileAttribute\") || 0;\n\tconst externalFileAttribute = getOptionValue(zipWriter, options, \"externalFileAttribute\") || 0;\n\tif (reader) {\n\t\tif (!reader.initialized) {\n\t\t\tawait reader.init();\n\t\t}\n\t\tuncompressedSize = reader.size;\n\t\tmaximumCompressedSize = getMaximumCompressedSize(uncompressedSize);\n\t}\n\tlet zip64 = options.zip64 || zipWriter.options.zip64 || false;\n\tif (zipWriter.offset + zipWriter.pendingCompressedSize >= MAX_32_BITS ||\n\t\tuncompressedSize >= MAX_32_BITS ||\n\t\tmaximumCompressedSize >= MAX_32_BITS) {\n\t\tif (options.zip64 === false || zipWriter.options.zip64 === false || !keepOrder) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t} else {\n\t\t\tzip64 = true;\n\t\t}\n\t}\n\tzipWriter.pendingCompressedSize += maximumCompressedSize;\n\tawait Promise.resolve();\n\tconst level = getOptionValue(zipWriter, options, \"level\");\n\tconst useWebWorkers = getOptionValue(zipWriter, options, \"useWebWorkers\");\n\tconst bufferedWrite = getOptionValue(zipWriter, options, \"bufferedWrite\");\n\tlet dataDescriptor = getOptionValue(zipWriter, options, \"dataDescriptor\");\n\tlet dataDescriptorSignature = getOptionValue(zipWriter, options, \"dataDescriptorSignature\");\n\tconst signal = getOptionValue(zipWriter, options, \"signal\");\n\tif (dataDescriptor === undefined) {\n\t\tdataDescriptor = true;\n\t}\n\tif (dataDescriptor && dataDescriptorSignature === undefined) {\n\t\tdataDescriptorSignature = false;\n\t}\n\tconst fileEntry = await getFileEntry(zipWriter, name, reader, Object.assign({}, options, {\n\t\trawFilename,\n\t\trawComment,\n\t\tversion,\n\t\tversionMadeBy,\n\t\tlastModDate,\n\t\tlastAccessDate,\n\t\tcreationDate,\n\t\trawExtraField,\n\t\tzip64,\n\t\tpassword,\n\t\tlevel,\n\t\tuseWebWorkers,\n\t\tencryptionStrength,\n\t\textendedTimestamp,\n\t\tzipCrypto,\n\t\tbufferedWrite,\n\t\tkeepOrder,\n\t\tdataDescriptor,\n\t\tdataDescriptorSignature,\n\t\tsignal,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t}));\n\tif (maximumCompressedSize) {\n\t\tzipWriter.pendingCompressedSize -= maximumCompressedSize;\n\t}\n\tObject.assign(fileEntry, { name, comment, extraField });\n\treturn new Entry(fileEntry);\n}\n\nasync function getFileEntry(zipWriter, name, reader, options) {\n\tconst files = zipWriter.files;\n\tconst writer = zipWriter.writer;\n\tconst previousFileEntry = Array.from(files.values()).pop();\n\tlet fileEntry = {};\n\tlet bufferedWrite;\n\tlet resolveLockUnbufferedWrite;\n\tlet resolveLockCurrentFileEntry;\n\tfiles.set(name, fileEntry);\n\ttry {\n\t\tlet lockPreviousFileEntry;\n\t\tlet fileWriter;\n\t\tlet lockCurrentFileEntry;\n\t\tif (options.keepOrder) {\n\t\t\tlockPreviousFileEntry = previousFileEntry && previousFileEntry.lock;\n\t\t}\n\t\tfileEntry.lock = lockCurrentFileEntry = new Promise(resolve => resolveLockCurrentFileEntry = resolve);\n\t\tif (options.bufferedWrite || zipWriter.lockWrite || !options.dataDescriptor) {\n\t\t\tfileWriter = new BlobWriter();\n\t\t\tfileWriter.init();\n\t\t\tbufferedWrite = true;\n\t\t} else {\n\t\t\tzipWriter.lockWrite = new Promise(resolve => resolveLockUnbufferedWrite = resolve);\n\t\t\tif (!writer.initialized) {\n\t\t\t\tawait writer.init();\n\t\t\t}\n\t\t\tfileWriter = writer;\n\t\t}\n\t\tfileEntry = await createFileEntry(reader, fileWriter, zipWriter.config, options);\n\t\tfileEntry.lock = lockCurrentFileEntry;\n\t\tfiles.set(name, fileEntry);\n\t\tfileEntry.filename = name;\n\t\tif (bufferedWrite) {\n\t\t\tlet indexWrittenData = 0;\n\t\t\tconst blob = fileWriter.getData();\n\t\t\tawait Promise.all([zipWriter.lockWrite, lockPreviousFileEntry]);\n\t\t\tlet pendingFileEntry;\n\t\t\tdo {\n\t\t\t\tpendingFileEntry = Array.from(files.values()).find(fileEntry => fileEntry.writingBufferedData);\n\t\t\t\tif (pendingFileEntry) {\n\t\t\t\t\tawait pendingFileEntry.lock;\n\t\t\t\t}\n\t\t\t} while (pendingFileEntry && pendingFileEntry.lock);\n\t\t\tfileEntry.writingBufferedData = true;\n\t\t\tif (!options.dataDescriptor) {\n\t\t\t\tconst headerLength = 26;\n\t\t\t\tconst arrayBuffer = await sliceAsArrayBuffer(blob, 0, headerLength);\n\t\t\t\tconst arrayBufferView = new DataView(arrayBuffer);\n\t\t\t\tif (!fileEntry.encrypted || options.zipCrypto) {\n\t\t\t\t\tsetUint32(arrayBufferView, 14, fileEntry.signature);\n\t\t\t\t}\n\t\t\t\tif (fileEntry.zip64) {\n\t\t\t\t\tsetUint32(arrayBufferView, 18, MAX_32_BITS);\n\t\t\t\t\tsetUint32(arrayBufferView, 22, MAX_32_BITS);\n\t\t\t\t} else {\n\t\t\t\t\tsetUint32(arrayBufferView, 18, fileEntry.compressedSize);\n\t\t\t\t\tsetUint32(arrayBufferView, 22, fileEntry.uncompressedSize);\n\t\t\t\t}\n\t\t\t\tawait writer.writeUint8Array(new Uint8Array(arrayBuffer));\n\t\t\t\tindexWrittenData = headerLength;\n\t\t\t}\n\t\t\tawait writeBlob(writer, blob, indexWrittenData);\n\t\t\tdelete fileEntry.writingBufferedData;\n\t\t}\n\t\tfileEntry.offset = zipWriter.offset;\n\t\tif (fileEntry.zip64) {\n\t\t\tconst rawExtraFieldZip64View = getDataView(fileEntry.rawExtraFieldZip64);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 20, BigInt(fileEntry.offset));\n\t\t} else if (fileEntry.offset >= MAX_32_BITS) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t}\n\t\tzipWriter.offset += fileEntry.length;\n\t\treturn fileEntry;\n\t} catch (error) {\n\t\tif ((bufferedWrite && fileEntry.writingBufferedData) || (!bufferedWrite && fileEntry.dataWritten)) {\n\t\t\terror.corruptedEntry = zipWriter.hasCorruptedEntries = true;\n\t\t\tif (fileEntry.uncompressedSize) {\n\t\t\t\tzipWriter.offset += fileEntry.uncompressedSize;\n\t\t\t}\n\t\t}\n\t\tfiles.delete(name);\n\t\tthrow error;\n\t} finally {\n\t\tresolveLockCurrentFileEntry();\n\t\tif (resolveLockUnbufferedWrite) {\n\t\t\tresolveLockUnbufferedWrite();\n\t\t}\n\t}\n}\n\nasync function createFileEntry(reader, writer, config, options) {\n\tconst {\n\t\trawFilename,\n\t\tlastAccessDate,\n\t\tcreationDate,\n\t\tpassword,\n\t\tlevel,\n\t\tzip64,\n\t\tzipCrypto,\n\t\tdataDescriptor,\n\t\tdataDescriptorSignature,\n\t\tdirectory,\n\t\tversion,\n\t\tversionMadeBy,\n\t\trawComment,\n\t\trawExtraField,\n\t\tuseWebWorkers,\n\t\tonprogress,\n\t\tsignal,\n\t\tencryptionStrength,\n\t\textendedTimestamp,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t} = options;\n\tconst encrypted = Boolean(password && password.length);\n\tconst compressed = level !== 0 && !directory;\n\tlet rawExtraFieldAES;\n\tif (encrypted && !zipCrypto) {\n\t\trawExtraFieldAES = new Uint8Array(EXTRAFIELD_DATA_AES.length + 2);\n\t\tconst extraFieldAESView = getDataView(rawExtraFieldAES);\n\t\tsetUint16(extraFieldAESView, 0, EXTRAFIELD_TYPE_AES);\n\t\tarraySet(rawExtraFieldAES, EXTRAFIELD_DATA_AES, 2);\n\t\tsetUint8(extraFieldAESView, 8, encryptionStrength);\n\t} else {\n\t\trawExtraFieldAES = new Uint8Array(0);\n\t}\n\tlet rawExtraFieldNTFS;\n\tlet rawExtraFieldExtendedTimestamp;\n\tif (extendedTimestamp) {\n\t\trawExtraFieldExtendedTimestamp = new Uint8Array(9 + (lastAccessDate ? 4 : 0) + (creationDate ? 4 : 0));\n\t\tconst extraFieldExtendedTimestampView = getDataView(rawExtraFieldExtendedTimestamp);\n\t\tsetUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\t\tsetUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);\n\t\tconst extraFieldExtendedTimestampFlag = 0x1 + (lastAccessDate ? 0x2 : 0) + (creationDate ? 0x4 : 0);\n\t\tsetUint8(extraFieldExtendedTimestampView, 4, extraFieldExtendedTimestampFlag);\n\t\tsetUint32(extraFieldExtendedTimestampView, 5, Math.floor(options.lastModDate.getTime() / 1000));\n\t\tif (lastAccessDate) {\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 9, Math.floor(lastAccessDate.getTime() / 1000));\n\t\t}\n\t\tif (creationDate) {\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 13, Math.floor(creationDate.getTime() / 1000));\n\t\t}\n\t\ttry {\n\t\t\trawExtraFieldNTFS = new Uint8Array(36);\n\t\t\tconst extraFieldNTFSView = getDataView(rawExtraFieldNTFS);\n\t\t\tconst lastModTimeNTFS = getTimeNTFS(options.lastModDate);\n\t\t\tsetUint16(extraFieldNTFSView, 0, EXTRAFIELD_TYPE_NTFS);\n\t\t\tsetUint16(extraFieldNTFSView, 2, 32);\n\t\t\tsetUint16(extraFieldNTFSView, 8, EXTRAFIELD_TYPE_NTFS_TAG1);\n\t\t\tsetUint16(extraFieldNTFSView, 10, 24);\n\t\t\tsetBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);\n\t\t\tsetBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);\n\t\t\tsetBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);\n\t\t} catch (_error) {\n\t\t\trawExtraFieldNTFS = new Uint8Array(0);\n\t\t}\n\t} else {\n\t\trawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);\n\t}\n\tconst fileEntry = {\n\t\tversion: version || VERSION_DEFLATE,\n\t\tversionMadeBy,\n\t\tzip64,\n\t\tdirectory: Boolean(directory),\n\t\tfilenameUTF8: true,\n\t\trawFilename,\n\t\tcommentUTF8: true,\n\t\trawComment,\n\t\trawExtraFieldZip64: zip64 ? new Uint8Array(EXTRAFIELD_LENGTH_ZIP64 + 4) : new Uint8Array(0),\n\t\trawExtraFieldExtendedTimestamp,\n\t\trawExtraFieldNTFS,\n\t\trawExtraFieldAES,\n\t\trawExtraField,\n\t\textendedTimestamp,\n\t\tmsDosCompatible,\n\t\tinternalFileAttribute,\n\t\texternalFileAttribute\n\t};\n\tlet uncompressedSize = fileEntry.uncompressedSize = 0;\n\tlet bitFlag = BITFLAG_LANG_ENCODING_FLAG;\n\tif (dataDescriptor) {\n\t\tbitFlag = bitFlag | BITFLAG_DATA_DESCRIPTOR;\n\t}\n\tlet compressionMethod = COMPRESSION_METHOD_STORE;\n\tif (compressed) {\n\t\tcompressionMethod = COMPRESSION_METHOD_DEFLATE;\n\t}\n\tif (zip64) {\n\t\tfileEntry.version = fileEntry.version > VERSION_ZIP64 ? fileEntry.version : VERSION_ZIP64;\n\t}\n\tif (encrypted) {\n\t\tbitFlag = bitFlag | BITFLAG_ENCRYPTED;\n\t\tif (!zipCrypto) {\n\t\t\tfileEntry.version = fileEntry.version > VERSION_AES ? fileEntry.version : VERSION_AES;\n\t\t\tcompressionMethod = COMPRESSION_METHOD_AES;\n\t\t\tif (compressed) {\n\t\t\t\tfileEntry.rawExtraFieldAES[9] = COMPRESSION_METHOD_DEFLATE;\n\t\t\t}\n\t\t}\n\t}\n\tfileEntry.compressionMethod = compressionMethod;\n\tconst headerArray = fileEntry.headerArray = new Uint8Array(26);\n\tconst headerView = getDataView(headerArray);\n\tsetUint16(headerView, 0, fileEntry.version);\n\tsetUint16(headerView, 2, bitFlag);\n\tsetUint16(headerView, 4, compressionMethod);\n\tconst dateArray = new Uint32Array(1);\n\tconst dateView = getDataView(dateArray);\n\tlet lastModDate;\n\tif (options.lastModDate < MIN_DATE) {\n\t\tlastModDate = MIN_DATE;\n\t} else if (options.lastModDate > MAX_DATE) {\n\t\tlastModDate = MAX_DATE;\n\t} else {\n\t\tlastModDate = options.lastModDate;\n\t}\n\tsetUint16(dateView, 0, (((lastModDate.getHours() << 6) | lastModDate.getMinutes()) << 5) | lastModDate.getSeconds() / 2);\n\tsetUint16(dateView, 2, ((((lastModDate.getFullYear() - 1980) << 4) | (lastModDate.getMonth() + 1)) << 5) | lastModDate.getDate());\n\tconst rawLastModDate = dateArray[0];\n\tsetUint32(headerView, 6, rawLastModDate);\n\tsetUint16(headerView, 22, rawFilename.length);\n\tconst extraFieldLength = rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + fileEntry.rawExtraField.length;\n\tsetUint16(headerView, 24, extraFieldLength);\n\tconst localHeaderArray = new Uint8Array(30 + rawFilename.length + extraFieldLength);\n\tconst localHeaderView = getDataView(localHeaderArray);\n\tsetUint32(localHeaderView, 0, LOCAL_FILE_HEADER_SIGNATURE);\n\tarraySet(localHeaderArray, headerArray, 4);\n\tarraySet(localHeaderArray, rawFilename, 30);\n\tarraySet(localHeaderArray, rawExtraFieldAES, 30 + rawFilename.length);\n\tarraySet(localHeaderArray, rawExtraFieldExtendedTimestamp, 30 + rawFilename.length + rawExtraFieldAES.length);\n\tarraySet(localHeaderArray, rawExtraFieldNTFS, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);\n\tarraySet(localHeaderArray, fileEntry.rawExtraField, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);\n\tlet result;\n\tlet compressedSize = 0;\n\tif (reader) {\n\t\tconst codec = await createCodec(config.Deflate, {\n\t\t\tcodecType: CODEC_DEFLATE,\n\t\t\tlevel,\n\t\t\tpassword,\n\t\t\tencryptionStrength,\n\t\t\tzipCrypto: encrypted && zipCrypto,\n\t\t\tpasswordVerification: encrypted && zipCrypto && (rawLastModDate >> 8) & 0xFF,\n\t\t\tsigned: true,\n\t\t\tcompressed,\n\t\t\tencrypted,\n\t\t\tuseWebWorkers\n\t\t}, config);\n\t\tawait writer.writeUint8Array(localHeaderArray);\n\t\tfileEntry.dataWritten = true;\n\t\tresult = await processData(codec, reader, writer, 0, () => reader.size, config, { onprogress, signal });\n\t\tuncompressedSize = fileEntry.uncompressedSize = reader.size;\n\t\tcompressedSize = result.length;\n\t} else {\n\t\tawait writer.writeUint8Array(localHeaderArray);\n\t\tfileEntry.dataWritten = true;\n\t}\n\tlet dataDescriptorArray = new Uint8Array(0);\n\tlet dataDescriptorView, dataDescriptorOffset = 0;\n\tif (dataDescriptor) {\n\t\tdataDescriptorArray = new Uint8Array(zip64 ? (dataDescriptorSignature ? 24 : 20) : (dataDescriptorSignature ? 16 : 12));\n\t\tdataDescriptorView = getDataView(dataDescriptorArray);\n\t\tif (dataDescriptorSignature) {\n\t\t\tdataDescriptorOffset = 4;\n\t\t\tsetUint32(dataDescriptorView, 0, DATA_DESCRIPTOR_RECORD_SIGNATURE);\n\t\t}\n\t}\n\tif (reader) {\n\t\tconst signature = result.signature;\n\t\tif ((!encrypted || zipCrypto) && signature !== undefined) {\n\t\t\tsetUint32(headerView, 10, signature);\n\t\t\tfileEntry.signature = signature;\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset, signature);\n\t\t\t}\n\t\t}\n\t\tif (zip64) {\n\t\t\tconst rawExtraFieldZip64View = getDataView(fileEntry.rawExtraFieldZip64);\n\t\t\tsetUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);\n\t\t\tsetUint16(rawExtraFieldZip64View, 2, EXTRAFIELD_LENGTH_ZIP64);\n\t\t\tsetUint32(headerView, 14, MAX_32_BITS);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 12, BigInt(compressedSize));\n\t\t\tsetUint32(headerView, 18, MAX_32_BITS);\n\t\t\tsetBigUint64(rawExtraFieldZip64View, 4, BigInt(uncompressedSize));\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetBigUint64(dataDescriptorView, dataDescriptorOffset + 4, BigInt(compressedSize));\n\t\t\t\tsetBigUint64(dataDescriptorView, dataDescriptorOffset + 12, BigInt(uncompressedSize));\n\t\t\t}\n\t\t} else {\n\t\t\tsetUint32(headerView, 14, compressedSize);\n\t\t\tsetUint32(headerView, 18, uncompressedSize);\n\t\t\tif (dataDescriptor) {\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset + 4, compressedSize);\n\t\t\t\tsetUint32(dataDescriptorView, dataDescriptorOffset + 8, uncompressedSize);\n\t\t\t}\n\t\t}\n\t}\n\tif (dataDescriptor) {\n\t\tawait writer.writeUint8Array(dataDescriptorArray);\n\t}\n\tconst length = localHeaderArray.length + compressedSize + dataDescriptorArray.length;\n\tObject.assign(fileEntry, { compressedSize, lastModDate, rawLastModDate, creationDate, lastAccessDate, encrypted, length });\n\treturn fileEntry;\n}\n\nasync function closeFile(zipWriter, comment, options) {\n\tconst writer = zipWriter.writer;\n\tconst files = zipWriter.files;\n\tlet offset = 0;\n\tlet directoryDataLength = 0;\n\tlet directoryOffset = zipWriter.offset;\n\tlet filesLength = files.size;\n\tfor (const [, fileEntry] of files) {\n\t\tdirectoryDataLength += 46 +\n\t\t\tfileEntry.rawFilename.length +\n\t\t\tfileEntry.rawComment.length +\n\t\t\tfileEntry.rawExtraFieldZip64.length +\n\t\t\tfileEntry.rawExtraFieldAES.length +\n\t\t\tfileEntry.rawExtraFieldExtendedTimestamp.length +\n\t\t\tfileEntry.rawExtraFieldNTFS.length +\n\t\t\tfileEntry.rawExtraField.length;\n\t}\n\tlet zip64 = options.zip64 || zipWriter.options.zip64 || false;\n\tif (directoryOffset >= MAX_32_BITS || directoryDataLength >= MAX_32_BITS || filesLength >= MAX_16_BITS) {\n\t\tif (options.zip64 === false || zipWriter.options.zip64 === false) {\n\t\t\tthrow new Error(ERR_UNSUPPORTED_FORMAT);\n\t\t} else {\n\t\t\tzip64 = true;\n\t\t}\n\t}\n\tconst directoryArray = new Uint8Array(directoryDataLength + (zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH));\n\tconst directoryView = getDataView(directoryArray);\n\tif (comment && comment.length) {\n\t\tif (comment.length <= MAX_16_BITS) {\n\t\t\tsetUint16(directoryView, offset + 20, comment.length);\n\t\t} else {\n\t\t\tthrow new Error(ERR_INVALID_COMMENT);\n\t\t}\n\t}\n\tfor (const [indexFileEntry, fileEntry] of Array.from(files.values()).entries()) {\n\t\tconst {\n\t\t\trawFilename,\n\t\t\trawExtraFieldZip64,\n\t\t\trawExtraFieldAES,\n\t\t\trawExtraField,\n\t\t\trawComment,\n\t\t\tversionMadeBy,\n\t\t\theaderArray,\n\t\t\tdirectory,\n\t\t\tzip64,\n\t\t\tmsDosCompatible,\n\t\t\tinternalFileAttribute,\n\t\t\texternalFileAttribute\n\t\t} = fileEntry;\n\t\tlet rawExtraFieldExtendedTimestamp;\n\t\tlet rawExtraFieldNTFS;\n\t\tif (fileEntry.extendedTimestamp) {\n\t\t\trawExtraFieldNTFS = fileEntry.rawExtraFieldNTFS;\n\t\t\trawExtraFieldExtendedTimestamp = new Uint8Array(9);\n\t\t\tconst extraFieldExtendedTimestampView = getDataView(rawExtraFieldExtendedTimestamp);\n\t\t\tsetUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);\n\t\t\tsetUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);\n\t\t\tsetUint8(extraFieldExtendedTimestampView, 4, 0x1);\n\t\t\tsetUint32(extraFieldExtendedTimestampView, 5, Math.floor(fileEntry.lastModDate.getTime() / 1000));\n\t\t} else {\n\t\t\trawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);\n\t\t}\n\t\tconst extraFieldLength = rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + rawExtraField.length;\n\t\tsetUint32(directoryView, offset, CENTRAL_FILE_HEADER_SIGNATURE);\n\t\tsetUint16(directoryView, offset + 4, versionMadeBy);\n\t\tarraySet(directoryArray, headerArray, offset + 6);\n\t\tsetUint16(directoryView, offset + 30, extraFieldLength);\n\t\tsetUint16(directoryView, offset + 32, rawComment.length);\n\t\tsetUint32(directoryView, offset + 34, internalFileAttribute);\n\t\tif (externalFileAttribute) {\n\t\t\tsetUint32(directoryView, offset + 38, externalFileAttribute);\n\t\t} else if (directory && msDosCompatible) {\n\t\t\tsetUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);\n\t\t}\n\t\tif (zip64) {\n\t\t\tsetUint32(directoryView, offset + 42, MAX_32_BITS);\n\t\t} else {\n\t\t\tsetUint32(directoryView, offset + 42, fileEntry.offset);\n\t\t}\n\t\tarraySet(directoryArray, rawFilename, offset + 46);\n\t\tarraySet(directoryArray, rawExtraFieldZip64, offset + 46 + rawFilename.length);\n\t\tarraySet(directoryArray, rawExtraFieldAES, offset + 46 + rawFilename.length + rawExtraFieldZip64.length);\n\t\tarraySet(directoryArray, rawExtraFieldExtendedTimestamp, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length);\n\t\tarraySet(directoryArray, rawExtraFieldNTFS, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);\n\t\tarraySet(directoryArray, rawExtraField, offset + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);\n\t\tarraySet(directoryArray, rawComment, offset + 46 + rawFilename.length + extraFieldLength);\n\t\toffset += 46 + rawFilename.length + extraFieldLength + rawComment.length;\n\t\tif (options.onprogress) {\n\t\t\ttry {\n\t\t\t\toptions.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));\n\t\t\t} catch (_error) {\n\t\t\t\t// ignored\n\t\t\t}\n\t\t}\n\t}\n\tif (zip64) {\n\t\tsetUint32(directoryView, offset, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE);\n\t\tsetBigUint64(directoryView, offset + 4, BigInt(44));\n\t\tsetUint16(directoryView, offset + 12, 45);\n\t\tsetUint16(directoryView, offset + 14, 45);\n\t\tsetBigUint64(directoryView, offset + 24, BigInt(filesLength));\n\t\tsetBigUint64(directoryView, offset + 32, BigInt(filesLength));\n\t\tsetBigUint64(directoryView, offset + 40, BigInt(directoryDataLength));\n\t\tsetBigUint64(directoryView, offset + 48, BigInt(directoryOffset));\n\t\tsetUint32(directoryView, offset + 56, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE);\n\t\tsetBigUint64(directoryView, offset + 64, BigInt(directoryOffset) + BigInt(directoryDataLength));\n\t\tsetUint32(directoryView, offset + 72, ZIP64_TOTAL_NUMBER_OF_DISKS);\n\t\tfilesLength = MAX_16_BITS;\n\t\tdirectoryOffset = MAX_32_BITS;\n\t\tdirectoryDataLength = MAX_32_BITS;\n\t\toffset += 76;\n\t}\n\tsetUint32(directoryView, offset, END_OF_CENTRAL_DIR_SIGNATURE);\n\tsetUint16(directoryView, offset + 8, filesLength);\n\tsetUint16(directoryView, offset + 10, filesLength);\n\tsetUint32(directoryView, offset + 12, directoryDataLength);\n\tsetUint32(directoryView, offset + 16, directoryOffset);\n\tawait writer.writeUint8Array(directoryArray);\n\tif (comment && comment.length) {\n\t\tawait writer.writeUint8Array(comment);\n\t}\n}\n\nfunction sliceAsArrayBuffer(blob, start, end) {\n\tif (blob.arrayBuffer) {\n\t\tif (start || end) {\n\t\t\treturn blob.slice(start, end).arrayBuffer();\n\t\t} else {\n\t\t\treturn blob.arrayBuffer();\n\t\t}\n\t} else {\n\t\tconst fileReader = new FileReader();\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfileReader.onload = event => resolve(event.target.result);\n\t\t\tfileReader.onerror = () => reject(fileReader.error);\n\t\t\tfileReader.readAsArrayBuffer(start || end ? blob.slice(start, end) : blob);\n\t\t});\n\t}\n}\n\nasync function writeBlob(writer, blob, start = 0) {\n\tconst blockSize = 512 * 1024 * 1024;\n\tawait writeSlice();\n\n\tasync function writeSlice() {\n\t\tif (start < blob.size) {\n\t\t\tconst arrayBuffer = await sliceAsArrayBuffer(blob, start, start + blockSize);\n\t\t\tawait writer.writeUint8Array(new Uint8Array(arrayBuffer));\n\t\t\tstart += blockSize;\n\t\t\tawait writeSlice();\n\t\t}\n\t}\n}\n\nfunction getTimeNTFS(date) {\n\tif (date) {\n\t\treturn ((BigInt(date.getTime()) + BigInt(11644473600000)) * BigInt(10000));\n\t}\n}\n\nfunction getOptionValue(zipWriter, options, name) {\n\treturn options[name] === undefined ? zipWriter.options[name] : options[name];\n}\n\nfunction getMaximumCompressedSize(uncompressedSize) {\n\treturn uncompressedSize + (5 * (Math.floor(uncompressedSize / 16383) + 1));\n}\n\nfunction setUint8(view, offset, value) {\n\tview.setUint8(offset, value);\n}\n\nfunction setUint16(view, offset, value) {\n\tview.setUint16(offset, value, true);\n}\n\nfunction setUint32(view, offset, value) {\n\tview.setUint32(offset, value, true);\n}\n\nfunction setBigUint64(view, offset, value) {\n\tview.setBigUint64(offset, value, true);\n}\n\nfunction arraySet(array, typedArray, offset) {\n\tarray.set(typedArray, offset);\n}\n\nfunction getDataView(array) {\n\treturn new DataView(array.buffer);\n}", "/*\n Copyright (c) 2022 Gildas Lormeau. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright \n notice, this list of conditions and the following disclaimer in \n the documentation and/or other materials provided with the distribution.\n\n 3. The names of the authors may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,\n INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport Deflate from \"./core/codecs/deflate.js\";\nimport Inflate from \"./core/codecs/inflate.js\";\nimport { configure } from \"./core/configuration.js\";\nimport { getMimeType } from \"./core/util/default-mime-type.js\";\nimport { terminateWorkers } from \"./core/codecs/codec-pool.js\";\n\nconfigure({ Deflate, Inflate });\n\nexport { ERR_ABORT } from \"./core/engine.js\";\nexport * from \"./core/io.js\";\nexport * from \"./core/zip-reader.js\";\nexport * from \"./core/zip-writer.js\";\nexport {\n\tconfigure,\n\tgetMimeType,\n\tterminateWorkers\n};", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ReferenceFrame from \"../Core/ReferenceFrame.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport * as zip from \"@zip.js/zip.js/lib/zip-no-worker.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport ModelGraphics from \"./ModelGraphics.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport SampledProperty from \"./SampledProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\n\nconst BILLBOARD_SIZE = 32;\nconst kmlNamespace = \"http://www.opengis.net/kml/2.2\";\nconst gxNamespace = \"http://www.google.com/kml/ext/2.2\";\nconst xmlnsNamespace = \"http://www.w3.org/2000/xmlns/\";\n\n//\n// Handles files external to the KML (eg. textures and models)\n//\nfunction ExternalFileHandler(modelCallback) {\n this._files = {};\n this._promises = [];\n this._count = 0;\n this._modelCallback = modelCallback;\n}\n\nconst imageTypeRegex = /^data:image\\/([^,;]+)/;\nExternalFileHandler.prototype.texture = function (texture) {\n const that = this;\n let filename;\n\n if (typeof texture === \"string\" || texture instanceof Resource) {\n texture = Resource.createIfNeeded(texture);\n if (!texture.isDataUri) {\n return texture.url;\n }\n\n // If its a data URI try and get the correct extension and then fetch the blob\n const regexResult = texture.url.match(imageTypeRegex);\n filename = `texture_${++this._count}`;\n if (defined(regexResult)) {\n filename += `.${regexResult[1]}`;\n }\n\n const promise = texture.fetchBlob().then(function (blob) {\n that._files[filename] = blob;\n });\n\n this._promises.push(promise);\n\n return filename;\n }\n\n if (texture instanceof HTMLCanvasElement) {\n filename = `texture_${++this._count}.png`;\n const promise = new Promise((resolve) => {\n texture.toBlob(function (blob) {\n that._files[filename] = blob;\n resolve();\n });\n });\n this._promises.push(promise);\n\n return filename;\n }\n\n return \"\";\n};\n\nfunction getModelBlobHander(that, filename) {\n return function (blob) {\n that._files[filename] = blob;\n };\n}\n\nExternalFileHandler.prototype.model = function (model, time) {\n const modelCallback = this._modelCallback;\n if (!defined(modelCallback)) {\n throw new RuntimeError(\n \"Encountered a model entity while exporting to KML, but no model callback was supplied.\"\n );\n }\n\n const externalFiles = {};\n const url = modelCallback(model, time, externalFiles);\n\n // Iterate through external files and add them to our list once the promise resolves\n for (const filename in externalFiles) {\n if (externalFiles.hasOwnProperty(filename)) {\n const promise = Promise.resolve(externalFiles[filename]);\n this._promises.push(promise);\n\n promise.then(getModelBlobHander(this, filename));\n }\n }\n\n return url;\n};\n\nObject.defineProperties(ExternalFileHandler.prototype, {\n promise: {\n get: function () {\n return Promise.all(this._promises);\n },\n },\n files: {\n get: function () {\n return this._files;\n },\n },\n});\n\n//\n// Handles getting values from properties taking the desired time and default values into account\n//\nfunction ValueGetter(time) {\n this._time = time;\n}\n\nValueGetter.prototype.get = function (property, defaultVal, result) {\n let value;\n if (defined(property)) {\n value = defined(property.getValue)\n ? property.getValue(this._time, result)\n : property;\n }\n\n return defaultValue(value, defaultVal);\n};\n\nValueGetter.prototype.getColor = function (property, defaultVal) {\n const result = this.get(property, defaultVal);\n if (defined(result)) {\n return colorToString(result);\n }\n};\n\nValueGetter.prototype.getMaterialType = function (property) {\n if (!defined(property)) {\n return;\n }\n\n return property.getType(this._time);\n};\n\n//\n// Caches styles so we don't generate a ton of duplicate styles\n//\nfunction StyleCache() {\n this._ids = {};\n this._styles = {};\n this._count = 0;\n}\n\nStyleCache.prototype.get = function (element) {\n const ids = this._ids;\n const key = element.innerHTML;\n if (defined(ids[key])) {\n return ids[key];\n }\n\n let styleId = `style-${++this._count}`;\n element.setAttribute(\"id\", styleId);\n\n // Store with #\n styleId = `#${styleId}`;\n ids[key] = styleId;\n this._styles[key] = element;\n\n return styleId;\n};\n\nStyleCache.prototype.save = function (parentElement) {\n const styles = this._styles;\n\n const firstElement = parentElement.childNodes[0];\n for (const key in styles) {\n if (styles.hasOwnProperty(key)) {\n parentElement.insertBefore(styles[key], firstElement);\n }\n }\n};\n\n//\n// Manages the generation of IDs because an entity may have geometry and a Folder for children\n//\nfunction IdManager() {\n this._ids = {};\n}\n\nIdManager.prototype.get = function (id) {\n if (!defined(id)) {\n return this.get(createGuid());\n }\n\n const ids = this._ids;\n if (!defined(ids[id])) {\n ids[id] = 0;\n return id;\n }\n\n return `${id.toString()}-${++ids[id]}`;\n};\n\n/**\n * @typedef exportKmlResultKml\n * @type {Object}\n * @property {String} kml The generated KML.\n * @property {Object.<string, Blob>} externalFiles An object dictionary of external files\n */\n\n/**\n * @typedef exportKmlResultKmz\n * @type {Object}\n * @property {Blob} kmz The generated kmz file.\n */\n\n/**\n * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries\n * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For\n * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at\n * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties\n * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using\n * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported\n * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary\n * color is used. Canvas objects are exported as PNG images.\n *\n * @function exportKml\n *\n * @param {Object} options An object with the following properties:\n * @param {EntityCollection} options.entities The EntityCollection to export as KML.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for the output file.\n * @param {exportKmlModelCallback} [options.modelCallback] A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection.\n * @param {JulianDate} [options.time=entities.computeAvailability().start] The time value to use to get properties that are not time varying in KML.\n * @param {TimeInterval} [options.defaultAvailability=entities.computeAvailability()] The interval that will be sampled if an entity doesn't have an availability.\n * @param {Number} [options.sampleDuration=60] The number of seconds to sample properties that are varying in KML.\n * @param {Boolean} [options.kmz=false] If true KML and external files will be compressed into a kmz file.\n *\n * @returns {Promise<exportKmlResultKml|exportKmlResultKmz>} A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true.\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Export%20KML.html|Cesium Sandcastle KML Export Demo}\n * @example\n * Cesium.exportKml({\n * entities: entityCollection\n * })\n * .then(function(result) {\n * // The XML string is in result.kml\n *\n * const externalFiles = result.externalFiles\n * for(const file in externalFiles) {\n * // file is the name of the file used in the KML document as the href\n * // externalFiles[file] is a blob with the contents of the file\n * }\n * });\n *\n */\nfunction exportKml(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const entities = options.entities;\n const kmz = defaultValue(options.kmz, false);\n\n // Get the state that is passed around during the recursion\n // This is separated out for testing.\n const state = exportKml._createState(options);\n\n // Filter EntityCollection so we only have top level entities\n const rootEntities = entities.values.filter(function (entity) {\n return !defined(entity.parent);\n });\n\n // Add the <Document>\n const kmlDoc = state.kmlDoc;\n const kmlElement = kmlDoc.documentElement;\n kmlElement.setAttributeNS(xmlnsNamespace, \"xmlns:gx\", gxNamespace);\n const kmlDocumentElement = kmlDoc.createElement(\"Document\");\n kmlElement.appendChild(kmlDocumentElement);\n\n // Create the KML Hierarchy\n recurseEntities(state, kmlDocumentElement, rootEntities);\n\n // Write out the <Style> elements\n state.styleCache.save(kmlDocumentElement);\n\n // Once all the blobs have resolved return the KML string along with the blob collection\n const externalFileHandler = state.externalFileHandler;\n return externalFileHandler.promise.then(function () {\n const serializer = new XMLSerializer();\n const kmlString = serializer.serializeToString(state.kmlDoc);\n if (kmz) {\n return createKmz(kmlString, externalFileHandler.files);\n }\n\n return {\n kml: kmlString,\n externalFiles: externalFileHandler.files,\n };\n });\n}\n\nfunction createKmz(kmlString, externalFiles) {\n const zWorkerUrl = buildModuleUrl(\"ThirdParty/Workers/z-worker-pako.js\");\n zip.configure({\n workerScripts: {\n deflate: [zWorkerUrl, \"./pako_deflate.min.js\"],\n inflate: [zWorkerUrl, \"./pako_inflate.min.js\"],\n },\n });\n const blobWriter = new zip.BlobWriter();\n const writer = new zip.ZipWriter(blobWriter);\n // We need to only write one file at a time so the zip doesn't get corrupted\n return writer\n .add(\"doc.kml\", new zip.TextReader(kmlString))\n .then(function () {\n const keys = Object.keys(externalFiles);\n return addExternalFilesToZip(writer, keys, externalFiles, 0);\n })\n .then(function () {\n return writer.close();\n })\n .then(function (blob) {\n return {\n kmz: blob,\n };\n });\n}\n\nfunction addExternalFilesToZip(writer, keys, externalFiles, index) {\n if (keys.length === index) {\n return;\n }\n const filename = keys[index];\n return writer\n .add(filename, new zip.BlobReader(externalFiles[filename]))\n .then(function () {\n return addExternalFilesToZip(writer, keys, externalFiles, index + 1);\n });\n}\n\nexportKml._createState = function (options) {\n const entities = options.entities;\n\n const styleCache = new StyleCache();\n\n // Use the start time as the default because just in case they define\n // properties with an interval even if they don't change.\n const entityAvailability = entities.computeAvailability();\n const time = defined(options.time) ? options.time : entityAvailability.start;\n\n // Figure out how we will sample dynamic position properties\n let defaultAvailability = defaultValue(\n options.defaultAvailability,\n entityAvailability\n );\n const sampleDuration = defaultValue(options.sampleDuration, 60);\n\n // Make sure we don't have infinite availability if we need to sample\n if (defaultAvailability.start === Iso8601.MINIMUM_VALUE) {\n if (defaultAvailability.stop === Iso8601.MAXIMUM_VALUE) {\n // Infinite, so just use the default\n defaultAvailability = new TimeInterval();\n } else {\n // No start time, so just sample 10 times before the stop\n JulianDate.addSeconds(\n defaultAvailability.stop,\n -10 * sampleDuration,\n defaultAvailability.start\n );\n }\n } else if (defaultAvailability.stop === Iso8601.MAXIMUM_VALUE) {\n // No stop time, so just sample 10 times after the start\n JulianDate.addSeconds(\n defaultAvailability.start,\n 10 * sampleDuration,\n defaultAvailability.stop\n );\n }\n\n const externalFileHandler = new ExternalFileHandler(options.modelCallback);\n\n const kmlDoc = document.implementation.createDocument(kmlNamespace, \"kml\");\n return {\n kmlDoc: kmlDoc,\n ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n idManager: new IdManager(),\n styleCache: styleCache,\n externalFileHandler: externalFileHandler,\n time: time,\n valueGetter: new ValueGetter(time),\n sampleDuration: sampleDuration,\n // Wrap it in a TimeIntervalCollection because that is what entity.availability is\n defaultAvailability: new TimeIntervalCollection([defaultAvailability]),\n };\n};\n\nfunction recurseEntities(state, parentNode, entities) {\n const kmlDoc = state.kmlDoc;\n const styleCache = state.styleCache;\n const valueGetter = state.valueGetter;\n const idManager = state.idManager;\n\n const count = entities.length;\n let overlays;\n let geometries;\n let styles;\n for (let i = 0; i < count; ++i) {\n const entity = entities[i];\n overlays = [];\n geometries = [];\n styles = [];\n\n createPoint(state, entity, geometries, styles);\n createLineString(state, entity.polyline, geometries, styles);\n createPolygon(state, entity.rectangle, geometries, styles, overlays);\n createPolygon(state, entity.polygon, geometries, styles, overlays);\n createModel(state, entity, entity.model, geometries, styles);\n\n let timeSpan;\n const availability = entity.availability;\n if (defined(availability)) {\n timeSpan = kmlDoc.createElement(\"TimeSpan\");\n\n if (!JulianDate.equals(availability.start, Iso8601.MINIMUM_VALUE)) {\n timeSpan.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"begin\",\n JulianDate.toIso8601(availability.start)\n )\n );\n }\n\n if (!JulianDate.equals(availability.stop, Iso8601.MAXIMUM_VALUE)) {\n timeSpan.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"end\",\n JulianDate.toIso8601(availability.stop)\n )\n );\n }\n }\n\n for (let overlayIndex = 0; overlayIndex < overlays.length; ++overlayIndex) {\n const overlay = overlays[overlayIndex];\n\n overlay.setAttribute(\"id\", idManager.get(entity.id));\n overlay.appendChild(\n createBasicElementWithText(kmlDoc, \"name\", entity.name)\n );\n overlay.appendChild(\n createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n );\n overlay.appendChild(\n createBasicElementWithText(kmlDoc, \"description\", entity.description)\n );\n\n if (defined(timeSpan)) {\n overlay.appendChild(timeSpan);\n }\n\n parentNode.appendChild(overlay);\n }\n\n const geometryCount = geometries.length;\n if (geometryCount > 0) {\n const placemark = kmlDoc.createElement(\"Placemark\");\n placemark.setAttribute(\"id\", idManager.get(entity.id));\n\n let name = entity.name;\n const labelGraphics = entity.label;\n if (defined(labelGraphics)) {\n const labelStyle = kmlDoc.createElement(\"LabelStyle\");\n\n // KML only shows the name as a label, so just change the name if we need to show a label\n const text = valueGetter.get(labelGraphics.text);\n name = defined(text) && text.length > 0 ? text : name;\n\n const color = valueGetter.getColor(labelGraphics.fillColor);\n if (defined(color)) {\n labelStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"color\", color)\n );\n labelStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n );\n }\n\n const scale = valueGetter.get(labelGraphics.scale);\n if (defined(scale)) {\n labelStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"scale\", scale)\n );\n }\n\n styles.push(labelStyle);\n }\n\n placemark.appendChild(createBasicElementWithText(kmlDoc, \"name\", name));\n placemark.appendChild(\n createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n );\n placemark.appendChild(\n createBasicElementWithText(kmlDoc, \"description\", entity.description)\n );\n\n if (defined(timeSpan)) {\n placemark.appendChild(timeSpan);\n }\n\n parentNode.appendChild(placemark);\n\n const styleCount = styles.length;\n if (styleCount > 0) {\n const style = kmlDoc.createElement(\"Style\");\n for (let styleIndex = 0; styleIndex < styleCount; ++styleIndex) {\n style.appendChild(styles[styleIndex]);\n }\n\n placemark.appendChild(\n createBasicElementWithText(kmlDoc, \"styleUrl\", styleCache.get(style))\n );\n }\n\n if (geometries.length === 1) {\n placemark.appendChild(geometries[0]);\n } else if (geometries.length > 1) {\n const multigeometry = kmlDoc.createElement(\"MultiGeometry\");\n for (\n let geometryIndex = 0;\n geometryIndex < geometryCount;\n ++geometryIndex\n ) {\n multigeometry.appendChild(geometries[geometryIndex]);\n }\n placemark.appendChild(multigeometry);\n }\n }\n\n const children = entity._children;\n if (children.length > 0) {\n const folderNode = kmlDoc.createElement(\"Folder\");\n folderNode.setAttribute(\"id\", idManager.get(entity.id));\n folderNode.appendChild(\n createBasicElementWithText(kmlDoc, \"name\", entity.name)\n );\n folderNode.appendChild(\n createBasicElementWithText(kmlDoc, \"visibility\", entity.show)\n );\n folderNode.appendChild(\n createBasicElementWithText(kmlDoc, \"description\", entity.description)\n );\n\n parentNode.appendChild(folderNode);\n\n recurseEntities(state, folderNode, children);\n }\n }\n}\n\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchJulianDate = new JulianDate();\n\nfunction createPoint(state, entity, geometries, styles) {\n const kmlDoc = state.kmlDoc;\n const ellipsoid = state.ellipsoid;\n const valueGetter = state.valueGetter;\n\n const pointGraphics = defaultValue(entity.billboard, entity.point);\n if (!defined(pointGraphics) && !defined(entity.path)) {\n return;\n }\n\n // If the point isn't constant then create gx:Track or gx:MultiTrack\n const entityPositionProperty = entity.position;\n if (!entityPositionProperty.isConstant) {\n createTracks(state, entity, pointGraphics, geometries, styles);\n return;\n }\n\n valueGetter.get(entityPositionProperty, undefined, scratchCartesian3);\n const coordinates = createBasicElementWithText(\n kmlDoc,\n \"coordinates\",\n getCoordinates(scratchCartesian3, ellipsoid)\n );\n\n const pointGeometry = kmlDoc.createElement(\"Point\");\n\n // Set altitude mode\n const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n altitudeMode.appendChild(\n getAltitudeMode(state, pointGraphics.heightReference)\n );\n pointGeometry.appendChild(altitudeMode);\n\n pointGeometry.appendChild(coordinates);\n geometries.push(pointGeometry);\n\n // Create style\n const iconStyle =\n pointGraphics instanceof BillboardGraphics\n ? createIconStyleFromBillboard(state, pointGraphics)\n : createIconStyleFromPoint(state, pointGraphics);\n styles.push(iconStyle);\n}\n\nfunction createTracks(state, entity, pointGraphics, geometries, styles) {\n const kmlDoc = state.kmlDoc;\n const ellipsoid = state.ellipsoid;\n const valueGetter = state.valueGetter;\n\n let intervals;\n const entityPositionProperty = entity.position;\n let useEntityPositionProperty = true;\n if (entityPositionProperty instanceof CompositePositionProperty) {\n intervals = entityPositionProperty.intervals;\n useEntityPositionProperty = false;\n } else {\n intervals = defaultValue(entity.availability, state.defaultAvailability);\n }\n\n const isModel = pointGraphics instanceof ModelGraphics;\n\n let i, j, times;\n const tracks = [];\n for (i = 0; i < intervals.length; ++i) {\n const interval = intervals.get(i);\n let positionProperty = useEntityPositionProperty\n ? entityPositionProperty\n : interval.data;\n\n const trackAltitudeMode = kmlDoc.createElement(\"altitudeMode\");\n // This is something that KML importing uses to handle clampToGround,\n // so just extract the internal property and set the altitudeMode.\n if (positionProperty instanceof ScaledPositionProperty) {\n positionProperty = positionProperty._value;\n trackAltitudeMode.appendChild(\n getAltitudeMode(state, HeightReference.CLAMP_TO_GROUND)\n );\n } else if (defined(pointGraphics)) {\n trackAltitudeMode.appendChild(\n getAltitudeMode(state, pointGraphics.heightReference)\n );\n } else {\n // Path graphics only, which has no height reference\n trackAltitudeMode.appendChild(\n getAltitudeMode(state, HeightReference.NONE)\n );\n }\n\n const positionTimes = [];\n const positionValues = [];\n\n if (positionProperty.isConstant) {\n valueGetter.get(positionProperty, undefined, scratchCartesian3);\n const constCoordinates = createBasicElementWithText(\n kmlDoc,\n \"coordinates\",\n getCoordinates(scratchCartesian3, ellipsoid)\n );\n\n // This interval is constant so add a track with the same position\n positionTimes.push(JulianDate.toIso8601(interval.start));\n positionValues.push(constCoordinates);\n positionTimes.push(JulianDate.toIso8601(interval.stop));\n positionValues.push(constCoordinates);\n } else if (positionProperty instanceof SampledPositionProperty) {\n times = positionProperty._property._times;\n\n for (j = 0; j < times.length; ++j) {\n positionTimes.push(JulianDate.toIso8601(times[j]));\n positionProperty.getValueInReferenceFrame(\n times[j],\n ReferenceFrame.FIXED,\n scratchCartesian3\n );\n positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n }\n } else if (positionProperty instanceof SampledProperty) {\n times = positionProperty._times;\n const values = positionProperty._values;\n\n for (j = 0; j < times.length; ++j) {\n positionTimes.push(JulianDate.toIso8601(times[j]));\n Cartesian3.fromArray(values, j * 3, scratchCartesian3);\n positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n }\n } else {\n const duration = state.sampleDuration;\n interval.start.clone(scratchJulianDate);\n if (!interval.isStartIncluded) {\n JulianDate.addSeconds(scratchJulianDate, duration, scratchJulianDate);\n }\n\n const stopDate = interval.stop;\n while (JulianDate.lessThan(scratchJulianDate, stopDate)) {\n positionProperty.getValue(scratchJulianDate, scratchCartesian3);\n\n positionTimes.push(JulianDate.toIso8601(scratchJulianDate));\n positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n\n JulianDate.addSeconds(scratchJulianDate, duration, scratchJulianDate);\n }\n\n if (\n interval.isStopIncluded &&\n JulianDate.equals(scratchJulianDate, stopDate)\n ) {\n positionProperty.getValue(scratchJulianDate, scratchCartesian3);\n\n positionTimes.push(JulianDate.toIso8601(scratchJulianDate));\n positionValues.push(getCoordinates(scratchCartesian3, ellipsoid));\n }\n }\n\n const trackGeometry = kmlDoc.createElementNS(gxNamespace, \"Track\");\n trackGeometry.appendChild(trackAltitudeMode);\n\n for (let k = 0; k < positionTimes.length; ++k) {\n const when = createBasicElementWithText(kmlDoc, \"when\", positionTimes[k]);\n const coord = createBasicElementWithText(\n kmlDoc,\n \"coord\",\n positionValues[k],\n gxNamespace\n );\n\n trackGeometry.appendChild(when);\n trackGeometry.appendChild(coord);\n }\n\n if (isModel) {\n trackGeometry.appendChild(createModelGeometry(state, pointGraphics));\n }\n\n tracks.push(trackGeometry);\n }\n\n // If one track, then use it otherwise combine into a multitrack\n if (tracks.length === 1) {\n geometries.push(tracks[0]);\n } else if (tracks.length > 1) {\n const multiTrackGeometry = kmlDoc.createElementNS(\n gxNamespace,\n \"MultiTrack\"\n );\n\n for (i = 0; i < tracks.length; ++i) {\n multiTrackGeometry.appendChild(tracks[i]);\n }\n\n geometries.push(multiTrackGeometry);\n }\n\n // Create style\n if (defined(pointGraphics) && !isModel) {\n const iconStyle =\n pointGraphics instanceof BillboardGraphics\n ? createIconStyleFromBillboard(state, pointGraphics)\n : createIconStyleFromPoint(state, pointGraphics);\n styles.push(iconStyle);\n }\n\n // See if we have a line that needs to be drawn\n const path = entity.path;\n if (defined(path)) {\n const width = valueGetter.get(path.width);\n const material = path.material;\n if (defined(material) || defined(width)) {\n const lineStyle = kmlDoc.createElement(\"LineStyle\");\n if (defined(width)) {\n lineStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"width\", width)\n );\n }\n\n processMaterial(state, material, lineStyle);\n styles.push(lineStyle);\n }\n }\n}\n\nfunction createIconStyleFromPoint(state, pointGraphics) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n const iconStyle = kmlDoc.createElement(\"IconStyle\");\n\n const color = valueGetter.getColor(pointGraphics.color);\n if (defined(color)) {\n iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n iconStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n );\n }\n\n const pixelSize = valueGetter.get(pointGraphics.pixelSize);\n if (defined(pixelSize)) {\n iconStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"scale\", pixelSize / BILLBOARD_SIZE)\n );\n }\n\n return iconStyle;\n}\n\nfunction createIconStyleFromBillboard(state, billboardGraphics) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n const externalFileHandler = state.externalFileHandler;\n\n const iconStyle = kmlDoc.createElement(\"IconStyle\");\n\n let image = valueGetter.get(billboardGraphics.image);\n if (defined(image)) {\n image = externalFileHandler.texture(image);\n\n const icon = kmlDoc.createElement(\"Icon\");\n icon.appendChild(createBasicElementWithText(kmlDoc, \"href\", image));\n\n const imageSubRegion = valueGetter.get(billboardGraphics.imageSubRegion);\n if (defined(imageSubRegion)) {\n icon.appendChild(\n createBasicElementWithText(kmlDoc, \"x\", imageSubRegion.x, gxNamespace)\n );\n icon.appendChild(\n createBasicElementWithText(kmlDoc, \"y\", imageSubRegion.y, gxNamespace)\n );\n icon.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"w\",\n imageSubRegion.width,\n gxNamespace\n )\n );\n icon.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"h\",\n imageSubRegion.height,\n gxNamespace\n )\n );\n }\n\n iconStyle.appendChild(icon);\n }\n\n const color = valueGetter.getColor(billboardGraphics.color);\n if (defined(color)) {\n iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n iconStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n );\n }\n\n let scale = valueGetter.get(billboardGraphics.scale);\n if (defined(scale)) {\n iconStyle.appendChild(createBasicElementWithText(kmlDoc, \"scale\", scale));\n }\n\n const pixelOffset = valueGetter.get(billboardGraphics.pixelOffset);\n if (defined(pixelOffset)) {\n scale = defaultValue(scale, 1.0);\n\n Cartesian2.divideByScalar(pixelOffset, scale, pixelOffset);\n\n const width = valueGetter.get(billboardGraphics.width, BILLBOARD_SIZE);\n const height = valueGetter.get(billboardGraphics.height, BILLBOARD_SIZE);\n\n // KML Hotspots are from the bottom left, but we work from the top left\n\n // Move to left\n const horizontalOrigin = valueGetter.get(\n billboardGraphics.horizontalOrigin,\n HorizontalOrigin.CENTER\n );\n if (horizontalOrigin === HorizontalOrigin.CENTER) {\n pixelOffset.x -= width * 0.5;\n } else if (horizontalOrigin === HorizontalOrigin.RIGHT) {\n pixelOffset.x -= width;\n }\n\n // Move to bottom\n const verticalOrigin = valueGetter.get(\n billboardGraphics.verticalOrigin,\n VerticalOrigin.CENTER\n );\n if (verticalOrigin === VerticalOrigin.TOP) {\n pixelOffset.y += height;\n } else if (verticalOrigin === VerticalOrigin.CENTER) {\n pixelOffset.y += height * 0.5;\n }\n\n const hotSpot = kmlDoc.createElement(\"hotSpot\");\n hotSpot.setAttribute(\"x\", -pixelOffset.x);\n hotSpot.setAttribute(\"y\", pixelOffset.y);\n hotSpot.setAttribute(\"xunits\", \"pixels\");\n hotSpot.setAttribute(\"yunits\", \"pixels\");\n\n iconStyle.appendChild(hotSpot);\n }\n\n // We can only specify heading so if axis isn't Z, then we skip the rotation\n // GE treats a heading of zero as no heading but can still point north using a 360 degree angle\n let rotation = valueGetter.get(billboardGraphics.rotation);\n const alignedAxis = valueGetter.get(billboardGraphics.alignedAxis);\n if (defined(rotation) && Cartesian3.equals(Cartesian3.UNIT_Z, alignedAxis)) {\n rotation = CesiumMath.toDegrees(-rotation);\n if (rotation === 0) {\n rotation = 360;\n }\n\n iconStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"heading\", rotation)\n );\n }\n\n return iconStyle;\n}\n\nfunction createLineString(state, polylineGraphics, geometries, styles) {\n const kmlDoc = state.kmlDoc;\n const ellipsoid = state.ellipsoid;\n const valueGetter = state.valueGetter;\n\n if (!defined(polylineGraphics)) {\n return;\n }\n\n const lineStringGeometry = kmlDoc.createElement(\"LineString\");\n\n // Set altitude mode\n const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n const clampToGround = valueGetter.get(polylineGraphics.clampToGround, false);\n let altitudeModeText;\n if (clampToGround) {\n lineStringGeometry.appendChild(\n createBasicElementWithText(kmlDoc, \"tessellate\", true)\n );\n altitudeModeText = kmlDoc.createTextNode(\"clampToGround\");\n } else {\n altitudeModeText = kmlDoc.createTextNode(\"absolute\");\n }\n altitudeMode.appendChild(altitudeModeText);\n lineStringGeometry.appendChild(altitudeMode);\n\n // Set coordinates\n const positionsProperty = polylineGraphics.positions;\n const cartesians = valueGetter.get(positionsProperty);\n const coordinates = createBasicElementWithText(\n kmlDoc,\n \"coordinates\",\n getCoordinates(cartesians, ellipsoid)\n );\n lineStringGeometry.appendChild(coordinates);\n\n // Set draw order\n const zIndex = valueGetter.get(polylineGraphics.zIndex);\n if (clampToGround && defined(zIndex)) {\n lineStringGeometry.appendChild(\n createBasicElementWithText(kmlDoc, \"drawOrder\", zIndex, gxNamespace)\n );\n }\n\n geometries.push(lineStringGeometry);\n\n // Create style\n const lineStyle = kmlDoc.createElement(\"LineStyle\");\n\n const width = valueGetter.get(polylineGraphics.width);\n if (defined(width)) {\n lineStyle.appendChild(createBasicElementWithText(kmlDoc, \"width\", width));\n }\n\n processMaterial(state, polylineGraphics.material, lineStyle);\n\n styles.push(lineStyle);\n}\n\nfunction getRectangleBoundaries(state, rectangleGraphics, extrudedHeight) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n let height = valueGetter.get(rectangleGraphics.height, 0.0);\n\n if (extrudedHeight > 0) {\n // We extrude up and KML extrudes down, so if we extrude, set the polygon height to\n // the extruded height so KML will look similar to Cesium\n height = extrudedHeight;\n }\n\n const coordinatesProperty = rectangleGraphics.coordinates;\n const rectangle = valueGetter.get(coordinatesProperty);\n\n const coordinateStrings = [];\n const cornerFunction = [\n Rectangle.northeast,\n Rectangle.southeast,\n Rectangle.southwest,\n Rectangle.northwest,\n ];\n\n for (let i = 0; i < 4; ++i) {\n cornerFunction[i](rectangle, scratchCartographic);\n coordinateStrings.push(\n `${CesiumMath.toDegrees(\n scratchCartographic.longitude\n )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${height}`\n );\n }\n\n const coordinates = createBasicElementWithText(\n kmlDoc,\n \"coordinates\",\n coordinateStrings.join(\" \")\n );\n\n const outerBoundaryIs = kmlDoc.createElement(\"outerBoundaryIs\");\n const linearRing = kmlDoc.createElement(\"LinearRing\");\n linearRing.appendChild(coordinates);\n outerBoundaryIs.appendChild(linearRing);\n\n return [outerBoundaryIs];\n}\n\nfunction getLinearRing(state, positions, height, perPositionHeight) {\n const kmlDoc = state.kmlDoc;\n const ellipsoid = state.ellipsoid;\n\n const coordinateStrings = [];\n const positionCount = positions.length;\n for (let i = 0; i < positionCount; ++i) {\n Cartographic.fromCartesian(positions[i], ellipsoid, scratchCartographic);\n coordinateStrings.push(\n `${CesiumMath.toDegrees(\n scratchCartographic.longitude\n )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${\n perPositionHeight ? scratchCartographic.height : height\n }`\n );\n }\n\n const coordinates = createBasicElementWithText(\n kmlDoc,\n \"coordinates\",\n coordinateStrings.join(\" \")\n );\n const linearRing = kmlDoc.createElement(\"LinearRing\");\n linearRing.appendChild(coordinates);\n\n return linearRing;\n}\n\nfunction getPolygonBoundaries(state, polygonGraphics, extrudedHeight) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n let height = valueGetter.get(polygonGraphics.height, 0.0);\n const perPositionHeight = valueGetter.get(\n polygonGraphics.perPositionHeight,\n false\n );\n\n if (!perPositionHeight && extrudedHeight > 0) {\n // We extrude up and KML extrudes down, so if we extrude, set the polygon height to\n // the extruded height so KML will look similar to Cesium\n height = extrudedHeight;\n }\n\n const boundaries = [];\n const hierarchyProperty = polygonGraphics.hierarchy;\n const hierarchy = valueGetter.get(hierarchyProperty);\n\n // Polygon hierarchy can sometimes just be an array of positions\n const positions = Array.isArray(hierarchy) ? hierarchy : hierarchy.positions;\n\n // Polygon boundaries\n const outerBoundaryIs = kmlDoc.createElement(\"outerBoundaryIs\");\n outerBoundaryIs.appendChild(\n getLinearRing(state, positions, height, perPositionHeight)\n );\n boundaries.push(outerBoundaryIs);\n\n // Hole boundaries\n const holes = hierarchy.holes;\n if (defined(holes)) {\n const holeCount = holes.length;\n for (let i = 0; i < holeCount; ++i) {\n const innerBoundaryIs = kmlDoc.createElement(\"innerBoundaryIs\");\n innerBoundaryIs.appendChild(\n getLinearRing(state, holes[i].positions, height, perPositionHeight)\n );\n boundaries.push(innerBoundaryIs);\n }\n }\n\n return boundaries;\n}\n\nfunction createPolygon(state, geometry, geometries, styles, overlays) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n if (!defined(geometry)) {\n return;\n }\n\n // Detect textured quads and use ground overlays instead\n const isRectangle = geometry instanceof RectangleGraphics;\n if (\n isRectangle &&\n valueGetter.getMaterialType(geometry.material) === \"Image\"\n ) {\n createGroundOverlay(state, geometry, overlays);\n return;\n }\n\n const polygonGeometry = kmlDoc.createElement(\"Polygon\");\n\n const extrudedHeight = valueGetter.get(geometry.extrudedHeight, 0.0);\n if (extrudedHeight > 0) {\n polygonGeometry.appendChild(\n createBasicElementWithText(kmlDoc, \"extrude\", true)\n );\n }\n\n // Set boundaries\n const boundaries = isRectangle\n ? getRectangleBoundaries(state, geometry, extrudedHeight)\n : getPolygonBoundaries(state, geometry, extrudedHeight);\n\n const boundaryCount = boundaries.length;\n for (let i = 0; i < boundaryCount; ++i) {\n polygonGeometry.appendChild(boundaries[i]);\n }\n\n // Set altitude mode\n const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n altitudeMode.appendChild(getAltitudeMode(state, geometry.heightReference));\n polygonGeometry.appendChild(altitudeMode);\n\n geometries.push(polygonGeometry);\n\n // Create style\n const polyStyle = kmlDoc.createElement(\"PolyStyle\");\n\n const fill = valueGetter.get(geometry.fill, false);\n if (fill) {\n polyStyle.appendChild(createBasicElementWithText(kmlDoc, \"fill\", fill));\n }\n\n processMaterial(state, geometry.material, polyStyle);\n\n const outline = valueGetter.get(geometry.outline, false);\n if (outline) {\n polyStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"outline\", outline)\n );\n\n // Outline uses LineStyle\n const lineStyle = kmlDoc.createElement(\"LineStyle\");\n\n const outlineWidth = valueGetter.get(geometry.outlineWidth, 1.0);\n lineStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"width\", outlineWidth)\n );\n\n const outlineColor = valueGetter.getColor(\n geometry.outlineColor,\n Color.BLACK\n );\n lineStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"color\", outlineColor)\n );\n lineStyle.appendChild(\n createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n );\n\n styles.push(lineStyle);\n }\n\n styles.push(polyStyle);\n}\n\nfunction createGroundOverlay(state, rectangleGraphics, overlays) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n const externalFileHandler = state.externalFileHandler;\n\n const groundOverlay = kmlDoc.createElement(\"GroundOverlay\");\n\n // Set altitude mode\n const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n altitudeMode.appendChild(\n getAltitudeMode(state, rectangleGraphics.heightReference)\n );\n groundOverlay.appendChild(altitudeMode);\n\n const height = valueGetter.get(rectangleGraphics.height);\n if (defined(height)) {\n groundOverlay.appendChild(\n createBasicElementWithText(kmlDoc, \"altitude\", height)\n );\n }\n\n const rectangle = valueGetter.get(rectangleGraphics.coordinates);\n const latLonBox = kmlDoc.createElement(\"LatLonBox\");\n latLonBox.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"north\",\n CesiumMath.toDegrees(rectangle.north)\n )\n );\n latLonBox.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"south\",\n CesiumMath.toDegrees(rectangle.south)\n )\n );\n latLonBox.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"east\",\n CesiumMath.toDegrees(rectangle.east)\n )\n );\n latLonBox.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"west\",\n CesiumMath.toDegrees(rectangle.west)\n )\n );\n groundOverlay.appendChild(latLonBox);\n\n // We should only end up here if we have an ImageMaterialProperty\n const material = valueGetter.get(rectangleGraphics.material);\n const href = externalFileHandler.texture(material.image);\n const icon = kmlDoc.createElement(\"Icon\");\n icon.appendChild(createBasicElementWithText(kmlDoc, \"href\", href));\n groundOverlay.appendChild(icon);\n\n const color = material.color;\n if (defined(color)) {\n groundOverlay.appendChild(\n createBasicElementWithText(kmlDoc, \"color\", colorToString(material.color))\n );\n }\n\n overlays.push(groundOverlay);\n}\n\nfunction createModelGeometry(state, modelGraphics) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n const externalFileHandler = state.externalFileHandler;\n\n const modelGeometry = kmlDoc.createElement(\"Model\");\n\n const scale = valueGetter.get(modelGraphics.scale);\n if (defined(scale)) {\n const scaleElement = kmlDoc.createElement(\"scale\");\n scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"x\", scale));\n scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"y\", scale));\n scaleElement.appendChild(createBasicElementWithText(kmlDoc, \"z\", scale));\n modelGeometry.appendChild(scaleElement);\n }\n\n const link = kmlDoc.createElement(\"Link\");\n const uri = externalFileHandler.model(modelGraphics, state.time);\n\n link.appendChild(createBasicElementWithText(kmlDoc, \"href\", uri));\n modelGeometry.appendChild(link);\n\n return modelGeometry;\n}\n\nfunction createModel(state, entity, modelGraphics, geometries, styles) {\n const kmlDoc = state.kmlDoc;\n const ellipsoid = state.ellipsoid;\n const valueGetter = state.valueGetter;\n\n if (!defined(modelGraphics)) {\n return;\n }\n\n // If the point isn't constant then create gx:Track or gx:MultiTrack\n const entityPositionProperty = entity.position;\n if (!entityPositionProperty.isConstant) {\n createTracks(state, entity, modelGraphics, geometries, styles);\n return;\n }\n\n const modelGeometry = createModelGeometry(state, modelGraphics);\n\n // Set altitude mode\n const altitudeMode = kmlDoc.createElement(\"altitudeMode\");\n altitudeMode.appendChild(\n getAltitudeMode(state, modelGraphics.heightReference)\n );\n modelGeometry.appendChild(altitudeMode);\n\n valueGetter.get(entityPositionProperty, undefined, scratchCartesian3);\n Cartographic.fromCartesian(scratchCartesian3, ellipsoid, scratchCartographic);\n const location = kmlDoc.createElement(\"Location\");\n location.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"longitude\",\n CesiumMath.toDegrees(scratchCartographic.longitude)\n )\n );\n location.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"latitude\",\n CesiumMath.toDegrees(scratchCartographic.latitude)\n )\n );\n location.appendChild(\n createBasicElementWithText(kmlDoc, \"altitude\", scratchCartographic.height)\n );\n modelGeometry.appendChild(location);\n\n geometries.push(modelGeometry);\n}\n\nfunction processMaterial(state, materialProperty, style) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n if (!defined(materialProperty)) {\n return;\n }\n\n const material = valueGetter.get(materialProperty);\n if (!defined(material)) {\n return;\n }\n\n let color;\n const type = valueGetter.getMaterialType(materialProperty);\n let outlineColor;\n let outlineWidth;\n switch (type) {\n case \"Image\":\n // Image materials are only able to be represented on rectangles, so if we make it\n // here we can't texture a generic polygon or polyline in KML, so just use white.\n color = colorToString(Color.WHITE);\n break;\n case \"Color\":\n case \"Grid\":\n case \"PolylineGlow\":\n case \"PolylineArrow\":\n case \"PolylineDash\":\n color = colorToString(material.color);\n break;\n case \"PolylineOutline\":\n color = colorToString(material.color);\n\n outlineColor = colorToString(material.outlineColor);\n outlineWidth = material.outlineWidth;\n style.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"outerColor\",\n outlineColor,\n gxNamespace\n )\n );\n style.appendChild(\n createBasicElementWithText(\n kmlDoc,\n \"outerWidth\",\n outlineWidth,\n gxNamespace\n )\n );\n break;\n case \"Stripe\":\n color = colorToString(material.oddColor);\n break;\n }\n\n if (defined(color)) {\n style.appendChild(createBasicElementWithText(kmlDoc, \"color\", color));\n style.appendChild(\n createBasicElementWithText(kmlDoc, \"colorMode\", \"normal\")\n );\n }\n}\n\nfunction getAltitudeMode(state, heightReferenceProperty) {\n const kmlDoc = state.kmlDoc;\n const valueGetter = state.valueGetter;\n\n const heightReference = valueGetter.get(\n heightReferenceProperty,\n HeightReference.NONE\n );\n let altitudeModeText;\n switch (heightReference) {\n case HeightReference.NONE:\n altitudeModeText = kmlDoc.createTextNode(\"absolute\");\n break;\n case HeightReference.CLAMP_TO_GROUND:\n altitudeModeText = kmlDoc.createTextNode(\"clampToGround\");\n break;\n case HeightReference.RELATIVE_TO_GROUND:\n altitudeModeText = kmlDoc.createTextNode(\"relativeToGround\");\n break;\n }\n\n return altitudeModeText;\n}\n\nfunction getCoordinates(coordinates, ellipsoid) {\n if (!Array.isArray(coordinates)) {\n coordinates = [coordinates];\n }\n\n const count = coordinates.length;\n const coordinateStrings = [];\n for (let i = 0; i < count; ++i) {\n Cartographic.fromCartesian(coordinates[i], ellipsoid, scratchCartographic);\n coordinateStrings.push(\n `${CesiumMath.toDegrees(\n scratchCartographic.longitude\n )},${CesiumMath.toDegrees(scratchCartographic.latitude)},${\n scratchCartographic.height\n }`\n );\n }\n\n return coordinateStrings.join(\" \");\n}\n\nfunction createBasicElementWithText(\n kmlDoc,\n elementName,\n elementValue,\n namespace\n) {\n elementValue = defaultValue(elementValue, \"\");\n\n if (typeof elementValue === \"boolean\") {\n elementValue = elementValue ? \"1\" : \"0\";\n }\n\n // Create element with optional namespace\n const element = defined(namespace)\n ? kmlDoc.createElementNS(namespace, elementName)\n : kmlDoc.createElement(elementName);\n\n // Wrap value in CDATA section if it contains HTML\n const text =\n elementValue === \"string\" && elementValue.indexOf(\"<\") !== -1\n ? kmlDoc.createCDATASection(elementValue)\n : kmlDoc.createTextNode(elementValue);\n\n element.appendChild(text);\n\n return element;\n}\n\nfunction colorToString(color) {\n let result = \"\";\n const bytes = color.toBytes();\n for (let i = 3; i >= 0; --i) {\n result +=\n bytes[i] < 16 ? `0${bytes[i].toString(16)}` : bytes[i].toString(16);\n }\n\n return result;\n}\n\n/**\n * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.\n * It can also be used to add additional files to the <code>externalFiles</code> object, which is the list of files embedded in the exported KMZ,\n * or otherwise returned with the KML string when exporting.\n *\n * @callback exportKmlModelCallback\n *\n * @param {ModelGraphics} model The ModelGraphics instance for an Entity.\n * @param {JulianDate} time The time that any properties should use to get the value.\n * @param {Object} externalFiles An object that maps a filename to a Blob or a Promise that resolves to a Blob.\n * @returns {String} The URL to use for the href in the KML document.\n */\nexport default exportKml;\n", "import buildModuleUrl from \"./buildModuleUrl.js\";\nimport Color from \"./Color.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Resource from \"./Resource.js\";\nimport writeTextToCanvas from \"./writeTextToCanvas.js\";\n\n/**\n * A utility class for generating custom map pins as canvas elements.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/PinBuilder.png' width='500'/><br />\n * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.\n * </div>\n *\n * @alias PinBuilder\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Map%20Pins.html|Cesium Sandcastle PinBuilder Demo}\n */\nfunction PinBuilder() {\n this._cache = {};\n}\n\n/**\n * Creates an empty pin of the specified color and size.\n *\n * @param {Color} color The color of the pin.\n * @param {Number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement} The canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromColor = function (color, size) {\nreturn createPin(undefined, undefined, color, size, this._cache);\n};\n\n/**\n * Creates a pin with the specified icon, color, and size.\n *\n * @param {Resource|String} url The url of the image to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {Number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement|Promise.<HTMLCanvasElement>} The canvas element or a Promise to the canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromUrl = function (url, color, size) {\nreturn createPin(url, undefined, color, size, this._cache);\n};\n\n/**\n * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.\n *\n * @param {String} id The id of the maki icon to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {Number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement|Promise.<HTMLCanvasElement>} The canvas element or a Promise to the canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromMakiIconId = function (id, color, size) {\nreturn createPin(\n buildModuleUrl(`Assets/Textures/maki/${encodeURIComponent(id)}.png`),\n undefined,\n color,\n size,\n this._cache\n );\n};\n\n/**\n * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible\n * while still being contained completely within the pin.\n *\n * @param {String} text The text to be stamped onto the pin.\n * @param {Color} color The color of the pin.\n * @param {Number} size The size of the pin, in pixels.\n * @returns {HTMLCanvasElement} The canvas element that represents the generated pin.\n */\nPinBuilder.prototype.fromText = function (text, color, size) {\n return createPin(undefined, text, color, size, this._cache);\n};\n\nconst colorScratch = new Color();\n\n//This function (except for the 3 commented lines) was auto-generated from an online tool,\n//http://www.professorcloud.com/svg-to-canvas/, using Assets/Textures/pin.svg as input.\n//The reason we simply can't load and draw the SVG directly to the canvas is because\n//it taints the canvas in Internet Explorer (and possibly some other browsers); making\n//it impossible to create a WebGL texture from the result.\nfunction drawPin(context2D, color, size) {\n context2D.save();\n context2D.scale(size / 24, size / 24); //Added to auto-generated code to scale up to desired size.\n context2D.fillStyle = color.toCssColorString(); //Modified from auto-generated code.\n context2D.strokeStyle = color.brighten(0.6, colorScratch).toCssColorString(); //Modified from auto-generated code.\n context2D.lineWidth = 0.846;\n context2D.beginPath();\n context2D.moveTo(6.72, 0.422);\n context2D.lineTo(17.28, 0.422);\n context2D.bezierCurveTo(18.553, 0.422, 19.577, 1.758, 19.577, 3.415);\n context2D.lineTo(19.577, 10.973);\n context2D.bezierCurveTo(19.577, 12.63, 18.553, 13.966, 17.282, 13.966);\n context2D.lineTo(14.386, 14.008);\n context2D.lineTo(11.826, 23.578);\n context2D.lineTo(9.614, 14.008);\n context2D.lineTo(6.719, 13.965);\n context2D.bezierCurveTo(5.446, 13.983, 4.422, 12.629, 4.422, 10.972);\n context2D.lineTo(4.422, 3.416);\n context2D.bezierCurveTo(4.423, 1.76, 5.447, 0.423, 6.718, 0.423);\n context2D.closePath();\n context2D.fill();\n context2D.stroke();\n context2D.restore();\n}\n\n//This function takes an image or canvas and uses it as a template\n//to \"stamp\" the pin with a white image outlined in black. The color\n//values of the input image are ignored completely and only the alpha\n//values are used.\nfunction drawIcon(context2D, image, size) {\n //Size is the largest image that looks good inside of pin box.\n const imageSize = size / 2.5;\n let sizeX = imageSize;\n let sizeY = imageSize;\n\n if (image.width > image.height) {\n sizeY = imageSize * (image.height / image.width);\n } else if (image.width < image.height) {\n sizeX = imageSize * (image.width / image.height);\n }\n\n //x and y are the center of the pin box\n const x = Math.round((size - sizeX) / 2);\n const y = Math.round((7 / 24) * size - sizeY / 2);\n\n context2D.globalCompositeOperation = \"destination-out\";\n context2D.drawImage(image, x - 1, y, sizeX, sizeY);\n context2D.drawImage(image, x, y - 1, sizeX, sizeY);\n context2D.drawImage(image, x + 1, y, sizeX, sizeY);\n context2D.drawImage(image, x, y + 1, sizeX, sizeY);\n\n context2D.globalCompositeOperation = \"destination-over\";\n context2D.fillStyle = Color.BLACK.toCssColorString();\n context2D.fillRect(x - 1, y - 1, sizeX + 2, sizeY + 2);\n\n context2D.globalCompositeOperation = \"destination-out\";\n context2D.drawImage(image, x, y, sizeX, sizeY);\n\n context2D.globalCompositeOperation = \"destination-over\";\n context2D.fillStyle = Color.WHITE.toCssColorString();\n context2D.fillRect(x - 1, y - 2, sizeX + 2, sizeY + 2);\n}\n\nconst stringifyScratch = new Array(4);\nfunction createPin(url, label, color, size, cache) {\n //Use the parameters as a unique ID for caching.\n stringifyScratch[0] = url;\n stringifyScratch[1] = label;\n stringifyScratch[2] = color;\n stringifyScratch[3] = size;\n const id = JSON.stringify(stringifyScratch);\n\n const item = cache[id];\n if (defined(item)) {\n return item;\n }\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = size;\n canvas.height = size;\n\n const context2D = canvas.getContext(\"2d\");\n drawPin(context2D, color, size);\n\n if (defined(url)) {\n const resource = Resource.createIfNeeded(url);\n\n //If we have an image url, load it and then stamp the pin.\n const promise = resource.fetchImage().then(function (image) {\n drawIcon(context2D, image, size);\n cache[id] = canvas;\n return canvas;\n });\n cache[id] = promise;\n return promise;\n } else if (defined(label)) {\n //If we have a label, write it to a canvas and then stamp the pin.\n const image = writeTextToCanvas(label, {\n font: `bold ${size}px sans-serif`,\n });\n drawIcon(context2D, image, size);\n }\n\n cache[id] = canvas;\n return canvas;\n}\nexport default PinBuilder;\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\n\nexport default function(transform) {\n if (transform == null) return identity;\n var x0,\n y0,\n kx = transform.scale[0],\n ky = transform.scale[1],\n dx = transform.translate[0],\n dy = transform.translate[1];\n return function(input, i) {\n if (!i) x0 = y0 = 0;\n var j = 2, n = input.length, output = new Array(n);\n output[0] = (x0 += input[0]) * kx + dx;\n output[1] = (y0 += input[1]) * ky + dy;\n while (j < n) output[j] = input[j], ++j;\n return output;\n };\n}\n", "export default function(array, n) {\n var t, j = array.length, i = j - n;\n while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;\n}\n", "import reverse from \"./reverse.js\";\nimport transform from \"./transform.js\";\n\nexport default function(topology, o) {\n if (typeof o === \"string\") o = topology.objects[o];\n return o.type === \"GeometryCollection\"\n ? {type: \"FeatureCollection\", features: o.geometries.map(function(o) { return feature(topology, o); })}\n : feature(topology, o);\n}\n\nfunction feature(topology, o) {\n var id = o.id,\n bbox = o.bbox,\n properties = o.properties == null ? {} : o.properties,\n geometry = object(topology, o);\n return id == null && bbox == null ? {type: \"Feature\", properties: properties, geometry: geometry}\n : bbox == null ? {type: \"Feature\", id: id, properties: properties, geometry: geometry}\n : {type: \"Feature\", id: id, bbox: bbox, properties: properties, geometry: geometry};\n}\n\nexport function object(topology, o) {\n var transformPoint = transform(topology.transform),\n arcs = topology.arcs;\n\n function arc(i, points) {\n if (points.length) points.pop();\n for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {\n points.push(transformPoint(a[k], k));\n }\n if (i < 0) reverse(points, n);\n }\n\n function point(p) {\n return transformPoint(p);\n }\n\n function line(arcs) {\n var points = [];\n for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);\n if (points.length < 2) points.push(points[0]); // This should never happen per the specification.\n return points;\n }\n\n function ring(arcs) {\n var points = line(arcs);\n while (points.length < 4) points.push(points[0]); // This may happen if an arc has only two points.\n return points;\n }\n\n function polygon(arcs) {\n return arcs.map(ring);\n }\n\n function geometry(o) {\n var type = o.type, coordinates;\n switch (type) {\n case \"GeometryCollection\": return {type: type, geometries: o.geometries.map(geometry)};\n case \"Point\": coordinates = point(o.coordinates); break;\n case \"MultiPoint\": coordinates = o.coordinates.map(point); break;\n case \"LineString\": coordinates = line(o.arcs); break;\n case \"MultiLineString\": coordinates = o.arcs.map(line); break;\n case \"Polygon\": coordinates = polygon(o.arcs); break;\n case \"MultiPolygon\": coordinates = o.arcs.map(polygon); break;\n default: return null;\n }\n return {type: type, coordinates: coordinates};\n }\n\n return geometry(o);\n}\n", "import ArcType from \"../Core/ArcType.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport * as topojson from \"topojson-client\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CallbackProperty from \"./CallbackProperty.js\";\nimport ColorMaterialProperty from \"./ColorMaterialProperty.js\";\nimport ConstantPositionProperty from \"./ConstantPositionProperty.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\n\nfunction defaultCrsFunction(coordinates) {\n return Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2]);\n}\n\nconst crsNames = {\n \"urn:ogc:def:crs:OGC:1.3:CRS84\": defaultCrsFunction,\n \"EPSG:4326\": defaultCrsFunction,\n \"urn:ogc:def:crs:EPSG::4326\": defaultCrsFunction,\n};\n\nconst crsLinkHrefs = {};\nconst crsLinkTypes = {};\nlet defaultMarkerSize = 48;\nlet defaultMarkerSymbol;\nlet defaultMarkerColor = Color.ROYALBLUE;\nlet defaultStroke = Color.YELLOW;\nlet defaultStrokeWidth = 2;\nlet defaultFill = Color.fromBytes(255, 255, 0, 100);\nlet defaultClampToGround = false;\n\nconst sizes = {\n small: 24,\n medium: 48,\n large: 64,\n};\n\nconst simpleStyleIdentifiers = [\n \"title\",\n \"description\", //\n \"marker-size\",\n \"marker-symbol\",\n \"marker-color\",\n \"stroke\", //\n \"stroke-opacity\",\n \"stroke-width\",\n \"fill\",\n \"fill-opacity\",\n];\n\nfunction defaultDescribe(properties, nameProperty) {\n let html = \"\";\n for (const key in properties) {\n if (properties.hasOwnProperty(key)) {\n if (key === nameProperty || simpleStyleIdentifiers.indexOf(key) !== -1) {\n continue;\n }\n const value = properties[key];\n if (defined(value)) {\n if (typeof value === \"object\") {\n html += `<tr><th>${key}</th><td>${defaultDescribe(value)}</td></tr>`;\n } else {\n html += `<tr><th>${key}</th><td>${value}</td></tr>`;\n }\n }\n }\n }\n\n if (html.length > 0) {\n html = `<table class=\"cesium-infoBox-defaultTable\"><tbody>${html}</tbody></table>`;\n }\n\n return html;\n}\n\nfunction createDescriptionCallback(describe, properties, nameProperty) {\n let description;\n return function (time, result) {\n if (!defined(description)) {\n description = describe(properties, nameProperty);\n }\n return description;\n };\n}\n\nfunction defaultDescribeProperty(properties, nameProperty) {\n return new CallbackProperty(\n createDescriptionCallback(defaultDescribe, properties, nameProperty),\n true\n );\n}\n\n//GeoJSON specifies only the Feature object has a usable id property\n//But since \"multi\" geometries create multiple entity,\n//we can't use it for them either.\nfunction createObject(geoJson, entityCollection, describe) {\n let id = geoJson.id;\n if (!defined(id) || geoJson.type !== \"Feature\") {\n id = createGuid();\n } else {\n let i = 2;\n let finalId = id;\n while (defined(entityCollection.getById(finalId))) {\n finalId = `${id}_${i}`;\n i++;\n }\n id = finalId;\n }\n\n const entity = entityCollection.getOrCreateEntity(id);\n const properties = geoJson.properties;\n if (defined(properties)) {\n entity.properties = properties;\n\n let nameProperty;\n\n //Check for the simplestyle specified name first.\n const name = properties.title;\n if (defined(name)) {\n entity.name = name;\n nameProperty = \"title\";\n } else {\n //Else, find the name by selecting an appropriate property.\n //The name will be obtained based on this order:\n //1) The first case-insensitive property with the name 'title',\n //2) The first case-insensitive property with the name 'name',\n //3) The first property containing the word 'title'.\n //4) The first property containing the word 'name',\n let namePropertyPrecedence = Number.MAX_VALUE;\n for (const key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n const lowerKey = key.toLowerCase();\n\n if (namePropertyPrecedence > 1 && lowerKey === \"title\") {\n namePropertyPrecedence = 1;\n nameProperty = key;\n break;\n } else if (namePropertyPrecedence > 2 && lowerKey === \"name\") {\n namePropertyPrecedence = 2;\n nameProperty = key;\n } else if (namePropertyPrecedence > 3 && /title/i.test(key)) {\n namePropertyPrecedence = 3;\n nameProperty = key;\n } else if (namePropertyPrecedence > 4 && /name/i.test(key)) {\n namePropertyPrecedence = 4;\n nameProperty = key;\n }\n }\n }\n if (defined(nameProperty)) {\n entity.name = properties[nameProperty];\n }\n }\n\n const description = properties.description;\n if (description !== null) {\n entity.description = !defined(description)\n ? describe(properties, nameProperty)\n : new ConstantProperty(description);\n }\n }\n return entity;\n}\n\nfunction coordinatesArrayToCartesianArray(coordinates, crsFunction) {\n const positions = new Array(coordinates.length);\n for (let i = 0; i < coordinates.length; i++) {\n positions[i] = crsFunction(coordinates[i]);\n }\n return positions;\n}\n\nconst geoJsonObjectTypes = {\n Feature: processFeature,\n FeatureCollection: processFeatureCollection,\n GeometryCollection: processGeometryCollection,\n LineString: processLineString,\n MultiLineString: processMultiLineString,\n MultiPoint: processMultiPoint,\n MultiPolygon: processMultiPolygon,\n Point: processPoint,\n Polygon: processPolygon,\n Topology: processTopology,\n};\n\nconst geometryTypes = {\n GeometryCollection: processGeometryCollection,\n LineString: processLineString,\n MultiLineString: processMultiLineString,\n MultiPoint: processMultiPoint,\n MultiPolygon: processMultiPolygon,\n Point: processPoint,\n Polygon: processPolygon,\n Topology: processTopology,\n};\n\n// GeoJSON processing functions\nfunction processFeature(dataSource, feature, notUsed, crsFunction, options) {\n if (feature.geometry === null) {\n //Null geometry is allowed, so just create an empty entity instance for it.\n createObject(feature, dataSource._entityCollection, options.describe);\n return;\n }\n\n if (!defined(feature.geometry)) {\n throw new RuntimeError(\"feature.geometry is required.\");\n }\n\n const geometryType = feature.geometry.type;\n const geometryHandler = geometryTypes[geometryType];\n if (!defined(geometryHandler)) {\n throw new RuntimeError(`Unknown geometry type: ${geometryType}`);\n }\n geometryHandler(dataSource, feature, feature.geometry, crsFunction, options);\n}\n\nfunction processFeatureCollection(\n dataSource,\n featureCollection,\n notUsed,\n crsFunction,\n options\n) {\n const features = featureCollection.features;\n for (let i = 0, len = features.length; i < len; i++) {\n processFeature(dataSource, features[i], undefined, crsFunction, options);\n }\n}\n\nfunction processGeometryCollection(\n dataSource,\n geoJson,\n geometryCollection,\n crsFunction,\n options\n) {\n const geometries = geometryCollection.geometries;\n for (let i = 0, len = geometries.length; i < len; i++) {\n const geometry = geometries[i];\n const geometryType = geometry.type;\n const geometryHandler = geometryTypes[geometryType];\n if (!defined(geometryHandler)) {\n throw new RuntimeError(`Unknown geometry type: ${geometryType}`);\n }\n geometryHandler(dataSource, geoJson, geometry, crsFunction, options);\n }\n}\n\nfunction createPoint(dataSource, geoJson, crsFunction, coordinates, options) {\n let symbol = options.markerSymbol;\n let color = options.markerColor;\n let size = options.markerSize;\n\n const properties = geoJson.properties;\n if (defined(properties)) {\n const cssColor = properties[\"marker-color\"];\n if (defined(cssColor)) {\n color = Color.fromCssColorString(cssColor);\n }\n\n size = defaultValue(sizes[properties[\"marker-size\"]], size);\n const markerSymbol = properties[\"marker-symbol\"];\n if (defined(markerSymbol)) {\n symbol = markerSymbol;\n }\n }\n\n let canvasOrPromise;\n if (defined(symbol)) {\n if (symbol.length === 1) {\n canvasOrPromise = dataSource._pinBuilder.fromText(\n symbol.toUpperCase(),\n color,\n size\n );\n } else {\n canvasOrPromise = dataSource._pinBuilder.fromMakiIconId(\n symbol,\n color,\n size\n );\n }\n } else {\n canvasOrPromise = dataSource._pinBuilder.fromColor(color, size);\n }\n\n const billboard = new BillboardGraphics();\n billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM);\n\n // Clamp to ground if there isn't a height specified\n if (coordinates.length === 2 && options.clampToGround) {\n billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n }\n\n const entity = createObject(\n geoJson,\n dataSource._entityCollection,\n options.describe\n );\n entity.billboard = billboard;\n entity.position = new ConstantPositionProperty(crsFunction(coordinates));\n\n const promise = Promise.resolve(canvasOrPromise)\n .then(function (image) {\n billboard.image = new ConstantProperty(image);\n })\n .catch(function () {\n billboard.image = new ConstantProperty(\n dataSource._pinBuilder.fromColor(color, size)\n );\n });\n\n dataSource._promises.push(promise);\n}\n\nfunction processPoint(dataSource, geoJson, geometry, crsFunction, options) {\n createPoint(dataSource, geoJson, crsFunction, geometry.coordinates, options);\n}\n\nfunction processMultiPoint(\n dataSource,\n geoJson,\n geometry,\n crsFunction,\n options\n) {\n const coordinates = geometry.coordinates;\n for (let i = 0; i < coordinates.length; i++) {\n createPoint(dataSource, geoJson, crsFunction, coordinates[i], options);\n }\n}\n\nfunction createLineString(\n dataSource,\n geoJson,\n crsFunction,\n coordinates,\n options\n) {\n let material = options.strokeMaterialProperty;\n let widthProperty = options.strokeWidthProperty;\n\n const properties = geoJson.properties;\n if (defined(properties)) {\n const width = properties[\"stroke-width\"];\n if (defined(width)) {\n widthProperty = new ConstantProperty(width);\n }\n\n let color;\n const stroke = properties.stroke;\n if (defined(stroke)) {\n color = Color.fromCssColorString(stroke);\n }\n const opacity = properties[\"stroke-opacity\"];\n if (defined(opacity) && opacity !== 1.0) {\n if (!defined(color)) {\n color = material.color.getValue().clone();\n }\n color.alpha = opacity;\n }\n if (defined(color)) {\n material = new ColorMaterialProperty(color);\n }\n }\n\n const entity = createObject(\n geoJson,\n dataSource._entityCollection,\n options.describe\n );\n const polylineGraphics = new PolylineGraphics();\n entity.polyline = polylineGraphics;\n\n polylineGraphics.clampToGround = options.clampToGround;\n polylineGraphics.material = material;\n polylineGraphics.width = widthProperty;\n polylineGraphics.positions = new ConstantProperty(\n coordinatesArrayToCartesianArray(coordinates, crsFunction)\n );\n polylineGraphics.arcType = ArcType.RHUMB;\n}\n\nfunction processLineString(\n dataSource,\n geoJson,\n geometry,\n crsFunction,\n options\n) {\n createLineString(\n dataSource,\n geoJson,\n crsFunction,\n geometry.coordinates,\n options\n );\n}\n\nfunction processMultiLineString(\n dataSource,\n geoJson,\n geometry,\n crsFunction,\n options\n) {\n const lineStrings = geometry.coordinates;\n for (let i = 0; i < lineStrings.length; i++) {\n createLineString(dataSource, geoJson, crsFunction, lineStrings[i], options);\n }\n}\n\nfunction createPolygon(dataSource, geoJson, crsFunction, coordinates, options) {\n if (coordinates.length === 0 || coordinates[0].length === 0) {\n return;\n }\n\n let outlineColorProperty = options.strokeMaterialProperty.color;\n let material = options.fillMaterialProperty;\n let widthProperty = options.strokeWidthProperty;\n\n const properties = geoJson.properties;\n if (defined(properties)) {\n const width = properties[\"stroke-width\"];\n if (defined(width)) {\n widthProperty = new ConstantProperty(width);\n }\n\n let color;\n const stroke = properties.stroke;\n if (defined(stroke)) {\n color = Color.fromCssColorString(stroke);\n }\n let opacity = properties[\"stroke-opacity\"];\n if (defined(opacity) && opacity !== 1.0) {\n if (!defined(color)) {\n color = outlineColorProperty.getValue().clone();\n }\n color.alpha = opacity;\n }\n\n if (defined(color)) {\n outlineColorProperty = new ConstantProperty(color);\n }\n\n let fillColor;\n const fill = properties.fill;\n const materialColor = material.color.getValue();\n if (defined(fill)) {\n fillColor = Color.fromCssColorString(fill);\n fillColor.alpha = materialColor.alpha;\n }\n opacity = properties[\"fill-opacity\"];\n if (defined(opacity) && opacity !== materialColor.alpha) {\n if (!defined(fillColor)) {\n fillColor = materialColor.clone();\n }\n fillColor.alpha = opacity;\n }\n if (defined(fillColor)) {\n material = new ColorMaterialProperty(fillColor);\n }\n }\n\n const polygon = new PolygonGraphics();\n polygon.outline = new ConstantProperty(true);\n polygon.outlineColor = outlineColorProperty;\n polygon.outlineWidth = widthProperty;\n polygon.material = material;\n polygon.arcType = ArcType.RHUMB;\n\n const holes = [];\n for (let i = 1, len = coordinates.length; i < len; i++) {\n holes.push(\n new PolygonHierarchy(\n coordinatesArrayToCartesianArray(coordinates[i], crsFunction)\n )\n );\n }\n\n const positions = coordinates[0];\n polygon.hierarchy = new ConstantProperty(\n new PolygonHierarchy(\n coordinatesArrayToCartesianArray(positions, crsFunction),\n holes\n )\n );\n if (positions[0].length > 2) {\n polygon.perPositionHeight = new ConstantProperty(true);\n } else if (!options.clampToGround) {\n polygon.height = 0;\n }\n\n const entity = createObject(\n geoJson,\n dataSource._entityCollection,\n options.describe\n );\n entity.polygon = polygon;\n}\n\nfunction processPolygon(dataSource, geoJson, geometry, crsFunction, options) {\n createPolygon(\n dataSource,\n geoJson,\n crsFunction,\n geometry.coordinates,\n options\n );\n}\n\nfunction processMultiPolygon(\n dataSource,\n geoJson,\n geometry,\n crsFunction,\n options\n) {\n const polygons = geometry.coordinates;\n for (let i = 0; i < polygons.length; i++) {\n createPolygon(dataSource, geoJson, crsFunction, polygons[i], options);\n }\n}\n\nfunction processTopology(dataSource, geoJson, geometry, crsFunction, options) {\n for (const property in geometry.objects) {\n if (geometry.objects.hasOwnProperty(property)) {\n const feature = topojson.feature(geometry, geometry.objects[property]);\n const typeHandler = geoJsonObjectTypes[feature.type];\n typeHandler(dataSource, feature, feature, crsFunction, options);\n }\n }\n}\n\n/**\n * @typedef {Object} GeoJsonDataSource.LoadOptions\n *\n * Initialization options for the <code>load</code> method.\n *\n * @property {String} [sourceUri] Overrides the url to use for resolving relative links.\n * @property {GeoJsonDataSource.describe} [describe=GeoJsonDataSource.defaultDescribeProperty] A function which returns a Property object (or just a string).\n * @property {Number} [markerSize=GeoJsonDataSource.markerSize] The default size of the map pin created for each point, in pixels.\n * @property {String} [markerSymbol=GeoJsonDataSource.markerSymbol] The default symbol of the map pin created for each point.\n * @property {Color} [markerColor=GeoJsonDataSource.markerColor] The default color of the map pin created for each point.\n * @property {Color} [stroke=GeoJsonDataSource.stroke] The default color of polylines and polygon outlines.\n * @property {Number} [strokeWidth=GeoJsonDataSource.strokeWidth] The default width of polylines and polygon outlines.\n * @property {Color} [fill=GeoJsonDataSource.fill] The default color for polygon interiors.\n * @property {Boolean} [clampToGround=GeoJsonDataSource.clampToGround] true if we want the geometry features (polygons or linestrings) clamped to the ground.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * A {@link DataSource} which processes both\n * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.\n * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they\n * are present.\n *\n * @alias GeoJsonDataSource\n * @constructor\n *\n * @param {String} [name] The name of this data source. If undefined, a name will be taken from\n * the name of the GeoJSON file.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=GeoJSON%20and%20TopoJSON.html|Cesium Sandcastle GeoJSON and TopoJSON Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=GeoJSON%20simplestyle.html|Cesium Sandcastle GeoJSON simplestyle Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {\n * stroke: Cesium.Color.HOTPINK,\n * fill: Cesium.Color.PINK,\n * strokeWidth: 3,\n * markerSymbol: '?'\n * }));\n */\nfunction GeoJsonDataSource(name) {\n this._name = name;\n this._changed = new Event();\n this._error = new Event();\n this._isLoading = false;\n this._loading = new Event();\n this._entityCollection = new EntityCollection(this);\n this._promises = [];\n this._pinBuilder = new PinBuilder();\n this._entityCluster = new EntityCluster();\n this._credit = undefined;\n this._resourceCredits = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.\n *\n * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<GeoJsonDataSource>} A promise that will resolve when the data is loaded.\n */\nGeoJsonDataSource.load = function (data, options) {\n return new GeoJsonDataSource().load(data, options);\n};\n\nObject.defineProperties(GeoJsonDataSource, {\n /**\n * Gets or sets the default size of the map pin created for each point, in pixels.\n * @memberof GeoJsonDataSource\n * @type {Number}\n * @default 48\n */\n markerSize: {\n get: function () {\n return defaultMarkerSize;\n },\n set: function (value) {\n defaultMarkerSize = value;\n },\n },\n /**\n * Gets or sets the default symbol of the map pin created for each point.\n * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,\n * or blank if no symbol is to be used.\n * @memberof GeoJsonDataSource\n * @type {String}\n */\n markerSymbol: {\n get: function () {\n return defaultMarkerSymbol;\n },\n set: function (value) {\n defaultMarkerSymbol = value;\n },\n },\n /**\n * Gets or sets the default color of the map pin created for each point.\n * @memberof GeoJsonDataSource\n * @type {Color}\n * @default Color.ROYALBLUE\n */\n markerColor: {\n get: function () {\n return defaultMarkerColor;\n },\n set: function (value) {\n defaultMarkerColor = value;\n },\n },\n /**\n * Gets or sets the default color of polylines and polygon outlines.\n * @memberof GeoJsonDataSource\n * @type {Color}\n * @default Color.BLACK\n */\n stroke: {\n get: function () {\n return defaultStroke;\n },\n set: function (value) {\n defaultStroke = value;\n },\n },\n /**\n * Gets or sets the default width of polylines and polygon outlines.\n * @memberof GeoJsonDataSource\n * @type {Number}\n * @default 2.0\n */\n strokeWidth: {\n get: function () {\n return defaultStrokeWidth;\n },\n set: function (value) {\n defaultStrokeWidth = value;\n },\n },\n /**\n * Gets or sets default color for polygon interiors.\n * @memberof GeoJsonDataSource\n * @type {Color}\n * @default Color.YELLOW\n */\n fill: {\n get: function () {\n return defaultFill;\n },\n set: function (value) {\n defaultFill = value;\n },\n },\n /**\n * Gets or sets default of whether to clamp to the ground.\n * @memberof GeoJsonDataSource\n * @type {Boolean}\n * @default false\n */\n clampToGround: {\n get: function () {\n return defaultClampToGround;\n },\n set: function (value) {\n defaultClampToGround = value;\n },\n },\n\n /**\n * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate\n * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which\n * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,\n * for example 'EPSG:4326'.\n * @memberof GeoJsonDataSource\n * @type {Object}\n */\n crsNames: {\n get: function () {\n return crsNames;\n },\n },\n\n /**\n * Gets an object that maps the href property of a crs link to a callback function\n * which takes the crs properties object and returns a Promise that resolves\n * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.\n * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming\n * the link has a type specified.\n * @memberof GeoJsonDataSource\n * @type {Object}\n */\n crsLinkHrefs: {\n get: function () {\n return crsLinkHrefs;\n },\n },\n\n /**\n * Gets an object that maps the type property of a crs link to a callback function\n * which takes the crs properties object and returns a Promise that resolves\n * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.\n * Items in <code>crsLinkHrefs</code> take precedence over this object.\n * @memberof GeoJsonDataSource\n * @type {Object}\n */\n crsLinkTypes: {\n get: function () {\n return crsLinkTypes;\n },\n },\n});\n\nObject.defineProperties(GeoJsonDataSource.prototype, {\n /**\n * Gets or sets a human-readable name for this instance.\n * @memberof GeoJsonDataSource.prototype\n * @type {String}\n */\n name: {\n get: function () {\n return this._name;\n },\n set: function (value) {\n if (this._name !== value) {\n this._name = value;\n this._changed.raiseEvent(this);\n }\n },\n },\n /**\n * This DataSource only defines static data, therefore this property is always undefined.\n * @memberof GeoJsonDataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n value: undefined,\n writable: false,\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof GeoJsonDataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: function () {\n return this._entityCollection;\n },\n },\n /**\n * Gets a value indicating if the data source is currently loading data.\n * @memberof GeoJsonDataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: function () {\n return this._isLoading;\n },\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof GeoJsonDataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: function () {\n return this._changed;\n },\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof GeoJsonDataSource.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._error;\n },\n },\n /**\n * Gets an event that will be raised when the data source either starts or stops loading.\n * @memberof GeoJsonDataSource.prototype\n * @type {Event}\n */\n loadingEvent: {\n get: function () {\n return this._loading;\n },\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof GeoJsonDataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._entityCollection.show;\n },\n set: function (value) {\n this._entityCollection.show = value;\n },\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof GeoJsonDataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: function () {\n return this._entityCluster;\n },\n set: function (value) {\nthis._entityCluster = value;\n },\n },\n /**\n * Gets the credit that will be displayed for the data source\n * @memberof GeoJsonDataSource.prototype\n * @type {Credit}\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n});\n\n/**\n * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.\n *\n * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<GeoJsonDataSource>} a promise that will resolve when the GeoJSON is loaded.\n */\nGeoJsonDataSource.prototype.load = function (data, options) {\n return preload(this, data, options, true);\n};\n\n/**\n * Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.\n *\n * @param {Resource|String|Object} data A url, GeoJSON object, or TopoJSON object to be loaded.\n * @param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<GeoJsonDataSource>} a promise that will resolve when the GeoJSON is loaded.\n */\nGeoJsonDataSource.prototype.process = function (data, options) {\n return preload(this, data, options, false);\n};\n\nfunction preload(that, data, options, clear) {\n DataSource.setLoading(that, true);\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n // User specified credit\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n that._credit = credit;\n\n let promise = data;\n let sourceUri = options.sourceUri;\n if (typeof data === \"string\" || data instanceof Resource) {\n data = Resource.createIfNeeded(data);\n promise = data.fetchJson();\n sourceUri = defaultValue(sourceUri, data.getUrlComponent());\n\n // Add resource credits to our list of credits to display\n const resourceCredits = that._resourceCredits;\n const credits = data.credits;\n if (defined(credits)) {\n const length = credits.length;\n for (let i = 0; i < length; i++) {\n resourceCredits.push(credits[i]);\n }\n }\n }\n\n options = {\n describe: defaultValue(options.describe, defaultDescribeProperty),\n markerSize: defaultValue(options.markerSize, defaultMarkerSize),\n markerSymbol: defaultValue(options.markerSymbol, defaultMarkerSymbol),\n markerColor: defaultValue(options.markerColor, defaultMarkerColor),\n strokeWidthProperty: new ConstantProperty(\n defaultValue(options.strokeWidth, defaultStrokeWidth)\n ),\n strokeMaterialProperty: new ColorMaterialProperty(\n defaultValue(options.stroke, defaultStroke)\n ),\n fillMaterialProperty: new ColorMaterialProperty(\n defaultValue(options.fill, defaultFill)\n ),\n clampToGround: defaultValue(options.clampToGround, defaultClampToGround),\n };\n\n return Promise.resolve(promise)\n .then(function (geoJson) {\n return load(that, geoJson, options, sourceUri, clear);\n })\n .catch(function (error) {\n DataSource.setLoading(that, false);\n that._error.raiseEvent(that, error);\n throw error;\n });\n}\n\n/**\n * Updates the data source to the provided time. This function is optional and\n * is not required to be implemented. It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nGeoJsonDataSource.prototype.update = function (time) {\n return true;\n};\n\nfunction load(that, geoJson, options, sourceUri, clear) {\n let name;\n if (defined(sourceUri)) {\n name = getFilenameFromUri(sourceUri);\n }\n\n if (defined(name) && that._name !== name) {\n that._name = name;\n that._changed.raiseEvent(that);\n }\n\n const typeHandler = geoJsonObjectTypes[geoJson.type];\n if (!defined(typeHandler)) {\n throw new RuntimeError(`Unsupported GeoJSON object type: ${geoJson.type}`);\n }\n\n //Check for a Coordinate Reference System.\n const crs = geoJson.crs;\n let crsFunction = crs !== null ? defaultCrsFunction : null;\n\n if (defined(crs)) {\n if (!defined(crs.properties)) {\n throw new RuntimeError(\"crs.properties is undefined.\");\n }\n\n const properties = crs.properties;\n if (crs.type === \"name\") {\n crsFunction = crsNames[properties.name];\n if (!defined(crsFunction)) {\n throw new RuntimeError(`Unknown crs name: ${properties.name}`);\n }\n } else if (crs.type === \"link\") {\n let handler = crsLinkHrefs[properties.href];\n if (!defined(handler)) {\n handler = crsLinkTypes[properties.type];\n }\n\n if (!defined(handler)) {\n throw new RuntimeError(\n `Unable to resolve crs link: ${JSON.stringify(properties)}`\n );\n }\n\n crsFunction = handler(properties);\n } else if (crs.type === \"EPSG\") {\n crsFunction = crsNames[`EPSG:${properties.code}`];\n if (!defined(crsFunction)) {\n throw new RuntimeError(`Unknown crs EPSG code: ${properties.code}`);\n }\n } else {\n throw new RuntimeError(`Unknown crs type: ${crs.type}`);\n }\n }\n\n return Promise.resolve(crsFunction).then(function (crsFunction) {\n if (clear) {\n that._entityCollection.removeAll();\n }\n\n // null is a valid value for the crs, but means the entire load process becomes a no-op\n // because we can't assume anything about the coordinates.\n if (crsFunction !== null) {\n typeHandler(that, geoJson, geoJson, crsFunction, options);\n }\n\n return Promise.all(that._promises).then(function () {\n that._promises.length = 0;\n DataSource.setLoading(that, false);\n return that;\n });\n });\n}\n\n/**\n * This callback is displayed as part of the GeoJsonDataSource class.\n * @callback GeoJsonDataSource.describe\n * @param {Object} properties The properties of the feature.\n * @param {String} nameProperty The property key that Cesium estimates to have the name of the feature.\n */\nexport default GeoJsonDataSource;\n", null, null, null, null, null, null, null, null, "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport VerticalOrigin from \"../Scene/VerticalOrigin.js\";\nimport Autolinker from \"autolinker\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport ConstantProperty from \"./ConstantProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PolylineOutlineMaterialProperty from \"./PolylineOutlineMaterialProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\n\nlet parser;\nif (typeof DOMParser !== \"undefined\") {\n parser = new DOMParser();\n}\n\nconst autolinker = new Autolinker({\n stripPrefix: false,\n email: false,\n replaceFn: function (linker, match) {\n if (!match.protocolUrlMatch) {\n // Prevent matching of non-explicit urls.\n // i.e. foo.id won't match but http://foo.id will\n return false;\n }\n },\n});\n\nconst BILLBOARD_SIZE = 32;\nconst BILLBOARD_NEAR_DISTANCE = 2414016;\nconst BILLBOARD_NEAR_RATIO = 1.0;\nconst BILLBOARD_FAR_DISTANCE = 1.6093e7;\nconst BILLBOARD_FAR_RATIO = 0.1;\n\nconst gpxNamespaces = [null, undefined, \"http://www.topografix.com/GPX/1/1\"];\nconst namespaces = {\n gpx: gpxNamespaces,\n};\n\nfunction readBlobAsText(blob) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener(\"load\", function () {\n resolve(reader.result);\n });\n reader.addEventListener(\"error\", function () {\n reject(reader.error);\n });\n reader.readAsText(blob);\n });\n}\n\nfunction getOrCreateEntity(node, entityCollection) {\n let id = queryStringAttribute(node, \"id\");\n id = defined(id) ? id : createGuid();\n const entity = entityCollection.getOrCreateEntity(id);\n return entity;\n}\n\nfunction readCoordinateFromNode(node) {\n const longitude = queryNumericAttribute(node, \"lon\");\n const latitude = queryNumericAttribute(node, \"lat\");\n const elevation = queryNumericValue(node, \"ele\", namespaces.gpx);\n return Cartesian3.fromDegrees(longitude, latitude, elevation);\n}\n\nfunction queryNumericAttribute(node, attributeName) {\n if (!defined(node)) {\n return undefined;\n }\n\n const value = node.getAttribute(attributeName);\n if (value !== null) {\n const result = parseFloat(value);\n return !isNaN(result) ? result : undefined;\n }\n return undefined;\n}\n\nfunction queryStringAttribute(node, attributeName) {\n if (!defined(node)) {\n return undefined;\n }\n const value = node.getAttribute(attributeName);\n return value !== null ? value : undefined;\n}\n\nfunction queryFirstNode(node, tagName, namespace) {\n if (!defined(node)) {\n return undefined;\n }\n const childNodes = node.childNodes;\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === tagName &&\n namespace.indexOf(child.namespaceURI) !== -1\n ) {\n return child;\n }\n }\n return undefined;\n}\n\nfunction queryNodes(node, tagName, namespace) {\n if (!defined(node)) {\n return undefined;\n }\n const result = [];\n const childNodes = node.getElementsByTagName(tagName);\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === tagName &&\n namespace.indexOf(child.namespaceURI) !== -1\n ) {\n result.push(child);\n }\n }\n return result;\n}\n\nfunction queryNumericValue(node, tagName, namespace) {\n const resultNode = queryFirstNode(node, tagName, namespace);\n if (defined(resultNode)) {\n const result = parseFloat(resultNode.textContent);\n return !isNaN(result) ? result : undefined;\n }\n return undefined;\n}\n\nfunction queryStringValue(node, tagName, namespace) {\n const result = queryFirstNode(node, tagName, namespace);\n if (defined(result)) {\n return result.textContent.trim();\n }\n return undefined;\n}\n\nfunction createDefaultBillboard(image) {\n const billboard = new BillboardGraphics();\n billboard.width = BILLBOARD_SIZE;\n billboard.height = BILLBOARD_SIZE;\n billboard.scaleByDistance = new NearFarScalar(\n BILLBOARD_NEAR_DISTANCE,\n BILLBOARD_NEAR_RATIO,\n BILLBOARD_FAR_DISTANCE,\n BILLBOARD_FAR_RATIO\n );\n billboard.pixelOffsetScaleByDistance = new NearFarScalar(\n BILLBOARD_NEAR_DISTANCE,\n BILLBOARD_NEAR_RATIO,\n BILLBOARD_FAR_DISTANCE,\n BILLBOARD_FAR_RATIO\n );\n billboard.verticalOrigin = new ConstantProperty(VerticalOrigin.BOTTOM);\n billboard.image = image;\n return billboard;\n}\n\nfunction createDefaultLabel() {\n const label = new LabelGraphics();\n label.translucencyByDistance = new NearFarScalar(3000000, 1.0, 5000000, 0.0);\n label.pixelOffset = new Cartesian2(17, 0);\n label.horizontalOrigin = HorizontalOrigin.LEFT;\n label.font = \"16px sans-serif\";\n label.style = LabelStyle.FILL_AND_OUTLINE;\n return label;\n}\n\nfunction createDefaultPolyline(color) {\n const polyline = new PolylineGraphics();\n polyline.width = 4;\n polyline.material = new PolylineOutlineMaterialProperty();\n polyline.material.color = defined(color) ? color : Color.RED;\n polyline.material.outlineWidth = 2;\n polyline.material.outlineColor = Color.BLACK;\n return polyline;\n}\n\n// This is a list of the Optional Description Information:\n// <cmt> GPS comment of the waypoint\n// <desc> Descriptive description of the waypoint\n// <src> Source of the waypoint data\n// <type> Type (category) of waypoint\nconst descriptiveInfoTypes = {\n time: {\n text: \"Time\",\n tag: \"time\",\n },\n comment: {\n text: \"Comment\",\n tag: \"cmt\",\n },\n description: {\n text: \"Description\",\n tag: \"desc\",\n },\n source: {\n text: \"Source\",\n tag: \"src\",\n },\n number: {\n text: \"GPS track/route number\",\n tag: \"number\",\n },\n type: {\n text: \"Type\",\n tag: \"type\",\n },\n};\n\nlet scratchDiv;\nif (typeof document !== \"undefined\") {\n scratchDiv = document.createElement(\"div\");\n}\nfunction processDescription(node, entity) {\n let i;\n\n let text = \"\";\n const infoTypeNames = Object.keys(descriptiveInfoTypes);\n const length = infoTypeNames.length;\n for (i = 0; i < length; i++) {\n const infoTypeName = infoTypeNames[i];\n const infoType = descriptiveInfoTypes[infoTypeName];\n infoType.value = defaultValue(\n queryStringValue(node, infoType.tag, namespaces.gpx),\n \"\"\n );\n if (defined(infoType.value) && infoType.value !== \"\") {\n text = `${text}<p>${infoType.text}: ${infoType.value}</p>`;\n }\n }\n\n if (!defined(text) || text === \"\") {\n // No description\n return;\n }\n\n // Turns non-explicit links into clickable links.\n text = autolinker.link(text);\n\n // Use a temporary div to manipulate the links\n // so that they open in a new window.\n scratchDiv.innerHTML = text;\n const links = scratchDiv.querySelectorAll(\"a\");\n\n for (i = 0; i < links.length; i++) {\n links[i].setAttribute(\"target\", \"_blank\");\n }\n\n const background = Color.WHITE;\n const foreground = Color.BLACK;\n let tmp = '<div class=\"cesium-infoBox-description-lighter\" style=\"';\n tmp += \"overflow:auto;\";\n tmp += \"word-wrap:break-word;\";\n tmp += `background-color:${background.toCssColorString()};`;\n tmp += `color:${foreground.toCssColorString()};`;\n tmp += '\">';\n tmp += `${scratchDiv.innerHTML}</div>`;\n scratchDiv.innerHTML = \"\";\n\n // return the final HTML as the description.\n return tmp;\n}\n\nfunction processWpt(dataSource, geometryNode, entityCollection, options) {\n const position = readCoordinateFromNode(geometryNode);\n\n const entity = getOrCreateEntity(geometryNode, entityCollection);\n entity.position = position;\n\n // Get billboard image\n const image = defined(options.waypointImage)\n ? options.waypointImage\n : dataSource._pinBuilder.fromMakiIconId(\n \"marker\",\n Color.RED,\n BILLBOARD_SIZE\n );\n entity.billboard = createDefaultBillboard(image);\n\n const name = queryStringValue(geometryNode, \"name\", namespaces.gpx);\n entity.name = name;\n entity.label = createDefaultLabel();\n entity.label.text = name;\n entity.description = processDescription(geometryNode, entity);\n\n if (options.clampToGround) {\n entity.billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n entity.label.heightReference = HeightReference.CLAMP_TO_GROUND;\n }\n}\n\n// rte represents route - an ordered list of waypoints representing a series of turn points leading to a destination\nfunction processRte(dataSource, geometryNode, entityCollection, options) {\n const entity = getOrCreateEntity(geometryNode, entityCollection);\n entity.description = processDescription(geometryNode, entity);\n\n // a list of waypoint\n const routePoints = queryNodes(geometryNode, \"rtept\", namespaces.gpx);\n const coordinateTuples = new Array(routePoints.length);\n for (let i = 0; i < routePoints.length; i++) {\n processWpt(dataSource, routePoints[i], entityCollection, options);\n coordinateTuples[i] = readCoordinateFromNode(routePoints[i]);\n }\n entity.polyline = createDefaultPolyline(options.routeColor);\n if (options.clampToGround) {\n entity.polyline.clampToGround = true;\n }\n entity.polyline.positions = coordinateTuples;\n}\n\n// trk represents a track - an ordered list of points describing a path.\nfunction processTrk(dataSource, geometryNode, entityCollection, options) {\n const entity = getOrCreateEntity(geometryNode, entityCollection);\n entity.description = processDescription(geometryNode, entity);\n\n const trackSegs = queryNodes(geometryNode, \"trkseg\", namespaces.gpx);\n let positions = [];\n let times = [];\n let trackSegInfo;\n let isTimeDynamic = true;\n const property = new SampledPositionProperty();\n for (let i = 0; i < trackSegs.length; i++) {\n trackSegInfo = processTrkSeg(trackSegs[i]);\n positions = positions.concat(trackSegInfo.positions);\n if (trackSegInfo.times.length > 0) {\n times = times.concat(trackSegInfo.times);\n property.addSamples(times, positions);\n // if one track segment is non dynamic the whole track must also be\n isTimeDynamic = isTimeDynamic && true;\n } else {\n isTimeDynamic = false;\n }\n }\n if (isTimeDynamic) {\n // Assign billboard image\n const image = defined(options.waypointImage)\n ? options.waypointImage\n : dataSource._pinBuilder.fromMakiIconId(\n \"marker\",\n Color.RED,\n BILLBOARD_SIZE\n );\n entity.billboard = createDefaultBillboard(image);\n entity.position = property;\n if (options.clampToGround) {\n entity.billboard.heightReference = HeightReference.CLAMP_TO_GROUND;\n }\n entity.availability = new TimeIntervalCollection();\n entity.availability.addInterval(\n new TimeInterval({\n start: times[0],\n stop: times[times.length - 1],\n })\n );\n }\n entity.polyline = createDefaultPolyline(options.trackColor);\n entity.polyline.positions = positions;\n if (options.clampToGround) {\n entity.polyline.clampToGround = true;\n }\n}\n\nfunction processTrkSeg(node) {\n const result = {\n positions: [],\n times: [],\n };\n const trackPoints = queryNodes(node, \"trkpt\", namespaces.gpx);\n let time;\n for (let i = 0; i < trackPoints.length; i++) {\n const position = readCoordinateFromNode(trackPoints[i]);\n result.positions.push(position);\n\n time = queryStringValue(trackPoints[i], \"time\", namespaces.gpx);\n if (defined(time)) {\n result.times.push(JulianDate.fromIso8601(time));\n }\n }\n return result;\n}\n\n// Processes a metadataType node and returns a metadata object\n// {@link http://www.topografix.com/gpx/1/1/#type_metadataType|GPX Schema}\nfunction processMetadata(node) {\n const metadataNode = queryFirstNode(node, \"metadata\", namespaces.gpx);\n if (defined(metadataNode)) {\n const metadata = {\n name: queryStringValue(metadataNode, \"name\", namespaces.gpx),\n desc: queryStringValue(metadataNode, \"desc\", namespaces.gpx),\n author: getPerson(metadataNode),\n copyright: getCopyright(metadataNode),\n link: getLink(metadataNode),\n time: queryStringValue(metadataNode, \"time\", namespaces.gpx),\n keywords: queryStringValue(metadataNode, \"keywords\", namespaces.gpx),\n bounds: getBounds(metadataNode),\n };\n if (\n defined(metadata.name) ||\n defined(metadata.desc) ||\n defined(metadata.author) ||\n defined(metadata.copyright) ||\n defined(metadata.link) ||\n defined(metadata.time) ||\n defined(metadata.keywords) ||\n defined(metadata.bounds)\n ) {\n return metadata;\n }\n }\n return undefined;\n}\n\n// Receives a XML node and returns a personType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_personType|GPX Schema}\nfunction getPerson(node) {\n const personNode = queryFirstNode(node, \"author\", namespaces.gpx);\n if (defined(personNode)) {\n const person = {\n name: queryStringValue(personNode, \"name\", namespaces.gpx),\n email: getEmail(personNode),\n link: getLink(personNode),\n };\n if (defined(person.name) || defined(person.email) || defined(person.link)) {\n return person;\n }\n }\n return undefined;\n}\n\n// Receives a XML node and returns an email address (from emailType), refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_emailType|GPX Schema}\nfunction getEmail(node) {\n const emailNode = queryFirstNode(node, \"email\", namespaces.gpx);\n if (defined(emailNode)) {\n const id = queryStringValue(emailNode, \"id\", namespaces.gpx);\n const domain = queryStringValue(emailNode, \"domain\", namespaces.gpx);\n return `${id}@${domain}`;\n }\n return undefined;\n}\n\n// Receives a XML node and returns a linkType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_linkType|GPX Schema}\nfunction getLink(node) {\n const linkNode = queryFirstNode(node, \"link\", namespaces.gpx);\n if (defined(linkNode)) {\n const link = {\n href: queryStringAttribute(linkNode, \"href\"),\n text: queryStringValue(linkNode, \"text\", namespaces.gpx),\n mimeType: queryStringValue(linkNode, \"type\", namespaces.gpx),\n };\n if (defined(link.href) || defined(link.text) || defined(link.mimeType)) {\n return link;\n }\n }\n return undefined;\n}\n\n// Receives a XML node and returns a copyrightType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_copyrightType|GPX Schema}\nfunction getCopyright(node) {\n const copyrightNode = queryFirstNode(node, \"copyright\", namespaces.gpx);\n if (defined(copyrightNode)) {\n const copyright = {\n author: queryStringAttribute(copyrightNode, \"author\"),\n year: queryStringValue(copyrightNode, \"year\", namespaces.gpx),\n license: queryStringValue(copyrightNode, \"license\", namespaces.gpx),\n };\n if (\n defined(copyright.author) ||\n defined(copyright.year) ||\n defined(copyright.license)\n ) {\n return copyright;\n }\n }\n return undefined;\n}\n\n// Receives a XML node and returns a boundsType object, refer to\n// {@link http://www.topografix.com/gpx/1/1/#type_boundsType|GPX Schema}\nfunction getBounds(node) {\n const boundsNode = queryFirstNode(node, \"bounds\", namespaces.gpx);\n if (defined(boundsNode)) {\n const bounds = {\n minLat: queryNumericValue(boundsNode, \"minlat\", namespaces.gpx),\n maxLat: queryNumericValue(boundsNode, \"maxlat\", namespaces.gpx),\n minLon: queryNumericValue(boundsNode, \"minlon\", namespaces.gpx),\n maxLon: queryNumericValue(boundsNode, \"maxlon\", namespaces.gpx),\n };\n if (\n defined(bounds.minLat) ||\n defined(bounds.maxLat) ||\n defined(bounds.minLon) ||\n defined(bounds.maxLon)\n ) {\n return bounds;\n }\n }\n return undefined;\n}\n\nconst complexTypes = {\n wpt: processWpt,\n rte: processRte,\n trk: processTrk,\n};\n\nfunction processGpx(dataSource, node, entityCollection, options) {\n const complexTypeNames = Object.keys(complexTypes);\n const complexTypeNamesLength = complexTypeNames.length;\n\n for (let i = 0; i < complexTypeNamesLength; i++) {\n const typeName = complexTypeNames[i];\n const processComplexTypeNode = complexTypes[typeName];\n\n const childNodes = node.childNodes;\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === typeName &&\n namespaces.gpx.indexOf(child.namespaceURI) !== -1\n ) {\n processComplexTypeNode(dataSource, child, entityCollection, options);\n }\n }\n }\n}\n\nfunction loadGpx(dataSource, gpx, options) {\n const entityCollection = dataSource._entityCollection;\n\n entityCollection.removeAll();\n\n const element = gpx.documentElement;\n const version = queryStringAttribute(element, \"version\");\n const creator = queryStringAttribute(element, \"creator\");\n\n let name;\n const metadata = processMetadata(element);\n if (defined(metadata)) {\n name = metadata.name;\n }\n\n if (element.localName === \"gpx\") {\n processGpx(dataSource, element, entityCollection, options);\n } else {\n console.log(`GPX - Unsupported node: ${element.localName}`);\n }\n\n let clock;\n const availability = entityCollection.computeAvailability();\n\n let start = availability.start;\n let stop = availability.stop;\n const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n if (!isMinStart || !isMaxStop) {\n let date;\n\n // If start is min time just start at midnight this morning, local time\n if (isMinStart) {\n date = new Date();\n date.setHours(0, 0, 0, 0);\n start = JulianDate.fromDate(date);\n }\n\n // If stop is max value just stop at midnight tonight, local time\n if (isMaxStop) {\n date = new Date();\n date.setHours(24, 0, 0, 0);\n stop = JulianDate.fromDate(date);\n }\n\n clock = new DataSourceClock();\n clock.startTime = start;\n clock.stopTime = stop;\n clock.currentTime = JulianDate.clone(start);\n clock.clockRange = ClockRange.LOOP_STOP;\n clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n clock.multiplier = Math.round(\n Math.min(\n Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n 3.15569e7\n )\n );\n }\n let changed = false;\n if (dataSource._name !== name) {\n dataSource._name = name;\n changed = true;\n }\n\n if (dataSource._creator !== creator) {\n dataSource._creator = creator;\n changed = true;\n }\n\n if (metadataChanged(dataSource._metadata, metadata)) {\n dataSource._metadata = metadata;\n changed = true;\n }\n\n if (dataSource._version !== version) {\n dataSource._version = version;\n changed = true;\n }\n\n if (clock !== dataSource._clock) {\n changed = true;\n dataSource._clock = clock;\n }\n\n if (changed) {\n dataSource._changed.raiseEvent(dataSource);\n }\n\n DataSource.setLoading(dataSource, false);\n return dataSource;\n}\n\nfunction metadataChanged(old, current) {\n if (!defined(old) && !defined(current)) {\n return false;\n } else if (defined(old) && defined(current)) {\n if (\n old.name !== current.name ||\n old.dec !== current.desc ||\n old.src !== current.src ||\n old.author !== current.author ||\n old.copyright !== current.copyright ||\n old.link !== current.link ||\n old.time !== current.time ||\n old.bounds !== current.bounds\n ) {\n return true;\n }\n return false;\n }\n return true;\n}\n\nfunction load(dataSource, entityCollection, data, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let promise = data;\n if (typeof data === \"string\" || data instanceof Resource) {\n data = Resource.createIfNeeded(data);\n promise = data.fetchBlob();\n\n // Add resource credits to our list of credits to display\n const resourceCredits = dataSource._resourceCredits;\n const credits = data.credits;\n if (defined(credits)) {\n const length = credits.length;\n for (let i = 0; i < length; i++) {\n resourceCredits.push(credits[i]);\n }\n }\n }\n\n return Promise.resolve(promise)\n .then(function (dataToLoad) {\n if (dataToLoad instanceof Blob) {\n return readBlobAsText(dataToLoad).then(function (text) {\n // There's no official way to validate if a parse was successful.\n // The following check detects the error on various browsers.\n // IE raises an exception\n let gpx;\n let error;\n try {\n gpx = parser.parseFromString(text, \"application/xml\");\n } catch (e) {\n error = e.toString();\n }\n\n // The parse succeeds on Chrome and Firefox, but the error\n // handling is different in each.\n if (\n defined(error) ||\n gpx.body ||\n gpx.documentElement.tagName === \"parsererror\"\n ) {\n // Firefox has error information as the firstChild nodeValue.\n let msg = defined(error)\n ? error\n : gpx.documentElement.firstChild.nodeValue;\n\n // Chrome has it in the body text.\n if (!msg) {\n msg = gpx.body.innerText;\n }\n\n // Return the error\n throw new RuntimeError(msg);\n }\n return loadGpx(dataSource, gpx, options);\n });\n }\n return loadGpx(dataSource, dataToLoad, options);\n })\n .catch(function (error) {\n dataSource._error.raiseEvent(dataSource, error);\n console.log(error);\n return Promise.reject(error);\n });\n}\n\n/**\n * A {@link DataSource} which processes the GPS Exchange Format (GPX).\n *\n * @alias GpxDataSource\n * @constructor\n *\n * @see {@link http://www.topografix.com/gpx.asp|Topografix GPX Standard}\n * @see {@link http://www.topografix.com/gpx/1/1/|Topografix GPX Documentation}\n *\n * @demo {@link http://sandcastle.cesium.com/index.html?src=GPX.html}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));\n */\nfunction GpxDataSource() {\n this._changed = new Event();\n this._error = new Event();\n this._loading = new Event();\n this._clock = undefined;\n this._entityCollection = new EntityCollection();\n this._entityCluster = new EntityCluster();\n this._name = undefined;\n this._version = undefined;\n this._creator = undefined;\n this._metadata = undefined;\n this._isLoading = false;\n this._pinBuilder = new PinBuilder();\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided GPX data.\n *\n * @param {String|Document|Blob} data A url, parsed GPX document, or Blob containing binary GPX data.\n * @param {Object} [options] An object with the following properties:\n * @param {Boolean} [options.clampToGround] True if the symbols should be rendered at the same height as the terrain\n * @param {String} [options.waypointImage] Image to use for waypoint billboards.\n * @param {String} [options.trackImage] Image to use for track billboards.\n * @param {String} [options.trackColor] Color to use for track lines.\n * @param {String} [options.routeColor] Color to use for route lines.\n * @returns {Promise.<GpxDataSource>} A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.\n */\nGpxDataSource.load = function (data, options) {\n return new GpxDataSource().load(data, options);\n};\n\nObject.defineProperties(GpxDataSource.prototype, {\n /**\n * Gets a human-readable name for this instance.\n * This will be automatically be set to the GPX document name on load.\n * @memberof GpxDataSource.prototype\n * @type {String}\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * Gets the version of the GPX Schema in use.\n * @memberof GpxDataSource.prototype\n * @type {String}\n */\n version: {\n get: function () {\n return this._version;\n },\n },\n /**\n * Gets the creator of the GPX document.\n * @memberof GpxDataSource.prototype\n * @type {String}\n */\n creator: {\n get: function () {\n return this._creator;\n },\n },\n /**\n * Gets an object containing metadata about the GPX file.\n * @memberof GpxDataSource.prototype\n * @type {Object}\n */\n metadata: {\n get: function () {\n return this._metadata;\n },\n },\n /**\n * Gets the clock settings defined by the loaded GPX. This represents the total\n * availability interval for all time-dynamic data. If the GPX does not contain\n * time-dynamic data, this value is undefined.\n * @memberof GpxDataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof GpxDataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: function () {\n return this._entityCollection;\n },\n },\n /**\n * Gets a value indicating if the data source is currently loading data.\n * @memberof GpxDataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: function () {\n return this._isLoading;\n },\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof GpxDataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: function () {\n return this._changed;\n },\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof GpxDataSource.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._error;\n },\n },\n /**\n * Gets an event that will be raised when the data source either starts or stops loading.\n * @memberof GpxDataSource.prototype\n * @type {Event}\n */\n loadingEvent: {\n get: function () {\n return this._loading;\n },\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof GpxDataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._entityCollection.show;\n },\n set: function (value) {\n this._entityCollection.show = value;\n },\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof GpxDataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: function () {\n return this._entityCluster;\n },\n set: function (value) {\nthis._entityCluster = value;\n },\n },\n});\n\n/**\n * Updates the data source to the provided time. This function is optional and\n * is not required to be implemented. It is provided for data sources which\n * retrieve data based on the current animation time or scene state.\n * If implemented, update will be called by {@link DataSourceDisplay} once a frame.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nGpxDataSource.prototype.update = function (time) {\n return true;\n};\n\n/**\n * Asynchronously loads the provided GPX data, replacing any existing data.\n *\n * @param {String|Document|Blob} data A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.\n * @param {Object} [options] An object with the following properties:\n * @param {Boolean} [options.clampToGround] True if the symbols should be rendered at the same height as the terrain\n * @param {String} [options.waypointImage] Image to use for waypoint billboards.\n * @param {String} [options.trackImage] Image to use for track billboards.\n * @param {String} [options.trackColor] Color to use for track lines.\n * @param {String} [options.routeColor] Color to use for route lines.\n * @returns {Promise.<GpxDataSource>} A promise that will resolve to this instances once the GPX is loaded.\n */\nGpxDataSource.prototype.load = function (data, options) {\n if (!defined(data)) {\n throw new DeveloperError(\"data is required.\");\n }\n\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n DataSource.setLoading(this, true);\n const oldName = this._name;\n const that = this;\n return load(this, this._entityCollection, data, options)\n .then(function () {\n let clock;\n\n const availability = that._entityCollection.computeAvailability();\n\n let start = availability.start;\n let stop = availability.stop;\n const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n if (!isMinStart || !isMaxStop) {\n let date;\n\n // If start is min time just start at midnight this morning, local time\n if (isMinStart) {\n date = new Date();\n date.setHours(0, 0, 0, 0);\n start = JulianDate.fromDate(date);\n }\n\n // If stop is max value just stop at midnight tonight, local time\n if (isMaxStop) {\n date = new Date();\n date.setHours(24, 0, 0, 0);\n stop = JulianDate.fromDate(date);\n }\n\n clock = new DataSourceClock();\n clock.startTime = start;\n clock.stopTime = stop;\n clock.currentTime = JulianDate.clone(start);\n clock.clockRange = ClockRange.LOOP_STOP;\n clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n clock.multiplier = Math.round(\n Math.min(\n Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n 3.15569e7\n )\n );\n }\n\n let changed = false;\n if (clock !== that._clock) {\n that._clock = clock;\n changed = true;\n }\n\n if (oldName !== that._name) {\n changed = true;\n }\n\n if (changed) {\n that._changed.raiseEvent(that);\n }\n\n DataSource.setLoading(that, false);\n\n return that;\n })\n .catch(function (error) {\n DataSource.setLoading(that, false);\n that._error.raiseEvent(that, error);\n console.log(error);\n return Promise.reject(error);\n });\n};\n\nexport default GpxDataSource;\n", "/**\n * Representation of <Camera> from KML\n * @alias KmlCamera\n * @constructor\n *\n * @param {Cartesian3} position camera position\n * @param {HeadingPitchRoll} headingPitchRoll camera orientation\n */\nfunction KmlCamera(position, headingPitchRoll) {\n this.position = position;\n this.headingPitchRoll = headingPitchRoll;\n}\nexport default KmlCamera;\n", "import ArcType from \"../Core/ArcType.js\";\nimport AssociativeArray from \"../Core/AssociativeArray.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport ClockRange from \"../Core/ClockRange.js\";\nimport ClockStep from \"../Core/ClockStep.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defer from \"../Core/defer.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport Event from \"../Core/Event.js\";\nimport getExtensionFromUri from \"../Core/getExtensionFromUri.js\";\nimport getFilenameFromUri from \"../Core/getFilenameFromUri.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport Iso8601 from \"../Core/Iso8601.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport objectToQuery from \"../Core/objectToQuery.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport PinBuilder from \"../Core/PinBuilder.js\";\nimport PolygonHierarchy from \"../Core/PolygonHierarchy.js\";\nimport queryToObject from \"../Core/queryToObject.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TimeInterval from \"../Core/TimeInterval.js\";\nimport TimeIntervalCollection from \"../Core/TimeIntervalCollection.js\";\nimport HeightReference from \"../Scene/HeightReference.js\";\nimport HorizontalOrigin from \"../Scene/HorizontalOrigin.js\";\nimport LabelStyle from \"../Scene/LabelStyle.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport Autolinker from \"autolinker\";\nimport Uri from \"urijs\";\nimport * as zip from \"@zip.js/zip.js/lib/zip-no-worker.js\";\nimport getElement from \"../Widgets/getElement.js\";\nimport BillboardGraphics from \"./BillboardGraphics.js\";\nimport CompositePositionProperty from \"./CompositePositionProperty.js\";\nimport DataSource from \"./DataSource.js\";\nimport DataSourceClock from \"./DataSourceClock.js\";\nimport Entity from \"./Entity.js\";\nimport EntityCluster from \"./EntityCluster.js\";\nimport EntityCollection from \"./EntityCollection.js\";\nimport KmlCamera from \"./KmlCamera.js\";\nimport KmlLookAt from \"./KmlLookAt.js\";\nimport KmlTour from \"./KmlTour.js\";\nimport KmlTourFlyTo from \"./KmlTourFlyTo.js\";\nimport KmlTourWait from \"./KmlTourWait.js\";\nimport LabelGraphics from \"./LabelGraphics.js\";\nimport PathGraphics from \"./PathGraphics.js\";\nimport PolygonGraphics from \"./PolygonGraphics.js\";\nimport PolylineGraphics from \"./PolylineGraphics.js\";\nimport PositionPropertyArray from \"./PositionPropertyArray.js\";\nimport RectangleGraphics from \"./RectangleGraphics.js\";\nimport ReferenceProperty from \"./ReferenceProperty.js\";\nimport SampledPositionProperty from \"./SampledPositionProperty.js\";\nimport ScaledPositionProperty from \"./ScaledPositionProperty.js\";\nimport TimeIntervalCollectionProperty from \"./TimeIntervalCollectionProperty.js\";\nimport WallGraphics from \"./WallGraphics.js\";\n\n//This is by no means an exhaustive list of MIME types.\n//The purpose of this list is to be able to accurately identify content embedded\n//in KMZ files. Eventually, we can make this configurable by the end user so they can add\n//there own content types if they have KMZ files that require it.\nconst MimeTypes = {\n avi: \"video/x-msvideo\",\n bmp: \"image/bmp\",\n bz2: \"application/x-bzip2\",\n chm: \"application/vnd.ms-htmlhelp\",\n css: \"text/css\",\n csv: \"text/csv\",\n doc: \"application/msword\",\n dvi: \"application/x-dvi\",\n eps: \"application/postscript\",\n flv: \"video/x-flv\",\n gif: \"image/gif\",\n gz: \"application/x-gzip\",\n htm: \"text/html\",\n html: \"text/html\",\n ico: \"image/vnd.microsoft.icon\",\n jnlp: \"application/x-java-jnlp-file\",\n jpeg: \"image/jpeg\",\n jpg: \"image/jpeg\",\n m3u: \"audio/x-mpegurl\",\n m4v: \"video/mp4\",\n mathml: \"application/mathml+xml\",\n mid: \"audio/midi\",\n midi: \"audio/midi\",\n mov: \"video/quicktime\",\n mp3: \"audio/mpeg\",\n mp4: \"video/mp4\",\n mp4v: \"video/mp4\",\n mpeg: \"video/mpeg\",\n mpg: \"video/mpeg\",\n odp: \"application/vnd.oasis.opendocument.presentation\",\n ods: \"application/vnd.oasis.opendocument.spreadsheet\",\n odt: \"application/vnd.oasis.opendocument.text\",\n ogg: \"application/ogg\",\n pdf: \"application/pdf\",\n png: \"image/png\",\n pps: \"application/vnd.ms-powerpoint\",\n ppt: \"application/vnd.ms-powerpoint\",\n ps: \"application/postscript\",\n qt: \"video/quicktime\",\n rdf: \"application/rdf+xml\",\n rss: \"application/rss+xml\",\n rtf: \"application/rtf\",\n svg: \"image/svg+xml\",\n swf: \"application/x-shockwave-flash\",\n text: \"text/plain\",\n tif: \"image/tiff\",\n tiff: \"image/tiff\",\n txt: \"text/plain\",\n wav: \"audio/x-wav\",\n wma: \"audio/x-ms-wma\",\n wmv: \"video/x-ms-wmv\",\n xml: \"application/xml\",\n zip: \"application/zip\",\n\n detectFromFilename: function (filename) {\n let ext = filename.toLowerCase();\n ext = getExtensionFromUri(ext);\n return MimeTypes[ext];\n },\n};\n\nlet parser;\nif (typeof DOMParser !== \"undefined\") {\n parser = new DOMParser();\n}\n\nconst autolinker = new Autolinker({\n stripPrefix: false,\n email: false,\n replaceFn: function (match) {\n if (!match.protocolUrlMatch) {\n //Prevent matching of non-explicit urls.\n //i.e. foo.id won't match but http://foo.id will\n return false;\n }\n },\n});\n\nconst BILLBOARD_SIZE = 32;\n\nconst BILLBOARD_NEAR_DISTANCE = 2414016;\nconst BILLBOARD_NEAR_RATIO = 1.0;\nconst BILLBOARD_FAR_DISTANCE = 1.6093e7;\nconst BILLBOARD_FAR_RATIO = 0.1;\n\nconst kmlNamespaces = [\n null,\n undefined,\n \"http://www.opengis.net/kml/2.2\",\n \"http://earth.google.com/kml/2.2\",\n \"http://earth.google.com/kml/2.1\",\n \"http://earth.google.com/kml/2.0\",\n];\nconst gxNamespaces = [\"http://www.google.com/kml/ext/2.2\"];\nconst atomNamespaces = [\"http://www.w3.org/2005/Atom\"];\nconst namespaces = {\n kml: kmlNamespaces,\n gx: gxNamespaces,\n atom: atomNamespaces,\n kmlgx: kmlNamespaces.concat(gxNamespaces),\n};\n\n// Ensure Specs/Data/KML/unsupported.kml is kept up to date with these supported types\nconst featureTypes = {\n Document: processDocument,\n Folder: processFolder,\n Placemark: processPlacemark,\n NetworkLink: processNetworkLink,\n GroundOverlay: processGroundOverlay,\n PhotoOverlay: processUnsupportedFeature,\n ScreenOverlay: processScreenOverlay,\n Tour: processTour,\n};\n\nfunction DeferredLoading(dataSource) {\n this._dataSource = dataSource;\n this._deferred = defer();\n this._stack = [];\n this._promises = [];\n this._timeoutSet = false;\n this._used = false;\n\n this._started = 0;\n this._timeThreshold = 1000; // Initial load is 1 second\n}\n\nObject.defineProperties(DeferredLoading.prototype, {\n dataSource: {\n get: function () {\n return this._dataSource;\n },\n },\n});\n\nDeferredLoading.prototype.addNodes = function (nodes, processingData) {\n this._stack.push({\n nodes: nodes,\n index: 0,\n processingData: processingData,\n });\n this._used = true;\n};\n\nDeferredLoading.prototype.addPromise = function (promise) {\n this._promises.push(promise);\n};\n\nDeferredLoading.prototype.wait = function () {\n // Case where we had a non-document/folder as the root\n const deferred = this._deferred;\n if (!this._used) {\n deferred.resolve();\n }\n\n return Promise.all([deferred.promise, Promise.all(this._promises)]);\n};\n\nDeferredLoading.prototype.process = function () {\n const isFirstCall = this._stack.length === 1;\n if (isFirstCall) {\n this._started = KmlDataSource._getTimestamp();\n }\n\n return this._process(isFirstCall);\n};\n\nDeferredLoading.prototype._giveUpTime = function () {\n if (this._timeoutSet) {\n // Timeout was already set so just return\n return;\n }\n\n this._timeoutSet = true;\n this._timeThreshold = 50; // After the first load lower threshold to 0.5 seconds\n const that = this;\n setTimeout(function () {\n that._timeoutSet = false;\n that._started = KmlDataSource._getTimestamp();\n that._process(true);\n }, 0);\n};\n\nDeferredLoading.prototype._nextNode = function () {\n const stack = this._stack;\n const top = stack[stack.length - 1];\n const index = top.index;\n const nodes = top.nodes;\n if (index === nodes.length) {\n return;\n }\n ++top.index;\n\n return nodes[index];\n};\n\nDeferredLoading.prototype._pop = function () {\n const stack = this._stack;\n stack.pop();\n\n // Return false if we are done\n if (stack.length === 0) {\n this._deferred.resolve();\n return false;\n }\n\n return true;\n};\n\nDeferredLoading.prototype._process = function (isFirstCall) {\n const dataSource = this.dataSource;\n const processingData = this._stack[this._stack.length - 1].processingData;\n\n let child = this._nextNode();\n while (defined(child)) {\n const featureProcessor = featureTypes[child.localName];\n if (\n defined(featureProcessor) &&\n (namespaces.kml.indexOf(child.namespaceURI) !== -1 ||\n namespaces.gx.indexOf(child.namespaceURI) !== -1)\n ) {\n featureProcessor(dataSource, child, processingData, this);\n\n // Give up time and continue loading later\n if (\n this._timeoutSet ||\n KmlDataSource._getTimestamp() > this._started + this._timeThreshold\n ) {\n this._giveUpTime();\n return;\n }\n }\n\n child = this._nextNode();\n }\n\n // If we are a recursive call from a subfolder, just return so the parent folder can continue processing\n // If we aren't then make another call to processNodes because there is stuff still left in the queue\n if (this._pop() && isFirstCall) {\n this._process(true);\n }\n};\n\nfunction isZipFile(blob) {\n const magicBlob = blob.slice(0, Math.min(4, blob.size));\n const deferred = defer();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function () {\n deferred.resolve(\n new DataView(reader.result).getUint32(0, false) === 0x504b0304\n );\n });\n reader.addEventListener(\"error\", function () {\n deferred.reject(reader.error);\n });\n reader.readAsArrayBuffer(magicBlob);\n return deferred.promise;\n}\n\nfunction readBlobAsText(blob) {\n const deferred = defer();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function () {\n deferred.resolve(reader.result);\n });\n reader.addEventListener(\"error\", function () {\n deferred.reject(reader.error);\n });\n reader.readAsText(blob);\n return deferred.promise;\n}\n\nfunction insertNamespaces(text) {\n const namespaceMap = {\n xsi: \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n let firstPart, lastPart, reg, declaration;\n\n for (const key in namespaceMap) {\n if (namespaceMap.hasOwnProperty(key)) {\n reg = RegExp(`[< ]${key}:`);\n declaration = `xmlns:${key}=`;\n if (reg.test(text) && text.indexOf(declaration) === -1) {\n if (!defined(firstPart)) {\n firstPart = text.substr(0, text.indexOf(\"<kml\") + 4);\n lastPart = text.substr(firstPart.length);\n }\n firstPart += ` ${declaration}\"${namespaceMap[key]}\"`;\n }\n }\n }\n\n if (defined(firstPart)) {\n text = firstPart + lastPart;\n }\n\n return text;\n}\n\nfunction removeDuplicateNamespaces(text) {\n let index = text.indexOf(\"xmlns:\");\n const endDeclaration = text.indexOf(\">\", index);\n let namespace, startIndex, endIndex;\n\n while (index !== -1 && index < endDeclaration) {\n namespace = text.slice(index, text.indexOf('\"', index));\n startIndex = index;\n index = text.indexOf(namespace, index + 1);\n if (index !== -1) {\n endIndex = text.indexOf('\"', text.indexOf('\"', index) + 1);\n text = text.slice(0, index - 1) + text.slice(endIndex + 1, text.length);\n index = text.indexOf(\"xmlns:\", startIndex - 1);\n } else {\n index = text.indexOf(\"xmlns:\", startIndex + 1);\n }\n }\n\n return text;\n}\n\nfunction loadXmlFromZip(entry, uriResolver) {\n return Promise.resolve(entry.getData(new zip.TextWriter())).then(function (\n text\n ) {\n text = insertNamespaces(text);\n text = removeDuplicateNamespaces(text);\n uriResolver.kml = parser.parseFromString(text, \"application/xml\");\n });\n}\n\nfunction loadDataUriFromZip(entry, uriResolver) {\n const mimeType = defaultValue(\n MimeTypes.detectFromFilename(entry.filename),\n \"application/octet-stream\"\n );\n return Promise.resolve(entry.getData(new zip.Data64URIWriter(mimeType))).then(\n function (dataUri) {\n uriResolver[entry.filename] = dataUri;\n }\n );\n}\n\nfunction embedDataUris(div, elementType, attributeName, uriResolver) {\n const keys = uriResolver.keys;\n const baseUri = new Uri(\".\");\n const elements = div.querySelectorAll(elementType);\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n const value = element.getAttribute(attributeName);\n if (defined(value)) {\n const relativeUri = new Uri(value);\n const uri = relativeUri.absoluteTo(baseUri).toString();\n const index = keys.indexOf(uri);\n if (index !== -1) {\n const key = keys[index];\n element.setAttribute(attributeName, uriResolver[key]);\n if (elementType === \"a\" && element.getAttribute(\"download\") === null) {\n element.setAttribute(\"download\", key);\n }\n }\n }\n }\n}\n\nfunction applyBasePath(div, elementType, attributeName, sourceResource) {\n const elements = div.querySelectorAll(elementType);\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i];\n const value = element.getAttribute(attributeName);\n const resource = resolveHref(value, sourceResource);\n if (defined(resource)) {\n element.setAttribute(attributeName, resource.url);\n }\n }\n}\n\n// an optional context is passed to allow for some malformed kmls (those with multiple geometries with same ids) to still parse\n// correctly, as they do in Google Earth.\nfunction createEntity(node, entityCollection, context) {\n let id = queryStringAttribute(node, \"id\");\n id = defined(id) && id.length !== 0 ? id : createGuid();\n if (defined(context)) {\n id = context + id;\n }\n\n // If we have a duplicate ID just generate one.\n // This isn't valid KML but Google Earth handles this case.\n let entity = entityCollection.getById(id);\n if (defined(entity)) {\n id = createGuid();\n if (defined(context)) {\n id = context + id;\n }\n }\n\n entity = entityCollection.add(new Entity({ id: id }));\n if (!defined(entity.kml)) {\n entity.addProperty(\"kml\");\n entity.kml = new KmlFeatureData();\n }\n return entity;\n}\n\nfunction isExtrudable(altitudeMode, gxAltitudeMode) {\n return (\n altitudeMode === \"absolute\" ||\n altitudeMode === \"relativeToGround\" ||\n gxAltitudeMode === \"relativeToSeaFloor\"\n );\n}\n\nfunction readCoordinate(value, ellipsoid) {\n //Google Earth treats empty or missing coordinates as 0.\n if (!defined(value)) {\n return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);\n }\n\n const digits = value.match(/[^\\s,\\n]+/g);\n if (!defined(digits)) {\n return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);\n }\n\n let longitude = parseFloat(digits[0]);\n let latitude = parseFloat(digits[1]);\n let height = parseFloat(digits[2]);\n\n longitude = isNaN(longitude) ? 0.0 : longitude;\n latitude = isNaN(latitude) ? 0.0 : latitude;\n height = isNaN(height) ? 0.0 : height;\n\n return Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid);\n}\n\nfunction readCoordinates(element, ellipsoid) {\n if (!defined(element)) {\n return undefined;\n }\n\n const tuples = element.textContent.match(/[^\\s\\n]+/g);\n if (!defined(tuples)) {\n return undefined;\n }\n\n const length = tuples.length;\n const result = new Array(length);\n let resultIndex = 0;\n for (let i = 0; i < length; i++) {\n result[resultIndex++] = readCoordinate(tuples[i], ellipsoid);\n }\n return result;\n}\n\nfunction queryNumericAttribute(node, attributeName) {\n if (!defined(node)) {\n return undefined;\n }\n\n const value = node.getAttribute(attributeName);\n if (value !== null) {\n const result = parseFloat(value);\n return !isNaN(result) ? result : undefined;\n }\n return undefined;\n}\n\nfunction queryStringAttribute(node, attributeName) {\n if (!defined(node)) {\n return undefined;\n }\n const value = node.getAttribute(attributeName);\n return value !== null ? value : undefined;\n}\n\nfunction queryFirstNode(node, tagName, namespace) {\n if (!defined(node)) {\n return undefined;\n }\n const childNodes = node.childNodes;\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === tagName &&\n namespace.indexOf(child.namespaceURI) !== -1\n ) {\n return child;\n }\n }\n return undefined;\n}\n\nfunction queryNodes(node, tagName, namespace) {\n if (!defined(node)) {\n return undefined;\n }\n const result = [];\n const childNodes = node.getElementsByTagNameNS(\"*\", tagName);\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === tagName &&\n namespace.indexOf(child.namespaceURI) !== -1\n ) {\n result.push(child);\n }\n }\n return result;\n}\n\nfunction queryChildNodes(node, tagName, namespace) {\n if (!defined(node)) {\n return [];\n }\n const result = [];\n const childNodes = node.childNodes;\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (\n child.localName === tagName &&\n namespace.indexOf(child.namespaceURI) !== -1\n ) {\n result.push(child);\n }\n }\n return result;\n}\n\nfunction queryNumericValue(node, tagName, namespace) {\n const resultNode = queryFirstNode(node, tagName, namespace);\n if (defined(resultNode)) {\n const result = parseFloat(resultNode.textContent);\n return !isNaN(result) ? result : undefined;\n }\n return undefined;\n}\n\nfunction queryStringValue(node, tagName, namespace) {\n const result = queryFirstNode(node, tagName, namespace);\n if (defined(result)) {\n return result.textContent.trim();\n }\n return undefined;\n}\n\nfunction queryBooleanValue(node, tagName, namespace) {\n const result = queryFirstNode(node, tagName, namespace);\n if (defined(result)) {\n const value = result.textContent.trim();\n return value === \"1\" || /^true$/i.test(value);\n }\n return undefined;\n}\n\nfunction resolveHref(href, sourceResource, uriResolver) {\n if (!defined(href)) {\n return undefined;\n }\n\n let resource;\n if (defined(uriResolver)) {\n // To resolve issues with KML sources defined in Windows style paths.\n href = href.replace(/\\\\/g, \"/\");\n let blob = uriResolver[href];\n if (defined(blob)) {\n resource = new Resource({\n url: blob,\n });\n } else {\n // Needed for multiple levels of KML files in a KMZ\n const baseUri = new Uri(sourceResource.getUrlComponent());\n const uri = new Uri(href);\n blob = uriResolver[uri.absoluteTo(baseUri)];\n if (defined(blob)) {\n resource = new Resource({\n url: blob,\n });\n }\n }\n }\n\n if (!defined(resource)) {\n resource = sourceResource.getDerivedResource({\n url: href,\n });\n }\n\n return resource;\n}\n\nconst colorOptions = {\n maximumRed: undefined,\n red: undefined,\n maximumGreen: undefined,\n green: undefined,\n maximumBlue: undefined,\n blue: undefined,\n};\n\nfunction parseColorString(value, isRandom) {\n if (!defined(value) || /^\\s*$/gm.test(value)) {\n return undefined;\n }\n\n if (value[0] === \"#\") {\n value = value.substring(1);\n }\n\n const alpha = parseInt(value.substring(0, 2), 16) / 255.0;\n const blue = parseInt(value.substring(2, 4), 16) / 255.0;\n const green = parseInt(value.substring(4, 6), 16) / 255.0;\n const red = parseInt(value.substring(6, 8), 16) / 255.0;\n\n if (!isRandom) {\n return new Color(red, green, blue, alpha);\n }\n\n if (red > 0) {\n colorOptions.maximumRed = red;\n colorOptions.red = undefined;\n } else {\n colorOptions.maximumRed = undefined;\n colorOptions.red = 0;\n }\n if (green > 0) {\n colorOptions.maximumGreen = green;\n colorOptions.green = undefined;\n } else {\n colorOptions.maximumGreen = undefined;\n colorOptions.green = 0;\n }\n if (blue > 0) {\n colorOptions.maximumBlue = blue;\n colorOptions.blue = undefined;\n } else {\n colorOptions.maximumBlue = undefined;\n colorOptions.blue = 0;\n }\n colorOptions.alpha = alpha;\n return Color.fromRandom(colorOptions);\n}\n\nfunction queryColorValue(node, tagName, namespace) {\n const value = queryStringValue(node, tagName, namespace);\n if (!defined(value)) {\n return undefined;\n }\n return parseColorString(\n value,\n queryStringValue(node, \"colorMode\", namespace) === \"random\"\n );\n}\n\nfunction processTimeStamp(featureNode) {\n const node = queryFirstNode(featureNode, \"TimeStamp\", namespaces.kmlgx);\n const whenString = queryStringValue(node, \"when\", namespaces.kmlgx);\n\n if (!defined(node) || !defined(whenString) || whenString.length === 0) {\n return undefined;\n }\n\n //According to the KML spec, a TimeStamp represents a \"single moment in time\"\n //However, since Cesium animates much differently than Google Earth, that doesn't\n //Make much sense here. Instead, we use the TimeStamp as the moment the feature\n //comes into existence. This works much better and gives a similar feel to\n //GE's experience.\n const when = JulianDate.fromIso8601(whenString);\n const result = new TimeIntervalCollection();\n result.addInterval(\n new TimeInterval({\n start: when,\n stop: Iso8601.MAXIMUM_VALUE,\n })\n );\n return result;\n}\n\nfunction processTimeSpan(featureNode) {\n const node = queryFirstNode(featureNode, \"TimeSpan\", namespaces.kmlgx);\n if (!defined(node)) {\n return undefined;\n }\n let result;\n\n const beginNode = queryFirstNode(node, \"begin\", namespaces.kmlgx);\n let beginDate = defined(beginNode)\n ? JulianDate.fromIso8601(beginNode.textContent)\n : undefined;\n\n const endNode = queryFirstNode(node, \"end\", namespaces.kmlgx);\n let endDate = defined(endNode)\n ? JulianDate.fromIso8601(endNode.textContent)\n : undefined;\n\n if (defined(beginDate) && defined(endDate)) {\n if (JulianDate.lessThan(endDate, beginDate)) {\n const tmp = beginDate;\n beginDate = endDate;\n endDate = tmp;\n }\n result = new TimeIntervalCollection();\n result.addInterval(\n new TimeInterval({\n start: beginDate,\n stop: endDate,\n })\n );\n } else if (defined(beginDate)) {\n result = new TimeIntervalCollection();\n result.addInterval(\n new TimeInterval({\n start: beginDate,\n stop: Iso8601.MAXIMUM_VALUE,\n })\n );\n } else if (defined(endDate)) {\n result = new TimeIntervalCollection();\n result.addInterval(\n new TimeInterval({\n start: Iso8601.MINIMUM_VALUE,\n stop: endDate,\n })\n );\n }\n\n return result;\n}\n\nfunction createDefaultBillboard() {\n const billboard = new BillboardGraphics();\n billboard.width = BILLBOARD_SIZE;\n billboard.height = BILLBOARD_SIZE;\n billboard.scaleByDistance = new NearFarScalar(\n BILLBOARD_NEAR_DISTANCE,\n BILLBOARD_NEAR_RATIO,\n BILLBOARD_FAR_DISTANCE,\n BILLBOARD_FAR_RATIO\n );\n billboard.pixelOffsetScaleByDistance = new NearFarScalar(\n BILLBOARD_NEAR_DISTANCE,\n BILLBOARD_NEAR_RATIO,\n BILLBOARD_FAR_DISTANCE,\n BILLBOARD_FAR_RATIO\n );\n return billboard;\n}\n\nfunction createDefaultPolygon() {\n const polygon = new PolygonGraphics();\n polygon.outline = true;\n polygon.outlineColor = Color.WHITE;\n return polygon;\n}\n\nfunction createDefaultLabel() {\n const label = new LabelGraphics();\n label.translucencyByDistance = new NearFarScalar(3000000, 1.0, 5000000, 0.0);\n label.pixelOffset = new Cartesian2(17, 0);\n label.horizontalOrigin = HorizontalOrigin.LEFT;\n label.font = \"16px sans-serif\";\n label.style = LabelStyle.FILL_AND_OUTLINE;\n return label;\n}\n\nfunction getIconHref(\n iconNode,\n dataSource,\n sourceResource,\n uriResolver,\n canRefresh\n) {\n let href = queryStringValue(iconNode, \"href\", namespaces.kml);\n if (!defined(href) || href.length === 0) {\n return undefined;\n }\n\n if (href.indexOf(\"root://icons/palette-\") === 0) {\n const palette = href.charAt(21);\n\n // Get the icon number\n let x = defaultValue(queryNumericValue(iconNode, \"x\", namespaces.gx), 0);\n let y = defaultValue(queryNumericValue(iconNode, \"y\", namespaces.gx), 0);\n x = Math.min(x / 32, 7);\n y = 7 - Math.min(y / 32, 7);\n const iconNum = 8 * y + x;\n\n href = `https://maps.google.com/mapfiles/kml/pal${palette}/icon${iconNum}.png`;\n }\n\n const hrefResource = resolveHref(href, sourceResource, uriResolver);\n\n if (canRefresh) {\n const refreshMode = queryStringValue(\n iconNode,\n \"refreshMode\",\n namespaces.kml\n );\n const viewRefreshMode = queryStringValue(\n iconNode,\n \"viewRefreshMode\",\n namespaces.kml\n );\n if (refreshMode === \"onInterval\" || refreshMode === \"onExpire\") {\n oneTimeWarning(\n `kml-refreshMode-${refreshMode}`,\n `KML - Unsupported Icon refreshMode: ${refreshMode}`\n );\n } else if (viewRefreshMode === \"onStop\" || viewRefreshMode === \"onRegion\") {\n oneTimeWarning(\n `kml-refreshMode-${viewRefreshMode}`,\n `KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}`\n );\n }\n\n const viewBoundScale = defaultValue(\n queryStringValue(iconNode, \"viewBoundScale\", namespaces.kml),\n 1.0\n );\n const defaultViewFormat =\n viewRefreshMode === \"onStop\"\n ? \"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]\"\n : \"\";\n const viewFormat = defaultValue(\n queryStringValue(iconNode, \"viewFormat\", namespaces.kml),\n defaultViewFormat\n );\n const httpQuery = queryStringValue(iconNode, \"httpQuery\", namespaces.kml);\n if (defined(viewFormat)) {\n hrefResource.setQueryParameters(queryToObject(cleanupString(viewFormat)));\n }\n if (defined(httpQuery)) {\n hrefResource.setQueryParameters(queryToObject(cleanupString(httpQuery)));\n }\n\n const ellipsoid = dataSource._ellipsoid;\n processNetworkLinkQueryString(\n hrefResource,\n dataSource.camera,\n dataSource.canvas,\n viewBoundScale,\n dataSource._lastCameraView.bbox,\n ellipsoid\n );\n\n return hrefResource;\n }\n\n return hrefResource;\n}\n\nfunction processBillboardIcon(\n dataSource,\n node,\n targetEntity,\n sourceResource,\n uriResolver\n) {\n let scale = queryNumericValue(node, \"scale\", namespaces.kml);\n const heading = queryNumericValue(node, \"heading\", namespaces.kml);\n const color = queryColorValue(node, \"color\", namespaces.kml);\n\n const iconNode = queryFirstNode(node, \"Icon\", namespaces.kml);\n let icon = getIconHref(\n iconNode,\n dataSource,\n sourceResource,\n uriResolver,\n false\n );\n\n // If icon tags are present but blank, we do not want to show an icon\n if (defined(iconNode) && !defined(icon)) {\n icon = false;\n }\n\n const x = queryNumericValue(iconNode, \"x\", namespaces.gx);\n const y = queryNumericValue(iconNode, \"y\", namespaces.gx);\n const w = queryNumericValue(iconNode, \"w\", namespaces.gx);\n const h = queryNumericValue(iconNode, \"h\", namespaces.gx);\n\n const hotSpotNode = queryFirstNode(node, \"hotSpot\", namespaces.kml);\n const hotSpotX = queryNumericAttribute(hotSpotNode, \"x\");\n const hotSpotY = queryNumericAttribute(hotSpotNode, \"y\");\n const hotSpotXUnit = queryStringAttribute(hotSpotNode, \"xunits\");\n const hotSpotYUnit = queryStringAttribute(hotSpotNode, \"yunits\");\n\n let billboard = targetEntity.billboard;\n if (!defined(billboard)) {\n billboard = createDefaultBillboard();\n targetEntity.billboard = billboard;\n }\n\n billboard.image = icon;\n billboard.scale = scale;\n billboard.color = color;\n\n if (defined(x) || defined(y) || defined(w) || defined(h)) {\n billboard.imageSubRegion = new BoundingRectangle(x, y, w, h);\n }\n\n //GE treats a heading of zero as no heading\n //You can still point north using a 360 degree angle (or any multiple of 360)\n if (defined(heading) && heading !== 0) {\n billboard.rotation = CesiumMath.toRadians(-heading);\n billboard.alignedAxis = Cartesian3.UNIT_Z;\n }\n\n //Hotpot is the KML equivalent of pixel offset\n //The hotspot origin is the lower left, but we leave\n //our billboard origin at the center and simply\n //modify the pixel offset to take this into account\n scale = defaultValue(scale, 1.0);\n\n let xOffset;\n let yOffset;\n if (defined(hotSpotX)) {\n if (hotSpotXUnit === \"pixels\") {\n xOffset = -hotSpotX * scale;\n } else if (hotSpotXUnit === \"insetPixels\") {\n xOffset = (hotSpotX - BILLBOARD_SIZE) * scale;\n } else if (hotSpotXUnit === \"fraction\") {\n xOffset = -hotSpotX * BILLBOARD_SIZE * scale;\n }\n xOffset += BILLBOARD_SIZE * 0.5 * scale;\n }\n\n if (defined(hotSpotY)) {\n if (hotSpotYUnit === \"pixels\") {\n yOffset = hotSpotY * scale;\n } else if (hotSpotYUnit === \"insetPixels\") {\n yOffset = (-hotSpotY + BILLBOARD_SIZE) * scale;\n } else if (hotSpotYUnit === \"fraction\") {\n yOffset = hotSpotY * BILLBOARD_SIZE * scale;\n }\n\n yOffset -= BILLBOARD_SIZE * 0.5 * scale;\n }\n\n if (defined(xOffset) || defined(yOffset)) {\n billboard.pixelOffset = new Cartesian2(xOffset, yOffset);\n }\n}\n\nfunction applyStyle(\n dataSource,\n styleNode,\n targetEntity,\n sourceResource,\n uriResolver\n) {\n for (let i = 0, len = styleNode.childNodes.length; i < len; i++) {\n const node = styleNode.childNodes.item(i);\n if (node.localName === \"IconStyle\") {\n processBillboardIcon(\n dataSource,\n node,\n targetEntity,\n sourceResource,\n uriResolver\n );\n } else if (node.localName === \"LabelStyle\") {\n let label = targetEntity.label;\n if (!defined(label)) {\n label = createDefaultLabel();\n targetEntity.label = label;\n }\n label.scale = defaultValue(\n queryNumericValue(node, \"scale\", namespaces.kml),\n label.scale\n );\n label.fillColor = defaultValue(\n queryColorValue(node, \"color\", namespaces.kml),\n label.fillColor\n );\n label.text = targetEntity.name;\n } else if (node.localName === \"LineStyle\") {\n let polyline = targetEntity.polyline;\n if (!defined(polyline)) {\n polyline = new PolylineGraphics();\n targetEntity.polyline = polyline;\n }\n polyline.width = queryNumericValue(node, \"width\", namespaces.kml);\n polyline.material = queryColorValue(node, \"color\", namespaces.kml);\n if (defined(queryColorValue(node, \"outerColor\", namespaces.gx))) {\n oneTimeWarning(\n \"kml-gx:outerColor\",\n \"KML - gx:outerColor is not supported in a LineStyle\"\n );\n }\n if (defined(queryNumericValue(node, \"outerWidth\", namespaces.gx))) {\n oneTimeWarning(\n \"kml-gx:outerWidth\",\n \"KML - gx:outerWidth is not supported in a LineStyle\"\n );\n }\n if (defined(queryNumericValue(node, \"physicalWidth\", namespaces.gx))) {\n oneTimeWarning(\n \"kml-gx:physicalWidth\",\n \"KML - gx:physicalWidth is not supported in a LineStyle\"\n );\n }\n if (defined(queryBooleanValue(node, \"labelVisibility\", namespaces.gx))) {\n oneTimeWarning(\n \"kml-gx:labelVisibility\",\n \"KML - gx:labelVisibility is not supported in a LineStyle\"\n );\n }\n } else if (node.localName === \"PolyStyle\") {\n let polygon = targetEntity.polygon;\n if (!defined(polygon)) {\n polygon = createDefaultPolygon();\n targetEntity.polygon = polygon;\n }\n polygon.material = defaultValue(\n queryColorValue(node, \"color\", namespaces.kml),\n polygon.material\n );\n polygon.fill = defaultValue(\n queryBooleanValue(node, \"fill\", namespaces.kml),\n polygon.fill\n );\n polygon.outline = defaultValue(\n queryBooleanValue(node, \"outline\", namespaces.kml),\n polygon.outline\n );\n } else if (node.localName === \"BalloonStyle\") {\n const bgColor = defaultValue(\n parseColorString(queryStringValue(node, \"bgColor\", namespaces.kml)),\n Color.WHITE\n );\n const textColor = defaultValue(\n parseColorString(queryStringValue(node, \"textColor\", namespaces.kml)),\n Color.BLACK\n );\n const text = queryStringValue(node, \"text\", namespaces.kml);\n\n //This is purely an internal property used in style processing,\n //it never ends up on the final entity.\n targetEntity.addProperty(\"balloonStyle\");\n targetEntity.balloonStyle = {\n bgColor: bgColor,\n textColor: textColor,\n text: text,\n };\n } else if (node.localName === \"ListStyle\") {\n const listItemType = queryStringValue(\n node,\n \"listItemType\",\n namespaces.kml\n );\n if (listItemType === \"radioFolder\" || listItemType === \"checkOffOnly\") {\n oneTimeWarning(\n `kml-listStyle-${listItemType}`,\n `KML - Unsupported ListStyle with listItemType: ${listItemType}`\n );\n }\n }\n }\n}\n\n//Processes and merges any inline styles for the provided node into the provided entity.\nfunction computeFinalStyle(\n dataSource,\n placeMark,\n styleCollection,\n sourceResource,\n uriResolver\n) {\n const result = new Entity();\n let styleEntity;\n\n //Google earth seems to always use the last inline Style/StyleMap only\n let styleIndex = -1;\n const childNodes = placeMark.childNodes;\n const length = childNodes.length;\n for (let q = 0; q < length; q++) {\n const child = childNodes[q];\n if (child.localName === \"Style\" || child.localName === \"StyleMap\") {\n styleIndex = q;\n }\n }\n\n if (styleIndex !== -1) {\n const inlineStyleNode = childNodes[styleIndex];\n if (inlineStyleNode.localName === \"Style\") {\n applyStyle(\n dataSource,\n inlineStyleNode,\n result,\n sourceResource,\n uriResolver\n );\n } else {\n // StyleMap\n const pairs = queryChildNodes(inlineStyleNode, \"Pair\", namespaces.kml);\n for (let p = 0; p < pairs.length; p++) {\n const pair = pairs[p];\n const key = queryStringValue(pair, \"key\", namespaces.kml);\n if (key === \"normal\") {\n const styleUrl = queryStringValue(pair, \"styleUrl\", namespaces.kml);\n if (defined(styleUrl)) {\n styleEntity = styleCollection.getById(styleUrl);\n if (!defined(styleEntity)) {\n styleEntity = styleCollection.getById(`#${styleUrl}`);\n }\n if (defined(styleEntity)) {\n result.merge(styleEntity);\n }\n } else {\n const node = queryFirstNode(pair, \"Style\", namespaces.kml);\n applyStyle(dataSource, node, result, sourceResource, uriResolver);\n }\n } else {\n oneTimeWarning(\n `kml-styleMap-${key}`,\n `KML - Unsupported StyleMap key: ${key}`\n );\n }\n }\n }\n }\n\n //Google earth seems to always use the first external style only.\n const externalStyle = queryStringValue(placeMark, \"styleUrl\", namespaces.kml);\n if (defined(externalStyle)) {\n let id = externalStyle;\n if (externalStyle[0] !== \"#\" && externalStyle.indexOf(\"#\") !== -1) {\n const tokens = externalStyle.split(\"#\");\n const uri = tokens[0];\n const resource = sourceResource.getDerivedResource({\n url: uri,\n });\n\n id = `${resource.getUrlComponent()}#${tokens[1]}`;\n }\n\n styleEntity = styleCollection.getById(id);\n if (!defined(styleEntity)) {\n styleEntity = styleCollection.getById(`#${id}`);\n }\n if (defined(styleEntity)) {\n result.merge(styleEntity);\n }\n }\n\n return result;\n}\n\n//Asynchronously processes an external style file.\nfunction processExternalStyles(dataSource, resource, styleCollection) {\n return resource.fetchXML().then(function (styleKml) {\n return processStyles(dataSource, styleKml, styleCollection, resource, true);\n });\n}\n\n//Processes all shared and external styles and stores\n//their id into the provided styleCollection.\n//Returns an array of promises that will resolve when\n//each style is loaded.\nfunction processStyles(\n dataSource,\n kml,\n styleCollection,\n sourceResource,\n isExternal,\n uriResolver\n) {\n let i;\n let id;\n let styleEntity;\n\n let node;\n const styleNodes = queryNodes(kml, \"Style\", namespaces.kml);\n if (defined(styleNodes)) {\n const styleNodesLength = styleNodes.length;\n for (i = 0; i < styleNodesLength; i++) {\n node = styleNodes[i];\n id = queryStringAttribute(node, \"id\");\n if (defined(id)) {\n id = `#${id}`;\n if (isExternal && defined(sourceResource)) {\n id = sourceResource.getUrlComponent() + id;\n }\n if (!defined(styleCollection.getById(id))) {\n styleEntity = new Entity({\n id: id,\n });\n styleCollection.add(styleEntity);\n applyStyle(\n dataSource,\n node,\n styleEntity,\n sourceResource,\n uriResolver\n );\n }\n }\n }\n }\n\n const styleMaps = queryNodes(kml, \"StyleMap\", namespaces.kml);\n if (defined(styleMaps)) {\n const styleMapsLength = styleMaps.length;\n for (i = 0; i < styleMapsLength; i++) {\n const styleMap = styleMaps[i];\n id = queryStringAttribute(styleMap, \"id\");\n if (defined(id)) {\n const pairs = queryChildNodes(styleMap, \"Pair\", namespaces.kml);\n for (let p = 0; p < pairs.length; p++) {\n const pair = pairs[p];\n const key = queryStringValue(pair, \"key\", namespaces.kml);\n if (key === \"normal\") {\n id = `#${id}`;\n if (isExternal && defined(sourceResource)) {\n id = sourceResource.getUrlComponent() + id;\n }\n if (!defined(styleCollection.getById(id))) {\n styleEntity = styleCollection.getOrCreateEntity(id);\n\n let styleUrl = queryStringValue(pair, \"styleUrl\", namespaces.kml);\n if (defined(styleUrl)) {\n if (styleUrl[0] !== \"#\") {\n styleUrl = `#${styleUrl}`;\n }\n\n if (isExternal && defined(sourceResource)) {\n styleUrl = sourceResource.getUrlComponent() + styleUrl;\n }\n const base = styleCollection.getById(styleUrl);\n\n if (defined(base)) {\n styleEntity.merge(base);\n }\n } else {\n node = queryFirstNode(pair, \"Style\", namespaces.kml);\n applyStyle(\n dataSource,\n node,\n styleEntity,\n sourceResource,\n uriResolver\n );\n }\n }\n } else {\n oneTimeWarning(\n `kml-styleMap-${key}`,\n `KML - Unsupported StyleMap key: ${key}`\n );\n }\n }\n }\n }\n }\n\n const promises = [];\n const styleUrlNodes = kml.getElementsByTagName(\"styleUrl\");\n const styleUrlNodesLength = styleUrlNodes.length;\n for (i = 0; i < styleUrlNodesLength; i++) {\n const styleReference = styleUrlNodes[i].textContent;\n if (styleReference[0] !== \"#\") {\n //According to the spec, all local styles should start with a #\n //and everything else is an external style that has a # seperating\n //the URL of the document and the style. However, Google Earth\n //also accepts styleUrls without a # as meaning a local style.\n const tokens = styleReference.split(\"#\");\n if (tokens.length === 2) {\n const uri = tokens[0];\n const resource = sourceResource.getDerivedResource({\n url: uri,\n });\n\n promises.push(\n processExternalStyles(dataSource, resource, styleCollection)\n );\n }\n }\n }\n\n return promises;\n}\n\nfunction createDropLine(entityCollection, entity, styleEntity) {\n const entityPosition = new ReferenceProperty(entityCollection, entity.id, [\n \"position\",\n ]);\n const surfacePosition = new ScaledPositionProperty(entity.position);\n entity.polyline = defined(styleEntity.polyline)\n ? styleEntity.polyline.clone()\n : new PolylineGraphics();\n entity.polyline.positions = new PositionPropertyArray([\n entityPosition,\n surfacePosition,\n ]);\n}\n\nfunction heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) {\n if (\n (!defined(altitudeMode) && !defined(gxAltitudeMode)) ||\n altitudeMode === \"clampToGround\"\n ) {\n return HeightReference.CLAMP_TO_GROUND;\n }\n\n if (altitudeMode === \"relativeToGround\") {\n return HeightReference.RELATIVE_TO_GROUND;\n }\n\n if (altitudeMode === \"absolute\") {\n return HeightReference.NONE;\n }\n\n if (gxAltitudeMode === \"clampToSeaFloor\") {\n oneTimeWarning(\n \"kml-gx:altitudeMode-clampToSeaFloor\",\n \"KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround.\"\n );\n return HeightReference.CLAMP_TO_GROUND;\n }\n\n if (gxAltitudeMode === \"relativeToSeaFloor\") {\n oneTimeWarning(\n \"kml-gx:altitudeMode-relativeToSeaFloor\",\n \"KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround.\"\n );\n return HeightReference.RELATIVE_TO_GROUND;\n }\n\n if (defined(altitudeMode)) {\n oneTimeWarning(\n \"kml-altitudeMode-unknown\",\n `KML - Unknown <kml:altitudeMode>:${altitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`\n );\n } else {\n oneTimeWarning(\n \"kml-gx:altitudeMode-unknown\",\n `KML - Unknown <gx:altitudeMode>:${gxAltitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`\n );\n }\n\n // Clamp to ground is the default\n return HeightReference.CLAMP_TO_GROUND;\n}\n\nfunction createPositionPropertyFromAltitudeMode(\n property,\n altitudeMode,\n gxAltitudeMode\n) {\n if (\n gxAltitudeMode === \"relativeToSeaFloor\" ||\n altitudeMode === \"absolute\" ||\n altitudeMode === \"relativeToGround\"\n ) {\n //Just return the ellipsoid referenced property until we support MSL\n return property;\n }\n\n if (\n (defined(altitudeMode) && altitudeMode !== \"clampToGround\") || //\n (defined(gxAltitudeMode) && gxAltitudeMode !== \"clampToSeaFloor\")\n ) {\n oneTimeWarning(\n \"kml-altitudeMode-unknown\",\n `KML - Unknown altitudeMode: ${defaultValue(\n altitudeMode,\n gxAltitudeMode\n )}`\n );\n }\n\n // Clamp to ground is the default\n return new ScaledPositionProperty(property);\n}\n\nfunction createPositionPropertyArrayFromAltitudeMode(\n properties,\n altitudeMode,\n gxAltitudeMode,\n ellipsoid\n) {\n if (!defined(properties)) {\n return undefined;\n }\n\n if (\n gxAltitudeMode === \"relativeToSeaFloor\" ||\n altitudeMode === \"absolute\" ||\n altitudeMode === \"relativeToGround\"\n ) {\n //Just return the ellipsoid referenced property until we support MSL\n return properties;\n }\n\n if (\n (defined(altitudeMode) && altitudeMode !== \"clampToGround\") || //\n (defined(gxAltitudeMode) && gxAltitudeMode !== \"clampToSeaFloor\")\n ) {\n oneTimeWarning(\n \"kml-altitudeMode-unknown\",\n `KML - Unknown altitudeMode: ${defaultValue(\n altitudeMode,\n gxAltitudeMode\n )}`\n );\n }\n\n // Clamp to ground is the default\n const propertiesLength = properties.length;\n for (let i = 0; i < propertiesLength; i++) {\n const property = properties[i];\n ellipsoid.scaleToGeodeticSurface(property, property);\n }\n return properties;\n}\n\nfunction processPositionGraphics(\n dataSource,\n entity,\n styleEntity,\n heightReference\n) {\n let label = entity.label;\n if (!defined(label)) {\n label = defined(styleEntity.label)\n ? styleEntity.label.clone()\n : createDefaultLabel();\n entity.label = label;\n }\n label.text = entity.name;\n\n let billboard = entity.billboard;\n if (!defined(billboard)) {\n billboard = defined(styleEntity.billboard)\n ? styleEntity.billboard.clone()\n : createDefaultBillboard();\n entity.billboard = billboard;\n }\n\n if (!defined(billboard.image)) {\n billboard.image = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);\n\n // If there were empty <Icon> tags in the KML, then billboard.image was set to false above\n // However, in this case, the false value would have been converted to a property afterwards\n // Thus, we check if billboard.image is defined with value of false\n } else if (!billboard.image.getValue()) {\n billboard.image = undefined;\n }\n\n let scale = 1.0;\n if (defined(billboard.scale)) {\n scale = billboard.scale.getValue();\n if (scale !== 0) {\n label.pixelOffset = new Cartesian2(scale * 16 + 1, 0);\n } else {\n //Minor tweaks to better match Google Earth.\n label.pixelOffset = undefined;\n label.horizontalOrigin = undefined;\n }\n }\n\n if (defined(heightReference) && dataSource._clampToGround) {\n billboard.heightReference = heightReference;\n label.heightReference = heightReference;\n }\n}\n\nfunction processPathGraphics(entity, styleEntity) {\n let path = entity.path;\n if (!defined(path)) {\n path = new PathGraphics();\n path.leadTime = 0;\n entity.path = path;\n }\n\n const polyline = styleEntity.polyline;\n if (defined(polyline)) {\n path.material = polyline.material;\n path.width = polyline.width;\n }\n}\n\nfunction processPoint(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n const coordinatesString = queryStringValue(\n geometryNode,\n \"coordinates\",\n namespaces.kml\n );\n const altitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.kml\n );\n const gxAltitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.gx\n );\n const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n const ellipsoid = dataSource._ellipsoid;\n const position = readCoordinate(coordinatesString, ellipsoid);\n\n entity.position = position;\n processPositionGraphics(\n dataSource,\n entity,\n styleEntity,\n heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)\n );\n\n if (extrude && isExtrudable(altitudeMode, gxAltitudeMode)) {\n createDropLine(entityCollection, entity, styleEntity);\n }\n\n return true;\n}\n\nfunction processLineStringOrLinearRing(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n const coordinatesNode = queryFirstNode(\n geometryNode,\n \"coordinates\",\n namespaces.kml\n );\n const altitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.kml\n );\n const gxAltitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.gx\n );\n const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n const tessellate = queryBooleanValue(\n geometryNode,\n \"tessellate\",\n namespaces.kml\n );\n const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n const zIndex = queryNumericValue(geometryNode, \"drawOrder\", namespaces.gx);\n\n const ellipsoid = dataSource._ellipsoid;\n const coordinates = readCoordinates(coordinatesNode, ellipsoid);\n let polyline = styleEntity.polyline;\n if (canExtrude && extrude) {\n const wall = new WallGraphics();\n entity.wall = wall;\n wall.positions = coordinates;\n const polygon = styleEntity.polygon;\n\n if (defined(polygon)) {\n wall.fill = polygon.fill;\n wall.material = polygon.material;\n }\n\n //Always outline walls so they show up in 2D.\n wall.outline = true;\n if (defined(polyline)) {\n wall.outlineColor = defined(polyline.material)\n ? polyline.material.color\n : Color.WHITE;\n wall.outlineWidth = polyline.width;\n } else if (defined(polygon)) {\n wall.outlineColor = defined(polygon.material)\n ? polygon.material.color\n : Color.WHITE;\n }\n } else if (dataSource._clampToGround && !canExtrude && tessellate) {\n const polylineGraphics = new PolylineGraphics();\n polylineGraphics.clampToGround = true;\n entity.polyline = polylineGraphics;\n polylineGraphics.positions = coordinates;\n if (defined(polyline)) {\n polylineGraphics.material = defined(polyline.material)\n ? polyline.material.color.getValue(Iso8601.MINIMUM_VALUE)\n : Color.WHITE;\n polylineGraphics.width = defaultValue(polyline.width, 1.0);\n } else {\n polylineGraphics.material = Color.WHITE;\n polylineGraphics.width = 1.0;\n }\n polylineGraphics.zIndex = zIndex;\n } else {\n if (defined(zIndex)) {\n oneTimeWarning(\n \"kml-gx:drawOrder\",\n \"KML - gx:drawOrder is not supported in LineStrings when clampToGround is false\"\n );\n }\n if (dataSource._clampToGround && !tessellate) {\n oneTimeWarning(\n \"kml-line-tesselate\",\n \"Ignoring clampToGround for KML lines without the tessellate flag.\"\n );\n }\n\n polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics();\n entity.polyline = polyline;\n polyline.positions = createPositionPropertyArrayFromAltitudeMode(\n coordinates,\n altitudeMode,\n gxAltitudeMode,\n ellipsoid\n );\n if (!tessellate || canExtrude) {\n polyline.arcType = ArcType.NONE;\n }\n }\n\n return true;\n}\n\nfunction processPolygon(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n const outerBoundaryIsNode = queryFirstNode(\n geometryNode,\n \"outerBoundaryIs\",\n namespaces.kml\n );\n let linearRingNode = queryFirstNode(\n outerBoundaryIsNode,\n \"LinearRing\",\n namespaces.kml\n );\n let coordinatesNode = queryFirstNode(\n linearRingNode,\n \"coordinates\",\n namespaces.kml\n );\n const ellipsoid = dataSource._ellipsoid;\n let coordinates = readCoordinates(coordinatesNode, ellipsoid);\n const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n const altitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.kml\n );\n const gxAltitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.gx\n );\n const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n\n const polygon = defined(styleEntity.polygon)\n ? styleEntity.polygon.clone()\n : createDefaultPolygon();\n\n const polyline = styleEntity.polyline;\n if (defined(polyline)) {\n polygon.outlineColor = defined(polyline.material)\n ? polyline.material.color\n : Color.WHITE;\n polygon.outlineWidth = polyline.width;\n }\n entity.polygon = polygon;\n\n if (canExtrude) {\n polygon.perPositionHeight = true;\n polygon.extrudedHeight = extrude ? 0 : undefined;\n } else if (!dataSource._clampToGround) {\n polygon.height = 0;\n }\n\n if (defined(coordinates)) {\n const hierarchy = new PolygonHierarchy(coordinates);\n const innerBoundaryIsNodes = queryChildNodes(\n geometryNode,\n \"innerBoundaryIs\",\n namespaces.kml\n );\n for (let j = 0; j < innerBoundaryIsNodes.length; j++) {\n linearRingNode = queryChildNodes(\n innerBoundaryIsNodes[j],\n \"LinearRing\",\n namespaces.kml\n );\n for (let k = 0; k < linearRingNode.length; k++) {\n coordinatesNode = queryFirstNode(\n linearRingNode[k],\n \"coordinates\",\n namespaces.kml\n );\n coordinates = readCoordinates(coordinatesNode, ellipsoid);\n if (defined(coordinates)) {\n hierarchy.holes.push(new PolygonHierarchy(coordinates));\n }\n }\n }\n polygon.hierarchy = hierarchy;\n }\n\n return true;\n}\n\nfunction processTrack(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n const altitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.kml\n );\n const gxAltitudeMode = queryStringValue(\n geometryNode,\n \"altitudeMode\",\n namespaces.gx\n );\n const coordNodes = queryChildNodes(geometryNode, \"coord\", namespaces.gx);\n const angleNodes = queryChildNodes(geometryNode, \"angles\", namespaces.gx);\n const timeNodes = queryChildNodes(geometryNode, \"when\", namespaces.kml);\n const extrude = queryBooleanValue(geometryNode, \"extrude\", namespaces.kml);\n const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n const ellipsoid = dataSource._ellipsoid;\n\n if (angleNodes.length > 0) {\n oneTimeWarning(\n \"kml-gx:angles\",\n \"KML - gx:angles are not supported in gx:Tracks\"\n );\n }\n\n const length = Math.min(coordNodes.length, timeNodes.length);\n const coordinates = [];\n const times = [];\n for (let i = 0; i < length; i++) {\n const position = readCoordinate(coordNodes[i].textContent, ellipsoid);\n coordinates.push(position);\n times.push(JulianDate.fromIso8601(timeNodes[i].textContent));\n }\n const property = new SampledPositionProperty();\n property.addSamples(times, coordinates);\n entity.position = property;\n processPositionGraphics(\n dataSource,\n entity,\n styleEntity,\n heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)\n );\n processPathGraphics(entity, styleEntity);\n\n entity.availability = new TimeIntervalCollection();\n\n if (timeNodes.length > 0) {\n entity.availability.addInterval(\n new TimeInterval({\n start: times[0],\n stop: times[times.length - 1],\n })\n );\n }\n\n if (canExtrude && extrude) {\n createDropLine(entityCollection, entity, styleEntity);\n }\n\n return true;\n}\n\nfunction addToMultiTrack(\n times,\n positions,\n composite,\n availability,\n dropShowProperty,\n extrude,\n altitudeMode,\n gxAltitudeMode,\n includeEndPoints\n) {\n const start = times[0];\n const stop = times[times.length - 1];\n\n const data = new SampledPositionProperty();\n data.addSamples(times, positions);\n\n composite.intervals.addInterval(\n new TimeInterval({\n start: start,\n stop: stop,\n isStartIncluded: includeEndPoints,\n isStopIncluded: includeEndPoints,\n data: createPositionPropertyFromAltitudeMode(\n data,\n altitudeMode,\n gxAltitudeMode\n ),\n })\n );\n availability.addInterval(\n new TimeInterval({\n start: start,\n stop: stop,\n isStartIncluded: includeEndPoints,\n isStopIncluded: includeEndPoints,\n })\n );\n dropShowProperty.intervals.addInterval(\n new TimeInterval({\n start: start,\n stop: stop,\n isStartIncluded: includeEndPoints,\n isStopIncluded: includeEndPoints,\n data: extrude,\n })\n );\n}\n\nfunction processMultiTrack(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n // Multitrack options do not work in GE as detailed in the spec,\n // rather than altitudeMode being at the MultiTrack level,\n // GE just defers all settings to the underlying track.\n\n const interpolate = queryBooleanValue(\n geometryNode,\n \"interpolate\",\n namespaces.gx\n );\n const trackNodes = queryChildNodes(geometryNode, \"Track\", namespaces.gx);\n\n let times;\n let lastStop;\n let lastStopPosition;\n let needDropLine = false;\n const dropShowProperty = new TimeIntervalCollectionProperty();\n const availability = new TimeIntervalCollection();\n const composite = new CompositePositionProperty();\n const ellipsoid = dataSource._ellipsoid;\n for (let i = 0, len = trackNodes.length; i < len; i++) {\n const trackNode = trackNodes[i];\n const timeNodes = queryChildNodes(trackNode, \"when\", namespaces.kml);\n const coordNodes = queryChildNodes(trackNode, \"coord\", namespaces.gx);\n const altitudeMode = queryStringValue(\n trackNode,\n \"altitudeMode\",\n namespaces.kml\n );\n const gxAltitudeMode = queryStringValue(\n trackNode,\n \"altitudeMode\",\n namespaces.gx\n );\n const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);\n const extrude = queryBooleanValue(trackNode, \"extrude\", namespaces.kml);\n\n const length = Math.min(coordNodes.length, timeNodes.length);\n\n const positions = [];\n times = [];\n for (let x = 0; x < length; x++) {\n const position = readCoordinate(coordNodes[x].textContent, ellipsoid);\n positions.push(position);\n times.push(JulianDate.fromIso8601(timeNodes[x].textContent));\n }\n\n if (interpolate) {\n //If we are interpolating, then we need to fill in the end of\n //the last track and the beginning of this one with a sampled\n //property. From testing in Google Earth, this property\n //is never extruded and always absolute.\n if (defined(lastStop)) {\n addToMultiTrack(\n [lastStop, times[0]],\n [lastStopPosition, positions[0]],\n composite,\n availability,\n dropShowProperty,\n false,\n \"absolute\",\n undefined,\n false\n );\n }\n lastStop = times[length - 1];\n lastStopPosition = positions[positions.length - 1];\n }\n\n addToMultiTrack(\n times,\n positions,\n composite,\n availability,\n dropShowProperty,\n canExtrude && extrude,\n altitudeMode,\n gxAltitudeMode,\n true\n );\n needDropLine = needDropLine || (canExtrude && extrude);\n }\n\n entity.availability = availability;\n entity.position = composite;\n processPositionGraphics(dataSource, entity, styleEntity);\n processPathGraphics(entity, styleEntity);\n if (needDropLine) {\n createDropLine(entityCollection, entity, styleEntity);\n entity.polyline.show = dropShowProperty;\n }\n\n return true;\n}\n\nconst geometryTypes = {\n Point: processPoint,\n LineString: processLineStringOrLinearRing,\n LinearRing: processLineStringOrLinearRing,\n Polygon: processPolygon,\n Track: processTrack,\n MultiTrack: processMultiTrack,\n MultiGeometry: processMultiGeometry,\n Model: processUnsupportedGeometry,\n};\n\nfunction processMultiGeometry(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity,\n context\n) {\n const childNodes = geometryNode.childNodes;\n let hasGeometry = false;\n for (let i = 0, len = childNodes.length; i < len; i++) {\n const childNode = childNodes.item(i);\n const geometryProcessor = geometryTypes[childNode.localName];\n if (defined(geometryProcessor)) {\n const childEntity = createEntity(childNode, entityCollection, context);\n childEntity.parent = entity;\n childEntity.name = entity.name;\n childEntity.availability = entity.availability;\n childEntity.description = entity.description;\n childEntity.kml = entity.kml;\n if (\n geometryProcessor(\n dataSource,\n entityCollection,\n childNode,\n childEntity,\n styleEntity\n )\n ) {\n hasGeometry = true;\n }\n }\n }\n\n return hasGeometry;\n}\n\nfunction processUnsupportedGeometry(\n dataSource,\n entityCollection,\n geometryNode,\n entity,\n styleEntity\n) {\n oneTimeWarning(\n \"kml-unsupportedGeometry\",\n `KML - Unsupported geometry: ${geometryNode.localName}`\n );\n return false;\n}\n\nfunction processExtendedData(node, entity) {\n const extendedDataNode = queryFirstNode(node, \"ExtendedData\", namespaces.kml);\n\n if (!defined(extendedDataNode)) {\n return undefined;\n }\n\n if (defined(queryFirstNode(extendedDataNode, \"SchemaData\", namespaces.kml))) {\n oneTimeWarning(\"kml-schemaData\", \"KML - SchemaData is unsupported\");\n }\n if (defined(queryStringAttribute(extendedDataNode, \"xmlns:prefix\"))) {\n oneTimeWarning(\n \"kml-extendedData\",\n \"KML - ExtendedData with xmlns:prefix is unsupported\"\n );\n }\n\n const result = {};\n const dataNodes = queryChildNodes(extendedDataNode, \"Data\", namespaces.kml);\n if (defined(dataNodes)) {\n const length = dataNodes.length;\n for (let i = 0; i < length; i++) {\n const dataNode = dataNodes[i];\n const name = queryStringAttribute(dataNode, \"name\");\n if (defined(name)) {\n result[name] = {\n displayName: queryStringValue(\n dataNode,\n \"displayName\",\n namespaces.kml\n ),\n value: queryStringValue(dataNode, \"value\", namespaces.kml),\n };\n }\n }\n }\n entity.kml.extendedData = result;\n}\n\nlet scratchDiv;\nif (typeof document !== \"undefined\") {\n scratchDiv = document.createElement(\"div\");\n}\n\nfunction processDescription(\n node,\n entity,\n styleEntity,\n uriResolver,\n sourceResource\n) {\n let i;\n let key;\n let keys;\n\n const kmlData = entity.kml;\n const extendedData = kmlData.extendedData;\n const description = queryStringValue(node, \"description\", namespaces.kml);\n\n const balloonStyle = defaultValue(\n entity.balloonStyle,\n styleEntity.balloonStyle\n );\n\n let background = Color.WHITE;\n let foreground = Color.BLACK;\n let text = description;\n\n if (defined(balloonStyle)) {\n background = defaultValue(balloonStyle.bgColor, Color.WHITE);\n foreground = defaultValue(balloonStyle.textColor, Color.BLACK);\n text = defaultValue(balloonStyle.text, description);\n }\n\n let value;\n if (defined(text)) {\n text = text.replace(\"$[name]\", defaultValue(entity.name, \"\"));\n text = text.replace(\"$[description]\", defaultValue(description, \"\"));\n text = text.replace(\"$[address]\", defaultValue(kmlData.address, \"\"));\n text = text.replace(\"$[Snippet]\", defaultValue(kmlData.snippet, \"\"));\n text = text.replace(\"$[id]\", entity.id);\n\n //While not explicitly defined by the OGC spec, in Google Earth\n //The appearance of geDirections adds the directions to/from links\n //We simply replace this string with nothing.\n text = text.replace(\"$[geDirections]\", \"\");\n\n if (defined(extendedData)) {\n const matches = text.match(/\\$\\[.+?\\]/g);\n if (matches !== null) {\n for (i = 0; i < matches.length; i++) {\n const token = matches[i];\n let propertyName = token.substr(2, token.length - 3);\n const isDisplayName = /\\/displayName$/.test(propertyName);\n propertyName = propertyName.replace(/\\/displayName$/, \"\");\n\n value = extendedData[propertyName];\n if (defined(value)) {\n value = isDisplayName ? value.displayName : value.value;\n }\n if (defined(value)) {\n text = text.replace(token, defaultValue(value, \"\"));\n }\n }\n }\n }\n } else if (defined(extendedData)) {\n //If no description exists, build a table out of the extended data\n keys = Object.keys(extendedData);\n if (keys.length > 0) {\n text =\n '<table class=\"cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter\"><tbody>';\n for (i = 0; i < keys.length; i++) {\n key = keys[i];\n value = extendedData[key];\n text += `<tr><th>${defaultValue(\n value.displayName,\n key\n )}</th><td>${defaultValue(value.value, \"\")}</td></tr>`;\n }\n text += \"</tbody></table>\";\n }\n }\n\n if (!defined(text)) {\n //No description\n return;\n }\n\n //Turns non-explicit links into clickable links.\n text = autolinker.link(text);\n\n //Use a temporary div to manipulate the links\n //so that they open in a new window.\n scratchDiv.innerHTML = text;\n const links = scratchDiv.querySelectorAll(\"a\");\n for (i = 0; i < links.length; i++) {\n links[i].setAttribute(\"target\", \"_blank\");\n }\n\n //Rewrite any KMZ embedded urls\n if (defined(uriResolver) && uriResolver.keys.length > 1) {\n embedDataUris(scratchDiv, \"a\", \"href\", uriResolver);\n embedDataUris(scratchDiv, \"link\", \"href\", uriResolver);\n embedDataUris(scratchDiv, \"area\", \"href\", uriResolver);\n embedDataUris(scratchDiv, \"img\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"iframe\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"video\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"audio\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"source\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"track\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"input\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"embed\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"script\", \"src\", uriResolver);\n embedDataUris(scratchDiv, \"video\", \"poster\", uriResolver);\n }\n\n //Make relative urls absolute using the sourceResource\n applyBasePath(scratchDiv, \"a\", \"href\", sourceResource);\n applyBasePath(scratchDiv, \"link\", \"href\", sourceResource);\n applyBasePath(scratchDiv, \"area\", \"href\", sourceResource);\n applyBasePath(scratchDiv, \"img\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"iframe\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"video\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"audio\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"source\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"track\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"input\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"embed\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"script\", \"src\", sourceResource);\n applyBasePath(scratchDiv, \"video\", \"poster\", sourceResource);\n\n let tmp = '<div class=\"cesium-infoBox-description-lighter\" style=\"';\n tmp += \"overflow:auto;\";\n tmp += \"word-wrap:break-word;\";\n tmp += `background-color:${background.toCssColorString()};`;\n tmp += `color:${foreground.toCssColorString()};`;\n tmp += '\">';\n tmp += `${scratchDiv.innerHTML}</div>`;\n scratchDiv.innerHTML = \"\";\n\n //Set the final HTML as the description.\n entity.description = tmp;\n}\n\nfunction processFeature(dataSource, featureNode, processingData) {\n const entityCollection = processingData.entityCollection;\n const parent = processingData.parentEntity;\n const sourceResource = processingData.sourceResource;\n const uriResolver = processingData.uriResolver;\n\n const entity = createEntity(\n featureNode,\n entityCollection,\n processingData.context\n );\n const kmlData = entity.kml;\n const styleEntity = computeFinalStyle(\n dataSource,\n featureNode,\n processingData.styleCollection,\n sourceResource,\n uriResolver\n );\n\n const name = queryStringValue(featureNode, \"name\", namespaces.kml);\n entity.name = name;\n entity.parent = parent;\n\n let availability = processTimeSpan(featureNode);\n if (!defined(availability)) {\n availability = processTimeStamp(featureNode);\n }\n entity.availability = availability;\n\n mergeAvailabilityWithParent(entity);\n\n // Per KML spec \"A Feature is visible only if it and all its ancestors are visible.\"\n function ancestryIsVisible(parentEntity) {\n if (!parentEntity) {\n return true;\n }\n return parentEntity.show && ancestryIsVisible(parentEntity.parent);\n }\n\n const visibility = queryBooleanValue(\n featureNode,\n \"visibility\",\n namespaces.kml\n );\n entity.show = ancestryIsVisible(parent) && defaultValue(visibility, true);\n //const open = queryBooleanValue(featureNode, 'open', namespaces.kml);\n\n const authorNode = queryFirstNode(featureNode, \"author\", namespaces.atom);\n const author = kmlData.author;\n author.name = queryStringValue(authorNode, \"name\", namespaces.atom);\n author.uri = queryStringValue(authorNode, \"uri\", namespaces.atom);\n author.email = queryStringValue(authorNode, \"email\", namespaces.atom);\n\n const linkNode = queryFirstNode(featureNode, \"link\", namespaces.atom);\n const link = kmlData.link;\n link.href = queryStringAttribute(linkNode, \"href\");\n link.hreflang = queryStringAttribute(linkNode, \"hreflang\");\n link.rel = queryStringAttribute(linkNode, \"rel\");\n link.type = queryStringAttribute(linkNode, \"type\");\n link.title = queryStringAttribute(linkNode, \"title\");\n link.length = queryStringAttribute(linkNode, \"length\");\n\n kmlData.address = queryStringValue(featureNode, \"address\", namespaces.kml);\n kmlData.phoneNumber = queryStringValue(\n featureNode,\n \"phoneNumber\",\n namespaces.kml\n );\n kmlData.snippet = queryStringValue(featureNode, \"Snippet\", namespaces.kml);\n\n processExtendedData(featureNode, entity);\n processDescription(\n featureNode,\n entity,\n styleEntity,\n uriResolver,\n sourceResource\n );\n\n const ellipsoid = dataSource._ellipsoid;\n processLookAt(featureNode, entity, ellipsoid);\n processCamera(featureNode, entity, ellipsoid);\n\n if (defined(queryFirstNode(featureNode, \"Region\", namespaces.kml))) {\n oneTimeWarning(\"kml-region\", \"KML - Placemark Regions are unsupported\");\n }\n\n return {\n entity: entity,\n styleEntity: styleEntity,\n };\n}\n\nfunction processDocument(dataSource, node, processingData, deferredLoading) {\n deferredLoading.addNodes(node.childNodes, processingData);\n deferredLoading.process();\n}\n\nfunction processFolder(dataSource, node, processingData, deferredLoading) {\n const r = processFeature(dataSource, node, processingData);\n const newProcessingData = clone(processingData);\n newProcessingData.parentEntity = r.entity;\n processDocument(dataSource, node, newProcessingData, deferredLoading);\n}\n\nfunction processPlacemark(\n dataSource,\n placemark,\n processingData,\n deferredLoading\n) {\n const r = processFeature(dataSource, placemark, processingData);\n const entity = r.entity;\n const styleEntity = r.styleEntity;\n\n let hasGeometry = false;\n const childNodes = placemark.childNodes;\n for (let i = 0, len = childNodes.length; i < len && !hasGeometry; i++) {\n const childNode = childNodes.item(i);\n const geometryProcessor = geometryTypes[childNode.localName];\n if (defined(geometryProcessor)) {\n // pass the placemark entity id as a context for case of defining multiple child entities together to handle case\n // where some malformed kmls reuse the same id across placemarks, which works in GE, but is not technically to spec.\n geometryProcessor(\n dataSource,\n processingData.entityCollection,\n childNode,\n entity,\n styleEntity,\n entity.id\n );\n hasGeometry = true;\n }\n }\n\n if (!hasGeometry) {\n entity.merge(styleEntity);\n processPositionGraphics(dataSource, entity, styleEntity);\n }\n}\n\nconst playlistNodeProcessors = {\n FlyTo: processTourFlyTo,\n Wait: processTourWait,\n SoundCue: processTourUnsupportedNode,\n AnimatedUpdate: processTourUnsupportedNode,\n TourControl: processTourUnsupportedNode,\n};\n\nfunction processTour(dataSource, node, processingData, deferredLoading) {\n const name = queryStringValue(node, \"name\", namespaces.kml);\n const id = queryStringAttribute(node, \"id\");\n const tour = new KmlTour(name, id);\n\n const playlistNode = queryFirstNode(node, \"Playlist\", namespaces.gx);\n if (playlistNode) {\n const ellipsoid = dataSource._ellipsoid;\n const childNodes = playlistNode.childNodes;\n for (let i = 0; i < childNodes.length; i++) {\n const entryNode = childNodes[i];\n if (entryNode.localName) {\n const playlistNodeProcessor =\n playlistNodeProcessors[entryNode.localName];\n if (playlistNodeProcessor) {\n playlistNodeProcessor(tour, entryNode, ellipsoid);\n } else {\n console.log(\n `Unknown KML Tour playlist entry type ${entryNode.localName}`\n );\n }\n }\n }\n }\n\n dataSource._kmlTours.push(tour);\n}\n\nfunction processTourUnsupportedNode(tour, entryNode) {\n oneTimeWarning(`KML Tour unsupported node ${entryNode.localName}`);\n}\n\nfunction processTourWait(tour, entryNode) {\n const duration = queryNumericValue(entryNode, \"duration\", namespaces.gx);\n tour.addPlaylistEntry(new KmlTourWait(duration));\n}\n\nfunction processTourFlyTo(tour, entryNode, ellipsoid) {\n const duration = queryNumericValue(entryNode, \"duration\", namespaces.gx);\n const flyToMode = queryStringValue(entryNode, \"flyToMode\", namespaces.gx);\n\n const t = { kml: {} };\n\n processLookAt(entryNode, t, ellipsoid);\n processCamera(entryNode, t, ellipsoid);\n\n const view = t.kml.lookAt || t.kml.camera;\n\n const flyto = new KmlTourFlyTo(duration, flyToMode, view);\n tour.addPlaylistEntry(flyto);\n}\n\nfunction processCamera(featureNode, entity, ellipsoid) {\n const camera = queryFirstNode(featureNode, \"Camera\", namespaces.kml);\n if (defined(camera)) {\n const lon = defaultValue(\n queryNumericValue(camera, \"longitude\", namespaces.kml),\n 0.0\n );\n const lat = defaultValue(\n queryNumericValue(camera, \"latitude\", namespaces.kml),\n 0.0\n );\n const altitude = defaultValue(\n queryNumericValue(camera, \"altitude\", namespaces.kml),\n 0.0\n );\n\n const heading = defaultValue(\n queryNumericValue(camera, \"heading\", namespaces.kml),\n 0.0\n );\n const tilt = defaultValue(\n queryNumericValue(camera, \"tilt\", namespaces.kml),\n 0.0\n );\n const roll = defaultValue(\n queryNumericValue(camera, \"roll\", namespaces.kml),\n 0.0\n );\n\n const position = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);\n const hpr = HeadingPitchRoll.fromDegrees(heading, tilt - 90.0, roll);\n\n entity.kml.camera = new KmlCamera(position, hpr);\n }\n}\n\nfunction processLookAt(featureNode, entity, ellipsoid) {\n const lookAt = queryFirstNode(featureNode, \"LookAt\", namespaces.kml);\n if (defined(lookAt)) {\n const lon = defaultValue(\n queryNumericValue(lookAt, \"longitude\", namespaces.kml),\n 0.0\n );\n const lat = defaultValue(\n queryNumericValue(lookAt, \"latitude\", namespaces.kml),\n 0.0\n );\n const altitude = defaultValue(\n queryNumericValue(lookAt, \"altitude\", namespaces.kml),\n 0.0\n );\n let heading = queryNumericValue(lookAt, \"heading\", namespaces.kml);\n let tilt = queryNumericValue(lookAt, \"tilt\", namespaces.kml);\n const range = defaultValue(\n queryNumericValue(lookAt, \"range\", namespaces.kml),\n 0.0\n );\n\n tilt = CesiumMath.toRadians(defaultValue(tilt, 0.0));\n heading = CesiumMath.toRadians(defaultValue(heading, 0.0));\n\n const hpr = new HeadingPitchRange(\n heading,\n tilt - CesiumMath.PI_OVER_TWO,\n range\n );\n const viewPoint = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);\n\n entity.kml.lookAt = new KmlLookAt(viewPoint, hpr);\n }\n}\n\nfunction processScreenOverlay(\n dataSource,\n screenOverlayNode,\n processingData,\n deferredLoading\n) {\n const screenOverlay = processingData.screenOverlayContainer;\n if (!defined(screenOverlay)) {\n return undefined;\n }\n\n const sourceResource = processingData.sourceResource;\n const uriResolver = processingData.uriResolver;\n\n const iconNode = queryFirstNode(screenOverlayNode, \"Icon\", namespaces.kml);\n const icon = getIconHref(\n iconNode,\n dataSource,\n sourceResource,\n uriResolver,\n false\n );\n\n if (!defined(icon)) {\n return undefined;\n }\n\n const img = document.createElement(\"img\");\n dataSource._screenOverlays.push(img);\n\n img.src = icon.url;\n img.onload = function () {\n const styles = [\"position: absolute\"];\n\n const screenXY = queryFirstNode(\n screenOverlayNode,\n \"screenXY\",\n namespaces.kml\n );\n const overlayXY = queryFirstNode(\n screenOverlayNode,\n \"overlayXY\",\n namespaces.kml\n );\n const size = queryFirstNode(screenOverlayNode, \"size\", namespaces.kml);\n\n let x, y;\n let xUnit, yUnit;\n let xStyle, yStyle;\n\n if (defined(size)) {\n x = queryNumericAttribute(size, \"x\");\n y = queryNumericAttribute(size, \"y\");\n xUnit = queryStringAttribute(size, \"xunits\");\n yUnit = queryStringAttribute(size, \"yunits\");\n\n if (defined(x) && x !== -1 && x !== 0) {\n if (xUnit === \"fraction\") {\n xStyle = `width: ${Math.floor(x * 100)}%`;\n } else if (xUnit === \"pixels\") {\n xStyle = `width: ${x}px`;\n }\n\n styles.push(xStyle);\n }\n\n if (defined(y) && y !== -1 && y !== 0) {\n if (yUnit === \"fraction\") {\n yStyle = `height: ${Math.floor(y * 100)}%`;\n } else if (yUnit === \"pixels\") {\n yStyle = `height: ${y}px`;\n }\n\n styles.push(yStyle);\n }\n }\n\n // set the interim style so the width/height properties get calculated\n img.style = styles.join(\";\");\n\n let xOrigin = 0;\n let yOrigin = img.height;\n\n if (defined(overlayXY)) {\n x = queryNumericAttribute(overlayXY, \"x\");\n y = queryNumericAttribute(overlayXY, \"y\");\n xUnit = queryStringAttribute(overlayXY, \"xunits\");\n yUnit = queryStringAttribute(overlayXY, \"yunits\");\n\n if (defined(x)) {\n if (xUnit === \"fraction\") {\n xOrigin = x * img.width;\n } else if (xUnit === \"pixels\") {\n xOrigin = x;\n } else if (xUnit === \"insetPixels\") {\n xOrigin = x;\n }\n }\n\n if (defined(y)) {\n if (yUnit === \"fraction\") {\n yOrigin = y * img.height;\n } else if (yUnit === \"pixels\") {\n yOrigin = y;\n } else if (yUnit === \"insetPixels\") {\n yOrigin = y;\n }\n }\n }\n\n if (defined(screenXY)) {\n x = queryNumericAttribute(screenXY, \"x\");\n y = queryNumericAttribute(screenXY, \"y\");\n xUnit = queryStringAttribute(screenXY, \"xunits\");\n yUnit = queryStringAttribute(screenXY, \"yunits\");\n\n if (defined(x)) {\n if (xUnit === \"fraction\") {\n xStyle = `${\"left: \" + \"calc(\"}${Math.floor(\n x * 100\n )}% - ${xOrigin}px)`;\n } else if (xUnit === \"pixels\") {\n xStyle = `left: ${x - xOrigin}px`;\n } else if (xUnit === \"insetPixels\") {\n xStyle = `right: ${x - xOrigin}px`;\n }\n\n styles.push(xStyle);\n }\n\n if (defined(y)) {\n if (yUnit === \"fraction\") {\n yStyle = `${\"bottom: \" + \"calc(\"}${Math.floor(\n y * 100\n )}% - ${yOrigin}px)`;\n } else if (yUnit === \"pixels\") {\n yStyle = `bottom: ${y - yOrigin}px`;\n } else if (yUnit === \"insetPixels\") {\n yStyle = `top: ${y - yOrigin}px`;\n }\n\n styles.push(yStyle);\n }\n }\n\n img.style = styles.join(\";\");\n };\n\n screenOverlay.appendChild(img);\n}\n\nfunction processGroundOverlay(\n dataSource,\n groundOverlay,\n processingData,\n deferredLoading\n) {\n const r = processFeature(dataSource, groundOverlay, processingData);\n const entity = r.entity;\n\n let geometry;\n let isLatLonQuad = false;\n\n const ellipsoid = dataSource._ellipsoid;\n const positions = readCoordinates(\n queryFirstNode(groundOverlay, \"LatLonQuad\", namespaces.gx),\n ellipsoid\n );\n const zIndex = queryNumericValue(groundOverlay, \"drawOrder\", namespaces.kml);\n if (defined(positions)) {\n geometry = createDefaultPolygon();\n geometry.hierarchy = new PolygonHierarchy(positions);\n geometry.zIndex = zIndex;\n entity.polygon = geometry;\n isLatLonQuad = true;\n } else {\n geometry = new RectangleGraphics();\n geometry.zIndex = zIndex;\n entity.rectangle = geometry;\n\n const latLonBox = queryFirstNode(\n groundOverlay,\n \"LatLonBox\",\n namespaces.kml\n );\n if (defined(latLonBox)) {\n let west = queryNumericValue(latLonBox, \"west\", namespaces.kml);\n let south = queryNumericValue(latLonBox, \"south\", namespaces.kml);\n let east = queryNumericValue(latLonBox, \"east\", namespaces.kml);\n let north = queryNumericValue(latLonBox, \"north\", namespaces.kml);\n\n if (defined(west)) {\n west = CesiumMath.negativePiToPi(CesiumMath.toRadians(west));\n }\n if (defined(south)) {\n south = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(south));\n }\n if (defined(east)) {\n east = CesiumMath.negativePiToPi(CesiumMath.toRadians(east));\n }\n if (defined(north)) {\n north = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(north));\n }\n geometry.coordinates = new Rectangle(west, south, east, north);\n\n const rotation = queryNumericValue(latLonBox, \"rotation\", namespaces.kml);\n if (defined(rotation)) {\n const rotationRadians = CesiumMath.toRadians(rotation);\n geometry.rotation = rotationRadians;\n geometry.stRotation = rotationRadians;\n }\n }\n }\n\n const iconNode = queryFirstNode(groundOverlay, \"Icon\", namespaces.kml);\n const href = getIconHref(\n iconNode,\n dataSource,\n processingData.sourceResource,\n processingData.uriResolver,\n true\n );\n if (defined(href)) {\n if (isLatLonQuad) {\n oneTimeWarning(\n \"kml-gx:LatLonQuad\",\n \"KML - gx:LatLonQuad Icon does not support texture projection.\"\n );\n }\n const x = queryNumericValue(iconNode, \"x\", namespaces.gx);\n const y = queryNumericValue(iconNode, \"y\", namespaces.gx);\n const w = queryNumericValue(iconNode, \"w\", namespaces.gx);\n const h = queryNumericValue(iconNode, \"h\", namespaces.gx);\n\n if (defined(x) || defined(y) || defined(w) || defined(h)) {\n oneTimeWarning(\n \"kml-groundOverlay-xywh\",\n \"KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays\"\n );\n }\n\n geometry.material = href;\n geometry.material.color = queryColorValue(\n groundOverlay,\n \"color\",\n namespaces.kml\n );\n geometry.material.transparent = true;\n } else {\n geometry.material = queryColorValue(groundOverlay, \"color\", namespaces.kml);\n }\n\n let altitudeMode = queryStringValue(\n groundOverlay,\n \"altitudeMode\",\n namespaces.kml\n );\n\n if (defined(altitudeMode)) {\n if (altitudeMode === \"absolute\") {\n //Use height above ellipsoid until we support MSL.\n geometry.height = queryNumericValue(\n groundOverlay,\n \"altitude\",\n namespaces.kml\n );\n geometry.zIndex = undefined;\n } else if (altitudeMode !== \"clampToGround\") {\n oneTimeWarning(\n \"kml-altitudeMode-unknown\",\n `KML - Unknown altitudeMode: ${altitudeMode}`\n );\n }\n // else just use the default of 0 until we support 'clampToGround'\n } else {\n altitudeMode = queryStringValue(\n groundOverlay,\n \"altitudeMode\",\n namespaces.gx\n );\n if (altitudeMode === \"relativeToSeaFloor\") {\n oneTimeWarning(\n \"kml-altitudeMode-relativeToSeaFloor\",\n \"KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute.\"\n );\n geometry.height = queryNumericValue(\n groundOverlay,\n \"altitude\",\n namespaces.kml\n );\n geometry.zIndex = undefined;\n } else if (altitudeMode === \"clampToSeaFloor\") {\n oneTimeWarning(\n \"kml-altitudeMode-clampToSeaFloor\",\n \"KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround.\"\n );\n } else if (defined(altitudeMode)) {\n oneTimeWarning(\n \"kml-altitudeMode-unknown\",\n `KML - Unknown altitudeMode: ${altitudeMode}`\n );\n }\n }\n}\n\nfunction processUnsupportedFeature(\n dataSource,\n node,\n processingData,\n deferredLoading\n) {\n dataSource._unsupportedNode.raiseEvent(\n dataSource,\n processingData.parentEntity,\n node,\n processingData.entityCollection,\n processingData.styleCollection,\n processingData.sourceResource,\n processingData.uriResolver\n );\n oneTimeWarning(\n `kml-unsupportedFeature-${node.nodeName}`,\n `KML - Unsupported feature: ${node.nodeName}`\n );\n}\n\nconst RefreshMode = {\n INTERVAL: 0,\n EXPIRE: 1,\n STOP: 2,\n};\n\nfunction cleanupString(s) {\n if (!defined(s) || s.length === 0) {\n return \"\";\n }\n\n const sFirst = s[0];\n if (sFirst === \"&\" || sFirst === \"?\") {\n s = s.substring(1);\n }\n\n return s;\n}\n\nconst zeroRectangle = new Rectangle();\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian2 = new Cartesian2();\nconst scratchCartesian3 = new Cartesian3();\n\nfunction processNetworkLinkQueryString(\n resource,\n camera,\n canvas,\n viewBoundScale,\n bbox,\n ellipsoid\n) {\n function fixLatitude(value) {\n if (value < -CesiumMath.PI_OVER_TWO) {\n return -CesiumMath.PI_OVER_TWO;\n } else if (value > CesiumMath.PI_OVER_TWO) {\n return CesiumMath.PI_OVER_TWO;\n }\n return value;\n }\n\n function fixLongitude(value) {\n if (value > CesiumMath.PI) {\n return value - CesiumMath.TWO_PI;\n } else if (value < -CesiumMath.PI) {\n return value + CesiumMath.TWO_PI;\n }\n\n return value;\n }\n\n let queryString = objectToQuery(resource.queryParameters);\n\n // objectToQuery escapes [ and ], so fix that\n queryString = queryString.replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n\n if (defined(camera) && camera._mode !== SceneMode.MORPHING) {\n let centerCartesian;\n let centerCartographic;\n\n bbox = defaultValue(bbox, zeroRectangle);\n if (defined(canvas)) {\n scratchCartesian2.x = canvas.clientWidth * 0.5;\n scratchCartesian2.y = canvas.clientHeight * 0.5;\n centerCartesian = camera.pickEllipsoid(\n scratchCartesian2,\n ellipsoid,\n scratchCartesian3\n );\n }\n\n if (defined(centerCartesian)) {\n centerCartographic = ellipsoid.cartesianToCartographic(\n centerCartesian,\n scratchCartographic\n );\n } else {\n centerCartographic = Rectangle.center(bbox, scratchCartographic);\n centerCartesian = ellipsoid.cartographicToCartesian(centerCartographic);\n }\n\n if (\n defined(viewBoundScale) &&\n !CesiumMath.equalsEpsilon(viewBoundScale, 1.0, CesiumMath.EPSILON9)\n ) {\n const newHalfWidth = bbox.width * viewBoundScale * 0.5;\n const newHalfHeight = bbox.height * viewBoundScale * 0.5;\n bbox = new Rectangle(\n fixLongitude(centerCartographic.longitude - newHalfWidth),\n fixLatitude(centerCartographic.latitude - newHalfHeight),\n fixLongitude(centerCartographic.longitude + newHalfWidth),\n fixLatitude(centerCartographic.latitude + newHalfHeight)\n );\n }\n\n queryString = queryString.replace(\n \"[bboxWest]\",\n CesiumMath.toDegrees(bbox.west).toString()\n );\n queryString = queryString.replace(\n \"[bboxSouth]\",\n CesiumMath.toDegrees(bbox.south).toString()\n );\n queryString = queryString.replace(\n \"[bboxEast]\",\n CesiumMath.toDegrees(bbox.east).toString()\n );\n queryString = queryString.replace(\n \"[bboxNorth]\",\n CesiumMath.toDegrees(bbox.north).toString()\n );\n\n const lon = CesiumMath.toDegrees(centerCartographic.longitude).toString();\n const lat = CesiumMath.toDegrees(centerCartographic.latitude).toString();\n queryString = queryString.replace(\"[lookatLon]\", lon);\n queryString = queryString.replace(\"[lookatLat]\", lat);\n queryString = queryString.replace(\n \"[lookatTilt]\",\n CesiumMath.toDegrees(camera.pitch).toString()\n );\n queryString = queryString.replace(\n \"[lookatHeading]\",\n CesiumMath.toDegrees(camera.heading).toString()\n );\n queryString = queryString.replace(\n \"[lookatRange]\",\n Cartesian3.distance(camera.positionWC, centerCartesian)\n );\n queryString = queryString.replace(\"[lookatTerrainLon]\", lon);\n queryString = queryString.replace(\"[lookatTerrainLat]\", lat);\n queryString = queryString.replace(\n \"[lookatTerrainAlt]\",\n centerCartographic.height.toString()\n );\n\n ellipsoid.cartesianToCartographic(camera.positionWC, scratchCartographic);\n queryString = queryString.replace(\n \"[cameraLon]\",\n CesiumMath.toDegrees(scratchCartographic.longitude).toString()\n );\n queryString = queryString.replace(\n \"[cameraLat]\",\n CesiumMath.toDegrees(scratchCartographic.latitude).toString()\n );\n queryString = queryString.replace(\n \"[cameraAlt]\",\n CesiumMath.toDegrees(scratchCartographic.height).toString()\n );\n\n const frustum = camera.frustum;\n const aspectRatio = frustum.aspectRatio;\n let horizFov = \"\";\n let vertFov = \"\";\n if (defined(aspectRatio)) {\n const fov = CesiumMath.toDegrees(frustum.fov);\n if (aspectRatio > 1.0) {\n horizFov = fov;\n vertFov = fov / aspectRatio;\n } else {\n vertFov = fov;\n horizFov = fov * aspectRatio;\n }\n }\n queryString = queryString.replace(\"[horizFov]\", horizFov.toString());\n queryString = queryString.replace(\"[vertFov]\", vertFov.toString());\n } else {\n queryString = queryString.replace(\"[bboxWest]\", \"-180\");\n queryString = queryString.replace(\"[bboxSouth]\", \"-90\");\n queryString = queryString.replace(\"[bboxEast]\", \"180\");\n queryString = queryString.replace(\"[bboxNorth]\", \"90\");\n\n queryString = queryString.replace(\"[lookatLon]\", \"\");\n queryString = queryString.replace(\"[lookatLat]\", \"\");\n queryString = queryString.replace(\"[lookatRange]\", \"\");\n queryString = queryString.replace(\"[lookatTilt]\", \"\");\n queryString = queryString.replace(\"[lookatHeading]\", \"\");\n queryString = queryString.replace(\"[lookatTerrainLon]\", \"\");\n queryString = queryString.replace(\"[lookatTerrainLat]\", \"\");\n queryString = queryString.replace(\"[lookatTerrainAlt]\", \"\");\n\n queryString = queryString.replace(\"[cameraLon]\", \"\");\n queryString = queryString.replace(\"[cameraLat]\", \"\");\n queryString = queryString.replace(\"[cameraAlt]\", \"\");\n queryString = queryString.replace(\"[horizFov]\", \"\");\n queryString = queryString.replace(\"[vertFov]\", \"\");\n }\n\n if (defined(canvas)) {\n queryString = queryString.replace(\"[horizPixels]\", canvas.clientWidth);\n queryString = queryString.replace(\"[vertPixels]\", canvas.clientHeight);\n } else {\n queryString = queryString.replace(\"[horizPixels]\", \"\");\n queryString = queryString.replace(\"[vertPixels]\", \"\");\n }\n\n queryString = queryString.replace(\"[terrainEnabled]\", \"1\");\n queryString = queryString.replace(\"[clientVersion]\", \"1\");\n queryString = queryString.replace(\"[kmlVersion]\", \"2.2\");\n queryString = queryString.replace(\"[clientName]\", \"Cesium\");\n queryString = queryString.replace(\"[language]\", \"English\");\n\n resource.setQueryParameters(queryToObject(queryString));\n}\n\nfunction processNetworkLink(dataSource, node, processingData, deferredLoading) {\n const r = processFeature(dataSource, node, processingData);\n const networkEntity = r.entity;\n\n const sourceResource = processingData.sourceResource;\n const uriResolver = processingData.uriResolver;\n\n let link = queryFirstNode(node, \"Link\", namespaces.kml);\n\n if (!defined(link)) {\n link = queryFirstNode(node, \"Url\", namespaces.kml);\n }\n if (defined(link)) {\n let href = queryStringValue(link, \"href\", namespaces.kml);\n let viewRefreshMode;\n let viewBoundScale;\n if (defined(href)) {\n let newSourceUri = href;\n href = resolveHref(href, sourceResource, processingData.uriResolver);\n\n // We need to pass in the original path if resolveHref returns a data uri because the network link\n // references a document in a KMZ archive\n if (/^data:/.test(href.getUrlComponent())) {\n // So if sourceUri isn't the kmz file, then its another kml in the archive, so resolve it\n if (!/\\.kmz/i.test(sourceResource.getUrlComponent())) {\n newSourceUri = sourceResource.getDerivedResource({\n url: newSourceUri,\n });\n }\n } else {\n newSourceUri = href.clone(); // Not a data uri so use the fully qualified uri\n viewRefreshMode = queryStringValue(\n link,\n \"viewRefreshMode\",\n namespaces.kml\n );\n if (viewRefreshMode === \"onRegion\") {\n oneTimeWarning(\n \"kml-refrehMode-onRegion\",\n \"KML - Unsupported viewRefreshMode: onRegion\"\n );\n return;\n }\n viewBoundScale = defaultValue(\n queryStringValue(link, \"viewBoundScale\", namespaces.kml),\n 1.0\n );\n const defaultViewFormat =\n viewRefreshMode === \"onStop\"\n ? \"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]\"\n : \"\";\n const viewFormat = defaultValue(\n queryStringValue(link, \"viewFormat\", namespaces.kml),\n defaultViewFormat\n );\n const httpQuery = queryStringValue(link, \"httpQuery\", namespaces.kml);\n if (defined(viewFormat)) {\n href.setQueryParameters(queryToObject(cleanupString(viewFormat)));\n }\n if (defined(httpQuery)) {\n href.setQueryParameters(queryToObject(cleanupString(httpQuery)));\n }\n\n const ellipsoid = dataSource._ellipsoid;\n processNetworkLinkQueryString(\n href,\n dataSource.camera,\n dataSource.canvas,\n viewBoundScale,\n dataSource._lastCameraView.bbox,\n ellipsoid\n );\n }\n\n const options = {\n sourceUri: newSourceUri,\n uriResolver: uriResolver,\n context: networkEntity.id,\n screenOverlayContainer: processingData.screenOverlayContainer,\n };\n const networkLinkCollection = new EntityCollection();\n const promise = load(dataSource, networkLinkCollection, href, options)\n .then(function (rootElement) {\n const entities = dataSource._entityCollection;\n const newEntities = networkLinkCollection.values;\n entities.suspendEvents();\n for (let i = 0; i < newEntities.length; i++) {\n const newEntity = newEntities[i];\n if (!defined(newEntity.parent)) {\n newEntity.parent = networkEntity;\n mergeAvailabilityWithParent(newEntity);\n }\n\n entities.add(newEntity);\n }\n entities.resumeEvents();\n\n // Add network links to a list if we need they will need to be updated\n const refreshMode = queryStringValue(\n link,\n \"refreshMode\",\n namespaces.kml\n );\n let refreshInterval = defaultValue(\n queryNumericValue(link, \"refreshInterval\", namespaces.kml),\n 0\n );\n if (\n (refreshMode === \"onInterval\" && refreshInterval > 0) ||\n refreshMode === \"onExpire\" ||\n viewRefreshMode === \"onStop\"\n ) {\n const networkLinkControl = queryFirstNode(\n rootElement,\n \"NetworkLinkControl\",\n namespaces.kml\n );\n const hasNetworkLinkControl = defined(networkLinkControl);\n\n const now = JulianDate.now();\n const networkLinkInfo = {\n id: createGuid(),\n href: href,\n cookie: {},\n lastUpdated: now,\n updating: false,\n entity: networkEntity,\n viewBoundScale: viewBoundScale,\n needsUpdate: false,\n cameraUpdateTime: now,\n };\n\n let minRefreshPeriod = 0;\n if (hasNetworkLinkControl) {\n networkLinkInfo.cookie = queryToObject(\n defaultValue(\n queryStringValue(\n networkLinkControl,\n \"cookie\",\n namespaces.kml\n ),\n \"\"\n )\n );\n minRefreshPeriod = defaultValue(\n queryNumericValue(\n networkLinkControl,\n \"minRefreshPeriod\",\n namespaces.kml\n ),\n 0\n );\n }\n\n if (refreshMode === \"onInterval\") {\n if (hasNetworkLinkControl) {\n refreshInterval = Math.max(minRefreshPeriod, refreshInterval);\n }\n networkLinkInfo.refreshMode = RefreshMode.INTERVAL;\n networkLinkInfo.time = refreshInterval;\n } else if (refreshMode === \"onExpire\") {\n let expires;\n if (hasNetworkLinkControl) {\n expires = queryStringValue(\n networkLinkControl,\n \"expires\",\n namespaces.kml\n );\n }\n if (defined(expires)) {\n try {\n const date = JulianDate.fromIso8601(expires);\n const diff = JulianDate.secondsDifference(date, now);\n if (diff > 0 && diff < minRefreshPeriod) {\n JulianDate.addSeconds(now, minRefreshPeriod, date);\n }\n networkLinkInfo.refreshMode = RefreshMode.EXPIRE;\n networkLinkInfo.time = date;\n } catch (e) {\n oneTimeWarning(\n \"kml-refreshMode-onInterval-onExpire\",\n \"KML - NetworkLinkControl expires is not a valid date\"\n );\n }\n } else {\n oneTimeWarning(\n \"kml-refreshMode-onExpire\",\n \"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element\"\n );\n }\n } else if (defined(dataSource.camera)) {\n // Only allow onStop refreshes if we have a camera\n networkLinkInfo.refreshMode = RefreshMode.STOP;\n networkLinkInfo.time = defaultValue(\n queryNumericValue(link, \"viewRefreshTime\", namespaces.kml),\n 0\n );\n } else {\n oneTimeWarning(\n \"kml-refrehMode-onStop-noCamera\",\n \"A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.\"\n );\n }\n\n if (defined(networkLinkInfo.refreshMode)) {\n dataSource._networkLinks.set(networkLinkInfo.id, networkLinkInfo);\n }\n }\n })\n .catch(function (error) {\n oneTimeWarning(`An error occured during loading ${href.url}`);\n dataSource._error.raiseEvent(dataSource, error);\n });\n\n deferredLoading.addPromise(promise);\n }\n }\n}\n\nfunction processFeatureNode(dataSource, node, processingData, deferredLoading) {\n const featureProcessor = featureTypes[node.localName];\n if (defined(featureProcessor)) {\n return featureProcessor(dataSource, node, processingData, deferredLoading);\n }\n\n return processUnsupportedFeature(\n dataSource,\n node,\n processingData,\n deferredLoading\n );\n}\n\nfunction loadKml(\n dataSource,\n entityCollection,\n kml,\n sourceResource,\n uriResolver,\n screenOverlayContainer,\n context\n) {\n entityCollection.removeAll();\n\n const documentElement = kml.documentElement;\n const document =\n documentElement.localName === \"Document\"\n ? documentElement\n : queryFirstNode(documentElement, \"Document\", namespaces.kml);\n let name = queryStringValue(document, \"name\", namespaces.kml);\n if (!defined(name)) {\n name = getFilenameFromUri(sourceResource.getUrlComponent());\n }\n\n // Only set the name from the root document\n if (!defined(dataSource._name)) {\n dataSource._name = name;\n }\n\n const deferredLoading = new KmlDataSource._DeferredLoading(dataSource);\n const styleCollection = new EntityCollection(dataSource);\n return Promise.all(\n processStyles(\n dataSource,\n kml,\n styleCollection,\n sourceResource,\n false,\n uriResolver\n )\n ).then(function () {\n let element = kml.documentElement;\n if (element.localName === \"kml\") {\n const childNodes = element.childNodes;\n for (let i = 0; i < childNodes.length; i++) {\n const tmp = childNodes[i];\n if (defined(featureTypes[tmp.localName])) {\n element = tmp;\n break;\n }\n }\n }\n\n const processingData = {\n parentEntity: undefined,\n entityCollection: entityCollection,\n styleCollection: styleCollection,\n sourceResource: sourceResource,\n uriResolver: uriResolver,\n context: context,\n screenOverlayContainer: screenOverlayContainer,\n };\n\n entityCollection.suspendEvents();\n processFeatureNode(dataSource, element, processingData, deferredLoading);\n entityCollection.resumeEvents();\n\n return deferredLoading.wait().then(function () {\n return kml.documentElement;\n });\n });\n}\n\nfunction loadKmz(\n dataSource,\n entityCollection,\n blob,\n sourceResource,\n screenOverlayContainer\n) {\n const zWorkerUrl = buildModuleUrl(\"ThirdParty/Workers/z-worker-pako.js\");\n zip.configure({\n workerScripts: {\n deflate: [zWorkerUrl, \"./pako_deflate.min.js\"],\n inflate: [zWorkerUrl, \"./pako_inflate.min.js\"],\n },\n });\n\n const reader = new zip.ZipReader(new zip.BlobReader(blob));\n return Promise.resolve(reader.getEntries()).then(function (entries) {\n const promises = [];\n const uriResolver = {};\n let docEntry;\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (!entry.directory) {\n if (/\\.kml$/i.test(entry.filename)) {\n // We use the first KML document we come across\n // https://developers.google.com/kml/documentation/kmzarchives\n // Unless we come across a .kml file at the root of the archive because GE does this\n if (!defined(docEntry) || !/\\//i.test(entry.filename)) {\n if (defined(docEntry)) {\n // We found one at the root so load the initial kml as a data uri\n promises.push(loadDataUriFromZip(docEntry, uriResolver));\n }\n docEntry = entry;\n } else {\n // Wasn't the first kml and wasn't at the root\n promises.push(loadDataUriFromZip(entry, uriResolver));\n }\n } else {\n promises.push(loadDataUriFromZip(entry, uriResolver));\n }\n }\n }\n\n // Now load the root KML document\n if (defined(docEntry)) {\n promises.push(loadXmlFromZip(docEntry, uriResolver));\n }\n return Promise.all(promises).then(function () {\n reader.close();\n if (!defined(uriResolver.kml)) {\n throw new RuntimeError(\"KMZ file does not contain a KML document.\");\n }\n uriResolver.keys = Object.keys(uriResolver);\n return loadKml(\n dataSource,\n entityCollection,\n uriResolver.kml,\n sourceResource,\n uriResolver,\n screenOverlayContainer\n );\n });\n });\n}\n\nfunction load(dataSource, entityCollection, data, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let sourceUri = options.sourceUri;\n const uriResolver = options.uriResolver;\n const context = options.context;\n let screenOverlayContainer = options.screenOverlayContainer;\n\n let promise = data;\n if (typeof data === \"string\" || data instanceof Resource) {\n data = Resource.createIfNeeded(data);\n promise = data.fetchBlob();\n sourceUri = defaultValue(sourceUri, data.clone());\n\n // Add resource credits to our list of credits to display\n const resourceCredits = dataSource._resourceCredits;\n const credits = data.credits;\n if (defined(credits)) {\n const length = credits.length;\n for (let i = 0; i < length; i++) {\n resourceCredits.push(credits[i]);\n }\n }\n } else {\n sourceUri = defaultValue(sourceUri, Resource.DEFAULT.clone());\n }\n\n sourceUri = Resource.createIfNeeded(sourceUri);\n\n if (defined(screenOverlayContainer)) {\n screenOverlayContainer = getElement(screenOverlayContainer);\n }\n\n return Promise.resolve(promise)\n .then(function (dataToLoad) {\n if (dataToLoad instanceof Blob) {\n return isZipFile(dataToLoad).then(function (isZip) {\n if (isZip) {\n return loadKmz(\n dataSource,\n entityCollection,\n dataToLoad,\n sourceUri,\n screenOverlayContainer\n );\n }\n return readBlobAsText(dataToLoad).then(function (text) {\n //There's no official way to validate if a parse was successful.\n //The following check detects the error on various browsers.\n\n //Insert missing namespaces\n text = insertNamespaces(text);\n\n //Remove Duplicate Namespaces\n text = removeDuplicateNamespaces(text);\n\n //IE raises an exception\n let kml;\n let error;\n try {\n kml = parser.parseFromString(text, \"application/xml\");\n } catch (e) {\n error = e.toString();\n }\n\n //The parse succeeds on Chrome and Firefox, but the error\n //handling is different in each.\n if (\n defined(error) ||\n kml.body ||\n kml.documentElement.tagName === \"parsererror\"\n ) {\n //Firefox has error information as the firstChild nodeValue.\n let msg = defined(error)\n ? error\n : kml.documentElement.firstChild.nodeValue;\n\n //Chrome has it in the body text.\n if (!msg) {\n msg = kml.body.innerText;\n }\n\n //Return the error\n throw new RuntimeError(msg);\n }\n return loadKml(\n dataSource,\n entityCollection,\n kml,\n sourceUri,\n uriResolver,\n screenOverlayContainer,\n context\n );\n });\n });\n }\n return loadKml(\n dataSource,\n entityCollection,\n dataToLoad,\n sourceUri,\n uriResolver,\n screenOverlayContainer,\n context\n );\n })\n .catch(function (error) {\n dataSource._error.raiseEvent(dataSource, error);\n console.log(error);\n return Promise.reject(error);\n });\n}\n\n// NOTE: LoadOptions properties are repeated in ConstructorOptions because some\n// tooling does not support \"base types\" for @typedef. Remove if/when\n// https://github.com/microsoft/TypeScript/issues/20077 and/or\n// https://github.com/jsdoc/jsdoc/issues/1199 actually get resolved\n/**\n * @typedef {Object} KmlDataSource.LoadOptions\n *\n * Initialization options for the `load` method.\n *\n * @property {String} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.\n * @property {Boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.\n * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations.\n * @property {Element|String} [screenOverlayContainer] A container for ScreenOverlay images.\n */\n\n/**\n * @typedef {Object} KmlDataSource.ConstructorOptions\n *\n * Options for constructing a new KmlDataSource, or calling the static `load` method.\n *\n * @property {Camera} [camera] The camera that is used for viewRefreshModes and sending camera properties to network links.\n * @property {HTMLCanvasElement} [canvas] The canvas that is used for sending viewer properties to network links.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n *\n * @property {String} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.\n * @property {Boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.\n * @property {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The global ellipsoid used for geographical calculations.\n * @property {Element|String} [screenOverlayContainer] A container for ScreenOverlay images.\n\n*/\n\n/**\n * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).\n * <p>\n * KML support in Cesium is incomplete, but a large amount of the standard,\n * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue\n * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a\n * detailed list of what is and isn't supported. Cesium will also write information to the\n * console when it encounters most unsupported features.\n * </p>\n * <p>\n * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>\n * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}\n * under the <code>kml</code> property.\n * </p>\n *\n * @alias KmlDataSource\n * @constructor\n *\n * @param {KmlDataSource.ConstructorOptions} [options] Object describing initialization options\n *\n * @see {@link http://www.opengeospatial.org/standards/kml/|Open Geospatial Consortium KML Standard}\n * @see {@link https://developers.google.com/kml/|Google KML Documentation}\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=KML.html|Cesium Sandcastle KML Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',\n * {\n * camera: viewer.scene.camera,\n * canvas: viewer.scene.canvas\n * })\n * );\n */\nfunction KmlDataSource(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const camera = options.camera;\n const canvas = options.canvas;\n\n this._changed = new Event();\n this._error = new Event();\n this._loading = new Event();\n this._refresh = new Event();\n this._unsupportedNode = new Event();\n\n this._clock = undefined;\n this._entityCollection = new EntityCollection(this);\n this._name = undefined;\n this._isLoading = false;\n this._pinBuilder = new PinBuilder();\n this._networkLinks = new AssociativeArray();\n this._entityCluster = new EntityCluster();\n\n /**\n * The current size of this Canvas will be used to populate the Link parameters\n * for client height and width.\n *\n * @type {HTMLCanvasElement | undefined}\n */\n this.canvas = canvas;\n\n /**\n * The position and orientation of this {@link Camera} will be used to\n * populate various camera parameters when making network requests.\n * Camera movement will determine when to trigger NetworkLink refresh if\n * <code>viewRefreshMode</code> is <code>onStop</code>.\n *\n * @type {Camera | undefined}\n */\n this.camera = camera;\n\n this._lastCameraView = {\n position: defined(camera) ? Cartesian3.clone(camera.positionWC) : undefined,\n direction: defined(camera)\n ? Cartesian3.clone(camera.directionWC)\n : undefined,\n up: defined(camera) ? Cartesian3.clone(camera.upWC) : undefined,\n bbox: defined(camera)\n ? camera.computeViewRectangle()\n : Rectangle.clone(Rectangle.MAX_VALUE),\n };\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n // User specified credit\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n // Create a list of Credit's from the resource that the user can't remove\n this._resourceCredits = [];\n\n this._kmlTours = [];\n\n this._screenOverlays = [];\n}\n\n/**\n * Creates a Promise to a new instance loaded with the provided KML data.\n *\n * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.\n * @param {KmlDataSource.ConstructorOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<KmlDataSource>} A promise that will resolve to a new KmlDataSource instance once the KML is loaded.\n */\nKmlDataSource.load = function (data, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const dataSource = new KmlDataSource(options);\n return dataSource.load(data, options);\n};\n\nObject.defineProperties(KmlDataSource.prototype, {\n /**\n * Gets or sets a human-readable name for this instance.\n * This will be automatically be set to the KML document name on load.\n * @memberof KmlDataSource.prototype\n * @type {String}\n */\n name: {\n get: function () {\n return this._name;\n },\n set: function (value) {\n if (this._name !== value) {\n this._name = value;\n this._changed.raiseEvent(this);\n }\n },\n },\n /**\n * Gets the clock settings defined by the loaded KML. This represents the total\n * availability interval for all time-dynamic data. If the KML does not contain\n * time-dynamic data, this value is undefined.\n * @memberof KmlDataSource.prototype\n * @type {DataSourceClock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n },\n /**\n * Gets the collection of {@link Entity} instances.\n * @memberof KmlDataSource.prototype\n * @type {EntityCollection}\n */\n entities: {\n get: function () {\n return this._entityCollection;\n },\n },\n /**\n * Gets a value indicating if the data source is currently loading data.\n * @memberof KmlDataSource.prototype\n * @type {Boolean}\n */\n isLoading: {\n get: function () {\n return this._isLoading;\n },\n },\n /**\n * Gets an event that will be raised when the underlying data changes.\n * @memberof KmlDataSource.prototype\n * @type {Event}\n */\n changedEvent: {\n get: function () {\n return this._changed;\n },\n },\n /**\n * Gets an event that will be raised if an error is encountered during processing.\n * @memberof KmlDataSource.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._error;\n },\n },\n /**\n * Gets an event that will be raised when the data source either starts or stops loading.\n * @memberof KmlDataSource.prototype\n * @type {Event}\n */\n loadingEvent: {\n get: function () {\n return this._loading;\n },\n },\n /**\n * Gets an event that will be raised when the data source refreshes a network link.\n * @memberof KmlDataSource.prototype\n * @type {Event}\n */\n refreshEvent: {\n get: function () {\n return this._refresh;\n },\n },\n /**\n * Gets an event that will be raised when the data source finds an unsupported node type.\n * @memberof KmlDataSource.prototype\n * @type {Event}\n */\n unsupportedNodeEvent: {\n get: function () {\n return this._unsupportedNode;\n },\n },\n /**\n * Gets whether or not this data source should be displayed.\n * @memberof KmlDataSource.prototype\n * @type {Boolean}\n */\n show: {\n get: function () {\n return this._entityCollection.show;\n },\n set: function (value) {\n this._entityCollection.show = value;\n },\n },\n\n /**\n * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.\n *\n * @memberof KmlDataSource.prototype\n * @type {EntityCluster}\n */\n clustering: {\n get: function () {\n return this._entityCluster;\n },\n set: function (value) {\nthis._entityCluster = value;\n },\n },\n /**\n * Gets the credit that will be displayed for the data source\n * @memberof KmlDataSource.prototype\n * @type {Credit}\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n /**\n * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.\n * @memberof KmlDataSource.prototype\n * @type {KmlTour[]}\n */\n kmlTours: {\n get: function () {\n return this._kmlTours;\n },\n },\n});\n\n/**\n * Asynchronously loads the provided KML data, replacing any existing data.\n *\n * @param {Resource|String|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.\n * @param {KmlDataSource.LoadOptions} [options] An object specifying configuration options\n *\n * @returns {Promise.<KmlDataSource>} A promise that will resolve to this instances once the KML is loaded.\n */\nKmlDataSource.prototype.load = function (data, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n DataSource.setLoading(this, true);\n\n const oldName = this._name;\n this._name = undefined;\n this._clampToGround = defaultValue(options.clampToGround, false);\n\n const that = this;\n return load(this, this._entityCollection, data, options)\n .then(function () {\n let clock;\n\n const availability = that._entityCollection.computeAvailability();\n\n let start = availability.start;\n let stop = availability.stop;\n const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n if (!isMinStart || !isMaxStop) {\n let date;\n\n //If start is min time just start at midnight this morning, local time\n if (isMinStart) {\n date = new Date();\n date.setHours(0, 0, 0, 0);\n start = JulianDate.fromDate(date);\n }\n\n //If stop is max value just stop at midnight tonight, local time\n if (isMaxStop) {\n date = new Date();\n date.setHours(24, 0, 0, 0);\n stop = JulianDate.fromDate(date);\n }\n\n clock = new DataSourceClock();\n clock.startTime = start;\n clock.stopTime = stop;\n clock.currentTime = JulianDate.clone(start);\n clock.clockRange = ClockRange.LOOP_STOP;\n clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n clock.multiplier = Math.round(\n Math.min(\n Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),\n 3.15569e7\n )\n );\n }\n\n let changed = false;\n if (clock !== that._clock) {\n that._clock = clock;\n changed = true;\n }\n\n if (oldName !== that._name) {\n changed = true;\n }\n\n if (changed) {\n that._changed.raiseEvent(that);\n }\n\n DataSource.setLoading(that, false);\n\n return that;\n })\n .catch(function (error) {\n DataSource.setLoading(that, false);\n that._error.raiseEvent(that, error);\n console.log(error);\n return Promise.reject(error);\n });\n};\n\n/**\n * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.\n */\nKmlDataSource.prototype.destroy = function () {\n while (this._screenOverlays.length > 0) {\n const elem = this._screenOverlays.pop();\n elem.remove();\n }\n};\n\nfunction mergeAvailabilityWithParent(child) {\n const parent = child.parent;\n if (defined(parent)) {\n const parentAvailability = parent.availability;\n if (defined(parentAvailability)) {\n const childAvailability = child.availability;\n if (defined(childAvailability)) {\n childAvailability.intersect(parentAvailability);\n } else {\n child.availability = parentAvailability;\n }\n }\n }\n}\n\nfunction getNetworkLinkUpdateCallback(\n dataSource,\n networkLink,\n newEntityCollection,\n networkLinks,\n processedHref\n) {\n return function (rootElement) {\n if (!networkLinks.contains(networkLink.id)) {\n // Got into the odd case where a parent network link was updated while a child\n // network link update was in flight, so just throw it away.\n return;\n }\n let remove = false;\n const networkLinkControl = queryFirstNode(\n rootElement,\n \"NetworkLinkControl\",\n namespaces.kml\n );\n const hasNetworkLinkControl = defined(networkLinkControl);\n\n let minRefreshPeriod = 0;\n if (hasNetworkLinkControl) {\n if (\n defined(queryFirstNode(networkLinkControl, \"Update\", namespaces.kml))\n ) {\n oneTimeWarning(\n \"kml-networkLinkControl-update\",\n \"KML - NetworkLinkControl updates aren't supported.\"\n );\n networkLink.updating = false;\n networkLinks.remove(networkLink.id);\n return;\n }\n networkLink.cookie = queryToObject(\n defaultValue(\n queryStringValue(networkLinkControl, \"cookie\", namespaces.kml),\n \"\"\n )\n );\n minRefreshPeriod = defaultValue(\n queryNumericValue(\n networkLinkControl,\n \"minRefreshPeriod\",\n namespaces.kml\n ),\n 0\n );\n }\n\n const now = JulianDate.now();\n const refreshMode = networkLink.refreshMode;\n if (refreshMode === RefreshMode.INTERVAL) {\n if (defined(networkLinkControl)) {\n networkLink.time = Math.max(minRefreshPeriod, networkLink.time);\n }\n } else if (refreshMode === RefreshMode.EXPIRE) {\n let expires;\n if (defined(networkLinkControl)) {\n expires = queryStringValue(\n networkLinkControl,\n \"expires\",\n namespaces.kml\n );\n }\n if (defined(expires)) {\n try {\n const date = JulianDate.fromIso8601(expires);\n const diff = JulianDate.secondsDifference(date, now);\n if (diff > 0 && diff < minRefreshPeriod) {\n JulianDate.addSeconds(now, minRefreshPeriod, date);\n }\n networkLink.time = date;\n } catch (e) {\n oneTimeWarning(\n \"kml-networkLinkControl-expires\",\n \"KML - NetworkLinkControl expires is not a valid date\"\n );\n remove = true;\n }\n } else {\n oneTimeWarning(\n \"kml-refreshMode-onExpire\",\n \"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element\"\n );\n remove = true;\n }\n }\n\n const networkLinkEntity = networkLink.entity;\n const entityCollection = dataSource._entityCollection;\n const newEntities = newEntityCollection.values;\n\n function removeChildren(entity) {\n entityCollection.remove(entity);\n const children = entity._children;\n const count = children.length;\n for (let i = 0; i < count; ++i) {\n removeChildren(children[i]);\n }\n }\n\n // Remove old entities\n entityCollection.suspendEvents();\n const entitiesCopy = entityCollection.values.slice();\n let i;\n for (i = 0; i < entitiesCopy.length; ++i) {\n const entityToRemove = entitiesCopy[i];\n if (entityToRemove.parent === networkLinkEntity) {\n entityToRemove.parent = undefined;\n removeChildren(entityToRemove);\n }\n }\n entityCollection.resumeEvents();\n\n // Add new entities\n entityCollection.suspendEvents();\n for (i = 0; i < newEntities.length; i++) {\n const newEntity = newEntities[i];\n if (!defined(newEntity.parent)) {\n newEntity.parent = networkLinkEntity;\n mergeAvailabilityWithParent(newEntity);\n }\n entityCollection.add(newEntity);\n }\n entityCollection.resumeEvents();\n\n // No refresh information remove it, otherwise update lastUpdate time\n if (remove) {\n networkLinks.remove(networkLink.id);\n } else {\n networkLink.lastUpdated = now;\n }\n\n const availability = entityCollection.computeAvailability();\n\n const start = availability.start;\n const stop = availability.stop;\n const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);\n const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);\n if (!isMinStart || !isMaxStop) {\n const clock = dataSource._clock;\n\n if (clock.startTime !== start || clock.stopTime !== stop) {\n clock.startTime = start;\n clock.stopTime = stop;\n dataSource._changed.raiseEvent(dataSource);\n }\n }\n\n networkLink.updating = false;\n networkLink.needsUpdate = false;\n dataSource._refresh.raiseEvent(\n dataSource,\n processedHref.getUrlComponent(true)\n );\n };\n}\n\nconst entitiesToIgnore = new AssociativeArray();\n\n/**\n * Updates any NetworkLink that require updating.\n *\n * @param {JulianDate} time The simulation time.\n * @returns {Boolean} True if this data source is ready to be displayed at the provided time, false otherwise.\n */\nKmlDataSource.prototype.update = function (time) {\n const networkLinks = this._networkLinks;\n if (networkLinks.length === 0) {\n return true;\n }\n\n const now = JulianDate.now();\n const that = this;\n\n entitiesToIgnore.removeAll();\n\n function recurseIgnoreEntities(entity) {\n const children = entity._children;\n const count = children.length;\n for (let i = 0; i < count; ++i) {\n const child = children[i];\n entitiesToIgnore.set(child.id, child);\n recurseIgnoreEntities(child);\n }\n }\n\n let cameraViewUpdate = false;\n const lastCameraView = this._lastCameraView;\n const camera = this.camera;\n if (\n defined(camera) &&\n !(\n camera.positionWC.equalsEpsilon(\n lastCameraView.position,\n CesiumMath.EPSILON7\n ) &&\n camera.directionWC.equalsEpsilon(\n lastCameraView.direction,\n CesiumMath.EPSILON7\n ) &&\n camera.upWC.equalsEpsilon(lastCameraView.up, CesiumMath.EPSILON7)\n )\n ) {\n // Camera has changed so update the last view\n lastCameraView.position = Cartesian3.clone(camera.positionWC);\n lastCameraView.direction = Cartesian3.clone(camera.directionWC);\n lastCameraView.up = Cartesian3.clone(camera.upWC);\n lastCameraView.bbox = camera.computeViewRectangle();\n cameraViewUpdate = true;\n }\n\n const newNetworkLinks = new AssociativeArray();\n let changed = false;\n networkLinks.values.forEach(function (networkLink) {\n const entity = networkLink.entity;\n if (entitiesToIgnore.contains(entity.id)) {\n return;\n }\n\n if (!networkLink.updating) {\n let doUpdate = false;\n if (networkLink.refreshMode === RefreshMode.INTERVAL) {\n if (\n JulianDate.secondsDifference(now, networkLink.lastUpdated) >\n networkLink.time\n ) {\n doUpdate = true;\n }\n } else if (networkLink.refreshMode === RefreshMode.EXPIRE) {\n if (JulianDate.greaterThan(now, networkLink.time)) {\n doUpdate = true;\n }\n } else if (networkLink.refreshMode === RefreshMode.STOP) {\n if (cameraViewUpdate) {\n networkLink.needsUpdate = true;\n networkLink.cameraUpdateTime = now;\n }\n\n if (\n networkLink.needsUpdate &&\n JulianDate.secondsDifference(now, networkLink.cameraUpdateTime) >=\n networkLink.time\n ) {\n doUpdate = true;\n }\n }\n\n if (doUpdate) {\n recurseIgnoreEntities(entity);\n networkLink.updating = true;\n const newEntityCollection = new EntityCollection();\n const href = networkLink.href.clone();\n\n href.setQueryParameters(networkLink.cookie);\n const ellipsoid = defaultValue(that._ellipsoid, Ellipsoid.WGS84);\n processNetworkLinkQueryString(\n href,\n that.camera,\n that.canvas,\n networkLink.viewBoundScale,\n lastCameraView.bbox,\n ellipsoid\n );\n\n load(that, newEntityCollection, href, {\n context: entity.id,\n })\n .then(\n getNetworkLinkUpdateCallback(\n that,\n networkLink,\n newEntityCollection,\n newNetworkLinks,\n href\n )\n )\n .catch(function (error) {\n const msg = `NetworkLink ${networkLink.href} refresh failed: ${error}`;\n console.log(msg);\n that._error.raiseEvent(that, msg);\n });\n changed = true;\n }\n }\n newNetworkLinks.set(networkLink.id, networkLink);\n });\n\n if (changed) {\n this._networkLinks = newNetworkLinks;\n this._changed.raiseEvent(this);\n }\n\n return true;\n};\n\n/**\n * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.\n * @alias KmlFeatureData\n * @constructor\n */\nfunction KmlFeatureData() {\n /**\n * @typedef KmlFeatureData.Author\n * @type {Object}\n * @property {String} name Gets the name.\n * @property {String} uri Gets the URI.\n * @property {Number} age Gets the email.\n */\n\n /**\n * Gets the atom syndication format author field.\n * @type {KmlFeatureData.Author}\n */\n this.author = {\n name: undefined,\n uri: undefined,\n email: undefined,\n };\n\n /**\n * @typedef KmlFeatureData.Link\n * @type {Object}\n * @property {String} href Gets the href.\n * @property {String} hreflang Gets the language of the linked resource.\n * @property {String} rel Gets the link relation.\n * @property {String} type Gets the link type.\n * @property {String} title Gets the link title.\n * @property {String} length Gets the link length.\n */\n\n /**\n * Gets the link.\n * @type {KmlFeatureData.Link}\n */\n this.link = {\n href: undefined,\n hreflang: undefined,\n rel: undefined,\n type: undefined,\n title: undefined,\n length: undefined,\n };\n\n /**\n * Gets the unstructured address field.\n * @type {String}\n */\n this.address = undefined;\n /**\n * Gets the phone number.\n * @type {String}\n */\n this.phoneNumber = undefined;\n /**\n * Gets the snippet.\n * @type {String}\n */\n this.snippet = undefined;\n /**\n * Gets the extended data, parsed into a JSON object.\n * Currently only the <code>Data</code> property is supported.\n * <code>SchemaData</code> and custom data are ignored.\n * @type {String}\n */\n this.extendedData = undefined;\n}\n\n// For testing\nKmlDataSource._DeferredLoading = DeferredLoading;\nKmlDataSource._getTimestamp = getTimestamp;\n\nexport default KmlDataSource;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * If element is a string, look up the element in the DOM by ID. Otherwise return element.\n *\n * @private\n *\n * @exception {DeveloperError} Element with id \"id\" does not exist in the document.\n */\nfunction getElement(element) {\n if (typeof element === \"string\") {\n const foundElement = document.getElementById(element);\n\n element = foundElement;\n }\n return element;\n}\nexport default getElement;\n", "/**\n * @alias KmlLookAt\n * @constructor\n *\n * @param {Cartesian3} position camera position\n * @param {HeadingPitchRange} headingPitchRange camera orientation\n */\nfunction KmlLookAt(position, headingPitchRange) {\n this.position = position;\n this.headingPitchRange = headingPitchRange;\n}\nexport default KmlLookAt;\n", "import defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\n/**\n * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to\n * guide the camera to a specified destinations on given time intervals.\n *\n * @alias KmlTour\n * @constructor\n *\n * @param {String} name name parsed from KML\n * @param {String} id id parsed from KML\n * @param {Array} playlist array with KmlTourFlyTos and KmlTourWaits\n *\n * @see KmlTourFlyTo\n * @see KmlTourWait\n *\n * @demo {@link https://sandcastle.cesium.com/?src=KML%20Tours.html|KML Tours}\n */\nfunction KmlTour(name, id) {\n /**\n * Id of kml gx:Tour entry\n * @type String\n */\n this.id = id;\n /**\n * Tour name\n * @type String\n */\n this.name = name;\n /**\n * Index of current entry from playlist\n * @type Number\n */\n this.playlistIndex = 0;\n /**\n * Array of playlist entries\n * @type Array\n */\n this.playlist = [];\n /**\n * Event will be called when tour starts to play,\n * before any playlist entry starts to play.\n * @type Event\n */\n this.tourStart = new Event();\n /**\n * Event will be called when all playlist entries are\n * played, or tour playback being canceled.\n *\n * If tour playback was terminated, event callback will\n * be called with terminated=true parameter.\n * @type Event\n */\n this.tourEnd = new Event();\n /**\n * Event will be called when entry from playlist starts to play.\n *\n * Event callback will be called with curent entry as first parameter.\n * @type Event\n */\n this.entryStart = new Event();\n /**\n * Event will be called when entry from playlist ends to play.\n *\n * Event callback will be called with following parameters:\n * 1. entry - entry\n * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}\n * @type Event\n */\n this.entryEnd = new Event();\n\n this._activeEntries = [];\n}\n\n/**\n * Add entry to this tour playlist.\n *\n * @param {KmlTourFlyTo|KmlTourWait} entry an entry to add to the playlist.\n */\nKmlTour.prototype.addPlaylistEntry = function (entry) {\n this.playlist.push(entry);\n};\n\n/**\n * Play this tour.\n *\n * @param {Viewer} viewer viewer widget.\n * @param {Object} [cameraOptions] these options will be merged with {@link Camera#flyTo}\n * options for FlyTo playlist entries.\n */\nKmlTour.prototype.play = function (viewer, cameraOptions) {\n this.tourStart.raiseEvent();\n\n const tour = this;\n playEntry.call(this, viewer, cameraOptions, function (terminated) {\n tour.playlistIndex = 0;\n // Stop nonblocking entries\n if (!terminated) {\n cancelAllEntries(tour._activeEntries);\n }\n tour.tourEnd.raiseEvent(terminated);\n });\n};\n\n/**\n * Stop curently playing tour.\n */\nKmlTour.prototype.stop = function () {\n cancelAllEntries(this._activeEntries);\n};\n\n// Stop all activeEntries.\nfunction cancelAllEntries(activeEntries) {\n for (\n let entry = activeEntries.pop();\n entry !== undefined;\n entry = activeEntries.pop()\n ) {\n entry.stop();\n }\n}\n\n// Play playlist entry.\n// This function is called recursevly with playNext and iterates over all entries from playlist.\nfunction playEntry(viewer, cameraOptions, allDone) {\n const entry = this.playlist[this.playlistIndex];\n if (entry) {\n const _playNext = playNext.bind(this, viewer, cameraOptions, allDone);\n this._activeEntries.push(entry);\n this.entryStart.raiseEvent(entry);\n if (entry.blocking) {\n entry.play(_playNext, viewer.scene.camera, cameraOptions);\n } else {\n const tour = this;\n entry.play(function () {\n tour.entryEnd.raiseEvent(entry);\n const indx = tour._activeEntries.indexOf(entry);\n if (indx >= 0) {\n tour._activeEntries.splice(indx, 1);\n }\n });\n _playNext(viewer, cameraOptions, allDone);\n }\n } else if (defined(allDone)) {\n allDone(false);\n }\n}\n\n// Increment playlistIndex and call playEntry if terminated isn't true.\nfunction playNext(viewer, cameraOptions, allDone, terminated) {\n const entry = this.playlist[this.playlistIndex];\n this.entryEnd.raiseEvent(entry, terminated);\n\n if (terminated) {\n allDone(terminated);\n } else {\n const indx = this._activeEntries.indexOf(entry);\n if (indx >= 0) {\n this._activeEntries.splice(indx, 1);\n }\n this.playlistIndex++;\n playEntry.call(this, viewer, cameraOptions, allDone);\n }\n}\nexport default KmlTour;\n", "/**\n * The Ease class provides a collection of easing functions for use with tween.js.\n */\nvar Easing = {\n Linear: {\n None: function (amount) {\n return amount;\n },\n },\n Quadratic: {\n In: function (amount) {\n return amount * amount;\n },\n Out: function (amount) {\n return amount * (2 - amount);\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount;\n }\n return -0.5 * (--amount * (amount - 2) - 1);\n },\n },\n Cubic: {\n In: function (amount) {\n return amount * amount * amount;\n },\n Out: function (amount) {\n return --amount * amount * amount + 1;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount;\n }\n return 0.5 * ((amount -= 2) * amount * amount + 2);\n },\n },\n Quartic: {\n In: function (amount) {\n return amount * amount * amount * amount;\n },\n Out: function (amount) {\n return 1 - --amount * amount * amount * amount;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount * amount;\n }\n return -0.5 * ((amount -= 2) * amount * amount * amount - 2);\n },\n },\n Quintic: {\n In: function (amount) {\n return amount * amount * amount * amount * amount;\n },\n Out: function (amount) {\n return --amount * amount * amount * amount * amount + 1;\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return 0.5 * amount * amount * amount * amount * amount;\n }\n return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);\n },\n },\n Sinusoidal: {\n In: function (amount) {\n return 1 - Math.cos((amount * Math.PI) / 2);\n },\n Out: function (amount) {\n return Math.sin((amount * Math.PI) / 2);\n },\n InOut: function (amount) {\n return 0.5 * (1 - Math.cos(Math.PI * amount));\n },\n },\n Exponential: {\n In: function (amount) {\n return amount === 0 ? 0 : Math.pow(1024, amount - 1);\n },\n Out: function (amount) {\n return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);\n },\n InOut: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n if ((amount *= 2) < 1) {\n return 0.5 * Math.pow(1024, amount - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);\n },\n },\n Circular: {\n In: function (amount) {\n return 1 - Math.sqrt(1 - amount * amount);\n },\n Out: function (amount) {\n return Math.sqrt(1 - --amount * amount);\n },\n InOut: function (amount) {\n if ((amount *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - amount * amount) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);\n },\n },\n Elastic: {\n In: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n },\n Out: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;\n },\n InOut: function (amount) {\n if (amount === 0) {\n return 0;\n }\n if (amount === 1) {\n return 1;\n }\n amount *= 2;\n if (amount < 1) {\n return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);\n }\n return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;\n },\n },\n Back: {\n In: function (amount) {\n var s = 1.70158;\n return amount * amount * ((s + 1) * amount - s);\n },\n Out: function (amount) {\n var s = 1.70158;\n return --amount * amount * ((s + 1) * amount + s) + 1;\n },\n InOut: function (amount) {\n var s = 1.70158 * 1.525;\n if ((amount *= 2) < 1) {\n return 0.5 * (amount * amount * ((s + 1) * amount - s));\n }\n return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);\n },\n },\n Bounce: {\n In: function (amount) {\n return 1 - Easing.Bounce.Out(1 - amount);\n },\n Out: function (amount) {\n if (amount < 1 / 2.75) {\n return 7.5625 * amount * amount;\n }\n else if (amount < 2 / 2.75) {\n return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;\n }\n else if (amount < 2.5 / 2.75) {\n return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;\n }\n else {\n return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;\n }\n },\n InOut: function (amount) {\n if (amount < 0.5) {\n return Easing.Bounce.In(amount * 2) * 0.5;\n }\n return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;\n },\n },\n};\n\nvar now;\n// Include a performance.now polyfill.\n// In node.js, use process.hrtime.\n// eslint-disable-next-line\n// @ts-ignore\nif (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {\n now = function () {\n // eslint-disable-next-line\n // @ts-ignore\n var time = process.hrtime();\n // Convert [seconds, nanoseconds] to milliseconds.\n return time[0] * 1000 + time[1] / 1000000;\n };\n}\n// In a browser, use self.performance.now if it is available.\nelse if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {\n // This must be bound, because directly assigning this function\n // leads to an invocation exception in Chrome.\n now = self.performance.now.bind(self.performance);\n}\n// Use Date.now if it is available.\nelse if (Date.now !== undefined) {\n now = Date.now;\n}\n// Otherwise, use 'new Date().getTime()'.\nelse {\n now = function () {\n return new Date().getTime();\n };\n}\nvar now$1 = now;\n\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tween\n */\nvar Group = /** @class */ (function () {\n function Group() {\n this._tweens = {};\n this._tweensAddedDuringUpdate = {};\n }\n Group.prototype.getAll = function () {\n var _this = this;\n return Object.keys(this._tweens).map(function (tweenId) {\n return _this._tweens[tweenId];\n });\n };\n Group.prototype.removeAll = function () {\n this._tweens = {};\n };\n Group.prototype.add = function (tween) {\n this._tweens[tween.getId()] = tween;\n this._tweensAddedDuringUpdate[tween.getId()] = tween;\n };\n Group.prototype.remove = function (tween) {\n delete this._tweens[tween.getId()];\n delete this._tweensAddedDuringUpdate[tween.getId()];\n };\n Group.prototype.update = function (time, preserve) {\n if (time === void 0) { time = now$1(); }\n if (preserve === void 0) { preserve = false; }\n var tweenIds = Object.keys(this._tweens);\n if (tweenIds.length === 0) {\n return false;\n }\n // Tweens are updated in \"batches\". If you add a new tween during an\n // update, then the new tween will be updated in the next batch.\n // If you remove a tween during an update, it may or may not be updated.\n // However, if the removed tween was added during the current batch,\n // then it will not be updated.\n while (tweenIds.length > 0) {\n this._tweensAddedDuringUpdate = {};\n for (var i = 0; i < tweenIds.length; i++) {\n var tween = this._tweens[tweenIds[i]];\n var autoStart = !preserve;\n if (tween && tween.update(time, autoStart) === false && !preserve) {\n delete this._tweens[tweenIds[i]];\n }\n }\n tweenIds = Object.keys(this._tweensAddedDuringUpdate);\n }\n return true;\n };\n return Group;\n}());\n\n/**\n *\n */\nvar Interpolation = {\n Linear: function (v, k) {\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n var fn = Interpolation.Utils.Linear;\n if (k < 0) {\n return fn(v[0], v[1], f);\n }\n if (k > 1) {\n return fn(v[m], v[m - 1], m - f);\n }\n return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n },\n Bezier: function (v, k) {\n var b = 0;\n var n = v.length - 1;\n var pw = Math.pow;\n var bn = Interpolation.Utils.Bernstein;\n for (var i = 0; i <= n; i++) {\n b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n }\n return b;\n },\n CatmullRom: function (v, k) {\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n var fn = Interpolation.Utils.CatmullRom;\n if (v[0] === v[m]) {\n if (k < 0) {\n i = Math.floor((f = m * (1 + k)));\n }\n return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n }\n else {\n if (k < 0) {\n return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n }\n if (k > 1) {\n return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n }\n return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n }\n },\n Utils: {\n Linear: function (p0, p1, t) {\n return (p1 - p0) * t + p0;\n },\n Bernstein: function (n, i) {\n var fc = Interpolation.Utils.Factorial;\n return fc(n) / fc(i) / fc(n - i);\n },\n Factorial: (function () {\n var a = [1];\n return function (n) {\n var s = 1;\n if (a[n]) {\n return a[n];\n }\n for (var i = n; i > 1; i--) {\n s *= i;\n }\n a[n] = s;\n return s;\n };\n })(),\n CatmullRom: function (p0, p1, p2, p3, t) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n var t2 = t * t;\n var t3 = t * t2;\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n },\n },\n};\n\n/**\n * Utils\n */\nvar Sequence = /** @class */ (function () {\n function Sequence() {\n }\n Sequence.nextId = function () {\n return Sequence._nextId++;\n };\n Sequence._nextId = 0;\n return Sequence;\n}());\n\nvar mainGroup = new Group();\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar Tween = /** @class */ (function () {\n function Tween(_object, _group) {\n if (_group === void 0) { _group = mainGroup; }\n this._object = _object;\n this._group = _group;\n this._isPaused = false;\n this._pauseStart = 0;\n this._valuesStart = {};\n this._valuesEnd = {};\n this._valuesStartRepeat = {};\n this._duration = 1000;\n this._initialRepeat = 0;\n this._repeat = 0;\n this._yoyo = false;\n this._isPlaying = false;\n this._reversed = false;\n this._delayTime = 0;\n this._startTime = 0;\n this._easingFunction = Easing.Linear.None;\n this._interpolationFunction = Interpolation.Linear;\n this._chainedTweens = [];\n this._onStartCallbackFired = false;\n this._id = Sequence.nextId();\n this._isChainStopped = false;\n this._goToEnd = false;\n }\n Tween.prototype.getId = function () {\n return this._id;\n };\n Tween.prototype.isPlaying = function () {\n return this._isPlaying;\n };\n Tween.prototype.isPaused = function () {\n return this._isPaused;\n };\n Tween.prototype.to = function (properties, duration) {\n // TODO? restore this, then update the 07_dynamic_to example to set fox\n // tween's to on each update. That way the behavior is opt-in (there's\n // currently no opt-out).\n // for (const prop in properties) this._valuesEnd[prop] = properties[prop]\n this._valuesEnd = Object.create(properties);\n if (duration !== undefined) {\n this._duration = duration;\n }\n return this;\n };\n Tween.prototype.duration = function (d) {\n this._duration = d;\n return this;\n };\n Tween.prototype.start = function (time) {\n if (this._isPlaying) {\n return this;\n }\n // eslint-disable-next-line\n this._group && this._group.add(this);\n this._repeat = this._initialRepeat;\n if (this._reversed) {\n // If we were reversed (f.e. using the yoyo feature) then we need to\n // flip the tween direction back to forward.\n this._reversed = false;\n for (var property in this._valuesStartRepeat) {\n this._swapEndStartRepeatValues(property);\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n }\n this._isPlaying = true;\n this._isPaused = false;\n this._onStartCallbackFired = false;\n this._isChainStopped = false;\n this._startTime = time !== undefined ? (typeof time === 'string' ? now$1() + parseFloat(time) : time) : now$1();\n this._startTime += this._delayTime;\n this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);\n return this;\n };\n Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {\n for (var property in _valuesEnd) {\n var startValue = _object[property];\n var startValueIsArray = Array.isArray(startValue);\n var propType = startValueIsArray ? 'array' : typeof startValue;\n var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);\n // If `to()` specifies a property that doesn't exist in the source object,\n // we should not set that property in the object\n if (propType === 'undefined' || propType === 'function') {\n continue;\n }\n // Check if an Array was provided as property value\n if (isInterpolationList) {\n var endValues = _valuesEnd[property];\n if (endValues.length === 0) {\n continue;\n }\n // handle an array of relative values\n endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));\n // Create a local copy of the Array with the start value at the front\n _valuesEnd[property] = [startValue].concat(endValues);\n }\n // handle the deepness of the values\n if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {\n _valuesStart[property] = startValueIsArray ? [] : {};\n // eslint-disable-next-line\n for (var prop in startValue) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStart[property][prop] = startValue[prop];\n }\n _valuesStartRepeat[property] = startValueIsArray ? [] : {}; // TODO? repeat nested values? And yoyo? And array values?\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);\n }\n else {\n // Save the starting value, but only once.\n if (typeof _valuesStart[property] === 'undefined') {\n _valuesStart[property] = startValue;\n }\n if (!startValueIsArray) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n }\n if (isInterpolationList) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();\n }\n else {\n _valuesStartRepeat[property] = _valuesStart[property] || 0;\n }\n }\n }\n };\n Tween.prototype.stop = function () {\n if (!this._isChainStopped) {\n this._isChainStopped = true;\n this.stopChainedTweens();\n }\n if (!this._isPlaying) {\n return this;\n }\n // eslint-disable-next-line\n this._group && this._group.remove(this);\n this._isPlaying = false;\n this._isPaused = false;\n if (this._onStopCallback) {\n this._onStopCallback(this._object);\n }\n return this;\n };\n Tween.prototype.end = function () {\n this._goToEnd = true;\n this.update(Infinity);\n return this;\n };\n Tween.prototype.pause = function (time) {\n if (time === void 0) { time = now$1(); }\n if (this._isPaused || !this._isPlaying) {\n return this;\n }\n this._isPaused = true;\n this._pauseStart = time;\n // eslint-disable-next-line\n this._group && this._group.remove(this);\n return this;\n };\n Tween.prototype.resume = function (time) {\n if (time === void 0) { time = now$1(); }\n if (!this._isPaused || !this._isPlaying) {\n return this;\n }\n this._isPaused = false;\n this._startTime += time - this._pauseStart;\n this._pauseStart = 0;\n // eslint-disable-next-line\n this._group && this._group.add(this);\n return this;\n };\n Tween.prototype.stopChainedTweens = function () {\n for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n this._chainedTweens[i].stop();\n }\n return this;\n };\n Tween.prototype.group = function (group) {\n this._group = group;\n return this;\n };\n Tween.prototype.delay = function (amount) {\n this._delayTime = amount;\n return this;\n };\n Tween.prototype.repeat = function (times) {\n this._initialRepeat = times;\n this._repeat = times;\n return this;\n };\n Tween.prototype.repeatDelay = function (amount) {\n this._repeatDelayTime = amount;\n return this;\n };\n Tween.prototype.yoyo = function (yoyo) {\n this._yoyo = yoyo;\n return this;\n };\n Tween.prototype.easing = function (easingFunction) {\n this._easingFunction = easingFunction;\n return this;\n };\n Tween.prototype.interpolation = function (interpolationFunction) {\n this._interpolationFunction = interpolationFunction;\n return this;\n };\n Tween.prototype.chain = function () {\n var tweens = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tweens[_i] = arguments[_i];\n }\n this._chainedTweens = tweens;\n return this;\n };\n Tween.prototype.onStart = function (callback) {\n this._onStartCallback = callback;\n return this;\n };\n Tween.prototype.onUpdate = function (callback) {\n this._onUpdateCallback = callback;\n return this;\n };\n Tween.prototype.onRepeat = function (callback) {\n this._onRepeatCallback = callback;\n return this;\n };\n Tween.prototype.onComplete = function (callback) {\n this._onCompleteCallback = callback;\n return this;\n };\n Tween.prototype.onStop = function (callback) {\n this._onStopCallback = callback;\n return this;\n };\n /**\n * @returns true if the tween is still playing after the update, false\n * otherwise (calling update on a paused tween still returns true because\n * it is still playing, just paused).\n */\n Tween.prototype.update = function (time, autoStart) {\n if (time === void 0) { time = now$1(); }\n if (autoStart === void 0) { autoStart = true; }\n if (this._isPaused)\n return true;\n var property;\n var elapsed;\n var endTime = this._startTime + this._duration;\n if (!this._goToEnd && !this._isPlaying) {\n if (time > endTime)\n return false;\n if (autoStart)\n this.start(time);\n }\n this._goToEnd = false;\n if (time < this._startTime) {\n return true;\n }\n if (this._onStartCallbackFired === false) {\n if (this._onStartCallback) {\n this._onStartCallback(this._object);\n }\n this._onStartCallbackFired = true;\n }\n elapsed = (time - this._startTime) / this._duration;\n elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;\n var value = this._easingFunction(elapsed);\n // properties transformations\n this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);\n if (this._onUpdateCallback) {\n this._onUpdateCallback(this._object, elapsed);\n }\n if (elapsed === 1) {\n if (this._repeat > 0) {\n if (isFinite(this._repeat)) {\n this._repeat--;\n }\n // Reassign starting values, restart by making startTime = now\n for (property in this._valuesStartRepeat) {\n if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {\n this._valuesStartRepeat[property] =\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);\n }\n if (this._yoyo) {\n this._swapEndStartRepeatValues(property);\n }\n this._valuesStart[property] = this._valuesStartRepeat[property];\n }\n if (this._yoyo) {\n this._reversed = !this._reversed;\n }\n if (this._repeatDelayTime !== undefined) {\n this._startTime = time + this._repeatDelayTime;\n }\n else {\n this._startTime = time + this._delayTime;\n }\n if (this._onRepeatCallback) {\n this._onRepeatCallback(this._object);\n }\n return true;\n }\n else {\n if (this._onCompleteCallback) {\n this._onCompleteCallback(this._object);\n }\n for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {\n // Make the chained tweens start exactly at the time they should,\n // even if the `update()` method was called way past the duration of the tween\n this._chainedTweens[i].start(this._startTime + this._duration);\n }\n this._isPlaying = false;\n return false;\n }\n }\n return true;\n };\n Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {\n for (var property in _valuesEnd) {\n // Don't update properties that do not exist in the source object\n if (_valuesStart[property] === undefined) {\n continue;\n }\n var start = _valuesStart[property] || 0;\n var end = _valuesEnd[property];\n var startIsArray = Array.isArray(_object[property]);\n var endIsArray = Array.isArray(end);\n var isInterpolationList = !startIsArray && endIsArray;\n if (isInterpolationList) {\n _object[property] = this._interpolationFunction(end, value);\n }\n else if (typeof end === 'object' && end) {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n this._updateProperties(_object[property], start, end, value);\n }\n else {\n // Parses relative end values with start as base (e.g.: +10, -3)\n end = this._handleRelativeValue(start, end);\n // Protect against non numeric properties.\n if (typeof end === 'number') {\n // eslint-disable-next-line\n // @ts-ignore FIXME?\n _object[property] = start + (end - start) * value;\n }\n }\n }\n };\n Tween.prototype._handleRelativeValue = function (start, end) {\n if (typeof end !== 'string') {\n return end;\n }\n if (end.charAt(0) === '+' || end.charAt(0) === '-') {\n return start + parseFloat(end);\n }\n else {\n return parseFloat(end);\n }\n };\n Tween.prototype._swapEndStartRepeatValues = function (property) {\n var tmp = this._valuesStartRepeat[property];\n var endValue = this._valuesEnd[property];\n if (typeof endValue === 'string') {\n this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);\n }\n else {\n this._valuesStartRepeat[property] = this._valuesEnd[property];\n }\n this._valuesEnd[property] = tmp;\n };\n return Tween;\n}());\n\nvar VERSION = '18.6.4';\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\nvar nextId = Sequence.nextId;\n/**\n * Controlling groups of tweens\n *\n * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.\n * In these cases, you may want to create your own smaller groups of tweens.\n */\nvar TWEEN = mainGroup;\n// This is the best way to export things in a way that's compatible with both ES\n// Modules and CommonJS, without build hacks, and so as not to break the\n// existing API.\n// https://github.com/rollup/rollup/issues/1961#issuecomment-423037881\nvar getAll = TWEEN.getAll.bind(TWEEN);\nvar removeAll = TWEEN.removeAll.bind(TWEEN);\nvar add = TWEEN.add.bind(TWEEN);\nvar remove = TWEEN.remove.bind(TWEEN);\nvar update = TWEEN.update.bind(TWEEN);\nvar exports = {\n Easing: Easing,\n Group: Group,\n Interpolation: Interpolation,\n now: now$1,\n Sequence: Sequence,\n nextId: nextId,\n Tween: Tween,\n VERSION: VERSION,\n getAll: getAll,\n removeAll: removeAll,\n add: add,\n remove: remove,\n update: update,\n};\n\nexport default exports;\nexport { Easing, Group, Interpolation, Sequence, Tween, VERSION, add, getAll, nextId, now$1 as now, remove, removeAll, update };\n", "import { Easing } from \"@tweenjs/tween.js\";\n\n/**\n * Easing functions for use with TweenCollection. These function are from\n * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the\n * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.\n *\n * @namespace\n */\nconst EasingFunction = {\n /**\n * Linear easing.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n LINEAR_NONE: Easing.Linear.None,\n\n /**\n * Quadratic in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUADRATIC_IN: Easing.Quadratic.In,\n /**\n * Quadratic out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUADRATIC_OUT: Easing.Quadratic.Out,\n /**\n * Quadratic in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUADRATIC_IN_OUT: Easing.Quadratic.InOut,\n\n /**\n * Cubic in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CUBIC_IN: Easing.Cubic.In,\n /**\n * Cubic out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CUBIC_OUT: Easing.Cubic.Out,\n /**\n * Cubic in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CUBIC_IN_OUT: Easing.Cubic.InOut,\n\n /**\n * Quartic in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUARTIC_IN: Easing.Quartic.In,\n /**\n * Quartic out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUARTIC_OUT: Easing.Quartic.Out,\n /**\n * Quartic in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUARTIC_IN_OUT: Easing.Quartic.InOut,\n\n /**\n * Quintic in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUINTIC_IN: Easing.Quintic.In,\n /**\n * Quintic out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUINTIC_OUT: Easing.Quintic.Out,\n /**\n * Quintic in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n QUINTIC_IN_OUT: Easing.Quintic.InOut,\n\n /**\n * Sinusoidal in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n SINUSOIDAL_IN: Easing.Sinusoidal.In,\n /**\n * Sinusoidal out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n SINUSOIDAL_OUT: Easing.Sinusoidal.Out,\n /**\n * Sinusoidal in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n SINUSOIDAL_IN_OUT: Easing.Sinusoidal.InOut,\n\n /**\n * Exponential in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n EXPONENTIAL_IN: Easing.Exponential.In,\n /**\n * Exponential out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n EXPONENTIAL_OUT: Easing.Exponential.Out,\n /**\n * Exponential in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n EXPONENTIAL_IN_OUT: Easing.Exponential.InOut,\n\n /**\n * Circular in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CIRCULAR_IN: Easing.Circular.In,\n /**\n * Circular out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CIRCULAR_OUT: Easing.Circular.Out,\n /**\n * Circular in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n CIRCULAR_IN_OUT: Easing.Circular.InOut,\n\n /**\n * Elastic in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n ELASTIC_IN: Easing.Elastic.In,\n /**\n * Elastic out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n ELASTIC_OUT: Easing.Elastic.Out,\n /**\n * Elastic in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n ELASTIC_IN_OUT: Easing.Elastic.InOut,\n\n /**\n * Back in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BACK_IN: Easing.Back.In,\n /**\n * Back out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BACK_OUT: Easing.Back.Out,\n /**\n * Back in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BACK_IN_OUT: Easing.Back.InOut,\n\n /**\n * Bounce in.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BOUNCE_IN: Easing.Bounce.In,\n /**\n * Bounce out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BOUNCE_OUT: Easing.Bounce.Out,\n /**\n * Bounce in then out.\n *\n * @type {EasingFunction.Callback}\n * @constant\n */\n BOUNCE_IN_OUT: Easing.Bounce.InOut,\n};\n\n/**\n * Function interface for implementing a custom easing function.\n * @callback EasingFunction.Callback\n * @param {Number} time The time in the range <code>[0, 1]</code>.\n * @returns {Number} The value of the function at the given time.\n *\n * @example\n * function quadraticIn(time) {\n * return time * time;\n * }\n *\n * @example\n * function quadraticOut(time) {\n * return time * (2.0 - time);\n * }\n */\n\nexport default Object.freeze(EasingFunction);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport combine from \"../Core/combine.js\";\nimport defined from \"../Core/defined.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\n/**\n * Transitions the KmlTour to the next destination. This transition is facilitated\n * using a specified flyToMode over a given number of seconds.\n *\n * @alias KmlTourFlyTo\n * @constructor\n *\n * @param {Number} duration entry duration\n * @param {String} flyToMode KML fly to mode: bounce, smooth, etc\n * @param {KmlCamera|KmlLookAt} view KmlCamera or KmlLookAt\n *\n * @see KmlTour\n * @see KmlTourWait\n */\nfunction KmlTourFlyTo(duration, flyToMode, view) {\n this.type = \"KmlTourFlyTo\";\n this.blocking = true;\n this.activeCamera = null;\n this.activeCallback = null;\n\n this.duration = duration;\n this.view = view;\n this.flyToMode = flyToMode;\n}\n\n/**\n * Play this playlist entry\n *\n * @param {KmlTourFlyTo.DoneCallback} done function which will be called when playback ends\n * @param {Camera} camera Cesium camera\n * @param {Object} [cameraOptions] which will be merged with camera flyTo options. See {@link Camera#flyTo}\n */\nKmlTourFlyTo.prototype.play = function (done, camera, cameraOptions) {\n this.activeCamera = camera;\n if (defined(done) && done !== null) {\n const self = this;\n this.activeCallback = function (terminated) {\n delete self.activeCallback;\n delete self.activeCamera;\n done(defined(terminated) ? false : terminated);\n };\n }\n\n const options = this.getCameraOptions(cameraOptions);\n if (this.view.headingPitchRoll) {\n camera.flyTo(options);\n } else if (this.view.headingPitchRange) {\n const target = new BoundingSphere(this.view.position);\n camera.flyToBoundingSphere(target, options);\n }\n};\n\n/**\n * Stop execution of curent entry. Cancel camera flyTo\n */\nKmlTourFlyTo.prototype.stop = function () {\n if (defined(this.activeCamera)) {\n this.activeCamera.cancelFlight();\n }\n if (defined(this.activeCallback)) {\n this.activeCallback(true);\n }\n};\n\n/**\n * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}\n * depends on this.view type.\n *\n * @param {Object} cameraOptions options to merge with generated. See {@link Camera#flyTo}\n * @returns {Object} {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options\n */\nKmlTourFlyTo.prototype.getCameraOptions = function (cameraOptions) {\n let options = {\n duration: this.duration,\n };\n\n if (defined(this.activeCallback)) {\n options.complete = this.activeCallback;\n }\n\n if (this.flyToMode === \"smooth\") {\n options.easingFunction = EasingFunction.LINEAR_NONE;\n }\n\n if (this.view.headingPitchRoll) {\n options.destination = this.view.position;\n options.orientation = this.view.headingPitchRoll;\n } else if (this.view.headingPitchRange) {\n options.offset = this.view.headingPitchRange;\n }\n\n if (defined(cameraOptions)) {\n options = combine(options, cameraOptions);\n }\n return options;\n};\n\n/**\n * A function that will be executed when the flight completes.\n * @callback KmlTourFlyTo.DoneCallback\n *\n * @param {Boolean} terminated true if {@link KmlTourFlyTo#stop} was\n * called before entry done playback.\n */\nexport default KmlTourFlyTo;\n", "import defined from \"../Core/defined.js\";\n/**\n * Pauses the KmlTour for a given number of seconds.\n *\n * @alias KmlTourWait\n * @constructor\n *\n * @param {Number} duration entry duration\n *\n * @see KmlTour\n * @see KmlTourFlyTo\n */\nfunction KmlTourWait(duration) {\n this.type = \"KmlTourWait\";\n this.blocking = true;\n this.duration = duration;\n\n this.timeout = null;\n}\n\n/**\n * Play this playlist entry\n *\n * @param {KmlTourWait.DoneCallback} done function which will be called when playback ends\n */\nKmlTourWait.prototype.play = function (done) {\n const self = this;\n this.activeCallback = done;\n this.timeout = setTimeout(function () {\n delete self.activeCallback;\n done(false);\n }, this.duration * 1000);\n};\n\n/**\n * Stop execution of curent entry, cancel curent timeout\n */\nKmlTourWait.prototype.stop = function () {\n clearTimeout(this.timeout);\n if (defined(this.activeCallback)) {\n this.activeCallback(true);\n }\n};\n\n/**\n * A function which will be called when playback ends.\n *\n * @callback KmlTourWait.DoneCallback\n * @param {Boolean} terminated true if {@link KmlTourWait#stop} was\n * called before entry done playback.\n */\nexport default KmlTourWait;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines the interface for visualizers. Visualizers are plug-ins to\n * {@link DataSourceDisplay} that render data associated with\n * {@link DataSource} instances.\n * This object is an interface for documentation purposes and is not intended\n * to be instantiated directly.\n * @alias Visualizer\n * @constructor\n *\n * @see BillboardVisualizer\n * @see LabelVisualizer\n * @see ModelVisualizer\n * @see PathVisualizer\n * @see PointVisualizer\n * @see GeometryVisualizer\n */\nfunction Visualizer() {\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Updates the visualization to the provided time.\n * @function\n *\n * @param {JulianDate} time The time.\n *\n * @returns {Boolean} True if the display was updated to the provided time,\n * false if the visualizer is waiting for an asynchronous operation to\n * complete before data can be updated.\n */\nVisualizer.prototype.update = DeveloperError.throwInstantiationError;\n\n/**\n * Computes a bounding sphere which encloses the visualization produced for the specified entity.\n * The bounding sphere is in the fixed frame of the scene's globe.\n *\n * @param {Entity} entity The entity whose bounding sphere to compute.\n * @param {BoundingSphere} result The bounding sphere onto which to store the result.\n * @returns {BoundingSphereState} BoundingSphereState.DONE if the result contains the bounding sphere,\n * BoundingSphereState.PENDING if the result is still being computed, or\n * BoundingSphereState.FAILED if the entity has no visualization in the current scene.\n * @private\n */\nVisualizer.prototype.getBoundingSphere = DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * @function\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nVisualizer.prototype.isDestroyed = DeveloperError.throwInstantiationError;\n\n/**\n * Removes all visualization and cleans up any resources associated with this instance.\n * @function\n */\nVisualizer.prototype.destroy = DeveloperError.throwInstantiationError;\nexport default Visualizer;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 position;\\n\\\nattribute vec2 textureCoordinates;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_Position = position;\\n\\\nv_textureCoordinates = textureCoordinates;\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport ViewportQuadVS from \"../Shaders/ViewportQuadVS.js\";\nimport ClearCommand from \"./ClearCommand.js\";\nimport DrawCommand from \"./DrawCommand.js\";\nimport Framebuffer from \"./Framebuffer.js\";\nimport RenderState from \"./RenderState.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\n\n/**\n * @private\n */\nfunction ComputeEngine(context) {\n this._context = context;\n}\n\nlet renderStateScratch;\nconst drawCommandScratch = new DrawCommand({\n primitiveType: PrimitiveType.TRIANGLES,\n});\nconst clearCommandScratch = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n});\n\nfunction createFramebuffer(context, outputTexture) {\n return new Framebuffer({\n context: context,\n colorTextures: [outputTexture],\n destroyAttachments: false,\n });\n}\n\nfunction createViewportQuadShader(context, fragmentShaderSource) {\n return ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: ViewportQuadVS,\n fragmentShaderSource: fragmentShaderSource,\n attributeLocations: {\n position: 0,\n textureCoordinates: 1,\n },\n });\n}\n\nfunction createRenderState(width, height) {\n if (\n !defined(renderStateScratch) ||\n renderStateScratch.viewport.width !== width ||\n renderStateScratch.viewport.height !== height\n ) {\n renderStateScratch = RenderState.fromCache({\n viewport: new BoundingRectangle(0, 0, width, height),\n });\n }\n return renderStateScratch;\n}\n\nComputeEngine.prototype.execute = function (computeCommand) {\n // This may modify the command's resources, so do error checking afterwards\n if (defined(computeCommand.preExecute)) {\n computeCommand.preExecute(computeCommand);\n }\n\n const outputTexture = computeCommand.outputTexture;\n const width = outputTexture.width;\n const height = outputTexture.height;\n\n const context = this._context;\n const vertexArray = defined(computeCommand.vertexArray)\n ? computeCommand.vertexArray\n : context.getViewportQuadVertexArray();\n const shaderProgram = defined(computeCommand.shaderProgram)\n ? computeCommand.shaderProgram\n : createViewportQuadShader(context, computeCommand.fragmentShaderSource);\n const framebuffer = createFramebuffer(context, outputTexture);\n const renderState = createRenderState(width, height);\n const uniformMap = computeCommand.uniformMap;\n\n const clearCommand = clearCommandScratch;\n clearCommand.framebuffer = framebuffer;\n clearCommand.renderState = renderState;\n clearCommand.execute(context);\n\n const drawCommand = drawCommandScratch;\n drawCommand.vertexArray = vertexArray;\n drawCommand.renderState = renderState;\n drawCommand.shaderProgram = shaderProgram;\n drawCommand.uniformMap = uniformMap;\n drawCommand.framebuffer = framebuffer;\n drawCommand.execute(context);\n\n framebuffer.destroy();\n\n if (!computeCommand.persists) {\n shaderProgram.destroy();\n if (defined(computeCommand.vertexArray)) {\n vertexArray.destroy();\n }\n }\n\n if (defined(computeCommand.postExecute)) {\n computeCommand.postExecute(outputTexture);\n }\n};\n\nComputeEngine.prototype.isDestroyed = function () {\n return false;\n};\n\nComputeEngine.prototype.destroy = function () {\n return destroyObject(this);\n};\nexport default ComputeEngine;\n", "/**\n * The state for a particular rendering pass. This is used to supplement the state\n * in a command being executed.\n *\n * @private\n * @constructor\n */\nfunction PassState(context) {\n /**\n * The context used to execute commands for this pass.\n *\n * @type {Context}\n */\n this.context = context;\n\n /**\n * The framebuffer to render to. This framebuffer is used unless a {@link DrawCommand}\n * or {@link ClearCommand} explicitly define a framebuffer, which is used for off-screen\n * rendering.\n *\n * @type {Framebuffer}\n * @default undefined\n */\n this.framebuffer = undefined;\n\n /**\n * When defined, this overrides the blending property of a {@link DrawCommand}'s render state.\n * This is used to, for example, to allow the renderer to turn off blending during the picking pass.\n * <p>\n * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.\n * </p>\n *\n * @type {Boolean}\n * @default undefined\n */\n this.blendingEnabled = undefined;\n\n /**\n * When defined, this overrides the scissor test property of a {@link DrawCommand}'s render state.\n * This is used to, for example, to allow the renderer to scissor out the pick region during the picking pass.\n * <p>\n * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.\n * </p>\n *\n * @type {Object}\n * @default undefined\n */\n this.scissorTest = undefined;\n\n /**\n * The viewport used when one is not defined by a {@link DrawCommand}'s render state.\n * @type {BoundingRectangle}\n * @default undefined\n */\n this.viewport = undefined;\n}\nexport default PassState;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport ShaderSource from \"./ShaderSource.js\";\n\n/**\n * @private\n */\nfunction ShaderCache(context) {\n this._context = context;\n this._shaders = {};\n this._numberOfShaders = 0;\n this._shadersToRelease = {};\n}\n\nObject.defineProperties(ShaderCache.prototype, {\n numberOfShaders: {\n get: function () {\n return this._numberOfShaders;\n },\n },\n});\n\n/**\n * Returns a shader program from the cache, or creates and caches a new shader program,\n * given the GLSL vertex and fragment shader source and attribute locations.\n * <p>\n * The difference between this and {@link ShaderCache#getShaderProgram}, is this is used to\n * replace an existing reference to a shader program, which is passed as the first argument.\n * </p>\n *\n * @param {Object} options Object with the following properties:\n * @param {ShaderProgram} [options.shaderProgram] The shader program that is being reassigned.\n * @param {String|ShaderSource} options.vertexShaderSource The GLSL source for the vertex shader.\n * @param {String|ShaderSource} options.fragmentShaderSource The GLSL source for the fragment shader.\n * @param {Object} options.attributeLocations Indices for the attribute inputs to the vertex shader.\n\n * @returns {ShaderProgram} The cached or newly created shader program.\n *\n *\n * @example\n * this._shaderProgram = context.shaderCache.replaceShaderProgram({\n * shaderProgram : this._shaderProgram,\n * vertexShaderSource : vs,\n * fragmentShaderSource : fs,\n * attributeLocations : attributeLocations\n * });\n *\n * @see ShaderCache#getShaderProgram\n */\nShaderCache.prototype.replaceShaderProgram = function (options) {\n if (defined(options.shaderProgram)) {\n options.shaderProgram.destroy();\n }\n\n return this.getShaderProgram(options);\n};\n\nfunction toSortedJson(dictionary) {\n const sortedKeys = Object.keys(dictionary).sort();\n return JSON.stringify(dictionary, sortedKeys);\n}\n\n/**\n * Returns a shader program from the cache, or creates and caches a new shader program,\n * given the GLSL vertex and fragment shader source and attribute locations.\n *\n * @param {Object} options Object with the following properties:\n * @param {String|ShaderSource} options.vertexShaderSource The GLSL source for the vertex shader.\n * @param {String|ShaderSource} options.fragmentShaderSource The GLSL source for the fragment shader.\n * @param {Object} options.attributeLocations Indices for the attribute inputs to the vertex shader.\n *\n * @returns {ShaderProgram} The cached or newly created shader program.\n */\nShaderCache.prototype.getShaderProgram = function (options) {\n // convert shaders which are provided as strings into ShaderSource objects\n // because ShaderSource handles all the automatic including of built-in functions, etc.\n\n let vertexShaderSource = options.vertexShaderSource;\n let fragmentShaderSource = options.fragmentShaderSource;\n const attributeLocations = options.attributeLocations;\n\n if (typeof vertexShaderSource === \"string\") {\n vertexShaderSource = new ShaderSource({\n sources: [vertexShaderSource],\n });\n }\n\n if (typeof fragmentShaderSource === \"string\") {\n fragmentShaderSource = new ShaderSource({\n sources: [fragmentShaderSource],\n });\n }\n\n // Since ShaderSource.createCombinedXxxShader() can be expensive, use a\n // simpler key for caching. This way, the function does not have to be called\n // for each cache lookup.\n const vertexShaderKey = vertexShaderSource.getCacheKey();\n const fragmentShaderKey = fragmentShaderSource.getCacheKey();\n // Sort the keys in the JSON to ensure a consistent order\n const attributeLocationKey = defined(attributeLocations)\n ? toSortedJson(attributeLocations)\n : \"\";\n const keyword = `${vertexShaderKey}:${fragmentShaderKey}:${attributeLocationKey}`;\n\n let cachedShader;\n if (defined(this._shaders[keyword])) {\n cachedShader = this._shaders[keyword];\n\n // No longer want to release this if it was previously released.\n delete this._shadersToRelease[keyword];\n } else {\n const context = this._context;\n\n const vertexShaderText = vertexShaderSource.createCombinedVertexShader(\n context\n );\n const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(\n context\n );\n\n const shaderProgram = new ShaderProgram({\n gl: context._gl,\n logShaderCompilation: context.logShaderCompilation,\n debugShaders: context.debugShaders,\n vertexShaderSource: vertexShaderSource,\n vertexShaderText: vertexShaderText,\n fragmentShaderSource: fragmentShaderSource,\n fragmentShaderText: fragmentShaderText,\n attributeLocations: attributeLocations,\n });\n\n cachedShader = {\n cache: this,\n shaderProgram: shaderProgram,\n keyword: keyword,\n derivedKeywords: [],\n count: 0,\n };\n\n // A shader can't be in more than one cache.\n shaderProgram._cachedShader = cachedShader;\n this._shaders[keyword] = cachedShader;\n ++this._numberOfShaders;\n }\n\n ++cachedShader.count;\n return cachedShader.shaderProgram;\n};\n\nShaderCache.prototype.replaceDerivedShaderProgram = function (\n shaderProgram,\n keyword,\n options\n) {\n const cachedShader = shaderProgram._cachedShader;\n const derivedKeyword = keyword + cachedShader.keyword;\n const cachedDerivedShader = this._shaders[derivedKeyword];\n if (defined(cachedDerivedShader)) {\n destroyShader(this, cachedDerivedShader);\n const index = cachedShader.derivedKeywords.indexOf(keyword);\n if (index > -1) {\n cachedShader.derivedKeywords.splice(index, 1);\n }\n }\n\n return this.createDerivedShaderProgram(shaderProgram, keyword, options);\n};\n\nShaderCache.prototype.getDerivedShaderProgram = function (\n shaderProgram,\n keyword\n) {\n const cachedShader = shaderProgram._cachedShader;\n const derivedKeyword = keyword + cachedShader.keyword;\n const cachedDerivedShader = this._shaders[derivedKeyword];\n if (!defined(cachedDerivedShader)) {\n return undefined;\n }\n\n return cachedDerivedShader.shaderProgram;\n};\n\nShaderCache.prototype.createDerivedShaderProgram = function (\n shaderProgram,\n keyword,\n options\n) {\n const cachedShader = shaderProgram._cachedShader;\n const derivedKeyword = keyword + cachedShader.keyword;\n\n let vertexShaderSource = options.vertexShaderSource;\n let fragmentShaderSource = options.fragmentShaderSource;\n const attributeLocations = options.attributeLocations;\n\n if (typeof vertexShaderSource === \"string\") {\n vertexShaderSource = new ShaderSource({\n sources: [vertexShaderSource],\n });\n }\n\n if (typeof fragmentShaderSource === \"string\") {\n fragmentShaderSource = new ShaderSource({\n sources: [fragmentShaderSource],\n });\n }\n\n const context = this._context;\n\n const vertexShaderText = vertexShaderSource.createCombinedVertexShader(\n context\n );\n const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(\n context\n );\n\n const derivedShaderProgram = new ShaderProgram({\n gl: context._gl,\n logShaderCompilation: context.logShaderCompilation,\n debugShaders: context.debugShaders,\n vertexShaderSource: vertexShaderSource,\n vertexShaderText: vertexShaderText,\n fragmentShaderSource: fragmentShaderSource,\n fragmentShaderText: fragmentShaderText,\n attributeLocations: attributeLocations,\n });\n\n const derivedCachedShader = {\n cache: this,\n shaderProgram: derivedShaderProgram,\n keyword: derivedKeyword,\n derivedKeywords: [],\n count: 0,\n };\n\n cachedShader.derivedKeywords.push(keyword);\n derivedShaderProgram._cachedShader = derivedCachedShader;\n this._shaders[derivedKeyword] = derivedCachedShader;\n return derivedShaderProgram;\n};\n\nfunction destroyShader(cache, cachedShader) {\n const derivedKeywords = cachedShader.derivedKeywords;\n const length = derivedKeywords.length;\n for (let i = 0; i < length; ++i) {\n const keyword = derivedKeywords[i] + cachedShader.keyword;\n const derivedCachedShader = cache._shaders[keyword];\n destroyShader(cache, derivedCachedShader);\n }\n\n delete cache._shaders[cachedShader.keyword];\n cachedShader.shaderProgram.finalDestroy();\n}\n\nShaderCache.prototype.destroyReleasedShaderPrograms = function () {\n const shadersToRelease = this._shadersToRelease;\n\n for (const keyword in shadersToRelease) {\n if (shadersToRelease.hasOwnProperty(keyword)) {\n const cachedShader = shadersToRelease[keyword];\n destroyShader(this, cachedShader);\n --this._numberOfShaders;\n }\n }\n\n this._shadersToRelease = {};\n};\n\nShaderCache.prototype.releaseShaderProgram = function (shaderProgram) {\n if (defined(shaderProgram)) {\n const cachedShader = shaderProgram._cachedShader;\n if (cachedShader && --cachedShader.count === 0) {\n this._shadersToRelease[cachedShader.keyword] = cachedShader;\n }\n }\n};\n\nShaderCache.prototype.isDestroyed = function () {\n return false;\n};\n\nShaderCache.prototype.destroy = function () {\n const shaders = this._shaders;\n for (const keyword in shaders) {\n if (shaders.hasOwnProperty(keyword)) {\n shaders[keyword].shaderProgram.finalDestroy();\n }\n }\n return destroyObject(this);\n};\nexport default ShaderCache;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * @private\n */\nfunction TextureCache() {\n this._textures = {};\n this._numberOfTextures = 0;\n this._texturesToRelease = {};\n}\n\nObject.defineProperties(TextureCache.prototype, {\n numberOfTextures: {\n get: function () {\n return this._numberOfTextures;\n },\n },\n});\n\nTextureCache.prototype.getTexture = function (keyword) {\n const cachedTexture = this._textures[keyword];\n if (!defined(cachedTexture)) {\n return undefined;\n }\n\n // No longer want to release this if it was previously released.\n delete this._texturesToRelease[keyword];\n\n ++cachedTexture.count;\n return cachedTexture.texture;\n};\n\nTextureCache.prototype.addTexture = function (keyword, texture) {\n const cachedTexture = {\n texture: texture,\n count: 1,\n };\n\n texture.finalDestroy = texture.destroy;\n\n const that = this;\n texture.destroy = function () {\n if (--cachedTexture.count === 0) {\n that._texturesToRelease[keyword] = cachedTexture;\n }\n };\n\n this._textures[keyword] = cachedTexture;\n ++this._numberOfTextures;\n};\n\nTextureCache.prototype.destroyReleasedTextures = function () {\n const texturesToRelease = this._texturesToRelease;\n\n for (const keyword in texturesToRelease) {\n if (texturesToRelease.hasOwnProperty(keyword)) {\n const cachedTexture = texturesToRelease[keyword];\n delete this._textures[keyword];\n cachedTexture.texture.finalDestroy();\n --this._numberOfTextures;\n }\n }\n\n this._texturesToRelease = {};\n};\n\nTextureCache.prototype.isDestroyed = function () {\n return false;\n};\n\nTextureCache.prototype.destroy = function () {\n const textures = this._textures;\n for (const keyword in textures) {\n if (textures.hasOwnProperty(keyword)) {\n textures[keyword].texture.finalDestroy();\n }\n }\n return destroyObject(this);\n};\nexport default TextureCache;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport TimeConstants from \"./TimeConstants.js\";\nimport TimeStandard from \"./TimeStandard.js\";\n\n/**\n * Contains functions for finding the Cartesian coordinates of the sun and the moon in the\n * Earth-centered inertial frame.\n *\n * @namespace Simon1994PlanetaryPositions\n */\nconst Simon1994PlanetaryPositions = {};\n\nfunction computeTdbMinusTtSpice(daysSinceJ2000InTerrestrialTime) {\n /* STK Comments ------------------------------------------------------\n * This function uses constants designed to be consistent with\n * the SPICE Toolkit from JPL version N0051 (unitim.c)\n * M0 = 6.239996\n * M0Dot = 1.99096871e-7 rad/s = 0.01720197 rad/d\n * EARTH_ECC = 1.671e-2\n * TDB_AMPL = 1.657e-3 secs\n *--------------------------------------------------------------------*/\n\n //* Values taken as specified in STK Comments except: 0.01720197 rad/day = 1.99096871e-7 rad/sec\n //* Here we use the more precise value taken from the SPICE value 1.99096871e-7 rad/sec converted to rad/day\n //* All other constants are consistent with the SPICE implementation of the TDB conversion\n //* except where we treat the independent time parameter to be in TT instead of TDB.\n //* This is an approximation made to facilitate performance due to the higher prevalance of\n //* the TT2TDB conversion over TDB2TT in order to avoid having to iterate when converting to TDB for the JPL ephemeris.\n //* Days are used instead of seconds to provide a slight improvement in numerical precision.\n\n //* For more information see:\n //* http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html#TDB\n //* ftp://ssd.jpl.nasa.gov/pub/eph/planets/ioms/ExplSupplChap8.pdf\n\n const g = 6.239996 + 0.0172019696544 * daysSinceJ2000InTerrestrialTime;\n return 1.657e-3 * Math.sin(g + 1.671e-2 * Math.sin(g));\n}\n\nconst TdtMinusTai = 32.184;\nconst J2000d = 2451545;\nfunction taiToTdb(date, result) {\n //Converts TAI to TT\n result = JulianDate.addSeconds(date, TdtMinusTai, result);\n\n //Converts TT to TDB\n const days = JulianDate.totalDays(result) - J2000d;\n result = JulianDate.addSeconds(result, computeTdbMinusTtSpice(days), result);\n\n return result;\n}\n\nconst epoch = new JulianDate(2451545, 0, TimeStandard.TAI); //Actually TDB (not TAI)\nconst MetersPerKilometer = 1000.0;\nconst RadiansPerDegree = CesiumMath.RADIANS_PER_DEGREE;\nconst RadiansPerArcSecond = CesiumMath.RADIANS_PER_ARCSECOND;\nconst MetersPerAstronomicalUnit = 1.4959787e11; // IAU 1976 value\n\nconst perifocalToEquatorial = new Matrix3();\nfunction elementsToCartesian(\n semimajorAxis,\n eccentricity,\n inclination,\n longitudeOfPerigee,\n longitudeOfNode,\n meanLongitude,\n result\n) {\n if (inclination < 0.0) {\n inclination = -inclination;\n longitudeOfNode += CesiumMath.PI;\n }\n\nconst radiusOfPeriapsis = semimajorAxis * (1.0 - eccentricity);\n const argumentOfPeriapsis = longitudeOfPerigee - longitudeOfNode;\n const rightAscensionOfAscendingNode = longitudeOfNode;\n const trueAnomaly = meanAnomalyToTrueAnomaly(\n meanLongitude - longitudeOfPerigee,\n eccentricity\n );\n const type = chooseOrbit(eccentricity, 0.0);\n\nperifocalToCartesianMatrix(\n argumentOfPeriapsis,\n inclination,\n rightAscensionOfAscendingNode,\n perifocalToEquatorial\n );\n const semilatus = radiusOfPeriapsis * (1.0 + eccentricity);\n const costheta = Math.cos(trueAnomaly);\n const sintheta = Math.sin(trueAnomaly);\n\n const denom = 1.0 + eccentricity * costheta;\n\nconst radius = semilatus / denom;\n if (!defined(result)) {\n result = new Cartesian3(radius * costheta, radius * sintheta, 0.0);\n } else {\n result.x = radius * costheta;\n result.y = radius * sintheta;\n result.z = 0.0;\n }\n\n return Matrix3.multiplyByVector(perifocalToEquatorial, result, result);\n}\n\nfunction chooseOrbit(eccentricity, tolerance) {\nif (eccentricity <= tolerance) {\n return \"Circular\";\n } else if (eccentricity < 1.0 - tolerance) {\n return \"Elliptical\";\n } else if (eccentricity <= 1.0 + tolerance) {\n return \"Parabolic\";\n }\n return \"Hyperbolic\";\n}\n\n// Calculates the true anomaly given the mean anomaly and the eccentricity.\nfunction meanAnomalyToTrueAnomaly(meanAnomaly, eccentricity) {\nconst eccentricAnomaly = meanAnomalyToEccentricAnomaly(\n meanAnomaly,\n eccentricity\n );\n return eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity);\n}\n\nconst maxIterationCount = 50;\nconst keplerEqConvergence = CesiumMath.EPSILON8;\n// Calculates the eccentric anomaly given the mean anomaly and the eccentricity.\nfunction meanAnomalyToEccentricAnomaly(meanAnomaly, eccentricity) {\nconst revs = Math.floor(meanAnomaly / CesiumMath.TWO_PI);\n\n // Find angle in current revolution\n meanAnomaly -= revs * CesiumMath.TWO_PI;\n\n // calculate starting value for iteration sequence\n let iterationValue =\n meanAnomaly +\n (eccentricity * Math.sin(meanAnomaly)) /\n (1.0 - Math.sin(meanAnomaly + eccentricity) + Math.sin(meanAnomaly));\n\n // Perform Newton-Raphson iteration on Kepler's equation\n let eccentricAnomaly = Number.MAX_VALUE;\n\n let count;\n for (\n count = 0;\n count < maxIterationCount &&\n Math.abs(eccentricAnomaly - iterationValue) > keplerEqConvergence;\n ++count\n ) {\n eccentricAnomaly = iterationValue;\n const NRfunction =\n eccentricAnomaly -\n eccentricity * Math.sin(eccentricAnomaly) -\n meanAnomaly;\n const dNRfunction = 1 - eccentricity * Math.cos(eccentricAnomaly);\n iterationValue = eccentricAnomaly - NRfunction / dNRfunction;\n }\n\neccentricAnomaly = iterationValue + revs * CesiumMath.TWO_PI;\n return eccentricAnomaly;\n}\n\n// Calculates the true anomaly given the eccentric anomaly and the eccentricity.\nfunction eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity) {\n// Calculate the number of previous revolutions\n const revs = Math.floor(eccentricAnomaly / CesiumMath.TWO_PI);\n\n // Find angle in current revolution\n eccentricAnomaly -= revs * CesiumMath.TWO_PI;\n\n // Calculate true anomaly from eccentric anomaly\n const trueAnomalyX = Math.cos(eccentricAnomaly) - eccentricity;\n const trueAnomalyY =\n Math.sin(eccentricAnomaly) * Math.sqrt(1 - eccentricity * eccentricity);\n\n let trueAnomaly = Math.atan2(trueAnomalyY, trueAnomalyX);\n\n // Ensure the correct quadrant\n trueAnomaly = CesiumMath.zeroToTwoPi(trueAnomaly);\n if (eccentricAnomaly < 0) {\n trueAnomaly -= CesiumMath.TWO_PI;\n }\n\n // Add on previous revolutions\n trueAnomaly += revs * CesiumMath.TWO_PI;\n\n return trueAnomaly;\n}\n\n// Calculates the transformation matrix to convert from the perifocal (PQW) coordinate\n// system to inertial cartesian coordinates.\nfunction perifocalToCartesianMatrix(\n argumentOfPeriapsis,\n inclination,\n rightAscension,\n result\n) {\nconst cosap = Math.cos(argumentOfPeriapsis);\n const sinap = Math.sin(argumentOfPeriapsis);\n\n const cosi = Math.cos(inclination);\n const sini = Math.sin(inclination);\n\n const cosraan = Math.cos(rightAscension);\n const sinraan = Math.sin(rightAscension);\n if (!defined(result)) {\n result = new Matrix3(\n cosraan * cosap - sinraan * sinap * cosi,\n -cosraan * sinap - sinraan * cosap * cosi,\n sinraan * sini,\n\n sinraan * cosap + cosraan * sinap * cosi,\n -sinraan * sinap + cosraan * cosap * cosi,\n -cosraan * sini,\n\n sinap * sini,\n cosap * sini,\n cosi\n );\n } else {\n result[0] = cosraan * cosap - sinraan * sinap * cosi;\n result[1] = sinraan * cosap + cosraan * sinap * cosi;\n result[2] = sinap * sini;\n result[3] = -cosraan * sinap - sinraan * cosap * cosi;\n result[4] = -sinraan * sinap + cosraan * cosap * cosi;\n result[5] = cosap * sini;\n result[6] = sinraan * sini;\n result[7] = -cosraan * sini;\n result[8] = cosi;\n }\n return result;\n}\n\n// From section 5.8\nconst semiMajorAxis0 = 1.0000010178 * MetersPerAstronomicalUnit;\nconst meanLongitude0 = 100.46645683 * RadiansPerDegree;\nconst meanLongitude1 = 1295977422.83429 * RadiansPerArcSecond;\n\n// From table 6\nconst p1u = 16002;\nconst p2u = 21863;\nconst p3u = 32004;\nconst p4u = 10931;\nconst p5u = 14529;\nconst p6u = 16368;\nconst p7u = 15318;\nconst p8u = 32794;\n\nconst Ca1 = 64 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca2 = -152 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca3 = 62 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca4 = -8 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca5 = 32 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca6 = -41 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca7 = 19 * 1e-7 * MetersPerAstronomicalUnit;\nconst Ca8 = -11 * 1e-7 * MetersPerAstronomicalUnit;\n\nconst Sa1 = -150 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa2 = -46 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa3 = 68 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa4 = 54 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa5 = 14 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa6 = 24 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa7 = -28 * 1e-7 * MetersPerAstronomicalUnit;\nconst Sa8 = 22 * 1e-7 * MetersPerAstronomicalUnit;\n\nconst q1u = 10;\nconst q2u = 16002;\nconst q3u = 21863;\nconst q4u = 10931;\nconst q5u = 1473;\nconst q6u = 32004;\nconst q7u = 4387;\nconst q8u = 73;\n\nconst Cl1 = -325 * 1e-7;\nconst Cl2 = -322 * 1e-7;\nconst Cl3 = -79 * 1e-7;\nconst Cl4 = 232 * 1e-7;\nconst Cl5 = -52 * 1e-7;\nconst Cl6 = 97 * 1e-7;\nconst Cl7 = 55 * 1e-7;\nconst Cl8 = -41 * 1e-7;\n\nconst Sl1 = -105 * 1e-7;\nconst Sl2 = -137 * 1e-7;\nconst Sl3 = 258 * 1e-7;\nconst Sl4 = 35 * 1e-7;\nconst Sl5 = -116 * 1e-7;\nconst Sl6 = -88 * 1e-7;\nconst Sl7 = -112 * 1e-7;\nconst Sl8 = -80 * 1e-7;\n\nconst scratchDate = new JulianDate(0, 0.0, TimeStandard.TAI);\n// Gets a point describing the motion of the Earth-Moon barycenter according to the equations described in section 6.\nfunction computeSimonEarthMoonBarycenter(date, result) {\n // t is thousands of years from J2000 TDB\n taiToTdb(date, scratchDate);\n const x =\n scratchDate.dayNumber -\n epoch.dayNumber +\n (scratchDate.secondsOfDay - epoch.secondsOfDay) /\n TimeConstants.SECONDS_PER_DAY;\n const t = x / (TimeConstants.DAYS_PER_JULIAN_CENTURY * 10.0);\n\n const u = 0.3595362 * t;\n const semimajorAxis =\n semiMajorAxis0 +\n Ca1 * Math.cos(p1u * u) +\n Sa1 * Math.sin(p1u * u) +\n Ca2 * Math.cos(p2u * u) +\n Sa2 * Math.sin(p2u * u) +\n Ca3 * Math.cos(p3u * u) +\n Sa3 * Math.sin(p3u * u) +\n Ca4 * Math.cos(p4u * u) +\n Sa4 * Math.sin(p4u * u) +\n Ca5 * Math.cos(p5u * u) +\n Sa5 * Math.sin(p5u * u) +\n Ca6 * Math.cos(p6u * u) +\n Sa6 * Math.sin(p6u * u) +\n Ca7 * Math.cos(p7u * u) +\n Sa7 * Math.sin(p7u * u) +\n Ca8 * Math.cos(p8u * u) +\n Sa8 * Math.sin(p8u * u);\n const meanLongitude =\n meanLongitude0 +\n meanLongitude1 * t +\n Cl1 * Math.cos(q1u * u) +\n Sl1 * Math.sin(q1u * u) +\n Cl2 * Math.cos(q2u * u) +\n Sl2 * Math.sin(q2u * u) +\n Cl3 * Math.cos(q3u * u) +\n Sl3 * Math.sin(q3u * u) +\n Cl4 * Math.cos(q4u * u) +\n Sl4 * Math.sin(q4u * u) +\n Cl5 * Math.cos(q5u * u) +\n Sl5 * Math.sin(q5u * u) +\n Cl6 * Math.cos(q6u * u) +\n Sl6 * Math.sin(q6u * u) +\n Cl7 * Math.cos(q7u * u) +\n Sl7 * Math.sin(q7u * u) +\n Cl8 * Math.cos(q8u * u) +\n Sl8 * Math.sin(q8u * u);\n\n // All constants in this part are from section 5.8\n const eccentricity = 0.0167086342 - 0.0004203654 * t;\n const longitudeOfPerigee =\n 102.93734808 * RadiansPerDegree + 11612.3529 * RadiansPerArcSecond * t;\n const inclination = 469.97289 * RadiansPerArcSecond * t;\n const longitudeOfNode =\n 174.87317577 * RadiansPerDegree - 8679.27034 * RadiansPerArcSecond * t;\n\n return elementsToCartesian(\n semimajorAxis,\n eccentricity,\n inclination,\n longitudeOfPerigee,\n longitudeOfNode,\n meanLongitude,\n result\n );\n}\n\n// Gets a point describing the position of the moon according to the equations described in section 4.\nfunction computeSimonMoon(date, result) {\n taiToTdb(date, scratchDate);\n const x =\n scratchDate.dayNumber -\n epoch.dayNumber +\n (scratchDate.secondsOfDay - epoch.secondsOfDay) /\n TimeConstants.SECONDS_PER_DAY;\n const t = x / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n const t2 = t * t;\n const t3 = t2 * t;\n const t4 = t3 * t;\n\n // Terms from section 3.4 (b.1)\n let semimajorAxis = 383397.7725 + 0.004 * t;\n let eccentricity = 0.055545526 - 0.000000016 * t;\n const inclinationConstant = 5.15668983 * RadiansPerDegree;\n let inclinationSecPart =\n -0.00008 * t + 0.02966 * t2 - 0.000042 * t3 - 0.00000013 * t4;\n const longitudeOfPerigeeConstant = 83.35324312 * RadiansPerDegree;\n let longitudeOfPerigeeSecPart =\n 14643420.2669 * t - 38.2702 * t2 - 0.045047 * t3 + 0.00021301 * t4;\n const longitudeOfNodeConstant = 125.04455501 * RadiansPerDegree;\n let longitudeOfNodeSecPart =\n -6967919.3631 * t + 6.3602 * t2 + 0.007625 * t3 - 0.00003586 * t4;\n const meanLongitudeConstant = 218.31664563 * RadiansPerDegree;\n let meanLongitudeSecPart =\n 1732559343.4847 * t - 6.391 * t2 + 0.006588 * t3 - 0.00003169 * t4;\n\n // Delaunay arguments from section 3.5 b\n const D =\n 297.85019547 * RadiansPerDegree +\n RadiansPerArcSecond *\n (1602961601.209 * t - 6.3706 * t2 + 0.006593 * t3 - 0.00003169 * t4);\n const F =\n 93.27209062 * RadiansPerDegree +\n RadiansPerArcSecond *\n (1739527262.8478 * t - 12.7512 * t2 - 0.001037 * t3 + 0.00000417 * t4);\n const l =\n 134.96340251 * RadiansPerDegree +\n RadiansPerArcSecond *\n (1717915923.2178 * t + 31.8792 * t2 + 0.051635 * t3 - 0.0002447 * t4);\n const lprime =\n 357.52910918 * RadiansPerDegree +\n RadiansPerArcSecond *\n (129596581.0481 * t - 0.5532 * t2 + 0.000136 * t3 - 0.00001149 * t4);\n const psi =\n 310.17137918 * RadiansPerDegree -\n RadiansPerArcSecond *\n (6967051.436 * t + 6.2068 * t2 + 0.007618 * t3 - 0.00003219 * t4);\n\n // Add terms from Table 4\n const twoD = 2.0 * D;\n const fourD = 4.0 * D;\n const sixD = 6.0 * D;\n const twol = 2.0 * l;\n const threel = 3.0 * l;\n const fourl = 4.0 * l;\n const twoF = 2.0 * F;\n semimajorAxis +=\n 3400.4 * Math.cos(twoD) -\n 635.6 * Math.cos(twoD - l) -\n 235.6 * Math.cos(l) +\n 218.1 * Math.cos(twoD - lprime) +\n 181.0 * Math.cos(twoD + l);\n eccentricity +=\n 0.014216 * Math.cos(twoD - l) +\n 0.008551 * Math.cos(twoD - twol) -\n 0.001383 * Math.cos(l) +\n 0.001356 * Math.cos(twoD + l) -\n 0.001147 * Math.cos(fourD - threel) -\n 0.000914 * Math.cos(fourD - twol) +\n 0.000869 * Math.cos(twoD - lprime - l) -\n 0.000627 * Math.cos(twoD) -\n 0.000394 * Math.cos(fourD - fourl) +\n 0.000282 * Math.cos(twoD - lprime - twol) -\n 0.000279 * Math.cos(D - l) -\n 0.000236 * Math.cos(twol) +\n 0.000231 * Math.cos(fourD) +\n 0.000229 * Math.cos(sixD - fourl) -\n 0.000201 * Math.cos(twol - twoF);\n inclinationSecPart +=\n 486.26 * Math.cos(twoD - twoF) -\n 40.13 * Math.cos(twoD) +\n 37.51 * Math.cos(twoF) +\n 25.73 * Math.cos(twol - twoF) +\n 19.97 * Math.cos(twoD - lprime - twoF);\n longitudeOfPerigeeSecPart +=\n -55609 * Math.sin(twoD - l) -\n 34711 * Math.sin(twoD - twol) -\n 9792 * Math.sin(l) +\n 9385 * Math.sin(fourD - threel) +\n 7505 * Math.sin(fourD - twol) +\n 5318 * Math.sin(twoD + l) +\n 3484 * Math.sin(fourD - fourl) -\n 3417 * Math.sin(twoD - lprime - l) -\n 2530 * Math.sin(sixD - fourl) -\n 2376 * Math.sin(twoD) -\n 2075 * Math.sin(twoD - threel) -\n 1883 * Math.sin(twol) -\n 1736 * Math.sin(sixD - 5.0 * l) +\n 1626 * Math.sin(lprime) -\n 1370 * Math.sin(sixD - threel);\n longitudeOfNodeSecPart +=\n -5392 * Math.sin(twoD - twoF) -\n 540 * Math.sin(lprime) -\n 441 * Math.sin(twoD) +\n 423 * Math.sin(twoF) -\n 288 * Math.sin(twol - twoF);\n meanLongitudeSecPart +=\n -3332.9 * Math.sin(twoD) +\n 1197.4 * Math.sin(twoD - l) -\n 662.5 * Math.sin(lprime) +\n 396.3 * Math.sin(l) -\n 218.0 * Math.sin(twoD - lprime);\n\n // Add terms from Table 5\n const twoPsi = 2.0 * psi;\n const threePsi = 3.0 * psi;\n inclinationSecPart +=\n 46.997 * Math.cos(psi) * t -\n 0.614 * Math.cos(twoD - twoF + psi) * t +\n 0.614 * Math.cos(twoD - twoF - psi) * t -\n 0.0297 * Math.cos(twoPsi) * t2 -\n 0.0335 * Math.cos(psi) * t2 +\n 0.0012 * Math.cos(twoD - twoF + twoPsi) * t2 -\n 0.00016 * Math.cos(psi) * t3 +\n 0.00004 * Math.cos(threePsi) * t3 +\n 0.00004 * Math.cos(twoPsi) * t3;\n const perigeeAndMean =\n 2.116 * Math.sin(psi) * t -\n 0.111 * Math.sin(twoD - twoF - psi) * t -\n 0.0015 * Math.sin(psi) * t2;\n longitudeOfPerigeeSecPart += perigeeAndMean;\n meanLongitudeSecPart += perigeeAndMean;\n longitudeOfNodeSecPart +=\n -520.77 * Math.sin(psi) * t +\n 13.66 * Math.sin(twoD - twoF + psi) * t +\n 1.12 * Math.sin(twoD - psi) * t -\n 1.06 * Math.sin(twoF - psi) * t +\n 0.66 * Math.sin(twoPsi) * t2 +\n 0.371 * Math.sin(psi) * t2 -\n 0.035 * Math.sin(twoD - twoF + twoPsi) * t2 -\n 0.015 * Math.sin(twoD - twoF + psi) * t2 +\n 0.0014 * Math.sin(psi) * t3 -\n 0.0011 * Math.sin(threePsi) * t3 -\n 0.0009 * Math.sin(twoPsi) * t3;\n\n // Add constants and convert units\n semimajorAxis *= MetersPerKilometer;\n const inclination =\n inclinationConstant + inclinationSecPart * RadiansPerArcSecond;\n const longitudeOfPerigee =\n longitudeOfPerigeeConstant +\n longitudeOfPerigeeSecPart * RadiansPerArcSecond;\n const meanLongitude =\n meanLongitudeConstant + meanLongitudeSecPart * RadiansPerArcSecond;\n const longitudeOfNode =\n longitudeOfNodeConstant + longitudeOfNodeSecPart * RadiansPerArcSecond;\n\n return elementsToCartesian(\n semimajorAxis,\n eccentricity,\n inclination,\n longitudeOfPerigee,\n longitudeOfNode,\n meanLongitude,\n result\n );\n}\n\n// Gets a point describing the motion of the Earth. This point uses the Moon point and\n// the 1992 mu value (ratio between Moon and Earth masses) in Table 2 of the paper in order\n// to determine the position of the Earth relative to the Earth-Moon barycenter.\nconst moonEarthMassRatio = 0.012300034; // From 1992 mu value in Table 2\nconst factor = (moonEarthMassRatio / (moonEarthMassRatio + 1.0)) * -1;\nfunction computeSimonEarth(date, result) {\n result = computeSimonMoon(date, result);\n return Cartesian3.multiplyByScalar(result, factor, result);\n}\n\n// Values for the <code>axesTransformation</code> needed for the rotation were found using the STK Components\n// GreographicTransformer on the position of the sun center of mass point and the earth J2000 frame.\n\nconst axesTransformation = new Matrix3(\n 1.0000000000000002,\n 5.619723173785822e-16,\n 4.690511510146299e-19,\n -5.154129427414611e-16,\n 0.9174820620691819,\n -0.39777715593191376,\n -2.23970096136568e-16,\n 0.39777715593191376,\n 0.9174820620691819\n);\nlet translation = new Cartesian3();\n/**\n * Computes the position of the Sun in the Earth-centered inertial frame\n *\n * @param {JulianDate} [julianDate] The time at which to compute the Sun's position, if not provided the current system time is used.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} Calculated sun position\n */\nSimon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame = function (\n julianDate,\n result\n) {\n if (!defined(julianDate)) {\n julianDate = JulianDate.now();\n }\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n //first forward transformation\n translation = computeSimonEarthMoonBarycenter(julianDate, translation);\n result = Cartesian3.negate(translation, result);\n\n //second forward transformation\n computeSimonEarth(julianDate, translation);\n\n Cartesian3.subtract(result, translation, result);\n Matrix3.multiplyByVector(axesTransformation, result, result);\n\n return result;\n};\n\n/**\n * Computes the position of the Moon in the Earth-centered inertial frame\n *\n * @param {JulianDate} [julianDate] The time at which to compute the Sun's position, if not provided the current system time is used.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} Calculated moon position\n */\nSimon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function (\n julianDate,\n result\n) {\n if (!defined(julianDate)) {\n julianDate = JulianDate.now();\n }\n\n result = computeSimonMoon(julianDate, result);\n Matrix3.multiplyByVector(axesTransformation, result, result);\n\n return result;\n};\nexport default Simon1994PlanetaryPositions;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * A directional light source that originates from the Sun.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Color} [options.color=Color.WHITE] The light's color.\n * @param {Number} [options.intensity=2.0] The light's intensity.\n *\n * @alias SunLight\n * @constructor\n */\nfunction SunLight(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n /**\n * The color of the light.\n * @type {Color}\n * @default Color.WHITE\n */\n this.color = Color.clone(defaultValue(options.color, Color.WHITE));\n\n /**\n * The intensity of the light.\n * @type {Number}\n * @default 2.0\n */\n this.intensity = defaultValue(options.intensity, 2.0);\n}\n\nexport default SunLight;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Simon1994PlanetaryPositions from \"../Core/Simon1994PlanetaryPositions.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport SceneMode from \"../Scene/SceneMode.js\";\nimport SunLight from \"../Scene/SunLight.js\";\n\n/**\n * @private\n * @constructor\n */\nfunction UniformState() {\n /**\n * @type {Texture}\n */\n this.globeDepthTexture = undefined;\n /**\n * @type {Number}\n */\n this.gamma = undefined;\n\n this._viewport = new BoundingRectangle();\n this._viewportCartesian4 = new Cartesian4();\n this._viewportDirty = false;\n this._viewportOrthographicMatrix = Matrix4.clone(Matrix4.IDENTITY);\n this._viewportTransformation = Matrix4.clone(Matrix4.IDENTITY);\n\n this._model = Matrix4.clone(Matrix4.IDENTITY);\n this._view = Matrix4.clone(Matrix4.IDENTITY);\n this._inverseView = Matrix4.clone(Matrix4.IDENTITY);\n this._projection = Matrix4.clone(Matrix4.IDENTITY);\n this._infiniteProjection = Matrix4.clone(Matrix4.IDENTITY);\n this._entireFrustum = new Cartesian2();\n this._currentFrustum = new Cartesian2();\n this._frustumPlanes = new Cartesian4();\n this._farDepthFromNearPlusOne = undefined;\n this._log2FarDepthFromNearPlusOne = undefined;\n this._oneOverLog2FarDepthFromNearPlusOne = undefined;\n\n this._frameState = undefined;\n this._temeToPseudoFixed = Matrix3.clone(Matrix4.IDENTITY);\n\n // Derived members\n this._view3DDirty = true;\n this._view3D = new Matrix4();\n\n this._inverseView3DDirty = true;\n this._inverseView3D = new Matrix4();\n\n this._inverseModelDirty = true;\n this._inverseModel = new Matrix4();\n\n this._inverseTransposeModelDirty = true;\n this._inverseTransposeModel = new Matrix3();\n\n this._viewRotation = new Matrix3();\n this._inverseViewRotation = new Matrix3();\n\n this._viewRotation3D = new Matrix3();\n this._inverseViewRotation3D = new Matrix3();\n\n this._inverseProjectionDirty = true;\n this._inverseProjection = new Matrix4();\n\n this._modelViewDirty = true;\n this._modelView = new Matrix4();\n\n this._modelView3DDirty = true;\n this._modelView3D = new Matrix4();\n\n this._modelViewRelativeToEyeDirty = true;\n this._modelViewRelativeToEye = new Matrix4();\n\n this._inverseModelViewDirty = true;\n this._inverseModelView = new Matrix4();\n\n this._inverseModelView3DDirty = true;\n this._inverseModelView3D = new Matrix4();\n\n this._viewProjectionDirty = true;\n this._viewProjection = new Matrix4();\n\n this._inverseViewProjectionDirty = true;\n this._inverseViewProjection = new Matrix4();\n\n this._modelViewProjectionDirty = true;\n this._modelViewProjection = new Matrix4();\n\n this._inverseModelViewProjectionDirty = true;\n this._inverseModelViewProjection = new Matrix4();\n\n this._modelViewProjectionRelativeToEyeDirty = true;\n this._modelViewProjectionRelativeToEye = new Matrix4();\n\n this._modelViewInfiniteProjectionDirty = true;\n this._modelViewInfiniteProjection = new Matrix4();\n\n this._normalDirty = true;\n this._normal = new Matrix3();\n\n this._normal3DDirty = true;\n this._normal3D = new Matrix3();\n\n this._inverseNormalDirty = true;\n this._inverseNormal = new Matrix3();\n\n this._inverseNormal3DDirty = true;\n this._inverseNormal3D = new Matrix3();\n\n this._encodedCameraPositionMCDirty = true;\n this._encodedCameraPositionMC = new EncodedCartesian3();\n this._cameraPosition = new Cartesian3();\n\n this._sunPositionWC = new Cartesian3();\n this._sunPositionColumbusView = new Cartesian3();\n this._sunDirectionWC = new Cartesian3();\n this._sunDirectionEC = new Cartesian3();\n this._moonDirectionEC = new Cartesian3();\n\n this._lightDirectionWC = new Cartesian3();\n this._lightDirectionEC = new Cartesian3();\n this._lightColor = new Cartesian3();\n this._lightColorHdr = new Cartesian3();\n\n this._pass = undefined;\n this._mode = undefined;\n this._mapProjection = undefined;\n this._ellipsoid = undefined;\n this._cameraDirection = new Cartesian3();\n this._cameraRight = new Cartesian3();\n this._cameraUp = new Cartesian3();\n this._frustum2DWidth = 0.0;\n this._eyeHeight = 0.0;\n this._eyeHeight2D = new Cartesian2();\n this._pixelRatio = 1.0;\n this._orthographicIn3D = false;\n this._backgroundColor = new Color();\n\n this._brdfLut = undefined;\n this._environmentMap = undefined;\n\n this._sphericalHarmonicCoefficients = undefined;\n this._specularEnvironmentMaps = undefined;\n this._specularEnvironmentMapsDimensions = new Cartesian2();\n this._specularEnvironmentMapsMaximumLOD = undefined;\n\n this._fogDensity = undefined;\n\n this._invertClassificationColor = undefined;\n\n this._splitPosition = 0.0;\n this._pixelSizePerMeter = undefined;\n this._geometricToleranceOverMeter = undefined;\n\n this._minimumDisableDepthTestDistance = undefined;\n}\n\nObject.defineProperties(UniformState.prototype, {\n /**\n * @memberof UniformState.prototype\n * @type {FrameState}\n * @readonly\n */\n frameState: {\n get: function () {\n return this._frameState;\n },\n },\n /**\n * @memberof UniformState.prototype\n * @type {BoundingRectangle}\n */\n viewport: {\n get: function () {\n return this._viewport;\n },\n set: function (viewport) {\n if (!BoundingRectangle.equals(viewport, this._viewport)) {\n BoundingRectangle.clone(viewport, this._viewport);\n\n const v = this._viewport;\n const vc = this._viewportCartesian4;\n vc.x = v.x;\n vc.y = v.y;\n vc.z = v.width;\n vc.w = v.height;\n\n this._viewportDirty = true;\n }\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @private\n */\n viewportCartesian4: {\n get: function () {\n return this._viewportCartesian4;\n },\n },\n\n viewportOrthographic: {\n get: function () {\n cleanViewport(this);\n return this._viewportOrthographicMatrix;\n },\n },\n\n viewportTransformation: {\n get: function () {\n cleanViewport(this);\n return this._viewportTransformation;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n model: {\n get: function () {\n return this._model;\n },\n set: function (matrix) {\n Matrix4.clone(matrix, this._model);\n\n this._modelView3DDirty = true;\n this._inverseModelView3DDirty = true;\n this._inverseModelDirty = true;\n this._inverseTransposeModelDirty = true;\n this._modelViewDirty = true;\n this._inverseModelViewDirty = true;\n this._modelViewRelativeToEyeDirty = true;\n this._inverseModelViewDirty = true;\n this._modelViewProjectionDirty = true;\n this._inverseModelViewProjectionDirty = true;\n this._modelViewProjectionRelativeToEyeDirty = true;\n this._modelViewInfiniteProjectionDirty = true;\n this._normalDirty = true;\n this._inverseNormalDirty = true;\n this._normal3DDirty = true;\n this._inverseNormal3DDirty = true;\n this._encodedCameraPositionMCDirty = true;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseModel: {\n get: function () {\n if (this._inverseModelDirty) {\n this._inverseModelDirty = false;\n\n Matrix4.inverse(this._model, this._inverseModel);\n }\n\n return this._inverseModel;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @private\n */\n inverseTransposeModel: {\n get: function () {\n const m = this._inverseTransposeModel;\n if (this._inverseTransposeModelDirty) {\n this._inverseTransposeModelDirty = false;\n\n Matrix4.getMatrix3(this.inverseModel, m);\n Matrix3.transpose(m, m);\n }\n\n return m;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n view: {\n get: function () {\n return this._view;\n },\n },\n\n /**\n * The 3D view matrix. In 3D mode, this is identical to {@link UniformState#view},\n * but in 2D and Columbus View it is a synthetic matrix based on the equivalent position\n * of the camera in the 3D world.\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n view3D: {\n get: function () {\n updateView3D(this);\n return this._view3D;\n },\n },\n\n /**\n * The 3x3 rotation matrix of the current view matrix ({@link UniformState#view}).\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n viewRotation: {\n get: function () {\n updateView3D(this);\n return this._viewRotation;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n viewRotation3D: {\n get: function () {\n updateView3D(this);\n return this._viewRotation3D;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseView: {\n get: function () {\n return this._inverseView;\n },\n },\n\n /**\n * the 4x4 inverse-view matrix that transforms from eye to 3D world coordinates. In 3D mode, this is\n * identical to {@link UniformState#inverseView}, but in 2D and Columbus View it is a synthetic matrix\n * based on the equivalent position of the camera in the 3D world.\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseView3D: {\n get: function () {\n updateInverseView3D(this);\n return this._inverseView3D;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n inverseViewRotation: {\n get: function () {\n return this._inverseViewRotation;\n },\n },\n\n /**\n * The 3x3 rotation matrix of the current 3D inverse-view matrix ({@link UniformState#inverseView3D}).\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n inverseViewRotation3D: {\n get: function () {\n updateInverseView3D(this);\n return this._inverseViewRotation3D;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n projection: {\n get: function () {\n return this._projection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseProjection: {\n get: function () {\n cleanInverseProjection(this);\n return this._inverseProjection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n infiniteProjection: {\n get: function () {\n return this._infiniteProjection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelView: {\n get: function () {\n cleanModelView(this);\n return this._modelView;\n },\n },\n\n /**\n * The 3D model-view matrix. In 3D mode, this is equivalent to {@link UniformState#modelView}. In 2D and\n * Columbus View, however, it is a synthetic matrix based on the equivalent position of the camera in the 3D world.\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelView3D: {\n get: function () {\n cleanModelView3D(this);\n return this._modelView3D;\n },\n },\n\n /**\n * Model-view relative to eye matrix.\n *\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelViewRelativeToEye: {\n get: function () {\n cleanModelViewRelativeToEye(this);\n return this._modelViewRelativeToEye;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseModelView: {\n get: function () {\n cleanInverseModelView(this);\n return this._inverseModelView;\n },\n },\n\n /**\n * The inverse of the 3D model-view matrix. In 3D mode, this is equivalent to {@link UniformState#inverseModelView}.\n * In 2D and Columbus View, however, it is a synthetic matrix based on the equivalent position of the camera in the 3D world.\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseModelView3D: {\n get: function () {\n cleanInverseModelView3D(this);\n return this._inverseModelView3D;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n viewProjection: {\n get: function () {\n cleanViewProjection(this);\n return this._viewProjection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseViewProjection: {\n get: function () {\n cleanInverseViewProjection(this);\n return this._inverseViewProjection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelViewProjection: {\n get: function () {\n cleanModelViewProjection(this);\n return this._modelViewProjection;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n inverseModelViewProjection: {\n get: function () {\n cleanInverseModelViewProjection(this);\n return this._inverseModelViewProjection;\n },\n },\n\n /**\n * Model-view-projection relative to eye matrix.\n *\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelViewProjectionRelativeToEye: {\n get: function () {\n cleanModelViewProjectionRelativeToEye(this);\n return this._modelViewProjectionRelativeToEye;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Matrix4}\n */\n modelViewInfiniteProjection: {\n get: function () {\n cleanModelViewInfiniteProjection(this);\n return this._modelViewInfiniteProjection;\n },\n },\n\n /**\n * A 3x3 normal transformation matrix that transforms normal vectors in model coordinates to\n * eye coordinates.\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n normal: {\n get: function () {\n cleanNormal(this);\n return this._normal;\n },\n },\n\n /**\n * A 3x3 normal transformation matrix that transforms normal vectors in 3D model\n * coordinates to eye coordinates. In 3D mode, this is identical to\n * {@link UniformState#normal}, but in 2D and Columbus View it represents the normal transformation\n * matrix as if the camera were at an equivalent location in 3D mode.\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n normal3D: {\n get: function () {\n cleanNormal3D(this);\n return this._normal3D;\n },\n },\n\n /**\n * An inverse 3x3 normal transformation matrix that transforms normal vectors in model coordinates\n * to eye coordinates.\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n inverseNormal: {\n get: function () {\n cleanInverseNormal(this);\n return this._inverseNormal;\n },\n },\n\n /**\n * An inverse 3x3 normal transformation matrix that transforms normal vectors in eye coordinates\n * to 3D model coordinates. In 3D mode, this is identical to\n * {@link UniformState#inverseNormal}, but in 2D and Columbus View it represents the normal transformation\n * matrix as if the camera were at an equivalent location in 3D mode.\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n inverseNormal3D: {\n get: function () {\n cleanInverseNormal3D(this);\n return this._inverseNormal3D;\n },\n },\n\n /**\n * The near distance (<code>x</code>) and the far distance (<code>y</code>) of the frustum defined by the camera.\n * This is the largest possible frustum, not an individual frustum used for multi-frustum rendering.\n * @memberof UniformState.prototype\n * @type {Cartesian2}\n */\n entireFrustum: {\n get: function () {\n return this._entireFrustum;\n },\n },\n\n /**\n * The near distance (<code>x</code>) and the far distance (<code>y</code>) of the frustum defined by the camera.\n * This is the individual frustum used for multi-frustum rendering.\n * @memberof UniformState.prototype\n * @type {Cartesian2}\n */\n currentFrustum: {\n get: function () {\n return this._currentFrustum;\n },\n },\n\n /**\n * The distances to the frustum planes. The top, bottom, left and right distances are\n * the x, y, z, and w components, respectively.\n * @memberof UniformState.prototype\n * @type {Cartesian4}\n */\n frustumPlanes: {\n get: function () {\n return this._frustumPlanes;\n },\n },\n\n /**\n * The far plane's distance from the near plane, plus 1.0.\n *\n * @memberof UniformState.prototype\n * @type {Number}\n */\n farDepthFromNearPlusOne: {\n get: function () {\n return this._farDepthFromNearPlusOne;\n },\n },\n\n /**\n * The log2 of {@link UniformState#farDepthFromNearPlusOne}.\n *\n * @memberof UniformState.prototype\n * @type {Number}\n */\n log2FarDepthFromNearPlusOne: {\n get: function () {\n return this._log2FarDepthFromNearPlusOne;\n },\n },\n\n /**\n * 1.0 divided by {@link UniformState#log2FarDepthFromNearPlusOne}.\n *\n * @memberof UniformState.prototype\n * @type {Number}\n */\n oneOverLog2FarDepthFromNearPlusOne: {\n get: function () {\n return this._oneOverLog2FarDepthFromNearPlusOne;\n },\n },\n\n /**\n * The height in meters of the eye (camera) above or below the ellipsoid.\n * @memberof UniformState.prototype\n * @type {Number}\n */\n eyeHeight: {\n get: function () {\n return this._eyeHeight;\n },\n },\n\n /**\n * The height (<code>x</code>) and the height squared (<code>y</code>)\n * in meters of the eye (camera) above the 2D world plane. This uniform is only valid\n * when the {@link SceneMode} is <code>SCENE2D</code>.\n * @memberof UniformState.prototype\n * @type {Cartesian2}\n */\n eyeHeight2D: {\n get: function () {\n return this._eyeHeight2D;\n },\n },\n\n /**\n * The sun position in 3D world coordinates at the current scene time.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n sunPositionWC: {\n get: function () {\n return this._sunPositionWC;\n },\n },\n\n /**\n * The sun position in 2D world coordinates at the current scene time.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n sunPositionColumbusView: {\n get: function () {\n return this._sunPositionColumbusView;\n },\n },\n\n /**\n * A normalized vector to the sun in 3D world coordinates at the current scene time. Even in 2D or\n * Columbus View mode, this returns the direction to the sun in the 3D scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n sunDirectionWC: {\n get: function () {\n return this._sunDirectionWC;\n },\n },\n\n /**\n * A normalized vector to the sun in eye coordinates at the current scene time. In 3D mode, this\n * returns the actual vector from the camera position to the sun position. In 2D and Columbus View, it returns\n * the vector from the equivalent 3D camera position to the position of the sun in the 3D scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n sunDirectionEC: {\n get: function () {\n return this._sunDirectionEC;\n },\n },\n\n /**\n * A normalized vector to the moon in eye coordinates at the current scene time. In 3D mode, this\n * returns the actual vector from the camera position to the moon position. In 2D and Columbus View, it returns\n * the vector from the equivalent 3D camera position to the position of the moon in the 3D scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n moonDirectionEC: {\n get: function () {\n return this._moonDirectionEC;\n },\n },\n\n /**\n * A normalized vector to the scene's light source in 3D world coordinates. Even in 2D or\n * Columbus View mode, this returns the direction to the light in the 3D scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n lightDirectionWC: {\n get: function () {\n return this._lightDirectionWC;\n },\n },\n\n /**\n * A normalized vector to the scene's light source in eye coordinates. In 3D mode, this\n * returns the actual vector from the camera position to the light. In 2D and Columbus View, it returns\n * the vector from the equivalent 3D camera position in the 3D scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n lightDirectionEC: {\n get: function () {\n return this._lightDirectionEC;\n },\n },\n\n /**\n * The color of light emitted by the scene's light source. This is equivalent to the light\n * color multiplied by the light intensity limited to a maximum luminance of 1.0 suitable\n * for non-HDR lighting.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n lightColor: {\n get: function () {\n return this._lightColor;\n },\n },\n\n /**\n * The high dynamic range color of light emitted by the scene's light source. This is equivalent to\n * the light color multiplied by the light intensity suitable for HDR lighting.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n lightColorHdr: {\n get: function () {\n return this._lightColorHdr;\n },\n },\n\n /**\n * The high bits of the camera position.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n encodedCameraPositionMCHigh: {\n get: function () {\n cleanEncodedCameraPositionMC(this);\n return this._encodedCameraPositionMC.high;\n },\n },\n\n /**\n * The low bits of the camera position.\n * @memberof UniformState.prototype\n * @type {Cartesian3}\n */\n encodedCameraPositionMCLow: {\n get: function () {\n cleanEncodedCameraPositionMC(this);\n return this._encodedCameraPositionMC.low;\n },\n },\n\n /**\n * A 3x3 matrix that transforms from True Equator Mean Equinox (TEME) axes to the\n * pseudo-fixed axes at the Scene's current time.\n * @memberof UniformState.prototype\n * @type {Matrix3}\n */\n temeToPseudoFixedMatrix: {\n get: function () {\n return this._temeToPseudoFixed;\n },\n },\n\n /**\n * Gets the scaling factor for transforming from the canvas\n * pixel space to canvas coordinate space.\n * @memberof UniformState.prototype\n * @type {Number}\n */\n pixelRatio: {\n get: function () {\n return this._pixelRatio;\n },\n },\n\n /**\n * A scalar used to mix a color with the fog color based on the distance to the camera.\n * @memberof UniformState.prototype\n * @type {Number}\n */\n fogDensity: {\n get: function () {\n return this._fogDensity;\n },\n },\n\n /**\n * A scalar that represents the geometric tolerance per meter\n * @memberof UniformState.prototype\n * @type {Number}\n */\n geometricToleranceOverMeter: {\n get: function () {\n return this._geometricToleranceOverMeter;\n },\n },\n\n /**\n * @memberof UniformState.prototype\n * @type {Pass}\n */\n pass: {\n get: function () {\n return this._pass;\n },\n },\n\n /**\n * The current background color\n * @memberof UniformState.prototype\n * @type {Color}\n */\n backgroundColor: {\n get: function () {\n return this._backgroundColor;\n },\n },\n\n /**\n * The look up texture used to find the BRDF for a material\n * @memberof UniformState.prototype\n * @type {Texture}\n */\n brdfLut: {\n get: function () {\n return this._brdfLut;\n },\n },\n\n /**\n * The environment map of the scene\n * @memberof UniformState.prototype\n * @type {CubeMap}\n */\n environmentMap: {\n get: function () {\n return this._environmentMap;\n },\n },\n\n /**\n * The spherical harmonic coefficients of the scene.\n * @memberof UniformState.prototype\n * @type {Cartesian3[]}\n */\n sphericalHarmonicCoefficients: {\n get: function () {\n return this._sphericalHarmonicCoefficients;\n },\n },\n\n /**\n * The specular environment map atlas of the scene.\n * @memberof UniformState.prototype\n * @type {Texture}\n */\n specularEnvironmentMaps: {\n get: function () {\n return this._specularEnvironmentMaps;\n },\n },\n\n /**\n * The dimensions of the specular environment map atlas of the scene.\n * @memberof UniformState.prototype\n * @type {Cartesian2}\n */\n specularEnvironmentMapsDimensions: {\n get: function () {\n return this._specularEnvironmentMapsDimensions;\n },\n },\n\n /**\n * The maximum level-of-detail of the specular environment map atlas of the scene.\n * @memberof UniformState.prototype\n * @type {Number}\n */\n specularEnvironmentMapsMaximumLOD: {\n get: function () {\n return this._specularEnvironmentMapsMaximumLOD;\n },\n },\n\n /**\n * The splitter position to use when rendering with a splitter. This will be in pixel coordinates relative to the canvas.\n * @memberof UniformState.prototype\n * @type {Number}\n */\n splitPosition: {\n get: function () {\n return this._splitPosition;\n },\n },\n\n /**\n * The distance from the camera at which to disable the depth test of billboards, labels and points\n * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n * be applied. When less than zero, the depth test should never be applied.\n *\n * @memberof UniformState.prototype\n * @type {Number}\n */\n minimumDisableDepthTestDistance: {\n get: function () {\n return this._minimumDisableDepthTestDistance;\n },\n },\n\n /**\n * The highlight color of unclassified 3D Tiles.\n *\n * @memberof UniformState.prototype\n * @type {Color}\n */\n invertClassificationColor: {\n get: function () {\n return this._invertClassificationColor;\n },\n },\n\n /**\n * Whether or not the current projection is orthographic in 3D.\n *\n * @memberOf UniformState.prototype\n * @type {Boolean}\n */\n orthographicIn3D: {\n get: function () {\n return this._orthographicIn3D;\n },\n },\n\n /**\n * The current ellipsoid.\n *\n * @memberOf UniformState.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return defaultValue(this._ellipsoid, Ellipsoid.WGS84);\n },\n },\n});\n\nfunction setView(uniformState, matrix) {\n Matrix4.clone(matrix, uniformState._view);\n Matrix4.getMatrix3(matrix, uniformState._viewRotation);\n\n uniformState._view3DDirty = true;\n uniformState._inverseView3DDirty = true;\n uniformState._modelViewDirty = true;\n uniformState._modelView3DDirty = true;\n uniformState._modelViewRelativeToEyeDirty = true;\n uniformState._inverseModelViewDirty = true;\n uniformState._inverseModelView3DDirty = true;\n uniformState._viewProjectionDirty = true;\n uniformState._inverseViewProjectionDirty = true;\n uniformState._modelViewProjectionDirty = true;\n uniformState._modelViewProjectionRelativeToEyeDirty = true;\n uniformState._modelViewInfiniteProjectionDirty = true;\n uniformState._normalDirty = true;\n uniformState._inverseNormalDirty = true;\n uniformState._normal3DDirty = true;\n uniformState._inverseNormal3DDirty = true;\n}\n\nfunction setInverseView(uniformState, matrix) {\n Matrix4.clone(matrix, uniformState._inverseView);\n Matrix4.getMatrix3(matrix, uniformState._inverseViewRotation);\n}\n\nfunction setProjection(uniformState, matrix) {\n Matrix4.clone(matrix, uniformState._projection);\n\n uniformState._inverseProjectionDirty = true;\n uniformState._viewProjectionDirty = true;\n uniformState._inverseViewProjectionDirty = true;\n uniformState._modelViewProjectionDirty = true;\n uniformState._modelViewProjectionRelativeToEyeDirty = true;\n}\n\nfunction setInfiniteProjection(uniformState, matrix) {\n Matrix4.clone(matrix, uniformState._infiniteProjection);\n\n uniformState._modelViewInfiniteProjectionDirty = true;\n}\n\nfunction setCamera(uniformState, camera) {\n Cartesian3.clone(camera.positionWC, uniformState._cameraPosition);\n Cartesian3.clone(camera.directionWC, uniformState._cameraDirection);\n Cartesian3.clone(camera.rightWC, uniformState._cameraRight);\n Cartesian3.clone(camera.upWC, uniformState._cameraUp);\n\n const positionCartographic = camera.positionCartographic;\n if (!defined(positionCartographic)) {\n uniformState._eyeHeight = -uniformState._ellipsoid.maximumRadius;\n } else {\n uniformState._eyeHeight = positionCartographic.height;\n }\n\n uniformState._encodedCameraPositionMCDirty = true;\n}\n\nlet transformMatrix = new Matrix3();\nconst sunCartographicScratch = new Cartographic();\nfunction setSunAndMoonDirections(uniformState, frameState) {\n if (\n !defined(\n Transforms.computeIcrfToFixedMatrix(frameState.time, transformMatrix)\n )\n ) {\n transformMatrix = Transforms.computeTemeToPseudoFixedMatrix(\n frameState.time,\n transformMatrix\n );\n }\n\n let position = Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(\n frameState.time,\n uniformState._sunPositionWC\n );\n Matrix3.multiplyByVector(transformMatrix, position, position);\n\n Cartesian3.normalize(position, uniformState._sunDirectionWC);\n\n position = Matrix3.multiplyByVector(\n uniformState.viewRotation3D,\n position,\n uniformState._sunDirectionEC\n );\n Cartesian3.normalize(position, position);\n\n position = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(\n frameState.time,\n uniformState._moonDirectionEC\n );\n Matrix3.multiplyByVector(transformMatrix, position, position);\n Matrix3.multiplyByVector(uniformState.viewRotation3D, position, position);\n Cartesian3.normalize(position, position);\n\n const projection = frameState.mapProjection;\n const ellipsoid = projection.ellipsoid;\n const sunCartographic = ellipsoid.cartesianToCartographic(\n uniformState._sunPositionWC,\n sunCartographicScratch\n );\n projection.project(sunCartographic, uniformState._sunPositionColumbusView);\n}\n\n/**\n * Synchronizes the frustum's state with the camera state. This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {Object} camera The camera to synchronize with.\n */\nUniformState.prototype.updateCamera = function (camera) {\n setView(this, camera.viewMatrix);\n setInverseView(this, camera.inverseViewMatrix);\n setCamera(this, camera);\n\n this._entireFrustum.x = camera.frustum.near;\n this._entireFrustum.y = camera.frustum.far;\n this.updateFrustum(camera.frustum);\n\n this._orthographicIn3D =\n this._mode !== SceneMode.SCENE2D &&\n camera.frustum instanceof OrthographicFrustum;\n};\n\n/**\n * Synchronizes the frustum's state with the uniform state. This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {Object} frustum The frustum to synchronize with.\n */\nUniformState.prototype.updateFrustum = function (frustum) {\n setProjection(this, frustum.projectionMatrix);\n if (defined(frustum.infiniteProjectionMatrix)) {\n setInfiniteProjection(this, frustum.infiniteProjectionMatrix);\n }\n this._currentFrustum.x = frustum.near;\n this._currentFrustum.y = frustum.far;\n\n this._farDepthFromNearPlusOne = frustum.far - frustum.near + 1.0;\n this._log2FarDepthFromNearPlusOne = CesiumMath.log2(\n this._farDepthFromNearPlusOne\n );\n this._oneOverLog2FarDepthFromNearPlusOne =\n 1.0 / this._log2FarDepthFromNearPlusOne;\n\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n\n this._frustumPlanes.x = frustum.top;\n this._frustumPlanes.y = frustum.bottom;\n this._frustumPlanes.z = frustum.left;\n this._frustumPlanes.w = frustum.right;\n};\n\nUniformState.prototype.updatePass = function (pass) {\n this._pass = pass;\n};\n\nconst EMPTY_ARRAY = [];\nconst defaultLight = new SunLight();\n\n/**\n * Synchronizes frame state with the uniform state. This is called\n * by the {@link Scene} when rendering to ensure that automatic GLSL uniforms\n * are set to the right value.\n *\n * @param {FrameState} frameState The frameState to synchronize with.\n */\nUniformState.prototype.update = function (frameState) {\n this._mode = frameState.mode;\n this._mapProjection = frameState.mapProjection;\n this._ellipsoid = frameState.mapProjection.ellipsoid;\n this._pixelRatio = frameState.pixelRatio;\n\n const camera = frameState.camera;\n this.updateCamera(camera);\n\n if (frameState.mode === SceneMode.SCENE2D) {\n this._frustum2DWidth = camera.frustum.right - camera.frustum.left;\n this._eyeHeight2D.x = this._frustum2DWidth * 0.5;\n this._eyeHeight2D.y = this._eyeHeight2D.x * this._eyeHeight2D.x;\n } else {\n this._frustum2DWidth = 0.0;\n this._eyeHeight2D.x = 0.0;\n this._eyeHeight2D.y = 0.0;\n }\n\n setSunAndMoonDirections(this, frameState);\n\n const light = defaultValue(frameState.light, defaultLight);\n if (light instanceof SunLight) {\n this._lightDirectionWC = Cartesian3.clone(\n this._sunDirectionWC,\n this._lightDirectionWC\n );\n this._lightDirectionEC = Cartesian3.clone(\n this._sunDirectionEC,\n this._lightDirectionEC\n );\n } else {\n this._lightDirectionWC = Cartesian3.normalize(\n Cartesian3.negate(light.direction, this._lightDirectionWC),\n this._lightDirectionWC\n );\n this._lightDirectionEC = Matrix3.multiplyByVector(\n this.viewRotation3D,\n this._lightDirectionWC,\n this._lightDirectionEC\n );\n }\n\n const lightColor = light.color;\n let lightColorHdr = Cartesian3.fromElements(\n lightColor.red,\n lightColor.green,\n lightColor.blue,\n this._lightColorHdr\n );\n lightColorHdr = Cartesian3.multiplyByScalar(\n lightColorHdr,\n light.intensity,\n lightColorHdr\n );\n const maximumComponent = Cartesian3.maximumComponent(lightColorHdr);\n if (maximumComponent > 1.0) {\n Cartesian3.divideByScalar(\n lightColorHdr,\n maximumComponent,\n this._lightColor\n );\n } else {\n Cartesian3.clone(lightColorHdr, this._lightColor);\n }\n\n const brdfLutGenerator = frameState.brdfLutGenerator;\n const brdfLut = defined(brdfLutGenerator)\n ? brdfLutGenerator.colorTexture\n : undefined;\n this._brdfLut = brdfLut;\n\n this._environmentMap = defaultValue(\n frameState.environmentMap,\n frameState.context.defaultCubeMap\n );\n\n // IE 11 doesn't optimize out uniforms that are #ifdef'd out. So undefined values for the spherical harmonic\n // coefficients and specular environment map atlas dimensions cause a crash.\n this._sphericalHarmonicCoefficients = defaultValue(\n frameState.sphericalHarmonicCoefficients,\n EMPTY_ARRAY\n );\n this._specularEnvironmentMaps = frameState.specularEnvironmentMaps;\n this._specularEnvironmentMapsMaximumLOD =\n frameState.specularEnvironmentMapsMaximumLOD;\n\n if (defined(this._specularEnvironmentMaps)) {\n Cartesian2.clone(\n this._specularEnvironmentMaps.dimensions,\n this._specularEnvironmentMapsDimensions\n );\n }\n\n this._fogDensity = frameState.fog.density;\n\n this._invertClassificationColor = frameState.invertClassificationColor;\n\n this._frameState = frameState;\n this._temeToPseudoFixed = Transforms.computeTemeToPseudoFixedMatrix(\n frameState.time,\n this._temeToPseudoFixed\n );\n\n // Convert the relative splitPosition to absolute pixel coordinates\n this._splitPosition =\n frameState.splitPosition * frameState.context.drawingBufferWidth;\n const fov = camera.frustum.fov;\n const viewport = this._viewport;\n let pixelSizePerMeter;\n if (defined(fov)) {\n if (viewport.height > viewport.width) {\n pixelSizePerMeter = (Math.tan(0.5 * fov) * 2.0) / viewport.height;\n } else {\n pixelSizePerMeter = (Math.tan(0.5 * fov) * 2.0) / viewport.width;\n }\n } else {\n pixelSizePerMeter = 1.0 / Math.max(viewport.width, viewport.height);\n }\n\n this._geometricToleranceOverMeter =\n pixelSizePerMeter * frameState.maximumScreenSpaceError;\n Color.clone(frameState.backgroundColor, this._backgroundColor);\n\n this._minimumDisableDepthTestDistance =\n frameState.minimumDisableDepthTestDistance;\n this._minimumDisableDepthTestDistance *= this._minimumDisableDepthTestDistance;\n if (this._minimumDisableDepthTestDistance === Number.POSITIVE_INFINITY) {\n this._minimumDisableDepthTestDistance = -1.0;\n }\n};\n\nfunction cleanViewport(uniformState) {\n if (uniformState._viewportDirty) {\n const v = uniformState._viewport;\n Matrix4.computeOrthographicOffCenter(\n v.x,\n v.x + v.width,\n v.y,\n v.y + v.height,\n 0.0,\n 1.0,\n uniformState._viewportOrthographicMatrix\n );\n Matrix4.computeViewportTransformation(\n v,\n 0.0,\n 1.0,\n uniformState._viewportTransformation\n );\n uniformState._viewportDirty = false;\n }\n}\n\nfunction cleanInverseProjection(uniformState) {\n if (uniformState._inverseProjectionDirty) {\n uniformState._inverseProjectionDirty = false;\n\n if (\n uniformState._mode !== SceneMode.SCENE2D &&\n uniformState._mode !== SceneMode.MORPHING &&\n !uniformState._orthographicIn3D\n ) {\n Matrix4.inverse(\n uniformState._projection,\n uniformState._inverseProjection\n );\n } else {\n Matrix4.clone(Matrix4.ZERO, uniformState._inverseProjection);\n }\n }\n}\n\n// Derived\nfunction cleanModelView(uniformState) {\n if (uniformState._modelViewDirty) {\n uniformState._modelViewDirty = false;\n\n Matrix4.multiplyTransformation(\n uniformState._view,\n uniformState._model,\n uniformState._modelView\n );\n }\n}\n\nfunction cleanModelView3D(uniformState) {\n if (uniformState._modelView3DDirty) {\n uniformState._modelView3DDirty = false;\n\n Matrix4.multiplyTransformation(\n uniformState.view3D,\n uniformState._model,\n uniformState._modelView3D\n );\n }\n}\n\nfunction cleanInverseModelView(uniformState) {\n if (uniformState._inverseModelViewDirty) {\n uniformState._inverseModelViewDirty = false;\n\n Matrix4.inverse(uniformState.modelView, uniformState._inverseModelView);\n }\n}\n\nfunction cleanInverseModelView3D(uniformState) {\n if (uniformState._inverseModelView3DDirty) {\n uniformState._inverseModelView3DDirty = false;\n\n Matrix4.inverse(uniformState.modelView3D, uniformState._inverseModelView3D);\n }\n}\n\nfunction cleanViewProjection(uniformState) {\n if (uniformState._viewProjectionDirty) {\n uniformState._viewProjectionDirty = false;\n\n Matrix4.multiply(\n uniformState._projection,\n uniformState._view,\n uniformState._viewProjection\n );\n }\n}\n\nfunction cleanInverseViewProjection(uniformState) {\n if (uniformState._inverseViewProjectionDirty) {\n uniformState._inverseViewProjectionDirty = false;\n\n Matrix4.inverse(\n uniformState.viewProjection,\n uniformState._inverseViewProjection\n );\n }\n}\n\nfunction cleanModelViewProjection(uniformState) {\n if (uniformState._modelViewProjectionDirty) {\n uniformState._modelViewProjectionDirty = false;\n\n Matrix4.multiply(\n uniformState._projection,\n uniformState.modelView,\n uniformState._modelViewProjection\n );\n }\n}\n\nfunction cleanModelViewRelativeToEye(uniformState) {\n if (uniformState._modelViewRelativeToEyeDirty) {\n uniformState._modelViewRelativeToEyeDirty = false;\n\n const mv = uniformState.modelView;\n const mvRte = uniformState._modelViewRelativeToEye;\n mvRte[0] = mv[0];\n mvRte[1] = mv[1];\n mvRte[2] = mv[2];\n mvRte[3] = mv[3];\n mvRte[4] = mv[4];\n mvRte[5] = mv[5];\n mvRte[6] = mv[6];\n mvRte[7] = mv[7];\n mvRte[8] = mv[8];\n mvRte[9] = mv[9];\n mvRte[10] = mv[10];\n mvRte[11] = mv[11];\n mvRte[12] = 0.0;\n mvRte[13] = 0.0;\n mvRte[14] = 0.0;\n mvRte[15] = mv[15];\n }\n}\n\nfunction cleanInverseModelViewProjection(uniformState) {\n if (uniformState._inverseModelViewProjectionDirty) {\n uniformState._inverseModelViewProjectionDirty = false;\n\n Matrix4.inverse(\n uniformState.modelViewProjection,\n uniformState._inverseModelViewProjection\n );\n }\n}\n\nfunction cleanModelViewProjectionRelativeToEye(uniformState) {\n if (uniformState._modelViewProjectionRelativeToEyeDirty) {\n uniformState._modelViewProjectionRelativeToEyeDirty = false;\n\n Matrix4.multiply(\n uniformState._projection,\n uniformState.modelViewRelativeToEye,\n uniformState._modelViewProjectionRelativeToEye\n );\n }\n}\n\nfunction cleanModelViewInfiniteProjection(uniformState) {\n if (uniformState._modelViewInfiniteProjectionDirty) {\n uniformState._modelViewInfiniteProjectionDirty = false;\n\n Matrix4.multiply(\n uniformState._infiniteProjection,\n uniformState.modelView,\n uniformState._modelViewInfiniteProjection\n );\n }\n}\n\nfunction cleanNormal(uniformState) {\n if (uniformState._normalDirty) {\n uniformState._normalDirty = false;\n\n const m = uniformState._normal;\n Matrix4.getMatrix3(uniformState.inverseModelView, m);\n Matrix3.getRotation(m, m);\n Matrix3.transpose(m, m);\n }\n}\n\nfunction cleanNormal3D(uniformState) {\n if (uniformState._normal3DDirty) {\n uniformState._normal3DDirty = false;\n\n const m = uniformState._normal3D;\n Matrix4.getMatrix3(uniformState.inverseModelView3D, m);\n Matrix3.getRotation(m, m);\n Matrix3.transpose(m, m);\n }\n}\n\nfunction cleanInverseNormal(uniformState) {\n if (uniformState._inverseNormalDirty) {\n uniformState._inverseNormalDirty = false;\n Matrix4.getMatrix3(\n uniformState.inverseModelView,\n uniformState._inverseNormal\n );\n Matrix3.getRotation(\n uniformState._inverseNormal,\n uniformState._inverseNormal\n );\n }\n}\n\nfunction cleanInverseNormal3D(uniformState) {\n if (uniformState._inverseNormal3DDirty) {\n uniformState._inverseNormal3DDirty = false;\n Matrix4.getMatrix3(\n uniformState.inverseModelView3D,\n uniformState._inverseNormal3D\n );\n Matrix3.getRotation(\n uniformState._inverseNormal3D,\n uniformState._inverseNormal3D\n );\n }\n}\n\nconst cameraPositionMC = new Cartesian3();\n\nfunction cleanEncodedCameraPositionMC(uniformState) {\n if (uniformState._encodedCameraPositionMCDirty) {\n uniformState._encodedCameraPositionMCDirty = false;\n\n Matrix4.multiplyByPoint(\n uniformState.inverseModel,\n uniformState._cameraPosition,\n cameraPositionMC\n );\n EncodedCartesian3.fromCartesian(\n cameraPositionMC,\n uniformState._encodedCameraPositionMC\n );\n }\n}\n\nconst view2Dto3DPScratch = new Cartesian3();\nconst view2Dto3DRScratch = new Cartesian3();\nconst view2Dto3DUScratch = new Cartesian3();\nconst view2Dto3DDScratch = new Cartesian3();\nconst view2Dto3DCartographicScratch = new Cartographic();\nconst view2Dto3DCartesian3Scratch = new Cartesian3();\nconst view2Dto3DMatrix4Scratch = new Matrix4();\n\nfunction view2Dto3D(\n position2D,\n direction2D,\n right2D,\n up2D,\n frustum2DWidth,\n mode,\n projection,\n result\n) {\n // The camera position and directions are expressed in the 2D coordinate system where the Y axis is to the East,\n // the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where\n // X is to the East, Y is to the North, and Z is out of the local horizontal plane.\n const p = view2Dto3DPScratch;\n p.x = position2D.y;\n p.y = position2D.z;\n p.z = position2D.x;\n\n const r = view2Dto3DRScratch;\n r.x = right2D.y;\n r.y = right2D.z;\n r.z = right2D.x;\n\n const u = view2Dto3DUScratch;\n u.x = up2D.y;\n u.y = up2D.z;\n u.z = up2D.x;\n\n const d = view2Dto3DDScratch;\n d.x = direction2D.y;\n d.y = direction2D.z;\n d.z = direction2D.x;\n\n // In 2D, the camera height is always 12.7 million meters.\n // The apparent height is equal to half the frustum width.\n if (mode === SceneMode.SCENE2D) {\n p.z = frustum2DWidth * 0.5;\n }\n\n // Compute the equivalent camera position in the real (3D) world.\n // In 2D and Columbus View, the camera can travel outside the projection, and when it does so\n // there's not really any corresponding location in the real world. So clamp the unprojected\n // longitude and latitude to their valid ranges.\n const cartographic = projection.unproject(p, view2Dto3DCartographicScratch);\n cartographic.longitude = CesiumMath.clamp(\n cartographic.longitude,\n -Math.PI,\n Math.PI\n );\n cartographic.latitude = CesiumMath.clamp(\n cartographic.latitude,\n -CesiumMath.PI_OVER_TWO,\n CesiumMath.PI_OVER_TWO\n );\n const ellipsoid = projection.ellipsoid;\n const position3D = ellipsoid.cartographicToCartesian(\n cartographic,\n view2Dto3DCartesian3Scratch\n );\n\n // Compute the rotation from the local ENU at the real world camera position to the fixed axes.\n const enuToFixed = Transforms.eastNorthUpToFixedFrame(\n position3D,\n ellipsoid,\n view2Dto3DMatrix4Scratch\n );\n\n // Transform each camera direction to the fixed axes.\n Matrix4.multiplyByPointAsVector(enuToFixed, r, r);\n Matrix4.multiplyByPointAsVector(enuToFixed, u, u);\n Matrix4.multiplyByPointAsVector(enuToFixed, d, d);\n\n // Compute the view matrix based on the new fixed-frame camera position and directions.\n if (!defined(result)) {\n result = new Matrix4();\n }\n\n result[0] = r.x;\n result[1] = u.x;\n result[2] = -d.x;\n result[3] = 0.0;\n result[4] = r.y;\n result[5] = u.y;\n result[6] = -d.y;\n result[7] = 0.0;\n result[8] = r.z;\n result[9] = u.z;\n result[10] = -d.z;\n result[11] = 0.0;\n result[12] = -Cartesian3.dot(r, position3D);\n result[13] = -Cartesian3.dot(u, position3D);\n result[14] = Cartesian3.dot(d, position3D);\n result[15] = 1.0;\n\n return result;\n}\n\nfunction updateView3D(that) {\n if (that._view3DDirty) {\n if (that._mode === SceneMode.SCENE3D) {\n Matrix4.clone(that._view, that._view3D);\n } else {\n view2Dto3D(\n that._cameraPosition,\n that._cameraDirection,\n that._cameraRight,\n that._cameraUp,\n that._frustum2DWidth,\n that._mode,\n that._mapProjection,\n that._view3D\n );\n }\n Matrix4.getMatrix3(that._view3D, that._viewRotation3D);\n that._view3DDirty = false;\n }\n}\n\nfunction updateInverseView3D(that) {\n if (that._inverseView3DDirty) {\n Matrix4.inverseTransformation(that.view3D, that._inverseView3D);\n Matrix4.getMatrix3(that._inverseView3D, that._inverseViewRotation3D);\n that._inverseView3DDirty = false;\n }\n}\nexport default UniformState;\n", "import Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ViewportQuadVS from \"../Shaders/ViewportQuadVS.js\";\nimport BufferUsage from \"./BufferUsage.js\";\nimport ClearCommand from \"./ClearCommand.js\";\nimport ContextLimits from \"./ContextLimits.js\";\nimport CubeMap from \"./CubeMap.js\";\nimport DrawCommand from \"./DrawCommand.js\";\nimport PassState from \"./PassState.js\";\nimport PixelDatatype from \"./PixelDatatype.js\";\nimport RenderState from \"./RenderState.js\";\nimport ShaderCache from \"./ShaderCache.js\";\nimport ShaderProgram from \"./ShaderProgram.js\";\nimport Texture from \"./Texture.js\";\nimport TextureCache from \"./TextureCache.js\";\nimport UniformState from \"./UniformState.js\";\nimport VertexArray from \"./VertexArray.js\";\n\nfunction errorToString(gl, error) {\n let message = \"WebGL Error: \";\n switch (error) {\n case gl.INVALID_ENUM:\n message += \"INVALID_ENUM\";\n break;\n case gl.INVALID_VALUE:\n message += \"INVALID_VALUE\";\n break;\n case gl.INVALID_OPERATION:\n message += \"INVALID_OPERATION\";\n break;\n case gl.OUT_OF_MEMORY:\n message += \"OUT_OF_MEMORY\";\n break;\n case gl.CONTEXT_LOST_WEBGL:\n message += \"CONTEXT_LOST_WEBGL lost\";\n break;\n default:\n message += `Unknown (${error})`;\n }\n\n return message;\n}\n\nfunction createErrorMessage(gl, glFunc, glFuncArguments, error) {\n let message = `${errorToString(gl, error)}: ${glFunc.name}(`;\n\n for (let i = 0; i < glFuncArguments.length; ++i) {\n if (i !== 0) {\n message += \", \";\n }\n message += glFuncArguments[i];\n }\n message += \");\";\n\n return message;\n}\n\nfunction throwOnError(gl, glFunc, glFuncArguments) {\n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n throw new RuntimeError(\n createErrorMessage(gl, glFunc, glFuncArguments, error)\n );\n }\n}\n\nfunction makeGetterSetter(gl, propertyName, logFunction) {\n return {\n get: function () {\n const value = gl[propertyName];\n logFunction(gl, `get: ${propertyName}`, value);\n return gl[propertyName];\n },\n set: function (value) {\n gl[propertyName] = value;\n logFunction(gl, `set: ${propertyName}`, value);\n },\n };\n}\n\nfunction wrapGL(gl, logFunction) {\n if (!defined(logFunction)) {\n return gl;\n }\n\n function wrapFunction(property) {\n return function () {\n const result = property.apply(gl, arguments);\n logFunction(gl, property, arguments);\n return result;\n };\n }\n\n const glWrapper = {};\n\n // JavaScript linters normally demand that a for..in loop must directly contain an if,\n // but in our loop below, we actually intend to iterate all properties, including\n // those in the prototype.\n /*eslint-disable guard-for-in*/\n for (const propertyName in gl) {\n const property = gl[propertyName];\n\n // wrap any functions we encounter, otherwise just copy the property to the wrapper.\n if (property instanceof Function) {\n glWrapper[propertyName] = wrapFunction(property);\n } else {\n Object.defineProperty(\n glWrapper,\n propertyName,\n makeGetterSetter(gl, propertyName, logFunction)\n );\n }\n }\n /*eslint-enable guard-for-in*/\n\n return glWrapper;\n}\n\nfunction getExtension(gl, names) {\n const length = names.length;\n for (let i = 0; i < length; ++i) {\n const extension = gl.getExtension(names[i]);\n if (extension) {\n return extension;\n }\n }\n\n return undefined;\n}\n\n/**\n * @private\n * @constructor\n */\nfunction Context(canvas, options) {\n // this check must use typeof, not defined, because defined doesn't work with undeclared variables.\n if (typeof WebGLRenderingContext === \"undefined\") {\n throw new RuntimeError(\n \"The browser does not support WebGL. Visit http://get.webgl.org.\"\n );\n }\n\n this._canvas = canvas;\n\n options = clone(options, true);\n // Don't use defaultValue.EMPTY_OBJECT here because the options object gets modified in the next line.\n options = defaultValue(options, {});\n options.allowTextureFilterAnisotropic = defaultValue(\n options.allowTextureFilterAnisotropic,\n true\n );\n const webglOptions = defaultValue(options.webgl, {});\n\n // Override select WebGL defaults\n webglOptions.alpha = defaultValue(webglOptions.alpha, false); // WebGL default is true\n webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false\n\n const requestWebgl2 =\n defaultValue(options.requestWebgl2, false) &&\n typeof WebGL2RenderingContext !== \"undefined\";\n let webgl2 = false;\n\n let glContext;\n const getWebGLStub = options.getWebGLStub;\n\n if (!defined(getWebGLStub)) {\n if (requestWebgl2) {\n glContext =\n canvas.getContext(\"webgl2\", webglOptions) ||\n canvas.getContext(\"experimental-webgl2\", webglOptions) ||\n undefined;\n if (defined(glContext)) {\n webgl2 = true;\n }\n }\n if (!defined(glContext)) {\n glContext =\n canvas.getContext(\"webgl\", webglOptions) ||\n canvas.getContext(\"experimental-webgl\", webglOptions) ||\n undefined;\n }\n if (!defined(glContext)) {\n throw new RuntimeError(\n \"The browser supports WebGL, but initialization failed.\"\n );\n }\n } else {\n // Use WebGL stub when requested for unit tests\n glContext = getWebGLStub(canvas, webglOptions);\n }\n\n this._originalGLContext = glContext;\n this._gl = glContext;\n this._webgl2 = webgl2;\n this._id = createGuid();\n\n // Validation and logging disabled by default for speed.\n this.validateFramebuffer = false;\n this.validateShaderProgram = false;\n this.logShaderCompilation = false;\n\n this._throwOnWebGLError = false;\n\n this._shaderCache = new ShaderCache(this);\n this._textureCache = new TextureCache();\n\n const gl = glContext;\n\n this._stencilBits = gl.getParameter(gl.STENCIL_BITS);\n\n ContextLimits._maximumCombinedTextureImageUnits = gl.getParameter(\n gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n ); // min: 8\n ContextLimits._maximumCubeMapSize = gl.getParameter(\n gl.MAX_CUBE_MAP_TEXTURE_SIZE\n ); // min: 16\n ContextLimits._maximumFragmentUniformVectors = gl.getParameter(\n gl.MAX_FRAGMENT_UNIFORM_VECTORS\n ); // min: 16\n ContextLimits._maximumTextureImageUnits = gl.getParameter(\n gl.MAX_TEXTURE_IMAGE_UNITS\n ); // min: 8\n ContextLimits._maximumRenderbufferSize = gl.getParameter(\n gl.MAX_RENDERBUFFER_SIZE\n ); // min: 1\n ContextLimits._maximumTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); // min: 64\n ContextLimits._maximumVaryingVectors = gl.getParameter(\n gl.MAX_VARYING_VECTORS\n ); // min: 8\n ContextLimits._maximumVertexAttributes = gl.getParameter(\n gl.MAX_VERTEX_ATTRIBS\n ); // min: 8\n ContextLimits._maximumVertexTextureImageUnits = gl.getParameter(\n gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n ); // min: 0\n ContextLimits._maximumVertexUniformVectors = gl.getParameter(\n gl.MAX_VERTEX_UNIFORM_VECTORS\n ); // min: 128\n\n ContextLimits._maximumSamples = this._webgl2\n ? gl.getParameter(gl.MAX_SAMPLES)\n : 0;\n\n const aliasedLineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE); // must include 1\n ContextLimits._minimumAliasedLineWidth = aliasedLineWidthRange[0];\n ContextLimits._maximumAliasedLineWidth = aliasedLineWidthRange[1];\n\n const aliasedPointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); // must include 1\n ContextLimits._minimumAliasedPointSize = aliasedPointSizeRange[0];\n ContextLimits._maximumAliasedPointSize = aliasedPointSizeRange[1];\n\n const maximumViewportDimensions = gl.getParameter(gl.MAX_VIEWPORT_DIMS);\n ContextLimits._maximumViewportWidth = maximumViewportDimensions[0];\n ContextLimits._maximumViewportHeight = maximumViewportDimensions[1];\n\n const highpFloat = gl.getShaderPrecisionFormat(\n gl.FRAGMENT_SHADER,\n gl.HIGH_FLOAT\n );\n ContextLimits._highpFloatSupported = highpFloat.precision !== 0;\n const highpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT);\n ContextLimits._highpIntSupported = highpInt.rangeMax !== 0;\n\n this._antialias = gl.getContextAttributes().antialias;\n\n // Query and initialize extensions\n this._standardDerivatives = !!getExtension(gl, [\"OES_standard_derivatives\"]);\n this._blendMinmax = !!getExtension(gl, [\"EXT_blend_minmax\"]);\n this._elementIndexUint = !!getExtension(gl, [\"OES_element_index_uint\"]);\n this._depthTexture = !!getExtension(gl, [\n \"WEBGL_depth_texture\",\n \"WEBKIT_WEBGL_depth_texture\",\n ]);\n this._fragDepth = !!getExtension(gl, [\"EXT_frag_depth\"]);\n this._debugShaders = getExtension(gl, [\"WEBGL_debug_shaders\"]);\n\n this._textureFloat = !!getExtension(gl, [\"OES_texture_float\"]);\n this._textureHalfFloat = !!getExtension(gl, [\"OES_texture_half_float\"]);\n\n this._textureFloatLinear = !!getExtension(gl, [\"OES_texture_float_linear\"]);\n this._textureHalfFloatLinear = !!getExtension(gl, [\n \"OES_texture_half_float_linear\",\n ]);\n\n this._colorBufferFloat = !!getExtension(gl, [\n \"EXT_color_buffer_float\",\n \"WEBGL_color_buffer_float\",\n ]);\n this._floatBlend = !!getExtension(gl, [\"EXT_float_blend\"]);\n this._colorBufferHalfFloat = !!getExtension(gl, [\n \"EXT_color_buffer_half_float\",\n ]);\n\n this._s3tc = !!getExtension(gl, [\n \"WEBGL_compressed_texture_s3tc\",\n \"MOZ_WEBGL_compressed_texture_s3tc\",\n \"WEBKIT_WEBGL_compressed_texture_s3tc\",\n ]);\n this._pvrtc = !!getExtension(gl, [\n \"WEBGL_compressed_texture_pvrtc\",\n \"WEBKIT_WEBGL_compressed_texture_pvrtc\",\n ]);\n this._astc = !!getExtension(gl, [\"WEBGL_compressed_texture_astc\"]);\n this._etc = !!getExtension(gl, [\"WEBG_compressed_texture_etc\"]);\n this._etc1 = !!getExtension(gl, [\"WEBGL_compressed_texture_etc1\"]);\n this._bc7 = !!getExtension(gl, [\"EXT_texture_compression_bptc\"]);\n\n // It is necessary to pass supported formats to loadKTX2\n // because imagery layers don't have access to the context.\n loadKTX2.setKTX2SupportedFormats(\n this._s3tc,\n this._pvrtc,\n this._astc,\n this._etc,\n this._etc1,\n this._bc7\n );\n\n const textureFilterAnisotropic = options.allowTextureFilterAnisotropic\n ? getExtension(gl, [\n \"EXT_texture_filter_anisotropic\",\n \"WEBKIT_EXT_texture_filter_anisotropic\",\n ])\n : undefined;\n this._textureFilterAnisotropic = textureFilterAnisotropic;\n ContextLimits._maximumTextureFilterAnisotropy = defined(\n textureFilterAnisotropic\n )\n ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)\n : 1.0;\n\n let glCreateVertexArray;\n let glBindVertexArray;\n let glDeleteVertexArray;\n\n let glDrawElementsInstanced;\n let glDrawArraysInstanced;\n let glVertexAttribDivisor;\n\n let glDrawBuffers;\n\n let vertexArrayObject;\n let instancedArrays;\n let drawBuffers;\n\n if (webgl2) {\n const that = this;\n\n glCreateVertexArray = function () {\n return that._gl.createVertexArray();\n };\n glBindVertexArray = function (vao) {\n that._gl.bindVertexArray(vao);\n };\n glDeleteVertexArray = function (vao) {\n that._gl.deleteVertexArray(vao);\n };\n\n glDrawElementsInstanced = function (\n mode,\n count,\n type,\n offset,\n instanceCount\n ) {\n gl.drawElementsInstanced(mode, count, type, offset, instanceCount);\n };\n glDrawArraysInstanced = function (mode, first, count, instanceCount) {\n gl.drawArraysInstanced(mode, first, count, instanceCount);\n };\n glVertexAttribDivisor = function (index, divisor) {\n gl.vertexAttribDivisor(index, divisor);\n };\n\n glDrawBuffers = function (buffers) {\n gl.drawBuffers(buffers);\n };\n } else {\n vertexArrayObject = getExtension(gl, [\"OES_vertex_array_object\"]);\n if (defined(vertexArrayObject)) {\n glCreateVertexArray = function () {\n return vertexArrayObject.createVertexArrayOES();\n };\n glBindVertexArray = function (vertexArray) {\n vertexArrayObject.bindVertexArrayOES(vertexArray);\n };\n glDeleteVertexArray = function (vertexArray) {\n vertexArrayObject.deleteVertexArrayOES(vertexArray);\n };\n }\n\n instancedArrays = getExtension(gl, [\"ANGLE_instanced_arrays\"]);\n if (defined(instancedArrays)) {\n glDrawElementsInstanced = function (\n mode,\n count,\n type,\n offset,\n instanceCount\n ) {\n instancedArrays.drawElementsInstancedANGLE(\n mode,\n count,\n type,\n offset,\n instanceCount\n );\n };\n glDrawArraysInstanced = function (mode, first, count, instanceCount) {\n instancedArrays.drawArraysInstancedANGLE(\n mode,\n first,\n count,\n instanceCount\n );\n };\n glVertexAttribDivisor = function (index, divisor) {\n instancedArrays.vertexAttribDivisorANGLE(index, divisor);\n };\n }\n\n drawBuffers = getExtension(gl, [\"WEBGL_draw_buffers\"]);\n if (defined(drawBuffers)) {\n glDrawBuffers = function (buffers) {\n drawBuffers.drawBuffersWEBGL(buffers);\n };\n }\n }\n\n this.glCreateVertexArray = glCreateVertexArray;\n this.glBindVertexArray = glBindVertexArray;\n this.glDeleteVertexArray = glDeleteVertexArray;\n\n this.glDrawElementsInstanced = glDrawElementsInstanced;\n this.glDrawArraysInstanced = glDrawArraysInstanced;\n this.glVertexAttribDivisor = glVertexAttribDivisor;\n\n this.glDrawBuffers = glDrawBuffers;\n\n this._vertexArrayObject = !!vertexArrayObject;\n this._instancedArrays = !!instancedArrays;\n this._drawBuffers = !!drawBuffers;\n\n ContextLimits._maximumDrawBuffers = this.drawBuffers\n ? gl.getParameter(WebGLConstants.MAX_DRAW_BUFFERS)\n : 1;\n ContextLimits._maximumColorAttachments = this.drawBuffers\n ? gl.getParameter(WebGLConstants.MAX_COLOR_ATTACHMENTS)\n : 1;\n\n this._clearColor = new Color(0.0, 0.0, 0.0, 0.0);\n this._clearDepth = 1.0;\n this._clearStencil = 0;\n\n const us = new UniformState();\n const ps = new PassState(this);\n const rs = RenderState.fromCache();\n\n this._defaultPassState = ps;\n this._defaultRenderState = rs;\n // default texture has a value of (1, 1, 1)\n // default emissive texture has a value of (0, 0, 0)\n // default normal texture is +z which is encoded as (0.5, 0.5, 1)\n this._defaultTexture = undefined;\n this._defaultEmissiveTexture = undefined;\n this._defaultNormalTexture = undefined;\n this._defaultCubeMap = undefined;\n\n this._us = us;\n this._currentRenderState = rs;\n this._currentPassState = ps;\n this._currentFramebuffer = undefined;\n this._maxFrameTextureUnitIndex = 0;\n\n // Vertex attribute divisor state cache. Workaround for ANGLE (also look at VertexArray.setVertexAttribDivisor)\n this._vertexAttribDivisors = [];\n this._previousDrawInstanced = false;\n for (let i = 0; i < ContextLimits._maximumVertexAttributes; i++) {\n this._vertexAttribDivisors.push(0);\n }\n\n this._pickObjects = {};\n this._nextPickColor = new Uint32Array(1);\n\n /**\n * @example\n * {\n * webgl : {\n * alpha : false,\n * depth : true,\n * stencil : false,\n * antialias : true,\n * premultipliedAlpha : true,\n * preserveDrawingBuffer : false,\n * failIfMajorPerformanceCaveat : true\n * },\n * allowTextureFilterAnisotropic : true\n * }\n */\n this.options = options;\n\n /**\n * A cache of objects tied to this context. Just before the Context is destroyed,\n * <code>destroy</code> will be invoked on each object in this object literal that has\n * such a method. This is useful for caching any objects that might otherwise\n * be stored globally, except they're tied to a particular context, and to manage\n * their lifetime.\n *\n * @type {Object}\n */\n this.cache = {};\n\n RenderState.apply(gl, rs, ps);\n}\n\nconst defaultFramebufferMarker = {};\n\nObject.defineProperties(Context.prototype, {\n id: {\n get: function () {\n return this._id;\n },\n },\n webgl2: {\n get: function () {\n return this._webgl2;\n },\n },\n canvas: {\n get: function () {\n return this._canvas;\n },\n },\n shaderCache: {\n get: function () {\n return this._shaderCache;\n },\n },\n textureCache: {\n get: function () {\n return this._textureCache;\n },\n },\n uniformState: {\n get: function () {\n return this._us;\n },\n },\n\n /**\n * The number of stencil bits per pixel in the default bound framebuffer. The minimum is eight bits.\n * @memberof Context.prototype\n * @type {Number}\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>STENCIL_BITS</code>.\n */\n stencilBits: {\n get: function () {\n return this._stencilBits;\n },\n },\n\n /**\n * <code>true</code> if the WebGL context supports stencil buffers.\n * Stencil buffers are not supported by all systems.\n * @memberof Context.prototype\n * @type {Boolean}\n */\n stencilBuffer: {\n get: function () {\n return this._stencilBits >= 8;\n },\n },\n\n /**\n * <code>true</code> if the WebGL context supports antialiasing. By default\n * antialiasing is requested, but it is not supported by all systems.\n * @memberof Context.prototype\n * @type {Boolean}\n */\n antialias: {\n get: function () {\n return this._antialias;\n },\n },\n\n /**\n * <code>true</code> if the WebGL context supports multisample antialiasing. Requires\n * WebGL2.\n * @memberof Context.prototype\n * @type {Boolean}\n */\n msaa: {\n get: function () {\n return this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the OES_standard_derivatives extension is supported. This\n * extension provides access to <code>dFdx</code>, <code>dFdy</code>, and <code>fwidth</code>\n * functions from GLSL. A shader using these functions still needs to explicitly enable the\n * extension with <code>#extension GL_OES_standard_derivatives : enable</code>.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt|OES_standard_derivatives}\n */\n standardDerivatives: {\n get: function () {\n return this._standardDerivatives || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the EXT_float_blend extension is supported. This\n * extension enables blending with 32-bit float values.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_float_blend/}\n */\n floatBlend: {\n get: function () {\n return this._floatBlend;\n },\n },\n\n /**\n * <code>true</code> if the EXT_blend_minmax extension is supported. This\n * extension extends blending capabilities by adding two new blend equations:\n * the minimum or maximum color components of the source and destination colors.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/}\n */\n blendMinmax: {\n get: function () {\n return this._blendMinmax || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the OES_element_index_uint extension is supported. This\n * extension allows the use of unsigned int indices, which can improve performance by\n * eliminating batch breaking caused by unsigned short indices.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/|OES_element_index_uint}\n */\n elementIndexUint: {\n get: function () {\n return this._elementIndexUint || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_depth_texture is supported. This extension provides\n * access to depth textures that, for example, can be attached to framebuffers for shadow mapping.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\n depthTexture: {\n get: function () {\n return this._depthTexture || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if OES_texture_float is supported. This extension provides\n * access to floating point textures that, for example, can be attached to framebuffers for high dynamic range.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_float/}\n */\n floatingPointTexture: {\n get: function () {\n return this._webgl2 || this._textureFloat;\n },\n },\n\n /**\n * <code>true</code> if OES_texture_half_float is supported. This extension provides\n * access to floating point textures that, for example, can be attached to framebuffers for high dynamic range.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/}\n */\n halfFloatingPointTexture: {\n get: function () {\n return this._webgl2 || this._textureHalfFloat;\n },\n },\n\n /**\n * <code>true</code> if OES_texture_float_linear is supported. This extension provides\n * access to linear sampling methods for minification and magnification filters of floating-point textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/}\n */\n textureFloatLinear: {\n get: function () {\n return this._textureFloatLinear;\n },\n },\n\n /**\n * <code>true</code> if OES_texture_half_float_linear is supported. This extension provides\n * access to linear sampling methods for minification and magnification filters of half floating-point textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/}\n */\n textureHalfFloatLinear: {\n get: function () {\n return (\n (this._webgl2 && this._textureFloatLinear) ||\n (!this._webgl2 && this._textureHalfFloatLinear)\n );\n },\n },\n\n /**\n * <code>true</code> if EXT_texture_filter_anisotropic is supported. This extension provides\n * access to anisotropic filtering for textured surfaces at an oblique angle from the viewer.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/}\n */\n textureFilterAnisotropic: {\n get: function () {\n return !!this._textureFilterAnisotropic;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_compressed_texture_s3tc is supported. This extension provides\n * access to DXT compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/}\n */\n s3tc: {\n get: function () {\n return this._s3tc;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_compressed_texture_pvrtc is supported. This extension provides\n * access to PVR compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/}\n */\n pvrtc: {\n get: function () {\n return this._pvrtc;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_compressed_texture_astc is supported. This extension provides\n * access to ASTC compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/}\n */\n astc: {\n get: function () {\n return this._astc;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_compressed_texture_etc is supported. This extension provides\n * access to ETC compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/}\n */\n etc: {\n get: function () {\n return this._etc;\n },\n },\n\n /**\n * <code>true</code> if WEBGL_compressed_texture_etc1 is supported. This extension provides\n * access to ETC1 compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/}\n */\n etc1: {\n get: function () {\n return this._etc1;\n },\n },\n\n /**\n * <code>true</code> if EXT_texture_compression_bptc is supported. This extension provides\n * access to BC7 compressed textures.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_texture_compression_bptc/}\n */\n bc7: {\n get: function () {\n return this._bc7;\n },\n },\n\n /**\n * <code>true</code> if S3TC, PVRTC, ASTC, ETC, ETC1, or BC7 compression is supported.\n * @memberof Context.prototype\n * @type {Boolean}\n */\n supportsBasis: {\n get: function () {\n return (\n this._s3tc ||\n this._pvrtc ||\n this._astc ||\n this._etc ||\n this._etc1 ||\n this._bc7\n );\n },\n },\n\n /**\n * <code>true</code> if the OES_vertex_array_object extension is supported. This\n * extension can improve performance by reducing the overhead of switching vertex arrays.\n * When enabled, this extension is automatically used by {@link VertexArray}.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/|OES_vertex_array_object}\n */\n vertexArrayObject: {\n get: function () {\n return this._vertexArrayObject || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the EXT_frag_depth extension is supported. This\n * extension provides access to the <code>gl_FragDepthEXT</code> built-in output variable\n * from GLSL fragment shaders. A shader using these functions still needs to explicitly enable the\n * extension with <code>#extension GL_EXT_frag_depth : enable</code>.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/|EXT_frag_depth}\n */\n fragmentDepth: {\n get: function () {\n return this._fragDepth || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the ANGLE_instanced_arrays extension is supported. This\n * extension provides access to instanced rendering.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays}\n */\n instancedArrays: {\n get: function () {\n return this._instancedArrays || this._webgl2;\n },\n },\n\n /**\n * <code>true</code> if the EXT_color_buffer_float extension is supported. This\n * extension makes the gl.RGBA32F format color renderable.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/}\n */\n colorBufferFloat: {\n get: function () {\n return this._colorBufferFloat;\n },\n },\n\n /**\n * <code>true</code> if the EXT_color_buffer_half_float extension is supported. This\n * extension makes the format gl.RGBA16F format color renderable.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/}\n * @see {@link https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/}\n */\n colorBufferHalfFloat: {\n get: function () {\n return (\n (this._webgl2 && this._colorBufferFloat) ||\n (!this._webgl2 && this._colorBufferHalfFloat)\n );\n },\n },\n\n /**\n * <code>true</code> if the WEBGL_draw_buffers extension is supported. This\n * extensions provides support for multiple render targets. The framebuffer object can have mutiple\n * color attachments and the GLSL fragment shader can write to the built-in output array <code>gl_FragData</code>.\n * A shader using this feature needs to explicitly enable the extension with\n * <code>#extension GL_EXT_draw_buffers : enable</code>.\n * @memberof Context.prototype\n * @type {Boolean}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/|WEBGL_draw_buffers}\n */\n drawBuffers: {\n get: function () {\n return this._drawBuffers || this._webgl2;\n },\n },\n\n debugShaders: {\n get: function () {\n return this._debugShaders;\n },\n },\n\n throwOnWebGLError: {\n get: function () {\n return this._throwOnWebGLError;\n },\n set: function (value) {\n this._throwOnWebGLError = value;\n this._gl = wrapGL(\n this._originalGLContext,\n value ? throwOnError : undefined\n );\n },\n },\n\n /**\n * A 1x1 RGBA texture initialized to [255, 255, 255, 255]. This can\n * be used as a placeholder texture while other textures are downloaded.\n * @memberof Context.prototype\n * @type {Texture}\n */\n defaultTexture: {\n get: function () {\n if (this._defaultTexture === undefined) {\n this._defaultTexture = new Texture({\n context: this,\n source: {\n width: 1,\n height: 1,\n arrayBufferView: new Uint8Array([255, 255, 255, 255]),\n },\n flipY: false,\n });\n }\n\n return this._defaultTexture;\n },\n },\n /**\n * A 1x1 RGB texture initialized to [0, 0, 0] representing a material that is\n * not emissive. This can be used as a placeholder texture for emissive\n * textures while other textures are downloaded.\n * @memberof Context.prototype\n * @type {Texture}\n */\n defaultEmissiveTexture: {\n get: function () {\n if (this._defaultEmissiveTexture === undefined) {\n this._defaultEmissiveTexture = new Texture({\n context: this,\n pixelFormat: PixelFormat.RGB,\n source: {\n width: 1,\n height: 1,\n arrayBufferView: new Uint8Array([0, 0, 0]),\n },\n flipY: false,\n });\n }\n\n return this._defaultEmissiveTexture;\n },\n },\n /**\n * A 1x1 RGBA texture initialized to [128, 128, 255] to encode a tangent\n * space normal pointing in the +z direction, i.e. (0, 0, 1). This can\n * be used as a placeholder normal texture while other textures are\n * downloaded.\n * @memberof Context.prototype\n * @type {Texture}\n */\n defaultNormalTexture: {\n get: function () {\n if (this._defaultNormalTexture === undefined) {\n this._defaultNormalTexture = new Texture({\n context: this,\n pixelFormat: PixelFormat.RGB,\n source: {\n width: 1,\n height: 1,\n arrayBufferView: new Uint8Array([128, 128, 255]),\n },\n flipY: false,\n });\n }\n\n return this._defaultNormalTexture;\n },\n },\n\n /**\n * A cube map, where each face is a 1x1 RGBA texture initialized to\n * [255, 255, 255, 255]. This can be used as a placeholder cube map while\n * other cube maps are downloaded.\n * @memberof Context.prototype\n * @type {CubeMap}\n */\n defaultCubeMap: {\n get: function () {\n if (this._defaultCubeMap === undefined) {\n const face = {\n width: 1,\n height: 1,\n arrayBufferView: new Uint8Array([255, 255, 255, 255]),\n };\n\n this._defaultCubeMap = new CubeMap({\n context: this,\n source: {\n positiveX: face,\n negativeX: face,\n positiveY: face,\n negativeY: face,\n positiveZ: face,\n negativeZ: face,\n },\n flipY: false,\n });\n }\n\n return this._defaultCubeMap;\n },\n },\n\n /**\n * The drawingBufferHeight of the underlying GL context.\n * @memberof Context.prototype\n * @type {Number}\n * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}\n */\n drawingBufferHeight: {\n get: function () {\n return this._gl.drawingBufferHeight;\n },\n },\n\n /**\n * The drawingBufferWidth of the underlying GL context.\n * @memberof Context.prototype\n * @type {Number}\n * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferWidth|drawingBufferWidth}\n */\n drawingBufferWidth: {\n get: function () {\n return this._gl.drawingBufferWidth;\n },\n },\n\n /**\n * Gets an object representing the currently bound framebuffer. While this instance is not an actual\n * {@link Framebuffer}, it is used to represent the default framebuffer in calls to\n * {@link Texture.fromFramebuffer}.\n * @memberof Context.prototype\n * @type {Object}\n */\n defaultFramebuffer: {\n get: function () {\n return defaultFramebufferMarker;\n },\n },\n});\n\n/**\n * Validates a framebuffer.\n * Available in debug builds only.\n * @private\n */\nfunction validateFramebuffer(context) {\n}\n\nfunction applyRenderState(context, renderState, passState, clear) {\n const previousRenderState = context._currentRenderState;\n const previousPassState = context._currentPassState;\n context._currentRenderState = renderState;\n context._currentPassState = passState;\n RenderState.partialApply(\n context._gl,\n previousRenderState,\n renderState,\n previousPassState,\n passState,\n clear\n );\n}\n\nlet scratchBackBufferArray;\n// this check must use typeof, not defined, because defined doesn't work with undeclared variables.\nif (typeof WebGLRenderingContext !== \"undefined\") {\n scratchBackBufferArray = [WebGLConstants.BACK];\n}\n\nfunction bindFramebuffer(context, framebuffer) {\n if (framebuffer !== context._currentFramebuffer) {\n context._currentFramebuffer = framebuffer;\n let buffers = scratchBackBufferArray;\n\n if (defined(framebuffer)) {\n framebuffer._bind();\n validateFramebuffer(context);\n\n // TODO: Need a way for a command to give what draw buffers are active.\n buffers = framebuffer._getActiveColorAttachments();\n } else {\n const gl = context._gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n\n if (context.drawBuffers) {\n context.glDrawBuffers(buffers);\n }\n }\n}\n\nconst defaultClearCommand = new ClearCommand();\n\nContext.prototype.clear = function (clearCommand, passState) {\n clearCommand = defaultValue(clearCommand, defaultClearCommand);\n passState = defaultValue(passState, this._defaultPassState);\n\n const gl = this._gl;\n let bitmask = 0;\n\n const c = clearCommand.color;\n const d = clearCommand.depth;\n const s = clearCommand.stencil;\n\n if (defined(c)) {\n if (!Color.equals(this._clearColor, c)) {\n Color.clone(c, this._clearColor);\n gl.clearColor(c.red, c.green, c.blue, c.alpha);\n }\n bitmask |= gl.COLOR_BUFFER_BIT;\n }\n\n if (defined(d)) {\n if (d !== this._clearDepth) {\n this._clearDepth = d;\n gl.clearDepth(d);\n }\n bitmask |= gl.DEPTH_BUFFER_BIT;\n }\n\n if (defined(s)) {\n if (s !== this._clearStencil) {\n this._clearStencil = s;\n gl.clearStencil(s);\n }\n bitmask |= gl.STENCIL_BUFFER_BIT;\n }\n\n const rs = defaultValue(clearCommand.renderState, this._defaultRenderState);\n applyRenderState(this, rs, passState, true);\n\n // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering.\n const framebuffer = defaultValue(\n clearCommand.framebuffer,\n passState.framebuffer\n );\n bindFramebuffer(this, framebuffer);\n\n gl.clear(bitmask);\n};\n\nfunction beginDraw(\n context,\n framebuffer,\n passState,\n shaderProgram,\n renderState\n) {\n bindFramebuffer(context, framebuffer);\n applyRenderState(context, renderState, passState, false);\n shaderProgram._bind();\n context._maxFrameTextureUnitIndex = Math.max(\n context._maxFrameTextureUnitIndex,\n shaderProgram.maximumTextureUnitIndex\n );\n}\n\nfunction continueDraw(context, drawCommand, shaderProgram, uniformMap) {\n const primitiveType = drawCommand._primitiveType;\n const va = drawCommand._vertexArray;\n let offset = drawCommand._offset;\n let count = drawCommand._count;\n const instanceCount = drawCommand.instanceCount;\n\n context._us.model = defaultValue(drawCommand._modelMatrix, Matrix4.IDENTITY);\n shaderProgram._setUniforms(\n uniformMap,\n context._us,\n context.validateShaderProgram\n );\n\n va._bind();\n const indexBuffer = va.indexBuffer;\n\n if (defined(indexBuffer)) {\n offset = offset * indexBuffer.bytesPerIndex; // offset in vertices to offset in bytes\n count = defaultValue(count, indexBuffer.numberOfIndices);\n if (instanceCount === 0) {\n context._gl.drawElements(\n primitiveType,\n count,\n indexBuffer.indexDatatype,\n offset\n );\n } else {\n context.glDrawElementsInstanced(\n primitiveType,\n count,\n indexBuffer.indexDatatype,\n offset,\n instanceCount\n );\n }\n } else {\n count = defaultValue(count, va.numberOfVertices);\n if (instanceCount === 0) {\n context._gl.drawArrays(primitiveType, offset, count);\n } else {\n context.glDrawArraysInstanced(\n primitiveType,\n offset,\n count,\n instanceCount\n );\n }\n }\n\n va._unBind();\n}\n\nContext.prototype.draw = function (\n drawCommand,\n passState,\n shaderProgram,\n uniformMap\n) {\n passState = defaultValue(passState, this._defaultPassState);\n // The command's framebuffer takes presidence over the pass' framebuffer, e.g., for off-screen rendering.\n const framebuffer = defaultValue(\n drawCommand._framebuffer,\n passState.framebuffer\n );\n const renderState = defaultValue(\n drawCommand._renderState,\n this._defaultRenderState\n );\n shaderProgram = defaultValue(shaderProgram, drawCommand._shaderProgram);\n uniformMap = defaultValue(uniformMap, drawCommand._uniformMap);\n\n beginDraw(this, framebuffer, passState, shaderProgram, renderState);\n continueDraw(this, drawCommand, shaderProgram, uniformMap);\n};\n\nContext.prototype.endFrame = function () {\n const gl = this._gl;\n gl.useProgram(null);\n\n this._currentFramebuffer = undefined;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n const buffers = scratchBackBufferArray;\n if (this.drawBuffers) {\n this.glDrawBuffers(buffers);\n }\n\n const length = this._maxFrameTextureUnitIndex;\n this._maxFrameTextureUnitIndex = 0;\n\n for (let i = 0; i < length; ++i) {\n gl.activeTexture(gl.TEXTURE0 + i);\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n }\n};\n\nContext.prototype.readPixels = function (readState) {\n const gl = this._gl;\n\n readState = defaultValue(readState, defaultValue.EMPTY_OBJECT);\n const x = Math.max(defaultValue(readState.x, 0), 0);\n const y = Math.max(defaultValue(readState.y, 0), 0);\n const width = defaultValue(readState.width, gl.drawingBufferWidth);\n const height = defaultValue(readState.height, gl.drawingBufferHeight);\n const framebuffer = readState.framebuffer;\n\n let pixelDatatype = PixelDatatype.UNSIGNED_BYTE;\n if (defined(framebuffer) && framebuffer.numberOfColorAttachments > 0) {\n pixelDatatype = framebuffer.getColorTexture(0).pixelDatatype;\n }\n\n const pixels = PixelFormat.createTypedArray(\n PixelFormat.RGBA,\n pixelDatatype,\n width,\n height\n );\n\n bindFramebuffer(this, framebuffer);\n\n gl.readPixels(\n x,\n y,\n width,\n height,\n PixelFormat.RGBA,\n PixelDatatype.toWebGLConstant(pixelDatatype, this),\n pixels\n );\n\n return pixels;\n};\n\nconst viewportQuadAttributeLocations = {\n position: 0,\n textureCoordinates: 1,\n};\n\nContext.prototype.getViewportQuadVertexArray = function () {\n // Per-context cache for viewport quads\n let vertexArray = this.cache.viewportQuad_vertexArray;\n\n if (!defined(vertexArray)) {\n const geometry = new Geometry({\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: [-1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0],\n }),\n\n textureCoordinates: new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0],\n }),\n },\n // Workaround Internet Explorer 11.0.8 lack of TRIANGLE_FAN\n indices: new Uint16Array([0, 1, 2, 0, 2, 3]),\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n vertexArray = VertexArray.fromGeometry({\n context: this,\n geometry: geometry,\n attributeLocations: viewportQuadAttributeLocations,\n bufferUsage: BufferUsage.STATIC_DRAW,\n interleave: true,\n });\n\n this.cache.viewportQuad_vertexArray = vertexArray;\n }\n\n return vertexArray;\n};\n\nContext.prototype.createViewportQuadCommand = function (\n fragmentShaderSource,\n overrides\n) {\n overrides = defaultValue(overrides, defaultValue.EMPTY_OBJECT);\n\n return new DrawCommand({\n vertexArray: this.getViewportQuadVertexArray(),\n primitiveType: PrimitiveType.TRIANGLES,\n renderState: overrides.renderState,\n shaderProgram: ShaderProgram.fromCache({\n context: this,\n vertexShaderSource: ViewportQuadVS,\n fragmentShaderSource: fragmentShaderSource,\n attributeLocations: viewportQuadAttributeLocations,\n }),\n uniformMap: overrides.uniformMap,\n owner: overrides.owner,\n framebuffer: overrides.framebuffer,\n pass: overrides.pass,\n });\n};\n\n/**\n * Gets the object associated with a pick color.\n *\n * @param {Color} pickColor The pick color.\n * @returns {Object} The object associated with the pick color, or undefined if no object is associated with that color.\n *\n * @example\n * const object = context.getObjectByPickColor(pickColor);\n *\n * @see Context#createPickId\n */\nContext.prototype.getObjectByPickColor = function (pickColor) {\n return this._pickObjects[pickColor.toRgba()];\n};\n\nfunction PickId(pickObjects, key, color) {\n this._pickObjects = pickObjects;\n this.key = key;\n this.color = color;\n}\n\nObject.defineProperties(PickId.prototype, {\n object: {\n get: function () {\n return this._pickObjects[this.key];\n },\n set: function (value) {\n this._pickObjects[this.key] = value;\n },\n },\n});\n\nPickId.prototype.destroy = function () {\n delete this._pickObjects[this.key];\n return undefined;\n};\n\n/**\n * Creates a unique ID associated with the input object for use with color-buffer picking.\n * The ID has an RGBA color value unique to this context. You must call destroy()\n * on the pick ID when destroying the input object.\n *\n * @param {Object} object The object to associate with the pick ID.\n * @returns {Object} A PickId object with a <code>color</code> property.\n *\n * @exception {RuntimeError} Out of unique Pick IDs.\n *\n *\n * @example\n * this._pickId = context.createPickId({\n * primitive : this,\n * id : this.id\n * });\n *\n * @see Context#getObjectByPickColor\n */\nContext.prototype.createPickId = function (object) {\n // the increment and assignment have to be separate statements to\n // actually detect overflow in the Uint32 value\n ++this._nextPickColor[0];\n const key = this._nextPickColor[0];\n if (key === 0) {\n // In case of overflow\n throw new RuntimeError(\"Out of unique Pick IDs.\");\n }\n\n this._pickObjects[key] = object;\n return new PickId(this._pickObjects, key, Color.fromRgba(key));\n};\n\nContext.prototype.isDestroyed = function () {\n return false;\n};\n\nContext.prototype.destroy = function () {\n // Destroy all objects in the cache that have a destroy method.\n const cache = this.cache;\n for (const property in cache) {\n if (cache.hasOwnProperty(property)) {\n const propertyValue = cache[property];\n if (defined(propertyValue.destroy)) {\n propertyValue.destroy();\n }\n }\n }\n\n this._shaderCache = this._shaderCache.destroy();\n this._textureCache = this._textureCache.destroy();\n this._defaultTexture = this._defaultTexture && this._defaultTexture.destroy();\n this._defaultEmissiveTexture =\n this._defaultEmissiveTexture && this._defaultEmissiveTexture.destroy();\n this._defaultNormalTexture =\n this._defaultNormalTexture && this._defaultNormalTexture.destroy();\n this._defaultCubeMap = this._defaultCubeMap && this._defaultCubeMap.destroy();\n\n return destroyObject(this);\n};\nexport default Context;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport CubeMap from \"./CubeMap.js\";\n\n/**\n * Asynchronously loads six images and creates a cube map. Returns a promise that\n * will resolve to a {@link CubeMap} once loaded, or reject if any image fails to load.\n *\n * @function loadCubeMap\n *\n * @param {Context} context The context to use to create the cube map.\n * @param {Object} urls The source URL of each image. See the example below.\n * @param {Boolean} [skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the images will be ignored.\n * @returns {Promise.<CubeMap>} a promise that will resolve to the requested {@link CubeMap} when loaded.\n *\n * @exception {DeveloperError} context is required.\n * @exception {DeveloperError} urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\n *\n *\n * @example\n * Cesium.loadCubeMap(context, {\n * positiveX : 'skybox_px.png',\n * negativeX : 'skybox_nx.png',\n * positiveY : 'skybox_py.png',\n * negativeY : 'skybox_ny.png',\n * positiveZ : 'skybox_pz.png',\n * negativeZ : 'skybox_nz.png'\n * }).then(function(cubeMap) {\n * // use the cubemap\n * }).catch(function(error) {\n * // an error occurred\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\n *\n * @private\n */\nfunction loadCubeMap(context, urls, skipColorSpaceConversion) {\n // PERFORMANCE_IDEA: Given the size of some cube maps, we should consider tiling them, which\n // would prevent hiccups when uploading, for example, six 4096x4096 textures to the GPU.\n //\n // Also, it is perhaps acceptable to use the context here in the callbacks, but\n // ideally, we would do it in the primitive's update function.\n const flipOptions = {\n flipY: true,\n skipColorSpaceConversion: skipColorSpaceConversion,\n preferImageBitmap: true,\n };\n\n const facePromises = [\n Resource.createIfNeeded(urls.positiveX).fetchImage(flipOptions),\n Resource.createIfNeeded(urls.negativeX).fetchImage(flipOptions),\n Resource.createIfNeeded(urls.positiveY).fetchImage(flipOptions),\n Resource.createIfNeeded(urls.negativeY).fetchImage(flipOptions),\n Resource.createIfNeeded(urls.positiveZ).fetchImage(flipOptions),\n Resource.createIfNeeded(urls.negativeZ).fetchImage(flipOptions),\n ];\n\n return Promise.all(facePromises).then(function (images) {\n return new CubeMap({\n context: context,\n source: {\n positiveX: images[0],\n negativeX: images[1],\n positiveY: images[2],\n negativeY: images[3],\n positiveZ: images[4],\n negativeZ: images[5],\n },\n });\n });\n}\nexport default loadCubeMap;\n", "/**\n * The encoding that is used for a heightmap\n *\n * @enum {Number}\n */\nconst HeightmapEncoding = {\n /**\n * No encoding\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * LERC encoding\n *\n * @type {Number}\n * @constant\n *\n * @see {@link https://github.com/Esri/lerc|The LERC specification}\n */\n LERC: 1,\n};\nexport default Object.freeze(HeightmapEncoding);\n", "/**\n * This enumerated type is used to determine how the vertices of the terrain mesh are compressed.\n *\n * @enum {Number}\n *\n * @private\n */\nconst TerrainQuantization = {\n /**\n * The vertices are not compressed.\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * The vertices are compressed to 12 bits.\n *\n * @type {Number}\n * @constant\n */\n BITS12: 1,\n};\nexport default Object.freeze(TerrainQuantization);\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport TerrainExaggeration from \"./TerrainExaggeration.js\";\nimport TerrainQuantization from \"./TerrainQuantization.js\";\n\nconst cartesian3Scratch = new Cartesian3();\nconst cartesian3DimScratch = new Cartesian3();\nconst cartesian2Scratch = new Cartesian2();\nconst matrix4Scratch = new Matrix4();\nconst matrix4Scratch2 = new Matrix4();\n\nconst SHIFT_LEFT_12 = Math.pow(2.0, 12.0);\n\n/**\n * Data used to quantize and pack the terrain mesh. The position can be unpacked for picking and all attributes\n * are unpacked in the vertex shader.\n *\n * @alias TerrainEncoding\n * @constructor\n *\n * @param {Cartesian3} center The center point of the vertices.\n * @param {AxisAlignedBoundingBox} axisAlignedBoundingBox The bounds of the tile in the east-north-up coordinates at the tiles center.\n * @param {Number} minimumHeight The minimum height.\n * @param {Number} maximumHeight The maximum height.\n * @param {Matrix4} fromENU The east-north-up to fixed frame matrix at the center of the terrain mesh.\n * @param {Boolean} hasVertexNormals If the mesh has vertex normals.\n * @param {Boolean} [hasWebMercatorT=false] true if the terrain data includes a Web Mercator texture coordinate; otherwise, false.\n * @param {Boolean} [hasGeodeticSurfaceNormals=false] true if the terrain data includes geodetic surface normals; otherwise, false.\n * @param {Number} [exaggeration=1.0] A scalar used to exaggerate terrain.\n * @param {Number} [exaggerationRelativeHeight=0.0] The relative height from which terrain is exaggerated.\n *\n * @private\n */\nfunction TerrainEncoding(\n center,\n axisAlignedBoundingBox,\n minimumHeight,\n maximumHeight,\n fromENU,\n hasVertexNormals,\n hasWebMercatorT,\n hasGeodeticSurfaceNormals,\n exaggeration,\n exaggerationRelativeHeight\n) {\n let quantization = TerrainQuantization.NONE;\n let toENU;\n let matrix;\n\n if (\n defined(axisAlignedBoundingBox) &&\n defined(minimumHeight) &&\n defined(maximumHeight) &&\n defined(fromENU)\n ) {\n const minimum = axisAlignedBoundingBox.minimum;\n const maximum = axisAlignedBoundingBox.maximum;\n\n const dimensions = Cartesian3.subtract(\n maximum,\n minimum,\n cartesian3DimScratch\n );\n const hDim = maximumHeight - minimumHeight;\n const maxDim = Math.max(Cartesian3.maximumComponent(dimensions), hDim);\n\n if (maxDim < SHIFT_LEFT_12 - 1.0) {\n quantization = TerrainQuantization.BITS12;\n } else {\n quantization = TerrainQuantization.NONE;\n }\n\n toENU = Matrix4.inverseTransformation(fromENU, new Matrix4());\n\n const translation = Cartesian3.negate(minimum, cartesian3Scratch);\n Matrix4.multiply(\n Matrix4.fromTranslation(translation, matrix4Scratch),\n toENU,\n toENU\n );\n\n const scale = cartesian3Scratch;\n scale.x = 1.0 / dimensions.x;\n scale.y = 1.0 / dimensions.y;\n scale.z = 1.0 / dimensions.z;\n Matrix4.multiply(Matrix4.fromScale(scale, matrix4Scratch), toENU, toENU);\n\n matrix = Matrix4.clone(fromENU);\n Matrix4.setTranslation(matrix, Cartesian3.ZERO, matrix);\n\n fromENU = Matrix4.clone(fromENU, new Matrix4());\n\n const translationMatrix = Matrix4.fromTranslation(minimum, matrix4Scratch);\n const scaleMatrix = Matrix4.fromScale(dimensions, matrix4Scratch2);\n const st = Matrix4.multiply(translationMatrix, scaleMatrix, matrix4Scratch);\n\n Matrix4.multiply(fromENU, st, fromENU);\n Matrix4.multiply(matrix, st, matrix);\n }\n\n /**\n * How the vertices of the mesh were compressed.\n * @type {TerrainQuantization}\n */\n this.quantization = quantization;\n\n /**\n * The minimum height of the tile including the skirts.\n * @type {Number}\n */\n this.minimumHeight = minimumHeight;\n\n /**\n * The maximum height of the tile.\n * @type {Number}\n */\n this.maximumHeight = maximumHeight;\n\n /**\n * The center of the tile.\n * @type {Cartesian3}\n */\n this.center = Cartesian3.clone(center);\n\n /**\n * A matrix that takes a vertex from the tile, transforms it to east-north-up at the center and scales\n * it so each component is in the [0, 1] range.\n * @type {Matrix4}\n */\n this.toScaledENU = toENU;\n\n /**\n * A matrix that restores a vertex transformed with toScaledENU back to the earth fixed reference frame\n * @type {Matrix4}\n */\n this.fromScaledENU = fromENU;\n\n /**\n * The matrix used to decompress the terrain vertices in the shader for RTE rendering.\n * @type {Matrix4}\n */\n this.matrix = matrix;\n\n /**\n * The terrain mesh contains normals.\n * @type {Boolean}\n */\n this.hasVertexNormals = hasVertexNormals;\n\n /**\n * The terrain mesh contains a vertical texture coordinate following the Web Mercator projection.\n * @type {Boolean}\n */\n this.hasWebMercatorT = defaultValue(hasWebMercatorT, false);\n\n /**\n * The terrain mesh contains geodetic surface normals, used for terrain exaggeration.\n * @type {Boolean}\n */\n this.hasGeodeticSurfaceNormals = defaultValue(\n hasGeodeticSurfaceNormals,\n false\n );\n\n /**\n * A scalar used to exaggerate terrain.\n * @type {Number}\n */\n this.exaggeration = defaultValue(exaggeration, 1.0);\n\n /**\n * The relative height from which terrain is exaggerated.\n */\n this.exaggerationRelativeHeight = defaultValue(\n exaggerationRelativeHeight,\n 0.0\n );\n\n /**\n * The number of components in each vertex. This value can differ with different quantizations.\n * @type {Number}\n */\n this.stride = 0;\n\n this._offsetGeodeticSurfaceNormal = 0;\n this._offsetVertexNormal = 0;\n\n // Calculate the stride and offsets declared above\n this._calculateStrideAndOffsets();\n}\n\nTerrainEncoding.prototype.encode = function (\n vertexBuffer,\n bufferIndex,\n position,\n uv,\n height,\n normalToPack,\n webMercatorT,\n geodeticSurfaceNormal\n) {\n const u = uv.x;\n const v = uv.y;\n\n if (this.quantization === TerrainQuantization.BITS12) {\n position = Matrix4.multiplyByPoint(\n this.toScaledENU,\n position,\n cartesian3Scratch\n );\n\n position.x = CesiumMath.clamp(position.x, 0.0, 1.0);\n position.y = CesiumMath.clamp(position.y, 0.0, 1.0);\n position.z = CesiumMath.clamp(position.z, 0.0, 1.0);\n\n const hDim = this.maximumHeight - this.minimumHeight;\n const h = CesiumMath.clamp((height - this.minimumHeight) / hDim, 0.0, 1.0);\n\n Cartesian2.fromElements(position.x, position.y, cartesian2Scratch);\n const compressed0 = AttributeCompression.compressTextureCoordinates(\n cartesian2Scratch\n );\n\n Cartesian2.fromElements(position.z, h, cartesian2Scratch);\n const compressed1 = AttributeCompression.compressTextureCoordinates(\n cartesian2Scratch\n );\n\n Cartesian2.fromElements(u, v, cartesian2Scratch);\n const compressed2 = AttributeCompression.compressTextureCoordinates(\n cartesian2Scratch\n );\n\n vertexBuffer[bufferIndex++] = compressed0;\n vertexBuffer[bufferIndex++] = compressed1;\n vertexBuffer[bufferIndex++] = compressed2;\n\n if (this.hasWebMercatorT) {\n Cartesian2.fromElements(webMercatorT, 0.0, cartesian2Scratch);\n const compressed3 = AttributeCompression.compressTextureCoordinates(\n cartesian2Scratch\n );\n vertexBuffer[bufferIndex++] = compressed3;\n }\n } else {\n Cartesian3.subtract(position, this.center, cartesian3Scratch);\n\n vertexBuffer[bufferIndex++] = cartesian3Scratch.x;\n vertexBuffer[bufferIndex++] = cartesian3Scratch.y;\n vertexBuffer[bufferIndex++] = cartesian3Scratch.z;\n vertexBuffer[bufferIndex++] = height;\n vertexBuffer[bufferIndex++] = u;\n vertexBuffer[bufferIndex++] = v;\n\n if (this.hasWebMercatorT) {\n vertexBuffer[bufferIndex++] = webMercatorT;\n }\n }\n\n if (this.hasVertexNormals) {\n vertexBuffer[bufferIndex++] = AttributeCompression.octPackFloat(\n normalToPack\n );\n }\n\n if (this.hasGeodeticSurfaceNormals) {\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.x;\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.y;\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.z;\n }\n\n return bufferIndex;\n};\n\nconst scratchPosition = new Cartesian3();\nconst scratchGeodeticSurfaceNormal = new Cartesian3();\n\nTerrainEncoding.prototype.addGeodeticSurfaceNormals = function (\n oldBuffer,\n newBuffer,\n ellipsoid\n) {\n if (this.hasGeodeticSurfaceNormals) {\n return;\n }\n\n const oldStride = this.stride;\n const vertexCount = oldBuffer.length / oldStride;\n this.hasGeodeticSurfaceNormals = true;\n this._calculateStrideAndOffsets();\n const newStride = this.stride;\n\n for (let index = 0; index < vertexCount; index++) {\n for (let offset = 0; offset < oldStride; offset++) {\n const oldIndex = index * oldStride + offset;\n const newIndex = index * newStride + offset;\n newBuffer[newIndex] = oldBuffer[oldIndex];\n }\n const position = this.decodePosition(newBuffer, index, scratchPosition);\n const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n position,\n scratchGeodeticSurfaceNormal\n );\n\n const bufferIndex = index * newStride + this._offsetGeodeticSurfaceNormal;\n newBuffer[bufferIndex] = geodeticSurfaceNormal.x;\n newBuffer[bufferIndex + 1] = geodeticSurfaceNormal.y;\n newBuffer[bufferIndex + 2] = geodeticSurfaceNormal.z;\n }\n};\n\nTerrainEncoding.prototype.removeGeodeticSurfaceNormals = function (\n oldBuffer,\n newBuffer\n) {\n if (!this.hasGeodeticSurfaceNormals) {\n return;\n }\n\n const oldStride = this.stride;\n const vertexCount = oldBuffer.length / oldStride;\n this.hasGeodeticSurfaceNormals = false;\n this._calculateStrideAndOffsets();\n const newStride = this.stride;\n\n for (let index = 0; index < vertexCount; index++) {\n for (let offset = 0; offset < newStride; offset++) {\n const oldIndex = index * oldStride + offset;\n const newIndex = index * newStride + offset;\n newBuffer[newIndex] = oldBuffer[oldIndex];\n }\n }\n};\n\nTerrainEncoding.prototype.decodePosition = function (buffer, index, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n index *= this.stride;\n\n if (this.quantization === TerrainQuantization.BITS12) {\n const xy = AttributeCompression.decompressTextureCoordinates(\n buffer[index],\n cartesian2Scratch\n );\n result.x = xy.x;\n result.y = xy.y;\n\n const zh = AttributeCompression.decompressTextureCoordinates(\n buffer[index + 1],\n cartesian2Scratch\n );\n result.z = zh.x;\n\n return Matrix4.multiplyByPoint(this.fromScaledENU, result, result);\n }\n\n result.x = buffer[index];\n result.y = buffer[index + 1];\n result.z = buffer[index + 2];\n return Cartesian3.add(result, this.center, result);\n};\n\nTerrainEncoding.prototype.getExaggeratedPosition = function (\n buffer,\n index,\n result\n) {\n result = this.decodePosition(buffer, index, result);\n\n const exaggeration = this.exaggeration;\n const exaggerationRelativeHeight = this.exaggerationRelativeHeight;\n const hasExaggeration = exaggeration !== 1.0;\n if (hasExaggeration && this.hasGeodeticSurfaceNormals) {\n const geodeticSurfaceNormal = this.decodeGeodeticSurfaceNormal(\n buffer,\n index,\n scratchGeodeticSurfaceNormal\n );\n const rawHeight = this.decodeHeight(buffer, index);\n const heightDifference =\n TerrainExaggeration.getHeight(\n rawHeight,\n exaggeration,\n exaggerationRelativeHeight\n ) - rawHeight;\n\n // some math is unrolled for better performance\n result.x += geodeticSurfaceNormal.x * heightDifference;\n result.y += geodeticSurfaceNormal.y * heightDifference;\n result.z += geodeticSurfaceNormal.z * heightDifference;\n }\n\n return result;\n};\n\nTerrainEncoding.prototype.decodeTextureCoordinates = function (\n buffer,\n index,\n result\n) {\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n index *= this.stride;\n\n if (this.quantization === TerrainQuantization.BITS12) {\n return AttributeCompression.decompressTextureCoordinates(\n buffer[index + 2],\n result\n );\n }\n\n return Cartesian2.fromElements(buffer[index + 4], buffer[index + 5], result);\n};\n\nTerrainEncoding.prototype.decodeHeight = function (buffer, index) {\n index *= this.stride;\n\n if (this.quantization === TerrainQuantization.BITS12) {\n const zh = AttributeCompression.decompressTextureCoordinates(\n buffer[index + 1],\n cartesian2Scratch\n );\n return (\n zh.y * (this.maximumHeight - this.minimumHeight) + this.minimumHeight\n );\n }\n\n return buffer[index + 3];\n};\n\nTerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) {\n index *= this.stride;\n\n if (this.quantization === TerrainQuantization.BITS12) {\n return AttributeCompression.decompressTextureCoordinates(\n buffer[index + 3],\n cartesian2Scratch\n ).x;\n }\n\n return buffer[index + 6];\n};\n\nTerrainEncoding.prototype.getOctEncodedNormal = function (\n buffer,\n index,\n result\n) {\n index = index * this.stride + this._offsetVertexNormal;\n\n const temp = buffer[index] / 256.0;\n const x = Math.floor(temp);\n const y = (temp - x) * 256.0;\n\n return Cartesian2.fromElements(x, y, result);\n};\n\nTerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function (\n buffer,\n index,\n result\n) {\n index = index * this.stride + this._offsetGeodeticSurfaceNormal;\n\n result.x = buffer[index];\n result.y = buffer[index + 1];\n result.z = buffer[index + 2];\n return result;\n};\n\nTerrainEncoding.prototype._calculateStrideAndOffsets = function () {\n let vertexStride = 0;\n\n switch (this.quantization) {\n case TerrainQuantization.BITS12:\n vertexStride += 3;\n break;\n default:\n vertexStride += 6;\n }\n if (this.hasWebMercatorT) {\n vertexStride += 1;\n }\n if (this.hasVertexNormals) {\n this._offsetVertexNormal = vertexStride;\n vertexStride += 1;\n }\n if (this.hasGeodeticSurfaceNormals) {\n this._offsetGeodeticSurfaceNormal = vertexStride;\n vertexStride += 3;\n }\n\n this.stride = vertexStride;\n};\n\nconst attributesIndicesNone = {\n position3DAndHeight: 0,\n textureCoordAndEncodedNormals: 1,\n geodeticSurfaceNormal: 2,\n};\nconst attributesIndicesBits12 = {\n compressed0: 0,\n compressed1: 1,\n geodeticSurfaceNormal: 2,\n};\n\nTerrainEncoding.prototype.getAttributes = function (buffer) {\n const datatype = ComponentDatatype.FLOAT;\n const sizeInBytes = ComponentDatatype.getSizeInBytes(datatype);\n const strideInBytes = this.stride * sizeInBytes;\n let offsetInBytes = 0;\n\n const attributes = [];\n function addAttribute(index, componentsPerAttribute) {\n attributes.push({\n index: index,\n vertexBuffer: buffer,\n componentDatatype: datatype,\n componentsPerAttribute: componentsPerAttribute,\n offsetInBytes: offsetInBytes,\n strideInBytes: strideInBytes,\n });\n offsetInBytes += componentsPerAttribute * sizeInBytes;\n }\n\n if (this.quantization === TerrainQuantization.NONE) {\n addAttribute(attributesIndicesNone.position3DAndHeight, 4);\n\n let componentsTexCoordAndNormals = 2;\n componentsTexCoordAndNormals += this.hasWebMercatorT ? 1 : 0;\n componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0;\n addAttribute(\n attributesIndicesNone.textureCoordAndEncodedNormals,\n componentsTexCoordAndNormals\n );\n\n if (this.hasGeodeticSurfaceNormals) {\n addAttribute(attributesIndicesNone.geodeticSurfaceNormal, 3);\n }\n } else {\n // When there is no webMercatorT or vertex normals, the attribute only needs 3 components: x/y, z/h, u/v.\n // WebMercatorT and vertex normals each take up one component, so if only one of them is present the first\n // attribute gets a 4th component. If both are present, we need an additional attribute that has 1 component.\n const usingAttribute0Component4 =\n this.hasWebMercatorT || this.hasVertexNormals;\n const usingAttribute1Component1 =\n this.hasWebMercatorT && this.hasVertexNormals;\n addAttribute(\n attributesIndicesBits12.compressed0,\n usingAttribute0Component4 ? 4 : 3\n );\n\n if (usingAttribute1Component1) {\n addAttribute(attributesIndicesBits12.compressed1, 1);\n }\n\n if (this.hasGeodeticSurfaceNormals) {\n addAttribute(attributesIndicesBits12.geodeticSurfaceNormal, 3);\n }\n }\n\n return attributes;\n};\n\nTerrainEncoding.prototype.getAttributeLocations = function () {\n if (this.quantization === TerrainQuantization.NONE) {\n return attributesIndicesNone;\n }\n return attributesIndicesBits12;\n};\n\nTerrainEncoding.clone = function (encoding, result) {\n if (!defined(encoding)) {\n return undefined;\n }\n if (!defined(result)) {\n result = new TerrainEncoding();\n }\n\n result.quantization = encoding.quantization;\n result.minimumHeight = encoding.minimumHeight;\n result.maximumHeight = encoding.maximumHeight;\n result.center = Cartesian3.clone(encoding.center);\n result.toScaledENU = Matrix4.clone(encoding.toScaledENU);\n result.fromScaledENU = Matrix4.clone(encoding.fromScaledENU);\n result.matrix = Matrix4.clone(encoding.matrix);\n result.hasVertexNormals = encoding.hasVertexNormals;\n result.hasWebMercatorT = encoding.hasWebMercatorT;\n result.hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;\n result.exaggeration = encoding.exaggeration;\n result.exaggerationRelativeHeight = encoding.exaggerationRelativeHeight;\n\n result._calculateStrideAndOffsets();\n\n return result;\n};\nexport default TerrainEncoding;\n", "import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidalOccluder from \"./EllipsoidalOccluder.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport Transforms from \"./Transforms.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\n/**\n * Contains functions to create a mesh from a heightmap image.\n *\n * @namespace HeightmapTessellator\n *\n * @private\n */\nconst HeightmapTessellator = {};\n\n/**\n * The default structure of a heightmap, as given to {@link HeightmapTessellator.computeVertices}.\n *\n * @constant\n */\nHeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({\n heightScale: 1.0,\n heightOffset: 0.0,\n elementsPerHeight: 1,\n stride: 1,\n elementMultiplier: 256.0,\n isBigEndian: false,\n});\n\nconst cartesian3Scratch = new Cartesian3();\nconst matrix4Scratch = new Matrix4();\nconst minimumScratch = new Cartesian3();\nconst maximumScratch = new Cartesian3();\n\n/**\n * Fills an array of vertices from a heightmap image.\n *\n * @param {Object} options Object with the following properties:\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate.\n * @param {Number} options.width The width of the heightmap, in height samples.\n * @param {Number} options.height The height of the heightmap, in height samples.\n * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap.\n * @param {Rectangle} options.nativeRectangle A rectangle in the native coordinates of the heightmap's projection. For\n * a heightmap with a geographic projection, this is degrees. For the web mercator\n * projection, this is meters.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\n * @param {Rectangle} [options.rectangle] The rectangle covered by the heightmap, in geodetic coordinates with north, south, east and\n * west properties in radians. Either rectangle or nativeRectangle must be provided. If both\n * are provided, they're assumed to be consistent.\n * @param {Boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses\n * a {@link WebMercatorProjection}.\n * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as <code>Cartesian3.subtract(worldPosition, relativeToCenter)</code>.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies.\n * @param {Object} [options.structure] An object describing the structure of the height data.\n * @param {Number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain\n * the height above the heightOffset, in meters. The heightOffset is added to the resulting\n * height after multiplying by the scale.\n * @param {Number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final\n * height in meters. The offset is added after the height sample is multiplied by the\n * heightScale.\n * @param {Number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height\n * sample. This is usually 1, indicating that each element is a separate height sample. If\n * it is greater than 1, that number of elements together form the height sample, which is\n * computed according to the structure.elementMultiplier and structure.isBigEndian properties.\n * @param {Number} [options.structure.stride=1] The number of elements to skip to get from the first element of\n * one height to the first element of the next height.\n * @param {Number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the\n * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier\n * is 256, the height is computed as follows:\n * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`\n * This is assuming that the isBigEndian property is false. If it is true, the order of the\n * elements is reversed.\n * @param {Number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer. Any heights that are lower\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\n * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is\n * not specified, no minimum value is enforced.\n * @param {Number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer. Any heights that are higher\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\n * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger\n * than 65535. If this parameter is not specified, no maximum value is enforced.\n * @param {Boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the\n * stride property is greater than 1. If this property is false, the first element is the\n * low-order element. If it is true, the first element is the high-order element.\n *\n * @example\n * const width = 5;\n * const height = 5;\n * const statistics = Cesium.HeightmapTessellator.computeVertices({\n * heightmap : [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],\n * width : width,\n * height : height,\n * skirtHeight : 0.0,\n * nativeRectangle : {\n * west : 10.0,\n * east : 20.0,\n * south : 30.0,\n * north : 40.0\n * }\n * });\n *\n * const encoding = statistics.encoding;\n * const position = encoding.decodePosition(statistics.vertices, index);\n */\nHeightmapTessellator.computeVertices = function (options) {\n // This function tends to be a performance hotspot for terrain rendering,\n // so it employs a lot of inlining and unrolling as an optimization.\n // In particular, the functionality of Ellipsoid.cartographicToCartesian\n // is inlined.\n\n const cos = Math.cos;\n const sin = Math.sin;\n const sqrt = Math.sqrt;\n const atan = Math.atan;\n const exp = Math.exp;\n const piOverTwo = CesiumMath.PI_OVER_TWO;\n const toRadians = CesiumMath.toRadians;\n\n const heightmap = options.heightmap;\n const width = options.width;\n const height = options.height;\n const skirtHeight = options.skirtHeight;\n const hasSkirts = skirtHeight > 0.0;\n\n const isGeographic = defaultValue(options.isGeographic, true);\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n const oneOverGlobeSemimajorAxis = 1.0 / ellipsoid.maximumRadius;\n\n const nativeRectangle = Rectangle.clone(options.nativeRectangle);\n const rectangle = Rectangle.clone(options.rectangle);\n\n let geographicWest;\n let geographicSouth;\n let geographicEast;\n let geographicNorth;\n\n if (!defined(rectangle)) {\n if (isGeographic) {\n geographicWest = toRadians(nativeRectangle.west);\n geographicSouth = toRadians(nativeRectangle.south);\n geographicEast = toRadians(nativeRectangle.east);\n geographicNorth = toRadians(nativeRectangle.north);\n } else {\n geographicWest = nativeRectangle.west * oneOverGlobeSemimajorAxis;\n geographicSouth =\n piOverTwo -\n 2.0 * atan(exp(-nativeRectangle.south * oneOverGlobeSemimajorAxis));\n geographicEast = nativeRectangle.east * oneOverGlobeSemimajorAxis;\n geographicNorth =\n piOverTwo -\n 2.0 * atan(exp(-nativeRectangle.north * oneOverGlobeSemimajorAxis));\n }\n } else {\n geographicWest = rectangle.west;\n geographicSouth = rectangle.south;\n geographicEast = rectangle.east;\n geographicNorth = rectangle.north;\n }\n\n let relativeToCenter = options.relativeToCenter;\n const hasRelativeToCenter = defined(relativeToCenter);\n relativeToCenter = hasRelativeToCenter ? relativeToCenter : Cartesian3.ZERO;\n const includeWebMercatorT = defaultValue(options.includeWebMercatorT, false);\n\n const exaggeration = defaultValue(options.exaggeration, 1.0);\n const exaggerationRelativeHeight = defaultValue(\n options.exaggerationRelativeHeight,\n 0.0\n );\n const hasExaggeration = exaggeration !== 1.0;\n const includeGeodeticSurfaceNormals = hasExaggeration;\n\n const structure = defaultValue(\n options.structure,\n HeightmapTessellator.DEFAULT_STRUCTURE\n );\n const heightScale = defaultValue(\n structure.heightScale,\n HeightmapTessellator.DEFAULT_STRUCTURE.heightScale\n );\n const heightOffset = defaultValue(\n structure.heightOffset,\n HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset\n );\n const elementsPerHeight = defaultValue(\n structure.elementsPerHeight,\n HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight\n );\n const stride = defaultValue(\n structure.stride,\n HeightmapTessellator.DEFAULT_STRUCTURE.stride\n );\n const elementMultiplier = defaultValue(\n structure.elementMultiplier,\n HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier\n );\n const isBigEndian = defaultValue(\n structure.isBigEndian,\n HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian\n );\n\n let rectangleWidth = Rectangle.computeWidth(nativeRectangle);\n let rectangleHeight = Rectangle.computeHeight(nativeRectangle);\n\n const granularityX = rectangleWidth / (width - 1);\n const granularityY = rectangleHeight / (height - 1);\n\n if (!isGeographic) {\n rectangleWidth *= oneOverGlobeSemimajorAxis;\n rectangleHeight *= oneOverGlobeSemimajorAxis;\n }\n\n const radiiSquared = ellipsoid.radiiSquared;\n const radiiSquaredX = radiiSquared.x;\n const radiiSquaredY = radiiSquared.y;\n const radiiSquaredZ = radiiSquared.z;\n\n let minimumHeight = 65536.0;\n let maximumHeight = -65536.0;\n\n const fromENU = Transforms.eastNorthUpToFixedFrame(\n relativeToCenter,\n ellipsoid\n );\n const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch);\n\n let southMercatorY;\n let oneOverMercatorHeight;\n if (includeWebMercatorT) {\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n geographicSouth\n );\n oneOverMercatorHeight =\n 1.0 /\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -\n southMercatorY);\n }\n\n const minimum = minimumScratch;\n minimum.x = Number.POSITIVE_INFINITY;\n minimum.y = Number.POSITIVE_INFINITY;\n minimum.z = Number.POSITIVE_INFINITY;\n\n const maximum = maximumScratch;\n maximum.x = Number.NEGATIVE_INFINITY;\n maximum.y = Number.NEGATIVE_INFINITY;\n maximum.z = Number.NEGATIVE_INFINITY;\n\n let hMin = Number.POSITIVE_INFINITY;\n\n const gridVertexCount = width * height;\n const edgeVertexCount = skirtHeight > 0.0 ? width * 2 + height * 2 : 0;\n const vertexCount = gridVertexCount + edgeVertexCount;\n\n const positions = new Array(vertexCount);\n const heights = new Array(vertexCount);\n const uvs = new Array(vertexCount);\n const webMercatorTs = includeWebMercatorT ? new Array(vertexCount) : [];\n const geodeticSurfaceNormals = includeGeodeticSurfaceNormals\n ? new Array(vertexCount)\n : [];\n\n let startRow = 0;\n let endRow = height;\n let startCol = 0;\n let endCol = width;\n\n if (hasSkirts) {\n --startRow;\n ++endRow;\n --startCol;\n ++endCol;\n }\n\n const skirtOffsetPercentage = 0.00001;\n\n for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {\n let row = rowIndex;\n if (row < 0) {\n row = 0;\n }\n if (row >= height) {\n row = height - 1;\n }\n\n let latitude = nativeRectangle.north - granularityY * row;\n\n if (!isGeographic) {\n latitude =\n piOverTwo - 2.0 * atan(exp(-latitude * oneOverGlobeSemimajorAxis));\n } else {\n latitude = toRadians(latitude);\n }\n\n let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);\n v = CesiumMath.clamp(v, 0.0, 1.0);\n\n const isNorthEdge = rowIndex === startRow;\n const isSouthEdge = rowIndex === endRow - 1;\n if (skirtHeight > 0.0) {\n if (isNorthEdge) {\n latitude += skirtOffsetPercentage * rectangleHeight;\n } else if (isSouthEdge) {\n latitude -= skirtOffsetPercentage * rectangleHeight;\n }\n }\n\n const cosLatitude = cos(latitude);\n const nZ = sin(latitude);\n const kZ = radiiSquaredZ * nZ;\n\n let webMercatorT;\n if (includeWebMercatorT) {\n webMercatorT =\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\n southMercatorY) *\n oneOverMercatorHeight;\n }\n\n for (let colIndex = startCol; colIndex < endCol; ++colIndex) {\n let col = colIndex;\n if (col < 0) {\n col = 0;\n }\n if (col >= width) {\n col = width - 1;\n }\n\n const terrainOffset = row * (width * stride) + col * stride;\n\n let heightSample;\n if (elementsPerHeight === 1) {\n heightSample = heightmap[terrainOffset];\n } else {\n heightSample = 0;\n\n let elementOffset;\n if (isBigEndian) {\n for (\n elementOffset = 0;\n elementOffset < elementsPerHeight;\n ++elementOffset\n ) {\n heightSample =\n heightSample * elementMultiplier +\n heightmap[terrainOffset + elementOffset];\n }\n } else {\n for (\n elementOffset = elementsPerHeight - 1;\n elementOffset >= 0;\n --elementOffset\n ) {\n heightSample =\n heightSample * elementMultiplier +\n heightmap[terrainOffset + elementOffset];\n }\n }\n }\n\n heightSample = heightSample * heightScale + heightOffset;\n\n maximumHeight = Math.max(maximumHeight, heightSample);\n minimumHeight = Math.min(minimumHeight, heightSample);\n\n let longitude = nativeRectangle.west + granularityX * col;\n\n if (!isGeographic) {\n longitude = longitude * oneOverGlobeSemimajorAxis;\n } else {\n longitude = toRadians(longitude);\n }\n\n let u = (longitude - geographicWest) / (geographicEast - geographicWest);\n u = CesiumMath.clamp(u, 0.0, 1.0);\n\n let index = row * width + col;\n\n if (skirtHeight > 0.0) {\n const isWestEdge = colIndex === startCol;\n const isEastEdge = colIndex === endCol - 1;\n const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;\n const isCorner =\n (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);\n if (isCorner) {\n // Don't generate skirts on the corners.\n continue;\n } else if (isEdge) {\n heightSample -= skirtHeight;\n\n if (isWestEdge) {\n // The outer loop iterates north to south but the indices are ordered south to north, hence the index flip below\n index = gridVertexCount + (height - row - 1);\n longitude -= skirtOffsetPercentage * rectangleWidth;\n } else if (isSouthEdge) {\n // Add after west indices. South indices are ordered east to west.\n index = gridVertexCount + height + (width - col - 1);\n } else if (isEastEdge) {\n // Add after west and south indices. East indices are ordered north to south. The index is flipped like above.\n index = gridVertexCount + height + width + row;\n longitude += skirtOffsetPercentage * rectangleWidth;\n } else if (isNorthEdge) {\n // Add after west, south, and east indices. North indices are ordered west to east.\n index = gridVertexCount + height + width + height + col;\n }\n }\n }\n\n const nX = cosLatitude * cos(longitude);\n const nY = cosLatitude * sin(longitude);\n\n const kX = radiiSquaredX * nX;\n const kY = radiiSquaredY * nY;\n\n const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\n const oneOverGamma = 1.0 / gamma;\n\n const rSurfaceX = kX * oneOverGamma;\n const rSurfaceY = kY * oneOverGamma;\n const rSurfaceZ = kZ * oneOverGamma;\n\n const position = new Cartesian3();\n position.x = rSurfaceX + nX * heightSample;\n position.y = rSurfaceY + nY * heightSample;\n position.z = rSurfaceZ + nZ * heightSample;\n\n Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);\n Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);\n Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);\n hMin = Math.min(hMin, heightSample);\n\n positions[index] = position;\n uvs[index] = new Cartesian2(u, v);\n heights[index] = heightSample;\n\n if (includeWebMercatorT) {\n webMercatorTs[index] = webMercatorT;\n }\n\n if (includeGeodeticSurfaceNormals) {\n geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal(\n position\n );\n }\n }\n }\n\n const boundingSphere3D = BoundingSphere.fromPoints(positions);\n let orientedBoundingBox;\n if (defined(rectangle)) {\n orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n rectangle,\n minimumHeight,\n maximumHeight,\n ellipsoid\n );\n }\n\n let occludeePointInScaledSpace;\n if (hasRelativeToCenter) {\n const occluder = new EllipsoidalOccluder(ellipsoid);\n occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n relativeToCenter,\n positions,\n minimumHeight\n );\n }\n\n const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);\n const encoding = new TerrainEncoding(\n relativeToCenter,\n aaBox,\n hMin,\n maximumHeight,\n fromENU,\n false,\n includeWebMercatorT,\n includeGeodeticSurfaceNormals,\n exaggeration,\n exaggerationRelativeHeight\n );\n const vertices = new Float32Array(vertexCount * encoding.stride);\n\n let bufferIndex = 0;\n for (let j = 0; j < vertexCount; ++j) {\n bufferIndex = encoding.encode(\n vertices,\n bufferIndex,\n positions[j],\n uvs[j],\n heights[j],\n undefined,\n webMercatorTs[j],\n geodeticSurfaceNormals[j]\n );\n }\n\n return {\n vertices: vertices,\n maximumHeight: maximumHeight,\n minimumHeight: minimumHeight,\n encoding: encoding,\n boundingSphere3D: boundingSphere3D,\n orientedBoundingBox: orientedBoundingBox,\n occludeePointInScaledSpace: occludeePointInScaledSpace,\n };\n};\nexport default HeightmapTessellator;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Terrain data for a single tile. This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TerrainData\n * @constructor\n *\n * @see HeightmapTerrainData\n * @see QuantizedMeshTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction TerrainData() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(TerrainData.prototype, {\n /**\n * An array of credits for this tile.\n * @memberof TerrainData.prototype\n * @type {Credit[]}\n */\n credits: {\n get: DeveloperError.throwInstantiationError,\n },\n /**\n * The water mask included in this terrain data, if any. A water mask is a rectangular\n * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @memberof TerrainData.prototype\n * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n */\n waterMask: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n * @function\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {Number} longitude The longitude in radians.\n * @param {Number} latitude The latitude in radians.\n * @returns {Number} The terrain height at the specified position. If the position\n * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n * incorrect for positions far outside the rectangle.\n */\nTerrainData.prototype.interpolateHeight =\n DeveloperError.throwInstantiationError;\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed\n * to be one of the four children of this tile. If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n * @function\n *\n * @param {Number} thisX The tile X coordinate of this (the parent) tile.\n * @param {Number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {Number} childX The tile X coordinate of the child tile to check for availability.\n * @param {Number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {Boolean} True if the child tile is available; otherwise, false.\n */\nTerrainData.prototype.isChildAvailable = DeveloperError.throwInstantiationError;\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n * @function\n *\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {Number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {Number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {Number} options.level The level of the tile for which to create the terrain data.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n * asynchronous mesh creations are already in progress and the operation should\n * be retried later.\n */\nTerrainData.prototype.createMesh = DeveloperError.throwInstantiationError;\n\n/**\n * Upsamples this terrain data for use by a descendant tile.\n * @function\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {Number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {Number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {Number} thisLevel The level of this tile in the tiling scheme.\n * @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise.<TerrainData>|undefined} A promise for upsampled terrain data for the descendant tile,\n * or undefined if too many asynchronous upsample operations are in progress and the request has been\n * deferred.\n */\nTerrainData.prototype.upsample = DeveloperError.throwInstantiationError;\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data. If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server. This method should return true for instances\n * returned from a call to {@link TerrainData#upsample}.\n * @function\n *\n * @returns {Boolean} True if this instance was created by upsampling; otherwise, false.\n */\nTerrainData.prototype.wasCreatedByUpsampling =\n DeveloperError.throwInstantiationError;\n\n/**\n * The maximum number of asynchronous tasks used for terrain processing.\n *\n * @type {Number}\n * @private\n */\nTerrainData.maximumAsynchronousTasks = 5;\n\nexport default TerrainData;\n", "import defaultValue from \"./defaultValue.js\";\n\n/**\n * A mesh plus related metadata for a single tile of terrain. Instances of this type are\n * usually created from raw {@link TerrainData}.\n *\n * @alias TerrainMesh\n * @constructor\n *\n * @param {Cartesian3} center The center of the tile. Vertex positions are specified relative to this center.\n * @param {Float32Array} vertices The vertex data, including positions, texture coordinates, and heights.\n * The vertex data is in the order [X, Y, Z, H, U, V], where X, Y, and Z represent\n * the Cartesian position of the vertex, H is the height above the ellipsoid, and\n * U and V are the texture coordinates.\n * @param {Uint8Array|Uint16Array|Uint32Array} indices The indices describing how the vertices are connected to form triangles.\n * @param {Number} indexCountWithoutSkirts The index count of the mesh not including skirts.\n * @param {Number} vertexCountWithoutSkirts The vertex count of the mesh not including skirts.\n * @param {Number} minimumHeight The lowest height in the tile, in meters above the ellipsoid.\n * @param {Number} maximumHeight The highest height in the tile, in meters above the ellipsoid.\n * @param {BoundingSphere} boundingSphere3D A bounding sphere that completely contains the tile.\n * @param {Cartesian3} occludeePointInScaledSpace The occludee point of the tile, represented in ellipsoid-\n * scaled space, and used for horizon culling. If this point is below the horizon,\n * the tile is considered to be entirely below the horizon.\n * @param {Number} [vertexStride=6] The number of components in each vertex.\n * @param {OrientedBoundingBox} [orientedBoundingBox] A bounding box that completely contains the tile.\n * @param {TerrainEncoding} encoding Information used to decode the mesh.\n * @param {Number[]} westIndicesSouthToNorth The indices of the vertices on the Western edge of the tile, ordered from South to North (clockwise).\n * @param {Number[]} southIndicesEastToWest The indices of the vertices on the Southern edge of the tile, ordered from East to West (clockwise).\n * @param {Number[]} eastIndicesNorthToSouth The indices of the vertices on the Eastern edge of the tile, ordered from North to South (clockwise).\n * @param {Number[]} northIndicesWestToEast The indices of the vertices on the Northern edge of the tile, ordered from West to East (clockwise).\n *\n * @private\n */\nfunction TerrainMesh(\n center,\n vertices,\n indices,\n indexCountWithoutSkirts,\n vertexCountWithoutSkirts,\n minimumHeight,\n maximumHeight,\n boundingSphere3D,\n occludeePointInScaledSpace,\n vertexStride,\n orientedBoundingBox,\n encoding,\n westIndicesSouthToNorth,\n southIndicesEastToWest,\n eastIndicesNorthToSouth,\n northIndicesWestToEast\n) {\n /**\n * The center of the tile. Vertex positions are specified relative to this center.\n * @type {Cartesian3}\n */\n this.center = center;\n\n /**\n * The vertex data, including positions, texture coordinates, and heights.\n * The vertex data is in the order [X, Y, Z, H, U, V], where X, Y, and Z represent\n * the Cartesian position of the vertex, H is the height above the ellipsoid, and\n * U and V are the texture coordinates. The vertex data may have additional attributes after those\n * mentioned above when the {@link TerrainMesh#stride} is greater than 6.\n * @type {Float32Array}\n */\n this.vertices = vertices;\n\n /**\n * The number of components in each vertex. Typically this is 6 for the 6 components\n * [X, Y, Z, H, U, V], but if each vertex has additional data (such as a vertex normal), this value\n * may be higher.\n * @type {Number}\n */\n this.stride = defaultValue(vertexStride, 6);\n\n /**\n * The indices describing how the vertices are connected to form triangles.\n * @type {Uint8Array|Uint16Array|Uint32Array}\n */\n this.indices = indices;\n\n /**\n * The index count of the mesh not including skirts.\n * @type {Number}\n */\n this.indexCountWithoutSkirts = indexCountWithoutSkirts;\n\n /**\n * The vertex count of the mesh not including skirts.\n * @type {Number}\n */\n this.vertexCountWithoutSkirts = vertexCountWithoutSkirts;\n\n /**\n * The lowest height in the tile, in meters above the ellipsoid.\n * @type {Number}\n */\n this.minimumHeight = minimumHeight;\n\n /**\n * The highest height in the tile, in meters above the ellipsoid.\n * @type {Number}\n */\n this.maximumHeight = maximumHeight;\n\n /**\n * A bounding sphere that completely contains the tile.\n * @type {BoundingSphere}\n */\n this.boundingSphere3D = boundingSphere3D;\n\n /**\n * The occludee point of the tile, represented in ellipsoid-\n * scaled space, and used for horizon culling. If this point is below the horizon,\n * the tile is considered to be entirely below the horizon.\n * @type {Cartesian3}\n */\n this.occludeePointInScaledSpace = occludeePointInScaledSpace;\n\n /**\n * A bounding box that completely contains the tile.\n * @type {OrientedBoundingBox}\n */\n this.orientedBoundingBox = orientedBoundingBox;\n\n /**\n * Information for decoding the mesh vertices.\n * @type {TerrainEncoding}\n */\n this.encoding = encoding;\n\n /**\n * The indices of the vertices on the Western edge of the tile, ordered from South to North (clockwise).\n * @type {Number[]}\n */\n this.westIndicesSouthToNorth = westIndicesSouthToNorth;\n\n /**\n * The indices of the vertices on the Southern edge of the tile, ordered from East to West (clockwise).\n * @type {Number[]}\n */\n this.southIndicesEastToWest = southIndicesEastToWest;\n\n /**\n * The indices of the vertices on the Eastern edge of the tile, ordered from North to South (clockwise).\n * @type {Number[]}\n */\n this.eastIndicesNorthToSouth = eastIndicesNorthToSouth;\n\n /**\n * The indices of the vertices on the Northern edge of the tile, ordered from West to East (clockwise).\n * @type {Number[]}\n */\n this.northIndicesWestToEast = northIndicesWestToEast;\n}\nexport default TerrainMesh;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\n\n/**\n * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is\n * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TerrainProvider\n * @constructor\n *\n * @see EllipsoidTerrainProvider\n * @see CesiumTerrainProvider\n * @see VRTheWorldTerrainProvider\n * @see GoogleEarthEnterpriseTerrainProvider\n */\nfunction TerrainProvider() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(TerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof TerrainProvider.prototype\n * @type {Event<TerrainProvider.ErrorEvent>}\n * @readonly\n */\n errorEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should\n * not be called before {@link TerrainProvider#ready} returns true.\n * @memberof TerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the tiling scheme used by the provider. This function should\n * not be called before {@link TerrainProvider#ready} returns true.\n * @memberof TerrainProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof TerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof TerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link TerrainProvider#ready} returns true.\n * @memberof TerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link TerrainProvider#ready} returns true.\n * @memberof TerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link TerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available.\n * @memberof TerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\nconst regularGridIndicesCache = [];\n\n/**\n * Gets a list of indices for a triangle mesh representing a regular grid. Calling\n * this function multiple times with the same grid width and height returns the\n * same list of indices. The total number of vertices must be less than or equal\n * to 65536.\n *\n * @param {Number} width The number of vertices in the regular grid in the horizontal direction.\n * @param {Number} height The number of vertices in the regular grid in the vertical direction.\n * @returns {Uint16Array|Uint32Array} The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.\n */\nTerrainProvider.getRegularGridIndices = function (width, height) {\n let byWidth = regularGridIndicesCache[width];\n if (!defined(byWidth)) {\n regularGridIndicesCache[width] = byWidth = [];\n }\n\n let indices = byWidth[height];\n if (!defined(indices)) {\n if (width * height < CesiumMath.SIXTY_FOUR_KILOBYTES) {\n indices = byWidth[height] = new Uint16Array(\n (width - 1) * (height - 1) * 6\n );\n } else {\n indices = byWidth[height] = new Uint32Array(\n (width - 1) * (height - 1) * 6\n );\n }\n addRegularGridIndices(width, height, indices, 0);\n }\n\n return indices;\n};\n\nconst regularGridAndEdgeIndicesCache = [];\n\n/**\n * @private\n */\nTerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) {\n let byWidth = regularGridAndEdgeIndicesCache[width];\n if (!defined(byWidth)) {\n regularGridAndEdgeIndicesCache[width] = byWidth = [];\n }\n\n let indicesAndEdges = byWidth[height];\n if (!defined(indicesAndEdges)) {\n const indices = TerrainProvider.getRegularGridIndices(width, height);\n\n const edgeIndices = getEdgeIndices(width, height);\n const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\n const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\n const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\n const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\n\n indicesAndEdges = byWidth[height] = {\n indices: indices,\n westIndicesSouthToNorth: westIndicesSouthToNorth,\n southIndicesEastToWest: southIndicesEastToWest,\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n northIndicesWestToEast: northIndicesWestToEast,\n };\n }\n\n return indicesAndEdges;\n};\n\nconst regularGridAndSkirtAndEdgeIndicesCache = [];\n\n/**\n * @private\n */\nTerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function (\n width,\n height\n) {\n let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];\n if (!defined(byWidth)) {\n regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];\n }\n\n let indicesAndEdges = byWidth[height];\n if (!defined(indicesAndEdges)) {\n const gridVertexCount = width * height;\n const gridIndexCount = (width - 1) * (height - 1) * 6;\n const edgeVertexCount = width * 2 + height * 2;\n const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;\n const vertexCount = gridVertexCount + edgeVertexCount;\n const indexCount = gridIndexCount + edgeIndexCount;\n\n const edgeIndices = getEdgeIndices(width, height);\n const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\n const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\n const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\n const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\n\n const indices = IndexDatatype.createTypedArray(vertexCount, indexCount);\n addRegularGridIndices(width, height, indices, 0);\n TerrainProvider.addSkirtIndices(\n westIndicesSouthToNorth,\n southIndicesEastToWest,\n eastIndicesNorthToSouth,\n northIndicesWestToEast,\n gridVertexCount,\n indices,\n gridIndexCount\n );\n\n indicesAndEdges = byWidth[height] = {\n indices: indices,\n westIndicesSouthToNorth: westIndicesSouthToNorth,\n southIndicesEastToWest: southIndicesEastToWest,\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n northIndicesWestToEast: northIndicesWestToEast,\n indexCountWithoutSkirts: gridIndexCount,\n };\n }\n\n return indicesAndEdges;\n};\n\n/**\n * @private\n */\nTerrainProvider.addSkirtIndices = function (\n westIndicesSouthToNorth,\n southIndicesEastToWest,\n eastIndicesNorthToSouth,\n northIndicesWestToEast,\n vertexCount,\n indices,\n offset\n) {\n let vertexIndex = vertexCount;\n offset = addSkirtIndices(\n westIndicesSouthToNorth,\n vertexIndex,\n indices,\n offset\n );\n vertexIndex += westIndicesSouthToNorth.length;\n offset = addSkirtIndices(\n southIndicesEastToWest,\n vertexIndex,\n indices,\n offset\n );\n vertexIndex += southIndicesEastToWest.length;\n offset = addSkirtIndices(\n eastIndicesNorthToSouth,\n vertexIndex,\n indices,\n offset\n );\n vertexIndex += eastIndicesNorthToSouth.length;\n addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);\n};\n\nfunction getEdgeIndices(width, height) {\n const westIndicesSouthToNorth = new Array(height);\n const southIndicesEastToWest = new Array(width);\n const eastIndicesNorthToSouth = new Array(height);\n const northIndicesWestToEast = new Array(width);\n\n let i;\n for (i = 0; i < width; ++i) {\n northIndicesWestToEast[i] = i;\n southIndicesEastToWest[i] = width * height - 1 - i;\n }\n\n for (i = 0; i < height; ++i) {\n eastIndicesNorthToSouth[i] = (i + 1) * width - 1;\n westIndicesSouthToNorth[i] = (height - i - 1) * width;\n }\n\n return {\n westIndicesSouthToNorth: westIndicesSouthToNorth,\n southIndicesEastToWest: southIndicesEastToWest,\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\n northIndicesWestToEast: northIndicesWestToEast,\n };\n}\n\nfunction addRegularGridIndices(width, height, indices, offset) {\n let index = 0;\n for (let j = 0; j < height - 1; ++j) {\n for (let i = 0; i < width - 1; ++i) {\n const upperLeft = index;\n const lowerLeft = upperLeft + width;\n const lowerRight = lowerLeft + 1;\n const upperRight = upperLeft + 1;\n\n indices[offset++] = upperLeft;\n indices[offset++] = lowerLeft;\n indices[offset++] = upperRight;\n indices[offset++] = upperRight;\n indices[offset++] = lowerLeft;\n indices[offset++] = lowerRight;\n\n ++index;\n }\n ++index;\n }\n}\n\nfunction addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {\n let previousIndex = edgeIndices[0];\n\n const length = edgeIndices.length;\n for (let i = 1; i < length; ++i) {\n const index = edgeIndices[i];\n\n indices[offset++] = previousIndex;\n indices[offset++] = index;\n indices[offset++] = vertexIndex;\n\n indices[offset++] = vertexIndex;\n indices[offset++] = index;\n indices[offset++] = vertexIndex + 1;\n\n previousIndex = index;\n ++vertexIndex;\n }\n\n return offset;\n}\n\n/**\n * Specifies the quality of terrain created from heightmaps. A value of 1.0 will\n * ensure that adjacent heightmap vertices are separated by no more than\n * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.\n * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the\n * screen pixels between adjacent heightmap vertices and thus rendering more quickly.\n * @type {Number}\n */\nTerrainProvider.heightmapTerrainQuality = 0.25;\n\n/**\n * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.\n *\n * @param {Ellipsoid} ellipsoid The ellipsoid to which the terrain is attached.\n * @param {Number} tileImageWidth The width, in pixels, of the heightmap associated with a single tile.\n * @param {Number} numberOfTilesAtLevelZero The number of tiles in the horizontal direction at tile level zero.\n * @returns {Number} An estimated geometric error.\n */\nTerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function (\n ellipsoid,\n tileImageWidth,\n numberOfTilesAtLevelZero\n) {\n return (\n (ellipsoid.maximumRadius *\n 2 *\n Math.PI *\n TerrainProvider.heightmapTerrainQuality) /\n (tileImageWidth * numberOfTilesAtLevelZero)\n );\n};\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link TerrainProvider#ready} returns true. The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n * @function\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n */\nTerrainProvider.prototype.requestTileGeometry =\n DeveloperError.throwInstantiationError;\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level. This function should not be\n * called before {@link TerrainProvider#ready} returns true.\n * @function\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nTerrainProvider.prototype.getLevelMaximumGeometricError =\n DeveloperError.throwInstantiationError;\n\n/**\n * Determines whether data for a tile is available to be loaded.\n * @function\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported by the terrain provider, otherwise true or false.\n */\nTerrainProvider.prototype.getTileDataAvailable =\n DeveloperError.throwInstantiationError;\n\n/**\n * Makes sure we load availability data for a tile\n * @function\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nTerrainProvider.prototype.loadTileDataAvailability =\n DeveloperError.throwInstantiationError;\nexport default TerrainProvider;\n\n/**\n * A function that is called when an error occurs.\n * @callback TerrainProvider.ErrorEvent\n *\n * @this TerrainProvider\n * @param {TileProviderError} err An object holding details about the error that occurred.\n */\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport HeightmapEncoding from \"./HeightmapEncoding.js\";\nimport HeightmapTessellator from \"./HeightmapTessellator.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap\n * is a rectangular array of heights in row-major order from north to south and west to east.\n *\n * @alias HeightmapTerrainData\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.buffer The buffer containing height data.\n * @param {Number} options.width The width (longitude direction) of the heightmap, in samples.\n * @param {Number} options.height The height (latitude direction) of the heightmap, in samples.\n * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n * If a child's bit is set, geometry will be requested for that tile as well when it\n * is needed. If the bit is cleared, the child tile is not requested and geometry is\n * instead upsampled from the parent. The bit values are as follows:\n * <table>\n * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n * <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n * <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n * <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n * <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n * </table>\n * @param {Uint8Array} [options.waterMask] The water mask included in this terrain data, if any. A water mask is a square\n * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @param {Object} [options.structure] An object describing the structure of the height data.\n * @param {Number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain\n * the height above the heightOffset, in meters. The heightOffset is added to the resulting\n * height after multiplying by the scale.\n * @param {Number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final\n * height in meters. The offset is added after the height sample is multiplied by the\n * heightScale.\n * @param {Number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height\n * sample. This is usually 1, indicating that each element is a separate height sample. If\n * it is greater than 1, that number of elements together form the height sample, which is\n * computed according to the structure.elementMultiplier and structure.isBigEndian properties.\n * @param {Number} [options.structure.stride=1] The number of elements to skip to get from the first element of\n * one height to the first element of the next height.\n * @param {Number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the\n * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier\n * is 256, the height is computed as follows:\n * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`\n * This is assuming that the isBigEndian property is false. If it is true, the order of the\n * elements is reversed.\n * @param {Boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the\n * stride property is greater than 1. If this property is false, the first element is the\n * low-order element. If it is true, the first element is the high-order element.\n * @param {Number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer. Any heights that are lower\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\n * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is\n * not specified, no minimum value is enforced.\n * @param {Number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer. Any heights that are higher\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\n * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger\n * than 65535. If this parameter is not specified, no maximum value is enforced.\n * @param {HeightmapEncoding} [options.encoding=HeightmapEncoding.NONE] The encoding that is used on the buffer.\n * @param {Boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n * otherwise, false.\n *\n *\n * @example\n * const buffer = ...\n * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);\n * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];\n * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);\n * const terrainData = new Cesium.HeightmapTerrainData({\n * buffer : heightBuffer,\n * width : 65,\n * height : 65,\n * childTileMask : childTileMask,\n * waterMask : waterMask\n * });\n *\n * @see TerrainData\n * @see QuantizedMeshTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction HeightmapTerrainData(options) {\n this._buffer = options.buffer;\n this._width = options.width;\n this._height = options.height;\n this._childTileMask = defaultValue(options.childTileMask, 15);\n this._encoding = defaultValue(options.encoding, HeightmapEncoding.NONE);\n\n const defaultStructure = HeightmapTessellator.DEFAULT_STRUCTURE;\n let structure = options.structure;\n if (!defined(structure)) {\n structure = defaultStructure;\n } else if (structure !== defaultStructure) {\n structure.heightScale = defaultValue(\n structure.heightScale,\n defaultStructure.heightScale\n );\n structure.heightOffset = defaultValue(\n structure.heightOffset,\n defaultStructure.heightOffset\n );\n structure.elementsPerHeight = defaultValue(\n structure.elementsPerHeight,\n defaultStructure.elementsPerHeight\n );\n structure.stride = defaultValue(structure.stride, defaultStructure.stride);\n structure.elementMultiplier = defaultValue(\n structure.elementMultiplier,\n defaultStructure.elementMultiplier\n );\n structure.isBigEndian = defaultValue(\n structure.isBigEndian,\n defaultStructure.isBigEndian\n );\n }\n\n this._structure = structure;\n this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n this._waterMask = options.waterMask;\n\n this._skirtHeight = undefined;\n this._bufferType =\n this._encoding === HeightmapEncoding.LERC\n ? Float32Array\n : this._buffer.constructor;\n this._mesh = undefined;\n}\n\nObject.defineProperties(HeightmapTerrainData.prototype, {\n /**\n * An array of credits for this tile.\n * @memberof HeightmapTerrainData.prototype\n * @type {Credit[]}\n */\n credits: {\n get: function () {\n return undefined;\n },\n },\n /**\n * The water mask included in this terrain data, if any. A water mask is a square\n * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @memberof HeightmapTerrainData.prototype\n * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n */\n waterMask: {\n get: function () {\n return this._waterMask;\n },\n },\n\n childTileMask: {\n get: function () {\n return this._childTileMask;\n },\n },\n});\n\nconst createMeshTaskName = \"createVerticesFromHeightmap\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n createMeshTaskName,\n TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {Number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {Number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {Number} options.level The level of the tile for which to create the terrain data.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n * asynchronous mesh creations are already in progress and the operation should\n * be retried later.\n */\nHeightmapTerrainData.prototype.createMesh = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const tilingScheme = options.tilingScheme;\n const x = options.x;\n const y = options.y;\n const level = options.level;\n const exaggeration = defaultValue(options.exaggeration, 1.0);\n const exaggerationRelativeHeight = defaultValue(\n options.exaggerationRelativeHeight,\n 0.0\n );\n const throttle = defaultValue(options.throttle, true);\n\n const ellipsoid = tilingScheme.ellipsoid;\n const nativeRectangle = tilingScheme.tileXYToNativeRectangle(x, y, level);\n const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n // Compute the center of the tile for RTC rendering.\n const center = ellipsoid.cartographicToCartesian(Rectangle.center(rectangle));\n\n const structure = this._structure;\n\n const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n ellipsoid,\n this._width,\n tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n const thisLevelMaxError = levelZeroMaxError / (1 << level);\n this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0);\n\n const createMeshTaskProcessor = throttle\n ? createMeshTaskProcessorThrottle\n : createMeshTaskProcessorNoThrottle;\n\n const verticesPromise = createMeshTaskProcessor.scheduleTask({\n heightmap: this._buffer,\n structure: structure,\n includeWebMercatorT: true,\n width: this._width,\n height: this._height,\n nativeRectangle: nativeRectangle,\n rectangle: rectangle,\n relativeToCenter: center,\n ellipsoid: ellipsoid,\n skirtHeight: this._skirtHeight,\n isGeographic: tilingScheme.projection instanceof GeographicProjection,\n exaggeration: exaggeration,\n exaggerationRelativeHeight: exaggerationRelativeHeight,\n encoding: this._encoding,\n });\n\n if (!defined(verticesPromise)) {\n // Postponed\n return undefined;\n }\n\n const that = this;\n return Promise.resolve(verticesPromise).then(function (result) {\n let indicesAndEdges;\n if (that._skirtHeight > 0.0) {\n indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(\n result.gridWidth,\n result.gridHeight\n );\n } else {\n indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices(\n result.gridWidth,\n result.gridHeight\n );\n }\n\n const vertexCountWithoutSkirts = result.gridWidth * result.gridHeight;\n\n // Clone complex result objects because the transfer from the web worker\n // has stripped them down to JSON-style objects.\n that._mesh = new TerrainMesh(\n center,\n new Float32Array(result.vertices),\n indicesAndEdges.indices,\n indicesAndEdges.indexCountWithoutSkirts,\n vertexCountWithoutSkirts,\n result.minimumHeight,\n result.maximumHeight,\n BoundingSphere.clone(result.boundingSphere3D),\n Cartesian3.clone(result.occludeePointInScaledSpace),\n result.numberOfAttributes,\n OrientedBoundingBox.clone(result.orientedBoundingBox),\n TerrainEncoding.clone(result.encoding),\n indicesAndEdges.westIndicesSouthToNorth,\n indicesAndEdges.southIndicesEastToWest,\n indicesAndEdges.eastIndicesNorthToSouth,\n indicesAndEdges.northIndicesWestToEast\n );\n\n // Free memory received from server after mesh is created.\n that._buffer = undefined;\n return that._mesh;\n });\n};\n\n/**\n * @param {Object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {Number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {Number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {Number} options.level The level of the tile for which to create the terrain data.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n *\n * @private\n */\nHeightmapTerrainData.prototype._createMeshSync = function (options) {\n const tilingScheme = options.tilingScheme;\n const x = options.x;\n const y = options.y;\n const level = options.level;\n const exaggeration = defaultValue(options.exaggeration, 1.0);\n const exaggerationRelativeHeight = defaultValue(\n options.exaggerationRelativeHeight,\n 0.0\n );\n\n const ellipsoid = tilingScheme.ellipsoid;\n const nativeRectangle = tilingScheme.tileXYToNativeRectangle(x, y, level);\n const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n // Compute the center of the tile for RTC rendering.\n const center = ellipsoid.cartographicToCartesian(Rectangle.center(rectangle));\n\n const structure = this._structure;\n\n const levelZeroMaxError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n ellipsoid,\n this._width,\n tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n const thisLevelMaxError = levelZeroMaxError / (1 << level);\n this._skirtHeight = Math.min(thisLevelMaxError * 4.0, 1000.0);\n\n const result = HeightmapTessellator.computeVertices({\n heightmap: this._buffer,\n structure: structure,\n includeWebMercatorT: true,\n width: this._width,\n height: this._height,\n nativeRectangle: nativeRectangle,\n rectangle: rectangle,\n relativeToCenter: center,\n ellipsoid: ellipsoid,\n skirtHeight: this._skirtHeight,\n isGeographic: tilingScheme.projection instanceof GeographicProjection,\n exaggeration: exaggeration,\n exaggerationRelativeHeight: exaggerationRelativeHeight,\n });\n\n // Free memory received from server after mesh is created.\n this._buffer = undefined;\n\n let indicesAndEdges;\n if (this._skirtHeight > 0.0) {\n indicesAndEdges = TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(\n this._width,\n this._height\n );\n } else {\n indicesAndEdges = TerrainProvider.getRegularGridIndicesAndEdgeIndices(\n this._width,\n this._height\n );\n }\n\n const vertexCountWithoutSkirts = result.gridWidth * result.gridHeight;\n\n // No need to clone here (as we do in the async version) because the result\n // is not coming from a web worker.\n this._mesh = new TerrainMesh(\n center,\n result.vertices,\n indicesAndEdges.indices,\n indicesAndEdges.indexCountWithoutSkirts,\n vertexCountWithoutSkirts,\n result.minimumHeight,\n result.maximumHeight,\n result.boundingSphere3D,\n result.occludeePointInScaledSpace,\n result.encoding.stride,\n result.orientedBoundingBox,\n result.encoding,\n indicesAndEdges.westIndicesSouthToNorth,\n indicesAndEdges.southIndicesEastToWest,\n indicesAndEdges.eastIndicesNorthToSouth,\n indicesAndEdges.northIndicesWestToEast\n );\n\n return this._mesh;\n};\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {Number} longitude The longitude in radians.\n * @param {Number} latitude The latitude in radians.\n * @returns {Number} The terrain height at the specified position. If the position\n * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n * incorrect for positions far outside the rectangle.\n */\nHeightmapTerrainData.prototype.interpolateHeight = function (\n rectangle,\n longitude,\n latitude\n) {\n const width = this._width;\n const height = this._height;\n\n const structure = this._structure;\n const stride = structure.stride;\n const elementsPerHeight = structure.elementsPerHeight;\n const elementMultiplier = structure.elementMultiplier;\n const isBigEndian = structure.isBigEndian;\n const heightOffset = structure.heightOffset;\n const heightScale = structure.heightScale;\n\n const isMeshCreated = defined(this._mesh);\n const isLERCEncoding = this._encoding === HeightmapEncoding.LERC;\n const isInterpolationImpossible = !isMeshCreated && isLERCEncoding;\n if (isInterpolationImpossible) {\n // We can't interpolate using the buffer because it's LERC encoded\n // so please call createMesh() first and interpolate using the mesh;\n // as mesh creation will decode the LERC buffer\n return undefined;\n }\n\n let heightSample;\n if (isMeshCreated) {\n const buffer = this._mesh.vertices;\n const encoding = this._mesh.encoding;\n heightSample = interpolateMeshHeight(\n buffer,\n encoding,\n heightOffset,\n heightScale,\n rectangle,\n width,\n height,\n longitude,\n latitude\n );\n } else {\n heightSample = interpolateHeight(\n this._buffer,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n rectangle,\n width,\n height,\n longitude,\n latitude\n );\n heightSample = heightSample * heightScale + heightOffset;\n }\n\n return heightSample;\n};\n\n/**\n * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the\n * height samples in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {Number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {Number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {Number} thisLevel The level of this tile in the tiling scheme.\n * @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n * or undefined if the mesh is unavailable.\n */\nHeightmapTerrainData.prototype.upsample = function (\n tilingScheme,\n thisX,\n thisY,\n thisLevel,\n descendantX,\n descendantY,\n descendantLevel\n) {\n const meshData = this._mesh;\n if (!defined(meshData)) {\n return undefined;\n }\n\n const width = this._width;\n const height = this._height;\n const structure = this._structure;\n const stride = structure.stride;\n\n const heights = new this._bufferType(width * height * stride);\n\n const buffer = meshData.vertices;\n const encoding = meshData.encoding;\n\n // PERFORMANCE_IDEA: don't recompute these rectangles - the caller already knows them.\n const sourceRectangle = tilingScheme.tileXYToRectangle(\n thisX,\n thisY,\n thisLevel\n );\n const destinationRectangle = tilingScheme.tileXYToRectangle(\n descendantX,\n descendantY,\n descendantLevel\n );\n\n const heightOffset = structure.heightOffset;\n const heightScale = structure.heightScale;\n\n const elementsPerHeight = structure.elementsPerHeight;\n const elementMultiplier = structure.elementMultiplier;\n const isBigEndian = structure.isBigEndian;\n\n const divisor = Math.pow(elementMultiplier, elementsPerHeight - 1);\n\n for (let j = 0; j < height; ++j) {\n const latitude = CesiumMath.lerp(\n destinationRectangle.north,\n destinationRectangle.south,\n j / (height - 1)\n );\n for (let i = 0; i < width; ++i) {\n const longitude = CesiumMath.lerp(\n destinationRectangle.west,\n destinationRectangle.east,\n i / (width - 1)\n );\n let heightSample = interpolateMeshHeight(\n buffer,\n encoding,\n heightOffset,\n heightScale,\n sourceRectangle,\n width,\n height,\n longitude,\n latitude\n );\n\n // Use conditionals here instead of Math.min and Math.max so that an undefined\n // lowestEncodedHeight or highestEncodedHeight has no effect.\n heightSample =\n heightSample < structure.lowestEncodedHeight\n ? structure.lowestEncodedHeight\n : heightSample;\n heightSample =\n heightSample > structure.highestEncodedHeight\n ? structure.highestEncodedHeight\n : heightSample;\n\n setHeight(\n heights,\n elementsPerHeight,\n elementMultiplier,\n divisor,\n stride,\n isBigEndian,\n j * width + i,\n heightSample\n );\n }\n }\n\n return Promise.resolve(\n new HeightmapTerrainData({\n buffer: heights,\n width: width,\n height: height,\n childTileMask: 0,\n structure: this._structure,\n createdByUpsampling: true,\n })\n );\n};\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed\n * to be one of the four children of this tile. If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {Number} thisX The tile X coordinate of this (the parent) tile.\n * @param {Number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {Number} childX The tile X coordinate of the child tile to check for availability.\n * @param {Number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {Boolean} True if the child tile is available; otherwise, false.\n */\nHeightmapTerrainData.prototype.isChildAvailable = function (\n thisX,\n thisY,\n childX,\n childY\n) {\n let bitNumber = 2; // northwest child\n if (childX !== thisX * 2) {\n ++bitNumber; // east child\n }\n if (childY !== thisY * 2) {\n bitNumber -= 2; // south child\n }\n\n return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data. If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server. This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {Boolean} True if this instance was created by upsampling; otherwise, false.\n */\nHeightmapTerrainData.prototype.wasCreatedByUpsampling = function () {\n return this._createdByUpsampling;\n};\n\nfunction interpolateHeight(\n sourceHeights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n sourceRectangle,\n width,\n height,\n longitude,\n latitude\n) {\n const fromWest =\n ((longitude - sourceRectangle.west) * (width - 1)) /\n (sourceRectangle.east - sourceRectangle.west);\n const fromSouth =\n ((latitude - sourceRectangle.south) * (height - 1)) /\n (sourceRectangle.north - sourceRectangle.south);\n\n let westInteger = fromWest | 0;\n let eastInteger = westInteger + 1;\n if (eastInteger >= width) {\n eastInteger = width - 1;\n westInteger = width - 2;\n }\n\n let southInteger = fromSouth | 0;\n let northInteger = southInteger + 1;\n if (northInteger >= height) {\n northInteger = height - 1;\n southInteger = height - 2;\n }\n\n const dx = fromWest - westInteger;\n const dy = fromSouth - southInteger;\n\n southInteger = height - 1 - southInteger;\n northInteger = height - 1 - northInteger;\n\n const southwestHeight = getHeight(\n sourceHeights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n southInteger * width + westInteger\n );\n const southeastHeight = getHeight(\n sourceHeights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n southInteger * width + eastInteger\n );\n const northwestHeight = getHeight(\n sourceHeights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n northInteger * width + westInteger\n );\n const northeastHeight = getHeight(\n sourceHeights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n northInteger * width + eastInteger\n );\n\n return triangleInterpolateHeight(\n dx,\n dy,\n southwestHeight,\n southeastHeight,\n northwestHeight,\n northeastHeight\n );\n}\n\nfunction interpolateMeshHeight(\n buffer,\n encoding,\n heightOffset,\n heightScale,\n sourceRectangle,\n width,\n height,\n longitude,\n latitude\n) {\n // returns a height encoded according to the structure's heightScale and heightOffset.\n const fromWest =\n ((longitude - sourceRectangle.west) * (width - 1)) /\n (sourceRectangle.east - sourceRectangle.west);\n const fromSouth =\n ((latitude - sourceRectangle.south) * (height - 1)) /\n (sourceRectangle.north - sourceRectangle.south);\n\n let westInteger = fromWest | 0;\n let eastInteger = westInteger + 1;\n if (eastInteger >= width) {\n eastInteger = width - 1;\n westInteger = width - 2;\n }\n\n let southInteger = fromSouth | 0;\n let northInteger = southInteger + 1;\n if (northInteger >= height) {\n northInteger = height - 1;\n southInteger = height - 2;\n }\n\n const dx = fromWest - westInteger;\n const dy = fromSouth - southInteger;\n\n southInteger = height - 1 - southInteger;\n northInteger = height - 1 - northInteger;\n\n const southwestHeight =\n (encoding.decodeHeight(buffer, southInteger * width + westInteger) -\n heightOffset) /\n heightScale;\n const southeastHeight =\n (encoding.decodeHeight(buffer, southInteger * width + eastInteger) -\n heightOffset) /\n heightScale;\n const northwestHeight =\n (encoding.decodeHeight(buffer, northInteger * width + westInteger) -\n heightOffset) /\n heightScale;\n const northeastHeight =\n (encoding.decodeHeight(buffer, northInteger * width + eastInteger) -\n heightOffset) /\n heightScale;\n\n return triangleInterpolateHeight(\n dx,\n dy,\n southwestHeight,\n southeastHeight,\n northwestHeight,\n northeastHeight\n );\n}\n\nfunction triangleInterpolateHeight(\n dX,\n dY,\n southwestHeight,\n southeastHeight,\n northwestHeight,\n northeastHeight\n) {\n // The HeightmapTessellator bisects the quad from southwest to northeast.\n if (dY < dX) {\n // Lower right triangle\n return (\n southwestHeight +\n dX * (southeastHeight - southwestHeight) +\n dY * (northeastHeight - southeastHeight)\n );\n }\n\n // Upper left triangle\n return (\n southwestHeight +\n dX * (northeastHeight - northwestHeight) +\n dY * (northwestHeight - southwestHeight)\n );\n}\n\nfunction getHeight(\n heights,\n elementsPerHeight,\n elementMultiplier,\n stride,\n isBigEndian,\n index\n) {\n index *= stride;\n\n let height = 0;\n let i;\n\n if (isBigEndian) {\n for (i = 0; i < elementsPerHeight; ++i) {\n height = height * elementMultiplier + heights[index + i];\n }\n } else {\n for (i = elementsPerHeight - 1; i >= 0; --i) {\n height = height * elementMultiplier + heights[index + i];\n }\n }\n\n return height;\n}\n\nfunction setHeight(\n heights,\n elementsPerHeight,\n elementMultiplier,\n divisor,\n stride,\n isBigEndian,\n index,\n height\n) {\n index *= stride;\n\n let i;\n if (isBigEndian) {\n for (i = 0; i < elementsPerHeight - 1; ++i) {\n heights[index + i] = (height / divisor) | 0;\n height -= heights[index + i] * divisor;\n divisor /= elementMultiplier;\n }\n } else {\n for (i = elementsPerHeight - 1; i > 0; --i) {\n heights[index + i] = (height / divisor) | 0;\n height -= heights[index + i] * divisor;\n divisor /= elementMultiplier;\n }\n }\n heights[index + i] = height;\n}\nexport default HeightmapTerrainData;\n", "import binarySearch from \"./binarySearch.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport defined from \"./defined.js\";\nimport Rectangle from \"./Rectangle.js\";\n\n/**\n * Reports the availability of tiles in a {@link TilingScheme}.\n *\n * @alias TileAvailability\n * @constructor\n *\n * @param {TilingScheme} tilingScheme The tiling scheme in which to report availability.\n * @param {Number} maximumLevel The maximum tile level that is potentially available.\n */\nfunction TileAvailability(tilingScheme, maximumLevel) {\n this._tilingScheme = tilingScheme;\n this._maximumLevel = maximumLevel;\n\n this._rootNodes = [];\n}\n\nconst rectangleScratch = new Rectangle();\n\nfunction findNode(level, x, y, nodes) {\n const count = nodes.length;\n for (let i = 0; i < count; ++i) {\n const node = nodes[i];\n if (node.x === x && node.y === y && node.level === level) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Marks a rectangular range of tiles in a particular level as being available. For best performance,\n * add your ranges in order of increasing level.\n *\n * @param {Number} level The level.\n * @param {Number} startX The X coordinate of the first available tiles at the level.\n * @param {Number} startY The Y coordinate of the first available tiles at the level.\n * @param {Number} endX The X coordinate of the last available tiles at the level.\n * @param {Number} endY The Y coordinate of the last available tiles at the level.\n */\nTileAvailability.prototype.addAvailableTileRange = function (\n level,\n startX,\n startY,\n endX,\n endY\n) {\n const tilingScheme = this._tilingScheme;\n\n const rootNodes = this._rootNodes;\n if (level === 0) {\n for (let y = startY; y <= endY; ++y) {\n for (let x = startX; x <= endX; ++x) {\n if (!findNode(level, x, y, rootNodes)) {\n rootNodes.push(new QuadtreeNode(tilingScheme, undefined, 0, x, y));\n }\n }\n }\n }\n\n tilingScheme.tileXYToRectangle(startX, startY, level, rectangleScratch);\n const west = rectangleScratch.west;\n const north = rectangleScratch.north;\n\n tilingScheme.tileXYToRectangle(endX, endY, level, rectangleScratch);\n const east = rectangleScratch.east;\n const south = rectangleScratch.south;\n\n const rectangleWithLevel = new RectangleWithLevel(\n level,\n west,\n south,\n east,\n north\n );\n\n for (let i = 0; i < rootNodes.length; ++i) {\n const rootNode = rootNodes[i];\n if (rectanglesOverlap(rootNode.extent, rectangleWithLevel)) {\n putRectangleInQuadtree(this._maximumLevel, rootNode, rectangleWithLevel);\n }\n }\n};\n\n/**\n * Determines the level of the most detailed tile covering the position. This function\n * usually completes in time logarithmic to the number of rectangles added with\n * {@link TileAvailability#addAvailableTileRange}.\n *\n * @param {Cartographic} position The position for which to determine the maximum available level. The height component is ignored.\n * @return {Number} The level of the most detailed tile covering the position.\n * @throws {DeveloperError} If position is outside any tile according to the tiling scheme.\n */\nTileAvailability.prototype.computeMaximumLevelAtPosition = function (position) {\n // Find the root node that contains this position.\n let node;\n for (let nodeIndex = 0; nodeIndex < this._rootNodes.length; ++nodeIndex) {\n const rootNode = this._rootNodes[nodeIndex];\n if (rectangleContainsPosition(rootNode.extent, position)) {\n node = rootNode;\n break;\n }\n }\n\n if (!defined(node)) {\n return -1;\n }\n\n return findMaxLevelFromNode(undefined, node, position);\n};\n\nconst rectanglesScratch = [];\nconst remainingToCoverByLevelScratch = [];\nconst westScratch = new Rectangle();\nconst eastScratch = new Rectangle();\n\n/**\n * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed\n * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this\n * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function\n * usually completes in time logarithmic to the number of rectangles added with\n * {@link TileAvailability#addAvailableTileRange}.\n *\n * @param {Rectangle} rectangle The rectangle.\n * @return {Number} The best available level for the entire rectangle.\n */\nTileAvailability.prototype.computeBestAvailableLevelOverRectangle = function (\n rectangle\n) {\n const rectangles = rectanglesScratch;\n rectangles.length = 0;\n\n if (rectangle.east < rectangle.west) {\n // Rectangle crosses the IDL, make it two rectangles.\n rectangles.push(\n Rectangle.fromRadians(\n -Math.PI,\n rectangle.south,\n rectangle.east,\n rectangle.north,\n westScratch\n )\n );\n rectangles.push(\n Rectangle.fromRadians(\n rectangle.west,\n rectangle.south,\n Math.PI,\n rectangle.north,\n eastScratch\n )\n );\n } else {\n rectangles.push(rectangle);\n }\n\n const remainingToCoverByLevel = remainingToCoverByLevelScratch;\n remainingToCoverByLevel.length = 0;\n\n let i;\n for (i = 0; i < this._rootNodes.length; ++i) {\n updateCoverageWithNode(\n remainingToCoverByLevel,\n this._rootNodes[i],\n rectangles\n );\n }\n\n for (i = remainingToCoverByLevel.length - 1; i >= 0; --i) {\n if (\n defined(remainingToCoverByLevel[i]) &&\n remainingToCoverByLevel[i].length === 0\n ) {\n return i;\n }\n }\n\n return 0;\n};\n\nconst cartographicScratch = new Cartographic();\n\n/**\n * Determines if a particular tile is available.\n * @param {Number} level The tile level to check.\n * @param {Number} x The X coordinate of the tile to check.\n * @param {Number} y The Y coordinate of the tile to check.\n * @return {Boolean} True if the tile is available; otherwise, false.\n */\nTileAvailability.prototype.isTileAvailable = function (level, x, y) {\n // Get the center of the tile and find the maximum level at that position.\n // Because availability is by tile, if the level is available at that point, it\n // is sure to be available for the whole tile. We assume that if a tile at level n exists,\n // then all its parent tiles back to level 0 exist too. This isn't really enforced\n // anywhere, but Cesium would never load a tile for which this is not true.\n const rectangle = this._tilingScheme.tileXYToRectangle(\n x,\n y,\n level,\n rectangleScratch\n );\n Rectangle.center(rectangle, cartographicScratch);\n return this.computeMaximumLevelAtPosition(cartographicScratch) >= level;\n};\n\n/**\n * Computes a bit mask indicating which of a tile's four children exist.\n * If a child's bit is set, a tile is available for that child. If it is cleared,\n * the tile is not available. The bit values are as follows:\n * <table>\n * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n * <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n * <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n * <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n * <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n * </table>\n *\n * @param {Number} level The level of the parent tile.\n * @param {Number} x The X coordinate of the parent tile.\n * @param {Number} y The Y coordinate of the parent tile.\n * @return {Number} The bit mask indicating child availability.\n */\nTileAvailability.prototype.computeChildMaskForTile = function (level, x, y) {\n const childLevel = level + 1;\n if (childLevel >= this._maximumLevel) {\n return 0;\n }\n\n let mask = 0;\n\n mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y + 1) ? 1 : 0;\n mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y + 1) ? 2 : 0;\n mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y) ? 4 : 0;\n mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y) ? 8 : 0;\n\n return mask;\n};\n\nfunction QuadtreeNode(tilingScheme, parent, level, x, y) {\n this.tilingScheme = tilingScheme;\n this.parent = parent;\n this.level = level;\n this.x = x;\n this.y = y;\n this.extent = tilingScheme.tileXYToRectangle(x, y, level);\n\n this.rectangles = [];\n this._sw = undefined;\n this._se = undefined;\n this._nw = undefined;\n this._ne = undefined;\n}\n\nObject.defineProperties(QuadtreeNode.prototype, {\n nw: {\n get: function () {\n if (!this._nw) {\n this._nw = new QuadtreeNode(\n this.tilingScheme,\n this,\n this.level + 1,\n this.x * 2,\n this.y * 2\n );\n }\n return this._nw;\n },\n },\n\n ne: {\n get: function () {\n if (!this._ne) {\n this._ne = new QuadtreeNode(\n this.tilingScheme,\n this,\n this.level + 1,\n this.x * 2 + 1,\n this.y * 2\n );\n }\n return this._ne;\n },\n },\n\n sw: {\n get: function () {\n if (!this._sw) {\n this._sw = new QuadtreeNode(\n this.tilingScheme,\n this,\n this.level + 1,\n this.x * 2,\n this.y * 2 + 1\n );\n }\n return this._sw;\n },\n },\n\n se: {\n get: function () {\n if (!this._se) {\n this._se = new QuadtreeNode(\n this.tilingScheme,\n this,\n this.level + 1,\n this.x * 2 + 1,\n this.y * 2 + 1\n );\n }\n return this._se;\n },\n },\n});\n\nfunction RectangleWithLevel(level, west, south, east, north) {\n this.level = level;\n this.west = west;\n this.south = south;\n this.east = east;\n this.north = north;\n}\n\nfunction rectanglesOverlap(rectangle1, rectangle2) {\n const west = Math.max(rectangle1.west, rectangle2.west);\n const south = Math.max(rectangle1.south, rectangle2.south);\n const east = Math.min(rectangle1.east, rectangle2.east);\n const north = Math.min(rectangle1.north, rectangle2.north);\n return south < north && west < east;\n}\n\nfunction putRectangleInQuadtree(maxDepth, node, rectangle) {\n while (node.level < maxDepth) {\n if (rectangleFullyContainsRectangle(node.nw.extent, rectangle)) {\n node = node.nw;\n } else if (rectangleFullyContainsRectangle(node.ne.extent, rectangle)) {\n node = node.ne;\n } else if (rectangleFullyContainsRectangle(node.sw.extent, rectangle)) {\n node = node.sw;\n } else if (rectangleFullyContainsRectangle(node.se.extent, rectangle)) {\n node = node.se;\n } else {\n break;\n }\n }\n\n if (\n node.rectangles.length === 0 ||\n node.rectangles[node.rectangles.length - 1].level <= rectangle.level\n ) {\n node.rectangles.push(rectangle);\n } else {\n // Maintain ordering by level when inserting.\n let index = binarySearch(\n node.rectangles,\n rectangle.level,\n rectangleLevelComparator\n );\n if (index < 0) {\n index = ~index;\n }\n node.rectangles.splice(index, 0, rectangle);\n }\n}\n\nfunction rectangleLevelComparator(a, b) {\n return a.level - b;\n}\n\nfunction rectangleFullyContainsRectangle(potentialContainer, rectangleToTest) {\n return (\n rectangleToTest.west >= potentialContainer.west &&\n rectangleToTest.east <= potentialContainer.east &&\n rectangleToTest.south >= potentialContainer.south &&\n rectangleToTest.north <= potentialContainer.north\n );\n}\n\nfunction rectangleContainsPosition(potentialContainer, positionToTest) {\n return (\n positionToTest.longitude >= potentialContainer.west &&\n positionToTest.longitude <= potentialContainer.east &&\n positionToTest.latitude >= potentialContainer.south &&\n positionToTest.latitude <= potentialContainer.north\n );\n}\n\nfunction findMaxLevelFromNode(stopNode, node, position) {\n let maxLevel = 0;\n\n // Find the deepest quadtree node containing this point.\n let found = false;\n while (!found) {\n const nw = node._nw && rectangleContainsPosition(node._nw.extent, position);\n const ne = node._ne && rectangleContainsPosition(node._ne.extent, position);\n const sw = node._sw && rectangleContainsPosition(node._sw.extent, position);\n const se = node._se && rectangleContainsPosition(node._se.extent, position);\n\n // The common scenario is that the point is in only one quadrant and we can simply\n // iterate down the tree. But if the point is on a boundary between tiles, it is\n // in multiple tiles and we need to check all of them, so use recursion.\n if (nw + ne + sw + se > 1) {\n if (nw) {\n maxLevel = Math.max(\n maxLevel,\n findMaxLevelFromNode(node, node._nw, position)\n );\n }\n if (ne) {\n maxLevel = Math.max(\n maxLevel,\n findMaxLevelFromNode(node, node._ne, position)\n );\n }\n if (sw) {\n maxLevel = Math.max(\n maxLevel,\n findMaxLevelFromNode(node, node._sw, position)\n );\n }\n if (se) {\n maxLevel = Math.max(\n maxLevel,\n findMaxLevelFromNode(node, node._se, position)\n );\n }\n break;\n } else if (nw) {\n node = node._nw;\n } else if (ne) {\n node = node._ne;\n } else if (sw) {\n node = node._sw;\n } else if (se) {\n node = node._se;\n } else {\n found = true;\n }\n }\n\n // Work up the tree until we find a rectangle that contains this point.\n while (node !== stopNode) {\n const rectangles = node.rectangles;\n\n // Rectangles are sorted by level, lowest first.\n for (\n let i = rectangles.length - 1;\n i >= 0 && rectangles[i].level > maxLevel;\n --i\n ) {\n const rectangle = rectangles[i];\n if (rectangleContainsPosition(rectangle, position)) {\n maxLevel = rectangle.level;\n }\n }\n\n node = node.parent;\n }\n\n return maxLevel;\n}\n\nfunction updateCoverageWithNode(\n remainingToCoverByLevel,\n node,\n rectanglesToCover\n) {\n if (!node) {\n return;\n }\n\n let i;\n let anyOverlap = false;\n for (i = 0; i < rectanglesToCover.length; ++i) {\n anyOverlap =\n anyOverlap || rectanglesOverlap(node.extent, rectanglesToCover[i]);\n }\n\n if (!anyOverlap) {\n // This node is not applicable to the rectangle(s).\n return;\n }\n\n const rectangles = node.rectangles;\n for (i = 0; i < rectangles.length; ++i) {\n const rectangle = rectangles[i];\n\n if (!remainingToCoverByLevel[rectangle.level]) {\n remainingToCoverByLevel[rectangle.level] = rectanglesToCover;\n }\n\n remainingToCoverByLevel[rectangle.level] = subtractRectangle(\n remainingToCoverByLevel[rectangle.level],\n rectangle\n );\n }\n\n // Update with child nodes.\n updateCoverageWithNode(remainingToCoverByLevel, node._nw, rectanglesToCover);\n updateCoverageWithNode(remainingToCoverByLevel, node._ne, rectanglesToCover);\n updateCoverageWithNode(remainingToCoverByLevel, node._sw, rectanglesToCover);\n updateCoverageWithNode(remainingToCoverByLevel, node._se, rectanglesToCover);\n}\n\nfunction subtractRectangle(rectangleList, rectangleToSubtract) {\n const result = [];\n for (let i = 0; i < rectangleList.length; ++i) {\n const rectangle = rectangleList[i];\n if (!rectanglesOverlap(rectangle, rectangleToSubtract)) {\n // Disjoint rectangles. Original rectangle is unmodified.\n result.push(rectangle);\n } else {\n // rectangleToSubtract partially or completely overlaps rectangle.\n if (rectangle.west < rectangleToSubtract.west) {\n result.push(\n new Rectangle(\n rectangle.west,\n rectangle.south,\n rectangleToSubtract.west,\n rectangle.north\n )\n );\n }\n if (rectangle.east > rectangleToSubtract.east) {\n result.push(\n new Rectangle(\n rectangleToSubtract.east,\n rectangle.south,\n rectangle.east,\n rectangle.north\n )\n );\n }\n if (rectangle.south < rectangleToSubtract.south) {\n result.push(\n new Rectangle(\n Math.max(rectangleToSubtract.west, rectangle.west),\n rectangle.south,\n Math.min(rectangleToSubtract.east, rectangle.east),\n rectangleToSubtract.south\n )\n );\n }\n if (rectangle.north > rectangleToSubtract.north) {\n result.push(\n new Rectangle(\n Math.max(rectangleToSubtract.west, rectangle.west),\n rectangleToSubtract.north,\n Math.min(rectangleToSubtract.east, rectangle.east),\n rectangle.north\n )\n );\n }\n }\n }\n\n return result;\n}\nexport default TileAvailability;\n", "import defined from \"./defined.js\";\n\n/**\n * Formats an error object into a String. If available, uses name, message, and stack\n * properties, otherwise, falls back on toString().\n *\n * @function\n *\n * @param {*} object The item to find in the array.\n * @returns {String} A string containing the formatted error.\n */\nfunction formatError(object) {\n let result;\n\n const name = object.name;\n const message = object.message;\n if (defined(name) && defined(message)) {\n result = `${name}: ${message}`;\n } else {\n result = object.toString();\n }\n\n const stack = object.stack;\n if (defined(stack)) {\n result += `\\n${stack}`;\n }\n\n return result;\n}\nexport default formatError;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport formatError from \"./formatError.js\";\n\n/**\n * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.\n *\n * @alias TileProviderError\n * @constructor\n *\n * @param {ImageryProvider|TerrainProvider} provider The imagery or terrain provider that experienced the error.\n * @param {String} message A message describing the error.\n * @param {Number} [x] The X coordinate of the tile that experienced the error, or undefined if the error\n * is not specific to a particular tile.\n * @param {Number} [y] The Y coordinate of the tile that experienced the error, or undefined if the error\n * is not specific to a particular tile.\n * @param {Number} [level] The level of the tile that experienced the error, or undefined if the error\n * is not specific to a particular tile.\n * @param {Number} [timesRetried=0] The number of times this operation has been retried.\n * @param {Error} [error] The error or exception that occurred, if any.\n */\nfunction TileProviderError(\n provider,\n message,\n x,\n y,\n level,\n timesRetried,\n error\n) {\n /**\n * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.\n * @type {ImageryProvider|TerrainProvider}\n */\n this.provider = provider;\n\n /**\n * The message describing the error.\n * @type {String}\n */\n this.message = message;\n\n /**\n * The X coordinate of the tile that experienced the error. If the error is not specific\n * to a particular tile, this property will be undefined.\n * @type {Number}\n */\n this.x = x;\n\n /**\n * The Y coordinate of the tile that experienced the error. If the error is not specific\n * to a particular tile, this property will be undefined.\n * @type {Number}\n */\n this.y = y;\n\n /**\n * The level-of-detail of the tile that experienced the error. If the error is not specific\n * to a particular tile, this property will be undefined.\n * @type {Number}\n */\n this.level = level;\n\n /**\n * The number of times this operation has been retried.\n * @type {Number}\n * @default 0\n */\n this.timesRetried = defaultValue(timesRetried, 0);\n\n /**\n * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider\n * will set the initial value of this property before raising the event, but any listeners\n * can change it. The value after the last listener is invoked will be acted upon.\n * @type {Boolean}\n * @default false\n */\n this.retry = false;\n\n /**\n * The error or exception that occurred, if any.\n * @type {Error}\n */\n this.error = error;\n}\n\n/**\n * Reports an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by\n * logging the error to the console if the event has no listeners. This method also tracks the number\n * of times the operation has been retried.\n *\n * @param {TileProviderError} previousError The error instance returned by this function the last\n * time it was called for this error, or undefined if this is the first time this error has\n * occurred.\n * @param {ImageryProvider|TerrainProvider} provider The imagery or terrain provider that encountered the error.\n * @param {Event} event The event to raise to inform listeners of the error.\n * @param {String} message The message describing the error.\n * @param {Number} x The X coordinate of the tile that experienced the error, or undefined if the\n * error is not specific to a particular tile.\n * @param {Number} y The Y coordinate of the tile that experienced the error, or undefined if the\n * error is not specific to a particular tile.\n * @param {Number} level The level-of-detail of the tile that experienced the error, or undefined if the\n * error is not specific to a particular tile.\n * @param {Error} [errorDetails] The error or exception that occurred, if any.\n * @returns {TileProviderError} The error instance that was passed to the event listeners and that\n * should be passed to this function the next time it is called for the same error in order\n * to track retry counts.\n */\nTileProviderError.reportError = function (\n previousError,\n provider,\n event,\n message,\n x,\n y,\n level,\n errorDetails\n) {\n let error = previousError;\n if (!defined(previousError)) {\n error = new TileProviderError(\n provider,\n message,\n x,\n y,\n level,\n 0,\n errorDetails\n );\n } else {\n error.provider = provider;\n error.message = message;\n error.x = x;\n error.y = y;\n error.level = level;\n error.retry = false;\n error.error = errorDetails;\n ++error.timesRetried;\n }\n\n if (event.numberOfListeners > 0) {\n event.raiseEvent(error);\n } else {\n console.log(\n `An error occurred in \"${provider.constructor.name}\": ${formatError(\n message\n )}`\n );\n }\n\n return error;\n};\n\n/**\n * Reports success of an operation by resetting the retry count of a previous error, if any. This way,\n * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.\n *\n * @param {TileProviderError} previousError The previous error, or undefined if this operation has\n * not previously resulted in an error.\n */\nTileProviderError.reportSuccess = function (previousError) {\n if (defined(previousError)) {\n previousError.timesRetried = -1;\n }\n};\n\n/**\n * A function that will be called to retry the operation.\n * @callback TileProviderError.RetryFunction\n */\nexport default TileProviderError;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\n/**\n * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is\n * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.\n *\n * @alias WebMercatorTilingScheme\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to\n * the WGS84 ellipsoid.\n * @param {Number} [options.numberOfLevelZeroTilesX=1] The number of tiles in the X direction at level zero of\n * the tile tree.\n * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of\n * the tile tree.\n * @param {Cartesian2} [options.rectangleSouthwestInMeters] The southwest corner of the rectangle covered by the\n * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire\n * globe is covered in the longitude direction and an equal distance is covered in the latitude\n * direction, resulting in a square projection.\n * @param {Cartesian2} [options.rectangleNortheastInMeters] The northeast corner of the rectangle covered by the\n * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire\n * globe is covered in the longitude direction and an equal distance is covered in the latitude\n * direction, resulting in a square projection.\n */\nfunction WebMercatorTilingScheme(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._numberOfLevelZeroTilesX = defaultValue(\n options.numberOfLevelZeroTilesX,\n 1\n );\n this._numberOfLevelZeroTilesY = defaultValue(\n options.numberOfLevelZeroTilesY,\n 1\n );\n\n this._projection = new WebMercatorProjection(this._ellipsoid);\n\n if (\n defined(options.rectangleSouthwestInMeters) &&\n defined(options.rectangleNortheastInMeters)\n ) {\n this._rectangleSouthwestInMeters = options.rectangleSouthwestInMeters;\n this._rectangleNortheastInMeters = options.rectangleNortheastInMeters;\n } else {\n const semimajorAxisTimesPi = this._ellipsoid.maximumRadius * Math.PI;\n this._rectangleSouthwestInMeters = new Cartesian2(\n -semimajorAxisTimesPi,\n -semimajorAxisTimesPi\n );\n this._rectangleNortheastInMeters = new Cartesian2(\n semimajorAxisTimesPi,\n semimajorAxisTimesPi\n );\n }\n\n const southwest = this._projection.unproject(\n this._rectangleSouthwestInMeters\n );\n const northeast = this._projection.unproject(\n this._rectangleNortheastInMeters\n );\n this._rectangle = new Rectangle(\n southwest.longitude,\n southwest.latitude,\n northeast.longitude,\n northeast.latitude\n );\n}\n\nObject.defineProperties(WebMercatorTilingScheme.prototype, {\n /**\n * Gets the ellipsoid that is tiled by this tiling scheme.\n * @memberof WebMercatorTilingScheme.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n\n /**\n * Gets the rectangle, in radians, covered by this tiling scheme.\n * @memberof WebMercatorTilingScheme.prototype\n * @type {Rectangle}\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n\n /**\n * Gets the map projection used by this tiling scheme.\n * @memberof WebMercatorTilingScheme.prototype\n * @type {MapProjection}\n */\n projection: {\n get: function () {\n return this._projection;\n },\n },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the X direction at the given level.\n */\nWebMercatorTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {\n return this._numberOfLevelZeroTilesX << level;\n};\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the Y direction at the given level.\n */\nWebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {\n return this._numberOfLevelZeroTilesY << level;\n};\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n * is undefined.\n */\nWebMercatorTilingScheme.prototype.rectangleToNativeRectangle = function (\n rectangle,\n result\n) {\n const projection = this._projection;\n const southwest = projection.project(Rectangle.southwest(rectangle));\n const northeast = projection.project(Rectangle.northeast(rectangle));\n\n if (!defined(result)) {\n return new Rectangle(southwest.x, southwest.y, northeast.x, northeast.y);\n }\n\n result.west = southwest.x;\n result.south = southwest.y;\n result.east = northeast.x;\n result.north = northeast.y;\n return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.tileXYToNativeRectangle = function (\n x,\n y,\n level,\n result\n) {\n const xTiles = this.getNumberOfXTilesAtLevel(level);\n const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n const xTileWidth =\n (this._rectangleNortheastInMeters.x - this._rectangleSouthwestInMeters.x) /\n xTiles;\n const west = this._rectangleSouthwestInMeters.x + x * xTileWidth;\n const east = this._rectangleSouthwestInMeters.x + (x + 1) * xTileWidth;\n\n const yTileHeight =\n (this._rectangleNortheastInMeters.y - this._rectangleSouthwestInMeters.y) /\n yTiles;\n const north = this._rectangleNortheastInMeters.y - y * yTileHeight;\n const south = this._rectangleNortheastInMeters.y - (y + 1) * yTileHeight;\n\n if (!defined(result)) {\n return new Rectangle(west, south, east, north);\n }\n\n result.west = west;\n result.south = south;\n result.east = east;\n result.north = north;\n return result;\n};\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.tileXYToRectangle = function (\n x,\n y,\n level,\n result\n) {\n const nativeRectangle = this.tileXYToNativeRectangle(x, y, level, result);\n\n const projection = this._projection;\n const southwest = projection.unproject(\n new Cartesian2(nativeRectangle.west, nativeRectangle.south)\n );\n const northeast = projection.unproject(\n new Cartesian2(nativeRectangle.east, nativeRectangle.north)\n );\n\n nativeRectangle.west = southwest.longitude;\n nativeRectangle.south = southwest.latitude;\n nativeRectangle.east = northeast.longitude;\n nativeRectangle.north = northeast.latitude;\n return nativeRectangle;\n};\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n *\n * @param {Cartographic} position The position.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n * if 'result' is undefined.\n */\nWebMercatorTilingScheme.prototype.positionToTileXY = function (\n position,\n level,\n result\n) {\n const rectangle = this._rectangle;\n if (!Rectangle.contains(rectangle, position)) {\n // outside the bounds of the tiling scheme\n return undefined;\n }\n\n const xTiles = this.getNumberOfXTilesAtLevel(level);\n const yTiles = this.getNumberOfYTilesAtLevel(level);\n\n const overallWidth =\n this._rectangleNortheastInMeters.x - this._rectangleSouthwestInMeters.x;\n const xTileWidth = overallWidth / xTiles;\n const overallHeight =\n this._rectangleNortheastInMeters.y - this._rectangleSouthwestInMeters.y;\n const yTileHeight = overallHeight / yTiles;\n\n const projection = this._projection;\n\n const webMercatorPosition = projection.project(position);\n const distanceFromWest =\n webMercatorPosition.x - this._rectangleSouthwestInMeters.x;\n const distanceFromNorth =\n this._rectangleNortheastInMeters.y - webMercatorPosition.y;\n\n let xTileCoordinate = (distanceFromWest / xTileWidth) | 0;\n if (xTileCoordinate >= xTiles) {\n xTileCoordinate = xTiles - 1;\n }\n let yTileCoordinate = (distanceFromNorth / yTileHeight) | 0;\n if (yTileCoordinate >= yTiles) {\n yTileCoordinate = yTiles - 1;\n }\n\n if (!defined(result)) {\n return new Cartesian2(xTileCoordinate, yTileCoordinate);\n }\n\n result.x = xTileCoordinate;\n result.y = yTileCoordinate;\n return result;\n};\nexport default WebMercatorTilingScheme;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapEncoding from \"./HeightmapEncoding.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Request from \"./Request.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileAvailability from \"./TileAvailability.js\";\nimport TileProviderError from \"./TileProviderError.js\";\nimport WebMercatorTilingScheme from \"./WebMercatorTilingScheme.js\";\n\nconst ALL_CHILDREN = 15;\n\n/**\n * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from Elevation Tiles of an an ArcGIS ImageService.\n *\n * @alias ArcGISTiledElevationTerrainProvider\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String|Promise<Resource>|Promise<String>} options.url The URL of the ArcGIS ImageServer service.\n * @param {String} [options.token] The authorization token to use to connect to the service.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead.\n * If neither parameter is specified, the WGS84 ellipsoid is used.\n *\n * @example\n * const terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({\n * url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',\n * token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'\n * });\n * viewer.terrainProvider = terrainProvider;\n *\n * @see TerrainProvider\n */\nfunction ArcGISTiledElevationTerrainProvider(options) {\n this._resource = undefined;\n this._credit = undefined;\n this._tilingScheme = undefined;\n this._levelZeroMaximumGeometricError = undefined;\n this._maxLevel = undefined;\n this._terrainDataStructure = undefined;\n this._ready = false;\n this._width = undefined;\n this._height = undefined;\n this._encoding = undefined;\n const token = options.token;\n\n this._hasAvailability = false;\n this._tilesAvailable = undefined;\n this._tilesAvailablityLoaded = undefined;\n this._availableCache = {};\n\n const that = this;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._readyPromise = Promise.resolve(options.url)\n .then(function (url) {\n let resource = Resource.createIfNeeded(url);\n resource.appendForwardSlash();\n if (defined(token)) {\n resource = resource.getDerivedResource({\n queryParameters: {\n token: token,\n },\n });\n }\n that._resource = resource;\n\n const metadataResource = resource.getDerivedResource({\n queryParameters: {\n f: \"pjson\",\n },\n });\n\n return metadataResource.fetchJson();\n })\n .then(function (metadata) {\n const copyrightText = metadata.copyrightText;\n if (defined(copyrightText)) {\n that._credit = new Credit(copyrightText);\n }\n\n const spatialReference = metadata.spatialReference;\n const wkid = defaultValue(\n spatialReference.latestWkid,\n spatialReference.wkid\n );\n const extent = metadata.extent;\n const tilingSchemeOptions = {\n ellipsoid: ellipsoid,\n };\n if (wkid === 4326) {\n tilingSchemeOptions.rectangle = Rectangle.fromDegrees(\n extent.xmin,\n extent.ymin,\n extent.xmax,\n extent.ymax\n );\n that._tilingScheme = new GeographicTilingScheme(tilingSchemeOptions);\n } else if (wkid === 3857) {\n tilingSchemeOptions.rectangleSouthwestInMeters = new Cartesian2(\n extent.xmin,\n extent.ymin\n );\n tilingSchemeOptions.rectangleNortheastInMeters = new Cartesian2(\n extent.xmax,\n extent.ymax\n );\n that._tilingScheme = new WebMercatorTilingScheme(tilingSchemeOptions);\n } else {\n return Promise.reject(new RuntimeError(\"Invalid spatial reference\"));\n }\n\n const tileInfo = metadata.tileInfo;\n if (!defined(tileInfo)) {\n return Promise.reject(new RuntimeError(\"tileInfo is required\"));\n }\n\n that._width = tileInfo.rows + 1;\n that._height = tileInfo.cols + 1;\n that._encoding =\n tileInfo.format === \"LERC\"\n ? HeightmapEncoding.LERC\n : HeightmapEncoding.NONE;\n that._lodCount = tileInfo.lods.length - 1;\n\n const hasAvailability = (that._hasAvailability =\n metadata.capabilities.indexOf(\"Tilemap\") !== -1);\n if (hasAvailability) {\n that._tilesAvailable = new TileAvailability(\n that._tilingScheme,\n that._lodCount\n );\n that._tilesAvailable.addAvailableTileRange(\n 0,\n 0,\n 0,\n that._tilingScheme.getNumberOfXTilesAtLevel(0),\n that._tilingScheme.getNumberOfYTilesAtLevel(0)\n );\n that._tilesAvailablityLoaded = new TileAvailability(\n that._tilingScheme,\n that._lodCount\n );\n }\n\n that._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n that._tilingScheme.ellipsoid,\n that._width,\n that._tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n\n if (metadata.bandCount > 1) {\n console.log(\n \"ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one.\"\n );\n }\n\n that._terrainDataStructure = {\n elementMultiplier: 1.0,\n lowestEncodedHeight: metadata.minValues[0],\n highestEncodedHeight: metadata.maxValues[0],\n };\n\n that._ready = true;\n\n return true;\n })\n .catch(function (error) {\n const message = `An error occurred while accessing ${that._resource.url}.`;\n TileProviderError.reportError(undefined, that, that._errorEvent, message);\n return Promise.reject(error);\n });\n\n this._errorEvent = new Event();\n}\n\nObject.defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\nreturn this._credit;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {GeographicTilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\nreturn this._tilingScheme;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: function () {\n return false;\n },\n },\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link TerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available.\n * @memberof ArcGISTiledElevationTerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: function () {\nreturn this._tilesAvailable;\n },\n },\n});\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n */\nArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const tileResource = this._resource.getDerivedResource({\n url: `tile/${level}/${y}/${x}`,\n request: request,\n });\n\n const hasAvailability = this._hasAvailability;\n let availabilityPromise = Promise.resolve(true);\n let availabilityRequest;\n if (\n hasAvailability &&\n !defined(isTileAvailable(this, level + 1, x * 2, y * 2))\n ) {\n // We need to load child availability\n const availabilityResult = requestAvailability(\n this,\n level + 1,\n x * 2,\n y * 2\n );\n\n availabilityPromise = availabilityResult.promise;\n availabilityRequest = availabilityResult.request;\n }\n\n const promise = tileResource.fetchArrayBuffer();\n if (!defined(promise) || !defined(availabilityPromise)) {\n return undefined;\n }\n\n const that = this;\n const tilesAvailable = this._tilesAvailable;\n return Promise.all([promise, availabilityPromise])\n .then(function (result) {\n return new HeightmapTerrainData({\n buffer: result[0],\n width: that._width,\n height: that._height,\n childTileMask: hasAvailability\n ? tilesAvailable.computeChildMaskForTile(level, x, y)\n : ALL_CHILDREN,\n structure: that._terrainDataStructure,\n encoding: that._encoding,\n });\n })\n .catch(function (error) {\n if (\n defined(availabilityRequest) &&\n availabilityRequest.state === RequestState.CANCELLED\n ) {\n request.cancel();\n\n // Don't reject the promise till the request is actually cancelled\n // Otherwise it will think the request failed, but it didn't.\n return request.deferred.promise.finally(function () {\n request.state = RequestState.CANCELLED;\n return Promise.reject(error);\n });\n }\n return Promise.reject(error);\n });\n};\n\nfunction isTileAvailable(that, level, x, y) {\n if (!that._hasAvailability) {\n return undefined;\n }\n\n const tilesAvailablityLoaded = that._tilesAvailablityLoaded;\n const tilesAvailable = that._tilesAvailable;\n\n if (level > that._lodCount) {\n return false;\n }\n\n // Check if tiles are known to be available\n if (tilesAvailable.isTileAvailable(level, x, y)) {\n return true;\n }\n\n // or to not be available\n if (tilesAvailablityLoaded.isTileAvailable(level, x, y)) {\n return false;\n }\n\n return undefined;\n}\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function (\n x,\n y,\n level\n) {\n if (!this._hasAvailability) {\n return undefined;\n }\n\n const result = isTileAvailable(this, level, x, y);\n if (defined(result)) {\n return result;\n }\n\n requestAvailability(this, level, x, y);\n\n return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined} This provider does not support loading availability.\n */\nArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\nfunction findRange(origin, width, height, data) {\n const endCol = width - 1;\n const endRow = height - 1;\n\n const value = data[origin.y * width + origin.x];\n const endingIndices = [];\n const range = {\n startX: origin.x,\n startY: origin.y,\n endX: 0,\n endY: 0,\n };\n\n const corner = new Cartesian2(origin.x + 1, origin.y + 1);\n let doneX = false;\n let doneY = false;\n while (!(doneX && doneY)) {\n // We want to use the original value when checking Y,\n // so get it before it possibly gets incremented\n let endX = corner.x;\n\n // If we no longer move in the Y direction we need to check the corner tile in X pass\n const endY = doneY ? corner.y + 1 : corner.y;\n\n // Check X range\n if (!doneX) {\n for (let y = origin.y; y < endY; ++y) {\n if (data[y * width + corner.x] !== value) {\n doneX = true;\n break;\n }\n }\n\n if (doneX) {\n endingIndices.push(new Cartesian2(corner.x, origin.y));\n\n // Use the last good column so we can continue with Y\n --corner.x;\n --endX;\n range.endX = corner.x;\n } else if (corner.x === endCol) {\n range.endX = corner.x;\n doneX = true;\n } else {\n ++corner.x;\n }\n }\n\n // Check Y range - The corner tile is checked here\n if (!doneY) {\n const col = corner.y * width;\n for (let x = origin.x; x <= endX; ++x) {\n if (data[col + x] !== value) {\n doneY = true;\n break;\n }\n }\n\n if (doneY) {\n endingIndices.push(new Cartesian2(origin.x, corner.y));\n\n // Use the last good row so we can continue with X\n --corner.y;\n range.endY = corner.y;\n } else if (corner.y === endRow) {\n range.endY = corner.y;\n doneY = true;\n } else {\n ++corner.y;\n }\n }\n }\n\n return {\n endingIndices: endingIndices,\n range: range,\n value: value,\n };\n}\n\nfunction computeAvailability(x, y, width, height, data) {\n const ranges = [];\n\n const singleValue = data.every(function (val) {\n return val === data[0];\n });\n if (singleValue) {\n if (data[0] === 1) {\n ranges.push({\n startX: x,\n startY: y,\n endX: x + width - 1,\n endY: y + height - 1,\n });\n }\n\n return ranges;\n }\n\n let positions = [new Cartesian2(0, 0)];\n while (positions.length > 0) {\n const origin = positions.pop();\n const result = findRange(origin, width, height, data);\n\n if (result.value === 1) {\n // Convert range into the array into global tile coordinates\n const range = result.range;\n range.startX += x;\n range.endX += x;\n range.startY += y;\n range.endY += y;\n ranges.push(range);\n }\n\n const endingIndices = result.endingIndices;\n if (endingIndices.length > 0) {\n positions = positions.concat(endingIndices);\n }\n }\n\n return ranges;\n}\n\nfunction requestAvailability(that, level, x, y) {\n if (!that._hasAvailability) {\n return {};\n }\n\n // Fetch 128x128 availability list, so we make the minimum amount of requests\n const xOffset = Math.floor(x / 128) * 128;\n const yOffset = Math.floor(y / 128) * 128;\n\n const dim = Math.min(1 << level, 128);\n const url = `tilemap/${level}/${yOffset}/${xOffset}/${dim}/${dim}`;\n\n const availableCache = that._availableCache;\n if (defined(availableCache[url])) {\n return availableCache[url];\n }\n\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.TERRAIN,\n });\n\n const tilemapResource = that._resource.getDerivedResource({\n url: url,\n request: request,\n });\n\n let promise = tilemapResource.fetchJson();\n if (!defined(promise)) {\n return {};\n }\n\n promise = promise.then(function (result) {\n const available = computeAvailability(\n xOffset,\n yOffset,\n dim,\n dim,\n result.data\n );\n\n // Mark whole area as having availability loaded\n that._tilesAvailablityLoaded.addAvailableTileRange(\n level,\n xOffset,\n yOffset,\n xOffset + dim,\n yOffset + dim\n );\n\n const tilesAvailable = that._tilesAvailable;\n for (let i = 0; i < available.length; ++i) {\n const range = available[i];\n tilesAvailable.addAvailableTileRange(\n level,\n range.startX,\n range.startY,\n range.endX,\n range.endY\n );\n }\n\n // Conveniently return availability of original tile\n return isTileAvailable(that, level, x, y);\n });\n\n availableCache[url] = {\n promise: promise,\n request: request,\n };\n\n promise = promise.finally(function (result) {\n delete availableCache[url];\n\n return result;\n });\n\n return {\n promise: promise,\n request: request,\n };\n}\nexport default ArcGISTiledElevationTerrainProvider;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst url = \"https://dev.virtualearth.net/REST/v1/Locations\";\n\n/**\n * Provides geocoding through Bing Maps.\n * @alias BingMapsGeocoderService\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.key A key to use with the Bing Maps geocoding service\n * @param {String} [options.culture] A Bing Maps {@link https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes|Culture Code} to return results in a specific culture and language.\n */\nfunction BingMapsGeocoderService(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const key = options.key;\n this._key = key;\n\n const queryParameters = {\n key: key,\n };\n\n if (defined(options.culture)) {\n queryParameters.culture = options.culture;\n }\n\n this._resource = new Resource({\n url: url,\n queryParameters: queryParameters,\n });\n}\n\nObject.defineProperties(BingMapsGeocoderService.prototype, {\n /**\n * The URL endpoint for the Bing geocoder service\n * @type {String}\n * @memberof BingMapsGeocoderService.prototype\n * @readonly\n */\n url: {\n get: function () {\n return url;\n },\n },\n\n /**\n * The key for the Bing geocoder service\n * @type {String}\n * @memberof BingMapsGeocoderService.prototype\n * @readonly\n */\n key: {\n get: function () {\n return this._key;\n },\n },\n});\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nBingMapsGeocoderService.prototype.geocode = function (query) {\n const resource = this._resource.getDerivedResource({\n queryParameters: {\n query: query,\n },\n });\n\n return resource.fetchJsonp(\"jsonp\").then(function (result) {\n if (result.resourceSets.length === 0) {\n return [];\n }\n\n const results = result.resourceSets[0].resources;\n\n return results.map(function (resource) {\n const bbox = resource.bbox;\n const south = bbox[0];\n const west = bbox[1];\n const north = bbox[2];\n const east = bbox[3];\n return {\n displayName: resource.name,\n destination: Rectangle.fromDegrees(west, south, east, north),\n };\n });\n });\n};\nexport default BingMapsGeocoderService;\n", "import defined from \"./defined.js\";\nimport deprecationWarning from \"./deprecationWarning.js\";\n\nlet implementation;\nif (typeof cancelAnimationFrame !== \"undefined\") {\n implementation = cancelAnimationFrame;\n}\n\n(function () {\n // look for vendor prefixed function\n if (!defined(implementation) && typeof window !== \"undefined\") {\n const vendors = [\"webkit\", \"moz\", \"ms\", \"o\"];\n let i = 0;\n const len = vendors.length;\n while (i < len && !defined(implementation)) {\n implementation = window[`${vendors[i]}CancelAnimationFrame`];\n if (!defined(implementation)) {\n implementation = window[`${vendors[i]}CancelRequestAnimationFrame`];\n }\n ++i;\n }\n }\n\n // otherwise, assume requestAnimationFrame is based on setTimeout, so use clearTimeout\n if (!defined(implementation)) {\n implementation = clearTimeout;\n }\n})();\n\n/**\n * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.\n *\n * @function cancelAnimationFrame\n *\n * @param {Number} requestID The value returned by {@link requestAnimationFrame}.\n *\n * @see {@link http://www.w3.org/TR/animation-timing/#the-WindowAnimationTiming-interface|The WindowAnimationTiming interface}\n *\n * @deprecated\n */\nfunction cancelAnimationFramePolyfill(requestID) {\n // we need this extra wrapper function because the native cancelAnimationFrame\n // functions must be invoked on the global scope (window), which is not the case\n // if invoked as Cesium.cancelAnimationFrame(requestID)\n\n deprecationWarning(\n \"Cesium.cancelAnimationFrame\",\n \"Cesium.cancelAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native cancelAnimationFrame method instead.\"\n );\n\n implementation(requestID);\n}\nexport default cancelAnimationFramePolyfill;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\n\n/**\n * Geocodes queries containing longitude and latitude coordinates and an optional height.\n * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.\n *\n * @alias CartographicGeocoderService\n * @constructor\n */\nfunction CartographicGeocoderService() {}\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nCartographicGeocoderService.prototype.geocode = function (query) {\n const splitQuery = query.match(/[^\\s,\\n]+/g);\n if (splitQuery.length === 2 || splitQuery.length === 3) {\n let longitude = +splitQuery[0];\n let latitude = +splitQuery[1];\n const height = splitQuery.length === 3 ? +splitQuery[2] : 300.0;\n\n if (isNaN(longitude) && isNaN(latitude)) {\n const coordTest = /^(\\d+.?\\d*)([nsew])/i;\n for (let i = 0; i < splitQuery.length; ++i) {\n const splitCoord = splitQuery[i].match(coordTest);\n if (coordTest.test(splitQuery[i]) && splitCoord.length === 3) {\n if (/^[ns]/i.test(splitCoord[2])) {\n latitude = /^[n]/i.test(splitCoord[2])\n ? +splitCoord[1]\n : -splitCoord[1];\n } else if (/^[ew]/i.test(splitCoord[2])) {\n longitude = /^[e]/i.test(splitCoord[2])\n ? +splitCoord[1]\n : -splitCoord[1];\n }\n }\n }\n }\n\n if (!isNaN(longitude) && !isNaN(latitude) && !isNaN(height)) {\n const result = {\n displayName: query,\n destination: Cartesian3.fromDegrees(longitude, latitude, height),\n };\n return Promise.resolve([result]);\n }\n }\n return Promise.resolve([]);\n};\nexport default CartographicGeocoderService;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport HermiteSpline from \"./HermiteSpline.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport Spline from \"./Spline.js\";\n\nconst scratchTimeVec = new Cartesian4();\nconst scratchTemp0 = new Cartesian3();\nconst scratchTemp1 = new Cartesian3();\n\nfunction createEvaluateFunction(spline) {\n const points = spline.points;\n const times = spline.times;\n\n if (points.length < 3) {\n const t0 = times[0];\n const invSpan = 1.0 / (times[1] - t0);\n\n const p0 = points[0];\n const p1 = points[1];\n\n return function (time, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n const u = (time - t0) * invSpan;\n return Cartesian3.lerp(p0, p1, u, result);\n };\n }\n\n return function (time, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n const i = (spline._lastTimeIndex = spline.findTimeInterval(\n time,\n spline._lastTimeIndex\n ));\n const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n const timeVec = scratchTimeVec;\n timeVec.z = u;\n timeVec.y = u * u;\n timeVec.x = timeVec.y * u;\n timeVec.w = 1.0;\n\n let p0;\n let p1;\n let p2;\n let p3;\n let coefs;\n\n if (i === 0) {\n p0 = points[0];\n p1 = points[1];\n p2 = spline.firstTangent;\n\n p3 = Cartesian3.subtract(points[2], p0, scratchTemp0);\n Cartesian3.multiplyByScalar(p3, 0.5, p3);\n\n coefs = Matrix4.multiplyByVector(\n HermiteSpline.hermiteCoefficientMatrix,\n timeVec,\n timeVec\n );\n } else if (i === points.length - 2) {\n p0 = points[i];\n p1 = points[i + 1];\n p3 = spline.lastTangent;\n\n p2 = Cartesian3.subtract(p1, points[i - 1], scratchTemp0);\n Cartesian3.multiplyByScalar(p2, 0.5, p2);\n\n coefs = Matrix4.multiplyByVector(\n HermiteSpline.hermiteCoefficientMatrix,\n timeVec,\n timeVec\n );\n } else {\n p0 = points[i - 1];\n p1 = points[i];\n p2 = points[i + 1];\n p3 = points[i + 2];\n coefs = Matrix4.multiplyByVector(\n CatmullRomSpline.catmullRomCoefficientMatrix,\n timeVec,\n timeVec\n );\n }\n result = Cartesian3.multiplyByScalar(p0, coefs.x, result);\n Cartesian3.multiplyByScalar(p1, coefs.y, scratchTemp1);\n Cartesian3.add(result, scratchTemp1, result);\n Cartesian3.multiplyByScalar(p2, coefs.z, scratchTemp1);\n Cartesian3.add(result, scratchTemp1, result);\n Cartesian3.multiplyByScalar(p3, coefs.w, scratchTemp1);\n return Cartesian3.add(result, scratchTemp1, result);\n };\n}\n\nconst firstTangentScratch = new Cartesian3();\nconst lastTangentScratch = new Cartesian3();\n\n/**\n * A Catmull-Rom spline is a cubic spline where the tangent at control points,\n * except the first and last, are computed using the previous and next control points.\n * Catmull-Rom splines are in the class C<sup>1</sup>.\n *\n * @alias CatmullRomSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n * The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Cartesian3[]} options.points The array of {@link Cartesian3} control points.\n * @param {Cartesian3} [options.firstTangent] The tangent of the curve at the first control point.\n * If the tangent is not given, it will be estimated.\n * @param {Cartesian3} [options.lastTangent] The tangent of the curve at the last control point.\n * If the tangent is not given, it will be estimated.\n *\n * @exception {DeveloperError} points.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be equal to points.length.\n *\n *\n * @example\n * // spline above the earth from Philadelphia to Los Angeles\n * const spline = new Cesium.CatmullRomSpline({\n * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],\n * points : [\n * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),\n * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),\n * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),\n * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),\n * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)\n * ]\n * });\n *\n * const p0 = spline.evaluate(times[i]); // equal to positions[i]\n * const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see HermiteSpline\n * @see LinearSpline\n * @see QuaternionSpline\n * @see MorphWeightSpline\n */\nfunction CatmullRomSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const points = options.points;\n const times = options.times;\n let firstTangent = options.firstTangent;\n let lastTangent = options.lastTangent;\n\n if (points.length > 2) {\n if (!defined(firstTangent)) {\n firstTangent = firstTangentScratch;\n Cartesian3.multiplyByScalar(points[1], 2.0, firstTangent);\n Cartesian3.subtract(firstTangent, points[2], firstTangent);\n Cartesian3.subtract(firstTangent, points[0], firstTangent);\n Cartesian3.multiplyByScalar(firstTangent, 0.5, firstTangent);\n }\n\n if (!defined(lastTangent)) {\n const n = points.length - 1;\n lastTangent = lastTangentScratch;\n Cartesian3.multiplyByScalar(points[n - 1], 2.0, lastTangent);\n Cartesian3.subtract(points[n], lastTangent, lastTangent);\n Cartesian3.add(lastTangent, points[n - 2], lastTangent);\n Cartesian3.multiplyByScalar(lastTangent, 0.5, lastTangent);\n }\n }\n\n this._times = times;\n this._points = points;\n this._firstTangent = Cartesian3.clone(firstTangent);\n this._lastTangent = Cartesian3.clone(lastTangent);\n\n this._evaluateFunction = createEvaluateFunction(this);\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(CatmullRomSpline.prototype, {\n /**\n * An array of times for the control points.\n *\n * @memberof CatmullRomSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of {@link Cartesian3} control points.\n *\n * @memberof CatmullRomSpline.prototype\n *\n * @type {Cartesian3[]}\n * @readonly\n */\n points: {\n get: function () {\n return this._points;\n },\n },\n\n /**\n * The tangent at the first control point.\n *\n * @memberof CatmullRomSpline.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n firstTangent: {\n get: function () {\n return this._firstTangent;\n },\n },\n\n /**\n * The tangent at the last control point.\n *\n * @memberof CatmullRomSpline.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n lastTangent: {\n get: function () {\n return this._lastTangent;\n },\n },\n});\n\n/**\n * @private\n */\nCatmullRomSpline.catmullRomCoefficientMatrix = new Matrix4(\n -0.5,\n 1.0,\n -0.5,\n 0.0,\n 1.5,\n -2.5,\n 0.0,\n 1.0,\n -1.5,\n 2.0,\n 0.5,\n 0.0,\n 0.5,\n -0.5,\n 0.0,\n 0.0\n);\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nCatmullRomSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nCatmullRomSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nCatmullRomSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nCatmullRomSpline.prototype.evaluate = function (time, result) {\n return this._evaluateFunction(time, result);\n};\nexport default CatmullRomSpline;\n", "import Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Contains functions for operating on 2D triangles.\n *\n * @namespace Intersections2D\n */\nconst Intersections2D = {};\n\n/**\n * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting\n * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,\n * 3, or 4 vertices.\n *\n * @param {Number} threshold The threshold coordinate value at which to clip the triangle.\n * @param {Boolean} keepAbove true to keep the portion of the triangle above the threshold, or false\n * to keep the portion below.\n * @param {Number} u0 The coordinate of the first vertex in the triangle, in counter-clockwise order.\n * @param {Number} u1 The coordinate of the second vertex in the triangle, in counter-clockwise order.\n * @param {Number} u2 The coordinate of the third vertex in the triangle, in counter-clockwise order.\n * @param {Number[]} [result] The array into which to copy the result. If this parameter is not supplied,\n * a new array is constructed and returned.\n * @returns {Number[]} The polygon that results after the clip, specified as a list of\n * vertices. The vertices are specified in counter-clockwise order.\n * Each vertex is either an index from the existing list (identified as\n * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.\n * For new vertices, the -1 is followed by three additional numbers: the\n * index of each of the two original vertices forming the line segment that\n * the new vertex lies on, and the fraction of the distance from the first\n * vertex to the second one.\n *\n * @example\n * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);\n * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]\n */\nIntersections2D.clipTriangleAtAxisAlignedThreshold = function (\n threshold,\n keepAbove,\n u0,\n u1,\n u2,\n result\n) {\n if (!defined(result)) {\n result = [];\n } else {\n result.length = 0;\n }\n\n let u0Behind;\n let u1Behind;\n let u2Behind;\n if (keepAbove) {\n u0Behind = u0 < threshold;\n u1Behind = u1 < threshold;\n u2Behind = u2 < threshold;\n } else {\n u0Behind = u0 > threshold;\n u1Behind = u1 > threshold;\n u2Behind = u2 > threshold;\n }\n\n const numBehind = u0Behind + u1Behind + u2Behind;\n\n let u01Ratio;\n let u02Ratio;\n let u12Ratio;\n let u10Ratio;\n let u20Ratio;\n let u21Ratio;\n\n if (numBehind === 1) {\n if (u0Behind) {\n u01Ratio = (threshold - u0) / (u1 - u0);\n u02Ratio = (threshold - u0) / (u2 - u0);\n\n result.push(1);\n\n result.push(2);\n\n if (u02Ratio !== 1.0) {\n result.push(-1);\n result.push(0);\n result.push(2);\n result.push(u02Ratio);\n }\n\n if (u01Ratio !== 1.0) {\n result.push(-1);\n result.push(0);\n result.push(1);\n result.push(u01Ratio);\n }\n } else if (u1Behind) {\n u12Ratio = (threshold - u1) / (u2 - u1);\n u10Ratio = (threshold - u1) / (u0 - u1);\n\n result.push(2);\n\n result.push(0);\n\n if (u10Ratio !== 1.0) {\n result.push(-1);\n result.push(1);\n result.push(0);\n result.push(u10Ratio);\n }\n\n if (u12Ratio !== 1.0) {\n result.push(-1);\n result.push(1);\n result.push(2);\n result.push(u12Ratio);\n }\n } else if (u2Behind) {\n u20Ratio = (threshold - u2) / (u0 - u2);\n u21Ratio = (threshold - u2) / (u1 - u2);\n\n result.push(0);\n\n result.push(1);\n\n if (u21Ratio !== 1.0) {\n result.push(-1);\n result.push(2);\n result.push(1);\n result.push(u21Ratio);\n }\n\n if (u20Ratio !== 1.0) {\n result.push(-1);\n result.push(2);\n result.push(0);\n result.push(u20Ratio);\n }\n }\n } else if (numBehind === 2) {\n if (!u0Behind && u0 !== threshold) {\n u10Ratio = (threshold - u1) / (u0 - u1);\n u20Ratio = (threshold - u2) / (u0 - u2);\n\n result.push(0);\n\n result.push(-1);\n result.push(1);\n result.push(0);\n result.push(u10Ratio);\n\n result.push(-1);\n result.push(2);\n result.push(0);\n result.push(u20Ratio);\n } else if (!u1Behind && u1 !== threshold) {\n u21Ratio = (threshold - u2) / (u1 - u2);\n u01Ratio = (threshold - u0) / (u1 - u0);\n\n result.push(1);\n\n result.push(-1);\n result.push(2);\n result.push(1);\n result.push(u21Ratio);\n\n result.push(-1);\n result.push(0);\n result.push(1);\n result.push(u01Ratio);\n } else if (!u2Behind && u2 !== threshold) {\n u02Ratio = (threshold - u0) / (u2 - u0);\n u12Ratio = (threshold - u1) / (u2 - u1);\n\n result.push(2);\n\n result.push(-1);\n result.push(0);\n result.push(2);\n result.push(u02Ratio);\n\n result.push(-1);\n result.push(1);\n result.push(2);\n result.push(u12Ratio);\n }\n } else if (numBehind !== 3) {\n // Completely in front of threshold\n result.push(0);\n result.push(1);\n result.push(2);\n }\n // else Completely behind threshold\n\n return result;\n};\n\n/**\n * Compute the barycentric coordinates of a 2D position within a 2D triangle.\n *\n * @param {Number} x The x coordinate of the position for which to find the barycentric coordinates.\n * @param {Number} y The y coordinate of the position for which to find the barycentric coordinates.\n * @param {Number} x1 The x coordinate of the triangle's first vertex.\n * @param {Number} y1 The y coordinate of the triangle's first vertex.\n * @param {Number} x2 The x coordinate of the triangle's second vertex.\n * @param {Number} y2 The y coordinate of the triangle's second vertex.\n * @param {Number} x3 The x coordinate of the triangle's third vertex.\n * @param {Number} y3 The y coordinate of the triangle's third vertex.\n * @param {Cartesian3} [result] The instance into to which to copy the result. If this parameter\n * is undefined, a new instance is created and returned.\n * @returns {Cartesian3} The barycentric coordinates of the position within the triangle.\n *\n * @example\n * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);\n * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);\n */\nIntersections2D.computeBarycentricCoordinates = function (\n x,\n y,\n x1,\n y1,\n x2,\n y2,\n x3,\n y3,\n result\n) {\n const x1mx3 = x1 - x3;\n const x3mx2 = x3 - x2;\n const y2my3 = y2 - y3;\n const y1my3 = y1 - y3;\n const inverseDeterminant = 1.0 / (y2my3 * x1mx3 + x3mx2 * y1my3);\n const ymy3 = y - y3;\n const xmx3 = x - x3;\n const l1 = (y2my3 * xmx3 + x3mx2 * ymy3) * inverseDeterminant;\n const l2 = (-y1my3 * xmx3 + x1mx3 * ymy3) * inverseDeterminant;\n const l3 = 1.0 - l1 - l2;\n\n if (defined(result)) {\n result.x = l1;\n result.y = l2;\n result.z = l3;\n return result;\n }\n return new Cartesian3(l1, l2, l3);\n};\n\n/**\n * Compute the intersection between 2 line segments\n *\n * @param {Number} x00 The x coordinate of the first line's first vertex.\n * @param {Number} y00 The y coordinate of the first line's first vertex.\n * @param {Number} x01 The x coordinate of the first line's second vertex.\n * @param {Number} y01 The y coordinate of the first line's second vertex.\n * @param {Number} x10 The x coordinate of the second line's first vertex.\n * @param {Number} y10 The y coordinate of the second line's first vertex.\n * @param {Number} x11 The x coordinate of the second line's second vertex.\n * @param {Number} y11 The y coordinate of the second line's second vertex.\n * @param {Cartesian2} [result] The instance into to which to copy the result. If this parameter\n * is undefined, a new instance is created and returned.\n * @returns {Cartesian2} The intersection point, undefined if there is no intersection point or lines are coincident.\n *\n * @example\n * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);\n * // result === new Cesium.Cartesian2(0.0, 1.0);\n */\nIntersections2D.computeLineSegmentLineSegmentIntersection = function (\n x00,\n y00,\n x01,\n y01,\n x10,\n y10,\n x11,\n y11,\n result\n) {\n const numerator1A = (x11 - x10) * (y00 - y10) - (y11 - y10) * (x00 - x10);\n const numerator1B = (x01 - x00) * (y00 - y10) - (y01 - y00) * (x00 - x10);\n const denominator1 = (y11 - y10) * (x01 - x00) - (x11 - x10) * (y01 - y00);\n\n // If denominator = 0, then lines are parallel. If denominator = 0 and both numerators are 0, then coincident\n if (denominator1 === 0) {\n return;\n }\n\n const ua1 = numerator1A / denominator1;\n const ub1 = numerator1B / denominator1;\n\n if (ua1 >= 0 && ua1 <= 1 && ub1 >= 0 && ub1 <= 1) {\n if (!defined(result)) {\n result = new Cartesian2();\n }\n\n result.x = x00 + ua1 * (x01 - x00);\n result.y = y00 + ua1 * (y01 - y00);\n\n return result;\n }\n};\nexport default Intersections2D;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersections2D from \"./Intersections2D.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\n\n/**\n * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized\n * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed\n * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner\n * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile\n * and 32767 at the maximum height in the tile.\n *\n * @alias QuantizedMeshTerrainData\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Uint16Array} options.quantizedVertices The buffer containing the quantized mesh.\n * @param {Uint16Array|Uint32Array} options.indices The indices specifying how the quantized vertices are linked\n * together into triangles. Each three indices specifies one triangle.\n * @param {Number} options.minimumHeight The minimum terrain height within the tile, in meters above the ellipsoid.\n * @param {Number} options.maximumHeight The maximum terrain height within the tile, in meters above the ellipsoid.\n * @param {BoundingSphere} options.boundingSphere A sphere bounding all of the vertices in the mesh.\n * @param {OrientedBoundingBox} [options.orientedBoundingBox] An OrientedBoundingBox bounding all of the vertices in the mesh.\n * @param {Cartesian3} options.horizonOcclusionPoint The horizon occlusion point of the mesh. If this point\n * is below the horizon, the entire tile is assumed to be below the horizon as well.\n * The point is expressed in ellipsoid-scaled coordinates.\n * @param {Number[]} options.westIndices The indices of the vertices on the western edge of the tile.\n * @param {Number[]} options.southIndices The indices of the vertices on the southern edge of the tile.\n * @param {Number[]} options.eastIndices The indices of the vertices on the eastern edge of the tile.\n * @param {Number[]} options.northIndices The indices of the vertices on the northern edge of the tile.\n * @param {Number} options.westSkirtHeight The height of the skirt to add on the western edge of the tile.\n * @param {Number} options.southSkirtHeight The height of the skirt to add on the southern edge of the tile.\n * @param {Number} options.eastSkirtHeight The height of the skirt to add on the eastern edge of the tile.\n * @param {Number} options.northSkirtHeight The height of the skirt to add on the northern edge of the tile.\n * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n * If a child's bit is set, geometry will be requested for that tile as well when it\n * is needed. If the bit is cleared, the child tile is not requested and geometry is\n * instead upsampled from the parent. The bit values are as follows:\n * <table>\n * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n * <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n * <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n * <tr><td>2</td><td>4</td><td>Northwest</td></tr>\n * <tr><td>3</td><td>8</td><td>Northeast</td></tr>\n * </table>\n * @param {Boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n * otherwise, false.\n * @param {Uint8Array} [options.encodedNormals] The buffer containing per vertex normals, encoded using 'oct' encoding\n * @param {Uint8Array} [options.waterMask] The buffer containing the watermask.\n * @param {Credit[]} [options.credits] Array of credits for this tile.\n *\n *\n * @example\n * const data = new Cesium.QuantizedMeshTerrainData({\n * minimumHeight : -100,\n * maximumHeight : 2101,\n * quantizedVertices : new Uint16Array([// order is SW NW SE NE\n * // longitude\n * 0, 0, 32767, 32767,\n * // latitude\n * 0, 32767, 0, 32767,\n * // heights\n * 16384, 0, 32767, 16384]),\n * indices : new Uint16Array([0, 3, 1,\n * 0, 2, 3]),\n * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),\n * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),\n * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),\n * westIndices : [0, 1],\n * southIndices : [0, 1],\n * eastIndices : [2, 3],\n * northIndices : [1, 3],\n * westSkirtHeight : 1.0,\n * southSkirtHeight : 1.0,\n * eastSkirtHeight : 1.0,\n * northSkirtHeight : 1.0\n * });\n *\n * @see TerrainData\n * @see HeightmapTerrainData\n * @see GoogleEarthEnterpriseTerrainData\n */\nfunction QuantizedMeshTerrainData(options) {\n this._quantizedVertices = options.quantizedVertices;\n this._encodedNormals = options.encodedNormals;\n this._indices = options.indices;\n this._minimumHeight = options.minimumHeight;\n this._maximumHeight = options.maximumHeight;\n this._boundingSphere = options.boundingSphere;\n this._orientedBoundingBox = options.orientedBoundingBox;\n this._horizonOcclusionPoint = options.horizonOcclusionPoint;\n this._credits = options.credits;\n\n const vertexCount = this._quantizedVertices.length / 3;\n const uValues = (this._uValues = this._quantizedVertices.subarray(\n 0,\n vertexCount\n ));\n const vValues = (this._vValues = this._quantizedVertices.subarray(\n vertexCount,\n 2 * vertexCount\n ));\n this._heightValues = this._quantizedVertices.subarray(\n 2 * vertexCount,\n 3 * vertexCount\n );\n\n // We don't assume that we can count on the edge vertices being sorted by u or v.\n function sortByV(a, b) {\n return vValues[a] - vValues[b];\n }\n\n function sortByU(a, b) {\n return uValues[a] - uValues[b];\n }\n\n this._westIndices = sortIndicesIfNecessary(\n options.westIndices,\n sortByV,\n vertexCount\n );\n this._southIndices = sortIndicesIfNecessary(\n options.southIndices,\n sortByU,\n vertexCount\n );\n this._eastIndices = sortIndicesIfNecessary(\n options.eastIndices,\n sortByV,\n vertexCount\n );\n this._northIndices = sortIndicesIfNecessary(\n options.northIndices,\n sortByU,\n vertexCount\n );\n\n this._westSkirtHeight = options.westSkirtHeight;\n this._southSkirtHeight = options.southSkirtHeight;\n this._eastSkirtHeight = options.eastSkirtHeight;\n this._northSkirtHeight = options.northSkirtHeight;\n\n this._childTileMask = defaultValue(options.childTileMask, 15);\n\n this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n this._waterMask = options.waterMask;\n\n this._mesh = undefined;\n}\n\nObject.defineProperties(QuantizedMeshTerrainData.prototype, {\n /**\n * An array of credits for this tile.\n * @memberof QuantizedMeshTerrainData.prototype\n * @type {Credit[]}\n */\n credits: {\n get: function () {\n return this._credits;\n },\n },\n /**\n * The water mask included in this terrain data, if any. A water mask is a rectangular\n * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @memberof QuantizedMeshTerrainData.prototype\n * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n */\n waterMask: {\n get: function () {\n return this._waterMask;\n },\n },\n\n childTileMask: {\n get: function () {\n return this._childTileMask;\n },\n },\n\n canUpsample: {\n get: function () {\n return defined(this._mesh);\n },\n },\n});\n\nconst arrayScratch = [];\n\nfunction sortIndicesIfNecessary(indices, sortFunction, vertexCount) {\n arrayScratch.length = indices.length;\n\n let needsSort = false;\n for (let i = 0, len = indices.length; i < len; ++i) {\n arrayScratch[i] = indices[i];\n needsSort =\n needsSort || (i > 0 && sortFunction(indices[i - 1], indices[i]) > 0);\n }\n\n if (needsSort) {\n arrayScratch.sort(sortFunction);\n return IndexDatatype.createTypedArray(vertexCount, arrayScratch);\n }\n return indices;\n}\n\nconst createMeshTaskName = \"createVerticesFromQuantizedTerrainMesh\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n createMeshTaskName,\n TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {Number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {Number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {Number} options.level The level of the tile for which to create the terrain data.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height relative to which terrain is exaggerated.\n * @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n * asynchronous mesh creations are already in progress and the operation should\n * be retried later.\n */\nQuantizedMeshTerrainData.prototype.createMesh = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const tilingScheme = options.tilingScheme;\n const x = options.x;\n const y = options.y;\n const level = options.level;\n const exaggeration = defaultValue(options.exaggeration, 1.0);\n const exaggerationRelativeHeight = defaultValue(\n options.exaggerationRelativeHeight,\n 0.0\n );\n const throttle = defaultValue(options.throttle, true);\n\n const ellipsoid = tilingScheme.ellipsoid;\n const rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n const createMeshTaskProcessor = throttle\n ? createMeshTaskProcessorThrottle\n : createMeshTaskProcessorNoThrottle;\n\n const verticesPromise = createMeshTaskProcessor.scheduleTask({\n minimumHeight: this._minimumHeight,\n maximumHeight: this._maximumHeight,\n quantizedVertices: this._quantizedVertices,\n octEncodedNormals: this._encodedNormals,\n includeWebMercatorT: true,\n indices: this._indices,\n westIndices: this._westIndices,\n southIndices: this._southIndices,\n eastIndices: this._eastIndices,\n northIndices: this._northIndices,\n westSkirtHeight: this._westSkirtHeight,\n southSkirtHeight: this._southSkirtHeight,\n eastSkirtHeight: this._eastSkirtHeight,\n northSkirtHeight: this._northSkirtHeight,\n rectangle: rectangle,\n relativeToCenter: this._boundingSphere.center,\n ellipsoid: ellipsoid,\n exaggeration: exaggeration,\n exaggerationRelativeHeight: exaggerationRelativeHeight,\n });\n\n if (!defined(verticesPromise)) {\n // Postponed\n return undefined;\n }\n\n const that = this;\n return Promise.resolve(verticesPromise).then(function (result) {\n const vertexCountWithoutSkirts = that._quantizedVertices.length / 3;\n const vertexCount =\n vertexCountWithoutSkirts +\n that._westIndices.length +\n that._southIndices.length +\n that._eastIndices.length +\n that._northIndices.length;\n const indicesTypedArray = IndexDatatype.createTypedArray(\n vertexCount,\n result.indices\n );\n\n const vertices = new Float32Array(result.vertices);\n const rtc = result.center;\n const minimumHeight = result.minimumHeight;\n const maximumHeight = result.maximumHeight;\n const boundingSphere = that._boundingSphere;\n const obb = that._orientedBoundingBox;\n const occludeePointInScaledSpace = defaultValue(\n Cartesian3.clone(result.occludeePointInScaledSpace),\n that._horizonOcclusionPoint\n );\n const stride = result.vertexStride;\n const terrainEncoding = TerrainEncoding.clone(result.encoding);\n\n // Clone complex result objects because the transfer from the web worker\n // has stripped them down to JSON-style objects.\n that._mesh = new TerrainMesh(\n rtc,\n vertices,\n indicesTypedArray,\n result.indexCountWithoutSkirts,\n vertexCountWithoutSkirts,\n minimumHeight,\n maximumHeight,\n boundingSphere,\n occludeePointInScaledSpace,\n stride,\n obb,\n terrainEncoding,\n result.westIndicesSouthToNorth,\n result.southIndicesEastToWest,\n result.eastIndicesNorthToSouth,\n result.northIndicesWestToEast\n );\n\n // Free memory received from server after mesh is created.\n that._quantizedVertices = undefined;\n that._encodedNormals = undefined;\n that._indices = undefined;\n\n that._uValues = undefined;\n that._vValues = undefined;\n that._heightValues = undefined;\n\n that._westIndices = undefined;\n that._southIndices = undefined;\n that._eastIndices = undefined;\n that._northIndices = undefined;\n\n return that._mesh;\n });\n};\n\nconst upsampleTaskProcessor = new TaskProcessor(\n \"upsampleQuantizedTerrainMesh\",\n TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the\n * vertices in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {Number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {Number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {Number} thisLevel The level of this tile in the tiling scheme.\n * @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise.<QuantizedMeshTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n * or undefined if too many asynchronous upsample operations are in progress and the request has been\n * deferred.\n */\nQuantizedMeshTerrainData.prototype.upsample = function (\n tilingScheme,\n thisX,\n thisY,\n thisLevel,\n descendantX,\n descendantY,\n descendantLevel\n) {\n const mesh = this._mesh;\n if (!defined(this._mesh)) {\n return undefined;\n }\n\n const isEastChild = thisX * 2 !== descendantX;\n const isNorthChild = thisY * 2 === descendantY;\n\n const ellipsoid = tilingScheme.ellipsoid;\n const childRectangle = tilingScheme.tileXYToRectangle(\n descendantX,\n descendantY,\n descendantLevel\n );\n\n const upsamplePromise = upsampleTaskProcessor.scheduleTask({\n vertices: mesh.vertices,\n vertexCountWithoutSkirts: mesh.vertexCountWithoutSkirts,\n indices: mesh.indices,\n indexCountWithoutSkirts: mesh.indexCountWithoutSkirts,\n encoding: mesh.encoding,\n minimumHeight: this._minimumHeight,\n maximumHeight: this._maximumHeight,\n isEastChild: isEastChild,\n isNorthChild: isNorthChild,\n childRectangle: childRectangle,\n ellipsoid: ellipsoid,\n });\n\n if (!defined(upsamplePromise)) {\n // Postponed\n return undefined;\n }\n\n let shortestSkirt = Math.min(this._westSkirtHeight, this._eastSkirtHeight);\n shortestSkirt = Math.min(shortestSkirt, this._southSkirtHeight);\n shortestSkirt = Math.min(shortestSkirt, this._northSkirtHeight);\n\n const westSkirtHeight = isEastChild\n ? shortestSkirt * 0.5\n : this._westSkirtHeight;\n const southSkirtHeight = isNorthChild\n ? shortestSkirt * 0.5\n : this._southSkirtHeight;\n const eastSkirtHeight = isEastChild\n ? this._eastSkirtHeight\n : shortestSkirt * 0.5;\n const northSkirtHeight = isNorthChild\n ? this._northSkirtHeight\n : shortestSkirt * 0.5;\n const credits = this._credits;\n\n return Promise.resolve(upsamplePromise).then(function (result) {\n const quantizedVertices = new Uint16Array(result.vertices);\n const indicesTypedArray = IndexDatatype.createTypedArray(\n quantizedVertices.length / 3,\n result.indices\n );\n let encodedNormals;\n if (defined(result.encodedNormals)) {\n encodedNormals = new Uint8Array(result.encodedNormals);\n }\n\n return new QuantizedMeshTerrainData({\n quantizedVertices: quantizedVertices,\n indices: indicesTypedArray,\n encodedNormals: encodedNormals,\n minimumHeight: result.minimumHeight,\n maximumHeight: result.maximumHeight,\n boundingSphere: BoundingSphere.clone(result.boundingSphere),\n orientedBoundingBox: OrientedBoundingBox.clone(\n result.orientedBoundingBox\n ),\n horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint),\n westIndices: result.westIndices,\n southIndices: result.southIndices,\n eastIndices: result.eastIndices,\n northIndices: result.northIndices,\n westSkirtHeight: westSkirtHeight,\n southSkirtHeight: southSkirtHeight,\n eastSkirtHeight: eastSkirtHeight,\n northSkirtHeight: northSkirtHeight,\n childTileMask: 0,\n credits: credits,\n createdByUpsampling: true,\n });\n });\n};\n\nconst maxShort = 32767;\nconst barycentricCoordinateScratch = new Cartesian3();\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {Number} longitude The longitude in radians.\n * @param {Number} latitude The latitude in radians.\n * @returns {Number} The terrain height at the specified position. The position is clamped to\n * the rectangle, so expect incorrect results for positions far outside the rectangle.\n */\nQuantizedMeshTerrainData.prototype.interpolateHeight = function (\n rectangle,\n longitude,\n latitude\n) {\n let u = CesiumMath.clamp(\n (longitude - rectangle.west) / rectangle.width,\n 0.0,\n 1.0\n );\n u *= maxShort;\n let v = CesiumMath.clamp(\n (latitude - rectangle.south) / rectangle.height,\n 0.0,\n 1.0\n );\n v *= maxShort;\n\n if (!defined(this._mesh)) {\n return interpolateHeight(this, u, v);\n }\n\n return interpolateMeshHeight(this, u, v);\n};\n\nfunction pointInBoundingBox(u, v, u0, v0, u1, v1, u2, v2) {\n const minU = Math.min(u0, u1, u2);\n const maxU = Math.max(u0, u1, u2);\n const minV = Math.min(v0, v1, v2);\n const maxV = Math.max(v0, v1, v2);\n return u >= minU && u <= maxU && v >= minV && v <= maxV;\n}\n\nconst texCoordScratch0 = new Cartesian2();\nconst texCoordScratch1 = new Cartesian2();\nconst texCoordScratch2 = new Cartesian2();\n\nfunction interpolateMeshHeight(terrainData, u, v) {\n const mesh = terrainData._mesh;\n const vertices = mesh.vertices;\n const encoding = mesh.encoding;\n const indices = mesh.indices;\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n const uv0 = encoding.decodeTextureCoordinates(\n vertices,\n i0,\n texCoordScratch0\n );\n const uv1 = encoding.decodeTextureCoordinates(\n vertices,\n i1,\n texCoordScratch1\n );\n const uv2 = encoding.decodeTextureCoordinates(\n vertices,\n i2,\n texCoordScratch2\n );\n\n if (pointInBoundingBox(u, v, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y)) {\n const barycentric = Intersections2D.computeBarycentricCoordinates(\n u,\n v,\n uv0.x,\n uv0.y,\n uv1.x,\n uv1.y,\n uv2.x,\n uv2.y,\n barycentricCoordinateScratch\n );\n if (\n barycentric.x >= -1e-15 &&\n barycentric.y >= -1e-15 &&\n barycentric.z >= -1e-15\n ) {\n const h0 = encoding.decodeHeight(vertices, i0);\n const h1 = encoding.decodeHeight(vertices, i1);\n const h2 = encoding.decodeHeight(vertices, i2);\n return barycentric.x * h0 + barycentric.y * h1 + barycentric.z * h2;\n }\n }\n }\n\n // Position does not lie in any triangle in this mesh.\n return undefined;\n}\n\nfunction interpolateHeight(terrainData, u, v) {\n const uBuffer = terrainData._uValues;\n const vBuffer = terrainData._vValues;\n const heightBuffer = terrainData._heightValues;\n\n const indices = terrainData._indices;\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n const u0 = uBuffer[i0];\n const u1 = uBuffer[i1];\n const u2 = uBuffer[i2];\n\n const v0 = vBuffer[i0];\n const v1 = vBuffer[i1];\n const v2 = vBuffer[i2];\n\n if (pointInBoundingBox(u, v, u0, v0, u1, v1, u2, v2)) {\n const barycentric = Intersections2D.computeBarycentricCoordinates(\n u,\n v,\n u0,\n v0,\n u1,\n v1,\n u2,\n v2,\n barycentricCoordinateScratch\n );\n if (\n barycentric.x >= -1e-15 &&\n barycentric.y >= -1e-15 &&\n barycentric.z >= -1e-15\n ) {\n const quantizedHeight =\n barycentric.x * heightBuffer[i0] +\n barycentric.y * heightBuffer[i1] +\n barycentric.z * heightBuffer[i2];\n return CesiumMath.lerp(\n terrainData._minimumHeight,\n terrainData._maximumHeight,\n quantizedHeight / maxShort\n );\n }\n }\n }\n\n // Position does not lie in any triangle in this mesh.\n return undefined;\n}\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed\n * to be one of the four children of this tile. If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {Number} thisX The tile X coordinate of this (the parent) tile.\n * @param {Number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {Number} childX The tile X coordinate of the child tile to check for availability.\n * @param {Number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {Boolean} True if the child tile is available; otherwise, false.\n */\nQuantizedMeshTerrainData.prototype.isChildAvailable = function (\n thisX,\n thisY,\n childX,\n childY\n) {\n let bitNumber = 2; // northwest child\n if (childX !== thisX * 2) {\n ++bitNumber; // east child\n }\n if (childY !== thisY * 2) {\n bitNumber -= 2; // south child\n }\n\n return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data. If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server. This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {Boolean} True if this instance was created by upsampling; otherwise, false.\n */\nQuantizedMeshTerrainData.prototype.wasCreatedByUpsampling = function () {\n return this._createdByUpsampling;\n};\nexport default QuantizedMeshTerrainData;\n", "import AttributeCompression from \"./AttributeCompression.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport WebMercatorTilingScheme from \"./WebMercatorTilingScheme.js\";\nimport getJsonFromTypedArray from \"./getJsonFromTypedArray.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport QuantizedMeshTerrainData from \"./QuantizedMeshTerrainData.js\";\nimport Request from \"./Request.js\";\nimport RequestType from \"./RequestType.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileAvailability from \"./TileAvailability.js\";\nimport TileProviderError from \"./TileProviderError.js\";\n\nfunction LayerInformation(layer) {\n this.resource = layer.resource;\n this.version = layer.version;\n this.isHeightmap = layer.isHeightmap;\n this.tileUrlTemplates = layer.tileUrlTemplates;\n this.availability = layer.availability;\n this.hasVertexNormals = layer.hasVertexNormals;\n this.hasWaterMask = layer.hasWaterMask;\n this.hasMetadata = layer.hasMetadata;\n this.availabilityLevels = layer.availabilityLevels;\n this.availabilityTilesLoaded = layer.availabilityTilesLoaded;\n this.littleEndianExtensionSize = layer.littleEndianExtensionSize;\n this.availabilityPromiseCache = {};\n}\n\n/**\n * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.\n * Terrain formats can be one of the following:\n * <ul>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh Quantized Mesh} </li>\n * <li> {@link https://github.com/AnalyticalGraphicsInc/cesium/wiki/heightmap-1.0 Height Map} </li>\n * </ul>\n *\n * @alias CesiumTerrainProvider\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String|Promise<Resource>|Promise<String>} options.url The URL of the Cesium terrain server.\n * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available.\n * @param {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server, if available.\n * @param {Boolean} [options.requestMetadata=true] Flag that indicates if the client should request per tile metadata from the server, if available.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n *\n *\n * @example\n * // Create Arctic DEM terrain with normals.\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * terrainProvider : new Cesium.CesiumTerrainProvider({\n * url : Cesium.IonResource.fromAssetId(3956),\n * requestVertexNormals : true\n * })\n * });\n *\n * @see createWorldTerrain\n * @see TerrainProvider\n */\nfunction CesiumTerrainProvider(options) {\n this._heightmapWidth = 65;\n this._heightmapStructure = undefined;\n this._hasWaterMask = false;\n this._hasVertexNormals = false;\n this._ellipsoid = options.ellipsoid;\n\n /**\n * Boolean flag that indicates if the client should request vertex normals from the server.\n * @type {Boolean}\n * @default false\n * @private\n */\n this._requestVertexNormals = defaultValue(\n options.requestVertexNormals,\n false\n );\n\n /**\n * Boolean flag that indicates if the client should request tile watermasks from the server.\n * @type {Boolean}\n * @default false\n * @private\n */\n this._requestWaterMask = defaultValue(options.requestWaterMask, false);\n\n /**\n * Boolean flag that indicates if the client should request tile metadata from the server.\n * @type {Boolean}\n * @default true\n * @private\n */\n this._requestMetadata = defaultValue(options.requestMetadata, true);\n\n this._errorEvent = new Event();\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n this._availability = undefined;\n\n this._ready = false;\n this._tileCredits = undefined;\n\n const that = this;\n let lastResource;\n let layerJsonResource;\n let metadataError;\n\n const layers = (this._layers = []);\n let attribution = \"\";\n const overallAvailability = [];\n let overallMaxZoom = 0;\n this._readyPromise = Promise.resolve(options.url).then(function (url) {\n const resource = Resource.createIfNeeded(url);\n resource.appendForwardSlash();\n lastResource = resource;\n layerJsonResource = lastResource.getDerivedResource({\n url: \"layer.json\",\n });\n\n // ion resources have a credits property we can use for additional attribution.\n that._tileCredits = resource.credits;\n\n return requestLayerJson();\n });\n\n function parseMetadataSuccess(data) {\n let message;\n\n if (!data.format) {\n message = \"The tile format is not specified in the layer.json file.\";\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n if (!data.tiles || data.tiles.length === 0) {\n message = \"The layer.json file does not specify any tile URL templates.\";\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n let hasVertexNormals = false;\n let hasWaterMask = false;\n let hasMetadata = false;\n let littleEndianExtensionSize = true;\n let isHeightmap = false;\n if (data.format === \"heightmap-1.0\") {\n isHeightmap = true;\n if (!defined(that._heightmapStructure)) {\n that._heightmapStructure = {\n heightScale: 1.0 / 5.0,\n heightOffset: -1000.0,\n elementsPerHeight: 1,\n stride: 1,\n elementMultiplier: 256.0,\n isBigEndian: false,\n lowestEncodedHeight: 0,\n highestEncodedHeight: 256 * 256 - 1,\n };\n }\n hasWaterMask = true;\n that._requestWaterMask = true;\n } else if (data.format.indexOf(\"quantized-mesh-1.\") !== 0) {\n message = `The tile format \"${data.format}\" is invalid or not supported.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n const tileUrlTemplates = data.tiles;\n\n const maxZoom = data.maxzoom;\n overallMaxZoom = Math.max(overallMaxZoom, maxZoom);\n // Keeps track of which of the availablity containing tiles have been loaded\n\n if (!data.projection || data.projection === \"EPSG:4326\") {\n that._tilingScheme = new GeographicTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 1,\n ellipsoid: that._ellipsoid,\n });\n } else if (data.projection === \"EPSG:3857\") {\n that._tilingScheme = new WebMercatorTilingScheme({\n numberOfLevelZeroTilesX: 1,\n numberOfLevelZeroTilesY: 1,\n ellipsoid: that._ellipsoid,\n });\n } else {\n message = `The projection \"${data.projection}\" is invalid or not supported.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n that._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n that._tilingScheme.ellipsoid,\n that._heightmapWidth,\n that._tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n if (!data.scheme || data.scheme === \"tms\" || data.scheme === \"slippyMap\") {\n that._scheme = data.scheme;\n } else {\n message = `The scheme \"${data.scheme}\" is invalid or not supported.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n let availabilityTilesLoaded;\n\n // The vertex normals defined in the 'octvertexnormals' extension is identical to the original\n // contents of the original 'vertexnormals' extension. 'vertexnormals' extension is now\n // deprecated, as the extensionLength for this extension was incorrectly using big endian.\n // We maintain backwards compatibility with the legacy 'vertexnormal' implementation\n // by setting the _littleEndianExtensionSize to false. Always prefer 'octvertexnormals'\n // over 'vertexnormals' if both extensions are supported by the server.\n if (\n defined(data.extensions) &&\n data.extensions.indexOf(\"octvertexnormals\") !== -1\n ) {\n hasVertexNormals = true;\n } else if (\n defined(data.extensions) &&\n data.extensions.indexOf(\"vertexnormals\") !== -1\n ) {\n hasVertexNormals = true;\n littleEndianExtensionSize = false;\n }\n if (\n defined(data.extensions) &&\n data.extensions.indexOf(\"watermask\") !== -1\n ) {\n hasWaterMask = true;\n }\n if (\n defined(data.extensions) &&\n data.extensions.indexOf(\"metadata\") !== -1\n ) {\n hasMetadata = true;\n }\n\n const availabilityLevels = data.metadataAvailability;\n const availableTiles = data.available;\n let availability;\n if (defined(availableTiles) && !defined(availabilityLevels)) {\n availability = new TileAvailability(\n that._tilingScheme,\n availableTiles.length\n );\n for (let level = 0; level < availableTiles.length; ++level) {\n const rangesAtLevel = availableTiles[level];\n const yTiles = that._tilingScheme.getNumberOfYTilesAtLevel(level);\n if (!defined(overallAvailability[level])) {\n overallAvailability[level] = [];\n }\n\n for (\n let rangeIndex = 0;\n rangeIndex < rangesAtLevel.length;\n ++rangeIndex\n ) {\n const range = rangesAtLevel[rangeIndex];\n const yStart = yTiles - range.endY - 1;\n const yEnd = yTiles - range.startY - 1;\n overallAvailability[level].push([\n range.startX,\n yStart,\n range.endX,\n yEnd,\n ]);\n availability.addAvailableTileRange(\n level,\n range.startX,\n yStart,\n range.endX,\n yEnd\n );\n }\n }\n } else if (defined(availabilityLevels)) {\n availabilityTilesLoaded = new TileAvailability(\n that._tilingScheme,\n maxZoom\n );\n availability = new TileAvailability(that._tilingScheme, maxZoom);\n overallAvailability[0] = [[0, 0, 1, 0]];\n availability.addAvailableTileRange(0, 0, 0, 1, 0);\n }\n\n that._hasWaterMask = that._hasWaterMask || hasWaterMask;\n that._hasVertexNormals = that._hasVertexNormals || hasVertexNormals;\n that._hasMetadata = that._hasMetadata || hasMetadata;\n if (defined(data.attribution)) {\n if (attribution.length > 0) {\n attribution += \" \";\n }\n attribution += data.attribution;\n }\n\n layers.push(\n new LayerInformation({\n resource: lastResource,\n version: data.version,\n isHeightmap: isHeightmap,\n tileUrlTemplates: tileUrlTemplates,\n availability: availability,\n hasVertexNormals: hasVertexNormals,\n hasWaterMask: hasWaterMask,\n hasMetadata: hasMetadata,\n availabilityLevels: availabilityLevels,\n availabilityTilesLoaded: availabilityTilesLoaded,\n littleEndianExtensionSize: littleEndianExtensionSize,\n })\n );\n\n const parentUrl = data.parentUrl;\n if (defined(parentUrl)) {\n if (!defined(availability)) {\n console.log(\n \"A layer.json can't have a parentUrl if it does't have an available array.\"\n );\n return Promise.resolve(true);\n }\n lastResource = lastResource.getDerivedResource({\n url: parentUrl,\n });\n lastResource.appendForwardSlash(); // Terrain always expects a directory\n layerJsonResource = lastResource.getDerivedResource({\n url: \"layer.json\",\n });\n const parentMetadata = layerJsonResource.fetchJson();\n return Promise.resolve(parentMetadata)\n .then(parseMetadataSuccess)\n .catch(parseMetadataFailure);\n }\n\n return Promise.resolve(true);\n }\n\n function parseMetadataFailure(data) {\n const message = `An error occurred while accessing ${layerJsonResource.url}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestLayerJson();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n function metadataSuccess(data) {\n return parseMetadataSuccess(data).then(function () {\n if (defined(metadataError)) {\n return;\n }\n\n const length = overallAvailability.length;\n if (length > 0) {\n const availability = (that._availability = new TileAvailability(\n that._tilingScheme,\n overallMaxZoom\n ));\n for (let level = 0; level < length; ++level) {\n const levelRanges = overallAvailability[level];\n for (let i = 0; i < levelRanges.length; ++i) {\n const range = levelRanges[i];\n availability.addAvailableTileRange(\n level,\n range[0],\n range[1],\n range[2],\n range[3]\n );\n }\n }\n }\n\n if (attribution.length > 0) {\n const layerJsonCredit = new Credit(attribution);\n\n if (defined(that._tileCredits)) {\n that._tileCredits.push(layerJsonCredit);\n } else {\n that._tileCredits = [layerJsonCredit];\n }\n }\n\n that._ready = true;\n return Promise.resolve(true);\n });\n }\n\n function metadataFailure(data) {\n // If the metadata is not found, assume this is a pre-metadata heightmap tileset.\n if (defined(data) && data.statusCode === 404) {\n return metadataSuccess({\n tilejson: \"2.1.0\",\n format: \"heightmap-1.0\",\n version: \"1.0.0\",\n scheme: \"tms\",\n tiles: [\"{z}/{x}/{y}.terrain?v={version}\"],\n });\n }\n return parseMetadataFailure(data);\n }\n\n function requestLayerJson() {\n return Promise.resolve(layerJsonResource.fetchJson())\n .then(metadataSuccess)\n .catch(metadataFailure);\n }\n}\n\n/**\n * When using the Quantized-Mesh format, a tile may be returned that includes additional extensions, such as PerVertexNormals, watermask, etc.\n * This enumeration defines the unique identifiers for each type of extension data that has been appended to the standard mesh data.\n *\n * @namespace QuantizedMeshExtensionIds\n * @see CesiumTerrainProvider\n * @private\n */\nconst QuantizedMeshExtensionIds = {\n /**\n * Oct-Encoded Per-Vertex Normals are included as an extension to the tile mesh\n *\n * @type {Number}\n * @constant\n * @default 1\n */\n OCT_VERTEX_NORMALS: 1,\n /**\n * A watermask is included as an extension to the tile mesh\n *\n * @type {Number}\n * @constant\n * @default 2\n */\n WATER_MASK: 2,\n /**\n * A json object contain metadata about the tile\n *\n * @type {Number}\n * @constant\n * @default 4\n */\n METADATA: 4,\n};\n\nfunction getRequestHeader(extensionsList) {\n if (!defined(extensionsList) || extensionsList.length === 0) {\n return {\n Accept:\n \"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01\",\n };\n }\n const extensions = extensionsList.join(\"-\");\n return {\n Accept: `application/vnd.quantized-mesh;extensions=${extensions},application/octet-stream;q=0.9,*/*;q=0.01`,\n };\n}\n\nfunction createHeightmapTerrainData(provider, buffer, level, x, y) {\n const heightBuffer = new Uint16Array(\n buffer,\n 0,\n provider._heightmapWidth * provider._heightmapWidth\n );\n return new HeightmapTerrainData({\n buffer: heightBuffer,\n childTileMask: new Uint8Array(buffer, heightBuffer.byteLength, 1)[0],\n waterMask: new Uint8Array(\n buffer,\n heightBuffer.byteLength + 1,\n buffer.byteLength - heightBuffer.byteLength - 1\n ),\n width: provider._heightmapWidth,\n height: provider._heightmapWidth,\n structure: provider._heightmapStructure,\n credits: provider._tileCredits,\n });\n}\n\nfunction createQuantizedMeshTerrainData(provider, buffer, level, x, y, layer) {\n const littleEndianExtensionSize = layer.littleEndianExtensionSize;\n let pos = 0;\n const cartesian3Elements = 3;\n const boundingSphereElements = cartesian3Elements + 1;\n const cartesian3Length = Float64Array.BYTES_PER_ELEMENT * cartesian3Elements;\n const boundingSphereLength =\n Float64Array.BYTES_PER_ELEMENT * boundingSphereElements;\n const encodedVertexElements = 3;\n const encodedVertexLength =\n Uint16Array.BYTES_PER_ELEMENT * encodedVertexElements;\n const triangleElements = 3;\n let bytesPerIndex = Uint16Array.BYTES_PER_ELEMENT;\n let triangleLength = bytesPerIndex * triangleElements;\n\n const view = new DataView(buffer);\n const center = new Cartesian3(\n view.getFloat64(pos, true),\n view.getFloat64(pos + 8, true),\n view.getFloat64(pos + 16, true)\n );\n pos += cartesian3Length;\n\n const minimumHeight = view.getFloat32(pos, true);\n pos += Float32Array.BYTES_PER_ELEMENT;\n const maximumHeight = view.getFloat32(pos, true);\n pos += Float32Array.BYTES_PER_ELEMENT;\n\n const boundingSphere = new BoundingSphere(\n new Cartesian3(\n view.getFloat64(pos, true),\n view.getFloat64(pos + 8, true),\n view.getFloat64(pos + 16, true)\n ),\n view.getFloat64(pos + cartesian3Length, true)\n );\n pos += boundingSphereLength;\n\n const horizonOcclusionPoint = new Cartesian3(\n view.getFloat64(pos, true),\n view.getFloat64(pos + 8, true),\n view.getFloat64(pos + 16, true)\n );\n pos += cartesian3Length;\n\n const vertexCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const encodedVertexBuffer = new Uint16Array(buffer, pos, vertexCount * 3);\n pos += vertexCount * encodedVertexLength;\n\n if (vertexCount > 64 * 1024) {\n // More than 64k vertices, so indices are 32-bit.\n bytesPerIndex = Uint32Array.BYTES_PER_ELEMENT;\n triangleLength = bytesPerIndex * triangleElements;\n }\n\n // Decode the vertex buffer.\n const uBuffer = encodedVertexBuffer.subarray(0, vertexCount);\n const vBuffer = encodedVertexBuffer.subarray(vertexCount, 2 * vertexCount);\n const heightBuffer = encodedVertexBuffer.subarray(\n vertexCount * 2,\n 3 * vertexCount\n );\n\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\n\n // skip over any additional padding that was added for 2/4 byte alignment\n if (pos % bytesPerIndex !== 0) {\n pos += bytesPerIndex - (pos % bytesPerIndex);\n }\n\n const triangleCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const indices = IndexDatatype.createTypedArrayFromArrayBuffer(\n vertexCount,\n buffer,\n pos,\n triangleCount * triangleElements\n );\n pos += triangleCount * triangleLength;\n\n // High water mark decoding based on decompressIndices_ in webgl-loader's loader.js.\n // https://code.google.com/p/webgl-loader/source/browse/trunk/samples/loader.js?r=99#55\n // Copyright 2012 Google Inc., Apache 2.0 license.\n let highest = 0;\n const length = indices.length;\n for (let i = 0; i < length; ++i) {\n const code = indices[i];\n indices[i] = highest - code;\n if (code === 0) {\n ++highest;\n }\n }\n\n const westVertexCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const westIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n vertexCount,\n buffer,\n pos,\n westVertexCount\n );\n pos += westVertexCount * bytesPerIndex;\n\n const southVertexCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const southIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n vertexCount,\n buffer,\n pos,\n southVertexCount\n );\n pos += southVertexCount * bytesPerIndex;\n\n const eastVertexCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const eastIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n vertexCount,\n buffer,\n pos,\n eastVertexCount\n );\n pos += eastVertexCount * bytesPerIndex;\n\n const northVertexCount = view.getUint32(pos, true);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n const northIndices = IndexDatatype.createTypedArrayFromArrayBuffer(\n vertexCount,\n buffer,\n pos,\n northVertexCount\n );\n pos += northVertexCount * bytesPerIndex;\n\n let encodedNormalBuffer;\n let waterMaskBuffer;\n while (pos < view.byteLength) {\n const extensionId = view.getUint8(pos, true);\n pos += Uint8Array.BYTES_PER_ELEMENT;\n const extensionLength = view.getUint32(pos, littleEndianExtensionSize);\n pos += Uint32Array.BYTES_PER_ELEMENT;\n\n if (\n extensionId === QuantizedMeshExtensionIds.OCT_VERTEX_NORMALS &&\n provider._requestVertexNormals\n ) {\n encodedNormalBuffer = new Uint8Array(buffer, pos, vertexCount * 2);\n } else if (\n extensionId === QuantizedMeshExtensionIds.WATER_MASK &&\n provider._requestWaterMask\n ) {\n waterMaskBuffer = new Uint8Array(buffer, pos, extensionLength);\n } else if (\n extensionId === QuantizedMeshExtensionIds.METADATA &&\n provider._requestMetadata\n ) {\n const stringLength = view.getUint32(pos, true);\n if (stringLength > 0) {\n const metadata = getJsonFromTypedArray(\n new Uint8Array(buffer),\n pos + Uint32Array.BYTES_PER_ELEMENT,\n stringLength\n );\n const availableTiles = metadata.available;\n if (defined(availableTiles)) {\n for (let offset = 0; offset < availableTiles.length; ++offset) {\n const availableLevel = level + offset + 1;\n const rangesAtLevel = availableTiles[offset];\n const yTiles = provider._tilingScheme.getNumberOfYTilesAtLevel(\n availableLevel\n );\n\n for (\n let rangeIndex = 0;\n rangeIndex < rangesAtLevel.length;\n ++rangeIndex\n ) {\n const range = rangesAtLevel[rangeIndex];\n const yStart = yTiles - range.endY - 1;\n const yEnd = yTiles - range.startY - 1;\n provider.availability.addAvailableTileRange(\n availableLevel,\n range.startX,\n yStart,\n range.endX,\n yEnd\n );\n layer.availability.addAvailableTileRange(\n availableLevel,\n range.startX,\n yStart,\n range.endX,\n yEnd\n );\n }\n }\n }\n }\n layer.availabilityTilesLoaded.addAvailableTileRange(level, x, y, x, y);\n }\n pos += extensionLength;\n }\n\n const skirtHeight = provider.getLevelMaximumGeometricError(level) * 5.0;\n\n // The skirt is not included in the OBB computation. If this ever\n // causes any rendering artifacts (cracks), they are expected to be\n // minor and in the corners of the screen. It's possible that this\n // might need to be changed - just change to `minimumHeight - skirtHeight`\n // A similar change might also be needed in `upsampleQuantizedTerrainMesh.js`.\n const rectangle = provider._tilingScheme.tileXYToRectangle(x, y, level);\n const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\n rectangle,\n minimumHeight,\n maximumHeight,\n provider._tilingScheme.ellipsoid\n );\n\n return new QuantizedMeshTerrainData({\n center: center,\n minimumHeight: minimumHeight,\n maximumHeight: maximumHeight,\n boundingSphere: boundingSphere,\n orientedBoundingBox: orientedBoundingBox,\n horizonOcclusionPoint: horizonOcclusionPoint,\n quantizedVertices: encodedVertexBuffer,\n encodedNormals: encodedNormalBuffer,\n indices: indices,\n westIndices: westIndices,\n southIndices: southIndices,\n eastIndices: eastIndices,\n northIndices: northIndices,\n westSkirtHeight: skirtHeight,\n southSkirtHeight: skirtHeight,\n eastSkirtHeight: skirtHeight,\n northSkirtHeight: skirtHeight,\n childTileMask: provider.availability.computeChildMaskForTile(level, x, y),\n waterMask: waterMaskBuffer,\n credits: provider._tileCredits,\n });\n}\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n *\n * @exception {DeveloperError} This function must not be called before {@link CesiumTerrainProvider#ready}\n * returns true.\n */\nCesiumTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const layers = this._layers;\n let layerToUse;\n const layerCount = layers.length;\n\n if (layerCount === 1) {\n // Optimized path for single layers\n layerToUse = layers[0];\n } else {\n for (let i = 0; i < layerCount; ++i) {\n const layer = layers[i];\n if (\n !defined(layer.availability) ||\n layer.availability.isTileAvailable(level, x, y)\n ) {\n layerToUse = layer;\n break;\n }\n }\n }\n\n return requestTileGeometry(this, x, y, level, layerToUse, request);\n};\n\nfunction requestTileGeometry(provider, x, y, level, layerToUse, request) {\n if (!defined(layerToUse)) {\n return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n }\n\n const urlTemplates = layerToUse.tileUrlTemplates;\n if (urlTemplates.length === 0) {\n return undefined;\n }\n\n // The TileMapService scheme counts from the bottom left\n let terrainY;\n if (!provider._scheme || provider._scheme === \"tms\") {\n const yTiles = provider._tilingScheme.getNumberOfYTilesAtLevel(level);\n terrainY = yTiles - y - 1;\n } else {\n terrainY = y;\n }\n\n const extensionList = [];\n if (provider._requestVertexNormals && layerToUse.hasVertexNormals) {\n extensionList.push(\n layerToUse.littleEndianExtensionSize\n ? \"octvertexnormals\"\n : \"vertexnormals\"\n );\n }\n if (provider._requestWaterMask && layerToUse.hasWaterMask) {\n extensionList.push(\"watermask\");\n }\n if (provider._requestMetadata && layerToUse.hasMetadata) {\n extensionList.push(\"metadata\");\n }\n\n let headers;\n let query;\n const url = urlTemplates[(x + terrainY + level) % urlTemplates.length];\n\n const resource = layerToUse.resource;\n if (\n defined(resource._ionEndpoint) &&\n !defined(resource._ionEndpoint.externalType)\n ) {\n // ion uses query paremeters to request extensions\n if (extensionList.length !== 0) {\n query = { extensions: extensionList.join(\"-\") };\n }\n headers = getRequestHeader(undefined);\n } else {\n //All other terrain servers\n headers = getRequestHeader(extensionList);\n }\n\n const promise = resource\n .getDerivedResource({\n url: url,\n templateValues: {\n version: layerToUse.version,\n z: level,\n x: x,\n y: terrainY,\n },\n queryParameters: query,\n headers: headers,\n request: request,\n })\n .fetchArrayBuffer();\n\n if (!defined(promise)) {\n return undefined;\n }\n\n return promise.then(function (buffer) {\n if (!defined(buffer)) {\n return Promise.reject(new RuntimeError(\"Mesh buffer doesn't exist.\"));\n }\n if (defined(provider._heightmapStructure)) {\n return createHeightmapTerrainData(provider, buffer, level, x, y);\n }\n return createQuantizedMeshTerrainData(\n provider,\n buffer,\n level,\n x,\n y,\n layerToUse\n );\n });\n}\n\nObject.defineProperties(CesiumTerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link CesiumTerrainProvider#ready} returns true.\n * @memberof CesiumTerrainProvider.prototype\n * @type {GeographicTilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link CesiumTerrainProvider#ready} returns true.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n * @exception {DeveloperError} This property must not be called before {@link CesiumTerrainProvider#ready}\n */\n hasWaterMask: {\n get: function () {\n return this._hasWaterMask && this._requestWaterMask;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n * @exception {DeveloperError} This property must not be called before {@link CesiumTerrainProvider#ready}\n */\n hasVertexNormals: {\n get: function () {\n // returns true if we can request vertex normals from the server\n return this._hasVertexNormals && this._requestVertexNormals;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include metadata.\n * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n * @exception {DeveloperError} This property must not be called before {@link CesiumTerrainProvider#ready}\n */\n hasMetadata: {\n get: function () {\n // returns true if we can request metadata from the server\n return this._hasMetadata && this._requestMetadata;\n },\n },\n\n /**\n * Boolean flag that indicates if the client should request vertex normals from the server.\n * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and\n * if the server provides vertex normals.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n requestVertexNormals: {\n get: function () {\n return this._requestVertexNormals;\n },\n },\n\n /**\n * Boolean flag that indicates if the client should request a watermask from the server.\n * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and\n * if the server provides a watermask.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n requestWaterMask: {\n get: function () {\n return this._requestWaterMask;\n },\n },\n\n /**\n * Boolean flag that indicates if the client should request metadata from the server.\n * Metadata is appended to the standard tile mesh data only if the client requests the metadata and\n * if the server provides a metadata.\n * @memberof CesiumTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n requestMetadata: {\n get: function () {\n return this._requestMetadata;\n },\n },\n\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available. Note that this reflects tiles that are known to be available currently.\n * Additional tiles may be discovered to be available in the future, e.g. if availability information\n * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that\n * is available now will not become unavailable in the future.\n * @memberof CesiumTerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: function () {\nreturn this._availability;\n },\n },\n});\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nCesiumTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported or availability is unknown, otherwise true or false.\n */\nCesiumTerrainProvider.prototype.getTileDataAvailable = function (x, y, level) {\n if (!defined(this._availability)) {\n return undefined;\n }\n if (level > this._availability._maximumLevel) {\n return false;\n }\n\n if (this._availability.isTileAvailable(level, x, y)) {\n // If the tile is listed as available, then we are done\n return true;\n }\n if (!this._hasMetadata) {\n // If we don't have any layers with the metadata extension then we don't have this tile\n return false;\n }\n\n const layers = this._layers;\n const count = layers.length;\n for (let i = 0; i < count; ++i) {\n const layerResult = checkLayer(this, x, y, level, layers[i], i === 0);\n if (layerResult.result) {\n // There is a layer that may or may not have the tile\n return undefined;\n }\n }\n\n return false;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nCesiumTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n if (\n !defined(this._availability) ||\n level > this._availability._maximumLevel ||\n this._availability.isTileAvailable(level, x, y) ||\n !this._hasMetadata\n ) {\n // We know the tile is either available or not available so nothing to wait on\n return undefined;\n }\n\n const layers = this._layers;\n const count = layers.length;\n for (let i = 0; i < count; ++i) {\n const layerResult = checkLayer(this, x, y, level, layers[i], i === 0);\n if (defined(layerResult.promise)) {\n return layerResult.promise;\n }\n }\n};\n\nfunction getAvailabilityTile(layer, x, y, level) {\n if (level === 0) {\n return;\n }\n\n const availabilityLevels = layer.availabilityLevels;\n const parentLevel =\n level % availabilityLevels === 0\n ? level - availabilityLevels\n : ((level / availabilityLevels) | 0) * availabilityLevels;\n const divisor = 1 << (level - parentLevel);\n const parentX = (x / divisor) | 0;\n const parentY = (y / divisor) | 0;\n\n return {\n level: parentLevel,\n x: parentX,\n y: parentY,\n };\n}\n\nfunction checkLayer(provider, x, y, level, layer, topLayer) {\n if (!defined(layer.availabilityLevels)) {\n // It's definitely not in this layer\n return {\n result: false,\n };\n }\n\n let cacheKey;\n const deleteFromCache = function () {\n delete layer.availabilityPromiseCache[cacheKey];\n };\n const availabilityTilesLoaded = layer.availabilityTilesLoaded;\n const availability = layer.availability;\n\n let tile = getAvailabilityTile(layer, x, y, level);\n while (defined(tile)) {\n if (\n availability.isTileAvailable(tile.level, tile.x, tile.y) &&\n !availabilityTilesLoaded.isTileAvailable(tile.level, tile.x, tile.y)\n ) {\n let requestPromise;\n if (!topLayer) {\n cacheKey = `${tile.level}-${tile.x}-${tile.y}`;\n requestPromise = layer.availabilityPromiseCache[cacheKey];\n if (!defined(requestPromise)) {\n // For cutout terrain, if this isn't the top layer the availability tiles\n // may never get loaded, so request it here.\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.TERRAIN,\n });\n requestPromise = requestTileGeometry(\n provider,\n tile.x,\n tile.y,\n tile.level,\n layer,\n request\n );\n if (defined(requestPromise)) {\n layer.availabilityPromiseCache[cacheKey] = requestPromise;\n requestPromise.then(deleteFromCache);\n }\n }\n }\n\n // The availability tile is available, but not loaded, so there\n // is still a chance that it may become available at some point\n return {\n result: true,\n promise: requestPromise,\n };\n }\n\n tile = getAvailabilityTile(layer, tile.x, tile.y, tile.level);\n }\n\n return {\n result: false,\n };\n}\n\n// Used for testing\nCesiumTerrainProvider._getAvailabilityTile = getAvailabilityTile;\nexport default CesiumTerrainProvider;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipseGeometry from \"./EllipseGeometry.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\n *\n * @alias CircleGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\n * @param {Number} options.radius The radius in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\n * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\n * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\n *\n * @exception {DeveloperError} radius must be greater than zero.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see CircleGeometry.createGeometry\n * @see Packable\n *\n * @example\n * // Create a circle.\n * const circle = new Cesium.CircleGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n * radius : 100000.0\n * });\n * const geometry = Cesium.CircleGeometry.createGeometry(circle);\n */\nfunction CircleGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const radius = options.radius;\n\n const ellipseGeometryOptions = {\n center: options.center,\n semiMajorAxis: radius,\n semiMinorAxis: radius,\n ellipsoid: options.ellipsoid,\n height: options.height,\n extrudedHeight: options.extrudedHeight,\n granularity: options.granularity,\n vertexFormat: options.vertexFormat,\n stRotation: options.stRotation,\n shadowVolume: options.shadowVolume,\n };\n this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions);\n this._workerName = \"createCircleGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCircleGeometry.packedLength = EllipseGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CircleGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCircleGeometry.pack = function (value, array, startingIndex) {\nreturn EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);\n};\n\nconst scratchEllipseGeometry = new EllipseGeometry({\n center: new Cartesian3(),\n semiMajorAxis: 1.0,\n semiMinorAxis: 1.0,\n});\nconst scratchOptions = {\n center: new Cartesian3(),\n radius: undefined,\n ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\n height: undefined,\n extrudedHeight: undefined,\n granularity: undefined,\n vertexFormat: new VertexFormat(),\n stRotation: undefined,\n semiMajorAxis: undefined,\n semiMinorAxis: undefined,\n shadowVolume: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CircleGeometry} [result] The object into which to store the result.\n * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.\n */\nCircleGeometry.unpack = function (array, startingIndex, result) {\n const ellipseGeometry = EllipseGeometry.unpack(\n array,\n startingIndex,\n scratchEllipseGeometry\n );\n scratchOptions.center = Cartesian3.clone(\n ellipseGeometry._center,\n scratchOptions.center\n );\n scratchOptions.ellipsoid = Ellipsoid.clone(\n ellipseGeometry._ellipsoid,\n scratchOptions.ellipsoid\n );\n scratchOptions.height = ellipseGeometry._height;\n scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\n scratchOptions.granularity = ellipseGeometry._granularity;\n scratchOptions.vertexFormat = VertexFormat.clone(\n ellipseGeometry._vertexFormat,\n scratchOptions.vertexFormat\n );\n scratchOptions.stRotation = ellipseGeometry._stRotation;\n scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipseGeometry._semiMajorAxis;\n return new CircleGeometry(scratchOptions);\n }\n\n scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\n scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\n result._ellipseGeometry = new EllipseGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {CircleGeometry} circleGeometry A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCircleGeometry.createGeometry = function (circleGeometry) {\n return EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);\n};\n\n/**\n * @private\n */\nCircleGeometry.createShadowVolume = function (\n circleGeometry,\n minHeightFunc,\n maxHeightFunc\n) {\n const granularity = circleGeometry._ellipseGeometry._granularity;\n const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;\n\n const minHeight = minHeightFunc(granularity, ellipsoid);\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\n\n return new CircleGeometry({\n center: circleGeometry._ellipseGeometry._center,\n radius: circleGeometry._ellipseGeometry._semiMajorAxis,\n ellipsoid: ellipsoid,\n stRotation: circleGeometry._ellipseGeometry._stRotation,\n granularity: granularity,\n extrudedHeight: minHeight,\n height: maxHeight,\n vertexFormat: VertexFormat.POSITION_ONLY,\n shadowVolume: true,\n });\n};\n\nObject.defineProperties(CircleGeometry.prototype, {\n /**\n * @private\n */\n rectangle: {\n get: function () {\n return this._ellipseGeometry.rectangle;\n },\n },\n /**\n * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.\n * @private\n */\n textureCoordinateRotationPoints: {\n get: function () {\n return this._ellipseGeometry.textureCoordinateRotationPoints;\n },\n },\n});\nexport default CircleGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipseOutlineGeometry from \"./EllipseOutlineGeometry.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\n\n/**\n * A description of the outline of a circle on the ellipsoid.\n *\n * @alias CircleOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\n * @param {Number} options.radius The radius in meters.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\n * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\n * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.\n * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.\n *\n * @exception {DeveloperError} radius must be greater than zero.\n * @exception {DeveloperError} granularity must be greater than zero.\n *\n * @see CircleOutlineGeometry.createGeometry\n * @see Packable\n *\n * @example\n * // Create a circle.\n * const circle = new Cesium.CircleOutlineGeometry({\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\n * radius : 100000.0\n * });\n * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);\n */\nfunction CircleOutlineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const radius = options.radius;\n\n const ellipseGeometryOptions = {\n center: options.center,\n semiMajorAxis: radius,\n semiMinorAxis: radius,\n ellipsoid: options.ellipsoid,\n height: options.height,\n extrudedHeight: options.extrudedHeight,\n granularity: options.granularity,\n numberOfVerticalLines: options.numberOfVerticalLines,\n };\n this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions);\n this._workerName = \"createCircleOutlineGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nCircleOutlineGeometry.packedLength = EllipseOutlineGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {CircleOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nCircleOutlineGeometry.pack = function (value, array, startingIndex) {\nreturn EllipseOutlineGeometry.pack(\n value._ellipseGeometry,\n array,\n startingIndex\n );\n};\n\nconst scratchEllipseGeometry = new EllipseOutlineGeometry({\n center: new Cartesian3(),\n semiMajorAxis: 1.0,\n semiMinorAxis: 1.0,\n});\nconst scratchOptions = {\n center: new Cartesian3(),\n radius: undefined,\n ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\n height: undefined,\n extrudedHeight: undefined,\n granularity: undefined,\n numberOfVerticalLines: undefined,\n semiMajorAxis: undefined,\n semiMinorAxis: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {CircleOutlineGeometry} [result] The object into which to store the result.\n * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.\n */\nCircleOutlineGeometry.unpack = function (array, startingIndex, result) {\n const ellipseGeometry = EllipseOutlineGeometry.unpack(\n array,\n startingIndex,\n scratchEllipseGeometry\n );\n scratchOptions.center = Cartesian3.clone(\n ellipseGeometry._center,\n scratchOptions.center\n );\n scratchOptions.ellipsoid = Ellipsoid.clone(\n ellipseGeometry._ellipsoid,\n scratchOptions.ellipsoid\n );\n scratchOptions.height = ellipseGeometry._height;\n scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\n scratchOptions.granularity = ellipseGeometry._granularity;\n scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipseGeometry._semiMajorAxis;\n return new CircleOutlineGeometry(scratchOptions);\n }\n\n scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\n scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\n result._ellipseGeometry = new EllipseOutlineGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\n *\n * @param {CircleOutlineGeometry} circleGeometry A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nCircleOutlineGeometry.createGeometry = function (circleGeometry) {\n return EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);\n};\nexport default CircleOutlineGeometry;\n", "import Uri from \"urijs\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ion from \"./Ion.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\n/**\n * A {@link Resource} instance that encapsulates Cesium ion asset access.\n * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.\n *\n * @alias IonResource\n * @constructor\n * @augments Resource\n *\n * @param {Object} endpoint The result of the Cesium ion asset endpoint service.\n * @param {Resource} endpointResource The resource used to retreive the endpoint.\n *\n * @see Ion\n * @see IonImageryProvider\n * @see createWorldTerrain\n * @see https://cesium.com\n */\nfunction IonResource(endpoint, endpointResource) {\n let options;\n const externalType = endpoint.externalType;\n const isExternal = defined(externalType);\n\n if (!isExternal) {\n options = {\n url: endpoint.url,\n retryAttempts: 1,\n retryCallback: retryCallback,\n };\n } else if (\n externalType === \"3DTILES\" ||\n externalType === \"STK_TERRAIN_SERVER\"\n ) {\n // 3D Tiles and STK Terrain Server external assets can still be represented as an IonResource\n options = { url: endpoint.options.url };\n } else {\n //External imagery assets have additional configuration that can't be represented as a Resource\n throw new RuntimeError(\n \"Ion.createResource does not support external imagery assets; use IonImageryProvider instead.\"\n );\n }\n\n Resource.call(this, options);\n\n // The asset endpoint data returned from ion.\n this._ionEndpoint = endpoint;\n this._ionEndpointDomain = isExternal\n ? undefined\n : new Uri(endpoint.url).authority();\n\n // The endpoint resource to fetch when a new token is needed\n this._ionEndpointResource = endpointResource;\n\n // The primary IonResource from which an instance is derived\n this._ionRoot = undefined;\n\n // Shared promise for endpooint requests amd credits (only ever set on the root request)\n this._pendingPromise = undefined;\n this._credits = undefined;\n this._isExternal = isExternal;\n}\n\nif (defined(Object.create)) {\n IonResource.prototype = Object.create(Resource.prototype);\n IonResource.prototype.constructor = IonResource;\n}\n\n/**\n * Asynchronously creates an instance.\n *\n * @param {Number} assetId The Cesium ion asset id.\n * @param {Object} [options] An object with the following properties:\n * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use.\n * @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.\n * @returns {Promise.<IonResource>} A Promise to am instance representing the Cesium ion Asset.\n *\n * @example\n * //Load a Cesium3DTileset with asset ID of 124624234\n * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));\n *\n * @example\n * //Load a CZML file with asset ID of 10890\n * Cesium.IonResource.fromAssetId(10890)\n * .then(function (resource) {\n * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));\n * });\n */\nIonResource.fromAssetId = function (assetId, options) {\n const endpointResource = IonResource._createEndpointResource(\n assetId,\n options\n );\n\n return endpointResource.fetchJson().then(function (endpoint) {\n return new IonResource(endpoint, endpointResource);\n });\n};\n\nObject.defineProperties(IonResource.prototype, {\n /**\n * Gets the credits required for attribution of the asset.\n *\n * @memberof IonResource.prototype\n * @type {Credit[]}\n * @readonly\n */\n credits: {\n get: function () {\n // Only we're not the root, return its credits;\n if (defined(this._ionRoot)) {\n return this._ionRoot.credits;\n }\n\n // We are the root\n if (defined(this._credits)) {\n return this._credits;\n }\n\n this._credits = IonResource.getCreditsFromEndpoint(\n this._ionEndpoint,\n this._ionEndpointResource\n );\n\n return this._credits;\n },\n },\n});\n\n/** @private */\nIonResource.getCreditsFromEndpoint = function (endpoint, endpointResource) {\n const credits = endpoint.attributions.map(Credit.getIonCredit);\n const defaultTokenCredit = Ion.getDefaultTokenCredit(\n endpointResource.queryParameters.access_token\n );\n if (defined(defaultTokenCredit)) {\n credits.push(Credit.clone(defaultTokenCredit));\n }\n return credits;\n};\n\n/** @inheritdoc */\nIonResource.prototype.clone = function (result) {\n // We always want to use the root's information because it's the most up-to-date\n const ionRoot = defaultValue(this._ionRoot, this);\n\n if (!defined(result)) {\n result = new IonResource(\n ionRoot._ionEndpoint,\n ionRoot._ionEndpointResource\n );\n }\n\n result = Resource.prototype.clone.call(this, result);\n result._ionRoot = ionRoot;\n result._isExternal = this._isExternal;\n\n return result;\n};\n\nIonResource.prototype.fetchImage = function (options) {\n if (!this._isExternal) {\n const userOptions = options;\n options = {\n preferBlob: true,\n };\n if (defined(userOptions)) {\n options.flipY = userOptions.flipY;\n options.preferImageBitmap = userOptions.preferImageBitmap;\n }\n }\n\n return Resource.prototype.fetchImage.call(this, options);\n};\n\nIonResource.prototype._makeRequest = function (options) {\n // Don't send ion access token to non-ion servers.\n if (\n this._isExternal ||\n new Uri(this.url).authority() !== this._ionEndpointDomain\n ) {\n return Resource.prototype._makeRequest.call(this, options);\n }\n\n if (!defined(options.headers)) {\n options.headers = {};\n }\n options.headers.Authorization = `Bearer ${this._ionEndpoint.accessToken}`;\n\n return Resource.prototype._makeRequest.call(this, options);\n};\n\n/**\n * @private\n */\nIonResource._createEndpointResource = function (assetId, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let server = defaultValue(options.server, Ion.defaultServer);\n const accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken);\n server = Resource.createIfNeeded(server);\n\n const resourceOptions = {\n url: `v1/assets/${assetId}/endpoint`,\n };\n\n if (defined(accessToken)) {\n resourceOptions.queryParameters = { access_token: accessToken };\n }\n\n return server.getDerivedResource(resourceOptions);\n};\n\nfunction retryCallback(that, error) {\n const ionRoot = defaultValue(that._ionRoot, that);\n const endpointResource = ionRoot._ionEndpointResource;\n\n // Image is not available in worker threads, so this avoids\n // a ReferenceError\n const imageDefined = typeof Image !== \"undefined\";\n\n // We only want to retry in the case of invalid credentials (401) or image\n // requests(since Image failures can not provide a status code)\n if (\n !defined(error) ||\n (error.statusCode !== 401 &&\n !(imageDefined && error.target instanceof Image))\n ) {\n return Promise.resolve(false);\n }\n\n // We use a shared pending promise for all derived assets, since they share\n // a common access_token. If we're already requesting a new token for this\n // asset, we wait on the same promise.\n if (!defined(ionRoot._pendingPromise)) {\n ionRoot._pendingPromise = endpointResource\n .fetchJson()\n .then(function (newEndpoint) {\n //Set the token for root resource so new derived resources automatically pick it up\n ionRoot._ionEndpoint = newEndpoint;\n return newEndpoint;\n })\n .finally(function (newEndpoint) {\n // Pass or fail, we're done with this promise, the next failure should use a new one.\n ionRoot._pendingPromise = undefined;\n return newEndpoint;\n });\n }\n\n return ionRoot._pendingPromise.then(function (newEndpoint) {\n // Set the new token and endpoint for this resource\n that._ionEndpoint = newEndpoint;\n return true;\n });\n}\nexport default IonResource;\n", "import Credit from \"./Credit.js\";\nimport defined from \"./defined.js\";\nimport Resource from \"./Resource.js\";\n\nlet defaultTokenCredit;\nconst defaultAccessToken =\n \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0NTkyNGVkMi04YTg1LTQ4YzktYTI3MS05NTNiZWM3MTg2ZGEiLCJpZCI6MjU5LCJpYXQiOjE2NjQ4MTQyODl9.mGZTN2DeKa-mQnQr6BInj8GzOK6wq3dZMwcyU0iwInA\";\n\n/**\n * Default settings for accessing the Cesium ion API.\n *\n * An ion access token is only required if you are using any ion related APIs.\n * A default access token is provided for evaluation purposes only.\n * Sign up for a free ion account and get your own access token at {@link https://cesium.com}\n *\n * @see IonResource\n * @see IonImageryProvider\n * @see IonGeocoderService\n * @see createWorldImagery\n * @see createWorldTerrain\n * @namespace Ion\n */\nconst Ion = {};\n\n/**\n * Gets or sets the default Cesium ion access token.\n *\n * @type {String}\n */\nIon.defaultAccessToken = defaultAccessToken;\n\n/**\n * Gets or sets the default Cesium ion server.\n *\n * @type {String|Resource}\n * @default https://api.cesium.com\n */\nIon.defaultServer = new Resource({ url: \"https://api.cesium.com/\" });\n\nIon.getDefaultTokenCredit = function (providedKey) {\n if (providedKey !== defaultAccessToken) {\n return undefined;\n }\n\n if (!defined(defaultTokenCredit)) {\n const defaultTokenMessage =\n '<b> \\\n This application is using Cesium\\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> \\\n with an access token from your ion account before making any Cesium API calls. \\\n You can sign up for a free ion account at <a href=\"https://cesium.com\">https://cesium.com</a>.</b>';\n\n defaultTokenCredit = new Credit(defaultTokenMessage, true);\n }\n\n return defaultTokenCredit;\n};\nexport default Ion;\n", "import CesiumTerrainProvider from \"./CesiumTerrainProvider.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport IonResource from \"./IonResource.js\";\n\n/**\n * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.\n *\n * @function\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.\n * @param {Boolean} [options.requestWaterMask=false] Flag that indicates if the client should request per tile water masks from the server if available.\n * @returns {CesiumTerrainProvider}\n *\n * @see Ion\n *\n * @example\n * // Create Cesium World Terrain with default settings\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * terrainProvider : Cesium.createWorldTerrain();\n * });\n *\n * @example\n * // Create Cesium World Terrain with water and normals.\n * const viewer1 = new Cesium.Viewer('cesiumContainer', {\n * terrainProvider : Cesium.createWorldTerrain({\n * requestWaterMask : true,\n * requestVertexNormals : true\n * });\n * });\n *\n */\nfunction createWorldTerrain(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n return new CesiumTerrainProvider({\n url: IonResource.fromAssetId(1),\n requestVertexNormals: defaultValue(options.requestVertexNormals, false),\n requestWaterMask: defaultValue(options.requestWaterMask, false),\n });\n}\nexport default createWorldTerrain;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * @callback CustomHeightmapTerrainProvider.GeometryCallback\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Number[]|Promise.<Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|Number[]>|undefined} An array or a promise to an array of heights in row-major order. If undefined, the globe will render the parent tile.\n */\n\n/**\n * A simple {@link TerrainProvider} that gets height values from a callback function.\n * It can be used for procedurally generated terrain or as a way to load custom\n * heightmap data without creating a subclass of {@link TerrainProvider}.\n *\n * There are some limitations such as no water mask, no vertex normals, and no\n * availability, so a full-fledged {@link TerrainProvider} subclass is better suited\n * for these more sophisticated use cases.\n *\n * @alias CustomHeightmapTerrainProvider\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {CustomHeightmapTerrainProvider.GeometryCallback} options.callback The callback function for requesting tile geometry.\n * @param {Number} options.width The number of columns per heightmap tile.\n * @param {Number} options.height The number of rows per heightmap tile.\n * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}\n * is used.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n *\n * @example\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\n * terrainProvider: new Cesium.CustomHeightmapTerrainProvider({\n * width: 32,\n * height: 32,\n * callback: function (x, y, level) {\n * return new Float32Array(32 * 32); // all zeros\n * },\n * }),\n * });\n *\n * @see TerrainProvider\n */\nfunction CustomHeightmapTerrainProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._callback = options.callback;\n\n this._tilingScheme = options.tilingScheme;\n if (!defined(this._tilingScheme)) {\n this._tilingScheme = new GeographicTilingScheme({\n ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n });\n }\n\n this._width = options.width;\n this._height = options.height;\n const maxTileDimensions = Math.max(this._width, this._height);\n\n this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n this._tilingScheme.ellipsoid,\n maxTileDimensions,\n this._tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n\n this._errorEvent = new Event();\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n this._readyPromise = Promise.resolve(true);\n}\n\nObject.defineProperties(CustomHeightmapTerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves.\n * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return\n * value will always be false.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return\n * value will always be false.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets the number of columns per heightmap tile.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n width: {\n get: function () {\n return this._width;\n },\n },\n\n /**\n * Gets the number of rows per heightmap tile.\n * @memberof CustomHeightmapTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n height: {\n get: function () {\n return this._height;\n },\n },\n});\n\n/**\n * Requests the geometry for a given tile. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n */\nCustomHeightmapTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const promise = this._callback(x, y, level);\n if (!defined(promise)) {\n return undefined;\n }\n\n const width = this._width;\n const height = this._height;\n\n return Promise.resolve(promise).then(function (heightmapData) {\n let buffer = heightmapData;\n if (Array.isArray(buffer)) {\n // HeightmapTerrainData expects a TypedArray, so convert from Number[] to Float64Array\n buffer = new Float64Array(buffer);\n }\n\n return new HeightmapTerrainData({\n buffer: buffer,\n width: width,\n height: height,\n });\n });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nCustomHeightmapTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nCustomHeightmapTerrainProvider.prototype.getTileDataAvailable = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nCustomHeightmapTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n return undefined;\n};\nexport default CustomHeightmapTerrainProvider;\n", "import Check from \"./Check.js\";\nimport RuntimeError from \"./RuntimeError.js\";\n\nconst compressedMagic = 0x7468dead;\nconst compressedMagicSwap = 0xadde6874;\n\n/**\n * Decodes data that is received from the Google Earth Enterprise server.\n *\n * @param {ArrayBuffer} key The key used during decoding.\n * @param {ArrayBuffer} data The data to be decoded.\n *\n * @private\n */\nfunction decodeGoogleEarthEnterpriseData(key, data) {\n if (decodeGoogleEarthEnterpriseData.passThroughDataForTesting) {\n return data;\n }\n\n const keyLength = key.byteLength;\n if (keyLength === 0 || keyLength % 4 !== 0) {\n throw new RuntimeError(\n \"The length of key must be greater than 0 and a multiple of 4.\"\n );\n }\n\n const dataView = new DataView(data);\n const magic = dataView.getUint32(0, true);\n if (magic === compressedMagic || magic === compressedMagicSwap) {\n // Occasionally packets don't come back encoded, so just return\n return data;\n }\n\n const keyView = new DataView(key);\n\n let dp = 0;\n const dpend = data.byteLength;\n const dpend64 = dpend - (dpend % 8);\n const kpend = keyLength;\n let kp;\n let off = 8;\n\n // This algorithm is intentionally asymmetric to make it more difficult to\n // guess. Security through obscurity. :-(\n\n // while we have a full uint64 (8 bytes) left to do\n // assumes buffer is 64bit aligned (or processor doesn't care)\n while (dp < dpend64) {\n // rotate the key each time through by using the offets 16,0,8,16,0,8,...\n off = (off + 8) % 24;\n kp = off;\n\n // run through one key length xor'ing one uint64 at a time\n // then drop out to rotate the key for the next bit\n while (dp < dpend64 && kp < kpend) {\n dataView.setUint32(\n dp,\n dataView.getUint32(dp, true) ^ keyView.getUint32(kp, true),\n true\n );\n dataView.setUint32(\n dp + 4,\n dataView.getUint32(dp + 4, true) ^ keyView.getUint32(kp + 4, true),\n true\n );\n dp += 8;\n kp += 24;\n }\n }\n\n // now the remaining 1 to 7 bytes\n if (dp < dpend) {\n if (kp >= kpend) {\n // rotate the key one last time (if necessary)\n off = (off + 8) % 24;\n kp = off;\n }\n\n while (dp < dpend) {\n dataView.setUint8(dp, dataView.getUint8(dp) ^ keyView.getUint8(kp));\n dp++;\n kp++;\n }\n }\n}\n\ndecodeGoogleEarthEnterpriseData.passThroughDataForTesting = false;\nexport default decodeGoogleEarthEnterpriseData;\n", "/**\n * A simple proxy that appends the desired resource as the sole query parameter\n * to the given proxy URL.\n *\n * @alias DefaultProxy\n * @constructor\n * @extends {Proxy}\n *\n * @param {String} proxy The proxy URL that will be used to requests all resources.\n */\nfunction DefaultProxy(proxy) {\n this.proxy = proxy;\n}\n\n/**\n * Get the final URL to use to request a given resource.\n *\n * @param {String} resource The resource to request.\n * @returns {String} proxied resource\n */\nDefaultProxy.prototype.getURL = function (resource) {\n const prefix = this.proxy.indexOf(\"?\") === -1 ? \"?\" : \"\";\n return this.proxy + prefix + encodeURIComponent(resource);\n};\n\nexport default DefaultProxy;\n", "import CesiumMath from \"./Math.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\n\n/**\n * Array-backed min-max heap implementation of a double-ended priority queue.\n * This data structure allows for efficient removal of minimum and maximum elements.\n *\n * @alias DoubleEndedPriorityQueue\n * @constructor\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {DoubleEndedPriorityQueue.ComparatorCallback} options.comparator The comparator to use for the queue. If comparator(a, b) is less than 0, a is lower priority than b.\n * @param {Number} [options.maximumLength] The maximum length of the queue. If an element is inserted when the queue is at full capacity, the minimum element is removed. By default, the size of the queue is unlimited.\n */\nfunction DoubleEndedPriorityQueue(options) {\n this._comparator = options.comparator;\n this._maximumLength = options.maximumLength;\n this._array = defined(options.maximumLength)\n ? new Array(options.maximumLength)\n : [];\n this._length = 0;\n}\n\nObject.defineProperties(DoubleEndedPriorityQueue.prototype, {\n /**\n * Gets the number of elements in the queue.\n *\n * @memberof DoubleEndedPriorityQueue.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._length;\n },\n },\n\n /**\n * Gets or sets the maximum number of elements in the queue.\n * If set to a smaller value than the current length of the queue, the lowest priority elements are removed.\n * If an element is inserted when the queue is at full capacity, the minimum element is removed.\n * If set to undefined, the size of the queue is unlimited.\n *\n * @memberof DoubleEndedPriorityQueue.prototype\n *\n * @type {Number}\n * @readonly\n */\n maximumLength: {\n get: function () {\n return this._maximumLength;\n },\n set: function (value) {\n if (defined(value)) {\n // Remove elements until the maximum length is met.\n while (this._length > value) {\n this.removeMinimum();\n }\n\n // The array size is fixed to the maximum length\n this._array.length = value;\n }\n this._maximumLength = value;\n },\n },\n\n /**\n * Gets the internal array.\n *\n * @memberof DoubleEndedPriorityQueue.prototype\n *\n * @type {Array}\n * @readonly\n */\n internalArray: {\n get: function () {\n return this._array;\n },\n },\n\n /**\n * The comparator used by the queue.\n * If comparator(a, b) is less than 0, a is lower priority than b.\n *\n * @memberof DoubleEndedPriorityQueue.prototype\n *\n * @type {DoubleEndedPriorityQueue.ComparatorCallback}\n * @readonly\n */\n comparator: {\n get: function () {\n return this._comparator;\n },\n },\n});\n\n/**\n * Clones the double ended priority queue.\n *\n * @returns {DoubleEndedPriorityQueue} The cloned double ended priority queue.\n */\nDoubleEndedPriorityQueue.prototype.clone = function () {\n const maximumLength = this._maximumLength;\n const comparator = this._comparator;\n const array = this._array;\n const length = this._length;\n\n const result = new DoubleEndedPriorityQueue({\n comparator: comparator,\n maximumLength: maximumLength,\n });\n\n result._length = length;\n for (let i = 0; i < length; i++) {\n result._array[i] = array[i];\n }\n\n return result;\n};\n\n/**\n * Removes all elements from the queue.\n */\nDoubleEndedPriorityQueue.prototype.reset = function () {\n this._length = 0;\n\n // Dereference elements\n const maximumLength = this._maximumLength;\n if (defined(maximumLength)) {\n // Dereference all elements but keep the array the same size\n for (let i = 0; i < maximumLength; i++) {\n this._array[i] = undefined;\n }\n } else {\n // Dereference all elements by clearing the array\n this._array.length = 0;\n }\n};\n\n/**\n * Resort the queue.\n */\nDoubleEndedPriorityQueue.prototype.resort = function () {\n const length = this._length;\n\n // Fix the queue from the top-down\n for (let i = 0; i < length; i++) {\n pushUp(this, i);\n }\n};\n\n/**\n * Inserts an element into the queue.\n * If the queue is at full capacity, the minimum element is removed.\n * The new element is returned (and not added) if it is less than or equal priority to the minimum element.\n *\n * @param {*} element\n * @returns {*|undefined} The minimum element if the queue is at full capacity. Returns undefined if there is no maximum length.\n */\nDoubleEndedPriorityQueue.prototype.insert = function (element) {\n let removedElement;\n\n const maximumLength = this._maximumLength;\n if (defined(maximumLength)) {\n if (maximumLength === 0) {\n return undefined;\n } else if (this._length === maximumLength) {\n // It's faster to access the minimum directly instead of calling the getter\n // because it avoids the length === 0 check.\n const minimumElement = this._array[0];\n if (this._comparator(element, minimumElement) <= 0.0) {\n // The element that is being inserted is less than or equal to\n // the minimum element, so don't insert anything and exit early.\n return element;\n }\n removedElement = this.removeMinimum();\n }\n }\n\n const index = this._length;\n this._array[index] = element;\n this._length++;\n pushUp(this, index);\n\n return removedElement;\n};\n\n/**\n * Removes the minimum element from the queue and returns it.\n * If the queue is empty, the return value is undefined.\n *\n * @returns {*|undefined} The minimum element, or undefined if the queue is empty.\n */\nDoubleEndedPriorityQueue.prototype.removeMinimum = function () {\n const length = this._length;\n if (length === 0) {\n return undefined;\n }\n\n this._length--;\n\n // The minimum element is always the root\n const minimumElement = this._array[0];\n\n if (length >= 2) {\n this._array[0] = this._array[length - 1];\n pushDown(this, 0);\n }\n\n // Dereference removed element\n this._array[length - 1] = undefined;\n\n return minimumElement;\n};\n\n/**\n * Removes the maximum element from the queue and returns it.\n * If the queue is empty, the return value is undefined.\n *\n * @returns {*|undefined} The maximum element, or undefined if the queue is empty.\n */\nDoubleEndedPriorityQueue.prototype.removeMaximum = function () {\n const length = this._length;\n if (length === 0) {\n return undefined;\n }\n\n this._length--;\n let maximumElement;\n\n // If the root has no children, the maximum is the root.\n // If the root has one child, the maximum is the child.\n if (length <= 2) {\n maximumElement = this._array[length - 1];\n } else {\n // Otherwise, the maximum is the larger of the root's two children.\n const maximumElementIndex = greaterThan(this, 1, 2) ? 1 : 2;\n maximumElement = this._array[maximumElementIndex];\n\n // Re-balance the heap\n this._array[maximumElementIndex] = this._array[length - 1];\n if (length >= 4) {\n pushDown(this, maximumElementIndex);\n }\n }\n\n // Dereference removed element\n this._array[length - 1] = undefined;\n\n return maximumElement;\n};\n\n/**\n * Gets the minimum element in the queue.\n * If the queue is empty, the result is undefined.\n *\n * @returns {*|undefined} element\n */\n\nDoubleEndedPriorityQueue.prototype.getMinimum = function () {\n const length = this._length;\n if (length === 0) {\n return undefined;\n }\n\n // The minimum element is always the root\n return this._array[0];\n};\n\n/**\n * Gets the maximum element in the queue.\n * If the queue is empty, the result is undefined.\n *\n * @returns {*|undefined} element\n */\nDoubleEndedPriorityQueue.prototype.getMaximum = function () {\n const length = this._length;\n if (length === 0) {\n return undefined;\n }\n\n // If the root has no children, the maximum is the root.\n // If the root has one child, the maximum is the child.\n if (length <= 2) {\n return this._array[length - 1];\n }\n\n // Otherwise, the maximum is the larger of the root's two children.\n return this._array[greaterThan(this, 1, 2) ? 1 : 2];\n};\n\n// Helper functions\n\nfunction swap(that, indexA, indexB) {\n const array = that._array;\n const temp = array[indexA];\n array[indexA] = array[indexB];\n array[indexB] = temp;\n}\n\nfunction lessThan(that, indexA, indexB) {\n return that._comparator(that._array[indexA], that._array[indexB]) < 0.0;\n}\n\nfunction greaterThan(that, indexA, indexB) {\n return that._comparator(that._array[indexA], that._array[indexB]) > 0.0;\n}\n\nfunction pushUp(that, index) {\n if (index === 0) {\n return;\n }\n const onMinLevel = Math.floor(CesiumMath.log2(index + 1)) % 2 === 0;\n const parentIndex = Math.floor((index - 1) / 2);\n const lessThanParent = lessThan(that, index, parentIndex);\n\n // Get the element onto the correct level if it's not already\n if (lessThanParent !== onMinLevel) {\n swap(that, index, parentIndex);\n index = parentIndex;\n }\n\n // Swap element with grandparent as long as it:\n // 1) has a grandparent\n // 2A) is less than the grandparent when on a min level\n // 2B) is greater than the grandparent when on a max level\n while (index >= 3) {\n const grandparentIndex = Math.floor((index - 3) / 4);\n if (lessThan(that, index, grandparentIndex) !== lessThanParent) {\n break;\n }\n swap(that, index, grandparentIndex);\n index = grandparentIndex;\n }\n}\n\nfunction pushDown(that, index) {\n const length = that._length;\n const onMinLevel = Math.floor(CesiumMath.log2(index + 1)) % 2 === 0;\n\n // Loop as long as there is a left child.\n let leftChildIndex;\n while ((leftChildIndex = 2 * index + 1) < length) {\n // Find the minimum (or maximum) child or grandchild\n let target = leftChildIndex;\n const rightChildIndex = leftChildIndex + 1;\n if (rightChildIndex < length) {\n if (lessThan(that, rightChildIndex, target) === onMinLevel) {\n target = rightChildIndex;\n }\n const grandChildStart = 2 * leftChildIndex + 1;\n const grandChildCount = Math.max(\n Math.min(length - grandChildStart, 4),\n 0\n );\n for (let i = 0; i < grandChildCount; i++) {\n const grandChildIndex = grandChildStart + i;\n if (lessThan(that, grandChildIndex, target) === onMinLevel) {\n target = grandChildIndex;\n }\n }\n }\n\n // Swap the element into the correct spot\n if (lessThan(that, target, index) === onMinLevel) {\n swap(that, target, index);\n if (target !== leftChildIndex && target !== rightChildIndex) {\n const parentOfGrandchildIndex = Math.floor((target - 1) / 2);\n if (greaterThan(that, target, parentOfGrandchildIndex) === onMinLevel) {\n swap(that, target, parentOfGrandchildIndex);\n }\n }\n }\n\n index = target;\n }\n}\n\n/**\n * The comparator to use for the queue.\n * @callback DoubleEndedPriorityQueue.ComparatorCallback\n * @param {*} a An element in the queue.\n * @param {*} b An element in the queue.\n * @returns {Number} If the result of the comparison is less than 0, a is lower priority than b.\n */\nexport default DoubleEndedPriorityQueue;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\n\n/**\n * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal\n * surface.\n *\n * @alias EllipsoidTerrainProvider\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}\n * is used.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n *\n * @see TerrainProvider\n */\nfunction EllipsoidTerrainProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tilingScheme = options.tilingScheme;\n if (!defined(this._tilingScheme)) {\n this._tilingScheme = new GeographicTilingScheme({\n ellipsoid: defaultValue(options.ellipsoid, Ellipsoid.WGS84),\n });\n }\n\n // Note: the 64 below does NOT need to match the actual vertex dimensions, because\n // the ellipsoid is significantly smoother than actual terrain.\n this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n this._tilingScheme.ellipsoid,\n 64,\n this._tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n\n this._errorEvent = new Event();\n this._readyPromise = Promise.resolve(true);\n}\n\nObject.defineProperties(EllipsoidTerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link EllipsoidTerrainProvider#ready} returns true.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {GeographicTilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link EllipsoidTerrainProvider#ready} returns true.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: function () {\n return false;\n },\n },\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link TerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available.\n * @memberof EllipsoidTerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: function () {\n return undefined;\n },\n },\n});\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link TerrainProvider#ready} returns true. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n */\nEllipsoidTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const width = 16;\n const height = 16;\n return Promise.resolve(\n new HeightmapTerrainData({\n buffer: new Uint8Array(width * height),\n width: width,\n height: height,\n })\n );\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nEllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nEllipsoidTerrainProvider.prototype.getTileDataAvailable = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined} This provider does not support loading availability.\n */\nEllipsoidTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n return undefined;\n};\nexport default EllipsoidTerrainProvider;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport CullingVolume from \"./CullingVolume.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias PerspectiveOffCenterFrustum\n * @constructor\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Number} [options.left] The left clipping plane distance.\n * @param {Number} [options.right] The right clipping plane distance.\n * @param {Number} [options.top] The top clipping plane distance.\n * @param {Number} [options.bottom] The bottom clipping plane distance.\n * @param {Number} [options.near=1.0] The near clipping plane distance.\n * @param {Number} [options.far=500000000.0] The far clipping plane distance.\n *\n * @example\n * const frustum = new Cesium.PerspectiveOffCenterFrustum({\n * left : -1.0,\n * right : 1.0,\n * top : 1.0,\n * bottom : -1.0,\n * near : 1.0,\n * far : 100.0\n * });\n *\n * @see PerspectiveFrustum\n */\nfunction PerspectiveOffCenterFrustum(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Defines the left clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.left = options.left;\n this._left = undefined;\n\n /**\n * Defines the right clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.right = options.right;\n this._right = undefined;\n\n /**\n * Defines the top clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.top = options.top;\n this._top = undefined;\n\n /**\n * Defines the bottom clipping plane.\n * @type {Number}\n * @default undefined\n */\n this.bottom = options.bottom;\n this._bottom = undefined;\n\n /**\n * The distance of the near plane.\n * @type {Number}\n * @default 1.0\n */\n this.near = defaultValue(options.near, 1.0);\n this._near = this.near;\n\n /**\n * The distance of the far plane.\n * @type {Number}\n * @default 500000000.0\n */\n this.far = defaultValue(options.far, 500000000.0);\n this._far = this.far;\n\n this._cullingVolume = new CullingVolume();\n this._perspectiveMatrix = new Matrix4();\n this._infinitePerspective = new Matrix4();\n}\n\nfunction update(frustum) {\n const t = frustum.top;\n const b = frustum.bottom;\n const r = frustum.right;\n const l = frustum.left;\n const n = frustum.near;\n const f = frustum.far;\n\n if (\n t !== frustum._top ||\n b !== frustum._bottom ||\n l !== frustum._left ||\n r !== frustum._right ||\n n !== frustum._near ||\n f !== frustum._far\n ) {\n frustum._left = l;\n frustum._right = r;\n frustum._top = t;\n frustum._bottom = b;\n frustum._near = n;\n frustum._far = f;\n frustum._perspectiveMatrix = Matrix4.computePerspectiveOffCenter(\n l,\n r,\n b,\n t,\n n,\n f,\n frustum._perspectiveMatrix\n );\n frustum._infinitePerspective = Matrix4.computeInfinitePerspectiveOffCenter(\n l,\n r,\n b,\n t,\n n,\n frustum._infinitePerspective\n );\n }\n}\n\nObject.defineProperties(PerspectiveOffCenterFrustum.prototype, {\n /**\n * Gets the perspective projection matrix computed from the view frustum.\n * @memberof PerspectiveOffCenterFrustum.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix\n */\n projectionMatrix: {\n get: function () {\n update(this);\n return this._perspectiveMatrix;\n },\n },\n\n /**\n * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.\n * @memberof PerspectiveOffCenterFrustum.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @see PerspectiveOffCenterFrustum#projectionMatrix\n */\n infiniteProjectionMatrix: {\n get: function () {\n update(this);\n return this._infinitePerspective;\n },\n },\n});\n\nconst getPlanesRight = new Cartesian3();\nconst getPlanesNearCenter = new Cartesian3();\nconst getPlanesFarCenter = new Cartesian3();\nconst getPlanesNormal = new Cartesian3();\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nPerspectiveOffCenterFrustum.prototype.computeCullingVolume = function (\n position,\n direction,\n up\n) {\n const planes = this._cullingVolume.planes;\n\n const t = this.top;\n const b = this.bottom;\n const r = this.right;\n const l = this.left;\n const n = this.near;\n const f = this.far;\n\n const right = Cartesian3.cross(direction, up, getPlanesRight);\n\n const nearCenter = getPlanesNearCenter;\n Cartesian3.multiplyByScalar(direction, n, nearCenter);\n Cartesian3.add(position, nearCenter, nearCenter);\n\n const farCenter = getPlanesFarCenter;\n Cartesian3.multiplyByScalar(direction, f, farCenter);\n Cartesian3.add(position, farCenter, farCenter);\n\n const normal = getPlanesNormal;\n\n //Left plane computation\n Cartesian3.multiplyByScalar(right, l, normal);\n Cartesian3.add(nearCenter, normal, normal);\n Cartesian3.subtract(normal, position, normal);\n Cartesian3.normalize(normal, normal);\n Cartesian3.cross(normal, up, normal);\n Cartesian3.normalize(normal, normal);\n\n let plane = planes[0];\n if (!defined(plane)) {\n plane = planes[0] = new Cartesian4();\n }\n plane.x = normal.x;\n plane.y = normal.y;\n plane.z = normal.z;\n plane.w = -Cartesian3.dot(normal, position);\n\n //Right plane computation\n Cartesian3.multiplyByScalar(right, r, normal);\n Cartesian3.add(nearCenter, normal, normal);\n Cartesian3.subtract(normal, position, normal);\n Cartesian3.cross(up, normal, normal);\n Cartesian3.normalize(normal, normal);\n\n plane = planes[1];\n if (!defined(plane)) {\n plane = planes[1] = new Cartesian4();\n }\n plane.x = normal.x;\n plane.y = normal.y;\n plane.z = normal.z;\n plane.w = -Cartesian3.dot(normal, position);\n\n //Bottom plane computation\n Cartesian3.multiplyByScalar(up, b, normal);\n Cartesian3.add(nearCenter, normal, normal);\n Cartesian3.subtract(normal, position, normal);\n Cartesian3.cross(right, normal, normal);\n Cartesian3.normalize(normal, normal);\n\n plane = planes[2];\n if (!defined(plane)) {\n plane = planes[2] = new Cartesian4();\n }\n plane.x = normal.x;\n plane.y = normal.y;\n plane.z = normal.z;\n plane.w = -Cartesian3.dot(normal, position);\n\n //Top plane computation\n Cartesian3.multiplyByScalar(up, t, normal);\n Cartesian3.add(nearCenter, normal, normal);\n Cartesian3.subtract(normal, position, normal);\n Cartesian3.cross(normal, right, normal);\n Cartesian3.normalize(normal, normal);\n\n plane = planes[3];\n if (!defined(plane)) {\n plane = planes[3] = new Cartesian4();\n }\n plane.x = normal.x;\n plane.y = normal.y;\n plane.z = normal.z;\n plane.w = -Cartesian3.dot(normal, position);\n\n //Near plane computation\n plane = planes[4];\n if (!defined(plane)) {\n plane = planes[4] = new Cartesian4();\n }\n plane.x = direction.x;\n plane.y = direction.y;\n plane.z = direction.z;\n plane.w = -Cartesian3.dot(direction, nearCenter);\n\n //Far plane computation\n Cartesian3.negate(direction, normal);\n\n plane = planes[5];\n if (!defined(plane)) {\n plane = planes[5] = new Cartesian4();\n }\n plane.x = normal.x;\n plane.y = normal.y;\n plane.z = normal.z;\n plane.w = -Cartesian3.dot(normal, farCenter);\n\n return this._cullingVolume;\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\n * @param {Number} distance The distance to the near plane in meters.\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\n *\n * @example\n * // Example 2\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\n * // For example, get the size of a pixel of an image on a billboard.\n * const position = camera.position;\n * const direction = camera.direction;\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\n */\nPerspectiveOffCenterFrustum.prototype.getPixelDimensions = function (\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n) {\n update(this);\n\n const inverseNear = 1.0 / this.near;\n let tanTheta = this.top * inverseNear;\n const pixelHeight =\n (2.0 * pixelRatio * distance * tanTheta) / drawingBufferHeight;\n tanTheta = this.right * inverseNear;\n const pixelWidth =\n (2.0 * pixelRatio * distance * tanTheta) / drawingBufferWidth;\n\n result.x = pixelWidth;\n result.y = pixelHeight;\n return result;\n};\n\n/**\n * Returns a duplicate of a PerspectiveOffCenterFrustum instance.\n *\n * @param {PerspectiveOffCenterFrustum} [result] The object onto which to store the result.\n * @returns {PerspectiveOffCenterFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveOffCenterFrustum.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new PerspectiveOffCenterFrustum();\n }\n\n result.right = this.right;\n result.left = this.left;\n result.top = this.top;\n result.bottom = this.bottom;\n result.near = this.near;\n result.far = this.far;\n\n // force update of clone to compute matrices\n result._left = undefined;\n result._right = undefined;\n result._top = undefined;\n result._bottom = undefined;\n result._near = undefined;\n result._far = undefined;\n\n return result;\n};\n\n/**\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {PerspectiveOffCenterFrustum} [other] The right hand side PerspectiveOffCenterFrustum.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nPerspectiveOffCenterFrustum.prototype.equals = function (other) {\n return (\n defined(other) &&\n other instanceof PerspectiveOffCenterFrustum &&\n this.right === other.right &&\n this.left === other.left &&\n this.top === other.top &&\n this.bottom === other.bottom &&\n this.near === other.near &&\n this.far === other.far\n );\n};\n\n/**\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {PerspectiveOffCenterFrustum} other The right hand side PerspectiveOffCenterFrustum.\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nPerspectiveOffCenterFrustum.prototype.equalsEpsilon = function (\n other,\n relativeEpsilon,\n absoluteEpsilon\n) {\n return (\n other === this ||\n (defined(other) &&\n other instanceof PerspectiveOffCenterFrustum &&\n CesiumMath.equalsEpsilon(\n this.right,\n other.right,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.left,\n other.left,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.top,\n other.top,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.bottom,\n other.bottom,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.near,\n other.near,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.far,\n other.far,\n relativeEpsilon,\n absoluteEpsilon\n ))\n );\n};\nexport default PerspectiveOffCenterFrustum;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport CesiumMath from \"./Math.js\";\nimport PerspectiveOffCenterFrustum from \"./PerspectiveOffCenterFrustum.js\";\n\n/**\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias PerspectiveFrustum\n * @constructor\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Number} [options.fov] The angle of the field of view (FOV), in radians.\n * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\n * @param {Number} [options.near=1.0] The distance of the near plane.\n * @param {Number} [options.far=500000000.0] The distance of the far plane.\n * @param {Number} [options.xOffset=0.0] The offset in the x direction.\n * @param {Number} [options.yOffset=0.0] The offset in the y direction.\n *\n * @example\n * const frustum = new Cesium.PerspectiveFrustum({\n * fov : Cesium.Math.PI_OVER_THREE,\n * aspectRatio : canvas.clientWidth / canvas.clientHeight\n * near : 1.0,\n * far : 1000.0\n * });\n *\n * @see PerspectiveOffCenterFrustum\n */\nfunction PerspectiveFrustum(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._offCenterFrustum = new PerspectiveOffCenterFrustum();\n\n /**\n * The angle of the field of view (FOV), in radians. This angle will be used\n * as the horizontal FOV if the width is greater than the height, otherwise\n * it will be the vertical FOV.\n * @type {Number}\n * @default undefined\n */\n this.fov = options.fov;\n this._fov = undefined;\n this._fovy = undefined;\n\n this._sseDenominator = undefined;\n\n /**\n * The aspect ratio of the frustum's width to it's height.\n * @type {Number}\n * @default undefined\n */\n this.aspectRatio = options.aspectRatio;\n this._aspectRatio = undefined;\n\n /**\n * The distance of the near plane.\n * @type {Number}\n * @default 1.0\n */\n this.near = defaultValue(options.near, 1.0);\n this._near = this.near;\n\n /**\n * The distance of the far plane.\n * @type {Number}\n * @default 500000000.0\n */\n this.far = defaultValue(options.far, 500000000.0);\n this._far = this.far;\n\n /**\n * Offsets the frustum in the x direction.\n * @type {Number}\n * @default 0.0\n */\n this.xOffset = defaultValue(options.xOffset, 0.0);\n this._xOffset = this.xOffset;\n\n /**\n * Offsets the frustum in the y direction.\n * @type {Number}\n * @default 0.0\n */\n this.yOffset = defaultValue(options.yOffset, 0.0);\n this._yOffset = this.yOffset;\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nPerspectiveFrustum.packedLength = 6;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {PerspectiveFrustum} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nPerspectiveFrustum.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n array[startingIndex++] = value.fov;\n array[startingIndex++] = value.aspectRatio;\n array[startingIndex++] = value.near;\n array[startingIndex++] = value.far;\n array[startingIndex++] = value.xOffset;\n array[startingIndex] = value.yOffset;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {PerspectiveFrustum} [result] The object into which to store the result.\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveFrustum.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n if (!defined(result)) {\n result = new PerspectiveFrustum();\n }\n\n result.fov = array[startingIndex++];\n result.aspectRatio = array[startingIndex++];\n result.near = array[startingIndex++];\n result.far = array[startingIndex++];\n result.xOffset = array[startingIndex++];\n result.yOffset = array[startingIndex];\n\n return result;\n};\n\nfunction update(frustum) {\n const f = frustum._offCenterFrustum;\n\n if (\n frustum.fov !== frustum._fov ||\n frustum.aspectRatio !== frustum._aspectRatio ||\n frustum.near !== frustum._near ||\n frustum.far !== frustum._far ||\n frustum.xOffset !== frustum._xOffset ||\n frustum.yOffset !== frustum._yOffset\n ) {\n frustum._aspectRatio = frustum.aspectRatio;\n frustum._fov = frustum.fov;\n frustum._fovy =\n frustum.aspectRatio <= 1\n ? frustum.fov\n : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;\n frustum._near = frustum.near;\n frustum._far = frustum.far;\n frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);\n frustum._xOffset = frustum.xOffset;\n frustum._yOffset = frustum.yOffset;\n\n f.top = frustum.near * Math.tan(0.5 * frustum._fovy);\n f.bottom = -f.top;\n f.right = frustum.aspectRatio * f.top;\n f.left = -f.right;\n f.near = frustum.near;\n f.far = frustum.far;\n\n f.right += frustum.xOffset;\n f.left += frustum.xOffset;\n f.top += frustum.yOffset;\n f.bottom += frustum.yOffset;\n }\n}\n\nObject.defineProperties(PerspectiveFrustum.prototype, {\n /**\n * Gets the perspective projection matrix computed from the view frustum.\n * @memberof PerspectiveFrustum.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @see PerspectiveFrustum#infiniteProjectionMatrix\n */\n projectionMatrix: {\n get: function () {\n update(this);\n return this._offCenterFrustum.projectionMatrix;\n },\n },\n\n /**\n * The perspective projection matrix computed from the view frustum with an infinite far plane.\n * @memberof PerspectiveFrustum.prototype\n * @type {Matrix4}\n * @readonly\n *\n * @see PerspectiveFrustum#projectionMatrix\n */\n infiniteProjectionMatrix: {\n get: function () {\n update(this);\n return this._offCenterFrustum.infiniteProjectionMatrix;\n },\n },\n\n /**\n * Gets the angle of the vertical field of view, in radians.\n * @memberof PerspectiveFrustum.prototype\n * @type {Number}\n * @readonly\n * @default undefined\n */\n fovy: {\n get: function () {\n update(this);\n return this._fovy;\n },\n },\n\n /**\n * @readonly\n * @private\n */\n sseDenominator: {\n get: function () {\n update(this);\n return this._sseDenominator;\n },\n },\n});\n\n/**\n * Creates a culling volume for this frustum.\n *\n * @param {Cartesian3} position The eye position.\n * @param {Cartesian3} direction The view direction.\n * @param {Cartesian3} up The up direction.\n * @returns {CullingVolume} A culling volume at the given position and orientation.\n *\n * @example\n * // Check if a bounding volume intersects the frustum.\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\n */\nPerspectiveFrustum.prototype.computeCullingVolume = function (\n position,\n direction,\n up\n) {\n update(this);\n return this._offCenterFrustum.computeCullingVolume(position, direction, up);\n};\n\n/**\n * Returns the pixel's width and height in meters.\n *\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\n * @param {Number} distance The distance to the near plane in meters.\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\n * @param {Cartesian2} result The object onto which to store the result.\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\n *\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\n * @exception {DeveloperError} pixelRatio must be greater than zero.\n *\n * @example\n * // Example 1\n * // Get the width and height of a pixel.\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\n *\n * @example\n * // Example 2\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\n * // For example, get the size of a pixel of an image on a billboard.\n * const position = camera.position;\n * const direction = camera.direction;\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\n */\nPerspectiveFrustum.prototype.getPixelDimensions = function (\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n) {\n update(this);\n return this._offCenterFrustum.getPixelDimensions(\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n pixelRatio,\n result\n );\n};\n\n/**\n * Returns a duplicate of a PerspectiveFrustum instance.\n *\n * @param {PerspectiveFrustum} [result] The object onto which to store the result.\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\n */\nPerspectiveFrustum.prototype.clone = function (result) {\n if (!defined(result)) {\n result = new PerspectiveFrustum();\n }\n\n result.aspectRatio = this.aspectRatio;\n result.fov = this.fov;\n result.near = this.near;\n result.far = this.far;\n\n // force update of clone to compute matrices\n result._aspectRatio = undefined;\n result._fov = undefined;\n result._near = undefined;\n result._far = undefined;\n\n this._offCenterFrustum.clone(result._offCenterFrustum);\n\n return result;\n};\n\n/**\n * Compares the provided PerspectiveFrustum componentwise and returns\n * <code>true</code> if they are equal, <code>false</code> otherwise.\n *\n * @param {PerspectiveFrustum} [other] The right hand side PerspectiveFrustum.\n * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.\n */\nPerspectiveFrustum.prototype.equals = function (other) {\n if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\n return false;\n }\n\n update(this);\n update(other);\n\n return (\n this.fov === other.fov &&\n this.aspectRatio === other.aspectRatio &&\n this._offCenterFrustum.equals(other._offCenterFrustum)\n );\n};\n\n/**\n * Compares the provided PerspectiveFrustum componentwise and returns\n * <code>true</code> if they pass an absolute or relative tolerance test,\n * <code>false</code> otherwise.\n *\n * @param {PerspectiveFrustum} other The right hand side PerspectiveFrustum.\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\n * @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.\n */\nPerspectiveFrustum.prototype.equalsEpsilon = function (\n other,\n relativeEpsilon,\n absoluteEpsilon\n) {\n if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\n return false;\n }\n\n update(this);\n update(other);\n\n return (\n CesiumMath.equalsEpsilon(\n this.fov,\n other.fov,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n CesiumMath.equalsEpsilon(\n this.aspectRatio,\n other.aspectRatio,\n relativeEpsilon,\n absoluteEpsilon\n ) &&\n this._offCenterFrustum.equalsEpsilon(\n other._offCenterFrustum,\n relativeEpsilon,\n absoluteEpsilon\n )\n );\n};\nexport default PerspectiveFrustum;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartesian4 from \"./Cartesian4.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst PERSPECTIVE = 0;\nconst ORTHOGRAPHIC = 1;\n\n/**\n * Describes a frustum at the given the origin and orientation.\n *\n * @alias FrustumGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\n * @param {Cartesian3} options.origin The origin of the frustum.\n * @param {Quaternion} options.orientation The orientation of the frustum.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n */\nfunction FrustumGeometry(options) {\n const frustum = options.frustum;\n const orientation = options.orientation;\n const origin = options.origin;\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\n\n // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\n // creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap\n // the far plane of another.\n const drawNearPlane = defaultValue(options._drawNearPlane, true);\n\n let frustumType;\n let frustumPackedLength;\n if (frustum instanceof PerspectiveFrustum) {\n frustumType = PERSPECTIVE;\n frustumPackedLength = PerspectiveFrustum.packedLength;\n } else if (frustum instanceof OrthographicFrustum) {\n frustumType = ORTHOGRAPHIC;\n frustumPackedLength = OrthographicFrustum.packedLength;\n }\n\n this._frustumType = frustumType;\n this._frustum = frustum.clone();\n this._origin = Cartesian3.clone(origin);\n this._orientation = Quaternion.clone(orientation);\n this._drawNearPlane = drawNearPlane;\n this._vertexFormat = vertexFormat;\n this._workerName = \"createFrustumGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n 2 +\n frustumPackedLength +\n Cartesian3.packedLength +\n Quaternion.packedLength +\n VertexFormat.packedLength;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {FrustumGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nFrustumGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const frustumType = value._frustumType;\n const frustum = value._frustum;\n\n array[startingIndex++] = frustumType;\n\n if (frustumType === PERSPECTIVE) {\n PerspectiveFrustum.pack(frustum, array, startingIndex);\n startingIndex += PerspectiveFrustum.packedLength;\n } else {\n OrthographicFrustum.pack(frustum, array, startingIndex);\n startingIndex += OrthographicFrustum.packedLength;\n }\n\n Cartesian3.pack(value._origin, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n Quaternion.pack(value._orientation, array, startingIndex);\n startingIndex += Quaternion.packedLength;\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\n startingIndex += VertexFormat.packedLength;\n array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\n\n return array;\n};\n\nconst scratchPackPerspective = new PerspectiveFrustum();\nconst scratchPackOrthographic = new OrthographicFrustum();\nconst scratchPackQuaternion = new Quaternion();\nconst scratchPackorigin = new Cartesian3();\nconst scratchVertexFormat = new VertexFormat();\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {FrustumGeometry} [result] The object into which to store the result.\n */\nFrustumGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const frustumType = array[startingIndex++];\n\n let frustum;\n if (frustumType === PERSPECTIVE) {\n frustum = PerspectiveFrustum.unpack(\n array,\n startingIndex,\n scratchPackPerspective\n );\n startingIndex += PerspectiveFrustum.packedLength;\n } else {\n frustum = OrthographicFrustum.unpack(\n array,\n startingIndex,\n scratchPackOrthographic\n );\n startingIndex += OrthographicFrustum.packedLength;\n }\n\n const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\n startingIndex += Cartesian3.packedLength;\n const orientation = Quaternion.unpack(\n array,\n startingIndex,\n scratchPackQuaternion\n );\n startingIndex += Quaternion.packedLength;\n const vertexFormat = VertexFormat.unpack(\n array,\n startingIndex,\n scratchVertexFormat\n );\n startingIndex += VertexFormat.packedLength;\n const drawNearPlane = array[startingIndex] === 1.0;\n\n if (!defined(result)) {\n return new FrustumGeometry({\n frustum: frustum,\n origin: origin,\n orientation: orientation,\n vertexFormat: vertexFormat,\n _drawNearPlane: drawNearPlane,\n });\n }\n\n const frustumResult =\n frustumType === result._frustumType ? result._frustum : undefined;\n result._frustum = frustum.clone(frustumResult);\n\n result._frustumType = frustumType;\n result._origin = Cartesian3.clone(origin, result._origin);\n result._orientation = Quaternion.clone(orientation, result._orientation);\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\n result._drawNearPlane = drawNearPlane;\n\n return result;\n};\n\nfunction getAttributes(\n offset,\n normals,\n tangents,\n bitangents,\n st,\n normal,\n tangent,\n bitangent\n) {\n const stOffset = (offset / 3) * 2;\n\n for (let i = 0; i < 4; ++i) {\n if (defined(normals)) {\n normals[offset] = normal.x;\n normals[offset + 1] = normal.y;\n normals[offset + 2] = normal.z;\n }\n if (defined(tangents)) {\n tangents[offset] = tangent.x;\n tangents[offset + 1] = tangent.y;\n tangents[offset + 2] = tangent.z;\n }\n if (defined(bitangents)) {\n bitangents[offset] = bitangent.x;\n bitangents[offset + 1] = bitangent.y;\n bitangents[offset + 2] = bitangent.z;\n }\n offset += 3;\n }\n\n st[stOffset] = 0.0;\n st[stOffset + 1] = 0.0;\n st[stOffset + 2] = 1.0;\n st[stOffset + 3] = 0.0;\n st[stOffset + 4] = 1.0;\n st[stOffset + 5] = 1.0;\n st[stOffset + 6] = 0.0;\n st[stOffset + 7] = 1.0;\n}\n\nconst scratchRotationMatrix = new Matrix3();\nconst scratchViewMatrix = new Matrix4();\nconst scratchInverseMatrix = new Matrix4();\n\nconst scratchXDirection = new Cartesian3();\nconst scratchYDirection = new Cartesian3();\nconst scratchZDirection = new Cartesian3();\nconst scratchNegativeX = new Cartesian3();\nconst scratchNegativeY = new Cartesian3();\nconst scratchNegativeZ = new Cartesian3();\n\nconst frustumSplits = new Array(3);\n\nconst frustumCornersNDC = new Array(4);\nfrustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[1] = new Cartesian4(1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[2] = new Cartesian4(1.0, 1.0, 1.0, 1.0);\nfrustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);\n\nconst scratchFrustumCorners = new Array(4);\nfor (let i = 0; i < 4; ++i) {\n scratchFrustumCorners[i] = new Cartesian4();\n}\n\nFrustumGeometry._computeNearFarPlanes = function (\n origin,\n orientation,\n frustumType,\n frustum,\n positions,\n xDirection,\n yDirection,\n zDirection\n) {\n const rotationMatrix = Matrix3.fromQuaternion(\n orientation,\n scratchRotationMatrix\n );\n let x = defaultValue(xDirection, scratchXDirection);\n let y = defaultValue(yDirection, scratchYDirection);\n let z = defaultValue(zDirection, scratchZDirection);\n\n x = Matrix3.getColumn(rotationMatrix, 0, x);\n y = Matrix3.getColumn(rotationMatrix, 1, y);\n z = Matrix3.getColumn(rotationMatrix, 2, z);\n\n Cartesian3.normalize(x, x);\n Cartesian3.normalize(y, y);\n Cartesian3.normalize(z, z);\n\n Cartesian3.negate(x, x);\n\n const view = Matrix4.computeView(origin, z, y, x, scratchViewMatrix);\n\n let inverseView;\n let inverseViewProjection;\n if (frustumType === PERSPECTIVE) {\n const projection = frustum.projectionMatrix;\n const viewProjection = Matrix4.multiply(\n projection,\n view,\n scratchInverseMatrix\n );\n inverseViewProjection = Matrix4.inverse(\n viewProjection,\n scratchInverseMatrix\n );\n } else {\n inverseView = Matrix4.inverseTransformation(view, scratchInverseMatrix);\n }\n\n if (defined(inverseViewProjection)) {\n frustumSplits[0] = frustum.near;\n frustumSplits[1] = frustum.far;\n } else {\n frustumSplits[0] = 0.0;\n frustumSplits[1] = frustum.near;\n frustumSplits[2] = frustum.far;\n }\n\n for (let i = 0; i < 2; ++i) {\n for (let j = 0; j < 4; ++j) {\n let corner = Cartesian4.clone(\n frustumCornersNDC[j],\n scratchFrustumCorners[j]\n );\n\n if (!defined(inverseViewProjection)) {\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n\n const near = frustumSplits[i];\n const far = frustumSplits[i + 1];\n\n corner.x =\n (corner.x * (frustum.right - frustum.left) +\n frustum.left +\n frustum.right) *\n 0.5;\n corner.y =\n (corner.y * (frustum.top - frustum.bottom) +\n frustum.bottom +\n frustum.top) *\n 0.5;\n corner.z = (corner.z * (near - far) - near - far) * 0.5;\n corner.w = 1.0;\n\n Matrix4.multiplyByVector(inverseView, corner, corner);\n } else {\n corner = Matrix4.multiplyByVector(\n inverseViewProjection,\n corner,\n corner\n );\n\n // Reverse perspective divide\n const w = 1.0 / corner.w;\n Cartesian3.multiplyByScalar(corner, w, corner);\n\n Cartesian3.subtract(corner, origin, corner);\n Cartesian3.normalize(corner, corner);\n\n const fac = Cartesian3.dot(z, corner);\n Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);\n Cartesian3.add(corner, origin, corner);\n }\n\n positions[12 * i + j * 3] = corner.x;\n positions[12 * i + j * 3 + 1] = corner.y;\n positions[12 * i + j * 3 + 2] = corner.z;\n }\n }\n};\n\n/**\n * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.\n *\n * @param {FrustumGeometry} frustumGeometry A description of the frustum.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nFrustumGeometry.createGeometry = function (frustumGeometry) {\n const frustumType = frustumGeometry._frustumType;\n const frustum = frustumGeometry._frustum;\n const origin = frustumGeometry._origin;\n const orientation = frustumGeometry._orientation;\n const drawNearPlane = frustumGeometry._drawNearPlane;\n const vertexFormat = frustumGeometry._vertexFormat;\n\n const numberOfPlanes = drawNearPlane ? 6 : 5;\n let positions = new Float64Array(3 * 4 * 6);\n FrustumGeometry._computeNearFarPlanes(\n origin,\n orientation,\n frustumType,\n frustum,\n positions\n );\n\n // -x plane\n let offset = 3 * 4 * 2;\n positions[offset] = positions[3 * 4];\n positions[offset + 1] = positions[3 * 4 + 1];\n positions[offset + 2] = positions[3 * 4 + 2];\n positions[offset + 3] = positions[0];\n positions[offset + 4] = positions[1];\n positions[offset + 5] = positions[2];\n positions[offset + 6] = positions[3 * 3];\n positions[offset + 7] = positions[3 * 3 + 1];\n positions[offset + 8] = positions[3 * 3 + 2];\n positions[offset + 9] = positions[3 * 7];\n positions[offset + 10] = positions[3 * 7 + 1];\n positions[offset + 11] = positions[3 * 7 + 2];\n\n // -y plane\n offset += 3 * 4;\n positions[offset] = positions[3 * 5];\n positions[offset + 1] = positions[3 * 5 + 1];\n positions[offset + 2] = positions[3 * 5 + 2];\n positions[offset + 3] = positions[3];\n positions[offset + 4] = positions[3 + 1];\n positions[offset + 5] = positions[3 + 2];\n positions[offset + 6] = positions[0];\n positions[offset + 7] = positions[1];\n positions[offset + 8] = positions[2];\n positions[offset + 9] = positions[3 * 4];\n positions[offset + 10] = positions[3 * 4 + 1];\n positions[offset + 11] = positions[3 * 4 + 2];\n\n // +x plane\n offset += 3 * 4;\n positions[offset] = positions[3];\n positions[offset + 1] = positions[3 + 1];\n positions[offset + 2] = positions[3 + 2];\n positions[offset + 3] = positions[3 * 5];\n positions[offset + 4] = positions[3 * 5 + 1];\n positions[offset + 5] = positions[3 * 5 + 2];\n positions[offset + 6] = positions[3 * 6];\n positions[offset + 7] = positions[3 * 6 + 1];\n positions[offset + 8] = positions[3 * 6 + 2];\n positions[offset + 9] = positions[3 * 2];\n positions[offset + 10] = positions[3 * 2 + 1];\n positions[offset + 11] = positions[3 * 2 + 2];\n\n // +y plane\n offset += 3 * 4;\n positions[offset] = positions[3 * 2];\n positions[offset + 1] = positions[3 * 2 + 1];\n positions[offset + 2] = positions[3 * 2 + 2];\n positions[offset + 3] = positions[3 * 6];\n positions[offset + 4] = positions[3 * 6 + 1];\n positions[offset + 5] = positions[3 * 6 + 2];\n positions[offset + 6] = positions[3 * 7];\n positions[offset + 7] = positions[3 * 7 + 1];\n positions[offset + 8] = positions[3 * 7 + 2];\n positions[offset + 9] = positions[3 * 3];\n positions[offset + 10] = positions[3 * 3 + 1];\n positions[offset + 11] = positions[3 * 3 + 2];\n\n if (!drawNearPlane) {\n positions = positions.subarray(3 * 4);\n }\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n }),\n });\n\n if (\n defined(vertexFormat.normal) ||\n defined(vertexFormat.tangent) ||\n defined(vertexFormat.bitangent) ||\n defined(vertexFormat.st)\n ) {\n const normals = defined(vertexFormat.normal)\n ? new Float32Array(3 * 4 * numberOfPlanes)\n : undefined;\n const tangents = defined(vertexFormat.tangent)\n ? new Float32Array(3 * 4 * numberOfPlanes)\n : undefined;\n const bitangents = defined(vertexFormat.bitangent)\n ? new Float32Array(3 * 4 * numberOfPlanes)\n : undefined;\n const st = defined(vertexFormat.st)\n ? new Float32Array(2 * 4 * numberOfPlanes)\n : undefined;\n\n const x = scratchXDirection;\n const y = scratchYDirection;\n const z = scratchZDirection;\n\n const negativeX = Cartesian3.negate(x, scratchNegativeX);\n const negativeY = Cartesian3.negate(y, scratchNegativeY);\n const negativeZ = Cartesian3.negate(z, scratchNegativeZ);\n\n offset = 0;\n if (drawNearPlane) {\n getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near\n offset += 3 * 4;\n }\n getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far\n offset += 3 * 4;\n getAttributes(\n offset,\n normals,\n tangents,\n bitangents,\n st,\n negativeX,\n negativeZ,\n y\n ); // -x\n offset += 3 * 4;\n getAttributes(\n offset,\n normals,\n tangents,\n bitangents,\n st,\n negativeY,\n negativeZ,\n negativeX\n ); // -y\n offset += 3 * 4;\n getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x\n offset += 3 * 4;\n getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y\n\n if (defined(normals)) {\n attributes.normal = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: normals,\n });\n }\n if (defined(tangents)) {\n attributes.tangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: tangents,\n });\n }\n if (defined(bitangents)) {\n attributes.bitangent = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: bitangents,\n });\n }\n if (defined(st)) {\n attributes.st = new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 2,\n values: st,\n });\n }\n }\n\n const indices = new Uint16Array(6 * numberOfPlanes);\n for (let i = 0; i < numberOfPlanes; ++i) {\n const indexOffset = i * 6;\n const index = i * 4;\n\n indices[indexOffset] = index;\n indices[indexOffset + 1] = index + 1;\n indices[indexOffset + 2] = index + 2;\n indices[indexOffset + 3] = index;\n indices[indexOffset + 4] = index + 2;\n indices[indexOffset + 5] = index + 3;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n boundingSphere: BoundingSphere.fromVertices(positions),\n });\n};\nexport default FrustumGeometry;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport FrustumGeometry from \"./FrustumGeometry.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\n\nconst PERSPECTIVE = 0;\nconst ORTHOGRAPHIC = 1;\n\n/**\n * A description of the outline of a frustum with the given the origin and orientation.\n *\n * @alias FrustumOutlineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\n * @param {Cartesian3} options.origin The origin of the frustum.\n * @param {Quaternion} options.orientation The orientation of the frustum.\n */\nfunction FrustumOutlineGeometry(options) {\n const frustum = options.frustum;\n const orientation = options.orientation;\n const origin = options.origin;\n\n // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\n // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap\n // the far plane of another.\n const drawNearPlane = defaultValue(options._drawNearPlane, true);\n\n let frustumType;\n let frustumPackedLength;\n if (frustum instanceof PerspectiveFrustum) {\n frustumType = PERSPECTIVE;\n frustumPackedLength = PerspectiveFrustum.packedLength;\n } else if (frustum instanceof OrthographicFrustum) {\n frustumType = ORTHOGRAPHIC;\n frustumPackedLength = OrthographicFrustum.packedLength;\n }\n\n this._frustumType = frustumType;\n this._frustum = frustum.clone();\n this._origin = Cartesian3.clone(origin);\n this._orientation = Quaternion.clone(orientation);\n this._drawNearPlane = drawNearPlane;\n this._workerName = \"createFrustumOutlineGeometry\";\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength =\n 2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {FrustumOutlineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nFrustumOutlineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const frustumType = value._frustumType;\n const frustum = value._frustum;\n\n array[startingIndex++] = frustumType;\n\n if (frustumType === PERSPECTIVE) {\n PerspectiveFrustum.pack(frustum, array, startingIndex);\n startingIndex += PerspectiveFrustum.packedLength;\n } else {\n OrthographicFrustum.pack(frustum, array, startingIndex);\n startingIndex += OrthographicFrustum.packedLength;\n }\n\n Cartesian3.pack(value._origin, array, startingIndex);\n startingIndex += Cartesian3.packedLength;\n Quaternion.pack(value._orientation, array, startingIndex);\n startingIndex += Quaternion.packedLength;\n array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\n\n return array;\n};\n\nconst scratchPackPerspective = new PerspectiveFrustum();\nconst scratchPackOrthographic = new OrthographicFrustum();\nconst scratchPackQuaternion = new Quaternion();\nconst scratchPackorigin = new Cartesian3();\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {FrustumOutlineGeometry} [result] The object into which to store the result.\n */\nFrustumOutlineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n const frustumType = array[startingIndex++];\n\n let frustum;\n if (frustumType === PERSPECTIVE) {\n frustum = PerspectiveFrustum.unpack(\n array,\n startingIndex,\n scratchPackPerspective\n );\n startingIndex += PerspectiveFrustum.packedLength;\n } else {\n frustum = OrthographicFrustum.unpack(\n array,\n startingIndex,\n scratchPackOrthographic\n );\n startingIndex += OrthographicFrustum.packedLength;\n }\n\n const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\n startingIndex += Cartesian3.packedLength;\n const orientation = Quaternion.unpack(\n array,\n startingIndex,\n scratchPackQuaternion\n );\n startingIndex += Quaternion.packedLength;\n const drawNearPlane = array[startingIndex] === 1.0;\n\n if (!defined(result)) {\n return new FrustumOutlineGeometry({\n frustum: frustum,\n origin: origin,\n orientation: orientation,\n _drawNearPlane: drawNearPlane,\n });\n }\n\n const frustumResult =\n frustumType === result._frustumType ? result._frustum : undefined;\n result._frustum = frustum.clone(frustumResult);\n\n result._frustumType = frustumType;\n result._origin = Cartesian3.clone(origin, result._origin);\n result._orientation = Quaternion.clone(orientation, result._orientation);\n result._drawNearPlane = drawNearPlane;\n\n return result;\n};\n\n/**\n * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.\n *\n * @param {FrustumOutlineGeometry} frustumGeometry A description of the frustum.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nFrustumOutlineGeometry.createGeometry = function (frustumGeometry) {\n const frustumType = frustumGeometry._frustumType;\n const frustum = frustumGeometry._frustum;\n const origin = frustumGeometry._origin;\n const orientation = frustumGeometry._orientation;\n const drawNearPlane = frustumGeometry._drawNearPlane;\n\n const positions = new Float64Array(3 * 4 * 2);\n FrustumGeometry._computeNearFarPlanes(\n origin,\n orientation,\n frustumType,\n frustum,\n positions\n );\n\n const attributes = new GeometryAttributes({\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positions,\n }),\n });\n\n let offset;\n let index;\n\n const numberOfPlanes = drawNearPlane ? 2 : 1;\n const indices = new Uint16Array(8 * (numberOfPlanes + 1));\n\n // Build the near/far planes\n let i = drawNearPlane ? 0 : 1;\n for (; i < 2; ++i) {\n offset = drawNearPlane ? i * 8 : 0;\n index = i * 4;\n\n indices[offset] = index;\n indices[offset + 1] = index + 1;\n indices[offset + 2] = index + 1;\n indices[offset + 3] = index + 2;\n indices[offset + 4] = index + 2;\n indices[offset + 5] = index + 3;\n indices[offset + 6] = index + 3;\n indices[offset + 7] = index;\n }\n\n // Build the sides of the frustums\n for (i = 0; i < 2; ++i) {\n offset = (numberOfPlanes + i) * 8;\n index = i * 4;\n\n indices[offset] = index;\n indices[offset + 1] = index + 4;\n indices[offset + 2] = index + 1;\n indices[offset + 3] = index + 5;\n indices[offset + 4] = index + 2;\n indices[offset + 5] = index + 6;\n indices[offset + 6] = index + 3;\n indices[offset + 7] = index + 7;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: BoundingSphere.fromVertices(positions),\n });\n};\nexport default FrustumOutlineGeometry;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * @typedef {Object} GeocoderService.Result\n * @property {String} displayName The display name for a location\n * @property {Rectangle|Cartesian3} destination The bounding box for a location\n */\n\n/**\n * Provides geocoding through an external service. This type describes an interface and\n * is not intended to be used.\n * @alias GeocoderService\n * @constructor\n *\n * @see BingMapsGeocoderService\n * @see PeliasGeocoderService\n * @see OpenCageGeocoderService\n */\nfunction GeocoderService() {}\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nGeocoderService.prototype.geocode = DeveloperError.throwInstantiationError;\nexport default GeocoderService;\n", "/**\n * The type of geocoding to be performed by a {@link GeocoderService}.\n * @enum {Number}\n * @see Geocoder\n */\nconst GeocodeType = {\n /**\n * Perform a search where the input is considered complete.\n *\n * @type {Number}\n * @constant\n */\n SEARCH: 0,\n\n /**\n * Perform an auto-complete using partial input, typically\n * reserved for providing possible results as a user is typing.\n *\n * @type {Number}\n * @constant\n */\n AUTOCOMPLETE: 1,\n};\nexport default Object.freeze(GeocodeType);\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}\n * for asynchronous geometry creation.\n *\n * @constructor\n * @class\n * @abstract\n */\nfunction GeometryFactory() {\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Returns a geometry.\n *\n * @param {GeometryFactory} geometryFactory A description of the circle.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nGeometryFactory.createGeometry = function (geometryFactory) {\n DeveloperError.throwInstantiationError();\n};\n\nexport default GeometryFactory;\n", "/**\n * Constructs an image from a TypedArray of pixel values\n *\n * @param {Uint8Array} typedArray The array of pixel values\n * @param {Number} width The width of the image to create\n * @param {Number} height The height of the image to create\n * @returns {HTMLCanvasElement} A new canvas containing the constructed image\n *\n * @private\n */\nfunction getImageFromTypedArray(typedArray, width, height) {\n // Input typedArray is Uint8Array, ImageData needs Uint8ClampedArray\n // To avoid copying, make a new DataView of the same buffer\n const dataArray = new Uint8ClampedArray(typedArray.buffer);\n const imageData = new ImageData(dataArray, width, height);\n\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n canvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n\n return canvas;\n}\nexport default getImageFromTypedArray;\n", "import * as protobuf from \"protobufjs/dist/minimal/protobuf.js\";\nimport buildModuleUrl from \"./buildModuleUrl.js\";\nimport Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport GoogleEarthEnterpriseTileInformation from \"./GoogleEarthEnterpriseTileInformation.js\";\nimport isBitSet from \"./isBitSet.js\";\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\nimport CesiumMath from \"./Math.js\";\nimport Request from \"./Request.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\n\nfunction stringToBuffer(str) {\n const len = str.length;\n const buffer = new ArrayBuffer(len);\n const ui8 = new Uint8Array(buffer);\n for (let i = 0; i < len; ++i) {\n ui8[i] = str.charCodeAt(i);\n }\n\n return buffer;\n}\n\n// Decodes packet with a key that has been around since the beginning of Google Earth Enterprise\nconst defaultKey = stringToBuffer(\n \"\\x45\\xf4\\xbd\\x0b\\x79\\xe2\\x6a\\x45\\x22\\x05\\x92\\x2c\\x17\\xcd\\x06\\x71\\xf8\\x49\\x10\\x46\\x67\\x51\\x00\\x42\\x25\\xc6\\xe8\\x61\\x2c\\x66\\x29\\x08\\xc6\\x34\\xdc\\x6a\\x62\\x25\\x79\\x0a\\x77\\x1d\\x6d\\x69\\xd6\\xf0\\x9c\\x6b\\x93\\xa1\\xbd\\x4e\\x75\\xe0\\x41\\x04\\x5b\\xdf\\x40\\x56\\x0c\\xd9\\xbb\\x72\\x9b\\x81\\x7c\\x10\\x33\\x53\\xee\\x4f\\x6c\\xd4\\x71\\x05\\xb0\\x7b\\xc0\\x7f\\x45\\x03\\x56\\x5a\\xad\\x77\\x55\\x65\\x0b\\x33\\x92\\x2a\\xac\\x19\\x6c\\x35\\x14\\xc5\\x1d\\x30\\x73\\xf8\\x33\\x3e\\x6d\\x46\\x38\\x4a\\xb4\\xdd\\xf0\\x2e\\xdd\\x17\\x75\\x16\\xda\\x8c\\x44\\x74\\x22\\x06\\xfa\\x61\\x22\\x0c\\x33\\x22\\x53\\x6f\\xaf\\x39\\x44\\x0b\\x8c\\x0e\\x39\\xd9\\x39\\x13\\x4c\\xb9\\xbf\\x7f\\xab\\x5c\\x8c\\x50\\x5f\\x9f\\x22\\x75\\x78\\x1f\\xe9\\x07\\x71\\x91\\x68\\x3b\\xc1\\xc4\\x9b\\x7f\\xf0\\x3c\\x56\\x71\\x48\\x82\\x05\\x27\\x55\\x66\\x59\\x4e\\x65\\x1d\\x98\\x75\\xa3\\x61\\x46\\x7d\\x61\\x3f\\x15\\x41\\x00\\x9f\\x14\\x06\\xd7\\xb4\\x34\\x4d\\xce\\x13\\x87\\x46\\xb0\\x1a\\xd5\\x05\\x1c\\xb8\\x8a\\x27\\x7b\\x8b\\xdc\\x2b\\xbb\\x4d\\x67\\x30\\xc8\\xd1\\xf6\\x5c\\x8f\\x50\\xfa\\x5b\\x2f\\x46\\x9b\\x6e\\x35\\x18\\x2f\\x27\\x43\\x2e\\xeb\\x0a\\x0c\\x5e\\x10\\x05\\x10\\xa5\\x73\\x1b\\x65\\x34\\xe5\\x6c\\x2e\\x6a\\x43\\x27\\x63\\x14\\x23\\x55\\xa9\\x3f\\x71\\x7b\\x67\\x43\\x7d\\x3a\\xaf\\xcd\\xe2\\x54\\x55\\x9c\\xfd\\x4b\\xc6\\xe2\\x9f\\x2f\\x28\\xed\\xcb\\x5c\\xc6\\x2d\\x66\\x07\\x88\\xa7\\x3b\\x2f\\x18\\x2a\\x22\\x4e\\x0e\\xb0\\x6b\\x2e\\xdd\\x0d\\x95\\x7d\\x7d\\x47\\xba\\x43\\xb2\\x11\\xb2\\x2b\\x3e\\x4d\\xaa\\x3e\\x7d\\xe6\\xce\\x49\\x89\\xc6\\xe6\\x78\\x0c\\x61\\x31\\x05\\x2d\\x01\\xa4\\x4f\\xa5\\x7e\\x71\\x20\\x88\\xec\\x0d\\x31\\xe8\\x4e\\x0b\\x00\\x6e\\x50\\x68\\x7d\\x17\\x3d\\x08\\x0d\\x17\\x95\\xa6\\x6e\\xa3\\x68\\x97\\x24\\x5b\\x6b\\xf3\\x17\\x23\\xf3\\xb6\\x73\\xb3\\x0d\\x0b\\x40\\xc0\\x9f\\xd8\\x04\\x51\\x5d\\xfa\\x1a\\x17\\x22\\x2e\\x15\\x6a\\xdf\\x49\\x00\\xb9\\xa0\\x77\\x55\\xc6\\xef\\x10\\x6a\\xbf\\x7b\\x47\\x4c\\x7f\\x83\\x17\\x05\\xee\\xdc\\xdc\\x46\\x85\\xa9\\xad\\x53\\x07\\x2b\\x53\\x34\\x06\\x07\\xff\\x14\\x94\\x59\\x19\\x02\\xe4\\x38\\xe8\\x31\\x83\\x4e\\xb9\\x58\\x46\\x6b\\xcb\\x2d\\x23\\x86\\x92\\x70\\x00\\x35\\x88\\x22\\xcf\\x31\\xb2\\x26\\x2f\\xe7\\xc3\\x75\\x2d\\x36\\x2c\\x72\\x74\\xb0\\x23\\x47\\xb7\\xd3\\xd1\\x26\\x16\\x85\\x37\\x72\\xe2\\x00\\x8c\\x44\\xcf\\x10\\xda\\x33\\x2d\\x1a\\xde\\x60\\x86\\x69\\x23\\x69\\x2a\\x7c\\xcd\\x4b\\x51\\x0d\\x95\\x54\\x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76\\xec\\x29\\x49\\xd6\\x5d\\x2d\\x83\\xe3\\xdb\\x36\\x06\\xa9\\x3b\\x66\\x13\\x97\\x87\\x6a\\xd5\\xb6\\x3d\\x50\\x5e\\x52\\xb9\\x4b\\xc7\\x73\\x57\\x78\\xc9\\xf4\\x2e\\x59\\x07\\x95\\x93\\x6f\\xd0\\x4b\\x17\\x57\\x19\\x3e\\x27\\x27\\xc7\\x60\\xdb\\x3b\\xed\\x9a\\x0e\\x53\\x44\\x16\\x3e\\x3f\\x8d\\x92\\x6d\\x77\\xa2\\x0a\\xeb\\x3f\\x52\\xa8\\xc6\\x55\\x5e\\x31\\x49\\x37\\x85\\xf4\\xc5\\x1f\\x26\\x2d\\xa9\\x1c\\xbf\\x8b\\x27\\x54\\xda\\xc3\\x6a\\x20\\xe5\\x2a\\x78\\x04\\xb0\\xd6\\x90\\x70\\x72\\xaa\\x8b\\x68\\xbd\\x88\\xf7\\x02\\x5f\\x48\\xb1\\x7e\\xc0\\x58\\x4c\\x3f\\x66\\x1a\\xf9\\x3e\\xe1\\x65\\xc0\\x70\\xa7\\xcf\\x38\\x69\\xaf\\xf0\\x56\\x6c\\x64\\x49\\x9c\\x27\\xad\\x78\\x74\\x4f\\xc2\\x87\\xde\\x56\\x39\\x00\\xda\\x77\\x0b\\xcb\\x2d\\x1b\\x89\\xfb\\x35\\x4f\\x02\\xf5\\x08\\x51\\x13\\x60\\xc1\\x0a\\x5a\\x47\\x4d\\x26\\x1c\\x33\\x30\\x78\\xda\\xc0\\x9c\\x46\\x47\\xe2\\x5b\\x79\\x60\\x49\\x6e\\x37\\x67\\x53\\x0a\\x3e\\xe9\\xec\\x46\\x39\\xb2\\xf1\\x34\\x0d\\xc6\\x84\\x53\\x75\\x6e\\xe1\\x0c\\x59\\xd9\\x1e\\xde\\x29\\x85\\x10\\x7b\\x49\\x49\\xa5\\x77\\x79\\xbe\\x49\\x56\\x2e\\x36\\xe7\\x0b\\x3a\\xbb\\x4f\\x03\\x62\\x7b\\xd2\\x4d\\x31\\x95\\x2f\\xbd\\x38\\x7b\\xa8\\x4f\\x21\\xe1\\xec\\x46\\x70\\x76\\x95\\x7d\\x29\\x22\\x78\\x88\\x0a\\x90\\xdd\\x9d\\x5c\\xda\\xde\\x19\\x51\\xcf\\xf0\\xfc\\x59\\x52\\x65\\x7c\\x33\\x13\\xdf\\xf3\\x48\\xda\\xbb\\x2a\\x75\\xdb\\x60\\xb2\\x02\\x15\\xd4\\xfc\\x19\\xed\\x1b\\xec\\x7f\\x35\\xa8\\xff\\x28\\x31\\x07\\x2d\\x12\\xc8\\xdc\\x88\\x46\\x7c\\x8a\\x5b\\x22\"\n);\n\n/**\n * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider\n * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.\n *\n * @alias GoogleEarthEnterpriseMetadata\n * @constructor\n *\n * @param {Resource|String} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery\n *\n * @see GoogleEarthEnterpriseImageryProvider\n * @see GoogleEarthEnterpriseTerrainProvider\n *\n */\nfunction GoogleEarthEnterpriseMetadata(resourceOrUrl) {\n let url = resourceOrUrl;\n\n if (typeof url !== \"string\" && !(url instanceof Resource)) {\n url = resourceOrUrl.url;\n }\n\n const resource = Resource.createIfNeeded(url);\n resource.appendForwardSlash();\n this._resource = resource;\n\n /**\n * True if imagery is available.\n * @type {Boolean}\n * @default true\n */\n this.imageryPresent = true;\n\n /**\n * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.\n * @type {Boolean}\n * @default undefined\n */\n this.protoImagery = undefined;\n\n /**\n * True if terrain is available.\n * @type {Boolean}\n * @default true\n */\n this.terrainPresent = true;\n\n /**\n * Exponent used to compute constant to calculate negative height values.\n * @type {Number}\n * @default 32\n */\n this.negativeAltitudeExponentBias = 32;\n\n /**\n * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.\n * @type {Number}\n * @default EPSILON12\n */\n this.negativeAltitudeThreshold = CesiumMath.EPSILON12;\n\n /**\n * Dictionary of provider id to copyright strings.\n * @type {Object}\n * @default {}\n */\n this.providers = {};\n\n /**\n * Key used to decode packets\n * @type {ArrayBuffer}\n */\n this.key = undefined;\n\n this._quadPacketVersion = 1;\n\n this._tileInfo = {};\n this._subtreePromises = {};\n\n const that = this;\n this._readyPromise = requestDbRoot(this)\n .then(function () {\n return that.getQuadTreePacket(\"\", that._quadPacketVersion);\n })\n .then(function () {\n return true;\n })\n .catch(function (e) {\n const message = `An error occurred while accessing ${\n getMetadataResource(that, \"\", 1).url\n }.`;\n return Promise.reject(new RuntimeError(message));\n });\n}\n\nObject.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {\n /**\n * Gets the name of the Google Earth Enterprise server.\n * @memberof GoogleEarthEnterpriseMetadata.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource.url;\n },\n },\n\n /**\n * Gets the proxy used for metadata requests.\n * @memberof GoogleEarthEnterpriseMetadata.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the resource used for metadata requests.\n * @memberof GoogleEarthEnterpriseMetadata.prototype\n * @type {Resource}\n * @readonly\n */\n resource: {\n get: function () {\n return this._resource;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the metadata is ready for use.\n * @memberof GoogleEarthEnterpriseMetadata.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\n/**\n * Converts a tiles (x, y, level) position into a quadkey used to request an image\n * from a Google Earth Enterprise server.\n *\n * @param {Number} x The tile's x coordinate.\n * @param {Number} y The tile's y coordinate.\n * @param {Number} level The tile's zoom level.\n *\n * @see GoogleEarthEnterpriseMetadata#quadKeyToTileXY\n */\nGoogleEarthEnterpriseMetadata.tileXYToQuadKey = function (x, y, level) {\n let quadkey = \"\";\n for (let i = level; i >= 0; --i) {\n const bitmask = 1 << i;\n let digit = 0;\n\n // Tile Layout\n // ___ ___\n //| | |\n //| 3 | 2 |\n //|-------|\n //| 0 | 1 |\n //|___|___|\n //\n\n if (!isBitSet(y, bitmask)) {\n // Top Row\n digit |= 2;\n if (!isBitSet(x, bitmask)) {\n // Right to left\n digit |= 1;\n }\n } else if (isBitSet(x, bitmask)) {\n // Left to right\n digit |= 1;\n }\n\n quadkey += digit;\n }\n return quadkey;\n};\n\n/**\n * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the\n * (x, y, level) position.\n *\n * @param {String} quadkey The tile's quad key\n *\n * @see GoogleEarthEnterpriseMetadata#tileXYToQuadKey\n */\nGoogleEarthEnterpriseMetadata.quadKeyToTileXY = function (quadkey) {\n let x = 0;\n let y = 0;\n const level = quadkey.length - 1;\n for (let i = level; i >= 0; --i) {\n const bitmask = 1 << i;\n const digit = +quadkey[level - i];\n\n if (isBitSet(digit, 2)) {\n // Top Row\n if (!isBitSet(digit, 1)) {\n // // Right to left\n x |= bitmask;\n }\n } else {\n y |= bitmask;\n if (isBitSet(digit, 1)) {\n // Left to right\n x |= bitmask;\n }\n }\n }\n return {\n x: x,\n y: y,\n level: level,\n };\n};\n\nGoogleEarthEnterpriseMetadata.prototype.isValid = function (quadKey) {\n let info = this.getTileInformationFromQuadKey(quadKey);\n if (defined(info)) {\n return info !== null;\n }\n\n let valid = true;\n let q = quadKey;\n let last;\n while (q.length > 1) {\n last = q.substring(q.length - 1);\n q = q.substring(0, q.length - 1);\n info = this.getTileInformationFromQuadKey(q);\n if (defined(info)) {\n if (!info.hasSubtree() && !info.hasChild(parseInt(last))) {\n // We have no subtree or child available at some point in this node's ancestry\n valid = false;\n }\n\n break;\n } else if (info === null) {\n // Some node in the ancestry was loaded and said there wasn't a subtree\n valid = false;\n break;\n }\n }\n\n return valid;\n};\n\nconst taskProcessor = new TaskProcessor(\"decodeGoogleEarthEnterprisePacket\");\n\n/**\n * Retrieves a Google Earth Enterprise quadtree packet.\n *\n * @param {String} [quadKey=''] The quadkey to retrieve the packet for.\n * @param {Number} [version=1] The cnode version to be used in the request.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket = function (\n quadKey,\n version,\n request\n) {\n version = defaultValue(version, 1);\n quadKey = defaultValue(quadKey, \"\");\n const resource = getMetadataResource(this, quadKey, version, request);\n\n const promise = resource.fetchArrayBuffer();\n\n if (!defined(promise)) {\n return undefined; // Throttled\n }\n\n const tileInfo = this._tileInfo;\n const key = this.key;\n return promise.then(function (metadata) {\n const decodePromise = taskProcessor.scheduleTask(\n {\n buffer: metadata,\n quadKey: quadKey,\n type: \"Metadata\",\n key: key,\n },\n [metadata]\n );\n\n return decodePromise.then(function (result) {\n let root;\n let topLevelKeyLength = -1;\n if (quadKey !== \"\") {\n // Root tile has no data except children bits, so put them into the tile info\n topLevelKeyLength = quadKey.length + 1;\n const top = result[quadKey];\n root = tileInfo[quadKey];\n root._bits |= top._bits;\n\n delete result[quadKey];\n }\n\n // Copy the resulting objects into tileInfo\n // Make sure we start with shorter quadkeys first, so we know the parents have\n // already been processed. Otherwise we can lose ancestorHasTerrain along the way.\n const keys = Object.keys(result);\n keys.sort(function (a, b) {\n return a.length - b.length;\n });\n const keysLength = keys.length;\n for (let i = 0; i < keysLength; ++i) {\n const key = keys[i];\n const r = result[key];\n if (r !== null) {\n const info = GoogleEarthEnterpriseTileInformation.clone(result[key]);\n const keyLength = key.length;\n if (keyLength === topLevelKeyLength) {\n info.setParent(root);\n } else if (keyLength > 1) {\n const parent = tileInfo[key.substring(0, key.length - 1)];\n info.setParent(parent);\n }\n tileInfo[key] = info;\n } else {\n tileInfo[key] = null;\n }\n }\n });\n });\n};\n\n/**\n * Populates the metadata subtree down to the specified tile.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise<GoogleEarthEnterpriseTileInformation>} A promise that resolves to the tile info for the requested quad key\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.populateSubtree = function (\n x,\n y,\n level,\n request\n) {\n const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n return populateSubtree(this, quadkey, request);\n};\n\nfunction populateSubtree(that, quadKey, request) {\n const tileInfo = that._tileInfo;\n let q = quadKey;\n let t = tileInfo[q];\n // If we have tileInfo make sure sure it is not a node with a subtree that's not loaded\n if (defined(t) && (!t.hasSubtree() || t.hasChildren())) {\n return t;\n }\n\n while (t === undefined && q.length > 1) {\n q = q.substring(0, q.length - 1);\n t = tileInfo[q];\n }\n\n let subtreeRequest;\n const subtreePromises = that._subtreePromises;\n let promise = subtreePromises[q];\n if (defined(promise)) {\n return promise.then(function () {\n // Recursively call this in case we need multiple subtree requests\n subtreeRequest = new Request({\n throttle: request.throttle,\n throttleByServer: request.throttleByServer,\n type: request.type,\n priorityFunction: request.priorityFunction,\n });\n return populateSubtree(that, quadKey, subtreeRequest);\n });\n }\n\n // t is either\n // null so one of its parents was a leaf node, so this tile doesn't exist\n // exists but doesn't have a subtree to request\n // undefined so no parent exists - this shouldn't ever happen once the provider is ready\n if (!defined(t) || !t.hasSubtree()) {\n return Promise.reject(\n new RuntimeError(`Couldn't load metadata for tile ${quadKey}`)\n );\n }\n\n // We need to split up the promise here because when will execute syncronously if getQuadTreePacket\n // is already resolved (like in the tests), so subtreePromises will never get cleared out.\n // Only the initial request will also remove the promise from subtreePromises.\n promise = that.getQuadTreePacket(q, t.cnodeVersion, request);\n if (!defined(promise)) {\n return undefined;\n }\n subtreePromises[q] = promise;\n\n return promise\n .then(function () {\n // Recursively call this in case we need multiple subtree requests\n subtreeRequest = new Request({\n throttle: request.throttle,\n throttleByServer: request.throttleByServer,\n type: request.type,\n priorityFunction: request.priorityFunction,\n });\n return populateSubtree(that, quadKey, subtreeRequest);\n })\n .finally(function () {\n delete subtreePromises[q];\n });\n}\n\n/**\n * Gets information about a tile\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @returns {GoogleEarthEnterpriseTileInformation|undefined} Information about the tile or undefined if it isn't loaded.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getTileInformation = function (\n x,\n y,\n level\n) {\n const quadkey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n return this._tileInfo[quadkey];\n};\n\n/**\n * Gets information about a tile from a quadKey\n *\n * @param {String} quadkey The quadkey for the tile\n * @returns {GoogleEarthEnterpriseTileInformation|undefined} Information about the tile or undefined if it isn't loaded.\n *\n * @private\n */\nGoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey = function (\n quadkey\n) {\n return this._tileInfo[quadkey];\n};\n\nfunction getMetadataResource(that, quadKey, version, request) {\n return that._resource.getDerivedResource({\n url: `flatfile?q2-0${quadKey}-q.${version.toString()}`,\n request: request,\n });\n}\n\nlet dbrootParser;\nlet dbrootParserPromise;\nfunction requestDbRoot(that) {\n const resource = that._resource.getDerivedResource({\n url: \"dbRoot.v5\",\n queryParameters: {\n output: \"proto\",\n },\n });\n\n if (!defined(dbrootParserPromise)) {\n const url = buildModuleUrl(\"ThirdParty/google-earth-dbroot-parser.js\");\n const oldValue = window.cesiumGoogleEarthDbRootParser;\n dbrootParserPromise = loadAndExecuteScript(url).then(function () {\n dbrootParser = window.cesiumGoogleEarthDbRootParser(protobuf);\n if (defined(oldValue)) {\n window.cesiumGoogleEarthDbRootParser = oldValue;\n } else {\n delete window.cesiumGoogleEarthDbRootParser;\n }\n });\n }\n\n return dbrootParserPromise\n .then(function () {\n return resource.fetchArrayBuffer();\n })\n .then(function (buf) {\n const encryptedDbRootProto = dbrootParser.EncryptedDbRootProto.decode(\n new Uint8Array(buf)\n );\n\n let byteArray = encryptedDbRootProto.encryptionData;\n let offset = byteArray.byteOffset;\n let end = offset + byteArray.byteLength;\n const key = (that.key = byteArray.buffer.slice(offset, end));\n\n byteArray = encryptedDbRootProto.dbrootData;\n offset = byteArray.byteOffset;\n end = offset + byteArray.byteLength;\n const dbRootCompressed = byteArray.buffer.slice(offset, end);\n return taskProcessor.scheduleTask(\n {\n buffer: dbRootCompressed,\n type: \"DbRoot\",\n key: key,\n },\n [dbRootCompressed]\n );\n })\n .then(function (result) {\n const dbRoot = dbrootParser.DbRootProto.decode(\n new Uint8Array(result.buffer)\n );\n that.imageryPresent = defaultValue(\n dbRoot.imageryPresent,\n that.imageryPresent\n );\n that.protoImagery = dbRoot.protoImagery;\n that.terrainPresent = defaultValue(\n dbRoot.terrainPresent,\n that.terrainPresent\n );\n if (defined(dbRoot.endSnippet) && defined(dbRoot.endSnippet.model)) {\n const model = dbRoot.endSnippet.model;\n that.negativeAltitudeExponentBias = defaultValue(\n model.negativeAltitudeExponentBias,\n that.negativeAltitudeExponentBias\n );\n that.negativeAltitudeThreshold = defaultValue(\n model.compressedNegativeAltitudeThreshold,\n that.negativeAltitudeThreshold\n );\n }\n if (defined(dbRoot.databaseVersion)) {\n that._quadPacketVersion = defaultValue(\n dbRoot.databaseVersion.quadtreeVersion,\n that._quadPacketVersion\n );\n }\n const providers = that.providers;\n const providerInfo = defaultValue(dbRoot.providerInfo, []);\n const count = providerInfo.length;\n for (let i = 0; i < count; ++i) {\n const provider = providerInfo[i];\n const copyrightString = provider.copyrightString;\n if (defined(copyrightString)) {\n providers[provider.providerId] = new Credit(copyrightString.value);\n }\n }\n })\n .catch(function () {\n // Just eat the error and use the default values.\n console.log(`Failed to retrieve ${resource.url}. Using defaults.`);\n that.key = defaultKey;\n });\n}\nexport default GoogleEarthEnterpriseMetadata;\n", "/**\n * @private\n */\nfunction isBitSet(bits, mask) {\n return (bits & mask) !== 0;\n}\nexport default isBitSet;\n", "import defined from \"./defined.js\";\nimport isBitSet from \"./isBitSet.js\";\n\n// Bitmask for checking tile properties\nconst childrenBitmasks = [0x01, 0x02, 0x04, 0x08];\nconst anyChildBitmask = 0x0f;\nconst cacheFlagBitmask = 0x10; // True if there is a child subtree\nconst imageBitmask = 0x40;\nconst terrainBitmask = 0x80;\n\n/**\n * Contains information about each tile from a Google Earth Enterprise server\n *\n * @param {Number} bits Bitmask that contains the type of data and available children for each tile.\n * @param {Number} cnodeVersion Version of the request for subtree metadata.\n * @param {Number} imageryVersion Version of the request for imagery tile.\n * @param {Number} terrainVersion Version of the request for terrain tile.\n * @param {Number} imageryProvider Id of imagery provider.\n * @param {Number} terrainProvider Id of terrain provider.\n *\n * @private\n */\nfunction GoogleEarthEnterpriseTileInformation(\n bits,\n cnodeVersion,\n imageryVersion,\n terrainVersion,\n imageryProvider,\n terrainProvider\n) {\n this._bits = bits;\n this.cnodeVersion = cnodeVersion;\n this.imageryVersion = imageryVersion;\n this.terrainVersion = terrainVersion;\n this.imageryProvider = imageryProvider;\n this.terrainProvider = terrainProvider;\n this.ancestorHasTerrain = false; // Set it later once we find its parent\n this.terrainState = undefined;\n}\n\n/**\n * Creates GoogleEarthEnterpriseTileInformation from an object\n *\n * @param {Object} info Object to be cloned\n * @param {GoogleEarthEnterpriseTileInformation} [result] The object onto which to store the result.\n * @returns {GoogleEarthEnterpriseTileInformation} The modified result parameter or a new GoogleEarthEnterpriseTileInformation instance if none was provided.\n */\nGoogleEarthEnterpriseTileInformation.clone = function (info, result) {\n if (!defined(result)) {\n result = new GoogleEarthEnterpriseTileInformation(\n info._bits,\n info.cnodeVersion,\n info.imageryVersion,\n info.terrainVersion,\n info.imageryProvider,\n info.terrainProvider\n );\n } else {\n result._bits = info._bits;\n result.cnodeVersion = info.cnodeVersion;\n result.imageryVersion = info.imageryVersion;\n result.terrainVersion = info.terrainVersion;\n result.imageryProvider = info.imageryProvider;\n result.terrainProvider = info.terrainProvider;\n }\n result.ancestorHasTerrain = info.ancestorHasTerrain;\n result.terrainState = info.terrainState;\n\n return result;\n};\n\n/**\n * Sets the parent for the tile\n *\n * @param {GoogleEarthEnterpriseTileInformation} parent Parent tile\n */\nGoogleEarthEnterpriseTileInformation.prototype.setParent = function (parent) {\n this.ancestorHasTerrain = parent.ancestorHasTerrain || this.hasTerrain();\n};\n\n/**\n * Gets whether a subtree is available\n *\n * @returns {Boolean} true if subtree is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasSubtree = function () {\n return isBitSet(this._bits, cacheFlagBitmask);\n};\n\n/**\n * Gets whether imagery is available\n *\n * @returns {Boolean} true if imagery is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasImagery = function () {\n return isBitSet(this._bits, imageBitmask);\n};\n\n/**\n * Gets whether terrain is available\n *\n * @returns {Boolean} true if terrain is available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasTerrain = function () {\n return isBitSet(this._bits, terrainBitmask);\n};\n\n/**\n * Gets whether any children are present\n *\n * @returns {Boolean} true if any children are available, false otherwise.\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasChildren = function () {\n return isBitSet(this._bits, anyChildBitmask);\n};\n\n/**\n * Gets whether a specified child is available\n *\n * @param {Number} index Index of child tile\n *\n * @returns {Boolean} true if child is available, false otherwise\n */\nGoogleEarthEnterpriseTileInformation.prototype.hasChild = function (index) {\n return isBitSet(this._bits, childrenBitmasks[index]);\n};\n\n/**\n * Gets bitmask containing children\n *\n * @returns {Number} Children bitmask\n */\nGoogleEarthEnterpriseTileInformation.prototype.getChildBitmask = function () {\n return this._bits & anyChildBitmask;\n};\nexport default GoogleEarthEnterpriseTileInformation;\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport Intersections2D from \"./Intersections2D.js\";\nimport CesiumMath from \"./Math.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport QuantizedMeshTerrainData from \"./QuantizedMeshTerrainData.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TerrainData from \"./TerrainData.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport TerrainMesh from \"./TerrainMesh.js\";\n\n/**\n * Terrain data for a single tile from a Google Earth Enterprise server.\n *\n * @alias GoogleEarthEnterpriseTerrainData\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {ArrayBuffer} options.buffer The buffer containing terrain data.\n * @param {Number} options.negativeAltitudeExponentBias Multiplier for negative terrain heights that are encoded as very small positive values.\n * @param {Number} options.negativeElevationThreshold Threshold for negative values\n * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.\n * If a child's bit is set, geometry will be requested for that tile as well when it\n * is needed. If the bit is cleared, the child tile is not requested and geometry is\n * instead upsampled from the parent. The bit values are as follows:\n * <table>\n * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>\n * <tr><td>0</td><td>1</td><td>Southwest</td></tr>\n * <tr><td>1</td><td>2</td><td>Southeast</td></tr>\n * <tr><td>2</td><td>4</td><td>Northeast</td></tr>\n * <tr><td>3</td><td>8</td><td>Northwest</td></tr>\n * </table>\n * @param {Boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;\n * otherwise, false.\n * @param {Credit[]} [options.credits] Array of credits for this tile.\n *\n *\n * @example\n * const buffer = ...\n * const childTileMask = ...\n * const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({\n * buffer : heightBuffer,\n * childTileMask : childTileMask\n * });\n *\n * @see TerrainData\n * @see HeightmapTerrainData\n * @see QuantizedMeshTerrainData\n */\nfunction GoogleEarthEnterpriseTerrainData(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._buffer = options.buffer;\n this._credits = options.credits;\n this._negativeAltitudeExponentBias = options.negativeAltitudeExponentBias;\n this._negativeElevationThreshold = options.negativeElevationThreshold;\n\n // Convert from google layout to layout of other providers\n // 3 2 -> 2 3\n // 0 1 -> 0 1\n const googleChildTileMask = defaultValue(options.childTileMask, 15);\n let childTileMask = googleChildTileMask & 3; // Bottom row is identical\n childTileMask |= googleChildTileMask & 4 ? 8 : 0; // NE\n childTileMask |= googleChildTileMask & 8 ? 4 : 0; // NW\n\n this._childTileMask = childTileMask;\n\n this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);\n\n this._skirtHeight = undefined;\n this._bufferType = this._buffer.constructor;\n this._mesh = undefined;\n this._minimumHeight = undefined;\n this._maximumHeight = undefined;\n}\n\nObject.defineProperties(GoogleEarthEnterpriseTerrainData.prototype, {\n /**\n * An array of credits for this tile\n * @memberof GoogleEarthEnterpriseTerrainData.prototype\n * @type {Credit[]}\n */\n credits: {\n get: function () {\n return this._credits;\n },\n },\n /**\n * The water mask included in this terrain data, if any. A water mask is a rectangular\n * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.\n * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.\n * @memberof GoogleEarthEnterpriseTerrainData.prototype\n * @type {Uint8Array|HTMLImageElement|HTMLCanvasElement}\n */\n waterMask: {\n get: function () {\n return undefined;\n },\n },\n});\n\nconst createMeshTaskName = \"createVerticesFromGoogleEarthEnterpriseBuffer\";\nconst createMeshTaskProcessorNoThrottle = new TaskProcessor(createMeshTaskName);\nconst createMeshTaskProcessorThrottle = new TaskProcessor(\n createMeshTaskName,\n TerrainData.maximumAsynchronousTasks\n);\n\nconst nativeRectangleScratch = new Rectangle();\nconst rectangleScratch = new Rectangle();\n\n/**\n * Creates a {@link TerrainMesh} from this terrain data.\n *\n * @private\n *\n * @param {Object} options Object with the following properties:\n * @param {TilingScheme} options.tilingScheme The tiling scheme to which this tile belongs.\n * @param {Number} options.x The X coordinate of the tile for which to create the terrain data.\n * @param {Number} options.y The Y coordinate of the tile for which to create the terrain data.\n * @param {Number} options.level The level of the tile for which to create the terrain data.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\n * @param {Boolean} [options.throttle=true] If true, indicates that this operation will need to be retried if too many asynchronous mesh creations are already in progress.\n * @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many\n * asynchronous mesh creations are already in progress and the operation should\n * be retried later.\n */\nGoogleEarthEnterpriseTerrainData.prototype.createMesh = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const tilingScheme = options.tilingScheme;\n const x = options.x;\n const y = options.y;\n const level = options.level;\n const exaggeration = defaultValue(options.exaggeration, 1.0);\n const exaggerationRelativeHeight = defaultValue(\n options.exaggerationRelativeHeight,\n 0.0\n );\n const throttle = defaultValue(options.throttle, true);\n\n const ellipsoid = tilingScheme.ellipsoid;\n tilingScheme.tileXYToNativeRectangle(x, y, level, nativeRectangleScratch);\n tilingScheme.tileXYToRectangle(x, y, level, rectangleScratch);\n\n // Compute the center of the tile for RTC rendering.\n const center = ellipsoid.cartographicToCartesian(\n Rectangle.center(rectangleScratch)\n );\n\n const levelZeroMaxError = 40075.16; // From Google's Doc\n const thisLevelMaxError = levelZeroMaxError / (1 << level);\n this._skirtHeight = Math.min(thisLevelMaxError * 8.0, 1000.0);\n\n const createMeshTaskProcessor = throttle\n ? createMeshTaskProcessorThrottle\n : createMeshTaskProcessorNoThrottle;\n\n const verticesPromise = createMeshTaskProcessor.scheduleTask({\n buffer: this._buffer,\n nativeRectangle: nativeRectangleScratch,\n rectangle: rectangleScratch,\n relativeToCenter: center,\n ellipsoid: ellipsoid,\n skirtHeight: this._skirtHeight,\n exaggeration: exaggeration,\n exaggerationRelativeHeight: exaggerationRelativeHeight,\n includeWebMercatorT: true,\n negativeAltitudeExponentBias: this._negativeAltitudeExponentBias,\n negativeElevationThreshold: this._negativeElevationThreshold,\n });\n\n if (!defined(verticesPromise)) {\n // Postponed\n return undefined;\n }\n\n const that = this;\n return verticesPromise.then(function (result) {\n // Clone complex result objects because the transfer from the web worker\n // has stripped them down to JSON-style objects.\n that._mesh = new TerrainMesh(\n center,\n new Float32Array(result.vertices),\n new Uint16Array(result.indices),\n result.indexCountWithoutSkirts,\n result.vertexCountWithoutSkirts,\n result.minimumHeight,\n result.maximumHeight,\n BoundingSphere.clone(result.boundingSphere3D),\n Cartesian3.clone(result.occludeePointInScaledSpace),\n result.numberOfAttributes,\n OrientedBoundingBox.clone(result.orientedBoundingBox),\n TerrainEncoding.clone(result.encoding),\n result.westIndicesSouthToNorth,\n result.southIndicesEastToWest,\n result.eastIndicesNorthToSouth,\n result.northIndicesWestToEast\n );\n\n that._minimumHeight = result.minimumHeight;\n that._maximumHeight = result.maximumHeight;\n\n // Free memory received from server after mesh is created.\n that._buffer = undefined;\n return that._mesh;\n });\n};\n\n/**\n * Computes the terrain height at a specified longitude and latitude.\n *\n * @param {Rectangle} rectangle The rectangle covered by this terrain data.\n * @param {Number} longitude The longitude in radians.\n * @param {Number} latitude The latitude in radians.\n * @returns {Number} The terrain height at the specified position. If the position\n * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly\n * incorrect for positions far outside the rectangle.\n */\nGoogleEarthEnterpriseTerrainData.prototype.interpolateHeight = function (\n rectangle,\n longitude,\n latitude\n) {\n const u = CesiumMath.clamp(\n (longitude - rectangle.west) / rectangle.width,\n 0.0,\n 1.0\n );\n const v = CesiumMath.clamp(\n (latitude - rectangle.south) / rectangle.height,\n 0.0,\n 1.0\n );\n\n if (!defined(this._mesh)) {\n return interpolateHeight(this, u, v, rectangle);\n }\n\n return interpolateMeshHeight(this, u, v);\n};\n\nconst upsampleTaskProcessor = new TaskProcessor(\n \"upsampleQuantizedTerrainMesh\",\n TerrainData.maximumAsynchronousTasks\n);\n\n/**\n * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the\n * height samples in this instance, interpolated if necessary.\n *\n * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.\n * @param {Number} thisX The X coordinate of this tile in the tiling scheme.\n * @param {Number} thisY The Y coordinate of this tile in the tiling scheme.\n * @param {Number} thisLevel The level of this tile in the tiling scheme.\n * @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.\n * @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.\n * @returns {Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,\n * or undefined if too many asynchronous upsample operations are in progress and the request has been\n * deferred.\n */\nGoogleEarthEnterpriseTerrainData.prototype.upsample = function (\n tilingScheme,\n thisX,\n thisY,\n thisLevel,\n descendantX,\n descendantY,\n descendantLevel\n) {\n const mesh = this._mesh;\n if (!defined(this._mesh)) {\n return undefined;\n }\n\n const isEastChild = thisX * 2 !== descendantX;\n const isNorthChild = thisY * 2 === descendantY;\n\n const ellipsoid = tilingScheme.ellipsoid;\n const childRectangle = tilingScheme.tileXYToRectangle(\n descendantX,\n descendantY,\n descendantLevel\n );\n\n const upsamplePromise = upsampleTaskProcessor.scheduleTask({\n vertices: mesh.vertices,\n indices: mesh.indices,\n indexCountWithoutSkirts: mesh.indexCountWithoutSkirts,\n vertexCountWithoutSkirts: mesh.vertexCountWithoutSkirts,\n encoding: mesh.encoding,\n minimumHeight: this._minimumHeight,\n maximumHeight: this._maximumHeight,\n isEastChild: isEastChild,\n isNorthChild: isNorthChild,\n childRectangle: childRectangle,\n ellipsoid: ellipsoid,\n });\n\n if (!defined(upsamplePromise)) {\n // Postponed\n return undefined;\n }\n\n const that = this;\n return upsamplePromise.then(function (result) {\n const quantizedVertices = new Uint16Array(result.vertices);\n const indicesTypedArray = IndexDatatype.createTypedArray(\n quantizedVertices.length / 3,\n result.indices\n );\n\n const skirtHeight = that._skirtHeight;\n\n // Use QuantizedMeshTerrainData since we have what we need already parsed\n return new QuantizedMeshTerrainData({\n quantizedVertices: quantizedVertices,\n indices: indicesTypedArray,\n minimumHeight: result.minimumHeight,\n maximumHeight: result.maximumHeight,\n boundingSphere: BoundingSphere.clone(result.boundingSphere),\n orientedBoundingBox: OrientedBoundingBox.clone(\n result.orientedBoundingBox\n ),\n horizonOcclusionPoint: Cartesian3.clone(result.horizonOcclusionPoint),\n westIndices: result.westIndices,\n southIndices: result.southIndices,\n eastIndices: result.eastIndices,\n northIndices: result.northIndices,\n westSkirtHeight: skirtHeight,\n southSkirtHeight: skirtHeight,\n eastSkirtHeight: skirtHeight,\n northSkirtHeight: skirtHeight,\n childTileMask: 0,\n createdByUpsampling: true,\n credits: that._credits,\n });\n });\n};\n\n/**\n * Determines if a given child tile is available, based on the\n * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed\n * to be one of the four children of this tile. If non-child tile coordinates are\n * given, the availability of the southeast child tile is returned.\n *\n * @param {Number} thisX The tile X coordinate of this (the parent) tile.\n * @param {Number} thisY The tile Y coordinate of this (the parent) tile.\n * @param {Number} childX The tile X coordinate of the child tile to check for availability.\n * @param {Number} childY The tile Y coordinate of the child tile to check for availability.\n * @returns {Boolean} True if the child tile is available; otherwise, false.\n */\nGoogleEarthEnterpriseTerrainData.prototype.isChildAvailable = function (\n thisX,\n thisY,\n childX,\n childY\n) {\n let bitNumber = 2; // northwest child\n if (childX !== thisX * 2) {\n ++bitNumber; // east child\n }\n if (childY !== thisY * 2) {\n bitNumber -= 2; // south child\n }\n\n return (this._childTileMask & (1 << bitNumber)) !== 0;\n};\n\n/**\n * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution\n * terrain data. If this value is false, the data was obtained from some other source, such\n * as by downloading it from a remote server. This method should return true for instances\n * returned from a call to {@link HeightmapTerrainData#upsample}.\n *\n * @returns {Boolean} True if this instance was created by upsampling; otherwise, false.\n */\nGoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling = function () {\n return this._createdByUpsampling;\n};\n\nconst texCoordScratch0 = new Cartesian2();\nconst texCoordScratch1 = new Cartesian2();\nconst texCoordScratch2 = new Cartesian2();\nconst barycentricCoordinateScratch = new Cartesian3();\n\nfunction interpolateMeshHeight(terrainData, u, v) {\n const mesh = terrainData._mesh;\n const vertices = mesh.vertices;\n const encoding = mesh.encoding;\n const indices = mesh.indices;\n\n for (let i = 0, len = indices.length; i < len; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n const uv0 = encoding.decodeTextureCoordinates(\n vertices,\n i0,\n texCoordScratch0\n );\n const uv1 = encoding.decodeTextureCoordinates(\n vertices,\n i1,\n texCoordScratch1\n );\n const uv2 = encoding.decodeTextureCoordinates(\n vertices,\n i2,\n texCoordScratch2\n );\n\n const barycentric = Intersections2D.computeBarycentricCoordinates(\n u,\n v,\n uv0.x,\n uv0.y,\n uv1.x,\n uv1.y,\n uv2.x,\n uv2.y,\n barycentricCoordinateScratch\n );\n if (\n barycentric.x >= -1e-15 &&\n barycentric.y >= -1e-15 &&\n barycentric.z >= -1e-15\n ) {\n const h0 = encoding.decodeHeight(vertices, i0);\n const h1 = encoding.decodeHeight(vertices, i1);\n const h2 = encoding.decodeHeight(vertices, i2);\n return barycentric.x * h0 + barycentric.y * h1 + barycentric.z * h2;\n }\n }\n\n // Position does not lie in any triangle in this mesh.\n return undefined;\n}\n\nconst sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\nconst sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;\nconst sizeOfFloat = Float32Array.BYTES_PER_ELEMENT;\nconst sizeOfDouble = Float64Array.BYTES_PER_ELEMENT;\n\nfunction interpolateHeight(terrainData, u, v, rectangle) {\n const buffer = terrainData._buffer;\n let quad = 0; // SW\n let uStart = 0.0;\n let vStart = 0.0;\n if (v > 0.5) {\n // Upper row\n if (u > 0.5) {\n // NE\n quad = 2;\n uStart = 0.5;\n } else {\n // NW\n quad = 3;\n }\n vStart = 0.5;\n } else if (u > 0.5) {\n // SE\n quad = 1;\n uStart = 0.5;\n }\n\n const dv = new DataView(buffer);\n let offset = 0;\n for (let q = 0; q < quad; ++q) {\n offset += dv.getUint32(offset, true);\n offset += sizeOfUint32;\n }\n offset += sizeOfUint32; // Skip length of quad\n offset += 2 * sizeOfDouble; // Skip origin\n\n // Read sizes\n const xSize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\n offset += sizeOfDouble;\n const ySize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\n offset += sizeOfDouble;\n\n // Samples per quad\n const xScale = rectangle.width / xSize / 2;\n const yScale = rectangle.height / ySize / 2;\n\n // Number of points\n const numPoints = dv.getInt32(offset, true);\n offset += sizeOfInt32;\n\n // Number of faces\n const numIndices = dv.getInt32(offset, true) * 3;\n offset += sizeOfInt32;\n\n offset += sizeOfInt32; // Skip Level\n\n const uBuffer = new Array(numPoints);\n const vBuffer = new Array(numPoints);\n const heights = new Array(numPoints);\n let i;\n for (i = 0; i < numPoints; ++i) {\n uBuffer[i] = uStart + dv.getUint8(offset++) * xScale;\n vBuffer[i] = vStart + dv.getUint8(offset++) * yScale;\n\n // Height is stored in units of (1/EarthRadius) or (1/6371010.0)\n heights[i] = dv.getFloat32(offset, true) * 6371010.0;\n offset += sizeOfFloat;\n }\n\n const indices = new Array(numIndices);\n for (i = 0; i < numIndices; ++i) {\n indices[i] = dv.getUint16(offset, true);\n offset += sizeOfUint16;\n }\n\n for (i = 0; i < numIndices; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n const u0 = uBuffer[i0];\n const u1 = uBuffer[i1];\n const u2 = uBuffer[i2];\n\n const v0 = vBuffer[i0];\n const v1 = vBuffer[i1];\n const v2 = vBuffer[i2];\n\n const barycentric = Intersections2D.computeBarycentricCoordinates(\n u,\n v,\n u0,\n v0,\n u1,\n v1,\n u2,\n v2,\n barycentricCoordinateScratch\n );\n if (\n barycentric.x >= -1e-15 &&\n barycentric.y >= -1e-15 &&\n barycentric.z >= -1e-15\n ) {\n return (\n barycentric.x * heights[i0] +\n barycentric.y * heights[i1] +\n barycentric.z * heights[i2]\n );\n }\n }\n\n // Position does not lie in any triangle in this mesh.\n return undefined;\n}\nexport default GoogleEarthEnterpriseTerrainData;\n", "import Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport GoogleEarthEnterpriseMetadata from \"./GoogleEarthEnterpriseMetadata.js\";\nimport GoogleEarthEnterpriseTerrainData from \"./GoogleEarthEnterpriseTerrainData.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Request from \"./Request.js\";\nimport RequestState from \"./RequestState.js\";\nimport RequestType from \"./RequestType.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TaskProcessor from \"./TaskProcessor.js\";\nimport TileProviderError from \"./TileProviderError.js\";\n\nconst TerrainState = {\n UNKNOWN: 0,\n NONE: 1,\n SELF: 2,\n PARENT: 3,\n};\n\nconst julianDateScratch = new JulianDate();\n\nfunction TerrainCache() {\n this._terrainCache = {};\n this._lastTidy = JulianDate.now();\n}\n\nTerrainCache.prototype.add = function (quadKey, buffer) {\n this._terrainCache[quadKey] = {\n buffer: buffer,\n timestamp: JulianDate.now(),\n };\n};\n\nTerrainCache.prototype.get = function (quadKey) {\n const terrainCache = this._terrainCache;\n const result = terrainCache[quadKey];\n if (defined(result)) {\n delete this._terrainCache[quadKey];\n return result.buffer;\n }\n};\n\nTerrainCache.prototype.tidy = function () {\n JulianDate.now(julianDateScratch);\n if (JulianDate.secondsDifference(julianDateScratch, this._lastTidy) > 10) {\n const terrainCache = this._terrainCache;\n const keys = Object.keys(terrainCache);\n const count = keys.length;\n for (let i = 0; i < count; ++i) {\n const k = keys[i];\n const e = terrainCache[k];\n if (JulianDate.secondsDifference(julianDateScratch, e.timestamp) > 10) {\n delete terrainCache[k];\n }\n }\n\n JulianDate.clone(julianDateScratch, this._lastTidy);\n }\n};\n\n/**\n * Provides tiled terrain using the Google Earth Enterprise REST API.\n *\n * @alias GoogleEarthEnterpriseTerrainProvider\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String} options.url The url of the Google Earth Enterprise server hosting the imagery.\n * @param {GoogleEarthEnterpriseMetadata} options.metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.\n * @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n *\n * @see GoogleEarthEnterpriseImageryProvider\n * @see CesiumTerrainProvider\n *\n * @example\n * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.example.com');\n * const gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({\n * metadata : geeMetadata\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseTerrainProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let metadata;\n if (defined(options.metadata)) {\n metadata = options.metadata;\n } else {\n const resource = Resource.createIfNeeded(options.url);\n metadata = new GoogleEarthEnterpriseMetadata(resource);\n }\n\n this._metadata = metadata;\n this._tilingScheme = new GeographicTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 2,\n rectangle: new Rectangle(\n -CesiumMath.PI,\n -CesiumMath.PI,\n CesiumMath.PI,\n CesiumMath.PI\n ),\n ellipsoid: options.ellipsoid,\n });\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n // Pulled from Google's documentation\n this._levelZeroMaximumGeometricError = 40075.16;\n\n this._terrainCache = new TerrainCache();\n this._terrainPromises = {};\n this._terrainRequests = {};\n\n this._errorEvent = new Event();\n\n this._ready = false;\n const that = this;\n let metadataError;\n this._readyPromise = metadata.readyPromise\n .then(function (result) {\n if (!metadata.terrainPresent) {\n const e = new RuntimeError(\n `The server ${metadata.url} doesn't have terrain`\n );\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n e.message,\n undefined,\n undefined,\n undefined,\n e\n );\n return Promise.reject(e);\n }\n\n TileProviderError.reportSuccess(metadataError);\n that._ready = result;\n return result;\n })\n .catch(function (e) {\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n e.message,\n undefined,\n undefined,\n undefined,\n e\n );\n return Promise.reject(e);\n });\n}\n\nObject.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {\n /**\n * Gets the name of the Google Earth Enterprise server url hosting the imagery.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._metadata.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._metadata.proxy;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available.\n * @memberof GoogleEarthEnterpriseTerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: function () {\n return undefined;\n },\n },\n});\n\nconst taskProcessor = new TaskProcessor(\"decodeGoogleEarthEnterprisePacket\");\n\n// If the tile has its own terrain, then you can just use its child bitmask. If it was requested using it's parent\n// then you need to check all of its children to see if they have terrain.\nfunction computeChildMask(quadKey, info, metadata) {\n let childMask = info.getChildBitmask();\n if (info.terrainState === TerrainState.PARENT) {\n childMask = 0;\n for (let i = 0; i < 4; ++i) {\n const child = metadata.getTileInformationFromQuadKey(\n quadKey + i.toString()\n );\n if (defined(child) && child.hasTerrain()) {\n childMask |= 1 << i;\n }\n }\n }\n\n return childMask;\n}\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and\n * may optionally include a water mask and an indication of which child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n *\n * @exception {DeveloperError} This function must not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready}\n * returns true.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n const terrainCache = this._terrainCache;\n const metadata = this._metadata;\n const info = metadata.getTileInformationFromQuadKey(quadKey);\n\n // Check if this tile is even possibly available\n if (!defined(info)) {\n return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n }\n\n let terrainState = info.terrainState;\n if (!defined(terrainState)) {\n // First time we have tried to load this tile, so set terrain state to UNKNOWN\n terrainState = info.terrainState = TerrainState.UNKNOWN;\n }\n\n // If its in the cache, return it\n const buffer = terrainCache.get(quadKey);\n if (defined(buffer)) {\n const credit = metadata.providers[info.terrainProvider];\n return Promise.resolve(\n new GoogleEarthEnterpriseTerrainData({\n buffer: buffer,\n childTileMask: computeChildMask(quadKey, info, metadata),\n credits: defined(credit) ? [credit] : undefined,\n negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,\n negativeElevationThreshold: metadata.negativeAltitudeThreshold,\n })\n );\n }\n\n // Clean up the cache\n terrainCache.tidy();\n\n // We have a tile, check to see if no ancestors have terrain or that we know for sure it doesn't\n if (!info.ancestorHasTerrain) {\n // We haven't reached a level with terrain, so return the ellipsoid\n return Promise.resolve(\n new HeightmapTerrainData({\n buffer: new Uint8Array(16 * 16),\n width: 16,\n height: 16,\n })\n );\n } else if (terrainState === TerrainState.NONE) {\n // Already have info and there isn't any terrain here\n return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n }\n\n // Figure out where we are getting the terrain and what version\n let parentInfo;\n let q = quadKey;\n let terrainVersion = -1;\n switch (terrainState) {\n case TerrainState.SELF: // We have terrain and have retrieved it before\n terrainVersion = info.terrainVersion;\n break;\n case TerrainState.PARENT: // We have terrain in our parent\n q = q.substring(0, q.length - 1);\n parentInfo = metadata.getTileInformationFromQuadKey(q);\n terrainVersion = parentInfo.terrainVersion;\n break;\n case TerrainState.UNKNOWN: // We haven't tried to retrieve terrain yet\n if (info.hasTerrain()) {\n terrainVersion = info.terrainVersion; // We should have terrain\n } else {\n q = q.substring(0, q.length - 1);\n parentInfo = metadata.getTileInformationFromQuadKey(q);\n if (defined(parentInfo) && parentInfo.hasTerrain()) {\n terrainVersion = parentInfo.terrainVersion; // Try checking in the parent\n }\n }\n break;\n }\n\n // We can't figure out where to get the terrain\n if (terrainVersion < 0) {\n return Promise.reject(new RuntimeError(\"Terrain tile doesn't exist\"));\n }\n\n // Load that terrain\n const terrainPromises = this._terrainPromises;\n const terrainRequests = this._terrainRequests;\n let sharedPromise;\n let sharedRequest;\n if (defined(terrainPromises[q])) {\n // Already being loaded possibly from another child, so return existing promise\n sharedPromise = terrainPromises[q];\n sharedRequest = terrainRequests[q];\n } else {\n // Create new request for terrain\n sharedRequest = request;\n const requestPromise = buildTerrainResource(\n this,\n q,\n terrainVersion,\n sharedRequest\n ).fetchArrayBuffer();\n\n if (!defined(requestPromise)) {\n return undefined; // Throttled\n }\n\n sharedPromise = requestPromise.then(function (terrain) {\n if (defined(terrain)) {\n return taskProcessor\n .scheduleTask(\n {\n buffer: terrain,\n type: \"Terrain\",\n key: metadata.key,\n },\n [terrain]\n )\n .then(function (terrainTiles) {\n // Add requested tile and mark it as SELF\n const requestedInfo = metadata.getTileInformationFromQuadKey(q);\n requestedInfo.terrainState = TerrainState.SELF;\n terrainCache.add(q, terrainTiles[0]);\n const provider = requestedInfo.terrainProvider;\n\n // Add children to cache\n const count = terrainTiles.length - 1;\n for (let j = 0; j < count; ++j) {\n const childKey = q + j.toString();\n const child = metadata.getTileInformationFromQuadKey(childKey);\n if (defined(child)) {\n terrainCache.add(childKey, terrainTiles[j + 1]);\n child.terrainState = TerrainState.PARENT;\n if (child.terrainProvider === 0) {\n child.terrainProvider = provider;\n }\n }\n }\n });\n }\n\n return Promise.reject(new RuntimeError(\"Failed to load terrain.\"));\n });\n\n terrainPromises[q] = sharedPromise; // Store promise without delete from terrainPromises\n terrainRequests[q] = sharedRequest;\n\n // Set promise so we remove from terrainPromises just one time\n sharedPromise = sharedPromise.finally(function () {\n delete terrainPromises[q];\n delete terrainRequests[q];\n });\n }\n\n return sharedPromise\n .then(function () {\n const buffer = terrainCache.get(quadKey);\n if (defined(buffer)) {\n const credit = metadata.providers[info.terrainProvider];\n return new GoogleEarthEnterpriseTerrainData({\n buffer: buffer,\n childTileMask: computeChildMask(quadKey, info, metadata),\n credits: defined(credit) ? [credit] : undefined,\n negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,\n negativeElevationThreshold: metadata.negativeAltitudeThreshold,\n });\n }\n\n return Promise.reject(new RuntimeError(\"Failed to load terrain.\"));\n })\n .catch(function (error) {\n if (sharedRequest.state === RequestState.CANCELLED) {\n request.state = sharedRequest.state;\n return Promise.reject(error);\n }\n info.terrainState = TerrainState.NONE;\n return Promise.reject(error);\n });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._levelZeroMaximumGeometricError / (1 << level);\n};\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function (\n x,\n y,\n level\n) {\n const metadata = this._metadata;\n let quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n\n const info = metadata.getTileInformation(x, y, level);\n if (info === null) {\n return false;\n }\n\n if (defined(info)) {\n if (!info.ancestorHasTerrain) {\n return true; // We'll just return the ellipsoid\n }\n\n const terrainState = info.terrainState;\n if (terrainState === TerrainState.NONE) {\n return false; // Terrain is not available\n }\n\n if (!defined(terrainState) || terrainState === TerrainState.UNKNOWN) {\n info.terrainState = TerrainState.UNKNOWN;\n if (!info.hasTerrain()) {\n quadKey = quadKey.substring(0, quadKey.length - 1);\n const parentInfo = metadata.getTileInformationFromQuadKey(quadKey);\n if (!defined(parentInfo) || !parentInfo.hasTerrain()) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n if (metadata.isValid(quadKey)) {\n // We will need this tile, so request metadata and return false for now\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.TERRAIN,\n });\n metadata.populateSubtree(x, y, level, request);\n }\n return false;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined}\n */\nGoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n//\n// Functions to handle imagery packets\n//\nfunction buildTerrainResource(terrainProvider, quadKey, version, request) {\n version = defined(version) && version > 0 ? version : 1;\n return terrainProvider._metadata.resource.getDerivedResource({\n url: `flatfile?f1c-0${quadKey}-t.${version.toString()}`,\n request: request,\n });\n}\nexport default GoogleEarthEnterpriseTerrainProvider;\n", "/**\n * A structure containing the orientation data computed at a particular time. The data\n * represents the direction of the pole of rotation and the rotation about that pole.\n * <p>\n * These parameters correspond to the parameters in the Report from the IAU/IAG Working Group\n * except that they are expressed in radians.\n * </p>\n *\n * @namespace IauOrientationParameters\n *\n * @private\n */\nfunction IauOrientationParameters(\n rightAscension,\n declination,\n rotation,\n rotationRate\n) {\n /**\n * The right ascension of the north pole of the body with respect to\n * the International Celestial Reference Frame, in radians.\n * @type {Number}\n *\n * @private\n */\n this.rightAscension = rightAscension;\n\n /**\n * The declination of the north pole of the body with respect to\n * the International Celestial Reference Frame, in radians.\n * @type {Number}\n *\n * @private\n */\n this.declination = declination;\n\n /**\n * The rotation about the north pole used to align a set of axes with\n * the meridian defined by the IAU report, in radians.\n * @type {Number}\n *\n * @private\n */\n this.rotation = rotation;\n\n /**\n * The instantaneous rotation rate about the north pole, in radians per second.\n * @type {Number}\n *\n * @private\n */\n this.rotationRate = rotationRate;\n}\nexport default IauOrientationParameters;\n", "import defined from \"./defined.js\";\nimport IauOrientationParameters from \"./IauOrientationParameters.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport TimeConstants from \"./TimeConstants.js\";\n\n/**\n * This is a collection of the orientation information available for central bodies.\n * The data comes from the Report of the IAU/IAG Working Group on Cartographic\n * Coordinates and Rotational Elements: 2000.\n *\n * @namespace Iau2000Orientation\n *\n * @private\n */\nconst Iau2000Orientation = {};\n\nconst TdtMinusTai = 32.184;\nconst J2000d = 2451545.0;\n\nconst c1 = -0.0529921;\nconst c2 = -0.1059842;\nconst c3 = 13.0120009;\nconst c4 = 13.3407154;\nconst c5 = 0.9856003;\nconst c6 = 26.4057084;\nconst c7 = 13.064993;\nconst c8 = 0.3287146;\nconst c9 = 1.7484877;\nconst c10 = -0.1589763;\nconst c11 = 0.0036096;\nconst c12 = 0.1643573;\nconst c13 = 12.9590088;\nlet dateTT = new JulianDate();\n\n/**\n * Compute the orientation parameters for the Moon.\n *\n * @param {JulianDate} [date=JulianDate.now()] The date to evaluate the parameters.\n * @param {IauOrientationParameters} [result] The object onto which to store the result.\n * @returns {IauOrientationParameters} The modified result parameter or a new instance representing the orientation of the Earth's Moon.\n * @private\n */\nIau2000Orientation.ComputeMoon = function (date, result) {\n if (!defined(date)) {\n date = JulianDate.now();\n }\n\n dateTT = JulianDate.addSeconds(date, TdtMinusTai, dateTT);\n const d = JulianDate.totalDays(dateTT) - J2000d;\n const T = d / TimeConstants.DAYS_PER_JULIAN_CENTURY;\n\n const E1 = (125.045 + c1 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E2 = (250.089 + c2 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E3 = (260.008 + c3 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E4 = (176.625 + c4 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E5 = (357.529 + c5 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E6 = (311.589 + c6 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E7 = (134.963 + c7 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E8 = (276.617 + c8 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E9 = (34.226 + c9 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E10 = (15.134 + c10 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E11 = (119.743 + c11 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E12 = (239.961 + c12 * d) * CesiumMath.RADIANS_PER_DEGREE;\n const E13 = (25.053 + c13 * d) * CesiumMath.RADIANS_PER_DEGREE;\n\n const sinE1 = Math.sin(E1);\n const sinE2 = Math.sin(E2);\n const sinE3 = Math.sin(E3);\n const sinE4 = Math.sin(E4);\n const sinE5 = Math.sin(E5);\n const sinE6 = Math.sin(E6);\n const sinE7 = Math.sin(E7);\n const sinE8 = Math.sin(E8);\n const sinE9 = Math.sin(E9);\n const sinE10 = Math.sin(E10);\n const sinE11 = Math.sin(E11);\n const sinE12 = Math.sin(E12);\n const sinE13 = Math.sin(E13);\n\n const cosE1 = Math.cos(E1);\n const cosE2 = Math.cos(E2);\n const cosE3 = Math.cos(E3);\n const cosE4 = Math.cos(E4);\n const cosE5 = Math.cos(E5);\n const cosE6 = Math.cos(E6);\n const cosE7 = Math.cos(E7);\n const cosE8 = Math.cos(E8);\n const cosE9 = Math.cos(E9);\n const cosE10 = Math.cos(E10);\n const cosE11 = Math.cos(E11);\n const cosE12 = Math.cos(E12);\n const cosE13 = Math.cos(E13);\n\n const rightAscension =\n (269.9949 +\n 0.0031 * T -\n 3.8787 * sinE1 -\n 0.1204 * sinE2 +\n 0.07 * sinE3 -\n 0.0172 * sinE4 +\n 0.0072 * sinE6 -\n 0.0052 * sinE10 +\n 0.0043 * sinE13) *\n CesiumMath.RADIANS_PER_DEGREE;\n const declination =\n (66.5392 +\n 0.013 * T +\n 1.5419 * cosE1 +\n 0.0239 * cosE2 -\n 0.0278 * cosE3 +\n 0.0068 * cosE4 -\n 0.0029 * cosE6 +\n 0.0009 * cosE7 +\n 0.0008 * cosE10 -\n 0.0009 * cosE13) *\n CesiumMath.RADIANS_PER_DEGREE;\n const rotation =\n (38.3213 +\n 13.17635815 * d -\n 1.4e-12 * d * d +\n 3.561 * sinE1 +\n 0.1208 * sinE2 -\n 0.0642 * sinE3 +\n 0.0158 * sinE4 +\n 0.0252 * sinE5 -\n 0.0066 * sinE6 -\n 0.0047 * sinE7 -\n 0.0046 * sinE8 +\n 0.0028 * sinE9 +\n 0.0052 * sinE10 +\n 0.004 * sinE11 +\n 0.0019 * sinE12 -\n 0.0044 * sinE13) *\n CesiumMath.RADIANS_PER_DEGREE;\n\n const rotationRate =\n ((13.17635815 -\n 1.4e-12 * (2.0 * d) +\n 3.561 * cosE1 * c1 +\n 0.1208 * cosE2 * c2 -\n 0.0642 * cosE3 * c3 +\n 0.0158 * cosE4 * c4 +\n 0.0252 * cosE5 * c5 -\n 0.0066 * cosE6 * c6 -\n 0.0047 * cosE7 * c7 -\n 0.0046 * cosE8 * c8 +\n 0.0028 * cosE9 * c9 +\n 0.0052 * cosE10 * c10 +\n 0.004 * cosE11 * c11 +\n 0.0019 * cosE12 * c12 -\n 0.0044 * cosE13 * c13) /\n 86400.0) *\n CesiumMath.RADIANS_PER_DEGREE;\n\n if (!defined(result)) {\n result = new IauOrientationParameters();\n }\n\n result.rightAscension = rightAscension;\n result.declination = declination;\n result.rotation = rotation;\n result.rotationRate = rotationRate;\n\n return result;\n};\nexport default Iau2000Orientation;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\nimport Iau2000Orientation from \"./Iau2000Orientation.js\";\nimport JulianDate from \"./JulianDate.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport Quaternion from \"./Quaternion.js\";\n\n/**\n * The Axes representing the orientation of a Globe as represented by the data\n * from the IAU/IAG Working Group reports on rotational elements.\n * @alias IauOrientationAxes\n * @constructor\n *\n * @param {IauOrientationAxes.ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}.\n *\n * @see Iau2000Orientation\n *\n * @private\n */\nfunction IauOrientationAxes(computeFunction) {\n if (!defined(computeFunction) || typeof computeFunction !== \"function\") {\n computeFunction = Iau2000Orientation.ComputeMoon;\n }\n\n this._computeFunction = computeFunction;\n}\n\nconst xAxisScratch = new Cartesian3();\nconst yAxisScratch = new Cartesian3();\nconst zAxisScratch = new Cartesian3();\n\nfunction computeRotationMatrix(alpha, delta, result) {\n const xAxis = xAxisScratch;\n xAxis.x = Math.cos(alpha + CesiumMath.PI_OVER_TWO);\n xAxis.y = Math.sin(alpha + CesiumMath.PI_OVER_TWO);\n xAxis.z = 0.0;\n\n const cosDec = Math.cos(delta);\n\n const zAxis = zAxisScratch;\n zAxis.x = cosDec * Math.cos(alpha);\n zAxis.y = cosDec * Math.sin(alpha);\n zAxis.z = Math.sin(delta);\n\n const yAxis = Cartesian3.cross(zAxis, xAxis, yAxisScratch);\n\n if (!defined(result)) {\n result = new Matrix3();\n }\n\n result[0] = xAxis.x;\n result[1] = yAxis.x;\n result[2] = zAxis.x;\n result[3] = xAxis.y;\n result[4] = yAxis.y;\n result[5] = zAxis.y;\n result[6] = xAxis.z;\n result[7] = yAxis.z;\n result[8] = zAxis.z;\n\n return result;\n}\n\nconst rotMtxScratch = new Matrix3();\nconst quatScratch = new Quaternion();\n\n/**\n * Computes a rotation from ICRF to a Globe's Fixed axes.\n *\n * @param {JulianDate} date The date to evaluate the matrix.\n * @param {Matrix3} result The object onto which to store the result.\n * @returns {Matrix3} The modified result parameter or a new instance of the rotation from ICRF to Fixed.\n */\nIauOrientationAxes.prototype.evaluate = function (date, result) {\n if (!defined(date)) {\n date = JulianDate.now();\n }\n\n const alphaDeltaW = this._computeFunction(date);\n const precMtx = computeRotationMatrix(\n alphaDeltaW.rightAscension,\n alphaDeltaW.declination,\n result\n );\n\n const rot = CesiumMath.zeroToTwoPi(alphaDeltaW.rotation);\n const quat = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, rot, quatScratch);\n const rotMtx = Matrix3.fromQuaternion(\n Quaternion.conjugate(quat, quat),\n rotMtxScratch\n );\n\n const cbi2cbf = Matrix3.multiply(rotMtx, precMtx, precMtx);\n return cbi2cbf;\n};\n\n/**\n * A function that computes the {@link IauOrientationParameters} for a {@link JulianDate}.\n * @callback IauOrientationAxes.ComputeFunction\n * @param {JulianDate} date The date to evaluate the parameters.\n * @returns {IauOrientationParameters} The orientation parameters.\n * @private\n */\nexport default IauOrientationAxes;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * The interface for interpolation algorithms.\n *\n * @interface InterpolationAlgorithm\n *\n * @see LagrangePolynomialApproximation\n * @see LinearApproximation\n * @see HermitePolynomialApproximation\n */\nconst InterpolationAlgorithm = {};\n\n/**\n * Gets the name of this interpolation algorithm.\n * @type {String}\n */\nInterpolationAlgorithm.type = undefined;\n\n/**\n * Given the desired degree, returns the number of data points required for interpolation.\n * @function\n *\n * @param {Number} degree The desired degree of interpolation.\n * @returns {Number} The number of required data points needed for the desired degree of interpolation.\n */\nInterpolationAlgorithm.getRequiredDataPoints =\n DeveloperError.throwInstantiationError;\n\n/**\n * Performs zero order interpolation.\n * @function\n *\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number[]} [result] An existing array into which to store the result.\n *\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nInterpolationAlgorithm.interpolateOrderZero =\n DeveloperError.throwInstantiationError;\n\n/**\n * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,\n * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.\n * @function\n * @param {Number} x The independent variable for which the dependent variables will be interpolated.\n * @param {Number[]} xTable The array of independent variables to use to interpolate. The values\n * in this array must be in increasing order and the same value must not occur twice in the array.\n * @param {Number[]} yTable The array of dependent variables to use to interpolate. For a set of three\n * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.\n * @param {Number} yStride The number of dependent variable values in yTable corresponding to\n * each independent variable value in xTable.\n * @param {Number} inputOrder The number of derivatives supplied for input.\n * @param {Number} outputOrder The number of derivatives desired for output.\n * @param {Number[]} [result] An existing array into which to store the result.\n * @returns {Number[]} The array of interpolated values, or the result parameter if one was provided.\n */\nInterpolationAlgorithm.interpolate = DeveloperError.throwInstantiationError;\nexport default InterpolationAlgorithm;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defined from \"./defined.js\";\nimport GeocodeType from \"./GeocodeType.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding via a {@link https://pelias.io/|Pelias} server.\n * @alias PeliasGeocoderService\n * @constructor\n *\n * @param {Resource|String} url The endpoint to the Pelias server.\n *\n * @example\n * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({\n * url: 'https://api.geocode.earth/v1/',\n * queryParameters: {\n * api_key: '<Your geocode.earth API key>'\n * }\n * }))\n * });\n */\nfunction PeliasGeocoderService(url) {\n this._url = Resource.createIfNeeded(url);\n this._url.appendForwardSlash();\n}\n\nObject.defineProperties(PeliasGeocoderService.prototype, {\n /**\n * The Resource used to access the Pelias endpoint.\n * @type {Resource}\n * @memberof PeliasGeocoderService.prototype\n * @readonly\n */\n url: {\n get: function () {\n return this._url;\n },\n },\n});\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nPeliasGeocoderService.prototype.geocode = function (query, type) {\n const resource = this._url.getDerivedResource({\n url: type === GeocodeType.AUTOCOMPLETE ? \"autocomplete\" : \"search\",\n queryParameters: {\n text: query,\n },\n });\n\n return resource.fetchJson().then(function (results) {\n return results.features.map(function (resultObject) {\n let destination;\n const bboxDegrees = resultObject.bbox;\n\n if (defined(bboxDegrees)) {\n destination = Rectangle.fromDegrees(\n bboxDegrees[0],\n bboxDegrees[1],\n bboxDegrees[2],\n bboxDegrees[3]\n );\n } else {\n const lon = resultObject.geometry.coordinates[0];\n const lat = resultObject.geometry.coordinates[1];\n destination = Cartesian3.fromDegrees(lon, lat);\n }\n\n return {\n displayName: resultObject.properties.label,\n destination: destination,\n };\n });\n });\n};\nexport default PeliasGeocoderService;\n", "import Check from \"./Check.js\";\nimport Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Ion from \"./Ion.js\";\nimport PeliasGeocoderService from \"./PeliasGeocoderService.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding through Cesium ion.\n * @alias IonGeocoderService\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Scene} options.scene The scene\n * @param {String} [options.accessToken=Ion.defaultAccessToken] The access token to use.\n * @param {String|Resource} [options.server=Ion.defaultServer] The resource to the Cesium ion API server.\n *\n * @see Ion\n */\nfunction IonGeocoderService(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const accessToken = defaultValue(options.accessToken, Ion.defaultAccessToken);\n const server = Resource.createIfNeeded(\n defaultValue(options.server, Ion.defaultServer)\n );\n server.appendForwardSlash();\n\n const defaultTokenCredit = Ion.getDefaultTokenCredit(accessToken);\n if (defined(defaultTokenCredit)) {\n options.scene.frameState.creditDisplay.addDefaultCredit(\n Credit.clone(defaultTokenCredit)\n );\n }\n\n const searchEndpoint = server.getDerivedResource({\n url: \"v1/geocode\",\n });\n\n if (defined(accessToken)) {\n searchEndpoint.appendQueryParameters({ access_token: accessToken });\n }\n\n this._accessToken = accessToken;\n this._server = server;\n this._pelias = new PeliasGeocoderService(searchEndpoint);\n}\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.\n * @returns {Promise<GeocoderService.Result[]>}\n */\nIonGeocoderService.prototype.geocode = function (query, geocodeType) {\n return this._pelias.geocode(query, geocodeType);\n};\nexport default IonGeocoderService;\n", "/**\n * This enumerated type is for representing keyboard modifiers. These are keys\n * that are held down in addition to other event types.\n *\n * @enum {Number}\n */\nconst KeyboardEventModifier = {\n /**\n * Represents the shift key being held down.\n *\n * @type {Number}\n * @constant\n */\n SHIFT: 0,\n\n /**\n * Represents the control key being held down.\n *\n * @type {Number}\n * @constant\n */\n CTRL: 1,\n\n /**\n * Represents the alt key being held down.\n *\n * @type {Number}\n * @constant\n */\n ALT: 2,\n};\nexport default Object.freeze(KeyboardEventModifier);\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a\n * flat map like Cesium's 2D and Columbus View modes.\n *\n * @alias MapProjection\n * @constructor\n * @abstract\n *\n * @see GeographicProjection\n * @see WebMercatorProjection\n */\nfunction MapProjection() {\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(MapProjection.prototype, {\n /**\n * Gets the {@link Ellipsoid}.\n *\n * @memberof MapProjection.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.\n *\n * @memberof MapProjection\n * @function\n *\n * @param {Cartographic} cartographic The coordinates to project.\n * @param {Cartesian3} [result] An instance into which to copy the result. If this parameter is\n * undefined, a new instance is created and returned.\n * @returns {Cartesian3} The projected coordinates. If the result parameter is not undefined, the\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\n * created and returned.\n */\nMapProjection.prototype.project = DeveloperError.throwInstantiationError;\n\n/**\n * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}\n * coordinates, in radians.\n *\n * @memberof MapProjection\n * @function\n *\n * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.\n * @param {Cartographic} [result] An instance into which to copy the result. If this parameter is\n * undefined, a new instance is created and returned.\n * @returns {Cartographic} The unprojected coordinates. If the result parameter is not undefined, the\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\n * created and returned.\n */\nMapProjection.prototype.unproject = DeveloperError.throwInstantiationError;\nexport default MapProjection;\n", "import defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\n\nconst leftScratchArray = [];\nconst rightScratchArray = [];\n\nfunction merge(array, compare, userDefinedObject, start, middle, end) {\n const leftLength = middle - start + 1;\n const rightLength = end - middle;\n\n const left = leftScratchArray;\n const right = rightScratchArray;\n\n let i;\n let j;\n\n for (i = 0; i < leftLength; ++i) {\n left[i] = array[start + i];\n }\n\n for (j = 0; j < rightLength; ++j) {\n right[j] = array[middle + j + 1];\n }\n\n i = 0;\n j = 0;\n for (let k = start; k <= end; ++k) {\n const leftElement = left[i];\n const rightElement = right[j];\n if (\n i < leftLength &&\n (j >= rightLength ||\n compare(leftElement, rightElement, userDefinedObject) <= 0)\n ) {\n array[k] = leftElement;\n ++i;\n } else if (j < rightLength) {\n array[k] = rightElement;\n ++j;\n }\n }\n}\n\nfunction sort(array, compare, userDefinedObject, start, end) {\n if (start >= end) {\n return;\n }\n\n const middle = Math.floor((start + end) * 0.5);\n sort(array, compare, userDefinedObject, start, middle);\n sort(array, compare, userDefinedObject, middle + 1, end);\n merge(array, compare, userDefinedObject, start, middle, end);\n}\n\n/**\n * A stable merge sort.\n *\n * @function mergeSort\n * @param {Array} array The array to sort.\n * @param {mergeSortComparator} comparator The function to use to compare elements in the array.\n * @param {*} [userDefinedObject] Any item to pass as the third parameter to <code>comparator</code>.\n *\n * @example\n * // Assume array contains BoundingSpheres in world coordinates.\n * // Sort them in ascending order of distance from the camera.\n * const position = camera.positionWC;\n * Cesium.mergeSort(array, function(a, b, position) {\n * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);\n * }, position);\n */\nfunction mergeSort(array, comparator, userDefinedObject) {\n const length = array.length;\n const scratchLength = Math.ceil(length * 0.5);\n\n // preallocate space in scratch arrays\n leftScratchArray.length = scratchLength;\n rightScratchArray.length = scratchLength;\n\n sort(array, comparator, userDefinedObject, 0, length - 1);\n\n // trim scratch arrays\n leftScratchArray.length = 0;\n rightScratchArray.length = 0;\n}\n\n/**\n * A function used to compare two items while performing a merge sort.\n * @callback mergeSortComparator\n *\n * @param {*} a An item in the array.\n * @param {*} b An item in the array.\n * @param {*} [userDefinedObject] An object that was passed to {@link mergeSort}.\n * @returns {Number} Returns a negative value if <code>a</code> is less than <code>b</code>,\n * a positive value if <code>a</code> is greater than <code>b</code>, or\n * 0 if <code>a</code> is equal to <code>b</code>.\n *\n * @example\n * function compareNumbers(a, b, userDefinedObject) {\n * return a - b;\n * }\n */\nexport default mergeSort;\n", "import Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Spline from \"./Spline.js\";\n\n/**\n * A spline that linearly interpolates over an array of weight values used by morph targets.\n *\n * @alias MorphWeightSpline\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.\n * The values are in no way connected to the clock time. They are the parameterization for the curve.\n * @param {Number[]} options.weights The array of floating-point control weights given. The weights are ordered such\n * that all weights for the targets are given in chronological order and order in which they appear in\n * the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...]\n * where i and j in w(i,j) are the time indices and target indices, respectively.\n *\n * @exception {DeveloperError} weights.length must be greater than or equal to 2.\n * @exception {DeveloperError} times.length must be a factor of weights.length.\n *\n *\n * @example\n * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];\n * const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets\n * const spline = new Cesium.WeightSpline({\n * times : times,\n * weights : weights\n * });\n *\n * const p0 = spline.evaluate(times[0]);\n *\n * @see ConstantSpline\n * @see SteppedSpline\n * @see LinearSpline\n * @see HermiteSpline\n * @see CatmullRomSpline\n * @see QuaternionSpline\n */\nfunction MorphWeightSpline(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const weights = options.weights;\n const times = options.times;\n\n this._times = times;\n this._weights = weights;\n this._count = weights.length / times.length;\n\n this._lastTimeIndex = 0;\n}\n\nObject.defineProperties(MorphWeightSpline.prototype, {\n /**\n * An array of times for the control weights.\n *\n * @memberof WeightSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n times: {\n get: function () {\n return this._times;\n },\n },\n\n /**\n * An array of floating-point array control weights.\n *\n * @memberof WeightSpline.prototype\n *\n * @type {Number[]}\n * @readonly\n */\n weights: {\n get: function () {\n return this._weights;\n },\n },\n});\n\n/**\n * Finds an index <code>i</code> in <code>times</code> such that the parameter\n * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.\n * @function\n *\n * @param {Number} time The time.\n * @returns {Number} The index for the element at the start of the interval.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nMorphWeightSpline.prototype.findTimeInterval =\n Spline.prototype.findTimeInterval;\n\n/**\n * Wraps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, wrapped around to the updated animation.\n */\nMorphWeightSpline.prototype.wrapTime = Spline.prototype.wrapTime;\n\n/**\n * Clamps the given time to the period covered by the spline.\n * @function\n *\n * @param {Number} time The time.\n * @return {Number} The time, clamped to the animation period.\n */\nMorphWeightSpline.prototype.clampTime = Spline.prototype.clampTime;\n\n/**\n * Evaluates the curve at a given time.\n *\n * @param {Number} time The time at which to evaluate the curve.\n * @param {Number[]} [result] The object onto which to store the result.\n * @returns {Number[]} The modified result parameter or a new instance of the point on the curve at the given time.\n *\n * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>\n * is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element\n * in the array <code>times</code>.\n */\nMorphWeightSpline.prototype.evaluate = function (time, result) {\n const weights = this.weights;\n const times = this.times;\n\n const i = (this._lastTimeIndex = this.findTimeInterval(\n time,\n this._lastTimeIndex\n ));\n const u = (time - times[i]) / (times[i + 1] - times[i]);\n\n if (!defined(result)) {\n result = new Array(this._count);\n }\n\n for (let j = 0; j < this._count; j++) {\n const index = i * this._count + j;\n result[j] = weights[index] * (1.0 - u) + weights[index + this._count] * u;\n }\n\n return result;\n};\nexport default MorphWeightSpline;\n", "/**\n * This enumerated type is used in determining to what extent an object, the occludee,\n * is visible during horizon culling. An occluder may fully block an occludee, in which case\n * it has no visibility, may partially block an occludee from view, or may not block it at all,\n * leading to full visibility.\n *\n * @enum {Number}\n */\nconst Visibility = {\n /**\n * Represents that no part of an object is visible.\n *\n * @type {Number}\n * @constant\n */\n NONE: -1,\n\n /**\n * Represents that part, but not all, of an object is visible\n *\n * @type {Number}\n * @constant\n */\n PARTIAL: 0,\n\n /**\n * Represents that an object is visible in its entirety.\n *\n * @type {Number}\n * @constant\n */\n FULL: 1,\n};\nexport default Object.freeze(Visibility);\n", "import BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Visibility from \"./Visibility.js\";\n\n/**\n * Creates an Occluder derived from an object's position and radius, as well as the camera position.\n * The occluder can be used to determine whether or not other objects are visible or hidden behind the\n * visible horizon defined by the occluder and camera position.\n *\n * @alias Occluder\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} cameraPosition The coordinate of the viewer/camera.\n *\n * @constructor\n *\n * @example\n * // Construct an occluder one unit away from the origin with a radius of one.\n * const cameraPosition = Cesium.Cartesian3.ZERO;\n * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);\n * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);\n */\nfunction Occluder(occluderBoundingSphere, cameraPosition) {\n this._occluderPosition = Cartesian3.clone(occluderBoundingSphere.center);\n this._occluderRadius = occluderBoundingSphere.radius;\n\n this._horizonDistance = 0.0;\n this._horizonPlaneNormal = undefined;\n this._horizonPlanePosition = undefined;\n this._cameraPosition = undefined;\n\n // cameraPosition fills in the above values\n this.cameraPosition = cameraPosition;\n}\n\nconst scratchCartesian3 = new Cartesian3();\n\nObject.defineProperties(Occluder.prototype, {\n /**\n * The position of the occluder.\n * @memberof Occluder.prototype\n * @type {Cartesian3}\n */\n position: {\n get: function () {\n return this._occluderPosition;\n },\n },\n\n /**\n * The radius of the occluder.\n * @memberof Occluder.prototype\n * @type {Number}\n */\n radius: {\n get: function () {\n return this._occluderRadius;\n },\n },\n\n /**\n * The position of the camera.\n * @memberof Occluder.prototype\n * @type {Cartesian3}\n */\n cameraPosition: {\n set: function (cameraPosition) {\n cameraPosition = Cartesian3.clone(cameraPosition, this._cameraPosition);\n\n const cameraToOccluderVec = Cartesian3.subtract(\n this._occluderPosition,\n cameraPosition,\n scratchCartesian3\n );\n let invCameraToOccluderDistance = Cartesian3.magnitudeSquared(\n cameraToOccluderVec\n );\n const occluderRadiusSqrd = this._occluderRadius * this._occluderRadius;\n\n let horizonDistance;\n let horizonPlaneNormal;\n let horizonPlanePosition;\n if (invCameraToOccluderDistance > occluderRadiusSqrd) {\n horizonDistance = Math.sqrt(\n invCameraToOccluderDistance - occluderRadiusSqrd\n );\n invCameraToOccluderDistance =\n 1.0 / Math.sqrt(invCameraToOccluderDistance);\n horizonPlaneNormal = Cartesian3.multiplyByScalar(\n cameraToOccluderVec,\n invCameraToOccluderDistance,\n scratchCartesian3\n );\n const nearPlaneDistance =\n horizonDistance * horizonDistance * invCameraToOccluderDistance;\n horizonPlanePosition = Cartesian3.add(\n cameraPosition,\n Cartesian3.multiplyByScalar(\n horizonPlaneNormal,\n nearPlaneDistance,\n scratchCartesian3\n ),\n scratchCartesian3\n );\n } else {\n horizonDistance = Number.MAX_VALUE;\n }\n\n this._horizonDistance = horizonDistance;\n this._horizonPlaneNormal = horizonPlaneNormal;\n this._horizonPlanePosition = horizonPlanePosition;\n this._cameraPosition = cameraPosition;\n },\n },\n});\n\n/**\n * Creates an occluder from a bounding sphere and the camera position.\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} cameraPosition The coordinate of the viewer/camera.\n * @param {Occluder} [result] The object onto which to store the result.\n * @returns {Occluder} The occluder derived from an object's position and radius, as well as the camera position.\n */\nOccluder.fromBoundingSphere = function (\n occluderBoundingSphere,\n cameraPosition,\n result\n) {\n if (!defined(result)) {\n return new Occluder(occluderBoundingSphere, cameraPosition);\n }\n\n Cartesian3.clone(occluderBoundingSphere.center, result._occluderPosition);\n result._occluderRadius = occluderBoundingSphere.radius;\n result.cameraPosition = cameraPosition;\n\n return result;\n};\n\nconst tempVecScratch = new Cartesian3();\n\n/**\n * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {Cartesian3} occludee The point surrounding the occludee object.\n * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);\n * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);\n * const point = new Cesium.Cartesian3(0, 0, -3);\n * occluder.isPointVisible(point); //returns true\n *\n * @see Occluder#computeVisibility\n */\nOccluder.prototype.isPointVisible = function (occludee) {\n if (this._horizonDistance !== Number.MAX_VALUE) {\n let tempVec = Cartesian3.subtract(\n occludee,\n this._occluderPosition,\n tempVecScratch\n );\n let temp = this._occluderRadius;\n temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp;\n if (temp > 0.0) {\n temp = Math.sqrt(temp) + this._horizonDistance;\n tempVec = Cartesian3.subtract(occludee, this._cameraPosition, tempVec);\n return temp * temp > Cartesian3.magnitudeSquared(tempVec);\n }\n }\n return false;\n};\n\nconst occludeePositionScratch = new Cartesian3();\n\n/**\n * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.\n *\n * @param {BoundingSphere} occludee The bounding sphere surrounding the occludee object.\n * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.\n *\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);\n * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);\n * const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);\n * occluder.isBoundingSphereVisible(bigSphere); //returns true\n *\n * @see Occluder#computeVisibility\n */\nOccluder.prototype.isBoundingSphereVisible = function (occludee) {\n const occludeePosition = Cartesian3.clone(\n occludee.center,\n occludeePositionScratch\n );\n const occludeeRadius = occludee.radius;\n\n if (this._horizonDistance !== Number.MAX_VALUE) {\n let tempVec = Cartesian3.subtract(\n occludeePosition,\n this._occluderPosition,\n tempVecScratch\n );\n let temp = this._occluderRadius - occludeeRadius;\n temp = Cartesian3.magnitudeSquared(tempVec) - temp * temp;\n if (occludeeRadius < this._occluderRadius) {\n if (temp > 0.0) {\n temp = Math.sqrt(temp) + this._horizonDistance;\n tempVec = Cartesian3.subtract(\n occludeePosition,\n this._cameraPosition,\n tempVec\n );\n return (\n temp * temp + occludeeRadius * occludeeRadius >\n Cartesian3.magnitudeSquared(tempVec)\n );\n }\n return false;\n }\n\n // Prevent against the case where the occludee radius is larger than the occluder's; since this is\n // an uncommon case, the following code should rarely execute.\n if (temp > 0.0) {\n tempVec = Cartesian3.subtract(\n occludeePosition,\n this._cameraPosition,\n tempVec\n );\n const tempVecMagnitudeSquared = Cartesian3.magnitudeSquared(tempVec);\n const occluderRadiusSquared = this._occluderRadius * this._occluderRadius;\n const occludeeRadiusSquared = occludeeRadius * occludeeRadius;\n if (\n (this._horizonDistance * this._horizonDistance +\n occluderRadiusSquared) *\n occludeeRadiusSquared >\n tempVecMagnitudeSquared * occluderRadiusSquared\n ) {\n // The occludee is close enough that the occluder cannot possible occlude the occludee\n return true;\n }\n temp = Math.sqrt(temp) + this._horizonDistance;\n return temp * temp + occludeeRadiusSquared > tempVecMagnitudeSquared;\n }\n\n // The occludee completely encompasses the occluder\n return true;\n }\n\n return false;\n};\n\nconst tempScratch = new Cartesian3();\n/**\n * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).\n *\n * @param {BoundingSphere} occludeeBS The bounding sphere of the occludee.\n * @returns {Visibility} Visibility.NONE if the occludee is not visible,\n * Visibility.PARTIAL if the occludee is partially visible, or\n * Visibility.FULL if the occludee is fully visible.\n *\n *\n * @example\n * const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);\n * const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const occluder = new Cesium.Occluder(sphere1, cameraPosition);\n * occluder.computeVisibility(sphere2); //returns Visibility.NONE\n *\n * @see Occluder#isVisible\n */\nOccluder.prototype.computeVisibility = function (occludeeBS) {\n // If the occludee radius is larger than the occluders, this will return that\n // the entire ocludee is visible, even though that may not be the case, though this should\n // not occur too often.\n const occludeePosition = Cartesian3.clone(occludeeBS.center);\n const occludeeRadius = occludeeBS.radius;\n\n if (occludeeRadius > this._occluderRadius) {\n return Visibility.FULL;\n }\n\n if (this._horizonDistance !== Number.MAX_VALUE) {\n // The camera is outside the occluder\n let tempVec = Cartesian3.subtract(\n occludeePosition,\n this._occluderPosition,\n tempScratch\n );\n let temp = this._occluderRadius - occludeeRadius;\n const occluderToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec);\n temp = occluderToOccludeeDistSqrd - temp * temp;\n if (temp > 0.0) {\n // The occludee is not completely inside the occluder\n // Check to see if the occluder completely hides the occludee\n temp = Math.sqrt(temp) + this._horizonDistance;\n tempVec = Cartesian3.subtract(\n occludeePosition,\n this._cameraPosition,\n tempVec\n );\n const cameraToOccludeeDistSqrd = Cartesian3.magnitudeSquared(tempVec);\n if (\n temp * temp + occludeeRadius * occludeeRadius <\n cameraToOccludeeDistSqrd\n ) {\n return Visibility.NONE;\n }\n\n // Check to see whether the occluder is fully or partially visible\n // when the occludee does not intersect the occluder\n temp = this._occluderRadius + occludeeRadius;\n temp = occluderToOccludeeDistSqrd - temp * temp;\n if (temp > 0.0) {\n // The occludee does not intersect the occluder.\n temp = Math.sqrt(temp) + this._horizonDistance;\n return cameraToOccludeeDistSqrd <\n temp * temp + occludeeRadius * occludeeRadius\n ? Visibility.FULL\n : Visibility.PARTIAL;\n }\n\n //Check to see if the occluder is fully or partially visible when the occludee DOES\n //intersect the occluder\n tempVec = Cartesian3.subtract(\n occludeePosition,\n this._horizonPlanePosition,\n tempVec\n );\n return Cartesian3.dot(tempVec, this._horizonPlaneNormal) > -occludeeRadius\n ? Visibility.PARTIAL\n : Visibility.FULL;\n }\n }\n return Visibility.NONE;\n};\n\nconst occludeePointScratch = new Cartesian3();\n/**\n * Computes a point that can be used as the occludee position to the visibility functions.\n * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around\n * an object that is used for visibility; however it is also possible to compute a point that if\n * seen/not seen would also indicate if an object is visible/not visible. This function is better\n * called for objects that do not move relative to the occluder and is large, such as a chunk of\n * terrain. You are better off not calling this and using the object's bounding sphere for objects\n * such as a satellite or ground vehicle.\n *\n * @param {BoundingSphere} occluderBoundingSphere The bounding sphere surrounding the occluder.\n * @param {Cartesian3} occludeePosition The point where the occludee (bounding sphere of radius 0) is located.\n * @param {Cartesian3[]} positions List of altitude points on the horizon near the surface of the occluder.\n * @returns {Object} An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>\n * which is a boolean value.\n *\n * @exception {DeveloperError} <code>positions</code> must contain at least one element.\n * @exception {DeveloperError} <code>occludeePosition</code> must have a value other than <code>occluderBoundingSphere.center</code>.\n *\n * @example\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);\n * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);\n * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);\n * const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];\n * const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);\n * const occludeePosition = tileOccluderSphere.center;\n * const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);\n */\nOccluder.computeOccludeePoint = function (\n occluderBoundingSphere,\n occludeePosition,\n positions\n) {\n const occludeePos = Cartesian3.clone(occludeePosition);\n const occluderPosition = Cartesian3.clone(occluderBoundingSphere.center);\n const occluderRadius = occluderBoundingSphere.radius;\n const numPositions = positions.length;\n\n // Compute a plane with a normal from the occluder to the occludee position.\n const occluderPlaneNormal = Cartesian3.normalize(\n Cartesian3.subtract(occludeePos, occluderPosition, occludeePointScratch),\n occludeePointScratch\n );\n const occluderPlaneD = -Cartesian3.dot(occluderPlaneNormal, occluderPosition);\n\n //For each position, determine the horizon intersection. Choose the position and intersection\n //that results in the greatest angle with the occcluder plane.\n const aRotationVector = Occluder._anyRotationVector(\n occluderPosition,\n occluderPlaneNormal,\n occluderPlaneD\n );\n let dot = Occluder._horizonToPlaneNormalDotProduct(\n occluderBoundingSphere,\n occluderPlaneNormal,\n occluderPlaneD,\n aRotationVector,\n positions[0]\n );\n if (!dot) {\n //The position is inside the mimimum radius, which is invalid\n return undefined;\n }\n let tempDot;\n for (let i = 1; i < numPositions; ++i) {\n tempDot = Occluder._horizonToPlaneNormalDotProduct(\n occluderBoundingSphere,\n occluderPlaneNormal,\n occluderPlaneD,\n aRotationVector,\n positions[i]\n );\n if (!tempDot) {\n //The position is inside the minimum radius, which is invalid\n return undefined;\n }\n if (tempDot < dot) {\n dot = tempDot;\n }\n }\n //Verify that the dot is not near 90 degress\n // eslint-disable-next-line no-loss-of-precision\n if (dot < 0.00174532836589830883577820272085) {\n return undefined;\n }\n\n const distance = occluderRadius / dot;\n return Cartesian3.add(\n occluderPosition,\n Cartesian3.multiplyByScalar(\n occluderPlaneNormal,\n distance,\n occludeePointScratch\n ),\n occludeePointScratch\n );\n};\n\nconst computeOccludeePointFromRectangleScratch = [];\n/**\n * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.\n *\n * @param {Rectangle} rectangle The rectangle used to create a bounding sphere.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.\n * @returns {Object} An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>\n * which is a boolean value.\n */\nOccluder.computeOccludeePointFromRectangle = function (rectangle, ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n const positions = Rectangle.subsample(\n rectangle,\n ellipsoid,\n 0.0,\n computeOccludeePointFromRectangleScratch\n );\n const bs = BoundingSphere.fromPoints(positions);\n\n // TODO: get correct ellipsoid center\n const ellipsoidCenter = Cartesian3.ZERO;\n if (!Cartesian3.equals(ellipsoidCenter, bs.center)) {\n return Occluder.computeOccludeePoint(\n new BoundingSphere(ellipsoidCenter, ellipsoid.minimumRadius),\n bs.center,\n positions\n );\n }\n\n return undefined;\n};\n\nconst tempVec0Scratch = new Cartesian3();\nOccluder._anyRotationVector = function (\n occluderPosition,\n occluderPlaneNormal,\n occluderPlaneD\n) {\n const tempVec0 = Cartesian3.abs(occluderPlaneNormal, tempVec0Scratch);\n let majorAxis = tempVec0.x > tempVec0.y ? 0 : 1;\n if (\n (majorAxis === 0 && tempVec0.z > tempVec0.x) ||\n (majorAxis === 1 && tempVec0.z > tempVec0.y)\n ) {\n majorAxis = 2;\n }\n const tempVec = new Cartesian3();\n let tempVec1;\n if (majorAxis === 0) {\n tempVec0.x = occluderPosition.x;\n tempVec0.y = occluderPosition.y + 1.0;\n tempVec0.z = occluderPosition.z + 1.0;\n tempVec1 = Cartesian3.UNIT_X;\n } else if (majorAxis === 1) {\n tempVec0.x = occluderPosition.x + 1.0;\n tempVec0.y = occluderPosition.y;\n tempVec0.z = occluderPosition.z + 1.0;\n tempVec1 = Cartesian3.UNIT_Y;\n } else {\n tempVec0.x = occluderPosition.x + 1.0;\n tempVec0.y = occluderPosition.y + 1.0;\n tempVec0.z = occluderPosition.z;\n tempVec1 = Cartesian3.UNIT_Z;\n }\n const u =\n (Cartesian3.dot(occluderPlaneNormal, tempVec0) + occluderPlaneD) /\n -Cartesian3.dot(occluderPlaneNormal, tempVec1);\n return Cartesian3.normalize(\n Cartesian3.subtract(\n Cartesian3.add(\n tempVec0,\n Cartesian3.multiplyByScalar(tempVec1, u, tempVec),\n tempVec0\n ),\n occluderPosition,\n tempVec0\n ),\n tempVec0\n );\n};\n\nconst posDirectionScratch = new Cartesian3();\nOccluder._rotationVector = function (\n occluderPosition,\n occluderPlaneNormal,\n occluderPlaneD,\n position,\n anyRotationVector\n) {\n //Determine the angle between the occluder plane normal and the position direction\n let positionDirection = Cartesian3.subtract(\n position,\n occluderPosition,\n posDirectionScratch\n );\n positionDirection = Cartesian3.normalize(\n positionDirection,\n positionDirection\n );\n if (\n Cartesian3.dot(occluderPlaneNormal, positionDirection) <\n // eslint-disable-next-line no-loss-of-precision\n 0.99999998476912904932780850903444\n ) {\n const crossProduct = Cartesian3.cross(\n occluderPlaneNormal,\n positionDirection,\n positionDirection\n );\n const length = Cartesian3.magnitude(crossProduct);\n if (length > CesiumMath.EPSILON13) {\n return Cartesian3.normalize(crossProduct, new Cartesian3());\n }\n }\n //The occluder plane normal and the position direction are colinear. Use any\n //vector in the occluder plane as the rotation vector\n return anyRotationVector;\n};\n\nconst posScratch1 = new Cartesian3();\nconst occluerPosScratch = new Cartesian3();\nconst posScratch2 = new Cartesian3();\nconst horizonPlanePosScratch = new Cartesian3();\nOccluder._horizonToPlaneNormalDotProduct = function (\n occluderBS,\n occluderPlaneNormal,\n occluderPlaneD,\n anyRotationVector,\n position\n) {\n const pos = Cartesian3.clone(position, posScratch1);\n const occluderPosition = Cartesian3.clone(\n occluderBS.center,\n occluerPosScratch\n );\n const occluderRadius = occluderBS.radius;\n\n //Verify that the position is outside the occluder\n let positionToOccluder = Cartesian3.subtract(\n occluderPosition,\n pos,\n posScratch2\n );\n const occluderToPositionDistanceSquared = Cartesian3.magnitudeSquared(\n positionToOccluder\n );\n const occluderRadiusSquared = occluderRadius * occluderRadius;\n if (occluderToPositionDistanceSquared < occluderRadiusSquared) {\n return false;\n }\n\n //Horizon parameters\n const horizonDistanceSquared =\n occluderToPositionDistanceSquared - occluderRadiusSquared;\n const horizonDistance = Math.sqrt(horizonDistanceSquared);\n const occluderToPositionDistance = Math.sqrt(\n occluderToPositionDistanceSquared\n );\n const invOccluderToPositionDistance = 1.0 / occluderToPositionDistance;\n const cosTheta = horizonDistance * invOccluderToPositionDistance;\n const horizonPlaneDistance = cosTheta * horizonDistance;\n positionToOccluder = Cartesian3.normalize(\n positionToOccluder,\n positionToOccluder\n );\n const horizonPlanePosition = Cartesian3.add(\n pos,\n Cartesian3.multiplyByScalar(\n positionToOccluder,\n horizonPlaneDistance,\n horizonPlanePosScratch\n ),\n horizonPlanePosScratch\n );\n const horizonCrossDistance = Math.sqrt(\n horizonDistanceSquared - horizonPlaneDistance * horizonPlaneDistance\n );\n\n //Rotate the position to occluder vector 90 degrees\n let tempVec = this._rotationVector(\n occluderPosition,\n occluderPlaneNormal,\n occluderPlaneD,\n pos,\n anyRotationVector\n );\n let horizonCrossDirection = Cartesian3.fromElements(\n tempVec.x * tempVec.x * positionToOccluder.x +\n (tempVec.x * tempVec.y - tempVec.z) * positionToOccluder.y +\n (tempVec.x * tempVec.z + tempVec.y) * positionToOccluder.z,\n (tempVec.x * tempVec.y + tempVec.z) * positionToOccluder.x +\n tempVec.y * tempVec.y * positionToOccluder.y +\n (tempVec.y * tempVec.z - tempVec.x) * positionToOccluder.z,\n (tempVec.x * tempVec.z - tempVec.y) * positionToOccluder.x +\n (tempVec.y * tempVec.z + tempVec.x) * positionToOccluder.y +\n tempVec.z * tempVec.z * positionToOccluder.z,\n posScratch1\n );\n horizonCrossDirection = Cartesian3.normalize(\n horizonCrossDirection,\n horizonCrossDirection\n );\n\n //Horizon positions\n const offset = Cartesian3.multiplyByScalar(\n horizonCrossDirection,\n horizonCrossDistance,\n posScratch1\n );\n tempVec = Cartesian3.normalize(\n Cartesian3.subtract(\n Cartesian3.add(horizonPlanePosition, offset, posScratch2),\n occluderPosition,\n posScratch2\n ),\n posScratch2\n );\n const dot0 = Cartesian3.dot(occluderPlaneNormal, tempVec);\n tempVec = Cartesian3.normalize(\n Cartesian3.subtract(\n Cartesian3.subtract(horizonPlanePosition, offset, tempVec),\n occluderPosition,\n tempVec\n ),\n tempVec\n );\n const dot1 = Cartesian3.dot(occluderPlaneNormal, tempVec);\n return dot0 < dot1 ? dot0 : dot1;\n};\nexport default Occluder;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport combine from \"./combine.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\n\n/**\n * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.\n * @alias OpenCageGeocoderService\n * @constructor\n *\n * @param {Resource|String} url The endpoint to the OpenCage server.\n * @param {String} apiKey The OpenCage API Key.\n * @param {Object} [params] An object with the following properties (See https://opencagedata.com/api#forward-opt):\n * @param {Number} [params.abbrv] When set to 1 we attempt to abbreviate and shorten the formatted string we return.\n * @param {Number} [options.add_request] When set to 1 the various request parameters are added to the response for ease of debugging.\n * @param {String} [options.bounds] Provides the geocoder with a hint to the region that the query resides in.\n * @param {String} [options.countrycode] Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).\n * @param {String} [options.jsonp] Wraps the returned JSON with a function name.\n * @param {String} [options.language] An IETF format language code.\n * @param {Number} [options.limit] The maximum number of results we should return.\n * @param {Number} [options.min_confidence] An integer from 1-10. Only results with at least this confidence will be returned.\n * @param {Number} [options.no_annotations] When set to 1 results will not contain annotations.\n * @param {Number} [options.no_dedupe] When set to 1 results will not be deduplicated.\n * @param {Number} [options.no_record] When set to 1 the query contents are not logged.\n * @param {Number} [options.pretty] When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.\n * @param {String} [options.proximity] Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870).\n *\n * @example\n * // Configure a Viewer to use the OpenCage Geocoder\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')\n * });\n */\nfunction OpenCageGeocoderService(url, apiKey, params) {\n url = Resource.createIfNeeded(url);\n url.appendForwardSlash();\n url.setQueryParameters({ key: apiKey });\n this._url = url;\n this._params = defaultValue(params, {});\n}\n\nObject.defineProperties(OpenCageGeocoderService.prototype, {\n /**\n * The Resource used to access the OpenCage endpoint.\n * @type {Resource}\n * @memberof OpenCageGeocoderService.prototype\n * @readonly\n */\n url: {\n get: function () {\n return this._url;\n },\n },\n /**\n * Optional params passed to OpenCage in order to customize geocoding\n * @type {Object}\n * @memberof OpenCageGeocoderService.prototype\n * @readonly\n */\n params: {\n get: function () {\n return this._params;\n },\n },\n});\n\n/**\n * @function\n *\n * @param {String} query The query to be sent to the geocoder service\n * @returns {Promise<GeocoderService.Result[]>}\n */\nOpenCageGeocoderService.prototype.geocode = function (query) {\n const resource = this._url.getDerivedResource({\n url: \"json\",\n queryParameters: combine(this._params, { q: query }),\n });\n return resource.fetchJson().then(function (response) {\n return response.results.map(function (resultObject) {\n let destination;\n const bounds = resultObject.bounds;\n\n if (defined(bounds)) {\n destination = Rectangle.fromDegrees(\n bounds.southwest.lng,\n bounds.southwest.lat,\n bounds.northeast.lng,\n bounds.northeast.lat\n );\n } else {\n const lon = resultObject.geometry.lat;\n const lat = resultObject.geometry.lng;\n destination = Cartesian3.fromDegrees(lon, lat);\n }\n\n return {\n displayName: resultObject.formatted,\n destination: destination,\n };\n });\n });\n};\nexport default OpenCageGeocoderService;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Static interface for types which can store their values as packed\n * elements in an array. These methods and properties are expected to be\n * defined on a constructor function.\n *\n * @interface Packable\n *\n * @see PackableForInterpolation\n */\nconst Packable = {\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n packedLength: undefined,\n\n /**\n * Stores the provided instance into the provided array.\n * @function\n *\n * @param {*} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n */\n pack: DeveloperError.throwInstantiationError,\n\n /**\n * Retrieves an instance from a packed array.\n * @function\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {Object} [result] The object into which to store the result.\n * @returns {Object} The modified result parameter or a new Object instance if one was not provided.\n */\n unpack: DeveloperError.throwInstantiationError,\n};\nexport default Packable;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Static interface for {@link Packable} types which are interpolated in a\n * different representation than their packed value. These methods and\n * properties are expected to be defined on a constructor function.\n *\n * @namespace PackableForInterpolation\n *\n * @see Packable\n */\nconst PackableForInterpolation = {\n /**\n * The number of elements used to store the object into an array in its interpolatable form.\n * @type {Number}\n */\n packedInterpolationLength: undefined,\n\n /**\n * Converts a packed array into a form suitable for interpolation.\n * @function\n *\n * @param {Number[]} packedArray The packed array.\n * @param {Number} [startingIndex=0] The index of the first element to be converted.\n * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted.\n * @param {Number[]} [result] The object into which to store the result.\n */\n convertPackedArrayForInterpolation: DeveloperError.throwInstantiationError,\n\n /**\n * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.\n * @function\n *\n * @param {Number[]} array The array previously packed for interpolation.\n * @param {Number[]} sourceArray The original packed array.\n * @param {Number} [startingIndex=0] The startingIndex used to convert the array.\n * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\n * @param {Object} [result] The object into which to store the result.\n * @returns {Object} The modified result parameter or a new Object instance if one was not provided.\n */\n unpackInterpolationResult: DeveloperError.throwInstantiationError,\n};\nexport default PackableForInterpolation;\n", "import barycentricCoordinates from \"./barycentricCoordinates.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defined from \"./defined.js\";\n\nconst scratchBarycentricCoords = new Cartesian3();\n\n/**\n * Determines if a point is inside a triangle.\n *\n * @function pointInsideTriangle\n *\n * @param {Cartesian2|Cartesian3} point The point to test.\n * @param {Cartesian2|Cartesian3} p0 The first point of the triangle.\n * @param {Cartesian2|Cartesian3} p1 The second point of the triangle.\n * @param {Cartesian2|Cartesian3} p2 The third point of the triangle.\n * @returns {Boolean} <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.\n *\n * @example\n * // Returns true\n * const p = new Cesium.Cartesian2(0.25, 0.25);\n * const b = Cesium.pointInsideTriangle(p,\n * new Cesium.Cartesian2(0.0, 0.0),\n * new Cesium.Cartesian2(1.0, 0.0),\n * new Cesium.Cartesian2(0.0, 1.0));\n */\nfunction pointInsideTriangle(point, p0, p1, p2) {\n const coords = barycentricCoordinates(\n point,\n p0,\n p1,\n p2,\n scratchBarycentricCoords\n );\n if (!defined(coords)) {\n return false;\n }\n return coords.x > 0.0 && coords.y > 0.0 && coords.z > 0;\n}\nexport default pointInsideTriangle;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Base class for proxying requested made by {@link Resource}.\n *\n * @alias Proxy\n * @constructor\n *\n * @see DefaultProxy\n */\nfunction Proxy() {\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Get the final URL to use to request a given resource.\n *\n * @param {String} resource The resource to request.\n * @returns {String} proxied resource\n * @function\n */\nProxy.prototype.getURL = DeveloperError.throwInstantiationError;\n\nexport default Proxy;\n", "import defined from \"./defined.js\";\nimport deprecationWarning from \"./deprecationWarning.js\";\nimport getTimestamp from \"./getTimestamp.js\";\n\nlet implementation;\nif (typeof requestAnimationFrame !== \"undefined\") {\n implementation = requestAnimationFrame;\n}\n\n(function () {\n // look for vendor prefixed function\n if (!defined(implementation) && typeof window !== \"undefined\") {\n const vendors = [\"webkit\", \"moz\", \"ms\", \"o\"];\n let i = 0;\n const len = vendors.length;\n while (i < len && !defined(implementation)) {\n implementation = window[`${vendors[i]}RequestAnimationFrame`];\n ++i;\n }\n }\n\n // build an implementation based on setTimeout\n if (!defined(implementation)) {\n const msPerFrame = 1000.0 / 60.0;\n let lastFrameTime = 0;\n implementation = function (callback) {\n const currentTime = getTimestamp();\n\n // schedule the callback to target 60fps, 16.7ms per frame,\n // accounting for the time taken by the callback\n const delay = Math.max(msPerFrame - (currentTime - lastFrameTime), 0);\n lastFrameTime = currentTime + delay;\n\n return setTimeout(function () {\n callback(lastFrameTime);\n }, delay);\n };\n }\n})();\n\n/**\n * A browser-independent function to request a new animation frame. This is used to create\n * an application's draw loop as shown in the example below.\n *\n * @function requestAnimationFrame\n *\n * @param {requestAnimationFrameCallback} callback The function to call when the next frame should be drawn.\n * @returns {Number} An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.\n *\n *\n * @example\n * // Create a draw loop using requestAnimationFrame. The\n * // tick callback function is called for every animation frame.\n * function tick() {\n * scene.render();\n * Cesium.requestAnimationFrame(tick);\n * }\n * tick();\n *\n * @see {@link https://www.w3.org/TR/html51/webappapis.html#animation-frames|The Web API Animation Frames interface}\n *\n * @deprecated\n */\nfunction requestAnimationFramePolyFill(callback) {\n // we need this extra wrapper function because the native requestAnimationFrame\n // functions must be invoked on the global scope (window), which is not the case\n // if invoked as Cesium.requestAnimationFrame(callback)\n\n deprecationWarning(\n \"Cesium.requestAnimationFrame\",\n \"Cesium.requestAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native requestAnimationFrame method instead.\"\n );\n\n return implementation(callback);\n}\n\n/**\n * A function that will be called when the next frame should be drawn.\n * @callback requestAnimationFrameCallback\n *\n * @param {Number} timestamp A timestamp for the frame, in milliseconds.\n */\nexport default requestAnimationFramePolyFill;\n", "/**\n * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.\n *\n * @enum {Number}\n */\nconst ScreenSpaceEventType = {\n /**\n * Represents a mouse left button down event.\n *\n * @type {Number}\n * @constant\n */\n LEFT_DOWN: 0,\n\n /**\n * Represents a mouse left button up event.\n *\n * @type {Number}\n * @constant\n */\n LEFT_UP: 1,\n\n /**\n * Represents a mouse left click event.\n *\n * @type {Number}\n * @constant\n */\n LEFT_CLICK: 2,\n\n /**\n * Represents a mouse left double click event.\n *\n * @type {Number}\n * @constant\n */\n LEFT_DOUBLE_CLICK: 3,\n\n /**\n * Represents a mouse left button down event.\n *\n * @type {Number}\n * @constant\n */\n RIGHT_DOWN: 5,\n\n /**\n * Represents a mouse right button up event.\n *\n * @type {Number}\n * @constant\n */\n RIGHT_UP: 6,\n\n /**\n * Represents a mouse right click event.\n *\n * @type {Number}\n * @constant\n */\n RIGHT_CLICK: 7,\n\n /**\n * Represents a mouse middle button down event.\n *\n * @type {Number}\n * @constant\n */\n MIDDLE_DOWN: 10,\n\n /**\n * Represents a mouse middle button up event.\n *\n * @type {Number}\n * @constant\n */\n MIDDLE_UP: 11,\n\n /**\n * Represents a mouse middle click event.\n *\n * @type {Number}\n * @constant\n */\n MIDDLE_CLICK: 12,\n\n /**\n * Represents a mouse move event.\n *\n * @type {Number}\n * @constant\n */\n MOUSE_MOVE: 15,\n\n /**\n * Represents a mouse wheel event.\n *\n * @type {Number}\n * @constant\n */\n WHEEL: 16,\n\n /**\n * Represents the start of a two-finger event on a touch surface.\n *\n * @type {Number}\n * @constant\n */\n PINCH_START: 17,\n\n /**\n * Represents the end of a two-finger event on a touch surface.\n *\n * @type {Number}\n * @constant\n */\n PINCH_END: 18,\n\n /**\n * Represents a change of a two-finger event on a touch surface.\n *\n * @type {Number}\n * @constant\n */\n PINCH_MOVE: 19,\n};\nexport default Object.freeze(ScreenSpaceEventType);\n", "import AssociativeArray from \"./AssociativeArray.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport FeatureDetection from \"./FeatureDetection.js\";\nimport getTimestamp from \"./getTimestamp.js\";\nimport KeyboardEventModifier from \"./KeyboardEventModifier.js\";\nimport ScreenSpaceEventType from \"./ScreenSpaceEventType.js\";\n\nfunction getPosition(screenSpaceEventHandler, event, result) {\n const element = screenSpaceEventHandler._element;\n if (element === document) {\n result.x = event.clientX;\n result.y = event.clientY;\n return result;\n }\n\n const rect = element.getBoundingClientRect();\n result.x = event.clientX - rect.left;\n result.y = event.clientY - rect.top;\n return result;\n}\n\nfunction getInputEventKey(type, modifier) {\n let key = type;\n if (defined(modifier)) {\n key += `+${modifier}`;\n }\n return key;\n}\n\nfunction getModifier(event) {\n if (event.shiftKey) {\n return KeyboardEventModifier.SHIFT;\n } else if (event.ctrlKey) {\n return KeyboardEventModifier.CTRL;\n } else if (event.altKey) {\n return KeyboardEventModifier.ALT;\n }\n\n return undefined;\n}\n\nconst MouseButton = {\n LEFT: 0,\n MIDDLE: 1,\n RIGHT: 2,\n};\n\nfunction registerListener(screenSpaceEventHandler, domType, element, callback) {\n function listener(e) {\n callback(screenSpaceEventHandler, e);\n }\n\n if (FeatureDetection.isInternetExplorer()) {\n element.addEventListener(domType, listener, false);\n } else {\n element.addEventListener(domType, listener, {\n capture: false,\n passive: false,\n });\n }\n\n screenSpaceEventHandler._removalFunctions.push(function () {\n element.removeEventListener(domType, listener, false);\n });\n}\n\nfunction registerListeners(screenSpaceEventHandler) {\n const element = screenSpaceEventHandler._element;\n\n // some listeners may be registered on the document, so we still get events even after\n // leaving the bounds of element.\n // this is affected by the existence of an undocumented disableRootEvents property on element.\n const alternateElement = !defined(element.disableRootEvents)\n ? document\n : element;\n\n if (FeatureDetection.supportsPointerEvents()) {\n registerListener(\n screenSpaceEventHandler,\n \"pointerdown\",\n element,\n handlePointerDown\n );\n registerListener(\n screenSpaceEventHandler,\n \"pointerup\",\n element,\n handlePointerUp\n );\n registerListener(\n screenSpaceEventHandler,\n \"pointermove\",\n element,\n handlePointerMove\n );\n registerListener(\n screenSpaceEventHandler,\n \"pointercancel\",\n element,\n handlePointerUp\n );\n } else {\n registerListener(\n screenSpaceEventHandler,\n \"mousedown\",\n element,\n handleMouseDown\n );\n registerListener(\n screenSpaceEventHandler,\n \"mouseup\",\n alternateElement,\n handleMouseUp\n );\n registerListener(\n screenSpaceEventHandler,\n \"mousemove\",\n alternateElement,\n handleMouseMove\n );\n registerListener(\n screenSpaceEventHandler,\n \"touchstart\",\n element,\n handleTouchStart\n );\n registerListener(\n screenSpaceEventHandler,\n \"touchend\",\n alternateElement,\n handleTouchEnd\n );\n registerListener(\n screenSpaceEventHandler,\n \"touchmove\",\n alternateElement,\n handleTouchMove\n );\n registerListener(\n screenSpaceEventHandler,\n \"touchcancel\",\n alternateElement,\n handleTouchEnd\n );\n }\n\n registerListener(\n screenSpaceEventHandler,\n \"dblclick\",\n element,\n handleDblClick\n );\n\n // detect available wheel event\n let wheelEvent;\n if (\"onwheel\" in element) {\n // spec event type\n wheelEvent = \"wheel\";\n } else if (document.onmousewheel !== undefined) {\n // legacy event type\n wheelEvent = \"mousewheel\";\n } else {\n // older Firefox\n wheelEvent = \"DOMMouseScroll\";\n }\n\n registerListener(screenSpaceEventHandler, wheelEvent, element, handleWheel);\n}\n\nfunction unregisterListeners(screenSpaceEventHandler) {\n const removalFunctions = screenSpaceEventHandler._removalFunctions;\n for (let i = 0; i < removalFunctions.length; ++i) {\n removalFunctions[i]();\n }\n}\n\nconst mouseDownEvent = {\n position: new Cartesian2(),\n};\n\nfunction gotTouchEvent(screenSpaceEventHandler) {\n screenSpaceEventHandler._lastSeenTouchEvent = getTimestamp();\n}\n\nfunction canProcessMouseEvent(screenSpaceEventHandler) {\n return (\n getTimestamp() - screenSpaceEventHandler._lastSeenTouchEvent >\n ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds\n );\n}\n\nfunction checkPixelTolerance(startPosition, endPosition, pixelTolerance) {\n const xDiff = startPosition.x - endPosition.x;\n const yDiff = startPosition.y - endPosition.y;\n const totalPixels = Math.sqrt(xDiff * xDiff + yDiff * yDiff);\n\n return totalPixels < pixelTolerance;\n}\n\nfunction handleMouseDown(screenSpaceEventHandler, event) {\n if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n return;\n }\n\n const button = event.button;\n screenSpaceEventHandler._buttonDown[button] = true;\n\n let screenSpaceEventType;\n if (button === MouseButton.LEFT) {\n screenSpaceEventType = ScreenSpaceEventType.LEFT_DOWN;\n } else if (button === MouseButton.MIDDLE) {\n screenSpaceEventType = ScreenSpaceEventType.MIDDLE_DOWN;\n } else if (button === MouseButton.RIGHT) {\n screenSpaceEventType = ScreenSpaceEventType.RIGHT_DOWN;\n } else {\n return;\n }\n\n const position = getPosition(\n screenSpaceEventHandler,\n event,\n screenSpaceEventHandler._primaryPosition\n );\n Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition);\n Cartesian2.clone(position, screenSpaceEventHandler._primaryPreviousPosition);\n\n const modifier = getModifier(event);\n\n const action = screenSpaceEventHandler.getInputAction(\n screenSpaceEventType,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(position, mouseDownEvent.position);\n\n action(mouseDownEvent);\n\n event.preventDefault();\n }\n}\n\nconst mouseUpEvent = {\n position: new Cartesian2(),\n};\nconst mouseClickEvent = {\n position: new Cartesian2(),\n};\n\nfunction cancelMouseEvent(\n screenSpaceEventHandler,\n screenSpaceEventType,\n clickScreenSpaceEventType,\n event\n) {\n const modifier = getModifier(event);\n\n const action = screenSpaceEventHandler.getInputAction(\n screenSpaceEventType,\n modifier\n );\n const clickAction = screenSpaceEventHandler.getInputAction(\n clickScreenSpaceEventType,\n modifier\n );\n\n if (defined(action) || defined(clickAction)) {\n const position = getPosition(\n screenSpaceEventHandler,\n event,\n screenSpaceEventHandler._primaryPosition\n );\n\n if (defined(action)) {\n Cartesian2.clone(position, mouseUpEvent.position);\n\n action(mouseUpEvent);\n }\n\n if (defined(clickAction)) {\n const startPosition = screenSpaceEventHandler._primaryStartPosition;\n if (\n checkPixelTolerance(\n startPosition,\n position,\n screenSpaceEventHandler._clickPixelTolerance\n )\n ) {\n Cartesian2.clone(position, mouseClickEvent.position);\n\n clickAction(mouseClickEvent);\n }\n }\n }\n}\n\nfunction handleMouseUp(screenSpaceEventHandler, event) {\n if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n return;\n }\n\n const button = event.button;\n\n if (\n button !== MouseButton.LEFT &&\n button !== MouseButton.MIDDLE &&\n button !== MouseButton.RIGHT\n ) {\n return;\n }\n\n if (screenSpaceEventHandler._buttonDown[MouseButton.LEFT]) {\n cancelMouseEvent(\n screenSpaceEventHandler,\n ScreenSpaceEventType.LEFT_UP,\n ScreenSpaceEventType.LEFT_CLICK,\n event\n );\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = false;\n }\n if (screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE]) {\n cancelMouseEvent(\n screenSpaceEventHandler,\n ScreenSpaceEventType.MIDDLE_UP,\n ScreenSpaceEventType.MIDDLE_CLICK,\n event\n );\n screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE] = false;\n }\n if (screenSpaceEventHandler._buttonDown[MouseButton.RIGHT]) {\n cancelMouseEvent(\n screenSpaceEventHandler,\n ScreenSpaceEventType.RIGHT_UP,\n ScreenSpaceEventType.RIGHT_CLICK,\n event\n );\n screenSpaceEventHandler._buttonDown[MouseButton.RIGHT] = false;\n }\n}\n\nconst mouseMoveEvent = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n};\n\nfunction handleMouseMove(screenSpaceEventHandler, event) {\n if (!canProcessMouseEvent(screenSpaceEventHandler)) {\n return;\n }\n\n const modifier = getModifier(event);\n\n const position = getPosition(\n screenSpaceEventHandler,\n event,\n screenSpaceEventHandler._primaryPosition\n );\n const previousPosition = screenSpaceEventHandler._primaryPreviousPosition;\n\n const action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.MOUSE_MOVE,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(previousPosition, mouseMoveEvent.startPosition);\n Cartesian2.clone(position, mouseMoveEvent.endPosition);\n\n action(mouseMoveEvent);\n }\n\n Cartesian2.clone(position, previousPosition);\n\n if (\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT] ||\n screenSpaceEventHandler._buttonDown[MouseButton.MIDDLE] ||\n screenSpaceEventHandler._buttonDown[MouseButton.RIGHT]\n ) {\n event.preventDefault();\n }\n}\n\nconst mouseDblClickEvent = {\n position: new Cartesian2(),\n};\n\nfunction handleDblClick(screenSpaceEventHandler, event) {\n const button = event.button;\n\n let screenSpaceEventType;\n if (button === MouseButton.LEFT) {\n screenSpaceEventType = ScreenSpaceEventType.LEFT_DOUBLE_CLICK;\n } else {\n return;\n }\n\n const modifier = getModifier(event);\n\n const action = screenSpaceEventHandler.getInputAction(\n screenSpaceEventType,\n modifier\n );\n\n if (defined(action)) {\n getPosition(screenSpaceEventHandler, event, mouseDblClickEvent.position);\n\n action(mouseDblClickEvent);\n }\n}\n\nfunction handleWheel(screenSpaceEventHandler, event) {\n // currently this event exposes the delta value in terms of\n // the obsolete mousewheel event type. so, for now, we adapt the other\n // values to that scheme.\n let delta;\n\n // standard wheel event uses deltaY. sign is opposite wheelDelta.\n // deltaMode indicates what unit it is in.\n if (defined(event.deltaY)) {\n const deltaMode = event.deltaMode;\n if (deltaMode === event.DOM_DELTA_PIXEL) {\n delta = -event.deltaY;\n } else if (deltaMode === event.DOM_DELTA_LINE) {\n delta = -event.deltaY * 40;\n } else {\n // DOM_DELTA_PAGE\n delta = -event.deltaY * 120;\n }\n } else if (event.detail > 0) {\n // old Firefox versions use event.detail to count the number of clicks. The sign\n // of the integer is the direction the wheel is scrolled.\n delta = event.detail * -120;\n } else {\n delta = event.wheelDelta;\n }\n\n if (!defined(delta)) {\n return;\n }\n\n const modifier = getModifier(event);\n const action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.WHEEL,\n modifier\n );\n\n if (defined(action)) {\n action(delta);\n\n event.preventDefault();\n }\n}\n\nfunction handleTouchStart(screenSpaceEventHandler, event) {\n gotTouchEvent(screenSpaceEventHandler);\n\n const changedTouches = event.changedTouches;\n\n let i;\n const length = changedTouches.length;\n let touch;\n let identifier;\n const positions = screenSpaceEventHandler._positions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n positions.set(\n identifier,\n getPosition(screenSpaceEventHandler, touch, new Cartesian2())\n );\n }\n\n fireTouchEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n previousPositions.set(\n identifier,\n Cartesian2.clone(positions.get(identifier))\n );\n }\n}\n\nfunction handleTouchEnd(screenSpaceEventHandler, event) {\n gotTouchEvent(screenSpaceEventHandler);\n\n const changedTouches = event.changedTouches;\n\n let i;\n const length = changedTouches.length;\n let touch;\n let identifier;\n const positions = screenSpaceEventHandler._positions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n positions.remove(identifier);\n }\n\n fireTouchEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n previousPositions.remove(identifier);\n }\n}\n\nconst touchStartEvent = {\n position: new Cartesian2(),\n};\nconst touch2StartEvent = {\n position1: new Cartesian2(),\n position2: new Cartesian2(),\n};\nconst touchEndEvent = {\n position: new Cartesian2(),\n};\nconst touchClickEvent = {\n position: new Cartesian2(),\n};\nconst touchHoldEvent = {\n position: new Cartesian2(),\n};\n\nfunction fireTouchEvents(screenSpaceEventHandler, event) {\n const modifier = getModifier(event);\n const positions = screenSpaceEventHandler._positions;\n const numberOfTouches = positions.length;\n let action;\n let clickAction;\n const pinching = screenSpaceEventHandler._isPinching;\n\n if (\n numberOfTouches !== 1 &&\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT]\n ) {\n // transitioning from single touch, trigger UP and might trigger CLICK\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = false;\n\n if (defined(screenSpaceEventHandler._touchHoldTimer)) {\n clearTimeout(screenSpaceEventHandler._touchHoldTimer);\n screenSpaceEventHandler._touchHoldTimer = undefined;\n }\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.LEFT_UP,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(\n screenSpaceEventHandler._primaryPosition,\n touchEndEvent.position\n );\n\n action(touchEndEvent);\n }\n\n if (numberOfTouches === 0 && !screenSpaceEventHandler._isTouchHolding) {\n // releasing single touch, check for CLICK\n clickAction = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.LEFT_CLICK,\n modifier\n );\n\n if (defined(clickAction)) {\n const startPosition = screenSpaceEventHandler._primaryStartPosition;\n const endPosition =\n screenSpaceEventHandler._previousPositions.values[0];\n if (\n checkPixelTolerance(\n startPosition,\n endPosition,\n screenSpaceEventHandler._clickPixelTolerance\n )\n ) {\n Cartesian2.clone(\n screenSpaceEventHandler._primaryPosition,\n touchClickEvent.position\n );\n\n clickAction(touchClickEvent);\n }\n }\n }\n\n screenSpaceEventHandler._isTouchHolding = false;\n\n // Otherwise don't trigger CLICK, because we are adding more touches.\n }\n\n if (numberOfTouches === 0 && pinching) {\n // transitioning from pinch, trigger PINCH_END\n screenSpaceEventHandler._isPinching = false;\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.PINCH_END,\n modifier\n );\n\n if (defined(action)) {\n action();\n }\n }\n\n if (numberOfTouches === 1 && !pinching) {\n // transitioning to single touch, trigger DOWN\n const position = positions.values[0];\n Cartesian2.clone(position, screenSpaceEventHandler._primaryPosition);\n Cartesian2.clone(position, screenSpaceEventHandler._primaryStartPosition);\n Cartesian2.clone(\n position,\n screenSpaceEventHandler._primaryPreviousPosition\n );\n\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT] = true;\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.LEFT_DOWN,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(position, touchStartEvent.position);\n\n action(touchStartEvent);\n }\n\n screenSpaceEventHandler._touchHoldTimer = setTimeout(function () {\n if (!screenSpaceEventHandler.isDestroyed()) {\n screenSpaceEventHandler._touchHoldTimer = undefined;\n screenSpaceEventHandler._isTouchHolding = true;\n\n clickAction = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.RIGHT_CLICK,\n modifier\n );\n\n if (defined(clickAction)) {\n const startPosition = screenSpaceEventHandler._primaryStartPosition;\n const endPosition =\n screenSpaceEventHandler._previousPositions.values[0];\n if (\n checkPixelTolerance(\n startPosition,\n endPosition,\n screenSpaceEventHandler._holdPixelTolerance\n )\n ) {\n Cartesian2.clone(\n screenSpaceEventHandler._primaryPosition,\n touchHoldEvent.position\n );\n\n clickAction(touchHoldEvent);\n }\n }\n }\n }, ScreenSpaceEventHandler.touchHoldDelayMilliseconds);\n\n event.preventDefault();\n }\n\n if (numberOfTouches === 2 && !pinching) {\n // transitioning to pinch, trigger PINCH_START\n screenSpaceEventHandler._isPinching = true;\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.PINCH_START,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(positions.values[0], touch2StartEvent.position1);\n Cartesian2.clone(positions.values[1], touch2StartEvent.position2);\n\n action(touch2StartEvent);\n\n // Touch-enabled devices, in particular iOS can have many default behaviours for\n // \"pinch\" events, which can still be executed unless we prevent them here.\n event.preventDefault();\n }\n }\n}\n\nfunction handleTouchMove(screenSpaceEventHandler, event) {\n gotTouchEvent(screenSpaceEventHandler);\n\n const changedTouches = event.changedTouches;\n\n let i;\n const length = changedTouches.length;\n let touch;\n let identifier;\n const positions = screenSpaceEventHandler._positions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n const position = positions.get(identifier);\n if (defined(position)) {\n getPosition(screenSpaceEventHandler, touch, position);\n }\n }\n\n fireTouchMoveEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n\n for (i = 0; i < length; ++i) {\n touch = changedTouches[i];\n identifier = touch.identifier;\n Cartesian2.clone(\n positions.get(identifier),\n previousPositions.get(identifier)\n );\n }\n}\n\nconst touchMoveEvent = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n};\nconst touchPinchMovementEvent = {\n distance: {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n },\n angleAndHeight: {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n },\n};\n\nfunction fireTouchMoveEvents(screenSpaceEventHandler, event) {\n const modifier = getModifier(event);\n const positions = screenSpaceEventHandler._positions;\n const previousPositions = screenSpaceEventHandler._previousPositions;\n const numberOfTouches = positions.length;\n let action;\n\n if (\n numberOfTouches === 1 &&\n screenSpaceEventHandler._buttonDown[MouseButton.LEFT]\n ) {\n // moving single touch\n const position = positions.values[0];\n Cartesian2.clone(position, screenSpaceEventHandler._primaryPosition);\n\n const previousPosition = screenSpaceEventHandler._primaryPreviousPosition;\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.MOUSE_MOVE,\n modifier\n );\n\n if (defined(action)) {\n Cartesian2.clone(previousPosition, touchMoveEvent.startPosition);\n Cartesian2.clone(position, touchMoveEvent.endPosition);\n\n action(touchMoveEvent);\n }\n\n Cartesian2.clone(position, previousPosition);\n\n event.preventDefault();\n } else if (numberOfTouches === 2 && screenSpaceEventHandler._isPinching) {\n // moving pinch\n\n action = screenSpaceEventHandler.getInputAction(\n ScreenSpaceEventType.PINCH_MOVE,\n modifier\n );\n if (defined(action)) {\n const position1 = positions.values[0];\n const position2 = positions.values[1];\n const previousPosition1 = previousPositions.values[0];\n const previousPosition2 = previousPositions.values[1];\n\n const dX = position2.x - position1.x;\n const dY = position2.y - position1.y;\n const dist = Math.sqrt(dX * dX + dY * dY) * 0.25;\n\n const prevDX = previousPosition2.x - previousPosition1.x;\n const prevDY = previousPosition2.y - previousPosition1.y;\n const prevDist = Math.sqrt(prevDX * prevDX + prevDY * prevDY) * 0.25;\n\n const cY = (position2.y + position1.y) * 0.125;\n const prevCY = (previousPosition2.y + previousPosition1.y) * 0.125;\n const angle = Math.atan2(dY, dX);\n const prevAngle = Math.atan2(prevDY, prevDX);\n\n Cartesian2.fromElements(\n 0.0,\n prevDist,\n touchPinchMovementEvent.distance.startPosition\n );\n Cartesian2.fromElements(\n 0.0,\n dist,\n touchPinchMovementEvent.distance.endPosition\n );\n\n Cartesian2.fromElements(\n prevAngle,\n prevCY,\n touchPinchMovementEvent.angleAndHeight.startPosition\n );\n Cartesian2.fromElements(\n angle,\n cY,\n touchPinchMovementEvent.angleAndHeight.endPosition\n );\n\n action(touchPinchMovementEvent);\n }\n }\n}\n\nfunction handlePointerDown(screenSpaceEventHandler, event) {\n event.target.setPointerCapture(event.pointerId);\n\n if (event.pointerType === \"touch\") {\n const positions = screenSpaceEventHandler._positions;\n\n const identifier = event.pointerId;\n positions.set(\n identifier,\n getPosition(screenSpaceEventHandler, event, new Cartesian2())\n );\n\n fireTouchEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n previousPositions.set(\n identifier,\n Cartesian2.clone(positions.get(identifier))\n );\n } else {\n handleMouseDown(screenSpaceEventHandler, event);\n }\n}\n\nfunction handlePointerUp(screenSpaceEventHandler, event) {\n if (event.pointerType === \"touch\") {\n const positions = screenSpaceEventHandler._positions;\n\n const identifier = event.pointerId;\n positions.remove(identifier);\n\n fireTouchEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n previousPositions.remove(identifier);\n } else {\n handleMouseUp(screenSpaceEventHandler, event);\n }\n}\n\nfunction handlePointerMove(screenSpaceEventHandler, event) {\n if (event.pointerType === \"touch\") {\n const positions = screenSpaceEventHandler._positions;\n\n const identifier = event.pointerId;\n const position = positions.get(identifier);\n if (!defined(position)) {\n return;\n }\n\n getPosition(screenSpaceEventHandler, event, position);\n fireTouchMoveEvents(screenSpaceEventHandler, event);\n\n const previousPositions = screenSpaceEventHandler._previousPositions;\n Cartesian2.clone(\n positions.get(identifier),\n previousPositions.get(identifier)\n );\n } else {\n handleMouseMove(screenSpaceEventHandler, event);\n }\n}\n\n/**\n * @typedef {Object} ScreenSpaceEventHandler.PositionedEvent\n *\n * An Event that occurs at a single position on screen.\n *\n * @property {Cartesian2} position\n */\n\n/**\n * @callback ScreenSpaceEventHandler.PositionedEventCallback\n *\n * The callback invoked when a positioned event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.PositionedEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {Object} ScreenSpaceEventHandler.MotionEvent\n *\n * An Event that starts at one position and ends at another.\n *\n * @property {Cartesian2} startPosition\n * @property {Cartesian2} endPosition\n */\n\n/**\n * @callback ScreenSpaceEventHandler.MotionEventCallback\n *\n * The callback invoked when a motion event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.MotionEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {Object} ScreenSpaceEventHandler.TwoPointEvent\n *\n * An Event that occurs at a two positions on screen.\n *\n * @property {Cartesian2} position1\n * @property {Cartesian2} position2\n */\n\n/**\n * @callback ScreenSpaceEventHandler.TwoPointEventCallback\n *\n * The callback invoked when a two-point event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.TwoPointEvent} event The event which triggered the listener\n */\n\n/**\n * @typedef {Object} ScreenSpaceEventHandler.TwoPointMotionEvent\n *\n * An Event that starts at a two positions on screen and moves to two other positions.\n *\n * @property {Cartesian2} position1\n * @property {Cartesian2} position2\n * @property {Cartesian2} previousPosition1\n * @property {Cartesian2} previousPosition2\n */\n\n/**\n * @callback ScreenSpaceEventHandler.TwoPointMotionEventCallback\n *\n * The callback invoked when a two-point motion event triggers an event listener.\n *\n * @param {ScreenSpaceEventHandler.TwoPointMotionEvent} event The event which triggered the listener\n */\n\n/**\n * @callback ScreenSpaceEventHandler.WheelEventCallback\n *\n * The callback invoked when a mouse-wheel event triggers an event listener.\n *\n * @param {number} delta The amount that the mouse wheel moved\n */\n\n/**\n * Handles user input events. Custom functions can be added to be executed on\n * when the user enters input.\n *\n * @alias ScreenSpaceEventHandler\n *\n * @param {HTMLCanvasElement} [element=document] The element to add events to.\n *\n * @constructor\n */\nfunction ScreenSpaceEventHandler(element) {\n this._inputEvents = {};\n this._buttonDown = {\n LEFT: false,\n MIDDLE: false,\n RIGHT: false,\n };\n this._isPinching = false;\n this._isTouchHolding = false;\n this._lastSeenTouchEvent = -ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds;\n\n this._primaryStartPosition = new Cartesian2();\n this._primaryPosition = new Cartesian2();\n this._primaryPreviousPosition = new Cartesian2();\n\n this._positions = new AssociativeArray();\n this._previousPositions = new AssociativeArray();\n\n this._removalFunctions = [];\n\n this._touchHoldTimer = undefined;\n\n // TODO: Revisit when doing mobile development. May need to be configurable\n // or determined based on the platform?\n this._clickPixelTolerance = 5;\n this._holdPixelTolerance = 25;\n\n this._element = defaultValue(element, document);\n\n registerListeners(this);\n}\n\n/**\n * Set a function to be executed on an input event.\n *\n * @param {ScreenSpaceEventHandler.PositionedEventCallback|ScreenSpaceEventHandler.MotionEventCallback|ScreenSpaceEventHandler.WheelEventCallback|ScreenSpaceEventHandler.TwoPointEventCallback|ScreenSpaceEventHandler.TwoPointMotionEventCallback} action Function to be executed when the input event occurs.\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @see ScreenSpaceEventHandler#getInputAction\n * @see ScreenSpaceEventHandler#removeInputAction\n */\nScreenSpaceEventHandler.prototype.setInputAction = function (\n action,\n type,\n modifier\n) {\n const key = getInputEventKey(type, modifier);\n this._inputEvents[key] = action;\n};\n\n/**\n * Returns the function to be executed on an input event.\n *\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @returns {ScreenSpaceEventHandler.PositionedEventCallback|ScreenSpaceEventHandler.MotionEventCallback|ScreenSpaceEventHandler.WheelEventCallback|ScreenSpaceEventHandler.TwoPointEventCallback|ScreenSpaceEventHandler.TwoPointMotionEventCallback} The function to be executed on an input event.\n *\n * @see ScreenSpaceEventHandler#setInputAction\n * @see ScreenSpaceEventHandler#removeInputAction\n */\nScreenSpaceEventHandler.prototype.getInputAction = function (type, modifier) {\n const key = getInputEventKey(type, modifier);\n return this._inputEvents[key];\n};\n\n/**\n * Removes the function to be executed on an input event.\n *\n * @param {ScreenSpaceEventType} type The ScreenSpaceEventType of input event.\n * @param {KeyboardEventModifier} [modifier] A KeyboardEventModifier key that is held when a <code>type</code>\n * event occurs.\n *\n * @see ScreenSpaceEventHandler#getInputAction\n * @see ScreenSpaceEventHandler#setInputAction\n */\nScreenSpaceEventHandler.prototype.removeInputAction = function (\n type,\n modifier\n) {\n const key = getInputEventKey(type, modifier);\n delete this._inputEvents[key];\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ScreenSpaceEventHandler#destroy\n */\nScreenSpaceEventHandler.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * handler = handler && handler.destroy();\n *\n * @see ScreenSpaceEventHandler#isDestroyed\n */\nScreenSpaceEventHandler.prototype.destroy = function () {\n unregisterListeners(this);\n\n return destroyObject(this);\n};\n\n/**\n * The amount of time, in milliseconds, that mouse events will be disabled after\n * receiving any touch events, such that any emulated mouse events will be ignored.\n * @type {Number}\n * @default 800\n */\nScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds = 800;\n\n/**\n * The amount of time, in milliseconds, before a touch on the screen becomes a\n * touch and hold.\n * @type {Number}\n * @default 1500\n */\nScreenSpaceEventHandler.touchHoldDelayMilliseconds = 1500;\nexport default ScreenSpaceEventHandler;\n", "import ArcType from \"./ArcType.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Color from \"./Color.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport PolylinePipeline from \"./PolylinePipeline.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\n\nfunction interpolateColors(p0, p1, color0, color1, minDistance, array, offset) {\n const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\n let i;\n\n const r0 = color0.red;\n const g0 = color0.green;\n const b0 = color0.blue;\n const a0 = color0.alpha;\n\n const r1 = color1.red;\n const g1 = color1.green;\n const b1 = color1.blue;\n const a1 = color1.alpha;\n\n if (Color.equals(color0, color1)) {\n for (i = 0; i < numPoints; i++) {\n array[offset++] = Color.floatToByte(r0);\n array[offset++] = Color.floatToByte(g0);\n array[offset++] = Color.floatToByte(b0);\n array[offset++] = Color.floatToByte(a0);\n }\n return offset;\n }\n\n const redPerVertex = (r1 - r0) / numPoints;\n const greenPerVertex = (g1 - g0) / numPoints;\n const bluePerVertex = (b1 - b0) / numPoints;\n const alphaPerVertex = (a1 - a0) / numPoints;\n\n let index = offset;\n for (i = 0; i < numPoints; i++) {\n array[index++] = Color.floatToByte(r0 + i * redPerVertex);\n array[index++] = Color.floatToByte(g0 + i * greenPerVertex);\n array[index++] = Color.floatToByte(b0 + i * bluePerVertex);\n array[index++] = Color.floatToByte(a0 + i * alphaPerVertex);\n }\n\n return index;\n}\n\n/**\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\n * and each additional position defines a line segment from the previous position.\n *\n * @alias SimplePolylineGeometry\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\n * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\n *\n * @exception {DeveloperError} At least two positions are required.\n * @exception {DeveloperError} colors has an invalid length.\n *\n * @see SimplePolylineGeometry#createGeometry\n *\n * @example\n * // A polyline with two connected line segments\n * const polyline = new Cesium.SimplePolylineGeometry({\n * positions : Cesium.Cartesian3.fromDegreesArray([\n * 0.0, 0.0,\n * 5.0, 0.0,\n * 5.0, 5.0\n * ])\n * });\n * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);\n */\nfunction SimplePolylineGeometry(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const positions = options.positions;\n const colors = options.colors;\n const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\n\n this._positions = positions;\n this._colors = colors;\n this._colorsPerVertex = colorsPerVertex;\n\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\n this._granularity = defaultValue(\n options.granularity,\n CesiumMath.RADIANS_PER_DEGREE\n );\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n this._workerName = \"createSimplePolylineGeometry\";\n\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\n numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\n\n /**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\n this.packedLength = numComponents + Ellipsoid.packedLength + 3;\n}\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SimplePolylineGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nSimplePolylineGeometry.pack = function (value, array, startingIndex) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n const positions = value._positions;\n let length = positions.length;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n Cartesian3.pack(positions[i], array, startingIndex);\n }\n\n const colors = value._colors;\n length = defined(colors) ? colors.length : 0.0;\n array[startingIndex++] = length;\n\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n Color.pack(colors[i], array, startingIndex);\n }\n\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\n array[startingIndex++] = value._arcType;\n array[startingIndex] = value._granularity;\n\n return array;\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SimplePolylineGeometry} [result] The object into which to store the result.\n * @returns {SimplePolylineGeometry} The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.\n */\nSimplePolylineGeometry.unpack = function (array, startingIndex, result) {\n startingIndex = defaultValue(startingIndex, 0);\n\n let i;\n\n let length = array[startingIndex++];\n const positions = new Array(length);\n\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\n positions[i] = Cartesian3.unpack(array, startingIndex);\n }\n\n length = array[startingIndex++];\n const colors = length > 0 ? new Array(length) : undefined;\n\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\n colors[i] = Color.unpack(array, startingIndex);\n }\n\n const ellipsoid = Ellipsoid.unpack(array, startingIndex);\n startingIndex += Ellipsoid.packedLength;\n\n const colorsPerVertex = array[startingIndex++] === 1.0;\n const arcType = array[startingIndex++];\n const granularity = array[startingIndex];\n\n if (!defined(result)) {\n return new SimplePolylineGeometry({\n positions: positions,\n colors: colors,\n ellipsoid: ellipsoid,\n colorsPerVertex: colorsPerVertex,\n arcType: arcType,\n granularity: granularity,\n });\n }\n\n result._positions = positions;\n result._colors = colors;\n result._ellipsoid = ellipsoid;\n result._colorsPerVertex = colorsPerVertex;\n result._arcType = arcType;\n result._granularity = granularity;\n\n return result;\n};\n\nconst scratchArray1 = new Array(2);\nconst scratchArray2 = new Array(2);\nconst generateArcOptionsScratch = {\n positions: scratchArray1,\n height: scratchArray2,\n ellipsoid: undefined,\n minDistance: undefined,\n granularity: undefined,\n};\n\n/**\n * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.\n *\n * @param {SimplePolylineGeometry} simplePolylineGeometry A description of the polyline.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) {\n const positions = simplePolylineGeometry._positions;\n const colors = simplePolylineGeometry._colors;\n const colorsPerVertex = simplePolylineGeometry._colorsPerVertex;\n const arcType = simplePolylineGeometry._arcType;\n const granularity = simplePolylineGeometry._granularity;\n const ellipsoid = simplePolylineGeometry._ellipsoid;\n\n const minDistance = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n const perSegmentColors = defined(colors) && !colorsPerVertex;\n\n let i;\n const length = positions.length;\n\n let positionValues;\n let numberOfPositions;\n let colorValues;\n let color;\n let offset = 0;\n\n if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\n let subdivisionSize;\n let numberOfPointsFunction;\n let generateArcFunction;\n if (arcType === ArcType.GEODESIC) {\n subdivisionSize = CesiumMath.chordLength(\n granularity,\n ellipsoid.maximumRadius\n );\n numberOfPointsFunction = PolylinePipeline.numberOfPoints;\n generateArcFunction = PolylinePipeline.generateArc;\n } else {\n subdivisionSize = granularity;\n numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\n generateArcFunction = PolylinePipeline.generateRhumbArc;\n }\n\n const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\n\n const generateArcOptions = generateArcOptionsScratch;\n if (arcType === ArcType.GEODESIC) {\n generateArcOptions.minDistance = minDistance;\n } else {\n generateArcOptions.granularity = granularity;\n }\n generateArcOptions.ellipsoid = ellipsoid;\n\n if (perSegmentColors) {\n let positionCount = 0;\n for (i = 0; i < length - 1; i++) {\n positionCount +=\n numberOfPointsFunction(\n positions[i],\n positions[i + 1],\n subdivisionSize\n ) + 1;\n }\n\n positionValues = new Float64Array(positionCount * 3);\n colorValues = new Uint8Array(positionCount * 4);\n\n generateArcOptions.positions = scratchArray1;\n generateArcOptions.height = scratchArray2;\n\n let ci = 0;\n for (i = 0; i < length - 1; ++i) {\n scratchArray1[0] = positions[i];\n scratchArray1[1] = positions[i + 1];\n\n scratchArray2[0] = heights[i];\n scratchArray2[1] = heights[i + 1];\n\n const pos = generateArcFunction(generateArcOptions);\n\n if (defined(colors)) {\n const segLen = pos.length / 3;\n color = colors[i];\n for (let k = 0; k < segLen; ++k) {\n colorValues[ci++] = Color.floatToByte(color.red);\n colorValues[ci++] = Color.floatToByte(color.green);\n colorValues[ci++] = Color.floatToByte(color.blue);\n colorValues[ci++] = Color.floatToByte(color.alpha);\n }\n }\n\n positionValues.set(pos, offset);\n offset += pos.length;\n }\n } else {\n generateArcOptions.positions = positions;\n generateArcOptions.height = heights;\n positionValues = new Float64Array(\n generateArcFunction(generateArcOptions)\n );\n\n if (defined(colors)) {\n colorValues = new Uint8Array((positionValues.length / 3) * 4);\n\n for (i = 0; i < length - 1; ++i) {\n const p0 = positions[i];\n const p1 = positions[i + 1];\n const c0 = colors[i];\n const c1 = colors[i + 1];\n offset = interpolateColors(\n p0,\n p1,\n c0,\n c1,\n minDistance,\n colorValues,\n offset\n );\n }\n\n const lastColor = colors[length - 1];\n colorValues[offset++] = Color.floatToByte(lastColor.red);\n colorValues[offset++] = Color.floatToByte(lastColor.green);\n colorValues[offset++] = Color.floatToByte(lastColor.blue);\n colorValues[offset++] = Color.floatToByte(lastColor.alpha);\n }\n }\n } else {\n numberOfPositions = perSegmentColors ? length * 2 - 2 : length;\n positionValues = new Float64Array(numberOfPositions * 3);\n colorValues = defined(colors)\n ? new Uint8Array(numberOfPositions * 4)\n : undefined;\n\n let positionIndex = 0;\n let colorIndex = 0;\n\n for (i = 0; i < length; ++i) {\n const p = positions[i];\n\n if (perSegmentColors && i > 0) {\n Cartesian3.pack(p, positionValues, positionIndex);\n positionIndex += 3;\n\n color = colors[i - 1];\n colorValues[colorIndex++] = Color.floatToByte(color.red);\n colorValues[colorIndex++] = Color.floatToByte(color.green);\n colorValues[colorIndex++] = Color.floatToByte(color.blue);\n colorValues[colorIndex++] = Color.floatToByte(color.alpha);\n }\n\n if (perSegmentColors && i === length - 1) {\n break;\n }\n\n Cartesian3.pack(p, positionValues, positionIndex);\n positionIndex += 3;\n\n if (defined(colors)) {\n color = colors[i];\n colorValues[colorIndex++] = Color.floatToByte(color.red);\n colorValues[colorIndex++] = Color.floatToByte(color.green);\n colorValues[colorIndex++] = Color.floatToByte(color.blue);\n colorValues[colorIndex++] = Color.floatToByte(color.alpha);\n }\n }\n }\n\n const attributes = new GeometryAttributes();\n attributes.position = new GeometryAttribute({\n componentDatatype: ComponentDatatype.DOUBLE,\n componentsPerAttribute: 3,\n values: positionValues,\n });\n\n if (defined(colors)) {\n attributes.color = new GeometryAttribute({\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n componentsPerAttribute: 4,\n values: colorValues,\n normalize: true,\n });\n }\n\n numberOfPositions = positionValues.length / 3;\n const numberOfIndices = (numberOfPositions - 1) * 2;\n const indices = IndexDatatype.createTypedArray(\n numberOfPositions,\n numberOfIndices\n );\n\n let index = 0;\n for (i = 0; i < numberOfPositions - 1; ++i) {\n indices[index++] = i;\n indices[index++] = i + 1;\n }\n\n return new Geometry({\n attributes: attributes,\n indices: indices,\n primitiveType: PrimitiveType.LINES,\n boundingSphere: BoundingSphere.fromPoints(positions),\n });\n};\nexport default SimplePolylineGeometry;\n", "import Cartesian3 from \"./Cartesian3.js\";\nimport Check from \"./Check.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport EllipsoidGeometry from \"./EllipsoidGeometry.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\n/**\n * A description of a sphere centered at the origin.\n *\n * @alias SphereGeometry\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.radius=1.0] The radius of the sphere.\n * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\n * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\n *\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\n *\n * @see SphereGeometry#createGeometry\n *\n * @example\n * const sphere = new Cesium.SphereGeometry({\n * radius : 100.0,\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY\n * });\n * const geometry = Cesium.SphereGeometry.createGeometry(sphere);\n */\nfunction SphereGeometry(options) {\n const radius = defaultValue(options.radius, 1.0);\n const radii = new Cartesian3(radius, radius, radius);\n const ellipsoidOptions = {\n radii: radii,\n stackPartitions: options.stackPartitions,\n slicePartitions: options.slicePartitions,\n vertexFormat: options.vertexFormat,\n };\n\n this._ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions);\n this._workerName = \"createSphereGeometry\";\n}\n\n/**\n * The number of elements used to pack the object into an array.\n * @type {Number}\n */\nSphereGeometry.packedLength = EllipsoidGeometry.packedLength;\n\n/**\n * Stores the provided instance into the provided array.\n *\n * @param {SphereGeometry} value The value to pack.\n * @param {Number[]} array The array to pack into.\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\n *\n * @returns {Number[]} The array that was packed into\n */\nSphereGeometry.pack = function (value, array, startingIndex) {\n return EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex);\n};\n\nconst scratchEllipsoidGeometry = new EllipsoidGeometry();\nconst scratchOptions = {\n radius: undefined,\n radii: new Cartesian3(),\n vertexFormat: new VertexFormat(),\n stackPartitions: undefined,\n slicePartitions: undefined,\n};\n\n/**\n * Retrieves an instance from a packed array.\n *\n * @param {Number[]} array The packed array.\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\n * @param {SphereGeometry} [result] The object into which to store the result.\n * @returns {SphereGeometry} The modified result parameter or a new SphereGeometry instance if one was not provided.\n */\nSphereGeometry.unpack = function (array, startingIndex, result) {\n const ellipsoidGeometry = EllipsoidGeometry.unpack(\n array,\n startingIndex,\n scratchEllipsoidGeometry\n );\n scratchOptions.vertexFormat = VertexFormat.clone(\n ellipsoidGeometry._vertexFormat,\n scratchOptions.vertexFormat\n );\n scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\n scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\n\n if (!defined(result)) {\n scratchOptions.radius = ellipsoidGeometry._radii.x;\n return new SphereGeometry(scratchOptions);\n }\n\n Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\n result._ellipsoidGeometry = new EllipsoidGeometry(scratchOptions);\n return result;\n};\n\n/**\n * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.\n *\n * @param {SphereGeometry} sphereGeometry A description of the sphere.\n * @returns {Geometry|undefined} The computed vertices and indices.\n */\nSphereGeometry.createGeometry = function (sphereGeometry) {\n return EllipsoidGeometry.createGeometry(sphereGeometry._ellipsoidGeometry);\n};\nexport default SphereGeometry;\n", "/**\n * @private\n */\nconst TileEdge = {\n WEST: 0,\n NORTH: 1,\n EAST: 2,\n SOUTH: 3,\n NORTHWEST: 4,\n NORTHEAST: 5,\n SOUTHWEST: 6,\n SOUTHEAST: 7,\n};\nexport default TileEdge;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,\n * the coarsest, least-detailed level, the number of tiles is configurable.\n * At level of detail one, each of the level zero tiles has four children, two in each direction.\n * At level of detail two, each of the level one tiles has four children, two in each direction.\n * This continues for as many levels as are present in the geometry or imagery source.\n *\n * @alias TilingScheme\n * @constructor\n *\n * @see WebMercatorTilingScheme\n * @see GeographicTilingScheme\n */\nfunction TilingScheme(options) {\n}\n\nObject.defineProperties(TilingScheme.prototype, {\n /**\n * Gets the ellipsoid that is tiled by the tiling scheme.\n * @memberof TilingScheme.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the rectangle, in radians, covered by this tiling scheme.\n * @memberof TilingScheme.prototype\n * @type {Rectangle}\n */\n rectangle: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the map projection used by the tiling scheme.\n * @memberof TilingScheme.prototype\n * @type {MapProjection}\n */\n projection: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\n * @function\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the X direction at the given level.\n */\nTilingScheme.prototype.getNumberOfXTilesAtLevel =\n DeveloperError.throwInstantiationError;\n\n/**\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\n * @function\n *\n * @param {Number} level The level-of-detail.\n * @returns {Number} The number of tiles in the Y direction at the given level.\n */\nTilingScheme.prototype.getNumberOfYTilesAtLevel =\n DeveloperError.throwInstantiationError;\n\n/**\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\n * of this tiling scheme.\n * @function\n *\n * @param {Rectangle} rectangle The rectangle to transform.\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\n * is undefined.\n */\nTilingScheme.prototype.rectangleToNativeRectangle =\n DeveloperError.throwInstantiationError;\n\n/**\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\n * of the tiling scheme.\n * @function\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nTilingScheme.prototype.tileXYToNativeRectangle =\n DeveloperError.throwInstantiationError;\n\n/**\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\n * @function\n *\n * @param {Number} x The integer x coordinate of the tile.\n * @param {Number} y The integer y coordinate of the tile.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\n * if 'result' is undefined.\n */\nTilingScheme.prototype.tileXYToRectangle =\n DeveloperError.throwInstantiationError;\n\n/**\n * Calculates the tile x, y coordinates of the tile containing\n * a given cartographic position.\n * @function\n *\n * @param {Cartographic} position The position.\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\n * should be created.\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\n * if 'result' is undefined.\n */\nTilingScheme.prototype.positionToTileXY =\n DeveloperError.throwInstantiationError;\nexport default TilingScheme;\n", "import defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport destroyObject from \"./destroyObject.js\";\nimport Iso8601 from \"./Iso8601.js\";\nimport JulianDate from \"./JulianDate.js\";\n\n/**\n * Synchronizes a video element with a simulation clock.\n *\n * @alias VideoSynchronizer\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Clock} [options.clock] The clock instance used to drive the video.\n * @param {HTMLVideoElement} [options.element] The video element to be synchronized.\n * @param {JulianDate} [options.epoch=Iso8601.MINIMUM_VALUE] The simulation time that marks the start of the video.\n * @param {Number} [options.tolerance=1.0] The maximum amount of time, in seconds, that the clock and video can diverge.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Video.html|Video Material Demo}\n */\nfunction VideoSynchronizer(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._clock = undefined;\n this._element = undefined;\n this._clockSubscription = undefined;\n this._seekFunction = undefined;\n this._lastPlaybackRate = undefined;\n\n this.clock = options.clock;\n this.element = options.element;\n\n /**\n * Gets or sets the simulation time that marks the start of the video.\n * @type {JulianDate}\n * @default Iso8601.MINIMUM_VALUE\n */\n this.epoch = defaultValue(options.epoch, Iso8601.MINIMUM_VALUE);\n\n /**\n * Gets or sets the amount of time in seconds the video's currentTime\n * and the clock's currentTime can diverge before a video seek is performed.\n * Lower values make the synchronization more accurate but video\n * performance might suffer. Higher values provide better performance\n * but at the cost of accuracy.\n * @type {Number}\n * @default 1.0\n */\n this.tolerance = defaultValue(options.tolerance, 1.0);\n\n this._seeking = false;\n this._seekFunction = undefined;\n this._firstTickAfterSeek = false;\n}\n\nObject.defineProperties(VideoSynchronizer.prototype, {\n /**\n * Gets or sets the clock used to drive the video element.\n *\n * @memberof VideoSynchronizer.prototype\n * @type {Clock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n set: function (value) {\n const oldValue = this._clock;\n\n if (oldValue === value) {\n return;\n }\n\n if (defined(oldValue)) {\n this._clockSubscription();\n this._clockSubscription = undefined;\n }\n\n if (defined(value)) {\n this._clockSubscription = value.onTick.addEventListener(\n VideoSynchronizer.prototype._onTick,\n this\n );\n }\n\n this._clock = value;\n },\n },\n /**\n * Gets or sets the video element to synchronize.\n *\n * @memberof VideoSynchronizer.prototype\n * @type {HTMLVideoElement}\n */\n element: {\n get: function () {\n return this._element;\n },\n set: function (value) {\n const oldValue = this._element;\n\n if (oldValue === value) {\n return;\n }\n\n if (defined(oldValue)) {\n oldValue.removeEventListener(\"seeked\", this._seekFunction, false);\n }\n\n if (defined(value)) {\n this._seeking = false;\n this._seekFunction = createSeekFunction(this);\n value.addEventListener(\"seeked\", this._seekFunction, false);\n }\n\n this._element = value;\n this._seeking = false;\n this._firstTickAfterSeek = false;\n },\n },\n});\n\n/**\n * Destroys and resources used by the object. Once an object is destroyed, it should not be used.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nVideoSynchronizer.prototype.destroy = function () {\n this.element = undefined;\n this.clock = undefined;\n return destroyObject(this);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n */\nVideoSynchronizer.prototype.isDestroyed = function () {\n return false;\n};\n\nVideoSynchronizer.prototype._trySetPlaybackRate = function (clock) {\n if (this._lastPlaybackRate === clock.multiplier) {\n return;\n }\n\n const element = this._element;\n try {\n element.playbackRate = clock.multiplier;\n } catch (error) {\n // Seek manually for unsupported playbackRates.\n element.playbackRate = 0.0;\n }\n this._lastPlaybackRate = clock.multiplier;\n};\n\nVideoSynchronizer.prototype._onTick = function (clock) {\n const element = this._element;\n if (!defined(element) || element.readyState < 2) {\n return;\n }\n\n const paused = element.paused;\n const shouldAnimate = clock.shouldAnimate;\n if (shouldAnimate === paused) {\n if (shouldAnimate) {\n element.play();\n } else {\n element.pause();\n }\n }\n\n //We need to avoid constant seeking or the video will\n //never contain a complete frame for us to render.\n //So don't do anything if we're seeing or on the first\n //tick after a seek (the latter of which allows the frame\n //to actually be rendered.\n if (this._seeking || this._firstTickAfterSeek) {\n this._firstTickAfterSeek = false;\n return;\n }\n\n this._trySetPlaybackRate(clock);\n\n const clockTime = clock.currentTime;\n const epoch = defaultValue(this.epoch, Iso8601.MINIMUM_VALUE);\n let videoTime = JulianDate.secondsDifference(clockTime, epoch);\n\n const duration = element.duration;\n let desiredTime;\n const currentTime = element.currentTime;\n if (element.loop) {\n videoTime = videoTime % duration;\n if (videoTime < 0.0) {\n videoTime = duration - videoTime;\n }\n desiredTime = videoTime;\n } else if (videoTime > duration) {\n desiredTime = duration;\n } else if (videoTime < 0.0) {\n desiredTime = 0.0;\n } else {\n desiredTime = videoTime;\n }\n\n //If the playing video's time and the scene's clock time\n //ever drift too far apart, we want to set the video to match\n const tolerance = shouldAnimate ? defaultValue(this.tolerance, 1.0) : 0.001;\n if (Math.abs(desiredTime - currentTime) > tolerance) {\n this._seeking = true;\n element.currentTime = desiredTime;\n }\n};\n\nfunction createSeekFunction(that) {\n return function () {\n that._seeking = false;\n that._firstTickAfterSeek = true;\n };\n}\nexport default VideoSynchronizer;\n", "import Credit from \"./Credit.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport Event from \"./Event.js\";\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\nimport getImagePixels from \"./getImagePixels.js\";\nimport HeightmapTerrainData from \"./HeightmapTerrainData.js\";\nimport CesiumMath from \"./Math.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport Resource from \"./Resource.js\";\nimport RuntimeError from \"./RuntimeError.js\";\nimport TerrainProvider from \"./TerrainProvider.js\";\nimport TileProviderError from \"./TileProviderError.js\";\n\nfunction DataRectangle(rectangle, maxLevel) {\n this.rectangle = rectangle;\n this.maxLevel = maxLevel;\n}\n\n/**\n * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps\n * retrieved from a {@link http://vr-theworld.com/|VT M\u00C4K VR-TheWorld server}.\n *\n * @alias VRTheWorldTerrainProvider\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String} options.url The URL of the VR-TheWorld TileMap.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid. If this parameter is not\n * specified, the WGS84 ellipsoid is used.\n * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.\n *\n *\n * @example\n * const terrainProvider = new Cesium.VRTheWorldTerrainProvider({\n * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'\n * });\n * viewer.terrainProvider = terrainProvider;\n *\n * @see TerrainProvider\n */\nfunction VRTheWorldTerrainProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const resource = Resource.createIfNeeded(options.url);\n\n this._resource = resource;\n\n this._errorEvent = new Event();\n this._ready = false;\n\n this._terrainDataStructure = {\n heightScale: 1.0 / 1000.0,\n heightOffset: -1000.0,\n elementsPerHeight: 3,\n stride: 4,\n elementMultiplier: 256.0,\n isBigEndian: true,\n lowestEncodedHeight: 0,\n highestEncodedHeight: 256 * 256 * 256 - 1,\n };\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n this._tilingScheme = undefined;\n this._rectangles = [];\n\n const that = this;\n let metadataError;\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\n\n function metadataSuccess(xml) {\n const srs = xml.getElementsByTagName(\"SRS\")[0].textContent;\n if (srs === \"EPSG:4326\") {\n that._tilingScheme = new GeographicTilingScheme({ ellipsoid: ellipsoid });\n } else {\n return Promise.reject(new RuntimeError(`SRS ${srs} is not supported.`));\n }\n\n const tileFormat = xml.getElementsByTagName(\"TileFormat\")[0];\n that._heightmapWidth = parseInt(tileFormat.getAttribute(\"width\"), 10);\n that._heightmapHeight = parseInt(tileFormat.getAttribute(\"height\"), 10);\n that._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(\n ellipsoid,\n Math.min(that._heightmapWidth, that._heightmapHeight),\n that._tilingScheme.getNumberOfXTilesAtLevel(0)\n );\n\n const dataRectangles = xml.getElementsByTagName(\"DataExtent\");\n\n for (let i = 0; i < dataRectangles.length; ++i) {\n const dataRectangle = dataRectangles[i];\n\n const west = CesiumMath.toRadians(\n parseFloat(dataRectangle.getAttribute(\"minx\"))\n );\n const south = CesiumMath.toRadians(\n parseFloat(dataRectangle.getAttribute(\"miny\"))\n );\n const east = CesiumMath.toRadians(\n parseFloat(dataRectangle.getAttribute(\"maxx\"))\n );\n const north = CesiumMath.toRadians(\n parseFloat(dataRectangle.getAttribute(\"maxy\"))\n );\n const maxLevel = parseInt(dataRectangle.getAttribute(\"maxlevel\"), 10);\n\n that._rectangles.push(\n new DataRectangle(new Rectangle(west, south, east, north), maxLevel)\n );\n }\n\n that._ready = true;\n return Promise.resolve(true);\n }\n\n function metadataFailure(e) {\n const message = defaultValue(\n defined(e) ? e.message : undefined,\n `An error occurred while accessing ${that._resource.url}.`\n );\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n function requestMetadata() {\n return that._resource\n .fetchXML()\n .then(metadataSuccess)\n .catch(metadataFailure);\n }\n\n this._readyPromise = requestMetadata();\n}\n\nObject.defineProperties(VRTheWorldTerrainProvider.prototype, {\n /**\n * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\n * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link VRTheWorldTerrainProvider#ready} returns true.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {GeographicTilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\n * indicates which areas of the globe are water rather than land, so they can be rendered\n * as a reflective surface with animated waves. This function should not be\n * called before {@link VRTheWorldTerrainProvider#ready} returns true.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasWaterMask: {\n get: function () {\n return false;\n },\n },\n\n /**\n * Gets a value indicating whether or not the requested tiles include vertex normals.\n * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasVertexNormals: {\n get: function () {\n return false;\n },\n },\n /**\n * Gets an object that can be used to determine availability of terrain from this provider, such as\n * at points and in rectangles. This function should not be called before\n * {@link TerrainProvider#ready} returns true. This property may be undefined if availability\n * information is not available.\n * @memberof VRTheWorldTerrainProvider.prototype\n * @type {TileAvailability}\n * @readonly\n */\n availability: {\n get: function () {\n return undefined;\n },\n },\n});\n\n/**\n * Requests the geometry for a given tile. This function should not be called before\n * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain\n * data and indicates that all child tiles are available.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry. If this method\n * returns undefined instead of a promise, it is an indication that too many requests are already\n * pending and the request will be retried later.\n */\nVRTheWorldTerrainProvider.prototype.requestTileGeometry = function (\n x,\n y,\n level,\n request\n) {\n const yTiles = this._tilingScheme.getNumberOfYTilesAtLevel(level);\n const resource = this._resource.getDerivedResource({\n url: `${level}/${x}/${yTiles - y - 1}.tif`,\n queryParameters: {\n cesium: true,\n },\n request: request,\n });\n const promise = resource.fetchImage({\n preferImageBitmap: true,\n });\n if (!defined(promise)) {\n return undefined;\n }\n\n const that = this;\n return Promise.resolve(promise).then(function (image) {\n return new HeightmapTerrainData({\n buffer: getImagePixels(image),\n width: that._heightmapWidth,\n height: that._heightmapHeight,\n childTileMask: getChildMask(that, x, y, level),\n structure: that._terrainDataStructure,\n });\n });\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error.\n */\nVRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\nreturn this._levelZeroMaximumGeometricError / (1 << level);\n};\n\nconst rectangleScratch = new Rectangle();\n\nfunction getChildMask(provider, x, y, level) {\n const tilingScheme = provider._tilingScheme;\n const rectangles = provider._rectangles;\n const parentRectangle = tilingScheme.tileXYToRectangle(x, y, level);\n\n let childMask = 0;\n\n for (let i = 0; i < rectangles.length && childMask !== 15; ++i) {\n const rectangle = rectangles[i];\n if (rectangle.maxLevel <= level) {\n continue;\n }\n\n const testRectangle = rectangle.rectangle;\n\n const intersection = Rectangle.intersection(\n testRectangle,\n parentRectangle,\n rectangleScratch\n );\n if (defined(intersection)) {\n // Parent tile is inside this rectangle, so at least one child is, too.\n if (\n isTileInRectangle(tilingScheme, testRectangle, x * 2, y * 2, level + 1)\n ) {\n childMask |= 4; // northwest\n }\n if (\n isTileInRectangle(\n tilingScheme,\n testRectangle,\n x * 2 + 1,\n y * 2,\n level + 1\n )\n ) {\n childMask |= 8; // northeast\n }\n if (\n isTileInRectangle(\n tilingScheme,\n testRectangle,\n x * 2,\n y * 2 + 1,\n level + 1\n )\n ) {\n childMask |= 1; // southwest\n }\n if (\n isTileInRectangle(\n tilingScheme,\n testRectangle,\n x * 2 + 1,\n y * 2 + 1,\n level + 1\n )\n ) {\n childMask |= 2; // southeast\n }\n }\n }\n\n return childMask;\n}\n\nfunction isTileInRectangle(tilingScheme, rectangle, x, y, level) {\n const tileRectangle = tilingScheme.tileXYToRectangle(x, y, level);\n return defined(\n Rectangle.intersection(tileRectangle, rectangle, rectangleScratch)\n );\n}\n\n/**\n * Determines whether data for a tile is available to be loaded.\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {Boolean|undefined} Undefined if not supported, otherwise true or false.\n */\nVRTheWorldTerrainProvider.prototype.getTileDataAvailable = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Makes sure we load availability data for a tile\n *\n * @param {Number} x The X coordinate of the tile for which to request geometry.\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\n * @param {Number} level The level of the tile for which to request geometry.\n * @returns {undefined|Promise<void>} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\n */\nVRTheWorldTerrainProvider.prototype.loadTileDataAvailability = function (\n x,\n y,\n level\n) {\n return undefined;\n};\nexport default VRTheWorldTerrainProvider;\n", "/**\n * Enum containing Vulkan Constant values by name.\n *\n * These match the constants from the {@link https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-definition|Vulkan 1.2 specification}.\n *\n * @enum {Number}\n * @private\n */\nconst VulkanConstants = {\n VK_FORMAT_UNDEFINED: 0,\n VK_FORMAT_R4G4_UNORM_PACK8: 1,\n VK_FORMAT_R4G4B4A4_UNORM_PACK16: 2,\n VK_FORMAT_B4G4R4A4_UNORM_PACK16: 3,\n VK_FORMAT_R5G6B5_UNORM_PACK16: 4,\n VK_FORMAT_B5G6R5_UNORM_PACK16: 5,\n VK_FORMAT_R5G5B5A1_UNORM_PACK16: 6,\n VK_FORMAT_B5G5R5A1_UNORM_PACK16: 7,\n VK_FORMAT_A1R5G5B5_UNORM_PACK16: 8,\n VK_FORMAT_R8_UNORM: 9,\n VK_FORMAT_R8_SNORM: 10,\n VK_FORMAT_R8_USCALED: 11,\n VK_FORMAT_R8_SSCALED: 12,\n VK_FORMAT_R8_UINT: 13,\n VK_FORMAT_R8_SINT: 14,\n VK_FORMAT_R8_SRGB: 15,\n VK_FORMAT_R8G8_UNORM: 16,\n VK_FORMAT_R8G8_SNORM: 17,\n VK_FORMAT_R8G8_USCALED: 18,\n VK_FORMAT_R8G8_SSCALED: 19,\n VK_FORMAT_R8G8_UINT: 20,\n VK_FORMAT_R8G8_SINT: 21,\n VK_FORMAT_R8G8_SRGB: 22,\n VK_FORMAT_R8G8B8_UNORM: 23,\n VK_FORMAT_R8G8B8_SNORM: 24,\n VK_FORMAT_R8G8B8_USCALED: 25,\n VK_FORMAT_R8G8B8_SSCALED: 26,\n VK_FORMAT_R8G8B8_UINT: 27,\n VK_FORMAT_R8G8B8_SINT: 28,\n VK_FORMAT_R8G8B8_SRGB: 29,\n VK_FORMAT_B8G8R8_UNORM: 30,\n VK_FORMAT_B8G8R8_SNORM: 31,\n VK_FORMAT_B8G8R8_USCALED: 32,\n VK_FORMAT_B8G8R8_SSCALED: 33,\n VK_FORMAT_B8G8R8_UINT: 34,\n VK_FORMAT_B8G8R8_SINT: 35,\n VK_FORMAT_B8G8R8_SRGB: 36,\n VK_FORMAT_R8G8B8A8_UNORM: 37,\n VK_FORMAT_R8G8B8A8_SNORM: 38,\n VK_FORMAT_R8G8B8A8_USCALED: 39,\n VK_FORMAT_R8G8B8A8_SSCALED: 40,\n VK_FORMAT_R8G8B8A8_UINT: 41,\n VK_FORMAT_R8G8B8A8_SINT: 42,\n VK_FORMAT_R8G8B8A8_SRGB: 43,\n VK_FORMAT_B8G8R8A8_UNORM: 44,\n VK_FORMAT_B8G8R8A8_SNORM: 45,\n VK_FORMAT_B8G8R8A8_USCALED: 46,\n VK_FORMAT_B8G8R8A8_SSCALED: 47,\n VK_FORMAT_B8G8R8A8_UINT: 48,\n VK_FORMAT_B8G8R8A8_SINT: 49,\n VK_FORMAT_B8G8R8A8_SRGB: 50,\n VK_FORMAT_A8B8G8R8_UNORM_PACK32: 51,\n VK_FORMAT_A8B8G8R8_SNORM_PACK32: 52,\n VK_FORMAT_A8B8G8R8_USCALED_PACK32: 53,\n VK_FORMAT_A8B8G8R8_SSCALED_PACK32: 54,\n VK_FORMAT_A8B8G8R8_UINT_PACK32: 55,\n VK_FORMAT_A8B8G8R8_SINT_PACK32: 56,\n VK_FORMAT_A8B8G8R8_SRGB_PACK32: 57,\n VK_FORMAT_A2R10G10B10_UNORM_PACK32: 58,\n VK_FORMAT_A2R10G10B10_SNORM_PACK32: 59,\n VK_FORMAT_A2R10G10B10_USCALED_PACK32: 60,\n VK_FORMAT_A2R10G10B10_SSCALED_PACK32: 61,\n VK_FORMAT_A2R10G10B10_UINT_PACK32: 62,\n VK_FORMAT_A2R10G10B10_SINT_PACK32: 63,\n VK_FORMAT_A2B10G10R10_UNORM_PACK32: 64,\n VK_FORMAT_A2B10G10R10_SNORM_PACK32: 65,\n VK_FORMAT_A2B10G10R10_USCALED_PACK32: 66,\n VK_FORMAT_A2B10G10R10_SSCALED_PACK32: 67,\n VK_FORMAT_A2B10G10R10_UINT_PACK32: 68,\n VK_FORMAT_A2B10G10R10_SINT_PACK32: 69,\n VK_FORMAT_R16_UNORM: 70,\n VK_FORMAT_R16_SNORM: 71,\n VK_FORMAT_R16_USCALED: 72,\n VK_FORMAT_R16_SSCALED: 73,\n VK_FORMAT_R16_UINT: 74,\n VK_FORMAT_R16_SINT: 75,\n VK_FORMAT_R16_SFLOAT: 76,\n VK_FORMAT_R16G16_UNORM: 77,\n VK_FORMAT_R16G16_SNORM: 78,\n VK_FORMAT_R16G16_USCALED: 79,\n VK_FORMAT_R16G16_SSCALED: 80,\n VK_FORMAT_R16G16_UINT: 81,\n VK_FORMAT_R16G16_SINT: 82,\n VK_FORMAT_R16G16_SFLOAT: 83,\n VK_FORMAT_R16G16B16_UNORM: 84,\n VK_FORMAT_R16G16B16_SNORM: 85,\n VK_FORMAT_R16G16B16_USCALED: 86,\n VK_FORMAT_R16G16B16_SSCALED: 87,\n VK_FORMAT_R16G16B16_UINT: 88,\n VK_FORMAT_R16G16B16_SINT: 89,\n VK_FORMAT_R16G16B16_SFLOAT: 90,\n VK_FORMAT_R16G16B16A16_UNORM: 91,\n VK_FORMAT_R16G16B16A16_SNORM: 92,\n VK_FORMAT_R16G16B16A16_USCALED: 93,\n VK_FORMAT_R16G16B16A16_SSCALED: 94,\n VK_FORMAT_R16G16B16A16_UINT: 95,\n VK_FORMAT_R16G16B16A16_SINT: 96,\n VK_FORMAT_R16G16B16A16_SFLOAT: 97,\n VK_FORMAT_R32_UINT: 98,\n VK_FORMAT_R32_SINT: 99,\n VK_FORMAT_R32_SFLOAT: 100,\n VK_FORMAT_R32G32_UINT: 101,\n VK_FORMAT_R32G32_SINT: 102,\n VK_FORMAT_R32G32_SFLOAT: 103,\n VK_FORMAT_R32G32B32_UINT: 104,\n VK_FORMAT_R32G32B32_SINT: 105,\n VK_FORMAT_R32G32B32_SFLOAT: 106,\n VK_FORMAT_R32G32B32A32_UINT: 107,\n VK_FORMAT_R32G32B32A32_SINT: 108,\n VK_FORMAT_R32G32B32A32_SFLOAT: 109,\n VK_FORMAT_R64_UINT: 110,\n VK_FORMAT_R64_SINT: 111,\n VK_FORMAT_R64_SFLOAT: 112,\n VK_FORMAT_R64G64_UINT: 113,\n VK_FORMAT_R64G64_SINT: 114,\n VK_FORMAT_R64G64_SFLOAT: 115,\n VK_FORMAT_R64G64B64_UINT: 116,\n VK_FORMAT_R64G64B64_SINT: 117,\n VK_FORMAT_R64G64B64_SFLOAT: 118,\n VK_FORMAT_R64G64B64A64_UINT: 119,\n VK_FORMAT_R64G64B64A64_SINT: 120,\n VK_FORMAT_R64G64B64A64_SFLOAT: 121,\n VK_FORMAT_B10G11R11_UFLOAT_PACK32: 122,\n VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: 123,\n VK_FORMAT_D16_UNORM: 124,\n VK_FORMAT_X8_D24_UNORM_PACK32: 125,\n VK_FORMAT_D32_SFLOAT: 126,\n VK_FORMAT_S8_UINT: 127,\n VK_FORMAT_D16_UNORM_S8_UINT: 128,\n VK_FORMAT_D24_UNORM_S8_UINT: 129,\n VK_FORMAT_D32_SFLOAT_S8_UINT: 130,\n VK_FORMAT_BC1_RGB_UNORM_BLOCK: 131,\n VK_FORMAT_BC1_RGB_SRGB_BLOCK: 132,\n VK_FORMAT_BC1_RGBA_UNORM_BLOCK: 133,\n VK_FORMAT_BC1_RGBA_SRGB_BLOCK: 134,\n VK_FORMAT_BC2_UNORM_BLOCK: 135,\n VK_FORMAT_BC2_SRGB_BLOCK: 136,\n VK_FORMAT_BC3_UNORM_BLOCK: 137,\n VK_FORMAT_BC3_SRGB_BLOCK: 138,\n VK_FORMAT_BC4_UNORM_BLOCK: 139,\n VK_FORMAT_BC4_SNORM_BLOCK: 140,\n VK_FORMAT_BC5_UNORM_BLOCK: 141,\n VK_FORMAT_BC5_SNORM_BLOCK: 142,\n VK_FORMAT_BC6H_UFLOAT_BLOCK: 143,\n VK_FORMAT_BC6H_SFLOAT_BLOCK: 144,\n VK_FORMAT_BC7_UNORM_BLOCK: 145,\n VK_FORMAT_BC7_SRGB_BLOCK: 146,\n VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: 147,\n VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: 148,\n VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: 149,\n VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: 150,\n VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: 151,\n VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: 152,\n VK_FORMAT_EAC_R11_UNORM_BLOCK: 153,\n VK_FORMAT_EAC_R11_SNORM_BLOCK: 154,\n VK_FORMAT_EAC_R11G11_UNORM_BLOCK: 155,\n VK_FORMAT_EAC_R11G11_SNORM_BLOCK: 156,\n VK_FORMAT_ASTC_4x4_UNORM_BLOCK: 157,\n VK_FORMAT_ASTC_4x4_SRGB_BLOCK: 158,\n VK_FORMAT_ASTC_5x4_UNORM_BLOCK: 159,\n VK_FORMAT_ASTC_5x4_SRGB_BLOCK: 160,\n VK_FORMAT_ASTC_5x5_UNORM_BLOCK: 161,\n VK_FORMAT_ASTC_5x5_SRGB_BLOCK: 162,\n VK_FORMAT_ASTC_6x5_UNORM_BLOCK: 163,\n VK_FORMAT_ASTC_6x5_SRGB_BLOCK: 164,\n VK_FORMAT_ASTC_6x6_UNORM_BLOCK: 165,\n VK_FORMAT_ASTC_6x6_SRGB_BLOCK: 166,\n VK_FORMAT_ASTC_8x5_UNORM_BLOCK: 167,\n VK_FORMAT_ASTC_8x5_SRGB_BLOCK: 168,\n VK_FORMAT_ASTC_8x6_UNORM_BLOCK: 169,\n VK_FORMAT_ASTC_8x6_SRGB_BLOCK: 170,\n VK_FORMAT_ASTC_8x8_UNORM_BLOCK: 171,\n VK_FORMAT_ASTC_8x8_SRGB_BLOCK: 172,\n VK_FORMAT_ASTC_10x5_UNORM_BLOCK: 173,\n VK_FORMAT_ASTC_10x5_SRGB_BLOCK: 174,\n VK_FORMAT_ASTC_10x6_UNORM_BLOCK: 175,\n VK_FORMAT_ASTC_10x6_SRGB_BLOCK: 176,\n VK_FORMAT_ASTC_10x8_UNORM_BLOCK: 177,\n VK_FORMAT_ASTC_10x8_SRGB_BLOCK: 178,\n VK_FORMAT_ASTC_10x10_UNORM_BLOCK: 179,\n VK_FORMAT_ASTC_10x10_SRGB_BLOCK: 180,\n VK_FORMAT_ASTC_12x10_UNORM_BLOCK: 181,\n VK_FORMAT_ASTC_12x10_SRGB_BLOCK: 182,\n VK_FORMAT_ASTC_12x12_UNORM_BLOCK: 183,\n VK_FORMAT_ASTC_12x12_SRGB_BLOCK: 184,\n VK_FORMAT_G8B8G8R8_422_UNORM: 1000156000,\n VK_FORMAT_B8G8R8G8_422_UNORM: 1000156001,\n VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: 1000156002,\n VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: 1000156003,\n VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: 1000156004,\n VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: 1000156005,\n VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: 1000156006,\n VK_FORMAT_R10X6_UNORM_PACK16: 1000156007,\n VK_FORMAT_R10X6G10X6_UNORM_2PACK16: 1000156008,\n VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: 1000156009,\n VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: 1000156010,\n VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: 1000156011,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: 1000156012,\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: 1000156013,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: 1000156014,\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: 1000156015,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: 1000156016,\n VK_FORMAT_R12X4_UNORM_PACK16: 1000156017,\n VK_FORMAT_R12X4G12X4_UNORM_2PACK16: 1000156018,\n VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: 1000156019,\n VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: 1000156020,\n VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: 1000156021,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: 1000156022,\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: 1000156023,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: 1000156024,\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: 1000156025,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: 1000156026,\n VK_FORMAT_G16B16G16R16_422_UNORM: 1000156027,\n VK_FORMAT_B16G16R16G16_422_UNORM: 1000156028,\n VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: 1000156029,\n VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: 1000156030,\n VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: 1000156031,\n VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: 1000156032,\n VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: 1000156033,\n VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: 1000054000,\n VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: 1000054001,\n VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: 1000054002,\n VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: 1000054003,\n VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: 1000054004,\n VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: 1000054005,\n VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: 1000054006,\n VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: 1000054007,\n VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT: 1000066000,\n VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT: 1000066001,\n VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT: 1000066002,\n VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT: 1000066003,\n VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT: 1000066004,\n VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT: 1000066005,\n VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT: 1000066006,\n VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT: 1000066007,\n VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT: 1000066008,\n VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT: 1000066009,\n VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: 1000066010,\n VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: 1000066011,\n VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: 1000066012,\n VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: 1000066013,\n VK_FORMAT_G8B8G8R8_422_UNORM_KHR: 1000156000,\n VK_FORMAT_B8G8R8G8_422_UNORM_KHR: 1000156001,\n VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: 1000156002,\n VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: 1000156003,\n VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: 1000156004,\n VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: 1000156005,\n VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: 1000156006,\n VK_FORMAT_R10X6_UNORM_PACK16_KHR: 1000156007,\n VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR: 1000156008,\n VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR: 1000156009,\n VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: 1000156010,\n VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: 1000156011,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: 1000156012,\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: 1000156013,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: 1000156014,\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: 1000156015,\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: 1000156016,\n VK_FORMAT_R12X4_UNORM_PACK16_KHR: 1000156017,\n VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR: 1000156018,\n VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR: 1000156019,\n VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: 1000156020,\n VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: 1000156021,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: 1000156022,\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: 1000156023,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: 1000156024,\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: 1000156025,\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: 1000156026,\n VK_FORMAT_G16B16G16R16_422_UNORM_KHR: 1000156027,\n VK_FORMAT_B16G16R16G16_422_UNORM_KHR: 1000156028,\n VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: 1000156029,\n VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: 1000156030,\n VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: 1000156031,\n VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: 1000156032,\n VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: 1000156033,\n};\nexport default Object.freeze(VulkanConstants);\n", "import WebGLConstants from \"./WebGLConstants.js\";\n\nfunction webGLConstantToGlslType(webGLValue) {\n switch (webGLValue) {\n case WebGLConstants.FLOAT:\n return \"float\";\n case WebGLConstants.FLOAT_VEC2:\n return \"vec2\";\n case WebGLConstants.FLOAT_VEC3:\n return \"vec3\";\n case WebGLConstants.FLOAT_VEC4:\n return \"vec4\";\n case WebGLConstants.FLOAT_MAT2:\n return \"mat2\";\n case WebGLConstants.FLOAT_MAT3:\n return \"mat3\";\n case WebGLConstants.FLOAT_MAT4:\n return \"mat4\";\n case WebGLConstants.SAMPLER_2D:\n return \"sampler2D\";\n case WebGLConstants.BOOL:\n return \"bool\";\n }\n}\nexport default webGLConstantToGlslType;\n", "import DeveloperError from \"./DeveloperError.js\";\n\n/**\n * Wraps a function on the provided objects with another function called in the\n * object's context so that the new function is always called immediately\n * before the old one.\n *\n * @private\n */\nfunction wrapFunction(obj, oldFunction, newFunction) {\n return function () {\n newFunction.apply(obj, arguments);\n oldFunction.apply(obj, arguments);\n };\n}\nexport default wrapFunction;\n", "var oldValue;\nif (typeof ko !== 'undefined') {\n oldValue = ko;\n}\n\n(function(){\n/*!\n * Knockout JavaScript library v3.5.1\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n\n(function() {(function(n){var A=this||(0,eval)(\"this\"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||\"undefined\"===typeof jQuery||(v=jQuery);(function(n){n(A.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);\nd=a.a.setTimeout(b,c)}}function Z(a,c){c&&\"change\"!==c?\"beforeChange\"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a=\"undefined\"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split(\".\"),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.L=function(a,c,d){a[c]=d};a.version=\"3.5.1\";a.b(\"version\",\na.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b){a.a.Na(l,b,e)});b[c]=l.join(\" \")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h=\"function\"===typeof Symbol,m={},k={};m[R&&/Firefox\\/2/i.test(R.userAgent)?\n\"KeyboardEvent\":\"UIEvents\"]=[\"keyup\",\"keydown\",\"keypress\"];m.MouseEvents=\"click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave\".split(\" \");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)k[b[c]]=a});var l={propertychange:!0},p=w&&function(){for(var a=3,b=w.createElement(\"div\"),c=b.getElementsByTagName(\"i\");b.innerHTML=\"\\x3c!--[if gt IE \"+ ++a+\"]><i></i><![endif]--\\x3e\",c[0];);return 4<a?a:n}(),q=/\\S+/g,t;return{Jc:[\"authenticity_token\",/^__RequestVerificationToken(_.*)?$/],\nD:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:\"function\"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Pa:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},wc:function(b){var c=[];b&&a.a.D(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,\nb,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)d.push(b.call(c,a[e],e));return d},jb:function(a,b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},Nb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Na:function(b,c,d){var e=a.a.A(a.a.bc(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=\nb.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement(\"div\"),d=0,e=b.length;d<e;d++)c.appendChild(a.oa(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,l=[];d<e;d++){var k=b[d].cloneNode(!0);l.push(c?a.oa(k):k)}return l},va:function(b,c){a.a.Tb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Xc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],\nl=e.parentNode,k=0,f=c.length;k<f;k++)l.insertBefore(c[k],e);k=0;for(f=d.length;k<f;k++)a.removeNode(d[k])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Zc:function(a,b){7>p?a.setAttribute(\"selected\",b):a.selected=b},Db:function(a){return null===a||a===n?\"\":a.trim?\na.trim():a.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g,\"\")},Ud:function(a,b){a=a||\"\";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&&\na.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||\"function\"!=typeof b.addEventListener)if(\"undefined\"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f=\"on\"+c;b.attachEvent(f,\nk);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error(\"Browser doesn't support addEventListener or attachEvent\");else b.addEventListener(c,e,!1);else t||(t=\"function\"==typeof v(b).on?\"on\":\"bind\"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error(\"element must be a DOM node when calling triggerEvent\");var d;\"input\"===a.a.R(b)&&b.type&&\"click\"==c.toLowerCase()?(d=b.type,d=\"checkbox\"==d||\"radio\"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if(\"function\"==typeof w.createEvent)if(\"function\"==\ntypeof b.dispatchEvent)d=w.createEvent(k[c]||\"HTMLEvents\"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error(\"The supplied element doesn't support dispatchEvent\");else if(d&&b.click)b.click();else if(\"undefined\"!=typeof b.fireEvent)b.fireEvent(\"on\"+c);else throw Error(\"Browser doesn't support triggering events\");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&(\"object\"===typeof b.classList?\n(l=b.classList[d?\"add\":\"remove\"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):\"string\"===typeof b.className.baseVal?e(b.className,\"baseVal\",c,d):e(b,\"className\",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d=\"\";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'\"]/g,function(a){return\"&#\"+a.charCodeAt(0)+\";\"});a.mergeAttributes(w.createElement(\"<input name='\"+\nc+\"'/>\"),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Zd:6===p,$d:7===p,W:p,Lc:function(b,c){for(var d=a.a.la(b.getElementsByTagName(\"input\")).concat(a.a.la(b.getElementsByTagName(\"textarea\"))),\ne=\"string\"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},l=[],k=d.length-1;0<=k;k--)e(d[k])&&l.push(d[k]);return l},Nd:function(b){return\"string\"==typeof b&&(b=a.a.Db(b))?H&&H.parse?H.parse(b):(new Function(\"return \"+b))():null},hc:function(b,c,d){if(!H||!H.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\");\nreturn H.stringify(a.a.f(b),c,d)},Od:function(c,d,e){e=e||{};var l=e.params||{},k=e.includeFields||this.Jc,f=c;if(\"object\"==typeof c&&\"form\"===a.a.R(c))for(var f=c.action,h=k.length-1;0<=h;h--)for(var g=a.a.Lc(c,k[h]),m=g.length-1;0<=m;m--)l[g[m].name]=g[m].value;d=a.a.f(d);var p=w.createElement(\"form\");p.style.display=\"none\";p.action=f;p.method=\"post\";for(var q in d)c=w.createElement(\"input\"),c.type=\"hidden\",c.name=q,c.value=a.a.hc(a.a.f(d[q])),p.appendChild(c);b(l,function(a,b){var c=w.createElement(\"input\");\nc.type=\"hidden\";c.name=a;c.value=b;p.appendChild(c)});w.body.appendChild(p);e.submitter?e.submitter(p):p.submit();setTimeout(function(){p.parentNode.removeChild(p)},0)}}}();a.b(\"utils\",a.a);a.b(\"utils.arrayForEach\",a.a.D);a.b(\"utils.arrayFirst\",a.a.Lb);a.b(\"utils.arrayFilter\",a.a.jb);a.b(\"utils.arrayGetDistinctValues\",a.a.wc);a.b(\"utils.arrayIndexOf\",a.a.A);a.b(\"utils.arrayMap\",a.a.Mb);a.b(\"utils.arrayPushAll\",a.a.Nb);a.b(\"utils.arrayRemoveItem\",a.a.Pa);a.b(\"utils.cloneNodes\",a.a.Ca);a.b(\"utils.createSymbolOrString\",\na.a.Da);a.b(\"utils.extend\",a.a.extend);a.b(\"utils.fieldsIncludedWithJsonPost\",a.a.Jc);a.b(\"utils.getFormFields\",a.a.Lc);a.b(\"utils.objectMap\",a.a.Ga);a.b(\"utils.peekObservable\",a.a.bc);a.b(\"utils.postJson\",a.a.Od);a.b(\"utils.parseJson\",a.a.Nd);a.b(\"utils.registerEventHandler\",a.a.B);a.b(\"utils.stringifyJson\",a.a.hc);a.b(\"utils.range\",a.a.Pd);a.b(\"utils.toggleDomNodeCssClass\",a.a.Eb);a.b(\"utils.triggerEvent\",a.a.Fb);a.b(\"utils.unwrapObservable\",a.a.f);a.b(\"utils.objectForEach\",a.a.P);a.b(\"utils.addOrRemoveItem\",\na.a.Na);a.b(\"utils.setTextContent\",a.a.Bb);a.b(\"unwrap\",a.a.f);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c=\"__ko__\"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||\"null\"===f||!d[f]){if(!e)return n;f=a[c]=\"ko\"+b++;d[f]=\n{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==n))&&(a[b]=c)},Ub:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b(\"utils.domData\",a.a.g);a.b(\"utils.domData.clear\",a.a.g.clear);a.a.K=new function(){function b(b,c){var d=a.a.g.get(b,e);\nd===n&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.g.clear(c);a.a.K.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if(\"function\"!=typeof c)throw Error(\"Callback must be a function\");b(a,!0).push(c)},yb:function(c,\nd){var f=b(c,!1);f&&(a.a.Pa(f,d),0==f.length&&a.a.g.set(c,e,n))},oa:function(b){a.u.G(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName(\"*\")))});return b},removeNode:function(b){a.oa(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&\"function\"==typeof v.cleanData&&v.cleanData([a])}}};a.oa=a.a.K.oa;a.removeNode=a.a.K.removeNode;a.b(\"cleanNode\",a.oa);a.b(\"removeNode\",a.removeNode);a.b(\"utils.domNodeDisposal\",a.a.K);a.b(\"utils.domNodeDisposal.addDisposeCallback\",\na.a.K.za);a.b(\"utils.domNodeDisposal.removeDisposeCallback\",a.a.K.yb);(function(){var b=[0,\"\",\"\"],c=[1,\"<table>\",\"</table>\"],d=[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],e=[1,\"<select multiple='multiple'>\",\"</select>\"],f={thead:c,tbody:c,tfoot:c,tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode;\nl.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement(\"div\"),t;t=(p=p.match(/^(?:\\x3c!--.*?--\\x3e\\s*?)*?<([a-z]+)[\\s>]/))&&f[p[1]]||b;p=t[0];t=\"ignored<div>\"+t[1]+c+t[2]+\"</div>\";\"function\"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b,\nc);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if(\"string\"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b(\"utils.parseHtmlFragment\",a.a.ua);a.b(\"utils.setHtml\",a.a.fc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=f&&e.push({ud:c,Kd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],\ne)}var c={};return{Xb:function(a){if(\"function\"!=typeof a)throw Error(\"You can only pass a function to ko.memoization.memoize()\");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return\"\\x3c!--[ko_memo:\"+b+\"]--\\x3e\"},bd:function(a,b){var f=c[a];if(f===n)throw Error(\"Couldn't find any memo with ID \"+a+\". Perhaps it's already been unmemoized.\");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},cd:function(c,e){var f=\n[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ud,k=[m];e&&a.a.Nb(k,e);a.aa.bd(f[g].Kd,k);m.nodeValue=\"\";m.parentNode&&m.parentNode.removeChild(m)}},Uc:function(a){return(a=a.match(/^\\[ko_memo\\:(.*?)\\]$/))?a[1]:null}}}();a.b(\"memoization\",a.aa);a.b(\"memoization.memoize\",a.aa.Xb);a.b(\"memoization.unmemoize\",a.aa.bd);a.b(\"memoization.parseMemoText\",a.aa.Uc);a.b(\"memoization.unmemoizeDomNodeAndDescendants\",a.aa.cd);a.na=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=\n++c){h=f;a.a.Gc(Error(\"'Too much recursion' after processing \"+c+\" task groups.\"));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement(\"div\");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle(\"foo\")}}(c):d=w&&\"onreadystatechange\"in w.createElement(\"script\")?function(a){var b=w.createElement(\"script\");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);\nb=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Sd:b}}();a.b(\"tasks\",a.na);a.b(\"tasks.schedule\",a.na.zb);a.b(\"tasks.runEarly\",a.na.Sd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},\nc)}})},rateLimit:function(a,c){var d,e,f;\"number\"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f=\"function\"==typeof e?e:\"notifyWhenChangesStop\"==e?Y:X;a.ub(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)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(c){var e,f=!1;return function(){if(!f){a.na.cancel(e);e=a.na.zb(c);try{f=!0,b.notifySubscribers(n,\"dirty\")}finally{f=\n!1}}}}))},notify:function(a,c){a.equalityComparer=\"always\"==c?null:K}};var W={undefined:1,\"boolean\":1,number:1,string:1};a.b(\"extenders\",a.Ta);a.ic=function(b,c,d){this.da=b;this.lc=c;this.mc=d;this.Ib=!1;this.fb=this.Jb=null;a.L(this,\"dispose\",this.s);a.L(this,\"disposeWhenNodeIsRemoved\",this.l)};a.ic.prototype.s=function(){this.Ib||(this.fb&&a.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)};a.ic.prototype.l=function(b){this.Jb=b;a.a.K.za(b,this.fb=this.s.bind(this))};\na.T=function(){a.a.Ab(this,D);D.qb(this)};var D={qb:function(a){a.U={change:[]};a.sc=1},subscribe:function(b,c,d){var e=this;d=d||\"change\";var f=new a.ic(e,c?b.bind(c):b,function(){a.a.Pa(e.U[d],f);e.hb&&e.hb(d)});e.Qa&&e.Qa(d);e.U[d]||(e.U[d]=[]);e.U[d].push(f);return f},notifySubscribers:function(b,c){c=c||\"change\";\"change\"===c&&this.Gb();if(this.Wa(c)){var d=\"change\"===c&&this.ed||this.U[c].slice(0);try{a.u.xc();for(var e=0,f;f=d[e];++e)f.Ib||f.lc(b)}finally{a.u.end()}}},ob:function(){return this.sc},\nDd:function(a){return this.ob()!==a},Gb:function(){++this.sc},ub:function(b){var c=this,d=a.O(c),e,f,g,h,m;c.gb||(c.gb=c.notifySubscribers,c.notifySubscribers=Z);var k=b(function(){c.Ja=!1;d&&h===c&&(h=c.nc?c.nc():c());var a=f||m&&c.sb(g,h);m=f=e=!1;a&&c.gb(g=h)});c.qc=function(a,b){b&&c.Ja||(m=!b);c.ed=c.U.change.slice(0);c.Ja=e=!0;h=a;k()};c.pc=function(a){e||(g=a,c.gb(a,\"beforeChange\"))};c.rc=function(){m=!0};c.gd=function(){c.sb(g,c.v(!0))&&(f=!0)}},Wa:function(a){return this.U[a]&&this.U[a].length},\nBd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var c=0;a.a.P(this.U,function(a,b){\"dirty\"!==a&&(c+=b.length)});return c},sb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return\"[object Object]\"},extend:function(b){var c=this;b&&a.a.P(b,function(b,e){var f=a.Ta[b];\"function\"==typeof f&&(c=f(c,e)||c)});return c}};a.L(D,\"init\",D.qb);a.L(D,\"subscribe\",D.subscribe);a.L(D,\"extend\",D.extend);a.L(D,\"getSubscriptionsCount\",D.Bd);a.a.Ba&&a.a.setPrototypeOf(D,\nFunction.prototype);a.T.fn=D;a.Qc=function(a){return null!=a&&\"function\"==typeof a.subscribe&&\"function\"==typeof a.notifySubscribers};a.b(\"subscribable\",a.T);a.b(\"isSubscribable\",a.Qc);a.S=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{xc:b,end:c,cc:function(b){if(e){if(!a.Qc(b))throw Error(\"Only subscribable things can act as dependencies\");e.od.call(e.pd,b,b.fd||(b.fd=++f))}},G:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},qa:function(){if(e)return e.o.qa()},\nVa:function(){if(e)return e.o.Va()},Ya:function(){if(e)return e.Ya},o:function(){if(e)return e.o}}}();a.b(\"computedContext\",a.S);a.b(\"computedContext.getDependenciesCount\",a.S.qa);a.b(\"computedContext.getDependencies\",a.S.Va);a.b(\"computedContext.isInitial\",a.S.Ya);a.b(\"computedContext.registerDependency\",a.S.cc);a.b(\"ignoreDependencies\",a.Yd=a.u.G);var I=a.a.Da(\"_latestValue\");a.ta=function(b){function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya(),c[I]=arguments[0],c.xa()),this;\na.u.cc(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.T.fn);a.T.fn.qb(c);a.a.Ab(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,v:function(){return this[I]},xa:function(){this.notifySubscribers(this[I],\"spectate\");this.notifySubscribers(this[I])},ya:function(){this.notifySubscribers(this[I],\"beforeChange\")}};a.a.Ba&&a.a.setPrototypeOf(F,a.T.fn);var G=a.ta.Ma=\"__ko_proto__\";F[G]=a.ta;a.O=function(b){if((b=\"function\"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error(\"Invalid object that looks like an observable; possibly from another Knockout instance\");\nreturn!!b};a.Za=function(b){return\"function\"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Nc)};a.b(\"observable\",a.ta);a.b(\"isObservable\",a.O);a.b(\"isWriteableObservable\",a.Za);a.b(\"isWritableObservable\",a.Za);a.b(\"observable.fn\",F);a.L(F,\"peek\",F.v);a.L(F,\"valueHasMutated\",F.xa);a.L(F,\"valueWillMutate\",F.ya);a.Ha=function(b){b=b||[];if(\"object\"!=typeof b||!(\"length\"in b))throw Error(\"The argument passed when initializing an observable array must be an array, or null, or undefined.\");b=a.ta(b);a.a.Ab(b,\na.Ha.fn);return b.extend({trackArrayChanges:!0})};a.Ha.fn={remove:function(b){for(var c=this.v(),d=[],e=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.ya();if(c[f]!==g)throw Error(\"Array modified during remove; cannot remove item\");d.push(g);c.splice(f,1);f--}}d.length&&this.xa();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.ya();c.splice(0,c.length);this.xa();return d}return b?this.remove(function(c){return 0<=\na.a.A(b,c)}):[]},destroy:function(b){var c=this.v(),d=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b;this.ya();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.xa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ya(),this.v()[d]=c,this.xa())},sorted:function(a){var c=this().slice(0);\nreturn a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ha.fn,a.ta.fn);a.a.D(\"pop push reverse shift sort splice unshift\".split(\" \"),function(b){a.Ha.fn[b]=function(){var a=this.v();this.ya();this.zc(a,b,arguments);var d=a[b].apply(a,arguments);this.xa();return d===a?this:d}});a.a.D([\"slice\"],function(b){a.Ha.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Pc=function(b){return a.O(b)&&\"function\"==typeof b.remove&&\"function\"==\ntypeof b.push};a.b(\"observableArray\",a.Ha);a.b(\"isObservableArray\",a.Pc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa(\"arrayChange\")){if(!f||1<m)f=a.a.Pb(k,d,b.Ob);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,\"arrayChange\")}}e?c():(e=!0,h=b.subscribe(function(){++m},null,\"spectate\"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Ob={};c&&\"object\"==typeof c&&a.a.extend(b.Ob,c);b.Ob.sparse=!0;if(!b.zc){var e=!1,f=null,g,h,m=0,\nk,l=b.Qa,p=b.hb;b.Qa=function(a){l&&l.call(b,a);\"arrayChange\"===a&&d()};b.hb=function(a){p&&p.call(b,a);\"arrayChange\"!==a||b.Wa(\"arrayChange\")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.zc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,g=d.length,h=0;switch(c){case \"push\":h=p;case \"unshift\":for(c=0;c<g;c++)l(\"added\",d[c],h+c);break;case \"pop\":h=p-1;case \"shift\":p&&l(\"deleted\",b[h],h);break;case \"splice\":c=Math.min(Math.max(0,0>d[0]?p+d[0]:\nd[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;c<h;++c,++n)c<p&&L.push(l(\"deleted\",b[c],c)),c<g&&U.push(l(\"added\",d[n],c));a.a.Kc(L,U);break;default:return}f=k}}}};var r=a.a.Da(\"_state\");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if(\"function\"===typeof f)f.apply(g.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}g.ra||\na.u.cc(e);(g.ka||g.J&&e.Xa())&&e.ha();return g.X}\"object\"===typeof b?d=b:(d=d||{},b&&(d.read=b));if(\"function\"!=typeof d.read)throw Error(\"Pass a function that returns the value of the ko.computed\");var f=d.write,g={X:n,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:d.read,nb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Rb:null,I:{},V:0,Ic:null};e[r]=g;e.Nc=\"function\"===typeof f;a.a.Ba||a.a.extend(e,a.T.fn);a.T.fn.qb(e);a.a.Ab(e,C);d.pure?(g.wb=!0,g.J=!0,a.a.extend(e,da)):\nd.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.jc=!0,g.l.nodeType||(g.l=null));g.J||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.K.za(g.l,g.Rb=function(){e.s()});return e};var C={equalityComparer:K,qa:function(){return this[r].V},Va:function(){var b=[];a.a.P(this[r].I,function(a,d){b[d.Ka]=d.da});return b},Vb:function(b){if(!this[r].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Vb&&a.Vb(b)})},uc:function(a,c,d){if(this[r].wb&&\nc===this)throw Error(\"A 'pure' computed must not be called recursively\");this[r].I[a]=d;d.Ka=this[r].V++;d.La=c.ob()},Xa:function(){var a,c,d=this[r].I;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ia&&c.da.Ja||c.da.Dd(c.La)))return!0},Jd:function(){this.Ia&&!this[r].rb&&this.Ia(!1)},ja:function(){var a=this[r];return a.ka||0<a.V},Rd:function(){this.Ja?this[r].ka&&(this[r].sa=!0):this.Hc()},$c:function(a){if(a.Hb){var c=a.subscribe(this.Jd,this,\"dirty\"),d=a.subscribe(this.Rd,\nthis);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Hc,this)},Hc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[r].Ic),this[r].Ic=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var c=this[r],d=c.Sa,e=!1;if(!c.rb&&!c.ra){if(c.l&&!a.a.Sb(c.l)||d&&d()){if(!c.jc){this.s();return}}else c.jc=!1;c.rb=!0;try{e=this.zd(b)}finally{c.rb=!1}return e}},zd:function(b){var c=this[r],d=!1,e=c.wb?n:!c.V,d={qd:this,mb:c.I,Qb:c.V};a.u.xc({pd:d,\nod:ba,o:this,Ya:e});c.I={};c.V=0;var f=this.yd(c,d);c.V?d=this.sb(c.X,f):(this.s(),d=!0);d&&(c.J?this.Gb():this.notifySubscribers(c.X,\"beforeChange\"),c.X=f,this.notifySubscribers(c.X,\"spectate\"),!c.J&&b&&this.notifySubscribers(c.X),this.rc&&this.rc());e&&this.notifySubscribers(c.X,\"awake\");return d},yd:function(b,c){try{var d=b.Wc;return b.nb?d.call(b.nb):d()}finally{a.u.end(),c.Qb&&!b.J&&a.a.P(c.mb,aa),b.sa=b.ka=!1}},v:function(a){var c=this[r];(c.ka&&(a||!c.V)||c.J&&this.Xa())&&this.ha();return c.X},\nub:function(b){a.T.fn.ub.call(this,b);this.nc=function(){this[r].J||(this[r].sa?this.ha():this[r].ka=!1);return this[r].X};this.Ia=function(a){this.pc(this[r].X);this[r].ka=!0;a&&(this[r].sa=!0);this.qc(this,!a)}},s:function(){var b=this[r];!b.J&&b.I&&a.a.P(b.I,function(a,b){b.s&&b.s()});b.l&&b.Rb&&a.a.K.yb(b.l,b.Rb);b.I=n;b.V=0;b.ra=!0;b.sa=!1;b.ka=!1;b.J=!1;b.l=n;b.Sa=n;b.Wc=n;this.Nc||(b.nb=n)}},da={Qa:function(b){var c=this,d=c[r];if(!d.ra&&d.J&&\"change\"==b){d.J=!1;if(d.sa||c.Xa())d.I=null,d.V=\n0,c.ha()&&c.Gb();else{var e=[];a.a.P(d.I,function(a,b){e[b.Ka]=a});a.a.D(e,function(a,b){var e=d.I[a],m=c.$c(e.da);m.Ka=b;m.La=e.La;d.I[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.ra||c.notifySubscribers(d.X,\"awake\")}},hb:function(b){var c=this[r];c.ra||\"change\"!=b||this.Wa(\"change\")||(a.a.P(c.I,function(a,b){b.s&&(c.I[a]={da:b.da,Ka:b.Ka,La:b.La},b.s())}),c.J=!0,this.notifySubscribers(n,\"asleep\"))},ob:function(){var b=this[r];b.J&&(b.sa||this.Xa())&&this.ha();return a.T.fn.ob.call(this)}},ea={Qa:function(a){\"change\"!=\na&&\"beforeChange\"!=a||this.v()}};a.a.Ba&&a.a.setPrototypeOf(C,a.T.fn);var N=a.ta.Ma;C[N]=a.o;a.Oc=function(a){return\"function\"==typeof a&&a[N]===C[N]};a.Fd=function(b){return a.Oc(b)&&b[r]&&b[r].wb};a.b(\"computed\",a.o);a.b(\"dependentObservable\",a.o);a.b(\"isComputed\",a.Oc);a.b(\"isPureComputed\",a.Fd);a.b(\"computed.fn\",C);a.L(C,\"peek\",C.v);a.L(C,\"dispose\",C.s);a.L(C,\"isActive\",C.ja);a.L(C,\"getDependenciesCount\",C.qa);a.L(C,\"getDependencies\",C.Va);a.xb=function(b,c){if(\"function\"===typeof b)return a.o(b,\nc,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b(\"pureComputed\",a.xb);(function(){function b(a,f,g){g=g||new d;a=f(a);if(\"object\"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case \"boolean\":case \"number\":case \"string\":case \"function\":h[c]=d;break;case \"object\":case \"undefined\":var l=g.get(d);h[c]=l!==\nn?l:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);\"function\"==typeof a.toJSON&&b(\"toJSON\")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.ad=function(c){if(0==arguments.length)throw Error(\"When calling ko.toJS, pass the object you want to convert.\");return b(c,function(b){for(var c=0;a.O(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys,\nb);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b(\"toJS\",a.ad);a.b(\"toJSON\",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:\"always\"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return\"function\"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b(\"when\",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case \"option\":return!0===b.__ko__hasDomDataOptionValue__?\na.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode(\"value\")&&b.getAttributeNode(\"value\").specified?b.value:b.text:b.value;case \"select\":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case \"option\":\"string\"===typeof c?(a.a.g.set(b,a.c.options.$b,n),\"__ko__hasDomDataOptionValue__\"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value=\"number\"===\ntypeof c?c:\"\");break;case \"select\":if(\"\"===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.M(b.options[f]),h==c||\"\"===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===n)c=\"\";b.value=c}}}})();a.b(\"selectExtensions\",a.w);a.b(\"selectExtensions.readValue\",a.w.M);a.b(\"selectExtensions.writeValue\",a.w.cb);a.m=function(){function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,\n-1));b+=\"\\n,\";var c=[],d=b.match(e),p,q=[],h=0;if(1<d.length){for(var x=0,B;B=d[x];++x){var u=B.charCodeAt(0);if(44===u){if(0>=h){c.push(p&&q.length?{key:p,value:q.join(\"\")}:{unknown:p||q.join(\"\")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1<B.length&&(47===B.charCodeAt(1)||42===B.charCodeAt(1)))continue;else 47===u&&x&&1<B.length?(u=d[x-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),x=-1,B=\"/\"):40===u||123===u||91===u?++h:\n41===u||125===u||93===u?--h:p||q.length||34!==u&&39!==u||(B=B.slice(1,-1));q.push(B)}if(0<h)throw Error(\"Unbalanced parentheses, braces, or brackets\");}return c}var c=[\"true\",\"false\",\"null\",\"undefined\"],d=/^(?:[$_a-z][$\\w]*|(.+)(\\.\\s*[$_a-z][$\\w]*|\\[.+\\]))$/i,e=RegExp(\"\\\"(?:\\\\\\\\.|[^\\\"])*\\\"|'(?:\\\\\\\\.|[^'])*'|`(?:\\\\\\\\.|[^`])*`|/\\\\*(?:[^*]|\\\\*+[^*/])*\\\\*+/|//.*\\n|/(?:\\\\\\\\.|[^/])+/w*|[^\\\\s:,/][^,\\\"'`{}()/:[\\\\]]*[^\\\\s,\\\"'`{}()/:[\\\\]]|[^\\\\s]\",\"g\"),f=/[\\])\"'A-Za-z0-9_$]+$/,g={\"in\":1,\"return\":1,\"typeof\":1},\nh={};return{Ra:[],wa:h,ac:b,vb:function(e,f){function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.preprocess&&!(e=k.preprocess(e,b,l)))return;if(k=h[b])f=e,0<=a.a.A(c,f)?f=!1:(k=f.match(d),f=null===k?!1:k[1]?\"Object(\"+k[1]+\")\"+k[2]:f),k=f;k&&q.push(\"'\"+(\"string\"==typeof h[b]?h[b]:b)+\"':function(_z){\"+f+\"=_z}\")}g&&(e=\"function(){return \"+e+\" }\");p.push(\"'\"+b+\"':\"+e)}f=f||{};var p=[],q=[],g=f.valueAccessors,x=f.bindingParams,B=\"string\"===typeof e?b(e):e;a.a.D(B,function(a){l(a.key||a.unknown,\na.value)});q.length&&l(\"_ko_property_writers\",\"{\"+q.join(\",\")+\" }\");return p.join(\",\")},Id:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},eb:function(b,c,d,e,f){if(b&&a.O(b))!a.Za(b)||f&&b.v()===e||b(e);else if((b=c.get(\"_ko_property_writers\"))&&b[d])b[d](e)}}}();a.b(\"expressionRewriting\",a.m);a.b(\"expressionRewriting.bindingRewriteValidators\",a.m.Ra);a.b(\"expressionRewriting.parseObjectLiteral\",a.m.ac);a.b(\"expressionRewriting.preProcessBindings\",a.m.vb);a.b(\"expressionRewriting._twoWayBindings\",\na.m.wa);a.b(\"jsonExpressionRewriting\",a.m);a.b(\"jsonExpressionRewriting.insertPropertyAccessorsIntoJson\",a.m.vb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error(\"Cannot find closing comment tag to match: \"+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?\n0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&\"\\x3c!--test--\\x3e\"===w.createComment(\"test\").text,g=f?/^\\x3c!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*--\\x3e$/:/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/,h=f?/^\\x3c!--\\s*\\/ko\\s*--\\x3e$/:/^\\s*\\/ko\\s*$/,m={ul:!0,ol:!0},k=\"__ko_matchedEndComment__\";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Tb(c)},va:function(c,d){if(b(c)){a.h.Ea(c);for(var e=\nc.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.va(c,d)},Vc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Wb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.h.Vc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error(\"Found invalid end comment, as the first child of \"+\na);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,k))throw Error(\"Found end comment without a matching opening comment, as child of \"+d);return null}return d.nextSibling},Cd:b,Vd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Sc:function(d){if(m[a.a.R(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=\ng:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b(\"virtualElements\",a.h);a.b(\"virtualElements.allowedBindings\",a.h.ea);a.b(\"virtualElements.emptyNode\",a.h.Ea);a.b(\"virtualElements.insertAfter\",a.h.Wb);a.b(\"virtualElements.prepend\",a.h.Vc);a.b(\"virtualElements.setDomNodeChildren\",a.h.va);(function(){a.ga=function(){this.nd={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=\nb.getAttribute(\"data-bind\")||a.j.getComponentNameForNode(b);case 8:return a.h.Cd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.tc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.tc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute(\"data-bind\");case 8:return a.h.Vd(b);default:return null}},\nparseBindingsString:function(b,c,d,e){try{var f=this.nd,g=b+(e&&e.valueAccessors||\"\"),h;if(!(h=f[g])){var m,k=\"with($context){with($data||{}){return{\"+a.m.vb(b,e)+\"}}}\";m=new Function(\"$context\",\"$element\",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message=\"Unable to parse bindings.\\nBindings value: \"+b+\"\\nMessage: \"+l.message,l;}}});a.ga.instance=new a.ga})();a.b(\"bindingProvider\",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}function c(c,d,e){this.node=c;this.yc=\nd;this.kb=[];this.H=!1;d.N||a.a.K.za(c,b);e&&e.N&&(e.N.kb.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return\"function\"===typeof b?f(b.bind(null,c,e)):a.a.Ga(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.h.nextSibling(e),l.call(f,e);\nd=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),k(b,e)}a.i.ma(c,a.i.H)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.R(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.D(k.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error(\"Cannot combine the following bindings, because they have a cyclic dependency: \"+e.join(\", \"));\nca(c)}}),e.length--),c.push({key:f,Mc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error(\"You cannot apply bindings multiple times to the same element.\");f.hd=!0}k||(f.context=d);f.Zb||(f.Zb={});var g;if(c&&\"function\"!==typeof c)g=c;else{var p=a.ga.instance,q=p.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):q.call(p,b,d)){if(d[t])d[t]();if(d[B])d[B]()}return g},null,{l:b});g&&m.ja()||(m=null)}var x=d,u;if(g){var J=function(){return a.a.Ga(m?m():\ng,e)},r=m?function(a){return function(){return e(m()[a])}}:function(a){return g[a]};J.get=function(a){return g[a]&&e(r(a))};J.has=function(a){return a in g};a.i.H in g&&a.i.subscribe(b,a.i.H,function(){var c=(0,g[a.i.H])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Ec(d[0]))}});a.i.pa in g&&(x=a.i.Cb(b,d),a.i.subscribe(b,a.i.pa,function(){var c=(0,g[a.i.pa])();c&&a.h.firstChild(b)&&c(b)}));f=l(g);a.a.D(f,function(c){var d=c.Mc.init,e=c.Mc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error(\"The binding '\"+\nf+\"' cannot be used with virtual elements\");try{\"function\"==typeof d&&a.u.G(function(){var a=d(b,r(f),J,x.$data,x);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error(\"Multiple bindings (\"+u+\" and \"+f+\") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.\");u=f}}),\"function\"==typeof e&&a.$(function(){e(b,r(f),J,x.$data,x)},null,{l:b})}catch(k){throw k.message='Unable to process binding \"'+f+\": \"+g[f]+'\"\\nMessage: '+k.message,\nk;}})}f=u===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&x}}function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}var t=a.a.Da(\"_subscribable\"),x=a.a.Da(\"_ancestorBindingInfo\"),B=a.a.Da(\"_dataDependency\");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.fa=function(b,c,d,e,f){function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c[x])):(l.$parents=[],l.$root=f,l.ko=a);l[t]=q;g?f=l.$data:(l.$rawData=\nb,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[t]&&!a.S.o().Vb(c[t]))c[t]();m&&(l[B]=m);return l.$data}var l=this,g=b===J,h=g?n:b,p=\"function\"==typeof h&&!a.O(h),q,m=f&&f.dataDependency;f&&f.exportDependencies?k():(q=a.xb(k),q.v(),q.ja()?q.equalityComparer=null:l[t]=n)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&\"object\"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f=\"function\"==typeof b&&!a.O(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,\nthis,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,\"function\"==typeof b?b(c):b)},c)};var z=a.a.g.Z();c.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};c.prototype.sd=function(b){a.a.Pa(this.kb,b);!this.kb.length&&this.H&&this.Cc()};c.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=\nnull,a.a.K.yb(this.node,b),a.i.ma(this.node,a.i.pa),this.Tc())};a.i={H:\"childrenComplete\",pa:\"descendantsComplete\",subscribe:function(b,c,d,e,f){var k=a.a.g.Ub(b,z,{});k.Fa||(k.Fa=new a.T);f&&f.notifyImmediately&&k.Zb[c]&&a.u.G(d,e,[b]);return k.Fa.subscribe(d,e,c)},ma:function(b,c){var d=a.a.g.get(b,z);if(d&&(d.Zb[c]=!0,d.Fa&&d.Fa.notifySubscribers(b,c),c==a.i.H))if(d.N)d.N.Cc();else if(d.N===n&&d.Fa&&d.Fa.Wa(a.i.pa))throw Error(\"descendantsComplete event not supported for bindings on this node\");\n},Cb:function(b,d){var e=a.a.g.Ub(b,z,{});e.N||(e.N=new c(b,e,d[x]));return d[x]==e?d:d.extend(function(a){a[x]=e})}};a.Td=function(b){return(b=a.a.g.get(b,z))&&b.context};a.ib=function(b,c,d){1===b.nodeType&&a.h.Sc(b);return p(b,c,q(d))};a.ld=function(b,c,d){d=q(d);return a.ib(b,g(c,d,b),d)};a.Oa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(q(a),b)};a.vc=function(a,b,c){!v&&A.jQuery&&(v=A.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error(\"ko.applyBindings: could not find document.body; has the document been loaded?\");\n}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error(\"ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node\");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b(\"bindingHandlers\",a.c);a.b(\"bindingEvent\",a.i);a.b(\"bindingEvent.subscribe\",a.i.subscribe);a.b(\"bindingEvent.startPossiblyAsyncContentBinding\",a.i.Cb);a.b(\"applyBindings\",a.vc);a.b(\"applyBindingsToDescendants\",a.Oa);\na.b(\"applyBindingAccessorsToNode\",a.ib);a.b(\"applyBindingsToNode\",a.ld);a.b(\"contextFor\",a.Dc);a.b(\"dataFor\",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e(\"getConfig\",[a],function(c){c?e(\"loadComponent\",[a,c],function(a){b(a,\nc)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error(\"Component loaders must supply values by invoking the callback, not by returning values synchronously.\");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}):\na.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b(\"components\",a.j);a.b(\"components.get\",a.j.get);a.b(\"components.clearCachedDefinition\",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc(\"loadTemplate\",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc(\"loadViewModel\",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if(\"function\"===typeof b)d(function(a){return new b(a)});\nelse if(\"function\"===typeof b[m])d(b[m]);else if(\"instance\"in b){var e=b.instance;d(function(){return e})}else\"viewModel\"in b?c(a,b.viewModel,d):a(\"Unknown viewModel value: \"+b)}function d(b){switch(a.a.R(b)){case \"script\":return a.a.ua(b.text);case \"textarea\":return a.a.ua(b.value);case \"template\":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){\"string\"===typeof b.require?\nT||A.require?(T||A.require)([b.require],function(a){a&&\"object\"===typeof a&&a.Xd&&a[\"default\"]&&(a=a[\"default\"]);c(a)}):a(\"Uses require, but no AMD loader is present\"):c(b)}function g(a){return function(b){throw Error(\"Component '\"+a+\"': \"+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error(\"Invalid configuration for \"+b);if(a.j.tb(b))throw Error(\"Component \"+b+\" is already registered\");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];\na.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if(\"string\"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if(\"string\"===typeof c){var h=w.getElementById(c);h?f(d(h)):b(\"Cannot find element with ID \"+c)}else b(\"Unknown element type: \"+\nc);else b(\"Unknown template value: \"+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m=\"createViewModel\";a.b(\"components.register\",a.j.register);a.b(\"components.isRegistered\",a.j.tb);a.b(\"components.unregister\",a.j.unregister);a.b(\"components.defaultLoader\",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute(\"params\");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f,\nfunction(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,\"$raw\")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf(\"-\")||\"[object HTMLUnknownElement]\"==\"\"+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the \"component\" binding on a custom element matching a component');\nvar m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error(\"Component '\"+b+\"' has no template\");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,\nb,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;\"function\"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;\"string\"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error(\"No component name specified\");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error(\"Unknown component '\"+h+\"'\");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t});\nd=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={\"class\":\"className\",\"for\":\"htmlFor\"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(\":\"),g=\"lookupNamespaceURI\"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===\nd||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));\"name\"===c&&a.a.Yc(b,h?\"\":d)})}};(function(){a.c.checked={after:[\"value\",\"attr\"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k,\nd,\"checked\",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has(\"checkedValue\"))return a.a.f(d.get(\"checkedValue\"));if(q)return d.has(\"value\")?a.a.f(d.get(\"value\")):b.value}),h=\"checkbox\"==b.type,m=\"radio\"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,\"click\",e);a.o(f,null,{l:b});\nk=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c[\"class\"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&\"object\"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c[\"class\"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute(\"disabled\"):d||b.disabled||(b.disabled=!0)}};a.c.disable=\n{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){\"string\"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+\"Bubble\")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c);\nif(!d||\"number\"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=\n!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if(\"activeElement\"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,\"hasfocus\",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,\"focus\",f);a.a.B(b,\"focusin\",f);a.a.B(b,\"blur\",g);a.a.B(b,\"focusout\",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===\nd||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?\"focusin\":\"focusout\"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus=\"hasfocus\";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get(\"as\");var u=h.get(\"noChildContext\");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t=\n\"render\"==h.get(\"completeOn\"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext(\"function\"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b(\"if\");b(\"ifnot\",!1,!0);b(\"with\",!0)})();a.c.let={init:function(b,\nc,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if(\"select\"!==a.a.R(b))throw Error(\"options binding applies only to SELECT elements\");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.jb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return\"function\"==d?b(a):\"string\"==d?a[b]:c}function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=\n0<=a.a.A(t,a.w.M(d[0]));a.a.Zc(d[0],e);x&&!e&&a.u.G(a.a.Fb,null,[b,\"change\"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.f(c()),l=d.get(\"valueAllowUnset\")&&d.has(\"value\"),p=d.get(\"optionsIncludeDestroyed\");c={};var q,t=[];l||(h?t=a.a.Mb(e(),a.w.M):0<=b.selectedIndex&&t.push(a.w.M(b.options[b.selectedIndex])));k&&(\"undefined\"==typeof k.length&&(k=[k]),q=a.a.jb(k,function(b){return p||b===n||null===b||!a.a.f(b._destroy)}),d.has(\"optionsCaption\")&&(k=a.a.f(d.get(\"optionsCaption\")),null!==\nk&&k!==n&&q.unshift(Q)));var x=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has(\"optionsAfterRender\")&&\"function\"==typeof d.get(\"optionsAfterRender\")&&(k=function(b,c){g(0,c);a.u.G(d.get(\"optionsAfterRender\"),null,[c[0],b!==Q?b:n])});a.a.ec(b,q,function(c,e,g){g.length&&(t=!l&&g[0].selected?[a.w.M(g[0])]:[],x=!0);e=b.ownerDocument.createElement(\"option\");c===Q?(a.a.Bb(e,d.get(\"optionsCaption\")),a.w.cb(e,n)):(g=f(c,d.get(\"optionsValue\"),c),a.w.cb(e,a.a.f(g)),c=f(c,d.get(\"optionsText\"),g),\na.a.Bb(e,c));return[e]},c,k);if(!l){var B;h?B=t.length&&e().length<t.length:B=t.length&&0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex])!==t[0]:t.length||0<=b.selectedIndex;B&&a.u.G(a.a.Fb,null,[b,\"change\"])}(l||a.S.Ya())&&a.i.ma(b,a.i.H);a.a.wd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.$b=a.a.g.Z();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName(\"option\"),function(b){b.selected&&f.push(a.w.M(b))});a.m.eb(e,d,\"selectedOptions\",\nf)}function f(){var d=a.a.f(c()),e=b.scrollTop;d&&\"number\"==typeof d.length&&a.a.D(b.getElementsByTagName(\"option\"),function(b){var c=0<=a.a.A(d,a.w.M(b));b.selected!=c&&a.a.Zc(b,c)});b.scrollTop=e}if(\"select\"!=a.a.R(b))throw Error(\"selectedOptions binding applies only to SELECT elements\");var g;a.i.subscribe(b,a.i.H,function(){g?e():(a.a.B(b,\"change\",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.wa.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.f(c()||\n{});a.a.P(d,function(c,d){d=a.a.f(d);if(null===d||d===n||!1===d)d=\"\";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+\"px\")}})}};a.c.submit={init:function(b,c,d,e,f){if(\"function\"!=typeof c())throw Error(\"The value for a submit binding must be a function\");a.a.B(b,\"submit\",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?\na.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Bb(b,c())}};a.h.ea.text=!0;(function(){if(A&&A.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=A.navigator.userAgent,d,e,f,g,h;(d=A.opera&&A.opera.version&&parseInt(A.opera.version()))||(h=b(c.match(/Edge\\/([^ ]+)$/)))||b(c.match(/Chrome\\/([^ ]+)/))||(e=b(c.match(/Version\\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||\n(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,\"selectionchange\",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d=\"\";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z,\n4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,\"textInput\",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l(\"keypress\",z);11>g&&l(\"propertychange\",function(a){y||\"value\"!==a.propertyName||A(a)});8==g&&(l(\"keyup\",z),l(\"keydown\",z));p&&(p(b,A),l(\"dragend\",r));(!g||9<=g)&&l(\"input\",A);5>e&&\"textarea\"===a.a.R(b)?(l(\"keydown\",r),l(\"paste\",r),l(\"cut\",r)):11>d?l(\"keydown\",r):4>f?(l(\"DOMAutoComplete\",z),l(\"dragdrop\",z),l(\"drop\",z)):h&&\"number\"===b.type&&l(\"keydown\",r);l(\"change\",\nz);l(\"blur\",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c(\"textInput\",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d=\"ko_unique_\"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has(\"as\")&&(g={as:d.get(\"as\"),noChildContext:d.get(\"noChildContext\")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f=\"input\"==\ne;if(!f||\"checkbox\"!=b.type&&\"radio\"!=b.type){var g=[],h=d.get(\"valueUpdate\"),m=!1,k=null;h&&(\"string\"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,\"change\"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,\"value\",f)};!a.a.W||!f||\"text\"!=b.type||\"off\"==b.autocomplete||b.form&&\"off\"==b.form.autocomplete||-1!=a.a.A(g,\"propertychange\")||(a.a.B(b,\"propertychange\",function(){m=!0}),a.a.B(b,\"focus\",function(){m=!1}),a.a.B(b,\"blur\",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,\"after\")&&\n(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&\"file\"==b.type?function(){var d=a.a.f(c());null===d||d===n||\"\"===d?b.value=\"\":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)\"select\"===e?(g=d.get(\"valueAllowUnset\"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if(\"select\"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get(\"valueAllowUnset\")?p():l():(a.a.B(b,\"change\",l),q=a.o(p,null,{l:b}))},\nnull,{notifyImmediately:!0})}else a.a.B(b,\"change\",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e=\"none\"!=b.style.display;d&&!e?b.style.display=\"\":!d&&e&&(b.style.display=\"none\")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})(\"click\");\na.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error(\"Override renderTemplateSource\");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error(\"Override createJavaScriptEvaluatorBlock\");};a.ca.prototype.makeTemplateSource=function(b,c){if(\"string\"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error(\"Cannot find template with ID \"+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error(\"Unknown template type: \"+b);};a.ca.prototype.renderTemplate=\nfunction(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data(\"isRewritten\")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data(\"isRewritten\",!0)};a.b(\"templateEngine\",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,\nl)){var p=m[l];if(\"function\"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error(\"This template engine does not support the '\"+l+\"' binding within its templates\");}}d=\"ko.__tr_ambtns(function($context,$element){return(function(){return{ \"+a.m.vb(b,{valueAccessors:!0})+\" } })()},'\"+d.toLowerCase()+\"')\";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\\d*)(?:\\s+(?!data-bind\\s*=\\s*)[a-z0-9\\-]+(?:=(?:\\\"[^\\\"]*\\\"|\\'[^\\']*\\'|[^>]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi,\nd=/\\x3c!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*--\\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,\"\\x3c!-- ko --\\x3e\",\"#comment\",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b(\"__tr_ambtns\",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c=\na.a.R(b);this.ab=\"script\"===c?1:\"textarea\"===c?2:\"template\"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?\"text\":2===this.ab?\"value\":\"innerHTML\";if(0==arguments.length)return this.F[b];var c=arguments[0];\"innerHTML\"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+\"_\";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F;\nif(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text(\"\");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F,\nc,{bb:arguments[0]})};a.b(\"templateSources\",a.C);a.b(\"templateSources.domElement\",a.C.F);a.b(\"templateSources.anonymousTemplate\",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):\n(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.templateEngine||g;a.kc.xd(f,B,n);f=B.renderTemplate(f,h,m,n);if(\"number\"!=typeof f.length||0<f.length&&\"number\"!=typeof f[0].nodeType)throw Error(\"Template engine must return an array of DOM nodes\");n=!1;switch(e){case \"replaceChildren\":a.h.va(b,\nf);n=!0;break;case \"replaceNode\":a.a.Xc(b,f);n=!0;break;case \"ignoreTargetNode\":break;default:throw Error(\"Unknown renderMode: \"+e);}n&&(c(f,h),m.afterRender&&a.u.G(m.afterRender,null,[f,h[m.as||\"$data\"]]),\"replaceChildren\"==e&&a.i.ma(b,a.i.H));return f}function f(b,c,d){return a.O(b)?b():\"function\"===typeof b?b(c,d):b}var g;a.gc=function(b){if(b!=n&&!(b instanceof a.ca))throw Error(\"templateEngine must inherit from ko.templateEngine\");g=b};a.dc=function(b,c,h,m,t){h=h||{};if((h.templateEngine||g)==\nn)throw Error(\"Set a template engine before calling renderTemplate\");t=t||\"replaceChildren\";if(m){var x=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(m,t,n,g,h);\"replaceNode\"==t&&(m=g,x=d(m))},null,{Sa:function(){return!x||!a.a.Sb(x)},l:x&&\"replaceNode\"==t?x.parentNode:x})}return a.aa.Xb(function(d){a.dc(b,c,h,d,\"replaceNode\")})};a.Qd=function(b,d,g,h,m){function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}\nfunction r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildContext,extend:function(a){a.$index=c;z&&(a[z+\"Index\"]=c)}});var d=f(b,a,v);return e(h,\"ignoreTargetNode\",d,v,g)}var v,z=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Pc(d))return a.$(function(){var b=a.a.f(d)||[];\"undefined\"==typeof b.length&&(b=[b]);w&&(b=a.a.jb(b,function(b){return b===n||null===b||\n!a.a.f(b._destroy)}));x(b)},null,{l:h});x(d.v());var A=d.subscribe(function(a){x(d(),a)},null,\"arrayChange\");A.l(h);return A};var h=a.a.g.Z(),m=a.a.g.Z();a.c.template={init:function(b,c){var d=a.a.f(c());if(\"string\"==typeof d||\"name\"in d)a.h.Ea(b);else if(\"nodes\"in d){d=d.nodes||[];if(a.O(d))throw Error('The \"nodes\" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Yb(d),a.a.g.set(e,m,!0));(new a.C.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=\na.a.Yb(d),(new a.C.ia(b)).nodes(e);else throw Error(\"Anonymous template defined, but no template content was provided\");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.f(g);d=!0;e=null;\"string\"==typeof c?c={}:(g=\"name\"in c?c.name:b,\"if\"in c&&(d=a.a.f(c[\"if\"])),d&&\"ifnot\"in c&&(d=!a.a.f(c.ifnot)),d&&!g&&(d=!1));\"foreach\"in c?e=a.Qd(g,d&&c.foreach||[],c,b,f):d?(d=f,\"data\"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),\ne=a.dc(g,d,c,b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&\"function\"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?n:f)}};a.m.Ra.template=function(b){b=a.m.ac(b);return 1==b.length&&b[0].unknown||a.m.Id(b,\"name\")?null:\"This template engine does not support anonymous templates nested within its templates\"};a.h.ea.template=!0})();a.b(\"setTemplateEngine\",a.gc);a.b(\"renderTemplate\",a.dc);a.a.Kc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===\nm.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Pb=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d.length,r=n-p||1,v=p+n+1,u,w,z;for(l=0;l<=p;l++)for(w=u,k.push(u=[]),z=h(n,l+r),q=m(0,l-1);q<=z;q++)u[q]=q?l?b[l-1]===d[q-1]?w[q-1]:h(w[q]||v,u[q-1]||v)+1:q+1:l+1;h=[];m=[];r=[];l=p;for(q=n;l||q;)n=k[l][q]-1,q&&n===k[l][q-1]?m.push(h[h.length]={status:e,value:d[--q],index:q}):l&&n===k[l-1][q]?r.push(h[h.length]={status:f,value:b[--l],index:l}):\n(--q,--l,g.sparse||h.push({status:\"retained\",value:d[q]}));a.a.Kc(r,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e=\"boolean\"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,\"added\",\"deleted\",e):b(d,a,\"deleted\",\"added\",e)}}();a.b(\"utils.compareArrays\",a.a.Pb);(function(){function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))||[];0<k.length&&(a.a.Xc(k,l),h&&a.u.G(h,null,[d,l,m]));k.length=0;a.a.Nb(k,l)},null,{l:b,Sa:function(){return!a.a.kd(k)}});\nreturn{Y:k,$:l.ja()?l:n}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.ec=function(e,f,g,h,m,k){function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.push(y)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];\"undefined\"==typeof f.length&&(f=[f]);h=h||{};var t=a.a.g.get(e,c),r=!t,v=[],u=0,w=0,z=[],A=[],C=[],D=[],F=[],y,I=0;if(r)a.a.D(f,l);else{if(!k||t&&t._countWaitingForRemove){var E=\na.a.Mb(t,function(a){return a.Aa});k=a.a.Pb(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=k[E];E++)switch(H=G.moved,K=G.index,G.status){case \"deleted\":for(;u<K;)p(u++);H===n&&(y=t[u],y.$&&(y.$.s(),y.$=n),a.a.Ua(y.Y,e).length&&(h.beforeRemove&&(v.push(y),I++,y.Aa===d?y=null:C.push(y)),y&&z.push.apply(z,y.Y)));u++;break;case \"added\":for(;w<K;)p(u++);H!==n?(A.push(v.length),p(H)):l(G.value)}for(;w<f.length;)p(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);q(h.beforeMove,D);a.a.D(z,\nh.beforeRemove?a.oa:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(A.length)for(;(E=A.shift())!=n;){y=v[E];for(M=n;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M)}for(E=0;y=v[E];E++){y.Y||a.a.extend(y,b(e,g,y.Aa,m,y.pb));for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M);!y.Ed&&m&&(m(y.Aa,y.Y,y.pb),y.Ed=!0,M=y.Y[y.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();q(h.beforeRemove,C);for(E=0;E<C.length;++E)C[E].Aa=d;q(h.afterMove,D);\nq(h.afterAdd,F)}})();a.b(\"utils.setDomNodeChildrenFromArrayMapping\",a.a.ec);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b(\"nativeTemplateEngine\",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf(\"__\"))return 2}catch(a){}return 1}();\nthis.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");var h=b.data(\"precompiled\");h||(h=b.text()||\"\",h=v.template(null,\"{{ko_with $item.koBindingContext}}\"+h+\"{{/ko_with}}\"),b.data(\"precompiled\",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement(\"div\"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return\"{{ko_code ((function() { return \"+\na+\" })()) }}\"};this.addTemplate=function(a,b){w.write(\"<script type='text/html' id='\"+a+\"'>\"+b+\"\\x3c/script>\")};0<a&&(v.tmpl.tag.ko_code={open:\"__.push($1 || '');\"},v.tmpl.tag.ko_with={open:\"with($1) {\",close:\"} \"})};a.$a.prototype=new a.ca;a.$a.prototype.constructor=a.$a;var b=new a.$a;0<b.Hd&&a.gc(b);a.b(\"jqueryTmplTemplateEngine\",a.$a)})()})})();})();\n\n})();\n\n// Avoid polluting the global scope.\nvar knockout = ko;\nif (typeof window !== 'undefined') {\n ko = window.ko;\n if (typeof oldValue !== 'undefined') {\n window.ko = oldValue;\n } else {\n delete window.ko;\n }\n} else {\n ko = global.ko;\n if (typeof oldValue !== 'undefined') {\n global.ko = oldValue;\n } else {\n delete global.ko;\n }\n}\n\nexport default knockout;\n", "/**\n * @license\n * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5\n * Copyright (c) Steve Sanderson\n * MIT license\n */\n\n var OBSERVABLES_PROPERTY = '__knockoutObservables';\n var SUBSCRIBABLE_PROPERTY = '__knockoutSubscribable';\n\n // Model tracking\n // --------------\n //\n // This is the central feature of Knockout-ES5. We augment model objects by converting properties\n // into ES5 getter/setter pairs that read/write an underlying Knockout observable. This means you can\n // use plain JavaScript syntax to read/write the property while still getting the full benefits of\n // Knockout's automatic dependency detection and notification triggering.\n //\n // For comparison, here's Knockout ES3-compatible syntax:\n //\n // var firstNameLength = myModel.user().firstName().length; // Read\n // myModel.user().firstName('Bert'); // Write\n //\n // ... versus Knockout-ES5 syntax:\n //\n // var firstNameLength = myModel.user.firstName.length; // Read\n // myModel.user.firstName = 'Bert'; // Write\n\n // `ko.track(model)` converts each property on the given model object into a getter/setter pair that\n // wraps a Knockout observable. Optionally specify an array of property names to wrap; otherwise we\n // wrap all properties. If any of the properties are already observables, we replace them with\n // ES5 getter/setter pairs that wrap your original observable instances. In the case of readonly\n // ko.computed properties, we simply do not define a setter (so attempted writes will be ignored,\n // which is how ES5 readonly properties normally behave).\n //\n // By design, this does *not* recursively walk child object properties, because making literally\n // everything everywhere independently observable is usually unhelpful. When you do want to track\n // child object properties independently, define your own class for those child objects and put\n // a separate ko.track call into its constructor --- this gives you far more control.\n function track(obj, propertyNames) {\n if (!obj /*|| typeof obj !== 'object'*/) {\n throw new Error('When calling ko.track, you must pass an object as the first parameter.');\n }\n\n var ko = this,\n allObservablesForObject = getAllObservablesForObject(obj, true);\n propertyNames = propertyNames || Object.getOwnPropertyNames(obj);\n\n propertyNames.forEach(function(propertyName) {\n // Skip storage properties\n if (propertyName === OBSERVABLES_PROPERTY || propertyName === SUBSCRIBABLE_PROPERTY) {\n return;\n }\n // Skip properties that are already tracked\n if (propertyName in allObservablesForObject) {\n return;\n }\n\n var origValue = obj[propertyName],\n isArray = origValue instanceof Array,\n observable = ko.isObservable(origValue) ? origValue\n : isArray ? ko.observableArray(origValue)\n : ko.observable(origValue);\n\n Object.defineProperty(obj, propertyName, {\n configurable: true,\n enumerable: true,\n get: observable,\n set: ko.isWriteableObservable(observable) ? observable : undefined\n });\n\n allObservablesForObject[propertyName] = observable;\n\n if (isArray) {\n notifyWhenPresentOrFutureArrayValuesMutate(ko, observable);\n }\n });\n\n return obj;\n }\n\n // Gets or creates the hidden internal key-value collection of observables corresponding to\n // properties on the model object.\n function getAllObservablesForObject(obj, createIfNotDefined) {\n var result = obj[OBSERVABLES_PROPERTY];\n if (!result && createIfNotDefined) {\n result = {};\n Object.defineProperty(obj, OBSERVABLES_PROPERTY, {\n value : result\n });\n }\n return result;\n }\n\n // Computed properties\n // -------------------\n //\n // The preceding code is already sufficient to upgrade ko.computed model properties to ES5\n // getter/setter pairs (or in the case of readonly ko.computed properties, just a getter).\n // These then behave like a regular property with a getter function, except they are smarter:\n // your evaluator is only invoked when one of its dependencies changes. The result is cached\n // and used for all evaluations until the next time a dependency changes).\n //\n // However, instead of forcing developers to declare a ko.computed property explicitly, it's\n // nice to offer a utility function that declares a computed getter directly.\n\n // Implements `ko.defineProperty`\n function defineComputedProperty(obj, propertyName, evaluatorOrOptions) {\n var ko = this,\n computedOptions = { owner: obj, deferEvaluation: true };\n\n if (typeof evaluatorOrOptions === 'function') {\n computedOptions.read = evaluatorOrOptions;\n } else {\n if ('value' in evaluatorOrOptions) {\n throw new Error('For ko.defineProperty, you must not specify a \"value\" for the property. You must provide a \"get\" function.');\n }\n\n if (typeof evaluatorOrOptions.get !== 'function') {\n throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called \"get\".');\n }\n\n computedOptions.read = evaluatorOrOptions.get;\n computedOptions.write = evaluatorOrOptions.set;\n }\n\n obj[propertyName] = ko.computed(computedOptions);\n track.call(ko, obj, [propertyName]);\n return obj;\n }\n\n // Array handling\n // --------------\n //\n // Arrays are special, because unlike other property types, they have standard mutator functions\n // (`push`/`pop`/`splice`/etc.) and it's desirable to trigger a change notification whenever one of\n // those mutator functions is invoked.\n //\n // Traditionally, Knockout handles this by putting special versions of `push`/`pop`/etc. on observable\n // arrays that mutate the underlying array and then trigger a notification. That approach doesn't\n // work for Knockout-ES5 because properties now return the underlying arrays, so the mutator runs\n // in the context of the underlying array, not any particular observable:\n //\n // // Operates on the underlying array value\n // myModel.someCollection.push('New value');\n //\n // To solve this, Knockout-ES5 detects array values, and modifies them as follows:\n // 1. Associates a hidden subscribable with each array instance that it encounters\n // 2. Intercepts standard mutators (`push`/`pop`/etc.) and makes them trigger the subscribable\n // Then, for model properties whose values are arrays, the property's underlying observable\n // subscribes to the array subscribable, so it can trigger a change notification after mutation.\n\n // Given an observable that underlies a model property, watch for any array value that might\n // be assigned as the property value, and hook into its change events\n function notifyWhenPresentOrFutureArrayValuesMutate(ko, observable) {\n var watchingArraySubscription = null;\n ko.computed(function () {\n // Unsubscribe to any earlier array instance\n if (watchingArraySubscription) {\n watchingArraySubscription.dispose();\n watchingArraySubscription = null;\n }\n\n // Subscribe to the new array instance\n var newArrayInstance = observable();\n if (newArrayInstance instanceof Array) {\n watchingArraySubscription = startWatchingArrayInstance(ko, observable, newArrayInstance);\n }\n });\n }\n\n // Listens for array mutations, and when they happen, cause the observable to fire notifications.\n // This is used to make model properties of type array fire notifications when the array changes.\n // Returns a subscribable that can later be disposed.\n function startWatchingArrayInstance(ko, observable, arrayInstance) {\n var subscribable = getSubscribableForArray(ko, arrayInstance);\n return subscribable.subscribe(observable);\n }\n\n // Gets or creates a subscribable that fires after each array mutation\n function getSubscribableForArray(ko, arrayInstance) {\n var subscribable = arrayInstance[SUBSCRIBABLE_PROPERTY];\n if (!subscribable) {\n subscribable = new ko.subscribable();\n Object.defineProperty(arrayInstance, SUBSCRIBABLE_PROPERTY, {\n value : subscribable\n });\n\n var notificationPauseSignal = {};\n wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal);\n addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal);\n }\n\n return subscribable;\n }\n\n // After each array mutation, fires a notification on the given subscribable\n function wrapStandardArrayMutators(arrayInstance, subscribable, notificationPauseSignal) {\n ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].forEach(function(fnName) {\n var origMutator = arrayInstance[fnName];\n arrayInstance[fnName] = function() {\n var result = origMutator.apply(this, arguments);\n if (notificationPauseSignal.pause !== true) {\n subscribable.notifySubscribers(this);\n }\n return result;\n };\n });\n }\n\n // Adds Knockout's additional array mutation functions to the array\n function addKnockoutArrayMutators(ko, arrayInstance, subscribable, notificationPauseSignal) {\n ['remove', 'removeAll', 'destroy', 'destroyAll', 'replace'].forEach(function(fnName) {\n // Make it a non-enumerable property for consistency with standard Array functions\n Object.defineProperty(arrayInstance, fnName, {\n enumerable: false,\n value: function() {\n var result;\n\n // These additional array mutators are built using the underlying push/pop/etc.\n // mutators, which are wrapped to trigger notifications. But we don't want to\n // trigger multiple notifications, so pause the push/pop/etc. wrappers and\n // delivery only one notification at the end of the process.\n notificationPauseSignal.pause = true;\n try {\n // Creates a temporary observableArray that can perform the operation.\n result = ko.observableArray.fn[fnName].apply(ko.observableArray(arrayInstance), arguments);\n }\n finally {\n notificationPauseSignal.pause = false;\n }\n subscribable.notifySubscribers(arrayInstance);\n return result;\n }\n });\n });\n }\n\n // Static utility functions\n // ------------------------\n //\n // Since Knockout-ES5 sets up properties that return values, not observables, you can't\n // trivially subscribe to the underlying observables (e.g., `someProperty.subscribe(...)`),\n // or tell them that object values have mutated, etc. To handle this, we set up some\n // extra utility functions that can return or work with the underlying observables.\n\n // Returns the underlying observable associated with a model property (or `null` if the\n // model or property doesn't exist, or isn't associated with an observable). This means\n // you can subscribe to the property, e.g.:\n //\n // ko.getObservable(model, 'propertyName')\n // .subscribe(function(newValue) { ... });\n function getObservable(obj, propertyName) {\n if (!obj /*|| typeof obj !== 'object'*/) {\n return null;\n }\n\n var allObservablesForObject = getAllObservablesForObject(obj, false);\n return (allObservablesForObject && allObservablesForObject[propertyName]) || null;\n }\n\n // Causes a property's associated observable to fire a change notification. Useful when\n // the property value is a complex object and you've modified a child property.\n function valueHasMutated(obj, propertyName) {\n var observable = getObservable(obj, propertyName);\n\n if (observable) {\n observable.valueHasMutated();\n }\n }\n\n // Extends a Knockout instance with Knockout-ES5 functionality\n function attachToKo(ko) {\n ko.track = track;\n ko.getObservable = getObservable;\n ko.valueHasMutated = valueHasMutated;\n ko.defineProperty = defineComputedProperty;\n }\n\n export default {\n attachToKo : attachToKo\n };\n", "const svgNS = \"http://www.w3.org/2000/svg\";\nconst svgClassName = \"cesium-svgPath-svg\";\n\n/**\n * A Knockout binding handler that creates a DOM element for a single SVG path.\n * This binding handler will be registered as cesiumSvgPath.\n *\n * <p>\n * The parameter to this binding is an object with the following properties:\n * </p>\n *\n * <ul>\n * <li>path: The SVG path as a string.</li>\n * <li>width: The width of the SVG path with no transformations applied.</li>\n * <li>height: The height of the SVG path with no transformations applied.</li>\n * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>\n * </ul>\n *\n * @namespace SvgPathBindingHandler\n *\n * @example\n * // Create an SVG as a child of a div\n * <div data-bind=\"cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }\"></div>\n *\n * // parameters can be observable from the view model\n * <div data-bind=\"cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }\"></div>\n *\n * // or the whole object can be observable from the view model\n * <div data-bind=\"cesiumSvgPath: svgPathOptions\"></div>\n */\nconst SvgPathBindingHandler = {\n /**\n * @function\n */\n register: function (knockout) {\n knockout.bindingHandlers.cesiumSvgPath = {\n init: function (element, valueAccessor) {\n const svg = document.createElementNS(svgNS, \"svg:svg\");\n svg.setAttribute(\"class\", svgClassName);\n\n const pathElement = document.createElementNS(svgNS, \"path\");\n svg.appendChild(pathElement);\n\n knockout.virtualElements.setDomNodeChildren(element, [svg]);\n\n knockout.computed({\n read: function () {\n const value = knockout.unwrap(valueAccessor());\n\n pathElement.setAttribute(\"d\", knockout.unwrap(value.path));\n\n const pathWidth = knockout.unwrap(value.width);\n const pathHeight = knockout.unwrap(value.height);\n\n svg.setAttribute(\"width\", pathWidth);\n svg.setAttribute(\"height\", pathHeight);\n svg.setAttribute(\"viewBox\", `0 0 ${pathWidth} ${pathHeight}`);\n\n if (value.css) {\n svg.setAttribute(\n \"class\",\n `${svgClassName} ${knockout.unwrap(value.css)}`\n );\n }\n },\n disposeWhenNodeIsRemoved: element,\n });\n\n return {\n controlsDescendantBindings: true,\n };\n },\n };\n\n knockout.virtualElements.allowedBindings.cesiumSvgPath = true;\n },\n};\nexport default SvgPathBindingHandler;\n", "import knockout from './knockout-3.5.1.js';\nimport knockout_es5 from './knockout-es5.js';\nimport SvgPathBindingHandler from '../Widgets/SvgPathBindingHandler.js';\n\n// install the Knockout-ES5 plugin\nknockout_es5.attachToKo(knockout);\n\n// Register all Cesium binding handlers\nSvgPathBindingHandler.register(knockout);\n\nexport default knockout;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef MRT\\n\\\n#extension GL_EXT_draw_buffers : enable\\n\\\n#endif\\n\\\nuniform vec4 u_bgColor;\\n\\\nuniform sampler2D u_depthTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\\n\\\n{\\n\\\n#ifdef MRT\\n\\\ngl_FragData[0] = u_bgColor;\\n\\\ngl_FragData[1] = vec4(u_bgColor.a);\\n\\\n#else\\n\\\ngl_FragColor = u_bgColor;\\n\\\n#endif\\n\\\nreturn;\\n\\\n}\\n\\\ndiscard;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_radiiAndDynamicAtmosphereColor;\\n\\\nuniform float u_atmosphereLightIntensity;\\n\\\nuniform float u_atmosphereRayleighScaleHeight;\\n\\\nuniform float u_atmosphereMieScaleHeight;\\n\\\nuniform float u_atmosphereMieAnisotropy;\\n\\\nuniform vec3 u_atmosphereRayleighCoefficient;\\n\\\nuniform vec3 u_atmosphereMieCoefficient;\\n\\\nconst float ATMOSPHERE_THICKNESS = 111e3;\\n\\\nconst int PRIMARY_STEPS = 16;\\n\\\nconst int LIGHT_STEPS = 4;\\n\\\nvoid computeScattering(\\n\\\nczm_ray primaryRay,\\n\\\nfloat primaryRayLength,\\n\\\nvec3 lightDirection,\\n\\\nfloat atmosphereInnerRadius,\\n\\\nout vec3 rayleighColor,\\n\\\nout vec3 mieColor,\\n\\\nout float opacity\\n\\\n) {\\n\\\nrayleighColor = vec3(0.0);\\n\\\nmieColor = vec3(0.0);\\n\\\nopacity = 0.0;\\n\\\nfloat atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\\n\\\nvec3 origin = vec3(0.0);\\n\\\nczm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);\\n\\\nif (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {\\n\\\nreturn;\\n\\\n}\\n\\\nprimaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);\\n\\\nprimaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));\\n\\\nfloat rayStepLength = (primaryRayAtmosphereIntersect.stop - primaryRayAtmosphereIntersect.start) / float(PRIMARY_STEPS);\\n\\\nfloat rayPositionLength = primaryRayAtmosphereIntersect.start;\\n\\\nvec3 rayleighAccumulation = vec3(0.0);\\n\\\nvec3 mieAccumulation = vec3(0.0);\\n\\\nvec2 opticalDepth = vec2(0.0);\\n\\\nvec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);\\n\\\nfor (int i = 0; i < PRIMARY_STEPS; i++) {\\n\\\nvec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);\\n\\\nfloat sampleHeight = length(samplePosition) - atmosphereInnerRadius;\\n\\\nvec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;\\n\\\nopticalDepth += sampleDensity;\\n\\\nczm_ray lightRay = czm_ray(samplePosition, lightDirection);\\n\\\nczm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);\\n\\\nfloat lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);\\n\\\nfloat lightPositionLength = 0.0;\\n\\\nvec2 lightOpticalDepth = vec2(0.0);\\n\\\nfor (int j = 0; j < LIGHT_STEPS; j++) {\\n\\\nvec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);\\n\\\nfloat lightHeight = length(lightPosition) - atmosphereInnerRadius;\\n\\\nlightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;\\n\\\nlightPositionLength += lightStepLength;\\n\\\n}\\n\\\nvec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));\\n\\\nrayleighAccumulation += sampleDensity.x * attenuation;\\n\\\nmieAccumulation += sampleDensity.y * attenuation;\\n\\\nrayPositionLength += rayStepLength;\\n\\\n}\\n\\\nrayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;\\n\\\nmieColor = u_atmosphereMieCoefficient * mieAccumulation;\\n\\\nopacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));\\n\\\n}\\n\\\nvec4 computeAtmosphereColor(\\n\\\nvec3 positionWC,\\n\\\nvec3 lightDirection,\\n\\\nvec3 rayleighColor,\\n\\\nvec3 mieColor,\\n\\\nfloat opacity\\n\\\n) {\\n\\\nvec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\nvec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\nfloat cosAngle = dot(cameraToPositionWCDirection, lightDirection);\\n\\\nfloat cosAngleSq = cosAngle * cosAngle;\\n\\\nfloat G = u_atmosphereMieAnisotropy;\\n\\\nfloat GSq = G * G;\\n\\\nfloat rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);\\n\\\nfloat miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));\\n\\\nvec3 rayleigh = rayleighPhase * rayleighColor;\\n\\\nvec3 mie = miePhase * mieColor;\\n\\\nvec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;\\n\\\nreturn vec4(color, opacity);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec2 v_textureCoordinates;\\n\\\nconst float M_PI = 3.141592653589793;\\n\\\nfloat vdcRadicalInverse(int i)\\n\\\n{\\n\\\nfloat r;\\n\\\nfloat base = 2.0;\\n\\\nfloat value = 0.0;\\n\\\nfloat invBase = 1.0 / base;\\n\\\nfloat invBi = invBase;\\n\\\nfor (int x = 0; x < 100; x++)\\n\\\n{\\n\\\nif (i <= 0)\\n\\\n{\\n\\\nbreak;\\n\\\n}\\n\\\nr = mod(float(i), base);\\n\\\nvalue += r * invBi;\\n\\\ninvBi *= invBase;\\n\\\ni = int(float(i) * invBase);\\n\\\n}\\n\\\nreturn value;\\n\\\n}\\n\\\nvec2 hammersley2D(int i, int N)\\n\\\n{\\n\\\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\\n\\\n}\\n\\\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\\n\\\n{\\n\\\nfloat a = roughness * roughness;\\n\\\nfloat phi = 2.0 * M_PI * xi.x;\\n\\\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\\n\\\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\\n\\\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\\n\\\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\\n\\\nvec3 tangentX = normalize(cross(upVector, N));\\n\\\nvec3 tangentY = cross(N, tangentX);\\n\\\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\\n\\\n}\\n\\\nfloat G1_Smith(float NdotV, float k)\\n\\\n{\\n\\\nreturn NdotV / (NdotV * (1.0 - k) + k);\\n\\\n}\\n\\\nfloat G_Smith(float roughness, float NdotV, float NdotL)\\n\\\n{\\n\\\nfloat k = roughness * roughness / 2.0;\\n\\\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\\n\\\n}\\n\\\nvec2 integrateBrdf(float roughness, float NdotV)\\n\\\n{\\n\\\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\\n\\\nfloat A = 0.0;\\n\\\nfloat B = 0.0;\\n\\\nconst int NumSamples = 1024;\\n\\\nfor (int i = 0; i < NumSamples; i++)\\n\\\n{\\n\\\nvec2 xi = hammersley2D(i, NumSamples);\\n\\\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\\n\\\nvec3 L = 2.0 * dot(V, H) * H - V;\\n\\\nfloat NdotL = clamp(L.z, 0.0, 1.0);\\n\\\nfloat NdotH = clamp(H.z, 0.0, 1.0);\\n\\\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\\n\\\nif (NdotL > 0.0)\\n\\\n{\\n\\\nfloat G = G_Smith(roughness, NdotV, NdotL);\\n\\\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\\n\\\nfloat Fc = pow(1.0 - VdotH, 5.0);\\n\\\nA += (1.0 - Fc) * G_Vis;\\n\\\nB += Fc * G_Vis;\\n\\\n}\\n\\\n}\\n\\\nreturn vec2(A, B) / float(NumSamples);\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_noiseTexture;\\n\\\nuniform vec3 u_noiseTextureDimensions;\\n\\\nuniform float u_noiseDetail;\\n\\\nvarying vec2 v_offset;\\n\\\nvarying vec3 v_maximumSize;\\n\\\nvarying vec4 v_color;\\n\\\nvarying float v_slice;\\n\\\nvarying float v_brightness;\\n\\\nfloat wrap(float value, float rangeLength) {\\n\\\nif(value < 0.0) {\\n\\\nfloat absValue = abs(value);\\n\\\nfloat modValue = mod(absValue, rangeLength);\\n\\\nreturn mod(rangeLength - modValue, rangeLength);\\n\\\n}\\n\\\nreturn mod(value, rangeLength);\\n\\\n}\\n\\\nvec3 wrapVec(vec3 value, float rangeLength) {\\n\\\nreturn vec3(wrap(value.x, rangeLength),\\n\\\nwrap(value.y, rangeLength),\\n\\\nwrap(value.z, rangeLength));\\n\\\n}\\n\\\nfloat textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\nfloat noiseTextureRows = u_noiseTextureDimensions.y;\\n\\\nfloat inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\nfloat textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;\\n\\\nvec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,\\n\\\ninverseNoiseTextureRows / textureSliceWidth);\\n\\\nvec2 voxelToUV(vec3 voxelIndex) {\\n\\\nvec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);\\n\\\nfloat column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);\\n\\\nfloat row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);\\n\\\nfloat xPixelCoord = wrappedIndex.x + column * textureSliceWidth;\\n\\\nfloat yPixelCoord = wrappedIndex.y + row * textureSliceWidth;\\n\\\nreturn vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;\\n\\\n}\\n\\\nvec4 lerpSamplesX(vec3 voxelIndex, float x) {\\n\\\nvec2 uv0 = voxelToUV(voxelIndex);\\n\\\nvec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));\\n\\\nvec4 sample0 = texture2D(u_noiseTexture, uv0);\\n\\\nvec4 sample1 = texture2D(u_noiseTexture, uv1);\\n\\\nreturn mix(sample0, sample1, x);\\n\\\n}\\n\\\nvec4 sampleNoiseTexture(vec3 position) {\\n\\\nvec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);\\n\\\nvec3 lerpValue = fract(recenteredPos);\\n\\\nvec3 voxelIndex = floor(recenteredPos);\\n\\\nvec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);\\n\\\nvec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);\\n\\\nvec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);\\n\\\nvec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);\\n\\\nvec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);\\n\\\nvec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);\\n\\\nreturn mix(yLerp0, yLerp1, lerpValue.z);\\n\\\n}\\n\\\nbool intersectSphere(vec3 origin, vec3 dir, float slice,\\n\\\nout vec3 point, out vec3 normal) {\\n\\\nfloat A = dot(dir, dir);\\n\\\nfloat B = dot(origin, dir);\\n\\\nfloat C = dot(origin, origin) - 0.25;\\n\\\nfloat discriminant = (B * B) - (A * C);\\n\\\nif(discriminant < 0.0) {\\n\\\nreturn false;\\n\\\n}\\n\\\nfloat root = sqrt(discriminant);\\n\\\nfloat t = (-B - root) / A;\\n\\\nif(t < 0.0) {\\n\\\nt = (-B + root) / A;\\n\\\n}\\n\\\npoint = origin + t * dir;\\n\\\nif(slice >= 0.0) {\\n\\\npoint.z = (slice / 2.0) - 0.5;\\n\\\nif(length(point) > 0.5) {\\n\\\nreturn false;\\n\\\n}\\n\\\n}\\n\\\nnormal = normalize(point);\\n\\\npoint -= czm_epsilon2 * normal;\\n\\\nreturn true;\\n\\\n}\\n\\\nbool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,\\n\\\nout vec3 point, out vec3 normal) {\\n\\\nif(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {\\n\\\nreturn false;\\n\\\n}\\n\\\nvec3 o = (origin - center) / scale;\\n\\\nvec3 d = dir / scale;\\n\\\nvec3 p, n;\\n\\\nbool intersected = intersectSphere(o, d, slice, p, n);\\n\\\nif(intersected) {\\n\\\npoint = (p * scale) + center;\\n\\\nnormal = n;\\n\\\n}\\n\\\nreturn intersected;\\n\\\n}\\n\\\nvec2 phaseShift2D(vec2 p, vec2 freq) {\\n\\\nreturn (czm_pi / 2.0) * sin(freq.yx * p.yx);\\n\\\n}\\n\\\nvec2 phaseShift3D(vec3 p, vec2 freq) {\\n\\\nreturn phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));\\n\\\n}\\n\\\nconst float T0 = 0.6;\\n\\\nconst float k = 0.1;\\n\\\nconst float C0 = 0.8;\\n\\\nconst float FX0 = 0.6;\\n\\\nconst float FY0 = 0.6;\\n\\\nconst int octaves = 5;\\n\\\nfloat T(vec3 point) {\\n\\\nvec2 sum = vec2(0.0);\\n\\\nfloat Ci = C0;\\n\\\nvec2 FXY = vec2(FX0, FY0);\\n\\\nvec2 PXY = vec2(0.0);\\n\\\nfor(int i = 1; i <= octaves; i++) {\\n\\\nPXY = phaseShift3D(point, FXY);\\n\\\nCi *= 0.707;\\n\\\nFXY *= 2.0;\\n\\\nvec2 sinTerm = sin(FXY * point.xy + PXY);\\n\\\nsum += Ci * sinTerm + vec2(T0);\\n\\\n}\\n\\\nreturn k * sum.x * sum.y;\\n\\\n}\\n\\\nconst float a = 0.5;\\n\\\nconst float t = 0.4;\\n\\\nconst float s = 0.25;\\n\\\nfloat I(float Id, float Is, float It) {\\n\\\nreturn (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;\\n\\\n}\\n\\\nconst vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));\\n\\\nvec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,\\n\\\nfloat brightness) {\\n\\\nvec3 cloudPoint, cloudNormal;\\n\\\nif(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,\\n\\\ncloudPoint, cloudNormal)) {\\n\\\nreturn vec4(0.0);\\n\\\n}\\n\\\nfloat Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);\\n\\\nfloat Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);\\n\\\nfloat It = T(cloudPoint);\\n\\\nfloat intensity = I(Id, Is, It);\\n\\\nvec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));\\n\\\nvec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);\\n\\\nfloat W = noise.x;\\n\\\nfloat W2 = noise.y;\\n\\\nfloat W3 = noise.z;\\n\\\nfloat ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);\\n\\\nfloat TR = pow(ndDot, 3.0) - W;\\n\\\nTR *= 1.3;\\n\\\nfloat minusDot = 0.5 - ndDot;\\n\\\nTR -= min(minusDot * W2, 0.0);\\n\\\nTR -= 0.8 * (minusDot + 0.25) * W3;\\n\\\nfloat shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);\\n\\\nshading = clamp(shading + 0.2, 0.3, 1.0);\\n\\\nvec3 finalColor = mix(vec3(0.5), shading * color, 1.15);\\n\\\nreturn vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;\\n\\\n}\\n\\\nvoid main() {\\n\\\n#ifdef DEBUG_BILLBOARDS\\n\\\ngl_FragColor = vec4(0.0, 0.5, 0.5, 1.0);\\n\\\n#endif\\n\\\nvec2 coordinate = v_maximumSize.xy * v_offset;\\n\\\nvec3 ellipsoidScale = 0.82 * v_maximumSize;\\n\\\nvec3 ellipsoidCenter = vec3(0.0);\\n\\\nfloat zOffset = max(ellipsoidScale.z - 10.0, 0.0);\\n\\\nvec3 eye = vec3(0, 0, -10.0 - zOffset);\\n\\\nvec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);\\n\\\nvec3 rayOrigin = eye;\\n\\\n#ifdef DEBUG_ELLIPSOIDS\\n\\\nvec3 point, normal;\\n\\\nif(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,\\n\\\npoint, normal)) {\\n\\\ngl_FragColor = v_brightness * v_color;\\n\\\n}\\n\\\n#else\\n\\\n#ifndef DEBUG_BILLBOARDS\\n\\\nvec4 cloud = drawCloud(rayOrigin, rayDir,\\n\\\nellipsoidCenter, ellipsoidScale, v_slice, v_brightness);\\n\\\nif(cloud.w < 0.01) {\\n\\\ndiscard;\\n\\\n}\\n\\\ngl_FragColor = cloud;\\n\\\n#endif\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef INSTANCED\\n\\\nattribute vec2 direction;\\n\\\n#endif\\n\\\nattribute vec4 positionHighAndScaleX;\\n\\\nattribute vec4 positionLowAndScaleY;\\n\\\nattribute vec4 packedAttribute0;\\n\\\nattribute vec4 packedAttribute1;\\n\\\nattribute vec4 color;\\n\\\nvarying vec2 v_offset;\\n\\\nvarying vec3 v_maximumSize;\\n\\\nvarying vec4 v_color;\\n\\\nvarying float v_slice;\\n\\\nvarying float v_brightness;\\n\\\nvoid main() {\\n\\\nvec3 positionHigh = positionHighAndScaleX.xyz;\\n\\\nvec3 positionLow = positionLowAndScaleY.xyz;\\n\\\nvec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);\\n\\\nfloat show = packedAttribute0.x;\\n\\\nfloat brightness = packedAttribute0.y;\\n\\\nvec2 coordinates = packedAttribute0.wz;\\n\\\nvec3 maximumSize = packedAttribute1.xyz;\\n\\\nfloat slice = packedAttribute1.w;\\n\\\n#ifdef INSTANCED\\n\\\nvec2 dir = direction;\\n\\\n#else\\n\\\nvec2 dir = coordinates;\\n\\\n#endif\\n\\\nvec2 offset = dir - vec2(0.5, 0.5);\\n\\\nvec2 scaledOffset = scale * offset;\\n\\\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\\n\\\nvec4 positionEC = czm_modelViewRelativeToEye * p;\\n\\\npositionEC.xy += scaledOffset;\\n\\\npositionEC.xyz *= show;\\n\\\ngl_Position = czm_projection * positionEC;\\n\\\nv_offset = offset;\\n\\\nv_maximumSize = maximumSize;\\n\\\nv_color = color;\\n\\\nv_slice = slice;\\n\\\nv_brightness = brightness;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_noiseTextureDimensions;\\n\\\nuniform float u_noiseDetail;\\n\\\nuniform vec3 u_noiseOffset;\\n\\\nvarying vec2 v_position;\\n\\\nfloat textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\nfloat inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\nfloat wrap(float value, float rangeLength) {\\n\\\nif(value < 0.0) {\\n\\\nfloat absValue = abs(value);\\n\\\nfloat modValue = mod(absValue, rangeLength);\\n\\\nreturn mod(rangeLength - modValue, rangeLength);\\n\\\n}\\n\\\nreturn mod(value, rangeLength);\\n\\\n}\\n\\\nvec3 wrapVec(vec3 value, float rangeLength) {\\n\\\nreturn vec3(wrap(value.x, rangeLength),\\n\\\nwrap(value.y, rangeLength),\\n\\\nwrap(value.z, rangeLength));\\n\\\n}\\n\\\nvec3 random3(vec3 p) {\\n\\\nfloat dot1 = dot(p, vec3(127.1, 311.7, 932.8));\\n\\\nfloat dot2 = dot(p, vec3(269.5, 183.3, 421.4));\\n\\\nreturn fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));\\n\\\n}\\n\\\nvec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {\\n\\\nvec3 cell = centerCell + offset;\\n\\\ncell = wrapVec(cell, textureSliceWidth / u_noiseDetail);\\n\\\ncell += floor(u_noiseOffset / u_noiseDetail);\\n\\\nvec3 p = offset + random3(cell);\\n\\\nreturn p;\\n\\\n}\\n\\\nfloat worleyNoise(vec3 p, float freq) {\\n\\\nvec3 centerCell = floor(p * freq);\\n\\\nvec3 pointInCell = fract(p * freq);\\n\\\nfloat shortestDistance = 1000.0;\\n\\\nfor(float z = -1.0; z <= 1.0; z++) {\\n\\\nfor(float y = -1.0; y <= 1.0; y++) {\\n\\\nfor(float x = -1.0; x <= 1.0; x++) {\\n\\\nvec3 offset = vec3(x, y, z);\\n\\\nvec3 point = getWorleyCellPoint(centerCell, offset, freq);\\n\\\nfloat distance = length(pointInCell - point);\\n\\\nif(distance < shortestDistance) {\\n\\\nshortestDistance = distance;\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\n}\\n\\\nreturn shortestDistance;\\n\\\n}\\n\\\nconst float MAX_FBM_ITERATIONS = 10.0;\\n\\\nfloat worleyFBMNoise(vec3 p, float octaves, float scale) {\\n\\\nfloat noise = 0.0;\\n\\\nfloat freq = 1.0;\\n\\\nfloat persistence = 0.625;\\n\\\nfor(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {\\n\\\nif(i >= octaves) {\\n\\\nbreak;\\n\\\n}\\n\\\nnoise += worleyNoise(p * scale, freq * scale) * persistence;\\n\\\npersistence *= 0.5;\\n\\\nfreq *= 2.0;\\n\\\n}\\n\\\nreturn noise;\\n\\\n}\\n\\\nvoid main() {\\n\\\nfloat x = mod(v_position.x, textureSliceWidth);\\n\\\nfloat y = mod(v_position.y, textureSliceWidth);\\n\\\nfloat sliceRow = floor(v_position.y / textureSliceWidth);\\n\\\nfloat z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;\\n\\\nvec3 position = vec3(x, y, z);\\n\\\nposition /= u_noiseDetail;\\n\\\nfloat worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);\\n\\\nfloat worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);\\n\\\nfloat worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);\\n\\\ngl_FragColor = vec4(worley0, worley1, worley2, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec3 u_noiseTextureDimensions;\\n\\\nattribute vec2 position;\\n\\\nvarying vec2 v_position;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_Position = vec4(position, 0.1, 1.0);\\n\\\nfloat textureSliceWidth = u_noiseTextureDimensions.x;\\n\\\nfloat noiseTextureRows = u_noiseTextureDimensions.y;\\n\\\nfloat inverseNoiseTextureRows = u_noiseTextureDimensions.z;\\n\\\nvec2 transformedPos = (position * 0.5) + vec2(0.5);\\n\\\ntransformedPos *= textureSliceWidth;\\n\\\ntransformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;\\n\\\ntransformedPos.y *= noiseTextureRows;\\n\\\nv_position = transformedPos;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_opaqueDepthTexture;\\n\\\nuniform sampler2D u_translucentDepthTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat opaqueDepth = texture2D(u_opaqueDepthTexture, v_textureCoordinates).r;\\n\\\nfloat translucentDepth = texture2D(u_translucentDepthTexture, v_textureCoordinates).r;\\n\\\ntranslucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);\\n\\\ngl_FragColor = czm_packDepth(translucentDepth);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_opaque;\\n\\\nuniform sampler2D u_accumulation;\\n\\\nuniform sampler2D u_revealage;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\\n\\\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\\n\\\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\\n\\\n#ifdef MRT\\n\\\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\\n\\\n#else\\n\\\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\\n\\\n#endif\\n\\\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\\n\\\nif (opaque != czm_backgroundColor)\\n\\\n{\\n\\\ngl_FragColor.a = 1.0;\\n\\\n}\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec4 positionEC;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 position;\\n\\\nvec3 direction;\\n\\\nif (czm_orthographicIn3D == 1.0)\\n\\\n{\\n\\\nvec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;\\n\\\nvec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y);\\n\\\nvec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x);\\n\\\nposition = vec3(mix(minPlane, maxPlane, uv), 0.0);\\n\\\ndirection = vec3(0.0, 0.0, -1.0);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nposition = vec3(0.0);\\n\\\ndirection = normalize(positionEC.xyz);\\n\\\n}\\n\\\nczm_ray ray = czm_ray(position, direction);\\n\\\nvec3 ellipsoid_center = czm_view[3].xyz;\\n\\\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\\n\\\nif (!czm_isEmpty(intersection))\\n\\\n{\\n\\\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\nczm_writeLogDepth();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 position;\\n\\\nvarying vec4 positionEC;\\n\\\nvoid main()\\n\\\n{\\n\\\npositionEC = czm_modelView * position;\\n\\\ngl_Position = czm_projection * positionEC;\\n\\\nczm_vertexLogDepth();\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef WRITE_DEPTH\\n\\\n#ifdef GL_EXT_frag_depth\\n\\\n#extension GL_EXT_frag_depth : enable\\n\\\n#endif\\n\\\n#endif\\n\\\nuniform vec3 u_radii;\\n\\\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\\n\\\n{\\n\\\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\\n\\\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\\n\\\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\\n\\\nvec3 sphericalNormal = normalize(positionMC / u_radii);\\n\\\nvec3 normalMC = geodeticNormal * side;\\n\\\nvec3 normalEC = normalize(czm_normal * normalMC);\\n\\\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\\n\\\nvec3 positionToEyeEC = -positionEC;\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.s = st.s;\\n\\\nmaterialInput.st = st;\\n\\\nmaterialInput.str = (positionMC + u_radii) / u_radii;\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef ONLY_SUN_LIGHTING\\n\\\nreturn czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\\n\\\n#else\\n\\\nreturn czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\\n\\\nvec3 direction = normalize(v_positionEC);\\n\\\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\\n\\\nfloat t1 = -1.0;\\n\\\nfloat t2 = -1.0;\\n\\\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\\n\\\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\\n\\\nfloat discriminant = b * b - 4.0 * c;\\n\\\nif (discriminant >= 0.0) {\\n\\\nt1 = (-b - sqrt(discriminant)) * 0.5;\\n\\\nt2 = (-b + sqrt(discriminant)) * 0.5;\\n\\\n}\\n\\\nif (t1 < 0.0 && t2 < 0.0) {\\n\\\ndiscard;\\n\\\n}\\n\\\nfloat t = min(t1, t2);\\n\\\nif (t < 0.0) {\\n\\\nt = 0.0;\\n\\\n}\\n\\\nczm_ray ray = czm_ray(t * direction, direction);\\n\\\nvec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\\n\\\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\\n\\\nif (czm_isEmpty(intersection))\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\\n\\\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\\n\\\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\\n\\\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\\n\\\n#ifdef WRITE_DEPTH\\n\\\n#ifdef GL_EXT_frag_depth\\n\\\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\\n\\\nvec3 positionEC = czm_pointAlongRay(ray, t);\\n\\\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\\n\\\n#ifdef LOG_DEPTH\\n\\\nczm_writeLogDepth(1.0 + positionCC.w);\\n\\\n#else\\n\\\nfloat z = positionCC.z / positionCC.w;\\n\\\nfloat n = czm_depthRange.near;\\n\\\nfloat f = czm_depthRange.far;\\n\\\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\\n\\\n#endif\\n\\\n#endif\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position;\\n\\\nuniform vec3 u_radii;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = vec4(u_radii * position, 1.0);\\n\\\nv_positionEC = (czm_modelView * p).xyz;\\n\\\ngl_Position = czm_modelViewProjection * p;\\n\\\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\\n\\\nczm_vertexLogDepth();\\n\\\n}\\n\\\n\";\n", "/**\n * @license\n * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of NVIDIA CORPORATION nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n//This file is automatically rebuilt by the Cesium build process.\nexport default \"#if (FXAA_QUALITY_PRESET == 10)\\n\\\n#define FXAA_QUALITY_PS 3\\n\\\n#define FXAA_QUALITY_P0 1.5\\n\\\n#define FXAA_QUALITY_P1 3.0\\n\\\n#define FXAA_QUALITY_P2 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 11)\\n\\\n#define FXAA_QUALITY_PS 4\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 3.0\\n\\\n#define FXAA_QUALITY_P3 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 12)\\n\\\n#define FXAA_QUALITY_PS 5\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 4.0\\n\\\n#define FXAA_QUALITY_P4 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 13)\\n\\\n#define FXAA_QUALITY_PS 6\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 4.0\\n\\\n#define FXAA_QUALITY_P5 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 14)\\n\\\n#define FXAA_QUALITY_PS 7\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 4.0\\n\\\n#define FXAA_QUALITY_P6 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 15)\\n\\\n#define FXAA_QUALITY_PS 8\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 4.0\\n\\\n#define FXAA_QUALITY_P7 12.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 20)\\n\\\n#define FXAA_QUALITY_PS 3\\n\\\n#define FXAA_QUALITY_P0 1.5\\n\\\n#define FXAA_QUALITY_P1 2.0\\n\\\n#define FXAA_QUALITY_P2 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 21)\\n\\\n#define FXAA_QUALITY_PS 4\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 22)\\n\\\n#define FXAA_QUALITY_PS 5\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 23)\\n\\\n#define FXAA_QUALITY_PS 6\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 24)\\n\\\n#define FXAA_QUALITY_PS 7\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 3.0\\n\\\n#define FXAA_QUALITY_P6 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 25)\\n\\\n#define FXAA_QUALITY_PS 8\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 4.0\\n\\\n#define FXAA_QUALITY_P7 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 26)\\n\\\n#define FXAA_QUALITY_PS 9\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 2.0\\n\\\n#define FXAA_QUALITY_P7 4.0\\n\\\n#define FXAA_QUALITY_P8 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 27)\\n\\\n#define FXAA_QUALITY_PS 10\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 2.0\\n\\\n#define FXAA_QUALITY_P7 2.0\\n\\\n#define FXAA_QUALITY_P8 4.0\\n\\\n#define FXAA_QUALITY_P9 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 28)\\n\\\n#define FXAA_QUALITY_PS 11\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 2.0\\n\\\n#define FXAA_QUALITY_P7 2.0\\n\\\n#define FXAA_QUALITY_P8 2.0\\n\\\n#define FXAA_QUALITY_P9 4.0\\n\\\n#define FXAA_QUALITY_P10 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 29)\\n\\\n#define FXAA_QUALITY_PS 12\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.5\\n\\\n#define FXAA_QUALITY_P2 2.0\\n\\\n#define FXAA_QUALITY_P3 2.0\\n\\\n#define FXAA_QUALITY_P4 2.0\\n\\\n#define FXAA_QUALITY_P5 2.0\\n\\\n#define FXAA_QUALITY_P6 2.0\\n\\\n#define FXAA_QUALITY_P7 2.0\\n\\\n#define FXAA_QUALITY_P8 2.0\\n\\\n#define FXAA_QUALITY_P9 2.0\\n\\\n#define FXAA_QUALITY_P10 4.0\\n\\\n#define FXAA_QUALITY_P11 8.0\\n\\\n#endif\\n\\\n#if (FXAA_QUALITY_PRESET == 39)\\n\\\n#define FXAA_QUALITY_PS 12\\n\\\n#define FXAA_QUALITY_P0 1.0\\n\\\n#define FXAA_QUALITY_P1 1.0\\n\\\n#define FXAA_QUALITY_P2 1.0\\n\\\n#define FXAA_QUALITY_P3 1.0\\n\\\n#define FXAA_QUALITY_P4 1.0\\n\\\n#define FXAA_QUALITY_P5 1.5\\n\\\n#define FXAA_QUALITY_P6 2.0\\n\\\n#define FXAA_QUALITY_P7 2.0\\n\\\n#define FXAA_QUALITY_P8 2.0\\n\\\n#define FXAA_QUALITY_P9 2.0\\n\\\n#define FXAA_QUALITY_P10 4.0\\n\\\n#define FXAA_QUALITY_P11 8.0\\n\\\n#endif\\n\\\n#define FxaaBool bool\\n\\\n#define FxaaFloat float\\n\\\n#define FxaaFloat2 vec2\\n\\\n#define FxaaFloat3 vec3\\n\\\n#define FxaaFloat4 vec4\\n\\\n#define FxaaHalf float\\n\\\n#define FxaaHalf2 vec2\\n\\\n#define FxaaHalf3 vec3\\n\\\n#define FxaaHalf4 vec4\\n\\\n#define FxaaInt2 vec2\\n\\\n#define FxaaTex sampler2D\\n\\\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\\n\\\n#define FxaaTexTop(t, p) texture2D(t, p)\\n\\\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\\n\\\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\\n\\\nFxaaFloat4 FxaaPixelShader(\\n\\\nFxaaFloat2 pos,\\n\\\nFxaaTex tex,\\n\\\nFxaaFloat2 fxaaQualityRcpFrame,\\n\\\nFxaaFloat fxaaQualitySubpix,\\n\\\nFxaaFloat fxaaQualityEdgeThreshold,\\n\\\nFxaaFloat fxaaQualityEdgeThresholdMin\\n\\\n) {\\n\\\nFxaaFloat2 posM;\\n\\\nposM.x = pos.x;\\n\\\nposM.y = pos.y;\\n\\\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\\n\\\n#define lumaM rgbyM.y\\n\\\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat maxSM = max(lumaS, lumaM);\\n\\\nFxaaFloat minSM = min(lumaS, lumaM);\\n\\\nFxaaFloat maxESM = max(lumaE, maxSM);\\n\\\nFxaaFloat minESM = min(lumaE, minSM);\\n\\\nFxaaFloat maxWN = max(lumaN, lumaW);\\n\\\nFxaaFloat minWN = min(lumaN, lumaW);\\n\\\nFxaaFloat rangeMax = max(maxWN, maxESM);\\n\\\nFxaaFloat rangeMin = min(minWN, minESM);\\n\\\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\\n\\\nFxaaFloat range = rangeMax - rangeMin;\\n\\\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\\n\\\nFxaaBool earlyExit = range < rangeMaxClamped;\\n\\\nif(earlyExit)\\n\\\nreturn rgbyM;\\n\\\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\\n\\\nFxaaFloat lumaNS = lumaN + lumaS;\\n\\\nFxaaFloat lumaWE = lumaW + lumaE;\\n\\\nFxaaFloat subpixRcpRange = 1.0/range;\\n\\\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\\n\\\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\\n\\\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\\n\\\nFxaaFloat lumaNESE = lumaNE + lumaSE;\\n\\\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\\n\\\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\\n\\\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\\n\\\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\\n\\\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\\n\\\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\\n\\\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\\n\\\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\\n\\\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\\n\\\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\\n\\\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\\n\\\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\\n\\\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\\n\\\nFxaaBool horzSpan = edgeHorz >= edgeVert;\\n\\\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\\n\\\nif(!horzSpan) lumaN = lumaW;\\n\\\nif(!horzSpan) lumaS = lumaE;\\n\\\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\\n\\\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\\n\\\nFxaaFloat gradientN = lumaN - lumaM;\\n\\\nFxaaFloat gradientS = lumaS - lumaM;\\n\\\nFxaaFloat lumaNN = lumaN + lumaM;\\n\\\nFxaaFloat lumaSS = lumaS + lumaM;\\n\\\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\\n\\\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\\n\\\nif(pairN) lengthSign = -lengthSign;\\n\\\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\\n\\\nFxaaFloat2 posB;\\n\\\nposB.x = posM.x;\\n\\\nposB.y = posM.y;\\n\\\nFxaaFloat2 offNP;\\n\\\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\\n\\\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\\n\\\nif(!horzSpan) posB.x += lengthSign * 0.5;\\n\\\nif( horzSpan) posB.y += lengthSign * 0.5;\\n\\\nFxaaFloat2 posN;\\n\\\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\\n\\\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\\n\\\nFxaaFloat2 posP;\\n\\\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\\n\\\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\\n\\\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\\n\\\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\\n\\\nFxaaFloat subpixE = subpixC * subpixC;\\n\\\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\\n\\\nif(!pairN) lumaNN = lumaSS;\\n\\\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\\n\\\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\\n\\\nFxaaFloat subpixF = subpixD * subpixE;\\n\\\nFxaaBool lumaMLTZero = lumaMM < 0.0;\\n\\\nlumaEndN -= lumaNN * 0.5;\\n\\\nlumaEndP -= lumaNN * 0.5;\\n\\\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\\n\\\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\\n\\\nFxaaBool doneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\\n\\\n#if (FXAA_QUALITY_PS > 3)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\\n\\\n#if (FXAA_QUALITY_PS > 4)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\\n\\\n#if (FXAA_QUALITY_PS > 5)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\\n\\\n#if (FXAA_QUALITY_PS > 6)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\\n\\\n#if (FXAA_QUALITY_PS > 7)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\\n\\\n#if (FXAA_QUALITY_PS > 8)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\\n\\\n#if (FXAA_QUALITY_PS > 9)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\\n\\\n#if (FXAA_QUALITY_PS > 10)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\\n\\\n#if (FXAA_QUALITY_PS > 11)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\\n\\\n#if (FXAA_QUALITY_PS > 12)\\n\\\nif(doneNP) {\\n\\\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\\n\\\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\\n\\\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\\n\\\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\\n\\\ndoneN = abs(lumaEndN) >= gradientScaled;\\n\\\ndoneP = abs(lumaEndP) >= gradientScaled;\\n\\\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\\n\\\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\\n\\\ndoneNP = (!doneN) || (!doneP);\\n\\\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\\n\\\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n}\\n\\\nFxaaFloat dstN = posM.x - posN.x;\\n\\\nFxaaFloat dstP = posP.x - posM.x;\\n\\\nif(!horzSpan) dstN = posM.y - posN.y;\\n\\\nif(!horzSpan) dstP = posP.y - posM.y;\\n\\\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\\n\\\nFxaaFloat spanLength = (dstP + dstN);\\n\\\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\\n\\\nFxaaFloat spanLengthRcp = 1.0/spanLength;\\n\\\nFxaaBool directionN = dstN < dstP;\\n\\\nFxaaFloat dst = min(dstN, dstP);\\n\\\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\\n\\\nFxaaFloat subpixG = subpixF * subpixF;\\n\\\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\\n\\\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\\n\\\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\\n\\\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\\n\\\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\\n\\\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\\n\\\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform vec4 u_initialColor;\\n\\\n#if TEXTURE_UNITS > 0\\n\\\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\\n\\\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\\n\\\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\\n\\\n#ifdef APPLY_ALPHA\\n\\\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_DAY_NIGHT_ALPHA\\n\\\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\\n\\\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_SPLIT\\n\\\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_BRIGHTNESS\\n\\\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_CONTRAST\\n\\\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_HUE\\n\\\nuniform float u_dayTextureHue[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_SATURATION\\n\\\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_GAMMA\\n\\\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_IMAGERY_CUTOUT\\n\\\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef APPLY_COLOR_TO_ALPHA\\n\\\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\\n\\\n#endif\\n\\\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\\n\\\n#endif\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\nuniform sampler2D u_waterMask;\\n\\\nuniform vec4 u_waterMaskTranslationAndScale;\\n\\\nuniform float u_zoomedOutOceanSpecularIntensity;\\n\\\n#endif\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\nuniform sampler2D u_oceanNormalMap;\\n\\\n#endif\\n\\\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\\n\\\nuniform vec2 u_lightingFadeDistance;\\n\\\n#endif\\n\\\n#ifdef TILE_LIMIT_RECTANGLE\\n\\\nuniform vec4 u_cartographicLimitRectangle;\\n\\\n#endif\\n\\\n#ifdef GROUND_ATMOSPHERE\\n\\\nuniform vec2 u_nightFadeDistance;\\n\\\n#endif\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\nuniform highp sampler2D u_clippingPlanes;\\n\\\nuniform mat4 u_clippingPlanesMatrix;\\n\\\nuniform vec4 u_clippingPlanesEdgeStyle;\\n\\\n#endif\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\nuniform float u_minimumBrightness;\\n\\\n#endif\\n\\\n#ifdef COLOR_CORRECT\\n\\\nuniform vec3 u_hsbShift;\\n\\\n#endif\\n\\\n#ifdef HIGHLIGHT_FILL_TILE\\n\\\nuniform vec4 u_fillHighlightColor;\\n\\\n#endif\\n\\\n#ifdef TRANSLUCENT\\n\\\nuniform vec4 u_frontFaceAlphaByDistance;\\n\\\nuniform vec4 u_backFaceAlphaByDistance;\\n\\\nuniform vec4 u_translucencyRectangle;\\n\\\n#endif\\n\\\n#ifdef UNDERGROUND_COLOR\\n\\\nuniform vec4 u_undergroundColor;\\n\\\nuniform vec4 u_undergroundColorAlphaByDistance;\\n\\\n#endif\\n\\\n#ifdef ENABLE_VERTEX_LIGHTING\\n\\\nuniform float u_lambertDiffuseMultiplier;\\n\\\n#endif\\n\\\nvarying vec3 v_positionMC;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_textureCoordinates;\\n\\\nvarying vec3 v_normalMC;\\n\\\nvarying vec3 v_normalEC;\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nvarying float v_height;\\n\\\nvarying float v_slope;\\n\\\nvarying float v_aspect;\\n\\\n#endif\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nvarying float v_distance;\\n\\\n#endif\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\\n\\\nvarying vec3 v_atmosphereRayleighColor;\\n\\\nvarying vec3 v_atmosphereMieColor;\\n\\\nvarying float v_atmosphereOpacity;\\n\\\n#endif\\n\\\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\\n\\\n{\\n\\\nfloat startDistance = nearFarScalar.x;\\n\\\nfloat startValue = nearFarScalar.y;\\n\\\nfloat endDistance = nearFarScalar.z;\\n\\\nfloat endValue = nearFarScalar.w;\\n\\\nfloat t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\\n\\\nreturn mix(startValue, endValue, t);\\n\\\n}\\n\\\n#endif\\n\\\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\\n\\\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\\n\\\n{\\n\\\nreturn sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef TRANSLUCENT\\n\\\nbool inTranslucencyRectangle()\\n\\\n{\\n\\\nreturn\\n\\\nv_textureCoordinates.x > u_translucencyRectangle.x &&\\n\\\nv_textureCoordinates.x < u_translucencyRectangle.z &&\\n\\\nv_textureCoordinates.y > u_translucencyRectangle.y &&\\n\\\nv_textureCoordinates.y < u_translucencyRectangle.w;\\n\\\n}\\n\\\n#endif\\n\\\nvec4 sampleAndBlend(\\n\\\nvec4 previousColor,\\n\\\nsampler2D textureToSample,\\n\\\nvec2 tileTextureCoordinates,\\n\\\nvec4 textureCoordinateRectangle,\\n\\\nvec4 textureCoordinateTranslationAndScale,\\n\\\nfloat textureAlpha,\\n\\\nfloat textureNightAlpha,\\n\\\nfloat textureDayAlpha,\\n\\\nfloat textureBrightness,\\n\\\nfloat textureContrast,\\n\\\nfloat textureHue,\\n\\\nfloat textureSaturation,\\n\\\nfloat textureOneOverGamma,\\n\\\nfloat split,\\n\\\nvec4 colorToAlpha,\\n\\\nfloat nightBlend)\\n\\\n{\\n\\\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\\n\\\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\\n\\\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\\n\\\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\\n\\\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\\n\\\ntextureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\\n\\\n#endif\\n\\\nvec2 translation = textureCoordinateTranslationAndScale.xy;\\n\\\nvec2 scale = textureCoordinateTranslationAndScale.zw;\\n\\\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\\n\\\nvec4 value = texture2D(textureToSample, textureCoordinates);\\n\\\nvec3 color = value.rgb;\\n\\\nfloat alpha = value.a;\\n\\\n#ifdef APPLY_COLOR_TO_ALPHA\\n\\\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\\n\\\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\\n\\\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\\n\\\n#endif\\n\\\n#if !defined(APPLY_GAMMA)\\n\\\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\\n\\\ncolor = tempColor.rgb;\\n\\\nalpha = tempColor.a;\\n\\\n#else\\n\\\ncolor = pow(color, vec3(textureOneOverGamma));\\n\\\n#endif\\n\\\n#ifdef APPLY_SPLIT\\n\\\nfloat splitPosition = czm_splitPosition;\\n\\\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\\n\\\nalpha = 0.0;\\n\\\n}\\n\\\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\\n\\\nalpha = 0.0;\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef APPLY_BRIGHTNESS\\n\\\ncolor = mix(vec3(0.0), color, textureBrightness);\\n\\\n#endif\\n\\\n#ifdef APPLY_CONTRAST\\n\\\ncolor = mix(vec3(0.5), color, textureContrast);\\n\\\n#endif\\n\\\n#ifdef APPLY_HUE\\n\\\ncolor = czm_hue(color, textureHue);\\n\\\n#endif\\n\\\n#ifdef APPLY_SATURATION\\n\\\ncolor = czm_saturation(color, textureSaturation);\\n\\\n#endif\\n\\\nfloat sourceAlpha = alpha * textureAlpha;\\n\\\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\\n\\\noutAlpha += sign(outAlpha) - 1.0;\\n\\\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\\n\\\nreturn vec4(outColor, max(outAlpha, 0.0));\\n\\\n}\\n\\\nvec3 colorCorrect(vec3 rgb) {\\n\\\n#ifdef COLOR_CORRECT\\n\\\nvec3 hsb = czm_RGBToHSB(rgb);\\n\\\nhsb.x += u_hsbShift.x;\\n\\\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\\n\\\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\\n\\\nrgb = czm_HSBToRGB(hsb);\\n\\\n#endif\\n\\\nreturn rgb;\\n\\\n}\\n\\\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\\n\\\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\\n\\\nconst float fExposure = 2.0;\\n\\\nvec3 computeEllipsoidPosition()\\n\\\n{\\n\\\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\\n\\\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\\n\\\nxy *= czm_viewport.zw * mpp * 0.5;\\n\\\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\\n\\\nczm_ray ray = czm_ray(vec3(0.0), direction);\\n\\\nvec3 ellipsoid_center = czm_view[3].xyz;\\n\\\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\\n\\\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\\n\\\nreturn (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef TILE_LIMIT_RECTANGLE\\n\\\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\\n\\\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\\n\\\n#endif\\n\\\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\\n\\\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\\n\\\nvec3 normalEC = czm_normal3D * normalMC;\\n\\\n#endif\\n\\\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\\n\\\nfloat nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\\n\\\n#else\\n\\\nfloat nightBlend = 0.0;\\n\\\n#endif\\n\\\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\\n\\\n#ifdef SHOW_TILE_BOUNDARIES\\n\\\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\\n\\\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\\n\\\n{\\n\\\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\\n\\\n}\\n\\\n#endif\\n\\\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\\n\\\nfloat cameraDist;\\n\\\nif (czm_sceneMode == czm_sceneMode2D)\\n\\\n{\\n\\\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\\n\\\n}\\n\\\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\\n\\\n{\\n\\\ncameraDist = -czm_view[3].z;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\ncameraDist = length(czm_view[3]);\\n\\\n}\\n\\\nfloat fadeOutDist = u_lightingFadeDistance.x;\\n\\\nfloat fadeInDist = u_lightingFadeDistance.y;\\n\\\nif (czm_sceneMode != czm_sceneMode3D) {\\n\\\nvec3 radii = czm_ellipsoidRadii;\\n\\\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\\n\\\nfadeOutDist -= maxRadii;\\n\\\nfadeInDist -= maxRadii;\\n\\\n}\\n\\\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\\n\\\n#else\\n\\\nfloat fade = 0.0;\\n\\\n#endif\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\\n\\\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\\n\\\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\\n\\\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\\n\\\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\\n\\\nif (mask > 0.0)\\n\\\n{\\n\\\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\\n\\\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\\n\\\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\\n\\\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\\n\\\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.st = v_textureCoordinates.st;\\n\\\nmaterialInput.normalEC = normalize(v_normalEC);\\n\\\nmaterialInput.positionToEyeEC = -v_positionEC;\\n\\\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));\\n\\\nmaterialInput.slope = v_slope;\\n\\\nmaterialInput.height = v_height;\\n\\\nmaterialInput.aspect = v_aspect;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\nvec4 materialColor = vec4(material.diffuse, material.alpha);\\n\\\ncolor = alphaBlend(materialColor, color);\\n\\\n#endif\\n\\\n#ifdef ENABLE_VERTEX_LIGHTING\\n\\\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + 0.3, 0.0, 1.0);\\n\\\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\\n\\\n#elif defined(ENABLE_DAYNIGHT_SHADING)\\n\\\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\\n\\\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\\n\\\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\\n\\\n#else\\n\\\nvec4 finalColor = color;\\n\\\n#endif\\n\\\n#ifdef ENABLE_CLIPPING_PLANES\\n\\\nvec4 clippingPlanesEdgeColor = vec4(1.0);\\n\\\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\\n\\\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\\n\\\nif (clipDistance < clippingPlanesEdgeWidth)\\n\\\n{\\n\\\nfinalColor = clippingPlanesEdgeColor;\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef HIGHLIGHT_FILL_TILE\\n\\\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\\n\\\n#endif\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\\n\\\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\\n\\\n#else\\n\\\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\\n\\\n#endif\\n\\\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\\n\\\nif (!czm_backFacing())\\n\\\n{\\n\\\nbool dynamicLighting = false;\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\\n\\\ndynamicLighting = true;\\n\\\n#endif\\n\\\nvec3 rayleighColor;\\n\\\nvec3 mieColor;\\n\\\nfloat opacity;\\n\\\nvec3 positionWC;\\n\\\nvec3 lightDirection;\\n\\\n#ifdef PER_FRAGMENT_GROUND_ATMOSPHERE\\n\\\npositionWC = computeEllipsoidPosition();\\n\\\nlightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\\n\\\ncomputeAtmosphereScattering(\\n\\\npositionWC,\\n\\\nlightDirection,\\n\\\nrayleighColor,\\n\\\nmieColor,\\n\\\nopacity\\n\\\n);\\n\\\n#else\\n\\\npositionWC = v_positionMC;\\n\\\nlightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\\n\\\nrayleighColor = v_atmosphereRayleighColor;\\n\\\nmieColor = v_atmosphereMieColor;\\n\\\nopacity = v_atmosphereOpacity;\\n\\\n#endif\\n\\\nrayleighColor = colorCorrect(rayleighColor);\\n\\\nmieColor = colorCorrect(mieColor);\\n\\\nvec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);\\n\\\n#ifdef FOG\\n\\\nvec3 fogColor = groundAtmosphereColor.rgb;\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\\n\\\nfogColor *= darken;\\n\\\n#endif\\n\\\n#ifndef HDR\\n\\\nfogColor.rgb = czm_acesTonemapping(fogColor.rgb);\\n\\\nfogColor.rgb = czm_inverseGamma(fogColor.rgb);\\n\\\n#endif\\n\\\nconst float modifier = 0.15;\\n\\\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);\\n\\\n#else\\n\\\nconst float transmittanceModifier = 0.5;\\n\\\nfloat transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);\\n\\\nvec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\\n\\\nfloat fadeInDist = u_nightFadeDistance.x;\\n\\\nfloat fadeOutDist = u_nightFadeDistance.y;\\n\\\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);\\n\\\nfloat darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);\\n\\\nvec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);\\n\\\nfinalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);\\n\\\n#endif\\n\\\n#ifndef HDR\\n\\\nfinalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);\\n\\\n#else\\n\\\nfinalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);\\n\\\n#endif\\n\\\nfinalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);\\n\\\n#endif\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef UNDERGROUND_COLOR\\n\\\nif (czm_backFacing())\\n\\\n{\\n\\\nfloat distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\\n\\\nfloat distance = max(v_distance - distanceFromEllipsoid, 0.0);\\n\\\nfloat blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\\n\\\nvec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\\n\\\nfinalColor = alphaBlend(undergroundColor, finalColor);\\n\\\n}\\n\\\n#endif\\n\\\n#ifdef TRANSLUCENT\\n\\\nif (inTranslucencyRectangle())\\n\\\n{\\n\\\nvec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\\n\\\nfinalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\\n\\\n}\\n\\\n#endif\\n\\\ngl_FragColor = finalColor;\\n\\\n}\\n\\\n#ifdef SHOW_REFLECTIVE_OCEAN\\n\\\nfloat waveFade(float edge0, float edge1, float x)\\n\\\n{\\n\\\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\\n\\\nreturn pow(1.0 - y, 5.0);\\n\\\n}\\n\\\nfloat linearFade(float edge0, float edge1, float x)\\n\\\n{\\n\\\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\\n\\\n}\\n\\\nconst float oceanFrequencyLowAltitude = 825000.0;\\n\\\nconst float oceanAnimationSpeedLowAltitude = 0.004;\\n\\\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\\n\\\nconst float oceanSpecularIntensity = 0.5;\\n\\\nconst float oceanFrequencyHighAltitude = 125000.0;\\n\\\nconst float oceanAnimationSpeedHighAltitude = 0.008;\\n\\\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\\n\\\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\\n\\\n{\\n\\\nvec3 positionToEyeEC = -positionEyeCoordinates;\\n\\\nfloat positionToEyeECLength = length(positionToEyeEC);\\n\\\nvec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\\n\\\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\\n\\\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\\n\\\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\\n\\\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\\n\\\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\\n\\\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\\n\\\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\\n\\\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\\n\\\nvec3 normalTangentSpace =\\n\\\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\\n\\\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\\n\\\nnormalTangentSpace = normalize(normalTangentSpace);\\n\\\nnormalTangentSpace.xy *= waveIntensity;\\n\\\nnormalTangentSpace = normalize(normalTangentSpace);\\n\\\n#else\\n\\\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\\n\\\n#endif\\n\\\nvec3 normalEC = enuToEye * normalTangentSpace;\\n\\\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\\n\\\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\\n\\\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\\n\\\n#ifdef SHOW_OCEAN_WAVES\\n\\\nfloat tsPerturbationRatio = normalTangentSpace.z;\\n\\\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\\n\\\n#else\\n\\\nvec3 nonDiffuseHighlight = vec3(0.0);\\n\\\n#endif\\n\\\nfloat specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\\n\\\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\\n\\\nfloat specular = specularIntensity * surfaceReflectance;\\n\\\n#ifdef HDR\\n\\\nspecular *= 1.4;\\n\\\nfloat e = 0.2;\\n\\\nfloat d = 3.3;\\n\\\nfloat c = 1.7;\\n\\\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\\n\\\n#else\\n\\\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\\n\\\n#endif\\n\\\nreturn vec4(color, imageryColor.a);\\n\\\n}\\n\\\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#ifdef QUANTIZATION_BITS12\\n\\\nattribute vec4 compressed0;\\n\\\nattribute float compressed1;\\n\\\n#else\\n\\\nattribute vec4 position3DAndHeight;\\n\\\nattribute vec4 textureCoordAndEncodedNormals;\\n\\\n#endif\\n\\\n#ifdef GEODETIC_SURFACE_NORMALS\\n\\\nattribute vec3 geodeticSurfaceNormal;\\n\\\n#endif\\n\\\n#ifdef EXAGGERATION\\n\\\nuniform vec2 u_terrainExaggerationAndRelativeHeight;\\n\\\n#endif\\n\\\nuniform vec3 u_center3D;\\n\\\nuniform mat4 u_modifiedModelView;\\n\\\nuniform mat4 u_modifiedModelViewProjection;\\n\\\nuniform vec4 u_tileRectangle;\\n\\\nuniform vec2 u_southAndNorthLatitude;\\n\\\nuniform vec2 u_southMercatorYAndOneOverHeight;\\n\\\nvarying vec3 v_positionMC;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec3 v_textureCoordinates;\\n\\\nvarying vec3 v_normalMC;\\n\\\nvarying vec3 v_normalEC;\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nvarying float v_slope;\\n\\\nvarying float v_aspect;\\n\\\nvarying float v_height;\\n\\\n#endif\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nvarying float v_distance;\\n\\\n#endif\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\\n\\\nvarying vec3 v_atmosphereRayleighColor;\\n\\\nvarying vec3 v_atmosphereMieColor;\\n\\\nvarying float v_atmosphereOpacity;\\n\\\n#endif\\n\\\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\\n\\\nfloat get2DYPositionFraction(vec2 textureCoordinates);\\n\\\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\\n\\\n}\\n\\\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\\n\\\n{\\n\\\nconst float maxTileWidth = 0.003068;\\n\\\nfloat positionFraction = textureCoordinates.y;\\n\\\nfloat southLatitude = u_southAndNorthLatitude.x;\\n\\\nfloat northLatitude = u_southAndNorthLatitude.y;\\n\\\nif (northLatitude - southLatitude > maxTileWidth)\\n\\\n{\\n\\\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\\n\\\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\\n\\\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\\n\\\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\\n\\\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\\n\\\n}\\n\\\nreturn positionFraction;\\n\\\n}\\n\\\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\\n\\\n{\\n\\\nreturn textureCoordinates.y;\\n\\\n}\\n\\\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\\n\\\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\\n\\\nreturn u_modifiedModelViewProjection * rtcPosition2D;\\n\\\n}\\n\\\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\\n\\\n}\\n\\\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\\n\\\n}\\n\\\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\\n\\\n{\\n\\\nvec3 position3DWC = position + u_center3D;\\n\\\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\\n\\\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\\n\\\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\\n\\\nreturn czm_modelViewProjection * morphPosition;\\n\\\n}\\n\\\n#ifdef QUANTIZATION_BITS12\\n\\\nuniform vec2 u_minMaxHeight;\\n\\\nuniform mat4 u_scaleAndBias;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef QUANTIZATION_BITS12\\n\\\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\\n\\\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\\n\\\nvec3 position = vec3(xy, zh.x);\\n\\\nfloat height = zh.y;\\n\\\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\\n\\\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\\n\\\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\\n\\\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\\n\\\nfloat encodedNormal = compressed1;\\n\\\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\\n\\\nfloat encodedNormal = 0.0;\\n\\\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\\n\\\nfloat webMercatorT = textureCoordinates.y;\\n\\\nfloat encodedNormal = compressed0.w;\\n\\\n#else\\n\\\nfloat webMercatorT = textureCoordinates.y;\\n\\\nfloat encodedNormal = 0.0;\\n\\\n#endif\\n\\\n#else\\n\\\nvec3 position = position3DAndHeight.xyz;\\n\\\nfloat height = position3DAndHeight.w;\\n\\\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\\n\\\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\\n\\\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\\n\\\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\\n\\\nfloat webMercatorT = textureCoordinates.y;\\n\\\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\\n\\\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\\n\\\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\\n\\\nfloat encodedNormal = 0.0;\\n\\\n#else\\n\\\nfloat webMercatorT = textureCoordinates.y;\\n\\\nfloat encodedNormal = 0.0;\\n\\\n#endif\\n\\\n#endif\\n\\\nvec3 position3DWC = position + u_center3D;\\n\\\n#ifdef GEODETIC_SURFACE_NORMALS\\n\\\nvec3 ellipsoidNormal = geodeticSurfaceNormal;\\n\\\n#else\\n\\\nvec3 ellipsoidNormal = normalize(position3DWC);\\n\\\n#endif\\n\\\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\\n\\\nfloat exaggeration = u_terrainExaggerationAndRelativeHeight.x;\\n\\\nfloat relativeHeight = u_terrainExaggerationAndRelativeHeight.y;\\n\\\nfloat newHeight = (height - relativeHeight) * exaggeration + relativeHeight;\\n\\\nfloat minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);\\n\\\nnewHeight = max(newHeight, -minRadius);\\n\\\nvec3 offset = ellipsoidNormal * (newHeight - height);\\n\\\nposition += offset;\\n\\\nposition3DWC += offset;\\n\\\nheight = newHeight;\\n\\\n#endif\\n\\\ngl_Position = getPosition(position, height, textureCoordinates);\\n\\\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\\n\\\nv_positionMC = position3DWC;\\n\\\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\\n\\\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\\n\\\nvec3 normalMC = czm_octDecode(encodedNormal);\\n\\\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\\n\\\nvec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;\\n\\\nvec3 rejection = normalMC - projection;\\n\\\nnormalMC = normalize(projection + rejection * exaggeration);\\n\\\n#endif\\n\\\nv_normalMC = normalMC;\\n\\\nv_normalEC = czm_normal3D * v_normalMC;\\n\\\n#endif\\n\\\n#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))\\n\\\nbool dynamicLighting = false;\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\\n\\\ndynamicLighting = true;\\n\\\n#endif\\n\\\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\\n\\\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\\n\\\n#else\\n\\\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\\n\\\n#endif\\n\\\nvec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));\\n\\\ncomputeAtmosphereScattering(\\n\\\nposition3DWC,\\n\\\nlightDirection,\\n\\\nv_atmosphereRayleighColor,\\n\\\nv_atmosphereMieColor,\\n\\\nv_atmosphereOpacity\\n\\\n);\\n\\\n#endif\\n\\\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\\n\\\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\\n\\\n#endif\\n\\\n#ifdef APPLY_MATERIAL\\n\\\nfloat northPoleZ = czm_ellipsoidRadii.z;\\n\\\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\\n\\\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\\n\\\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\\n\\\nv_slope = acos(dotProd);\\n\\\nvec3 normalRejected = ellipsoidNormal * dotProd;\\n\\\nvec3 normalProjected = v_normalMC - normalRejected;\\n\\\nvec3 aspectVector = normalize(normalProjected);\\n\\\nv_aspect = acos(dot(aspectVector, vectorEastMC));\\n\\\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\\n\\\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\\n\\\nv_height = height;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {\\n\\\nvec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\nvec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\nczm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\\n\\\nfloat atmosphereInnerRadius = length(positionWC);\\n\\\ncomputeScattering(\\n\\\nprimaryRay,\\n\\\nlength(cameraToPositionWC),\\n\\\nlightDirection,\\n\\\natmosphereInnerRadius,\\n\\\nrayleighColor,\\n\\\nmieColor,\\n\\\nopacity\\n\\\n);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_texture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 position;\\n\\\nattribute float webMercatorT;\\n\\\nuniform vec2 u_textureDimensions;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nv_textureCoordinates = vec2(position.x, webMercatorT);\\n\\\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"float interpolateByDistance(vec4 nearFarScalar, float distance)\\n\\\n{\\n\\\nfloat startDistance = nearFarScalar.x;\\n\\\nfloat startValue = nearFarScalar.y;\\n\\\nfloat endDistance = nearFarScalar.z;\\n\\\nfloat endValue = nearFarScalar.w;\\n\\\nfloat t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\\n\\\nreturn mix(startValue, endValue, t);\\n\\\n}\\n\\\nvec3 getLightDirection(vec3 positionWC)\\n\\\n{\\n\\\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\\n\\\nvec3 lightDirection =\\n\\\npositionWC * float(lightEnum == 0.0) +\\n\\\nczm_lightDirectionWC * float(lightEnum == 1.0) +\\n\\\nczm_sunDirectionWC * float(lightEnum == 2.0);\\n\\\nreturn normalize(lightDirection);\\n\\\n}\\n\\\nvoid computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)\\n\\\n{\\n\\\nfloat ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;\\n\\\nfloat distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;\\n\\\nfloat distanceAdjustMax = czm_ellipsoidRadii.x;\\n\\\nfloat distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;\\n\\\nfloat distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);\\n\\\nfloat radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;\\n\\\nfloat atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;\\n\\\nvec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\\n\\\nvec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\\n\\\nczm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\\n\\\nunderTranslucentGlobe = 0.0;\\n\\\n#if defined(GLOBE_TRANSLUCENT)\\n\\\nczm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);\\n\\\nif (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {\\n\\\nvec3 direction = normalize(positionWC);\\n\\\nczm_ray ellipsoidRay = czm_ray(positionWC, -direction);\\n\\\nczm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);\\n\\\nvec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);\\n\\\nfloat angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));\\n\\\nopacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));\\n\\\nvec3 horizonColor = vec3(0.1, 0.2, 0.3);\\n\\\nvec3 nearColor = vec3(0.0);\\n\\\nrayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);\\n\\\nunderTranslucentGlobe = 1.0;\\n\\\nreturn;\\n\\\n}\\n\\\n#endif\\n\\\ncomputeScattering(\\n\\\nprimaryRay,\\n\\\nlength(cameraToPositionWC),\\n\\\nlightDirection,\\n\\\natmosphereInnerRadius,\\n\\\nrayleighColor,\\n\\\nmieColor,\\n\\\nopacity\\n\\\n);\\n\\\nfloat cameraHeight = czm_eyeHeight + atmosphereInnerRadius;\\n\\\nfloat atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\\n\\\nopacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);\\n\\\nfloat nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\\n\\\nopacity *= pow(nightAlpha, 0.5);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_outerPositionWC;\\n\\\nuniform vec3 u_hsbShift;\\n\\\n#ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\nvarying vec3 v_mieColor;\\n\\\nvarying vec3 v_rayleighColor;\\n\\\nvarying float v_opacity;\\n\\\nvarying float v_translucent;\\n\\\n#endif\\n\\\nvoid main (void)\\n\\\n{\\n\\\nvec3 lightDirection = getLightDirection(v_outerPositionWC);\\n\\\nvec3 mieColor;\\n\\\nvec3 rayleighColor;\\n\\\nfloat opacity;\\n\\\nfloat translucent;\\n\\\n#ifdef PER_FRAGMENT_ATMOSPHERE\\n\\\ncomputeAtmosphereScattering(\\n\\\nv_outerPositionWC,\\n\\\nlightDirection,\\n\\\nrayleighColor,\\n\\\nmieColor,\\n\\\nopacity,\\n\\\ntranslucent\\n\\\n);\\n\\\n#else\\n\\\nmieColor = v_mieColor;\\n\\\nrayleighColor = v_rayleighColor;\\n\\\nopacity = v_opacity;\\n\\\ntranslucent = v_translucent;\\n\\\n#endif\\n\\\nvec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\\n\\\n#ifndef HDR\\n\\\ncolor.rgb = czm_acesTonemapping(color.rgb);\\n\\\ncolor.rgb = czm_inverseGamma(color.rgb);\\n\\\n#endif\\n\\\n#ifdef COLOR_CORRECT\\n\\\nvec3 hsb = czm_RGBToHSB(color.rgb);\\n\\\nhsb.x += u_hsbShift.x;\\n\\\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\\n\\\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\\n\\\ncolor.rgb = czm_HSBToRGB(hsb);\\n\\\n#endif\\n\\\nif (translucent == 0.0) {\\n\\\ncolor.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);\\n\\\n}\\n\\\ngl_FragColor = color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec4 position;\\n\\\nvarying vec3 v_outerPositionWC;\\n\\\n#ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\nvarying vec3 v_mieColor;\\n\\\nvarying vec3 v_rayleighColor;\\n\\\nvarying float v_opacity;\\n\\\nvarying float v_translucent;\\n\\\n#endif\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec4 positionWC = czm_model * position;\\n\\\nvec3 lightDirection = getLightDirection(positionWC.xyz);\\n\\\n#ifndef PER_FRAGMENT_ATMOSPHERE\\n\\\ncomputeAtmosphereScattering(\\n\\\npositionWC.xyz,\\n\\\nlightDirection,\\n\\\nv_rayleighColor,\\n\\\nv_mieColor,\\n\\\nv_opacity,\\n\\\nv_translucent\\n\\\n);\\n\\\n#endif\\n\\\nv_outerPositionWC = positionWC.xyz;\\n\\\ngl_Position = czm_modelViewProjection * position;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform samplerCube u_cubeMap;\\n\\\nvarying vec3 v_texCoord;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\\n\\\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position;\\n\\\nvarying vec3 v_texCoord;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\\n\\\ngl_Position = czm_projection * vec4(p, 1.0);\\n\\\nv_texCoord = position.xyz;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_texture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 color = texture2D(u_texture, v_textureCoordinates);\\n\\\ngl_FragColor = czm_gammaCorrect(color);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform float u_radiusTS;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvec2 rotate(vec2 p, vec2 direction)\\n\\\n{\\n\\\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\\n\\\n}\\n\\\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\\n\\\n{\\n\\\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\\n\\\nfloat radius = length(rotatedPosition) * lengthScalar;\\n\\\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\\n\\\nreturn vec4(burst);\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat lengthScalar = 2.0 / sqrt(2.0);\\n\\\nvec2 position = v_textureCoordinates - vec2(0.5);\\n\\\nfloat radius = length(position) * lengthScalar;\\n\\\nfloat surface = step(radius, u_radiusTS);\\n\\\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\\n\\\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\\n\\\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\\n\\\nvec4 burst = vec4(0.0);\\n\\\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);\\n\\\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\\n\\\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\\n\\\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\\n\\\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\\n\\\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\\n\\\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\\n\\\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec2 direction;\\n\\\nuniform float u_size;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 position;\\n\\\nif (czm_morphTime == 1.0)\\n\\\n{\\n\\\nposition = vec4(czm_sunPositionWC, 1.0);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\\n\\\n}\\n\\\nvec4 positionEC = czm_view * position;\\n\\\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\nvec2 halfSize = vec2(u_size * 0.5);\\n\\\nhalfSize *= ((direction * 2.0) - 1.0);\\n\\\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\\n\\\nv_textureCoordinates = direction;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nczm_materialInput materialInput;\\n\\\nmaterialInput.s = v_textureCoordinates.s;\\n\\\nmaterialInput.st = v_textureCoordinates;\\n\\\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\\n\\\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n}\\n\\\n\";\n", "import Clock from \"../Core/Clock.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport EventHelper from \"../Core/EventHelper.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\n/**\n * A view model which exposes a {@link Clock} for user interfaces.\n * @alias ClockViewModel\n * @constructor\n *\n * @param {Clock} [clock] The clock object wrapped by this view model, if undefined a new instance will be created.\n *\n * @see Clock\n */\nfunction ClockViewModel(clock) {\n if (!defined(clock)) {\n clock = new Clock();\n }\n this._clock = clock;\n\n this._eventHelper = new EventHelper();\n this._eventHelper.add(clock.onTick, this.synchronize, this);\n\n /**\n * Gets the current system time.\n * This property is observable.\n * @type {JulianDate}\n */\n this.systemTime = knockout.observable(JulianDate.now());\n this.systemTime.equalityComparer = JulianDate.equals;\n\n /**\n * Gets or sets the start time of the clock.\n * See {@link Clock#startTime}.\n * This property is observable.\n * @type {JulianDate}\n */\n this.startTime = knockout.observable(clock.startTime);\n this.startTime.equalityComparer = JulianDate.equals;\n this.startTime.subscribe(function (value) {\n clock.startTime = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets the stop time of the clock.\n * See {@link Clock#stopTime}.\n * This property is observable.\n * @type {JulianDate}\n */\n this.stopTime = knockout.observable(clock.stopTime);\n this.stopTime.equalityComparer = JulianDate.equals;\n this.stopTime.subscribe(function (value) {\n clock.stopTime = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets the current time.\n * See {@link Clock#currentTime}.\n * This property is observable.\n * @type {JulianDate}\n */\n this.currentTime = knockout.observable(clock.currentTime);\n this.currentTime.equalityComparer = JulianDate.equals;\n this.currentTime.subscribe(function (value) {\n clock.currentTime = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets the clock multiplier.\n * See {@link Clock#multiplier}.\n * This property is observable.\n * @type {Number}\n */\n this.multiplier = knockout.observable(clock.multiplier);\n this.multiplier.subscribe(function (value) {\n clock.multiplier = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets the clock step setting.\n * See {@link Clock#clockStep}.\n * This property is observable.\n * @type {ClockStep}\n */\n this.clockStep = knockout.observable(clock.clockStep);\n this.clockStep.subscribe(function (value) {\n clock.clockStep = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets the clock range setting.\n * See {@link Clock#clockRange}.\n * This property is observable.\n * @type {ClockRange}\n */\n this.clockRange = knockout.observable(clock.clockRange);\n this.clockRange.subscribe(function (value) {\n clock.clockRange = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets whether the clock can animate.\n * See {@link Clock#canAnimate}.\n * This property is observable.\n * @type {Boolean}\n */\n this.canAnimate = knockout.observable(clock.canAnimate);\n this.canAnimate.subscribe(function (value) {\n clock.canAnimate = value;\n this.synchronize();\n }, this);\n\n /**\n * Gets or sets whether the clock should animate.\n * See {@link Clock#shouldAnimate}.\n * This property is observable.\n * @type {Boolean}\n */\n this.shouldAnimate = knockout.observable(clock.shouldAnimate);\n this.shouldAnimate.subscribe(function (value) {\n clock.shouldAnimate = value;\n this.synchronize();\n }, this);\n\n knockout.track(this, [\n \"systemTime\",\n \"startTime\",\n \"stopTime\",\n \"currentTime\",\n \"multiplier\",\n \"clockStep\",\n \"clockRange\",\n \"canAnimate\",\n \"shouldAnimate\",\n ]);\n}\n\nObject.defineProperties(ClockViewModel.prototype, {\n /**\n * Gets the underlying Clock.\n * @memberof ClockViewModel.prototype\n * @type {Clock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n },\n});\n\n/**\n * Updates the view model with the contents of the underlying clock.\n * Can be called to force an update of the viewModel if the underlying\n * clock has changed and <code>Clock.tick</code> has not yet been called.\n */\nClockViewModel.prototype.synchronize = function () {\n const clock = this._clock;\n\n this.systemTime = JulianDate.now();\n this.startTime = clock.startTime;\n this.stopTime = clock.stopTime;\n this.currentTime = clock.currentTime;\n this.multiplier = clock.multiplier;\n this.clockStep = clock.clockStep;\n this.clockRange = clock.clockRange;\n this.canAnimate = clock.canAnimate;\n this.shouldAnimate = clock.shouldAnimate;\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nClockViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the view model. Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nClockViewModel.prototype.destroy = function () {\n this._eventHelper.removeAll();\n\n destroyObject(this);\n};\nexport default ClockViewModel;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A Command is a function with an extra <code>canExecute</code> observable property to determine\n * whether the command can be executed. When executed, a Command function will check the\n * value of <code>canExecute</code> and throw if false.\n *\n * This type describes an interface and is not intended to be instantiated directly.\n * See {@link createCommand} to create a command from a function.\n *\n * @alias Command\n * @constructor\n */\nfunction Command() {\n /**\n * Gets whether this command can currently be executed. This property is observable.\n * @type {Boolean}\n * @default undefined\n */\n this.canExecute = undefined;\n\n /**\n * Gets an event which is raised before the command executes, the event\n * is raised with an object containing two properties: a <code>cancel</code> property,\n * which if set to false by the listener will prevent the command from being executed, and\n * an <code>args</code> property, which is the array of arguments being passed to the command.\n * @type {Event}\n * @default undefined\n */\n this.beforeExecute = undefined;\n\n /**\n * Gets an event which is raised after the command executes, the event\n * is raised with the return value of the command as its only parameter.\n * @type {Event}\n * @default undefined\n */\n this.afterExecute = undefined;\n\n DeveloperError.throwInstantiationError();\n}\nexport default Command;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\n/**\n * Create a Command from a given function, for use with ViewModels.\n *\n * A Command is a function with an extra <code>canExecute</code> observable property to determine\n * whether the command can be executed. When executed, a Command function will check the\n * value of <code>canExecute</code> and throw if false. It also provides events for when\n * a command has been or is about to be executed.\n *\n * @function\n *\n * @param {Function} func The function to execute.\n * @param {Boolean} [canExecute=true] A boolean indicating whether the function can currently be executed.\n */\nfunction createCommand(func, canExecute) {\n canExecute = defaultValue(canExecute, true);\n\n const beforeExecute = new Event();\n const afterExecute = new Event();\n\n function command() {\n const commandInfo = {\n args: arguments,\n cancel: false,\n };\n\n let result;\n beforeExecute.raiseEvent(commandInfo);\n if (!commandInfo.cancel) {\n result = func.apply(null, arguments);\n afterExecute.raiseEvent(result);\n }\n return result;\n }\n\n command.canExecute = canExecute;\n knockout.track(command, [\"canExecute\"]);\n\n Object.defineProperties(command, {\n beforeExecute: {\n value: beforeExecute,\n },\n afterExecute: {\n value: afterExecute,\n },\n });\n\n return command;\n}\nexport default createCommand;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * A static class with helper functions used by the CesiumInspector and Cesium3DTilesInspector\n * @private\n */\nconst InspectorShared = {};\n\n/**\n * Creates a checkbox component\n * @param {String} labelText The text to display in the checkbox label\n * @param {String} checkedBinding The name of the variable used for checked binding\n * @param {String} [enableBinding] The name of the variable used for enable binding\n * @return {Element}\n */\nInspectorShared.createCheckbox = function (\n labelText,\n checkedBinding,\n enableBinding\n) {\nconst checkboxContainer = document.createElement(\"div\");\n const checkboxLabel = document.createElement(\"label\");\n const checkboxInput = document.createElement(\"input\");\n checkboxInput.type = \"checkbox\";\n\n let binding = `checked: ${checkedBinding}`;\n if (defined(enableBinding)) {\n binding += `, enable: ${enableBinding}`;\n }\n checkboxInput.setAttribute(\"data-bind\", binding);\n checkboxLabel.appendChild(checkboxInput);\n checkboxLabel.appendChild(document.createTextNode(labelText));\n checkboxContainer.appendChild(checkboxLabel);\n return checkboxContainer;\n};\n\n/**\n * Creates a section element\n * @param {Element} panel The parent element\n * @param {String} headerText The text to display at the top of the section\n * @param {String} sectionVisibleBinding The name of the variable used for visible binding\n * @param {String} toggleSectionVisibilityBinding The name of the function used to toggle visibility\n * @return {Element}\n */\nInspectorShared.createSection = function (\n panel,\n headerText,\n sectionVisibleBinding,\n toggleSectionVisibilityBinding\n) {\nconst section = document.createElement(\"div\");\n section.className = \"cesium-cesiumInspector-section\";\n section.setAttribute(\n \"data-bind\",\n `css: { \"cesium-cesiumInspector-section-collapsed\": !${sectionVisibleBinding} }`\n );\n panel.appendChild(section);\n\n const sectionHeader = document.createElement(\"h3\");\n sectionHeader.className = \"cesium-cesiumInspector-sectionHeader\";\n sectionHeader.appendChild(document.createTextNode(headerText));\n sectionHeader.setAttribute(\n \"data-bind\",\n `click: ${toggleSectionVisibilityBinding}`\n );\n section.appendChild(sectionHeader);\n\n const sectionContent = document.createElement(\"div\");\n sectionContent.className = \"cesium-cesiumInspector-sectionContent\";\n section.appendChild(sectionContent);\n return sectionContent;\n};\nexport default InspectorShared;\n", "import knockout from \"../ThirdParty/knockout.js\";\n\n/**\n * Subscribe to a Knockout observable ES5 property, and immediately fire\n * the callback with the current value of the property.\n *\n * @private\n *\n * @function subscribeAndEvaluate\n *\n * @param {Object} owner The object containing the observable property.\n * @param {String} observablePropertyName The name of the observable property.\n * @param {Function} callback The callback function.\n * @param {Object} [target] The value of this in the callback function.\n * @param {String} [event='change'] The name of the event to receive notification for.\n * @returns The subscription object from Knockout which can be used to dispose the subscription later.\n */\nfunction subscribeAndEvaluate(\n owner,\n observablePropertyName,\n callback,\n target,\n event\n) {\n callback.call(target, owner[observablePropertyName]);\n return knockout\n .getObservable(owner, observablePropertyName)\n .subscribe(callback, target, event);\n}\nexport default subscribeAndEvaluate;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport knockout from \"../ThirdParty/knockout.js\";\n\n/**\n * A view model which exposes the properties of a toggle button.\n * @alias ToggleButtonViewModel\n * @constructor\n *\n * @param {Command} command The command which will be executed when the button is toggled.\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.toggled=false] A boolean indicating whether the button should be initially toggled.\n * @param {String} [options.tooltip=''] A string containing the button's tooltip.\n */\nfunction ToggleButtonViewModel(command, options) {\n this._command = command;\n\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Gets or sets whether the button is currently toggled. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.toggled = defaultValue(options.toggled, false);\n\n /**\n * Gets or sets the button's tooltip. This property is observable.\n * @type {String}\n * @default ''\n */\n this.tooltip = defaultValue(options.tooltip, \"\");\n\n knockout.track(this, [\"toggled\", \"tooltip\"]);\n}\n\nObject.defineProperties(ToggleButtonViewModel.prototype, {\n /**\n * Gets the command which will be executed when the button is toggled.\n * @memberof ToggleButtonViewModel.prototype\n * @type {Command}\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n});\nexport default ToggleButtonViewModel;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getImagePixels from \"../Core/getImagePixels.js\";\nimport Resource from \"../Core/Resource.js\";\n\n/**\n * A policy for discarding tile images that match a known image containing a\n * \"missing\" image.\n *\n * @alias DiscardMissingTileImagePolicy\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Resource|String} options.missingImageUrl The URL of the known missing image.\n * @param {Cartesian2[]} options.pixelsToCheck An array of {@link Cartesian2} pixel positions to\n * compare against the missing image.\n * @param {Boolean} [options.disableCheckIfAllPixelsAreTransparent=false] If true, the discard check will be disabled\n * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the\n * discard check will proceed no matter the values of the pixelsToCheck.\n */\nfunction DiscardMissingTileImagePolicy(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._pixelsToCheck = options.pixelsToCheck;\n this._missingImagePixels = undefined;\n this._missingImageByteLength = undefined;\n this._isReady = false;\n\n const resource = Resource.createIfNeeded(options.missingImageUrl);\n\n const that = this;\n\n function success(image) {\n if (defined(image.blob)) {\n that._missingImageByteLength = image.blob.size;\n }\n\n let pixels = getImagePixels(image);\n\n if (options.disableCheckIfAllPixelsAreTransparent) {\n let allAreTransparent = true;\n const width = image.width;\n\n const pixelsToCheck = options.pixelsToCheck;\n for (\n let i = 0, len = pixelsToCheck.length;\n allAreTransparent && i < len;\n ++i\n ) {\n const pos = pixelsToCheck[i];\n const index = pos.x * 4 + pos.y * width;\n const alpha = pixels[index + 3];\n\n if (alpha > 0) {\n allAreTransparent = false;\n }\n }\n\n if (allAreTransparent) {\n pixels = undefined;\n }\n }\n\n that._missingImagePixels = pixels;\n that._isReady = true;\n }\n\n function failure() {\n // Failed to download \"missing\" image, so assume that any truly missing tiles\n // will also fail to download and disable the discard check.\n that._missingImagePixels = undefined;\n that._isReady = true;\n }\n\n resource\n .fetchImage({\n preferBlob: true,\n preferImageBitmap: true,\n flipY: true,\n })\n .then(success)\n .catch(failure);\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {Boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nDiscardMissingTileImagePolicy.prototype.isReady = function () {\n return this._isReady;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {Boolean} True if the image should be discarded; otherwise, false.\n *\n * @exception {DeveloperError} <code>shouldDiscardImage</code> must not be called before the discard policy is ready.\n */\nDiscardMissingTileImagePolicy.prototype.shouldDiscardImage = function (image) {\n const pixelsToCheck = this._pixelsToCheck;\n const missingImagePixels = this._missingImagePixels;\n\n // If missingImagePixels is undefined, it indicates that the discard check has been disabled.\n if (!defined(missingImagePixels)) {\n return false;\n }\n\n if (defined(image.blob) && image.blob.size !== this._missingImageByteLength) {\n return false;\n }\n\n const pixels = getImagePixels(image);\n const width = image.width;\n\n for (let i = 0, len = pixelsToCheck.length; i < len; ++i) {\n const pos = pixelsToCheck[i];\n const index = pos.x * 4 + pos.y * width;\n for (let offset = 0; offset < 4; ++offset) {\n const pixel = index + offset;\n if (pixels[pixel] !== missingImagePixels[pixel]) {\n return false;\n }\n }\n }\n return true;\n};\nexport default DiscardMissingTileImagePolicy;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.\n *\n * @alias ImageryLayerFeatureInfo\n * @constructor\n */\nfunction ImageryLayerFeatureInfo() {\n /**\n * Gets or sets the name of the feature.\n * @type {String|undefined}\n */\n this.name = undefined;\n\n /**\n * Gets or sets an HTML description of the feature. The HTML is not trusted and should\n * be sanitized before display to the user.\n * @type {String|undefined}\n */\n this.description = undefined;\n\n /**\n * Gets or sets the position of the feature, or undefined if the position is not known.\n *\n * @type {Cartographic|undefined}\n */\n this.position = undefined;\n\n /**\n * Gets or sets the raw data describing the feature. The raw data may be in any\n * number of formats, such as GeoJSON, KML, etc.\n * @type {Object|undefined}\n */\n this.data = undefined;\n\n /**\n * Gets or sets the image layer of the feature.\n * @type {Object|undefined}\n */\n this.imageryLayer = undefined;\n}\n\n/**\n * Configures the name of this feature by selecting an appropriate property. The name will be obtained from\n * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',\n * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If\n * the name cannot be obtained from any of these sources, the existing name will be left unchanged.\n *\n * @param {Object} properties An object literal containing the properties of the feature.\n */\nImageryLayerFeatureInfo.prototype.configureNameFromProperties = function (\n properties\n) {\n let namePropertyPrecedence = 10;\n let nameProperty;\n\n for (const key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n const lowerKey = key.toLowerCase();\n\n if (namePropertyPrecedence > 1 && lowerKey === \"name\") {\n namePropertyPrecedence = 1;\n nameProperty = key;\n } else if (namePropertyPrecedence > 2 && lowerKey === \"title\") {\n namePropertyPrecedence = 2;\n nameProperty = key;\n } else if (namePropertyPrecedence > 3 && /name/i.test(key)) {\n namePropertyPrecedence = 3;\n nameProperty = key;\n } else if (namePropertyPrecedence > 4 && /title/i.test(key)) {\n namePropertyPrecedence = 4;\n nameProperty = key;\n }\n }\n }\n\n if (defined(nameProperty)) {\n this.name = properties[nameProperty];\n }\n};\n\n/**\n * Configures the description of this feature by creating an HTML table of properties and their values.\n *\n * @param {Object} properties An object literal containing the properties of the feature.\n */\nImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties = function (\n properties\n) {\n function describe(properties) {\n let html = '<table class=\"cesium-infoBox-defaultTable\">';\n for (const key in properties) {\n if (properties.hasOwnProperty(key)) {\n const value = properties[key];\n if (defined(value)) {\n if (typeof value === \"object\") {\n html += `<tr><td>${key}</td><td>${describe(value)}</td></tr>`;\n } else {\n html += `<tr><td>${key}</td><td>${value}</td></tr>`;\n }\n }\n }\n }\n html += \"</table>\";\n\n return html;\n }\n\n this.description = describe(properties);\n};\nexport default ImageryLayerFeatureInfo;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport loadKTX2 from \"../Core/loadKTX2.js\";\nimport Resource from \"../Core/Resource.js\";\n\n/**\n * @typedef {HTMLImageElement|HTMLCanvasElement|ImageBitmap} ImageryTypes\n *\n * The format in which {@link ImageryProvider} methods return an image may\n * vary by provider, configuration, or server settings. Most common are\n * <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or on supported\n * browsers, <code>ImageBitmap</code>.\n *\n * See the documentation for each ImageryProvider class for more information about how they return images.\n */\n\n/**\n * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias ImageryProvider\n * @constructor\n * @abstract\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see OpenStreetMapImageryProvider\n * @see TileMapServiceImageryProvider\n * @see GoogleEarthEnterpriseImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see GridImageryProvider\n * @see IonImageryProvider\n * @see MapboxImageryProvider\n * @see MapboxStyleImageryProvider\n * @see SingleTileImageryProvider\n * @see TileCoordinatesImageryProvider\n * @see UrlTemplateImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers.html|Cesium Sandcastle Imagery Layers Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html|Cesium Sandcastle Imagery Manipulation Demo}\n */\nfunction ImageryProvider() {\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n DeveloperError.throwInstantiationError();\n}\n\nObject.defineProperties(ImageryProvider.prototype, {\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof ImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof ImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link ImageryProvider#ready} returns true. Generally,\n * a minimum level should only be used when the rectangle of the imagery is small\n * enough that the number of tiles at the minimum level is small. An imagery\n * provider with more than a few tiles at the minimum level will lead to\n * rendering problems.\n * @memberof ImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the tiling scheme used by the provider. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof ImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof ImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof ImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof ImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nImageryProvider.prototype.getTileCredits = function (x, y, level) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} Returns a promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nImageryProvider.prototype.requestImage = function (x, y, level, request) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.\n * This function is optional, so it may not exist on all ImageryProviders.\n *\n * @function\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n DeveloperError.throwInstantiationError();\n};\n\nconst ktx2Regex = /\\.ktx2$/i;\n\n/**\n * Loads an image from a given URL. If the server referenced by the URL already has\n * too many requests pending, this function will instead return undefined, indicating\n * that the request should be retried later.\n *\n * @param {ImageryProvider} imageryProvider The imagery provider for the URL.\n * @param {Resource|String} url The URL of the image.\n * @returns {Promise.<ImageryTypes|CompressedTextureBuffer>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n */\nImageryProvider.loadImage = function (imageryProvider, url) {\n const resource = Resource.createIfNeeded(url);\n\n if (ktx2Regex.test(resource.url)) {\n // Resolves with `CompressedTextureBuffer`\n return loadKTX2(resource);\n } else if (\n defined(imageryProvider) &&\n defined(imageryProvider.tileDiscardPolicy)\n ) {\n // Resolves with `HTMLImageElement` or `ImageBitmap`\n return resource.fetchImage({\n preferBlob: true,\n preferImageBitmap: true,\n flipY: true,\n });\n }\n\n return resource.fetchImage({\n preferImageBitmap: true,\n flipY: true,\n });\n};\nexport default ImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport DiscardMissingTileImagePolicy from \"./DiscardMissingTileImagePolicy.js\";\nimport ImageryLayerFeatureInfo from \"./ImageryLayerFeatureInfo.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {Object} ArcGisMapServerImageryProvider.ConstructorOptions\n *\n * Initialization options for the ArcGisMapServerImageryProvider constructor\n *\n * @property {Resource|String} url The URL of the ArcGIS MapServer service.\n * @property {String} [token] The ArcGIS token used to authenticate with the ArcGIS MapServer service.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n * is invalid and should be discarded. If this value is not specified, a default\n * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a\n * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,\n * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),\n * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is\n * disabled and no tiles are discarded. If any of them have a non-transparent color, any\n * tile that has the same values in these pixel locations is discarded. The end result of\n * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure\n * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this\n * parameter.\n * @property {Boolean} [usePreCachedTilesIfAvailable=true] If true, the server's pre-cached\n * tiles are used if they are available. If false, any pre-cached tiles are ignored and the\n * 'export' service is used.\n * @property {String} [layers] A comma-separated list of the layers to show, or undefined if all layers should be shown.\n * @property {Boolean} [enablePickFeatures=true] If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke\n * the Identify service on the MapServer and return the features included in the response. If false,\n * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n * without communicating with the server. Set this property to false if you don't want this provider's features to\n * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer. This parameter is ignored when accessing\n * a tiled layer.\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.\n * This parameter is ignored when accessing a tiled server.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified and used,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.\n * @property {Number} [tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server.\n * @property {Number} [tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server.\n * @property {Number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing\n * a tiled server.\n */\n\n/**\n * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are\n * used, if available.\n *\n * @alias ArcGisMapServerImageryProvider\n * @constructor\n *\n * @param {ArcGisMapServerImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const esri = new Cesium.ArcGisMapServerImageryProvider({\n * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'\n * });\n *\n * @see {@link https://developers.arcgis.com/rest/|ArcGIS Server REST API}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction ArcGisMapServerImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const resource = Resource.createIfNeeded(options.url);\n resource.appendForwardSlash();\n\n if (defined(options.token)) {\n resource.setQueryParameters({\n token: options.token,\n });\n }\n\n this._resource = resource;\n this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n this._maximumLevel = options.maximumLevel;\n this._tilingScheme = defaultValue(\n options.tilingScheme,\n new GeographicTilingScheme({ ellipsoid: options.ellipsoid })\n );\n this._useTiles = defaultValue(options.usePreCachedTilesIfAvailable, true);\n this._rectangle = defaultValue(\n options.rectangle,\n this._tilingScheme.rectangle\n );\n this._layers = options.layers;\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n /**\n * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will\n * invoke the \"identify\" operation on the ArcGIS server and return the features included in the response. If false,\n * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n * without communicating with the server.\n * @type {Boolean}\n * @default true\n */\n this.enablePickFeatures = defaultValue(options.enablePickFeatures, true);\n\n this._errorEvent = new Event();\n\n this._ready = false;\n\n // Grab the details of this MapServer.\n const that = this;\n let metadataError;\n\n function metadataSuccess(data) {\n const tileInfo = data.tileInfo;\n if (!defined(tileInfo)) {\n that._useTiles = false;\n } else {\n that._tileWidth = tileInfo.rows;\n that._tileHeight = tileInfo.cols;\n\n if (\n tileInfo.spatialReference.wkid === 102100 ||\n tileInfo.spatialReference.wkid === 102113\n ) {\n that._tilingScheme = new WebMercatorTilingScheme({\n ellipsoid: options.ellipsoid,\n });\n } else if (data.tileInfo.spatialReference.wkid === 4326) {\n that._tilingScheme = new GeographicTilingScheme({\n ellipsoid: options.ellipsoid,\n });\n } else if(data.fullExtent.spatialReference.wkid === 4490) {\n that._tilingScheme = new GeographicTilingScheme({ \n ellipsoid : options.ellipsoid,\n tileInfo:data.tileInfo, // \u4F20\u5165tileInfo\uFF0C\u7528\u4E8E\u540E\u9762GeographicTilingScheme\u7684\u8BA1\u7B97\n rectangle: that._rectangle\n });\n that._tilingScheme._tileInfo = data.tileInfo;//\u9644\u52A0\u81EA\u5B9A\u4E49\u5C5E\u6027\n } else {\n const message = `Tile spatial reference WKID ${data.tileInfo.spatialReference.wkid} is not supported.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message,\n undefined,\n undefined,\n undefined\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n that._maximumLevel = defaultValue(options.maximumLevel, data.tileInfo.lods.length - 1);\n\n if (defined(data.fullExtent)) {\n if (\n defined(data.fullExtent.spatialReference) &&\n defined(data.fullExtent.spatialReference.wkid)\n ) {\n if (\n data.fullExtent.spatialReference.wkid === 102100 ||\n data.fullExtent.spatialReference.wkid === 102113\n ) {\n const projection = new WebMercatorProjection();\n const extent = data.fullExtent;\n const sw = projection.unproject(\n new Cartesian3(\n Math.max(\n extent.xmin,\n -that._tilingScheme.ellipsoid.maximumRadius * Math.PI\n ),\n Math.max(\n extent.ymin,\n -that._tilingScheme.ellipsoid.maximumRadius * Math.PI\n ),\n 0.0\n )\n );\n const ne = projection.unproject(\n new Cartesian3(\n Math.min(\n extent.xmax,\n that._tilingScheme.ellipsoid.maximumRadius * Math.PI\n ),\n Math.min(\n extent.ymax,\n that._tilingScheme.ellipsoid.maximumRadius * Math.PI\n ),\n 0.0\n )\n );\n options.rectangle || (that._rectangle = new Rectangle(\n sw.longitude,\n sw.latitude,\n ne.longitude,\n ne.latitude\n ));\n } else if (data.fullExtent.spatialReference.wkid === 4326 || data.fullExtent.spatialReference.wkid === 4490) {\n options.rectangle || (that._rectangle = Rectangle.fromDegrees(\n data.fullExtent.xmin,\n data.fullExtent.ymin,\n data.fullExtent.xmax,\n data.fullExtent.ymax\n ));\n } else {\n const extentMessage = `fullExtent.spatialReference WKID ${data.fullExtent.spatialReference.wkid} is not supported.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n extentMessage,\n undefined,\n undefined,\n undefined\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(extentMessage));\n }\n }\n } else {\n that._rectangle = that._tilingScheme.rectangle;\n }\n\n // Install the default tile discard policy if none has been supplied.\n if (!defined(that._tileDiscardPolicy)) {\n that._tileDiscardPolicy = new DiscardMissingTileImagePolicy({\n missingImageUrl: buildImageResource(that, 0, 0, that._maximumLevel)\n .url,\n pixelsToCheck: [\n new Cartesian2(0, 0),\n new Cartesian2(200, 20),\n new Cartesian2(20, 200),\n new Cartesian2(80, 110),\n new Cartesian2(160, 130),\n ],\n disableCheckIfAllPixelsAreTransparent: true,\n });\n }\n\n that._useTiles = true;\n }\n\n if (defined(data.copyrightText) && data.copyrightText.length > 0) {\n that._credit = new Credit(data.copyrightText);\n }\n\n that._ready = true;\n TileProviderError.reportSuccess(metadataError);\n return Promise.resolve(true);\n }\n\n function metadataFailure(e) {\n const message = `An error occurred while accessing ${that._resource.url}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message,\n undefined,\n undefined,\n undefined\n );\n return Promise.reject(new RuntimeError(message));\n }\n function requestMetadata() {\n const resource = that._resource.getDerivedResource({\n queryParameters: {\n f: \"json\",\n },\n });\n return resource.fetchJsonp().then(metadataSuccess).catch(metadataFailure);\n }\n\n if (this._useTiles) {\n this._readyPromise = requestMetadata();\n } else {\n this._ready = true;\n this._readyPromise = Promise.resolve(true);\n }\n}\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n let resource;\n if (imageryProvider._useTiles) {\n resource = imageryProvider._resource.getDerivedResource({\n url: `tile/${level}/${y}/${x}`,\n request: request,\n });\n } else {\n const nativeRectangle = imageryProvider._tilingScheme.tileXYToNativeRectangle(\n x,\n y,\n level\n );\n const bbox = `${nativeRectangle.west},${nativeRectangle.south},${nativeRectangle.east},${nativeRectangle.north}`;\n\n const query = {\n bbox: bbox,\n size: `${imageryProvider._tileWidth},${imageryProvider._tileHeight}`,\n format: \"png32\",\n transparent: true,\n f: \"image\",\n };\n\n if (\n imageryProvider._tilingScheme.projection instanceof GeographicProjection\n ) {\n query.bboxSR = 4326;\n query.imageSR = 4326;\n } else {\n query.bboxSR = 3857;\n query.imageSR = 3857;\n }\n if (imageryProvider.layers) {\n query.layers = `show:${imageryProvider.layers}`;\n }\n\n resource = imageryProvider._resource.getDerivedResource({\n url: \"export\",\n request: request,\n queryParameters: query,\n });\n }\n\n return resource;\n}\n\nObject.defineProperties(ArcGisMapServerImageryProvider.prototype, {\n /**\n * Gets the URL of the ArcGIS MapServer.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource._url;\n },\n },\n\n /**\n * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n token: {\n get: function () {\n return this._resource.queryParameters.token;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n * @memberof ArcGisMapServerImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether this imagery provider is using pre-cached tiles from the\n * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function\n * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does\n * not have pre-cached tiles.\n * @memberof ArcGisMapServerImageryProvider.prototype\n *\n * @type {Boolean}\n * @readonly\n * @default true\n */\n usingPrecachedTiles: {\n get: function () {\n return this._useTiles;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof ArcGisMapServerImageryProvider.prototype\n *\n * @type {Boolean}\n * @readonly\n * @default true\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets the comma-separated list of layer IDs to show.\n * @memberof ArcGisMapServerImageryProvider.prototype\n *\n * @type {String}\n */\n layers: {\n get: function () {\n return this._layers;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nArcGisMapServerImageryProvider.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nArcGisMapServerImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n return ImageryProvider.loadImage(\n this,\n buildImageResource(this, x, y, level, request)\n );\n};\n\n/**\n /**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nArcGisMapServerImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n if (!this.enablePickFeatures) {\n return undefined;\n }\n\n const rectangle = this._tilingScheme.tileXYToNativeRectangle(x, y, level);\n\n let horizontal;\n let vertical;\n let sr;\n if (this._tilingScheme.projection instanceof GeographicProjection) {\n horizontal = CesiumMath.toDegrees(longitude);\n vertical = CesiumMath.toDegrees(latitude);\n sr = \"4326\";\n } else {\n const projected = this._tilingScheme.projection.project(\n new Cartographic(longitude, latitude, 0.0)\n );\n horizontal = projected.x;\n vertical = projected.y;\n sr = \"3857\";\n }\n\n let layers = \"visible\";\n if (defined(this._layers)) {\n layers += `:${this._layers}`;\n }\n\n const query = {\n f: \"json\",\n tolerance: 2,\n geometryType: \"esriGeometryPoint\",\n geometry: `${horizontal},${vertical}`,\n mapExtent: `${rectangle.west},${rectangle.south},${rectangle.east},${rectangle.north}`,\n imageDisplay: `${this._tileWidth},${this._tileHeight},96`,\n sr: sr,\n layers: layers,\n };\n\n const resource = this._resource.getDerivedResource({\n url: \"identify\",\n queryParameters: query,\n });\n\n return resource.fetchJson().then(function (json) {\n const result = [];\n\n const features = json.results;\n if (!defined(features)) {\n return result;\n }\n\n for (let i = 0; i < features.length; ++i) {\n const feature = features[i];\n\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.data = feature;\n featureInfo.name = feature.value;\n featureInfo.properties = feature.attributes;\n featureInfo.configureDescriptionFromProperties(feature.attributes);\n\n // If this is a point feature, use the coordinates of the point.\n if (feature.geometryType === \"esriGeometryPoint\" && feature.geometry) {\n const wkid =\n feature.geometry.spatialReference &&\n feature.geometry.spatialReference.wkid\n ? feature.geometry.spatialReference.wkid\n : 4326;\n if (wkid === 4326 || wkid === 4283) {\n featureInfo.position = Cartographic.fromDegrees(\n feature.geometry.x,\n feature.geometry.y,\n feature.geometry.z\n );\n } else if (wkid === 102100 || wkid === 900913 || wkid === 3857) {\n const projection = new WebMercatorProjection();\n featureInfo.position = projection.unproject(\n new Cartesian3(\n feature.geometry.x,\n feature.geometry.y,\n feature.geometry.z\n )\n );\n }\n }\n\n result.push(featureInfo);\n }\n\n return result;\n });\n};\nexport default ArcGisMapServerImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\n\n/**\n * A post process stage that will get the luminance value at each pixel and\n * uses parallel reduction to compute the average luminance in a 1x1 texture.\n * This texture can be used as input for tone mapping.\n *\n * @constructor\n * @private\n */\nfunction AutoExposure() {\n this._uniformMap = undefined;\n this._command = undefined;\n\n this._colorTexture = undefined;\n this._depthTexture = undefined;\n\n this._ready = false;\n\n this._name = \"czm_autoexposure\";\n\n this._logDepthChanged = undefined;\n this._useLogDepth = undefined;\n\n this._framebuffers = undefined;\n this._previousLuminance = new FramebufferManager();\n\n this._commands = undefined;\n this._clearCommand = undefined;\n\n this._minMaxLuminance = new Cartesian2();\n\n /**\n * Whether or not to execute this post-process stage when ready.\n *\n * @type {Boolean}\n */\n this.enabled = true;\n this._enabled = true;\n\n /**\n * The minimum value used to clamp the luminance.\n *\n * @type {Number}\n * @default 0.1\n */\n this.minimumLuminance = 0.1;\n\n /**\n * The maximum value used to clamp the luminance.\n *\n * @type {Number}\n * @default 10.0\n */\n this.maximumLuminance = 10.0;\n}\n\nObject.defineProperties(AutoExposure.prototype, {\n /**\n * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>\n * and {@link AutoExposure#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures\n * to load.\n *\n * @memberof AutoExposure.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n /**\n * The unique name of this post-process stage for reference by other stages.\n *\n * @memberof AutoExposure.prototype\n * @type {String}\n * @readonly\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n\n /**\n * A reference to the texture written to when executing this post process stage.\n *\n * @memberof AutoExposure.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n outputTexture: {\n get: function () {\n const framebuffers = this._framebuffers;\n if (!defined(framebuffers)) {\n return undefined;\n }\n return framebuffers[framebuffers.length - 1].getColorTexture(0);\n },\n },\n});\n\nfunction destroyFramebuffers(autoexposure) {\n const framebuffers = autoexposure._framebuffers;\n if (!defined(framebuffers)) {\n return;\n }\n\n const length = framebuffers.length;\n for (let i = 0; i < length; ++i) {\n framebuffers[i].destroy();\n }\n autoexposure._framebuffers = undefined;\n\n autoexposure._previousLuminance.destroy();\n autoexposure._previousLuminance = undefined;\n}\n\nfunction createFramebuffers(autoexposure, context) {\n destroyFramebuffers(autoexposure);\n\n let width = autoexposure._width;\n let height = autoexposure._height;\n\n const pixelDatatype = context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT;\n\n const length = Math.ceil(Math.log(Math.max(width, height)) / Math.log(3.0));\n const framebuffers = new Array(length);\n for (let i = 0; i < length; ++i) {\n width = Math.max(Math.ceil(width / 3.0), 1.0);\n height = Math.max(Math.ceil(height / 3.0), 1.0);\n framebuffers[i] = new FramebufferManager();\n framebuffers[i].update(context, width, height, 1, pixelDatatype);\n }\n\n const lastTexture = framebuffers[length - 1].getColorTexture(0);\n autoexposure._previousLuminance.update(\n context,\n lastTexture.width,\n lastTexture.height,\n 1,\n pixelDatatype\n );\n autoexposure._framebuffers = framebuffers;\n}\n\nfunction destroyCommands(autoexposure) {\n const commands = autoexposure._commands;\n if (!defined(commands)) {\n return;\n }\n\n const length = commands.length;\n for (let i = 0; i < length; ++i) {\n commands[i].shaderProgram.destroy();\n }\n autoexposure._commands = undefined;\n}\n\nfunction createUniformMap(autoexposure, index) {\n let uniforms;\n if (index === 0) {\n uniforms = {\n colorTexture: function () {\n return autoexposure._colorTexture;\n },\n colorTextureDimensions: function () {\n return autoexposure._colorTexture.dimensions;\n },\n };\n } else {\n const texture = autoexposure._framebuffers[index - 1].getColorTexture(0);\n uniforms = {\n colorTexture: function () {\n return texture;\n },\n colorTextureDimensions: function () {\n return texture.dimensions;\n },\n };\n }\n\n uniforms.minMaxLuminance = function () {\n return autoexposure._minMaxLuminance;\n };\n uniforms.previousLuminance = function () {\n return autoexposure._previousLuminance.getColorTexture(0);\n };\n\n return uniforms;\n}\n\nfunction getShaderSource(index, length) {\n let source =\n \"uniform sampler2D colorTexture; \\n\" +\n \"varying vec2 v_textureCoordinates; \\n\" +\n \"float sampleTexture(vec2 offset) { \\n\";\n\n if (index === 0) {\n source +=\n \" vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \\n\" +\n \" return czm_luminance(color.rgb); \\n\";\n } else {\n source +=\n \" return texture2D(colorTexture, v_textureCoordinates + offset).r; \\n\";\n }\n\n source += \"}\\n\\n\";\n\n source +=\n \"uniform vec2 colorTextureDimensions; \\n\" +\n \"uniform vec2 minMaxLuminance; \\n\" +\n \"uniform sampler2D previousLuminance; \\n\" +\n \"void main() { \\n\" +\n \" float color = 0.0; \\n\" +\n \" float xStep = 1.0 / colorTextureDimensions.x; \\n\" +\n \" float yStep = 1.0 / colorTextureDimensions.y; \\n\" +\n \" int count = 0; \\n\" +\n \" for (int i = 0; i < 3; ++i) { \\n\" +\n \" for (int j = 0; j < 3; ++j) { \\n\" +\n \" vec2 offset; \\n\" +\n \" offset.x = -xStep + float(i) * xStep; \\n\" +\n \" offset.y = -yStep + float(j) * yStep; \\n\" +\n \" if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \\n\" +\n \" continue; \\n\" +\n \" } \\n\" +\n \" color += sampleTexture(offset); \\n\" +\n \" ++count; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \" if (count > 0) { \\n\" +\n \" color /= float(count); \\n\" +\n \" } \\n\";\n\n if (index === length - 1) {\n source +=\n \" float previous = texture2D(previousLuminance, vec2(0.5)).r; \\n\" +\n \" color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \\n\" +\n \" color = previous + (color - previous) / (60.0 * 1.5); \\n\" +\n \" color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \\n\";\n }\n\n source += \" gl_FragColor = vec4(color); \\n\" + \"} \\n\";\n return source;\n}\n\nfunction createCommands(autoexposure, context) {\n destroyCommands(autoexposure);\n const framebuffers = autoexposure._framebuffers;\n const length = framebuffers.length;\n\n const commands = new Array(length);\n\n for (let i = 0; i < length; ++i) {\n commands[i] = context.createViewportQuadCommand(\n getShaderSource(i, length),\n {\n framebuffer: framebuffers[i].framebuffer,\n uniformMap: createUniformMap(autoexposure, i),\n }\n );\n }\n autoexposure._commands = commands;\n}\n\n/**\n * A function that will be called before execute. Used to clear any textures attached to framebuffers.\n * @param {Context} context The context.\n * @private\n */\nAutoExposure.prototype.clear = function (context) {\n const framebuffers = this._framebuffers;\n if (!defined(framebuffers)) {\n return;\n }\n\n let clearCommand = this._clearCommand;\n if (!defined(clearCommand)) {\n clearCommand = this._clearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n framebuffer: undefined,\n });\n }\n\n const length = framebuffers.length;\n for (let i = 0; i < length; ++i) {\n framebuffers[i].clear(context, clearCommand);\n }\n};\n\n/**\n * A function that will be called before execute. Used to create WebGL resources and load any textures.\n * @param {Context} context The context.\n * @private\n */\nAutoExposure.prototype.update = function (context) {\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n\n if (width !== this._width || height !== this._height) {\n this._width = width;\n this._height = height;\n\n createFramebuffers(this, context);\n createCommands(this, context);\n\n if (!this._ready) {\n this._ready = true;\n }\n }\n\n this._minMaxLuminance.x = this.minimumLuminance;\n this._minMaxLuminance.y = this.maximumLuminance;\n\n const framebuffers = this._framebuffers;\n const temp = framebuffers[framebuffers.length - 1];\n framebuffers[framebuffers.length - 1] = this._previousLuminance;\n this._commands[\n this._commands.length - 1\n ].framebuffer = this._previousLuminance.framebuffer;\n this._previousLuminance = temp;\n};\n\n/**\n * Executes the post-process stage. The color texture is the texture rendered to by the scene or from the previous stage.\n * @param {Context} context The context.\n * @param {Texture} colorTexture The input color texture.\n * @private\n */\nAutoExposure.prototype.execute = function (context, colorTexture) {\n this._colorTexture = colorTexture;\n\n const commands = this._commands;\n if (!defined(commands)) {\n return;\n }\n\n const length = commands.length;\n for (let i = 0; i < length; ++i) {\n commands[i].execute(context);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see AutoExposure#destroy\n */\nAutoExposure.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see AutoExposure#isDestroyed\n */\nAutoExposure.prototype.destroy = function () {\n destroyFramebuffers(this);\n destroyCommands(this);\n return destroyObject(this);\n};\nexport default AutoExposure;\n", "/**\n * The types of imagery provided by Bing Maps.\n *\n * @enum {Number}\n *\n * @see BingMapsImageryProvider\n */\nconst BingMapsStyle = {\n /**\n * Aerial imagery.\n *\n * @type {String}\n * @constant\n */\n AERIAL: \"Aerial\",\n\n /**\n * Aerial imagery with a road overlay.\n *\n * @type {String}\n * @constant\n * @deprecated See https://github.com/CesiumGS/cesium/issues/7128.\n * Use `BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND` instead\n */\n AERIAL_WITH_LABELS: \"AerialWithLabels\",\n\n /**\n * Aerial imagery with a road overlay.\n *\n * @type {String}\n * @constant\n */\n AERIAL_WITH_LABELS_ON_DEMAND: \"AerialWithLabelsOnDemand\",\n\n /**\n * Roads without additional imagery.\n *\n * @type {String}\n * @constant\n * @deprecated See https://github.com/CesiumGS/cesium/issues/7128.\n * Use `BingMapsStyle.ROAD_ON_DEMAND` instead\n */\n ROAD: \"Road\",\n\n /**\n * Roads without additional imagery.\n *\n * @type {String}\n * @constant\n */\n ROAD_ON_DEMAND: \"RoadOnDemand\",\n\n /**\n * A dark version of the road maps.\n *\n * @type {String}\n * @constant\n */\n CANVAS_DARK: \"CanvasDark\",\n\n /**\n * A lighter version of the road maps.\n *\n * @type {String}\n * @constant\n */\n CANVAS_LIGHT: \"CanvasLight\",\n\n /**\n * A grayscale version of the road maps.\n *\n * @type {String}\n * @constant\n */\n CANVAS_GRAY: \"CanvasGray\",\n\n /**\n * Ordnance Survey imagery. This imagery is visible only for the London, UK area.\n *\n * @type {String}\n * @constant\n */\n ORDNANCE_SURVEY: \"OrdnanceSurvey\",\n\n /**\n * Collins Bart imagery.\n *\n * @type {String}\n * @constant\n */\n COLLINS_BART: \"CollinsBart\",\n};\nexport default Object.freeze(BingMapsStyle);\n", "import defined from \"../Core/defined.js\";\n\n/**\n * A policy for discarding tile images that contain no data (and so aren't actually images).\n * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is\n * expected to be used in place of any empty tile images by the image loading code.\n *\n * @alias DiscardEmptyTileImagePolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n */\nfunction DiscardEmptyTileImagePolicy(options) {}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {Boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nDiscardEmptyTileImagePolicy.prototype.isReady = function () {\n return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {Boolean} True if the image should be discarded; otherwise, false.\n */\nDiscardEmptyTileImagePolicy.prototype.shouldDiscardImage = function (image) {\n return DiscardEmptyTileImagePolicy.EMPTY_IMAGE === image;\n};\n\nlet emptyImage;\n\nObject.defineProperties(DiscardEmptyTileImagePolicy, {\n /**\n * Default value for representing an empty image.\n * @type {HTMLImageElement}\n * @readonly\n * @memberof DiscardEmptyTileImagePolicy\n */\n EMPTY_IMAGE: {\n get: function () {\n if (!defined(emptyImage)) {\n emptyImage = new Image();\n // load a blank data URI with a 1x1 transparent pixel.\n emptyImage.src =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\";\n }\n return emptyImage;\n },\n },\n});\nexport default DiscardEmptyTileImagePolicy;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport BingMapsStyle from \"./BingMapsStyle.js\";\nimport DiscardEmptyTilePolicy from \"./DiscardEmptyTileImagePolicy.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {Object} BingMapsImageryProvider.ConstructorOptions\n *\n * Initialization options for the BingMapsImageryProvider constructor\n *\n * @property {Resource|String} url The url of the Bing Maps server hosting the imagery.\n * @property {String} key The Bing Maps key for your application, which can be\n * created at {@link https://www.bingmapsportal.com/}.\n * @property {String} [tileProtocol] The protocol to use when loading tiles, e.g. 'http' or 'https'.\n * By default, tiles are loaded using the same protocol as the page.\n * @property {BingMapsStyle} [mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load.\n * @property {String} [culture=''] The culture to use when requesting Bing Maps imagery. Not\n * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}\n * for information on the supported cultures.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}\n * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.\n * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.\n */\n\n/**\n * Provides tiled imagery using the Bing Maps Imagery REST API.\n *\n * @alias BingMapsImageryProvider\n * @constructor\n *\n * @param {BingMapsImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const bing = new Cesium.BingMapsImageryProvider({\n * url : 'https://dev.virtualearth.net',\n * key : 'get-yours-at-https://www.bingmapsportal.com/',\n * mapStyle : Cesium.BingMapsStyle.AERIAL\n * });\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/ff701713.aspx|Bing Maps REST Services}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction BingMapsImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const accessKey = options.key;\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default 1.0\n */\n this.defaultGamma = 1.0;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n this._key = accessKey;\n this._resource = Resource.createIfNeeded(options.url);\n this._resource.appendForwardSlash();\n this._tileProtocol = options.tileProtocol;\n this._mapStyle = defaultValue(options.mapStyle, BingMapsStyle.AERIAL);\n this._culture = defaultValue(options.culture, \"\");\n\n this._tileDiscardPolicy = options.tileDiscardPolicy;\n if (!defined(this._tileDiscardPolicy)) {\n this._tileDiscardPolicy = new DiscardEmptyTilePolicy();\n }\n\n this._proxy = options.proxy;\n this._credit = new Credit(\n `<a href=\"http://www.bing.com\"><img src=\"${BingMapsImageryProvider.logoUrl}\" title=\"Bing Imagery\"/></a>`\n );\n\n this._tilingScheme = new WebMercatorTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 2,\n ellipsoid: options.ellipsoid,\n });\n\n this._tileWidth = undefined;\n this._tileHeight = undefined;\n this._maximumLevel = undefined;\n this._imageUrlTemplate = undefined;\n this._imageUrlSubdomains = undefined;\n\n this._errorEvent = new Event();\n\n this._ready = false;\n\n let tileProtocol = this._tileProtocol;\n\n // For backward compatibility reasons, the tileProtocol may end with\n // a `:`. Remove it.\n if (defined(tileProtocol)) {\n if (\n tileProtocol.length > 0 &&\n tileProtocol[tileProtocol.length - 1] === \":\"\n ) {\n tileProtocol = tileProtocol.substr(0, tileProtocol.length - 1);\n }\n } else {\n // use http if the document's protocol is http, otherwise use https\n const documentProtocol = document.location.protocol;\n tileProtocol = documentProtocol === \"http:\" ? \"http\" : \"https\";\n }\n\n const metadataResource = this._resource.getDerivedResource({\n url: `REST/v1/Imagery/Metadata/${this._mapStyle}`,\n queryParameters: {\n incl: \"ImageryProviders\",\n key: this._key,\n uriScheme: tileProtocol,\n },\n });\n const that = this;\n let metadataError;\n\n function metadataSuccess(data) {\n if (data.resourceSets.length !== 1) {\n return metadataFailure();\n }\n const resource = data.resourceSets[0].resources[0];\n\n that._tileWidth = resource.imageWidth;\n that._tileHeight = resource.imageHeight;\n that._maximumLevel = resource.zoomMax - 1;\n that._imageUrlSubdomains = resource.imageUrlSubdomains;\n that._imageUrlTemplate = resource.imageUrl;\n\n let attributionList = (that._attributionList = resource.imageryProviders);\n if (!attributionList) {\n attributionList = that._attributionList = [];\n }\n\n for (\n let attributionIndex = 0, attributionLength = attributionList.length;\n attributionIndex < attributionLength;\n ++attributionIndex\n ) {\n const attribution = attributionList[attributionIndex];\n\n if (attribution.credit instanceof Credit) {\n // If attribution.credit has already been created\n // then we are using a cached value, which means\n // none of the remaining processing needs to be done.\n break;\n }\n\n attribution.credit = new Credit(attribution.attribution);\n const coverageAreas = attribution.coverageAreas;\n\n for (\n let areaIndex = 0, areaLength = attribution.coverageAreas.length;\n areaIndex < areaLength;\n ++areaIndex\n ) {\n const area = coverageAreas[areaIndex];\n const bbox = area.bbox;\n area.bbox = new Rectangle(\n CesiumMath.toRadians(bbox[1]),\n CesiumMath.toRadians(bbox[0]),\n CesiumMath.toRadians(bbox[3]),\n CesiumMath.toRadians(bbox[2])\n );\n }\n }\n\n that._ready = true;\n TileProviderError.reportSuccess(metadataError);\n return Promise.resolve(true);\n }\n\n function metadataFailure(e) {\n const message = `An error occurred while accessing ${metadataResource.url}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message,\n undefined,\n undefined,\n undefined\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n const cacheKey = metadataResource.url;\n function requestMetadata() {\n const promise = metadataResource.fetchJsonp(\"jsonp\");\n BingMapsImageryProvider._metadataCache[cacheKey] = promise;\n return promise.then(metadataSuccess).catch(metadataFailure);\n }\n\n const promise = BingMapsImageryProvider._metadataCache[cacheKey];\n if (defined(promise)) {\n this._readyPromise = promise.then(metadataSuccess).catch(metadataFailure);\n } else {\n this._readyPromise = requestMetadata();\n }\n}\n\nObject.defineProperties(BingMapsImageryProvider.prototype, {\n /**\n * Gets the name of the BingMaps server url hosting the imagery.\n * @memberof BingMapsImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the Bing Maps key.\n * @memberof BingMapsImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n key: {\n get: function () {\n return this._key;\n },\n },\n\n /**\n * Gets the type of Bing Maps imagery to load.\n * @memberof BingMapsImageryProvider.prototype\n * @type {BingMapsStyle}\n * @readonly\n */\n mapStyle: {\n get: function () {\n return this._mapStyle;\n },\n },\n\n /**\n * The culture to use when requesting Bing Maps imagery. Not\n * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}\n * for information on the supported cultures.\n * @memberof BingMapsImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n culture: {\n get: function () {\n return this._culture;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage\n * and texture upload time.\n * @memberof BingMapsImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return false;\n },\n },\n});\n\nconst rectangleScratch = new Rectangle();\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nBingMapsImageryProvider.prototype.getTileCredits = function (x, y, level) {\n const rectangle = this._tilingScheme.tileXYToRectangle(\n x,\n y,\n level,\n rectangleScratch\n );\n const result = getRectangleAttribution(\n this._attributionList,\n level,\n rectangle\n );\n\n return result;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link BingMapsImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nBingMapsImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const promise = ImageryProvider.loadImage(\n this,\n buildImageResource(this, x, y, level, request)\n );\n\n if (defined(promise)) {\n return promise.catch(function (error) {\n // One cause of an error here is that the image we tried to load was zero-length.\n // This isn't actually a problem, since it indicates that there is no tile.\n // So, in that case we return the EMPTY_IMAGE sentinel value for later discarding.\n if (defined(error.blob) && error.blob.size === 0) {\n return DiscardEmptyTilePolicy.EMPTY_IMAGE;\n }\n return Promise.reject(error);\n });\n }\n\n return undefined;\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nBingMapsImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\n\n/**\n * Converts a tiles (x, y, level) position into a quadkey used to request an image\n * from a Bing Maps server.\n *\n * @param {Number} x The tile's x coordinate.\n * @param {Number} y The tile's y coordinate.\n * @param {Number} level The tile's zoom level.\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/bb259689.aspx|Bing Maps Tile System}\n * @see BingMapsImageryProvider#quadKeyToTileXY\n */\nBingMapsImageryProvider.tileXYToQuadKey = function (x, y, level) {\n let quadkey = \"\";\n for (let i = level; i >= 0; --i) {\n const bitmask = 1 << i;\n let digit = 0;\n\n if ((x & bitmask) !== 0) {\n digit |= 1;\n }\n\n if ((y & bitmask) !== 0) {\n digit |= 2;\n }\n\n quadkey += digit;\n }\n return quadkey;\n};\n\n/**\n * Converts a tile's quadkey used to request an image from a Bing Maps server into the\n * (x, y, level) position.\n *\n * @param {String} quadkey The tile's quad key\n *\n * @see {@link http://msdn.microsoft.com/en-us/library/bb259689.aspx|Bing Maps Tile System}\n * @see BingMapsImageryProvider#tileXYToQuadKey\n */\nBingMapsImageryProvider.quadKeyToTileXY = function (quadkey) {\n let x = 0;\n let y = 0;\n const level = quadkey.length - 1;\n for (let i = level; i >= 0; --i) {\n const bitmask = 1 << i;\n const digit = +quadkey[level - i];\n\n if ((digit & 1) !== 0) {\n x |= bitmask;\n }\n\n if ((digit & 2) !== 0) {\n y |= bitmask;\n }\n }\n return {\n x: x,\n y: y,\n level: level,\n };\n};\n\nBingMapsImageryProvider._logoUrl = undefined;\n\nObject.defineProperties(BingMapsImageryProvider, {\n /**\n * Gets or sets the URL to the Bing logo for display in the credit.\n * @memberof BingMapsImageryProvider\n * @type {String}\n */\n logoUrl: {\n get: function () {\n if (!defined(BingMapsImageryProvider._logoUrl)) {\n BingMapsImageryProvider._logoUrl = buildModuleUrl(\n \"Assets/Images/bing_maps_credit.png\"\n );\n }\n return BingMapsImageryProvider._logoUrl;\n },\n set: function (value) {\n BingMapsImageryProvider._logoUrl = value;\n },\n },\n});\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n const imageUrl = imageryProvider._imageUrlTemplate;\n\n const subdomains = imageryProvider._imageUrlSubdomains;\n const subdomainIndex = (x + y + level) % subdomains.length;\n\n return imageryProvider._resource.getDerivedResource({\n url: imageUrl,\n request: request,\n templateValues: {\n quadkey: BingMapsImageryProvider.tileXYToQuadKey(x, y, level),\n subdomain: subdomains[subdomainIndex],\n culture: imageryProvider._culture,\n },\n queryParameters: {\n // this parameter tells the Bing servers to send a zero-length response\n // instead of a placeholder image for missing tiles.\n n: \"z\",\n },\n });\n}\n\nconst intersectionScratch = new Rectangle();\n\nfunction getRectangleAttribution(attributionList, level, rectangle) {\n // Bing levels start at 1, while ours start at 0.\n ++level;\n\n const result = [];\n\n for (\n let attributionIndex = 0, attributionLength = attributionList.length;\n attributionIndex < attributionLength;\n ++attributionIndex\n ) {\n const attribution = attributionList[attributionIndex];\n const coverageAreas = attribution.coverageAreas;\n\n let included = false;\n\n for (\n let areaIndex = 0, areaLength = attribution.coverageAreas.length;\n !included && areaIndex < areaLength;\n ++areaIndex\n ) {\n const area = coverageAreas[areaIndex];\n if (level >= area.zoomMin && level <= area.zoomMax) {\n const intersection = Rectangle.intersection(\n rectangle,\n area.bbox,\n intersectionScratch\n );\n if (defined(intersection)) {\n included = true;\n }\n }\n }\n\n if (included) {\n result.push(attribution.credit);\n }\n }\n\n return result;\n}\n\n// Exposed for testing\nBingMapsImageryProvider._metadataCache = {};\nexport default BingMapsImageryProvider;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\nconst defaultDimensions = new Cartesian3(1.0, 1.0, 1.0);\n\n/**\n * A ParticleEmitter that emits particles within a box.\n * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.\n *\n * @alias BoxEmitter\n * @constructor\n *\n * @param {Cartesian3} dimensions The width, height and depth dimensions of the box.\n */\nfunction BoxEmitter(dimensions) {\n dimensions = defaultValue(dimensions, defaultDimensions);\n\n this._dimensions = Cartesian3.clone(dimensions);\n}\n\nObject.defineProperties(BoxEmitter.prototype, {\n /**\n * The width, height and depth dimensions of the box in meters.\n * @memberof BoxEmitter.prototype\n * @type {Cartesian3}\n * @default new Cartesian3(1.0, 1.0, 1.0)\n */\n dimensions: {\n get: function () {\n return this._dimensions;\n },\n set: function (value) {\nCartesian3.clone(value, this._dimensions);\n },\n },\n});\n\nconst scratchHalfDim = new Cartesian3();\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize.\n */\nBoxEmitter.prototype.emit = function (particle) {\n const dim = this._dimensions;\n const halfDim = Cartesian3.multiplyByScalar(dim, 0.5, scratchHalfDim);\n\n const x = CesiumMath.randomBetween(-halfDim.x, halfDim.x);\n const y = CesiumMath.randomBetween(-halfDim.y, halfDim.y);\n const z = CesiumMath.randomBetween(-halfDim.z, halfDim.z);\n\n particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n particle.velocity = Cartesian3.normalize(\n particle.position,\n particle.velocity\n );\n};\nexport default BoxEmitter;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport BrdfLutGeneratorFS from \"../Shaders/BrdfLutGeneratorFS.js\";\n\n/**\n * @private\n */\nfunction BrdfLutGenerator() {\n this._colorTexture = undefined;\n this._drawCommand = undefined;\n}\n\nObject.defineProperties(BrdfLutGenerator.prototype, {\n colorTexture: {\n get: function () {\n return this._colorTexture;\n },\n },\n});\n\nfunction createCommand(generator, context, framebuffer) {\n const drawCommand = context.createViewportQuadCommand(BrdfLutGeneratorFS, {\n framebuffer: framebuffer,\n renderState: RenderState.fromCache({\n viewport: new BoundingRectangle(0.0, 0.0, 256.0, 256.0),\n }),\n });\n\n generator._drawCommand = drawCommand;\n}\n\nBrdfLutGenerator.prototype.update = function (frameState) {\n if (!defined(this._colorTexture)) {\n const context = frameState.context;\n const colorTexture = new Texture({\n context: context,\n width: 256,\n height: 256,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n sampler: Sampler.NEAREST,\n });\n\n this._colorTexture = colorTexture;\n const framebuffer = new Framebuffer({\n context: context,\n colorTextures: [colorTexture],\n destroyAttachments: false,\n });\n\n createCommand(this, context, framebuffer);\n this._drawCommand.execute(context);\n framebuffer.destroy();\n this._drawCommand.shaderProgram =\n this._drawCommand.shaderProgram &&\n this._drawCommand.shaderProgram.destroy();\n }\n};\n\nBrdfLutGenerator.prototype.isDestroyed = function () {\n return false;\n};\n\nBrdfLutGenerator.prototype.destroy = function () {\n this._colorTexture = this._colorTexture && this._colorTexture.destroy();\n return destroyObject(this);\n};\nexport default BrdfLutGenerator;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Creates tweens for camera flights.\n * <br /><br />\n * Mouse interaction is disabled during flights.\n *\n * @private\n */\nconst CameraFlightPath = {};\n\nfunction getAltitude(frustum, dx, dy) {\n let near;\n let top;\n let right;\n if (frustum instanceof PerspectiveFrustum) {\n const tanTheta = Math.tan(0.5 * frustum.fovy);\n near = frustum.near;\n top = frustum.near * tanTheta;\n right = frustum.aspectRatio * top;\n return Math.max((dx * near) / right, (dy * near) / top);\n } else if (frustum instanceof PerspectiveOffCenterFrustum) {\n near = frustum.near;\n top = frustum.top;\n right = frustum.right;\n return Math.max((dx * near) / right, (dy * near) / top);\n }\n\n return Math.max(dx, dy);\n}\n\nconst scratchCart = new Cartesian3();\nconst scratchCart2 = new Cartesian3();\n\nfunction createPitchFunction(\n startPitch,\n endPitch,\n heightFunction,\n pitchAdjustHeight\n) {\n if (defined(pitchAdjustHeight) && heightFunction(0.5) > pitchAdjustHeight) {\n const startHeight = heightFunction(0.0);\n const endHeight = heightFunction(1.0);\n const middleHeight = heightFunction(0.5);\n\n const d1 = middleHeight - startHeight;\n const d2 = middleHeight - endHeight;\n\n return function (time) {\n const altitude = heightFunction(time);\n if (time <= 0.5) {\n const t1 = (altitude - startHeight) / d1;\n return CesiumMath.lerp(startPitch, -CesiumMath.PI_OVER_TWO, t1);\n }\n\n const t2 = (altitude - endHeight) / d2;\n return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO, endPitch, 1 - t2);\n };\n }\n return function (time) {\n return CesiumMath.lerp(startPitch, endPitch, time);\n };\n}\n\nfunction createHeightFunction(\n camera,\n destination,\n startHeight,\n endHeight,\n optionAltitude\n) {\n let altitude = optionAltitude;\n const maxHeight = Math.max(startHeight, endHeight);\n\n if (!defined(altitude)) {\n const start = camera.position;\n const end = destination;\n const up = camera.up;\n const right = camera.right;\n const frustum = camera.frustum;\n\n const diff = Cartesian3.subtract(start, end, scratchCart);\n const verticalDistance = Cartesian3.magnitude(\n Cartesian3.multiplyByScalar(up, Cartesian3.dot(diff, up), scratchCart2)\n );\n const horizontalDistance = Cartesian3.magnitude(\n Cartesian3.multiplyByScalar(\n right,\n Cartesian3.dot(diff, right),\n scratchCart2\n )\n );\n\n altitude = Math.min(\n getAltitude(frustum, verticalDistance, horizontalDistance) * 0.2,\n 1000000000.0\n );\n }\n\n if (maxHeight < altitude) {\n const power = 8.0;\n const factor = 1000000.0;\n\n const s = -Math.pow((altitude - startHeight) * factor, 1.0 / power);\n const e = Math.pow((altitude - endHeight) * factor, 1.0 / power);\n\n return function (t) {\n const x = t * (e - s) + s;\n return -Math.pow(x, power) / factor + altitude;\n };\n }\n\n return function (t) {\n return CesiumMath.lerp(startHeight, endHeight, t);\n };\n}\n\nfunction adjustAngleForLERP(startAngle, endAngle) {\n if (\n CesiumMath.equalsEpsilon(\n startAngle,\n CesiumMath.TWO_PI,\n CesiumMath.EPSILON11\n )\n ) {\n startAngle = 0.0;\n }\n\n if (endAngle > startAngle + Math.PI) {\n startAngle += CesiumMath.TWO_PI;\n } else if (endAngle < startAngle - Math.PI) {\n startAngle -= CesiumMath.TWO_PI;\n }\n\n return startAngle;\n}\n\nconst scratchStart = new Cartesian3();\n\nfunction createUpdateCV(\n scene,\n duration,\n destination,\n heading,\n pitch,\n roll,\n optionAltitude,\n optionPitchAdjustHeight\n) {\n const camera = scene.camera;\n\n const start = Cartesian3.clone(camera.position, scratchStart);\n const startPitch = camera.pitch;\n const startHeading = adjustAngleForLERP(camera.heading, heading);\n const startRoll = adjustAngleForLERP(camera.roll, roll);\n\n const heightFunction = createHeightFunction(\n camera,\n destination,\n start.z,\n destination.z,\n optionAltitude\n );\n\n const pitchFunction = createPitchFunction(\n startPitch,\n pitch,\n heightFunction,\n optionPitchAdjustHeight\n );\n\n function update(value) {\n const time = value.time / duration;\n\n camera.setView({\n orientation: {\n heading: CesiumMath.lerp(startHeading, heading, time),\n pitch: pitchFunction(time),\n roll: CesiumMath.lerp(startRoll, roll, time),\n },\n });\n\n Cartesian2.lerp(start, destination, time, camera.position);\n camera.position.z = heightFunction(time);\n }\n return update;\n}\n\nfunction useLongestFlight(startCart, destCart) {\n if (startCart.longitude < destCart.longitude) {\n startCart.longitude += CesiumMath.TWO_PI;\n } else {\n destCart.longitude += CesiumMath.TWO_PI;\n }\n}\n\nfunction useShortestFlight(startCart, destCart) {\n const diff = startCart.longitude - destCart.longitude;\n if (diff < -CesiumMath.PI) {\n startCart.longitude += CesiumMath.TWO_PI;\n } else if (diff > CesiumMath.PI) {\n destCart.longitude += CesiumMath.TWO_PI;\n }\n}\n\nconst scratchStartCart = new Cartographic();\nconst scratchEndCart = new Cartographic();\n\nfunction createUpdate3D(\n scene,\n duration,\n destination,\n heading,\n pitch,\n roll,\n optionAltitude,\n optionFlyOverLongitude,\n optionFlyOverLongitudeWeight,\n optionPitchAdjustHeight\n) {\n const camera = scene.camera;\n const projection = scene.mapProjection;\n const ellipsoid = projection.ellipsoid;\n\n const startCart = Cartographic.clone(\n camera.positionCartographic,\n scratchStartCart\n );\n const startPitch = camera.pitch;\n const startHeading = adjustAngleForLERP(camera.heading, heading);\n const startRoll = adjustAngleForLERP(camera.roll, roll);\n\n const destCart = ellipsoid.cartesianToCartographic(\n destination,\n scratchEndCart\n );\n startCart.longitude = CesiumMath.zeroToTwoPi(startCart.longitude);\n destCart.longitude = CesiumMath.zeroToTwoPi(destCart.longitude);\n\n let useLongFlight = false;\n\n if (defined(optionFlyOverLongitude)) {\n const hitLon = CesiumMath.zeroToTwoPi(optionFlyOverLongitude);\n\n const lonMin = Math.min(startCart.longitude, destCart.longitude);\n const lonMax = Math.max(startCart.longitude, destCart.longitude);\n\n const hitInside = hitLon >= lonMin && hitLon <= lonMax;\n\n if (defined(optionFlyOverLongitudeWeight)) {\n // Distance inside (0...2Pi)\n const din = Math.abs(startCart.longitude - destCart.longitude);\n // Distance outside (0...2Pi)\n const dot = CesiumMath.TWO_PI - din;\n\n const hitDistance = hitInside ? din : dot;\n const offDistance = hitInside ? dot : din;\n\n if (\n hitDistance < offDistance * optionFlyOverLongitudeWeight &&\n !hitInside\n ) {\n useLongFlight = true;\n }\n } else if (!hitInside) {\n useLongFlight = true;\n }\n }\n\n if (useLongFlight) {\n useLongestFlight(startCart, destCart);\n } else {\n useShortestFlight(startCart, destCart);\n }\n\n const heightFunction = createHeightFunction(\n camera,\n destination,\n startCart.height,\n destCart.height,\n optionAltitude\n );\n const pitchFunction = createPitchFunction(\n startPitch,\n pitch,\n heightFunction,\n optionPitchAdjustHeight\n );\n\n // Isolate scope for update function.\n // to have local copies of vars used in lerp\n // Othervise, if you call nex\n // createUpdate3D (createAnimationTween)\n // before you played animation, variables will be overwriten.\n function isolateUpdateFunction() {\n const startLongitude = startCart.longitude;\n const destLongitude = destCart.longitude;\n const startLatitude = startCart.latitude;\n const destLatitude = destCart.latitude;\n\n return function update(value) {\n const time = value.time / duration;\n\n const position = Cartesian3.fromRadians(\n CesiumMath.lerp(startLongitude, destLongitude, time),\n CesiumMath.lerp(startLatitude, destLatitude, time),\n heightFunction(time),\n ellipsoid\n );\n\n camera.setView({\n destination: position,\n orientation: {\n heading: CesiumMath.lerp(startHeading, heading, time),\n pitch: pitchFunction(time),\n roll: CesiumMath.lerp(startRoll, roll, time),\n },\n });\n };\n }\n return isolateUpdateFunction();\n}\n\nfunction createUpdate2D(\n scene,\n duration,\n destination,\n heading,\n pitch,\n roll,\n optionAltitude\n) {\n const camera = scene.camera;\n\n const start = Cartesian3.clone(camera.position, scratchStart);\n const startHeading = adjustAngleForLERP(camera.heading, heading);\n\n const startHeight = camera.frustum.right - camera.frustum.left;\n const heightFunction = createHeightFunction(\n camera,\n destination,\n startHeight,\n destination.z,\n optionAltitude\n );\n\n function update(value) {\n const time = value.time / duration;\n\n camera.setView({\n orientation: {\n heading: CesiumMath.lerp(startHeading, heading, time),\n },\n });\n\n Cartesian2.lerp(start, destination, time, camera.position);\n\n const zoom = heightFunction(time);\n\n const frustum = camera.frustum;\n const ratio = frustum.top / frustum.right;\n\n const incrementAmount = (zoom - (frustum.right - frustum.left)) * 0.5;\n frustum.right += incrementAmount;\n frustum.left -= incrementAmount;\n frustum.top = ratio * frustum.right;\n frustum.bottom = -frustum.top;\n }\n return update;\n}\n\nconst scratchCartographic = new Cartographic();\nconst scratchDestination = new Cartesian3();\n\nfunction emptyFlight(complete, cancel) {\n return {\n startObject: {},\n stopObject: {},\n duration: 0.0,\n complete: complete,\n cancel: cancel,\n };\n}\n\nfunction wrapCallback(controller, cb) {\n function wrapped() {\n if (typeof cb === \"function\") {\n cb();\n }\n\n controller.enableInputs = true;\n }\n return wrapped;\n}\n\nCameraFlightPath.createTween = function (scene, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let destination = options.destination;\n\nconst mode = scene.mode;\n\n if (mode === SceneMode.MORPHING) {\n return emptyFlight();\n }\n\n const convert = defaultValue(options.convert, true);\n const projection = scene.mapProjection;\n const ellipsoid = projection.ellipsoid;\n const maximumHeight = options.maximumHeight;\n const flyOverLongitude = options.flyOverLongitude;\n const flyOverLongitudeWeight = options.flyOverLongitudeWeight;\n const pitchAdjustHeight = options.pitchAdjustHeight;\n let easingFunction = options.easingFunction;\n\n if (convert && mode !== SceneMode.SCENE3D) {\n ellipsoid.cartesianToCartographic(destination, scratchCartographic);\n destination = projection.project(scratchCartographic, scratchDestination);\n }\n\n const camera = scene.camera;\n const transform = options.endTransform;\n if (defined(transform)) {\n camera._setTransform(transform);\n }\n\n let duration = options.duration;\n if (!defined(duration)) {\n duration =\n Math.ceil(Cartesian3.distance(camera.position, destination) / 1000000.0) +\n 2.0;\n duration = Math.min(duration, 3.0);\n }\n\n const heading = defaultValue(options.heading, 0.0);\n const pitch = defaultValue(options.pitch, -CesiumMath.PI_OVER_TWO);\n const roll = defaultValue(options.roll, 0.0);\n\n const controller = scene.screenSpaceCameraController;\n controller.enableInputs = false;\n\n const complete = wrapCallback(controller, options.complete);\n const cancel = wrapCallback(controller, options.cancel);\n\n const frustum = camera.frustum;\n\n let empty = scene.mode === SceneMode.SCENE2D;\n empty =\n empty &&\n Cartesian2.equalsEpsilon(camera.position, destination, CesiumMath.EPSILON6);\n empty =\n empty &&\n CesiumMath.equalsEpsilon(\n Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom),\n destination.z,\n CesiumMath.EPSILON6\n );\n\n empty =\n empty ||\n (scene.mode !== SceneMode.SCENE2D &&\n Cartesian3.equalsEpsilon(\n destination,\n camera.position,\n CesiumMath.EPSILON10\n ));\n\n empty =\n empty &&\n CesiumMath.equalsEpsilon(\n CesiumMath.negativePiToPi(heading),\n CesiumMath.negativePiToPi(camera.heading),\n CesiumMath.EPSILON10\n ) &&\n CesiumMath.equalsEpsilon(\n CesiumMath.negativePiToPi(pitch),\n CesiumMath.negativePiToPi(camera.pitch),\n CesiumMath.EPSILON10\n ) &&\n CesiumMath.equalsEpsilon(\n CesiumMath.negativePiToPi(roll),\n CesiumMath.negativePiToPi(camera.roll),\n CesiumMath.EPSILON10\n );\n\n if (empty) {\n return emptyFlight(complete, cancel);\n }\n\n const updateFunctions = new Array(4);\n updateFunctions[SceneMode.SCENE2D] = createUpdate2D;\n updateFunctions[SceneMode.SCENE3D] = createUpdate3D;\n updateFunctions[SceneMode.COLUMBUS_VIEW] = createUpdateCV;\n\n if (duration <= 0.0) {\n const newOnComplete = function () {\n const update = updateFunctions[mode](\n scene,\n 1.0,\n destination,\n heading,\n pitch,\n roll,\n maximumHeight,\n flyOverLongitude,\n flyOverLongitudeWeight,\n pitchAdjustHeight\n );\n update({ time: 1.0 });\n\n if (typeof complete === \"function\") {\n complete();\n }\n };\n return emptyFlight(newOnComplete, cancel);\n }\n\n const update = updateFunctions[mode](\n scene,\n duration,\n destination,\n heading,\n pitch,\n roll,\n maximumHeight,\n flyOverLongitude,\n flyOverLongitudeWeight,\n pitchAdjustHeight\n );\n\n if (!defined(easingFunction)) {\n const startHeight = camera.positionCartographic.height;\n const endHeight =\n mode === SceneMode.SCENE3D\n ? ellipsoid.cartesianToCartographic(destination).height\n : destination.z;\n\n if (startHeight > endHeight && startHeight > 11500.0) {\n easingFunction = EasingFunction.CUBIC_OUT;\n } else {\n easingFunction = EasingFunction.QUINTIC_IN_OUT;\n }\n }\n\n return {\n duration: duration,\n easingFunction: easingFunction,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: duration,\n },\n update: update,\n complete: complete,\n cancel: cancel,\n };\n};\nexport default CameraFlightPath;\n", "/**\n * Describes how the map will operate in 2D.\n *\n * @enum {Number}\n */\nconst MapMode2D = {\n /**\n * The 2D map can be rotated about the z axis.\n *\n * @type {Number}\n * @constant\n */\n ROTATE: 0,\n\n /**\n * The 2D map can be scrolled infinitely in the horizontal direction.\n *\n * @type {Number}\n * @constant\n */\n INFINITE_SCROLL: 1,\n};\nexport default Object.freeze(MapMode2D);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidGeodesic from \"../Core/EllipsoidGeodesic.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport HeadingPitchRange from \"../Core/HeadingPitchRange.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport CameraFlightPath from \"./CameraFlightPath.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * @typedef {Object} DirectionUp\n *\n * An orientation given by a pair of unit vectors\n *\n * @property {Cartesian3} direction The unit \"direction\" vector\n * @property {Cartesian3} up The unit \"up\" vector\n **/\n/**\n * @typedef {Object} HeadingPitchRollValues\n *\n * An orientation given by numeric heading, pitch, and roll\n *\n * @property {number} [heading=0.0] The heading in radians\n * @property {number} [pitch=-CesiumMath.PI_OVER_TWO] The pitch in radians\n * @property {number} [roll=0.0] The roll in meters\n **/\n\n/**\n * The camera is defined by a position, orientation, and view frustum.\n * <br /><br />\n * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.\n * <br /><br />\n * The viewing frustum is defined by 6 planes.\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\n * define the unit vector normal to the plane, and the w component is the distance of the\n * plane from the origin/camera position.\n *\n * @alias Camera\n *\n * @constructor\n *\n * @param {Scene} scene The scene.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera.html|Cesium Sandcastle Camera Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera%20Tutorial.html|Cesium Sandcastle Camera Tutorial Example}\n * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}\n *\n * @example\n * // Create a camera looking down the negative z-axis, positioned at the origin,\n * // with a field of view of 60 degrees, and 1:1 aspect ratio.\n * const camera = new Cesium.Camera(scene);\n * camera.position = new Cesium.Cartesian3();\n * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());\n * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);\n * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;\n * camera.frustum.near = 1.0;\n * camera.frustum.far = 2.0;\n */\nfunction Camera(scene) {\nthis._scene = scene;\n\n this._transform = Matrix4.clone(Matrix4.IDENTITY);\n this._invTransform = Matrix4.clone(Matrix4.IDENTITY);\n this._actualTransform = Matrix4.clone(Matrix4.IDENTITY);\n this._actualInvTransform = Matrix4.clone(Matrix4.IDENTITY);\n this._transformChanged = false;\n\n /**\n * The position of the camera.\n *\n * @type {Cartesian3}\n */\n this.position = new Cartesian3();\n this._position = new Cartesian3();\n this._positionWC = new Cartesian3();\n this._positionCartographic = new Cartographic();\n this._oldPositionWC = undefined;\n\n /**\n * The position delta magnitude.\n *\n * @private\n */\n this.positionWCDeltaMagnitude = 0.0;\n\n /**\n * The position delta magnitude last frame.\n *\n * @private\n */\n this.positionWCDeltaMagnitudeLastFrame = 0.0;\n\n /**\n * How long in seconds since the camera has stopped moving\n *\n * @private\n */\n this.timeSinceMoved = 0.0;\n this._lastMovedTimestamp = 0.0;\n\n /**\n * The view direction of the camera.\n *\n * @type {Cartesian3}\n */\n this.direction = new Cartesian3();\n this._direction = new Cartesian3();\n this._directionWC = new Cartesian3();\n\n /**\n * The up direction of the camera.\n *\n * @type {Cartesian3}\n */\n this.up = new Cartesian3();\n this._up = new Cartesian3();\n this._upWC = new Cartesian3();\n\n /**\n * The right direction of the camera.\n *\n * @type {Cartesian3}\n */\n this.right = new Cartesian3();\n this._right = new Cartesian3();\n this._rightWC = new Cartesian3();\n\n /**\n * The region of space in view.\n *\n * @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum}\n * @default PerspectiveFrustum()\n *\n * @see PerspectiveFrustum\n * @see PerspectiveOffCenterFrustum\n * @see OrthographicFrustum\n */\n this.frustum = new PerspectiveFrustum();\n this.frustum.aspectRatio =\n scene.drawingBufferWidth / scene.drawingBufferHeight;\n this.frustum.fov = CesiumMath.toRadians(60.0);\n\n /**\n * The default amount to move the camera when an argument is not\n * provided to the move methods.\n * @type {Number}\n * @default 100000.0;\n */\n this.defaultMoveAmount = 100000.0;\n /**\n * The default amount to rotate the camera when an argument is not\n * provided to the look methods.\n * @type {Number}\n * @default Math.PI / 60.0\n */\n this.defaultLookAmount = Math.PI / 60.0;\n /**\n * The default amount to rotate the camera when an argument is not\n * provided to the rotate methods.\n * @type {Number}\n * @default Math.PI / 3600.0\n */\n this.defaultRotateAmount = Math.PI / 3600.0;\n /**\n * The default amount to move the camera when an argument is not\n * provided to the zoom methods.\n * @type {Number}\n * @default 100000.0;\n */\n this.defaultZoomAmount = 100000.0;\n /**\n * If set, the camera will not be able to rotate past this axis in either direction.\n * @type {Cartesian3}\n * @default undefined\n */\n this.constrainedAxis = undefined;\n /**\n * The factor multiplied by the the map size used to determine where to clamp the camera position\n * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.\n * @type {Number}\n * @default 1.5\n */\n this.maximumZoomFactor = 1.5;\n\n this._moveStart = new Event();\n this._moveEnd = new Event();\n\n this._changed = new Event();\n this._changedPosition = undefined;\n this._changedDirection = undefined;\n this._changedFrustum = undefined;\n this._changedHeading = undefined;\n\n /**\n * The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.\n * @type {number}\n * @default 0.5\n */\n this.percentageChanged = 0.5;\n\n this._viewMatrix = new Matrix4();\n this._invViewMatrix = new Matrix4();\n updateViewMatrix(this);\n\n this._mode = SceneMode.SCENE3D;\n this._modeChanged = true;\n const projection = scene.mapProjection;\n this._projection = projection;\n this._maxCoord = projection.project(\n new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO)\n );\n this._max2Dfrustum = undefined;\n\n // set default view\n rectangleCameraPosition3D(\n this,\n Camera.DEFAULT_VIEW_RECTANGLE,\n this.position,\n true\n );\n\n let mag = Cartesian3.magnitude(this.position);\n mag += mag * Camera.DEFAULT_VIEW_FACTOR;\n Cartesian3.normalize(this.position, this.position);\n Cartesian3.multiplyByScalar(this.position, mag, this.position);\n}\n\n/**\n * @private\n */\nCamera.TRANSFORM_2D = new Matrix4(\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n);\n\n/**\n * @private\n */\nCamera.TRANSFORM_2D_INVERSE = Matrix4.inverseTransformation(\n Camera.TRANSFORM_2D,\n new Matrix4()\n);\n\n/**\n * The default rectangle the camera will view on creation.\n * @type Rectangle\n */\nCamera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees(\n -95.0,\n -20.0,\n -70.0,\n 90.0\n);\n\n/**\n * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.\n * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero\n * will move it further away from the extent, and a value less than zero will move it close to the extent.\n * @type Number\n */\nCamera.DEFAULT_VIEW_FACTOR = 0.5;\n\n/**\n * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.\n * @type HeadingPitchRange\n */\nCamera.DEFAULT_OFFSET = new HeadingPitchRange(\n 0.0,\n -CesiumMath.PI_OVER_FOUR,\n 0.0\n);\n\nfunction updateViewMatrix(camera) {\n Matrix4.computeView(\n camera._position,\n camera._direction,\n camera._up,\n camera._right,\n camera._viewMatrix\n );\n Matrix4.multiply(\n camera._viewMatrix,\n camera._actualInvTransform,\n camera._viewMatrix\n );\n Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);\n}\n\nfunction updateCameraDeltas(camera) {\n if (!defined(camera._oldPositionWC)) {\n camera._oldPositionWC = Cartesian3.clone(\n camera.positionWC,\n camera._oldPositionWC\n );\n } else {\n camera.positionWCDeltaMagnitudeLastFrame = camera.positionWCDeltaMagnitude;\n const delta = Cartesian3.subtract(\n camera.positionWC,\n camera._oldPositionWC,\n camera._oldPositionWC\n );\n camera.positionWCDeltaMagnitude = Cartesian3.magnitude(delta);\n camera._oldPositionWC = Cartesian3.clone(\n camera.positionWC,\n camera._oldPositionWC\n );\n\n // Update move timers\n if (camera.positionWCDeltaMagnitude > 0.0) {\n camera.timeSinceMoved = 0.0;\n camera._lastMovedTimestamp = getTimestamp();\n } else {\n camera.timeSinceMoved =\n Math.max(getTimestamp() - camera._lastMovedTimestamp, 0.0) / 1000.0;\n }\n }\n}\n\n/**\n * Checks if there's a camera flight with preload for this camera.\n *\n * @returns {Boolean} Whether or not this camera has a current flight with a valid preloadFlightCamera in scene.\n *\n * @private\n *\n */\nCamera.prototype.canPreloadFlight = function () {\n return defined(this._currentFlight) && this._mode !== SceneMode.SCENE2D;\n};\n\nCamera.prototype._updateCameraChanged = function () {\n const camera = this;\n\n updateCameraDeltas(camera);\n\n if (camera._changed.numberOfListeners === 0) {\n return;\n }\n\n const percentageChanged = camera.percentageChanged;\n\n const currentHeading = camera.heading;\n\n if (!defined(camera._changedHeading)) {\n camera._changedHeading = currentHeading;\n }\n\n let delta =\n Math.abs(camera._changedHeading - currentHeading) % CesiumMath.TWO_PI;\n delta = delta > CesiumMath.PI ? CesiumMath.TWO_PI - delta : delta;\n\n // Since delta is computed as the shortest distance between two angles\n // the percentage is relative to the half circle.\n const headingChangedPercentage = delta / Math.PI;\n\n if (headingChangedPercentage > percentageChanged) {\n camera._changed.raiseEvent(headingChangedPercentage);\n camera._changedHeading = currentHeading;\n }\n\n if (camera._mode === SceneMode.SCENE2D) {\n if (!defined(camera._changedFrustum)) {\n camera._changedPosition = Cartesian3.clone(\n camera.position,\n camera._changedPosition\n );\n camera._changedFrustum = camera.frustum.clone();\n return;\n }\n\n const position = camera.position;\n const lastPosition = camera._changedPosition;\n\n const frustum = camera.frustum;\n const lastFrustum = camera._changedFrustum;\n\n const x0 = position.x + frustum.left;\n const x1 = position.x + frustum.right;\n const x2 = lastPosition.x + lastFrustum.left;\n const x3 = lastPosition.x + lastFrustum.right;\n\n const y0 = position.y + frustum.bottom;\n const y1 = position.y + frustum.top;\n const y2 = lastPosition.y + lastFrustum.bottom;\n const y3 = lastPosition.y + lastFrustum.top;\n\n const leftX = Math.max(x0, x2);\n const rightX = Math.min(x1, x3);\n const bottomY = Math.max(y0, y2);\n const topY = Math.min(y1, y3);\n\n let areaPercentage;\n if (leftX >= rightX || bottomY >= y1) {\n areaPercentage = 1.0;\n } else {\n let areaRef = lastFrustum;\n if (x0 < x2 && x1 > x3 && y0 < y2 && y1 > y3) {\n areaRef = frustum;\n }\n areaPercentage =\n 1.0 -\n ((rightX - leftX) * (topY - bottomY)) /\n ((areaRef.right - areaRef.left) * (areaRef.top - areaRef.bottom));\n }\n\n if (areaPercentage > percentageChanged) {\n camera._changed.raiseEvent(areaPercentage);\n camera._changedPosition = Cartesian3.clone(\n camera.position,\n camera._changedPosition\n );\n camera._changedFrustum = camera.frustum.clone(camera._changedFrustum);\n }\n return;\n }\n\n if (!defined(camera._changedDirection)) {\n camera._changedPosition = Cartesian3.clone(\n camera.positionWC,\n camera._changedPosition\n );\n camera._changedDirection = Cartesian3.clone(\n camera.directionWC,\n camera._changedDirection\n );\n return;\n }\n\n const dirAngle = CesiumMath.acosClamped(\n Cartesian3.dot(camera.directionWC, camera._changedDirection)\n );\n\n let dirPercentage;\n if (defined(camera.frustum.fovy)) {\n dirPercentage = dirAngle / (camera.frustum.fovy * 0.5);\n } else {\n dirPercentage = dirAngle;\n }\n\n const distance = Cartesian3.distance(\n camera.positionWC,\n camera._changedPosition\n );\n const heightPercentage = distance / camera.positionCartographic.height;\n\n if (\n dirPercentage > percentageChanged ||\n heightPercentage > percentageChanged\n ) {\n camera._changed.raiseEvent(Math.max(dirPercentage, heightPercentage));\n camera._changedPosition = Cartesian3.clone(\n camera.positionWC,\n camera._changedPosition\n );\n camera._changedDirection = Cartesian3.clone(\n camera.directionWC,\n camera._changedDirection\n );\n }\n};\n\nfunction convertTransformForColumbusView(camera) {\n Transforms.basisTo2D(\n camera._projection,\n camera._transform,\n camera._actualTransform\n );\n}\n\nconst scratchCartographic = new Cartographic();\nconst scratchCartesian3Projection = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4Origin = new Cartesian4();\nconst scratchCartesian4NewOrigin = new Cartesian4();\nconst scratchCartesian4NewXAxis = new Cartesian4();\nconst scratchCartesian4NewYAxis = new Cartesian4();\nconst scratchCartesian4NewZAxis = new Cartesian4();\n\nfunction convertTransformFor2D(camera) {\n const projection = camera._projection;\n const ellipsoid = projection.ellipsoid;\n\n const origin = Matrix4.getColumn(\n camera._transform,\n 3,\n scratchCartesian4Origin\n );\n const cartographic = ellipsoid.cartesianToCartographic(\n origin,\n scratchCartographic\n );\n\n const projectedPosition = projection.project(\n cartographic,\n scratchCartesian3Projection\n );\n const newOrigin = scratchCartesian4NewOrigin;\n newOrigin.x = projectedPosition.z;\n newOrigin.y = projectedPosition.x;\n newOrigin.z = projectedPosition.y;\n newOrigin.w = 1.0;\n\n const newZAxis = Cartesian4.clone(\n Cartesian4.UNIT_X,\n scratchCartesian4NewZAxis\n );\n\n const xAxis = Cartesian4.add(\n Matrix4.getColumn(camera._transform, 0, scratchCartesian3),\n origin,\n scratchCartesian3\n );\n ellipsoid.cartesianToCartographic(xAxis, cartographic);\n\n projection.project(cartographic, projectedPosition);\n const newXAxis = scratchCartesian4NewXAxis;\n newXAxis.x = projectedPosition.z;\n newXAxis.y = projectedPosition.x;\n newXAxis.z = projectedPosition.y;\n newXAxis.w = 0.0;\n\n Cartesian3.subtract(newXAxis, newOrigin, newXAxis);\n newXAxis.x = 0.0;\n\n const newYAxis = scratchCartesian4NewYAxis;\n if (Cartesian3.magnitudeSquared(newXAxis) > CesiumMath.EPSILON10) {\n Cartesian3.cross(newZAxis, newXAxis, newYAxis);\n } else {\n const yAxis = Cartesian4.add(\n Matrix4.getColumn(camera._transform, 1, scratchCartesian3),\n origin,\n scratchCartesian3\n );\n ellipsoid.cartesianToCartographic(yAxis, cartographic);\n\n projection.project(cartographic, projectedPosition);\n newYAxis.x = projectedPosition.z;\n newYAxis.y = projectedPosition.x;\n newYAxis.z = projectedPosition.y;\n newYAxis.w = 0.0;\n\n Cartesian3.subtract(newYAxis, newOrigin, newYAxis);\n newYAxis.x = 0.0;\n\n if (Cartesian3.magnitudeSquared(newYAxis) < CesiumMath.EPSILON10) {\n Cartesian4.clone(Cartesian4.UNIT_Y, newXAxis);\n Cartesian4.clone(Cartesian4.UNIT_Z, newYAxis);\n }\n }\n\n Cartesian3.cross(newYAxis, newZAxis, newXAxis);\n Cartesian3.normalize(newXAxis, newXAxis);\n Cartesian3.cross(newZAxis, newXAxis, newYAxis);\n Cartesian3.normalize(newYAxis, newYAxis);\n\n Matrix4.setColumn(\n camera._actualTransform,\n 0,\n newXAxis,\n camera._actualTransform\n );\n Matrix4.setColumn(\n camera._actualTransform,\n 1,\n newYAxis,\n camera._actualTransform\n );\n Matrix4.setColumn(\n camera._actualTransform,\n 2,\n newZAxis,\n camera._actualTransform\n );\n Matrix4.setColumn(\n camera._actualTransform,\n 3,\n newOrigin,\n camera._actualTransform\n );\n}\n\nconst scratchCartesian = new Cartesian3();\n\nfunction updateMembers(camera) {\n const mode = camera._mode;\n\n let heightChanged = false;\n let height = 0.0;\n if (mode === SceneMode.SCENE2D) {\n height = camera.frustum.right - camera.frustum.left;\n heightChanged = height !== camera._positionCartographic.height;\n }\n\n let position = camera._position;\n const positionChanged =\n !Cartesian3.equals(position, camera.position) || heightChanged;\n if (positionChanged) {\n position = Cartesian3.clone(camera.position, camera._position);\n }\n\n let direction = camera._direction;\n const directionChanged = !Cartesian3.equals(direction, camera.direction);\n if (directionChanged) {\n Cartesian3.normalize(camera.direction, camera.direction);\n direction = Cartesian3.clone(camera.direction, camera._direction);\n }\n\n let up = camera._up;\n const upChanged = !Cartesian3.equals(up, camera.up);\n if (upChanged) {\n Cartesian3.normalize(camera.up, camera.up);\n up = Cartesian3.clone(camera.up, camera._up);\n }\n\n let right = camera._right;\n const rightChanged = !Cartesian3.equals(right, camera.right);\n if (rightChanged) {\n Cartesian3.normalize(camera.right, camera.right);\n right = Cartesian3.clone(camera.right, camera._right);\n }\n\n const transformChanged = camera._transformChanged || camera._modeChanged;\n camera._transformChanged = false;\n\n if (transformChanged) {\n Matrix4.inverseTransformation(camera._transform, camera._invTransform);\n\n if (\n camera._mode === SceneMode.COLUMBUS_VIEW ||\n camera._mode === SceneMode.SCENE2D\n ) {\n if (Matrix4.equals(Matrix4.IDENTITY, camera._transform)) {\n Matrix4.clone(Camera.TRANSFORM_2D, camera._actualTransform);\n } else if (camera._mode === SceneMode.COLUMBUS_VIEW) {\n convertTransformForColumbusView(camera);\n } else {\n convertTransformFor2D(camera);\n }\n } else {\n Matrix4.clone(camera._transform, camera._actualTransform);\n }\n\n Matrix4.inverseTransformation(\n camera._actualTransform,\n camera._actualInvTransform\n );\n\n camera._modeChanged = false;\n }\n\n const transform = camera._actualTransform;\n\n if (positionChanged || transformChanged) {\n camera._positionWC = Matrix4.multiplyByPoint(\n transform,\n position,\n camera._positionWC\n );\n\n // Compute the Cartographic position of the camera.\n if (mode === SceneMode.SCENE3D || mode === SceneMode.MORPHING) {\n camera._positionCartographic = camera._projection.ellipsoid.cartesianToCartographic(\n camera._positionWC,\n camera._positionCartographic\n );\n } else {\n // The camera position is expressed in the 2D coordinate system where the Y axis is to the East,\n // the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where\n // X is to the East, Y is to the North, and Z is out of the local horizontal plane.\n const positionENU = scratchCartesian;\n positionENU.x = camera._positionWC.y;\n positionENU.y = camera._positionWC.z;\n positionENU.z = camera._positionWC.x;\n\n // In 2D, the camera height is always 12.7 million meters.\n // The apparent height is equal to half the frustum width.\n if (mode === SceneMode.SCENE2D) {\n positionENU.z = height;\n }\n\n camera._projection.unproject(positionENU, camera._positionCartographic);\n }\n }\n\n if (directionChanged || upChanged || rightChanged) {\n const det = Cartesian3.dot(\n direction,\n Cartesian3.cross(up, right, scratchCartesian)\n );\n if (Math.abs(1.0 - det) > CesiumMath.EPSILON2) {\n //orthonormalize axes\n const invUpMag = 1.0 / Cartesian3.magnitudeSquared(up);\n const scalar = Cartesian3.dot(up, direction) * invUpMag;\n const w0 = Cartesian3.multiplyByScalar(\n direction,\n scalar,\n scratchCartesian\n );\n up = Cartesian3.normalize(\n Cartesian3.subtract(up, w0, camera._up),\n camera._up\n );\n Cartesian3.clone(up, camera.up);\n\n right = Cartesian3.cross(direction, up, camera._right);\n Cartesian3.clone(right, camera.right);\n }\n }\n\n if (directionChanged || transformChanged) {\n camera._directionWC = Matrix4.multiplyByPointAsVector(\n transform,\n direction,\n camera._directionWC\n );\n Cartesian3.normalize(camera._directionWC, camera._directionWC);\n }\n\n if (upChanged || transformChanged) {\n camera._upWC = Matrix4.multiplyByPointAsVector(transform, up, camera._upWC);\n Cartesian3.normalize(camera._upWC, camera._upWC);\n }\n\n if (rightChanged || transformChanged) {\n camera._rightWC = Matrix4.multiplyByPointAsVector(\n transform,\n right,\n camera._rightWC\n );\n Cartesian3.normalize(camera._rightWC, camera._rightWC);\n }\n\n if (\n positionChanged ||\n directionChanged ||\n upChanged ||\n rightChanged ||\n transformChanged\n ) {\n updateViewMatrix(camera);\n }\n}\n\nfunction getHeading(direction, up) {\n let heading;\n if (\n !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)\n ) {\n heading = Math.atan2(direction.y, direction.x) - CesiumMath.PI_OVER_TWO;\n } else {\n heading = Math.atan2(up.y, up.x) - CesiumMath.PI_OVER_TWO;\n }\n\n return CesiumMath.TWO_PI - CesiumMath.zeroToTwoPi(heading);\n}\n\nfunction getPitch(direction) {\n return CesiumMath.PI_OVER_TWO - CesiumMath.acosClamped(direction.z);\n}\n\nfunction getRoll(direction, up, right) {\n let roll = 0.0;\n if (\n !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)\n ) {\n roll = Math.atan2(-right.z, up.z);\n roll = CesiumMath.zeroToTwoPi(roll + CesiumMath.TWO_PI);\n }\n\n return roll;\n}\n\nconst scratchHPRMatrix1 = new Matrix4();\nconst scratchHPRMatrix2 = new Matrix4();\n\nObject.defineProperties(Camera.prototype, {\n /**\n * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.\n * @memberof Camera.prototype\n *\n * @type {Matrix4}\n * @readonly\n *\n * @default {@link Matrix4.IDENTITY}\n */\n transform: {\n get: function () {\n return this._transform;\n },\n },\n\n /**\n * Gets the inverse camera transform.\n * @memberof Camera.prototype\n *\n * @type {Matrix4}\n * @readonly\n *\n * @default {@link Matrix4.IDENTITY}\n */\n inverseTransform: {\n get: function () {\n updateMembers(this);\n return this._invTransform;\n },\n },\n\n /**\n * Gets the view matrix.\n * @memberof Camera.prototype\n *\n * @type {Matrix4}\n * @readonly\n *\n * @see Camera#inverseViewMatrix\n */\n viewMatrix: {\n get: function () {\n updateMembers(this);\n return this._viewMatrix;\n },\n },\n\n /**\n * Gets the inverse view matrix.\n * @memberof Camera.prototype\n *\n * @type {Matrix4}\n * @readonly\n *\n * @see Camera#viewMatrix\n */\n inverseViewMatrix: {\n get: function () {\n updateMembers(this);\n return this._invViewMatrix;\n },\n },\n\n /**\n * Gets the {@link Cartographic} position of the camera, with longitude and latitude\n * expressed in radians and height in meters. In 2D and Columbus View, it is possible\n * for the returned longitude and latitude to be outside the range of valid longitudes\n * and latitudes when the camera is outside the map.\n * @memberof Camera.prototype\n *\n * @type {Cartographic}\n * @readonly\n */\n positionCartographic: {\n get: function () {\n updateMembers(this);\n return this._positionCartographic;\n },\n },\n\n /**\n * Gets the position of the camera in world coordinates.\n * @memberof Camera.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n positionWC: {\n get: function () {\n updateMembers(this);\n return this._positionWC;\n },\n },\n\n /**\n * Gets the view direction of the camera in world coordinates.\n * @memberof Camera.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n directionWC: {\n get: function () {\n updateMembers(this);\n return this._directionWC;\n },\n },\n\n /**\n * Gets the up direction of the camera in world coordinates.\n * @memberof Camera.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n upWC: {\n get: function () {\n updateMembers(this);\n return this._upWC;\n },\n },\n\n /**\n * Gets the right direction of the camera in world coordinates.\n * @memberof Camera.prototype\n *\n * @type {Cartesian3}\n * @readonly\n */\n rightWC: {\n get: function () {\n updateMembers(this);\n return this._rightWC;\n },\n },\n\n /**\n * Gets the camera heading in radians.\n * @memberof Camera.prototype\n *\n * @type {Number}\n * @readonly\n */\n heading: {\n get: function () {\n if (this._mode !== SceneMode.MORPHING) {\n const ellipsoid = this._projection.ellipsoid;\n\n const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n const transform = Transforms.eastNorthUpToFixedFrame(\n this.positionWC,\n ellipsoid,\n scratchHPRMatrix2\n );\n this._setTransform(transform);\n\n const heading = getHeading(this.direction, this.up);\n\n this._setTransform(oldTransform);\n\n return heading;\n }\n\n return undefined;\n },\n },\n\n /**\n * Gets the camera pitch in radians.\n * @memberof Camera.prototype\n *\n * @type {Number}\n * @readonly\n */\n pitch: {\n get: function () {\n if (this._mode !== SceneMode.MORPHING) {\n const ellipsoid = this._projection.ellipsoid;\n\n const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n const transform = Transforms.eastNorthUpToFixedFrame(\n this.positionWC,\n ellipsoid,\n scratchHPRMatrix2\n );\n this._setTransform(transform);\n\n const pitch = getPitch(this.direction);\n\n this._setTransform(oldTransform);\n\n return pitch;\n }\n\n return undefined;\n },\n },\n\n /**\n * Gets the camera roll in radians.\n * @memberof Camera.prototype\n *\n * @type {Number}\n * @readonly\n */\n roll: {\n get: function () {\n if (this._mode !== SceneMode.MORPHING) {\n const ellipsoid = this._projection.ellipsoid;\n\n const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);\n const transform = Transforms.eastNorthUpToFixedFrame(\n this.positionWC,\n ellipsoid,\n scratchHPRMatrix2\n );\n this._setTransform(transform);\n\n const roll = getRoll(this.direction, this.up, this.right);\n\n this._setTransform(oldTransform);\n\n return roll;\n }\n\n return undefined;\n },\n },\n\n /**\n * Gets the event that will be raised at when the camera starts to move.\n * @memberof Camera.prototype\n * @type {Event}\n * @readonly\n */\n moveStart: {\n get: function () {\n return this._moveStart;\n },\n },\n\n /**\n * Gets the event that will be raised when the camera has stopped moving.\n * @memberof Camera.prototype\n * @type {Event}\n * @readonly\n */\n moveEnd: {\n get: function () {\n return this._moveEnd;\n },\n },\n\n /**\n * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.\n * @memberof Camera.prototype\n * @type {Event}\n * @readonly\n */\n changed: {\n get: function () {\n return this._changed;\n },\n },\n});\n\n/**\n * @private\n */\nCamera.prototype.update = function (mode) {\n let updateFrustum = false;\n if (mode !== this._mode) {\n this._mode = mode;\n this._modeChanged = mode !== SceneMode.MORPHING;\n updateFrustum = this._mode === SceneMode.SCENE2D;\n }\n\n if (updateFrustum) {\n const frustum = (this._max2Dfrustum = this.frustum.clone());\n\n const maxZoomOut = 2.0;\n const ratio = frustum.top / frustum.right;\n frustum.right = this._maxCoord.x * maxZoomOut;\n frustum.left = -frustum.right;\n frustum.top = ratio * frustum.right;\n frustum.bottom = -frustum.top;\n }\n\n if (this._mode === SceneMode.SCENE2D) {\n clampMove2D(this, this.position);\n }\n};\n\nconst setTransformPosition = new Cartesian3();\nconst setTransformUp = new Cartesian3();\nconst setTransformDirection = new Cartesian3();\n\nCamera.prototype._setTransform = function (transform) {\n const position = Cartesian3.clone(this.positionWC, setTransformPosition);\n const up = Cartesian3.clone(this.upWC, setTransformUp);\n const direction = Cartesian3.clone(this.directionWC, setTransformDirection);\n\n Matrix4.clone(transform, this._transform);\n this._transformChanged = true;\n updateMembers(this);\n const inverse = this._actualInvTransform;\n\n Matrix4.multiplyByPoint(inverse, position, this.position);\n Matrix4.multiplyByPointAsVector(inverse, direction, this.direction);\n Matrix4.multiplyByPointAsVector(inverse, up, this.up);\n Cartesian3.cross(this.direction, this.up, this.right);\n\n updateMembers(this);\n};\n\nconst scratchAdjustOrthographicFrustumMousePosition = new Cartesian2();\nconst scratchPickRay = new Ray();\nconst scratchRayIntersection = new Cartesian3();\nconst scratchDepthIntersection = new Cartesian3();\n\nfunction calculateOrthographicFrustumWidth(camera) {\n // Camera is fixed to an object, so keep frustum width constant.\n if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {\n return Cartesian3.magnitude(camera.position);\n }\n\n const scene = camera._scene;\n const globe = scene.globe;\n\n const mousePosition = scratchAdjustOrthographicFrustumMousePosition;\n mousePosition.x = scene.drawingBufferWidth / 2.0;\n mousePosition.y = scene.drawingBufferHeight / 2.0;\n\n let rayIntersection;\n if (defined(globe)) {\n const ray = camera.getPickRay(mousePosition, scratchPickRay);\n rayIntersection = globe.pickWorldCoordinates(\n ray,\n scene,\n true,\n scratchRayIntersection\n );\n }\n\n let depthIntersection;\n if (scene.pickPositionSupported) {\n depthIntersection = scene.pickPositionWorldCoordinates(\n mousePosition,\n scratchDepthIntersection\n );\n }\n\n let distance;\n if (defined(rayIntersection) || defined(depthIntersection)) {\n const depthDistance = defined(depthIntersection)\n ? Cartesian3.distance(depthIntersection, camera.positionWC)\n : Number.POSITIVE_INFINITY;\n const rayDistance = defined(rayIntersection)\n ? Cartesian3.distance(rayIntersection, camera.positionWC)\n : Number.POSITIVE_INFINITY;\n distance = Math.min(depthDistance, rayDistance);\n } else {\n distance = Math.max(camera.positionCartographic.height, 0.0);\n }\n return distance;\n}\n\nCamera.prototype._adjustOrthographicFrustum = function (zooming) {\n if (!(this.frustum instanceof OrthographicFrustum)) {\n return;\n }\n\n if (!zooming && this._positionCartographic.height < 150000.0) {\n return;\n }\n\n this.frustum.width = calculateOrthographicFrustumWidth(this);\n};\n\nconst scratchSetViewCartesian = new Cartesian3();\nconst scratchSetViewTransform1 = new Matrix4();\nconst scratchSetViewTransform2 = new Matrix4();\nconst scratchSetViewQuaternion = new Quaternion();\nconst scratchSetViewMatrix3 = new Matrix3();\nconst scratchSetViewCartographic = new Cartographic();\n\nfunction setView3D(camera, position, hpr) {\n const currentTransform = Matrix4.clone(\n camera.transform,\n scratchSetViewTransform1\n );\n const localTransform = Transforms.eastNorthUpToFixedFrame(\n position,\n camera._projection.ellipsoid,\n scratchSetViewTransform2\n );\n camera._setTransform(localTransform);\n\n Cartesian3.clone(Cartesian3.ZERO, camera.position);\n hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n\n const rotQuat = Quaternion.fromHeadingPitchRoll(\n hpr,\n scratchSetViewQuaternion\n );\n const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n Matrix3.getColumn(rotMat, 0, camera.direction);\n Matrix3.getColumn(rotMat, 2, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n camera._setTransform(currentTransform);\n\n camera._adjustOrthographicFrustum(true);\n}\n\nfunction setViewCV(camera, position, hpr, convert) {\n const currentTransform = Matrix4.clone(\n camera.transform,\n scratchSetViewTransform1\n );\n camera._setTransform(Matrix4.IDENTITY);\n\n if (!Cartesian3.equals(position, camera.positionWC)) {\n if (convert) {\n const projection = camera._projection;\n const cartographic = projection.ellipsoid.cartesianToCartographic(\n position,\n scratchSetViewCartographic\n );\n position = projection.project(cartographic, scratchSetViewCartesian);\n }\n Cartesian3.clone(position, camera.position);\n }\n hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n\n const rotQuat = Quaternion.fromHeadingPitchRoll(\n hpr,\n scratchSetViewQuaternion\n );\n const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n Matrix3.getColumn(rotMat, 0, camera.direction);\n Matrix3.getColumn(rotMat, 2, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n camera._setTransform(currentTransform);\n\n camera._adjustOrthographicFrustum(true);\n}\n\nfunction setView2D(camera, position, hpr, convert) {\n const currentTransform = Matrix4.clone(\n camera.transform,\n scratchSetViewTransform1\n );\n camera._setTransform(Matrix4.IDENTITY);\n\n if (!Cartesian3.equals(position, camera.positionWC)) {\n if (convert) {\n const projection = camera._projection;\n const cartographic = projection.ellipsoid.cartesianToCartographic(\n position,\n scratchSetViewCartographic\n );\n position = projection.project(cartographic, scratchSetViewCartesian);\n }\n\n Cartesian2.clone(position, camera.position);\n\n const newLeft = -position.z * 0.5;\n const newRight = -newLeft;\n\n const frustum = camera.frustum;\n if (newRight > newLeft) {\n const ratio = frustum.top / frustum.right;\n frustum.right = newRight;\n frustum.left = newLeft;\n frustum.top = frustum.right * ratio;\n frustum.bottom = -frustum.top;\n }\n }\n\n if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;\n hpr.pitch = -CesiumMath.PI_OVER_TWO;\n hpr.roll = 0.0;\n const rotQuat = Quaternion.fromHeadingPitchRoll(\n hpr,\n scratchSetViewQuaternion\n );\n const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);\n\n Matrix3.getColumn(rotMat, 2, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n }\n\n camera._setTransform(currentTransform);\n}\n\nconst scratchToHPRDirection = new Cartesian3();\nconst scratchToHPRUp = new Cartesian3();\nconst scratchToHPRRight = new Cartesian3();\n\nfunction directionUpToHeadingPitchRoll(camera, position, orientation, result) {\n const direction = Cartesian3.clone(\n orientation.direction,\n scratchToHPRDirection\n );\n const up = Cartesian3.clone(orientation.up, scratchToHPRUp);\n\n if (camera._scene.mode === SceneMode.SCENE3D) {\n const ellipsoid = camera._projection.ellipsoid;\n const transform = Transforms.eastNorthUpToFixedFrame(\n position,\n ellipsoid,\n scratchHPRMatrix1\n );\n const invTransform = Matrix4.inverseTransformation(\n transform,\n scratchHPRMatrix2\n );\n\n Matrix4.multiplyByPointAsVector(invTransform, direction, direction);\n Matrix4.multiplyByPointAsVector(invTransform, up, up);\n }\n\n const right = Cartesian3.cross(direction, up, scratchToHPRRight);\n\n result.heading = getHeading(direction, up);\n result.pitch = getPitch(direction);\n result.roll = getRoll(direction, up, right);\n\n return result;\n}\n\nconst scratchSetViewOptions = {\n destination: undefined,\n orientation: {\n direction: undefined,\n up: undefined,\n heading: undefined,\n pitch: undefined,\n roll: undefined,\n },\n convert: undefined,\n endTransform: undefined,\n};\n\nconst scratchHpr = new HeadingPitchRoll();\n/**\n * Sets the camera position, orientation and transform.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3|Rectangle} [options.destination] The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.\n * @param {HeadingPitchRollValues|DirectionUp} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point\n * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive\n * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame of the camera.\n * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.\n *\n * @example\n * // 1. Set position with a top-down view\n * viewer.camera.setView({\n * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)\n * });\n *\n * // 2 Set view with heading, pitch and roll\n * viewer.camera.setView({\n * destination : cartesianPosition,\n * orientation: {\n * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)\n * pitch : Cesium.Math.toRadians(-90), // default value (looking down)\n * roll : 0.0 // default value\n * }\n * });\n *\n * // 3. Change heading, pitch and roll with the camera position remaining the same.\n * viewer.camera.setView({\n * orientation: {\n * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)\n * pitch : Cesium.Math.toRadians(-90), // default value (looking down)\n * roll : 0.0 // default value\n * }\n * });\n *\n *\n * // 4. View rectangle with a top-down view\n * viewer.camera.setView({\n * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)\n * });\n *\n * // 5. Set position with an orientation using unit vectors.\n * viewer.camera.setView({\n * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n * orientation : {\n * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),\n * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)\n * }\n * });\n */\nCamera.prototype.setView = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let orientation = defaultValue(\n options.orientation,\n defaultValue.EMPTY_OBJECT\n );\n\n const mode = this._mode;\n if (mode === SceneMode.MORPHING) {\n return;\n }\n\n if (defined(options.endTransform)) {\n this._setTransform(options.endTransform);\n }\n\n let convert = defaultValue(options.convert, true);\n let destination = defaultValue(\n options.destination,\n Cartesian3.clone(this.positionWC, scratchSetViewCartesian)\n );\n if (defined(destination) && defined(destination.west)) {\n destination = this.getRectangleCameraCoordinates(\n destination,\n scratchSetViewCartesian\n );\n convert = false;\n }\n\n if (defined(orientation.direction)) {\n orientation = directionUpToHeadingPitchRoll(\n this,\n destination,\n orientation,\n scratchSetViewOptions.orientation\n );\n }\n\n scratchHpr.heading = defaultValue(orientation.heading, 0.0);\n scratchHpr.pitch = defaultValue(orientation.pitch, -CesiumMath.PI_OVER_TWO);\n scratchHpr.roll = defaultValue(orientation.roll, 0.0);\n\n if (mode === SceneMode.SCENE3D) {\n setView3D(this, destination, scratchHpr);\n } else if (mode === SceneMode.SCENE2D) {\n setView2D(this, destination, scratchHpr, convert);\n } else {\n setViewCV(this, destination, scratchHpr, convert);\n }\n};\n\nconst pitchScratch = new Cartesian3();\n/**\n * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set\n * the default view for the 3D scene. The home view for 2D and columbus view shows the\n * entire map.\n *\n * @param {Number} [duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo}\n */\nCamera.prototype.flyHome = function (duration) {\n const mode = this._mode;\n\n if (mode === SceneMode.MORPHING) {\n this._scene.completeMorph();\n }\n\n if (mode === SceneMode.SCENE2D) {\n this.flyTo({\n destination: Camera.DEFAULT_VIEW_RECTANGLE,\n duration: duration,\n endTransform: Matrix4.IDENTITY,\n });\n } else if (mode === SceneMode.SCENE3D) {\n const destination = this.getRectangleCameraCoordinates(\n Camera.DEFAULT_VIEW_RECTANGLE\n );\n\n let mag = Cartesian3.magnitude(destination);\n mag += mag * Camera.DEFAULT_VIEW_FACTOR;\n Cartesian3.normalize(destination, destination);\n Cartesian3.multiplyByScalar(destination, mag, destination);\n\n this.flyTo({\n destination: destination,\n duration: duration,\n endTransform: Matrix4.IDENTITY,\n });\n } else if (mode === SceneMode.COLUMBUS_VIEW) {\n const maxRadii = this._projection.ellipsoid.maximumRadius;\n let position = new Cartesian3(0.0, -1.0, 1.0);\n position = Cartesian3.multiplyByScalar(\n Cartesian3.normalize(position, position),\n 5.0 * maxRadii,\n position\n );\n this.flyTo({\n destination: position,\n duration: duration,\n orientation: {\n heading: 0.0,\n pitch: -Math.acos(Cartesian3.normalize(position, pitchScratch).z),\n roll: 0.0,\n },\n endTransform: Matrix4.IDENTITY,\n convert: false,\n });\n }\n};\n\n/**\n * Transform a vector or point from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian4} cartesian The vector or point to transform.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The transformed vector or point.\n */\nCamera.prototype.worldToCameraCoordinates = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian4();\n }\n updateMembers(this);\n return Matrix4.multiplyByVector(this._actualInvTransform, cartesian, result);\n};\n\n/**\n * Transform a point from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian3} cartesian The point to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed point.\n */\nCamera.prototype.worldToCameraCoordinatesPoint = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n updateMembers(this);\n return Matrix4.multiplyByPoint(this._actualInvTransform, cartesian, result);\n};\n\n/**\n * Transform a vector from world coordinates to the camera's reference frame.\n *\n * @param {Cartesian3} cartesian The vector to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed vector.\n */\nCamera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n updateMembers(this);\n return Matrix4.multiplyByPointAsVector(\n this._actualInvTransform,\n cartesian,\n result\n );\n};\n\n/**\n * Transform a vector or point from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian4} cartesian The vector or point to transform.\n * @param {Cartesian4} [result] The object onto which to store the result.\n * @returns {Cartesian4} The transformed vector or point.\n */\nCamera.prototype.cameraToWorldCoordinates = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian4();\n }\n updateMembers(this);\n return Matrix4.multiplyByVector(this._actualTransform, cartesian, result);\n};\n\n/**\n * Transform a point from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian3} cartesian The point to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed point.\n */\nCamera.prototype.cameraToWorldCoordinatesPoint = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n updateMembers(this);\n return Matrix4.multiplyByPoint(this._actualTransform, cartesian, result);\n};\n\n/**\n * Transform a vector from the camera's reference frame to world coordinates.\n *\n * @param {Cartesian3} cartesian The vector to transform.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3} The transformed vector.\n */\nCamera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) {\n if (!defined(result)) {\n result = new Cartesian3();\n }\n updateMembers(this);\n return Matrix4.multiplyByPointAsVector(\n this._actualTransform,\n cartesian,\n result\n );\n};\n\nfunction clampMove2D(camera, position) {\n const rotatable2D = camera._scene.mapMode2D === MapMode2D.ROTATE;\n const maxProjectedX = camera._maxCoord.x;\n const maxProjectedY = camera._maxCoord.y;\n\n let minX;\n let maxX;\n if (rotatable2D) {\n maxX = maxProjectedX;\n minX = -maxX;\n } else {\n maxX = position.x - maxProjectedX * 2.0;\n minX = position.x + maxProjectedX * 2.0;\n }\n\n if (position.x > maxProjectedX) {\n position.x = maxX;\n }\n if (position.x < -maxProjectedX) {\n position.x = minX;\n }\n\n if (position.y > maxProjectedY) {\n position.y = maxProjectedY;\n }\n if (position.y < -maxProjectedY) {\n position.y = -maxProjectedY;\n }\n}\n\nconst moveScratch = new Cartesian3();\n/**\n * Translates the camera's position by <code>amount</code> along <code>direction</code>.\n *\n * @param {Cartesian3} direction The direction to move.\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveBackward\n * @see Camera#moveForward\n * @see Camera#moveLeft\n * @see Camera#moveRight\n * @see Camera#moveUp\n * @see Camera#moveDown\n */\nCamera.prototype.move = function (direction, amount) {\n const cameraPosition = this.position;\n Cartesian3.multiplyByScalar(direction, amount, moveScratch);\n Cartesian3.add(cameraPosition, moveScratch, cameraPosition);\n\n if (this._mode === SceneMode.SCENE2D) {\n clampMove2D(this, cameraPosition);\n }\n this._adjustOrthographicFrustum(true);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's view vector.\n * When in 2D mode, this will zoom in the camera instead of translating the camera's position.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveBackward\n */\nCamera.prototype.moveForward = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n\n if (this._mode === SceneMode.SCENE2D) {\n // 2D mode\n zoom2D(this, amount);\n } else {\n // 3D or Columbus view mode\n this.move(this.direction, amount);\n }\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's view vector.\n * When in 2D mode, this will zoom out the camera instead of translating the camera's position.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveForward\n */\nCamera.prototype.moveBackward = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n\n if (this._mode === SceneMode.SCENE2D) {\n // 2D mode\n zoom2D(this, -amount);\n } else {\n // 3D or Columbus view mode\n this.move(this.direction, -amount);\n }\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's up vector.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveDown\n */\nCamera.prototype.moveUp = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n this.move(this.up, amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's up vector.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveUp\n */\nCamera.prototype.moveDown = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n this.move(this.up, -amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the camera's right vector.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveLeft\n */\nCamera.prototype.moveRight = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n this.move(this.right, amount);\n};\n\n/**\n * Translates the camera's position by <code>amount</code> along the opposite direction\n * of the camera's right vector.\n *\n * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.\n *\n * @see Camera#moveRight\n */\nCamera.prototype.moveLeft = function (amount) {\n amount = defaultValue(amount, this.defaultMoveAmount);\n this.move(this.right, -amount);\n};\n\n/**\n * Rotates the camera around its up vector by amount, in radians, in the opposite direction\n * of its right vector if not in 2D mode.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookRight\n */\nCamera.prototype.lookLeft = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n\n // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n if (this._mode !== SceneMode.SCENE2D) {\n this.look(this.up, -amount);\n }\n};\n\n/**\n * Rotates the camera around its up vector by amount, in radians, in the direction\n * of its right vector if not in 2D mode.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookLeft\n */\nCamera.prototype.lookRight = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n\n // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n if (this._mode !== SceneMode.SCENE2D) {\n this.look(this.up, amount);\n }\n};\n\n/**\n * Rotates the camera around its right vector by amount, in radians, in the direction\n * of its up vector if not in 2D mode.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookDown\n */\nCamera.prototype.lookUp = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n\n // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n if (this._mode !== SceneMode.SCENE2D) {\n this.look(this.right, -amount);\n }\n};\n\n/**\n * Rotates the camera around its right vector by amount, in radians, in the opposite direction\n * of its up vector if not in 2D mode.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookUp\n */\nCamera.prototype.lookDown = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n\n // only want view of map to change in 3D mode, 2D visual is incorrect when look changes\n if (this._mode !== SceneMode.SCENE2D) {\n this.look(this.right, amount);\n }\n};\n\nconst lookScratchQuaternion = new Quaternion();\nconst lookScratchMatrix = new Matrix3();\n/**\n * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>\n *\n * @param {Cartesian3} axis The axis to rotate around.\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#lookUp\n * @see Camera#lookDown\n * @see Camera#lookLeft\n * @see Camera#lookRight\n */\nCamera.prototype.look = function (axis, angle) {\n const turnAngle = defaultValue(angle, this.defaultLookAmount);\n const quaternion = Quaternion.fromAxisAngle(\n axis,\n -turnAngle,\n lookScratchQuaternion\n );\n const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix);\n\n const direction = this.direction;\n const up = this.up;\n const right = this.right;\n\n Matrix3.multiplyByVector(rotation, direction, direction);\n Matrix3.multiplyByVector(rotation, up, up);\n Matrix3.multiplyByVector(rotation, right, right);\n};\n\n/**\n * Rotate the camera counter-clockwise around its direction vector by amount, in radians.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#twistRight\n */\nCamera.prototype.twistLeft = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n this.look(this.direction, amount);\n};\n\n/**\n * Rotate the camera clockwise around its direction vector by amount, in radians.\n *\n * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.\n *\n * @see Camera#twistLeft\n */\nCamera.prototype.twistRight = function (amount) {\n amount = defaultValue(amount, this.defaultLookAmount);\n this.look(this.direction, -amount);\n};\n\nconst rotateScratchQuaternion = new Quaternion();\nconst rotateScratchMatrix = new Matrix3();\n/**\n * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance\n * of the camera's position to the center of the camera's reference frame remains the same.\n *\n * @param {Cartesian3} axis The axis to rotate around given in world coordinates.\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateUp\n * @see Camera#rotateDown\n * @see Camera#rotateLeft\n * @see Camera#rotateRight\n */\nCamera.prototype.rotate = function (axis, angle) {\n const turnAngle = defaultValue(angle, this.defaultRotateAmount);\n const quaternion = Quaternion.fromAxisAngle(\n axis,\n -turnAngle,\n rotateScratchQuaternion\n );\n const rotation = Matrix3.fromQuaternion(quaternion, rotateScratchMatrix);\n Matrix3.multiplyByVector(rotation, this.position, this.position);\n Matrix3.multiplyByVector(rotation, this.direction, this.direction);\n Matrix3.multiplyByVector(rotation, this.up, this.up);\n Cartesian3.cross(this.direction, this.up, this.right);\n Cartesian3.cross(this.right, this.direction, this.up);\n\n this._adjustOrthographicFrustum(false);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle downwards.\n *\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateUp\n * @see Camera#rotate\n */\nCamera.prototype.rotateDown = function (angle) {\n angle = defaultValue(angle, this.defaultRotateAmount);\n rotateVertical(this, angle);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle upwards.\n *\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateDown\n * @see Camera#rotate\n */\nCamera.prototype.rotateUp = function (angle) {\n angle = defaultValue(angle, this.defaultRotateAmount);\n rotateVertical(this, -angle);\n};\n\nconst rotateVertScratchP = new Cartesian3();\nconst rotateVertScratchA = new Cartesian3();\nconst rotateVertScratchTan = new Cartesian3();\nconst rotateVertScratchNegate = new Cartesian3();\nfunction rotateVertical(camera, angle) {\n const position = camera.position;\n if (\n defined(camera.constrainedAxis) &&\n !Cartesian3.equalsEpsilon(\n camera.position,\n Cartesian3.ZERO,\n CesiumMath.EPSILON2\n )\n ) {\n const p = Cartesian3.normalize(position, rotateVertScratchP);\n const northParallel = Cartesian3.equalsEpsilon(\n p,\n camera.constrainedAxis,\n CesiumMath.EPSILON2\n );\n const southParallel = Cartesian3.equalsEpsilon(\n p,\n Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate),\n CesiumMath.EPSILON2\n );\n if (!northParallel && !southParallel) {\n const constrainedAxis = Cartesian3.normalize(\n camera.constrainedAxis,\n rotateVertScratchA\n );\n\n let dot = Cartesian3.dot(p, constrainedAxis);\n let angleToAxis = CesiumMath.acosClamped(dot);\n if (angle > 0 && angle > angleToAxis) {\n angle = angleToAxis - CesiumMath.EPSILON4;\n }\n\n dot = Cartesian3.dot(\n p,\n Cartesian3.negate(constrainedAxis, rotateVertScratchNegate)\n );\n angleToAxis = CesiumMath.acosClamped(dot);\n if (angle < 0 && -angle > angleToAxis) {\n angle = -angleToAxis + CesiumMath.EPSILON4;\n }\n\n const tangent = Cartesian3.cross(\n constrainedAxis,\n p,\n rotateVertScratchTan\n );\n camera.rotate(tangent, angle);\n } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {\n camera.rotate(camera.right, angle);\n }\n } else {\n camera.rotate(camera.right, angle);\n }\n}\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle to the right.\n *\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateLeft\n * @see Camera#rotate\n */\nCamera.prototype.rotateRight = function (angle) {\n angle = defaultValue(angle, this.defaultRotateAmount);\n rotateHorizontal(this, -angle);\n};\n\n/**\n * Rotates the camera around the center of the camera's reference frame by angle to the left.\n *\n * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.\n *\n * @see Camera#rotateRight\n * @see Camera#rotate\n */\nCamera.prototype.rotateLeft = function (angle) {\n angle = defaultValue(angle, this.defaultRotateAmount);\n rotateHorizontal(this, angle);\n};\n\nfunction rotateHorizontal(camera, angle) {\n if (defined(camera.constrainedAxis)) {\n camera.rotate(camera.constrainedAxis, angle);\n } else {\n camera.rotate(camera.up, angle);\n }\n}\n\nfunction zoom2D(camera, amount) {\n const frustum = camera.frustum;\n\n let ratio;\n amount = amount * 0.5;\n\n if (\n Math.abs(frustum.top) + Math.abs(frustum.bottom) >\n Math.abs(frustum.left) + Math.abs(frustum.right)\n ) {\n let newTop = frustum.top - amount;\n let newBottom = frustum.bottom + amount;\n\n let maxBottom = camera._maxCoord.y;\n if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n maxBottom *= camera.maximumZoomFactor;\n }\n\n if (newBottom > maxBottom) {\n newBottom = maxBottom;\n newTop = -maxBottom;\n }\n\n if (newTop <= newBottom) {\n newTop = 1.0;\n newBottom = -1.0;\n }\n\n ratio = frustum.right / frustum.top;\n frustum.top = newTop;\n frustum.bottom = newBottom;\n frustum.right = frustum.top * ratio;\n frustum.left = -frustum.right;\n } else {\n let newRight = frustum.right - amount;\n let newLeft = frustum.left + amount;\n\n let maxRight = camera._maxCoord.x;\n if (camera._scene.mapMode2D === MapMode2D.ROTATE) {\n maxRight *= camera.maximumZoomFactor;\n }\n\n if (newRight > maxRight) {\n newRight = maxRight;\n newLeft = -maxRight;\n }\n\n if (newRight <= newLeft) {\n newRight = 1.0;\n newLeft = -1.0;\n }\n ratio = frustum.top / frustum.right;\n frustum.right = newRight;\n frustum.left = newLeft;\n frustum.top = frustum.right * ratio;\n frustum.bottom = -frustum.top;\n }\n}\n\nfunction zoom3D(camera, amount) {\n camera.move(camera.direction, amount);\n}\n\n/**\n * Zooms <code>amount</code> along the camera's view vector.\n *\n * @param {Number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.\n *\n * @see Camera#zoomOut\n */\nCamera.prototype.zoomIn = function (amount) {\n amount = defaultValue(amount, this.defaultZoomAmount);\n if (this._mode === SceneMode.SCENE2D) {\n zoom2D(this, amount);\n } else {\n zoom3D(this, amount);\n }\n};\n\n/**\n * Zooms <code>amount</code> along the opposite direction of\n * the camera's view vector.\n *\n * @param {Number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.\n *\n * @see Camera#zoomIn\n */\nCamera.prototype.zoomOut = function (amount) {\n amount = defaultValue(amount, this.defaultZoomAmount);\n if (this._mode === SceneMode.SCENE2D) {\n zoom2D(this, -amount);\n } else {\n zoom3D(this, -amount);\n }\n};\n\n/**\n * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and\n * Columbus view, this is the distance to the map.\n *\n * @returns {Number} The magnitude of the position.\n */\nCamera.prototype.getMagnitude = function () {\n if (this._mode === SceneMode.SCENE3D) {\n return Cartesian3.magnitude(this.position);\n } else if (this._mode === SceneMode.COLUMBUS_VIEW) {\n return Math.abs(this.position.z);\n } else if (this._mode === SceneMode.SCENE2D) {\n return Math.max(\n this.frustum.right - this.frustum.left,\n this.frustum.top - this.frustum.bottom\n );\n }\n};\n\nconst scratchLookAtMatrix4 = new Matrix4();\n\n/**\n * Sets the camera position and orientation using a target and offset. The target must be given in\n * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target.\n * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset\n * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.\n *\n * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.\n *\n * @param {Cartesian3} target The target position in world coordinates.\n * @param {Cartesian3|HeadingPitchRange} offset The offset from the target in the local east-north-up reference frame centered at the target.\n *\n * @exception {DeveloperError} lookAt is not supported while morphing.\n *\n * @example\n * // 1. Using a cartesian offset\n * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);\n * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));\n *\n * // 2. Using a HeadingPitchRange offset\n * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);\n * const heading = Cesium.Math.toRadians(50.0);\n * const pitch = Cesium.Math.toRadians(-20.0);\n * const range = 5000.0;\n * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));\n */\nCamera.prototype.lookAt = function (target, offset) {\n const transform = Transforms.eastNorthUpToFixedFrame(\n target,\n Ellipsoid.WGS84,\n scratchLookAtMatrix4\n );\n this.lookAtTransform(transform, offset);\n};\n\nconst scratchLookAtHeadingPitchRangeOffset = new Cartesian3();\nconst scratchLookAtHeadingPitchRangeQuaternion1 = new Quaternion();\nconst scratchLookAtHeadingPitchRangeQuaternion2 = new Quaternion();\nconst scratchHeadingPitchRangeMatrix3 = new Matrix3();\n\nfunction offsetFromHeadingPitchRange(heading, pitch, range) {\n pitch = CesiumMath.clamp(\n pitch,\n -CesiumMath.PI_OVER_TWO,\n CesiumMath.PI_OVER_TWO\n );\n heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO;\n\n const pitchQuat = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_Y,\n -pitch,\n scratchLookAtHeadingPitchRangeQuaternion1\n );\n const headingQuat = Quaternion.fromAxisAngle(\n Cartesian3.UNIT_Z,\n -heading,\n scratchLookAtHeadingPitchRangeQuaternion2\n );\n const rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat);\n const rotMatrix = Matrix3.fromQuaternion(\n rotQuat,\n scratchHeadingPitchRangeMatrix3\n );\n\n const offset = Cartesian3.clone(\n Cartesian3.UNIT_X,\n scratchLookAtHeadingPitchRangeOffset\n );\n Matrix3.multiplyByVector(rotMatrix, offset, offset);\n Cartesian3.negate(offset, offset);\n Cartesian3.multiplyByScalar(offset, range, offset);\n return offset;\n}\n\n/**\n * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.\n * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset\n * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.\n *\n * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the\n * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.\n *\n * @param {Matrix4} transform The transformation matrix defining the reference frame.\n * @param {Cartesian3|HeadingPitchRange} [offset] The offset from the target in a reference frame centered at the target.\n *\n * @exception {DeveloperError} lookAtTransform is not supported while morphing.\n *\n * @example\n * // 1. Using a cartesian offset\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));\n * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));\n *\n * // 2. Using a HeadingPitchRange offset\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));\n * const heading = Cesium.Math.toRadians(50.0);\n * const pitch = Cesium.Math.toRadians(-20.0);\n * const range = 5000.0;\n * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));\n */\nCamera.prototype.lookAtTransform = function (transform, offset) {\n this._setTransform(transform);\n if (!defined(offset)) {\n return;\n }\n\n let cartesianOffset;\n if (defined(offset.heading)) {\n cartesianOffset = offsetFromHeadingPitchRange(\n offset.heading,\n offset.pitch,\n offset.range\n );\n } else {\n cartesianOffset = offset;\n }\n\n if (this._mode === SceneMode.SCENE2D) {\n Cartesian2.clone(Cartesian2.ZERO, this.position);\n\n Cartesian3.negate(cartesianOffset, this.up);\n this.up.z = 0.0;\n\n if (Cartesian3.magnitudeSquared(this.up) < CesiumMath.EPSILON10) {\n Cartesian3.clone(Cartesian3.UNIT_Y, this.up);\n }\n\n Cartesian3.normalize(this.up, this.up);\n\n this._setTransform(Matrix4.IDENTITY);\n\n Cartesian3.negate(Cartesian3.UNIT_Z, this.direction);\n Cartesian3.cross(this.direction, this.up, this.right);\n Cartesian3.normalize(this.right, this.right);\n\n const frustum = this.frustum;\n const ratio = frustum.top / frustum.right;\n frustum.right = Cartesian3.magnitude(cartesianOffset) * 0.5;\n frustum.left = -frustum.right;\n frustum.top = ratio * frustum.right;\n frustum.bottom = -frustum.top;\n\n this._setTransform(transform);\n\n return;\n }\n\n Cartesian3.clone(cartesianOffset, this.position);\n Cartesian3.negate(this.position, this.direction);\n Cartesian3.normalize(this.direction, this.direction);\n Cartesian3.cross(this.direction, Cartesian3.UNIT_Z, this.right);\n\n if (Cartesian3.magnitudeSquared(this.right) < CesiumMath.EPSILON10) {\n Cartesian3.clone(Cartesian3.UNIT_X, this.right);\n }\n\n Cartesian3.normalize(this.right, this.right);\n Cartesian3.cross(this.right, this.direction, this.up);\n Cartesian3.normalize(this.up, this.up);\n\n this._adjustOrthographicFrustum(true);\n};\n\nconst viewRectangle3DCartographic1 = new Cartographic();\nconst viewRectangle3DCartographic2 = new Cartographic();\nconst viewRectangle3DNorthEast = new Cartesian3();\nconst viewRectangle3DSouthWest = new Cartesian3();\nconst viewRectangle3DNorthWest = new Cartesian3();\nconst viewRectangle3DSouthEast = new Cartesian3();\nconst viewRectangle3DNorthCenter = new Cartesian3();\nconst viewRectangle3DSouthCenter = new Cartesian3();\nconst viewRectangle3DCenter = new Cartesian3();\nconst viewRectangle3DEquator = new Cartesian3();\nconst defaultRF = {\n direction: new Cartesian3(),\n right: new Cartesian3(),\n up: new Cartesian3(),\n};\nlet viewRectangle3DEllipsoidGeodesic;\n\nfunction computeD(direction, upOrRight, corner, tanThetaOrPhi) {\n const opposite = Math.abs(Cartesian3.dot(upOrRight, corner));\n return opposite / tanThetaOrPhi - Cartesian3.dot(direction, corner);\n}\n\nfunction rectangleCameraPosition3D(camera, rectangle, result, updateCamera) {\n const ellipsoid = camera._projection.ellipsoid;\n const cameraRF = updateCamera ? camera : defaultRF;\n\n const north = rectangle.north;\n const south = rectangle.south;\n let east = rectangle.east;\n const west = rectangle.west;\n\n // If we go across the International Date Line\n if (west > east) {\n east += CesiumMath.TWO_PI;\n }\n\n // Find the midpoint latitude.\n //\n // EllipsoidGeodesic will fail if the north and south edges are very close to being on opposite sides of the ellipsoid.\n // Ideally we'd just call EllipsoidGeodesic.setEndPoints and let it throw when it detects this case, but sadly it doesn't\n // even look for this case in optimized builds, so we have to test for it here instead.\n //\n // Fortunately, this case can only happen (here) when north is very close to the north pole and south is very close to the south pole,\n // so handle it just by using 0 latitude as the center. It's certainliy possible to use a smaller tolerance\n // than one degree here, but one degree is safe and putting the center at 0 latitude should be good enough for any\n // rectangle that spans 178+ of the 180 degrees of latitude.\n const longitude = (west + east) * 0.5;\n let latitude;\n if (\n south < -CesiumMath.PI_OVER_TWO + CesiumMath.RADIANS_PER_DEGREE &&\n north > CesiumMath.PI_OVER_TWO - CesiumMath.RADIANS_PER_DEGREE\n ) {\n latitude = 0.0;\n } else {\n const northCartographic = viewRectangle3DCartographic1;\n northCartographic.longitude = longitude;\n northCartographic.latitude = north;\n northCartographic.height = 0.0;\n\n const southCartographic = viewRectangle3DCartographic2;\n southCartographic.longitude = longitude;\n southCartographic.latitude = south;\n southCartographic.height = 0.0;\n\n let ellipsoidGeodesic = viewRectangle3DEllipsoidGeodesic;\n if (\n !defined(ellipsoidGeodesic) ||\n ellipsoidGeodesic.ellipsoid !== ellipsoid\n ) {\n viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic = new EllipsoidGeodesic(\n undefined,\n undefined,\n ellipsoid\n );\n }\n\n ellipsoidGeodesic.setEndPoints(northCartographic, southCartographic);\n latitude = ellipsoidGeodesic.interpolateUsingFraction(\n 0.5,\n viewRectangle3DCartographic1\n ).latitude;\n }\n\n const centerCartographic = viewRectangle3DCartographic1;\n centerCartographic.longitude = longitude;\n centerCartographic.latitude = latitude;\n centerCartographic.height = 0.0;\n\n const center = ellipsoid.cartographicToCartesian(\n centerCartographic,\n viewRectangle3DCenter\n );\n\n const cart = viewRectangle3DCartographic1;\n cart.longitude = east;\n cart.latitude = north;\n const northEast = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DNorthEast\n );\n cart.longitude = west;\n const northWest = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DNorthWest\n );\n cart.longitude = longitude;\n const northCenter = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DNorthCenter\n );\n cart.latitude = south;\n const southCenter = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DSouthCenter\n );\n cart.longitude = east;\n const southEast = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DSouthEast\n );\n cart.longitude = west;\n const southWest = ellipsoid.cartographicToCartesian(\n cart,\n viewRectangle3DSouthWest\n );\n\n Cartesian3.subtract(northWest, center, northWest);\n Cartesian3.subtract(southEast, center, southEast);\n Cartesian3.subtract(northEast, center, northEast);\n Cartesian3.subtract(southWest, center, southWest);\n Cartesian3.subtract(northCenter, center, northCenter);\n Cartesian3.subtract(southCenter, center, southCenter);\n\n const direction = ellipsoid.geodeticSurfaceNormal(center, cameraRF.direction);\n Cartesian3.negate(direction, direction);\n const right = Cartesian3.cross(direction, Cartesian3.UNIT_Z, cameraRF.right);\n Cartesian3.normalize(right, right);\n const up = Cartesian3.cross(right, direction, cameraRF.up);\n\n let d;\n if (camera.frustum instanceof OrthographicFrustum) {\n const width = Math.max(\n Cartesian3.distance(northEast, northWest),\n Cartesian3.distance(southEast, southWest)\n );\n const height = Math.max(\n Cartesian3.distance(northEast, southEast),\n Cartesian3.distance(northWest, southWest)\n );\n\n let rightScalar;\n let topScalar;\n const ratio =\n camera.frustum._offCenterFrustum.right /\n camera.frustum._offCenterFrustum.top;\n const heightRatio = height * ratio;\n if (width > heightRatio) {\n rightScalar = width;\n topScalar = rightScalar / ratio;\n } else {\n topScalar = height;\n rightScalar = heightRatio;\n }\n\n d = Math.max(rightScalar, topScalar);\n } else {\n const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n const tanTheta = camera.frustum.aspectRatio * tanPhi;\n\n d = Math.max(\n computeD(direction, up, northWest, tanPhi),\n computeD(direction, up, southEast, tanPhi),\n computeD(direction, up, northEast, tanPhi),\n computeD(direction, up, southWest, tanPhi),\n computeD(direction, up, northCenter, tanPhi),\n computeD(direction, up, southCenter, tanPhi),\n computeD(direction, right, northWest, tanTheta),\n computeD(direction, right, southEast, tanTheta),\n computeD(direction, right, northEast, tanTheta),\n computeD(direction, right, southWest, tanTheta),\n computeD(direction, right, northCenter, tanTheta),\n computeD(direction, right, southCenter, tanTheta)\n );\n\n // If the rectangle crosses the equator, compute D at the equator, too, because that's the\n // widest part of the rectangle when projected onto the globe.\n if (south < 0 && north > 0) {\n const equatorCartographic = viewRectangle3DCartographic1;\n equatorCartographic.longitude = west;\n equatorCartographic.latitude = 0.0;\n equatorCartographic.height = 0.0;\n let equatorPosition = ellipsoid.cartographicToCartesian(\n equatorCartographic,\n viewRectangle3DEquator\n );\n Cartesian3.subtract(equatorPosition, center, equatorPosition);\n d = Math.max(\n d,\n computeD(direction, up, equatorPosition, tanPhi),\n computeD(direction, right, equatorPosition, tanTheta)\n );\n\n equatorCartographic.longitude = east;\n equatorPosition = ellipsoid.cartographicToCartesian(\n equatorCartographic,\n viewRectangle3DEquator\n );\n Cartesian3.subtract(equatorPosition, center, equatorPosition);\n d = Math.max(\n d,\n computeD(direction, up, equatorPosition, tanPhi),\n computeD(direction, right, equatorPosition, tanTheta)\n );\n }\n }\n\n return Cartesian3.add(\n center,\n Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator),\n result\n );\n}\n\nconst viewRectangleCVCartographic = new Cartographic();\nconst viewRectangleCVNorthEast = new Cartesian3();\nconst viewRectangleCVSouthWest = new Cartesian3();\nfunction rectangleCameraPositionColumbusView(camera, rectangle, result) {\n const projection = camera._projection;\n if (rectangle.west > rectangle.east) {\n rectangle = Rectangle.MAX_VALUE;\n }\n const transform = camera._actualTransform;\n const invTransform = camera._actualInvTransform;\n\n const cart = viewRectangleCVCartographic;\n cart.longitude = rectangle.east;\n cart.latitude = rectangle.north;\n const northEast = projection.project(cart, viewRectangleCVNorthEast);\n Matrix4.multiplyByPoint(transform, northEast, northEast);\n Matrix4.multiplyByPoint(invTransform, northEast, northEast);\n\n cart.longitude = rectangle.west;\n cart.latitude = rectangle.south;\n const southWest = projection.project(cart, viewRectangleCVSouthWest);\n Matrix4.multiplyByPoint(transform, southWest, southWest);\n Matrix4.multiplyByPoint(invTransform, southWest, southWest);\n\n result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;\n result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;\n\n if (defined(camera.frustum.fovy)) {\n const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n const tanTheta = camera.frustum.aspectRatio * tanPhi;\n result.z =\n Math.max(\n (northEast.x - southWest.x) / tanTheta,\n (northEast.y - southWest.y) / tanPhi\n ) * 0.5;\n } else {\n const width = northEast.x - southWest.x;\n const height = northEast.y - southWest.y;\n result.z = Math.max(width, height);\n }\n\n return result;\n}\n\nconst viewRectangle2DCartographic = new Cartographic();\nconst viewRectangle2DNorthEast = new Cartesian3();\nconst viewRectangle2DSouthWest = new Cartesian3();\nfunction rectangleCameraPosition2D(camera, rectangle, result) {\n const projection = camera._projection;\n\n // Account for the rectangle crossing the International Date Line in 2D mode\n let east = rectangle.east;\n if (rectangle.west > rectangle.east) {\n if (camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL) {\n east += CesiumMath.TWO_PI;\n } else {\n rectangle = Rectangle.MAX_VALUE;\n east = rectangle.east;\n }\n }\n\n let cart = viewRectangle2DCartographic;\n cart.longitude = east;\n cart.latitude = rectangle.north;\n const northEast = projection.project(cart, viewRectangle2DNorthEast);\n cart.longitude = rectangle.west;\n cart.latitude = rectangle.south;\n const southWest = projection.project(cart, viewRectangle2DSouthWest);\n\n const width = Math.abs(northEast.x - southWest.x) * 0.5;\n let height = Math.abs(northEast.y - southWest.y) * 0.5;\n\n let right, top;\n const ratio = camera.frustum.right / camera.frustum.top;\n const heightRatio = height * ratio;\n if (width > heightRatio) {\n right = width;\n top = right / ratio;\n } else {\n top = height;\n right = heightRatio;\n }\n\n height = Math.max(2.0 * right, 2.0 * top);\n\n result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;\n result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;\n\n cart = projection.unproject(result, cart);\n cart.height = height;\n result = projection.project(cart, result);\n\n return result;\n}\n\n/**\n * Get the camera position needed to view a rectangle on an ellipsoid or map\n *\n * @param {Rectangle} rectangle The rectangle to view.\n * @param {Cartesian3} [result] The camera position needed to view the rectangle\n * @returns {Cartesian3} The camera position needed to view the rectangle\n */\nCamera.prototype.getRectangleCameraCoordinates = function (rectangle, result) {\nconst mode = this._mode;\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n if (mode === SceneMode.SCENE3D) {\n return rectangleCameraPosition3D(this, rectangle, result);\n } else if (mode === SceneMode.COLUMBUS_VIEW) {\n return rectangleCameraPositionColumbusView(this, rectangle, result);\n } else if (mode === SceneMode.SCENE2D) {\n return rectangleCameraPosition2D(this, rectangle, result);\n }\n\n return undefined;\n};\n\nconst pickEllipsoid3DRay = new Ray();\nfunction pickEllipsoid3D(camera, windowPosition, ellipsoid, result) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n const ray = camera.getPickRay(windowPosition, pickEllipsoid3DRay);\n const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n if (!intersection) {\n return undefined;\n }\n\n const t = intersection.start > 0.0 ? intersection.start : intersection.stop;\n return Ray.getPoint(ray, t, result);\n}\n\nconst pickEllipsoid2DRay = new Ray();\nfunction pickMap2D(camera, windowPosition, projection, result) {\n const ray = camera.getPickRay(windowPosition, pickEllipsoid2DRay);\n let position = ray.origin;\n position = Cartesian3.fromElements(position.y, position.z, 0.0, position);\n const cart = projection.unproject(position);\n\n if (\n cart.latitude < -CesiumMath.PI_OVER_TWO ||\n cart.latitude > CesiumMath.PI_OVER_TWO\n ) {\n return undefined;\n }\n\n return projection.ellipsoid.cartographicToCartesian(cart, result);\n}\n\nconst pickEllipsoidCVRay = new Ray();\nfunction pickMapColumbusView(camera, windowPosition, projection, result) {\n const ray = camera.getPickRay(windowPosition, pickEllipsoidCVRay);\n const scalar = -ray.origin.x / ray.direction.x;\n Ray.getPoint(ray, scalar, result);\n\n const cart = projection.unproject(new Cartesian3(result.y, result.z, 0.0));\n\n if (\n cart.latitude < -CesiumMath.PI_OVER_TWO ||\n cart.latitude > CesiumMath.PI_OVER_TWO ||\n cart.longitude < -Math.PI ||\n cart.longitude > Math.PI\n ) {\n return undefined;\n }\n\n return projection.ellipsoid.cartographicToCartesian(cart, result);\n}\n\n/**\n * Pick an ellipsoid or map.\n *\n * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to pick.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3 | undefined} If the ellipsoid or map was picked,\n * returns the point on the surface of the ellipsoid or map in world\n * coordinates. If the ellipsoid or map was not picked, returns undefined.\n *\n * @example\n * const canvas = viewer.scene.canvas;\n * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);\n * const ellipsoid = viewer.scene.globe.ellipsoid;\n * const result = viewer.camera.pickEllipsoid(center, ellipsoid);\n */\nCamera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) {\n const canvas = this._scene.canvas;\n if (canvas.clientWidth === 0 || canvas.clientHeight === 0) {\n return undefined;\n }\n\n if (!defined(result)) {\n result = new Cartesian3();\n }\n\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n if (this._mode === SceneMode.SCENE3D) {\n result = pickEllipsoid3D(this, windowPosition, ellipsoid, result);\n } else if (this._mode === SceneMode.SCENE2D) {\n result = pickMap2D(this, windowPosition, this._projection, result);\n } else if (this._mode === SceneMode.COLUMBUS_VIEW) {\n result = pickMapColumbusView(\n this,\n windowPosition,\n this._projection,\n result\n );\n } else {\n return undefined;\n }\n\n return result;\n};\n\nconst pickPerspCenter = new Cartesian3();\nconst pickPerspXDir = new Cartesian3();\nconst pickPerspYDir = new Cartesian3();\nfunction getPickRayPerspective(camera, windowPosition, result) {\n const canvas = camera._scene.canvas;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n\n const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n const tanTheta = camera.frustum.aspectRatio * tanPhi;\n const near = camera.frustum.near;\n\n const x = (2.0 / width) * windowPosition.x - 1.0;\n const y = (2.0 / height) * (height - windowPosition.y) - 1.0;\n\n const position = camera.positionWC;\n Cartesian3.clone(position, result.origin);\n\n const nearCenter = Cartesian3.multiplyByScalar(\n camera.directionWC,\n near,\n pickPerspCenter\n );\n Cartesian3.add(position, nearCenter, nearCenter);\n const xDir = Cartesian3.multiplyByScalar(\n camera.rightWC,\n x * near * tanTheta,\n pickPerspXDir\n );\n const yDir = Cartesian3.multiplyByScalar(\n camera.upWC,\n y * near * tanPhi,\n pickPerspYDir\n );\n const direction = Cartesian3.add(nearCenter, xDir, result.direction);\n Cartesian3.add(direction, yDir, direction);\n Cartesian3.subtract(direction, position, direction);\n Cartesian3.normalize(direction, direction);\n\n return result;\n}\n\nconst scratchDirection = new Cartesian3();\n\nfunction getPickRayOrthographic(camera, windowPosition, result) {\n const canvas = camera._scene.canvas;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n\n let frustum = camera.frustum;\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n let x = (2.0 / width) * windowPosition.x - 1.0;\n x *= (frustum.right - frustum.left) * 0.5;\n let y = (2.0 / height) * (height - windowPosition.y) - 1.0;\n y *= (frustum.top - frustum.bottom) * 0.5;\n\n const origin = result.origin;\n Cartesian3.clone(camera.position, origin);\n\n Cartesian3.multiplyByScalar(camera.right, x, scratchDirection);\n Cartesian3.add(scratchDirection, origin, origin);\n Cartesian3.multiplyByScalar(camera.up, y, scratchDirection);\n Cartesian3.add(scratchDirection, origin, origin);\n\n Cartesian3.clone(camera.directionWC, result.direction);\n\n if (\n camera._mode === SceneMode.COLUMBUS_VIEW ||\n camera._mode === SceneMode.SCENE2D\n ) {\n Cartesian3.fromElements(\n result.origin.z,\n result.origin.x,\n result.origin.y,\n result.origin\n );\n }\n\n return result;\n}\n\n/**\n * Create a ray from the camera position through the pixel at <code>windowPosition</code>\n * in world coordinates.\n *\n * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.\n * @param {Ray} [result] The object onto which to store the result.\n * @returns {Ray|undefined} Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.\n */\nCamera.prototype.getPickRay = function (windowPosition, result) {\n if (!defined(result)) {\n result = new Ray();\n }\n\n const canvas = this._scene.canvas;\n if (canvas.clientWidth <= 0 || canvas.clientHeight <= 0) {\n return undefined;\n }\n\n const frustum = this.frustum;\n if (\n defined(frustum.aspectRatio) &&\n defined(frustum.fov) &&\n defined(frustum.near)\n ) {\n return getPickRayPerspective(this, windowPosition, result);\n }\n\n return getPickRayOrthographic(this, windowPosition, result);\n};\n\nconst scratchToCenter = new Cartesian3();\nconst scratchProj = new Cartesian3();\n\n/**\n * Return the distance from the camera to the front of the bounding sphere.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.\n * @returns {Number} The distance to the bounding sphere.\n */\nCamera.prototype.distanceToBoundingSphere = function (boundingSphere) {\n const toCenter = Cartesian3.subtract(\n this.positionWC,\n boundingSphere.center,\n scratchToCenter\n );\n const proj = Cartesian3.multiplyByScalar(\n this.directionWC,\n Cartesian3.dot(toCenter, this.directionWC),\n scratchProj\n );\n return Math.max(0.0, Cartesian3.magnitude(proj) - boundingSphere.radius);\n};\n\nconst scratchPixelSize = new Cartesian2();\n\n/**\n * Return the pixel size in meters.\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.\n * @param {Number} drawingBufferWidth The drawing buffer width.\n * @param {Number} drawingBufferHeight The drawing buffer height.\n * @returns {Number} The pixel size in meters.\n */\nCamera.prototype.getPixelSize = function (\n boundingSphere,\n drawingBufferWidth,\n drawingBufferHeight\n) {\n const distance = this.distanceToBoundingSphere(boundingSphere);\n const pixelSize = this.frustum.getPixelDimensions(\n drawingBufferWidth,\n drawingBufferHeight,\n distance,\n this._scene.pixelRatio,\n scratchPixelSize\n );\n return Math.max(pixelSize.x, pixelSize.y);\n};\n\nfunction createAnimationTemplateCV(\n camera,\n position,\n center,\n maxX,\n maxY,\n duration\n) {\n const newPosition = Cartesian3.clone(position);\n\n if (center.y > maxX) {\n newPosition.y -= center.y - maxX;\n } else if (center.y < -maxX) {\n newPosition.y += -maxX - center.y;\n }\n\n if (center.z > maxY) {\n newPosition.z -= center.z - maxY;\n } else if (center.z < -maxY) {\n newPosition.z += -maxY - center.z;\n }\n\n function updateCV(value) {\n const interp = Cartesian3.lerp(\n position,\n newPosition,\n value.time,\n new Cartesian3()\n );\n camera.worldToCameraCoordinatesPoint(interp, camera.position);\n }\n return {\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n duration: duration,\n update: updateCV,\n };\n}\n\nconst normalScratch = new Cartesian3();\nconst centerScratch = new Cartesian3();\nconst posScratch = new Cartesian3();\nconst scratchCartesian3Subtract = new Cartesian3();\n\nfunction createAnimationCV(camera, duration) {\n let position = camera.position;\n const direction = camera.direction;\n\n const normal = camera.worldToCameraCoordinatesVector(\n Cartesian3.UNIT_X,\n normalScratch\n );\n const scalar =\n -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);\n const center = Cartesian3.add(\n position,\n Cartesian3.multiplyByScalar(direction, scalar, centerScratch),\n centerScratch\n );\n camera.cameraToWorldCoordinatesPoint(center, center);\n\n position = camera.cameraToWorldCoordinatesPoint(camera.position, posScratch);\n\n const tanPhi = Math.tan(camera.frustum.fovy * 0.5);\n const tanTheta = camera.frustum.aspectRatio * tanPhi;\n const distToC = Cartesian3.magnitude(\n Cartesian3.subtract(position, center, scratchCartesian3Subtract)\n );\n const dWidth = tanTheta * distToC;\n const dHeight = tanPhi * distToC;\n\n const mapWidth = camera._maxCoord.x;\n const mapHeight = camera._maxCoord.y;\n\n const maxX = Math.max(dWidth - mapWidth, mapWidth);\n const maxY = Math.max(dHeight - mapHeight, mapHeight);\n\n if (\n position.z < -maxX ||\n position.z > maxX ||\n position.y < -maxY ||\n position.y > maxY\n ) {\n const translateX = center.y < -maxX || center.y > maxX;\n const translateY = center.z < -maxY || center.z > maxY;\n if (translateX || translateY) {\n return createAnimationTemplateCV(\n camera,\n position,\n center,\n maxX,\n maxY,\n duration\n );\n }\n }\n\n return undefined;\n}\n\n/**\n * Create an animation to move the map into view. This method is only valid for 2D and Columbus modes.\n *\n * @param {Number} duration The duration, in seconds, of the animation.\n * @returns {Object} The animation or undefined if the scene mode is 3D or the map is already ion view.\n *\n * @private\n */\nCamera.prototype.createCorrectPositionTween = function (duration) {\n if (this._mode === SceneMode.COLUMBUS_VIEW) {\n return createAnimationCV(this, duration);\n }\n\n return undefined;\n};\n\nconst scratchFlyToDestination = new Cartesian3();\nconst newOptions = {\n destination: undefined,\n heading: undefined,\n pitch: undefined,\n roll: undefined,\n duration: undefined,\n complete: undefined,\n cancel: undefined,\n endTransform: undefined,\n maximumHeight: undefined,\n easingFunction: undefined,\n};\n\n/**\n * Cancels the current camera flight and leaves the camera at its current location.\n * If no flight is in progress, this this function does nothing.\n */\nCamera.prototype.cancelFlight = function () {\n if (defined(this._currentFlight)) {\n this._currentFlight.cancelTween();\n this._currentFlight = undefined;\n }\n};\n\n/**\n * Completes the current camera flight and moves the camera immediately to its final destination.\n * If no flight is in progress, this this function does nothing.\n */\nCamera.prototype.completeFlight = function () {\n if (defined(this._currentFlight)) {\n this._currentFlight.cancelTween();\n\n const options = {\n destination: undefined,\n orientation: {\n heading: undefined,\n pitch: undefined,\n roll: undefined,\n },\n };\n\n options.destination = newOptions.destination;\n options.orientation.heading = newOptions.heading;\n options.orientation.pitch = newOptions.pitch;\n options.orientation.roll = newOptions.roll;\n\n this.setView(options);\n\n if (defined(this._currentFlight.complete)) {\n this._currentFlight.complete();\n }\n\n this._currentFlight = undefined;\n }\n};\n\n/**\n * Flies the camera from its current position to a new position.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3|Rectangle} options.destination The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.\n * @param {Object} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point\n * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive\n * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.\n * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.\n * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.\n * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.\n * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.\n * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.\n * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.\n * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.\n * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.\n *\n * @exception {DeveloperError} If either direction or up is given, then both are required.\n *\n * @example\n * // 1. Fly to a position with a top-down view\n * viewer.camera.flyTo({\n * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)\n * });\n *\n * // 2. Fly to a Rectangle with a top-down view\n * viewer.camera.flyTo({\n * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)\n * });\n *\n * // 3. Fly to a position with an orientation using unit vectors.\n * viewer.camera.flyTo({\n * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n * orientation : {\n * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),\n * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)\n * }\n * });\n *\n * // 4. Fly to a position with an orientation using heading, pitch and roll.\n * viewer.camera.flyTo({\n * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),\n * orientation : {\n * heading : Cesium.Math.toRadians(175.0),\n * pitch : Cesium.Math.toRadians(-35.0),\n * roll : 0.0\n * }\n * });\n */\nCamera.prototype.flyTo = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n let destination = options.destination;\n const mode = this._mode;\n if (mode === SceneMode.MORPHING) {\n return;\n }\n\n this.cancelFlight();\n\n const isRectangle = destination instanceof Rectangle;\n if (isRectangle) {\n destination = this.getRectangleCameraCoordinates(\n destination,\n scratchFlyToDestination\n );\n }\n\n let orientation = defaultValue(\n options.orientation,\n defaultValue.EMPTY_OBJECT\n );\n if (defined(orientation.direction)) {\n orientation = directionUpToHeadingPitchRoll(\n this,\n destination,\n orientation,\n scratchSetViewOptions.orientation\n );\n }\n\n if (defined(options.duration) && options.duration <= 0.0) {\n const setViewOptions = scratchSetViewOptions;\n setViewOptions.destination = options.destination;\n setViewOptions.orientation.heading = orientation.heading;\n setViewOptions.orientation.pitch = orientation.pitch;\n setViewOptions.orientation.roll = orientation.roll;\n setViewOptions.convert = options.convert;\n setViewOptions.endTransform = options.endTransform;\n this.setView(setViewOptions);\n if (typeof options.complete === \"function\") {\n options.complete();\n }\n return;\n }\n\n const that = this;\n /* eslint-disable-next-line prefer-const */\n let flightTween;\n\n newOptions.destination = destination;\n newOptions.heading = orientation.heading;\n newOptions.pitch = orientation.pitch;\n newOptions.roll = orientation.roll;\n newOptions.duration = options.duration;\n newOptions.complete = function () {\n if (flightTween === that._currentFlight) {\n that._currentFlight = undefined;\n }\n if (defined(options.complete)) {\n options.complete();\n }\n };\n newOptions.cancel = options.cancel;\n newOptions.endTransform = options.endTransform;\n newOptions.convert = isRectangle ? false : options.convert;\n newOptions.maximumHeight = options.maximumHeight;\n newOptions.pitchAdjustHeight = options.pitchAdjustHeight;\n newOptions.flyOverLongitude = options.flyOverLongitude;\n newOptions.flyOverLongitudeWeight = options.flyOverLongitudeWeight;\n newOptions.easingFunction = options.easingFunction;\n\n const scene = this._scene;\n const tweenOptions = CameraFlightPath.createTween(scene, newOptions);\n // If the camera doesn't actually need to go anywhere, duration\n // will be 0 and we can just complete the current flight.\n if (tweenOptions.duration === 0) {\n if (typeof tweenOptions.complete === \"function\") {\n tweenOptions.complete();\n }\n return;\n }\n flightTween = scene.tweens.add(tweenOptions);\n this._currentFlight = flightTween;\n\n // Save the final destination view information for the PRELOAD_FLIGHT pass.\n let preloadFlightCamera = this._scene.preloadFlightCamera;\n if (this._mode !== SceneMode.SCENE2D) {\n if (!defined(preloadFlightCamera)) {\n preloadFlightCamera = Camera.clone(this);\n }\n preloadFlightCamera.setView({\n destination: destination,\n orientation: orientation,\n });\n\n this._scene.preloadFlightCullingVolume = preloadFlightCamera.frustum.computeCullingVolume(\n preloadFlightCamera.positionWC,\n preloadFlightCamera.directionWC,\n preloadFlightCamera.upWC\n );\n }\n};\n\nfunction distanceToBoundingSphere3D(camera, radius) {\n const frustum = camera.frustum;\n const tanPhi = Math.tan(frustum.fovy * 0.5);\n const tanTheta = frustum.aspectRatio * tanPhi;\n return Math.max(radius / tanTheta, radius / tanPhi);\n}\n\nfunction distanceToBoundingSphere2D(camera, radius) {\n let frustum = camera.frustum;\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n\n let right, top;\n const ratio = frustum.right / frustum.top;\n const heightRatio = radius * ratio;\n if (radius > heightRatio) {\n right = radius;\n top = right / ratio;\n } else {\n top = radius;\n right = heightRatio;\n }\n\n return Math.max(right, top) * 1.5;\n}\n\nconst MINIMUM_ZOOM = 100.0;\n\nfunction adjustBoundingSphereOffset(camera, boundingSphere, offset) {\n offset = HeadingPitchRange.clone(\n defined(offset) ? offset : Camera.DEFAULT_OFFSET\n );\n\n const minimumZoom =\n camera._scene.screenSpaceCameraController.minimumZoomDistance;\n const maximumZoom =\n camera._scene.screenSpaceCameraController.maximumZoomDistance;\n const range = offset.range;\n if (!defined(range) || range === 0.0) {\n const radius = boundingSphere.radius;\n if (radius === 0.0) {\n offset.range = MINIMUM_ZOOM;\n } else if (\n camera.frustum instanceof OrthographicFrustum ||\n camera._mode === SceneMode.SCENE2D\n ) {\n offset.range = distanceToBoundingSphere2D(camera, radius);\n } else {\n offset.range = distanceToBoundingSphere3D(camera, radius);\n }\n offset.range = CesiumMath.clamp(offset.range, minimumZoom, maximumZoom);\n }\n\n return offset;\n}\n\n/**\n * Sets the camera so that the current view contains the provided bounding sphere.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.\n * @param {HeadingPitchRange} [offset] The offset from the target in the local east-north-up reference frame centered at the target.\n *\n * @exception {DeveloperError} viewBoundingSphere is not supported while morphing.\n */\nCamera.prototype.viewBoundingSphere = function (boundingSphere, offset) {\n offset = adjustBoundingSphereOffset(this, boundingSphere, offset);\n this.lookAt(boundingSphere.center, offset);\n};\n\nconst scratchflyToBoundingSphereTransform = new Matrix4();\nconst scratchflyToBoundingSphereDestination = new Cartesian3();\nconst scratchflyToBoundingSphereDirection = new Cartesian3();\nconst scratchflyToBoundingSphereUp = new Cartesian3();\nconst scratchflyToBoundingSphereRight = new Cartesian3();\nconst scratchFlyToBoundingSphereCart4 = new Cartesian4();\nconst scratchFlyToBoundingSphereQuaternion = new Quaternion();\nconst scratchFlyToBoundingSphereMatrix3 = new Matrix3();\n\n/**\n * Flies the camera to a location where the current view contains the provided bounding sphere.\n *\n * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be aligned to local north.</p>\n *\n * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.\n * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.\n * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.\n * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.\n * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.\n * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.\n * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.\n * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.\n * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.\n */\nCamera.prototype.flyToBoundingSphere = function (boundingSphere, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const scene2D =\n this._mode === SceneMode.SCENE2D || this._mode === SceneMode.COLUMBUS_VIEW;\n this._setTransform(Matrix4.IDENTITY);\n const offset = adjustBoundingSphereOffset(\n this,\n boundingSphere,\n options.offset\n );\n\n let position;\n if (scene2D) {\n position = Cartesian3.multiplyByScalar(\n Cartesian3.UNIT_Z,\n offset.range,\n scratchflyToBoundingSphereDestination\n );\n } else {\n position = offsetFromHeadingPitchRange(\n offset.heading,\n offset.pitch,\n offset.range\n );\n }\n\n const transform = Transforms.eastNorthUpToFixedFrame(\n boundingSphere.center,\n Ellipsoid.WGS84,\n scratchflyToBoundingSphereTransform\n );\n Matrix4.multiplyByPoint(transform, position, position);\n\n let direction;\n let up;\n\n if (!scene2D) {\n direction = Cartesian3.subtract(\n boundingSphere.center,\n position,\n scratchflyToBoundingSphereDirection\n );\n Cartesian3.normalize(direction, direction);\n\n up = Matrix4.multiplyByPointAsVector(\n transform,\n Cartesian3.UNIT_Z,\n scratchflyToBoundingSphereUp\n );\n if (1.0 - Math.abs(Cartesian3.dot(direction, up)) < CesiumMath.EPSILON6) {\n const rotateQuat = Quaternion.fromAxisAngle(\n direction,\n offset.heading,\n scratchFlyToBoundingSphereQuaternion\n );\n const rotation = Matrix3.fromQuaternion(\n rotateQuat,\n scratchFlyToBoundingSphereMatrix3\n );\n\n Cartesian3.fromCartesian4(\n Matrix4.getColumn(transform, 1, scratchFlyToBoundingSphereCart4),\n up\n );\n Matrix3.multiplyByVector(rotation, up, up);\n }\n\n const right = Cartesian3.cross(\n direction,\n up,\n scratchflyToBoundingSphereRight\n );\n Cartesian3.cross(right, direction, up);\n Cartesian3.normalize(up, up);\n }\n\n this.flyTo({\n destination: position,\n orientation: {\n direction: direction,\n up: up,\n },\n duration: options.duration,\n complete: options.complete,\n cancel: options.cancel,\n endTransform: options.endTransform,\n maximumHeight: options.maximumHeight,\n easingFunction: options.easingFunction,\n flyOverLongitude: options.flyOverLongitude,\n flyOverLongitudeWeight: options.flyOverLongitudeWeight,\n pitchAdjustHeight: options.pitchAdjustHeight,\n });\n};\n\nconst scratchCartesian3_1 = new Cartesian3();\nconst scratchCartesian3_2 = new Cartesian3();\nconst scratchCartesian3_3 = new Cartesian3();\nconst scratchCartesian3_4 = new Cartesian3();\nconst horizonPoints = [\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n];\n\nfunction computeHorizonQuad(camera, ellipsoid) {\n const radii = ellipsoid.radii;\n const p = camera.positionWC;\n\n // Find the corresponding position in the scaled space of the ellipsoid.\n const q = Cartesian3.multiplyComponents(\n ellipsoid.oneOverRadii,\n p,\n scratchCartesian3_1\n );\n\n const qMagnitude = Cartesian3.magnitude(q);\n const qUnit = Cartesian3.normalize(q, scratchCartesian3_2);\n\n // Determine the east and north directions at q.\n let eUnit;\n let nUnit;\n if (\n Cartesian3.equalsEpsilon(qUnit, Cartesian3.UNIT_Z, CesiumMath.EPSILON10)\n ) {\n eUnit = new Cartesian3(0, 1, 0);\n nUnit = new Cartesian3(0, 0, 1);\n } else {\n eUnit = Cartesian3.normalize(\n Cartesian3.cross(Cartesian3.UNIT_Z, qUnit, scratchCartesian3_3),\n scratchCartesian3_3\n );\n nUnit = Cartesian3.normalize(\n Cartesian3.cross(qUnit, eUnit, scratchCartesian3_4),\n scratchCartesian3_4\n );\n }\n\n // Determine the radius of the 'limb' of the ellipsoid.\n const wMagnitude = Math.sqrt(Cartesian3.magnitudeSquared(q) - 1.0);\n\n // Compute the center and offsets.\n const center = Cartesian3.multiplyByScalar(\n qUnit,\n 1.0 / qMagnitude,\n scratchCartesian3_1\n );\n const scalar = wMagnitude / qMagnitude;\n const eastOffset = Cartesian3.multiplyByScalar(\n eUnit,\n scalar,\n scratchCartesian3_2\n );\n const northOffset = Cartesian3.multiplyByScalar(\n nUnit,\n scalar,\n scratchCartesian3_3\n );\n\n // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.\n const upperLeft = Cartesian3.add(center, northOffset, horizonPoints[0]);\n Cartesian3.subtract(upperLeft, eastOffset, upperLeft);\n Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);\n\n const lowerLeft = Cartesian3.subtract(center, northOffset, horizonPoints[1]);\n Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);\n Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);\n\n const lowerRight = Cartesian3.subtract(center, northOffset, horizonPoints[2]);\n Cartesian3.add(lowerRight, eastOffset, lowerRight);\n Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);\n\n const upperRight = Cartesian3.add(center, northOffset, horizonPoints[3]);\n Cartesian3.add(upperRight, eastOffset, upperRight);\n Cartesian3.multiplyComponents(radii, upperRight, upperRight);\n\n return horizonPoints;\n}\n\nconst scratchPickCartesian2 = new Cartesian2();\nconst scratchRectCartesian = new Cartesian3();\nconst cartoArray = [\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n new Cartographic(),\n];\nfunction addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) {\n scratchPickCartesian2.x = x;\n scratchPickCartesian2.y = y;\n const r = camera.pickEllipsoid(\n scratchPickCartesian2,\n ellipsoid,\n scratchRectCartesian\n );\n if (defined(r)) {\n cartoArray[index] = ellipsoid.cartesianToCartographic(r, cartoArray[index]);\n return 1;\n }\n cartoArray[index] = ellipsoid.cartesianToCartographic(\n computedHorizonQuad[index],\n cartoArray[index]\n );\n return 0;\n}\n/**\n * Computes the approximate visible rectangle on the ellipsoid.\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that you want to know the visible region.\n * @param {Rectangle} [result] The rectangle in which to store the result\n *\n * @returns {Rectangle|undefined} The visible rectangle or undefined if the ellipsoid isn't visible at all.\n */\nCamera.prototype.computeViewRectangle = function (ellipsoid, result) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n const cullingVolume = this.frustum.computeCullingVolume(\n this.positionWC,\n this.directionWC,\n this.upWC\n );\n const boundingSphere = new BoundingSphere(\n Cartesian3.ZERO,\n ellipsoid.maximumRadius\n );\n const visibility = cullingVolume.computeVisibility(boundingSphere);\n if (visibility === Intersect.OUTSIDE) {\n return undefined;\n }\n\n const canvas = this._scene.canvas;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n\n let successfulPickCount = 0;\n\n const computedHorizonQuad = computeHorizonQuad(this, ellipsoid);\n\n successfulPickCount += addToResult(\n 0,\n 0,\n 0,\n this,\n ellipsoid,\n computedHorizonQuad\n );\n successfulPickCount += addToResult(\n 0,\n height,\n 1,\n this,\n ellipsoid,\n computedHorizonQuad\n );\n successfulPickCount += addToResult(\n width,\n height,\n 2,\n this,\n ellipsoid,\n computedHorizonQuad\n );\n successfulPickCount += addToResult(\n width,\n 0,\n 3,\n this,\n ellipsoid,\n computedHorizonQuad\n );\n\n if (successfulPickCount < 2) {\n // If we have space non-globe in 3 or 4 corners then return the whole globe\n return Rectangle.MAX_VALUE;\n }\n\n result = Rectangle.fromCartographicArray(cartoArray, result);\n\n // Detect if we go over the poles\n let distance = 0;\n let lastLon = cartoArray[3].longitude;\n for (let i = 0; i < 4; ++i) {\n const lon = cartoArray[i].longitude;\n const diff = Math.abs(lon - lastLon);\n if (diff > CesiumMath.PI) {\n // Crossed the dateline\n distance += CesiumMath.TWO_PI - diff;\n } else {\n distance += diff;\n }\n\n lastLon = lon;\n }\n\n // We are over one of the poles so adjust the rectangle accordingly\n if (\n CesiumMath.equalsEpsilon(\n Math.abs(distance),\n CesiumMath.TWO_PI,\n CesiumMath.EPSILON9\n )\n ) {\n result.west = -CesiumMath.PI;\n result.east = CesiumMath.PI;\n if (cartoArray[0].latitude >= 0.0) {\n result.north = CesiumMath.PI_OVER_TWO;\n } else {\n result.south = -CesiumMath.PI_OVER_TWO;\n }\n }\n\n return result;\n};\n\n/**\n * Switches the frustum/projection to perspective.\n *\n * This function is a no-op in 2D which must always be orthographic.\n */\nCamera.prototype.switchToPerspectiveFrustum = function () {\n if (\n this._mode === SceneMode.SCENE2D ||\n this.frustum instanceof PerspectiveFrustum\n ) {\n return;\n }\n\n const scene = this._scene;\n this.frustum = new PerspectiveFrustum();\n this.frustum.aspectRatio =\n scene.drawingBufferWidth / scene.drawingBufferHeight;\n this.frustum.fov = CesiumMath.toRadians(60.0);\n};\n\n/**\n * Switches the frustum/projection to orthographic.\n *\n * This function is a no-op in 2D which will always be orthographic.\n */\nCamera.prototype.switchToOrthographicFrustum = function () {\n if (\n this._mode === SceneMode.SCENE2D ||\n this.frustum instanceof OrthographicFrustum\n ) {\n return;\n }\n\n // This must be called before changing the frustum because it uses the previous\n // frustum to reconstruct the world space position from the depth buffer.\n const frustumWidth = calculateOrthographicFrustumWidth(this);\n\n const scene = this._scene;\n this.frustum = new OrthographicFrustum();\n this.frustum.aspectRatio =\n scene.drawingBufferWidth / scene.drawingBufferHeight;\n this.frustum.width = frustumWidth;\n};\n\n/**\n * @private\n */\nCamera.clone = function (camera, result) {\n if (!defined(result)) {\n result = new Camera(camera._scene);\n }\n\n Cartesian3.clone(camera.position, result.position);\n Cartesian3.clone(camera.direction, result.direction);\n Cartesian3.clone(camera.up, result.up);\n Cartesian3.clone(camera.right, result.right);\n Matrix4.clone(camera._transform, result.transform);\n result._transformChanged = true;\n result.frustum = camera.frustum.clone();\n\n return result;\n};\n\n/**\n * A function that will execute when a flight completes.\n * @callback Camera.FlightCompleteCallback\n */\n\n/**\n * A function that will execute when a flight is cancelled.\n * @callback Camera.FlightCancelledCallback\n */\nexport default Camera;\n", "/**\n * Enumerates the available input for interacting with the camera.\n *\n * @enum {Number}\n */\nconst CameraEventType = {\n /**\n * A left mouse button press followed by moving the mouse and releasing the button.\n *\n * @type {Number}\n * @constant\n */\n LEFT_DRAG: 0,\n\n /**\n * A right mouse button press followed by moving the mouse and releasing the button.\n *\n * @type {Number}\n * @constant\n */\n RIGHT_DRAG: 1,\n\n /**\n * A middle mouse button press followed by moving the mouse and releasing the button.\n *\n * @type {Number}\n * @constant\n */\n MIDDLE_DRAG: 2,\n\n /**\n * Scrolling the middle mouse button.\n *\n * @type {Number}\n * @constant\n */\n WHEEL: 3,\n\n /**\n * A two-finger touch on a touch surface.\n *\n * @type {Number}\n * @constant\n */\n PINCH: 4,\n};\nexport default Object.freeze(CameraEventType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport KeyboardEventModifier from \"../Core/KeyboardEventModifier.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport ScreenSpaceEventHandler from \"../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../Core/ScreenSpaceEventType.js\";\nimport CameraEventType from \"./CameraEventType.js\";\n\nfunction getKey(type, modifier) {\n let key = type;\n if (defined(modifier)) {\n key += `+${modifier}`;\n }\n return key;\n}\n\nfunction clonePinchMovement(pinchMovement, result) {\n Cartesian2.clone(\n pinchMovement.distance.startPosition,\n result.distance.startPosition\n );\n Cartesian2.clone(\n pinchMovement.distance.endPosition,\n result.distance.endPosition\n );\n\n Cartesian2.clone(\n pinchMovement.angleAndHeight.startPosition,\n result.angleAndHeight.startPosition\n );\n Cartesian2.clone(\n pinchMovement.angleAndHeight.endPosition,\n result.angleAndHeight.endPosition\n );\n}\n\nfunction listenToPinch(aggregator, modifier, canvas) {\n const key = getKey(CameraEventType.PINCH, modifier);\n\n const update = aggregator._update;\n const isDown = aggregator._isDown;\n const eventStartPosition = aggregator._eventStartPosition;\n const pressTime = aggregator._pressTime;\n const releaseTime = aggregator._releaseTime;\n\n update[key] = true;\n isDown[key] = false;\n eventStartPosition[key] = new Cartesian2();\n\n let movement = aggregator._movement[key];\n if (!defined(movement)) {\n movement = aggregator._movement[key] = {};\n }\n\n movement.distance = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n };\n movement.angleAndHeight = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n };\n movement.prevAngle = 0.0;\n\n aggregator._eventHandler.setInputAction(\n function (event) {\n aggregator._buttonsDown++;\n isDown[key] = true;\n pressTime[key] = new Date();\n // Compute center position and store as start point.\n Cartesian2.lerp(\n event.position1,\n event.position2,\n 0.5,\n eventStartPosition[key]\n );\n },\n ScreenSpaceEventType.PINCH_START,\n modifier\n );\n\n aggregator._eventHandler.setInputAction(\n function () {\n aggregator._buttonsDown = Math.max(aggregator._buttonsDown - 1, 0);\n isDown[key] = false;\n releaseTime[key] = new Date();\n },\n ScreenSpaceEventType.PINCH_END,\n modifier\n );\n\n aggregator._eventHandler.setInputAction(\n function (mouseMovement) {\n if (isDown[key]) {\n // Aggregate several input events into a single animation frame.\n if (!update[key]) {\n Cartesian2.clone(\n mouseMovement.distance.endPosition,\n movement.distance.endPosition\n );\n Cartesian2.clone(\n mouseMovement.angleAndHeight.endPosition,\n movement.angleAndHeight.endPosition\n );\n } else {\n clonePinchMovement(mouseMovement, movement);\n update[key] = false;\n movement.prevAngle = movement.angleAndHeight.startPosition.x;\n }\n // Make sure our aggregation of angles does not \"flip\" over 360 degrees.\n let angle = movement.angleAndHeight.endPosition.x;\n const prevAngle = movement.prevAngle;\n const TwoPI = Math.PI * 2;\n while (angle >= prevAngle + Math.PI) {\n angle -= TwoPI;\n }\n while (angle < prevAngle - Math.PI) {\n angle += TwoPI;\n }\n movement.angleAndHeight.endPosition.x =\n (-angle * canvas.clientWidth) / 12;\n movement.angleAndHeight.startPosition.x =\n (-prevAngle * canvas.clientWidth) / 12;\n }\n },\n ScreenSpaceEventType.PINCH_MOVE,\n modifier\n );\n}\n\nfunction listenToWheel(aggregator, modifier) {\n const key = getKey(CameraEventType.WHEEL, modifier);\n\n const update = aggregator._update;\n update[key] = true;\n\n let movement = aggregator._movement[key];\n if (!defined(movement)) {\n movement = aggregator._movement[key] = {};\n }\n\n movement.startPosition = new Cartesian2();\n movement.endPosition = new Cartesian2();\n\n aggregator._eventHandler.setInputAction(\n function (delta) {\n // TODO: magic numbers\n const arcLength = 15.0 * CesiumMath.toRadians(delta);\n if (!update[key]) {\n movement.endPosition.y = movement.endPosition.y + arcLength;\n } else {\n Cartesian2.clone(Cartesian2.ZERO, movement.startPosition);\n movement.endPosition.x = 0.0;\n movement.endPosition.y = arcLength;\n update[key] = false;\n }\n },\n ScreenSpaceEventType.WHEEL,\n modifier\n );\n}\n\nfunction listenMouseButtonDownUp(aggregator, modifier, type) {\n const key = getKey(type, modifier);\n\n const isDown = aggregator._isDown;\n const eventStartPosition = aggregator._eventStartPosition;\n const pressTime = aggregator._pressTime;\n const releaseTime = aggregator._releaseTime;\n\n isDown[key] = false;\n eventStartPosition[key] = new Cartesian2();\n\n let lastMovement = aggregator._lastMovement[key];\n if (!defined(lastMovement)) {\n lastMovement = aggregator._lastMovement[key] = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n valid: false,\n };\n }\n\n let down;\n let up;\n if (type === CameraEventType.LEFT_DRAG) {\n down = ScreenSpaceEventType.LEFT_DOWN;\n up = ScreenSpaceEventType.LEFT_UP;\n } else if (type === CameraEventType.RIGHT_DRAG) {\n down = ScreenSpaceEventType.RIGHT_DOWN;\n up = ScreenSpaceEventType.RIGHT_UP;\n } else if (type === CameraEventType.MIDDLE_DRAG) {\n down = ScreenSpaceEventType.MIDDLE_DOWN;\n up = ScreenSpaceEventType.MIDDLE_UP;\n }\n\n aggregator._eventHandler.setInputAction(\n function (event) {\n aggregator._buttonsDown++;\n lastMovement.valid = false;\n isDown[key] = true;\n pressTime[key] = new Date();\n Cartesian2.clone(event.position, eventStartPosition[key]);\n },\n down,\n modifier\n );\n\n aggregator._eventHandler.setInputAction(\n function () {\n aggregator._buttonsDown = Math.max(aggregator._buttonsDown - 1, 0);\n isDown[key] = false;\n releaseTime[key] = new Date();\n },\n up,\n modifier\n );\n}\n\nfunction cloneMouseMovement(mouseMovement, result) {\n Cartesian2.clone(mouseMovement.startPosition, result.startPosition);\n Cartesian2.clone(mouseMovement.endPosition, result.endPosition);\n}\n\nfunction listenMouseMove(aggregator, modifier) {\n const update = aggregator._update;\n const movement = aggregator._movement;\n const lastMovement = aggregator._lastMovement;\n const isDown = aggregator._isDown;\n\n for (const typeName in CameraEventType) {\n if (CameraEventType.hasOwnProperty(typeName)) {\n const type = CameraEventType[typeName];\n if (defined(type)) {\n const key = getKey(type, modifier);\n update[key] = true;\n\n if (!defined(aggregator._lastMovement[key])) {\n aggregator._lastMovement[key] = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n valid: false,\n };\n }\n\n if (!defined(aggregator._movement[key])) {\n aggregator._movement[key] = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n };\n }\n }\n }\n }\n\n aggregator._eventHandler.setInputAction(\n function (mouseMovement) {\n for (const typeName in CameraEventType) {\n if (CameraEventType.hasOwnProperty(typeName)) {\n const type = CameraEventType[typeName];\n if (defined(type)) {\n const key = getKey(type, modifier);\n if (isDown[key]) {\n if (!update[key]) {\n Cartesian2.clone(\n mouseMovement.endPosition,\n movement[key].endPosition\n );\n } else {\n cloneMouseMovement(movement[key], lastMovement[key]);\n lastMovement[key].valid = true;\n cloneMouseMovement(mouseMovement, movement[key]);\n update[key] = false;\n }\n }\n }\n }\n }\n\n Cartesian2.clone(\n mouseMovement.endPosition,\n aggregator._currentMousePosition\n );\n },\n ScreenSpaceEventType.MOUSE_MOVE,\n modifier\n );\n}\n\n/**\n * Aggregates input events. For example, suppose the following inputs are received between frames:\n * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into\n * one event with a start and end position of the mouse.\n *\n * @alias CameraEventAggregator\n * @constructor\n *\n * @param {HTMLCanvasElement} [canvas=document] The element to handle events for.\n *\n * @see ScreenSpaceEventHandler\n */\nfunction CameraEventAggregator(canvas) {\n this._eventHandler = new ScreenSpaceEventHandler(canvas);\n\n this._update = {};\n this._movement = {};\n this._lastMovement = {};\n this._isDown = {};\n this._eventStartPosition = {};\n this._pressTime = {};\n this._releaseTime = {};\n\n this._buttonsDown = 0;\n\n this._currentMousePosition = new Cartesian2();\n\n listenToWheel(this, undefined);\n listenToPinch(this, undefined, canvas);\n listenMouseButtonDownUp(this, undefined, CameraEventType.LEFT_DRAG);\n listenMouseButtonDownUp(this, undefined, CameraEventType.RIGHT_DRAG);\n listenMouseButtonDownUp(this, undefined, CameraEventType.MIDDLE_DRAG);\n listenMouseMove(this, undefined);\n\n for (const modifierName in KeyboardEventModifier) {\n if (KeyboardEventModifier.hasOwnProperty(modifierName)) {\n const modifier = KeyboardEventModifier[modifierName];\n if (defined(modifier)) {\n listenToWheel(this, modifier);\n listenToPinch(this, modifier, canvas);\n listenMouseButtonDownUp(this, modifier, CameraEventType.LEFT_DRAG);\n listenMouseButtonDownUp(this, modifier, CameraEventType.RIGHT_DRAG);\n listenMouseButtonDownUp(this, modifier, CameraEventType.MIDDLE_DRAG);\n listenMouseMove(this, modifier);\n }\n }\n }\n}\n\nObject.defineProperties(CameraEventAggregator.prototype, {\n /**\n * Gets the current mouse position.\n * @memberof CameraEventAggregator.prototype\n * @type {Cartesian2}\n */\n currentMousePosition: {\n get: function () {\n return this._currentMousePosition;\n },\n },\n\n /**\n * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.\n * @memberof CameraEventAggregator.prototype\n * @type {Boolean}\n */\n anyButtonDown: {\n get: function () {\n const wheelMoved =\n !this._update[getKey(CameraEventType.WHEEL)] ||\n !this._update[\n getKey(CameraEventType.WHEEL, KeyboardEventModifier.SHIFT)\n ] ||\n !this._update[\n getKey(CameraEventType.WHEEL, KeyboardEventModifier.CTRL)\n ] ||\n !this._update[getKey(CameraEventType.WHEEL, KeyboardEventModifier.ALT)];\n return this._buttonsDown > 0 || wheelMoved;\n },\n },\n});\n\n/**\n * Gets if a mouse button down or touch has started and has been moved.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Boolean} Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>\n */\nCameraEventAggregator.prototype.isMoving = function (type, modifier) {\n const key = getKey(type, modifier);\n return !this._update[key];\n};\n\n/**\n * Gets the aggregated start and end position of the current event.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Object} An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.\n */\nCameraEventAggregator.prototype.getMovement = function (type, modifier) {\n const key = getKey(type, modifier);\n const movement = this._movement[key];\n return movement;\n};\n\n/**\n * Gets the start and end position of the last move event (not the aggregated event).\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Object|undefined} An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.\n */\nCameraEventAggregator.prototype.getLastMovement = function (type, modifier) {\n const key = getKey(type, modifier);\n const lastMovement = this._lastMovement[key];\n if (lastMovement.valid) {\n return lastMovement;\n }\n\n return undefined;\n};\n\n/**\n * Gets whether the mouse button is down or a touch has started.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Boolean} Whether the mouse button is down or a touch has started.\n */\nCameraEventAggregator.prototype.isButtonDown = function (type, modifier) {\n const key = getKey(type, modifier);\n return this._isDown[key];\n};\n\n/**\n * Gets the mouse position that started the aggregation.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Cartesian2} The mouse position.\n */\nCameraEventAggregator.prototype.getStartMousePosition = function (\n type,\n modifier\n) {\n if (type === CameraEventType.WHEEL) {\n return this._currentMousePosition;\n }\n\n const key = getKey(type, modifier);\n return this._eventStartPosition[key];\n};\n\n/**\n * Gets the time the button was pressed or the touch was started.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Date} The time the button was pressed or the touch was started.\n */\nCameraEventAggregator.prototype.getButtonPressTime = function (type, modifier) {\n const key = getKey(type, modifier);\n return this._pressTime[key];\n};\n\n/**\n * Gets the time the button was released or the touch was ended.\n *\n * @param {CameraEventType} type The camera event type.\n * @param {KeyboardEventModifier} [modifier] The keyboard modifier.\n * @returns {Date} The time the button was released or the touch was ended.\n */\nCameraEventAggregator.prototype.getButtonReleaseTime = function (\n type,\n modifier\n) {\n const key = getKey(type, modifier);\n return this._releaseTime[key];\n};\n\n/**\n * Signals that all of the events have been handled and the aggregator should be reset to handle new events.\n */\nCameraEventAggregator.prototype.reset = function () {\n for (const name in this._update) {\n if (this._update.hasOwnProperty(name)) {\n this._update[name] = true;\n }\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see CameraEventAggregator#destroy\n */\nCameraEventAggregator.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes mouse listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * handler = handler && handler.destroy();\n *\n * @see CameraEventAggregator#isDestroyed\n */\nCameraEventAggregator.prototype.destroy = function () {\n this._eventHandler = this._eventHandler && this._eventHandler.destroy();\n return destroyObject(this);\n};\nexport default CameraEventAggregator;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * The content of a tile in a {@link Cesium3DTileset}.\n * <p>\n * Derived classes of this interface provide access to individual features in the tile.\n * Access derived objects through {@link Cesium3DTile#content}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias Cesium3DTileContent\n * @constructor\n */\nfunction Cesium3DTileContent() {\n /**\n * Gets or sets if any feature's property changed. Used to\n * optimized applying a style when a feature's property changed.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @type {Boolean}\n *\n * @private\n */\n this.featurePropertiesDirty = false;\n}\n\nObject.defineProperties(Cesium3DTileContent.prototype, {\n /**\n * Gets the number of features in the tile.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n featuresLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the number of points in the tile.\n * <p>\n * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which\n * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud#batched-points}\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n pointsLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the number of triangles in the tile.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n trianglesLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the tile's geometry memory in bytes.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n geometryByteLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the tile's texture memory in bytes.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n texturesByteLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the amount of memory used by the batch table textures and any binary\n * metadata properties not accounted for in geometryByteLength or\n * texturesByteLength\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Number}\n * @readonly\n */\n batchTableByteLength: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile.\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Composite|Composite specification}\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Array}\n * @readonly\n */\n innerContents: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the promise that will be resolved when the tile's content is ready to render.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Promise.<Cesium3DTileContent>}\n * @readonly\n */\n readyPromise: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the tileset for this tile.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Cesium3DTileset}\n * @readonly\n */\n tileset: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the tile containing this content.\n *\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {Cesium3DTile}\n * @readonly\n */\n tile: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the url of the tile's content.\n * @memberof Cesium3DTileContent.prototype\n *\n * @type {String}\n * @readonly\n */\n url: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the batch table for this content.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @type {Cesium3DTileBatchTable}\n * @readonly\n *\n * @private\n */\n batchTable: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the metadata for this content, whether it is available explicitly or via\n * implicit tiling. If there is no metadata, this property should be undefined.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @type {ImplicitMetadataView|undefined}\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n metadata: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n set: function (value) {\n DeveloperError.throwInstantiationError();\n },\n },\n\n /**\n * Gets the group for this content if the content has metadata (3D Tiles 1.1) or\n * if it uses the <code>3DTILES_metadata</code> extension. If neither are present,\n * this property should be undefined.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @type {Cesium3DTileContentGroup|undefined}\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n group: {\n // eslint-disable-next-line getter-return\n get: function () {\n DeveloperError.throwInstantiationError();\n },\n set: function (value) {\n DeveloperError.throwInstantiationError();\n },\n },\n});\n\n/**\n * Returns whether the feature has this property.\n *\n * @param {Number} batchId The batchId for the feature.\n * @param {String} name The case-sensitive name of the property.\n * @returns {Boolean} <code>true</code> if the feature has this property; otherwise, <code>false</code>.\n */\nCesium3DTileContent.prototype.hasProperty = function (batchId, name) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns the {@link Cesium3DTileFeature} object for the feature with the\n * given <code>batchId</code>. This object is used to get and modify the\n * feature's properties.\n * <p>\n * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.\n * </p>\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/BatchTable}.\n *\n * @param {Number} batchId The batchId for the feature.\n * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.\n *\n * @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength} - 1.\n */\nCesium3DTileContent.prototype.getFeature = function (batchId) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Called when {@link Cesium3DTileset#debugColorizeTiles} changes.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @param {Boolean} enabled Whether to enable or disable debug settings.\n * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.\n\n * @private\n */\nCesium3DTileContent.prototype.applyDebugSettings = function (enabled, color) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Apply a style to the content\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @param {Cesium3DTileStyle} style The style.\n *\n * @private\n */\nCesium3DTileContent.prototype.applyStyle = function (style) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Called by the tile during tileset traversal to get the draw commands needed to render this content.\n * When the tile's content is in the PROCESSING state, this creates WebGL resources to ultimately\n * move to the READY state.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @param {Cesium3DTileset} tileset The tileset containing this tile.\n * @param {FrameState} frameState The frame state.\n *\n * @private\n */\nCesium3DTileContent.prototype.update = function (tileset, frameState) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Cesium3DTileContent#destroy\n *\n * @private\n */\nCesium3DTileContent.prototype.isDestroyed = function () {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * <p>\n * This is used to implement the <code>Cesium3DTileContent</code> interface, but is\n * not part of the public Cesium API.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * content = content && content.destroy();\n *\n * @see Cesium3DTileContent#isDestroyed\n *\n * @private\n */\nCesium3DTileContent.prototype.destroy = function () {\n DeveloperError.throwInstantiationError();\n};\nexport default Cesium3DTileContent;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * The state for a 3D Tiles update pass.\n *\n * @private\n * @constructor\n */\nfunction Cesium3DTilePassState(options) {\n /**\n * The pass.\n *\n * @type {Cesium3DTilePass}\n */\n this.pass = options.pass;\n\n /**\n * An array of rendering commands to use instead of {@link FrameState.commandList} for the current pass.\n *\n * @type {DrawCommand[]}\n */\n this.commandList = options.commandList;\n\n /**\n * A camera to use instead of {@link FrameState.camera} for the current pass.\n *\n * @type {Camera}\n */\n this.camera = options.camera;\n\n /**\n * A culling volume to use instead of {@link FrameState.cullingVolume} for the current pass.\n *\n * @type {CullingVolume}\n */\n this.cullingVolume = options.cullingVolume;\n\n /**\n * A read-only property that indicates whether the pass is ready, i.e. all tiles needed by the pass are loaded.\n *\n * @type {Boolean}\n * @readonly\n * @default false\n */\n this.ready = false;\n}\nexport default Cesium3DTilePassState;\n", "import clone from \"../Core/clone.js\";\nimport defined from \"../Core/defined.js\";\nimport Expression from \"./Expression.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates a conditions expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * Implements the {@link StyleExpression} interface.\n * </p>\n *\n * @alias ConditionsExpression\n * @constructor\n *\n * @param {Object} [conditionsExpression] The conditions expression defined using the 3D Tiles Styling language.\n * @param {Object} [defines] Defines in the style.\n *\n * @example\n * const expression = new Cesium.ConditionsExpression({\n * conditions : [\n * ['${Area} > 10, 'color(\"#FF0000\")'],\n * ['${id} !== \"1\"', 'color(\"#00FF00\")'],\n * ['true', 'color(\"#FFFFFF\")']\n * ]\n * });\n * expression.evaluateColor(feature, result); // returns a Cesium.Color object\n */\nfunction ConditionsExpression(conditionsExpression, defines) {\n this._conditionsExpression = clone(conditionsExpression, true);\n this._conditions = conditionsExpression.conditions;\n this._runtimeConditions = undefined;\n\n setRuntime(this, defines);\n}\n\nObject.defineProperties(ConditionsExpression.prototype, {\n /**\n * Gets the conditions expression defined in the 3D Tiles Styling language.\n *\n * @memberof ConditionsExpression.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @default undefined\n */\n conditionsExpression: {\n get: function () {\n return this._conditionsExpression;\n },\n },\n});\n\nfunction Statement(condition, expression) {\n this.condition = condition;\n this.expression = expression;\n}\n\nfunction setRuntime(expression, defines) {\n const runtimeConditions = [];\n const conditions = expression._conditions;\n if (!defined(conditions)) {\n return;\n }\n const length = conditions.length;\n for (let i = 0; i < length; ++i) {\n const statement = conditions[i];\n const cond = String(statement[0]);\n const condExpression = String(statement[1]);\n runtimeConditions.push(\n new Statement(\n new Expression(cond, defines),\n new Expression(condExpression, defines)\n )\n );\n }\n expression._runtimeConditions = runtimeConditions;\n}\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Object} [result] The object onto which to store the result.\n * @returns {Boolean|Number|String|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nConditionsExpression.prototype.evaluate = function (feature, result) {\n const conditions = this._runtimeConditions;\n if (!defined(conditions)) {\n return undefined;\n }\n const length = conditions.length;\n for (let i = 0; i < length; ++i) {\n const statement = conditions[i];\n if (statement.condition.evaluate(feature)) {\n return statement.expression.evaluate(feature, result);\n }\n }\n};\n\n/**\n * Evaluates the result of a Color expression, using the values defined by a feature.\n * <p>\n * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.\n * </p>\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nConditionsExpression.prototype.evaluateColor = function (feature, result) {\n const conditions = this._runtimeConditions;\n if (!defined(conditions)) {\n return undefined;\n }\n const length = conditions.length;\n for (let i = 0; i < length; ++i) {\n const statement = conditions[i];\n if (statement.condition.evaluate(feature)) {\n return statement.expression.evaluateColor(feature, result);\n }\n }\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {String} returnType The return type of the generated function.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nConditionsExpression.prototype.getShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n returnType\n) {\n const conditions = this._runtimeConditions;\n if (!defined(conditions) || conditions.length === 0) {\n return undefined;\n }\n\n let shaderFunction = \"\";\n const length = conditions.length;\n for (let i = 0; i < length; ++i) {\n const statement = conditions[i];\n\n const condition = statement.condition.getShaderExpression(\n variableSubstitutionMap,\n shaderState\n );\n const expression = statement.expression.getShaderExpression(\n variableSubstitutionMap,\n shaderState\n );\n\n // Build the if/else chain from the list of conditions\n shaderFunction +=\n ` ${i === 0 ? \"if\" : \"else if\"} (${condition})\\n` +\n ` {\\n` +\n ` return ${expression};\\n` +\n ` }\\n`;\n }\n\n shaderFunction =\n `${returnType} ${functionSignature}\\n` +\n `{\\n${shaderFunction} return ${returnType}(1.0);\\n` + // Return a default value if no conditions are met\n `}\\n`;\n\n return shaderFunction;\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {String[]} The variables used by the expression.\n *\n * @private\n */\nConditionsExpression.prototype.getVariables = function () {\n let variables = [];\n\n const conditions = this._runtimeConditions;\n if (!defined(conditions) || conditions.length === 0) {\n return variables;\n }\n\n const length = conditions.length;\n for (let i = 0; i < length; ++i) {\n const statement = conditions[i];\n variables.push.apply(variables, statement.condition.getVariables());\n variables.push.apply(variables, statement.expression.getVariables());\n }\n\n // Remove duplicates\n variables = variables.filter(function (variable, index, variables) {\n return variables.indexOf(variable) === index;\n });\n\n return variables;\n};\n\nexport default ConditionsExpression;\n", "import clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ConditionsExpression from \"./ConditionsExpression.js\";\nimport Expression from \"./Expression.js\";\n\n/**\n * A style that is applied to a {@link Cesium3DTileset}.\n * <p>\n * Evaluates an expression defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n *\n * @alias Cesium3DTileStyle\n * @constructor\n *\n * @param {Object} [style] An object defining a style.\n *\n * @example\n * tileset.style = new Cesium.Cesium3DTileStyle({\n * color : {\n * conditions : [\n * ['${Height} >= 100', 'color(\"purple\", 0.5)'],\n * ['${Height} >= 50', 'color(\"red\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * },\n * show : '${Height} > 0',\n * meta : {\n * description : '\"Building id ${id} has height ${Height}.\"'\n * }\n * });\n *\n * @example\n * tileset.style = new Cesium.Cesium3DTileStyle({\n * color : 'vec4(${Temperature})',\n * pointSize : '${Temperature} * 2.0'\n * });\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n */\nfunction Cesium3DTileStyle(style) {\n this._style = {};\n this._ready = false;\n\n this._show = undefined;\n this._color = undefined;\n this._pointSize = undefined;\n this._pointOutlineColor = undefined;\n this._pointOutlineWidth = undefined;\n this._labelColor = undefined;\n this._labelOutlineColor = undefined;\n this._labelOutlineWidth = undefined;\n this._font = undefined;\n this._labelStyle = undefined;\n this._labelText = undefined;\n this._backgroundColor = undefined;\n this._backgroundPadding = undefined;\n this._backgroundEnabled = undefined;\n this._scaleByDistance = undefined;\n this._translucencyByDistance = undefined;\n this._distanceDisplayCondition = undefined;\n this._heightOffset = undefined;\n this._anchorLineEnabled = undefined;\n this._anchorLineColor = undefined;\n this._image = undefined;\n this._disableDepthTestDistance = undefined;\n this._horizontalOrigin = undefined;\n this._verticalOrigin = undefined;\n this._labelHorizontalOrigin = undefined;\n this._labelVerticalOrigin = undefined;\n this._meta = undefined;\n\n this._colorShaderFunction = undefined;\n this._showShaderFunction = undefined;\n this._pointSizeShaderFunction = undefined;\n this._colorShaderFunctionReady = false;\n this._showShaderFunctionReady = false;\n this._pointSizeShaderFunctionReady = false;\n\n this._colorShaderTranslucent = false;\n\n setup(this, style);\n}\n\nfunction setup(that, styleJson) {\n styleJson = defaultValue(clone(styleJson, true), that._style);\n that._style = styleJson;\n\n that.show = styleJson.show;\n that.color = styleJson.color;\n that.pointSize = styleJson.pointSize;\n that.pointOutlineColor = styleJson.pointOutlineColor;\n that.pointOutlineWidth = styleJson.pointOutlineWidth;\n that.labelColor = styleJson.labelColor;\n that.labelOutlineColor = styleJson.labelOutlineColor;\n that.labelOutlineWidth = styleJson.labelOutlineWidth;\n that.labelStyle = styleJson.labelStyle;\n that.font = styleJson.font;\n that.labelText = styleJson.labelText;\n that.backgroundColor = styleJson.backgroundColor;\n that.backgroundPadding = styleJson.backgroundPadding;\n that.backgroundEnabled = styleJson.backgroundEnabled;\n that.scaleByDistance = styleJson.scaleByDistance;\n that.translucencyByDistance = styleJson.translucencyByDistance;\n that.distanceDisplayCondition = styleJson.distanceDisplayCondition;\n that.heightOffset = styleJson.heightOffset;\n that.anchorLineEnabled = styleJson.anchorLineEnabled;\n that.anchorLineColor = styleJson.anchorLineColor;\n that.image = styleJson.image;\n that.disableDepthTestDistance = styleJson.disableDepthTestDistance;\n that.horizontalOrigin = styleJson.horizontalOrigin;\n that.verticalOrigin = styleJson.verticalOrigin;\n that.labelHorizontalOrigin = styleJson.labelHorizontalOrigin;\n that.labelVerticalOrigin = styleJson.labelVerticalOrigin;\n\n const meta = {};\n if (defined(styleJson.meta)) {\n const defines = styleJson.defines;\n const metaJson = defaultValue(styleJson.meta, defaultValue.EMPTY_OBJECT);\n for (const property in metaJson) {\n if (metaJson.hasOwnProperty(property)) {\n meta[property] = new Expression(metaJson[property], defines);\n }\n }\n }\n\n that._meta = meta;\n\n that._ready = true;\n}\n\nfunction getExpression(tileStyle, value) {\n const defines = defaultValue(tileStyle._style, defaultValue.EMPTY_OBJECT)\n .defines;\n\n if (!defined(value)) {\n return undefined;\n } else if (typeof value === \"boolean\" || typeof value === \"number\") {\n return new Expression(String(value));\n } else if (typeof value === \"string\") {\n return new Expression(value, defines);\n } else if (defined(value.conditions)) {\n return new ConditionsExpression(value, defines);\n }\n return value;\n}\n\nfunction getJsonFromExpression(expression) {\n if (!defined(expression)) {\n return undefined;\n } else if (defined(expression.expression)) {\n return expression.expression;\n } else if (defined(expression.conditionsExpression)) {\n return clone(expression.conditionsExpression, true);\n }\n return expression;\n}\n\nObject.defineProperties(Cesium3DTileStyle.prototype, {\n /**\n * Gets the object defining the style using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @default {}\n */\n style: {\n get: function () {\n return this._style;\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>show</code> property. Alternatively a boolean, string, or object defining a show style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return or convert to a <code>Boolean</code>.\n * </p>\n * <p>\n * This expression is applicable to all tile formats.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * show : '(regExp(\"^Chest\").test(${County})) && (${YearBuilt} >= 1970)'\n * });\n * style.show.evaluate(feature); // returns true or false depending on the feature's properties\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override show expression with a custom function\n * style.show = {\n * evaluate : function(feature) {\n * return true;\n * }\n * };\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override show expression with a boolean\n * style.show = true;\n * };\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override show expression with a string\n * style.show = '${Height} > 0';\n * };\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override show expression with a condition\n * style.show = {\n * conditions: [\n * ['${height} > 2', 'false'],\n * ['true', 'true']\n * ];\n * };\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n this._show = getExpression(this, value);\n this._style.show = getJsonFromExpression(this._show);\n this._showShaderFunctionReady = false;\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>color</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is applicable to all tile formats.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * color : '(${Temperature} > 90) ? color(\"red\") : color(\"white\")'\n * });\n * style.color.evaluateColor(feature, result); // returns a Cesium.Color object\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override color expression with a custom function\n * style.color = {\n * evaluateColor : function(feature, result) {\n * return Cesium.Color.clone(Cesium.Color.WHITE, result);\n * }\n * };\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override color expression with a string\n * style.color = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override color expression with a condition\n * style.color = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n this._color = getExpression(this, value);\n this._style.color = getJsonFromExpression(this._color);\n this._colorShaderFunctionReady = false;\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointSize</code> property. Alternatively a string or object defining a point size style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Number</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'\n * });\n * style.pointSize.evaluate(feature); // returns a Number\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointSize expression with a custom function\n * style.pointSize = {\n * evaluate : function(feature) {\n * return 1.0;\n * }\n * };\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointSize expression with a number\n * style.pointSize = 1.0;\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointSize expression with a string\n * style.pointSize = '${height} / 10';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointSize expression with a condition\n * style.pointSize = {\n * conditions : [\n * ['${height} > 2', '1.0'],\n * ['true', '2.0']\n * ]\n * };\n */\n pointSize: {\n get: function () {\n return this._pointSize;\n },\n set: function (value) {\n this._pointSize = getExpression(this, value);\n this._style.pointSize = getJsonFromExpression(this._pointSize);\n this._pointSizeShaderFunctionReady = false;\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineColor</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointOutlineColor expression with a string\n * style.pointOutlineColor = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointOutlineColor expression with a condition\n * style.pointOutlineColor = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n pointOutlineColor: {\n get: function () {\n return this._pointOutlineColor;\n },\n set: function (value) {\n this._pointOutlineColor = getExpression(this, value);\n this._style.pointOutlineColor = getJsonFromExpression(\n this._pointOutlineColor\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Number</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointOutlineWidth expression with a string\n * style.pointOutlineWidth = '5';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override pointOutlineWidth expression with a condition\n * style.pointOutlineWidth = {\n * conditions : [\n * ['${height} > 2', '5'],\n * ['true', '0']\n * ]\n * };\n */\n pointOutlineWidth: {\n get: function () {\n return this._pointOutlineWidth;\n },\n set: function (value) {\n this._pointOutlineWidth = getExpression(this, value);\n this._style.pointOutlineWidth = getJsonFromExpression(\n this._pointOutlineWidth\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelColor</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelColor expression with a string\n * style.labelColor = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelColor expression with a condition\n * style.labelColor = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n labelColor: {\n get: function () {\n return this._labelColor;\n },\n set: function (value) {\n this._labelColor = getExpression(this, value);\n this._style.labelColor = getJsonFromExpression(this._labelColor);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineColor</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelOutlineColor expression with a string\n * style.labelOutlineColor = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelOutlineColor expression with a condition\n * style.labelOutlineColor = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n labelOutlineColor: {\n get: function () {\n return this._labelOutlineColor;\n },\n set: function (value) {\n this._labelOutlineColor = getExpression(this, value);\n this._style.labelOutlineColor = getJsonFromExpression(\n this._labelOutlineColor\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Number</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelOutlineWidth expression with a string\n * style.labelOutlineWidth = '5';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelOutlineWidth expression with a condition\n * style.labelOutlineWidth = {\n * conditions : [\n * ['${height} > 2', '5'],\n * ['true', '0']\n * ]\n * };\n */\n labelOutlineWidth: {\n get: function () {\n return this._labelOutlineWidth;\n },\n set: function (value) {\n this._labelOutlineWidth = getExpression(this, value);\n this._style.labelOutlineWidth = getJsonFromExpression(\n this._labelOutlineWidth\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>font</code> property. Alternatively a string or object defining a string style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>String</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * font : '(${Temperature} > 90) ? \"30px Helvetica\" : \"24px Helvetica\"'\n * });\n * style.font.evaluate(feature); // returns a String\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override font expression with a custom function\n * style.font = {\n * evaluate : function(feature) {\n * return '24px Helvetica';\n * }\n * };\n */\n font: {\n get: function () {\n return this._font;\n },\n set: function (value) {\n this._font = getExpression(this, value);\n this._style.font = getJsonFromExpression(this._font);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>label style</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>LabelStyle</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * labelStyle : `(\\${Temperature} > 90) ? ${LabelStyle.FILL_AND_OUTLINE} : ${LabelStyle.FILL}`\n * });\n * style.labelStyle.evaluate(feature); // returns a LabelStyle\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelStyle expression with a custom function\n * style.labelStyle = {\n * evaluate : function(feature) {\n * return LabelStyle.FILL;\n * }\n * };\n */\n labelStyle: {\n get: function () {\n return this._labelStyle;\n },\n set: function (value) {\n this._labelStyle = getExpression(this, value);\n this._style.labelStyle = getJsonFromExpression(this._labelStyle);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelText</code> property. Alternatively a string or object defining a string style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>String</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * labelText : '(${Temperature} > 90) ? \">90\" : \"<=90\"'\n * });\n * style.labelText.evaluate(feature); // returns a String\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelText expression with a custom function\n * style.labelText = {\n * evaluate : function(feature) {\n * return 'Example label text';\n * }\n * };\n */\n labelText: {\n get: function () {\n return this._labelText;\n },\n set: function (value) {\n this._labelText = getExpression(this, value);\n this._style.labelText = getJsonFromExpression(this._labelText);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundColor</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override backgroundColor expression with a string\n * style.backgroundColor = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override backgroundColor expression with a condition\n * style.backgroundColor = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n backgroundColor: {\n get: function () {\n return this._backgroundColor;\n },\n set: function (value) {\n this._backgroundColor = getExpression(this, value);\n this._style.backgroundColor = getJsonFromExpression(\n this._backgroundColor\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundPadding</code> property. Alternatively a string or object defining a vec2 style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Cartesian2</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override backgroundPadding expression with a string\n * style.backgroundPadding = 'vec2(5.0, 7.0)';\n * style.backgroundPadding.evaluate(feature); // returns a Cartesian2\n */\n backgroundPadding: {\n get: function () {\n return this._backgroundPadding;\n },\n set: function (value) {\n this._backgroundPadding = getExpression(this, value);\n this._style.backgroundPadding = getJsonFromExpression(\n this._backgroundPadding\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundEnabled</code> property. Alternatively a string or object defining a boolean style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Boolean</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override backgroundEnabled expression with a string\n * style.backgroundEnabled = 'true';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override backgroundEnabled expression with a condition\n * style.backgroundEnabled = {\n * conditions : [\n * ['${height} > 2', 'true'],\n * ['true', 'false']\n * ]\n * };\n */\n backgroundEnabled: {\n get: function () {\n return this._backgroundEnabled;\n },\n set: function (value) {\n this._backgroundEnabled = getExpression(this, value);\n this._style.backgroundEnabled = getJsonFromExpression(\n this._backgroundEnabled\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>scaleByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Cartesian4</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override scaleByDistance expression with a string\n * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';\n * style.scaleByDistance.evaluate(feature); // returns a Cartesian4\n */\n scaleByDistance: {\n get: function () {\n return this._scaleByDistance;\n },\n set: function (value) {\n this._scaleByDistance = getExpression(this, value);\n this._style.scaleByDistance = getJsonFromExpression(\n this._scaleByDistance\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>translucencyByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Cartesian4</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override translucencyByDistance expression with a string\n * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';\n * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4\n */\n translucencyByDistance: {\n get: function () {\n return this._translucencyByDistance;\n },\n set: function (value) {\n this._translucencyByDistance = getExpression(this, value);\n this._style.translucencyByDistance = getJsonFromExpression(\n this._translucencyByDistance\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>distanceDisplayCondition</code> property. Alternatively a string or object defining a vec2 style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Cartesian2</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override distanceDisplayCondition expression with a string\n * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';\n * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2\n */\n distanceDisplayCondition: {\n get: function () {\n return this._distanceDisplayCondition;\n },\n set: function (value) {\n this._distanceDisplayCondition = getExpression(this, value);\n this._style.distanceDisplayCondition = getJsonFromExpression(\n this._distanceDisplayCondition\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>heightOffset</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Number</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override heightOffset expression with a string\n * style.heightOffset = '2.0';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override heightOffset expression with a condition\n * style.heightOffset = {\n * conditions : [\n * ['${height} > 2', '4.0'],\n * ['true', '2.0']\n * ]\n * };\n */\n heightOffset: {\n get: function () {\n return this._heightOffset;\n },\n set: function (value) {\n this._heightOffset = getExpression(this, value);\n this._style.heightOffset = getJsonFromExpression(this._heightOffset);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineEnabled</code> property. Alternatively a string or object defining a boolean style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Boolean</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override anchorLineEnabled expression with a string\n * style.anchorLineEnabled = 'true';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override anchorLineEnabled expression with a condition\n * style.anchorLineEnabled = {\n * conditions : [\n * ['${height} > 2', 'true'],\n * ['true', 'false']\n * ]\n * };\n */\n anchorLineEnabled: {\n get: function () {\n return this._anchorLineEnabled;\n },\n set: function (value) {\n this._anchorLineEnabled = getExpression(this, value);\n this._style.anchorLineEnabled = getJsonFromExpression(\n this._anchorLineEnabled\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineColor</code> property. Alternatively a string or object defining a color style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Color</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override anchorLineColor expression with a string\n * style.anchorLineColor = 'color(\"blue\")';\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override anchorLineColor expression with a condition\n * style.anchorLineColor = {\n * conditions : [\n * ['${height} > 2', 'color(\"cyan\")'],\n * ['true', 'color(\"blue\")']\n * ]\n * };\n */\n anchorLineColor: {\n get: function () {\n return this._anchorLineColor;\n },\n set: function (value) {\n this._anchorLineColor = getExpression(this, value);\n this._style.anchorLineColor = getJsonFromExpression(\n this._anchorLineColor\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>image</code> property. Alternatively a string or object defining a string style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>String</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * image : '(${Temperature} > 90) ? \"/url/to/image1\" : \"/url/to/image2\"'\n * });\n * style.image.evaluate(feature); // returns a String\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override image expression with a custom function\n * style.image = {\n * evaluate : function(feature) {\n * return '/url/to/image';\n * }\n * };\n */\n image: {\n get: function () {\n return this._image;\n },\n set: function (value) {\n this._image = getExpression(this, value);\n this._style.image = getJsonFromExpression(this._image);\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>disableDepthTestDistance</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>Number</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override disableDepthTestDistance expression with a string\n * style.disableDepthTestDistance = '1000.0';\n * style.disableDepthTestDistance.evaluate(feature); // returns a Number\n */\n disableDepthTestDistance: {\n get: function () {\n return this._disableDepthTestDistance;\n },\n set: function (value) {\n this._disableDepthTestDistance = getExpression(this, value);\n this._style.disableDepthTestDistance = getJsonFromExpression(\n this._disableDepthTestDistance\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>horizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>HorizontalOrigin</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * horizontalOrigin : HorizontalOrigin.LEFT\n * });\n * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override horizontalOrigin expression with a custom function\n * style.horizontalOrigin = {\n * evaluate : function(feature) {\n * return HorizontalOrigin.CENTER;\n * }\n * };\n */\n horizontalOrigin: {\n get: function () {\n return this._horizontalOrigin;\n },\n set: function (value) {\n this._horizontalOrigin = getExpression(this, value);\n this._style.horizontalOrigin = getJsonFromExpression(\n this._horizontalOrigin\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>verticalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>VerticalOrigin</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * verticalOrigin : VerticalOrigin.TOP\n * });\n * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override verticalOrigin expression with a custom function\n * style.verticalOrigin = {\n * evaluate : function(feature) {\n * return VerticalOrigin.CENTER;\n * }\n * };\n */\n verticalOrigin: {\n get: function () {\n return this._verticalOrigin;\n },\n set: function (value) {\n this._verticalOrigin = getExpression(this, value);\n this._style.verticalOrigin = getJsonFromExpression(this._verticalOrigin);\n },\n },\n\n /**\n Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelHorizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>HorizontalOrigin</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * labelHorizontalOrigin : HorizontalOrigin.LEFT\n * });\n * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelHorizontalOrigin expression with a custom function\n * style.labelHorizontalOrigin = {\n * evaluate : function(feature) {\n * return HorizontalOrigin.CENTER;\n * }\n * };\n */\n labelHorizontalOrigin: {\n get: function () {\n return this._labelHorizontalOrigin;\n },\n set: function (value) {\n this._labelHorizontalOrigin = getExpression(this, value);\n this._style.labelHorizontalOrigin = getJsonFromExpression(\n this._labelHorizontalOrigin\n );\n },\n },\n\n /**\n * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelVerticalOrigin</code> property. Alternatively a string or object defining a number style can be used.\n * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.\n * <p>\n * The expression must return a <code>VerticalOrigin</code>.\n * </p>\n * <p>\n * This expression is only applicable to point features in a Vector tile.\n * </p>\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * labelVerticalOrigin : VerticalOrigin.TOP\n * });\n * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin\n *\n * @example\n * const style = new Cesium.Cesium3DTileStyle();\n * // Override labelVerticalOrigin expression with a custom function\n * style.labelVerticalOrigin = {\n * evaluate : function(feature) {\n * return VerticalOrigin.CENTER;\n * }\n * };\n */\n labelVerticalOrigin: {\n get: function () {\n return this._labelVerticalOrigin;\n },\n set: function (value) {\n this._labelVerticalOrigin = getExpression(this, value);\n this._style.labelVerticalOrigin = getJsonFromExpression(\n this._labelVerticalOrigin\n );\n },\n },\n\n /**\n * Gets or sets the object containing application-specific expression that can be explicitly\n * evaluated, e.g., for display in a UI.\n *\n * @memberof Cesium3DTileStyle.prototype\n *\n * @type {StyleExpression}\n *\n * @example\n * const style = new Cesium3DTileStyle({\n * meta : {\n * description : '\"Building id ${id} has height ${Height}.\"'\n * }\n * });\n * style.meta.description.evaluate(feature); // returns a String with the substituted variables\n */\n meta: {\n get: function () {\n return this._meta;\n },\n set: function (value) {\n this._meta = value;\n },\n },\n});\n\n/**\n * Asynchronously creates a Cesium3DTileStyle from a url.\n *\n * @param {Resource|String} url The url of the style to be loaded.\n *\n * @returns {Promise.<Cesium3DTileStyle>} A promise which resolves to the created style\n *\n * @private\n */\nCesium3DTileStyle.fromUrl = function (url) {\n const resource = Resource.createIfNeeded(url);\n return resource.fetchJson(url).then(function (styleJson) {\n return new Cesium3DTileStyle(styleJson);\n });\n};\n\n/**\n * Gets the color shader function for this style.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getColorShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState\n) {\n if (this._colorShaderFunctionReady) {\n shaderState.translucent = this._colorShaderTranslucent;\n // Return the cached result, may be undefined\n return this._colorShaderFunction;\n }\n\n this._colorShaderFunctionReady = true;\n if (defined(this.color) && defined(this.color.getShaderFunction)) {\n this._colorShaderFunction = this.color.getShaderFunction(\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n \"vec4\"\n );\n } else {\n this._colorShaderFunction = undefined;\n }\n\n this._colorShaderTranslucent = shaderState.translucent;\n return this._colorShaderFunction;\n};\n\n/**\n * Gets the show shader function for this style.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getShowShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState\n) {\n if (this._showShaderFunctionReady) {\n // Return the cached result, may be undefined\n return this._showShaderFunction;\n }\n\n this._showShaderFunctionReady = true;\n\n if (defined(this.show) && defined(this.show.getShaderFunction)) {\n this._showShaderFunction = this.show.getShaderFunction(\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n \"bool\"\n );\n } else {\n this._showShaderFunction = undefined;\n }\n return this._showShaderFunction;\n};\n\n/**\n * Gets the pointSize shader function for this style.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getPointSizeShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState\n) {\n if (this._pointSizeShaderFunctionReady) {\n // Return the cached result, may be undefined\n return this._pointSizeShaderFunction;\n }\n\n this._pointSizeShaderFunctionReady = true;\n if (defined(this.pointSize) && defined(this.pointSize.getShaderFunction)) {\n this._pointSizeShaderFunction = this.pointSize.getShaderFunction(\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n \"float\"\n );\n } else {\n this._pointSizeShaderFunction = undefined;\n }\n\n return this._pointSizeShaderFunction;\n};\n\n/**\n * Gets the variables used by the style.\n *\n * @returns {String[]} The variables used by the style.\n *\n * @private\n */\nCesium3DTileStyle.prototype.getVariables = function () {\n let variables = [];\n\n if (defined(this.color) && defined(this.color.getVariables)) {\n variables.push.apply(variables, this.color.getVariables());\n }\n\n if (defined(this.show) && defined(this.show.getVariables)) {\n variables.push.apply(variables, this.show.getVariables());\n }\n\n if (defined(this.pointSize) && defined(this.pointSize.getVariables)) {\n variables.push.apply(variables, this.pointSize.getVariables());\n }\n\n // Remove duplicates\n variables = variables.filter(function (variable, index, variables) {\n return variables.indexOf(variable) === index;\n });\n\n return variables;\n};\n\nexport default Cesium3DTileStyle;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A ParticleEmitter that emits particles from a circle.\n * Particles will be positioned within a circle and have initial velocities going along the z vector.\n *\n * @alias CircleEmitter\n * @constructor\n *\n * @param {Number} [radius=1.0] The radius of the circle in meters.\n */\nfunction CircleEmitter(radius) {\n radius = defaultValue(radius, 1.0);\n\n this._radius = defaultValue(radius, 1.0);\n}\n\nObject.defineProperties(CircleEmitter.prototype, {\n /**\n * The radius of the circle in meters.\n * @memberof CircleEmitter.prototype\n * @type {Number}\n * @default 1.0\n */\n radius: {\n get: function () {\n return this._radius;\n },\n set: function (value) {\nthis._radius = value;\n },\n },\n});\n\n/**\n * Initializes the given {@link Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize.\n */\nCircleEmitter.prototype.emit = function (particle) {\n const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n const rad = CesiumMath.randomBetween(0.0, this._radius);\n\n const x = rad * Math.cos(theta);\n const y = rad * Math.sin(theta);\n const z = 0.0;\n\n particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n particle.velocity = Cartesian3.clone(Cartesian3.UNIT_Z, particle.velocity);\n};\nexport default CircleEmitter;\n", "/**\n * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}.\n *\n * @enum {Number}\n */\n\nconst CloudType = {\n /**\n * Cumulus cloud.\n *\n * @type {Number}\n * @constant\n */\n CUMULUS: 0,\n};\n\n/**\n * Validates that the provided cloud type is a valid {@link CloudType}\n *\n * @param {CloudType} cloudType The cloud type to validate.\n * @returns {Boolean} <code>true</code> if the provided cloud type is a valid value; otherwise, <code>false</code>.\n *\n * @example\n * if (!Cesium.CloudType.validate(cloudType)) {\n * throw new Cesium.DeveloperError('cloudType must be a valid value.');\n * }\n */\n\nCloudType.validate = function (cloudType) {\n return cloudType === CloudType.CUMULUS;\n};\n\nexport default Object.freeze(CloudType);\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * <div class=\"notice\">\n * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.\n * and {@link CloudCollection#remove}. Do not call the constructor directly.\n * </div>\n * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />\n * Example cumulus clouds\n * </div>\n * @alias CumulusCloud\n *\n * @performance Similar to {@link Billboard}, reading a property, e.g., {@link CumulusCloud#show},\n * takes constant time. Assigning to a property is constant time but results in\n * CPU to GPU traffic when {@link CloudCollection#update} is called. The per-cloud traffic is\n * the same regardless of how many properties were updated. If most clouds in a collection need to be\n * updated, it may be more efficient to clear the collection with {@link CloudCollection#removeAll}\n * and add new clouds instead of modifying each one.\n *\n * @see CloudCollection\n * @see CloudCollection#add\n *\n * @internalConstructor\n * @class\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cloud%20Parameters.html|Cesium Sandcastle Cloud Parameters Demo}\n */\nfunction CumulusCloud(options, cloudCollection) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this._show = defaultValue(options.show, true);\n\n this._position = Cartesian3.clone(\n defaultValue(options.position, Cartesian3.ZERO)\n );\n\n if (!defined(options.scale) && defined(options.maximumSize)) {\n this._maximumSize = Cartesian3.clone(options.maximumSize);\n this._scale = new Cartesian2(this._maximumSize.x, this._maximumSize.y);\n } else {\n this._scale = Cartesian2.clone(\n defaultValue(options.scale, new Cartesian2(20.0, 12.0))\n );\n\n const defaultMaxSize = new Cartesian3(\n this._scale.x,\n this._scale.y,\n Math.min(this._scale.x, this._scale.y) / 1.5\n );\n this._maximumSize = Cartesian3.clone(\n defaultValue(options.maximumSize, defaultMaxSize)\n );\n }\n\n this._slice = defaultValue(options.slice, -1.0);\n this._color = Color.clone(defaultValue(options.color, Color.WHITE));\n this._brightness = defaultValue(options.brightness, 1.0);\n this._cloudCollection = cloudCollection;\n this._index = -1; // Used by CloudCollection\n}\n\nconst SHOW_INDEX = (CumulusCloud.SHOW_INDEX = 0);\nconst POSITION_INDEX = (CumulusCloud.POSITION_INDEX = 1);\nconst SCALE_INDEX = (CumulusCloud.SCALE_INDEX = 2);\nconst MAXIMUM_SIZE_INDEX = (CumulusCloud.MAXIMUM_SIZE_INDEX = 3);\nconst SLICE_INDEX = (CumulusCloud.SLICE_INDEX = 4);\nconst BRIGHTNESS_INDEX = (CumulusCloud.BRIGHTNESS_INDEX = 5);\nconst COLOR_INDEX = (CumulusCloud.COLOR_INDEX = 6);\nCumulusCloud.NUMBER_OF_PROPERTIES = 7;\n\nfunction makeDirty(cloud, propertyChanged) {\n const cloudCollection = cloud._cloudCollection;\n if (defined(cloudCollection)) {\n cloudCollection._updateCloud(cloud, propertyChanged);\n cloud._dirty = true;\n }\n}\n\nObject.defineProperties(CumulusCloud.prototype, {\n /**\n * Determines if this cumulus cloud will be shown. Use this to hide or show a cloud, instead\n * of removing it and re-adding it to the collection.\n * @memberof CumulusCloud.prototype\n * @type {Boolean}\n * @default true\n */\n show: {\n get: function () {\n return this._show;\n },\n set: function (value) {\n if (this._show !== value) {\n this._show = value;\n makeDirty(this, SHOW_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the Cartesian position of this cumulus cloud.\n * @memberof CumulusCloud.prototype\n * @type {Cartesian3}\n */\n position: {\n get: function () {\n return this._position;\n },\n set: function (value) {\n const position = this._position;\n if (!Cartesian3.equals(position, value)) {\n Cartesian3.clone(value, position);\n makeDirty(this, POSITION_INDEX);\n }\n },\n },\n\n /**\n * <p>Gets or sets the scale of the cumulus cloud billboard in meters.\n * The <code>scale</code> property will affect the size of the billboard,\n * but not the cloud's actual appearance.</p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'>\n * <code>cloud.scale = new Cesium.Cartesian2(12, 8);</code><br/>\n * <img src='Images/CumulusCloud.scalex12y8.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>cloud.scale = new Cesium.Cartesian2(24, 10);</code><br/>\n * <img src='Images/CumulusCloud.scalex24y10.png' width='250' height='158' />\n * </td>\n * </tr></table>\n * </div>\n *\n * <p>To modify the cloud's appearance, modify its <code>maximumSize</code>\n * and <code>slice</code> properties.</p>\n * @memberof CumulusCloud.prototype\n * @type {Cartesian2}\n *\n * @see CumulusCloud#maximumSize\n * @see CumulusCloud#slice\n */\n scale: {\n get: function () {\n return this._scale;\n },\n set: function (value) {\n const scale = this._scale;\n if (!Cartesian2.equals(scale, value)) {\n Cartesian2.clone(value, scale);\n makeDirty(this, SCALE_INDEX);\n }\n },\n },\n\n /**\n * <p>Gets or sets the maximum size of the cumulus cloud rendered on the billboard.\n * This defines a maximum ellipsoid volume that the cloud can appear in.\n * Rather than guaranteeing a specific size, this specifies a boundary for the\n * cloud to appear in, and changing it can affect the shape of the cloud.</p>\n * <p>Changing the z-value of <code>maximumSize</code> has the most dramatic effect\n * on the cloud's appearance because it changes the depth of the cloud, and thus the\n * positions at which the cloud-shaping texture is sampled.</p>\n * <div align='center'>\n * <table border='0' cellpadding='5'>\n * <tr>\n * <td align='center'>\n * <code>cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);</code><br/>\n * <img src='Images/CumulusCloud.maximumSizex14y9z10.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>cloud.maximumSize.x = 25;</code><br/>\n * <img src='Images/CumulusCloud.maximumSizex25.png' width='250' height='158' />\n * </td>\n * </tr>\n * <tr>\n * <td align='center'>\n * <code>cloud.maximumSize.y = 5;</code><br/>\n * <img src='Images/CumulusCloud.maximumSizey5.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>cloud.maximumSize.z = 17;</code><br/>\n * <img src='Images/CumulusCloud.maximumSizez17.png' width='250' height='158' />\n * </td>\n * </tr>\n * </table>\n * </div>\n *\n * <p>To modify the billboard's actual size, modify the cloud's <code>scale</code> property.</p>\n * @memberof CumulusCloud.prototype\n * @type {Cartesian3}\n *\n * @see CumulusCloud#scale\n */\n maximumSize: {\n get: function () {\n return this._maximumSize;\n },\n set: function (value) {\n const maximumSize = this._maximumSize;\n if (!Cartesian3.equals(maximumSize, value)) {\n Cartesian3.clone(value, maximumSize);\n makeDirty(this, MAXIMUM_SIZE_INDEX);\n }\n },\n },\n /**\n * Sets the color of the cloud\n * @memberof CumulusCloud.prototype\n * @type {Color}\n * @default Color.WHITE\n */\n color: {\n get: function () {\n return this._color;\n },\n set: function (value) {\n const color = this._color;\n if (!Color.equals(color, value)) {\n Color.clone(value, color);\n makeDirty(this, COLOR_INDEX);\n }\n },\n },\n /**\n * <p>Gets or sets the \"slice\" of the cloud that is rendered on the billboard, i.e.\n * the specific cross-section of the cloud chosen for the billboard's appearance.\n * Given a value between 0 and 1, the slice specifies how deeply into the cloud\n * to intersect based on its maximum size in the z-direction.</p>\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>cloud.slice = 0.32;</code><br/><img src='Images/CumulusCloud.slice0.32.png' width='250' height='158' /></td>\n * <td align='center'><code>cloud.slice = 0.5;</code><br/><img src='Images/CumulusCloud.slice0.5.png' width='250' height='158' /></td>\n * <td align='center'><code>cloud.slice = 0.6;</code><br/><img src='Images/CumulusCloud.slice0.6.png' width='250' height='158' /></td>\n * </tr></table>\n * </div>\n *\n * <br />\n * <p>Due to the nature in which this slice is calculated,\n * values below <code>0.2</code> may result in cross-sections that are too small,\n * and the edge of the ellipsoid will be visible. Similarly, values above <code>0.7</code>\n * will cause the cloud to appear smaller. Values outside the range <code>[0.1, 0.9]</code>\n * should be avoided entirely because they do not produce desirable results.</p>\n *\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>cloud.slice = 0.08;</code><br/><img src='Images/CumulusCloud.slice0.08.png' width='250' height='158' /></td>\n * <td align='center'><code>cloud.slice = 0.8;</code><br/><img src='Images/CumulusCloud.slice0.8.png' width='250' height='158' /></td>\n * </tr></table>\n * </div>\n *\n * <p>If <code>slice</code> is set to a negative number, the cloud will not render a cross-section.\n * Instead, it will render the outside of the ellipsoid that is visible. For clouds with\n * small values of `maximumSize.z`, this can produce good-looking results, but for larger\n * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.</p>\n *\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'>\n * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 18;</code><br/>\n * <img src='Images/CumulusCloud.slice-1z18.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 30;</code><br/>\n * <img src='Images/CumulusCloud.slice-1z30.png' width='250' height='158' /></td>\n * </tr></table>\n * </div>\n *\n * @memberof CumulusCloud.prototype\n * @type {Number}\n * @default -1.0\n */\n slice: {\n get: function () {\n return this._slice;\n },\n set: function (value) {\n const slice = this._slice;\n if (slice !== value) {\n this._slice = value;\n makeDirty(this, SLICE_INDEX);\n }\n },\n },\n\n /**\n * Gets or sets the brightness of the cloud. This can be used to give clouds\n * a darker, grayer appearance.\n * <br /><br />\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'><code>cloud.brightness = 1.0;</code><br/><img src='Images/CumulusCloud.brightness1.png' width='250' height='158' /></td>\n * <td align='center'><code>cloud.brightness = 0.6;</code><br/><img src='Images/CumulusCloud.brightness0.6.png' width='250' height='158' /></td>\n * <td align='center'><code>cloud.brightness = 0.0;</code><br/><img src='Images/CumulusCloud.brightness0.png' width='250' height='158' /></td>\n * </tr></table>\n * </div>\n * @memberof CumulusCloud.prototype\n * @type {Number}\n * @default 1.0\n */\n brightness: {\n get: function () {\n return this._brightness;\n },\n set: function (value) {\n const brightness = this._brightness;\n if (brightness !== value) {\n this._brightness = value;\n makeDirty(this, BRIGHTNESS_INDEX);\n }\n },\n },\n});\n\nCumulusCloud.prototype._destroy = function () {\n this._cloudCollection = undefined;\n};\n\nexport default CumulusCloud;\n", "import BlendingState from \"./BlendingState.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport CloudType from \"./CloudType.js\";\nimport CloudCollectionFS from \"../Shaders/CloudCollectionFS.js\";\nimport CloudCollectionVS from \"../Shaders/CloudCollectionVS.js\";\nimport CloudNoiseFS from \"../Shaders/CloudNoiseFS.js\";\nimport CloudNoiseVS from \"../Shaders/CloudNoiseVS.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport CumulusCloud from \"./CumulusCloud.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport EncodedCartesian3 from \"../Core/EncodedCartesian3.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport VertexArrayFacade from \"../Renderer/VertexArrayFacade.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\n\nlet attributeLocations;\nconst scratchTextureDimensions = new Cartesian3();\n\nconst attributeLocationsBatched = {\n positionHighAndScaleX: 0,\n positionLowAndScaleY: 1,\n packedAttribute0: 2, // show, brightness, direction\n packedAttribute1: 3, // cloudSize, slice\n color: 4,\n};\n\nconst attributeLocationsInstanced = {\n direction: 0,\n positionHighAndScaleX: 1,\n positionLowAndScaleY: 2,\n packedAttribute0: 3, // show, brightness\n packedAttribute1: 4, // cloudSize, slice\n color: 5,\n};\n\nconst SHOW_INDEX = CumulusCloud.SHOW_INDEX;\nconst POSITION_INDEX = CumulusCloud.POSITION_INDEX;\nconst SCALE_INDEX = CumulusCloud.SCALE_INDEX;\nconst MAXIMUM_SIZE_INDEX = CumulusCloud.MAXIMUM_SIZE_INDEX;\nconst SLICE_INDEX = CumulusCloud.SLICE_INDEX;\nconst BRIGHTNESS_INDEX = CumulusCloud.BRIGHTNESS_INDEX;\nconst NUMBER_OF_PROPERTIES = CumulusCloud.NUMBER_OF_PROPERTIES;\nconst COLOR_INDEX = CumulusCloud.COLOR_INDEX;\n\n/**\n * A renderable collection of clouds in the 3D scene.\n * <br /><br />\n * <div align='center'>\n * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />\n * Example cumulus clouds\n * </div>\n * <br /><br />\n * Clouds are added and removed from the collection using {@link CloudCollection#add}\n * and {@link CloudCollection#remove}.\n * @alias CloudCollection\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.show=true] Whether to display the clouds.\n * @param {Number} [options.noiseDetail=16.0] Desired amount of detail in the noise texture.\n * @param {Number} [options.noiseOffset=Cartesian3.ZERO] Desired translation of data in noise texture.\n * @param {Boolean} [options.debugBillboards=false] For debugging only. Determines if the billboards are rendered with an opaque color.\n * @param {Boolean} [options.debugEllipsoids=false] For debugging only. Determines if the clouds will be rendered as opaque ellipsoids.\n * @see CloudCollection#add\n * @see CloudCollection#remove\n * @see CumulusCloud\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Clouds.html|Cesium Sandcastle Clouds Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cloud%20Parameters.html|Cesium Sandcastle Cloud Parameters Demo}\n *\n * @example\n * // Create a cloud collection with two cumulus clouds\n * const clouds = scene.primitives.add(new Cesium.CloudCollection());\n * clouds.add({\n * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),\n * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)\n * });\n * clouds.add({\n * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),\n * maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),\n * slice: 0.5\n * });\n *\n */\nfunction CloudCollection(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._clouds = [];\n this._cloudsToUpdate = [];\n this._cloudsToUpdateIndex = 0;\n this._cloudsRemoved = false;\n this._createVertexArray = false;\n\n this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);\n\n this._noiseTexture = undefined;\n this._textureSliceWidth = 128;\n this._noiseTextureRows = 4;\n\n /**\n * <p>\n * Controls the amount of detail captured in the precomputed noise texture\n * used to render the cumulus clouds. In order for the texture to be tileable,\n * this must be a power of two. For best results, set this to be a power of two\n * between <code>8.0</code> and <code>32.0</code> (inclusive).\n * </p>\n *\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'>\n * <code>clouds.noiseDetail = 8.0;</code><br/>\n * <img src='Images/CloudCollection.noiseDetail8.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>clouds.noiseDetail = 32.0;</code><br/>\n * <img src='Images/CloudCollection.noiseDetail32.png' width='250' height='158' />\n * </td>\n * </tr></table>\n * </div>\n *\n * @type {Number}\n *\n * @default 16.0\n */\n this.noiseDetail = defaultValue(options.noiseDetail, 16.0);\n\n /**\n * <p>\n * Applies a translation to noise texture coordinates to generate different data.\n * This can be modified if the default noise does not generate good-looking clouds.\n * </p>\n *\n * <div align='center'>\n * <table border='0' cellpadding='5'><tr>\n * <td align='center'>\n * <code>default</code><br/>\n * <img src='Images/CloudCollection.noiseOffsetdefault.png' width='250' height='158' />\n * </td>\n * <td align='center'>\n * <code>clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);</code><br/>\n * <img src='Images/CloudCollection.noiseOffsetx10y20z10.png' width='250' height='158' />\n * </td>\n * </tr></table>\n * </div>\n * @type {Cartesian3}\n *\n * @default Cartesian3.ZERO\n */\n this.noiseOffset = Cartesian3.clone(\n defaultValue(options.noiseOffset, Cartesian3.ZERO)\n );\n\n this._loading = false;\n this._ready = false;\n\n const that = this;\n this._uniforms = {\n u_noiseTexture: function () {\n return that._noiseTexture;\n },\n u_noiseTextureDimensions: getNoiseTextureDimensions(that),\n u_noiseDetail: function () {\n return that.noiseDetail;\n },\n };\n\n this._vaNoise = undefined;\n this._spNoise = undefined;\n\n this._spCreated = false;\n this._sp = undefined;\n this._rs = undefined;\n\n /**\n * Determines if billboards in this collection will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n this._colorCommands = [];\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Renders the billboards with one opaque color for the sake of debugging.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugBillboards = defaultValue(options.debugBillboards, false);\n this._compiledDebugBillboards = false;\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging.\n * If <code>debugBillboards</code> is also true, then the ellipsoids will draw on top of the billboards.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugEllipsoids = defaultValue(options.debugEllipsoids, false);\n this._compiledDebugEllipsoids = false;\n}\n\n// Wraps useful texture metrics into a single vec3 for less overhead.\nfunction getNoiseTextureDimensions(collection) {\n return function () {\n scratchTextureDimensions.x = collection._textureSliceWidth;\n scratchTextureDimensions.y = collection._noiseTextureRows;\n scratchTextureDimensions.z = 1.0 / collection._noiseTextureRows;\n return scratchTextureDimensions;\n };\n}\n\nObject.defineProperties(CloudCollection.prototype, {\n /**\n * Returns the number of clouds in this collection.\n * @memberof CloudCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n removeClouds(this);\n return this._clouds.length;\n },\n },\n});\n\nfunction destroyClouds(clouds) {\n const length = clouds.length;\n for (let i = 0; i < length; ++i) {\n if (clouds[i]) {\n clouds[i]._destroy();\n }\n }\n}\n\n/**\n * Creates and adds a cloud with the specified initial properties to the collection.\n * The added cloud is returned so it can be modified or removed from the collection later.\n *\n * @param {Object}[options] A template describing the cloud's properties as shown in Example 1.\n * @returns {CumulusCloud} The cloud that was added to the collection.\n *\n * @performance Calling <code>add</code> is expected constant time. However, the collection's vertex buffer\n * is rewritten - an <code>O(n)</code> operation that also incurs CPU to GPU overhead. For\n * best performance, add as many clouds as possible before calling <code>update</code>.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Example 1: Add a cumulus cloud, specifying all the default values.\n * const c = clouds.add({\n * show : true,\n * position : Cesium.Cartesian3.ZERO,\n * scale : new Cesium.Cartesian2(20.0, 12.0),\n * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),\n * slice: -1.0,\n * cloudType : CloudType.CUMULUS\n * });\n *\n * @example\n * // Example 2: Specify only the cloud's cartographic position.\n * const c = clouds.add({\n * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)\n * });\n *\n * @see CloudCollection#remove\n * @see CloudCollection#removeAll\n */\nCloudCollection.prototype.add = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const cloudType = defaultValue(options.cloudType, CloudType.CUMULUS);\n let cloud;\n if (cloudType === CloudType.CUMULUS) {\n cloud = new CumulusCloud(options, this);\n cloud._index = this._clouds.length;\n this._clouds.push(cloud);\n this._createVertexArray = true;\n }\n\n return cloud;\n};\n\n/**\n * Removes a cloud from the collection.\n *\n * @param {CumulusCloud} cloud The cloud to remove.\n * @returns {Boolean} <code>true</code> if the cloud was removed; <code>false</code> if the cloud was not found in the collection.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * const c = clouds.add(...);\n * clouds.remove(c); // Returns true\n *\n * @see CloudCollection#add\n * @see CloudCollection#removeAll\n * @see CumulusCloud#show\n */\nCloudCollection.prototype.remove = function (cloud) {\n if (this.contains(cloud)) {\n this._clouds[cloud._index] = undefined; // Removed later in removeClouds()\n this._cloudsRemoved = true;\n this._createVertexArray = true;\n cloud._destroy();\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all clouds from the collection.\n *\n * @performance <code>O(n)</code>. It is more efficient to remove all the clouds\n * from a collection and then add new ones than to create a new collection entirely.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * clouds.add(...);\n * clouds.add(...);\n * clouds.removeAll();\n *\n * @see CloudCollection#add\n * @see CloudCollection#remove\n */\nCloudCollection.prototype.removeAll = function () {\n destroyClouds(this._clouds);\n this._clouds = [];\n this._cloudsToUpdate = [];\n this._cloudsToUpdateIndex = 0;\n this._cloudsRemoved = false;\n\n this._createVertexArray = true;\n};\n\nfunction removeClouds(cloudCollection) {\n if (cloudCollection._cloudsRemoved) {\n cloudCollection._cloudsRemoved = false;\n\n const newClouds = [];\n const clouds = cloudCollection._clouds;\n const length = clouds.length;\n for (let i = 0, j = 0; i < length; ++i) {\n const cloud = clouds[i];\n if (defined(cloud)) {\n clouds._index = j++;\n newClouds.push(cloud);\n }\n }\n\n cloudCollection._clouds = newClouds;\n }\n}\n\nCloudCollection.prototype._updateCloud = function (cloud, propertyChanged) {\n if (!cloud._dirty) {\n this._cloudsToUpdate[this._cloudsToUpdateIndex++] = cloud;\n }\n\n ++this._propertiesChanged[propertyChanged];\n};\n\n/**\n * Check whether this collection contains a given cloud.\n *\n * @param {CumulusCloud} [cloud] The cloud to check for.\n * @returns {Boolean} true if this collection contains the cloud, false otherwise.\n *\n * @see CloudCollection#get\n */\nCloudCollection.prototype.contains = function (cloud) {\n return defined(cloud) && cloud._cloudCollection === this;\n};\n\n/**\n * Returns the cloud in the collection at the specified index. Indices are zero-based\n * and increase as clouds are added. Removing a cloud shifts all clouds after\n * it to the left, changing their indices. This function is commonly used with\n * {@link CloudCollection#length} to iterate over all the clouds in the collection.\n *\n * @param {Number} index The zero-based index of the cloud.\n * @returns {CumulusCloud} The cloud at the specified index.\n *\n * @performance Expected constant time. If clouds were removed from the collection and\n * {@link CloudCollection#update} was not called, an implicit <code>O(n)</code>\n * operation is performed.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * // Toggle the show property of every cloud in the collection\n * const len = clouds.length;\n * for (let i = 0; i < len; ++i) {\n * const c = clouds.get(i);\n * c.show = !c.show;\n * }\n *\n * @see CloudCollection#length\n */\nCloudCollection.prototype.get = function (index) {\n removeClouds(this);\n return this._clouds[index];\n};\n\nconst texturePositions = new Float32Array([\n -1.0,\n -1.0,\n 1.0,\n -1.0,\n 1.0,\n 1.0,\n -1.0,\n 1.0,\n]);\n\nconst textureIndices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n\nfunction createTextureVA(context) {\n const positionBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: texturePositions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: textureIndices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n const attributes = [\n {\n index: 0,\n vertexBuffer: positionBuffer,\n componentsPerAttribute: 2,\n componentDatatype: ComponentDatatype.FLOAT,\n },\n ];\n\n return new VertexArray({\n context: context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n });\n}\n\nlet getIndexBuffer;\n\nfunction getIndexBufferBatched(context) {\n const sixteenK = 16 * 1024;\n\n let indexBuffer = context.cache.cloudCollection_indexBufferBatched;\n if (defined(indexBuffer)) {\n return indexBuffer;\n }\n\n // Subtract 6 because the last index is reserved for primitive restart.\n // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.18\n const length = sixteenK * 6 - 6;\n const indices = new Uint16Array(length);\n for (let i = 0, j = 0; i < length; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n\n indices[i + 3] = j;\n indices[i + 4] = j + 2;\n indices[i + 5] = j + 3;\n }\n\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n indexBuffer.vertexArrayDestroyable = false;\n context.cache.cloudCollection_indexBufferBatched = indexBuffer;\n return indexBuffer;\n}\n\nfunction getIndexBufferInstanced(context) {\n let indexBuffer = context.cache.cloudCollection_indexBufferInstanced;\n if (defined(indexBuffer)) {\n return indexBuffer;\n }\n\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n indexBuffer.vertexArrayDestroyable = false;\n context.cache.cloudCollection_indexBufferInstanced = indexBuffer;\n return indexBuffer;\n}\n\nfunction getVertexBufferInstanced(context) {\n let vertexBuffer = context.cache.cloudCollection_vertexBufferInstanced;\n if (defined(vertexBuffer)) {\n return vertexBuffer;\n }\n\n vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: new Float32Array([0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]),\n usage: BufferUsage.STATIC_DRAW,\n });\n\n vertexBuffer.vertexArrayDestroyable = false;\n context.cache.cloudCollection_vertexBufferInstanced = vertexBuffer;\n return vertexBuffer;\n}\n\nfunction createVAF(context, numberOfClouds, instanced) {\n const attributes = [\n {\n index: attributeLocations.positionHighAndScaleX,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: BufferUsage.STATIC_DRAW,\n },\n {\n index: attributeLocations.positionLowAndScaleY,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: BufferUsage.STATIC_DRAW,\n },\n {\n index: attributeLocations.packedAttribute0,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: BufferUsage.STATIC_DRAW,\n },\n {\n index: attributeLocations.packedAttribute1,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.FLOAT,\n usage: BufferUsage.STATIC_DRAW,\n },\n {\n index: attributeLocations.color,\n componentsPerAttribute: 4,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n normalize: true,\n usage: BufferUsage.STATIC_DRAW,\n },\n ];\n\n if (instanced) {\n attributes.push({\n index: attributeLocations.direction,\n componentsPerAttribute: 2,\n componentDatatype: ComponentDatatype.FLOAT,\n vertexBuffer: getVertexBufferInstanced(context),\n });\n }\n\n const sizeInVertices = instanced ? numberOfClouds : 4 * numberOfClouds;\n return new VertexArrayFacade(context, attributes, sizeInVertices, instanced);\n}\n\nconst writePositionScratch = new EncodedCartesian3();\n\nfunction writePositionAndScale(cloudCollection, frameState, vafWriters, cloud) {\n let i;\n const positionHighWriter =\n vafWriters[attributeLocations.positionHighAndScaleX];\n const positionLowWriter = vafWriters[attributeLocations.positionLowAndScaleY];\n const position = cloud.position;\n\n EncodedCartesian3.fromCartesian(position, writePositionScratch);\n const scale = cloud.scale;\n\n const high = writePositionScratch.high;\n const low = writePositionScratch.low;\n\n if (cloudCollection._instanced) {\n i = cloud._index;\n positionHighWriter(i, high.x, high.y, high.z, scale.x);\n positionLowWriter(i, low.x, low.y, low.z, scale.y);\n } else {\n i = cloud._index * 4;\n positionHighWriter(i + 0, high.x, high.y, high.z, scale.x);\n positionHighWriter(i + 1, high.x, high.y, high.z, scale.x);\n positionHighWriter(i + 2, high.x, high.y, high.z, scale.x);\n positionHighWriter(i + 3, high.x, high.y, high.z, scale.x);\n\n positionLowWriter(i + 0, low.x, low.y, low.z, scale.y);\n positionLowWriter(i + 1, low.x, low.y, low.z, scale.y);\n positionLowWriter(i + 2, low.x, low.y, low.z, scale.y);\n positionLowWriter(i + 3, low.x, low.y, low.z, scale.y);\n }\n}\n\nfunction writePackedAttribute0(cloudCollection, frameState, vafWriters, cloud) {\n let i;\n const writer = vafWriters[attributeLocations.packedAttribute0];\n const show = cloud.show;\n const brightness = cloud.brightness;\n\n if (cloudCollection._instanced) {\n i = cloud._index;\n writer(i, show, brightness, 0.0, 0.0);\n } else {\n i = cloud._index * 4;\n writer(i + 0, show, brightness, 0.0, 0.0);\n writer(i + 1, show, brightness, 1.0, 0.0);\n writer(i + 2, show, brightness, 1.0, 1.0);\n writer(i + 3, show, brightness, 0.0, 1.0);\n }\n}\n\nfunction writePackedAttribute1(cloudCollection, frameState, vafWriters, cloud) {\n let i;\n const writer = vafWriters[attributeLocations.packedAttribute1];\n const maximumSize = cloud.maximumSize;\n const slice = cloud.slice;\n\n if (cloudCollection._instanced) {\n i = cloud._index;\n writer(i, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n } else {\n i = cloud._index * 4;\n writer(i + 0, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n writer(i + 1, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n writer(i + 2, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n writer(i + 3, maximumSize.x, maximumSize.y, maximumSize.z, slice);\n }\n}\n\nfunction writeColor(cloudCollection, frameState, vafWriters, cloud) {\n let i;\n const writer = vafWriters[attributeLocations.color];\n const color = cloud.color;\n const red = Color.floatToByte(color.red);\n const green = Color.floatToByte(color.green);\n const blue = Color.floatToByte(color.blue);\n const alpha = Color.floatToByte(color.alpha);\n\n if (cloudCollection._instanced) {\n i = cloud._index;\n writer(i, red, green, blue, alpha);\n } else {\n i = cloud._index * 4;\n writer(i + 0, red, green, blue, alpha);\n writer(i + 1, red, green, blue, alpha);\n writer(i + 2, red, green, blue, alpha);\n writer(i + 3, red, green, blue, alpha);\n }\n}\nfunction writeCloud(cloudCollection, frameState, vafWriters, cloud) {\n writePositionAndScale(cloudCollection, frameState, vafWriters, cloud);\n writePackedAttribute0(cloudCollection, frameState, vafWriters, cloud);\n writePackedAttribute1(cloudCollection, frameState, vafWriters, cloud);\n writeColor(cloudCollection, frameState, vafWriters, cloud);\n}\n\nfunction createNoiseTexture(cloudCollection, frameState, vsSource, fsSource) {\n const that = cloudCollection;\n\n const textureSliceWidth = that._textureSliceWidth;\n const noiseTextureRows = that._noiseTextureRows;\n const context = frameState.context;\n that._vaNoise = createTextureVA(context);\n that._spNoise = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vsSource,\n fragmentShaderSource: fsSource,\n attributeLocations: {\n position: 0,\n },\n });\n\n const noiseDetail = that.noiseDetail;\n const noiseOffset = that.noiseOffset;\n\n that._noiseTexture = new Texture({\n context: context,\n width: (textureSliceWidth * textureSliceWidth) / noiseTextureRows,\n height: textureSliceWidth * noiseTextureRows,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n pixelFormat: PixelFormat.RGBA,\n sampler: new Sampler({\n wrapS: TextureWrap.REPEAT,\n wrapT: TextureWrap.REPEAT,\n minificationFilter: TextureMinificationFilter.NEAREST,\n magnificationFilter: TextureMagnificationFilter.NEAREST,\n }),\n });\n\n const textureCommand = new ComputeCommand({\n vertexArray: that._vaNoise,\n shaderProgram: that._spNoise,\n outputTexture: that._noiseTexture,\n uniformMap: {\n u_noiseTextureDimensions: getNoiseTextureDimensions(that),\n u_noiseDetail: function () {\n return noiseDetail;\n },\n u_noiseOffset: function () {\n return noiseOffset;\n },\n },\n persists: false,\n owner: cloudCollection,\n postExecute: function (texture) {\n that._ready = true;\n that._loading = false;\n },\n });\n\n frameState.commandList.push(textureCommand);\n that._loading = true;\n}\n\nfunction createVertexArray(cloudCollection, frameState) {\n const that = cloudCollection;\n const context = frameState.context;\n that._createVertexArray = false;\n that._vaf = that._vaf && that._vaf.destroy();\n\n const clouds = cloudCollection._clouds;\n const cloudsLength = clouds.length;\n if (cloudsLength > 0) {\n that._vaf = createVAF(context, cloudsLength, that._instanced);\n const vafWriters = that._vaf.writers;\n\n let i;\n // Rewrite entire buffer if clouds were added or removed.\n for (i = 0; i < cloudsLength; ++i) {\n const cloud = clouds[i];\n writeCloud(cloudCollection, frameState, vafWriters, cloud);\n }\n\n // Different cloud collections share the same index buffer.\n that._vaf.commit(getIndexBuffer(context));\n }\n}\n\nconst scratchWriterArray = [];\n\nfunction updateClouds(cloudCollection, frameState) {\n const context = frameState.context;\n const that = cloudCollection;\n const clouds = that._clouds;\n const cloudsLength = clouds.length;\n const cloudsToUpdate = that._cloudsToUpdate;\n const cloudsToUpdateLength = that._cloudsToUpdateIndex;\n\n const properties = that._propertiesChanged;\n\n const writers = scratchWriterArray;\n writers.length = 0;\n\n if (properties[POSITION_INDEX] || properties[SCALE_INDEX]) {\n writers.push(writePositionAndScale);\n }\n\n if (properties[SHOW_INDEX] || properties[BRIGHTNESS_INDEX]) {\n writers.push(writePackedAttribute0);\n }\n\n if (properties[MAXIMUM_SIZE_INDEX] || properties[SLICE_INDEX]) {\n writers.push(writePackedAttribute1);\n }\n\n if (properties[COLOR_INDEX]) {\n writers.push(writeColor);\n }\n\n const numWriters = writers.length;\n const vafWriters = that._vaf.writers;\n\n let i, c, w;\n if (cloudsToUpdateLength / cloudsLength > 0.1) {\n // Like BillboardCollection, if more than 10% of clouds change,\n // rewrite the entire buffer.\n\n for (i = 0; i < cloudsToUpdateLength; ++i) {\n c = cloudsToUpdate[i];\n c._dirty = false;\n\n for (w = 0; w < numWriters; ++w) {\n writers[w](cloudCollection, frameState, vafWriters, c);\n }\n }\n\n that._vaf.commit(getIndexBuffer(context));\n } else {\n for (i = 0; i < cloudsToUpdateLength; ++i) {\n c = cloudsToUpdate[i];\n c._dirty = false;\n\n for (w = 0; w < numWriters; ++w) {\n writers[w](cloudCollection, frameState, vafWriters, c);\n }\n\n if (that._instanced) {\n that._vaf.subCommit(c._index, 1);\n } else {\n that._vaf.subCommit(c._index * 4, 4);\n }\n }\n that._vaf.endSubCommits();\n }\n\n that._cloudsToUpdateIndex = 0;\n}\n\nfunction createShaderProgram(cloudCollection, frameState, vsSource, fsSource) {\n const context = frameState.context;\n const that = cloudCollection;\n const vs = new ShaderSource({\n defines: [],\n sources: [vsSource],\n });\n\n if (that._instanced) {\n vs.defines.push(\"INSTANCED\");\n }\n\n const fs = new ShaderSource({\n defines: [],\n sources: [fsSource],\n });\n\n if (that.debugBillboards) {\n fs.defines.push(\"DEBUG_BILLBOARDS\");\n }\n\n if (that.debugEllipsoids) {\n fs.defines.push(\"DEBUG_ELLIPSOIDS\");\n }\n\n that._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: that._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n that._rs = RenderState.fromCache({\n depthTest: {\n enabled: true,\n func: WebGLConstants.LESS,\n },\n depthMask: false,\n blending: BlendingState.ALPHA_BLEND,\n });\n\n that._spCreated = true;\n that._compiledDebugBillboards = that.debugBillboards;\n that._compiledDebugEllipsoids = that.debugEllipsoids;\n}\n\nfunction createDrawCommands(cloudCollection, frameState) {\n const that = cloudCollection;\n const pass = frameState.passes;\n const uniforms = that._uniforms;\n const commandList = frameState.commandList;\n if (pass.render) {\n const colorList = that._colorCommands;\n\n const va = that._vaf.va;\n const vaLength = va.length;\n colorList.length = vaLength;\n for (let i = 0; i < vaLength; i++) {\n let command = colorList[i];\n if (!defined(command)) {\n command = colorList[i] = new DrawCommand();\n }\n command.pass = Pass.TRANSLUCENT;\n command.owner = cloudCollection;\n command.uniformMap = uniforms;\n command.count = va[i].indicesCount;\n command.vertexArray = va[i].va;\n command.shaderProgram = that._sp;\n command.renderState = that._rs;\n if (that._instanced) {\n command.count = 6;\n command.instanceCount = that._clouds.length;\n }\n\n commandList.push(command);\n }\n }\n}\n\n/**\n * @private\n */\nCloudCollection.prototype.update = function (frameState) {\n removeClouds(this);\n if (!this.show) {\n return;\n }\n\n const debugging = this.debugBillboards || this.debugEllipsoids;\n this._ready = debugging ? true : defined(this._noiseTexture);\n\n if (!this._ready && !this._loading && !debugging) {\n createNoiseTexture(this, frameState, CloudNoiseVS, CloudNoiseFS);\n }\n\n this._instanced = frameState.context.instancedArrays;\n attributeLocations = this._instanced\n ? attributeLocationsInstanced\n : attributeLocationsBatched;\n getIndexBuffer = this._instanced\n ? getIndexBufferInstanced\n : getIndexBufferBatched;\n\n const clouds = this._clouds;\n const cloudsLength = clouds.length;\n const cloudsToUpdate = this._cloudsToUpdate;\n const cloudsToUpdateLength = this._cloudsToUpdateIndex;\n\n if (this._createVertexArray) {\n createVertexArray(this, frameState);\n } else if (cloudsToUpdateLength > 0) {\n // Clouds were modified, but none were added or removed.\n updateClouds(this, frameState);\n }\n\n // If the number of total clouds ever shrinks considerably,\n // truncate cloudsToUpdate so that we free memory that\n // we are no longer using.\n if (cloudsToUpdateLength > cloudsLength * 1.5) {\n cloudsToUpdate.length = cloudsLength;\n }\n\n if (\n !defined(this._vaf) ||\n !defined(this._vaf.va) ||\n !this._ready & !debugging\n ) {\n return;\n }\n\n if (\n !this._spCreated ||\n this.debugBillboards !== this._compiledDebugBillboards ||\n this.debugEllipsoids !== this._compiledDebugEllipsoids\n ) {\n createShaderProgram(this, frameState, CloudCollectionVS, CloudCollectionFS);\n }\n\n createDrawCommands(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see CloudCollection#destroy\n */\nCloudCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * clouds = clouds && clouds.destroy();\n *\n * @see CloudCollection#isDestroyed\n */\nCloudCollection.prototype.destroy = function () {\n this._noiseTexture = this._noiseTexture && this._noiseTexture.destroy();\n this._sp = this._sp && this._sp.destroy();\n this._vaf = this._vaf && this._vaf.destroy();\n\n destroyClouds(this._clouds);\n\n return destroyObject(this);\n};\n\nexport default CloudCollection;\n", "import defined from \"../Core/defined.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport sampleTerrainMostDetailed from \"../Core/sampleTerrainMostDetailed.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Computes the final camera location to view a rectangle adjusted for the current terrain.\n * If the terrain does not support availability, the height above the ellipsoid is used.\n *\n * @param {Rectangle} rectangle The rectangle being zoomed to.\n * @param {Scene} scene The scene being used.\n *\n * @returns {Cartographic} The optimal location to place the camera so that the entire rectangle is in view.\n *\n * @private\n */\nfunction computeFlyToLocationForRectangle(rectangle, scene) {\n const terrainProvider = scene.terrainProvider;\n const mapProjection = scene.mapProjection;\n const ellipsoid = mapProjection.ellipsoid;\n\n let positionWithoutTerrain;\n const tmp = scene.camera.getRectangleCameraCoordinates(rectangle);\n if (scene.mode === SceneMode.SCENE3D) {\n positionWithoutTerrain = ellipsoid.cartesianToCartographic(tmp);\n } else {\n positionWithoutTerrain = mapProjection.unproject(tmp);\n }\n\n if (!defined(terrainProvider)) {\n return Promise.resolve(positionWithoutTerrain);\n }\n\n return terrainProvider.readyPromise.then(function () {\n const availability = terrainProvider.availability;\n\n if (!defined(availability) || scene.mode === SceneMode.SCENE2D) {\n return positionWithoutTerrain;\n }\n\n const cartographics = [\n Rectangle.center(rectangle),\n Rectangle.southeast(rectangle),\n Rectangle.southwest(rectangle),\n Rectangle.northeast(rectangle),\n Rectangle.northwest(rectangle),\n ];\n\n return computeFlyToLocationForRectangle\n ._sampleTerrainMostDetailed(terrainProvider, cartographics)\n .then(function (positionsOnTerrain) {\n const maxHeight = positionsOnTerrain.reduce(function (\n currentMax,\n item\n ) {\n return Math.max(item.height, currentMax);\n },\n -Number.MAX_VALUE);\n\n const finalPosition = positionWithoutTerrain;\n finalPosition.height += maxHeight;\n return finalPosition;\n });\n });\n}\n\n//Exposed for testing.\ncomputeFlyToLocationForRectangle._sampleTerrainMostDetailed = sampleTerrainMostDetailed;\nexport default computeFlyToLocationForRectangle;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\nconst defaultAngle = CesiumMath.toRadians(30.0);\n\n/**\n * A ParticleEmitter that emits particles within a cone.\n * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.\n *\n * @alias ConeEmitter\n * @constructor\n *\n * @param {Number} [angle=Cesium.Math.toRadians(30.0)] The angle of the cone in radians.\n */\nfunction ConeEmitter(angle) {\n this._angle = defaultValue(angle, defaultAngle);\n}\n\nObject.defineProperties(ConeEmitter.prototype, {\n /**\n * The angle of the cone in radians.\n * @memberof CircleEmitter.prototype\n * @type {Number}\n * @default Cesium.Math.toRadians(30.0)\n */\n angle: {\n get: function () {\n return this._angle;\n },\n set: function (value) {\nthis._angle = value;\n },\n },\n});\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize\n */\nConeEmitter.prototype.emit = function (particle) {\n const radius = Math.tan(this._angle);\n\n // Compute a random point on the cone's base\n const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n const rad = CesiumMath.randomBetween(0.0, radius);\n\n const x = rad * Math.cos(theta);\n const y = rad * Math.sin(theta);\n const z = 1.0;\n\n particle.velocity = Cartesian3.fromElements(x, y, z, particle.velocity);\n Cartesian3.normalize(particle.velocity, particle.velocity);\n particle.position = Cartesian3.clone(Cartesian3.ZERO, particle.position);\n};\nexport default ConeEmitter;\n", "import Cartesian4 from \"../Core/Cartesian4.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport mergeSort from \"../Core/mergeSort.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport Material from \"./Material.js\";\n\nconst scratchColor = new Color();\nconst scratchColorAbove = new Color();\nconst scratchColorBelow = new Color();\nconst scratchColorBlend = new Color();\nconst scratchPackedFloat = new Cartesian4();\nconst scratchColorBytes = new Uint8Array(4);\n\nfunction lerpEntryColor(height, entryBefore, entryAfter, result) {\n const lerpFactor =\n entryBefore.height === entryAfter.height\n ? 0.0\n : (height - entryBefore.height) /\n (entryAfter.height - entryBefore.height);\n return Color.lerp(entryBefore.color, entryAfter.color, lerpFactor, result);\n}\n\nfunction createNewEntry(height, color) {\n return {\n height: height,\n color: Color.clone(color),\n };\n}\n\nfunction removeDuplicates(entries) {\n // This function expects entries to be sorted from lowest to highest.\n\n // Remove entries that have the same height as before and after.\n entries = entries.filter(function (entry, index, array) {\n const hasPrev = index > 0;\n const hasNext = index < array.length - 1;\n\n const sameHeightAsPrev = hasPrev\n ? entry.height === array[index - 1].height\n : true;\n const sameHeightAsNext = hasNext\n ? entry.height === array[index + 1].height\n : true;\n\n const keep = !sameHeightAsPrev || !sameHeightAsNext;\n return keep;\n });\n\n // Remove entries that have the same color as before and after.\n entries = entries.filter(function (entry, index, array) {\n const hasPrev = index > 0;\n const hasNext = index < array.length - 1;\n\n const sameColorAsPrev = hasPrev\n ? Color.equals(entry.color, array[index - 1].color)\n : false;\n const sameColorAsNext = hasNext\n ? Color.equals(entry.color, array[index + 1].color)\n : false;\n\n const keep = !sameColorAsPrev || !sameColorAsNext;\n return keep;\n });\n\n // Also remove entries that have the same height AND color as the entry before.\n entries = entries.filter(function (entry, index, array) {\n const hasPrev = index > 0;\n\n const sameColorAsPrev = hasPrev\n ? Color.equals(entry.color, array[index - 1].color)\n : false;\n\n const sameHeightAsPrev = hasPrev\n ? entry.height === array[index - 1].height\n : true;\n\n const keep = !sameColorAsPrev || !sameHeightAsPrev;\n return keep;\n });\n\n return entries;\n}\n\nfunction preprocess(layers) {\n let i, j;\n\n const layeredEntries = [];\n\n const layersLength = layers.length;\n for (i = 0; i < layersLength; i++) {\n const layer = layers[i];\n const entriesOrig = layer.entries;\n const entriesLength = entriesOrig.length;\n\n let entries = [];\n\n for (j = 0; j < entriesLength; j++) {\n const entryOrig = entriesOrig[j];\n\n const height = CesiumMath.clamp(\n entryOrig.height,\n createElevationBandMaterial._minimumHeight,\n createElevationBandMaterial._maximumHeight\n );\n\n // premultiplied alpha\n const color = Color.clone(entryOrig.color, scratchColor);\n color.red *= color.alpha;\n color.green *= color.alpha;\n color.blue *= color.alpha;\n\n entries.push(createNewEntry(height, color));\n }\n\n let sortedAscending = true;\n let sortedDescending = true;\n for (j = 0; j < entriesLength - 1; j++) {\n const currEntry = entries[j + 0];\n const nextEntry = entries[j + 1];\n\n sortedAscending = sortedAscending && currEntry.height <= nextEntry.height;\n sortedDescending =\n sortedDescending && currEntry.height >= nextEntry.height;\n }\n\n // When the array is fully descending, reverse it.\n if (sortedDescending) {\n entries = entries.reverse();\n } else if (!sortedAscending) {\n // Stable sort from lowest to greatest height.\n mergeSort(entries, function (a, b) {\n return CesiumMath.sign(a.height - b.height);\n });\n }\n\n let extendDownwards = defaultValue(layer.extendDownwards, false);\n let extendUpwards = defaultValue(layer.extendUpwards, false);\n\n // Interpret a single entry to extend all the way up and down.\n if (entries.length === 1 && !extendDownwards && !extendUpwards) {\n extendDownwards = true;\n extendUpwards = true;\n }\n\n if (extendDownwards) {\n entries.splice(\n 0,\n 0,\n createNewEntry(\n createElevationBandMaterial._minimumHeight,\n entries[0].color\n )\n );\n }\n if (extendUpwards) {\n entries.splice(\n entries.length,\n 0,\n createNewEntry(\n createElevationBandMaterial._maximumHeight,\n entries[entries.length - 1].color\n )\n );\n }\n\n entries = removeDuplicates(entries);\n\n layeredEntries.push(entries);\n }\n\n return layeredEntries;\n}\n\nfunction createLayeredEntries(layers) {\n // clean up the input data and check for errors\n const layeredEntries = preprocess(layers);\n\n let entriesAccumNext = [];\n let entriesAccumCurr = [];\n let i;\n\n function addEntry(height, color) {\n entriesAccumNext.push(createNewEntry(height, color));\n }\n function addBlendEntry(height, a, b) {\n let result = Color.multiplyByScalar(b, 1.0 - a.alpha, scratchColorBlend);\n result = Color.add(result, a, result);\n addEntry(height, result);\n }\n\n // alpha blend new layers on top of old ones\n const layerLength = layeredEntries.length;\n for (i = 0; i < layerLength; i++) {\n const entries = layeredEntries[i];\n let idx = 0;\n let accumIdx = 0;\n\n // swap the arrays\n entriesAccumCurr = entriesAccumNext;\n entriesAccumNext = [];\n\n const entriesLength = entries.length;\n const entriesAccumLength = entriesAccumCurr.length;\n while (idx < entriesLength || accumIdx < entriesAccumLength) {\n const entry = idx < entriesLength ? entries[idx] : undefined;\n const prevEntry = idx > 0 ? entries[idx - 1] : undefined;\n const nextEntry = idx < entriesLength - 1 ? entries[idx + 1] : undefined;\n\n const entryAccum =\n accumIdx < entriesAccumLength ? entriesAccumCurr[accumIdx] : undefined;\n const prevEntryAccum =\n accumIdx > 0 ? entriesAccumCurr[accumIdx - 1] : undefined;\n const nextEntryAccum =\n accumIdx < entriesAccumLength - 1\n ? entriesAccumCurr[accumIdx + 1]\n : undefined;\n\n if (\n defined(entry) &&\n defined(entryAccum) &&\n entry.height === entryAccum.height\n ) {\n // New entry directly on top of accum entry\n const isSplitAccum =\n defined(nextEntryAccum) &&\n entryAccum.height === nextEntryAccum.height;\n const isStartAccum = !defined(prevEntryAccum);\n const isEndAccum = !defined(nextEntryAccum);\n\n const isSplit = defined(nextEntry) && entry.height === nextEntry.height;\n const isStart = !defined(prevEntry);\n const isEnd = !defined(nextEntry);\n\n if (isSplitAccum) {\n if (isSplit) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addBlendEntry(entry.height, nextEntry.color, nextEntryAccum.color);\n } else if (isStart) {\n addEntry(entry.height, entryAccum.color);\n addBlendEntry(entry.height, entry.color, nextEntryAccum.color);\n } else if (isEnd) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addEntry(entry.height, nextEntryAccum.color);\n } else {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addBlendEntry(entry.height, entry.color, nextEntryAccum.color);\n }\n } else if (isStartAccum) {\n if (isSplit) {\n addEntry(entry.height, entry.color);\n addBlendEntry(entry.height, nextEntry.color, entryAccum.color);\n } else if (isEnd) {\n addEntry(entry.height, entry.color);\n addEntry(entry.height, entryAccum.color);\n } else if (isStart) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n } else {\n addEntry(entry.height, entry.color);\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n }\n } else if (isEndAccum) {\n if (isSplit) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addEntry(entry.height, nextEntry.color);\n } else if (isStart) {\n addEntry(entry.height, entryAccum.color);\n addEntry(entry.height, entry.color);\n } else if (isEnd) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n } else {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addEntry(entry.height, entry.color);\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isSplit) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addBlendEntry(entry.height, nextEntry.color, entryAccum.color);\n } else if (isStart) {\n addEntry(entry.height, entryAccum.color);\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n } else if (isEnd) {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n addEntry(entry.height, entryAccum.color);\n } else {\n addBlendEntry(entry.height, entry.color, entryAccum.color);\n }\n }\n idx += isSplit ? 2 : 1;\n accumIdx += isSplitAccum ? 2 : 1;\n } else if (\n defined(entry) &&\n defined(entryAccum) &&\n defined(prevEntryAccum) &&\n entry.height < entryAccum.height\n ) {\n // New entry between two accum entries\n const colorBelow = lerpEntryColor(\n entry.height,\n prevEntryAccum,\n entryAccum,\n scratchColorBelow\n );\n\n if (!defined(prevEntry)) {\n addEntry(entry.height, colorBelow);\n addBlendEntry(entry.height, entry.color, colorBelow);\n } else if (!defined(nextEntry)) {\n addBlendEntry(entry.height, entry.color, colorBelow);\n addEntry(entry.height, colorBelow);\n } else {\n addBlendEntry(entry.height, entry.color, colorBelow);\n }\n idx++;\n } else if (\n defined(entryAccum) &&\n defined(entry) &&\n defined(prevEntry) &&\n entryAccum.height < entry.height\n ) {\n // Accum entry between two new entries\n const colorAbove = lerpEntryColor(\n entryAccum.height,\n prevEntry,\n entry,\n scratchColorAbove\n );\n\n if (!defined(prevEntryAccum)) {\n addEntry(entryAccum.height, colorAbove);\n addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n } else if (!defined(nextEntryAccum)) {\n addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n addEntry(entryAccum.height, colorAbove);\n } else {\n addBlendEntry(entryAccum.height, colorAbove, entryAccum.color);\n }\n accumIdx++;\n } else if (\n defined(entry) &&\n (!defined(entryAccum) || entry.height < entryAccum.height)\n ) {\n // New entry completely before or completely after accum entries\n if (\n defined(entryAccum) &&\n !defined(prevEntryAccum) &&\n !defined(nextEntry)\n ) {\n // Insert blank gap between last entry and first accum entry\n addEntry(entry.height, entry.color);\n addEntry(entry.height, createElevationBandMaterial._emptyColor);\n addEntry(entryAccum.height, createElevationBandMaterial._emptyColor);\n } else if (\n !defined(entryAccum) &&\n defined(prevEntryAccum) &&\n !defined(prevEntry)\n ) {\n // Insert blank gap between last accum entry and first entry\n addEntry(\n prevEntryAccum.height,\n createElevationBandMaterial._emptyColor\n );\n addEntry(entry.height, createElevationBandMaterial._emptyColor);\n addEntry(entry.height, entry.color);\n } else {\n addEntry(entry.height, entry.color);\n }\n idx++;\n } else if (\n defined(entryAccum) &&\n (!defined(entry) || entryAccum.height < entry.height)\n ) {\n // Accum entry completely before or completely after new entries\n addEntry(entryAccum.height, entryAccum.color);\n accumIdx++;\n }\n }\n }\n\n // one final cleanup pass in case duplicate colors show up in the final result\n const allEntries = removeDuplicates(entriesAccumNext);\n return allEntries;\n}\n\n/**\n * @typedef createElevationBandMaterialEntry\n *\n * @property {Number} height The height.\n * @property {Color} color The color at this height.\n */\n/**\n * @typedef createElevationBandMaterialBand\n *\n * @property {createElevationBandMaterialEntry[]} entries A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and <code>extendsDownards</code> and <code>extendUpwards</code> are both <code>false</code>, they will both be set to <code>true</code>.\n * @property {Boolean} [extendDownwards=false] If <code>true</code>, the band's minimum elevation color will extend infinitely downwards.\n * @property {Boolean} [extendUpwards=false] If <code>true</code>, the band's maximum elevation color will extend infinitely upwards.\n */\n\n/**\n * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights.\n *\n * The shader does a binary search over all the heights to find out which colors are above and below a given height, and\n * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.\n *\n * @function createElevationBandMaterial\n *\n * @param {Object} options Object with the following properties:\n * @param {Scene} options.scene The scene where the visualization is taking place.\n * @param {createElevationBandMaterialBand[]} options.layers A list of bands ordered from lowest to highest precedence.\n * @returns {Material} A new {@link Material} instance.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Elevation%20Band%20Material.html|Cesium Sandcastle Elevation Band Demo}\n *\n * @example\n * scene.globe.material = Cesium.createElevationBandMaterial({\n * scene : scene,\n * layers : [{\n * entries : [{\n * height : 4200.0,\n * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)\n * }, {\n * height : 8848.0,\n * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)\n * }],\n * extendDownwards : true,\n * extendUpwards : true,\n * }, {\n * entries : [{\n * height : 7000.0,\n * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)\n * }, {\n * height : 7100.0,\n * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)\n * }]\n * }]\n * });\n */\nfunction createElevationBandMaterial(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const scene = options.scene;\n const layers = options.layers;\n\n const entries = createLayeredEntries(layers);\n const entriesLength = entries.length;\n let i;\n\n let heightTexBuffer;\n let heightTexDatatype;\n let heightTexFormat;\n\n const isPackedHeight = !createElevationBandMaterial._useFloatTexture(\n scene.context\n );\n if (isPackedHeight) {\n heightTexDatatype = PixelDatatype.UNSIGNED_BYTE;\n heightTexFormat = PixelFormat.RGBA;\n heightTexBuffer = new Uint8Array(entriesLength * 4);\n for (i = 0; i < entriesLength; i++) {\n Cartesian4.packFloat(entries[i].height, scratchPackedFloat);\n Cartesian4.pack(scratchPackedFloat, heightTexBuffer, i * 4);\n }\n } else {\n heightTexDatatype = PixelDatatype.FLOAT;\n heightTexFormat = PixelFormat.LUMINANCE;\n heightTexBuffer = new Float32Array(entriesLength);\n for (i = 0; i < entriesLength; i++) {\n heightTexBuffer[i] = entries[i].height;\n }\n }\n\n const heightsTex = Texture.create({\n context: scene.context,\n pixelFormat: heightTexFormat,\n pixelDatatype: heightTexDatatype,\n source: {\n arrayBufferView: heightTexBuffer,\n width: entriesLength,\n height: 1,\n },\n sampler: new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.NEAREST,\n magnificationFilter: TextureMagnificationFilter.NEAREST,\n }),\n });\n\n const colorsArray = new Uint8Array(entriesLength * 4);\n for (i = 0; i < entriesLength; i++) {\n const color = entries[i].color;\n color.toBytes(scratchColorBytes);\n colorsArray[i * 4 + 0] = scratchColorBytes[0];\n colorsArray[i * 4 + 1] = scratchColorBytes[1];\n colorsArray[i * 4 + 2] = scratchColorBytes[2];\n colorsArray[i * 4 + 3] = scratchColorBytes[3];\n }\n\n const colorsTex = Texture.create({\n context: scene.context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n arrayBufferView: colorsArray,\n width: entriesLength,\n height: 1,\n },\n sampler: new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.LINEAR,\n magnificationFilter: TextureMagnificationFilter.LINEAR,\n }),\n });\n\n const material = Material.fromType(\"ElevationBand\", {\n heights: heightsTex,\n colors: colorsTex,\n });\n return material;\n}\n\n/**\n * Function for checking if the context will allow floating point textures for heights.\n *\n * @param {Context} context The {@link Context}.\n * @returns {Boolean} <code>true</code> if floating point textures can be used for heights.\n * @private\n */\ncreateElevationBandMaterial._useFloatTexture = function (context) {\n return context.floatingPointTexture;\n};\n\n/**\n * This is the height that gets stored in the texture when using extendUpwards.\n * There's nothing special about it, it's just a really big number.\n * @private\n */\ncreateElevationBandMaterial._maximumHeight = +5906376425472;\n\n/**\n * This is the height that gets stored in the texture when using extendDownwards.\n * There's nothing special about it, it's just a really big number.\n * @private\n */\ncreateElevationBandMaterial._minimumHeight = -5906376425472;\n\n/**\n * Color used to create empty space in the color texture\n * @private\n */\ncreateElevationBandMaterial._emptyColor = new Color(0.0, 0.0, 0.0, 0.0);\n\nexport default createElevationBandMaterial;\n", "import Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport IonResource from \"../Core/IonResource.js\";\nimport Cesium3DTileset from \"./Cesium3DTileset.js\";\nimport Cesium3DTileStyle from \"./Cesium3DTileStyle.js\";\n\n/**\n * Creates a {@link Cesium3DTileset} instance for the\n * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}\n * tileset.\n *\n * @function\n *\n * @param {Object} [options] Construction options. Any options allowed by the {@link Cesium3DTileset} constructor\n * may be specified here. In addition to those, the following properties are supported:\n * @param {Color} [options.defaultColor=Color.WHITE] The default color to use for buildings\n * that do not have a color. This parameter is ignored if <code>options.style</code> is specified.\n * @param {Cesium3DTileStyle} [options.style] The style to use with the tileset. If not\n * specified, a default style is used which gives each building or building part a\n * color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,\n * <code>options.defaultColor</code> is used.\n * @param {Boolean} [options.enableShowOutline=true] If true, enable rendering outlines. This can be set to false to avoid the additional processing of geometry at load time.\n * @param {Boolean} [options.showOutline=true] Whether to show outlines around buildings. When true,\n * outlines are displayed. When false, outlines are not displayed.\n * @returns {Cesium3DTileset}\n *\n * @see Ion\n *\n * @example\n * // Create Cesium OSM Buildings with default styling\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.scene.primitives.add(Cesium.createOsmBuildings());\n *\n * @example\n * // Create Cesium OSM Buildings with a custom style highlighting\n * // schools and hospitals.\n * viewer.scene.primitives.add(Cesium.createOsmBuildings({\n * style: new Cesium.Cesium3DTileStyle({\n * color: {\n * conditions: [\n * [\"${feature['building']} === 'hospital'\", \"color('#0000FF')\"],\n * [\"${feature['building']} === 'school'\", \"color('#00FF00')\"],\n * [true, \"color('#ffffff')\"]\n * ]\n * }\n * })\n * }));\n */\nfunction createOsmBuildings(options) {\n options = combine(options, {\n url: IonResource.fromAssetId(96188),\n });\n\n const tileset = new Cesium3DTileset(options);\n\n let style = options.style;\n\n if (!defined(style)) {\n const color = defaultValue(\n options.defaultColor,\n Color.WHITE\n ).toCssColorString();\n style = new Cesium3DTileStyle({\n color: `Boolean(\\${feature['cesium#color']}) ? color(\\${feature['cesium#color']}) : ${color}`,\n });\n }\n\n tileset.style = style;\n\n return tileset;\n}\n\nexport default createOsmBuildings;\n", "import ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Creates a {@link Primitive} to visualize well-known vector vertex attributes:\n * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal\n * is red; tangent is green; and bitangent is blue. If an attribute is not\n * present, it is not drawn.\n *\n * @function\n *\n * @param {Object} options Object with the following properties:\n * @param {Geometry} options.geometry The <code>Geometry</code> instance with the attribute.\n * @param {Number} [options.length=10000.0] The length of each line segment in meters. This can be negative to point the vector in the opposite direction.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.\n * @returns {Primitive} A new <code>Primitive</code> instance with geometry for the vectors.\n *\n * @example\n * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({\n * geometry : instance.geometry,\n * length : 100000.0,\n * modelMatrix : instance.modelMatrix\n * }));\n */\nfunction createTangentSpaceDebugPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const instances = [];\n let geometry = options.geometry;\n\n if (!defined(geometry.attributes) || !defined(geometry.primitiveType)) {\n // to create the debug lines, we need the computed attributes.\n // compute them if they are undefined.\n geometry = geometry.constructor.createGeometry(geometry);\n }\n\n const attributes = geometry.attributes;\n const modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n const length = defaultValue(options.length, 10000.0);\n\n if (defined(attributes.normal)) {\n instances.push(\n new GeometryInstance({\n geometry: GeometryPipeline.createLineSegmentsForVectors(\n geometry,\n \"normal\",\n length\n ),\n attributes: {\n color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n },\n modelMatrix: modelMatrix,\n })\n );\n }\n\n if (defined(attributes.tangent)) {\n instances.push(\n new GeometryInstance({\n geometry: GeometryPipeline.createLineSegmentsForVectors(\n geometry,\n \"tangent\",\n length\n ),\n attributes: {\n color: new ColorGeometryInstanceAttribute(0.0, 1.0, 0.0, 1.0),\n },\n modelMatrix: modelMatrix,\n })\n );\n }\n\n if (defined(attributes.bitangent)) {\n instances.push(\n new GeometryInstance({\n geometry: GeometryPipeline.createLineSegmentsForVectors(\n geometry,\n \"bitangent\",\n length\n ),\n attributes: {\n color: new ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 1.0),\n },\n modelMatrix: modelMatrix,\n })\n );\n }\n\n if (instances.length > 0) {\n return new Primitive({\n asynchronous: false,\n geometryInstances: instances,\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: false,\n }),\n });\n }\n\n return undefined;\n}\nexport default createTangentSpaceDebugPrimitive;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport combine from \"../Core/combine.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\nconst templateRegex = /{[^}]+}/g;\n\nconst tags = {\n x: xTag,\n y: yTag,\n z: zTag,\n s: sTag,\n reverseX: reverseXTag,\n reverseY: reverseYTag,\n reverseZ: reverseZTag,\n westDegrees: westDegreesTag,\n southDegrees: southDegreesTag,\n eastDegrees: eastDegreesTag,\n northDegrees: northDegreesTag,\n westProjected: westProjectedTag,\n southProjected: southProjectedTag,\n eastProjected: eastProjectedTag,\n northProjected: northProjectedTag,\n width: widthTag,\n height: heightTag,\n};\n\nconst pickFeaturesTags = combine(tags, {\n i: iTag,\n j: jTag,\n reverseI: reverseITag,\n reverseJ: reverseJTag,\n longitudeDegrees: longitudeDegreesTag,\n latitudeDegrees: latitudeDegreesTag,\n longitudeProjected: longitudeProjectedTag,\n latitudeProjected: latitudeProjectedTag,\n format: formatTag,\n});\n\n/**\n * @typedef {Object} UrlTemplateImageryProvider.ConstructorOptions\n *\n * Initialization options for the UrlTemplateImageryProvider constructor\n *\n * @property {Promise.<Object>|Object} [options] Object with the following properties:\n * @property {Resource|String} url The URL template to use to request tiles. It has the following keywords:\n * <ul>\n * <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>\n * <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>\n * <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>\n * <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>\n * <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>\n * <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>\n * <li><code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li>\n * <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>\n * <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>\n * <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>\n * <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>\n * <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li><code>{width}</code>: The width of each tile in pixels.</li>\n * <li><code>{height}</code>: The height of each tile in pixels.</li>\n * </ul>\n * @property {Resource|String} [pickFeaturesUrl] The URL template to use to pick features. If this property is not specified,\n * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no\n * features picked. The URL template supports all of the keywords supported by the <code>url</code>\n * parameter, plus the following:\n * <ul>\n * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>\n * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>\n * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>\n * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>\n * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>\n * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>\n * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>\n * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>\n * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>\n * </ul>\n * @property {Object} [urlSchemeZeroPadding] Gets the URL scheme zero padding for each tile coordinate. The format is '000' where\n * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:\n * urlSchemeZeroPadding : { '{x}' : '0000'}\n * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.\n * It the passed object has the following keywords:\n * <ul>\n * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>\n * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>\n * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>\n * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>\n * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>\n * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>\n * </ul>\n * @property {String|String[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n * If this parameter is a single string, each character in the string is a subdomain. If it is\n * an array, each element in the array is a subdomain.\n * @property {Credit|String} [credit=''] A credit for the data source, which is displayed on the canvas.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying\n * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely\n * to result in rendering problems.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {TilingScheme} [tilingScheme=WebMercatorTilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}\n * is used.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Number} [tileWidth=256] Pixel width of image tiles.\n * @property {Number} [tileHeight=256] Pixel height of image tiles.\n * @property {Boolean} [hasAlphaChannel=true] true if the images provided by this imagery provider\n * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if\n * present, will be ignored. If this property is true, any images without an alpha channel will\n * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are potentially reduced.\n * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats] The formats in which to get feature information at a\n * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this\n * parameter is not specified, feature picking is disabled.\n * @property {Boolean} [enablePickFeatures=true] If true, {@link UrlTemplateImageryProvider#pickFeatures} will\n * request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,\n * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n * features) without communicating with the server. Set this property to false if you know your data\n * source does not support picking features or if you don't want this provider's features to be pickable. Note\n * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}\n * property.\n * @property {Object} [customTags] Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.\n */\n\n/**\n * Provides imagery by requesting tiles using a specified URL template.\n *\n * @alias UrlTemplateImageryProvider\n * @constructor\n *\n * @param {UrlTemplateImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project\n * const tms = new Cesium.UrlTemplateImageryProvider({\n * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',\n * credit : '\u00A9 Analytical Graphics, Inc.',\n * tilingScheme : new Cesium.GeographicTilingScheme(),\n * maximumLevel : 5\n * });\n * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.\n * const positron = new Cesium.UrlTemplateImageryProvider({\n * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',\n * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'\n * });\n * // Access a Web Map Service (WMS) server.\n * const wms = new Cesium.UrlTemplateImageryProvider({\n * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +\n * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +\n * 'styles=&service=WMS&version=1.1.1&request=GetMap&' +\n * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +\n * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +\n * 'width=256&height=256',\n * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)\n * });\n * // Using custom tags in your template url.\n * const custom = new Cesium.UrlTemplateImageryProvider({\n * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',\n * customTags : {\n * Time: function(imageryProvider, x, y, level) {\n * return '20171231'\n * }\n * }\n * });\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n */\nfunction UrlTemplateImageryProvider(options) {\n this._errorEvent = new Event();\n\n this._resource = undefined;\n this._urlSchemeZeroPadding = undefined;\n this._pickFeaturesResource = undefined;\n this._tileWidth = undefined;\n this._tileHeight = undefined;\n this._maximumLevel = undefined;\n this._minimumLevel = undefined;\n this._tilingScheme = undefined;\n this._rectangle = undefined;\n this._tileDiscardPolicy = undefined;\n this._credit = undefined;\n this._hasAlphaChannel = undefined;\n this._readyPromise = undefined;\n this._tags = undefined;\n this._pickFeaturesTags = undefined;\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n /**\n * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will\n * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,\n * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n * features) without communicating with the server. Set this property to false if you know your data\n * source does not support picking features or if you don't want this provider's features to be pickable.\n * @type {Boolean}\n * @default true\n */\n this.enablePickFeatures = true;\n\n this.reinitialize(options);\n}\n\nObject.defineProperties(UrlTemplateImageryProvider.prototype, {\n /**\n * Gets the URL template to use to request tiles. It has the following keywords:\n * <ul>\n * <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>\n * <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>\n * <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>\n * <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>\n * <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>\n * <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>\n * <li> <code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li>\n * <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>\n * <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>\n * <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>\n * <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>\n * <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>\n * <li> <code>{width}</code>: The width of each tile in pixels.</li>\n * <li> <code>{height}</code>: The height of each tile in pixels.</li>\n * </ul>\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource.url;\n },\n },\n\n /**\n * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on\n * the left with zeros to match the width of the passed string of zeros. e.g. Setting:\n * urlSchemeZeroPadding : { '{x}' : '0000'}\n * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.\n * It has the following keywords:\n * <ul>\n * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>\n * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>\n * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>\n * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>\n * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>\n * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>\n * </ul>\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Object}\n * @readonly\n */\n urlSchemeZeroPadding: {\n get: function () {\n return this._urlSchemeZeroPadding;\n },\n },\n\n /**\n * Gets the URL template to use to use to pick features. If this property is not specified,\n * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no\n * features picked. The URL template supports all of the keywords supported by the\n * {@link UrlTemplateImageryProvider#url} property, plus the following:\n * <ul>\n * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>\n * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>\n * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>\n * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>\n * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>\n * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>\n * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>\n * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>\n * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>\n * </ul>\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n pickFeaturesUrl: {\n get: function () {\n return this._pickFeaturesResource.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n * @default undefined\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Number}\n * @readonly\n * @default 256\n */\n tileWidth: {\n get: function () {\nreturn this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Number}\n * @readonly\n * @default 256\n */\n tileHeight: {\n get: function () {\nreturn this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.\n * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n * @default undefined\n */\n maximumLevel: {\n get: function () {\nreturn this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Number}\n * @readonly\n * @default 0\n */\n minimumLevel: {\n get: function () {\nreturn this._minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n * @default new WebMercatorTilingScheme()\n */\n tilingScheme: {\n get: function () {\nreturn this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n * @default tilingScheme.rectangle\n */\n rectangle: {\n get: function () {\nreturn this._rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n * @default undefined\n */\n tileDiscardPolicy: {\n get: function () {\nreturn this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return defined(this._resource);\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Credit}\n * @readonly\n * @default undefined\n */\n credit: {\n get: function () {\nreturn this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced. This function should\n * not be called before {@link ImageryProvider#ready} returns true.\n * @memberof UrlTemplateImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n * @default true\n */\n hasAlphaChannel: {\n get: function () {\nreturn this._hasAlphaChannel;\n },\n },\n});\n\n/**\n * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not\n * recommended because existing tiles provided by the imagery provider will not be updated.\n *\n * @param {Promise.<Object>|Object} options Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.\n */\nUrlTemplateImageryProvider.prototype.reinitialize = function (options) {\n const that = this;\n that._readyPromise = Promise.resolve(options).then(function (properties) {\n const customTags = properties.customTags;\n const allTags = combine(tags, customTags);\n const allPickFeaturesTags = combine(pickFeaturesTags, customTags);\n const resource = Resource.createIfNeeded(properties.url);\n const pickFeaturesResource = Resource.createIfNeeded(\n properties.pickFeaturesUrl\n );\n\n that.enablePickFeatures = defaultValue(\n properties.enablePickFeatures,\n that.enablePickFeatures\n );\n that._urlSchemeZeroPadding = defaultValue(\n properties.urlSchemeZeroPadding,\n that.urlSchemeZeroPadding\n );\n that._tileDiscardPolicy = properties.tileDiscardPolicy;\n that._getFeatureInfoFormats = properties.getFeatureInfoFormats;\n\n that._subdomains = properties.subdomains;\n if (Array.isArray(that._subdomains)) {\n that._subdomains = that._subdomains.slice();\n } else if (defined(that._subdomains) && that._subdomains.length > 0) {\n that._subdomains = that._subdomains.split(\"\");\n } else {\n that._subdomains = [\"a\", \"b\", \"c\"];\n }\n\n that._tileWidth = defaultValue(properties.tileWidth, 256);\n that._tileHeight = defaultValue(properties.tileHeight, 256);\n that._minimumLevel = defaultValue(properties.minimumLevel, 0);\n that._maximumLevel = properties.maximumLevel;\n that._tilingScheme = defaultValue(\n properties.tilingScheme,\n new WebMercatorTilingScheme({ ellipsoid: properties.ellipsoid })\n );\n that._rectangle = defaultValue(\n properties.rectangle,\n that._tilingScheme.rectangle\n );\n that._rectangle = Rectangle.intersection(\n that._rectangle,\n that._tilingScheme.rectangle\n );\n that._hasAlphaChannel = defaultValue(properties.hasAlphaChannel, true);\n\n let credit = properties.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n that._credit = credit;\n\n that._resource = resource;\n that._tags = allTags;\n that._pickFeaturesResource = pickFeaturesResource;\n that._pickFeaturesTags = allPickFeaturesTags;\n\n return true;\n });\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nUrlTemplateImageryProvider.prototype.getTileCredits = function (x, y, level) {\nreturn undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link UrlTemplateImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n */\nUrlTemplateImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\nreturn ImageryProvider.loadImage(\n this,\n buildImageResource(this, x, y, level, request)\n );\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n */\nUrlTemplateImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n if (\n !this.enablePickFeatures ||\n !defined(this._pickFeaturesResource) ||\n this._getFeatureInfoFormats.length === 0\n ) {\n return undefined;\n }\n\n let formatIndex = 0;\n\n const that = this;\n\n function handleResponse(format, data) {\n return format.callback(data);\n }\n\n function doRequest() {\n if (formatIndex >= that._getFeatureInfoFormats.length) {\n // No valid formats, so no features picked.\n return Promise.resolve([]);\n }\n\n const format = that._getFeatureInfoFormats[formatIndex];\n const resource = buildPickFeaturesResource(\n that,\n x,\n y,\n level,\n longitude,\n latitude,\n format.format\n );\n\n ++formatIndex;\n\n if (format.type === \"json\") {\n return resource.fetchJson().then(format.callback).catch(doRequest);\n } else if (format.type === \"xml\") {\n return resource.fetchXML().then(format.callback).catch(doRequest);\n } else if (format.type === \"text\" || format.type === \"html\") {\n return resource.fetchText().then(format.callback).catch(doRequest);\n }\n return resource\n .fetch({\n responseType: format.format,\n })\n .then(handleResponse.bind(undefined, format))\n .catch(doRequest);\n }\n\n return doRequest();\n};\n\nlet degreesScratchComputed = false;\nconst degreesScratch = new Rectangle();\nlet projectedScratchComputed = false;\nconst projectedScratch = new Rectangle();\n\nfunction buildImageResource(imageryProvider, x, y, level, request) {\n degreesScratchComputed = false;\n projectedScratchComputed = false;\n\n const resource = imageryProvider._resource;\n const url = resource.getUrlComponent(true);\n const allTags = imageryProvider._tags;\n const templateValues = {};\n\n const match = url.match(templateRegex);\n if (defined(match)) {\n match.forEach(function (tag) {\n const key = tag.substring(1, tag.length - 1); //strip {}\n if (defined(allTags[key])) {\n templateValues[key] = allTags[key](imageryProvider, x, y, level);\n }\n });\n }\n\n return resource.getDerivedResource({\n request: request,\n templateValues: templateValues,\n });\n}\n\nlet ijScratchComputed = false;\nconst ijScratch = new Cartesian2();\nlet longitudeLatitudeProjectedScratchComputed = false;\n\nfunction buildPickFeaturesResource(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n degreesScratchComputed = false;\n projectedScratchComputed = false;\n ijScratchComputed = false;\n longitudeLatitudeProjectedScratchComputed = false;\n\n const resource = imageryProvider._pickFeaturesResource;\n const url = resource.getUrlComponent(true);\n const allTags = imageryProvider._pickFeaturesTags;\n const templateValues = {};\n const match = url.match(templateRegex);\n if (defined(match)) {\n match.forEach(function (tag) {\n const key = tag.substring(1, tag.length - 1); //strip {}\n if (defined(allTags[key])) {\n templateValues[key] = allTags[key](\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n );\n }\n });\n }\n\n return resource.getDerivedResource({\n templateValues: templateValues,\n });\n}\n\nfunction padWithZerosIfNecessary(imageryProvider, key, value) {\n if (\n imageryProvider &&\n imageryProvider.urlSchemeZeroPadding &&\n imageryProvider.urlSchemeZeroPadding.hasOwnProperty(key)\n ) {\n const paddingTemplate = imageryProvider.urlSchemeZeroPadding[key];\n if (typeof paddingTemplate === \"string\") {\n const paddingTemplateWidth = paddingTemplate.length;\n if (paddingTemplateWidth > 1) {\n value =\n value.length >= paddingTemplateWidth\n ? value\n : new Array(\n paddingTemplateWidth - value.toString().length + 1\n ).join(\"0\") + value;\n }\n }\n }\n return value;\n}\n\nfunction xTag(imageryProvider, x, y, level) {\n return padWithZerosIfNecessary(imageryProvider, \"{x}\", x);\n}\n\nfunction reverseXTag(imageryProvider, x, y, level) {\n const reverseX =\n imageryProvider.tilingScheme.getNumberOfXTilesAtLevel(level) - x - 1;\n return padWithZerosIfNecessary(imageryProvider, \"{reverseX}\", reverseX);\n}\n\nfunction yTag(imageryProvider, x, y, level) {\n return padWithZerosIfNecessary(imageryProvider, \"{y}\", y);\n}\n\nfunction reverseYTag(imageryProvider, x, y, level) {\n const reverseY =\n imageryProvider.tilingScheme.getNumberOfYTilesAtLevel(level) - y - 1;\n return padWithZerosIfNecessary(imageryProvider, \"{reverseY}\", reverseY);\n}\n\nfunction reverseZTag(imageryProvider, x, y, level) {\n const maximumLevel = imageryProvider.maximumLevel;\n const reverseZ =\n defined(maximumLevel) && level < maximumLevel\n ? maximumLevel - level - 1\n : level;\n return padWithZerosIfNecessary(imageryProvider, \"{reverseZ}\", reverseZ);\n}\n\nfunction zTag(imageryProvider, x, y, level) {\n return padWithZerosIfNecessary(imageryProvider, \"{z}\", level);\n}\n\nfunction sTag(imageryProvider, x, y, level) {\n const index = (x + y + level) % imageryProvider._subdomains.length;\n return imageryProvider._subdomains[index];\n}\n\nfunction computeDegrees(imageryProvider, x, y, level) {\n if (degreesScratchComputed) {\n return;\n }\n\n imageryProvider.tilingScheme.tileXYToRectangle(x, y, level, degreesScratch);\n degreesScratch.west = CesiumMath.toDegrees(degreesScratch.west);\n degreesScratch.south = CesiumMath.toDegrees(degreesScratch.south);\n degreesScratch.east = CesiumMath.toDegrees(degreesScratch.east);\n degreesScratch.north = CesiumMath.toDegrees(degreesScratch.north);\n\n degreesScratchComputed = true;\n}\n\nfunction westDegreesTag(imageryProvider, x, y, level) {\n computeDegrees(imageryProvider, x, y, level);\n return degreesScratch.west;\n}\n\nfunction southDegreesTag(imageryProvider, x, y, level) {\n computeDegrees(imageryProvider, x, y, level);\n return degreesScratch.south;\n}\n\nfunction eastDegreesTag(imageryProvider, x, y, level) {\n computeDegrees(imageryProvider, x, y, level);\n return degreesScratch.east;\n}\n\nfunction northDegreesTag(imageryProvider, x, y, level) {\n computeDegrees(imageryProvider, x, y, level);\n return degreesScratch.north;\n}\n\nfunction computeProjected(imageryProvider, x, y, level) {\n if (projectedScratchComputed) {\n return;\n }\n\n imageryProvider.tilingScheme.tileXYToNativeRectangle(\n x,\n y,\n level,\n projectedScratch\n );\n\n projectedScratchComputed = true;\n}\n\nfunction westProjectedTag(imageryProvider, x, y, level) {\n computeProjected(imageryProvider, x, y, level);\n return projectedScratch.west;\n}\n\nfunction southProjectedTag(imageryProvider, x, y, level) {\n computeProjected(imageryProvider, x, y, level);\n return projectedScratch.south;\n}\n\nfunction eastProjectedTag(imageryProvider, x, y, level) {\n computeProjected(imageryProvider, x, y, level);\n return projectedScratch.east;\n}\n\nfunction northProjectedTag(imageryProvider, x, y, level) {\n computeProjected(imageryProvider, x, y, level);\n return projectedScratch.north;\n}\n\nfunction widthTag(imageryProvider, x, y, level) {\n return imageryProvider.tileWidth;\n}\n\nfunction heightTag(imageryProvider, x, y, level) {\n return imageryProvider.tileHeight;\n}\n\nfunction iTag(imageryProvider, x, y, level, longitude, latitude, format) {\n computeIJ(imageryProvider, x, y, level, longitude, latitude);\n return ijScratch.x;\n}\n\nfunction jTag(imageryProvider, x, y, level, longitude, latitude, format) {\n computeIJ(imageryProvider, x, y, level, longitude, latitude);\n return ijScratch.y;\n}\n\nfunction reverseITag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n computeIJ(imageryProvider, x, y, level, longitude, latitude);\n return imageryProvider.tileWidth - ijScratch.x - 1;\n}\n\nfunction reverseJTag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n computeIJ(imageryProvider, x, y, level, longitude, latitude);\n return imageryProvider.tileHeight - ijScratch.y - 1;\n}\n\nconst rectangleScratch = new Rectangle();\nconst longitudeLatitudeProjectedScratch = new Cartesian3();\n\nfunction computeIJ(imageryProvider, x, y, level, longitude, latitude, format) {\n if (ijScratchComputed) {\n return;\n }\n\n computeLongitudeLatitudeProjected(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude\n );\n const projected = longitudeLatitudeProjectedScratch;\n\n const rectangle = imageryProvider.tilingScheme.tileXYToNativeRectangle(\n x,\n y,\n level,\n rectangleScratch\n );\n ijScratch.x =\n ((imageryProvider.tileWidth * (projected.x - rectangle.west)) /\n rectangle.width) |\n 0;\n ijScratch.y =\n ((imageryProvider.tileHeight * (rectangle.north - projected.y)) /\n rectangle.height) |\n 0;\n ijScratchComputed = true;\n}\n\nfunction longitudeDegreesTag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n return CesiumMath.toDegrees(longitude);\n}\n\nfunction latitudeDegreesTag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n return CesiumMath.toDegrees(latitude);\n}\n\nfunction longitudeProjectedTag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n computeLongitudeLatitudeProjected(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude\n );\n return longitudeLatitudeProjectedScratch.x;\n}\n\nfunction latitudeProjectedTag(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n computeLongitudeLatitudeProjected(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude\n );\n return longitudeLatitudeProjectedScratch.y;\n}\n\nconst cartographicScratch = new Cartographic();\n\nfunction computeLongitudeLatitudeProjected(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n format\n) {\n if (longitudeLatitudeProjectedScratchComputed) {\n return;\n }\n\n if (imageryProvider.tilingScheme.projection instanceof GeographicProjection) {\n longitudeLatitudeProjectedScratch.x = CesiumMath.toDegrees(longitude);\n longitudeLatitudeProjectedScratch.y = CesiumMath.toDegrees(latitude);\n } else {\n const cartographic = cartographicScratch;\n cartographic.longitude = longitude;\n cartographic.latitude = latitude;\n imageryProvider.tilingScheme.projection.project(\n cartographic,\n longitudeLatitudeProjectedScratch\n );\n }\n\n longitudeLatitudeProjectedScratchComputed = true;\n}\n\nfunction formatTag(imageryProvider, x, y, level, longitude, latitude, format) {\n return format;\n}\nexport default UrlTemplateImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport RequestErrorEvent from \"../Core/RequestErrorEvent.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\n/**\n * @typedef {Object} TileMapServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileMapServiceImageryProvider constructor\n *\n * @property {Resource|String|Promise<Resource>|Promise<String>} [url='.'] Path to image tiles on server.\n * @property {String} [fileExtension='png'] The file extension for images on the server.\n * @property {Credit|String} [credit=''] A credit for the data source, which is displayed on the canvas.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying\n * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely\n * to result in rendering problems.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {TilingScheme} [tilingScheme] The tiling scheme specifying how the ellipsoidal\n * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}\n * is used.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Number} [tileWidth=256] Pixel width of image tiles.\n * @property {Number} [tileHeight=256] Pixel height of image tiles.\n * @property {Boolean} [flipXY] Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.\n * Specifying this option will do the same, allowing for loading of these incorrect tilesets.\n */\n\n/**\n * An imagery provider that provides tiled imagery as generated by\n * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.\n *\n * @alias TileMapServiceImageryProvider\n * @constructor\n * @extends UrlTemplateImageryProvider\n *\n * @param {TileMapServiceImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @example\n * const tms = new Cesium.TileMapServiceImageryProvider({\n * url : '../images/cesium_maptiler/Cesium_Logo_Color',\n * fileExtension: 'png',\n * maximumLevel: 4,\n * rectangle: new Cesium.Rectangle(\n * Cesium.Math.toRadians(-120.0),\n * Cesium.Math.toRadians(20.0),\n * Cesium.Math.toRadians(-60.0),\n * Cesium.Math.toRadians(40.0))\n * });\n */\nfunction TileMapServiceImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tmsResource = undefined;\n this._xmlResource = undefined;\n this._options = options;\n this._metadataError = undefined;\n\n this._metadataSuccess = this._metadataSuccess.bind(this);\n this._metadataFailure = this._metadataFailure.bind(this);\n this._requestMetadata = this._requestMetadata.bind(this);\n\n let resource;\n const that = this;\n const promise = Promise.resolve(options.url)\n .then(function (url) {\n resource = Resource.createIfNeeded(url);\n resource.appendForwardSlash();\n\n that._tmsResource = resource;\n that._xmlResource = resource.getDerivedResource({\n url: \"tilemapresource.xml\",\n });\n\n return that._requestMetadata();\n })\n .catch((e) => {\n return Promise.reject(e);\n });\n\n UrlTemplateImageryProvider.call(this, promise);\n this._promise = promise;\n}\n\nif (defined(Object.create)) {\n TileMapServiceImageryProvider.prototype = Object.create(\n UrlTemplateImageryProvider.prototype\n );\n TileMapServiceImageryProvider.prototype.constructor = TileMapServiceImageryProvider;\n}\n\nTileMapServiceImageryProvider.prototype._requestMetadata = function () {\n // Try to load remaining parameters from XML\n return this._xmlResource\n .fetchXML()\n .then(this._metadataSuccess)\n .catch((e) => {\n if (e instanceof RequestErrorEvent) {\n return this._metadataFailure();\n }\n return Promise.reject(e);\n });\n};\n\n/**\n * Mutates the properties of a given rectangle so it does not extend outside of the given tiling scheme's rectangle\n * @private\n */\nfunction confineRectangleToTilingScheme(rectangle, tilingScheme) {\n if (rectangle.west < tilingScheme.rectangle.west) {\n rectangle.west = tilingScheme.rectangle.west;\n }\n if (rectangle.east > tilingScheme.rectangle.east) {\n rectangle.east = tilingScheme.rectangle.east;\n }\n if (rectangle.south < tilingScheme.rectangle.south) {\n rectangle.south = tilingScheme.rectangle.south;\n }\n if (rectangle.north > tilingScheme.rectangle.north) {\n rectangle.north = tilingScheme.rectangle.north;\n }\n return rectangle;\n}\n\nfunction calculateSafeMinimumDetailLevel(\n tilingScheme,\n rectangle,\n minimumLevel\n) {\n // Check the number of tiles at the minimum level. If it's more than four,\n // try requesting the lower levels anyway, because starting at the higher minimum\n // level will cause too many tiles to be downloaded and rendered.\n const swTile = tilingScheme.positionToTileXY(\n Rectangle.southwest(rectangle),\n minimumLevel\n );\n const neTile = tilingScheme.positionToTileXY(\n Rectangle.northeast(rectangle),\n minimumLevel\n );\n const tileCount =\n (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n if (tileCount > 4) {\n return 0;\n }\n return minimumLevel;\n}\n\nTileMapServiceImageryProvider.prototype._metadataSuccess = function (xml) {\n const tileFormatRegex = /tileformat/i;\n const tileSetRegex = /tileset/i;\n const tileSetsRegex = /tilesets/i;\n const bboxRegex = /boundingbox/i;\n let format, bbox, tilesets;\n const tilesetsList = []; //list of TileSets\n const xmlResource = this._xmlResource;\n let metadataError = this._metadataError;\n const requestMetadata = this._requestMetadata;\n\n // Allowing options properties (already copied to that) to override XML values\n\n // Iterate XML Document nodes for properties\n const nodeList = xml.childNodes[0].childNodes;\n for (let i = 0; i < nodeList.length; i++) {\n if (tileFormatRegex.test(nodeList.item(i).nodeName)) {\n format = nodeList.item(i);\n } else if (tileSetsRegex.test(nodeList.item(i).nodeName)) {\n tilesets = nodeList.item(i); // Node list of TileSets\n const tileSetNodes = nodeList.item(i).childNodes;\n // Iterate the nodes to find all TileSets\n for (let j = 0; j < tileSetNodes.length; j++) {\n if (tileSetRegex.test(tileSetNodes.item(j).nodeName)) {\n // Add them to tilesets list\n tilesetsList.push(tileSetNodes.item(j));\n }\n }\n } else if (bboxRegex.test(nodeList.item(i).nodeName)) {\n bbox = nodeList.item(i);\n }\n }\n\n let message;\n if (!defined(tilesets) || !defined(bbox)) {\n message = `Unable to find expected tilesets or bbox attributes in ${xmlResource.url}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n this,\n this.errorEvent,\n message\n );\n if (metadataError.retry) {\n this._metadataError = metadataError;\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n const options = this._options;\n const fileExtension = defaultValue(\n options.fileExtension,\n format.getAttribute(\"extension\")\n );\n const tileWidth = defaultValue(\n options.tileWidth,\n parseInt(format.getAttribute(\"width\"), 10)\n );\n const tileHeight = defaultValue(\n options.tileHeight,\n parseInt(format.getAttribute(\"height\"), 10)\n );\n let minimumLevel = defaultValue(\n options.minimumLevel,\n parseInt(tilesetsList[0].getAttribute(\"order\"), 10)\n );\n const maximumLevel = defaultValue(\n options.maximumLevel,\n parseInt(tilesetsList[tilesetsList.length - 1].getAttribute(\"order\"), 10)\n );\n const tilingSchemeName = tilesets.getAttribute(\"profile\");\n let tilingScheme = options.tilingScheme;\n\n if (!defined(tilingScheme)) {\n if (\n tilingSchemeName === \"geodetic\" ||\n tilingSchemeName === \"global-geodetic\"\n ) {\n tilingScheme = new GeographicTilingScheme({\n ellipsoid: options.ellipsoid,\n });\n } else if (\n tilingSchemeName === \"mercator\" ||\n tilingSchemeName === \"global-mercator\"\n ) {\n tilingScheme = new WebMercatorTilingScheme({\n ellipsoid: options.ellipsoid,\n });\n } else {\n message = `${xmlResource.url}specifies an unsupported profile attribute, ${tilingSchemeName}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n this,\n this.errorEvent,\n message\n );\n if (metadataError.retry) {\n this._metadataError = metadataError;\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n }\n\n // rectangle handling\n let rectangle = Rectangle.clone(options.rectangle);\n\n if (!defined(rectangle)) {\n let sw;\n let ne;\n let swXY;\n let neXY;\n\n // In older versions of gdal x and y values were flipped, which is why we check for an option to flip\n // the values here as well. Unfortunately there is no way to autodetect whether flipping is needed.\n const flipXY = defaultValue(options.flipXY, false);\n if (flipXY) {\n swXY = new Cartesian2(\n parseFloat(bbox.getAttribute(\"miny\")),\n parseFloat(bbox.getAttribute(\"minx\"))\n );\n neXY = new Cartesian2(\n parseFloat(bbox.getAttribute(\"maxy\")),\n parseFloat(bbox.getAttribute(\"maxx\"))\n );\n } else {\n swXY = new Cartesian2(\n parseFloat(bbox.getAttribute(\"minx\")),\n parseFloat(bbox.getAttribute(\"miny\"))\n );\n neXY = new Cartesian2(\n parseFloat(bbox.getAttribute(\"maxx\")),\n parseFloat(bbox.getAttribute(\"maxy\"))\n );\n }\n\n // Determine based on the profile attribute if this tileset was generated by gdal2tiles.py, which\n // uses 'mercator' and 'geodetic' profiles, or by a tool compliant with the TMS standard, which is\n // 'global-mercator' and 'global-geodetic' profiles. In the gdal2Tiles case, X and Y are always in\n // geodetic degrees.\n const isGdal2tiles =\n tilingSchemeName === \"geodetic\" || tilingSchemeName === \"mercator\";\n if (\n tilingScheme.projection instanceof GeographicProjection ||\n isGdal2tiles\n ) {\n sw = Cartographic.fromDegrees(swXY.x, swXY.y);\n ne = Cartographic.fromDegrees(neXY.x, neXY.y);\n } else {\n const projection = tilingScheme.projection;\n sw = projection.unproject(swXY);\n ne = projection.unproject(neXY);\n }\n\n rectangle = new Rectangle(\n sw.longitude,\n sw.latitude,\n ne.longitude,\n ne.latitude\n );\n }\n\n // The rectangle must not be outside the bounds allowed by the tiling scheme.\n rectangle = confineRectangleToTilingScheme(rectangle, tilingScheme);\n // clamp our minimum detail level to something that isn't going to request a ridiculous number of tiles\n minimumLevel = calculateSafeMinimumDetailLevel(\n tilingScheme,\n rectangle,\n minimumLevel\n );\n\n const templateResource = this._tmsResource.getDerivedResource({\n url: `{z}/{x}/{reverseY}.${fileExtension}`,\n });\n\n return Promise.resolve({\n url: templateResource,\n tilingScheme: tilingScheme,\n rectangle: rectangle,\n tileWidth: tileWidth,\n tileHeight: tileHeight,\n minimumLevel: minimumLevel,\n maximumLevel: maximumLevel,\n tileDiscardPolicy: options.tileDiscardPolicy,\n credit: options.credit,\n });\n};\n\nTileMapServiceImageryProvider.prototype._metadataFailure = function () {\n // Can't load XML, still allow options and defaults\n const options = this._options;\n const fileExtension = defaultValue(options.fileExtension, \"png\");\n const tileWidth = defaultValue(options.tileWidth, 256);\n const tileHeight = defaultValue(options.tileHeight, 256);\n const maximumLevel = options.maximumLevel;\n const tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid });\n\n let rectangle = defaultValue(options.rectangle, tilingScheme.rectangle);\n // The rectangle must not be outside the bounds allowed by the tiling scheme.\n rectangle = confineRectangleToTilingScheme(rectangle, tilingScheme);\n\n // make sure we use a safe minimum detail level, so we don't request a ridiculous number of tiles\n const minimumLevel = calculateSafeMinimumDetailLevel(\n tilingScheme,\n rectangle,\n options.minimumLevel\n );\n\n const templateResource = this._tmsResource.getDerivedResource({\n url: `{z}/{x}/{reverseY}.${fileExtension}`,\n });\n\n return Promise.resolve({\n url: templateResource,\n tilingScheme: tilingScheme,\n rectangle: rectangle,\n tileWidth: tileWidth,\n tileHeight: tileHeight,\n minimumLevel: minimumLevel,\n maximumLevel: maximumLevel,\n tileDiscardPolicy: options.tileDiscardPolicy,\n credit: options.credit,\n });\n};\n\nexport default TileMapServiceImageryProvider;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {Object} GoogleEarthEnterpriseMapsProvider.ConstructorOptions\n *\n * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor\n *\n * @property {Resource|String} url The url of the Google Earth server hosting the imagery.\n * @property {Number} channel The channel (id) to be used when requesting data from the server.\n * The channel number can be found by looking at the json file located at:\n * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may\n * differ depending on your Google Earth Enterprise server configuration. Look for the \"id\" that\n * is associated with a \"ImageryMaps\" requestType. There may be more than one id available.\n * Example:\n * {\n * layers: [\n * {\n * id: 1002,\n * requestType: \"ImageryMaps\"\n * },\n * {\n * id: 1007,\n * requestType: \"VectorMapsRaster\"\n * }\n * ]\n * }\n * @property {String} [path=\"/default_map\"] The path of the Google Earth server hosting the imagery.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the Google Earth\n * Enterprise server, or undefined if there is no limit.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass\n * a {@link NeverTileDiscardPolicy} for this parameter.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Provides tiled imagery using the Google Earth Imagery API.\n *\n * Notes: This imagery provider does not work with the public Google Earth servers. It works with the\n * Google Earth Enterprise Server.\n *\n * By default the Google Earth Enterprise server does not set the\n * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either\n * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf\n * and add the 'Header set Access-Control-Allow-Origin \"*\"' option to the '<Directory />' and\n * '<Directory \"/opt/google/gehttpd/htdocs\">' directives.\n *\n * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it\n * is necessary to use {@link GoogleEarthEnterpriseImageryProvider}\n *\n * @alias GoogleEarthEnterpriseMapsProvider\n * @constructor\n *\n * @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} options Object describing initialization options\n *\n * @exception {RuntimeError} Could not find layer with channel (id) of <code>options.channel</code>.\n * @exception {RuntimeError} Could not find a version in channel (id) <code>options.channel</code>.\n * @exception {RuntimeError} Unsupported projection <code>data.projection</code>.\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const google = new Cesium.GoogleEarthEnterpriseMapsProvider({\n * url : 'https://earth.localdomain',\n * channel : 1008\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseMapsProvider(options) {\n options = defaultValue(options, {});\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default 1.9\n */\n this.defaultGamma = 1.9;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const url = options.url;\n const path = defaultValue(options.path, \"/default_map\");\n\n const resource = Resource.createIfNeeded(url).getDerivedResource({\n // We used to just append path to url, so now that we do proper URI resolution, removed the /\n url: path[0] === \"/\" ? path.substring(1) : path,\n });\n\n resource.appendForwardSlash();\n\n this._resource = resource;\n this._url = url;\n this._path = path;\n this._tileDiscardPolicy = options.tileDiscardPolicy;\n this._channel = options.channel;\n this._requestType = \"ImageryMaps\";\n this._credit = new Credit(\n `<a href=\"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html\"><img src=\"${GoogleEarthEnterpriseMapsProvider.logoUrl}\" title=\"Google Imagery\"/></a>`\n );\n\n this._tilingScheme = undefined;\n\n this._version = undefined;\n\n this._tileWidth = 256;\n this._tileHeight = 256;\n this._maximumLevel = options.maximumLevel;\n\n this._errorEvent = new Event();\n\n this._ready = false;\n const metadataResource = resource.getDerivedResource({\n url: \"query\",\n queryParameters: {\n request: \"Json\",\n vars: \"geeServerDefs\",\n is2d: \"t\",\n },\n });\n const that = this;\n let metadataError;\n\n function metadataSuccess(text) {\n let data;\n\n // The Google Earth server sends malformed JSON data currently...\n try {\n // First, try parsing it like normal in case a future version sends correctly formatted JSON\n data = JSON.parse(text);\n } catch (e) {\n // Quote object strings manually, then try parsing again\n data = JSON.parse(\n text.replace(/([\\[\\{,])[\\n\\r ]*([A-Za-z0-9]+)[\\n\\r ]*:/g, '$1\"$2\":')\n );\n }\n\n let layer;\n for (let i = 0; i < data.layers.length; i++) {\n if (data.layers[i].id === that._channel) {\n layer = data.layers[i];\n break;\n }\n }\n\n let message;\n\n if (!defined(layer)) {\n message = `Could not find layer with channel (id) of ${that._channel}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n if (!defined(layer.version)) {\n message = `Could not find a version in channel (id) ${that._channel}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n that._version = layer.version;\n\n if (defined(data.projection) && data.projection === \"flat\") {\n that._tilingScheme = new GeographicTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 2,\n rectangle: new Rectangle(-Math.PI, -Math.PI, Math.PI, Math.PI),\n ellipsoid: options.ellipsoid,\n });\n // Default to mercator projection when projection is undefined\n } else if (!defined(data.projection) || data.projection === \"mercator\") {\n that._tilingScheme = new WebMercatorTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 2,\n ellipsoid: options.ellipsoid,\n });\n } else {\n message = `Unsupported projection ${data.projection}.`;\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n if (metadataError.retry) {\n return requestMetadata();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n that._ready = true;\n TileProviderError.reportSuccess(metadataError);\n return Promise.resolve(true);\n }\n\n function metadataFailure(e) {\n const message = defaultValue(\n e.message,\n `An error occurred while accessing ${metadataResource.url}.`\n );\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n message\n );\n return Promise.reject(new RuntimeError(message));\n }\n\n function requestMetadata() {\n return metadataResource\n .fetchText()\n .then(metadataSuccess)\n .catch(metadataFailure);\n }\n\n this._readyPromise = requestMetadata();\n}\n\nObject.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, {\n /**\n * Gets the URL of the Google Earth MapServer.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._url;\n },\n },\n\n /**\n * Gets the url path of the data on the Google Earth server.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {String}\n * @readonly\n */\n path: {\n get: function () {\n return this._path;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the imagery channel (id) currently being used.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number}\n * @readonly\n */\n channel: {\n get: function () {\n return this._channel;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the version of the data used by this provider. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Number}\n * @readonly\n */\n version: {\n get: function () {\n return this._version;\n },\n },\n\n /**\n * Gets the type of data that is being requested from the provider. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {String}\n * @readonly\n */\n requestType: {\n get: function () {\n return this._requestType;\n },\n },\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof GoogleEarthEnterpriseMapsProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const resource = this._resource.getDerivedResource({\n url: \"query\",\n request: request,\n queryParameters: {\n request: this._requestType,\n channel: this._channel,\n version: this._version,\n x: x,\n y: y,\n z: level + 1, // Google Earth starts with a zoom level of 1, not 0\n },\n });\n\n return ImageryProvider.loadImage(this, resource);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGoogleEarthEnterpriseMapsProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\n\nGoogleEarthEnterpriseMapsProvider._logoUrl = undefined;\n\nObject.defineProperties(GoogleEarthEnterpriseMapsProvider, {\n /**\n * Gets or sets the URL to the Google Earth logo for display in the credit.\n * @memberof GoogleEarthEnterpriseMapsProvider\n * @type {String}\n */\n logoUrl: {\n get: function () {\n if (!defined(GoogleEarthEnterpriseMapsProvider._logoUrl)) {\n GoogleEarthEnterpriseMapsProvider._logoUrl = buildModuleUrl(\n \"Assets/Images/google_earth_credit.png\"\n );\n }\n return GoogleEarthEnterpriseMapsProvider._logoUrl;\n },\n set: function (value) {\n GoogleEarthEnterpriseMapsProvider._logoUrl = value;\n },\n },\n});\nexport default GoogleEarthEnterpriseMapsProvider;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst trailingSlashRegex = /\\/$/;\nconst defaultCredit = new Credit(\n '© <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>'\n);\n\n/**\n * @typedef {Object} MapboxImageryProvider.ConstructorOptions\n *\n * Initialization options for the MapboxImageryProvider constructor\n *\n * @property {String} [url='https://api.mapbox.com/v4/'] The Mapbox server url.\n * @property {String} mapId The Mapbox Map ID.\n * @property {String} accessToken The public access token for the imagery.\n * @property {String} [format='png'] The format of the image request.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying\n * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely\n * to result in rendering problems.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Provides tiled imagery hosted by Mapbox.\n *\n * @alias MapboxImageryProvider\n * @constructor\n *\n * @param {MapboxImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Mapbox tile provider\n * const mapbox = new Cesium.MapboxImageryProvider({\n * mapId: 'mapbox.streets',\n * accessToken: 'thisIsMyAccessToken'\n * });\n *\n * @see {@link https://www.mapbox.com/developers/api/maps/#tiles}\n * @see {@link https://www.mapbox.com/developers/api/#access-tokens}\n */\nfunction MapboxImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const mapId = options.mapId;\n const accessToken = options.accessToken;\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const resource = Resource.createIfNeeded(\n defaultValue(options.url, \"https://{s}.tiles.mapbox.com/v4/\")\n );\n\n this._mapId = mapId;\n this._accessToken = accessToken;\n\n let format = defaultValue(options.format, \"png\");\n if (!/\\./.test(format)) {\n format = `.${format}`;\n }\n this._format = format;\n\n let templateUrl = resource.getUrlComponent();\n if (!trailingSlashRegex.test(templateUrl)) {\n templateUrl += \"/\";\n }\n templateUrl += `${mapId}/{z}/{x}/{y}${this._format}`;\n resource.url = templateUrl;\n\n resource.setQueryParameters({\n access_token: accessToken,\n });\n\n let credit;\n if (defined(options.credit)) {\n credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n } else {\n credit = defaultCredit;\n }\n\n this._resource = resource;\n this._imageryProvider = new UrlTemplateImageryProvider({\n url: resource,\n credit: credit,\n ellipsoid: options.ellipsoid,\n minimumLevel: options.minimumLevel,\n maximumLevel: options.maximumLevel,\n rectangle: options.rectangle,\n });\n}\n\nObject.defineProperties(MapboxImageryProvider.prototype, {\n /**\n * Gets the URL of the Mapbox server.\n * @memberof MapboxImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._imageryProvider.url;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof MapboxImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._imageryProvider.ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof MapboxImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._imageryProvider.readyPromise;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._imageryProvider.rectangle;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._imageryProvider.tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._imageryProvider.tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._imageryProvider.maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true. Generally,\n * a minimum level should only be used when the rectangle of the imagery is small\n * enough that the number of tiles at the minimum level is small. An imagery\n * provider with more than a few tiles at the minimum level will lead to\n * rendering problems.\n * @memberof MapboxImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return this._imageryProvider.minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by the provider. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._imageryProvider.tilingScheme;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._imageryProvider.tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof MapboxImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._imageryProvider.errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n * @memberof MapboxImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._imageryProvider.credit;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof MapboxImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._imageryProvider.proxy;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof MapboxImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return this._imageryProvider.hasAlphaChannel;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nMapboxImageryProvider.prototype.getTileCredits = function (x, y, level) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link MapboxImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nMapboxImageryProvider.prototype.requestImage = function (x, y, level, request) {\n return this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.\n * This function is optional, so it may not exist on all ImageryProviders.\n *\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nMapboxImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n// Exposed for tests\nMapboxImageryProvider._defaultCredit = defaultCredit;\nexport default MapboxImageryProvider;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\n\n/**\n * @typedef {Object} SingleTileImageryProvider.ConstructorOptions\n *\n * Initialization options for the SingleTileImageryProvider constructor\n *\n * @property {Resource|String} url The url for the tile.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n */\n\n/**\n * Provides a single, top-level imagery tile. The single image is assumed to use a\n * {@link GeographicTilingScheme}.\n *\n * @alias SingleTileImageryProvider\n * @constructor\n *\n * @param {SingleTileImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n */\nfunction SingleTileImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const resource = Resource.createIfNeeded(options.url);\n\n const rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n const tilingScheme = new GeographicTilingScheme({\n rectangle: rectangle,\n numberOfLevelZeroTilesX: 1,\n numberOfLevelZeroTilesY: 1,\n ellipsoid: options.ellipsoid,\n });\n this._tilingScheme = tilingScheme;\n this._resource = resource;\n this._image = undefined;\n this._texture = undefined;\n this._tileWidth = 0;\n this._tileHeight = 0;\n\n this._errorEvent = new Event();\n\n this._ready = false;\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n const that = this;\n let error;\n\n function success(image) {\n that._image = image;\n that._tileWidth = image.width;\n that._tileHeight = image.height;\n that._ready = true;\n TileProviderError.reportSuccess(that._errorEvent);\n return Promise.resolve(true);\n }\n\n function failure(e) {\n const message = `Failed to load image ${resource.url}.`;\n error = TileProviderError.reportError(\n error,\n that,\n that._errorEvent,\n message,\n 0,\n 0,\n 0\n );\n if (error.retry) {\n return doRequest();\n }\n return Promise.reject(new RuntimeError(message));\n }\n\n function doRequest() {\n return ImageryProvider.loadImage(null, resource)\n .then(success)\n .catch(failure);\n }\n\n this._readyPromise = doRequest();\n}\n\nObject.defineProperties(SingleTileImageryProvider.prototype, {\n /**\n * Gets the URL of the single, top-level imagery tile.\n * @memberof SingleTileImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof SingleTileImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nSingleTileImageryProvider.prototype.getTileCredits = function (x, y, level) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link SingleTileImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} The resolved image\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nSingleTileImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n if (!defined(this._image)) {\n return;\n }\n\n return Promise.resolve(this._image);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nSingleTileImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default SingleTileImageryProvider;\n", "import Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ImageryLayerFeatureInfo from \"./ImageryLayerFeatureInfo.js\";\n\n/**\n * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.\n *\n * @alias GetFeatureInfoFormat\n * @constructor\n *\n * @param {String} type The type of response to expect from a GetFeatureInfo request. Valid\n * values are 'json', 'xml', 'html', or 'text'.\n * @param {String} [format] The info format to request from the WMS server. This is usually a\n * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'\n * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.\n * @param {Function} [callback] A function to invoke with the GetFeatureInfo response from the WMS server\n * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,\n * a default function for the type of response is used.\n */\nfunction GetFeatureInfoFormat(type, format, callback) {\n this.type = type;\n\n if (!defined(format)) {\n if (type === \"json\") {\n format = \"application/json\";\n } else if (type === \"xml\") {\n format = \"text/xml\";\n } else if (type === \"html\") {\n format = \"text/html\";\n } else if (type === \"text\") {\n format = \"text/plain\";\n }\n}\n\n this.format = format;\n\n if (!defined(callback)) {\n if (type === \"json\") {\n callback = geoJsonToFeatureInfo;\n } else if (type === \"xml\") {\n callback = xmlToFeatureInfo;\n } else if (type === \"html\") {\n callback = textToFeatureInfo;\n } else if (type === \"text\") {\n callback = textToFeatureInfo;\n }\n}\n\n this.callback = callback;\n}\n\nfunction geoJsonToFeatureInfo(json) {\n const result = [];\n\n const features = json.features;\n for (let i = 0; i < features.length; ++i) {\n const feature = features[i];\n\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.data = feature;\n featureInfo.properties = feature.properties;\n featureInfo.configureNameFromProperties(feature.properties);\n featureInfo.configureDescriptionFromProperties(feature.properties);\n\n // If this is a point feature, use the coordinates of the point.\n if (defined(feature.geometry) && feature.geometry.type === \"Point\") {\n const longitude = feature.geometry.coordinates[0];\n const latitude = feature.geometry.coordinates[1];\n featureInfo.position = Cartographic.fromDegrees(longitude, latitude);\n }\n\n result.push(featureInfo);\n }\n\n return result;\n}\n\nconst mapInfoMxpNamespace = \"http://www.mapinfo.com/mxp\";\nconst esriWmsNamespace = \"http://www.esri.com/wms\";\nconst wfsNamespace = \"http://www.opengis.net/wfs\";\nconst gmlNamespace = \"http://www.opengis.net/gml\";\n\nfunction xmlToFeatureInfo(xml) {\n const documentElement = xml.documentElement;\n if (\n documentElement.localName === \"MultiFeatureCollection\" &&\n documentElement.namespaceURI === mapInfoMxpNamespace\n ) {\n // This looks like a MapInfo MXP response\n return mapInfoXmlToFeatureInfo(xml);\n } else if (\n documentElement.localName === \"FeatureInfoResponse\" &&\n documentElement.namespaceURI === esriWmsNamespace\n ) {\n // This looks like an Esri WMS response\n return esriXmlToFeatureInfo(xml);\n } else if (\n documentElement.localName === \"FeatureCollection\" &&\n documentElement.namespaceURI === wfsNamespace\n ) {\n // This looks like a WFS/GML response.\n return gmlToFeatureInfo(xml);\n } else if (documentElement.localName === \"ServiceExceptionReport\") {\n // This looks like a WMS server error, so no features picked.\n throw new RuntimeError(\n new XMLSerializer().serializeToString(documentElement)\n );\n } else if (documentElement.localName === \"msGMLOutput\") {\n return msGmlToFeatureInfo(xml);\n } else {\n // Unknown response type, so just dump the XML itself into the description.\n return unknownXmlToFeatureInfo(xml);\n }\n}\n\nfunction mapInfoXmlToFeatureInfo(xml) {\n const result = [];\n\n const multiFeatureCollection = xml.documentElement;\n\n const features = multiFeatureCollection.getElementsByTagNameNS(\n mapInfoMxpNamespace,\n \"Feature\"\n );\n for (let featureIndex = 0; featureIndex < features.length; ++featureIndex) {\n const feature = features[featureIndex];\n\n const properties = {};\n\n const propertyElements = feature.getElementsByTagNameNS(\n mapInfoMxpNamespace,\n \"Val\"\n );\n for (\n let propertyIndex = 0;\n propertyIndex < propertyElements.length;\n ++propertyIndex\n ) {\n const propertyElement = propertyElements[propertyIndex];\n if (propertyElement.hasAttribute(\"ref\")) {\n const name = propertyElement.getAttribute(\"ref\");\n const value = propertyElement.textContent.trim();\n properties[name] = value;\n }\n }\n\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.data = feature;\n featureInfo.properties = properties;\n featureInfo.configureNameFromProperties(properties);\n featureInfo.configureDescriptionFromProperties(properties);\n result.push(featureInfo);\n }\n\n return result;\n}\n\nfunction esriXmlToFeatureInfo(xml) {\n const featureInfoResponse = xml.documentElement;\n const result = [];\n let properties;\n\n const features = featureInfoResponse.getElementsByTagNameNS(\"*\", \"FIELDS\");\n if (features.length > 0) {\n // Standard esri format\n for (let featureIndex = 0; featureIndex < features.length; ++featureIndex) {\n const feature = features[featureIndex];\n\n properties = {};\n\n const propertyAttributes = feature.attributes;\n for (\n let attributeIndex = 0;\n attributeIndex < propertyAttributes.length;\n ++attributeIndex\n ) {\n const attribute = propertyAttributes[attributeIndex];\n properties[attribute.name] = attribute.value;\n }\n\n result.push(\n imageryLayerFeatureInfoFromDataAndProperties(feature, properties)\n );\n }\n } else {\n // Thredds format -- looks like esri, but instead of containing FIELDS, contains FeatureInfo element\n const featureInfoElements = featureInfoResponse.getElementsByTagNameNS(\n \"*\",\n \"FeatureInfo\"\n );\n for (\n let featureInfoElementIndex = 0;\n featureInfoElementIndex < featureInfoElements.length;\n ++featureInfoElementIndex\n ) {\n const featureInfoElement = featureInfoElements[featureInfoElementIndex];\n\n properties = {};\n\n // node.children is not supported in IE9-11, so use childNodes and check that child.nodeType is an element\n const featureInfoChildren = featureInfoElement.childNodes;\n for (\n let childIndex = 0;\n childIndex < featureInfoChildren.length;\n ++childIndex\n ) {\n const child = featureInfoChildren[childIndex];\n if (child.nodeType === Node.ELEMENT_NODE) {\n properties[child.localName] = child.textContent;\n }\n }\n\n result.push(\n imageryLayerFeatureInfoFromDataAndProperties(\n featureInfoElement,\n properties\n )\n );\n }\n }\n\n return result;\n}\n\nfunction gmlToFeatureInfo(xml) {\n const result = [];\n\n const featureCollection = xml.documentElement;\n\n const featureMembers = featureCollection.getElementsByTagNameNS(\n gmlNamespace,\n \"featureMember\"\n );\n for (\n let featureIndex = 0;\n featureIndex < featureMembers.length;\n ++featureIndex\n ) {\n const featureMember = featureMembers[featureIndex];\n\n const properties = {};\n getGmlPropertiesRecursively(featureMember, properties);\n result.push(\n imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties)\n );\n }\n\n return result;\n}\n\n// msGmlToFeatureInfo is similar to gmlToFeatureInfo, but assumes different XML structure\n// eg. <msGMLOutput> <ABC_layer> <ABC_feature> <foo>bar</foo> ... </ABC_feature> </ABC_layer> </msGMLOutput>\n\nfunction msGmlToFeatureInfo(xml) {\n const result = [];\n\n // Find the first child. Except for IE, this would work:\n // const layer = xml.documentElement.children[0];\n let layer;\n const children = xml.documentElement.childNodes;\n for (let i = 0; i < children.length; i++) {\n if (children[i].nodeType === Node.ELEMENT_NODE) {\n layer = children[i];\n break;\n }\n }\n if (!defined(layer)) {\n throw new RuntimeError(\n \"Unable to find first child of the feature info xml document\"\n );\n }\n const featureMembers = layer.childNodes;\n for (\n let featureIndex = 0;\n featureIndex < featureMembers.length;\n ++featureIndex\n ) {\n const featureMember = featureMembers[featureIndex];\n if (featureMember.nodeType === Node.ELEMENT_NODE) {\n const properties = {};\n getGmlPropertiesRecursively(featureMember, properties);\n result.push(\n imageryLayerFeatureInfoFromDataAndProperties(featureMember, properties)\n );\n }\n }\n\n return result;\n}\n\nfunction getGmlPropertiesRecursively(gmlNode, properties) {\n let isSingleValue = true;\n\n for (let i = 0; i < gmlNode.childNodes.length; ++i) {\n const child = gmlNode.childNodes[i];\n\n if (child.nodeType === Node.ELEMENT_NODE) {\n isSingleValue = false;\n }\n\n if (\n child.localName === \"Point\" ||\n child.localName === \"LineString\" ||\n child.localName === \"Polygon\" ||\n child.localName === \"boundedBy\"\n ) {\n continue;\n }\n\n if (\n child.hasChildNodes() &&\n getGmlPropertiesRecursively(child, properties)\n ) {\n properties[child.localName] = child.textContent;\n }\n }\n\n return isSingleValue;\n}\n\nfunction imageryLayerFeatureInfoFromDataAndProperties(data, properties) {\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.data = data;\n featureInfo.properties = properties;\n featureInfo.configureNameFromProperties(properties);\n featureInfo.configureDescriptionFromProperties(properties);\n return featureInfo;\n}\n\nfunction unknownXmlToFeatureInfo(xml) {\n const xmlText = new XMLSerializer().serializeToString(xml);\n\n const element = document.createElement(\"div\");\n const pre = document.createElement(\"pre\");\n pre.textContent = xmlText;\n element.appendChild(pre);\n\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.data = xml;\n featureInfo.description = element.innerHTML;\n return [featureInfo];\n}\n\nconst emptyBodyRegex = /<body>\\s*<\\/body>/im;\nconst wmsServiceExceptionReportRegex = /<ServiceExceptionReport([\\s\\S]*)<\\/ServiceExceptionReport>/im;\nconst titleRegex = /<title>([\\s\\S]*)<\\/title>/im;\n\nfunction textToFeatureInfo(text) {\n // If the text is HTML and it has an empty body tag, assume it means no features were found.\n if (emptyBodyRegex.test(text)) {\n return undefined;\n }\n\n // If this is a WMS exception report, treat it as \"no features found\" rather than showing\n // bogus feature info.\n if (wmsServiceExceptionReportRegex.test(text)) {\n return undefined;\n }\n\n // If the text has a <title> element, use it as the name.\n let name;\n const title = titleRegex.exec(text);\n if (title && title.length > 1) {\n name = title[1];\n }\n\n const featureInfo = new ImageryLayerFeatureInfo();\n featureInfo.name = name;\n featureInfo.description = text;\n featureInfo.data = text;\n return [featureInfo];\n}\nexport default GetFeatureInfoFormat;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestType from \"../Core/RequestType.js\";\n\n/**\n * Provides functionality for ImageryProviders that have time dynamic imagery\n *\n * @alias TimeDynamicImagery\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Clock} options.clock A Clock instance that is used when determining the value for the time dimension. Required when <code>options.times</code> is specified.\n * @param {TimeIntervalCollection} options.times TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.\n * @param {Function} options.requestImageFunction A function that will request imagery tiles.\n * @param {Function} options.reloadFunction A function that will be called when all imagery tiles need to be reloaded.\n */\nfunction TimeDynamicImagery(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tileCache = {};\n this._tilesRequestedForInterval = [];\n\n const clock = (this._clock = options.clock);\n this._times = options.times;\n this._requestImageFunction = options.requestImageFunction;\n this._reloadFunction = options.reloadFunction;\n this._currentIntervalIndex = -1;\n\n clock.onTick.addEventListener(this._clockOnTick, this);\n this._clockOnTick(clock);\n}\n\nObject.defineProperties(TimeDynamicImagery.prototype, {\n /**\n * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n * @memberof TimeDynamicImagery.prototype\n * @type {Clock}\n */\n clock: {\n get: function () {\n return this._clock;\n },\n set: function (value) {\n if (this._clock !== value) {\n this._clock = value;\n this._clockOnTick(value);\n this._reloadFunction();\n }\n },\n },\n /**\n * Gets or sets a time interval collection.\n * @memberof TimeDynamicImagery.prototype\n * @type {TimeIntervalCollection}\n */\n times: {\n get: function () {\n return this._times;\n },\n set: function (value) {\n if (this._times !== value) {\n this._times = value;\n this._clockOnTick(this._clock);\n this._reloadFunction();\n }\n },\n },\n /**\n * Gets the current interval.\n * @memberof TimeDynamicImagery.prototype\n * @type {TimeInterval}\n */\n currentInterval: {\n get: function () {\n return this._times.get(this._currentIntervalIndex);\n },\n },\n});\n\n/**\n * Gets the tile from the cache if its available.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n *\n * @returns {Promise.<HTMLImageElement>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if the tile is not in the cache.\n */\nTimeDynamicImagery.prototype.getFromCache = function (x, y, level, request) {\n const key = getKey(x, y, level);\n let result;\n const cache = this._tileCache[this._currentIntervalIndex];\n if (defined(cache) && defined(cache[key])) {\n const item = cache[key];\n result = item.promise.catch(function (e) {\n // Set the correct state in case it was cancelled\n request.state = item.request.state;\n throw e;\n });\n delete cache[key];\n }\n\n return result;\n};\n\n/**\n * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will\n * just add the tile to a list to preload when we approach the next interval.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n */\nTimeDynamicImagery.prototype.checkApproachingInterval = function (\n x,\n y,\n level,\n request\n) {\n const key = getKey(x, y, level);\n const tilesRequestedForInterval = this._tilesRequestedForInterval;\n\n // If we are approaching an interval, preload this tile in the next interval\n const approachingInterval = getApproachingInterval(this);\n const tile = {\n key: key,\n // Determines priority based on camera distance to the tile.\n // Since the imagery regardless of time will be attached to the same tile we can just steal it.\n priorityFunction: request.priorityFunction,\n };\n if (\n !defined(approachingInterval) ||\n !addToCache(this, tile, approachingInterval)\n ) {\n // Add to recent request list if we aren't approaching and interval or the request was throttled\n tilesRequestedForInterval.push(tile);\n }\n\n // Don't let the tile list get out of hand\n if (tilesRequestedForInterval.length >= 512) {\n tilesRequestedForInterval.splice(0, 256);\n }\n};\n\nTimeDynamicImagery.prototype._clockOnTick = function (clock) {\n const time = clock.currentTime;\n const times = this._times;\n const index = times.indexOf(time);\n const currentIntervalIndex = this._currentIntervalIndex;\n\n if (index !== currentIntervalIndex) {\n // Cancel all outstanding requests and clear out caches not from current time interval\n const currentCache = this._tileCache[currentIntervalIndex];\n for (const t in currentCache) {\n if (currentCache.hasOwnProperty(t)) {\n currentCache[t].request.cancel();\n }\n }\n delete this._tileCache[currentIntervalIndex];\n this._tilesRequestedForInterval = [];\n\n this._currentIntervalIndex = index;\n this._reloadFunction();\n\n return;\n }\n\n const approachingInterval = getApproachingInterval(this);\n if (defined(approachingInterval)) {\n // Start loading recent tiles from end of this._tilesRequestedForInterval\n // We keep preloading until we hit a throttling limit.\n const tilesRequested = this._tilesRequestedForInterval;\n let success = true;\n while (success) {\n if (tilesRequested.length === 0) {\n break;\n }\n\n const tile = tilesRequested.pop();\n success = addToCache(this, tile, approachingInterval);\n if (!success) {\n tilesRequested.push(tile);\n }\n }\n }\n};\n\nfunction getKey(x, y, level) {\n return `${x}-${y}-${level}`;\n}\n\nfunction getKeyElements(key) {\n const s = key.split(\"-\");\n if (s.length !== 3) {\n return undefined;\n }\n\n return {\n x: Number(s[0]),\n y: Number(s[1]),\n level: Number(s[2]),\n };\n}\n\nfunction getApproachingInterval(that) {\n const times = that._times;\n if (!defined(times)) {\n return undefined;\n }\n const clock = that._clock;\n const time = clock.currentTime;\n const isAnimating = clock.canAnimate && clock.shouldAnimate;\n const multiplier = clock.multiplier;\n\n if (!isAnimating && multiplier !== 0) {\n return undefined;\n }\n\n let seconds;\n let index = times.indexOf(time);\n if (index < 0) {\n return undefined;\n }\n\n const interval = times.get(index);\n if (multiplier > 0) {\n // animating forward\n seconds = JulianDate.secondsDifference(interval.stop, time);\n ++index;\n } else {\n //backwards\n seconds = JulianDate.secondsDifference(interval.start, time); // Will be negative\n --index;\n }\n seconds /= multiplier; // Will always be positive\n\n // Less than 5 wall time seconds\n return index >= 0 && seconds <= 5.0 ? times.get(index) : undefined;\n}\n\nfunction addToCache(that, tile, interval) {\n const index = that._times.indexOf(interval.start);\n const tileCache = that._tileCache;\n let intervalTileCache = tileCache[index];\n if (!defined(intervalTileCache)) {\n intervalTileCache = tileCache[index] = {};\n }\n\n const key = tile.key;\n if (defined(intervalTileCache[key])) {\n return true; // Already in the cache\n }\n\n const keyElements = getKeyElements(key);\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.IMAGERY,\n priorityFunction: tile.priorityFunction,\n });\n const promise = that._requestImageFunction(\n keyElements.x,\n keyElements.y,\n keyElements.level,\n request,\n interval\n );\n if (!defined(promise)) {\n return false;\n }\n\n intervalTileCache[key] = {\n promise: promise,\n request: request,\n };\n\n return true;\n}\nexport default TimeDynamicImagery;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport GetFeatureInfoFormat from \"./GetFeatureInfoFormat.js\";\nimport TimeDynamicImagery from \"./TimeDynamicImagery.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\n/**\n * EPSG codes known to include reverse axis orders, but are not within 4000-5000.\n *\n * @type {number[]}\n */\nconst includesReverseAxis = [\n 3034, // ETRS89-extended / LCC Europe\n 3035, // ETRS89-extended / LAEA Europe\n 3042, // ETRS89 / UTM zone 30N (N-E)\n 3043, // ETRS89 / UTM zone 31N (N-E)\n 3044, // ETRS89 / UTM zone 32N (N-E)\n];\n\n/**\n * EPSG codes known to not include reverse axis orders, and are within 4000-5000.\n *\n * @type {number[]}\n */\nconst excludesReverseAxis = [\n 4471, // Mayotte\n 4559, // French Antilles\n];\n\n/**\n * @typedef {Object} WebMapServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the WebMapServiceImageryProvider constructor\n *\n * @property {Resource|String} url The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.\n * @property {String} layers The layers to include, separated by commas.\n * @property {Object} [parameters=WebMapServiceImageryProvider.DefaultParameters] Additional parameters to pass to the WMS server in the GetMap URL.\n * @property {Object} [getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL.\n * @property {Boolean} [enablePickFeatures=true] If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke\n * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,\n * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)\n * without communicating with the server. Set this property to false if you know your WMS server does not support\n * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically\n * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.\n * @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats\n * in which to try WMS GetFeatureInfo requests.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Number} [tileWidth=256] The width of each tile in pixels.\n * @property {Number} [tileHeight=256] The height of each tile in pixels.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when\n * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is\n * likely to result in rendering problems.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * If not specified, there is no limit.\n * @property {String} [crs] CRS specification, for use with WMS specification >= 1.3.0.\n * @property {String} [srs] SRS specification, for use with WMS specification 1.1.0 or 1.1.1\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {String|String[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n * If this parameter is a single string, each character in the string is a subdomain. If it is\n * an array, each element in the array is a subdomain.\n * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.\n * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.\n * @property {Resource|String} [getFeatureInfoUrl] The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.\n */\n\n/**\n * Provides tiled imagery hosted by a Web Map Service (WMS) server.\n *\n * @alias WebMapServiceImageryProvider\n * @constructor\n *\n * @param {WebMapServiceImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @see {@link http://resources.esri.com/help/9.3/arcgisserver/apis/rest/|ArcGIS Server REST API}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n *\n * @example\n * const provider = new Cesium.WebMapServiceImageryProvider({\n * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',\n * layers : '0',\n * proxy: new Cesium.DefaultProxy('/proxy/')\n * });\n *\n * viewer.imageryLayers.addImageryProvider(provider);\n */\nfunction WebMapServiceImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n if (defined(options.times) && !defined(options.clock)) {\n throw new DeveloperError(\n \"options.times was specified, so options.clock is required.\"\n );\n }\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n this._getFeatureInfoUrl = defaultValue(\n options.getFeatureInfoUrl,\n options.url\n );\n\n const resource = Resource.createIfNeeded(options.url);\n const pickFeatureResource = Resource.createIfNeeded(this._getFeatureInfoUrl);\n\n resource.setQueryParameters(\n WebMapServiceImageryProvider.DefaultParameters,\n true\n );\n pickFeatureResource.setQueryParameters(\n WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,\n true\n );\n\n if (defined(options.parameters)) {\n resource.setQueryParameters(objectToLowercase(options.parameters));\n }\n\n if (defined(options.getFeatureInfoParameters)) {\n pickFeatureResource.setQueryParameters(\n objectToLowercase(options.getFeatureInfoParameters)\n );\n }\n\n const that = this;\n this._reload = undefined;\n if (defined(options.times)) {\n this._timeDynamicImagery = new TimeDynamicImagery({\n clock: options.clock,\n times: options.times,\n requestImageFunction: function (x, y, level, request, interval) {\n return requestImage(that, x, y, level, request, interval);\n },\n reloadFunction: function () {\n if (defined(that._reload)) {\n that._reload();\n }\n },\n });\n }\n\n const parameters = {};\n parameters.layers = options.layers;\n parameters.bbox =\n \"{westProjected},{southProjected},{eastProjected},{northProjected}\";\n parameters.width = \"{width}\";\n parameters.height = \"{height}\";\n\n // Use SRS or CRS based on the WMS version.\n if (parseFloat(resource.queryParameters.version) >= 1.3) {\n // Use CRS with 1.3.0 and going forward.\n // For GeographicTilingScheme, use CRS:84 vice EPSG:4326 to specify lon, lat (x, y) ordering for\n // bbox requests.\n parameters.crs = defaultValue(\n options.crs,\n options.tilingScheme &&\n options.tilingScheme.projection instanceof WebMercatorProjection\n ? \"EPSG:3857\"\n : \"CRS:84\"\n );\n\n // The axis order in previous versions of the WMS specifications was to always use easting (x or lon ) and northing (y or\n // lat). WMS 1.3.0 specifies that, depending on the particular CRS, the x axis may or may not be oriented West-to-East,\n // and the y axis may or may not be oriented South-to-North. The WMS portrayal operation shall account for axis order.\n // This affects some of the EPSG codes that were commonly used such as ESPG:4326. The current implementation\n // makes sure that coordinates passed to the server (as part of the GetMap BBOX parameter) as well as those advertised\n // in the capabilities document reflect the inverse axe orders for EPSG codes between 4000 and 5000.\n // - Taken from Section 9.1.3 of https://download.osgeo.org/mapserver/docs/MapServer-56.pdf\n const parts = parameters.crs.split(\":\");\n if (parts[0] === \"EPSG\" && parts.length === 2) {\n const code = Number(parts[1]);\n if (\n (code >= 4000 && code < 5000 && !excludesReverseAxis.includes(code)) ||\n includesReverseAxis.includes(code)\n ) {\n parameters.bbox =\n \"{southProjected},{westProjected},{northProjected},{eastProjected}\";\n }\n }\n } else {\n // SRS for WMS 1.1.0 or 1.1.1.\n parameters.srs = defaultValue(\n options.srs,\n options.tilingScheme &&\n options.tilingScheme.projection instanceof WebMercatorProjection\n ? \"EPSG:3857\"\n : \"EPSG:4326\"\n );\n }\n\n resource.setQueryParameters(parameters, true);\n pickFeatureResource.setQueryParameters(parameters, true);\n\n const pickFeatureParams = {\n query_layers: options.layers,\n info_format: \"{format}\",\n };\n // use correct pixel coordinate identifier based on version\n if (parseFloat(pickFeatureResource.queryParameters.version) >= 1.3) {\n pickFeatureParams.i = \"{i}\";\n pickFeatureParams.j = \"{j}\";\n } else {\n pickFeatureParams.x = \"{i}\";\n pickFeatureParams.y = \"{j}\";\n }\n pickFeatureResource.setQueryParameters(pickFeatureParams, true);\n\n this._resource = resource;\n this._pickFeaturesResource = pickFeatureResource;\n this._layers = options.layers;\n\n // Let UrlTemplateImageryProvider do the actual URL building.\n this._tileProvider = new UrlTemplateImageryProvider({\n url: resource,\n pickFeaturesUrl: pickFeatureResource,\n tilingScheme: defaultValue(\n options.tilingScheme,\n new GeographicTilingScheme({ ellipsoid: options.ellipsoid })\n ),\n rectangle: options.rectangle,\n tileWidth: options.tileWidth,\n tileHeight: options.tileHeight,\n minimumLevel: options.minimumLevel,\n maximumLevel: options.maximumLevel,\n subdomains: options.subdomains,\n tileDiscardPolicy: options.tileDiscardPolicy,\n credit: options.credit,\n getFeatureInfoFormats: defaultValue(\n options.getFeatureInfoFormats,\n WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats\n ),\n enablePickFeatures: options.enablePickFeatures,\n });\n}\n\nfunction requestImage(imageryProvider, col, row, level, request, interval) {\n const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n const tileProvider = imageryProvider._tileProvider;\n\n if (defined(dynamicIntervalData)) {\n // We set the query parameters within the tile provider, because it is managing the query.\n tileProvider._resource.setQueryParameters(dynamicIntervalData);\n }\n return tileProvider.requestImage(col, row, level, request);\n}\n\nfunction pickFeatures(\n imageryProvider,\n x,\n y,\n level,\n longitude,\n latitude,\n interval\n) {\n const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n const tileProvider = imageryProvider._tileProvider;\n\n if (defined(dynamicIntervalData)) {\n // We set the query parameters within the tile provider, because it is managing the query.\n tileProvider._pickFeaturesResource.setQueryParameters(dynamicIntervalData);\n }\n return tileProvider.pickFeatures(x, y, level, longitude, latitude);\n}\n\nObject.defineProperties(WebMapServiceImageryProvider.prototype, {\n /**\n * Gets the URL of the WMS server.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource._url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the names of the WMS layers, separated by commas.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n layers: {\n get: function () {\n return this._layers;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileProvider.tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileProvider.tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._tileProvider.maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return this._tileProvider.minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tileProvider.tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tileProvider.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileProvider.tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._tileProvider.errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._tileProvider.ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._tileProvider.readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._tileProvider.credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return this._tileProvider.hasAlphaChannel;\n },\n },\n\n /**\n * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will\n * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,\n * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable\n * features) without communicating with the server. Set this property to false if you know your data\n * source does not support picking features or if you don't want this provider's features to be pickable.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Boolean}\n * @default true\n */\n enablePickFeatures: {\n get: function () {\n return this._tileProvider.enablePickFeatures;\n },\n set: function (enablePickFeatures) {\n this._tileProvider.enablePickFeatures = enablePickFeatures;\n },\n },\n\n /**\n * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Clock}\n */\n clock: {\n get: function () {\n return this._timeDynamicImagery.clock;\n },\n set: function (value) {\n this._timeDynamicImagery.clock = value;\n },\n },\n /**\n * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each\n * TimeInterval is an object containing the keys and values of the properties that are used during\n * tile requests.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {TimeIntervalCollection}\n */\n times: {\n get: function () {\n return this._timeDynamicImagery.times;\n },\n set: function (value) {\n this._timeDynamicImagery.times = value;\n },\n },\n\n /**\n * Gets the getFeatureInfo URL of the WMS server.\n * @memberof WebMapServiceImageryProvider.prototype\n * @type {Resource|String}\n * @readonly\n */\n getFeatureInfoUrl: {\n get: function () {\n return this._getFeatureInfoUrl;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nWebMapServiceImageryProvider.prototype.getTileCredits = function (x, y, level) {\n return this._tileProvider.getTileCredits(x, y, level);\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link WebMapServiceImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nWebMapServiceImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n let result;\n const timeDynamicImagery = this._timeDynamicImagery;\n let currentInterval;\n\n // Try and load from cache\n if (defined(timeDynamicImagery)) {\n currentInterval = timeDynamicImagery.currentInterval;\n result = timeDynamicImagery.getFromCache(x, y, level, request);\n }\n\n // Couldn't load from cache\n if (!defined(result)) {\n result = requestImage(this, x, y, level, request, currentInterval);\n }\n\n // If we are approaching an interval, preload this tile in the next interval\n if (defined(result) && defined(timeDynamicImagery)) {\n timeDynamicImagery.checkApproachingInterval(x, y, level, request);\n }\n\n return result;\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nWebMapServiceImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n const timeDynamicImagery = this._timeDynamicImagery;\n const currentInterval = defined(timeDynamicImagery)\n ? timeDynamicImagery.currentInterval\n : undefined;\n\n return pickFeatures(this, x, y, level, longitude, latitude, currentInterval);\n};\n\n/**\n * The default parameters to include in the WMS URL to obtain images. The values are as follows:\n * service=WMS\n * version=1.1.1\n * request=GetMap\n * styles=\n * format=image/jpeg\n *\n * @constant\n * @type {Object}\n */\nWebMapServiceImageryProvider.DefaultParameters = Object.freeze({\n service: \"WMS\",\n version: \"1.1.1\",\n request: \"GetMap\",\n styles: \"\",\n format: \"image/jpeg\",\n});\n\n/**\n * The default parameters to include in the WMS URL to get feature information. The values are as follows:\n * service=WMS\n * version=1.1.1\n * request=GetFeatureInfo\n *\n * @constant\n * @type {Object}\n */\nWebMapServiceImageryProvider.GetFeatureInfoDefaultParameters = Object.freeze({\n service: \"WMS\",\n version: \"1.1.1\",\n request: \"GetFeatureInfo\",\n});\n\nWebMapServiceImageryProvider.DefaultGetFeatureInfoFormats = Object.freeze([\n Object.freeze(new GetFeatureInfoFormat(\"json\", \"application/json\")),\n Object.freeze(new GetFeatureInfoFormat(\"xml\", \"text/xml\")),\n Object.freeze(new GetFeatureInfoFormat(\"text\", \"text/html\")),\n]);\n\nfunction objectToLowercase(obj) {\n const result = {};\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n result[key.toLowerCase()] = obj[key];\n }\n }\n return result;\n}\nexport default WebMapServiceImageryProvider;\n", "import combine from \"../Core/combine.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport ImageryProvider from \"./ImageryProvider.js\";\nimport TimeDynamicImagery from \"./TimeDynamicImagery.js\";\n\nconst defaultParameters = Object.freeze({\n service: \"WMTS\",\n version: \"1.0.0\",\n request: \"GetTile\",\n});\n\n/**\n * @typedef {Object} WebMapTileServiceImageryProvider.ConstructorOptions\n *\n * Initialization options for the WebMapTileServiceImageryProvider constructor\n *\n * @property {Resource|String} url The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains.\n * @property {String} [format='image/jpeg'] The MIME type for images to retrieve from the server.\n * @property {String} layer The layer name for WMTS requests.\n * @property {String} style The style name for WMTS requests.\n * @property {String} tileMatrixSetID The identifier of the TileMatrixSet to use for WMTS requests.\n * @property {Array} [tileMatrixLabels] A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.\n * @property {Clock} [clock] A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.\n * @property {TimeIntervalCollection} [times] TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.\n * @property {Object} [dimensions] A object containing static dimensions and their values.\n * @property {Number} [tileWidth=256] The tile width in pixels.\n * @property {Number} [tileHeight=256] The tile height in pixels.\n * @property {TilingScheme} [tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n * @property {String|String[]} [subdomains='abc'] The subdomains to use for the <code>{s}</code> placeholder in the URL template.\n * If this parameter is a single string, each character in the string is a subdomain. If it is\n * an array, each element in the array is a subdomain.\n */\n\n/**\n * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.\n * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.\n *\n * @alias WebMapTileServiceImageryProvider\n * @constructor\n *\n * @param {WebMapTileServiceImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Web%20Map%20Tile%20Service%20with%20Time.html|Cesium Sandcastle Web Map Tile Service with Time Demo}\n *\n * @example\n * // Example 1. USGS shaded relief tiles (KVP)\n * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({\n * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',\n * layer : 'USGSShadedReliefOnly',\n * style : 'default',\n * format : 'image/jpeg',\n * tileMatrixSetID : 'default028mm',\n * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],\n * maximumLevel: 19,\n * credit : new Cesium.Credit('U. S. Geological Survey')\n * });\n * viewer.imageryLayers.addImageryProvider(shadedRelief1);\n *\n * @example\n * // Example 2. USGS shaded relief tiles (RESTful)\n * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({\n * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',\n * layer : 'USGSShadedReliefOnly',\n * style : 'default',\n * format : 'image/jpeg',\n * tileMatrixSetID : 'default028mm',\n * maximumLevel: 19,\n * credit : new Cesium.Credit('U. S. Geological Survey')\n * });\n * viewer.imageryLayers.addImageryProvider(shadedRelief2);\n *\n * @example\n * // Example 3. NASA time dynamic weather data (RESTful)\n * const times = Cesium.TimeIntervalCollection.fromIso8601({\n * iso8601: '2015-07-30/2017-06-16/P1D',\n * dataCallback: function dataCallback(interval, index) {\n * return {\n * Time: Cesium.JulianDate.toIso8601(interval.start)\n * };\n * }\n * });\n * const weather = new Cesium.WebMapTileServiceImageryProvider({\n * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',\n * layer : 'AMSR2_Snow_Water_Equivalent',\n * style : 'default',\n * tileMatrixSetID : '2km',\n * maximumLevel : 5,\n * format : 'image/png',\n * clock: clock,\n * times: times,\n * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')\n * });\n * viewer.imageryLayers.addImageryProvider(weather);\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see UrlTemplateImageryProvider\n */\nfunction WebMapTileServiceImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const resource = Resource.createIfNeeded(options.url);\n\n const style = options.style;\n const tileMatrixSetID = options.tileMatrixSetID;\n const url = resource.url;\n\n const bracketMatch = url.match(/{/g);\n if (\n !defined(bracketMatch) ||\n (bracketMatch.length === 1 && /{s}/.test(url))\n ) {\n resource.setQueryParameters(defaultParameters);\n this._useKvp = true;\n } else {\n const templateValues = {\n style: style,\n Style: style,\n TileMatrixSet: tileMatrixSetID,\n };\n\n resource.setTemplateValues(templateValues);\n this._useKvp = false;\n }\n\n this._resource = resource;\n this._layer = options.layer;\n this._style = style;\n this._tileMatrixSetID = tileMatrixSetID;\n this._tileMatrixLabels = options.tileMatrixLabels;\n this._format = defaultValue(options.format, \"image/jpeg\");\n this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n this._tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new WebMercatorTilingScheme({ ellipsoid: options.ellipsoid });\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n\n this._minimumLevel = defaultValue(options.minimumLevel, 0);\n this._maximumLevel = options.maximumLevel;\n\n this._rectangle = defaultValue(\n options.rectangle,\n this._tilingScheme.rectangle\n );\n this._dimensions = options.dimensions;\n\n const that = this;\n this._reload = undefined;\n if (defined(options.times)) {\n this._timeDynamicImagery = new TimeDynamicImagery({\n clock: options.clock,\n times: options.times,\n requestImageFunction: function (x, y, level, request, interval) {\n return requestImage(that, x, y, level, request, interval);\n },\n reloadFunction: function () {\n if (defined(that._reload)) {\n that._reload();\n }\n },\n });\n }\n\n this._readyPromise = Promise.resolve(true);\n\n // Check the number of tiles at the minimum level. If it's more than four,\n // throw an exception, because starting at the higher minimum\n // level will cause too many tiles to be downloaded and rendered.\n const swTile = this._tilingScheme.positionToTileXY(\n Rectangle.southwest(this._rectangle),\n this._minimumLevel\n );\n const neTile = this._tilingScheme.positionToTileXY(\n Rectangle.northeast(this._rectangle),\n this._minimumLevel\n );\n const tileCount =\n (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n this._errorEvent = new Event();\n\n const credit = options.credit;\n this._credit = typeof credit === \"string\" ? new Credit(credit) : credit;\n\n this._subdomains = options.subdomains;\n if (Array.isArray(this._subdomains)) {\n this._subdomains = this._subdomains.slice();\n } else if (defined(this._subdomains) && this._subdomains.length > 0) {\n this._subdomains = this._subdomains.split(\"\");\n } else {\n this._subdomains = [\"a\", \"b\", \"c\"];\n }\n}\n\nfunction requestImage(imageryProvider, col, row, level, request, interval) {\n const labels = imageryProvider._tileMatrixLabels;\n const tileMatrix = defined(labels) ? labels[level] : level.toString();\n const subdomains = imageryProvider._subdomains;\n const staticDimensions = imageryProvider._dimensions;\n const dynamicIntervalData = defined(interval) ? interval.data : undefined;\n\n let resource;\n let templateValues;\n if (!imageryProvider._useKvp) {\n templateValues = {\n TileMatrix: tileMatrix,\n TileRow: row.toString(),\n TileCol: col.toString(),\n s: subdomains[(col + row + level) % subdomains.length],\n };\n\n resource = imageryProvider._resource.getDerivedResource({\n request: request,\n });\n resource.setTemplateValues(templateValues);\n\n if (defined(staticDimensions)) {\n resource.setTemplateValues(staticDimensions);\n }\n\n if (defined(dynamicIntervalData)) {\n resource.setTemplateValues(dynamicIntervalData);\n }\n } else {\n // build KVP request\n let query = {};\n query.tilematrix = tileMatrix;\n query.layer = imageryProvider._layer;\n query.style = imageryProvider._style;\n query.tilerow = row;\n query.tilecol = col;\n query.tilematrixset = imageryProvider._tileMatrixSetID;\n query.format = imageryProvider._format;\n\n if (defined(staticDimensions)) {\n query = combine(query, staticDimensions);\n }\n\n if (defined(dynamicIntervalData)) {\n query = combine(query, dynamicIntervalData);\n }\n\n templateValues = {\n s: subdomains[(col + row + level) % subdomains.length],\n };\n\n resource = imageryProvider._resource.getDerivedResource({\n queryParameters: query,\n request: request,\n });\n resource.setTemplateValues(templateValues);\n }\n\n return ImageryProvider.loadImage(imageryProvider, resource);\n}\n\nObject.defineProperties(WebMapTileServiceImageryProvider.prototype, {\n /**\n * Gets the URL of the service hosting the imagery.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._resource.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._resource.proxy;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return this._minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the mime type of images returned by this imagery provider.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n format: {\n get: function () {\n return this._format;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n value: true,\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n /**\n * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Clock}\n */\n clock: {\n get: function () {\n return this._timeDynamicImagery.clock;\n },\n set: function (value) {\n this._timeDynamicImagery.clock = value;\n },\n },\n /**\n * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each\n * TimeInterval is an object containing the keys and values of the properties that are used during\n * tile requests.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {TimeIntervalCollection}\n */\n times: {\n get: function () {\n return this._timeDynamicImagery.times;\n },\n set: function (value) {\n this._timeDynamicImagery.times = value;\n },\n },\n /**\n * Gets or sets an object that contains static dimensions and their values.\n * @memberof WebMapTileServiceImageryProvider.prototype\n * @type {Object}\n */\n dimensions: {\n get: function () {\n return this._dimensions;\n },\n set: function (value) {\n if (this._dimensions !== value) {\n this._dimensions = value;\n if (defined(this._reload)) {\n this._reload();\n }\n }\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nWebMapTileServiceImageryProvider.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nWebMapTileServiceImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n let result;\n const timeDynamicImagery = this._timeDynamicImagery;\n let currentInterval;\n\n // Try and load from cache\n if (defined(timeDynamicImagery)) {\n currentInterval = timeDynamicImagery.currentInterval;\n result = timeDynamicImagery.getFromCache(x, y, level, request);\n }\n\n // Couldn't load from cache\n if (!defined(result)) {\n result = requestImage(this, x, y, level, request, currentInterval);\n }\n\n // If we are approaching an interval, preload this tile in the next interval\n if (defined(result) && defined(timeDynamicImagery)) {\n timeDynamicImagery.checkApproachingInterval(x, y, level, request);\n }\n\n return result;\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nWebMapTileServiceImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default WebMapTileServiceImageryProvider;\n", "import Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport IonResource from \"../Core/IonResource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport ArcGisMapServerImageryProvider from \"./ArcGisMapServerImageryProvider.js\";\nimport BingMapsImageryProvider from \"./BingMapsImageryProvider.js\";\nimport TileMapServiceImageryProvider from \"./TileMapServiceImageryProvider.js\";\nimport GoogleEarthEnterpriseMapsProvider from \"./GoogleEarthEnterpriseMapsProvider.js\";\nimport MapboxImageryProvider from \"./MapboxImageryProvider.js\";\nimport SingleTileImageryProvider from \"./SingleTileImageryProvider.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\nimport WebMapServiceImageryProvider from \"./WebMapServiceImageryProvider.js\";\nimport WebMapTileServiceImageryProvider from \"./WebMapTileServiceImageryProvider.js\";\n\nfunction createFactory(Type) {\n return function (options) {\n return new Type(options);\n };\n}\n\n// These values are the list of supported external imagery\n// assets in the Cesium ion beta. They are subject to change.\nconst ImageryProviderMapping = {\n ARCGIS_MAPSERVER: createFactory(ArcGisMapServerImageryProvider),\n BING: createFactory(BingMapsImageryProvider),\n GOOGLE_EARTH: createFactory(GoogleEarthEnterpriseMapsProvider),\n MAPBOX: createFactory(MapboxImageryProvider),\n SINGLE_TILE: createFactory(SingleTileImageryProvider),\n TMS: createFactory(TileMapServiceImageryProvider),\n URL_TEMPLATE: createFactory(UrlTemplateImageryProvider),\n WMS: createFactory(WebMapServiceImageryProvider),\n WMTS: createFactory(WebMapTileServiceImageryProvider),\n};\n\n/**\n * @typedef {Object} IonImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileMapServiceImageryProvider constructor\n *\n * @property {Number} assetId An ion imagery asset ID\n * @property {String} [accessToken=Ion.defaultAccessToken] The access token to use.\n * @property {String|Resource} [server=Ion.defaultServer] The resource to the Cesium ion API server.\n */\n\n/**\n * Provides tiled imagery using the Cesium ion REST API.\n *\n * @alias IonImageryProvider\n * @constructor\n *\n * @param {IonImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));\n */\nfunction IonImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const assetId = options.assetId;\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n this._ready = false;\n this._tileCredits = undefined;\n this._errorEvent = new Event();\n\n const that = this;\n const endpointResource = IonResource._createEndpointResource(\n assetId,\n options\n );\n\n // A simple cache to avoid making repeated requests to ion for endpoints we've\n // already retrieved. This exists mainly to support Bing caching to reduce\n // world imagery sessions, but provides a small boost of performance in general\n // if constantly reloading assets\n const cacheKey =\n options.assetId.toString() + options.accessToken + options.server;\n let promise = IonImageryProvider._endpointCache[cacheKey];\n if (!defined(promise)) {\n promise = endpointResource.fetchJson();\n IonImageryProvider._endpointCache[cacheKey] = promise;\n }\n\n this._readyPromise = promise.then(function (endpoint) {\n if (endpoint.type !== \"IMAGERY\") {\n return Promise.reject(\n new RuntimeError(`Cesium ion asset ${assetId} is not an imagery asset.`)\n );\n }\n\n let imageryProvider;\n const externalType = endpoint.externalType;\n if (!defined(externalType)) {\n imageryProvider = new TileMapServiceImageryProvider({\n url: new IonResource(endpoint, endpointResource),\n });\n } else {\n const factory = ImageryProviderMapping[externalType];\n\n if (!defined(factory)) {\n return Promise.reject(\n new RuntimeError(\n `Unrecognized Cesium ion imagery type: ${externalType}`\n )\n );\n }\n imageryProvider = factory(endpoint.options);\n }\n\n that._tileCredits = IonResource.getCreditsFromEndpoint(\n endpoint,\n endpointResource\n );\n\n imageryProvider.errorEvent.addEventListener(function (tileProviderError) {\n //Propagate the errorEvent but set the provider to this instance instead\n //of the inner instance.\n tileProviderError.provider = that;\n that._errorEvent.raiseEvent(tileProviderError);\n });\n\n that._imageryProvider = imageryProvider;\n return imageryProvider.readyPromise.then(function () {\n that._ready = true;\n return true;\n });\n });\n}\n\nObject.defineProperties(IonImageryProvider.prototype, {\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof IonImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof IonImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\nreturn this._imageryProvider.rectangle;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\nreturn this._imageryProvider.tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\nreturn this._imageryProvider.tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\nreturn this._imageryProvider.maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link IonImageryProvider#ready} returns true. Generally,\n * a minimum level should only be used when the rectangle of the imagery is small\n * enough that the number of tiles at the minimum level is small. An imagery\n * provider with more than a few tiles at the minimum level will lead to\n * rendering problems.\n * @memberof IonImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\nreturn this._imageryProvider.minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by the provider. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\nreturn this._imageryProvider.tilingScheme;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\nreturn this._imageryProvider.tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof IonImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @memberof IonImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\nreturn this._imageryProvider.credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof IonImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\nreturn this._imageryProvider.hasAlphaChannel;\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof IonImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n * @default undefined\n */\n proxy: {\n get: function () {\n return undefined;\n },\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n * @function\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nIonImageryProvider.prototype.getTileCredits = function (x, y, level) {\n const innerCredits = this._imageryProvider.getTileCredits(x, y, level);\n if (!defined(innerCredits)) {\n return this._tileCredits;\n }\n\n return this._tileCredits.concat(innerCredits);\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link IonImageryProvider#ready} returns true.\n * @function\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nIonImageryProvider.prototype.requestImage = function (x, y, level, request) {\nreturn this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.\n * This function is optional, so it may not exist on all ImageryProviders.\n *\n * @function\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nIonImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\nreturn this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n//exposed for testing\nIonImageryProvider._endpointCache = {};\nexport default IonImageryProvider;\n", "// Note, these values map directly to ion asset ids.\n\n/**\n * The types of imagery provided by {@link createWorldImagery}.\n *\n * @enum {Number}\n */\nconst IonWorldImageryStyle = {\n /**\n * Aerial imagery.\n *\n * @type {Number}\n * @constant\n */\n AERIAL: 2,\n\n /**\n * Aerial imagery with a road overlay.\n *\n * @type {Number}\n * @constant\n */\n AERIAL_WITH_LABELS: 3,\n\n /**\n * Roads without additional imagery.\n *\n * @type {Number}\n * @constant\n */\n ROAD: 4,\n};\nexport default Object.freeze(IonWorldImageryStyle);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport IonImageryProvider from \"./IonImageryProvider.js\";\nimport IonWorldImageryStyle from \"./IonWorldImageryStyle.js\";\n\n/**\n * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.\n *\n * @function\n *\n * @param {Object} [options] Object with the following properties:\n * @param {IonWorldImageryStyle} [options.style=IonWorldImageryStyle] The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.\n * @returns {IonImageryProvider}\n *\n * @see Ion\n *\n * @example\n * // Create Cesium World Terrain with default settings\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * imageryProvider : Cesium.createWorldImagery();\n * });\n *\n * @example\n * // Create Cesium World Terrain with water and normals.\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * imageryProvider : Cesium.createWorldImagery({\n * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS\n * })\n * });\n *\n */\nfunction createWorldImagery(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const style = defaultValue(options.style, IonWorldImageryStyle.AERIAL);\n return new IonImageryProvider({\n assetId: style,\n });\n}\nexport default createWorldImagery;\n", "import AssociativeArray from \"../Core/AssociativeArray.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Check from \"../Core/Check.js\";\nimport Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Uri from \"urijs\";\n\nconst mobileWidth = 576;\nconst lightboxHeight = 100;\nconst textColor = \"#ffffff\";\nconst highlightColor = \"#48b\";\n\n/**\n * Used to sort the credits by frequency of appearance\n * when they are later displayed.\n *\n * @alias CreditDisplay.CreditDisplayElement\n * @constructor\n *\n * @private\n */\nfunction CreditDisplayElement(credit, count) {\n this.credit = credit;\n this.count = defaultValue(count, 1);\n}\n\nfunction contains(credits, credit) {\n const len = credits.length;\n for (let i = 0; i < len; i++) {\n const existingCredit = credits[i];\n if (Credit.equals(existingCredit, credit)) {\n return true;\n }\n }\n return false;\n}\n\nfunction swapCesiumCredit(creditDisplay) {\n // We don't want to clutter the screen with the Cesium logo and the Cesium ion\n // logo at the same time. Since the ion logo is required, we just replace the\n // Cesium logo or add the logo if the Cesium one was removed.\n const previousCredit = creditDisplay._previousCesiumCredit;\n const currentCredit = creditDisplay._currentCesiumCredit;\n if (Credit.equals(currentCredit, previousCredit)) {\n return;\n }\n\n if (defined(previousCredit)) {\n creditDisplay._cesiumCreditContainer.removeChild(previousCredit.element);\n }\n if (defined(currentCredit)) {\n creditDisplay._cesiumCreditContainer.appendChild(currentCredit.element);\n }\n\n creditDisplay._previousCesiumCredit = currentCredit;\n}\n\nconst delimiterClassName = \"cesium-credit-delimiter\";\n\nfunction createDelimiterElement(delimiter) {\n const delimiterElement = document.createElement(\"span\");\n delimiterElement.textContent = delimiter;\n delimiterElement.className = delimiterClassName;\n return delimiterElement;\n}\n\nfunction createCreditElement(element, elementWrapperTagName) {\n // may need to wrap the credit in another element\n if (defined(elementWrapperTagName)) {\n const wrapper = document.createElement(elementWrapperTagName);\n wrapper._creditId = element._creditId;\n wrapper.appendChild(element);\n element = wrapper;\n }\n return element;\n}\n\nfunction displayCredits(container, credits, delimiter, elementWrapperTagName) {\n const childNodes = container.childNodes;\n let domIndex = -1;\n\n // Sort the credits such that more frequent credits appear first\n credits.sort(function (credit1, credit2) {\n return credit2.count - credit1.count;\n });\n\n for (let creditIndex = 0; creditIndex < credits.length; ++creditIndex) {\n const credit = credits[creditIndex].credit;\n if (defined(credit)) {\n domIndex = creditIndex;\n if (defined(delimiter)) {\n // credits may be separated by delimiters\n domIndex *= 2;\n if (creditIndex > 0) {\n const delimiterDomIndex = domIndex - 1;\n if (childNodes.length <= delimiterDomIndex) {\n container.appendChild(createDelimiterElement(delimiter));\n } else {\n const existingDelimiter = childNodes[delimiterDomIndex];\n if (existingDelimiter.className !== delimiterClassName) {\n container.replaceChild(\n createDelimiterElement(delimiter),\n existingDelimiter\n );\n }\n }\n }\n }\n\n const element = credit.element;\n\n // check to see if the correct credit is in the right place\n if (childNodes.length <= domIndex) {\n container.appendChild(\n createCreditElement(element, elementWrapperTagName)\n );\n } else {\n const existingElement = childNodes[domIndex];\n if (existingElement._creditId !== credit._id) {\n // not the right credit, swap it in\n container.replaceChild(\n createCreditElement(element, elementWrapperTagName),\n existingElement\n );\n }\n }\n }\n }\n\n // any remaining nodes in the container are unnecessary\n ++domIndex;\n while (domIndex < childNodes.length) {\n container.removeChild(childNodes[domIndex]);\n }\n}\n\nfunction styleLightboxContainer(that) {\n const lightboxCredits = that._lightboxCredits;\n const width = that.viewport.clientWidth;\n const height = that.viewport.clientHeight;\n if (width !== that._lastViewportWidth) {\n if (width < mobileWidth) {\n lightboxCredits.className =\n \"cesium-credit-lightbox cesium-credit-lightbox-mobile\";\n lightboxCredits.style.marginTop = \"0\";\n } else {\n lightboxCredits.className =\n \"cesium-credit-lightbox cesium-credit-lightbox-expanded\";\n lightboxCredits.style.marginTop = `${Math.floor(\n (height - lightboxCredits.clientHeight) * 0.5\n )}px`;\n }\n that._lastViewportWidth = width;\n }\n\n if (width >= mobileWidth && height !== that._lastViewportHeight) {\n lightboxCredits.style.marginTop = `${Math.floor(\n (height - lightboxCredits.clientHeight) * 0.5\n )}px`;\n that._lastViewportHeight = height;\n }\n}\n\nfunction addStyle(selector, styles) {\n let style = `${selector} {`;\n for (const attribute in styles) {\n if (styles.hasOwnProperty(attribute)) {\n style += `${attribute}: ${styles[attribute]}; `;\n }\n }\n style += \" }\\n\";\n return style;\n}\n\nfunction appendCss() {\n let style = \"\";\n style += addStyle(\".cesium-credit-lightbox-overlay\", {\n display: \"none\",\n \"z-index\": \"1\", //must be at least 1 to draw over top other Cesium widgets\n position: \"absolute\",\n top: \"0\",\n left: \"0\",\n width: \"100%\",\n height: \"100%\",\n \"background-color\": \"rgba(80, 80, 80, 0.8)\",\n });\n\n style += addStyle(\".cesium-credit-lightbox\", {\n \"background-color\": \"#303336\",\n color: textColor,\n position: \"relative\",\n \"min-height\": `${lightboxHeight}px`,\n margin: \"auto\",\n });\n\n style += addStyle(\n \".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited\",\n {\n color: textColor,\n }\n );\n\n style += addStyle(\".cesium-credit-lightbox > ul > li a:hover\", {\n color: highlightColor,\n });\n\n style += addStyle(\".cesium-credit-lightbox.cesium-credit-lightbox-expanded\", {\n border: \"1px solid #444\",\n \"border-radius\": \"5px\",\n \"max-width\": \"370px\",\n });\n\n style += addStyle(\".cesium-credit-lightbox.cesium-credit-lightbox-mobile\", {\n height: \"100%\",\n width: \"100%\",\n });\n\n style += addStyle(\".cesium-credit-lightbox-title\", {\n padding: \"20px 20px 0 20px\",\n });\n\n style += addStyle(\".cesium-credit-lightbox-close\", {\n \"font-size\": \"18pt\",\n cursor: \"pointer\",\n position: \"absolute\",\n top: \"0\",\n right: \"6px\",\n color: textColor,\n });\n\n style += addStyle(\".cesium-credit-lightbox-close:hover\", {\n color: highlightColor,\n });\n\n style += addStyle(\".cesium-credit-lightbox > ul\", {\n margin: \"0\",\n padding: \"12px 20px 12px 40px\",\n \"font-size\": \"13px\",\n });\n\n style += addStyle(\".cesium-credit-lightbox > ul > li\", {\n \"padding-bottom\": \"6px\",\n });\n\n style += addStyle(\".cesium-credit-lightbox > ul > li *\", {\n padding: \"0\",\n margin: \"0\",\n });\n\n style += addStyle(\".cesium-credit-expand-link\", {\n \"padding-left\": \"5px\",\n cursor: \"pointer\",\n \"text-decoration\": \"underline\",\n color: textColor,\n });\n style += addStyle(\".cesium-credit-expand-link:hover\", {\n color: highlightColor,\n });\n\n style += addStyle(\".cesium-credit-text\", {\n color: textColor,\n });\n\n style += addStyle(\n \".cesium-credit-textContainer *, .cesium-credit-logoContainer *\",\n {\n display: \"inline\",\n }\n );\n\n const head = document.head;\n const css = document.createElement(\"style\");\n css.innerHTML = style;\n head.insertBefore(css, head.firstChild);\n}\n\n/**\n * The credit display is responsible for displaying credits on screen.\n *\n * @param {HTMLElement} container The HTML element where credits will be displayed\n * @param {String} [delimiter= ' \u2022 '] The string to separate text credits\n * @param {HTMLElement} [viewport=document.body] The HTML element that will contain the credits popup\n *\n * @alias CreditDisplay\n * @constructor\n *\n * @example\n * const creditDisplay = new Cesium.CreditDisplay(creditContainer);\n */\nfunction CreditDisplay(container, delimiter, viewport) {\nconst that = this;\n\n viewport = defaultValue(viewport, document.body);\n\n const lightbox = document.createElement(\"div\");\n lightbox.className = \"cesium-credit-lightbox-overlay\";\n viewport.appendChild(lightbox);\n\n const lightboxCredits = document.createElement(\"div\");\n lightboxCredits.className = \"cesium-credit-lightbox\";\n lightbox.appendChild(lightboxCredits);\n\n function hideLightbox(event) {\n if (lightboxCredits.contains(event.target)) {\n return;\n }\n that.hideLightbox();\n }\n lightbox.addEventListener(\"click\", hideLightbox, false);\n\n const title = document.createElement(\"div\");\n title.className = \"cesium-credit-lightbox-title\";\n title.textContent = \"Data provided by:\";\n lightboxCredits.appendChild(title);\n\n const closeButton = document.createElement(\"a\");\n closeButton.onclick = this.hideLightbox.bind(this);\n closeButton.innerHTML = \"×\";\n closeButton.className = \"cesium-credit-lightbox-close\";\n lightboxCredits.appendChild(closeButton);\n\n const creditList = document.createElement(\"ul\");\n lightboxCredits.appendChild(creditList);\n\n const cesiumCreditContainer = document.createElement(\"div\");\n cesiumCreditContainer.className = \"cesium-credit-logoContainer\";\n cesiumCreditContainer.style.display = \"inline\";\n container.appendChild(cesiumCreditContainer);\n\n const screenContainer = document.createElement(\"div\");\n screenContainer.className = \"cesium-credit-textContainer\";\n screenContainer.style.display = \"inline\";\n container.appendChild(screenContainer);\n\n const expandLink = document.createElement(\"a\");\n expandLink.className = \"cesium-credit-expand-link\";\n expandLink.onclick = this.showLightbox.bind(this);\n expandLink.textContent = \"Data attribution\";\n container.appendChild(expandLink);\n\n appendCss();\n const cesiumCredit = Credit.clone(CreditDisplay.cesiumCredit);\n\n this._delimiter = defaultValue(delimiter, \" \u2022 \");\n this._screenContainer = screenContainer;\n this._cesiumCreditContainer = cesiumCreditContainer;\n this._lastViewportHeight = undefined;\n this._lastViewportWidth = undefined;\n this._lightboxCredits = lightboxCredits;\n this._creditList = creditList;\n this._lightbox = lightbox;\n this._hideLightbox = hideLightbox;\n this._expandLink = expandLink;\n this._expanded = false;\n this._defaultCredits = [];\n this._cesiumCredit = cesiumCredit;\n this._previousCesiumCredit = undefined;\n this._currentCesiumCredit = cesiumCredit;\n this._creditDisplayElementPool = [];\n this._creditDisplayElementIndex = 0;\n\n this._currentFrameCredits = {\n screenCredits: new AssociativeArray(),\n lightboxCredits: new AssociativeArray(),\n };\n\n this._defaultCredit = undefined;\n\n this.viewport = viewport;\n\n /**\n * The HTML element where credits will be displayed.\n * @type {HTMLElement}\n */\n this.container = container;\n}\n\nfunction setCredit(creditDisplay, credits, credit, count) {\n count = defaultValue(count, 1);\n let creditDisplayElement = credits.get(credit.id);\n if (!defined(creditDisplayElement)) {\n const pool = creditDisplay._creditDisplayElementPool;\n const poolIndex = creditDisplay._creditDisplayElementPoolIndex;\n if (poolIndex < pool.length) {\n creditDisplayElement = pool[poolIndex];\n creditDisplayElement.credit = credit;\n creditDisplayElement.count = count;\n } else {\n creditDisplayElement = new CreditDisplayElement(credit, count);\n pool.push(creditDisplayElement);\n }\n ++creditDisplay._creditDisplayElementPoolIndex;\n credits.set(credit.id, creditDisplayElement);\n } else if (creditDisplayElement.count < Number.MAX_VALUE) {\n creditDisplayElement.count += count;\n }\n}\n/**\n * Adds a credit to the list of current credits to be displayed in the credit container\n *\n * @param {Credit} credit The credit to display\n */\nCreditDisplay.prototype.addCredit = function (credit) {\n if (credit._isIon) {\n // If this is the an ion logo credit from the ion server\n // Juse use the default credit (which is identical) to avoid blinking\n if (!defined(this._defaultCredit)) {\n this._defaultCredit = Credit.clone(getDefaultCredit());\n }\n this._currentCesiumCredit = this._defaultCredit;\n return;\n }\n\n let credits;\n if (!credit.showOnScreen) {\n credits = this._currentFrameCredits.lightboxCredits;\n } else {\n credits = this._currentFrameCredits.screenCredits;\n }\n\n setCredit(this, credits, credit);\n};\n\n/**\n * Adds credits that will persist until they are removed\n *\n * @param {Credit} credit The credit to added to defaults\n */\nCreditDisplay.prototype.addDefaultCredit = function (credit) {\n const defaultCredits = this._defaultCredits;\n if (!contains(defaultCredits, credit)) {\n defaultCredits.push(credit);\n }\n};\n\n/**\n * Removes a default credit\n *\n * @param {Credit} credit The credit to be removed from defaults\n */\nCreditDisplay.prototype.removeDefaultCredit = function (credit) {\n const defaultCredits = this._defaultCredits;\n const index = defaultCredits.indexOf(credit);\n if (index !== -1) {\n defaultCredits.splice(index, 1);\n }\n};\n\nCreditDisplay.prototype.showLightbox = function () {\n this._lightbox.style.display = \"block\";\n this._expanded = true;\n};\n\nCreditDisplay.prototype.hideLightbox = function () {\n this._lightbox.style.display = \"none\";\n this._expanded = false;\n};\n\n/**\n * Updates the credit display before a new frame is rendered.\n */\nCreditDisplay.prototype.update = function () {\n if (this._expanded) {\n styleLightboxContainer(this);\n }\n};\n\n/**\n * Resets the credit display to a beginning of frame state, clearing out current credits.\n */\nCreditDisplay.prototype.beginFrame = function () {\n const currentFrameCredits = this._currentFrameCredits;\n this._creditDisplayElementPoolIndex = 0;\n\n const screenCredits = currentFrameCredits.screenCredits;\n screenCredits.removeAll();\n const defaultCredits = this._defaultCredits;\n for (let i = 0; i < defaultCredits.length; ++i) {\n const defaultCredit = defaultCredits[i];\n setCredit(this, screenCredits, defaultCredit, Number.MAX_VALUE);\n }\n\n currentFrameCredits.lightboxCredits.removeAll();\n\n if (!Credit.equals(CreditDisplay.cesiumCredit, this._cesiumCredit)) {\n this._cesiumCredit = Credit.clone(CreditDisplay.cesiumCredit);\n }\n this._currentCesiumCredit = this._cesiumCredit;\n};\n\n/**\n * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.\n */\nCreditDisplay.prototype.endFrame = function () {\n const screenCredits = this._currentFrameCredits.screenCredits.values;\n displayCredits(\n this._screenContainer,\n screenCredits,\n this._delimiter,\n undefined\n );\n\n const lightboxCredits = this._currentFrameCredits.lightboxCredits.values;\n this._expandLink.style.display =\n lightboxCredits.length > 0 ? \"inline\" : \"none\";\n displayCredits(this._creditList, lightboxCredits, undefined, \"li\");\n\n swapCesiumCredit(this);\n};\n\n/**\n * Destroys the resources held by this object. Destroying an object allows for deterministic\n * release of resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nCreditDisplay.prototype.destroy = function () {\n this._lightbox.removeEventListener(\"click\", this._hideLightbox, false);\n\n this.container.removeChild(this._cesiumCreditContainer);\n this.container.removeChild(this._screenContainer);\n this.container.removeChild(this._expandLink);\n this.viewport.removeChild(this._lightbox);\n\n return destroyObject(this);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nCreditDisplay.prototype.isDestroyed = function () {\n return false;\n};\n\nCreditDisplay._cesiumCredit = undefined;\nCreditDisplay._cesiumCreditInitialized = false;\n\nlet defaultCredit;\nfunction getDefaultCredit() {\n if (!defined(defaultCredit)) {\n let logo = buildModuleUrl(\"Assets/Images/ion-credit.png\");\n\n // When hosting in a WebView, the base URL scheme is file:// or ms-appx-web://\n // which is stripped out from the Credit's <img> tag; use the full path instead\n if (\n logo.indexOf(\"http://\") !== 0 &&\n logo.indexOf(\"https://\") !== 0 &&\n logo.indexOf(\"data:\") !== 0\n ) {\n const logoUrl = new Uri(logo);\n logo = logoUrl.path();\n }\n\n defaultCredit = new Credit(\n `<a href=\"https://cesium.com/\" target=\"_blank\"><img src=\"${logo}\" title=\"Cesium ion\"/></a>`,\n true\n );\n }\n\n if (!CreditDisplay._cesiumCreditInitialized) {\n CreditDisplay._cesiumCredit = defaultCredit;\n CreditDisplay._cesiumCreditInitialized = true;\n }\n return defaultCredit;\n}\n\nObject.defineProperties(CreditDisplay, {\n /**\n * Gets or sets the Cesium logo credit.\n * @memberof CreditDisplay\n * @type {Credit}\n */\n cesiumCredit: {\n get: function () {\n getDefaultCredit();\n return CreditDisplay._cesiumCredit;\n },\n set: function (value) {\n CreditDisplay._cesiumCredit = value;\n CreditDisplay._cesiumCreditInitialized = true;\n },\n },\n});\n\nCreditDisplay.CreditDisplayElement = CreditDisplayElement;\nexport default CreditDisplay;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Appearance from \"./Appearance.js\";\n\n/**\n * Visualizes a vertex attribute by displaying it as a color for debugging.\n * <p>\n * Components for well-known unit-length vectors, i.e., <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased\n * from [-1.0, 1.0] to (-1.0, 1.0).\n * </p>\n *\n * @alias DebugAppearance\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {String} options.attributeName The name of the attribute to visualize.\n * @param {Boolean} [options.perInstanceAttribute=false] Boolean that determines whether this attribute is a per-instance geometry attribute.\n * @param {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @exception {DeveloperError} options.glslDatatype must be float, vec2, vec3, or vec4.\n *\n * @example\n * const primitive = new Cesium.Primitive({\n * geometryInstances : // ...\n * appearance : new Cesium.DebugAppearance({\n * attributeName : 'normal'\n * })\n * });\n */\nfunction DebugAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const attributeName = options.attributeName;\n let perInstanceAttribute = options.perInstanceAttribute;\n\n if (!defined(perInstanceAttribute)) {\n perInstanceAttribute = false;\n }\n\n let glslDatatype = defaultValue(options.glslDatatype, \"vec3\");\n const varyingName = `v_${attributeName}`;\n let getColor;\n\n // Well-known normalized vector attributes in VertexFormat\n if (\n attributeName === \"normal\" ||\n attributeName === \"tangent\" ||\n attributeName === \"bitangent\"\n ) {\n getColor = `vec4 getColor() { return vec4((${varyingName} + vec3(1.0)) * 0.5, 1.0); }\\n`;\n } else {\n // All other attributes, both well-known and custom\n if (attributeName === \"st\") {\n glslDatatype = \"vec2\";\n }\n\n switch (glslDatatype) {\n case \"float\":\n getColor = `vec4 getColor() { return vec4(vec3(${varyingName}), 1.0); }\\n`;\n break;\n case \"vec2\":\n getColor = `vec4 getColor() { return vec4(${varyingName}, 0.0, 1.0); }\\n`;\n break;\n case \"vec3\":\n getColor = `vec4 getColor() { return vec4(${varyingName}, 1.0); }\\n`;\n break;\n case \"vec4\":\n getColor = `vec4 getColor() { return ${varyingName}; }\\n`;\n break;\n}\n }\n\n const vs =\n `${\n \"attribute vec3 position3DHigh;\\n\" +\n \"attribute vec3 position3DLow;\\n\" +\n \"attribute float batchId;\\n\"\n }${\n perInstanceAttribute\n ? \"\"\n : `attribute ${glslDatatype} ${attributeName};\\n`\n }varying ${glslDatatype} ${varyingName};\\n` +\n `void main()\\n` +\n `{\\n` +\n `vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\\n${\n perInstanceAttribute\n ? `${varyingName} = czm_batchTable_${attributeName}(batchId);\\n`\n : `${varyingName} = ${attributeName};\\n`\n }gl_Position = czm_modelViewProjectionRelativeToEye * p;\\n` +\n `}`;\n const fs =\n `varying ${glslDatatype} ${varyingName};\\n${getColor}\\n` +\n `void main()\\n` +\n `{\\n` +\n `gl_FragColor = getColor();\\n` +\n `}`;\n\n /**\n * This property is part of the {@link Appearance} interface, but is not\n * used by {@link DebugAppearance} since a fully custom fragment shader is used.\n *\n * @type Material\n *\n * @default undefined\n */\n this.material = undefined;\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent.\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.translucent = defaultValue(options.translucent, false);\n\n this._vertexShaderSource = defaultValue(options.vertexShaderSource, vs);\n this._fragmentShaderSource = defaultValue(options.fragmentShaderSource, fs);\n this._renderState = Appearance.getDefaultRenderState(\n false,\n false,\n options.renderState\n );\n this._closed = defaultValue(options.closed, false);\n\n // Non-derived members\n\n this._attributeName = attributeName;\n this._glslDatatype = glslDatatype;\n}\n\nObject.defineProperties(DebugAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader. The full fragment shader\n * source is built procedurally taking into account the {@link DebugAppearance#material}.\n * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The name of the attribute being visualized.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n attributeName: {\n get: function () {\n return this._attributeName;\n },\n },\n\n /**\n * The GLSL datatype of the attribute being visualized.\n *\n * @memberof DebugAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n glslDatatype: {\n get: function () {\n return this._glslDatatype;\n },\n },\n});\n\n/**\n * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just\n * {@link DebugAppearance#fragmentShaderSource}.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nDebugAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nDebugAppearance.prototype.isTranslucent = Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nDebugAppearance.prototype.getRenderState = Appearance.prototype.getRenderState;\nexport default DebugAppearance;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FrustumGeometry from \"../Core/FrustumGeometry.js\";\nimport FrustumOutlineGeometry from \"../Core/FrustumOutlineGeometry.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Draws the outline of the camera's view frustum.\n *\n * @alias DebugCameraPrimitive\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Camera} options.camera The camera.\n * @param {Number[]} [options.frustumSplits] Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.\n * @param {Color} [options.color=Color.CYAN] The color of the debug outline.\n * @param {Boolean} [options.updateOnChange=true] Whether the primitive updates when the underlying camera changes.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}.\n *\n * @example\n * primitives.add(new Cesium.DebugCameraPrimitive({\n * camera : camera,\n * color : Cesium.Color.YELLOW\n * }));\n */\nfunction DebugCameraPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._camera = options.camera;\n this._frustumSplits = options.frustumSplits;\n this._color = defaultValue(options.color, Color.CYAN);\n this._updateOnChange = defaultValue(options.updateOnChange, true);\n\n /**\n * Determines if this primitive will be shown.\n *\n * @type Boolean\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * User-defined value returned when the primitive is picked.\n *\n * @type {*}\n * @default undefined\n *\n * @see Scene#pick\n */\n this.id = options.id;\n this._id = undefined;\n\n this._outlinePrimitives = [];\n this._planesPrimitives = [];\n}\n\nconst scratchRight = new Cartesian3();\nconst scratchRotation = new Matrix3();\nconst scratchOrientation = new Quaternion();\nconst scratchPerspective = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenter = new PerspectiveOffCenterFrustum();\nconst scratchOrthographic = new OrthographicFrustum();\nconst scratchOrthographicOffCenter = new OrthographicOffCenterFrustum();\n\nconst scratchColor = new Color();\nconst scratchSplits = [1.0, 100000.0];\n\n/**\n * @private\n */\nDebugCameraPrimitive.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const planesPrimitives = this._planesPrimitives;\n const outlinePrimitives = this._outlinePrimitives;\n let i;\n let length;\n\n if (this._updateOnChange) {\n // Recreate the primitive every frame\n length = planesPrimitives.length;\n for (i = 0; i < length; ++i) {\n outlinePrimitives[i] =\n outlinePrimitives[i] && outlinePrimitives[i].destroy();\n planesPrimitives[i] =\n planesPrimitives[i] && planesPrimitives[i].destroy();\n }\n planesPrimitives.length = 0;\n outlinePrimitives.length = 0;\n }\n\n if (planesPrimitives.length === 0) {\n const camera = this._camera;\n const cameraFrustum = camera.frustum;\n let frustum;\n if (cameraFrustum instanceof PerspectiveFrustum) {\n frustum = scratchPerspective;\n } else if (cameraFrustum instanceof PerspectiveOffCenterFrustum) {\n frustum = scratchPerspectiveOffCenter;\n } else if (cameraFrustum instanceof OrthographicFrustum) {\n frustum = scratchOrthographic;\n } else {\n frustum = scratchOrthographicOffCenter;\n }\n frustum = cameraFrustum.clone(frustum);\n\n let numFrustums;\n let frustumSplits = this._frustumSplits;\n if (!defined(frustumSplits) || frustumSplits.length <= 1) {\n // Use near and far planes if no splits created\n frustumSplits = scratchSplits;\n frustumSplits[0] = this._camera.frustum.near;\n frustumSplits[1] = this._camera.frustum.far;\n numFrustums = 1;\n } else {\n numFrustums = frustumSplits.length - 1;\n }\n\n const position = camera.positionWC;\n const direction = camera.directionWC;\n const up = camera.upWC;\n let right = camera.rightWC;\n right = Cartesian3.negate(right, scratchRight);\n\n const rotation = scratchRotation;\n Matrix3.setColumn(rotation, 0, right, rotation);\n Matrix3.setColumn(rotation, 1, up, rotation);\n Matrix3.setColumn(rotation, 2, direction, rotation);\n\n const orientation = Quaternion.fromRotationMatrix(\n rotation,\n scratchOrientation\n );\n\n planesPrimitives.length = outlinePrimitives.length = numFrustums;\n\n for (i = 0; i < numFrustums; ++i) {\n frustum.near = frustumSplits[i];\n frustum.far = frustumSplits[i + 1];\n\n planesPrimitives[i] = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry: new FrustumGeometry({\n origin: position,\n orientation: orientation,\n frustum: frustum,\n _drawNearPlane: i === 0,\n }),\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(\n Color.fromAlpha(this._color, 0.1, scratchColor)\n ),\n },\n id: this.id,\n pickPrimitive: this,\n }),\n appearance: new PerInstanceColorAppearance({\n translucent: true,\n flat: true,\n }),\n asynchronous: false,\n });\n\n outlinePrimitives[i] = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry: new FrustumOutlineGeometry({\n origin: position,\n orientation: orientation,\n frustum: frustum,\n _drawNearPlane: i === 0,\n }),\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(this._color),\n },\n id: this.id,\n pickPrimitive: this,\n }),\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n }\n }\n\n length = planesPrimitives.length;\n for (i = 0; i < length; ++i) {\n outlinePrimitives[i].update(frameState);\n planesPrimitives[i].update(frameState);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see DebugCameraPrimitive#destroy\n */\nDebugCameraPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * p = p && p.destroy();\n *\n * @see DebugCameraPrimitive#isDestroyed\n */\nDebugCameraPrimitive.prototype.destroy = function () {\n const length = this._planesPrimitives.length;\n for (let i = 0; i < length; ++i) {\n this._outlinePrimitives[i] =\n this._outlinePrimitives[i] && this._outlinePrimitives[i].destroy();\n this._planesPrimitives[i] =\n this._planesPrimitives[i] && this._planesPrimitives[i].destroy();\n }\n return destroyObject(this);\n};\nexport default DebugCameraPrimitive;\n", "import Color from \"../Core/Color.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport defined from \"../Core/defined.js\";\n\n/**\n * @private\n */\nfunction DebugInspector() {\n this._cachedShowFrustumsShaders = {};\n}\n\nfunction getAttributeLocations(shaderProgram) {\n const attributeLocations = {};\n const attributes = shaderProgram.vertexAttributes;\n for (const a in attributes) {\n if (attributes.hasOwnProperty(a)) {\n attributeLocations[a] = attributes[a].index;\n }\n }\n\n return attributeLocations;\n}\n\nfunction createDebugShowFrustumsShaderProgram(scene, shaderProgram) {\n const context = scene.context;\n const sp = shaderProgram;\n const fs = sp.fragmentShaderSource.clone();\n\n const targets = [];\n fs.sources = fs.sources.map(function (source) {\n source = ShaderSource.replaceMain(source, \"czm_Debug_main\");\n const re = /gl_FragData\\[(\\d+)\\]/g;\n let match;\n while ((match = re.exec(source)) !== null) {\n if (targets.indexOf(match[1]) === -1) {\n targets.push(match[1]);\n }\n }\n return source;\n });\n const length = targets.length;\n\n let newMain = \"\";\n newMain += \"uniform vec3 debugShowCommandsColor;\\n\";\n newMain += \"uniform vec3 debugShowFrustumsColor;\\n\";\n newMain += \"void main() \\n\" + \"{ \\n\" + \" czm_Debug_main(); \\n\";\n\n // set debugShowCommandsColor to Color(1.0, 1.0, 1.0, 1.0) to stop rendering scene.debugShowCommands\n // set debugShowFrustumsColor to Color(1.0, 1.0, 1.0, 1.0) to stop rendering scene.debugShowFrustums\n let i;\n if (length > 0) {\n for (i = 0; i < length; ++i) {\n newMain += ` gl_FragData[${targets[i]}].rgb *= debugShowCommandsColor;\\n`;\n newMain += ` gl_FragData[${targets[i]}].rgb *= debugShowFrustumsColor;\\n`;\n }\n } else {\n newMain += \" gl_FragColor.rgb *= debugShowCommandsColor;\\n\";\n newMain += \" gl_FragColor.rgb *= debugShowFrustumsColor;\\n\";\n }\n newMain += \"}\";\n\n fs.sources.push(newMain);\n\n const attributeLocations = getAttributeLocations(sp);\n\n return ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: sp.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n}\n\nconst scratchFrustumColor = new Color();\nfunction createDebugShowFrustumsUniformMap(scene, command) {\n // setup uniform for the shader\n let debugUniformMap;\n if (!defined(command.uniformMap)) {\n debugUniformMap = {};\n } else {\n debugUniformMap = command.uniformMap;\n }\n\n if (\n defined(debugUniformMap.debugShowCommandsColor) ||\n defined(debugUniformMap.debugShowFrustumsColor)\n ) {\n return debugUniformMap;\n }\n\n debugUniformMap.debugShowCommandsColor = function () {\n if (!scene.debugShowCommands) {\n return Color.WHITE;\n }\n\n if (!defined(command._debugColor)) {\n command._debugColor = Color.fromRandom();\n }\n\n return command._debugColor;\n };\n\n debugUniformMap.debugShowFrustumsColor = function () {\n if (!scene.debugShowFrustums) {\n return Color.WHITE;\n }\n\n // Support up to three frustums. If a command overlaps all\n // three, it's code is not changed.\n scratchFrustumColor.red =\n command.debugOverlappingFrustums & (1 << 0) ? 1.0 : 0.0;\n scratchFrustumColor.green =\n command.debugOverlappingFrustums & (1 << 1) ? 1.0 : 0.0;\n scratchFrustumColor.blue =\n command.debugOverlappingFrustums & (1 << 2) ? 1.0 : 0.0;\n scratchFrustumColor.alpha = 1.0;\n return scratchFrustumColor;\n };\n\n return debugUniformMap;\n}\n\nconst scratchShowFrustumCommand = new DrawCommand();\nDebugInspector.prototype.executeDebugShowFrustumsCommand = function (\n scene,\n command,\n passState\n) {\n // create debug command\n const shaderProgramId = command.shaderProgram.id;\n let debugShaderProgram = this._cachedShowFrustumsShaders[shaderProgramId];\n if (!defined(debugShaderProgram)) {\n debugShaderProgram = createDebugShowFrustumsShaderProgram(\n scene,\n command.shaderProgram\n );\n\n this._cachedShowFrustumsShaders[shaderProgramId] = debugShaderProgram;\n }\n\n const debugCommand = DrawCommand.shallowClone(\n command,\n scratchShowFrustumCommand\n );\n debugCommand.shaderProgram = debugShaderProgram;\n debugCommand.uniformMap = createDebugShowFrustumsUniformMap(scene, command);\n debugCommand.execute(scene.context, passState);\n};\nexport default DebugInspector;\n", "import ArcType from \"../Core/ArcType.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PolylineGeometry from \"../Core/PolylineGeometry.js\";\nimport PolylineColorAppearance from \"./PolylineColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\n\n/**\n * Draws the axes of a reference frame defined by a matrix that transforms to world\n * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is\n * a primitives <code>modelMatrix</code>.\n * <p>\n * The X axis is red; Y is green; and Z is blue.\n * </p>\n * <p>\n * This is for debugging only; it is not optimized for production use.\n * </p>\n *\n * @alias DebugModelMatrixPrimitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.length=10000000.0] The length of the axes in meters.\n * @param {Number} [options.width=2.0] The width of the axes in pixels.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}\n *\n * @example\n * primitives.add(new Cesium.DebugModelMatrixPrimitive({\n * modelMatrix : primitive.modelMatrix, // primitive to debug\n * length : 100000.0,\n * width : 10.0\n * }));\n */\nfunction DebugModelMatrixPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The length of the axes in meters.\n *\n * @type {Number}\n * @default 10000000.0\n */\n this.length = defaultValue(options.length, 10000000.0);\n this._length = undefined;\n\n /**\n * The width of the axes in pixels.\n *\n * @type {Number}\n * @default 2.0\n */\n this.width = defaultValue(options.width, 2.0);\n this._width = undefined;\n\n /**\n * Determines if this primitive will be shown.\n *\n * @type Boolean\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.\n *\n * @type {Matrix4}\n * @default {@link Matrix4.IDENTITY}\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = new Matrix4();\n\n /**\n * User-defined value returned when the primitive is picked.\n *\n * @type {*}\n * @default undefined\n *\n * @see Scene#pick\n */\n this.id = options.id;\n this._id = undefined;\n\n this._primitive = undefined;\n}\n\n/**\n * @private\n */\nDebugModelMatrixPrimitive.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n if (\n !defined(this._primitive) ||\n !Matrix4.equals(this._modelMatrix, this.modelMatrix) ||\n this._length !== this.length ||\n this._width !== this.width ||\n this._id !== this.id\n ) {\n this._modelMatrix = Matrix4.clone(this.modelMatrix, this._modelMatrix);\n this._length = this.length;\n this._width = this.width;\n this._id = this.id;\n\n if (defined(this._primitive)) {\n this._primitive.destroy();\n }\n\n // Workaround projecting (0, 0, 0)\n if (\n this.modelMatrix[12] === 0.0 &&\n this.modelMatrix[13] === 0.0 &&\n this.modelMatrix[14] === 0.0\n ) {\n this.modelMatrix[14] = 0.01;\n }\n\n const x = new GeometryInstance({\n geometry: new PolylineGeometry({\n positions: [Cartesian3.ZERO, Cartesian3.UNIT_X],\n width: this.width,\n vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n colors: [Color.RED, Color.RED],\n arcType: ArcType.NONE,\n }),\n modelMatrix: Matrix4.multiplyByUniformScale(\n this.modelMatrix,\n this.length,\n new Matrix4()\n ),\n id: this.id,\n pickPrimitive: this,\n });\n const y = new GeometryInstance({\n geometry: new PolylineGeometry({\n positions: [Cartesian3.ZERO, Cartesian3.UNIT_Y],\n width: this.width,\n vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n colors: [Color.GREEN, Color.GREEN],\n arcType: ArcType.NONE,\n }),\n modelMatrix: Matrix4.multiplyByUniformScale(\n this.modelMatrix,\n this.length,\n new Matrix4()\n ),\n id: this.id,\n pickPrimitive: this,\n });\n const z = new GeometryInstance({\n geometry: new PolylineGeometry({\n positions: [Cartesian3.ZERO, Cartesian3.UNIT_Z],\n width: this.width,\n vertexFormat: PolylineColorAppearance.VERTEX_FORMAT,\n colors: [Color.BLUE, Color.BLUE],\n arcType: ArcType.NONE,\n }),\n modelMatrix: Matrix4.multiplyByUniformScale(\n this.modelMatrix,\n this.length,\n new Matrix4()\n ),\n id: this.id,\n pickPrimitive: this,\n });\n\n this._primitive = new Primitive({\n geometryInstances: [x, y, z],\n appearance: new PolylineColorAppearance(),\n asynchronous: false,\n });\n }\n\n this._primitive.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see DebugModelMatrixPrimitive#destroy\n */\nDebugModelMatrixPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * p = p && p.destroy();\n *\n * @see DebugModelMatrixPrimitive#isDestroyed\n */\nDebugModelMatrixPrimitive.prototype.destroy = function () {\n this._primitive = this._primitive && this._primitive.destroy();\n return destroyObject(this);\n};\nexport default DebugModelMatrixPrimitive;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport Geometry from \"../Core/Geometry.js\";\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport DepthPlaneFS from \"../Shaders/DepthPlaneFS.js\";\nimport DepthPlaneVS from \"../Shaders/DepthPlaneVS.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\n\n/**\n * @private\n */\nfunction DepthPlane(depthPlaneEllipsoidOffset) {\n this._rs = undefined;\n this._sp = undefined;\n this._va = undefined;\n this._command = undefined;\n this._mode = undefined;\n this._useLogDepth = false;\n this._ellipsoidOffset = defaultValue(depthPlaneEllipsoidOffset, 0);\n}\n\nconst depthQuadScratch = FeatureDetection.supportsTypedArrays()\n ? new Float32Array(12)\n : [];\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst scratchCartesian5 = new Cartesian3();\n\nfunction computeDepthQuad(ellipsoid, frameState) {\n const radii = ellipsoid.radii;\n const camera = frameState.camera;\n let center, eastOffset, northOffset;\n\n if (camera.frustum instanceof OrthographicFrustum) {\n center = Cartesian3.ZERO;\n eastOffset = camera.rightWC;\n northOffset = camera.upWC;\n } else {\n const p = camera.positionWC;\n\n // Find the corresponding position in the scaled space of the ellipsoid.\n const q = Cartesian3.multiplyComponents(\n ellipsoid.oneOverRadii,\n p,\n scratchCartesian1\n );\n\n const qUnit = Cartesian3.normalize(q, scratchCartesian2);\n\n // Determine the east and north directions at q.\n const eUnit = Cartesian3.normalize(\n Cartesian3.cross(Cartesian3.UNIT_Z, q, scratchCartesian3),\n scratchCartesian3\n );\n const nUnit = Cartesian3.normalize(\n Cartesian3.cross(qUnit, eUnit, scratchCartesian4),\n scratchCartesian4\n );\n\n const qMagnitude = Cartesian3.magnitude(q);\n\n // Determine the radius of the 'limb' of the ellipsoid.\n const wMagnitude = Math.sqrt(qMagnitude * qMagnitude - 1.0);\n\n // Compute the center and offsets.\n center = Cartesian3.multiplyByScalar(\n qUnit,\n 1.0 / qMagnitude,\n scratchCartesian1\n );\n const scalar = wMagnitude / qMagnitude;\n eastOffset = Cartesian3.multiplyByScalar(eUnit, scalar, scratchCartesian2);\n northOffset = Cartesian3.multiplyByScalar(nUnit, scalar, scratchCartesian3);\n }\n\n // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.\n const upperLeft = Cartesian3.add(center, northOffset, scratchCartesian5);\n Cartesian3.subtract(upperLeft, eastOffset, upperLeft);\n Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);\n Cartesian3.pack(upperLeft, depthQuadScratch, 0);\n\n const lowerLeft = Cartesian3.subtract(center, northOffset, scratchCartesian5);\n Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);\n Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);\n Cartesian3.pack(lowerLeft, depthQuadScratch, 3);\n\n const upperRight = Cartesian3.add(center, northOffset, scratchCartesian5);\n Cartesian3.add(upperRight, eastOffset, upperRight);\n Cartesian3.multiplyComponents(radii, upperRight, upperRight);\n Cartesian3.pack(upperRight, depthQuadScratch, 6);\n\n const lowerRight = Cartesian3.subtract(\n center,\n northOffset,\n scratchCartesian5\n );\n Cartesian3.add(lowerRight, eastOffset, lowerRight);\n Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);\n Cartesian3.pack(lowerRight, depthQuadScratch, 9);\n\n return depthQuadScratch;\n}\n\nDepthPlane.prototype.update = function (frameState) {\n this._mode = frameState.mode;\n if (frameState.mode !== SceneMode.SCENE3D) {\n return;\n }\n\n const context = frameState.context;\n\n // Allow offsetting the ellipsoid radius to address rendering artefacts below ellipsoid zero elevation.\n const radii = frameState.mapProjection.ellipsoid.radii;\n const ellipsoid = new Ellipsoid(\n radii.x + this._ellipsoidOffset,\n radii.y + this._ellipsoidOffset,\n radii.z + this._ellipsoidOffset\n );\n\n const useLogDepth = frameState.useLogDepth;\n\n if (!defined(this._command)) {\n this._rs = RenderState.fromCache({\n // Write depth, not color\n cull: {\n enabled: true,\n },\n depthTest: {\n enabled: true,\n },\n colorMask: {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n },\n });\n\n this._command = new DrawCommand({\n renderState: this._rs,\n boundingVolume: new BoundingSphere(\n Cartesian3.ZERO,\n ellipsoid.maximumRadius\n ),\n pass: Pass.OPAQUE,\n owner: this,\n });\n }\n\n if (!defined(this._sp) || this._useLogDepth !== useLogDepth) {\n this._useLogDepth = useLogDepth;\n\n const vs = new ShaderSource({\n sources: [DepthPlaneVS],\n });\n const fs = new ShaderSource({\n sources: [DepthPlaneFS],\n });\n if (useLogDepth) {\n const extension =\n \"#ifdef GL_EXT_frag_depth \\n\" +\n \"#extension GL_EXT_frag_depth : enable \\n\" +\n \"#endif \\n\\n\";\n\n fs.sources.push(extension);\n fs.defines.push(\"LOG_DEPTH\");\n vs.defines.push(\"LOG_DEPTH\");\n }\n\n this._sp = ShaderProgram.replaceCache({\n shaderProgram: this._sp,\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: {\n position: 0,\n },\n });\n\n this._command.shaderProgram = this._sp;\n }\n\n // update depth plane\n const depthQuad = computeDepthQuad(ellipsoid, frameState);\n\n // depth plane\n if (!defined(this._va)) {\n const geometry = new Geometry({\n attributes: {\n position: new GeometryAttribute({\n componentDatatype: ComponentDatatype.FLOAT,\n componentsPerAttribute: 3,\n values: depthQuad,\n }),\n },\n indices: [0, 1, 2, 2, 1, 3],\n primitiveType: PrimitiveType.TRIANGLES,\n });\n\n this._va = VertexArray.fromGeometry({\n context: context,\n geometry: geometry,\n attributeLocations: {\n position: 0,\n },\n bufferUsage: BufferUsage.DYNAMIC_DRAW,\n });\n\n this._command.vertexArray = this._va;\n } else {\n this._va.getAttribute(0).vertexBuffer.copyFromArrayView(depthQuad);\n }\n};\n\nDepthPlane.prototype.execute = function (context, passState) {\n if (this._mode === SceneMode.SCENE3D) {\n this._command.execute(context, passState);\n }\n};\n\nDepthPlane.prototype.isDestroyed = function () {\n return false;\n};\n\nDepthPlane.prototype.destroy = function () {\n this._sp = this._sp && this._sp.destroy();\n this._va = this._va && this._va.destroy();\n};\nexport default DepthPlane;\n", "import defined from \"../Core/defined.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * @private\n */\nfunction DerivedCommand() {}\n\nconst fragDepthRegex = /\\bgl_FragDepthEXT\\b/;\nconst discardRegex = /\\bdiscard\\b/;\n\nfunction getDepthOnlyShaderProgram(context, shaderProgram) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n \"depthOnly\"\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n let fs = shaderProgram.fragmentShaderSource;\n\n let i;\n let writesDepthOrDiscards = false;\n const sources = fs.sources;\n let length = sources.length;\n for (i = 0; i < length; ++i) {\n if (fragDepthRegex.test(sources[i]) || discardRegex.test(sources[i])) {\n writesDepthOrDiscards = true;\n break;\n }\n }\n\n let usesLogDepth = false;\n const defines = fs.defines;\n length = defines.length;\n for (i = 0; i < length; ++i) {\n if (defines[i] === \"LOG_DEPTH\") {\n usesLogDepth = true;\n break;\n }\n }\n\n let source;\n if (!writesDepthOrDiscards && !usesLogDepth) {\n source =\n \"void main() \\n\" + \"{ \\n\" + \" gl_FragColor = vec4(1.0); \\n\" + \"} \\n\";\n fs = new ShaderSource({\n sources: [source],\n });\n } else if (!writesDepthOrDiscards && usesLogDepth) {\n source =\n \"#ifdef GL_EXT_frag_depth \\n\" +\n \"#extension GL_EXT_frag_depth : enable \\n\" +\n \"#endif \\n\\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" gl_FragColor = vec4(1.0); \\n\" +\n \" czm_writeLogDepth(); \\n\" +\n \"} \\n\";\n fs = new ShaderSource({\n defines: [\"LOG_DEPTH\"],\n sources: [source],\n });\n }\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"depthOnly\",\n {\n vertexShaderSource: shaderProgram.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nfunction getDepthOnlyRenderState(scene, renderState) {\n const cache = scene._depthOnlyRenderStateCache;\n let depthOnlyState = cache[renderState.id];\n if (!defined(depthOnlyState)) {\n const rs = RenderState.getState(renderState);\n rs.depthMask = true;\n rs.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n\n depthOnlyState = RenderState.fromCache(rs);\n cache[renderState.id] = depthOnlyState;\n }\n\n return depthOnlyState;\n}\n\nDerivedCommand.createDepthOnlyDerivedCommand = function (\n scene,\n command,\n context,\n result\n) {\n // For a depth only pass, we bind a framebuffer with only a depth attachment (no color attachments),\n // do not write color, and write depth. If the fragment shader doesn't modify the fragment depth\n // or discard, the driver can replace the fragment shader with a pass-through shader. We're unsure if this\n // actually happens so we modify the shader to use a pass-through fragment shader.\n\n if (!defined(result)) {\n result = {};\n }\n\n let shader;\n let renderState;\n if (defined(result.depthOnlyCommand)) {\n shader = result.depthOnlyCommand.shaderProgram;\n renderState = result.depthOnlyCommand.renderState;\n }\n\n result.depthOnlyCommand = DrawCommand.shallowClone(\n command,\n result.depthOnlyCommand\n );\n\n if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n result.depthOnlyCommand.shaderProgram = getDepthOnlyShaderProgram(\n context,\n command.shaderProgram\n );\n result.depthOnlyCommand.renderState = getDepthOnlyRenderState(\n scene,\n command.renderState\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.depthOnlyCommand.shaderProgram = shader;\n result.depthOnlyCommand.renderState = renderState;\n }\n\n return result;\n};\n\nconst writeLogDepthRegex = /\\s+czm_writeLogDepth\\(/;\nconst vertexlogDepthRegex = /\\s+czm_vertexLogDepth\\(/;\nconst extensionRegex = /\\s*#extension\\s+GL_EXT_frag_depth\\s*:\\s*enable/;\n\nfunction getLogDepthShaderProgram(context, shaderProgram) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n \"logDepth\"\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n const vs = shaderProgram.vertexShaderSource.clone();\n const fs = shaderProgram.fragmentShaderSource.clone();\n\n vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n vs.defines.push(\"LOG_DEPTH\");\n fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n fs.defines.push(\"LOG_DEPTH\");\n\n let i;\n let logMain;\n let writesLogDepth = false;\n let sources = vs.sources;\n let length = sources.length;\n for (i = 0; i < length; ++i) {\n if (vertexlogDepthRegex.test(sources[i])) {\n writesLogDepth = true;\n break;\n }\n }\n\n if (!writesLogDepth) {\n for (i = 0; i < length; ++i) {\n sources[i] = ShaderSource.replaceMain(sources[i], \"czm_log_depth_main\");\n }\n\n logMain =\n \"\\n\\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_log_depth_main(); \\n\" +\n \" czm_vertexLogDepth(); \\n\" +\n \"} \\n\";\n sources.push(logMain);\n }\n\n sources = fs.sources;\n length = sources.length;\n\n writesLogDepth = false;\n for (i = 0; i < length; ++i) {\n if (writeLogDepthRegex.test(sources[i])) {\n writesLogDepth = true;\n }\n }\n // This define indicates that a log depth value is written by the shader but doesn't use czm_writeLogDepth.\n if (fs.defines.indexOf(\"LOG_DEPTH_WRITE\") !== -1) {\n writesLogDepth = true;\n }\n\n let addExtension = true;\n for (i = 0; i < length; ++i) {\n if (extensionRegex.test(sources[i])) {\n addExtension = false;\n }\n }\n\n let logSource = \"\";\n if (addExtension) {\n logSource +=\n \"#ifdef GL_EXT_frag_depth \\n\" +\n \"#extension GL_EXT_frag_depth : enable \\n\" +\n \"#endif \\n\\n\";\n }\n\n if (!writesLogDepth) {\n for (i = 0; i < length; i++) {\n sources[i] = ShaderSource.replaceMain(sources[i], \"czm_log_depth_main\");\n }\n\n logSource +=\n \"\\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_log_depth_main(); \\n\" +\n \" czm_writeLogDepth(); \\n\" +\n \"} \\n\";\n }\n\n sources.push(logSource);\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"logDepth\",\n {\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nDerivedCommand.createLogDepthCommand = function (command, context, result) {\n if (!defined(result)) {\n result = {};\n }\n\n let shader;\n if (defined(result.command)) {\n shader = result.command.shaderProgram;\n }\n\n result.command = DrawCommand.shallowClone(command, result.command);\n\n if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n result.command.shaderProgram = getLogDepthShaderProgram(\n context,\n command.shaderProgram\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.command.shaderProgram = shader;\n }\n\n return result;\n};\n\nfunction getPickShaderProgram(context, shaderProgram, pickId) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n \"pick\"\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n let fs = shaderProgram.fragmentShaderSource;\n\n const sources = fs.sources;\n const length = sources.length;\n\n const newMain =\n `${\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_non_pick_main(); \\n\" +\n \" if (gl_FragColor.a == 0.0) { \\n\" +\n \" discard; \\n\" +\n \" } \\n\" +\n \" gl_FragColor = \"\n }${pickId}; \\n` + `} \\n`;\n const newSources = new Array(length + 1);\n for (let i = 0; i < length; ++i) {\n newSources[i] = ShaderSource.replaceMain(sources[i], \"czm_non_pick_main\");\n }\n newSources[length] = newMain;\n fs = new ShaderSource({\n sources: newSources,\n defines: fs.defines,\n });\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"pick\",\n {\n vertexShaderSource: shaderProgram.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nfunction getPickRenderState(scene, renderState) {\n const cache = scene.picking.pickRenderStateCache;\n let pickState = cache[renderState.id];\n if (!defined(pickState)) {\n const rs = RenderState.getState(renderState);\n rs.blending.enabled = false;\n\n // Turns on depth writing for opaque and translucent passes\n // Overlapping translucent geometry on the globe surface may exhibit z-fighting\n // during the pick pass which may not match the rendered scene. Once\n // terrain is on by default and ground primitives are used instead\n // this will become less of a problem.\n rs.depthMask = true;\n\n pickState = RenderState.fromCache(rs);\n cache[renderState.id] = pickState;\n }\n\n return pickState;\n}\n\nDerivedCommand.createPickDerivedCommand = function (\n scene,\n command,\n context,\n result\n) {\n if (!defined(result)) {\n result = {};\n }\n\n let shader;\n let renderState;\n if (defined(result.pickCommand)) {\n shader = result.pickCommand.shaderProgram;\n renderState = result.pickCommand.renderState;\n }\n\n result.pickCommand = DrawCommand.shallowClone(command, result.pickCommand);\n\n if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n result.pickCommand.shaderProgram = getPickShaderProgram(\n context,\n command.shaderProgram,\n command.pickId\n );\n result.pickCommand.renderState = getPickRenderState(\n scene,\n command.renderState\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.pickCommand.shaderProgram = shader;\n result.pickCommand.renderState = renderState;\n }\n\n return result;\n};\n\nfunction getHdrShaderProgram(context, shaderProgram) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n \"HDR\"\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n const vs = shaderProgram.vertexShaderSource.clone();\n const fs = shaderProgram.fragmentShaderSource.clone();\n\n vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n vs.defines.push(\"HDR\");\n fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n fs.defines.push(\"HDR\");\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n \"HDR\",\n {\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nDerivedCommand.createHdrCommand = function (command, context, result) {\n if (!defined(result)) {\n result = {};\n }\n\n let shader;\n if (defined(result.command)) {\n shader = result.command.shaderProgram;\n }\n\n result.command = DrawCommand.shallowClone(command, result.command);\n\n if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {\n result.command.shaderProgram = getHdrShaderProgram(\n context,\n command.shaderProgram\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.command.shaderProgram = shader;\n }\n\n return result;\n};\nexport default DerivedCommand;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\n\n/**\n * @private\n */\nfunction DeviceOrientationCameraController(scene) {\n this._scene = scene;\n\n this._lastAlpha = undefined;\n this._lastBeta = undefined;\n this._lastGamma = undefined;\n\n this._alpha = undefined;\n this._beta = undefined;\n this._gamma = undefined;\n\n const that = this;\n\n function callback(e) {\n const alpha = e.alpha;\n if (!defined(alpha)) {\n that._alpha = undefined;\n that._beta = undefined;\n that._gamma = undefined;\n return;\n }\n\n that._alpha = CesiumMath.toRadians(alpha);\n that._beta = CesiumMath.toRadians(e.beta);\n that._gamma = CesiumMath.toRadians(e.gamma);\n }\n\n window.addEventListener(\"deviceorientation\", callback, false);\n\n this._removeListener = function () {\n window.removeEventListener(\"deviceorientation\", callback, false);\n };\n}\n\nconst scratchQuaternion1 = new Quaternion();\nconst scratchQuaternion2 = new Quaternion();\nconst scratchMatrix3 = new Matrix3();\n\nfunction rotate(camera, alpha, beta, gamma) {\n const direction = camera.direction;\n const right = camera.right;\n const up = camera.up;\n\n const bQuat = Quaternion.fromAxisAngle(direction, beta, scratchQuaternion2);\n const gQuat = Quaternion.fromAxisAngle(right, gamma, scratchQuaternion1);\n\n const rotQuat = Quaternion.multiply(gQuat, bQuat, gQuat);\n\n const aQuat = Quaternion.fromAxisAngle(up, alpha, scratchQuaternion2);\n Quaternion.multiply(aQuat, rotQuat, rotQuat);\n\n const matrix = Matrix3.fromQuaternion(rotQuat, scratchMatrix3);\n Matrix3.multiplyByVector(matrix, right, right);\n Matrix3.multiplyByVector(matrix, up, up);\n Matrix3.multiplyByVector(matrix, direction, direction);\n}\n\nDeviceOrientationCameraController.prototype.update = function () {\n if (!defined(this._alpha)) {\n return;\n }\n\n if (!defined(this._lastAlpha)) {\n this._lastAlpha = this._alpha;\n this._lastBeta = this._beta;\n this._lastGamma = this._gamma;\n }\n\n const a = this._lastAlpha - this._alpha;\n const b = this._lastBeta - this._beta;\n const g = this._lastGamma - this._gamma;\n\n rotate(this._scene.camera, -a, b, g);\n\n this._lastAlpha = this._alpha;\n this._lastBeta = this._beta;\n this._lastGamma = this._gamma;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nDeviceOrientationCameraController.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the resources held by this object. Destroying an object allows for deterministic\n * release of resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nDeviceOrientationCameraController.prototype.destroy = function () {\n this._removeListener();\n return destroyObject(this);\n};\nexport default DeviceOrientationCameraController;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A light that gets emitted in a single direction from infinitely far away.\n *\n * @param {Object} options Object with the following properties:\n * @param {Cartesian3} options.direction The direction in which light gets emitted.\n * @param {Color} [options.color=Color.WHITE] The color of the light.\n * @param {Number} [options.intensity=1.0] The intensity of the light.\n *\n * @exception {DeveloperError} options.direction cannot be zero-length\n *\n * @alias DirectionalLight\n * @constructor\n */\nfunction DirectionalLight(options) {\n /**\n * The direction in which light gets emitted.\n * @type {Cartesian3}\n */\n this.direction = Cartesian3.clone(options.direction);\n\n /**\n * The color of the light.\n * @type {Color}\n * @default Color.WHITE\n */\n this.color = Color.clone(defaultValue(options.color, Color.WHITE));\n\n /**\n * The intensity of the light.\n * @type {Number}\n * @default 1.0\n */\n this.intensity = defaultValue(options.intensity, 1.0);\n}\n\nexport default DirectionalLight;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport EllipsoidFS from \"../Shaders/EllipsoidFS.js\";\nimport EllipsoidVS from \"../Shaders/EllipsoidVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport Material from \"./Material.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst attributeLocations = {\n position: 0,\n};\n\n/**\n * A renderable ellipsoid. It can also draw spheres when the three {@link EllipsoidPrimitive#radii} components are equal.\n * <p>\n * This is only supported in 3D. The ellipsoid is not shown in 2D or Columbus view.\n * </p>\n *\n * @alias EllipsoidPrimitive\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Cartesian3} [options.center=Cartesian3.ZERO] The center of the ellipsoid in the ellipsoid's model coordinates.\n * @param {Cartesian3} [options.radii] The radius of the ellipsoid along the <code>x</code>, <code>y</code>, and <code>z</code> axes in the ellipsoid's model coordinates.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the ellipsoid from model to world coordinates.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n * @param {Material} [options.material=Material.ColorType] The surface appearance of the primitive.\n * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick}\n * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.\n *\n * @private\n */\nfunction EllipsoidPrimitive(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The center of the ellipsoid in the ellipsoid's model coordinates.\n * <p>\n * The default is {@link Cartesian3.ZERO}.\n * </p>\n *\n * @type {Cartesian3}\n * @default {@link Cartesian3.ZERO}\n *\n * @see EllipsoidPrimitive#modelMatrix\n */\n this.center = Cartesian3.clone(defaultValue(options.center, Cartesian3.ZERO));\n this._center = new Cartesian3();\n\n /**\n * The radius of the ellipsoid along the <code>x</code>, <code>y</code>, and <code>z</code> axes in the ellipsoid's model coordinates.\n * When these are the same, the ellipsoid is a sphere.\n * <p>\n * The default is <code>undefined</code>. The ellipsoid is not drawn until a radii is provided.\n * </p>\n *\n * @type {Cartesian3}\n * @default undefined\n *\n *\n * @example\n * // A sphere with a radius of 2.0\n * e.radii = new Cesium.Cartesian3(2.0, 2.0, 2.0);\n *\n * @see EllipsoidPrimitive#modelMatrix\n */\n this.radii = Cartesian3.clone(options.radii);\n this._radii = new Cartesian3();\n\n this._oneOverEllipsoidRadiiSquared = new Cartesian3();\n this._boundingSphere = new BoundingSphere();\n\n /**\n * The 4x4 transformation matrix that transforms the ellipsoid from model to world coordinates.\n * When this is the identity matrix, the ellipsoid is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\n * Local reference frames can be used by providing a different transformation matrix, like that returned\n * by {@link Transforms.eastNorthUpToFixedFrame}.\n *\n * @type {Matrix4}\n * @default {@link Matrix4.IDENTITY}\n *\n * @example\n * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);\n * e.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._modelMatrix = new Matrix4();\n this._computedModelMatrix = new Matrix4();\n\n /**\n * Determines if the ellipsoid primitive will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The surface appearance of the ellipsoid. This can be one of several built-in {@link Material} objects or a custom material, scripted with\n * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n * <p>\n * The default material is <code>Material.ColorType</code>.\n * </p>\n *\n * @type {Material}\n * @default Material.fromType(Material.ColorType)\n *\n *\n * @example\n * // 1. Change the color of the default material to yellow\n * e.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n *\n * // 2. Change material to horizontal stripes\n * e.material = Cesium.Material.fromType(Cesium.Material.StripeType);\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = defaultValue(\n options.material,\n Material.fromType(Material.ColorType)\n );\n this._material = undefined;\n this._translucent = undefined;\n\n /**\n * User-defined object returned when the ellipsoid is picked.\n *\n * @type Object\n *\n * @default undefined\n *\n * @see Scene#pick\n */\n this.id = options.id;\n this._id = undefined;\n\n /**\n * This property is for debugging only; it is not for production use nor is it optimized.\n * <p>\n * Draws the bounding sphere for each draw command in the primitive.\n * </p>\n *\n * @type {Boolean}\n *\n * @default false\n */\n this.debugShowBoundingVolume = defaultValue(\n options.debugShowBoundingVolume,\n false\n );\n\n /**\n * @private\n */\n this.onlySunLighting = defaultValue(options.onlySunLighting, false);\n this._onlySunLighting = false;\n\n /**\n * @private\n */\n this._depthTestEnabled = defaultValue(options.depthTestEnabled, true);\n\n this._useLogDepth = false;\n\n this._sp = undefined;\n this._rs = undefined;\n this._va = undefined;\n\n this._pickSP = undefined;\n this._pickId = undefined;\n\n this._colorCommand = new DrawCommand({\n owner: defaultValue(options._owner, this),\n });\n this._pickCommand = new DrawCommand({\n owner: defaultValue(options._owner, this),\n pickOnly: true,\n });\n\n const that = this;\n this._uniforms = {\n u_radii: function () {\n return that.radii;\n },\n u_oneOverEllipsoidRadiiSquared: function () {\n return that._oneOverEllipsoidRadiiSquared;\n },\n };\n\n this._pickUniforms = {\n czm_pickColor: function () {\n return that._pickId.color;\n },\n };\n}\n\nfunction getVertexArray(context) {\n let vertexArray = context.cache.ellipsoidPrimitive_vertexArray;\n\n if (defined(vertexArray)) {\n return vertexArray;\n }\n\n const geometry = BoxGeometry.createGeometry(\n BoxGeometry.fromDimensions({\n dimensions: new Cartesian3(2.0, 2.0, 2.0),\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n\n vertexArray = VertexArray.fromGeometry({\n context: context,\n geometry: geometry,\n attributeLocations: attributeLocations,\n bufferUsage: BufferUsage.STATIC_DRAW,\n interleave: true,\n });\n\n context.cache.ellipsoidPrimitive_vertexArray = vertexArray;\n return vertexArray;\n}\n\nconst logDepthExtension =\n \"#ifdef GL_EXT_frag_depth \\n\" +\n \"#extension GL_EXT_frag_depth : enable \\n\" +\n \"#endif \\n\\n\";\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.material must be defined.\n */\nEllipsoidPrimitive.prototype.update = function (frameState) {\n if (\n !this.show ||\n frameState.mode !== SceneMode.SCENE3D ||\n !defined(this.center) ||\n !defined(this.radii)\n ) {\n return;\n }\n\n const context = frameState.context;\n const translucent = this.material.isTranslucent();\n const translucencyChanged = this._translucent !== translucent;\n\n if (!defined(this._rs) || translucencyChanged) {\n this._translucent = translucent;\n\n // If this render state is ever updated to use a non-default\n // depth range, the hard-coded values in EllipsoidVS.glsl need\n // to be updated as well.\n\n this._rs = RenderState.fromCache({\n // Cull front faces - not back faces - so the ellipsoid doesn't\n // disappear if the viewer enters the bounding box.\n cull: {\n enabled: true,\n face: CullFace.FRONT,\n },\n depthTest: {\n enabled: this._depthTestEnabled,\n },\n // Only write depth when EXT_frag_depth is supported since the depth for\n // the bounding box is wrong; it is not the true depth of the ray casted ellipsoid.\n depthMask: !translucent && context.fragmentDepth,\n blending: translucent ? BlendingState.ALPHA_BLEND : undefined,\n });\n }\n\n if (!defined(this._va)) {\n this._va = getVertexArray(context);\n }\n\n let boundingSphereDirty = false;\n\n const radii = this.radii;\n if (!Cartesian3.equals(this._radii, radii)) {\n Cartesian3.clone(radii, this._radii);\n\n const r = this._oneOverEllipsoidRadiiSquared;\n r.x = 1.0 / (radii.x * radii.x);\n r.y = 1.0 / (radii.y * radii.y);\n r.z = 1.0 / (radii.z * radii.z);\n\n boundingSphereDirty = true;\n }\n\n if (\n !Matrix4.equals(this.modelMatrix, this._modelMatrix) ||\n !Cartesian3.equals(this.center, this._center)\n ) {\n Matrix4.clone(this.modelMatrix, this._modelMatrix);\n Cartesian3.clone(this.center, this._center);\n\n // Translate model coordinates used for rendering such that the origin is the center of the ellipsoid.\n Matrix4.multiplyByTranslation(\n this.modelMatrix,\n this.center,\n this._computedModelMatrix\n );\n boundingSphereDirty = true;\n }\n\n if (boundingSphereDirty) {\n Cartesian3.clone(Cartesian3.ZERO, this._boundingSphere.center);\n this._boundingSphere.radius = Cartesian3.maximumComponent(radii);\n BoundingSphere.transform(\n this._boundingSphere,\n this._computedModelMatrix,\n this._boundingSphere\n );\n }\n\n const materialChanged = this._material !== this.material;\n this._material = this.material;\n this._material.update(context);\n\n const lightingChanged = this.onlySunLighting !== this._onlySunLighting;\n this._onlySunLighting = this.onlySunLighting;\n\n const useLogDepth = frameState.useLogDepth;\n const useLogDepthChanged = this._useLogDepth !== useLogDepth;\n this._useLogDepth = useLogDepth;\n\n const colorCommand = this._colorCommand;\n let vs;\n let fs;\n\n // Recompile shader when material, lighting, or translucency changes\n if (\n materialChanged ||\n lightingChanged ||\n translucencyChanged ||\n useLogDepthChanged\n ) {\n vs = new ShaderSource({\n sources: [EllipsoidVS],\n });\n fs = new ShaderSource({\n sources: [this.material.shaderSource, EllipsoidFS],\n });\n if (this.onlySunLighting) {\n fs.defines.push(\"ONLY_SUN_LIGHTING\");\n }\n if (!translucent && context.fragmentDepth) {\n fs.defines.push(\"WRITE_DEPTH\");\n }\n if (this._useLogDepth) {\n vs.defines.push(\"LOG_DEPTH\");\n fs.defines.push(\"LOG_DEPTH\");\n fs.sources.push(logDepthExtension);\n }\n\n this._sp = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._sp,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n colorCommand.vertexArray = this._va;\n colorCommand.renderState = this._rs;\n colorCommand.shaderProgram = this._sp;\n colorCommand.uniformMap = combine(this._uniforms, this.material._uniforms);\n colorCommand.executeInClosestFrustum = translucent;\n }\n\n const commandList = frameState.commandList;\n const passes = frameState.passes;\n\n if (passes.render) {\n colorCommand.boundingVolume = this._boundingSphere;\n colorCommand.debugShowBoundingVolume = this.debugShowBoundingVolume;\n colorCommand.modelMatrix = this._computedModelMatrix;\n colorCommand.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n commandList.push(colorCommand);\n }\n\n if (passes.pick) {\n const pickCommand = this._pickCommand;\n\n if (!defined(this._pickId) || this._id !== this.id) {\n this._id = this.id;\n this._pickId = this._pickId && this._pickId.destroy();\n this._pickId = context.createPickId({\n primitive: this,\n id: this.id,\n });\n }\n\n // Recompile shader when material changes\n if (\n materialChanged ||\n lightingChanged ||\n !defined(this._pickSP) ||\n useLogDepthChanged\n ) {\n vs = new ShaderSource({\n sources: [EllipsoidVS],\n });\n fs = new ShaderSource({\n sources: [this.material.shaderSource, EllipsoidFS],\n pickColorQualifier: \"uniform\",\n });\n if (this.onlySunLighting) {\n fs.defines.push(\"ONLY_SUN_LIGHTING\");\n }\n if (!translucent && context.fragmentDepth) {\n fs.defines.push(\"WRITE_DEPTH\");\n }\n if (this._useLogDepth) {\n vs.defines.push(\"LOG_DEPTH\");\n fs.defines.push(\"LOG_DEPTH\");\n fs.sources.push(logDepthExtension);\n }\n\n this._pickSP = ShaderProgram.replaceCache({\n context: context,\n shaderProgram: this._pickSP,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n pickCommand.vertexArray = this._va;\n pickCommand.renderState = this._rs;\n pickCommand.shaderProgram = this._pickSP;\n pickCommand.uniformMap = combine(\n combine(this._uniforms, this._pickUniforms),\n this.material._uniforms\n );\n pickCommand.executeInClosestFrustum = translucent;\n }\n\n pickCommand.boundingVolume = this._boundingSphere;\n pickCommand.modelMatrix = this._computedModelMatrix;\n pickCommand.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE;\n\n commandList.push(pickCommand);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see EllipsoidPrimitive#destroy\n */\nEllipsoidPrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * e = e && e.destroy();\n *\n * @see EllipsoidPrimitive#isDestroyed\n */\nEllipsoidPrimitive.prototype.destroy = function () {\n this._sp = this._sp && this._sp.destroy();\n this._pickSP = this._pickSP && this._pickSP.destroy();\n this._pickId = this._pickId && this._pickId.destroy();\n return destroyObject(this);\n};\nexport default EllipsoidPrimitive;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec3 v_positionMC;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nczm_materialInput materialInput;\\n\\\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\\n\\\n#ifdef FACE_FORWARD\\n\\\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\\n\\\n#endif\\n\\\nmaterialInput.s = v_st.s;\\n\\\nmaterialInput.st = v_st;\\n\\\nmaterialInput.str = vec3(v_st, 0.0);\\n\\\nmaterialInput.normalEC = normalEC;\\n\\\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\\n\\\nvec3 positionToEyeEC = -v_positionEC;\\n\\\nmaterialInput.positionToEyeEC = positionToEyeEC;\\n\\\nczm_material material = czm_getMaterial(materialInput);\\n\\\n#ifdef FLAT\\n\\\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\\n\\\n#else\\n\\\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"attribute vec3 position3DHigh;\\n\\\nattribute vec3 position3DLow;\\n\\\nattribute vec2 st;\\n\\\nattribute float batchId;\\n\\\nvarying vec3 v_positionMC;\\n\\\nvarying vec3 v_positionEC;\\n\\\nvarying vec2 v_st;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 p = czm_computePosition();\\n\\\nv_positionMC = position3DHigh + position3DLow;\\n\\\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\\n\\\nv_st = st;\\n\\\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\\n\\\n}\\n\\\n\";\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport EllipsoidSurfaceAppearanceFS from \"../Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js\";\nimport EllipsoidSurfaceAppearanceVS from \"../Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js\";\nimport Appearance from \"./Appearance.js\";\nimport Material from \"./Material.js\";\n\n/**\n * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}\n * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}\n * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires\n * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,\n * <code>tangent</code>, and <code>bitangent</code>.\n *\n * @alias EllipsoidSurfaceAppearance\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.flat=false] When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.\n * @param {Boolean} [options.faceForward=options.aboveGround] When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.\n * @param {Boolean} [options.translucent=true] When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.\n * @param {Boolean} [options.aboveGround=false] When <code>true</code>, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.\n * @param {Material} [options.material=Material.ColorType] The material used to determine the fragment color.\n * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.\n * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.\n * @param {Object} [options.renderState] Optional render state to override the default render state.\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n *\n * @example\n * const primitive = new Cesium.Primitive({\n * geometryInstances : new Cesium.GeometryInstance({\n * geometry : new Cesium.PolygonGeometry({\n * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,\n * // ...\n * })\n * }),\n * appearance : new Cesium.EllipsoidSurfaceAppearance({\n * material : Cesium.Material.fromType('Stripe')\n * })\n * });\n */\nfunction EllipsoidSurfaceAppearance(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const translucent = defaultValue(options.translucent, true);\n const aboveGround = defaultValue(options.aboveGround, false);\n\n /**\n * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}\n * properties, this is not read-only, so an appearance's material can change on the fly.\n *\n * @type Material\n *\n * @default {@link Material.ColorType}\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = defined(options.material)\n ? options.material\n : Material.fromType(Material.ColorType);\n\n /**\n * When <code>true</code>, the geometry is expected to appear translucent.\n *\n * @type {Boolean}\n *\n * @default true\n */\n this.translucent = defaultValue(options.translucent, true);\n\n this._vertexShaderSource = defaultValue(\n options.vertexShaderSource,\n EllipsoidSurfaceAppearanceVS\n );\n this._fragmentShaderSource = defaultValue(\n options.fragmentShaderSource,\n EllipsoidSurfaceAppearanceFS\n );\n this._renderState = Appearance.getDefaultRenderState(\n translucent,\n !aboveGround,\n options.renderState\n );\n this._closed = false;\n\n // Non-derived members\n\n this._flat = defaultValue(options.flat, false);\n this._faceForward = defaultValue(options.faceForward, aboveGround);\n this._aboveGround = aboveGround;\n}\n\nObject.defineProperties(EllipsoidSurfaceAppearance.prototype, {\n /**\n * The GLSL source code for the vertex shader.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n vertexShaderSource: {\n get: function () {\n return this._vertexShaderSource;\n },\n },\n\n /**\n * The GLSL source code for the fragment shader. The full fragment shader\n * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},\n * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.\n * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {String}\n * @readonly\n */\n fragmentShaderSource: {\n get: function () {\n return this._fragmentShaderSource;\n },\n },\n\n /**\n * The WebGL fixed-function state to use when rendering the geometry.\n * <p>\n * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}\n * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}\n * and {@link EllipsoidSurfaceAppearance#aboveGround}.\n * </p>\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {Object}\n * @readonly\n */\n renderState: {\n get: function () {\n return this._renderState;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be closed so\n * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.\n * If the viewer enters the geometry, it will not be visible.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n closed: {\n get: function () {\n return this._closed;\n },\n },\n\n /**\n * The {@link VertexFormat} that this appearance instance is compatible with.\n * A geometry can have more vertex attributes and still be compatible - at a\n * potential performance cost - but it can't have less.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type VertexFormat\n * @readonly\n *\n * @default {@link EllipsoidSurfaceAppearance.VERTEX_FORMAT}\n */\n vertexFormat: {\n get: function () {\n return EllipsoidSurfaceAppearance.VERTEX_FORMAT;\n },\n },\n\n /**\n * When <code>true</code>, flat shading is used in the fragment shader,\n * which means lighting is not taking into account.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n flat: {\n get: function () {\n return this._flat;\n },\n },\n\n /**\n * When <code>true</code>, the fragment shader flips the surface normal\n * as needed to ensure that the normal faces the viewer to avoid\n * dark spots. This is useful when both sides of a geometry should be\n * shaded like {@link WallGeometry}.\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default true\n */\n faceForward: {\n get: function () {\n return this._faceForward;\n },\n },\n\n /**\n * When <code>true</code>, the geometry is expected to be on the ellipsoid's\n * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}\n * has backface culling enabled.\n *\n *\n * @memberof EllipsoidSurfaceAppearance.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @default false\n */\n aboveGround: {\n get: function () {\n return this._aboveGround;\n },\n },\n});\n\n/**\n * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances\n * are compatible with, which requires only <code>position</code> and <code>st</code>\n * attributes. Other attributes are procedurally computed in the fragment shader.\n *\n * @type VertexFormat\n *\n * @constant\n */\nEllipsoidSurfaceAppearance.VERTEX_FORMAT = VertexFormat.POSITION_AND_ST;\n\n/**\n * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},\n * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},\n * and {@link EllipsoidSurfaceAppearance#faceForward}.\n *\n * @function\n *\n * @returns {String} The full GLSL fragment shader source.\n */\nEllipsoidSurfaceAppearance.prototype.getFragmentShaderSource =\n Appearance.prototype.getFragmentShaderSource;\n\n/**\n * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.\n *\n * @function\n *\n * @returns {Boolean} <code>true</code> if the appearance is translucent.\n */\nEllipsoidSurfaceAppearance.prototype.isTranslucent =\n Appearance.prototype.isTranslucent;\n\n/**\n * Creates a render state. This is not the final render state instance; instead,\n * it can contain a subset of render state properties identical to the render state\n * created in the context.\n *\n * @function\n *\n * @returns {Object} The render state.\n */\nEllipsoidSurfaceAppearance.prototype.getRenderState =\n Appearance.prototype.getRenderState;\nexport default EllipsoidSurfaceAppearance;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defined from \"../Core/defined.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional\n * performance improvements by rendering less geometry and dispatching less terrain requests.\n *\n * @alias Fog\n * @constructor\n */\nfunction Fog() {\n /**\n * <code>true</code> if fog is enabled, <code>false</code> otherwise.\n * @type {Boolean}\n * @default true\n */\n this.enabled = true;\n /**\n * <code>true</code> if fog is renderable in shaders, <code>false</code> otherwise.\n * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.\n * @type {Boolean}\n * @default true\n */\n this.renderable = true;\n /**\n * A scalar that determines the density of the fog. Terrain that is in full fog are culled.\n * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.\n * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of\n * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.\n * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.\n * @type {Number}\n * @default 2.0e-4\n */\n this.density = 2.0e-4;\n /**\n * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce\n * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased\n * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably\n * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.\n * @type {Number}\n * @default 2.0\n */\n this.screenSpaceErrorFactor = 2.0;\n /**\n * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect\n * the brightness at all.\n * @type {Number}\n * @default 0.03\n */\n this.minimumBrightness = 0.03;\n}\n\n// These values were found by sampling the density at certain views and finding at what point culled tiles impacted the view at the horizon.\nconst heightsTable = [\n 359.393,\n 800.749,\n 1275.6501,\n 2151.1192,\n 3141.7763,\n 4777.5198,\n 6281.2493,\n 12364.307,\n 15900.765,\n 49889.0549,\n 78026.8259,\n 99260.7344,\n 120036.3873,\n 151011.0158,\n 156091.1953,\n 203849.3112,\n 274866.9803,\n 319916.3149,\n 493552.0528,\n 628733.5874,\n];\nconst densityTable = [\n 2.0e-5,\n 2.0e-4,\n 1.0e-4,\n 7.0e-5,\n 5.0e-5,\n 4.0e-5,\n 3.0e-5,\n 1.9e-5,\n 1.0e-5,\n 8.5e-6,\n 6.2e-6,\n 5.8e-6,\n 5.3e-6,\n 5.2e-6,\n 5.1e-6,\n 4.2e-6,\n 4.0e-6,\n 3.4e-6,\n 2.6e-6,\n 2.2e-6,\n];\n\n// Scale densities by 1e6 to bring lowest value to ~1. Prevents divide by zero.\nfor (let i = 0; i < densityTable.length; ++i) {\n densityTable[i] *= 1.0e6;\n}\n// Change range to [0, 1].\nconst tableStartDensity = densityTable[1];\nconst tableEndDensity = densityTable[densityTable.length - 1];\nfor (let j = 0; j < densityTable.length; ++j) {\n densityTable[j] =\n (densityTable[j] - tableEndDensity) / (tableStartDensity - tableEndDensity);\n}\n\nlet tableLastIndex = 0;\n\nfunction findInterval(height) {\n const heights = heightsTable;\n const length = heights.length;\n\n if (height < heights[0]) {\n tableLastIndex = 0;\n return tableLastIndex;\n } else if (height > heights[length - 1]) {\n tableLastIndex = length - 2;\n return tableLastIndex;\n }\n\n // Take advantage of temporal coherence by checking current, next and previous intervals\n // for containment of time.\n if (height >= heights[tableLastIndex]) {\n if (tableLastIndex + 1 < length && height < heights[tableLastIndex + 1]) {\n return tableLastIndex;\n } else if (\n tableLastIndex + 2 < length &&\n height < heights[tableLastIndex + 2]\n ) {\n ++tableLastIndex;\n return tableLastIndex;\n }\n } else if (tableLastIndex - 1 >= 0 && height >= heights[tableLastIndex - 1]) {\n --tableLastIndex;\n return tableLastIndex;\n }\n\n // The above failed so do a linear search.\n let i;\n for (i = 0; i < length - 2; ++i) {\n if (height >= heights[i] && height < heights[i + 1]) {\n break;\n }\n }\n\n tableLastIndex = i;\n return tableLastIndex;\n}\n\nconst scratchPositionNormal = new Cartesian3();\n\nFog.prototype.update = function (frameState) {\n const enabled = (frameState.fog.enabled = this.enabled);\n if (!enabled) {\n return;\n }\n\n frameState.fog.renderable = this.renderable;\n\n const camera = frameState.camera;\n const positionCartographic = camera.positionCartographic;\n\n // Turn off fog in space.\n if (\n !defined(positionCartographic) ||\n positionCartographic.height > 800000.0 ||\n frameState.mode !== SceneMode.SCENE3D\n ) {\n frameState.fog.enabled = false;\n return;\n }\n\n const height = positionCartographic.height;\n const i = findInterval(height);\n const t = CesiumMath.clamp(\n (height - heightsTable[i]) / (heightsTable[i + 1] - heightsTable[i]),\n 0.0,\n 1.0\n );\n let density = CesiumMath.lerp(densityTable[i], densityTable[i + 1], t);\n\n // Again, scale value to be in the range of densityTable (prevents divide by zero) and change to new range.\n const startDensity = this.density * 1.0e6;\n const endDensity = (startDensity / tableStartDensity) * tableEndDensity;\n density = density * (startDensity - endDensity) * 1.0e-6;\n\n // Fade fog in as the camera tilts toward the horizon.\n const positionNormal = Cartesian3.normalize(\n camera.positionWC,\n scratchPositionNormal\n );\n const dot = Math.abs(Cartesian3.dot(camera.directionWC, positionNormal));\n density *= 1.0 - dot;\n\n frameState.fog.density = density;\n frameState.fog.sse = this.screenSpaceErrorFactor;\n frameState.fog.minimumBrightness = this.minimumBrightness;\n};\nexport default Fog;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport TimeConstants from \"../Core/TimeConstants.js\";\n\n/**\n * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is\n * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.\n * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}\n * instead of constructing an instance explicitly.\n *\n * @alias FrameRateMonitor\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Scene} options.scene The Scene instance for which to monitor performance.\n * @param {Number} [options.samplingWindow=5.0] The length of the sliding window over which to compute the average frame rate, in seconds.\n * @param {Number} [options.quietPeriod=2.0] The length of time to wait at startup and each time the page becomes visible (i.e. when the user\n * switches back to the tab) before starting to measure performance, in seconds.\n * @param {Number} [options.warmupPeriod=5.0] The length of the warmup period, in seconds. During the warmup period, a separate\n * (usually lower) frame rate is required.\n * @param {Number} [options.minimumFrameRateDuringWarmup=4] The minimum frames-per-second that are required for acceptable performance during\n * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the\n * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.\n * @param {Number} [options.minimumFrameRateAfterWarmup=8] The minimum frames-per-second that are required for acceptable performance after\n * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the\n * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.\n */\nfunction FrameRateMonitor(options) {\n this._scene = options.scene;\n\n /**\n * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.\n * @type {Number}\n */\n this.samplingWindow = defaultValue(\n options.samplingWindow,\n FrameRateMonitor.defaultSettings.samplingWindow\n );\n\n /**\n * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user\n * switches back to the tab) before starting to measure performance, in seconds.\n * @type {Number}\n */\n this.quietPeriod = defaultValue(\n options.quietPeriod,\n FrameRateMonitor.defaultSettings.quietPeriod\n );\n\n /**\n * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate\n * (usually lower) frame rate is required.\n * @type {Number}\n */\n this.warmupPeriod = defaultValue(\n options.warmupPeriod,\n FrameRateMonitor.defaultSettings.warmupPeriod\n );\n\n /**\n * Gets or sets the minimum frames-per-second that are required for acceptable performance during\n * the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the\n * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.\n * @type {Number}\n */\n this.minimumFrameRateDuringWarmup = defaultValue(\n options.minimumFrameRateDuringWarmup,\n FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup\n );\n\n /**\n * Gets or sets the minimum frames-per-second that are required for acceptable performance after\n * the end of the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> after the <code>warmupPeriod</code>, the\n * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.\n * @type {Number}\n */\n this.minimumFrameRateAfterWarmup = defaultValue(\n options.minimumFrameRateAfterWarmup,\n FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup\n );\n\n this._lowFrameRate = new Event();\n this._nominalFrameRate = new Event();\n\n this._frameTimes = [];\n this._needsQuietPeriod = true;\n this._quietPeriodEndTime = 0.0;\n this._warmupPeriodEndTime = 0.0;\n this._frameRateIsLow = false;\n this._lastFramesPerSecond = undefined;\n this._pauseCount = 0;\n\n const that = this;\n this._preUpdateRemoveListener = this._scene.preUpdate.addEventListener(\n function (scene, time) {\n update(that, time);\n }\n );\n\n this._hiddenPropertyName =\n document.hidden !== undefined\n ? \"hidden\"\n : document.mozHidden !== undefined\n ? \"mozHidden\"\n : document.msHidden !== undefined\n ? \"msHidden\"\n : document.webkitHidden !== undefined\n ? \"webkitHidden\"\n : undefined;\n\n const visibilityChangeEventName =\n document.hidden !== undefined\n ? \"visibilitychange\"\n : document.mozHidden !== undefined\n ? \"mozvisibilitychange\"\n : document.msHidden !== undefined\n ? \"msvisibilitychange\"\n : document.webkitHidden !== undefined\n ? \"webkitvisibilitychange\"\n : undefined;\n\n function visibilityChangeListener() {\n visibilityChanged(that);\n }\n\n this._visibilityChangeRemoveListener = undefined;\n if (defined(visibilityChangeEventName)) {\n document.addEventListener(\n visibilityChangeEventName,\n visibilityChangeListener,\n false\n );\n\n this._visibilityChangeRemoveListener = function () {\n document.removeEventListener(\n visibilityChangeEventName,\n visibilityChangeListener,\n false\n );\n };\n }\n}\n\n/**\n * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}\n * needs to create a new frame rate monitor, and for any settings that are not passed to the\n * {@link FrameRateMonitor} constructor.\n *\n * @memberof FrameRateMonitor\n * @type {Object}\n */\nFrameRateMonitor.defaultSettings = {\n samplingWindow: 5.0,\n quietPeriod: 2.0,\n warmupPeriod: 5.0,\n minimumFrameRateDuringWarmup: 4,\n minimumFrameRateAfterWarmup: 8,\n};\n\n/**\n * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have\n * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.\n *\n * @param {Scene} scene The scene for which to get the {@link FrameRateMonitor}.\n * @returns {FrameRateMonitor} The scene's {@link FrameRateMonitor}.\n */\nFrameRateMonitor.fromScene = function (scene) {\n if (\n !defined(scene._frameRateMonitor) ||\n scene._frameRateMonitor.isDestroyed()\n ) {\n scene._frameRateMonitor = new FrameRateMonitor({\n scene: scene,\n });\n }\n\n return scene._frameRateMonitor;\n};\n\nObject.defineProperties(FrameRateMonitor.prototype, {\n /**\n * Gets the {@link Scene} instance for which to monitor performance.\n * @memberof FrameRateMonitor.prototype\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the event that is raised when a low frame rate is detected. The function will be passed\n * the {@link Scene} instance as its first parameter and the average number of frames per second\n * over the sampling window as its second parameter.\n * @memberof FrameRateMonitor.prototype\n * @type {Event}\n */\n lowFrameRate: {\n get: function () {\n return this._lowFrameRate;\n },\n },\n\n /**\n * Gets the event that is raised when the frame rate returns to a normal level after having been low.\n * The function will be passed the {@link Scene} instance as its first parameter and the average\n * number of frames per second over the sampling window as its second parameter.\n * @memberof FrameRateMonitor.prototype\n * @type {Event}\n */\n nominalFrameRate: {\n get: function () {\n return this._nominalFrameRate;\n },\n },\n\n /**\n * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.\n * This property may be undefined if the frame rate has not been computed.\n * @memberof FrameRateMonitor.prototype\n * @type {Number}\n */\n lastFramesPerSecond: {\n get: function () {\n return this._lastFramesPerSecond;\n },\n },\n});\n\n/**\n * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}\n * must be called once for each time this function is called.\n * @memberof FrameRateMonitor\n */\nFrameRateMonitor.prototype.pause = function () {\n ++this._pauseCount;\n if (this._pauseCount === 1) {\n this._frameTimes.length = 0;\n this._lastFramesPerSecond = undefined;\n }\n};\n\n/**\n * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called\n * multiple times, this function must be called the same number of times in order to\n * actually resume monitoring.\n * @memberof FrameRateMonitor\n */\nFrameRateMonitor.prototype.unpause = function () {\n --this._pauseCount;\n if (this._pauseCount <= 0) {\n this._pauseCount = 0;\n this._needsQuietPeriod = true;\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof FrameRateMonitor\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see FrameRateMonitor#destroy\n */\nFrameRateMonitor.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Unsubscribes this instance from all events it is listening to.\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof FrameRateMonitor\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see FrameRateMonitor#isDestroyed\n */\nFrameRateMonitor.prototype.destroy = function () {\n this._preUpdateRemoveListener();\n\n if (defined(this._visibilityChangeRemoveListener)) {\n this._visibilityChangeRemoveListener();\n }\n\n return destroyObject(this);\n};\n\nfunction update(monitor, time) {\n if (monitor._pauseCount > 0) {\n return;\n }\n\n const timeStamp = getTimestamp();\n\n if (monitor._needsQuietPeriod) {\n monitor._needsQuietPeriod = false;\n monitor._frameTimes.length = 0;\n monitor._quietPeriodEndTime =\n timeStamp + monitor.quietPeriod / TimeConstants.SECONDS_PER_MILLISECOND;\n monitor._warmupPeriodEndTime =\n monitor._quietPeriodEndTime +\n (monitor.warmupPeriod + monitor.samplingWindow) /\n TimeConstants.SECONDS_PER_MILLISECOND;\n } else if (timeStamp >= monitor._quietPeriodEndTime) {\n monitor._frameTimes.push(timeStamp);\n\n const beginningOfWindow =\n timeStamp -\n monitor.samplingWindow / TimeConstants.SECONDS_PER_MILLISECOND;\n\n if (\n monitor._frameTimes.length >= 2 &&\n monitor._frameTimes[0] <= beginningOfWindow\n ) {\n while (\n monitor._frameTimes.length >= 2 &&\n monitor._frameTimes[1] < beginningOfWindow\n ) {\n monitor._frameTimes.shift();\n }\n\n const averageTimeBetweenFrames =\n (timeStamp - monitor._frameTimes[0]) / (monitor._frameTimes.length - 1);\n\n monitor._lastFramesPerSecond = 1000.0 / averageTimeBetweenFrames;\n\n const maximumFrameTime =\n 1000.0 /\n (timeStamp > monitor._warmupPeriodEndTime\n ? monitor.minimumFrameRateAfterWarmup\n : monitor.minimumFrameRateDuringWarmup);\n if (averageTimeBetweenFrames > maximumFrameTime) {\n if (!monitor._frameRateIsLow) {\n monitor._frameRateIsLow = true;\n monitor._needsQuietPeriod = true;\n monitor.lowFrameRate.raiseEvent(\n monitor.scene,\n monitor._lastFramesPerSecond\n );\n }\n } else if (monitor._frameRateIsLow) {\n monitor._frameRateIsLow = false;\n monitor._needsQuietPeriod = true;\n monitor.nominalFrameRate.raiseEvent(\n monitor.scene,\n monitor._lastFramesPerSecond\n );\n }\n }\n }\n}\n\nfunction visibilityChanged(monitor) {\n if (document[monitor._hiddenPropertyName]) {\n monitor.pause();\n } else {\n monitor.unpause();\n }\n}\nexport default FrameRateMonitor;\n", "import SceneMode from \"./SceneMode.js\";\n\n/**\n * State information about the current frame. An instance of this class\n * is provided to update functions.\n *\n * @param {Context} context The rendering context\n * @param {CreditDisplay} creditDisplay Handles adding and removing credits from an HTML element\n * @param {JobScheduler} jobScheduler The job scheduler\n *\n * @alias FrameState\n * @constructor\n *\n * @private\n */\nfunction FrameState(context, creditDisplay, jobScheduler) {\n /**\n * The rendering context.\n *\n * @type {Context}\n */\n this.context = context;\n\n /**\n * An array of rendering commands.\n *\n * @type {DrawCommand[]}\n */\n this.commandList = [];\n\n /**\n * An array of shadow maps.\n * @type {ShadowMap[]}\n */\n this.shadowMaps = [];\n\n /**\n * The BRDF look up texture generator used for image-based lighting for PBR models\n * @type {BrdfLutGenerator}\n */\n this.brdfLutGenerator = undefined;\n\n /**\n * The environment map used for image-based lighting for PBR models\n * @type {CubeMap}\n */\n this.environmentMap = undefined;\n\n /**\n * The spherical harmonic coefficients used for image-based lighting for PBR models.\n * @type {Cartesian3[]}\n */\n this.sphericalHarmonicCoefficients = undefined;\n\n /**\n * The specular environment atlas used for image-based lighting for PBR models.\n * @type {Texture}\n */\n this.specularEnvironmentMaps = undefined;\n\n /**\n * The maximum level-of-detail of the specular environment atlas used for image-based lighting for PBR models.\n * @type {Number}\n */\n this.specularEnvironmentMapsMaximumLOD = undefined;\n\n /**\n * The current mode of the scene.\n *\n * @type {SceneMode}\n * @default {@link SceneMode.SCENE3D}\n */\n this.mode = SceneMode.SCENE3D;\n\n /**\n * The current morph transition time between 2D/Columbus View and 3D,\n * with 0.0 being 2D or Columbus View and 1.0 being 3D.\n *\n * @type {Number}\n */\n this.morphTime = SceneMode.getMorphTime(SceneMode.SCENE3D);\n\n /**\n * The current frame number.\n *\n * @type {Number}\n * @default 0\n */\n this.frameNumber = 0;\n\n /**\n * <code>true</code> if a new frame has been issued and the frame number has been updated.\n *\n * @type {Boolean}\n * @default false\n */\n this.newFrame = false;\n\n /**\n * The scene's current time.\n *\n * @type {JulianDate}\n * @default undefined\n */\n this.time = undefined;\n\n /**\n * The job scheduler.\n *\n * @type {JobScheduler}\n */\n this.jobScheduler = jobScheduler;\n\n /**\n * The map projection to use in 2D and Columbus View modes.\n *\n * @type {MapProjection}\n * @default undefined\n */\n this.mapProjection = undefined;\n\n /**\n * The current camera.\n *\n * @type {Camera}\n * @default undefined\n */\n this.camera = undefined;\n\n /**\n * Whether the camera is underground.\n *\n * @type {Boolean}\n * @default false\n */\n this.cameraUnderground = false;\n\n /**\n * The {@link GlobeTranslucencyState} object used by the scene.\n *\n * @type {GlobeTranslucencyState}\n * @default undefined\n */\n this.globeTranslucencyState = undefined;\n\n /**\n * The culling volume.\n *\n * @type {CullingVolume}\n * @default undefined\n */\n this.cullingVolume = undefined;\n\n /**\n * The current occluder.\n *\n * @type {Occluder}\n * @default undefined\n */\n this.occluder = undefined;\n\n /**\n * The maximum screen-space error used to drive level-of-detail refinement. Higher\n * values will provide better performance but lower visual quality.\n *\n * @type {Number}\n * @default 2\n */\n this.maximumScreenSpaceError = undefined;\n\n /**\n * Ratio between a pixel and a density-independent pixel. Provides a standard unit of\n * measure for real pixel measurements appropriate to a particular device.\n *\n * @type {Number}\n * @default 1.0\n */\n this.pixelRatio = 1.0;\n\n /**\n * @typedef FrameState.Passes\n * @type {Object}\n * @property {Boolean} render <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise.\n * @property {Boolean} pick <code>true</code> if the primitive should update for a picking pass, <code>false</code> otherwise.\n * @property {Boolean} depth <code>true</code> if the primitive should update for a depth only pass, <code>false</code> otherwise.\n * @property {Boolean} postProcess <code>true</code> if the primitive should update for a per-feature post-process pass, <code>false</code> otherwise.\n * @property {Boolean} offscreen <code>true</code> if the primitive should update for an offscreen pass, <code>false</code> otherwise.\n */\n\n /**\n * @type {FrameState.Passes}\n */\n this.passes = {\n /**\n * @default false\n */\n render: false,\n /**\n * @default false\n */\n pick: false,\n /**\n * @default false\n */\n depth: false,\n /**\n * @default false\n */\n postProcess: false,\n /**\n * @default false\n */\n offscreen: false,\n };\n\n /**\n * The credit display.\n *\n * @type {CreditDisplay}\n */\n this.creditDisplay = creditDisplay;\n\n /**\n * An array of functions to be called at the end of the frame. This array\n * will be cleared after each frame.\n * <p>\n * This allows queueing up events in <code>update</code> functions and\n * firing them at a time when the subscribers are free to change the\n * scene state, e.g., manipulate the camera, instead of firing events\n * directly in <code>update</code> functions.\n * </p>\n *\n * @type {FrameState.AfterRenderCallback[]}\n *\n * @example\n * frameState.afterRender.push(function() {\n * // take some action, raise an event, etc.\n * });\n */\n this.afterRender = [];\n\n /**\n * Gets whether or not to optimize for 3D only.\n *\n * @type {Boolean}\n * @default false\n */\n this.scene3DOnly = false;\n\n /**\n * @typedef FrameState.Fog\n * @type {Object}\n * @property {Boolean} enabled <code>true</code> if fog is enabled, <code>false</code> otherwise.\n * @property {Number} density A positive number used to mix the color and fog color based on camera distance.\n * @property {Number} sse A scalar used to modify the screen space error of geometry partially in fog.\n * @property {Number} minimumBrightness The minimum brightness of terrain with fog applied.\n */\n\n /**\n * @type {FrameState.Fog}\n */\n\n this.fog = {\n /**\n * @default false\n */\n enabled: false,\n density: undefined,\n sse: undefined,\n minimumBrightness: undefined,\n };\n\n /**\n * A scalar used to exaggerate the terrain.\n * @type {Number}\n * @default 1.0\n */\n this.terrainExaggeration = 1.0;\n\n /**\n * The height relative to which terrain is exaggerated.\n * @type {Number}\n * @default 0.0\n */\n this.terrainExaggerationRelativeHeight = 0.0;\n\n /**\n * @typedef FrameState.ShadowState\n * @type {Object}\n * @property {Boolean} shadowsEnabled Whether there are any active shadow maps this frame.\n * @property {Boolean} lightShadowsEnabled Whether there are any active shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes.\n * @property {ShadowMap[]} shadowMaps All shadow maps that are enabled this frame.\n * @property {ShadowMap[]} lightShadowMaps Shadow maps that originate from light sources. Does not include shadow maps that are used for analytical purposes. Only these shadow maps will be used to generate receive shadows shaders.\n * @property {Number} nearPlane The near plane of the scene's frustum commands. Used for fitting cascaded shadow maps.\n * @property {Number} farPlane The far plane of the scene's frustum commands. Used for fitting cascaded shadow maps.\n * @property {Number} closestObjectSize The size of the bounding volume that is closest to the camera. This is used to place more shadow detail near the object.\n * @property {Number} lastDirtyTime The time when a shadow map was last dirty\n * @property {Boolean} outOfView Whether the shadows maps are out of view this frame\n */\n\n /**\n * @type {FrameState.ShadowState}\n */\n\n this.shadowState = {\n /**\n * @default true\n */\n shadowsEnabled: true,\n shadowMaps: [],\n lightShadowMaps: [],\n /**\n * @default 1.0\n */\n nearPlane: 1.0,\n /**\n * @default 5000.0\n */\n farPlane: 5000.0,\n /**\n * @default 1000.0\n */\n closestObjectSize: 1000.0,\n /**\n * @default 0\n */\n lastDirtyTime: 0,\n /**\n * @default true\n */\n outOfView: true,\n };\n\n /**\n * The position of the splitter to use when rendering different things on either side of a splitter.\n * This value should be between 0.0 and 1.0 with 0 being the far left of the viewport and 1 being the far right of the viewport.\n * @type {Number}\n * @default 0.0\n */\n this.splitPosition = 0.0;\n\n /**\n * Distances to the near and far planes of the camera frustums\n * @type {Number[]}\n * @default []\n */\n this.frustumSplits = [];\n\n /**\n * The current scene background color\n *\n * @type {Color}\n */\n this.backgroundColor = undefined;\n\n /**\n * The light used to shade the scene.\n *\n * @type {Light}\n */\n this.light = undefined;\n\n /**\n * The distance from the camera at which to disable the depth test of billboards, labels and points\n * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n * be applied. When less than zero, the depth test should never be applied.\n * @type {Number}\n */\n this.minimumDisableDepthTestDistance = undefined;\n\n /**\n * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and\n * unclassified 3D Tile geometry will render with the color multiplied with {@link FrameState#invertClassificationColor}.\n * @type {Boolean}\n * @default false\n */\n this.invertClassification = false;\n\n /**\n * The highlight color of unclassified 3D Tile geometry when {@link FrameState#invertClassification} is <code>true</code>.\n * @type {Color}\n */\n this.invertClassificationColor = undefined;\n\n /**\n * Whether or not the scene uses a logarithmic depth buffer.\n *\n * @type {Boolean}\n * @default false\n */\n this.useLogDepth = false;\n\n /**\n * Additional state used to update 3D Tilesets.\n *\n * @type {Cesium3DTilePassState}\n */\n this.tilesetPassState = undefined;\n\n /**\n * The minimum terrain height out of all rendered terrain tiles. Used to improve culling for objects underneath the ellipsoid but above terrain.\n *\n * @type {Number}\n * @default 0.0\n */\n this.minimumTerrainHeight = 0.0;\n}\n\n/**\n * A function that will be called at the end of the frame.\n *\n * @callback FrameState.AfterRenderCallback\n */\nexport default FrameState;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport Pass from \"../Renderer/Pass.js\";\n\n/**\n * Defines a list of commands whose geometry are bound by near and far distances from the camera.\n * @alias FrustumCommands\n * @constructor\n *\n * @param {Number} [near=0.0] The lower bound or closest distance from the camera.\n * @param {Number} [far=0.0] The upper bound or farthest distance from the camera.\n *\n * @private\n */\nfunction FrustumCommands(near, far) {\n this.near = defaultValue(near, 0.0);\n this.far = defaultValue(far, 0.0);\n\n const numPasses = Pass.NUMBER_OF_PASSES;\n const commands = new Array(numPasses);\n const indices = new Array(numPasses);\n\n for (let i = 0; i < numPasses; ++i) {\n commands[i] = [];\n indices[i] = 0;\n }\n\n this.commands = commands;\n this.indices = indices;\n}\nexport default FrustumCommands;\n", "import Check from \"../Core/Check.js\";\n\n/**\n * Gets a GLSL snippet that clips a fragment using the `clip` function from {@link getClippingFunction} and styles it.\n *\n * @param {String} samplerUniformName Name of the uniform for the clipping planes texture sampler.\n * @param {String} matrixUniformName Name of the uniform for the clipping planes matrix.\n * @param {String} styleUniformName Name of the uniform for the clipping planes style, a vec4.\n * @returns {String} A string containing GLSL that clips and styles the current fragment.\n * @private\n */\nfunction getClipAndStyleCode(\n samplerUniformName,\n matrixUniformName,\n styleUniformName\n) {\n const shaderCode =\n ` float clipDistance = clip(gl_FragCoord, ${samplerUniformName}, ${matrixUniformName}); \\n` +\n ` vec4 clippingPlanesEdgeColor = vec4(1.0); \\n` +\n ` clippingPlanesEdgeColor.rgb = ${styleUniformName}.rgb; \\n` +\n ` float clippingPlanesEdgeWidth = ${styleUniformName}.a; \\n` +\n ` if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \\n` +\n ` { \\n` +\n ` gl_FragColor = clippingPlanesEdgeColor;\\n` +\n ` } \\n`;\n return shaderCode;\n}\nexport default getClipAndStyleCode;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Check from \"../Core/Check.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\n\nconst textureResolutionScratch = new Cartesian2();\n/**\n * Gets the GLSL functions needed to retrieve clipping planes from a ClippingPlaneCollection's texture.\n *\n * @param {ClippingPlaneCollection} clippingPlaneCollection ClippingPlaneCollection with a defined texture.\n * @param {Context} context The current rendering context.\n * @returns {String} A string containing GLSL functions for retrieving clipping planes.\n * @private\n */\nfunction getClippingFunction(clippingPlaneCollection, context) {\nconst unionClippingRegions = clippingPlaneCollection.unionClippingRegions;\n const clippingPlanesLength = clippingPlaneCollection.length;\n const usingFloatTexture = ClippingPlaneCollection.useFloatTexture(context);\n const textureResolution = ClippingPlaneCollection.getTextureResolution(\n clippingPlaneCollection,\n context,\n textureResolutionScratch\n );\n const width = textureResolution.x;\n const height = textureResolution.y;\n\n let functions = usingFloatTexture\n ? getClippingPlaneFloat(width, height)\n : getClippingPlaneUint8(width, height);\n functions += \"\\n\";\n functions += unionClippingRegions\n ? clippingFunctionUnion(clippingPlanesLength)\n : clippingFunctionIntersect(clippingPlanesLength);\n return functions;\n}\n\nfunction clippingFunctionUnion(clippingPlanesLength) {\n const functionString =\n `${\n \"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\\n\" +\n \"{\\n\" +\n \" vec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\" +\n \" vec3 clipNormal = vec3(0.0);\\n\" +\n \" vec3 clipPosition = vec3(0.0);\\n\" +\n \" float clipAmount;\\n\" + // 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.\n \" float pixelWidth = czm_metersPerPixel(position);\\n\" +\n \" bool breakAndDiscard = false;\\n\" +\n \" for (int i = 0; i < \"\n }${clippingPlanesLength}; ++i)\\n` +\n ` {\\n` +\n ` vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n` +\n ` clipNormal = clippingPlane.xyz;\\n` +\n ` clipPosition = -clippingPlane.w * clipNormal;\\n` +\n ` float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n` +\n ` clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\\n` +\n ` if (amount <= 0.0)\\n` +\n ` {\\n` +\n ` breakAndDiscard = true;\\n` +\n ` break;\\n` + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6\n ` }\\n` +\n ` }\\n` +\n ` if (breakAndDiscard) {\\n` +\n ` discard;\\n` +\n ` }\\n` +\n ` return clipAmount;\\n` +\n `}\\n`;\n return functionString;\n}\n\nfunction clippingFunctionIntersect(clippingPlanesLength) {\n const functionString =\n `${\n \"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\\n\" +\n \"{\\n\" +\n \" bool clipped = true;\\n\" +\n \" vec4 position = czm_windowToEyeCoordinates(fragCoord);\\n\" +\n \" vec3 clipNormal = vec3(0.0);\\n\" +\n \" vec3 clipPosition = vec3(0.0);\\n\" +\n \" float clipAmount = 0.0;\\n\" +\n \" float pixelWidth = czm_metersPerPixel(position);\\n\" +\n \" for (int i = 0; i < \"\n }${clippingPlanesLength}; ++i)\\n` +\n ` {\\n` +\n ` vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\\n` +\n ` clipNormal = clippingPlane.xyz;\\n` +\n ` clipPosition = -clippingPlane.w * clipNormal;\\n` +\n ` float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\\n` +\n ` clipAmount = max(amount, clipAmount);\\n` +\n ` clipped = clipped && (amount <= 0.0);\\n` +\n ` }\\n` +\n ` if (clipped)\\n` +\n ` {\\n` +\n ` discard;\\n` +\n ` }\\n` +\n ` return clipAmount;\\n` +\n `}\\n`;\n return functionString;\n}\n\nfunction getClippingPlaneFloat(width, height) {\n const pixelWidth = 1.0 / width;\n const pixelHeight = 1.0 / height;\n\n let pixelWidthString = `${pixelWidth}`;\n if (pixelWidthString.indexOf(\".\") === -1) {\n pixelWidthString += \".0\";\n }\n let pixelHeightString = `${pixelHeight}`;\n if (pixelHeightString.indexOf(\".\") === -1) {\n pixelHeightString += \".0\";\n }\n\n const functionString =\n `${\n \"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\\n\" +\n \"{\\n\" +\n \" int pixY = clippingPlaneNumber / \"\n }${width};\\n` +\n ` int pixX = clippingPlaneNumber - (pixY * ${width});\\n` +\n ` float u = (float(pixX) + 0.5) * ${pixelWidthString};\\n` + // sample from center of pixel\n ` float v = (float(pixY) + 0.5) * ${pixelHeightString};\\n` +\n ` vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\\n` +\n ` return czm_transformPlane(plane, transform);\\n` +\n `}\\n`;\n return functionString;\n}\n\nfunction getClippingPlaneUint8(width, height) {\n const pixelWidth = 1.0 / width;\n const pixelHeight = 1.0 / height;\n\n let pixelWidthString = `${pixelWidth}`;\n if (pixelWidthString.indexOf(\".\") === -1) {\n pixelWidthString += \".0\";\n }\n let pixelHeightString = `${pixelHeight}`;\n if (pixelHeightString.indexOf(\".\") === -1) {\n pixelHeightString += \".0\";\n }\n\n const functionString =\n `${\n \"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\\n\" +\n \"{\\n\" +\n \" int clippingPlaneStartIndex = clippingPlaneNumber * 2;\\n\" + // clipping planes are two pixels each\n \" int pixY = clippingPlaneStartIndex / \"\n }${width};\\n` +\n ` int pixX = clippingPlaneStartIndex - (pixY * ${width});\\n` +\n ` float u = (float(pixX) + 0.5) * ${pixelWidthString};\\n` + // sample from center of pixel\n ` float v = (float(pixY) + 0.5) * ${pixelHeightString};\\n` +\n ` vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\\n` +\n ` vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\\n` +\n ` vec4 plane;\\n` +\n ` plane.xyz = czm_octDecode(oct, 65535.0);\\n` +\n ` plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ${pixelWidthString}, v)));\\n` +\n ` return czm_transformPlane(plane, transform);\\n` +\n `}\\n`;\n return functionString;\n}\nexport default getClippingFunction;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport TerrainQuantization from \"../Core/TerrainQuantization.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport getClippingFunction from \"./getClippingFunction.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nfunction GlobeSurfaceShader(\n numberOfDayTextures,\n flags,\n material,\n shaderProgram,\n clippingShaderState\n) {\n this.numberOfDayTextures = numberOfDayTextures;\n this.flags = flags;\n this.material = material;\n this.shaderProgram = shaderProgram;\n this.clippingShaderState = clippingShaderState;\n}\n\n/**\n * Manages the shaders used to shade the surface of a {@link Globe}.\n *\n * @alias GlobeSurfaceShaderSet\n * @private\n */\nfunction GlobeSurfaceShaderSet() {\n this.baseVertexShaderSource = undefined;\n this.baseFragmentShaderSource = undefined;\n\n this._shadersByTexturesFlags = [];\n\n this.material = undefined;\n}\n\nfunction getPositionMode(sceneMode) {\n const getPosition3DMode =\n \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }\";\n const getPositionColumbusViewAnd2DMode =\n \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }\";\n const getPositionMorphingMode =\n \"vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }\";\n\n let positionMode;\n\n switch (sceneMode) {\n case SceneMode.SCENE3D:\n positionMode = getPosition3DMode;\n break;\n case SceneMode.SCENE2D:\n case SceneMode.COLUMBUS_VIEW:\n positionMode = getPositionColumbusViewAnd2DMode;\n break;\n case SceneMode.MORPHING:\n positionMode = getPositionMorphingMode;\n break;\n }\n\n return positionMode;\n}\n\nfunction get2DYPositionFraction(useWebMercatorProjection) {\n const get2DYPositionFractionGeographicProjection =\n \"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }\";\n const get2DYPositionFractionMercatorProjection =\n \"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }\";\n return useWebMercatorProjection\n ? get2DYPositionFractionMercatorProjection\n : get2DYPositionFractionGeographicProjection;\n}\n\nGlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) {\n const frameState = options.frameState;\n const surfaceTile = options.surfaceTile;\n const numberOfDayTextures = options.numberOfDayTextures;\n const applyBrightness = options.applyBrightness;\n const applyContrast = options.applyContrast;\n const applyHue = options.applyHue;\n const applySaturation = options.applySaturation;\n const applyGamma = options.applyGamma;\n const applyAlpha = options.applyAlpha;\n const applyDayNightAlpha = options.applyDayNightAlpha;\n const applySplit = options.applySplit;\n const showReflectiveOcean = options.showReflectiveOcean;\n const showOceanWaves = options.showOceanWaves;\n const enableLighting = options.enableLighting;\n const dynamicAtmosphereLighting = options.dynamicAtmosphereLighting;\n const dynamicAtmosphereLightingFromSun =\n options.dynamicAtmosphereLightingFromSun;\n const showGroundAtmosphere = options.showGroundAtmosphere;\n const perFragmentGroundAtmosphere = options.perFragmentGroundAtmosphere;\n const hasVertexNormals = options.hasVertexNormals;\n const useWebMercatorProjection = options.useWebMercatorProjection;\n const enableFog = options.enableFog;\n const enableClippingPlanes = options.enableClippingPlanes;\n const clippingPlanes = options.clippingPlanes;\n const clippedByBoundaries = options.clippedByBoundaries;\n const hasImageryLayerCutout = options.hasImageryLayerCutout;\n const colorCorrect = options.colorCorrect;\n const highlightFillTile = options.highlightFillTile;\n const colorToAlpha = options.colorToAlpha;\n const hasGeodeticSurfaceNormals = options.hasGeodeticSurfaceNormals;\n const hasExaggeration = options.hasExaggeration;\n const showUndergroundColor = options.showUndergroundColor;\n const translucent = options.translucent;\n\n let quantization = 0;\n let quantizationDefine = \"\";\n\n const mesh = surfaceTile.renderedMesh;\n const terrainEncoding = mesh.encoding;\n const quantizationMode = terrainEncoding.quantization;\n if (quantizationMode === TerrainQuantization.BITS12) {\n quantization = 1;\n quantizationDefine = \"QUANTIZATION_BITS12\";\n }\n\n let cartographicLimitRectangleFlag = 0;\n let cartographicLimitRectangleDefine = \"\";\n if (clippedByBoundaries) {\n cartographicLimitRectangleFlag = 1;\n cartographicLimitRectangleDefine = \"TILE_LIMIT_RECTANGLE\";\n }\n\n let imageryCutoutFlag = 0;\n let imageryCutoutDefine = \"\";\n if (hasImageryLayerCutout) {\n imageryCutoutFlag = 1;\n imageryCutoutDefine = \"APPLY_IMAGERY_CUTOUT\";\n }\n\n const sceneMode = frameState.mode;\n const flags =\n sceneMode |\n (applyBrightness << 2) |\n (applyContrast << 3) |\n (applyHue << 4) |\n (applySaturation << 5) |\n (applyGamma << 6) |\n (applyAlpha << 7) |\n (showReflectiveOcean << 8) |\n (showOceanWaves << 9) |\n (enableLighting << 10) |\n (dynamicAtmosphereLighting << 11) |\n (dynamicAtmosphereLightingFromSun << 12) |\n (showGroundAtmosphere << 13) |\n (perFragmentGroundAtmosphere << 14) |\n (hasVertexNormals << 15) |\n (useWebMercatorProjection << 16) |\n (enableFog << 17) |\n (quantization << 18) |\n (applySplit << 19) |\n (enableClippingPlanes << 20) |\n (cartographicLimitRectangleFlag << 21) |\n (imageryCutoutFlag << 22) |\n (colorCorrect << 23) |\n (highlightFillTile << 24) |\n (colorToAlpha << 25) |\n (hasGeodeticSurfaceNormals << 26) |\n (hasExaggeration << 27) |\n (showUndergroundColor << 28) |\n (translucent << 29) |\n (applyDayNightAlpha << 30);\n\n let currentClippingShaderState = 0;\n if (defined(clippingPlanes) && clippingPlanes.length > 0) {\n currentClippingShaderState = enableClippingPlanes\n ? clippingPlanes.clippingPlanesState\n : 0;\n }\n let surfaceShader = surfaceTile.surfaceShader;\n if (\n defined(surfaceShader) &&\n surfaceShader.numberOfDayTextures === numberOfDayTextures &&\n surfaceShader.flags === flags &&\n surfaceShader.material === this.material &&\n surfaceShader.clippingShaderState === currentClippingShaderState\n ) {\n return surfaceShader.shaderProgram;\n }\n\n // New tile, or tile changed number of textures, flags, or clipping planes\n let shadersByFlags = this._shadersByTexturesFlags[numberOfDayTextures];\n if (!defined(shadersByFlags)) {\n shadersByFlags = this._shadersByTexturesFlags[numberOfDayTextures] = [];\n }\n\n surfaceShader = shadersByFlags[flags];\n if (\n !defined(surfaceShader) ||\n surfaceShader.material !== this.material ||\n surfaceShader.clippingShaderState !== currentClippingShaderState\n ) {\n // Cache miss - we've never seen this combination of numberOfDayTextures and flags before.\n const vs = this.baseVertexShaderSource.clone();\n const fs = this.baseFragmentShaderSource.clone();\n\n if (currentClippingShaderState !== 0) {\n fs.sources.unshift(\n getClippingFunction(clippingPlanes, frameState.context)\n ); // Need to go before GlobeFS\n }\n\n vs.defines.push(quantizationDefine);\n fs.defines.push(\n `TEXTURE_UNITS ${numberOfDayTextures}`,\n cartographicLimitRectangleDefine,\n imageryCutoutDefine\n );\n\n if (applyBrightness) {\n fs.defines.push(\"APPLY_BRIGHTNESS\");\n }\n if (applyContrast) {\n fs.defines.push(\"APPLY_CONTRAST\");\n }\n if (applyHue) {\n fs.defines.push(\"APPLY_HUE\");\n }\n if (applySaturation) {\n fs.defines.push(\"APPLY_SATURATION\");\n }\n if (applyGamma) {\n fs.defines.push(\"APPLY_GAMMA\");\n }\n if (applyAlpha) {\n fs.defines.push(\"APPLY_ALPHA\");\n }\n if (applyDayNightAlpha) {\n fs.defines.push(\"APPLY_DAY_NIGHT_ALPHA\");\n }\n if (showReflectiveOcean) {\n fs.defines.push(\"SHOW_REFLECTIVE_OCEAN\");\n vs.defines.push(\"SHOW_REFLECTIVE_OCEAN\");\n }\n if (showOceanWaves) {\n fs.defines.push(\"SHOW_OCEAN_WAVES\");\n }\n if (colorToAlpha) {\n fs.defines.push(\"APPLY_COLOR_TO_ALPHA\");\n }\n if (showUndergroundColor) {\n vs.defines.push(\"UNDERGROUND_COLOR\");\n fs.defines.push(\"UNDERGROUND_COLOR\");\n }\n if (translucent) {\n vs.defines.push(\"TRANSLUCENT\");\n fs.defines.push(\"TRANSLUCENT\");\n }\n if (enableLighting) {\n if (hasVertexNormals) {\n vs.defines.push(\"ENABLE_VERTEX_LIGHTING\");\n fs.defines.push(\"ENABLE_VERTEX_LIGHTING\");\n } else {\n vs.defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n fs.defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n }\n }\n\n if (dynamicAtmosphereLighting) {\n vs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING\");\n fs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING\");\n if (dynamicAtmosphereLightingFromSun) {\n vs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN\");\n fs.defines.push(\"DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN\");\n }\n }\n\n if (showGroundAtmosphere) {\n vs.defines.push(\"GROUND_ATMOSPHERE\");\n fs.defines.push(\"GROUND_ATMOSPHERE\");\n if (perFragmentGroundAtmosphere) {\n vs.defines.push(\"PER_FRAGMENT_GROUND_ATMOSPHERE\");\n fs.defines.push(\"PER_FRAGMENT_GROUND_ATMOSPHERE\");\n }\n }\n\n vs.defines.push(\"INCLUDE_WEB_MERCATOR_Y\");\n fs.defines.push(\"INCLUDE_WEB_MERCATOR_Y\");\n\n if (enableFog) {\n vs.defines.push(\"FOG\");\n fs.defines.push(\"FOG\");\n }\n\n if (applySplit) {\n fs.defines.push(\"APPLY_SPLIT\");\n }\n\n if (enableClippingPlanes) {\n fs.defines.push(\"ENABLE_CLIPPING_PLANES\");\n }\n\n if (colorCorrect) {\n fs.defines.push(\"COLOR_CORRECT\");\n }\n\n if (highlightFillTile) {\n fs.defines.push(\"HIGHLIGHT_FILL_TILE\");\n }\n\n if (hasGeodeticSurfaceNormals) {\n vs.defines.push(\"GEODETIC_SURFACE_NORMALS\");\n }\n\n if (hasExaggeration) {\n vs.defines.push(\"EXAGGERATION\");\n }\n\n let computeDayColor =\n \"\\\n vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\\n\\\n {\\n\\\n vec4 color = initialColor;\\n\";\n\n if (hasImageryLayerCutout) {\n computeDayColor +=\n \"\\\n vec4 cutoutAndColorResult;\\n\\\n bool texelUnclipped;\\n\";\n }\n\n for (let i = 0; i < numberOfDayTextures; ++i) {\n if (hasImageryLayerCutout) {\n computeDayColor += `\\\n cutoutAndColorResult = u_dayTextureCutoutRectangles[${i}];\\n\\\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\\n\\\n cutoutAndColorResult = sampleAndBlend(\\n`;\n } else {\n computeDayColor += \"\\\n color = sampleAndBlend(\\n\";\n }\n computeDayColor += `\\\n color,\\n\\\n u_dayTextures[${i}],\\n\\\n u_dayTextureUseWebMercatorT[${i}] ? textureCoordinates.xz : textureCoordinates.xy,\\n\\\n u_dayTextureTexCoordsRectangle[${i}],\\n\\\n u_dayTextureTranslationAndScale[${i}],\\n\\\n ${applyAlpha ? `u_dayTextureAlpha[${i}]` : \"1.0\"},\\n\\\n ${applyDayNightAlpha ? `u_dayTextureNightAlpha[${i}]` : \"1.0\"},\\n${\n applyDayNightAlpha ? `u_dayTextureDayAlpha[${i}]` : \"1.0\"\n },\\n${applyBrightness ? `u_dayTextureBrightness[${i}]` : \"0.0\"},\\n\\\n ${applyContrast ? `u_dayTextureContrast[${i}]` : \"0.0\"},\\n\\\n ${applyHue ? `u_dayTextureHue[${i}]` : \"0.0\"},\\n\\\n ${applySaturation ? `u_dayTextureSaturation[${i}]` : \"0.0\"},\\n\\\n ${applyGamma ? `u_dayTextureOneOverGamma[${i}]` : \"0.0\"},\\n\\\n ${applySplit ? `u_dayTextureSplit[${i}]` : \"0.0\"},\\n\\\n ${colorToAlpha ? `u_colorsToAlpha[${i}]` : \"vec4(0.0)\"},\\n\\\n nightBlend\\\n );\\n`;\n if (hasImageryLayerCutout) {\n computeDayColor +=\n \"\\\n color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\\n\";\n }\n }\n\n computeDayColor += \"\\\n return color;\\n\\\n }\";\n\n fs.sources.push(computeDayColor);\n\n vs.sources.push(getPositionMode(sceneMode));\n vs.sources.push(get2DYPositionFraction(useWebMercatorProjection));\n\n const shader = ShaderProgram.fromCache({\n context: frameState.context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: terrainEncoding.getAttributeLocations(),\n });\n\n surfaceShader = shadersByFlags[flags] = new GlobeSurfaceShader(\n numberOfDayTextures,\n flags,\n this.material,\n shader,\n currentClippingShaderState\n );\n }\n\n surfaceTile.surfaceShader = surfaceShader;\n return surfaceShader.shaderProgram;\n};\n\nGlobeSurfaceShaderSet.prototype.destroy = function () {\n let flags;\n let shader;\n\n const shadersByTexturesFlags = this._shadersByTexturesFlags;\n for (const textureCount in shadersByTexturesFlags) {\n if (shadersByTexturesFlags.hasOwnProperty(textureCount)) {\n const shadersByFlags = shadersByTexturesFlags[textureCount];\n if (!defined(shadersByFlags)) {\n continue;\n }\n\n for (flags in shadersByFlags) {\n if (shadersByFlags.hasOwnProperty(flags)) {\n shader = shadersByFlags[flags];\n if (defined(shader)) {\n shader.shaderProgram.destroy();\n }\n }\n }\n }\n }\n\n return destroyObject(this);\n};\nexport default GlobeSurfaceShaderSet;\n", "/**\n * @private\n */\nconst ImageryState = {\n UNLOADED: 0,\n TRANSITIONING: 1,\n RECEIVED: 2,\n TEXTURE_LOADED: 3,\n READY: 4,\n FAILED: 5,\n INVALID: 6,\n PLACEHOLDER: 7,\n};\nexport default Object.freeze(ImageryState);\n", "/**\n * The state of a {@link QuadtreeTile} in the tile load pipeline.\n * @enum {Number}\n * @private\n */\nconst QuadtreeTileLoadState = {\n /**\n * The tile is new and loading has not yet begun.\n * @type QuadtreeTileLoadState\n * @constant\n * @default 0\n */\n START: 0,\n\n /**\n * Loading is in progress.\n * @type QuadtreeTileLoadState\n * @constant\n * @default 1\n */\n LOADING: 1,\n\n /**\n * Loading is complete.\n * @type QuadtreeTileLoadState\n * @constant\n * @default 2\n */\n DONE: 2,\n\n /**\n * The tile has failed to load.\n * @type QuadtreeTileLoadState\n * @constant\n * @default 3\n */\n FAILED: 3,\n};\nexport default Object.freeze(QuadtreeTileLoadState);\n", "/**\n * @private\n */\nconst TerrainState = {\n FAILED: 0,\n UNLOADED: 1,\n RECEIVING: 2,\n RECEIVED: 3,\n TRANSFORMING: 4,\n TRANSFORMED: 5,\n READY: 6,\n};\nexport default Object.freeze(TerrainState);\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TerrainState from \"./TerrainState.js\";\n\n/**\n * Contains additional information about a {@link QuadtreeTile} of the globe's surface, and\n * encapsulates state transition logic for loading tiles.\n *\n * @constructor\n * @alias GlobeSurfaceTile\n * @private\n */\nfunction GlobeSurfaceTile() {\n /**\n * The {@link TileImagery} attached to this tile.\n * @type {TileImagery[]}\n * @default []\n */\n this.imagery = [];\n\n this.waterMaskTexture = undefined;\n this.waterMaskTranslationAndScale = new Cartesian4(0.0, 0.0, 1.0, 1.0);\n\n this.terrainData = undefined;\n this.vertexArray = undefined;\n\n /**\n * A bounding region used to estimate distance to the tile. The horizontal bounds are always tight-fitting,\n * but the `minimumHeight` and `maximumHeight` properties may be derived from the min/max of an ancestor tile\n * and be quite loose-fitting and thus very poor for estimating distance.\n * @type {TileBoundingRegion}\n */\n this.tileBoundingRegion = undefined;\n this.occludeePointInScaledSpace = new Cartesian3();\n this.boundingVolumeSourceTile = undefined;\n this.boundingVolumeIsFromMesh = false;\n\n this.terrainState = TerrainState.UNLOADED;\n this.mesh = undefined;\n this.fill = undefined;\n\n this.pickBoundingSphere = new BoundingSphere();\n\n this.surfaceShader = undefined;\n this.isClipped = true;\n\n this.clippedByBoundaries = false;\n}\n\nObject.defineProperties(GlobeSurfaceTile.prototype, {\n /**\n * Gets a value indicating whether or not this tile is eligible to be unloaded.\n * Typically, a tile is ineligible to be unloaded while an asynchronous operation,\n * such as a request for data, is in progress on it. A tile will never be\n * unloaded while it is needed for rendering, regardless of the value of this\n * property.\n * @memberof GlobeSurfaceTile.prototype\n * @type {Boolean}\n */\n eligibleForUnloading: {\n get: function () {\n // Do not remove tiles that are transitioning or that have\n // imagery that is transitioning.\n const terrainState = this.terrainState;\n const loadingIsTransitioning =\n terrainState === TerrainState.RECEIVING ||\n terrainState === TerrainState.TRANSFORMING;\n\n let shouldRemoveTile = !loadingIsTransitioning;\n\n const imagery = this.imagery;\n for (let i = 0, len = imagery.length; shouldRemoveTile && i < len; ++i) {\n const tileImagery = imagery[i];\n shouldRemoveTile =\n !defined(tileImagery.loadingImagery) ||\n tileImagery.loadingImagery.state !== ImageryState.TRANSITIONING;\n }\n\n return shouldRemoveTile;\n },\n },\n\n /**\n * Gets the {@link TerrainMesh} that is used for rendering this tile, if any.\n * Returns the value of the {@link GlobeSurfaceTile#mesh} property if\n * {@link GlobeSurfaceTile#vertexArray} is defined. Otherwise, It returns the\n * {@link TerrainFillMesh#mesh} property of the {@link GlobeSurfaceTile#fill}.\n * If there is no fill, it returns undefined.\n *\n * @memberof GlobeSurfaceTile.prototype\n * @type {TerrainMesh}\n */\n renderedMesh: {\n get: function () {\n if (defined(this.vertexArray)) {\n return this.mesh;\n } else if (defined(this.fill)) {\n return this.fill.mesh;\n }\n return undefined;\n },\n },\n});\n\nconst scratchCartographic = new Cartographic();\n\nfunction getPosition(encoding, mode, projection, vertices, index, result) {\n let position = encoding.getExaggeratedPosition(vertices, index, result);\n\n if (defined(mode) && mode !== SceneMode.SCENE3D) {\n const ellipsoid = projection.ellipsoid;\n const positionCartographic = ellipsoid.cartesianToCartographic(\n position,\n scratchCartographic\n );\n position = projection.project(positionCartographic, result);\n position = Cartesian3.fromElements(\n position.z,\n position.x,\n position.y,\n result\n );\n }\n\n return position;\n}\n\nconst scratchV0 = new Cartesian3();\nconst scratchV1 = new Cartesian3();\nconst scratchV2 = new Cartesian3();\n\nGlobeSurfaceTile.prototype.pick = function (\n ray,\n mode,\n projection,\n cullBackFaces,\n result\n) {\n const mesh = this.renderedMesh;\n if (!defined(mesh)) {\n return undefined;\n }\n\n const vertices = mesh.vertices;\n const indices = mesh.indices;\n const encoding = mesh.encoding;\n const indicesLength = indices.length;\n\n let minT = Number.MAX_VALUE;\n\n for (let i = 0; i < indicesLength; i += 3) {\n const i0 = indices[i];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n\n const v0 = getPosition(encoding, mode, projection, vertices, i0, scratchV0);\n const v1 = getPosition(encoding, mode, projection, vertices, i1, scratchV1);\n const v2 = getPosition(encoding, mode, projection, vertices, i2, scratchV2);\n\n const t = IntersectionTests.rayTriangleParametric(\n ray,\n v0,\n v1,\n v2,\n cullBackFaces\n );\n if (defined(t) && t < minT && t >= 0.0) {\n minT = t;\n }\n }\n\n return minT !== Number.MAX_VALUE\n ? Ray.getPoint(ray, minT, result)\n : undefined;\n};\n\nGlobeSurfaceTile.prototype.freeResources = function () {\n if (defined(this.waterMaskTexture)) {\n --this.waterMaskTexture.referenceCount;\n if (this.waterMaskTexture.referenceCount === 0) {\n this.waterMaskTexture.destroy();\n }\n this.waterMaskTexture = undefined;\n }\n\n this.terrainData = undefined;\n\n this.terrainState = TerrainState.UNLOADED;\n this.mesh = undefined;\n this.fill = this.fill && this.fill.destroy();\n\n const imageryList = this.imagery;\n for (let i = 0, len = imageryList.length; i < len; ++i) {\n imageryList[i].freeResources();\n }\n this.imagery.length = 0;\n\n this.freeVertexArray();\n};\n\nGlobeSurfaceTile.prototype.freeVertexArray = function () {\n GlobeSurfaceTile._freeVertexArray(this.vertexArray);\n this.vertexArray = undefined;\n GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray);\n this.wireframeVertexArray = undefined;\n};\n\nGlobeSurfaceTile.initialize = function (\n tile,\n terrainProvider,\n imageryLayerCollection\n) {\n let surfaceTile = tile.data;\n if (!defined(surfaceTile)) {\n surfaceTile = tile.data = new GlobeSurfaceTile();\n }\n\n if (tile.state === QuadtreeTileLoadState.START) {\n prepareNewTile(tile, terrainProvider, imageryLayerCollection);\n tile.state = QuadtreeTileLoadState.LOADING;\n }\n};\n\nGlobeSurfaceTile.processStateMachine = function (\n tile,\n frameState,\n terrainProvider,\n imageryLayerCollection,\n quadtree,\n vertexArraysToDestroy,\n terrainOnly\n) {\n GlobeSurfaceTile.initialize(tile, terrainProvider, imageryLayerCollection);\n\n const surfaceTile = tile.data;\n\n if (tile.state === QuadtreeTileLoadState.LOADING) {\n processTerrainStateMachine(\n tile,\n frameState,\n terrainProvider,\n imageryLayerCollection,\n quadtree,\n vertexArraysToDestroy\n );\n }\n\n // From here down we're loading imagery, not terrain. We don't want to load imagery until\n // we're certain that the terrain tiles are actually visible, though. We'll load terrainOnly\n // in these scenarios:\n // * our bounding volume isn't accurate so we're not certain this tile is really visible (see GlobeSurfaceTileProvider#loadTile).\n // * we want to upsample from this tile but don't plan to render it (see processTerrainStateMachine).\n if (terrainOnly) {\n return;\n }\n\n const wasAlreadyRenderable = tile.renderable;\n\n // The terrain is renderable as soon as we have a valid vertex array.\n tile.renderable = defined(surfaceTile.vertexArray);\n\n // But it's not done loading until it's in the READY state.\n const isTerrainDoneLoading = surfaceTile.terrainState === TerrainState.READY;\n\n // If this tile's terrain and imagery are just upsampled from its parent, mark the tile as\n // upsampled only. We won't refine a tile if its four children are upsampled only.\n tile.upsampledFromParent =\n defined(surfaceTile.terrainData) &&\n surfaceTile.terrainData.wasCreatedByUpsampling();\n\n const isImageryDoneLoading = surfaceTile.processImagery(\n tile,\n terrainProvider,\n frameState\n );\n\n if (isTerrainDoneLoading && isImageryDoneLoading) {\n const callbacks = tile._loadedCallbacks;\n const newCallbacks = {};\n for (const layerId in callbacks) {\n if (callbacks.hasOwnProperty(layerId)) {\n if (!callbacks[layerId](tile)) {\n newCallbacks[layerId] = callbacks[layerId];\n }\n }\n }\n tile._loadedCallbacks = newCallbacks;\n\n tile.state = QuadtreeTileLoadState.DONE;\n }\n\n // Once a tile is renderable, it stays renderable, because doing otherwise would\n // cause detail (or maybe even the entire globe) to vanish when adding a new\n // imagery layer. `GlobeSurfaceTileProvider._onLayerAdded` sets renderable to\n // false for all affected tiles that are not currently being rendered.\n if (wasAlreadyRenderable) {\n tile.renderable = true;\n }\n};\n\nGlobeSurfaceTile.prototype.processImagery = function (\n tile,\n terrainProvider,\n frameState,\n skipLoading\n) {\n const surfaceTile = tile.data;\n let isUpsampledOnly = tile.upsampledFromParent;\n let isAnyTileLoaded = false;\n let isDoneLoading = true;\n\n // Transition imagery states\n const tileImageryCollection = surfaceTile.imagery;\n let i, len;\n for (i = 0, len = tileImageryCollection.length; i < len; ++i) {\n const tileImagery = tileImageryCollection[i];\n if (!defined(tileImagery.loadingImagery)) {\n isUpsampledOnly = false;\n continue;\n }\n\n if (tileImagery.loadingImagery.state === ImageryState.PLACEHOLDER) {\n const imageryLayer = tileImagery.loadingImagery.imageryLayer;\n if (imageryLayer.imageryProvider.ready) {\n // Remove the placeholder and add the actual skeletons (if any)\n // at the same position. Then continue the loop at the same index.\n tileImagery.freeResources();\n tileImageryCollection.splice(i, 1);\n imageryLayer._createTileImagerySkeletons(tile, terrainProvider, i);\n --i;\n len = tileImageryCollection.length;\n continue;\n } else {\n isUpsampledOnly = false;\n }\n }\n\n const thisTileDoneLoading = tileImagery.processStateMachine(\n tile,\n frameState,\n skipLoading\n );\n isDoneLoading = isDoneLoading && thisTileDoneLoading;\n\n // The imagery is renderable as soon as we have any renderable imagery for this region.\n isAnyTileLoaded =\n isAnyTileLoaded ||\n thisTileDoneLoading ||\n defined(tileImagery.readyImagery);\n\n isUpsampledOnly =\n isUpsampledOnly &&\n defined(tileImagery.loadingImagery) &&\n (tileImagery.loadingImagery.state === ImageryState.FAILED ||\n tileImagery.loadingImagery.state === ImageryState.INVALID);\n }\n\n tile.upsampledFromParent = isUpsampledOnly;\n\n // Allow rendering if any available layers are loaded\n tile.renderable = tile.renderable && (isAnyTileLoaded || isDoneLoading);\n\n return isDoneLoading;\n};\n\nfunction toggleGeodeticSurfaceNormals(\n surfaceTile,\n enabled,\n ellipsoid,\n frameState\n) {\n const renderedMesh = surfaceTile.renderedMesh;\n const vertexBuffer = renderedMesh.vertices;\n const encoding = renderedMesh.encoding;\n const vertexCount = vertexBuffer.length / encoding.stride;\n\n // Calculate the new stride and generate a new buffer\n // Clone the other encoding, toggle geodetic surface normals, then clone again to get updated stride\n let newEncoding = TerrainEncoding.clone(encoding);\n newEncoding.hasGeodeticSurfaceNormals = enabled;\n newEncoding = TerrainEncoding.clone(newEncoding);\n const newStride = newEncoding.stride;\n const newVertexBuffer = new Float32Array(vertexCount * newStride);\n\n if (enabled) {\n encoding.addGeodeticSurfaceNormals(\n vertexBuffer,\n newVertexBuffer,\n ellipsoid\n );\n } else {\n encoding.removeGeodeticSurfaceNormals(vertexBuffer, newVertexBuffer);\n }\n\n renderedMesh.vertices = newVertexBuffer;\n renderedMesh.stride = newStride;\n\n // delete the old vertex array (which deletes the vertex buffer attached to it), and create a new vertex array with the new vertex buffer\n const isFill = renderedMesh !== surfaceTile.mesh;\n if (isFill) {\n GlobeSurfaceTile._freeVertexArray(surfaceTile.fill.vertexArray);\n surfaceTile.fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n frameState.context,\n renderedMesh\n );\n } else {\n GlobeSurfaceTile._freeVertexArray(surfaceTile.vertexArray);\n surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n frameState.context,\n renderedMesh\n );\n }\n GlobeSurfaceTile._freeVertexArray(surfaceTile.wireframeVertexArray);\n surfaceTile.wireframeVertexArray = undefined;\n}\n\nGlobeSurfaceTile.prototype.addGeodeticSurfaceNormals = function (\n ellipsoid,\n frameState\n) {\n toggleGeodeticSurfaceNormals(this, true, ellipsoid, frameState);\n};\n\nGlobeSurfaceTile.prototype.removeGeodeticSurfaceNormals = function (\n frameState\n) {\n toggleGeodeticSurfaceNormals(this, false, undefined, frameState);\n};\n\nGlobeSurfaceTile.prototype.updateExaggeration = function (\n tile,\n frameState,\n quadtree\n) {\n const surfaceTile = this;\n const mesh = surfaceTile.renderedMesh;\n if (mesh === undefined) {\n return;\n }\n\n // Check the tile's terrain encoding to see if it has been exaggerated yet\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n const hasExaggerationScale = exaggeration !== 1.0;\n\n const encoding = mesh.encoding;\n const encodingExaggerationScaleChanged =\n encoding.exaggeration !== exaggeration;\n const encodingRelativeHeightChanged =\n encoding.exaggerationRelativeHeight !== exaggerationRelativeHeight;\n\n if (encodingExaggerationScaleChanged || encodingRelativeHeightChanged) {\n // Turning exaggeration scale on/off requires adding or removing geodetic surface normals\n // Relative height only translates, so it has no effect on normals\n if (encodingExaggerationScaleChanged) {\n if (hasExaggerationScale && !encoding.hasGeodeticSurfaceNormals) {\n const ellipsoid = tile.tilingScheme.ellipsoid;\n surfaceTile.addGeodeticSurfaceNormals(ellipsoid, frameState);\n } else if (!hasExaggerationScale && encoding.hasGeodeticSurfaceNormals) {\n surfaceTile.removeGeodeticSurfaceNormals(frameState);\n }\n }\n\n encoding.exaggeration = exaggeration;\n encoding.exaggerationRelativeHeight = exaggerationRelativeHeight;\n\n // Notify the quadtree that this tile's height has changed\n if (quadtree !== undefined) {\n quadtree._tileToUpdateHeights.push(tile);\n const customData = tile.customData;\n const customDataLength = customData.length;\n for (let i = 0; i < customDataLength; i++) {\n // Restart the level so that a height update is triggered\n const data = customData[i];\n data.level = -1;\n }\n }\n }\n};\n\nfunction prepareNewTile(tile, terrainProvider, imageryLayerCollection) {\n let available = terrainProvider.getTileDataAvailable(\n tile.x,\n tile.y,\n tile.level\n );\n\n if (!defined(available) && defined(tile.parent)) {\n // Provider doesn't know if this tile is available. Does the parent tile know?\n const parent = tile.parent;\n const parentSurfaceTile = parent.data;\n if (defined(parentSurfaceTile) && defined(parentSurfaceTile.terrainData)) {\n available = parentSurfaceTile.terrainData.isChildAvailable(\n parent.x,\n parent.y,\n tile.x,\n tile.y\n );\n }\n }\n\n if (available === false) {\n // This tile is not available, so mark it failed so we start upsampling right away.\n tile.data.terrainState = TerrainState.FAILED;\n }\n\n // Map imagery tiles to this terrain tile\n for (let i = 0, len = imageryLayerCollection.length; i < len; ++i) {\n const layer = imageryLayerCollection.get(i);\n if (layer.show) {\n layer._createTileImagerySkeletons(tile, terrainProvider);\n }\n }\n}\n\nfunction processTerrainStateMachine(\n tile,\n frameState,\n terrainProvider,\n imageryLayerCollection,\n quadtree,\n vertexArraysToDestroy\n) {\n const surfaceTile = tile.data;\n\n // If this tile is FAILED, we'll need to upsample from the parent. If the parent isn't\n // ready for that, let's push it along.\n const parent = tile.parent;\n if (\n surfaceTile.terrainState === TerrainState.FAILED &&\n parent !== undefined\n ) {\n const parentReady =\n parent.data !== undefined &&\n parent.data.terrainData !== undefined &&\n parent.data.terrainData.canUpsample !== false;\n if (!parentReady) {\n GlobeSurfaceTile.processStateMachine(\n parent,\n frameState,\n terrainProvider,\n imageryLayerCollection,\n quadtree,\n vertexArraysToDestroy,\n true\n );\n }\n }\n\n if (surfaceTile.terrainState === TerrainState.FAILED) {\n upsample(\n surfaceTile,\n tile,\n frameState,\n terrainProvider,\n tile.x,\n tile.y,\n tile.level\n );\n }\n\n if (surfaceTile.terrainState === TerrainState.UNLOADED) {\n requestTileGeometry(\n surfaceTile,\n terrainProvider,\n tile.x,\n tile.y,\n tile.level\n );\n }\n\n if (surfaceTile.terrainState === TerrainState.RECEIVED) {\n transform(\n surfaceTile,\n frameState,\n terrainProvider,\n tile.x,\n tile.y,\n tile.level\n );\n }\n\n if (surfaceTile.terrainState === TerrainState.TRANSFORMED) {\n createResources(\n surfaceTile,\n frameState.context,\n terrainProvider,\n tile.x,\n tile.y,\n tile.level,\n vertexArraysToDestroy\n );\n\n // Update the tile's exaggeration in case the globe's exaggeration changed while the tile was being processed\n surfaceTile.updateExaggeration(tile, frameState, quadtree);\n }\n\n if (\n surfaceTile.terrainState >= TerrainState.RECEIVED &&\n surfaceTile.waterMaskTexture === undefined &&\n terrainProvider.hasWaterMask\n ) {\n const terrainData = surfaceTile.terrainData;\n if (terrainData.waterMask !== undefined) {\n createWaterMaskTextureIfNeeded(frameState.context, surfaceTile);\n } else {\n const sourceTile = surfaceTile._findAncestorTileWithTerrainData(tile);\n if (defined(sourceTile) && defined(sourceTile.data.waterMaskTexture)) {\n surfaceTile.waterMaskTexture = sourceTile.data.waterMaskTexture;\n ++surfaceTile.waterMaskTexture.referenceCount;\n surfaceTile._computeWaterMaskTranslationAndScale(\n tile,\n sourceTile,\n surfaceTile.waterMaskTranslationAndScale\n );\n }\n }\n }\n}\n\nfunction upsample(surfaceTile, tile, frameState, terrainProvider, x, y, level) {\n const parent = tile.parent;\n if (!parent) {\n // Trying to upsample from a root tile. No can do. This tile is a failure.\n tile.state = QuadtreeTileLoadState.FAILED;\n return;\n }\n\n const sourceData = parent.data.terrainData;\n const sourceX = parent.x;\n const sourceY = parent.y;\n const sourceLevel = parent.level;\n\n if (!defined(sourceData)) {\n // Parent is not available, so we can't upsample this tile yet.\n return;\n }\n\n const terrainDataPromise = sourceData.upsample(\n terrainProvider.tilingScheme,\n sourceX,\n sourceY,\n sourceLevel,\n x,\n y,\n level\n );\n if (!defined(terrainDataPromise)) {\n // The upsample request has been deferred - try again later.\n return;\n }\n\n surfaceTile.terrainState = TerrainState.RECEIVING;\n\n Promise.resolve(terrainDataPromise)\n .then(function (terrainData) {\n surfaceTile.terrainData = terrainData;\n surfaceTile.terrainState = TerrainState.RECEIVED;\n })\n .catch(function () {\n surfaceTile.terrainState = TerrainState.FAILED;\n });\n}\n\nfunction requestTileGeometry(surfaceTile, terrainProvider, x, y, level) {\n function success(terrainData) {\n surfaceTile.terrainData = terrainData;\n surfaceTile.terrainState = TerrainState.RECEIVED;\n surfaceTile.request = undefined;\n }\n\n function failure(error) {\n if (surfaceTile.request.state === RequestState.CANCELLED) {\n // Cancelled due to low priority - try again later.\n surfaceTile.terrainData = undefined;\n surfaceTile.terrainState = TerrainState.UNLOADED;\n surfaceTile.request = undefined;\n return;\n }\n\n // Initially assume failure. reportError may retry, in which case the state will\n // change to RECEIVING or UNLOADED.\n surfaceTile.terrainState = TerrainState.FAILED;\n surfaceTile.request = undefined;\n\n const message = `Failed to obtain terrain tile X: ${x} Y: ${y} Level: ${level}. Error message: \"${error}\"`;\n terrainProvider._requestError = TileProviderError.reportError(\n terrainProvider._requestError,\n terrainProvider,\n terrainProvider.errorEvent,\n message,\n x,\n y,\n level\n );\n if (terrainProvider._requestError.retry) {\n doRequest();\n }\n }\n\n function doRequest() {\n // Request the terrain from the terrain provider.\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.TERRAIN,\n });\n surfaceTile.request = request;\n\n const requestPromise = terrainProvider.requestTileGeometry(\n x,\n y,\n level,\n request\n );\n\n // If the request method returns undefined (instead of a promise), the request\n // has been deferred.\n if (defined(requestPromise)) {\n surfaceTile.terrainState = TerrainState.RECEIVING;\n Promise.resolve(requestPromise)\n .then(function (terrainData) {\n success(terrainData);\n })\n .catch(function (e) {\n failure(e);\n });\n } else {\n // Deferred - try again later.\n surfaceTile.terrainState = TerrainState.UNLOADED;\n surfaceTile.request = undefined;\n }\n }\n\n doRequest();\n}\n\nconst scratchCreateMeshOptions = {\n tilingScheme: undefined,\n x: 0,\n y: 0,\n level: 0,\n exaggeration: 1.0,\n exaggerationRelativeHeight: 0.0,\n throttle: true,\n};\n\nfunction transform(surfaceTile, frameState, terrainProvider, x, y, level) {\n const tilingScheme = terrainProvider.tilingScheme;\n\n const createMeshOptions = scratchCreateMeshOptions;\n createMeshOptions.tilingScheme = tilingScheme;\n createMeshOptions.x = x;\n createMeshOptions.y = y;\n createMeshOptions.level = level;\n createMeshOptions.exaggeration = frameState.terrainExaggeration;\n createMeshOptions.exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n createMeshOptions.throttle = true;\n\n const terrainData = surfaceTile.terrainData;\n const meshPromise = terrainData.createMesh(createMeshOptions);\n\n if (!defined(meshPromise)) {\n // Postponed.\n return;\n }\n\n surfaceTile.terrainState = TerrainState.TRANSFORMING;\n\n Promise.resolve(meshPromise)\n .then(function (mesh) {\n surfaceTile.mesh = mesh;\n surfaceTile.terrainState = TerrainState.TRANSFORMED;\n })\n .catch(function () {\n surfaceTile.terrainState = TerrainState.FAILED;\n });\n}\n\nGlobeSurfaceTile._createVertexArrayForMesh = function (context, mesh) {\n const typedArray = mesh.vertices;\n const buffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n const attributes = mesh.encoding.getAttributes(buffer);\n\n const indexBuffers = mesh.indices.indexBuffers || {};\n let indexBuffer = indexBuffers[context.id];\n if (!defined(indexBuffer) || indexBuffer.isDestroyed()) {\n const indices = mesh.indices;\n indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.fromSizeInBytes(indices.BYTES_PER_ELEMENT),\n });\n indexBuffer.vertexArrayDestroyable = false;\n indexBuffer.referenceCount = 1;\n indexBuffers[context.id] = indexBuffer;\n mesh.indices.indexBuffers = indexBuffers;\n } else {\n ++indexBuffer.referenceCount;\n }\n\n return new VertexArray({\n context: context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n });\n};\n\nGlobeSurfaceTile._freeVertexArray = function (vertexArray) {\n if (defined(vertexArray)) {\n const indexBuffer = vertexArray.indexBuffer;\n\n if (!vertexArray.isDestroyed()) {\n vertexArray.destroy();\n }\n\n if (\n defined(indexBuffer) &&\n !indexBuffer.isDestroyed() &&\n defined(indexBuffer.referenceCount)\n ) {\n --indexBuffer.referenceCount;\n if (indexBuffer.referenceCount === 0) {\n indexBuffer.destroy();\n }\n }\n }\n};\n\nfunction createResources(\n surfaceTile,\n context,\n terrainProvider,\n x,\n y,\n level,\n vertexArraysToDestroy\n) {\n surfaceTile.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n context,\n surfaceTile.mesh\n );\n surfaceTile.terrainState = TerrainState.READY;\n surfaceTile.fill =\n surfaceTile.fill && surfaceTile.fill.destroy(vertexArraysToDestroy);\n}\n\nfunction getContextWaterMaskData(context) {\n let data = context.cache.tile_waterMaskData;\n\n if (!defined(data)) {\n const allWaterTexture = Texture.create({\n context: context,\n pixelFormat: PixelFormat.LUMINANCE,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n arrayBufferView: new Uint8Array([255]),\n width: 1,\n height: 1,\n },\n });\n allWaterTexture.referenceCount = 1;\n\n const sampler = new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.LINEAR,\n magnificationFilter: TextureMagnificationFilter.LINEAR,\n });\n\n data = {\n allWaterTexture: allWaterTexture,\n sampler: sampler,\n destroy: function () {\n this.allWaterTexture.destroy();\n },\n };\n\n context.cache.tile_waterMaskData = data;\n }\n\n return data;\n}\n\nfunction createWaterMaskTextureIfNeeded(context, surfaceTile) {\n const waterMask = surfaceTile.terrainData.waterMask;\n const waterMaskData = getContextWaterMaskData(context);\n let texture;\n\n const waterMaskLength = waterMask.length;\n if (waterMaskLength === 1) {\n // Length 1 means the tile is entirely land or entirely water.\n // A value of 0 indicates entirely land, a value of 1 indicates entirely water.\n if (waterMask[0] !== 0) {\n texture = waterMaskData.allWaterTexture;\n } else {\n // Leave the texture undefined if the tile is entirely land.\n return;\n }\n } else {\n const textureSize = Math.sqrt(waterMaskLength);\n texture = Texture.create({\n context: context,\n pixelFormat: PixelFormat.LUMINANCE,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n width: textureSize,\n height: textureSize,\n arrayBufferView: waterMask,\n },\n sampler: waterMaskData.sampler,\n flipY: false,\n });\n\n texture.referenceCount = 0;\n }\n\n ++texture.referenceCount;\n surfaceTile.waterMaskTexture = texture;\n\n Cartesian4.fromElements(\n 0.0,\n 0.0,\n 1.0,\n 1.0,\n surfaceTile.waterMaskTranslationAndScale\n );\n}\n\nGlobeSurfaceTile.prototype._findAncestorTileWithTerrainData = function (tile) {\n let sourceTile = tile.parent;\n\n while (\n defined(sourceTile) &&\n (!defined(sourceTile.data) ||\n !defined(sourceTile.data.terrainData) ||\n sourceTile.data.terrainData.wasCreatedByUpsampling())\n ) {\n sourceTile = sourceTile.parent;\n }\n\n return sourceTile;\n};\n\nGlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale = function (\n tile,\n sourceTile,\n result\n) {\n const sourceTileRectangle = sourceTile.rectangle;\n const tileRectangle = tile.rectangle;\n const tileWidth = tileRectangle.width;\n const tileHeight = tileRectangle.height;\n\n const scaleX = tileWidth / sourceTileRectangle.width;\n const scaleY = tileHeight / sourceTileRectangle.height;\n result.x =\n (scaleX * (tileRectangle.west - sourceTileRectangle.west)) / tileWidth;\n result.y =\n (scaleY * (tileRectangle.south - sourceTileRectangle.south)) / tileHeight;\n result.z = scaleX;\n result.w = scaleY;\n\n return result;\n};\nexport default GlobeSurfaceTile;\n", "import defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ImageryState from \"./ImageryState.js\";\n\n/**\n * Stores details about a tile of imagery.\n *\n * @alias Imagery\n * @private\n */\nfunction Imagery(imageryLayer, x, y, level, rectangle) {\n this.imageryLayer = imageryLayer;\n this.x = x;\n this.y = y;\n this.level = level;\n this.request = undefined;\n\n if (level !== 0) {\n const parentX = (x / 2) | 0;\n const parentY = (y / 2) | 0;\n const parentLevel = level - 1;\n this.parent = imageryLayer.getImageryFromCache(\n parentX,\n parentY,\n parentLevel\n );\n }\n\n this.state = ImageryState.UNLOADED;\n this.imageUrl = undefined;\n this.image = undefined;\n this.texture = undefined;\n this.textureWebMercator = undefined;\n this.credits = undefined;\n this.referenceCount = 0;\n\n if (!defined(rectangle) && imageryLayer.imageryProvider.ready) {\n const tilingScheme = imageryLayer.imageryProvider.tilingScheme;\n rectangle = tilingScheme.tileXYToRectangle(x, y, level);\n }\n\n this.rectangle = rectangle;\n}\nImagery.createPlaceholder = function (imageryLayer) {\n const result = new Imagery(imageryLayer, 0, 0, 0);\n result.addReference();\n result.state = ImageryState.PLACEHOLDER;\n return result;\n};\n\nImagery.prototype.addReference = function () {\n ++this.referenceCount;\n};\n\nImagery.prototype.releaseReference = function () {\n --this.referenceCount;\n\n if (this.referenceCount === 0) {\n this.imageryLayer.removeImageryFromCache(this);\n\n if (defined(this.parent)) {\n this.parent.releaseReference();\n }\n\n if (defined(this.image) && defined(this.image.destroy)) {\n this.image.destroy();\n }\n\n if (defined(this.texture)) {\n this.texture.destroy();\n }\n\n if (\n defined(this.textureWebMercator) &&\n this.texture !== this.textureWebMercator\n ) {\n this.textureWebMercator.destroy();\n }\n\n destroyObject(this);\n\n return 0;\n }\n\n return this.referenceCount;\n};\n\nImagery.prototype.processStateMachine = function (\n frameState,\n needGeographicProjection,\n skipLoading\n) {\n if (this.state === ImageryState.UNLOADED && !skipLoading) {\n this.state = ImageryState.TRANSITIONING;\n this.imageryLayer._requestImagery(this);\n }\n\n if (this.state === ImageryState.RECEIVED) {\n this.state = ImageryState.TRANSITIONING;\n this.imageryLayer._createTexture(frameState.context, this);\n }\n\n // If the imagery is already ready, but we need a geographic version and don't have it yet,\n // we still need to do the reprojection step. This can happen if the Web Mercator version\n // is fine initially, but the geographic one is needed later.\n const needsReprojection =\n this.state === ImageryState.READY &&\n needGeographicProjection &&\n !this.texture;\n\n if (this.state === ImageryState.TEXTURE_LOADED || needsReprojection) {\n this.state = ImageryState.TRANSITIONING;\n this.imageryLayer._reprojectTexture(\n frameState,\n this,\n needGeographicProjection\n );\n }\n};\nexport default Imagery;\n", "import defined from \"../Core/defined.js\";\nimport ImageryState from \"./ImageryState.js\";\n\n/**\n * The assocation between a terrain tile and an imagery tile.\n *\n * @alias TileImagery\n * @private\n *\n * @param {Imagery} imagery The imagery tile.\n * @param {Cartesian4} textureCoordinateRectangle The texture rectangle of the tile that is covered\n * by the imagery, where X=west, Y=south, Z=east, W=north.\n * @param {Boolean} useWebMercatorT true to use the Web Mercator texture coordinates for this imagery tile.\n */\nfunction TileImagery(imagery, textureCoordinateRectangle, useWebMercatorT) {\n this.readyImagery = undefined;\n this.loadingImagery = imagery;\n this.textureCoordinateRectangle = textureCoordinateRectangle;\n this.textureTranslationAndScale = undefined;\n this.useWebMercatorT = useWebMercatorT;\n}\n\n/**\n * Frees the resources held by this instance.\n */\nTileImagery.prototype.freeResources = function () {\n if (defined(this.readyImagery)) {\n this.readyImagery.releaseReference();\n }\n\n if (defined(this.loadingImagery)) {\n this.loadingImagery.releaseReference();\n }\n};\n\n/**\n * Processes the load state machine for this instance.\n *\n * @param {Tile} tile The tile to which this instance belongs.\n * @param {FrameState} frameState The frameState.\n * @param {Boolean} skipLoading True to skip loading, e.g. new requests, creating textures. This function will\n * still synchronously process imagery that's already mostly ready to go, e.g. use textures\n * already loaded on ancestor tiles.\n * @returns {Boolean} True if this instance is done loading; otherwise, false.\n */\nTileImagery.prototype.processStateMachine = function (\n tile,\n frameState,\n skipLoading\n) {\n const loadingImagery = this.loadingImagery;\n const imageryLayer = loadingImagery.imageryLayer;\n\n loadingImagery.processStateMachine(\n frameState,\n !this.useWebMercatorT,\n skipLoading\n );\n\n if (loadingImagery.state === ImageryState.READY) {\n if (defined(this.readyImagery)) {\n this.readyImagery.releaseReference();\n }\n this.readyImagery = this.loadingImagery;\n this.loadingImagery = undefined;\n this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n tile,\n this\n );\n return true; // done loading\n }\n\n // Find some ancestor imagery we can use while this imagery is still loading.\n let ancestor = loadingImagery.parent;\n let closestAncestorThatNeedsLoading;\n while (\n defined(ancestor) &&\n (ancestor.state !== ImageryState.READY ||\n (!this.useWebMercatorT && !defined(ancestor.texture)))\n ) {\n if (\n ancestor.state !== ImageryState.FAILED &&\n ancestor.state !== ImageryState.INVALID\n ) {\n // ancestor is still loading\n closestAncestorThatNeedsLoading =\n closestAncestorThatNeedsLoading || ancestor;\n }\n ancestor = ancestor.parent;\n }\n\n if (this.readyImagery !== ancestor) {\n if (defined(this.readyImagery)) {\n this.readyImagery.releaseReference();\n }\n\n this.readyImagery = ancestor;\n\n if (defined(ancestor)) {\n ancestor.addReference();\n this.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n tile,\n this\n );\n }\n }\n\n if (\n loadingImagery.state === ImageryState.FAILED ||\n loadingImagery.state === ImageryState.INVALID\n ) {\n // The imagery tile is failed or invalid, so we'd like to use an ancestor instead.\n if (defined(closestAncestorThatNeedsLoading)) {\n // Push the ancestor's load process along a bit. This is necessary because some ancestor imagery\n // tiles may not be attached directly to a terrain tile. Such tiles will never load if\n // we don't do it here.\n closestAncestorThatNeedsLoading.processStateMachine(\n frameState,\n !this.useWebMercatorT,\n skipLoading\n );\n return false; // not done loading\n }\n // This imagery tile is failed or invalid, and we have the \"best available\" substitute.\n return true; // done loading\n }\n\n return false; // not done loading\n};\nexport default TileImagery;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport RequestState from \"../Core/RequestState.js\";\nimport RequestType from \"../Core/RequestType.js\";\nimport TerrainProvider from \"../Core/TerrainProvider.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport MipmapHint from \"../Renderer/MipmapHint.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport ReprojectWebMercatorFS from \"../Shaders/ReprojectWebMercatorFS.js\";\nimport ReprojectWebMercatorVS from \"../Shaders/ReprojectWebMercatorVS.js\";\nimport Imagery from \"./Imagery.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport TileImagery from \"./TileImagery.js\";\n\n/**\n * An imagery layer that displays tiled image data from a single imagery provider\n * on a {@link Globe}.\n *\n * @alias ImageryLayer\n * @constructor\n *\n * @param {ImageryProvider} imageryProvider The imagery provider to use.\n * @param {Object} [options] Object with the following properties:\n * @param {Rectangle} [options.rectangle=imageryProvider.rectangle] The rectangle of the layer. This rectangle\n * can limit the visible portion of the imagery provider.\n * @param {Number|Function} [options.alpha=1.0] The alpha blending value of this layer, from 0.0 to 1.0.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the alpha is required, and it is expected to return\n * the alpha value to use for the tile.\n * @param {Number|Function} [options.nightAlpha=1.0] The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the alpha is required, and it is expected to return\n * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.\n * @param {Number|Function} [options.dayAlpha=1.0] The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the alpha is required, and it is expected to return\n * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.\n * @param {Number|Function} [options.brightness=1.0] The brightness of this layer. 1.0 uses the unmodified imagery\n * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the brightness is required, and it is expected to return\n * the brightness value to use for the tile. The function is executed for every\n * frame and for every tile, so it must be fast.\n * @param {Number|Function} [options.contrast=1.0] The contrast of this layer. 1.0 uses the unmodified imagery color.\n * Less than 1.0 reduces the contrast while greater than 1.0 increases it.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the contrast is required, and it is expected to return\n * the contrast value to use for the tile. The function is executed for every\n * frame and for every tile, so it must be fast.\n * @param {Number|Function} [options.hue=0.0] The hue of this layer. 0.0 uses the unmodified imagery color.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates\n * of the imagery tile for which the hue is required, and it is expected to return\n * the contrast value to use for the tile. The function is executed for every\n * frame and for every tile, so it must be fast.\n * @param {Number|Function} [options.saturation=1.0] The saturation of this layer. 1.0 uses the unmodified imagery color.\n * Less than 1.0 reduces the saturation while greater than 1.0 increases it.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates\n * of the imagery tile for which the saturation is required, and it is expected to return\n * the contrast value to use for the tile. The function is executed for every\n * frame and for every tile, so it must be fast.\n * @param {Number|Function} [options.gamma=1.0] The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.\n * This can either be a simple number or a function with the signature\n * <code>function(frameState, layer, x, y, level)</code>. The function is passed the\n * current frame state, this layer, and the x, y, and level coordinates of the\n * imagery tile for which the gamma is required, and it is expected to return\n * the gamma value to use for the tile. The function is executed for every\n * frame and for every tile, so it must be fast.\n * @param {SplitDirection|Function} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this layer.\n * @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The\n * texture minification filter to apply to this layer. Possible values\n * are <code>TextureMinificationFilter.LINEAR</code> and\n * <code>TextureMinificationFilter.NEAREST</code>.\n * @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The\n * texture minification filter to apply to this layer. Possible values\n * are <code>TextureMagnificationFilter.LINEAR</code> and\n * <code>TextureMagnificationFilter.NEAREST</code>.\n * @param {Boolean} [options.show=true] True if the layer is shown; otherwise, false.\n * @param {Number} [options.maximumAnisotropy=maximum supported] The maximum anisotropy level to use\n * for texture filtering. If this parameter is not specified, the maximum anisotropy supported\n * by the WebGL stack will be used. Larger values make the imagery look better in horizon\n * views.\n * @param {Number} [options.minimumTerrainLevel] The minimum terrain level-of-detail at which to show this imagery layer,\n * or undefined to show it at all levels. Level zero is the least-detailed level.\n * @param {Number} [options.maximumTerrainLevel] The maximum terrain level-of-detail at which to show this imagery layer,\n * or undefined to show it at all levels. Level zero is the least-detailed level.\n * @param {Rectangle} [options.cutoutRectangle] Cartographic rectangle for cutting out a portion of this ImageryLayer.\n * @param {Color} [options.colorToAlpha] Color to be used as alpha.\n * @param {Number} [options.colorToAlphaThreshold=0.004] Threshold for color-to-alpha.\n */\nfunction ImageryLayer(imageryProvider, options) {\n this._imageryProvider = imageryProvider;\n\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The alpha blending value of this layer, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number}\n * @default 1.0\n */\n this.alpha = defaultValue(\n options.alpha,\n defaultValue(imageryProvider.defaultAlpha, 1.0)\n );\n\n /**\n * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.\n *\n * @type {Number}\n * @default 1.0\n */\n this.nightAlpha = defaultValue(\n options.nightAlpha,\n defaultValue(imageryProvider.defaultNightAlpha, 1.0)\n );\n\n /**\n * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.\n *\n * @type {Number}\n * @default 1.0\n */\n this.dayAlpha = defaultValue(\n options.dayAlpha,\n defaultValue(imageryProvider.defaultDayAlpha, 1.0)\n );\n\n /**\n * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number}\n * @default {@link ImageryLayer.DEFAULT_BRIGHTNESS}\n */\n this.brightness = defaultValue(\n options.brightness,\n defaultValue(\n imageryProvider.defaultBrightness,\n ImageryLayer.DEFAULT_BRIGHTNESS\n )\n );\n\n /**\n * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number}\n * @default {@link ImageryLayer.DEFAULT_CONTRAST}\n */\n this.contrast = defaultValue(\n options.contrast,\n defaultValue(imageryProvider.defaultContrast, ImageryLayer.DEFAULT_CONTRAST)\n );\n\n /**\n * The hue of this layer in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number}\n * @default {@link ImageryLayer.DEFAULT_HUE}\n */\n this.hue = defaultValue(\n options.hue,\n defaultValue(imageryProvider.defaultHue, ImageryLayer.DEFAULT_HUE)\n );\n\n /**\n * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number}\n * @default {@link ImageryLayer.DEFAULT_SATURATION}\n */\n this.saturation = defaultValue(\n options.saturation,\n defaultValue(\n imageryProvider.defaultSaturation,\n ImageryLayer.DEFAULT_SATURATION\n )\n );\n\n /**\n * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.\n *\n * @type {Number}\n * @default {@link ImageryLayer.DEFAULT_GAMMA}\n */\n this.gamma = defaultValue(\n options.gamma,\n defaultValue(imageryProvider.defaultGamma, ImageryLayer.DEFAULT_GAMMA)\n );\n\n /**\n * The {@link SplitDirection} to apply to this layer.\n *\n * @type {SplitDirection}\n * @default {@link ImageryLayer.DEFAULT_SPLIT}\n */\n this.splitDirection = defaultValue(\n options.splitDirection,\n defaultValue(imageryProvider.defaultSplit, ImageryLayer.DEFAULT_SPLIT)\n );\n\n /**\n * The {@link TextureMinificationFilter} to apply to this layer.\n * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)\n * and {@link TextureMinificationFilter.NEAREST}.\n *\n * To take effect, this property must be set immediately after adding the imagery layer.\n * Once a texture is loaded it won't be possible to change the texture filter used.\n *\n * @type {TextureMinificationFilter}\n * @default {@link ImageryLayer.DEFAULT_MINIFICATION_FILTER}\n */\n this.minificationFilter = defaultValue(\n options.minificationFilter,\n defaultValue(\n imageryProvider.defaultMinificationFilter,\n ImageryLayer.DEFAULT_MINIFICATION_FILTER\n )\n );\n\n /**\n * The {@link TextureMagnificationFilter} to apply to this layer.\n * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)\n * and {@link TextureMagnificationFilter.NEAREST}.\n *\n * To take effect, this property must be set immediately after adding the imagery layer.\n * Once a texture is loaded it won't be possible to change the texture filter used.\n *\n * @type {TextureMagnificationFilter}\n * @default {@link ImageryLayer.DEFAULT_MAGNIFICATION_FILTER}\n */\n this.magnificationFilter = defaultValue(\n options.magnificationFilter,\n defaultValue(\n imageryProvider.defaultMagnificationFilter,\n ImageryLayer.DEFAULT_MAGNIFICATION_FILTER\n )\n );\n\n /**\n * Determines if this layer is shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n this._minimumTerrainLevel = options.minimumTerrainLevel;\n this._maximumTerrainLevel = options.maximumTerrainLevel;\n\n this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\n this._maximumAnisotropy = options.maximumAnisotropy;\n\n this._imageryCache = {};\n\n this._skeletonPlaceholder = new TileImagery(Imagery.createPlaceholder(this));\n\n // The value of the show property on the last update.\n this._show = true;\n\n // The index of this layer in the ImageryLayerCollection.\n this._layerIndex = -1;\n\n // true if this is the base (lowest shown) layer.\n this._isBaseLayer = false;\n\n this._requestImageError = undefined;\n\n this._reprojectComputeCommands = [];\n\n /**\n * Rectangle cutout in this layer of imagery.\n *\n * @type {Rectangle}\n */\n this.cutoutRectangle = options.cutoutRectangle;\n\n /**\n * Color value that should be set to transparent.\n *\n * @type {Color}\n */\n this.colorToAlpha = options.colorToAlpha;\n\n /**\n * Normalized (0-1) threshold for color-to-alpha.\n *\n * @type {Number}\n */\n this.colorToAlphaThreshold = defaultValue(\n options.colorToAlphaThreshold,\n ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD\n );\n}\n\nObject.defineProperties(ImageryLayer.prototype, {\n /**\n * Gets the imagery provider for this layer.\n * @memberof ImageryLayer.prototype\n * @type {ImageryProvider}\n * @readonly\n */\n imageryProvider: {\n get: function () {\n return this._imageryProvider;\n },\n },\n\n /**\n * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the\n * {@link ImageryProvider}, only a portion of the imagery provider is shown.\n * @memberof ImageryLayer.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n});\n\n/**\n * This value is used as the default brightness for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the brightness of the imagery.\n * @type {Number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_BRIGHTNESS = 1.0;\n/**\n * This value is used as the default contrast for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the contrast of the imagery.\n * @type {Number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_CONTRAST = 1.0;\n/**\n * This value is used as the default hue for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the hue of the imagery.\n * @type {Number}\n * @default 0.0\n */\nImageryLayer.DEFAULT_HUE = 0.0;\n/**\n * This value is used as the default saturation for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the saturation of the imagery.\n * @type {Number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_SATURATION = 1.0;\n/**\n * This value is used as the default gamma for the imagery layer if one is not provided during construction\n * or by the imagery provider. This value does not modify the gamma of the imagery.\n * @type {Number}\n * @default 1.0\n */\nImageryLayer.DEFAULT_GAMMA = 1.0;\n\n/**\n * This value is used as the default split for the imagery layer if one is not provided during construction\n * or by the imagery provider.\n * @type {SplitDirection}\n * @default SplitDirection.NONE\n */\nImageryLayer.DEFAULT_SPLIT = SplitDirection.NONE;\n\n/**\n * This value is used as the default texture minification filter for the imagery layer if one is not provided\n * during construction or by the imagery provider.\n * @type {TextureMinificationFilter}\n * @default TextureMinificationFilter.LINEAR\n */\nImageryLayer.DEFAULT_MINIFICATION_FILTER = TextureMinificationFilter.LINEAR;\n\n/**\n * This value is used as the default texture magnification filter for the imagery layer if one is not provided\n * during construction or by the imagery provider.\n * @type {TextureMagnificationFilter}\n * @default TextureMagnificationFilter.LINEAR\n */\nImageryLayer.DEFAULT_MAGNIFICATION_FILTER = TextureMagnificationFilter.LINEAR;\n\n/**\n * This value is used as the default threshold for color-to-alpha if one is not provided\n * during construction or by the imagery provider.\n * @type {Number}\n * @default 0.004\n */\nImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD = 0.004;\n\n/**\n * Gets a value indicating whether this layer is the base layer in the\n * {@link ImageryLayerCollection}. The base layer is the one that underlies all\n * others. It is special in that it is treated as if it has global rectangle, even if\n * it actually does not, by stretching the texels at the edges over the entire\n * globe.\n *\n * @returns {Boolean} true if this is the base layer; otherwise, false.\n */\nImageryLayer.prototype.isBaseLayer = function () {\n return this._isBaseLayer;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ImageryLayer#destroy\n */\nImageryLayer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * imageryLayer = imageryLayer && imageryLayer.destroy();\n *\n * @see ImageryLayer#isDestroyed\n */\nImageryLayer.prototype.destroy = function () {\n return destroyObject(this);\n};\n\nconst imageryBoundsScratch = new Rectangle();\nconst tileImageryBoundsScratch = new Rectangle();\nconst clippedRectangleScratch = new Rectangle();\nconst terrainRectangleScratch = new Rectangle();\n\n/**\n * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,\n * producing the overall bounds of imagery that can be produced by this layer.\n *\n * @returns {Promise.<Rectangle>} A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.\n *\n * @example\n * // Zoom to an imagery layer.\n * imageryLayer.getViewableRectangle().then(function (rectangle) {\n * return camera.flyTo({\n * destination: rectangle\n * });\n * });\n */\nImageryLayer.prototype.getViewableRectangle = function () {\n const imageryProvider = this._imageryProvider;\n const rectangle = this._rectangle;\n return imageryProvider.readyPromise.then(function () {\n return Rectangle.intersection(imageryProvider.rectangle, rectangle);\n });\n};\n\n/**\n * Create skeletons for the imagery tiles that partially or completely overlap a given terrain\n * tile.\n *\n * @private\n *\n * @param {Tile} tile The terrain tile.\n * @param {TerrainProvider} terrainProvider The terrain provider associated with the terrain tile.\n * @param {Number} insertionPoint The position to insert new skeletons before in the tile's imagery list.\n * @returns {Boolean} true if this layer overlaps any portion of the terrain tile; otherwise, false.\n */\nImageryLayer.prototype._createTileImagerySkeletons = function (\n tile,\n terrainProvider,\n insertionPoint\n) {\n const surfaceTile = tile.data;\n\n if (\n defined(this._minimumTerrainLevel) &&\n tile.level < this._minimumTerrainLevel\n ) {\n return false;\n }\n if (\n defined(this._maximumTerrainLevel) &&\n tile.level > this._maximumTerrainLevel\n ) {\n return false;\n }\n\n const imageryProvider = this._imageryProvider;\n\n if (!defined(insertionPoint)) {\n insertionPoint = surfaceTile.imagery.length;\n }\n\n if (!imageryProvider.ready) {\n // The imagery provider is not ready, so we can't create skeletons, yet.\n // Instead, add a placeholder so that we'll know to create\n // the skeletons once the provider is ready.\n this._skeletonPlaceholder.loadingImagery.addReference();\n surfaceTile.imagery.splice(insertionPoint, 0, this._skeletonPlaceholder);\n return true;\n }\n\n // Use Web Mercator for our texture coordinate computations if this imagery layer uses\n // that projection and the terrain tile falls entirely inside the valid bounds of the\n // projection.\n const useWebMercatorT =\n imageryProvider.tilingScheme.projection instanceof WebMercatorProjection &&\n tile.rectangle.north < WebMercatorProjection.MaximumLatitude &&\n tile.rectangle.south > -WebMercatorProjection.MaximumLatitude;\n\n // Compute the rectangle of the imagery from this imageryProvider that overlaps\n // the geometry tile. The ImageryProvider and ImageryLayer both have the\n // opportunity to constrain the rectangle. The imagery TilingScheme's rectangle\n // always fully contains the ImageryProvider's rectangle.\n const imageryBounds = Rectangle.intersection(\n imageryProvider.rectangle,\n this._rectangle,\n imageryBoundsScratch\n );\n let rectangle = Rectangle.intersection(\n tile.rectangle,\n imageryBounds,\n tileImageryBoundsScratch\n );\n\n if (!defined(rectangle)) {\n // There is no overlap between this terrain tile and this imagery\n // provider. Unless this is the base layer, no skeletons need to be created.\n // We stretch texels at the edge of the base layer over the entire globe.\n if (!this.isBaseLayer()) {\n return false;\n }\n\n const baseImageryRectangle = imageryBounds;\n const baseTerrainRectangle = tile.rectangle;\n rectangle = tileImageryBoundsScratch;\n\n if (baseTerrainRectangle.south >= baseImageryRectangle.north) {\n rectangle.north = rectangle.south = baseImageryRectangle.north;\n } else if (baseTerrainRectangle.north <= baseImageryRectangle.south) {\n rectangle.north = rectangle.south = baseImageryRectangle.south;\n } else {\n rectangle.south = Math.max(\n baseTerrainRectangle.south,\n baseImageryRectangle.south\n );\n rectangle.north = Math.min(\n baseTerrainRectangle.north,\n baseImageryRectangle.north\n );\n }\n\n if (baseTerrainRectangle.west >= baseImageryRectangle.east) {\n rectangle.west = rectangle.east = baseImageryRectangle.east;\n } else if (baseTerrainRectangle.east <= baseImageryRectangle.west) {\n rectangle.west = rectangle.east = baseImageryRectangle.west;\n } else {\n rectangle.west = Math.max(\n baseTerrainRectangle.west,\n baseImageryRectangle.west\n );\n rectangle.east = Math.min(\n baseTerrainRectangle.east,\n baseImageryRectangle.east\n );\n }\n }\n\n let latitudeClosestToEquator = 0.0;\n if (rectangle.south > 0.0) {\n latitudeClosestToEquator = rectangle.south;\n } else if (rectangle.north < 0.0) {\n latitudeClosestToEquator = rectangle.north;\n }\n\n // Compute the required level in the imagery tiling scheme.\n // The errorRatio should really be imagerySSE / terrainSSE rather than this hard-coded value.\n // But first we need configurable imagery SSE and we need the rendering to be able to handle more\n // images attached to a terrain tile than there are available texture units. So that's for the future.\n const errorRatio = 1.0;\n const targetGeometricError =\n errorRatio * terrainProvider.getLevelMaximumGeometricError(tile.level);\n let imageryLevel = getLevelWithMaximumTexelSpacing(\n this,\n targetGeometricError,\n latitudeClosestToEquator\n );\n imageryLevel = Math.max(0, imageryLevel);\n const maximumLevel = imageryProvider.maximumLevel;\n if (imageryLevel > maximumLevel) {\n imageryLevel = maximumLevel;\n }\n\n if (defined(imageryProvider.minimumLevel)) {\n const minimumLevel = imageryProvider.minimumLevel;\n if (imageryLevel < minimumLevel) {\n imageryLevel = minimumLevel;\n }\n }\n\n const imageryTilingScheme = imageryProvider.tilingScheme;\n const northwestTileCoordinates = imageryTilingScheme.positionToTileXY(\n Rectangle.northwest(rectangle),\n imageryLevel\n );\n const southeastTileCoordinates = imageryTilingScheme.positionToTileXY(\n Rectangle.southeast(rectangle),\n imageryLevel\n );\n\n // If the southeast corner of the rectangle lies very close to the north or west side\n // of the southeast tile, we don't actually need the southernmost or easternmost\n // tiles.\n // Similarly, if the northwest corner of the rectangle lies very close to the south or east side\n // of the northwest tile, we don't actually need the northernmost or westernmost tiles.\n\n // We define \"very close\" as being within 1/512 of the width of the tile.\n let veryCloseX = tile.rectangle.width / 512.0;\n let veryCloseY = tile.rectangle.height / 512.0;\n\n const northwestTileRectangle = imageryTilingScheme.tileXYToRectangle(\n northwestTileCoordinates.x,\n northwestTileCoordinates.y,\n imageryLevel\n );\n if (\n Math.abs(northwestTileRectangle.south - tile.rectangle.north) <\n veryCloseY &&\n northwestTileCoordinates.y < southeastTileCoordinates.y\n ) {\n ++northwestTileCoordinates.y;\n }\n if (\n Math.abs(northwestTileRectangle.east - tile.rectangle.west) < veryCloseX &&\n northwestTileCoordinates.x < southeastTileCoordinates.x\n ) {\n ++northwestTileCoordinates.x;\n }\n\n const southeastTileRectangle = imageryTilingScheme.tileXYToRectangle(\n southeastTileCoordinates.x,\n southeastTileCoordinates.y,\n imageryLevel\n );\n if (\n Math.abs(southeastTileRectangle.north - tile.rectangle.south) <\n veryCloseY &&\n southeastTileCoordinates.y > northwestTileCoordinates.y\n ) {\n --southeastTileCoordinates.y;\n }\n if (\n Math.abs(southeastTileRectangle.west - tile.rectangle.east) < veryCloseX &&\n southeastTileCoordinates.x > northwestTileCoordinates.x\n ) {\n --southeastTileCoordinates.x;\n }\n\n // Create TileImagery instances for each imagery tile overlapping this terrain tile.\n // We need to do all texture coordinate computations in the imagery tile's tiling scheme.\n\n const terrainRectangle = Rectangle.clone(\n tile.rectangle,\n terrainRectangleScratch\n );\n let imageryRectangle = imageryTilingScheme.tileXYToRectangle(\n northwestTileCoordinates.x,\n northwestTileCoordinates.y,\n imageryLevel\n );\n let clippedImageryRectangle = Rectangle.intersection(\n imageryRectangle,\n imageryBounds,\n clippedRectangleScratch\n );\n\n let imageryTileXYToRectangle;\n if (useWebMercatorT) {\n imageryTilingScheme.rectangleToNativeRectangle(\n terrainRectangle,\n terrainRectangle\n );\n imageryTilingScheme.rectangleToNativeRectangle(\n imageryRectangle,\n imageryRectangle\n );\n imageryTilingScheme.rectangleToNativeRectangle(\n clippedImageryRectangle,\n clippedImageryRectangle\n );\n imageryTilingScheme.rectangleToNativeRectangle(\n imageryBounds,\n imageryBounds\n );\n imageryTileXYToRectangle = imageryTilingScheme.tileXYToNativeRectangle.bind(\n imageryTilingScheme\n );\n veryCloseX = terrainRectangle.width / 512.0;\n veryCloseY = terrainRectangle.height / 512.0;\n } else {\n imageryTileXYToRectangle = imageryTilingScheme.tileXYToRectangle.bind(\n imageryTilingScheme\n );\n }\n\n let minU;\n let maxU = 0.0;\n\n let minV = 1.0;\n let maxV;\n\n // If this is the northern-most or western-most tile in the imagery tiling scheme,\n // it may not start at the northern or western edge of the terrain tile.\n // Calculate where it does start.\n if (\n !this.isBaseLayer() &&\n Math.abs(clippedImageryRectangle.west - terrainRectangle.west) >= veryCloseX\n ) {\n maxU = Math.min(\n 1.0,\n (clippedImageryRectangle.west - terrainRectangle.west) /\n terrainRectangle.width\n );\n }\n\n if (\n !this.isBaseLayer() &&\n Math.abs(clippedImageryRectangle.north - terrainRectangle.north) >=\n veryCloseY\n ) {\n minV = Math.max(\n 0.0,\n (clippedImageryRectangle.north - terrainRectangle.south) /\n terrainRectangle.height\n );\n }\n\n const initialMinV = minV;\n\n for (\n let i = northwestTileCoordinates.x;\n i <= southeastTileCoordinates.x;\n i++\n ) {\n minU = maxU;\n\n imageryRectangle = imageryTileXYToRectangle(\n i,\n northwestTileCoordinates.y,\n imageryLevel\n );\n clippedImageryRectangle = Rectangle.simpleIntersection(\n imageryRectangle,\n imageryBounds,\n clippedRectangleScratch\n );\n\n if (!defined(clippedImageryRectangle)) {\n continue;\n }\n\n maxU = Math.min(\n 1.0,\n (clippedImageryRectangle.east - terrainRectangle.west) /\n terrainRectangle.width\n );\n\n // If this is the eastern-most imagery tile mapped to this terrain tile,\n // and there are more imagery tiles to the east of this one, the maxU\n // should be 1.0 to make sure rounding errors don't make the last\n // image fall shy of the edge of the terrain tile.\n if (\n i === southeastTileCoordinates.x &&\n (this.isBaseLayer() ||\n Math.abs(clippedImageryRectangle.east - terrainRectangle.east) <\n veryCloseX)\n ) {\n maxU = 1.0;\n }\n\n minV = initialMinV;\n\n for (\n let j = northwestTileCoordinates.y;\n j <= southeastTileCoordinates.y;\n j++\n ) {\n maxV = minV;\n\n imageryRectangle = imageryTileXYToRectangle(i, j, imageryLevel);\n clippedImageryRectangle = Rectangle.simpleIntersection(\n imageryRectangle,\n imageryBounds,\n clippedRectangleScratch\n );\n\n if (!defined(clippedImageryRectangle)) {\n continue;\n }\n\n minV = Math.max(\n 0.0,\n (clippedImageryRectangle.south - terrainRectangle.south) /\n terrainRectangle.height\n );\n\n // If this is the southern-most imagery tile mapped to this terrain tile,\n // and there are more imagery tiles to the south of this one, the minV\n // should be 0.0 to make sure rounding errors don't make the last\n // image fall shy of the edge of the terrain tile.\n if (\n j === southeastTileCoordinates.y &&\n (this.isBaseLayer() ||\n Math.abs(clippedImageryRectangle.south - terrainRectangle.south) <\n veryCloseY)\n ) {\n minV = 0.0;\n }\n\n const texCoordsRectangle = new Cartesian4(minU, minV, maxU, maxV);\n const imagery = this.getImageryFromCache(i, j, imageryLevel);\n surfaceTile.imagery.splice(\n insertionPoint,\n 0,\n new TileImagery(imagery, texCoordsRectangle, useWebMercatorT)\n );\n ++insertionPoint;\n }\n }\n\n return true;\n};\n\n/**\n * Calculate the translation and scale for a particular {@link TileImagery} attached to a\n * particular terrain tile.\n *\n * @private\n *\n * @param {Tile} tile The terrain tile.\n * @param {TileImagery} tileImagery The imagery tile mapping.\n * @returns {Cartesian4} The translation and scale where X and Y are the translation and Z and W\n * are the scale.\n */\nImageryLayer.prototype._calculateTextureTranslationAndScale = function (\n tile,\n tileImagery\n) {\n let imageryRectangle = tileImagery.readyImagery.rectangle;\n let terrainRectangle = tile.rectangle;\n\n if (tileImagery.useWebMercatorT) {\n const tilingScheme =\n tileImagery.readyImagery.imageryLayer.imageryProvider.tilingScheme;\n imageryRectangle = tilingScheme.rectangleToNativeRectangle(\n imageryRectangle,\n imageryBoundsScratch\n );\n terrainRectangle = tilingScheme.rectangleToNativeRectangle(\n terrainRectangle,\n terrainRectangleScratch\n );\n }\n\n const terrainWidth = terrainRectangle.width;\n const terrainHeight = terrainRectangle.height;\n\n const scaleX = terrainWidth / imageryRectangle.width;\n const scaleY = terrainHeight / imageryRectangle.height;\n return new Cartesian4(\n (scaleX * (terrainRectangle.west - imageryRectangle.west)) / terrainWidth,\n (scaleY * (terrainRectangle.south - imageryRectangle.south)) /\n terrainHeight,\n scaleX,\n scaleY\n );\n};\n\n/**\n * Request a particular piece of imagery from the imagery provider. This method handles raising an\n * error event if the request fails, and retrying the request if necessary.\n *\n * @private\n *\n * @param {Imagery} imagery The imagery to request.\n */\nImageryLayer.prototype._requestImagery = function (imagery) {\n const imageryProvider = this._imageryProvider;\n\n const that = this;\n\n function success(image) {\n if (!defined(image)) {\n return failure();\n }\n\n imagery.image = image;\n imagery.state = ImageryState.RECEIVED;\n imagery.request = undefined;\n\n TileProviderError.reportSuccess(that._requestImageError);\n }\n\n function failure(e) {\n if (imagery.request.state === RequestState.CANCELLED) {\n // Cancelled due to low priority - try again later.\n imagery.state = ImageryState.UNLOADED;\n imagery.request = undefined;\n return;\n }\n\n // Initially assume failure. handleError may retry, in which case the state will\n // change to TRANSITIONING.\n imagery.state = ImageryState.FAILED;\n imagery.request = undefined;\n\n const message = `Failed to obtain image tile X: ${imagery.x} Y: ${imagery.y} Level: ${imagery.level}.`;\n that._requestImageError = TileProviderError.reportError(\n that._requestImageError,\n imageryProvider,\n imageryProvider.errorEvent,\n message,\n imagery.x,\n imagery.y,\n imagery.level,\n e\n );\n if (that._requestImageError.retry) {\n doRequest();\n }\n }\n\n function doRequest() {\n const request = new Request({\n throttle: false,\n throttleByServer: true,\n type: RequestType.IMAGERY,\n });\n imagery.request = request;\n imagery.state = ImageryState.TRANSITIONING;\n const imagePromise = imageryProvider.requestImage(\n imagery.x,\n imagery.y,\n imagery.level,\n request\n );\n\n if (!defined(imagePromise)) {\n // Too many parallel requests, so postpone loading tile.\n imagery.state = ImageryState.UNLOADED;\n imagery.request = undefined;\n return;\n }\n\n if (defined(imageryProvider.getTileCredits)) {\n imagery.credits = imageryProvider.getTileCredits(\n imagery.x,\n imagery.y,\n imagery.level\n );\n }\n\n imagePromise\n .then(function (image) {\n success(image);\n })\n .catch(function (e) {\n failure(e);\n });\n }\n\n doRequest();\n};\n\nImageryLayer.prototype._createTextureWebGL = function (context, imagery) {\n const sampler = new Sampler({\n minificationFilter: this.minificationFilter,\n magnificationFilter: this.magnificationFilter,\n });\n\n const image = imagery.image;\n\n if (defined(image.internalFormat)) {\n return new Texture({\n context: context,\n pixelFormat: image.internalFormat,\n width: image.width,\n height: image.height,\n source: {\n arrayBufferView: image.bufferView,\n },\n sampler: sampler,\n });\n }\n return new Texture({\n context: context,\n source: image,\n pixelFormat: this._imageryProvider.hasAlphaChannel\n ? PixelFormat.RGBA\n : PixelFormat.RGB,\n sampler: sampler,\n });\n};\n\n/**\n * Create a WebGL texture for a given {@link Imagery} instance.\n *\n * @private\n *\n * @param {Context} context The rendered context to use to create textures.\n * @param {Imagery} imagery The imagery for which to create a texture.\n */\nImageryLayer.prototype._createTexture = function (context, imagery) {\n const imageryProvider = this._imageryProvider;\n const image = imagery.image;\n\n // If this imagery provider has a discard policy, use it to check if this\n // image should be discarded.\n if (defined(imageryProvider.tileDiscardPolicy)) {\n const discardPolicy = imageryProvider.tileDiscardPolicy;\n if (defined(discardPolicy)) {\n // If the discard policy is not ready yet, transition back to the\n // RECEIVED state and we'll try again next time.\n if (!discardPolicy.isReady()) {\n imagery.state = ImageryState.RECEIVED;\n return;\n }\n\n // Mark discarded imagery tiles invalid. Parent imagery will be used instead.\n if (discardPolicy.shouldDiscardImage(image)) {\n imagery.state = ImageryState.INVALID;\n return;\n }\n }\n }\n\n // Imagery does not need to be discarded, so upload it to WebGL.\n const texture = this._createTextureWebGL(context, imagery);\n\n if (\n imageryProvider.tilingScheme.projection instanceof WebMercatorProjection\n ) {\n imagery.textureWebMercator = texture;\n } else {\n imagery.texture = texture;\n }\n imagery.image = undefined;\n imagery.state = ImageryState.TEXTURE_LOADED;\n};\n\nfunction getSamplerKey(\n minificationFilter,\n magnificationFilter,\n maximumAnisotropy\n) {\n return `${minificationFilter}:${magnificationFilter}:${maximumAnisotropy}`;\n}\n\nImageryLayer.prototype._finalizeReprojectTexture = function (context, texture) {\n let minificationFilter = this.minificationFilter;\n const magnificationFilter = this.magnificationFilter;\n const usesLinearTextureFilter =\n minificationFilter === TextureMinificationFilter.LINEAR &&\n magnificationFilter === TextureMagnificationFilter.LINEAR;\n // Use mipmaps if this texture has power-of-two dimensions.\n // In addition, mipmaps are only generated if the texture filters are both LINEAR.\n if (\n usesLinearTextureFilter &&\n !PixelFormat.isCompressedFormat(texture.pixelFormat) &&\n CesiumMath.isPowerOfTwo(texture.width) &&\n CesiumMath.isPowerOfTwo(texture.height)\n ) {\n minificationFilter = TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;\n const maximumSupportedAnisotropy =\n ContextLimits.maximumTextureFilterAnisotropy;\n const maximumAnisotropy = Math.min(\n maximumSupportedAnisotropy,\n defaultValue(this._maximumAnisotropy, maximumSupportedAnisotropy)\n );\n const mipmapSamplerKey = getSamplerKey(\n minificationFilter,\n magnificationFilter,\n maximumAnisotropy\n );\n let mipmapSamplers = context.cache.imageryLayerMipmapSamplers;\n if (!defined(mipmapSamplers)) {\n mipmapSamplers = {};\n context.cache.imageryLayerMipmapSamplers = mipmapSamplers;\n }\n let mipmapSampler = mipmapSamplers[mipmapSamplerKey];\n if (!defined(mipmapSampler)) {\n mipmapSampler = mipmapSamplers[mipmapSamplerKey] = new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: minificationFilter,\n magnificationFilter: magnificationFilter,\n maximumAnisotropy: maximumAnisotropy,\n });\n }\n texture.generateMipmap(MipmapHint.NICEST);\n texture.sampler = mipmapSampler;\n } else {\n const nonMipmapSamplerKey = getSamplerKey(\n minificationFilter,\n magnificationFilter,\n 0\n );\n let nonMipmapSamplers = context.cache.imageryLayerNonMipmapSamplers;\n if (!defined(nonMipmapSamplers)) {\n nonMipmapSamplers = {};\n context.cache.imageryLayerNonMipmapSamplers = nonMipmapSamplers;\n }\n let nonMipmapSampler = nonMipmapSamplers[nonMipmapSamplerKey];\n if (!defined(nonMipmapSampler)) {\n nonMipmapSampler = nonMipmapSamplers[nonMipmapSamplerKey] = new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: minificationFilter,\n magnificationFilter: magnificationFilter,\n });\n }\n texture.sampler = nonMipmapSampler;\n }\n};\n\n/**\n * Enqueues a command re-projecting a texture to a {@link GeographicProjection} on the next update, if necessary, and generate\n * mipmaps for the geographic texture.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n * @param {Imagery} imagery The imagery instance to reproject.\n * @param {Boolean} [needGeographicProjection=true] True to reproject to geographic, or false if Web Mercator is fine.\n */\nImageryLayer.prototype._reprojectTexture = function (\n frameState,\n imagery,\n needGeographicProjection\n) {\n const texture = imagery.textureWebMercator || imagery.texture;\n const rectangle = imagery.rectangle;\n const context = frameState.context;\n\n needGeographicProjection = defaultValue(needGeographicProjection, true);\n\n // Reproject this texture if it is not already in a geographic projection and\n // the pixels are more than 1e-5 radians apart. The pixel spacing cutoff\n // avoids precision problems in the reprojection transformation while making\n // no noticeable difference in the georeferencing of the image.\n if (\n needGeographicProjection &&\n !(\n this._imageryProvider.tilingScheme.projection instanceof\n GeographicProjection\n ) &&\n rectangle.width / texture.width > 1e-5\n ) {\n const that = this;\n imagery.addReference();\n const computeCommand = new ComputeCommand({\n persists: true,\n owner: this,\n // Update render resources right before execution instead of now.\n // This allows different ImageryLayers to share the same vao and buffers.\n preExecute: function (command) {\n reprojectToGeographic(command, context, texture, imagery.rectangle);\n },\n postExecute: function (outputTexture) {\n imagery.texture = outputTexture;\n that._finalizeReprojectTexture(context, outputTexture);\n imagery.state = ImageryState.READY;\n imagery.releaseReference();\n },\n canceled: function () {\n imagery.state = ImageryState.TEXTURE_LOADED;\n imagery.releaseReference();\n },\n });\n this._reprojectComputeCommands.push(computeCommand);\n } else {\n if (needGeographicProjection) {\n imagery.texture = texture;\n }\n this._finalizeReprojectTexture(context, texture);\n imagery.state = ImageryState.READY;\n }\n};\n\n/**\n * Updates frame state to execute any queued texture re-projections.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n */\nImageryLayer.prototype.queueReprojectionCommands = function (frameState) {\n const computeCommands = this._reprojectComputeCommands;\n const length = computeCommands.length;\n for (let i = 0; i < length; ++i) {\n frameState.commandList.push(computeCommands[i]);\n }\n computeCommands.length = 0;\n};\n\n/**\n * Cancels re-projection commands queued for the next frame.\n *\n * @private\n */\nImageryLayer.prototype.cancelReprojections = function () {\n this._reprojectComputeCommands.forEach(function (command) {\n if (defined(command.canceled)) {\n command.canceled();\n }\n });\n this._reprojectComputeCommands.length = 0;\n};\n\nImageryLayer.prototype.getImageryFromCache = function (\n x,\n y,\n level,\n imageryRectangle\n) {\n const cacheKey = getImageryCacheKey(x, y, level);\n let imagery = this._imageryCache[cacheKey];\n\n if (!defined(imagery)) {\n imagery = new Imagery(this, x, y, level, imageryRectangle);\n this._imageryCache[cacheKey] = imagery;\n }\n\n imagery.addReference();\n return imagery;\n};\n\nImageryLayer.prototype.removeImageryFromCache = function (imagery) {\n const cacheKey = getImageryCacheKey(imagery.x, imagery.y, imagery.level);\n delete this._imageryCache[cacheKey];\n};\n\nfunction getImageryCacheKey(x, y, level) {\n return JSON.stringify([x, y, level]);\n}\n\nconst uniformMap = {\n u_textureDimensions: function () {\n return this.textureDimensions;\n },\n u_texture: function () {\n return this.texture;\n },\n\n textureDimensions: new Cartesian2(),\n texture: undefined,\n};\n\nconst float32ArrayScratch = FeatureDetection.supportsTypedArrays()\n ? new Float32Array(2 * 64)\n : undefined;\n\nfunction reprojectToGeographic(command, context, texture, rectangle) {\n // This function has gone through a number of iterations, because GPUs are awesome.\n //\n // Originally, we had a very simple vertex shader and computed the Web Mercator texture coordinates\n // per-fragment in the fragment shader. That worked well, except on mobile devices, because\n // fragment shaders have limited precision on many mobile devices. The result was smearing artifacts\n // at medium zoom levels because different geographic texture coordinates would be reprojected to Web\n // Mercator as the same value.\n //\n // Our solution was to reproject to Web Mercator in the vertex shader instead of the fragment shader.\n // This required far more vertex data. With fragment shader reprojection, we only needed a single quad.\n // But to achieve the same precision with vertex shader reprojection, we needed a vertex for each\n // output pixel. So we used a grid of 256x256 vertices, because most of our imagery\n // tiles are 256x256. Fortunately the grid could be created and uploaded to the GPU just once and\n // re-used for all reprojections, so the performance was virtually unchanged from our original fragment\n // shader approach. See https://github.com/CesiumGS/cesium/pull/714.\n //\n // Over a year later, we noticed (https://github.com/CesiumGS/cesium/issues/2110)\n // that our reprojection code was creating a rare but severe artifact on some GPUs (Intel HD 4600\n // for one). The problem was that the GLSL sin function on these GPUs had a discontinuity at fine scales in\n // a few places.\n //\n // We solved this by implementing a more reliable sin function based on the CORDIC algorithm\n // (https://github.com/CesiumGS/cesium/pull/2111). Even though this was a fair\n // amount of code to be executing per vertex, the performance seemed to be pretty good on most GPUs.\n // Unfortunately, on some GPUs, the performance was absolutely terrible\n // (https://github.com/CesiumGS/cesium/issues/2258).\n //\n // So that brings us to our current solution, the one you see here. Effectively, we compute the Web\n // Mercator texture coordinates on the CPU and store the T coordinate with each vertex (the S coordinate\n // is the same in Geographic and Web Mercator). To make this faster, we reduced our reprojection mesh\n // to be only 2 vertices wide and 64 vertices high. We should have reduced the width to 2 sooner,\n // because the extra vertices weren't buying us anything. The height of 64 means we are technically\n // doing a slightly less accurate reprojection than we were before, but we can't see the difference\n // so it's worth the 4x speedup.\n\n let reproject = context.cache.imageryLayer_reproject;\n\n if (!defined(reproject)) {\n reproject = context.cache.imageryLayer_reproject = {\n vertexArray: undefined,\n shaderProgram: undefined,\n sampler: undefined,\n destroy: function () {\n if (defined(this.framebuffer)) {\n this.framebuffer.destroy();\n }\n if (defined(this.vertexArray)) {\n this.vertexArray.destroy();\n }\n if (defined(this.shaderProgram)) {\n this.shaderProgram.destroy();\n }\n },\n };\n\n const positions = new Float32Array(2 * 64 * 2);\n let index = 0;\n for (let j = 0; j < 64; ++j) {\n const y = j / 63.0;\n positions[index++] = 0.0;\n positions[index++] = y;\n positions[index++] = 1.0;\n positions[index++] = y;\n }\n\n const reprojectAttributeIndices = {\n position: 0,\n webMercatorT: 1,\n };\n\n const indices = TerrainProvider.getRegularGridIndices(2, 64);\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: indices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n\n reproject.vertexArray = new VertexArray({\n context: context,\n attributes: [\n {\n index: reprojectAttributeIndices.position,\n vertexBuffer: Buffer.createVertexBuffer({\n context: context,\n typedArray: positions,\n usage: BufferUsage.STATIC_DRAW,\n }),\n componentsPerAttribute: 2,\n },\n {\n index: reprojectAttributeIndices.webMercatorT,\n vertexBuffer: Buffer.createVertexBuffer({\n context: context,\n sizeInBytes: 64 * 2 * 4,\n usage: BufferUsage.STREAM_DRAW,\n }),\n componentsPerAttribute: 1,\n },\n ],\n indexBuffer: indexBuffer,\n });\n\n const vs = new ShaderSource({\n sources: [ReprojectWebMercatorVS],\n });\n\n reproject.shaderProgram = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: ReprojectWebMercatorFS,\n attributeLocations: reprojectAttributeIndices,\n });\n\n reproject.sampler = new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: TextureMinificationFilter.LINEAR,\n magnificationFilter: TextureMagnificationFilter.LINEAR,\n });\n }\n\n texture.sampler = reproject.sampler;\n\n const width = texture.width;\n const height = texture.height;\n\n uniformMap.textureDimensions.x = width;\n uniformMap.textureDimensions.y = height;\n uniformMap.texture = texture;\n\n let sinLatitude = Math.sin(rectangle.south);\n const southMercatorY = 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));\n\n sinLatitude = Math.sin(rectangle.north);\n const northMercatorY = 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));\n const oneOverMercatorHeight = 1.0 / (northMercatorY - southMercatorY);\n\n const outputTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: texture.pixelFormat,\n pixelDatatype: texture.pixelDatatype,\n preMultiplyAlpha: texture.preMultiplyAlpha,\n });\n\n // Allocate memory for the mipmaps. Failure to do this before rendering\n // to the texture via the FBO, and calling generateMipmap later,\n // will result in the texture appearing blank. I can't pretend to\n // understand exactly why this is.\n if (CesiumMath.isPowerOfTwo(width) && CesiumMath.isPowerOfTwo(height)) {\n outputTexture.generateMipmap(MipmapHint.NICEST);\n }\n\n const south = rectangle.south;\n const north = rectangle.north;\n\n const webMercatorT = float32ArrayScratch;\n\n let outputIndex = 0;\n for (let webMercatorTIndex = 0; webMercatorTIndex < 64; ++webMercatorTIndex) {\n const fraction = webMercatorTIndex / 63.0;\n const latitude = CesiumMath.lerp(south, north, fraction);\n sinLatitude = Math.sin(latitude);\n const mercatorY = 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n const mercatorFraction =\n (mercatorY - southMercatorY) * oneOverMercatorHeight;\n webMercatorT[outputIndex++] = mercatorFraction;\n webMercatorT[outputIndex++] = mercatorFraction;\n }\n\n reproject.vertexArray\n .getAttribute(1)\n .vertexBuffer.copyFromArrayView(webMercatorT);\n\n command.shaderProgram = reproject.shaderProgram;\n command.outputTexture = outputTexture;\n command.uniformMap = uniformMap;\n command.vertexArray = reproject.vertexArray;\n}\n\n/**\n * Gets the level with the specified world coordinate spacing between texels, or less.\n *\n * @param {ImageryLayer} layer The imagery layer to use.\n * @param {Number} texelSpacing The texel spacing for which to find a corresponding level.\n * @param {Number} latitudeClosestToEquator The latitude closest to the equator that we're concerned with.\n * @returns {Number} The level with the specified texel spacing or less.\n * @private\n */\nfunction getLevelWithMaximumTexelSpacing(\n layer,\n texelSpacing,\n latitudeClosestToEquator\n) {\n // PERFORMANCE_IDEA: factor out the stuff that doesn't change.\n const imageryProvider = layer._imageryProvider;\n const tilingScheme = imageryProvider.tilingScheme;\n const ellipsoid = tilingScheme.ellipsoid;\n const latitudeFactor = !(\n layer._imageryProvider.tilingScheme.projection instanceof\n GeographicProjection\n )\n ? Math.cos(latitudeClosestToEquator)\n : 1.0;\n const tilingSchemeRectangle = tilingScheme.rectangle;\n const levelZeroMaximumTexelSpacing =\n (ellipsoid.maximumRadius * tilingSchemeRectangle.width * latitudeFactor) /\n (imageryProvider.tileWidth * tilingScheme.getNumberOfXTilesAtLevel(0));\n\n const twoToTheLevelPower = levelZeroMaximumTexelSpacing / texelSpacing;\n const level = Math.log(twoToTheLevelPower) / Math.log(2);\n const rounded = Math.round(level);\n return rounded | 0;\n}\nexport default ImageryLayer;\n", "/**\n * Indicates what happened the last time this tile was visited for selection.\n * @private\n */\nconst TileSelectionResult = {\n /**\n * There was no selection result, perhaps because the tile wasn't visited\n * last frame.\n */\n NONE: 0,\n\n /**\n * This tile was deemed not visible and culled.\n */\n CULLED: 1,\n\n /**\n * The tile was selected for rendering.\n */\n RENDERED: 2,\n\n /**\n * This tile did not meet the required screen-space error and was refined.\n */\n REFINED: 3,\n\n /**\n * This tile was originally rendered, but it got kicked out of the render list\n * in favor of an ancestor because it is not yet renderable.\n */\n RENDERED_AND_KICKED: 2 | 4,\n\n /**\n * This tile was originally refined, but its rendered descendants got kicked out of the\n * render list in favor of an ancestor because it is not yet renderable.\n */\n REFINED_AND_KICKED: 3 | 4,\n\n /**\n * This tile was culled because it was not visible, but it still needs to be loaded\n * and any heights on it need to be updated because the camera's position or the\n * camera's reference frame's origin falls inside this tile. Loading this tile\n * could affect the position of the camera if the camera is currently below\n * terrain or if it is tracking an object whose height is referenced to terrain.\n * And a change in the camera position may, in turn, affect what is culled.\n */\n CULLED_BUT_NEEDED: 1 | 8,\n\n /**\n * Determines if a selection result indicates that this tile or its descendants were\n * kicked from the render list. In other words, if it is <code>RENDERED_AND_KICKED</code>\n * or <code>REFINED_AND_KICKED</code>.\n *\n * @param {TileSelectionResult} value The selection result to test.\n * @returns {Boolean} true if the tile was kicked, no matter if it was originally rendered or refined.\n */\n wasKicked: function (value) {\n return value >= TileSelectionResult.RENDERED_AND_KICKED;\n },\n\n /**\n * Determines the original selection result prior to being kicked or CULLED_BUT_NEEDED.\n * If the tile wasn't kicked or CULLED_BUT_NEEDED, the original value is returned.\n * @param {TileSelectionResult} value The selection result.\n * @returns {TileSelectionResult} The original selection result prior to kicking.\n */\n originalResult: function (value) {\n return value & 3;\n },\n\n /**\n * Converts this selection result to a kick.\n * @param {TileSelectionResult} value The original selection result.\n * @returns {TileSelectionResult} The kicked form of the selection result.\n */\n kick: function (value) {\n return value | 4;\n },\n};\nexport default TileSelectionResult;\n", "import AttributeCompression from \"../Core/AttributeCompression.js\";\nimport binarySearch from \"../Core/binarySearch.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport HeightmapTerrainData from \"../Core/HeightmapTerrainData.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport Queue from \"../Core/Queue.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\nimport TerrainMesh from \"../Core/TerrainMesh.js\";\nimport TileEdge from \"../Core/TileEdge.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport GlobeSurfaceTile from \"./GlobeSurfaceTile.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\nfunction TerrainFillMesh(tile) {\n this.tile = tile;\n this.frameLastUpdated = undefined;\n this.westMeshes = []; // north to south (CCW)\n this.westTiles = [];\n this.southMeshes = []; // west to east (CCW)\n this.southTiles = [];\n this.eastMeshes = []; // south to north (CCW)\n this.eastTiles = [];\n this.northMeshes = []; // east to west (CCW)\n this.northTiles = [];\n this.southwestMesh = undefined;\n this.southwestTile = undefined;\n this.southeastMesh = undefined;\n this.southeastTile = undefined;\n this.northwestMesh = undefined;\n this.northwestTile = undefined;\n this.northeastMesh = undefined;\n this.northeastTile = undefined;\n this.changedThisFrame = true;\n this.visitedFrame = undefined;\n this.enqueuedFrame = undefined;\n this.mesh = undefined;\n this.vertexArray = undefined;\n this.waterMaskTexture = undefined;\n this.waterMaskTranslationAndScale = new Cartesian4();\n}\n\nTerrainFillMesh.prototype.update = function (\n tileProvider,\n frameState,\n vertexArraysToDestroy\n) {\n if (this.changedThisFrame) {\n createFillMesh(tileProvider, frameState, this.tile, vertexArraysToDestroy);\n this.changedThisFrame = false;\n }\n};\n\nTerrainFillMesh.prototype.destroy = function (vertexArraysToDestroy) {\n this._destroyVertexArray(vertexArraysToDestroy);\n\n if (defined(this.waterMaskTexture)) {\n --this.waterMaskTexture.referenceCount;\n if (this.waterMaskTexture.referenceCount === 0) {\n this.waterMaskTexture.destroy();\n }\n this.waterMaskTexture = undefined;\n }\n\n return undefined;\n};\n\nTerrainFillMesh.prototype._destroyVertexArray = function (\n vertexArraysToDestroy\n) {\n if (defined(this.vertexArray)) {\n if (defined(vertexArraysToDestroy)) {\n vertexArraysToDestroy.push(this.vertexArray);\n } else {\n GlobeSurfaceTile._freeVertexArray(this.vertexArray);\n }\n this.vertexArray = undefined;\n }\n};\n\nconst traversalQueueScratch = new Queue();\n\nTerrainFillMesh.updateFillTiles = function (\n tileProvider,\n renderedTiles,\n frameState,\n vertexArraysToDestroy\n) {\n // We want our fill tiles to look natural, which means they should align perfectly with\n // adjacent loaded tiles, and their edges that are not adjacent to loaded tiles should have\n // sensible heights (e.g. the average of the heights of loaded edges). Some fill tiles may\n // be adjacent only to other fill tiles, and in that case heights should be assigned fanning\n // outward from the loaded tiles so that there are no sudden changes in height.\n\n // We do this with a breadth-first traversal of the rendered tiles, starting with the loaded\n // ones. Graph nodes are tiles and graph edges connect to other rendered tiles that are spatially adjacent\n // to those tiles. As we visit each node, we propagate tile edges to adjacent tiles. If there's no data\n // for a tile edge, we create an edge with an average height and then propagate it. If an edge is partially defined\n // (e.g. an edge is adjacent to multiple more-detailed tiles and only some of them are loaded), we\n // fill in the rest of the edge with the same height.\n const quadtree = tileProvider._quadtree;\n const levelZeroTiles = quadtree._levelZeroTiles;\n const lastSelectionFrameNumber = quadtree._lastSelectionFrameNumber;\n\n const traversalQueue = traversalQueueScratch;\n traversalQueue.clear();\n\n // Add the tiles with real geometry to the traversal queue.\n for (let i = 0; i < renderedTiles.length; ++i) {\n const renderedTile = renderedTiles[i];\n if (defined(renderedTile.data.vertexArray)) {\n traversalQueue.enqueue(renderedTiles[i]);\n }\n }\n\n let tile = traversalQueue.dequeue();\n\n while (tile !== undefined) {\n const tileToWest = tile.findTileToWest(levelZeroTiles);\n const tileToSouth = tile.findTileToSouth(levelZeroTiles);\n const tileToEast = tile.findTileToEast(levelZeroTiles);\n const tileToNorth = tile.findTileToNorth(levelZeroTiles);\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToWest,\n lastSelectionFrameNumber,\n TileEdge.EAST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToSouth,\n lastSelectionFrameNumber,\n TileEdge.NORTH,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToEast,\n lastSelectionFrameNumber,\n TileEdge.WEST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToNorth,\n lastSelectionFrameNumber,\n TileEdge.SOUTH,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n\n const tileToNorthwest = tileToWest.findTileToNorth(levelZeroTiles);\n const tileToSouthwest = tileToWest.findTileToSouth(levelZeroTiles);\n const tileToNortheast = tileToEast.findTileToNorth(levelZeroTiles);\n const tileToSoutheast = tileToEast.findTileToSouth(levelZeroTiles);\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToNorthwest,\n lastSelectionFrameNumber,\n TileEdge.SOUTHEAST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToNortheast,\n lastSelectionFrameNumber,\n TileEdge.SOUTHWEST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToSouthwest,\n lastSelectionFrameNumber,\n TileEdge.NORTHEAST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n tile,\n tileToSoutheast,\n lastSelectionFrameNumber,\n TileEdge.NORTHWEST,\n false,\n traversalQueue,\n vertexArraysToDestroy\n );\n\n tile = traversalQueue.dequeue();\n }\n};\n\nfunction visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile,\n currentFrameNumber,\n tileEdge,\n downOnly,\n traversalQueue,\n vertexArraysToDestroy\n) {\n if (startTile === undefined) {\n // There are no tiles North or South of the poles.\n return;\n }\n\n let tile = startTile;\n while (\n tile &&\n (tile._lastSelectionResultFrame !== currentFrameNumber ||\n TileSelectionResult.wasKicked(tile._lastSelectionResult) ||\n TileSelectionResult.originalResult(tile._lastSelectionResult) ===\n TileSelectionResult.CULLED)\n ) {\n // This tile wasn't visited or it was visited and then kicked, so walk up to find the closest ancestor that was rendered.\n // We also walk up if the tile was culled, because if siblings were kicked an ancestor may have been rendered.\n if (downOnly) {\n return;\n }\n\n const parent = tile.parent;\n if (tileEdge >= TileEdge.NORTHWEST && parent !== undefined) {\n // When we're looking for a corner, verify that the parent tile is still relevant.\n // That is, the parent and child must share the corner in question.\n switch (tileEdge) {\n case TileEdge.NORTHWEST:\n tile = tile === parent.northwestChild ? parent : undefined;\n break;\n case TileEdge.NORTHEAST:\n tile = tile === parent.northeastChild ? parent : undefined;\n break;\n case TileEdge.SOUTHWEST:\n tile = tile === parent.southwestChild ? parent : undefined;\n break;\n case TileEdge.SOUTHEAST:\n tile = tile === parent.southeastChild ? parent : undefined;\n break;\n }\n } else {\n tile = parent;\n }\n }\n\n if (tile === undefined) {\n return;\n }\n\n if (tile._lastSelectionResult === TileSelectionResult.RENDERED) {\n if (defined(tile.data.vertexArray)) {\n // No further processing necessary for renderable tiles.\n return;\n }\n visitTile(\n tileProvider,\n frameState,\n sourceTile,\n tile,\n tileEdge,\n currentFrameNumber,\n traversalQueue,\n vertexArraysToDestroy\n );\n return;\n }\n\n if (\n TileSelectionResult.originalResult(startTile._lastSelectionResult) ===\n TileSelectionResult.CULLED\n ) {\n return;\n }\n\n // This tile was refined, so find rendered children, if any.\n // Visit the tiles in counter-clockwise order.\n switch (tileEdge) {\n case TileEdge.WEST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.EAST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.SOUTH:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.NORTH:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.NORTHWEST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.NORTHEAST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.northeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.SOUTHWEST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southwestChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n case TileEdge.SOUTHEAST:\n visitRenderedTiles(\n tileProvider,\n frameState,\n sourceTile,\n startTile.southeastChild,\n currentFrameNumber,\n tileEdge,\n true,\n traversalQueue,\n vertexArraysToDestroy\n );\n break;\n default:\n throw new DeveloperError(\"Invalid edge\");\n }\n}\n\nfunction visitTile(\n tileProvider,\n frameState,\n sourceTile,\n destinationTile,\n tileEdge,\n frameNumber,\n traversalQueue,\n vertexArraysToDestroy\n) {\n const destinationSurfaceTile = destinationTile.data;\n\n if (destinationSurfaceTile.fill === undefined) {\n destinationSurfaceTile.fill = new TerrainFillMesh(destinationTile);\n } else if (destinationSurfaceTile.fill.visitedFrame === frameNumber) {\n // Don't propagate edges to tiles that have already been visited this frame.\n return;\n }\n\n if (destinationSurfaceTile.fill.enqueuedFrame !== frameNumber) {\n // First time visiting this tile this frame, add it to the traversal queue.\n destinationSurfaceTile.fill.enqueuedFrame = frameNumber;\n destinationSurfaceTile.fill.changedThisFrame = false;\n traversalQueue.enqueue(destinationTile);\n }\n\n propagateEdge(\n tileProvider,\n frameState,\n sourceTile,\n destinationTile,\n tileEdge,\n vertexArraysToDestroy\n );\n}\n\nfunction propagateEdge(\n tileProvider,\n frameState,\n sourceTile,\n destinationTile,\n tileEdge,\n vertexArraysToDestroy\n) {\n const destinationFill = destinationTile.data.fill;\n\n let sourceMesh;\n const sourceFill = sourceTile.data.fill;\n if (defined(sourceFill)) {\n sourceFill.visitedFrame = frameState.frameNumber;\n\n // Source is a fill, create/update it if necessary.\n if (sourceFill.changedThisFrame) {\n createFillMesh(\n tileProvider,\n frameState,\n sourceTile,\n vertexArraysToDestroy\n );\n sourceFill.changedThisFrame = false;\n }\n sourceMesh = sourceTile.data.fill.mesh;\n } else {\n sourceMesh = sourceTile.data.mesh;\n }\n\n let edgeMeshes;\n let edgeTiles;\n\n switch (tileEdge) {\n case TileEdge.WEST:\n edgeMeshes = destinationFill.westMeshes;\n edgeTiles = destinationFill.westTiles;\n break;\n case TileEdge.SOUTH:\n edgeMeshes = destinationFill.southMeshes;\n edgeTiles = destinationFill.southTiles;\n break;\n case TileEdge.EAST:\n edgeMeshes = destinationFill.eastMeshes;\n edgeTiles = destinationFill.eastTiles;\n break;\n case TileEdge.NORTH:\n edgeMeshes = destinationFill.northMeshes;\n edgeTiles = destinationFill.northTiles;\n break;\n // Corners are simpler.\n case TileEdge.NORTHWEST:\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame ||\n destinationFill.northwestMesh !== sourceMesh;\n destinationFill.northwestMesh = sourceMesh;\n destinationFill.northwestTile = sourceTile;\n return;\n case TileEdge.NORTHEAST:\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame ||\n destinationFill.northeastMesh !== sourceMesh;\n destinationFill.northeastMesh = sourceMesh;\n destinationFill.northeastTile = sourceTile;\n return;\n case TileEdge.SOUTHWEST:\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame ||\n destinationFill.southwestMesh !== sourceMesh;\n destinationFill.southwestMesh = sourceMesh;\n destinationFill.southwestTile = sourceTile;\n return;\n case TileEdge.SOUTHEAST:\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame ||\n destinationFill.southeastMesh !== sourceMesh;\n destinationFill.southeastMesh = sourceMesh;\n destinationFill.southeastTile = sourceTile;\n return;\n }\n\n if (sourceTile.level <= destinationTile.level) {\n // Source edge completely spans the destination edge.\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame ||\n edgeMeshes[0] !== sourceMesh ||\n edgeMeshes.length !== 1;\n edgeMeshes[0] = sourceMesh;\n edgeTiles[0] = sourceTile;\n edgeMeshes.length = 1;\n edgeTiles.length = 1;\n return;\n }\n\n // Source edge is a subset of the destination edge.\n // Figure out the range of meshes we're replacing.\n let startIndex, endIndex, existingTile, existingRectangle;\n const sourceRectangle = sourceTile.rectangle;\n\n let epsilon;\n const destinationRectangle = destinationTile.rectangle;\n\n switch (tileEdge) {\n case TileEdge.WEST:\n epsilon =\n (destinationRectangle.north - destinationRectangle.south) *\n CesiumMath.EPSILON5;\n\n for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n existingTile = edgeTiles[startIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.greaterThan(\n sourceRectangle.north,\n existingRectangle.south,\n epsilon\n )\n ) {\n break;\n }\n }\n for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n existingTile = edgeTiles[endIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.greaterThanOrEquals(\n sourceRectangle.south,\n existingRectangle.north,\n epsilon\n )\n ) {\n break;\n }\n }\n break;\n case TileEdge.SOUTH:\n epsilon =\n (destinationRectangle.east - destinationRectangle.west) *\n CesiumMath.EPSILON5;\n\n for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n existingTile = edgeTiles[startIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.lessThan(\n sourceRectangle.west,\n existingRectangle.east,\n epsilon\n )\n ) {\n break;\n }\n }\n for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n existingTile = edgeTiles[endIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.lessThanOrEquals(\n sourceRectangle.east,\n existingRectangle.west,\n epsilon\n )\n ) {\n break;\n }\n }\n break;\n case TileEdge.EAST:\n epsilon =\n (destinationRectangle.north - destinationRectangle.south) *\n CesiumMath.EPSILON5;\n\n for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n existingTile = edgeTiles[startIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.lessThan(\n sourceRectangle.south,\n existingRectangle.north,\n epsilon\n )\n ) {\n break;\n }\n }\n for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n existingTile = edgeTiles[endIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.lessThanOrEquals(\n sourceRectangle.north,\n existingRectangle.south,\n epsilon\n )\n ) {\n break;\n }\n }\n break;\n case TileEdge.NORTH:\n epsilon =\n (destinationRectangle.east - destinationRectangle.west) *\n CesiumMath.EPSILON5;\n\n for (startIndex = 0; startIndex < edgeTiles.length; ++startIndex) {\n existingTile = edgeTiles[startIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.greaterThan(\n sourceRectangle.east,\n existingRectangle.west,\n epsilon\n )\n ) {\n break;\n }\n }\n for (endIndex = startIndex; endIndex < edgeTiles.length; ++endIndex) {\n existingTile = edgeTiles[endIndex];\n existingRectangle = existingTile.rectangle;\n if (\n CesiumMath.greaterThanOrEquals(\n sourceRectangle.west,\n existingRectangle.east,\n epsilon\n )\n ) {\n break;\n }\n }\n break;\n }\n\n if (endIndex - startIndex === 1) {\n destinationFill.changedThisFrame =\n destinationFill.changedThisFrame || edgeMeshes[startIndex] !== sourceMesh;\n edgeMeshes[startIndex] = sourceMesh;\n edgeTiles[startIndex] = sourceTile;\n } else {\n destinationFill.changedThisFrame = true;\n edgeMeshes.splice(startIndex, endIndex - startIndex, sourceMesh);\n edgeTiles.splice(startIndex, endIndex - startIndex, sourceTile);\n }\n}\n\nconst cartographicScratch = new Cartographic();\nconst centerCartographicScratch = new Cartographic();\nconst cartesianScratch = new Cartesian3();\nconst normalScratch = new Cartesian3();\nconst octEncodedNormalScratch = new Cartesian2();\nconst uvScratch2 = new Cartesian2();\nconst uvScratch = new Cartesian2();\n\nfunction HeightAndNormal() {\n this.height = 0.0;\n this.encodedNormal = new Cartesian2();\n}\n\nfunction fillMissingCorner(\n fill,\n ellipsoid,\n u,\n v,\n corner,\n adjacentCorner1,\n adjacentCorner2,\n oppositeCorner,\n vertex\n) {\n if (defined(corner)) {\n return corner;\n }\n\n let height;\n\n if (defined(adjacentCorner1) && defined(adjacentCorner2)) {\n height = (adjacentCorner1.height + adjacentCorner2.height) * 0.5;\n } else if (defined(adjacentCorner1)) {\n height = adjacentCorner1.height;\n } else if (defined(adjacentCorner2)) {\n height = adjacentCorner2.height;\n } else if (defined(oppositeCorner)) {\n height = oppositeCorner.height;\n } else {\n const surfaceTile = fill.tile.data;\n const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n let minimumHeight = 0.0;\n let maximumHeight = 0.0;\n if (defined(tileBoundingRegion)) {\n minimumHeight = tileBoundingRegion.minimumHeight;\n maximumHeight = tileBoundingRegion.maximumHeight;\n }\n height = (minimumHeight + maximumHeight) * 0.5;\n }\n\n getVertexWithHeightAtCorner(fill, ellipsoid, u, v, height, vertex);\n return vertex;\n}\n\nconst heightRangeScratch = {\n minimumHeight: 0.0,\n maximumHeight: 0.0,\n};\n\nconst scratchCenter = new Cartesian3();\nconst swVertexScratch = new HeightAndNormal();\nconst seVertexScratch = new HeightAndNormal();\nconst nwVertexScratch = new HeightAndNormal();\nconst neVertexScratch = new HeightAndNormal();\nconst heightmapBuffer =\n typeof Uint8Array !== \"undefined\" ? new Uint8Array(9 * 9) : undefined;\n\nconst scratchCreateMeshSyncOptions = {\n tilingScheme: undefined,\n x: 0,\n y: 0,\n level: 0,\n exaggeration: 1.0,\n exaggerationRelativeHeight: 0.0,\n};\nfunction createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {\n GlobeSurfaceTile.initialize(\n tile,\n tileProvider.terrainProvider,\n tileProvider._imageryLayers\n );\n\n const surfaceTile = tile.data;\n const fill = surfaceTile.fill;\n const rectangle = tile.rectangle;\n\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n const hasExaggeration = exaggeration !== 1.0;\n\n const ellipsoid = tile.tilingScheme.ellipsoid;\n\n let nwCorner = getCorner(\n fill,\n ellipsoid,\n 0.0,\n 1.0,\n fill.northwestTile,\n fill.northwestMesh,\n fill.northTiles,\n fill.northMeshes,\n fill.westTiles,\n fill.westMeshes,\n nwVertexScratch\n );\n let swCorner = getCorner(\n fill,\n ellipsoid,\n 0.0,\n 0.0,\n fill.southwestTile,\n fill.southwestMesh,\n fill.westTiles,\n fill.westMeshes,\n fill.southTiles,\n fill.southMeshes,\n swVertexScratch\n );\n let seCorner = getCorner(\n fill,\n ellipsoid,\n 1.0,\n 0.0,\n fill.southeastTile,\n fill.southeastMesh,\n fill.southTiles,\n fill.southMeshes,\n fill.eastTiles,\n fill.eastMeshes,\n seVertexScratch\n );\n let neCorner = getCorner(\n fill,\n ellipsoid,\n 1.0,\n 1.0,\n fill.northeastTile,\n fill.northeastMesh,\n fill.eastTiles,\n fill.eastMeshes,\n fill.northTiles,\n fill.northMeshes,\n neVertexScratch\n );\n\n nwCorner = fillMissingCorner(\n fill,\n ellipsoid,\n 0.0,\n 1.0,\n nwCorner,\n swCorner,\n neCorner,\n seCorner,\n nwVertexScratch\n );\n swCorner = fillMissingCorner(\n fill,\n ellipsoid,\n 0.0,\n 0.0,\n swCorner,\n nwCorner,\n seCorner,\n neCorner,\n swVertexScratch\n );\n seCorner = fillMissingCorner(\n fill,\n ellipsoid,\n 1.0,\n 1.0,\n seCorner,\n swCorner,\n neCorner,\n nwCorner,\n seVertexScratch\n );\n neCorner = fillMissingCorner(\n fill,\n ellipsoid,\n 1.0,\n 1.0,\n neCorner,\n seCorner,\n nwCorner,\n swCorner,\n neVertexScratch\n );\n\n const southwestHeight = swCorner.height;\n const southeastHeight = seCorner.height;\n const northwestHeight = nwCorner.height;\n const northeastHeight = neCorner.height;\n\n let minimumHeight = Math.min(\n southwestHeight,\n southeastHeight,\n northwestHeight,\n northeastHeight\n );\n let maximumHeight = Math.max(\n southwestHeight,\n southeastHeight,\n northwestHeight,\n northeastHeight\n );\n\n const middleHeight = (minimumHeight + maximumHeight) * 0.5;\n\n let i;\n let len;\n\n // For low-detail tiles, our usual fill tile approach will create tiles that\n // look really blocky because they don't have enough vertices to account for the\n // Earth's curvature. But the height range will also typically be well within\n // the allowed geometric error for those levels. So fill such tiles with a\n // constant-height heightmap.\n const geometricError = tileProvider.getLevelMaximumGeometricError(tile.level);\n const minCutThroughRadius = ellipsoid.maximumRadius - geometricError;\n let maxTileWidth =\n Math.acos(minCutThroughRadius / ellipsoid.maximumRadius) * 4.0;\n\n // When the tile width is greater than maxTileWidth as computed above, the error\n // of a normal fill tile from globe curvature alone will exceed the allowed geometric\n // error. Terrain won't change that much. However, we can allow more error than that.\n // A little blockiness during load is acceptable. For the WGS84 ellipsoid and\n // standard geometric error setup, the value here will have us use a heightmap\n // at levels 1, 2, and 3.\n maxTileWidth *= 1.5;\n\n if (\n rectangle.width > maxTileWidth &&\n maximumHeight - minimumHeight <= geometricError\n ) {\n const terrainData = new HeightmapTerrainData({\n width: 9,\n height: 9,\n buffer: heightmapBuffer,\n structure: {\n // Use the maximum as the constant height so that this tile's skirt\n // covers any cracks with adjacent tiles.\n heightOffset: maximumHeight,\n },\n });\n\n const createMeshSyncOptions = scratchCreateMeshSyncOptions;\n createMeshSyncOptions.tilingScheme = tile.tilingScheme;\n createMeshSyncOptions.x = tile.x;\n createMeshSyncOptions.y = tile.y;\n createMeshSyncOptions.level = tile.level;\n createMeshSyncOptions.exaggeration = exaggeration;\n createMeshSyncOptions.exaggerationRelativeHeight = exaggerationRelativeHeight;\n\n fill.mesh = terrainData._createMeshSync(createMeshSyncOptions);\n } else {\n const hasGeodeticSurfaceNormals = hasExaggeration;\n const centerCartographic = Rectangle.center(\n rectangle,\n centerCartographicScratch\n );\n centerCartographic.height = middleHeight;\n const center = ellipsoid.cartographicToCartesian(\n centerCartographic,\n scratchCenter\n );\n const encoding = new TerrainEncoding(\n center,\n undefined,\n undefined,\n undefined,\n undefined,\n true,\n true,\n hasGeodeticSurfaceNormals,\n exaggeration,\n exaggerationRelativeHeight\n );\n\n // At _most_, we have vertices for the 4 corners, plus 1 center, plus every adjacent edge vertex.\n // In reality there will be less most of the time, but close enough; better\n // to overestimate than to re-allocate/copy/traverse the vertices twice.\n // Also, we'll often be able to squeeze the index data into the extra space in the buffer.\n let maxVertexCount = 5;\n let meshes;\n\n meshes = fill.westMeshes;\n for (i = 0, len = meshes.length; i < len; ++i) {\n maxVertexCount += meshes[i].eastIndicesNorthToSouth.length;\n }\n\n meshes = fill.southMeshes;\n for (i = 0, len = meshes.length; i < len; ++i) {\n maxVertexCount += meshes[i].northIndicesWestToEast.length;\n }\n\n meshes = fill.eastMeshes;\n for (i = 0, len = meshes.length; i < len; ++i) {\n maxVertexCount += meshes[i].westIndicesSouthToNorth.length;\n }\n\n meshes = fill.northMeshes;\n for (i = 0, len = meshes.length; i < len; ++i) {\n maxVertexCount += meshes[i].southIndicesEastToWest.length;\n }\n\n const heightRange = heightRangeScratch;\n heightRange.minimumHeight = minimumHeight;\n heightRange.maximumHeight = maximumHeight;\n\n const stride = encoding.stride;\n let typedArray = new Float32Array(maxVertexCount * stride);\n\n let nextIndex = 0;\n const northwestIndex = nextIndex;\n nextIndex = addVertexWithComputedPosition(\n ellipsoid,\n rectangle,\n encoding,\n typedArray,\n nextIndex,\n 0.0,\n 1.0,\n nwCorner.height,\n nwCorner.encodedNormal,\n 1.0,\n heightRange\n );\n nextIndex = addEdge(\n fill,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n fill.westTiles,\n fill.westMeshes,\n TileEdge.EAST,\n heightRange\n );\n const southwestIndex = nextIndex;\n nextIndex = addVertexWithComputedPosition(\n ellipsoid,\n rectangle,\n encoding,\n typedArray,\n nextIndex,\n 0.0,\n 0.0,\n swCorner.height,\n swCorner.encodedNormal,\n 0.0,\n heightRange\n );\n nextIndex = addEdge(\n fill,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n fill.southTiles,\n fill.southMeshes,\n TileEdge.NORTH,\n heightRange\n );\n const southeastIndex = nextIndex;\n nextIndex = addVertexWithComputedPosition(\n ellipsoid,\n rectangle,\n encoding,\n typedArray,\n nextIndex,\n 1.0,\n 0.0,\n seCorner.height,\n seCorner.encodedNormal,\n 0.0,\n heightRange\n );\n nextIndex = addEdge(\n fill,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n fill.eastTiles,\n fill.eastMeshes,\n TileEdge.WEST,\n heightRange\n );\n const northeastIndex = nextIndex;\n nextIndex = addVertexWithComputedPosition(\n ellipsoid,\n rectangle,\n encoding,\n typedArray,\n nextIndex,\n 1.0,\n 1.0,\n neCorner.height,\n neCorner.encodedNormal,\n 1.0,\n heightRange\n );\n nextIndex = addEdge(\n fill,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n fill.northTiles,\n fill.northMeshes,\n TileEdge.SOUTH,\n heightRange\n );\n\n minimumHeight = heightRange.minimumHeight;\n maximumHeight = heightRange.maximumHeight;\n\n const obb = OrientedBoundingBox.fromRectangle(\n rectangle,\n minimumHeight,\n maximumHeight,\n tile.tilingScheme.ellipsoid\n );\n\n // Add a single vertex at the center of the tile.\n const southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n rectangle.south\n );\n const oneOverMercatorHeight =\n 1.0 /\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(rectangle.north) -\n southMercatorY);\n const centerWebMercatorT =\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n centerCartographic.latitude\n ) -\n southMercatorY) *\n oneOverMercatorHeight;\n\n const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n cartographicScratch,\n normalScratch\n );\n const centerEncodedNormal = AttributeCompression.octEncode(\n geodeticSurfaceNormal,\n octEncodedNormalScratch\n );\n\n const centerIndex = nextIndex;\n encoding.encode(\n typedArray,\n nextIndex * stride,\n obb.center,\n Cartesian2.fromElements(0.5, 0.5, uvScratch),\n middleHeight,\n centerEncodedNormal,\n centerWebMercatorT,\n geodeticSurfaceNormal\n );\n ++nextIndex;\n\n const vertexCount = nextIndex;\n\n const bytesPerIndex = vertexCount < 256 ? 1 : 2;\n const indexCount = (vertexCount - 1) * 3; // one triangle per edge vertex\n const indexDataBytes = indexCount * bytesPerIndex;\n const availableBytesInBuffer =\n (typedArray.length - vertexCount * stride) *\n Float32Array.BYTES_PER_ELEMENT;\n\n let indices;\n if (availableBytesInBuffer >= indexDataBytes) {\n // Store the index data in the same buffer as the vertex data.\n const startIndex = vertexCount * stride * Float32Array.BYTES_PER_ELEMENT;\n indices =\n vertexCount < 256\n ? new Uint8Array(typedArray.buffer, startIndex, indexCount)\n : new Uint16Array(typedArray.buffer, startIndex, indexCount);\n } else {\n // Allocate a new buffer for the index data.\n indices =\n vertexCount < 256\n ? new Uint8Array(indexCount)\n : new Uint16Array(indexCount);\n }\n\n typedArray = new Float32Array(typedArray.buffer, 0, vertexCount * stride);\n\n let indexOut = 0;\n for (i = 0; i < vertexCount - 2; ++i) {\n indices[indexOut++] = centerIndex;\n indices[indexOut++] = i;\n indices[indexOut++] = i + 1;\n }\n\n indices[indexOut++] = centerIndex;\n indices[indexOut++] = i;\n indices[indexOut++] = 0;\n\n const westIndicesSouthToNorth = [];\n for (i = southwestIndex; i >= northwestIndex; --i) {\n westIndicesSouthToNorth.push(i);\n }\n\n const southIndicesEastToWest = [];\n for (i = southeastIndex; i >= southwestIndex; --i) {\n southIndicesEastToWest.push(i);\n }\n\n const eastIndicesNorthToSouth = [];\n for (i = northeastIndex; i >= southeastIndex; --i) {\n eastIndicesNorthToSouth.push(i);\n }\n\n const northIndicesWestToEast = [];\n northIndicesWestToEast.push(0);\n for (i = centerIndex - 1; i >= northeastIndex; --i) {\n northIndicesWestToEast.push(i);\n }\n\n fill.mesh = new TerrainMesh(\n encoding.center,\n typedArray,\n indices,\n indexCount,\n vertexCount,\n minimumHeight,\n maximumHeight,\n BoundingSphere.fromOrientedBoundingBox(obb),\n computeOccludeePoint(\n tileProvider,\n obb.center,\n rectangle,\n minimumHeight,\n maximumHeight\n ),\n encoding.stride,\n obb,\n encoding,\n westIndicesSouthToNorth,\n southIndicesEastToWest,\n eastIndicesNorthToSouth,\n northIndicesWestToEast\n );\n }\n\n const context = frameState.context;\n\n fill._destroyVertexArray(vertexArraysToDestroy);\n\n fill.vertexArray = GlobeSurfaceTile._createVertexArrayForMesh(\n context,\n fill.mesh\n );\n surfaceTile.processImagery(\n tile,\n tileProvider.terrainProvider,\n frameState,\n true\n );\n\n const oldTexture = fill.waterMaskTexture;\n fill.waterMaskTexture = undefined;\n\n if (tileProvider.terrainProvider.hasWaterMask) {\n const waterSourceTile = surfaceTile._findAncestorTileWithTerrainData(tile);\n if (\n defined(waterSourceTile) &&\n defined(waterSourceTile.data.waterMaskTexture)\n ) {\n fill.waterMaskTexture = waterSourceTile.data.waterMaskTexture;\n ++fill.waterMaskTexture.referenceCount;\n surfaceTile._computeWaterMaskTranslationAndScale(\n tile,\n waterSourceTile,\n fill.waterMaskTranslationAndScale\n );\n }\n }\n\n if (defined(oldTexture)) {\n --oldTexture.referenceCount;\n if (oldTexture.referenceCount === 0) {\n oldTexture.destroy();\n }\n }\n}\n\nfunction addVertexWithComputedPosition(\n ellipsoid,\n rectangle,\n encoding,\n buffer,\n index,\n u,\n v,\n height,\n encodedNormal,\n webMercatorT,\n heightRange\n) {\n const cartographic = cartographicScratch;\n cartographic.longitude = CesiumMath.lerp(rectangle.west, rectangle.east, u);\n cartographic.latitude = CesiumMath.lerp(rectangle.south, rectangle.north, v);\n cartographic.height = height;\n const position = ellipsoid.cartographicToCartesian(\n cartographic,\n cartesianScratch\n );\n\n let geodeticSurfaceNormal;\n if (encoding.hasGeodeticSurfaceNormals) {\n geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n position,\n normalScratch\n );\n }\n\n const uv = uvScratch2;\n uv.x = u;\n uv.y = v;\n\n encoding.encode(\n buffer,\n index * encoding.stride,\n position,\n uv,\n height,\n encodedNormal,\n webMercatorT,\n geodeticSurfaceNormal\n );\n\n heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height);\n heightRange.maximumHeight = Math.max(heightRange.maximumHeight, height);\n\n return index + 1;\n}\n\nconst sourceRectangleScratch = new Rectangle();\n\nfunction transformTextureCoordinates(\n sourceTile,\n targetTile,\n coordinates,\n result\n) {\n let sourceRectangle = sourceTile.rectangle;\n const targetRectangle = targetTile.rectangle;\n\n // Handle transforming across the anti-meridian.\n if (\n targetTile.x === 0 &&\n coordinates.x === 1.0 &&\n sourceTile.x ===\n sourceTile.tilingScheme.getNumberOfXTilesAtLevel(sourceTile.level) - 1\n ) {\n sourceRectangle = Rectangle.clone(\n sourceTile.rectangle,\n sourceRectangleScratch\n );\n sourceRectangle.west -= CesiumMath.TWO_PI;\n sourceRectangle.east -= CesiumMath.TWO_PI;\n } else if (\n sourceTile.x === 0 &&\n coordinates.x === 0.0 &&\n targetTile.x ===\n targetTile.tilingScheme.getNumberOfXTilesAtLevel(targetTile.level) - 1\n ) {\n sourceRectangle = Rectangle.clone(\n sourceTile.rectangle,\n sourceRectangleScratch\n );\n sourceRectangle.west += CesiumMath.TWO_PI;\n sourceRectangle.east += CesiumMath.TWO_PI;\n }\n\n const sourceWidth = sourceRectangle.east - sourceRectangle.west;\n const umin = (targetRectangle.west - sourceRectangle.west) / sourceWidth;\n const umax = (targetRectangle.east - sourceRectangle.west) / sourceWidth;\n\n const sourceHeight = sourceRectangle.north - sourceRectangle.south;\n const vmin = (targetRectangle.south - sourceRectangle.south) / sourceHeight;\n const vmax = (targetRectangle.north - sourceRectangle.south) / sourceHeight;\n\n let u = (coordinates.x - umin) / (umax - umin);\n let v = (coordinates.y - vmin) / (vmax - vmin);\n\n // Ensure that coordinates very near the corners are at the corners.\n if (Math.abs(u) < Math.EPSILON5) {\n u = 0.0;\n } else if (Math.abs(u - 1.0) < Math.EPSILON5) {\n u = 1.0;\n }\n\n if (Math.abs(v) < Math.EPSILON5) {\n v = 0.0;\n } else if (Math.abs(v - 1.0) < Math.EPSILON5) {\n v = 1.0;\n }\n\n result.x = u;\n result.y = v;\n return result;\n}\n\nconst encodedNormalScratch = new Cartesian2();\n\nfunction getVertexFromTileAtCorner(sourceMesh, sourceIndex, u, v, vertex) {\n const sourceEncoding = sourceMesh.encoding;\n const sourceVertices = sourceMesh.vertices;\n\n vertex.height = sourceEncoding.decodeHeight(sourceVertices, sourceIndex);\n\n if (sourceEncoding.hasVertexNormals) {\n sourceEncoding.getOctEncodedNormal(\n sourceVertices,\n sourceIndex,\n vertex.encodedNormal\n );\n } else {\n const normal = vertex.encodedNormal;\n normal.x = 0.0;\n normal.y = 0.0;\n }\n}\n\nconst encodedNormalScratch2 = new Cartesian2();\nconst cartesianScratch2 = new Cartesian3();\n\nfunction getInterpolatedVertexAtCorner(\n ellipsoid,\n sourceTile,\n targetTile,\n sourceMesh,\n previousIndex,\n nextIndex,\n u,\n v,\n interpolateU,\n vertex\n) {\n const sourceEncoding = sourceMesh.encoding;\n const sourceVertices = sourceMesh.vertices;\n\n const previousUv = transformTextureCoordinates(\n sourceTile,\n targetTile,\n sourceEncoding.decodeTextureCoordinates(\n sourceVertices,\n previousIndex,\n uvScratch\n ),\n uvScratch\n );\n const nextUv = transformTextureCoordinates(\n sourceTile,\n targetTile,\n sourceEncoding.decodeTextureCoordinates(\n sourceVertices,\n nextIndex,\n uvScratch2\n ),\n uvScratch2\n );\n\n let ratio;\n if (interpolateU) {\n ratio = (u - previousUv.x) / (nextUv.x - previousUv.x);\n } else {\n ratio = (v - previousUv.y) / (nextUv.y - previousUv.y);\n }\n\n const height1 = sourceEncoding.decodeHeight(sourceVertices, previousIndex);\n const height2 = sourceEncoding.decodeHeight(sourceVertices, nextIndex);\n\n const targetRectangle = targetTile.rectangle;\n cartographicScratch.longitude = CesiumMath.lerp(\n targetRectangle.west,\n targetRectangle.east,\n u\n );\n cartographicScratch.latitude = CesiumMath.lerp(\n targetRectangle.south,\n targetRectangle.north,\n v\n );\n vertex.height = cartographicScratch.height = CesiumMath.lerp(\n height1,\n height2,\n ratio\n );\n\n let normal;\n if (sourceEncoding.hasVertexNormals) {\n const encodedNormal1 = sourceEncoding.getOctEncodedNormal(\n sourceVertices,\n previousIndex,\n encodedNormalScratch\n );\n const encodedNormal2 = sourceEncoding.getOctEncodedNormal(\n sourceVertices,\n nextIndex,\n encodedNormalScratch2\n );\n const normal1 = AttributeCompression.octDecode(\n encodedNormal1.x,\n encodedNormal1.y,\n cartesianScratch\n );\n const normal2 = AttributeCompression.octDecode(\n encodedNormal2.x,\n encodedNormal2.y,\n cartesianScratch2\n );\n normal = Cartesian3.lerp(normal1, normal2, ratio, cartesianScratch);\n Cartesian3.normalize(normal, normal);\n AttributeCompression.octEncode(normal, vertex.encodedNormal);\n } else {\n normal = ellipsoid.geodeticSurfaceNormalCartographic(\n cartographicScratch,\n cartesianScratch\n );\n AttributeCompression.octEncode(normal, vertex.encodedNormal);\n }\n}\n\nfunction getVertexWithHeightAtCorner(\n terrainFillMesh,\n ellipsoid,\n u,\n v,\n height,\n vertex\n) {\n vertex.height = height;\n const normal = ellipsoid.geodeticSurfaceNormalCartographic(\n cartographicScratch,\n cartesianScratch\n );\n AttributeCompression.octEncode(normal, vertex.encodedNormal);\n}\n\nfunction getCorner(\n terrainFillMesh,\n ellipsoid,\n u,\n v,\n cornerTile,\n cornerMesh,\n previousEdgeTiles,\n previousEdgeMeshes,\n nextEdgeTiles,\n nextEdgeMeshes,\n vertex\n) {\n const gotCorner =\n getCornerFromEdge(\n terrainFillMesh,\n ellipsoid,\n previousEdgeMeshes,\n previousEdgeTiles,\n false,\n u,\n v,\n vertex\n ) ||\n getCornerFromEdge(\n terrainFillMesh,\n ellipsoid,\n nextEdgeMeshes,\n nextEdgeTiles,\n true,\n u,\n v,\n vertex\n );\n if (gotCorner) {\n return vertex;\n }\n\n let vertexIndex;\n\n if (meshIsUsable(cornerTile, cornerMesh)) {\n // Corner mesh is valid, copy its corner vertex to this mesh.\n if (u === 0.0) {\n if (v === 0.0) {\n // southwest destination, northeast source\n vertexIndex = cornerMesh.eastIndicesNorthToSouth[0];\n } else {\n // northwest destination, southeast source\n vertexIndex = cornerMesh.southIndicesEastToWest[0];\n }\n } else if (v === 0.0) {\n // southeast destination, northwest source\n vertexIndex = cornerMesh.northIndicesWestToEast[0];\n } else {\n // northeast destination, southwest source\n vertexIndex = cornerMesh.westIndicesSouthToNorth[0];\n }\n getVertexFromTileAtCorner(cornerMesh, vertexIndex, u, v, vertex);\n return vertex;\n }\n\n // There is no precise vertex available from the corner or from either adjacent edge.\n // This is either because there are no tiles at all at the edges and corner, or\n // because the tiles at the edge are higher-level-number and don't extend all the way\n // to the corner.\n // Try to grab a height from the adjacent edges.\n let height;\n if (u === 0.0) {\n if (v === 0.0) {\n // southwest\n height = getClosestHeightToCorner(\n terrainFillMesh.westMeshes,\n terrainFillMesh.westTiles,\n TileEdge.EAST,\n terrainFillMesh.southMeshes,\n terrainFillMesh.southTiles,\n TileEdge.NORTH,\n u,\n v\n );\n } else {\n // northwest\n height = getClosestHeightToCorner(\n terrainFillMesh.northMeshes,\n terrainFillMesh.northTiles,\n TileEdge.SOUTH,\n terrainFillMesh.westMeshes,\n terrainFillMesh.westTiles,\n TileEdge.EAST,\n u,\n v\n );\n }\n } else if (v === 0.0) {\n // southeast\n height = getClosestHeightToCorner(\n terrainFillMesh.southMeshes,\n terrainFillMesh.southTiles,\n TileEdge.NORTH,\n terrainFillMesh.eastMeshes,\n terrainFillMesh.eastTiles,\n TileEdge.WEST,\n u,\n v\n );\n } else {\n // northeast\n height = getClosestHeightToCorner(\n terrainFillMesh.eastMeshes,\n terrainFillMesh.eastTiles,\n TileEdge.WEST,\n terrainFillMesh.northMeshes,\n terrainFillMesh.northTiles,\n TileEdge.SOUTH,\n u,\n v\n );\n }\n\n if (defined(height)) {\n getVertexWithHeightAtCorner(\n terrainFillMesh,\n ellipsoid,\n u,\n v,\n height,\n vertex\n );\n return vertex;\n }\n\n // No heights available that are closer than the adjacent corners.\n return undefined;\n}\n\nfunction getClosestHeightToCorner(\n previousMeshes,\n previousTiles,\n previousEdge,\n nextMeshes,\n nextTiles,\n nextEdge,\n u,\n v\n) {\n const height1 = getNearestHeightOnEdge(\n previousMeshes,\n previousTiles,\n false,\n previousEdge,\n u,\n v\n );\n const height2 = getNearestHeightOnEdge(\n nextMeshes,\n nextTiles,\n true,\n nextEdge,\n u,\n v\n );\n if (defined(height1) && defined(height2)) {\n // It would be slightly better to do a weighted average of the two heights\n // based on their distance from the corner, but it shouldn't matter much in practice.\n return (height1 + height2) * 0.5;\n } else if (defined(height1)) {\n return height1;\n }\n return height2;\n}\n\nfunction addEdge(\n terrainFillMesh,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n edgeTiles,\n edgeMeshes,\n tileEdge,\n heightRange\n) {\n for (let i = 0; i < edgeTiles.length; ++i) {\n nextIndex = addEdgeMesh(\n terrainFillMesh,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n edgeTiles[i],\n edgeMeshes[i],\n tileEdge,\n heightRange\n );\n }\n return nextIndex;\n}\n\nfunction addEdgeMesh(\n terrainFillMesh,\n ellipsoid,\n encoding,\n typedArray,\n nextIndex,\n edgeTile,\n edgeMesh,\n tileEdge,\n heightRange\n) {\n // Handle copying edges across the anti-meridian.\n let sourceRectangle = edgeTile.rectangle;\n if (tileEdge === TileEdge.EAST && terrainFillMesh.tile.x === 0) {\n sourceRectangle = Rectangle.clone(\n edgeTile.rectangle,\n sourceRectangleScratch\n );\n sourceRectangle.west -= CesiumMath.TWO_PI;\n sourceRectangle.east -= CesiumMath.TWO_PI;\n } else if (tileEdge === TileEdge.WEST && edgeTile.x === 0) {\n sourceRectangle = Rectangle.clone(\n edgeTile.rectangle,\n sourceRectangleScratch\n );\n sourceRectangle.west += CesiumMath.TWO_PI;\n sourceRectangle.east += CesiumMath.TWO_PI;\n }\n\n const targetRectangle = terrainFillMesh.tile.rectangle;\n\n let lastU;\n let lastV;\n\n if (nextIndex > 0) {\n encoding.decodeTextureCoordinates(typedArray, nextIndex - 1, uvScratch);\n lastU = uvScratch.x;\n lastV = uvScratch.y;\n }\n\n let indices;\n let compareU;\n\n switch (tileEdge) {\n case TileEdge.WEST:\n indices = edgeMesh.westIndicesSouthToNorth;\n compareU = false;\n break;\n case TileEdge.NORTH:\n indices = edgeMesh.northIndicesWestToEast;\n compareU = true;\n break;\n case TileEdge.EAST:\n indices = edgeMesh.eastIndicesNorthToSouth;\n compareU = false;\n break;\n case TileEdge.SOUTH:\n indices = edgeMesh.southIndicesEastToWest;\n compareU = true;\n break;\n }\n\n const sourceTile = edgeTile;\n const targetTile = terrainFillMesh.tile;\n const sourceEncoding = edgeMesh.encoding;\n const sourceVertices = edgeMesh.vertices;\n const targetStride = encoding.stride;\n\n let southMercatorY;\n let oneOverMercatorHeight;\n if (sourceEncoding.hasWebMercatorT) {\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n targetRectangle.south\n );\n oneOverMercatorHeight =\n 1.0 /\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n targetRectangle.north\n ) -\n southMercatorY);\n }\n\n for (let i = 0; i < indices.length; ++i) {\n const index = indices[i];\n\n const uv = sourceEncoding.decodeTextureCoordinates(\n sourceVertices,\n index,\n uvScratch\n );\n transformTextureCoordinates(sourceTile, targetTile, uv, uv);\n const u = uv.x;\n const v = uv.y;\n const uOrV = compareU ? u : v;\n\n if (uOrV < 0.0 || uOrV > 1.0) {\n // Vertex is outside the target tile - skip it.\n continue;\n }\n\n if (\n Math.abs(u - lastU) < CesiumMath.EPSILON5 &&\n Math.abs(v - lastV) < CesiumMath.EPSILON5\n ) {\n // Vertex is very close to the previous one - skip it.\n continue;\n }\n\n const nearlyEdgeU =\n Math.abs(u) < CesiumMath.EPSILON5 ||\n Math.abs(u - 1.0) < CesiumMath.EPSILON5;\n const nearlyEdgeV =\n Math.abs(v) < CesiumMath.EPSILON5 ||\n Math.abs(v - 1.0) < CesiumMath.EPSILON5;\n\n if (nearlyEdgeU && nearlyEdgeV) {\n // Corner vertex - skip it.\n continue;\n }\n\n const position = sourceEncoding.decodePosition(\n sourceVertices,\n index,\n cartesianScratch\n );\n const height = sourceEncoding.decodeHeight(sourceVertices, index);\n\n let normal;\n if (sourceEncoding.hasVertexNormals) {\n normal = sourceEncoding.getOctEncodedNormal(\n sourceVertices,\n index,\n octEncodedNormalScratch\n );\n } else {\n normal = octEncodedNormalScratch;\n normal.x = 0.0;\n normal.y = 0.0;\n }\n\n let webMercatorT = v;\n if (sourceEncoding.hasWebMercatorT) {\n const latitude = CesiumMath.lerp(\n targetRectangle.south,\n targetRectangle.north,\n v\n );\n webMercatorT =\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\n southMercatorY) *\n oneOverMercatorHeight;\n }\n\n let geodeticSurfaceNormal;\n if (encoding.hasGeodeticSurfaceNormals) {\n geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\n position,\n normalScratch\n );\n }\n\n encoding.encode(\n typedArray,\n nextIndex * targetStride,\n position,\n uv,\n height,\n normal,\n webMercatorT,\n geodeticSurfaceNormal\n );\n\n heightRange.minimumHeight = Math.min(heightRange.minimumHeight, height);\n heightRange.maximumHeight = Math.max(heightRange.maximumHeight, height);\n\n ++nextIndex;\n }\n\n return nextIndex;\n}\n\nfunction getNearestHeightOnEdge(meshes, tiles, isNext, edge, u, v) {\n let meshStart;\n let meshEnd;\n let meshStep;\n\n if (isNext) {\n meshStart = 0;\n meshEnd = meshes.length;\n meshStep = 1;\n } else {\n meshStart = meshes.length - 1;\n meshEnd = -1;\n meshStep = -1;\n }\n\n for (\n let meshIndex = meshStart;\n meshIndex !== meshEnd;\n meshIndex += meshStep\n ) {\n const mesh = meshes[meshIndex];\n const tile = tiles[meshIndex];\n if (!meshIsUsable(tile, mesh)) {\n continue;\n }\n\n let indices;\n switch (edge) {\n case TileEdge.WEST:\n indices = mesh.westIndicesSouthToNorth;\n break;\n case TileEdge.SOUTH:\n indices = mesh.southIndicesEastToWest;\n break;\n case TileEdge.EAST:\n indices = mesh.eastIndicesNorthToSouth;\n break;\n case TileEdge.NORTH:\n indices = mesh.northIndicesWestToEast;\n break;\n }\n\n const index = indices[isNext ? 0 : indices.length - 1];\n if (defined(index)) {\n return mesh.encoding.decodeHeight(mesh.vertices, index);\n }\n }\n\n return undefined;\n}\n\nfunction meshIsUsable(tile, mesh) {\n return (\n defined(mesh) &&\n (!defined(tile.data.fill) || !tile.data.fill.changedThisFrame)\n );\n}\n\nfunction getCornerFromEdge(\n terrainFillMesh,\n ellipsoid,\n edgeMeshes,\n edgeTiles,\n isNext,\n u,\n v,\n vertex\n) {\n let edgeVertices;\n let compareU;\n let increasing;\n let vertexIndexIndex;\n let vertexIndex;\n const sourceTile = edgeTiles[isNext ? 0 : edgeMeshes.length - 1];\n const sourceMesh = edgeMeshes[isNext ? 0 : edgeMeshes.length - 1];\n\n if (meshIsUsable(sourceTile, sourceMesh)) {\n // Previous mesh is valid, but we don't know yet if it covers this corner.\n if (u === 0.0) {\n if (v === 0.0) {\n // southwest\n edgeVertices = isNext\n ? sourceMesh.northIndicesWestToEast\n : sourceMesh.eastIndicesNorthToSouth;\n compareU = isNext;\n increasing = isNext;\n } else {\n // northwest\n edgeVertices = isNext\n ? sourceMesh.eastIndicesNorthToSouth\n : sourceMesh.southIndicesEastToWest;\n compareU = !isNext;\n increasing = false;\n }\n } else if (v === 0.0) {\n // southeast\n edgeVertices = isNext\n ? sourceMesh.westIndicesSouthToNorth\n : sourceMesh.northIndicesWestToEast;\n compareU = !isNext;\n increasing = true;\n } else {\n // northeast\n edgeVertices = isNext\n ? sourceMesh.southIndicesEastToWest\n : sourceMesh.westIndicesSouthToNorth;\n compareU = isNext;\n increasing = !isNext;\n }\n\n if (edgeVertices.length > 0) {\n // The vertex we want will very often be the first/last vertex so check that first.\n vertexIndexIndex = isNext ? 0 : edgeVertices.length - 1;\n vertexIndex = edgeVertices[vertexIndexIndex];\n sourceMesh.encoding.decodeTextureCoordinates(\n sourceMesh.vertices,\n vertexIndex,\n uvScratch\n );\n const targetUv = transformTextureCoordinates(\n sourceTile,\n terrainFillMesh.tile,\n uvScratch,\n uvScratch\n );\n if (targetUv.x === u && targetUv.y === v) {\n // Vertex is good!\n getVertexFromTileAtCorner(sourceMesh, vertexIndex, u, v, vertex);\n return true;\n }\n\n // The last vertex is not the one we need, try binary searching for the right one.\n vertexIndexIndex = binarySearch(edgeVertices, compareU ? u : v, function (\n vertexIndex,\n textureCoordinate\n ) {\n sourceMesh.encoding.decodeTextureCoordinates(\n sourceMesh.vertices,\n vertexIndex,\n uvScratch\n );\n const targetUv = transformTextureCoordinates(\n sourceTile,\n terrainFillMesh.tile,\n uvScratch,\n uvScratch\n );\n if (increasing) {\n if (compareU) {\n return targetUv.x - u;\n }\n return targetUv.y - v;\n } else if (compareU) {\n return u - targetUv.x;\n }\n return v - targetUv.y;\n });\n\n if (vertexIndexIndex < 0) {\n vertexIndexIndex = ~vertexIndexIndex;\n\n if (vertexIndexIndex > 0 && vertexIndexIndex < edgeVertices.length) {\n // The corner falls between two vertices, so interpolate between them.\n getInterpolatedVertexAtCorner(\n ellipsoid,\n sourceTile,\n terrainFillMesh.tile,\n sourceMesh,\n edgeVertices[vertexIndexIndex - 1],\n edgeVertices[vertexIndexIndex],\n u,\n v,\n compareU,\n vertex\n );\n return true;\n }\n } else {\n // Found a vertex that fits in the corner exactly.\n getVertexFromTileAtCorner(\n sourceMesh,\n edgeVertices[vertexIndexIndex],\n u,\n v,\n vertex\n );\n return true;\n }\n }\n }\n\n return false;\n}\n\nconst cornerPositionsScratch = [\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n];\n\nfunction computeOccludeePoint(\n tileProvider,\n center,\n rectangle,\n minimumHeight,\n maximumHeight,\n result\n) {\n const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid;\n const ellipsoid = ellipsoidalOccluder.ellipsoid;\n\n const cornerPositions = cornerPositionsScratch;\n Cartesian3.fromRadians(\n rectangle.west,\n rectangle.south,\n maximumHeight,\n ellipsoid,\n cornerPositions[0]\n );\n Cartesian3.fromRadians(\n rectangle.east,\n rectangle.south,\n maximumHeight,\n ellipsoid,\n cornerPositions[1]\n );\n Cartesian3.fromRadians(\n rectangle.west,\n rectangle.north,\n maximumHeight,\n ellipsoid,\n cornerPositions[2]\n );\n Cartesian3.fromRadians(\n rectangle.east,\n rectangle.north,\n maximumHeight,\n ellipsoid,\n cornerPositions[3]\n );\n\n return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n center,\n cornerPositions,\n minimumHeight,\n result\n );\n}\nexport default TerrainFillMesh;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport TerrainExaggeration from \"../Core/TerrainExaggeration.js\";\nimport TerrainQuantization from \"../Core/TerrainQuantization.js\";\nimport Visibility from \"../Core/Visibility.js\";\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport DepthFunction from \"./DepthFunction.js\";\nimport GlobeSurfaceTile from \"./GlobeSurfaceTile.js\";\nimport ImageryLayer from \"./ImageryLayer.js\";\nimport ImageryState from \"./ImageryState.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport TerrainFillMesh from \"./TerrainFillMesh.js\";\nimport TerrainState from \"./TerrainState.js\";\nimport TileBoundingRegion from \"./TileBoundingRegion.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * Provides quadtree tiles representing the surface of the globe. This type is intended to be used\n * with {@link QuadtreePrimitive}.\n *\n * @alias GlobeSurfaceTileProvider\n * @constructor\n *\n * @param {TerrainProvider} options.terrainProvider The terrain provider that describes the surface geometry.\n * @param {ImageryLayerCollection} option.imageryLayers The collection of imagery layers describing the shading of the surface.\n * @param {GlobeSurfaceShaderSet} options.surfaceShaderSet The set of shaders used to render the surface.\n *\n * @private\n */\nfunction GlobeSurfaceTileProvider(options) {\n this.lightingFadeOutDistance = 6500000.0;\n this.lightingFadeInDistance = 9000000.0;\n this.hasWaterMask = false;\n this.oceanNormalMap = undefined;\n this.zoomedOutOceanSpecularIntensity = 0.5;\n this.enableLighting = false;\n this.dynamicAtmosphereLighting = false;\n this.dynamicAtmosphereLightingFromSun = false;\n this.showGroundAtmosphere = false;\n this.shadows = ShadowMode.RECEIVE_ONLY;\n\n /**\n * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not\n * highlighted at all. The alpha value is used to alpha blend with the tile's\n * actual color. Because terrain fill tiles do not represent the actual terrain surface,\n * it may be useful in some applications to indicate visually that they are not to be trusted.\n * @type {Color}\n * @default undefined\n */\n this.fillHighlightColor = undefined;\n\n this.hueShift = 0.0;\n this.saturationShift = 0.0;\n this.brightnessShift = 0.0;\n\n this.showSkirts = true;\n this.backFaceCulling = true;\n this.undergroundColor = undefined;\n this.undergroundColorAlphaByDistance = undefined;\n\n this.lambertDiffuseMultiplier = 0.0;\n\n this.materialUniformMap = undefined;\n this._materialUniformMap = undefined;\n\n this._quadtree = undefined;\n this._terrainProvider = options.terrainProvider;\n this._imageryLayers = options.imageryLayers;\n this._surfaceShaderSet = options.surfaceShaderSet;\n\n this._renderState = undefined;\n this._blendRenderState = undefined;\n this._disableCullingRenderState = undefined;\n this._disableCullingBlendRenderState = undefined;\n\n this._errorEvent = new Event();\n\n this._imageryLayers.layerAdded.addEventListener(\n GlobeSurfaceTileProvider.prototype._onLayerAdded,\n this\n );\n this._imageryLayers.layerRemoved.addEventListener(\n GlobeSurfaceTileProvider.prototype._onLayerRemoved,\n this\n );\n this._imageryLayers.layerMoved.addEventListener(\n GlobeSurfaceTileProvider.prototype._onLayerMoved,\n this\n );\n this._imageryLayers.layerShownOrHidden.addEventListener(\n GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,\n this\n );\n this._imageryLayersUpdatedEvent = new Event();\n\n this._layerOrderChanged = false;\n\n this._tilesToRenderByTextureCount = [];\n this._drawCommands = [];\n this._uniformMaps = [];\n this._usedDrawCommands = 0;\n\n this._vertexArraysToDestroy = [];\n\n this._debug = {\n wireframe: false,\n boundingSphereTile: undefined,\n };\n\n this._baseColor = undefined;\n this._firstPassInitialColor = undefined;\n this.baseColor = new Color(0.0, 0.0, 0.5, 1.0);\n\n /**\n * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.\n * @type {ClippingPlaneCollection}\n * @private\n */\n this._clippingPlanes = undefined;\n\n /**\n * A property specifying a {@link Rectangle} used to selectively limit terrain and imagery rendering.\n * @type {Rectangle}\n */\n this.cartographicLimitRectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n\n this._hasLoadedTilesThisFrame = false;\n this._hasFillTilesThisFrame = false;\n\n this._oldTerrainExaggeration = undefined;\n this._oldTerrainExaggerationRelativeHeight = undefined;\n}\n\nObject.defineProperties(GlobeSurfaceTileProvider.prototype, {\n /**\n * Gets or sets the color of the globe when no imagery is available.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {Color}\n */\n baseColor: {\n get: function () {\n return this._baseColor;\n },\n set: function (value) {\n this._baseColor = value;\n this._firstPassInitialColor = Cartesian4.fromColor(\n value,\n this._firstPassInitialColor\n );\n },\n },\n /**\n * Gets or sets the {@link QuadtreePrimitive} for which this provider is\n * providing tiles. This property may be undefined if the provider is not yet associated\n * with a {@link QuadtreePrimitive}.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {QuadtreePrimitive}\n */\n quadtree: {\n get: function () {\n return this._quadtree;\n },\n set: function (value) {\n this._quadtree = value;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {Boolean}\n */\n ready: {\n get: function () {\n return (\n this._terrainProvider.ready &&\n (this._imageryLayers.length === 0 ||\n this._imageryLayers.get(0).imageryProvider.ready)\n );\n },\n },\n\n /**\n * Gets the tiling scheme used by the provider. This property should\n * not be accessed before {@link GlobeSurfaceTileProvider#ready} returns true.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {TilingScheme}\n */\n tilingScheme: {\n get: function () {\n return this._terrainProvider.tilingScheme;\n },\n },\n\n /**\n * Gets an event that is raised when the geometry provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {Event}\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets an event that is raised when an imagery layer is added, shown, hidden, moved, or removed.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {Event}\n */\n imageryLayersUpdatedEvent: {\n get: function () {\n return this._imageryLayersUpdatedEvent;\n },\n },\n\n /**\n * Gets or sets the terrain provider that describes the surface geometry.\n * @memberof GlobeSurfaceTileProvider.prototype\n * @type {TerrainProvider}\n */\n terrainProvider: {\n get: function () {\n return this._terrainProvider;\n },\n set: function (terrainProvider) {\n if (this._terrainProvider === terrainProvider) {\n return;\n }\n\n this._terrainProvider = terrainProvider;\n\n if (defined(this._quadtree)) {\n this._quadtree.invalidateAllTiles();\n }\n },\n },\n /**\n * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.\n *\n * @type {ClippingPlaneCollection}\n *\n * @private\n */\n clippingPlanes: {\n get: function () {\n return this._clippingPlanes;\n },\n set: function (value) {\n ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n },\n },\n});\n\nfunction sortTileImageryByLayerIndex(a, b) {\n let aImagery = a.loadingImagery;\n if (!defined(aImagery)) {\n aImagery = a.readyImagery;\n }\n\n let bImagery = b.loadingImagery;\n if (!defined(bImagery)) {\n bImagery = b.readyImagery;\n }\n\n return aImagery.imageryLayer._layerIndex - bImagery.imageryLayer._layerIndex;\n}\n\n/**\n * Make updates to the tile provider that are not involved in rendering. Called before the render update cycle.\n */\nGlobeSurfaceTileProvider.prototype.update = function (frameState) {\n // update collection: imagery indices, base layers, raise layer show/hide event\n this._imageryLayers._update();\n};\n\nfunction updateCredits(surface, frameState) {\n const creditDisplay = frameState.creditDisplay;\n if (\n surface._terrainProvider.ready &&\n defined(surface._terrainProvider.credit)\n ) {\n creditDisplay.addCredit(surface._terrainProvider.credit);\n }\n\n const imageryLayers = surface._imageryLayers;\n for (let i = 0, len = imageryLayers.length; i < len; ++i) {\n const imageryProvider = imageryLayers.get(i).imageryProvider;\n if (imageryProvider.ready && defined(imageryProvider.credit)) {\n creditDisplay.addCredit(imageryProvider.credit);\n }\n }\n}\n\n/**\n * Called at the beginning of each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.initialize = function (frameState) {\n // update each layer for texture reprojection.\n this._imageryLayers.queueReprojectionCommands(frameState);\n\n if (this._layerOrderChanged) {\n this._layerOrderChanged = false;\n\n // Sort the TileImagery instances in each tile by the layer index.\n this._quadtree.forEachLoadedTile(function (tile) {\n tile.data.imagery.sort(sortTileImageryByLayerIndex);\n });\n }\n\n // Add credits for terrain and imagery providers.\n updateCredits(this, frameState);\n\n const vertexArraysToDestroy = this._vertexArraysToDestroy;\n const length = vertexArraysToDestroy.length;\n for (let j = 0; j < length; ++j) {\n GlobeSurfaceTile._freeVertexArray(vertexArraysToDestroy[j]);\n }\n vertexArraysToDestroy.length = 0;\n};\n\n/**\n * Called at the beginning of the update cycle for each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * or any other functions.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.beginUpdate = function (frameState) {\n const tilesToRenderByTextureCount = this._tilesToRenderByTextureCount;\n for (let i = 0, len = tilesToRenderByTextureCount.length; i < len; ++i) {\n const tiles = tilesToRenderByTextureCount[i];\n if (defined(tiles)) {\n tiles.length = 0;\n }\n }\n // update clipping planes\n const clippingPlanes = this._clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n clippingPlanes.update(frameState);\n }\n this._usedDrawCommands = 0;\n\n this._hasLoadedTilesThisFrame = false;\n this._hasFillTilesThisFrame = false;\n};\n\n/**\n * Called at the end of the update cycle for each render frame, after {@link QuadtreeTileProvider#showTileThisFrame}\n * and any other functions.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) {\n if (!defined(this._renderState)) {\n this._renderState = RenderState.fromCache({\n // Write color and depth\n cull: {\n enabled: true,\n },\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS,\n },\n });\n\n this._blendRenderState = RenderState.fromCache({\n // Write color and depth\n cull: {\n enabled: true,\n },\n depthTest: {\n enabled: true,\n func: DepthFunction.LESS_OR_EQUAL,\n },\n blending: BlendingState.ALPHA_BLEND,\n });\n\n let rs = clone(this._renderState, true);\n rs.cull.enabled = false;\n this._disableCullingRenderState = RenderState.fromCache(rs);\n\n rs = clone(this._blendRenderState, true);\n rs.cull.enabled = false;\n this._disableCullingBlendRenderState = RenderState.fromCache(rs);\n }\n\n // If this frame has a mix of loaded and fill tiles, we need to propagate\n // loaded heights to the fill tiles.\n if (this._hasFillTilesThisFrame && this._hasLoadedTilesThisFrame) {\n TerrainFillMesh.updateFillTiles(\n this,\n this._quadtree._tilesToRender,\n frameState,\n this._vertexArraysToDestroy\n );\n }\n\n // When terrain exaggeration changes, all of the loaded tiles need to generate\n // geodetic surface normals so they can scale properly when rendered.\n // When exaggeration is reset, geodetic surface normals are removed to decrease\n // memory usage. Some tiles might have been constructed with the correct\n // exaggeration already, so skip over them.\n\n // If the geodetic surface normals can't be created because the tile doesn't\n // have a mesh, keep checking until the tile does have a mesh. This can happen\n // if the tile's mesh starts construction in a worker thread right before the\n // exaggeration changes.\n\n const quadtree = this.quadtree;\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n const exaggerationChanged =\n this._oldTerrainExaggeration !== exaggeration ||\n this._oldTerrainExaggerationRelativeHeight !== exaggerationRelativeHeight;\n\n // Keep track of the next time there is a change in exaggeration\n this._oldTerrainExaggeration = exaggeration;\n this._oldTerrainExaggerationRelativeHeight = exaggerationRelativeHeight;\n\n if (exaggerationChanged) {\n quadtree.forEachLoadedTile(function (tile) {\n const surfaceTile = tile.data;\n surfaceTile.updateExaggeration(tile, frameState, quadtree);\n });\n }\n\n // Add the tile render commands to the command list, sorted by texture count.\n const tilesToRenderByTextureCount = this._tilesToRenderByTextureCount;\n for (\n let textureCountIndex = 0,\n textureCountLength = tilesToRenderByTextureCount.length;\n textureCountIndex < textureCountLength;\n ++textureCountIndex\n ) {\n const tilesToRender = tilesToRenderByTextureCount[textureCountIndex];\n if (!defined(tilesToRender)) {\n continue;\n }\n\n for (\n let tileIndex = 0, tileLength = tilesToRender.length;\n tileIndex < tileLength;\n ++tileIndex\n ) {\n const tile = tilesToRender[tileIndex];\n const tileBoundingRegion = tile.data.tileBoundingRegion;\n addDrawCommandsForTile(this, tile, frameState);\n frameState.minimumTerrainHeight = Math.min(\n frameState.minimumTerrainHeight,\n tileBoundingRegion.minimumHeight\n );\n }\n }\n};\n\nfunction pushCommand(command, frameState) {\n const globeTranslucencyState = frameState.globeTranslucencyState;\n if (globeTranslucencyState.translucent) {\n const isBlendCommand = command.renderState.blending.enabled;\n globeTranslucencyState.pushDerivedCommands(\n command,\n isBlendCommand,\n frameState\n );\n } else {\n frameState.commandList.push(command);\n }\n}\n\n/**\n * Adds draw commands for tiles rendered in the previous frame for a pick pass.\n *\n * @param {FrameState} frameState The frame state.\n */\nGlobeSurfaceTileProvider.prototype.updateForPick = function (frameState) {\n // Add the tile pick commands from the tiles drawn last frame.\n const drawCommands = this._drawCommands;\n for (let i = 0, length = this._usedDrawCommands; i < length; ++i) {\n pushCommand(drawCommands[i], frameState);\n }\n};\n\n/**\n * Cancels any imagery re-projections in the queue.\n */\nGlobeSurfaceTileProvider.prototype.cancelReprojections = function () {\n this._imageryLayers.cancelReprojections();\n};\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level, in meters. This function should not be\n * called before {@link GlobeSurfaceTileProvider#ready} returns true.\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error in meters.\n */\nGlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError = function (\n level\n) {\n return this._terrainProvider.getLevelMaximumGeometricError(level);\n};\n\n/**\n * Loads, or continues loading, a given tile. This function will continue to be called\n * until {@link QuadtreeTile#state} is no longer {@link QuadtreeTileLoadState#LOADING}. This function should\n * not be called before {@link GlobeSurfaceTileProvider#ready} returns true.\n *\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to load.\n *\n * @exception {DeveloperError} <code>loadTile</code> must not be called before the tile provider is ready.\n */\nGlobeSurfaceTileProvider.prototype.loadTile = function (frameState, tile) {\n // We don't want to load imagery until we're certain that the terrain tiles are actually visible.\n // So if our bounding volume isn't accurate because it came from another tile, load terrain only\n // initially. If we load some terrain and suddenly have a more accurate bounding volume and the\n // tile is _still_ visible, give the tile a chance to load imagery immediately rather than\n // waiting for next frame.\n\n let surfaceTile = tile.data;\n let terrainOnly = true;\n let terrainStateBefore;\n if (defined(surfaceTile)) {\n terrainOnly =\n surfaceTile.boundingVolumeSourceTile !== tile ||\n tile._lastSelectionResult === TileSelectionResult.CULLED_BUT_NEEDED;\n terrainStateBefore = surfaceTile.terrainState;\n }\n\n GlobeSurfaceTile.processStateMachine(\n tile,\n frameState,\n this.terrainProvider,\n this._imageryLayers,\n this.quadtree,\n this._vertexArraysToDestroy,\n terrainOnly\n );\n\n surfaceTile = tile.data;\n if (terrainOnly && terrainStateBefore !== tile.data.terrainState) {\n // Terrain state changed. If:\n // a) The tile is visible, and\n // b) The bounding volume is accurate (updated as a side effect of computing visibility)\n // Then we'll load imagery, too.\n if (\n this.computeTileVisibility(tile, frameState, this.quadtree.occluders) !==\n Visibility.NONE &&\n surfaceTile.boundingVolumeSourceTile === tile\n ) {\n terrainOnly = false;\n GlobeSurfaceTile.processStateMachine(\n tile,\n frameState,\n this.terrainProvider,\n this._imageryLayers,\n this.quadtree,\n this._vertexArraysToDestroy,\n terrainOnly\n );\n }\n }\n};\n\nconst boundingSphereScratch = new BoundingSphere();\nconst rectangleIntersectionScratch = new Rectangle();\nconst splitCartographicLimitRectangleScratch = new Rectangle();\nconst rectangleCenterScratch = new Cartographic();\n\n// cartographicLimitRectangle may span the IDL, but tiles never will.\nfunction clipRectangleAntimeridian(tileRectangle, cartographicLimitRectangle) {\n if (cartographicLimitRectangle.west < cartographicLimitRectangle.east) {\n return cartographicLimitRectangle;\n }\n const splitRectangle = Rectangle.clone(\n cartographicLimitRectangle,\n splitCartographicLimitRectangleScratch\n );\n const tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch);\n if (tileCenter.longitude > 0.0) {\n splitRectangle.east = CesiumMath.PI;\n } else {\n splitRectangle.west = -CesiumMath.PI;\n }\n return splitRectangle;\n}\n\nfunction isUndergroundVisible(tileProvider, frameState) {\n if (frameState.cameraUnderground) {\n return true;\n }\n\n if (frameState.globeTranslucencyState.translucent) {\n return true;\n }\n\n if (tileProvider.backFaceCulling) {\n return false;\n }\n\n const clippingPlanes = tileProvider._clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n return true;\n }\n\n if (\n !Rectangle.equals(\n tileProvider.cartographicLimitRectangle,\n Rectangle.MAX_VALUE\n )\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Determines the visibility of a given tile. The tile may be fully visible, partially visible, or not\n * visible at all. Tiles that are renderable and are at least partially visible will be shown by a call\n * to {@link GlobeSurfaceTileProvider#showTileThisFrame}.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information about the current frame.\n * @param {QuadtreeOccluders} occluders The objects that may occlude this tile.\n *\n * @returns {Visibility} Visibility.NONE if the tile is not visible,\n * Visibility.PARTIAL if the tile is partially visible, or\n * Visibility.FULL if the tile is fully visible.\n */\nGlobeSurfaceTileProvider.prototype.computeTileVisibility = function (\n tile,\n frameState,\n occluders\n) {\n const distance = this.computeDistanceToTile(tile, frameState);\n tile._distance = distance;\n\n const undergroundVisible = isUndergroundVisible(this, frameState);\n\n if (frameState.fog.enabled && !undergroundVisible) {\n if (CesiumMath.fog(distance, frameState.fog.density) >= 1.0) {\n // Tile is completely in fog so return that it is not visible.\n return Visibility.NONE;\n }\n }\n\n const surfaceTile = tile.data;\n const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n\n if (surfaceTile.boundingVolumeSourceTile === undefined) {\n // We have no idea where this tile is, so let's just call it partially visible.\n return Visibility.PARTIAL;\n }\n\n const cullingVolume = frameState.cullingVolume;\n let boundingVolume = tileBoundingRegion.boundingVolume;\n\n if (!defined(boundingVolume)) {\n boundingVolume = tileBoundingRegion.boundingSphere;\n }\n\n // Check if the tile is outside the limit area in cartographic space\n surfaceTile.clippedByBoundaries = false;\n const clippedCartographicLimitRectangle = clipRectangleAntimeridian(\n tile.rectangle,\n this.cartographicLimitRectangle\n );\n const areaLimitIntersection = Rectangle.simpleIntersection(\n clippedCartographicLimitRectangle,\n tile.rectangle,\n rectangleIntersectionScratch\n );\n if (!defined(areaLimitIntersection)) {\n return Visibility.NONE;\n }\n if (!Rectangle.equals(areaLimitIntersection, tile.rectangle)) {\n surfaceTile.clippedByBoundaries = true;\n }\n\n if (frameState.mode !== SceneMode.SCENE3D) {\n boundingVolume = boundingSphereScratch;\n BoundingSphere.fromRectangleWithHeights2D(\n tile.rectangle,\n frameState.mapProjection,\n tileBoundingRegion.minimumHeight,\n tileBoundingRegion.maximumHeight,\n boundingVolume\n );\n Cartesian3.fromElements(\n boundingVolume.center.z,\n boundingVolume.center.x,\n boundingVolume.center.y,\n boundingVolume.center\n );\n\n if (\n frameState.mode === SceneMode.MORPHING &&\n defined(surfaceTile.renderedMesh)\n ) {\n boundingVolume = BoundingSphere.union(\n tileBoundingRegion.boundingSphere,\n boundingVolume,\n boundingVolume\n );\n }\n }\n\n if (!defined(boundingVolume)) {\n return Visibility.PARTIAL;\n }\n\n const clippingPlanes = this._clippingPlanes;\n if (defined(clippingPlanes) && clippingPlanes.enabled) {\n const planeIntersection = clippingPlanes.computeIntersectionWithBoundingVolume(\n boundingVolume\n );\n tile.isClipped = planeIntersection !== Intersect.INSIDE;\n if (planeIntersection === Intersect.OUTSIDE) {\n return Visibility.NONE;\n }\n }\n\n let visibility;\n const intersection = cullingVolume.computeVisibility(boundingVolume);\n\n if (intersection === Intersect.OUTSIDE) {\n visibility = Visibility.NONE;\n } else if (intersection === Intersect.INTERSECTING) {\n visibility = Visibility.PARTIAL;\n } else if (intersection === Intersect.INSIDE) {\n visibility = Visibility.FULL;\n }\n\n if (visibility === Visibility.NONE) {\n return visibility;\n }\n\n const ortho3D =\n frameState.mode === SceneMode.SCENE3D &&\n frameState.camera.frustum instanceof OrthographicFrustum;\n if (\n frameState.mode === SceneMode.SCENE3D &&\n !ortho3D &&\n defined(occluders) &&\n !undergroundVisible\n ) {\n const occludeePointInScaledSpace = surfaceTile.occludeePointInScaledSpace;\n if (!defined(occludeePointInScaledSpace)) {\n return visibility;\n }\n\n if (\n occluders.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(\n occludeePointInScaledSpace,\n tileBoundingRegion.minimumHeight\n )\n ) {\n return visibility;\n }\n\n return Visibility.NONE;\n }\n\n return visibility;\n};\n\n/**\n * Determines if the given tile can be refined\n * @param {QuadtreeTile} tile The tile to check.\n * @returns {boolean} True if the tile can be refined, false if it cannot.\n */\nGlobeSurfaceTileProvider.prototype.canRefine = function (tile) {\n // Only allow refinement it we know whether or not the children of this tile exist.\n // For a tileset with `availability`, we'll always be able to refine.\n // We can ask for availability of _any_ child tile because we only need to confirm\n // that we get a yes or no answer, it doesn't matter what the answer is.\n if (defined(tile.data.terrainData)) {\n return true;\n }\n const childAvailable = this.terrainProvider.getTileDataAvailable(\n tile.x * 2,\n tile.y * 2,\n tile.level + 1\n );\n return childAvailable !== undefined;\n};\n\nconst readyImageryScratch = [];\nconst canRenderTraversalStack = [];\n\n/**\n * Determines if the given not-fully-loaded tile can be rendered without losing detail that\n * was present last frame as a result of rendering descendant tiles. This method will only be\n * called if this tile's descendants were rendered last frame. If the tile is fully loaded,\n * it is assumed that this method will return true and it will not be called.\n * @param {QuadtreeTile} tile The tile to check.\n * @returns {boolean} True if the tile can be rendered without losing detail.\n */\nGlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail = function (\n tile,\n frameState\n) {\n const surfaceTile = tile.data;\n\n const readyImagery = readyImageryScratch;\n readyImagery.length = this._imageryLayers.length;\n\n let terrainReady = false;\n let initialImageryState = false;\n let imagery;\n\n if (defined(surfaceTile)) {\n // We can render even with non-ready terrain as long as all our rendered descendants\n // are missing terrain geometry too. i.e. if we rendered fills for more detailed tiles\n // last frame, it's ok to render a fill for this tile this frame.\n terrainReady = surfaceTile.terrainState === TerrainState.READY;\n\n // Initially assume all imagery layers are ready, unless imagery hasn't been initialized at all.\n initialImageryState = true;\n\n imagery = surfaceTile.imagery;\n }\n\n let i;\n let len;\n\n for (i = 0, len = readyImagery.length; i < len; ++i) {\n readyImagery[i] = initialImageryState;\n }\n\n if (defined(imagery)) {\n for (i = 0, len = imagery.length; i < len; ++i) {\n const tileImagery = imagery[i];\n const loadingImagery = tileImagery.loadingImagery;\n const isReady =\n !defined(loadingImagery) ||\n loadingImagery.state === ImageryState.FAILED ||\n loadingImagery.state === ImageryState.INVALID;\n const layerIndex = (\n tileImagery.loadingImagery || tileImagery.readyImagery\n ).imageryLayer._layerIndex;\n\n // For a layer to be ready, all tiles belonging to that layer must be ready.\n readyImagery[layerIndex] = isReady && readyImagery[layerIndex];\n }\n }\n\n const lastFrame = this.quadtree._lastSelectionFrameNumber;\n\n // Traverse the descendants looking for one with terrain or imagery that is not loaded on this tile.\n const stack = canRenderTraversalStack;\n stack.length = 0;\n stack.push(\n tile.southwestChild,\n tile.southeastChild,\n tile.northwestChild,\n tile.northeastChild\n );\n\n while (stack.length > 0) {\n const descendant = stack.pop();\n const lastFrameSelectionResult =\n descendant._lastSelectionResultFrame === lastFrame\n ? descendant._lastSelectionResult\n : TileSelectionResult.NONE;\n\n if (lastFrameSelectionResult === TileSelectionResult.RENDERED) {\n const descendantSurface = descendant.data;\n\n if (!defined(descendantSurface)) {\n // Descendant has no data, so it can't block rendering.\n continue;\n }\n\n if (\n !terrainReady &&\n descendant.data.terrainState === TerrainState.READY\n ) {\n // Rendered descendant has real terrain, but we don't. Rendering is blocked.\n return false;\n }\n\n const descendantImagery = descendant.data.imagery;\n for (i = 0, len = descendantImagery.length; i < len; ++i) {\n const descendantTileImagery = descendantImagery[i];\n const descendantLoadingImagery = descendantTileImagery.loadingImagery;\n const descendantIsReady =\n !defined(descendantLoadingImagery) ||\n descendantLoadingImagery.state === ImageryState.FAILED ||\n descendantLoadingImagery.state === ImageryState.INVALID;\n const descendantLayerIndex = (\n descendantTileImagery.loadingImagery ||\n descendantTileImagery.readyImagery\n ).imageryLayer._layerIndex;\n\n // If this imagery tile of a descendant is ready but the layer isn't ready in this tile,\n // then rendering is blocked.\n if (descendantIsReady && !readyImagery[descendantLayerIndex]) {\n return false;\n }\n }\n } else if (lastFrameSelectionResult === TileSelectionResult.REFINED) {\n stack.push(\n descendant.southwestChild,\n descendant.southeastChild,\n descendant.northwestChild,\n descendant.northeastChild\n );\n }\n }\n\n return true;\n};\n\nconst tileDirectionScratch = new Cartesian3();\n\n/**\n * Determines the priority for loading this tile. Lower priority values load sooner.\n * @param {QuadtreeTile} tile The tile.\n * @param {FrameState} frameState The frame state.\n * @returns {Number} The load priority value.\n */\nGlobeSurfaceTileProvider.prototype.computeTileLoadPriority = function (\n tile,\n frameState\n) {\n const surfaceTile = tile.data;\n if (surfaceTile === undefined) {\n return 0.0;\n }\n\n const obb = surfaceTile.tileBoundingRegion.boundingVolume;\n if (obb === undefined) {\n return 0.0;\n }\n\n const cameraPosition = frameState.camera.positionWC;\n const cameraDirection = frameState.camera.directionWC;\n const tileDirection = Cartesian3.subtract(\n obb.center,\n cameraPosition,\n tileDirectionScratch\n );\n const magnitude = Cartesian3.magnitude(tileDirection);\n if (magnitude < CesiumMath.EPSILON5) {\n return 0.0;\n }\n Cartesian3.divideByScalar(tileDirection, magnitude, tileDirection);\n return (\n (1.0 - Cartesian3.dot(tileDirection, cameraDirection)) * tile._distance\n );\n};\n\nconst modifiedModelViewScratch = new Matrix4();\nconst modifiedModelViewProjectionScratch = new Matrix4();\nconst tileRectangleScratch = new Cartesian4();\nconst localizedCartographicLimitRectangleScratch = new Cartesian4();\nconst localizedTranslucencyRectangleScratch = new Cartesian4();\nconst rtcScratch = new Cartesian3();\nconst centerEyeScratch = new Cartesian3();\nconst southwestScratch = new Cartesian3();\nconst northeastScratch = new Cartesian3();\n\n/**\n * Shows a specified tile in this frame. The provider can cause the tile to be shown by adding\n * render commands to the commandList, or use any other method as appropriate. The tile is not\n * expected to be visible next frame as well, unless this method is called next frame, too.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n */\nGlobeSurfaceTileProvider.prototype.showTileThisFrame = function (\n tile,\n frameState\n) {\n let readyTextureCount = 0;\n const tileImageryCollection = tile.data.imagery;\n for (let i = 0, len = tileImageryCollection.length; i < len; ++i) {\n const tileImagery = tileImageryCollection[i];\n if (\n defined(tileImagery.readyImagery) &&\n tileImagery.readyImagery.imageryLayer.alpha !== 0.0\n ) {\n ++readyTextureCount;\n }\n }\n\n let tileSet = this._tilesToRenderByTextureCount[readyTextureCount];\n if (!defined(tileSet)) {\n tileSet = [];\n this._tilesToRenderByTextureCount[readyTextureCount] = tileSet;\n }\n\n tileSet.push(tile);\n\n const surfaceTile = tile.data;\n if (!defined(surfaceTile.vertexArray)) {\n this._hasFillTilesThisFrame = true;\n } else {\n this._hasLoadedTilesThisFrame = true;\n }\n\n const debug = this._debug;\n ++debug.tilesRendered;\n debug.texturesRendered += readyTextureCount;\n};\n\nconst cornerPositionsScratch = [\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n new Cartesian3(),\n];\n\nfunction computeOccludeePoint(\n tileProvider,\n center,\n rectangle,\n minimumHeight,\n maximumHeight,\n result\n) {\n const ellipsoidalOccluder = tileProvider.quadtree._occluders.ellipsoid;\n const ellipsoid = ellipsoidalOccluder.ellipsoid;\n\n const cornerPositions = cornerPositionsScratch;\n Cartesian3.fromRadians(\n rectangle.west,\n rectangle.south,\n maximumHeight,\n ellipsoid,\n cornerPositions[0]\n );\n Cartesian3.fromRadians(\n rectangle.east,\n rectangle.south,\n maximumHeight,\n ellipsoid,\n cornerPositions[1]\n );\n Cartesian3.fromRadians(\n rectangle.west,\n rectangle.north,\n maximumHeight,\n ellipsoid,\n cornerPositions[2]\n );\n Cartesian3.fromRadians(\n rectangle.east,\n rectangle.north,\n maximumHeight,\n ellipsoid,\n cornerPositions[3]\n );\n\n return ellipsoidalOccluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\n center,\n cornerPositions,\n minimumHeight,\n result\n );\n}\n\n/**\n * Gets the distance from the camera to the closest point on the tile. This is used for level-of-detail selection.\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n *\n * @returns {Number} The distance from the camera to the closest point on the tile, in meters.\n */\nGlobeSurfaceTileProvider.prototype.computeDistanceToTile = function (\n tile,\n frameState\n) {\n // The distance should be:\n // 1. the actual distance to the tight-fitting bounding volume, or\n // 2. a distance that is equal to or greater than the actual distance to the tight-fitting bounding volume.\n //\n // When we don't know the min/max heights for a tile, but we do know the min/max of an ancestor tile, we can\n // build a tight-fitting bounding volume horizontally, but not vertically. The min/max heights from the\n // ancestor will likely form a volume that is much bigger than it needs to be. This means that the volume may\n // be deemed to be much closer to the camera than it really is, causing us to select tiles that are too detailed.\n // Loading too-detailed tiles is super expensive, so we don't want to do that. We don't know where the child\n // tile really lies within the parent range of heights, but we _do_ know the child tile can't be any closer than\n // the ancestor height surface (min or max) that is _farthest away_ from the camera. So if we compute distance\n // based on that conservative metric, we may end up loading tiles that are not detailed enough, but that's much\n // better (faster) than loading tiles that are too detailed.\n\n updateTileBoundingRegion(tile, this, frameState);\n\n const surfaceTile = tile.data;\n const boundingVolumeSourceTile = surfaceTile.boundingVolumeSourceTile;\n if (boundingVolumeSourceTile === undefined) {\n // Can't find any min/max heights anywhere? Ok, let's just say the\n // tile is really far away so we'll load and render it rather than\n // refining.\n return 9999999999.0;\n }\n\n const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n const min = tileBoundingRegion.minimumHeight;\n const max = tileBoundingRegion.maximumHeight;\n\n if (surfaceTile.boundingVolumeSourceTile !== tile) {\n const cameraHeight = frameState.camera.positionCartographic.height;\n const distanceToMin = Math.abs(cameraHeight - min);\n const distanceToMax = Math.abs(cameraHeight - max);\n if (distanceToMin > distanceToMax) {\n tileBoundingRegion.minimumHeight = min;\n tileBoundingRegion.maximumHeight = min;\n } else {\n tileBoundingRegion.minimumHeight = max;\n tileBoundingRegion.maximumHeight = max;\n }\n }\n\n const result = tileBoundingRegion.distanceToCamera(frameState);\n\n tileBoundingRegion.minimumHeight = min;\n tileBoundingRegion.maximumHeight = max;\n\n return result;\n};\n\nfunction updateTileBoundingRegion(tile, tileProvider, frameState) {\n let surfaceTile = tile.data;\n if (surfaceTile === undefined) {\n surfaceTile = tile.data = new GlobeSurfaceTile();\n }\n\n const ellipsoid = tile.tilingScheme.ellipsoid;\n if (surfaceTile.tileBoundingRegion === undefined) {\n surfaceTile.tileBoundingRegion = new TileBoundingRegion({\n computeBoundingVolumes: false,\n rectangle: tile.rectangle,\n ellipsoid: ellipsoid,\n minimumHeight: 0.0,\n maximumHeight: 0.0,\n });\n }\n\n const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n const oldMinimumHeight = tileBoundingRegion.minimumHeight;\n const oldMaximumHeight = tileBoundingRegion.maximumHeight;\n let hasBoundingVolumesFromMesh = false;\n let sourceTile = tile;\n\n // Get min and max heights from the mesh.\n // If the mesh is not available, get them from the terrain data.\n // If the terrain data is not available either, get them from an ancestor.\n // If none of the ancestors are available, then there are no min and max heights for this tile at this time.\n const mesh = surfaceTile.mesh;\n const terrainData = surfaceTile.terrainData;\n if (\n mesh !== undefined &&\n mesh.minimumHeight !== undefined &&\n mesh.maximumHeight !== undefined\n ) {\n tileBoundingRegion.minimumHeight = mesh.minimumHeight;\n tileBoundingRegion.maximumHeight = mesh.maximumHeight;\n hasBoundingVolumesFromMesh = true;\n } else if (\n terrainData !== undefined &&\n terrainData._minimumHeight !== undefined &&\n terrainData._maximumHeight !== undefined\n ) {\n tileBoundingRegion.minimumHeight = terrainData._minimumHeight;\n tileBoundingRegion.maximumHeight = terrainData._maximumHeight;\n } else {\n // No accurate min/max heights available, so we're stuck with min/max heights from an ancestor tile.\n tileBoundingRegion.minimumHeight = Number.NaN;\n tileBoundingRegion.maximumHeight = Number.NaN;\n\n let ancestorTile = tile.parent;\n while (ancestorTile !== undefined) {\n const ancestorSurfaceTile = ancestorTile.data;\n if (ancestorSurfaceTile !== undefined) {\n const ancestorMesh = ancestorSurfaceTile.mesh;\n const ancestorTerrainData = ancestorSurfaceTile.terrainData;\n if (\n ancestorMesh !== undefined &&\n ancestorMesh.minimumHeight !== undefined &&\n ancestorMesh.maximumHeight !== undefined\n ) {\n tileBoundingRegion.minimumHeight = ancestorMesh.minimumHeight;\n tileBoundingRegion.maximumHeight = ancestorMesh.maximumHeight;\n break;\n } else if (\n ancestorTerrainData !== undefined &&\n ancestorTerrainData._minimumHeight !== undefined &&\n ancestorTerrainData._maximumHeight !== undefined\n ) {\n tileBoundingRegion.minimumHeight = ancestorTerrainData._minimumHeight;\n tileBoundingRegion.maximumHeight = ancestorTerrainData._maximumHeight;\n break;\n }\n }\n ancestorTile = ancestorTile.parent;\n }\n sourceTile = ancestorTile;\n }\n\n // Update bounding regions from the min and max heights\n if (sourceTile !== undefined) {\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n const hasExaggeration = exaggeration !== 1.0;\n if (hasExaggeration) {\n hasBoundingVolumesFromMesh = false;\n tileBoundingRegion.minimumHeight = TerrainExaggeration.getHeight(\n tileBoundingRegion.minimumHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n tileBoundingRegion.maximumHeight = TerrainExaggeration.getHeight(\n tileBoundingRegion.maximumHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n }\n\n if (hasBoundingVolumesFromMesh) {\n if (!surfaceTile.boundingVolumeIsFromMesh) {\n tileBoundingRegion._orientedBoundingBox = OrientedBoundingBox.clone(\n mesh.orientedBoundingBox,\n tileBoundingRegion._orientedBoundingBox\n );\n tileBoundingRegion._boundingSphere = BoundingSphere.clone(\n mesh.boundingSphere3D,\n tileBoundingRegion._boundingSphere\n );\n surfaceTile.occludeePointInScaledSpace = Cartesian3.clone(\n mesh.occludeePointInScaledSpace,\n surfaceTile.occludeePointInScaledSpace\n );\n\n // If the occludee point is not defined, fallback to calculating it from the OBB\n if (!defined(surfaceTile.occludeePointInScaledSpace)) {\n surfaceTile.occludeePointInScaledSpace = computeOccludeePoint(\n tileProvider,\n tileBoundingRegion._orientedBoundingBox.center,\n tile.rectangle,\n tileBoundingRegion.minimumHeight,\n tileBoundingRegion.maximumHeight,\n surfaceTile.occludeePointInScaledSpace\n );\n }\n }\n } else {\n const needsBounds =\n tileBoundingRegion._orientedBoundingBox === undefined ||\n tileBoundingRegion._boundingSphere === undefined;\n const heightChanged =\n tileBoundingRegion.minimumHeight !== oldMinimumHeight ||\n tileBoundingRegion.maximumHeight !== oldMaximumHeight;\n if (heightChanged || needsBounds) {\n // Bounding volumes need to be recomputed in some circumstances\n tileBoundingRegion.computeBoundingVolumes(ellipsoid);\n surfaceTile.occludeePointInScaledSpace = computeOccludeePoint(\n tileProvider,\n tileBoundingRegion._orientedBoundingBox.center,\n tile.rectangle,\n tileBoundingRegion.minimumHeight,\n tileBoundingRegion.maximumHeight,\n surfaceTile.occludeePointInScaledSpace\n );\n }\n }\n surfaceTile.boundingVolumeSourceTile = sourceTile;\n surfaceTile.boundingVolumeIsFromMesh = hasBoundingVolumesFromMesh;\n } else {\n surfaceTile.boundingVolumeSourceTile = undefined;\n surfaceTile.boundingVolumeIsFromMesh = false;\n }\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see GlobeSurfaceTileProvider#destroy\n */\nGlobeSurfaceTileProvider.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * provider = provider && provider();\n *\n * @see GlobeSurfaceTileProvider#isDestroyed\n */\nGlobeSurfaceTileProvider.prototype.destroy = function () {\n this._tileProvider = this._tileProvider && this._tileProvider.destroy();\n this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n\n return destroyObject(this);\n};\n\nfunction getTileReadyCallback(tileImageriesToFree, layer, terrainProvider) {\n return function (tile) {\n let tileImagery;\n let imagery;\n let startIndex = -1;\n const tileImageryCollection = tile.data.imagery;\n const length = tileImageryCollection.length;\n let i;\n for (i = 0; i < length; ++i) {\n tileImagery = tileImageryCollection[i];\n imagery = defaultValue(\n tileImagery.readyImagery,\n tileImagery.loadingImagery\n );\n if (imagery.imageryLayer === layer) {\n startIndex = i;\n break;\n }\n }\n\n if (startIndex !== -1) {\n const endIndex = startIndex + tileImageriesToFree;\n tileImagery = tileImageryCollection[endIndex];\n imagery = defined(tileImagery)\n ? defaultValue(tileImagery.readyImagery, tileImagery.loadingImagery)\n : undefined;\n if (!defined(imagery) || imagery.imageryLayer !== layer) {\n // Return false to keep the callback if we have to wait on the skeletons\n // Return true to remove the callback if something went wrong\n return !layer._createTileImagerySkeletons(\n tile,\n terrainProvider,\n endIndex\n );\n }\n\n for (i = startIndex; i < endIndex; ++i) {\n tileImageryCollection[i].freeResources();\n }\n\n tileImageryCollection.splice(startIndex, tileImageriesToFree);\n }\n\n return true; // Everything is done, so remove the callback\n };\n}\n\nGlobeSurfaceTileProvider.prototype._onLayerAdded = function (layer, index) {\n if (layer.show) {\n const terrainProvider = this._terrainProvider;\n\n const that = this;\n const imageryProvider = layer.imageryProvider;\n const tileImageryUpdatedEvent = this._imageryLayersUpdatedEvent;\n imageryProvider._reload = function () {\n // Clear the layer's cache\n layer._imageryCache = {};\n\n that._quadtree.forEachLoadedTile(function (tile) {\n // If this layer is still waiting to for the loaded callback, just return\n if (defined(tile._loadedCallbacks[layer._layerIndex])) {\n return;\n }\n\n let i;\n\n // Figure out how many TileImageries we will need to remove and where to insert new ones\n const tileImageryCollection = tile.data.imagery;\n const length = tileImageryCollection.length;\n let startIndex = -1;\n let tileImageriesToFree = 0;\n for (i = 0; i < length; ++i) {\n const tileImagery = tileImageryCollection[i];\n const imagery = defaultValue(\n tileImagery.readyImagery,\n tileImagery.loadingImagery\n );\n if (imagery.imageryLayer === layer) {\n if (startIndex === -1) {\n startIndex = i;\n }\n\n ++tileImageriesToFree;\n } else if (startIndex !== -1) {\n // iterated past the section of TileImageries belonging to this layer, no need to continue.\n break;\n }\n }\n\n if (startIndex === -1) {\n return;\n }\n\n // Insert immediately after existing TileImageries\n const insertionPoint = startIndex + tileImageriesToFree;\n\n // Create new TileImageries for all loaded tiles\n if (\n layer._createTileImagerySkeletons(\n tile,\n terrainProvider,\n insertionPoint\n )\n ) {\n // Add callback to remove old TileImageries when the new TileImageries are ready\n tile._loadedCallbacks[layer._layerIndex] = getTileReadyCallback(\n tileImageriesToFree,\n layer,\n terrainProvider\n );\n\n tile.state = QuadtreeTileLoadState.LOADING;\n }\n });\n };\n\n // create TileImageries for this layer for all previously loaded tiles\n this._quadtree.forEachLoadedTile(function (tile) {\n if (layer._createTileImagerySkeletons(tile, terrainProvider)) {\n tile.state = QuadtreeTileLoadState.LOADING;\n\n // Tiles that are not currently being rendered need to load the new layer before they're renderable.\n // We don't mark the rendered tiles non-renderable, though, because that would make the globe disappear.\n if (\n tile.level !== 0 &&\n (tile._lastSelectionResultFrame !==\n that.quadtree._lastSelectionFrameNumber ||\n tile._lastSelectionResult !== TileSelectionResult.RENDERED)\n ) {\n tile.renderable = false;\n }\n }\n });\n\n this._layerOrderChanged = true;\n tileImageryUpdatedEvent.raiseEvent();\n }\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerRemoved = function (layer, index) {\n // destroy TileImagerys for this layer for all previously loaded tiles\n this._quadtree.forEachLoadedTile(function (tile) {\n const tileImageryCollection = tile.data.imagery;\n\n let startIndex = -1;\n let numDestroyed = 0;\n for (let i = 0, len = tileImageryCollection.length; i < len; ++i) {\n const tileImagery = tileImageryCollection[i];\n let imagery = tileImagery.loadingImagery;\n if (!defined(imagery)) {\n imagery = tileImagery.readyImagery;\n }\n if (imagery.imageryLayer === layer) {\n if (startIndex === -1) {\n startIndex = i;\n }\n\n tileImagery.freeResources();\n ++numDestroyed;\n } else if (startIndex !== -1) {\n // iterated past the section of TileImagerys belonging to this layer, no need to continue.\n break;\n }\n }\n\n if (startIndex !== -1) {\n tileImageryCollection.splice(startIndex, numDestroyed);\n }\n });\n\n if (defined(layer.imageryProvider)) {\n layer.imageryProvider._reload = undefined;\n }\n\n this._imageryLayersUpdatedEvent.raiseEvent();\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerMoved = function (\n layer,\n newIndex,\n oldIndex\n) {\n this._layerOrderChanged = true;\n this._imageryLayersUpdatedEvent.raiseEvent();\n};\n\nGlobeSurfaceTileProvider.prototype._onLayerShownOrHidden = function (\n layer,\n index,\n show\n) {\n if (show) {\n this._onLayerAdded(layer, index);\n } else {\n this._onLayerRemoved(layer, index);\n }\n};\n\nconst scratchClippingPlanesMatrix = new Matrix4();\nconst scratchInverseTransposeClippingPlanesMatrix = new Matrix4();\nfunction createTileUniformMap(frameState, globeSurfaceTileProvider) {\n const uniformMap = {\n u_initialColor: function () {\n return this.properties.initialColor;\n },\n u_fillHighlightColor: function () {\n return this.properties.fillHighlightColor;\n },\n u_zoomedOutOceanSpecularIntensity: function () {\n return this.properties.zoomedOutOceanSpecularIntensity;\n },\n u_oceanNormalMap: function () {\n return this.properties.oceanNormalMap;\n },\n u_atmosphereLightIntensity: function () {\n return this.properties.atmosphereLightIntensity;\n },\n u_atmosphereRayleighCoefficient: function () {\n return this.properties.atmosphereRayleighCoefficient;\n },\n u_atmosphereMieCoefficient: function () {\n return this.properties.atmosphereMieCoefficient;\n },\n u_atmosphereRayleighScaleHeight: function () {\n return this.properties.atmosphereRayleighScaleHeight;\n },\n u_atmosphereMieScaleHeight: function () {\n return this.properties.atmosphereMieScaleHeight;\n },\n u_atmosphereMieAnisotropy: function () {\n return this.properties.atmosphereMieAnisotropy;\n },\n u_lightingFadeDistance: function () {\n return this.properties.lightingFadeDistance;\n },\n u_nightFadeDistance: function () {\n return this.properties.nightFadeDistance;\n },\n u_center3D: function () {\n return this.properties.center3D;\n },\n u_terrainExaggerationAndRelativeHeight: function () {\n return this.properties.terrainExaggerationAndRelativeHeight;\n },\n u_tileRectangle: function () {\n return this.properties.tileRectangle;\n },\n u_modifiedModelView: function () {\n const viewMatrix = frameState.context.uniformState.view;\n const centerEye = Matrix4.multiplyByPoint(\n viewMatrix,\n this.properties.rtc,\n centerEyeScratch\n );\n Matrix4.setTranslation(viewMatrix, centerEye, modifiedModelViewScratch);\n return modifiedModelViewScratch;\n },\n u_modifiedModelViewProjection: function () {\n const viewMatrix = frameState.context.uniformState.view;\n const projectionMatrix = frameState.context.uniformState.projection;\n const centerEye = Matrix4.multiplyByPoint(\n viewMatrix,\n this.properties.rtc,\n centerEyeScratch\n );\n Matrix4.setTranslation(\n viewMatrix,\n centerEye,\n modifiedModelViewProjectionScratch\n );\n Matrix4.multiply(\n projectionMatrix,\n modifiedModelViewProjectionScratch,\n modifiedModelViewProjectionScratch\n );\n return modifiedModelViewProjectionScratch;\n },\n u_dayTextures: function () {\n return this.properties.dayTextures;\n },\n u_dayTextureTranslationAndScale: function () {\n return this.properties.dayTextureTranslationAndScale;\n },\n u_dayTextureTexCoordsRectangle: function () {\n return this.properties.dayTextureTexCoordsRectangle;\n },\n u_dayTextureUseWebMercatorT: function () {\n return this.properties.dayTextureUseWebMercatorT;\n },\n u_dayTextureAlpha: function () {\n return this.properties.dayTextureAlpha;\n },\n u_dayTextureNightAlpha: function () {\n return this.properties.dayTextureNightAlpha;\n },\n u_dayTextureDayAlpha: function () {\n return this.properties.dayTextureDayAlpha;\n },\n u_dayTextureBrightness: function () {\n return this.properties.dayTextureBrightness;\n },\n u_dayTextureContrast: function () {\n return this.properties.dayTextureContrast;\n },\n u_dayTextureHue: function () {\n return this.properties.dayTextureHue;\n },\n u_dayTextureSaturation: function () {\n return this.properties.dayTextureSaturation;\n },\n u_dayTextureOneOverGamma: function () {\n return this.properties.dayTextureOneOverGamma;\n },\n u_dayIntensity: function () {\n return this.properties.dayIntensity;\n },\n u_southAndNorthLatitude: function () {\n return this.properties.southAndNorthLatitude;\n },\n u_southMercatorYAndOneOverHeight: function () {\n return this.properties.southMercatorYAndOneOverHeight;\n },\n u_waterMask: function () {\n return this.properties.waterMask;\n },\n u_waterMaskTranslationAndScale: function () {\n return this.properties.waterMaskTranslationAndScale;\n },\n u_minMaxHeight: function () {\n return this.properties.minMaxHeight;\n },\n u_scaleAndBias: function () {\n return this.properties.scaleAndBias;\n },\n u_dayTextureSplit: function () {\n return this.properties.dayTextureSplit;\n },\n u_dayTextureCutoutRectangles: function () {\n return this.properties.dayTextureCutoutRectangles;\n },\n u_clippingPlanes: function () {\n const clippingPlanes = globeSurfaceTileProvider._clippingPlanes;\n if (defined(clippingPlanes) && defined(clippingPlanes.texture)) {\n // Check in case clippingPlanes hasn't been updated yet.\n return clippingPlanes.texture;\n }\n return frameState.context.defaultTexture;\n },\n u_cartographicLimitRectangle: function () {\n return this.properties.localizedCartographicLimitRectangle;\n },\n u_clippingPlanesMatrix: function () {\n const clippingPlanes = globeSurfaceTileProvider._clippingPlanes;\n const transform = defined(clippingPlanes)\n ? Matrix4.multiply(\n frameState.context.uniformState.view,\n clippingPlanes.modelMatrix,\n scratchClippingPlanesMatrix\n )\n : Matrix4.IDENTITY;\n\n return Matrix4.inverseTranspose(\n transform,\n scratchInverseTransposeClippingPlanesMatrix\n );\n },\n u_clippingPlanesEdgeStyle: function () {\n const style = this.properties.clippingPlanesEdgeColor;\n style.alpha = this.properties.clippingPlanesEdgeWidth;\n return style;\n },\n u_minimumBrightness: function () {\n return frameState.fog.minimumBrightness;\n },\n u_hsbShift: function () {\n return this.properties.hsbShift;\n },\n u_colorsToAlpha: function () {\n return this.properties.colorsToAlpha;\n },\n u_frontFaceAlphaByDistance: function () {\n return this.properties.frontFaceAlphaByDistance;\n },\n u_backFaceAlphaByDistance: function () {\n return this.properties.backFaceAlphaByDistance;\n },\n u_translucencyRectangle: function () {\n return this.properties.localizedTranslucencyRectangle;\n },\n u_undergroundColor: function () {\n return this.properties.undergroundColor;\n },\n u_undergroundColorAlphaByDistance: function () {\n return this.properties.undergroundColorAlphaByDistance;\n },\n u_lambertDiffuseMultiplier: function () {\n return this.properties.lambertDiffuseMultiplier;\n },\n\n // make a separate object so that changes to the properties are seen on\n // derived commands that combine another uniform map with this one.\n properties: {\n initialColor: new Cartesian4(0.0, 0.0, 0.5, 1.0),\n fillHighlightColor: new Color(0.0, 0.0, 0.0, 0.0),\n zoomedOutOceanSpecularIntensity: 0.5,\n oceanNormalMap: undefined,\n lightingFadeDistance: new Cartesian2(6500000.0, 9000000.0),\n nightFadeDistance: new Cartesian2(10000000.0, 40000000.0),\n atmosphereLightIntensity: 10.0,\n atmosphereRayleighCoefficient: new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6),\n atmosphereMieCoefficient: new Cartesian3(21e-6, 21e-6, 21e-6),\n atmosphereRayleighScaleHeight: 10000.0,\n atmosphereMieScaleHeight: 3200.0,\n atmosphereMieAnisotropy: 0.9,\n hsbShift: new Cartesian3(),\n\n center3D: undefined,\n rtc: new Cartesian3(),\n modifiedModelView: new Matrix4(),\n tileRectangle: new Cartesian4(),\n\n terrainExaggerationAndRelativeHeight: new Cartesian2(1.0, 0.0),\n\n dayTextures: [],\n dayTextureTranslationAndScale: [],\n dayTextureTexCoordsRectangle: [],\n dayTextureUseWebMercatorT: [],\n dayTextureAlpha: [],\n dayTextureNightAlpha: [],\n dayTextureDayAlpha: [],\n dayTextureBrightness: [],\n dayTextureContrast: [],\n dayTextureHue: [],\n dayTextureSaturation: [],\n dayTextureOneOverGamma: [],\n dayTextureSplit: [],\n dayTextureCutoutRectangles: [],\n dayIntensity: 0.0,\n colorsToAlpha: [],\n\n southAndNorthLatitude: new Cartesian2(),\n southMercatorYAndOneOverHeight: new Cartesian2(),\n\n waterMask: undefined,\n waterMaskTranslationAndScale: new Cartesian4(),\n\n minMaxHeight: new Cartesian2(),\n scaleAndBias: new Matrix4(),\n clippingPlanesEdgeColor: Color.clone(Color.WHITE),\n clippingPlanesEdgeWidth: 0.0,\n\n localizedCartographicLimitRectangle: new Cartesian4(),\n\n frontFaceAlphaByDistance: new Cartesian4(),\n backFaceAlphaByDistance: new Cartesian4(),\n localizedTranslucencyRectangle: new Cartesian4(),\n undergroundColor: Color.clone(Color.TRANSPARENT),\n undergroundColorAlphaByDistance: new Cartesian4(),\n lambertDiffuseMultiplier: 0.0,\n },\n };\n\n if (defined(globeSurfaceTileProvider.materialUniformMap)) {\n return combine(uniformMap, globeSurfaceTileProvider.materialUniformMap);\n }\n\n return uniformMap;\n}\n\nfunction createWireframeVertexArrayIfNecessary(context, provider, tile) {\n const surfaceTile = tile.data;\n\n let mesh;\n let vertexArray;\n\n if (defined(surfaceTile.vertexArray)) {\n mesh = surfaceTile.mesh;\n vertexArray = surfaceTile.vertexArray;\n } else if (\n defined(surfaceTile.fill) &&\n defined(surfaceTile.fill.vertexArray)\n ) {\n mesh = surfaceTile.fill.mesh;\n vertexArray = surfaceTile.fill.vertexArray;\n }\n\n if (!defined(mesh) || !defined(vertexArray)) {\n return;\n }\n\n if (defined(surfaceTile.wireframeVertexArray)) {\n if (surfaceTile.wireframeVertexArray.mesh === mesh) {\n return;\n }\n\n surfaceTile.wireframeVertexArray.destroy();\n surfaceTile.wireframeVertexArray = undefined;\n }\n\n surfaceTile.wireframeVertexArray = createWireframeVertexArray(\n context,\n vertexArray,\n mesh\n );\n surfaceTile.wireframeVertexArray.mesh = mesh;\n}\n\n/**\n * Creates a vertex array for wireframe rendering of a terrain tile.\n *\n * @private\n *\n * @param {Context} context The context in which to create the vertex array.\n * @param {VertexArray} vertexArray The existing, non-wireframe vertex array. The new vertex array\n * will share vertex buffers with this existing one.\n * @param {TerrainMesh} terrainMesh The terrain mesh containing non-wireframe indices.\n * @returns {VertexArray} The vertex array for wireframe rendering.\n */\nfunction createWireframeVertexArray(context, vertexArray, terrainMesh) {\n const indices = terrainMesh.indices;\n\n const geometry = {\n indices: indices,\n primitiveType: PrimitiveType.TRIANGLES,\n };\n\n GeometryPipeline.toWireframe(geometry);\n\n const wireframeIndices = geometry.indices;\n const wireframeIndexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: wireframeIndices,\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.fromSizeInBytes(\n wireframeIndices.BYTES_PER_ELEMENT\n ),\n });\n return new VertexArray({\n context: context,\n attributes: vertexArray._attributes,\n indexBuffer: wireframeIndexBuffer,\n });\n}\n\nlet getDebugOrientedBoundingBox;\nlet getDebugBoundingSphere;\nlet debugDestroyPrimitive;\n\n(function () {\n const instanceOBB = new GeometryInstance({\n geometry: BoxOutlineGeometry.fromDimensions({\n dimensions: new Cartesian3(2.0, 2.0, 2.0),\n }),\n });\n const instanceSphere = new GeometryInstance({\n geometry: new SphereOutlineGeometry({ radius: 1.0 }),\n });\n let modelMatrix = new Matrix4();\n let previousVolume;\n let primitive;\n\n function createDebugPrimitive(instance) {\n return new Primitive({\n geometryInstances: instance,\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n });\n }\n\n getDebugOrientedBoundingBox = function (obb, color) {\n if (obb === previousVolume) {\n return primitive;\n }\n debugDestroyPrimitive();\n\n previousVolume = obb;\n modelMatrix = Matrix4.fromRotationTranslation(\n obb.halfAxes,\n obb.center,\n modelMatrix\n );\n\n instanceOBB.modelMatrix = modelMatrix;\n instanceOBB.attributes.color = ColorGeometryInstanceAttribute.fromColor(\n color\n );\n\n primitive = createDebugPrimitive(instanceOBB);\n return primitive;\n };\n\n getDebugBoundingSphere = function (sphere, color) {\n if (sphere === previousVolume) {\n return primitive;\n }\n debugDestroyPrimitive();\n\n previousVolume = sphere;\n modelMatrix = Matrix4.fromTranslation(sphere.center, modelMatrix);\n modelMatrix = Matrix4.multiplyByUniformScale(\n modelMatrix,\n sphere.radius,\n modelMatrix\n );\n\n instanceSphere.modelMatrix = modelMatrix;\n instanceSphere.attributes.color = ColorGeometryInstanceAttribute.fromColor(\n color\n );\n\n primitive = createDebugPrimitive(instanceSphere);\n return primitive;\n };\n\n debugDestroyPrimitive = function () {\n if (defined(primitive)) {\n primitive.destroy();\n primitive = undefined;\n previousVolume = undefined;\n }\n };\n})();\n\nconst otherPassesInitialColor = new Cartesian4(0.0, 0.0, 0.0, 0.0);\nconst surfaceShaderSetOptionsScratch = {\n frameState: undefined,\n surfaceTile: undefined,\n numberOfDayTextures: undefined,\n applyBrightness: undefined,\n applyContrast: undefined,\n applyHue: undefined,\n applySaturation: undefined,\n applyGamma: undefined,\n applyAlpha: undefined,\n applyDayNightAlpha: undefined,\n applySplit: undefined,\n showReflectiveOcean: undefined,\n showOceanWaves: undefined,\n enableLighting: undefined,\n dynamicAtmosphereLighting: undefined,\n dynamicAtmosphereLightingFromSun: undefined,\n showGroundAtmosphere: undefined,\n perFragmentGroundAtmosphere: undefined,\n hasVertexNormals: undefined,\n useWebMercatorProjection: undefined,\n enableFog: undefined,\n enableClippingPlanes: undefined,\n clippingPlanes: undefined,\n clippedByBoundaries: undefined,\n hasImageryLayerCutout: undefined,\n colorCorrect: undefined,\n colorToAlpha: undefined,\n hasGeodeticSurfaceNormals: undefined,\n hasExaggeration: undefined,\n};\n\nconst defaultUndergroundColor = Color.TRANSPARENT;\nconst defaultUndergroundColorAlphaByDistance = new NearFarScalar();\n\nfunction addDrawCommandsForTile(tileProvider, tile, frameState) {\n const surfaceTile = tile.data;\n\n if (!defined(surfaceTile.vertexArray)) {\n if (surfaceTile.fill === undefined) {\n // No fill was created for this tile, probably because this tile is not connected to\n // any renderable tiles. So create a simple tile in the middle of the tile's possible\n // height range.\n surfaceTile.fill = new TerrainFillMesh(tile);\n }\n surfaceTile.fill.update(tileProvider, frameState);\n }\n\n const creditDisplay = frameState.creditDisplay;\n\n const terrainData = surfaceTile.terrainData;\n if (defined(terrainData) && defined(terrainData.credits)) {\n const tileCredits = terrainData.credits;\n for (\n let tileCreditIndex = 0, tileCreditLength = tileCredits.length;\n tileCreditIndex < tileCreditLength;\n ++tileCreditIndex\n ) {\n creditDisplay.addCredit(tileCredits[tileCreditIndex]);\n }\n }\n\n let maxTextures = ContextLimits.maximumTextureImageUnits;\n\n let waterMaskTexture = surfaceTile.waterMaskTexture;\n let waterMaskTranslationAndScale = surfaceTile.waterMaskTranslationAndScale;\n if (!defined(waterMaskTexture) && defined(surfaceTile.fill)) {\n waterMaskTexture = surfaceTile.fill.waterMaskTexture;\n waterMaskTranslationAndScale =\n surfaceTile.fill.waterMaskTranslationAndScale;\n }\n\n const cameraUnderground = frameState.cameraUnderground;\n\n const globeTranslucencyState = frameState.globeTranslucencyState;\n const translucent = globeTranslucencyState.translucent;\n const frontFaceAlphaByDistance =\n globeTranslucencyState.frontFaceAlphaByDistance;\n const backFaceAlphaByDistance =\n globeTranslucencyState.backFaceAlphaByDistance;\n const translucencyRectangle = globeTranslucencyState.rectangle;\n\n const undergroundColor = defaultValue(\n tileProvider.undergroundColor,\n defaultUndergroundColor\n );\n const undergroundColorAlphaByDistance = defaultValue(\n tileProvider.undergroundColorAlphaByDistance,\n defaultUndergroundColorAlphaByDistance\n );\n const showUndergroundColor =\n isUndergroundVisible(tileProvider, frameState) &&\n frameState.mode === SceneMode.SCENE3D &&\n undergroundColor.alpha > 0.0 &&\n (undergroundColorAlphaByDistance.nearValue > 0.0 ||\n undergroundColorAlphaByDistance.farValue > 0.0);\n\n const lambertDiffuseMultiplier = tileProvider.lambertDiffuseMultiplier;\n\n const showReflectiveOcean =\n tileProvider.hasWaterMask && defined(waterMaskTexture);\n const oceanNormalMap = tileProvider.oceanNormalMap;\n const showOceanWaves = showReflectiveOcean && defined(oceanNormalMap);\n const hasVertexNormals =\n tileProvider.terrainProvider.ready &&\n tileProvider.terrainProvider.hasVertexNormals;\n const enableFog =\n frameState.fog.enabled && frameState.fog.renderable && !cameraUnderground;\n const showGroundAtmosphere =\n tileProvider.showGroundAtmosphere && frameState.mode === SceneMode.SCENE3D;\n const castShadows =\n ShadowMode.castShadows(tileProvider.shadows) && !translucent;\n const receiveShadows =\n ShadowMode.receiveShadows(tileProvider.shadows) && !translucent;\n\n const hueShift = tileProvider.hueShift;\n const saturationShift = tileProvider.saturationShift;\n const brightnessShift = tileProvider.brightnessShift;\n\n let colorCorrect = !(\n CesiumMath.equalsEpsilon(hueShift, 0.0, CesiumMath.EPSILON7) &&\n CesiumMath.equalsEpsilon(saturationShift, 0.0, CesiumMath.EPSILON7) &&\n CesiumMath.equalsEpsilon(brightnessShift, 0.0, CesiumMath.EPSILON7)\n );\n\n let perFragmentGroundAtmosphere = false;\n if (showGroundAtmosphere) {\n const cameraDistance = Cartesian3.magnitude(frameState.camera.positionWC);\n const fadeOutDistance = tileProvider.nightFadeOutDistance;\n perFragmentGroundAtmosphere = cameraDistance > fadeOutDistance;\n }\n\n if (showReflectiveOcean) {\n --maxTextures;\n }\n if (showOceanWaves) {\n --maxTextures;\n }\n if (\n defined(frameState.shadowState) &&\n frameState.shadowState.shadowsEnabled\n ) {\n --maxTextures;\n }\n if (\n defined(tileProvider.clippingPlanes) &&\n tileProvider.clippingPlanes.enabled\n ) {\n --maxTextures;\n }\n\n maxTextures -= globeTranslucencyState.numberOfTextureUniforms;\n\n const mesh = surfaceTile.renderedMesh;\n let rtc = mesh.center;\n const encoding = mesh.encoding;\n const tileBoundingRegion = surfaceTile.tileBoundingRegion;\n\n const exaggeration = frameState.terrainExaggeration;\n const exaggerationRelativeHeight =\n frameState.terrainExaggerationRelativeHeight;\n const hasExaggeration = exaggeration !== 1.0;\n const hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;\n\n // Not used in 3D.\n const tileRectangle = tileRectangleScratch;\n\n // Only used for Mercator projections.\n let southLatitude = 0.0;\n let northLatitude = 0.0;\n let southMercatorY = 0.0;\n let oneOverMercatorHeight = 0.0;\n\n let useWebMercatorProjection = false;\n\n if (frameState.mode !== SceneMode.SCENE3D) {\n const projection = frameState.mapProjection;\n const southwest = projection.project(\n Rectangle.southwest(tile.rectangle),\n southwestScratch\n );\n const northeast = projection.project(\n Rectangle.northeast(tile.rectangle),\n northeastScratch\n );\n\n tileRectangle.x = southwest.x;\n tileRectangle.y = southwest.y;\n tileRectangle.z = northeast.x;\n tileRectangle.w = northeast.y;\n\n // In 2D and Columbus View, use the center of the tile for RTC rendering.\n if (frameState.mode !== SceneMode.MORPHING) {\n rtc = rtcScratch;\n rtc.x = 0.0;\n rtc.y = (tileRectangle.z + tileRectangle.x) * 0.5;\n rtc.z = (tileRectangle.w + tileRectangle.y) * 0.5;\n tileRectangle.x -= rtc.y;\n tileRectangle.y -= rtc.z;\n tileRectangle.z -= rtc.y;\n tileRectangle.w -= rtc.z;\n }\n\n if (\n frameState.mode === SceneMode.SCENE2D &&\n encoding.quantization === TerrainQuantization.BITS12\n ) {\n // In 2D, the texture coordinates of the tile are interpolated over the rectangle to get the position in the vertex shader.\n // When the texture coordinates are quantized, error is introduced. This can be seen through the 1px wide cracking\n // between the quantized tiles in 2D. To compensate for the error, move the expand the rectangle in each direction by\n // half the error amount.\n const epsilon = (1.0 / (Math.pow(2.0, 12.0) - 1.0)) * 0.5;\n const widthEpsilon = (tileRectangle.z - tileRectangle.x) * epsilon;\n const heightEpsilon = (tileRectangle.w - tileRectangle.y) * epsilon;\n tileRectangle.x -= widthEpsilon;\n tileRectangle.y -= heightEpsilon;\n tileRectangle.z += widthEpsilon;\n tileRectangle.w += heightEpsilon;\n }\n\n if (projection instanceof WebMercatorProjection) {\n southLatitude = tile.rectangle.south;\n northLatitude = tile.rectangle.north;\n\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\n southLatitude\n );\n\n oneOverMercatorHeight =\n 1.0 /\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(northLatitude) -\n southMercatorY);\n\n useWebMercatorProjection = true;\n }\n }\n\n const surfaceShaderSetOptions = surfaceShaderSetOptionsScratch;\n surfaceShaderSetOptions.frameState = frameState;\n surfaceShaderSetOptions.surfaceTile = surfaceTile;\n surfaceShaderSetOptions.showReflectiveOcean = showReflectiveOcean;\n surfaceShaderSetOptions.showOceanWaves = showOceanWaves;\n surfaceShaderSetOptions.enableLighting = tileProvider.enableLighting;\n surfaceShaderSetOptions.dynamicAtmosphereLighting =\n tileProvider.dynamicAtmosphereLighting;\n surfaceShaderSetOptions.dynamicAtmosphereLightingFromSun =\n tileProvider.dynamicAtmosphereLightingFromSun;\n surfaceShaderSetOptions.showGroundAtmosphere = showGroundAtmosphere;\n surfaceShaderSetOptions.atmosphereLightIntensity =\n tileProvider.atmosphereLightIntensity;\n surfaceShaderSetOptions.atmosphereRayleighCoefficient =\n tileProvider.atmosphereRayleighCoefficient;\n surfaceShaderSetOptions.atmosphereMieCoefficient =\n tileProvider.atmosphereMieCoefficient;\n surfaceShaderSetOptions.atmosphereRayleighScaleHeight =\n tileProvider.atmosphereRayleighScaleHeight;\n surfaceShaderSetOptions.atmosphereMieScaleHeight =\n tileProvider.atmosphereMieScaleHeight;\n surfaceShaderSetOptions.atmosphereMieAnisotropy =\n tileProvider.atmosphereMieAnisotropy;\n surfaceShaderSetOptions.perFragmentGroundAtmosphere = perFragmentGroundAtmosphere;\n surfaceShaderSetOptions.hasVertexNormals = hasVertexNormals;\n surfaceShaderSetOptions.useWebMercatorProjection = useWebMercatorProjection;\n surfaceShaderSetOptions.clippedByBoundaries = surfaceTile.clippedByBoundaries;\n surfaceShaderSetOptions.hasGeodeticSurfaceNormals = hasGeodeticSurfaceNormals;\n surfaceShaderSetOptions.hasExaggeration = hasExaggeration;\n\n const tileImageryCollection = surfaceTile.imagery;\n let imageryIndex = 0;\n const imageryLen = tileImageryCollection.length;\n\n const showSkirts =\n tileProvider.showSkirts && !cameraUnderground && !translucent;\n const backFaceCulling =\n tileProvider.backFaceCulling && !cameraUnderground && !translucent;\n const firstPassRenderState = backFaceCulling\n ? tileProvider._renderState\n : tileProvider._disableCullingRenderState;\n const otherPassesRenderState = backFaceCulling\n ? tileProvider._blendRenderState\n : tileProvider._disableCullingBlendRenderState;\n let renderState = firstPassRenderState;\n\n let initialColor = tileProvider._firstPassInitialColor;\n\n const context = frameState.context;\n\n if (!defined(tileProvider._debug.boundingSphereTile)) {\n debugDestroyPrimitive();\n }\n\n const materialUniformMapChanged =\n tileProvider._materialUniformMap !== tileProvider.materialUniformMap;\n if (materialUniformMapChanged) {\n tileProvider._materialUniformMap = tileProvider.materialUniformMap;\n const drawCommandsLength = tileProvider._drawCommands.length;\n for (let i = 0; i < drawCommandsLength; ++i) {\n tileProvider._uniformMaps[i] = createTileUniformMap(\n frameState,\n tileProvider\n );\n }\n }\n\n do {\n let numberOfDayTextures = 0;\n\n let command;\n let uniformMap;\n\n if (tileProvider._drawCommands.length <= tileProvider._usedDrawCommands) {\n command = new DrawCommand();\n command.owner = tile;\n command.cull = false;\n command.boundingVolume = new BoundingSphere();\n command.orientedBoundingBox = undefined;\n\n uniformMap = createTileUniformMap(frameState, tileProvider);\n\n tileProvider._drawCommands.push(command);\n tileProvider._uniformMaps.push(uniformMap);\n } else {\n command = tileProvider._drawCommands[tileProvider._usedDrawCommands];\n uniformMap = tileProvider._uniformMaps[tileProvider._usedDrawCommands];\n }\n\n command.owner = tile;\n\n ++tileProvider._usedDrawCommands;\n\n if (tile === tileProvider._debug.boundingSphereTile) {\n const obb = tileBoundingRegion.boundingVolume;\n const boundingSphere = tileBoundingRegion.boundingSphere;\n // If a debug primitive already exists for this tile, it will not be\n // re-created, to avoid allocation every frame. If it were possible\n // to have more than one selected tile, this would have to change.\n if (defined(obb)) {\n getDebugOrientedBoundingBox(obb, Color.RED).update(frameState);\n } else if (defined(boundingSphere)) {\n getDebugBoundingSphere(boundingSphere, Color.RED).update(frameState);\n }\n }\n\n const uniformMapProperties = uniformMap.properties;\n Cartesian4.clone(initialColor, uniformMapProperties.initialColor);\n uniformMapProperties.oceanNormalMap = oceanNormalMap;\n uniformMapProperties.lightingFadeDistance.x =\n tileProvider.lightingFadeOutDistance;\n uniformMapProperties.lightingFadeDistance.y =\n tileProvider.lightingFadeInDistance;\n uniformMapProperties.nightFadeDistance.x =\n tileProvider.nightFadeOutDistance;\n uniformMapProperties.nightFadeDistance.y = tileProvider.nightFadeInDistance;\n uniformMapProperties.atmosphereLightIntensity =\n tileProvider.atmosphereLightIntensity;\n uniformMapProperties.atmosphereRayleighCoefficient =\n tileProvider.atmosphereRayleighCoefficient;\n uniformMapProperties.atmosphereMieCoefficient =\n tileProvider.atmosphereMieCoefficient;\n uniformMapProperties.atmosphereRayleighScaleHeight =\n tileProvider.atmosphereRayleighScaleHeight;\n uniformMapProperties.atmosphereMieScaleHeight =\n tileProvider.atmosphereMieScaleHeight;\n uniformMapProperties.atmosphereMieAnisotropy =\n tileProvider.atmosphereMieAnisotropy;\n uniformMapProperties.zoomedOutOceanSpecularIntensity =\n tileProvider.zoomedOutOceanSpecularIntensity;\n\n const frontFaceAlphaByDistanceFinal = cameraUnderground\n ? backFaceAlphaByDistance\n : frontFaceAlphaByDistance;\n const backFaceAlphaByDistanceFinal = cameraUnderground\n ? frontFaceAlphaByDistance\n : backFaceAlphaByDistance;\n\n if (defined(frontFaceAlphaByDistanceFinal)) {\n Cartesian4.fromElements(\n frontFaceAlphaByDistanceFinal.near,\n frontFaceAlphaByDistanceFinal.nearValue,\n frontFaceAlphaByDistanceFinal.far,\n frontFaceAlphaByDistanceFinal.farValue,\n uniformMapProperties.frontFaceAlphaByDistance\n );\n Cartesian4.fromElements(\n backFaceAlphaByDistanceFinal.near,\n backFaceAlphaByDistanceFinal.nearValue,\n backFaceAlphaByDistanceFinal.far,\n backFaceAlphaByDistanceFinal.farValue,\n uniformMapProperties.backFaceAlphaByDistance\n );\n }\n\n Cartesian4.fromElements(\n undergroundColorAlphaByDistance.near,\n undergroundColorAlphaByDistance.nearValue,\n undergroundColorAlphaByDistance.far,\n undergroundColorAlphaByDistance.farValue,\n uniformMapProperties.undergroundColorAlphaByDistance\n );\n Color.clone(undergroundColor, uniformMapProperties.undergroundColor);\n\n uniformMapProperties.lambertDiffuseMultiplier = lambertDiffuseMultiplier;\n\n const highlightFillTile =\n !defined(surfaceTile.vertexArray) &&\n defined(tileProvider.fillHighlightColor) &&\n tileProvider.fillHighlightColor.alpha > 0.0;\n if (highlightFillTile) {\n Color.clone(\n tileProvider.fillHighlightColor,\n uniformMapProperties.fillHighlightColor\n );\n }\n\n uniformMapProperties.terrainExaggerationAndRelativeHeight.x = exaggeration;\n uniformMapProperties.terrainExaggerationAndRelativeHeight.y = exaggerationRelativeHeight;\n\n uniformMapProperties.center3D = mesh.center;\n Cartesian3.clone(rtc, uniformMapProperties.rtc);\n\n Cartesian4.clone(tileRectangle, uniformMapProperties.tileRectangle);\n uniformMapProperties.southAndNorthLatitude.x = southLatitude;\n uniformMapProperties.southAndNorthLatitude.y = northLatitude;\n uniformMapProperties.southMercatorYAndOneOverHeight.x = southMercatorY;\n uniformMapProperties.southMercatorYAndOneOverHeight.y = oneOverMercatorHeight;\n\n // Convert tile limiter rectangle from cartographic to texture space using the tileRectangle.\n const localizedCartographicLimitRectangle = localizedCartographicLimitRectangleScratch;\n const cartographicLimitRectangle = clipRectangleAntimeridian(\n tile.rectangle,\n tileProvider.cartographicLimitRectangle\n );\n\n const localizedTranslucencyRectangle = localizedTranslucencyRectangleScratch;\n const clippedTranslucencyRectangle = clipRectangleAntimeridian(\n tile.rectangle,\n translucencyRectangle\n );\n\n Cartesian3.fromElements(\n hueShift,\n saturationShift,\n brightnessShift,\n uniformMapProperties.hsbShift\n );\n\n const cartographicTileRectangle = tile.rectangle;\n const inverseTileWidth = 1.0 / cartographicTileRectangle.width;\n const inverseTileHeight = 1.0 / cartographicTileRectangle.height;\n localizedCartographicLimitRectangle.x =\n (cartographicLimitRectangle.west - cartographicTileRectangle.west) *\n inverseTileWidth;\n localizedCartographicLimitRectangle.y =\n (cartographicLimitRectangle.south - cartographicTileRectangle.south) *\n inverseTileHeight;\n localizedCartographicLimitRectangle.z =\n (cartographicLimitRectangle.east - cartographicTileRectangle.west) *\n inverseTileWidth;\n localizedCartographicLimitRectangle.w =\n (cartographicLimitRectangle.north - cartographicTileRectangle.south) *\n inverseTileHeight;\n\n Cartesian4.clone(\n localizedCartographicLimitRectangle,\n uniformMapProperties.localizedCartographicLimitRectangle\n );\n\n localizedTranslucencyRectangle.x =\n (clippedTranslucencyRectangle.west - cartographicTileRectangle.west) *\n inverseTileWidth;\n localizedTranslucencyRectangle.y =\n (clippedTranslucencyRectangle.south - cartographicTileRectangle.south) *\n inverseTileHeight;\n localizedTranslucencyRectangle.z =\n (clippedTranslucencyRectangle.east - cartographicTileRectangle.west) *\n inverseTileWidth;\n localizedTranslucencyRectangle.w =\n (clippedTranslucencyRectangle.north - cartographicTileRectangle.south) *\n inverseTileHeight;\n\n Cartesian4.clone(\n localizedTranslucencyRectangle,\n uniformMapProperties.localizedTranslucencyRectangle\n );\n\n // For performance, use fog in the shader only when the tile is in fog.\n const applyFog =\n enableFog &&\n CesiumMath.fog(tile._distance, frameState.fog.density) >\n CesiumMath.EPSILON3;\n colorCorrect = colorCorrect && (applyFog || showGroundAtmosphere);\n\n let applyBrightness = false;\n let applyContrast = false;\n let applyHue = false;\n let applySaturation = false;\n let applyGamma = false;\n let applyAlpha = false;\n let applyDayNightAlpha = false;\n let applySplit = false;\n let applyCutout = false;\n let applyColorToAlpha = false;\n\n while (numberOfDayTextures < maxTextures && imageryIndex < imageryLen) {\n const tileImagery = tileImageryCollection[imageryIndex];\n const imagery = tileImagery.readyImagery;\n ++imageryIndex;\n\n if (!defined(imagery) || imagery.imageryLayer.alpha === 0.0) {\n continue;\n }\n\n const texture = tileImagery.useWebMercatorT\n ? imagery.textureWebMercator\n : imagery.texture;\n\n const imageryLayer = imagery.imageryLayer;\n\n if (!defined(tileImagery.textureTranslationAndScale)) {\n tileImagery.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(\n tile,\n tileImagery\n );\n }\n\n uniformMapProperties.dayTextures[numberOfDayTextures] = texture;\n uniformMapProperties.dayTextureTranslationAndScale[numberOfDayTextures] =\n tileImagery.textureTranslationAndScale;\n uniformMapProperties.dayTextureTexCoordsRectangle[numberOfDayTextures] =\n tileImagery.textureCoordinateRectangle;\n uniformMapProperties.dayTextureUseWebMercatorT[numberOfDayTextures] =\n tileImagery.useWebMercatorT;\n\n uniformMapProperties.dayTextureAlpha[numberOfDayTextures] =\n imageryLayer.alpha;\n applyAlpha =\n applyAlpha ||\n uniformMapProperties.dayTextureAlpha[numberOfDayTextures] !== 1.0;\n\n uniformMapProperties.dayTextureNightAlpha[numberOfDayTextures] =\n imageryLayer.nightAlpha;\n applyDayNightAlpha =\n applyDayNightAlpha ||\n uniformMapProperties.dayTextureNightAlpha[numberOfDayTextures] !== 1.0;\n\n uniformMapProperties.dayTextureDayAlpha[numberOfDayTextures] =\n imageryLayer.dayAlpha;\n applyDayNightAlpha =\n applyDayNightAlpha ||\n uniformMapProperties.dayTextureDayAlpha[numberOfDayTextures] !== 1.0;\n\n uniformMapProperties.dayTextureBrightness[numberOfDayTextures] =\n imageryLayer.brightness;\n applyBrightness =\n applyBrightness ||\n uniformMapProperties.dayTextureBrightness[numberOfDayTextures] !==\n ImageryLayer.DEFAULT_BRIGHTNESS;\n\n uniformMapProperties.dayTextureContrast[numberOfDayTextures] =\n imageryLayer.contrast;\n applyContrast =\n applyContrast ||\n uniformMapProperties.dayTextureContrast[numberOfDayTextures] !==\n ImageryLayer.DEFAULT_CONTRAST;\n\n uniformMapProperties.dayTextureHue[numberOfDayTextures] =\n imageryLayer.hue;\n applyHue =\n applyHue ||\n uniformMapProperties.dayTextureHue[numberOfDayTextures] !==\n ImageryLayer.DEFAULT_HUE;\n\n uniformMapProperties.dayTextureSaturation[numberOfDayTextures] =\n imageryLayer.saturation;\n applySaturation =\n applySaturation ||\n uniformMapProperties.dayTextureSaturation[numberOfDayTextures] !==\n ImageryLayer.DEFAULT_SATURATION;\n\n uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] =\n 1.0 / imageryLayer.gamma;\n applyGamma =\n applyGamma ||\n uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] !==\n 1.0 / ImageryLayer.DEFAULT_GAMMA;\n\n uniformMapProperties.dayTextureSplit[numberOfDayTextures] =\n imageryLayer.splitDirection;\n applySplit =\n applySplit ||\n uniformMapProperties.dayTextureSplit[numberOfDayTextures] !== 0.0;\n\n // Update cutout rectangle\n let dayTextureCutoutRectangle =\n uniformMapProperties.dayTextureCutoutRectangles[numberOfDayTextures];\n if (!defined(dayTextureCutoutRectangle)) {\n dayTextureCutoutRectangle = uniformMapProperties.dayTextureCutoutRectangles[\n numberOfDayTextures\n ] = new Cartesian4();\n }\n\n Cartesian4.clone(Cartesian4.ZERO, dayTextureCutoutRectangle);\n if (defined(imageryLayer.cutoutRectangle)) {\n const cutoutRectangle = clipRectangleAntimeridian(\n cartographicTileRectangle,\n imageryLayer.cutoutRectangle\n );\n const intersection = Rectangle.simpleIntersection(\n cutoutRectangle,\n cartographicTileRectangle,\n rectangleIntersectionScratch\n );\n applyCutout = defined(intersection) || applyCutout;\n\n dayTextureCutoutRectangle.x =\n (cutoutRectangle.west - cartographicTileRectangle.west) *\n inverseTileWidth;\n dayTextureCutoutRectangle.y =\n (cutoutRectangle.south - cartographicTileRectangle.south) *\n inverseTileHeight;\n dayTextureCutoutRectangle.z =\n (cutoutRectangle.east - cartographicTileRectangle.west) *\n inverseTileWidth;\n dayTextureCutoutRectangle.w =\n (cutoutRectangle.north - cartographicTileRectangle.south) *\n inverseTileHeight;\n }\n\n // Update color to alpha\n let colorToAlpha =\n uniformMapProperties.colorsToAlpha[numberOfDayTextures];\n if (!defined(colorToAlpha)) {\n colorToAlpha = uniformMapProperties.colorsToAlpha[\n numberOfDayTextures\n ] = new Cartesian4();\n }\n\n const hasColorToAlpha =\n defined(imageryLayer.colorToAlpha) &&\n imageryLayer.colorToAlphaThreshold > 0.0;\n applyColorToAlpha = applyColorToAlpha || hasColorToAlpha;\n\n if (hasColorToAlpha) {\n const color = imageryLayer.colorToAlpha;\n colorToAlpha.x = color.red;\n colorToAlpha.y = color.green;\n colorToAlpha.z = color.blue;\n colorToAlpha.w = imageryLayer.colorToAlphaThreshold;\n } else {\n colorToAlpha.w = -1.0;\n }\n\n if (defined(imagery.credits)) {\n const credits = imagery.credits;\n for (\n let creditIndex = 0, creditLength = credits.length;\n creditIndex < creditLength;\n ++creditIndex\n ) {\n creditDisplay.addCredit(credits[creditIndex]);\n }\n }\n\n ++numberOfDayTextures;\n }\n\n // trim texture array to the used length so we don't end up using old textures\n // which might get destroyed eventually\n uniformMapProperties.dayTextures.length = numberOfDayTextures;\n uniformMapProperties.waterMask = waterMaskTexture;\n Cartesian4.clone(\n waterMaskTranslationAndScale,\n uniformMapProperties.waterMaskTranslationAndScale\n );\n\n uniformMapProperties.minMaxHeight.x = encoding.minimumHeight;\n uniformMapProperties.minMaxHeight.y = encoding.maximumHeight;\n Matrix4.clone(encoding.matrix, uniformMapProperties.scaleAndBias);\n\n // update clipping planes\n const clippingPlanes = tileProvider._clippingPlanes;\n const clippingPlanesEnabled =\n defined(clippingPlanes) && clippingPlanes.enabled && tile.isClipped;\n if (clippingPlanesEnabled) {\n uniformMapProperties.clippingPlanesEdgeColor = Color.clone(\n clippingPlanes.edgeColor,\n uniformMapProperties.clippingPlanesEdgeColor\n );\n uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth;\n }\n\n surfaceShaderSetOptions.numberOfDayTextures = numberOfDayTextures;\n surfaceShaderSetOptions.applyBrightness = applyBrightness;\n surfaceShaderSetOptions.applyContrast = applyContrast;\n surfaceShaderSetOptions.applyHue = applyHue;\n surfaceShaderSetOptions.applySaturation = applySaturation;\n surfaceShaderSetOptions.applyGamma = applyGamma;\n surfaceShaderSetOptions.applyAlpha = applyAlpha;\n surfaceShaderSetOptions.applyDayNightAlpha = applyDayNightAlpha;\n surfaceShaderSetOptions.applySplit = applySplit;\n surfaceShaderSetOptions.enableFog = applyFog;\n surfaceShaderSetOptions.enableClippingPlanes = clippingPlanesEnabled;\n surfaceShaderSetOptions.clippingPlanes = clippingPlanes;\n surfaceShaderSetOptions.hasImageryLayerCutout = applyCutout;\n surfaceShaderSetOptions.colorCorrect = colorCorrect;\n surfaceShaderSetOptions.highlightFillTile = highlightFillTile;\n surfaceShaderSetOptions.colorToAlpha = applyColorToAlpha;\n surfaceShaderSetOptions.showUndergroundColor = showUndergroundColor;\n surfaceShaderSetOptions.translucent = translucent;\n\n let count = surfaceTile.renderedMesh.indices.length;\n if (!showSkirts) {\n count = surfaceTile.renderedMesh.indexCountWithoutSkirts;\n }\n\n command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(\n surfaceShaderSetOptions\n );\n command.castShadows = castShadows;\n command.receiveShadows = receiveShadows;\n command.renderState = renderState;\n command.primitiveType = PrimitiveType.TRIANGLES;\n command.vertexArray =\n surfaceTile.vertexArray || surfaceTile.fill.vertexArray;\n command.count = count;\n command.uniformMap = uniformMap;\n command.pass = Pass.GLOBE;\n\n if (tileProvider._debug.wireframe) {\n createWireframeVertexArrayIfNecessary(context, tileProvider, tile);\n if (defined(surfaceTile.wireframeVertexArray)) {\n command.vertexArray = surfaceTile.wireframeVertexArray;\n command.primitiveType = PrimitiveType.LINES;\n command.count = count * 2;\n }\n }\n\n let boundingVolume = command.boundingVolume;\n const orientedBoundingBox = command.orientedBoundingBox;\n\n if (frameState.mode !== SceneMode.SCENE3D) {\n BoundingSphere.fromRectangleWithHeights2D(\n tile.rectangle,\n frameState.mapProjection,\n tileBoundingRegion.minimumHeight,\n tileBoundingRegion.maximumHeight,\n boundingVolume\n );\n Cartesian3.fromElements(\n boundingVolume.center.z,\n boundingVolume.center.x,\n boundingVolume.center.y,\n boundingVolume.center\n );\n\n if (frameState.mode === SceneMode.MORPHING) {\n boundingVolume = BoundingSphere.union(\n tileBoundingRegion.boundingSphere,\n boundingVolume,\n boundingVolume\n );\n }\n } else {\n command.boundingVolume = BoundingSphere.clone(\n tileBoundingRegion.boundingSphere,\n boundingVolume\n );\n command.orientedBoundingBox = OrientedBoundingBox.clone(\n tileBoundingRegion.boundingVolume,\n orientedBoundingBox\n );\n }\n\n command.dirty = true;\n\n if (translucent) {\n globeTranslucencyState.updateDerivedCommands(command, frameState);\n }\n\n pushCommand(command, frameState);\n\n renderState = otherPassesRenderState;\n initialColor = otherPassesInitialColor;\n } while (imageryIndex < imageryLen);\n}\nexport default GlobeSurfaceTileProvider;\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\n\n/**\n * Properties for controlling globe translucency.\n *\n * @alias GlobeTranslucency\n * @constructor\n */\nfunction GlobeTranslucency() {\n this._enabled = false;\n this._frontFaceAlpha = 1.0;\n this._frontFaceAlphaByDistance = undefined;\n this._backFaceAlpha = 1.0;\n this._backFaceAlphaByDistance = undefined;\n this._rectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n}\n\nObject.defineProperties(GlobeTranslucency.prototype, {\n /**\n * When true, the globe is rendered as a translucent surface.\n * <br /><br />\n * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},\n * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by\n * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and\n * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.\n * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry\n * is considered front facing.\n * <br /><br />\n * Translucency is disabled by default.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {Boolean}\n * @default false\n *\n * @see GlobeTranslucency#frontFaceAlpha\n * @see GlobeTranslucency#frontFaceAlphaByDistance\n * @see GlobeTranslucency#backFaceAlpha\n * @see GlobeTranslucency#backFaceAlphaByDistance\n */\n enabled: {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\nthis._enabled = value;\n },\n },\n\n /**\n * A constant translucency to apply to front faces of the globe.\n * <br /><br />\n * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {Number}\n * @default 1.0\n *\n * @see GlobeTranslucency#enabled\n * @see GlobeTranslucency#frontFaceAlphaByDistance\n *\n * @example\n * // Set front face translucency to 0.5.\n * globe.translucency.frontFaceAlpha = 0.5;\n * globe.translucency.enabled = true;\n */\n frontFaceAlpha: {\n get: function () {\n return this._frontFaceAlpha;\n },\n set: function (value) {\nthis._frontFaceAlpha = value;\n },\n },\n /**\n * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.\n * The translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,\n * frontFaceAlphaByDistance will be disabled.\n * <br /><br />\n * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {NearFarScalar}\n * @default undefined\n *\n * @see GlobeTranslucency#enabled\n * @see GlobeTranslucency#frontFaceAlpha\n *\n * @example\n * // Example 1.\n * // Set front face translucency to 0.5 when the\n * // camera is 1500 meters from the surface and 1.0\n * // as the camera distance approaches 8.0e6 meters.\n * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);\n * globe.translucency.enabled = true;\n *\n * @example\n * // Example 2.\n * // Disable front face translucency by distance\n * globe.translucency.frontFaceAlphaByDistance = undefined;\n */\n frontFaceAlphaByDistance: {\n get: function () {\n return this._frontFaceAlphaByDistance;\n },\n set: function (value) {\nthis._frontFaceAlphaByDistance = NearFarScalar.clone(\n value,\n this._frontFaceAlphaByDistance\n );\n },\n },\n\n /**\n * A constant translucency to apply to back faces of the globe.\n * <br /><br />\n * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {Number}\n * @default 1.0\n *\n * @see GlobeTranslucency#enabled\n * @see GlobeTranslucency#backFaceAlphaByDistance\n *\n * @example\n * // Set back face translucency to 0.5.\n * globe.translucency.backFaceAlpha = 0.5;\n * globe.translucency.enabled = true;\n */\n backFaceAlpha: {\n get: function () {\n return this._backFaceAlpha;\n },\n set: function (value) {\nthis._backFaceAlpha = value;\n },\n },\n /**\n * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.\n * The translucency will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,\n * backFaceAlphaByDistance will be disabled.\n * <br /><br />\n * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {NearFarScalar}\n * @default undefined\n *\n * @see GlobeTranslucency#enabled\n * @see GlobeTranslucency#backFaceAlpha\n *\n * @example\n * // Example 1.\n * // Set back face translucency to 0.5 when the\n * // camera is 1500 meters from the surface and 1.0\n * // as the camera distance approaches 8.0e6 meters.\n * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);\n * globe.translucency.enabled = true;\n *\n * @example\n * // Example 2.\n * // Disable back face translucency by distance\n * globe.translucency.backFaceAlphaByDistance = undefined;\n */\n backFaceAlphaByDistance: {\n get: function () {\n return this._backFaceAlphaByDistance;\n },\n set: function (value) {\nthis._backFaceAlphaByDistance = NearFarScalar.clone(\n value,\n this._backFaceAlphaByDistance\n );\n },\n },\n\n /**\n * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.\n * Defaults to the maximum extent of cartographic coordinates.\n *\n * @memberof GlobeTranslucency.prototype\n *\n * @type {Rectangle}\n * @default {@link Rectangle.MAX_VALUE}\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n set: function (value) {\n if (!defined(value)) {\n value = Rectangle.clone(Rectangle.MAX_VALUE);\n }\n Rectangle.clone(value, this._rectangle);\n },\n },\n});\n\nexport default GlobeTranslucency;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport ImageryLayer from \"./ImageryLayer.js\";\n\n/**\n * An ordered collection of imagery layers.\n *\n * @alias ImageryLayerCollection\n * @constructor\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Adjustment.html|Cesium Sandcastle Imagery Adjustment Demo}\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html|Cesium Sandcastle Imagery Manipulation Demo}\n */\nfunction ImageryLayerCollection() {\n this._layers = [];\n\n /**\n * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that\n * was added and the index at which it was added.\n * @type {Event}\n * @default Event()\n */\n this.layerAdded = new Event();\n\n /**\n * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that\n * was removed and the index from which it was removed.\n * @type {Event}\n * @default Event()\n */\n this.layerRemoved = new Event();\n\n /**\n * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that\n * was moved, its new index after the move, and its old index prior to the move.\n * @type {Event}\n * @default Event()\n */\n this.layerMoved = new Event();\n\n /**\n * An event that is raised when a layer is shown or hidden by setting the\n * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,\n * the index of the layer in the collection, and a flag that is true if the layer is now\n * shown or false if it is now hidden.\n *\n * @type {Event}\n * @default Event()\n */\n this.layerShownOrHidden = new Event();\n}\n\nObject.defineProperties(ImageryLayerCollection.prototype, {\n /**\n * Gets the number of layers in this collection.\n * @memberof ImageryLayerCollection.prototype\n * @type {Number}\n */\n length: {\n get: function () {\n return this._layers.length;\n },\n },\n});\n\n/**\n * Adds a layer to the collection.\n *\n * @param {ImageryLayer} layer the layer to add.\n * @param {Number} [index] the index to add the layer at. If omitted, the layer will\n * be added on top of all existing layers.\n *\n * @exception {DeveloperError} index, if supplied, must be greater than or equal to zero and less than or equal to the number of the layers.\n */\nImageryLayerCollection.prototype.add = function (layer, index) {\n const hasIndex = defined(index);\n\n if (!hasIndex) {\n index = this._layers.length;\n this._layers.push(layer);\n } else {\n this._layers.splice(index, 0, layer);\n }\n\n this._update();\n this.layerAdded.raiseEvent(layer, index);\n};\n\n/**\n * Creates a new layer using the given ImageryProvider and adds it to the collection.\n *\n * @param {ImageryProvider} imageryProvider the imagery provider to create a new layer for.\n * @param {Number} [index] the index to add the layer at. If omitted, the layer will\n * added on top of all existing layers.\n * @returns {ImageryLayer} The newly created layer.\n */\nImageryLayerCollection.prototype.addImageryProvider = function (\n imageryProvider,\n index\n) {\n const layer = new ImageryLayer(imageryProvider);\n this.add(layer, index);\n return layer;\n};\n\n/**\n * Removes a layer from this collection, if present.\n *\n * @param {ImageryLayer} layer The layer to remove.\n * @param {Boolean} [destroy=true] whether to destroy the layers in addition to removing them.\n * @returns {Boolean} true if the layer was in the collection and was removed,\n * false if the layer was not in the collection.\n */\nImageryLayerCollection.prototype.remove = function (layer, destroy) {\n destroy = defaultValue(destroy, true);\n\n const index = this._layers.indexOf(layer);\n if (index !== -1) {\n this._layers.splice(index, 1);\n\n this._update();\n\n this.layerRemoved.raiseEvent(layer, index);\n\n if (destroy) {\n layer.destroy();\n }\n\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all layers from this collection.\n *\n * @param {Boolean} [destroy=true] whether to destroy the layers in addition to removing them.\n */\nImageryLayerCollection.prototype.removeAll = function (destroy) {\n destroy = defaultValue(destroy, true);\n\n const layers = this._layers;\n for (let i = 0, len = layers.length; i < len; i++) {\n const layer = layers[i];\n this.layerRemoved.raiseEvent(layer, i);\n\n if (destroy) {\n layer.destroy();\n }\n }\n\n this._layers = [];\n};\n\n/**\n * Checks to see if the collection contains a given layer.\n *\n * @param {ImageryLayer} layer the layer to check for.\n *\n * @returns {Boolean} true if the collection contains the layer, false otherwise.\n */\nImageryLayerCollection.prototype.contains = function (layer) {\n return this.indexOf(layer) !== -1;\n};\n\n/**\n * Determines the index of a given layer in the collection.\n *\n * @param {ImageryLayer} layer The layer to find the index of.\n *\n * @returns {Number} The index of the layer in the collection, or -1 if the layer does not exist in the collection.\n */\nImageryLayerCollection.prototype.indexOf = function (layer) {\n return this._layers.indexOf(layer);\n};\n\n/**\n * Gets a layer by index from the collection.\n *\n * @param {Number} index the index to retrieve.\n *\n * @returns {ImageryLayer} The imagery layer at the given index.\n */\nImageryLayerCollection.prototype.get = function (index) {\n return this._layers[index];\n};\n\nfunction getLayerIndex(layers, layer) {\n const index = layers.indexOf(layer);\n\n return index;\n}\n\nfunction swapLayers(collection, i, j) {\n const arr = collection._layers;\n i = CesiumMath.clamp(i, 0, arr.length - 1);\n j = CesiumMath.clamp(j, 0, arr.length - 1);\n\n if (i === j) {\n return;\n }\n\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n\n collection._update();\n\n collection.layerMoved.raiseEvent(temp, j, i);\n}\n\n/**\n * Raises a layer up one position in the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.raise = function (layer) {\n const index = getLayerIndex(this._layers, layer);\n swapLayers(this, index, index + 1);\n};\n\n/**\n * Lowers a layer down one position in the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.lower = function (layer) {\n const index = getLayerIndex(this._layers, layer);\n swapLayers(this, index, index - 1);\n};\n\n/**\n * Raises a layer to the top of the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.raiseToTop = function (layer) {\n const index = getLayerIndex(this._layers, layer);\n if (index === this._layers.length - 1) {\n return;\n }\n this._layers.splice(index, 1);\n this._layers.push(layer);\n\n this._update();\n\n this.layerMoved.raiseEvent(layer, this._layers.length - 1, index);\n};\n\n/**\n * Lowers a layer to the bottom of the collection.\n *\n * @param {ImageryLayer} layer the layer to move.\n *\n * @exception {DeveloperError} layer is not in this collection.\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n */\nImageryLayerCollection.prototype.lowerToBottom = function (layer) {\n const index = getLayerIndex(this._layers, layer);\n if (index === 0) {\n return;\n }\n this._layers.splice(index, 1);\n this._layers.splice(0, 0, layer);\n\n this._update();\n\n this.layerMoved.raiseEvent(layer, 0, index);\n};\n\nconst applicableRectangleScratch = new Rectangle();\n\nfunction pickImageryHelper(scene, pickedLocation, pickFeatures, callback) {\n // Find the terrain tile containing the picked location.\n const tilesToRender = scene.globe._surface._tilesToRender;\n let pickedTile;\n\n for (\n let textureIndex = 0;\n !defined(pickedTile) && textureIndex < tilesToRender.length;\n ++textureIndex\n ) {\n const tile = tilesToRender[textureIndex];\n if (Rectangle.contains(tile.rectangle, pickedLocation)) {\n pickedTile = tile;\n }\n }\n\n if (!defined(pickedTile)) {\n return;\n }\n\n // Pick against all attached imagery tiles containing the pickedLocation.\n const imageryTiles = pickedTile.data.imagery;\n\n for (let i = imageryTiles.length - 1; i >= 0; --i) {\n const terrainImagery = imageryTiles[i];\n const imagery = terrainImagery.readyImagery;\n if (!defined(imagery)) {\n continue;\n }\n const provider = imagery.imageryLayer.imageryProvider;\n if (pickFeatures && !defined(provider.pickFeatures)) {\n continue;\n }\n\n if (!Rectangle.contains(imagery.rectangle, pickedLocation)) {\n continue;\n }\n\n // If this imagery came from a parent, it may not be applicable to its entire rectangle.\n // Check the textureCoordinateRectangle.\n const applicableRectangle = applicableRectangleScratch;\n\n const epsilon = 1 / 1024; // 1/4 of a pixel in a typical 256x256 tile.\n applicableRectangle.west = CesiumMath.lerp(\n pickedTile.rectangle.west,\n pickedTile.rectangle.east,\n terrainImagery.textureCoordinateRectangle.x - epsilon\n );\n applicableRectangle.east = CesiumMath.lerp(\n pickedTile.rectangle.west,\n pickedTile.rectangle.east,\n terrainImagery.textureCoordinateRectangle.z + epsilon\n );\n applicableRectangle.south = CesiumMath.lerp(\n pickedTile.rectangle.south,\n pickedTile.rectangle.north,\n terrainImagery.textureCoordinateRectangle.y - epsilon\n );\n applicableRectangle.north = CesiumMath.lerp(\n pickedTile.rectangle.south,\n pickedTile.rectangle.north,\n terrainImagery.textureCoordinateRectangle.w + epsilon\n );\n if (!Rectangle.contains(applicableRectangle, pickedLocation)) {\n continue;\n }\n\n callback(imagery);\n }\n}\n\n/**\n * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a\n * location on the screen, use {@link Camera.getPickRay}.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @return {ImageryLayer[]|undefined} An array that includes all of\n * the layers that are intersected by a given pick ray. Undefined if\n * no layers are selected.\n *\n */\nImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) {\n // Find the picked location on the globe.\n const pickedPosition = scene.globe.pick(ray, scene);\n if (!defined(pickedPosition)) {\n return;\n }\n\n const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(\n pickedPosition\n );\n\n const imageryLayers = [];\n\n pickImageryHelper(scene, pickedLocation, false, function (imagery) {\n imageryLayers.push(imagery.imageryLayer);\n });\n\n if (imageryLayers.length === 0) {\n return undefined;\n }\n\n return imageryLayers;\n};\n\n/**\n * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery\n * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected\n * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise that resolves to an array of features intersected by the pick ray.\n * If it can be quickly determined that no features are intersected (for example,\n * because no active imagery providers support {@link ImageryProvider#pickFeatures}\n * or because the pick ray does not intersect the surface), this function will\n * return undefined.\n *\n * @example\n * const pickRay = viewer.camera.getPickRay(windowPosition);\n * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);\n * if (!Cesium.defined(featuresPromise)) {\n * console.log('No features picked.');\n * } else {\n * Promise.resolve(featuresPromise).then(function(features) {\n * // This function is called asynchronously when the list if picked features is available.\n * console.log(`Number of features: ${features.length}`);\n * if (features.length > 0) {\n * console.log(`First feature name: ${features[0].name}`);\n * }\n * });\n * }\n */\nImageryLayerCollection.prototype.pickImageryLayerFeatures = function (\n ray,\n scene\n) {\n // Find the picked location on the globe.\n const pickedPosition = scene.globe.pick(ray, scene);\n if (!defined(pickedPosition)) {\n return;\n }\n\n const pickedLocation = scene.globe.ellipsoid.cartesianToCartographic(\n pickedPosition\n );\n\n const promises = [];\n const imageryLayers = [];\n\n pickImageryHelper(scene, pickedLocation, true, function (imagery) {\n const provider = imagery.imageryLayer.imageryProvider;\n const promise = provider.pickFeatures(\n imagery.x,\n imagery.y,\n imagery.level,\n pickedLocation.longitude,\n pickedLocation.latitude\n );\n if (defined(promise)) {\n promises.push(promise);\n imageryLayers.push(imagery.imageryLayer);\n }\n });\n\n if (promises.length === 0) {\n return undefined;\n }\n return Promise.all(promises).then(function (results) {\n const features = [];\n for (let resultIndex = 0; resultIndex < results.length; ++resultIndex) {\n const result = results[resultIndex];\n const image = imageryLayers[resultIndex];\n if (defined(result) && result.length > 0) {\n for (\n let featureIndex = 0;\n featureIndex < result.length;\n ++featureIndex\n ) {\n const feature = result[featureIndex];\n feature.imageryLayer = image;\n // For features without a position, use the picked location.\n if (!defined(feature.position)) {\n feature.position = pickedLocation;\n }\n features.push(feature);\n }\n }\n }\n return features;\n });\n};\n\n/**\n * Updates frame state to execute any queued texture re-projections.\n *\n * @private\n *\n * @param {FrameState} frameState The frameState.\n */\nImageryLayerCollection.prototype.queueReprojectionCommands = function (\n frameState\n) {\n const layers = this._layers;\n for (let i = 0, len = layers.length; i < len; ++i) {\n layers[i].queueReprojectionCommands(frameState);\n }\n};\n\n/**\n * Cancels re-projection commands queued for the next frame.\n *\n * @private\n */\nImageryLayerCollection.prototype.cancelReprojections = function () {\n const layers = this._layers;\n for (let i = 0, len = layers.length; i < len; ++i) {\n layers[i].cancelReprojections();\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} true if this object was destroyed; otherwise, false.\n *\n * @see ImageryLayerCollection#destroy\n */\nImageryLayerCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this\n * object allows for deterministic release of WebGL resources, instead of relying on the garbage\n * collector.\n * <br /><br />\n * Once this object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * layerCollection = layerCollection && layerCollection.destroy();\n *\n * @see ImageryLayerCollection#isDestroyed\n */\nImageryLayerCollection.prototype.destroy = function () {\n this.removeAll(true);\n return destroyObject(this);\n};\n\nImageryLayerCollection.prototype._update = function () {\n let isBaseLayer = true;\n const layers = this._layers;\n let layersShownOrHidden;\n let layer;\n let i, len;\n for (i = 0, len = layers.length; i < len; ++i) {\n layer = layers[i];\n\n layer._layerIndex = i;\n\n if (layer.show) {\n layer._isBaseLayer = isBaseLayer;\n isBaseLayer = false;\n } else {\n layer._isBaseLayer = false;\n }\n\n if (layer.show !== layer._show) {\n if (defined(layer._show)) {\n if (!defined(layersShownOrHidden)) {\n layersShownOrHidden = [];\n }\n layersShownOrHidden.push(layer);\n }\n layer._show = layer.show;\n }\n }\n\n if (defined(layersShownOrHidden)) {\n for (i = 0, len = layersShownOrHidden.length; i < len; ++i) {\n layer = layersShownOrHidden[i];\n this.layerShownOrHidden.raiseEvent(layer, layer._layerIndex, layer.show);\n }\n }\n};\nexport default ImageryLayerCollection;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\n\n/**\n * A set of occluders that can be used to test quadtree tiles for occlusion.\n *\n * @alias QuadtreeOccluders\n * @constructor\n * @private\n *\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid that potentially occludes tiles.\n */\nfunction QuadtreeOccluders(options) {\n this._ellipsoid = new EllipsoidalOccluder(options.ellipsoid, Cartesian3.ZERO);\n}\n\nObject.defineProperties(QuadtreeOccluders.prototype, {\n /**\n * Gets the {@link EllipsoidalOccluder} that can be used to determine if a point is\n * occluded by an {@link Ellipsoid}.\n * @type {EllipsoidalOccluder}\n * @memberof QuadtreeOccluders.prototype\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n});\nexport default QuadtreeOccluders;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * A single tile in a {@link QuadtreePrimitive}.\n *\n * @alias QuadtreeTile\n * @constructor\n * @private\n *\n * @param {Number} options.level The level of the tile in the quadtree.\n * @param {Number} options.x The X coordinate of the tile in the quadtree. 0 is the westernmost tile.\n * @param {Number} options.y The Y coordinate of the tile in the quadtree. 0 is the northernmost tile.\n * @param {TilingScheme} options.tilingScheme The tiling scheme in which this tile exists.\n * @param {QuadtreeTile} [options.parent] This tile's parent, or undefined if this is a root tile.\n */\nfunction QuadtreeTile(options) {\n this._tilingScheme = options.tilingScheme;\n this._x = options.x;\n this._y = options.y;\n this._level = options.level;\n this._parent = options.parent;\n this._rectangle = this._tilingScheme.tileXYToRectangle(\n this._x,\n this._y,\n this._level\n );\n\n this._southwestChild = undefined;\n this._southeastChild = undefined;\n this._northwestChild = undefined;\n this._northeastChild = undefined;\n\n // TileReplacementQueue gets/sets these private properties.\n this.replacementPrevious = undefined;\n this.replacementNext = undefined;\n\n // The distance from the camera to this tile, updated when the tile is selected\n // for rendering. We can get rid of this if we have a better way to sort by\n // distance - for example, by using the natural ordering of a quadtree.\n // QuadtreePrimitive gets/sets this private property.\n this._distance = 0.0;\n this._loadPriority = 0.0;\n\n this._customData = [];\n this._frameUpdated = undefined;\n this._lastSelectionResult = TileSelectionResult.NONE;\n this._lastSelectionResultFrame = undefined;\n this._loadedCallbacks = {};\n\n /**\n * Gets or sets the current state of the tile in the tile load pipeline.\n * @type {QuadtreeTileLoadState}\n * @default {@link QuadtreeTileLoadState.START}\n */\n this.state = QuadtreeTileLoadState.START;\n\n /**\n * Gets or sets a value indicating whether or not the tile is currently renderable.\n * @type {Boolean}\n * @default false\n */\n this.renderable = false;\n\n /**\n * Gets or set a value indicating whether or not the tile was entirely upsampled from its\n * parent tile. If all four children of a parent tile were upsampled from the parent,\n * we will render the parent instead of the children even if the LOD indicates that\n * the children would be preferable.\n * @type {Boolean}\n * @default false\n */\n this.upsampledFromParent = false;\n\n /**\n * Gets or sets the additional data associated with this tile. The exact content is specific to the\n * {@link QuadtreeTileProvider}.\n * @type {Object}\n * @default undefined\n */\n this.data = undefined;\n}\n\n/**\n * Creates a rectangular set of tiles for level of detail zero, the coarsest, least detailed level.\n *\n * @memberof QuadtreeTile\n *\n * @param {TilingScheme} tilingScheme The tiling scheme for which the tiles are to be created.\n * @returns {QuadtreeTile[]} An array containing the tiles at level of detail zero, starting with the\n * tile in the northwest corner and followed by the tile (if any) to its east.\n */\nQuadtreeTile.createLevelZeroTiles = function (tilingScheme) {\n const numberOfLevelZeroTilesX = tilingScheme.getNumberOfXTilesAtLevel(0);\n const numberOfLevelZeroTilesY = tilingScheme.getNumberOfYTilesAtLevel(0);\n\n const result = new Array(numberOfLevelZeroTilesX * numberOfLevelZeroTilesY);\n\n let index = 0;\n for (let y = 0; y < numberOfLevelZeroTilesY; ++y) {\n for (let x = 0; x < numberOfLevelZeroTilesX; ++x) {\n result[index++] = new QuadtreeTile({\n tilingScheme: tilingScheme,\n x: x,\n y: y,\n level: 0,\n });\n }\n }\n\n return result;\n};\n\nQuadtreeTile.prototype._updateCustomData = function (\n frameNumber,\n added,\n removed\n) {\n let customData = this.customData;\n\n let i;\n let data;\n let rectangle;\n\n if (defined(added) && defined(removed)) {\n customData = customData.filter(function (value) {\n return removed.indexOf(value) === -1;\n });\n this._customData = customData;\n\n rectangle = this._rectangle;\n for (i = 0; i < added.length; ++i) {\n data = added[i];\n if (Rectangle.contains(rectangle, data.positionCartographic)) {\n customData.push(data);\n }\n }\n\n this._frameUpdated = frameNumber;\n } else {\n // interior or leaf tile, update from parent\n const parent = this._parent;\n if (defined(parent) && this._frameUpdated !== parent._frameUpdated) {\n customData.length = 0;\n\n rectangle = this._rectangle;\n const parentCustomData = parent.customData;\n for (i = 0; i < parentCustomData.length; ++i) {\n data = parentCustomData[i];\n if (Rectangle.contains(rectangle, data.positionCartographic)) {\n customData.push(data);\n }\n }\n\n this._frameUpdated = parent._frameUpdated;\n }\n }\n};\n\nObject.defineProperties(QuadtreeTile.prototype, {\n /**\n * Gets the tiling scheme used to tile the surface.\n * @memberof QuadtreeTile.prototype\n * @type {TilingScheme}\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the tile X coordinate.\n * @memberof QuadtreeTile.prototype\n * @type {Number}\n */\n x: {\n get: function () {\n return this._x;\n },\n },\n\n /**\n * Gets the tile Y coordinate.\n * @memberof QuadtreeTile.prototype\n * @type {Number}\n */\n y: {\n get: function () {\n return this._y;\n },\n },\n\n /**\n * Gets the level-of-detail, where zero is the coarsest, least-detailed.\n * @memberof QuadtreeTile.prototype\n * @type {Number}\n */\n level: {\n get: function () {\n return this._level;\n },\n },\n\n /**\n * Gets the parent tile of this tile.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile}\n */\n parent: {\n get: function () {\n return this._parent;\n },\n },\n\n /**\n * Gets the cartographic rectangle of the tile, with north, south, east and\n * west properties in radians.\n * @memberof QuadtreeTile.prototype\n * @type {Rectangle}\n */\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n\n /**\n * An array of tiles that is at the next level of the tile tree.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile[]}\n */\n children: {\n get: function () {\n return [\n this.northwestChild,\n this.northeastChild,\n this.southwestChild,\n this.southeastChild,\n ];\n },\n },\n\n /**\n * Gets the southwest child tile.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile}\n */\n southwestChild: {\n get: function () {\n if (!defined(this._southwestChild)) {\n this._southwestChild = new QuadtreeTile({\n tilingScheme: this.tilingScheme,\n x: this.x * 2,\n y: this.y * 2 + 1,\n level: this.level + 1,\n parent: this,\n });\n }\n return this._southwestChild;\n },\n },\n\n /**\n * Gets the southeast child tile.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile}\n */\n southeastChild: {\n get: function () {\n if (!defined(this._southeastChild)) {\n this._southeastChild = new QuadtreeTile({\n tilingScheme: this.tilingScheme,\n x: this.x * 2 + 1,\n y: this.y * 2 + 1,\n level: this.level + 1,\n parent: this,\n });\n }\n return this._southeastChild;\n },\n },\n\n /**\n * Gets the northwest child tile.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile}\n */\n northwestChild: {\n get: function () {\n if (!defined(this._northwestChild)) {\n this._northwestChild = new QuadtreeTile({\n tilingScheme: this.tilingScheme,\n x: this.x * 2,\n y: this.y * 2,\n level: this.level + 1,\n parent: this,\n });\n }\n return this._northwestChild;\n },\n },\n\n /**\n * Gets the northeast child tile.\n * @memberof QuadtreeTile.prototype\n * @type {QuadtreeTile}\n */\n northeastChild: {\n get: function () {\n if (!defined(this._northeastChild)) {\n this._northeastChild = new QuadtreeTile({\n tilingScheme: this.tilingScheme,\n x: this.x * 2 + 1,\n y: this.y * 2,\n level: this.level + 1,\n parent: this,\n });\n }\n return this._northeastChild;\n },\n },\n\n /**\n * An array of objects associated with this tile.\n * @memberof QuadtreeTile.prototype\n * @type {Array}\n */\n customData: {\n get: function () {\n return this._customData;\n },\n },\n\n /**\n * Gets a value indicating whether or not this tile needs further loading.\n * This property will return true if the {@link QuadtreeTile#state} is\n * <code>START</code> or <code>LOADING</code>.\n * @memberof QuadtreeTile.prototype\n * @type {Boolean}\n */\n needsLoading: {\n get: function () {\n return this.state < QuadtreeTileLoadState.DONE;\n },\n },\n\n /**\n * Gets a value indicating whether or not this tile is eligible to be unloaded.\n * Typically, a tile is ineligible to be unloaded while an asynchronous operation,\n * such as a request for data, is in progress on it. A tile will never be\n * unloaded while it is needed for rendering, regardless of the value of this\n * property. If {@link QuadtreeTile#data} is defined and has an\n * <code>eligibleForUnloading</code> property, the value of that property is returned.\n * Otherwise, this property returns true.\n * @memberof QuadtreeTile.prototype\n * @type {Boolean}\n */\n eligibleForUnloading: {\n get: function () {\n let result = true;\n\n if (defined(this.data)) {\n result = this.data.eligibleForUnloading;\n if (!defined(result)) {\n result = true;\n }\n }\n\n return result;\n },\n },\n});\n\nQuadtreeTile.prototype.findLevelZeroTile = function (levelZeroTiles, x, y) {\n const xTiles = this.tilingScheme.getNumberOfXTilesAtLevel(0);\n if (x < 0) {\n x += xTiles;\n } else if (x >= xTiles) {\n x -= xTiles;\n }\n\n if (y < 0 || y >= this.tilingScheme.getNumberOfYTilesAtLevel(0)) {\n return undefined;\n }\n\n return levelZeroTiles.filter(function (tile) {\n return tile.x === x && tile.y === y;\n })[0];\n};\n\nQuadtreeTile.prototype.findTileToWest = function (levelZeroTiles) {\n const parent = this.parent;\n if (parent === undefined) {\n return this.findLevelZeroTile(levelZeroTiles, this.x - 1, this.y);\n }\n\n if (parent.southeastChild === this) {\n return parent.southwestChild;\n } else if (parent.northeastChild === this) {\n return parent.northwestChild;\n }\n\n const westOfParent = parent.findTileToWest(levelZeroTiles);\n if (westOfParent === undefined) {\n return undefined;\n } else if (parent.southwestChild === this) {\n return westOfParent.southeastChild;\n }\n return westOfParent.northeastChild;\n};\n\nQuadtreeTile.prototype.findTileToEast = function (levelZeroTiles) {\n const parent = this.parent;\n if (parent === undefined) {\n return this.findLevelZeroTile(levelZeroTiles, this.x + 1, this.y);\n }\n\n if (parent.southwestChild === this) {\n return parent.southeastChild;\n } else if (parent.northwestChild === this) {\n return parent.northeastChild;\n }\n\n const eastOfParent = parent.findTileToEast(levelZeroTiles);\n if (eastOfParent === undefined) {\n return undefined;\n } else if (parent.southeastChild === this) {\n return eastOfParent.southwestChild;\n }\n return eastOfParent.northwestChild;\n};\n\nQuadtreeTile.prototype.findTileToSouth = function (levelZeroTiles) {\n const parent = this.parent;\n if (parent === undefined) {\n return this.findLevelZeroTile(levelZeroTiles, this.x, this.y + 1);\n }\n\n if (parent.northwestChild === this) {\n return parent.southwestChild;\n } else if (parent.northeastChild === this) {\n return parent.southeastChild;\n }\n\n const southOfParent = parent.findTileToSouth(levelZeroTiles);\n if (southOfParent === undefined) {\n return undefined;\n } else if (parent.southwestChild === this) {\n return southOfParent.northwestChild;\n }\n return southOfParent.northeastChild;\n};\n\nQuadtreeTile.prototype.findTileToNorth = function (levelZeroTiles) {\n const parent = this.parent;\n if (parent === undefined) {\n return this.findLevelZeroTile(levelZeroTiles, this.x, this.y - 1);\n }\n\n if (parent.southwestChild === this) {\n return parent.northwestChild;\n } else if (parent.southeastChild === this) {\n return parent.northeastChild;\n }\n\n const northOfParent = parent.findTileToNorth(levelZeroTiles);\n if (northOfParent === undefined) {\n return undefined;\n } else if (parent.northwestChild === this) {\n return northOfParent.southwestChild;\n }\n return northOfParent.southeastChild;\n};\n\n/**\n * Frees the resources associated with this tile and returns it to the <code>START</code>\n * {@link QuadtreeTileLoadState}. If the {@link QuadtreeTile#data} property is defined and it\n * has a <code>freeResources</code> method, the method will be invoked.\n *\n * @memberof QuadtreeTile\n */\nQuadtreeTile.prototype.freeResources = function () {\n this.state = QuadtreeTileLoadState.START;\n this.renderable = false;\n this.upsampledFromParent = false;\n\n if (defined(this.data) && defined(this.data.freeResources)) {\n this.data.freeResources();\n }\n\n freeTile(this._southwestChild);\n this._southwestChild = undefined;\n freeTile(this._southeastChild);\n this._southeastChild = undefined;\n freeTile(this._northwestChild);\n this._northwestChild = undefined;\n freeTile(this._northeastChild);\n this._northeastChild = undefined;\n};\n\nfunction freeTile(tile) {\n if (defined(tile)) {\n tile.freeResources();\n }\n}\nexport default QuadtreeTile;\n", "import defined from \"../Core/defined.js\";\n\n/**\n * A priority queue of tiles to be replaced, if necessary, to make room for new tiles. The queue\n * is implemented as a linked list.\n *\n * @alias TileReplacementQueue\n * @private\n */\nfunction TileReplacementQueue() {\n this.head = undefined;\n this.tail = undefined;\n this.count = 0;\n this._lastBeforeStartOfFrame = undefined;\n}\n\n/**\n * Marks the start of the render frame. Tiles before (closer to the head) this tile in the\n * list were used last frame and must not be unloaded.\n */\nTileReplacementQueue.prototype.markStartOfRenderFrame = function () {\n this._lastBeforeStartOfFrame = this.head;\n};\n\n/**\n * Reduces the size of the queue to a specified size by unloading the least-recently used\n * tiles. Tiles that were used last frame will not be unloaded, even if that puts the number\n * of tiles above the specified maximum.\n *\n * @param {Number} maximumTiles The maximum number of tiles in the queue.\n */\nTileReplacementQueue.prototype.trimTiles = function (maximumTiles) {\n let tileToTrim = this.tail;\n let keepTrimming = true;\n while (\n keepTrimming &&\n defined(this._lastBeforeStartOfFrame) &&\n this.count > maximumTiles &&\n defined(tileToTrim)\n ) {\n // Stop trimming after we process the last tile not used in the\n // current frame.\n keepTrimming = tileToTrim !== this._lastBeforeStartOfFrame;\n\n const previous = tileToTrim.replacementPrevious;\n\n if (tileToTrim.eligibleForUnloading) {\n tileToTrim.freeResources();\n remove(this, tileToTrim);\n }\n\n tileToTrim = previous;\n }\n};\n\nfunction remove(tileReplacementQueue, item) {\n const previous = item.replacementPrevious;\n const next = item.replacementNext;\n\n if (item === tileReplacementQueue._lastBeforeStartOfFrame) {\n tileReplacementQueue._lastBeforeStartOfFrame = next;\n }\n\n if (item === tileReplacementQueue.head) {\n tileReplacementQueue.head = next;\n } else {\n previous.replacementNext = next;\n }\n\n if (item === tileReplacementQueue.tail) {\n tileReplacementQueue.tail = previous;\n } else {\n next.replacementPrevious = previous;\n }\n\n item.replacementPrevious = undefined;\n item.replacementNext = undefined;\n\n --tileReplacementQueue.count;\n}\n\n/**\n * Marks a tile as rendered this frame and moves it before the first tile that was not rendered\n * this frame.\n *\n * @param {TileReplacementQueue} item The tile that was rendered.\n */\nTileReplacementQueue.prototype.markTileRendered = function (item) {\n const head = this.head;\n if (head === item) {\n if (item === this._lastBeforeStartOfFrame) {\n this._lastBeforeStartOfFrame = item.replacementNext;\n }\n return;\n }\n\n ++this.count;\n\n if (!defined(head)) {\n // no other tiles in the list\n item.replacementPrevious = undefined;\n item.replacementNext = undefined;\n this.head = item;\n this.tail = item;\n return;\n }\n\n if (defined(item.replacementPrevious) || defined(item.replacementNext)) {\n // tile already in the list, remove from its current location\n remove(this, item);\n }\n\n item.replacementPrevious = undefined;\n item.replacementNext = head;\n head.replacementPrevious = item;\n\n this.head = item;\n};\nexport default TileReplacementQueue;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Visibility from \"../Core/Visibility.js\";\nimport QuadtreeOccluders from \"./QuadtreeOccluders.js\";\nimport QuadtreeTile from \"./QuadtreeTile.js\";\nimport QuadtreeTileLoadState from \"./QuadtreeTileLoadState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport TileReplacementQueue from \"./TileReplacementQueue.js\";\nimport TileSelectionResult from \"./TileSelectionResult.js\";\n\n/**\n * Renders massive sets of data by utilizing level-of-detail and culling. The globe surface is divided into\n * a quadtree of tiles with large, low-detail tiles at the root and small, high-detail tiles at the leaves.\n * The set of tiles to render is selected by projecting an estimate of the geometric error in a tile onto\n * the screen to estimate screen-space error, in pixels, which must be below a user-specified threshold.\n * The actual content of the tiles is arbitrary and is specified using a {@link QuadtreeTileProvider}.\n *\n * @alias QuadtreePrimitive\n * @constructor\n * @private\n *\n * @param {QuadtreeTileProvider} options.tileProvider The tile provider that loads, renders, and estimates\n * the distance to individual tiles.\n * @param {Number} [options.maximumScreenSpaceError=2] The maximum screen-space error, in pixels, that is allowed.\n * A higher maximum error will render fewer tiles and improve performance, while a lower\n * value will improve visual quality.\n * @param {Number} [options.tileCacheSize=100] The maximum number of tiles that will be retained in the tile cache.\n * Note that tiles will never be unloaded if they were used for rendering the last\n * frame, so the actual number of resident tiles may be higher. The value of\n * this property will not affect visual quality.\n */\nfunction QuadtreePrimitive(options) {\n this._tileProvider = options.tileProvider;\n this._tileProvider.quadtree = this;\n\n this._debug = {\n enableDebugOutput: false,\n\n maxDepth: 0,\n maxDepthVisited: 0,\n tilesVisited: 0,\n tilesCulled: 0,\n tilesRendered: 0,\n tilesWaitingForChildren: 0,\n\n lastMaxDepth: -1,\n lastMaxDepthVisited: -1,\n lastTilesVisited: -1,\n lastTilesCulled: -1,\n lastTilesRendered: -1,\n lastTilesWaitingForChildren: -1,\n\n suspendLodUpdate: false,\n };\n\n const tilingScheme = this._tileProvider.tilingScheme;\n const ellipsoid = tilingScheme.ellipsoid;\n\n this._tilesToRender = [];\n this._tileLoadQueueHigh = []; // high priority tiles are preventing refinement\n this._tileLoadQueueMedium = []; // medium priority tiles are being rendered\n this._tileLoadQueueLow = []; // low priority tiles were refined past or are non-visible parts of quads.\n this._tileReplacementQueue = new TileReplacementQueue();\n this._levelZeroTiles = undefined;\n this._loadQueueTimeSlice = 5.0;\n this._tilesInvalidated = false;\n\n this._addHeightCallbacks = [];\n this._removeHeightCallbacks = [];\n\n this._tileToUpdateHeights = [];\n this._lastTileIndex = 0;\n this._updateHeightsTimeSlice = 2.0;\n\n // If a culled tile contains _cameraPositionCartographic or _cameraReferenceFrameOriginCartographic, it will be marked\n // TileSelectionResult.CULLED_BUT_NEEDED and added to the list of tiles to update heights,\n // even though it is not rendered.\n // These are updated each frame in `selectTilesForRendering`.\n this._cameraPositionCartographic = undefined;\n this._cameraReferenceFrameOriginCartographic = undefined;\n\n /**\n * Gets or sets the maximum screen-space error, in pixels, that is allowed.\n * A higher maximum error will render fewer tiles and improve performance, while a lower\n * value will improve visual quality.\n * @type {Number}\n * @default 2\n */\n this.maximumScreenSpaceError = defaultValue(\n options.maximumScreenSpaceError,\n 2\n );\n\n /**\n * Gets or sets the maximum number of tiles that will be retained in the tile cache.\n * Note that tiles will never be unloaded if they were used for rendering the last\n * frame, so the actual number of resident tiles may be higher. The value of\n * this property will not affect visual quality.\n * @type {Number}\n * @default 100\n */\n this.tileCacheSize = defaultValue(options.tileCacheSize, 100);\n\n /**\n * Gets or sets the number of loading descendant tiles that is considered \"too many\".\n * If a tile has too many loading descendants, that tile will be loaded and rendered before any of\n * its descendants are loaded and rendered. This means more feedback for the user that something\n * is happening at the cost of a longer overall load time. Setting this to 0 will cause each\n * tile level to be loaded successively, significantly increasing load time. Setting it to a large\n * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make\n * detail appear all at once after a long wait.\n * @type {Number}\n * @default 20\n */\n this.loadingDescendantLimit = 20;\n\n /**\n * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.\n * Setting this to true optimizes the zoom-out experience and provides more detail in\n * newly-exposed areas when panning. The down side is that it requires loading more tiles.\n * @type {Boolean}\n * @default true\n */\n this.preloadAncestors = true;\n\n /**\n * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.\n * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even\n * if they are culled. Setting this to true may provide a better panning experience at the\n * cost of loading more tiles.\n * @type {Boolean}\n * @default false\n */\n this.preloadSiblings = false;\n\n this._occluders = new QuadtreeOccluders({\n ellipsoid: ellipsoid,\n });\n\n this._tileLoadProgressEvent = new Event();\n this._lastTileLoadQueueLength = 0;\n\n this._lastSelectionFrameNumber = undefined;\n}\n\nObject.defineProperties(QuadtreePrimitive.prototype, {\n /**\n * Gets the provider of {@link QuadtreeTile} instances for this quadtree.\n * @type {QuadtreeTile}\n * @memberof QuadtreePrimitive.prototype\n */\n tileProvider: {\n get: function () {\n return this._tileProvider;\n },\n },\n /**\n * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty,\n * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.\n *\n * @memberof QuadtreePrimitive.prototype\n * @type {Event}\n */\n tileLoadProgressEvent: {\n get: function () {\n return this._tileLoadProgressEvent;\n },\n },\n\n occluders: {\n get: function () {\n return this._occluders;\n },\n },\n});\n\n/**\n * Invalidates and frees all the tiles in the quadtree. The tiles must be reloaded\n * before they can be displayed.\n *\n * @memberof QuadtreePrimitive\n */\nQuadtreePrimitive.prototype.invalidateAllTiles = function () {\n this._tilesInvalidated = true;\n};\n\nfunction invalidateAllTiles(primitive) {\n // Clear the replacement queue\n const replacementQueue = primitive._tileReplacementQueue;\n replacementQueue.head = undefined;\n replacementQueue.tail = undefined;\n replacementQueue.count = 0;\n\n clearTileLoadQueue(primitive);\n\n // Free and recreate the level zero tiles.\n const levelZeroTiles = primitive._levelZeroTiles;\n if (defined(levelZeroTiles)) {\n for (let i = 0; i < levelZeroTiles.length; ++i) {\n const tile = levelZeroTiles[i];\n const customData = tile.customData;\n const customDataLength = customData.length;\n\n for (let j = 0; j < customDataLength; ++j) {\n const data = customData[j];\n data.level = 0;\n primitive._addHeightCallbacks.push(data);\n }\n\n levelZeroTiles[i].freeResources();\n }\n }\n\n primitive._levelZeroTiles = undefined;\n\n primitive._tileProvider.cancelReprojections();\n}\n\n/**\n * Invokes a specified function for each {@link QuadtreeTile} that is partially\n * or completely loaded.\n *\n * @param {Function} tileFunction The function to invoke for each loaded tile. The\n * function is passed a reference to the tile as its only parameter.\n */\nQuadtreePrimitive.prototype.forEachLoadedTile = function (tileFunction) {\n let tile = this._tileReplacementQueue.head;\n while (defined(tile)) {\n if (tile.state !== QuadtreeTileLoadState.START) {\n tileFunction(tile);\n }\n tile = tile.replacementNext;\n }\n};\n\n/**\n * Invokes a specified function for each {@link QuadtreeTile} that was rendered\n * in the most recent frame.\n *\n * @param {Function} tileFunction The function to invoke for each rendered tile. The\n * function is passed a reference to the tile as its only parameter.\n */\nQuadtreePrimitive.prototype.forEachRenderedTile = function (tileFunction) {\n const tilesRendered = this._tilesToRender;\n for (let i = 0, len = tilesRendered.length; i < len; ++i) {\n tileFunction(tilesRendered[i]);\n }\n};\n\n/**\n * Calls the callback when a new tile is rendered that contains the given cartographic. The only parameter\n * is the cartesian position on the tile.\n *\n * @param {Cartographic} cartographic The cartographic position.\n * @param {Function} callback The function to be called when a new tile is loaded containing cartographic.\n * @returns {Function} The function to remove this callback from the quadtree.\n */\nQuadtreePrimitive.prototype.updateHeight = function (cartographic, callback) {\n const primitive = this;\n const object = {\n positionOnEllipsoidSurface: undefined,\n positionCartographic: cartographic,\n level: -1,\n callback: callback,\n };\n\n object.removeFunc = function () {\n const addedCallbacks = primitive._addHeightCallbacks;\n const length = addedCallbacks.length;\n for (let i = 0; i < length; ++i) {\n if (addedCallbacks[i] === object) {\n addedCallbacks.splice(i, 1);\n break;\n }\n }\n primitive._removeHeightCallbacks.push(object);\n if (object.callback) {\n object.callback = undefined;\n }\n };\n\n primitive._addHeightCallbacks.push(object);\n return object.removeFunc;\n};\n\n/**\n * Updates the tile provider imagery and continues to process the tile load queue.\n * @private\n */\nQuadtreePrimitive.prototype.update = function (frameState) {\n if (defined(this._tileProvider.update)) {\n this._tileProvider.update(frameState);\n }\n};\n\nfunction clearTileLoadQueue(primitive) {\n const debug = primitive._debug;\n debug.maxDepth = 0;\n debug.maxDepthVisited = 0;\n debug.tilesVisited = 0;\n debug.tilesCulled = 0;\n debug.tilesRendered = 0;\n debug.tilesWaitingForChildren = 0;\n\n primitive._tileLoadQueueHigh.length = 0;\n primitive._tileLoadQueueMedium.length = 0;\n primitive._tileLoadQueueLow.length = 0;\n}\n\n/**\n * Initializes values for a new render frame and prepare the tile load queue.\n * @private\n */\nQuadtreePrimitive.prototype.beginFrame = function (frameState) {\n const passes = frameState.passes;\n if (!passes.render) {\n return;\n }\n\n if (this._tilesInvalidated) {\n invalidateAllTiles(this);\n this._tilesInvalidated = false;\n }\n\n // Gets commands for any texture re-projections\n this._tileProvider.initialize(frameState);\n\n clearTileLoadQueue(this);\n\n if (this._debug.suspendLodUpdate) {\n return;\n }\n\n this._tileReplacementQueue.markStartOfRenderFrame();\n};\n\n/**\n * Selects new tiles to load based on the frame state and creates render commands.\n * @private\n */\nQuadtreePrimitive.prototype.render = function (frameState) {\n const passes = frameState.passes;\n const tileProvider = this._tileProvider;\n\n if (passes.render) {\n tileProvider.beginUpdate(frameState);\n\n selectTilesForRendering(this, frameState);\n createRenderCommandsForSelectedTiles(this, frameState);\n\n tileProvider.endUpdate(frameState);\n }\n\n if (passes.pick && this._tilesToRender.length > 0) {\n tileProvider.updateForPick(frameState);\n }\n};\n\n/**\n * Checks if the load queue length has changed since the last time we raised a queue change event - if so, raises\n * a new change event at the end of the render cycle.\n * @private\n */\nfunction updateTileLoadProgress(primitive, frameState) {\n const currentLoadQueueLength =\n primitive._tileLoadQueueHigh.length +\n primitive._tileLoadQueueMedium.length +\n primitive._tileLoadQueueLow.length;\n\n if (\n currentLoadQueueLength !== primitive._lastTileLoadQueueLength ||\n primitive._tilesInvalidated\n ) {\n frameState.afterRender.push(\n Event.prototype.raiseEvent.bind(\n primitive._tileLoadProgressEvent,\n currentLoadQueueLength\n )\n );\n primitive._lastTileLoadQueueLength = currentLoadQueueLength;\n }\n\n const debug = primitive._debug;\n if (debug.enableDebugOutput && !debug.suspendLodUpdate) {\n debug.maxDepth = primitive._tilesToRender.reduce(function (max, tile) {\n return Math.max(max, tile.level);\n }, -1);\n debug.tilesRendered = primitive._tilesToRender.length;\n\n if (\n debug.tilesVisited !== debug.lastTilesVisited ||\n debug.tilesRendered !== debug.lastTilesRendered ||\n debug.tilesCulled !== debug.lastTilesCulled ||\n debug.maxDepth !== debug.lastMaxDepth ||\n debug.tilesWaitingForChildren !== debug.lastTilesWaitingForChildren ||\n debug.maxDepthVisited !== debug.lastMaxDepthVisited\n ) {\n console.log(\n `Visited ${debug.tilesVisited}, Rendered: ${debug.tilesRendered}, Culled: ${debug.tilesCulled}, Max Depth Rendered: ${debug.maxDepth}, Max Depth Visited: ${debug.maxDepthVisited}, Waiting for children: ${debug.tilesWaitingForChildren}`\n );\n\n debug.lastTilesVisited = debug.tilesVisited;\n debug.lastTilesRendered = debug.tilesRendered;\n debug.lastTilesCulled = debug.tilesCulled;\n debug.lastMaxDepth = debug.maxDepth;\n debug.lastTilesWaitingForChildren = debug.tilesWaitingForChildren;\n debug.lastMaxDepthVisited = debug.maxDepthVisited;\n }\n }\n}\n\n/**\n * Updates terrain heights.\n * @private\n */\nQuadtreePrimitive.prototype.endFrame = function (frameState) {\n const passes = frameState.passes;\n if (!passes.render || frameState.mode === SceneMode.MORPHING) {\n // Only process the load queue for a single pass.\n // Don't process the load queue or update heights during the morph flights.\n return;\n }\n\n // Load/create resources for terrain and imagery. Prepare texture re-projections for the next frame.\n processTileLoadQueue(this, frameState);\n updateHeights(this, frameState);\n updateTileLoadProgress(this, frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof QuadtreePrimitive\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see QuadtreePrimitive#destroy\n */\nQuadtreePrimitive.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof QuadtreePrimitive\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * primitive = primitive && primitive.destroy();\n *\n * @see QuadtreePrimitive#isDestroyed\n */\nQuadtreePrimitive.prototype.destroy = function () {\n this._tileProvider = this._tileProvider && this._tileProvider.destroy();\n};\n\nlet comparisonPoint;\nconst centerScratch = new Cartographic();\nfunction compareDistanceToPoint(a, b) {\n let center = Rectangle.center(a.rectangle, centerScratch);\n const alon = center.longitude - comparisonPoint.longitude;\n const alat = center.latitude - comparisonPoint.latitude;\n\n center = Rectangle.center(b.rectangle, centerScratch);\n const blon = center.longitude - comparisonPoint.longitude;\n const blat = center.latitude - comparisonPoint.latitude;\n\n return alon * alon + alat * alat - (blon * blon + blat * blat);\n}\n\nconst cameraOriginScratch = new Cartesian3();\nlet rootTraversalDetails = [];\n\nfunction selectTilesForRendering(primitive, frameState) {\n const debug = primitive._debug;\n if (debug.suspendLodUpdate) {\n return;\n }\n\n // Clear the render list.\n const tilesToRender = primitive._tilesToRender;\n tilesToRender.length = 0;\n\n // We can't render anything before the level zero tiles exist.\n let i;\n const tileProvider = primitive._tileProvider;\n if (!defined(primitive._levelZeroTiles)) {\n if (tileProvider.ready) {\n const tilingScheme = tileProvider.tilingScheme;\n primitive._levelZeroTiles = QuadtreeTile.createLevelZeroTiles(\n tilingScheme\n );\n const numberOfRootTiles = primitive._levelZeroTiles.length;\n if (rootTraversalDetails.length < numberOfRootTiles) {\n rootTraversalDetails = new Array(numberOfRootTiles);\n for (i = 0; i < numberOfRootTiles; ++i) {\n if (rootTraversalDetails[i] === undefined) {\n rootTraversalDetails[i] = new TraversalDetails();\n }\n }\n }\n } else {\n // Nothing to do until the provider is ready.\n return;\n }\n }\n\n primitive._occluders.ellipsoid.cameraPosition = frameState.camera.positionWC;\n\n let tile;\n const levelZeroTiles = primitive._levelZeroTiles;\n const occluders =\n levelZeroTiles.length > 1 ? primitive._occluders : undefined;\n\n // Sort the level zero tiles by the distance from the center to the camera.\n // The level zero tiles aren't necessarily a nice neat quad, so we can't use the\n // quadtree ordering we use elsewhere in the tree\n comparisonPoint = frameState.camera.positionCartographic;\n levelZeroTiles.sort(compareDistanceToPoint);\n\n const customDataAdded = primitive._addHeightCallbacks;\n const customDataRemoved = primitive._removeHeightCallbacks;\n const frameNumber = frameState.frameNumber;\n\n let len;\n if (customDataAdded.length > 0 || customDataRemoved.length > 0) {\n for (i = 0, len = levelZeroTiles.length; i < len; ++i) {\n tile = levelZeroTiles[i];\n tile._updateCustomData(frameNumber, customDataAdded, customDataRemoved);\n }\n\n customDataAdded.length = 0;\n customDataRemoved.length = 0;\n }\n\n const camera = frameState.camera;\n\n primitive._cameraPositionCartographic = camera.positionCartographic;\n const cameraFrameOrigin = Matrix4.getTranslation(\n camera.transform,\n cameraOriginScratch\n );\n primitive._cameraReferenceFrameOriginCartographic = primitive.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(\n cameraFrameOrigin,\n primitive._cameraReferenceFrameOriginCartographic\n );\n\n // Traverse in depth-first, near-to-far order.\n for (i = 0, len = levelZeroTiles.length; i < len; ++i) {\n tile = levelZeroTiles[i];\n primitive._tileReplacementQueue.markTileRendered(tile);\n if (!tile.renderable) {\n queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n ++debug.tilesWaitingForChildren;\n } else {\n visitIfVisible(\n primitive,\n tile,\n tileProvider,\n frameState,\n occluders,\n false,\n rootTraversalDetails[i]\n );\n }\n }\n\n primitive._lastSelectionFrameNumber = frameNumber;\n}\n\nfunction queueTileLoad(primitive, queue, tile, frameState) {\n if (!tile.needsLoading) {\n return;\n }\n\n if (primitive.tileProvider.computeTileLoadPriority !== undefined) {\n tile._loadPriority = primitive.tileProvider.computeTileLoadPriority(\n tile,\n frameState\n );\n }\n queue.push(tile);\n}\n\n/**\n * Tracks details of traversing a tile while selecting tiles for rendering.\n * @alias TraversalDetails\n * @constructor\n * @private\n */\nfunction TraversalDetails() {\n /**\n * True if all selected (i.e. not culled or refined) tiles in this tile's subtree\n * are renderable. If the subtree is renderable, we'll render it; no drama.\n */\n this.allAreRenderable = true;\n\n /**\n * True if any tiles in this tile's subtree were rendered last frame. If any\n * were, we must render the subtree rather than this tile, because rendering\n * this tile would cause detail to vanish that was visible last frame, and\n * that's no good.\n */\n this.anyWereRenderedLastFrame = false;\n\n /**\n * Counts the number of selected tiles in this tile's subtree that are\n * not yet ready to be rendered because they need more loading. Note that\n * this value will _not_ necessarily be zero when\n * {@link TraversalDetails#allAreRenderable} is true, for subtle reasons.\n * When {@link TraversalDetails#allAreRenderable} and\n * {@link TraversalDetails#anyWereRenderedLastFrame} are both false, we\n * will render this tile instead of any tiles in its subtree and\n * the `allAreRenderable` value for this tile will reflect only whether _this_\n * tile is renderable. The `notYetRenderableCount` value, however, will still\n * reflect the total number of tiles that we are waiting on, including the\n * ones that we're not rendering. `notYetRenderableCount` is only reset\n * when a subtree is removed from the render queue because the\n * `notYetRenderableCount` exceeds the\n * {@link QuadtreePrimitive#loadingDescendantLimit}.\n */\n this.notYetRenderableCount = 0;\n}\n\nfunction TraversalQuadDetails() {\n this.southwest = new TraversalDetails();\n this.southeast = new TraversalDetails();\n this.northwest = new TraversalDetails();\n this.northeast = new TraversalDetails();\n}\n\nTraversalQuadDetails.prototype.combine = function (result) {\n const southwest = this.southwest;\n const southeast = this.southeast;\n const northwest = this.northwest;\n const northeast = this.northeast;\n\n result.allAreRenderable =\n southwest.allAreRenderable &&\n southeast.allAreRenderable &&\n northwest.allAreRenderable &&\n northeast.allAreRenderable;\n result.anyWereRenderedLastFrame =\n southwest.anyWereRenderedLastFrame ||\n southeast.anyWereRenderedLastFrame ||\n northwest.anyWereRenderedLastFrame ||\n northeast.anyWereRenderedLastFrame;\n result.notYetRenderableCount =\n southwest.notYetRenderableCount +\n southeast.notYetRenderableCount +\n northwest.notYetRenderableCount +\n northeast.notYetRenderableCount;\n};\n\nconst traversalQuadsByLevel = new Array(31); // level 30 tiles are ~2cm wide at the equator, should be good enough.\nfor (let i = 0; i < traversalQuadsByLevel.length; ++i) {\n traversalQuadsByLevel[i] = new TraversalQuadDetails();\n}\n\n/**\n * Visits a tile for possible rendering. When we call this function with a tile:\n *\n * * the tile has been determined to be visible (possibly based on a bounding volume that is not very tight-fitting)\n * * its parent tile does _not_ meet the SSE (unless ancestorMeetsSse=true, see comments below)\n * * the tile may or may not be renderable\n *\n * @private\n *\n * @param {Primitive} primitive The QuadtreePrimitive.\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to visit\n * @param {Boolean} ancestorMeetsSse True if a tile higher in the tile tree already met the SSE and we're refining further only\n * to maintain detail while that higher tile loads.\n * @param {TraversalDetails} traveralDetails On return, populated with details of how the traversal of this tile went.\n */\nfunction visitTile(\n primitive,\n frameState,\n tile,\n ancestorMeetsSse,\n traversalDetails\n) {\n const debug = primitive._debug;\n\n ++debug.tilesVisited;\n\n primitive._tileReplacementQueue.markTileRendered(tile);\n tile._updateCustomData(frameState.frameNumber);\n\n if (tile.level > debug.maxDepthVisited) {\n debug.maxDepthVisited = tile.level;\n }\n\n const meetsSse =\n screenSpaceError(primitive, frameState, tile) <\n primitive.maximumScreenSpaceError;\n\n const southwestChild = tile.southwestChild;\n const southeastChild = tile.southeastChild;\n const northwestChild = tile.northwestChild;\n const northeastChild = tile.northeastChild;\n\n const lastFrame = primitive._lastSelectionFrameNumber;\n const lastFrameSelectionResult =\n tile._lastSelectionResultFrame === lastFrame\n ? tile._lastSelectionResult\n : TileSelectionResult.NONE;\n\n const tileProvider = primitive.tileProvider;\n\n if (meetsSse || ancestorMeetsSse) {\n // This tile (or an ancestor) is the one we want to render this frame, but we'll do different things depending\n // on the state of this tile and on what we did _last_ frame.\n\n // We can render it if _any_ of the following are true:\n // 1. We rendered it (or kicked it) last frame.\n // 2. This tile was culled last frame, or it wasn't even visited because an ancestor was culled.\n // 3. The tile is completely done loading.\n // 4. a) Terrain is ready, and\n // b) All necessary imagery is ready. Necessary imagery is imagery that was rendered with this tile\n // or any descendants last frame. Such imagery is required because rendering this tile without\n // it would cause detail to disappear.\n //\n // Determining condition 4 is more expensive, so we check the others first.\n //\n // Note that even if we decide to render a tile here, it may later get \"kicked\" in favor of an ancestor.\n\n const oneRenderedLastFrame =\n TileSelectionResult.originalResult(lastFrameSelectionResult) ===\n TileSelectionResult.RENDERED;\n const twoCulledOrNotVisited =\n TileSelectionResult.originalResult(lastFrameSelectionResult) ===\n TileSelectionResult.CULLED ||\n lastFrameSelectionResult === TileSelectionResult.NONE;\n const threeCompletelyLoaded = tile.state === QuadtreeTileLoadState.DONE;\n\n let renderable =\n oneRenderedLastFrame || twoCulledOrNotVisited || threeCompletelyLoaded;\n\n if (!renderable) {\n // Check the more expensive condition 4 above. This requires details of the thing\n // we're rendering (e.g. the globe surface), so delegate it to the tile provider.\n if (defined(tileProvider.canRenderWithoutLosingDetail)) {\n renderable = tileProvider.canRenderWithoutLosingDetail(tile);\n }\n }\n\n if (renderable) {\n // Only load this tile if it (not just an ancestor) meets the SSE.\n if (meetsSse) {\n queueTileLoad(\n primitive,\n primitive._tileLoadQueueMedium,\n tile,\n frameState\n );\n }\n addTileToRenderList(primitive, tile);\n\n traversalDetails.allAreRenderable = tile.renderable;\n traversalDetails.anyWereRenderedLastFrame =\n lastFrameSelectionResult === TileSelectionResult.RENDERED;\n traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n\n tile._lastSelectionResultFrame = frameState.frameNumber;\n tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n if (!traversalDetails.anyWereRenderedLastFrame) {\n // Tile is newly-rendered this frame, so update its heights.\n primitive._tileToUpdateHeights.push(tile);\n }\n\n return;\n }\n\n // Otherwise, we can't render this tile (or its fill) because doing so would cause detail to disappear\n // that was visible last frame. Instead, keep rendering any still-visible descendants that were rendered\n // last frame and render fills for newly-visible descendants. E.g. if we were rendering level 15 last\n // frame but this frame we want level 14 and the closest renderable level <= 14 is 0, rendering level\n // zero would be pretty jarring so instead we keep rendering level 15 even though its SSE is better\n // than required. So fall through to continue traversal...\n ancestorMeetsSse = true;\n\n // Load this blocker tile with high priority, but only if this tile (not just an ancestor) meets the SSE.\n if (meetsSse) {\n queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n }\n }\n\n if (tileProvider.canRefine(tile)) {\n const allAreUpsampled =\n southwestChild.upsampledFromParent &&\n southeastChild.upsampledFromParent &&\n northwestChild.upsampledFromParent &&\n northeastChild.upsampledFromParent;\n\n if (allAreUpsampled) {\n // No point in rendering the children because they're all upsampled. Render this tile instead.\n addTileToRenderList(primitive, tile);\n\n // Rendered tile that's not waiting on children loads with medium priority.\n queueTileLoad(\n primitive,\n primitive._tileLoadQueueMedium,\n tile,\n frameState\n );\n\n // Make sure we don't unload the children and forget they're upsampled.\n primitive._tileReplacementQueue.markTileRendered(southwestChild);\n primitive._tileReplacementQueue.markTileRendered(southeastChild);\n primitive._tileReplacementQueue.markTileRendered(northwestChild);\n primitive._tileReplacementQueue.markTileRendered(northeastChild);\n\n traversalDetails.allAreRenderable = tile.renderable;\n traversalDetails.anyWereRenderedLastFrame =\n lastFrameSelectionResult === TileSelectionResult.RENDERED;\n traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n\n tile._lastSelectionResultFrame = frameState.frameNumber;\n tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n if (!traversalDetails.anyWereRenderedLastFrame) {\n // Tile is newly-rendered this frame, so update its heights.\n primitive._tileToUpdateHeights.push(tile);\n }\n\n return;\n }\n\n // SSE is not good enough, so refine.\n tile._lastSelectionResultFrame = frameState.frameNumber;\n tile._lastSelectionResult = TileSelectionResult.REFINED;\n\n const firstRenderedDescendantIndex = primitive._tilesToRender.length;\n const loadIndexLow = primitive._tileLoadQueueLow.length;\n const loadIndexMedium = primitive._tileLoadQueueMedium.length;\n const loadIndexHigh = primitive._tileLoadQueueHigh.length;\n const tilesToUpdateHeightsIndex = primitive._tileToUpdateHeights.length;\n\n // No need to add the children to the load queue because they'll be added (if necessary) when they're visited.\n visitVisibleChildrenNearToFar(\n primitive,\n southwestChild,\n southeastChild,\n northwestChild,\n northeastChild,\n frameState,\n ancestorMeetsSse,\n traversalDetails\n );\n\n // If no descendant tiles were added to the render list by the function above, it means they were all\n // culled even though this tile was deemed visible. That's pretty common.\n\n if (firstRenderedDescendantIndex !== primitive._tilesToRender.length) {\n // At least one descendant tile was added to the render list.\n // The traversalDetails tell us what happened while visiting the children.\n\n const allAreRenderable = traversalDetails.allAreRenderable;\n const anyWereRenderedLastFrame =\n traversalDetails.anyWereRenderedLastFrame;\n const notYetRenderableCount = traversalDetails.notYetRenderableCount;\n let queuedForLoad = false;\n\n if (!allAreRenderable && !anyWereRenderedLastFrame) {\n // Some of our descendants aren't ready to render yet, and none were rendered last frame,\n // so kick them all out of the render list and render this tile instead. Continue to load them though!\n\n // Mark the rendered descendants and their ancestors - up to this tile - as kicked.\n const renderList = primitive._tilesToRender;\n for (let i = firstRenderedDescendantIndex; i < renderList.length; ++i) {\n let workTile = renderList[i];\n while (\n workTile !== undefined &&\n workTile._lastSelectionResult !== TileSelectionResult.KICKED &&\n workTile !== tile\n ) {\n workTile._lastSelectionResult = TileSelectionResult.kick(\n workTile._lastSelectionResult\n );\n workTile = workTile.parent;\n }\n }\n\n // Remove all descendants from the render list and add this tile.\n primitive._tilesToRender.length = firstRenderedDescendantIndex;\n primitive._tileToUpdateHeights.length = tilesToUpdateHeightsIndex;\n addTileToRenderList(primitive, tile);\n\n tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n // If we're waiting on heaps of descendants, the above will take too long. So in that case,\n // load this tile INSTEAD of loading any of the descendants, and tell the up-level we're only waiting\n // on this tile. Keep doing this until we actually manage to render this tile.\n const wasRenderedLastFrame =\n lastFrameSelectionResult === TileSelectionResult.RENDERED;\n if (\n !wasRenderedLastFrame &&\n notYetRenderableCount > primitive.loadingDescendantLimit\n ) {\n // Remove all descendants from the load queues.\n primitive._tileLoadQueueLow.length = loadIndexLow;\n primitive._tileLoadQueueMedium.length = loadIndexMedium;\n primitive._tileLoadQueueHigh.length = loadIndexHigh;\n queueTileLoad(\n primitive,\n primitive._tileLoadQueueMedium,\n tile,\n frameState\n );\n traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n queuedForLoad = true;\n }\n\n traversalDetails.allAreRenderable = tile.renderable;\n traversalDetails.anyWereRenderedLastFrame = wasRenderedLastFrame;\n\n if (!wasRenderedLastFrame) {\n // Tile is newly-rendered this frame, so update its heights.\n primitive._tileToUpdateHeights.push(tile);\n }\n\n ++debug.tilesWaitingForChildren;\n }\n\n if (primitive.preloadAncestors && !queuedForLoad) {\n queueTileLoad(primitive, primitive._tileLoadQueueLow, tile, frameState);\n }\n }\n\n return;\n }\n\n tile._lastSelectionResultFrame = frameState.frameNumber;\n tile._lastSelectionResult = TileSelectionResult.RENDERED;\n\n // We'd like to refine but can't because we have no availability data for this tile's children,\n // so we have no idea if refinining would involve a load or an upsample. We'll have to finish\n // loading this tile first in order to find that out, so load this refinement blocker with\n // high priority.\n addTileToRenderList(primitive, tile);\n queueTileLoad(primitive, primitive._tileLoadQueueHigh, tile, frameState);\n\n traversalDetails.allAreRenderable = tile.renderable;\n traversalDetails.anyWereRenderedLastFrame =\n lastFrameSelectionResult === TileSelectionResult.RENDERED;\n traversalDetails.notYetRenderableCount = tile.renderable ? 0 : 1;\n}\n\nfunction visitVisibleChildrenNearToFar(\n primitive,\n southwest,\n southeast,\n northwest,\n northeast,\n frameState,\n ancestorMeetsSse,\n traversalDetails\n) {\n const cameraPosition = frameState.camera.positionCartographic;\n const tileProvider = primitive._tileProvider;\n const occluders = primitive._occluders;\n\n const quadDetails = traversalQuadsByLevel[southwest.level];\n const southwestDetails = quadDetails.southwest;\n const southeastDetails = quadDetails.southeast;\n const northwestDetails = quadDetails.northwest;\n const northeastDetails = quadDetails.northeast;\n\n if (cameraPosition.longitude < southwest.rectangle.east) {\n if (cameraPosition.latitude < southwest.rectangle.north) {\n // Camera in southwest quadrant\n visitIfVisible(\n primitive,\n southwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southwestDetails\n );\n visitIfVisible(\n primitive,\n southeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southeastDetails\n );\n visitIfVisible(\n primitive,\n northwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northwestDetails\n );\n visitIfVisible(\n primitive,\n northeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northeastDetails\n );\n } else {\n // Camera in northwest quadrant\n visitIfVisible(\n primitive,\n northwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northwestDetails\n );\n visitIfVisible(\n primitive,\n southwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southwestDetails\n );\n visitIfVisible(\n primitive,\n northeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northeastDetails\n );\n visitIfVisible(\n primitive,\n southeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southeastDetails\n );\n }\n } else if (cameraPosition.latitude < southwest.rectangle.north) {\n // Camera southeast quadrant\n visitIfVisible(\n primitive,\n southeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southeastDetails\n );\n visitIfVisible(\n primitive,\n southwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southwestDetails\n );\n visitIfVisible(\n primitive,\n northeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northeastDetails\n );\n visitIfVisible(\n primitive,\n northwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northwestDetails\n );\n } else {\n // Camera in northeast quadrant\n visitIfVisible(\n primitive,\n northeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northeastDetails\n );\n visitIfVisible(\n primitive,\n northwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n northwestDetails\n );\n visitIfVisible(\n primitive,\n southeast,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southeastDetails\n );\n visitIfVisible(\n primitive,\n southwest,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n southwestDetails\n );\n }\n\n quadDetails.combine(traversalDetails);\n}\n\nfunction containsNeededPosition(primitive, tile) {\n const rectangle = tile.rectangle;\n return (\n (defined(primitive._cameraPositionCartographic) &&\n Rectangle.contains(rectangle, primitive._cameraPositionCartographic)) ||\n (defined(primitive._cameraReferenceFrameOriginCartographic) &&\n Rectangle.contains(\n rectangle,\n primitive._cameraReferenceFrameOriginCartographic\n ))\n );\n}\n\nfunction visitIfVisible(\n primitive,\n tile,\n tileProvider,\n frameState,\n occluders,\n ancestorMeetsSse,\n traversalDetails\n) {\n if (\n tileProvider.computeTileVisibility(tile, frameState, occluders) !==\n Visibility.NONE\n ) {\n return visitTile(\n primitive,\n frameState,\n tile,\n ancestorMeetsSse,\n traversalDetails\n );\n }\n\n ++primitive._debug.tilesCulled;\n primitive._tileReplacementQueue.markTileRendered(tile);\n\n traversalDetails.allAreRenderable = true;\n traversalDetails.anyWereRenderedLastFrame = false;\n traversalDetails.notYetRenderableCount = 0;\n\n if (containsNeededPosition(primitive, tile)) {\n // Load the tile(s) that contains the camera's position and\n // the origin of its reference frame with medium priority.\n // But we only need to load until the terrain is available, no need to load imagery.\n if (!defined(tile.data) || !defined(tile.data.vertexArray)) {\n queueTileLoad(\n primitive,\n primitive._tileLoadQueueMedium,\n tile,\n frameState\n );\n }\n\n const lastFrame = primitive._lastSelectionFrameNumber;\n const lastFrameSelectionResult =\n tile._lastSelectionResultFrame === lastFrame\n ? tile._lastSelectionResult\n : TileSelectionResult.NONE;\n if (\n lastFrameSelectionResult !== TileSelectionResult.CULLED_BUT_NEEDED &&\n lastFrameSelectionResult !== TileSelectionResult.RENDERED\n ) {\n primitive._tileToUpdateHeights.push(tile);\n }\n\n tile._lastSelectionResult = TileSelectionResult.CULLED_BUT_NEEDED;\n } else if (primitive.preloadSiblings || tile.level === 0) {\n // Load culled level zero tiles with low priority.\n // For all other levels, only load culled tiles if preloadSiblings is enabled.\n queueTileLoad(primitive, primitive._tileLoadQueueLow, tile, frameState);\n tile._lastSelectionResult = TileSelectionResult.CULLED;\n } else {\n tile._lastSelectionResult = TileSelectionResult.CULLED;\n }\n\n tile._lastSelectionResultFrame = frameState.frameNumber;\n}\n\nfunction screenSpaceError(primitive, frameState, tile) {\n if (\n frameState.mode === SceneMode.SCENE2D ||\n frameState.camera.frustum instanceof OrthographicFrustum ||\n frameState.camera.frustum instanceof OrthographicOffCenterFrustum\n ) {\n return screenSpaceError2D(primitive, frameState, tile);\n }\n\n const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError(\n tile.level\n );\n\n const distance = tile._distance;\n const height = frameState.context.drawingBufferHeight;\n const sseDenominator = frameState.camera.frustum.sseDenominator;\n\n let error = (maxGeometricError * height) / (distance * sseDenominator);\n\n if (frameState.fog.enabled) {\n error -=\n CesiumMath.fog(distance, frameState.fog.density) * frameState.fog.sse;\n }\n\n error /= frameState.pixelRatio;\n\n return error;\n}\n\nfunction screenSpaceError2D(primitive, frameState, tile) {\n const camera = frameState.camera;\n let frustum = camera.frustum;\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n\n const context = frameState.context;\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n\n const maxGeometricError = primitive._tileProvider.getLevelMaximumGeometricError(\n tile.level\n );\n const pixelSize =\n Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) /\n Math.max(width, height);\n let error = maxGeometricError / pixelSize;\n\n if (frameState.fog.enabled && frameState.mode !== SceneMode.SCENE2D) {\n error -=\n CesiumMath.fog(tile._distance, frameState.fog.density) *\n frameState.fog.sse;\n }\n\n error /= frameState.pixelRatio;\n\n return error;\n}\n\nfunction addTileToRenderList(primitive, tile) {\n primitive._tilesToRender.push(tile);\n}\n\nfunction processTileLoadQueue(primitive, frameState) {\n const tileLoadQueueHigh = primitive._tileLoadQueueHigh;\n const tileLoadQueueMedium = primitive._tileLoadQueueMedium;\n const tileLoadQueueLow = primitive._tileLoadQueueLow;\n\n if (\n tileLoadQueueHigh.length === 0 &&\n tileLoadQueueMedium.length === 0 &&\n tileLoadQueueLow.length === 0\n ) {\n return;\n }\n\n // Remove any tiles that were not used this frame beyond the number\n // we're allowed to keep.\n primitive._tileReplacementQueue.trimTiles(primitive.tileCacheSize);\n\n const endTime = getTimestamp() + primitive._loadQueueTimeSlice;\n const tileProvider = primitive._tileProvider;\n\n let didSomeLoading = processSinglePriorityLoadQueue(\n primitive,\n frameState,\n tileProvider,\n endTime,\n tileLoadQueueHigh,\n false\n );\n didSomeLoading = processSinglePriorityLoadQueue(\n primitive,\n frameState,\n tileProvider,\n endTime,\n tileLoadQueueMedium,\n didSomeLoading\n );\n processSinglePriorityLoadQueue(\n primitive,\n frameState,\n tileProvider,\n endTime,\n tileLoadQueueLow,\n didSomeLoading\n );\n}\n\nfunction sortByLoadPriority(a, b) {\n return a._loadPriority - b._loadPriority;\n}\n\nfunction processSinglePriorityLoadQueue(\n primitive,\n frameState,\n tileProvider,\n endTime,\n loadQueue,\n didSomeLoading\n) {\n if (tileProvider.computeTileLoadPriority !== undefined) {\n loadQueue.sort(sortByLoadPriority);\n }\n\n for (\n let i = 0, len = loadQueue.length;\n i < len && (getTimestamp() < endTime || !didSomeLoading);\n ++i\n ) {\n const tile = loadQueue[i];\n primitive._tileReplacementQueue.markTileRendered(tile);\n tileProvider.loadTile(frameState, tile);\n didSomeLoading = true;\n }\n\n return didSomeLoading;\n}\n\nconst scratchRay = new Ray();\nconst scratchCartographic = new Cartographic();\nconst scratchPosition = new Cartesian3();\nconst scratchArray = [];\n\nfunction updateHeights(primitive, frameState) {\n if (!primitive.tileProvider.ready) {\n return;\n }\n\n const tryNextFrame = scratchArray;\n tryNextFrame.length = 0;\n const tilesToUpdateHeights = primitive._tileToUpdateHeights;\n\n const startTime = getTimestamp();\n const timeSlice = primitive._updateHeightsTimeSlice;\n const endTime = startTime + timeSlice;\n\n const mode = frameState.mode;\n const projection = frameState.mapProjection;\n const ellipsoid = primitive.tileProvider.tilingScheme.ellipsoid;\n let i;\n\n while (tilesToUpdateHeights.length > 0) {\n const tile = tilesToUpdateHeights[0];\n if (!defined(tile.data) || !defined(tile.data.mesh)) {\n // Tile isn't loaded enough yet, so try again next frame if this tile is still\n // being rendered.\n const selectionResult =\n tile._lastSelectionResultFrame === primitive._lastSelectionFrameNumber\n ? tile._lastSelectionResult\n : TileSelectionResult.NONE;\n if (\n selectionResult === TileSelectionResult.RENDERED ||\n selectionResult === TileSelectionResult.CULLED_BUT_NEEDED\n ) {\n tryNextFrame.push(tile);\n }\n tilesToUpdateHeights.shift();\n primitive._lastTileIndex = 0;\n continue;\n }\n const customData = tile.customData;\n const customDataLength = customData.length;\n\n let timeSliceMax = false;\n for (i = primitive._lastTileIndex; i < customDataLength; ++i) {\n const data = customData[i];\n\n // No need to run this code when the tile is upsampled, because the height will be the same as its parent.\n const terrainData = tile.data.terrainData;\n const upsampledGeometryFromParent =\n defined(terrainData) && terrainData.wasCreatedByUpsampling();\n\n if (tile.level > data.level && !upsampledGeometryFromParent) {\n if (!defined(data.positionOnEllipsoidSurface)) {\n // cartesian has to be on the ellipsoid surface for `ellipsoid.geodeticSurfaceNormal`\n data.positionOnEllipsoidSurface = Cartesian3.fromRadians(\n data.positionCartographic.longitude,\n data.positionCartographic.latitude,\n 0.0,\n ellipsoid\n );\n }\n\n if (mode === SceneMode.SCENE3D) {\n const surfaceNormal = ellipsoid.geodeticSurfaceNormal(\n data.positionOnEllipsoidSurface,\n scratchRay.direction\n );\n\n // compute origin point\n\n // Try to find the intersection point between the surface normal and z-axis.\n // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis(\n data.positionOnEllipsoidSurface,\n 11500.0,\n scratchRay.origin\n );\n\n // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid\n if (!defined(rayOrigin)) {\n // intersection point is outside the ellipsoid, try other value\n // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n let minimumHeight = 0.0;\n if (defined(tile.data.tileBoundingRegion)) {\n minimumHeight = tile.data.tileBoundingRegion.minimumHeight;\n }\n const magnitude = Math.min(minimumHeight, -11500.0);\n\n // multiply by the *positive* value of the magnitude\n const vectorToMinimumPoint = Cartesian3.multiplyByScalar(\n surfaceNormal,\n Math.abs(magnitude) + 1,\n scratchPosition\n );\n Cartesian3.subtract(\n data.positionOnEllipsoidSurface,\n vectorToMinimumPoint,\n scratchRay.origin\n );\n }\n } else {\n Cartographic.clone(data.positionCartographic, scratchCartographic);\n\n // minimum height for the terrain set, need to get this information from the terrain provider\n scratchCartographic.height = -11500.0;\n projection.project(scratchCartographic, scratchPosition);\n Cartesian3.fromElements(\n scratchPosition.z,\n scratchPosition.x,\n scratchPosition.y,\n scratchPosition\n );\n Cartesian3.clone(scratchPosition, scratchRay.origin);\n Cartesian3.clone(Cartesian3.UNIT_X, scratchRay.direction);\n }\n\n const position = tile.data.pick(\n scratchRay,\n mode,\n projection,\n false,\n scratchPosition\n );\n if (defined(position)) {\n if (defined(data.callback)) {\n data.callback(position);\n }\n data.level = tile.level;\n }\n }\n\n if (getTimestamp() >= endTime) {\n timeSliceMax = true;\n break;\n }\n }\n\n if (timeSliceMax) {\n primitive._lastTileIndex = i;\n break;\n } else {\n primitive._lastTileIndex = 0;\n tilesToUpdateHeights.shift();\n }\n }\n for (i = 0; i < tryNextFrame.length; i++) {\n tilesToUpdateHeights.push(tryNextFrame[i]);\n }\n}\n\nfunction createRenderCommandsForSelectedTiles(primitive, frameState) {\n const tileProvider = primitive._tileProvider;\n const tilesToRender = primitive._tilesToRender;\n\n for (let i = 0, len = tilesToRender.length; i < len; ++i) {\n const tile = tilesToRender[i];\n tileProvider.showTileThisFrame(tile, frameState);\n }\n}\nexport default QuadtreePrimitive;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidTerrainProvider from \"../Core/EllipsoidTerrainProvider.js\";\nimport Event from \"../Core/Event.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Ray from \"../Core/Ray.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport GlobeFS from \"../Shaders/GlobeFS.js\";\nimport GlobeVS from \"../Shaders/GlobeVS.js\";\nimport AtmosphereCommon from \"../Shaders/AtmosphereCommon.js\";\nimport GroundAtmosphere from \"../Shaders/GroundAtmosphere.js\";\nimport GlobeSurfaceShaderSet from \"./GlobeSurfaceShaderSet.js\";\nimport GlobeSurfaceTileProvider from \"./GlobeSurfaceTileProvider.js\";\nimport GlobeTranslucency from \"./GlobeTranslucency.js\";\nimport ImageryLayerCollection from \"./ImageryLayerCollection.js\";\nimport QuadtreePrimitive from \"./QuadtreePrimitive.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\n\n/**\n * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})\n * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.\n *\n * @alias Globe\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] Determines the size and shape of the\n * globe.\n */\nfunction Globe(ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n const terrainProvider = new EllipsoidTerrainProvider({\n ellipsoid: ellipsoid,\n });\n const imageryLayerCollection = new ImageryLayerCollection();\n\n this._ellipsoid = ellipsoid;\n this._imageryLayerCollection = imageryLayerCollection;\n\n this._surfaceShaderSet = new GlobeSurfaceShaderSet();\n this._material = undefined;\n\n this._surface = new QuadtreePrimitive({\n tileProvider: new GlobeSurfaceTileProvider({\n terrainProvider: terrainProvider,\n imageryLayers: imageryLayerCollection,\n surfaceShaderSet: this._surfaceShaderSet,\n }),\n });\n\n this._terrainProvider = terrainProvider;\n this._terrainProviderChanged = new Event();\n\n this._undergroundColor = Color.clone(Color.BLACK);\n this._undergroundColorAlphaByDistance = new NearFarScalar(\n ellipsoid.maximumRadius / 1000.0,\n 0.0,\n ellipsoid.maximumRadius / 5.0,\n 1.0\n );\n\n this._translucency = new GlobeTranslucency();\n\n makeShadersDirty(this);\n\n /**\n * Determines if the globe will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = true;\n\n this._oceanNormalMapResourceDirty = true;\n this._oceanNormalMapResource = new Resource({\n url: buildModuleUrl(\"Assets/Textures/waterNormalsSmall.jpg\"),\n });\n\n /**\n * The maximum screen-space error used to drive level-of-detail refinement. Higher\n * values will provide better performance but lower visual quality.\n *\n * @type {Number}\n * @default 2\n */\n this.maximumScreenSpaceError = 2;\n\n /**\n * The size of the terrain tile cache, expressed as a number of tiles. Any additional\n * tiles beyond this number will be freed, as long as they aren't needed for rendering\n * this frame. A larger number will consume more memory but will show detail faster\n * when, for example, zooming out and then back in.\n *\n * @type {Number}\n * @default 100\n */\n this.tileCacheSize = 100;\n\n /**\n * Gets or sets the number of loading descendant tiles that is considered \"too many\".\n * If a tile has too many loading descendants, that tile will be loaded and rendered before any of\n * its descendants are loaded and rendered. This means more feedback for the user that something\n * is happening at the cost of a longer overall load time. Setting this to 0 will cause each\n * tile level to be loaded successively, significantly increasing load time. Setting it to a large\n * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make\n * detail appear all at once after a long wait.\n * @type {Number}\n * @default 20\n */\n this.loadingDescendantLimit = 20;\n\n /**\n * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.\n * Setting this to true optimizes the zoom-out experience and provides more detail in\n * newly-exposed areas when panning. The down side is that it requires loading more tiles.\n * @type {Boolean}\n * @default true\n */\n this.preloadAncestors = true;\n\n /**\n * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.\n * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even\n * if they are culled. Setting this to true may provide a better panning experience at the\n * cost of loading more tiles.\n * @type {Boolean}\n * @default false\n */\n this.preloadSiblings = false;\n\n /**\n * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not\n * highlighted at all. The alpha value is used to alpha blend with the tile's\n * actual color. Because terrain fill tiles do not represent the actual terrain surface,\n * it may be useful in some applications to indicate visually that they are not to be trusted.\n * @type {Color}\n * @default undefined\n */\n this.fillHighlightColor = undefined;\n\n /**\n * Enable lighting the globe with the scene's light source.\n *\n * @type {Boolean}\n * @default false\n */\n this.enableLighting = false;\n\n /**\n * A multiplier to adjust terrain lambert lighting.\n * This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl.\n * This only takes effect when <code>enableLighting</code> is <code>true</code>.\n *\n * @type {Number}\n * @default 0.9\n */\n this.lambertDiffuseMultiplier = 0.9;\n\n /**\n * Enable dynamic lighting effects on atmosphere and fog. This only takes effect\n * when <code>enableLighting</code> is <code>true</code>.\n *\n * @type {Boolean}\n * @default true\n */\n this.dynamicAtmosphereLighting = true;\n\n /**\n * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's\n * light direction. This only takes effect when <code>enableLighting</code> and\n * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n *\n * @type {Boolean}\n * @default false\n */\n this.dynamicAtmosphereLightingFromSun = false;\n\n /**\n * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.\n *\n * @type {Boolean}\n * @default true\n */\n this.showGroundAtmosphere = true;\n\n /**\n * The intensity of the light that is used for computing the ground atmosphere color.\n *\n * @type {Number}\n * @default 10.0\n */\n this.atmosphereLightIntensity = 10.0;\n\n /**\n * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.\n *\n * @type {Cartesian3}\n * @default Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)\n */\n this.atmosphereRayleighCoefficient = new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6);\n\n /**\n * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.\n *\n * @type {Cartesian3}\n * @default Cartesian3(21e-6, 21e-6, 21e-6)\n */\n this.atmosphereMieCoefficient = new Cartesian3(21e-6, 21e-6, 21e-6);\n\n /**\n * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.\n *\n * @type {Number}\n * @default 10000.0\n */\n this.atmosphereRayleighScaleHeight = 10000.0;\n\n /**\n * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.\n *\n * @type {Number}\n * @default 3200.0\n */\n this.atmosphereMieScaleHeight = 3200.0;\n\n /**\n * The anisotropy of the medium to consider for Mie scattering.\n * <p>\n * Valid values are between -1.0 and 1.0.\n * </p>\n * @type {Number}\n * @default 0.9\n */\n this.atmosphereMieAnisotropy = 0.9;\n\n /**\n * The distance where everything becomes lit. This only takes effect\n * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.\n *\n * @type {Number}\n * @default 10000000.0\n */\n this.lightingFadeOutDistance = 1.0e7;\n\n /**\n * The distance where lighting resumes. This only takes effect\n * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.\n *\n * @type {Number}\n * @default 20000000.0\n */\n this.lightingFadeInDistance = 2.0e7;\n\n /**\n * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.\n * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and\n * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n *\n * @type {Number}\n * @default 10000000.0\n */\n this.nightFadeOutDistance = 1.0e7;\n\n /**\n * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.\n * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and\n * <code>dynamicAtmosphereLighting</code> are <code>true</code>.\n *\n * @type {Number}\n * @default 50000000.0\n */\n this.nightFadeInDistance = 5.0e7;\n\n /**\n * True if an animated wave effect should be shown in areas of the globe\n * covered by water; otherwise, false. This property is ignored if the\n * <code>terrainProvider</code> does not provide a water mask.\n *\n * @type {Boolean}\n * @default true\n */\n this.showWaterEffect = true;\n\n /**\n * True if primitives such as billboards, polylines, labels, etc. should be depth-tested\n * against the terrain surface, or false if such primitives should always be drawn on top\n * of terrain unless they're on the opposite side of the globe. The disadvantage of depth\n * testing primitives against terrain is that slight numerical noise or terrain level-of-detail\n * switched can sometimes make a primitive that should be on the surface disappear underneath it.\n *\n * @type {Boolean}\n * @default false\n *\n */\n this.depthTestAgainstTerrain = false;\n\n /**\n * Determines whether the globe casts or receives shadows from light sources. Setting the globe\n * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.\n * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.\n *\n * @type {ShadowMode}\n * @default ShadowMode.RECEIVE_ONLY\n */\n this.shadows = ShadowMode.RECEIVE_ONLY;\n\n /**\n * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A hue shift of 1.0 indicates a complete rotation of the hues available.\n * @type {Number}\n * @default 0.0\n */\n this.atmosphereHueShift = 0.0;\n\n /**\n * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A saturation shift of -1.0 is monochrome.\n * @type {Number}\n * @default 0.0\n */\n this.atmosphereSaturationShift = 0.0;\n\n /**\n * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A brightness shift of -1.0 is complete darkness, which will let space show through.\n * @type {Number}\n * @default 0.0\n */\n this.atmosphereBrightnessShift = 0.0;\n\n /**\n * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).\n * A value of <code>2.0</code> scales the terrain by 2x.\n * A value of <code>0.0</code> makes the terrain completely flat.\n * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.\n * @type {Number}\n * @default 1.0\n */\n this.terrainExaggeration = 1.0;\n\n /**\n * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).\n * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.\n * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.\n * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.\n * @type {Number}\n * @default 0.0\n */\n this.terrainExaggerationRelativeHeight = 0.0;\n\n /**\n * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.\n * Skirts are always hidden when the camera is underground or translucency is enabled.\n *\n * @type {Boolean}\n * @default true\n */\n this.showSkirts = true;\n\n /**\n * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.\n *\n * @type {Boolean}\n * @default true\n */\n this.backFaceCulling = true;\n\n this._oceanNormalMap = undefined;\n this._zoomedOutOceanSpecularIntensity = undefined;\n}\n\nObject.defineProperties(Globe.prototype, {\n /**\n * Gets an ellipsoid describing the shape of this globe.\n * @memberof Globe.prototype\n * @type {Ellipsoid}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n /**\n * Gets the collection of image layers that will be rendered on this globe.\n * @memberof Globe.prototype\n * @type {ImageryLayerCollection}\n */\n imageryLayers: {\n get: function () {\n return this._imageryLayerCollection;\n },\n },\n /**\n * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.\n *\n * @memberof Globe.prototype\n * @type {Event}\n * @readonly\n */\n imageryLayersUpdatedEvent: {\n get: function () {\n return this._surface.tileProvider.imageryLayersUpdatedEvent;\n },\n },\n /**\n * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,\n * all terrain and imagery for the current view have been loaded.\n * @memberof Globe.prototype\n * @type {Boolean}\n * @readonly\n */\n tilesLoaded: {\n get: function () {\n if (!defined(this._surface)) {\n return true;\n }\n return (\n this._surface.tileProvider.ready &&\n this._surface._tileLoadQueueHigh.length === 0 &&\n this._surface._tileLoadQueueMedium.length === 0 &&\n this._surface._tileLoadQueueLow.length === 0\n );\n },\n },\n /**\n * Gets or sets the color of the globe when no imagery is available.\n * @memberof Globe.prototype\n * @type {Color}\n */\n baseColor: {\n get: function () {\n return this._surface.tileProvider.baseColor;\n },\n set: function (value) {\n this._surface.tileProvider.baseColor = value;\n },\n },\n /**\n * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.\n *\n * @memberof Globe.prototype\n * @type {ClippingPlaneCollection}\n */\n clippingPlanes: {\n get: function () {\n return this._surface.tileProvider.clippingPlanes;\n },\n set: function (value) {\n this._surface.tileProvider.clippingPlanes = value;\n },\n },\n /**\n * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.\n * Defaults to the maximum extent of cartographic coordinates.\n *\n * @memberof Globe.prototype\n * @type {Rectangle}\n * @default {@link Rectangle.MAX_VALUE}\n */\n cartographicLimitRectangle: {\n get: function () {\n return this._surface.tileProvider.cartographicLimitRectangle;\n },\n set: function (value) {\n if (!defined(value)) {\n value = Rectangle.clone(Rectangle.MAX_VALUE);\n }\n this._surface.tileProvider.cartographicLimitRectangle = value;\n },\n },\n /**\n * The normal map to use for rendering waves in the ocean. Setting this property will\n * only have an effect if the configured terrain provider includes a water mask.\n * @memberof Globe.prototype\n * @type {String}\n * @default buildModuleUrl('Assets/Textures/waterNormalsSmall.jpg')\n */\n oceanNormalMapUrl: {\n get: function () {\n return this._oceanNormalMapResource.url;\n },\n set: function (value) {\n this._oceanNormalMapResource.url = value;\n this._oceanNormalMapResourceDirty = true;\n },\n },\n /**\n * The terrain provider providing surface geometry for this globe.\n * @type {TerrainProvider}\n *\n * @memberof Globe.prototype\n * @type {TerrainProvider}\n *\n */\n terrainProvider: {\n get: function () {\n return this._terrainProvider;\n },\n set: function (value) {\n if (value !== this._terrainProvider) {\n this._terrainProvider = value;\n this._terrainProviderChanged.raiseEvent(value);\n if (defined(this._material)) {\n makeShadersDirty(this);\n }\n }\n },\n },\n /**\n * Gets an event that's raised when the terrain provider is changed\n *\n * @memberof Globe.prototype\n * @type {Event}\n * @readonly\n */\n terrainProviderChanged: {\n get: function () {\n return this._terrainProviderChanged;\n },\n },\n /**\n * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty,\n * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.\n *\n * @memberof Globe.prototype\n * @type {Event}\n */\n tileLoadProgressEvent: {\n get: function () {\n return this._surface.tileLoadProgressEvent;\n },\n },\n\n /**\n * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with\n * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n * @memberof Globe.prototype\n * @type {Material | undefined}\n */\n material: {\n get: function () {\n return this._material;\n },\n set: function (material) {\n if (this._material !== material) {\n this._material = material;\n makeShadersDirty(this);\n }\n },\n },\n\n /**\n * The color to render the back side of the globe when the camera is underground or the globe is translucent,\n * blended with the globe color based on the camera's distance.\n * <br /><br />\n * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.\n *\n * @memberof Globe.prototype\n * @type {Color}\n * @default {@link Color.BLACK}\n *\n * @see Globe#undergroundColorAlphaByDistance\n */\n undergroundColor: {\n get: function () {\n return this._undergroundColor;\n },\n set: function (value) {\n this._undergroundColor = Color.clone(value, this._undergroundColor);\n },\n },\n\n /**\n * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.\n * The alpha will interpolate between the {@link NearFarScalar#nearValue} and\n * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds\n * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.\n * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,\n * the underground color will not be blended with the globe color.\n * <br /> <br />\n * When the camera is above the ellipsoid the distance is computed from the nearest\n * point on the ellipsoid instead of the camera's position.\n *\n * @memberof Globe.prototype\n * @type {NearFarScalar}\n *\n * @see Globe#undergroundColor\n *\n */\n undergroundColorAlphaByDistance: {\n get: function () {\n return this._undergroundColorAlphaByDistance;\n },\n set: function (value) {\nthis._undergroundColorAlphaByDistance = NearFarScalar.clone(\n value,\n this._undergroundColorAlphaByDistance\n );\n },\n },\n\n /**\n * Properties for controlling globe translucency.\n *\n * @memberof Globe.prototype\n * @type {GlobeTranslucency}\n */\n translucency: {\n get: function () {\n return this._translucency;\n },\n },\n});\n\nfunction makeShadersDirty(globe) {\n const defines = [];\n\n const requireNormals =\n defined(globe._material) &&\n (globe._material.shaderSource.match(/slope/) ||\n globe._material.shaderSource.match(\"normalEC\"));\n\n const fragmentSources = [AtmosphereCommon, GroundAtmosphere];\n if (\n defined(globe._material) &&\n (!requireNormals || globe._terrainProvider.requestVertexNormals)\n ) {\n fragmentSources.push(globe._material.shaderSource);\n defines.push(\"APPLY_MATERIAL\");\n globe._surface._tileProvider.materialUniformMap = globe._material._uniforms;\n } else {\n globe._surface._tileProvider.materialUniformMap = undefined;\n }\n fragmentSources.push(GlobeFS);\n\n globe._surfaceShaderSet.baseVertexShaderSource = new ShaderSource({\n sources: [AtmosphereCommon, GroundAtmosphere, GlobeVS],\n defines: defines,\n });\n\n globe._surfaceShaderSet.baseFragmentShaderSource = new ShaderSource({\n sources: fragmentSources,\n defines: defines,\n });\n globe._surfaceShaderSet.material = globe._material;\n}\n\nfunction createComparePickTileFunction(rayOrigin) {\n return function (a, b) {\n const aDist = BoundingSphere.distanceSquaredTo(\n a.pickBoundingSphere,\n rayOrigin\n );\n const bDist = BoundingSphere.distanceSquaredTo(\n b.pickBoundingSphere,\n rayOrigin\n );\n\n return aDist - bDist;\n };\n}\n\nconst scratchArray = [];\nconst scratchSphereIntersectionResult = {\n start: 0.0,\n stop: 0.0,\n};\n\n/**\n * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @param {Boolean} [cullBackFaces=true] Set to true to not pick back faces.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found. The returned position is in projected coordinates for 2D and Columbus View.\n *\n * @private\n */\nGlobe.prototype.pickWorldCoordinates = function (\n ray,\n scene,\n cullBackFaces,\n result\n) {\n cullBackFaces = defaultValue(cullBackFaces, true);\n\n const mode = scene.mode;\n const projection = scene.mapProjection;\n\n const sphereIntersections = scratchArray;\n sphereIntersections.length = 0;\n\n const tilesToRender = this._surface._tilesToRender;\n let length = tilesToRender.length;\n\n let tile;\n let i;\n\n for (i = 0; i < length; ++i) {\n tile = tilesToRender[i];\n const surfaceTile = tile.data;\n\n if (!defined(surfaceTile)) {\n continue;\n }\n\n let boundingVolume = surfaceTile.pickBoundingSphere;\n if (mode !== SceneMode.SCENE3D) {\n surfaceTile.pickBoundingSphere = boundingVolume = BoundingSphere.fromRectangleWithHeights2D(\n tile.rectangle,\n projection,\n surfaceTile.tileBoundingRegion.minimumHeight,\n surfaceTile.tileBoundingRegion.maximumHeight,\n boundingVolume\n );\n Cartesian3.fromElements(\n boundingVolume.center.z,\n boundingVolume.center.x,\n boundingVolume.center.y,\n boundingVolume.center\n );\n } else if (defined(surfaceTile.renderedMesh)) {\n BoundingSphere.clone(\n surfaceTile.tileBoundingRegion.boundingSphere,\n boundingVolume\n );\n } else {\n // So wait how did we render this thing then? It shouldn't be possible to get here.\n continue;\n }\n\n const boundingSphereIntersection = IntersectionTests.raySphere(\n ray,\n boundingVolume,\n scratchSphereIntersectionResult\n );\n if (defined(boundingSphereIntersection)) {\n sphereIntersections.push(surfaceTile);\n }\n }\n\n sphereIntersections.sort(createComparePickTileFunction(ray.origin));\n\n let intersection;\n length = sphereIntersections.length;\n for (i = 0; i < length; ++i) {\n intersection = sphereIntersections[i].pick(\n ray,\n scene.mode,\n scene.mapProjection,\n cullBackFaces,\n result\n );\n if (defined(intersection)) {\n break;\n }\n }\n\n return intersection;\n};\n\nconst cartoScratch = new Cartographic();\n/**\n * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.\n *\n * @param {Ray} ray The ray to test for intersection.\n * @param {Scene} scene The scene.\n * @param {Cartesian3} [result] The object onto which to store the result.\n * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.\n *\n * @example\n * // find intersection of ray through a pixel and the globe\n * const ray = viewer.camera.getPickRay(windowCoordinates);\n * const intersection = globe.pick(ray, scene);\n */\nGlobe.prototype.pick = function (ray, scene, result) {\n result = this.pickWorldCoordinates(ray, scene, true, result);\n if (defined(result) && scene.mode !== SceneMode.SCENE3D) {\n result = Cartesian3.fromElements(result.y, result.z, result.x, result);\n const carto = scene.mapProjection.unproject(result, cartoScratch);\n result = scene.globe.ellipsoid.cartographicToCartesian(carto, result);\n }\n\n return result;\n};\n\nconst scratchGetHeightCartesian = new Cartesian3();\nconst scratchGetHeightIntersection = new Cartesian3();\nconst scratchGetHeightCartographic = new Cartographic();\nconst scratchGetHeightRay = new Ray();\n\nfunction tileIfContainsCartographic(tile, cartographic) {\n return defined(tile) && Rectangle.contains(tile.rectangle, cartographic)\n ? tile\n : undefined;\n}\n\n/**\n * Get the height of the surface at a given cartographic.\n *\n * @param {Cartographic} cartographic The cartographic for which to find the height.\n * @returns {Number|undefined} The height of the cartographic or undefined if it could not be found.\n */\nGlobe.prototype.getHeight = function (cartographic) {\n const levelZeroTiles = this._surface._levelZeroTiles;\n if (!defined(levelZeroTiles)) {\n return;\n }\n\n let tile;\n let i;\n\n const length = levelZeroTiles.length;\n for (i = 0; i < length; ++i) {\n tile = levelZeroTiles[i];\n if (Rectangle.contains(tile.rectangle, cartographic)) {\n break;\n }\n }\n\n if (i >= length) {\n return undefined;\n }\n\n let tileWithMesh = tile;\n\n while (defined(tile)) {\n tile =\n tileIfContainsCartographic(tile._southwestChild, cartographic) ||\n tileIfContainsCartographic(tile._southeastChild, cartographic) ||\n tileIfContainsCartographic(tile._northwestChild, cartographic) ||\n tile._northeastChild;\n\n if (\n defined(tile) &&\n defined(tile.data) &&\n defined(tile.data.renderedMesh)\n ) {\n tileWithMesh = tile;\n }\n }\n\n tile = tileWithMesh;\n\n // This tile was either rendered or culled.\n // It is sometimes useful to get a height from a culled tile,\n // e.g. when we're getting a height in order to place a billboard\n // on terrain, and the camera is looking at that same billboard.\n // The culled tile must have a valid mesh, though.\n if (\n !defined(tile) ||\n !defined(tile.data) ||\n !defined(tile.data.renderedMesh)\n ) {\n // Tile was not rendered (culled).\n return undefined;\n }\n\n const projection = this._surface._tileProvider.tilingScheme.projection;\n const ellipsoid = this._surface._tileProvider.tilingScheme.ellipsoid;\n\n //cartesian has to be on the ellipsoid surface for `ellipsoid.geodeticSurfaceNormal`\n const cartesian = Cartesian3.fromRadians(\n cartographic.longitude,\n cartographic.latitude,\n 0.0,\n ellipsoid,\n scratchGetHeightCartesian\n );\n\n const ray = scratchGetHeightRay;\n const surfaceNormal = ellipsoid.geodeticSurfaceNormal(\n cartesian,\n ray.direction\n );\n\n // Try to find the intersection point between the surface normal and z-axis.\n // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n const rayOrigin = ellipsoid.getSurfaceNormalIntersectionWithZAxis(\n cartesian,\n 11500.0,\n ray.origin\n );\n\n // Theoretically, not with Earth datums, the intersection point can be outside the ellipsoid\n if (!defined(rayOrigin)) {\n // intersection point is outside the ellipsoid, try other value\n // minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider\n let minimumHeight;\n if (defined(tile.data.tileBoundingRegion)) {\n minimumHeight = tile.data.tileBoundingRegion.minimumHeight;\n }\n const magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);\n\n // multiply by the *positive* value of the magnitude\n const vectorToMinimumPoint = Cartesian3.multiplyByScalar(\n surfaceNormal,\n Math.abs(magnitude) + 1,\n scratchGetHeightIntersection\n );\n Cartesian3.subtract(cartesian, vectorToMinimumPoint, ray.origin);\n }\n\n const intersection = tile.data.pick(\n ray,\n undefined,\n projection,\n false,\n scratchGetHeightIntersection\n );\n if (!defined(intersection)) {\n return undefined;\n }\n\n return ellipsoid.cartesianToCartographic(\n intersection,\n scratchGetHeightCartographic\n ).height;\n};\n\n/**\n * @private\n */\nGlobe.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n if (frameState.passes.render) {\n this._surface.update(frameState);\n }\n};\n\n/**\n * @private\n */\nGlobe.prototype.beginFrame = function (frameState) {\n const surface = this._surface;\n const tileProvider = surface.tileProvider;\n const terrainProvider = this.terrainProvider;\n const hasWaterMask =\n this.showWaterEffect &&\n terrainProvider.ready &&\n terrainProvider.hasWaterMask;\n\n if (hasWaterMask && this._oceanNormalMapResourceDirty) {\n // url changed, load new normal map asynchronously\n this._oceanNormalMapResourceDirty = false;\n const oceanNormalMapResource = this._oceanNormalMapResource;\n const oceanNormalMapUrl = oceanNormalMapResource.url;\n if (defined(oceanNormalMapUrl)) {\n const that = this;\n oceanNormalMapResource.fetchImage().then(function (image) {\n if (oceanNormalMapUrl !== that._oceanNormalMapResource.url) {\n // url changed while we were loading\n return;\n }\n\n that._oceanNormalMap =\n that._oceanNormalMap && that._oceanNormalMap.destroy();\n that._oceanNormalMap = new Texture({\n context: frameState.context,\n source: image,\n });\n });\n } else {\n this._oceanNormalMap =\n this._oceanNormalMap && this._oceanNormalMap.destroy();\n }\n }\n\n const pass = frameState.passes;\n const mode = frameState.mode;\n\n if (pass.render) {\n if (this.showGroundAtmosphere) {\n this._zoomedOutOceanSpecularIntensity = 0.4;\n } else {\n this._zoomedOutOceanSpecularIntensity = 0.5;\n }\n\n surface.maximumScreenSpaceError = this.maximumScreenSpaceError;\n surface.tileCacheSize = this.tileCacheSize;\n surface.loadingDescendantLimit = this.loadingDescendantLimit;\n surface.preloadAncestors = this.preloadAncestors;\n surface.preloadSiblings = this.preloadSiblings;\n\n tileProvider.terrainProvider = this.terrainProvider;\n tileProvider.lightingFadeOutDistance = this.lightingFadeOutDistance;\n tileProvider.lightingFadeInDistance = this.lightingFadeInDistance;\n tileProvider.nightFadeOutDistance = this.nightFadeOutDistance;\n tileProvider.nightFadeInDistance = this.nightFadeInDistance;\n tileProvider.zoomedOutOceanSpecularIntensity =\n mode === SceneMode.SCENE3D ? this._zoomedOutOceanSpecularIntensity : 0.0;\n tileProvider.hasWaterMask = hasWaterMask;\n tileProvider.oceanNormalMap = this._oceanNormalMap;\n tileProvider.enableLighting = this.enableLighting;\n tileProvider.dynamicAtmosphereLighting = this.dynamicAtmosphereLighting;\n tileProvider.dynamicAtmosphereLightingFromSun = this.dynamicAtmosphereLightingFromSun;\n tileProvider.showGroundAtmosphere = this.showGroundAtmosphere;\n tileProvider.atmosphereLightIntensity = this.atmosphereLightIntensity;\n tileProvider.atmosphereRayleighCoefficient = this.atmosphereRayleighCoefficient;\n tileProvider.atmosphereMieCoefficient = this.atmosphereMieCoefficient;\n tileProvider.atmosphereRayleighScaleHeight = this.atmosphereRayleighScaleHeight;\n tileProvider.atmosphereMieScaleHeight = this.atmosphereMieScaleHeight;\n tileProvider.atmosphereMieAnisotropy = this.atmosphereMieAnisotropy;\n tileProvider.shadows = this.shadows;\n tileProvider.hueShift = this.atmosphereHueShift;\n tileProvider.saturationShift = this.atmosphereSaturationShift;\n tileProvider.brightnessShift = this.atmosphereBrightnessShift;\n tileProvider.fillHighlightColor = this.fillHighlightColor;\n tileProvider.showSkirts = this.showSkirts;\n tileProvider.backFaceCulling = this.backFaceCulling;\n tileProvider.undergroundColor = this._undergroundColor;\n tileProvider.undergroundColorAlphaByDistance = this._undergroundColorAlphaByDistance;\n tileProvider.lambertDiffuseMultiplier = this.lambertDiffuseMultiplier;\n surface.beginFrame(frameState);\n }\n};\n\n/**\n * @private\n */\nGlobe.prototype.render = function (frameState) {\n if (!this.show) {\n return;\n }\n\n if (defined(this._material)) {\n this._material.update(frameState.context);\n }\n\n this._surface.render(frameState);\n};\n\n/**\n * @private\n */\nGlobe.prototype.endFrame = function (frameState) {\n if (!this.show) {\n return;\n }\n\n if (frameState.passes.render) {\n this._surface.endFrame(frameState);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see Globe#destroy\n */\nGlobe.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * globe = globe && globe.destroy();\n *\n * @see Globe#isDestroyed\n */\nGlobe.prototype.destroy = function () {\n this._surfaceShaderSet =\n this._surfaceShaderSet && this._surfaceShaderSet.destroy();\n this._surface = this._surface && this._surface.destroy();\n this._oceanNormalMap = this._oceanNormalMap && this._oceanNormalMap.destroy();\n return destroyObject(this);\n};\nexport default Globe;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform highp sampler2D u_depthTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PassThroughDepth from \"../Shaders/PostProcessStages/PassThroughDepth.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * @private\n */\nfunction GlobeDepth() {\n this._picking = false;\n this._numSamples = 1;\n this._tempCopyDepthTexture = undefined;\n\n this._pickColorFramebuffer = new FramebufferManager({\n depthStencil: true,\n supportsDepthTexture: true,\n });\n this._outputFramebuffer = new FramebufferManager({\n depthStencil: true,\n supportsDepthTexture: true,\n });\n this._copyDepthFramebuffer = new FramebufferManager();\n this._tempCopyDepthFramebuffer = new FramebufferManager();\n this._updateDepthFramebuffer = new FramebufferManager({\n createColorAttachments: false,\n createDepthAttachments: false,\n depthStencil: true,\n });\n\n this._clearGlobeColorCommand = undefined;\n this._copyColorCommand = undefined;\n this._copyDepthCommand = undefined;\n this._tempCopyDepthCommand = undefined;\n this._updateDepthCommand = undefined;\n\n this._viewport = new BoundingRectangle();\n this._rs = undefined;\n this._rsBlend = undefined;\n this._rsUpdate = undefined;\n\n this._useScissorTest = false;\n this._scissorRectangle = undefined;\n\n this._useHdr = undefined;\n this._clearGlobeDepth = undefined;\n}\n\nObject.defineProperties(GlobeDepth.prototype, {\n colorFramebufferManager: {\n get: function () {\n return this._picking\n ? this._pickColorFramebuffer\n : this._outputFramebuffer;\n },\n },\n framebuffer: {\n get: function () {\n return this.colorFramebufferManager.framebuffer;\n },\n },\n depthStencilTexture: {\n get: function () {\n return this.colorFramebufferManager.getDepthStencilTexture();\n },\n },\n picking: {\n get: function () {\n return this._picking;\n },\n set: function (value) {\n this._picking = value;\n },\n },\n});\n\nfunction destroyFramebuffers(globeDepth) {\n globeDepth._pickColorFramebuffer.destroy();\n globeDepth._outputFramebuffer.destroy();\n globeDepth._copyDepthFramebuffer.destroy();\n globeDepth._tempCopyDepthFramebuffer.destroy();\n globeDepth._updateDepthFramebuffer.destroy();\n}\n\nfunction updateCopyCommands(globeDepth, context, width, height, passState) {\n globeDepth._viewport.width = width;\n globeDepth._viewport.height = height;\n\n const useScissorTest = !BoundingRectangle.equals(\n globeDepth._viewport,\n passState.viewport\n );\n let updateScissor = useScissorTest !== globeDepth._useScissorTest;\n globeDepth._useScissorTest = useScissorTest;\n\n if (\n !BoundingRectangle.equals(globeDepth._scissorRectangle, passState.viewport)\n ) {\n globeDepth._scissorRectangle = BoundingRectangle.clone(\n passState.viewport,\n globeDepth._scissorRectangle\n );\n updateScissor = true;\n }\n\n if (\n !defined(globeDepth._rs) ||\n !BoundingRectangle.equals(globeDepth._viewport, globeDepth._rs.viewport) ||\n updateScissor\n ) {\n globeDepth._rs = RenderState.fromCache({\n viewport: globeDepth._viewport,\n scissorTest: {\n enabled: globeDepth._useScissorTest,\n rectangle: globeDepth._scissorRectangle,\n },\n });\n globeDepth._rsBlend = RenderState.fromCache({\n viewport: globeDepth._viewport,\n scissorTest: {\n enabled: globeDepth._useScissorTest,\n rectangle: globeDepth._scissorRectangle,\n },\n blending: BlendingState.ALPHA_BLEND,\n });\n\n // Copy packed depth only if the 3D Tiles bit is set\n globeDepth._rsUpdate = RenderState.fromCache({\n viewport: globeDepth._viewport,\n scissorTest: {\n enabled: globeDepth._useScissorTest,\n rectangle: globeDepth._scissorRectangle,\n },\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.EQUAL,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: StencilFunction.NEVER,\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n mask: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n });\n }\n\n if (!defined(globeDepth._copyDepthCommand)) {\n globeDepth._copyDepthCommand = context.createViewportQuadCommand(\n PassThroughDepth,\n {\n uniformMap: {\n u_depthTexture: function () {\n return globeDepth.colorFramebufferManager.getDepthStencilTexture();\n },\n },\n owner: globeDepth,\n }\n );\n }\n\n globeDepth._copyDepthCommand.framebuffer =\n globeDepth._copyDepthFramebuffer.framebuffer;\n globeDepth._copyDepthCommand.renderState = globeDepth._rs;\n\n if (!defined(globeDepth._copyColorCommand)) {\n globeDepth._copyColorCommand = context.createViewportQuadCommand(\n PassThrough,\n {\n uniformMap: {\n colorTexture: function () {\n return globeDepth.colorFramebufferManager.getColorTexture();\n },\n },\n owner: globeDepth,\n }\n );\n }\n\n globeDepth._copyColorCommand.renderState = globeDepth._rs;\n\n if (!defined(globeDepth._tempCopyDepthCommand)) {\n globeDepth._tempCopyDepthCommand = context.createViewportQuadCommand(\n PassThroughDepth,\n {\n uniformMap: {\n u_depthTexture: function () {\n return globeDepth._tempCopyDepthTexture;\n },\n },\n owner: globeDepth,\n }\n );\n }\n\n globeDepth._tempCopyDepthCommand.framebuffer =\n globeDepth._tempCopyDepthFramebuffer.framebuffer;\n globeDepth._tempCopyDepthCommand.renderState = globeDepth._rs;\n\n if (!defined(globeDepth._updateDepthCommand)) {\n globeDepth._updateDepthCommand = context.createViewportQuadCommand(\n PassThrough,\n {\n uniformMap: {\n colorTexture: function () {\n return globeDepth._tempCopyDepthFramebuffer.getColorTexture();\n },\n },\n owner: globeDepth,\n }\n );\n }\n\n globeDepth._updateDepthCommand.framebuffer =\n globeDepth._updateDepthFramebuffer.framebuffer;\n globeDepth._updateDepthCommand.renderState = globeDepth._rsUpdate;\n\n if (!defined(globeDepth._clearGlobeColorCommand)) {\n globeDepth._clearGlobeColorCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n stencil: 0.0,\n owner: globeDepth,\n });\n }\n\n globeDepth._clearGlobeColorCommand.framebuffer = globeDepth.framebuffer;\n}\n\nGlobeDepth.prototype.update = function (\n context,\n passState,\n viewport,\n numSamples,\n hdr,\n clearGlobeDepth\n) {\n const width = viewport.width;\n const height = viewport.height;\n\n const pixelDatatype = hdr\n ? context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT\n : PixelDatatype.UNSIGNED_BYTE;\n this._numSamples = numSamples;\n if (this.picking) {\n this._pickColorFramebuffer.update(context, width, height);\n } else {\n this._outputFramebuffer.update(\n context,\n width,\n height,\n numSamples,\n pixelDatatype\n );\n }\n this._copyDepthFramebuffer.update(context, width, height);\n updateCopyCommands(this, context, width, height, passState);\n context.uniformState.globeDepthTexture = undefined;\n\n this._useHdr = hdr;\n this._clearGlobeDepth = clearGlobeDepth;\n};\n\nGlobeDepth.prototype.prepareColorTextures = function (context, blitStencil) {\n if (!this.picking && this._numSamples > 1) {\n this._outputFramebuffer.prepareTextures(context, blitStencil);\n }\n};\n\nGlobeDepth.prototype.executeCopyDepth = function (context, passState) {\n if (defined(this._copyDepthCommand)) {\n this.prepareColorTextures(context);\n this._copyDepthCommand.execute(context, passState);\n context.uniformState.globeDepthTexture = this._copyDepthFramebuffer.getColorTexture();\n }\n};\n\nGlobeDepth.prototype.executeUpdateDepth = function (\n context,\n passState,\n clearGlobeDepth,\n depthTexture\n) {\n const depthTextureToCopy = defined(depthTexture)\n ? depthTexture\n : passState.framebuffer.depthStencilTexture;\n if (\n clearGlobeDepth ||\n depthTextureToCopy !== this.colorFramebufferManager.getDepthStencilTexture()\n ) {\n // First copy the depth to a temporary globe depth texture, then update the\n // main globe depth texture where the stencil bit for 3D Tiles is set.\n // This preserves the original globe depth except where 3D Tiles is rendered.\n // The additional texture and framebuffer resources are created on demand.\n if (defined(this._updateDepthCommand)) {\n if (\n !defined(this._updateDepthFramebuffer.framebuffer) ||\n this._updateDepthFramebuffer.getDepthStencilTexture() !==\n depthTextureToCopy ||\n this._updateDepthFramebuffer.getColorTexture() !==\n this._copyDepthFramebuffer.getColorTexture()\n ) {\n const width = this._copyDepthFramebuffer.getColorTexture().width;\n const height = this._copyDepthFramebuffer.getColorTexture().height;\n this._tempCopyDepthFramebuffer.destroy();\n this._tempCopyDepthFramebuffer.update(context, width, height);\n\n const colorTexture = this._copyDepthFramebuffer.getColorTexture();\n this._updateDepthFramebuffer.setColorTexture(colorTexture, 0);\n this._updateDepthFramebuffer.setDepthStencilTexture(depthTextureToCopy);\n this._updateDepthFramebuffer.update(context, width, height);\n\n updateCopyCommands(this, context, width, height, passState);\n }\n this._tempCopyDepthTexture = depthTextureToCopy;\n this._tempCopyDepthCommand.execute(context, passState);\n this._updateDepthCommand.execute(context, passState);\n }\n return;\n }\n\n // Fast path - the depth texture can be copied normally.\n if (defined(this._copyDepthCommand)) {\n this._copyDepthCommand.execute(context, passState);\n }\n};\n\nGlobeDepth.prototype.executeCopyColor = function (context, passState) {\n if (defined(this._copyColorCommand)) {\n this._copyColorCommand.execute(context, passState);\n }\n};\n\nGlobeDepth.prototype.clear = function (context, passState, clearColor) {\n const clear = this._clearGlobeColorCommand;\n if (defined(clear)) {\n Color.clone(clearColor, clear.color);\n this.colorFramebufferManager.clear(context, clear, passState);\n }\n};\n\nGlobeDepth.prototype.isDestroyed = function () {\n return false;\n};\n\nGlobeDepth.prototype.destroy = function () {\n destroyFramebuffers(this);\n\n if (defined(this._copyColorCommand)) {\n this._copyColorCommand.shaderProgram = this._copyColorCommand.shaderProgram.destroy();\n }\n\n if (defined(this._copyDepthCommand)) {\n this._copyDepthCommand.shaderProgram = this._copyDepthCommand.shaderProgram.destroy();\n }\n\n if (defined(this._tempCopyDepthCommand)) {\n this._tempCopyDepthCommand.shaderProgram = this._tempCopyDepthCommand.shaderProgram.destroy();\n }\n\n if (defined(this._updateDepthCommand)) {\n this._updateDepthCommand.shaderProgram = this._updateDepthCommand.shaderProgram.destroy();\n }\n\n return destroyObject(this);\n};\nexport default GlobeDepth;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport PassThroughDepth from \"../Shaders/PostProcessStages/PassThroughDepth.js\";\n\n/**\n * @private\n */\nfunction GlobeTranslucencyFramebuffer() {\n this._framebuffer = new FramebufferManager({\n depthStencil: true,\n supportsDepthTexture: true,\n });\n this._packedDepthFramebuffer = new FramebufferManager();\n\n this._renderState = undefined;\n\n this._packedDepthCommand = undefined;\n this._clearCommand = undefined;\n\n this._viewport = new BoundingRectangle();\n this._useScissorTest = false;\n this._scissorRectangle = undefined;\n this._useHdr = undefined;\n}\n\nObject.defineProperties(GlobeTranslucencyFramebuffer.prototype, {\n // Exposed for testing\n classificationTexture: {\n get: function () {\n return this._framebuffer.getColorTexture();\n },\n },\n classificationFramebuffer: {\n get: function () {\n return this._framebuffer.framebuffer;\n },\n },\n // Exposed for testing\n packedDepthFramebuffer: {\n get: function () {\n return this._packedDepthFramebuffer.framebuffer;\n },\n },\n depthStencilTexture: {\n get: function () {\n return this._framebuffer.getDepthStencilTexture();\n },\n },\n // Exposed for testing\n depthStencilRenderbuffer: {\n get: function () {\n return this._framebuffer.getDepthStencilRenderbuffer();\n },\n },\n packedDepthTexture: {\n get: function () {\n return this._packedDepthFramebuffer.getColorTexture();\n },\n },\n});\n\nfunction destroyResources(globeTranslucency) {\n globeTranslucency._framebuffer.destroy();\n globeTranslucency._packedDepthFramebuffer.destroy();\n}\n\nfunction updateResources(globeTranslucency, context, width, height, hdr) {\n const pixelDatatype = hdr\n ? context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT\n : PixelDatatype.UNSIGNED_BYTE;\n globeTranslucency._framebuffer.update(\n context,\n width,\n height,\n 1,\n pixelDatatype\n );\n globeTranslucency._packedDepthFramebuffer.update(context, width, height);\n}\n\nfunction updateCommands(globeTranslucency, context, width, height, passState) {\n globeTranslucency._viewport.width = width;\n globeTranslucency._viewport.height = height;\n\n const useScissorTest = !BoundingRectangle.equals(\n globeTranslucency._viewport,\n passState.viewport\n );\n let updateScissor = useScissorTest !== globeTranslucency._useScissorTest;\n globeTranslucency._useScissorTest = useScissorTest;\n\n if (\n !BoundingRectangle.equals(\n globeTranslucency._scissorRectangle,\n passState.viewport\n )\n ) {\n globeTranslucency._scissorRectangle = BoundingRectangle.clone(\n passState.viewport,\n globeTranslucency._scissorRectangle\n );\n updateScissor = true;\n }\n\n if (\n !defined(globeTranslucency._renderState) ||\n !BoundingRectangle.equals(\n globeTranslucency._viewport,\n globeTranslucency._renderState.viewport\n ) ||\n updateScissor\n ) {\n globeTranslucency._renderState = RenderState.fromCache({\n viewport: globeTranslucency._viewport,\n scissorTest: {\n enabled: globeTranslucency._useScissorTest,\n rectangle: globeTranslucency._scissorRectangle,\n },\n });\n }\n\n if (!defined(globeTranslucency._packedDepthCommand)) {\n globeTranslucency._packedDepthCommand = context.createViewportQuadCommand(\n PassThroughDepth,\n {\n uniformMap: {\n u_depthTexture: function () {\n return globeTranslucency.depthStencilTexture;\n },\n },\n owner: globeTranslucency,\n }\n );\n }\n\n if (!defined(globeTranslucency._clearCommand)) {\n globeTranslucency._clearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n depth: 1.0,\n stencil: 0.0,\n owner: globeTranslucency,\n });\n }\n\n globeTranslucency._packedDepthCommand.framebuffer =\n globeTranslucency._packedDepthFramebuffer.framebuffer;\n globeTranslucency._packedDepthCommand.renderState =\n globeTranslucency._renderState;\n globeTranslucency._clearCommand.framebuffer =\n globeTranslucency.classificationFramebuffer;\n globeTranslucency._clearCommand.renderState = globeTranslucency._renderState;\n}\n\nGlobeTranslucencyFramebuffer.prototype.updateAndClear = function (\n hdr,\n viewport,\n context,\n passState\n) {\n const width = viewport.width;\n const height = viewport.height;\n\n updateResources(this, context, width, height, hdr);\n updateCommands(this, context, width, height, passState);\n\n this._useHdr = hdr;\n};\n\nGlobeTranslucencyFramebuffer.prototype.clearClassification = function (\n context,\n passState\n) {\n this._clearCommand.execute(context, passState);\n};\n\nGlobeTranslucencyFramebuffer.prototype.packDepth = function (\n context,\n passState\n) {\n this._packedDepthCommand.execute(context, passState);\n return this.packedDepthTexture;\n};\n\nGlobeTranslucencyFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nGlobeTranslucencyFramebuffer.prototype.destroy = function () {\n destroyResources(this);\n return destroyObject(this);\n};\n\nexport default GlobeTranslucencyFramebuffer;\n", "import combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport NearFarScalar from \"../Core/NearFarScalar.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport SceneMode from \"./SceneMode.js\";\n\nconst DerivedCommandType = {\n OPAQUE_FRONT_FACE: 0,\n OPAQUE_BACK_FACE: 1,\n DEPTH_ONLY_FRONT_FACE: 2,\n DEPTH_ONLY_BACK_FACE: 3,\n DEPTH_ONLY_FRONT_AND_BACK_FACE: 4,\n TRANSLUCENT_FRONT_FACE: 5,\n TRANSLUCENT_BACK_FACE: 6,\n TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST: 7,\n TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST: 8,\n PICK_FRONT_FACE: 9,\n PICK_BACK_FACE: 10,\n DERIVED_COMMANDS_MAXIMUM_LENGTH: 11,\n};\n\nconst derivedCommandsMaximumLength =\n DerivedCommandType.DERIVED_COMMANDS_MAXIMUM_LENGTH;\n\nconst DerivedCommandNames = [\n \"opaqueFrontFaceCommand\",\n \"opaqueBackFaceCommand\",\n \"depthOnlyFrontFaceCommand\",\n \"depthOnlyBackFaceCommand\",\n \"depthOnlyFrontAndBackFaceCommand\",\n \"translucentFrontFaceCommand\",\n \"translucentBackFaceCommand\",\n \"translucentFrontFaceManualDepthTestCommand\",\n \"translucentBackFaceManualDepthTestCommand\",\n \"pickFrontFaceCommand\",\n \"pickBackFaceCommand\",\n];\n\n/**\n * @private\n */\nfunction GlobeTranslucencyState() {\n this._frontFaceAlphaByDistance = new NearFarScalar(0.0, 1.0, 0.0, 1.0);\n this._backFaceAlphaByDistance = new NearFarScalar(0.0, 1.0, 0.0, 1.0);\n\n this._frontFaceTranslucent = false;\n this._backFaceTranslucent = false;\n this._requiresManualDepthTest = false;\n this._sunVisibleThroughGlobe = false;\n this._environmentVisible = false;\n this._useDepthPlane = false;\n this._numberOfTextureUniforms = 0;\n this._globeTranslucencyFramebuffer = undefined;\n this._rectangle = Rectangle.clone(Rectangle.MAX_VALUE);\n\n this._derivedCommandKey = 0;\n this._derivedCommandsDirty = false;\n this._derivedCommandPacks = undefined;\n\n this._derivedCommandTypes = new Array(derivedCommandsMaximumLength);\n this._derivedBlendCommandTypes = new Array(derivedCommandsMaximumLength);\n this._derivedPickCommandTypes = new Array(derivedCommandsMaximumLength);\n this._derivedCommandTypesToUpdate = new Array(derivedCommandsMaximumLength);\n\n this._derivedCommandsLength = 0;\n this._derivedBlendCommandsLength = 0;\n this._derivedPickCommandsLength = 0;\n this._derivedCommandsToUpdateLength = 0;\n}\n\nObject.defineProperties(GlobeTranslucencyState.prototype, {\n frontFaceAlphaByDistance: {\n get: function () {\n return this._frontFaceAlphaByDistance;\n },\n },\n backFaceAlphaByDistance: {\n get: function () {\n return this._backFaceAlphaByDistance;\n },\n },\n translucent: {\n get: function () {\n return this._frontFaceTranslucent;\n },\n },\n sunVisibleThroughGlobe: {\n get: function () {\n return this._sunVisibleThroughGlobe;\n },\n },\n environmentVisible: {\n get: function () {\n return this._environmentVisible;\n },\n },\n useDepthPlane: {\n get: function () {\n return this._useDepthPlane;\n },\n },\n numberOfTextureUniforms: {\n get: function () {\n return this._numberOfTextureUniforms;\n },\n },\n rectangle: {\n get: function () {\n return this._rectangle;\n },\n },\n});\n\nGlobeTranslucencyState.prototype.update = function (scene) {\n const globe = scene.globe;\n if (!defined(globe) || !globe.show) {\n this._frontFaceTranslucent = false;\n this._backFaceTranslucent = false;\n this._sunVisibleThroughGlobe = true;\n this._environmentVisible = true;\n this._useDepthPlane = false;\n return;\n }\n\n this._frontFaceAlphaByDistance = updateAlphaByDistance(\n globe.translucency.enabled,\n globe.translucency.frontFaceAlpha,\n globe.translucency.frontFaceAlphaByDistance,\n this._frontFaceAlphaByDistance\n );\n this._backFaceAlphaByDistance = updateAlphaByDistance(\n globe.translucency.enabled,\n globe.translucency.backFaceAlpha,\n globe.translucency.backFaceAlphaByDistance,\n this._backFaceAlphaByDistance\n );\n\n this._frontFaceTranslucent = isFaceTranslucent(\n globe.translucency.enabled,\n this._frontFaceAlphaByDistance,\n globe\n );\n this._backFaceTranslucent = isFaceTranslucent(\n globe.translucency.enabled,\n this._backFaceAlphaByDistance,\n globe\n );\n\n this._requiresManualDepthTest = requiresManualDepthTest(this, scene, globe);\n\n this._sunVisibleThroughGlobe = isSunVisibleThroughGlobe(this, scene);\n this._environmentVisible = isEnvironmentVisible(this, scene);\n this._useDepthPlane = useDepthPlane(this, scene);\n this._numberOfTextureUniforms = getNumberOfTextureUniforms(this);\n\n this._rectangle = Rectangle.clone(\n globe.translucency.rectangle,\n this._rectangle\n );\n\n gatherDerivedCommandRequirements(this, scene);\n};\n\nfunction updateAlphaByDistance(enabled, alpha, alphaByDistance, result) {\n if (!enabled) {\n result.nearValue = 1.0;\n result.farValue = 1.0;\n return result;\n }\n\n if (!defined(alphaByDistance)) {\n result.nearValue = alpha;\n result.farValue = alpha;\n return result;\n }\n\n NearFarScalar.clone(alphaByDistance, result);\n result.nearValue *= alpha;\n result.farValue *= alpha;\n return result;\n}\n\nfunction isFaceTranslucent(translucencyEnabled, alphaByDistance, globe) {\n return (\n translucencyEnabled &&\n (globe.baseColor.alpha < 1.0 ||\n alphaByDistance.nearValue < 1.0 ||\n alphaByDistance.farValue < 1.0)\n );\n}\n\nfunction isSunVisibleThroughGlobe(state, scene) {\n // The sun is visible through the globe if the front and back faces are translucent when above ground\n // or if front faces are translucent when below ground\n const frontTranslucent = state._frontFaceTranslucent;\n const backTranslucent = state._backFaceTranslucent;\n return frontTranslucent && (scene.cameraUnderground || backTranslucent);\n}\n\nfunction isEnvironmentVisible(state, scene) {\n // The environment is visible if the camera is above ground or underground with translucency\n return !scene.cameraUnderground || state._frontFaceTranslucent;\n}\n\nfunction useDepthPlane(state, scene) {\n // Use the depth plane when the camera is above ground and the globe is opaque\n return !scene.cameraUnderground && !state._frontFaceTranslucent;\n}\n\nfunction requiresManualDepthTest(state, scene, globe) {\n return (\n state._frontFaceTranslucent &&\n !state._backFaceTranslucent &&\n !globe.depthTestAgainstTerrain &&\n scene.mode !== SceneMode.SCENE2D &&\n scene.context.depthTexture\n );\n}\n\nfunction getNumberOfTextureUniforms(state) {\n let numberOfTextureUniforms = 0;\n\n if (state._frontFaceTranslucent) {\n ++numberOfTextureUniforms; // classification texture\n }\n\n if (state._requiresManualDepthTest) {\n ++numberOfTextureUniforms; // czm_globeDepthTexture for manual depth testing\n }\n\n return numberOfTextureUniforms;\n}\n\nfunction gatherDerivedCommandRequirements(state, scene) {\n state._derivedCommandsLength = getDerivedCommandTypes(\n state,\n scene,\n false,\n false,\n state._derivedCommandTypes\n );\n\n state._derivedBlendCommandsLength = getDerivedCommandTypes(\n state,\n scene,\n true,\n false,\n state._derivedBlendCommandTypes\n );\n\n state._derivedPickCommandsLength = getDerivedCommandTypes(\n state,\n scene,\n false,\n true,\n state._derivedPickCommandTypes\n );\n\n let i;\n\n let derivedCommandKey = 0;\n for (i = 0; i < state._derivedCommandsLength; ++i) {\n derivedCommandKey |= 1 << state._derivedCommandTypes[i];\n }\n for (i = 0; i < state._derivedBlendCommandsLength; ++i) {\n derivedCommandKey |= 1 << state._derivedBlendCommandTypes[i];\n }\n for (i = 0; i < state._derivedPickCommandsLength; ++i) {\n derivedCommandKey |= 1 << state._derivedPickCommandTypes[i];\n }\n\n let derivedCommandsToUpdateLength = 0;\n for (i = 0; i < derivedCommandsMaximumLength; ++i) {\n if ((derivedCommandKey & (1 << i)) > 0) {\n state._derivedCommandTypesToUpdate[derivedCommandsToUpdateLength++] = i;\n }\n }\n state._derivedCommandsToUpdateLength = derivedCommandsToUpdateLength;\n\n const derivedCommandsDirty = derivedCommandKey !== state._derivedCommandKey;\n state._derivedCommandKey = derivedCommandKey;\n state._derivedCommandsDirty = derivedCommandsDirty;\n\n if (!defined(state._derivedCommandPacks) && state._frontFaceTranslucent) {\n state._derivedCommandPacks = createDerivedCommandPacks();\n }\n}\n\nfunction getDerivedCommandTypes(\n state,\n scene,\n isBlendCommand,\n isPickCommand,\n types\n) {\n let length = 0;\n\n const frontTranslucent = state._frontFaceTranslucent;\n const backTranslucent = state._backFaceTranslucent;\n\n if (!frontTranslucent) {\n // Don't use derived commands if the globe is opaque\n return length;\n }\n\n const cameraUnderground = scene.cameraUnderground;\n const requiresManualDepthTest = state._requiresManualDepthTest;\n\n const translucentFrontFaceCommandType = isPickCommand\n ? DerivedCommandType.PICK_FRONT_FACE\n : requiresManualDepthTest\n ? DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST\n : DerivedCommandType.TRANSLUCENT_FRONT_FACE;\n\n const translucentBackFaceCommandType = isPickCommand\n ? DerivedCommandType.PICK_BACK_FACE\n : requiresManualDepthTest\n ? DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST\n : DerivedCommandType.TRANSLUCENT_BACK_FACE;\n\n if (scene.mode === SceneMode.SCENE2D) {\n types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_FACE;\n types[length++] = translucentFrontFaceCommandType;\n return length;\n }\n\n if (backTranslucent) {\n // Push depth-only command for classification. Blend commands do not need to write depth.\n // Push translucent commands for front and back faces.\n if (!isBlendCommand) {\n types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE;\n }\n if (cameraUnderground) {\n types[length++] = translucentFrontFaceCommandType;\n types[length++] = translucentBackFaceCommandType;\n } else {\n types[length++] = translucentBackFaceCommandType;\n types[length++] = translucentFrontFaceCommandType;\n }\n } else {\n // Push opaque command for the face that appears in back.\n // Push depth-only command and translucent command for the face that appears in front.\n // eslint-disable-next-line no-lonely-if\n if (cameraUnderground) {\n if (!isBlendCommand) {\n types[length++] = DerivedCommandType.DEPTH_ONLY_BACK_FACE;\n }\n types[length++] = DerivedCommandType.OPAQUE_FRONT_FACE;\n types[length++] = translucentBackFaceCommandType;\n } else {\n if (!isBlendCommand) {\n types[length++] = DerivedCommandType.DEPTH_ONLY_FRONT_FACE;\n }\n types[length++] = DerivedCommandType.OPAQUE_BACK_FACE;\n types[length++] = translucentFrontFaceCommandType;\n }\n }\n\n return length;\n}\n\nfunction removeDefine(defines, defineToRemove) {\n const index = defines.indexOf(defineToRemove);\n if (index > -1) {\n defines.splice(index, 1);\n }\n}\n\nfunction hasDefine(defines, define) {\n return defines.indexOf(define) > -1;\n}\n\nfunction getOpaqueFrontFaceShaderProgram(vs, fs) {\n removeDefine(vs.defines, \"TRANSLUCENT\");\n removeDefine(fs.defines, \"TRANSLUCENT\");\n}\n\nfunction getOpaqueBackFaceShaderProgram(vs, fs) {\n removeDefine(vs.defines, \"GROUND_ATMOSPHERE\");\n removeDefine(fs.defines, \"GROUND_ATMOSPHERE\");\n removeDefine(vs.defines, \"FOG\");\n removeDefine(fs.defines, \"FOG\");\n removeDefine(vs.defines, \"TRANSLUCENT\");\n removeDefine(fs.defines, \"TRANSLUCENT\");\n}\n\nfunction getDepthOnlyShaderProgram(vs, fs) {\n if (\n hasDefine(fs.defines, \"TILE_LIMIT_RECTANGLE\") ||\n hasDefine(fs.defines, \"ENABLE_CLIPPING_PLANES\")\n ) {\n // Need to execute the full shader if discard is called\n return;\n }\n\n const depthOnlyShader =\n \"void main() \\n\" + \"{ \\n\" + \" gl_FragColor = vec4(1.0); \\n\" + \"} \\n\";\n\n fs.sources = [depthOnlyShader];\n}\n\nfunction getTranslucentShaderProgram(vs, fs) {\n const sources = fs.sources;\n const length = sources.length;\n for (let i = 0; i < length; ++i) {\n sources[i] = ShaderSource.replaceMain(\n sources[i],\n \"czm_globe_translucency_main\"\n );\n }\n\n const globeTranslucencyMain =\n \"\\n\\n\" +\n \"uniform sampler2D u_classificationTexture; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" vec2 st = gl_FragCoord.xy / czm_viewport.zw; \\n\" +\n \"#ifdef MANUAL_DEPTH_TEST \\n\" +\n \" float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st)); \\n\" +\n \" if (logDepthOrDepth != 0.0) \\n\" +\n \" { \\n\" +\n \" vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \\n\" +\n \" float depthEC = eyeCoordinate.z / eyeCoordinate.w; \\n\" +\n \" if (v_positionEC.z < depthEC) \\n\" +\n \" { \\n\" +\n \" discard; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \"#endif \\n\" +\n \" czm_globe_translucency_main(); \\n\" +\n \" vec4 classificationColor = texture2D(u_classificationTexture, st); \\n\" +\n \" if (classificationColor.a > 0.0) \\n\" +\n \" { \\n\" +\n \" // Reverse premultiplication process to get the correct composited result of the classification primitives \\n\" +\n \" classificationColor.rgb /= classificationColor.a; \\n\" +\n \" } \\n\" +\n \" gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a); \\n\" +\n \"} \\n\";\n\n sources.push(globeTranslucencyMain);\n}\n\nfunction getTranslucentBackFaceShaderProgram(vs, fs) {\n getTranslucentShaderProgram(vs, fs);\n removeDefine(vs.defines, \"GROUND_ATMOSPHERE\");\n removeDefine(fs.defines, \"GROUND_ATMOSPHERE\");\n removeDefine(vs.defines, \"FOG\");\n removeDefine(fs.defines, \"FOG\");\n}\n\nfunction getTranslucentFrontFaceManualDepthTestShaderProgram(vs, fs) {\n getTranslucentShaderProgram(vs, fs);\n vs.defines.push(\"GENERATE_POSITION\");\n fs.defines.push(\"MANUAL_DEPTH_TEST\");\n}\n\nfunction getTranslucentBackFaceManualDepthTestShaderProgram(vs, fs) {\n getTranslucentBackFaceShaderProgram(vs, fs);\n vs.defines.push(\"GENERATE_POSITION\");\n fs.defines.push(\"MANUAL_DEPTH_TEST\");\n}\n\nfunction getPickShaderProgram(vs, fs) {\n const pickShader =\n \"uniform sampler2D u_classificationTexture; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" vec2 st = gl_FragCoord.xy / czm_viewport.zw; \\n\" +\n \" vec4 pickColor = texture2D(u_classificationTexture, st); \\n\" +\n \" if (pickColor == vec4(0.0)) \\n\" +\n \" { \\n\" +\n \" discard; \\n\" +\n \" } \\n\" +\n \" gl_FragColor = pickColor; \\n\" +\n \"} \\n\";\n\n fs.sources = [pickShader];\n}\n\nfunction getDerivedShaderProgram(\n context,\n shaderProgram,\n derivedShaderProgram,\n shaderProgramDirty,\n getShaderProgramFunction,\n cacheName\n) {\n if (!defined(getShaderProgramFunction)) {\n return shaderProgram;\n }\n\n if (!shaderProgramDirty && defined(derivedShaderProgram)) {\n return derivedShaderProgram;\n }\n\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n cacheName\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n const vs = shaderProgram.vertexShaderSource.clone();\n const fs = shaderProgram.fragmentShaderSource.clone();\n vs.defines = defined(vs.defines) ? vs.defines.slice(0) : [];\n fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];\n\n getShaderProgramFunction(vs, fs);\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n cacheName,\n {\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nfunction getOpaqueFrontFaceRenderState(renderState) {\n renderState.cull.face = CullFace.BACK;\n renderState.cull.enabled = true;\n}\n\nfunction getOpaqueBackFaceRenderState(renderState) {\n renderState.cull.face = CullFace.FRONT;\n renderState.cull.enabled = true;\n}\n\nfunction getDepthOnlyFrontFaceRenderState(renderState) {\n renderState.cull.face = CullFace.BACK;\n renderState.cull.enabled = true;\n renderState.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n}\n\nfunction getDepthOnlyBackFaceRenderState(renderState) {\n renderState.cull.face = CullFace.FRONT;\n renderState.cull.enabled = true;\n renderState.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n}\n\nfunction getDepthOnlyFrontAndBackFaceRenderState(renderState) {\n renderState.cull.enabled = false;\n renderState.colorMask = {\n red: false,\n green: false,\n blue: false,\n alpha: false,\n };\n}\n\nfunction getTranslucentFrontFaceRenderState(renderState) {\n renderState.cull.face = CullFace.BACK;\n renderState.cull.enabled = true;\n renderState.depthMask = false;\n renderState.blending = BlendingState.ALPHA_BLEND;\n}\n\nfunction getTranslucentBackFaceRenderState(renderState) {\n renderState.cull.face = CullFace.FRONT;\n renderState.cull.enabled = true;\n renderState.depthMask = false;\n renderState.blending = BlendingState.ALPHA_BLEND;\n}\n\nfunction getPickFrontFaceRenderState(renderState) {\n renderState.cull.face = CullFace.BACK;\n renderState.cull.enabled = true;\n renderState.blending.enabled = false;\n}\n\nfunction getPickBackFaceRenderState(renderState) {\n renderState.cull.face = CullFace.FRONT;\n renderState.cull.enabled = true;\n renderState.blending.enabled = false;\n}\n\nfunction getDerivedRenderState(\n renderState,\n derivedRenderState,\n renderStateDirty,\n getRenderStateFunction,\n cache\n) {\n if (!defined(getRenderStateFunction)) {\n return renderState;\n }\n\n if (!renderStateDirty && defined(derivedRenderState)) {\n return derivedRenderState;\n }\n\n let cachedRenderState = cache[renderState.id];\n if (!defined(cachedRenderState)) {\n const rs = RenderState.getState(renderState);\n getRenderStateFunction(rs);\n cachedRenderState = RenderState.fromCache(rs);\n cache[renderState.id] = cachedRenderState;\n }\n\n return cachedRenderState;\n}\n\nfunction getTranslucencyUniformMap(state) {\n return {\n u_classificationTexture: function () {\n return state._globeTranslucencyFramebuffer.classificationTexture;\n },\n };\n}\n\nfunction getDerivedUniformMap(\n state,\n uniformMap,\n derivedUniformMap,\n uniformMapDirty,\n getDerivedUniformMapFunction\n) {\n if (!defined(getDerivedUniformMapFunction)) {\n return uniformMap;\n }\n\n if (!uniformMapDirty && defined(derivedUniformMap)) {\n return derivedUniformMap;\n }\n\n return combine(uniformMap, getDerivedUniformMapFunction(state), false);\n}\n\nfunction DerivedCommandPack(options) {\n this.pass = options.pass;\n this.pickOnly = options.pickOnly;\n this.getShaderProgramFunction = options.getShaderProgramFunction;\n this.getRenderStateFunction = options.getRenderStateFunction;\n this.getUniformMapFunction = options.getUniformMapFunction;\n this.renderStateCache = {};\n}\n\nfunction createDerivedCommandPacks() {\n return [\n // opaqueFrontFaceCommand\n new DerivedCommandPack({\n pass: Pass.GLOBE,\n pickOnly: false,\n getShaderProgramFunction: getOpaqueFrontFaceShaderProgram,\n getRenderStateFunction: getOpaqueFrontFaceRenderState,\n getUniformMapFunction: undefined,\n }),\n // opaqueBackFaceCommand\n new DerivedCommandPack({\n pass: Pass.GLOBE,\n pickOnly: false,\n getShaderProgramFunction: getOpaqueBackFaceShaderProgram,\n getRenderStateFunction: getOpaqueBackFaceRenderState,\n getUniformMapFunction: undefined,\n }),\n // depthOnlyFrontFaceCommand\n new DerivedCommandPack({\n pass: Pass.GLOBE,\n pickOnly: false,\n getShaderProgramFunction: getDepthOnlyShaderProgram,\n getRenderStateFunction: getDepthOnlyFrontFaceRenderState,\n getUniformMapFunction: undefined,\n }),\n // depthOnlyBackFaceCommand\n new DerivedCommandPack({\n pass: Pass.GLOBE,\n pickOnly: false,\n getShaderProgramFunction: getDepthOnlyShaderProgram,\n getRenderStateFunction: getDepthOnlyBackFaceRenderState,\n getUniformMapFunction: undefined,\n }),\n // depthOnlyFrontAndBackFaceCommand\n new DerivedCommandPack({\n pass: Pass.GLOBE,\n pickOnly: false,\n getShaderProgramFunction: getDepthOnlyShaderProgram,\n getRenderStateFunction: getDepthOnlyFrontAndBackFaceRenderState,\n getUniformMapFunction: undefined,\n }),\n // translucentFrontFaceCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: false,\n getShaderProgramFunction: getTranslucentShaderProgram,\n getRenderStateFunction: getTranslucentFrontFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n // translucentBackFaceCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: false,\n getShaderProgramFunction: getTranslucentBackFaceShaderProgram,\n getRenderStateFunction: getTranslucentBackFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n // translucentFrontFaceManualDepthTestCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: false,\n getShaderProgramFunction: getTranslucentFrontFaceManualDepthTestShaderProgram,\n getRenderStateFunction: getTranslucentFrontFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n // translucentBackFaceManualDepthTestCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: false,\n getShaderProgramFunction: getTranslucentBackFaceManualDepthTestShaderProgram,\n getRenderStateFunction: getTranslucentBackFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n // pickFrontFaceCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: true,\n getShaderProgramFunction: getPickShaderProgram,\n getRenderStateFunction: getPickFrontFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n // pickBackFaceCommand\n new DerivedCommandPack({\n pass: Pass.TRANSLUCENT,\n pickOnly: true,\n getShaderProgramFunction: getPickShaderProgram,\n getRenderStateFunction: getPickBackFaceRenderState,\n getUniformMapFunction: getTranslucencyUniformMap,\n }),\n ];\n}\n\nconst derivedCommandNames = new Array(derivedCommandsMaximumLength);\nconst derivedCommandPacks = new Array(derivedCommandsMaximumLength);\n\nGlobeTranslucencyState.prototype.updateDerivedCommands = function (\n command,\n frameState\n) {\n const derivedCommandTypes = this._derivedCommandTypesToUpdate;\n const derivedCommandsLength = this._derivedCommandsToUpdateLength;\n\n if (derivedCommandsLength === 0) {\n return;\n }\n\n for (let i = 0; i < derivedCommandsLength; ++i) {\n derivedCommandPacks[i] = this._derivedCommandPacks[derivedCommandTypes[i]];\n derivedCommandNames[i] = DerivedCommandNames[derivedCommandTypes[i]];\n }\n\n updateDerivedCommands(\n this,\n command,\n derivedCommandsLength,\n derivedCommandTypes,\n derivedCommandNames,\n derivedCommandPacks,\n frameState\n );\n};\n\nfunction updateDerivedCommands(\n state,\n command,\n derivedCommandsLength,\n derivedCommandTypes,\n derivedCommandNames,\n derivedCommandPacks,\n frameState\n) {\n let derivedCommandsObject = command.derivedCommands.globeTranslucency;\n const derivedCommandsDirty = state._derivedCommandsDirty;\n\n if (\n command.dirty ||\n !defined(derivedCommandsObject) ||\n derivedCommandsDirty\n ) {\n command.dirty = false;\n\n if (!defined(derivedCommandsObject)) {\n derivedCommandsObject = {};\n command.derivedCommands.globeTranslucency = derivedCommandsObject;\n }\n\n const frameNumber = frameState.frameNumber;\n\n const uniformMapDirtyFrame = defaultValue(\n derivedCommandsObject.uniformMapDirtyFrame,\n 0\n );\n const shaderProgramDirtyFrame = defaultValue(\n derivedCommandsObject.shaderProgramDirtyFrame,\n 0\n );\n const renderStateDirtyFrame = defaultValue(\n derivedCommandsObject.renderStateDirtyFrame,\n 0\n );\n\n const uniformMapDirty =\n derivedCommandsObject.uniformMap !== command.uniformMap;\n\n const shaderProgramDirty =\n derivedCommandsObject.shaderProgramId !== command.shaderProgram.id;\n\n const renderStateDirty =\n derivedCommandsObject.renderStateId !== command.renderState.id;\n\n if (uniformMapDirty) {\n derivedCommandsObject.uniformMapDirtyFrame = frameNumber;\n }\n if (shaderProgramDirty) {\n derivedCommandsObject.shaderProgramDirtyFrame = frameNumber;\n }\n if (renderStateDirty) {\n derivedCommandsObject.renderStateDirtyFrame = frameNumber;\n }\n\n derivedCommandsObject.uniformMap = command.uniformMap;\n derivedCommandsObject.shaderProgramId = command.shaderProgram.id;\n derivedCommandsObject.renderStateId = command.renderState.id;\n\n for (let i = 0; i < derivedCommandsLength; ++i) {\n const derivedCommandPack = derivedCommandPacks[i];\n const derivedCommandType = derivedCommandTypes[i];\n const derivedCommandName = derivedCommandNames[i];\n let derivedCommand = derivedCommandsObject[derivedCommandName];\n\n let derivedUniformMap;\n let derivedShaderProgram;\n let derivedRenderState;\n\n if (defined(derivedCommand)) {\n derivedUniformMap = derivedCommand.uniformMap;\n derivedShaderProgram = derivedCommand.shaderProgram;\n derivedRenderState = derivedCommand.renderState;\n } else {\n derivedUniformMap = undefined;\n derivedShaderProgram = undefined;\n derivedRenderState = undefined;\n }\n\n derivedCommand = DrawCommand.shallowClone(command, derivedCommand);\n derivedCommandsObject[derivedCommandName] = derivedCommand;\n\n const derivedUniformMapDirtyFrame = defaultValue(\n derivedCommand.derivedCommands.uniformMapDirtyFrame,\n 0\n );\n const derivedShaderProgramDirtyFrame = defaultValue(\n derivedCommand.derivedCommands.shaderProgramDirtyFrame,\n 0\n );\n const derivedRenderStateDirtyFrame = defaultValue(\n derivedCommand.derivedCommands.renderStateDirtyFrame,\n 0\n );\n\n const derivedUniformMapDirty =\n uniformMapDirty || derivedUniformMapDirtyFrame < uniformMapDirtyFrame;\n const derivedShaderProgramDirty =\n shaderProgramDirty ||\n derivedShaderProgramDirtyFrame < shaderProgramDirtyFrame;\n const derivedRenderStateDirty =\n renderStateDirty ||\n derivedRenderStateDirtyFrame < renderStateDirtyFrame;\n\n if (derivedUniformMapDirty) {\n derivedCommand.derivedCommands.uniformMapDirtyFrame = frameNumber;\n }\n if (derivedShaderProgramDirty) {\n derivedCommand.derivedCommands.shaderProgramDirtyFrame = frameNumber;\n }\n if (derivedRenderStateDirty) {\n derivedCommand.derivedCommands.renderStateDirtyFrame = frameNumber;\n }\n\n derivedCommand.derivedCommands.type = derivedCommandType;\n derivedCommand.pass = derivedCommandPack.pass;\n derivedCommand.pickOnly = derivedCommandPack.pickOnly;\n derivedCommand.uniformMap = getDerivedUniformMap(\n state,\n command.uniformMap,\n derivedUniformMap,\n derivedUniformMapDirty,\n derivedCommandPack.getUniformMapFunction\n );\n derivedCommand.shaderProgram = getDerivedShaderProgram(\n frameState.context,\n command.shaderProgram,\n derivedShaderProgram,\n derivedShaderProgramDirty,\n derivedCommandPack.getShaderProgramFunction,\n derivedCommandName\n );\n derivedCommand.renderState = getDerivedRenderState(\n command.renderState,\n derivedRenderState,\n derivedRenderStateDirty,\n derivedCommandPack.getRenderStateFunction,\n derivedCommandPack.renderStateCache\n );\n }\n }\n}\n\nGlobeTranslucencyState.prototype.pushDerivedCommands = function (\n command,\n isBlendCommand,\n frameState\n) {\n const picking = frameState.passes.pick;\n if (picking && isBlendCommand) {\n // No need to push blend commands in the pick pass\n return;\n }\n\n let derivedCommandTypes = this._derivedCommandTypes;\n let derivedCommandsLength = this._derivedCommandsLength;\n\n if (picking) {\n derivedCommandTypes = this._derivedPickCommandTypes;\n derivedCommandsLength = this._derivedPickCommandsLength;\n } else if (isBlendCommand) {\n derivedCommandTypes = this._derivedBlendCommandTypes;\n derivedCommandsLength = this._derivedBlendCommandsLength;\n }\n\n if (derivedCommandsLength === 0) {\n // No derived commands to push so just push the globe command\n frameState.commandList.push(command);\n return;\n }\n\n // Push derived commands\n const derivedCommands = command.derivedCommands.globeTranslucency;\n for (let i = 0; i < derivedCommandsLength; ++i) {\n const derivedCommandName = DerivedCommandNames[derivedCommandTypes[i]];\n frameState.commandList.push(derivedCommands[derivedCommandName]);\n }\n};\n\nfunction executeCommandsMatchingType(\n commands,\n commandsLength,\n executeCommandFunction,\n scene,\n context,\n passState,\n types\n) {\n for (let i = 0; i < commandsLength; ++i) {\n const command = commands[i];\n const type = command.derivedCommands.type;\n if (!defined(types) || types.indexOf(type) > -1) {\n executeCommandFunction(command, scene, context, passState);\n }\n }\n}\n\nfunction executeCommands(\n commands,\n commandsLength,\n executeCommandFunction,\n scene,\n context,\n passState\n) {\n for (let i = 0; i < commandsLength; ++i) {\n executeCommandFunction(commands[i], scene, context, passState);\n }\n}\n\nconst opaqueTypes = [\n DerivedCommandType.OPAQUE_FRONT_FACE,\n DerivedCommandType.OPAQUE_BACK_FACE,\n];\nconst depthOnlyTypes = [\n DerivedCommandType.DEPTH_ONLY_FRONT_FACE,\n DerivedCommandType.DEPTH_ONLY_BACK_FACE,\n DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE,\n];\n\nGlobeTranslucencyState.prototype.executeGlobeCommands = function (\n frustumCommands,\n executeCommandFunction,\n globeTranslucencyFramebuffer,\n scene,\n passState\n) {\n const context = scene.context;\n const globeCommands = frustumCommands.commands[Pass.GLOBE];\n const globeCommandsLength = frustumCommands.indices[Pass.GLOBE];\n\n if (globeCommandsLength === 0) {\n return;\n }\n\n this._globeTranslucencyFramebuffer = globeTranslucencyFramebuffer;\n globeTranslucencyFramebuffer.clearClassification(context, passState);\n\n // Render opaque commands like normal\n executeCommandsMatchingType(\n globeCommands,\n globeCommandsLength,\n executeCommandFunction,\n scene,\n context,\n passState,\n opaqueTypes\n );\n};\n\nGlobeTranslucencyState.prototype.executeGlobeClassificationCommands = function (\n frustumCommands,\n executeCommandFunction,\n globeTranslucencyFramebuffer,\n scene,\n passState\n) {\n const context = scene.context;\n const globeCommands = frustumCommands.commands[Pass.GLOBE];\n const globeCommandsLength = frustumCommands.indices[Pass.GLOBE];\n const classificationCommands =\n frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];\n const classificationCommandsLength =\n frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];\n\n if (globeCommandsLength === 0 || classificationCommandsLength === 0) {\n return;\n }\n\n const frontTranslucent = this._frontFaceTranslucent;\n const backTranslucent = this._backFaceTranslucent;\n\n if (!frontTranslucent || !backTranslucent) {\n // Render classification on opaque faces like normal\n executeCommands(\n classificationCommands,\n classificationCommandsLength,\n executeCommandFunction,\n scene,\n context,\n passState\n );\n }\n\n if (!frontTranslucent && !backTranslucent) {\n // No translucent commands to render. Skip translucent classification.\n return;\n }\n\n this._globeTranslucencyFramebuffer = globeTranslucencyFramebuffer;\n\n const originalGlobeDepthTexture = context.uniformState.globeDepthTexture;\n const originalFramebuffer = passState.framebuffer;\n\n // Render to internal framebuffer and get the first depth peel\n passState.framebuffer =\n globeTranslucencyFramebuffer.classificationFramebuffer;\n\n executeCommandsMatchingType(\n globeCommands,\n globeCommandsLength,\n executeCommandFunction,\n scene,\n context,\n passState,\n depthOnlyTypes\n );\n\n if (context.depthTexture) {\n // Pack depth into separate texture for ground polylines and textured ground primitives\n const packedDepthTexture = globeTranslucencyFramebuffer.packDepth(\n context,\n passState\n );\n context.uniformState.globeDepthTexture = packedDepthTexture;\n }\n\n // Render classification on translucent faces\n executeCommands(\n classificationCommands,\n classificationCommandsLength,\n executeCommandFunction,\n scene,\n context,\n passState\n );\n\n // Unset temporary state\n context.uniformState.globeDepthTexture = originalGlobeDepthTexture;\n passState.framebuffer = originalFramebuffer;\n};\n\nexport default GlobeTranslucencyState;\n", "import Credit from \"../Core/Credit.js\";\nimport decodeGoogleEarthEnterpriseData from \"../Core/decodeGoogleEarthEnterpriseData.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\nimport GoogleEarthEnterpriseMetadata from \"../Core/GoogleEarthEnterpriseMetadata.js\";\nimport loadImageFromTypedArray from \"../Core/loadImageFromTypedArray.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Request from \"../Core/Request.js\";\nimport Resource from \"../Core/Resource.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport TileProviderError from \"../Core/TileProviderError.js\";\nimport * as protobuf from \"protobufjs/dist/minimal/protobuf.js\";\n\n/**\n * @private\n */\nfunction GoogleEarthEnterpriseDiscardPolicy() {\n this._image = new Image();\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {Boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nGoogleEarthEnterpriseDiscardPolicy.prototype.isReady = function () {\n return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {Boolean} True if the image should be discarded; otherwise, false.\n */\nGoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage = function (\n image\n) {\n return image === this._image;\n};\n\n/**\n * @typedef {Object} GoogleEarthEnterpriseImageryProvider.ConstructorOptions\n *\n * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor\n *\n * @property {Resource|String} url The url of the Google Earth Enterprise server hosting the imagery.\n * @property {GoogleEarthEnterpriseMetadata} metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {TileDiscardPolicy} [tileDiscardPolicy] The policy that determines if a tile\n * is invalid and should be discarded. If this value is not specified, a default\n * is to discard tiles that fail to download.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Provides tiled imagery using the Google Earth Enterprise REST API.\n *\n * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,\n * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.\n *\n * @alias GoogleEarthEnterpriseImageryProvider\n * @constructor\n *\n * @param {GoogleEarthEnterpriseImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @see GoogleEarthEnterpriseTerrainProvider\n * @see ArcGisMapServerImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see OpenStreetMapImageryProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n *\n * @example\n * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.example.com');\n * const gee = new Cesium.GoogleEarthEnterpriseImageryProvider({\n * metadata : geeMetadata\n * });\n *\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction GoogleEarthEnterpriseImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n let metadata;\n if (defined(options.metadata)) {\n metadata = options.metadata;\n } else {\n const resource = Resource.createIfNeeded(options.url);\n metadata = new GoogleEarthEnterpriseMetadata(resource);\n }\n this._metadata = metadata;\n this._tileDiscardPolicy = options.tileDiscardPolicy;\n\n this._tilingScheme = new GeographicTilingScheme({\n numberOfLevelZeroTilesX: 2,\n numberOfLevelZeroTilesY: 2,\n rectangle: new Rectangle(\n -CesiumMath.PI,\n -CesiumMath.PI,\n CesiumMath.PI,\n CesiumMath.PI\n ),\n ellipsoid: options.ellipsoid,\n });\n\n let credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n this._credit = credit;\n\n this._tileWidth = 256;\n this._tileHeight = 256;\n this._maximumLevel = 23;\n\n // Install the default tile discard policy if none has been supplied.\n if (!defined(this._tileDiscardPolicy)) {\n this._tileDiscardPolicy = new GoogleEarthEnterpriseDiscardPolicy();\n }\n\n this._errorEvent = new Event();\n\n this._ready = false;\n const that = this;\n let metadataError;\n this._readyPromise = metadata.readyPromise\n .then(function (result) {\n if (!metadata.imageryPresent) {\n const e = new RuntimeError(\n `The server ${metadata.url} doesn't have imagery`\n );\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n e.message,\n undefined,\n undefined,\n undefined,\n e\n );\n return Promise.reject(e);\n }\n\n TileProviderError.reportSuccess(metadataError);\n that._ready = result;\n return result;\n })\n .catch(function (e) {\n metadataError = TileProviderError.reportError(\n metadataError,\n that,\n that._errorEvent,\n e.message,\n undefined,\n undefined,\n undefined,\n e\n );\n return Promise.reject(e);\n });\n}\n\nObject.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype, {\n /**\n * Gets the name of the Google Earth Enterprise server url hosting the imagery.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._metadata.url;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._metadata.proxy;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return 0;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._credit;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage\n * and texture upload time.\n * @memberof GoogleEarthEnterpriseImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return false;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n const metadata = this._metadata;\n const info = metadata.getTileInformation(x, y, level);\n if (defined(info)) {\n const credit = metadata.providers[info.imageryProvider];\n if (defined(credit)) {\n return [credit];\n }\n }\n\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const invalidImage = this._tileDiscardPolicy._image; // Empty image or undefined depending on discard policy\n const metadata = this._metadata;\n const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n const info = metadata.getTileInformation(x, y, level);\n if (!defined(info)) {\n if (metadata.isValid(quadKey)) {\n const metadataRequest = new Request({\n throttle: request.throttle,\n throttleByServer: request.throttleByServer,\n type: request.type,\n priorityFunction: request.priorityFunction,\n });\n metadata.populateSubtree(x, y, level, metadataRequest);\n return undefined; // No metadata so return undefined so we can be loaded later\n }\n return Promise.resolve(invalidImage); // Image doesn't exist\n }\n\n if (!info.hasImagery()) {\n // Already have info and there isn't any imagery here\n return Promise.resolve(invalidImage);\n }\n const promise = buildImageResource(\n this,\n info,\n x,\n y,\n level,\n request\n ).fetchArrayBuffer();\n if (!defined(promise)) {\n return undefined; // Throttled\n }\n\n return promise.then(function (image) {\n decodeGoogleEarthEnterpriseData(metadata.key, image);\n let a = new Uint8Array(image);\n let type;\n\n const protoImagery = metadata.protoImagery;\n if (!defined(protoImagery) || !protoImagery) {\n type = getImageType(a);\n }\n\n if (!defined(type) && (!defined(protoImagery) || protoImagery)) {\n const message = decodeEarthImageryPacket(a);\n type = message.imageType;\n a = message.imageData;\n }\n\n if (!defined(type) || !defined(a)) {\n return invalidImage;\n }\n\n return loadImageFromTypedArray({\n uint8Array: a,\n format: type,\n flipY: true,\n });\n });\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGoogleEarthEnterpriseImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\n\n//\n// Functions to handle imagery packets\n//\nfunction buildImageResource(imageryProvider, info, x, y, level, request) {\n const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);\n let version = info.imageryVersion;\n version = defined(version) && version > 0 ? version : 1;\n\n return imageryProvider._metadata.resource.getDerivedResource({\n url: `flatfile?f1-0${quadKey}-i.${version.toString()}`,\n request: request,\n });\n}\n\n// Detects if a Uint8Array is a JPEG or PNG\nfunction getImageType(image) {\n const jpeg = \"JFIF\";\n if (\n image[6] === jpeg.charCodeAt(0) &&\n image[7] === jpeg.charCodeAt(1) &&\n image[8] === jpeg.charCodeAt(2) &&\n image[9] === jpeg.charCodeAt(3)\n ) {\n return \"image/jpeg\";\n }\n\n const png = \"PNG\";\n if (\n image[1] === png.charCodeAt(0) &&\n image[2] === png.charCodeAt(1) &&\n image[3] === png.charCodeAt(2)\n ) {\n return \"image/png\";\n }\n\n return undefined;\n}\n\n// Decodes an Imagery protobuf into the message\n// Partially generated with the help of protobuf.js static generator\nfunction decodeEarthImageryPacket(data) {\n const reader = protobuf.Reader.create(data);\n const end = reader.len;\n const message = {};\n while (reader.pos < end) {\n const tag = reader.uint32();\n let copyrightIds;\n switch (tag >>> 3) {\n case 1:\n message.imageType = reader.uint32();\n break;\n case 2:\n message.imageData = reader.bytes();\n break;\n case 3:\n message.alphaType = reader.uint32();\n break;\n case 4:\n message.imageAlpha = reader.bytes();\n break;\n case 5:\n copyrightIds = message.copyrightIds;\n if (!defined(copyrightIds)) {\n copyrightIds = message.copyrightIds = [];\n }\n if ((tag & 7) === 2) {\n const end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2) {\n copyrightIds.push(reader.uint32());\n }\n } else {\n copyrightIds.push(reader.uint32());\n }\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n\n const imageType = message.imageType;\n if (defined(imageType)) {\n switch (imageType) {\n case 0:\n message.imageType = \"image/jpeg\";\n break;\n case 4:\n message.imageType = \"image/png\";\n break;\n default:\n throw new RuntimeError(\n \"GoogleEarthEnterpriseImageryProvider: Unsupported image type.\"\n );\n }\n }\n\n const alphaType = message.alphaType;\n if (defined(alphaType) && alphaType !== 0) {\n console.log(\n \"GoogleEarthEnterpriseImageryProvider: External alpha not supported.\"\n );\n delete message.alphaType;\n delete message.imageAlpha;\n }\n\n return message;\n}\nexport default GoogleEarthEnterpriseImageryProvider;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\nconst defaultColor = new Color(1.0, 1.0, 1.0, 0.4);\nconst defaultGlowColor = new Color(0.0, 1.0, 0.0, 0.05);\nconst defaultBackgroundColor = new Color(0.0, 0.5, 0.0, 0.2);\n\n/**\n * @typedef {Object} GridImageryProvider.ConstructorOptions\n *\n * Initialization options for the GridImageryProvider constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Number} [cells=8] The number of grids cells.\n * @property {Color} [color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines.\n * @property {Color} [glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines.\n * @property {Number} [glowWidth=6] The width of lines used for rendering the line glow effect.\n * @property {Color} [backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color.\n * @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n * @property {Number} [canvasSize=256] The size of the canvas used for rendering.\n */\n\n/**\n * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.\n * May be useful for custom rendering effects or debugging terrain.\n *\n * @alias GridImageryProvider\n * @constructor\n * @param {GridImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n */\nfunction GridImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n this._tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n this._cells = defaultValue(options.cells, 8);\n this._color = defaultValue(options.color, defaultColor);\n this._glowColor = defaultValue(options.glowColor, defaultGlowColor);\n this._glowWidth = defaultValue(options.glowWidth, 6);\n this._backgroundColor = defaultValue(\n options.backgroundColor,\n defaultBackgroundColor\n );\n this._errorEvent = new Event();\n\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n\n // A little larger than tile size so lines are sharper\n // Note: can't be too much difference otherwise texture blowout\n this._canvasSize = defaultValue(options.canvasSize, 256);\n\n // We only need a single canvas since all tiles will be the same\n this._canvas = this._createGridCanvas();\n\n this._readyPromise = Promise.resolve(true);\n}\n\nObject.defineProperties(GridImageryProvider.prototype, {\n /**\n * Gets the proxy used by this provider.\n * @memberof GridImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof GridImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof GridImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof GridImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.\n * @memberof GridImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof GridImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Draws a grid of lines into a canvas.\n */\nGridImageryProvider.prototype._drawGrid = function (context) {\n const minPixel = 0;\n const maxPixel = this._canvasSize;\n for (let x = 0; x <= this._cells; ++x) {\n const nx = x / this._cells;\n const val = 1 + nx * (maxPixel - 1);\n\n context.moveTo(val, minPixel);\n context.lineTo(val, maxPixel);\n context.moveTo(minPixel, val);\n context.lineTo(maxPixel, val);\n }\n context.stroke();\n};\n\n/**\n * Render a grid into a canvas with background and glow\n */\nGridImageryProvider.prototype._createGridCanvas = function () {\n const canvas = document.createElement(\"canvas\");\n canvas.width = this._canvasSize;\n canvas.height = this._canvasSize;\n const minPixel = 0;\n const maxPixel = this._canvasSize;\n\n const context = canvas.getContext(\"2d\");\n\n // Fill the background\n const cssBackgroundColor = this._backgroundColor.toCssColorString();\n context.fillStyle = cssBackgroundColor;\n context.fillRect(minPixel, minPixel, maxPixel, maxPixel);\n\n // Glow for grid lines\n const cssGlowColor = this._glowColor.toCssColorString();\n context.strokeStyle = cssGlowColor;\n // Wide\n context.lineWidth = this._glowWidth;\n context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n this._drawGrid(context);\n // Narrow\n context.lineWidth = this._glowWidth * 0.5;\n context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n this._drawGrid(context);\n\n // Grid lines\n const cssColor = this._color.toCssColorString();\n // Border\n context.strokeStyle = cssColor;\n context.lineWidth = 2;\n context.strokeRect(minPixel, minPixel, maxPixel, maxPixel);\n // Inner\n context.lineWidth = 1;\n this._drawGrid(context);\n\n return canvas;\n};\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nGridImageryProvider.prototype.getTileCredits = function (x, y, level) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link GridImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nGridImageryProvider.prototype.requestImage = function (x, y, level, request) {\n return Promise.resolve(this._canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nGridImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default GridImageryProvider;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Renderbuffer from \"../Renderer/Renderbuffer.js\";\nimport RenderbufferFormat from \"../Renderer/RenderbufferFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\nimport StencilOperation from \"./StencilOperation.js\";\n\n/**\n * @private\n */\nfunction InvertClassification() {\n this._numSamples = 1;\n this.previousFramebuffer = undefined;\n this._previousFramebuffer = undefined;\n\n this._depthStencilTexture = undefined;\n this._depthStencilRenderbuffer = undefined;\n this._fbo = new FramebufferManager({\n depthStencil: true,\n createDepthAttachments: false,\n });\n this._fboClassified = new FramebufferManager({\n depthStencil: true,\n createDepthAttachments: false,\n });\n\n this._rsUnclassified = undefined;\n this._rsClassified = undefined;\n\n this._unclassifiedCommand = undefined;\n this._classifiedCommand = undefined;\n this._translucentCommand = undefined;\n\n this._clearColorCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n owner: this,\n });\n this._clearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n depth: 1.0,\n stencil: 0,\n });\n\n const that = this;\n this._uniformMap = {\n colorTexture: function () {\n return that._fbo.getColorTexture();\n },\n depthTexture: function () {\n return that._depthStencilTexture;\n },\n classifiedTexture: function () {\n return that._fboClassified.getColorTexture();\n },\n };\n}\n\nObject.defineProperties(InvertClassification.prototype, {\n unclassifiedCommand: {\n get: function () {\n return this._unclassifiedCommand;\n },\n },\n});\n\nInvertClassification.isTranslucencySupported = function (context) {\n return context.depthTexture && context.fragmentDepth;\n};\n\nconst rsUnclassified = {\n depthMask: false,\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.EQUAL,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: StencilFunction.NEVER,\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n blending: BlendingState.ALPHA_BLEND,\n};\n\nconst rsClassified = {\n depthMask: false,\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.NOT_EQUAL,\n frontOperation: {\n fail: StencilOperation.KEEP,\n zFail: StencilOperation.KEEP,\n zPass: StencilOperation.KEEP,\n },\n backFunction: StencilFunction.NEVER,\n reference: 0,\n mask: StencilConstants.CLASSIFICATION_MASK,\n },\n blending: BlendingState.ALPHA_BLEND,\n};\n\n// Set the 3D Tiles bit when rendering back into the scene's framebuffer. This is only needed if\n// invert classification does not use the scene's depth-stencil texture, which is the case if the invert\n// classification color is translucent.\nconst rsDefault = {\n depthMask: true,\n depthTest: {\n enabled: true,\n },\n stencilTest: StencilConstants.setCesium3DTileBit(),\n stencilMask: StencilConstants.CESIUM_3D_TILE_MASK,\n blending: BlendingState.ALPHA_BLEND,\n};\n\nconst translucentFS =\n \"#extension GL_EXT_frag_depth : enable\\n\" +\n \"uniform sampler2D colorTexture;\\n\" +\n \"uniform sampler2D depthTexture;\\n\" +\n \"uniform sampler2D classifiedTexture;\\n\" +\n \"varying vec2 v_textureCoordinates;\\n\" +\n \"void main()\\n\" +\n \"{\\n\" +\n \" vec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\" +\n \" if (color.a == 0.0)\\n\" +\n \" {\\n\" +\n \" discard;\\n\" +\n \" }\\n\" +\n \" bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\\n\" +\n \"#ifdef UNCLASSIFIED\\n\" +\n \" vec4 highlightColor = czm_invertClassificationColor;\\n\" +\n \" if (isClassified)\\n\" +\n \" {\\n\" +\n \" discard;\\n\" +\n \" }\\n\" +\n \"#else\\n\" +\n \" vec4 highlightColor = vec4(1.0);\\n\" +\n \" if (!isClassified)\\n\" +\n \" {\\n\" +\n \" discard;\\n\" +\n \" }\\n\" +\n \"#endif\\n\" +\n \" gl_FragColor = color * highlightColor;\\n\" +\n \" gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\\n\" +\n \"}\\n\";\n\nconst opaqueFS =\n \"uniform sampler2D colorTexture;\\n\" +\n \"varying vec2 v_textureCoordinates;\\n\" +\n \"void main()\\n\" +\n \"{\\n\" +\n \" vec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\" +\n \" if (color.a == 0.0)\\n\" +\n \" {\\n\" +\n \" discard;\\n\" +\n \" }\\n\" +\n \"#ifdef UNCLASSIFIED\\n\" +\n \" gl_FragColor = color * czm_invertClassificationColor;\\n\" +\n \"#else\\n\" +\n \" gl_FragColor = color;\\n\" +\n \"#endif\\n\" +\n \"}\\n\";\n\nInvertClassification.prototype.update = function (\n context,\n numSamples,\n globeFramebuffer\n) {\n const texture = this._fbo.getColorTexture();\n const previousFramebufferChanged =\n this.previousFramebuffer !== this._previousFramebuffer;\n this._previousFramebuffer = this.previousFramebuffer;\n const samplesChanged = this._numSamples !== numSamples;\n\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n const textureChanged =\n !defined(texture) || texture.width !== width || texture.height !== height;\n\n if (textureChanged || previousFramebufferChanged || samplesChanged) {\n this._numSamples = numSamples;\n this._depthStencilTexture =\n this._depthStencilTexture && this._depthStencilTexture.destroy();\n this._depthStencilRenderbuffer =\n this._depthStencilRenderbuffer &&\n this._depthStencilRenderbuffer.destroy();\n\n if (!defined(this._previousFramebuffer)) {\n this._depthStencilTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: PixelFormat.DEPTH_STENCIL,\n pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n });\n if (numSamples > 1) {\n this._depthStencilRenderbuffer = new Renderbuffer({\n context: context,\n width: width,\n height: height,\n format: RenderbufferFormat.DEPTH24_STENCIL8,\n numSamples: numSamples,\n });\n }\n }\n }\n\n if (\n !defined(this._fbo.framebuffer) ||\n textureChanged ||\n previousFramebufferChanged ||\n samplesChanged\n ) {\n this._fbo.destroy();\n this._fboClassified.destroy();\n\n let depthStencilTexture;\n let depthStencilRenderbuffer;\n if (defined(this._previousFramebuffer)) {\n depthStencilTexture = globeFramebuffer.getDepthStencilTexture();\n depthStencilRenderbuffer = globeFramebuffer.getDepthStencilRenderbuffer();\n } else {\n depthStencilTexture = this._depthStencilTexture;\n depthStencilRenderbuffer = this._depthStencilRenderbuffer;\n }\n\n this._fbo.setDepthStencilTexture(depthStencilTexture);\n if (defined(depthStencilRenderbuffer)) {\n this._fbo.setDepthStencilRenderbuffer(depthStencilRenderbuffer);\n }\n this._fbo.update(context, width, height, numSamples);\n\n if (!defined(this._previousFramebuffer)) {\n this._fboClassified.setDepthStencilTexture(depthStencilTexture);\n this._fboClassified.update(context, width, height);\n }\n }\n\n if (!defined(this._rsUnclassified)) {\n this._rsUnclassified = RenderState.fromCache(rsUnclassified);\n this._rsClassified = RenderState.fromCache(rsClassified);\n this._rsDefault = RenderState.fromCache(rsDefault);\n }\n\n if (\n !defined(this._unclassifiedCommand) ||\n previousFramebufferChanged ||\n samplesChanged\n ) {\n if (defined(this._unclassifiedCommand)) {\n this._unclassifiedCommand.shaderProgram =\n this._unclassifiedCommand.shaderProgram &&\n this._unclassifiedCommand.shaderProgram.destroy();\n this._classifiedCommand.shaderProgram =\n this._classifiedCommand.shaderProgram &&\n this._classifiedCommand.shaderProgram.destroy();\n }\n\n const fs = defined(this._previousFramebuffer) ? opaqueFS : translucentFS;\n const unclassifiedFSSource = new ShaderSource({\n defines: [\"UNCLASSIFIED\"],\n sources: [fs],\n });\n const classifiedFSSource = new ShaderSource({\n sources: [fs],\n });\n this._unclassifiedCommand = context.createViewportQuadCommand(\n unclassifiedFSSource,\n {\n renderState: defined(this._previousFramebuffer)\n ? this._rsUnclassified\n : this._rsDefault,\n uniformMap: this._uniformMap,\n owner: this,\n }\n );\n this._classifiedCommand = context.createViewportQuadCommand(\n classifiedFSSource,\n {\n renderState: defined(this._previousFramebuffer)\n ? this._rsClassified\n : this._rsDefault,\n uniformMap: this._uniformMap,\n owner: this,\n }\n );\n\n if (defined(this._translucentCommand)) {\n this._translucentCommand.shaderProgram =\n this._translucentCommand.shaderProgram &&\n this._translucentCommand.shaderProgram.destroy();\n }\n if (!defined(this._previousFramebuffer)) {\n this._translucentCommand = context.createViewportQuadCommand(\n PassThrough,\n {\n renderState: this._rsUnclassified,\n uniformMap: this._uniformMap,\n owner: this,\n }\n );\n }\n }\n};\n\nInvertClassification.prototype.prepareTextures = function (\n context,\n blitStencil\n) {\n if (this._fbo._numSamples > 1) {\n this._fbo.prepareTextures(context, blitStencil);\n }\n};\n\nInvertClassification.prototype.clear = function (context, passState) {\n if (defined(this._previousFramebuffer)) {\n this._fbo.clear(context, this._clearColorCommand, passState);\n } else {\n this._fbo.clear(context, this._clearCommand, passState);\n this._fboClassified.clear(context, this._clearCommand, passState);\n }\n};\n\nInvertClassification.prototype.executeClassified = function (\n context,\n passState\n) {\n if (!defined(this._previousFramebuffer)) {\n const framebuffer = passState.framebuffer;\n\n this.prepareTextures(context, true);\n passState.framebuffer = this._fboClassified.framebuffer;\n this._translucentCommand.execute(context, passState);\n\n passState.framebuffer = framebuffer;\n }\n this._classifiedCommand.execute(context, passState);\n};\n\nInvertClassification.prototype.executeUnclassified = function (\n context,\n passState\n) {\n this._unclassifiedCommand.execute(context, passState);\n};\n\nInvertClassification.prototype.isDestroyed = function () {\n return false;\n};\n\nInvertClassification.prototype.destroy = function () {\n this._fbo.destroy();\n this._fboClassified.destroy();\n this._depthStencilTexture =\n this._depthStencilTexture && this._depthStencilTexture.destroy();\n this._depthStencilRenderbuffer =\n this._depthStencilRenderbuffer && this._depthStencilRenderbuffer.destroy();\n\n if (defined(this._unclassifiedCommand)) {\n this._unclassifiedCommand.shaderProgram =\n this._unclassifiedCommand.shaderProgram &&\n this._unclassifiedCommand.shaderProgram.destroy();\n this._classifiedCommand.shaderProgram =\n this._classifiedCommand.shaderProgram &&\n this._classifiedCommand.shaderProgram.destroy();\n }\n\n return destroyObject(this);\n};\nexport default InvertClassification;\n", "import defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport JobType from \"./JobType.js\";\n\n/**\n *\n * @private\n * @constructor\n */\nfunction JobTypeBudget(total) {\n /**\n * Total budget, in milliseconds, allowed for one frame\n */\n this._total = total;\n\n /**\n * Time, in milliseconds, used so far during this frame\n */\n this.usedThisFrame = 0.0;\n\n /**\n * Time, in milliseconds, that other job types stole this frame\n */\n this.stolenFromMeThisFrame = 0.0;\n\n /**\n * Indicates if this job type was starved this frame, i.e., a job\n * tried to run but didn't have budget\n */\n this.starvedThisFrame = false;\n\n /**\n * Indicates if this job was starved last frame. This prevents it\n * from being stolen from this frame.\n */\n this.starvedLastFrame = false;\n}\n\nObject.defineProperties(JobTypeBudget.prototype, {\n total: {\n get: function () {\n return this._total;\n },\n },\n});\n\n/**\n * Engine for time slicing jobs during a frame to amortize work over multiple frames. This supports:\n * <ul>\n * <li>\n * Separate budgets for different job types, e.g., texture, shader program, and buffer creation. This\n * allows all job types to make progress each frame.\n * </li>\n * <li>\n * Stealing from other jobs type budgets if they were not exhausted in the previous frame. This allows\n * using the entire budget for all job types each frame even if, for example, all the jobs are the same type.\n * </li>\n * <li>\n * Guaranteed progress on all job types each frame, even if it means exceeding the total budget for the frame.\n * This prevents, for example, several expensive texture uploads over many frames from prevent a shader compile.\n * </li>\n * </ul>\n *\n * @private\n */\nfunction JobScheduler(budgets) {\n // Total for defaults is half of of one frame at 10 fps\n const jobBudgets = new Array(JobType.NUMBER_OF_JOB_TYPES);\n jobBudgets[JobType.TEXTURE] = new JobTypeBudget(\n defined(budgets) ? budgets[JobType.TEXTURE] : 10.0\n );\n // On cache miss, this most likely only allows one shader compile per frame\n jobBudgets[JobType.PROGRAM] = new JobTypeBudget(\n defined(budgets) ? budgets[JobType.PROGRAM] : 10.0\n );\n jobBudgets[JobType.BUFFER] = new JobTypeBudget(\n defined(budgets) ? budgets[JobType.BUFFER] : 30.0\n );\n\n const length = jobBudgets.length;\n let i;\n\n let totalBudget = 0.0;\n for (i = 0; i < length; ++i) {\n totalBudget += jobBudgets[i].total;\n }\n\n const executedThisFrame = new Array(length);\n for (i = 0; i < length; ++i) {\n executedThisFrame[i] = false;\n }\n\n this._totalBudget = totalBudget;\n this._totalUsedThisFrame = 0.0;\n this._budgets = jobBudgets;\n this._executedThisFrame = executedThisFrame;\n}\n\n// For unit testing\nJobScheduler.getTimestamp = getTimestamp;\n\nObject.defineProperties(JobScheduler.prototype, {\n totalBudget: {\n get: function () {\n return this._totalBudget;\n },\n },\n});\n\nJobScheduler.prototype.disableThisFrame = function () {\n // Prevent jobs from running this frame\n this._totalUsedThisFrame = this._totalBudget;\n};\n\nJobScheduler.prototype.resetBudgets = function () {\n const budgets = this._budgets;\n const length = budgets.length;\n for (let i = 0; i < length; ++i) {\n const budget = budgets[i];\n budget.starvedLastFrame = budget.starvedThisFrame;\n budget.starvedThisFrame = false;\n budget.usedThisFrame = 0.0;\n budget.stolenFromMeThisFrame = 0.0;\n }\n this._totalUsedThisFrame = 0.0;\n};\n\nJobScheduler.prototype.execute = function (job, jobType) {\n const budgets = this._budgets;\n const budget = budgets[jobType];\n\n // This ensures each job type makes progress each frame by executing at least once\n const progressThisFrame = this._executedThisFrame[jobType];\n\n if (this._totalUsedThisFrame >= this._totalBudget && progressThisFrame) {\n // No budget left this frame for jobs of any type\n budget.starvedThisFrame = true;\n return false;\n }\n\n let stolenBudget;\n\n if (budget.usedThisFrame + budget.stolenFromMeThisFrame >= budget.total) {\n // No budget remaining for jobs of this type. Try to steal from other job types.\n const length = budgets.length;\n let i;\n for (i = 0; i < length; ++i) {\n stolenBudget = budgets[i];\n\n // Steal from this budget if it has time left and it wasn't starved last fame\n if (\n stolenBudget.usedThisFrame + stolenBudget.stolenFromMeThisFrame <\n stolenBudget.total &&\n !stolenBudget.starvedLastFrame\n ) {\n break;\n }\n }\n\n if (i === length && progressThisFrame) {\n // No other job types can give up their budget this frame, and\n // this job type already progressed this frame\n return false;\n }\n\n if (progressThisFrame) {\n // It is considered \"starved\" even if it executes using stolen time so that\n // next frame, no other job types can steal time from it.\n budget.starvedThisFrame = true;\n }\n }\n\n const startTime = JobScheduler.getTimestamp();\n job.execute();\n const duration = JobScheduler.getTimestamp() - startTime;\n\n // Track both time remaining for this job type and all jobs\n // so budget stealing does send us way over the total budget.\n this._totalUsedThisFrame += duration;\n\n if (stolenBudget) {\n stolenBudget.stolenFromMeThisFrame += duration;\n } else {\n budget.usedThisFrame += duration;\n }\n this._executedThisFrame[jobType] = true;\n\n return true;\n};\nexport default JobScheduler;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A light source. This type describes an interface and is not intended to be instantiated directly. Together, <code>color</code> and <code>intensity</code> produce a high-dynamic-range light color. <code>intensity</code> can also be used individually to dim or brighten the light without changing the hue.\n *\n * @alias Light\n * @constructor\n *\n * @see DirectionalLight\n * @see SunLight\n */\nfunction Light() {}\n\nObject.defineProperties(Light.prototype, {\n /**\n * The color of the light.\n * @memberof Light.prototype\n * @type {Color}\n */\n color: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * The intensity controls the strength of the light. <code>intensity</code> has a minimum value of 0.0 and no maximum value.\n * @memberof Light.prototype\n * @type {Number}\n */\n intensity: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\nexport default Light;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Resource from \"../Core/Resource.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst trailingSlashRegex = /\\/$/;\nconst defaultCredit = new Credit(\n '© <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>'\n);\n\n/**\n * @typedef {Object} MapboxStyleImageryProvider.ConstructorOptions\n *\n * Initialization options for the MapboxStyleImageryProvider constructor\n *\n * @property {Resource|String} [url='https://api.mapbox.com/styles/v1/'] The Mapbox server url.\n * @property {String} [username='mapbox'] The username of the map account.\n * @property {String} styleId The Mapbox Style ID.\n * @property {String} accessToken The public access token for the imagery.\n * @property {Number} [tilesize=512] The size of the image tiles.\n * @property {Boolean} [scaleFactor] Determines if tiles are rendered at a @2x scale factor.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying\n * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely\n * to result in rendering problems.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.\n * @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * Provides tiled imagery hosted by Mapbox.\n *\n * @alias MapboxStyleImageryProvider\n * @constructor\n *\n * @param {MapboxStyleImageryProvider.ConstructorOptions} options Object describing initialization options\n *\n * @example\n * // Mapbox style provider\n * const mapbox = new Cesium.MapboxStyleImageryProvider({\n * styleId: 'streets-v11',\n * accessToken: 'thisIsMyAccessToken'\n * });\n *\n * @see {@link https://docs.mapbox.com/api/maps/#styles}\n * @see {@link https://docs.mapbox.com/api/#access-tokens-and-token-scopes}\n */\nfunction MapboxStyleImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const styleId = options.styleId;\n const accessToken = options.accessToken;\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n\n const resource = Resource.createIfNeeded(\n defaultValue(options.url, \"https://api.mapbox.com/styles/v1/\")\n );\n\n this._styleId = styleId;\n this._accessToken = accessToken;\n\n const tilesize = defaultValue(options.tilesize, 512);\n this._tilesize = tilesize;\n\n const username = defaultValue(options.username, \"mapbox\");\n this._username = username;\n\n const scaleFactor = defined(options.scaleFactor) ? \"@2x\" : \"\";\n\n let templateUrl = resource.getUrlComponent();\n if (!trailingSlashRegex.test(templateUrl)) {\n templateUrl += \"/\";\n }\n templateUrl += `${this._username}/${styleId}/tiles/${this._tilesize}/{z}/{x}/{y}${scaleFactor}`;\n resource.url = templateUrl;\n\n resource.setQueryParameters({\n access_token: accessToken,\n });\n\n let credit;\n if (defined(options.credit)) {\n credit = options.credit;\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n } else {\n credit = defaultCredit;\n }\n\n this._resource = resource;\n this._imageryProvider = new UrlTemplateImageryProvider({\n url: resource,\n credit: credit,\n ellipsoid: options.ellipsoid,\n minimumLevel: options.minimumLevel,\n maximumLevel: options.maximumLevel,\n rectangle: options.rectangle,\n });\n}\n\nObject.defineProperties(MapboxStyleImageryProvider.prototype, {\n /**\n * Gets the URL of the Mapbox server.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {String}\n * @readonly\n */\n url: {\n get: function () {\n return this._imageryProvider.url;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._imageryProvider.ready;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._imageryProvider.readyPromise;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by the instance. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._imageryProvider.rectangle;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._imageryProvider.tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._imageryProvider.tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return this._imageryProvider.maximumLevel;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,\n * a minimum level should only be used when the rectangle of the imagery is small\n * enough that the number of tiles at the minimum level is small. An imagery\n * provider with more than a few tiles at the minimum level will lead to\n * rendering problems.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return this._imageryProvider.minimumLevel;\n },\n },\n\n /**\n * Gets the tiling scheme used by the provider. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._imageryProvider.tilingScheme;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return this._imageryProvider.tileDiscardPolicy;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._imageryProvider.errorEvent;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return this._imageryProvider.credit;\n },\n },\n\n /**\n * Gets the proxy used by this provider.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return this._imageryProvider.proxy;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. When this property is false, memory usage\n * and texture upload time are reduced.\n * @memberof MapboxStyleImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return this._imageryProvider.hasAlphaChannel;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nMapboxStyleImageryProvider.prototype.getTileCredits = function (x, y, level) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<ImageryTypes>|undefined} A promise for the image that will resolve when the image is available, or\n * undefined if there are too many active requests to the server, and the request should be retried later.\n *\n * @exception {DeveloperError} <code>requestImage</code> must not be called before the imagery provider is ready.\n */\nMapboxStyleImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n return this._imageryProvider.requestImage(x, y, level, request);\n};\n\n/**\n * Asynchronously determines what features, if any, are located at a given longitude and latitude within\n * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.\n * This function is optional, so it may not exist on all ImageryProviders.\n *\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {Promise.<ImageryLayerFeatureInfo[]>|undefined} A promise for the picked features that will resolve when the asynchronous\n * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}\n * instances. The array may be empty if no features are found at the given location.\n * It may also be undefined if picking is not supported.\n *\n * @exception {DeveloperError} <code>pickFeatures</code> must not be called before the imagery provider is ready.\n */\nMapboxStyleImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return this._imageryProvider.pickFeatures(x, y, level, longitude, latitude);\n};\n\n// Exposed for tests\nMapboxStyleImageryProvider._defaultCredit = defaultCredit;\nexport default MapboxStyleImageryProvider;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport IauOrientationAxes from \"../Core/IauOrientationAxes.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Simon1994PlanetaryPositions from \"../Core/Simon1994PlanetaryPositions.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport EllipsoidPrimitive from \"./EllipsoidPrimitive.js\";\nimport Material from \"./Material.js\";\n\n/**\n * Draws the Moon in 3D.\n * @alias Moon\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.show=true] Determines whether the moon will be rendered.\n * @param {String} [options.textureUrl=buildModuleUrl('Assets/Textures/moonSmall.jpg')] The moon texture.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.MOON] The moon ellipsoid.\n * @param {Boolean} [options.onlySunLighting=true] Use the sun as the only light source.\n *\n *\n * @example\n * scene.moon = new Cesium.Moon();\n *\n * @see Scene#moon\n */\nfunction Moon(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n let url = options.textureUrl;\n if (!defined(url)) {\n url = buildModuleUrl(\"Assets/Textures/moonSmall.jpg\");\n }\n\n /**\n * Determines if the moon will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * The moon texture.\n * @type {String}\n * @default buildModuleUrl('Assets/Textures/moonSmall.jpg')\n */\n this.textureUrl = url;\n\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.MOON);\n\n /**\n * Use the sun as the only light source.\n * @type {Boolean}\n * @default true\n */\n this.onlySunLighting = defaultValue(options.onlySunLighting, true);\n\n this._ellipsoidPrimitive = new EllipsoidPrimitive({\n radii: this.ellipsoid.radii,\n material: Material.fromType(Material.ImageType),\n depthTestEnabled: false,\n _owner: this,\n });\n this._ellipsoidPrimitive.material.translucent = false;\n\n this._axes = new IauOrientationAxes();\n}\n\nObject.defineProperties(Moon.prototype, {\n /**\n * Get the ellipsoid that defines the shape of the moon.\n *\n * @memberof Moon.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n *\n * @default {@link Ellipsoid.MOON}\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n});\n\nconst icrfToFixed = new Matrix3();\nconst rotationScratch = new Matrix3();\nconst translationScratch = new Cartesian3();\nconst scratchCommandList = [];\n\n/**\n * @private\n */\nMoon.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const ellipsoidPrimitive = this._ellipsoidPrimitive;\n ellipsoidPrimitive.material.uniforms.image = this.textureUrl;\n ellipsoidPrimitive.onlySunLighting = this.onlySunLighting;\n\n const date = frameState.time;\n if (!defined(Transforms.computeIcrfToFixedMatrix(date, icrfToFixed))) {\n Transforms.computeTemeToPseudoFixedMatrix(date, icrfToFixed);\n }\n\n const rotation = this._axes.evaluate(date, rotationScratch);\n Matrix3.transpose(rotation, rotation);\n Matrix3.multiply(icrfToFixed, rotation, rotation);\n\n const translation = Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(\n date,\n translationScratch\n );\n Matrix3.multiplyByVector(icrfToFixed, translation, translation);\n\n Matrix4.fromRotationTranslation(\n rotation,\n translation,\n ellipsoidPrimitive.modelMatrix\n );\n\n const savedCommandList = frameState.commandList;\n frameState.commandList = scratchCommandList;\n scratchCommandList.length = 0;\n ellipsoidPrimitive.update(frameState);\n frameState.commandList = savedCommandList;\n return scratchCommandList.length === 1 ? scratchCommandList[0] : undefined;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Moon#destroy\n */\nMoon.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * moon = moon && moon.destroy();\n *\n * @see Moon#isDestroyed\n */\nMoon.prototype.destroy = function () {\n this._ellipsoidPrimitive =\n this._ellipsoidPrimitive && this._ellipsoidPrimitive.destroy();\n return destroyObject(this);\n};\nexport default Moon;\n", "/**\n * A {@link TileDiscardPolicy} specifying that tile images should never be discard.\n *\n * @alias NeverTileDiscardPolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n */\nfunction NeverTileDiscardPolicy(options) {}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @returns {Boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nNeverTileDiscardPolicy.prototype.isReady = function () {\n return true;\n};\n\n/**\n * Given a tile image, decide whether to discard that image.\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {Boolean} True if the image should be discarded; otherwise, false.\n */\nNeverTileDiscardPolicy.prototype.shouldDiscardImage = function (image) {\n return false;\n};\nexport default NeverTileDiscardPolicy;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport AdjustTranslucentFS from \"../Shaders/AdjustTranslucentFS.js\";\nimport CompositeOITFS from \"../Shaders/CompositeOITFS.js\";\nimport BlendEquation from \"./BlendEquation.js\";\nimport BlendFunction from \"./BlendFunction.js\";\n\n/**\n * @private\n */\nfunction OIT(context) {\n this._numSamples = 1;\n // We support multipass for the Chrome D3D9 backend and ES 2.0 on mobile.\n this._translucentMultipassSupport = false;\n this._translucentMRTSupport = false;\n\n const extensionsSupported =\n context.colorBufferFloat && context.depthTexture && context.floatBlend;\n this._translucentMRTSupport = context.drawBuffers && extensionsSupported;\n this._translucentMultipassSupport =\n !this._translucentMRTSupport && extensionsSupported;\n\n this._opaqueFBO = undefined;\n this._opaqueTexture = undefined;\n this._depthStencilTexture = undefined;\n\n this._accumulationTexture = undefined;\n\n this._translucentFBO = new FramebufferManager({\n colorAttachmentsLength: this._translucentMRTSupport ? 2 : 1,\n createColorAttachments: false,\n createDepthAttachments: false,\n depth: true,\n });\n this._alphaFBO = new FramebufferManager({\n createColorAttachments: false,\n createDepthAttachments: false,\n depth: true,\n });\n\n this._adjustTranslucentFBO = new FramebufferManager({\n colorAttachmentsLength: this._translucentMRTSupport ? 2 : 1,\n createColorAttachments: false,\n });\n this._adjustAlphaFBO = new FramebufferManager({\n createColorAttachments: false,\n });\n\n this._opaqueClearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n owner: this,\n });\n this._translucentMRTClearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 1.0),\n owner: this,\n });\n this._translucentMultipassClearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n owner: this,\n });\n this._alphaClearCommand = new ClearCommand({\n color: new Color(1.0, 1.0, 1.0, 1.0),\n owner: this,\n });\n\n this._translucentRenderStateCache = {};\n this._alphaRenderStateCache = {};\n\n this._compositeCommand = undefined;\n this._adjustTranslucentCommand = undefined;\n this._adjustAlphaCommand = undefined;\n\n this._viewport = new BoundingRectangle();\n this._rs = undefined;\n\n this._useScissorTest = false;\n this._scissorRectangle = undefined;\n\n this._useHDR = false;\n}\n\nfunction destroyTextures(oit) {\n oit._accumulationTexture =\n oit._accumulationTexture &&\n !oit._accumulationTexture.isDestroyed() &&\n oit._accumulationTexture.destroy();\n oit._revealageTexture =\n oit._revealageTexture &&\n !oit._revealageTexture.isDestroyed() &&\n oit._revealageTexture.destroy();\n}\n\nfunction destroyFramebuffers(oit) {\n oit._translucentFBO.destroy();\n oit._alphaFBO.destroy();\n oit._adjustTranslucentFBO.destroy();\n oit._adjustAlphaFBO.destroy();\n}\n\nfunction destroyResources(oit) {\n destroyTextures(oit);\n destroyFramebuffers(oit);\n}\n\nfunction updateTextures(oit, context, width, height) {\n destroyTextures(oit);\n\n oit._accumulationTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.FLOAT,\n });\n\n // Use zeroed arraybuffer instead of null to initialize texture\n // to workaround Firefox. Only needed for the second color attachment.\n const source = new Float32Array(width * height * 4);\n oit._revealageTexture = new Texture({\n context: context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.FLOAT,\n source: {\n arrayBufferView: source,\n width: width,\n height: height,\n },\n flipY: false,\n });\n}\n\nfunction updateFramebuffers(oit, context) {\n destroyFramebuffers(oit);\n\n const completeFBO = WebGLConstants.FRAMEBUFFER_COMPLETE;\n let supported = true;\n\n const width = oit._accumulationTexture.width;\n const height = oit._accumulationTexture.height;\n\n // if MRT is supported, attempt to make an FBO with multiple color attachments\n if (oit._translucentMRTSupport) {\n oit._translucentFBO.setColorTexture(oit._accumulationTexture, 0);\n oit._translucentFBO.setColorTexture(oit._revealageTexture, 1);\n oit._translucentFBO.setDepthStencilTexture(oit._depthStencilTexture);\n oit._translucentFBO.update(context, width, height);\n\n oit._adjustTranslucentFBO.setColorTexture(oit._accumulationTexture, 0);\n oit._adjustTranslucentFBO.setColorTexture(oit._revealageTexture, 1);\n oit._adjustTranslucentFBO.update(context, width, height);\n\n if (\n oit._translucentFBO.status !== completeFBO ||\n oit._adjustTranslucentFBO.status !== completeFBO\n ) {\n destroyFramebuffers(oit);\n oit._translucentMRTSupport = false;\n }\n }\n\n // either MRT isn't supported or FBO creation failed, attempt multipass\n if (!oit._translucentMRTSupport) {\n oit._translucentFBO.setColorTexture(oit._accumulationTexture);\n oit._translucentFBO.setDepthStencilTexture(oit._depthStencilTexture);\n oit._translucentFBO.update(context, width, height);\n\n oit._alphaFBO.setColorTexture(oit._revealageTexture);\n oit._alphaFBO.setDepthStencilTexture(oit._depthStencilTexture);\n oit._alphaFBO.update(context, width, height);\n\n oit._adjustTranslucentFBO.setColorTexture(oit._accumulationTexture);\n oit._adjustTranslucentFBO.update(context, width, height);\n\n oit._adjustAlphaFBO.setColorTexture(oit._revealageTexture);\n oit._adjustAlphaFBO.update(context, width, height);\n\n const translucentComplete = oit._translucentFBO.status === completeFBO;\n const alphaComplete = oit._alphaFBO.status === completeFBO;\n const adjustTranslucentComplete =\n oit._adjustTranslucentFBO.status === completeFBO;\n const adjustAlphaComplete = oit._adjustAlphaFBO.status === completeFBO;\n if (\n !translucentComplete ||\n !alphaComplete ||\n !adjustTranslucentComplete ||\n !adjustAlphaComplete\n ) {\n destroyResources(oit);\n oit._translucentMultipassSupport = false;\n supported = false;\n }\n }\n\n return supported;\n}\n\nOIT.prototype.update = function (\n context,\n passState,\n framebuffer,\n useHDR,\n numSamples\n) {\n if (!this.isSupported()) {\n return;\n }\n\n this._opaqueFBO = framebuffer;\n this._opaqueTexture = framebuffer.getColorTexture(0);\n this._depthStencilTexture = framebuffer.getDepthStencilTexture();\n\n const width = this._opaqueTexture.width;\n const height = this._opaqueTexture.height;\n\n const accumulationTexture = this._accumulationTexture;\n const textureChanged =\n !defined(accumulationTexture) ||\n accumulationTexture.width !== width ||\n accumulationTexture.height !== height ||\n useHDR !== this._useHDR;\n const samplesChanged = this._numSamples !== numSamples;\n\n if (textureChanged || samplesChanged) {\n this._numSamples = numSamples;\n updateTextures(this, context, width, height);\n }\n\n if (\n !defined(this._translucentFBO.framebuffer) ||\n textureChanged ||\n samplesChanged\n ) {\n if (!updateFramebuffers(this, context)) {\n // framebuffer creation failed\n return;\n }\n }\n\n this._useHDR = useHDR;\n\n const that = this;\n let fs;\n let uniformMap;\n\n if (!defined(this._compositeCommand)) {\n fs = new ShaderSource({\n sources: [CompositeOITFS],\n });\n if (this._translucentMRTSupport) {\n fs.defines.push(\"MRT\");\n }\n\n uniformMap = {\n u_opaque: function () {\n return that._opaqueTexture;\n },\n u_accumulation: function () {\n return that._accumulationTexture;\n },\n u_revealage: function () {\n return that._revealageTexture;\n },\n };\n this._compositeCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: this,\n });\n }\n\n if (!defined(this._adjustTranslucentCommand)) {\n if (this._translucentMRTSupport) {\n fs = new ShaderSource({\n defines: [\"MRT\"],\n sources: [AdjustTranslucentFS],\n });\n\n uniformMap = {\n u_bgColor: function () {\n return that._translucentMRTClearCommand.color;\n },\n u_depthTexture: function () {\n return that._depthStencilTexture;\n },\n };\n\n this._adjustTranslucentCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: this,\n });\n } else if (this._translucentMultipassSupport) {\n fs = new ShaderSource({\n sources: [AdjustTranslucentFS],\n });\n\n uniformMap = {\n u_bgColor: function () {\n return that._translucentMultipassClearCommand.color;\n },\n u_depthTexture: function () {\n return that._depthStencilTexture;\n },\n };\n\n this._adjustTranslucentCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: this,\n });\n\n uniformMap = {\n u_bgColor: function () {\n return that._alphaClearCommand.color;\n },\n u_depthTexture: function () {\n return that._depthStencilTexture;\n },\n };\n\n this._adjustAlphaCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: this,\n });\n }\n }\n\n this._viewport.width = width;\n this._viewport.height = height;\n\n const useScissorTest = !BoundingRectangle.equals(\n this._viewport,\n passState.viewport\n );\n let updateScissor = useScissorTest !== this._useScissorTest;\n this._useScissorTest = useScissorTest;\n\n if (!BoundingRectangle.equals(this._scissorRectangle, passState.viewport)) {\n this._scissorRectangle = BoundingRectangle.clone(\n passState.viewport,\n this._scissorRectangle\n );\n updateScissor = true;\n }\n\n if (\n !defined(this._rs) ||\n !BoundingRectangle.equals(this._viewport, this._rs.viewport) ||\n updateScissor\n ) {\n this._rs = RenderState.fromCache({\n viewport: this._viewport,\n scissorTest: {\n enabled: this._useScissorTest,\n rectangle: this._scissorRectangle,\n },\n });\n }\n\n if (defined(this._compositeCommand)) {\n this._compositeCommand.renderState = this._rs;\n }\n\n if (this._adjustTranslucentCommand) {\n this._adjustTranslucentCommand.renderState = this._rs;\n }\n\n if (defined(this._adjustAlphaCommand)) {\n this._adjustAlphaCommand.renderState = this._rs;\n }\n};\n\nconst translucentMRTBlend = {\n enabled: true,\n color: new Color(0.0, 0.0, 0.0, 0.0),\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.ONE,\n functionDestinationRgb: BlendFunction.ONE,\n functionSourceAlpha: BlendFunction.ZERO,\n functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n};\n\nconst translucentColorBlend = {\n enabled: true,\n color: new Color(0.0, 0.0, 0.0, 0.0),\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.ONE,\n functionDestinationRgb: BlendFunction.ONE,\n functionSourceAlpha: BlendFunction.ONE,\n functionDestinationAlpha: BlendFunction.ONE,\n};\n\nconst translucentAlphaBlend = {\n enabled: true,\n color: new Color(0.0, 0.0, 0.0, 0.0),\n equationRgb: BlendEquation.ADD,\n equationAlpha: BlendEquation.ADD,\n functionSourceRgb: BlendFunction.ZERO,\n functionDestinationRgb: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n functionSourceAlpha: BlendFunction.ZERO,\n functionDestinationAlpha: BlendFunction.ONE_MINUS_SOURCE_ALPHA,\n};\n\nfunction getTranslucentRenderState(\n context,\n translucentBlending,\n cache,\n renderState\n) {\n let translucentState = cache[renderState.id];\n if (!defined(translucentState)) {\n const rs = RenderState.getState(renderState);\n rs.depthMask = false;\n rs.blending = translucentBlending;\n\n translucentState = RenderState.fromCache(rs);\n cache[renderState.id] = translucentState;\n }\n\n return translucentState;\n}\n\nfunction getTranslucentMRTRenderState(oit, context, renderState) {\n return getTranslucentRenderState(\n context,\n translucentMRTBlend,\n oit._translucentRenderStateCache,\n renderState\n );\n}\n\nfunction getTranslucentColorRenderState(oit, context, renderState) {\n return getTranslucentRenderState(\n context,\n translucentColorBlend,\n oit._translucentRenderStateCache,\n renderState\n );\n}\n\nfunction getTranslucentAlphaRenderState(oit, context, renderState) {\n return getTranslucentRenderState(\n context,\n translucentAlphaBlend,\n oit._alphaRenderStateCache,\n renderState\n );\n}\n\nconst mrtShaderSource =\n \" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\\n\" +\n \" float ai = czm_gl_FragColor.a;\\n\" +\n \" float wzi = czm_alphaWeight(ai);\\n\" +\n \" gl_FragData[0] = vec4(Ci * wzi, ai);\\n\" +\n \" gl_FragData[1] = vec4(ai * wzi);\\n\";\n\nconst colorShaderSource =\n \" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\\n\" +\n \" float ai = czm_gl_FragColor.a;\\n\" +\n \" float wzi = czm_alphaWeight(ai);\\n\" +\n \" gl_FragColor = vec4(Ci, ai) * wzi;\\n\";\n\nconst alphaShaderSource =\n \" float ai = czm_gl_FragColor.a;\\n\" + \" gl_FragColor = vec4(ai);\\n\";\n\nfunction getTranslucentShaderProgram(context, shaderProgram, keyword, source) {\n let shader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n keyword\n );\n if (!defined(shader)) {\n const attributeLocations = shaderProgram._attributeLocations;\n\n const fs = shaderProgram.fragmentShaderSource.clone();\n\n fs.sources = fs.sources.map(function (source) {\n source = ShaderSource.replaceMain(source, \"czm_translucent_main\");\n source = source.replace(/gl_FragColor/g, \"czm_gl_FragColor\");\n source = source.replace(/\\bdiscard\\b/g, \"czm_discard = true\");\n source = source.replace(/czm_phong/g, \"czm_translucentPhong\");\n return source;\n });\n\n // Discarding the fragment in main is a workaround for ANGLE D3D9\n // shader compilation errors.\n\n fs.sources.splice(\n 0,\n 0,\n `${\n source.indexOf(\"gl_FragData\") !== -1\n ? \"#extension GL_EXT_draw_buffers : enable \\n\"\n : \"\"\n }vec4 czm_gl_FragColor;\\n` + `bool czm_discard = false;\\n`\n );\n\n fs.sources.push(\n `${\n \"void main()\\n\" +\n \"{\\n\" +\n \" czm_translucent_main();\\n\" +\n \" if (czm_discard)\\n\" +\n \" {\\n\" +\n \" discard;\\n\" +\n \" }\\n\"\n }${source}}\\n`\n );\n\n shader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n keyword,\n {\n vertexShaderSource: shaderProgram.vertexShaderSource,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n }\n );\n }\n\n return shader;\n}\n\nfunction getTranslucentMRTShaderProgram(context, shaderProgram) {\n return getTranslucentShaderProgram(\n context,\n shaderProgram,\n \"translucentMRT\",\n mrtShaderSource\n );\n}\n\nfunction getTranslucentColorShaderProgram(context, shaderProgram) {\n return getTranslucentShaderProgram(\n context,\n shaderProgram,\n \"translucentMultipass\",\n colorShaderSource\n );\n}\n\nfunction getTranslucentAlphaShaderProgram(context, shaderProgram) {\n return getTranslucentShaderProgram(\n context,\n shaderProgram,\n \"alphaMultipass\",\n alphaShaderSource\n );\n}\n\nOIT.prototype.createDerivedCommands = function (command, context, result) {\n if (!defined(result)) {\n result = {};\n }\n\n if (this._translucentMRTSupport) {\n let translucentShader;\n let translucentRenderState;\n if (defined(result.translucentCommand)) {\n translucentShader = result.translucentCommand.shaderProgram;\n translucentRenderState = result.translucentCommand.renderState;\n }\n\n result.translucentCommand = DrawCommand.shallowClone(\n command,\n result.translucentCommand\n );\n\n if (\n !defined(translucentShader) ||\n result.shaderProgramId !== command.shaderProgram.id\n ) {\n result.translucentCommand.shaderProgram = getTranslucentMRTShaderProgram(\n context,\n command.shaderProgram\n );\n result.translucentCommand.renderState = getTranslucentMRTRenderState(\n this,\n context,\n command.renderState\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.translucentCommand.shaderProgram = translucentShader;\n result.translucentCommand.renderState = translucentRenderState;\n }\n } else {\n let colorShader;\n let colorRenderState;\n let alphaShader;\n let alphaRenderState;\n if (defined(result.translucentCommand)) {\n colorShader = result.translucentCommand.shaderProgram;\n colorRenderState = result.translucentCommand.renderState;\n alphaShader = result.alphaCommand.shaderProgram;\n alphaRenderState = result.alphaCommand.renderState;\n }\n\n result.translucentCommand = DrawCommand.shallowClone(\n command,\n result.translucentCommand\n );\n result.alphaCommand = DrawCommand.shallowClone(\n command,\n result.alphaCommand\n );\n\n if (\n !defined(colorShader) ||\n result.shaderProgramId !== command.shaderProgram.id\n ) {\n result.translucentCommand.shaderProgram = getTranslucentColorShaderProgram(\n context,\n command.shaderProgram\n );\n result.translucentCommand.renderState = getTranslucentColorRenderState(\n this,\n context,\n command.renderState\n );\n result.alphaCommand.shaderProgram = getTranslucentAlphaShaderProgram(\n context,\n command.shaderProgram\n );\n result.alphaCommand.renderState = getTranslucentAlphaRenderState(\n this,\n context,\n command.renderState\n );\n result.shaderProgramId = command.shaderProgram.id;\n } else {\n result.translucentCommand.shaderProgram = colorShader;\n result.translucentCommand.renderState = colorRenderState;\n result.alphaCommand.shaderProgram = alphaShader;\n result.alphaCommand.renderState = alphaRenderState;\n }\n }\n\n return result;\n};\n\nfunction executeTranslucentCommandsSortedMultipass(\n oit,\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n) {\n let command;\n let derivedCommand;\n let j;\n\n const context = scene.context;\n const useLogDepth = scene.frameState.useLogDepth;\n const useHdr = scene._hdr;\n const framebuffer = passState.framebuffer;\n const length = commands.length;\n\n const lightShadowsEnabled = scene.frameState.shadowState.lightShadowsEnabled;\n\n passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;\n oit._adjustTranslucentCommand.execute(context, passState);\n passState.framebuffer = oit._adjustAlphaFBO.framebuffer;\n oit._adjustAlphaCommand.execute(context, passState);\n\n const debugFramebuffer = oit._opaqueFBO.framebuffer;\n passState.framebuffer = oit._translucentFBO.framebuffer;\n\n for (j = 0; j < length; ++j) {\n command = commands[j];\n command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n command = useHdr ? command.derivedCommands.hdr.command : command;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.translucentCommand\n : command.derivedCommands.oit.translucentCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n if (defined(invertClassification)) {\n command = invertClassification.unclassifiedCommand;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.translucentCommand\n : command.derivedCommands.oit.translucentCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n passState.framebuffer = oit._alphaFBO.framebuffer;\n\n for (j = 0; j < length; ++j) {\n command = commands[j];\n command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n command = useHdr ? command.derivedCommands.hdr.command : command;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.alphaCommand\n : command.derivedCommands.oit.alphaCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n if (defined(invertClassification)) {\n command = invertClassification.unclassifiedCommand;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.alphaCommand\n : command.derivedCommands.oit.alphaCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n passState.framebuffer = framebuffer;\n}\n\nfunction executeTranslucentCommandsSortedMRT(\n oit,\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n) {\n const context = scene.context;\n const useLogDepth = scene.frameState.useLogDepth;\n const useHdr = scene._hdr;\n const framebuffer = passState.framebuffer;\n const length = commands.length;\n\n const lightShadowsEnabled = scene.frameState.shadowState.lightShadowsEnabled;\n\n passState.framebuffer = oit._adjustTranslucentFBO.framebuffer;\n oit._adjustTranslucentCommand.execute(context, passState);\n\n const debugFramebuffer = oit._opaqueFBO.framebuffer;\n passState.framebuffer = oit._translucentFBO.framebuffer;\n\n let command;\n let derivedCommand;\n\n for (let j = 0; j < length; ++j) {\n command = commands[j];\n command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n command = useHdr ? command.derivedCommands.hdr.command : command;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.translucentCommand\n : command.derivedCommands.oit.translucentCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n if (defined(invertClassification)) {\n command = invertClassification.unclassifiedCommand;\n derivedCommand =\n lightShadowsEnabled && command.receiveShadows\n ? command.derivedCommands.oit.shadows.translucentCommand\n : command.derivedCommands.oit.translucentCommand;\n executeFunction(\n derivedCommand,\n scene,\n context,\n passState,\n debugFramebuffer\n );\n }\n\n passState.framebuffer = framebuffer;\n}\n\nOIT.prototype.executeCommands = function (\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n) {\n if (this._translucentMRTSupport) {\n executeTranslucentCommandsSortedMRT(\n this,\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n );\n return;\n }\n\n executeTranslucentCommandsSortedMultipass(\n this,\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n );\n};\n\nOIT.prototype.execute = function (context, passState) {\n this._compositeCommand.execute(context, passState);\n};\n\nOIT.prototype.clear = function (context, passState, clearColor) {\n const framebuffer = passState.framebuffer;\n\n passState.framebuffer = this._opaqueFBO.framebuffer;\n Color.clone(clearColor, this._opaqueClearCommand.color);\n this._opaqueClearCommand.execute(context, passState);\n\n passState.framebuffer = this._translucentFBO.framebuffer;\n const translucentClearCommand = this._translucentMRTSupport\n ? this._translucentMRTClearCommand\n : this._translucentMultipassClearCommand;\n translucentClearCommand.execute(context, passState);\n\n if (this._translucentMultipassSupport) {\n passState.framebuffer = this._alphaFBO.framebuffer;\n this._alphaClearCommand.execute(context, passState);\n }\n\n passState.framebuffer = framebuffer;\n};\n\nOIT.prototype.isSupported = function () {\n return this._translucentMRTSupport || this._translucentMultipassSupport;\n};\n\nOIT.prototype.isDestroyed = function () {\n return false;\n};\n\nOIT.prototype.destroy = function () {\n destroyResources(this);\n\n if (defined(this._compositeCommand)) {\n this._compositeCommand.shaderProgram =\n this._compositeCommand.shaderProgram &&\n this._compositeCommand.shaderProgram.destroy();\n }\n\n if (defined(this._adjustTranslucentCommand)) {\n this._adjustTranslucentCommand.shaderProgram =\n this._adjustTranslucentCommand.shaderProgram &&\n this._adjustTranslucentCommand.shaderProgram.destroy();\n }\n\n if (defined(this._adjustAlphaCommand)) {\n this._adjustAlphaCommand.shaderProgram =\n this._adjustAlphaCommand.shaderProgram &&\n this._adjustAlphaCommand.shaderProgram.destroy();\n }\n\n return destroyObject(this);\n};\nexport default OIT;\n", "import Credit from \"../Core/Credit.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Rectangle from \"../Core/Rectangle.js\";\nimport Resource from \"../Core/Resource.js\";\nimport WebMercatorTilingScheme from \"../Core/WebMercatorTilingScheme.js\";\nimport UrlTemplateImageryProvider from \"./UrlTemplateImageryProvider.js\";\n\nconst defaultCredit = new Credit(\n \"MapQuest, Open Street Map and contributors, CC-BY-SA\"\n);\n\n/**\n * @typedef {Object} OpenStreetMapImageryProvider.ConstructorOptions\n *\n * Initialization options for the OpenStreetMapImageryProvider constructor\n *\n * @property {String} [url='https://a.tile.openstreetmap.org'] The OpenStreetMap server url.\n * @property {String} [fileExtension='png'] The file extension for images on the server.\n * @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.\n * @property {Number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider.\n * @property {Number} [maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n * @property {Credit|String} [credit='MapQuest, Open Street Map and contributors, CC-BY-SA'] A credit for the data source, which is displayed on the canvas.\n */\n\n/**\n * An imagery provider that provides tiled imagery hosted by OpenStreetMap\n * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run\n * servers, so you must conform to their\n * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.\n *\n * @alias OpenStreetMapImageryProvider\n * @constructor\n * @extends UrlTemplateImageryProvider\n *\n * @param {OpenStreetMapImageryProvider.ConstructorOptions} options Object describing initialization options\n * @exception {DeveloperError} The rectangle and minimumLevel indicate that there are more than four tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.\n *\n * @see ArcGisMapServerImageryProvider\n * @see BingMapsImageryProvider\n * @see GoogleEarthEnterpriseMapsProvider\n * @see SingleTileImageryProvider\n * @see TileMapServiceImageryProvider\n * @see WebMapServiceImageryProvider\n * @see WebMapTileServiceImageryProvider\n * @see UrlTemplateImageryProvider\n *\n * @example\n * const osm = new Cesium.OpenStreetMapImageryProvider({\n * url : 'https://a.tile.openstreetmap.org/'\n * });\n *\n * @see {@link http://wiki.openstreetmap.org/wiki/Main_Page|OpenStreetMap Wiki}\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\n */\nfunction OpenStreetMapImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const resource = Resource.createIfNeeded(\n defaultValue(options.url, \"https://a.tile.openstreetmap.org/\")\n );\n resource.appendForwardSlash();\n resource.url += `{z}/{x}/{y}.${defaultValue(options.fileExtension, \"png\")}`;\n\n const tilingScheme = new WebMercatorTilingScheme({\n ellipsoid: options.ellipsoid,\n });\n\n const tileWidth = 256;\n const tileHeight = 256;\n\n const minimumLevel = defaultValue(options.minimumLevel, 0);\n const maximumLevel = options.maximumLevel;\n\n const rectangle = defaultValue(options.rectangle, tilingScheme.rectangle);\n\n // Check the number of tiles at the minimum level. If it's more than four,\n // throw an exception, because starting at the higher minimum\n // level will cause too many tiles to be downloaded and rendered.\n const swTile = tilingScheme.positionToTileXY(\n Rectangle.southwest(rectangle),\n minimumLevel\n );\n const neTile = tilingScheme.positionToTileXY(\n Rectangle.northeast(rectangle),\n minimumLevel\n );\n const tileCount =\n (Math.abs(neTile.x - swTile.x) + 1) * (Math.abs(neTile.y - swTile.y) + 1);\n let credit = defaultValue(options.credit, defaultCredit);\n if (typeof credit === \"string\") {\n credit = new Credit(credit);\n }\n\n UrlTemplateImageryProvider.call(this, {\n url: resource,\n credit: credit,\n tilingScheme: tilingScheme,\n tileWidth: tileWidth,\n tileHeight: tileHeight,\n minimumLevel: minimumLevel,\n maximumLevel: maximumLevel,\n rectangle: rectangle,\n });\n}\n\nif (defined(Object.create)) {\n OpenStreetMapImageryProvider.prototype = Object.create(\n UrlTemplateImageryProvider.prototype\n );\n OpenStreetMapImageryProvider.prototype.constructor = OpenStreetMapImageryProvider;\n}\n\nexport default OpenStreetMapImageryProvider;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\n\nconst defaultSize = new Cartesian2(1.0, 1.0);\n\n/**\n * A particle emitted by a {@link ParticleSystem}.\n *\n * @alias Particle\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {Number} [options.mass=1.0] The mass of the particle in kilograms.\n * @param {Cartesian3} [options.position=Cartesian3.ZERO] The initial position of the particle in world coordinates.\n * @param {Cartesian3} [options.velocity=Cartesian3.ZERO] The velocity vector of the particle in world coordinates.\n * @param {Number} [options.life=Number.MAX_VALUE] The life of the particle in seconds.\n * @param {Object} [options.image] The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n * @param {Color} [options.startColor=Color.WHITE] The color of a particle when it is born.\n * @param {Color} [options.endColor=Color.WHITE] The color of a particle when it dies.\n * @param {Number} [options.startScale=1.0] The scale of the particle when it is born.\n * @param {Number} [options.endScale=1.0] The scale of the particle when it dies.\n * @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] The dimensions, width by height, to scale the particle image in pixels.\n */\nfunction Particle(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The mass of the particle in kilograms.\n * @type {Number}\n * @default 1.0\n */\n this.mass = defaultValue(options.mass, 1.0);\n /**\n * The positon of the particle in world coordinates.\n * @type {Cartesian3}\n * @default Cartesian3.ZERO\n */\n this.position = Cartesian3.clone(\n defaultValue(options.position, Cartesian3.ZERO)\n );\n /**\n * The velocity of the particle in world coordinates.\n * @type {Cartesian3}\n * @default Cartesian3.ZERO\n */\n this.velocity = Cartesian3.clone(\n defaultValue(options.velocity, Cartesian3.ZERO)\n );\n /**\n * The life of the particle in seconds.\n * @type {Number}\n * @default Number.MAX_VALUE\n */\n this.life = defaultValue(options.life, Number.MAX_VALUE);\n /**\n * The image to use for the particle.\n * @type {Object}\n * @default undefined\n */\n this.image = options.image;\n /**\n * The color of the particle when it is born.\n * @type {Color}\n * @default Color.WHITE\n */\n this.startColor = Color.clone(defaultValue(options.startColor, Color.WHITE));\n /**\n * The color of the particle when it dies.\n * @type {Color}\n * @default Color.WHITE\n */\n this.endColor = Color.clone(defaultValue(options.endColor, Color.WHITE));\n /**\n * the scale of the particle when it is born.\n * @type {Number}\n * @default 1.0\n */\n this.startScale = defaultValue(options.startScale, 1.0);\n /**\n * The scale of the particle when it dies.\n * @type {Number}\n * @default 1.0\n */\n this.endScale = defaultValue(options.endScale, 1.0);\n /**\n * The dimensions, width by height, to scale the particle image in pixels.\n * @type {Cartesian2}\n * @default new Cartesian(1.0, 1.0)\n */\n this.imageSize = Cartesian2.clone(\n defaultValue(options.imageSize, defaultSize)\n );\n\n this._age = 0.0;\n this._normalizedAge = 0.0;\n\n // used by ParticleSystem\n this._billboard = undefined;\n}\n\nObject.defineProperties(Particle.prototype, {\n /**\n * Gets the age of the particle in seconds.\n * @memberof Particle.prototype\n * @type {Number}\n */\n age: {\n get: function () {\n return this._age;\n },\n },\n /**\n * Gets the age normalized to a value in the range [0.0, 1.0].\n * @memberof Particle.prototype\n * @type {Number}\n */\n normalizedAge: {\n get: function () {\n return this._normalizedAge;\n },\n },\n});\n\nconst deltaScratch = new Cartesian3();\n\n/**\n * @private\n */\nParticle.prototype.update = function (dt, particleUpdateFunction) {\n // Apply the velocity\n Cartesian3.multiplyByScalar(this.velocity, dt, deltaScratch);\n Cartesian3.add(this.position, deltaScratch, this.position);\n\n // Update any forces.\n if (defined(particleUpdateFunction)) {\n particleUpdateFunction(this, dt);\n }\n\n // Age the particle\n this._age += dt;\n\n // Compute the normalized age.\n if (this.life === Number.MAX_VALUE) {\n this._normalizedAge = 0.0;\n } else {\n this._normalizedAge = this._age / this.life;\n }\n\n // If this particle is older than it's lifespan then die.\n return this._age <= this.life;\n};\nexport default Particle;\n", "import defaultValue from \"../Core/defaultValue.js\";\n\n/**\n * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.\n *\n * @alias ParticleBurst\n * @constructor\n *\n * @param {Object} [options] An object with the following properties:\n * @param {Number} [options.time=0.0] The time in seconds after the beginning of the particle system's lifetime that the burst will occur.\n * @param {Number} [options.minimum=0.0] The minimum number of particles emmitted in the burst.\n * @param {Number} [options.maximum=50.0] The maximum number of particles emitted in the burst.\n */\nfunction ParticleBurst(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.\n * @type {Number}\n * @default 0.0\n */\n this.time = defaultValue(options.time, 0.0);\n /**\n * The minimum number of particles emitted.\n * @type {Number}\n * @default 0.0\n */\n this.minimum = defaultValue(options.minimum, 0.0);\n /**\n * The maximum number of particles emitted.\n * @type {Number}\n * @default 50.0\n */\n this.maximum = defaultValue(options.maximum, 50.0);\n\n this._complete = false;\n}\n\nObject.defineProperties(ParticleBurst.prototype, {\n /**\n * <code>true</code> if the burst has been completed; <code>false</code> otherwise.\n * @memberof ParticleBurst.prototype\n * @type {Boolean}\n */\n complete: {\n get: function () {\n return this._complete;\n },\n },\n});\nexport default ParticleBurst;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * <p>\n * An object that initializes a {@link Particle} from a {@link ParticleSystem}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias ParticleEmitter\n * @constructor\n *\n * @see BoxEmitter\n * @see CircleEmitter\n * @see ConeEmitter\n * @see SphereEmitter\n */\nfunction ParticleEmitter(options) {\n}\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} The particle to initialize\n */\nParticleEmitter.prototype.emit = function (particle) {\n DeveloperError.throwInstantiationError();\n};\nexport default ParticleEmitter;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport BillboardCollection from \"./BillboardCollection.js\";\nimport CircleEmitter from \"./CircleEmitter.js\";\nimport Particle from \"./Particle.js\";\n\nconst defaultImageSize = new Cartesian2(1.0, 1.0);\n\n/**\n * A ParticleSystem manages the updating and display of a collection of particles.\n *\n * @alias ParticleSystem\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Boolean} [options.show=true] Whether to display the particle system.\n * @param {ParticleSystem.updateCallback} [options.updateCallback] The callback function to be called each frame to update a particle.\n * @param {ParticleEmitter} [options.emitter=new CircleEmitter(0.5)] The particle emitter for this system.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system from model to world coordinates.\n * @param {Matrix4} [options.emitterModelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.\n * @param {Number} [options.emissionRate=5] The number of particles to emit per second.\n * @param {ParticleBurst[]} [options.bursts] An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.\n * @param {Boolean} [options.loop=true] Whether the particle system should loop its bursts when it is complete.\n * @param {Number} [options.scale=1.0] Sets the scale to apply to the image of the particle for the duration of its particleLife.\n * @param {Number} [options.startScale] The initial scale to apply to the image of the particle at the beginning of its life.\n * @param {Number} [options.endScale] The final scale to apply to the image of the particle at the end of its life.\n * @param {Color} [options.color=Color.WHITE] Sets the color of a particle for the duration of its particleLife.\n * @param {Color} [options.startColor] The color of the particle at the beginning of its life.\n * @param {Color} [options.endColor] The color of the particle at the end of its life.\n * @param {Object} [options.image] The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n * @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels.\n * @param {Cartesian2} [options.minimumImageSize] Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.\n * @param {Cartesian2} [options.maximumImageSize] Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.\n * @param {Boolean} [options.sizeInMeters] Sets if the size of particles is in meters or pixels. <code>true</code> to size the particles in meters; otherwise, the size is in pixels.\n * @param {Number} [options.speed=1.0] If set, overrides the minimumSpeed and maximumSpeed inputs with this value.\n * @param {Number} [options.minimumSpeed] Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.\n * @param {Number} [options.maximumSpeed] Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.\n * @param {Number} [options.lifetime=Number.MAX_VALUE] How long the particle system will emit particles, in seconds.\n * @param {Number} [options.particleLife=5.0] If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.\n * @param {Number} [options.minimumParticleLife] Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.\n * @param {Number} [options.maximumParticleLife] Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.\n * @param {Number} [options.mass=1.0] Sets the minimum and maximum mass of particles in kilograms.\n * @param {Number} [options.minimumMass] Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value.\n * @param {Number} [options.maximumMass] Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value.\n * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-particle-systems/|Particle Systems Tutorial}\n * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System.html&label=Showcases|Particle Systems Tutorial Demo}\n * @demo {@link https://sandcastle.cesium.com/?src=Particle%20System%20Fireworks.html&label=Showcases|Particle Systems Fireworks Demo}\n */\nfunction ParticleSystem(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Whether to display the particle system.\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time\n * @type {ParticleSystem.updateCallback}\n * @default undefined\n */\n this.updateCallback = options.updateCallback;\n\n /**\n * Whether the particle system should loop it's bursts when it is complete.\n * @type {Boolean}\n * @default true\n */\n this.loop = defaultValue(options.loop, true);\n\n /**\n * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.\n * @type {Object}\n * @default undefined\n */\n this.image = defaultValue(options.image, undefined);\n\n let emitter = options.emitter;\n if (!defined(emitter)) {\n emitter = new CircleEmitter(0.5);\n }\n this._emitter = emitter;\n\n this._bursts = options.bursts;\n\n this._modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n this._emitterModelMatrix = Matrix4.clone(\n defaultValue(options.emitterModelMatrix, Matrix4.IDENTITY)\n );\n this._matrixDirty = true;\n this._combinedMatrix = new Matrix4();\n\n this._startColor = Color.clone(\n defaultValue(options.color, defaultValue(options.startColor, Color.WHITE))\n );\n this._endColor = Color.clone(\n defaultValue(options.color, defaultValue(options.endColor, Color.WHITE))\n );\n\n this._startScale = defaultValue(\n options.scale,\n defaultValue(options.startScale, 1.0)\n );\n this._endScale = defaultValue(\n options.scale,\n defaultValue(options.endScale, 1.0)\n );\n\n this._emissionRate = defaultValue(options.emissionRate, 5.0);\n\n this._minimumSpeed = defaultValue(\n options.speed,\n defaultValue(options.minimumSpeed, 1.0)\n );\n this._maximumSpeed = defaultValue(\n options.speed,\n defaultValue(options.maximumSpeed, 1.0)\n );\n\n this._minimumParticleLife = defaultValue(\n options.particleLife,\n defaultValue(options.minimumParticleLife, 5.0)\n );\n this._maximumParticleLife = defaultValue(\n options.particleLife,\n defaultValue(options.maximumParticleLife, 5.0)\n );\n\n this._minimumMass = defaultValue(\n options.mass,\n defaultValue(options.minimumMass, 1.0)\n );\n this._maximumMass = defaultValue(\n options.mass,\n defaultValue(options.maximumMass, 1.0)\n );\n\n this._minimumImageSize = Cartesian2.clone(\n defaultValue(\n options.imageSize,\n defaultValue(options.minimumImageSize, defaultImageSize)\n )\n );\n this._maximumImageSize = Cartesian2.clone(\n defaultValue(\n options.imageSize,\n defaultValue(options.maximumImageSize, defaultImageSize)\n )\n );\n\n this._sizeInMeters = defaultValue(options.sizeInMeters, false);\n\n this._lifetime = defaultValue(options.lifetime, Number.MAX_VALUE);\n\n this._billboardCollection = undefined;\n this._particles = [];\n\n // An array of available particles that we can reuse instead of allocating new.\n this._particlePool = [];\n\n this._previousTime = undefined;\n this._currentTime = 0.0;\n this._carryOver = 0.0;\n\n this._complete = new Event();\n this._isComplete = false;\n\n this._updateParticlePool = true;\n this._particleEstimate = 0;\n}\n\nObject.defineProperties(ParticleSystem.prototype, {\n /**\n * The particle emitter for this\n * @memberof ParticleSystem.prototype\n * @type {ParticleEmitter}\n * @default CircleEmitter\n */\n emitter: {\n get: function () {\n return this._emitter;\n },\n set: function (value) {\nthis._emitter = value;\n },\n },\n /**\n * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.\n * @memberof ParticleSystem.prototype\n * @type {ParticleBurst[]}\n * @default undefined\n */\n bursts: {\n get: function () {\n return this._bursts;\n },\n set: function (value) {\n this._bursts = value;\n this._updateParticlePool = true;\n },\n },\n /**\n * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.\n * @memberof ParticleSystem.prototype\n * @type {Matrix4}\n * @default Matrix4.IDENTITY\n */\n modelMatrix: {\n get: function () {\n return this._modelMatrix;\n },\n set: function (value) {\nthis._matrixDirty =\n this._matrixDirty || !Matrix4.equals(this._modelMatrix, value);\n Matrix4.clone(value, this._modelMatrix);\n },\n },\n /**\n * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.\n * @memberof ParticleSystem.prototype\n * @type {Matrix4}\n * @default Matrix4.IDENTITY\n */\n emitterModelMatrix: {\n get: function () {\n return this._emitterModelMatrix;\n },\n set: function (value) {\nthis._matrixDirty =\n this._matrixDirty || !Matrix4.equals(this._emitterModelMatrix, value);\n Matrix4.clone(value, this._emitterModelMatrix);\n },\n },\n /**\n * The color of the particle at the beginning of its life.\n * @memberof ParticleSystem.prototype\n * @type {Color}\n * @default Color.WHITE\n */\n startColor: {\n get: function () {\n return this._startColor;\n },\n set: function (value) {\nColor.clone(value, this._startColor);\n },\n },\n /**\n * The color of the particle at the end of its life.\n * @memberof ParticleSystem.prototype\n * @type {Color}\n * @default Color.WHITE\n */\n endColor: {\n get: function () {\n return this._endColor;\n },\n set: function (value) {\nColor.clone(value, this._endColor);\n },\n },\n /**\n * The initial scale to apply to the image of the particle at the beginning of its life.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n startScale: {\n get: function () {\n return this._startScale;\n },\n set: function (value) {\nthis._startScale = value;\n },\n },\n /**\n * The final scale to apply to the image of the particle at the end of its life.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n endScale: {\n get: function () {\n return this._endScale;\n },\n set: function (value) {\nthis._endScale = value;\n },\n },\n /**\n * The number of particles to emit per second.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 5\n */\n emissionRate: {\n get: function () {\n return this._emissionRate;\n },\n set: function (value) {\nthis._emissionRate = value;\n this._updateParticlePool = true;\n },\n },\n /**\n * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n minimumSpeed: {\n get: function () {\n return this._minimumSpeed;\n },\n set: function (value) {\nthis._minimumSpeed = value;\n },\n },\n /**\n * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n maximumSpeed: {\n get: function () {\n return this._maximumSpeed;\n },\n set: function (value) {\nthis._maximumSpeed = value;\n },\n },\n /**\n * Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 5.0\n */\n minimumParticleLife: {\n get: function () {\n return this._minimumParticleLife;\n },\n set: function (value) {\nthis._minimumParticleLife = value;\n },\n },\n /**\n * Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 5.0\n */\n maximumParticleLife: {\n get: function () {\n return this._maximumParticleLife;\n },\n set: function (value) {\nthis._maximumParticleLife = value;\n this._updateParticlePool = true;\n },\n },\n /**\n * Sets the minimum mass of particles in kilograms.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n minimumMass: {\n get: function () {\n return this._minimumMass;\n },\n set: function (value) {\nthis._minimumMass = value;\n },\n },\n /**\n * Sets the maximum mass of particles in kilograms.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default 1.0\n */\n maximumMass: {\n get: function () {\n return this._maximumMass;\n },\n set: function (value) {\nthis._maximumMass = value;\n },\n },\n /**\n * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.\n * @memberof ParticleSystem.prototype\n * @type {Cartesian2}\n * @default new Cartesian2(1.0, 1.0)\n */\n minimumImageSize: {\n get: function () {\n return this._minimumImageSize;\n },\n set: function (value) {\nthis._minimumImageSize = value;\n },\n },\n /**\n * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.\n * @memberof ParticleSystem.prototype\n * @type {Cartesian2}\n * @default new Cartesian2(1.0, 1.0)\n */\n maximumImageSize: {\n get: function () {\n return this._maximumImageSize;\n },\n set: function (value) {\nthis._maximumImageSize = value;\n },\n },\n /**\n * Gets or sets if the particle size is in meters or pixels. <code>true</code> to size particles in meters; otherwise, the size is in pixels.\n * @memberof ParticleSystem.prototype\n * @type {Boolean}\n * @default false\n */\n sizeInMeters: {\n get: function () {\n return this._sizeInMeters;\n },\n set: function (value) {\nthis._sizeInMeters = value;\n },\n },\n /**\n * How long the particle system will emit particles, in seconds.\n * @memberof ParticleSystem.prototype\n * @type {Number}\n * @default Number.MAX_VALUE\n */\n lifetime: {\n get: function () {\n return this._lifetime;\n },\n set: function (value) {\nthis._lifetime = value;\n },\n },\n /**\n * Fires an event when the particle system has reached the end of its lifetime.\n * @memberof ParticleSystem.prototype\n * @type {Event}\n */\n complete: {\n get: function () {\n return this._complete;\n },\n },\n /**\n * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.\n * @memberof ParticleSystem.prototype\n * @type {Boolean}\n */\n isComplete: {\n get: function () {\n return this._isComplete;\n },\n },\n});\n\nfunction updateParticlePool(system) {\n const emissionRate = system._emissionRate;\n const life = system._maximumParticleLife;\n\n let burstAmount = 0;\n const bursts = system._bursts;\n if (defined(bursts)) {\n const length = bursts.length;\n for (let i = 0; i < length; ++i) {\n burstAmount += bursts[i].maximum;\n }\n }\n\n const billboardCollection = system._billboardCollection;\n const image = system.image;\n\n const particleEstimate = Math.ceil(emissionRate * life + burstAmount);\n const particles = system._particles;\n const particlePool = system._particlePool;\n const numToAdd = Math.max(\n particleEstimate - particles.length - particlePool.length,\n 0\n );\n\n for (let j = 0; j < numToAdd; ++j) {\n const particle = new Particle();\n particle._billboard = billboardCollection.add({\n image: image,\n });\n particlePool.push(particle);\n }\n\n system._particleEstimate = particleEstimate;\n}\n\nfunction getOrCreateParticle(system) {\n // Try to reuse an existing particle from the pool.\n let particle = system._particlePool.pop();\n if (!defined(particle)) {\n // Create a new one\n particle = new Particle();\n }\n return particle;\n}\n\nfunction addParticleToPool(system, particle) {\n system._particlePool.push(particle);\n}\n\nfunction freeParticlePool(system) {\n const particles = system._particles;\n const particlePool = system._particlePool;\n const billboardCollection = system._billboardCollection;\n\n const numParticles = particles.length;\n const numInPool = particlePool.length;\n const estimate = system._particleEstimate;\n\n const start = numInPool - Math.max(estimate - numParticles - numInPool, 0);\n for (let i = start; i < numInPool; ++i) {\n const p = particlePool[i];\n billboardCollection.remove(p._billboard);\n }\n particlePool.length = start;\n}\n\nfunction removeBillboard(particle) {\n if (defined(particle._billboard)) {\n particle._billboard.show = false;\n }\n}\n\nfunction updateBillboard(system, particle) {\n let billboard = particle._billboard;\n if (!defined(billboard)) {\n billboard = particle._billboard = system._billboardCollection.add({\n image: particle.image,\n });\n }\n billboard.width = particle.imageSize.x;\n billboard.height = particle.imageSize.y;\n billboard.position = particle.position;\n billboard.sizeInMeters = system.sizeInMeters;\n billboard.show = true;\n\n // Update the color\n const r = CesiumMath.lerp(\n particle.startColor.red,\n particle.endColor.red,\n particle.normalizedAge\n );\n const g = CesiumMath.lerp(\n particle.startColor.green,\n particle.endColor.green,\n particle.normalizedAge\n );\n const b = CesiumMath.lerp(\n particle.startColor.blue,\n particle.endColor.blue,\n particle.normalizedAge\n );\n const a = CesiumMath.lerp(\n particle.startColor.alpha,\n particle.endColor.alpha,\n particle.normalizedAge\n );\n billboard.color = new Color(r, g, b, a);\n\n // Update the scale\n billboard.scale = CesiumMath.lerp(\n particle.startScale,\n particle.endScale,\n particle.normalizedAge\n );\n}\n\nfunction addParticle(system, particle) {\n particle.startColor = Color.clone(system._startColor, particle.startColor);\n particle.endColor = Color.clone(system._endColor, particle.endColor);\n particle.startScale = system._startScale;\n particle.endScale = system._endScale;\n particle.image = system.image;\n particle.life = CesiumMath.randomBetween(\n system._minimumParticleLife,\n system._maximumParticleLife\n );\n particle.mass = CesiumMath.randomBetween(\n system._minimumMass,\n system._maximumMass\n );\n particle.imageSize.x = CesiumMath.randomBetween(\n system._minimumImageSize.x,\n system._maximumImageSize.x\n );\n particle.imageSize.y = CesiumMath.randomBetween(\n system._minimumImageSize.y,\n system._maximumImageSize.y\n );\n\n // Reset the normalizedAge and age in case the particle was reused.\n particle._normalizedAge = 0.0;\n particle._age = 0.0;\n\n const speed = CesiumMath.randomBetween(\n system._minimumSpeed,\n system._maximumSpeed\n );\n Cartesian3.multiplyByScalar(particle.velocity, speed, particle.velocity);\n\n system._particles.push(particle);\n}\n\nfunction calculateNumberToEmit(system, dt) {\n // This emitter is finished if it exceeds it's lifetime.\n if (system._isComplete) {\n return 0;\n }\n\n dt = CesiumMath.mod(dt, system._lifetime);\n\n // Compute the number of particles to emit based on the emissionRate.\n const v = dt * system._emissionRate;\n let numToEmit = Math.floor(v);\n system._carryOver += v - numToEmit;\n if (system._carryOver > 1.0) {\n numToEmit++;\n system._carryOver -= 1.0;\n }\n\n // Apply any bursts\n if (defined(system.bursts)) {\n const length = system.bursts.length;\n for (let i = 0; i < length; i++) {\n const burst = system.bursts[i];\n const currentTime = system._currentTime;\n if (defined(burst) && !burst._complete && currentTime > burst.time) {\n numToEmit += CesiumMath.randomBetween(burst.minimum, burst.maximum);\n burst._complete = true;\n }\n }\n }\n\n return numToEmit;\n}\n\nconst rotatedVelocityScratch = new Cartesian3();\n\n/**\n * @private\n */\nParticleSystem.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n if (!defined(this._billboardCollection)) {\n this._billboardCollection = new BillboardCollection();\n }\n\n if (this._updateParticlePool) {\n updateParticlePool(this);\n this._updateParticlePool = false;\n }\n\n // Compute the frame time\n let dt = 0.0;\n if (this._previousTime) {\n dt = JulianDate.secondsDifference(frameState.time, this._previousTime);\n }\n\n if (dt < 0.0) {\n dt = 0.0;\n }\n\n const particles = this._particles;\n const emitter = this._emitter;\n const updateCallback = this.updateCallback;\n\n let i;\n let particle;\n\n // update particles and remove dead particles\n let length = particles.length;\n for (i = 0; i < length; ++i) {\n particle = particles[i];\n if (!particle.update(dt, updateCallback)) {\n removeBillboard(particle);\n // Add the particle back to the pool so it can be reused.\n addParticleToPool(this, particle);\n particles[i] = particles[length - 1];\n --i;\n --length;\n } else {\n updateBillboard(this, particle);\n }\n }\n particles.length = length;\n\n const numToEmit = calculateNumberToEmit(this, dt);\n\n if (numToEmit > 0 && defined(emitter)) {\n // Compute the final model matrix by combining the particle systems model matrix and the emitter matrix.\n if (this._matrixDirty) {\n this._combinedMatrix = Matrix4.multiply(\n this.modelMatrix,\n this.emitterModelMatrix,\n this._combinedMatrix\n );\n this._matrixDirty = false;\n }\n\n const combinedMatrix = this._combinedMatrix;\n\n for (i = 0; i < numToEmit; i++) {\n // Create a new particle.\n particle = getOrCreateParticle(this);\n\n // Let the emitter initialize the particle.\n this._emitter.emit(particle);\n\n //For the velocity we need to add it to the original position and then multiply by point.\n Cartesian3.add(\n particle.position,\n particle.velocity,\n rotatedVelocityScratch\n );\n Matrix4.multiplyByPoint(\n combinedMatrix,\n rotatedVelocityScratch,\n rotatedVelocityScratch\n );\n\n // Change the position to be in world coordinates\n particle.position = Matrix4.multiplyByPoint(\n combinedMatrix,\n particle.position,\n particle.position\n );\n\n // Orient the velocity in world space as well.\n Cartesian3.subtract(\n rotatedVelocityScratch,\n particle.position,\n particle.velocity\n );\n Cartesian3.normalize(particle.velocity, particle.velocity);\n\n // Add the particle to the system.\n addParticle(this, particle);\n updateBillboard(this, particle);\n }\n }\n\n this._billboardCollection.update(frameState);\n this._previousTime = JulianDate.clone(frameState.time, this._previousTime);\n this._currentTime += dt;\n\n if (\n this._lifetime !== Number.MAX_VALUE &&\n this._currentTime > this._lifetime\n ) {\n if (this.loop) {\n this._currentTime = CesiumMath.mod(this._currentTime, this._lifetime);\n if (this.bursts) {\n const burstLength = this.bursts.length;\n // Reset any bursts\n for (i = 0; i < burstLength; i++) {\n this.bursts[i]._complete = false;\n }\n }\n } else {\n this._isComplete = true;\n this._complete.raiseEvent(this);\n }\n }\n\n // free particles in the pool and release billboard GPU memory\n if (frameState.frameNumber % 120 === 0) {\n freeParticlePool(this);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ParticleSystem#destroy\n */\nParticleSystem.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see ParticleSystem#isDestroyed\n */\nParticleSystem.prototype.destroy = function () {\n this._billboardCollection =\n this._billboardCollection && this._billboardCollection.destroy();\n return destroyObject(this);\n};\n\n/**\n * A function used to modify attributes of the particle at each time step. This can include force modifications,\n * color, sizing, etc.\n *\n * @callback ParticleSystem.updateCallback\n *\n * @param {Particle} particle The particle being updated.\n * @param {Number} dt The time in seconds since the last update.\n *\n * @example\n * function applyGravity(particle, dt) {\n * const position = particle.position;\n * const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());\n * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);\n * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);\n * }\n */\nexport default ParticleSystem;\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport getElement from \"../Widgets/getElement.js\";\n\n/**\n * @private\n */\nfunction PerformanceDisplay(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const container = getElement(options.container);\n this._container = container;\n\n const display = document.createElement(\"div\");\n display.className = \"cesium-performanceDisplay\";\n const fpsElement = document.createElement(\"div\");\n fpsElement.className = \"cesium-performanceDisplay-fps\";\n this._fpsText = document.createTextNode(\"\");\n fpsElement.appendChild(this._fpsText);\n const msElement = document.createElement(\"div\");\n msElement.className = \"cesium-performanceDisplay-ms\";\n this._msText = document.createTextNode(\"\");\n msElement.appendChild(this._msText);\n display.appendChild(msElement);\n display.appendChild(fpsElement);\n this._container.appendChild(display);\n\n this._lastFpsSampleTime = getTimestamp();\n this._lastMsSampleTime = getTimestamp();\n this._fpsFrameCount = 0;\n this._msFrameCount = 0;\n\n this._throttled = false;\n const throttledElement = document.createElement(\"div\");\n throttledElement.className = \"cesium-performanceDisplay-throttled\";\n this._throttledText = document.createTextNode(\"\");\n throttledElement.appendChild(this._throttledText);\n display.appendChild(throttledElement);\n}\n\nObject.defineProperties(PerformanceDisplay.prototype, {\n /**\n * The display should indicate the FPS is being throttled.\n * @memberof PerformanceDisplay.prototype\n *\n * @type {Boolean}\n */\n throttled: {\n get: function () {\n return this._throttled;\n },\n set: function (value) {\n if (this._throttled === value) {\n return;\n }\n\n if (value) {\n this._throttledText.nodeValue = \"(throttled)\";\n } else {\n this._throttledText.nodeValue = \"\";\n }\n\n this._throttled = value;\n },\n },\n});\n\n/**\n * Update the display. This function should only be called once per frame, because\n * each call records a frame in the internal buffer and redraws the display.\n *\n * @param {Boolean} [renderedThisFrame=true] If provided, the FPS count will only update and display if true.\n */\nPerformanceDisplay.prototype.update = function (renderedThisFrame) {\n const time = getTimestamp();\n const updateDisplay = defaultValue(renderedThisFrame, true);\n\n this._fpsFrameCount++;\n const fpsElapsedTime = time - this._lastFpsSampleTime;\n if (fpsElapsedTime > 1000) {\n let fps = \"N/A\";\n if (updateDisplay) {\n fps = ((this._fpsFrameCount * 1000) / fpsElapsedTime) | 0;\n }\n\n this._fpsText.nodeValue = `${fps} FPS`;\n this._lastFpsSampleTime = time;\n this._fpsFrameCount = 0;\n }\n\n this._msFrameCount++;\n const msElapsedTime = time - this._lastMsSampleTime;\n if (msElapsedTime > 200) {\n let ms = \"N/A\";\n if (updateDisplay) {\n ms = (msElapsedTime / this._msFrameCount).toFixed(2);\n }\n\n this._msText.nodeValue = `${ms} MS`;\n this._lastMsSampleTime = time;\n this._msFrameCount = 0;\n }\n};\n\n/**\n * Destroys the WebGL resources held by this object.\n */\nPerformanceDisplay.prototype.destroy = function () {\n return destroyObject(this);\n};\nexport default PerformanceDisplay;\n", "import Cartesian4 from \"../Core/Cartesian4.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\n\n/**\n * @private\n */\nfunction PickDepth() {\n this._framebuffer = new FramebufferManager();\n\n this._textureToCopy = undefined;\n this._copyDepthCommand = undefined;\n}\n\nObject.defineProperties(PickDepth.prototype, {\n framebuffer: {\n get: function () {\n return this._framebuffer.framebuffer;\n },\n },\n});\n\nfunction updateFramebuffers(pickDepth, context, depthTexture) {\n const width = depthTexture.width;\n const height = depthTexture.height;\n pickDepth._framebuffer.update(context, width, height);\n}\n\nfunction updateCopyCommands(pickDepth, context, depthTexture) {\n if (!defined(pickDepth._copyDepthCommand)) {\n const fs =\n \"uniform highp sampler2D u_texture;\\n\" +\n \"varying vec2 v_textureCoordinates;\\n\" +\n \"void main()\\n\" +\n \"{\\n\" +\n \" gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\\n\" +\n \"}\\n\";\n pickDepth._copyDepthCommand = context.createViewportQuadCommand(fs, {\n renderState: RenderState.fromCache(),\n uniformMap: {\n u_texture: function () {\n return pickDepth._textureToCopy;\n },\n },\n owner: pickDepth,\n });\n }\n\n pickDepth._textureToCopy = depthTexture;\n pickDepth._copyDepthCommand.framebuffer = pickDepth.framebuffer;\n}\n\nPickDepth.prototype.update = function (context, depthTexture) {\n updateFramebuffers(this, context, depthTexture);\n updateCopyCommands(this, context, depthTexture);\n};\n\nconst scratchPackedDepth = new Cartesian4();\nconst packedDepthScale = new Cartesian4(\n 1.0,\n 1.0 / 255.0,\n 1.0 / 65025.0,\n 1.0 / 16581375.0\n);\n\nPickDepth.prototype.getDepth = function (context, x, y) {\n // If this function is called before the framebuffer is created, the depth is undefined.\n if (!defined(this.framebuffer)) {\n return undefined;\n }\n\n const pixels = context.readPixels({\n x: x,\n y: y,\n width: 1,\n height: 1,\n framebuffer: this.framebuffer,\n });\n\n const packedDepth = Cartesian4.unpack(pixels, 0, scratchPackedDepth);\n Cartesian4.divideByScalar(packedDepth, 255.0, packedDepth);\n return Cartesian4.dot(packedDepth, packedDepthScale);\n};\n\nPickDepth.prototype.executeCopyDepth = function (context, passState) {\n this._copyDepthCommand.execute(context, passState);\n};\n\nPickDepth.prototype.isDestroyed = function () {\n return false;\n};\n\nPickDepth.prototype.destroy = function () {\n this._framebuffer.destroy();\n if (defined(this._copyDepthCommand)) {\n this._copyDepthCommand.shaderProgram =\n defined(this._copyDepthCommand.shaderProgram) &&\n this._copyDepthCommand.shaderProgram.destroy();\n }\n\n return destroyObject(this);\n};\nexport default PickDepth;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PassState from \"../Renderer/PassState.js\";\n\n/**\n * @private\n */\nfunction PickDepthFramebuffer() {\n this._framebuffer = new FramebufferManager({\n color: false,\n depthStencil: true,\n supportsDepthTexture: true,\n });\n this._passState = undefined;\n}\n\nObject.defineProperties(PickDepthFramebuffer.prototype, {\n framebuffer: {\n get: function () {\n return this._framebuffer.framebuffer;\n },\n },\n});\n\nfunction destroyResources(pickDepth) {\n pickDepth._framebuffer.destroy();\n}\n\nfunction createResources(pickDepth, context) {\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n\n pickDepth._framebuffer.update(context, width, height);\n\n const passState = new PassState(context);\n passState.blendingEnabled = false;\n passState.scissorTest = {\n enabled: true,\n rectangle: new BoundingRectangle(),\n };\n passState.viewport = new BoundingRectangle();\n pickDepth._passState = passState;\n}\n\nPickDepthFramebuffer.prototype.update = function (\n context,\n drawingBufferPosition,\n viewport\n) {\n const width = viewport.width;\n const height = viewport.height;\n\n if (this._framebuffer.isDirty(width, height)) {\n createResources(this, context);\n }\n\n const framebuffer = this.framebuffer;\n const passState = this._passState;\n passState.framebuffer = framebuffer;\n passState.viewport.width = width;\n passState.viewport.height = height;\n passState.scissorTest.rectangle.x = drawingBufferPosition.x;\n passState.scissorTest.rectangle.y = height - drawingBufferPosition.y;\n passState.scissorTest.rectangle.width = 1;\n passState.scissorTest.rectangle.height = 1;\n\n return passState;\n};\n\nPickDepthFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nPickDepthFramebuffer.prototype.destroy = function () {\n destroyResources(this);\n return destroyObject(this);\n};\nexport default PickDepthFramebuffer;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PassState from \"../Renderer/PassState.js\";\n\n/**\n * @private\n */\nfunction PickFramebuffer(context) {\n // Override per-command states\n const passState = new PassState(context);\n passState.blendingEnabled = false;\n passState.scissorTest = {\n enabled: true,\n rectangle: new BoundingRectangle(),\n };\n passState.viewport = new BoundingRectangle();\n\n this._context = context;\n this._fb = new FramebufferManager({\n depthStencil: true,\n });\n this._passState = passState;\n this._width = 0;\n this._height = 0;\n}\nPickFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {\n const context = this._context;\n const width = viewport.width;\n const height = viewport.height;\n\n BoundingRectangle.clone(\n screenSpaceRectangle,\n this._passState.scissorTest.rectangle\n );\n\n // Create or recreate renderbuffers and framebuffer used for picking\n this._width = width;\n this._height = height;\n this._fb.update(context, width, height);\n this._passState.framebuffer = this._fb.framebuffer;\n\n this._passState.viewport.width = width;\n this._passState.viewport.height = height;\n\n return this._passState;\n};\n\nconst colorScratch = new Color();\n\nPickFramebuffer.prototype.end = function (screenSpaceRectangle) {\n const width = defaultValue(screenSpaceRectangle.width, 1.0);\n const height = defaultValue(screenSpaceRectangle.height, 1.0);\n\n const context = this._context;\n const pixels = context.readPixels({\n x: screenSpaceRectangle.x,\n y: screenSpaceRectangle.y,\n width: width,\n height: height,\n framebuffer: this._fb.framebuffer,\n });\n\n const max = Math.max(width, height);\n const length = max * max;\n const halfWidth = Math.floor(width * 0.5);\n const halfHeight = Math.floor(height * 0.5);\n\n let x = 0;\n let y = 0;\n let dx = 0;\n let dy = -1;\n\n // Spiral around the center pixel, this is a workaround until\n // we can access the depth buffer on all browsers.\n\n // The region does not have to square and the dimensions do not have to be odd, but\n // loop iterations would be wasted. Prefer square regions where the size is odd.\n for (let i = 0; i < length; ++i) {\n if (\n -halfWidth <= x &&\n x <= halfWidth &&\n -halfHeight <= y &&\n y <= halfHeight\n ) {\n const index = 4 * ((halfHeight - y) * width + x + halfWidth);\n\n colorScratch.red = Color.byteToFloat(pixels[index]);\n colorScratch.green = Color.byteToFloat(pixels[index + 1]);\n colorScratch.blue = Color.byteToFloat(pixels[index + 2]);\n colorScratch.alpha = Color.byteToFloat(pixels[index + 3]);\n\n const object = context.getObjectByPickColor(colorScratch);\n if (defined(object)) {\n return object;\n }\n }\n\n // if (top right || bottom left corners) || (top left corner) || (bottom right corner + (1, 0))\n // change spiral direction\n if (x === y || (x < 0 && -x === y) || (x > 0 && x === 1 - y)) {\n const temp = dx;\n dx = -dy;\n dy = temp;\n }\n\n x += dx;\n y += dy;\n }\n\n return undefined;\n};\n\nPickFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nPickFramebuffer.prototype.destroy = function () {\n this._fb.destroy();\n return destroyObject(this);\n};\nexport default PickFramebuffer;\n", "import Color from \"../Core/Color.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\n\n/**\n * @private\n */\nfunction SceneFramebuffer() {\n this._numSamples = 1;\n this._colorFramebuffer = new FramebufferManager({\n depthStencil: true,\n supportsDepthTexture: true,\n });\n this._idFramebuffer = new FramebufferManager({\n depthStencil: true,\n supportsDepthTexture: true,\n });\n\n this._idClearColor = new Color(0.0, 0.0, 0.0, 0.0);\n\n this._clearCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n depth: 1.0,\n owner: this,\n });\n}\n\nfunction destroyResources(post) {\n post._colorFramebuffer.destroy();\n post._idFramebuffer.destroy();\n}\n\nObject.defineProperties(SceneFramebuffer.prototype, {\n framebuffer: {\n get: function () {\n return this._colorFramebuffer.framebuffer;\n },\n },\n idFramebuffer: {\n get: function () {\n return this._idFramebuffer.framebuffer;\n },\n },\n depthStencilTexture: {\n get: function () {\n return this._colorFramebuffer.getDepthStencilTexture();\n },\n },\n});\n\nSceneFramebuffer.prototype.update = function (\n context,\n viewport,\n hdr,\n numSamples\n) {\n const width = viewport.width;\n const height = viewport.height;\n const pixelDatatype = hdr\n ? context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT\n : PixelDatatype.UNSIGNED_BYTE;\n this._numSamples = numSamples;\n this._colorFramebuffer.update(\n context,\n width,\n height,\n numSamples,\n pixelDatatype\n );\n this._idFramebuffer.update(context, width, height);\n};\n\nSceneFramebuffer.prototype.clear = function (context, passState, clearColor) {\n Color.clone(clearColor, this._clearCommand.color);\n Color.clone(this._idClearColor, this._clearCommand.color);\n this._colorFramebuffer.clear(context, this._clearCommand, passState);\n this._idFramebuffer.clear(context, this._clearCommand, passState);\n};\n\nSceneFramebuffer.prototype.getFramebuffer = function () {\n return this._colorFramebuffer.framebuffer;\n};\n\nSceneFramebuffer.prototype.getIdFramebuffer = function () {\n return this._idFramebuffer.framebuffer;\n};\n\nSceneFramebuffer.prototype.prepareColorTextures = function (context) {\n if (this._numSamples > 1) {\n this._colorFramebuffer.prepareTextures(context);\n }\n};\n\nSceneFramebuffer.prototype.isDestroyed = function () {\n return false;\n};\n\nSceneFramebuffer.prototype.destroy = function () {\n destroyResources(this);\n return destroyObject(this);\n};\nexport default SceneFramebuffer;\n", "import defined from \"../Core/defined.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * @private\n */\nfunction ShadowMapShader() {}\n\nShadowMapShader.getShadowCastShaderKeyword = function (\n isPointLight,\n isTerrain,\n usesDepthTexture,\n isOpaque\n) {\n return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`;\n};\n\nShadowMapShader.createShadowCastVertexShader = function (\n vs,\n isPointLight,\n isTerrain\n) {\n const defines = vs.defines.slice(0);\n const sources = vs.sources.slice(0);\n\n defines.push(\"SHADOW_MAP\");\n\n if (isTerrain) {\n defines.push(\"GENERATE_POSITION\");\n }\n\n const positionVaryingName = ShaderSource.findPositionVarying(vs);\n const hasPositionVarying = defined(positionVaryingName);\n\n if (isPointLight && !hasPositionVarying) {\n const length = sources.length;\n for (let j = 0; j < length; ++j) {\n sources[j] = ShaderSource.replaceMain(sources[j], \"czm_shadow_cast_main\");\n }\n\n const shadowVS =\n \"varying vec3 v_positionEC; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_shadow_cast_main(); \\n\" +\n \" v_positionEC = (czm_inverseProjection * gl_Position).xyz; \\n\" +\n \"}\";\n sources.push(shadowVS);\n }\n\n return new ShaderSource({\n defines: defines,\n sources: sources,\n });\n};\n\nShadowMapShader.createShadowCastFragmentShader = function (\n fs,\n isPointLight,\n usesDepthTexture,\n opaque\n) {\n const defines = fs.defines.slice(0);\n const sources = fs.sources.slice(0);\n\n defines.push(\"SHADOW_MAP\");\n\n let positionVaryingName = ShaderSource.findPositionVarying(fs);\n const hasPositionVarying = defined(positionVaryingName);\n if (!hasPositionVarying) {\n positionVaryingName = \"v_positionEC\";\n }\n\n const length = sources.length;\n for (let i = 0; i < length; ++i) {\n sources[i] = ShaderSource.replaceMain(sources[i], \"czm_shadow_cast_main\");\n }\n\n let fsSource = \"\";\n\n if (isPointLight) {\n if (!hasPositionVarying) {\n fsSource += \"varying vec3 v_positionEC; \\n\";\n }\n fsSource += \"uniform vec4 shadowMap_lightPositionEC; \\n\";\n }\n\n if (opaque) {\n fsSource += \"void main() \\n\" + \"{ \\n\";\n } else {\n fsSource +=\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_shadow_cast_main(); \\n\" +\n \" if (gl_FragColor.a == 0.0) \\n\" +\n \" { \\n\" +\n \" discard; \\n\" +\n \" } \\n\";\n }\n\n if (isPointLight) {\n fsSource +=\n ` float distance = length(${positionVaryingName}); \\n` +\n ` if (distance >= shadowMap_lightPositionEC.w) \\n` +\n ` { \\n` +\n ` discard; \\n` +\n ` } \\n` +\n ` distance /= shadowMap_lightPositionEC.w; // radius \\n` +\n ` gl_FragColor = czm_packDepth(distance); \\n`;\n } else if (usesDepthTexture) {\n fsSource += \" gl_FragColor = vec4(1.0); \\n\";\n } else {\n fsSource += \" gl_FragColor = czm_packDepth(gl_FragCoord.z); \\n\";\n }\n\n fsSource += \"} \\n\";\n\n sources.push(fsSource);\n\n return new ShaderSource({\n defines: defines,\n sources: sources,\n });\n};\n\nShadowMapShader.getShadowReceiveShaderKeyword = function (\n shadowMap,\n castShadows,\n isTerrain,\n hasTerrainNormal\n) {\n const usesDepthTexture = shadowMap._usesDepthTexture;\n const polygonOffsetSupported = shadowMap._polygonOffsetSupported;\n const isPointLight = shadowMap._isPointLight;\n const isSpotLight = shadowMap._isSpotLight;\n const hasCascades = shadowMap._numberOfCascades > 1;\n const debugCascadeColors = shadowMap.debugCascadeColors;\n const softShadows = shadowMap.softShadows;\n\n return `receiveShadow ${usesDepthTexture}${polygonOffsetSupported}${isPointLight}${isSpotLight}${hasCascades}${debugCascadeColors}${softShadows}${castShadows}${isTerrain}${hasTerrainNormal}`;\n};\n\nShadowMapShader.createShadowReceiveVertexShader = function (\n vs,\n isTerrain,\n hasTerrainNormal\n) {\n const defines = vs.defines.slice(0);\n const sources = vs.sources.slice(0);\n\n defines.push(\"SHADOW_MAP\");\n\n if (isTerrain) {\n if (hasTerrainNormal) {\n defines.push(\"GENERATE_POSITION_AND_NORMAL\");\n } else {\n defines.push(\"GENERATE_POSITION\");\n }\n }\n\n return new ShaderSource({\n defines: defines,\n sources: sources,\n });\n};\n\nShadowMapShader.createShadowReceiveFragmentShader = function (\n fs,\n shadowMap,\n castShadows,\n isTerrain,\n hasTerrainNormal\n) {\n const normalVaryingName = ShaderSource.findNormalVarying(fs);\n const hasNormalVarying =\n (!isTerrain && defined(normalVaryingName)) ||\n (isTerrain && hasTerrainNormal);\n\n const positionVaryingName = ShaderSource.findPositionVarying(fs);\n const hasPositionVarying = defined(positionVaryingName);\n\n const usesDepthTexture = shadowMap._usesDepthTexture;\n const polygonOffsetSupported = shadowMap._polygonOffsetSupported;\n const isPointLight = shadowMap._isPointLight;\n const isSpotLight = shadowMap._isSpotLight;\n const hasCascades = shadowMap._numberOfCascades > 1;\n const debugCascadeColors = shadowMap.debugCascadeColors;\n const softShadows = shadowMap.softShadows;\n const bias = isPointLight\n ? shadowMap._pointBias\n : isTerrain\n ? shadowMap._terrainBias\n : shadowMap._primitiveBias;\n\n const defines = fs.defines.slice(0);\n const sources = fs.sources.slice(0);\n\n const length = sources.length;\n for (let i = 0; i < length; ++i) {\n sources[i] = ShaderSource.replaceMain(\n sources[i],\n \"czm_shadow_receive_main\"\n );\n }\n\n if (isPointLight) {\n defines.push(\"USE_CUBE_MAP_SHADOW\");\n } else if (usesDepthTexture) {\n defines.push(\"USE_SHADOW_DEPTH_TEXTURE\");\n }\n\n if (softShadows && !isPointLight) {\n defines.push(\"USE_SOFT_SHADOWS\");\n }\n\n // Enable day-night shading so that the globe is dark when the light is below the horizon\n if (hasCascades && castShadows && isTerrain) {\n if (hasNormalVarying) {\n defines.push(\"ENABLE_VERTEX_LIGHTING\");\n } else {\n defines.push(\"ENABLE_DAYNIGHT_SHADING\");\n }\n }\n\n if (castShadows && bias.normalShading && hasNormalVarying) {\n defines.push(\"USE_NORMAL_SHADING\");\n if (bias.normalShadingSmooth > 0.0) {\n defines.push(\"USE_NORMAL_SHADING_SMOOTH\");\n }\n }\n\n let fsSource = \"\";\n\n if (isPointLight) {\n fsSource += \"uniform samplerCube shadowMap_textureCube; \\n\";\n } else {\n fsSource += \"uniform sampler2D shadowMap_texture; \\n\";\n }\n\n let returnPositionEC;\n if (hasPositionVarying) {\n returnPositionEC = ` return vec4(${positionVaryingName}, 1.0); \\n`;\n } else {\n returnPositionEC =\n \"#ifndef LOG_DEPTH \\n\" +\n \" return czm_windowToEyeCoordinates(gl_FragCoord); \\n\" +\n \"#else \\n\" +\n \" return vec4(v_logPositionEC, 1.0); \\n\" +\n \"#endif \\n\";\n }\n\n fsSource +=\n `${\n \"uniform mat4 shadowMap_matrix; \\n\" +\n \"uniform vec3 shadowMap_lightDirectionEC; \\n\" +\n \"uniform vec4 shadowMap_lightPositionEC; \\n\" +\n \"uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \\n\" +\n \"uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \\n\" +\n \"#ifdef LOG_DEPTH \\n\" +\n \"varying vec3 v_logPositionEC; \\n\" +\n \"#endif \\n\" +\n \"vec4 getPositionEC() \\n\" +\n \"{ \\n\"\n }${returnPositionEC}} \\n` +\n `vec3 getNormalEC() \\n` +\n `{ \\n${\n hasNormalVarying\n ? ` return normalize(${normalVaryingName}); \\n`\n : \" return vec3(1.0); \\n\"\n }} \\n` +\n // Offset the shadow position in the direction of the normal for perpendicular and back faces\n `void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \\n` +\n `{ \\n${\n bias.normalOffset && hasNormalVarying\n ? \" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \\n\" +\n \" float normalOffsetScale = 1.0 - nDotL; \\n\" +\n \" vec3 offset = normalOffset * normalOffsetScale * normalEC; \\n\" +\n \" positionEC.xyz += offset; \\n\"\n : \"\"\n }} \\n`;\n\n fsSource +=\n \"void main() \\n\" +\n \"{ \\n\" +\n \" czm_shadow_receive_main(); \\n\" +\n \" vec4 positionEC = getPositionEC(); \\n\" +\n \" vec3 normalEC = getNormalEC(); \\n\" +\n \" float depth = -positionEC.z; \\n\";\n\n fsSource +=\n \" czm_shadowParameters shadowParameters; \\n\" +\n \" shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \\n\" +\n \" shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \\n\" +\n \" shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \\n\" +\n \" shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \\n\";\n\n if (isTerrain) {\n // Scale depth bias based on view distance to reduce z-fighting in distant terrain\n fsSource += \" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \\n\";\n } else if (!polygonOffsetSupported) {\n // If polygon offset isn't supported push the depth back based on view, however this\n // causes light leaking at further away views\n fsSource +=\n \" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \\n\";\n }\n\n if (isPointLight) {\n fsSource +=\n \" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \\n\" +\n \" float distance = length(directionEC); \\n\" +\n \" directionEC = normalize(directionEC); \\n\" +\n \" float radius = shadowMap_lightPositionEC.w; \\n\" +\n \" // Stop early if the fragment is beyond the point light radius \\n\" +\n \" if (distance > radius) \\n\" +\n \" { \\n\" +\n \" return; \\n\" +\n \" } \\n\" +\n \" vec3 directionWC = czm_inverseViewRotation * directionEC; \\n\" +\n \" shadowParameters.depth = distance / radius; \\n\" +\n \" shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \\n\" +\n \" shadowParameters.texCoords = directionWC; \\n\" +\n \" float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \\n\";\n } else if (isSpotLight) {\n fsSource +=\n \" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \\n\" +\n \" float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \\n\" +\n \" applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n \" vec4 shadowPosition = shadowMap_matrix * positionEC; \\n\" +\n \" // Spot light uses a perspective projection, so perform the perspective divide \\n\" +\n \" shadowPosition /= shadowPosition.w; \\n\" +\n \" // Stop early if the fragment is not in the shadow bounds \\n\" +\n \" if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \\n\" +\n \" { \\n\" +\n \" return; \\n\" +\n \" } \\n\" +\n \" shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n \" shadowParameters.depth = shadowPosition.z; \\n\" +\n \" shadowParameters.nDotL = nDotL; \\n\" +\n \" float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\";\n } else if (hasCascades) {\n fsSource += `${\n \" float maxDepth = shadowMap_cascadeSplits[1].w; \\n\" +\n \" // Stop early if the eye depth exceeds the last cascade \\n\" +\n \" if (depth > maxDepth) \\n\" +\n \" { \\n\" +\n \" return; \\n\" +\n \" } \\n\" +\n \" // Get the cascade based on the eye-space depth \\n\" +\n \" vec4 weights = czm_cascadeWeights(depth); \\n\" +\n \" // Apply normal offset \\n\" +\n \" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \\n\" +\n \" applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n \" // Transform position into the cascade \\n\" +\n \" vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \\n\" +\n \" // Get visibility \\n\" +\n \" shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n \" shadowParameters.depth = shadowPosition.z; \\n\" +\n \" shadowParameters.nDotL = nDotL; \\n\" +\n \" float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\" +\n \" // Fade out shadows that are far away \\n\" +\n \" float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \\n\" +\n \" float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \\n\" +\n \" visibility = mix(visibility, 1.0, fade); \\n\"\n }${\n debugCascadeColors\n ? \" // Draw cascade colors for debugging \\n\" +\n \" gl_FragColor *= czm_cascadeColor(weights); \\n\"\n : \"\"\n }`;\n } else {\n fsSource +=\n \" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \\n\" +\n \" applyNormalOffset(positionEC, normalEC, nDotL); \\n\" +\n \" vec4 shadowPosition = shadowMap_matrix * positionEC; \\n\" +\n \" // Stop early if the fragment is not in the shadow bounds \\n\" +\n \" if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \\n\" +\n \" { \\n\" +\n \" return; \\n\" +\n \" } \\n\" +\n \" shadowParameters.texCoords = shadowPosition.xy; \\n\" +\n \" shadowParameters.depth = shadowPosition.z; \\n\" +\n \" shadowParameters.nDotL = nDotL; \\n\" +\n \" float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \\n\";\n }\n\n fsSource += \" gl_FragColor.rgb *= visibility; \\n\" + \"} \\n\";\n\n sources.push(fsSource);\n\n return new ShaderSource({\n defines: defines,\n sources: sources,\n });\n};\nexport default ShadowMapShader;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport combine from \"../Core/combine.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport FeatureDetection from \"../Core/FeatureDetection.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\nimport WebGLConstants from \"../Core/WebGLConstants.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Framebuffer from \"../Renderer/Framebuffer.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Renderbuffer from \"../Renderer/Renderbuffer.js\";\nimport RenderbufferFormat from \"../Renderer/RenderbufferFormat.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport Camera from \"./Camera.js\";\nimport CullFace from \"./CullFace.js\";\nimport DebugCameraPrimitive from \"./DebugCameraPrimitive.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Primitive from \"./Primitive.js\";\nimport ShadowMapShader from \"./ShadowMapShader.js\";\n\n/**\n * <div class=\"notice\">\n * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.\n * </div>\n *\n * <p>\n * The normalOffset bias pushes the shadows forward slightly, and may be disabled\n * for applications that require ultra precise shadows.\n * </p>\n *\n * @alias ShadowMap\n * @internalConstructor\n * @class\n *\n * @privateParam {Object} options An object containing the following properties:\n * @privateParam {Context} options.context The context\n * @privateParam {Camera} options.lightCamera A camera representing the light source.\n * @privateParam {Boolean} [options.enabled=true] Whether the shadow map is enabled.\n * @privateParam {Boolean} [options.isPointLight=false] Whether the light source is a point light. Point light shadows do not use cascades.\n * @privateParam {Number} [options.pointLightRadius=100.0] Radius of the point light.\n * @privateParam {Boolean} [options.cascadesEnabled=true] Use multiple shadow maps to cover different partitions of the view frustum.\n * @privateParam {Number} [options.numberOfCascades=4] The number of cascades to use for the shadow map. Supported values are one and four.\n * @privateParam {Number} [options.maximumDistance=5000.0] The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.\n * @privateParam {Number} [options.size=2048] The width and height, in pixels, of each shadow map.\n * @privateParam {Boolean} [options.softShadows=false] Whether percentage-closer-filtering is enabled for producing softer shadows.\n * @privateParam {Number} [options.darkness=0.3] The shadow darkness.\n * @privateParam {Boolean} [options.normalOffset=true] Whether a normal bias is applied to shadows.\n * @privateParam {Boolean} [options.fadingEnabled=true] Whether shadows start to fade out once the light gets closer to the horizon.\n *\n * @exception {DeveloperError} Only one or four cascades are supported.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Shadows.html|Cesium Sandcastle Shadows Demo}\n */\nfunction ShadowMap(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const context = options.context;\n\n this._enabled = defaultValue(options.enabled, true);\n this._softShadows = defaultValue(options.softShadows, false);\n this._normalOffset = defaultValue(options.normalOffset, true);\n this.dirty = true;\n\n /**\n * Specifies whether the shadow map originates from a light source. Shadow maps that are used for analytical\n * purposes should set this to false so as not to affect scene rendering.\n *\n * @private\n */\n this.fromLightSource = defaultValue(options.fromLightSource, true);\n\n /**\n * Determines the darkness of the shadows.\n *\n * @type {Number}\n * @default 0.3\n */\n this.darkness = defaultValue(options.darkness, 0.3);\n this._darkness = this.darkness;\n\n /**\n * Determines whether shadows start to fade out once the light gets closer to the horizon.\n *\n * @type {Boolean}\n * @default true\n */\n this.fadingEnabled = defaultValue(options.fadingEnabled, true);\n\n /**\n * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.\n *\n * @type {Number}\n * @default 5000.0\n */\n this.maximumDistance = defaultValue(options.maximumDistance, 5000.0);\n\n this._outOfView = false;\n this._outOfViewPrevious = false;\n this._needsUpdate = true;\n\n // In IE11 and Edge polygon offset is not functional.\n // TODO : Also disabled for instances of Firefox and Chrome running ANGLE that do not support depth textures.\n // Re-enable once https://github.com/CesiumGS/cesium/issues/4560 is resolved.\n let polygonOffsetSupported = true;\n if (\n FeatureDetection.isInternetExplorer() ||\n FeatureDetection.isEdge() ||\n ((FeatureDetection.isChrome() || FeatureDetection.isFirefox()) &&\n FeatureDetection.isWindows() &&\n !context.depthTexture)\n ) {\n polygonOffsetSupported = false;\n }\n this._polygonOffsetSupported = polygonOffsetSupported;\n\n this._terrainBias = {\n polygonOffset: polygonOffsetSupported,\n polygonOffsetFactor: 1.1,\n polygonOffsetUnits: 4.0,\n normalOffset: this._normalOffset,\n normalOffsetScale: 0.5,\n normalShading: true,\n normalShadingSmooth: 0.3,\n depthBias: 0.0001,\n };\n\n this._primitiveBias = {\n polygonOffset: polygonOffsetSupported,\n polygonOffsetFactor: 1.1,\n polygonOffsetUnits: 4.0,\n normalOffset: this._normalOffset,\n normalOffsetScale: 0.1,\n normalShading: true,\n normalShadingSmooth: 0.05,\n depthBias: 0.00002,\n };\n\n this._pointBias = {\n polygonOffset: false,\n polygonOffsetFactor: 1.1,\n polygonOffsetUnits: 4.0,\n normalOffset: this._normalOffset,\n normalOffsetScale: 0.0,\n normalShading: true,\n normalShadingSmooth: 0.1,\n depthBias: 0.0005,\n };\n\n // Framebuffer resources\n this._depthAttachment = undefined;\n this._colorAttachment = undefined;\n\n // Uniforms\n this._shadowMapMatrix = new Matrix4();\n this._shadowMapTexture = undefined;\n this._lightDirectionEC = new Cartesian3();\n this._lightPositionEC = new Cartesian4();\n this._distance = 0.0;\n\n this._lightCamera = options.lightCamera;\n this._shadowMapCamera = new ShadowMapCamera();\n this._shadowMapCullingVolume = undefined;\n this._sceneCamera = undefined;\n this._boundingSphere = new BoundingSphere();\n\n this._isPointLight = defaultValue(options.isPointLight, false);\n this._pointLightRadius = defaultValue(options.pointLightRadius, 100.0);\n\n this._cascadesEnabled = this._isPointLight\n ? false\n : defaultValue(options.cascadesEnabled, true);\n this._numberOfCascades = !this._cascadesEnabled\n ? 0\n : defaultValue(options.numberOfCascades, 4);\n this._fitNearFar = true;\n this._maximumCascadeDistances = [25.0, 150.0, 700.0, Number.MAX_VALUE];\n\n this._textureSize = new Cartesian2();\n\n this._isSpotLight = false;\n if (this._cascadesEnabled) {\n // Cascaded shadows are always orthographic. The frustum dimensions are calculated on the fly.\n this._shadowMapCamera.frustum = new OrthographicOffCenterFrustum();\n } else if (defined(this._lightCamera.frustum.fov)) {\n // If the light camera uses a perspective frustum, then the light source is a spot light\n this._isSpotLight = true;\n }\n\n // Uniforms\n this._cascadeSplits = [new Cartesian4(), new Cartesian4()];\n this._cascadeMatrices = [\n new Matrix4(),\n new Matrix4(),\n new Matrix4(),\n new Matrix4(),\n ];\n this._cascadeDistances = new Cartesian4();\n\n let numberOfPasses;\n if (this._isPointLight) {\n numberOfPasses = 6; // One shadow map for each direction\n } else if (!this._cascadesEnabled) {\n numberOfPasses = 1;\n } else {\n numberOfPasses = this._numberOfCascades;\n }\n\n this._passes = new Array(numberOfPasses);\n for (let i = 0; i < numberOfPasses; ++i) {\n this._passes[i] = new ShadowPass(context);\n }\n\n this.debugShow = false;\n this.debugFreezeFrame = false;\n this._debugFreezeFrame = false;\n this._debugCascadeColors = false;\n this._debugLightFrustum = undefined;\n this._debugCameraFrustum = undefined;\n this._debugCascadeFrustums = new Array(this._numberOfCascades);\n this._debugShadowViewCommand = undefined;\n\n this._usesDepthTexture = context.depthTexture;\n\n if (this._isPointLight) {\n this._usesDepthTexture = false;\n }\n\n // Create render states for shadow casters\n this._primitiveRenderState = undefined;\n this._terrainRenderState = undefined;\n this._pointRenderState = undefined;\n createRenderStates(this);\n\n // For clearing the shadow map texture every frame\n this._clearCommand = new ClearCommand({\n depth: 1.0,\n color: new Color(),\n });\n\n this._clearPassState = new PassState(context);\n\n this._size = defaultValue(options.size, 2048);\n this.size = this._size;\n}\n\n/**\n * Global maximum shadow distance used to prevent far off receivers from extending\n * the shadow far plane. This helps set a tighter near/far when viewing objects from space.\n *\n * @private\n */\nShadowMap.MAXIMUM_DISTANCE = 20000.0;\n\nfunction ShadowPass(context) {\n this.camera = new ShadowMapCamera();\n this.passState = new PassState(context);\n this.framebuffer = undefined;\n this.textureOffsets = undefined;\n this.commandList = [];\n this.cullingVolume = undefined;\n}\n\nfunction createRenderState(colorMask, bias) {\n return RenderState.fromCache({\n cull: {\n enabled: true,\n face: CullFace.BACK,\n },\n depthTest: {\n enabled: true,\n },\n colorMask: {\n red: colorMask,\n green: colorMask,\n blue: colorMask,\n alpha: colorMask,\n },\n depthMask: true,\n polygonOffset: {\n enabled: bias.polygonOffset,\n factor: bias.polygonOffsetFactor,\n units: bias.polygonOffsetUnits,\n },\n });\n}\n\nfunction createRenderStates(shadowMap) {\n // Enable the color mask if the shadow map is backed by a color texture, e.g. when depth textures aren't supported\n const colorMask = !shadowMap._usesDepthTexture;\n shadowMap._primitiveRenderState = createRenderState(\n colorMask,\n shadowMap._primitiveBias\n );\n shadowMap._terrainRenderState = createRenderState(\n colorMask,\n shadowMap._terrainBias\n );\n shadowMap._pointRenderState = createRenderState(\n colorMask,\n shadowMap._pointBias\n );\n}\n\n/**\n * @private\n */\nShadowMap.prototype.debugCreateRenderStates = function () {\n createRenderStates(this);\n};\n\nObject.defineProperties(ShadowMap.prototype, {\n /**\n * Determines if the shadow map will be shown.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @default true\n */\n enabled: {\n get: function () {\n return this._enabled;\n },\n set: function (value) {\n this.dirty = this._enabled !== value;\n this._enabled = value;\n },\n },\n\n /**\n * Determines if a normal bias will be applied to shadows.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @default true\n */\n normalOffset: {\n get: function () {\n return this._normalOffset;\n },\n set: function (value) {\n this.dirty = this._normalOffset !== value;\n this._normalOffset = value;\n this._terrainBias.normalOffset = value;\n this._primitiveBias.normalOffset = value;\n this._pointBias.normalOffset = value;\n },\n },\n\n /**\n * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @default false\n */\n softShadows: {\n get: function () {\n return this._softShadows;\n },\n set: function (value) {\n this.dirty = this._softShadows !== value;\n this._softShadows = value;\n },\n },\n\n /**\n * The width and height, in pixels, of each shadow map.\n *\n * @memberof ShadowMap.prototype\n * @type {Number}\n * @default 2048\n */\n size: {\n get: function () {\n return this._size;\n },\n set: function (value) {\n resize(this, value);\n },\n },\n\n /**\n * Whether the shadow map is out of view of the scene camera.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n outOfView: {\n get: function () {\n return this._outOfView;\n },\n },\n\n /**\n * The culling volume of the shadow frustum.\n *\n * @memberof ShadowMap.prototype\n * @type {CullingVolume}\n * @readonly\n * @private\n */\n shadowMapCullingVolume: {\n get: function () {\n return this._shadowMapCullingVolume;\n },\n },\n\n /**\n * The passes used for rendering shadows. Each face of a point light or each cascade for a cascaded shadow map is a separate pass.\n *\n * @memberof ShadowMap.prototype\n * @type {ShadowPass[]}\n * @readonly\n * @private\n */\n passes: {\n get: function () {\n return this._passes;\n },\n },\n\n /**\n * Whether the light source is a point light.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n isPointLight: {\n get: function () {\n return this._isPointLight;\n },\n },\n\n /**\n * Debug option for visualizing the cascades by color.\n *\n * @memberof ShadowMap.prototype\n * @type {Boolean}\n * @default false\n * @private\n */\n debugCascadeColors: {\n get: function () {\n return this._debugCascadeColors;\n },\n set: function (value) {\n this.dirty = this._debugCascadeColors !== value;\n this._debugCascadeColors = value;\n },\n },\n});\n\nfunction destroyFramebuffer(shadowMap) {\n const length = shadowMap._passes.length;\n for (let i = 0; i < length; ++i) {\n const pass = shadowMap._passes[i];\n const framebuffer = pass.framebuffer;\n if (defined(framebuffer) && !framebuffer.isDestroyed()) {\n framebuffer.destroy();\n }\n pass.framebuffer = undefined;\n }\n\n // Destroy the framebuffer attachments\n shadowMap._depthAttachment =\n shadowMap._depthAttachment && shadowMap._depthAttachment.destroy();\n shadowMap._colorAttachment =\n shadowMap._colorAttachment && shadowMap._colorAttachment.destroy();\n}\n\nfunction createFramebufferColor(shadowMap, context) {\n const depthRenderbuffer = new Renderbuffer({\n context: context,\n width: shadowMap._textureSize.x,\n height: shadowMap._textureSize.y,\n format: RenderbufferFormat.DEPTH_COMPONENT16,\n });\n\n const colorTexture = new Texture({\n context: context,\n width: shadowMap._textureSize.x,\n height: shadowMap._textureSize.y,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n sampler: Sampler.NEAREST,\n });\n\n const framebuffer = new Framebuffer({\n context: context,\n depthRenderbuffer: depthRenderbuffer,\n colorTextures: [colorTexture],\n destroyAttachments: false,\n });\n\n const length = shadowMap._passes.length;\n for (let i = 0; i < length; ++i) {\n const pass = shadowMap._passes[i];\n pass.framebuffer = framebuffer;\n pass.passState.framebuffer = framebuffer;\n }\n\n shadowMap._shadowMapTexture = colorTexture;\n shadowMap._depthAttachment = depthRenderbuffer;\n shadowMap._colorAttachment = colorTexture;\n}\n\nfunction createFramebufferDepth(shadowMap, context) {\n const depthStencilTexture = new Texture({\n context: context,\n width: shadowMap._textureSize.x,\n height: shadowMap._textureSize.y,\n pixelFormat: PixelFormat.DEPTH_STENCIL,\n pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n sampler: Sampler.NEAREST,\n });\n\n const framebuffer = new Framebuffer({\n context: context,\n depthStencilTexture: depthStencilTexture,\n destroyAttachments: false,\n });\n\n const length = shadowMap._passes.length;\n for (let i = 0; i < length; ++i) {\n const pass = shadowMap._passes[i];\n pass.framebuffer = framebuffer;\n pass.passState.framebuffer = framebuffer;\n }\n\n shadowMap._shadowMapTexture = depthStencilTexture;\n shadowMap._depthAttachment = depthStencilTexture;\n}\n\nfunction createFramebufferCube(shadowMap, context) {\n const depthRenderbuffer = new Renderbuffer({\n context: context,\n width: shadowMap._textureSize.x,\n height: shadowMap._textureSize.y,\n format: RenderbufferFormat.DEPTH_COMPONENT16,\n });\n\n const cubeMap = new CubeMap({\n context: context,\n width: shadowMap._textureSize.x,\n height: shadowMap._textureSize.y,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n sampler: Sampler.NEAREST,\n });\n\n const faces = [\n cubeMap.negativeX,\n cubeMap.negativeY,\n cubeMap.negativeZ,\n cubeMap.positiveX,\n cubeMap.positiveY,\n cubeMap.positiveZ,\n ];\n\n for (let i = 0; i < 6; ++i) {\n const framebuffer = new Framebuffer({\n context: context,\n depthRenderbuffer: depthRenderbuffer,\n colorTextures: [faces[i]],\n destroyAttachments: false,\n });\n const pass = shadowMap._passes[i];\n pass.framebuffer = framebuffer;\n pass.passState.framebuffer = framebuffer;\n }\n\n shadowMap._shadowMapTexture = cubeMap;\n shadowMap._depthAttachment = depthRenderbuffer;\n shadowMap._colorAttachment = cubeMap;\n}\n\nfunction createFramebuffer(shadowMap, context) {\n if (shadowMap._isPointLight) {\n createFramebufferCube(shadowMap, context);\n } else if (shadowMap._usesDepthTexture) {\n createFramebufferDepth(shadowMap, context);\n } else {\n createFramebufferColor(shadowMap, context);\n }\n}\n\nfunction checkFramebuffer(shadowMap, context) {\n // Attempt to make an FBO with only a depth texture. If it fails, fallback to a color texture.\n if (\n shadowMap._usesDepthTexture &&\n shadowMap._passes[0].framebuffer.status !==\n WebGLConstants.FRAMEBUFFER_COMPLETE\n ) {\n shadowMap._usesDepthTexture = false;\n createRenderStates(shadowMap);\n destroyFramebuffer(shadowMap);\n createFramebuffer(shadowMap, context);\n }\n}\n\nfunction updateFramebuffer(shadowMap, context) {\n if (\n !defined(shadowMap._passes[0].framebuffer) ||\n shadowMap._shadowMapTexture.width !== shadowMap._textureSize.x\n ) {\n destroyFramebuffer(shadowMap);\n createFramebuffer(shadowMap, context);\n checkFramebuffer(shadowMap, context);\n clearFramebuffer(shadowMap, context);\n }\n}\n\nfunction clearFramebuffer(shadowMap, context, shadowPass) {\n shadowPass = defaultValue(shadowPass, 0);\n if (shadowMap._isPointLight || shadowPass === 0) {\n shadowMap._clearCommand.framebuffer =\n shadowMap._passes[shadowPass].framebuffer;\n shadowMap._clearCommand.execute(context, shadowMap._clearPassState);\n }\n}\n\nfunction resize(shadowMap, size) {\n shadowMap._size = size;\n const passes = shadowMap._passes;\n const numberOfPasses = passes.length;\n const textureSize = shadowMap._textureSize;\n\n if (shadowMap._isPointLight) {\n size =\n ContextLimits.maximumCubeMapSize >= size\n ? size\n : ContextLimits.maximumCubeMapSize;\n textureSize.x = size;\n textureSize.y = size;\n const faceViewport = new BoundingRectangle(0, 0, size, size);\n passes[0].passState.viewport = faceViewport;\n passes[1].passState.viewport = faceViewport;\n passes[2].passState.viewport = faceViewport;\n passes[3].passState.viewport = faceViewport;\n passes[4].passState.viewport = faceViewport;\n passes[5].passState.viewport = faceViewport;\n } else if (numberOfPasses === 1) {\n // +----+\n // | 1 |\n // +----+\n size =\n ContextLimits.maximumTextureSize >= size\n ? size\n : ContextLimits.maximumTextureSize;\n textureSize.x = size;\n textureSize.y = size;\n passes[0].passState.viewport = new BoundingRectangle(0, 0, size, size);\n } else if (numberOfPasses === 4) {\n // +----+----+\n // | 3 | 4 |\n // +----+----+\n // | 1 | 2 |\n // +----+----+\n size =\n ContextLimits.maximumTextureSize >= size * 2\n ? size\n : ContextLimits.maximumTextureSize / 2;\n textureSize.x = size * 2;\n textureSize.y = size * 2;\n passes[0].passState.viewport = new BoundingRectangle(0, 0, size, size);\n passes[1].passState.viewport = new BoundingRectangle(size, 0, size, size);\n passes[2].passState.viewport = new BoundingRectangle(0, size, size, size);\n passes[3].passState.viewport = new BoundingRectangle(\n size,\n size,\n size,\n size\n );\n }\n\n // Update clear pass state\n shadowMap._clearPassState.viewport = new BoundingRectangle(\n 0,\n 0,\n textureSize.x,\n textureSize.y\n );\n\n // Transforms shadow coordinates [0, 1] into the pass's region of the texture\n for (let i = 0; i < numberOfPasses; ++i) {\n const pass = passes[i];\n const viewport = pass.passState.viewport;\n const biasX = viewport.x / textureSize.x;\n const biasY = viewport.y / textureSize.y;\n const scaleX = viewport.width / textureSize.x;\n const scaleY = viewport.height / textureSize.y;\n pass.textureOffsets = new Matrix4(\n scaleX,\n 0.0,\n 0.0,\n biasX,\n 0.0,\n scaleY,\n 0.0,\n biasY,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n );\n }\n}\n\nconst scratchViewport = new BoundingRectangle();\n\nfunction createDebugShadowViewCommand(shadowMap, context) {\n let fs;\n if (shadowMap._isPointLight) {\n fs =\n \"uniform samplerCube shadowMap_textureCube; \\n\" +\n \"varying vec2 v_textureCoordinates; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n \" vec2 uv = v_textureCoordinates; \\n\" +\n \" vec3 dir; \\n\" +\n \" \\n\" +\n \" if (uv.y < 0.5) \\n\" +\n \" { \\n\" +\n \" if (uv.x < 0.333) \\n\" +\n \" { \\n\" +\n \" dir.x = -1.0; \\n\" +\n \" dir.y = uv.x * 6.0 - 1.0; \\n\" +\n \" dir.z = uv.y * 4.0 - 1.0; \\n\" +\n \" } \\n\" +\n \" else if (uv.x < 0.666) \\n\" +\n \" { \\n\" +\n \" dir.y = -1.0; \\n\" +\n \" dir.x = uv.x * 6.0 - 3.0; \\n\" +\n \" dir.z = uv.y * 4.0 - 1.0; \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" dir.z = -1.0; \\n\" +\n \" dir.x = uv.x * 6.0 - 5.0; \\n\" +\n \" dir.y = uv.y * 4.0 - 1.0; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" if (uv.x < 0.333) \\n\" +\n \" { \\n\" +\n \" dir.x = 1.0; \\n\" +\n \" dir.y = uv.x * 6.0 - 1.0; \\n\" +\n \" dir.z = uv.y * 4.0 - 3.0; \\n\" +\n \" } \\n\" +\n \" else if (uv.x < 0.666) \\n\" +\n \" { \\n\" +\n \" dir.y = 1.0; \\n\" +\n \" dir.x = uv.x * 6.0 - 3.0; \\n\" +\n \" dir.z = uv.y * 4.0 - 3.0; \\n\" +\n \" } \\n\" +\n \" else \\n\" +\n \" { \\n\" +\n \" dir.z = 1.0; \\n\" +\n \" dir.x = uv.x * 6.0 - 5.0; \\n\" +\n \" dir.y = uv.y * 4.0 - 3.0; \\n\" +\n \" } \\n\" +\n \" } \\n\" +\n \" \\n\" +\n \" float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \\n\" +\n \" gl_FragColor = vec4(vec3(shadow), 1.0); \\n\" +\n \"} \\n\";\n } else {\n fs =\n `${\n \"uniform sampler2D shadowMap_texture; \\n\" +\n \"varying vec2 v_textureCoordinates; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\"\n }${\n shadowMap._usesDepthTexture\n ? \" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \\n\"\n : \" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \\n\"\n } gl_FragColor = vec4(vec3(shadow), 1.0); \\n` + `} \\n`;\n }\n\n const drawCommand = context.createViewportQuadCommand(fs, {\n uniformMap: {\n shadowMap_texture: function () {\n return shadowMap._shadowMapTexture;\n },\n shadowMap_textureCube: function () {\n return shadowMap._shadowMapTexture;\n },\n },\n });\n drawCommand.pass = Pass.OVERLAY;\n return drawCommand;\n}\n\nfunction updateDebugShadowViewCommand(shadowMap, frameState) {\n // Draws the shadow map on the bottom-right corner of the screen\n const context = frameState.context;\n const screenWidth = frameState.context.drawingBufferWidth;\n const screenHeight = frameState.context.drawingBufferHeight;\n const size = Math.min(screenWidth, screenHeight) * 0.3;\n\n const viewport = scratchViewport;\n viewport.x = screenWidth - size;\n viewport.y = 0;\n viewport.width = size;\n viewport.height = size;\n\n let debugCommand = shadowMap._debugShadowViewCommand;\n if (!defined(debugCommand)) {\n debugCommand = createDebugShadowViewCommand(shadowMap, context);\n shadowMap._debugShadowViewCommand = debugCommand;\n }\n\n // Get a new RenderState for the updated viewport size\n if (\n !defined(debugCommand.renderState) ||\n !BoundingRectangle.equals(debugCommand.renderState.viewport, viewport)\n ) {\n debugCommand.renderState = RenderState.fromCache({\n viewport: BoundingRectangle.clone(viewport),\n });\n }\n\n frameState.commandList.push(shadowMap._debugShadowViewCommand);\n}\n\nconst frustumCornersNDC = new Array(8);\nfrustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, -1.0, 1.0);\nfrustumCornersNDC[1] = new Cartesian4(1.0, -1.0, -1.0, 1.0);\nfrustumCornersNDC[2] = new Cartesian4(1.0, 1.0, -1.0, 1.0);\nfrustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, -1.0, 1.0);\nfrustumCornersNDC[4] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[5] = new Cartesian4(1.0, -1.0, 1.0, 1.0);\nfrustumCornersNDC[6] = new Cartesian4(1.0, 1.0, 1.0, 1.0);\nfrustumCornersNDC[7] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);\n\nconst scratchMatrix = new Matrix4();\nconst scratchFrustumCorners = new Array(8);\nfor (let i = 0; i < 8; ++i) {\n scratchFrustumCorners[i] = new Cartesian4();\n}\n\nfunction createDebugPointLight(modelMatrix, color) {\n const box = new GeometryInstance({\n geometry: new BoxOutlineGeometry({\n minimum: new Cartesian3(-0.5, -0.5, -0.5),\n maximum: new Cartesian3(0.5, 0.5, 0.5),\n }),\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n const sphere = new GeometryInstance({\n geometry: new SphereOutlineGeometry({\n radius: 0.5,\n }),\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(color),\n },\n });\n\n return new Primitive({\n geometryInstances: [box, sphere],\n appearance: new PerInstanceColorAppearance({\n translucent: false,\n flat: true,\n }),\n asynchronous: false,\n modelMatrix: modelMatrix,\n });\n}\n\nconst debugOutlineColors = [Color.RED, Color.GREEN, Color.BLUE, Color.MAGENTA];\nconst scratchScale = new Cartesian3();\n\nfunction applyDebugSettings(shadowMap, frameState) {\n updateDebugShadowViewCommand(shadowMap, frameState);\n\n const enterFreezeFrame =\n shadowMap.debugFreezeFrame && !shadowMap._debugFreezeFrame;\n shadowMap._debugFreezeFrame = shadowMap.debugFreezeFrame;\n\n // Draw scene camera in freeze frame mode\n if (shadowMap.debugFreezeFrame) {\n if (enterFreezeFrame) {\n // Recreate debug camera when entering freeze frame mode\n shadowMap._debugCameraFrustum =\n shadowMap._debugCameraFrustum &&\n shadowMap._debugCameraFrustum.destroy();\n shadowMap._debugCameraFrustum = new DebugCameraPrimitive({\n camera: shadowMap._sceneCamera,\n color: Color.CYAN,\n updateOnChange: false,\n });\n }\n shadowMap._debugCameraFrustum.update(frameState);\n }\n\n if (shadowMap._cascadesEnabled) {\n // Draw cascades only in freeze frame mode\n if (shadowMap.debugFreezeFrame) {\n if (enterFreezeFrame) {\n // Recreate debug frustum when entering freeze frame mode\n shadowMap._debugLightFrustum =\n shadowMap._debugLightFrustum &&\n shadowMap._debugLightFrustum.destroy();\n shadowMap._debugLightFrustum = new DebugCameraPrimitive({\n camera: shadowMap._shadowMapCamera,\n color: Color.YELLOW,\n updateOnChange: false,\n });\n }\n shadowMap._debugLightFrustum.update(frameState);\n\n for (let i = 0; i < shadowMap._numberOfCascades; ++i) {\n if (enterFreezeFrame) {\n // Recreate debug frustum when entering freeze frame mode\n shadowMap._debugCascadeFrustums[i] =\n shadowMap._debugCascadeFrustums[i] &&\n shadowMap._debugCascadeFrustums[i].destroy();\n shadowMap._debugCascadeFrustums[i] = new DebugCameraPrimitive({\n camera: shadowMap._passes[i].camera,\n color: debugOutlineColors[i],\n updateOnChange: false,\n });\n }\n shadowMap._debugCascadeFrustums[i].update(frameState);\n }\n }\n } else if (shadowMap._isPointLight) {\n if (!defined(shadowMap._debugLightFrustum) || shadowMap._needsUpdate) {\n const translation = shadowMap._shadowMapCamera.positionWC;\n const rotation = Quaternion.IDENTITY;\n const uniformScale = shadowMap._pointLightRadius * 2.0;\n const scale = Cartesian3.fromElements(\n uniformScale,\n uniformScale,\n uniformScale,\n scratchScale\n );\n const modelMatrix = Matrix4.fromTranslationQuaternionRotationScale(\n translation,\n rotation,\n scale,\n scratchMatrix\n );\n\n shadowMap._debugLightFrustum =\n shadowMap._debugLightFrustum && shadowMap._debugLightFrustum.destroy();\n shadowMap._debugLightFrustum = createDebugPointLight(\n modelMatrix,\n Color.YELLOW\n );\n }\n shadowMap._debugLightFrustum.update(frameState);\n } else {\n if (!defined(shadowMap._debugLightFrustum) || shadowMap._needsUpdate) {\n shadowMap._debugLightFrustum = new DebugCameraPrimitive({\n camera: shadowMap._shadowMapCamera,\n color: Color.YELLOW,\n updateOnChange: false,\n });\n }\n shadowMap._debugLightFrustum.update(frameState);\n }\n}\n\nfunction ShadowMapCamera() {\n this.viewMatrix = new Matrix4();\n this.inverseViewMatrix = new Matrix4();\n this.frustum = undefined;\n this.positionCartographic = new Cartographic();\n this.positionWC = new Cartesian3();\n this.directionWC = Cartesian3.clone(Cartesian3.UNIT_Z);\n this.upWC = Cartesian3.clone(Cartesian3.UNIT_Y);\n this.rightWC = Cartesian3.clone(Cartesian3.UNIT_X);\n this.viewProjectionMatrix = new Matrix4();\n}\n\nShadowMapCamera.prototype.clone = function (camera) {\n Matrix4.clone(camera.viewMatrix, this.viewMatrix);\n Matrix4.clone(camera.inverseViewMatrix, this.inverseViewMatrix);\n this.frustum = camera.frustum.clone(this.frustum);\n Cartographic.clone(camera.positionCartographic, this.positionCartographic);\n Cartesian3.clone(camera.positionWC, this.positionWC);\n Cartesian3.clone(camera.directionWC, this.directionWC);\n Cartesian3.clone(camera.upWC, this.upWC);\n Cartesian3.clone(camera.rightWC, this.rightWC);\n};\n\n// Converts from NDC space to texture space\nconst scaleBiasMatrix = new Matrix4(\n 0.5,\n 0.0,\n 0.0,\n 0.5,\n 0.0,\n 0.5,\n 0.0,\n 0.5,\n 0.0,\n 0.0,\n 0.5,\n 0.5,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n);\n\nShadowMapCamera.prototype.getViewProjection = function () {\n const view = this.viewMatrix;\n const projection = this.frustum.projectionMatrix;\n Matrix4.multiply(projection, view, this.viewProjectionMatrix);\n Matrix4.multiply(\n scaleBiasMatrix,\n this.viewProjectionMatrix,\n this.viewProjectionMatrix\n );\n return this.viewProjectionMatrix;\n};\n\nconst scratchSplits = new Array(5);\nconst scratchFrustum = new PerspectiveFrustum();\nconst scratchCascadeDistances = new Array(4);\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\n\nfunction computeCascades(shadowMap, frameState) {\n const shadowMapCamera = shadowMap._shadowMapCamera;\n const sceneCamera = shadowMap._sceneCamera;\n const cameraNear = sceneCamera.frustum.near;\n const cameraFar = sceneCamera.frustum.far;\n const numberOfCascades = shadowMap._numberOfCascades;\n\n // Split cascades. Use a mix of linear and log splits.\n let i;\n const range = cameraFar - cameraNear;\n const ratio = cameraFar / cameraNear;\n\n let lambda = 0.9;\n let clampCascadeDistances = false;\n\n // When the camera is close to a relatively small model, provide more detail in the closer cascades.\n // If the camera is near or inside a large model, such as the root tile of a city, then use the default values.\n // To get the most accurate cascade splits we would need to find the min and max values from the depth texture.\n if (frameState.shadowState.closestObjectSize < 200.0) {\n clampCascadeDistances = true;\n lambda = 0.9;\n }\n\n const cascadeDistances = scratchCascadeDistances;\n const splits = scratchSplits;\n splits[0] = cameraNear;\n splits[numberOfCascades] = cameraFar;\n\n // Find initial splits\n for (i = 0; i < numberOfCascades; ++i) {\n const p = (i + 1) / numberOfCascades;\n const logScale = cameraNear * Math.pow(ratio, p);\n const uniformScale = cameraNear + range * p;\n const split = CesiumMath.lerp(uniformScale, logScale, lambda);\n splits[i + 1] = split;\n cascadeDistances[i] = split - splits[i];\n }\n\n if (clampCascadeDistances) {\n // Clamp each cascade to its maximum distance\n for (i = 0; i < numberOfCascades; ++i) {\n cascadeDistances[i] = Math.min(\n cascadeDistances[i],\n shadowMap._maximumCascadeDistances[i]\n );\n }\n\n // Recompute splits\n let distance = splits[0];\n for (i = 0; i < numberOfCascades - 1; ++i) {\n distance += cascadeDistances[i];\n splits[i + 1] = distance;\n }\n }\n\n Cartesian4.unpack(splits, 0, shadowMap._cascadeSplits[0]);\n Cartesian4.unpack(splits, 1, shadowMap._cascadeSplits[1]);\n Cartesian4.unpack(cascadeDistances, 0, shadowMap._cascadeDistances);\n\n const shadowFrustum = shadowMapCamera.frustum;\n const left = shadowFrustum.left;\n const right = shadowFrustum.right;\n const bottom = shadowFrustum.bottom;\n const top = shadowFrustum.top;\n const near = shadowFrustum.near;\n const far = shadowFrustum.far;\n\n const position = shadowMapCamera.positionWC;\n const direction = shadowMapCamera.directionWC;\n const up = shadowMapCamera.upWC;\n\n const cascadeSubFrustum = sceneCamera.frustum.clone(scratchFrustum);\n const shadowViewProjection = shadowMapCamera.getViewProjection();\n\n for (i = 0; i < numberOfCascades; ++i) {\n // Find the bounding box of the camera sub-frustum in shadow map texture space\n cascadeSubFrustum.near = splits[i];\n cascadeSubFrustum.far = splits[i + 1];\n const viewProjection = Matrix4.multiply(\n cascadeSubFrustum.projectionMatrix,\n sceneCamera.viewMatrix,\n scratchMatrix\n );\n const inverseViewProjection = Matrix4.inverse(\n viewProjection,\n scratchMatrix\n );\n const shadowMapMatrix = Matrix4.multiply(\n shadowViewProjection,\n inverseViewProjection,\n scratchMatrix\n );\n\n // Project each corner from camera NDC space to shadow map texture space. Min and max will be from 0 to 1.\n const min = Cartesian3.fromElements(\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n scratchMin\n );\n const max = Cartesian3.fromElements(\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n scratchMax\n );\n\n for (let k = 0; k < 8; ++k) {\n const corner = Cartesian4.clone(\n frustumCornersNDC[k],\n scratchFrustumCorners[k]\n );\n Matrix4.multiplyByVector(shadowMapMatrix, corner, corner);\n Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide\n Cartesian3.minimumByComponent(corner, min, min);\n Cartesian3.maximumByComponent(corner, max, max);\n }\n\n // Limit light-space coordinates to the [0, 1] range\n min.x = Math.max(min.x, 0.0);\n min.y = Math.max(min.y, 0.0);\n min.z = 0.0; // Always start cascade frustum at the top of the light frustum to capture objects in the light's path\n max.x = Math.min(max.x, 1.0);\n max.y = Math.min(max.y, 1.0);\n max.z = Math.min(max.z, 1.0);\n\n const pass = shadowMap._passes[i];\n const cascadeCamera = pass.camera;\n cascadeCamera.clone(shadowMapCamera); // PERFORMANCE_IDEA : could do a shallow clone for all properties except the frustum\n\n const frustum = cascadeCamera.frustum;\n frustum.left = left + min.x * (right - left);\n frustum.right = left + max.x * (right - left);\n frustum.bottom = bottom + min.y * (top - bottom);\n frustum.top = bottom + max.y * (top - bottom);\n frustum.near = near + min.z * (far - near);\n frustum.far = near + max.z * (far - near);\n\n pass.cullingVolume = cascadeCamera.frustum.computeCullingVolume(\n position,\n direction,\n up\n );\n\n // Transforms from eye space to the cascade's texture space\n const cascadeMatrix = shadowMap._cascadeMatrices[i];\n Matrix4.multiply(\n cascadeCamera.getViewProjection(),\n sceneCamera.inverseViewMatrix,\n cascadeMatrix\n );\n Matrix4.multiply(pass.textureOffsets, cascadeMatrix, cascadeMatrix);\n }\n}\n\nconst scratchLightView = new Matrix4();\nconst scratchRight = new Cartesian3();\nconst scratchUp = new Cartesian3();\nconst scratchTranslation = new Cartesian3();\n\nfunction fitShadowMapToScene(shadowMap, frameState) {\n const shadowMapCamera = shadowMap._shadowMapCamera;\n const sceneCamera = shadowMap._sceneCamera;\n\n // 1. First find a tight bounding box in light space that contains the entire camera frustum.\n const viewProjection = Matrix4.multiply(\n sceneCamera.frustum.projectionMatrix,\n sceneCamera.viewMatrix,\n scratchMatrix\n );\n const inverseViewProjection = Matrix4.inverse(viewProjection, scratchMatrix);\n\n // Start to construct the light view matrix. Set translation later once the bounding box is found.\n const lightDir = shadowMapCamera.directionWC;\n let lightUp = sceneCamera.directionWC; // Align shadows to the camera view.\n if (Cartesian3.equalsEpsilon(lightDir, lightUp, CesiumMath.EPSILON10)) {\n lightUp = sceneCamera.upWC;\n }\n const lightRight = Cartesian3.cross(lightDir, lightUp, scratchRight);\n lightUp = Cartesian3.cross(lightRight, lightDir, scratchUp); // Recalculate up now that right is derived\n Cartesian3.normalize(lightUp, lightUp);\n Cartesian3.normalize(lightRight, lightRight);\n const lightPosition = Cartesian3.fromElements(\n 0.0,\n 0.0,\n 0.0,\n scratchTranslation\n );\n\n let lightView = Matrix4.computeView(\n lightPosition,\n lightDir,\n lightUp,\n lightRight,\n scratchLightView\n );\n const cameraToLight = Matrix4.multiply(\n lightView,\n inverseViewProjection,\n scratchMatrix\n );\n\n // Project each corner from NDC space to light view space, and calculate a min and max in light view space\n const min = Cartesian3.fromElements(\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n Number.MAX_VALUE,\n scratchMin\n );\n const max = Cartesian3.fromElements(\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n -Number.MAX_VALUE,\n scratchMax\n );\n\n for (let i = 0; i < 8; ++i) {\n const corner = Cartesian4.clone(\n frustumCornersNDC[i],\n scratchFrustumCorners[i]\n );\n Matrix4.multiplyByVector(cameraToLight, corner, corner);\n Cartesian3.divideByScalar(corner, corner.w, corner); // Handle the perspective divide\n Cartesian3.minimumByComponent(corner, min, min);\n Cartesian3.maximumByComponent(corner, max, max);\n }\n\n // 2. Set bounding box back to include objects in the light's view\n max.z += 1000.0; // Note: in light space, a positive number is behind the camera\n min.z -= 10.0; // Extend the shadow volume forward slightly to avoid problems right at the edge\n\n // 3. Adjust light view matrix so that it is centered on the bounding volume\n const translation = scratchTranslation;\n translation.x = -(0.5 * (min.x + max.x));\n translation.y = -(0.5 * (min.y + max.y));\n translation.z = -max.z;\n\n const translationMatrix = Matrix4.fromTranslation(translation, scratchMatrix);\n lightView = Matrix4.multiply(translationMatrix, lightView, lightView);\n\n // 4. Create an orthographic frustum that covers the bounding box extents\n const halfWidth = 0.5 * (max.x - min.x);\n const halfHeight = 0.5 * (max.y - min.y);\n const depth = max.z - min.z;\n\n const frustum = shadowMapCamera.frustum;\n frustum.left = -halfWidth;\n frustum.right = halfWidth;\n frustum.bottom = -halfHeight;\n frustum.top = halfHeight;\n frustum.near = 0.01;\n frustum.far = depth;\n\n // 5. Update the shadow map camera\n Matrix4.clone(lightView, shadowMapCamera.viewMatrix);\n Matrix4.inverse(lightView, shadowMapCamera.inverseViewMatrix);\n Matrix4.getTranslation(\n shadowMapCamera.inverseViewMatrix,\n shadowMapCamera.positionWC\n );\n frameState.mapProjection.ellipsoid.cartesianToCartographic(\n shadowMapCamera.positionWC,\n shadowMapCamera.positionCartographic\n );\n Cartesian3.clone(lightDir, shadowMapCamera.directionWC);\n Cartesian3.clone(lightUp, shadowMapCamera.upWC);\n Cartesian3.clone(lightRight, shadowMapCamera.rightWC);\n}\n\nconst directions = [\n new Cartesian3(-1.0, 0.0, 0.0),\n new Cartesian3(0.0, -1.0, 0.0),\n new Cartesian3(0.0, 0.0, -1.0),\n new Cartesian3(1.0, 0.0, 0.0),\n new Cartesian3(0.0, 1.0, 0.0),\n new Cartesian3(0.0, 0.0, 1.0),\n];\n\nconst ups = [\n new Cartesian3(0.0, -1.0, 0.0),\n new Cartesian3(0.0, 0.0, -1.0),\n new Cartesian3(0.0, -1.0, 0.0),\n new Cartesian3(0.0, -1.0, 0.0),\n new Cartesian3(0.0, 0.0, 1.0),\n new Cartesian3(0.0, -1.0, 0.0),\n];\n\nconst rights = [\n new Cartesian3(0.0, 0.0, 1.0),\n new Cartesian3(1.0, 0.0, 0.0),\n new Cartesian3(-1.0, 0.0, 0.0),\n new Cartesian3(0.0, 0.0, -1.0),\n new Cartesian3(1.0, 0.0, 0.0),\n new Cartesian3(1.0, 0.0, 0.0),\n];\n\nfunction computeOmnidirectional(shadowMap, frameState) {\n // All sides share the same frustum\n const frustum = new PerspectiveFrustum();\n frustum.fov = CesiumMath.PI_OVER_TWO;\n frustum.near = 1.0;\n frustum.far = shadowMap._pointLightRadius;\n frustum.aspectRatio = 1.0;\n\n for (let i = 0; i < 6; ++i) {\n const camera = shadowMap._passes[i].camera;\n camera.positionWC = shadowMap._shadowMapCamera.positionWC;\n camera.positionCartographic = frameState.mapProjection.ellipsoid.cartesianToCartographic(\n camera.positionWC,\n camera.positionCartographic\n );\n camera.directionWC = directions[i];\n camera.upWC = ups[i];\n camera.rightWC = rights[i];\n\n Matrix4.computeView(\n camera.positionWC,\n camera.directionWC,\n camera.upWC,\n camera.rightWC,\n camera.viewMatrix\n );\n Matrix4.inverse(camera.viewMatrix, camera.inverseViewMatrix);\n\n camera.frustum = frustum;\n }\n}\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchBoundingSphere = new BoundingSphere();\nconst scratchCenter = scratchBoundingSphere.center;\n\nfunction checkVisibility(shadowMap, frameState) {\n const sceneCamera = shadowMap._sceneCamera;\n const shadowMapCamera = shadowMap._shadowMapCamera;\n\n const boundingSphere = scratchBoundingSphere;\n\n // Check whether the shadow map is in view and needs to be updated\n if (shadowMap._cascadesEnabled) {\n // If the nearest shadow receiver is further than the shadow map's maximum distance then the shadow map is out of view.\n if (sceneCamera.frustum.near >= shadowMap.maximumDistance) {\n shadowMap._outOfView = true;\n shadowMap._needsUpdate = false;\n return;\n }\n\n // If the light source is below the horizon then the shadow map is out of view\n const surfaceNormal = frameState.mapProjection.ellipsoid.geodeticSurfaceNormal(\n sceneCamera.positionWC,\n scratchCartesian1\n );\n const lightDirection = Cartesian3.negate(\n shadowMapCamera.directionWC,\n scratchCartesian2\n );\n const dot = Cartesian3.dot(surfaceNormal, lightDirection);\n if (shadowMap.fadingEnabled) {\n // Shadows start to fade out once the light gets closer to the horizon.\n // At this point the globe uses vertex lighting alone to darken the surface.\n const darknessAmount = CesiumMath.clamp(dot / 0.1, 0.0, 1.0);\n shadowMap._darkness = CesiumMath.lerp(\n 1.0,\n shadowMap.darkness,\n darknessAmount\n );\n } else {\n shadowMap._darkness = shadowMap.darkness;\n }\n\n if (dot < 0.0) {\n shadowMap._outOfView = true;\n shadowMap._needsUpdate = false;\n return;\n }\n\n // By default cascaded shadows need to update and are always in view\n shadowMap._needsUpdate = true;\n shadowMap._outOfView = false;\n } else if (shadowMap._isPointLight) {\n // Sphere-frustum intersection test\n boundingSphere.center = shadowMapCamera.positionWC;\n boundingSphere.radius = shadowMap._pointLightRadius;\n shadowMap._outOfView =\n frameState.cullingVolume.computeVisibility(boundingSphere) ===\n Intersect.OUTSIDE;\n shadowMap._needsUpdate =\n !shadowMap._outOfView &&\n !shadowMap._boundingSphere.equals(boundingSphere);\n BoundingSphere.clone(boundingSphere, shadowMap._boundingSphere);\n } else {\n // Simplify frustum-frustum intersection test as a sphere-frustum test\n const frustumRadius = shadowMapCamera.frustum.far / 2.0;\n const frustumCenter = Cartesian3.add(\n shadowMapCamera.positionWC,\n Cartesian3.multiplyByScalar(\n shadowMapCamera.directionWC,\n frustumRadius,\n scratchCenter\n ),\n scratchCenter\n );\n boundingSphere.center = frustumCenter;\n boundingSphere.radius = frustumRadius;\n shadowMap._outOfView =\n frameState.cullingVolume.computeVisibility(boundingSphere) ===\n Intersect.OUTSIDE;\n shadowMap._needsUpdate =\n !shadowMap._outOfView &&\n !shadowMap._boundingSphere.equals(boundingSphere);\n BoundingSphere.clone(boundingSphere, shadowMap._boundingSphere);\n }\n}\n\nfunction updateCameras(shadowMap, frameState) {\n const camera = frameState.camera; // The actual camera in the scene\n const lightCamera = shadowMap._lightCamera; // The external camera representing the light source\n const sceneCamera = shadowMap._sceneCamera; // Clone of camera, with clamped near and far planes\n const shadowMapCamera = shadowMap._shadowMapCamera; // Camera representing the shadow volume, initially cloned from lightCamera\n\n // Clone light camera into the shadow map camera\n if (shadowMap._cascadesEnabled) {\n Cartesian3.clone(lightCamera.directionWC, shadowMapCamera.directionWC);\n } else if (shadowMap._isPointLight) {\n Cartesian3.clone(lightCamera.positionWC, shadowMapCamera.positionWC);\n } else {\n shadowMapCamera.clone(lightCamera);\n }\n\n // Get the light direction in eye coordinates\n const lightDirection = shadowMap._lightDirectionEC;\n Matrix4.multiplyByPointAsVector(\n camera.viewMatrix,\n shadowMapCamera.directionWC,\n lightDirection\n );\n Cartesian3.normalize(lightDirection, lightDirection);\n Cartesian3.negate(lightDirection, lightDirection);\n\n // Get the light position in eye coordinates\n Matrix4.multiplyByPoint(\n camera.viewMatrix,\n shadowMapCamera.positionWC,\n shadowMap._lightPositionEC\n );\n shadowMap._lightPositionEC.w = shadowMap._pointLightRadius;\n\n // Get the near and far of the scene camera\n let near;\n let far;\n if (shadowMap._fitNearFar) {\n // shadowFar can be very large, so limit to shadowMap.maximumDistance\n // Push the far plane slightly further than the near plane to avoid degenerate frustum\n near = Math.min(\n frameState.shadowState.nearPlane,\n shadowMap.maximumDistance\n );\n far = Math.min(frameState.shadowState.farPlane, shadowMap.maximumDistance);\n far = Math.max(far, near + 1.0);\n } else {\n near = camera.frustum.near;\n far = shadowMap.maximumDistance;\n }\n\n shadowMap._sceneCamera = Camera.clone(camera, sceneCamera);\n camera.frustum.clone(shadowMap._sceneCamera.frustum);\n shadowMap._sceneCamera.frustum.near = near;\n shadowMap._sceneCamera.frustum.far = far;\n shadowMap._distance = far - near;\n\n checkVisibility(shadowMap, frameState);\n\n if (!shadowMap._outOfViewPrevious && shadowMap._outOfView) {\n shadowMap._needsUpdate = true;\n }\n shadowMap._outOfViewPrevious = shadowMap._outOfView;\n}\n\n/**\n * @private\n */\nShadowMap.prototype.update = function (frameState) {\n updateCameras(this, frameState);\n\n if (this._needsUpdate) {\n updateFramebuffer(this, frameState.context);\n\n if (this._isPointLight) {\n computeOmnidirectional(this, frameState);\n }\n\n if (this._cascadesEnabled) {\n fitShadowMapToScene(this, frameState);\n\n if (this._numberOfCascades > 1) {\n computeCascades(this, frameState);\n }\n }\n\n if (!this._isPointLight) {\n // Compute the culling volume\n const shadowMapCamera = this._shadowMapCamera;\n const position = shadowMapCamera.positionWC;\n const direction = shadowMapCamera.directionWC;\n const up = shadowMapCamera.upWC;\n this._shadowMapCullingVolume = shadowMapCamera.frustum.computeCullingVolume(\n position,\n direction,\n up\n );\n\n if (this._passes.length === 1) {\n // Since there is only one pass, use the shadow map camera as the pass camera.\n this._passes[0].camera.clone(shadowMapCamera);\n }\n } else {\n this._shadowMapCullingVolume = CullingVolume.fromBoundingSphere(\n this._boundingSphere\n );\n }\n }\n\n if (this._passes.length === 1) {\n // Transforms from eye space to shadow texture space.\n // Always requires an update since the scene camera constantly changes.\n const inverseView = this._sceneCamera.inverseViewMatrix;\n Matrix4.multiply(\n this._shadowMapCamera.getViewProjection(),\n inverseView,\n this._shadowMapMatrix\n );\n }\n\n if (this.debugShow) {\n applyDebugSettings(this, frameState);\n }\n};\n\n/**\n * @private\n */\nShadowMap.prototype.updatePass = function (context, shadowPass) {\n clearFramebuffer(this, context, shadowPass);\n};\n\nconst scratchTexelStepSize = new Cartesian2();\n\nfunction combineUniforms(shadowMap, uniforms, isTerrain) {\n const bias = shadowMap._isPointLight\n ? shadowMap._pointBias\n : isTerrain\n ? shadowMap._terrainBias\n : shadowMap._primitiveBias;\n\n const mapUniforms = {\n shadowMap_texture: function () {\n return shadowMap._shadowMapTexture;\n },\n shadowMap_textureCube: function () {\n return shadowMap._shadowMapTexture;\n },\n shadowMap_matrix: function () {\n return shadowMap._shadowMapMatrix;\n },\n shadowMap_cascadeSplits: function () {\n return shadowMap._cascadeSplits;\n },\n shadowMap_cascadeMatrices: function () {\n return shadowMap._cascadeMatrices;\n },\n shadowMap_lightDirectionEC: function () {\n return shadowMap._lightDirectionEC;\n },\n shadowMap_lightPositionEC: function () {\n return shadowMap._lightPositionEC;\n },\n shadowMap_cascadeDistances: function () {\n return shadowMap._cascadeDistances;\n },\n shadowMap_texelSizeDepthBiasAndNormalShadingSmooth: function () {\n const texelStepSize = scratchTexelStepSize;\n texelStepSize.x = 1.0 / shadowMap._textureSize.x;\n texelStepSize.y = 1.0 / shadowMap._textureSize.y;\n\n return Cartesian4.fromElements(\n texelStepSize.x,\n texelStepSize.y,\n bias.depthBias,\n bias.normalShadingSmooth,\n this.combinedUniforms1\n );\n },\n shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: function () {\n return Cartesian4.fromElements(\n bias.normalOffsetScale,\n shadowMap._distance,\n shadowMap.maximumDistance,\n shadowMap._darkness,\n this.combinedUniforms2\n );\n },\n\n combinedUniforms1: new Cartesian4(),\n combinedUniforms2: new Cartesian4(),\n };\n\n return combine(uniforms, mapUniforms, false);\n}\n\nfunction createCastDerivedCommand(\n shadowMap,\n shadowsDirty,\n command,\n context,\n oldShaderId,\n result\n) {\n let castShader;\n let castRenderState;\n let castUniformMap;\n if (defined(result)) {\n castShader = result.shaderProgram;\n castRenderState = result.renderState;\n castUniformMap = result.uniformMap;\n }\n\n result = DrawCommand.shallowClone(command, result);\n result.castShadows = true;\n result.receiveShadows = false;\n\n if (\n !defined(castShader) ||\n oldShaderId !== command.shaderProgram.id ||\n shadowsDirty\n ) {\n const shaderProgram = command.shaderProgram;\n\n const isTerrain = command.pass === Pass.GLOBE;\n const isOpaque = command.pass !== Pass.TRANSLUCENT;\n const isPointLight = shadowMap._isPointLight;\n const usesDepthTexture = shadowMap._usesDepthTexture;\n\n const keyword = ShadowMapShader.getShadowCastShaderKeyword(\n isPointLight,\n isTerrain,\n usesDepthTexture,\n isOpaque\n );\n castShader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n keyword\n );\n if (!defined(castShader)) {\n const vertexShaderSource = shaderProgram.vertexShaderSource;\n const fragmentShaderSource = shaderProgram.fragmentShaderSource;\n\n const castVS = ShadowMapShader.createShadowCastVertexShader(\n vertexShaderSource,\n isPointLight,\n isTerrain\n );\n const castFS = ShadowMapShader.createShadowCastFragmentShader(\n fragmentShaderSource,\n isPointLight,\n usesDepthTexture,\n isOpaque\n );\n\n castShader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n keyword,\n {\n vertexShaderSource: castVS,\n fragmentShaderSource: castFS,\n attributeLocations: shaderProgram._attributeLocations,\n }\n );\n }\n\n castRenderState = shadowMap._primitiveRenderState;\n if (isPointLight) {\n castRenderState = shadowMap._pointRenderState;\n } else if (isTerrain) {\n castRenderState = shadowMap._terrainRenderState;\n }\n\n // Modify the render state for commands that do not use back-face culling, e.g. flat textured walls\n const cullEnabled = command.renderState.cull.enabled;\n if (!cullEnabled) {\n castRenderState = clone(castRenderState, false);\n castRenderState.cull = clone(castRenderState.cull, false);\n castRenderState.cull.enabled = false;\n castRenderState = RenderState.fromCache(castRenderState);\n }\n\n castUniformMap = combineUniforms(shadowMap, command.uniformMap, isTerrain);\n }\n\n result.shaderProgram = castShader;\n result.renderState = castRenderState;\n result.uniformMap = castUniformMap;\n\n return result;\n}\n\nShadowMap.createReceiveDerivedCommand = function (\n lightShadowMaps,\n command,\n shadowsDirty,\n context,\n result\n) {\n if (!defined(result)) {\n result = {};\n }\n\n const lightShadowMapsEnabled = lightShadowMaps.length > 0;\n const shaderProgram = command.shaderProgram;\n const vertexShaderSource = shaderProgram.vertexShaderSource;\n const fragmentShaderSource = shaderProgram.fragmentShaderSource;\n const isTerrain = command.pass === Pass.GLOBE;\n\n let hasTerrainNormal = false;\n if (isTerrain) {\n hasTerrainNormal =\n command.owner.data.renderedMesh.encoding.hasVertexNormals;\n }\n\n if (command.receiveShadows && lightShadowMapsEnabled) {\n // Only generate a receiveCommand if there is a shadow map originating from a light source.\n let receiveShader;\n let receiveUniformMap;\n if (defined(result.receiveCommand)) {\n receiveShader = result.receiveCommand.shaderProgram;\n receiveUniformMap = result.receiveCommand.uniformMap;\n }\n\n result.receiveCommand = DrawCommand.shallowClone(\n command,\n result.receiveCommand\n );\n result.castShadows = false;\n result.receiveShadows = true;\n\n // If castShadows changed, recompile the receive shadows shader. The normal shading technique simulates\n // self-shadowing so it should be turned off if castShadows is false.\n const castShadowsDirty =\n result.receiveShaderCastShadows !== command.castShadows;\n const shaderDirty =\n result.receiveShaderProgramId !== command.shaderProgram.id;\n\n if (\n !defined(receiveShader) ||\n shaderDirty ||\n shadowsDirty ||\n castShadowsDirty\n ) {\n const keyword = ShadowMapShader.getShadowReceiveShaderKeyword(\n lightShadowMaps[0],\n command.castShadows,\n isTerrain,\n hasTerrainNormal\n );\n receiveShader = context.shaderCache.getDerivedShaderProgram(\n shaderProgram,\n keyword\n );\n if (!defined(receiveShader)) {\n const receiveVS = ShadowMapShader.createShadowReceiveVertexShader(\n vertexShaderSource,\n isTerrain,\n hasTerrainNormal\n );\n const receiveFS = ShadowMapShader.createShadowReceiveFragmentShader(\n fragmentShaderSource,\n lightShadowMaps[0],\n command.castShadows,\n isTerrain,\n hasTerrainNormal\n );\n\n receiveShader = context.shaderCache.createDerivedShaderProgram(\n shaderProgram,\n keyword,\n {\n vertexShaderSource: receiveVS,\n fragmentShaderSource: receiveFS,\n attributeLocations: shaderProgram._attributeLocations,\n }\n );\n }\n\n receiveUniformMap = combineUniforms(\n lightShadowMaps[0],\n command.uniformMap,\n isTerrain\n );\n }\n\n result.receiveCommand.shaderProgram = receiveShader;\n result.receiveCommand.uniformMap = receiveUniformMap;\n result.receiveShaderProgramId = command.shaderProgram.id;\n result.receiveShaderCastShadows = command.castShadows;\n }\n\n return result;\n};\n\nShadowMap.createCastDerivedCommand = function (\n shadowMaps,\n command,\n shadowsDirty,\n context,\n result\n) {\n if (!defined(result)) {\n result = {};\n }\n\n if (command.castShadows) {\n let castCommands = result.castCommands;\n if (!defined(castCommands)) {\n castCommands = result.castCommands = [];\n }\n\n const oldShaderId = result.castShaderProgramId;\n\n const shadowMapLength = shadowMaps.length;\n castCommands.length = shadowMapLength;\n\n for (let i = 0; i < shadowMapLength; ++i) {\n castCommands[i] = createCastDerivedCommand(\n shadowMaps[i],\n shadowsDirty,\n command,\n context,\n oldShaderId,\n castCommands[i]\n );\n }\n\n result.castShaderProgramId = command.shaderProgram.id;\n }\n\n return result;\n};\n\n/**\n * @private\n */\nShadowMap.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * @private\n */\nShadowMap.prototype.destroy = function () {\n destroyFramebuffer(this);\n\n this._debugLightFrustum =\n this._debugLightFrustum && this._debugLightFrustum.destroy();\n this._debugCameraFrustum =\n this._debugCameraFrustum && this._debugCameraFrustum.destroy();\n this._debugShadowViewCommand =\n this._debugShadowViewCommand &&\n this._debugShadowViewCommand.shaderProgram &&\n this._debugShadowViewCommand.shaderProgram.destroy();\n\n for (let i = 0; i < this._numberOfCascades; ++i) {\n this._debugCascadeFrustums[i] =\n this._debugCascadeFrustums[i] && this._debugCascadeFrustums[i].destroy();\n }\n\n return destroyObject(this);\n};\nexport default ShadowMap;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\n#ifdef DEBUG_SHOW_DEPTH\\n\\\nuniform sampler2D u_packedTranslucentDepth;\\n\\\n#endif\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\n#ifdef DEBUG_SHOW_DEPTH\\n\\\nif (v_textureCoordinates.x < 0.5)\\n\\\n{\\n\\\ngl_FragColor.rgb = vec3(czm_unpackDepth(texture2D(u_packedTranslucentDepth, v_textureCoordinates)));\\n\\\ngl_FragColor.a = 1.0;\\n\\\n}\\n\\\n#else\\n\\\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\\\n#ifdef PICK\\n\\\nif (color == vec4(0.0))\\n\\\n{\\n\\\ndiscard;\\n\\\n}\\n\\\n#else\\n\\\ncolor.rgb /= color.a;\\n\\\n#endif\\n\\\ngl_FragColor = color;\\n\\\n#endif\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport CompareAndPackTranslucentDepth from \"../Shaders/CompareAndPackTranslucentDepth.js\";\nimport CompositeTranslucentClassification from \"../Shaders/PostProcessStages/CompositeTranslucentClassification.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport StencilFunction from \"./StencilFunction.js\";\n\nconst debugShowPackedDepth = false;\n\n/**\n * Handles buffers, drawing, and deriving commands needed for classifying translucent 3D Tiles.\n * Uses a depth texture, so classification on translucent 3D Tiles is not available in Internet Explorer.\n *\n * @private\n */\nfunction TranslucentTileClassification(context) {\n this._drawClassificationFBO = new FramebufferManager({\n createDepthAttachments: false,\n });\n this._accumulationFBO = new FramebufferManager({\n createDepthAttachments: false,\n });\n this._packFBO = new FramebufferManager();\n\n this._opaqueDepthStencilTexture = undefined;\n\n // Reference to either colorTexture or accumulationTexture\n this._textureToComposite = undefined;\n\n this._translucentDepthStencilTexture = undefined;\n\n this._packDepthCommand = undefined;\n this._accumulateCommand = undefined;\n this._compositeCommand = undefined;\n this._copyCommand = undefined;\n\n this._clearColorCommand = new ClearCommand({\n color: new Color(0.0, 0.0, 0.0, 0.0),\n owner: this,\n });\n\n this._clearDepthStencilCommand = new ClearCommand({\n depth: 1.0,\n stencil: 0,\n owner: this,\n });\n\n this._supported = context.depthTexture;\n\n this._viewport = new BoundingRectangle();\n this._rsDepth = undefined;\n this._rsAccumulate = undefined;\n this._rsComp = undefined;\n this._useScissorTest = undefined;\n this._scissorRectangle = undefined;\n\n this._hasTranslucentDepth = false;\n this._frustumsDrawn = 0;\n}\n\nObject.defineProperties(TranslucentTileClassification.prototype, {\n /**\n * Gets whether or not translucent depth was rendered.\n * @memberof TranslucentTileClassification.prototype\n *\n * @type {Boolean}\n * @readonly\n */\n hasTranslucentDepth: {\n get: function () {\n return this._hasTranslucentDepth;\n },\n },\n});\n\nfunction destroyTextures(transpClass) {\n transpClass._textureToComposite = undefined;\n\n transpClass._translucentDepthStencilTexture =\n transpClass._translucentDepthStencilTexture &&\n !transpClass._translucentDepthStencilTexture.isDestroyed() &&\n transpClass._translucentDepthStencilTexture.destroy();\n}\n\nfunction destroyFramebuffers(transpClass) {\n transpClass._drawClassificationFBO.destroy();\n transpClass._accumulationFBO.destroy();\n transpClass._packFBO.destroy();\n}\n\nfunction updateTextures(transpClass, context, width, height) {\n destroyTextures(transpClass);\n\n transpClass._translucentDepthStencilTexture = new Texture({\n context: context,\n width: width,\n height: height,\n pixelFormat: PixelFormat.DEPTH_STENCIL,\n pixelDatatype: PixelDatatype.UNSIGNED_INT_24_8,\n sampler: Sampler.NEAREST,\n });\n}\n\nfunction updateFramebuffers(transpClass, context, width, height) {\n destroyFramebuffers(transpClass);\n transpClass._drawClassificationFBO.setDepthStencilTexture(\n transpClass._translucentDepthStencilTexture\n );\n transpClass._drawClassificationFBO.update(context, width, height);\n\n transpClass._accumulationFBO.setDepthStencilTexture(\n transpClass._translucentDepthStencilTexture\n );\n transpClass._accumulationFBO.update(context, width, height);\n\n transpClass._packFBO.update(context, width, height);\n}\n\nfunction updateResources(\n transpClass,\n context,\n passState,\n globeDepthStencilTexture\n) {\n if (!transpClass.isSupported()) {\n return;\n }\n\n transpClass._opaqueDepthStencilTexture = globeDepthStencilTexture;\n\n const width = transpClass._opaqueDepthStencilTexture.width;\n const height = transpClass._opaqueDepthStencilTexture.height;\n if (transpClass._drawClassificationFBO.isDirty(width, height)) {\n updateTextures(transpClass, context, width, height);\n updateFramebuffers(transpClass, context, width, height);\n }\n\n let fs;\n let uniformMap;\n\n if (!defined(transpClass._packDepthCommand)) {\n fs = new ShaderSource({\n sources: [CompareAndPackTranslucentDepth],\n });\n\n uniformMap = {\n u_opaqueDepthTexture: function () {\n return transpClass._opaqueDepthStencilTexture;\n },\n u_translucentDepthTexture: function () {\n return transpClass._translucentDepthStencilTexture;\n },\n };\n\n transpClass._packDepthCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: transpClass,\n });\n }\n\n if (!defined(transpClass._compositeCommand)) {\n fs = new ShaderSource({\n sources: [CompositeTranslucentClassification],\n });\n\n uniformMap = {\n colorTexture: function () {\n return transpClass._textureToComposite;\n },\n };\n\n if (debugShowPackedDepth) {\n fs.defines = [\"DEBUG_SHOW_DEPTH\"];\n uniformMap.u_packedTranslucentDepth = function () {\n return transpClass._packFBO.getColorTexture();\n };\n }\n\n transpClass._compositeCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: transpClass,\n });\n\n const compositeCommand = transpClass._compositeCommand;\n const compositeProgram = compositeCommand.shaderProgram;\n const compositePickProgram = context.shaderCache.createDerivedShaderProgram(\n compositeProgram,\n \"pick\",\n {\n vertexShaderSource: compositeProgram.vertexShaderSource,\n fragmentShaderSource: new ShaderSource({\n sources: fs.sources,\n defines: [\"PICK\"],\n }),\n attributeLocations: compositeProgram._attributeLocations,\n }\n );\n const compositePickCommand = DrawCommand.shallowClone(compositeCommand);\n compositePickCommand.shaderProgram = compositePickProgram;\n compositeCommand.derivedCommands.pick = compositePickCommand;\n }\n\n if (!defined(transpClass._copyCommand)) {\n fs = new ShaderSource({\n sources: [CompositeTranslucentClassification],\n });\n\n uniformMap = {\n colorTexture: function () {\n return transpClass._drawClassificationFBO.getColorTexture();\n },\n };\n\n transpClass._copyCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: transpClass,\n });\n }\n\n if (!defined(transpClass._accumulateCommand)) {\n fs = new ShaderSource({\n sources: [CompositeTranslucentClassification],\n });\n\n uniformMap = {\n colorTexture: function () {\n return transpClass._drawClassificationFBO.getColorTexture();\n },\n };\n\n transpClass._accumulateCommand = context.createViewportQuadCommand(fs, {\n uniformMap: uniformMap,\n owner: transpClass,\n });\n }\n\n transpClass._viewport.width = width;\n transpClass._viewport.height = height;\n\n const useScissorTest = !BoundingRectangle.equals(\n transpClass._viewport,\n passState.viewport\n );\n let updateScissor = useScissorTest !== transpClass._useScissorTest;\n transpClass._useScissorTest = useScissorTest;\n\n if (\n !BoundingRectangle.equals(transpClass._scissorRectangle, passState.viewport)\n ) {\n transpClass._scissorRectangle = BoundingRectangle.clone(\n passState.viewport,\n transpClass._scissorRectangle\n );\n updateScissor = true;\n }\n\n if (\n !defined(transpClass._rsDepth) ||\n !BoundingRectangle.equals(\n transpClass._viewport,\n transpClass._rsDepth.viewport\n ) ||\n updateScissor\n ) {\n transpClass._rsDepth = RenderState.fromCache({\n viewport: transpClass._viewport,\n scissorTest: {\n enabled: transpClass._useScissorTest,\n rectangle: transpClass._scissorRectangle,\n },\n });\n }\n\n if (defined(transpClass._packDepthCommand)) {\n transpClass._packDepthCommand.renderState = transpClass._rsDepth;\n }\n\n if (\n !defined(transpClass._rsAccumulate) ||\n !BoundingRectangle.equals(\n transpClass._viewport,\n transpClass._rsAccumulate.viewport\n ) ||\n updateScissor\n ) {\n transpClass._rsAccumulate = RenderState.fromCache({\n viewport: transpClass._viewport,\n scissorTest: {\n enabled: transpClass._useScissorTest,\n rectangle: transpClass._scissorRectangle,\n },\n stencilTest: {\n enabled: true,\n frontFunction: StencilFunction.EQUAL,\n reference: StencilConstants.CESIUM_3D_TILE_MASK,\n },\n });\n }\n\n if (defined(transpClass._accumulateCommand)) {\n transpClass._accumulateCommand.renderState = transpClass._rsAccumulate;\n }\n\n if (\n !defined(transpClass._rsComp) ||\n !BoundingRectangle.equals(\n transpClass._viewport,\n transpClass._rsComp.viewport\n ) ||\n updateScissor\n ) {\n transpClass._rsComp = RenderState.fromCache({\n viewport: transpClass._viewport,\n scissorTest: {\n enabled: transpClass._useScissorTest,\n rectangle: transpClass._scissorRectangle,\n },\n blending: BlendingState.ALPHA_BLEND,\n });\n }\n\n if (defined(transpClass._compositeCommand)) {\n transpClass._compositeCommand.renderState = transpClass._rsComp;\n transpClass._compositeCommand.derivedCommands.pick.renderState =\n transpClass._rsComp;\n }\n}\n\nTranslucentTileClassification.prototype.executeTranslucentCommands = function (\n scene,\n executeCommand,\n passState,\n commands,\n globeDepthStencilTexture\n) {\n // Check for translucent commands that should be classified\n const length = commands.length;\n let command;\n let i;\n\n const useLogDepth = scene.frameState.useLogDepth;\n const context = scene.context;\n const framebuffer = passState.framebuffer;\n\n for (i = 0; i < length; ++i) {\n command = commands[i];\n command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n\n if (command.depthForTranslucentClassification) {\n this._hasTranslucentDepth = true;\n break;\n }\n }\n\n if (!this._hasTranslucentDepth) {\n return;\n }\n\n updateResources(this, context, passState, globeDepthStencilTexture);\n\n // Get translucent depth\n passState.framebuffer = this._drawClassificationFBO.framebuffer;\n\n // Clear depth for multifrustum\n this._clearDepthStencilCommand.execute(context, passState);\n\n for (i = 0; i < length; ++i) {\n command = commands[i];\n command = useLogDepth ? command.derivedCommands.logDepth.command : command;\n\n if (!command.depthForTranslucentClassification) {\n continue;\n }\n\n // Depth-only commands are created for all translucent 3D Tiles commands\n const depthOnlyCommand = command.derivedCommands.depth.depthOnlyCommand;\n executeCommand(depthOnlyCommand, scene, context, passState);\n }\n\n this._frustumsDrawn += this._hasTranslucentDepth ? 1 : 0;\n\n // Pack depth if any translucent depth commands were performed\n if (this._hasTranslucentDepth) {\n passState.framebuffer = this._packFBO.framebuffer;\n this._packDepthCommand.execute(context, passState);\n }\n\n passState.framebuffer = framebuffer;\n};\n\nTranslucentTileClassification.prototype.executeClassificationCommands = function (\n scene,\n executeCommand,\n passState,\n frustumCommands\n) {\n if (!this._hasTranslucentDepth) {\n return;\n }\n\n const context = scene.context;\n const us = context.uniformState;\n const framebuffer = passState.framebuffer;\n\n if (this._frustumsDrawn === 2) {\n // copy classification from first frustum\n passState.framebuffer = this._accumulationFBO.framebuffer;\n this._copyCommand.execute(context, passState);\n }\n\n passState.framebuffer = this._drawClassificationFBO.framebuffer;\n if (this._frustumsDrawn > 1) {\n this._clearColorCommand.execute(context, passState);\n }\n\n us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n const swapGlobeDepth = us.globeDepthTexture;\n us.globeDepthTexture = this._packFBO.getColorTexture();\n const commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n const length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n for (let i = 0; i < length; ++i) {\n executeCommand(commands[i], scene, context, passState);\n }\n\n us.globeDepthTexture = swapGlobeDepth;\n passState.framebuffer = framebuffer;\n\n if (this._frustumsDrawn === 1) {\n return;\n }\n\n passState.framebuffer = this._accumulationFBO.framebuffer;\n this._accumulateCommand.execute(context, passState);\n\n passState.framebuffer = framebuffer;\n};\n\nTranslucentTileClassification.prototype.execute = function (scene, passState) {\n if (!this._hasTranslucentDepth) {\n return;\n }\n if (this._frustumsDrawn === 1) {\n this._textureToComposite = this._drawClassificationFBO.getColorTexture();\n } else {\n this._textureToComposite = this._accumulationFBO.getColorTexture();\n }\n\n const command = scene.frameState.passes.pick\n ? this._compositeCommand.derivedCommands.pick\n : this._compositeCommand;\n command.execute(scene.context, passState);\n\n clear(this, scene, passState);\n};\n\nfunction clear(translucentTileClassification, scene, passState) {\n if (!translucentTileClassification._hasTranslucentDepth) {\n return;\n }\n\n const framebuffer = passState.framebuffer;\n\n passState.framebuffer =\n translucentTileClassification._drawClassificationFBO.framebuffer;\n translucentTileClassification._clearColorCommand.execute(\n scene._context,\n passState\n );\n\n passState.framebuffer = framebuffer;\n\n if (translucentTileClassification._frustumsDrawn > 1) {\n passState.framebuffer =\n translucentTileClassification._accumulationFBO.framebuffer;\n translucentTileClassification._clearColorCommand.execute(\n scene._context,\n passState\n );\n }\n\n translucentTileClassification._hasTranslucentDepth = false;\n translucentTileClassification._frustumsDrawn = 0;\n}\n\nTranslucentTileClassification.prototype.isSupported = function () {\n return this._supported;\n};\n\nTranslucentTileClassification.prototype.isDestroyed = function () {\n return false;\n};\n\nTranslucentTileClassification.prototype.destroy = function () {\n destroyTextures(this);\n destroyFramebuffers(this);\n\n if (defined(this._compositeCommand)) {\n this._compositeCommand.shaderProgram =\n this._compositeCommand.shaderProgram &&\n this._compositeCommand.shaderProgram.destroy();\n }\n\n if (defined(this._packDepthCommand)) {\n this._packDepthCommand.shaderProgram =\n this._packDepthCommand.shaderProgram &&\n this._packDepthCommand.shaderProgram.destroy();\n }\n return destroyObject(this);\n};\n\nexport default TranslucentTileClassification;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defined from \"../Core/defined.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport Interval from \"../Core/Interval.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport Camera from \"./Camera.js\";\nimport FrustumCommands from \"./FrustumCommands.js\";\nimport GlobeDepth from \"./GlobeDepth.js\";\nimport GlobeTranslucencyFramebuffer from \"./GlobeTranslucencyFramebuffer.js\";\nimport OIT from \"./OIT.js\";\nimport PickDepthFramebuffer from \"./PickDepthFramebuffer.js\";\nimport PickFramebuffer from \"./PickFramebuffer.js\";\nimport SceneFramebuffer from \"./SceneFramebuffer.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMap from \"./ShadowMap.js\";\nimport TranslucentTileClassification from \"./TranslucentTileClassification.js\";\n\nfunction CommandExtent() {\n this.command = undefined;\n this.near = undefined;\n this.far = undefined;\n}\n\n/**\n * @private\n */\nfunction View(scene, camera, viewport) {\n const context = scene.context;\n\n let globeDepth;\n if (context.depthTexture) {\n globeDepth = new GlobeDepth();\n }\n\n let oit;\n if (scene._useOIT && context.depthTexture) {\n oit = new OIT(context);\n }\n\n const passState = new PassState(context);\n passState.viewport = BoundingRectangle.clone(viewport);\n\n this.camera = camera;\n this._cameraClone = Camera.clone(camera);\n this._cameraStartFired = false;\n this._cameraMovedTime = undefined;\n\n this.viewport = viewport;\n this.passState = passState;\n this.pickFramebuffer = new PickFramebuffer(context);\n this.pickDepthFramebuffer = new PickDepthFramebuffer();\n this.sceneFramebuffer = new SceneFramebuffer();\n this.globeDepth = globeDepth;\n this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer();\n this.oit = oit;\n this.translucentTileClassification = new TranslucentTileClassification(\n context\n );\n this.pickDepths = [];\n this.frustumCommandsList = [];\n this.debugFrustumStatistics = undefined;\n\n // Array of all commands that get rendered into frustums along with their near / far values.\n // Acts similar to a ManagedArray.\n this._commandExtents = [];\n}\n\nconst scratchPosition0 = new Cartesian3();\nconst scratchPosition1 = new Cartesian3();\nfunction maxComponent(a, b) {\n const x = Math.max(Math.abs(a.x), Math.abs(b.x));\n const y = Math.max(Math.abs(a.y), Math.abs(b.y));\n const z = Math.max(Math.abs(a.z), Math.abs(b.z));\n return Math.max(Math.max(x, y), z);\n}\n\nfunction cameraEqual(camera0, camera1, epsilon) {\n const scalar =\n 1 / Math.max(1, maxComponent(camera0.position, camera1.position));\n Cartesian3.multiplyByScalar(camera0.position, scalar, scratchPosition0);\n Cartesian3.multiplyByScalar(camera1.position, scalar, scratchPosition1);\n return (\n Cartesian3.equalsEpsilon(scratchPosition0, scratchPosition1, epsilon) &&\n Cartesian3.equalsEpsilon(camera0.direction, camera1.direction, epsilon) &&\n Cartesian3.equalsEpsilon(camera0.up, camera1.up, epsilon) &&\n Cartesian3.equalsEpsilon(camera0.right, camera1.right, epsilon) &&\n Matrix4.equalsEpsilon(camera0.transform, camera1.transform, epsilon) &&\n camera0.frustum.equalsEpsilon(camera1.frustum, epsilon)\n );\n}\n\nView.prototype.checkForCameraUpdates = function (scene) {\n const camera = this.camera;\n const cameraClone = this._cameraClone;\n if (!cameraEqual(camera, cameraClone, CesiumMath.EPSILON15)) {\n if (!this._cameraStartFired) {\n camera.moveStart.raiseEvent();\n this._cameraStartFired = true;\n }\n this._cameraMovedTime = getTimestamp();\n Camera.clone(camera, cameraClone);\n\n return true;\n }\n\n if (\n this._cameraStartFired &&\n getTimestamp() - this._cameraMovedTime > scene.cameraEventWaitTime\n ) {\n camera.moveEnd.raiseEvent();\n this._cameraStartFired = false;\n }\n\n return false;\n};\n\nfunction updateFrustums(view, scene, near, far) {\n const frameState = scene.frameState;\n const camera = frameState.camera;\n const farToNearRatio = frameState.useLogDepth\n ? scene.logarithmicDepthFarToNearRatio\n : scene.farToNearRatio;\n const is2D = scene.mode === SceneMode.SCENE2D;\n const nearToFarDistance2D = scene.nearToFarDistance2D;\n\n // Extend the far plane slightly further to prevent geometry clipping against the far plane.\n far *= 1.0 + CesiumMath.EPSILON2;\n\n // The computed near plane must be between the user defined near and far planes.\n // The computed far plane must between the user defined far and computed near.\n // This will handle the case where the computed near plane is further than the user defined far plane.\n near = Math.min(Math.max(near, camera.frustum.near), camera.frustum.far);\n far = Math.max(Math.min(far, camera.frustum.far), near);\n\n let numFrustums;\n if (is2D) {\n // The multifrustum for 2D is uniformly distributed. To avoid z-fighting in 2D,\n // the camera is moved to just before the frustum and the frustum depth is scaled\n // to be in [1.0, nearToFarDistance2D].\n far = Math.min(far, camera.position.z + scene.nearToFarDistance2D);\n near = Math.min(near, far);\n numFrustums = Math.ceil(\n Math.max(1.0, far - near) / scene.nearToFarDistance2D\n );\n } else {\n // The multifrustum for 3D/CV is non-uniformly distributed.\n numFrustums = Math.ceil(Math.log(far / near) / Math.log(farToNearRatio));\n }\n\n const frustumCommandsList = view.frustumCommandsList;\n frustumCommandsList.length = numFrustums;\n for (let m = 0; m < numFrustums; ++m) {\n let curNear;\n let curFar;\n\n if (is2D) {\n curNear = Math.min(\n far - nearToFarDistance2D,\n near + m * nearToFarDistance2D\n );\n curFar = Math.min(far, curNear + nearToFarDistance2D);\n } else {\n curNear = Math.max(near, Math.pow(farToNearRatio, m) * near);\n curFar = Math.min(far, farToNearRatio * curNear);\n }\n let frustumCommands = frustumCommandsList[m];\n if (!defined(frustumCommands)) {\n frustumCommands = frustumCommandsList[m] = new FrustumCommands(\n curNear,\n curFar\n );\n } else {\n frustumCommands.near = curNear;\n frustumCommands.far = curFar;\n }\n }\n}\n\nfunction insertIntoBin(view, scene, command, commandNear, commandFar) {\n if (scene.debugShowFrustums) {\n command.debugOverlappingFrustums = 0;\n }\n\n const frustumCommandsList = view.frustumCommandsList;\n const length = frustumCommandsList.length;\n\n for (let i = 0; i < length; ++i) {\n const frustumCommands = frustumCommandsList[i];\n const curNear = frustumCommands.near;\n const curFar = frustumCommands.far;\n\n if (commandNear > curFar) {\n continue;\n }\n\n if (commandFar < curNear) {\n break;\n }\n\n const pass = command.pass;\n const index = frustumCommands.indices[pass]++;\n frustumCommands.commands[pass][index] = command;\n\n if (scene.debugShowFrustums) {\n command.debugOverlappingFrustums |= 1 << i;\n }\n\n if (command.executeInClosestFrustum) {\n break;\n }\n }\n\n if (scene.debugShowFrustums) {\n const cf = view.debugFrustumStatistics.commandsInFrustums;\n cf[command.debugOverlappingFrustums] = defined(\n cf[command.debugOverlappingFrustums]\n )\n ? cf[command.debugOverlappingFrustums] + 1\n : 1;\n ++view.debugFrustumStatistics.totalCommands;\n }\n\n scene.updateDerivedCommands(command);\n}\n\nconst scratchCullingVolume = new CullingVolume();\nconst scratchNearFarInterval = new Interval();\n\nView.prototype.createPotentiallyVisibleSet = function (scene) {\n const frameState = scene.frameState;\n const camera = frameState.camera;\n const direction = camera.directionWC;\n const position = camera.positionWC;\n\n const computeList = scene._computeCommandList;\n const overlayList = scene._overlayCommandList;\n const commandList = frameState.commandList;\n\n if (scene.debugShowFrustums) {\n this.debugFrustumStatistics = {\n totalCommands: 0,\n commandsInFrustums: {},\n };\n }\n\n const frustumCommandsList = this.frustumCommandsList;\n const numberOfFrustums = frustumCommandsList.length;\n const numberOfPasses = Pass.NUMBER_OF_PASSES;\n for (let n = 0; n < numberOfFrustums; ++n) {\n for (let p = 0; p < numberOfPasses; ++p) {\n frustumCommandsList[n].indices[p] = 0;\n }\n }\n\n computeList.length = 0;\n overlayList.length = 0;\n\n const commandExtents = this._commandExtents;\n const commandExtentCapacity = commandExtents.length;\n let commandExtentCount = 0;\n\n let near = +Number.MAX_VALUE;\n let far = -Number.MAX_VALUE;\n\n const shadowsEnabled = frameState.shadowState.shadowsEnabled;\n let shadowNear = +Number.MAX_VALUE;\n let shadowFar = -Number.MAX_VALUE;\n let shadowClosestObjectSize = Number.MAX_VALUE;\n\n const occluder =\n frameState.mode === SceneMode.SCENE3D ? frameState.occluder : undefined;\n let cullingVolume = frameState.cullingVolume;\n\n // get user culling volume minus the far plane.\n const planes = scratchCullingVolume.planes;\n for (let k = 0; k < 5; ++k) {\n planes[k] = cullingVolume.planes[k];\n }\n cullingVolume = scratchCullingVolume;\n\n const length = commandList.length;\n for (let i = 0; i < length; ++i) {\n const command = commandList[i];\n const pass = command.pass;\n\n if (pass === Pass.COMPUTE) {\n computeList.push(command);\n } else if (pass === Pass.OVERLAY) {\n overlayList.push(command);\n } else {\n let commandNear;\n let commandFar;\n\n const boundingVolume = command.boundingVolume;\n if (defined(boundingVolume)) {\n if (!scene.isVisible(command, cullingVolume, occluder)) {\n continue;\n }\n\n const nearFarInterval = boundingVolume.computePlaneDistances(\n position,\n direction,\n scratchNearFarInterval\n );\n commandNear = nearFarInterval.start;\n commandFar = nearFarInterval.stop;\n near = Math.min(near, commandNear);\n far = Math.max(far, commandFar);\n\n // Compute a tight near and far plane for commands that receive shadows. This helps compute\n // good splits for cascaded shadow maps. Ignore commands that exceed the maximum distance.\n // When moving the camera low LOD globe tiles begin to load, whose bounding volumes\n // throw off the near/far fitting for the shadow map. Only update for globe tiles that the\n // camera isn't inside.\n if (\n shadowsEnabled &&\n command.receiveShadows &&\n commandNear < ShadowMap.MAXIMUM_DISTANCE &&\n !(pass === Pass.GLOBE && commandNear < -100.0 && commandFar > 100.0)\n ) {\n // Get the smallest bounding volume the camera is near. This is used to place more shadow detail near the object.\n const size = commandFar - commandNear;\n if (pass !== Pass.GLOBE && commandNear < 100.0) {\n shadowClosestObjectSize = Math.min(shadowClosestObjectSize, size);\n }\n shadowNear = Math.min(shadowNear, commandNear);\n shadowFar = Math.max(shadowFar, commandFar);\n }\n } else if (command instanceof ClearCommand) {\n // Clear commands don't need a bounding volume - just add the clear to all frustums.\n commandNear = camera.frustum.near;\n commandFar = camera.frustum.far;\n } else {\n // If command has no bounding volume we need to use the camera's\n // worst-case near and far planes to avoid clipping something important.\n commandNear = camera.frustum.near;\n commandFar = camera.frustum.far;\n near = Math.min(near, commandNear);\n far = Math.max(far, commandFar);\n }\n\n let extent = commandExtents[commandExtentCount];\n if (!defined(extent)) {\n extent = commandExtents[commandExtentCount] = new CommandExtent();\n }\n extent.command = command;\n extent.near = commandNear;\n extent.far = commandFar;\n commandExtentCount++;\n }\n }\n\n if (shadowsEnabled) {\n shadowNear = Math.min(\n Math.max(shadowNear, camera.frustum.near),\n camera.frustum.far\n );\n shadowFar = Math.max(Math.min(shadowFar, camera.frustum.far), shadowNear);\n }\n\n // Use the computed near and far for shadows\n if (shadowsEnabled) {\n frameState.shadowState.nearPlane = shadowNear;\n frameState.shadowState.farPlane = shadowFar;\n frameState.shadowState.closestObjectSize = shadowClosestObjectSize;\n }\n\n updateFrustums(this, scene, near, far);\n\n let c;\n let ce;\n\n for (c = 0; c < commandExtentCount; c++) {\n ce = commandExtents[c];\n insertIntoBin(this, scene, ce.command, ce.near, ce.far);\n }\n\n // Dereference old commands\n if (commandExtentCount < commandExtentCapacity) {\n for (c = commandExtentCount; c < commandExtentCapacity; c++) {\n ce = commandExtents[c];\n if (!defined(ce.command)) {\n // If the command is undefined, it's assumed that all\n // subsequent commmands were set to undefined as well,\n // so no need to loop over them all\n break;\n }\n ce.command = undefined;\n }\n }\n\n const numFrustums = frustumCommandsList.length;\n const frustumSplits = frameState.frustumSplits;\n frustumSplits.length = numFrustums + 1;\n for (let j = 0; j < numFrustums; ++j) {\n frustumSplits[j] = frustumCommandsList[j].near;\n if (j === numFrustums - 1) {\n frustumSplits[j + 1] = frustumCommandsList[j].far;\n }\n }\n};\n\nView.prototype.destroy = function () {\n this.pickFramebuffer = this.pickFramebuffer && this.pickFramebuffer.destroy();\n this.pickDepthFramebuffer =\n this.pickDepthFramebuffer && this.pickDepthFramebuffer.destroy();\n this.sceneFramebuffer =\n this.sceneFramebuffer && this.sceneFramebuffer.destroy();\n this.globeDepth = this.globeDepth && this.globeDepth.destroy();\n this.oit = this.oit && this.oit.destroy();\n this.translucentTileClassification =\n this.translucentTileClassification &&\n this.translucentTileClassification.destroy();\n this.globeTranslucencyFramebuffer =\n this.globeTranslucencyFramebuffer &&\n this.globeTranslucencyFramebuffer.destroy();\n\n let i;\n const pickDepths = this.pickDepths;\n const length = pickDepths.length;\n for (i = 0; i < length; ++i) {\n pickDepths[i].destroy();\n }\n};\nexport default View;\n", "import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\nimport BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport ShowGeometryInstanceAttribute from \"../Core/ShowGeometryInstanceAttribute.js\";\nimport Camera from \"./Camera.js\";\nimport Cesium3DTileFeature from \"./Cesium3DTileFeature.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTilePassState from \"./Cesium3DTilePassState.js\";\nimport PickDepth from \"./PickDepth.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport View from \"./View.js\";\n\nconst offscreenDefaultWidth = 0.1;\n\nconst mostDetailedPreloadTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.MOST_DETAILED_PRELOAD,\n});\n\nconst mostDetailedPickTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.MOST_DETAILED_PICK,\n});\n\nconst pickTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.PICK,\n});\n\n/**\n * @private\n */\nfunction Picking(scene) {\n this._mostDetailedRayPicks = [];\n this.pickRenderStateCache = {};\n this._pickPositionCache = {};\n this._pickPositionCacheDirty = false;\n\n const pickOffscreenViewport = new BoundingRectangle(0, 0, 1, 1);\n const pickOffscreenCamera = new Camera(scene);\n pickOffscreenCamera.frustum = new OrthographicFrustum({\n width: offscreenDefaultWidth,\n aspectRatio: 1.0,\n near: 0.1,\n });\n\n this._pickOffscreenView = new View(\n scene,\n pickOffscreenCamera,\n pickOffscreenViewport\n );\n}\n\nPicking.prototype.update = function () {\n this._pickPositionCacheDirty = true;\n};\n\nPicking.prototype.getPickDepth = function (scene, index) {\n const pickDepths = scene.view.pickDepths;\n let pickDepth = pickDepths[index];\n if (!defined(pickDepth)) {\n pickDepth = new PickDepth();\n pickDepths[index] = pickDepth;\n }\n return pickDepth;\n};\n\nconst scratchOrthoPickingFrustum = new OrthographicOffCenterFrustum();\nconst scratchOrthoOrigin = new Cartesian3();\nconst scratchOrthoDirection = new Cartesian3();\nconst scratchOrthoPixelSize = new Cartesian2();\nconst scratchOrthoPickVolumeMatrix4 = new Matrix4();\n\nfunction getPickOrthographicCullingVolume(\n scene,\n drawingBufferPosition,\n width,\n height,\n viewport\n) {\n const camera = scene.camera;\n let frustum = camera.frustum;\n if (defined(frustum._offCenterFrustum)) {\n frustum = frustum._offCenterFrustum;\n }\n\n let x = (2.0 * (drawingBufferPosition.x - viewport.x)) / viewport.width - 1.0;\n x *= (frustum.right - frustum.left) * 0.5;\n let y =\n (2.0 * (viewport.height - drawingBufferPosition.y - viewport.y)) /\n viewport.height -\n 1.0;\n y *= (frustum.top - frustum.bottom) * 0.5;\n\n const transform = Matrix4.clone(\n camera.transform,\n scratchOrthoPickVolumeMatrix4\n );\n camera._setTransform(Matrix4.IDENTITY);\n\n const origin = Cartesian3.clone(camera.position, scratchOrthoOrigin);\n Cartesian3.multiplyByScalar(camera.right, x, scratchOrthoDirection);\n Cartesian3.add(scratchOrthoDirection, origin, origin);\n Cartesian3.multiplyByScalar(camera.up, y, scratchOrthoDirection);\n Cartesian3.add(scratchOrthoDirection, origin, origin);\n\n camera._setTransform(transform);\n\n if (scene.mode === SceneMode.SCENE2D) {\n Cartesian3.fromElements(origin.z, origin.x, origin.y, origin);\n }\n\n const pixelSize = frustum.getPixelDimensions(\n viewport.width,\n viewport.height,\n 1.0,\n 1.0,\n scratchOrthoPixelSize\n );\n\n const ortho = scratchOrthoPickingFrustum;\n ortho.right = pixelSize.x * 0.5;\n ortho.left = -ortho.right;\n ortho.top = pixelSize.y * 0.5;\n ortho.bottom = -ortho.top;\n ortho.near = frustum.near;\n ortho.far = frustum.far;\n\n return ortho.computeCullingVolume(origin, camera.directionWC, camera.upWC);\n}\n\nconst scratchPerspPickingFrustum = new PerspectiveOffCenterFrustum();\nconst scratchPerspPixelSize = new Cartesian2();\n\nfunction getPickPerspectiveCullingVolume(\n scene,\n drawingBufferPosition,\n width,\n height,\n viewport\n) {\n const camera = scene.camera;\n const frustum = camera.frustum;\n const near = frustum.near;\n\n const tanPhi = Math.tan(frustum.fovy * 0.5);\n const tanTheta = frustum.aspectRatio * tanPhi;\n\n const x =\n (2.0 * (drawingBufferPosition.x - viewport.x)) / viewport.width - 1.0;\n const y =\n (2.0 * (viewport.height - drawingBufferPosition.y - viewport.y)) /\n viewport.height -\n 1.0;\n\n const xDir = x * near * tanTheta;\n const yDir = y * near * tanPhi;\n\n const pixelSize = frustum.getPixelDimensions(\n viewport.width,\n viewport.height,\n 1.0,\n 1.0,\n scratchPerspPixelSize\n );\n const pickWidth = pixelSize.x * width * 0.5;\n const pickHeight = pixelSize.y * height * 0.5;\n\n const offCenter = scratchPerspPickingFrustum;\n offCenter.top = yDir + pickHeight;\n offCenter.bottom = yDir - pickHeight;\n offCenter.right = xDir + pickWidth;\n offCenter.left = xDir - pickWidth;\n offCenter.near = near;\n offCenter.far = frustum.far;\n\n return offCenter.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n}\n\nfunction getPickCullingVolume(\n scene,\n drawingBufferPosition,\n width,\n height,\n viewport\n) {\n const frustum = scene.camera.frustum;\n if (\n frustum instanceof OrthographicFrustum ||\n frustum instanceof OrthographicOffCenterFrustum\n ) {\n return getPickOrthographicCullingVolume(\n scene,\n drawingBufferPosition,\n width,\n height,\n viewport\n );\n }\n\n return getPickPerspectiveCullingVolume(\n scene,\n drawingBufferPosition,\n width,\n height,\n viewport\n );\n}\n\n// pick rectangle width and height, assumed odd\nlet scratchRectangleWidth = 3.0;\nlet scratchRectangleHeight = 3.0;\nlet scratchRectangle = new BoundingRectangle(\n 0.0,\n 0.0,\n scratchRectangleWidth,\n scratchRectangleHeight\n);\nconst scratchPosition = new Cartesian2();\nconst scratchColorZero = new Color(0.0, 0.0, 0.0, 0.0);\n\nPicking.prototype.pick = function (scene, windowPosition, width, height) {\n scratchRectangleWidth = defaultValue(width, 3.0);\n scratchRectangleHeight = defaultValue(height, scratchRectangleWidth);\n\n const context = scene.context;\n const us = context.uniformState;\n const frameState = scene.frameState;\n\n const view = scene.defaultView;\n scene.view = view;\n\n const viewport = view.viewport;\n viewport.x = 0;\n viewport.y = 0;\n viewport.width = context.drawingBufferWidth;\n viewport.height = context.drawingBufferHeight;\n\n let passState = view.passState;\n passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer(\n scene,\n windowPosition,\n scratchPosition\n );\n\n scene.jobScheduler.disableThisFrame();\n\n scene.updateFrameState();\n frameState.cullingVolume = getPickCullingVolume(\n scene,\n drawingBufferPosition,\n scratchRectangleWidth,\n scratchRectangleHeight,\n viewport\n );\n frameState.invertClassification = false;\n frameState.passes.pick = true;\n frameState.tilesetPassState = pickTilesetPassState;\n\n us.update(frameState);\n\n scene.updateEnvironment();\n\n scratchRectangle.x =\n drawingBufferPosition.x - (scratchRectangleWidth - 1.0) * 0.5;\n scratchRectangle.y =\n scene.drawingBufferHeight -\n drawingBufferPosition.y -\n (scratchRectangleHeight - 1.0) * 0.5;\n scratchRectangle.width = scratchRectangleWidth;\n scratchRectangle.height = scratchRectangleHeight;\n passState = view.pickFramebuffer.begin(scratchRectangle, view.viewport);\n\n scene.updateAndExecuteCommands(passState, scratchColorZero);\n scene.resolveFramebuffers(passState);\n\n const object = view.pickFramebuffer.end(scratchRectangle);\n context.endFrame();\n return object;\n};\n\nfunction renderTranslucentDepthForPick(scene, drawingBufferPosition) {\n // PERFORMANCE_IDEA: render translucent only and merge with the previous frame\n const context = scene.context;\n const frameState = scene.frameState;\n const environmentState = scene.environmentState;\n\n const view = scene.defaultView;\n scene.view = view;\n\n const viewport = view.viewport;\n viewport.x = 0;\n viewport.y = 0;\n viewport.width = context.drawingBufferWidth;\n viewport.height = context.drawingBufferHeight;\n\n let passState = view.passState;\n passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n scene.clearPasses(frameState.passes);\n frameState.passes.pick = true;\n frameState.passes.depth = true;\n frameState.cullingVolume = getPickCullingVolume(\n scene,\n drawingBufferPosition,\n 1,\n 1,\n viewport\n );\n frameState.tilesetPassState = pickTilesetPassState;\n\n scene.updateEnvironment();\n environmentState.renderTranslucentDepthForPick = true;\n passState = view.pickDepthFramebuffer.update(\n context,\n drawingBufferPosition,\n viewport\n );\n\n scene.updateAndExecuteCommands(passState, scratchColorZero);\n scene.resolveFramebuffers(passState);\n\n context.endFrame();\n}\n\nconst scratchPerspectiveFrustum = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum();\nconst scratchOrthographicFrustum = new OrthographicFrustum();\nconst scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum();\n\nPicking.prototype.pickPositionWorldCoordinates = function (\n scene,\n windowPosition,\n result\n) {\n if (!scene.useDepthPicking) {\n return undefined;\n }\n\n const cacheKey = windowPosition.toString();\n\n if (this._pickPositionCacheDirty) {\n this._pickPositionCache = {};\n this._pickPositionCacheDirty = false;\n } else if (this._pickPositionCache.hasOwnProperty(cacheKey)) {\n return Cartesian3.clone(this._pickPositionCache[cacheKey], result);\n }\n\n const frameState = scene.frameState;\n const context = scene.context;\n const uniformState = context.uniformState;\n\n const view = scene.defaultView;\n scene.view = view;\n\n const drawingBufferPosition = SceneTransforms.transformWindowToDrawingBuffer(\n scene,\n windowPosition,\n scratchPosition\n );\n if (scene.pickTranslucentDepth) {\n renderTranslucentDepthForPick(scene, drawingBufferPosition);\n } else {\n scene.updateFrameState();\n uniformState.update(frameState);\n scene.updateEnvironment();\n }\n drawingBufferPosition.y = scene.drawingBufferHeight - drawingBufferPosition.y;\n\n const camera = scene.camera;\n\n // Create a working frustum from the original camera frustum.\n let frustum;\n if (defined(camera.frustum.fov)) {\n frustum = camera.frustum.clone(scratchPerspectiveFrustum);\n } else if (defined(camera.frustum.infiniteProjectionMatrix)) {\n frustum = camera.frustum.clone(scratchPerspectiveOffCenterFrustum);\n } else if (defined(camera.frustum.width)) {\n frustum = camera.frustum.clone(scratchOrthographicFrustum);\n } else {\n frustum = camera.frustum.clone(scratchOrthographicOffCenterFrustum);\n }\n\n const frustumCommandsList = view.frustumCommandsList;\n const numFrustums = frustumCommandsList.length;\n for (let i = 0; i < numFrustums; ++i) {\n const pickDepth = this.getPickDepth(scene, i);\n const depth = pickDepth.getDepth(\n context,\n drawingBufferPosition.x,\n drawingBufferPosition.y\n );\n if (!defined(depth)) {\n continue;\n }\n if (depth > 0.0 && depth < 1.0) {\n const renderedFrustum = frustumCommandsList[i];\n let height2D;\n if (scene.mode === SceneMode.SCENE2D) {\n height2D = camera.position.z;\n camera.position.z = height2D - renderedFrustum.near + 1.0;\n frustum.far = Math.max(1.0, renderedFrustum.far - renderedFrustum.near);\n frustum.near = 1.0;\n uniformState.update(frameState);\n uniformState.updateFrustum(frustum);\n } else {\n frustum.near =\n renderedFrustum.near *\n (i !== 0 ? scene.opaqueFrustumNearOffset : 1.0);\n frustum.far = renderedFrustum.far;\n uniformState.updateFrustum(frustum);\n }\n\n result = SceneTransforms.drawingBufferToWgs84Coordinates(\n scene,\n drawingBufferPosition,\n depth,\n result\n );\n\n if (scene.mode === SceneMode.SCENE2D) {\n camera.position.z = height2D;\n uniformState.update(frameState);\n }\n\n this._pickPositionCache[cacheKey] = Cartesian3.clone(result);\n return result;\n }\n }\n\n this._pickPositionCache[cacheKey] = undefined;\n return undefined;\n};\n\nconst scratchPickPositionCartographic = new Cartographic();\n\nPicking.prototype.pickPosition = function (scene, windowPosition, result) {\n result = this.pickPositionWorldCoordinates(scene, windowPosition, result);\n if (defined(result) && scene.mode !== SceneMode.SCENE3D) {\n Cartesian3.fromElements(result.y, result.z, result.x, result);\n\n const projection = scene.mapProjection;\n const ellipsoid = projection.ellipsoid;\n\n const cart = projection.unproject(result, scratchPickPositionCartographic);\n ellipsoid.cartographicToCartesian(cart, result);\n }\n\n return result;\n};\n\nfunction drillPick(limit, pickCallback) {\n // PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead\n // we could update the primitive once, and then just execute their commands for each pass,\n // and cull commands for picked primitives. e.g., base on the command's owner.\n let i;\n let attributes;\n const result = [];\n const pickedPrimitives = [];\n const pickedAttributes = [];\n const pickedFeatures = [];\n if (!defined(limit)) {\n limit = Number.MAX_VALUE;\n }\n\n let pickedResult = pickCallback();\n while (defined(pickedResult)) {\n const object = pickedResult.object;\n const position = pickedResult.position;\n const exclude = pickedResult.exclude;\n\n if (defined(position) && !defined(object)) {\n result.push(pickedResult);\n break;\n }\n\n if (!defined(object) || !defined(object.primitive)) {\n break;\n }\n\n if (!exclude) {\n result.push(pickedResult);\n if (0 >= --limit) {\n break;\n }\n }\n\n const primitive = object.primitive;\n let hasShowAttribute = false;\n\n // If the picked object has a show attribute, use it.\n if (typeof primitive.getGeometryInstanceAttributes === \"function\") {\n if (defined(object.id)) {\n attributes = primitive.getGeometryInstanceAttributes(object.id);\n if (defined(attributes) && defined(attributes.show)) {\n hasShowAttribute = true;\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n false,\n attributes.show\n );\n pickedAttributes.push(attributes);\n }\n }\n }\n\n if (object instanceof Cesium3DTileFeature) {\n hasShowAttribute = true;\n object.show = false;\n pickedFeatures.push(object);\n }\n\n // Otherwise, hide the entire primitive\n if (!hasShowAttribute) {\n primitive.show = false;\n pickedPrimitives.push(primitive);\n }\n\n pickedResult = pickCallback();\n }\n\n // Unhide everything we hid while drill picking\n for (i = 0; i < pickedPrimitives.length; ++i) {\n pickedPrimitives[i].show = true;\n }\n\n for (i = 0; i < pickedAttributes.length; ++i) {\n attributes = pickedAttributes[i];\n attributes.show = ShowGeometryInstanceAttribute.toValue(\n true,\n attributes.show\n );\n }\n\n for (i = 0; i < pickedFeatures.length; ++i) {\n pickedFeatures[i].show = true;\n }\n\n return result;\n}\n\nPicking.prototype.drillPick = function (\n scene,\n windowPosition,\n limit,\n width,\n height\n) {\n const that = this;\n const pickCallback = function () {\n const object = that.pick(scene, windowPosition, width, height);\n if (defined(object)) {\n return {\n object: object,\n position: undefined,\n exclude: false,\n };\n }\n };\n const objects = drillPick(limit, pickCallback);\n return objects.map(function (element) {\n return element.object;\n });\n};\n\nconst scratchRight = new Cartesian3();\nconst scratchUp = new Cartesian3();\n\nfunction MostDetailedRayPick(ray, width, tilesets) {\n this.ray = ray;\n this.width = width;\n this.tilesets = tilesets;\n this.ready = false;\n const pick = this;\n this.promise = new Promise((resolve) => {\n pick._completePick = () => {\n resolve();\n };\n });\n}\n\nfunction updateOffscreenCameraFromRay(picking, ray, width, camera) {\n const direction = ray.direction;\n const orthogonalAxis = Cartesian3.mostOrthogonalAxis(direction, scratchRight);\n const right = Cartesian3.cross(direction, orthogonalAxis, scratchRight);\n const up = Cartesian3.cross(direction, right, scratchUp);\n\n camera.position = ray.origin;\n camera.direction = direction;\n camera.up = up;\n camera.right = right;\n\n camera.frustum.width = defaultValue(width, offscreenDefaultWidth);\n return camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n}\n\nfunction updateMostDetailedRayPick(picking, scene, rayPick) {\n const frameState = scene.frameState;\n\n const ray = rayPick.ray;\n const width = rayPick.width;\n const tilesets = rayPick.tilesets;\n\n const camera = picking._pickOffscreenView.camera;\n const cullingVolume = updateOffscreenCameraFromRay(\n picking,\n ray,\n width,\n camera\n );\n\n const tilesetPassState = mostDetailedPreloadTilesetPassState;\n tilesetPassState.camera = camera;\n tilesetPassState.cullingVolume = cullingVolume;\n\n let ready = true;\n const tilesetsLength = tilesets.length;\n for (let i = 0; i < tilesetsLength; ++i) {\n const tileset = tilesets[i];\n if (tileset.show && scene.primitives.contains(tileset)) {\n // Only update tilesets that are still contained in the scene's primitive collection and are still visible\n // Update tilesets continually until all tilesets are ready. This way tiles are never removed from the cache.\n tileset.updateForPass(frameState, tilesetPassState);\n ready = ready && tilesetPassState.ready;\n }\n }\n\n if (ready) {\n rayPick._completePick();\n }\n\n return ready;\n}\n\nPicking.prototype.updateMostDetailedRayPicks = function (scene) {\n // Modifies array during iteration\n const rayPicks = this._mostDetailedRayPicks;\n for (let i = 0; i < rayPicks.length; ++i) {\n if (updateMostDetailedRayPick(this, scene, rayPicks[i])) {\n rayPicks.splice(i--, 1);\n }\n }\n};\n\nfunction getTilesets(primitives, objectsToExclude, tilesets) {\n const length = primitives.length;\n for (let i = 0; i < length; ++i) {\n const primitive = primitives.get(i);\n if (primitive.show) {\n if (defined(primitive.isCesium3DTileset)) {\n if (\n !defined(objectsToExclude) ||\n objectsToExclude.indexOf(primitive) === -1\n ) {\n tilesets.push(primitive);\n }\n } else if (primitive instanceof PrimitiveCollection) {\n getTilesets(primitive, objectsToExclude, tilesets);\n }\n }\n }\n}\n\nfunction launchMostDetailedRayPick(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n callback\n) {\n const tilesets = [];\n getTilesets(scene.primitives, objectsToExclude, tilesets);\n if (tilesets.length === 0) {\n return Promise.resolve(callback());\n }\n\n const rayPick = new MostDetailedRayPick(ray, width, tilesets);\n picking._mostDetailedRayPicks.push(rayPick);\n return rayPick.promise.then(function () {\n return callback();\n });\n}\n\nfunction isExcluded(object, objectsToExclude) {\n if (\n !defined(object) ||\n !defined(objectsToExclude) ||\n objectsToExclude.length === 0\n ) {\n return false;\n }\n return (\n objectsToExclude.indexOf(object) > -1 ||\n objectsToExclude.indexOf(object.primitive) > -1 ||\n objectsToExclude.indexOf(object.id) > -1\n );\n}\n\nfunction getRayIntersection(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n) {\n const context = scene.context;\n const uniformState = context.uniformState;\n const frameState = scene.frameState;\n\n const view = picking._pickOffscreenView;\n scene.view = view;\n\n updateOffscreenCameraFromRay(picking, ray, width, view.camera);\n\n scratchRectangle = BoundingRectangle.clone(view.viewport, scratchRectangle);\n\n const passState = view.pickFramebuffer.begin(scratchRectangle, view.viewport);\n\n scene.jobScheduler.disableThisFrame();\n\n scene.updateFrameState();\n frameState.invertClassification = false;\n frameState.passes.pick = true;\n frameState.passes.offscreen = true;\n\n if (mostDetailed) {\n frameState.tilesetPassState = mostDetailedPickTilesetPassState;\n } else {\n frameState.tilesetPassState = pickTilesetPassState;\n }\n\n uniformState.update(frameState);\n\n scene.updateEnvironment();\n scene.updateAndExecuteCommands(passState, scratchColorZero);\n scene.resolveFramebuffers(passState);\n\n let position;\n const object = view.pickFramebuffer.end(scratchRectangle);\n\n if (scene.context.depthTexture) {\n const numFrustums = view.frustumCommandsList.length;\n for (let i = 0; i < numFrustums; ++i) {\n const pickDepth = picking.getPickDepth(scene, i);\n const depth = pickDepth.getDepth(context, 0, 0);\n if (!defined(depth)) {\n continue;\n }\n if (depth > 0.0 && depth < 1.0) {\n const renderedFrustum = view.frustumCommandsList[i];\n const near =\n renderedFrustum.near *\n (i !== 0 ? scene.opaqueFrustumNearOffset : 1.0);\n const far = renderedFrustum.far;\n const distance = near + depth * (far - near);\n position = Ray.getPoint(ray, distance);\n break;\n }\n }\n }\n\n scene.view = scene.defaultView;\n context.endFrame();\n\n if (defined(object) || defined(position)) {\n return {\n object: object,\n position: position,\n exclude:\n (!defined(position) && requirePosition) ||\n isExcluded(object, objectsToExclude),\n };\n }\n}\n\nfunction getRayIntersections(\n picking,\n scene,\n ray,\n limit,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n) {\n const pickCallback = function () {\n return getRayIntersection(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n );\n };\n return drillPick(limit, pickCallback);\n}\n\nfunction pickFromRay(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n) {\n const results = getRayIntersections(\n picking,\n scene,\n ray,\n 1,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n );\n if (results.length > 0) {\n return results[0];\n }\n}\n\nfunction drillPickFromRay(\n picking,\n scene,\n ray,\n limit,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n) {\n return getRayIntersections(\n picking,\n scene,\n ray,\n limit,\n objectsToExclude,\n width,\n requirePosition,\n mostDetailed\n );\n}\n\nfunction deferPromiseUntilPostRender(scene, promise) {\n // Resolve promise after scene's postRender in case entities are created when the promise resolves.\n // Entities can't be created between viewer._onTick and viewer._postRender.\n return new Promise((resolve, reject) => {\n promise\n .then(function (result) {\n const removeCallback = scene.postRender.addEventListener(function () {\n removeCallback();\n resolve(result);\n });\n scene.requestRender();\n })\n .catch(function (error) {\n reject(error);\n });\n });\n}\n\nPicking.prototype.pickFromRay = function (scene, ray, objectsToExclude, width) {\n return pickFromRay(this, scene, ray, objectsToExclude, width, false, false);\n};\n\nPicking.prototype.drillPickFromRay = function (\n scene,\n ray,\n limit,\n objectsToExclude,\n width\n) {\n return drillPickFromRay(\n this,\n scene,\n ray,\n limit,\n objectsToExclude,\n width,\n false,\n false\n );\n};\n\nPicking.prototype.pickFromRayMostDetailed = function (\n scene,\n ray,\n objectsToExclude,\n width\n) {\n const that = this;\n ray = Ray.clone(ray);\n objectsToExclude = defined(objectsToExclude)\n ? objectsToExclude.slice()\n : objectsToExclude;\n return deferPromiseUntilPostRender(\n scene,\n launchMostDetailedRayPick(\n that,\n scene,\n ray,\n objectsToExclude,\n width,\n function () {\n return pickFromRay(\n that,\n scene,\n ray,\n objectsToExclude,\n width,\n false,\n true\n );\n }\n )\n );\n};\n\nPicking.prototype.drillPickFromRayMostDetailed = function (\n scene,\n ray,\n limit,\n objectsToExclude,\n width\n) {\n const that = this;\n ray = Ray.clone(ray);\n objectsToExclude = defined(objectsToExclude)\n ? objectsToExclude.slice()\n : objectsToExclude;\n return deferPromiseUntilPostRender(\n scene,\n launchMostDetailedRayPick(\n that,\n scene,\n ray,\n objectsToExclude,\n width,\n function () {\n return drillPickFromRay(\n that,\n scene,\n ray,\n limit,\n objectsToExclude,\n width,\n false,\n true\n );\n }\n )\n );\n};\n\nconst scratchSurfacePosition = new Cartesian3();\nconst scratchSurfaceNormal = new Cartesian3();\nconst scratchSurfaceRay = new Ray();\nconst scratchCartographic = new Cartographic();\n\nfunction getRayForSampleHeight(scene, cartographic) {\n const globe = scene.globe;\n const ellipsoid = defined(globe)\n ? globe.ellipsoid\n : scene.mapProjection.ellipsoid;\n const height = ApproximateTerrainHeights._defaultMaxTerrainHeight;\n const surfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(\n cartographic,\n scratchSurfaceNormal\n );\n const surfacePosition = Cartographic.toCartesian(\n cartographic,\n ellipsoid,\n scratchSurfacePosition\n );\n const surfaceRay = scratchSurfaceRay;\n surfaceRay.origin = surfacePosition;\n surfaceRay.direction = surfaceNormal;\n const ray = new Ray();\n Ray.getPoint(surfaceRay, height, ray.origin);\n Cartesian3.negate(surfaceNormal, ray.direction);\n return ray;\n}\n\nfunction getRayForClampToHeight(scene, cartesian) {\n const globe = scene.globe;\n const ellipsoid = defined(globe)\n ? globe.ellipsoid\n : scene.mapProjection.ellipsoid;\n const cartographic = Cartographic.fromCartesian(\n cartesian,\n ellipsoid,\n scratchCartographic\n );\n return getRayForSampleHeight(scene, cartographic);\n}\n\nfunction getHeightFromCartesian(scene, cartesian) {\n const globe = scene.globe;\n const ellipsoid = defined(globe)\n ? globe.ellipsoid\n : scene.mapProjection.ellipsoid;\n const cartographic = Cartographic.fromCartesian(\n cartesian,\n ellipsoid,\n scratchCartographic\n );\n return cartographic.height;\n}\n\nfunction sampleHeightMostDetailed(\n picking,\n scene,\n cartographic,\n objectsToExclude,\n width\n) {\n const ray = getRayForSampleHeight(scene, cartographic);\n return launchMostDetailedRayPick(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n function () {\n const pickResult = pickFromRay(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n true,\n true\n );\n if (defined(pickResult)) {\n return getHeightFromCartesian(scene, pickResult.position);\n }\n }\n );\n}\n\nfunction clampToHeightMostDetailed(\n picking,\n scene,\n cartesian,\n objectsToExclude,\n width,\n result\n) {\n const ray = getRayForClampToHeight(scene, cartesian);\n return launchMostDetailedRayPick(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n function () {\n const pickResult = pickFromRay(\n picking,\n scene,\n ray,\n objectsToExclude,\n width,\n true,\n true\n );\n if (defined(pickResult)) {\n return Cartesian3.clone(pickResult.position, result);\n }\n }\n );\n}\n\nPicking.prototype.sampleHeight = function (\n scene,\n position,\n objectsToExclude,\n width\n) {\n const ray = getRayForSampleHeight(scene, position);\n const pickResult = pickFromRay(\n this,\n scene,\n ray,\n objectsToExclude,\n width,\n true,\n false\n );\n if (defined(pickResult)) {\n return getHeightFromCartesian(scene, pickResult.position);\n }\n};\n\nPicking.prototype.clampToHeight = function (\n scene,\n cartesian,\n objectsToExclude,\n width,\n result\n) {\n const ray = getRayForClampToHeight(scene, cartesian);\n const pickResult = pickFromRay(\n this,\n scene,\n ray,\n objectsToExclude,\n width,\n true,\n false\n );\n if (defined(pickResult)) {\n return Cartesian3.clone(pickResult.position, result);\n }\n};\n\nPicking.prototype.sampleHeightMostDetailed = function (\n scene,\n positions,\n objectsToExclude,\n width\n) {\n objectsToExclude = defined(objectsToExclude)\n ? objectsToExclude.slice()\n : objectsToExclude;\n const length = positions.length;\n const promises = new Array(length);\n for (let i = 0; i < length; ++i) {\n promises[i] = sampleHeightMostDetailed(\n this,\n scene,\n positions[i],\n objectsToExclude,\n width\n );\n }\n return deferPromiseUntilPostRender(\n scene,\n Promise.all(promises).then(function (heights) {\n const length = heights.length;\n for (let i = 0; i < length; ++i) {\n positions[i].height = heights[i];\n }\n return positions;\n })\n );\n};\n\nPicking.prototype.clampToHeightMostDetailed = function (\n scene,\n cartesians,\n objectsToExclude,\n width\n) {\n objectsToExclude = defined(objectsToExclude)\n ? objectsToExclude.slice()\n : objectsToExclude;\n const length = cartesians.length;\n const promises = new Array(length);\n for (let i = 0; i < length; ++i) {\n promises[i] = clampToHeightMostDetailed(\n this,\n scene,\n cartesians[i],\n objectsToExclude,\n width,\n cartesians[i]\n );\n }\n return deferPromiseUntilPostRender(\n scene,\n Promise.all(promises).then(function (clampedCartesians) {\n const length = clampedCartesians.length;\n for (let i = 0; i < length; ++i) {\n cartesians[i] = clampedCartesians[i];\n }\n return cartesians;\n })\n );\n};\n\nPicking.prototype.destroy = function () {\n this._pickOffscreenView =\n this._pickOffscreenView && this._pickOffscreenView.destroy();\n};\nexport default Picking;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Check from \"../Core/Check.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport RuntimeError from \"../Core/RuntimeError.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport MersenneTwister from \"mersenne-twister\";\nimport BlendingState from \"./BlendingState.js\";\nimport Cesium3DTileBatchTable from \"./Cesium3DTileBatchTable.js\";\nimport DracoLoader from \"./DracoLoader.js\";\nimport getClipAndStyleCode from \"./getClipAndStyleCode.js\";\nimport getClippingFunction from \"./getClippingFunction.js\";\nimport PntsParser from \"./PntsParser.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\nimport SplitDirection from \"./SplitDirection.js\";\nimport Splitter from \"./Splitter.js\";\nimport StencilConstants from \"./StencilConstants.js\";\n\nconst DecodingState = {\n NEEDS_DECODE: 0,\n DECODING: 1,\n READY: 2,\n FAILED: 3,\n};\n\n/**\n * Represents the contents of a\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/PointCloud|Point Cloud}\n * tile. Used internally by {@link TimeDynamicPointCloud}.\n *\n * @alias PointCloud\n * @constructor\n *\n * @see TimeDynamicPointCloud\n *\n * @private\n */\nfunction PointCloud(options) {\n // Hold onto the payload until the render resources are created\n this._parsedContent = undefined;\n\n this._drawCommand = undefined;\n this._isTranslucent = false;\n this._styleTranslucent = false;\n this._constantColor = Color.clone(Color.DARKGRAY);\n this._highlightColor = Color.clone(Color.WHITE);\n this._pointSize = 1.0;\n\n this._rtcCenter = undefined;\n this._quantizedVolumeScale = undefined;\n this._quantizedVolumeOffset = undefined;\n\n // These values are used to regenerate the shader when the style changes\n this._styleableShaderAttributes = undefined;\n this._isQuantized = false;\n this._isOctEncoded16P = false;\n this._isRGB565 = false;\n this._hasColors = false;\n this._hasNormals = false;\n this._hasBatchIds = false;\n\n // Draco\n this._decodingState = DecodingState.READY;\n this._dequantizeInShader = true;\n this._isQuantizedDraco = false;\n this._isOctEncodedDraco = false;\n this._quantizedRange = 0.0;\n this._octEncodedRange = 0.0;\n\n // Use per-point normals to hide back-facing points.\n this.backFaceCulling = false;\n this._backFaceCulling = false;\n\n // Whether to enable normal shading\n this.normalShading = true;\n this._normalShading = true;\n\n this._opaqueRenderState = undefined;\n this._translucentRenderState = undefined;\n\n this._mode = undefined;\n\n this._ready = false;\n this._pointsLength = 0;\n this._geometryByteLength = 0;\n\n this._vertexShaderLoaded = options.vertexShaderLoaded;\n this._fragmentShaderLoaded = options.fragmentShaderLoaded;\n this._uniformMapLoaded = options.uniformMapLoaded;\n this._batchTableLoaded = options.batchTableLoaded;\n this._pickIdLoaded = options.pickIdLoaded;\n this._opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);\n this._cull = defaultValue(options.cull, true);\n\n this.style = undefined;\n this._style = undefined;\n this.styleDirty = false;\n\n this.modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n this._modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\n\n this.time = 0.0; // For styling\n this.shadows = ShadowMode.ENABLED;\n this._boundingSphere = undefined;\n\n this.clippingPlanes = undefined;\n this.isClipped = false;\n this.clippingPlanesDirty = false;\n // If defined, use this matrix to position the clipping planes instead of the modelMatrix.\n // This is so that when point clouds are part of a tileset they all get clipped relative\n // to the root tile.\n this.clippingPlanesOriginMatrix = undefined;\n\n this.attenuation = false;\n this._attenuation = false;\n\n // Options for geometric error based attenuation\n this.geometricError = 0.0;\n this.geometricErrorScale = 1.0;\n this.maximumAttenuation = this._pointSize;\n\n /**\n * The {@link SplitDirection} to apply to this point cloud.\n *\n * @type {SplitDirection}\n * @default {@link SplitDirection.NONE}\n */\n this.splitDirection = defaultValue(\n options.splitDirection,\n SplitDirection.NONE\n );\n this._splittingEnabled = false;\n\n this._resolveReadyPromise = undefined;\n this._rejectReadyPromise = undefined;\n this._readyPromise = initialize(this, options);\n}\n\nObject.defineProperties(PointCloud.prototype, {\n pointsLength: {\n get: function () {\n return this._pointsLength;\n },\n },\n\n geometryByteLength: {\n get: function () {\n return this._geometryByteLength;\n },\n },\n\n ready: {\n get: function () {\n return this._ready;\n },\n },\n\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n color: {\n get: function () {\n return Color.clone(this._highlightColor);\n },\n set: function (value) {\n this._highlightColor = Color.clone(value, this._highlightColor);\n },\n },\n\n boundingSphere: {\n get: function () {\n if (defined(this._drawCommand)) {\n return this._drawCommand.boundingVolume;\n }\n return undefined;\n },\n set: function (value) {\n this._boundingSphere = BoundingSphere.clone(value, this._boundingSphere);\n },\n },\n});\n\nfunction initialize(pointCloud, options) {\n const parsedContent = PntsParser.parse(\n options.arrayBuffer,\n options.byteOffset\n );\n pointCloud._parsedContent = parsedContent;\n pointCloud._rtcCenter = parsedContent.rtcCenter;\n pointCloud._hasNormals = parsedContent.hasNormals;\n pointCloud._hasColors = parsedContent.hasColors;\n pointCloud._hasBatchIds = parsedContent.hasBatchIds;\n pointCloud._isTranslucent = parsedContent.isTranslucent;\n\n // If points are not batched and there are per-point properties, use the\n // properties as metadata for styling purposes.\n if (!parsedContent.hasBatchIds && defined(parsedContent.batchTableBinary)) {\n parsedContent.styleableProperties = Cesium3DTileBatchTable.getBinaryProperties(\n parsedContent.pointsLength,\n parsedContent.batchTableJson,\n parsedContent.batchTableBinary\n );\n }\n\n if (defined(parsedContent.draco)) {\n const draco = parsedContent.draco;\n pointCloud._decodingState = DecodingState.NEEDS_DECODE;\n draco.dequantizeInShader = pointCloud._dequantizeInShader;\n }\n\n const positions = parsedContent.positions;\n if (defined(positions)) {\n pointCloud._isQuantized = positions.isQuantized;\n pointCloud._quantizedVolumeScale = positions.quantizedVolumeScale;\n pointCloud._quantizedVolumeOffset = positions.quantizedVolumeOffset;\n pointCloud._quantizedRange = positions.quantizedRange;\n }\n\n const normals = parsedContent.normals;\n if (defined(normals)) {\n pointCloud._isOctEncoded16P = normals.octEncoded;\n }\n\n const colors = parsedContent.colors;\n if (defined(colors)) {\n if (defined(colors.constantColor)) {\n pointCloud._constantColor = Color.clone(\n colors.constantColor,\n pointCloud._constantColor\n );\n\n // Constant colors are handled as a uniform rather than a vertex\n // attribute.\n pointCloud._hasColors = false;\n }\n pointCloud._isRGB565 = colors.isRGB565;\n }\n\n // PntsParser parses BATCH_ID as _FEATURE_ID_0 for EXT_mesh_features.\n // These properties aren't used but rename them to BATCH_ID to avoid\n // confusion when debugging.\n const batchIds = parsedContent.batchIds;\n if (defined(parsedContent.batchIds)) {\n batchIds.name = \"BATCH_ID\";\n batchIds.semantic = \"BATCH_ID\";\n batchIds.setIndex = undefined;\n }\n\n if (parsedContent.hasBatchIds) {\n pointCloud._batchTableLoaded(\n parsedContent.batchLength,\n parsedContent.batchTableJson,\n parsedContent.batchTableBinary\n );\n }\n\n pointCloud._pointsLength = parsedContent.pointsLength;\n\n return new Promise(function (resolve, reject) {\n pointCloud._resolveReadyPromise = function () {\n pointCloud._ready = true;\n resolve(pointCloud);\n };\n pointCloud._rejectReadyPromise = reject;\n });\n}\n\nconst scratchMin = new Cartesian3();\nconst scratchMax = new Cartesian3();\nconst scratchPosition = new Cartesian3();\n\n// Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n// See https://github.com/CesiumGS/cesium/issues/9730\nlet randomNumberGenerator;\nlet randomValues;\n\nfunction getRandomValues(samplesLength) {\n // Use same random values across all runs\n if (!defined(randomValues)) {\n // Use MersenneTwister directly to avoid interfering with CesiumMath.nextRandomNumber()\n // See https://github.com/CesiumGS/cesium/issues/9730\n randomNumberGenerator = new MersenneTwister(0);\n randomValues = new Array(samplesLength);\n for (let i = 0; i < samplesLength; ++i) {\n randomValues[i] = randomNumberGenerator.random();\n }\n }\n return randomValues;\n}\n\nfunction computeApproximateBoundingSphereFromPositions(positions) {\n const maximumSamplesLength = 20;\n const pointsLength = positions.length / 3;\n const samplesLength = Math.min(pointsLength, maximumSamplesLength);\n const randomValues = getRandomValues(maximumSamplesLength);\n const maxValue = Number.MAX_VALUE;\n const minValue = -Number.MAX_VALUE;\n const min = Cartesian3.fromElements(maxValue, maxValue, maxValue, scratchMin);\n const max = Cartesian3.fromElements(minValue, minValue, minValue, scratchMax);\n for (let i = 0; i < samplesLength; ++i) {\n const index = Math.floor(randomValues[i] * pointsLength);\n const position = Cartesian3.unpack(positions, index * 3, scratchPosition);\n Cartesian3.minimumByComponent(min, position, min);\n Cartesian3.maximumByComponent(max, position, max);\n }\n\n const boundingSphere = BoundingSphere.fromCornerPoints(min, max);\n boundingSphere.radius += CesiumMath.EPSILON2; // To avoid radius of zero\n return boundingSphere;\n}\n\nfunction prepareVertexAttribute(typedArray, name) {\n // WebGL does not support UNSIGNED_INT, INT, or DOUBLE vertex attributes. Convert these to FLOAT.\n const componentDatatype = ComponentDatatype.fromTypedArray(typedArray);\n if (\n componentDatatype === ComponentDatatype.INT ||\n componentDatatype === ComponentDatatype.UNSIGNED_INT ||\n componentDatatype === ComponentDatatype.DOUBLE\n ) {\n oneTimeWarning(\n \"Cast pnts property to floats\",\n `Point cloud property \"${name}\" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`\n );\n return new Float32Array(typedArray);\n }\n return typedArray;\n}\n\nconst scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier = new Cartesian4();\nconst scratchQuantizedVolumeScaleAndOctEncodedRange = new Cartesian4();\nconst scratchColor = new Color();\n\nconst positionLocation = 0;\nconst colorLocation = 1;\nconst normalLocation = 2;\nconst batchIdLocation = 3;\nconst numberOfAttributes = 4;\n\nconst scratchClippingPlanesMatrix = new Matrix4();\nconst scratchInverseTransposeClippingPlanesMatrix = new Matrix4();\n\nfunction createResources(pointCloud, frameState) {\n const context = frameState.context;\n const parsedContent = pointCloud._parsedContent;\n const pointsLength = pointCloud._pointsLength;\n const positions = parsedContent.positions;\n const colors = parsedContent.colors;\n const normals = parsedContent.normals;\n const batchIds = parsedContent.batchIds;\n const styleableProperties = parsedContent.styleableProperties;\n const hasStyleableProperties = defined(styleableProperties);\n const isQuantized = pointCloud._isQuantized;\n const isQuantizedDraco = pointCloud._isQuantizedDraco;\n const isOctEncoded16P = pointCloud._isOctEncoded16P;\n const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n const quantizedRange = pointCloud._quantizedRange;\n const octEncodedRange = pointCloud._octEncodedRange;\n const isRGB565 = pointCloud._isRGB565;\n const isTranslucent = pointCloud._isTranslucent;\n const hasColors = pointCloud._hasColors;\n const hasNormals = pointCloud._hasNormals;\n const hasBatchIds = pointCloud._hasBatchIds;\n\n let componentsPerAttribute;\n let componentDatatype;\n\n const styleableVertexAttributes = [];\n const styleableShaderAttributes = {};\n pointCloud._styleableShaderAttributes = styleableShaderAttributes;\n\n if (hasStyleableProperties) {\n let attributeLocation = numberOfAttributes;\n\n for (const name in styleableProperties) {\n if (styleableProperties.hasOwnProperty(name)) {\n const property = styleableProperties[name];\n const typedArray = prepareVertexAttribute(property.typedArray, name);\n componentsPerAttribute = property.componentCount;\n componentDatatype = ComponentDatatype.fromTypedArray(typedArray);\n\n const vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n\n pointCloud._geometryByteLength += vertexBuffer.sizeInBytes;\n\n const vertexAttribute = {\n index: attributeLocation,\n vertexBuffer: vertexBuffer,\n componentsPerAttribute: componentsPerAttribute,\n componentDatatype: componentDatatype,\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: 0,\n };\n\n styleableVertexAttributes.push(vertexAttribute);\n styleableShaderAttributes[name] = {\n location: attributeLocation,\n componentCount: componentsPerAttribute,\n };\n ++attributeLocation;\n }\n }\n }\n\n const positionsVertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: positions.typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n pointCloud._geometryByteLength += positionsVertexBuffer.sizeInBytes;\n\n let colorsVertexBuffer;\n if (hasColors) {\n colorsVertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: colors.typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n pointCloud._geometryByteLength += colorsVertexBuffer.sizeInBytes;\n }\n\n let normalsVertexBuffer;\n if (hasNormals) {\n normalsVertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: normals.typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n pointCloud._geometryByteLength += normalsVertexBuffer.sizeInBytes;\n }\n\n let batchIdsVertexBuffer;\n if (hasBatchIds) {\n batchIds.typedArray = prepareVertexAttribute(\n batchIds.typedArray,\n \"batchIds\"\n );\n batchIdsVertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: batchIds.typedArray,\n usage: BufferUsage.STATIC_DRAW,\n });\n pointCloud._geometryByteLength += batchIdsVertexBuffer.sizeInBytes;\n }\n\n let attributes = [];\n\n if (isQuantized) {\n componentDatatype = ComponentDatatype.UNSIGNED_SHORT;\n } else if (isQuantizedDraco) {\n componentDatatype =\n quantizedRange <= 255\n ? ComponentDatatype.UNSIGNED_BYTE\n : ComponentDatatype.UNSIGNED_SHORT;\n } else {\n componentDatatype = ComponentDatatype.FLOAT;\n }\n\n attributes.push({\n index: positionLocation,\n vertexBuffer: positionsVertexBuffer,\n componentsPerAttribute: 3,\n componentDatatype: componentDatatype,\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: 0,\n });\n\n if (pointCloud._cull) {\n if (isQuantized || isQuantizedDraco) {\n pointCloud._boundingSphere = BoundingSphere.fromCornerPoints(\n Cartesian3.ZERO,\n pointCloud._quantizedVolumeScale\n );\n } else {\n pointCloud._boundingSphere = computeApproximateBoundingSphereFromPositions(\n positions.typedArray\n );\n }\n }\n\n if (hasColors) {\n if (isRGB565) {\n attributes.push({\n index: colorLocation,\n vertexBuffer: colorsVertexBuffer,\n componentsPerAttribute: 1,\n componentDatatype: ComponentDatatype.UNSIGNED_SHORT,\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: 0,\n });\n } else {\n const colorComponentsPerAttribute = isTranslucent ? 4 : 3;\n attributes.push({\n index: colorLocation,\n vertexBuffer: colorsVertexBuffer,\n componentsPerAttribute: colorComponentsPerAttribute,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n normalize: true,\n offsetInBytes: 0,\n strideInBytes: 0,\n });\n }\n }\n\n if (hasNormals) {\n if (isOctEncoded16P) {\n componentsPerAttribute = 2;\n componentDatatype = ComponentDatatype.UNSIGNED_BYTE;\n } else if (isOctEncodedDraco) {\n componentsPerAttribute = 2;\n componentDatatype =\n octEncodedRange <= 255\n ? ComponentDatatype.UNSIGNED_BYTE\n : ComponentDatatype.UNSIGNED_SHORT;\n } else {\n componentsPerAttribute = 3;\n componentDatatype = ComponentDatatype.FLOAT;\n }\n attributes.push({\n index: normalLocation,\n vertexBuffer: normalsVertexBuffer,\n componentsPerAttribute: componentsPerAttribute,\n componentDatatype: componentDatatype,\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: 0,\n });\n }\n\n if (hasBatchIds) {\n attributes.push({\n index: batchIdLocation,\n vertexBuffer: batchIdsVertexBuffer,\n componentsPerAttribute: 1,\n componentDatatype: ComponentDatatype.fromTypedArray(batchIds.typedArray),\n normalize: false,\n offsetInBytes: 0,\n strideInBytes: 0,\n });\n }\n\n if (hasStyleableProperties) {\n attributes = attributes.concat(styleableVertexAttributes);\n }\n\n const vertexArray = new VertexArray({\n context: context,\n attributes: attributes,\n });\n\n const opaqueRenderState = {\n depthTest: {\n enabled: true,\n },\n };\n\n const translucentRenderState = {\n depthTest: {\n enabled: true,\n },\n depthMask: false,\n blending: BlendingState.ALPHA_BLEND,\n };\n\n if (pointCloud._opaquePass === Pass.CESIUM_3D_TILE) {\n opaqueRenderState.stencilTest = StencilConstants.setCesium3DTileBit();\n opaqueRenderState.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n translucentRenderState.stencilTest = StencilConstants.setCesium3DTileBit();\n translucentRenderState.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;\n }\n\n pointCloud._opaqueRenderState = RenderState.fromCache(opaqueRenderState);\n pointCloud._translucentRenderState = RenderState.fromCache(\n translucentRenderState\n );\n\n pointCloud._drawCommand = new DrawCommand({\n boundingVolume: new BoundingSphere(),\n cull: pointCloud._cull,\n modelMatrix: new Matrix4(),\n primitiveType: PrimitiveType.POINTS,\n vertexArray: vertexArray,\n count: pointsLength,\n shaderProgram: undefined, // Updated in createShaders\n uniformMap: undefined, // Updated in createShaders\n renderState: isTranslucent\n ? pointCloud._translucentRenderState\n : pointCloud._opaqueRenderState,\n pass: isTranslucent ? Pass.TRANSLUCENT : pointCloud._opaquePass,\n owner: pointCloud,\n castShadows: false,\n receiveShadows: false,\n pickId: pointCloud._pickIdLoaded(),\n });\n}\n\nfunction createUniformMap(pointCloud, frameState) {\n const context = frameState.context;\n const isQuantized = pointCloud._isQuantized;\n const isQuantizedDraco = pointCloud._isQuantizedDraco;\n const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n\n let uniformMap = {\n u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier: function () {\n const scratch = scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier;\n scratch.x = pointCloud._attenuation\n ? pointCloud.maximumAttenuation\n : pointCloud._pointSize;\n scratch.x *= frameState.pixelRatio;\n\n scratch.y = pointCloud.time;\n\n if (pointCloud._attenuation) {\n const frustum = frameState.camera.frustum;\n let depthMultiplier;\n // Attenuation is maximumAttenuation in 2D/ortho\n if (\n frameState.mode === SceneMode.SCENE2D ||\n frustum instanceof OrthographicFrustum\n ) {\n depthMultiplier = Number.POSITIVE_INFINITY;\n } else {\n depthMultiplier =\n context.drawingBufferHeight /\n frameState.camera.frustum.sseDenominator;\n }\n\n scratch.z = pointCloud.geometricError * pointCloud.geometricErrorScale;\n scratch.w = depthMultiplier;\n }\n\n return scratch;\n },\n u_highlightColor: function () {\n return pointCloud._highlightColor;\n },\n u_constantColor: function () {\n return pointCloud._constantColor;\n },\n u_clippingPlanes: function () {\n const clippingPlanes = pointCloud.clippingPlanes;\n const isClipped = pointCloud.isClipped;\n return isClipped ? clippingPlanes.texture : context.defaultTexture;\n },\n u_clippingPlanesEdgeStyle: function () {\n const clippingPlanes = pointCloud.clippingPlanes;\n if (!defined(clippingPlanes)) {\n return Color.TRANSPARENT;\n }\n\n const style = Color.clone(clippingPlanes.edgeColor, scratchColor);\n style.alpha = clippingPlanes.edgeWidth;\n return style;\n },\n u_clippingPlanesMatrix: function () {\n const clippingPlanes = pointCloud.clippingPlanes;\n if (!defined(clippingPlanes)) {\n return Matrix4.IDENTITY;\n }\n\n const clippingPlanesOriginMatrix = defaultValue(\n pointCloud.clippingPlanesOriginMatrix,\n pointCloud._modelMatrix\n );\n Matrix4.multiply(\n context.uniformState.view3D,\n clippingPlanesOriginMatrix,\n scratchClippingPlanesMatrix\n );\n const transform = Matrix4.multiply(\n scratchClippingPlanesMatrix,\n clippingPlanes.modelMatrix,\n scratchClippingPlanesMatrix\n );\n\n return Matrix4.inverseTranspose(\n transform,\n scratchInverseTransposeClippingPlanesMatrix\n );\n },\n };\n\n Splitter.addUniforms(pointCloud, uniformMap);\n\n if (isQuantized || isQuantizedDraco || isOctEncodedDraco) {\n uniformMap = combine(uniformMap, {\n u_quantizedVolumeScaleAndOctEncodedRange: function () {\n const scratch = scratchQuantizedVolumeScaleAndOctEncodedRange;\n if (defined(pointCloud._quantizedVolumeScale)) {\n const scale = Cartesian3.clone(\n pointCloud._quantizedVolumeScale,\n scratch\n );\n Cartesian3.divideByScalar(scale, pointCloud._quantizedRange, scratch);\n }\n scratch.w = pointCloud._octEncodedRange;\n return scratch;\n },\n });\n }\n\n if (defined(pointCloud._uniformMapLoaded)) {\n uniformMap = pointCloud._uniformMapLoaded(uniformMap);\n }\n\n pointCloud._drawCommand.uniformMap = uniformMap;\n}\n\nfunction getStyleablePropertyIds(source, propertyIds) {\n // Get all the property IDs used by this style\n const regex = /czm_3dtiles_property_(\\d+)/g;\n let matches = regex.exec(source);\n while (matches !== null) {\n const id = parseInt(matches[1]);\n if (propertyIds.indexOf(id) === -1) {\n propertyIds.push(id);\n }\n matches = regex.exec(source);\n }\n}\n\nfunction getBuiltinPropertyNames(source, propertyNames) {\n // Get all the builtin property names used by this style, ignoring the function signature\n source = source.slice(source.indexOf(\"\\n\"));\n const regex = /czm_3dtiles_builtin_property_(\\w+)/g;\n let matches = regex.exec(source);\n while (matches !== null) {\n const name = matches[1];\n if (propertyNames.indexOf(name) === -1) {\n propertyNames.push(name);\n }\n matches = regex.exec(source);\n }\n}\n\nfunction getVertexAttribute(vertexArray, index) {\n const numberOfAttributes = vertexArray.numberOfAttributes;\n for (let i = 0; i < numberOfAttributes; ++i) {\n const attribute = vertexArray.getAttribute(i);\n if (attribute.index === index) {\n return attribute;\n }\n }\n}\n\nconst builtinVariableSubstitutionMap = {\n POSITION: \"czm_3dtiles_builtin_property_POSITION\",\n POSITION_ABSOLUTE: \"czm_3dtiles_builtin_property_POSITION_ABSOLUTE\",\n COLOR: \"czm_3dtiles_builtin_property_COLOR\",\n NORMAL: \"czm_3dtiles_builtin_property_NORMAL\",\n};\n\nfunction createShaders(pointCloud, frameState, style) {\n let i;\n let name;\n let attribute;\n\n const context = frameState.context;\n const hasStyle = defined(style);\n const isQuantized = pointCloud._isQuantized;\n const isQuantizedDraco = pointCloud._isQuantizedDraco;\n const isOctEncoded16P = pointCloud._isOctEncoded16P;\n const isOctEncodedDraco = pointCloud._isOctEncodedDraco;\n const isRGB565 = pointCloud._isRGB565;\n const isTranslucent = pointCloud._isTranslucent;\n const hasColors = pointCloud._hasColors;\n const hasNormals = pointCloud._hasNormals;\n const hasBatchIds = pointCloud._hasBatchIds;\n const backFaceCulling = pointCloud._backFaceCulling;\n const normalShading = pointCloud._normalShading;\n const vertexArray = pointCloud._drawCommand.vertexArray;\n const clippingPlanes = pointCloud.clippingPlanes;\n const attenuation = pointCloud._attenuation;\n\n let colorStyleFunction;\n let showStyleFunction;\n let pointSizeStyleFunction;\n let styleTranslucent = isTranslucent;\n\n const variableSubstitutionMap = clone(builtinVariableSubstitutionMap);\n const propertyIdToAttributeMap = {};\n const styleableShaderAttributes = pointCloud._styleableShaderAttributes;\n for (name in styleableShaderAttributes) {\n if (styleableShaderAttributes.hasOwnProperty(name)) {\n attribute = styleableShaderAttributes[name];\n variableSubstitutionMap[\n name\n ] = `czm_3dtiles_property_${attribute.location}`;\n propertyIdToAttributeMap[attribute.location] = attribute;\n }\n }\n\n if (hasStyle) {\n const shaderState = {\n translucent: false,\n };\n const parameterList =\n \"(\" +\n \"vec3 czm_3dtiles_builtin_property_POSITION, \" +\n \"vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, \" +\n \"vec4 czm_3dtiles_builtin_property_COLOR, \" +\n \"vec3 czm_3dtiles_builtin_property_NORMAL\" +\n \")\";\n colorStyleFunction = style.getColorShaderFunction(\n `getColorFromStyle${parameterList}`,\n variableSubstitutionMap,\n shaderState\n );\n showStyleFunction = style.getShowShaderFunction(\n `getShowFromStyle${parameterList}`,\n variableSubstitutionMap,\n shaderState\n );\n pointSizeStyleFunction = style.getPointSizeShaderFunction(\n `getPointSizeFromStyle${parameterList}`,\n variableSubstitutionMap,\n shaderState\n );\n if (defined(colorStyleFunction) && shaderState.translucent) {\n styleTranslucent = true;\n }\n }\n\n pointCloud._styleTranslucent = styleTranslucent;\n\n const hasColorStyle = defined(colorStyleFunction);\n const hasShowStyle = defined(showStyleFunction);\n const hasPointSizeStyle = defined(pointSizeStyleFunction);\n const hasClippedContent = pointCloud.isClipped;\n\n // Get the properties in use by the style\n const styleablePropertyIds = [];\n const builtinPropertyNames = [];\n\n if (hasColorStyle) {\n getStyleablePropertyIds(colorStyleFunction, styleablePropertyIds);\n getBuiltinPropertyNames(colorStyleFunction, builtinPropertyNames);\n }\n if (hasShowStyle) {\n getStyleablePropertyIds(showStyleFunction, styleablePropertyIds);\n getBuiltinPropertyNames(showStyleFunction, builtinPropertyNames);\n }\n if (hasPointSizeStyle) {\n getStyleablePropertyIds(pointSizeStyleFunction, styleablePropertyIds);\n getBuiltinPropertyNames(pointSizeStyleFunction, builtinPropertyNames);\n }\n\n const usesColorSemantic = builtinPropertyNames.indexOf(\"COLOR\") >= 0;\n const usesNormalSemantic = builtinPropertyNames.indexOf(\"NORMAL\") >= 0;\n\n if (usesNormalSemantic && !hasNormals) {\n throw new RuntimeError(\n \"Style references the NORMAL semantic but the point cloud does not have normals\"\n );\n }\n\n // Disable vertex attributes that aren't used in the style, enable attributes that are\n for (name in styleableShaderAttributes) {\n if (styleableShaderAttributes.hasOwnProperty(name)) {\n attribute = styleableShaderAttributes[name];\n const enabled = styleablePropertyIds.indexOf(attribute.location) >= 0;\n const vertexAttribute = getVertexAttribute(\n vertexArray,\n attribute.location\n );\n vertexAttribute.enabled = enabled;\n }\n }\n\n const usesColors = hasColors && (!hasColorStyle || usesColorSemantic);\n if (hasColors) {\n // Disable the color vertex attribute if the color style does not reference the color semantic\n const colorVertexAttribute = getVertexAttribute(vertexArray, colorLocation);\n colorVertexAttribute.enabled = usesColors;\n }\n\n const usesNormals =\n hasNormals && (normalShading || backFaceCulling || usesNormalSemantic);\n if (hasNormals) {\n // Disable the normal vertex attribute if normals are not used\n const normalVertexAttribute = getVertexAttribute(\n vertexArray,\n normalLocation\n );\n normalVertexAttribute.enabled = usesNormals;\n }\n\n const attributeLocations = {\n a_position: positionLocation,\n };\n if (usesColors) {\n attributeLocations.a_color = colorLocation;\n }\n if (usesNormals) {\n attributeLocations.a_normal = normalLocation;\n }\n if (hasBatchIds) {\n attributeLocations.a_batchId = batchIdLocation;\n }\n\n let attributeDeclarations = \"\";\n\n const length = styleablePropertyIds.length;\n for (i = 0; i < length; ++i) {\n const propertyId = styleablePropertyIds[i];\n attribute = propertyIdToAttributeMap[propertyId];\n const componentCount = attribute.componentCount;\n const attributeName = `czm_3dtiles_property_${propertyId}`;\n let attributeType;\n if (componentCount === 1) {\n attributeType = \"float\";\n } else {\n attributeType = `vec${componentCount}`;\n }\n\n attributeDeclarations += `attribute ${attributeType} ${attributeName}; \\n`;\n attributeLocations[attributeName] = attribute.location;\n }\n\n createUniformMap(pointCloud, frameState);\n\n let vs =\n \"attribute vec3 a_position; \\n\" +\n \"varying vec4 v_color; \\n\" +\n \"uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \\n\" +\n \"uniform vec4 u_constantColor; \\n\" +\n \"uniform vec4 u_highlightColor; \\n\";\n\n // The time variable is named differently for compatibility with custom\n // shaders in Model.\n vs += \"float u_pointSize; \\n\" + \"float tiles3d_tileset_time; \\n\";\n\n if (attenuation) {\n vs += \"float u_geometricError; \\n\" + \"float u_depthMultiplier; \\n\";\n }\n\n vs += attributeDeclarations;\n\n if (usesColors) {\n if (isTranslucent) {\n vs += \"attribute vec4 a_color; \\n\";\n } else if (isRGB565) {\n vs +=\n \"attribute float a_color; \\n\" +\n \"const float SHIFT_RIGHT_11 = 1.0 / 2048.0; \\n\" +\n \"const float SHIFT_RIGHT_5 = 1.0 / 32.0; \\n\" +\n \"const float SHIFT_LEFT_11 = 2048.0; \\n\" +\n \"const float SHIFT_LEFT_5 = 32.0; \\n\" +\n \"const float NORMALIZE_6 = 1.0 / 64.0; \\n\" +\n \"const float NORMALIZE_5 = 1.0 / 32.0; \\n\";\n } else {\n vs += \"attribute vec3 a_color; \\n\";\n }\n }\n if (usesNormals) {\n if (isOctEncoded16P || isOctEncodedDraco) {\n vs += \"attribute vec2 a_normal; \\n\";\n } else {\n vs += \"attribute vec3 a_normal; \\n\";\n }\n }\n\n if (hasBatchIds) {\n vs += \"attribute float a_batchId; \\n\";\n }\n\n if (isQuantized || isQuantizedDraco || isOctEncodedDraco) {\n vs += \"uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \\n\";\n }\n\n if (hasColorStyle) {\n vs += colorStyleFunction;\n }\n\n if (hasShowStyle) {\n vs += showStyleFunction;\n }\n\n if (hasPointSizeStyle) {\n vs += pointSizeStyleFunction;\n }\n\n vs +=\n \"void main() \\n\" +\n \"{ \\n\" +\n \" u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \\n\" +\n \" tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \\n\";\n\n if (attenuation) {\n vs +=\n \" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \\n\" +\n \" u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \\n\";\n }\n\n if (usesColors) {\n if (isTranslucent) {\n vs += \" vec4 color = a_color; \\n\";\n } else if (isRGB565) {\n vs +=\n \" float compressed = a_color; \\n\" +\n \" float r = floor(compressed * SHIFT_RIGHT_11); \\n\" +\n \" compressed -= r * SHIFT_LEFT_11; \\n\" +\n \" float g = floor(compressed * SHIFT_RIGHT_5); \\n\" +\n \" compressed -= g * SHIFT_LEFT_5; \\n\" +\n \" float b = compressed; \\n\" +\n \" vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \\n\" +\n \" vec4 color = vec4(rgb, 1.0); \\n\";\n } else {\n vs += \" vec4 color = vec4(a_color, 1.0); \\n\";\n }\n } else {\n vs += \" vec4 color = u_constantColor; \\n\";\n }\n\n if (isQuantized || isQuantizedDraco) {\n vs +=\n \" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \\n\";\n } else {\n vs += \" vec3 position = a_position; \\n\";\n }\n vs +=\n \" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \\n\";\n\n if (usesNormals) {\n if (isOctEncoded16P) {\n vs += \" vec3 normal = czm_octDecode(a_normal); \\n\";\n } else if (isOctEncodedDraco) {\n // Draco oct-encoding decodes to zxy order\n vs +=\n \" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \\n\";\n } else {\n vs += \" vec3 normal = a_normal; \\n\";\n }\n vs += \" vec3 normalEC = czm_normal * normal; \\n\";\n } else {\n vs += \" vec3 normal = vec3(1.0); \\n\";\n }\n\n if (hasColorStyle) {\n vs +=\n \" color = getColorFromStyle(position, position_absolute, color, normal); \\n\";\n }\n\n if (hasShowStyle) {\n vs +=\n \" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \\n\";\n }\n\n if (hasPointSizeStyle) {\n vs +=\n \" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \\n\";\n } else if (attenuation) {\n vs +=\n \" vec4 positionEC = czm_modelView * vec4(position, 1.0); \\n\" +\n \" float depth = -positionEC.z; \\n\" +\n // compute SSE for this point\n \" gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \\n\";\n } else {\n vs += \" gl_PointSize = u_pointSize; \\n\";\n }\n\n vs += \" color = color * u_highlightColor; \\n\";\n\n if (usesNormals && normalShading) {\n vs +=\n \" float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \\n\" +\n \" diffuseStrength = max(diffuseStrength, 0.4); \\n\" + // Apply some ambient lighting\n \" color.xyz *= diffuseStrength * czm_lightColor; \\n\";\n }\n\n vs +=\n \" v_color = color; \\n\" +\n \" gl_Position = czm_modelViewProjection * vec4(position, 1.0); \\n\";\n\n if (usesNormals && backFaceCulling) {\n vs +=\n \" float visible = step(-normalEC.z, 0.0); \\n\" +\n \" gl_Position *= visible; \\n\" +\n \" gl_PointSize *= visible; \\n\";\n }\n\n if (hasShowStyle) {\n vs +=\n \" gl_Position.w *= float(show); \\n\" +\n \" gl_PointSize *= float(show); \\n\";\n }\n\n vs += \"} \\n\";\n\n let fs = \"varying vec4 v_color; \\n\";\n\n if (hasClippedContent) {\n fs +=\n \"uniform highp sampler2D u_clippingPlanes; \\n\" +\n \"uniform mat4 u_clippingPlanesMatrix; \\n\" +\n \"uniform vec4 u_clippingPlanesEdgeStyle; \\n\";\n fs += \"\\n\";\n fs += getClippingFunction(clippingPlanes, context);\n fs += \"\\n\";\n }\n\n fs +=\n \"void main() \\n\" +\n \"{ \\n\" +\n \" gl_FragColor = czm_gammaCorrect(v_color); \\n\";\n\n if (hasClippedContent) {\n fs += getClipAndStyleCode(\n \"u_clippingPlanes\",\n \"u_clippingPlanesMatrix\",\n \"u_clippingPlanesEdgeStyle\"\n );\n }\n\n fs += \"} \\n\";\n\n if (pointCloud.splitDirection !== SplitDirection.NONE) {\n fs = Splitter.modifyFragmentShader(fs);\n }\n\n if (defined(pointCloud._vertexShaderLoaded)) {\n vs = pointCloud._vertexShaderLoaded(vs);\n }\n\n if (defined(pointCloud._fragmentShaderLoaded)) {\n fs = pointCloud._fragmentShaderLoaded(fs);\n }\n\n const drawCommand = pointCloud._drawCommand;\n if (defined(drawCommand.shaderProgram)) {\n // Destroy the old shader\n drawCommand.shaderProgram.destroy();\n }\n drawCommand.shaderProgram = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n attributeLocations: attributeLocations,\n });\n\n try {\n // Check if the shader compiles correctly. If not there is likely a syntax error with the style.\n drawCommand.shaderProgram._bind();\n } catch (error) {\n // Rephrase the error.\n throw new RuntimeError(\n \"Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.\"\n );\n }\n}\n\nfunction decodeDraco(pointCloud, context) {\n if (pointCloud._decodingState === DecodingState.READY) {\n return false;\n }\n if (pointCloud._decodingState === DecodingState.NEEDS_DECODE) {\n const parsedContent = pointCloud._parsedContent;\n const draco = parsedContent.draco;\n const decodePromise = DracoLoader.decodePointCloud(draco, context);\n if (defined(decodePromise)) {\n pointCloud._decodingState = DecodingState.DECODING;\n decodePromise\n .then(function (result) {\n pointCloud._decodingState = DecodingState.READY;\n const decodedPositions = defined(result.POSITION)\n ? result.POSITION.array\n : undefined;\n const decodedRgb = defined(result.RGB) ? result.RGB.array : undefined;\n const decodedRgba = defined(result.RGBA)\n ? result.RGBA.array\n : undefined;\n const decodedNormals = defined(result.NORMAL)\n ? result.NORMAL.array\n : undefined;\n const decodedBatchIds = defined(result.BATCH_ID)\n ? result.BATCH_ID.array\n : undefined;\n const isQuantizedDraco =\n defined(decodedPositions) &&\n defined(result.POSITION.data.quantization);\n const isOctEncodedDraco =\n defined(decodedNormals) && defined(result.NORMAL.data.quantization);\n if (isQuantizedDraco) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n const quantization = result.POSITION.data.quantization;\n const range = quantization.range;\n pointCloud._quantizedVolumeScale = Cartesian3.fromElements(\n range,\n range,\n range\n );\n pointCloud._quantizedVolumeOffset = Cartesian3.unpack(\n quantization.minValues\n );\n pointCloud._quantizedRange =\n (1 << quantization.quantizationBits) - 1.0;\n pointCloud._isQuantizedDraco = true;\n }\n if (isOctEncodedDraco) {\n pointCloud._octEncodedRange =\n (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n pointCloud._isOctEncodedDraco = true;\n }\n let styleableProperties = parsedContent.styleableProperties;\n const batchTableProperties = draco.batchTableProperties;\n for (const name in batchTableProperties) {\n if (batchTableProperties.hasOwnProperty(name)) {\n const property = result[name];\n if (!defined(styleableProperties)) {\n styleableProperties = {};\n }\n styleableProperties[name] = {\n typedArray: property.array,\n componentCount: property.data.componentsPerAttribute,\n };\n }\n }\n\n if (defined(decodedPositions)) {\n parsedContent.positions = {\n typedArray: decodedPositions,\n };\n }\n\n const decodedColors = defaultValue(decodedRgba, decodedRgb);\n if (defined(decodedColors)) {\n parsedContent.colors = {\n typedArray: decodedColors,\n };\n }\n\n if (defined(decodedNormals)) {\n parsedContent.normals = {\n typedArray: decodedNormals,\n };\n }\n\n if (defined(decodedBatchIds)) {\n parsedContent.batchIds = {\n typedArray: decodedBatchIds,\n };\n }\n\n parsedContent.styleableProperties = styleableProperties;\n })\n .catch(function (error) {\n pointCloud._decodingState = DecodingState.FAILED;\n pointCloud._rejectReadyPromise(error);\n });\n }\n }\n return true;\n}\n\nconst scratchComputedTranslation = new Cartesian4();\nconst scratchScale = new Cartesian3();\n\nPointCloud.prototype.update = function (frameState) {\n const context = frameState.context;\n const decoding = decodeDraco(this, context);\n if (decoding) {\n return;\n }\n\n let shadersDirty = false;\n let modelMatrixDirty = !Matrix4.equals(this._modelMatrix, this.modelMatrix);\n\n if (this._mode !== frameState.mode) {\n this._mode = frameState.mode;\n modelMatrixDirty = true;\n }\n\n if (!defined(this._drawCommand)) {\n createResources(this, frameState);\n modelMatrixDirty = true;\n shadersDirty = true;\n this._resolveReadyPromise();\n this._parsedContent = undefined; // Unload\n }\n\n if (modelMatrixDirty) {\n Matrix4.clone(this.modelMatrix, this._modelMatrix);\n const modelMatrix = this._drawCommand.modelMatrix;\n Matrix4.clone(this._modelMatrix, modelMatrix);\n\n if (defined(this._rtcCenter)) {\n Matrix4.multiplyByTranslation(modelMatrix, this._rtcCenter, modelMatrix);\n }\n if (defined(this._quantizedVolumeOffset)) {\n Matrix4.multiplyByTranslation(\n modelMatrix,\n this._quantizedVolumeOffset,\n modelMatrix\n );\n }\n\n if (frameState.mode !== SceneMode.SCENE3D) {\n const projection = frameState.mapProjection;\n const translation = Matrix4.getColumn(\n modelMatrix,\n 3,\n scratchComputedTranslation\n );\n if (!Cartesian4.equals(translation, Cartesian4.UNIT_W)) {\n Transforms.basisTo2D(projection, modelMatrix, modelMatrix);\n }\n }\n\n const boundingSphere = this._drawCommand.boundingVolume;\n BoundingSphere.clone(this._boundingSphere, boundingSphere);\n\n if (this._cull) {\n const center = boundingSphere.center;\n Matrix4.multiplyByPoint(modelMatrix, center, center);\n const scale = Matrix4.getScale(modelMatrix, scratchScale);\n boundingSphere.radius *= Cartesian3.maximumComponent(scale);\n }\n }\n\n if (this.clippingPlanesDirty) {\n this.clippingPlanesDirty = false;\n shadersDirty = true;\n }\n\n if (this._attenuation !== this.attenuation) {\n this._attenuation = this.attenuation;\n shadersDirty = true;\n }\n\n if (this.backFaceCulling !== this._backFaceCulling) {\n this._backFaceCulling = this.backFaceCulling;\n shadersDirty = true;\n }\n\n if (this.normalShading !== this._normalShading) {\n this._normalShading = this.normalShading;\n shadersDirty = true;\n }\n\n if (this._style !== this.style || this.styleDirty) {\n this._style = this.style;\n this.styleDirty = false;\n shadersDirty = true;\n }\n\n const splittingEnabled = this.splitDirection !== SplitDirection.NONE;\n if (this._splittingEnabled !== splittingEnabled) {\n this._splittingEnabled = splittingEnabled;\n shadersDirty = true;\n }\n\n if (shadersDirty) {\n createShaders(this, frameState, this._style);\n }\n\n this._drawCommand.castShadows = ShadowMode.castShadows(this.shadows);\n this._drawCommand.receiveShadows = ShadowMode.receiveShadows(this.shadows);\n\n // Update the render state\n const isTranslucent =\n this._highlightColor.alpha < 1.0 ||\n this._constantColor.alpha < 1.0 ||\n this._styleTranslucent;\n this._drawCommand.renderState = isTranslucent\n ? this._translucentRenderState\n : this._opaqueRenderState;\n this._drawCommand.pass = isTranslucent ? Pass.TRANSLUCENT : this._opaquePass;\n\n const commandList = frameState.commandList;\n\n const passes = frameState.passes;\n if (passes.render || passes.pick) {\n commandList.push(this._drawCommand);\n }\n};\n\nPointCloud.prototype.isDestroyed = function () {\n return false;\n};\n\nPointCloud.prototype.destroy = function () {\n const command = this._drawCommand;\n if (defined(command)) {\n command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n command.shaderProgram =\n command.shaderProgram && command.shaderProgram.destroy();\n }\n return destroyObject(this);\n};\nexport default PointCloud;\n", "import ShaderSource from \"../Renderer/ShaderSource.js\";\n\n/**\n * Support for rendering things on only one side of the screen.\n *\n * @private\n */\nconst Splitter = {\n /**\n * Given a fragment shader string, returns a modified version of it that\n * only renders on one side of the screen or the other. Fragments on the\n * other side are discarded. The screen side is given by a uniform called\n * `czm_splitDirection`, which can be added by calling\n * {@link Splitter#addUniforms}, and the split position is given by an\n * automatic uniform called `czm_splitPosition`.\n */\n modifyFragmentShader: function modifyFragmentShader(shader) {\n shader = ShaderSource.replaceMain(shader, \"czm_splitter_main\");\n shader +=\n // czm_splitPosition is not declared because it is an automatic uniform.\n \"uniform float czm_splitDirection; \\n\" +\n \"void main() \\n\" +\n \"{ \\n\" +\n // Don't split when rendering the shadow map, because it is rendered from\n // the perspective of a totally different camera.\n \"#ifndef SHADOW_MAP\\n\" +\n \" if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; \\n\" +\n \" if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; \\n\" +\n \"#endif\\n\" +\n \" czm_splitter_main(); \\n\" +\n \"} \\n\";\n\n return shader;\n },\n\n /**\n * Add `czm_splitDirection` to the given uniform map.\n *\n * @param {Object} object The object on which the `splitDirection` property may be found.\n * @param {Object} uniformMap The uniform map.\n */\n addUniforms: function addUniforms(object, uniformMap) {\n uniformMap.czm_splitDirection = function () {\n return object.splitDirection;\n };\n },\n};\n\nexport default Splitter;\n", "/**\n * Determines how input texture to a {@link PostProcessStage} is sampled.\n *\n * @enum {Number}\n */\nconst PostProcessStageSampleMode = {\n /**\n * Samples the texture by returning the closest texel.\n *\n * @type {Number}\n * @constant\n */\n NEAREST: 0,\n /**\n * Samples the texture through bi-linear interpolation of the four nearest texels.\n *\n * @type {Number}\n * @constant\n */\n LINEAR: 1,\n};\nexport default PostProcessStageSampleMode;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Check from \"../Core/Check.js\";\nimport Color from \"../Core/Color.js\";\nimport combine from \"../Core/combine.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport Resource from \"../Core/Resource.js\";\nimport PassState from \"../Renderer/PassState.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\n\n/**\n * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.\n *\n * @alias PostProcessStage\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {String} options.fragmentShader The fragment shader to use. The default <code>sampler2D</code> uniforms are <code>colorTexture</code> and <code>depthTexture</code>. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a <code>vec2</code> varying named <code>v_textureCoordinates</code> that can be used to sample the textures.\n * @param {Object} [options.uniforms] An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture.\n * @param {Number} [options.textureScale=1.0] A number in the range (0.0, 1.0] used to scale the texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport.\n * @param {Boolean} [options.forcePowerOfTwo=false] Whether or not to force the texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.\n * @param {PostProcessStageSampleMode} [options.sampleMode=PostProcessStageSampleMode.NEAREST] How to sample the input color texture.\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] The color pixel format of the output texture.\n * @param {PixelDatatype} [options.pixelDatatype=PixelDatatype.UNSIGNED_BYTE] The pixel data type of the output texture.\n * @param {Color} [options.clearColor=Color.BLACK] The color to clear the output texture to.\n * @param {BoundingRectangle} [options.scissorRectangle] The rectangle to use for the scissor test.\n * @param {String} [options.name=createGuid()] The unique name of this post-process stage for reference by other stages in a composite. If a name is not supplied, a GUID will be generated.\n *\n * @exception {DeveloperError} options.textureScale must be greater than 0.0 and less than or equal to 1.0.\n * @exception {DeveloperError} options.pixelFormat must be a color format.\n * @exception {DeveloperError} When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.\n *\n * @see PostProcessStageComposite\n *\n * @example\n * // Simple stage to change the color\n * const fs =`\n * uniform sampler2D colorTexture;\n * varying vec2 v_textureCoordinates;\n * uniform float scale;\n * uniform vec3 offset;\n * void main() {\n * vec4 color = texture2D(colorTexture, v_textureCoordinates);\n * gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n * }`;\n * scene.postProcessStages.add(new Cesium.PostProcessStage({\n * fragmentShader : fs,\n * uniforms : {\n * scale : 1.1,\n * offset : function() {\n * return new Cesium.Cartesian3(0.1, 0.2, 0.3);\n * }\n * }\n * }));\n *\n * @example\n * // Simple stage to change the color of what is selected.\n * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.\n * const fs =`\n * uniform sampler2D colorTexture;\n * varying vec2 v_textureCoordinates;\n * uniform vec4 highlight;\n * void main() {\n * vec4 color = texture2D(colorTexture, v_textureCoordinates);\n * if (czm_selected()) {\n * vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n * gl_FragColor = vec4(highlighted, 1.0);\n * } else {\n * gl_FragColor = color;\n * }\n * }`;\n * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({\n * fragmentShader : fs,\n * uniforms : {\n * highlight : function() {\n * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);\n * }\n * }\n * }));\n * stage.selected = [cesium3DTileFeature];\n */\nfunction PostProcessStage(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const fragmentShader = options.fragmentShader;\n const textureScale = defaultValue(options.textureScale, 1.0);\n const pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n\n this._fragmentShader = fragmentShader;\n this._uniforms = options.uniforms;\n this._textureScale = textureScale;\n this._forcePowerOfTwo = defaultValue(options.forcePowerOfTwo, false);\n this._sampleMode = defaultValue(\n options.sampleMode,\n PostProcessStageSampleMode.NEAREST\n );\n this._pixelFormat = pixelFormat;\n this._pixelDatatype = defaultValue(\n options.pixelDatatype,\n PixelDatatype.UNSIGNED_BYTE\n );\n this._clearColor = defaultValue(options.clearColor, Color.BLACK);\n\n this._uniformMap = undefined;\n this._command = undefined;\n\n this._colorTexture = undefined;\n this._depthTexture = undefined;\n this._idTexture = undefined;\n\n this._actualUniforms = {};\n this._dirtyUniforms = [];\n this._texturesToRelease = [];\n this._texturesToCreate = [];\n this._texturePromise = undefined;\n\n const passState = new PassState();\n passState.scissorTest = {\n enabled: true,\n rectangle: defined(options.scissorRectangle)\n ? BoundingRectangle.clone(options.scissorRectangle)\n : new BoundingRectangle(),\n };\n this._passState = passState;\n\n this._ready = false;\n\n let name = options.name;\n if (!defined(name)) {\n name = createGuid();\n }\n this._name = name;\n\n this._logDepthChanged = undefined;\n this._useLogDepth = undefined;\n\n this._selectedIdTexture = undefined;\n this._selected = undefined;\n this._selectedShadow = undefined;\n this._parentSelected = undefined;\n this._parentSelectedShadow = undefined;\n this._combinedSelected = undefined;\n this._combinedSelectedShadow = undefined;\n this._selectedLength = 0;\n this._parentSelectedLength = 0;\n this._selectedDirty = true;\n\n // set by PostProcessStageCollection\n this._textureCache = undefined;\n this._index = undefined;\n\n /**\n * Whether or not to execute this post-process stage when ready.\n *\n * @type {Boolean}\n */\n this.enabled = true;\n this._enabled = true;\n}\n\nObject.defineProperties(PostProcessStage.prototype, {\n /**\n * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>\n * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures\n * to load.\n *\n * @memberof PostProcessStage.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return this._ready;\n },\n },\n /**\n * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.\n *\n * @memberof PostProcessStage.prototype\n * @type {String}\n * @readonly\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * The fragment shader to use when execute this post-process stage.\n * <p>\n * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,\n * or both.\n * </p>\n * <p>\n * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling\n * the texture uniforms.\n * </p>\n *\n * @memberof PostProcessStage.prototype\n * @type {String}\n * @readonly\n */\n fragmentShader: {\n get: function () {\n return this._fragmentShader;\n },\n },\n /**\n * An object whose properties are used to set the uniforms of the fragment shader.\n * <p>\n * The object property values can be either a constant or a function. The function will be called\n * each frame before the post-process stage is executed.\n * </p>\n * <p>\n * A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement.\n * </p>\n * <p>\n * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be\n * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.\n * </p>\n *\n * @memberof PostProcessStage.prototype\n * @type {Object}\n * @readonly\n */\n uniforms: {\n get: function () {\n return this._uniforms;\n },\n },\n /**\n * A number in the range (0.0, 1.0] used to scale the output texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport.\n *\n * @memberof PostProcessStage.prototype\n * @type {Number}\n * @readonly\n */\n textureScale: {\n get: function () {\n return this._textureScale;\n },\n },\n /**\n * Whether or not to force the output texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.\n *\n * @memberof PostProcessStage.prototype\n * @type {Number}\n * @readonly\n */\n forcePowerOfTwo: {\n get: function () {\n return this._forcePowerOfTwo;\n },\n },\n /**\n * How to sample the input color texture.\n *\n * @memberof PostProcessStage.prototype\n * @type {PostProcessStageSampleMode}\n * @readonly\n */\n sampleMode: {\n get: function () {\n return this._sampleMode;\n },\n },\n /**\n * The color pixel format of the output texture.\n *\n * @memberof PostProcessStage.prototype\n * @type {PixelFormat}\n * @readonly\n */\n pixelFormat: {\n get: function () {\n return this._pixelFormat;\n },\n },\n /**\n * The pixel data type of the output texture.\n *\n * @memberof PostProcessStage.prototype\n * @type {PixelDatatype}\n * @readonly\n */\n pixelDatatype: {\n get: function () {\n return this._pixelDatatype;\n },\n },\n /**\n * The color to clear the output texture to.\n *\n * @memberof PostProcessStage.prototype\n * @type {Color}\n * @readonly\n */\n clearColor: {\n get: function () {\n return this._clearColor;\n },\n },\n /**\n * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.\n *\n * @memberof PostProcessStage.prototype\n * @type {BoundingRectangle}\n * @readonly\n */\n scissorRectangle: {\n get: function () {\n return this._passState.scissorTest.rectangle;\n },\n },\n /**\n * A reference to the texture written to when executing this post process stage.\n *\n * @memberof PostProcessStage.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n outputTexture: {\n get: function () {\n if (defined(this._textureCache)) {\n const framebuffer = this._textureCache.getFramebuffer(this._name);\n if (defined(framebuffer)) {\n return framebuffer.getColorTexture(0);\n }\n }\n return undefined;\n },\n },\n /**\n * The features selected for applying the post-process.\n * <p>\n * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process\n * stage to that fragment. For example:\n * <code>\n * if (czm_selected(v_textureCoordinates)) {\n * // apply post-process stage\n * } else {\n * gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n * }\n * </code>\n * </p>\n *\n * @memberof PostProcessStage.prototype\n * @type {Array}\n */\n selected: {\n get: function () {\n return this._selected;\n },\n set: function (value) {\n this._selected = value;\n },\n },\n /**\n * @private\n */\n parentSelected: {\n get: function () {\n return this._parentSelected;\n },\n set: function (value) {\n this._parentSelected = value;\n },\n },\n});\n\nconst depthTextureRegex = /uniform\\s+sampler2D\\s+depthTexture/g;\n\n/**\n * @private\n */\nPostProcessStage.prototype._isSupported = function (context) {\n return !depthTextureRegex.test(this._fragmentShader) || context.depthTexture;\n};\n\nfunction getUniformValueGetterAndSetter(stage, uniforms, name) {\n const currentValue = uniforms[name];\n if (\n typeof currentValue === \"string\" ||\n currentValue instanceof HTMLCanvasElement ||\n currentValue instanceof HTMLImageElement ||\n currentValue instanceof HTMLVideoElement ||\n currentValue instanceof ImageData\n ) {\n stage._dirtyUniforms.push(name);\n }\n\n return {\n get: function () {\n return uniforms[name];\n },\n set: function (value) {\n const currentValue = uniforms[name];\n uniforms[name] = value;\n\n const actualUniforms = stage._actualUniforms;\n const actualValue = actualUniforms[name];\n if (\n defined(actualValue) &&\n actualValue !== currentValue &&\n actualValue instanceof Texture &&\n !defined(stage._textureCache.getStageByName(name))\n ) {\n stage._texturesToRelease.push(actualValue);\n delete actualUniforms[name];\n delete actualUniforms[`${name}Dimensions`];\n }\n\n if (currentValue instanceof Texture) {\n stage._texturesToRelease.push(currentValue);\n }\n\n if (\n typeof value === \"string\" ||\n value instanceof HTMLCanvasElement ||\n value instanceof HTMLImageElement ||\n value instanceof HTMLVideoElement ||\n value instanceof ImageData\n ) {\n stage._dirtyUniforms.push(name);\n } else {\n actualUniforms[name] = value;\n }\n },\n };\n}\n\nfunction getUniformMapFunction(stage, name) {\n return function () {\n const value = stage._actualUniforms[name];\n if (typeof value === \"function\") {\n return value();\n }\n return value;\n };\n}\n\nfunction getUniformMapDimensionsFunction(uniformMap, name) {\n return function () {\n const texture = uniformMap[name]();\n if (defined(texture)) {\n return texture.dimensions;\n }\n return undefined;\n };\n}\n\nfunction createUniformMap(stage) {\n if (defined(stage._uniformMap)) {\n return;\n }\n\n const uniformMap = {};\n const newUniforms = {};\n const uniforms = stage._uniforms;\n const actualUniforms = stage._actualUniforms;\n for (const name in uniforms) {\n if (uniforms.hasOwnProperty(name)) {\n if (typeof uniforms[name] !== \"function\") {\n uniformMap[name] = getUniformMapFunction(stage, name);\n newUniforms[name] = getUniformValueGetterAndSetter(\n stage,\n uniforms,\n name\n );\n } else {\n uniformMap[name] = uniforms[name];\n newUniforms[name] = uniforms[name];\n }\n\n actualUniforms[name] = uniforms[name];\n\n const value = uniformMap[name]();\n if (\n typeof value === \"string\" ||\n value instanceof Texture ||\n value instanceof HTMLImageElement ||\n value instanceof HTMLCanvasElement ||\n value instanceof HTMLVideoElement\n ) {\n uniformMap[`${name}Dimensions`] = getUniformMapDimensionsFunction(\n uniformMap,\n name\n );\n }\n }\n }\n\n stage._uniforms = {};\n Object.defineProperties(stage._uniforms, newUniforms);\n\n stage._uniformMap = combine(uniformMap, {\n colorTexture: function () {\n return stage._colorTexture;\n },\n colorTextureDimensions: function () {\n return stage._colorTexture.dimensions;\n },\n depthTexture: function () {\n return stage._depthTexture;\n },\n depthTextureDimensions: function () {\n return stage._depthTexture.dimensions;\n },\n czm_idTexture: function () {\n return stage._idTexture;\n },\n czm_selectedIdTexture: function () {\n return stage._selectedIdTexture;\n },\n czm_selectedIdTextureStep: function () {\n return 1.0 / stage._selectedIdTexture.width;\n },\n });\n}\n\nfunction createDrawCommand(stage, context) {\n if (\n defined(stage._command) &&\n !stage._logDepthChanged &&\n !stage._selectedDirty\n ) {\n return;\n }\n\n let fs = stage._fragmentShader;\n if (defined(stage._selectedIdTexture)) {\n const width = stage._selectedIdTexture.width;\n\n fs = fs.replace(/varying\\s+vec2\\s+v_textureCoordinates;/g, \"\");\n fs =\n `${\n \"#define CZM_SELECTED_FEATURE \\n\" +\n \"uniform sampler2D czm_idTexture; \\n\" +\n \"uniform sampler2D czm_selectedIdTexture; \\n\" +\n \"uniform float czm_selectedIdTextureStep; \\n\" +\n \"varying vec2 v_textureCoordinates; \\n\" +\n \"bool czm_selected(vec2 offset) \\n\" +\n \"{ \\n\" +\n \" bool selected = false;\\n\" +\n \" vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \\n\" +\n \" for (int i = 0; i < \"\n }${width}; ++i) \\n` +\n ` { \\n` +\n ` vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \\n` +\n ` if (all(equal(id, selectedId))) \\n` +\n ` { \\n` +\n ` return true; \\n` +\n ` } \\n` +\n ` } \\n` +\n ` return false; \\n` +\n `} \\n\\n` +\n `bool czm_selected() \\n` +\n `{ \\n` +\n ` return czm_selected(vec2(0.0)); \\n` +\n `} \\n\\n${fs}`;\n }\n\n const fragmentShader = new ShaderSource({\n defines: [stage._useLogDepth ? \"LOG_DEPTH\" : \"\"],\n sources: [fs],\n });\n stage._command = context.createViewportQuadCommand(fragmentShader, {\n uniformMap: stage._uniformMap,\n owner: stage,\n });\n}\n\nfunction createSampler(stage) {\n const mode = stage._sampleMode;\n\n let minFilter;\n let magFilter;\n\n if (mode === PostProcessStageSampleMode.LINEAR) {\n minFilter = TextureMinificationFilter.LINEAR;\n magFilter = TextureMagnificationFilter.LINEAR;\n } else {\n minFilter = TextureMinificationFilter.NEAREST;\n magFilter = TextureMagnificationFilter.NEAREST;\n }\n\n const sampler = stage._sampler;\n if (\n !defined(sampler) ||\n sampler.minificationFilter !== minFilter ||\n sampler.magnificationFilter !== magFilter\n ) {\n stage._sampler = new Sampler({\n wrapS: TextureWrap.CLAMP_TO_EDGE,\n wrapT: TextureWrap.CLAMP_TO_EDGE,\n minificationFilter: minFilter,\n magnificationFilter: magFilter,\n });\n }\n}\n\nfunction createLoadImageFunction(stage, name) {\n return function (image) {\n stage._texturesToCreate.push({\n name: name,\n source: image,\n });\n };\n}\n\nfunction createStageOutputTextureFunction(stage, name) {\n return function () {\n return stage._textureCache.getOutputTexture(name);\n };\n}\n\nfunction updateUniformTextures(stage, context) {\n let i;\n let texture;\n let name;\n\n const texturesToRelease = stage._texturesToRelease;\n let length = texturesToRelease.length;\n for (i = 0; i < length; ++i) {\n texture = texturesToRelease[i];\n texture = texture && texture.destroy();\n }\n texturesToRelease.length = 0;\n\n const texturesToCreate = stage._texturesToCreate;\n length = texturesToCreate.length;\n for (i = 0; i < length; ++i) {\n const textureToCreate = texturesToCreate[i];\n name = textureToCreate.name;\n const source = textureToCreate.source;\n stage._actualUniforms[name] = new Texture({\n context: context,\n source: source,\n });\n }\n texturesToCreate.length = 0;\n\n const dirtyUniforms = stage._dirtyUniforms;\n if (dirtyUniforms.length === 0 && !defined(stage._texturePromise)) {\n stage._ready = true;\n return;\n }\n\n if (dirtyUniforms.length === 0 || defined(stage._texturePromise)) {\n return;\n }\n\n length = dirtyUniforms.length;\n const uniforms = stage._uniforms;\n const promises = [];\n for (i = 0; i < length; ++i) {\n name = dirtyUniforms[i];\n const stageNameUrlOrImage = uniforms[name];\n const stageWithName = stage._textureCache.getStageByName(\n stageNameUrlOrImage\n );\n if (defined(stageWithName)) {\n stage._actualUniforms[name] = createStageOutputTextureFunction(\n stage,\n stageNameUrlOrImage\n );\n } else if (typeof stageNameUrlOrImage === \"string\") {\n const resource = new Resource({\n url: stageNameUrlOrImage,\n });\n\n promises.push(\n resource.fetchImage().then(createLoadImageFunction(stage, name))\n );\n } else {\n stage._texturesToCreate.push({\n name: name,\n source: stageNameUrlOrImage,\n });\n }\n }\n\n dirtyUniforms.length = 0;\n\n if (promises.length > 0) {\n stage._ready = false;\n stage._texturePromise = Promise.all(promises).then(function () {\n stage._ready = true;\n stage._texturePromise = undefined;\n });\n } else {\n stage._ready = true;\n }\n}\n\nfunction releaseResources(stage) {\n if (defined(stage._command)) {\n stage._command.shaderProgram =\n stage._command.shaderProgram && stage._command.shaderProgram.destroy();\n stage._command = undefined;\n }\n\n stage._selectedIdTexture =\n stage._selectedIdTexture && stage._selectedIdTexture.destroy();\n\n const textureCache = stage._textureCache;\n if (!defined(textureCache)) {\n return;\n }\n\n const uniforms = stage._uniforms;\n const actualUniforms = stage._actualUniforms;\n for (const name in actualUniforms) {\n if (actualUniforms.hasOwnProperty(name)) {\n if (actualUniforms[name] instanceof Texture) {\n if (!defined(textureCache.getStageByName(uniforms[name]))) {\n actualUniforms[name].destroy();\n }\n stage._dirtyUniforms.push(name);\n }\n }\n }\n}\n\nfunction isSelectedTextureDirty(stage) {\n let length = defined(stage._selected) ? stage._selected.length : 0;\n const parentLength = defined(stage._parentSelected)\n ? stage._parentSelected\n : 0;\n let dirty =\n stage._selected !== stage._selectedShadow ||\n length !== stage._selectedLength;\n dirty =\n dirty ||\n stage._parentSelected !== stage._parentSelectedShadow ||\n parentLength !== stage._parentSelectedLength;\n\n if (defined(stage._selected) && defined(stage._parentSelected)) {\n stage._combinedSelected = stage._selected.concat(stage._parentSelected);\n } else if (defined(stage._parentSelected)) {\n stage._combinedSelected = stage._parentSelected;\n } else {\n stage._combinedSelected = stage._selected;\n }\n\n if (!dirty && defined(stage._combinedSelected)) {\n if (!defined(stage._combinedSelectedShadow)) {\n return true;\n }\n\n length = stage._combinedSelected.length;\n for (let i = 0; i < length; ++i) {\n if (stage._combinedSelected[i] !== stage._combinedSelectedShadow[i]) {\n return true;\n }\n }\n }\n return dirty;\n}\n\nfunction createSelectedTexture(stage, context) {\n if (!stage._selectedDirty) {\n return;\n }\n\n stage._selectedIdTexture =\n stage._selectedIdTexture && stage._selectedIdTexture.destroy();\n stage._selectedIdTexture = undefined;\n\n const features = stage._combinedSelected;\n if (!defined(features)) {\n return;\n }\n\n let i;\n let feature;\n\n let textureLength = 0;\n const length = features.length;\n for (i = 0; i < length; ++i) {\n feature = features[i];\n if (defined(feature.pickIds)) {\n textureLength += feature.pickIds.length;\n } else if (defined(feature.pickId)) {\n ++textureLength;\n }\n }\n\n if (length === 0 || textureLength === 0) {\n // max pick id is reserved\n const empty = new Uint8Array(4);\n empty[0] = 255;\n empty[1] = 255;\n empty[2] = 255;\n empty[3] = 255;\n\n stage._selectedIdTexture = new Texture({\n context: context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n arrayBufferView: empty,\n width: 1,\n height: 1,\n },\n sampler: Sampler.NEAREST,\n });\n return;\n }\n\n let pickColor;\n let offset = 0;\n const ids = new Uint8Array(textureLength * 4);\n for (i = 0; i < length; ++i) {\n feature = features[i];\n if (defined(feature.pickIds)) {\n const pickIds = feature.pickIds;\n const pickIdsLength = pickIds.length;\n for (let j = 0; j < pickIdsLength; ++j) {\n pickColor = pickIds[j].color;\n ids[offset] = Color.floatToByte(pickColor.red);\n ids[offset + 1] = Color.floatToByte(pickColor.green);\n ids[offset + 2] = Color.floatToByte(pickColor.blue);\n ids[offset + 3] = Color.floatToByte(pickColor.alpha);\n offset += 4;\n }\n } else if (defined(feature.pickId)) {\n pickColor = feature.pickId.color;\n ids[offset] = Color.floatToByte(pickColor.red);\n ids[offset + 1] = Color.floatToByte(pickColor.green);\n ids[offset + 2] = Color.floatToByte(pickColor.blue);\n ids[offset + 3] = Color.floatToByte(pickColor.alpha);\n offset += 4;\n }\n }\n\n stage._selectedIdTexture = new Texture({\n context: context,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n arrayBufferView: ids,\n width: textureLength,\n height: 1,\n },\n sampler: Sampler.NEAREST,\n });\n}\n\n/**\n * A function that will be called before execute. Used to create WebGL resources and load any textures.\n * @param {Context} context The context.\n * @param {Boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n * @private\n */\nPostProcessStage.prototype.update = function (context, useLogDepth) {\n if (this.enabled !== this._enabled && !this.enabled) {\n releaseResources(this);\n }\n\n this._enabled = this.enabled;\n if (!this._enabled) {\n return;\n }\n\n this._logDepthChanged = useLogDepth !== this._useLogDepth;\n this._useLogDepth = useLogDepth;\n\n this._selectedDirty = isSelectedTextureDirty(this);\n\n this._selectedShadow = this._selected;\n this._parentSelectedShadow = this._parentSelected;\n this._combinedSelectedShadow = this._combinedSelected;\n this._selectedLength = defined(this._selected) ? this._selected.length : 0;\n this._parentSelectedLength = defined(this._parentSelected)\n ? this._parentSelected.length\n : 0;\n\n createSelectedTexture(this, context);\n createUniformMap(this);\n updateUniformTextures(this, context);\n createDrawCommand(this, context);\n createSampler(this);\n\n this._selectedDirty = false;\n\n if (!this._ready) {\n return;\n }\n\n const framebuffer = this._textureCache.getFramebuffer(this._name);\n this._command.framebuffer = framebuffer;\n\n if (!defined(framebuffer)) {\n return;\n }\n\n const colorTexture = framebuffer.getColorTexture(0);\n let renderState;\n if (\n colorTexture.width !== context.drawingBufferWidth ||\n colorTexture.height !== context.drawingBufferHeight\n ) {\n renderState = this._renderState;\n if (\n !defined(renderState) ||\n colorTexture.width !== renderState.viewport.width ||\n colorTexture.height !== renderState.viewport.height\n ) {\n this._renderState = RenderState.fromCache({\n viewport: new BoundingRectangle(\n 0,\n 0,\n colorTexture.width,\n colorTexture.height\n ),\n });\n }\n }\n\n this._command.renderState = renderState;\n};\n\n/**\n * Executes the post-process stage. The color texture is the texture rendered to by the scene or from the previous stage.\n * @param {Context} context The context.\n * @param {Texture} colorTexture The input color texture.\n * @param {Texture} depthTexture The input depth texture.\n * @param {Texture} idTexture The id texture.\n * @private\n */\nPostProcessStage.prototype.execute = function (\n context,\n colorTexture,\n depthTexture,\n idTexture\n) {\n if (\n !defined(this._command) ||\n !defined(this._command.framebuffer) ||\n !this._ready ||\n !this._enabled\n ) {\n return;\n }\n\n this._colorTexture = colorTexture;\n this._depthTexture = depthTexture;\n this._idTexture = idTexture;\n\n if (!Sampler.equals(this._colorTexture.sampler, this._sampler)) {\n this._colorTexture.sampler = this._sampler;\n }\n\n const passState =\n this.scissorRectangle.width > 0 && this.scissorRectangle.height > 0\n ? this._passState\n : undefined;\n if (defined(passState)) {\n passState.context = context;\n }\n\n this._command.execute(context, passState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStage#destroy\n */\nPostProcessStage.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStage#isDestroyed\n */\nPostProcessStage.prototype.destroy = function () {\n releaseResources(this);\n return destroyObject(this);\n};\nexport default PostProcessStage;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\\n\\\n#endif\\n\\\ncolor = czm_acesTonemapping(color);\\n\\\ncolor = czm_inverseGamma(color);\\n\\\ngl_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D randomTexture;\\n\\\nuniform sampler2D depthTexture;\\n\\\nuniform float intensity;\\n\\\nuniform float bias;\\n\\\nuniform float lengthCap;\\n\\\nuniform float stepSize;\\n\\\nuniform float frustumLength;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvec4 clipToEye(vec2 uv, float depth)\\n\\\n{\\n\\\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\\n\\\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\\n\\\nposEC = posEC / posEC.w;\\n\\\nreturn posEC;\\n\\\n}\\n\\\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\\n\\\n{\\n\\\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\\n\\\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\\n\\\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\\n\\\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\\n\\\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\\n\\\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\\n\\\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\\n\\\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\\n\\\nvec3 DX = length(left) < length(right) ? left : right;\\n\\\nvec3 DY = length(up) < length(down) ? up : down;\\n\\\nreturn normalize(cross(DY, DX));\\n\\\n}\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\\n\\\nif (posInCamera.z > frustumLength)\\n\\\n{\\n\\\ngl_FragColor = vec4(1.0);\\n\\\nreturn;\\n\\\n}\\n\\\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\\n\\\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\\n\\\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\\n\\\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\\n\\\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\\n\\\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\\n\\\nfloat ao = 0.0;\\n\\\nvec2 sampleDirection = vec2(1.0, 0.0);\\n\\\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\\n\\\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\\n\\\nfor (int i = 0; i < 4; i++)\\n\\\n{\\n\\\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\\n\\\nfloat cosVal = cos(newGapAngle);\\n\\\nfloat sinVal = sin(newGapAngle);\\n\\\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\\n\\\nfloat localAO = 0.0;\\n\\\nfloat localStepSize = stepSize;\\n\\\nfor (int j = 0; j < 6; j++)\\n\\\n{\\n\\\nvec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\\n\\\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\\n\\\n{\\n\\\nbreak;\\n\\\n}\\n\\\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\\n\\\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\\n\\\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\\n\\\nfloat len = length(diffVec);\\n\\\nif (len > lengthCap)\\n\\\n{\\n\\\nbreak;\\n\\\n}\\n\\\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\\n\\\nfloat weight = len / lengthCap;\\n\\\nweight = 1.0 - weight * weight;\\n\\\nif (dotVal < bias)\\n\\\n{\\n\\\ndotVal = 0.0;\\n\\\n}\\n\\\nlocalAO = max(localAO, dotVal * weight);\\n\\\nlocalStepSize += stepSize;\\n\\\n}\\n\\\nao += localAO;\\n\\\n}\\n\\\nao /= 4.0;\\n\\\nao = 1.0 - clamp(ao, 0.0, 1.0);\\n\\\nao = pow(ao, intensity);\\n\\\ngl_FragColor = vec4(vec3(ao), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D ambientOcclusionTexture;\\n\\\nuniform bool ambientOcclusionOnly;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\\n\\\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\\n\\\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float gradations;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\nif (czm_selected()) {\\n\\\ngl_FragColor = vec4(rgb, 1.0);\\n\\\nreturn;\\n\\\n}\\n\\\n#endif\\n\\\nfloat luminance = czm_luminance(rgb);\\n\\\nfloat darkness = luminance * gradations;\\n\\\ndarkness = (darkness - fract(darkness)) / gradations;\\n\\\ngl_FragColor = vec4(vec3(darkness), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D bloomTexture;\\n\\\nuniform bool glowOnly;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\nif (czm_selected()) {\\n\\\ngl_FragColor = color;\\n\\\nreturn;\\n\\\n}\\n\\\n#endif\\n\\\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\\n\\\ngl_FragColor = glowOnly ? bloom : bloom + color;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float brightness;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\\n\\\nvec3 target = vec3(0.0);\\n\\\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float contrast;\\n\\\nuniform float brightness;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\\n\\\nsceneColor = czm_RGBToHSB(sceneColor);\\n\\\nsceneColor.z += brightness;\\n\\\nsceneColor = czm_HSBToRGB(sceneColor);\\n\\\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\\n\\\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\\n\\\ngl_FragColor = vec4(sceneColor, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D blurTexture;\\n\\\nuniform sampler2D depthTexture;\\n\\\nuniform float focalDistance;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvec4 toEye(vec2 uv, float depth)\\n\\\n{\\n\\\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\\n\\\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\\n\\\nposInCamera = posInCamera / posInCamera.w;\\n\\\nreturn posInCamera;\\n\\\n}\\n\\\nfloat computeDepthBlur(float depth)\\n\\\n{\\n\\\nfloat f;\\n\\\nif (depth < focalDistance)\\n\\\n{\\n\\\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\\n\\\nf = pow(f, 0.1);\\n\\\n}\\n\\\nf *= f;\\n\\\nf = clamp(f, 0.0, 1.0);\\n\\\nreturn pow(f, 0.5);\\n\\\n}\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\\n\\\nfloat d = computeDepthBlur(-posInCamera.z);\\n\\\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D depthTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\\n\\\ngl_FragColor = vec4(vec3(depth), 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D depthTexture;\\n\\\nuniform float length;\\n\\\nuniform vec4 color;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat directions[3];\\n\\\ndirections[0] = -1.0;\\n\\\ndirections[1] = 0.0;\\n\\\ndirections[2] = 1.0;\\n\\\nfloat scalars[3];\\n\\\nscalars[0] = 3.0;\\n\\\nscalars[1] = 10.0;\\n\\\nscalars[2] = 3.0;\\n\\\nfloat padx = czm_pixelRatio / czm_viewport.z;\\n\\\nfloat pady = czm_pixelRatio / czm_viewport.w;\\n\\\n#ifdef CZM_SELECTED_FEATURE\\n\\\nbool selected = false;\\n\\\nfor (int i = 0; i < 3; ++i)\\n\\\n{\\n\\\nfloat dir = directions[i];\\n\\\nselected = selected || czm_selected(vec2(-padx, dir * pady));\\n\\\nselected = selected || czm_selected(vec2(padx, dir * pady));\\n\\\nselected = selected || czm_selected(vec2(dir * padx, -pady));\\n\\\nselected = selected || czm_selected(vec2(dir * padx, pady));\\n\\\nif (selected)\\n\\\n{\\n\\\nbreak;\\n\\\n}\\n\\\n}\\n\\\nif (!selected)\\n\\\n{\\n\\\ngl_FragColor = vec4(color.rgb, 0.0);\\n\\\nreturn;\\n\\\n}\\n\\\n#endif\\n\\\nfloat horizEdge = 0.0;\\n\\\nfloat vertEdge = 0.0;\\n\\\nfor (int i = 0; i < 3; ++i)\\n\\\n{\\n\\\nfloat dir = directions[i];\\n\\\nfloat scale = scalars[i];\\n\\\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\\n\\\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\\n\\\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\\n\\\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\\n\\\n}\\n\\\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\\n\\\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\\n\\\ncolor /= exposure;\\n\\\n#endif\\n\\\nconst float A = 0.22;\\n\\\nconst float B = 0.30;\\n\\\nconst float C = 0.10;\\n\\\nconst float D = 0.20;\\n\\\nconst float E = 0.01;\\n\\\nconst float F = 0.30;\\n\\\nconst float white = 11.2;\\n\\\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\\n\\\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\\n\\\nc = czm_inverseGamma(c / w);\\n\\\ngl_FragColor = vec4(c, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"varying vec2 v_textureCoordinates;\\n\\\nuniform sampler2D colorTexture;\\n\\\nconst float fxaaQualitySubpix = 0.5;\\n\\\nconst float fxaaQualityEdgeThreshold = 0.125;\\n\\\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\\n\\\nvec4 color = FxaaPixelShader(\\n\\\nv_textureCoordinates,\\n\\\ncolorTexture,\\n\\\nfxaaQualityRcpFrame,\\n\\\nfxaaQualitySubpix,\\n\\\nfxaaQualityEdgeThreshold,\\n\\\nfxaaQualityEdgeThresholdMin);\\n\\\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\\n\\\ngl_FragColor = vec4(color.rgb, alpha);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"#define SAMPLES 8\\n\\\nuniform float delta;\\n\\\nuniform float sigma;\\n\\\nuniform float direction;\\n\\\nuniform sampler2D colorTexture;\\n\\\n#ifdef USE_STEP_SIZE\\n\\\nuniform float stepSize;\\n\\\n#else\\n\\\nuniform vec2 step;\\n\\\n#endif\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec2 st = v_textureCoordinates;\\n\\\nvec2 dir = vec2(1.0 - direction, direction);\\n\\\n#ifdef USE_STEP_SIZE\\n\\\nvec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\\n\\\n#else\\n\\\nvec2 step = step;\\n\\\n#endif\\n\\\nvec3 g;\\n\\\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\\n\\\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\\n\\\ng.z = g.y * g.y;\\n\\\nvec4 result = texture2D(colorTexture, st) * g.x;\\n\\\nfor (int i = 1; i < SAMPLES; ++i)\\n\\\n{\\n\\\ng.xy *= g.yz;\\n\\\nvec2 offset = float(i) * dir * step;\\n\\\nresult += texture2D(colorTexture, st - offset) * g.x;\\n\\\nresult += texture2D(colorTexture, st + offset) * g.x;\\n\\\n}\\n\\\ngl_FragColor = result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D dirtTexture;\\n\\\nuniform sampler2D starTexture;\\n\\\nuniform vec2 dirtTextureDimensions;\\n\\\nuniform float distortion;\\n\\\nuniform float ghostDispersal;\\n\\\nuniform float haloWidth;\\n\\\nuniform float dirtAmount;\\n\\\nuniform float earthRadius;\\n\\\nuniform float intensity;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#define DISTANCE_TO_SPACE 6500000.0\\n\\\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\\n\\\n{\\n\\\nvec4 positionEC = czm_view * vec4(WC, 1.0);\\n\\\npositionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\\n\\\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\\n\\\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\\n\\\n}\\n\\\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\\n\\\n{\\n\\\nvec2 NDC = texcoord * 2.0 - 1.0;\\n\\\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\\n\\\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\\n\\\nNDC.xy -= earthPosSC.xy;\\n\\\nfloat X = abs(NDC.x) * sceneSize.x;\\n\\\nfloat Y = abs(NDC.y) * sceneSize.y;\\n\\\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\\n\\\n}\\n\\\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\\n\\\n{\\n\\\nvec2 sceneSize = czm_viewport.zw;\\n\\\nvec3 color;\\n\\\nif(isSpace)\\n\\\n{\\n\\\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\\n\\\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\\n\\\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\\n\\\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\\n\\\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\\n\\\n}\\n\\\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\\n\\\n}\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 rgb = originalColor.rgb;\\n\\\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\\n\\\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\\n\\\nvec4 sunPositionEC = czm_view * sunPos;\\n\\\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\\n\\\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\\n\\\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\\n\\\n{\\n\\\ngl_FragColor = originalColor;\\n\\\nreturn;\\n\\\n}\\n\\\nvec2 texcoord = vec2(1.0) - v_textureCoordinates;\\n\\\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\\n\\\nvec2 invPixelSize = 1.0 / pixelSize;\\n\\\nvec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\\n\\\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\\n\\\nvec3 direction = normalize(vec3(ghostVec, 0.0));\\n\\\nvec4 result = vec4(0.0);\\n\\\nvec4 ghost = vec4(0.0);\\n\\\nfor (int i = 0; i < 4; ++i)\\n\\\n{\\n\\\nvec2 offset = fract(texcoord + ghostVec * float(i));\\n\\\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\\n\\\n}\\n\\\nresult += ghost;\\n\\\nvec2 haloVec = normalize(ghostVec) * haloWidth;\\n\\\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\\n\\\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\\n\\\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\\n\\\nvec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\\n\\\nif (dirtTexCoords.x > 1.0)\\n\\\n{\\n\\\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\\n\\\n}\\n\\\nif (dirtTexCoords.y > 1.0)\\n\\\n{\\n\\\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\\n\\\n}\\n\\\nresult += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\\n\\\nfloat camrot = czm_view[0].z + czm_view[1].y;\\n\\\nfloat cosValue = cos(camrot);\\n\\\nfloat sinValue = sin(camrot);\\n\\\nmat3 rotation = mat3(\\n\\\ncosValue, -sinValue, 0.0,\\n\\\nsinValue, cosValue, 0.0,\\n\\\n0.0, 0.0, 1.0\\n\\\n);\\n\\\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\\n\\\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\\n\\\nvec3 st3 = st2 * 0.5 + vec3(0.5);\\n\\\nvec2 lensStarTexcoord = st3.xy;\\n\\\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\\n\\\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\\n\\\nif (!isSpace)\\n\\\n{\\n\\\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\\n\\\n}\\n\\\nelse\\n\\\n{\\n\\\nresult *= oneMinusWeightForLensFlare * intensity;\\n\\\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\\n\\\n}\\n\\\nresult += texture2D(colorTexture, v_textureCoordinates);\\n\\\ngl_FragColor = result;\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform vec3 white;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\\n\\\ncolor /= exposure;\\n\\\n#endif\\n\\\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\\n\\\ncolor = czm_inverseGamma(color);\\n\\\ngl_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nfloat rand(vec2 co)\\n\\\n{\\n\\\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\\n\\\n}\\n\\\nvoid main(void)\\n\\\n{\\n\\\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\\n\\\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\\n\\\nvec3 green = vec3(0.0, 1.0, 0.0);\\n\\\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nuniform sampler2D autoExposure;\\n\\\n#endif\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 color = fragmentColor.rgb;\\n\\\n#ifdef AUTO_EXPOSURE\\n\\\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\\n\\\ncolor /= exposure;\\n\\\n#endif\\n\\\ncolor = color / (1.0 + color);\\n\\\ncolor = czm_inverseGamma(color);\\n\\\ngl_FragColor = vec4(color, fragmentColor.a);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D silhouetteTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main(void)\\n\\\n{\\n\\\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\\n\\\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\\\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\\n\\\n}\\n\\\n\";\n", "import Check from \"../Core/Check.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\n\n/**\n * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.\n * <p>\n * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.\n * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.\n * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene\n * or the output texture of the previous stage.\n * </p>\n *\n * @alias PostProcessStageComposite\n * @constructor\n *\n * @param {Object} options An object with the following properties:\n * @param {Array} options.stages An array of {@link PostProcessStage}s or composites to be executed in order.\n * @param {Boolean} [options.inputPreviousStageTexture=true] Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite.\n * @param {String} [options.name=createGuid()] The unique name of this post-process stage for reference by other composites. If a name is not supplied, a GUID will be generated.\n * @param {Object} [options.uniforms] An alias to the uniforms of post-process stages.\n *\n * @exception {DeveloperError} options.stages.length must be greater than 0.0.\n *\n * @see PostProcessStage\n *\n * @example\n * // Example 1: separable blur filter\n * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.\n * // The input to blurYDirection is the texture rendered to by blurXDirection.\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n * stages : [blurXDirection, blurYDirection]\n * }));\n *\n * @example\n * // Example 2: referencing the output of another post-process stage\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n * inputPreviousStageTexture : false,\n * stages : [\n * // The same as Example 1.\n * new Cesium.PostProcessStageComposite({\n * inputPreviousStageTexture : true\n * stages : [blurXDirection, blurYDirection],\n * name : 'blur'\n * }),\n * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false\n * new Cesium.PostProcessStage({\n * fragmentShader : compositeShader,\n * uniforms : {\n * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).\n * }\n * })\n * ]\n * });\n *\n * @example\n * // Example 3: create a uniform alias\n * const uniforms = {};\n * Cesium.defineProperties(uniforms, {\n * filterSize : {\n * get : function() {\n * return blurXDirection.uniforms.filterSize;\n * },\n * set : function(value) {\n * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;\n * }\n * }\n * });\n * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({\n * stages : [blurXDirection, blurYDirection],\n * uniforms : uniforms\n * }));\n */\nfunction PostProcessStageComposite(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._stages = options.stages;\n this._inputPreviousStageTexture = defaultValue(\n options.inputPreviousStageTexture,\n true\n );\n\n let name = options.name;\n if (!defined(name)) {\n name = createGuid();\n }\n this._name = name;\n\n this._uniforms = options.uniforms;\n\n // used by PostProcessStageCollection\n this._textureCache = undefined;\n this._index = undefined;\n\n this._selected = undefined;\n this._selectedShadow = undefined;\n this._parentSelected = undefined;\n this._parentSelectedShadow = undefined;\n this._combinedSelected = undefined;\n this._combinedSelectedShadow = undefined;\n this._selectedLength = 0;\n this._parentSelectedLength = 0;\n this._selectedDirty = true;\n}\n\nObject.defineProperties(PostProcessStageComposite.prototype, {\n /**\n * Determines if this post-process stage is ready to be executed.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n if (!stages[i].ready) {\n return false;\n }\n }\n return true;\n },\n },\n /**\n * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {String}\n * @readonly\n */\n name: {\n get: function () {\n return this._name;\n },\n },\n /**\n * Whether or not to execute this post-process stage when ready.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {Boolean}\n */\n enabled: {\n get: function () {\n return this._stages[0].enabled;\n },\n set: function (value) {\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n stages[i].enabled = value;\n }\n },\n },\n /**\n * An alias to the uniform values of the post-process stages. May be <code>undefined</code>; in which case, get each stage to set uniform values.\n * @memberof PostProcessStageComposite.prototype\n * @type {Object}\n */\n uniforms: {\n get: function () {\n return this._uniforms;\n },\n },\n /**\n * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.\n * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.\n * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene\n * or the output texture of the previous stage.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {Boolean}\n * @readonly\n */\n inputPreviousStageTexture: {\n get: function () {\n return this._inputPreviousStageTexture;\n },\n },\n /**\n * The number of post-process stages in this composite.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._stages.length;\n },\n },\n /**\n * The features selected for applying the post-process.\n *\n * @memberof PostProcessStageComposite.prototype\n * @type {Array}\n */\n selected: {\n get: function () {\n return this._selected;\n },\n set: function (value) {\n this._selected = value;\n },\n },\n /**\n * @private\n */\n parentSelected: {\n get: function () {\n return this._parentSelected;\n },\n set: function (value) {\n this._parentSelected = value;\n },\n },\n});\n\n/**\n * @private\n */\nPostProcessStageComposite.prototype._isSupported = function (context) {\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n if (!stages[i]._isSupported(context)) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Gets the post-process stage at <code>index</code>\n *\n * @param {Number} index The index of the post-process stage or composite.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage or composite at index.\n *\n * @exception {DeveloperError} index must be greater than or equal to 0.\n * @exception {DeveloperError} index must be less than {@link PostProcessStageComposite#length}.\n */\nPostProcessStageComposite.prototype.get = function (index) {\nreturn this._stages[index];\n};\n\nfunction isSelectedTextureDirty(stage) {\n let length = defined(stage._selected) ? stage._selected.length : 0;\n const parentLength = defined(stage._parentSelected)\n ? stage._parentSelected\n : 0;\n let dirty =\n stage._selected !== stage._selectedShadow ||\n length !== stage._selectedLength;\n dirty =\n dirty ||\n stage._parentSelected !== stage._parentSelectedShadow ||\n parentLength !== stage._parentSelectedLength;\n\n if (defined(stage._selected) && defined(stage._parentSelected)) {\n stage._combinedSelected = stage._selected.concat(stage._parentSelected);\n } else if (defined(stage._parentSelected)) {\n stage._combinedSelected = stage._parentSelected;\n } else {\n stage._combinedSelected = stage._selected;\n }\n\n if (!dirty && defined(stage._combinedSelected)) {\n if (!defined(stage._combinedSelectedShadow)) {\n return true;\n }\n\n length = stage._combinedSelected.length;\n for (let i = 0; i < length; ++i) {\n if (stage._combinedSelected[i] !== stage._combinedSelectedShadow[i]) {\n return true;\n }\n }\n }\n return dirty;\n}\n\n/**\n * A function that will be called before execute. Updates each post-process stage in the composite.\n * @param {Context} context The context.\n * @param {Boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n * @private\n */\nPostProcessStageComposite.prototype.update = function (context, useLogDepth) {\n this._selectedDirty = isSelectedTextureDirty(this);\n\n this._selectedShadow = this._selected;\n this._parentSelectedShadow = this._parentSelected;\n this._combinedSelectedShadow = this._combinedSelected;\n this._selectedLength = defined(this._selected) ? this._selected.length : 0;\n this._parentSelectedLength = defined(this._parentSelected)\n ? this._parentSelected.length\n : 0;\n\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n const stage = stages[i];\n if (this._selectedDirty) {\n stage.parentSelected = this._combinedSelected;\n }\n stage.update(context, useLogDepth);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageComposite#destroy\n */\nPostProcessStageComposite.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageComposite#isDestroyed\n */\nPostProcessStageComposite.prototype.destroy = function () {\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n stages[i].destroy();\n }\n return destroyObject(this);\n};\nexport default PostProcessStageComposite;\n", "import buildModuleUrl from \"../Core/buildModuleUrl.js\";\nimport Color from \"../Core/Color.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport defined from \"../Core/defined.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport AcesTonemapping from \"../Shaders/PostProcessStages/AcesTonemappingStage.js\";\nimport AmbientOcclusionGenerate from \"../Shaders/PostProcessStages/AmbientOcclusionGenerate.js\";\nimport AmbientOcclusionModulate from \"../Shaders/PostProcessStages/AmbientOcclusionModulate.js\";\nimport BlackAndWhite from \"../Shaders/PostProcessStages/BlackAndWhite.js\";\nimport BloomComposite from \"../Shaders/PostProcessStages/BloomComposite.js\";\nimport Brightness from \"../Shaders/PostProcessStages/Brightness.js\";\nimport ContrastBias from \"../Shaders/PostProcessStages/ContrastBias.js\";\nimport DepthOfField from \"../Shaders/PostProcessStages/DepthOfField.js\";\nimport DepthView from \"../Shaders/PostProcessStages/DepthView.js\";\nimport EdgeDetection from \"../Shaders/PostProcessStages/EdgeDetection.js\";\nimport FilmicTonemapping from \"../Shaders/PostProcessStages/FilmicTonemapping.js\";\nimport FXAA from \"../Shaders/PostProcessStages/FXAA.js\";\nimport GaussianBlur1D from \"../Shaders/PostProcessStages/GaussianBlur1D.js\";\nimport LensFlare from \"../Shaders/PostProcessStages/LensFlare.js\";\nimport ModifiedReinhardTonemapping from \"../Shaders/PostProcessStages/ModifiedReinhardTonemapping.js\";\nimport NightVision from \"../Shaders/PostProcessStages/NightVision.js\";\nimport ReinhardTonemapping from \"../Shaders/PostProcessStages/ReinhardTonemapping.js\";\nimport Silhouette from \"../Shaders/PostProcessStages/Silhouette.js\";\nimport FXAA3_11 from \"../Shaders/FXAA3_11.js\";\nimport AutoExposure from \"./AutoExposure.js\";\nimport PostProcessStage from \"./PostProcessStage.js\";\nimport PostProcessStageComposite from \"./PostProcessStageComposite.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\n\n/**\n * Contains functions for creating common post-process stages.\n *\n * @namespace PostProcessStageLibrary\n */\nconst PostProcessStageLibrary = {};\n\nfunction createBlur(name) {\n const delta = 1.0;\n const sigma = 2.0;\n const stepSize = 1.0;\n\n const blurShader = `#define USE_STEP_SIZE\\n${GaussianBlur1D}`;\n const blurX = new PostProcessStage({\n name: `${name}_x_direction`,\n fragmentShader: blurShader,\n uniforms: {\n delta: delta,\n sigma: sigma,\n stepSize: stepSize,\n direction: 0.0,\n },\n sampleMode: PostProcessStageSampleMode.LINEAR,\n });\n const blurY = new PostProcessStage({\n name: `${name}_y_direction`,\n fragmentShader: blurShader,\n uniforms: {\n delta: delta,\n sigma: sigma,\n stepSize: stepSize,\n direction: 1.0,\n },\n sampleMode: PostProcessStageSampleMode.LINEAR,\n });\n\n const uniforms = {};\n Object.defineProperties(uniforms, {\n delta: {\n get: function () {\n return blurX.uniforms.delta;\n },\n set: function (value) {\n const blurXUniforms = blurX.uniforms;\n const blurYUniforms = blurY.uniforms;\n blurXUniforms.delta = blurYUniforms.delta = value;\n },\n },\n sigma: {\n get: function () {\n return blurX.uniforms.sigma;\n },\n set: function (value) {\n const blurXUniforms = blurX.uniforms;\n const blurYUniforms = blurY.uniforms;\n blurXUniforms.sigma = blurYUniforms.sigma = value;\n },\n },\n stepSize: {\n get: function () {\n return blurX.uniforms.stepSize;\n },\n set: function (value) {\n const blurXUniforms = blurX.uniforms;\n const blurYUniforms = blurY.uniforms;\n blurXUniforms.stepSize = blurYUniforms.stepSize = value;\n },\n },\n });\n return new PostProcessStageComposite({\n name: name,\n stages: [blurX, blurY],\n uniforms: uniforms,\n });\n}\n\n/**\n * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.\n * <p>\n * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <p>\n * <code>delta</code> and <code>sigma</code> are used to compute the weights of a Gaussian filter. The equation is <code>exp((-0.5 * delta * delta) / (sigma * sigma))</code>.\n * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.\n * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies a Gaussian blur to the input texture.\n */\nPostProcessStageLibrary.createBlurStage = function () {\n return createBlur(\"czm_blur\");\n};\n\n/**\n * Creates a post-process stage that applies a depth of field effect.\n * <p>\n * Depth of field simulates camera focus. Objects in the scene that are in focus\n * will be clear whereas objects not in focus will be blurred.\n * </p>\n * <p>\n * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <p>\n * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.\n * </p>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the areas out of focus.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies a depth of field effect.\n */\nPostProcessStageLibrary.createDepthOfFieldStage = function () {\n const blur = createBlur(\"czm_depth_of_field_blur\");\n const dof = new PostProcessStage({\n name: \"czm_depth_of_field_composite\",\n fragmentShader: DepthOfField,\n uniforms: {\n focalDistance: 5.0,\n blurTexture: blur.name,\n },\n });\n\n const uniforms = {};\n Object.defineProperties(uniforms, {\n focalDistance: {\n get: function () {\n return dof.uniforms.focalDistance;\n },\n set: function (value) {\n dof.uniforms.focalDistance = value;\n },\n },\n delta: {\n get: function () {\n return blur.uniforms.delta;\n },\n set: function (value) {\n blur.uniforms.delta = value;\n },\n },\n sigma: {\n get: function () {\n return blur.uniforms.sigma;\n },\n set: function (value) {\n blur.uniforms.sigma = value;\n },\n },\n stepSize: {\n get: function () {\n return blur.uniforms.stepSize;\n },\n set: function (value) {\n blur.uniforms.stepSize = value;\n },\n },\n });\n return new PostProcessStageComposite({\n name: \"czm_depth_of_field\",\n stages: [blur, dof],\n inputPreviousStageTexture: false,\n uniforms: uniforms,\n });\n};\n\n/**\n * Whether or not a depth of field stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {Boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isDepthOfFieldSupported = function (scene) {\n return scene.context.depthTexture;\n};\n\n/**\n * Creates a post-process stage that detects edges.\n * <p>\n * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.\n * </p>\n * <p>\n * This stage has the following uniforms: <code>color</code> and <code>length</code>\n * </p>\n * <ul>\n * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>\n * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>\n * </ul>\n * <p>\n * This stage is not supported in 2D.\n * </p>\n * @return {PostProcessStage} A post-process stage that applies an edge detection effect.\n *\n * @example\n * // multiple silhouette effects\n * const yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();\n * yellowEdge.uniforms.color = Cesium.Color.YELLOW;\n * yellowEdge.selected = [feature0];\n *\n * const greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();\n * greenEdge.uniforms.color = Cesium.Color.LIME;\n * greenEdge.selected = [feature1];\n *\n * // draw edges around feature0 and feature1\n * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);\n */\nPostProcessStageLibrary.createEdgeDetectionStage = function () {\n // unique name generated on call so more than one effect can be added\n const name = createGuid();\n return new PostProcessStage({\n name: `czm_edge_detection_${name}`,\n fragmentShader: EdgeDetection,\n uniforms: {\n length: 0.25,\n color: Color.clone(Color.BLACK),\n },\n });\n};\n\n/**\n * Whether or not an edge detection stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {Boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isEdgeDetectionSupported = function (scene) {\n return scene.context.depthTexture;\n};\n\nfunction getSilhouetteEdgeDetection(edgeDetectionStages) {\n if (!defined(edgeDetectionStages)) {\n return PostProcessStageLibrary.createEdgeDetectionStage();\n }\n\n const edgeDetection = new PostProcessStageComposite({\n name: \"czm_edge_detection_multiple\",\n stages: edgeDetectionStages,\n inputPreviousStageTexture: false,\n });\n\n const compositeUniforms = {};\n let fsDecl = \"\";\n let fsLoop = \"\";\n for (let i = 0; i < edgeDetectionStages.length; ++i) {\n fsDecl += `uniform sampler2D edgeTexture${i}; \\n`;\n fsLoop +=\n ` vec4 edge${i} = texture2D(edgeTexture${i}, v_textureCoordinates); \\n` +\n ` if (edge${i}.a > 0.0) \\n` +\n ` { \\n` +\n ` color = edge${i}; \\n` +\n ` break; \\n` +\n ` } \\n`;\n compositeUniforms[`edgeTexture${i}`] = edgeDetectionStages[i].name;\n }\n\n const fs =\n `${fsDecl}varying vec2 v_textureCoordinates; \\n` +\n `void main() { \\n` +\n ` vec4 color = vec4(0.0); \\n` +\n ` for (int i = 0; i < ${edgeDetectionStages.length}; i++) \\n` +\n ` { \\n${fsLoop} } \\n` +\n ` gl_FragColor = color; \\n` +\n `} \\n`;\n\n const edgeComposite = new PostProcessStage({\n name: \"czm_edge_detection_combine\",\n fragmentShader: fs,\n uniforms: compositeUniforms,\n });\n return new PostProcessStageComposite({\n name: \"czm_edge_detection_composite\",\n stages: [edgeDetection, edgeComposite],\n });\n}\n\n/**\n * Creates a post-process stage that applies a silhouette effect.\n * <p>\n * A silhouette effect composites the color from the edge detection pass with input color texture.\n * </p>\n * <p>\n * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>\n * </p>\n * <p>\n * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.\n * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.\n * </p>\n * @param {PostProcessStage[]} [edgeDetectionStages] An array of edge detection post process stages.\n * @return {PostProcessStageComposite} A post-process stage that applies a silhouette effect.\n */\nPostProcessStageLibrary.createSilhouetteStage = function (edgeDetectionStages) {\n const edgeDetection = getSilhouetteEdgeDetection(edgeDetectionStages);\n const silhouetteProcess = new PostProcessStage({\n name: \"czm_silhouette_color_edges\",\n fragmentShader: Silhouette,\n uniforms: {\n silhouetteTexture: edgeDetection.name,\n },\n });\n\n return new PostProcessStageComposite({\n name: \"czm_silhouette\",\n stages: [edgeDetection, silhouetteProcess],\n inputPreviousStageTexture: false,\n uniforms: edgeDetection.uniforms,\n });\n};\n\n/**\n * Whether or not a silhouette stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {Boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isSilhouetteSupported = function (scene) {\n return scene.context.depthTexture;\n};\n\n/**\n * Creates a post-process stage that applies a bloom effect to the input texture.\n * <p>\n * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.\n * </p>\n * <p>\n * This post-process stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <ul>\n * <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li>\n * <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is\n * added to the brightness. The default value is <code>-0.3</code>.</li>\n * <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture.\n * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage to applies a bloom effect.\n *\n * @private\n */\nPostProcessStageLibrary.createBloomStage = function () {\n const contrastBias = new PostProcessStage({\n name: \"czm_bloom_contrast_bias\",\n fragmentShader: ContrastBias,\n uniforms: {\n contrast: 128.0,\n brightness: -0.3,\n },\n });\n const blur = createBlur(\"czm_bloom_blur\");\n const generateComposite = new PostProcessStageComposite({\n name: \"czm_bloom_contrast_bias_blur\",\n stages: [contrastBias, blur],\n });\n\n const bloomComposite = new PostProcessStage({\n name: \"czm_bloom_generate_composite\",\n fragmentShader: BloomComposite,\n uniforms: {\n glowOnly: false,\n bloomTexture: generateComposite.name,\n },\n });\n\n const uniforms = {};\n Object.defineProperties(uniforms, {\n glowOnly: {\n get: function () {\n return bloomComposite.uniforms.glowOnly;\n },\n set: function (value) {\n bloomComposite.uniforms.glowOnly = value;\n },\n },\n contrast: {\n get: function () {\n return contrastBias.uniforms.contrast;\n },\n set: function (value) {\n contrastBias.uniforms.contrast = value;\n },\n },\n brightness: {\n get: function () {\n return contrastBias.uniforms.brightness;\n },\n set: function (value) {\n contrastBias.uniforms.brightness = value;\n },\n },\n delta: {\n get: function () {\n return blur.uniforms.delta;\n },\n set: function (value) {\n blur.uniforms.delta = value;\n },\n },\n sigma: {\n get: function () {\n return blur.uniforms.sigma;\n },\n set: function (value) {\n blur.uniforms.sigma = value;\n },\n },\n stepSize: {\n get: function () {\n return blur.uniforms.stepSize;\n },\n set: function (value) {\n blur.uniforms.stepSize = value;\n },\n },\n });\n\n return new PostProcessStageComposite({\n name: \"czm_bloom\",\n stages: [generateComposite, bloomComposite],\n inputPreviousStageTexture: false,\n uniforms: uniforms,\n });\n};\n\n/**\n * Creates a post-process stage that Horizon-based Ambient Occlusion (HBAO) to the input texture.\n * <p>\n * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the\n * surface receives light and regardless of the light's position.\n * </p>\n * <p>\n * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,\n * <code>stepSize</code>, <code>frustumLength</code>, <code>randomTexture</code>, <code>ambientOcclusionOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.\n * </p>\n * <ul>\n * <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>\n * <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,\n * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>\n * <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,\n * sampling stops in the current direction. The default value is <code>0.26</code>.</li>\n * <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li>\n * <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.\n * The default value is <code>1000.0</code>.</li>\n * <li><code>randomTexture</code> is a texture where the red channel is a random value in [0.0, 1.0]. The default value is <code>undefined</code>. This texture needs to be set.</li>\n * <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated\n * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the shadows generated from the image to make them smoother.\n * </p>\n * @return {PostProcessStageComposite} A post-process stage that applies an ambient occlusion effect.\n *\n * @private\n */\nPostProcessStageLibrary.createAmbientOcclusionStage = function () {\n const generate = new PostProcessStage({\n name: \"czm_ambient_occlusion_generate\",\n fragmentShader: AmbientOcclusionGenerate,\n uniforms: {\n intensity: 3.0,\n bias: 0.1,\n lengthCap: 0.26,\n stepSize: 1.95,\n frustumLength: 1000.0,\n randomTexture: undefined,\n },\n });\n const blur = createBlur(\"czm_ambient_occlusion_blur\");\n blur.uniforms.stepSize = 0.86;\n const generateAndBlur = new PostProcessStageComposite({\n name: \"czm_ambient_occlusion_generate_blur\",\n stages: [generate, blur],\n });\n\n const ambientOcclusionModulate = new PostProcessStage({\n name: \"czm_ambient_occlusion_composite\",\n fragmentShader: AmbientOcclusionModulate,\n uniforms: {\n ambientOcclusionOnly: false,\n ambientOcclusionTexture: generateAndBlur.name,\n },\n });\n\n const uniforms = {};\n Object.defineProperties(uniforms, {\n intensity: {\n get: function () {\n return generate.uniforms.intensity;\n },\n set: function (value) {\n generate.uniforms.intensity = value;\n },\n },\n bias: {\n get: function () {\n return generate.uniforms.bias;\n },\n set: function (value) {\n generate.uniforms.bias = value;\n },\n },\n lengthCap: {\n get: function () {\n return generate.uniforms.lengthCap;\n },\n set: function (value) {\n generate.uniforms.lengthCap = value;\n },\n },\n stepSize: {\n get: function () {\n return generate.uniforms.stepSize;\n },\n set: function (value) {\n generate.uniforms.stepSize = value;\n },\n },\n frustumLength: {\n get: function () {\n return generate.uniforms.frustumLength;\n },\n set: function (value) {\n generate.uniforms.frustumLength = value;\n },\n },\n randomTexture: {\n get: function () {\n return generate.uniforms.randomTexture;\n },\n set: function (value) {\n generate.uniforms.randomTexture = value;\n },\n },\n delta: {\n get: function () {\n return blur.uniforms.delta;\n },\n set: function (value) {\n blur.uniforms.delta = value;\n },\n },\n sigma: {\n get: function () {\n return blur.uniforms.sigma;\n },\n set: function (value) {\n blur.uniforms.sigma = value;\n },\n },\n blurStepSize: {\n get: function () {\n return blur.uniforms.stepSize;\n },\n set: function (value) {\n blur.uniforms.stepSize = value;\n },\n },\n ambientOcclusionOnly: {\n get: function () {\n return ambientOcclusionModulate.uniforms.ambientOcclusionOnly;\n },\n set: function (value) {\n ambientOcclusionModulate.uniforms.ambientOcclusionOnly = value;\n },\n },\n });\n\n return new PostProcessStageComposite({\n name: \"czm_ambient_occlusion\",\n stages: [generateAndBlur, ambientOcclusionModulate],\n inputPreviousStageTexture: false,\n uniforms: uniforms,\n });\n};\n\n/**\n * Whether or not an ambient occlusion stage is supported.\n * <p>\n * This stage requires the WEBGL_depth_texture extension.\n * </p>\n *\n * @param {Scene} scene The scene.\n * @return {Boolean} Whether this post process stage is supported.\n *\n * @see {Context#depthTexture}\n * @see {@link http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/|WEBGL_depth_texture}\n */\nPostProcessStageLibrary.isAmbientOcclusionSupported = function (scene) {\n return scene.context.depthTexture;\n};\n\nconst fxaaFS = `#define FXAA_QUALITY_PRESET 39 \\n${FXAA3_11}\\n${FXAA}`;\n\n/**\n * Creates a post-process stage that applies Fast Approximate Anti-aliasing (FXAA) to the input texture.\n * @return {PostProcessStage} A post-process stage that applies Fast Approximate Anti-aliasing to the input texture.\n *\n * @private\n */\nPostProcessStageLibrary.createFXAAStage = function () {\n return new PostProcessStage({\n name: \"czm_FXAA\",\n fragmentShader: fxaaFS,\n sampleMode: PostProcessStageSampleMode.LINEAR,\n });\n};\n\n/**\n * Creates a post-process stage that applies ACES tonemapping operator.\n * @param {Boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies ACES tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createAcesTonemappingStage = function (\n useAutoExposure\n) {\n let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n fs += AcesTonemapping;\n return new PostProcessStage({\n name: \"czm_aces\",\n fragmentShader: fs,\n uniforms: {\n autoExposure: undefined,\n },\n });\n};\n\n/**\n * Creates a post-process stage that applies filmic tonemapping operator.\n * @param {Boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies filmic tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createFilmicTonemappingStage = function (\n useAutoExposure\n) {\n let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n fs += FilmicTonemapping;\n return new PostProcessStage({\n name: \"czm_filmic\",\n fragmentShader: fs,\n uniforms: {\n autoExposure: undefined,\n },\n });\n};\n\n/**\n * Creates a post-process stage that applies Reinhard tonemapping operator.\n * @param {Boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies Reinhard tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createReinhardTonemappingStage = function (\n useAutoExposure\n) {\n let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n fs += ReinhardTonemapping;\n return new PostProcessStage({\n name: \"czm_reinhard\",\n fragmentShader: fs,\n uniforms: {\n autoExposure: undefined,\n },\n });\n};\n\n/**\n * Creates a post-process stage that applies modified Reinhard tonemapping operator.\n * @param {Boolean} useAutoExposure Whether or not to use auto-exposure.\n * @return {PostProcessStage} A post-process stage that applies modified Reinhard tonemapping operator.\n * @private\n */\nPostProcessStageLibrary.createModifiedReinhardTonemappingStage = function (\n useAutoExposure\n) {\n let fs = useAutoExposure ? \"#define AUTO_EXPOSURE\\n\" : \"\";\n fs += ModifiedReinhardTonemapping;\n return new PostProcessStage({\n name: \"czm_modified_reinhard\",\n fragmentShader: fs,\n uniforms: {\n white: Color.WHITE,\n autoExposure: undefined,\n },\n });\n};\n\n/**\n * Creates a post-process stage that finds the average luminance of the input texture.\n * @return {PostProcessStage} A post-process stage that finds the average luminance of the input texture.\n * @private\n */\nPostProcessStageLibrary.createAutoExposureStage = function () {\n return new AutoExposure();\n};\n\n/**\n * Creates a post-process stage that renders the input texture with black and white gradations.\n * <p>\n * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.\n * </p>\n * @return {PostProcessStage} A post-process stage that renders the input texture with black and white gradations.\n */\nPostProcessStageLibrary.createBlackAndWhiteStage = function () {\n return new PostProcessStage({\n name: \"czm_black_and_white\",\n fragmentShader: BlackAndWhite,\n uniforms: {\n gradations: 5.0,\n },\n });\n};\n\n/**\n * Creates a post-process stage that saturates the input texture.\n * <p>\n * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.\n * </p>\n * @return {PostProcessStage} A post-process stage that saturates the input texture.\n */\nPostProcessStageLibrary.createBrightnessStage = function () {\n return new PostProcessStage({\n name: \"czm_brightness\",\n fragmentShader: Brightness,\n uniforms: {\n brightness: 0.5,\n },\n });\n};\n\n/**\n * Creates a post-process stage that adds a night vision effect to the input texture.\n * @return {PostProcessStage} A post-process stage that adds a night vision effect to the input texture.\n */\nPostProcessStageLibrary.createNightVisionStage = function () {\n return new PostProcessStage({\n name: \"czm_night_vision\",\n fragmentShader: NightVision,\n });\n};\n\n/**\n * Creates a post-process stage that replaces the input color texture with a black and white texture representing the fragment depth at each pixel.\n * @return {PostProcessStage} A post-process stage that replaces the input color texture with a black and white texture representing the fragment depth at each pixel.\n *\n * @private\n */\nPostProcessStageLibrary.createDepthViewStage = function () {\n return new PostProcessStage({\n name: \"czm_depth_view\",\n fragmentShader: DepthView,\n });\n};\n\n/**\n * Creates a post-process stage that applies an effect simulating light flaring a camera lens.\n * <p>\n * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,\n * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.\n * <ul>\n * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>\n * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>\n * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>\n * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>\n * <li><code>ghostDispersal</code> is a scalar indicating how far the halo effect is from the center of the texture. The default value is <code>0.4</code>.</li>\n * <li><code>haloWidth</code> is a scalar representing the width of the halo from the ghost dispersal. The default value is <code>0.4</code>.</li>\n * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>\n * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>\n * </ul>\n * </p>\n * @return {PostProcessStage} A post-process stage for applying a lens flare effect.\n */\nPostProcessStageLibrary.createLensFlareStage = function () {\n return new PostProcessStage({\n name: \"czm_lens_flare\",\n fragmentShader: LensFlare,\n uniforms: {\n dirtTexture: buildModuleUrl(\"Assets/Textures/LensFlare/DirtMask.jpg\"),\n starTexture: buildModuleUrl(\"Assets/Textures/LensFlare/StarBurst.jpg\"),\n intensity: 2.0,\n distortion: 10.0,\n ghostDispersal: 0.4,\n haloWidth: 0.4,\n dirtAmount: 0.4,\n earthRadius: Ellipsoid.WGS84.maximumRadius,\n },\n });\n};\nexport default PostProcessStageLibrary;\n", "import Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport FramebufferManager from \"../Renderer/FramebufferManager.js\";\n\n/**\n * Creates a minimal amount of textures and framebuffers.\n *\n * @alias PostProcessStageTextureCache\n * @constructor\n *\n * @param {PostProcessStageCollection} postProcessStageCollection The post process collection.\n *\n * @private\n */\nfunction PostProcessStageTextureCache(postProcessStageCollection) {\n this._collection = postProcessStageCollection;\n\n this._framebuffers = [];\n this._stageNameToFramebuffer = {};\n\n this._width = undefined;\n this._height = undefined;\n this._updateDependencies = false;\n}\n\nfunction getLastStageName(stage) {\n while (defined(stage.length)) {\n stage = stage.get(stage.length - 1);\n }\n return stage.name;\n}\n\nfunction getStageDependencies(\n collection,\n context,\n dependencies,\n stage,\n previousName\n) {\n if (!stage.enabled || !stage._isSupported(context)) {\n return previousName;\n }\n\n const stageDependencies = (dependencies[stage.name] = {});\n if (defined(previousName)) {\n const previous = collection.getStageByName(previousName);\n stageDependencies[getLastStageName(previous)] = true;\n }\n const uniforms = stage.uniforms;\n if (defined(uniforms)) {\n const uniformNames = Object.getOwnPropertyNames(uniforms);\n const uniformNamesLength = uniformNames.length;\n for (let i = 0; i < uniformNamesLength; ++i) {\n const value = uniforms[uniformNames[i]];\n if (typeof value === \"string\") {\n const dependent = collection.getStageByName(value);\n if (defined(dependent)) {\n stageDependencies[getLastStageName(dependent)] = true;\n }\n }\n }\n }\n\n return stage.name;\n}\n\nfunction getCompositeDependencies(\n collection,\n context,\n dependencies,\n composite,\n previousName\n) {\n if (\n (defined(composite.enabled) && !composite.enabled) ||\n (defined(composite._isSupported) && !composite._isSupported(context))\n ) {\n return previousName;\n }\n\n const originalDependency = previousName;\n\n const inSeries =\n !defined(composite.inputPreviousStageTexture) ||\n composite.inputPreviousStageTexture;\n let currentName = previousName;\n const length = composite.length;\n for (let i = 0; i < length; ++i) {\n const stage = composite.get(i);\n if (defined(stage.length)) {\n currentName = getCompositeDependencies(\n collection,\n context,\n dependencies,\n stage,\n previousName\n );\n } else {\n currentName = getStageDependencies(\n collection,\n context,\n dependencies,\n stage,\n previousName\n );\n }\n // Stages in a series only depend on the previous stage\n if (inSeries) {\n previousName = currentName;\n }\n }\n\n // Stages not in a series depend on every stage executed before it since it could reference it as a uniform.\n // This prevents looking at the dependencies of each stage in the composite, but might create more framebuffers than necessary.\n // In practice, there are only 2-3 stages in these composites.\n let j;\n let name;\n if (!inSeries) {\n for (j = 1; j < length; ++j) {\n name = getLastStageName(composite.get(j));\n const currentDependencies = dependencies[name];\n for (let k = 0; k < j; ++k) {\n currentDependencies[getLastStageName(composite.get(k))] = true;\n }\n }\n } else {\n for (j = 1; j < length; ++j) {\n name = getLastStageName(composite.get(j));\n if (!defined(dependencies[name])) {\n dependencies[name] = {};\n }\n dependencies[name][originalDependency] = true;\n }\n }\n\n return currentName;\n}\n\nfunction getDependencies(collection, context) {\n const dependencies = {};\n\n if (defined(collection.ambientOcclusion)) {\n const ao = collection.ambientOcclusion;\n const bloom = collection.bloom;\n const tonemapping = collection._tonemapping;\n const fxaa = collection.fxaa;\n\n let previousName = getCompositeDependencies(\n collection,\n context,\n dependencies,\n ao,\n undefined\n );\n previousName = getCompositeDependencies(\n collection,\n context,\n dependencies,\n bloom,\n previousName\n );\n previousName = getStageDependencies(\n collection,\n context,\n dependencies,\n tonemapping,\n previousName\n );\n previousName = getCompositeDependencies(\n collection,\n context,\n dependencies,\n collection,\n previousName\n );\n getStageDependencies(collection, context, dependencies, fxaa, previousName);\n } else {\n getCompositeDependencies(\n collection,\n context,\n dependencies,\n collection,\n undefined\n );\n }\n\n return dependencies;\n}\n\nfunction getFramebuffer(cache, stageName, dependencies) {\n const collection = cache._collection;\n const stage = collection.getStageByName(stageName);\n\n const textureScale = stage._textureScale;\n const forcePowerOfTwo = stage._forcePowerOfTwo;\n const pixelFormat = stage._pixelFormat;\n const pixelDatatype = stage._pixelDatatype;\n const clearColor = stage._clearColor;\n\n let i;\n let framebuffer;\n const framebuffers = cache._framebuffers;\n const length = framebuffers.length;\n for (i = 0; i < length; ++i) {\n framebuffer = framebuffers[i];\n\n if (\n textureScale !== framebuffer.textureScale ||\n forcePowerOfTwo !== framebuffer.forcePowerOfTwo ||\n pixelFormat !== framebuffer.pixelFormat ||\n pixelDatatype !== framebuffer.pixelDatatype ||\n !Color.equals(clearColor, framebuffer.clearColor)\n ) {\n continue;\n }\n\n const stageNames = framebuffer.stages;\n const stagesLength = stageNames.length;\n let foundConflict = false;\n for (let j = 0; j < stagesLength; ++j) {\n if (dependencies[stageNames[j]]) {\n foundConflict = true;\n break;\n }\n }\n\n if (!foundConflict) {\n break;\n }\n }\n\n if (defined(framebuffer) && i < length) {\n framebuffer.stages.push(stageName);\n return framebuffer;\n }\n\n framebuffer = {\n textureScale: textureScale,\n forcePowerOfTwo: forcePowerOfTwo,\n pixelFormat: pixelFormat,\n pixelDatatype: pixelDatatype,\n clearColor: clearColor,\n stages: [stageName],\n buffer: new FramebufferManager({\n pixelFormat: pixelFormat,\n pixelDatatype: pixelDatatype,\n }),\n clear: undefined,\n };\n\n framebuffers.push(framebuffer);\n return framebuffer;\n}\n\nfunction createFramebuffers(cache, context) {\n const dependencies = getDependencies(cache._collection, context);\n for (const stageName in dependencies) {\n if (dependencies.hasOwnProperty(stageName)) {\n cache._stageNameToFramebuffer[stageName] = getFramebuffer(\n cache,\n stageName,\n dependencies[stageName]\n );\n }\n }\n}\n\nfunction releaseResources(cache) {\n const framebuffers = cache._framebuffers;\n const length = framebuffers.length;\n for (let i = 0; i < length; ++i) {\n const framebuffer = framebuffers[i];\n framebuffer.buffer.destroy();\n }\n}\n\nfunction updateFramebuffers(cache, context) {\n const width = cache._width;\n const height = cache._height;\n\n const framebuffers = cache._framebuffers;\n const length = framebuffers.length;\n for (let i = 0; i < length; ++i) {\n const framebuffer = framebuffers[i];\n\n const scale = framebuffer.textureScale;\n let textureWidth = Math.ceil(width * scale);\n let textureHeight = Math.ceil(height * scale);\n\n let size = Math.min(textureWidth, textureHeight);\n if (framebuffer.forcePowerOfTwo) {\n if (!CesiumMath.isPowerOfTwo(size)) {\n size = CesiumMath.nextPowerOfTwo(size);\n }\n textureWidth = size;\n textureHeight = size;\n }\n\n framebuffer.buffer.update(context, textureWidth, textureHeight);\n framebuffer.clear = new ClearCommand({\n color: framebuffer.clearColor,\n framebuffer: framebuffer.buffer.framebuffer,\n });\n }\n}\n\nPostProcessStageTextureCache.prototype.updateDependencies = function () {\n this._updateDependencies = true;\n};\n\n/**\n * Called before the stages in the collection are executed. Creates the minimum amount of framebuffers for a post-process collection.\n *\n * @param {Context} context The context.\n */\nPostProcessStageTextureCache.prototype.update = function (context) {\n const collection = this._collection;\n const updateDependencies = this._updateDependencies;\n const aoEnabled =\n defined(collection.ambientOcclusion) &&\n collection.ambientOcclusion.enabled &&\n collection.ambientOcclusion._isSupported(context);\n const bloomEnabled =\n defined(collection.bloom) &&\n collection.bloom.enabled &&\n collection.bloom._isSupported(context);\n const tonemappingEnabled =\n defined(collection._tonemapping) &&\n collection._tonemapping.enabled &&\n collection._tonemapping._isSupported(context);\n const fxaaEnabled =\n defined(collection.fxaa) &&\n collection.fxaa.enabled &&\n collection.fxaa._isSupported(context);\n const needsCheckDimensionsUpdate =\n !defined(collection._activeStages) ||\n collection._activeStages.length > 0 ||\n aoEnabled ||\n bloomEnabled ||\n tonemappingEnabled ||\n fxaaEnabled;\n if (\n updateDependencies ||\n (!needsCheckDimensionsUpdate && this._framebuffers.length > 0)\n ) {\n releaseResources(this);\n this._framebuffers.length = 0;\n this._stageNameToFramebuffer = {};\n this._width = undefined;\n this._height = undefined;\n }\n\n if (!updateDependencies && !needsCheckDimensionsUpdate) {\n return;\n }\n\n if (this._framebuffers.length === 0) {\n createFramebuffers(this, context);\n }\n\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n const dimensionsChanged = this._width !== width || this._height !== height;\n if (!updateDependencies && !dimensionsChanged) {\n return;\n }\n\n this._width = width;\n this._height = height;\n this._updateDependencies = false;\n releaseResources(this);\n updateFramebuffers(this, context);\n};\n\n/**\n * Clears all of the framebuffers.\n *\n * @param {Context} context The context.\n */\nPostProcessStageTextureCache.prototype.clear = function (context) {\n const framebuffers = this._framebuffers;\n for (let i = 0; i < framebuffers.length; ++i) {\n framebuffers[i].clear.execute(context);\n }\n};\n\n/**\n * Gets the stage with the given name.\n * @param {String} name The name of the stage.\n * @return {PostProcessStage|PostProcessStageComposite}\n */\nPostProcessStageTextureCache.prototype.getStageByName = function (name) {\n return this._collection.getStageByName(name);\n};\n\n/**\n * Gets the output texture for a stage with the given name.\n * @param {String} name The name of the stage.\n * @return {Texture|undefined} The output texture of the stage with the given name.\n */\nPostProcessStageTextureCache.prototype.getOutputTexture = function (name) {\n return this._collection.getOutputTexture(name);\n};\n\n/**\n * Gets the framebuffer for a stage with the given name.\n *\n * @param {String} name The name of the stage.\n * @return {Framebuffer|undefined} The framebuffer for the stage with the given name.\n */\nPostProcessStageTextureCache.prototype.getFramebuffer = function (name) {\n const framebuffer = this._stageNameToFramebuffer[name];\n if (!defined(framebuffer)) {\n return undefined;\n }\n return framebuffer.buffer.framebuffer;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageTextureCache#destroy\n */\nPostProcessStageTextureCache.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageTextureCache#isDestroyed\n */\nPostProcessStageTextureCache.prototype.destroy = function () {\n releaseResources(this);\n return destroyObject(this);\n};\nexport default PostProcessStageTextureCache;\n", "/**\n * A tonemapping algorithm when rendering with high dynamic range.\n *\n * @enum {Number}\n * @private\n */\nconst Tonemapper = {\n /**\n * Use the Reinhard tonemapping operator.\n *\n * @type {Number}\n * @constant\n */\n REINHARD: 0,\n\n /**\n * Use the modified Reinhard tonemapping operator.\n *\n * @type {Number}\n * @constant\n */\n MODIFIED_REINHARD: 1,\n\n /**\n * Use the Filmic tonemapping operator.\n *\n * @type {Number}\n * @constant\n */\n FILMIC: 2,\n\n /**\n * Use the ACES tonemapping operator.\n *\n * @type {Number}\n * @constant\n */\n ACES: 3,\n\n /**\n * @private\n */\n validate: function (tonemapper) {\n return (\n tonemapper === Tonemapper.REINHARD ||\n tonemapper === Tonemapper.MODIFIED_REINHARD ||\n tonemapper === Tonemapper.FILMIC ||\n tonemapper === Tonemapper.ACES\n );\n },\n};\nexport default Object.freeze(Tonemapper);\n", "import Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport Sampler from \"../Renderer/Sampler.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport TextureMagnificationFilter from \"../Renderer/TextureMagnificationFilter.js\";\nimport TextureMinificationFilter from \"../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../Renderer/TextureWrap.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PostProcessStageLibrary from \"./PostProcessStageLibrary.js\";\nimport PostProcessStageTextureCache from \"./PostProcessStageTextureCache.js\";\nimport Tonemapper from \"./Tonemapper.js\";\n\nconst stackScratch = [];\n\n/**\n * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.\n * <p>\n * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered\n * to by the previous stage in the collection.\n * </p>\n * <p>\n * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.\n * </p>\n * <p>\n * If the FXAA stage is enabled, it will execute after all other stages.\n * </p>\n *\n * @alias PostProcessStageCollection\n * @constructor\n */\nfunction PostProcessStageCollection() {\n const fxaa = PostProcessStageLibrary.createFXAAStage();\n const ao = PostProcessStageLibrary.createAmbientOcclusionStage();\n const bloom = PostProcessStageLibrary.createBloomStage();\n\n // Auto-exposure is currently disabled because most shaders output a value in [0.0, 1.0].\n // Some shaders, such as the atmosphere and ground atmosphere, output values slightly over 1.0.\n this._autoExposureEnabled = false;\n this._autoExposure = PostProcessStageLibrary.createAutoExposureStage();\n this._tonemapping = undefined;\n this._tonemapper = undefined;\n\n // set tonemapper and tonemapping\n this.tonemapper = Tonemapper.ACES;\n\n const tonemapping = this._tonemapping;\n\n fxaa.enabled = false;\n ao.enabled = false;\n bloom.enabled = false;\n tonemapping.enabled = false; // will be enabled if necessary in update\n\n const textureCache = new PostProcessStageTextureCache(this);\n\n const stageNames = {};\n const stack = stackScratch;\n stack.push(fxaa, ao, bloom, tonemapping);\n while (stack.length > 0) {\n const stage = stack.pop();\n stageNames[stage.name] = stage;\n stage._textureCache = textureCache;\n\n const length = stage.length;\n if (defined(length)) {\n for (let i = 0; i < length; ++i) {\n stack.push(stage.get(i));\n }\n }\n }\n\n this._stages = [];\n this._activeStages = [];\n this._previousActiveStages = [];\n\n this._randomTexture = undefined; // For AO\n\n const that = this;\n ao.uniforms.randomTexture = function () {\n return that._randomTexture;\n };\n\n this._ao = ao;\n this._bloom = bloom;\n this._fxaa = fxaa;\n\n this._aoEnabled = undefined;\n this._bloomEnabled = undefined;\n this._tonemappingEnabled = undefined;\n this._fxaaEnabled = undefined;\n\n this._activeStagesChanged = false;\n this._stagesRemoved = false;\n this._textureCacheDirty = false;\n\n this._stageNames = stageNames;\n this._textureCache = textureCache;\n}\n\nObject.defineProperties(PostProcessStageCollection.prototype, {\n /**\n * Determines if all of the post-process stages in the collection are ready to be executed.\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n let readyAndEnabled = false;\n const stages = this._stages;\n const length = stages.length;\n for (let i = length - 1; i >= 0; --i) {\n const stage = stages[i];\n readyAndEnabled = readyAndEnabled || (stage.ready && stage.enabled);\n }\n\n const fxaa = this._fxaa;\n const ao = this._ao;\n const bloom = this._bloom;\n const tonemapping = this._tonemapping;\n\n readyAndEnabled = readyAndEnabled || (fxaa.ready && fxaa.enabled);\n readyAndEnabled = readyAndEnabled || (ao.ready && ao.enabled);\n readyAndEnabled = readyAndEnabled || (bloom.ready && bloom.enabled);\n readyAndEnabled =\n readyAndEnabled || (tonemapping.ready && tonemapping.enabled);\n\n return readyAndEnabled;\n },\n },\n /**\n * A post-process stage for Fast Approximate Anti-aliasing.\n * <p>\n * When enabled, this stage will execute after all others.\n * </p>\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {PostProcessStage}\n * @readonly\n */\n fxaa: {\n get: function () {\n return this._fxaa;\n },\n },\n /**\n * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.\n * <p>\n * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the\n * surface receives light and regardless of the light's position.\n * </p>\n * <p>\n * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,\n * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.\n * </p>\n * <ul>\n * <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>\n *\n * <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,\n * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>\n *\n * <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,\n * sampling stops in the current direction. The default value is <code>0.26</code>.</li>\n *\n * <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li>\n *\n * <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.\n * The default value is <code>1000.0</code>.</li>\n *\n * <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated\n * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the shadows generated from the image to make them smoother.\n * </p>\n * <p>\n * When enabled, this stage will execute before all others.\n * </p>\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {PostProcessStageComposite}\n * @readonly\n */\n ambientOcclusion: {\n get: function () {\n return this._ao;\n },\n },\n /**\n * A post-process stage for a bloom effect.\n * <p>\n * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.\n * </p>\n * <p>\n * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.\n * </p>\n * <ul>\n * <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li>\n *\n * <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is\n * added to the brightness. The default value is <code>-0.3</code>.</li>\n *\n * <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture.\n * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>\n * </ul>\n * <p>\n * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.\n * The blur is applied to the shadows generated from the image to make them smoother.\n * </p>\n * <p>\n * When enabled, this stage will execute before all others.\n * </p>\n *\n * @memberOf PostProcessStageCollection.prototype\n * @type {PostProcessStageComposite}\n * @readonly\n */\n bloom: {\n get: function () {\n return this._bloom;\n },\n },\n /**\n * The number of post-process stages in this collection.\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n removeStages(this);\n return this._stages.length;\n },\n },\n /**\n * A reference to the last texture written to when executing the post-process stages in this collection.\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {Texture}\n * @readonly\n * @private\n */\n outputTexture: {\n get: function () {\n const fxaa = this._fxaa;\n if (fxaa.enabled && fxaa.ready) {\n return this.getOutputTexture(fxaa.name);\n }\n\n const stages = this._stages;\n const length = stages.length;\n for (let i = length - 1; i >= 0; --i) {\n const stage = stages[i];\n if (defined(stage) && stage.ready && stage.enabled) {\n return this.getOutputTexture(stage.name);\n }\n }\n\n const tonemapping = this._tonemapping;\n if (tonemapping.enabled && tonemapping.ready) {\n return this.getOutputTexture(tonemapping.name);\n }\n\n const bloom = this._bloom;\n if (bloom.enabled && bloom.ready) {\n return this.getOutputTexture(bloom.name);\n }\n\n const ao = this._ao;\n if (ao.enabled && ao.ready) {\n return this.getOutputTexture(ao.name);\n }\n\n return undefined;\n },\n },\n /**\n * Whether the collection has a stage that has selected features.\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {Boolean}\n * @readonly\n * @private\n */\n hasSelected: {\n get: function () {\n const stages = this._stages.slice();\n while (stages.length > 0) {\n const stage = stages.pop();\n if (!defined(stage)) {\n continue;\n }\n if (defined(stage.selected)) {\n return true;\n }\n const length = stage.length;\n if (defined(length)) {\n for (let i = 0; i < length; ++i) {\n stages.push(stage.get(i));\n }\n }\n }\n return false;\n },\n },\n\n /**\n * Gets and sets the tonemapping algorithm used when rendering with high dynamic range.\n *\n * @memberof PostProcessStageCollection.prototype\n * @type {Tonemapper}\n * @private\n */\n tonemapper: {\n get: function () {\n return this._tonemapper;\n },\n set: function (value) {\n if (this._tonemapper === value) {\n return;\n }\n if (defined(this._tonemapping)) {\n delete this._stageNames[this._tonemapping.name];\n this._tonemapping.destroy();\n }\n\n const useAutoExposure = this._autoExposureEnabled;\n let tonemapper;\n\n switch (value) {\n case Tonemapper.REINHARD:\n tonemapper = PostProcessStageLibrary.createReinhardTonemappingStage(\n useAutoExposure\n );\n break;\n case Tonemapper.MODIFIED_REINHARD:\n tonemapper = PostProcessStageLibrary.createModifiedReinhardTonemappingStage(\n useAutoExposure\n );\n break;\n case Tonemapper.FILMIC:\n tonemapper = PostProcessStageLibrary.createFilmicTonemappingStage(\n useAutoExposure\n );\n break;\n default:\n tonemapper = PostProcessStageLibrary.createAcesTonemappingStage(\n useAutoExposure\n );\n break;\n }\n\n if (useAutoExposure) {\n const autoexposure = this._autoExposure;\n tonemapper.uniforms.autoExposure = function () {\n return autoexposure.outputTexture;\n };\n }\n\n this._tonemapper = value;\n this._tonemapping = tonemapper;\n\n if (defined(this._stageNames)) {\n this._stageNames[tonemapper.name] = tonemapper;\n tonemapper._textureCache = this._textureCache;\n }\n\n this._textureCacheDirty = true;\n },\n },\n});\n\nfunction removeStages(collection) {\n if (!collection._stagesRemoved) {\n return;\n }\n\n collection._stagesRemoved = false;\n\n const newStages = [];\n const stages = collection._stages;\n const length = stages.length;\n for (let i = 0, j = 0; i < length; ++i) {\n const stage = stages[i];\n if (stage) {\n stage._index = j++;\n newStages.push(stage);\n }\n }\n\n collection._stages = newStages;\n}\n\n/**\n * Adds the post-process stage to the collection.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage to add to the collection.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage that was added to the collection.\n *\n * @exception {DeveloperError} The post-process stage has already been added to the collection or does not have a unique name.\n */\nPostProcessStageCollection.prototype.add = function (stage) {\n const stageNames = this._stageNames;\n\n const stack = stackScratch;\n stack.push(stage);\n while (stack.length > 0) {\n const currentStage = stack.pop();\nstageNames[currentStage.name] = currentStage;\n currentStage._textureCache = this._textureCache;\n\n const length = currentStage.length;\n if (defined(length)) {\n for (let i = 0; i < length; ++i) {\n stack.push(currentStage.get(i));\n }\n }\n }\n\n const stages = this._stages;\n stage._index = stages.length;\n stages.push(stage);\n this._textureCacheDirty = true;\n return stage;\n};\n\n/**\n * Removes a post-process stage from the collection and destroys it.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage to remove from the collection.\n * @return {Boolean} Whether the post-process stage was removed.\n */\nPostProcessStageCollection.prototype.remove = function (stage) {\n if (!this.contains(stage)) {\n return false;\n }\n\n const stageNames = this._stageNames;\n\n const stack = stackScratch;\n stack.push(stage);\n while (stack.length > 0) {\n const currentStage = stack.pop();\n delete stageNames[currentStage.name];\n\n const length = currentStage.length;\n if (defined(length)) {\n for (let i = 0; i < length; ++i) {\n stack.push(currentStage.get(i));\n }\n }\n }\n\n this._stages[stage._index] = undefined;\n this._stagesRemoved = true;\n this._textureCacheDirty = true;\n stage._index = undefined;\n stage._textureCache = undefined;\n stage.destroy();\n return true;\n};\n\n/**\n * Returns whether the collection contains a post-process stage.\n *\n * @param {PostProcessStage|PostProcessStageComposite} stage The post-process stage.\n * @return {Boolean} Whether the collection contains the post-process stage.\n */\nPostProcessStageCollection.prototype.contains = function (stage) {\n return (\n defined(stage) &&\n defined(stage._index) &&\n stage._textureCache === this._textureCache\n );\n};\n\n/**\n * Gets the post-process stage at <code>index</code>.\n *\n * @param {Number} index The index of the post-process stage.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage at index.\n */\nPostProcessStageCollection.prototype.get = function (index) {\n removeStages(this);\n const stages = this._stages;\nreturn stages[index];\n};\n\n/**\n * Removes all post-process stages from the collection and destroys them.\n */\nPostProcessStageCollection.prototype.removeAll = function () {\n const stages = this._stages;\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n this.remove(stages[i]);\n }\n stages.length = 0;\n};\n\n/**\n * Gets a post-process stage in the collection by its name.\n *\n * @param {String} name The name of the post-process stage.\n * @return {PostProcessStage|PostProcessStageComposite} The post-process stage.\n *\n * @private\n */\nPostProcessStageCollection.prototype.getStageByName = function (name) {\n return this._stageNames[name];\n};\n\n/**\n * Called before the post-process stages in the collection are executed. Calls update for each stage and creates WebGL resources.\n *\n * @param {Context} context The context.\n * @param {Boolean} useLogDepth Whether the scene uses a logarithmic depth buffer.\n *\n * @private\n */\nPostProcessStageCollection.prototype.update = function (\n context,\n useLogDepth,\n useHdr\n) {\n removeStages(this);\n\n const previousActiveStages = this._activeStages;\n const activeStages = (this._activeStages = this._previousActiveStages);\n this._previousActiveStages = previousActiveStages;\n\n const stages = this._stages;\n let length = (activeStages.length = stages.length);\n\n let i;\n let stage;\n let count = 0;\n for (i = 0; i < length; ++i) {\n stage = stages[i];\n if (stage.ready && stage.enabled && stage._isSupported(context)) {\n activeStages[count++] = stage;\n }\n }\n\n activeStages.length = count;\n\n let activeStagesChanged = count !== previousActiveStages.length;\n if (!activeStagesChanged) {\n for (i = 0; i < count; ++i) {\n if (activeStages[i] !== previousActiveStages[i]) {\n activeStagesChanged = true;\n break;\n }\n }\n }\n\n const ao = this._ao;\n const bloom = this._bloom;\n const autoexposure = this._autoExposure;\n const tonemapping = this._tonemapping;\n const fxaa = this._fxaa;\n\n tonemapping.enabled = useHdr;\n\n const aoEnabled = ao.enabled && ao._isSupported(context);\n const bloomEnabled = bloom.enabled && bloom._isSupported(context);\n const tonemappingEnabled =\n tonemapping.enabled && tonemapping._isSupported(context);\n const fxaaEnabled = fxaa.enabled && fxaa._isSupported(context);\n\n if (\n activeStagesChanged ||\n this._textureCacheDirty ||\n aoEnabled !== this._aoEnabled ||\n bloomEnabled !== this._bloomEnabled ||\n tonemappingEnabled !== this._tonemappingEnabled ||\n fxaaEnabled !== this._fxaaEnabled\n ) {\n // The number of stages to execute has changed.\n // Update dependencies and recreate framebuffers.\n this._textureCache.updateDependencies();\n\n this._aoEnabled = aoEnabled;\n this._bloomEnabled = bloomEnabled;\n this._tonemappingEnabled = tonemappingEnabled;\n this._fxaaEnabled = fxaaEnabled;\n this._textureCacheDirty = false;\n }\n\n if (defined(this._randomTexture) && !aoEnabled) {\n this._randomTexture.destroy();\n this._randomTexture = undefined;\n }\n\n if (!defined(this._randomTexture) && aoEnabled) {\n length = 256 * 256 * 3;\n const random = new Uint8Array(length);\n for (i = 0; i < length; i += 3) {\n random[i] = Math.floor(Math.random() * 255.0);\n }\n\n this._randomTexture = new Texture({\n context: context,\n pixelFormat: PixelFormat.RGB,\n pixelDatatype: PixelDatatype.UNSIGNED_BYTE,\n source: {\n arrayBufferView: random,\n width: 256,\n height: 256,\n },\n sampler: new Sampler({\n wrapS: TextureWrap.REPEAT,\n wrapT: TextureWrap.REPEAT,\n minificationFilter: TextureMinificationFilter.NEAREST,\n magnificationFilter: TextureMagnificationFilter.NEAREST,\n }),\n });\n }\n\n this._textureCache.update(context);\n\n fxaa.update(context, useLogDepth);\n ao.update(context, useLogDepth);\n bloom.update(context, useLogDepth);\n tonemapping.update(context, useLogDepth);\n\n if (this._autoExposureEnabled) {\n autoexposure.update(context, useLogDepth);\n }\n\n length = stages.length;\n for (i = 0; i < length; ++i) {\n stages[i].update(context, useLogDepth);\n }\n\n count = 0;\n for (i = 0; i < length; ++i) {\n stage = stages[i];\n if (stage.ready && stage.enabled && stage._isSupported(context)) {\n count++;\n }\n }\n\n activeStagesChanged = count !== activeStages.length;\n if (activeStagesChanged) {\n this.update(context, useLogDepth, useHdr);\n }\n};\n\n/**\n * Clears all of the framebuffers used by the stages.\n *\n * @param {Context} context The context.\n *\n * @private\n */\nPostProcessStageCollection.prototype.clear = function (context) {\n this._textureCache.clear(context);\n\n if (this._autoExposureEnabled) {\n this._autoExposure.clear(context);\n }\n};\n\nfunction getOutputTexture(stage) {\n while (defined(stage.length)) {\n stage = stage.get(stage.length - 1);\n }\n return stage.outputTexture;\n}\n\n/**\n * Gets the output texture of a stage with the given name.\n *\n * @param {String} stageName The name of the stage.\n * @return {Texture|undefined} The texture rendered to by the stage with the given name.\n *\n * @private\n */\nPostProcessStageCollection.prototype.getOutputTexture = function (stageName) {\n const stage = this.getStageByName(stageName);\n if (!defined(stage)) {\n return undefined;\n }\n return getOutputTexture(stage);\n};\n\nfunction execute(stage, context, colorTexture, depthTexture, idTexture) {\n if (defined(stage.execute)) {\n stage.execute(context, colorTexture, depthTexture, idTexture);\n return;\n }\n\n const length = stage.length;\n let i;\n\n if (stage.inputPreviousStageTexture) {\n execute(stage.get(0), context, colorTexture, depthTexture, idTexture);\n for (i = 1; i < length; ++i) {\n execute(\n stage.get(i),\n context,\n getOutputTexture(stage.get(i - 1)),\n depthTexture,\n idTexture\n );\n }\n } else {\n for (i = 0; i < length; ++i) {\n execute(stage.get(i), context, colorTexture, depthTexture, idTexture);\n }\n }\n}\n\n/**\n * Executes all ready and enabled stages in the collection.\n *\n * @param {Context} context The context.\n * @param {Texture} colorTexture The color texture rendered to by the scene.\n * @param {Texture} depthTexture The depth texture written to by the scene.\n * @param {Texture} idTexture The id texture written to by the scene.\n *\n * @private\n */\nPostProcessStageCollection.prototype.execute = function (\n context,\n colorTexture,\n depthTexture,\n idTexture\n) {\n const activeStages = this._activeStages;\n const length = activeStages.length;\n const fxaa = this._fxaa;\n const ao = this._ao;\n const bloom = this._bloom;\n const autoexposure = this._autoExposure;\n const tonemapping = this._tonemapping;\n\n const aoEnabled = ao.enabled && ao._isSupported(context);\n const bloomEnabled = bloom.enabled && bloom._isSupported(context);\n const autoExposureEnabled = this._autoExposureEnabled;\n const tonemappingEnabled =\n tonemapping.enabled && tonemapping._isSupported(context);\n const fxaaEnabled = fxaa.enabled && fxaa._isSupported(context);\n\n if (\n !fxaaEnabled &&\n !aoEnabled &&\n !bloomEnabled &&\n !tonemappingEnabled &&\n length === 0\n ) {\n return;\n }\n\n let initialTexture = colorTexture;\n if (aoEnabled && ao.ready) {\n execute(ao, context, initialTexture, depthTexture, idTexture);\n initialTexture = getOutputTexture(ao);\n }\n if (bloomEnabled && bloom.ready) {\n execute(bloom, context, initialTexture, depthTexture, idTexture);\n initialTexture = getOutputTexture(bloom);\n }\n if (autoExposureEnabled && autoexposure.ready) {\n execute(autoexposure, context, initialTexture, depthTexture, idTexture);\n }\n if (tonemappingEnabled && tonemapping.ready) {\n execute(tonemapping, context, initialTexture, depthTexture, idTexture);\n initialTexture = getOutputTexture(tonemapping);\n }\n\n let lastTexture = initialTexture;\n\n if (length > 0) {\n execute(activeStages[0], context, initialTexture, depthTexture, idTexture);\n for (let i = 1; i < length; ++i) {\n execute(\n activeStages[i],\n context,\n getOutputTexture(activeStages[i - 1]),\n depthTexture,\n idTexture\n );\n }\n lastTexture = getOutputTexture(activeStages[length - 1]);\n }\n\n if (fxaaEnabled && fxaa.ready) {\n execute(fxaa, context, lastTexture, depthTexture, idTexture);\n }\n};\n\n/**\n * Copies the output of all executed stages to the color texture of a framebuffer.\n *\n * @param {Context} context The context.\n * @param {Framebuffer} framebuffer The framebuffer to copy to.\n *\n * @private\n */\nPostProcessStageCollection.prototype.copy = function (context, framebuffer) {\n if (!defined(this._copyColorCommand)) {\n const that = this;\n this._copyColorCommand = context.createViewportQuadCommand(PassThrough, {\n uniformMap: {\n colorTexture: function () {\n return that.outputTexture;\n },\n },\n owner: this,\n });\n }\n\n this._copyColorCommand.framebuffer = framebuffer;\n this._copyColorCommand.execute(context);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <p>\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n * </p>\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see PostProcessStageCollection#destroy\n */\nPostProcessStageCollection.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <p>\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n * </p>\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @see PostProcessStageCollection#isDestroyed\n */\nPostProcessStageCollection.prototype.destroy = function () {\n this._fxaa.destroy();\n this._ao.destroy();\n this._bloom.destroy();\n this._autoExposure.destroy();\n this._tonemapping.destroy();\n this.removeAll();\n this._textureCache = this._textureCache && this._textureCache.destroy();\n return destroyObject(this);\n};\nexport default PostProcessStageCollection;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Provides general quadtree tiles to be displayed on or near the surface of an ellipsoid. It is intended to be\n * used with the {@link QuadtreePrimitive}. This type describes an interface and is not intended to be\n * instantiated directly.\n *\n * @alias QuadtreeTileProvider\n * @constructor\n * @private\n */\nfunction QuadtreeTileProvider() {\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Computes the default geometric error for level zero of the quadtree.\n *\n * @memberof QuadtreeTileProvider\n *\n * @param {TilingScheme} tilingScheme The tiling scheme for which to compute the geometric error.\n * @returns {Number} The maximum geometric error at level zero, in meters.\n */\nQuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError = function (\n tilingScheme\n) {\n return (\n (tilingScheme.ellipsoid.maximumRadius * 2 * Math.PI * 0.25) /\n (65 * tilingScheme.getNumberOfXTilesAtLevel(0))\n );\n};\n\nObject.defineProperties(QuadtreeTileProvider.prototype, {\n /**\n * Gets or sets the {@link QuadtreePrimitive} for which this provider is\n * providing tiles.\n * @memberof QuadtreeTileProvider.prototype\n * @type {QuadtreePrimitive}\n */\n quadtree: {\n get: DeveloperError.throwInstantiationError,\n set: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof QuadtreeTileProvider.prototype\n * @type {Boolean}\n */\n ready: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets the tiling scheme used by the provider. This property should\n * not be accessed before {@link QuadtreeTileProvider#ready} returns true.\n * @memberof QuadtreeTileProvider.prototype\n * @type {TilingScheme}\n */\n tilingScheme: {\n get: DeveloperError.throwInstantiationError,\n },\n\n /**\n * Gets an event that is raised when the geometry provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof QuadtreeTileProvider.prototype\n * @type {Event}\n */\n errorEvent: {\n get: DeveloperError.throwInstantiationError,\n },\n});\n\n/**\n * Called at the beginning of the update cycle, regardless of id a new frame is being rendered, before {@link QuadtreeTileProvider#beginUpdate}\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n */\nQuadtreeTileProvider.prototype.update = DeveloperError.throwInstantiationError;\n\n/**\n * Called at the beginning of the update cycle for each render frame, before {@link QuadtreeTileProvider#showTileThisFrame}\n * or any other functions.\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} commandList An array of rendering commands. This method may push\n * commands into this array.\n */\nQuadtreeTileProvider.prototype.beginUpdate =\n DeveloperError.throwInstantiationError;\n\n/**\n * Called at the end of the update cycle for each render frame, after {@link QuadtreeTileProvider#showTileThisFrame}\n * and any other functions.\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {DrawCommand[]} commandList An array of rendering commands. This method may push\n * commands into this array.\n */\nQuadtreeTileProvider.prototype.endUpdate =\n DeveloperError.throwInstantiationError;\n\n/**\n * Gets the maximum geometric error allowed in a tile at a given level, in meters. This function should not be\n * called before {@link QuadtreeTileProvider#ready} returns true.\n *\n * @see QuadtreeTileProvider#computeDefaultLevelZeroMaximumGeometricError\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Number} level The tile level for which to get the maximum geometric error.\n * @returns {Number} The maximum geometric error in meters.\n */\nQuadtreeTileProvider.prototype.getLevelMaximumGeometricError =\n DeveloperError.throwInstantiationError;\n\n/**\n * Loads, or continues loading, a given tile. This function will continue to be called\n * until {@link QuadtreeTile#state} is no longer {@link QuadtreeTileLoadState#LOADING}. This function should\n * not be called before {@link QuadtreeTileProvider#ready} returns true.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The frame state.\n * @param {QuadtreeTile} tile The tile to load.\n *\n * @exception {DeveloperError} <code>loadTile</code> must not be called before the tile provider is ready.\n */\nQuadtreeTileProvider.prototype.loadTile =\n DeveloperError.throwInstantiationError;\n\n/**\n * Determines the visibility of a given tile. The tile may be fully visible, partially visible, or not\n * visible at all. Tiles that are renderable and are at least partially visible will be shown by a call\n * to {@link QuadtreeTileProvider#showTileThisFrame}.\n *\n * @memberof QuadtreeTileProvider\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information about the current frame.\n * @param {QuadtreeOccluders} occluders The objects that may occlude this tile.\n *\n * @returns {Visibility} The visibility of the tile.\n */\nQuadtreeTileProvider.prototype.computeTileVisibility =\n DeveloperError.throwInstantiationError;\n\n/**\n * Shows a specified tile in this frame. The provider can cause the tile to be shown by adding\n * render commands to the commandList, or use any other method as appropriate. The tile is not\n * expected to be visible next frame as well, unless this method is call next frame, too.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {Context} context The rendering context.\n * @param {FrameState} frameState The state information of the current rendering frame.\n * @param {DrawCommand[]} commandList The list of rendering commands. This method may add additional commands to this list.\n */\nQuadtreeTileProvider.prototype.showTileThisFrame =\n DeveloperError.throwInstantiationError;\n\n/**\n * Gets the distance from the camera to the closest point on the tile. This is used for level-of-detail selection.\n *\n * @memberof QuadtreeTileProvider\n * @function\n *\n * @param {QuadtreeTile} tile The tile instance.\n * @param {FrameState} frameState The state information of the current rendering frame.\n *\n * @returns {Number} The distance from the camera to the closest point on the tile, in meters.\n */\nQuadtreeTileProvider.prototype.computeDistanceToTile =\n DeveloperError.throwInstantiationError;\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @memberof QuadtreeTileProvider\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see QuadtreeTileProvider#destroy\n */\nQuadtreeTileProvider.prototype.isDestroyed =\n DeveloperError.throwInstantiationError;\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @memberof QuadtreeTileProvider\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * provider = provider && provider();\n *\n * @see QuadtreeTileProvider#isDestroyed\n */\nQuadtreeTileProvider.prototype.destroy = DeveloperError.throwInstantiationError;\nexport default QuadtreeTileProvider;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport Check from \"../Core/Check.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport Ray from \"../Core/Ray.js\";\nimport ScreenSpaceEventHandler from \"../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../Core/ScreenSpaceEventType.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport Camera from \"./Camera.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * @private\n */\nfunction SceneTransitioner(scene) {\n this._scene = scene;\n this._currentTweens = [];\n this._morphHandler = undefined;\n this._morphCancelled = false;\n this._completeMorph = undefined;\n this._morphToOrthographic = false;\n}\n\nSceneTransitioner.prototype.completeMorph = function () {\n if (defined(this._completeMorph)) {\n this._completeMorph();\n }\n};\n\nSceneTransitioner.prototype.morphTo2D = function (duration, ellipsoid) {\n if (defined(this._completeMorph)) {\n this._completeMorph();\n }\n\n const scene = this._scene;\n this._previousMode = scene.mode;\n this._morphToOrthographic =\n scene.camera.frustum instanceof OrthographicFrustum;\n\n if (\n this._previousMode === SceneMode.SCENE2D ||\n this._previousMode === SceneMode.MORPHING\n ) {\n return;\n }\n this._scene.morphStart.raiseEvent(\n this,\n this._previousMode,\n SceneMode.SCENE2D,\n true\n );\n\n scene._mode = SceneMode.MORPHING;\n scene.camera._setTransform(Matrix4.IDENTITY);\n\n if (this._previousMode === SceneMode.COLUMBUS_VIEW) {\n morphFromColumbusViewTo2D(this, duration);\n } else {\n morphFrom3DTo2D(this, duration, ellipsoid);\n }\n\n if (duration === 0.0 && defined(this._completeMorph)) {\n this._completeMorph();\n }\n};\n\nconst scratchToCVPosition = new Cartesian3();\nconst scratchToCVDirection = new Cartesian3();\nconst scratchToCVUp = new Cartesian3();\nconst scratchToCVPosition2D = new Cartesian3();\nconst scratchToCVDirection2D = new Cartesian3();\nconst scratchToCVUp2D = new Cartesian3();\nconst scratchToCVSurfacePosition = new Cartesian3();\nconst scratchToCVCartographic = new Cartographic();\nconst scratchToCVToENU = new Matrix4();\nconst scratchToCVFrustumPerspective = new PerspectiveFrustum();\nconst scratchToCVFrustumOrthographic = new OrthographicFrustum();\nconst scratchToCVCamera = {\n position: undefined,\n direction: undefined,\n up: undefined,\n position2D: undefined,\n direction2D: undefined,\n up2D: undefined,\n frustum: undefined,\n};\n\nSceneTransitioner.prototype.morphToColumbusView = function (\n duration,\n ellipsoid\n) {\n if (defined(this._completeMorph)) {\n this._completeMorph();\n }\n\n const scene = this._scene;\n this._previousMode = scene.mode;\n\n if (\n this._previousMode === SceneMode.COLUMBUS_VIEW ||\n this._previousMode === SceneMode.MORPHING\n ) {\n return;\n }\n this._scene.morphStart.raiseEvent(\n this,\n this._previousMode,\n SceneMode.COLUMBUS_VIEW,\n true\n );\n\n scene.camera._setTransform(Matrix4.IDENTITY);\n\n let position = scratchToCVPosition;\n const direction = scratchToCVDirection;\n const up = scratchToCVUp;\n\n if (duration > 0.0) {\n position.x = 0.0;\n position.y = -1.0;\n position.z = 1.0;\n position = Cartesian3.multiplyByScalar(\n Cartesian3.normalize(position, position),\n 5.0 * ellipsoid.maximumRadius,\n position\n );\n\n Cartesian3.negate(Cartesian3.normalize(position, direction), direction);\n Cartesian3.cross(Cartesian3.UNIT_X, direction, up);\n } else {\n const camera = scene.camera;\n if (this._previousMode === SceneMode.SCENE2D) {\n Cartesian3.clone(camera.position, position);\n position.z = camera.frustum.right - camera.frustum.left;\n Cartesian3.negate(Cartesian3.UNIT_Z, direction);\n Cartesian3.clone(Cartesian3.UNIT_Y, up);\n } else {\n Cartesian3.clone(camera.positionWC, position);\n Cartesian3.clone(camera.directionWC, direction);\n Cartesian3.clone(camera.upWC, up);\n\n const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n position,\n scratchToCVSurfacePosition\n );\n const toENU = Transforms.eastNorthUpToFixedFrame(\n surfacePoint,\n ellipsoid,\n scratchToCVToENU\n );\n Matrix4.inverseTransformation(toENU, toENU);\n\n scene.mapProjection.project(\n ellipsoid.cartesianToCartographic(position, scratchToCVCartographic),\n position\n );\n Matrix4.multiplyByPointAsVector(toENU, direction, direction);\n Matrix4.multiplyByPointAsVector(toENU, up, up);\n }\n }\n\n let frustum;\n if (this._morphToOrthographic) {\n frustum = scratchToCVFrustumOrthographic;\n frustum.width = scene.camera.frustum.right - scene.camera.frustum.left;\n frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n } else {\n frustum = scratchToCVFrustumPerspective;\n frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n frustum.fov = CesiumMath.toRadians(60.0);\n }\n\n const cameraCV = scratchToCVCamera;\n cameraCV.position = position;\n cameraCV.direction = direction;\n cameraCV.up = up;\n cameraCV.frustum = frustum;\n\n const complete = completeColumbusViewCallback(cameraCV);\n createMorphHandler(this, complete);\n\n if (this._previousMode === SceneMode.SCENE2D) {\n morphFrom2DToColumbusView(this, duration, cameraCV, complete);\n } else {\n cameraCV.position2D = Matrix4.multiplyByPoint(\n Camera.TRANSFORM_2D,\n position,\n scratchToCVPosition2D\n );\n cameraCV.direction2D = Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n direction,\n scratchToCVDirection2D\n );\n cameraCV.up2D = Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n up,\n scratchToCVUp2D\n );\n\n scene._mode = SceneMode.MORPHING;\n morphFrom3DToColumbusView(this, duration, cameraCV, complete);\n }\n\n if (duration === 0.0 && defined(this._completeMorph)) {\n this._completeMorph();\n }\n};\n\nconst scratchCVTo3DCamera = {\n position: new Cartesian3(),\n direction: new Cartesian3(),\n up: new Cartesian3(),\n frustum: undefined,\n};\nconst scratch2DTo3DFrustumPersp = new PerspectiveFrustum();\n\nSceneTransitioner.prototype.morphTo3D = function (duration, ellipsoid) {\n if (defined(this._completeMorph)) {\n this._completeMorph();\n }\n\n const scene = this._scene;\n this._previousMode = scene.mode;\n\n if (\n this._previousMode === SceneMode.SCENE3D ||\n this._previousMode === SceneMode.MORPHING\n ) {\n return;\n }\n this._scene.morphStart.raiseEvent(\n this,\n this._previousMode,\n SceneMode.SCENE3D,\n true\n );\n\n scene._mode = SceneMode.MORPHING;\n scene.camera._setTransform(Matrix4.IDENTITY);\n\n if (this._previousMode === SceneMode.SCENE2D) {\n morphFrom2DTo3D(this, duration, ellipsoid);\n } else {\n let camera3D;\n if (duration > 0.0) {\n camera3D = scratchCVTo3DCamera;\n Cartesian3.fromDegrees(\n 0.0,\n 0.0,\n 5.0 * ellipsoid.maximumRadius,\n ellipsoid,\n camera3D.position\n );\n Cartesian3.negate(camera3D.position, camera3D.direction);\n Cartesian3.normalize(camera3D.direction, camera3D.direction);\n Cartesian3.clone(Cartesian3.UNIT_Z, camera3D.up);\n } else {\n camera3D = getColumbusViewTo3DCamera(this, ellipsoid);\n }\n\n let frustum;\n const camera = scene.camera;\n if (camera.frustum instanceof OrthographicFrustum) {\n frustum = camera.frustum.clone();\n } else {\n frustum = scratch2DTo3DFrustumPersp;\n frustum.aspectRatio =\n scene.drawingBufferWidth / scene.drawingBufferHeight;\n frustum.fov = CesiumMath.toRadians(60.0);\n }\n camera3D.frustum = frustum;\n\n const complete = complete3DCallback(camera3D);\n createMorphHandler(this, complete);\n\n morphFromColumbusViewTo3D(this, duration, camera3D, complete);\n }\n\n if (duration === 0.0 && defined(this._completeMorph)) {\n this._completeMorph();\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n */\nSceneTransitioner.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * transitioner = transitioner && transitioner.destroy();\n */\nSceneTransitioner.prototype.destroy = function () {\n destroyMorphHandler(this);\n return destroyObject(this);\n};\n\nfunction createMorphHandler(transitioner, completeMorphFunction) {\n if (transitioner._scene.completeMorphOnUserInput) {\n transitioner._morphHandler = new ScreenSpaceEventHandler(\n transitioner._scene.canvas\n );\n\n const completeMorph = function () {\n transitioner._morphCancelled = true;\n transitioner._scene.camera.cancelFlight();\n completeMorphFunction(transitioner);\n };\n transitioner._completeMorph = completeMorph;\n transitioner._morphHandler.setInputAction(\n completeMorph,\n ScreenSpaceEventType.LEFT_DOWN\n );\n transitioner._morphHandler.setInputAction(\n completeMorph,\n ScreenSpaceEventType.MIDDLE_DOWN\n );\n transitioner._morphHandler.setInputAction(\n completeMorph,\n ScreenSpaceEventType.RIGHT_DOWN\n );\n transitioner._morphHandler.setInputAction(\n completeMorph,\n ScreenSpaceEventType.WHEEL\n );\n }\n}\n\nfunction destroyMorphHandler(transitioner) {\n const tweens = transitioner._currentTweens;\n for (let i = 0; i < tweens.length; ++i) {\n tweens[i].cancelTween();\n }\n transitioner._currentTweens.length = 0;\n transitioner._morphHandler =\n transitioner._morphHandler && transitioner._morphHandler.destroy();\n}\n\nconst scratchCVTo3DCartographic = new Cartographic();\nconst scratchCVTo3DSurfacePoint = new Cartesian3();\nconst scratchCVTo3DFromENU = new Matrix4();\n\nfunction getColumbusViewTo3DCamera(transitioner, ellipsoid) {\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const camera3D = scratchCVTo3DCamera;\n const position = camera3D.position;\n const direction = camera3D.direction;\n const up = camera3D.up;\n\n const positionCarto = scene.mapProjection.unproject(\n camera.position,\n scratchCVTo3DCartographic\n );\n ellipsoid.cartographicToCartesian(positionCarto, position);\n const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n position,\n scratchCVTo3DSurfacePoint\n );\n\n const fromENU = Transforms.eastNorthUpToFixedFrame(\n surfacePoint,\n ellipsoid,\n scratchCVTo3DFromENU\n );\n\n Matrix4.multiplyByPointAsVector(fromENU, camera.direction, direction);\n Matrix4.multiplyByPointAsVector(fromENU, camera.up, up);\n\n return camera3D;\n}\n\nconst scratchCVTo3DStartPos = new Cartesian3();\nconst scratchCVTo3DStartDir = new Cartesian3();\nconst scratchCVTo3DStartUp = new Cartesian3();\nconst scratchCVTo3DEndPos = new Cartesian3();\nconst scratchCVTo3DEndDir = new Cartesian3();\nconst scratchCVTo3DEndUp = new Cartesian3();\n\nfunction morphFromColumbusViewTo3D(\n transitioner,\n duration,\n endCamera,\n complete\n) {\n duration *= 0.5;\n\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const startPos = Cartesian3.clone(camera.position, scratchCVTo3DStartPos);\n const startDir = Cartesian3.clone(camera.direction, scratchCVTo3DStartDir);\n const startUp = Cartesian3.clone(camera.up, scratchCVTo3DStartUp);\n\n const endPos = Matrix4.multiplyByPoint(\n Camera.TRANSFORM_2D_INVERSE,\n endCamera.position,\n scratchCVTo3DEndPos\n );\n const endDir = Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D_INVERSE,\n endCamera.direction,\n scratchCVTo3DEndDir\n );\n const endUp = Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D_INVERSE,\n endCamera.up,\n scratchCVTo3DEndUp\n );\n\n function update(value) {\n columbusViewMorph(startPos, endPos, value.time, camera.position);\n columbusViewMorph(startDir, endDir, value.time, camera.direction);\n columbusViewMorph(startUp, endUp, value.time, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n }\n\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: update,\n complete: function () {\n addMorphTimeAnimations(transitioner, scene, 0.0, 1.0, duration, complete);\n },\n });\n transitioner._currentTweens.push(tween);\n}\n\nconst scratch2DTo3DFrustumOrtho = new OrthographicFrustum();\nconst scratch3DToCVStartPos = new Cartesian3();\nconst scratch3DToCVStartDir = new Cartesian3();\nconst scratch3DToCVStartUp = new Cartesian3();\nconst scratch3DToCVEndPos = new Cartesian3();\nconst scratch3DToCVEndDir = new Cartesian3();\nconst scratch3DToCVEndUp = new Cartesian3();\n\nfunction morphFrom2DTo3D(transitioner, duration, ellipsoid) {\n duration /= 3.0;\n\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n let camera3D;\n if (duration > 0.0) {\n camera3D = scratchCVTo3DCamera;\n Cartesian3.fromDegrees(\n 0.0,\n 0.0,\n 5.0 * ellipsoid.maximumRadius,\n ellipsoid,\n camera3D.position\n );\n Cartesian3.negate(camera3D.position, camera3D.direction);\n Cartesian3.normalize(camera3D.direction, camera3D.direction);\n Cartesian3.clone(Cartesian3.UNIT_Z, camera3D.up);\n } else {\n camera.position.z = camera.frustum.right - camera.frustum.left;\n\n camera3D = getColumbusViewTo3DCamera(transitioner, ellipsoid);\n }\n\n let frustum;\n if (transitioner._morphToOrthographic) {\n frustum = scratch2DTo3DFrustumOrtho;\n frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n frustum.width = camera.frustum.right - camera.frustum.left;\n } else {\n frustum = scratch2DTo3DFrustumPersp;\n frustum.aspectRatio = scene.drawingBufferWidth / scene.drawingBufferHeight;\n frustum.fov = CesiumMath.toRadians(60.0);\n }\n\n camera3D.frustum = frustum;\n\n const complete = complete3DCallback(camera3D);\n createMorphHandler(transitioner, complete);\n\n let morph;\n if (transitioner._morphToOrthographic) {\n morph = function () {\n morphFromColumbusViewTo3D(transitioner, duration, camera3D, complete);\n };\n } else {\n morph = function () {\n morphOrthographicToPerspective(\n transitioner,\n duration,\n camera3D,\n function () {\n morphFromColumbusViewTo3D(transitioner, duration, camera3D, complete);\n }\n );\n };\n }\n\n if (duration > 0.0) {\n scene._mode = SceneMode.SCENE2D;\n camera.flyTo({\n duration: duration,\n destination: Cartesian3.fromDegrees(\n 0.0,\n 0.0,\n 5.0 * ellipsoid.maximumRadius,\n ellipsoid,\n scratch3DToCVEndPos\n ),\n complete: function () {\n scene._mode = SceneMode.MORPHING;\n morph();\n },\n });\n } else {\n morph();\n }\n}\n\nfunction columbusViewMorph(startPosition, endPosition, time, result) {\n // Just linear for now.\n return Cartesian3.lerp(startPosition, endPosition, time, result);\n}\n\nfunction morphPerspectiveToOrthographic(\n transitioner,\n duration,\n endCamera,\n updateHeight,\n complete\n) {\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n if (camera.frustum instanceof OrthographicFrustum) {\n return;\n }\n\n const startFOV = camera.frustum.fov;\n const endFOV = CesiumMath.RADIANS_PER_DEGREE * 0.5;\n const d = endCamera.position.z * Math.tan(startFOV * 0.5);\n camera.frustum.far = d / Math.tan(endFOV * 0.5) + 10000000.0;\n\n function update(value) {\n camera.frustum.fov = CesiumMath.lerp(startFOV, endFOV, value.time);\n const height = d / Math.tan(camera.frustum.fov * 0.5);\n updateHeight(camera, height);\n }\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: update,\n complete: function () {\n camera.frustum = endCamera.frustum.clone();\n complete(transitioner);\n },\n });\n transitioner._currentTweens.push(tween);\n}\n\nconst scratchCVTo2DStartPos = new Cartesian3();\nconst scratchCVTo2DStartDir = new Cartesian3();\nconst scratchCVTo2DStartUp = new Cartesian3();\nconst scratchCVTo2DEndPos = new Cartesian3();\nconst scratchCVTo2DEndDir = new Cartesian3();\nconst scratchCVTo2DEndUp = new Cartesian3();\nconst scratchCVTo2DFrustum = new OrthographicOffCenterFrustum();\nconst scratchCVTo2DRay = new Ray();\nconst scratchCVTo2DPickPos = new Cartesian3();\nconst scratchCVTo2DCamera = {\n position: undefined,\n direction: undefined,\n up: undefined,\n frustum: undefined,\n};\n\nfunction morphFromColumbusViewTo2D(transitioner, duration) {\n duration *= 0.5;\n\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const startPos = Cartesian3.clone(camera.position, scratchCVTo2DStartPos);\n const startDir = Cartesian3.clone(camera.direction, scratchCVTo2DStartDir);\n const startUp = Cartesian3.clone(camera.up, scratchCVTo2DStartUp);\n\n const endDir = Cartesian3.negate(Cartesian3.UNIT_Z, scratchCVTo2DEndDir);\n const endUp = Cartesian3.clone(Cartesian3.UNIT_Y, scratchCVTo2DEndUp);\n\n const endPos = scratchCVTo2DEndPos;\n\n if (duration > 0.0) {\n Cartesian3.clone(Cartesian3.ZERO, scratchCVTo2DEndPos);\n endPos.z = 5.0 * scene.mapProjection.ellipsoid.maximumRadius;\n } else {\n Cartesian3.clone(startPos, scratchCVTo2DEndPos);\n\n const ray = scratchCVTo2DRay;\n Matrix4.multiplyByPoint(Camera.TRANSFORM_2D, startPos, ray.origin);\n Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n startDir,\n ray.direction\n );\n\n const globe = scene.globe;\n if (defined(globe)) {\n const pickPos = globe.pickWorldCoordinates(\n ray,\n scene,\n true,\n scratchCVTo2DPickPos\n );\n if (defined(pickPos)) {\n Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE, pickPos, endPos);\n endPos.z += Cartesian3.distance(startPos, endPos);\n }\n }\n }\n\n const frustum = scratchCVTo2DFrustum;\n frustum.right = endPos.z * 0.5;\n frustum.left = -frustum.right;\n frustum.top =\n frustum.right * (scene.drawingBufferHeight / scene.drawingBufferWidth);\n frustum.bottom = -frustum.top;\n\n const camera2D = scratchCVTo2DCamera;\n camera2D.position = endPos;\n camera2D.direction = endDir;\n camera2D.up = endUp;\n camera2D.frustum = frustum;\n\n const complete = complete2DCallback(camera2D);\n createMorphHandler(transitioner, complete);\n\n function updateCV(value) {\n columbusViewMorph(startPos, endPos, value.time, camera.position);\n columbusViewMorph(startDir, endDir, value.time, camera.direction);\n columbusViewMorph(startUp, endUp, value.time, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n camera._adjustOrthographicFrustum(true);\n }\n\n function updateHeight(camera, height) {\n camera.position.z = height;\n }\n\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: updateCV,\n complete: function () {\n morphPerspectiveToOrthographic(\n transitioner,\n duration,\n camera2D,\n updateHeight,\n complete\n );\n },\n });\n transitioner._currentTweens.push(tween);\n}\n\nconst scratch3DTo2DCartographic = new Cartographic();\nconst scratch3DTo2DCamera = {\n position: new Cartesian3(),\n direction: new Cartesian3(),\n up: new Cartesian3(),\n position2D: new Cartesian3(),\n direction2D: new Cartesian3(),\n up2D: new Cartesian3(),\n frustum: new OrthographicOffCenterFrustum(),\n};\nconst scratch3DTo2DEndCamera = {\n position: new Cartesian3(),\n direction: new Cartesian3(),\n up: new Cartesian3(),\n frustum: undefined,\n};\nconst scratch3DTo2DPickPosition = new Cartesian3();\nconst scratch3DTo2DRay = new Ray();\nconst scratch3DTo2DToENU = new Matrix4();\nconst scratch3DTo2DSurfacePoint = new Cartesian3();\n\nfunction morphFrom3DTo2D(transitioner, duration, ellipsoid) {\n duration *= 0.5;\n\n const scene = transitioner._scene;\n const camera = scene.camera;\n const camera2D = scratch3DTo2DCamera;\n\n if (duration > 0.0) {\n Cartesian3.clone(Cartesian3.ZERO, camera2D.position);\n camera2D.position.z = 5.0 * ellipsoid.maximumRadius;\n Cartesian3.negate(Cartesian3.UNIT_Z, camera2D.direction);\n Cartesian3.clone(Cartesian3.UNIT_Y, camera2D.up);\n } else {\n ellipsoid.cartesianToCartographic(\n camera.positionWC,\n scratch3DTo2DCartographic\n );\n scene.mapProjection.project(scratch3DTo2DCartographic, camera2D.position);\n\n Cartesian3.negate(Cartesian3.UNIT_Z, camera2D.direction);\n Cartesian3.clone(Cartesian3.UNIT_Y, camera2D.up);\n\n const ray = scratch3DTo2DRay;\n Cartesian3.clone(camera2D.position2D, ray.origin);\n const rayDirection = Cartesian3.clone(camera.directionWC, ray.direction);\n const surfacePoint = ellipsoid.scaleToGeodeticSurface(\n camera.positionWC,\n scratch3DTo2DSurfacePoint\n );\n const toENU = Transforms.eastNorthUpToFixedFrame(\n surfacePoint,\n ellipsoid,\n scratch3DTo2DToENU\n );\n Matrix4.inverseTransformation(toENU, toENU);\n Matrix4.multiplyByPointAsVector(toENU, rayDirection, rayDirection);\n Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n rayDirection,\n rayDirection\n );\n\n const globe = scene.globe;\n if (defined(globe)) {\n const pickedPos = globe.pickWorldCoordinates(\n ray,\n scene,\n true,\n scratch3DTo2DPickPosition\n );\n if (defined(pickedPos)) {\n const height = Cartesian3.distance(camera2D.position2D, pickedPos);\n pickedPos.x += height;\n Cartesian3.clone(pickedPos, camera2D.position2D);\n }\n }\n }\n\n function updateHeight(camera, height) {\n camera.position.x = height;\n }\n\n Matrix4.multiplyByPoint(\n Camera.TRANSFORM_2D,\n camera2D.position,\n camera2D.position2D\n );\n Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n camera2D.direction,\n camera2D.direction2D\n );\n Matrix4.multiplyByPointAsVector(\n Camera.TRANSFORM_2D,\n camera2D.up,\n camera2D.up2D\n );\n\n const frustum = camera2D.frustum;\n frustum.right = camera2D.position.z * 0.5;\n frustum.left = -frustum.right;\n frustum.top =\n frustum.right * (scene.drawingBufferHeight / scene.drawingBufferWidth);\n frustum.bottom = -frustum.top;\n\n const endCamera = scratch3DTo2DEndCamera;\n Matrix4.multiplyByPoint(\n Camera.TRANSFORM_2D_INVERSE,\n camera2D.position2D,\n endCamera.position\n );\n Cartesian3.clone(camera2D.direction, endCamera.direction);\n Cartesian3.clone(camera2D.up, endCamera.up);\n endCamera.frustum = frustum;\n\n const complete = complete2DCallback(endCamera);\n createMorphHandler(transitioner, complete);\n\n function completeCallback() {\n morphPerspectiveToOrthographic(\n transitioner,\n duration,\n camera2D,\n updateHeight,\n complete\n );\n }\n morphFrom3DToColumbusView(transitioner, duration, camera2D, completeCallback);\n}\n\nfunction morphOrthographicToPerspective(\n transitioner,\n duration,\n cameraCV,\n complete\n) {\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const height = camera.frustum.right - camera.frustum.left;\n camera.frustum = cameraCV.frustum.clone();\n\n const endFOV = camera.frustum.fov;\n const startFOV = CesiumMath.RADIANS_PER_DEGREE * 0.5;\n const d = height * Math.tan(endFOV * 0.5);\n camera.frustum.far = d / Math.tan(startFOV * 0.5) + 10000000.0;\n camera.frustum.fov = startFOV;\n\n function update(value) {\n camera.frustum.fov = CesiumMath.lerp(startFOV, endFOV, value.time);\n camera.position.z = d / Math.tan(camera.frustum.fov * 0.5);\n }\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: update,\n complete: function () {\n complete(transitioner);\n },\n });\n transitioner._currentTweens.push(tween);\n}\n\nfunction morphFrom2DToColumbusView(transitioner, duration, cameraCV, complete) {\n duration *= 0.5;\n\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const endPos = Cartesian3.clone(cameraCV.position, scratch3DToCVEndPos);\n const endDir = Cartesian3.clone(cameraCV.direction, scratch3DToCVEndDir);\n const endUp = Cartesian3.clone(cameraCV.up, scratch3DToCVEndUp);\n\n scene._mode = SceneMode.MORPHING;\n\n function morph() {\n camera.frustum = cameraCV.frustum.clone();\n\n const startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos);\n const startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir);\n const startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp);\n startPos.z = endPos.z;\n\n function update(value) {\n columbusViewMorph(startPos, endPos, value.time, camera.position);\n columbusViewMorph(startDir, endDir, value.time, camera.direction);\n columbusViewMorph(startUp, endUp, value.time, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n }\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: update,\n complete: function () {\n complete(transitioner);\n },\n });\n transitioner._currentTweens.push(tween);\n }\n\n if (transitioner._morphToOrthographic) {\n morph();\n } else {\n morphOrthographicToPerspective(transitioner, 0.0, cameraCV, morph);\n }\n}\n\nfunction morphFrom3DToColumbusView(\n transitioner,\n duration,\n endCamera,\n complete\n) {\n const scene = transitioner._scene;\n const camera = scene.camera;\n\n const startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos);\n const startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir);\n const startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp);\n\n const endPos = Cartesian3.clone(endCamera.position2D, scratch3DToCVEndPos);\n const endDir = Cartesian3.clone(endCamera.direction2D, scratch3DToCVEndDir);\n const endUp = Cartesian3.clone(endCamera.up2D, scratch3DToCVEndUp);\n\n function update(value) {\n columbusViewMorph(startPos, endPos, value.time, camera.position);\n columbusViewMorph(startDir, endDir, value.time, camera.direction);\n columbusViewMorph(startUp, endUp, value.time, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n camera._adjustOrthographicFrustum(true);\n }\n const tween = scene.tweens.add({\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n startObject: {\n time: 0.0,\n },\n stopObject: {\n time: 1.0,\n },\n update: update,\n complete: function () {\n addMorphTimeAnimations(transitioner, scene, 1.0, 0.0, duration, complete);\n },\n });\n transitioner._currentTweens.push(tween);\n}\n\nfunction addMorphTimeAnimations(\n transitioner,\n scene,\n start,\n stop,\n duration,\n complete\n) {\n // Later, this will be linear and each object will adjust, if desired, in its vertex shader.\n const options = {\n object: scene,\n property: \"morphTime\",\n startValue: start,\n stopValue: stop,\n duration: duration,\n easingFunction: EasingFunction.QUARTIC_OUT,\n };\n\n if (defined(complete)) {\n options.complete = function () {\n complete(transitioner);\n };\n }\n\n const tween = scene.tweens.addProperty(options);\n transitioner._currentTweens.push(tween);\n}\n\nfunction complete3DCallback(camera3D) {\n return function (transitioner) {\n const scene = transitioner._scene;\n scene._mode = SceneMode.SCENE3D;\n scene.morphTime = SceneMode.getMorphTime(SceneMode.SCENE3D);\n\n destroyMorphHandler(transitioner);\n\n const camera = scene.camera;\n if (\n transitioner._previousMode !== SceneMode.MORPHING ||\n transitioner._morphCancelled\n ) {\n transitioner._morphCancelled = false;\n\n Cartesian3.clone(camera3D.position, camera.position);\n Cartesian3.clone(camera3D.direction, camera.direction);\n Cartesian3.clone(camera3D.up, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n\n camera.frustum = camera3D.frustum.clone();\n }\n\n const frustum = camera.frustum;\n if (scene.frameState.useLogDepth) {\n frustum.near = 0.1;\n frustum.far = 10000000000.0;\n }\n\n const wasMorphing = defined(transitioner._completeMorph);\n transitioner._completeMorph = undefined;\n scene.camera.update(scene.mode);\n transitioner._scene.morphComplete.raiseEvent(\n transitioner,\n transitioner._previousMode,\n SceneMode.SCENE3D,\n wasMorphing\n );\n };\n}\n\nfunction complete2DCallback(camera2D) {\n return function (transitioner) {\n const scene = transitioner._scene;\n\n scene._mode = SceneMode.SCENE2D;\n scene.morphTime = SceneMode.getMorphTime(SceneMode.SCENE2D);\n\n destroyMorphHandler(transitioner);\n\n const camera = scene.camera;\n Cartesian3.clone(camera2D.position, camera.position);\n camera.position.z = scene.mapProjection.ellipsoid.maximumRadius * 2.0;\n Cartesian3.clone(camera2D.direction, camera.direction);\n Cartesian3.clone(camera2D.up, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n camera.frustum = camera2D.frustum.clone();\n\n const wasMorphing = defined(transitioner._completeMorph);\n transitioner._completeMorph = undefined;\n scene.camera.update(scene.mode);\n transitioner._scene.morphComplete.raiseEvent(\n transitioner,\n transitioner._previousMode,\n SceneMode.SCENE2D,\n wasMorphing\n );\n };\n}\n\nfunction completeColumbusViewCallback(cameraCV) {\n return function (transitioner) {\n const scene = transitioner._scene;\n scene._mode = SceneMode.COLUMBUS_VIEW;\n scene.morphTime = SceneMode.getMorphTime(SceneMode.COLUMBUS_VIEW);\n\n destroyMorphHandler(transitioner);\n\n const camera = scene.camera;\n if (\n transitioner._previousModeMode !== SceneMode.MORPHING ||\n transitioner._morphCancelled\n ) {\n transitioner._morphCancelled = false;\n\n Cartesian3.clone(cameraCV.position, camera.position);\n Cartesian3.clone(cameraCV.direction, camera.direction);\n Cartesian3.clone(cameraCV.up, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.normalize(camera.right, camera.right);\n }\n\n const frustum = camera.frustum;\n if (scene.frameState.useLogDepth) {\n frustum.near = 0.1;\n frustum.far = 10000000000.0;\n }\n\n const wasMorphing = defined(transitioner._completeMorph);\n transitioner._completeMorph = undefined;\n scene.camera.update(scene.mode);\n transitioner._scene.morphComplete.raiseEvent(\n transitioner,\n transitioner._previousMode,\n SceneMode.COLUMBUS_VIEW,\n wasMorphing\n );\n };\n}\nexport default SceneTransitioner;\n", "import clone from \"../Core/clone.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EasingFunction from \"../Core/EasingFunction.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport TimeConstants from \"../Core/TimeConstants.js\";\nimport { Tween as TweenJS } from \"@tweenjs/tween.js\";\n\n/**\n * A tween is an animation that interpolates the properties of two objects using an {@link EasingFunction}. Create\n * one using {@link Scene#tweens} and {@link TweenCollection#add} and related add functions.\n *\n * @alias Tween\n * @constructor\n *\n * @private\n */\nfunction Tween(\n tweens,\n tweenjs,\n startObject,\n stopObject,\n duration,\n delay,\n easingFunction,\n update,\n complete,\n cancel\n) {\n this._tweens = tweens;\n this._tweenjs = tweenjs;\n\n this._startObject = clone(startObject);\n this._stopObject = clone(stopObject);\n\n this._duration = duration;\n this._delay = delay;\n this._easingFunction = easingFunction;\n\n this._update = update;\n this._complete = complete;\n\n /**\n * The callback to call if the tween is canceled either because {@link Tween#cancelTween}\n * was called or because the tween was removed from the collection.\n *\n * @type {TweenCollection.TweenCancelledCallback}\n */\n this.cancel = cancel;\n\n /**\n * @private\n */\n this.needsStart = true;\n}\n\nObject.defineProperties(Tween.prototype, {\n /**\n * An object with properties for initial values of the tween. The properties of this object are changed during the tween's animation.\n * @memberof Tween.prototype\n *\n * @type {Object}\n * @readonly\n */\n startObject: {\n get: function () {\n return this._startObject;\n },\n },\n\n /**\n * An object with properties for the final values of the tween.\n * @memberof Tween.prototype\n *\n * @type {Object}\n * @readonly\n */\n stopObject: {\n get: function () {\n return this._stopObject;\n },\n },\n\n /**\n * The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.\n * @memberof Tween.prototype\n *\n * @type {Number}\n * @readonly\n */\n duration: {\n get: function () {\n return this._duration;\n },\n },\n\n /**\n * The delay, in seconds, before the tween starts animating.\n * @memberof Tween.prototype\n *\n * @type {Number}\n * @readonly\n */\n delay: {\n get: function () {\n return this._delay;\n },\n },\n\n /**\n * Determines the curve for animtion.\n * @memberof Tween.prototype\n *\n * @type {EasingFunction}\n * @readonly\n */\n easingFunction: {\n get: function () {\n return this._easingFunction;\n },\n },\n\n /**\n * The callback to call at each animation update (usually tied to the a rendered frame).\n * @memberof Tween.prototype\n *\n * @type {TweenCollection.TweenUpdateCallback}\n * @readonly\n */\n update: {\n get: function () {\n return this._update;\n },\n },\n\n /**\n * The callback to call when the tween finishes animating.\n * @memberof Tween.prototype\n *\n * @type {TweenCollection.TweenCompleteCallback}\n * @readonly\n */\n complete: {\n get: function () {\n return this._complete;\n },\n },\n\n /**\n * @memberof Tween.prototype\n *\n * @private\n */\n tweenjs: {\n get: function () {\n return this._tweenjs;\n },\n },\n});\n\n/**\n * Cancels the tween calling the {@link Tween#cancel} callback if one exists. This\n * has no effect if the tween finished or was already canceled.\n */\nTween.prototype.cancelTween = function () {\n this._tweens.remove(this);\n};\n\n/**\n * A collection of tweens for animating properties. Commonly accessed using {@link Scene#tweens}.\n *\n * @alias TweenCollection\n * @constructor\n *\n * @private\n */\nfunction TweenCollection() {\n this._tweens = [];\n}\n\nObject.defineProperties(TweenCollection.prototype, {\n /**\n * The number of tweens in the collection.\n * @memberof TweenCollection.prototype\n *\n * @type {Number}\n * @readonly\n */\n length: {\n get: function () {\n return this._tweens.length;\n },\n },\n});\n\n/**\n * Creates a tween for animating between two sets of properties. The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Object} options.startObject An object with properties for initial values of the tween. The properties of this object are changed during the tween's animation.\n * @param {Object} options.stopObject An object with properties for the final values of the tween.\n * @param {Number} options.duration The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.\n * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.add = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n if (options.duration === 0.0) {\n if (defined(options.complete)) {\n options.complete();\n }\n return new Tween(this);\n }\n\n const duration = options.duration / TimeConstants.SECONDS_PER_MILLISECOND;\n const delayInSeconds = defaultValue(options.delay, 0.0);\n const delay = delayInSeconds / TimeConstants.SECONDS_PER_MILLISECOND;\n const easingFunction = defaultValue(\n options.easingFunction,\n EasingFunction.LINEAR_NONE\n );\n\n const value = options.startObject;\n const tweenjs = new TweenJS(value);\n tweenjs.to(clone(options.stopObject), duration);\n tweenjs.delay(delay);\n tweenjs.easing(easingFunction);\n if (defined(options.update)) {\n tweenjs.onUpdate(function () {\n options.update(value);\n });\n }\n tweenjs.onComplete(defaultValue(options.complete, null));\n tweenjs.repeat(defaultValue(options._repeat, 0.0));\n\n const tween = new Tween(\n this,\n tweenjs,\n options.startObject,\n options.stopObject,\n options.duration,\n delayInSeconds,\n easingFunction,\n options.update,\n options.complete,\n options.cancel\n );\n this._tweens.push(tween);\n return tween;\n};\n\n/**\n * Creates a tween for animating a scalar property on the given object. The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Object} options.object The object containing the property to animate.\n * @param {String} options.property The name of the property to animate.\n * @param {Number} options.startValue The initial value.\n * @param {Number} options.stopValue The final value.\n * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.\n * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} options.object must have the specified property.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addProperty = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const object = options.object;\n const property = options.property;\n const startValue = options.startValue;\n const stopValue = options.stopValue;\n\n function update(value) {\n object[property] = value.value;\n }\n\n return this.add({\n startObject: {\n value: startValue,\n },\n stopObject: {\n value: stopValue,\n },\n duration: defaultValue(options.duration, 3.0),\n delay: options.delay,\n easingFunction: options.easingFunction,\n update: update,\n complete: options.complete,\n cancel: options.cancel,\n _repeat: options._repeat,\n });\n};\n\n/**\n * Creates a tween for animating the alpha of all color uniforms on a {@link Material}. The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Material} options.material The material to animate.\n * @param {Number} [options.startValue=0.0] The initial alpha value.\n * @param {Number} [options.stopValue=1.0] The final alpha value.\n * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.\n * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} material has no properties with alpha components.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addAlpha = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const material = options.material;\n\n const properties = [];\n\n for (const property in material.uniforms) {\n if (\n material.uniforms.hasOwnProperty(property) &&\n defined(material.uniforms[property]) &&\n defined(material.uniforms[property].alpha)\n ) {\n properties.push(property);\n }\n }\n\n function update(value) {\n const length = properties.length;\n for (let i = 0; i < length; ++i) {\n material.uniforms[properties[i]].alpha = value.alpha;\n }\n }\n\n return this.add({\n startObject: {\n alpha: defaultValue(options.startValue, 0.0), // Default to fade in\n },\n stopObject: {\n alpha: defaultValue(options.stopValue, 1.0),\n },\n duration: defaultValue(options.duration, 3.0),\n delay: options.delay,\n easingFunction: options.easingFunction,\n update: update,\n complete: options.complete,\n cancel: options.cancel,\n });\n};\n\n/**\n * Creates a tween for animating the offset uniform of a {@link Material}. The tween starts animating at the next call to {@link TweenCollection#update}, which\n * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Material} options.material The material to animate.\n * @param {Number} options.startValue The initial alpha value.\n * @param {Number} options.stopValue The final alpha value.\n * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.\n * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.\n * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion.\n * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).\n * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.\n * @returns {Tween} The tween.\n *\n * @exception {DeveloperError} material.uniforms must have an offset property.\n * @exception {DeveloperError} options.duration must be positive.\n */\nTweenCollection.prototype.addOffsetIncrement = function (options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const material = options.material;\n\n const uniforms = material.uniforms;\n return this.addProperty({\n object: uniforms,\n property: \"offset\",\n startValue: uniforms.offset,\n stopValue: uniforms.offset + 1,\n duration: options.duration,\n delay: options.delay,\n easingFunction: options.easingFunction,\n update: options.update,\n cancel: options.cancel,\n _repeat: Infinity,\n });\n};\n\n/**\n * Removes a tween from the collection.\n * <p>\n * This calls the {@link Tween#cancel} callback if the tween has one.\n * </p>\n *\n * @param {Tween} tween The tween to remove.\n * @returns {Boolean} <code>true</code> if the tween was removed; <code>false</code> if the tween was not found in the collection.\n */\nTweenCollection.prototype.remove = function (tween) {\n if (!defined(tween)) {\n return false;\n }\n\n const index = this._tweens.indexOf(tween);\n if (index !== -1) {\n tween.tweenjs.stop();\n if (defined(tween.cancel)) {\n tween.cancel();\n }\n this._tweens.splice(index, 1);\n return true;\n }\n\n return false;\n};\n\n/**\n * Removes all tweens from the collection.\n * <p>\n * This calls the {@link Tween#cancel} callback for each tween that has one.\n * </p>\n */\nTweenCollection.prototype.removeAll = function () {\n const tweens = this._tweens;\n\n for (let i = 0; i < tweens.length; ++i) {\n const tween = tweens[i];\n tween.tweenjs.stop();\n if (defined(tween.cancel)) {\n tween.cancel();\n }\n }\n tweens.length = 0;\n};\n\n/**\n * Determines whether this collection contains a given tween.\n *\n * @param {Tween} tween The tween to check for.\n * @returns {Boolean} <code>true</code> if this collection contains the tween, <code>false</code> otherwise.\n */\nTweenCollection.prototype.contains = function (tween) {\n return defined(tween) && this._tweens.indexOf(tween) !== -1;\n};\n\n/**\n * Returns the tween in the collection at the specified index. Indices are zero-based\n * and increase as tweens are added. Removing a tween shifts all tweens after\n * it to the left, changing their indices. This function is commonly used to iterate over\n * all the tween in the collection.\n *\n * @param {Number} index The zero-based index of the tween.\n * @returns {Tween} The tween at the specified index.\n *\n * @example\n * // Output the duration of all the tweens in the collection.\n * const tweens = scene.tweens;\n * const length = tweens.length;\n * for (let i = 0; i < length; ++i) {\n * console.log(tweens.get(i).duration);\n * }\n */\nTweenCollection.prototype.get = function (index) {\n return this._tweens[index];\n};\n\n/**\n * Updates the tweens in the collection to be at the provide time. When a tween finishes, it is removed\n * from the collection.\n *\n * @param {Number} [time=getTimestamp()] The time in seconds. By default tweens are synced to the system clock.\n */\nTweenCollection.prototype.update = function (time) {\n const tweens = this._tweens;\n\n let i = 0;\n time = defined(time)\n ? time / TimeConstants.SECONDS_PER_MILLISECOND\n : getTimestamp();\n while (i < tweens.length) {\n const tween = tweens[i];\n const tweenjs = tween.tweenjs;\n\n if (tween.needsStart) {\n tween.needsStart = false;\n tweenjs.start(time);\n } else if (tweenjs.update(time)) {\n i++;\n } else {\n tweenjs.stop();\n tweens.splice(i, 1);\n }\n }\n};\n\n/**\n * A function that will execute when a tween completes.\n * @callback TweenCollection.TweenCompleteCallback\n */\n\n/**\n * A function that will execute when a tween updates.\n * @callback TweenCollection.TweenUpdateCallback\n */\n\n/**\n * A function that will execute when a tween is cancelled.\n * @callback TweenCollection.TweenCancelledCallback\n */\nexport default TweenCollection;\n", "import Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport HeadingPitchRoll from \"../Core/HeadingPitchRoll.js\";\nimport IntersectionTests from \"../Core/IntersectionTests.js\";\nimport KeyboardEventModifier from \"../Core/KeyboardEventModifier.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix3 from \"../Core/Matrix3.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport Plane from \"../Core/Plane.js\";\nimport Quaternion from \"../Core/Quaternion.js\";\nimport Ray from \"../Core/Ray.js\";\nimport TerrainExaggeration from \"../Core/TerrainExaggeration.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport CameraEventAggregator from \"./CameraEventAggregator.js\";\nimport CameraEventType from \"./CameraEventType.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport TweenCollection from \"./TweenCollection.js\";\n\n/**\n * Modifies the camera position and orientation based on mouse input to a canvas.\n * @alias ScreenSpaceCameraController\n * @constructor\n *\n * @param {Scene} scene The scene.\n */\nfunction ScreenSpaceCameraController(scene) {\n /**\n * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,\n * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.\n *\n * NOTE: This setting is for temporary use cases, such as camera flights and\n * drag-selection of regions (see Picking demo). It is typically set to false at the\n * start of such events, and set true on completion. To keep inputs disabled\n * past the end of camera flights, you must use the other booleans (enableTranslate,\n * enableZoom, enableRotate, enableTilt, and enableLook).\n * @type {Boolean}\n * @default true\n */\n this.enableInputs = true;\n /**\n * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.\n * This flag only applies in 2D and Columbus view modes.\n * @type {Boolean}\n * @default true\n */\n this.enableTranslate = true;\n /**\n * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.\n * @type {Boolean}\n * @default true\n */\n this.enableZoom = true;\n /**\n * If true, allows the user to rotate the world which translates the user's position.\n * This flag only applies in 2D and 3D.\n * @type {Boolean}\n * @default true\n */\n this.enableRotate = true;\n /**\n * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.\n * This flag only applies in 3D and Columbus view.\n * @type {Boolean}\n * @default true\n */\n this.enableTilt = true;\n /**\n * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating\n * or rotating. This flag only applies in 3D and Columbus view modes.\n * @type {Boolean}\n * @default true\n */\n this.enableLook = true;\n /**\n * A parameter in the range <code>[0, 1)</code> used to determine how long\n * the camera will continue to spin because of inertia.\n * With value of zero, the camera will have no inertia.\n * @type {Number}\n * @default 0.9\n */\n this.inertiaSpin = 0.9;\n /**\n * A parameter in the range <code>[0, 1)</code> used to determine how long\n * the camera will continue to translate because of inertia.\n * With value of zero, the camera will have no inertia.\n * @type {Number}\n * @default 0.9\n */\n this.inertiaTranslate = 0.9;\n /**\n * A parameter in the range <code>[0, 1)</code> used to determine how long\n * the camera will continue to zoom because of inertia.\n * With value of zero, the camera will have no inertia.\n * @type {Number}\n * @default 0.8\n */\n this.inertiaZoom = 0.8;\n /**\n * A parameter in the range <code>[0, 1)</code> used to limit the range\n * of various user inputs to a percentage of the window width/height per animation frame.\n * This helps keep the camera under control in low-frame-rate situations.\n * @type {Number}\n * @default 0.1\n */\n this.maximumMovementRatio = 0.1;\n /**\n * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.\n * @type {Number}\n * @default 3.0\n */\n this.bounceAnimationTime = 3.0;\n /**\n * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.\n * @type {Number}\n * @default 1.0\n */\n this.minimumZoomDistance = 1.0;\n /**\n * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.\n * @type {Number}\n * @default {@link Number.POSITIVE_INFINITY}\n */\n this.maximumZoomDistance = Number.POSITIVE_INFINITY;\n /**\n * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.\n * <p>\n * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n * or an array of any of the preceding.\n * </p>\n * @type {CameraEventType|Array|undefined}\n * @default {@link CameraEventType.LEFT_DRAG}\n */\n this.translateEventTypes = CameraEventType.LEFT_DRAG;\n /**\n * The input that allows the user to zoom in/out.\n * <p>\n * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n * or an array of any of the preceding.\n * </p>\n * @type {CameraEventType|Array|undefined}\n * @default [{@link CameraEventType.RIGHT_DRAG}, {@link CameraEventType.WHEEL}, {@link CameraEventType.PINCH}]\n */\n this.zoomEventTypes = [\n CameraEventType.RIGHT_DRAG,\n CameraEventType.WHEEL,\n CameraEventType.PINCH,\n ];\n /**\n * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.\n * <p>\n * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n * or an array of any of the preceding.\n * </p>\n * @type {CameraEventType|Array|undefined}\n * @default {@link CameraEventType.LEFT_DRAG}\n */\n this.rotateEventTypes = CameraEventType.LEFT_DRAG;\n /**\n * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.\n * <p>\n * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n * or an array of any of the preceding.\n * </p>\n * @type {CameraEventType|Array|undefined}\n * @default [{@link CameraEventType.MIDDLE_DRAG}, {@link CameraEventType.PINCH}, {\n * eventType : {@link CameraEventType.LEFT_DRAG},\n * modifier : {@link KeyboardEventModifier.CTRL}\n * }, {\n * eventType : {@link CameraEventType.RIGHT_DRAG},\n * modifier : {@link KeyboardEventModifier.CTRL}\n * }]\n */\n this.tiltEventTypes = [\n CameraEventType.MIDDLE_DRAG,\n CameraEventType.PINCH,\n {\n eventType: CameraEventType.LEFT_DRAG,\n modifier: KeyboardEventModifier.CTRL,\n },\n {\n eventType: CameraEventType.RIGHT_DRAG,\n modifier: KeyboardEventModifier.CTRL,\n },\n ];\n /**\n * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.\n * <p>\n * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>\n * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},\n * or an array of any of the preceding.\n * </p>\n * @type {CameraEventType|Array|undefined}\n * @default { eventType : {@link CameraEventType.LEFT_DRAG}, modifier : {@link KeyboardEventModifier.SHIFT} }\n */\n this.lookEventTypes = {\n eventType: CameraEventType.LEFT_DRAG,\n modifier: KeyboardEventModifier.SHIFT,\n };\n /**\n * The minimum height the camera must be before picking the terrain instead of the ellipsoid.\n * @type {Number}\n * @default 150000.0\n */\n this.minimumPickingTerrainHeight = 150000.0;\n this._minimumPickingTerrainHeight = this.minimumPickingTerrainHeight;\n /**\n * The minimum height the camera must be before testing for collision with terrain.\n * @type {Number}\n * @default 15000.0\n */\n this.minimumCollisionTerrainHeight = 15000.0;\n this._minimumCollisionTerrainHeight = this.minimumCollisionTerrainHeight;\n /**\n * The minimum height the camera must be before switching from rotating a track ball to\n * free look when clicks originate on the sky or in space.\n * @type {Number}\n * @default 7500000.0\n */\n this.minimumTrackBallHeight = 7500000.0;\n this._minimumTrackBallHeight = this.minimumTrackBallHeight;\n /**\n * Enables or disables camera collision detection with terrain.\n * @type {Boolean}\n * @default true\n */\n this.enableCollisionDetection = true;\n\n this._scene = scene;\n this._globe = undefined;\n this._ellipsoid = undefined;\n\n this._aggregator = new CameraEventAggregator(scene.canvas);\n\n this._lastInertiaSpinMovement = undefined;\n this._lastInertiaZoomMovement = undefined;\n this._lastInertiaTranslateMovement = undefined;\n this._lastInertiaTiltMovement = undefined;\n\n // Zoom disables tilt, spin, and translate inertia\n // Tilt disables spin and translate inertia\n this._inertiaDisablers = {\n _lastInertiaZoomMovement: [\n \"_lastInertiaSpinMovement\",\n \"_lastInertiaTranslateMovement\",\n \"_lastInertiaTiltMovement\",\n ],\n _lastInertiaTiltMovement: [\n \"_lastInertiaSpinMovement\",\n \"_lastInertiaTranslateMovement\",\n ],\n };\n\n this._tweens = new TweenCollection();\n this._tween = undefined;\n\n this._horizontalRotationAxis = undefined;\n\n this._tiltCenterMousePosition = new Cartesian2(-1.0, -1.0);\n this._tiltCenter = new Cartesian3();\n this._rotateMousePosition = new Cartesian2(-1.0, -1.0);\n this._rotateStartPosition = new Cartesian3();\n this._strafeStartPosition = new Cartesian3();\n this._strafeMousePosition = new Cartesian2();\n this._strafeEndMousePosition = new Cartesian2();\n this._zoomMouseStart = new Cartesian2(-1.0, -1.0);\n this._zoomWorldPosition = new Cartesian3();\n this._useZoomWorldPosition = false;\n this._tiltCVOffMap = false;\n this._looking = false;\n this._rotating = false;\n this._strafing = false;\n this._zoomingOnVector = false;\n this._zoomingUnderground = false;\n this._rotatingZoom = false;\n this._adjustedHeightForTerrain = false;\n this._cameraUnderground = false;\n\n const projection = scene.mapProjection;\n this._maxCoord = projection.project(\n new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO)\n );\n\n // Constants, Make any of these public?\n this._zoomFactor = 5.0;\n this._rotateFactor = undefined;\n this._rotateRateRangeAdjustment = undefined;\n this._maximumRotateRate = 1.77;\n this._minimumRotateRate = 1.0 / 5000.0;\n this._minimumZoomRate = 20.0;\n this._maximumZoomRate = 5906376272000.0; // distance from the Sun to Pluto in meters.\n this._minimumUndergroundPickDistance = 2000.0;\n this._maximumUndergroundPickDistance = 10000.0;\n}\n\nfunction decay(time, coefficient) {\n if (time < 0) {\n return 0.0;\n }\n\n const tau = (1.0 - coefficient) * 25.0;\n return Math.exp(-tau * time);\n}\n\nfunction sameMousePosition(movement) {\n return Cartesian2.equalsEpsilon(\n movement.startPosition,\n movement.endPosition,\n CesiumMath.EPSILON14\n );\n}\n\n// If the time between mouse down and mouse up is not between\n// these thresholds, the camera will not move with inertia.\n// This value is probably dependent on the browser and/or the\n// hardware. Should be investigated further.\nconst inertiaMaxClickTimeThreshold = 0.4;\n\nfunction maintainInertia(\n aggregator,\n type,\n modifier,\n decayCoef,\n action,\n object,\n lastMovementName\n) {\n let movementState = object[lastMovementName];\n if (!defined(movementState)) {\n movementState = object[lastMovementName] = {\n startPosition: new Cartesian2(),\n endPosition: new Cartesian2(),\n motion: new Cartesian2(),\n inertiaEnabled: true,\n };\n }\n\n const ts = aggregator.getButtonPressTime(type, modifier);\n const tr = aggregator.getButtonReleaseTime(type, modifier);\n\n const threshold = ts && tr && (tr.getTime() - ts.getTime()) / 1000.0;\n const now = new Date();\n const fromNow = tr && (now.getTime() - tr.getTime()) / 1000.0;\n\n if (ts && tr && threshold < inertiaMaxClickTimeThreshold) {\n const d = decay(fromNow, decayCoef);\n\n const lastMovement = aggregator.getLastMovement(type, modifier);\n if (\n !defined(lastMovement) ||\n sameMousePosition(lastMovement) ||\n !movementState.inertiaEnabled\n ) {\n return;\n }\n\n movementState.motion.x =\n (lastMovement.endPosition.x - lastMovement.startPosition.x) * 0.5;\n movementState.motion.y =\n (lastMovement.endPosition.y - lastMovement.startPosition.y) * 0.5;\n\n movementState.startPosition = Cartesian2.clone(\n lastMovement.startPosition,\n movementState.startPosition\n );\n\n movementState.endPosition = Cartesian2.multiplyByScalar(\n movementState.motion,\n d,\n movementState.endPosition\n );\n movementState.endPosition = Cartesian2.add(\n movementState.startPosition,\n movementState.endPosition,\n movementState.endPosition\n );\n\n // If value from the decreasing exponential function is close to zero,\n // the end coordinates may be NaN.\n if (\n isNaN(movementState.endPosition.x) ||\n isNaN(movementState.endPosition.y) ||\n Cartesian2.distance(\n movementState.startPosition,\n movementState.endPosition\n ) < 0.5\n ) {\n return;\n }\n\n if (!aggregator.isButtonDown(type, modifier)) {\n const startPosition = aggregator.getStartMousePosition(type, modifier);\n action(object, startPosition, movementState);\n }\n }\n}\n\nfunction activateInertia(controller, inertiaStateName) {\n if (defined(inertiaStateName)) {\n // Re-enable inertia if it was disabled\n let movementState = controller[inertiaStateName];\n if (defined(movementState)) {\n movementState.inertiaEnabled = true;\n }\n // Disable inertia on other movements\n const inertiasToDisable = controller._inertiaDisablers[inertiaStateName];\n if (defined(inertiasToDisable)) {\n const length = inertiasToDisable.length;\n for (let i = 0; i < length; ++i) {\n movementState = controller[inertiasToDisable[i]];\n if (defined(movementState)) {\n movementState.inertiaEnabled = false;\n }\n }\n }\n }\n}\n\nconst scratchEventTypeArray = [];\n\nfunction reactToInput(\n controller,\n enabled,\n eventTypes,\n action,\n inertiaConstant,\n inertiaStateName\n) {\n if (!defined(eventTypes)) {\n return;\n }\n\n const aggregator = controller._aggregator;\n\n if (!Array.isArray(eventTypes)) {\n scratchEventTypeArray[0] = eventTypes;\n eventTypes = scratchEventTypeArray;\n }\n\n const length = eventTypes.length;\n for (let i = 0; i < length; ++i) {\n const eventType = eventTypes[i];\n const type = defined(eventType.eventType) ? eventType.eventType : eventType;\n const modifier = eventType.modifier;\n\n const movement =\n aggregator.isMoving(type, modifier) &&\n aggregator.getMovement(type, modifier);\n const startPosition = aggregator.getStartMousePosition(type, modifier);\n\n if (controller.enableInputs && enabled) {\n if (movement) {\n action(controller, startPosition, movement);\n activateInertia(controller, inertiaStateName);\n } else if (inertiaConstant < 1.0) {\n maintainInertia(\n aggregator,\n type,\n modifier,\n inertiaConstant,\n action,\n controller,\n inertiaStateName\n );\n }\n }\n }\n}\n\nconst scratchZoomPickRay = new Ray();\nconst scratchPickCartesian = new Cartesian3();\nconst scratchZoomOffset = new Cartesian2();\nconst scratchZoomDirection = new Cartesian3();\nconst scratchCenterPixel = new Cartesian2();\nconst scratchCenterPosition = new Cartesian3();\nconst scratchPositionNormal = new Cartesian3();\nconst scratchPickNormal = new Cartesian3();\nconst scratchZoomAxis = new Cartesian3();\nconst scratchCameraPositionNormal = new Cartesian3();\n\n// Scratch variables used in zooming algorithm\nconst scratchTargetNormal = new Cartesian3();\nconst scratchCameraPosition = new Cartesian3();\nconst scratchCameraUpNormal = new Cartesian3();\nconst scratchCameraRightNormal = new Cartesian3();\nconst scratchForwardNormal = new Cartesian3();\nconst scratchPositionToTarget = new Cartesian3();\nconst scratchPositionToTargetNormal = new Cartesian3();\nconst scratchPan = new Cartesian3();\nconst scratchCenterMovement = new Cartesian3();\nconst scratchCenter = new Cartesian3();\nconst scratchCartesian = new Cartesian3();\nconst scratchCartesianTwo = new Cartesian3();\nconst scratchCartesianThree = new Cartesian3();\nconst scratchZoomViewOptions = {\n orientation: new HeadingPitchRoll(),\n};\n\nfunction handleZoom(\n object,\n startPosition,\n movement,\n zoomFactor,\n distanceMeasure,\n unitPositionDotDirection\n) {\n let percentage = 1.0;\n if (defined(unitPositionDotDirection)) {\n percentage = CesiumMath.clamp(\n Math.abs(unitPositionDotDirection),\n 0.25,\n 1.0\n );\n }\n\n const diff = movement.endPosition.y - movement.startPosition.y;\n\n // distanceMeasure should be the height above the ellipsoid.\n // When approaching the surface, the zoomRate slows and stops minimumZoomDistance above it.\n const approachingSurface = diff > 0;\n const minHeight = approachingSurface\n ? object.minimumZoomDistance * percentage\n : 0;\n const maxHeight = object.maximumZoomDistance;\n\n const minDistance = distanceMeasure - minHeight;\n let zoomRate = zoomFactor * minDistance;\n zoomRate = CesiumMath.clamp(\n zoomRate,\n object._minimumZoomRate,\n object._maximumZoomRate\n );\n\n let rangeWindowRatio = diff / object._scene.canvas.clientHeight;\n rangeWindowRatio = Math.min(rangeWindowRatio, object.maximumMovementRatio);\n let distance = zoomRate * rangeWindowRatio;\n\n if (\n object.enableCollisionDetection ||\n object.minimumZoomDistance === 0.0 ||\n !defined(object._globe) // look-at mode\n ) {\n if (distance > 0.0 && Math.abs(distanceMeasure - minHeight) < 1.0) {\n return;\n }\n\n if (distance < 0.0 && Math.abs(distanceMeasure - maxHeight) < 1.0) {\n return;\n }\n\n if (distanceMeasure - distance < minHeight) {\n distance = distanceMeasure - minHeight - 1.0;\n } else if (distanceMeasure - distance > maxHeight) {\n distance = distanceMeasure - maxHeight;\n }\n }\n\n const scene = object._scene;\n const camera = scene.camera;\n const mode = scene.mode;\n\n const orientation = scratchZoomViewOptions.orientation;\n orientation.heading = camera.heading;\n orientation.pitch = camera.pitch;\n orientation.roll = camera.roll;\n\n if (camera.frustum instanceof OrthographicFrustum) {\n if (Math.abs(distance) > 0.0) {\n camera.zoomIn(distance);\n camera._adjustOrthographicFrustum();\n }\n return;\n }\n\n const sameStartPosition = Cartesian2.equals(\n startPosition,\n object._zoomMouseStart\n );\n let zoomingOnVector = object._zoomingOnVector;\n let rotatingZoom = object._rotatingZoom;\n let pickedPosition;\n\n if (!sameStartPosition) {\n object._zoomMouseStart = Cartesian2.clone(\n startPosition,\n object._zoomMouseStart\n );\n\n if (defined(object._globe)) {\n if (mode === SceneMode.SCENE2D) {\n pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay)\n .origin;\n pickedPosition = Cartesian3.fromElements(\n pickedPosition.y,\n pickedPosition.z,\n pickedPosition.x\n );\n } else {\n pickedPosition = pickGlobe(object, startPosition, scratchPickCartesian);\n }\n }\n if (defined(pickedPosition)) {\n object._useZoomWorldPosition = true;\n object._zoomWorldPosition = Cartesian3.clone(\n pickedPosition,\n object._zoomWorldPosition\n );\n } else {\n object._useZoomWorldPosition = false;\n }\n\n zoomingOnVector = object._zoomingOnVector = false;\n rotatingZoom = object._rotatingZoom = false;\n object._zoomingUnderground = object._cameraUnderground;\n }\n\n if (!object._useZoomWorldPosition) {\n camera.zoomIn(distance);\n return;\n }\n\n let zoomOnVector = mode === SceneMode.COLUMBUS_VIEW;\n\n if (camera.positionCartographic.height < 2000000) {\n rotatingZoom = true;\n }\n\n if (!sameStartPosition || rotatingZoom) {\n if (mode === SceneMode.SCENE2D) {\n const worldPosition = object._zoomWorldPosition;\n const endPosition = camera.position;\n\n if (\n !Cartesian3.equals(worldPosition, endPosition) &&\n camera.positionCartographic.height < object._maxCoord.x * 2.0\n ) {\n const savedX = camera.position.x;\n\n const direction = Cartesian3.subtract(\n worldPosition,\n endPosition,\n scratchZoomDirection\n );\n Cartesian3.normalize(direction, direction);\n\n const d =\n (Cartesian3.distance(worldPosition, endPosition) * distance) /\n (camera.getMagnitude() * 0.5);\n camera.move(direction, d * 0.5);\n\n if (\n (camera.position.x < 0.0 && savedX > 0.0) ||\n (camera.position.x > 0.0 && savedX < 0.0)\n ) {\n pickedPosition = camera.getPickRay(startPosition, scratchZoomPickRay)\n .origin;\n pickedPosition = Cartesian3.fromElements(\n pickedPosition.y,\n pickedPosition.z,\n pickedPosition.x\n );\n object._zoomWorldPosition = Cartesian3.clone(\n pickedPosition,\n object._zoomWorldPosition\n );\n }\n }\n } else if (mode === SceneMode.SCENE3D) {\n const cameraPositionNormal = Cartesian3.normalize(\n camera.position,\n scratchCameraPositionNormal\n );\n if (\n object._cameraUnderground ||\n object._zoomingUnderground ||\n (camera.positionCartographic.height < 3000.0 &&\n Math.abs(Cartesian3.dot(camera.direction, cameraPositionNormal)) <\n 0.6)\n ) {\n zoomOnVector = true;\n } else {\n const canvas = scene.canvas;\n\n const centerPixel = scratchCenterPixel;\n centerPixel.x = canvas.clientWidth / 2;\n centerPixel.y = canvas.clientHeight / 2;\n const centerPosition = pickGlobe(\n object,\n centerPixel,\n scratchCenterPosition\n );\n // If centerPosition is not defined, it means the globe does not cover the center position of screen\n\n if (!defined(centerPosition)) {\n zoomOnVector = true;\n } else if (camera.positionCartographic.height < 1000000) {\n // The math in the else block assumes the camera\n // points toward the earth surface, so we check it here.\n // Theoretically, we should check for 90 degree, but it doesn't behave well when parallel\n // to the earth surface\n if (Cartesian3.dot(camera.direction, cameraPositionNormal) >= -0.5) {\n zoomOnVector = true;\n } else {\n const cameraPosition = scratchCameraPosition;\n Cartesian3.clone(camera.position, cameraPosition);\n const target = object._zoomWorldPosition;\n\n let targetNormal = scratchTargetNormal;\n\n targetNormal = Cartesian3.normalize(target, targetNormal);\n\n if (Cartesian3.dot(targetNormal, cameraPositionNormal) < 0.0) {\n return;\n }\n\n const center = scratchCenter;\n const forward = scratchForwardNormal;\n Cartesian3.clone(camera.direction, forward);\n Cartesian3.add(\n cameraPosition,\n Cartesian3.multiplyByScalar(forward, 1000, scratchCartesian),\n center\n );\n\n const positionToTarget = scratchPositionToTarget;\n const positionToTargetNormal = scratchPositionToTargetNormal;\n Cartesian3.subtract(target, cameraPosition, positionToTarget);\n\n Cartesian3.normalize(positionToTarget, positionToTargetNormal);\n\n const alphaDot = Cartesian3.dot(\n cameraPositionNormal,\n positionToTargetNormal\n );\n if (alphaDot >= 0.0) {\n // We zoomed past the target, and this zoom is not valid anymore.\n // This line causes the next zoom movement to pick a new starting point.\n object._zoomMouseStart.x = -1;\n return;\n }\n const alpha = Math.acos(-alphaDot);\n const cameraDistance = Cartesian3.magnitude(cameraPosition);\n const targetDistance = Cartesian3.magnitude(target);\n const remainingDistance = cameraDistance - distance;\n const positionToTargetDistance = Cartesian3.magnitude(\n positionToTarget\n );\n\n const gamma = Math.asin(\n CesiumMath.clamp(\n (positionToTargetDistance / targetDistance) * Math.sin(alpha),\n -1.0,\n 1.0\n )\n );\n const delta = Math.asin(\n CesiumMath.clamp(\n (remainingDistance / targetDistance) * Math.sin(alpha),\n -1.0,\n 1.0\n )\n );\n const beta = gamma - delta + alpha;\n\n const up = scratchCameraUpNormal;\n Cartesian3.normalize(cameraPosition, up);\n let right = scratchCameraRightNormal;\n right = Cartesian3.cross(positionToTargetNormal, up, right);\n right = Cartesian3.normalize(right, right);\n\n Cartesian3.normalize(\n Cartesian3.cross(up, right, scratchCartesian),\n forward\n );\n\n // Calculate new position to move to\n Cartesian3.multiplyByScalar(\n Cartesian3.normalize(center, scratchCartesian),\n Cartesian3.magnitude(center) - distance,\n center\n );\n Cartesian3.normalize(cameraPosition, cameraPosition);\n Cartesian3.multiplyByScalar(\n cameraPosition,\n remainingDistance,\n cameraPosition\n );\n\n // Pan\n const pMid = scratchPan;\n Cartesian3.multiplyByScalar(\n Cartesian3.add(\n Cartesian3.multiplyByScalar(\n up,\n Math.cos(beta) - 1,\n scratchCartesianTwo\n ),\n Cartesian3.multiplyByScalar(\n forward,\n Math.sin(beta),\n scratchCartesianThree\n ),\n scratchCartesian\n ),\n remainingDistance,\n pMid\n );\n Cartesian3.add(cameraPosition, pMid, cameraPosition);\n\n Cartesian3.normalize(center, up);\n Cartesian3.normalize(\n Cartesian3.cross(up, right, scratchCartesian),\n forward\n );\n\n const cMid = scratchCenterMovement;\n Cartesian3.multiplyByScalar(\n Cartesian3.add(\n Cartesian3.multiplyByScalar(\n up,\n Math.cos(beta) - 1,\n scratchCartesianTwo\n ),\n Cartesian3.multiplyByScalar(\n forward,\n Math.sin(beta),\n scratchCartesianThree\n ),\n scratchCartesian\n ),\n Cartesian3.magnitude(center),\n cMid\n );\n Cartesian3.add(center, cMid, center);\n\n // Update camera\n\n // Set new position\n Cartesian3.clone(cameraPosition, camera.position);\n\n // Set new direction\n Cartesian3.normalize(\n Cartesian3.subtract(center, cameraPosition, scratchCartesian),\n camera.direction\n );\n Cartesian3.clone(camera.direction, camera.direction);\n\n // Set new right & up vectors\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n camera.setView(scratchZoomViewOptions);\n return;\n }\n } else {\n const positionNormal = Cartesian3.normalize(\n centerPosition,\n scratchPositionNormal\n );\n const pickedNormal = Cartesian3.normalize(\n object._zoomWorldPosition,\n scratchPickNormal\n );\n const dotProduct = Cartesian3.dot(pickedNormal, positionNormal);\n\n if (dotProduct > 0.0 && dotProduct < 1.0) {\n const angle = CesiumMath.acosClamped(dotProduct);\n const axis = Cartesian3.cross(\n pickedNormal,\n positionNormal,\n scratchZoomAxis\n );\n\n const denom =\n Math.abs(angle) > CesiumMath.toRadians(20.0)\n ? camera.positionCartographic.height * 0.75\n : camera.positionCartographic.height - distance;\n const scalar = distance / denom;\n camera.rotate(axis, angle * scalar);\n }\n }\n }\n }\n\n object._rotatingZoom = !zoomOnVector;\n }\n\n if ((!sameStartPosition && zoomOnVector) || zoomingOnVector) {\n let ray;\n const zoomMouseStart = SceneTransforms.wgs84ToWindowCoordinates(\n scene,\n object._zoomWorldPosition,\n scratchZoomOffset\n );\n if (\n mode !== SceneMode.COLUMBUS_VIEW &&\n Cartesian2.equals(startPosition, object._zoomMouseStart) &&\n defined(zoomMouseStart)\n ) {\n ray = camera.getPickRay(zoomMouseStart, scratchZoomPickRay);\n } else {\n ray = camera.getPickRay(startPosition, scratchZoomPickRay);\n }\n\n const rayDirection = ray.direction;\n if (mode === SceneMode.COLUMBUS_VIEW || mode === SceneMode.SCENE2D) {\n Cartesian3.fromElements(\n rayDirection.y,\n rayDirection.z,\n rayDirection.x,\n rayDirection\n );\n }\n\n camera.move(rayDirection, distance);\n\n object._zoomingOnVector = true;\n } else {\n camera.zoomIn(distance);\n }\n\n if (!object._cameraUnderground) {\n camera.setView(scratchZoomViewOptions);\n }\n}\n\nconst translate2DStart = new Ray();\nconst translate2DEnd = new Ray();\nconst scratchTranslateP0 = new Cartesian3();\n\nfunction translate2D(controller, startPosition, movement) {\n const scene = controller._scene;\n const camera = scene.camera;\n let start = camera.getPickRay(movement.startPosition, translate2DStart)\n .origin;\n let end = camera.getPickRay(movement.endPosition, translate2DEnd).origin;\n\n start = Cartesian3.fromElements(start.y, start.z, start.x, start);\n end = Cartesian3.fromElements(end.y, end.z, end.x, end);\n\n const direction = Cartesian3.subtract(start, end, scratchTranslateP0);\n const distance = Cartesian3.magnitude(direction);\n\n if (distance > 0.0) {\n Cartesian3.normalize(direction, direction);\n camera.move(direction, distance);\n }\n}\n\nfunction zoom2D(controller, startPosition, movement) {\n if (defined(movement.distance)) {\n movement = movement.distance;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n\n handleZoom(\n controller,\n startPosition,\n movement,\n controller._zoomFactor,\n camera.getMagnitude()\n );\n}\n\nconst twist2DStart = new Cartesian2();\nconst twist2DEnd = new Cartesian2();\n\nfunction twist2D(controller, startPosition, movement) {\n if (defined(movement.angleAndHeight)) {\n singleAxisTwist2D(controller, startPosition, movement.angleAndHeight);\n return;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n\n let start = twist2DStart;\n start.x = (2.0 / width) * movement.startPosition.x - 1.0;\n start.y = (2.0 / height) * (height - movement.startPosition.y) - 1.0;\n start = Cartesian2.normalize(start, start);\n\n let end = twist2DEnd;\n end.x = (2.0 / width) * movement.endPosition.x - 1.0;\n end.y = (2.0 / height) * (height - movement.endPosition.y) - 1.0;\n end = Cartesian2.normalize(end, end);\n\n let startTheta = CesiumMath.acosClamped(start.x);\n if (start.y < 0) {\n startTheta = CesiumMath.TWO_PI - startTheta;\n }\n let endTheta = CesiumMath.acosClamped(end.x);\n if (end.y < 0) {\n endTheta = CesiumMath.TWO_PI - endTheta;\n }\n const theta = endTheta - startTheta;\n\n camera.twistRight(theta);\n}\n\nfunction singleAxisTwist2D(controller, startPosition, movement) {\n let rotateRate =\n controller._rotateFactor * controller._rotateRateRangeAdjustment;\n\n if (rotateRate > controller._maximumRotateRate) {\n rotateRate = controller._maximumRotateRate;\n }\n\n if (rotateRate < controller._minimumRotateRate) {\n rotateRate = controller._minimumRotateRate;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n\n let phiWindowRatio =\n (movement.endPosition.x - movement.startPosition.x) / canvas.clientWidth;\n phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);\n\n const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 4.0;\n\n camera.twistRight(deltaPhi);\n}\n\nfunction update2D(controller) {\n const rotatable2D = controller._scene.mapMode2D === MapMode2D.ROTATE;\n if (!Matrix4.equals(Matrix4.IDENTITY, controller._scene.camera.transform)) {\n reactToInput(\n controller,\n controller.enableZoom,\n controller.zoomEventTypes,\n zoom2D,\n controller.inertiaZoom,\n \"_lastInertiaZoomMovement\"\n );\n if (rotatable2D) {\n reactToInput(\n controller,\n controller.enableRotate,\n controller.translateEventTypes,\n twist2D,\n controller.inertiaSpin,\n \"_lastInertiaSpinMovement\"\n );\n }\n } else {\n reactToInput(\n controller,\n controller.enableTranslate,\n controller.translateEventTypes,\n translate2D,\n controller.inertiaTranslate,\n \"_lastInertiaTranslateMovement\"\n );\n reactToInput(\n controller,\n controller.enableZoom,\n controller.zoomEventTypes,\n zoom2D,\n controller.inertiaZoom,\n \"_lastInertiaZoomMovement\"\n );\n if (rotatable2D) {\n reactToInput(\n controller,\n controller.enableRotate,\n controller.tiltEventTypes,\n twist2D,\n controller.inertiaSpin,\n \"_lastInertiaTiltMovement\"\n );\n }\n }\n}\n\nconst pickGlobeScratchRay = new Ray();\nconst scratchDepthIntersection = new Cartesian3();\nconst scratchRayIntersection = new Cartesian3();\n\nfunction pickGlobe(controller, mousePosition, result) {\n const scene = controller._scene;\n const globe = controller._globe;\n const camera = scene.camera;\n\n if (!defined(globe)) {\n return undefined;\n }\n\n const cullBackFaces = !controller._cameraUnderground;\n\n let depthIntersection;\n if (scene.pickPositionSupported) {\n depthIntersection = scene.pickPositionWorldCoordinates(\n mousePosition,\n scratchDepthIntersection\n );\n }\n\n const ray = camera.getPickRay(mousePosition, pickGlobeScratchRay);\n const rayIntersection = globe.pickWorldCoordinates(\n ray,\n scene,\n cullBackFaces,\n scratchRayIntersection\n );\n\n const pickDistance = defined(depthIntersection)\n ? Cartesian3.distance(depthIntersection, camera.positionWC)\n : Number.POSITIVE_INFINITY;\n const rayDistance = defined(rayIntersection)\n ? Cartesian3.distance(rayIntersection, camera.positionWC)\n : Number.POSITIVE_INFINITY;\n\n if (pickDistance < rayDistance) {\n return Cartesian3.clone(depthIntersection, result);\n }\n\n return Cartesian3.clone(rayIntersection, result);\n}\n\nconst scratchDistanceCartographic = new Cartographic();\n\nfunction getDistanceFromSurface(controller) {\n const ellipsoid = controller._ellipsoid;\n const scene = controller._scene;\n const camera = scene.camera;\n const mode = scene.mode;\n\n let height = 0.0;\n if (mode === SceneMode.SCENE3D) {\n const cartographic = ellipsoid.cartesianToCartographic(\n camera.position,\n scratchDistanceCartographic\n );\n if (defined(cartographic)) {\n height = cartographic.height;\n }\n } else {\n height = camera.position.z;\n }\n const globeHeight = defaultValue(controller._scene.globeHeight, 0.0);\n const distanceFromSurface = Math.abs(globeHeight - height);\n return distanceFromSurface;\n}\n\nconst scratchSurfaceNormal = new Cartesian3();\n\nfunction getZoomDistanceUnderground(controller, ray) {\n const origin = ray.origin;\n const direction = ray.direction;\n const distanceFromSurface = getDistanceFromSurface(controller);\n\n // Weight zoom distance based on how strongly the pick ray is pointing inward.\n // Geocentric normal is accurate enough for these purposes\n const surfaceNormal = Cartesian3.normalize(origin, scratchSurfaceNormal);\n let strength = Math.abs(Cartesian3.dot(surfaceNormal, direction));\n strength = Math.max(strength, 0.5) * 2.0;\n return distanceFromSurface * strength;\n}\n\nfunction getTiltCenterUnderground(controller, ray, pickedPosition, result) {\n let distance = Cartesian3.distance(ray.origin, pickedPosition);\n const distanceFromSurface = getDistanceFromSurface(controller);\n\n const maximumDistance = CesiumMath.clamp(\n distanceFromSurface * 5.0,\n controller._minimumUndergroundPickDistance,\n controller._maximumUndergroundPickDistance\n );\n\n if (distance > maximumDistance) {\n // Simulate look-at behavior by tilting around a small invisible sphere\n distance = Math.min(distance, distanceFromSurface / 5.0);\n distance = Math.max(distance, 100.0);\n }\n\n return Ray.getPoint(ray, distance, result);\n}\n\nfunction getStrafeStartPositionUnderground(\n controller,\n ray,\n pickedPosition,\n result\n) {\n let distance;\n if (!defined(pickedPosition)) {\n distance = getDistanceFromSurface(controller);\n } else {\n distance = Cartesian3.distance(ray.origin, pickedPosition);\n if (distance > controller._maximumUndergroundPickDistance) {\n // If the picked position is too far away set the strafe speed based on the\n // camera's height from the globe surface\n distance = getDistanceFromSurface(controller);\n }\n }\n\n return Ray.getPoint(ray, distance, result);\n}\n\nconst scratchInertialDelta = new Cartesian2();\n\nfunction continueStrafing(controller, movement) {\n // Update the end position continually based on the inertial delta\n const originalEndPosition = movement.endPosition;\n const inertialDelta = Cartesian2.subtract(\n movement.endPosition,\n movement.startPosition,\n scratchInertialDelta\n );\n const endPosition = controller._strafeEndMousePosition;\n Cartesian2.add(endPosition, inertialDelta, endPosition);\n movement.endPosition = endPosition;\n strafe(controller, movement, controller._strafeStartPosition);\n movement.endPosition = originalEndPosition;\n}\n\nconst translateCVStartRay = new Ray();\nconst translateCVEndRay = new Ray();\nconst translateCVStartPos = new Cartesian3();\nconst translateCVEndPos = new Cartesian3();\nconst translateCVDifference = new Cartesian3();\nconst translateCVOrigin = new Cartesian3();\nconst translateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst translateCVStartMouse = new Cartesian2();\nconst translateCVEndMouse = new Cartesian2();\n\nfunction translateCV(controller, startPosition, movement) {\n if (!Cartesian3.equals(startPosition, controller._translateMousePosition)) {\n controller._looking = false;\n }\n\n if (!Cartesian3.equals(startPosition, controller._strafeMousePosition)) {\n controller._strafing = false;\n }\n\n if (controller._looking) {\n look3D(controller, startPosition, movement);\n return;\n }\n\n if (controller._strafing) {\n continueStrafing(controller, movement);\n return;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n const cameraUnderground = controller._cameraUnderground;\n const startMouse = Cartesian2.clone(\n movement.startPosition,\n translateCVStartMouse\n );\n const endMouse = Cartesian2.clone(movement.endPosition, translateCVEndMouse);\n let startRay = camera.getPickRay(startMouse, translateCVStartRay);\n\n const origin = Cartesian3.clone(Cartesian3.ZERO, translateCVOrigin);\n const normal = Cartesian3.UNIT_X;\n\n let globePos;\n if (camera.position.z < controller._minimumPickingTerrainHeight) {\n globePos = pickGlobe(controller, startMouse, translateCVStartPos);\n if (defined(globePos)) {\n origin.x = globePos.x;\n }\n }\n\n if (\n cameraUnderground ||\n (origin.x > camera.position.z && defined(globePos))\n ) {\n let pickPosition = globePos;\n if (cameraUnderground) {\n pickPosition = getStrafeStartPositionUnderground(\n controller,\n startRay,\n globePos,\n translateCVStartPos\n );\n }\n Cartesian2.clone(startPosition, controller._strafeMousePosition);\n Cartesian2.clone(startPosition, controller._strafeEndMousePosition);\n Cartesian3.clone(pickPosition, controller._strafeStartPosition);\n controller._strafing = true;\n strafe(controller, movement, controller._strafeStartPosition);\n return;\n }\n\n const plane = Plane.fromPointNormal(origin, normal, translateCVPlane);\n\n startRay = camera.getPickRay(startMouse, translateCVStartRay);\n const startPlanePos = IntersectionTests.rayPlane(\n startRay,\n plane,\n translateCVStartPos\n );\n\n const endRay = camera.getPickRay(endMouse, translateCVEndRay);\n const endPlanePos = IntersectionTests.rayPlane(\n endRay,\n plane,\n translateCVEndPos\n );\n\n if (!defined(startPlanePos) || !defined(endPlanePos)) {\n controller._looking = true;\n look3D(controller, startPosition, movement);\n Cartesian2.clone(startPosition, controller._translateMousePosition);\n return;\n }\n\n const diff = Cartesian3.subtract(\n startPlanePos,\n endPlanePos,\n translateCVDifference\n );\n const temp = diff.x;\n diff.x = diff.y;\n diff.y = diff.z;\n diff.z = temp;\n const mag = Cartesian3.magnitude(diff);\n if (mag > CesiumMath.EPSILON6) {\n Cartesian3.normalize(diff, diff);\n camera.move(diff, mag);\n }\n}\n\nconst rotateCVWindowPos = new Cartesian2();\nconst rotateCVWindowRay = new Ray();\nconst rotateCVCenter = new Cartesian3();\nconst rotateCVVerticalCenter = new Cartesian3();\nconst rotateCVTransform = new Matrix4();\nconst rotateCVVerticalTransform = new Matrix4();\nconst rotateCVOrigin = new Cartesian3();\nconst rotateCVPlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst rotateCVCartesian3 = new Cartesian3();\nconst rotateCVCart = new Cartographic();\nconst rotateCVOldTransform = new Matrix4();\nconst rotateCVQuaternion = new Quaternion();\nconst rotateCVMatrix = new Matrix3();\nconst tilt3DCartesian3 = new Cartesian3();\n\nfunction rotateCV(controller, startPosition, movement) {\n if (defined(movement.angleAndHeight)) {\n movement = movement.angleAndHeight;\n }\n\n if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n controller._tiltCVOffMap = false;\n controller._looking = false;\n }\n\n if (controller._looking) {\n look3D(controller, startPosition, movement);\n return;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n\n if (\n controller._tiltCVOffMap ||\n !controller.onMap() ||\n Math.abs(camera.position.z) > controller._minimumPickingTerrainHeight\n ) {\n controller._tiltCVOffMap = true;\n rotateCVOnPlane(controller, startPosition, movement);\n } else {\n rotateCVOnTerrain(controller, startPosition, movement);\n }\n}\n\nfunction rotateCVOnPlane(controller, startPosition, movement) {\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n\n const windowPosition = rotateCVWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = canvas.clientHeight / 2;\n const ray = camera.getPickRay(windowPosition, rotateCVWindowRay);\n const normal = Cartesian3.UNIT_X;\n\n const position = ray.origin;\n const direction = ray.direction;\n let scalar;\n const normalDotDirection = Cartesian3.dot(normal, direction);\n if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {\n scalar = -Cartesian3.dot(normal, position) / normalDotDirection;\n }\n\n if (!defined(scalar) || scalar <= 0.0) {\n controller._looking = true;\n look3D(controller, startPosition, movement);\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n return;\n }\n\n const center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);\n Cartesian3.add(position, center, center);\n\n const projection = scene.mapProjection;\n const ellipsoid = projection.ellipsoid;\n\n Cartesian3.fromElements(center.y, center.z, center.x, center);\n const cart = projection.unproject(center, rotateCVCart);\n ellipsoid.cartographicToCartesian(cart, center);\n\n const transform = Transforms.eastNorthUpToFixedFrame(\n center,\n ellipsoid,\n rotateCVTransform\n );\n\n const oldGlobe = controller._globe;\n const oldEllipsoid = controller._ellipsoid;\n controller._globe = undefined;\n controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n controller._rotateFactor = 1.0;\n controller._rotateRateRangeAdjustment = 1.0;\n\n const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);\n camera._setTransform(transform);\n\n rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);\n\n camera._setTransform(oldTransform);\n controller._globe = oldGlobe;\n controller._ellipsoid = oldEllipsoid;\n\n const radius = oldEllipsoid.maximumRadius;\n controller._rotateFactor = 1.0 / radius;\n controller._rotateRateRangeAdjustment = radius;\n}\n\nfunction rotateCVOnTerrain(controller, startPosition, movement) {\n const scene = controller._scene;\n const camera = scene.camera;\n const cameraUnderground = controller._cameraUnderground;\n\n let center;\n let ray;\n const normal = Cartesian3.UNIT_X;\n\n if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n center = Cartesian3.clone(controller._tiltCenter, rotateCVCenter);\n } else {\n if (camera.position.z < controller._minimumPickingTerrainHeight) {\n center = pickGlobe(controller, startPosition, rotateCVCenter);\n }\n\n if (!defined(center)) {\n ray = camera.getPickRay(startPosition, rotateCVWindowRay);\n const position = ray.origin;\n const direction = ray.direction;\n\n let scalar;\n const normalDotDirection = Cartesian3.dot(normal, direction);\n if (Math.abs(normalDotDirection) > CesiumMath.EPSILON6) {\n scalar = -Cartesian3.dot(normal, position) / normalDotDirection;\n }\n\n if (!defined(scalar) || scalar <= 0.0) {\n controller._looking = true;\n look3D(controller, startPosition, movement);\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n return;\n }\n\n center = Cartesian3.multiplyByScalar(direction, scalar, rotateCVCenter);\n Cartesian3.add(position, center, center);\n }\n\n if (cameraUnderground) {\n if (!defined(ray)) {\n ray = camera.getPickRay(startPosition, rotateCVWindowRay);\n }\n getTiltCenterUnderground(controller, ray, center, center);\n }\n\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n Cartesian3.clone(center, controller._tiltCenter);\n }\n\n const canvas = scene.canvas;\n\n const windowPosition = rotateCVWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = controller._tiltCenterMousePosition.y;\n ray = camera.getPickRay(windowPosition, rotateCVWindowRay);\n\n const origin = Cartesian3.clone(Cartesian3.ZERO, rotateCVOrigin);\n origin.x = center.x;\n\n const plane = Plane.fromPointNormal(origin, normal, rotateCVPlane);\n const verticalCenter = IntersectionTests.rayPlane(\n ray,\n plane,\n rotateCVVerticalCenter\n );\n\n const projection = camera._projection;\n const ellipsoid = projection.ellipsoid;\n\n Cartesian3.fromElements(center.y, center.z, center.x, center);\n let cart = projection.unproject(center, rotateCVCart);\n ellipsoid.cartographicToCartesian(cart, center);\n\n const transform = Transforms.eastNorthUpToFixedFrame(\n center,\n ellipsoid,\n rotateCVTransform\n );\n\n let verticalTransform;\n if (defined(verticalCenter)) {\n Cartesian3.fromElements(\n verticalCenter.y,\n verticalCenter.z,\n verticalCenter.x,\n verticalCenter\n );\n cart = projection.unproject(verticalCenter, rotateCVCart);\n ellipsoid.cartographicToCartesian(cart, verticalCenter);\n\n verticalTransform = Transforms.eastNorthUpToFixedFrame(\n verticalCenter,\n ellipsoid,\n rotateCVVerticalTransform\n );\n } else {\n verticalTransform = transform;\n }\n\n const oldGlobe = controller._globe;\n const oldEllipsoid = controller._ellipsoid;\n controller._globe = undefined;\n controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n controller._rotateFactor = 1.0;\n controller._rotateRateRangeAdjustment = 1.0;\n\n let constrainedAxis = Cartesian3.UNIT_Z;\n\n const oldTransform = Matrix4.clone(camera.transform, rotateCVOldTransform);\n camera._setTransform(transform);\n\n const tangent = Cartesian3.cross(\n Cartesian3.UNIT_Z,\n Cartesian3.normalize(camera.position, rotateCVCartesian3),\n rotateCVCartesian3\n );\n const dot = Cartesian3.dot(camera.right, tangent);\n\n rotate3D(controller, startPosition, movement, constrainedAxis, false, true);\n\n camera._setTransform(verticalTransform);\n if (dot < 0.0) {\n const movementDelta = movement.startPosition.y - movement.endPosition.y;\n if (\n (cameraUnderground && movementDelta < 0.0) ||\n (!cameraUnderground && movementDelta > 0.0)\n ) {\n // Prevent camera from flipping past the up axis\n constrainedAxis = undefined;\n }\n\n const oldConstrainedAxis = camera.constrainedAxis;\n camera.constrainedAxis = undefined;\n\n rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n\n camera.constrainedAxis = oldConstrainedAxis;\n } else {\n rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n }\n\n if (defined(camera.constrainedAxis)) {\n const right = Cartesian3.cross(\n camera.direction,\n camera.constrainedAxis,\n tilt3DCartesian3\n );\n if (\n !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)\n ) {\n if (Cartesian3.dot(right, camera.right) < 0.0) {\n Cartesian3.negate(right, right);\n }\n\n Cartesian3.cross(right, camera.direction, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n Cartesian3.normalize(camera.up, camera.up);\n Cartesian3.normalize(camera.right, camera.right);\n }\n }\n\n camera._setTransform(oldTransform);\n controller._globe = oldGlobe;\n controller._ellipsoid = oldEllipsoid;\n\n const radius = oldEllipsoid.maximumRadius;\n controller._rotateFactor = 1.0 / radius;\n controller._rotateRateRangeAdjustment = radius;\n\n const originalPosition = Cartesian3.clone(\n camera.positionWC,\n rotateCVCartesian3\n );\n\n if (controller.enableCollisionDetection) {\n adjustHeightForTerrain(controller);\n }\n\n if (!Cartesian3.equals(camera.positionWC, originalPosition)) {\n camera._setTransform(verticalTransform);\n camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);\n\n const magSqrd = Cartesian3.magnitudeSquared(originalPosition);\n if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {\n Cartesian3.normalize(camera.position, camera.position);\n Cartesian3.multiplyByScalar(\n camera.position,\n Math.sqrt(magSqrd),\n camera.position\n );\n }\n\n const angle = Cartesian3.angleBetween(originalPosition, camera.position);\n const axis = Cartesian3.cross(\n originalPosition,\n camera.position,\n originalPosition\n );\n Cartesian3.normalize(axis, axis);\n\n const quaternion = Quaternion.fromAxisAngle(\n axis,\n angle,\n rotateCVQuaternion\n );\n const rotation = Matrix3.fromQuaternion(quaternion, rotateCVMatrix);\n Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);\n Matrix3.multiplyByVector(rotation, camera.up, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n camera._setTransform(oldTransform);\n }\n}\n\nconst zoomCVWindowPos = new Cartesian2();\nconst zoomCVWindowRay = new Ray();\nconst zoomCVIntersection = new Cartesian3();\n\nfunction zoomCV(controller, startPosition, movement) {\n if (defined(movement.distance)) {\n movement = movement.distance;\n }\n\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n\n const cameraUnderground = controller._cameraUnderground;\n\n let windowPosition;\n\n if (cameraUnderground) {\n windowPosition = startPosition;\n } else {\n windowPosition = zoomCVWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = canvas.clientHeight / 2;\n }\n\n const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);\n const position = ray.origin;\n const direction = ray.direction;\n const height = camera.position.z;\n\n let intersection;\n if (height < controller._minimumPickingTerrainHeight) {\n intersection = pickGlobe(controller, windowPosition, zoomCVIntersection);\n }\n\n let distance;\n if (defined(intersection)) {\n distance = Cartesian3.distance(position, intersection);\n }\n\n if (cameraUnderground) {\n const distanceUnderground = getZoomDistanceUnderground(\n controller,\n ray,\n height\n );\n if (defined(distance)) {\n distance = Math.min(distance, distanceUnderground);\n } else {\n distance = distanceUnderground;\n }\n }\n\n if (!defined(distance)) {\n const normal = Cartesian3.UNIT_X;\n distance =\n -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);\n }\n\n handleZoom(\n controller,\n startPosition,\n movement,\n controller._zoomFactor,\n distance\n );\n}\n\nfunction updateCV(controller) {\n const scene = controller._scene;\n const camera = scene.camera;\n\n if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {\n reactToInput(\n controller,\n controller.enableRotate,\n controller.rotateEventTypes,\n rotate3D,\n controller.inertiaSpin,\n \"_lastInertiaSpinMovement\"\n );\n reactToInput(\n controller,\n controller.enableZoom,\n controller.zoomEventTypes,\n zoom3D,\n controller.inertiaZoom,\n \"_lastInertiaZoomMovement\"\n );\n } else {\n const tweens = controller._tweens;\n\n if (controller._aggregator.anyButtonDown) {\n tweens.removeAll();\n }\n\n reactToInput(\n controller,\n controller.enableTilt,\n controller.tiltEventTypes,\n rotateCV,\n controller.inertiaSpin,\n \"_lastInertiaTiltMovement\"\n );\n reactToInput(\n controller,\n controller.enableTranslate,\n controller.translateEventTypes,\n translateCV,\n controller.inertiaTranslate,\n \"_lastInertiaTranslateMovement\"\n );\n reactToInput(\n controller,\n controller.enableZoom,\n controller.zoomEventTypes,\n zoomCV,\n controller.inertiaZoom,\n \"_lastInertiaZoomMovement\"\n );\n reactToInput(\n controller,\n controller.enableLook,\n controller.lookEventTypes,\n look3D\n );\n\n if (\n !controller._aggregator.anyButtonDown &&\n !tweens.contains(controller._tween)\n ) {\n const tween = camera.createCorrectPositionTween(\n controller.bounceAnimationTime\n );\n if (defined(tween)) {\n controller._tween = tweens.add(tween);\n }\n }\n\n tweens.update();\n }\n}\n\nconst scratchStrafeRay = new Ray();\nconst scratchStrafePlane = new Plane(Cartesian3.UNIT_X, 0.0);\nconst scratchStrafeIntersection = new Cartesian3();\nconst scratchStrafeDirection = new Cartesian3();\nconst scratchMousePos = new Cartesian3();\n\nfunction strafe(controller, movement, strafeStartPosition) {\n const scene = controller._scene;\n const camera = scene.camera;\n\n const ray = camera.getPickRay(movement.endPosition, scratchStrafeRay);\n\n let direction = Cartesian3.clone(camera.direction, scratchStrafeDirection);\n if (scene.mode === SceneMode.COLUMBUS_VIEW) {\n Cartesian3.fromElements(direction.z, direction.x, direction.y, direction);\n }\n\n const plane = Plane.fromPointNormal(\n strafeStartPosition,\n direction,\n scratchStrafePlane\n );\n const intersection = IntersectionTests.rayPlane(\n ray,\n plane,\n scratchStrafeIntersection\n );\n if (!defined(intersection)) {\n return;\n }\n\n direction = Cartesian3.subtract(strafeStartPosition, intersection, direction);\n if (scene.mode === SceneMode.COLUMBUS_VIEW) {\n Cartesian3.fromElements(direction.y, direction.z, direction.x, direction);\n }\n\n Cartesian3.add(camera.position, direction, camera.position);\n}\n\nconst spin3DPick = new Cartesian3();\nconst scratchCartographic = new Cartographic();\nconst scratchRadii = new Cartesian3();\nconst scratchEllipsoid = new Ellipsoid();\nconst scratchLookUp = new Cartesian3();\nconst scratchNormal = new Cartesian3();\n\nfunction spin3D(controller, startPosition, movement) {\n const scene = controller._scene;\n const camera = scene.camera;\n const cameraUnderground = controller._cameraUnderground;\n let ellipsoid = controller._ellipsoid;\n\n if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n rotate3D(controller, startPosition, movement);\n return;\n }\n\n let magnitude;\n let radii;\n\n const up = ellipsoid.geodeticSurfaceNormal(camera.position, scratchLookUp);\n\n if (Cartesian2.equals(startPosition, controller._rotateMousePosition)) {\n if (controller._looking) {\n look3D(controller, startPosition, movement, up);\n } else if (controller._rotating) {\n rotate3D(controller, startPosition, movement);\n } else if (controller._strafing) {\n continueStrafing(controller, movement);\n } else {\n if (\n Cartesian3.magnitude(camera.position) <\n Cartesian3.magnitude(controller._rotateStartPosition)\n ) {\n // Pan action is no longer valid if camera moves below the pan ellipsoid\n return;\n }\n magnitude = Cartesian3.magnitude(controller._rotateStartPosition);\n radii = scratchRadii;\n radii.x = radii.y = radii.z = magnitude;\n ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n pan3D(controller, startPosition, movement, ellipsoid);\n }\n return;\n }\n controller._looking = false;\n controller._rotating = false;\n controller._strafing = false;\n\n const height = ellipsoid.cartesianToCartographic(\n camera.positionWC,\n scratchCartographic\n ).height;\n const globe = controller._globe;\n\n if (defined(globe) && height < controller._minimumPickingTerrainHeight) {\n const mousePos = pickGlobe(\n controller,\n movement.startPosition,\n scratchMousePos\n );\n if (defined(mousePos)) {\n let strafing = false;\n const ray = camera.getPickRay(\n movement.startPosition,\n pickGlobeScratchRay\n );\n\n if (cameraUnderground) {\n strafing = true;\n getStrafeStartPositionUnderground(controller, ray, mousePos, mousePos);\n } else {\n const normal = ellipsoid.geodeticSurfaceNormal(mousePos, scratchNormal);\n const tangentPick =\n Math.abs(Cartesian3.dot(ray.direction, normal)) < 0.05;\n\n if (tangentPick) {\n strafing = true;\n } else {\n strafing =\n Cartesian3.magnitude(camera.position) <\n Cartesian3.magnitude(mousePos);\n }\n }\n\n if (strafing) {\n Cartesian2.clone(startPosition, controller._strafeEndMousePosition);\n Cartesian3.clone(mousePos, controller._strafeStartPosition);\n controller._strafing = true;\n strafe(controller, movement, controller._strafeStartPosition);\n } else {\n magnitude = Cartesian3.magnitude(mousePos);\n radii = scratchRadii;\n radii.x = radii.y = radii.z = magnitude;\n ellipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n pan3D(controller, startPosition, movement, ellipsoid);\n\n Cartesian3.clone(mousePos, controller._rotateStartPosition);\n }\n } else {\n controller._looking = true;\n look3D(controller, startPosition, movement, up);\n }\n } else if (\n defined(\n camera.pickEllipsoid(\n movement.startPosition,\n controller._ellipsoid,\n spin3DPick\n )\n )\n ) {\n pan3D(controller, startPosition, movement, controller._ellipsoid);\n Cartesian3.clone(spin3DPick, controller._rotateStartPosition);\n } else if (height > controller._minimumTrackBallHeight) {\n controller._rotating = true;\n rotate3D(controller, startPosition, movement);\n } else {\n controller._looking = true;\n look3D(controller, startPosition, movement, up);\n }\n\n Cartesian2.clone(startPosition, controller._rotateMousePosition);\n}\n\nfunction rotate3D(\n controller,\n startPosition,\n movement,\n constrainedAxis,\n rotateOnlyVertical,\n rotateOnlyHorizontal\n) {\n rotateOnlyVertical = defaultValue(rotateOnlyVertical, false);\n rotateOnlyHorizontal = defaultValue(rotateOnlyHorizontal, false);\n\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n\n const oldAxis = camera.constrainedAxis;\n if (defined(constrainedAxis)) {\n camera.constrainedAxis = constrainedAxis;\n }\n\n const rho = Cartesian3.magnitude(camera.position);\n let rotateRate =\n controller._rotateFactor * (rho - controller._rotateRateRangeAdjustment);\n\n if (rotateRate > controller._maximumRotateRate) {\n rotateRate = controller._maximumRotateRate;\n }\n\n if (rotateRate < controller._minimumRotateRate) {\n rotateRate = controller._minimumRotateRate;\n }\n\n let phiWindowRatio =\n (movement.startPosition.x - movement.endPosition.x) / canvas.clientWidth;\n let thetaWindowRatio =\n (movement.startPosition.y - movement.endPosition.y) / canvas.clientHeight;\n phiWindowRatio = Math.min(phiWindowRatio, controller.maximumMovementRatio);\n thetaWindowRatio = Math.min(\n thetaWindowRatio,\n controller.maximumMovementRatio\n );\n\n const deltaPhi = rotateRate * phiWindowRatio * Math.PI * 2.0;\n const deltaTheta = rotateRate * thetaWindowRatio * Math.PI;\n\n if (!rotateOnlyVertical) {\n camera.rotateRight(deltaPhi);\n }\n\n if (!rotateOnlyHorizontal) {\n camera.rotateUp(deltaTheta);\n }\n\n camera.constrainedAxis = oldAxis;\n}\n\nconst pan3DP0 = Cartesian4.clone(Cartesian4.UNIT_W);\nconst pan3DP1 = Cartesian4.clone(Cartesian4.UNIT_W);\nconst pan3DTemp0 = new Cartesian3();\nconst pan3DTemp1 = new Cartesian3();\nconst pan3DTemp2 = new Cartesian3();\nconst pan3DTemp3 = new Cartesian3();\nconst pan3DStartMousePosition = new Cartesian2();\nconst pan3DEndMousePosition = new Cartesian2();\n\nfunction pan3D(controller, startPosition, movement, ellipsoid) {\n const scene = controller._scene;\n const camera = scene.camera;\n\n const startMousePosition = Cartesian2.clone(\n movement.startPosition,\n pan3DStartMousePosition\n );\n const endMousePosition = Cartesian2.clone(\n movement.endPosition,\n pan3DEndMousePosition\n );\n\n let p0 = camera.pickEllipsoid(startMousePosition, ellipsoid, pan3DP0);\n let p1 = camera.pickEllipsoid(endMousePosition, ellipsoid, pan3DP1);\n\n if (!defined(p0) || !defined(p1)) {\n controller._rotating = true;\n rotate3D(controller, startPosition, movement);\n return;\n }\n\n p0 = camera.worldToCameraCoordinates(p0, p0);\n p1 = camera.worldToCameraCoordinates(p1, p1);\n\n if (!defined(camera.constrainedAxis)) {\n Cartesian3.normalize(p0, p0);\n Cartesian3.normalize(p1, p1);\n const dot = Cartesian3.dot(p0, p1);\n const axis = Cartesian3.cross(p0, p1, pan3DTemp0);\n\n if (\n dot < 1.0 &&\n !Cartesian3.equalsEpsilon(axis, Cartesian3.ZERO, CesiumMath.EPSILON14)\n ) {\n // dot is in [0, 1]\n const angle = Math.acos(dot);\n camera.rotate(axis, angle);\n }\n } else {\n const basis0 = camera.constrainedAxis;\n const basis1 = Cartesian3.mostOrthogonalAxis(basis0, pan3DTemp0);\n Cartesian3.cross(basis1, basis0, basis1);\n Cartesian3.normalize(basis1, basis1);\n const basis2 = Cartesian3.cross(basis0, basis1, pan3DTemp1);\n\n const startRho = Cartesian3.magnitude(p0);\n const startDot = Cartesian3.dot(basis0, p0);\n const startTheta = Math.acos(startDot / startRho);\n const startRej = Cartesian3.multiplyByScalar(basis0, startDot, pan3DTemp2);\n Cartesian3.subtract(p0, startRej, startRej);\n Cartesian3.normalize(startRej, startRej);\n\n const endRho = Cartesian3.magnitude(p1);\n const endDot = Cartesian3.dot(basis0, p1);\n const endTheta = Math.acos(endDot / endRho);\n const endRej = Cartesian3.multiplyByScalar(basis0, endDot, pan3DTemp3);\n Cartesian3.subtract(p1, endRej, endRej);\n Cartesian3.normalize(endRej, endRej);\n\n let startPhi = Math.acos(Cartesian3.dot(startRej, basis1));\n if (Cartesian3.dot(startRej, basis2) < 0) {\n startPhi = CesiumMath.TWO_PI - startPhi;\n }\n\n let endPhi = Math.acos(Cartesian3.dot(endRej, basis1));\n if (Cartesian3.dot(endRej, basis2) < 0) {\n endPhi = CesiumMath.TWO_PI - endPhi;\n }\n\n const deltaPhi = startPhi - endPhi;\n\n let east;\n if (\n Cartesian3.equalsEpsilon(basis0, camera.position, CesiumMath.EPSILON2)\n ) {\n east = camera.right;\n } else {\n east = Cartesian3.cross(basis0, camera.position, pan3DTemp0);\n }\n\n const planeNormal = Cartesian3.cross(basis0, east, pan3DTemp0);\n const side0 = Cartesian3.dot(\n planeNormal,\n Cartesian3.subtract(p0, basis0, pan3DTemp1)\n );\n const side1 = Cartesian3.dot(\n planeNormal,\n Cartesian3.subtract(p1, basis0, pan3DTemp1)\n );\n\n let deltaTheta;\n if (side0 > 0 && side1 > 0) {\n deltaTheta = endTheta - startTheta;\n } else if (side0 > 0 && side1 <= 0) {\n if (Cartesian3.dot(camera.position, basis0) > 0) {\n deltaTheta = -startTheta - endTheta;\n } else {\n deltaTheta = startTheta + endTheta;\n }\n } else {\n deltaTheta = startTheta - endTheta;\n }\n\n camera.rotateRight(deltaPhi);\n camera.rotateUp(deltaTheta);\n }\n}\n\nconst zoom3DUnitPosition = new Cartesian3();\nconst zoom3DCartographic = new Cartographic();\n\nfunction zoom3D(controller, startPosition, movement) {\n if (defined(movement.distance)) {\n movement = movement.distance;\n }\n\n const ellipsoid = controller._ellipsoid;\n const scene = controller._scene;\n const camera = scene.camera;\n const canvas = scene.canvas;\n\n const cameraUnderground = controller._cameraUnderground;\n\n let windowPosition;\n\n if (cameraUnderground) {\n windowPosition = startPosition;\n } else {\n windowPosition = zoomCVWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = canvas.clientHeight / 2;\n }\n\n const ray = camera.getPickRay(windowPosition, zoomCVWindowRay);\n\n let intersection;\n const height = ellipsoid.cartesianToCartographic(\n camera.position,\n zoom3DCartographic\n ).height;\n if (height < controller._minimumPickingTerrainHeight) {\n intersection = pickGlobe(controller, windowPosition, zoomCVIntersection);\n }\n\n let distance;\n if (defined(intersection)) {\n distance = Cartesian3.distance(ray.origin, intersection);\n }\n\n if (cameraUnderground) {\n const distanceUnderground = getZoomDistanceUnderground(\n controller,\n ray,\n height\n );\n if (defined(distance)) {\n distance = Math.min(distance, distanceUnderground);\n } else {\n distance = distanceUnderground;\n }\n }\n\n if (!defined(distance)) {\n distance = height;\n }\n\n const unitPosition = Cartesian3.normalize(\n camera.position,\n zoom3DUnitPosition\n );\n handleZoom(\n controller,\n startPosition,\n movement,\n controller._zoomFactor,\n distance,\n Cartesian3.dot(unitPosition, camera.direction)\n );\n}\n\nconst tilt3DWindowPos = new Cartesian2();\nconst tilt3DRay = new Ray();\nconst tilt3DCenter = new Cartesian3();\nconst tilt3DVerticalCenter = new Cartesian3();\nconst tilt3DTransform = new Matrix4();\nconst tilt3DVerticalTransform = new Matrix4();\nconst tilt3DOldTransform = new Matrix4();\nconst tilt3DQuaternion = new Quaternion();\nconst tilt3DMatrix = new Matrix3();\nconst tilt3DCart = new Cartographic();\nconst tilt3DLookUp = new Cartesian3();\n\nfunction tilt3D(controller, startPosition, movement) {\n const scene = controller._scene;\n const camera = scene.camera;\n\n if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n return;\n }\n\n if (defined(movement.angleAndHeight)) {\n movement = movement.angleAndHeight;\n }\n\n if (!Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n controller._tiltOnEllipsoid = false;\n controller._looking = false;\n }\n\n if (controller._looking) {\n const up = controller._ellipsoid.geodeticSurfaceNormal(\n camera.position,\n tilt3DLookUp\n );\n look3D(controller, startPosition, movement, up);\n return;\n }\n\n const ellipsoid = controller._ellipsoid;\n const cartographic = ellipsoid.cartesianToCartographic(\n camera.position,\n tilt3DCart\n );\n\n if (\n controller._tiltOnEllipsoid ||\n cartographic.height > controller._minimumCollisionTerrainHeight\n ) {\n controller._tiltOnEllipsoid = true;\n tilt3DOnEllipsoid(controller, startPosition, movement);\n } else {\n tilt3DOnTerrain(controller, startPosition, movement);\n }\n}\n\nconst tilt3DOnEllipsoidCartographic = new Cartographic();\n\nfunction tilt3DOnEllipsoid(controller, startPosition, movement) {\n const ellipsoid = controller._ellipsoid;\n const scene = controller._scene;\n const camera = scene.camera;\n const minHeight = controller.minimumZoomDistance * 0.25;\n const height = ellipsoid.cartesianToCartographic(\n camera.positionWC,\n tilt3DOnEllipsoidCartographic\n ).height;\n if (\n height - minHeight - 1.0 < CesiumMath.EPSILON3 &&\n movement.endPosition.y - movement.startPosition.y < 0\n ) {\n return;\n }\n\n const canvas = scene.canvas;\n\n const windowPosition = tilt3DWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = canvas.clientHeight / 2;\n const ray = camera.getPickRay(windowPosition, tilt3DRay);\n\n let center;\n const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n if (defined(intersection)) {\n center = Ray.getPoint(ray, intersection.start, tilt3DCenter);\n } else if (height > controller._minimumTrackBallHeight) {\n const grazingAltitudeLocation = IntersectionTests.grazingAltitudeLocation(\n ray,\n ellipsoid\n );\n if (!defined(grazingAltitudeLocation)) {\n return;\n }\n const grazingAltitudeCart = ellipsoid.cartesianToCartographic(\n grazingAltitudeLocation,\n tilt3DCart\n );\n grazingAltitudeCart.height = 0.0;\n center = ellipsoid.cartographicToCartesian(\n grazingAltitudeCart,\n tilt3DCenter\n );\n } else {\n controller._looking = true;\n const up = controller._ellipsoid.geodeticSurfaceNormal(\n camera.position,\n tilt3DLookUp\n );\n look3D(controller, startPosition, movement, up);\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n return;\n }\n\n const transform = Transforms.eastNorthUpToFixedFrame(\n center,\n ellipsoid,\n tilt3DTransform\n );\n\n const oldGlobe = controller._globe;\n const oldEllipsoid = controller._ellipsoid;\n controller._globe = undefined;\n controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n controller._rotateFactor = 1.0;\n controller._rotateRateRangeAdjustment = 1.0;\n\n const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);\n camera._setTransform(transform);\n\n rotate3D(controller, startPosition, movement, Cartesian3.UNIT_Z);\n\n camera._setTransform(oldTransform);\n controller._globe = oldGlobe;\n controller._ellipsoid = oldEllipsoid;\n\n const radius = oldEllipsoid.maximumRadius;\n controller._rotateFactor = 1.0 / radius;\n controller._rotateRateRangeAdjustment = radius;\n}\n\nfunction tilt3DOnTerrain(controller, startPosition, movement) {\n const ellipsoid = controller._ellipsoid;\n const scene = controller._scene;\n const camera = scene.camera;\n const cameraUnderground = controller._cameraUnderground;\n\n let center;\n let ray;\n let intersection;\n\n if (Cartesian2.equals(startPosition, controller._tiltCenterMousePosition)) {\n center = Cartesian3.clone(controller._tiltCenter, tilt3DCenter);\n } else {\n center = pickGlobe(controller, startPosition, tilt3DCenter);\n\n if (!defined(center)) {\n ray = camera.getPickRay(startPosition, tilt3DRay);\n intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);\n if (!defined(intersection)) {\n const cartographic = ellipsoid.cartesianToCartographic(\n camera.position,\n tilt3DCart\n );\n if (cartographic.height <= controller._minimumTrackBallHeight) {\n controller._looking = true;\n const up = controller._ellipsoid.geodeticSurfaceNormal(\n camera.position,\n tilt3DLookUp\n );\n look3D(controller, startPosition, movement, up);\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n }\n return;\n }\n center = Ray.getPoint(ray, intersection.start, tilt3DCenter);\n }\n\n if (cameraUnderground) {\n if (!defined(ray)) {\n ray = camera.getPickRay(startPosition, tilt3DRay);\n }\n getTiltCenterUnderground(controller, ray, center, center);\n }\n\n Cartesian2.clone(startPosition, controller._tiltCenterMousePosition);\n Cartesian3.clone(center, controller._tiltCenter);\n }\n\n const canvas = scene.canvas;\n\n const windowPosition = tilt3DWindowPos;\n windowPosition.x = canvas.clientWidth / 2;\n windowPosition.y = controller._tiltCenterMousePosition.y;\n ray = camera.getPickRay(windowPosition, tilt3DRay);\n\n const mag = Cartesian3.magnitude(center);\n const radii = Cartesian3.fromElements(mag, mag, mag, scratchRadii);\n const newEllipsoid = Ellipsoid.fromCartesian3(radii, scratchEllipsoid);\n\n intersection = IntersectionTests.rayEllipsoid(ray, newEllipsoid);\n if (!defined(intersection)) {\n return;\n }\n\n const t =\n Cartesian3.magnitude(ray.origin) > mag\n ? intersection.start\n : intersection.stop;\n const verticalCenter = Ray.getPoint(ray, t, tilt3DVerticalCenter);\n\n const transform = Transforms.eastNorthUpToFixedFrame(\n center,\n ellipsoid,\n tilt3DTransform\n );\n const verticalTransform = Transforms.eastNorthUpToFixedFrame(\n verticalCenter,\n newEllipsoid,\n tilt3DVerticalTransform\n );\n\n const oldGlobe = controller._globe;\n const oldEllipsoid = controller._ellipsoid;\n controller._globe = undefined;\n controller._ellipsoid = Ellipsoid.UNIT_SPHERE;\n controller._rotateFactor = 1.0;\n controller._rotateRateRangeAdjustment = 1.0;\n\n let constrainedAxis = Cartesian3.UNIT_Z;\n\n const oldTransform = Matrix4.clone(camera.transform, tilt3DOldTransform);\n camera._setTransform(verticalTransform);\n\n const tangent = Cartesian3.cross(\n verticalCenter,\n camera.positionWC,\n tilt3DCartesian3\n );\n const dot = Cartesian3.dot(camera.rightWC, tangent);\n\n if (dot < 0.0) {\n const movementDelta = movement.startPosition.y - movement.endPosition.y;\n if (\n (cameraUnderground && movementDelta < 0.0) ||\n (!cameraUnderground && movementDelta > 0.0)\n ) {\n // Prevent camera from flipping past the up axis\n constrainedAxis = undefined;\n }\n\n const oldConstrainedAxis = camera.constrainedAxis;\n camera.constrainedAxis = undefined;\n\n rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n\n camera.constrainedAxis = oldConstrainedAxis;\n } else {\n rotate3D(controller, startPosition, movement, constrainedAxis, true, false);\n }\n\n camera._setTransform(transform);\n rotate3D(controller, startPosition, movement, constrainedAxis, false, true);\n\n if (defined(camera.constrainedAxis)) {\n const right = Cartesian3.cross(\n camera.direction,\n camera.constrainedAxis,\n tilt3DCartesian3\n );\n if (\n !Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)\n ) {\n if (Cartesian3.dot(right, camera.right) < 0.0) {\n Cartesian3.negate(right, right);\n }\n\n Cartesian3.cross(right, camera.direction, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n\n Cartesian3.normalize(camera.up, camera.up);\n Cartesian3.normalize(camera.right, camera.right);\n }\n }\n\n camera._setTransform(oldTransform);\n controller._globe = oldGlobe;\n controller._ellipsoid = oldEllipsoid;\n\n const radius = oldEllipsoid.maximumRadius;\n controller._rotateFactor = 1.0 / radius;\n controller._rotateRateRangeAdjustment = radius;\n\n const originalPosition = Cartesian3.clone(\n camera.positionWC,\n tilt3DCartesian3\n );\n\n if (controller.enableCollisionDetection) {\n adjustHeightForTerrain(controller);\n }\n\n if (!Cartesian3.equals(camera.positionWC, originalPosition)) {\n camera._setTransform(verticalTransform);\n camera.worldToCameraCoordinatesPoint(originalPosition, originalPosition);\n\n const magSqrd = Cartesian3.magnitudeSquared(originalPosition);\n if (Cartesian3.magnitudeSquared(camera.position) > magSqrd) {\n Cartesian3.normalize(camera.position, camera.position);\n Cartesian3.multiplyByScalar(\n camera.position,\n Math.sqrt(magSqrd),\n camera.position\n );\n }\n\n const angle = Cartesian3.angleBetween(originalPosition, camera.position);\n const axis = Cartesian3.cross(\n originalPosition,\n camera.position,\n originalPosition\n );\n Cartesian3.normalize(axis, axis);\n\n const quaternion = Quaternion.fromAxisAngle(axis, angle, tilt3DQuaternion);\n const rotation = Matrix3.fromQuaternion(quaternion, tilt3DMatrix);\n Matrix3.multiplyByVector(rotation, camera.direction, camera.direction);\n Matrix3.multiplyByVector(rotation, camera.up, camera.up);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.cross(camera.right, camera.direction, camera.up);\n\n camera._setTransform(oldTransform);\n }\n}\n\nconst look3DStartPos = new Cartesian2();\nconst look3DEndPos = new Cartesian2();\nconst look3DStartRay = new Ray();\nconst look3DEndRay = new Ray();\nconst look3DNegativeRot = new Cartesian3();\nconst look3DTan = new Cartesian3();\n\nfunction look3D(controller, startPosition, movement, rotationAxis) {\n const scene = controller._scene;\n const camera = scene.camera;\n\n const startPos = look3DStartPos;\n startPos.x = movement.startPosition.x;\n startPos.y = 0.0;\n const endPos = look3DEndPos;\n endPos.x = movement.endPosition.x;\n endPos.y = 0.0;\n\n let startRay = camera.getPickRay(startPos, look3DStartRay);\n let endRay = camera.getPickRay(endPos, look3DEndRay);\n let angle = 0.0;\n let start;\n let end;\n\n if (camera.frustum instanceof OrthographicFrustum) {\n start = startRay.origin;\n end = endRay.origin;\n\n Cartesian3.add(camera.direction, start, start);\n Cartesian3.add(camera.direction, end, end);\n\n Cartesian3.subtract(start, camera.position, start);\n Cartesian3.subtract(end, camera.position, end);\n\n Cartesian3.normalize(start, start);\n Cartesian3.normalize(end, end);\n } else {\n start = startRay.direction;\n end = endRay.direction;\n }\n\n let dot = Cartesian3.dot(start, end);\n if (dot < 1.0) {\n // dot is in [0, 1]\n angle = Math.acos(dot);\n }\n\n angle = movement.startPosition.x > movement.endPosition.x ? -angle : angle;\n\n const horizontalRotationAxis = controller._horizontalRotationAxis;\n if (defined(rotationAxis)) {\n camera.look(rotationAxis, -angle);\n } else if (defined(horizontalRotationAxis)) {\n camera.look(horizontalRotationAxis, -angle);\n } else {\n camera.lookLeft(angle);\n }\n\n startPos.x = 0.0;\n startPos.y = movement.startPosition.y;\n endPos.x = 0.0;\n endPos.y = movement.endPosition.y;\n\n startRay = camera.getPickRay(startPos, look3DStartRay);\n endRay = camera.getPickRay(endPos, look3DEndRay);\n angle = 0.0;\n\n if (camera.frustum instanceof OrthographicFrustum) {\n start = startRay.origin;\n end = endRay.origin;\n\n Cartesian3.add(camera.direction, start, start);\n Cartesian3.add(camera.direction, end, end);\n\n Cartesian3.subtract(start, camera.position, start);\n Cartesian3.subtract(end, camera.position, end);\n\n Cartesian3.normalize(start, start);\n Cartesian3.normalize(end, end);\n } else {\n start = startRay.direction;\n end = endRay.direction;\n }\n\n dot = Cartesian3.dot(start, end);\n if (dot < 1.0) {\n // dot is in [0, 1]\n angle = Math.acos(dot);\n }\n angle = movement.startPosition.y > movement.endPosition.y ? -angle : angle;\n\n rotationAxis = defaultValue(rotationAxis, horizontalRotationAxis);\n if (defined(rotationAxis)) {\n const direction = camera.direction;\n const negativeRotationAxis = Cartesian3.negate(\n rotationAxis,\n look3DNegativeRot\n );\n const northParallel = Cartesian3.equalsEpsilon(\n direction,\n rotationAxis,\n CesiumMath.EPSILON2\n );\n const southParallel = Cartesian3.equalsEpsilon(\n direction,\n negativeRotationAxis,\n CesiumMath.EPSILON2\n );\n if (!northParallel && !southParallel) {\n dot = Cartesian3.dot(direction, rotationAxis);\n let angleToAxis = CesiumMath.acosClamped(dot);\n if (angle > 0 && angle > angleToAxis) {\n angle = angleToAxis - CesiumMath.EPSILON4;\n }\n\n dot = Cartesian3.dot(direction, negativeRotationAxis);\n angleToAxis = CesiumMath.acosClamped(dot);\n if (angle < 0 && -angle > angleToAxis) {\n angle = -angleToAxis + CesiumMath.EPSILON4;\n }\n\n const tangent = Cartesian3.cross(rotationAxis, direction, look3DTan);\n camera.look(tangent, angle);\n } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {\n camera.look(camera.right, -angle);\n }\n } else {\n camera.lookUp(angle);\n }\n}\n\nfunction update3D(controller) {\n reactToInput(\n controller,\n controller.enableRotate,\n controller.rotateEventTypes,\n spin3D,\n controller.inertiaSpin,\n \"_lastInertiaSpinMovement\"\n );\n reactToInput(\n controller,\n controller.enableZoom,\n controller.zoomEventTypes,\n zoom3D,\n controller.inertiaZoom,\n \"_lastInertiaZoomMovement\"\n );\n reactToInput(\n controller,\n controller.enableTilt,\n controller.tiltEventTypes,\n tilt3D,\n controller.inertiaSpin,\n \"_lastInertiaTiltMovement\"\n );\n reactToInput(\n controller,\n controller.enableLook,\n controller.lookEventTypes,\n look3D\n );\n}\n\nconst scratchAdjustHeightTransform = new Matrix4();\nconst scratchAdjustHeightCartographic = new Cartographic();\n\nfunction adjustHeightForTerrain(controller) {\n controller._adjustedHeightForTerrain = true;\n\n const scene = controller._scene;\n const mode = scene.mode;\n const globe = scene.globe;\n\n if (\n !defined(globe) ||\n mode === SceneMode.SCENE2D ||\n mode === SceneMode.MORPHING\n ) {\n return;\n }\n\n const camera = scene.camera;\n const ellipsoid = globe.ellipsoid;\n const projection = scene.mapProjection;\n\n let transform;\n let mag;\n if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n transform = Matrix4.clone(camera.transform, scratchAdjustHeightTransform);\n mag = Cartesian3.magnitude(camera.position);\n camera._setTransform(Matrix4.IDENTITY);\n }\n\n const cartographic = scratchAdjustHeightCartographic;\n if (mode === SceneMode.SCENE3D) {\n ellipsoid.cartesianToCartographic(camera.position, cartographic);\n } else {\n projection.unproject(camera.position, cartographic);\n }\n\n let heightUpdated = false;\n if (cartographic.height < controller._minimumCollisionTerrainHeight) {\n const globeHeight = controller._scene.globeHeight;\n if (defined(globeHeight)) {\n const height = globeHeight + controller.minimumZoomDistance;\n if (cartographic.height < height) {\n cartographic.height = height;\n if (mode === SceneMode.SCENE3D) {\n ellipsoid.cartographicToCartesian(cartographic, camera.position);\n } else {\n projection.project(cartographic, camera.position);\n }\n heightUpdated = true;\n }\n }\n }\n\n if (defined(transform)) {\n camera._setTransform(transform);\n if (heightUpdated) {\n Cartesian3.normalize(camera.position, camera.position);\n Cartesian3.negate(camera.position, camera.direction);\n Cartesian3.multiplyByScalar(\n camera.position,\n Math.max(mag, controller.minimumZoomDistance),\n camera.position\n );\n Cartesian3.normalize(camera.direction, camera.direction);\n Cartesian3.cross(camera.direction, camera.up, camera.right);\n Cartesian3.cross(camera.right, camera.direction, camera.up);\n }\n }\n}\n\n/**\n * @private\n */\nScreenSpaceCameraController.prototype.onMap = function () {\n const scene = this._scene;\n const mode = scene.mode;\n const camera = scene.camera;\n\n if (mode === SceneMode.COLUMBUS_VIEW) {\n return (\n Math.abs(camera.position.x) - this._maxCoord.x < 0 &&\n Math.abs(camera.position.y) - this._maxCoord.y < 0\n );\n }\n\n return true;\n};\n\nconst scratchPreviousPosition = new Cartesian3();\nconst scratchPreviousDirection = new Cartesian3();\n\n/**\n * @private\n */\nScreenSpaceCameraController.prototype.update = function () {\n const scene = this._scene;\n const camera = scene.camera;\n const globe = scene.globe;\n const mode = scene.mode;\n\n if (!Matrix4.equals(camera.transform, Matrix4.IDENTITY)) {\n this._globe = undefined;\n this._ellipsoid = Ellipsoid.UNIT_SPHERE;\n } else {\n this._globe = globe;\n this._ellipsoid = defined(this._globe)\n ? this._globe.ellipsoid\n : scene.mapProjection.ellipsoid;\n }\n\n const exaggeration = defined(this._globe)\n ? this._globe.terrainExaggeration\n : 1.0;\n const exaggerationRelativeHeight = defined(this._globe)\n ? this._globe.terrainExaggerationRelativeHeight\n : 0.0;\n this._minimumCollisionTerrainHeight = TerrainExaggeration.getHeight(\n this.minimumCollisionTerrainHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n this._minimumPickingTerrainHeight = TerrainExaggeration.getHeight(\n this.minimumPickingTerrainHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n this._minimumTrackBallHeight = TerrainExaggeration.getHeight(\n this.minimumTrackBallHeight,\n exaggeration,\n exaggerationRelativeHeight\n );\n\n this._cameraUnderground = scene.cameraUnderground && defined(this._globe);\n\n const radius = this._ellipsoid.maximumRadius;\n this._rotateFactor = 1.0 / radius;\n this._rotateRateRangeAdjustment = radius;\n\n this._adjustedHeightForTerrain = false;\n const previousPosition = Cartesian3.clone(\n camera.positionWC,\n scratchPreviousPosition\n );\n const previousDirection = Cartesian3.clone(\n camera.directionWC,\n scratchPreviousDirection\n );\n\n if (mode === SceneMode.SCENE2D) {\n update2D(this);\n } else if (mode === SceneMode.COLUMBUS_VIEW) {\n this._horizontalRotationAxis = Cartesian3.UNIT_Z;\n updateCV(this);\n } else if (mode === SceneMode.SCENE3D) {\n this._horizontalRotationAxis = undefined;\n update3D(this);\n }\n\n if (this.enableCollisionDetection && !this._adjustedHeightForTerrain) {\n // Adjust the camera height if the camera moved at all (user input or inertia) and an action didn't already adjust the camera height\n const cameraChanged =\n !Cartesian3.equals(previousPosition, camera.positionWC) ||\n !Cartesian3.equals(previousDirection, camera.directionWC);\n if (cameraChanged) {\n adjustHeightForTerrain(this);\n }\n }\n\n this._aggregator.reset();\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see ScreenSpaceCameraController#destroy\n */\nScreenSpaceCameraController.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Removes mouse listeners held by this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * controller = controller && controller.destroy();\n *\n * @see ScreenSpaceCameraController#isDestroyed\n */\nScreenSpaceCameraController.prototype.destroy = function () {\n this._tweens.removeAll();\n this._aggregator = this._aggregator && this._aggregator.destroy();\n return destroyObject(this);\n};\nexport default ScreenSpaceCameraController;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform sampler2D colorTexture2;\\n\\\nuniform vec2 center;\\n\\\nuniform float radius;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\\n\\\nfloat x = length(gl_FragCoord.xy - center) / radius;\\n\\\nfloat t = smoothstep(0.5, 0.8, x);\\n\\\ngl_FragColor = mix(color0 + color1, color1, t);\\n\\\n}\\n\\\n\";\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D colorTexture;\\n\\\nuniform float avgLuminance;\\n\\\nuniform float threshold;\\n\\\nuniform float offset;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nfloat key(float avg)\\n\\\n{\\n\\\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\\n\\\nreturn max(0.0, guess) + 0.1;\\n\\\n}\\n\\\nvoid main()\\n\\\n{\\n\\\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\\n\\\nvec3 xyz = czm_RGBToXYZ(color.rgb);\\n\\\nfloat luminance = xyz.r;\\n\\\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\\n\\\nfloat brightLum = max(scaledLum - threshold, 0.0);\\n\\\nfloat brightness = brightLum / (offset + brightLum);\\n\\\nxyz.r = brightness;\\n\\\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\\n\\\n}\\n\\\n\";\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport AdditiveBlend from \"../Shaders/PostProcessStages/AdditiveBlend.js\";\nimport BrightPass from \"../Shaders/PostProcessStages/BrightPass.js\";\nimport GaussianBlur1D from \"../Shaders/PostProcessStages/GaussianBlur1D.js\";\nimport PassThrough from \"../Shaders/PostProcessStages/PassThrough.js\";\nimport PostProcessStage from \"./PostProcessStage.js\";\nimport PostProcessStageComposite from \"./PostProcessStageComposite.js\";\nimport PostProcessStageSampleMode from \"./PostProcessStageSampleMode.js\";\nimport PostProcessStageTextureCache from \"./PostProcessStageTextureCache.js\";\nimport SceneFramebuffer from \"./SceneFramebuffer.js\";\n\nfunction SunPostProcess() {\n this._sceneFramebuffer = new SceneFramebuffer();\n\n const scale = 0.125;\n const stages = new Array(6);\n\n stages[0] = new PostProcessStage({\n fragmentShader: PassThrough,\n textureScale: scale,\n forcePowerOfTwo: true,\n sampleMode: PostProcessStageSampleMode.LINEAR,\n });\n\n const brightPass = (stages[1] = new PostProcessStage({\n fragmentShader: BrightPass,\n uniforms: {\n avgLuminance: 0.5, // A guess at the average luminance across the entire scene\n threshold: 0.25,\n offset: 0.1,\n },\n textureScale: scale,\n forcePowerOfTwo: true,\n }));\n\n const that = this;\n this._delta = 1.0;\n this._sigma = 2.0;\n this._blurStep = new Cartesian2();\n\n stages[2] = new PostProcessStage({\n fragmentShader: GaussianBlur1D,\n uniforms: {\n step: function () {\n that._blurStep.x = that._blurStep.y =\n 1.0 / brightPass.outputTexture.width;\n return that._blurStep;\n },\n delta: function () {\n return that._delta;\n },\n sigma: function () {\n return that._sigma;\n },\n direction: 0.0,\n },\n textureScale: scale,\n forcePowerOfTwo: true,\n });\n\n stages[3] = new PostProcessStage({\n fragmentShader: GaussianBlur1D,\n uniforms: {\n step: function () {\n that._blurStep.x = that._blurStep.y =\n 1.0 / brightPass.outputTexture.width;\n return that._blurStep;\n },\n delta: function () {\n return that._delta;\n },\n sigma: function () {\n return that._sigma;\n },\n direction: 1.0,\n },\n textureScale: scale,\n forcePowerOfTwo: true,\n });\n\n stages[4] = new PostProcessStage({\n fragmentShader: PassThrough,\n sampleMode: PostProcessStageSampleMode.LINEAR,\n });\n\n this._uCenter = new Cartesian2();\n this._uRadius = undefined;\n\n stages[5] = new PostProcessStage({\n fragmentShader: AdditiveBlend,\n uniforms: {\n center: function () {\n return that._uCenter;\n },\n radius: function () {\n return that._uRadius;\n },\n colorTexture2: function () {\n return that._sceneFramebuffer.framebuffer.getColorTexture(0);\n },\n },\n });\n\n this._stages = new PostProcessStageComposite({\n stages: stages,\n });\n\n const textureCache = new PostProcessStageTextureCache(this);\n const length = stages.length;\n for (let i = 0; i < length; ++i) {\n stages[i]._textureCache = textureCache;\n }\n\n this._textureCache = textureCache;\n this.length = stages.length;\n}\n\nSunPostProcess.prototype.get = function (index) {\n return this._stages.get(index);\n};\n\nSunPostProcess.prototype.getStageByName = function (name) {\n const length = this._stages.length;\n for (let i = 0; i < length; ++i) {\n const stage = this._stages.get(i);\n if (stage.name === name) {\n return stage;\n }\n }\n return undefined;\n};\n\nconst sunPositionECScratch = new Cartesian4();\nconst sunPositionWCScratch = new Cartesian2();\nconst sizeScratch = new Cartesian2();\nconst postProcessMatrix4Scratch = new Matrix4();\n\nfunction updateSunPosition(postProcess, context, viewport) {\n const us = context.uniformState;\n const sunPosition = us.sunPositionWC;\n const viewMatrix = us.view;\n const viewProjectionMatrix = us.viewProjection;\n const projectionMatrix = us.projection;\n\n // create up sampled render state\n let viewportTransformation = Matrix4.computeViewportTransformation(\n viewport,\n 0.0,\n 1.0,\n postProcessMatrix4Scratch\n );\n const sunPositionEC = Matrix4.multiplyByPoint(\n viewMatrix,\n sunPosition,\n sunPositionECScratch\n );\n let sunPositionWC = Transforms.pointToGLWindowCoordinates(\n viewProjectionMatrix,\n viewportTransformation,\n sunPosition,\n sunPositionWCScratch\n );\n\n sunPositionEC.x += CesiumMath.SOLAR_RADIUS;\n const limbWC = Transforms.pointToGLWindowCoordinates(\n projectionMatrix,\n viewportTransformation,\n sunPositionEC,\n sunPositionEC\n );\n const sunSize =\n Cartesian2.magnitude(Cartesian2.subtract(limbWC, sunPositionWC, limbWC)) *\n 30.0 *\n 2.0;\n\n const size = sizeScratch;\n size.x = sunSize;\n size.y = sunSize;\n\n postProcess._uCenter = Cartesian2.clone(sunPositionWC, postProcess._uCenter);\n postProcess._uRadius = Math.max(size.x, size.y) * 0.15;\n\n const width = context.drawingBufferWidth;\n const height = context.drawingBufferHeight;\n\n const stages = postProcess._stages;\n const firstStage = stages.get(0);\n\n const downSampleWidth = firstStage.outputTexture.width;\n const downSampleHeight = firstStage.outputTexture.height;\n\n const downSampleViewport = new BoundingRectangle();\n downSampleViewport.width = downSampleWidth;\n downSampleViewport.height = downSampleHeight;\n\n // create down sampled render state\n viewportTransformation = Matrix4.computeViewportTransformation(\n downSampleViewport,\n 0.0,\n 1.0,\n postProcessMatrix4Scratch\n );\n sunPositionWC = Transforms.pointToGLWindowCoordinates(\n viewProjectionMatrix,\n viewportTransformation,\n sunPosition,\n sunPositionWCScratch\n );\n\n size.x *= downSampleWidth / width;\n size.y *= downSampleHeight / height;\n\n const scissorRectangle = firstStage.scissorRectangle;\n scissorRectangle.x = Math.max(sunPositionWC.x - size.x * 0.5, 0.0);\n scissorRectangle.y = Math.max(sunPositionWC.y - size.y * 0.5, 0.0);\n scissorRectangle.width = Math.min(size.x, width);\n scissorRectangle.height = Math.min(size.y, height);\n\n for (let i = 1; i < 4; ++i) {\n BoundingRectangle.clone(scissorRectangle, stages.get(i).scissorRectangle);\n }\n}\n\nSunPostProcess.prototype.clear = function (context, passState, clearColor) {\n this._sceneFramebuffer.clear(context, passState, clearColor);\n this._textureCache.clear(context);\n};\n\nSunPostProcess.prototype.update = function (passState) {\n const context = passState.context;\n const viewport = passState.viewport;\n\n const sceneFramebuffer = this._sceneFramebuffer;\n sceneFramebuffer.update(context, viewport);\n const framebuffer = sceneFramebuffer.framebuffer;\n\n this._textureCache.update(context);\n this._stages.update(context, false);\n\n updateSunPosition(this, context, viewport);\n\n return framebuffer;\n};\n\nSunPostProcess.prototype.execute = function (context) {\n const colorTexture = this._sceneFramebuffer.framebuffer.getColorTexture(0);\n const stages = this._stages;\n const length = stages.length;\n stages.get(0).execute(context, colorTexture);\n for (let i = 1; i < length; ++i) {\n stages.get(i).execute(context, stages.get(i - 1).outputTexture);\n }\n};\n\nSunPostProcess.prototype.copy = function (context, framebuffer) {\n if (!defined(this._copyColorCommand)) {\n const that = this;\n this._copyColorCommand = context.createViewportQuadCommand(PassThrough, {\n uniformMap: {\n colorTexture: function () {\n return that._stages.get(that._stages.length - 1).outputTexture;\n },\n },\n owner: this,\n });\n }\n\n this._copyColorCommand.framebuffer = framebuffer;\n this._copyColorCommand.execute(context);\n};\n\nSunPostProcess.prototype.isDestroyed = function () {\n return false;\n};\n\nSunPostProcess.prototype.destroy = function () {\n this._textureCache.destroy();\n this._stages.destroy();\n return destroyObject(this);\n};\nexport default SunPostProcess;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\nimport BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartographic from \"../Core/Cartographic.js\";\nimport clone from \"../Core/clone.js\";\nimport Color from \"../Core/Color.js\";\nimport ColorGeometryInstanceAttribute from \"../Core/ColorGeometryInstanceAttribute.js\";\nimport createGuid from \"../Core/createGuid.js\";\nimport CullingVolume from \"../Core/CullingVolume.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\nimport GeometryInstance from \"../Core/GeometryInstance.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Intersect from \"../Core/Intersect.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport mergeSort from \"../Core/mergeSort.js\";\nimport Occluder from \"../Core/Occluder.js\";\nimport OrthographicFrustum from \"../Core/OrthographicFrustum.js\";\nimport OrthographicOffCenterFrustum from \"../Core/OrthographicOffCenterFrustum.js\";\nimport PerspectiveFrustum from \"../Core/PerspectiveFrustum.js\";\nimport PerspectiveOffCenterFrustum from \"../Core/PerspectiveOffCenterFrustum.js\";\nimport RequestScheduler from \"../Core/RequestScheduler.js\";\nimport TaskProcessor from \"../Core/TaskProcessor.js\";\nimport Transforms from \"../Core/Transforms.js\";\nimport ClearCommand from \"../Renderer/ClearCommand.js\";\nimport ComputeEngine from \"../Renderer/ComputeEngine.js\";\nimport Context from \"../Renderer/Context.js\";\nimport ContextLimits from \"../Renderer/ContextLimits.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport BrdfLutGenerator from \"./BrdfLutGenerator.js\";\nimport Camera from \"./Camera.js\";\nimport Cesium3DTilePass from \"./Cesium3DTilePass.js\";\nimport Cesium3DTilePassState from \"./Cesium3DTilePassState.js\";\nimport CreditDisplay from \"./CreditDisplay.js\";\nimport DebugCameraPrimitive from \"./DebugCameraPrimitive.js\";\nimport DepthPlane from \"./DepthPlane.js\";\nimport DerivedCommand from \"./DerivedCommand.js\";\nimport DeviceOrientationCameraController from \"./DeviceOrientationCameraController.js\";\nimport Fog from \"./Fog.js\";\nimport FrameState from \"./FrameState.js\";\nimport GlobeTranslucencyState from \"./GlobeTranslucencyState.js\";\nimport InvertClassification from \"./InvertClassification.js\";\nimport JobScheduler from \"./JobScheduler.js\";\nimport MapMode2D from \"./MapMode2D.js\";\nimport OctahedralProjectedCubeMap from \"./OctahedralProjectedCubeMap.js\";\nimport PerformanceDisplay from \"./PerformanceDisplay.js\";\nimport PerInstanceColorAppearance from \"./PerInstanceColorAppearance.js\";\nimport Picking from \"./Picking.js\";\nimport PostProcessStageCollection from \"./PostProcessStageCollection.js\";\nimport Primitive from \"./Primitive.js\";\nimport PrimitiveCollection from \"./PrimitiveCollection.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\nimport SceneTransitioner from \"./SceneTransitioner.js\";\nimport ScreenSpaceCameraController from \"./ScreenSpaceCameraController.js\";\nimport ShadowMap from \"./ShadowMap.js\";\nimport StencilConstants from \"./StencilConstants.js\";\nimport SunLight from \"./SunLight.js\";\nimport SunPostProcess from \"./SunPostProcess.js\";\nimport TweenCollection from \"./TweenCollection.js\";\nimport View from \"./View.js\";\nimport DebugInspector from \"./DebugInspector.js\";\n\nconst requestRenderAfterFrame = function (scene) {\n return function () {\n scene.frameState.afterRender.push(function () {\n scene.requestRender();\n });\n };\n};\n\n/**\n * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,\n * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.\n * <p>\n * <em><code>contextOptions</code> parameter details:</em>\n * </p>\n * <p>\n * The default values are:\n * <code>\n * {\n * webgl : {\n * alpha : false,\n * depth : true,\n * stencil : false,\n * antialias : true,\n * powerPreference: 'high-performance',\n * premultipliedAlpha : true,\n * preserveDrawingBuffer : false,\n * failIfMajorPerformanceCaveat : false\n * },\n * allowTextureFilterAnisotropic : true\n * }\n * </code>\n * </p>\n * <p>\n * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}\n * object used to create the WebGL context.\n * </p>\n * <p>\n * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default\n * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set\n * <code>webgl.alpha</code> to true.\n * </p>\n * <p>\n * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.\n * </p>\n * <p>\n * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the\n * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.\n * </p>\n *\n * @alias Scene\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for.\n * @param {Object} [options.contextOptions] Context and WebGL creation properties. See details above.\n * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed.\n * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas.\n * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @param {Boolean} [options.scene3DOnly=false] If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.\n * @param {Boolean} [options.shadows=false] Determines if shadows are cast by light sources.\n * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {Number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.\n * @param {Number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n *\n * @see CesiumWidget\n * @see {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}\n *\n * @exception {DeveloperError} options and options.canvas are required.\n *\n * @example\n * // Create scene without anisotropic texture filtering\n * const scene = new Cesium.Scene({\n * canvas : canvas,\n * contextOptions : {\n * allowTextureFilterAnisotropic : false\n * }\n * });\n */\nfunction Scene(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n const canvas = options.canvas;\n let creditContainer = options.creditContainer;\n let creditViewport = options.creditViewport;\n\n let contextOptions = clone(options.contextOptions);\n if (!defined(contextOptions)) {\n contextOptions = {};\n }\n if (!defined(contextOptions.webgl)) {\n contextOptions.webgl = {};\n }\n contextOptions.webgl.powerPreference = defaultValue(\n contextOptions.webgl.powerPreference,\n \"high-performance\"\n );\n\nconst hasCreditContainer = defined(creditContainer);\n const context = new Context(canvas, contextOptions);\n if (!hasCreditContainer) {\n creditContainer = document.createElement(\"div\");\n creditContainer.style.position = \"absolute\";\n creditContainer.style.bottom = \"0\";\n creditContainer.style[\"text-shadow\"] = \"0 0 2px #000000\";\n creditContainer.style.color = \"#ffffff\";\n creditContainer.style[\"font-size\"] = \"10px\";\n creditContainer.style[\"padding-right\"] = \"5px\";\n canvas.parentNode.appendChild(creditContainer);\n }\n if (!defined(creditViewport)) {\n creditViewport = canvas.parentNode;\n }\n\n this._id = createGuid();\n this._jobScheduler = new JobScheduler();\n this._frameState = new FrameState(\n context,\n new CreditDisplay(creditContainer, \" \u2022 \", creditViewport),\n this._jobScheduler\n );\n this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false);\n this._removeCreditContainer = !hasCreditContainer;\n this._creditContainer = creditContainer;\n\n this._canvas = canvas;\n this._context = context;\n this._computeEngine = new ComputeEngine(context);\n this._globe = undefined;\n this._globeTranslucencyState = new GlobeTranslucencyState();\n this._primitives = new PrimitiveCollection();\n this._groundPrimitives = new PrimitiveCollection();\n\n this._globeHeight = undefined;\n this._cameraUnderground = false;\n\n this._logDepthBuffer = context.fragmentDepth;\n this._logDepthBufferDirty = true;\n\n this._tweens = new TweenCollection();\n\n this._shaderFrameCount = 0;\n\n this._sunPostProcess = undefined;\n\n this._computeCommandList = [];\n this._overlayCommandList = [];\n\n this._useOIT = defaultValue(options.orderIndependentTranslucency, true);\n this._executeOITFunction = undefined;\n\n this._depthPlane = new DepthPlane(options.depthPlaneEllipsoidOffset);\n\n this._clearColorCommand = new ClearCommand({\n color: new Color(),\n stencil: 0,\n owner: this,\n });\n this._depthClearCommand = new ClearCommand({\n depth: 1.0,\n owner: this,\n });\n this._stencilClearCommand = new ClearCommand({\n stencil: 0,\n });\n this._classificationStencilClearCommand = new ClearCommand({\n stencil: 0,\n renderState: RenderState.fromCache({\n stencilMask: StencilConstants.CLASSIFICATION_MASK,\n }),\n });\n\n this._depthOnlyRenderStateCache = {};\n\n this._transitioner = new SceneTransitioner(this);\n\n this._preUpdate = new Event();\n this._postUpdate = new Event();\n\n this._renderError = new Event();\n this._preRender = new Event();\n this._postRender = new Event();\n\n this._minimumDisableDepthTestDistance = 0.0;\n this._debugInspector = new DebugInspector();\n\n this._msaaSamples = defaultValue(options.msaaSamples, 1);\n\n /**\n * Exceptions occurring in <code>render</code> are always caught in order to raise the\n * <code>renderError</code> event. If this property is true, the error is rethrown\n * after the event is raised. If this property is false, the <code>render</code> function\n * returns normally after raising the event.\n *\n * @type {Boolean}\n * @default false\n */\n this.rethrowRenderErrors = false;\n\n /**\n * Determines whether or not to instantly complete the\n * scene transition animation on user input.\n *\n * @type {Boolean}\n * @default true\n */\n this.completeMorphOnUserInput = true;\n\n /**\n * The event fired at the beginning of a scene transition.\n * @type {Event}\n * @default Event()\n */\n this.morphStart = new Event();\n\n /**\n * The event fired at the completion of a scene transition.\n * @type {Event}\n * @default Event()\n */\n this.morphComplete = new Event();\n\n /**\n * The {@link SkyBox} used to draw the stars.\n *\n * @type {SkyBox}\n * @default undefined\n *\n * @see Scene#backgroundColor\n */\n this.skyBox = undefined;\n\n /**\n * The sky atmosphere drawn around the globe.\n *\n * @type {SkyAtmosphere}\n * @default undefined\n */\n this.skyAtmosphere = undefined;\n\n /**\n * The {@link Sun}.\n *\n * @type {Sun}\n * @default undefined\n */\n this.sun = undefined;\n\n /**\n * Uses a bloom filter on the sun when enabled.\n *\n * @type {Boolean}\n * @default true\n */\n this.sunBloom = true;\n this._sunBloom = undefined;\n\n /**\n * The {@link Moon}\n *\n * @type Moon\n * @default undefined\n */\n this.moon = undefined;\n\n /**\n * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.\n *\n * @type {Color}\n * @default {@link Color.BLACK}\n *\n * @see Scene#skyBox\n */\n this.backgroundColor = Color.clone(Color.BLACK);\n\n this._mode = SceneMode.SCENE3D;\n\n this._mapProjection = defined(options.mapProjection)\n ? options.mapProjection\n : new GeographicProjection();\n\n /**\n * The current morph transition time between 2D/Columbus View and 3D,\n * with 0.0 being 2D or Columbus View and 1.0 being 3D.\n *\n * @type {Number}\n * @default 1.0\n */\n this.morphTime = 1.0;\n\n /**\n * The far-to-near ratio of the multi-frustum when using a normal depth buffer.\n * <p>\n * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used\n * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is\n * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.\n * </p>\n *\n * @type {Number}\n * @default 1000.0\n */\n this.farToNearRatio = 1000.0;\n\n /**\n * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.\n * <p>\n * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used\n * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is\n * <code>false</code>, use {@link Scene#farToNearRatio}.\n * </p>\n *\n * @type {Number}\n * @default 1e9\n */\n this.logarithmicDepthFarToNearRatio = 1e9;\n\n /**\n * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close\n * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the\n * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.\n *\n * @type {Number}\n * @default 1.75e6\n */\n this.nearToFarDistance2D = 1.75e6;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * A function that determines what commands are executed. As shown in the examples below,\n * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the\n * command should be executed.\n * </p>\n * <p>\n * The default is <code>undefined</code>, indicating that all commands are executed.\n * </p>\n *\n * @type Function\n *\n * @default undefined\n *\n * @example\n * // Do not execute any commands.\n * scene.debugCommandFilter = function(command) {\n * return false;\n * };\n *\n * // Execute only the billboard's commands. That is, only draw the billboard.\n * const billboards = new Cesium.BillboardCollection();\n * scene.debugCommandFilter = function(command) {\n * return command.owner === billboards;\n * };\n */\n this.debugCommandFilter = undefined;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * When <code>true</code>, commands are randomly shaded. This is useful\n * for performance analysis to see what parts of a scene or model are\n * command-dense and could benefit from batching.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.debugShowCommands = false;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * When <code>true</code>, commands are shaded based on the frustums they\n * overlap. Commands in the closest frustum are tinted red, commands in\n * the next closest are green, and commands in the farthest frustum are\n * blue. If a command overlaps more than one frustum, the color components\n * are combined, e.g., a command overlapping the first two frustums is tinted\n * yellow.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.debugShowFrustums = false;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * Displays frames per second and time between frames.\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.debugShowFramesPerSecond = false;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * Indicates which frustum will have depth information displayed.\n * </p>\n *\n * @type Number\n *\n * @default 1\n */\n this.debugShowDepthFrustum = 1;\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * When <code>true</code>, draws outlines to show the boundaries of the camera frustums\n * </p>\n *\n * @type Boolean\n *\n * @default false\n */\n this.debugShowFrustumPlanes = false;\n this._debugShowFrustumPlanes = false;\n this._debugFrustumPlanes = undefined;\n\n /**\n * When <code>true</code>, enables picking using the depth buffer.\n *\n * @type Boolean\n * @default true\n */\n this.useDepthPicking = true;\n\n /**\n * When <code>true</code>, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work.\n *\n * <p>\n * There is a decrease in performance when enabled. There are extra draw calls to write depth for\n * translucent geometry.\n * </p>\n *\n * @example\n * // picking the position of a translucent primitive\n * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {\n * const pickedFeature = viewer.scene.pick(movement.position);\n * if (!Cesium.defined(pickedFeature)) {\n * // nothing picked\n * return;\n * }\n * const worldPosition = viewer.scene.pickPosition(movement.position);\n * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);\n *\n * @type {Boolean}\n * @default false\n */\n this.pickTranslucentDepth = false;\n\n /**\n * The time in milliseconds to wait before checking if the camera has not moved and fire the cameraMoveEnd event.\n * @type {Number}\n * @default 500.0\n * @private\n */\n this.cameraEventWaitTime = 500.0;\n\n /**\n * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional\n * performance improvements by rendering less geometry and dispatching less terrain requests.\n * @type {Fog}\n */\n this.fog = new Fog();\n\n this._shadowMapCamera = new Camera(this);\n\n /**\n * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.\n * @type {ShadowMap}\n */\n this.shadowMap = new ShadowMap({\n context: context,\n lightCamera: this._shadowMapCamera,\n enabled: defaultValue(options.shadows, false),\n });\n\n /**\n * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and\n * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.\n * @type {Boolean}\n * @default false\n */\n this.invertClassification = false;\n\n /**\n * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.\n * <p>When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.</p>\n * <p>Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.</p>\n * @type {Color}\n * @default Color.WHITE\n */\n this.invertClassificationColor = Color.clone(Color.WHITE);\n\n this._actualInvertClassificationColor = Color.clone(\n this._invertClassificationColor\n );\n this._invertClassification = new InvertClassification();\n\n /**\n * The focal length for use when with cardboard or WebVR.\n * @type {Number}\n */\n this.focalLength = undefined;\n\n /**\n * The eye separation distance in meters for use with cardboard or WebVR.\n * @type {Number}\n */\n this.eyeSeparation = undefined;\n\n /**\n * Post processing effects applied to the final render.\n * @type {PostProcessStageCollection}\n */\n this.postProcessStages = new PostProcessStageCollection();\n\n this._brdfLutGenerator = new BrdfLutGenerator();\n\n this._performanceDisplay = undefined;\n this._debugVolume = undefined;\n\n this._screenSpaceCameraController = new ScreenSpaceCameraController(this);\n this._cameraUnderground = false;\n this._mapMode2D = defaultValue(options.mapMode2D, MapMode2D.INFINITE_SCROLL);\n\n // Keeps track of the state of a frame. FrameState is the state across\n // the primitives of the scene. This state is for internally keeping track\n // of celestial and environment effects that need to be updated/rendered in\n // a certain order as well as updating/tracking framebuffer usage.\n this._environmentState = {\n skyBoxCommand: undefined,\n skyAtmosphereCommand: undefined,\n sunDrawCommand: undefined,\n sunComputeCommand: undefined,\n moonCommand: undefined,\n\n isSunVisible: false,\n isMoonVisible: false,\n isReadyForAtmosphere: false,\n isSkyAtmosphereVisible: false,\n\n clearGlobeDepth: false,\n useDepthPlane: false,\n renderTranslucentDepthForPick: false,\n\n originalFramebuffer: undefined,\n useGlobeDepthFramebuffer: false,\n useOIT: false,\n useInvertClassification: false,\n usePostProcess: false,\n usePostProcessSelected: false,\n useWebVR: false,\n };\n\n this._useWebVR = false;\n this._cameraVR = undefined;\n this._aspectRatioVR = undefined;\n\n /**\n * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.\n * Enabling improves performance of the application, but requires using {@link Scene#requestRender}\n * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes\n * to the scene in other parts of the API.\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#maximumRenderTimeChange\n * @see Scene#requestRender\n *\n * @type {Boolean}\n * @default false\n */\n this.requestRenderMode = defaultValue(options.requestRenderMode, false);\n this._renderRequested = true;\n\n /**\n * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in\n * simulation time allowed before a render is requested. Lower values increase the number of frames rendered\n * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to\n * the simulation time will never request a render.\n * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,\n * and animations.\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#requestRenderMode\n *\n * @type {Number}\n * @default 0.0\n */\n this.maximumRenderTimeChange = defaultValue(\n options.maximumRenderTimeChange,\n 0.0\n );\n this._lastRenderTime = undefined;\n this._frameRateMonitor = undefined;\n\n this._removeRequestListenerCallback = RequestScheduler.requestCompletedEvent.addEventListener(\n requestRenderAfterFrame(this)\n );\n this._removeTaskProcessorListenerCallback = TaskProcessor.taskCompletedEvent.addEventListener(\n requestRenderAfterFrame(this)\n );\n this._removeGlobeCallbacks = [];\n\n const viewport = new BoundingRectangle(\n 0,\n 0,\n context.drawingBufferWidth,\n context.drawingBufferHeight\n );\n const camera = new Camera(this);\n\n if (this._logDepthBuffer) {\n camera.frustum.near = 0.1;\n camera.frustum.far = 10000000000.0;\n }\n\n /**\n * The camera view for the scene camera flight destination. Used for preloading flight destination tiles.\n * @type {Camera}\n * @private\n */\n this.preloadFlightCamera = new Camera(this);\n\n /**\n * The culling volume for the scene camera flight destination. Used for preloading flight destination tiles.\n * @type {CullingVolume}\n * @private\n */\n this.preloadFlightCullingVolume = undefined;\n\n this._picking = new Picking(this);\n this._defaultView = new View(this, camera, viewport);\n this._view = this._defaultView;\n\n this._hdr = undefined;\n this._hdrDirty = undefined;\n this.highDynamicRange = false;\n this.gamma = 2.2;\n\n /**\n * The spherical harmonic coefficients for image-based lighting of PBR models.\n * @type {Cartesian3[]}\n */\n this.sphericalHarmonicCoefficients = undefined;\n\n /**\n * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.\n * @type {String}\n */\n this.specularEnvironmentMaps = undefined;\n this._specularEnvironmentMapAtlas = undefined;\n\n /**\n * The light source for shading. Defaults to a directional light from the Sun.\n * @type {Light}\n */\n this.light = new SunLight();\n\n // Give frameState, camera, and screen space camera controller initial state before rendering\n updateFrameNumber(this, 0.0, JulianDate.now());\n this.updateFrameState();\n this.initializeFrame();\n}\n\nfunction updateGlobeListeners(scene, globe) {\n for (let i = 0; i < scene._removeGlobeCallbacks.length; ++i) {\n scene._removeGlobeCallbacks[i]();\n }\n scene._removeGlobeCallbacks.length = 0;\n\n const removeGlobeCallbacks = [];\n if (defined(globe)) {\n removeGlobeCallbacks.push(\n globe.imageryLayersUpdatedEvent.addEventListener(\n requestRenderAfterFrame(scene)\n )\n );\n removeGlobeCallbacks.push(\n globe.terrainProviderChanged.addEventListener(\n requestRenderAfterFrame(scene)\n )\n );\n }\n scene._removeGlobeCallbacks = removeGlobeCallbacks;\n}\n\nObject.defineProperties(Scene.prototype, {\n /**\n * Gets the canvas element to which this scene is bound.\n * @memberof Scene.prototype\n *\n * @type {HTMLCanvasElement}\n * @readonly\n */\n canvas: {\n get: function () {\n return this._canvas;\n },\n },\n\n /**\n * The drawingBufferHeight of the underlying GL context.\n * @memberof Scene.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}\n */\n drawingBufferHeight: {\n get: function () {\n return this._context.drawingBufferHeight;\n },\n },\n\n /**\n * The drawingBufferHeight of the underlying GL context.\n * @memberof Scene.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}\n */\n drawingBufferWidth: {\n get: function () {\n return this._context.drawingBufferWidth;\n },\n },\n\n /**\n * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.\n * @memberof Scene.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALIASED_LINE_WIDTH_RANGE</code>.\n */\n maximumAliasedLineWidth: {\n get: function () {\n return ContextLimits.maximumAliasedLineWidth;\n },\n },\n\n /**\n * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.\n * @memberof Scene.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>GL_MAX_CUBE_MAP_TEXTURE_SIZE</code>.\n */\n maximumCubeMapSize: {\n get: function () {\n return ContextLimits.maximumCubeMapSize;\n },\n },\n\n /**\n * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.\n * @memberof Scene.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @see Scene#pickPosition\n */\n pickPositionSupported: {\n get: function () {\n return this._context.depthTexture;\n },\n },\n\n /**\n * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.\n * @memberof Scene.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @see Scene#sampleHeight\n * @see Scene#sampleHeightMostDetailed\n */\n sampleHeightSupported: {\n get: function () {\n return this._context.depthTexture;\n },\n },\n\n /**\n * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.\n * @memberof Scene.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @see Scene#clampToHeight\n * @see Scene#clampToHeightMostDetailed\n */\n clampToHeightSupported: {\n get: function () {\n return this._context.depthTexture;\n },\n },\n\n /**\n * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.\n * @memberof Scene.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @see Scene#invertClassification\n */\n invertClassificationSupported: {\n get: function () {\n return this._context.depthTexture;\n },\n },\n\n /**\n * Returns <code>true</code> if specular environment maps are supported.\n * @memberof Scene.prototype\n *\n * @type {Boolean}\n * @readonly\n *\n * @see Scene#specularEnvironmentMaps\n */\n specularEnvironmentMapsSupported: {\n get: function () {\n return OctahedralProjectedCubeMap.isSupported(this._context);\n },\n },\n\n /**\n * Gets or sets the depth-test ellipsoid.\n * @memberof Scene.prototype\n *\n * @type {Globe}\n */\n globe: {\n get: function () {\n return this._globe;\n },\n\n set: function (globe) {\n this._globe = this._globe && this._globe.destroy();\n this._globe = globe;\n\n updateGlobeListeners(this, globe);\n },\n },\n\n /**\n * Gets the collection of primitives.\n * @memberof Scene.prototype\n *\n * @type {PrimitiveCollection}\n * @readonly\n */\n primitives: {\n get: function () {\n return this._primitives;\n },\n },\n\n /**\n * Gets the collection of ground primitives.\n * @memberof Scene.prototype\n *\n * @type {PrimitiveCollection}\n * @readonly\n */\n groundPrimitives: {\n get: function () {\n return this._groundPrimitives;\n },\n },\n\n /**\n * Gets or sets the camera.\n * @memberof Scene.prototype\n *\n * @type {Camera}\n * @readonly\n */\n camera: {\n get: function () {\n return this._view.camera;\n },\n set: function (camera) {\n // For internal use only. Documentation is still @readonly.\n this._view.camera = camera;\n },\n },\n\n /**\n * Gets or sets the view.\n * @memberof Scene.prototype\n *\n * @type {View}\n * @readonly\n *\n * @private\n */\n view: {\n get: function () {\n return this._view;\n },\n set: function (view) {\n // For internal use only. Documentation is still @readonly.\n this._view = view;\n },\n },\n\n /**\n * Gets the default view.\n * @memberof Scene.prototype\n *\n * @type {View}\n * @readonly\n *\n * @private\n */\n defaultView: {\n get: function () {\n return this._defaultView;\n },\n },\n\n /**\n * Gets picking functions and state\n * @memberof Scene.prototype\n *\n * @type {Picking}\n * @readonly\n *\n * @private\n */\n picking: {\n get: function () {\n return this._picking;\n },\n },\n\n /**\n * Gets the controller for camera input handling.\n * @memberof Scene.prototype\n *\n * @type {ScreenSpaceCameraController}\n * @readonly\n */\n screenSpaceCameraController: {\n get: function () {\n return this._screenSpaceCameraController;\n },\n },\n\n /**\n * Get the map projection to use in 2D and Columbus View modes.\n * @memberof Scene.prototype\n *\n * @type {MapProjection}\n * @readonly\n *\n * @default new GeographicProjection()\n */\n mapProjection: {\n get: function () {\n return this._mapProjection;\n },\n },\n\n /**\n * Gets the job scheduler\n * @memberof Scene.prototype\n * @type {JobScheduler}\n * @readonly\n *\n * @private\n */\n jobScheduler: {\n get: function () {\n return this._jobScheduler;\n },\n },\n\n /**\n * Gets state information about the current scene. If called outside of a primitive's <code>update</code>\n * function, the previous frame's state is returned.\n * @memberof Scene.prototype\n *\n * @type {FrameState}\n * @readonly\n *\n * @private\n */\n frameState: {\n get: function () {\n return this._frameState;\n },\n },\n\n /**\n * Gets the environment state.\n * @memberof Scene.prototype\n *\n * @type {EnvironmentState}\n * @readonly\n *\n * @private\n */\n environmentState: {\n get: function () {\n return this._environmentState;\n },\n },\n\n /**\n * Gets the collection of tweens taking place in the scene.\n * @memberof Scene.prototype\n *\n * @type {TweenCollection}\n * @readonly\n *\n * @private\n */\n tweens: {\n get: function () {\n return this._tweens;\n },\n },\n\n /**\n * Gets the collection of image layers that will be rendered on the globe.\n * @memberof Scene.prototype\n *\n * @type {ImageryLayerCollection}\n * @readonly\n */\n imageryLayers: {\n get: function () {\n if (!defined(this.globe)) {\n return undefined;\n }\n\n return this.globe.imageryLayers;\n },\n },\n\n /**\n * The terrain provider providing surface geometry for the globe.\n * @memberof Scene.prototype\n *\n * @type {TerrainProvider}\n */\n terrainProvider: {\n get: function () {\n if (!defined(this.globe)) {\n return undefined;\n }\n\n return this.globe.terrainProvider;\n },\n set: function (terrainProvider) {\n if (defined(this.globe)) {\n this.globe.terrainProvider = terrainProvider;\n }\n },\n },\n\n /**\n * Gets an event that's raised when the terrain provider is changed\n * @memberof Scene.prototype\n *\n * @type {Event}\n * @readonly\n */\n terrainProviderChanged: {\n get: function () {\n if (!defined(this.globe)) {\n return undefined;\n }\n\n return this.globe.terrainProviderChanged;\n },\n },\n\n /**\n * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event\n * receive the Scene instance as the first parameter and the current time as the second parameter.\n * @memberof Scene.prototype\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#postUpdate\n * @see Scene#preRender\n * @see Scene#postRender\n *\n * @type {Event}\n * @readonly\n */\n preUpdate: {\n get: function () {\n return this._preUpdate;\n },\n },\n\n /**\n * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.\n * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second\n * parameter.\n * @memberof Scene.prototype\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#preUpdate\n * @see Scene#preRender\n * @see Scene#postRender\n *\n * @type {Event}\n * @readonly\n */\n postUpdate: {\n get: function () {\n return this._postUpdate;\n },\n },\n\n /**\n * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.\n * The Scene instance and the thrown error are the only two parameters passed to the event handler.\n * By default, errors are not rethrown after this event is raised, but that can be changed by setting\n * the <code>rethrowRenderErrors</code> property.\n * @memberof Scene.prototype\n *\n * @type {Event}\n * @readonly\n */\n renderError: {\n get: function () {\n return this._renderError;\n },\n },\n\n /**\n * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.\n * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second\n * parameter.\n * @memberof Scene.prototype\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#preUpdate\n * @see Scene#postUpdate\n * @see Scene#postRender\n *\n * @type {Event}\n * @readonly\n */\n preRender: {\n get: function () {\n return this._preRender;\n },\n },\n\n /**\n * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event\n * receive the Scene instance as the first parameter and the current time as the second parameter.\n * @memberof Scene.prototype\n *\n * @see {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}\n * @see Scene#preUpdate\n * @see Scene#postUpdate\n * @see Scene#postRender\n *\n * @type {Event}\n * @readonly\n */\n postRender: {\n get: function () {\n return this._postRender;\n },\n },\n\n /**\n * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been\n * rendered.\n * @memberof Scene.prototype\n *\n * @type {JulianDate}\n * @readonly\n */\n lastRenderTime: {\n get: function () {\n return this._lastRenderTime;\n },\n },\n\n /**\n * @memberof Scene.prototype\n * @private\n * @readonly\n */\n context: {\n get: function () {\n return this._context;\n },\n },\n\n /**\n * This property is for debugging only; it is not for production use.\n * <p>\n * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains\n * properties with statistics about the number of command execute per frustum.\n * <code>totalCommands</code> is the total number of commands executed, ignoring\n * overlap. <code>commandsInFrustums</code> is an array with the number of times\n * commands are executed redundantly, e.g., how many commands overlap two or\n * three frustums.\n * </p>\n *\n * @memberof Scene.prototype\n *\n * @type {Object}\n * @readonly\n *\n * @default undefined\n */\n debugFrustumStatistics: {\n get: function () {\n return this._view.debugFrustumStatistics;\n },\n },\n\n /**\n * Gets whether or not the scene is optimized for 3D only viewing.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @readonly\n */\n scene3DOnly: {\n get: function () {\n return this._frameState.scene3DOnly;\n },\n },\n\n /**\n * Gets whether or not the scene has order independent translucency enabled.\n * Note that this only reflects the original construction option, and there are\n * other factors that could prevent OIT from functioning on a given system configuration.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @readonly\n */\n orderIndependentTranslucency: {\n get: function () {\n return this._useOIT;\n },\n },\n\n /**\n * Gets the unique identifier for this scene.\n * @memberof Scene.prototype\n * @type {String}\n * @readonly\n */\n id: {\n get: function () {\n return this._id;\n },\n },\n\n /**\n * Gets or sets the current mode of the scene.\n * @memberof Scene.prototype\n * @type {SceneMode}\n * @default {@link SceneMode.SCENE3D}\n */\n mode: {\n get: function () {\n return this._mode;\n },\n set: function (value) {\nif (value === SceneMode.SCENE2D) {\n this.morphTo2D(0);\n } else if (value === SceneMode.SCENE3D) {\n this.morphTo3D(0);\n } else if (value === SceneMode.COLUMBUS_VIEW) {\n this.morphToColumbusView(0);\n}\n this._mode = value;\n },\n },\n\n /**\n * Gets the number of frustums used in the last frame.\n * @memberof Scene.prototype\n * @type {FrustumCommands[]}\n *\n * @private\n */\n frustumCommandsList: {\n get: function () {\n return this._view.frustumCommandsList;\n },\n },\n\n /**\n * Gets the number of frustums used in the last frame.\n * @memberof Scene.prototype\n * @type {Number}\n *\n * @private\n */\n numberOfFrustums: {\n get: function () {\n return this._view.frustumCommandsList.length;\n },\n },\n\n /**\n * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.\n * Used for cardboard and WebVR.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @default false\n */\n useWebVR: {\n get: function () {\n return this._useWebVR;\n },\n set: function (value) {\nthis._useWebVR = value;\n if (this._useWebVR) {\n this._frameState.creditDisplay.container.style.visibility = \"hidden\";\n this._cameraVR = new Camera(this);\n if (!defined(this._deviceOrientationCameraController)) {\n this._deviceOrientationCameraController = new DeviceOrientationCameraController(\n this\n );\n }\n\n this._aspectRatioVR = this.camera.frustum.aspectRatio;\n } else {\n this._frameState.creditDisplay.container.style.visibility = \"visible\";\n this._cameraVR = undefined;\n this._deviceOrientationCameraController =\n this._deviceOrientationCameraController &&\n !this._deviceOrientationCameraController.isDestroyed() &&\n this._deviceOrientationCameraController.destroy();\n\n this.camera.frustum.aspectRatio = this._aspectRatioVR;\n this.camera.frustum.xOffset = 0.0;\n }\n },\n },\n\n /**\n * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @memberof Scene.prototype\n * @type {MapMode2D}\n * @readonly\n */\n mapMode2D: {\n get: function () {\n return this._mapMode2D;\n },\n },\n\n /**\n * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.\n * @memberof Scene.prototype\n *\n * @type {Number}\n */\n splitPosition: {\n get: function () {\n return this._frameState.splitPosition;\n },\n set: function (value) {\n this._frameState.splitPosition = value;\n },\n },\n\n /**\n * The distance from the camera at which to disable the depth test of billboards, labels and points\n * to, for example, prevent clipping against terrain. When set to zero, the depth test should always\n * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance\n * property of a billboard, label or point will override this value.\n * @memberof Scene.prototype\n * @type {Number}\n * @default 0.0\n */\n minimumDisableDepthTestDistance: {\n get: function () {\n return this._minimumDisableDepthTestDistance;\n },\n set: function (value) {\nthis._minimumDisableDepthTestDistance = value;\n },\n },\n\n /**\n * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,\n * increasing performance. This property relies on fragmentDepth being supported.\n * @memberof Scene.prototype\n * @type {Boolean}\n */\n logarithmicDepthBuffer: {\n get: function () {\n return this._logDepthBuffer;\n },\n set: function (value) {\n value = this._context.fragmentDepth && value;\n if (this._logDepthBuffer !== value) {\n this._logDepthBuffer = value;\n this._logDepthBufferDirty = true;\n }\n },\n },\n\n /**\n * The value used for gamma correction. This is only used when rendering with high dynamic range.\n * @memberof Scene.prototype\n * @type {Number}\n * @default 2.2\n */\n gamma: {\n get: function () {\n return this._context.uniformState.gamma;\n },\n set: function (value) {\n this._context.uniformState.gamma = value;\n },\n },\n\n /**\n * Whether or not to use high dynamic range rendering.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @default false\n */\n highDynamicRange: {\n get: function () {\n return this._hdr;\n },\n set: function (value) {\n const context = this._context;\n const hdr =\n value &&\n context.depthTexture &&\n (context.colorBufferFloat || context.colorBufferHalfFloat);\n this._hdrDirty = hdr !== this._hdr;\n this._hdr = hdr;\n },\n },\n\n /**\n * Whether or not high dynamic range rendering is supported.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @readonly\n * @default true\n */\n highDynamicRangeSupported: {\n get: function () {\n const context = this._context;\n return (\n context.depthTexture &&\n (context.colorBufferFloat || context.colorBufferHalfFloat)\n );\n },\n },\n\n /**\n * Whether or not the camera is underneath the globe.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @readonly\n * @default false\n */\n cameraUnderground: {\n get: function () {\n return this._cameraUnderground;\n },\n },\n\n /**\n * The sample rate of multisample antialiasing (values greater than 1 enable MSAA).\n * @memberof Scene.prototype\n * @type {Number}\n * @default 1\n */\n msaaSamples: {\n get: function () {\n return this._msaaSamples;\n },\n set: function (value) {\n value = Math.min(value, ContextLimits.maximumSamples);\n this._msaaSamples = value;\n },\n },\n\n /**\n * Returns <code>true</code> if the Scene's context supports MSAA.\n * @memberof Scene.prototype\n * @type {Boolean}\n * @readonly\n */\n msaaSupported: {\n get: function () {\n return this._context.msaa;\n },\n },\n\n /**\n * Ratio between a pixel and a density-independent pixel. Provides a standard unit of\n * measure for real pixel measurements appropriate to a particular device.\n *\n * @memberof Scene.prototype\n * @type {Number}\n * @default 1.0\n * @private\n */\n pixelRatio: {\n get: function () {\n return this._frameState.pixelRatio;\n },\n set: function (value) {\n this._frameState.pixelRatio = value;\n },\n },\n\n /**\n * @private\n */\n opaqueFrustumNearOffset: {\n get: function () {\n return 0.9999;\n },\n },\n\n /**\n * @private\n */\n globeHeight: {\n get: function () {\n return this._globeHeight;\n },\n },\n});\n\n/**\n * Determines if a compressed texture format is supported.\n * @param {String} format The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc.\n * @return {boolean} Whether or not the format is supported.\n */\nScene.prototype.getCompressedTextureFormatSupported = function (format) {\n const context = this.context;\n return (\n ((format === \"WEBGL_compressed_texture_s3tc\" || format === \"s3tc\") &&\n context.s3tc) ||\n ((format === \"WEBGL_compressed_texture_pvrtc\" || format === \"pvrtc\") &&\n context.pvrtc) ||\n ((format === \"WEBGL_compressed_texture_etc\" || format === \"etc\") &&\n context.etc) ||\n ((format === \"WEBGL_compressed_texture_etc1\" || format === \"etc1\") &&\n context.etc1) ||\n ((format === \"WEBGL_compressed_texture_astc\" || format === \"astc\") &&\n context.astc) ||\n ((format === \"EXT_texture_compression_bptc\" || format === \"bc7\") &&\n context.bc7)\n );\n};\n\nfunction updateDerivedCommands(scene, command, shadowsDirty) {\n const frameState = scene._frameState;\n const context = scene._context;\n const oit = scene._view.oit;\n const lightShadowMaps = frameState.shadowState.lightShadowMaps;\n const lightShadowsEnabled = frameState.shadowState.lightShadowsEnabled;\n\n let derivedCommands = command.derivedCommands;\n\n if (defined(command.pickId)) {\n derivedCommands.picking = DerivedCommand.createPickDerivedCommand(\n scene,\n command,\n context,\n derivedCommands.picking\n );\n }\n\n if (!command.pickOnly) {\n derivedCommands.depth = DerivedCommand.createDepthOnlyDerivedCommand(\n scene,\n command,\n context,\n derivedCommands.depth\n );\n }\n\n derivedCommands.originalCommand = command;\n\n if (scene._hdr) {\n derivedCommands.hdr = DerivedCommand.createHdrCommand(\n command,\n context,\n derivedCommands.hdr\n );\n command = derivedCommands.hdr.command;\n derivedCommands = command.derivedCommands;\n }\n\n if (lightShadowsEnabled && command.receiveShadows) {\n derivedCommands.shadows = ShadowMap.createReceiveDerivedCommand(\n lightShadowMaps,\n command,\n shadowsDirty,\n context,\n derivedCommands.shadows\n );\n }\n\n if (command.pass === Pass.TRANSLUCENT && defined(oit) && oit.isSupported()) {\n if (lightShadowsEnabled && command.receiveShadows) {\n derivedCommands.oit = defined(derivedCommands.oit)\n ? derivedCommands.oit\n : {};\n derivedCommands.oit.shadows = oit.createDerivedCommands(\n derivedCommands.shadows.receiveCommand,\n context,\n derivedCommands.oit.shadows\n );\n } else {\n derivedCommands.oit = oit.createDerivedCommands(\n command,\n context,\n derivedCommands.oit\n );\n }\n }\n}\n\n/**\n * @private\n */\nScene.prototype.updateDerivedCommands = function (command) {\n if (!defined(command.derivedCommands)) {\n // Is not a DrawCommand\n return;\n }\n\n const frameState = this._frameState;\n const context = this._context;\n\n // Update derived commands when any shadow maps become dirty\n let shadowsDirty = false;\n const lastDirtyTime = frameState.shadowState.lastDirtyTime;\n if (command.lastDirtyTime !== lastDirtyTime) {\n command.lastDirtyTime = lastDirtyTime;\n command.dirty = true;\n shadowsDirty = true;\n }\n\n const useLogDepth = frameState.useLogDepth;\n const useHdr = this._hdr;\n const derivedCommands = command.derivedCommands;\n const hasLogDepthDerivedCommands = defined(derivedCommands.logDepth);\n const hasHdrCommands = defined(derivedCommands.hdr);\n const hasDerivedCommands = defined(derivedCommands.originalCommand);\n const needsLogDepthDerivedCommands =\n useLogDepth && !hasLogDepthDerivedCommands;\n const needsHdrCommands = useHdr && !hasHdrCommands;\n const needsDerivedCommands = (!useLogDepth || !useHdr) && !hasDerivedCommands;\n command.dirty =\n command.dirty ||\n needsLogDepthDerivedCommands ||\n needsHdrCommands ||\n needsDerivedCommands;\n\n if (command.dirty) {\n command.dirty = false;\n\n const shadowMaps = frameState.shadowState.shadowMaps;\n const shadowsEnabled = frameState.shadowState.shadowsEnabled;\n if (shadowsEnabled && command.castShadows) {\n derivedCommands.shadows = ShadowMap.createCastDerivedCommand(\n shadowMaps,\n command,\n shadowsDirty,\n context,\n derivedCommands.shadows\n );\n }\n\n if (hasLogDepthDerivedCommands || needsLogDepthDerivedCommands) {\n derivedCommands.logDepth = DerivedCommand.createLogDepthCommand(\n command,\n context,\n derivedCommands.logDepth\n );\n updateDerivedCommands(\n this,\n derivedCommands.logDepth.command,\n shadowsDirty\n );\n }\n if (hasDerivedCommands || needsDerivedCommands) {\n updateDerivedCommands(this, command, shadowsDirty);\n }\n }\n};\n\nconst renderTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.RENDER,\n});\n\nconst preloadTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.PRELOAD,\n});\n\nconst preloadFlightTilesetPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.PRELOAD_FLIGHT,\n});\n\nconst requestRenderModeDeferCheckPassState = new Cesium3DTilePassState({\n pass: Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,\n});\n\nconst scratchOccluderBoundingSphere = new BoundingSphere();\nlet scratchOccluder;\n\nfunction getOccluder(scene) {\n // TODO: The occluder is the top-level globe. When we add\n // support for multiple central bodies, this should be the closest one.\n const globe = scene.globe;\n if (\n scene._mode === SceneMode.SCENE3D &&\n defined(globe) &&\n globe.show &&\n !scene._cameraUnderground &&\n !scene._globeTranslucencyState.translucent\n ) {\n const ellipsoid = globe.ellipsoid;\n const minimumTerrainHeight = scene.frameState.minimumTerrainHeight;\n scratchOccluderBoundingSphere.radius =\n ellipsoid.minimumRadius + minimumTerrainHeight;\n scratchOccluder = Occluder.fromBoundingSphere(\n scratchOccluderBoundingSphere,\n scene.camera.positionWC,\n scratchOccluder\n );\n return scratchOccluder;\n }\n\n return undefined;\n}\n\n/**\n * @private\n */\nScene.prototype.clearPasses = function (passes) {\n passes.render = false;\n passes.pick = false;\n passes.depth = false;\n passes.postProcess = false;\n passes.offscreen = false;\n};\n\nfunction updateFrameNumber(scene, frameNumber, time) {\n const frameState = scene._frameState;\n frameState.frameNumber = frameNumber;\n frameState.time = JulianDate.clone(time, frameState.time);\n}\n\n/**\n * @private\n */\nScene.prototype.updateFrameState = function () {\n const camera = this.camera;\n\n const frameState = this._frameState;\n frameState.commandList.length = 0;\n frameState.shadowMaps.length = 0;\n frameState.brdfLutGenerator = this._brdfLutGenerator;\n frameState.environmentMap = this.skyBox && this.skyBox._cubeMap;\n frameState.mode = this._mode;\n frameState.morphTime = this.morphTime;\n frameState.mapProjection = this.mapProjection;\n frameState.camera = camera;\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n frameState.occluder = getOccluder(this);\n frameState.minimumTerrainHeight = 0.0;\n frameState.minimumDisableDepthTestDistance = this._minimumDisableDepthTestDistance;\n frameState.invertClassification = this.invertClassification;\n frameState.useLogDepth =\n this._logDepthBuffer &&\n !(\n this.camera.frustum instanceof OrthographicFrustum ||\n this.camera.frustum instanceof OrthographicOffCenterFrustum\n );\n frameState.light = this.light;\n frameState.cameraUnderground = this._cameraUnderground;\n frameState.globeTranslucencyState = this._globeTranslucencyState;\n\n if (defined(this.globe)) {\n frameState.terrainExaggeration = this.globe.terrainExaggeration;\n frameState.terrainExaggerationRelativeHeight = this.globe.terrainExaggerationRelativeHeight;\n }\n\n if (\n defined(this._specularEnvironmentMapAtlas) &&\n this._specularEnvironmentMapAtlas.ready\n ) {\n frameState.specularEnvironmentMaps = this._specularEnvironmentMapAtlas.texture;\n frameState.specularEnvironmentMapsMaximumLOD = this._specularEnvironmentMapAtlas.maximumMipmapLevel;\n } else {\n frameState.specularEnvironmentMaps = undefined;\n frameState.specularEnvironmentMapsMaximumLOD = undefined;\n }\n\n frameState.sphericalHarmonicCoefficients = this.sphericalHarmonicCoefficients;\n\n this._actualInvertClassificationColor = Color.clone(\n this.invertClassificationColor,\n this._actualInvertClassificationColor\n );\n if (!InvertClassification.isTranslucencySupported(this._context)) {\n this._actualInvertClassificationColor.alpha = 1.0;\n }\n\n frameState.invertClassificationColor = this._actualInvertClassificationColor;\n\n if (defined(this.globe)) {\n frameState.maximumScreenSpaceError = this.globe.maximumScreenSpaceError;\n } else {\n frameState.maximumScreenSpaceError = 2;\n }\n\n this.clearPasses(frameState.passes);\n\n frameState.tilesetPassState = undefined;\n};\n\n/**\n * @private\n */\nScene.prototype.isVisible = function (command, cullingVolume, occluder) {\n return (\n defined(command) &&\n (!defined(command.boundingVolume) ||\n !command.cull ||\n (cullingVolume.computeVisibility(command.boundingVolume) !==\n Intersect.OUTSIDE &&\n (!defined(occluder) ||\n !command.occlude ||\n !command.boundingVolume.isOccluded(occluder))))\n );\n};\n\nlet transformFrom2D = new Matrix4(\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 1.0\n);\ntransformFrom2D = Matrix4.inverseTransformation(\n transformFrom2D,\n transformFrom2D\n);\n\nfunction debugShowBoundingVolume(command, scene, passState, debugFramebuffer) {\n // Debug code to draw bounding volume for command. Not optimized!\n // Assumes bounding volume is a bounding sphere or box\n const frameState = scene._frameState;\n const context = frameState.context;\n const boundingVolume = command.boundingVolume;\n\n if (defined(scene._debugVolume)) {\n scene._debugVolume.destroy();\n }\n\n let geometry;\n\n let center = Cartesian3.clone(boundingVolume.center);\n if (frameState.mode !== SceneMode.SCENE3D) {\n center = Matrix4.multiplyByPoint(transformFrom2D, center, center);\n const projection = frameState.mapProjection;\n const centerCartographic = projection.unproject(center);\n center = projection.ellipsoid.cartographicToCartesian(centerCartographic);\n }\n\n if (defined(boundingVolume.radius)) {\n const radius = boundingVolume.radius;\n\n geometry = GeometryPipeline.toWireframe(\n EllipsoidGeometry.createGeometry(\n new EllipsoidGeometry({\n radii: new Cartesian3(radius, radius, radius),\n vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,\n })\n )\n );\n\n scene._debugVolume = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry: geometry,\n modelMatrix: Matrix4.fromTranslation(center),\n attributes: {\n color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n },\n }),\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: false,\n }),\n asynchronous: false,\n });\n } else {\n const halfAxes = boundingVolume.halfAxes;\n\n geometry = GeometryPipeline.toWireframe(\n BoxGeometry.createGeometry(\n BoxGeometry.fromDimensions({\n dimensions: new Cartesian3(2.0, 2.0, 2.0),\n vertexFormat: PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,\n })\n )\n );\n\n scene._debugVolume = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry: geometry,\n modelMatrix: Matrix4.fromRotationTranslation(\n halfAxes,\n center,\n new Matrix4()\n ),\n attributes: {\n color: new ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 1.0),\n },\n }),\n appearance: new PerInstanceColorAppearance({\n flat: true,\n translucent: false,\n }),\n asynchronous: false,\n });\n }\n\n const savedCommandList = frameState.commandList;\n const commandList = (frameState.commandList = []);\n scene._debugVolume.update(frameState);\n\n command = commandList[0];\n\n if (frameState.useLogDepth) {\n const logDepth = DerivedCommand.createLogDepthCommand(command, context);\n command = logDepth.command;\n }\n\n let framebuffer;\n if (defined(debugFramebuffer)) {\n framebuffer = passState.framebuffer;\n passState.framebuffer = debugFramebuffer;\n }\n\n command.execute(context, passState);\n\n if (defined(framebuffer)) {\n passState.framebuffer = framebuffer;\n }\n\n frameState.commandList = savedCommandList;\n}\n\nfunction executeCommand(command, scene, context, passState, debugFramebuffer) {\n const frameState = scene._frameState;\n\n if (defined(scene.debugCommandFilter) && !scene.debugCommandFilter(command)) {\n return;\n }\n\n if (command instanceof ClearCommand) {\n command.execute(context, passState);\n return;\n }\n\n if (command.debugShowBoundingVolume && defined(command.boundingVolume)) {\n debugShowBoundingVolume(command, scene, passState, debugFramebuffer);\n }\n\n if (frameState.useLogDepth && defined(command.derivedCommands.logDepth)) {\n command = command.derivedCommands.logDepth.command;\n }\n\n const passes = frameState.passes;\n if (\n !passes.pick &&\n !passes.depth &&\n scene._hdr &&\n defined(command.derivedCommands) &&\n defined(command.derivedCommands.hdr)\n ) {\n command = command.derivedCommands.hdr.command;\n }\n\n if (passes.pick || passes.depth) {\n if (\n passes.pick &&\n !passes.depth &&\n defined(command.derivedCommands.picking)\n ) {\n command = command.derivedCommands.picking.pickCommand;\n command.execute(context, passState);\n return;\n } else if (defined(command.derivedCommands.depth)) {\n command = command.derivedCommands.depth.depthOnlyCommand;\n command.execute(context, passState);\n return;\n }\n }\n\n if (scene.debugShowCommands || scene.debugShowFrustums) {\n scene._debugInspector.executeDebugShowFrustumsCommand(\n scene,\n command,\n passState\n );\n return;\n }\n\n if (\n frameState.shadowState.lightShadowsEnabled &&\n command.receiveShadows &&\n defined(command.derivedCommands.shadows)\n ) {\n // If the command receives shadows, execute the derived shadows command.\n // Some commands, such as OIT derived commands, do not have derived shadow commands themselves\n // and instead shadowing is built-in. In this case execute the command regularly below.\n command.derivedCommands.shadows.receiveCommand.execute(context, passState);\n } else {\n command.execute(context, passState);\n }\n}\n\nfunction executeIdCommand(command, scene, context, passState) {\n const frameState = scene._frameState;\n let derivedCommands = command.derivedCommands;\n if (!defined(derivedCommands)) {\n return;\n }\n\n if (frameState.useLogDepth && defined(derivedCommands.logDepth)) {\n command = derivedCommands.logDepth.command;\n }\n\n derivedCommands = command.derivedCommands;\n if (defined(derivedCommands.picking)) {\n command = derivedCommands.picking.pickCommand;\n command.execute(context, passState);\n } else if (defined(derivedCommands.depth)) {\n command = derivedCommands.depth.depthOnlyCommand;\n command.execute(context, passState);\n }\n}\n\nfunction backToFront(a, b, position) {\n return (\n b.boundingVolume.distanceSquaredTo(position) -\n a.boundingVolume.distanceSquaredTo(position)\n );\n}\n\nfunction frontToBack(a, b, position) {\n // When distances are equal equal favor sorting b before a. This gives render priority to commands later in the list.\n return (\n a.boundingVolume.distanceSquaredTo(position) -\n b.boundingVolume.distanceSquaredTo(position) +\n CesiumMath.EPSILON12\n );\n}\n\nfunction executeTranslucentCommandsBackToFront(\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n) {\n const context = scene.context;\n\n mergeSort(commands, backToFront, scene.camera.positionWC);\n\n if (defined(invertClassification)) {\n executeFunction(\n invertClassification.unclassifiedCommand,\n scene,\n context,\n passState\n );\n }\n\n const length = commands.length;\n for (let i = 0; i < length; ++i) {\n executeFunction(commands[i], scene, context, passState);\n }\n}\n\nfunction executeTranslucentCommandsFrontToBack(\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n) {\n const context = scene.context;\n\n mergeSort(commands, frontToBack, scene.camera.positionWC);\n\n if (defined(invertClassification)) {\n executeFunction(\n invertClassification.unclassifiedCommand,\n scene,\n context,\n passState\n );\n }\n\n const length = commands.length;\n for (let i = 0; i < length; ++i) {\n executeFunction(commands[i], scene, context, passState);\n }\n}\n\nconst scratchPerspectiveFrustum = new PerspectiveFrustum();\nconst scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum();\nconst scratchOrthographicFrustum = new OrthographicFrustum();\nconst scratchOrthographicOffCenterFrustum = new OrthographicOffCenterFrustum();\n\nfunction executeCommands(scene, passState) {\n const camera = scene.camera;\n const context = scene.context;\n const frameState = scene.frameState;\n const us = context.uniformState;\n\n us.updateCamera(camera);\n\n // Create a working frustum from the original camera frustum.\n let frustum;\n if (defined(camera.frustum.fov)) {\n frustum = camera.frustum.clone(scratchPerspectiveFrustum);\n } else if (defined(camera.frustum.infiniteProjectionMatrix)) {\n frustum = camera.frustum.clone(scratchPerspectiveOffCenterFrustum);\n } else if (defined(camera.frustum.width)) {\n frustum = camera.frustum.clone(scratchOrthographicFrustum);\n } else {\n frustum = camera.frustum.clone(scratchOrthographicOffCenterFrustum);\n }\n\n // Ideally, we would render the sky box and atmosphere last for\n // early-z, but we would have to draw it in each frustum\n frustum.near = camera.frustum.near;\n frustum.far = camera.frustum.far;\n us.updateFrustum(frustum);\n us.updatePass(Pass.ENVIRONMENT);\n\n const passes = frameState.passes;\n const picking = passes.pick;\n const environmentState = scene._environmentState;\n const view = scene._view;\n const renderTranslucentDepthForPick =\n environmentState.renderTranslucentDepthForPick;\n const useWebVR = environmentState.useWebVR;\n\n // Do not render environment primitives during a pick pass since they do not generate picking commands.\n if (!picking) {\n const skyBoxCommand = environmentState.skyBoxCommand;\n if (defined(skyBoxCommand)) {\n executeCommand(skyBoxCommand, scene, context, passState);\n }\n\n if (environmentState.isSkyAtmosphereVisible) {\n executeCommand(\n environmentState.skyAtmosphereCommand,\n scene,\n context,\n passState\n );\n }\n\n if (environmentState.isSunVisible) {\n environmentState.sunDrawCommand.execute(context, passState);\n if (scene.sunBloom && !useWebVR) {\n let framebuffer;\n if (environmentState.useGlobeDepthFramebuffer) {\n framebuffer = view.globeDepth.framebuffer;\n } else if (environmentState.usePostProcess) {\n framebuffer = view.sceneFramebuffer.framebuffer;\n } else {\n framebuffer = environmentState.originalFramebuffer;\n }\n scene._sunPostProcess.execute(context);\n scene._sunPostProcess.copy(context, framebuffer);\n passState.framebuffer = framebuffer;\n }\n }\n\n // Moon can be seen through the atmosphere, since the sun is rendered after the atmosphere.\n if (environmentState.isMoonVisible) {\n environmentState.moonCommand.execute(context, passState);\n }\n }\n\n // Determine how translucent surfaces will be handled.\n let executeTranslucentCommands;\n if (environmentState.useOIT) {\n if (!defined(scene._executeOITFunction)) {\n scene._executeOITFunction = function (\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n ) {\n view.globeDepth.prepareColorTextures(context);\n view.oit.executeCommands(\n scene,\n executeFunction,\n passState,\n commands,\n invertClassification\n );\n };\n }\n executeTranslucentCommands = scene._executeOITFunction;\n } else if (passes.render) {\n executeTranslucentCommands = executeTranslucentCommandsBackToFront;\n } else {\n executeTranslucentCommands = executeTranslucentCommandsFrontToBack;\n }\n\n const frustumCommandsList = view.frustumCommandsList;\n const numFrustums = frustumCommandsList.length;\n\n const clearGlobeDepth = environmentState.clearGlobeDepth;\n const useDepthPlane = environmentState.useDepthPlane;\n const globeTranslucencyState = scene._globeTranslucencyState;\n const globeTranslucent = globeTranslucencyState.translucent;\n const globeTranslucencyFramebuffer = scene._view.globeTranslucencyFramebuffer;\n const clearDepth = scene._depthClearCommand;\n const clearStencil = scene._stencilClearCommand;\n const clearClassificationStencil = scene._classificationStencilClearCommand;\n const depthPlane = scene._depthPlane;\n const usePostProcessSelected = environmentState.usePostProcessSelected;\n\n const height2D = camera.position.z;\n\n // Execute commands in each frustum in back to front order\n let j;\n for (let i = 0; i < numFrustums; ++i) {\n const index = numFrustums - i - 1;\n const frustumCommands = frustumCommandsList[index];\n\n if (scene.mode === SceneMode.SCENE2D) {\n // To avoid z-fighting in 2D, move the camera to just before the frustum\n // and scale the frustum depth to be in [1.0, nearToFarDistance2D].\n camera.position.z = height2D - frustumCommands.near + 1.0;\n frustum.far = Math.max(1.0, frustumCommands.far - frustumCommands.near);\n frustum.near = 1.0;\n us.update(frameState);\n us.updateFrustum(frustum);\n } else {\n // Avoid tearing artifacts between adjacent frustums in the opaque passes\n frustum.near =\n index !== 0\n ? frustumCommands.near * scene.opaqueFrustumNearOffset\n : frustumCommands.near;\n frustum.far = frustumCommands.far;\n us.updateFrustum(frustum);\n }\n\n clearDepth.execute(context, passState);\n\n if (context.stencilBuffer) {\n clearStencil.execute(context, passState);\n }\n\n us.updatePass(Pass.GLOBE);\n let commands = frustumCommands.commands[Pass.GLOBE];\n let length = frustumCommands.indices[Pass.GLOBE];\n\n if (globeTranslucent) {\n globeTranslucencyState.executeGlobeCommands(\n frustumCommands,\n executeCommand,\n globeTranslucencyFramebuffer,\n scene,\n passState\n );\n } else {\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n }\n\n const globeDepth = view.globeDepth;\n if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n globeDepth.executeCopyDepth(context, passState);\n }\n\n // Draw terrain classification\n if (!environmentState.renderTranslucentDepthForPick) {\n us.updatePass(Pass.TERRAIN_CLASSIFICATION);\n commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];\n length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];\n\n if (globeTranslucent) {\n globeTranslucencyState.executeGlobeClassificationCommands(\n frustumCommands,\n executeCommand,\n globeTranslucencyFramebuffer,\n scene,\n passState\n );\n } else {\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n }\n }\n\n if (clearGlobeDepth) {\n clearDepth.execute(context, passState);\n if (useDepthPlane) {\n depthPlane.execute(context, passState);\n }\n }\n\n if (\n !environmentState.useInvertClassification ||\n picking ||\n environmentState.renderTranslucentDepthForPick\n ) {\n // Common/fastest path. Draw 3D Tiles and classification normally.\n\n // Draw 3D Tiles\n us.updatePass(Pass.CESIUM_3D_TILE);\n commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n\n if (length > 0) {\n if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n // When clearGlobeDepth is true, executeUpdateDepth needs\n // a globe depth texture with resolved stencil bits.\n globeDepth.prepareColorTextures(context, clearGlobeDepth);\n globeDepth.executeUpdateDepth(\n context,\n passState,\n clearGlobeDepth,\n globeDepth.depthStencilTexture\n );\n }\n\n // Draw classifications. Modifies 3D Tiles color.\n if (!environmentState.renderTranslucentDepthForPick) {\n us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n commands =\n frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n }\n }\n } else {\n // When the invert classification color is opaque:\n // Main FBO (FBO1): Main_Color + Main_DepthStencil\n // Invert classification FBO (FBO2) : Invert_Color + Main_DepthStencil\n //\n // 1. Clear FBO2 color to vec4(0.0) for each frustum\n // 2. Draw 3D Tiles to FBO2\n // 3. Draw classification to FBO2\n // 4. Fullscreen pass to FBO1, draw Invert_Color when:\n // * Main_DepthStencil has the stencil bit set > 0 (classified)\n // 5. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:\n // * Main_DepthStencil has stencil bit set to 0 (unclassified) and\n // * Invert_Color !== vec4(0.0)\n //\n // When the invert classification color is translucent:\n // Main FBO (FBO1): Main_Color + Main_DepthStencil\n // Invert classification FBO (FBO2): Invert_Color + Invert_DepthStencil\n // IsClassified FBO (FBO3): IsClassified_Color + Invert_DepthStencil\n //\n // 1. Clear FBO2 and FBO3 color to vec4(0.0), stencil to 0, and depth to 1.0\n // 2. Draw 3D Tiles to FBO2\n // 3. Draw classification to FBO2\n // 4. Fullscreen pass to FBO3, draw any color when\n // * Invert_DepthStencil has the stencil bit set > 0 (classified)\n // 5. Fullscreen pass to FBO1, draw Invert_Color when:\n // * Invert_Color !== vec4(0.0) and\n // * IsClassified_Color !== vec4(0.0)\n // 6. Fullscreen pass to FBO1, draw Invert_Color * czm_invertClassificationColor when:\n // * Invert_Color !== vec4(0.0) and\n // * IsClassified_Color === vec4(0.0)\n //\n // NOTE: Step six when translucent invert color occurs after the TRANSLUCENT pass\n //\n scene._invertClassification.clear(context, passState);\n\n const opaqueClassificationFramebuffer = passState.framebuffer;\n passState.framebuffer = scene._invertClassification._fbo.framebuffer;\n\n // Draw normally\n us.updatePass(Pass.CESIUM_3D_TILE);\n commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n\n if (defined(globeDepth) && environmentState.useGlobeDepthFramebuffer) {\n scene._invertClassification.prepareTextures(context);\n globeDepth.executeUpdateDepth(\n context,\n passState,\n clearGlobeDepth,\n scene._invertClassification._fbo.getDepthStencilTexture()\n );\n }\n\n // Set stencil\n us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW);\n commands =\n frustumCommands.commands[\n Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW\n ];\n length =\n frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n\n passState.framebuffer = opaqueClassificationFramebuffer;\n\n // Fullscreen pass to copy classified fragments\n scene._invertClassification.executeClassified(context, passState);\n if (frameState.invertClassificationColor.alpha === 1.0) {\n // Fullscreen pass to copy unclassified fragments when alpha == 1.0\n scene._invertClassification.executeUnclassified(context, passState);\n }\n\n // Clear stencil set by the classification for the next classification pass\n if (length > 0 && context.stencilBuffer) {\n clearClassificationStencil.execute(context, passState);\n }\n\n // Draw style over classification.\n us.updatePass(Pass.CESIUM_3D_TILE_CLASSIFICATION);\n commands = frustumCommands.commands[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n length = frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n }\n\n if (length > 0 && context.stencilBuffer) {\n clearStencil.execute(context, passState);\n }\n\n us.updatePass(Pass.OPAQUE);\n commands = frustumCommands.commands[Pass.OPAQUE];\n length = frustumCommands.indices[Pass.OPAQUE];\n for (j = 0; j < length; ++j) {\n executeCommand(commands[j], scene, context, passState);\n }\n\n if (index !== 0 && scene.mode !== SceneMode.SCENE2D) {\n // Do not overlap frustums in the translucent pass to avoid blending artifacts\n frustum.near = frustumCommands.near;\n us.updateFrustum(frustum);\n }\n\n let invertClassification;\n if (\n !picking &&\n environmentState.useInvertClassification &&\n frameState.invertClassificationColor.alpha < 1.0\n ) {\n // Fullscreen pass to copy unclassified fragments when alpha < 1.0.\n // Not executed when undefined.\n invertClassification = scene._invertClassification;\n }\n\n us.updatePass(Pass.TRANSLUCENT);\n commands = frustumCommands.commands[Pass.TRANSLUCENT];\n commands.length = frustumCommands.indices[Pass.TRANSLUCENT];\n executeTranslucentCommands(\n scene,\n executeCommand,\n passState,\n commands,\n invertClassification\n );\n\n // Classification for translucent 3D Tiles\n const has3DTilesClassificationCommands =\n frustumCommands.indices[Pass.CESIUM_3D_TILE_CLASSIFICATION] > 0;\n if (\n has3DTilesClassificationCommands &&\n view.translucentTileClassification.isSupported()\n ) {\n view.translucentTileClassification.executeTranslucentCommands(\n scene,\n executeCommand,\n passState,\n commands,\n globeDepth.depthStencilTexture\n );\n view.translucentTileClassification.executeClassificationCommands(\n scene,\n executeCommand,\n passState,\n frustumCommands\n );\n }\n\n if (\n context.depthTexture &&\n scene.useDepthPicking &&\n (environmentState.useGlobeDepthFramebuffer ||\n renderTranslucentDepthForPick)\n ) {\n // PERFORMANCE_IDEA: Use MRT to avoid the extra copy.\n const depthStencilTexture = globeDepth.depthStencilTexture;\n const pickDepth = scene._picking.getPickDepth(scene, index);\n pickDepth.update(context, depthStencilTexture);\n pickDepth.executeCopyDepth(context, passState);\n }\n\n if (picking || !usePostProcessSelected) {\n continue;\n }\n\n const originalFramebuffer = passState.framebuffer;\n passState.framebuffer = view.sceneFramebuffer.getIdFramebuffer();\n\n // reset frustum\n frustum.near =\n index !== 0\n ? frustumCommands.near * scene.opaqueFrustumNearOffset\n : frustumCommands.near;\n frustum.far = frustumCommands.far;\n us.updateFrustum(frustum);\n\n us.updatePass(Pass.GLOBE);\n commands = frustumCommands.commands[Pass.GLOBE];\n length = frustumCommands.indices[Pass.GLOBE];\n\n if (globeTranslucent) {\n globeTranslucencyState.executeGlobeCommands(\n frustumCommands,\n executeIdCommand,\n globeTranslucencyFramebuffer,\n scene,\n passState\n );\n } else {\n for (j = 0; j < length; ++j) {\n executeIdCommand(commands[j], scene, context, passState);\n }\n }\n\n if (clearGlobeDepth) {\n clearDepth.framebuffer = passState.framebuffer;\n clearDepth.execute(context, passState);\n clearDepth.framebuffer = undefined;\n }\n\n if (clearGlobeDepth && useDepthPlane) {\n depthPlane.execute(context, passState);\n }\n\n us.updatePass(Pass.CESIUM_3D_TILE);\n commands = frustumCommands.commands[Pass.CESIUM_3D_TILE];\n length = frustumCommands.indices[Pass.CESIUM_3D_TILE];\n for (j = 0; j < length; ++j) {\n executeIdCommand(commands[j], scene, context, passState);\n }\n\n us.updatePass(Pass.OPAQUE);\n commands = frustumCommands.commands[Pass.OPAQUE];\n length = frustumCommands.indices[Pass.OPAQUE];\n for (j = 0; j < length; ++j) {\n executeIdCommand(commands[j], scene, context, passState);\n }\n\n us.updatePass(Pass.TRANSLUCENT);\n commands = frustumCommands.commands[Pass.TRANSLUCENT];\n length = frustumCommands.indices[Pass.TRANSLUCENT];\n for (j = 0; j < length; ++j) {\n executeIdCommand(commands[j], scene, context, passState);\n }\n\n passState.framebuffer = originalFramebuffer;\n }\n}\n\nfunction executeComputeCommands(scene) {\n const us = scene.context.uniformState;\n us.updatePass(Pass.COMPUTE);\n\n const sunComputeCommand = scene._environmentState.sunComputeCommand;\n if (defined(sunComputeCommand)) {\n sunComputeCommand.execute(scene._computeEngine);\n }\n\n const commandList = scene._computeCommandList;\n const length = commandList.length;\n for (let i = 0; i < length; ++i) {\n commandList[i].execute(scene._computeEngine);\n }\n}\n\nfunction executeOverlayCommands(scene, passState) {\n const us = scene.context.uniformState;\n us.updatePass(Pass.OVERLAY);\n\n const context = scene.context;\n const commandList = scene._overlayCommandList;\n const length = commandList.length;\n for (let i = 0; i < length; ++i) {\n commandList[i].execute(context, passState);\n }\n}\n\nfunction insertShadowCastCommands(scene, commandList, shadowMap) {\n const shadowVolume = shadowMap.shadowMapCullingVolume;\n const isPointLight = shadowMap.isPointLight;\n const passes = shadowMap.passes;\n const numberOfPasses = passes.length;\n\n const length = commandList.length;\n for (let i = 0; i < length; ++i) {\n const command = commandList[i];\n scene.updateDerivedCommands(command);\n\n if (\n command.castShadows &&\n (command.pass === Pass.GLOBE ||\n command.pass === Pass.CESIUM_3D_TILE ||\n command.pass === Pass.OPAQUE ||\n command.pass === Pass.TRANSLUCENT)\n ) {\n if (scene.isVisible(command, shadowVolume)) {\n if (isPointLight) {\n for (let k = 0; k < numberOfPasses; ++k) {\n passes[k].commandList.push(command);\n }\n } else if (numberOfPasses === 1) {\n passes[0].commandList.push(command);\n } else {\n let wasVisible = false;\n // Loop over cascades from largest to smallest\n for (let j = numberOfPasses - 1; j >= 0; --j) {\n const cascadeVolume = passes[j].cullingVolume;\n if (scene.isVisible(command, cascadeVolume)) {\n passes[j].commandList.push(command);\n wasVisible = true;\n } else if (wasVisible) {\n // If it was visible in the previous cascade but now isn't\n // then there is no need to check any more cascades\n break;\n }\n }\n }\n }\n }\n }\n}\n\nfunction executeShadowMapCastCommands(scene) {\n const frameState = scene.frameState;\n const shadowMaps = frameState.shadowState.shadowMaps;\n const shadowMapLength = shadowMaps.length;\n\n if (!frameState.shadowState.shadowsEnabled) {\n return;\n }\n\n const context = scene.context;\n const uniformState = context.uniformState;\n\n for (let i = 0; i < shadowMapLength; ++i) {\n const shadowMap = shadowMaps[i];\n if (shadowMap.outOfView) {\n continue;\n }\n\n // Reset the command lists\n const passes = shadowMap.passes;\n const numberOfPasses = passes.length;\n for (let j = 0; j < numberOfPasses; ++j) {\n passes[j].commandList.length = 0;\n }\n\n // Insert the primitive/model commands into the command lists\n const sceneCommands = scene.frameState.commandList;\n insertShadowCastCommands(scene, sceneCommands, shadowMap);\n\n for (let j = 0; j < numberOfPasses; ++j) {\n const pass = shadowMap.passes[j];\n uniformState.updateCamera(pass.camera);\n shadowMap.updatePass(context, j);\n const numberOfCommands = pass.commandList.length;\n for (let k = 0; k < numberOfCommands; ++k) {\n const command = pass.commandList[k];\n // Set the correct pass before rendering into the shadow map because some shaders\n // conditionally render based on whether the pass is translucent or opaque.\n uniformState.updatePass(command.pass);\n executeCommand(\n command.derivedCommands.shadows.castCommands[i],\n scene,\n context,\n pass.passState\n );\n }\n }\n }\n}\n\nconst scratchEyeTranslation = new Cartesian3();\n\n/**\n * @private\n */\nScene.prototype.updateAndExecuteCommands = function (\n passState,\n backgroundColor\n) {\n const frameState = this._frameState;\n const mode = frameState.mode;\n const useWebVR = this._environmentState.useWebVR;\n\n if (useWebVR) {\n executeWebVRCommands(this, passState, backgroundColor);\n } else if (\n mode !== SceneMode.SCENE2D ||\n this._mapMode2D === MapMode2D.ROTATE\n ) {\n executeCommandsInViewport(true, this, passState, backgroundColor);\n } else {\n updateAndClearFramebuffers(this, passState, backgroundColor);\n execute2DViewportCommands(this, passState);\n }\n};\n\nfunction executeWebVRCommands(scene, passState, backgroundColor) {\n const view = scene._view;\n const camera = view.camera;\n const environmentState = scene._environmentState;\n const renderTranslucentDepthForPick =\n environmentState.renderTranslucentDepthForPick;\n\n updateAndClearFramebuffers(scene, passState, backgroundColor);\n\n updateAndRenderPrimitives(scene);\n\n view.createPotentiallyVisibleSet(scene);\n\n executeComputeCommands(scene);\n\n if (!renderTranslucentDepthForPick) {\n executeShadowMapCastCommands(scene);\n }\n\n // Based on Calculating Stereo pairs by Paul Bourke\n // http://paulbourke.net/stereographics/stereorender/\n const viewport = passState.viewport;\n viewport.x = 0;\n viewport.y = 0;\n viewport.width = viewport.width * 0.5;\n\n const savedCamera = Camera.clone(camera, scene._cameraVR);\n savedCamera.frustum = camera.frustum;\n\n const near = camera.frustum.near;\n const fo = near * defaultValue(scene.focalLength, 5.0);\n const eyeSeparation = defaultValue(scene.eyeSeparation, fo / 30.0);\n const eyeTranslation = Cartesian3.multiplyByScalar(\n savedCamera.right,\n eyeSeparation * 0.5,\n scratchEyeTranslation\n );\n\n camera.frustum.aspectRatio = viewport.width / viewport.height;\n\n const offset = (0.5 * eyeSeparation * near) / fo;\n\n Cartesian3.add(savedCamera.position, eyeTranslation, camera.position);\n camera.frustum.xOffset = offset;\n\n executeCommands(scene, passState);\n\n viewport.x = viewport.width;\n\n Cartesian3.subtract(savedCamera.position, eyeTranslation, camera.position);\n camera.frustum.xOffset = -offset;\n\n executeCommands(scene, passState);\n\n Camera.clone(savedCamera, camera);\n}\n\nconst scratch2DViewportCartographic = new Cartographic(\n Math.PI,\n CesiumMath.PI_OVER_TWO\n);\nconst scratch2DViewportMaxCoord = new Cartesian3();\nconst scratch2DViewportSavedPosition = new Cartesian3();\nconst scratch2DViewportTransform = new Matrix4();\nconst scratch2DViewportCameraTransform = new Matrix4();\nconst scratch2DViewportEyePoint = new Cartesian3();\nconst scratch2DViewportWindowCoords = new Cartesian3();\nconst scratch2DViewport = new BoundingRectangle();\n\nfunction execute2DViewportCommands(scene, passState) {\n const context = scene.context;\n const frameState = scene.frameState;\n const camera = scene.camera;\n\n const originalViewport = passState.viewport;\n const viewport = BoundingRectangle.clone(originalViewport, scratch2DViewport);\n passState.viewport = viewport;\n\n const maxCartographic = scratch2DViewportCartographic;\n const maxCoord = scratch2DViewportMaxCoord;\n\n const projection = scene.mapProjection;\n projection.project(maxCartographic, maxCoord);\n\n const position = Cartesian3.clone(\n camera.position,\n scratch2DViewportSavedPosition\n );\n const transform = Matrix4.clone(\n camera.transform,\n scratch2DViewportCameraTransform\n );\n const frustum = camera.frustum.clone();\n\n camera._setTransform(Matrix4.IDENTITY);\n\n const viewportTransformation = Matrix4.computeViewportTransformation(\n viewport,\n 0.0,\n 1.0,\n scratch2DViewportTransform\n );\n const projectionMatrix = camera.frustum.projectionMatrix;\n\n const x = camera.positionWC.y;\n const eyePoint = Cartesian3.fromElements(\n CesiumMath.sign(x) * maxCoord.x - x,\n 0.0,\n -camera.positionWC.x,\n scratch2DViewportEyePoint\n );\n const windowCoordinates = Transforms.pointToGLWindowCoordinates(\n projectionMatrix,\n viewportTransformation,\n eyePoint,\n scratch2DViewportWindowCoords\n );\n\n windowCoordinates.x = Math.floor(windowCoordinates.x);\n\n const viewportX = viewport.x;\n const viewportWidth = viewport.width;\n\n if (\n x === 0.0 ||\n windowCoordinates.x <= viewportX ||\n windowCoordinates.x >= viewportX + viewportWidth\n ) {\n executeCommandsInViewport(true, scene, passState);\n } else if (\n Math.abs(viewportX + viewportWidth * 0.5 - windowCoordinates.x) < 1.0\n ) {\n viewport.width = windowCoordinates.x - viewport.x;\n\n camera.position.x *= CesiumMath.sign(camera.position.x);\n\n camera.frustum.right = 0.0;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(true, scene, passState);\n\n viewport.x = windowCoordinates.x;\n\n camera.position.x = -camera.position.x;\n\n camera.frustum.right = -camera.frustum.left;\n camera.frustum.left = 0.0;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(false, scene, passState);\n } else if (windowCoordinates.x > viewportX + viewportWidth * 0.5) {\n viewport.width = windowCoordinates.x - viewportX;\n\n const right = camera.frustum.right;\n camera.frustum.right = maxCoord.x - x;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(true, scene, passState);\n\n viewport.x = windowCoordinates.x;\n viewport.width = viewportX + viewportWidth - windowCoordinates.x;\n\n camera.position.x = -camera.position.x;\n\n camera.frustum.left = -camera.frustum.right;\n camera.frustum.right = right - camera.frustum.right * 2.0;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(false, scene, passState);\n } else {\n viewport.x = windowCoordinates.x;\n viewport.width = viewportX + viewportWidth - windowCoordinates.x;\n\n const left = camera.frustum.left;\n camera.frustum.left = -maxCoord.x - x;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(true, scene, passState);\n\n viewport.x = viewportX;\n viewport.width = windowCoordinates.x - viewportX;\n\n camera.position.x = -camera.position.x;\n\n camera.frustum.right = -camera.frustum.left;\n camera.frustum.left = left - camera.frustum.left * 2.0;\n\n frameState.cullingVolume = camera.frustum.computeCullingVolume(\n camera.positionWC,\n camera.directionWC,\n camera.upWC\n );\n context.uniformState.update(frameState);\n\n executeCommandsInViewport(false, scene, passState);\n }\n\n camera._setTransform(transform);\n Cartesian3.clone(position, camera.position);\n camera.frustum = frustum.clone();\n passState.viewport = originalViewport;\n}\n\nfunction executeCommandsInViewport(\n firstViewport,\n scene,\n passState,\n backgroundColor\n) {\n const environmentState = scene._environmentState;\n const view = scene._view;\n const renderTranslucentDepthForPick =\n environmentState.renderTranslucentDepthForPick;\n\n if (!firstViewport) {\n scene.frameState.commandList.length = 0;\n }\n\n updateAndRenderPrimitives(scene);\n\n view.createPotentiallyVisibleSet(scene);\n\n if (firstViewport) {\n if (defined(backgroundColor)) {\n updateAndClearFramebuffers(scene, passState, backgroundColor);\n }\n executeComputeCommands(scene);\n if (!renderTranslucentDepthForPick) {\n executeShadowMapCastCommands(scene);\n }\n }\n\n executeCommands(scene, passState);\n}\n\nconst scratchCullingVolume = new CullingVolume();\n\n/**\n * @private\n */\nScene.prototype.updateEnvironment = function () {\n const frameState = this._frameState;\n const view = this._view;\n\n // Update celestial and terrestrial environment effects.\n const environmentState = this._environmentState;\n const renderPass = frameState.passes.render;\n const offscreenPass = frameState.passes.offscreen;\n const skyAtmosphere = this.skyAtmosphere;\n const globe = this.globe;\n const globeTranslucencyState = this._globeTranslucencyState;\n\n if (\n !renderPass ||\n (this._mode !== SceneMode.SCENE2D &&\n view.camera.frustum instanceof OrthographicFrustum) ||\n !globeTranslucencyState.environmentVisible\n ) {\n environmentState.skyAtmosphereCommand = undefined;\n environmentState.skyBoxCommand = undefined;\n environmentState.sunDrawCommand = undefined;\n environmentState.sunComputeCommand = undefined;\n environmentState.moonCommand = undefined;\n } else {\n if (defined(skyAtmosphere)) {\n if (defined(globe)) {\n skyAtmosphere.setDynamicAtmosphereColor(\n globe.enableLighting && globe.dynamicAtmosphereLighting,\n globe.dynamicAtmosphereLightingFromSun\n );\n environmentState.isReadyForAtmosphere =\n environmentState.isReadyForAtmosphere ||\n globe._surface._tilesToRender.length > 0;\n }\n environmentState.skyAtmosphereCommand = skyAtmosphere.update(\n frameState,\n globe\n );\n if (defined(environmentState.skyAtmosphereCommand)) {\n this.updateDerivedCommands(environmentState.skyAtmosphereCommand);\n }\n } else {\n environmentState.skyAtmosphereCommand = undefined;\n }\n\n environmentState.skyBoxCommand = defined(this.skyBox)\n ? this.skyBox.update(frameState, this._hdr)\n : undefined;\n const sunCommands = defined(this.sun)\n ? this.sun.update(frameState, view.passState, this._hdr)\n : undefined;\n environmentState.sunDrawCommand = defined(sunCommands)\n ? sunCommands.drawCommand\n : undefined;\n environmentState.sunComputeCommand = defined(sunCommands)\n ? sunCommands.computeCommand\n : undefined;\n environmentState.moonCommand = defined(this.moon)\n ? this.moon.update(frameState)\n : undefined;\n }\n\n const clearGlobeDepth = (environmentState.clearGlobeDepth =\n defined(globe) &&\n globe.show &&\n (!globe.depthTestAgainstTerrain || this.mode === SceneMode.SCENE2D));\n const useDepthPlane = (environmentState.useDepthPlane =\n clearGlobeDepth &&\n this.mode === SceneMode.SCENE3D &&\n globeTranslucencyState.useDepthPlane);\n if (useDepthPlane) {\n // Update the depth plane that is rendered in 3D when the primitives are\n // not depth tested against terrain so primitives on the backface\n // of the globe are not picked.\n this._depthPlane.update(frameState);\n }\n\n environmentState.renderTranslucentDepthForPick = false;\n environmentState.useWebVR =\n this._useWebVR && this.mode !== SceneMode.SCENE2D && !offscreenPass;\n\n const occluder =\n frameState.mode === SceneMode.SCENE3D &&\n !globeTranslucencyState.sunVisibleThroughGlobe\n ? frameState.occluder\n : undefined;\n let cullingVolume = frameState.cullingVolume;\n\n // get user culling volume minus the far plane.\n const planes = scratchCullingVolume.planes;\n for (let k = 0; k < 5; ++k) {\n planes[k] = cullingVolume.planes[k];\n }\n cullingVolume = scratchCullingVolume;\n\n // Determine visibility of celestial and terrestrial environment effects.\n environmentState.isSkyAtmosphereVisible =\n defined(environmentState.skyAtmosphereCommand) &&\n environmentState.isReadyForAtmosphere;\n environmentState.isSunVisible = this.isVisible(\n environmentState.sunDrawCommand,\n cullingVolume,\n occluder\n );\n environmentState.isMoonVisible = this.isVisible(\n environmentState.moonCommand,\n cullingVolume,\n occluder\n );\n\n const envMaps = this.specularEnvironmentMaps;\n let envMapAtlas = this._specularEnvironmentMapAtlas;\n if (\n defined(envMaps) &&\n (!defined(envMapAtlas) || envMapAtlas.url !== envMaps)\n ) {\n envMapAtlas = envMapAtlas && envMapAtlas.destroy();\n this._specularEnvironmentMapAtlas = new OctahedralProjectedCubeMap(envMaps);\n } else if (!defined(envMaps) && defined(envMapAtlas)) {\n envMapAtlas.destroy();\n this._specularEnvironmentMapAtlas = undefined;\n }\n\n if (defined(this._specularEnvironmentMapAtlas)) {\n this._specularEnvironmentMapAtlas.update(frameState);\n }\n};\n\nfunction updateDebugFrustumPlanes(scene) {\n const frameState = scene._frameState;\n if (scene.debugShowFrustumPlanes !== scene._debugShowFrustumPlanes) {\n if (scene.debugShowFrustumPlanes) {\n scene._debugFrustumPlanes = new DebugCameraPrimitive({\n camera: scene.camera,\n updateOnChange: false,\n frustumSplits: frameState.frustumSplits,\n });\n } else {\n scene._debugFrustumPlanes =\n scene._debugFrustumPlanes && scene._debugFrustumPlanes.destroy();\n }\n scene._debugShowFrustumPlanes = scene.debugShowFrustumPlanes;\n }\n\n if (defined(scene._debugFrustumPlanes)) {\n scene._debugFrustumPlanes.update(frameState);\n }\n}\n\nfunction updateShadowMaps(scene) {\n const frameState = scene._frameState;\n const shadowMaps = frameState.shadowMaps;\n const length = shadowMaps.length;\n\n const shadowsEnabled =\n length > 0 && !frameState.passes.pick && scene.mode === SceneMode.SCENE3D;\n if (shadowsEnabled !== frameState.shadowState.shadowsEnabled) {\n // Update derived commands when shadowsEnabled changes\n ++frameState.shadowState.lastDirtyTime;\n frameState.shadowState.shadowsEnabled = shadowsEnabled;\n }\n\n frameState.shadowState.lightShadowsEnabled = false;\n\n if (!shadowsEnabled) {\n return;\n }\n\n // Check if the shadow maps are different than the shadow maps last frame.\n // If so, the derived commands need to be updated.\n for (let j = 0; j < length; ++j) {\n if (shadowMaps[j] !== frameState.shadowState.shadowMaps[j]) {\n ++frameState.shadowState.lastDirtyTime;\n break;\n }\n }\n\n frameState.shadowState.shadowMaps.length = 0;\n frameState.shadowState.lightShadowMaps.length = 0;\n\n for (let i = 0; i < length; ++i) {\n const shadowMap = shadowMaps[i];\n shadowMap.update(frameState);\n\n frameState.shadowState.shadowMaps.push(shadowMap);\n\n if (shadowMap.fromLightSource) {\n frameState.shadowState.lightShadowMaps.push(shadowMap);\n frameState.shadowState.lightShadowsEnabled = true;\n }\n\n if (shadowMap.dirty) {\n ++frameState.shadowState.lastDirtyTime;\n shadowMap.dirty = false;\n }\n }\n}\n\nfunction updateAndRenderPrimitives(scene) {\n const frameState = scene._frameState;\n\n scene._groundPrimitives.update(frameState);\n scene._primitives.update(frameState);\n\n updateDebugFrustumPlanes(scene);\n updateShadowMaps(scene);\n\n if (scene._globe) {\n scene._globe.render(frameState);\n }\n}\n\nfunction updateAndClearFramebuffers(scene, passState, clearColor) {\n const context = scene._context;\n const frameState = scene._frameState;\n const environmentState = scene._environmentState;\n const view = scene._view;\n\n const passes = scene._frameState.passes;\n const picking = passes.pick;\n if (defined(view.globeDepth)) {\n view.globeDepth.picking = picking;\n }\n const useWebVR = environmentState.useWebVR;\n\n // Preserve the reference to the original framebuffer.\n environmentState.originalFramebuffer = passState.framebuffer;\n\n // Manage sun bloom post-processing effect.\n if (defined(scene.sun) && scene.sunBloom !== scene._sunBloom) {\n if (scene.sunBloom && !useWebVR) {\n scene._sunPostProcess = new SunPostProcess();\n } else if (defined(scene._sunPostProcess)) {\n scene._sunPostProcess = scene._sunPostProcess.destroy();\n }\n\n scene._sunBloom = scene.sunBloom;\n } else if (!defined(scene.sun) && defined(scene._sunPostProcess)) {\n scene._sunPostProcess = scene._sunPostProcess.destroy();\n scene._sunBloom = false;\n }\n\n // Clear the pass state framebuffer.\n const clear = scene._clearColorCommand;\n Color.clone(clearColor, clear.color);\n clear.execute(context, passState);\n\n // Update globe depth rendering based on the current context and clear the globe depth framebuffer.\n // Globe depth is copied for the pick pass to support picking batched geometries in GroundPrimitives.\n const useGlobeDepthFramebuffer = (environmentState.useGlobeDepthFramebuffer = defined(\n view.globeDepth\n ));\n if (useGlobeDepthFramebuffer) {\n view.globeDepth.update(\n context,\n passState,\n view.viewport,\n scene.msaaSamples,\n scene._hdr,\n environmentState.clearGlobeDepth\n );\n view.globeDepth.clear(context, passState, clearColor);\n }\n\n // If supported, configure OIT to use the globe depth framebuffer and clear the OIT framebuffer.\n const oit = view.oit;\n const useOIT = (environmentState.useOIT =\n !picking && defined(oit) && oit.isSupported());\n if (useOIT) {\n oit.update(\n context,\n passState,\n view.globeDepth.colorFramebufferManager,\n scene._hdr,\n scene.msaaSamples\n );\n oit.clear(context, passState, clearColor);\n environmentState.useOIT = oit.isSupported();\n }\n\n const postProcess = scene.postProcessStages;\n let usePostProcess = (environmentState.usePostProcess =\n !picking &&\n (scene._hdr ||\n postProcess.length > 0 ||\n postProcess.ambientOcclusion.enabled ||\n postProcess.fxaa.enabled ||\n postProcess.bloom.enabled));\n environmentState.usePostProcessSelected = false;\n if (usePostProcess) {\n view.sceneFramebuffer.update(\n context,\n view.viewport,\n scene._hdr,\n scene.msaaSamples\n );\n view.sceneFramebuffer.clear(context, passState, clearColor);\n\n postProcess.update(context, frameState.useLogDepth, scene._hdr);\n postProcess.clear(context);\n\n usePostProcess = environmentState.usePostProcess = postProcess.ready;\n environmentState.usePostProcessSelected =\n usePostProcess && postProcess.hasSelected;\n }\n\n if (environmentState.isSunVisible && scene.sunBloom && !useWebVR) {\n passState.framebuffer = scene._sunPostProcess.update(passState);\n scene._sunPostProcess.clear(context, passState, clearColor);\n } else if (useGlobeDepthFramebuffer) {\n passState.framebuffer = view.globeDepth.framebuffer;\n } else if (usePostProcess) {\n passState.framebuffer = view.sceneFramebuffer.framebuffer;\n }\n\n if (defined(passState.framebuffer)) {\n clear.execute(context, passState);\n }\n\n const useInvertClassification = (environmentState.useInvertClassification =\n !picking && defined(passState.framebuffer) && scene.invertClassification);\n if (useInvertClassification) {\n let depthFramebuffer;\n if (scene.frameState.invertClassificationColor.alpha === 1.0) {\n if (environmentState.useGlobeDepthFramebuffer) {\n depthFramebuffer = view.globeDepth.framebuffer;\n }\n }\n\n if (defined(depthFramebuffer) || context.depthTexture) {\n scene._invertClassification.previousFramebuffer = depthFramebuffer;\n scene._invertClassification.update(\n context,\n scene.msaaSamples,\n view.globeDepth.colorFramebufferManager\n );\n scene._invertClassification.clear(context, passState);\n\n if (scene.frameState.invertClassificationColor.alpha < 1.0 && useOIT) {\n const command = scene._invertClassification.unclassifiedCommand;\n const derivedCommands = command.derivedCommands;\n derivedCommands.oit = oit.createDerivedCommands(\n command,\n context,\n derivedCommands.oit\n );\n }\n } else {\n environmentState.useInvertClassification = false;\n }\n }\n\n if (scene._globeTranslucencyState.translucent) {\n view.globeTranslucencyFramebuffer.updateAndClear(\n scene._hdr,\n view.viewport,\n context,\n passState\n );\n }\n}\n\n/**\n * @private\n */\nScene.prototype.resolveFramebuffers = function (passState) {\n const context = this._context;\n const environmentState = this._environmentState;\n const view = this._view;\n const globeDepth = view.globeDepth;\n if (defined(globeDepth)) {\n globeDepth.prepareColorTextures(context);\n }\n\n const useOIT = environmentState.useOIT;\n const useGlobeDepthFramebuffer = environmentState.useGlobeDepthFramebuffer;\n const usePostProcess = environmentState.usePostProcess;\n\n const defaultFramebuffer = environmentState.originalFramebuffer;\n const globeFramebuffer = useGlobeDepthFramebuffer\n ? globeDepth.colorFramebufferManager\n : undefined;\n const sceneFramebuffer = view.sceneFramebuffer._colorFramebuffer;\n const idFramebuffer = view.sceneFramebuffer.idFramebuffer;\n\n if (useOIT) {\n passState.framebuffer = usePostProcess\n ? sceneFramebuffer.framebuffer\n : defaultFramebuffer;\n view.oit.execute(context, passState);\n }\n\n const translucentTileClassification = view.translucentTileClassification;\n if (\n translucentTileClassification.hasTranslucentDepth &&\n translucentTileClassification.isSupported()\n ) {\n translucentTileClassification.execute(this, passState);\n }\n\n if (usePostProcess) {\n view.sceneFramebuffer.prepareColorTextures(context);\n let inputFramebuffer = sceneFramebuffer;\n if (useGlobeDepthFramebuffer && !useOIT) {\n inputFramebuffer = globeFramebuffer;\n }\n\n const postProcess = this.postProcessStages;\n const colorTexture = inputFramebuffer.getColorTexture(0);\n const idTexture = idFramebuffer.getColorTexture(0);\n const depthTexture = defaultValue(\n globeFramebuffer,\n sceneFramebuffer\n ).getDepthStencilTexture();\n postProcess.execute(context, colorTexture, depthTexture, idTexture);\n postProcess.copy(context, defaultFramebuffer);\n }\n\n if (!useOIT && !usePostProcess && useGlobeDepthFramebuffer) {\n passState.framebuffer = defaultFramebuffer;\n globeDepth.executeCopyColor(context, passState);\n }\n};\n\nfunction callAfterRenderFunctions(scene) {\n // Functions are queued up during primitive update and executed here in case\n // the function modifies scene state that should remain constant over the frame.\n const functions = scene._frameState.afterRender;\n for (let i = 0, length = functions.length; i < length; ++i) {\n functions[i]();\n scene.requestRender();\n }\n\n functions.length = 0;\n}\n\nfunction getGlobeHeight(scene) {\n const globe = scene._globe;\n const camera = scene.camera;\n const cartographic = camera.positionCartographic;\n if (defined(globe) && globe.show && defined(cartographic)) {\n return globe.getHeight(cartographic);\n }\n return undefined;\n}\n\nfunction isCameraUnderground(scene) {\n const camera = scene.camera;\n const mode = scene._mode;\n const globe = scene.globe;\n const cameraController = scene._screenSpaceCameraController;\n const cartographic = camera.positionCartographic;\n\n if (!defined(cartographic)) {\n return false;\n }\n\n if (!cameraController.onMap() && cartographic.height < 0.0) {\n // The camera can go off the map while in Columbus View.\n // Make a best guess as to whether it's underground by checking if its height is less than zero.\n return true;\n }\n\n if (\n !defined(globe) ||\n !globe.show ||\n mode === SceneMode.SCENE2D ||\n mode === SceneMode.MORPHING\n ) {\n return false;\n }\n\n const globeHeight = scene._globeHeight;\n return defined(globeHeight) && cartographic.height < globeHeight;\n}\n\n/**\n * @private\n */\nScene.prototype.initializeFrame = function () {\n // Destroy released shaders and textures once every 120 frames to avoid thrashing the cache\n if (this._shaderFrameCount++ === 120) {\n this._shaderFrameCount = 0;\n this._context.shaderCache.destroyReleasedShaderPrograms();\n this._context.textureCache.destroyReleasedTextures();\n }\n\n this._tweens.update();\n\n this._globeHeight = getGlobeHeight(this);\n this._cameraUnderground = isCameraUnderground(this);\n this._globeTranslucencyState.update(this);\n\n this._screenSpaceCameraController.update();\n if (defined(this._deviceOrientationCameraController)) {\n this._deviceOrientationCameraController.update();\n }\n\n this.camera.update(this._mode);\n this.camera._updateCameraChanged();\n};\n\nfunction updateDebugShowFramesPerSecond(scene, renderedThisFrame) {\n if (scene.debugShowFramesPerSecond) {\n if (!defined(scene._performanceDisplay)) {\n const performanceContainer = document.createElement(\"div\");\n performanceContainer.className =\n \"cesium-performanceDisplay-defaultContainer\";\n const container = scene._canvas.parentNode;\n container.appendChild(performanceContainer);\n const performanceDisplay = new PerformanceDisplay({\n container: performanceContainer,\n });\n scene._performanceDisplay = performanceDisplay;\n scene._performanceContainer = performanceContainer;\n }\n\n scene._performanceDisplay.throttled = scene.requestRenderMode;\n scene._performanceDisplay.update(renderedThisFrame);\n } else if (defined(scene._performanceDisplay)) {\n scene._performanceDisplay =\n scene._performanceDisplay && scene._performanceDisplay.destroy();\n scene._performanceContainer.parentNode.removeChild(\n scene._performanceContainer\n );\n }\n}\n\nfunction prePassesUpdate(scene) {\n scene._jobScheduler.resetBudgets();\n\n const frameState = scene._frameState;\n const primitives = scene.primitives;\n primitives.prePassesUpdate(frameState);\n\n if (defined(scene.globe)) {\n scene.globe.update(frameState);\n }\n\n scene._picking.update();\n frameState.creditDisplay.update();\n}\n\nfunction postPassesUpdate(scene) {\n const frameState = scene._frameState;\n const primitives = scene.primitives;\n primitives.postPassesUpdate(frameState);\n\n RequestScheduler.update();\n}\n\nconst scratchBackgroundColor = new Color();\n\nfunction render(scene) {\n const frameState = scene._frameState;\n\n const context = scene.context;\n const us = context.uniformState;\n\n const view = scene._defaultView;\n scene._view = view;\n\n scene.updateFrameState();\n frameState.passes.render = true;\n frameState.passes.postProcess = scene.postProcessStages.hasSelected;\n frameState.tilesetPassState = renderTilesetPassState;\n\n let backgroundColor = defaultValue(scene.backgroundColor, Color.BLACK);\n if (scene._hdr) {\n backgroundColor = Color.clone(backgroundColor, scratchBackgroundColor);\n backgroundColor.red = Math.pow(backgroundColor.red, scene.gamma);\n backgroundColor.green = Math.pow(backgroundColor.green, scene.gamma);\n backgroundColor.blue = Math.pow(backgroundColor.blue, scene.gamma);\n }\n frameState.backgroundColor = backgroundColor;\n\n scene.fog.update(frameState);\n\n us.update(frameState);\n\n const shadowMap = scene.shadowMap;\n if (defined(shadowMap) && shadowMap.enabled) {\n if (!defined(scene.light) || scene.light instanceof SunLight) {\n // Negate the sun direction so that it is from the Sun, not to the Sun\n Cartesian3.negate(us.sunDirectionWC, scene._shadowMapCamera.direction);\n } else {\n Cartesian3.clone(scene.light.direction, scene._shadowMapCamera.direction);\n }\n frameState.shadowMaps.push(shadowMap);\n }\n\n scene._computeCommandList.length = 0;\n scene._overlayCommandList.length = 0;\n\n const viewport = view.viewport;\n viewport.x = 0;\n viewport.y = 0;\n viewport.width = context.drawingBufferWidth;\n viewport.height = context.drawingBufferHeight;\n\n const passState = view.passState;\n passState.framebuffer = undefined;\n passState.blendingEnabled = undefined;\n passState.scissorTest = undefined;\n passState.viewport = BoundingRectangle.clone(viewport, passState.viewport);\n\n if (defined(scene.globe)) {\n scene.globe.beginFrame(frameState);\n }\n\n scene.updateEnvironment();\n scene.updateAndExecuteCommands(passState, backgroundColor);\n scene.resolveFramebuffers(passState);\n\n passState.framebuffer = undefined;\n executeOverlayCommands(scene, passState);\n\n if (defined(scene.globe)) {\n scene.globe.endFrame(frameState);\n\n if (!scene.globe.tilesLoaded) {\n scene._renderRequested = true;\n }\n }\n\n context.endFrame();\n}\n\nfunction tryAndCatchError(scene, functionToExecute) {\n try {\n functionToExecute(scene);\n } catch (error) {\n scene._renderError.raiseEvent(scene, error);\n\n if (scene.rethrowRenderErrors) {\n throw error;\n }\n }\n}\n\nfunction updateMostDetailedRayPicks(scene) {\n return scene._picking.updateMostDetailedRayPicks(scene);\n}\n\n/**\n * Update and render the scene. It is usually not necessary to call this function\n * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.\n * @param {JulianDate} [time] The simulation time at which to render.\n */\nScene.prototype.render = function (time) {\n /**\n *\n * Pre passes update. Execute any pass invariant code that should run before the passes here.\n *\n */\n this._preUpdate.raiseEvent(this, time);\n\n const frameState = this._frameState;\n frameState.newFrame = false;\n\n if (!defined(time)) {\n time = JulianDate.now();\n }\n\n // Determine if shouldRender\n const cameraChanged = this._view.checkForCameraUpdates(this);\n let shouldRender =\n !this.requestRenderMode ||\n this._renderRequested ||\n cameraChanged ||\n this._logDepthBufferDirty ||\n this._hdrDirty ||\n this.mode === SceneMode.MORPHING;\n if (\n !shouldRender &&\n defined(this.maximumRenderTimeChange) &&\n defined(this._lastRenderTime)\n ) {\n const difference = Math.abs(\n JulianDate.secondsDifference(this._lastRenderTime, time)\n );\n shouldRender = shouldRender || difference > this.maximumRenderTimeChange;\n }\n\n if (shouldRender) {\n this._lastRenderTime = JulianDate.clone(time, this._lastRenderTime);\n this._renderRequested = false;\n this._logDepthBufferDirty = false;\n this._hdrDirty = false;\n\n const frameNumber = CesiumMath.incrementWrap(\n frameState.frameNumber,\n 15000000.0,\n 1.0\n );\n updateFrameNumber(this, frameNumber, time);\n frameState.newFrame = true;\n }\n\n tryAndCatchError(this, prePassesUpdate);\n\n /**\n *\n * Passes update. Add any passes here\n *\n */\n if (this.primitives.show) {\n tryAndCatchError(this, updateMostDetailedRayPicks);\n tryAndCatchError(this, updatePreloadPass);\n tryAndCatchError(this, updatePreloadFlightPass);\n if (!shouldRender) {\n tryAndCatchError(this, updateRequestRenderModeDeferCheckPass);\n }\n }\n\n this._postUpdate.raiseEvent(this, time);\n\n if (shouldRender) {\n this._preRender.raiseEvent(this, time);\n frameState.creditDisplay.beginFrame();\n tryAndCatchError(this, render);\n }\n\n /**\n *\n * Post passes update. Execute any pass invariant code that should run after the passes here.\n *\n */\n updateDebugShowFramesPerSecond(this, shouldRender);\n tryAndCatchError(this, postPassesUpdate);\n\n // Often used to trigger events (so don't want in trycatch) that the user might be subscribed to. Things like the tile load events, ready promises, etc.\n // We don't want those events to resolve during the render loop because the events might add new primitives\n callAfterRenderFunctions(this);\n\n if (shouldRender) {\n this._postRender.raiseEvent(this, time);\n frameState.creditDisplay.endFrame();\n }\n};\n\n/**\n * Update and render the scene. Always forces a new render frame regardless of whether a render was\n * previously requested.\n * @param {JulianDate} [time] The simulation time at which to render.\n *\n * @private\n */\nScene.prototype.forceRender = function (time) {\n this._renderRequested = true;\n this.render(time);\n};\n\n/**\n * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.\n * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.\n *\n * @see Scene#requestRenderMode\n */\nScene.prototype.requestRender = function () {\n this._renderRequested = true;\n};\n\n/**\n * @private\n */\nScene.prototype.clampLineWidth = function (width) {\n return Math.max(\n ContextLimits.minimumAliasedLineWidth,\n Math.min(width, ContextLimits.maximumAliasedLineWidth)\n );\n};\n\n/**\n * Returns an object with a `primitive` property that contains the first (top) primitive in the scene\n * at a particular window coordinate or undefined if nothing is at the location. Other properties may\n * potentially be set depending on the type of primitive and may be used to further identify the picked object.\n * <p>\n * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.\n * </p>\n *\n * @example\n * // On mouse over, color the feature yellow.\n * handler.setInputAction(function(movement) {\n * const feature = scene.pick(movement.endPosition);\n * if (feature instanceof Cesium.Cesium3DTileFeature) {\n * feature.color = Cesium.Color.YELLOW;\n * }\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Number} [width=3] Width of the pick rectangle.\n * @param {Number} [height=3] Height of the pick rectangle.\n * @returns {Object} Object containing the picked primitive.\n */\nScene.prototype.pick = function (windowPosition, width, height) {\n return this._picking.pick(this, windowPosition, width, height);\n};\n\n/**\n * Returns the cartesian position reconstructed from the depth buffer and window position.\n * The returned position is in world coordinates. Used internally by camera functions to\n * prevent conversion to projected 2D coordinates and then back.\n * <p>\n * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of\n * translucent primitives; otherwise, this essentially picks through translucent primitives.\n * </p>\n *\n * @private\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Cartesian3} [result] The object on which to restore the result.\n * @returns {Cartesian3} The cartesian position in world coordinates.\n *\n * @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.\n */\nScene.prototype.pickPositionWorldCoordinates = function (\n windowPosition,\n result\n) {\n return this._picking.pickPositionWorldCoordinates(\n this,\n windowPosition,\n result\n );\n};\n\n/**\n * Returns the cartesian position reconstructed from the depth buffer and window position.\n * <p>\n * The position reconstructed from the depth buffer in 2D may be slightly different from those\n * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution\n * of depth values of perspective and orthographic projection.\n * </p>\n * <p>\n * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of\n * translucent primitives; otherwise, this essentially picks through translucent primitives.\n * </p>\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Cartesian3} [result] The object on which to restore the result.\n * @returns {Cartesian3} The cartesian position.\n *\n * @exception {DeveloperError} Picking from the depth buffer is not supported. Check pickPositionSupported.\n */\nScene.prototype.pickPosition = function (windowPosition, result) {\n return this._picking.pickPosition(this, windowPosition, result);\n};\n\n/**\n * Returns a list of objects, each containing a `primitive` property, for all primitives at\n * a particular window coordinate position. Other properties may also be set depending on the\n * type of primitive and may be used to further identify the picked object. The primitives in\n * the list are ordered by their visual order in the scene (front to back).\n *\n * @param {Cartesian2} windowPosition Window coordinates to perform picking on.\n * @param {Number} [limit] If supplied, stop drilling after collecting this many picks.\n * @param {Number} [width=3] Width of the pick rectangle.\n * @param {Number} [height=3] Height of the pick rectangle.\n * @returns {Array.<*>} Array of objects, each containing 1 picked primitives.\n *\n * @exception {DeveloperError} windowPosition is undefined.\n *\n * @example\n * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));\n *\n * @see Scene#pick\n */\nScene.prototype.drillPick = function (windowPosition, limit, width, height) {\n return this._picking.drillPick(this, windowPosition, limit, width, height);\n};\n\nfunction updatePreloadPass(scene) {\n const frameState = scene._frameState;\n preloadTilesetPassState.camera = frameState.camera;\n preloadTilesetPassState.cullingVolume = frameState.cullingVolume;\n\n const primitives = scene.primitives;\n primitives.updateForPass(frameState, preloadTilesetPassState);\n}\n\nfunction updatePreloadFlightPass(scene) {\n const frameState = scene._frameState;\n const camera = frameState.camera;\n if (!camera.canPreloadFlight()) {\n return;\n }\n\n preloadFlightTilesetPassState.camera = scene.preloadFlightCamera;\n preloadFlightTilesetPassState.cullingVolume =\n scene.preloadFlightCullingVolume;\n\n const primitives = scene.primitives;\n primitives.updateForPass(frameState, preloadFlightTilesetPassState);\n}\n\nfunction updateRequestRenderModeDeferCheckPass(scene) {\n // Check if any ignored requests are ready to go (to wake rendering up again)\n scene.primitives.updateForPass(\n scene._frameState,\n requestRenderModeDeferCheckPassState\n );\n}\n\n/**\n * Returns an object containing the first object intersected by the ray and the position of intersection,\n * or <code>undefined</code> if there were no intersections. The intersected object has a <code>primitive</code>\n * property that contains the intersected primitive. Other properties may be set depending on the type of primitive\n * and may be used to further identify the picked object. The ray must be given in world coordinates.\n * <p>\n * This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other\n * primitives regardless of their visibility.\n * </p>\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Object} An object containing the object and position of the first intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.pickFromRay = function (ray, objectsToExclude, width) {\n return this._picking.pickFromRay(this, ray, objectsToExclude, width);\n};\n\n/**\n * Returns a list of objects, each containing the object intersected by the ray and the position of intersection.\n * The intersected object has a <code>primitive</code> property that contains the intersected primitive. Other\n * properties may also be set depending on the type of primitive and may be used to further identify the picked object.\n * The primitives in the list are ordered by first intersection to last intersection. The ray must be given in\n * world coordinates.\n * <p>\n * This function only picks globe tiles and 3D Tiles that are rendered in the current view. Picks all other\n * primitives regardless of their visibility.\n * </p>\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Object[]} List of objects containing the object and position of each intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.drillPickFromRay = function (\n ray,\n limit,\n objectsToExclude,\n width\n) {\n return this._picking.drillPickFromRay(\n this,\n ray,\n limit,\n objectsToExclude,\n width\n );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#pickFromRay} request using the maximum level of detail for 3D Tilesets\n * regardless of visibility.\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise.<Object>} A promise that resolves to an object containing the object and position of the first intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.pickFromRayMostDetailed = function (\n ray,\n objectsToExclude,\n width\n) {\n return this._picking.pickFromRayMostDetailed(\n this,\n ray,\n objectsToExclude,\n width\n );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#drillPickFromRay} request using the maximum level of detail for 3D Tilesets\n * regardless of visibility.\n *\n * @private\n *\n * @param {Ray} ray The ray.\n * @param {Number} [limit=Number.MAX_VALUE] If supplied, stop finding intersections after this many intersections.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to exclude from the ray intersection.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise.<Object[]>} A promise that resolves to a list of objects containing the object and position of each intersection.\n *\n * @exception {DeveloperError} Ray intersections are only supported in 3D mode.\n */\nScene.prototype.drillPickFromRayMostDetailed = function (\n ray,\n limit,\n objectsToExclude,\n width\n) {\n return this._picking.drillPickFromRayMostDetailed(\n this,\n ray,\n limit,\n objectsToExclude,\n width\n );\n};\n\n/**\n * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no\n * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to\n * the globe, 3D Tiles, or primitives in the scene.\n * <p>\n * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height\n * from all other primitives regardless of their visibility.\n * </p>\n *\n * @param {Cartographic} position The cartographic position to sample height from.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Number} The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.\n *\n * @example\n * const position = new Cesium.Cartographic(-1.31968, 0.698874);\n * const height = viewer.scene.sampleHeight(position);\n * console.log(height);\n *\n * @see Scene#clampToHeight\n * @see Scene#clampToHeightMostDetailed\n * @see Scene#sampleHeightMostDetailed\n *\n * @exception {DeveloperError} sampleHeight is only supported in 3D mode.\n * @exception {DeveloperError} sampleHeight requires depth texture support. Check sampleHeightSupported.\n */\nScene.prototype.sampleHeight = function (position, objectsToExclude, width) {\n return this._picking.sampleHeight(this, position, objectsToExclude, width);\n};\n\n/**\n * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the\n * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp\n * objects to the globe, 3D Tiles, or primitives in the scene.\n * <p>\n * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to\n * all other primitives regardless of their visibility.\n * </p>\n *\n * @param {Cartesian3} cartesian The cartesian position.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @param {Cartesian3} [result] An optional object to return the clamped position.\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to.\n *\n * @example\n * // Clamp an entity to the underlying scene geometry\n * const position = entity.position.getValue(Cesium.JulianDate.now());\n * entity.position = viewer.scene.clampToHeight(position);\n *\n * @see Scene#sampleHeight\n * @see Scene#sampleHeightMostDetailed\n * @see Scene#clampToHeightMostDetailed\n *\n * @exception {DeveloperError} clampToHeight is only supported in 3D mode.\n * @exception {DeveloperError} clampToHeight requires depth texture support. Check clampToHeightSupported.\n */\nScene.prototype.clampToHeight = function (\n cartesian,\n objectsToExclude,\n width,\n result\n) {\n return this._picking.clampToHeight(\n this,\n cartesian,\n objectsToExclude,\n width,\n result\n );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions\n * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.\n * Returns a promise that is resolved when the query completes. Each point height is modified in place.\n * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,\n * the height is set to undefined.\n *\n * @param {Cartographic[]} positions The cartographic positions to update with sampled heights.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when the query has completed.\n *\n * @example\n * const positions = [\n * new Cesium.Cartographic(-1.31968, 0.69887),\n * new Cesium.Cartographic(-1.10489, 0.83923)\n * ];\n * const promise = viewer.scene.sampleHeightMostDetailed(positions);\n * promise.then(function(updatedPosition) {\n * // positions[0].height and positions[1].height have been updated.\n * // updatedPositions is just a reference to positions.\n * }\n *\n * @see Scene#sampleHeight\n *\n * @exception {DeveloperError} sampleHeightMostDetailed is only supported in 3D mode.\n * @exception {DeveloperError} sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.\n */\nScene.prototype.sampleHeightMostDetailed = function (\n positions,\n objectsToExclude,\n width\n) {\n return this._picking.sampleHeightMostDetailed(\n this,\n positions,\n objectsToExclude,\n width\n );\n};\n\n/**\n * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions\n * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when\n * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry\n * can be sampled at that location, or another error occurs, the element in the array is set to undefined.\n *\n * @param {Cartesian3[]} cartesians The cartesian positions to update with clamped positions.\n * @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not clamp to.\n * @param {Number} [width=0.1] Width of the intersection volume in meters.\n * @returns {Promise.<Cartesian3[]>} A promise that resolves to the provided list of positions when the query has completed.\n *\n * @example\n * const cartesians = [\n * entities[0].position.getValue(Cesium.JulianDate.now()),\n * entities[1].position.getValue(Cesium.JulianDate.now())\n * ];\n * const promise = viewer.scene.clampToHeightMostDetailed(cartesians);\n * promise.then(function(updatedCartesians) {\n * entities[0].position = updatedCartesians[0];\n * entities[1].position = updatedCartesians[1];\n * }\n *\n * @see Scene#clampToHeight\n *\n * @exception {DeveloperError} clampToHeightMostDetailed is only supported in 3D mode.\n * @exception {DeveloperError} clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.\n */\nScene.prototype.clampToHeightMostDetailed = function (\n cartesians,\n objectsToExclude,\n width\n) {\n return this._picking.clampToHeightMostDetailed(\n this,\n cartesians,\n objectsToExclude,\n width\n );\n};\n\n/**\n * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an\n * HTML element at the same screen position as an object in the scene.\n *\n * @param {Cartesian3} position The position in cartesian coordinates.\n * @param {Cartesian2} [result] An optional object to return the input position transformed to canvas coordinates.\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.\n *\n * @example\n * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.\n * const scene = widget.scene;\n * const ellipsoid = scene.globe.ellipsoid;\n * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\n * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n * handler.setInputAction(function(movement) {\n * console.log(scene.cartesianToCanvasCoordinates(position));\n * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);\n */\nScene.prototype.cartesianToCanvasCoordinates = function (position, result) {\n return SceneTransforms.wgs84ToWindowCoordinates(this, position, result);\n};\n\n/**\n * Instantly completes an active transition.\n */\nScene.prototype.completeMorph = function () {\n this._transitioner.completeMorph();\n};\n\n/**\n * Asynchronously transitions the scene to 2D.\n * @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphTo2D = function (duration) {\n let ellipsoid;\n const globe = this.globe;\n if (defined(globe)) {\n ellipsoid = globe.ellipsoid;\n } else {\n ellipsoid = this.mapProjection.ellipsoid;\n }\n duration = defaultValue(duration, 2.0);\n this._transitioner.morphTo2D(duration, ellipsoid);\n};\n\n/**\n * Asynchronously transitions the scene to Columbus View.\n * @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphToColumbusView = function (duration) {\n let ellipsoid;\n const globe = this.globe;\n if (defined(globe)) {\n ellipsoid = globe.ellipsoid;\n } else {\n ellipsoid = this.mapProjection.ellipsoid;\n }\n duration = defaultValue(duration, 2.0);\n this._transitioner.morphToColumbusView(duration, ellipsoid);\n};\n\n/**\n * Asynchronously transitions the scene to 3D.\n * @param {Number} [duration=2.0] The amount of time, in seconds, for transition animations to complete.\n */\nScene.prototype.morphTo3D = function (duration) {\n let ellipsoid;\n const globe = this.globe;\n if (defined(globe)) {\n ellipsoid = globe.ellipsoid;\n } else {\n ellipsoid = this.mapProjection.ellipsoid;\n }\n duration = defaultValue(duration, 2.0);\n this._transitioner.morphTo3D(duration, ellipsoid);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Scene#destroy\n */\nScene.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * scene = scene && scene.destroy();\n *\n * @see Scene#isDestroyed\n */\nScene.prototype.destroy = function () {\n this._tweens.removeAll();\n this._computeEngine = this._computeEngine && this._computeEngine.destroy();\n this._screenSpaceCameraController =\n this._screenSpaceCameraController &&\n this._screenSpaceCameraController.destroy();\n this._deviceOrientationCameraController =\n this._deviceOrientationCameraController &&\n !this._deviceOrientationCameraController.isDestroyed() &&\n this._deviceOrientationCameraController.destroy();\n this._primitives = this._primitives && this._primitives.destroy();\n this._groundPrimitives =\n this._groundPrimitives && this._groundPrimitives.destroy();\n this._globe = this._globe && this._globe.destroy();\n this.skyBox = this.skyBox && this.skyBox.destroy();\n this.skyAtmosphere = this.skyAtmosphere && this.skyAtmosphere.destroy();\n this._debugSphere = this._debugSphere && this._debugSphere.destroy();\n this.sun = this.sun && this.sun.destroy();\n this._sunPostProcess = this._sunPostProcess && this._sunPostProcess.destroy();\n this._depthPlane = this._depthPlane && this._depthPlane.destroy();\n this._transitioner = this._transitioner && this._transitioner.destroy();\n this._debugFrustumPlanes =\n this._debugFrustumPlanes && this._debugFrustumPlanes.destroy();\n this._brdfLutGenerator =\n this._brdfLutGenerator && this._brdfLutGenerator.destroy();\n this._picking = this._picking && this._picking.destroy();\n\n this._defaultView = this._defaultView && this._defaultView.destroy();\n this._view = undefined;\n\n if (this._removeCreditContainer) {\n this._canvas.parentNode.removeChild(this._creditContainer);\n }\n\n this.postProcessStages =\n this.postProcessStages && this.postProcessStages.destroy();\n\n this._context = this._context && this._context.destroy();\n this._frameState.creditDisplay =\n this._frameState.creditDisplay && this._frameState.creditDisplay.destroy();\n\n if (defined(this._performanceDisplay)) {\n this._performanceDisplay =\n this._performanceDisplay && this._performanceDisplay.destroy();\n this._performanceContainer.parentNode.removeChild(\n this._performanceContainer\n );\n }\n\n this._removeRequestListenerCallback();\n this._removeTaskProcessorListenerCallback();\n for (let i = 0; i < this._removeGlobeCallbacks.length; ++i) {\n this._removeGlobeCallbacks[i]();\n }\n this._removeGlobeCallbacks.length = 0;\n\n return destroyObject(this);\n};\nexport default Scene;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport AtmosphereCommon from \"../Shaders/AtmosphereCommon.js\";\nimport SkyAtmosphereCommon from \"../Shaders/SkyAtmosphereCommon.js\";\nimport SkyAtmosphereFS from \"../Shaders/SkyAtmosphereFS.js\";\nimport SkyAtmosphereVS from \"../Shaders/SkyAtmosphereVS.js\";\nimport Axis from \"./Axis.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport CullFace from \"./CullFace.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * An atmosphere drawn around the limb of the provided ellipsoid. Based on\n * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}.\n * <p>\n * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.\n * </p>\n *\n * @alias SkyAtmosphere\n * @constructor\n *\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that the atmosphere is drawn around.\n *\n * @example\n * scene.skyAtmosphere = new Cesium.SkyAtmosphere();\n *\n * @see Scene.skyAtmosphere\n */\nfunction SkyAtmosphere(ellipsoid) {\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\n\n /**\n * Determines if the atmosphere is shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = true;\n\n /**\n * Compute atmosphere per-fragment instead of per-vertex.\n * This produces better looking atmosphere with a slight performance penalty.\n *\n * @type {Boolean}\n * @default false\n */\n this.perFragmentAtmosphere = false;\n\n this._ellipsoid = ellipsoid;\n\n const outerEllipsoidScale = 1.025;\n const scaleVector = Cartesian3.multiplyByScalar(\n ellipsoid.radii,\n outerEllipsoidScale,\n new Cartesian3()\n );\n this._scaleMatrix = Matrix4.fromScale(scaleVector);\n this._modelMatrix = new Matrix4();\n\n this._command = new DrawCommand({\n owner: this,\n modelMatrix: this._modelMatrix,\n });\n this._spSkyFromSpace = undefined;\n this._spSkyFromAtmosphere = undefined;\n\n this._flags = undefined;\n\n /**\n * The intensity of the light that is used for computing the sky atmosphere color.\n *\n * @type {Number}\n * @default 50.0\n */\n this.atmosphereLightIntensity = 50.0;\n\n /**\n * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.\n *\n * @type {Cartesian3}\n * @default Cartesian3(5.5e-6, 13.0e-6, 28.4e-6)\n */\n this.atmosphereRayleighCoefficient = new Cartesian3(5.5e-6, 13.0e-6, 28.4e-6);\n\n /**\n * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.\n *\n * @type {Cartesian3}\n * @default Cartesian3(21e-6, 21e-6, 21e-6)\n */\n this.atmosphereMieCoefficient = new Cartesian3(21e-6, 21e-6, 21e-6);\n\n /**\n * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.\n *\n * @type {Number}\n * @default 10000.0\n */\n this.atmosphereRayleighScaleHeight = 10000.0;\n\n /**\n * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.\n *\n * @type {Number}\n * @default 3200.0\n */\n this.atmosphereMieScaleHeight = 3200.0;\n\n /**\n * The anisotropy of the medium to consider for Mie scattering.\n * <p>\n * Valid values are between -1.0 and 1.0.\n * </p>\n * @type {Number}\n * @default 0.9\n */\n this.atmosphereMieAnisotropy = 0.9;\n\n /**\n * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A hue shift of 1.0 indicates a complete rotation of the hues available.\n * @type {Number}\n * @default 0.0\n */\n this.hueShift = 0.0;\n\n /**\n * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A saturation shift of -1.0 is monochrome.\n * @type {Number}\n * @default 0.0\n */\n this.saturationShift = 0.0;\n\n /**\n * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).\n * A brightness shift of -1.0 is complete darkness, which will let space show through.\n * @type {Number}\n * @default 0.0\n */\n this.brightnessShift = 0.0;\n\n this._hueSaturationBrightness = new Cartesian3();\n\n // outer radius, inner radius, dynamic atmosphere color flag\n const radiiAndDynamicAtmosphereColor = new Cartesian3();\n\n radiiAndDynamicAtmosphereColor.x =\n ellipsoid.maximumRadius * outerEllipsoidScale;\n radiiAndDynamicAtmosphereColor.y = ellipsoid.maximumRadius;\n\n // Toggles whether the sun position is used. 0 treats the sun as always directly overhead.\n radiiAndDynamicAtmosphereColor.z = 0;\n\n this._radiiAndDynamicAtmosphereColor = radiiAndDynamicAtmosphereColor;\n\n const that = this;\n\n this._command.uniformMap = {\n u_radiiAndDynamicAtmosphereColor: function () {\n return that._radiiAndDynamicAtmosphereColor;\n },\n u_hsbShift: function () {\n that._hueSaturationBrightness.x = that.hueShift;\n that._hueSaturationBrightness.y = that.saturationShift;\n that._hueSaturationBrightness.z = that.brightnessShift;\n return that._hueSaturationBrightness;\n },\n u_atmosphereLightIntensity: function () {\n return that.atmosphereLightIntensity;\n },\n u_atmosphereRayleighCoefficient: function () {\n return that.atmosphereRayleighCoefficient;\n },\n u_atmosphereMieCoefficient: function () {\n return that.atmosphereMieCoefficient;\n },\n u_atmosphereRayleighScaleHeight: function () {\n return that.atmosphereRayleighScaleHeight;\n },\n u_atmosphereMieScaleHeight: function () {\n return that.atmosphereMieScaleHeight;\n },\n u_atmosphereMieAnisotropy: function () {\n return that.atmosphereMieAnisotropy;\n },\n };\n}\n\nObject.defineProperties(SkyAtmosphere.prototype, {\n /**\n * Gets the ellipsoid the atmosphere is drawn around.\n * @memberof SkyAtmosphere.prototype\n *\n * @type {Ellipsoid}\n * @readonly\n */\n ellipsoid: {\n get: function () {\n return this._ellipsoid;\n },\n },\n});\n\n/**\n * @private\n */\nSkyAtmosphere.prototype.setDynamicAtmosphereColor = function (\n enableLighting,\n useSunDirection\n) {\n const lightEnum = enableLighting ? (useSunDirection ? 2.0 : 1.0) : 0.0;\n this._radiiAndDynamicAtmosphereColor.z = lightEnum;\n};\n\nconst scratchModelMatrix = new Matrix4();\n\n/**\n * @private\n */\nSkyAtmosphere.prototype.update = function (frameState, globe) {\n if (!this.show) {\n return undefined;\n }\n\n const mode = frameState.mode;\n if (mode !== SceneMode.SCENE3D && mode !== SceneMode.MORPHING) {\n return undefined;\n }\n\n // The atmosphere is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc.\n if (!frameState.passes.render) {\n return undefined;\n }\n\n // Align the ellipsoid geometry so it always faces the same direction as the\n // camera to reduce artifacts when rendering atmosphere per-vertex\n const rotationMatrix = Matrix4.fromRotationTranslation(\n frameState.context.uniformState.inverseViewRotation,\n Cartesian3.ZERO,\n scratchModelMatrix\n );\n const rotationOffsetMatrix = Matrix4.multiplyTransformation(\n rotationMatrix,\n Axis.Y_UP_TO_Z_UP,\n scratchModelMatrix\n );\n const modelMatrix = Matrix4.multiply(\n this._scaleMatrix,\n rotationOffsetMatrix,\n scratchModelMatrix\n );\n Matrix4.clone(modelMatrix, this._modelMatrix);\n\n const context = frameState.context;\n\n const colorCorrect = hasColorCorrection(this);\n const translucent = frameState.globeTranslucencyState.translucent;\n const perFragmentAtmosphere =\n this.perFragmentAtmosphere || translucent || !defined(globe) || !globe.show;\n\n const command = this._command;\n\n if (!defined(command.vertexArray)) {\n const geometry = EllipsoidGeometry.createGeometry(\n new EllipsoidGeometry({\n radii: new Cartesian3(1.0, 1.0, 1.0),\n slicePartitions: 256,\n stackPartitions: 256,\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n command.vertexArray = VertexArray.fromGeometry({\n context: context,\n geometry: geometry,\n attributeLocations: GeometryPipeline.createAttributeLocations(geometry),\n bufferUsage: BufferUsage.STATIC_DRAW,\n });\n command.renderState = RenderState.fromCache({\n cull: {\n enabled: true,\n face: CullFace.FRONT,\n },\n blending: BlendingState.ALPHA_BLEND,\n depthMask: false,\n });\n }\n\n const flags =\n colorCorrect | (perFragmentAtmosphere << 2) | (translucent << 3);\n\n if (flags !== this._flags) {\n this._flags = flags;\n\n const defines = [];\n\n if (colorCorrect) {\n defines.push(\"COLOR_CORRECT\");\n }\n\n if (perFragmentAtmosphere) {\n defines.push(\"PER_FRAGMENT_ATMOSPHERE\");\n }\n\n if (translucent) {\n defines.push(\"GLOBE_TRANSLUCENT\");\n }\n\n const vs = new ShaderSource({\n defines: defines,\n sources: [AtmosphereCommon, SkyAtmosphereCommon, SkyAtmosphereVS],\n });\n\n const fs = new ShaderSource({\n defines: defines,\n sources: [AtmosphereCommon, SkyAtmosphereCommon, SkyAtmosphereFS],\n });\n\n this._spSkyAtmosphere = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: vs,\n fragmentShaderSource: fs,\n });\n\n command.shaderProgram = this._spSkyAtmosphere;\n }\n\n return command;\n};\n\nfunction hasColorCorrection(skyAtmosphere) {\n return !(\n CesiumMath.equalsEpsilon(\n skyAtmosphere.hueShift,\n 0.0,\n CesiumMath.EPSILON7\n ) &&\n CesiumMath.equalsEpsilon(\n skyAtmosphere.saturationShift,\n 0.0,\n CesiumMath.EPSILON7\n ) &&\n CesiumMath.equalsEpsilon(\n skyAtmosphere.brightnessShift,\n 0.0,\n CesiumMath.EPSILON7\n )\n );\n}\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see SkyAtmosphere#destroy\n */\nSkyAtmosphere.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();\n *\n * @see SkyAtmosphere#isDestroyed\n */\nSkyAtmosphere.prototype.destroy = function () {\n const command = this._command;\n command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n this._spSkyAtmosphere =\n this._spSkyAtmosphere && this._spSkyAtmosphere.destroy();\n return destroyObject(this);\n};\nexport default SkyAtmosphere;\n", "import BoxGeometry from \"../Core/BoxGeometry.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport VertexFormat from \"../Core/VertexFormat.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport CubeMap from \"../Renderer/CubeMap.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport loadCubeMap from \"../Renderer/loadCubeMap.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport SkyBoxFS from \"../Shaders/SkyBoxFS.js\";\nimport SkyBoxVS from \"../Shaders/SkyBoxVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport SceneMode from \"./SceneMode.js\";\n\n/**\n * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.\n * <p>\n * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of\n * the sky box must not exceed {@link Scene#maximumCubeMapSize}.\n * </p>\n *\n * @alias SkyBox\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Object} [options.sources] The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.\n * @param {Boolean} [options.show=true] Determines if this primitive will be shown.\n *\n *\n * @example\n * scene.skyBox = new Cesium.SkyBox({\n * sources : {\n * positiveX : 'skybox_px.png',\n * negativeX : 'skybox_nx.png',\n * positiveY : 'skybox_py.png',\n * negativeY : 'skybox_ny.png',\n * positiveZ : 'skybox_pz.png',\n * negativeZ : 'skybox_nz.png'\n * }\n * });\n *\n * @see Scene#skyBox\n * @see Transforms.computeTemeToPseudoFixedMatrix\n */\nfunction SkyBox(options) {\n /**\n * The sources used to create the cube map faces: an object\n * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,\n * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.\n * These can be either URLs or <code>Image</code> objects.\n *\n * @type Object\n * @default undefined\n */\n this.sources = options.sources;\n this._sources = undefined;\n\n /**\n * Determines if the sky box will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n this._command = new DrawCommand({\n modelMatrix: Matrix4.clone(Matrix4.IDENTITY),\n owner: this,\n });\n this._cubeMap = undefined;\n\n this._attributeLocations = undefined;\n this._useHdr = undefined;\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.\n * @exception {DeveloperError} this.sources properties must all be the same type.\n */\nSkyBox.prototype.update = function (frameState, useHdr) {\n const that = this;\n\n if (!this.show) {\n return undefined;\n }\n\n if (\n frameState.mode !== SceneMode.SCENE3D &&\n frameState.mode !== SceneMode.MORPHING\n ) {\n return undefined;\n }\n\n // The sky box is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc.\n if (!frameState.passes.render) {\n return undefined;\n }\n\n const context = frameState.context;\n\n if (this._sources !== this.sources) {\n this._sources = this.sources;\n const sources = this.sources;\n\n if (typeof sources.positiveX === \"string\") {\n // Given urls for cube-map images. Load them.\n loadCubeMap(context, this._sources).then(function (cubeMap) {\n that._cubeMap = that._cubeMap && that._cubeMap.destroy();\n that._cubeMap = cubeMap;\n });\n } else {\n this._cubeMap = this._cubeMap && this._cubeMap.destroy();\n this._cubeMap = new CubeMap({\n context: context,\n source: sources,\n });\n }\n }\n\n const command = this._command;\n\n if (!defined(command.vertexArray)) {\n command.uniformMap = {\n u_cubeMap: function () {\n return that._cubeMap;\n },\n };\n\n const geometry = BoxGeometry.createGeometry(\n BoxGeometry.fromDimensions({\n dimensions: new Cartesian3(2.0, 2.0, 2.0),\n vertexFormat: VertexFormat.POSITION_ONLY,\n })\n );\n const attributeLocations = (this._attributeLocations = GeometryPipeline.createAttributeLocations(\n geometry\n ));\n\n command.vertexArray = VertexArray.fromGeometry({\n context: context,\n geometry: geometry,\n attributeLocations: attributeLocations,\n bufferUsage: BufferUsage.STATIC_DRAW,\n });\n\n command.renderState = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n });\n }\n\n if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {\n const fs = new ShaderSource({\n defines: [useHdr ? \"HDR\" : \"\"],\n sources: [SkyBoxFS],\n });\n command.shaderProgram = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: SkyBoxVS,\n fragmentShaderSource: fs,\n attributeLocations: this._attributeLocations,\n });\n this._useHdr = useHdr;\n }\n\n if (!defined(this._cubeMap)) {\n return undefined;\n }\n\n return command;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see SkyBox#destroy\n */\nSkyBox.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * skyBox = skyBox && skyBox.destroy();\n *\n * @see SkyBox#isDestroyed\n */\nSkyBox.prototype.destroy = function () {\n const command = this._command;\n command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n command.shaderProgram =\n command.shaderProgram && command.shaderProgram.destroy();\n this._cubeMap = this._cubeMap && this._cubeMap.destroy();\n return destroyObject(this);\n};\nexport default SkyBox;\n", "import Cartesian3 from \"../Core/Cartesian3.js\";\nimport Check from \"../Core/Check.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport CesiumMath from \"../Core/Math.js\";\n\n/**\n * A ParticleEmitter that emits particles within a sphere.\n * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.\n *\n * @alias SphereEmitter\n * @constructor\n *\n * @param {Number} [radius=1.0] The radius of the sphere in meters.\n */\nfunction SphereEmitter(radius) {\n radius = defaultValue(radius, 1.0);\n\n this._radius = defaultValue(radius, 1.0);\n}\n\nObject.defineProperties(SphereEmitter.prototype, {\n /**\n * The radius of the sphere in meters.\n * @memberof SphereEmitter.prototype\n * @type {Number}\n * @default 1.0\n */\n radius: {\n get: function () {\n return this._radius;\n },\n set: function (value) {\nthis._radius = value;\n },\n },\n});\n\n/**\n * Initializes the given {Particle} by setting it's position and velocity.\n *\n * @private\n * @param {Particle} particle The particle to initialize\n */\nSphereEmitter.prototype.emit = function (particle) {\n const theta = CesiumMath.randomBetween(0.0, CesiumMath.TWO_PI);\n const phi = CesiumMath.randomBetween(0.0, CesiumMath.PI);\n const rad = CesiumMath.randomBetween(0.0, this._radius);\n\n const x = rad * Math.cos(theta) * Math.sin(phi);\n const y = rad * Math.sin(theta) * Math.sin(phi);\n const z = rad * Math.cos(phi);\n\n particle.position = Cartesian3.fromElements(x, y, z, particle.position);\n particle.velocity = Cartesian3.normalize(\n particle.position,\n particle.velocity\n );\n};\nexport default SphereEmitter;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * An expression for a style applied to a {@link Cesium3DTileset}.\n * <p>\n * Derived classes of this interface evaluate expressions in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.\n * </p>\n * <p>\n * This type describes an interface and is not intended to be instantiated directly.\n * </p>\n *\n * @alias StyleExpression\n * @constructor\n *\n * @see Expression\n * @see ConditionsExpression\n */\nfunction StyleExpression() {}\n\n/**\n * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of\n * the expression in the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript\n * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>\n * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,\n * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is\n * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Object} [result] The object onto which to store the result.\n * @returns {Boolean|Number|String|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.\n */\nStyleExpression.prototype.evaluate = function (feature, result) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Evaluates the result of a Color expression, optionally using the provided feature's properties.\n * <p>\n * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.\n * </p>\n *\n * @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.\n * @param {Color} [result] The object in which to store the result.\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\n */\nStyleExpression.prototype.evaluateColor = function (feature, result) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Gets the shader function for this expression.\n * Returns undefined if the shader function can't be generated from this expression.\n *\n * @param {String} functionSignature Signature of the generated function.\n * @param {Object} variableSubstitutionMap Maps variable names to shader variable names.\n * @param {Object} shaderState Stores information about the generated shader function, including whether it is translucent.\n * @param {String} returnType The return type of the generated function.\n *\n * @returns {String} The shader function.\n *\n * @private\n */\nStyleExpression.prototype.getShaderFunction = function (\n functionSignature,\n variableSubstitutionMap,\n shaderState,\n returnType\n) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Gets the variables used by the expression.\n *\n * @returns {String[]} The variables used by the expression.\n *\n * @private\n */\nStyleExpression.prototype.getVariables = function () {\n DeveloperError.throwInstantiationError();\n};\n\nexport default StyleExpression;\n", "import BoundingSphere from \"../Core/BoundingSphere.js\";\nimport Cartesian2 from \"../Core/Cartesian2.js\";\nimport Cartesian3 from \"../Core/Cartesian3.js\";\nimport Cartesian4 from \"../Core/Cartesian4.js\";\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport PixelFormat from \"../Core/PixelFormat.js\";\nimport PrimitiveType from \"../Core/PrimitiveType.js\";\nimport Buffer from \"../Renderer/Buffer.js\";\nimport BufferUsage from \"../Renderer/BufferUsage.js\";\nimport ComputeCommand from \"../Renderer/ComputeCommand.js\";\nimport DrawCommand from \"../Renderer/DrawCommand.js\";\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderProgram from \"../Renderer/ShaderProgram.js\";\nimport Texture from \"../Renderer/Texture.js\";\nimport VertexArray from \"../Renderer/VertexArray.js\";\nimport SunFS from \"../Shaders/SunFS.js\";\nimport SunTextureFS from \"../Shaders/SunTextureFS.js\";\nimport SunVS from \"../Shaders/SunVS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport SceneTransforms from \"./SceneTransforms.js\";\n\n/**\n * Draws a sun billboard.\n * <p>This is only supported in 3D and Columbus view.</p>\n *\n * @alias Sun\n * @constructor\n *\n *\n * @example\n * scene.sun = new Cesium.Sun();\n *\n * @see Scene#sun\n */\nfunction Sun() {\n /**\n * Determines if the sun will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = true;\n\n this._drawCommand = new DrawCommand({\n primitiveType: PrimitiveType.TRIANGLES,\n boundingVolume: new BoundingSphere(),\n owner: this,\n });\n this._commands = {\n drawCommand: this._drawCommand,\n computeCommand: undefined,\n };\n this._boundingVolume = new BoundingSphere();\n this._boundingVolume2D = new BoundingSphere();\n\n this._texture = undefined;\n this._drawingBufferWidth = undefined;\n this._drawingBufferHeight = undefined;\n this._radiusTS = undefined;\n this._size = undefined;\n\n this.glowFactor = 1.0;\n this._glowFactorDirty = false;\n\n this._useHdr = undefined;\n\n const that = this;\n this._uniformMap = {\n u_texture: function () {\n return that._texture;\n },\n u_size: function () {\n return that._size;\n },\n };\n}\n\nObject.defineProperties(Sun.prototype, {\n /**\n * Gets or sets a number that controls how \"bright\" the Sun's lens flare appears\n * to be. Zero shows just the Sun's disc without any flare.\n * Use larger values for a more pronounced flare around the Sun.\n *\n * @memberof Sun.prototype\n * @type {Number}\n * @default 1.0\n */\n glowFactor: {\n get: function () {\n return this._glowFactor;\n },\n set: function (glowFactor) {\n glowFactor = Math.max(glowFactor, 0.0);\n this._glowFactor = glowFactor;\n this._glowFactorDirty = true;\n },\n },\n});\n\nconst scratchPositionWC = new Cartesian2();\nconst scratchLimbWC = new Cartesian2();\nconst scratchPositionEC = new Cartesian4();\nconst scratchCartesian4 = new Cartesian4();\n\n/**\n * @private\n */\nSun.prototype.update = function (frameState, passState, useHdr) {\n if (!this.show) {\n return undefined;\n }\n\n const mode = frameState.mode;\n if (mode === SceneMode.SCENE2D || mode === SceneMode.MORPHING) {\n return undefined;\n }\n\n if (!frameState.passes.render) {\n return undefined;\n }\n\n const context = frameState.context;\n const drawingBufferWidth = passState.viewport.width;\n const drawingBufferHeight = passState.viewport.height;\n\n if (\n !defined(this._texture) ||\n drawingBufferWidth !== this._drawingBufferWidth ||\n drawingBufferHeight !== this._drawingBufferHeight ||\n this._glowFactorDirty ||\n useHdr !== this._useHdr\n ) {\n this._texture = this._texture && this._texture.destroy();\n this._drawingBufferWidth = drawingBufferWidth;\n this._drawingBufferHeight = drawingBufferHeight;\n this._glowFactorDirty = false;\n this._useHdr = useHdr;\n\n let size = Math.max(drawingBufferWidth, drawingBufferHeight);\n size = Math.pow(2.0, Math.ceil(Math.log(size) / Math.log(2.0)) - 2.0);\n\n // The size computed above can be less than 1.0 if size < 4.0. This will probably\n // never happen in practice, but does in the tests. Clamp to 1.0 to prevent WebGL\n // errors in the tests.\n size = Math.max(1.0, size);\n\n const pixelDatatype = useHdr\n ? context.halfFloatingPointTexture\n ? PixelDatatype.HALF_FLOAT\n : PixelDatatype.FLOAT\n : PixelDatatype.UNSIGNED_BYTE;\n this._texture = new Texture({\n context: context,\n width: size,\n height: size,\n pixelFormat: PixelFormat.RGBA,\n pixelDatatype: pixelDatatype,\n });\n\n this._glowLengthTS = this._glowFactor * 5.0;\n this._radiusTS = (1.0 / (1.0 + 2.0 * this._glowLengthTS)) * 0.5;\n\n const that = this;\n const uniformMap = {\n u_radiusTS: function () {\n return that._radiusTS;\n },\n };\n\n this._commands.computeCommand = new ComputeCommand({\n fragmentShaderSource: SunTextureFS,\n outputTexture: this._texture,\n uniformMap: uniformMap,\n persists: false,\n owner: this,\n postExecute: function () {\n that._commands.computeCommand = undefined;\n },\n });\n }\n\n const drawCommand = this._drawCommand;\n\n if (!defined(drawCommand.vertexArray)) {\n const attributeLocations = {\n direction: 0,\n };\n\n const directions = new Uint8Array(4 * 2);\n directions[0] = 0;\n directions[1] = 0;\n\n directions[2] = 255;\n directions[3] = 0.0;\n\n directions[4] = 255;\n directions[5] = 255;\n\n directions[6] = 0.0;\n directions[7] = 255;\n\n const vertexBuffer = Buffer.createVertexBuffer({\n context: context,\n typedArray: directions,\n usage: BufferUsage.STATIC_DRAW,\n });\n const attributes = [\n {\n index: attributeLocations.direction,\n vertexBuffer: vertexBuffer,\n componentsPerAttribute: 2,\n normalize: true,\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\n },\n ];\n // Workaround Internet Explorer 11.0.8 lack of TRIANGLE_FAN\n const indexBuffer = Buffer.createIndexBuffer({\n context: context,\n typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),\n usage: BufferUsage.STATIC_DRAW,\n indexDatatype: IndexDatatype.UNSIGNED_SHORT,\n });\n drawCommand.vertexArray = new VertexArray({\n context: context,\n attributes: attributes,\n indexBuffer: indexBuffer,\n });\n\n drawCommand.shaderProgram = ShaderProgram.fromCache({\n context: context,\n vertexShaderSource: SunVS,\n fragmentShaderSource: SunFS,\n attributeLocations: attributeLocations,\n });\n\n drawCommand.renderState = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n });\n drawCommand.uniformMap = this._uniformMap;\n }\n\n const sunPosition = context.uniformState.sunPositionWC;\n const sunPositionCV = context.uniformState.sunPositionColumbusView;\n\n const boundingVolume = this._boundingVolume;\n const boundingVolume2D = this._boundingVolume2D;\n\n Cartesian3.clone(sunPosition, boundingVolume.center);\n boundingVolume2D.center.x = sunPositionCV.z;\n boundingVolume2D.center.y = sunPositionCV.x;\n boundingVolume2D.center.z = sunPositionCV.y;\n\n boundingVolume.radius =\n CesiumMath.SOLAR_RADIUS + CesiumMath.SOLAR_RADIUS * this._glowLengthTS;\n boundingVolume2D.radius = boundingVolume.radius;\n\n if (mode === SceneMode.SCENE3D) {\n BoundingSphere.clone(boundingVolume, drawCommand.boundingVolume);\n } else if (mode === SceneMode.COLUMBUS_VIEW) {\n BoundingSphere.clone(boundingVolume2D, drawCommand.boundingVolume);\n }\n\n const position = SceneTransforms.computeActualWgs84Position(\n frameState,\n sunPosition,\n scratchCartesian4\n );\n\n const dist = Cartesian3.magnitude(\n Cartesian3.subtract(position, frameState.camera.position, scratchCartesian4)\n );\n const projMatrix = context.uniformState.projection;\n\n const positionEC = scratchPositionEC;\n positionEC.x = 0;\n positionEC.y = 0;\n positionEC.z = -dist;\n positionEC.w = 1;\n\n const positionCC = Matrix4.multiplyByVector(\n projMatrix,\n positionEC,\n scratchCartesian4\n );\n const positionWC = SceneTransforms.clipToGLWindowCoordinates(\n passState.viewport,\n positionCC,\n scratchPositionWC\n );\n\n positionEC.x = CesiumMath.SOLAR_RADIUS;\n const limbCC = Matrix4.multiplyByVector(\n projMatrix,\n positionEC,\n scratchCartesian4\n );\n const limbWC = SceneTransforms.clipToGLWindowCoordinates(\n passState.viewport,\n limbCC,\n scratchLimbWC\n );\n\n this._size = Cartesian2.magnitude(\n Cartesian2.subtract(limbWC, positionWC, scratchCartesian4)\n );\n this._size = 2.0 * this._size * (1.0 + 2.0 * this._glowLengthTS);\n this._size = Math.ceil(this._size);\n\n return this._commands;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see Sun#destroy\n */\nSun.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * sun = sun && sun.destroy();\n *\n * @see Sun#isDestroyed\n */\nSun.prototype.destroy = function () {\n const command = this._drawCommand;\n command.vertexArray = command.vertexArray && command.vertexArray.destroy();\n command.shaderProgram =\n command.shaderProgram && command.shaderProgram.destroy();\n\n this._texture = this._texture && this._texture.destroy();\n\n return destroyObject(this);\n};\nexport default Sun;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * Defines a bounding volume for a tile. This type describes an interface\n * and is not intended to be instantiated directly.\n *\n * @alias TileBoundingVolume\n * @constructor\n *\n * @see TileBoundingRegion\n * @see TileBoundingSphere\n * @see TileOrientedBoundingBox\n *\n * @private\n */\nfunction TileBoundingVolume() {}\n\n/**\n * The underlying bounding volume.\n *\n * @type {Object}\n * @readonly\n */\nTileBoundingVolume.prototype.boundingVolume = undefined;\n\n/**\n * The underlying bounding sphere.\n *\n * @type {BoundingSphere}\n * @readonly\n */\nTileBoundingVolume.prototype.boundingSphere = undefined;\n\n/**\n * Calculates the distance between the tile and the camera.\n *\n * @param {FrameState} frameState The frame state.\n * @return {Number} The distance between the tile and the camera, in meters.\n * Returns 0.0 if the camera is inside the tile.\n */\nTileBoundingVolume.prototype.distanceToCamera = function (frameState) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Determines which side of a plane this volume is located.\n *\n * @param {Plane} plane The plane to test against.\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire volume is on the side of the plane\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire volume is\n * on the opposite side, and {@link Intersect.INTERSECTING} if the volume\n * intersects the plane.\n */\nTileBoundingVolume.prototype.intersectPlane = function (plane) {\n DeveloperError.throwInstantiationError();\n};\n\n/**\n * Creates a debug primitive that shows the outline of the tile bounding\n * volume.\n *\n * @param {Color} color The desired color of the primitive's mesh\n * @return {Primitive}\n */\nTileBoundingVolume.prototype.createDebugVolume = function (color) {\n DeveloperError.throwInstantiationError();\n};\nexport default TileBoundingVolume;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\n/**\n * @typedef {Object} TileCoordinatesImageryProvider.ConstructorOptions\n *\n * Initialization options for the TileCoordinatesImageryProvider constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Color} [color=Color.YELLOW] The color to draw the tile box and label.\n * @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n */\n\n/**\n * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws\n * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for\n * debugging terrain and imagery rendering problems.\n *\n * @alias TileCoordinatesImageryProvider\n * @constructor\n *\n * @param {TileCoordinatesImageryProvider.ConstructorOptions} [options] Object describing initialization options\n */\nfunction TileCoordinatesImageryProvider(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n this._color = defaultValue(options.color, Color.YELLOW);\n this._errorEvent = new Event();\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n this._readyPromise = Promise.resolve(true);\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n}\n\nObject.defineProperties(TileCoordinatesImageryProvider.prototype, {\n /**\n * Gets the proxy used by this provider.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage\n * and texture upload time.\n * @memberof TileCoordinatesImageryProvider.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nTileCoordinatesImageryProvider.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nTileCoordinatesImageryProvider.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext(\"2d\");\n\n const cssColor = this._color.toCssColorString();\n\n context.strokeStyle = cssColor;\n context.lineWidth = 2;\n context.strokeRect(1, 1, 255, 255);\n\n context.font = \"bold 25px Arial\";\n context.textAlign = \"center\";\n context.fillStyle = cssColor;\n context.fillText(`L: ${level}`, 124, 86);\n context.fillText(`X: ${x}`, 124, 136);\n context.fillText(`Y: ${y}`, 124, 186);\n\n return Promise.resolve(canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nTileCoordinatesImageryProvider.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default TileCoordinatesImageryProvider;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\n/**\n * @typedef {Object} TileCoordinatesImageryProviderFlw.ConstructorOptions\n *\n * Initialization options for the TileCoordinatesImageryProviderFlw constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Color} [color=Color.YELLOW] The color to draw the tile box and label.\n * @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n */\n\n/**\n * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws\n * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for\n * debugging terrain and imagery rendering problems.\n *\n * @alias TileCoordinatesImageryProviderFlw\n * @constructor\n *\n * @param {TileCoordinatesImageryProviderFlw.ConstructorOptions} [options] Object describing initialization options\n */\nfunction TileCoordinatesImageryProviderFlw(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n this._color = defaultValue(options.color, Color.YELLOW);\n this._errorEvent = new Event();\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n this._readyPromise = Promise.resolve(true);\n this._type = 'flw'\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n}\n\nObject.defineProperties(TileCoordinatesImageryProviderFlw.prototype, {\n /**\n * Gets the proxy used by this provider.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage\n * and texture upload time.\n * @memberof TileCoordinatesImageryProviderFlw.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nTileCoordinatesImageryProviderFlw.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link TileCoordinatesImageryProviderFlw#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nTileCoordinatesImageryProviderFlw.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext(\"2d\");\n\n const cssColor = this._color.toCssColorString();\n\n context.strokeStyle = cssColor;\n context.lineWidth = 2;\n context.strokeRect(1, 1, 255, 255);\n\n \n context.font = `24px Arial`;\n context.textAlign = \"center\";\n context.fillStyle = cssColor;\n // context.fillText(`L: ${level}`, 124, 86);\n // context.fillText(`X: ${x}`, 124, 136);\n // context.fillText(`Y: ${y}`, 124, 186);\n let rectangle = this._tilingScheme.tileXYToNativeRectangle(x,y,level)\n let point1 = Cesium.Cartesian3.fromDegrees(rectangle.west, rectangle.south)\n let point2 = Cesium.Cartesian3.fromDegrees(rectangle.east, rectangle.south)\n let point3 = Cesium.Cartesian3.fromDegrees(rectangle.west, rectangle.north)\n let width = Number(Cesium.Cartesian3.distance(point1, point2).toFixed(2));\n let height = Number(Cesium.Cartesian3.distance(point1, point3).toFixed(2));\n let w_unit = 'm'\n let h_unit = 'm'\n if(width>=1000) {\n width = Number((width / 1000).toFixed(2))\n w_unit = '\u339E'\n }\n if(height>=1000) {\n height = Number((height / 1000).toFixed(2))\n h_unit = '\u339E'\n }\n context.fillText(`${width} ${w_unit}`, 124, 246);\n context.textAlign = \"left\";\n context.fillText(`${height} ${h_unit}`, 14, 136);\n\n return Promise.resolve(canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nTileCoordinatesImageryProviderFlw.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default TileCoordinatesImageryProviderFlw;\n", "import Color from \"../Core/Color.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport Event from \"../Core/Event.js\";\nimport GeographicTilingScheme from \"../Core/GeographicTilingScheme.js\";\n\n/**\n * @typedef {Object} TileCoordinatesImageryProviderJww.ConstructorOptions\n *\n * Initialization options for the TileCoordinatesImageryProviderJww constructor\n *\n * @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.\n * @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,\n * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither\n * parameter is specified, the WGS84 ellipsoid is used.\n * @property {Color} [color=Color.YELLOW] The color to draw the tile box and label.\n * @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.\n * @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.\n */\n\n/**\n * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws\n * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for\n * debugging terrain and imagery rendering problems.\n *\n * @alias TileCoordinatesImageryProviderJww\n * @constructor\n *\n * @param {TileCoordinatesImageryProviderJww.ConstructorOptions} [options] Object describing initialization options\n */\nfunction TileCoordinatesImageryProviderJww(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n this._tilingScheme = defined(options.tilingScheme)\n ? options.tilingScheme\n : new GeographicTilingScheme({ ellipsoid: options.ellipsoid });\n this._color = defaultValue(options.color, Color.YELLOW);\n this._errorEvent = new Event();\n this._tileWidth = defaultValue(options.tileWidth, 256);\n this._tileHeight = defaultValue(options.tileHeight, 256);\n this._readyPromise = Promise.resolve(true);\n this._type = 'jww'\n\n /**\n * The default alpha blending value of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultAlpha = undefined;\n\n /**\n * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultNightAlpha = undefined;\n\n /**\n * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and\n * 1.0 representing fully opaque.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultDayAlpha = undefined;\n\n /**\n * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0\n * makes the imagery darker while greater than 1.0 makes it brighter.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultBrightness = undefined;\n\n /**\n * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces\n * the contrast while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultContrast = undefined;\n\n /**\n * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultHue = undefined;\n\n /**\n * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the\n * saturation while greater than 1.0 increases it.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultSaturation = undefined;\n\n /**\n * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.defaultGamma = undefined;\n\n /**\n * The default texture minification filter to apply to this provider.\n *\n * @type {TextureMinificationFilter}\n * @default undefined\n */\n this.defaultMinificationFilter = undefined;\n\n /**\n * The default texture magnification filter to apply to this provider.\n *\n * @type {TextureMagnificationFilter}\n * @default undefined\n */\n this.defaultMagnificationFilter = undefined;\n}\n\nObject.defineProperties(TileCoordinatesImageryProviderJww.prototype, {\n /**\n * Gets the proxy used by this provider.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Proxy}\n * @readonly\n */\n proxy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the width of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Number}\n * @readonly\n */\n tileWidth: {\n get: function () {\n return this._tileWidth;\n },\n },\n\n /**\n * Gets the height of each tile, in pixels. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Number}\n * @readonly\n */\n tileHeight: {\n get: function () {\n return this._tileHeight;\n },\n },\n\n /**\n * Gets the maximum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Number|undefined}\n * @readonly\n */\n maximumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the minimum level-of-detail that can be requested. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Number}\n * @readonly\n */\n minimumLevel: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets the tiling scheme used by this provider. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {TilingScheme}\n * @readonly\n */\n tilingScheme: {\n get: function () {\n return this._tilingScheme;\n },\n },\n\n /**\n * Gets the rectangle, in radians, of the imagery provided by this instance. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Rectangle}\n * @readonly\n */\n rectangle: {\n get: function () {\n return this._tilingScheme.rectangle;\n },\n },\n\n /**\n * Gets the tile discard policy. If not undefined, the discard policy is responsible\n * for filtering out \"missing\" tiles via its shouldDiscardImage function. If this function\n * returns undefined, no tiles are filtered. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {TileDiscardPolicy}\n * @readonly\n */\n tileDiscardPolicy: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\n * are passed an instance of {@link TileProviderError}.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Event}\n * @readonly\n */\n errorEvent: {\n get: function () {\n return this._errorEvent;\n },\n },\n\n /**\n * Gets a value indicating whether or not the provider is ready for use.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Boolean}\n * @readonly\n */\n ready: {\n get: function () {\n return true;\n },\n },\n\n /**\n * Gets a promise that resolves to true when the provider is ready for use.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Promise.<Boolean>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n\n /**\n * Gets the credit to display when this imagery provider is active. Typically this is used to credit\n * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Credit}\n * @readonly\n */\n credit: {\n get: function () {\n return undefined;\n },\n },\n\n /**\n * Gets a value indicating whether or not the images provided by this imagery provider\n * include an alpha channel. If this property is false, an alpha channel, if present, will\n * be ignored. If this property is true, any images without an alpha channel will be treated\n * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage\n * and texture upload time.\n * @memberof TileCoordinatesImageryProviderJww.prototype\n * @type {Boolean}\n * @readonly\n */\n hasAlphaChannel: {\n get: function () {\n return true;\n },\n },\n});\n\n/**\n * Gets the credits to be displayed when a given tile is displayed.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level;\n * @returns {Credit[]} The credits to be displayed when the tile is displayed.\n *\n * @exception {DeveloperError} <code>getTileCredits</code> must not be called before the imagery provider is ready.\n */\nTileCoordinatesImageryProviderJww.prototype.getTileCredits = function (\n x,\n y,\n level\n) {\n return undefined;\n};\n\n/**\n * Requests the image for a given tile. This function should\n * not be called before {@link TileCoordinatesImageryProviderJww#ready} returns true.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Request} [request] The request object. Intended for internal use only.\n * @returns {Promise.<HTMLCanvasElement>} The resolved image as a Canvas DOM object.\n */\nTileCoordinatesImageryProviderJww.prototype.requestImage = function (\n x,\n y,\n level,\n request\n) {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext(\"2d\");\n\n const cssColor = this._color.toCssColorString();\n\n context.strokeStyle = cssColor;\n context.lineWidth = 2;\n context.strokeRect(1, 1, 255, 255);\n\n\n context.font = `24px Arial`;\n context.textAlign = \"center\";\n context.fillStyle = cssColor;\n // context.fillText(`L: ${level}`, 124, 86);\n // context.fillText(`X: ${x}`, 124, 136);\n // context.fillText(`Y: ${y}`, 124, 186);\n let rectangle = this._tilingScheme.tileXYToNativeRectangle(x, y, level)\n if ((x % 2) &&(y % 2)) {\n context.fillText(`${rectangle.south < 0 ? 'S' : 'N'} ${Math.abs(Number(rectangle.south.toFixed(1)))}\u00B0`, 124, 246);\n // context.textAlign = \"left\";\n // context.fillText(`${rectangle.west < 0 ? 'W' : 'E'} ${Math.abs(Number(rectangle.west.toFixed(2)))}\u00B0`, 14, 136);\n }\n if (!(x % 2) &&!(y % 2)) {\n // context.fillText(`${rectangle.south < 0 ? 'S' : 'N'} ${Math.abs(Number(rectangle.south.toFixed(2)))}\u00B0`, 124, 246);\n context.textAlign = \"left\";\n context.fillText(`${rectangle.west < 0 ? 'W' : 'E'} ${Math.abs(Number(rectangle.west.toFixed(1)))}\u00B0`, 14, 136);\n }\n // if (!(y % 2)) {\n // context.textAlign = \"left\";\n // context.fillText(`${rectangle.west < 0 ? 'W' : 'E'} ${Math.abs(Number(rectangle.west.toFixed(2)))}\u00B0`, 14, 136);\n // }\n\n\n return Promise.resolve(canvas);\n};\n\n/**\n * Picking features is not currently supported by this imagery provider, so this function simply returns\n * undefined.\n *\n * @param {Number} x The tile X coordinate.\n * @param {Number} y The tile Y coordinate.\n * @param {Number} level The tile level.\n * @param {Number} longitude The longitude at which to pick features.\n * @param {Number} latitude The latitude at which to pick features.\n * @return {undefined} Undefined since picking is not supported.\n */\nTileCoordinatesImageryProviderJww.prototype.pickFeatures = function (\n x,\n y,\n level,\n longitude,\n latitude\n) {\n return undefined;\n};\nexport default TileCoordinatesImageryProviderJww;\n", "import DeveloperError from \"../Core/DeveloperError.js\";\n\n/**\n * A policy for discarding tile images according to some criteria. This type describes an\n * interface and is not intended to be instantiated directly.\n *\n * @alias TileDiscardPolicy\n * @constructor\n *\n * @see DiscardMissingTileImagePolicy\n * @see NeverTileDiscardPolicy\n */\nfunction TileDiscardPolicy(options) {\n DeveloperError.throwInstantiationError();\n}\n\n/**\n * Determines if the discard policy is ready to process images.\n * @function\n *\n * @returns {Boolean} True if the discard policy is ready to process images; otherwise, false.\n */\nTileDiscardPolicy.prototype.isReady = DeveloperError.throwInstantiationError;\n\n/**\n * Given a tile image, decide whether to discard that image.\n * @function\n *\n * @param {HTMLImageElement} image An image to test.\n * @returns {Boolean} True if the image should be discarded; otherwise, false.\n */\nTileDiscardPolicy.prototype.shouldDiscardImage =\n DeveloperError.throwInstantiationError;\nexport default TileDiscardPolicy;\n", "/**\n * @private\n */\nconst TileState = {\n START: 0,\n LOADING: 1,\n READY: 2,\n UPSAMPLED_ONLY: 3,\n};\nexport default Object.freeze(TileState);\n", "import Check from \"../Core/Check.js\";\nimport combine from \"../Core/combine.js\";\nimport defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport Event from \"../Core/Event.js\";\nimport getTimestamp from \"../Core/getTimestamp.js\";\nimport JulianDate from \"../Core/JulianDate.js\";\nimport CesiumMath from \"../Core/Math.js\";\nimport Matrix4 from \"../Core/Matrix4.js\";\nimport Resource from \"../Core/Resource.js\";\nimport ClippingPlaneCollection from \"./ClippingPlaneCollection.js\";\nimport PointCloud from \"./PointCloud.js\";\nimport PointCloudEyeDomeLighting from \"./PointCloudEyeDomeLighting.js\";\nimport PointCloudShading from \"./PointCloudShading.js\";\nimport SceneMode from \"./SceneMode.js\";\nimport ShadowMode from \"./ShadowMode.js\";\n\n/**\n * Provides playback of time-dynamic point cloud data.\n * <p>\n * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.\n * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently\n * small or the clock is sufficiently slow then no frames will be skipped.\n * </p>\n *\n * @alias TimeDynamicPointCloud\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Clock} options.clock A {@link Clock} instance that is used when determining the value for the time dimension.\n * @param {TimeIntervalCollection} options.intervals A {@link TimeIntervalCollection} with its data property being an object containing a <code>uri</code> to a 3D Tiles Point Cloud tile and an optional <code>transform</code>.\n * @param {Boolean} [options.show=true] Determines if the point cloud will be shown.\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] A 4x4 transformation matrix that transforms the point cloud.\n * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the point cloud casts or receives shadows from light sources.\n * @param {Number} [options.maximumMemoryUsage=256] The maximum amount of memory in MB that can be used by the point cloud.\n * @param {Object} [options.shading] Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.\n * @param {Cesium3DTileStyle} [options.style] The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud.\n * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.\n */\nfunction TimeDynamicPointCloud(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * Determines if the point cloud will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = defaultValue(options.show, true);\n\n /**\n * A 4x4 transformation matrix that transforms the point cloud.\n *\n * @type {Matrix4}\n * @default Matrix4.IDENTITY\n */\n this.modelMatrix = Matrix4.clone(\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\n );\n\n /**\n * Determines whether the point cloud casts or receives shadows from light sources.\n * <p>\n * Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view.\n * </p>\n * <p>\n * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.\n * </p>\n *\n * @type {ShadowMode}\n * @default ShadowMode.ENABLED\n */\n this.shadows = defaultValue(options.shadows, ShadowMode.ENABLED);\n\n /**\n * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.\n * <p>\n * Frames that are not being loaded or rendered are unloaded to enforce this.\n * </p>\n * <p>\n * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.\n * </p>\n *\n * @type {Number}\n * @default 256\n *\n * @see TimeDynamicPointCloud#totalMemoryUsageInBytes\n */\n this.maximumMemoryUsage = defaultValue(options.maximumMemoryUsage, 256);\n\n /**\n * Options for controlling point size based on geometric error and eye dome lighting.\n * @type {PointCloudShading}\n */\n this.shading = new PointCloudShading(options.shading);\n\n /**\n * The style, defined using the\n * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},\n * applied to each point in the point cloud.\n * <p>\n * Assign <code>undefined</code> to remove the style, which will restore the visual\n * appearance of the point cloud to its default when no style was applied.\n * </p>\n *\n * @type {Cesium3DTileStyle}\n *\n * @example\n * pointCloud.style = new Cesium.Cesium3DTileStyle({\n * color : {\n * conditions : [\n * ['${Classification} === 0', 'color(\"purple\", 0.5)'],\n * ['${Classification} === 1', 'color(\"red\")'],\n * ['true', '${COLOR}']\n * ]\n * },\n * show : '${Classification} !== 2'\n * });\n *\n * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}\n */\n this.style = options.style;\n\n /**\n * The event fired to indicate that a frame failed to load. A frame may fail to load if the\n * request for its uri fails or processing fails due to invalid content.\n * <p>\n * If there are no event listeners, error messages will be logged to the console.\n * </p>\n * <p>\n * The error object passed to the listener contains two properties:\n * <ul>\n * <li><code>uri</code>: the uri of the failed frame.</li>\n * <li><code>message</code>: the error message.</li>\n * </ul>\n *\n * @type {Event}\n * @default new Event()\n *\n * @example\n * pointCloud.frameFailed.addEventListener(function(error) {\n * console.log(`An error occurred loading frame: ${error.uri}`);\n * console.log(`Error: ${error.message}`);\n * });\n */\n this.frameFailed = new Event();\n\n /**\n * The event fired to indicate that a new frame was rendered.\n * <p>\n * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.\n * </p>\n * @type {Event}\n * @default new Event()\n *\n * @example\n * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {\n * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);\n * });\n */\n this.frameChanged = new Event();\n\n this._clock = options.clock;\n this._intervals = options.intervals;\n this._clippingPlanes = undefined;\n this.clippingPlanes = options.clippingPlanes; // Call setter\n this._pointCloudEyeDomeLighting = new PointCloudEyeDomeLighting();\n this._loadTimestamp = undefined;\n this._clippingPlanesState = 0;\n this._styleDirty = false;\n this._pickId = undefined;\n this._totalMemoryUsageInBytes = 0;\n this._frames = [];\n this._previousInterval = undefined;\n this._nextInterval = undefined;\n this._lastRenderedFrame = undefined;\n this._clockMultiplier = 0.0;\n this._resolveReadyPromise = undefined;\n const that = this;\n this._readyPromise = new Promise(function (resolve) {\n that._resolveReadyPromise = resolve;\n });\n\n // For calculating average load time of the last N frames\n this._runningSum = 0.0;\n this._runningLength = 0;\n this._runningIndex = 0;\n this._runningSamples = new Array(5).fill(0.0);\n this._runningAverage = 0.0;\n}\n\nObject.defineProperties(TimeDynamicPointCloud.prototype, {\n /**\n * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.\n *\n * @memberof TimeDynamicPointCloud.prototype\n *\n * @type {ClippingPlaneCollection}\n */\n clippingPlanes: {\n get: function () {\n return this._clippingPlanes;\n },\n set: function (value) {\n ClippingPlaneCollection.setOwner(value, this, \"_clippingPlanes\");\n },\n },\n\n /**\n * The total amount of GPU memory in bytes used by the point cloud.\n *\n * @memberof TimeDynamicPointCloud.prototype\n *\n * @type {Number}\n * @readonly\n *\n * @see TimeDynamicPointCloud#maximumMemoryUsage\n */\n totalMemoryUsageInBytes: {\n get: function () {\n return this._totalMemoryUsageInBytes;\n },\n },\n\n /**\n * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.\n *\n * @memberof TimeDynamicPointCloud.prototype\n *\n * @type {BoundingSphere}\n * @readonly\n */\n boundingSphere: {\n get: function () {\n if (defined(this._lastRenderedFrame)) {\n return this._lastRenderedFrame.pointCloud.boundingSphere;\n }\n return undefined;\n },\n },\n\n /**\n * Gets the promise that will be resolved when the point cloud renders a frame for the first time.\n *\n * @memberof TimeDynamicPointCloud.prototype\n *\n * @type {Promise.<TimeDynamicPointCloud>}\n * @readonly\n */\n readyPromise: {\n get: function () {\n return this._readyPromise;\n },\n },\n});\n\nfunction getFragmentShaderLoaded(fs) {\n return `uniform vec4 czm_pickColor;\\n${fs}`;\n}\n\nfunction getUniformMapLoaded(stream) {\n return function (uniformMap) {\n return combine(uniformMap, {\n czm_pickColor: function () {\n return stream._pickId.color;\n },\n });\n };\n}\n\nfunction getPickIdLoaded() {\n return \"czm_pickColor\";\n}\n\n/**\n * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all\n * points to re-evaluate the style in the next frame.\n */\nTimeDynamicPointCloud.prototype.makeStyleDirty = function () {\n this._styleDirty = true;\n};\n\n/**\n * Exposed for testing.\n *\n * @private\n */\nTimeDynamicPointCloud.prototype._getAverageLoadTime = function () {\n if (this._runningLength === 0) {\n // Before any frames have loaded make a best guess about the average load time\n return 0.05;\n }\n return this._runningAverage;\n};\n\nconst scratchDate = new JulianDate();\n\nfunction getClockMultiplier(that) {\n const clock = that._clock;\n const isAnimating = clock.canAnimate && clock.shouldAnimate;\n const multiplier = clock.multiplier;\n return isAnimating ? multiplier : 0.0;\n}\n\nfunction getIntervalIndex(that, interval) {\n return that._intervals.indexOf(interval.start);\n}\n\nfunction getNextInterval(that, currentInterval) {\n const intervals = that._intervals;\n const clock = that._clock;\n const multiplier = getClockMultiplier(that);\n\n if (multiplier === 0.0) {\n return undefined;\n }\n\n const averageLoadTime = that._getAverageLoadTime();\n const time = JulianDate.addSeconds(\n clock.currentTime,\n averageLoadTime * multiplier,\n scratchDate\n );\n let index = intervals.indexOf(time);\n\n const currentIndex = getIntervalIndex(that, currentInterval);\n if (index === currentIndex) {\n if (multiplier >= 0) {\n ++index;\n } else {\n --index;\n }\n }\n\n // Returns undefined if not in range\n return intervals.get(index);\n}\n\nfunction getCurrentInterval(that) {\n const intervals = that._intervals;\n const clock = that._clock;\n const time = clock.currentTime;\n const index = intervals.indexOf(time);\n\n // Returns undefined if not in range\n return intervals.get(index);\n}\n\nfunction reachedInterval(that, currentInterval, nextInterval) {\n const multiplier = getClockMultiplier(that);\n const currentIndex = getIntervalIndex(that, currentInterval);\n const nextIndex = getIntervalIndex(that, nextInterval);\n\n if (multiplier >= 0) {\n return currentIndex >= nextIndex;\n }\n return currentIndex <= nextIndex;\n}\n\nfunction handleFrameFailure(that, uri) {\n return function (error) {\n const message = defined(error.message) ? error.message : error.toString();\n if (that.frameFailed.numberOfListeners > 0) {\n that.frameFailed.raiseEvent({\n uri: uri,\n message: message,\n });\n } else {\n console.log(`A frame failed to load: ${uri}`);\n console.log(`Error: ${message}`);\n }\n };\n}\n\nfunction requestFrame(that, interval, frameState) {\n const index = getIntervalIndex(that, interval);\n const frames = that._frames;\n let frame = frames[index];\n if (!defined(frame)) {\n const transformArray = interval.data.transform;\n const transform = defined(transformArray)\n ? Matrix4.fromArray(transformArray)\n : undefined;\n const uri = interval.data.uri;\n frame = {\n pointCloud: undefined,\n transform: transform,\n timestamp: getTimestamp(),\n sequential: true,\n ready: false,\n touchedFrameNumber: frameState.frameNumber,\n };\n frames[index] = frame;\n Resource.fetchArrayBuffer({\n url: uri,\n })\n .then(function (arrayBuffer) {\n // PERFORMANCE_IDEA: share a memory pool, render states, shaders, and other resources among all\n // frames. Each frame just needs an index/offset into the pool.\n frame.pointCloud = new PointCloud({\n arrayBuffer: arrayBuffer,\n cull: true,\n fragmentShaderLoaded: getFragmentShaderLoaded,\n uniformMapLoaded: getUniformMapLoaded(that),\n pickIdLoaded: getPickIdLoaded,\n });\n return frame.pointCloud.readyPromise;\n })\n .catch(handleFrameFailure(that, uri));\n }\n return frame;\n}\n\nfunction updateAverageLoadTime(that, loadTime) {\n that._runningSum += loadTime;\n that._runningSum -= that._runningSamples[that._runningIndex];\n that._runningSamples[that._runningIndex] = loadTime;\n that._runningLength = Math.min(\n that._runningLength + 1,\n that._runningSamples.length\n );\n that._runningIndex = (that._runningIndex + 1) % that._runningSamples.length;\n that._runningAverage = that._runningSum / that._runningLength;\n}\n\nfunction prepareFrame(that, frame, updateState, frameState) {\n if (frame.touchedFrameNumber < frameState.frameNumber - 1) {\n // If this frame was not loaded in sequential updates then it can't be used it for calculating the average load time.\n // For example: selecting a frame on the timeline, selecting another frame before the request finishes, then selecting this frame later.\n frame.sequential = false;\n }\n\n const pointCloud = frame.pointCloud;\n\n if (defined(pointCloud) && !frame.ready) {\n // Call update to prepare renderer resources. Don't render anything yet.\n const commandList = frameState.commandList;\n const lengthBeforeUpdate = commandList.length;\n renderFrame(that, frame, updateState, frameState);\n\n if (pointCloud.ready) {\n // Point cloud became ready this update\n frame.ready = true;\n that._totalMemoryUsageInBytes += pointCloud.geometryByteLength;\n commandList.length = lengthBeforeUpdate; // Don't allow preparing frame to insert commands.\n if (frame.sequential) {\n // Update the values used to calculate average load time\n const loadTime = (getTimestamp() - frame.timestamp) / 1000.0;\n updateAverageLoadTime(that, loadTime);\n }\n }\n }\n\n frame.touchedFrameNumber = frameState.frameNumber;\n}\n\nconst scratchModelMatrix = new Matrix4();\n\nfunction getGeometricError(that, pointCloud) {\n const shading = that.shading;\n if (defined(shading) && defined(shading.baseResolution)) {\n return shading.baseResolution;\n } else if (defined(pointCloud.boundingSphere)) {\n return CesiumMath.cbrt(\n pointCloud.boundingSphere.volume() / pointCloud.pointsLength\n );\n }\n return 0.0;\n}\n\nfunction getMaximumAttenuation(that) {\n const shading = that.shading;\n if (defined(shading) && defined(shading.maximumAttenuation)) {\n return shading.maximumAttenuation;\n }\n\n // Return a hardcoded maximum attenuation. For a tileset this would instead be the maximum screen space error.\n return 10.0;\n}\n\nconst defaultShading = new PointCloudShading();\n\nfunction renderFrame(that, frame, updateState, frameState) {\n const shading = defaultValue(that.shading, defaultShading);\n const pointCloud = frame.pointCloud;\n const transform = defaultValue(frame.transform, Matrix4.IDENTITY);\n pointCloud.modelMatrix = Matrix4.multiplyTransformation(\n that.modelMatrix,\n transform,\n scratchModelMatrix\n );\n pointCloud.style = that.style;\n pointCloud.time = updateState.timeSinceLoad;\n pointCloud.shadows = that.shadows;\n pointCloud.clippingPlanes = that._clippingPlanes;\n pointCloud.isClipped = updateState.isClipped;\n pointCloud.attenuation = shading.attenuation;\n pointCloud.backFaceCulling = shading.backFaceCulling;\n pointCloud.normalShading = shading.normalShading;\n pointCloud.geometricError = getGeometricError(that, pointCloud);\n pointCloud.geometricErrorScale = shading.geometricErrorScale;\n pointCloud.maximumAttenuation = getMaximumAttenuation(that);\n\n pointCloud.update(frameState);\n frame.touchedFrameNumber = frameState.frameNumber;\n}\n\nfunction loadFrame(that, interval, updateState, frameState) {\n const frame = requestFrame(that, interval, frameState);\n prepareFrame(that, frame, updateState, frameState);\n}\n\nfunction getUnloadCondition(frameState) {\n return function (frame) {\n // Unload all frames that aren't currently being loaded or rendered\n return frame.touchedFrameNumber < frameState.frameNumber;\n };\n}\n\nfunction unloadFrames(that, unloadCondition) {\n const frames = that._frames;\n const length = frames.length;\n for (let i = 0; i < length; ++i) {\n const frame = frames[i];\n if (defined(frame)) {\n if (!defined(unloadCondition) || unloadCondition(frame)) {\n const pointCloud = frame.pointCloud;\n if (frame.ready) {\n that._totalMemoryUsageInBytes -= pointCloud.geometryByteLength;\n }\n if (defined(pointCloud)) {\n pointCloud.destroy();\n }\n if (frame === that._lastRenderedFrame) {\n that._lastRenderedFrame = undefined;\n }\n frames[i] = undefined;\n }\n }\n }\n}\n\nfunction getFrame(that, interval) {\n const index = getIntervalIndex(that, interval);\n const frame = that._frames[index];\n if (defined(frame) && frame.ready) {\n return frame;\n }\n}\n\nfunction updateInterval(that, interval, frame, updateState, frameState) {\n if (defined(frame)) {\n if (frame.ready) {\n return true;\n }\n loadFrame(that, interval, updateState, frameState);\n return frame.ready;\n }\n return false;\n}\n\nfunction getNearestReadyInterval(\n that,\n previousInterval,\n currentInterval,\n updateState,\n frameState\n) {\n let i;\n let interval;\n let frame;\n const intervals = that._intervals;\n const frames = that._frames;\n const currentIndex = getIntervalIndex(that, currentInterval);\n const previousIndex = getIntervalIndex(that, previousInterval);\n\n if (currentIndex >= previousIndex) {\n // look backwards\n for (i = currentIndex; i >= previousIndex; --i) {\n interval = intervals.get(i);\n frame = frames[i];\n if (updateInterval(that, interval, frame, updateState, frameState)) {\n return interval;\n }\n }\n } else {\n // look forwards\n for (i = currentIndex; i <= previousIndex; ++i) {\n interval = intervals.get(i);\n frame = frames[i];\n if (updateInterval(that, interval, frame, updateState, frameState)) {\n return interval;\n }\n }\n }\n\n // If no intervals are ready return the previous interval\n return previousInterval;\n}\n\nfunction setFramesDirty(that, clippingPlanesDirty, styleDirty) {\n const frames = that._frames;\n const framesLength = frames.length;\n for (let i = 0; i < framesLength; ++i) {\n const frame = frames[i];\n if (defined(frame) && defined(frame.pointCloud)) {\n frame.pointCloud.clippingPlanesDirty = clippingPlanesDirty;\n frame.pointCloud.styleDirty = styleDirty;\n }\n }\n}\n\nconst updateState = {\n timeSinceLoad: 0,\n isClipped: false,\n clippingPlanesDirty: false,\n};\n\n/**\n * @private\n */\nTimeDynamicPointCloud.prototype.update = function (frameState) {\n if (frameState.mode === SceneMode.MORPHING) {\n return;\n }\n\n if (!this.show) {\n return;\n }\n\n if (!defined(this._pickId)) {\n this._pickId = frameState.context.createPickId({\n primitive: this,\n });\n }\n\n if (!defined(this._loadTimestamp)) {\n this._loadTimestamp = JulianDate.clone(frameState.time);\n }\n\n // For styling\n const timeSinceLoad = Math.max(\n JulianDate.secondsDifference(frameState.time, this._loadTimestamp) * 1000,\n 0.0\n );\n\n // Update clipping planes\n const clippingPlanes = this._clippingPlanes;\n let clippingPlanesState = 0;\n let clippingPlanesDirty = false;\n const isClipped = defined(clippingPlanes) && clippingPlanes.enabled;\n\n if (isClipped) {\n clippingPlanes.update(frameState);\n clippingPlanesState = clippingPlanes.clippingPlanesState;\n }\n\n if (this._clippingPlanesState !== clippingPlanesState) {\n this._clippingPlanesState = clippingPlanesState;\n clippingPlanesDirty = true;\n }\n\n const styleDirty = this._styleDirty;\n this._styleDirty = false;\n\n if (clippingPlanesDirty || styleDirty) {\n setFramesDirty(this, clippingPlanesDirty, styleDirty);\n }\n\n updateState.timeSinceLoad = timeSinceLoad;\n updateState.isClipped = isClipped;\n\n const shading = this.shading;\n const eyeDomeLighting = this._pointCloudEyeDomeLighting;\n\n const commandList = frameState.commandList;\n const lengthBeforeUpdate = commandList.length;\n\n let previousInterval = this._previousInterval;\n let nextInterval = this._nextInterval;\n const currentInterval = getCurrentInterval(this);\n\n if (!defined(currentInterval)) {\n return;\n }\n\n let clockMultiplierChanged = false;\n const clockMultiplier = getClockMultiplier(this);\n const clockPaused = clockMultiplier === 0;\n if (clockMultiplier !== this._clockMultiplier) {\n clockMultiplierChanged = true;\n this._clockMultiplier = clockMultiplier;\n }\n\n if (!defined(previousInterval) || clockPaused) {\n previousInterval = currentInterval;\n }\n\n if (\n !defined(nextInterval) ||\n clockMultiplierChanged ||\n reachedInterval(this, currentInterval, nextInterval)\n ) {\n nextInterval = getNextInterval(this, currentInterval);\n }\n\n previousInterval = getNearestReadyInterval(\n this,\n previousInterval,\n currentInterval,\n updateState,\n frameState\n );\n let frame = getFrame(this, previousInterval);\n\n if (!defined(frame)) {\n // The frame is not ready to render. This can happen when the simulation starts or when scrubbing the timeline\n // to a frame that hasn't loaded yet. Just render the last rendered frame in its place until it finishes loading.\n loadFrame(this, previousInterval, updateState, frameState);\n frame = this._lastRenderedFrame;\n }\n\n if (defined(frame)) {\n renderFrame(this, frame, updateState, frameState);\n }\n\n if (defined(nextInterval)) {\n // Start loading the next frame\n loadFrame(this, nextInterval, updateState, frameState);\n }\n\n const that = this;\n if (defined(frame) && !defined(this._lastRenderedFrame)) {\n frameState.afterRender.push(function () {\n that._resolveReadyPromise(that);\n });\n }\n\n if (defined(frame) && frame !== this._lastRenderedFrame) {\n if (that.frameChanged.numberOfListeners > 0) {\n frameState.afterRender.push(function () {\n that.frameChanged.raiseEvent(that);\n });\n }\n }\n\n this._previousInterval = previousInterval;\n this._nextInterval = nextInterval;\n this._lastRenderedFrame = frame;\n\n const totalMemoryUsageInBytes = this._totalMemoryUsageInBytes;\n const maximumMemoryUsageInBytes = this.maximumMemoryUsage * 1024 * 1024;\n\n if (totalMemoryUsageInBytes > maximumMemoryUsageInBytes) {\n unloadFrames(this, getUnloadCondition(frameState));\n }\n\n const lengthAfterUpdate = commandList.length;\n const addedCommandsLength = lengthAfterUpdate - lengthBeforeUpdate;\n\n if (\n defined(shading) &&\n shading.attenuation &&\n shading.eyeDomeLighting &&\n addedCommandsLength > 0\n ) {\n eyeDomeLighting.update(\n frameState,\n lengthBeforeUpdate,\n shading,\n this.boundingSphere\n );\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.\n *\n * @see TimeDynamicPointCloud#destroy\n */\nTimeDynamicPointCloud.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * pointCloud = pointCloud && pointCloud.destroy();\n *\n * @see TimeDynamicPointCloud#isDestroyed\n */\nTimeDynamicPointCloud.prototype.destroy = function () {\n unloadFrames(this);\n this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();\n this._pickId = this._pickId && this._pickId.destroy();\n return destroyObject(this);\n};\nexport default TimeDynamicPointCloud;\n", "import BoundingRectangle from \"../Core/BoundingRectangle.js\";\nimport Color from \"../Core/Color.js\";\nimport defined from \"../Core/defined.js\";\nimport destroyObject from \"../Core/destroyObject.js\";\nimport DeveloperError from \"../Core/DeveloperError.js\";\nimport Pass from \"../Renderer/Pass.js\";\nimport RenderState from \"../Renderer/RenderState.js\";\nimport ShaderSource from \"../Renderer/ShaderSource.js\";\nimport ViewportQuadFS from \"../Shaders/ViewportQuadFS.js\";\nimport BlendingState from \"./BlendingState.js\";\nimport Material from \"./Material.js\";\n\n/**\n * A viewport aligned quad.\n *\n * @alias ViewportQuad\n * @constructor\n *\n * @param {BoundingRectangle} [rectangle] The {@link BoundingRectangle} defining the quad's position within the viewport.\n * @param {Material} [material] The {@link Material} defining the surface appearance of the viewport quad.\n *\n * @example\n * const viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));\n * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);\n */\nfunction ViewportQuad(rectangle, material) {\n /**\n * Determines if the viewport quad primitive will be shown.\n *\n * @type {Boolean}\n * @default true\n */\n this.show = true;\n\n if (!defined(rectangle)) {\n rectangle = new BoundingRectangle();\n }\n\n /**\n * The BoundingRectangle defining the quad's position within the viewport.\n *\n * @type {BoundingRectangle}\n *\n * @example\n * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);\n */\n this.rectangle = BoundingRectangle.clone(rectangle);\n\n if (!defined(material)) {\n material = Material.fromType(Material.ColorType, {\n color: new Color(1.0, 1.0, 1.0, 1.0),\n });\n }\n\n /**\n * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with\n * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.\n * <p>\n * The default material is <code>Material.ColorType</code>.\n * </p>\n *\n * @type Material\n *\n * @example\n * // 1. Change the color of the default material to yellow\n * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);\n *\n * // 2. Change material to horizontal stripes\n * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);\n *\n * @see {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}\n */\n this.material = material;\n this._material = undefined;\n\n this._overlayCommand = undefined;\n this._rs = undefined;\n}\n\n/**\n * Called when {@link Viewer} or {@link CesiumWidget} render the scene to\n * get the draw commands needed to render this primitive.\n * <p>\n * Do not call this function directly. This is documented just to\n * list the exceptions that may be propagated when the scene is rendered:\n * </p>\n *\n * @exception {DeveloperError} this.material must be defined.\n * @exception {DeveloperError} this.rectangle must be defined.\n */\nViewportQuad.prototype.update = function (frameState) {\n if (!this.show) {\n return;\n }\n\n const rs = this._rs;\n if (!defined(rs) || !BoundingRectangle.equals(rs.viewport, this.rectangle)) {\n this._rs = RenderState.fromCache({\n blending: BlendingState.ALPHA_BLEND,\n viewport: this.rectangle,\n });\n }\n\n const pass = frameState.passes;\n if (pass.render) {\n const context = frameState.context;\n\n if (this._material !== this.material || !defined(this._overlayCommand)) {\n // Recompile shader when material changes\n this._material = this.material;\n\n if (defined(this._overlayCommand)) {\n this._overlayCommand.shaderProgram.destroy();\n }\n\n const fs = new ShaderSource({\n sources: [this._material.shaderSource, ViewportQuadFS],\n });\n this._overlayCommand = context.createViewportQuadCommand(fs, {\n renderState: this._rs,\n uniformMap: this._material._uniforms,\n owner: this,\n });\n this._overlayCommand.pass = Pass.OVERLAY;\n }\n\n this._material.update(context);\n\n this._overlayCommand.renderState = this._rs;\n this._overlayCommand.uniformMap = this._material._uniforms;\n frameState.commandList.push(this._overlayCommand);\n }\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see ViewportQuad#destroy\n */\nViewportQuad.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n *\n * @example\n * quad = quad && quad.destroy();\n *\n * @see ViewportQuad#isDestroyed\n */\nViewportQuad.prototype.destroy = function () {\n if (defined(this._overlayCommand)) {\n this._overlayCommand.shaderProgram =\n this._overlayCommand.shaderProgram &&\n this._overlayCommand.shaderProgram.destroy();\n }\n return destroyObject(this);\n};\nexport default ViewportQuad;\n", "//This file is automatically rebuilt by the Cesium build process.\nexport default \"uniform sampler2D u_depthTexture;\\n\\\nvarying vec2 v_textureCoordinates;\\n\\\nvoid main()\\n\\\n{\\n\\\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\\n\\\nz_window = czm_reverseLogDepth(z_window);\\n\\\nfloat n_range = czm_depthRange.near;\\n\\\nfloat f_range = czm_depthRange.far;\\n\\\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\\n\\\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\\n\\\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\\n\\\n}\\n\\\n\";\n", "import Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport getElement from \"../getElement.js\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\n\nconst svgNS = \"http://www.w3.org/2000/svg\";\nconst xlinkNS = \"http://www.w3.org/1999/xlink\";\n\nlet widgetForDrag;\n\nconst gradientEnabledColor0 = Color.fromCssColorString(\n \"rgba(247,250,255,0.384)\"\n);\nconst gradientEnabledColor1 = Color.fromCssColorString(\n \"rgba(143,191,255,0.216)\"\n);\nconst gradientEnabledColor2 = Color.fromCssColorString(\n \"rgba(153,197,255,0.098)\"\n);\nconst gradientEnabledColor3 = Color.fromCssColorString(\n \"rgba(255,255,255,0.086)\"\n);\n\nconst gradientDisabledColor0 = Color.fromCssColorString(\n \"rgba(255,255,255,0.267)\"\n);\nconst gradientDisabledColor1 = Color.fromCssColorString(\"rgba(255,255,255,0)\");\n\nconst gradientKnobColor = Color.fromCssColorString(\"rgba(66,67,68,0.3)\");\nconst gradientPointerColor = Color.fromCssColorString(\"rgba(0,0,0,0.5)\");\n\nfunction getElementColor(element) {\n return Color.fromCssColorString(\n window.getComputedStyle(element).getPropertyValue(\"color\")\n );\n}\n\nconst svgIconsById = {\n animation_pathReset: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n d:\n \"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\",\n },\n animation_pathPause: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n 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\",\n },\n animation_pathPlay: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n d: \"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z\",\n },\n animation_pathPlayReverse: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(-0.85,0.85) translate(-16,-16)\",\n d: \"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z\",\n },\n animation_pathLoop: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(0.85) translate(-16,-16)\",\n d:\n \"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\",\n },\n animation_pathClock: {\n tagName: \"path\",\n transform: \"translate(16,16) scale(0.85) translate(-16,-15.5)\",\n d:\n \"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\",\n },\n animation_pathWingButton: {\n tagName: \"path\",\n d:\n \"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\",\n },\n animation_pathPointer: {\n tagName: \"path\",\n d: \"M-15,-65,-15,-55,15,-55,15,-65,0,-95z\",\n },\n animation_pathSwooshFX: {\n tagName: \"path\",\n d:\n \"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\",\n },\n};\n\n//Dynamically builds an SVG element from a JSON object.\nfunction svgFromObject(obj) {\n const ele = document.createElementNS(svgNS, obj.tagName);\n for (const field in obj) {\n if (obj.hasOwnProperty(field) && field !== \"tagName\") {\n if (field === \"children\") {\n const len = obj.children.length;\n for (let i = 0; i < len; ++i) {\n ele.appendChild(svgFromObject(obj.children[i]));\n }\n } else if (field.indexOf(\"xlink:\") === 0) {\n ele.setAttributeNS(xlinkNS, field.substring(6), obj[field]);\n } else if (field === \"textContent\") {\n ele.textContent = obj[field];\n } else {\n ele.setAttribute(field, obj[field]);\n }\n }\n }\n return ele;\n}\n\nfunction svgText(x, y, msg) {\n const text = document.createElementNS(svgNS, \"text\");\n text.setAttribute(\"x\", x);\n text.setAttribute(\"y\", y);\n text.setAttribute(\"class\", \"cesium-animation-svgText\");\n\n const tspan = document.createElementNS(svgNS, \"tspan\");\n tspan.textContent = msg;\n text.appendChild(tspan);\n return text;\n}\n\nfunction setShuttleRingPointer(shuttleRingPointer, knobOuter, angle) {\n shuttleRingPointer.setAttribute(\n \"transform\",\n `translate(100,100) rotate(${angle})`\n );\n knobOuter.setAttribute(\"transform\", `rotate(${angle})`);\n}\n\nconst makeColorStringScratch = new Color();\nfunction makeColorString(background, gradient) {\n const gradientAlpha = gradient.alpha;\n const backgroundAlpha = 1.0 - gradientAlpha;\n makeColorStringScratch.red =\n background.red * backgroundAlpha + gradient.red * gradientAlpha;\n makeColorStringScratch.green =\n background.green * backgroundAlpha + gradient.green * gradientAlpha;\n makeColorStringScratch.blue =\n background.blue * backgroundAlpha + gradient.blue * gradientAlpha;\n return makeColorStringScratch.toCssColorString();\n}\n\nfunction rectButton(x, y, path) {\n const iconInfo = svgIconsById[path];\n\n const button = {\n tagName: \"g\",\n class: \"cesium-animation-rectButton\",\n transform: `translate(${x},${y})`,\n children: [\n {\n tagName: \"rect\",\n class: \"cesium-animation-buttonGlow\",\n width: 32,\n height: 32,\n rx: 2,\n ry: 2,\n },\n {\n tagName: \"rect\",\n class: \"cesium-animation-buttonMain\",\n width: 32,\n height: 32,\n rx: 4,\n ry: 4,\n },\n {\n class: \"cesium-animation-buttonPath\",\n id: path,\n tagName: iconInfo.tagName,\n transform: iconInfo.transform,\n d: iconInfo.d,\n },\n {\n tagName: \"title\",\n textContent: \"\",\n },\n ],\n };\n return svgFromObject(button);\n}\n\nfunction wingButton(x, y, path) {\n const buttonIconInfo = svgIconsById[path];\n const wingIconInfo = svgIconsById[\"animation_pathWingButton\"];\n\n const button = {\n tagName: \"g\",\n class: \"cesium-animation-rectButton\",\n transform: `translate(${x},${y})`,\n children: [\n {\n class: \"cesium-animation-buttonGlow\",\n id: \"animation_pathWingButton\",\n tagName: wingIconInfo.tagName,\n d: wingIconInfo.d,\n },\n {\n class: \"cesium-animation-buttonMain\",\n id: \"animation_pathWingButton\",\n tagName: wingIconInfo.tagName,\n d: wingIconInfo.d,\n },\n {\n class: \"cesium-animation-buttonPath\",\n id: path,\n tagName: buttonIconInfo.tagName,\n transform: buttonIconInfo.transform,\n d: buttonIconInfo.d,\n },\n {\n tagName: \"title\",\n textContent: \"\",\n },\n ],\n };\n return svgFromObject(button);\n}\n\nfunction setShuttleRingFromMouseOrTouch(widget, e) {\n const viewModel = widget._viewModel;\n const shuttleRingDragging = viewModel.shuttleRingDragging;\n\n if (shuttleRingDragging && widgetForDrag !== widget) {\n return;\n }\n\n if (\n e.type === \"mousedown\" ||\n (shuttleRingDragging && e.type === \"mousemove\") ||\n (e.type === \"touchstart\" && e.touches.length === 1) ||\n (shuttleRingDragging && e.type === \"touchmove\" && e.touches.length === 1)\n ) {\n const centerX = widget._centerX;\n const centerY = widget._centerY;\n const svg = widget._svgNode;\n const rect = svg.getBoundingClientRect();\n let clientX;\n let clientY;\n if (e.type === \"touchstart\" || e.type === \"touchmove\") {\n clientX = e.touches[0].clientX;\n clientY = e.touches[0].clientY;\n } else {\n clientX = e.clientX;\n clientY = e.clientY;\n }\n\n if (\n !shuttleRingDragging &&\n (clientX > rect.right ||\n clientX < rect.left ||\n clientY < rect.top ||\n clientY > rect.bottom)\n ) {\n return;\n }\n\n const pointerRect = widget._shuttleRingPointer.getBoundingClientRect();\n\n const x = clientX - centerX - rect.left;\n const y = clientY - centerY - rect.top;\n\n let angle = (Math.atan2(y, x) * 180) / Math.PI + 90;\n if (angle > 180) {\n angle -= 360;\n }\n const shuttleRingAngle = viewModel.shuttleRingAngle;\n if (\n shuttleRingDragging ||\n (clientX < pointerRect.right &&\n clientX > pointerRect.left &&\n clientY > pointerRect.top &&\n clientY < pointerRect.bottom)\n ) {\n widgetForDrag = widget;\n viewModel.shuttleRingDragging = true;\n viewModel.shuttleRingAngle = angle;\n } else if (angle < shuttleRingAngle) {\n viewModel.slower();\n } else if (angle > shuttleRingAngle) {\n viewModel.faster();\n }\n e.preventDefault();\n } else {\n if (widget === widgetForDrag) {\n widgetForDrag = undefined;\n }\n viewModel.shuttleRingDragging = false;\n }\n}\n\n//This is a private class for treating an SVG element like a button.\n//If we ever need a general purpose SVG button, we can make this generic.\nfunction SvgButton(svgElement, viewModel) {\n this._viewModel = viewModel;\n this.svgElement = svgElement;\n this._enabled = undefined;\n this._toggled = undefined;\n\n const that = this;\n this._clickFunction = function () {\n const command = that._viewModel.command;\n if (command.canExecute) {\n command();\n }\n };\n\n svgElement.addEventListener(\"click\", this._clickFunction, true);\n\n //TODO: Since the animation widget uses SVG and has no HTML backing,\n //we need to wire everything up manually. Knockout can supposedly\n //bind to SVG, so we we figure that out we can modify our SVG\n //to include the binding information directly.\n\n this._subscriptions = [\n //\n subscribeAndEvaluate(viewModel, \"toggled\", this.setToggled, this), //\n subscribeAndEvaluate(viewModel, \"tooltip\", this.setTooltip, this), //\n subscribeAndEvaluate(\n viewModel.command,\n \"canExecute\",\n this.setEnabled,\n this\n ),\n ];\n}\n\nSvgButton.prototype.destroy = function () {\n this.svgElement.removeEventListener(\"click\", this._clickFunction, true);\n const subscriptions = this._subscriptions;\n for (let i = 0, len = subscriptions.length; i < len; i++) {\n subscriptions[i].dispose();\n }\n destroyObject(this);\n};\n\nSvgButton.prototype.isDestroyed = function () {\n return false;\n};\n\nSvgButton.prototype.setEnabled = function (enabled) {\n if (this._enabled !== enabled) {\n this._enabled = enabled;\n\n if (!enabled) {\n this.svgElement.setAttribute(\"class\", \"cesium-animation-buttonDisabled\");\n return;\n }\n\n if (this._toggled) {\n this.svgElement.setAttribute(\n \"class\",\n \"cesium-animation-rectButton cesium-animation-buttonToggled\"\n );\n return;\n }\n\n this.svgElement.setAttribute(\"class\", \"cesium-animation-rectButton\");\n }\n};\n\nSvgButton.prototype.setToggled = function (toggled) {\n if (this._toggled !== toggled) {\n this._toggled = toggled;\n\n if (this._enabled) {\n if (toggled) {\n this.svgElement.setAttribute(\n \"class\",\n \"cesium-animation-rectButton cesium-animation-buttonToggled\"\n );\n } else {\n this.svgElement.setAttribute(\"class\", \"cesium-animation-rectButton\");\n }\n }\n }\n};\n\nSvgButton.prototype.setTooltip = function (tooltip) {\n this.svgElement.getElementsByTagName(\"title\")[0].textContent = tooltip;\n};\n\n/**\n * <span style=\"display: block; text-align: center;\">\n * <img src=\"Images/AnimationWidget.png\" width=\"211\" height=\"142\" alt=\"\" />\n * <br />Animation widget\n * </span>\n * <br /><br />\n * The Animation widget provides buttons for play, pause, and reverse, along with the\n * current time and date, surrounded by a \"shuttle ring\" for controlling the speed of animation.\n * <br /><br />\n * The \"shuttle ring\" concept is borrowed from video editing, where typically a\n * \"jog wheel\" can be rotated to move past individual animation frames very slowly, and\n * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.\n * Cesium typically treats time as continuous (not broken into pre-defined animation frames),\n * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and\n * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),\n * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.\n * <br /><br />\n * The Animation widget also provides a \"realtime\" button (in the upper-left) that keeps\n * animation time in sync with the end user's system clock, typically displaying\n * \"today\" or \"right now.\" This mode is not available in {@link ClockRange.CLAMPED} or\n * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.\n *\n * @alias Animation\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {AnimationViewModel} viewModel The view model used by this widget.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n *\n * @example\n * // In HTML head, include a link to Animation.css stylesheet,\n * // and in the body, include: <div id=\"animationContainer\"></div>\n *\n * const clock = new Cesium.Clock();\n * const clockViewModel = new Cesium.ClockViewModel(clock);\n * const viewModel = new Cesium.AnimationViewModel(clockViewModel);\n * const widget = new Cesium.Animation('animationContainer', viewModel);\n *\n * function tick() {\n * clock.tick();\n * requestAnimationFrame(tick);\n * }\n * requestAnimationFrame(tick);\n *\n * @see AnimationViewModel\n * @see Clock\n */\nfunction Animation(container, viewModel) {\n container = getElement(container);\n this._viewModel = viewModel;\n this._container = container;\n this._centerX = 0;\n this._centerY = 0;\n this._defsElement = undefined;\n this._svgNode = undefined;\n this._topG = undefined;\n this._lastHeight = undefined;\n this._lastWidth = undefined;\n\n const ownerDocument = container.ownerDocument;\n\n // Firefox requires SVG references to be included directly, not imported from external CSS.\n // Also, CSS minifiers get confused by this being in an external CSS file.\n const cssStyle = document.createElement(\"style\");\n cssStyle.textContent =\n \".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }\\\n.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }\\\n.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }\\\n.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }\\\n.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }\\\n.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }\\\n.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }\\\n.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }\\\n.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }\\\n.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }\\\n.cesium-animation-knobInner { fill: url(#animation_knobInner); }\";\n\n ownerDocument.head.insertBefore(cssStyle, ownerDocument.head.childNodes[0]);\n\n const themeEle = document.createElement(\"div\");\n themeEle.className = \"cesium-animation-theme\";\n themeEle.innerHTML =\n '<div class=\"cesium-animation-themeNormal\"></div>\\\n<div class=\"cesium-animation-themeHover\"></div>\\\n<div class=\"cesium-animation-themeSelect\"></div>\\\n<div class=\"cesium-animation-themeDisabled\"></div>\\\n<div class=\"cesium-animation-themeKnob\"></div>\\\n<div class=\"cesium-animation-themePointer\"></div>\\\n<div class=\"cesium-animation-themeSwoosh\"></div>\\\n<div class=\"cesium-animation-themeSwooshHover\"></div>';\n\n this._theme = themeEle;\n this._themeNormal = themeEle.childNodes[0];\n this._themeHover = themeEle.childNodes[1];\n this._themeSelect = themeEle.childNodes[2];\n this._themeDisabled = themeEle.childNodes[3];\n this._themeKnob = themeEle.childNodes[4];\n this._themePointer = themeEle.childNodes[5];\n this._themeSwoosh = themeEle.childNodes[6];\n this._themeSwooshHover = themeEle.childNodes[7];\n\n const svg = document.createElementNS(svgNS, \"svg:svg\");\n this._svgNode = svg;\n\n // Define the XLink namespace that SVG uses\n svg.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xlink\", xlinkNS);\n\n const topG = document.createElementNS(svgNS, \"g\");\n this._topG = topG;\n\n this._realtimeSVG = new SvgButton(\n wingButton(3, 4, \"animation_pathClock\"),\n viewModel.playRealtimeViewModel\n );\n this._playReverseSVG = new SvgButton(\n rectButton(44, 99, \"animation_pathPlayReverse\"),\n viewModel.playReverseViewModel\n );\n this._playForwardSVG = new SvgButton(\n rectButton(124, 99, \"animation_pathPlay\"),\n viewModel.playForwardViewModel\n );\n this._pauseSVG = new SvgButton(\n rectButton(84, 99, \"animation_pathPause\"),\n viewModel.pauseViewModel\n );\n\n const buttonsG = document.createElementNS(svgNS, \"g\");\n buttonsG.appendChild(this._realtimeSVG.svgElement);\n buttonsG.appendChild(this._playReverseSVG.svgElement);\n buttonsG.appendChild(this._playForwardSVG.svgElement);\n buttonsG.appendChild(this._pauseSVG.svgElement);\n\n const shuttleRingBackPanel = svgFromObject({\n tagName: \"circle\",\n class: \"cesium-animation-shuttleRingBack\",\n cx: 100,\n cy: 100,\n r: 99,\n });\n this._shuttleRingBackPanel = shuttleRingBackPanel;\n\n const swooshIconInfo = svgIconsById[\"animation_pathSwooshFX\"];\n const shuttleRingPointerIconInfo = svgIconsById[\"animation_pathPointer\"];\n\n const shuttleRingSwooshG = svgFromObject({\n tagName: \"g\",\n class: \"cesium-animation-shuttleRingSwoosh\",\n children: [\n {\n tagName: swooshIconInfo.tagName,\n transform: \"translate(100,97) scale(-1,1)\",\n id: \"animation_pathSwooshFX\",\n d: swooshIconInfo.d,\n },\n {\n tagName: swooshIconInfo.tagName,\n transform: \"translate(100,97)\",\n id: \"animation_pathSwooshFX\",\n d: swooshIconInfo.d,\n },\n {\n tagName: \"line\",\n x1: 100,\n y1: 8,\n x2: 100,\n y2: 22,\n },\n ],\n });\n this._shuttleRingSwooshG = shuttleRingSwooshG;\n\n this._shuttleRingPointer = svgFromObject({\n class: \"cesium-animation-shuttleRingPointer\",\n id: \"animation_pathPointer\",\n tagName: shuttleRingPointerIconInfo.tagName,\n d: shuttleRingPointerIconInfo.d,\n });\n\n const knobG = svgFromObject({\n tagName: \"g\",\n transform: \"translate(100,100)\",\n });\n\n this._knobOuter = svgFromObject({\n tagName: \"circle\",\n class: \"cesium-animation-knobOuter\",\n cx: 0,\n cy: 0,\n r: 71,\n });\n\n const knobInnerAndShieldSize = 61;\n\n const knobInner = svgFromObject({\n tagName: \"circle\",\n class: \"cesium-animation-knobInner\",\n cx: 0,\n cy: 0,\n r: knobInnerAndShieldSize,\n });\n\n this._knobDate = svgText(0, -24, \"\");\n this._knobTime = svgText(0, -7, \"\");\n this._knobStatus = svgText(0, -41, \"\");\n\n // widget shield catches clicks on the knob itself (even while DOM elements underneath are changing).\n const knobShield = svgFromObject({\n tagName: \"circle\",\n class: \"cesium-animation-blank\",\n cx: 0,\n cy: 0,\n r: knobInnerAndShieldSize,\n });\n\n const shuttleRingBackG = document.createElementNS(svgNS, \"g\");\n shuttleRingBackG.setAttribute(\"class\", \"cesium-animation-shuttleRingG\");\n\n container.appendChild(themeEle);\n topG.appendChild(shuttleRingBackG);\n topG.appendChild(knobG);\n topG.appendChild(buttonsG);\n\n shuttleRingBackG.appendChild(shuttleRingBackPanel);\n shuttleRingBackG.appendChild(shuttleRingSwooshG);\n shuttleRingBackG.appendChild(this._shuttleRingPointer);\n\n knobG.appendChild(this._knobOuter);\n knobG.appendChild(knobInner);\n knobG.appendChild(this._knobDate);\n knobG.appendChild(this._knobTime);\n knobG.appendChild(this._knobStatus);\n knobG.appendChild(knobShield);\n\n svg.appendChild(topG);\n container.appendChild(svg);\n\n const that = this;\n function mouseCallback(e) {\n setShuttleRingFromMouseOrTouch(that, e);\n }\n this._mouseCallback = mouseCallback;\n\n shuttleRingBackPanel.addEventListener(\"mousedown\", mouseCallback, true);\n shuttleRingBackPanel.addEventListener(\"touchstart\", mouseCallback, true);\n shuttleRingSwooshG.addEventListener(\"mousedown\", mouseCallback, true);\n shuttleRingSwooshG.addEventListener(\"touchstart\", mouseCallback, true);\n ownerDocument.addEventListener(\"mousemove\", mouseCallback, true);\n ownerDocument.addEventListener(\"touchmove\", mouseCallback, true);\n ownerDocument.addEventListener(\"mouseup\", mouseCallback, true);\n ownerDocument.addEventListener(\"touchend\", mouseCallback, true);\n ownerDocument.addEventListener(\"touchcancel\", mouseCallback, true);\n this._shuttleRingPointer.addEventListener(\"mousedown\", mouseCallback, true);\n this._shuttleRingPointer.addEventListener(\"touchstart\", mouseCallback, true);\n this._knobOuter.addEventListener(\"mousedown\", mouseCallback, true);\n this._knobOuter.addEventListener(\"touchstart\", mouseCallback, true);\n\n //TODO: Since the animation widget uses SVG and has no HTML backing,\n //we need to wire everything up manually. Knockout can supposedly\n //bind to SVG, so we we figure that out we can modify our SVG\n //to include the binding information directly.\n\n const timeNode = this._knobTime.childNodes[0];\n const dateNode = this._knobDate.childNodes[0];\n const statusNode = this._knobStatus.childNodes[0];\n let isPaused;\n this._subscriptions = [\n //\n subscribeAndEvaluate(viewModel.pauseViewModel, \"toggled\", function (value) {\n if (isPaused !== value) {\n isPaused = value;\n if (isPaused) {\n that._shuttleRingPointer.setAttribute(\n \"class\",\n \"cesium-animation-shuttleRingPausePointer\"\n );\n } else {\n that._shuttleRingPointer.setAttribute(\n \"class\",\n \"cesium-animation-shuttleRingPointer\"\n );\n }\n }\n }),\n\n subscribeAndEvaluate(viewModel, \"shuttleRingAngle\", function (value) {\n setShuttleRingPointer(that._shuttleRingPointer, that._knobOuter, value);\n }),\n\n subscribeAndEvaluate(viewModel, \"dateLabel\", function (value) {\n if (dateNode.textContent !== value) {\n dateNode.textContent = value;\n }\n }),\n\n subscribeAndEvaluate(viewModel, \"timeLabel\", function (value) {\n if (timeNode.textContent !== value) {\n timeNode.textContent = value;\n }\n }),\n\n subscribeAndEvaluate(viewModel, \"multiplierLabel\", function (value) {\n if (statusNode.textContent !== value) {\n statusNode.textContent = value;\n }\n }),\n ];\n\n this.applyThemeChanges();\n this.resize();\n}\n\nObject.defineProperties(Animation.prototype, {\n /**\n * Gets the parent container.\n *\n * @memberof Animation.prototype\n * @type {Element}\n * @readonly\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n *\n * @memberof Animation.prototype\n * @type {AnimationViewModel}\n * @readonly\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nAnimation.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the animation widget. Should be called if permanently\n * removing the widget from layout.\n */\nAnimation.prototype.destroy = function () {\n if (defined(this._observer)) {\n this._observer.disconnect();\n this._observer = undefined;\n }\n\n const doc = this._container.ownerDocument;\n\n const mouseCallback = this._mouseCallback;\n this._shuttleRingBackPanel.removeEventListener(\n \"mousedown\",\n mouseCallback,\n true\n );\n this._shuttleRingBackPanel.removeEventListener(\n \"touchstart\",\n mouseCallback,\n true\n );\n this._shuttleRingSwooshG.removeEventListener(\n \"mousedown\",\n mouseCallback,\n true\n );\n this._shuttleRingSwooshG.removeEventListener(\n \"touchstart\",\n mouseCallback,\n true\n );\n doc.removeEventListener(\"mousemove\", mouseCallback, true);\n doc.removeEventListener(\"touchmove\", mouseCallback, true);\n doc.removeEventListener(\"mouseup\", mouseCallback, true);\n doc.removeEventListener(\"touchend\", mouseCallback, true);\n doc.removeEventListener(\"touchcancel\", mouseCallback, true);\n this._shuttleRingPointer.removeEventListener(\n \"mousedown\",\n mouseCallback,\n true\n );\n this._shuttleRingPointer.removeEventListener(\n \"touchstart\",\n mouseCallback,\n true\n );\n this._knobOuter.removeEventListener(\"mousedown\", mouseCallback, true);\n this._knobOuter.removeEventListener(\"touchstart\", mouseCallback, true);\n\n this._container.removeChild(this._svgNode);\n this._container.removeChild(this._theme);\n this._realtimeSVG.destroy();\n this._playReverseSVG.destroy();\n this._playForwardSVG.destroy();\n this._pauseSVG.destroy();\n\n const subscriptions = this._subscriptions;\n for (let i = 0, len = subscriptions.length; i < len; i++) {\n subscriptions[i].dispose();\n }\n\n return destroyObject(this);\n};\n\n/**\n * Resizes the widget to match the container size.\n * This function should be called whenever the container size is changed.\n */\nAnimation.prototype.resize = function () {\n const parentWidth = this._container.clientWidth;\n const parentHeight = this._container.clientHeight;\n if (parentWidth === this._lastWidth && parentHeight === this._lastHeight) {\n return;\n }\n\n const svg = this._svgNode;\n\n //The width and height as the SVG was originally drawn.\n const baseWidth = 200;\n const baseHeight = 132;\n\n let width = parentWidth;\n let height = parentHeight;\n\n if (parentWidth === 0 && parentHeight === 0) {\n width = baseWidth;\n height = baseHeight;\n } else if (parentWidth === 0) {\n height = parentHeight;\n width = baseWidth * (parentHeight / baseHeight);\n } else if (parentHeight === 0) {\n width = parentWidth;\n height = baseHeight * (parentWidth / baseWidth);\n }\n\n const scaleX = width / baseWidth;\n const scaleY = height / baseHeight;\n\n svg.style.cssText = `width: ${width}px; height: ${height}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`;\n svg.setAttribute(\"width\", width);\n svg.setAttribute(\"height\", height);\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n this._topG.setAttribute(\"transform\", `scale(${scaleX},${scaleY})`);\n\n this._centerX = Math.max(1, 100.0 * scaleX);\n this._centerY = Math.max(1, 100.0 * scaleY);\n\n this._lastHeight = parentWidth;\n this._lastWidth = parentHeight;\n};\n\n/**\n * Updates the widget to reflect any modified CSS rules for theming.\n *\n * @example\n * //Switch to the cesium-lighter theme.\n * document.body.className = 'cesium-lighter';\n * animation.applyThemeChanges();\n */\nAnimation.prototype.applyThemeChanges = function () {\n // Since we rely on computed styles for themeing, we can't actually\n // do anything if the container has not yet been added to the DOM.\n // Set up an observer to be notified when it is added and apply\n // the changes at that time.\n\n const doc = this._container.ownerDocument;\n\n if (!doc.body.contains(this._container)) {\n if (defined(this._observer)) {\n //Already listening.\n return;\n }\n const that = this;\n that._observer = new MutationObserver(function () {\n if (doc.body.contains(that._container)) {\n that._observer.disconnect();\n that._observer = undefined;\n that.applyThemeChanges();\n }\n });\n that._observer.observe(doc, { childList: true, subtree: true });\n return;\n }\n\n const buttonNormalBackColor = getElementColor(this._themeNormal);\n const buttonHoverBackColor = getElementColor(this._themeHover);\n const buttonToggledBackColor = getElementColor(this._themeSelect);\n const buttonDisabledBackColor = getElementColor(this._themeDisabled);\n const knobBackColor = getElementColor(this._themeKnob);\n const pointerColor = getElementColor(this._themePointer);\n const swooshColor = getElementColor(this._themeSwoosh);\n const swooshHoverColor = getElementColor(this._themeSwooshHover);\n\n const defsElement = svgFromObject({\n tagName: \"defs\",\n children: [\n {\n id: \"animation_buttonNormal\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n //add a 'stop-opacity' field to make translucent.\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": makeColorString(\n buttonNormalBackColor,\n gradientEnabledColor0\n ),\n },\n {\n tagName: \"stop\",\n offset: \"12%\",\n \"stop-color\": makeColorString(\n buttonNormalBackColor,\n gradientEnabledColor1\n ),\n },\n {\n tagName: \"stop\",\n offset: \"46%\",\n \"stop-color\": makeColorString(\n buttonNormalBackColor,\n gradientEnabledColor2\n ),\n },\n {\n tagName: \"stop\",\n offset: \"81%\",\n \"stop-color\": makeColorString(\n buttonNormalBackColor,\n gradientEnabledColor3\n ),\n },\n ],\n },\n {\n id: \"animation_buttonHovered\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": makeColorString(\n buttonHoverBackColor,\n gradientEnabledColor0\n ),\n },\n {\n tagName: \"stop\",\n offset: \"12%\",\n \"stop-color\": makeColorString(\n buttonHoverBackColor,\n gradientEnabledColor1\n ),\n },\n {\n tagName: \"stop\",\n offset: \"46%\",\n \"stop-color\": makeColorString(\n buttonHoverBackColor,\n gradientEnabledColor2\n ),\n },\n {\n tagName: \"stop\",\n offset: \"81%\",\n \"stop-color\": makeColorString(\n buttonHoverBackColor,\n gradientEnabledColor3\n ),\n },\n ],\n },\n {\n id: \"animation_buttonToggled\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": makeColorString(\n buttonToggledBackColor,\n gradientEnabledColor0\n ),\n },\n {\n tagName: \"stop\",\n offset: \"12%\",\n \"stop-color\": makeColorString(\n buttonToggledBackColor,\n gradientEnabledColor1\n ),\n },\n {\n tagName: \"stop\",\n offset: \"46%\",\n \"stop-color\": makeColorString(\n buttonToggledBackColor,\n gradientEnabledColor2\n ),\n },\n {\n tagName: \"stop\",\n offset: \"81%\",\n \"stop-color\": makeColorString(\n buttonToggledBackColor,\n gradientEnabledColor3\n ),\n },\n ],\n },\n {\n id: \"animation_buttonDisabled\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": makeColorString(\n buttonDisabledBackColor,\n gradientDisabledColor0\n ),\n },\n {\n tagName: \"stop\",\n offset: \"75%\",\n \"stop-color\": makeColorString(\n buttonDisabledBackColor,\n gradientDisabledColor1\n ),\n },\n ],\n },\n {\n id: \"animation_blurred\",\n tagName: \"filter\",\n width: \"200%\",\n height: \"200%\",\n x: \"-50%\",\n y: \"-50%\",\n children: [\n {\n tagName: \"feGaussianBlur\",\n stdDeviation: 4,\n in: \"SourceGraphic\",\n },\n ],\n },\n {\n id: \"animation_shuttleRingSwooshGradient\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-opacity\": 0.2,\n \"stop-color\": swooshColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"85%\",\n \"stop-opacity\": 0.85,\n \"stop-color\": swooshColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"95%\",\n \"stop-opacity\": 0.05,\n \"stop-color\": swooshColor.toCssColorString(),\n },\n ],\n },\n {\n id: \"animation_shuttleRingSwooshHovered\",\n tagName: \"linearGradient\",\n x1: \"50%\",\n y1: \"0%\",\n x2: \"50%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-opacity\": 0.2,\n \"stop-color\": swooshHoverColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"85%\",\n \"stop-opacity\": 0.85,\n \"stop-color\": swooshHoverColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"95%\",\n \"stop-opacity\": 0.05,\n \"stop-color\": swooshHoverColor.toCssColorString(),\n },\n ],\n },\n {\n id: \"animation_shuttleRingPointerGradient\",\n tagName: \"linearGradient\",\n x1: \"0%\",\n y1: \"50%\",\n x2: \"100%\",\n y2: \"50%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": pointerColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"40%\",\n \"stop-color\": pointerColor.toCssColorString(),\n },\n {\n tagName: \"stop\",\n offset: \"60%\",\n \"stop-color\": makeColorString(pointerColor, gradientPointerColor),\n },\n {\n tagName: \"stop\",\n offset: \"100%\",\n \"stop-color\": makeColorString(pointerColor, gradientPointerColor),\n },\n ],\n },\n {\n id: \"animation_shuttleRingPointerPaused\",\n tagName: \"linearGradient\",\n x1: \"0%\",\n y1: \"50%\",\n x2: \"100%\",\n y2: \"50%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"0%\",\n \"stop-color\": \"#CCC\",\n },\n {\n tagName: \"stop\",\n offset: \"40%\",\n \"stop-color\": \"#CCC\",\n },\n {\n tagName: \"stop\",\n offset: \"60%\",\n \"stop-color\": \"#555\",\n },\n {\n tagName: \"stop\",\n offset: \"100%\",\n \"stop-color\": \"#555\",\n },\n ],\n },\n {\n id: \"animation_knobOuter\",\n tagName: \"linearGradient\",\n x1: \"20%\",\n y1: \"0%\",\n x2: \"90%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"5%\",\n \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor0),\n },\n {\n tagName: \"stop\",\n offset: \"60%\",\n \"stop-color\": makeColorString(knobBackColor, gradientKnobColor),\n },\n {\n tagName: \"stop\",\n offset: \"85%\",\n \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor1),\n },\n ],\n },\n {\n id: \"animation_knobInner\",\n tagName: \"linearGradient\",\n x1: \"20%\",\n y1: \"0%\",\n x2: \"90%\",\n y2: \"100%\",\n children: [\n {\n tagName: \"stop\",\n offset: \"5%\",\n \"stop-color\": makeColorString(knobBackColor, gradientKnobColor),\n },\n {\n tagName: \"stop\",\n offset: \"60%\",\n \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor0),\n },\n {\n tagName: \"stop\",\n offset: \"85%\",\n \"stop-color\": makeColorString(knobBackColor, gradientEnabledColor3),\n },\n ],\n },\n ],\n });\n\n if (!defined(this._defsElement)) {\n this._svgNode.appendChild(defsElement);\n } else {\n this._svgNode.replaceChild(defsElement, this._defsElement);\n }\n this._defsElement = defsElement;\n};\nexport default Animation;\n", "import binarySearch from \"../../Core/binarySearch.js\";\nimport ClockRange from \"../../Core/ClockRange.js\";\nimport ClockStep from \"../../Core/ClockStep.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\nimport ToggleButtonViewModel from \"../ToggleButtonViewModel.js\";\n\nconst monthNames = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\nconst realtimeShuttleRingAngle = 15;\nconst maxShuttleRingAngle = 105;\n\nfunction numberComparator(left, right) {\n return left - right;\n}\n\nfunction getTypicalMultiplierIndex(multiplier, shuttleRingTicks) {\n const index = binarySearch(shuttleRingTicks, multiplier, numberComparator);\n return index < 0 ? ~index : index;\n}\n\nfunction angleToMultiplier(angle, shuttleRingTicks) {\n //Use a linear scale for -1 to 1 between -15 < angle < 15 degrees\n if (Math.abs(angle) <= realtimeShuttleRingAngle) {\n return angle / realtimeShuttleRingAngle;\n }\n\n const minp = realtimeShuttleRingAngle;\n const maxp = maxShuttleRingAngle;\n let maxv;\n const minv = 0;\n let scale;\n if (angle > 0) {\n maxv = Math.log(shuttleRingTicks[shuttleRingTicks.length - 1]);\n scale = (maxv - minv) / (maxp - minp);\n return Math.exp(minv + scale * (angle - minp));\n }\n\n maxv = Math.log(-shuttleRingTicks[0]);\n scale = (maxv - minv) / (maxp - minp);\n return -Math.exp(minv + scale * (Math.abs(angle) - minp));\n}\n\nfunction multiplierToAngle(multiplier, shuttleRingTicks, clockViewModel) {\n if (clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK) {\n return realtimeShuttleRingAngle;\n }\n\n if (Math.abs(multiplier) <= 1) {\n return multiplier * realtimeShuttleRingAngle;\n }\n\n const fastedMultipler = shuttleRingTicks[shuttleRingTicks.length - 1];\n if (multiplier > fastedMultipler) {\n multiplier = fastedMultipler;\n } else if (multiplier < -fastedMultipler) {\n multiplier = -fastedMultipler;\n }\n\n const minp = realtimeShuttleRingAngle;\n const maxp = maxShuttleRingAngle;\n let maxv;\n const minv = 0;\n let scale;\n\n if (multiplier > 0) {\n maxv = Math.log(fastedMultipler);\n scale = (maxv - minv) / (maxp - minp);\n return (Math.log(multiplier) - minv) / scale + minp;\n }\n\n maxv = Math.log(-shuttleRingTicks[0]);\n scale = (maxv - minv) / (maxp - minp);\n return -((Math.log(Math.abs(multiplier)) - minv) / scale + minp);\n}\n\n/**\n * The view model for the {@link Animation} widget.\n * @alias AnimationViewModel\n * @constructor\n *\n * @param {ClockViewModel} clockViewModel The ClockViewModel instance to use.\n *\n * @see Animation\n */\nfunction AnimationViewModel(clockViewModel) {\n const that = this;\n this._clockViewModel = clockViewModel;\n this._allShuttleRingTicks = [];\n this._dateFormatter = AnimationViewModel.defaultDateFormatter;\n this._timeFormatter = AnimationViewModel.defaultTimeFormatter;\n\n /**\n * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.shuttleRingDragging = false;\n\n /**\n * Gets or sets whether dragging the shuttle ring should cause the multiplier\n * to snap to the defined tick values rather than interpolating between them.\n * This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.snapToTicks = false;\n\n knockout.track(this, [\n \"_allShuttleRingTicks\",\n \"_dateFormatter\",\n \"_timeFormatter\",\n \"shuttleRingDragging\",\n \"snapToTicks\",\n ]);\n\n this._sortedFilteredPositiveTicks = [];\n\n this.setShuttleRingTicks(AnimationViewModel.defaultTicks);\n\n /**\n * Gets the string representation of the current time. This property is observable.\n * @type {String}\n */\n this.timeLabel = undefined;\n knockout.defineProperty(this, \"timeLabel\", function () {\n return that._timeFormatter(that._clockViewModel.currentTime, that);\n });\n\n /**\n * Gets the string representation of the current date. This property is observable.\n * @type {String}\n */\n this.dateLabel = undefined;\n knockout.defineProperty(this, \"dateLabel\", function () {\n return that._dateFormatter(that._clockViewModel.currentTime, that);\n });\n\n /**\n * Gets the string representation of the current multiplier. This property is observable.\n * @type {String}\n */\n this.multiplierLabel = undefined;\n knockout.defineProperty(this, \"multiplierLabel\", function () {\n const clockViewModel = that._clockViewModel;\n if (clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK) {\n return \"Today\";\n }\n\n const multiplier = clockViewModel.multiplier;\n\n //If it's a whole number, just return it.\n if (multiplier % 1 === 0) {\n return `${multiplier.toFixed(0)}x`;\n }\n\n //Convert to decimal string and remove any trailing zeroes\n return `${multiplier.toFixed(3).replace(/0{0,3}$/, \"\")}x`;\n });\n\n /**\n * Gets or sets the current shuttle ring angle. This property is observable.\n * @type {Number}\n */\n this.shuttleRingAngle = undefined;\n knockout.defineProperty(this, \"shuttleRingAngle\", {\n get: function () {\n return multiplierToAngle(\n clockViewModel.multiplier,\n that._allShuttleRingTicks,\n clockViewModel\n );\n },\n set: function (angle) {\n angle = Math.max(\n Math.min(angle, maxShuttleRingAngle),\n -maxShuttleRingAngle\n );\n const ticks = that._allShuttleRingTicks;\n\n const clockViewModel = that._clockViewModel;\n clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;\n\n //If we are at the max angle, simply return the max value in either direction.\n if (Math.abs(angle) === maxShuttleRingAngle) {\n clockViewModel.multiplier =\n angle > 0 ? ticks[ticks.length - 1] : ticks[0];\n return;\n }\n\n let multiplier = angleToMultiplier(angle, ticks);\n if (that.snapToTicks) {\n multiplier = ticks[getTypicalMultiplierIndex(multiplier, ticks)];\n } else if (multiplier !== 0) {\n const positiveMultiplier = Math.abs(multiplier);\n\n if (positiveMultiplier > 100) {\n const numDigits = positiveMultiplier.toFixed(0).length - 2;\n const divisor = Math.pow(10, numDigits);\n multiplier = (Math.round(multiplier / divisor) * divisor) | 0;\n } else if (positiveMultiplier > realtimeShuttleRingAngle) {\n multiplier = Math.round(multiplier);\n } else if (positiveMultiplier > 1) {\n multiplier = +multiplier.toFixed(1);\n } else if (positiveMultiplier > 0) {\n multiplier = +multiplier.toFixed(2);\n }\n }\n clockViewModel.multiplier = multiplier;\n },\n });\n\n this._canAnimate = undefined;\n knockout.defineProperty(this, \"_canAnimate\", function () {\n const clockViewModel = that._clockViewModel;\n const clockRange = clockViewModel.clockRange;\n\n if (that.shuttleRingDragging || clockRange === ClockRange.UNBOUNDED) {\n return true;\n }\n\n const multiplier = clockViewModel.multiplier;\n const currentTime = clockViewModel.currentTime;\n const startTime = clockViewModel.startTime;\n\n let result = false;\n if (clockRange === ClockRange.LOOP_STOP) {\n result =\n JulianDate.greaterThan(currentTime, startTime) ||\n (currentTime.equals(startTime) && multiplier > 0);\n } else {\n const stopTime = clockViewModel.stopTime;\n result =\n (JulianDate.greaterThan(currentTime, startTime) &&\n JulianDate.lessThan(currentTime, stopTime)) || //\n (currentTime.equals(startTime) && multiplier > 0) || //\n (currentTime.equals(stopTime) && multiplier < 0);\n }\n\n if (!result) {\n clockViewModel.shouldAnimate = false;\n }\n return result;\n });\n\n this._isSystemTimeAvailable = undefined;\n knockout.defineProperty(this, \"_isSystemTimeAvailable\", function () {\n const clockViewModel = that._clockViewModel;\n const clockRange = clockViewModel.clockRange;\n if (clockRange === ClockRange.UNBOUNDED) {\n return true;\n }\n\n const systemTime = clockViewModel.systemTime;\n return (\n JulianDate.greaterThanOrEquals(systemTime, clockViewModel.startTime) &&\n JulianDate.lessThanOrEquals(systemTime, clockViewModel.stopTime)\n );\n });\n\n this._isAnimating = undefined;\n knockout.defineProperty(this, \"_isAnimating\", function () {\n return (\n that._clockViewModel.shouldAnimate &&\n (that._canAnimate || that.shuttleRingDragging)\n );\n });\n\n const pauseCommand = createCommand(function () {\n const clockViewModel = that._clockViewModel;\n if (clockViewModel.shouldAnimate) {\n clockViewModel.shouldAnimate = false;\n } else if (that._canAnimate) {\n clockViewModel.shouldAnimate = true;\n }\n });\n\n this._pauseViewModel = new ToggleButtonViewModel(pauseCommand, {\n toggled: knockout.computed(function () {\n return !that._isAnimating;\n }),\n tooltip: \"Pause\",\n });\n\n const playReverseCommand = createCommand(function () {\n const clockViewModel = that._clockViewModel;\n const multiplier = clockViewModel.multiplier;\n if (multiplier > 0) {\n clockViewModel.multiplier = -multiplier;\n }\n clockViewModel.shouldAnimate = true;\n });\n\n this._playReverseViewModel = new ToggleButtonViewModel(playReverseCommand, {\n toggled: knockout.computed(function () {\n return that._isAnimating && clockViewModel.multiplier < 0;\n }),\n tooltip: \"Play Reverse\",\n });\n\n const playForwardCommand = createCommand(function () {\n const clockViewModel = that._clockViewModel;\n const multiplier = clockViewModel.multiplier;\n if (multiplier < 0) {\n clockViewModel.multiplier = -multiplier;\n }\n clockViewModel.shouldAnimate = true;\n });\n\n this._playForwardViewModel = new ToggleButtonViewModel(playForwardCommand, {\n toggled: knockout.computed(function () {\n return (\n that._isAnimating &&\n clockViewModel.multiplier > 0 &&\n clockViewModel.clockStep !== ClockStep.SYSTEM_CLOCK\n );\n }),\n tooltip: \"Play Forward\",\n });\n\n const playRealtimeCommand = createCommand(function () {\n that._clockViewModel.clockStep = ClockStep.SYSTEM_CLOCK;\n }, knockout.getObservable(this, \"_isSystemTimeAvailable\"));\n\n this._playRealtimeViewModel = new ToggleButtonViewModel(playRealtimeCommand, {\n toggled: knockout.computed(function () {\n return clockViewModel.clockStep === ClockStep.SYSTEM_CLOCK;\n }),\n tooltip: knockout.computed(function () {\n return that._isSystemTimeAvailable\n ? \"Today (real-time)\"\n : \"Current time not in range\";\n }),\n });\n\n this._slower = createCommand(function () {\n const clockViewModel = that._clockViewModel;\n const shuttleRingTicks = that._allShuttleRingTicks;\n const multiplier = clockViewModel.multiplier;\n const index = getTypicalMultiplierIndex(multiplier, shuttleRingTicks) - 1;\n if (index >= 0) {\n clockViewModel.multiplier = shuttleRingTicks[index];\n }\n });\n\n this._faster = createCommand(function () {\n const clockViewModel = that._clockViewModel;\n const shuttleRingTicks = that._allShuttleRingTicks;\n const multiplier = clockViewModel.multiplier;\n const index = getTypicalMultiplierIndex(multiplier, shuttleRingTicks) + 1;\n if (index < shuttleRingTicks.length) {\n clockViewModel.multiplier = shuttleRingTicks[index];\n }\n });\n}\n\n/**\n * Gets or sets the default date formatter used by new instances.\n *\n * @member\n * @type {AnimationViewModel.DateFormatter}\n */\nAnimationViewModel.defaultDateFormatter = function (date, viewModel) {\n const gregorianDate = JulianDate.toGregorianDate(date);\n return `${monthNames[gregorianDate.month - 1]} ${gregorianDate.day} ${\n gregorianDate.year\n }`;\n};\n\n/**\n * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.\n * @type {Number[]}\n */\nAnimationViewModel.defaultTicks = [\n //\n 0.001,\n 0.002,\n 0.005,\n 0.01,\n 0.02,\n 0.05,\n 0.1,\n 0.25,\n 0.5,\n 1.0,\n 2.0,\n 5.0,\n 10.0, //\n 15.0,\n 30.0,\n 60.0,\n 120.0,\n 300.0,\n 600.0,\n 900.0,\n 1800.0,\n 3600.0,\n 7200.0,\n 14400.0, //\n 21600.0,\n 43200.0,\n 86400.0,\n 172800.0,\n 345600.0,\n 604800.0,\n];\n\n/**\n * Gets or sets the default time formatter used by new instances.\n *\n * @member\n * @type {AnimationViewModel.TimeFormatter}\n */\nAnimationViewModel.defaultTimeFormatter = function (date, viewModel) {\n const gregorianDate = JulianDate.toGregorianDate(date);\n const millisecond = Math.round(gregorianDate.millisecond);\n if (Math.abs(viewModel._clockViewModel.multiplier) < 1) {\n return `${gregorianDate.hour\n .toString()\n .padStart(2, \"0\")}:${gregorianDate.minute\n .toString()\n .padStart(2, \"0\")}:${gregorianDate.second\n .toString()\n .padStart(2, \"0\")}.${millisecond.toString().padStart(3, \"0\")}`;\n }\n return `${gregorianDate.hour\n .toString()\n .padStart(2, \"0\")}:${gregorianDate.minute\n .toString()\n .padStart(2, \"0\")}:${gregorianDate.second.toString().padStart(2, \"0\")} UTC`;\n};\n\n/**\n * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.\n *\n * @returns {Number[]} The array of known clock multipliers associated with the shuttle ring.\n */\nAnimationViewModel.prototype.getShuttleRingTicks = function () {\n return this._sortedFilteredPositiveTicks.slice(0);\n};\n\n/**\n * Sets the array of positive known clock multipliers to associate with the shuttle ring.\n * These values will have negative equivalents created for them and sets both the minimum\n * and maximum range of values for the shuttle ring as well as the values that are snapped\n * to when a single click is made. The values need not be in order, as they will be sorted\n * automatically, and duplicate values will be removed.\n *\n * @param {Number[]} positiveTicks The list of known positive clock multipliers to associate with the shuttle ring.\n */\nAnimationViewModel.prototype.setShuttleRingTicks = function (positiveTicks) {\n let i;\n let len;\n let tick;\n\n const hash = {};\n const sortedFilteredPositiveTicks = this._sortedFilteredPositiveTicks;\n sortedFilteredPositiveTicks.length = 0;\n for (i = 0, len = positiveTicks.length; i < len; ++i) {\n tick = positiveTicks[i];\n //filter duplicates\n if (!hash.hasOwnProperty(tick)) {\n hash[tick] = true;\n sortedFilteredPositiveTicks.push(tick);\n }\n }\n sortedFilteredPositiveTicks.sort(numberComparator);\n\n const allTicks = [];\n for (len = sortedFilteredPositiveTicks.length, i = len - 1; i >= 0; --i) {\n tick = sortedFilteredPositiveTicks[i];\n if (tick !== 0) {\n allTicks.push(-tick);\n }\n }\n Array.prototype.push.apply(allTicks, sortedFilteredPositiveTicks);\n\n this._allShuttleRingTicks = allTicks;\n};\n\nObject.defineProperties(AnimationViewModel.prototype, {\n /**\n * Gets a command that decreases the speed of animation.\n * @memberof AnimationViewModel.prototype\n * @type {Command}\n */\n slower: {\n get: function () {\n return this._slower;\n },\n },\n\n /**\n * Gets a command that increases the speed of animation.\n * @memberof AnimationViewModel.prototype\n * @type {Command}\n */\n faster: {\n get: function () {\n return this._faster;\n },\n },\n\n /**\n * Gets the clock view model.\n * @memberof AnimationViewModel.prototype\n *\n * @type {ClockViewModel}\n */\n clockViewModel: {\n get: function () {\n return this._clockViewModel;\n },\n },\n\n /**\n * Gets the pause toggle button view model.\n * @memberof AnimationViewModel.prototype\n *\n * @type {ToggleButtonViewModel}\n */\n pauseViewModel: {\n get: function () {\n return this._pauseViewModel;\n },\n },\n\n /**\n * Gets the reverse toggle button view model.\n * @memberof AnimationViewModel.prototype\n *\n * @type {ToggleButtonViewModel}\n */\n playReverseViewModel: {\n get: function () {\n return this._playReverseViewModel;\n },\n },\n\n /**\n * Gets the play toggle button view model.\n * @memberof AnimationViewModel.prototype\n *\n * @type {ToggleButtonViewModel}\n */\n playForwardViewModel: {\n get: function () {\n return this._playForwardViewModel;\n },\n },\n\n /**\n * Gets the realtime toggle button view model.\n * @memberof AnimationViewModel.prototype\n *\n * @type {ToggleButtonViewModel}\n */\n playRealtimeViewModel: {\n get: function () {\n return this._playRealtimeViewModel;\n },\n },\n\n /**\n * Gets or sets the function which formats a date for display.\n * @memberof AnimationViewModel.prototype\n *\n * @type {AnimationViewModel.DateFormatter}\n * @default AnimationViewModel.defaultDateFormatter\n */\n dateFormatter: {\n //TODO:@exception {DeveloperError} dateFormatter must be a function.\n get: function () {\n return this._dateFormatter;\n },\n set: function (dateFormatter) {\n this._dateFormatter = dateFormatter;\n },\n },\n\n /**\n * Gets or sets the function which formats a time for display.\n * @memberof AnimationViewModel.prototype\n *\n * @type {AnimationViewModel.TimeFormatter}\n * @default AnimationViewModel.defaultTimeFormatter\n */\n timeFormatter: {\n //TODO:@exception {DeveloperError} timeFormatter must be a function.\n get: function () {\n return this._timeFormatter;\n },\n set: function (timeFormatter) {\n this._timeFormatter = timeFormatter;\n },\n },\n});\n\n//Currently exposed for tests.\nAnimationViewModel._maxShuttleRingAngle = maxShuttleRingAngle;\nAnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle;\n\n/**\n * A function that formats a date for display.\n * @callback AnimationViewModel.DateFormatter\n *\n * @param {JulianDate} date The date to be formatted\n * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting.\n * @returns {String} The string representation of the calendar date portion of the provided date.\n */\n\n/**\n * A function that formats a time for display.\n * @callback AnimationViewModel.TimeFormatter\n *\n * @param {JulianDate} date The date to be formatted\n * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting.\n * @returns {String} The string representation of the time portion of the provided date.\n */\nexport default AnimationViewModel;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport EllipsoidTerrainProvider from \"../../Core/EllipsoidTerrainProvider.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link BaseLayerPicker}.\n * @alias BaseLayerPickerViewModel\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Globe} options.globe The Globe to use.\n * @param {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery.\n * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used.\n * @param {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain.\n * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.\n *\n * @exception {DeveloperError} imageryProviderViewModels must be an array.\n * @exception {DeveloperError} terrainProviderViewModels must be an array.\n */\nfunction BaseLayerPickerViewModel(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const globe = options.globe;\n const imageryProviderViewModels = defaultValue(\n options.imageryProviderViewModels,\n []\n );\n const terrainProviderViewModels = defaultValue(\n options.terrainProviderViewModels,\n []\n );\n\n this._globe = globe;\n\n /**\n * Gets or sets an array of ProviderViewModel instances available for imagery selection.\n * This property is observable.\n * @type {ProviderViewModel[]}\n */\n this.imageryProviderViewModels = imageryProviderViewModels.slice(0);\n\n /**\n * Gets or sets an array of ProviderViewModel instances available for terrain selection.\n * This property is observable.\n * @type {ProviderViewModel[]}\n */\n this.terrainProviderViewModels = terrainProviderViewModels.slice(0);\n\n /**\n * Gets or sets whether the imagery selection drop-down is currently visible.\n * @type {Boolean}\n * @default false\n */\n this.dropDownVisible = false;\n\n knockout.track(this, [\n \"imageryProviderViewModels\",\n \"terrainProviderViewModels\",\n \"dropDownVisible\",\n ]);\n\n const imageryObservable = knockout.getObservable(\n this,\n \"imageryProviderViewModels\"\n );\n const imageryProviders = knockout.pureComputed(function () {\n const providers = imageryObservable();\n const categories = {};\n let i;\n for (i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const category = provider.category;\n if (defined(categories[category])) {\n categories[category].push(provider);\n } else {\n categories[category] = [provider];\n }\n }\n const allCategoryNames = Object.keys(categories);\n\n const result = [];\n for (i = 0; i < allCategoryNames.length; i++) {\n const name = allCategoryNames[i];\n result.push({\n name: name,\n providers: categories[name],\n });\n }\n return result;\n });\n this._imageryProviders = imageryProviders;\n\n const terrainObservable = knockout.getObservable(\n this,\n \"terrainProviderViewModels\"\n );\n const terrainProviders = knockout.pureComputed(function () {\n const providers = terrainObservable();\n const categories = {};\n let i;\n for (i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const category = provider.category;\n if (defined(categories[category])) {\n categories[category].push(provider);\n } else {\n categories[category] = [provider];\n }\n }\n const allCategoryNames = Object.keys(categories);\n\n const result = [];\n for (i = 0; i < allCategoryNames.length; i++) {\n const name = allCategoryNames[i];\n result.push({\n name: name,\n providers: categories[name],\n });\n }\n return result;\n });\n this._terrainProviders = terrainProviders;\n\n /**\n * Gets the button tooltip. This property is observable.\n * @type {String}\n */\n this.buttonTooltip = undefined;\n knockout.defineProperty(this, \"buttonTooltip\", function () {\n const selectedImagery = this.selectedImagery;\n const selectedTerrain = this.selectedTerrain;\n\n const imageryTip = defined(selectedImagery)\n ? selectedImagery.name\n : undefined;\n const terrainTip = defined(selectedTerrain)\n ? selectedTerrain.name\n : undefined;\n\n if (defined(imageryTip) && defined(terrainTip)) {\n return `${imageryTip}\\n${terrainTip}`;\n } else if (defined(imageryTip)) {\n return imageryTip;\n }\n return terrainTip;\n });\n\n /**\n * Gets the button background image. This property is observable.\n * @type {String}\n */\n this.buttonImageUrl = undefined;\n knockout.defineProperty(this, \"buttonImageUrl\", function () {\n const selectedImagery = this.selectedImagery;\n if (defined(selectedImagery)) {\n return selectedImagery.iconUrl;\n }\n });\n\n /**\n * Gets or sets the currently selected imagery. This property is observable.\n * @type {ProviderViewModel}\n * @default undefined\n */\n this.selectedImagery = undefined;\n const selectedImageryViewModel = knockout.observable();\n\n this._currentImageryProviders = [];\n knockout.defineProperty(this, \"selectedImagery\", {\n get: function () {\n return selectedImageryViewModel();\n },\n set: function (value) {\n if (selectedImageryViewModel() === value) {\n this.dropDownVisible = false;\n return;\n }\n\n let i;\n const currentImageryProviders = this._currentImageryProviders;\n const currentImageryProvidersLength = currentImageryProviders.length;\n const imageryLayers = this._globe.imageryLayers;\n let hadExistingBaseLayer = false;\n for (i = 0; i < currentImageryProvidersLength; i++) {\n const layersLength = imageryLayers.length;\n for (let x = 0; x < layersLength; x++) {\n const layer = imageryLayers.get(x);\n if (layer.imageryProvider === currentImageryProviders[i]) {\n imageryLayers.remove(layer);\n hadExistingBaseLayer = true;\n break;\n }\n }\n }\n\n if (defined(value)) {\n const newProviders = value.creationCommand();\n if (Array.isArray(newProviders)) {\n const newProvidersLength = newProviders.length;\n for (i = newProvidersLength - 1; i >= 0; i--) {\n imageryLayers.addImageryProvider(newProviders[i], 0);\n }\n this._currentImageryProviders = newProviders.slice(0);\n } else {\n this._currentImageryProviders = [newProviders];\n if (hadExistingBaseLayer) {\n imageryLayers.addImageryProvider(newProviders, 0);\n } else {\n const baseLayer = imageryLayers.get(0);\n if (defined(baseLayer)) {\n imageryLayers.remove(baseLayer);\n }\n imageryLayers.addImageryProvider(newProviders, 0);\n }\n }\n }\n selectedImageryViewModel(value);\n this.dropDownVisible = false;\n },\n });\n\n /**\n * Gets or sets the currently selected terrain. This property is observable.\n * @type {ProviderViewModel}\n * @default undefined\n */\n this.selectedTerrain = undefined;\n const selectedTerrainViewModel = knockout.observable();\n\n knockout.defineProperty(this, \"selectedTerrain\", {\n get: function () {\n return selectedTerrainViewModel();\n },\n set: function (value) {\n if (selectedTerrainViewModel() === value) {\n this.dropDownVisible = false;\n return;\n }\n\n let newProvider;\n if (defined(value)) {\n newProvider = value.creationCommand();\n }\n\n this._globe.depthTestAgainstTerrain = !(\n newProvider instanceof EllipsoidTerrainProvider\n );\n this._globe.terrainProvider = newProvider;\n selectedTerrainViewModel(value);\n this.dropDownVisible = false;\n },\n });\n\n const that = this;\n this._toggleDropDown = createCommand(function () {\n that.dropDownVisible = !that.dropDownVisible;\n });\n\n this.selectedImagery = defaultValue(\n options.selectedImageryProviderViewModel,\n imageryProviderViewModels[0]\n );\n this.selectedTerrain = defaultValue(\n options.selectedTerrainProviderViewModel,\n terrainProviderViewModels[0]\n );\n}\n\nObject.defineProperties(BaseLayerPickerViewModel.prototype, {\n /**\n * Gets the command to toggle the visibility of the drop down.\n * @memberof BaseLayerPickerViewModel.prototype\n *\n * @type {Command}\n */\n toggleDropDown: {\n get: function () {\n return this._toggleDropDown;\n },\n },\n\n /**\n * Gets the globe.\n * @memberof BaseLayerPickerViewModel.prototype\n *\n * @type {Globe}\n */\n globe: {\n get: function () {\n return this._globe;\n },\n },\n});\nexport default BaseLayerPickerViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport BaseLayerPickerViewModel from \"./BaseLayerPickerViewModel.js\";\n\n/**\n * <span style=\"display: block; text-align: center;\">\n * <img src=\"Images/BaseLayerPicker.png\" width=\"264\" height=\"287\" alt=\"\" />\n * <br />BaseLayerPicker with its drop-panel open.\n * </span>\n * <br /><br />\n * The BaseLayerPicker is a single button widget that displays a panel of available imagery and\n * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted\n * as the base layer of the imagery collection; removing the existing base. When terrain is selected,\n * it replaces the current terrain provider. Each item in the available providers list contains a name,\n * a representative icon, and a tooltip to display more information when hovered. The list is initially\n * empty, and must be configured before use, as illustrated in the below example.\n *\n * @alias BaseLayerPicker\n * @constructor\n *\n * @param {Element|String} container The parent HTML container node or ID for this widget.\n * @param {Object} options Object with the following properties:\n * @param {Globe} options.globe The Globe to use.\n * @param {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery.\n * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used.\n * @param {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain.\n * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n *\n * @example\n * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,\n * // and in the body, include: <div id=\"baseLayerPickerContainer\"\n * // style=\"position:absolute;top:24px;right:24px;width:38px;height:38px;\"></div>\n *\n * //Create the list of available providers we would like the user to select from.\n * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.\n * const imageryViewModels = [];\n * imageryViewModels.push(new Cesium.ProviderViewModel({\n * name : 'Open\\u00adStreet\\u00adMap',\n * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),\n * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \\\n * map of the world.\\nhttp://www.openstreetmap.org',\n * creationFunction : function() {\n * return new Cesium.OpenStreetMapImageryProvider({\n * url : 'https://a.tile.openstreetmap.org/'\n * });\n * }\n * }));\n *\n * imageryViewModels.push(new Cesium.ProviderViewModel({\n * name : 'Earth at Night',\n * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),\n * tooltip : 'The lights of cities and villages trace the outlines of civilization \\\n * in this global view of the Earth at night as seen by NASA/NOAA\\'s Suomi NPP satellite.',\n * creationFunction : function() {\n * return new Cesium.IonImageryProvider({ assetId: 3812 });\n * }\n * }));\n *\n * imageryViewModels.push(new Cesium.ProviderViewModel({\n * name : 'Natural Earth\\u00a0II',\n * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),\n * tooltip : 'Natural Earth II, darkened for contrast.\\nhttp://www.naturalearthdata.com/',\n * creationFunction : function() {\n * return new Cesium.TileMapServiceImageryProvider({\n * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')\n * });\n * }\n * }));\n *\n * //Create a CesiumWidget without imagery, if you haven't already done so.\n * const cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });\n *\n * //Finally, create the baseLayerPicker widget using our view models.\n * const layers = cesiumWidget.imageryLayers;\n * const baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {\n * globe : cesiumWidget.scene.globe,\n * imageryProviderViewModels : imageryViewModels\n * });\n *\n * @see TerrainProvider\n * @see ImageryProvider\n * @see ImageryLayerCollection\n */\nfunction BaseLayerPicker(container, options) {\n container = getElement(container);\n\n const viewModel = new BaseLayerPickerViewModel(options);\n\n const element = document.createElement(\"button\");\n element.type = \"button\";\n element.className = \"cesium-button cesium-toolbar-button\";\n element.setAttribute(\n \"data-bind\",\n \"\\\nattr: { title: buttonTooltip },\\\nclick: toggleDropDown\"\n );\n container.appendChild(element);\n\n const imgElement = document.createElement(\"img\");\n imgElement.setAttribute(\"draggable\", \"false\");\n imgElement.className = \"cesium-baseLayerPicker-selected\";\n imgElement.setAttribute(\n \"data-bind\",\n \"\\\nattr: { src: buttonImageUrl }, visible: !!buttonImageUrl\"\n );\n element.appendChild(imgElement);\n\n const dropPanel = document.createElement(\"div\");\n dropPanel.className = \"cesium-baseLayerPicker-dropDown\";\n dropPanel.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-baseLayerPicker-dropDown-visible\" : dropDownVisible }'\n );\n container.appendChild(dropPanel);\n\n const imageryTitle = document.createElement(\"div\");\n imageryTitle.className = \"cesium-baseLayerPicker-sectionTitle\";\n imageryTitle.setAttribute(\n \"data-bind\",\n \"visible: imageryProviderViewModels.length > 0\"\n );\n imageryTitle.innerHTML = \"Imagery\";\n dropPanel.appendChild(imageryTitle);\n\n const imagerySection = document.createElement(\"div\");\n imagerySection.className = \"cesium-baseLayerPicker-section\";\n imagerySection.setAttribute(\"data-bind\", \"foreach: _imageryProviders\");\n dropPanel.appendChild(imagerySection);\n\n const imageryCategories = document.createElement(\"div\");\n imageryCategories.className = \"cesium-baseLayerPicker-category\";\n imagerySection.appendChild(imageryCategories);\n\n const categoryTitle = document.createElement(\"div\");\n categoryTitle.className = \"cesium-baseLayerPicker-categoryTitle\";\n categoryTitle.setAttribute(\"data-bind\", \"text: name\");\n imageryCategories.appendChild(categoryTitle);\n\n const imageryChoices = document.createElement(\"div\");\n imageryChoices.className = \"cesium-baseLayerPicker-choices\";\n imageryChoices.setAttribute(\"data-bind\", \"foreach: providers\");\n imageryCategories.appendChild(imageryChoices);\n\n const imageryProvider = document.createElement(\"div\");\n imageryProvider.className = \"cesium-baseLayerPicker-item\";\n imageryProvider.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-baseLayerPicker-selectedItem\" : $data === $parents[1].selectedImagery },\\\nattr: { title: tooltip },\\\nvisible: creationCommand.canExecute,\\\nclick: function($data) { $parents[1].selectedImagery = $data; }'\n );\n imageryChoices.appendChild(imageryProvider);\n\n const providerIcon = document.createElement(\"img\");\n providerIcon.className = \"cesium-baseLayerPicker-itemIcon\";\n providerIcon.setAttribute(\"data-bind\", \"attr: { src: iconUrl }\");\n providerIcon.setAttribute(\"draggable\", \"false\");\n imageryProvider.appendChild(providerIcon);\n\n const providerLabel = document.createElement(\"div\");\n providerLabel.className = \"cesium-baseLayerPicker-itemLabel\";\n providerLabel.setAttribute(\"data-bind\", \"text: name\");\n imageryProvider.appendChild(providerLabel);\n\n const terrainTitle = document.createElement(\"div\");\n terrainTitle.className = \"cesium-baseLayerPicker-sectionTitle\";\n terrainTitle.setAttribute(\n \"data-bind\",\n \"visible: terrainProviderViewModels.length > 0\"\n );\n terrainTitle.innerHTML = \"Terrain\";\n dropPanel.appendChild(terrainTitle);\n\n const terrainSection = document.createElement(\"div\");\n terrainSection.className = \"cesium-baseLayerPicker-section\";\n terrainSection.setAttribute(\"data-bind\", \"foreach: _terrainProviders\");\n dropPanel.appendChild(terrainSection);\n\n const terrainCategories = document.createElement(\"div\");\n terrainCategories.className = \"cesium-baseLayerPicker-category\";\n terrainSection.appendChild(terrainCategories);\n\n const terrainCategoryTitle = document.createElement(\"div\");\n terrainCategoryTitle.className = \"cesium-baseLayerPicker-categoryTitle\";\n terrainCategoryTitle.setAttribute(\"data-bind\", \"text: name\");\n terrainCategories.appendChild(terrainCategoryTitle);\n\n const terrainChoices = document.createElement(\"div\");\n terrainChoices.className = \"cesium-baseLayerPicker-choices\";\n terrainChoices.setAttribute(\"data-bind\", \"foreach: providers\");\n terrainCategories.appendChild(terrainChoices);\n\n const terrainProvider = document.createElement(\"div\");\n terrainProvider.className = \"cesium-baseLayerPicker-item\";\n terrainProvider.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-baseLayerPicker-selectedItem\" : $data === $parents[1].selectedTerrain },\\\nattr: { title: tooltip },\\\nvisible: creationCommand.canExecute,\\\nclick: function($data) { $parents[1].selectedTerrain = $data; }'\n );\n terrainChoices.appendChild(terrainProvider);\n\n const terrainProviderIcon = document.createElement(\"img\");\n terrainProviderIcon.className = \"cesium-baseLayerPicker-itemIcon\";\n terrainProviderIcon.setAttribute(\"data-bind\", \"attr: { src: iconUrl }\");\n terrainProviderIcon.setAttribute(\"draggable\", \"false\");\n terrainProvider.appendChild(terrainProviderIcon);\n\n const terrainProviderLabel = document.createElement(\"div\");\n terrainProviderLabel.className = \"cesium-baseLayerPicker-itemLabel\";\n terrainProviderLabel.setAttribute(\"data-bind\", \"text: name\");\n terrainProvider.appendChild(terrainProviderLabel);\n\n knockout.applyBindings(viewModel, element);\n knockout.applyBindings(viewModel, dropPanel);\n\n this._viewModel = viewModel;\n this._container = container;\n this._element = element;\n this._dropPanel = dropPanel;\n\n this._closeDropDown = function (e) {\n if (!(element.contains(e.target) || dropPanel.contains(e.target))) {\n viewModel.dropDownVisible = false;\n }\n };\n\n if (FeatureDetection.supportsPointerEvents()) {\n document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.addEventListener(\"mousedown\", this._closeDropDown, true);\n document.addEventListener(\"touchstart\", this._closeDropDown, true);\n }\n}\n\nObject.defineProperties(BaseLayerPicker.prototype, {\n /**\n * Gets the parent container.\n * @memberof BaseLayerPicker.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof BaseLayerPicker.prototype\n *\n * @type {BaseLayerPickerViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nBaseLayerPicker.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nBaseLayerPicker.prototype.destroy = function () {\n if (FeatureDetection.supportsPointerEvents()) {\n document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n }\n\n knockout.cleanNode(this._element);\n knockout.cleanNode(this._dropPanel);\n this._container.removeChild(this._element);\n this._container.removeChild(this._dropPanel);\n return destroyObject(this);\n};\nexport default BaseLayerPicker;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * A view model that represents each item in the {@link BaseLayerPicker}.\n *\n * @alias ProviderViewModel\n * @constructor\n *\n * @param {Object} options The object containing all parameters.\n * @param {String} options.name The name of the layer.\n * @param {String} options.tooltip The tooltip to show when the item is moused over.\n * @param {String} options.iconUrl An icon representing the layer.\n * @param {String} [options.category] A category for the layer.\n * @param {ProviderViewModel.CreationFunction|Command} options.creationFunction A function or Command\n * that creates one or more providers which will be added to the globe when this item is selected.\n *\n * @see BaseLayerPicker\n * @see ImageryProvider\n * @see TerrainProvider\n */\nfunction ProviderViewModel(options) {\n let creationCommand = options.creationFunction;\n if (!defined(creationCommand.canExecute)) {\n creationCommand = createCommand(creationCommand);\n }\n\n this._creationCommand = creationCommand;\n\n /**\n * Gets the display name. This property is observable.\n * @type {String}\n */\n this.name = options.name;\n\n /**\n * Gets the tooltip. This property is observable.\n * @type {String}\n */\n this.tooltip = options.tooltip;\n\n /**\n * Gets the icon. This property is observable.\n * @type {String}\n */\n this.iconUrl = options.iconUrl;\n\n this._category = defaultValue(options.category, \"\");\n\n knockout.track(this, [\"name\", \"tooltip\", \"iconUrl\"]);\n}\n\nObject.defineProperties(ProviderViewModel.prototype, {\n /**\n * Gets the Command that creates one or more providers which will be added to\n * the globe when this item is selected.\n * @memberof ProviderViewModel.prototype\n * @memberof ProviderViewModel.prototype\n * @type {Command}\n * @readonly\n */\n creationCommand: {\n get: function () {\n return this._creationCommand;\n },\n },\n\n /**\n * Gets the category\n * @type {String}\n * @memberof ProviderViewModel.prototype\n * @readonly\n */\n category: {\n get: function () {\n return this._category;\n },\n },\n});\n\n/**\n * A function which creates one or more providers.\n * @callback ProviderViewModel.CreationFunction\n * @returns {ImageryProvider|TerrainProvider|ImageryProvider[]|TerrainProvider[]}\n * The ImageryProvider or TerrainProvider, or array of providers, to be added\n * to the globe.\n */\nexport default ProviderViewModel;\n", "import buildModuleUrl from \"../../Core/buildModuleUrl.js\";\nimport ArcGisMapServerImageryProvider from \"../../Scene/ArcGisMapServerImageryProvider.js\";\nimport createWorldImagery from \"../../Scene/createWorldImagery.js\";\nimport IonImageryProvider from \"../../Scene/IonImageryProvider.js\";\nimport IonWorldImageryStyle from \"../../Scene/IonWorldImageryStyle.js\";\nimport OpenStreetMapImageryProvider from \"../../Scene/OpenStreetMapImageryProvider.js\";\nimport TileMapServiceImageryProvider from \"../../Scene/TileMapServiceImageryProvider.js\";\nimport ProviderViewModel from \"../BaseLayerPicker/ProviderViewModel.js\";\n\n/**\n * @private\n */\nfunction createDefaultImageryProviderViewModels() {\n const providerViewModels = [];\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Bing Maps Aerial\",\n iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/bingAerial.png\"),\n tooltip: \"Bing Maps aerial imagery, provided by Cesium ion\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return createWorldImagery({\n style: IonWorldImageryStyle.AERIAL,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Bing Maps Aerial with Labels\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/bingAerialLabels.png\"\n ),\n tooltip: \"Bing Maps aerial imagery with labels, provided by Cesium ion\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return createWorldImagery({\n style: IonWorldImageryStyle.AERIAL_WITH_LABELS,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Bing Maps Roads\",\n iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/bingRoads.png\"),\n tooltip: \"Bing Maps standard road maps, provided by Cesium ion\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return createWorldImagery({\n style: IonWorldImageryStyle.ROAD,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"ESRI World Imagery\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/esriWorldImagery.png\"\n ),\n tooltip:\n \"\\\nWorld Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution \\\nsatellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales \\\n(above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat \\\nimagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in \\\nparts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, \\\ni-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been \\\ncontributed by the GIS User Community.\\nhttp://www.esri.com\",\n category: \"Other\",\n creationFunction: function () {\n return new ArcGisMapServerImageryProvider({\n url:\n \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\",\n enablePickFeatures: false,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"ESRI World Street Map\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/esriWorldStreetMap.png\"\n ),\n tooltip:\n \"\\\nThis worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of \\\nCanada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, \\\nChile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\\n\\\nhttp://www.esri.com\",\n category: \"Other\",\n creationFunction: function () {\n return new ArcGisMapServerImageryProvider({\n url:\n \"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer\",\n enablePickFeatures: false,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"ESRI National Geographic\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/esriNationalGeographic.png\"\n ),\n tooltip:\n \"\\\nThis web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map \\\nfor informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web \\\nmapping applications.\\nhttp://www.esri.com\",\n category: \"Other\",\n creationFunction: function () {\n return new ArcGisMapServerImageryProvider({\n url:\n \"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/\",\n enablePickFeatures: false,\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Open\\u00adStreet\\u00adMap\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/openStreetMap.png\"\n ),\n tooltip:\n \"OpenStreetMap (OSM) is a collaborative project to create a free editable map \\\nof the world.\\nhttp://www.openstreetmap.org\",\n category: \"Other\",\n creationFunction: function () {\n return new OpenStreetMapImageryProvider({\n url: \"https://a.tile.openstreetmap.org/\",\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Stamen Watercolor\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/stamenWatercolor.png\"\n ),\n tooltip:\n \"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect \\\narea washes and organic edges over a paper texture to add warm pop to any map.\\nhttp://maps.stamen.com\",\n category: \"Other\",\n creationFunction: function () {\n return new OpenStreetMapImageryProvider({\n url: \"https://stamen-tiles.a.ssl.fastly.net/watercolor/\",\n credit:\n \"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.\",\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Stamen Toner\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/stamenToner.png\"\n ),\n tooltip: \"A high contrast black and white map.\\nhttp://maps.stamen.com\",\n category: \"Other\",\n creationFunction: function () {\n return new OpenStreetMapImageryProvider({\n url: \"https://stamen-tiles.a.ssl.fastly.net/toner/\",\n credit:\n \"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.\",\n });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Sentinel-2\",\n iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/sentinel-2.png\"),\n tooltip:\n \"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return new IonImageryProvider({ assetId: 3954 });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Blue Marble\",\n iconUrl: buildModuleUrl(\"Widgets/Images/ImageryProviders/blueMarble.png\"),\n tooltip: \"Blue Marble Next Generation July, 2004 imagery from NASA.\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return new IonImageryProvider({ assetId: 3845 });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Earth at night\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/earthAtNight.png\"\n ),\n tooltip:\n \"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return new IonImageryProvider({ assetId: 3812 });\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Natural Earth\\u00a0II\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/ImageryProviders/naturalEarthII.png\"\n ),\n tooltip:\n \"Natural Earth II, darkened for contrast.\\nhttp://www.naturalearthdata.com/\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return new TileMapServiceImageryProvider({\n url: buildModuleUrl(\"Assets/Textures/NaturalEarthII\"),\n });\n },\n })\n );\n\n return providerViewModels;\n}\nexport default createDefaultImageryProviderViewModels;\n", "import buildModuleUrl from \"../../Core/buildModuleUrl.js\";\nimport createWorldTerrain from \"../../Core/createWorldTerrain.js\";\nimport EllipsoidTerrainProvider from \"../../Core/EllipsoidTerrainProvider.js\";\nimport ProviderViewModel from \"../BaseLayerPicker/ProviderViewModel.js\";\n\n/**\n * @private\n */\nfunction createDefaultTerrainProviderViewModels() {\n const providerViewModels = [];\n providerViewModels.push(\n new ProviderViewModel({\n name: \"WGS84 Ellipsoid\",\n iconUrl: buildModuleUrl(\"Widgets/Images/TerrainProviders/Ellipsoid.png\"),\n tooltip: \"WGS84 standard ellipsoid, also known as EPSG:4326\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return new EllipsoidTerrainProvider();\n },\n })\n );\n\n providerViewModels.push(\n new ProviderViewModel({\n name: \"Cesium World Terrain\",\n iconUrl: buildModuleUrl(\n \"Widgets/Images/TerrainProviders/CesiumWorldTerrain.png\"\n ),\n tooltip:\n \"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion\",\n category: \"Cesium ion\",\n creationFunction: function () {\n return createWorldTerrain({\n requestWaterMask: true,\n requestVertexNormals: true,\n });\n },\n })\n );\n\n return providerViewModels;\n}\nexport default createDefaultTerrainProviderViewModels;\n", "import Check from \"../../Core/Check.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport ScreenSpaceEventHandler from \"../../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../../Core/ScreenSpaceEventType.js\";\nimport Cesium3DTileColorBlendMode from \"../../Scene/Cesium3DTileColorBlendMode.js\";\nimport Cesium3DTileFeature from \"../../Scene/Cesium3DTileFeature.js\";\nimport Cesium3DTilePass from \"../../Scene/Cesium3DTilePass.js\";\nimport Cesium3DTileset from \"../../Scene/Cesium3DTileset.js\";\nimport Cesium3DTileStyle from \"../../Scene/Cesium3DTileStyle.js\";\nimport PerformanceDisplay from \"../../Scene/PerformanceDisplay.js\";\nimport ResourceCache from \"../../Scene/ResourceCache.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\n\nfunction getPickTileset(viewModel) {\n return function (e) {\n const pick = viewModel._scene.pick(e.position);\n if (defined(pick) && pick.primitive instanceof Cesium3DTileset) {\n viewModel.tileset = pick.primitive;\n }\n viewModel.pickActive = false;\n };\n}\n\nfunction selectTilesetOnHover(viewModel, value) {\n if (value) {\n viewModel._eventHandler.setInputAction(function (e) {\n const pick = viewModel._scene.pick(e.endPosition);\n if (defined(pick) && pick.primitive instanceof Cesium3DTileset) {\n viewModel.tileset = pick.primitive;\n }\n }, ScreenSpaceEventType.MOUSE_MOVE);\n } else {\n viewModel._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE);\n\n // Restore hover-over selection to its current value\n // eslint-disable-next-line no-self-assign\n viewModel.picking = viewModel.picking;\n }\n}\n\nconst stringOptions = {\n maximumFractionDigits: 3,\n};\n\nfunction formatMemoryString(memorySizeInBytes) {\n const memoryInMegabytes = memorySizeInBytes / 1048576;\n if (memoryInMegabytes < 1.0) {\n return memoryInMegabytes.toLocaleString(undefined, stringOptions);\n }\n return Math.round(memoryInMegabytes).toLocaleString();\n}\n\nfunction getStatistics(tileset, isPick) {\n if (!defined(tileset)) {\n return \"\";\n }\n\n const statistics = isPick\n ? tileset._statisticsPerPass[Cesium3DTilePass.PICK]\n : tileset._statisticsPerPass[Cesium3DTilePass.RENDER];\n\n // Since the pick pass uses a smaller frustum around the pixel of interest,\n // the statistics will be different than the normal render pass.\n let s = '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Rendering statistics\n `<li><strong>Visited: </strong>${statistics.visited.toLocaleString()}</li>` +\n // Number of commands returned is likely to be higher than the number of tiles selected\n // because of tiles that create multiple commands.\n `<li><strong>Selected: </strong>${statistics.selected.toLocaleString()}</li>` +\n // Number of commands executed is likely to be higher because of commands overlapping\n // multiple frustums.\n `<li><strong>Commands: </strong>${statistics.numberOfCommands.toLocaleString()}</li>`;\n s += \"</ul>\";\n if (!isPick) {\n s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Cache/loading statistics\n `<li><strong>Requests: </strong>${statistics.numberOfPendingRequests.toLocaleString()}</li>` +\n `<li><strong>Attempted: </strong>${statistics.numberOfAttemptedRequests.toLocaleString()}</li>` +\n `<li><strong>Processing: </strong>${statistics.numberOfTilesProcessing.toLocaleString()}</li>` +\n `<li><strong>Content Ready: </strong>${statistics.numberOfTilesWithContentReady.toLocaleString()}</li>` +\n // Total number of tiles includes tiles without content, so \"Ready\" may never reach\n // \"Total.\" Total also will increase when a tile with a tileset JSON content is loaded.\n `<li><strong>Total: </strong>${statistics.numberOfTilesTotal.toLocaleString()}</li>`;\n s += \"</ul>\";\n s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Features statistics\n `<li><strong>Features Selected: </strong>${statistics.numberOfFeaturesSelected.toLocaleString()}</li>` +\n `<li><strong>Features Loaded: </strong>${statistics.numberOfFeaturesLoaded.toLocaleString()}</li>` +\n `<li><strong>Points Selected: </strong>${statistics.numberOfPointsSelected.toLocaleString()}</li>` +\n `<li><strong>Points Loaded: </strong>${statistics.numberOfPointsLoaded.toLocaleString()}</li>` +\n `<li><strong>Triangles Selected: </strong>${statistics.numberOfTrianglesSelected.toLocaleString()}</li>`;\n s += \"</ul>\";\n s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Styling statistics\n `<li><strong>Tiles styled: </strong>${statistics.numberOfTilesStyled.toLocaleString()}</li>` +\n `<li><strong>Features styled: </strong>${statistics.numberOfFeaturesStyled.toLocaleString()}</li>`;\n s += \"</ul>\";\n s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Optimization statistics\n `<li><strong>Children Union Culled: </strong>${statistics.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`;\n s += \"</ul>\";\n s += '<ul class=\"cesium-cesiumInspector-statistics\">';\n s +=\n // --- Memory statistics\n `<li><strong>Geometry Memory (MB): </strong>${formatMemoryString(\n statistics.geometryByteLength\n )}</li>` +\n `<li><strong>Texture Memory (MB): </strong>${formatMemoryString(\n statistics.texturesByteLength\n )}</li>` +\n `<li><strong>Batch Table Memory (MB): </strong>${formatMemoryString(\n statistics.batchTableByteLength\n )}</li>`;\n s += \"</ul>\";\n }\n return s;\n}\n\nfunction getResourceCacheStatistics() {\n const statistics = ResourceCache.statistics;\n\n return `\n <ul class=\"cesium-cesiumInspector-statistics\">\n <li><strong>Geometry Memory (MB): </strong>${formatMemoryString(\n statistics.geometryByteLength\n )}</li>\n <li><strong>Texture Memory (MB): </strong>${formatMemoryString(\n statistics.texturesByteLength\n )}</li>\n </ul>\n `;\n}\n\nconst colorBlendModes = [\n {\n text: \"Highlight\",\n value: Cesium3DTileColorBlendMode.HIGHLIGHT,\n },\n {\n text: \"Replace\",\n value: Cesium3DTileColorBlendMode.REPLACE,\n },\n {\n text: \"Mix\",\n value: Cesium3DTileColorBlendMode.MIX,\n },\n];\n\nconst highlightColor = new Color(1.0, 1.0, 0.0, 0.4);\nconst scratchColor = new Color();\nconst oldColor = new Color();\n\n/**\n * The view model for {@link Cesium3DTilesInspector}.\n * @alias Cesium3DTilesInspectorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {HTMLElement} performanceContainer The container for the performance display\n */\nfunction Cesium3DTilesInspectorViewModel(scene, performanceContainer) {\n const that = this;\n const canvas = scene.canvas;\n this._eventHandler = new ScreenSpaceEventHandler(canvas);\n this._scene = scene;\n this._performanceContainer = performanceContainer;\n this._canvas = canvas;\n\n this._performanceDisplay = new PerformanceDisplay({\n container: performanceContainer,\n });\n\n this._statisticsText = \"\";\n this._pickStatisticsText = \"\";\n this._resourceCacheStatisticsText = \"\";\n this._editorError = \"\";\n\n /**\n * Gets or sets the flag to enable performance display. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.performance = false;\n\n /**\n * Gets or sets the flag to show statistics. This property is observable.\n *\n * @type {Boolean}\n * @default true\n */\n this.showStatistics = true;\n\n /**\n * Gets or sets the flag to show pick statistics. This property is observable.\n *\n * @type {Boolean}\n * @default true\n */\n this.showPickStatistics = true;\n\n /**\n * Gets or sets the flag to show resource cache statistics. This property is\n * observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showResourceCacheStatistics = false;\n\n /**\n * Gets or sets the flag to show the inspector. This property is observable.\n *\n * @type {Boolean}\n * @default true\n */\n this.inspectorVisible = true;\n\n /**\n * Gets or sets the flag to show the tileset section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.tilesetVisible = false;\n\n /**\n * Gets or sets the flag to show the display section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.displayVisible = false;\n\n /**\n * Gets or sets the flag to show the update section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.updateVisible = false;\n\n /**\n * Gets or sets the flag to show the logging section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.loggingVisible = false;\n\n /**\n * Gets or sets the flag to show the style section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.styleVisible = false;\n\n /**\n * Gets or sets the flag to show the tile info section. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.tileDebugLabelsVisible = false;\n\n /**\n * Gets or sets the flag to show the optimization info section. This property is observable.\n *\n * @type {Boolean}\n * @default false;\n */\n this.optimizationVisible = false;\n\n /**\n * Gets or sets the JSON for the tileset style. This property is observable.\n *\n * @type {String}\n * @default '{}'\n */\n this.styleString = \"{}\";\n\n /**\n * Gets or sets the JSON for the tileset enableDebugWireframe attribute. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.hasEnabledWireframe = false;\n\n this._tileset = undefined;\n this._feature = undefined;\n this._tile = undefined;\n\n knockout.track(this, [\n \"performance\",\n \"inspectorVisible\",\n \"_statisticsText\",\n \"_pickStatisticsText\",\n \"_resourceCacheStatisticsText\",\n \"_editorError\",\n \"showPickStatistics\",\n \"showStatistics\",\n \"showResourceCacheStatistics\",\n \"tilesetVisible\",\n \"displayVisible\",\n \"updateVisible\",\n \"loggingVisible\",\n \"styleVisible\",\n \"optimizationVisible\",\n \"tileDebugLabelsVisible\",\n \"styleString\",\n \"_feature\",\n \"_tile\",\n \"_tileset\",\n \"hasEnabledWireframe\",\n ]);\n\n this._properties = knockout.observable({});\n /**\n * Gets the names of the properties in the tileset. This property is observable.\n * @type {String[]}\n * @readonly\n */\n this.properties = [];\n knockout.defineProperty(this, \"properties\", function () {\n const names = [];\n const properties = that._properties();\n for (const prop in properties) {\n if (properties.hasOwnProperty(prop)) {\n names.push(prop);\n }\n }\n return names;\n });\n\n const dynamicScreenSpaceError = knockout.observable();\n knockout.defineProperty(this, \"dynamicScreenSpaceError\", {\n get: function () {\n return dynamicScreenSpaceError();\n },\n set: function (value) {\n dynamicScreenSpaceError(value);\n if (defined(that._tileset)) {\n that._tileset.dynamicScreenSpaceError = value;\n }\n },\n });\n /**\n * Gets or sets the flag to enable dynamic screen space error. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.dynamicScreenSpaceError = false;\n\n const colorBlendMode = knockout.observable();\n knockout.defineProperty(this, \"colorBlendMode\", {\n get: function () {\n return colorBlendMode();\n },\n set: function (value) {\n colorBlendMode(value);\n if (defined(that._tileset)) {\n that._tileset.colorBlendMode = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the color blend mode. This property is observable.\n *\n * @type {Cesium3DTileColorBlendMode}\n * @default Cesium3DTileColorBlendMode.HIGHLIGHT\n */\n this.colorBlendMode = Cesium3DTileColorBlendMode.HIGHLIGHT;\n\n const showOnlyPickedTileDebugLabel = knockout.observable();\n const picking = knockout.observable();\n knockout.defineProperty(this, \"picking\", {\n get: function () {\n return picking();\n },\n set: function (value) {\n picking(value);\n if (value) {\n that._eventHandler.setInputAction(function (e) {\n const picked = scene.pick(e.endPosition);\n if (picked instanceof Cesium3DTileFeature) {\n // Picked a feature\n that.feature = picked;\n that.tile = picked.content.tile;\n } else if (defined(picked) && defined(picked.content)) {\n // Picked a tile\n that.feature = undefined;\n that.tile = picked.content.tile;\n } else {\n // Picked nothing\n that.feature = undefined;\n that.tile = undefined;\n }\n if (!defined(that._tileset)) {\n return;\n }\n if (\n showOnlyPickedTileDebugLabel &&\n defined(picked) &&\n defined(picked.content)\n ) {\n let position;\n if (scene.pickPositionSupported) {\n position = scene.pickPosition(e.endPosition);\n if (defined(position)) {\n that._tileset.debugPickPosition = position;\n }\n }\n that._tileset.debugPickedTile = picked.content.tile;\n } else {\n that._tileset.debugPickedTile = undefined;\n }\n that._scene.requestRender();\n }, ScreenSpaceEventType.MOUSE_MOVE);\n } else {\n that.feature = undefined;\n that.tile = undefined;\n that._eventHandler.removeInputAction(ScreenSpaceEventType.MOUSE_MOVE);\n }\n },\n });\n /**\n * Gets or sets the flag to enable picking. This property is observable.\n *\n * @type {Boolean}\n * @default true\n */\n this.picking = true;\n\n const colorize = knockout.observable();\n knockout.defineProperty(this, \"colorize\", {\n get: function () {\n return colorize();\n },\n set: function (value) {\n colorize(value);\n if (defined(that._tileset)) {\n that._tileset.debugColorizeTiles = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to colorize tiles. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.colorize = false;\n\n const wireframe = knockout.observable();\n knockout.defineProperty(this, \"wireframe\", {\n get: function () {\n return wireframe();\n },\n set: function (value) {\n wireframe(value);\n if (defined(that._tileset)) {\n that._tileset.debugWireframe = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to draw with wireframe. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.wireframe = false;\n\n const showBoundingVolumes = knockout.observable();\n knockout.defineProperty(this, \"showBoundingVolumes\", {\n get: function () {\n return showBoundingVolumes();\n },\n set: function (value) {\n showBoundingVolumes(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowBoundingVolume = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show bounding volumes. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showBoundingVolumes = false;\n\n const showContentBoundingVolumes = knockout.observable();\n knockout.defineProperty(this, \"showContentBoundingVolumes\", {\n get: function () {\n return showContentBoundingVolumes();\n },\n set: function (value) {\n showContentBoundingVolumes(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowContentBoundingVolume = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show content volumes. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showContentBoundingVolumes = false;\n\n const showRequestVolumes = knockout.observable();\n knockout.defineProperty(this, \"showRequestVolumes\", {\n get: function () {\n return showRequestVolumes();\n },\n set: function (value) {\n showRequestVolumes(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowViewerRequestVolume = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show request volumes. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showRequestVolumes = false;\n\n const freezeFrame = knockout.observable();\n knockout.defineProperty(this, \"freezeFrame\", {\n get: function () {\n return freezeFrame();\n },\n set: function (value) {\n freezeFrame(value);\n if (defined(that._tileset)) {\n that._tileset.debugFreezeFrame = value;\n that._scene.debugShowFrustumPlanes = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to suspend updates. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.freezeFrame = false;\n\n knockout.defineProperty(this, \"showOnlyPickedTileDebugLabel\", {\n get: function () {\n return showOnlyPickedTileDebugLabel();\n },\n set: function (value) {\n showOnlyPickedTileDebugLabel(value);\n if (defined(that._tileset)) {\n that._tileset.debugPickedTileLabelOnly = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showOnlyPickedTileDebugLabel = false;\n\n const showGeometricError = knockout.observable();\n knockout.defineProperty(this, \"showGeometricError\", {\n get: function () {\n return showGeometricError();\n },\n set: function (value) {\n showGeometricError(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowGeometricError = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show tile geometric error. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showGeometricError = false;\n\n const showRenderingStatistics = knockout.observable();\n knockout.defineProperty(this, \"showRenderingStatistics\", {\n get: function () {\n return showRenderingStatistics();\n },\n set: function (value) {\n showRenderingStatistics(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowRenderingStatistics = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Displays the number of commands, points, triangles and features used per tile. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showRenderingStatistics = false;\n\n const showMemoryUsage = knockout.observable();\n knockout.defineProperty(this, \"showMemoryUsage\", {\n get: function () {\n return showMemoryUsage();\n },\n set: function (value) {\n showMemoryUsage(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowMemoryUsage = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Displays the memory used per tile. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showMemoryUsage = false;\n\n const showUrl = knockout.observable();\n knockout.defineProperty(this, \"showUrl\", {\n get: function () {\n return showUrl();\n },\n set: function (value) {\n showUrl(value);\n if (defined(that._tileset)) {\n that._tileset.debugShowUrl = value;\n that._scene.requestRender();\n }\n },\n });\n /**\n * Gets or sets the flag to show the tile url. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.showUrl = false;\n\n const maximumScreenSpaceError = knockout.observable();\n knockout.defineProperty(this, \"maximumScreenSpaceError\", {\n get: function () {\n return maximumScreenSpaceError();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n maximumScreenSpaceError(value);\n if (defined(that._tileset)) {\n that._tileset.maximumScreenSpaceError = value;\n }\n }\n },\n });\n /**\n * Gets or sets the maximum screen space error. This property is observable.\n *\n * @type {Number}\n * @default 16\n */\n this.maximumScreenSpaceError = 16;\n\n const dynamicScreenSpaceErrorDensity = knockout.observable();\n knockout.defineProperty(this, \"dynamicScreenSpaceErrorDensity\", {\n get: function () {\n return dynamicScreenSpaceErrorDensity();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n dynamicScreenSpaceErrorDensity(value);\n if (defined(that._tileset)) {\n that._tileset.dynamicScreenSpaceErrorDensity = value;\n }\n }\n },\n });\n /**\n * Gets or sets the dynamic screen space error density. This property is observable.\n *\n * @type {Number}\n * @default 0.00278\n */\n this.dynamicScreenSpaceErrorDensity = 0.00278;\n\n /**\n * Gets or sets the dynamic screen space error density slider value.\n * This allows the slider to be exponential because values tend to be closer to 0 than 1.\n * This property is observable.\n *\n * @type {Number}\n * @default 0.00278\n */\n this.dynamicScreenSpaceErrorDensitySliderValue = undefined;\n knockout.defineProperty(this, \"dynamicScreenSpaceErrorDensitySliderValue\", {\n get: function () {\n return Math.pow(dynamicScreenSpaceErrorDensity(), 1 / 6);\n },\n set: function (value) {\n dynamicScreenSpaceErrorDensity(Math.pow(value, 6));\n },\n });\n\n const dynamicScreenSpaceErrorFactor = knockout.observable();\n knockout.defineProperty(this, \"dynamicScreenSpaceErrorFactor\", {\n get: function () {\n return dynamicScreenSpaceErrorFactor();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n dynamicScreenSpaceErrorFactor(value);\n if (defined(that._tileset)) {\n that._tileset.dynamicScreenSpaceErrorFactor = value;\n }\n }\n },\n });\n /**\n * Gets or sets the dynamic screen space error factor. This property is observable.\n *\n * @type {Number}\n * @default 4.0\n */\n this.dynamicScreenSpaceErrorFactor = 4.0;\n\n const pickTileset = getPickTileset(this);\n const pickActive = knockout.observable();\n knockout.defineProperty(this, \"pickActive\", {\n get: function () {\n return pickActive();\n },\n set: function (value) {\n pickActive(value);\n if (value) {\n that._eventHandler.setInputAction(\n pickTileset,\n ScreenSpaceEventType.LEFT_CLICK\n );\n } else {\n that._eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n }\n },\n });\n\n const pointCloudShading = knockout.observable();\n knockout.defineProperty(this, \"pointCloudShading\", {\n get: function () {\n return pointCloudShading();\n },\n set: function (value) {\n pointCloudShading(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.attenuation = value;\n }\n },\n });\n /**\n * Gets or sets the flag to enable point cloud shading. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.pointCloudShading = false;\n\n const geometricErrorScale = knockout.observable();\n knockout.defineProperty(this, \"geometricErrorScale\", {\n get: function () {\n return geometricErrorScale();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n geometricErrorScale(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.geometricErrorScale = value;\n }\n }\n },\n });\n /**\n * Gets or sets the geometric error scale. This property is observable.\n *\n * @type {Number}\n * @default 1.0\n */\n this.geometricErrorScale = 1.0;\n\n const maximumAttenuation = knockout.observable();\n knockout.defineProperty(this, \"maximumAttenuation\", {\n get: function () {\n return maximumAttenuation();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n maximumAttenuation(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.maximumAttenuation =\n value === 0 ? undefined : value;\n }\n }\n },\n });\n /**\n * Gets or sets the maximum attenuation. This property is observable.\n *\n * @type {Number}\n * @default 0\n */\n this.maximumAttenuation = 0;\n\n const baseResolution = knockout.observable();\n knockout.defineProperty(this, \"baseResolution\", {\n get: function () {\n return baseResolution();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n baseResolution(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.baseResolution =\n value === 0 ? undefined : value;\n }\n }\n },\n });\n /**\n * Gets or sets the base resolution. This property is observable.\n *\n * @type {Number}\n * @default 0\n */\n this.baseResolution = 0;\n\n const eyeDomeLighting = knockout.observable();\n knockout.defineProperty(this, \"eyeDomeLighting\", {\n get: function () {\n return eyeDomeLighting();\n },\n set: function (value) {\n eyeDomeLighting(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.eyeDomeLighting = value;\n }\n },\n });\n /**\n * Gets or sets the flag to enable eye dome lighting. This property is observable.\n *\n * @type {Boolean}\n * @default false\n */\n this.eyeDomeLighting = false;\n\n const eyeDomeLightingStrength = knockout.observable();\n knockout.defineProperty(this, \"eyeDomeLightingStrength\", {\n get: function () {\n return eyeDomeLightingStrength();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n eyeDomeLightingStrength(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.eyeDomeLightingStrength = value;\n }\n }\n },\n });\n /**\n * Gets or sets the eye dome lighting strength. This property is observable.\n *\n * @type {Number}\n * @default 1.0\n */\n this.eyeDomeLightingStrength = 1.0;\n\n const eyeDomeLightingRadius = knockout.observable();\n knockout.defineProperty(this, \"eyeDomeLightingRadius\", {\n get: function () {\n return eyeDomeLightingRadius();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n eyeDomeLightingRadius(value);\n if (defined(that._tileset)) {\n that._tileset.pointCloudShading.eyeDomeLightingRadius = value;\n }\n }\n },\n });\n /**\n * Gets or sets the eye dome lighting radius. This property is observable.\n *\n * @type {Number}\n * @default 1.0\n */\n this.eyeDomeLightingRadius = 1.0;\n\n /**\n * Gets or sets the pick state\n *\n * @type {Boolean}\n * @default false\n */\n this.pickActive = false;\n\n const skipLevelOfDetail = knockout.observable();\n knockout.defineProperty(this, \"skipLevelOfDetail\", {\n get: function () {\n return skipLevelOfDetail();\n },\n set: function (value) {\n skipLevelOfDetail(value);\n if (defined(that._tileset)) {\n that._tileset.skipLevelOfDetail = value;\n }\n },\n });\n /**\n * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.\n * This property is observable.\n * @type {Boolean}\n * @default true\n */\n this.skipLevelOfDetail = true;\n\n const skipScreenSpaceErrorFactor = knockout.observable();\n knockout.defineProperty(this, \"skipScreenSpaceErrorFactor\", {\n get: function () {\n return skipScreenSpaceErrorFactor();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n skipScreenSpaceErrorFactor(value);\n if (defined(that._tileset)) {\n that._tileset.skipScreenSpaceErrorFactor = value;\n }\n }\n },\n });\n /**\n * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.\n * @type {Number}\n * @default 16\n */\n this.skipScreenSpaceErrorFactor = 16;\n\n const baseScreenSpaceError = knockout.observable();\n knockout.defineProperty(this, \"baseScreenSpaceError\", {\n get: function () {\n return baseScreenSpaceError();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n baseScreenSpaceError(value);\n if (defined(that._tileset)) {\n that._tileset.baseScreenSpaceError = value;\n }\n }\n },\n });\n /**\n * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.\n * @type {Number}\n * @default 1024\n */\n this.baseScreenSpaceError = 1024;\n\n const skipLevels = knockout.observable();\n knockout.defineProperty(this, \"skipLevels\", {\n get: function () {\n return skipLevels();\n },\n set: function (value) {\n value = Number(value);\n if (!isNaN(value)) {\n skipLevels(value);\n if (defined(that._tileset)) {\n that._tileset.skipLevels = value;\n }\n }\n },\n });\n /**\n * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.\n * @type {Number}\n * @default 1\n */\n this.skipLevels = 1;\n\n const immediatelyLoadDesiredLevelOfDetail = knockout.observable();\n knockout.defineProperty(this, \"immediatelyLoadDesiredLevelOfDetail\", {\n get: function () {\n return immediatelyLoadDesiredLevelOfDetail();\n },\n set: function (value) {\n immediatelyLoadDesiredLevelOfDetail(value);\n if (defined(that._tileset)) {\n that._tileset.immediatelyLoadDesiredLevelOfDetail = value;\n }\n },\n });\n /**\n * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.\n * This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.immediatelyLoadDesiredLevelOfDetail = false;\n\n const loadSiblings = knockout.observable();\n knockout.defineProperty(this, \"loadSiblings\", {\n get: function () {\n return loadSiblings();\n },\n set: function (value) {\n loadSiblings(value);\n if (defined(that._tileset)) {\n that._tileset.loadSiblings = value;\n }\n },\n });\n /**\n * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.\n * This property is observable\n * @type {Boolean}\n * @default false\n */\n this.loadSiblings = false;\n\n this._style = undefined;\n this._shouldStyle = false;\n this._definedProperties = [\n \"properties\",\n \"dynamicScreenSpaceError\",\n \"colorBlendMode\",\n \"picking\",\n \"colorize\",\n \"wireframe\",\n \"showBoundingVolumes\",\n \"showContentBoundingVolumes\",\n \"showRequestVolumes\",\n \"freezeFrame\",\n \"maximumScreenSpaceError\",\n \"dynamicScreenSpaceErrorDensity\",\n \"baseScreenSpaceError\",\n \"skipScreenSpaceErrorFactor\",\n \"skipLevelOfDetail\",\n \"skipLevels\",\n \"immediatelyLoadDesiredLevelOfDetail\",\n \"loadSiblings\",\n \"dynamicScreenSpaceErrorDensitySliderValue\",\n \"dynamicScreenSpaceErrorFactor\",\n \"pickActive\",\n \"showOnlyPickedTileDebugLabel\",\n \"showGeometricError\",\n \"showRenderingStatistics\",\n \"showMemoryUsage\",\n \"showUrl\",\n \"pointCloudShading\",\n \"geometricErrorScale\",\n \"maximumAttenuation\",\n \"baseResolution\",\n \"eyeDomeLighting\",\n \"eyeDomeLightingStrength\",\n \"eyeDomeLightingRadius\",\n ];\n this._removePostRenderEvent = scene.postRender.addEventListener(function () {\n that._update();\n });\n\n if (!defined(this._tileset)) {\n selectTilesetOnHover(this, true);\n }\n}\n\nObject.defineProperties(Cesium3DTilesInspectorViewModel.prototype, {\n /**\n * Gets the scene\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {Scene}\n * @readonly\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n /**\n * Gets the performance container\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {HTMLElement}\n * @readonly\n */\n performanceContainer: {\n get: function () {\n return this._performanceContainer;\n },\n },\n\n /**\n * Gets the statistics text. This property is observable.\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {String}\n * @readonly\n */\n statisticsText: {\n get: function () {\n return this._statisticsText;\n },\n },\n /**\n * Gets the pick statistics text. This property is observable.\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {String}\n * @readonly\n */\n pickStatisticsText: {\n get: function () {\n return this._pickStatisticsText;\n },\n },\n\n /**\n * Gets the resource cache statistics text. This property is observable.\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {String}\n * @readonly\n */\n resourceCacheStatisticsText: {\n get: function () {\n return this._resourceCacheStatisticsText;\n },\n },\n\n /**\n * Gets the available blend modes\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {Object[]}\n * @readonly\n */\n colorBlendModes: {\n get: function () {\n return colorBlendModes;\n },\n },\n\n /**\n * Gets the editor error message\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {String}\n * @readonly\n */\n editorError: {\n get: function () {\n return this._editorError;\n },\n },\n\n /**\n * Gets or sets the tileset of the view model.\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {Cesium3DTileset}\n */\n tileset: {\n get: function () {\n return this._tileset;\n },\n set: function (tileset) {\n this._tileset = tileset;\n this._style = undefined;\n this.styleString = \"{}\";\n this.feature = undefined;\n this.tile = undefined;\n\n if (defined(tileset)) {\n const that = this;\n tileset.readyPromise.then(function (t) {\n if (!that.isDestroyed()) {\n that._properties(t.properties);\n }\n });\n\n // update tileset with existing settings\n const settings = [\n \"colorize\",\n \"wireframe\",\n \"showBoundingVolumes\",\n \"showContentBoundingVolumes\",\n \"showRequestVolumes\",\n \"freezeFrame\",\n \"showOnlyPickedTileDebugLabel\",\n \"showGeometricError\",\n \"showRenderingStatistics\",\n \"showMemoryUsage\",\n \"showUrl\",\n ];\n const length = settings.length;\n for (let i = 0; i < length; ++i) {\n const setting = settings[i];\n //eslint-disable-next-line no-self-assign\n this[setting] = this[setting];\n }\n\n // update view model with existing tileset settings\n this.maximumScreenSpaceError = tileset.maximumScreenSpaceError;\n this.dynamicScreenSpaceError = tileset.dynamicScreenSpaceError;\n this.dynamicScreenSpaceErrorDensity =\n tileset.dynamicScreenSpaceErrorDensity;\n this.dynamicScreenSpaceErrorFactor =\n tileset.dynamicScreenSpaceErrorFactor;\n this.colorBlendMode = tileset.colorBlendMode;\n this.skipLevelOfDetail = tileset.skipLevelOfDetail;\n this.skipScreenSpaceErrorFactor = tileset.skipScreenSpaceErrorFactor;\n this.baseScreenSpaceError = tileset.baseScreenSpaceError;\n this.skipLevels = tileset.skipLevels;\n this.immediatelyLoadDesiredLevelOfDetail =\n tileset.immediatelyLoadDesiredLevelOfDetail;\n this.loadSiblings = tileset.loadSiblings;\n this.hasEnabledWireframe = tileset._enableDebugWireframe;\n\n const pointCloudShading = tileset.pointCloudShading;\n this.pointCloudShading = pointCloudShading.attenuation;\n this.geometricErrorScale = pointCloudShading.geometricErrorScale;\n this.maximumAttenuation = pointCloudShading.maximumAttenuation\n ? pointCloudShading.maximumAttenuation\n : 0.0;\n this.baseResolution = pointCloudShading.baseResolution\n ? pointCloudShading.baseResolution\n : 0.0;\n this.eyeDomeLighting = pointCloudShading.eyeDomeLighting;\n this.eyeDomeLightingStrength =\n pointCloudShading.eyeDomeLightingStrength;\n this.eyeDomeLightingRadius = pointCloudShading.eyeDomeLightingRadius;\n\n this._scene.requestRender();\n } else {\n this._properties({});\n }\n\n this._statisticsText = getStatistics(tileset, false);\n this._pickStatisticsText = getStatistics(tileset, true);\n this._resourceCacheStatisticsText = getResourceCacheStatistics();\n selectTilesetOnHover(this, false);\n },\n },\n\n /**\n * Gets the current feature of the view model.\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {Cesium3DTileFeature}\n */\n feature: {\n get: function () {\n return this._feature;\n },\n set: function (feature) {\n if (this._feature === feature) {\n return;\n }\n const currentFeature = this._feature;\n if (defined(currentFeature) && !currentFeature.content.isDestroyed()) {\n // Restore original color to feature that is no longer selected\n if (!this.colorize && defined(this._style)) {\n currentFeature.color = defined(this._style.color)\n ? this._style.color.evaluateColor(currentFeature, scratchColor)\n : Color.WHITE;\n } else {\n currentFeature.color = oldColor;\n }\n this._scene.requestRender();\n }\n if (defined(feature)) {\n // Highlight new feature\n Color.clone(feature.color, oldColor);\n feature.color = highlightColor;\n this._scene.requestRender();\n }\n this._feature = feature;\n },\n },\n\n /**\n * Gets the current tile of the view model\n * @memberof Cesium3DTilesInspectorViewModel.prototype\n * @type {Cesium3DTile}\n */\n tile: {\n get: function () {\n return this._tile;\n },\n set: function (tile) {\n if (this._tile === tile) {\n return;\n }\n const currentTile = this._tile;\n\n if (\n defined(currentTile) &&\n !currentTile.isDestroyed() &&\n !hasFeatures(currentTile.content)\n ) {\n // Restore original color to tile that is no longer selected\n currentTile.color = oldColor;\n this._scene.requestRender();\n }\n\n if (defined(tile) && !hasFeatures(tile.content)) {\n // Highlight new tile\n Color.clone(tile.color, oldColor);\n tile.color = highlightColor;\n this._scene.requestRender();\n }\n this._tile = tile;\n },\n },\n});\n\nfunction hasFeatures(content) {\n if (!defined(content)) {\n return false;\n }\n\n if (content.featuresLength > 0) {\n return true;\n }\n const innerContents = content.innerContents;\n if (defined(innerContents)) {\n const length = innerContents.length;\n for (let i = 0; i < length; ++i) {\n if (!hasFeatures(innerContents[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n\n/**\n * Toggles the pick tileset mode\n */\nCesium3DTilesInspectorViewModel.prototype.togglePickTileset = function () {\n this.pickActive = !this.pickActive;\n};\n\n/**\n * Toggles the inspector visibility\n */\nCesium3DTilesInspectorViewModel.prototype.toggleInspector = function () {\n this.inspectorVisible = !this.inspectorVisible;\n};\n\n/**\n * Toggles the visibility of the tileset section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleTileset = function () {\n this.tilesetVisible = !this.tilesetVisible;\n};\n\n/**\n * Toggles the visibility of the display section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleDisplay = function () {\n this.displayVisible = !this.displayVisible;\n};\n\n/**\n * Toggles the visibility of the update section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleUpdate = function () {\n this.updateVisible = !this.updateVisible;\n};\n\n/**\n * Toggles the visibility of the logging section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleLogging = function () {\n this.loggingVisible = !this.loggingVisible;\n};\n\n/**\n * Toggles the visibility of the style section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleStyle = function () {\n this.styleVisible = !this.styleVisible;\n};\n\n/**\n * Toggles the visibility of the tile Debug Info section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels = function () {\n this.tileDebugLabelsVisible = !this.tileDebugLabelsVisible;\n};\n\n/**\n * Toggles the visibility of the optimization section\n */\nCesium3DTilesInspectorViewModel.prototype.toggleOptimization = function () {\n this.optimizationVisible = !this.optimizationVisible;\n};\n\n/**\n * Trims tile cache\n */\nCesium3DTilesInspectorViewModel.prototype.trimTilesCache = function () {\n if (defined(this._tileset)) {\n this._tileset.trimLoadedTiles();\n }\n};\n\n/**\n * Compiles the style in the style editor.\n */\nCesium3DTilesInspectorViewModel.prototype.compileStyle = function () {\n const tileset = this._tileset;\n if (!defined(tileset) || this.styleString === JSON.stringify(tileset.style)) {\n return;\n }\n this._editorError = \"\";\n try {\n if (this.styleString.length === 0) {\n this.styleString = \"{}\";\n }\n this._style = new Cesium3DTileStyle(JSON.parse(this.styleString));\n this._shouldStyle = true;\n this._scene.requestRender();\n } catch (err) {\n this._editorError = err.toString();\n }\n\n // set feature again so pick coloring is set\n this.feature = this._feature;\n this.tile = this._tile;\n};\n\n/**\n * Handles key press events on the style editor.\n */\nCesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress = function (\n sender,\n event\n) {\n if (event.keyCode === 9) {\n //tab\n event.preventDefault();\n const textArea = event.target;\n const start = textArea.selectionStart;\n const end = textArea.selectionEnd;\n let newEnd = end;\n const selected = textArea.value.slice(start, end);\n const lines = selected.split(\"\\n\");\n const length = lines.length;\n let i;\n if (!event.shiftKey) {\n for (i = 0; i < length; ++i) {\n lines[i] = ` ${lines[i]}`;\n newEnd += 2;\n }\n } else {\n for (i = 0; i < length; ++i) {\n if (lines[i][0] === \" \") {\n if (lines[i][1] === \" \") {\n lines[i] = lines[i].substr(2);\n newEnd -= 2;\n } else {\n lines[i] = lines[i].substr(1);\n newEnd -= 1;\n }\n }\n }\n }\n const newText = lines.join(\"\\n\");\n textArea.value =\n textArea.value.slice(0, start) + newText + textArea.value.slice(end);\n textArea.selectionStart = start !== end ? start : newEnd;\n textArea.selectionEnd = newEnd;\n } else if (event.ctrlKey && (event.keyCode === 10 || event.keyCode === 13)) {\n //ctrl + enter\n this.compileStyle();\n }\n return true;\n};\n\n/**\n * Updates the values of view model\n * @private\n */\nCesium3DTilesInspectorViewModel.prototype._update = function () {\n const tileset = this._tileset;\n\n if (this.performance) {\n this._performanceDisplay.update();\n }\n\n if (defined(tileset)) {\n if (tileset.isDestroyed()) {\n this.tile = undefined;\n this.feature = undefined;\n this.tileset = undefined;\n return;\n }\n\n const style = tileset.style;\n if (this._style !== tileset.style) {\n if (this._shouldStyle) {\n tileset.style = this._style;\n this._shouldStyle = false;\n } else {\n this._style = style;\n this.styleString = JSON.stringify(style.style, null, \" \");\n }\n }\n }\n if (this.showStatistics) {\n this._statisticsText = getStatistics(tileset, false);\n this._pickStatisticsText = getStatistics(tileset, true);\n this._resourceCacheStatisticsText = getResourceCacheStatistics();\n }\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nCesium3DTilesInspectorViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nCesium3DTilesInspectorViewModel.prototype.destroy = function () {\n this._eventHandler.destroy();\n this._removePostRenderEvent();\n\n const that = this;\n this._definedProperties.forEach(function (property) {\n knockout.getObservable(that, property).dispose();\n });\n\n return destroyObject(this);\n};\n\n/**\n * Generates an HTML string of the statistics\n *\n * @function\n * @param {Cesium3DTileset} tileset The tileset\n * @param {Boolean} isPick Whether this is getting the statistics for the pick pass\n * @returns {String} The formatted statistics\n */\nCesium3DTilesInspectorViewModel.getStatistics = getStatistics;\nexport default Cesium3DTilesInspectorViewModel;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport InspectorShared from \"../InspectorShared.js\";\nimport Cesium3DTilesInspectorViewModel from \"./Cesium3DTilesInspectorViewModel.js\";\n\n/**\n * Inspector widget to aid in debugging 3D Tiles\n *\n * @alias Cesium3DTilesInspector\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene the Scene instance to use.\n */\nfunction Cesium3DTilesInspector(container, scene) {\n container = getElement(container);\n const element = document.createElement(\"div\");\n const performanceContainer = document.createElement(\"div\");\n performanceContainer.setAttribute(\"data-bind\", \"visible: performance\");\n const viewModel = new Cesium3DTilesInspectorViewModel(\n scene,\n performanceContainer\n );\n\n this._viewModel = viewModel;\n this._container = container;\n this._element = element;\n\n const text = document.createElement(\"div\");\n text.textContent = \"3D Tiles Inspector\";\n text.className = \"cesium-cesiumInspector-button\";\n text.setAttribute(\"data-bind\", \"click: toggleInspector\");\n element.appendChild(text);\n element.className = \"cesium-cesiumInspector cesium-3DTilesInspector\";\n element.setAttribute(\n \"data-bind\",\n 'css: { \"cesium-cesiumInspector-visible\" : inspectorVisible, \"cesium-cesiumInspector-hidden\" : !inspectorVisible}'\n );\n container.appendChild(element);\n\n const panel = document.createElement(\"div\");\n this._panel = panel;\n panel.className = \"cesium-cesiumInspector-dropDown\";\n element.appendChild(panel);\n\n const createSection = InspectorShared.createSection;\n const createCheckbox = InspectorShared.createCheckbox;\n\n const tilesetPanelContents = createSection(\n panel,\n \"Tileset\",\n \"tilesetVisible\",\n \"toggleTileset\"\n );\n const displayPanelContents = createSection(\n panel,\n \"Display\",\n \"displayVisible\",\n \"toggleDisplay\"\n );\n const updatePanelContents = createSection(\n panel,\n \"Update\",\n \"updateVisible\",\n \"toggleUpdate\"\n );\n const loggingPanelContents = createSection(\n panel,\n \"Logging\",\n \"loggingVisible\",\n \"toggleLogging\"\n );\n const tileDebugLabelsPanelContents = createSection(\n panel,\n \"Tile Debug Labels\",\n \"tileDebugLabelsVisible\",\n \"toggleTileDebugLabels\"\n );\n const stylePanelContents = createSection(\n panel,\n \"Style\",\n \"styleVisible\",\n \"toggleStyle\"\n );\n const optimizationPanelContents = createSection(\n panel,\n \"Optimization\",\n \"optimizationVisible\",\n \"toggleOptimization\"\n );\n\n const properties = document.createElement(\"div\");\n properties.className = \"field-group\";\n const propertiesLabel = document.createElement(\"label\");\n propertiesLabel.className = \"field-label\";\n propertiesLabel.appendChild(document.createTextNode(\"Properties: \"));\n const propertiesField = document.createElement(\"div\");\n propertiesField.setAttribute(\"data-bind\", \"text: properties\");\n properties.appendChild(propertiesLabel);\n properties.appendChild(propertiesField);\n tilesetPanelContents.appendChild(properties);\n tilesetPanelContents.appendChild(\n makeButton(\"togglePickTileset\", \"Pick Tileset\", \"pickActive\")\n );\n tilesetPanelContents.appendChild(\n makeButton(\"trimTilesCache\", \"Trim Tiles Cache\")\n );\n tilesetPanelContents.appendChild(createCheckbox(\"Enable Picking\", \"picking\"));\n\n displayPanelContents.appendChild(createCheckbox(\"Colorize\", \"colorize\"));\n displayPanelContents.appendChild(\n createCheckbox(\n \"Wireframe\",\n \"wireframe\",\n \"_tileset === undefined || hasEnabledWireframe\"\n )\n );\n\n //Create warning text when the Wireframe checkbox is disabled\n const warningText = document.createElement(\"p\");\n warningText.setAttribute(\n \"data-bind\",\n \"visible: _tileset !== undefined && !hasEnabledWireframe\"\n );\n warningText.setAttribute(\n \"class\",\n \"cesium-3DTilesInspector-disabledElementsInfo\"\n );\n warningText.innerText =\n \"Set enableDebugWireframe to true in the tileset constructor to enable this option.\";\n displayPanelContents.lastChild.appendChild(warningText);\n\n displayPanelContents.appendChild(\n createCheckbox(\"Bounding Volumes\", \"showBoundingVolumes\")\n );\n displayPanelContents.appendChild(\n createCheckbox(\"Content Volumes\", \"showContentBoundingVolumes\")\n );\n displayPanelContents.appendChild(\n createCheckbox(\"Request Volumes\", \"showRequestVolumes\")\n );\n\n displayPanelContents.appendChild(\n createCheckbox(\"Point Cloud Shading\", \"pointCloudShading\")\n );\n const pointCloudShadingContainer = document.createElement(\"div\");\n pointCloudShadingContainer.setAttribute(\n \"data-bind\",\n \"visible: pointCloudShading\"\n );\n pointCloudShadingContainer.appendChild(\n makeRangeInput(\"geometricErrorScale\", 0, 2, 0.01, \"Geometric Error Scale\")\n );\n pointCloudShadingContainer.appendChild(\n makeRangeInput(\"maximumAttenuation\", 0, 32, 1, \"Maximum Attenuation\")\n );\n pointCloudShadingContainer.appendChild(\n makeRangeInput(\"baseResolution\", 0, 1, 0.01, \"Base Resolution\")\n );\n pointCloudShadingContainer.appendChild(\n createCheckbox(\"Eye Dome Lighting (EDL)\", \"eyeDomeLighting\")\n );\n displayPanelContents.appendChild(pointCloudShadingContainer);\n\n const edlContainer = document.createElement(\"div\");\n edlContainer.setAttribute(\"data-bind\", \"visible: eyeDomeLighting\");\n edlContainer.appendChild(\n makeRangeInput(\"eyeDomeLightingStrength\", 0, 2.0, 0.1, \"EDL Strength\")\n );\n edlContainer.appendChild(\n makeRangeInput(\"eyeDomeLightingRadius\", 0, 4.0, 0.1, \"EDL Radius\")\n );\n pointCloudShadingContainer.appendChild(edlContainer);\n\n updatePanelContents.appendChild(\n createCheckbox(\"Freeze Frame\", \"freezeFrame\")\n );\n updatePanelContents.appendChild(\n createCheckbox(\"Dynamic Screen Space Error\", \"dynamicScreenSpaceError\")\n );\n const sseContainer = document.createElement(\"div\");\n sseContainer.appendChild(\n makeRangeInput(\n \"maximumScreenSpaceError\",\n 0,\n 128,\n 1,\n \"Maximum Screen Space Error\"\n )\n );\n updatePanelContents.appendChild(sseContainer);\n const dynamicScreenSpaceErrorContainer = document.createElement(\"div\");\n dynamicScreenSpaceErrorContainer.setAttribute(\n \"data-bind\",\n \"visible: dynamicScreenSpaceError\"\n );\n dynamicScreenSpaceErrorContainer.appendChild(\n makeRangeInput(\n \"dynamicScreenSpaceErrorDensitySliderValue\",\n 0,\n 1,\n 0.005,\n \"Screen Space Error Density\",\n \"dynamicScreenSpaceErrorDensity\"\n )\n );\n dynamicScreenSpaceErrorContainer.appendChild(\n makeRangeInput(\n \"dynamicScreenSpaceErrorFactor\",\n 1,\n 10,\n 0.1,\n \"Screen Space Error Factor\"\n )\n );\n updatePanelContents.appendChild(dynamicScreenSpaceErrorContainer);\n\n loggingPanelContents.appendChild(\n createCheckbox(\"Performance\", \"performance\")\n );\n loggingPanelContents.appendChild(performanceContainer);\n loggingPanelContents.appendChild(\n createCheckbox(\"Statistics\", \"showStatistics\")\n );\n const statistics = document.createElement(\"div\");\n statistics.className = \"cesium-3dTilesInspector-statistics\";\n statistics.setAttribute(\n \"data-bind\",\n \"html: statisticsText, visible: showStatistics\"\n );\n loggingPanelContents.appendChild(statistics);\n loggingPanelContents.appendChild(\n createCheckbox(\"Pick Statistics\", \"showPickStatistics\")\n );\n const pickStatistics = document.createElement(\"div\");\n pickStatistics.className = \"cesium-3dTilesInspector-statistics\";\n pickStatistics.setAttribute(\n \"data-bind\",\n \"html: pickStatisticsText, visible: showPickStatistics\"\n );\n loggingPanelContents.appendChild(pickStatistics);\n loggingPanelContents.appendChild(\n createCheckbox(\"Resource Cache Statistics\", \"showResourceCacheStatistics\")\n );\n const resourceCacheStatistics = document.createElement(\"div\");\n resourceCacheStatistics.className = \"cesium-3dTilesInspector-statistics\";\n resourceCacheStatistics.setAttribute(\n \"data-bind\",\n \"html: resourceCacheStatisticsText, visible: showResourceCacheStatistics\"\n );\n loggingPanelContents.appendChild(resourceCacheStatistics);\n\n const stylePanelEditor = document.createElement(\"div\");\n stylePanelContents.appendChild(stylePanelEditor);\n stylePanelEditor.appendChild(document.createTextNode(\"Color Blend Mode: \"));\n const blendDropdown = document.createElement(\"select\");\n blendDropdown.setAttribute(\n \"data-bind\",\n \"options: colorBlendModes, \" +\n 'optionsText: \"text\", ' +\n 'optionsValue: \"value\", ' +\n \"value: colorBlendMode\"\n );\n stylePanelEditor.appendChild(blendDropdown);\n const styleEditor = document.createElement(\"textarea\");\n styleEditor.setAttribute(\n \"data-bind\",\n \"textInput: styleString, event: { keydown: styleEditorKeyPress }\"\n );\n stylePanelEditor.className = \"cesium-cesiumInspector-styleEditor\";\n stylePanelEditor.appendChild(styleEditor);\n const closeStylesBtn = makeButton(\"compileStyle\", \"Compile (Ctrl+Enter)\");\n stylePanelEditor.appendChild(closeStylesBtn);\n const errorBox = document.createElement(\"div\");\n errorBox.className = \"cesium-cesiumInspector-error\";\n errorBox.setAttribute(\"data-bind\", \"text: editorError\");\n stylePanelEditor.appendChild(errorBox);\n\n tileDebugLabelsPanelContents.appendChild(\n createCheckbox(\"Show Picked Only\", \"showOnlyPickedTileDebugLabel\")\n );\n tileDebugLabelsPanelContents.appendChild(\n createCheckbox(\"Geometric Error\", \"showGeometricError\")\n );\n tileDebugLabelsPanelContents.appendChild(\n createCheckbox(\"Rendering Statistics\", \"showRenderingStatistics\")\n );\n tileDebugLabelsPanelContents.appendChild(\n createCheckbox(\"Memory Usage (MB)\", \"showMemoryUsage\")\n );\n tileDebugLabelsPanelContents.appendChild(createCheckbox(\"Url\", \"showUrl\"));\n\n optimizationPanelContents.appendChild(\n createCheckbox(\"Skip Tile LODs\", \"skipLevelOfDetail\")\n );\n const skipScreenSpaceErrorFactorContainer = document.createElement(\"div\");\n skipScreenSpaceErrorFactorContainer.appendChild(\n makeRangeInput(\"skipScreenSpaceErrorFactor\", 1, 50, 1, \"Skip SSE Factor\")\n );\n optimizationPanelContents.appendChild(skipScreenSpaceErrorFactorContainer);\n const baseScreenSpaceError = document.createElement(\"div\");\n baseScreenSpaceError.appendChild(\n makeRangeInput(\n \"baseScreenSpaceError\",\n 0,\n 4096,\n 1,\n \"SSE before skipping LOD\"\n )\n );\n optimizationPanelContents.appendChild(baseScreenSpaceError);\n const skipLevelsContainer = document.createElement(\"div\");\n skipLevelsContainer.appendChild(\n makeRangeInput(\"skipLevels\", 0, 10, 1, \"Min. levels to skip\")\n );\n optimizationPanelContents.appendChild(skipLevelsContainer);\n optimizationPanelContents.appendChild(\n createCheckbox(\n \"Load only tiles that meet the max SSE.\",\n \"immediatelyLoadDesiredLevelOfDetail\"\n )\n );\n optimizationPanelContents.appendChild(\n createCheckbox(\"Load siblings of visible tiles\", \"loadSiblings\")\n );\n\n knockout.applyBindings(viewModel, element);\n}\n\nObject.defineProperties(Cesium3DTilesInspector.prototype, {\n /**\n * Gets the parent container.\n * @memberof Cesium3DTilesInspector.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof Cesium3DTilesInspector.prototype\n *\n * @type {Cesium3DTilesInspectorViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nCesium3DTilesInspector.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nCesium3DTilesInspector.prototype.destroy = function () {\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n this.viewModel.destroy();\n\n return destroyObject(this);\n};\n\nfunction makeRangeInput(property, min, max, step, text, displayProperty) {\n displayProperty = defaultValue(displayProperty, property);\n const input = document.createElement(\"input\");\n input.setAttribute(\"data-bind\", `value: ${displayProperty}`);\n input.type = \"number\";\n\n const slider = document.createElement(\"input\");\n slider.type = \"range\";\n slider.min = min;\n slider.max = max;\n slider.step = step;\n slider.setAttribute(\"data-bind\", `valueUpdate: \"input\", value: ${property}`);\n\n const wrapper = document.createElement(\"div\");\n wrapper.appendChild(slider);\n\n const container = document.createElement(\"div\");\n container.className = \"cesium-cesiumInspector-slider\";\n container.appendChild(document.createTextNode(text));\n container.appendChild(input);\n container.appendChild(wrapper);\n\n return container;\n}\n\nfunction makeButton(action, text, active) {\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.textContent = text;\n button.className = \"cesium-cesiumInspector-pickButton\";\n let binding = `click: ${action}`;\n if (defined(active)) {\n binding += `, css: {\"cesium-cesiumInspector-pickButtonHighlight\" : ${active}}`;\n }\n button.setAttribute(\"data-bind\", binding);\n\n return button;\n}\nexport default Cesium3DTilesInspector;\n", "import Cartesian3 from \"../../Core/Cartesian3.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Ray from \"../../Core/Ray.js\";\nimport Rectangle from \"../../Core/Rectangle.js\";\nimport ScreenSpaceEventHandler from \"../../Core/ScreenSpaceEventHandler.js\";\nimport ScreenSpaceEventType from \"../../Core/ScreenSpaceEventType.js\";\nimport DebugModelMatrixPrimitive from \"../../Scene/DebugModelMatrixPrimitive.js\";\nimport PerformanceDisplay from \"../../Scene/PerformanceDisplay.js\";\nimport TileCoordinatesImageryProvider from \"../../Scene/TileCoordinatesImageryProvider.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\nfunction frustumStatisticsToString(statistics) {\n let str;\n if (defined(statistics)) {\n str = \"Command Statistics\";\n const com = statistics.commandsInFrustums;\n for (const n in com) {\n if (com.hasOwnProperty(n)) {\n let num = parseInt(n, 10);\n let s;\n if (num === 7) {\n s = \"1, 2 and 3\";\n } else {\n const f = [];\n for (let i = 2; i >= 0; i--) {\n const p = Math.pow(2, i);\n if (num >= p) {\n f.push(i + 1);\n num -= p;\n }\n }\n s = f.reverse().join(\" and \");\n }\n str += `<br>    ${com[n]} in frustum ${s}`;\n }\n }\n str += `<br>Total: ${statistics.totalCommands}`;\n }\n\n return str;\n}\n\nfunction boundDepthFrustum(lower, upper, proposed) {\n let bounded = Math.min(proposed, upper);\n bounded = Math.max(bounded, lower);\n return bounded;\n}\n\nconst scratchPickRay = new Ray();\nconst scratchPickCartesian = new Cartesian3();\n\n/**\n * The view model for {@link CesiumInspector}.\n * @alias CesiumInspectorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {Element} performanceContainer The instance to use for performance container.\n */\nfunction CesiumInspectorViewModel(scene, performanceContainer) {\n const that = this;\n const canvas = scene.canvas;\n const eventHandler = new ScreenSpaceEventHandler(canvas);\n this._eventHandler = eventHandler;\n this._scene = scene;\n this._canvas = canvas;\n this._primitive = undefined;\n this._tile = undefined;\n this._modelMatrixPrimitive = undefined;\n this._performanceDisplay = undefined;\n this._performanceContainer = performanceContainer;\n\n const globe = this._scene.globe;\n globe.depthTestAgainstTerrain = true;\n\n /**\n * Gets or sets the show frustums state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.frustums = false;\n\n /**\n * Gets or sets the show frustum planes state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.frustumPlanes = false;\n\n /**\n * Gets or sets the show performance display state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.performance = false;\n\n /**\n * Gets or sets the shader cache text. This property is observable.\n * @type {String}\n * @default ''\n */\n this.shaderCacheText = \"\";\n\n /**\n * Gets or sets the show primitive bounding sphere state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.primitiveBoundingSphere = false;\n\n /**\n * Gets or sets the show primitive reference frame state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.primitiveReferenceFrame = false;\n\n /**\n * Gets or sets the filter primitive state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.filterPrimitive = false;\n\n /**\n * Gets or sets the show tile bounding sphere state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.tileBoundingSphere = false;\n\n /**\n * Gets or sets the filter tile state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.filterTile = false;\n\n /**\n * Gets or sets the show wireframe state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.wireframe = false;\n\n /**\n * Gets or sets the index of the depth frustum to display. This property is observable.\n * @type {Number}\n * @default 1\n */\n this.depthFrustum = 1;\n this._numberOfFrustums = 1;\n\n /**\n * Gets or sets the suspend updates state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.suspendUpdates = false;\n\n /**\n * Gets or sets the show tile coordinates state. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.tileCoordinates = false;\n\n /**\n * Gets or sets the frustum statistic text. This property is observable.\n * @type {String}\n * @default ''\n */\n this.frustumStatisticText = false;\n\n /**\n * Gets or sets the selected tile information text. This property is observable.\n * @type {String}\n * @default ''\n */\n this.tileText = \"\";\n\n /**\n * Gets if a primitive has been selected. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.hasPickedPrimitive = false;\n\n /**\n * Gets if a tile has been selected. This property is observable\n * @type {Boolean}\n * @default false\n */\n this.hasPickedTile = false;\n\n /**\n * Gets if the picking primitive command is active. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.pickPrimitiveActive = false;\n\n /**\n * Gets if the picking tile command is active. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.pickTileActive = false;\n\n /**\n * Gets or sets if the cesium inspector drop down is visible. This property is observable.\n * @type {Boolean}\n * @default true\n */\n this.dropDownVisible = true;\n\n /**\n * Gets or sets if the general section is visible. This property is observable.\n * @type {Boolean}\n * @default true\n */\n this.generalVisible = true;\n\n /**\n * Gets or sets if the primitive section is visible. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.primitivesVisible = false;\n\n /**\n * Gets or sets if the terrain section is visible. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.terrainVisible = false;\n\n /**\n * Gets or sets the index of the depth frustum text. This property is observable.\n * @type {String}\n * @default ''\n */\n this.depthFrustumText = \"\";\n\n knockout.track(this, [\n \"frustums\",\n \"frustumPlanes\",\n \"performance\",\n \"shaderCacheText\",\n \"primitiveBoundingSphere\",\n \"primitiveReferenceFrame\",\n \"filterPrimitive\",\n \"tileBoundingSphere\",\n \"filterTile\",\n \"wireframe\",\n \"depthFrustum\",\n \"suspendUpdates\",\n \"tileCoordinates\",\n \"frustumStatisticText\",\n \"tileText\",\n \"hasPickedPrimitive\",\n \"hasPickedTile\",\n \"pickPrimitiveActive\",\n \"pickTileActive\",\n \"dropDownVisible\",\n \"generalVisible\",\n \"primitivesVisible\",\n \"terrainVisible\",\n \"depthFrustumText\",\n ]);\n\n this._toggleDropDown = createCommand(function () {\n that.dropDownVisible = !that.dropDownVisible;\n });\n\n this._toggleGeneral = createCommand(function () {\n that.generalVisible = !that.generalVisible;\n });\n\n this._togglePrimitives = createCommand(function () {\n that.primitivesVisible = !that.primitivesVisible;\n });\n\n this._toggleTerrain = createCommand(function () {\n that.terrainVisible = !that.terrainVisible;\n });\n\n this._frustumsSubscription = knockout\n .getObservable(this, \"frustums\")\n .subscribe(function (val) {\n that._scene.debugShowFrustums = val;\n that._scene.requestRender();\n });\n\n this._frustumPlanesSubscription = knockout\n .getObservable(this, \"frustumPlanes\")\n .subscribe(function (val) {\n that._scene.debugShowFrustumPlanes = val;\n that._scene.requestRender();\n });\n\n this._performanceSubscription = knockout\n .getObservable(this, \"performance\")\n .subscribe(function (val) {\n if (val) {\n that._performanceDisplay = new PerformanceDisplay({\n container: that._performanceContainer,\n });\n } else {\n that._performanceContainer.innerHTML = \"\";\n }\n });\n\n this._showPrimitiveBoundingSphere = createCommand(function () {\n that._primitive.debugShowBoundingVolume = that.primitiveBoundingSphere;\n that._scene.requestRender();\n return true;\n });\n\n this._primitiveBoundingSphereSubscription = knockout\n .getObservable(this, \"primitiveBoundingSphere\")\n .subscribe(function () {\n that._showPrimitiveBoundingSphere();\n });\n\n this._showPrimitiveReferenceFrame = createCommand(function () {\n if (that.primitiveReferenceFrame) {\n const modelMatrix = that._primitive.modelMatrix;\n that._modelMatrixPrimitive = new DebugModelMatrixPrimitive({\n modelMatrix: modelMatrix,\n });\n that._scene.primitives.add(that._modelMatrixPrimitive);\n } else if (defined(that._modelMatrixPrimitive)) {\n that._scene.primitives.remove(that._modelMatrixPrimitive);\n that._modelMatrixPrimitive = undefined;\n }\n that._scene.requestRender();\n return true;\n });\n\n this._primitiveReferenceFrameSubscription = knockout\n .getObservable(this, \"primitiveReferenceFrame\")\n .subscribe(function () {\n that._showPrimitiveReferenceFrame();\n });\n\n this._doFilterPrimitive = createCommand(function () {\n if (that.filterPrimitive) {\n that._scene.debugCommandFilter = function (command) {\n if (\n defined(that._modelMatrixPrimitive) &&\n command.owner === that._modelMatrixPrimitive._primitive\n ) {\n return true;\n } else if (defined(that._primitive)) {\n return (\n command.owner === that._primitive ||\n command.owner === that._primitive._billboardCollection ||\n command.owner.primitive === that._primitive\n );\n }\n return false;\n };\n } else {\n that._scene.debugCommandFilter = undefined;\n }\n return true;\n });\n\n this._filterPrimitiveSubscription = knockout\n .getObservable(this, \"filterPrimitive\")\n .subscribe(function () {\n that._doFilterPrimitive();\n that._scene.requestRender();\n });\n\n this._wireframeSubscription = knockout\n .getObservable(this, \"wireframe\")\n .subscribe(function (val) {\n globe._surface.tileProvider._debug.wireframe = val;\n that._scene.requestRender();\n });\n\n this._depthFrustumSubscription = knockout\n .getObservable(this, \"depthFrustum\")\n .subscribe(function (val) {\n that._scene.debugShowDepthFrustum = val;\n that._scene.requestRender();\n });\n\n this._incrementDepthFrustum = createCommand(function () {\n const next = that.depthFrustum + 1;\n that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);\n that._scene.requestRender();\n return true;\n });\n\n this._decrementDepthFrustum = createCommand(function () {\n const next = that.depthFrustum - 1;\n that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);\n that._scene.requestRender();\n return true;\n });\n\n this._suspendUpdatesSubscription = knockout\n .getObservable(this, \"suspendUpdates\")\n .subscribe(function (val) {\n globe._surface._debug.suspendLodUpdate = val;\n if (!val) {\n that.filterTile = false;\n }\n });\n\n let tileBoundariesLayer;\n this._showTileCoordinates = createCommand(function () {\n if (that.tileCoordinates && !defined(tileBoundariesLayer)) {\n tileBoundariesLayer = scene.imageryLayers.addImageryProvider(\n new TileCoordinatesImageryProvider({\n tilingScheme: scene.terrainProvider.tilingScheme,\n })\n );\n } else if (!that.tileCoordinates && defined(tileBoundariesLayer)) {\n scene.imageryLayers.remove(tileBoundariesLayer);\n tileBoundariesLayer = undefined;\n }\n return true;\n });\n\n this._tileCoordinatesSubscription = knockout\n .getObservable(this, \"tileCoordinates\")\n .subscribe(function () {\n that._showTileCoordinates();\n that._scene.requestRender();\n });\n\n this._tileBoundingSphereSubscription = knockout\n .getObservable(this, \"tileBoundingSphere\")\n .subscribe(function () {\n that._showTileBoundingSphere();\n that._scene.requestRender();\n });\n\n this._showTileBoundingSphere = createCommand(function () {\n if (that.tileBoundingSphere) {\n globe._surface.tileProvider._debug.boundingSphereTile = that._tile;\n } else {\n globe._surface.tileProvider._debug.boundingSphereTile = undefined;\n }\n that._scene.requestRender();\n return true;\n });\n\n this._doFilterTile = createCommand(function () {\n if (!that.filterTile) {\n that.suspendUpdates = false;\n } else {\n that.suspendUpdates = true;\n\n globe._surface._tilesToRender = [];\n\n if (defined(that._tile) && that._tile.renderable) {\n globe._surface._tilesToRender.push(that._tile);\n }\n }\n return true;\n });\n\n this._filterTileSubscription = knockout\n .getObservable(this, \"filterTile\")\n .subscribe(function () {\n that.doFilterTile();\n that._scene.requestRender();\n });\n\n function pickPrimitive(e) {\n const newPick = that._scene.pick({\n x: e.position.x,\n y: e.position.y,\n });\n if (defined(newPick)) {\n that.primitive = defined(newPick.collection)\n ? newPick.collection\n : newPick.primitive;\n }\n\n that._scene.requestRender();\n that.pickPrimitiveActive = false;\n }\n\n this._pickPrimitive = createCommand(function () {\n that.pickPrimitiveActive = !that.pickPrimitiveActive;\n });\n\n this._pickPrimitiveActiveSubscription = knockout\n .getObservable(this, \"pickPrimitiveActive\")\n .subscribe(function (val) {\n if (val) {\n eventHandler.setInputAction(\n pickPrimitive,\n ScreenSpaceEventType.LEFT_CLICK\n );\n } else {\n eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n }\n });\n\n function selectTile(e) {\n let selectedTile;\n const ellipsoid = globe.ellipsoid;\n\n const ray = that._scene.camera.getPickRay(e.position, scratchPickRay);\n const cartesian = globe.pick(ray, that._scene, scratchPickCartesian);\n\n if (defined(cartesian)) {\n const cartographic = ellipsoid.cartesianToCartographic(cartesian);\n const tilesRendered =\n globe._surface.tileProvider._tilesToRenderByTextureCount;\n for (\n let textureCount = 0;\n !selectedTile && textureCount < tilesRendered.length;\n ++textureCount\n ) {\n const tilesRenderedByTextureCount = tilesRendered[textureCount];\n if (!defined(tilesRenderedByTextureCount)) {\n continue;\n }\n\n for (\n let tileIndex = 0;\n !selectedTile && tileIndex < tilesRenderedByTextureCount.length;\n ++tileIndex\n ) {\n const tile = tilesRenderedByTextureCount[tileIndex];\n if (Rectangle.contains(tile.rectangle, cartographic)) {\n selectedTile = tile;\n }\n }\n }\n }\n\n that.tile = selectedTile;\n\n that.pickTileActive = false;\n }\n\n this._pickTile = createCommand(function () {\n that.pickTileActive = !that.pickTileActive;\n });\n\n this._pickTileActiveSubscription = knockout\n .getObservable(this, \"pickTileActive\")\n .subscribe(function (val) {\n if (val) {\n eventHandler.setInputAction(\n selectTile,\n ScreenSpaceEventType.LEFT_CLICK\n );\n } else {\n eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK);\n }\n });\n\n this._removePostRenderEvent = scene.postRender.addEventListener(function () {\n that._update();\n });\n}\n\nObject.defineProperties(CesiumInspectorViewModel.prototype, {\n /**\n * Gets the scene to control.\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the container of the PerformanceDisplay\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Element}\n */\n performanceContainer: {\n get: function () {\n return this._performanceContainer;\n },\n },\n\n /**\n * Gets the command to toggle the visibility of the drop down.\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n toggleDropDown: {\n get: function () {\n return this._toggleDropDown;\n },\n },\n\n /**\n * Gets the command to toggle the visibility of a BoundingSphere for a primitive\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n showPrimitiveBoundingSphere: {\n get: function () {\n return this._showPrimitiveBoundingSphere;\n },\n },\n\n /**\n * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n showPrimitiveReferenceFrame: {\n get: function () {\n return this._showPrimitiveReferenceFrame;\n },\n },\n\n /**\n * Gets the command to toggle a filter that renders only a selected primitive\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n doFilterPrimitive: {\n get: function () {\n return this._doFilterPrimitive;\n },\n },\n\n /**\n * Gets the command to increment the depth frustum index to be shown\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n incrementDepthFrustum: {\n get: function () {\n return this._incrementDepthFrustum;\n },\n },\n\n /**\n * Gets the command to decrement the depth frustum index to be shown\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n decrementDepthFrustum: {\n get: function () {\n return this._decrementDepthFrustum;\n },\n },\n\n /**\n * Gets the command to toggle the visibility of tile coordinates\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n showTileCoordinates: {\n get: function () {\n return this._showTileCoordinates;\n },\n },\n\n /**\n * Gets the command to toggle the visibility of a BoundingSphere for a selected tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n showTileBoundingSphere: {\n get: function () {\n return this._showTileBoundingSphere;\n },\n },\n\n /**\n * Gets the command to toggle a filter that renders only a selected tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n doFilterTile: {\n get: function () {\n return this._doFilterTile;\n },\n },\n\n /**\n * Gets the command to expand and collapse the general section\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n toggleGeneral: {\n get: function () {\n return this._toggleGeneral;\n },\n },\n\n /**\n * Gets the command to expand and collapse the primitives section\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n togglePrimitives: {\n get: function () {\n return this._togglePrimitives;\n },\n },\n\n /**\n * Gets the command to expand and collapse the terrain section\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n toggleTerrain: {\n get: function () {\n return this._toggleTerrain;\n },\n },\n\n /**\n * Gets the command to pick a primitive\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n pickPrimitive: {\n get: function () {\n return this._pickPrimitive;\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n pickTile: {\n get: function () {\n return this._pickTile;\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n selectParent: {\n get: function () {\n const that = this;\n return createCommand(function () {\n that.tile = that.tile.parent;\n });\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n selectNW: {\n get: function () {\n const that = this;\n return createCommand(function () {\n that.tile = that.tile.northwestChild;\n });\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n selectNE: {\n get: function () {\n const that = this;\n return createCommand(function () {\n that.tile = that.tile.northeastChild;\n });\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n selectSW: {\n get: function () {\n const that = this;\n return createCommand(function () {\n that.tile = that.tile.southwestChild;\n });\n },\n },\n\n /**\n * Gets the command to pick a tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n selectSE: {\n get: function () {\n const that = this;\n return createCommand(function () {\n that.tile = that.tile.southeastChild;\n });\n },\n },\n\n /**\n * Gets or sets the current selected primitive\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n primitive: {\n get: function () {\n return this._primitive;\n },\n set: function (newPrimitive) {\n const oldPrimitive = this._primitive;\n if (newPrimitive !== oldPrimitive) {\n this.hasPickedPrimitive = true;\n if (defined(oldPrimitive)) {\n oldPrimitive.debugShowBoundingVolume = false;\n }\n this._scene.debugCommandFilter = undefined;\n if (defined(this._modelMatrixPrimitive)) {\n this._scene.primitives.remove(this._modelMatrixPrimitive);\n this._modelMatrixPrimitive = undefined;\n }\n this._primitive = newPrimitive;\n newPrimitive.show = false;\n setTimeout(function () {\n newPrimitive.show = true;\n }, 50);\n this.showPrimitiveBoundingSphere();\n this.showPrimitiveReferenceFrame();\n this.doFilterPrimitive();\n }\n },\n },\n\n /**\n * Gets or sets the current selected tile\n * @memberof CesiumInspectorViewModel.prototype\n *\n * @type {Command}\n */\n tile: {\n get: function () {\n return this._tile;\n },\n set: function (newTile) {\n if (defined(newTile)) {\n this.hasPickedTile = true;\n const oldTile = this._tile;\n if (newTile !== oldTile) {\n this.tileText = `L: ${newTile.level} X: ${newTile.x} Y: ${newTile.y}`;\n this.tileText += `<br>SW corner: ${newTile.rectangle.west}, ${newTile.rectangle.south}`;\n this.tileText += `<br>NE corner: ${newTile.rectangle.east}, ${newTile.rectangle.north}`;\n const data = newTile.data;\n if (defined(data) && defined(data.tileBoundingRegion)) {\n this.tileText += `<br>Min: ${data.tileBoundingRegion.minimumHeight} Max: ${data.tileBoundingRegion.maximumHeight}`;\n } else {\n this.tileText += \"<br>(Tile is not loaded)\";\n }\n }\n this._tile = newTile;\n this.showTileBoundingSphere();\n this.doFilterTile();\n } else {\n this.hasPickedTile = false;\n this._tile = undefined;\n }\n },\n },\n});\n\n/**\n * Updates the view model\n * @private\n */\nCesiumInspectorViewModel.prototype._update = function () {\n if (this.frustums) {\n this.frustumStatisticText = frustumStatisticsToString(\n this._scene.debugFrustumStatistics\n );\n }\n\n // Determine the number of frustums being used.\n const numberOfFrustums = this._scene.numberOfFrustums;\n this._numberOfFrustums = numberOfFrustums;\n // Bound the frustum to be displayed.\n this.depthFrustum = boundDepthFrustum(1, numberOfFrustums, this.depthFrustum);\n // Update the displayed text.\n this.depthFrustumText = `${this.depthFrustum} of ${numberOfFrustums}`;\n\n if (this.performance) {\n this._performanceDisplay.update();\n }\n if (this.primitiveReferenceFrame) {\n this._modelMatrixPrimitive.modelMatrix = this._primitive.modelMatrix;\n }\n\n this.shaderCacheText = `Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`;\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumInspectorViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nCesiumInspectorViewModel.prototype.destroy = function () {\n this._eventHandler.destroy();\n this._removePostRenderEvent();\n this._frustumsSubscription.dispose();\n this._frustumPlanesSubscription.dispose();\n this._performanceSubscription.dispose();\n this._primitiveBoundingSphereSubscription.dispose();\n this._primitiveReferenceFrameSubscription.dispose();\n this._filterPrimitiveSubscription.dispose();\n this._wireframeSubscription.dispose();\n this._depthFrustumSubscription.dispose();\n this._suspendUpdatesSubscription.dispose();\n this._tileCoordinatesSubscription.dispose();\n this._tileBoundingSphereSubscription.dispose();\n this._filterTileSubscription.dispose();\n this._pickPrimitiveActiveSubscription.dispose();\n this._pickTileActiveSubscription.dispose();\n return destroyObject(this);\n};\nexport default CesiumInspectorViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport InspectorShared from \"../InspectorShared.js\";\nimport CesiumInspectorViewModel from \"./CesiumInspectorViewModel.js\";\n\n/**\n * Inspector widget to aid in debugging\n *\n * @alias CesiumInspector\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Inspector.html|Cesium Sandcastle Cesium Inspector Demo}\n */\nfunction CesiumInspector(container, scene) {\n container = getElement(container);\n\n const performanceContainer = document.createElement(\"div\");\n\n const viewModel = new CesiumInspectorViewModel(scene, performanceContainer);\n this._viewModel = viewModel;\n this._container = container;\n\n const element = document.createElement(\"div\");\n this._element = element;\n const text = document.createElement(\"div\");\n text.textContent = \"Cesium Inspector\";\n text.className = \"cesium-cesiumInspector-button\";\n text.setAttribute(\"data-bind\", \"click: toggleDropDown\");\n element.appendChild(text);\n element.className = \"cesium-cesiumInspector\";\n element.setAttribute(\n \"data-bind\",\n 'css: { \"cesium-cesiumInspector-visible\" : dropDownVisible, \"cesium-cesiumInspector-hidden\" : !dropDownVisible }'\n );\n container.appendChild(this._element);\n\n const panel = document.createElement(\"div\");\n this._panel = panel;\n panel.className = \"cesium-cesiumInspector-dropDown\";\n element.appendChild(panel);\n\n const createSection = InspectorShared.createSection;\n const createCheckbox = InspectorShared.createCheckbox;\n\n // General\n const generalSection = createSection(\n panel,\n \"General\",\n \"generalVisible\",\n \"toggleGeneral\"\n );\n\n const debugShowFrustums = createCheckbox(\"Show Frustums\", \"frustums\");\n const frustumStatistics = document.createElement(\"div\");\n frustumStatistics.className = \"cesium-cesiumInspector-frustumStatistics\";\n frustumStatistics.setAttribute(\n \"data-bind\",\n \"visible: frustums, html: frustumStatisticText\"\n );\n debugShowFrustums.appendChild(frustumStatistics);\n generalSection.appendChild(debugShowFrustums);\n\n generalSection.appendChild(\n createCheckbox(\"Show Frustum Planes\", \"frustumPlanes\")\n );\n generalSection.appendChild(\n createCheckbox(\"Performance Display\", \"performance\")\n );\n\n performanceContainer.className = \"cesium-cesiumInspector-performanceDisplay\";\n generalSection.appendChild(performanceContainer);\n\n const shaderCacheDisplay = document.createElement(\"div\");\n shaderCacheDisplay.className = \"cesium-cesiumInspector-shaderCache\";\n shaderCacheDisplay.setAttribute(\"data-bind\", \"html: shaderCacheText\");\n generalSection.appendChild(shaderCacheDisplay);\n\n const depthFrustum = document.createElement(\"div\");\n generalSection.appendChild(depthFrustum);\n\n // Use a span with HTML binding so that we can indent with non-breaking spaces.\n const gLabel = document.createElement(\"span\");\n gLabel.setAttribute(\n \"data-bind\",\n 'html: \"     Frustum:\"'\n );\n depthFrustum.appendChild(gLabel);\n\n const gText = document.createElement(\"span\");\n gText.setAttribute(\"data-bind\", \"text: depthFrustumText\");\n depthFrustum.appendChild(gText);\n\n const gMinusButton = document.createElement(\"input\");\n gMinusButton.type = \"button\";\n gMinusButton.value = \"-\";\n gMinusButton.className = \"cesium-cesiumInspector-pickButton\";\n gMinusButton.setAttribute(\"data-bind\", \"click: decrementDepthFrustum\");\n depthFrustum.appendChild(gMinusButton);\n\n const gPlusButton = document.createElement(\"input\");\n gPlusButton.type = \"button\";\n gPlusButton.value = \"+\";\n gPlusButton.className = \"cesium-cesiumInspector-pickButton\";\n gPlusButton.setAttribute(\"data-bind\", \"click: incrementDepthFrustum\");\n depthFrustum.appendChild(gPlusButton);\n\n // Primitives\n const primSection = createSection(\n panel,\n \"Primitives\",\n \"primitivesVisible\",\n \"togglePrimitives\"\n );\n const pickPrimRequired = document.createElement(\"div\");\n pickPrimRequired.className = \"cesium-cesiumInspector-pickSection\";\n primSection.appendChild(pickPrimRequired);\n\n const pickPrimitiveButton = document.createElement(\"input\");\n pickPrimitiveButton.type = \"button\";\n pickPrimitiveButton.value = \"Pick a primitive\";\n pickPrimitiveButton.className = \"cesium-cesiumInspector-pickButton\";\n pickPrimitiveButton.setAttribute(\n \"data-bind\",\n 'css: {\"cesium-cesiumInspector-pickButtonHighlight\" : pickPrimitiveActive}, click: pickPrimitive'\n );\n let buttonWrap = document.createElement(\"div\");\n buttonWrap.className = \"cesium-cesiumInspector-center\";\n buttonWrap.appendChild(pickPrimitiveButton);\n pickPrimRequired.appendChild(buttonWrap);\n\n pickPrimRequired.appendChild(\n createCheckbox(\n \"Show bounding sphere\",\n \"primitiveBoundingSphere\",\n \"hasPickedPrimitive\"\n )\n );\n pickPrimRequired.appendChild(\n createCheckbox(\n \"Show reference frame\",\n \"primitiveReferenceFrame\",\n \"hasPickedPrimitive\"\n )\n );\n\n this._primitiveOnly = createCheckbox(\n \"Show only selected\",\n \"filterPrimitive\",\n \"hasPickedPrimitive\"\n );\n pickPrimRequired.appendChild(this._primitiveOnly);\n\n // Terrain\n const terrainSection = createSection(\n panel,\n \"Terrain\",\n \"terrainVisible\",\n \"toggleTerrain\"\n );\n const pickTileRequired = document.createElement(\"div\");\n pickTileRequired.className = \"cesium-cesiumInspector-pickSection\";\n terrainSection.appendChild(pickTileRequired);\n const pickTileButton = document.createElement(\"input\");\n pickTileButton.type = \"button\";\n pickTileButton.value = \"Pick a tile\";\n pickTileButton.className = \"cesium-cesiumInspector-pickButton\";\n pickTileButton.setAttribute(\n \"data-bind\",\n 'css: {\"cesium-cesiumInspector-pickButtonHighlight\" : pickTileActive}, click: pickTile'\n );\n buttonWrap = document.createElement(\"div\");\n buttonWrap.appendChild(pickTileButton);\n buttonWrap.className = \"cesium-cesiumInspector-center\";\n pickTileRequired.appendChild(buttonWrap);\n const tileInfo = document.createElement(\"div\");\n pickTileRequired.appendChild(tileInfo);\n const parentTile = document.createElement(\"input\");\n parentTile.type = \"button\";\n parentTile.value = \"Parent\";\n parentTile.className = \"cesium-cesiumInspector-pickButton\";\n parentTile.setAttribute(\"data-bind\", \"click: selectParent\");\n const nwTile = document.createElement(\"input\");\n nwTile.type = \"button\";\n nwTile.value = \"NW\";\n nwTile.className = \"cesium-cesiumInspector-pickButton\";\n nwTile.setAttribute(\"data-bind\", \"click: selectNW\");\n const neTile = document.createElement(\"input\");\n neTile.type = \"button\";\n neTile.value = \"NE\";\n neTile.className = \"cesium-cesiumInspector-pickButton\";\n neTile.setAttribute(\"data-bind\", \"click: selectNE\");\n const swTile = document.createElement(\"input\");\n swTile.type = \"button\";\n swTile.value = \"SW\";\n swTile.className = \"cesium-cesiumInspector-pickButton\";\n swTile.setAttribute(\"data-bind\", \"click: selectSW\");\n const seTile = document.createElement(\"input\");\n seTile.type = \"button\";\n seTile.value = \"SE\";\n seTile.className = \"cesium-cesiumInspector-pickButton\";\n seTile.setAttribute(\"data-bind\", \"click: selectSE\");\n\n const tileText = document.createElement(\"div\");\n tileText.className = \"cesium-cesiumInspector-tileText\";\n tileInfo.className = \"cesium-cesiumInspector-frustumStatistics\";\n tileInfo.appendChild(tileText);\n tileInfo.setAttribute(\"data-bind\", \"visible: hasPickedTile\");\n tileText.setAttribute(\"data-bind\", \"html: tileText\");\n\n const relativeText = document.createElement(\"div\");\n relativeText.className = \"cesium-cesiumInspector-relativeText\";\n relativeText.textContent = \"Select relative:\";\n tileInfo.appendChild(relativeText);\n\n const table = document.createElement(\"table\");\n const tr1 = document.createElement(\"tr\");\n const tr2 = document.createElement(\"tr\");\n const td1 = document.createElement(\"td\");\n td1.appendChild(parentTile);\n const td2 = document.createElement(\"td\");\n td2.appendChild(nwTile);\n const td3 = document.createElement(\"td\");\n td3.appendChild(neTile);\n tr1.appendChild(td1);\n tr1.appendChild(td2);\n tr1.appendChild(td3);\n const td4 = document.createElement(\"td\");\n const td5 = document.createElement(\"td\");\n td5.appendChild(swTile);\n const td6 = document.createElement(\"td\");\n td6.appendChild(seTile);\n tr2.appendChild(td4);\n tr2.appendChild(td5);\n tr2.appendChild(td6);\n table.appendChild(tr1);\n table.appendChild(tr2);\n\n tileInfo.appendChild(table);\n\n pickTileRequired.appendChild(\n createCheckbox(\n \"Show bounding volume\",\n \"tileBoundingSphere\",\n \"hasPickedTile\"\n )\n );\n pickTileRequired.appendChild(\n createCheckbox(\"Show only selected\", \"filterTile\", \"hasPickedTile\")\n );\n\n terrainSection.appendChild(createCheckbox(\"Wireframe\", \"wireframe\"));\n terrainSection.appendChild(\n createCheckbox(\"Suspend LOD update\", \"suspendUpdates\")\n );\n terrainSection.appendChild(\n createCheckbox(\"Show tile coordinates\", \"tileCoordinates\")\n );\n\n knockout.applyBindings(viewModel, this._element);\n}\n\nObject.defineProperties(CesiumInspector.prototype, {\n /**\n * Gets the parent container.\n * @memberof CesiumInspector.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof CesiumInspector.prototype\n *\n * @type {CesiumInspectorViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumInspector.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nCesiumInspector.prototype.destroy = function () {\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n this.viewModel.destroy();\n\n return destroyObject(this);\n};\nexport default CesiumInspector;\n", "import buildModuleUrl from \"../../Core/buildModuleUrl.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Clock from \"../../Core/Clock.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Ellipsoid from \"../../Core/Ellipsoid.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport formatError from \"../../Core/formatError.js\";\nimport ScreenSpaceEventHandler from \"../../Core/ScreenSpaceEventHandler.js\";\nimport createWorldImagery from \"../../Scene/createWorldImagery.js\";\nimport Globe from \"../../Scene/Globe.js\";\nimport Moon from \"../../Scene/Moon.js\";\nimport Scene from \"../../Scene/Scene.js\";\nimport SceneMode from \"../../Scene/SceneMode.js\";\nimport ShadowMode from \"../../Scene/ShadowMode.js\";\nimport SkyAtmosphere from \"../../Scene/SkyAtmosphere.js\";\nimport SkyBox from \"../../Scene/SkyBox.js\";\nimport Sun from \"../../Scene/Sun.js\";\nimport getElement from \"../getElement.js\";\n\nfunction getDefaultSkyBoxUrl(suffix) {\n return buildModuleUrl(`Assets/Textures/SkyBox/tycho2t3_80_${suffix}.jpg`);\n}\n\nfunction startRenderLoop(widget) {\n widget._renderLoopRunning = true;\n\n let lastFrameTime = 0;\n function render(frameTime) {\n if (widget.isDestroyed()) {\n return;\n }\n\n if (widget._useDefaultRenderLoop) {\n try {\n const targetFrameRate = widget._targetFrameRate;\n if (!defined(targetFrameRate)) {\n widget.resize();\n widget.render();\n requestAnimationFrame(render);\n } else {\n const interval = 1000.0 / targetFrameRate;\n const delta = frameTime - lastFrameTime;\n\n if (delta > interval) {\n widget.resize();\n widget.render();\n lastFrameTime = frameTime - (delta % interval);\n }\n requestAnimationFrame(render);\n }\n } catch (error) {\n widget._useDefaultRenderLoop = false;\n widget._renderLoopRunning = false;\n if (widget._showRenderLoopErrors) {\n const title =\n \"An error occurred while rendering. Rendering has stopped.\";\n widget.showErrorPanel(title, undefined, error);\n }\n }\n } else {\n widget._renderLoopRunning = false;\n }\n }\n\n requestAnimationFrame(render);\n}\n\nfunction configurePixelRatio(widget) {\n let pixelRatio = widget._useBrowserRecommendedResolution\n ? 1.0\n : window.devicePixelRatio;\n pixelRatio *= widget._resolutionScale;\n if (defined(widget._scene)) {\n widget._scene.pixelRatio = pixelRatio;\n }\n\n return pixelRatio;\n}\n\nfunction configureCanvasSize(widget) {\n const canvas = widget._canvas;\n let width = canvas.clientWidth;\n let height = canvas.clientHeight;\n const pixelRatio = configurePixelRatio(widget);\n\n widget._canvasClientWidth = width;\n widget._canvasClientHeight = height;\n\n width *= pixelRatio;\n height *= pixelRatio;\n\n canvas.width = width;\n canvas.height = height;\n\n widget._canRender = width !== 0 && height !== 0;\n widget._lastDevicePixelRatio = window.devicePixelRatio;\n}\n\nfunction configureCameraFrustum(widget) {\n const canvas = widget._canvas;\n const width = canvas.width;\n const height = canvas.height;\n if (width !== 0 && height !== 0) {\n const frustum = widget._scene.camera.frustum;\n if (defined(frustum.aspectRatio)) {\n frustum.aspectRatio = width / height;\n } else {\n frustum.top = frustum.right * (height / width);\n frustum.bottom = -frustum.top;\n }\n }\n}\n\n/**\n * A widget containing a Cesium scene.\n *\n * @alias CesiumWidget\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Object} [options] Object with the following properties:\n * @param {Clock} [options.clock=new Clock()] The clock to use to control current time.\n * @param {ImageryProvider | false} [options.imageryProvider=createWorldImagery()] The imagery provider to serve as the base layer. If set to <code>false</code>, no imagery provider will be added.\n * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider] The terrain provider.\n * @param {SkyBox| false} [options.skyBox] The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.\n * @param {SkyAtmosphere | false} [options.skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.\n * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] The initial scene mode.\n * @param {Boolean} [options.scene3DOnly=false] When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.\n * @param {Boolean} [options.orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @param {Globe | false} [options.globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to <code>false</code>, no globe will be added.\n * @param {Boolean} [options.useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.\n * @param {Boolean} [options.useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.\n * @param {Number} [options.targetFrameRate] The target frame rate when using the default render loop.\n * @param {Boolean} [options.showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.\n * @param {Object} [options.contextOptions] Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.\n * @param {Element|String} [options.creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added\n * to the bottom of the widget itself.\n * @param {Element|String} [options.creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself.\n * @param {Boolean} [options.shadows=false] Determines if shadows are cast by light sources.\n * @param {ShadowMode} [options.terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources.\n * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @param {Boolean} [options.blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.\n * @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @param {Number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Widget.html|Cesium Sandcastle Cesium Widget Demo}\n *\n * @example\n * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,\n * // and in the body, include: <div id=\"cesiumContainer\"></div>\n *\n * //Widget with no terrain and default Bing Maps imagery provider.\n * const widget = new Cesium.CesiumWidget('cesiumContainer');\n *\n * //Widget with ion imagery and Cesium World Terrain.\n * const widget2 = new Cesium.CesiumWidget('cesiumContainer', {\n * imageryProvider : Cesium.createWorldImagery(),\n * terrainProvider : Cesium.createWorldTerrain(),\n * skyBox : new Cesium.SkyBox({\n * sources : {\n * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',\n * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',\n * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',\n * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',\n * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',\n * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'\n * }\n * }),\n * // Show Columbus View map with Web Mercator projection\n * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,\n * mapProjection : new Cesium.WebMercatorProjection()\n * });\n */\nfunction CesiumWidget(container, options) {\n container = getElement(container);\n\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n //Configure the widget DOM elements\n const element = document.createElement(\"div\");\n element.className = \"cesium-widget\";\n container.appendChild(element);\n\n const canvas = document.createElement(\"canvas\");\n const supportsImageRenderingPixelated = FeatureDetection.supportsImageRenderingPixelated();\n this._supportsImageRenderingPixelated = supportsImageRenderingPixelated;\n if (supportsImageRenderingPixelated) {\n canvas.style.imageRendering = FeatureDetection.imageRenderingValue();\n }\n\n canvas.oncontextmenu = function () {\n return false;\n };\n canvas.onselectstart = function () {\n return false;\n };\n\n // Interacting with a canvas does not automatically blur the previously focused element.\n // This leads to unexpected interaction if the last element was an input field.\n // For example, clicking the mouse wheel could lead to the value in the field changing\n // unexpectedly. The solution is to blur whatever has focus as soon as canvas interaction begins.\n // Although in some cases the active element needs to stay active even after interacting with the canvas,\n // for example when clicking on it only for getting the data of a clicked position or an entity.\n // For this case, the `blurActiveElementOnCanvasFocus` can be passed with false to avoid blurring\n // the active element after interacting with the canvas.\n function blurActiveElement() {\n if (canvas !== canvas.ownerDocument.activeElement) {\n canvas.ownerDocument.activeElement.blur();\n }\n }\n\n const blurActiveElementOnCanvasFocus = defaultValue(\n options.blurActiveElementOnCanvasFocus,\n true\n );\n\n if (blurActiveElementOnCanvasFocus) {\n canvas.addEventListener(\"mousedown\", blurActiveElement);\n canvas.addEventListener(\"pointerdown\", blurActiveElement);\n }\n\n element.appendChild(canvas);\n\n const innerCreditContainer = document.createElement(\"div\");\n innerCreditContainer.className = \"cesium-widget-credits\";\n\n const creditContainer = defined(options.creditContainer)\n ? getElement(options.creditContainer)\n : element;\n creditContainer.appendChild(innerCreditContainer);\n\n const creditViewport = defined(options.creditViewport)\n ? getElement(options.creditViewport)\n : element;\n\n const showRenderLoopErrors = defaultValue(options.showRenderLoopErrors, true);\n\n const useBrowserRecommendedResolution = defaultValue(\n options.useBrowserRecommendedResolution,\n true\n );\n\n this._element = element;\n this._container = container;\n this._canvas = canvas;\n this._canvasClientWidth = 0;\n this._canvasClientHeight = 0;\n this._lastDevicePixelRatio = 0;\n this._creditViewport = creditViewport;\n this._creditContainer = creditContainer;\n this._innerCreditContainer = innerCreditContainer;\n this._canRender = false;\n this._renderLoopRunning = false;\n this._showRenderLoopErrors = showRenderLoopErrors;\n this._resolutionScale = 1.0;\n this._useBrowserRecommendedResolution = useBrowserRecommendedResolution;\n this._forceResize = false;\n this._clock = defined(options.clock) ? options.clock : new Clock();\n\n configureCanvasSize(this);\n\n try {\n const scene = new Scene({\n canvas: canvas,\n contextOptions: options.contextOptions,\n creditContainer: innerCreditContainer,\n creditViewport: creditViewport,\n mapProjection: options.mapProjection,\n orderIndependentTranslucency: options.orderIndependentTranslucency,\n scene3DOnly: defaultValue(options.scene3DOnly, false),\n shadows: options.shadows,\n mapMode2D: options.mapMode2D,\n requestRenderMode: options.requestRenderMode,\n maximumRenderTimeChange: options.maximumRenderTimeChange,\n depthPlaneEllipsoidOffset: options.depthPlaneEllipsoidOffset,\n msaaSamples: options.msaaSamples,\n });\n this._scene = scene;\n\n scene.camera.constrainedAxis = Cartesian3.UNIT_Z;\n\n configurePixelRatio(this);\n configureCameraFrustum(this);\n\n const ellipsoid = defaultValue(\n scene.mapProjection.ellipsoid,\n Ellipsoid.WGS84\n );\n\n let globe = options.globe;\n if (!defined(globe)) {\n globe = new Globe(ellipsoid);\n }\n if (globe !== false) {\n scene.globe = globe;\n scene.globe.shadows = defaultValue(\n options.terrainShadows,\n ShadowMode.RECEIVE_ONLY\n );\n }\n\n let skyBox = options.skyBox;\n if (!defined(skyBox)) {\n skyBox = new SkyBox({\n sources: {\n positiveX: getDefaultSkyBoxUrl(\"px\"),\n negativeX: getDefaultSkyBoxUrl(\"mx\"),\n positiveY: getDefaultSkyBoxUrl(\"py\"),\n negativeY: getDefaultSkyBoxUrl(\"my\"),\n positiveZ: getDefaultSkyBoxUrl(\"pz\"),\n negativeZ: getDefaultSkyBoxUrl(\"mz\"),\n },\n });\n }\n if (skyBox !== false) {\n scene.skyBox = skyBox;\n scene.sun = new Sun();\n scene.moon = new Moon();\n }\n\n // Blue sky, and the glow around the Earth's limb.\n let skyAtmosphere = options.skyAtmosphere;\n if (!defined(skyAtmosphere)) {\n skyAtmosphere = new SkyAtmosphere(ellipsoid);\n }\n if (skyAtmosphere !== false) {\n scene.skyAtmosphere = skyAtmosphere;\n }\n\n //Set the base imagery layer\n let imageryProvider =\n options.globe === false ? false : options.imageryProvider;\n if (!defined(imageryProvider)) {\n imageryProvider = createWorldImagery();\n }\n\n if (imageryProvider !== false) {\n scene.imageryLayers.addImageryProvider(imageryProvider);\n }\n\n //Set the terrain provider if one is provided.\n if (defined(options.terrainProvider) && options.globe !== false) {\n scene.terrainProvider = options.terrainProvider;\n }\n\n this._screenSpaceEventHandler = new ScreenSpaceEventHandler(canvas);\n\n if (defined(options.sceneMode)) {\n if (options.sceneMode === SceneMode.SCENE2D) {\n this._scene.morphTo2D(0);\n }\n if (options.sceneMode === SceneMode.COLUMBUS_VIEW) {\n this._scene.morphToColumbusView(0);\n }\n }\n\n this._useDefaultRenderLoop = undefined;\n this.useDefaultRenderLoop = defaultValue(\n options.useDefaultRenderLoop,\n true\n );\n\n this._targetFrameRate = undefined;\n this.targetFrameRate = options.targetFrameRate;\n\n const that = this;\n this._onRenderError = function (scene, error) {\n that._useDefaultRenderLoop = false;\n that._renderLoopRunning = false;\n if (that._showRenderLoopErrors) {\n const title =\n \"An error occurred while rendering. Rendering has stopped.\";\n that.showErrorPanel(title, undefined, error);\n }\n };\n scene.renderError.addEventListener(this._onRenderError);\n } catch (error) {\n if (showRenderLoopErrors) {\n const title = \"Error constructing CesiumWidget.\";\n const message =\n '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:';\n this.showErrorPanel(title, message, error);\n }\n throw error;\n }\n}\n\nObject.defineProperties(CesiumWidget.prototype, {\n /**\n * Gets the parent container.\n * @memberof CesiumWidget.prototype\n *\n * @type {Element}\n * @readonly\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the canvas.\n * @memberof CesiumWidget.prototype\n *\n * @type {HTMLCanvasElement}\n * @readonly\n */\n canvas: {\n get: function () {\n return this._canvas;\n },\n },\n\n /**\n * Gets the credit container.\n * @memberof CesiumWidget.prototype\n *\n * @type {Element}\n * @readonly\n */\n creditContainer: {\n get: function () {\n return this._creditContainer;\n },\n },\n\n /**\n * Gets the credit viewport\n * @memberof CesiumWidget.prototype\n *\n * @type {Element}\n * @readonly\n */\n creditViewport: {\n get: function () {\n return this._creditViewport;\n },\n },\n\n /**\n * Gets the scene.\n * @memberof CesiumWidget.prototype\n *\n * @type {Scene}\n * @readonly\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the collection of image layers that will be rendered on the globe.\n * @memberof CesiumWidget.prototype\n *\n * @type {ImageryLayerCollection}\n * @readonly\n */\n imageryLayers: {\n get: function () {\n return this._scene.imageryLayers;\n },\n },\n\n /**\n * The terrain provider providing surface geometry for the globe.\n * @memberof CesiumWidget.prototype\n *\n * @type {TerrainProvider}\n */\n terrainProvider: {\n get: function () {\n return this._scene.terrainProvider;\n },\n set: function (terrainProvider) {\n this._scene.terrainProvider = terrainProvider;\n },\n },\n\n /**\n * Gets the camera.\n * @memberof CesiumWidget.prototype\n *\n * @type {Camera}\n * @readonly\n */\n camera: {\n get: function () {\n return this._scene.camera;\n },\n },\n\n /**\n * Gets the clock.\n * @memberof CesiumWidget.prototype\n *\n * @type {Clock}\n * @readonly\n */\n clock: {\n get: function () {\n return this._clock;\n },\n },\n\n /**\n * Gets the screen space event handler.\n * @memberof CesiumWidget.prototype\n *\n * @type {ScreenSpaceEventHandler}\n * @readonly\n */\n screenSpaceEventHandler: {\n get: function () {\n return this._screenSpaceEventHandler;\n },\n },\n\n /**\n * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>\n * is true. If undefined, the browser's requestAnimationFrame implementation\n * determines the frame rate. If defined, this value must be greater than 0. A value higher\n * than the underlying requestAnimationFrame implementation will have no effect.\n * @memberof CesiumWidget.prototype\n *\n * @type {Number}\n */\n targetFrameRate: {\n get: function () {\n return this._targetFrameRate;\n },\n set: function (value) {\nthis._targetFrameRate = value;\n },\n },\n\n /**\n * Gets or sets whether or not this widget should control the render loop.\n * If true the widget will use requestAnimationFrame to\n * perform rendering and resizing of the widget, as well as drive the\n * simulation clock. If set to false, you must manually call the\n * <code>resize</code>, <code>render</code> methods as part of a custom\n * render loop. If an error occurs during rendering, {@link Scene}'s\n * <code>renderError</code> event will be raised and this property\n * will be set to false. It must be set back to true to continue rendering\n * after the error.\n * @memberof CesiumWidget.prototype\n *\n * @type {Boolean}\n */\n useDefaultRenderLoop: {\n get: function () {\n return this._useDefaultRenderLoop;\n },\n set: function (value) {\n if (this._useDefaultRenderLoop !== value) {\n this._useDefaultRenderLoop = value;\n if (value && !this._renderLoopRunning) {\n startRenderLoop(this);\n }\n }\n },\n },\n\n /**\n * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve\n * performance on less powerful devices while values greater than 1.0 will render at a higher\n * resolution and then scale down, resulting in improved visual fidelity.\n * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5\n * will cause the scene to be rendered at 320x240 and then scaled up while setting\n * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.\n * @memberof CesiumWidget.prototype\n *\n * @type {Number}\n * @default 1.0\n */\n resolutionScale: {\n get: function () {\n return this._resolutionScale;\n },\n set: function (value) {\nif (this._resolutionScale !== value) {\n this._resolutionScale = value;\n this._forceResize = true;\n }\n },\n },\n\n /**\n * Boolean flag indicating if the browser's recommended resolution is used.\n * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,\n * effectively rendering based on CSS pixels instead of device pixels. This can improve\n * performance on less powerful devices that have high pixel density. When false, rendering\n * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether\n * this flag is true or false.\n * @memberof CesiumWidget.prototype\n *\n * @type {Boolean}\n * @default true\n */\n useBrowserRecommendedResolution: {\n get: function () {\n return this._useBrowserRecommendedResolution;\n },\n set: function (value) {\n if (this._useBrowserRecommendedResolution !== value) {\n this._useBrowserRecommendedResolution = value;\n this._forceResize = true;\n }\n },\n },\n});\n\n/**\n * Show an error panel to the user containing a title and a longer error message,\n * which can be dismissed using an OK button. This panel is displayed automatically\n * when a render loop error occurs, if showRenderLoopErrors was not false when the\n * widget was constructed.\n *\n * @param {String} title The title to be displayed on the error panel. This string is interpreted as text.\n * @param {String} [message] A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.\n * @param {String} [error] The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.\n */\nCesiumWidget.prototype.showErrorPanel = function (title, message, error) {\n const element = this._element;\n const overlay = document.createElement(\"div\");\n overlay.className = \"cesium-widget-errorPanel\";\n\n const content = document.createElement(\"div\");\n content.className = \"cesium-widget-errorPanel-content\";\n overlay.appendChild(content);\n\n const errorHeader = document.createElement(\"div\");\n errorHeader.className = \"cesium-widget-errorPanel-header\";\n errorHeader.appendChild(document.createTextNode(title));\n content.appendChild(errorHeader);\n\n const errorPanelScroller = document.createElement(\"div\");\n errorPanelScroller.className = \"cesium-widget-errorPanel-scroll\";\n content.appendChild(errorPanelScroller);\n function resizeCallback() {\n errorPanelScroller.style.maxHeight = `${Math.max(\n Math.round(element.clientHeight * 0.9 - 100),\n 30\n )}px`;\n }\n resizeCallback();\n if (defined(window.addEventListener)) {\n window.addEventListener(\"resize\", resizeCallback, false);\n }\n\n const hasMessage = defined(message);\n const hasError = defined(error);\n\n if (hasMessage || hasError) {\n const errorMessage = document.createElement(\"div\");\n errorMessage.className = \"cesium-widget-errorPanel-message\";\n errorPanelScroller.appendChild(errorMessage);\n\n if (hasError) {\n let errorDetails = formatError(error);\n if (!hasMessage) {\n if (typeof error === \"string\") {\n error = new Error(error);\n }\n\n message = formatError({\n name: error.name,\n message: error.message,\n });\n errorDetails = error.stack;\n }\n\n //IE8 does not have a console object unless the dev tools are open.\n if (typeof console !== \"undefined\") {\n console.error(`${title}\\n${message}\\n${errorDetails}`);\n }\n\n const errorMessageDetails = document.createElement(\"div\");\n errorMessageDetails.className =\n \"cesium-widget-errorPanel-message-details collapsed\";\n\n const moreDetails = document.createElement(\"span\");\n moreDetails.className = \"cesium-widget-errorPanel-more-details\";\n moreDetails.appendChild(document.createTextNode(\"See more...\"));\n errorMessageDetails.appendChild(moreDetails);\n\n errorMessageDetails.onclick = function (e) {\n errorMessageDetails.removeChild(moreDetails);\n errorMessageDetails.appendChild(document.createTextNode(errorDetails));\n errorMessageDetails.className =\n \"cesium-widget-errorPanel-message-details\";\n content.className = \"cesium-widget-errorPanel-content expanded\";\n errorMessageDetails.onclick = undefined;\n };\n\n errorPanelScroller.appendChild(errorMessageDetails);\n }\n\n errorMessage.innerHTML = `<p>${message}</p>`;\n }\n\n const buttonPanel = document.createElement(\"div\");\n buttonPanel.className = \"cesium-widget-errorPanel-buttonPanel\";\n content.appendChild(buttonPanel);\n\n const okButton = document.createElement(\"button\");\n okButton.setAttribute(\"type\", \"button\");\n okButton.className = \"cesium-button\";\n okButton.appendChild(document.createTextNode(\"OK\"));\n okButton.onclick = function () {\n if (defined(resizeCallback) && defined(window.removeEventListener)) {\n window.removeEventListener(\"resize\", resizeCallback, false);\n }\n element.removeChild(overlay);\n };\n\n buttonPanel.appendChild(okButton);\n\n element.appendChild(overlay);\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nCesiumWidget.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nCesiumWidget.prototype.destroy = function () {\n if (defined(this._scene)) {\n this._scene.renderError.removeEventListener(this._onRenderError);\n this._scene = this._scene.destroy();\n }\n this._container.removeChild(this._element);\n this._creditContainer.removeChild(this._innerCreditContainer);\n destroyObject(this);\n};\n\n/**\n * Updates the canvas size, camera aspect ratio, and viewport size.\n * This function is called automatically as needed unless\n * <code>useDefaultRenderLoop</code> is set to false.\n */\nCesiumWidget.prototype.resize = function () {\n const canvas = this._canvas;\n if (\n !this._forceResize &&\n this._canvasClientWidth === canvas.clientWidth &&\n this._canvasClientHeight === canvas.clientHeight &&\n this._lastDevicePixelRatio === window.devicePixelRatio\n ) {\n return;\n }\n this._forceResize = false;\n\n configureCanvasSize(this);\n configureCameraFrustum(this);\n\n this._scene.requestRender();\n};\n\n/**\n * Renders the scene. This function is called automatically\n * unless <code>useDefaultRenderLoop</code> is set to false;\n */\nCesiumWidget.prototype.render = function () {\n if (this._canRender) {\n this._scene.initializeFrame();\n const currentTime = this._clock.tick();\n this._scene.render(currentTime);\n } else {\n this._clock.tick();\n }\n};\nexport default CesiumWidget;\n", "import defined from \"../../Core/defined.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Fullscreen from \"../../Core/Fullscreen.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\nimport getElement from \"../getElement.js\";\n\n/**\n * The view model for {@link FullscreenButton}.\n * @alias FullscreenButtonViewModel\n * @constructor\n *\n * @param {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.\n * @param {Element|String} [container] The DOM element or ID that will contain the widget.\n */\nfunction FullscreenButtonViewModel(fullscreenElement, container) {\n if (!defined(container)) {\n container = document.body;\n }\n\n container = getElement(container);\n\n const that = this;\n\n const tmpIsFullscreen = knockout.observable(Fullscreen.fullscreen);\n const tmpIsEnabled = knockout.observable(Fullscreen.enabled);\n const ownerDocument = container.ownerDocument;\n\n /**\n * Gets whether or not fullscreen mode is active. This property is observable.\n *\n * @type {Boolean}\n */\n this.isFullscreen = undefined;\n knockout.defineProperty(this, \"isFullscreen\", {\n get: function () {\n return tmpIsFullscreen();\n },\n });\n\n /**\n * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.\n *\n * @type {Boolean}\n * @see Fullscreen.enabled\n */\n this.isFullscreenEnabled = undefined;\n knockout.defineProperty(this, \"isFullscreenEnabled\", {\n get: function () {\n return tmpIsEnabled();\n },\n set: function (value) {\n tmpIsEnabled(value && Fullscreen.enabled);\n },\n });\n\n /**\n * Gets the tooltip. This property is observable.\n *\n * @type {String}\n */\n this.tooltip = undefined;\n knockout.defineProperty(this, \"tooltip\", function () {\n if (!this.isFullscreenEnabled) {\n return \"Full screen unavailable\";\n }\n return tmpIsFullscreen() ? \"Exit full screen\" : \"Full screen\";\n });\n\n this._command = createCommand(function () {\n if (Fullscreen.fullscreen) {\n Fullscreen.exitFullscreen();\n } else {\n Fullscreen.requestFullscreen(that._fullscreenElement);\n }\n }, knockout.getObservable(this, \"isFullscreenEnabled\"));\n\n this._fullscreenElement = defaultValue(\n getElement(fullscreenElement),\n ownerDocument.body\n );\n\n this._callback = function () {\n tmpIsFullscreen(Fullscreen.fullscreen);\n };\n ownerDocument.addEventListener(Fullscreen.changeEventName, this._callback);\n}\n\nObject.defineProperties(FullscreenButtonViewModel.prototype, {\n /**\n * Gets or sets the HTML element to place into fullscreen mode when the\n * corresponding button is pressed.\n * @memberof FullscreenButtonViewModel.prototype\n *\n * @type {Element}\n */\n fullscreenElement: {\n //TODO:@exception {DeveloperError} value must be a valid HTML Element.\n get: function () {\n return this._fullscreenElement;\n },\n set: function (value) {\n this._fullscreenElement = value;\n },\n },\n\n /**\n * Gets the Command to toggle fullscreen mode.\n * @memberof FullscreenButtonViewModel.prototype\n *\n * @type {Command}\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nFullscreenButtonViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the view model. Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nFullscreenButtonViewModel.prototype.destroy = function () {\n document.removeEventListener(Fullscreen.changeEventName, this._callback);\n destroyObject(this);\n};\nexport default FullscreenButtonViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport FullscreenButtonViewModel from \"./FullscreenButtonViewModel.js\";\n\nconst enterFullScreenPath =\n \"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\";\nconst exitFullScreenPath =\n \"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\";\n\n/**\n * A single button widget for toggling fullscreen mode.\n *\n * @alias FullscreenButton\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @see Fullscreen\n */\nfunction FullscreenButton(container, fullscreenElement) {\n container = getElement(container);\n\n const viewModel = new FullscreenButtonViewModel(fullscreenElement, container);\n\n viewModel._exitFullScreenPath = exitFullScreenPath;\n viewModel._enterFullScreenPath = enterFullScreenPath;\n\n const element = document.createElement(\"button\");\n element.type = \"button\";\n element.className = \"cesium-button cesium-fullscreenButton\";\n element.setAttribute(\n \"data-bind\",\n \"\\\nattr: { title: tooltip },\\\nclick: command,\\\nenable: isFullscreenEnabled,\\\ncesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }\"\n );\n\n container.appendChild(element);\n\n knockout.applyBindings(viewModel, element);\n\n this._container = container;\n this._viewModel = viewModel;\n this._element = element;\n}\n\nObject.defineProperties(FullscreenButton.prototype, {\n /**\n * Gets the parent container.\n * @memberof FullscreenButton.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof FullscreenButton.prototype\n *\n * @type {FullscreenButtonViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nFullscreenButton.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nFullscreenButton.prototype.destroy = function () {\n this._viewModel.destroy();\n\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n\n return destroyObject(this);\n};\nexport default FullscreenButton;\n", "import CartographicGeocoderService from \"../../Core/CartographicGeocoderService.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Event from \"../../Core/Event.js\";\nimport GeocodeType from \"../../Core/GeocodeType.js\";\nimport IonGeocoderService from \"../../Core/IonGeocoderService.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport Rectangle from \"../../Core/Rectangle.js\";\nimport sampleTerrainMostDetailed from \"../../Core/sampleTerrainMostDetailed.js\";\nimport computeFlyToLocationForRectangle from \"../../Scene/computeFlyToLocationForRectangle.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\nimport getElement from \"../getElement.js\";\n\n// The height we use if geocoding to a specific point instead of an rectangle.\nconst DEFAULT_HEIGHT = 1000;\n\n/**\n * The view model for the {@link Geocoder} widget.\n * @alias GeocoderViewModel\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Scene} options.scene The Scene instance to use.\n * @param {GeocoderService[]} [options.geocoderServices] Geocoder services to use for geocoding queries.\n * If more than one are supplied, suggestions will be gathered for the geocoders that support it,\n * and if no suggestion is selected the result from the first geocoder service wil be used.\n * @param {Number} [options.flightDuration] The duration of the camera flight to an entered location, in seconds.\n * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination.\n */\nfunction GeocoderViewModel(options) {\n if (defined(options.geocoderServices)) {\n this._geocoderServices = options.geocoderServices;\n } else {\n this._geocoderServices = [\n new CartographicGeocoderService(),\n new IonGeocoderService({ scene: options.scene }),\n ];\n }\n\n this._viewContainer = options.container;\n this._scene = options.scene;\n this._flightDuration = options.flightDuration;\n this._searchText = \"\";\n this._isSearchInProgress = false;\n this._geocodePromise = undefined;\n this._complete = new Event();\n this._suggestions = [];\n this._selectedSuggestion = undefined;\n this._showSuggestions = true;\n\n this._handleArrowDown = handleArrowDown;\n this._handleArrowUp = handleArrowUp;\n\n const that = this;\n\n this._suggestionsVisible = knockout.pureComputed(function () {\n const suggestions = knockout.getObservable(that, \"_suggestions\");\n const suggestionsNotEmpty = suggestions().length > 0;\n const showSuggestions = knockout.getObservable(that, \"_showSuggestions\")();\n return suggestionsNotEmpty && showSuggestions;\n });\n\n this._searchCommand = createCommand(function (geocodeType) {\n geocodeType = defaultValue(geocodeType, GeocodeType.SEARCH);\n that._focusTextbox = false;\n if (defined(that._selectedSuggestion)) {\n that.activateSuggestion(that._selectedSuggestion);\n return false;\n }\n that.hideSuggestions();\n if (that.isSearchInProgress) {\n cancelGeocode(that);\n } else {\n geocode(that, that._geocoderServices, geocodeType);\n }\n });\n\n this.deselectSuggestion = function () {\n that._selectedSuggestion = undefined;\n };\n\n this.handleKeyDown = function (data, event) {\n const downKey =\n event.key === \"ArrowDown\" || event.key === \"Down\" || event.keyCode === 40;\n const upKey =\n event.key === \"ArrowUp\" || event.key === \"Up\" || event.keyCode === 38;\n if (downKey || upKey) {\n event.preventDefault();\n }\n\n return true;\n };\n\n this.handleKeyUp = function (data, event) {\n const downKey =\n event.key === \"ArrowDown\" || event.key === \"Down\" || event.keyCode === 40;\n const upKey =\n event.key === \"ArrowUp\" || event.key === \"Up\" || event.keyCode === 38;\n const enterKey = event.key === \"Enter\" || event.keyCode === 13;\n if (upKey) {\n handleArrowUp(that);\n } else if (downKey) {\n handleArrowDown(that);\n } else if (enterKey) {\n that._searchCommand();\n }\n return true;\n };\n\n this.activateSuggestion = function (data) {\n that.hideSuggestions();\n that._searchText = data.displayName;\n const destination = data.destination;\n clearSuggestions(that);\n that.destinationFound(that, destination);\n };\n\n this.hideSuggestions = function () {\n that._showSuggestions = false;\n that._selectedSuggestion = undefined;\n };\n\n this.showSuggestions = function () {\n that._showSuggestions = true;\n };\n\n this.handleMouseover = function (data, event) {\n if (data !== that._selectedSuggestion) {\n that._selectedSuggestion = data;\n }\n };\n\n /**\n * Gets or sets a value indicating if this instance should always show its text input field.\n *\n * @type {Boolean}\n * @default false\n */\n this.keepExpanded = false;\n\n /**\n * True if the geocoder should query as the user types to autocomplete\n * @type {Boolean}\n * @default true\n */\n this.autoComplete = defaultValue(options.autocomplete, true);\n\n /**\n * Gets and sets the command called when a geocode destination is found\n * @type {Geocoder.DestinationFoundFunction}\n */\n this.destinationFound = defaultValue(\n options.destinationFound,\n GeocoderViewModel.flyToDestination\n );\n\n this._focusTextbox = false;\n\n knockout.track(this, [\n \"_searchText\",\n \"_isSearchInProgress\",\n \"keepExpanded\",\n \"_suggestions\",\n \"_selectedSuggestion\",\n \"_showSuggestions\",\n \"_focusTextbox\",\n ]);\n\n const searchTextObservable = knockout.getObservable(this, \"_searchText\");\n searchTextObservable.extend({ rateLimit: { timeout: 500 } });\n this._suggestionSubscription = searchTextObservable.subscribe(function () {\n GeocoderViewModel._updateSearchSuggestions(that);\n });\n /**\n * Gets a value indicating whether a search is currently in progress. This property is observable.\n *\n * @type {Boolean}\n */\n this.isSearchInProgress = undefined;\n knockout.defineProperty(this, \"isSearchInProgress\", {\n get: function () {\n return this._isSearchInProgress;\n },\n });\n\n /**\n * Gets or sets the text to search for. The text can be an address, or longitude, latitude,\n * and optional height, where longitude and latitude are in degrees and height is in meters.\n *\n * @type {String}\n */\n this.searchText = undefined;\n knockout.defineProperty(this, \"searchText\", {\n get: function () {\n if (this.isSearchInProgress) {\n return \"Searching...\";\n }\n\n return this._searchText;\n },\n set: function (value) {\nthis._searchText = value;\n },\n });\n\n /**\n * Gets or sets the the duration of the camera flight in seconds.\n * A value of zero causes the camera to instantly switch to the geocoding location.\n * The duration will be computed based on the distance when undefined.\n *\n * @type {Number|undefined}\n * @default undefined\n */\n this.flightDuration = undefined;\n knockout.defineProperty(this, \"flightDuration\", {\n get: function () {\n return this._flightDuration;\n },\n set: function (value) {\n this._flightDuration = value;\n },\n });\n}\n\nObject.defineProperties(GeocoderViewModel.prototype, {\n /**\n * Gets the event triggered on flight completion.\n * @memberof GeocoderViewModel.prototype\n *\n * @type {Event}\n */\n complete: {\n get: function () {\n return this._complete;\n },\n },\n\n /**\n * Gets the scene to control.\n * @memberof GeocoderViewModel.prototype\n *\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the Command that is executed when the button is clicked.\n * @memberof GeocoderViewModel.prototype\n *\n * @type {Command}\n */\n search: {\n get: function () {\n return this._searchCommand;\n },\n },\n\n /**\n * Gets the currently selected geocoder search suggestion\n * @memberof GeocoderViewModel.prototype\n *\n * @type {Object}\n */\n selectedSuggestion: {\n get: function () {\n return this._selectedSuggestion;\n },\n },\n\n /**\n * Gets the list of geocoder search suggestions\n * @memberof GeocoderViewModel.prototype\n *\n * @type {Object[]}\n */\n suggestions: {\n get: function () {\n return this._suggestions;\n },\n },\n});\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nGeocoderViewModel.prototype.destroy = function () {\n this._suggestionSubscription.dispose();\n};\n\nfunction handleArrowUp(viewModel) {\n if (viewModel._suggestions.length === 0) {\n return;\n }\n const currentIndex = viewModel._suggestions.indexOf(\n viewModel._selectedSuggestion\n );\n if (currentIndex === -1 || currentIndex === 0) {\n viewModel._selectedSuggestion = undefined;\n return;\n }\n const next = currentIndex - 1;\n viewModel._selectedSuggestion = viewModel._suggestions[next];\n GeocoderViewModel._adjustSuggestionsScroll(viewModel, next);\n}\n\nfunction handleArrowDown(viewModel) {\n if (viewModel._suggestions.length === 0) {\n return;\n }\n const numberOfSuggestions = viewModel._suggestions.length;\n const currentIndex = viewModel._suggestions.indexOf(\n viewModel._selectedSuggestion\n );\n const next = (currentIndex + 1) % numberOfSuggestions;\n viewModel._selectedSuggestion = viewModel._suggestions[next];\n\n GeocoderViewModel._adjustSuggestionsScroll(viewModel, next);\n}\n\nfunction computeFlyToLocationForCartographic(cartographic, terrainProvider) {\n const availability = defined(terrainProvider)\n ? terrainProvider.availability\n : undefined;\n\n if (!defined(availability)) {\n cartographic.height += DEFAULT_HEIGHT;\n return Promise.resolve(cartographic);\n }\n\n return sampleTerrainMostDetailed(terrainProvider, [cartographic]).then(\n function (positionOnTerrain) {\n cartographic = positionOnTerrain[0];\n cartographic.height += DEFAULT_HEIGHT;\n return cartographic;\n }\n );\n}\n\nfunction flyToDestination(viewModel, destination) {\n const scene = viewModel._scene;\n const mapProjection = scene.mapProjection;\n const ellipsoid = mapProjection.ellipsoid;\n\n const camera = scene.camera;\n const terrainProvider = scene.terrainProvider;\n let finalDestination = destination;\n\n let promise;\n if (destination instanceof Rectangle) {\n // Some geocoders return a Rectangle of zero width/height, treat it like a point instead.\n if (\n CesiumMath.equalsEpsilon(\n destination.south,\n destination.north,\n CesiumMath.EPSILON7\n ) &&\n CesiumMath.equalsEpsilon(\n destination.east,\n destination.west,\n CesiumMath.EPSILON7\n )\n ) {\n // destination is now a Cartographic\n destination = Rectangle.center(destination);\n } else {\n promise = computeFlyToLocationForRectangle(destination, scene);\n }\n } else {\n // destination is a Cartesian3\n destination = ellipsoid.cartesianToCartographic(destination);\n }\n\n if (!defined(promise)) {\n promise = computeFlyToLocationForCartographic(destination, terrainProvider);\n }\n\n return promise\n .then(function (result) {\n finalDestination = ellipsoid.cartographicToCartesian(result);\n })\n .finally(function () {\n // Whether terrain querying succeeded or not, fly to the destination.\n camera.flyTo({\n destination: finalDestination,\n complete: function () {\n viewModel._complete.raiseEvent();\n },\n duration: viewModel._flightDuration,\n endTransform: Matrix4.IDENTITY,\n });\n });\n}\n\nfunction chainPromise(promise, geocoderService, query, geocodeType) {\n return promise.then(function (result) {\n if (\n defined(result) &&\n result.state === \"fulfilled\" &&\n result.value.length > 0\n ) {\n return result;\n }\n const nextPromise = geocoderService\n .geocode(query, geocodeType)\n .then(function (result) {\n return { state: \"fulfilled\", value: result };\n })\n .catch(function (err) {\n return { state: \"rejected\", reason: err };\n });\n\n return nextPromise;\n });\n}\n\nfunction geocode(viewModel, geocoderServices, geocodeType) {\n const query = viewModel._searchText;\n\n if (hasOnlyWhitespace(query)) {\n viewModel.showSuggestions();\n return;\n }\n\n viewModel._isSearchInProgress = true;\n\n let promise = Promise.resolve();\n for (let i = 0; i < geocoderServices.length; i++) {\n promise = chainPromise(promise, geocoderServices[i], query, geocodeType);\n }\n\n viewModel._geocodePromise = promise;\n promise.then(function (result) {\n if (promise.cancel) {\n return;\n }\n viewModel._isSearchInProgress = false;\n\n const geocoderResults = result.value;\n if (\n result.state === \"fulfilled\" &&\n defined(geocoderResults) &&\n geocoderResults.length > 0\n ) {\n viewModel._searchText = geocoderResults[0].displayName;\n viewModel.destinationFound(viewModel, geocoderResults[0].destination);\n return;\n }\n viewModel._searchText = `${query} (not found)`;\n });\n}\n\nfunction adjustSuggestionsScroll(viewModel, focusedItemIndex) {\n const container = getElement(viewModel._viewContainer);\n const searchResults = container.getElementsByClassName(\"search-results\")[0];\n const listItems = container.getElementsByTagName(\"li\");\n const element = listItems[focusedItemIndex];\n\n if (focusedItemIndex === 0) {\n searchResults.scrollTop = 0;\n return;\n }\n\n const offsetTop = element.offsetTop;\n if (offsetTop + element.clientHeight > searchResults.clientHeight) {\n searchResults.scrollTop = offsetTop + element.clientHeight;\n } else if (offsetTop < searchResults.scrollTop) {\n searchResults.scrollTop = offsetTop;\n }\n}\n\nfunction cancelGeocode(viewModel) {\n viewModel._isSearchInProgress = false;\n if (defined(viewModel._geocodePromise)) {\n viewModel._geocodePromise.cancel = true;\n viewModel._geocodePromise = undefined;\n }\n}\n\nfunction hasOnlyWhitespace(string) {\n return /^\\s*$/.test(string);\n}\n\nfunction clearSuggestions(viewModel) {\n knockout.getObservable(viewModel, \"_suggestions\").removeAll();\n}\n\nfunction updateSearchSuggestions(viewModel) {\n if (!viewModel.autoComplete) {\n return;\n }\n\n const query = viewModel._searchText;\n\n clearSuggestions(viewModel);\n if (hasOnlyWhitespace(query)) {\n return;\n }\n\n let promise = Promise.resolve([]);\n viewModel._geocoderServices.forEach(function (service) {\n promise = promise.then(function (results) {\n if (results.length >= 5) {\n return results;\n }\n return service\n .geocode(query, GeocodeType.AUTOCOMPLETE)\n .then(function (newResults) {\n results = results.concat(newResults);\n return results;\n });\n });\n });\n return promise.then(function (results) {\n const suggestions = viewModel._suggestions;\n for (let i = 0; i < results.length; i++) {\n suggestions.push(results[i]);\n }\n });\n}\n\n/**\n * A function to fly to the destination found by a successful geocode.\n * @type {Geocoder.DestinationFoundFunction}\n */\nGeocoderViewModel.flyToDestination = flyToDestination;\n\n//exposed for testing\nGeocoderViewModel._updateSearchSuggestions = updateSearchSuggestions;\nGeocoderViewModel._adjustSuggestionsScroll = adjustSuggestionsScroll;\nexport default GeocoderViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport GeocoderViewModel from \"./GeocoderViewModel.js\";\n\nconst startSearchPath =\n \"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\";\nconst stopSearchPath =\n \"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\";\n\n/**\n * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is\n * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.\n *\n * @alias Geocoder\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Element|String} options.container The DOM element or ID that will contain the widget.\n * @param {Scene} options.scene The Scene instance to use.\n * @param {GeocoderService[]} [options.geocoderServices] The geocoder services to be used\n * @param {Boolean} [options.autoComplete = true] True if the geocoder should query as the user types to autocomplete\n * @param {Number} [options.flightDuration=1.5] The duration of the camera flight to an entered location, in seconds.\n * @param {Geocoder.DestinationFoundFunction} [options.destinationFound=GeocoderViewModel.flyToDestination] A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination.\n */\nfunction Geocoder(options) {\n const container = getElement(options.container);\n const viewModel = new GeocoderViewModel(options);\n\n viewModel._startSearchPath = startSearchPath;\n viewModel._stopSearchPath = stopSearchPath;\n\n const form = document.createElement(\"form\");\n form.setAttribute(\"data-bind\", \"submit: search\");\n\n const textBox = document.createElement(\"input\");\n textBox.type = \"search\";\n textBox.className = \"cesium-geocoder-input\";\n textBox.setAttribute(\"placeholder\", \"Enter an address or landmark...\");\n textBox.setAttribute(\n \"data-bind\",\n '\\\ntextInput: searchText,\\\ndisable: isSearchInProgress,\\\nevent: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },\\\ncss: { \"cesium-geocoder-input-wide\" : keepExpanded || searchText.length > 0 },\\\nhasFocus: _focusTextbox'\n );\n\n this._onTextBoxFocus = function () {\n // as of 2016-10-19, setTimeout is required to ensure that the\n // text is focused on Safari 10\n setTimeout(function () {\n textBox.select();\n }, 0);\n };\n\n textBox.addEventListener(\"focus\", this._onTextBoxFocus, false);\n form.appendChild(textBox);\n this._textBox = textBox;\n\n const searchButton = document.createElement(\"span\");\n searchButton.className = \"cesium-geocoder-searchButton\";\n searchButton.setAttribute(\n \"data-bind\",\n \"\\\nclick: search,\\\ncesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }\"\n );\n form.appendChild(searchButton);\n\n container.appendChild(form);\n\n const searchSuggestionsContainer = document.createElement(\"div\");\n searchSuggestionsContainer.className = \"search-results\";\n searchSuggestionsContainer.setAttribute(\n \"data-bind\",\n \"visible: _suggestionsVisible\"\n );\n\n const suggestionsList = document.createElement(\"ul\");\n suggestionsList.setAttribute(\"data-bind\", \"foreach: _suggestions\");\n const suggestions = document.createElement(\"li\");\n suggestionsList.appendChild(suggestions);\n suggestions.setAttribute(\n \"data-bind\",\n \"text: $data.displayName, \\\nclick: $parent.activateSuggestion, \\\nevent: { mouseover: $parent.handleMouseover}, \\\ncss: { active: $data === $parent._selectedSuggestion }\"\n );\n\n searchSuggestionsContainer.appendChild(suggestionsList);\n container.appendChild(searchSuggestionsContainer);\n\n knockout.applyBindings(viewModel, form);\n knockout.applyBindings(viewModel, searchSuggestionsContainer);\n\n this._container = container;\n this._searchSuggestionsContainer = searchSuggestionsContainer;\n this._viewModel = viewModel;\n this._form = form;\n\n this._onInputBegin = function (e) {\n // e.target will not be correct if we are inside of the Shadow DOM\n // and contains will always fail. To retrieve the correct target,\n // we need to access the first element of the composedPath.\n // This allows us to use shadow DOM if it exists and fall\n // back to legacy behavior if its not being used.\n\n let target = e.target;\n if (typeof e.composedPath === \"function\") {\n target = e.composedPath()[0];\n }\n\n if (!container.contains(target)) {\n viewModel._focusTextbox = false;\n viewModel.hideSuggestions();\n }\n };\n\n this._onInputEnd = function (e) {\n viewModel._focusTextbox = true;\n viewModel.showSuggestions();\n };\n\n //We subscribe to both begin and end events in order to give the text box\n //focus no matter where on the widget is clicked.\n\n if (FeatureDetection.supportsPointerEvents()) {\n document.addEventListener(\"pointerdown\", this._onInputBegin, true);\n container.addEventListener(\"pointerup\", this._onInputEnd, true);\n container.addEventListener(\"pointercancel\", this._onInputEnd, true);\n } else {\n document.addEventListener(\"mousedown\", this._onInputBegin, true);\n container.addEventListener(\"mouseup\", this._onInputEnd, true);\n document.addEventListener(\"touchstart\", this._onInputBegin, true);\n container.addEventListener(\"touchend\", this._onInputEnd, true);\n container.addEventListener(\"touchcancel\", this._onInputEnd, true);\n }\n}\n\nObject.defineProperties(Geocoder.prototype, {\n /**\n * Gets the parent container.\n * @memberof Geocoder.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the parent container.\n * @memberof Geocoder.prototype\n *\n * @type {Element}\n */\n searchSuggestionsContainer: {\n get: function () {\n return this._searchSuggestionsContainer;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof Geocoder.prototype\n *\n * @type {GeocoderViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nGeocoder.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nGeocoder.prototype.destroy = function () {\n const container = this._container;\n if (FeatureDetection.supportsPointerEvents()) {\n document.removeEventListener(\"pointerdown\", this._onInputBegin, true);\n container.removeEventListener(\"pointerup\", this._onInputEnd, true);\n } else {\n document.removeEventListener(\"mousedown\", this._onInputBegin, true);\n container.removeEventListener(\"mouseup\", this._onInputEnd, true);\n document.removeEventListener(\"touchstart\", this._onInputBegin, true);\n container.removeEventListener(\"touchend\", this._onInputEnd, true);\n }\n this._viewModel.destroy();\n knockout.cleanNode(this._form);\n knockout.cleanNode(this._searchSuggestionsContainer);\n container.removeChild(this._form);\n container.removeChild(this._searchSuggestionsContainer);\n this._textBox.removeEventListener(\"focus\", this._onTextBoxFocus, false);\n\n return destroyObject(this);\n};\n\n/**\n * A function that handles the result of a successful geocode.\n * @callback Geocoder.DestinationFoundFunction\n * @param {GeocoderViewModel} viewModel The view model.\n * @param {Cartesian3|Rectangle} destination The destination result of the geocode.\n */\nexport default Geocoder;\n", "import defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link HomeButton}.\n * @alias HomeButtonViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use.\n * @param {Number} [duration] The duration of the camera flight in seconds.\n */\nfunction HomeButtonViewModel(scene, duration) {\n this._scene = scene;\n this._duration = duration;\n\n const that = this;\n this._command = createCommand(function () {\n that._scene.camera.flyHome(that._duration);\n });\n\n /**\n * Gets or sets the tooltip. This property is observable.\n *\n * @type {String}\n */\n this.tooltip = \"View Home\";\n\n knockout.track(this, [\"tooltip\"]);\n}\n\nObject.defineProperties(HomeButtonViewModel.prototype, {\n /**\n * Gets the scene to control.\n * @memberof HomeButtonViewModel.prototype\n *\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the Command that is executed when the button is clicked.\n * @memberof HomeButtonViewModel.prototype\n *\n * @type {Command}\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n\n /**\n * Gets or sets the the duration of the camera flight in seconds.\n * A value of zero causes the camera to instantly switch to home view.\n * The duration will be computed based on the distance when undefined.\n * @memberof HomeButtonViewModel.prototype\n *\n * @type {Number|undefined}\n */\n duration: {\n get: function () {\n return this._duration;\n },\n set: function (value) {\n this._duration = value;\n },\n },\n});\nexport default HomeButtonViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport HomeButtonViewModel from \"./HomeButtonViewModel.js\";\n\n/**\n * A single button widget for returning to the default camera view of the current scene.\n *\n * @alias HomeButton\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n * @param {Number} [duration] The time, in seconds, it takes to complete the camera flight home.\n */\nfunction HomeButton(container, scene, duration) {\n container = getElement(container);\n\n const viewModel = new HomeButtonViewModel(scene, duration);\n\n viewModel._svgPath =\n \"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\";\n\n const element = document.createElement(\"button\");\n element.type = \"button\";\n element.className = \"cesium-button cesium-toolbar-button cesium-home-button\";\n element.setAttribute(\n \"data-bind\",\n \"\\\nattr: { title: tooltip },\\\nclick: command,\\\ncesiumSvgPath: { path: _svgPath, width: 28, height: 28 }\"\n );\n\n container.appendChild(element);\n\n knockout.applyBindings(viewModel, element);\n\n this._container = container;\n this._viewModel = viewModel;\n this._element = element;\n}\n\nObject.defineProperties(HomeButton.prototype, {\n /**\n * Gets the parent container.\n * @memberof HomeButton.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof HomeButton.prototype\n *\n * @type {HomeButtonViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nHomeButton.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nHomeButton.prototype.destroy = function () {\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n\n return destroyObject(this);\n};\nexport default HomeButton;\n", "import defined from \"../../Core/defined.js\";\nimport Event from \"../../Core/Event.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\n\nconst cameraEnabledPath =\n \"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\";\nconst cameraDisabledPath =\n \"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\";\n\n/**\n * The view model for {@link InfoBox}.\n * @alias InfoBoxViewModel\n * @constructor\n */\nfunction InfoBoxViewModel() {\n this._cameraClicked = new Event();\n this._closeClicked = new Event();\n\n /**\n * Gets or sets the maximum height of the info box in pixels. This property is observable.\n * @type {Number}\n */\n this.maxHeight = 500;\n\n /**\n * Gets or sets whether the camera tracking icon is enabled.\n * @type {Boolean}\n */\n this.enableCamera = false;\n\n /**\n * Gets or sets the status of current camera tracking of the selected object.\n * @type {Boolean}\n */\n this.isCameraTracking = false;\n\n /**\n * Gets or sets the visibility of the info box.\n * @type {Boolean}\n */\n this.showInfo = false;\n\n /**\n * Gets or sets the title text in the info box.\n * @type {String}\n */\n this.titleText = \"\";\n\n /**\n * Gets or sets the description HTML for the info box.\n * @type {String}\n */\n this.description = \"\";\n\n knockout.track(this, [\n \"showInfo\",\n \"titleText\",\n \"description\",\n \"maxHeight\",\n \"enableCamera\",\n \"isCameraTracking\",\n ]);\n\n this._loadingIndicatorHtml =\n '<div class=\"cesium-infoBox-loadingContainer\"><span class=\"cesium-infoBox-loading\"></span></div>';\n\n /**\n * Gets the SVG path of the camera icon, which can change to be \"crossed out\" or not.\n * @type {String}\n */\n this.cameraIconPath = undefined;\n knockout.defineProperty(this, \"cameraIconPath\", {\n get: function () {\n return !this.enableCamera || this.isCameraTracking\n ? cameraDisabledPath\n : cameraEnabledPath;\n },\n });\n\n knockout.defineProperty(this, \"_bodyless\", {\n get: function () {\n return !defined(this.description) || this.description.length === 0;\n },\n });\n}\n\n/**\n * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.\n * @param {Number} offset The offset in pixels.\n * @returns {String}\n */\nInfoBoxViewModel.prototype.maxHeightOffset = function (offset) {\n return `${this.maxHeight - offset}px`;\n};\n\nObject.defineProperties(InfoBoxViewModel.prototype, {\n /**\n * Gets an {@link Event} that is fired when the user clicks the camera icon.\n * @memberof InfoBoxViewModel.prototype\n * @type {Event}\n */\n cameraClicked: {\n get: function () {\n return this._cameraClicked;\n },\n },\n /**\n * Gets an {@link Event} that is fired when the user closes the info box.\n * @memberof InfoBoxViewModel.prototype\n * @type {Event}\n */\n closeClicked: {\n get: function () {\n return this._closeClicked;\n },\n },\n});\nexport default InfoBoxViewModel;\n", "import buildModuleUrl from \"../../Core/buildModuleUrl.js\";\nimport Check from \"../../Core/Check.js\";\nimport Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\nimport InfoBoxViewModel from \"./InfoBoxViewModel.js\";\n\n/**\n * A widget for displaying information or a description.\n *\n * @alias InfoBox\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction InfoBox(container) {\ncontainer = getElement(container);\n\n const infoElement = document.createElement(\"div\");\n infoElement.className = \"cesium-infoBox\";\n infoElement.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-infoBox-visible\" : showInfo, \"cesium-infoBox-bodyless\" : _bodyless }'\n );\n container.appendChild(infoElement);\n\n const titleElement = document.createElement(\"div\");\n titleElement.className = \"cesium-infoBox-title\";\n titleElement.setAttribute(\"data-bind\", \"text: titleText\");\n infoElement.appendChild(titleElement);\n\n const cameraElement = document.createElement(\"button\");\n cameraElement.type = \"button\";\n cameraElement.className = \"cesium-button cesium-infoBox-camera\";\n cameraElement.setAttribute(\n \"data-bind\",\n '\\\nattr: { title: \"Focus camera on object\" },\\\nclick: function () { cameraClicked.raiseEvent(this); },\\\nenable: enableCamera,\\\ncesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'\n );\n infoElement.appendChild(cameraElement);\n\n const closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.className = \"cesium-infoBox-close\";\n closeElement.setAttribute(\n \"data-bind\",\n \"\\\nclick: function () { closeClicked.raiseEvent(this); }\"\n );\n closeElement.innerHTML = \"×\";\n infoElement.appendChild(closeElement);\n\n const frame = document.createElement(\"iframe\");\n frame.className = \"cesium-infoBox-iframe\";\n frame.setAttribute(\"sandbox\", \"allow-same-origin allow-popups allow-forms\"); //allow-pointer-lock allow-scripts allow-top-navigation\n frame.setAttribute(\n \"data-bind\",\n \"style : { maxHeight : maxHeightOffset(40) }\"\n );\n frame.setAttribute(\"allowfullscreen\", true);\n infoElement.appendChild(frame);\n\n const viewModel = new InfoBoxViewModel();\n knockout.applyBindings(viewModel, infoElement);\n\n this._container = container;\n this._element = infoElement;\n this._frame = frame;\n this._viewModel = viewModel;\n this._descriptionSubscription = undefined;\n\n const that = this;\n //We can't actually add anything into the frame until the load event is fired\n frame.addEventListener(\"load\", function () {\n const frameDocument = frame.contentDocument;\n\n //We inject default css into the content iframe,\n //end users can remove it or add their own via the exposed frame property.\n const cssLink = frameDocument.createElement(\"link\");\n cssLink.href = buildModuleUrl(\"Widgets/InfoBox/InfoBoxDescription.css\");\n cssLink.rel = \"stylesheet\";\n cssLink.type = \"text/css\";\n\n //div to use for description content.\n const frameContent = frameDocument.createElement(\"div\");\n frameContent.className = \"cesium-infoBox-description\";\n\n frameDocument.head.appendChild(cssLink);\n frameDocument.body.appendChild(frameContent);\n\n //We manually subscribe to the description event rather than through a binding for two reasons.\n //1. It's an easy way to ensure order of operation so that we can adjust the height.\n //2. Knockout does not bind to elements inside of an iFrame, so we would have to apply a second binding\n // model anyway.\n that._descriptionSubscription = subscribeAndEvaluate(\n viewModel,\n \"description\",\n function (value) {\n // Set the frame to small height, force vertical scroll bar to appear, and text to wrap accordingly.\n frame.style.height = \"5px\";\n frameContent.innerHTML = value;\n\n //If the snippet is a single element, then use its background\n //color for the body of the InfoBox. This makes the padding match\n //the content and produces much nicer results.\n let background = null;\n const firstElementChild = frameContent.firstElementChild;\n if (\n firstElementChild !== null &&\n frameContent.childNodes.length === 1\n ) {\n const style = window.getComputedStyle(firstElementChild);\n if (style !== null) {\n const backgroundColor = style[\"background-color\"];\n const color = Color.fromCssColorString(backgroundColor);\n if (defined(color) && color.alpha !== 0) {\n background = style[\"background-color\"];\n }\n }\n }\n infoElement.style[\"background-color\"] = background;\n\n // Measure and set the new custom height, based on text wrapped above.\n const height = frameContent.getBoundingClientRect().height;\n frame.style.height = `${height}px`;\n }\n );\n });\n\n //Chrome does not send the load event unless we explicitly set a src\n frame.setAttribute(\"src\", \"about:blank\");\n}\n\nObject.defineProperties(InfoBox.prototype, {\n /**\n * Gets the parent container.\n * @memberof InfoBox.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof InfoBox.prototype\n *\n * @type {InfoBoxViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n\n /**\n * Gets the iframe used to display the description.\n * @memberof InfoBox.prototype\n *\n * @type {HTMLIFrameElement}\n */\n frame: {\n get: function () {\n return this._frame;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nInfoBox.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nInfoBox.prototype.destroy = function () {\n const container = this._container;\n knockout.cleanNode(this._element);\n container.removeChild(this._element);\n\n if (defined(this._descriptionSubscription)) {\n this._descriptionSubscription.dispose();\n }\n\n return destroyObject(this);\n};\nexport default InfoBox;\n", "import knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link NavigationHelpButton}.\n * @alias NavigationHelpButtonViewModel\n * @constructor\n */\nfunction NavigationHelpButtonViewModel() {\n /**\n * Gets or sets whether the instructions are currently shown. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.showInstructions = false;\n\n const that = this;\n this._command = createCommand(function () {\n that.showInstructions = !that.showInstructions;\n });\n this._showClick = createCommand(function () {\n that._touch = false;\n });\n this._showTouch = createCommand(function () {\n that._touch = true;\n });\n\n this._touch = false;\n\n /**\n * Gets or sets the tooltip. This property is observable.\n *\n * @type {String}\n */\n this.tooltip = \"Navigation Instructions\";\n\n knockout.track(this, [\"tooltip\", \"showInstructions\", \"_touch\"]);\n}\n\nObject.defineProperties(NavigationHelpButtonViewModel.prototype, {\n /**\n * Gets the Command that is executed when the button is clicked.\n * @memberof NavigationHelpButtonViewModel.prototype\n *\n * @type {Command}\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n\n /**\n * Gets the Command that is executed when the mouse instructions should be shown.\n * @memberof NavigationHelpButtonViewModel.prototype\n *\n * @type {Command}\n */\n showClick: {\n get: function () {\n return this._showClick;\n },\n },\n\n /**\n * Gets the Command that is executed when the touch instructions should be shown.\n * @memberof NavigationHelpButtonViewModel.prototype\n *\n * @type {Command}\n */\n showTouch: {\n get: function () {\n return this._showTouch;\n },\n },\n});\nexport default NavigationHelpButtonViewModel;\n", "import buildModuleUrl from \"../../Core/buildModuleUrl.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport NavigationHelpButtonViewModel from \"./NavigationHelpButtonViewModel.js\";\n\n/**\n * <p>The NavigationHelpButton is a single button widget for displaying instructions for\n * navigating the globe with the mouse.</p><p style=\"clear: both;\"></p><br/>\n *\n * @alias NavigationHelpButton\n * @constructor\n *\n * @param {Object} options Object with the following properties:\n * @param {Element|String} options.container The DOM element or ID that will contain the widget.\n * @param {Boolean} [options.instructionsInitiallyVisible=false] True if the navigation instructions should initially be visible; otherwise, false.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,\n * // and in the body, include: <div id=\"navigationHelpButtonContainer\"></div>\n *\n * const navigationHelpButton = new Cesium.NavigationHelpButton({\n * container : 'navigationHelpButtonContainer'\n * });\n */\nfunction NavigationHelpButton(options) {\n const container = getElement(options.container);\n\n const viewModel = new NavigationHelpButtonViewModel();\n\n const showInsructionsDefault = defaultValue(\n options.instructionsInitiallyVisible,\n false\n );\n viewModel.showInstructions = showInsructionsDefault;\n\n viewModel._svgPath =\n \"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\";\n\n const wrapper = document.createElement(\"span\");\n wrapper.className = \"cesium-navigationHelpButton-wrapper\";\n container.appendChild(wrapper);\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className =\n \"cesium-button cesium-toolbar-button cesium-navigation-help-button\";\n button.setAttribute(\n \"data-bind\",\n \"\\\nattr: { title: tooltip },\\\nclick: command,\\\ncesiumSvgPath: { path: _svgPath, width: 32, height: 32 }\"\n );\n wrapper.appendChild(button);\n\n const instructionContainer = document.createElement(\"div\");\n instructionContainer.className = \"cesium-navigation-help\";\n instructionContainer.setAttribute(\n \"data-bind\",\n 'css: { \"cesium-navigation-help-visible\" : showInstructions}'\n );\n wrapper.appendChild(instructionContainer);\n\n const mouseButton = document.createElement(\"button\");\n mouseButton.type = \"button\";\n mouseButton.className =\n \"cesium-navigation-button cesium-navigation-button-left\";\n mouseButton.setAttribute(\n \"data-bind\",\n 'click: showClick, css: {\"cesium-navigation-button-selected\": !_touch, \"cesium-navigation-button-unselected\": _touch}'\n );\n const mouseIcon = document.createElement(\"img\");\n mouseIcon.src = buildModuleUrl(\"Widgets/Images/NavigationHelp/Mouse.svg\");\n mouseIcon.className = \"cesium-navigation-button-icon\";\n mouseIcon.style.width = \"25px\";\n mouseIcon.style.height = \"25px\";\n mouseButton.appendChild(mouseIcon);\n mouseButton.appendChild(document.createTextNode(\"Mouse\"));\n\n const touchButton = document.createElement(\"button\");\n touchButton.type = \"button\";\n touchButton.className =\n \"cesium-navigation-button cesium-navigation-button-right\";\n touchButton.setAttribute(\n \"data-bind\",\n 'click: showTouch, css: {\"cesium-navigation-button-selected\": _touch, \"cesium-navigation-button-unselected\": !_touch}'\n );\n const touchIcon = document.createElement(\"img\");\n touchIcon.src = buildModuleUrl(\"Widgets/Images/NavigationHelp/Touch.svg\");\n touchIcon.className = \"cesium-navigation-button-icon\";\n touchIcon.style.width = \"25px\";\n touchIcon.style.height = \"25px\";\n touchButton.appendChild(touchIcon);\n touchButton.appendChild(document.createTextNode(\"Touch\"));\n\n instructionContainer.appendChild(mouseButton);\n instructionContainer.appendChild(touchButton);\n\n const clickInstructions = document.createElement(\"div\");\n clickInstructions.className =\n \"cesium-click-navigation-help cesium-navigation-help-instructions\";\n clickInstructions.setAttribute(\n \"data-bind\",\n 'css: { \"cesium-click-navigation-help-visible\" : !_touch}'\n );\n clickInstructions.innerHTML = `\\\n <table>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/MouseLeft.svg\"\n )}\" width=\"48\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-pan\">Pan view</div>\\\n <div class=\"cesium-navigation-help-details\">Left click + drag</div>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/MouseRight.svg\"\n )}\" width=\"48\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-zoom\">Zoom view</div>\\\n <div class=\"cesium-navigation-help-details\">Right click + drag, or</div>\\\n <div class=\"cesium-navigation-help-details\">Mouse wheel scroll</div>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/MouseMiddle.svg\"\n )}\" width=\"48\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-rotate\">Rotate view</div>\\\n <div class=\"cesium-navigation-help-details\">Middle click + drag, or</div>\\\n <div class=\"cesium-navigation-help-details\">CTRL + Left/Right click + drag</div>\\\n </td>\\\n </tr>\\\n </table>`;\n\n instructionContainer.appendChild(clickInstructions);\n\n const touchInstructions = document.createElement(\"div\");\n touchInstructions.className =\n \"cesium-touch-navigation-help cesium-navigation-help-instructions\";\n touchInstructions.setAttribute(\n \"data-bind\",\n 'css: { \"cesium-touch-navigation-help-visible\" : _touch}'\n );\n touchInstructions.innerHTML = `\\\n <table>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/TouchDrag.svg\"\n )}\" width=\"70\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-pan\">Pan view</div>\\\n <div class=\"cesium-navigation-help-details\">One finger drag</div>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/TouchZoom.svg\"\n )}\" width=\"70\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-zoom\">Zoom view</div>\\\n <div class=\"cesium-navigation-help-details\">Two finger pinch</div>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/TouchTilt.svg\"\n )}\" width=\"70\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-rotate\">Tilt view</div>\\\n <div class=\"cesium-navigation-help-details\">Two finger drag, same direction</div>\\\n </td>\\\n </tr>\\\n <tr>\\\n <td><img src=\"${buildModuleUrl(\n \"Widgets/Images/NavigationHelp/TouchRotate.svg\"\n )}\" width=\"70\" height=\"48\" /></td>\\\n <td>\\\n <div class=\"cesium-navigation-help-tilt\">Rotate view</div>\\\n <div class=\"cesium-navigation-help-details\">Two finger drag, opposite direction</div>\\\n </td>\\\n </tr>\\\n </table>`;\n\n instructionContainer.appendChild(touchInstructions);\n\n knockout.applyBindings(viewModel, wrapper);\n\n this._container = container;\n this._viewModel = viewModel;\n this._wrapper = wrapper;\n\n this._closeInstructions = function (e) {\n if (!wrapper.contains(e.target)) {\n viewModel.showInstructions = false;\n }\n };\n\n if (FeatureDetection.supportsPointerEvents()) {\n document.addEventListener(\"pointerdown\", this._closeInstructions, true);\n } else {\n document.addEventListener(\"mousedown\", this._closeInstructions, true);\n document.addEventListener(\"touchstart\", this._closeInstructions, true);\n }\n}\n\nObject.defineProperties(NavigationHelpButton.prototype, {\n /**\n * Gets the parent container.\n * @memberof NavigationHelpButton.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof NavigationHelpButton.prototype\n *\n * @type {NavigationHelpButtonViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nNavigationHelpButton.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nNavigationHelpButton.prototype.destroy = function () {\n if (FeatureDetection.supportsPointerEvents()) {\n document.removeEventListener(\"pointerdown\", this._closeInstructions, true);\n } else {\n document.removeEventListener(\"mousedown\", this._closeInstructions, true);\n document.removeEventListener(\"touchstart\", this._closeInstructions, true);\n }\n\n knockout.cleanNode(this._wrapper);\n this._container.removeChild(this._wrapper);\n\n return destroyObject(this);\n};\nexport default NavigationHelpButton;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FrameRateMonitor from \"../../Scene/FrameRateMonitor.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link PerformanceWatchdog}.\n *\n * @alias PerformanceWatchdogViewModel\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Scene} options.scene The Scene instance for which to monitor performance.\n * @param {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The\n * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure\n * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n */\nfunction PerformanceWatchdogViewModel(options) {\n this._scene = options.scene;\n\n /**\n * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.\n * @type {String}\n */\n this.lowFrameRateMessage = defaultValue(\n options.lowFrameRateMessage,\n \"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.\"\n );\n\n /**\n * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has\n * been dismissed, the message will not be redisplayed, no matter the frame rate.\n * @type {Boolean}\n */\n this.lowFrameRateMessageDismissed = false;\n\n /**\n * Gets or sets a value indicating whether the low frame rate message is currently being displayed.\n * @type {Boolean}\n */\n this.showingLowFrameRateMessage = false;\n\n knockout.track(this, [\n \"lowFrameRateMessage\",\n \"lowFrameRateMessageDismissed\",\n \"showingLowFrameRateMessage\",\n ]);\n\n const that = this;\n this._dismissMessage = createCommand(function () {\n that.showingLowFrameRateMessage = false;\n that.lowFrameRateMessageDismissed = true;\n });\n\n const monitor = FrameRateMonitor.fromScene(options.scene);\n\n this._unsubscribeLowFrameRate = monitor.lowFrameRate.addEventListener(\n function () {\n if (!that.lowFrameRateMessageDismissed) {\n that.showingLowFrameRateMessage = true;\n }\n }\n );\n\n this._unsubscribeNominalFrameRate = monitor.nominalFrameRate.addEventListener(\n function () {\n that.showingLowFrameRateMessage = false;\n }\n );\n}\n\nObject.defineProperties(PerformanceWatchdogViewModel.prototype, {\n /**\n * Gets the {@link Scene} instance for which to monitor performance.\n * @memberof PerformanceWatchdogViewModel.prototype\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message\n * will not be redisplayed.\n * @memberof PerformanceWatchdogViewModel.prototype\n * @type {Command}\n */\n dismissMessage: {\n get: function () {\n return this._dismissMessage;\n },\n },\n});\n\nPerformanceWatchdogViewModel.prototype.destroy = function () {\n this._unsubscribeLowFrameRate();\n this._unsubscribeNominalFrameRate();\n\n return destroyObject(this);\n};\nexport default PerformanceWatchdogViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport PerformanceWatchdogViewModel from \"./PerformanceWatchdogViewModel.js\";\n\n/**\n * Monitors performance of the application and displays a message if poor performance is detected.\n *\n * @alias PerformanceWatchdog\n * @constructor\n *\n * @param {Object} [options] Object with the following properties:\n * @param {Element|String} options.container The DOM element or ID that will contain the widget.\n * @param {Scene} options.scene The {@link Scene} for which to monitor performance.\n * @param {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The\n * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure\n * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n */\nfunction PerformanceWatchdog(options) {\n const container = getElement(options.container);\n\n const viewModel = new PerformanceWatchdogViewModel(options);\n\n const element = document.createElement(\"div\");\n element.className = \"cesium-performance-watchdog-message-area\";\n element.setAttribute(\"data-bind\", \"visible: showingLowFrameRateMessage\");\n\n const dismissButton = document.createElement(\"button\");\n dismissButton.setAttribute(\"type\", \"button\");\n dismissButton.className = \"cesium-performance-watchdog-message-dismiss\";\n dismissButton.innerHTML = \"×\";\n dismissButton.setAttribute(\"data-bind\", \"click: dismissMessage\");\n element.appendChild(dismissButton);\n\n const message = document.createElement(\"div\");\n message.className = \"cesium-performance-watchdog-message\";\n message.setAttribute(\"data-bind\", \"html: lowFrameRateMessage\");\n element.appendChild(message);\n\n container.appendChild(element);\n\n knockout.applyBindings(viewModel, element);\n\n this._container = container;\n this._viewModel = viewModel;\n this._element = element;\n}\n\nObject.defineProperties(PerformanceWatchdog.prototype, {\n /**\n * Gets the parent container.\n * @memberof PerformanceWatchdog.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof PerformanceWatchdog.prototype\n *\n * @type {PerformanceWatchdogViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @memberof PerformanceWatchdog\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nPerformanceWatchdog.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n * @memberof PerformanceWatchdog\n */\nPerformanceWatchdog.prototype.destroy = function () {\n this._viewModel.destroy();\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n\n return destroyObject(this);\n};\nexport default PerformanceWatchdog;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport EventHelper from \"../../Core/EventHelper.js\";\nimport OrthographicFrustum from \"../../Core/OrthographicFrustum.js\";\nimport SceneMode from \"../../Scene/SceneMode.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link ProjectionPicker}.\n * @alias ProjectionPickerViewModel\n * @constructor\n *\n * @param {Scene} scene The Scene to switch projections.\n */\nfunction ProjectionPickerViewModel(scene) {\n this._scene = scene;\n this._orthographic = scene.camera.frustum instanceof OrthographicFrustum;\n this._flightInProgress = false;\n\n /**\n * Gets or sets whether the button drop-down is currently visible. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.dropDownVisible = false;\n\n /**\n * Gets or sets the perspective projection tooltip. This property is observable.\n * @type {String}\n * @default 'Perspective Projection'\n */\n this.tooltipPerspective = \"Perspective Projection\";\n\n /**\n * Gets or sets the orthographic projection tooltip. This property is observable.\n * @type {String}\n * @default 'Orthographic Projection'\n */\n this.tooltipOrthographic = \"Orthographic Projection\";\n\n /**\n * Gets the currently active tooltip. This property is observable.\n * @type {String}\n */\n this.selectedTooltip = undefined;\n\n /**\n * Gets or sets the current SceneMode. This property is observable.\n * @type {SceneMode}\n */\n this.sceneMode = scene.mode;\n\n knockout.track(this, [\n \"_orthographic\",\n \"_flightInProgress\",\n \"sceneMode\",\n \"dropDownVisible\",\n \"tooltipPerspective\",\n \"tooltipOrthographic\",\n ]);\n\n const that = this;\n knockout.defineProperty(this, \"selectedTooltip\", function () {\n if (that._orthographic) {\n return that.tooltipOrthographic;\n }\n return that.tooltipPerspective;\n });\n\n this._toggleDropDown = createCommand(function () {\n if (that.sceneMode === SceneMode.SCENE2D || that._flightInProgress) {\n return;\n }\n\n that.dropDownVisible = !that.dropDownVisible;\n });\n\n this._eventHelper = new EventHelper();\n this._eventHelper.add(scene.morphComplete, function (\n transitioner,\n oldMode,\n newMode,\n isMorphing\n ) {\n that.sceneMode = newMode;\n that._orthographic =\n newMode === SceneMode.SCENE2D ||\n that._scene.camera.frustum instanceof OrthographicFrustum;\n });\n this._eventHelper.add(scene.preRender, function () {\n that._flightInProgress = defined(scene.camera._currentFlight);\n });\n\n this._switchToPerspective = createCommand(function () {\n if (that.sceneMode === SceneMode.SCENE2D) {\n return;\n }\n\n that._scene.camera.switchToPerspectiveFrustum();\n that._orthographic = false;\n that.dropDownVisible = false;\n });\n\n this._switchToOrthographic = createCommand(function () {\n if (that.sceneMode === SceneMode.SCENE2D) {\n return;\n }\n\n that._scene.camera.switchToOrthographicFrustum();\n that._orthographic = true;\n that.dropDownVisible = false;\n });\n\n //Used by knockout\n this._sceneMode = SceneMode;\n}\n\nObject.defineProperties(ProjectionPickerViewModel.prototype, {\n /**\n * Gets the scene\n * @memberof ProjectionPickerViewModel.prototype\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets the command to toggle the drop down box.\n * @memberof ProjectionPickerViewModel.prototype\n *\n * @type {Command}\n */\n toggleDropDown: {\n get: function () {\n return this._toggleDropDown;\n },\n },\n\n /**\n * Gets the command to switch to a perspective projection.\n * @memberof ProjectionPickerViewModel.prototype\n *\n * @type {Command}\n */\n switchToPerspective: {\n get: function () {\n return this._switchToPerspective;\n },\n },\n\n /**\n * Gets the command to switch to orthographic projection.\n * @memberof ProjectionPickerViewModel.prototype\n *\n * @type {Command}\n */\n switchToOrthographic: {\n get: function () {\n return this._switchToOrthographic;\n },\n },\n\n /**\n * Gets whether the scene is currently using an orthographic projection.\n * @memberof ProjectionPickerViewModel.prototype\n *\n * @type {Command}\n */\n isOrthographicProjection: {\n get: function () {\n return this._orthographic;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nProjectionPickerViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the view model.\n */\nProjectionPickerViewModel.prototype.destroy = function () {\n this._eventHelper.removeAll();\n destroyObject(this);\n};\nexport default ProjectionPickerViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport ProjectionPickerViewModel from \"./ProjectionPickerViewModel.js\";\n\nconst perspectivePath =\n \"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\";\nconst orthographicPath =\n \"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\";\n\n/**\n * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.\n *\n * @alias ProjectionPicker\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the ProjectionPicker.css stylesheet,\n * // and in the body, include: <div id=\"projectionPickerContainer\"></div>\n * // Note: This code assumes you already have a Scene instance.\n *\n * const projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);\n */\nfunction ProjectionPicker(container, scene) {\n container = getElement(container);\n\n const viewModel = new ProjectionPickerViewModel(scene);\n\n viewModel._perspectivePath = perspectivePath;\n viewModel._orthographicPath = orthographicPath;\n\n const wrapper = document.createElement(\"span\");\n wrapper.className = \"cesium-projectionPicker-wrapper cesium-toolbar-button\";\n container.appendChild(wrapper);\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = \"cesium-button cesium-toolbar-button\";\n button.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-projectionPicker-buttonPerspective\": !_orthographic,\\\n \"cesium-projectionPicker-buttonOrthographic\": _orthographic,\\\n \"cesium-button-disabled\" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, \\\n \"cesium-projectionPicker-selected\": dropDownVisible },\\\nattr: { title: selectedTooltip },\\\nclick: toggleDropDown'\n );\n button.innerHTML =\n '\\\n<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: \"cesium-projectionPicker-iconPerspective\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: \"cesium-projectionPicker-iconOrthographic\" } --><!-- /ko -->';\n wrapper.appendChild(button);\n\n const perspectiveButton = document.createElement(\"button\");\n perspectiveButton.type = \"button\";\n perspectiveButton.className =\n \"cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon\";\n perspectiveButton.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-projectionPicker-visible\" : (dropDownVisible && _orthographic),\\\n \"cesium-projectionPicker-none\" : !_orthographic,\\\n \"cesium-projectionPicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltipPerspective },\\\nclick: switchToPerspective,\\\ncesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'\n );\n wrapper.appendChild(perspectiveButton);\n\n const orthographicButton = document.createElement(\"button\");\n orthographicButton.type = \"button\";\n orthographicButton.className =\n \"cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon\";\n orthographicButton.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-projectionPicker-visible\" : (dropDownVisible && !_orthographic),\\\n \"cesium-projectionPicker-none\" : _orthographic,\\\n \"cesium-projectionPicker-hidden\" : !dropDownVisible},\\\nattr: { title: tooltipOrthographic },\\\nclick: switchToOrthographic,\\\ncesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'\n );\n wrapper.appendChild(orthographicButton);\n\n knockout.applyBindings(viewModel, wrapper);\n\n this._viewModel = viewModel;\n this._container = container;\n this._wrapper = wrapper;\n\n this._closeDropDown = function (e) {\n if (!wrapper.contains(e.target)) {\n viewModel.dropDownVisible = false;\n }\n };\n if (FeatureDetection.supportsPointerEvents()) {\n document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.addEventListener(\"mousedown\", this._closeDropDown, true);\n document.addEventListener(\"touchstart\", this._closeDropDown, true);\n }\n}\n\nObject.defineProperties(ProjectionPicker.prototype, {\n /**\n * Gets the parent container.\n * @memberof ProjectionPicker.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof ProjectionPicker.prototype\n *\n * @type {ProjectionPickerViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nProjectionPicker.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nProjectionPicker.prototype.destroy = function () {\n this._viewModel.destroy();\n\n if (FeatureDetection.supportsPointerEvents()) {\n document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n }\n\n knockout.cleanNode(this._wrapper);\n this._container.removeChild(this._wrapper);\n\n return destroyObject(this);\n};\nexport default ProjectionPicker;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport EventHelper from \"../../Core/EventHelper.js\";\nimport SceneMode from \"../../Scene/SceneMode.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport createCommand from \"../createCommand.js\";\n\n/**\n * The view model for {@link SceneModePicker}.\n * @alias SceneModePickerViewModel\n * @constructor\n *\n * @param {Scene} scene The Scene to morph\n * @param {Number} [duration=2.0] The duration of scene morph animations, in seconds\n */\nfunction SceneModePickerViewModel(scene, duration) {\n this._scene = scene;\n\n const that = this;\n\n const morphStart = function (transitioner, oldMode, newMode, isMorphing) {\n that.sceneMode = newMode;\n that.dropDownVisible = false;\n };\n\n this._eventHelper = new EventHelper();\n this._eventHelper.add(scene.morphStart, morphStart);\n\n this._duration = defaultValue(duration, 2.0);\n\n /**\n * Gets or sets the current SceneMode. This property is observable.\n * @type {SceneMode}\n */\n this.sceneMode = scene.mode;\n\n /**\n * Gets or sets whether the button drop-down is currently visible. This property is observable.\n * @type {Boolean}\n * @default false\n */\n this.dropDownVisible = false;\n\n /**\n * Gets or sets the 2D tooltip. This property is observable.\n * @type {String}\n * @default '2D'\n */\n this.tooltip2D = \"2D\";\n\n /**\n * Gets or sets the 3D tooltip. This property is observable.\n * @type {String}\n * @default '3D'\n */\n this.tooltip3D = \"3D\";\n\n /**\n * Gets or sets the Columbus View tooltip. This property is observable.\n * @type {String}\n * @default 'Columbus View'\n */\n this.tooltipColumbusView = \"Columbus View\";\n\n knockout.track(this, [\n \"sceneMode\",\n \"dropDownVisible\",\n \"tooltip2D\",\n \"tooltip3D\",\n \"tooltipColumbusView\",\n ]);\n\n /**\n * Gets the currently active tooltip. This property is observable.\n * @type {String}\n */\n this.selectedTooltip = undefined;\n knockout.defineProperty(this, \"selectedTooltip\", function () {\n const mode = that.sceneMode;\n if (mode === SceneMode.SCENE2D) {\n return that.tooltip2D;\n }\n if (mode === SceneMode.SCENE3D) {\n return that.tooltip3D;\n }\n return that.tooltipColumbusView;\n });\n\n this._toggleDropDown = createCommand(function () {\n that.dropDownVisible = !that.dropDownVisible;\n });\n\n this._morphTo2D = createCommand(function () {\n scene.morphTo2D(that._duration);\n });\n\n this._morphTo3D = createCommand(function () {\n scene.morphTo3D(that._duration);\n });\n\n this._morphToColumbusView = createCommand(function () {\n scene.morphToColumbusView(that._duration);\n });\n\n //Used by knockout\n this._sceneMode = SceneMode;\n}\n\nObject.defineProperties(SceneModePickerViewModel.prototype, {\n /**\n * Gets the scene\n * @memberof SceneModePickerViewModel.prototype\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n\n /**\n * Gets or sets the the duration of scene mode transition animations in seconds.\n * A value of zero causes the scene to instantly change modes.\n * @memberof SceneModePickerViewModel.prototype\n * @type {Number}\n */\n duration: {\n get: function () {\n return this._duration;\n },\n set: function (value) {\n this._duration = value;\n },\n },\n\n /**\n * Gets the command to toggle the drop down box.\n * @memberof SceneModePickerViewModel.prototype\n *\n * @type {Command}\n */\n toggleDropDown: {\n get: function () {\n return this._toggleDropDown;\n },\n },\n\n /**\n * Gets the command to morph to 2D.\n * @memberof SceneModePickerViewModel.prototype\n *\n * @type {Command}\n */\n morphTo2D: {\n get: function () {\n return this._morphTo2D;\n },\n },\n\n /**\n * Gets the command to morph to 3D.\n * @memberof SceneModePickerViewModel.prototype\n *\n * @type {Command}\n */\n morphTo3D: {\n get: function () {\n return this._morphTo3D;\n },\n },\n\n /**\n * Gets the command to morph to Columbus View.\n * @memberof SceneModePickerViewModel.prototype\n *\n * @type {Command}\n */\n morphToColumbusView: {\n get: function () {\n return this._morphToColumbusView;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nSceneModePickerViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the view model.\n */\nSceneModePickerViewModel.prototype.destroy = function () {\n this._eventHelper.removeAll();\n\n destroyObject(this);\n};\nexport default SceneModePickerViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport FeatureDetection from \"../../Core/FeatureDetection.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport SceneModePickerViewModel from \"./SceneModePickerViewModel.js\";\n\nconst globePath =\n \"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 \\\n -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 \\\n -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 \\\n 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 \\\n 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 \\\n 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 \\\n -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\";\nconst flatMapPath =\n \"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\";\nconst columbusViewPath =\n \"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\";\n\n/**\n * <img src=\"Images/sceneModePicker.png\" style=\"float: left; margin-right: 10px;\" width=\"44\" height=\"116\" />\n * <p>The SceneModePicker is a single button widget for switching between scene modes;\n * shown to the left in its expanded state. Programatic switching of scene modes will\n * be automatically reflected in the widget as long as the specified Scene\n * is used to perform the change.</p><p style=\"clear: both;\"></p><br/>\n *\n * @alias SceneModePicker\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n * @param {Number} [duration=2.0] The time, in seconds, it takes for the scene to transition.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n *\n * @example\n * // In HTML head, include a link to the SceneModePicker.css stylesheet,\n * // and in the body, include: <div id=\"sceneModePickerContainer\"></div>\n * // Note: This code assumes you already have a Scene instance.\n *\n * const sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);\n */\nfunction SceneModePicker(container, scene, duration) {\n container = getElement(container);\n\n const viewModel = new SceneModePickerViewModel(scene, duration);\n\n viewModel._globePath = globePath;\n viewModel._flatMapPath = flatMapPath;\n viewModel._columbusViewPath = columbusViewPath;\n\n const wrapper = document.createElement(\"span\");\n wrapper.className = \"cesium-sceneModePicker-wrapper cesium-toolbar-button\";\n container.appendChild(wrapper);\n\n const button = document.createElement(\"button\");\n button.type = \"button\";\n button.className = \"cesium-button cesium-toolbar-button\";\n button.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-sceneModePicker-button2D\": sceneMode === _sceneMode.SCENE2D,\\\n \"cesium-sceneModePicker-button3D\": sceneMode === _sceneMode.SCENE3D,\\\n \"cesium-sceneModePicker-buttonColumbusView\": sceneMode === _sceneMode.COLUMBUS_VIEW,\\\n \"cesium-sceneModePicker-selected\": dropDownVisible },\\\nattr: { title: selectedTooltip },\\\nclick: toggleDropDown'\n );\n button.innerHTML =\n '\\\n<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D\" } --><!-- /ko -->\\\n<!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: \"cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView\" } --><!-- /ko -->';\n wrapper.appendChild(button);\n\n const morphTo3DButton = document.createElement(\"button\");\n morphTo3DButton.type = \"button\";\n morphTo3DButton.className =\n \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n morphTo3DButton.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),\\\n \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.SCENE3D,\\\n \"cesium-sceneModePicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltip3D },\\\nclick: morphTo3D,\\\ncesiumSvgPath: { path: _globePath, width: 64, height: 64 }'\n );\n wrapper.appendChild(morphTo3DButton);\n\n const morphTo2DButton = document.createElement(\"button\");\n morphTo2DButton.type = \"button\";\n morphTo2DButton.className =\n \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n morphTo2DButton.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),\\\n \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.SCENE2D,\\\n \"cesium-sceneModePicker-hidden\" : !dropDownVisible },\\\nattr: { title: tooltip2D },\\\nclick: morphTo2D,\\\ncesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'\n );\n wrapper.appendChild(morphTo2DButton);\n\n const morphToCVButton = document.createElement(\"button\");\n morphToCVButton.type = \"button\";\n morphToCVButton.className =\n \"cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon\";\n morphToCVButton.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-sceneModePicker-visible\" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),\\\n \"cesium-sceneModePicker-none\" : sceneMode === _sceneMode.COLUMBUS_VIEW,\\\n \"cesium-sceneModePicker-hidden\" : !dropDownVisible},\\\nattr: { title: tooltipColumbusView },\\\nclick: morphToColumbusView,\\\ncesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'\n );\n wrapper.appendChild(morphToCVButton);\n\n knockout.applyBindings(viewModel, wrapper);\n\n this._viewModel = viewModel;\n this._container = container;\n this._wrapper = wrapper;\n\n this._closeDropDown = function (e) {\n if (!wrapper.contains(e.target)) {\n viewModel.dropDownVisible = false;\n }\n };\n if (FeatureDetection.supportsPointerEvents()) {\n document.addEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.addEventListener(\"mousedown\", this._closeDropDown, true);\n document.addEventListener(\"touchstart\", this._closeDropDown, true);\n }\n}\n\nObject.defineProperties(SceneModePicker.prototype, {\n /**\n * Gets the parent container.\n * @memberof SceneModePicker.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof SceneModePicker.prototype\n *\n * @type {SceneModePickerViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nSceneModePicker.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nSceneModePicker.prototype.destroy = function () {\n this._viewModel.destroy();\n\n if (FeatureDetection.supportsPointerEvents()) {\n document.removeEventListener(\"pointerdown\", this._closeDropDown, true);\n } else {\n document.removeEventListener(\"mousedown\", this._closeDropDown, true);\n document.removeEventListener(\"touchstart\", this._closeDropDown, true);\n }\n\n knockout.cleanNode(this._wrapper);\n this._container.removeChild(this._wrapper);\n\n return destroyObject(this);\n};\nexport default SceneModePicker;\n", "import Cartesian2 from \"../../Core/Cartesian2.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport EasingFunction from \"../../Core/EasingFunction.js\";\nimport SceneTransforms from \"../../Scene/SceneTransforms.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\n\nconst screenSpacePos = new Cartesian2();\nconst offScreen = \"-1000px\";\n\n/**\n * The view model for {@link SelectionIndicator}.\n * @alias SelectionIndicatorViewModel\n * @constructor\n *\n * @param {Scene} scene The scene instance to use for screen-space coordinate conversion.\n * @param {Element} selectionIndicatorElement The element containing all elements that make up the selection indicator.\n * @param {Element} container The DOM element that contains the widget.\n */\nfunction SelectionIndicatorViewModel(\n scene,\n selectionIndicatorElement,\n container\n) {\nthis._scene = scene;\n this._screenPositionX = offScreen;\n this._screenPositionY = offScreen;\n this._tweens = scene.tweens;\n this._container = defaultValue(container, document.body);\n this._selectionIndicatorElement = selectionIndicatorElement;\n this._scale = 1;\n\n /**\n * Gets or sets the world position of the object for which to display the selection indicator.\n * @type {Cartesian3}\n */\n this.position = undefined;\n\n /**\n * Gets or sets the visibility of the selection indicator.\n * @type {Boolean}\n */\n this.showSelection = false;\n\n knockout.track(this, [\n \"position\",\n \"_screenPositionX\",\n \"_screenPositionY\",\n \"_scale\",\n \"showSelection\",\n ]);\n\n /**\n * Gets the visibility of the position indicator. This can be false even if an\n * object is selected, when the selected object has no position.\n * @type {Boolean}\n */\n this.isVisible = undefined;\n knockout.defineProperty(this, \"isVisible\", {\n get: function () {\n return this.showSelection && defined(this.position);\n },\n });\n\n knockout.defineProperty(this, \"_transform\", {\n get: function () {\n return `scale(${this._scale})`;\n },\n });\n\n /**\n * Gets or sets the function for converting the world position of the object to the screen space position.\n *\n * @member\n * @type {SelectionIndicatorViewModel.ComputeScreenSpacePosition}\n * @default SceneTransforms.wgs84ToWindowCoordinates\n *\n * @example\n * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {\n * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n * };\n */\n this.computeScreenSpacePosition = function (position, result) {\n return SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);\n };\n}\n\n/**\n * Updates the view of the selection indicator to match the position and content properties of the view model.\n * This function should be called as part of the render loop.\n */\nSelectionIndicatorViewModel.prototype.update = function () {\n if (this.showSelection && defined(this.position)) {\n const screenPosition = this.computeScreenSpacePosition(\n this.position,\n screenSpacePos\n );\n if (!defined(screenPosition)) {\n this._screenPositionX = offScreen;\n this._screenPositionY = offScreen;\n } else {\n const container = this._container;\n const containerWidth = container.parentNode.clientWidth;\n const containerHeight = container.parentNode.clientHeight;\n const indicatorSize = this._selectionIndicatorElement.clientWidth;\n const halfSize = indicatorSize * 0.5;\n\n screenPosition.x =\n Math.min(\n Math.max(screenPosition.x, -indicatorSize),\n containerWidth + indicatorSize\n ) - halfSize;\n screenPosition.y =\n Math.min(\n Math.max(screenPosition.y, -indicatorSize),\n containerHeight + indicatorSize\n ) - halfSize;\n\n this._screenPositionX = `${Math.floor(screenPosition.x + 0.25)}px`;\n this._screenPositionY = `${Math.floor(screenPosition.y + 0.25)}px`;\n }\n }\n};\n\n/**\n * Animate the indicator to draw attention to the selection.\n */\nSelectionIndicatorViewModel.prototype.animateAppear = function () {\n this._tweens.addProperty({\n object: this,\n property: \"_scale\",\n startValue: 2,\n stopValue: 1,\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n });\n};\n\n/**\n * Animate the indicator to release the selection.\n */\nSelectionIndicatorViewModel.prototype.animateDepart = function () {\n this._tweens.addProperty({\n object: this,\n property: \"_scale\",\n startValue: this._scale,\n stopValue: 1.5,\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n });\n};\n\nObject.defineProperties(SelectionIndicatorViewModel.prototype, {\n /**\n * Gets the HTML element containing the selection indicator.\n * @memberof SelectionIndicatorViewModel.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the HTML element that holds the selection indicator.\n * @memberof SelectionIndicatorViewModel.prototype\n *\n * @type {Element}\n */\n selectionIndicatorElement: {\n get: function () {\n return this._selectionIndicatorElement;\n },\n },\n\n /**\n * Gets the scene being used.\n * @memberof SelectionIndicatorViewModel.prototype\n *\n * @type {Scene}\n */\n scene: {\n get: function () {\n return this._scene;\n },\n },\n});\n\n/**\n * A function that converts the world position of an object to a screen space position.\n * @callback SelectionIndicatorViewModel.ComputeScreenSpacePosition\n * @param {Cartesian3} position The position in WGS84 (world) coordinates.\n * @param {Cartesian2} result An object to return the input position transformed to window coordinates.\n * @returns {Cartesian2} The modified result parameter.\n */\nexport default SelectionIndicatorViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport SelectionIndicatorViewModel from \"./SelectionIndicatorViewModel.js\";\n\n/**\n * A widget for displaying an indicator on a selected object.\n *\n * @alias SelectionIndicator\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The Scene instance to use.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction SelectionIndicator(container, scene) {\ncontainer = getElement(container);\n\n this._container = container;\n\n const el = document.createElement(\"div\");\n el.className = \"cesium-selection-wrapper\";\n el.setAttribute(\n \"data-bind\",\n '\\\nstyle: { \"top\" : _screenPositionY, \"left\" : _screenPositionX },\\\ncss: { \"cesium-selection-wrapper-visible\" : isVisible }'\n );\n container.appendChild(el);\n this._element = el;\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const path =\n \"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\";\n\n const svg = document.createElementNS(svgNS, \"svg:svg\");\n svg.setAttribute(\"width\", 160);\n svg.setAttribute(\"height\", 160);\n svg.setAttribute(\"viewBox\", \"0 0 160 160\");\n\n const group = document.createElementNS(svgNS, \"g\");\n group.setAttribute(\"transform\", \"translate(80,80)\");\n svg.appendChild(group);\n\n const pathElement = document.createElementNS(svgNS, \"path\");\n pathElement.setAttribute(\"data-bind\", \"attr: { transform: _transform }\");\n pathElement.setAttribute(\"d\", path);\n group.appendChild(pathElement);\n\n el.appendChild(svg);\n\n const viewModel = new SelectionIndicatorViewModel(\n scene,\n this._element,\n this._container\n );\n this._viewModel = viewModel;\n\n knockout.applyBindings(this._viewModel, this._element);\n}\n\nObject.defineProperties(SelectionIndicator.prototype, {\n /**\n * Gets the parent container.\n * @memberof SelectionIndicator.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof SelectionIndicator.prototype\n *\n * @type {SelectionIndicatorViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nSelectionIndicator.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nSelectionIndicator.prototype.destroy = function () {\n const container = this._container;\n knockout.cleanNode(this._element);\n container.removeChild(this._element);\n return destroyObject(this);\n};\nexport default SelectionIndicator;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\n\n/**\n * @private\n */\nfunction TimelineHighlightRange(color, heightInPx, base) {\n this._color = color;\n this._height = heightInPx;\n this._base = defaultValue(base, 0);\n}\n\nTimelineHighlightRange.prototype.getHeight = function () {\n return this._height;\n};\n\nTimelineHighlightRange.prototype.getBase = function () {\n return this._base;\n};\n\nTimelineHighlightRange.prototype.getStartTime = function () {\n return this._start;\n};\n\nTimelineHighlightRange.prototype.getStopTime = function () {\n return this._stop;\n};\n\nTimelineHighlightRange.prototype.setRange = function (start, stop) {\n this._start = start;\n this._stop = stop;\n};\n\nTimelineHighlightRange.prototype.render = function (renderState) {\n let range = \"\";\n if (this._start && this._stop && this._color) {\n const highlightStart = JulianDate.secondsDifference(\n this._start,\n renderState.epochJulian\n );\n let highlightLeft = Math.round(\n renderState.timeBarWidth * renderState.getAlpha(highlightStart)\n );\n const highlightStop = JulianDate.secondsDifference(\n this._stop,\n renderState.epochJulian\n );\n let highlightWidth =\n Math.round(\n renderState.timeBarWidth * renderState.getAlpha(highlightStop)\n ) - highlightLeft;\n if (highlightLeft < 0) {\n highlightWidth += highlightLeft;\n highlightLeft = 0;\n }\n if (highlightLeft + highlightWidth > renderState.timeBarWidth) {\n highlightWidth = renderState.timeBarWidth - highlightLeft;\n }\n if (highlightWidth > 0) {\n range = `<span class=\"cesium-timeline-highlight\" style=\"left: ${highlightLeft.toString()}px; width: ${highlightWidth.toString()}px; bottom: ${this._base.toString()}px; height: ${\n this._height\n }px; background-color: ${this._color};\"></span>`;\n }\n }\n return range;\n};\nexport default TimelineHighlightRange;\n", "import Color from \"../../Core/Color.js\";\nimport defined from \"../../Core/defined.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\n\n/**\n * @private\n */\nfunction TimelineTrack(interval, pixelHeight, color, backgroundColor) {\n this.interval = interval;\n this.height = pixelHeight;\n this.color = color || new Color(0.5, 0.5, 0.5, 1.0);\n this.backgroundColor = backgroundColor || new Color(0.0, 0.0, 0.0, 0.0);\n}\n\nTimelineTrack.prototype.render = function (context, renderState) {\n const startInterval = this.interval.start;\n const stopInterval = this.interval.stop;\n\n const spanStart = renderState.startJulian;\n const spanStop = JulianDate.addSeconds(\n renderState.startJulian,\n renderState.duration,\n new JulianDate()\n );\n\n if (\n JulianDate.lessThan(startInterval, spanStart) &&\n JulianDate.greaterThan(stopInterval, spanStop)\n ) {\n //The track takes up the entire visible span.\n context.fillStyle = this.color.toCssColorString();\n context.fillRect(0, renderState.y, renderState.timeBarWidth, this.height);\n } else if (\n JulianDate.lessThanOrEquals(startInterval, spanStop) &&\n JulianDate.greaterThanOrEquals(stopInterval, spanStart)\n ) {\n //The track only takes up some of the visible span, compute that span.\n let x;\n let start, stop;\n for (x = 0; x < renderState.timeBarWidth; ++x) {\n const currentTime = JulianDate.addSeconds(\n renderState.startJulian,\n (x / renderState.timeBarWidth) * renderState.duration,\n new JulianDate()\n );\n if (\n !defined(start) &&\n JulianDate.greaterThanOrEquals(currentTime, startInterval)\n ) {\n start = x;\n } else if (\n !defined(stop) &&\n JulianDate.greaterThanOrEquals(currentTime, stopInterval)\n ) {\n stop = x;\n }\n }\n\n context.fillStyle = this.backgroundColor.toCssColorString();\n context.fillRect(0, renderState.y, renderState.timeBarWidth, this.height);\n\n if (defined(start)) {\n if (!defined(stop)) {\n stop = renderState.timeBarWidth;\n }\n context.fillStyle = this.color.toCssColorString();\n context.fillRect(\n start,\n renderState.y,\n Math.max(stop - start, 1),\n this.height\n );\n }\n }\n};\nexport default TimelineTrack;\n", "import ClockRange from \"../../Core/ClockRange.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport getElement from \"../getElement.js\";\nimport TimelineHighlightRange from \"./TimelineHighlightRange.js\";\nimport TimelineTrack from \"./TimelineTrack.js\";\n\nlet timelineWheelDelta = 1e12;\n\nconst timelineMouseMode = {\n none: 0,\n scrub: 1,\n slide: 2,\n zoom: 3,\n touchOnly: 4,\n};\nconst timelineTouchMode = {\n none: 0,\n scrub: 1,\n slideZoom: 2,\n singleTap: 3,\n ignore: 4,\n};\n\nconst timelineTicScales = [\n 0.001,\n 0.002,\n 0.005,\n 0.01,\n 0.02,\n 0.05,\n 0.1,\n 0.25,\n 0.5,\n 1.0,\n 2.0,\n 5.0,\n 10.0,\n 15.0,\n 30.0,\n 60.0, // 1min\n 120.0, // 2min\n 300.0, // 5min\n 600.0, // 10min\n 900.0, // 15min\n 1800.0, // 30min\n 3600.0, // 1hr\n 7200.0, // 2hr\n 14400.0, // 4hr\n 21600.0, // 6hr\n 43200.0, // 12hr\n 86400.0, // 24hr\n 172800.0, // 2days\n 345600.0, // 4days\n 604800.0, // 7days\n 1296000.0, // 15days\n 2592000.0, // 30days\n 5184000.0, // 60days\n 7776000.0, // 90days\n 15552000.0, // 180days\n 31536000.0, // 365days\n 63072000.0, // 2years\n 126144000.0, // 4years\n 157680000.0, // 5years\n 315360000.0, // 10years\n 630720000.0, // 20years\n 1261440000.0, // 40years\n 1576800000.0, // 50years\n 3153600000.0, // 100years\n 6307200000.0, // 200years\n 12614400000.0, // 400years\n 15768000000.0, // 500years\n 31536000000.0, // 1000years\n];\n\nconst timelineMonthNames = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\n/**\n * The Timeline is a widget for displaying and controlling the current scene time.\n * @alias Timeline\n * @constructor\n *\n * @param {Element} container The parent HTML container node for this widget.\n * @param {Clock} clock The clock to use.\n */\nfunction Timeline(container, clock) {\n container = getElement(container);\n\n const ownerDocument = container.ownerDocument;\n\n /**\n * Gets the parent container.\n * @type {Element}\n */\n this.container = container;\n\n const topDiv = ownerDocument.createElement(\"div\");\n topDiv.className = \"cesium-timeline-main\";\n container.appendChild(topDiv);\n this._topDiv = topDiv;\n\n this._endJulian = undefined;\n this._epochJulian = undefined;\n this._lastXPos = undefined;\n this._scrubElement = undefined;\n this._startJulian = undefined;\n this._timeBarSecondsSpan = undefined;\n this._clock = clock;\n this._scrubJulian = clock.currentTime;\n this._mainTicSpan = -1;\n this._mouseMode = timelineMouseMode.none;\n this._touchMode = timelineTouchMode.none;\n this._touchState = {\n centerX: 0,\n spanX: 0,\n };\n this._mouseX = 0;\n this._timelineDrag = 0;\n this._timelineDragLocation = undefined;\n this._lastHeight = undefined;\n this._lastWidth = undefined;\n\n this._topDiv.innerHTML =\n '<div class=\"cesium-timeline-bar\"></div><div class=\"cesium-timeline-trackContainer\">' +\n '<canvas class=\"cesium-timeline-tracks\" width=\"10\" height=\"1\">' +\n '</canvas></div><div class=\"cesium-timeline-needle\"></div><span class=\"cesium-timeline-ruler\"></span>';\n this._timeBarEle = this._topDiv.childNodes[0];\n this._trackContainer = this._topDiv.childNodes[1];\n this._trackListEle = this._topDiv.childNodes[1].childNodes[0];\n this._needleEle = this._topDiv.childNodes[2];\n this._rulerEle = this._topDiv.childNodes[3];\n this._context = this._trackListEle.getContext(\"2d\");\n\n this._trackList = [];\n this._highlightRanges = [];\n\n this.zoomTo(clock.startTime, clock.stopTime);\n\n this._onMouseDown = createMouseDownCallback(this);\n this._onMouseUp = createMouseUpCallback(this);\n this._onMouseMove = createMouseMoveCallback(this);\n this._onMouseWheel = createMouseWheelCallback(this);\n this._onTouchStart = createTouchStartCallback(this);\n this._onTouchMove = createTouchMoveCallback(this);\n this._onTouchEnd = createTouchEndCallback(this);\n\n const timeBarEle = this._timeBarEle;\n ownerDocument.addEventListener(\"mouseup\", this._onMouseUp, false);\n ownerDocument.addEventListener(\"mousemove\", this._onMouseMove, false);\n timeBarEle.addEventListener(\"mousedown\", this._onMouseDown, false);\n timeBarEle.addEventListener(\"DOMMouseScroll\", this._onMouseWheel, false); // Mozilla mouse wheel\n timeBarEle.addEventListener(\"mousewheel\", this._onMouseWheel, false);\n timeBarEle.addEventListener(\"touchstart\", this._onTouchStart, false);\n timeBarEle.addEventListener(\"touchmove\", this._onTouchMove, false);\n timeBarEle.addEventListener(\"touchend\", this._onTouchEnd, false);\n timeBarEle.addEventListener(\"touchcancel\", this._onTouchEnd, false);\n\n this._topDiv.oncontextmenu = function () {\n return false;\n };\n\n clock.onTick.addEventListener(this.updateFromClock, this);\n this.updateFromClock();\n}\n\n/**\n * @private\n */\nTimeline.prototype.addEventListener = function (type, listener, useCapture) {\n this._topDiv.addEventListener(type, listener, useCapture);\n};\n\n/**\n * @private\n */\nTimeline.prototype.removeEventListener = function (type, listener, useCapture) {\n this._topDiv.removeEventListener(type, listener, useCapture);\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nTimeline.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nTimeline.prototype.destroy = function () {\n this._clock.onTick.removeEventListener(this.updateFromClock, this);\n\n const doc = this.container.ownerDocument;\n doc.removeEventListener(\"mouseup\", this._onMouseUp, false);\n doc.removeEventListener(\"mousemove\", this._onMouseMove, false);\n\n const timeBarEle = this._timeBarEle;\n timeBarEle.removeEventListener(\"mousedown\", this._onMouseDown, false);\n timeBarEle.removeEventListener(\"DOMMouseScroll\", this._onMouseWheel, false); // Mozilla mouse wheel\n timeBarEle.removeEventListener(\"mousewheel\", this._onMouseWheel, false);\n timeBarEle.removeEventListener(\"touchstart\", this._onTouchStart, false);\n timeBarEle.removeEventListener(\"touchmove\", this._onTouchMove, false);\n timeBarEle.removeEventListener(\"touchend\", this._onTouchEnd, false);\n timeBarEle.removeEventListener(\"touchcancel\", this._onTouchEnd, false);\n this.container.removeChild(this._topDiv);\n destroyObject(this);\n};\n\n/**\n * @private\n */\nTimeline.prototype.addHighlightRange = function (color, heightInPx, base) {\n const newHighlightRange = new TimelineHighlightRange(color, heightInPx, base);\n this._highlightRanges.push(newHighlightRange);\n this.resize();\n return newHighlightRange;\n};\n\n/**\n * @private\n */\nTimeline.prototype.addTrack = function (\n interval,\n heightInPx,\n color,\n backgroundColor\n) {\n const newTrack = new TimelineTrack(\n interval,\n heightInPx,\n color,\n backgroundColor\n );\n this._trackList.push(newTrack);\n this._lastHeight = undefined;\n this.resize();\n return newTrack;\n};\n\n/**\n * Sets the view to the provided times.\n *\n * @param {JulianDate} startTime The start time.\n * @param {JulianDate} stopTime The stop time.\n */\nTimeline.prototype.zoomTo = function (startTime, stopTime) {\n this._startJulian = startTime;\n this._endJulian = stopTime;\n this._timeBarSecondsSpan = JulianDate.secondsDifference(stopTime, startTime);\n\n // If clock is not unbounded, clamp timeline range to clock.\n if (this._clock && this._clock.clockRange !== ClockRange.UNBOUNDED) {\n const clockStart = this._clock.startTime;\n const clockEnd = this._clock.stopTime;\n const clockSpan = JulianDate.secondsDifference(clockEnd, clockStart);\n const startOffset = JulianDate.secondsDifference(\n clockStart,\n this._startJulian\n );\n const endOffset = JulianDate.secondsDifference(clockEnd, this._endJulian);\n\n if (this._timeBarSecondsSpan >= clockSpan) {\n // if new duration longer than clock range duration, clamp to full range.\n this._timeBarSecondsSpan = clockSpan;\n this._startJulian = this._clock.startTime;\n this._endJulian = this._clock.stopTime;\n } else if (startOffset > 0) {\n // if timeline start is before clock start, shift right\n this._endJulian = JulianDate.addSeconds(\n this._endJulian,\n startOffset,\n new JulianDate()\n );\n this._startJulian = clockStart;\n this._timeBarSecondsSpan = JulianDate.secondsDifference(\n this._endJulian,\n this._startJulian\n );\n } else if (endOffset < 0) {\n // if timeline end is after clock end, shift left\n this._startJulian = JulianDate.addSeconds(\n this._startJulian,\n endOffset,\n new JulianDate()\n );\n this._endJulian = clockEnd;\n this._timeBarSecondsSpan = JulianDate.secondsDifference(\n this._endJulian,\n this._startJulian\n );\n }\n }\n\n this._makeTics();\n\n const evt = document.createEvent(\"Event\");\n evt.initEvent(\"setzoom\", true, true);\n evt.startJulian = this._startJulian;\n evt.endJulian = this._endJulian;\n evt.epochJulian = this._epochJulian;\n evt.totalSpan = this._timeBarSecondsSpan;\n evt.mainTicSpan = this._mainTicSpan;\n this._topDiv.dispatchEvent(evt);\n};\n\n/**\n * @private\n */\nTimeline.prototype.zoomFrom = function (amount) {\n let centerSec = JulianDate.secondsDifference(\n this._scrubJulian,\n this._startJulian\n );\n if (amount > 1 || centerSec < 0 || centerSec > this._timeBarSecondsSpan) {\n centerSec = this._timeBarSecondsSpan * 0.5;\n } else {\n centerSec += centerSec - this._timeBarSecondsSpan * 0.5;\n }\n const centerSecFlip = this._timeBarSecondsSpan - centerSec;\n this.zoomTo(\n JulianDate.addSeconds(\n this._startJulian,\n centerSec - centerSec * amount,\n new JulianDate()\n ),\n JulianDate.addSeconds(\n this._endJulian,\n centerSecFlip * amount - centerSecFlip,\n new JulianDate()\n )\n );\n};\n\nfunction twoDigits(num) {\n return num < 10 ? `0${num.toString()}` : num.toString();\n}\n\n/**\n * @private\n */\nTimeline.prototype.makeLabel = function (time) {\n const gregorian = JulianDate.toGregorianDate(time);\n const millisecond = gregorian.millisecond;\n let millisecondString = \" UTC\";\n if (millisecond > 0 && this._timeBarSecondsSpan < 3600) {\n millisecondString = Math.floor(millisecond).toString();\n while (millisecondString.length < 3) {\n millisecondString = `0${millisecondString}`;\n }\n millisecondString = `.${millisecondString}`;\n }\n\n return `${timelineMonthNames[gregorian.month - 1]} ${gregorian.day} ${\n gregorian.year\n } ${twoDigits(gregorian.hour)}:${twoDigits(gregorian.minute)}:${twoDigits(\n gregorian.second\n )}${millisecondString}`;\n};\n\n/**\n * @private\n */\nTimeline.prototype.smallestTicInPixels = 7.0;\n\n/**\n * @private\n */\nTimeline.prototype._makeTics = function () {\n const timeBar = this._timeBarEle;\n\n const seconds = JulianDate.secondsDifference(\n this._scrubJulian,\n this._startJulian\n );\n const xPos = Math.round(\n (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan\n );\n const scrubX = xPos - 8;\n let tic;\n const widget = this;\n\n this._needleEle.style.left = `${xPos.toString()}px`;\n\n let tics = \"\";\n\n const minimumDuration = 0.01;\n const maximumDuration = 31536000000.0; // ~1000 years\n const epsilon = 1e-10;\n\n // If time step size is known, enter it here...\n let minSize = 0;\n\n let duration = this._timeBarSecondsSpan;\n if (duration < minimumDuration) {\n duration = minimumDuration;\n this._timeBarSecondsSpan = minimumDuration;\n this._endJulian = JulianDate.addSeconds(\n this._startJulian,\n minimumDuration,\n new JulianDate()\n );\n } else if (duration > maximumDuration) {\n duration = maximumDuration;\n this._timeBarSecondsSpan = maximumDuration;\n this._endJulian = JulianDate.addSeconds(\n this._startJulian,\n maximumDuration,\n new JulianDate()\n );\n }\n\n let timeBarWidth = this._timeBarEle.clientWidth;\n if (timeBarWidth < 10) {\n timeBarWidth = 10;\n }\n const startJulian = this._startJulian;\n\n // epsilonTime: a small fraction of one pixel width of the timeline, measured in seconds.\n const epsilonTime = Math.min((duration / timeBarWidth) * 1e-5, 0.4);\n\n // epochJulian: a nearby time to be considered \"zero seconds\", should be a round-ish number by human standards.\n let epochJulian;\n const gregorianDate = JulianDate.toGregorianDate(startJulian);\n if (duration > 315360000) {\n // 3650+ days visible, epoch is start of the first visible century.\n epochJulian = JulianDate.fromDate(\n new Date(Date.UTC(Math.floor(gregorianDate.year / 100) * 100, 0))\n );\n } else if (duration > 31536000) {\n // 365+ days visible, epoch is start of the first visible decade.\n epochJulian = JulianDate.fromDate(\n new Date(Date.UTC(Math.floor(gregorianDate.year / 10) * 10, 0))\n );\n } else if (duration > 86400) {\n // 1+ day(s) visible, epoch is start of the year.\n epochJulian = JulianDate.fromDate(\n new Date(Date.UTC(gregorianDate.year, 0))\n );\n } else {\n // Less than a day on timeline, epoch is midnight of the visible day.\n epochJulian = JulianDate.fromDate(\n new Date(\n Date.UTC(gregorianDate.year, gregorianDate.month, gregorianDate.day)\n )\n );\n }\n\n // startTime: Seconds offset of the left side of the timeline from epochJulian.\n const startTime = JulianDate.secondsDifference(\n this._startJulian,\n JulianDate.addSeconds(epochJulian, epsilonTime, new JulianDate())\n );\n // endTime: Seconds offset of the right side of the timeline from epochJulian.\n let endTime = startTime + duration;\n this._epochJulian = epochJulian;\n\n function getStartTic(ticScale) {\n return Math.floor(startTime / ticScale) * ticScale;\n }\n\n function getNextTic(tic, ticScale) {\n return Math.ceil(tic / ticScale + 0.5) * ticScale;\n }\n\n function getAlpha(time) {\n return (time - startTime) / duration;\n }\n\n function remainder(x, y) {\n //return x % y;\n return x - y * Math.round(x / y);\n }\n\n // Width in pixels of a typical label, plus padding\n this._rulerEle.innerHTML = this.makeLabel(\n JulianDate.addSeconds(this._endJulian, -minimumDuration, new JulianDate())\n );\n let sampleWidth = this._rulerEle.offsetWidth + 20;\n if (sampleWidth < 30) {\n // Workaround an apparent IE bug with measuring the width after going full-screen from inside an iframe.\n sampleWidth = 180;\n }\n\n const origMinSize = minSize;\n minSize -= epsilon;\n\n const renderState = {\n startTime: startTime,\n startJulian: startJulian,\n epochJulian: epochJulian,\n duration: duration,\n timeBarWidth: timeBarWidth,\n getAlpha: getAlpha,\n };\n this._highlightRanges.forEach(function (highlightRange) {\n tics += highlightRange.render(renderState);\n });\n\n // Calculate tic mark label spacing in the TimeBar.\n let mainTic = 0.0,\n subTic = 0.0,\n tinyTic = 0.0;\n // Ideal labeled tic as percentage of zoom interval\n let idealTic = sampleWidth / timeBarWidth;\n if (idealTic > 1.0) {\n // Clamp to width of window, for thin windows.\n idealTic = 1.0;\n }\n // Ideal labeled tic size in seconds\n idealTic *= this._timeBarSecondsSpan;\n let ticIndex = -1,\n smallestIndex = -1;\n\n const ticScaleLen = timelineTicScales.length;\n let i;\n for (i = 0; i < ticScaleLen; ++i) {\n const sc = timelineTicScales[i];\n ++ticIndex;\n mainTic = sc;\n // Find acceptable main tic size not smaller than ideal size.\n if (sc > idealTic && sc > minSize) {\n break;\n }\n if (\n smallestIndex < 0 &&\n timeBarWidth * (sc / this._timeBarSecondsSpan) >= this.smallestTicInPixels\n ) {\n smallestIndex = ticIndex;\n }\n }\n if (ticIndex > 0) {\n while (ticIndex > 0) {\n // Compute sub-tic size that evenly divides main tic.\n --ticIndex;\n if (Math.abs(remainder(mainTic, timelineTicScales[ticIndex])) < 0.00001) {\n if (timelineTicScales[ticIndex] >= minSize) {\n subTic = timelineTicScales[ticIndex];\n }\n break;\n }\n }\n\n if (smallestIndex >= 0) {\n while (smallestIndex < ticIndex) {\n // Compute tiny tic size that evenly divides sub-tic.\n if (\n Math.abs(remainder(subTic, timelineTicScales[smallestIndex])) <\n 0.00001 &&\n timelineTicScales[smallestIndex] >= minSize\n ) {\n tinyTic = timelineTicScales[smallestIndex];\n break;\n }\n ++smallestIndex;\n }\n }\n }\n\n minSize = origMinSize;\n if (\n minSize > epsilon &&\n tinyTic < 0.00001 &&\n Math.abs(minSize - mainTic) > epsilon\n ) {\n tinyTic = minSize;\n if (minSize <= mainTic + epsilon) {\n subTic = 0.0;\n }\n }\n\n let lastTextLeft = -999999,\n textWidth;\n if (timeBarWidth * (tinyTic / this._timeBarSecondsSpan) >= 3.0) {\n for (\n tic = getStartTic(tinyTic);\n tic <= endTime;\n tic = getNextTic(tic, tinyTic)\n ) {\n tics += `<span class=\"cesium-timeline-ticTiny\" style=\"left: ${Math.round(\n timeBarWidth * getAlpha(tic)\n ).toString()}px;\"></span>`;\n }\n }\n if (timeBarWidth * (subTic / this._timeBarSecondsSpan) >= 3.0) {\n for (\n tic = getStartTic(subTic);\n tic <= endTime;\n tic = getNextTic(tic, subTic)\n ) {\n tics += `<span class=\"cesium-timeline-ticSub\" style=\"left: ${Math.round(\n timeBarWidth * getAlpha(tic)\n ).toString()}px;\"></span>`;\n }\n }\n if (timeBarWidth * (mainTic / this._timeBarSecondsSpan) >= 2.0) {\n this._mainTicSpan = mainTic;\n endTime += mainTic;\n tic = getStartTic(mainTic);\n const leapSecond = JulianDate.computeTaiMinusUtc(epochJulian);\n while (tic <= endTime) {\n let ticTime = JulianDate.addSeconds(\n startJulian,\n tic - startTime,\n new JulianDate()\n );\n if (mainTic > 2.1) {\n const ticLeap = JulianDate.computeTaiMinusUtc(ticTime);\n if (Math.abs(ticLeap - leapSecond) > 0.1) {\n tic += ticLeap - leapSecond;\n ticTime = JulianDate.addSeconds(\n startJulian,\n tic - startTime,\n new JulianDate()\n );\n }\n }\n const ticLeft = Math.round(timeBarWidth * getAlpha(tic));\n const ticLabel = this.makeLabel(ticTime);\n this._rulerEle.innerHTML = ticLabel;\n textWidth = this._rulerEle.offsetWidth;\n if (textWidth < 10) {\n // IE iframe fullscreen sampleWidth workaround, continued.\n textWidth = sampleWidth;\n }\n const labelLeft = ticLeft - (textWidth / 2 - 1);\n if (labelLeft > lastTextLeft) {\n lastTextLeft = labelLeft + textWidth + 5;\n tics +=\n `<span class=\"cesium-timeline-ticMain\" style=\"left: ${ticLeft.toString()}px;\"></span>` +\n `<span class=\"cesium-timeline-ticLabel\" style=\"left: ${labelLeft.toString()}px;\">${ticLabel}</span>`;\n } else {\n tics += `<span class=\"cesium-timeline-ticSub\" style=\"left: ${ticLeft.toString()}px;\"></span>`;\n }\n tic = getNextTic(tic, mainTic);\n }\n } else {\n this._mainTicSpan = -1;\n }\n\n tics += `<span class=\"cesium-timeline-icon16\" style=\"left:${scrubX}px;bottom:0;background-position: 0 0;\"></span>`;\n timeBar.innerHTML = tics;\n this._scrubElement = timeBar.lastChild;\n\n // Clear track canvas.\n this._context.clearRect(\n 0,\n 0,\n this._trackListEle.width,\n this._trackListEle.height\n );\n\n renderState.y = 0;\n this._trackList.forEach(function (track) {\n track.render(widget._context, renderState);\n renderState.y += track.height;\n });\n};\n\n/**\n * @private\n */\nTimeline.prototype.updateFromClock = function () {\n this._scrubJulian = this._clock.currentTime;\n const scrubElement = this._scrubElement;\n if (defined(this._scrubElement)) {\n const seconds = JulianDate.secondsDifference(\n this._scrubJulian,\n this._startJulian\n );\n const xPos = Math.round(\n (seconds * this._topDiv.clientWidth) / this._timeBarSecondsSpan\n );\n\n if (this._lastXPos !== xPos) {\n this._lastXPos = xPos;\n\n scrubElement.style.left = `${xPos - 8}px`;\n this._needleEle.style.left = `${xPos}px`;\n }\n }\n if (defined(this._timelineDragLocation)) {\n this._setTimeBarTime(\n this._timelineDragLocation,\n (this._timelineDragLocation * this._timeBarSecondsSpan) /\n this._topDiv.clientWidth\n );\n this.zoomTo(\n JulianDate.addSeconds(\n this._startJulian,\n this._timelineDrag,\n new JulianDate()\n ),\n JulianDate.addSeconds(\n this._endJulian,\n this._timelineDrag,\n new JulianDate()\n )\n );\n }\n};\n\n/**\n * @private\n */\nTimeline.prototype._setTimeBarTime = function (xPos, seconds) {\n xPos = Math.round(xPos);\n this._scrubJulian = JulianDate.addSeconds(\n this._startJulian,\n seconds,\n new JulianDate()\n );\n if (this._scrubElement) {\n const scrubX = xPos - 8;\n this._scrubElement.style.left = `${scrubX.toString()}px`;\n this._needleEle.style.left = `${xPos.toString()}px`;\n }\n\n const evt = document.createEvent(\"Event\");\n evt.initEvent(\"settime\", true, true);\n evt.clientX = xPos;\n evt.timeSeconds = seconds;\n evt.timeJulian = this._scrubJulian;\n evt.clock = this._clock;\n this._topDiv.dispatchEvent(evt);\n};\n\nfunction createMouseDownCallback(timeline) {\n return function (e) {\n if (timeline._mouseMode !== timelineMouseMode.touchOnly) {\n if (e.button === 0) {\n timeline._mouseMode = timelineMouseMode.scrub;\n if (timeline._scrubElement) {\n timeline._scrubElement.style.backgroundPosition = \"-16px 0\";\n }\n timeline._onMouseMove(e);\n } else {\n timeline._mouseX = e.clientX;\n if (e.button === 2) {\n timeline._mouseMode = timelineMouseMode.zoom;\n } else {\n timeline._mouseMode = timelineMouseMode.slide;\n }\n }\n }\n e.preventDefault();\n };\n}\n\nfunction createMouseUpCallback(timeline) {\n return function (e) {\n timeline._mouseMode = timelineMouseMode.none;\n if (timeline._scrubElement) {\n timeline._scrubElement.style.backgroundPosition = \"0 0\";\n }\n timeline._timelineDrag = 0;\n timeline._timelineDragLocation = undefined;\n };\n}\n\nfunction createMouseMoveCallback(timeline) {\n return function (e) {\n let dx;\n if (timeline._mouseMode === timelineMouseMode.scrub) {\n e.preventDefault();\n const x = e.clientX - timeline._topDiv.getBoundingClientRect().left;\n\n if (x < 0) {\n timeline._timelineDragLocation = 0;\n timeline._timelineDrag = -0.01 * timeline._timeBarSecondsSpan;\n } else if (x > timeline._topDiv.clientWidth) {\n timeline._timelineDragLocation = timeline._topDiv.clientWidth;\n timeline._timelineDrag = 0.01 * timeline._timeBarSecondsSpan;\n } else {\n timeline._timelineDragLocation = undefined;\n timeline._setTimeBarTime(\n x,\n (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth\n );\n }\n } else if (timeline._mouseMode === timelineMouseMode.slide) {\n dx = timeline._mouseX - e.clientX;\n timeline._mouseX = e.clientX;\n if (dx !== 0) {\n const dsec =\n (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth;\n timeline.zoomTo(\n JulianDate.addSeconds(timeline._startJulian, dsec, new JulianDate()),\n JulianDate.addSeconds(timeline._endJulian, dsec, new JulianDate())\n );\n }\n } else if (timeline._mouseMode === timelineMouseMode.zoom) {\n dx = timeline._mouseX - e.clientX;\n timeline._mouseX = e.clientX;\n if (dx !== 0) {\n timeline.zoomFrom(Math.pow(1.01, dx));\n }\n }\n };\n}\n\nfunction createMouseWheelCallback(timeline) {\n return function (e) {\n let dy = e.wheelDeltaY || e.wheelDelta || -e.detail;\n timelineWheelDelta = Math.max(\n Math.min(Math.abs(dy), timelineWheelDelta),\n 1\n );\n dy /= timelineWheelDelta;\n timeline.zoomFrom(Math.pow(1.05, -dy));\n };\n}\n\nfunction createTouchStartCallback(timeline) {\n return function (e) {\n const len = e.touches.length;\n let seconds, xPos;\n const leftX = timeline._topDiv.getBoundingClientRect().left;\n e.preventDefault();\n timeline._mouseMode = timelineMouseMode.touchOnly;\n if (len === 1) {\n seconds = JulianDate.secondsDifference(\n timeline._scrubJulian,\n timeline._startJulian\n );\n xPos = Math.round(\n (seconds * timeline._topDiv.clientWidth) /\n timeline._timeBarSecondsSpan +\n leftX\n );\n if (Math.abs(e.touches[0].clientX - xPos) < 50) {\n timeline._touchMode = timelineTouchMode.scrub;\n if (timeline._scrubElement) {\n timeline._scrubElement.style.backgroundPosition =\n len === 1 ? \"-16px 0\" : \"0 0\";\n }\n } else {\n timeline._touchMode = timelineTouchMode.singleTap;\n timeline._touchState.centerX = e.touches[0].clientX - leftX;\n }\n } else if (len === 2) {\n timeline._touchMode = timelineTouchMode.slideZoom;\n timeline._touchState.centerX =\n (e.touches[0].clientX + e.touches[1].clientX) * 0.5 - leftX;\n timeline._touchState.spanX = Math.abs(\n e.touches[0].clientX - e.touches[1].clientX\n );\n } else {\n timeline._touchMode = timelineTouchMode.ignore;\n }\n };\n}\n\nfunction createTouchEndCallback(timeline) {\n return function (e) {\n const len = e.touches.length,\n leftX = timeline._topDiv.getBoundingClientRect().left;\n if (timeline._touchMode === timelineTouchMode.singleTap) {\n timeline._touchMode = timelineTouchMode.scrub;\n timeline._onTouchMove(e);\n } else if (timeline._touchMode === timelineTouchMode.scrub) {\n timeline._onTouchMove(e);\n }\n timeline._mouseMode = timelineMouseMode.touchOnly;\n if (len !== 1) {\n timeline._touchMode =\n len > 0 ? timelineTouchMode.ignore : timelineTouchMode.none;\n } else if (timeline._touchMode === timelineTouchMode.slideZoom) {\n timeline._touchState.centerX = e.touches[0].clientX - leftX;\n }\n if (timeline._scrubElement) {\n timeline._scrubElement.style.backgroundPosition = \"0 0\";\n }\n };\n}\n\nfunction createTouchMoveCallback(timeline) {\n return function (e) {\n let dx,\n x,\n len,\n newCenter,\n newSpan,\n newStartTime,\n zoom = 1;\n const leftX = timeline._topDiv.getBoundingClientRect().left;\n if (timeline._touchMode === timelineTouchMode.singleTap) {\n timeline._touchMode = timelineTouchMode.slideZoom;\n }\n timeline._mouseMode = timelineMouseMode.touchOnly;\n if (timeline._touchMode === timelineTouchMode.scrub) {\n e.preventDefault();\n if (e.changedTouches.length === 1) {\n x = e.changedTouches[0].clientX - leftX;\n if (x >= 0 && x <= timeline._topDiv.clientWidth) {\n timeline._setTimeBarTime(\n x,\n (x * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth\n );\n }\n }\n } else if (timeline._touchMode === timelineTouchMode.slideZoom) {\n len = e.touches.length;\n if (len === 2) {\n newCenter = (e.touches[0].clientX + e.touches[1].clientX) * 0.5 - leftX;\n newSpan = Math.abs(e.touches[0].clientX - e.touches[1].clientX);\n } else if (len === 1) {\n newCenter = e.touches[0].clientX - leftX;\n newSpan = 0;\n }\n\n if (defined(newCenter)) {\n if (newSpan > 0 && timeline._touchState.spanX > 0) {\n // Zoom and slide\n zoom = timeline._touchState.spanX / newSpan;\n newStartTime = JulianDate.addSeconds(\n timeline._startJulian,\n (timeline._touchState.centerX * timeline._timeBarSecondsSpan -\n newCenter * timeline._timeBarSecondsSpan * zoom) /\n timeline._topDiv.clientWidth,\n new JulianDate()\n );\n } else {\n // Slide to newCenter\n dx = timeline._touchState.centerX - newCenter;\n newStartTime = JulianDate.addSeconds(\n timeline._startJulian,\n (dx * timeline._timeBarSecondsSpan) / timeline._topDiv.clientWidth,\n new JulianDate()\n );\n }\n\n timeline.zoomTo(\n newStartTime,\n JulianDate.addSeconds(\n newStartTime,\n timeline._timeBarSecondsSpan * zoom,\n new JulianDate()\n )\n );\n timeline._touchState.centerX = newCenter;\n timeline._touchState.spanX = newSpan;\n }\n }\n };\n}\n\n/**\n * Resizes the widget to match the container size.\n */\nTimeline.prototype.resize = function () {\n const width = this.container.clientWidth;\n const height = this.container.clientHeight;\n\n if (width === this._lastWidth && height === this._lastHeight) {\n return;\n }\n\n this._trackContainer.style.height = `${height}px`;\n\n let trackListHeight = 1;\n this._trackList.forEach(function (track) {\n trackListHeight += track.height;\n });\n this._trackListEle.style.height = `${trackListHeight.toString()}px`;\n this._trackListEle.width = this._trackListEle.clientWidth;\n this._trackListEle.height = trackListHeight;\n this._makeTics();\n\n this._lastXPos = undefined;\n this._lastWidth = width;\n this._lastHeight = height;\n};\nexport default Timeline;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport EventHelper from \"../../Core/EventHelper.js\";\nimport Fullscreen from \"../../Core/Fullscreen.js\";\nimport OrthographicFrustum from \"../../Core/OrthographicFrustum.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport NoSleep from \"nosleep.js\";\nimport createCommand from \"../createCommand.js\";\nimport getElement from \"../getElement.js\";\n\nfunction lockScreen(orientation) {\n let locked = false;\n const screen = window.screen;\n if (defined(screen)) {\n if (defined(screen.lockOrientation)) {\n locked = screen.lockOrientation(orientation);\n } else if (defined(screen.mozLockOrientation)) {\n locked = screen.mozLockOrientation(orientation);\n } else if (defined(screen.msLockOrientation)) {\n locked = screen.msLockOrientation(orientation);\n } else if (defined(screen.orientation && screen.orientation.lock)) {\n locked = screen.orientation.lock(orientation);\n }\n }\n return locked;\n}\n\nfunction unlockScreen() {\n const screen = window.screen;\n if (defined(screen)) {\n if (defined(screen.unlockOrientation)) {\n screen.unlockOrientation();\n } else if (defined(screen.mozUnlockOrientation)) {\n screen.mozUnlockOrientation();\n } else if (defined(screen.msUnlockOrientation)) {\n screen.msUnlockOrientation();\n } else if (defined(screen.orientation && screen.orientation.unlock)) {\n screen.orientation.unlock();\n }\n }\n}\n\nfunction toggleVR(viewModel, scene, isVRMode, isOrthographic) {\n if (isOrthographic()) {\n return;\n }\n\n if (isVRMode()) {\n scene.useWebVR = false;\n if (viewModel._locked) {\n unlockScreen();\n viewModel._locked = false;\n }\n viewModel._noSleep.disable();\n Fullscreen.exitFullscreen();\n isVRMode(false);\n } else {\n if (!Fullscreen.fullscreen) {\n Fullscreen.requestFullscreen(viewModel._vrElement);\n }\n viewModel._noSleep.enable();\n if (!viewModel._locked) {\n viewModel._locked = lockScreen(\"landscape\");\n }\n scene.useWebVR = true;\n isVRMode(true);\n }\n}\n\n/**\n * The view model for {@link VRButton}.\n * @alias VRButtonViewModel\n * @constructor\n *\n * @param {Scene} scene The scene.\n * @param {Element|String} [vrElement=document.body] The element or id to be placed into VR mode.\n */\nfunction VRButtonViewModel(scene, vrElement) {\n const that = this;\n\n const isEnabled = knockout.observable(Fullscreen.enabled);\n const isVRMode = knockout.observable(false);\n\n /**\n * Gets whether or not VR mode is active.\n *\n * @type {Boolean}\n */\n this.isVRMode = undefined;\n knockout.defineProperty(this, \"isVRMode\", {\n get: function () {\n return isVRMode();\n },\n });\n\n /**\n * Gets or sets whether or not VR functionality should be enabled.\n *\n * @type {Boolean}\n * @see Fullscreen.enabled\n */\n this.isVREnabled = undefined;\n knockout.defineProperty(this, \"isVREnabled\", {\n get: function () {\n return isEnabled();\n },\n set: function (value) {\n isEnabled(value && Fullscreen.enabled);\n },\n });\n\n /**\n * Gets the tooltip. This property is observable.\n *\n * @type {String}\n */\n this.tooltip = undefined;\n knockout.defineProperty(this, \"tooltip\", function () {\n if (!isEnabled()) {\n return \"VR mode is unavailable\";\n }\n return isVRMode() ? \"Exit VR mode\" : \"Enter VR mode\";\n });\n\n const isOrthographic = knockout.observable(false);\n\n this._isOrthographic = undefined;\n knockout.defineProperty(this, \"_isOrthographic\", {\n get: function () {\n return isOrthographic();\n },\n });\n\n this._eventHelper = new EventHelper();\n this._eventHelper.add(scene.preRender, function () {\n isOrthographic(scene.camera.frustum instanceof OrthographicFrustum);\n });\n\n this._locked = false;\n this._noSleep = new NoSleep();\n\n this._command = createCommand(function () {\n toggleVR(that, scene, isVRMode, isOrthographic);\n }, knockout.getObservable(this, \"isVREnabled\"));\n\n this._vrElement = defaultValue(getElement(vrElement), document.body);\n\n this._callback = function () {\n if (!Fullscreen.fullscreen && isVRMode()) {\n scene.useWebVR = false;\n if (that._locked) {\n unlockScreen();\n that._locked = false;\n }\n that._noSleep.disable();\n isVRMode(false);\n }\n };\n document.addEventListener(Fullscreen.changeEventName, this._callback);\n}\n\nObject.defineProperties(VRButtonViewModel.prototype, {\n /**\n * Gets or sets the HTML element to place into VR mode when the\n * corresponding button is pressed.\n * @memberof VRButtonViewModel.prototype\n *\n * @type {Element}\n */\n vrElement: {\n //TODO:@exception {DeveloperError} value must be a valid HTML Element.\n get: function () {\n return this._vrElement;\n },\n set: function (value) {\n this._vrElement = value;\n },\n },\n\n /**\n * Gets the Command to toggle VR mode.\n * @memberof VRButtonViewModel.prototype\n *\n * @type {Command}\n */\n command: {\n get: function () {\n return this._command;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nVRButtonViewModel.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the view model. Should be called to\n * properly clean up the view model when it is no longer needed.\n */\nVRButtonViewModel.prototype.destroy = function () {\n this._eventHelper.removeAll();\n document.removeEventListener(Fullscreen.changeEventName, this._callback);\n destroyObject(this);\n};\nexport default VRButtonViewModel;\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport getElement from \"../getElement.js\";\nimport VRButtonViewModel from \"./VRButtonViewModel.js\";\n\nconst enterVRPath =\n \"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\";\nconst exitVRPath =\n \"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\";\n\n/**\n * A single button widget for toggling vr mode.\n *\n * @alias VRButton\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Scene} scene The scene.\n * @param {Element|String} [vrElement=document.body] The element or id to be placed into vr mode.\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n */\nfunction VRButton(container, scene, vrElement) {\n container = getElement(container);\n\n const viewModel = new VRButtonViewModel(scene, vrElement);\n\n viewModel._exitVRPath = exitVRPath;\n viewModel._enterVRPath = enterVRPath;\n\n const element = document.createElement(\"button\");\n element.type = \"button\";\n element.className = \"cesium-button cesium-vrButton\";\n element.setAttribute(\n \"data-bind\",\n '\\\ncss: { \"cesium-button-disabled\" : _isOrthographic }, \\\nattr: { title: tooltip },\\\nclick: command,\\\nenable: isVREnabled,\\\ncesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'\n );\n\n container.appendChild(element);\n\n knockout.applyBindings(viewModel, element);\n\n this._container = container;\n this._viewModel = viewModel;\n this._element = element;\n}\n\nObject.defineProperties(VRButton.prototype, {\n /**\n * Gets the parent container.\n * @memberof VRButton.prototype\n *\n * @type {Element}\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the view model.\n * @memberof VRButton.prototype\n *\n * @type {VRButtonViewModel}\n */\n viewModel: {\n get: function () {\n return this._viewModel;\n },\n },\n});\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nVRButton.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nVRButton.prototype.destroy = function () {\n this._viewModel.destroy();\n\n knockout.cleanNode(this._element);\n this._container.removeChild(this._element);\n\n return destroyObject(this);\n};\nexport default VRButton;\n", "import BoundingSphere from \"../../Core/BoundingSphere.js\";\nimport Cartesian3 from \"../../Core/Cartesian3.js\";\nimport Cartographic from \"../../Core/Cartographic.js\";\nimport Clock from \"../../Core/Clock.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Event from \"../../Core/Event.js\";\nimport EventHelper from \"../../Core/EventHelper.js\";\nimport HeadingPitchRange from \"../../Core/HeadingPitchRange.js\";\nimport Matrix4 from \"../../Core/Matrix4.js\";\nimport ScreenSpaceEventType from \"../../Core/ScreenSpaceEventType.js\";\nimport BoundingSphereState from \"../../DataSources/BoundingSphereState.js\";\nimport ConstantPositionProperty from \"../../DataSources/ConstantPositionProperty.js\";\nimport DataSourceCollection from \"../../DataSources/DataSourceCollection.js\";\nimport DataSourceDisplay from \"../../DataSources/DataSourceDisplay.js\";\nimport Entity from \"../../DataSources/Entity.js\";\nimport EntityView from \"../../DataSources/EntityView.js\";\nimport Property from \"../../DataSources/Property.js\";\nimport Cesium3DTileset from \"../../Scene/Cesium3DTileset.js\";\nimport computeFlyToLocationForRectangle from \"../../Scene/computeFlyToLocationForRectangle.js\";\nimport ImageryLayer from \"../../Scene/ImageryLayer.js\";\nimport SceneMode from \"../../Scene/SceneMode.js\";\nimport TimeDynamicPointCloud from \"../../Scene/TimeDynamicPointCloud.js\";\nimport knockout from \"../../ThirdParty/knockout.js\";\nimport Animation from \"../Animation/Animation.js\";\nimport AnimationViewModel from \"../Animation/AnimationViewModel.js\";\nimport BaseLayerPicker from \"../BaseLayerPicker/BaseLayerPicker.js\";\nimport createDefaultImageryProviderViewModels from \"../BaseLayerPicker/createDefaultImageryProviderViewModels.js\";\nimport createDefaultTerrainProviderViewModels from \"../BaseLayerPicker/createDefaultTerrainProviderViewModels.js\";\nimport CesiumWidget from \"../CesiumWidget/CesiumWidget.js\";\nimport ClockViewModel from \"../ClockViewModel.js\";\nimport FullscreenButton from \"../FullscreenButton/FullscreenButton.js\";\nimport Geocoder from \"../Geocoder/Geocoder.js\";\nimport getElement from \"../getElement.js\";\nimport HomeButton from \"../HomeButton/HomeButton.js\";\nimport InfoBox from \"../InfoBox/InfoBox.js\";\nimport NavigationHelpButton from \"../NavigationHelpButton/NavigationHelpButton.js\";\nimport ProjectionPicker from \"../ProjectionPicker/ProjectionPicker.js\";\nimport SceneModePicker from \"../SceneModePicker/SceneModePicker.js\";\nimport SelectionIndicator from \"../SelectionIndicator/SelectionIndicator.js\";\nimport subscribeAndEvaluate from \"../subscribeAndEvaluate.js\";\nimport Timeline from \"../Timeline/Timeline.js\";\nimport VRButton from \"../VRButton/VRButton.js\";\nimport Cesium3DTileFeature from \"../../Scene/Cesium3DTileFeature.js\";\nimport JulianDate from \"../../Core/JulianDate.js\";\nimport CesiumMath from \"../../Core/Math.js\";\n\nconst boundingSphereScratch = new BoundingSphere();\n\nfunction onTimelineScrubfunction(e) {\n const clock = e.clock;\n clock.currentTime = e.timeJulian;\n clock.shouldAnimate = false;\n}\n\nfunction getCesium3DTileFeatureDescription(feature) {\n const propertyIds = feature.getPropertyIds();\n\n let html = \"\";\n propertyIds.forEach(function (propertyId) {\n const value = feature.getProperty(propertyId);\n if (defined(value)) {\n html += `<tr><th>${propertyId}</th><td>${value}</td></tr>`;\n }\n });\n\n if (html.length > 0) {\n html = `<table class=\"cesium-infoBox-defaultTable\"><tbody>${html}</tbody></table>`;\n }\n\n return html;\n}\n\nfunction getCesium3DTileFeatureName(feature) {\n // We need to iterate all property IDs to find potential\n // candidates, but since we prefer some property IDs\n // over others, we store them in an indexed array\n // and then use the first defined element in the array\n // as the preferred choice.\n\n let i;\n const possibleIds = [];\n const propertyIds = feature.getPropertyIds();\n for (i = 0; i < propertyIds.length; i++) {\n const propertyId = propertyIds[i];\n if (/^name$/i.test(propertyId)) {\n possibleIds[0] = feature.getProperty(propertyId);\n } else if (/name/i.test(propertyId)) {\n possibleIds[1] = feature.getProperty(propertyId);\n } else if (/^title$/i.test(propertyId)) {\n possibleIds[2] = feature.getProperty(propertyId);\n } else if (/^(id|identifier)$/i.test(propertyId)) {\n possibleIds[3] = feature.getProperty(propertyId);\n } else if (/element/i.test(propertyId)) {\n possibleIds[4] = feature.getProperty(propertyId);\n } else if (/(id|identifier)$/i.test(propertyId)) {\n possibleIds[5] = feature.getProperty(propertyId);\n }\n }\n\n const length = possibleIds.length;\n for (i = 0; i < length; i++) {\n const item = possibleIds[i];\n if (defined(item) && item !== \"\") {\n return item;\n }\n }\n return \"Unnamed Feature\";\n}\n\nfunction pickEntity(viewer, e) {\n const picked = viewer.scene.pick(e.position);\n if (defined(picked)) {\n const id = defaultValue(picked.id, picked.primitive.id);\n if (id instanceof Entity) {\n return id;\n }\n\n if (picked instanceof Cesium3DTileFeature) {\n return new Entity({\n name: getCesium3DTileFeatureName(picked),\n description: getCesium3DTileFeatureDescription(picked),\n feature: picked,\n });\n }\n }\n\n // No regular entity picked. Try picking features from imagery layers.\n if (defined(viewer.scene.globe)) {\n return pickImageryLayerFeature(viewer, e.position);\n }\n}\n\nconst scratchStopTime = new JulianDate();\n\nfunction trackDataSourceClock(timeline, clock, dataSource) {\n if (defined(dataSource)) {\n const dataSourceClock = dataSource.clock;\n if (defined(dataSourceClock)) {\n dataSourceClock.getValue(clock);\n if (defined(timeline)) {\n const startTime = dataSourceClock.startTime;\n let stopTime = dataSourceClock.stopTime;\n // When the start and stop times are equal, set the timeline to the shortest interval\n // starting at the start time. This prevents an invalid timeline configuration.\n if (JulianDate.equals(startTime, stopTime)) {\n stopTime = JulianDate.addSeconds(\n startTime,\n CesiumMath.EPSILON2,\n scratchStopTime\n );\n }\n timeline.updateFromClock();\n timeline.zoomTo(startTime, stopTime);\n }\n }\n }\n}\n\nconst cartesian3Scratch = new Cartesian3();\n\nfunction pickImageryLayerFeature(viewer, windowPosition) {\n const scene = viewer.scene;\n const pickRay = scene.camera.getPickRay(windowPosition);\n const imageryLayerFeaturePromise = scene.imageryLayers.pickImageryLayerFeatures(\n pickRay,\n scene\n );\n if (!defined(imageryLayerFeaturePromise)) {\n return;\n }\n\n // Imagery layer feature picking is asynchronous, so put up a message while loading.\n const loadingMessage = new Entity({\n id: \"Loading...\",\n description: \"Loading feature information...\",\n });\n\n imageryLayerFeaturePromise.then(\n function (features) {\n // Has this async pick been superseded by a later one?\n if (viewer.selectedEntity !== loadingMessage) {\n return;\n }\n\n if (!defined(features) || features.length === 0) {\n viewer.selectedEntity = createNoFeaturesEntity();\n return;\n }\n\n // Select the first feature.\n const feature = features[0];\n\n const entity = new Entity({\n id: feature.name,\n description: feature.description,\n });\n\n if (defined(feature.position)) {\n const ecfPosition = viewer.scene.globe.ellipsoid.cartographicToCartesian(\n feature.position,\n cartesian3Scratch\n );\n entity.position = new ConstantPositionProperty(ecfPosition);\n }\n\n viewer.selectedEntity = entity;\n },\n function () {\n // Has this async pick been superseded by a later one?\n if (viewer.selectedEntity !== loadingMessage) {\n return;\n }\n viewer.selectedEntity = createNoFeaturesEntity();\n }\n );\n\n return loadingMessage;\n}\n\nfunction createNoFeaturesEntity() {\n return new Entity({\n id: \"None\",\n description: \"No features found.\",\n });\n}\n\nfunction enableVRUI(viewer, enabled) {\n const geocoder = viewer._geocoder;\n const homeButton = viewer._homeButton;\n const sceneModePicker = viewer._sceneModePicker;\n const projectionPicker = viewer._projectionPicker;\n const baseLayerPicker = viewer._baseLayerPicker;\n const animation = viewer._animation;\n const timeline = viewer._timeline;\n const fullscreenButton = viewer._fullscreenButton;\n const infoBox = viewer._infoBox;\n const selectionIndicator = viewer._selectionIndicator;\n\n const visibility = enabled ? \"hidden\" : \"visible\";\n\n if (defined(geocoder)) {\n geocoder.container.style.visibility = visibility;\n }\n if (defined(homeButton)) {\n homeButton.container.style.visibility = visibility;\n }\n if (defined(sceneModePicker)) {\n sceneModePicker.container.style.visibility = visibility;\n }\n if (defined(projectionPicker)) {\n projectionPicker.container.style.visibility = visibility;\n }\n if (defined(baseLayerPicker)) {\n baseLayerPicker.container.style.visibility = visibility;\n }\n if (defined(animation)) {\n animation.container.style.visibility = visibility;\n }\n if (defined(timeline)) {\n timeline.container.style.visibility = visibility;\n }\n if (\n defined(fullscreenButton) &&\n fullscreenButton.viewModel.isFullscreenEnabled\n ) {\n fullscreenButton.container.style.visibility = visibility;\n }\n if (defined(infoBox)) {\n infoBox.container.style.visibility = visibility;\n }\n if (defined(selectionIndicator)) {\n selectionIndicator.container.style.visibility = visibility;\n }\n\n if (viewer._container) {\n const right =\n enabled || !defined(fullscreenButton)\n ? 0\n : fullscreenButton.container.clientWidth;\n viewer._vrButton.container.style.right = `${right}px`;\n\n viewer.forceResize();\n }\n}\n\n/**\n * @typedef {Object} Viewer.ConstructorOptions\n *\n * Initialization options for the Viewer constructor\n *\n * @property {Boolean} [animation=true] If set to false, the Animation widget will not be created.\n * @property {Boolean} [baseLayerPicker=true] If set to false, the BaseLayerPicker widget will not be created.\n * @property {Boolean} [fullscreenButton=true] If set to false, the FullscreenButton widget will not be created.\n * @property {Boolean} [vrButton=false] If set to true, the VRButton widget will be created.\n * @property {Boolean|GeocoderService[]} [geocoder=true] If set to false, the Geocoder widget will not be created.\n * @property {Boolean} [homeButton=true] If set to false, the HomeButton widget will not be created.\n * @property {Boolean} [infoBox=true] If set to false, the InfoBox widget will not be created.\n * @property {Boolean} [sceneModePicker=true] If set to false, the SceneModePicker widget will not be created.\n * @property {Boolean} [selectionIndicator=true] If set to false, the SelectionIndicator widget will not be created.\n * @property {Boolean} [timeline=true] If set to false, the Timeline widget will not be created.\n * @property {Boolean} [navigationHelpButton=true] If set to false, the navigation help button will not be created.\n * @property {Boolean} [navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button.\n * @property {Boolean} [scene3DOnly=false] When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.\n * @property {Boolean} [shouldAnimate=false] <code>true</code> if the clock should attempt to advance simulation time by default, <code>false</code> otherwise. This option takes precedence over setting {@link Viewer#clockViewModel}.\n * @property {ClockViewModel} [clockViewModel=new ClockViewModel(clock)] The clock view model to use to control current time.\n * @property {ProviderViewModel} [selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel[]} [imageryProviderViewModels=createDefaultImageryProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel} [selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true.\n * @property {ProviderViewModel[]} [terrainProviderViewModels=createDefaultTerrainProviderViewModels()] The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.\n * @property {ImageryProvider} [imageryProvider=createWorldImagery()] The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.\n * @property {TerrainProvider} [terrainProvider=new EllipsoidTerrainProvider()] The terrain provider to use\n * @property {SkyBox|false} [skyBox] The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.\n * @property {SkyAtmosphere|false} [skyAtmosphere] Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.\n * @property {Element|String} [fullscreenElement=document.body] The element or id to be placed into fullscreen mode when the full screen button is pressed.\n * @property {Boolean} [useDefaultRenderLoop=true] True if this widget should control the render loop, false otherwise.\n * @property {Number} [targetFrameRate] The target frame rate when using the default render loop.\n * @property {Boolean} [showRenderLoopErrors=true] If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.\n * @property {Boolean} [useBrowserRecommendedResolution=true] If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.\n * @property {Boolean} [automaticallyTrackDataSourceClocks=true] If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently.\n * @property {Object} [contextOptions] Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.\n * @property {SceneMode} [sceneMode=SceneMode.SCENE3D] The initial scene mode.\n * @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.\n * @property {Globe|false} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to <code>false</code>, no globe will be added.\n * @property {Boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.\n * @property {Element|String} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself.\n * @property {Element|String} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself.\n * @property {DataSourceCollection} [dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget. If this parameter is provided,\n * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.\n * @property {Boolean} [shadows=false] Determines if shadows are cast by light sources.\n * @property {ShadowMode} [terrainShadows=ShadowMode.RECEIVE_ONLY] Determines if the terrain casts or receives shadows from light sources.\n * @property {MapMode2D} [mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.\n * @property {Boolean} [projectionPicker=false] If set to true, the ProjectionPicker widget will be created.\n * @property {Boolean} [blurActiveElementOnCanvasFocus=true] If true, the active element will blur when the viewer's canvas is clicked. Setting this to false is useful for cases when the canvas is clicked only for retrieving position or an entity data without actually meaning to set the canvas to be the active element.\n * @property {Boolean} [requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @property {Number} [maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.\n * @property {Number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.\n * @property {Number} [msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.\n */\n\n/**\n * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.\n * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.\n *\n * @alias Viewer\n * @constructor\n *\n * @param {Element|String} container The DOM element or ID that will contain the widget.\n * @param {Viewer.ConstructorOptions} [options] Object describing initialization options\n *\n * @exception {DeveloperError} Element with id \"container\" does not exist in the document.\n * @exception {DeveloperError} options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.imageryProvider instead.\n * @exception {DeveloperError} options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget, specify options.terrainProvider instead.\n *\n * @see Animation\n * @see BaseLayerPicker\n * @see CesiumWidget\n * @see FullscreenButton\n * @see HomeButton\n * @see SceneModePicker\n * @see Timeline\n * @see viewerDragDropMixin\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Hello%20World.html|Cesium Sandcastle Hello World Demo}\n *\n * @example\n * //Initialize the viewer widget with several custom options and mixins.\n * const viewer = new Cesium.Viewer('cesiumContainer', {\n * //Start in Columbus Viewer\n * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,\n * //Use Cesium World Terrain\n * terrainProvider : Cesium.createWorldTerrain(),\n * //Hide the base layer picker\n * baseLayerPicker : false,\n * //Use OpenStreetMaps\n * imageryProvider : new Cesium.OpenStreetMapImageryProvider({\n * url : 'https://a.tile.openstreetmap.org/'\n * }),\n * skyBox : new Cesium.SkyBox({\n * sources : {\n * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',\n * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',\n * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',\n * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',\n * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',\n * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'\n * }\n * }),\n * // Show Columbus View map with Web Mercator projection\n * mapProjection : new Cesium.WebMercatorProjection()\n * });\n *\n * //Add basic drag and drop functionality\n * viewer.extend(Cesium.viewerDragDropMixin);\n *\n * //Show a pop-up alert if we encounter an error when processing a dropped file\n * viewer.dropError.addEventListener(function(dropHandler, name, error) {\n * console.log(error);\n * window.alert(error);\n * });\n */\nfunction Viewer(container, options) {\n container = getElement(container);\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const createBaseLayerPicker =\n (!defined(options.globe) || options.globe !== false) &&\n (!defined(options.baseLayerPicker) || options.baseLayerPicker !== false);\n\nconst that = this;\n\n const viewerContainer = document.createElement(\"div\");\n viewerContainer.className = \"cesium-viewer\";\n container.appendChild(viewerContainer);\n\n // Cesium widget container\n const cesiumWidgetContainer = document.createElement(\"div\");\n cesiumWidgetContainer.className = \"cesium-viewer-cesiumWidgetContainer\";\n viewerContainer.appendChild(cesiumWidgetContainer);\n\n // Bottom container\n const bottomContainer = document.createElement(\"div\");\n bottomContainer.className = \"cesium-viewer-bottom\";\n\n viewerContainer.appendChild(bottomContainer);\n\n const scene3DOnly = defaultValue(options.scene3DOnly, false);\n\n let clock;\n let clockViewModel;\n let destroyClockViewModel = false;\n if (defined(options.clockViewModel)) {\n clockViewModel = options.clockViewModel;\n clock = clockViewModel.clock;\n } else {\n clock = new Clock();\n clockViewModel = new ClockViewModel(clock);\n destroyClockViewModel = true;\n }\n\n if (defined(options.shouldAnimate)) {\n clock.shouldAnimate = options.shouldAnimate;\n }\n\n // Cesium widget\n const cesiumWidget = new CesiumWidget(cesiumWidgetContainer, {\n imageryProvider:\n createBaseLayerPicker || defined(options.imageryProvider)\n ? false\n : undefined,\n clock: clock,\n skyBox: options.skyBox,\n skyAtmosphere: options.skyAtmosphere,\n sceneMode: options.sceneMode,\n mapProjection: options.mapProjection,\n globe: options.globe,\n orderIndependentTranslucency: options.orderIndependentTranslucency,\n contextOptions: options.contextOptions,\n useDefaultRenderLoop: options.useDefaultRenderLoop,\n targetFrameRate: options.targetFrameRate,\n showRenderLoopErrors: options.showRenderLoopErrors,\n useBrowserRecommendedResolution: options.useBrowserRecommendedResolution,\n creditContainer: defined(options.creditContainer)\n ? options.creditContainer\n : bottomContainer,\n creditViewport: options.creditViewport,\n scene3DOnly: scene3DOnly,\n shadows: options.shadows,\n terrainShadows: options.terrainShadows,\n mapMode2D: options.mapMode2D,\n blurActiveElementOnCanvasFocus: options.blurActiveElementOnCanvasFocus,\n requestRenderMode: options.requestRenderMode,\n maximumRenderTimeChange: options.maximumRenderTimeChange,\n depthPlaneEllipsoidOffset: options.depthPlaneEllipsoidOffset,\n msaaSamples: options.msaaSamples,\n });\n\n let dataSourceCollection = options.dataSources;\n let destroyDataSourceCollection = false;\n if (!defined(dataSourceCollection)) {\n dataSourceCollection = new DataSourceCollection();\n destroyDataSourceCollection = true;\n }\n\n const scene = cesiumWidget.scene;\n\n const dataSourceDisplay = new DataSourceDisplay({\n scene: scene,\n dataSourceCollection: dataSourceCollection,\n });\n\n const eventHelper = new EventHelper();\n\n eventHelper.add(clock.onTick, Viewer.prototype._onTick, this);\n eventHelper.add(scene.morphStart, Viewer.prototype._clearTrackedObject, this);\n\n // Selection Indicator\n let selectionIndicator;\n if (\n !defined(options.selectionIndicator) ||\n options.selectionIndicator !== false\n ) {\n const selectionIndicatorContainer = document.createElement(\"div\");\n selectionIndicatorContainer.className =\n \"cesium-viewer-selectionIndicatorContainer\";\n viewerContainer.appendChild(selectionIndicatorContainer);\n selectionIndicator = new SelectionIndicator(\n selectionIndicatorContainer,\n scene\n );\n }\n\n // Info Box\n let infoBox;\n if (!defined(options.infoBox) || options.infoBox !== false) {\n const infoBoxContainer = document.createElement(\"div\");\n infoBoxContainer.className = \"cesium-viewer-infoBoxContainer\";\n viewerContainer.appendChild(infoBoxContainer);\n infoBox = new InfoBox(infoBoxContainer);\n\n const infoBoxViewModel = infoBox.viewModel;\n eventHelper.add(\n infoBoxViewModel.cameraClicked,\n Viewer.prototype._onInfoBoxCameraClicked,\n this\n );\n eventHelper.add(\n infoBoxViewModel.closeClicked,\n Viewer.prototype._onInfoBoxClockClicked,\n this\n );\n }\n\n // Main Toolbar\n const toolbar = document.createElement(\"div\");\n toolbar.className = \"cesium-viewer-toolbar\";\n viewerContainer.appendChild(toolbar);\n\n // Geocoder\n let geocoder;\n if (!defined(options.geocoder) || options.geocoder !== false) {\n const geocoderContainer = document.createElement(\"div\");\n geocoderContainer.className = \"cesium-viewer-geocoderContainer\";\n toolbar.appendChild(geocoderContainer);\n let geocoderService;\n if (defined(options.geocoder) && typeof options.geocoder !== \"boolean\") {\n geocoderService = Array.isArray(options.geocoder)\n ? options.geocoder\n : [options.geocoder];\n }\n geocoder = new Geocoder({\n container: geocoderContainer,\n geocoderServices: geocoderService,\n scene: scene,\n });\n // Subscribe to search so that we can clear the trackedEntity when it is clicked.\n eventHelper.add(\n geocoder.viewModel.search.beforeExecute,\n Viewer.prototype._clearObjects,\n this\n );\n }\n\n // HomeButton\n let homeButton;\n if (!defined(options.homeButton) || options.homeButton !== false) {\n homeButton = new HomeButton(toolbar, scene);\n if (defined(geocoder)) {\n eventHelper.add(homeButton.viewModel.command.afterExecute, function () {\n const viewModel = geocoder.viewModel;\n viewModel.searchText = \"\";\n if (viewModel.isSearchInProgress) {\n viewModel.search();\n }\n });\n }\n // Subscribe to the home button beforeExecute event so that we can clear the trackedEntity.\n eventHelper.add(\n homeButton.viewModel.command.beforeExecute,\n Viewer.prototype._clearTrackedObject,\n this\n );\n }\n\n // SceneModePicker\n // By default, we silently disable the scene mode picker if scene3DOnly is true,\n // but if sceneModePicker is explicitly set to true, throw an error.\n let sceneModePicker;\n if (\n !scene3DOnly &&\n (!defined(options.sceneModePicker) || options.sceneModePicker !== false)\n ) {\n sceneModePicker = new SceneModePicker(toolbar, scene);\n }\n\n let projectionPicker;\n if (options.projectionPicker) {\n projectionPicker = new ProjectionPicker(toolbar, scene);\n }\n\n // BaseLayerPicker\n let baseLayerPicker;\n let baseLayerPickerDropDown;\n if (createBaseLayerPicker) {\n const imageryProviderViewModels = defaultValue(\n options.imageryProviderViewModels,\n createDefaultImageryProviderViewModels()\n );\n const terrainProviderViewModels = defaultValue(\n options.terrainProviderViewModels,\n createDefaultTerrainProviderViewModels()\n );\n\n baseLayerPicker = new BaseLayerPicker(toolbar, {\n globe: scene.globe,\n imageryProviderViewModels: imageryProviderViewModels,\n selectedImageryProviderViewModel:\n options.selectedImageryProviderViewModel,\n terrainProviderViewModels: terrainProviderViewModels,\n selectedTerrainProviderViewModel:\n options.selectedTerrainProviderViewModel,\n });\n\n //Grab the dropdown for resize code.\n const elements = toolbar.getElementsByClassName(\n \"cesium-baseLayerPicker-dropDown\"\n );\n baseLayerPickerDropDown = elements[0];\n }\n\n // These need to be set after the BaseLayerPicker is created in order to take effect\n if (defined(options.imageryProvider) && options.imageryProvider !== false) {\n if (createBaseLayerPicker) {\n baseLayerPicker.viewModel.selectedImagery = undefined;\n }\n scene.imageryLayers.removeAll();\n scene.imageryLayers.addImageryProvider(options.imageryProvider);\n }\n if (defined(options.terrainProvider)) {\n if (createBaseLayerPicker) {\n baseLayerPicker.viewModel.selectedTerrain = undefined;\n }\n scene.terrainProvider = options.terrainProvider;\n }\n\n // Navigation Help Button\n let navigationHelpButton;\n if (\n !defined(options.navigationHelpButton) ||\n options.navigationHelpButton !== false\n ) {\n let showNavHelp = true;\n try {\n //window.localStorage is null if disabled in Firefox or undefined in browsers with implementation\n if (defined(window.localStorage)) {\n const hasSeenNavHelp = window.localStorage.getItem(\n \"cesium-hasSeenNavHelp\"\n );\n if (defined(hasSeenNavHelp) && Boolean(hasSeenNavHelp)) {\n showNavHelp = false;\n } else {\n window.localStorage.setItem(\"cesium-hasSeenNavHelp\", \"true\");\n }\n }\n } catch (e) {\n //Accessing window.localStorage throws if disabled in Chrome\n //window.localStorage.setItem throws if in Safari private browsing mode or in any browser if we are over quota.\n }\n navigationHelpButton = new NavigationHelpButton({\n container: toolbar,\n instructionsInitiallyVisible: defaultValue(\n options.navigationInstructionsInitiallyVisible,\n showNavHelp\n ),\n });\n }\n\n // Animation\n let animation;\n if (!defined(options.animation) || options.animation !== false) {\n const animationContainer = document.createElement(\"div\");\n animationContainer.className = \"cesium-viewer-animationContainer\";\n viewerContainer.appendChild(animationContainer);\n animation = new Animation(\n animationContainer,\n new AnimationViewModel(clockViewModel)\n );\n }\n\n // Timeline\n let timeline;\n if (!defined(options.timeline) || options.timeline !== false) {\n const timelineContainer = document.createElement(\"div\");\n timelineContainer.className = \"cesium-viewer-timelineContainer\";\n viewerContainer.appendChild(timelineContainer);\n timeline = new Timeline(timelineContainer, clock);\n timeline.addEventListener(\"settime\", onTimelineScrubfunction, false);\n timeline.zoomTo(clock.startTime, clock.stopTime);\n }\n\n // Fullscreen\n let fullscreenButton;\n let fullscreenSubscription;\n let fullscreenContainer;\n if (\n !defined(options.fullscreenButton) ||\n options.fullscreenButton !== false\n ) {\n fullscreenContainer = document.createElement(\"div\");\n fullscreenContainer.className = \"cesium-viewer-fullscreenContainer\";\n viewerContainer.appendChild(fullscreenContainer);\n fullscreenButton = new FullscreenButton(\n fullscreenContainer,\n options.fullscreenElement\n );\n\n //Subscribe to fullscreenButton.viewModel.isFullscreenEnabled so\n //that we can hide/show the button as well as size the timeline.\n fullscreenSubscription = subscribeAndEvaluate(\n fullscreenButton.viewModel,\n \"isFullscreenEnabled\",\n function (isFullscreenEnabled) {\n fullscreenContainer.style.display = isFullscreenEnabled\n ? \"block\"\n : \"none\";\n if (defined(timeline)) {\n timeline.container.style.right = `${fullscreenContainer.clientWidth}px`;\n timeline.resize();\n }\n }\n );\n }\n\n // VR\n let vrButton;\n let vrSubscription;\n let vrModeSubscription;\n if (options.vrButton) {\n const vrContainer = document.createElement(\"div\");\n vrContainer.className = \"cesium-viewer-vrContainer\";\n viewerContainer.appendChild(vrContainer);\n vrButton = new VRButton(vrContainer, scene, options.fullScreenElement);\n\n vrSubscription = subscribeAndEvaluate(\n vrButton.viewModel,\n \"isVREnabled\",\n function (isVREnabled) {\n vrContainer.style.display = isVREnabled ? \"block\" : \"none\";\n if (defined(fullscreenButton)) {\n vrContainer.style.right = `${fullscreenContainer.clientWidth}px`;\n }\n if (defined(timeline)) {\n timeline.container.style.right = `${vrContainer.clientWidth}px`;\n timeline.resize();\n }\n }\n );\n\n vrModeSubscription = subscribeAndEvaluate(\n vrButton.viewModel,\n \"isVRMode\",\n function (isVRMode) {\n enableVRUI(that, isVRMode);\n }\n );\n }\n\n //Assign all properties to this instance. No \"this\" assignments should\n //take place above this line.\n this._baseLayerPickerDropDown = baseLayerPickerDropDown;\n this._fullscreenSubscription = fullscreenSubscription;\n this._vrSubscription = vrSubscription;\n this._vrModeSubscription = vrModeSubscription;\n this._dataSourceChangedListeners = {};\n this._automaticallyTrackDataSourceClocks = defaultValue(\n options.automaticallyTrackDataSourceClocks,\n true\n );\n this._container = container;\n this._bottomContainer = bottomContainer;\n this._element = viewerContainer;\n this._cesiumWidget = cesiumWidget;\n this._selectionIndicator = selectionIndicator;\n this._infoBox = infoBox;\n this._dataSourceCollection = dataSourceCollection;\n this._destroyDataSourceCollection = destroyDataSourceCollection;\n this._dataSourceDisplay = dataSourceDisplay;\n this._clockViewModel = clockViewModel;\n this._destroyClockViewModel = destroyClockViewModel;\n this._toolbar = toolbar;\n this._homeButton = homeButton;\n this._sceneModePicker = sceneModePicker;\n this._projectionPicker = projectionPicker;\n this._baseLayerPicker = baseLayerPicker;\n this._navigationHelpButton = navigationHelpButton;\n this._animation = animation;\n this._timeline = timeline;\n this._fullscreenButton = fullscreenButton;\n this._vrButton = vrButton;\n this._geocoder = geocoder;\n this._eventHelper = eventHelper;\n this._lastWidth = 0;\n this._lastHeight = 0;\n this._allowDataSourcesToSuspendAnimation = true;\n this._entityView = undefined;\n this._enableInfoOrSelection = defined(infoBox) || defined(selectionIndicator);\n this._clockTrackedDataSource = undefined;\n this._trackedEntity = undefined;\n this._needTrackedEntityUpdate = false;\n this._selectedEntity = undefined;\n this._zoomIsFlight = false;\n this._zoomTarget = undefined;\n this._zoomPromise = undefined;\n this._zoomOptions = undefined;\n this._selectedEntityChanged = new Event();\n this._trackedEntityChanged = new Event();\n\n knockout.track(this, [\n \"_trackedEntity\",\n \"_selectedEntity\",\n \"_clockTrackedDataSource\",\n ]);\n\n //Listen to data source events in order to track clock changes.\n eventHelper.add(\n dataSourceCollection.dataSourceAdded,\n Viewer.prototype._onDataSourceAdded,\n this\n );\n eventHelper.add(\n dataSourceCollection.dataSourceRemoved,\n Viewer.prototype._onDataSourceRemoved,\n this\n );\n\n // Prior to each render, check if anything needs to be resized.\n eventHelper.add(scene.postUpdate, Viewer.prototype.resize, this);\n eventHelper.add(scene.postRender, Viewer.prototype._postRender, this);\n\n // We need to subscribe to the data sources and collections so that we can clear the\n // tracked object when it is removed from the scene.\n // Subscribe to current data sources\n const dataSourceLength = dataSourceCollection.length;\n for (let i = 0; i < dataSourceLength; i++) {\n this._dataSourceAdded(dataSourceCollection, dataSourceCollection.get(i));\n }\n this._dataSourceAdded(undefined, dataSourceDisplay.defaultDataSource);\n\n // Hook up events so that we can subscribe to future sources.\n eventHelper.add(\n dataSourceCollection.dataSourceAdded,\n Viewer.prototype._dataSourceAdded,\n this\n );\n eventHelper.add(\n dataSourceCollection.dataSourceRemoved,\n Viewer.prototype._dataSourceRemoved,\n this\n );\n\n // Subscribe to left clicks and zoom to the picked object.\n function pickAndTrackObject(e) {\n const entity = pickEntity(that, e);\n if (defined(entity)) {\n //Only track the entity if it has a valid position at the current time.\n if (\n Property.getValueOrUndefined(entity.position, that.clock.currentTime)\n ) {\n that.trackedEntity = entity;\n } else {\n that.zoomTo(entity);\n }\n } else if (defined(that.trackedEntity)) {\n that.trackedEntity = undefined;\n }\n }\n\n function pickAndSelectObject(e) {\n that.selectedEntity = pickEntity(that, e);\n }\n\n cesiumWidget.screenSpaceEventHandler.setInputAction(\n pickAndSelectObject,\n ScreenSpaceEventType.LEFT_CLICK\n );\n cesiumWidget.screenSpaceEventHandler.setInputAction(\n pickAndTrackObject,\n ScreenSpaceEventType.LEFT_DOUBLE_CLICK\n );\n}\n\nObject.defineProperties(Viewer.prototype, {\n /**\n * Gets the parent container.\n * @memberof Viewer.prototype\n * @type {Element}\n * @readonly\n */\n container: {\n get: function () {\n return this._container;\n },\n },\n\n /**\n * Gets the DOM element for the area at the bottom of the window containing the\n * {@link CreditDisplay} and potentially other things.\n * @memberof Viewer.prototype\n * @type {Element}\n * @readonly\n */\n bottomContainer: {\n get: function () {\n return this._bottomContainer;\n },\n },\n\n /**\n * Gets the CesiumWidget.\n * @memberof Viewer.prototype\n * @type {CesiumWidget}\n * @readonly\n */\n cesiumWidget: {\n get: function () {\n return this._cesiumWidget;\n },\n },\n\n /**\n * Gets the selection indicator.\n * @memberof Viewer.prototype\n * @type {SelectionIndicator}\n * @readonly\n */\n selectionIndicator: {\n get: function () {\n return this._selectionIndicator;\n },\n },\n\n /**\n * Gets the info box.\n * @memberof Viewer.prototype\n * @type {InfoBox}\n * @readonly\n */\n infoBox: {\n get: function () {\n return this._infoBox;\n },\n },\n\n /**\n * Gets the Geocoder.\n * @memberof Viewer.prototype\n * @type {Geocoder}\n * @readonly\n */\n geocoder: {\n get: function () {\n return this._geocoder;\n },\n },\n\n /**\n * Gets the HomeButton.\n * @memberof Viewer.prototype\n * @type {HomeButton}\n * @readonly\n */\n homeButton: {\n get: function () {\n return this._homeButton;\n },\n },\n\n /**\n * Gets the SceneModePicker.\n * @memberof Viewer.prototype\n * @type {SceneModePicker}\n * @readonly\n */\n sceneModePicker: {\n get: function () {\n return this._sceneModePicker;\n },\n },\n\n /**\n * Gets the ProjectionPicker.\n * @memberof Viewer.prototype\n * @type {ProjectionPicker}\n * @readonly\n */\n projectionPicker: {\n get: function () {\n return this._projectionPicker;\n },\n },\n\n /**\n * Gets the BaseLayerPicker.\n * @memberof Viewer.prototype\n * @type {BaseLayerPicker}\n * @readonly\n */\n baseLayerPicker: {\n get: function () {\n return this._baseLayerPicker;\n },\n },\n\n /**\n * Gets the NavigationHelpButton.\n * @memberof Viewer.prototype\n * @type {NavigationHelpButton}\n * @readonly\n */\n navigationHelpButton: {\n get: function () {\n return this._navigationHelpButton;\n },\n },\n\n /**\n * Gets the Animation widget.\n * @memberof Viewer.prototype\n * @type {Animation}\n * @readonly\n */\n animation: {\n get: function () {\n return this._animation;\n },\n },\n\n /**\n * Gets the Timeline widget.\n * @memberof Viewer.prototype\n * @type {Timeline}\n * @readonly\n */\n timeline: {\n get: function () {\n return this._timeline;\n },\n },\n\n /**\n * Gets the FullscreenButton.\n * @memberof Viewer.prototype\n * @type {FullscreenButton}\n * @readonly\n */\n fullscreenButton: {\n get: function () {\n return this._fullscreenButton;\n },\n },\n\n /**\n * Gets the VRButton.\n * @memberof Viewer.prototype\n * @type {VRButton}\n * @readonly\n */\n vrButton: {\n get: function () {\n return this._vrButton;\n },\n },\n\n /**\n * Gets the display used for {@link DataSource} visualization.\n * @memberof Viewer.prototype\n * @type {DataSourceDisplay}\n * @readonly\n */\n dataSourceDisplay: {\n get: function () {\n return this._dataSourceDisplay;\n },\n },\n\n /**\n * Gets the collection of entities not tied to a particular data source.\n * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.\n * @memberof Viewer.prototype\n * @type {EntityCollection}\n * @readonly\n */\n entities: {\n get: function () {\n return this._dataSourceDisplay.defaultDataSource.entities;\n },\n },\n\n /**\n * Gets the set of {@link DataSource} instances to be visualized.\n * @memberof Viewer.prototype\n * @type {DataSourceCollection}\n * @readonly\n */\n dataSources: {\n get: function () {\n return this._dataSourceCollection;\n },\n },\n\n /**\n * Gets the canvas.\n * @memberof Viewer.prototype\n * @type {HTMLCanvasElement}\n * @readonly\n */\n canvas: {\n get: function () {\n return this._cesiumWidget.canvas;\n },\n },\n\n /**\n * Gets the scene.\n * @memberof Viewer.prototype\n * @type {Scene}\n * @readonly\n */\n scene: {\n get: function () {\n return this._cesiumWidget.scene;\n },\n },\n\n /**\n * Determines if shadows are cast by light sources.\n * @memberof Viewer.prototype\n * @type {Boolean}\n */\n shadows: {\n get: function () {\n return this.scene.shadowMap.enabled;\n },\n set: function (value) {\n this.scene.shadowMap.enabled = value;\n },\n },\n\n /**\n * Determines if the terrain casts or shadows from light sources.\n * @memberof Viewer.prototype\n * @type {ShadowMode}\n */\n terrainShadows: {\n get: function () {\n return this.scene.globe.shadows;\n },\n set: function (value) {\n this.scene.globe.shadows = value;\n },\n },\n\n /**\n * Get the scene's shadow map\n * @memberof Viewer.prototype\n * @type {ShadowMap}\n * @readonly\n */\n shadowMap: {\n get: function () {\n return this.scene.shadowMap;\n },\n },\n\n /**\n * Gets the collection of image layers that will be rendered on the globe.\n * @memberof Viewer.prototype\n *\n * @type {ImageryLayerCollection}\n * @readonly\n */\n imageryLayers: {\n get: function () {\n return this.scene.imageryLayers;\n },\n },\n\n /**\n * The terrain provider providing surface geometry for the globe.\n * @memberof Viewer.prototype\n *\n * @type {TerrainProvider}\n */\n terrainProvider: {\n get: function () {\n return this.scene.terrainProvider;\n },\n set: function (terrainProvider) {\n this.scene.terrainProvider = terrainProvider;\n },\n },\n\n /**\n * Gets the camera.\n * @memberof Viewer.prototype\n *\n * @type {Camera}\n * @readonly\n */\n camera: {\n get: function () {\n return this.scene.camera;\n },\n },\n\n /**\n * Gets the post-process stages.\n * @memberof Viewer.prototype\n *\n * @type {PostProcessStageCollection}\n * @readonly\n */\n postProcessStages: {\n get: function () {\n return this.scene.postProcessStages;\n },\n },\n\n /**\n * Gets the clock.\n * @memberof Viewer.prototype\n * @type {Clock}\n * @readonly\n */\n clock: {\n get: function () {\n return this._clockViewModel.clock;\n },\n },\n\n /**\n * Gets the clock view model.\n * @memberof Viewer.prototype\n * @type {ClockViewModel}\n * @readonly\n */\n clockViewModel: {\n get: function () {\n return this._clockViewModel;\n },\n },\n\n /**\n * Gets the screen space event handler.\n * @memberof Viewer.prototype\n * @type {ScreenSpaceEventHandler}\n * @readonly\n */\n screenSpaceEventHandler: {\n get: function () {\n return this._cesiumWidget.screenSpaceEventHandler;\n },\n },\n\n /**\n * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>\n * is true. If undefined, the browser's requestAnimationFrame implementation\n * determines the frame rate. If defined, this value must be greater than 0. A value higher\n * than the underlying requestAnimationFrame implementation will have no effect.\n * @memberof Viewer.prototype\n *\n * @type {Number}\n */\n targetFrameRate: {\n get: function () {\n return this._cesiumWidget.targetFrameRate;\n },\n set: function (value) {\n this._cesiumWidget.targetFrameRate = value;\n },\n },\n\n /**\n * Gets or sets whether or not this widget should control the render loop.\n * If true the widget will use requestAnimationFrame to\n * perform rendering and resizing of the widget, as well as drive the\n * simulation clock. If set to false, you must manually call the\n * <code>resize</code>, <code>render</code> methods\n * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s\n * <code>renderError</code> event will be raised and this property\n * will be set to false. It must be set back to true to continue rendering\n * after the error.\n * @memberof Viewer.prototype\n *\n * @type {Boolean}\n */\n useDefaultRenderLoop: {\n get: function () {\n return this._cesiumWidget.useDefaultRenderLoop;\n },\n set: function (value) {\n this._cesiumWidget.useDefaultRenderLoop = value;\n },\n },\n\n /**\n * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve\n * performance on less powerful devices while values greater than 1.0 will render at a higher\n * resolution and then scale down, resulting in improved visual fidelity.\n * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5\n * will cause the scene to be rendered at 320x240 and then scaled up while setting\n * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.\n * @memberof Viewer.prototype\n *\n * @type {Number}\n * @default 1.0\n */\n resolutionScale: {\n get: function () {\n return this._cesiumWidget.resolutionScale;\n },\n set: function (value) {\n this._cesiumWidget.resolutionScale = value;\n },\n },\n\n /**\n * Boolean flag indicating if the browser's recommended resolution is used.\n * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,\n * effectively rendering based on CSS pixels instead of device pixels. This can improve\n * performance on less powerful devices that have high pixel density. When false, rendering\n * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether\n * this flag is true or false.\n * @memberof Viewer.prototype\n *\n * @type {Boolean}\n * @default true\n */\n useBrowserRecommendedResolution: {\n get: function () {\n return this._cesiumWidget.useBrowserRecommendedResolution;\n },\n set: function (value) {\n this._cesiumWidget.useBrowserRecommendedResolution = value;\n },\n },\n\n /**\n * Gets or sets whether or not data sources can temporarily pause\n * animation in order to avoid showing an incomplete picture to the user.\n * For example, if asynchronous primitives are being processed in the\n * background, the clock will not advance until the geometry is ready.\n *\n * @memberof Viewer.prototype\n *\n * @type {Boolean}\n */\n allowDataSourcesToSuspendAnimation: {\n get: function () {\n return this._allowDataSourcesToSuspendAnimation;\n },\n set: function (value) {\n this._allowDataSourcesToSuspendAnimation = value;\n },\n },\n\n /**\n * Gets or sets the Entity instance currently being tracked by the camera.\n * @memberof Viewer.prototype\n * @type {Entity | undefined}\n */\n trackedEntity: {\n get: function () {\n return this._trackedEntity;\n },\n set: function (value) {\n if (this._trackedEntity !== value) {\n this._trackedEntity = value;\n\n //Cancel any pending zoom\n cancelZoom(this);\n\n const scene = this.scene;\n const sceneMode = scene.mode;\n\n //Stop tracking\n if (!defined(value) || !defined(value.position)) {\n this._needTrackedEntityUpdate = false;\n if (\n sceneMode === SceneMode.COLUMBUS_VIEW ||\n sceneMode === SceneMode.SCENE2D\n ) {\n scene.screenSpaceCameraController.enableTranslate = true;\n }\n\n if (\n sceneMode === SceneMode.COLUMBUS_VIEW ||\n sceneMode === SceneMode.SCENE3D\n ) {\n scene.screenSpaceCameraController.enableTilt = true;\n }\n\n this._entityView = undefined;\n this.camera.lookAtTransform(Matrix4.IDENTITY);\n } else {\n //We can't start tracking immediately, so we set a flag and start tracking\n //when the bounding sphere is ready (most likely next frame).\n this._needTrackedEntityUpdate = true;\n }\n\n this._trackedEntityChanged.raiseEvent(value);\n this.scene.requestRender();\n }\n },\n },\n /**\n * Gets or sets the object instance for which to display a selection indicator.\n *\n * If a user interactively picks a Cesium3DTilesFeature instance, then this property\n * will contain a transient Entity instance with a property named \"feature\" that is\n * the instance that was picked.\n * @memberof Viewer.prototype\n * @type {Entity | undefined}\n */\n selectedEntity: {\n get: function () {\n return this._selectedEntity;\n },\n set: function (value) {\n if (this._selectedEntity !== value) {\n this._selectedEntity = value;\n const selectionIndicatorViewModel = defined(this._selectionIndicator)\n ? this._selectionIndicator.viewModel\n : undefined;\n if (defined(value)) {\n if (defined(selectionIndicatorViewModel)) {\n selectionIndicatorViewModel.animateAppear();\n }\n } else if (defined(selectionIndicatorViewModel)) {\n // Leave the info text in place here, it is needed during the exit animation.\n selectionIndicatorViewModel.animateDepart();\n }\n this._selectedEntityChanged.raiseEvent(value);\n }\n },\n },\n /**\n * Gets the event that is raised when the selected entity changes.\n * @memberof Viewer.prototype\n * @type {Event}\n * @readonly\n */\n selectedEntityChanged: {\n get: function () {\n return this._selectedEntityChanged;\n },\n },\n /**\n * Gets the event that is raised when the tracked entity changes.\n * @memberof Viewer.prototype\n * @type {Event}\n * @readonly\n */\n trackedEntityChanged: {\n get: function () {\n return this._trackedEntityChanged;\n },\n },\n /**\n * Gets or sets the data source to track with the viewer's clock.\n * @memberof Viewer.prototype\n * @type {DataSource}\n */\n clockTrackedDataSource: {\n get: function () {\n return this._clockTrackedDataSource;\n },\n set: function (value) {\n if (this._clockTrackedDataSource !== value) {\n this._clockTrackedDataSource = value;\n trackDataSourceClock(this._timeline, this.clock, value);\n }\n },\n },\n});\n\n/**\n * Extends the base viewer functionality with the provided mixin.\n * A mixin may add additional properties, functions, or other behavior\n * to the provided viewer instance.\n *\n * @param {Viewer.ViewerMixin} mixin The Viewer mixin to add to this instance.\n * @param {Object} [options] The options object to be passed to the mixin function.\n *\n * @see viewerDragDropMixin\n */\nViewer.prototype.extend = function (mixin, options) {\nmixin(this, options);\n};\n\n/**\n * Resizes the widget to match the container size.\n * This function is called automatically as needed unless\n * <code>useDefaultRenderLoop</code> is set to false.\n */\nViewer.prototype.resize = function () {\n const cesiumWidget = this._cesiumWidget;\n const container = this._container;\n const width = container.clientWidth;\n const height = container.clientHeight;\n const animationExists = defined(this._animation);\n const timelineExists = defined(this._timeline);\n\n cesiumWidget.resize();\n\n if (width === this._lastWidth && height === this._lastHeight) {\n return;\n }\n\n const panelMaxHeight = height - 125;\n const baseLayerPickerDropDown = this._baseLayerPickerDropDown;\n\n if (defined(baseLayerPickerDropDown)) {\n baseLayerPickerDropDown.style.maxHeight = `${panelMaxHeight}px`;\n }\n\n if (defined(this._geocoder)) {\n const geocoderSuggestions = this._geocoder.searchSuggestionsContainer;\n geocoderSuggestions.style.maxHeight = `${panelMaxHeight}px`;\n }\n\n if (defined(this._infoBox)) {\n this._infoBox.viewModel.maxHeight = panelMaxHeight;\n }\n\n const timeline = this._timeline;\n let animationContainer;\n let animationWidth = 0;\n let creditLeft = 0;\n let creditBottom = 0;\n\n if (\n animationExists &&\n window.getComputedStyle(this._animation.container).visibility !== \"hidden\"\n ) {\n const lastWidth = this._lastWidth;\n animationContainer = this._animation.container;\n if (width > 900) {\n animationWidth = 169;\n if (lastWidth <= 900) {\n animationContainer.style.width = \"169px\";\n animationContainer.style.height = \"112px\";\n this._animation.resize();\n }\n } else if (width >= 600) {\n animationWidth = 136;\n if (lastWidth < 600 || lastWidth > 900) {\n animationContainer.style.width = \"136px\";\n animationContainer.style.height = \"90px\";\n this._animation.resize();\n }\n } else {\n animationWidth = 106;\n if (lastWidth > 600 || lastWidth === 0) {\n animationContainer.style.width = \"106px\";\n animationContainer.style.height = \"70px\";\n this._animation.resize();\n }\n }\n creditLeft = animationWidth + 5;\n }\n\n if (\n timelineExists &&\n window.getComputedStyle(this._timeline.container).visibility !== \"hidden\"\n ) {\n const fullscreenButton = this._fullscreenButton;\n const vrButton = this._vrButton;\n const timelineContainer = timeline.container;\n const timelineStyle = timelineContainer.style;\n\n creditBottom = timelineContainer.clientHeight + 3;\n timelineStyle.left = `${animationWidth}px`;\n\n let pixels = 0;\n if (defined(fullscreenButton)) {\n pixels += fullscreenButton.container.clientWidth;\n }\n if (defined(vrButton)) {\n pixels += vrButton.container.clientWidth;\n }\n\n timelineStyle.right = `${pixels}px`;\n timeline.resize();\n }\n\n this._bottomContainer.style.left = `${creditLeft}px`;\n this._bottomContainer.style.bottom = `${creditBottom}px`;\n\n this._lastWidth = width;\n this._lastHeight = height;\n};\n\n/**\n * This forces the widget to re-think its layout, including\n * widget sizes and credit placement.\n */\nViewer.prototype.forceResize = function () {\n this._lastWidth = 0;\n this.resize();\n};\n\n/**\n * Renders the scene. This function is called automatically\n * unless <code>useDefaultRenderLoop</code> is set to false;\n */\nViewer.prototype.render = function () {\n this._cesiumWidget.render();\n};\n\n/**\n * @returns {Boolean} true if the object has been destroyed, false otherwise.\n */\nViewer.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the widget. Should be called if permanently\n * removing the widget from layout.\n */\nViewer.prototype.destroy = function () {\n let i;\n\n this.screenSpaceEventHandler.removeInputAction(\n ScreenSpaceEventType.LEFT_CLICK\n );\n this.screenSpaceEventHandler.removeInputAction(\n ScreenSpaceEventType.LEFT_DOUBLE_CLICK\n );\n\n // Unsubscribe from data sources\n const dataSources = this.dataSources;\n const dataSourceLength = dataSources.length;\n for (i = 0; i < dataSourceLength; i++) {\n this._dataSourceRemoved(dataSources, dataSources.get(i));\n }\n this._dataSourceRemoved(undefined, this._dataSourceDisplay.defaultDataSource);\n\n this._container.removeChild(this._element);\n this._element.removeChild(this._toolbar);\n\n this._eventHelper.removeAll();\n\n if (defined(this._geocoder)) {\n this._geocoder = this._geocoder.destroy();\n }\n\n if (defined(this._homeButton)) {\n this._homeButton = this._homeButton.destroy();\n }\n\n if (defined(this._sceneModePicker)) {\n this._sceneModePicker = this._sceneModePicker.destroy();\n }\n\n if (defined(this._projectionPicker)) {\n this._projectionPicker = this._projectionPicker.destroy();\n }\n\n if (defined(this._baseLayerPicker)) {\n this._baseLayerPicker = this._baseLayerPicker.destroy();\n }\n\n if (defined(this._animation)) {\n this._element.removeChild(this._animation.container);\n this._animation = this._animation.destroy();\n }\n\n if (defined(this._timeline)) {\n this._timeline.removeEventListener(\n \"settime\",\n onTimelineScrubfunction,\n false\n );\n this._element.removeChild(this._timeline.container);\n this._timeline = this._timeline.destroy();\n }\n\n if (defined(this._fullscreenButton)) {\n this._fullscreenSubscription.dispose();\n this._element.removeChild(this._fullscreenButton.container);\n this._fullscreenButton = this._fullscreenButton.destroy();\n }\n\n if (defined(this._vrButton)) {\n this._vrSubscription.dispose();\n this._vrModeSubscription.dispose();\n this._element.removeChild(this._vrButton.container);\n this._vrButton = this._vrButton.destroy();\n }\n\n if (defined(this._infoBox)) {\n this._element.removeChild(this._infoBox.container);\n this._infoBox = this._infoBox.destroy();\n }\n\n if (defined(this._selectionIndicator)) {\n this._element.removeChild(this._selectionIndicator.container);\n this._selectionIndicator = this._selectionIndicator.destroy();\n }\n\n if (this._destroyClockViewModel) {\n this._clockViewModel = this._clockViewModel.destroy();\n }\n this._dataSourceDisplay = this._dataSourceDisplay.destroy();\n this._cesiumWidget = this._cesiumWidget.destroy();\n\n if (this._destroyDataSourceCollection) {\n this._dataSourceCollection = this._dataSourceCollection.destroy();\n }\n\n return destroyObject(this);\n};\n\n/**\n * @private\n */\nViewer.prototype._dataSourceAdded = function (\n dataSourceCollection,\n dataSource\n) {\n const entityCollection = dataSource.entities;\n entityCollection.collectionChanged.addEventListener(\n Viewer.prototype._onEntityCollectionChanged,\n this\n );\n};\n\n/**\n * @private\n */\nViewer.prototype._dataSourceRemoved = function (\n dataSourceCollection,\n dataSource\n) {\n const entityCollection = dataSource.entities;\n entityCollection.collectionChanged.removeEventListener(\n Viewer.prototype._onEntityCollectionChanged,\n this\n );\n\n if (defined(this.trackedEntity)) {\n if (\n entityCollection.getById(this.trackedEntity.id) === this.trackedEntity\n ) {\n this.trackedEntity = undefined;\n }\n }\n\n if (defined(this.selectedEntity)) {\n if (\n entityCollection.getById(this.selectedEntity.id) === this.selectedEntity\n ) {\n this.selectedEntity = undefined;\n }\n }\n};\n\n/**\n * @private\n */\nViewer.prototype._onTick = function (clock) {\n const time = clock.currentTime;\n\n const isUpdated = this._dataSourceDisplay.update(time);\n if (this._allowDataSourcesToSuspendAnimation) {\n this._clockViewModel.canAnimate = isUpdated;\n }\n\n const entityView = this._entityView;\n if (defined(entityView)) {\n const trackedEntity = this._trackedEntity;\n const trackedState = this._dataSourceDisplay.getBoundingSphere(\n trackedEntity,\n false,\n boundingSphereScratch\n );\n if (trackedState === BoundingSphereState.DONE) {\n entityView.update(time, boundingSphereScratch);\n }\n }\n\n let position;\n let enableCamera = false;\n const selectedEntity = this.selectedEntity;\n const showSelection = defined(selectedEntity) && this._enableInfoOrSelection;\n\n if (\n showSelection &&\n selectedEntity.isShowing &&\n selectedEntity.isAvailable(time)\n ) {\n const state = this._dataSourceDisplay.getBoundingSphere(\n selectedEntity,\n true,\n boundingSphereScratch\n );\n if (state !== BoundingSphereState.FAILED) {\n position = boundingSphereScratch.center;\n } else if (defined(selectedEntity.position)) {\n position = selectedEntity.position.getValue(time, position);\n }\n enableCamera = defined(position);\n }\n\n const selectionIndicatorViewModel = defined(this._selectionIndicator)\n ? this._selectionIndicator.viewModel\n : undefined;\n if (defined(selectionIndicatorViewModel)) {\n selectionIndicatorViewModel.position = Cartesian3.clone(\n position,\n selectionIndicatorViewModel.position\n );\n selectionIndicatorViewModel.showSelection = showSelection && enableCamera;\n selectionIndicatorViewModel.update();\n }\n\n const infoBoxViewModel = defined(this._infoBox)\n ? this._infoBox.viewModel\n : undefined;\n if (defined(infoBoxViewModel)) {\n infoBoxViewModel.showInfo = showSelection;\n infoBoxViewModel.enableCamera = enableCamera;\n infoBoxViewModel.isCameraTracking =\n this.trackedEntity === this.selectedEntity;\n\n if (showSelection) {\n infoBoxViewModel.titleText = defaultValue(\n selectedEntity.name,\n selectedEntity.id\n );\n infoBoxViewModel.description = Property.getValueOrDefault(\n selectedEntity.description,\n time,\n \"\"\n );\n } else {\n infoBoxViewModel.titleText = \"\";\n infoBoxViewModel.description = \"\";\n }\n }\n};\n\n/**\n * @private\n */\nViewer.prototype._onEntityCollectionChanged = function (\n collection,\n added,\n removed\n) {\n const length = removed.length;\n for (let i = 0; i < length; i++) {\n const removedObject = removed[i];\n if (this.trackedEntity === removedObject) {\n this.trackedEntity = undefined;\n }\n if (this.selectedEntity === removedObject) {\n this.selectedEntity = undefined;\n }\n }\n};\n\n/**\n * @private\n */\nViewer.prototype._onInfoBoxCameraClicked = function (infoBoxViewModel) {\n if (\n infoBoxViewModel.isCameraTracking &&\n this.trackedEntity === this.selectedEntity\n ) {\n this.trackedEntity = undefined;\n } else {\n const selectedEntity = this.selectedEntity;\n const position = selectedEntity.position;\n if (defined(position)) {\n this.trackedEntity = this.selectedEntity;\n } else {\n this.zoomTo(this.selectedEntity);\n }\n }\n};\n\n/**\n * @private\n */\nViewer.prototype._clearTrackedObject = function () {\n this.trackedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._onInfoBoxClockClicked = function (infoBoxViewModel) {\n this.selectedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._clearObjects = function () {\n this.trackedEntity = undefined;\n this.selectedEntity = undefined;\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceChanged = function (dataSource) {\n if (this.clockTrackedDataSource === dataSource) {\n trackDataSourceClock(this.timeline, this.clock, dataSource);\n }\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceAdded = function (\n dataSourceCollection,\n dataSource\n) {\n if (this._automaticallyTrackDataSourceClocks) {\n this.clockTrackedDataSource = dataSource;\n }\n const id = dataSource.entities.id;\n const removalFunc = this._eventHelper.add(\n dataSource.changedEvent,\n Viewer.prototype._onDataSourceChanged,\n this\n );\n this._dataSourceChangedListeners[id] = removalFunc;\n};\n\n/**\n * @private\n */\nViewer.prototype._onDataSourceRemoved = function (\n dataSourceCollection,\n dataSource\n) {\n const resetClock = this.clockTrackedDataSource === dataSource;\n const id = dataSource.entities.id;\n this._dataSourceChangedListeners[id]();\n this._dataSourceChangedListeners[id] = undefined;\n if (resetClock) {\n const numDataSources = dataSourceCollection.length;\n if (this._automaticallyTrackDataSourceClocks && numDataSources > 0) {\n this.clockTrackedDataSource = dataSourceCollection.get(\n numDataSources - 1\n );\n } else {\n this.clockTrackedDataSource = undefined;\n }\n }\n};\n\n/**\n * Asynchronously sets the camera to view the provided entity, entities, or data source.\n * If the data source is still in the process of loading or the visualization is otherwise still loading,\n * this method waits for the data to be ready before performing the zoom.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|Promise.<Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud>} target The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.\n * @param {HeadingPitchRange} [offset] The offset from the center of the entity in the local east-north-up reference frame.\n * @returns {Promise.<Boolean>} A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled.\n */\nViewer.prototype.zoomTo = function (target, offset) {\n const options = {\n offset: offset,\n };\n return zoomToOrFly(this, target, options, false);\n};\n\n/**\n * Flies the camera to the provided entity, entities, or data source.\n * If the data source is still in the process of loading or the visualization is otherwise still loading,\n * this method waits for the data to be ready before performing the flight.\n *\n * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.\n * The heading and the pitch angles are defined in the local east-north-up reference frame.\n * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch\n * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is\n * zero, a range will be computed such that the whole bounding sphere is visible.</p>\n *\n * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the\n * target will be the range. The heading will be determined from the offset. If the heading cannot be\n * determined from the offset, the heading will be north.</p>\n *\n * @param {Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud|Promise.<Entity|Entity[]|EntityCollection|DataSource|ImageryLayer|Cesium3DTileset|TimeDynamicPointCloud>} target The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.\n * @param {Object} [options] Object with the following properties:\n * @param {Number} [options.duration=3.0] The duration of the flight in seconds.\n * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.\n * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.\n * @returns {Promise.<Boolean>} A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions\n */\nViewer.prototype.flyTo = function (target, options) {\n return zoomToOrFly(this, target, options, true);\n};\n\nfunction zoomToOrFly(that, zoomTarget, options, isFlight) {\n cancelZoom(that);\n\n //We can't actually perform the zoom until all visualization is ready and\n //bounding spheres have been computed. Therefore we create and return\n //a deferred which will be resolved as part of the post-render step in the\n //frame that actually performs the zoom.\n const zoomPromise = new Promise((resolve) => {\n that._completeZoom = function (value) {\n resolve(value);\n };\n });\n that._zoomPromise = zoomPromise;\n that._zoomIsFlight = isFlight;\n that._zoomOptions = options;\n\n Promise.resolve(zoomTarget).then(function (zoomTarget) {\n //Only perform the zoom if it wasn't cancelled before the promise resolved.\n if (that._zoomPromise !== zoomPromise) {\n return;\n }\n\n //If the zoom target is a rectangular imagery in an ImageLayer\n if (zoomTarget instanceof ImageryLayer) {\n zoomTarget\n .getViewableRectangle()\n .then(function (rectangle) {\n return computeFlyToLocationForRectangle(rectangle, that.scene);\n })\n .then(function (position) {\n //Only perform the zoom if it wasn't cancelled before the promise was resolved\n if (that._zoomPromise === zoomPromise) {\n that._zoomTarget = position;\n }\n });\n return;\n }\n\n //If the zoom target is a Cesium3DTileset\n if (zoomTarget instanceof Cesium3DTileset) {\n that._zoomTarget = zoomTarget;\n return;\n }\n\n //If the zoom target is a TimeDynamicPointCloud\n if (zoomTarget instanceof TimeDynamicPointCloud) {\n that._zoomTarget = zoomTarget;\n return;\n }\n\n //If the zoom target is a data source, and it's in the middle of loading, wait for it to finish loading.\n if (zoomTarget.isLoading && defined(zoomTarget.loadingEvent)) {\n const removeEvent = zoomTarget.loadingEvent.addEventListener(function () {\n removeEvent();\n\n //Only perform the zoom if it wasn't cancelled before the data source finished.\n if (that._zoomPromise === zoomPromise) {\n that._zoomTarget = zoomTarget.entities.values.slice(0);\n }\n });\n return;\n }\n\n //Zoom target is already an array, just copy it and return.\n if (Array.isArray(zoomTarget)) {\n that._zoomTarget = zoomTarget.slice(0);\n return;\n }\n\n //If zoomTarget is an EntityCollection, this will retrieve the array\n zoomTarget = defaultValue(zoomTarget.values, zoomTarget);\n\n //If zoomTarget is a DataSource, this will retrieve the array.\n if (defined(zoomTarget.entities)) {\n zoomTarget = zoomTarget.entities.values;\n }\n\n //Zoom target is already an array, just copy it and return.\n if (Array.isArray(zoomTarget)) {\n that._zoomTarget = zoomTarget.slice(0);\n } else {\n //Single entity\n that._zoomTarget = [zoomTarget];\n }\n });\n\n that.scene.requestRender();\n return zoomPromise;\n}\n\nfunction clearZoom(viewer) {\n viewer._zoomPromise = undefined;\n viewer._zoomTarget = undefined;\n viewer._zoomOptions = undefined;\n}\n\nfunction cancelZoom(viewer) {\n const zoomPromise = viewer._zoomPromise;\n if (defined(zoomPromise)) {\n clearZoom(viewer);\n viewer._completeZoom(false);\n }\n}\n\n/**\n * @private\n */\nViewer.prototype._postRender = function () {\n updateZoomTarget(this);\n updateTrackedEntity(this);\n};\n\nfunction updateZoomTarget(viewer) {\n const target = viewer._zoomTarget;\n if (!defined(target) || viewer.scene.mode === SceneMode.MORPHING) {\n return;\n }\n\n const scene = viewer.scene;\n const camera = scene.camera;\n const zoomOptions = defaultValue(viewer._zoomOptions, {});\n let options;\n\n // If zoomTarget was Cesium3DTileset\n if (target instanceof Cesium3DTileset) {\n return target.readyPromise\n .then(function () {\n const boundingSphere = target.boundingSphere;\n // If offset was originally undefined then give it base value instead of empty object\n if (!defined(zoomOptions.offset)) {\n zoomOptions.offset = new HeadingPitchRange(\n 0.0,\n -0.5,\n boundingSphere.radius\n );\n }\n\n options = {\n offset: zoomOptions.offset,\n duration: zoomOptions.duration,\n maximumHeight: zoomOptions.maximumHeight,\n complete: function () {\n viewer._completeZoom(true);\n },\n cancel: function () {\n viewer._completeZoom(false);\n },\n };\n\n if (viewer._zoomIsFlight) {\n camera.flyToBoundingSphere(target.boundingSphere, options);\n } else {\n camera.viewBoundingSphere(boundingSphere, zoomOptions.offset);\n camera.lookAtTransform(Matrix4.IDENTITY);\n\n // Finish the promise\n viewer._completeZoom(true);\n }\n\n clearZoom(viewer);\n })\n .catch(() => {\n cancelZoom(viewer);\n });\n }\n\n // If zoomTarget was TimeDynamicPointCloud\n if (target instanceof TimeDynamicPointCloud) {\n return target.readyPromise.then(function () {\n const boundingSphere = target.boundingSphere;\n // If offset was originally undefined then give it base value instead of empty object\n if (!defined(zoomOptions.offset)) {\n zoomOptions.offset = new HeadingPitchRange(\n 0.0,\n -0.5,\n boundingSphere.radius\n );\n }\n\n options = {\n offset: zoomOptions.offset,\n duration: zoomOptions.duration,\n maximumHeight: zoomOptions.maximumHeight,\n complete: function () {\n viewer._completeZoom(true);\n },\n cancel: function () {\n viewer._completeZoom(false);\n },\n };\n\n if (viewer._zoomIsFlight) {\n camera.flyToBoundingSphere(boundingSphere, options);\n } else {\n camera.viewBoundingSphere(boundingSphere, zoomOptions.offset);\n camera.lookAtTransform(Matrix4.IDENTITY);\n\n // Finish the promise\n viewer._completeZoom(true);\n }\n\n clearZoom(viewer);\n });\n }\n\n // If zoomTarget was an ImageryLayer\n if (target instanceof Cartographic) {\n options = {\n destination: scene.mapProjection.ellipsoid.cartographicToCartesian(\n target\n ),\n duration: zoomOptions.duration,\n maximumHeight: zoomOptions.maximumHeight,\n complete: function () {\n viewer._completeZoom(true);\n },\n cancel: function () {\n viewer._completeZoom(false);\n },\n };\n\n if (viewer._zoomIsFlight) {\n camera.flyTo(options);\n } else {\n camera.setView(options);\n viewer._completeZoom(true);\n }\n clearZoom(viewer);\n return;\n }\n\n const entities = target;\n\n const boundingSpheres = [];\n for (let i = 0, len = entities.length; i < len; i++) {\n const state = viewer._dataSourceDisplay.getBoundingSphere(\n entities[i],\n false,\n boundingSphereScratch\n );\n\n if (state === BoundingSphereState.PENDING) {\n return;\n } else if (state !== BoundingSphereState.FAILED) {\n boundingSpheres.push(BoundingSphere.clone(boundingSphereScratch));\n }\n }\n\n if (boundingSpheres.length === 0) {\n cancelZoom(viewer);\n return;\n }\n\n //Stop tracking the current entity.\n viewer.trackedEntity = undefined;\n\n const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres);\n\n if (!viewer._zoomIsFlight) {\n camera.viewBoundingSphere(boundingSphere, zoomOptions.offset);\n camera.lookAtTransform(Matrix4.IDENTITY);\n clearZoom(viewer);\n viewer._completeZoom(true);\n } else {\n clearZoom(viewer);\n camera.flyToBoundingSphere(boundingSphere, {\n duration: zoomOptions.duration,\n maximumHeight: zoomOptions.maximumHeight,\n complete: function () {\n viewer._completeZoom(true);\n },\n cancel: function () {\n viewer._completeZoom(false);\n },\n offset: zoomOptions.offset,\n });\n }\n}\n\nfunction updateTrackedEntity(viewer) {\n if (!viewer._needTrackedEntityUpdate) {\n return;\n }\n\n const trackedEntity = viewer._trackedEntity;\n const currentTime = viewer.clock.currentTime;\n\n //Verify we have a current position at this time. This is only triggered if a position\n //has become undefined after trackedEntity is set but before the boundingSphere has been\n //computed. In this case, we will track the entity once it comes back into existence.\n const currentPosition = Property.getValueOrUndefined(\n trackedEntity.position,\n currentTime\n );\n\n if (!defined(currentPosition)) {\n return;\n }\n\n const scene = viewer.scene;\n\n const state = viewer._dataSourceDisplay.getBoundingSphere(\n trackedEntity,\n false,\n boundingSphereScratch\n );\n if (state === BoundingSphereState.PENDING) {\n return;\n }\n\n const sceneMode = scene.mode;\n if (\n sceneMode === SceneMode.COLUMBUS_VIEW ||\n sceneMode === SceneMode.SCENE2D\n ) {\n scene.screenSpaceCameraController.enableTranslate = false;\n }\n\n if (\n sceneMode === SceneMode.COLUMBUS_VIEW ||\n sceneMode === SceneMode.SCENE3D\n ) {\n scene.screenSpaceCameraController.enableTilt = false;\n }\n\n const bs =\n state !== BoundingSphereState.FAILED ? boundingSphereScratch : undefined;\n viewer._entityView = new EntityView(\n trackedEntity,\n scene,\n scene.mapProjection.ellipsoid\n );\n viewer._entityView.update(currentTime, bs);\n viewer._needTrackedEntityUpdate = false;\n}\n\n/**\n * A function that augments a Viewer instance with additional functionality.\n * @callback Viewer.ViewerMixin\n * @param {Viewer} viewer The viewer instance.\n * @param {Object} options Options object to be passed to the mixin function.\n *\n * @see Viewer#extend\n */\nexport default Viewer;\n", "import Check from \"../../Core/Check.js\";\nimport Cesium3DTilesInspector from \"../Cesium3DTilesInspector/Cesium3DTilesInspector.js\";\n\n/**\n * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);\n */\nfunction viewerCesium3DTilesInspectorMixin(viewer) {\n const container = document.createElement(\"div\");\n container.className = \"cesium-viewer-cesium3DTilesInspectorContainer\";\n viewer.container.appendChild(container);\n const cesium3DTilesInspector = new Cesium3DTilesInspector(\n container,\n viewer.scene\n );\n\n Object.defineProperties(viewer, {\n cesium3DTilesInspector: {\n get: function () {\n return cesium3DTilesInspector;\n },\n },\n });\n}\nexport default viewerCesium3DTilesInspectorMixin;\n", "import defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport CesiumInspector from \"../CesiumInspector/CesiumInspector.js\";\n\n/**\n * A mixin which adds the CesiumInspector widget to the Viewer widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n *\n * @exception {DeveloperError} viewer is required.\n *\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Cesium%20Inspector.html|Cesium Sandcastle Cesium Inspector Demo}\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerCesiumInspectorMixin);\n */\nfunction viewerCesiumInspectorMixin(viewer) {\n const cesiumInspectorContainer = document.createElement(\"div\");\n cesiumInspectorContainer.className = \"cesium-viewer-cesiumInspectorContainer\";\n viewer.container.appendChild(cesiumInspectorContainer);\n const cesiumInspector = new CesiumInspector(\n cesiumInspectorContainer,\n viewer.scene\n );\n\n Object.defineProperties(viewer, {\n cesiumInspector: {\n get: function () {\n return cesiumInspector;\n },\n },\n });\n}\nexport default viewerCesiumInspectorMixin;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Event from \"../../Core/Event.js\";\nimport wrapFunction from \"../../Core/wrapFunction.js\";\nimport CzmlDataSource from \"../../DataSources/CzmlDataSource.js\";\nimport GeoJsonDataSource from \"../../DataSources/GeoJsonDataSource.js\";\nimport KmlDataSource from \"../../DataSources/KmlDataSource.js\";\nimport GpxDataSource from \"../../DataSources/GpxDataSource.js\";\nimport getElement from \"../getElement.js\";\n\n/**\n * A mixin which adds default drag and drop support for CZML files to the Viewer widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function viewerDragDropMixin\n\n * @param {Viewer} viewer The viewer instance.\n * @param {Object} [options] Object with the following properties:\n * @param {Element|String} [options.dropTarget=viewer.container] The DOM element which will serve as the drop target.\n * @param {Boolean} [options.clearOnDrop=true] When true, dropping files will clear all existing data sources first, when false, new data sources will be loaded after the existing ones.\n * @param {Boolean} [options.flyToOnDrop=true] When true, dropping files will fly to the data source once it is loaded.\n * @param {Boolean} [options.clampToGround=true] When true, datasources are clamped to the ground.\n * @param {Proxy} [options.proxy] The proxy to be used for KML network links.\n *\n * @exception {DeveloperError} Element with id <options.dropTarget> does not exist in the document.\n * @exception {DeveloperError} dropTarget is already defined by another mixin.\n * @exception {DeveloperError} dropEnabled is already defined by another mixin.\n * @exception {DeveloperError} dropError is already defined by another mixin.\n * @exception {DeveloperError} clearOnDrop is already defined by another mixin.\n *\n * @example\n * // Add basic drag and drop support and pop up an alert window on error.\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerDragDropMixin);\n * viewer.dropError.addEventListener(function(viewerArg, source, error) {\n * window.alert('Error processing ' + source + ':' + error);\n * });\n */\nfunction viewerDragDropMixin(viewer, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n //Local variables to be closed over by defineProperties.\n let dropEnabled = true;\n let flyToOnDrop = defaultValue(options.flyToOnDrop, true);\n const dropError = new Event();\n let clearOnDrop = defaultValue(options.clearOnDrop, true);\n let dropTarget = defaultValue(options.dropTarget, viewer.container);\n let clampToGround = defaultValue(options.clampToGround, true);\n let proxy = options.proxy;\n\n dropTarget = getElement(dropTarget);\n\n Object.defineProperties(viewer, {\n /**\n * Gets or sets the element to serve as the drop target.\n * @memberof viewerDragDropMixin.prototype\n * @type {Element}\n */\n dropTarget: {\n //TODO See https://github.com/CesiumGS/cesium/issues/832\n get: function () {\n return dropTarget;\n },\n set: function (value) {\n unsubscribe(dropTarget, handleDrop);\n dropTarget = value;\n subscribe(dropTarget, handleDrop);\n },\n },\n\n /**\n * Gets or sets a value indicating if drag and drop support is enabled.\n * @memberof viewerDragDropMixin.prototype\n * @type {Element}\n */\n dropEnabled: {\n get: function () {\n return dropEnabled;\n },\n set: function (value) {\n if (value !== dropEnabled) {\n if (value) {\n subscribe(dropTarget, handleDrop);\n } else {\n unsubscribe(dropTarget, handleDrop);\n }\n dropEnabled = value;\n }\n },\n },\n\n /**\n * Gets the event that will be raised when an error is encountered during drop processing.\n * @memberof viewerDragDropMixin.prototype\n * @type {Event}\n */\n dropError: {\n get: function () {\n return dropError;\n },\n },\n\n /**\n * Gets or sets a value indicating if existing data sources should be cleared before adding the newly dropped sources.\n * @memberof viewerDragDropMixin.prototype\n * @type {Boolean}\n */\n clearOnDrop: {\n get: function () {\n return clearOnDrop;\n },\n set: function (value) {\n clearOnDrop = value;\n },\n },\n\n /**\n * Gets or sets a value indicating if the camera should fly to the data source after it is loaded.\n * @memberof viewerDragDropMixin.prototype\n * @type {Boolean}\n */\n flyToOnDrop: {\n get: function () {\n return flyToOnDrop;\n },\n set: function (value) {\n flyToOnDrop = value;\n },\n },\n\n /**\n * Gets or sets the proxy to be used for KML.\n * @memberof viewerDragDropMixin.prototype\n * @type {Proxy}\n */\n proxy: {\n get: function () {\n return proxy;\n },\n set: function (value) {\n proxy = value;\n },\n },\n\n /**\n * Gets or sets a value indicating if the datasources should be clamped to the ground\n * @memberof viewerDragDropMixin.prototype\n * @type {Boolean}\n */\n clampToGround: {\n get: function () {\n return clampToGround;\n },\n set: function (value) {\n clampToGround = value;\n },\n },\n });\n\n function handleDrop(event) {\n stop(event);\n\n if (clearOnDrop) {\n viewer.entities.removeAll();\n viewer.dataSources.removeAll();\n }\n\n const files = event.dataTransfer.files;\n const length = files.length;\n for (let i = 0; i < length; i++) {\n const file = files[i];\n const reader = new FileReader();\n reader.onload = createOnLoadCallback(viewer, file, proxy, clampToGround);\n reader.onerror = createDropErrorCallback(viewer, file);\n reader.readAsText(file);\n }\n }\n\n //Enable drop by default;\n subscribe(dropTarget, handleDrop);\n\n //Wrap the destroy function to make sure all events are unsubscribed from\n viewer.destroy = wrapFunction(viewer, viewer.destroy, function () {\n viewer.dropEnabled = false;\n });\n\n //Specs need access to handleDrop\n viewer._handleDrop = handleDrop;\n}\n\nfunction stop(event) {\n event.stopPropagation();\n event.preventDefault();\n}\n\nfunction unsubscribe(dropTarget, handleDrop) {\n const currentTarget = dropTarget;\n if (defined(currentTarget)) {\n currentTarget.removeEventListener(\"drop\", handleDrop, false);\n currentTarget.removeEventListener(\"dragenter\", stop, false);\n currentTarget.removeEventListener(\"dragover\", stop, false);\n currentTarget.removeEventListener(\"dragexit\", stop, false);\n }\n}\n\nfunction subscribe(dropTarget, handleDrop) {\n dropTarget.addEventListener(\"drop\", handleDrop, false);\n dropTarget.addEventListener(\"dragenter\", stop, false);\n dropTarget.addEventListener(\"dragover\", stop, false);\n dropTarget.addEventListener(\"dragexit\", stop, false);\n}\n\nfunction createOnLoadCallback(viewer, file, proxy, clampToGround) {\n const scene = viewer.scene;\n return function (evt) {\n const fileName = file.name;\n try {\n let loadPromise;\n\n if (/\\.czml$/i.test(fileName)) {\n loadPromise = CzmlDataSource.load(JSON.parse(evt.target.result), {\n sourceUri: fileName,\n });\n } else if (\n /\\.geojson$/i.test(fileName) ||\n /\\.json$/i.test(fileName) ||\n /\\.topojson$/i.test(fileName)\n ) {\n loadPromise = GeoJsonDataSource.load(JSON.parse(evt.target.result), {\n sourceUri: fileName,\n clampToGround: clampToGround,\n });\n } else if (/\\.(kml|kmz)$/i.test(fileName)) {\n loadPromise = KmlDataSource.load(file, {\n sourceUri: fileName,\n proxy: proxy,\n camera: scene.camera,\n canvas: scene.canvas,\n clampToGround: clampToGround,\n screenOverlayContainer: viewer.container,\n });\n } else if (/\\.gpx$/i.test(fileName)) {\n loadPromise = GpxDataSource.load(file, {\n sourceUri: fileName,\n proxy: proxy,\n });\n } else {\n viewer.dropError.raiseEvent(\n viewer,\n fileName,\n `Unrecognized file: ${fileName}`\n );\n return;\n }\n\n if (defined(loadPromise)) {\n viewer.dataSources\n .add(loadPromise)\n .then(function (dataSource) {\n if (viewer.flyToOnDrop) {\n viewer.flyTo(dataSource);\n }\n })\n .catch(function (error) {\n viewer.dropError.raiseEvent(viewer, fileName, error);\n });\n }\n } catch (error) {\n viewer.dropError.raiseEvent(viewer, fileName, error);\n }\n };\n}\n\nfunction createDropErrorCallback(viewer, file) {\n return function (evt) {\n viewer.dropError.raiseEvent(viewer, file.name, evt.target.error);\n };\n}\nexport default viewerDragDropMixin;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport PerformanceWatchdog from \"../PerformanceWatchdog/PerformanceWatchdog.js\";\n\n/**\n * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.\n * Rather than being called directly, this function is normally passed as\n * a parameter to {@link Viewer#extend}, as shown in the example below.\n * @function\n *\n * @param {Viewer} viewer The viewer instance.\n * @param {Object} [options] An object with properties.\n * @param {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The\n * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure\n * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.\n *\n * @exception {DeveloperError} viewer is required.\n *\n * @example\n * const viewer = new Cesium.Viewer('cesiumContainer');\n * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {\n * lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'\n * });\n */\nfunction viewerPerformanceWatchdogMixin(viewer, options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n const performanceWatchdog = new PerformanceWatchdog({\n scene: viewer.scene,\n container: viewer.bottomContainer,\n lowFrameRateMessage: options.lowFrameRateMessage,\n });\n\n Object.defineProperties(viewer, {\n performanceWatchdog: {\n get: function () {\n return performanceWatchdog;\n },\n },\n });\n}\nexport default viewerPerformanceWatchdogMixin;\n", "/**\n * An enum of the basic GLSL uniform types. These can be used with\n * {@link CustomShader} to declare user-defined uniforms.\n *\n * @enum {String}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst UniformType = {\n /**\n * A single floating point value.\n *\n * @type {String}\n * @constant\n */\n FLOAT: \"float\",\n /**\n * A vector of 2 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC2: \"vec2\",\n /**\n * A vector of 3 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC3: \"vec3\",\n /**\n * A vector of 4 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC4: \"vec4\",\n /**\n * A single integer value\n *\n * @type {String}\n * @constant\n */\n INT: \"int\",\n /**\n * A vector of 2 integer values.\n *\n * @type {String}\n * @constant\n */\n INT_VEC2: \"ivec2\",\n /**\n * A vector of 3 integer values.\n *\n * @type {String}\n * @constant\n */\n INT_VEC3: \"ivec3\",\n /**\n * A vector of 4 integer values.\n *\n * @type {String}\n * @constant\n */\n INT_VEC4: \"ivec4\",\n /**\n * A single boolean value.\n *\n * @type {String}\n * @constant\n */\n BOOL: \"bool\",\n /**\n * A vector of 2 boolean values.\n *\n * @type {String}\n * @constant\n */\n BOOL_VEC2: \"bvec2\",\n /**\n * A vector of 3 boolean values.\n *\n * @type {String}\n * @constant\n */\n BOOL_VEC3: \"bvec3\",\n /**\n * A vector of 4 boolean values.\n *\n * @type {String}\n * @constant\n */\n BOOL_VEC4: \"bvec4\",\n /**\n * A 2x2 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT2: \"mat2\",\n /**\n * A 3x3 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT3: \"mat2\",\n /**\n * A 3x3 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT4: \"mat4\",\n /**\n * A 2D sampled texture.\n * @type {String}\n * @constant\n */\n SAMPLER_2D: \"sampler2D\",\n SAMPLER_CUBE: \"samplerCube\",\n};\n\nexport default Object.freeze(UniformType);\n", "import defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport getImageFromTypedArray from \"../../Core/getImageFromTypedArray.js\";\nimport CesiumMath from \"../../Core/Math.js\";\nimport resizeImageToNextPowerOfTwo from \"../../Core/resizeImageToNextPowerOfTwo.js\";\nimport PixelDatatype from \"../../Renderer/PixelDatatype.js\";\nimport Texture from \"../../Renderer/Texture.js\";\nimport TextureMinificationFilter from \"../../Renderer/TextureMinificationFilter.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n/**\n * An object to manage loading textures\n *\n * @alias TextureManager\n * @constructor\n *\n * @private\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TextureManager() {\n this._defaultTexture = undefined;\n this._textures = {};\n this._loadedImages = [];\n\n // Keep track of the last time update() was called to avoid\n // calling update() twice.\n this._lastUpdatedFrame = -1;\n}\n\n/**\n * Get one of the loaded textures\n * @param {String} textureId The unique ID of the texture loaded by {@link TextureManager#loadTexture2D}\n * @return {Texture} The texture or <code>undefined</code> if no texture exists\n */\nTextureManager.prototype.getTexture = function (textureId) {\n return this._textures[textureId];\n};\n\nfunction fetchTexture2D(textureManager, textureId, textureUniform) {\n textureUniform.resource\n .fetchImage()\n .then(function (image) {\n textureManager._loadedImages.push({\n id: textureId,\n image: image,\n textureUniform: textureUniform,\n });\n })\n .catch(function () {\n const texture = textureManager._textures[textureId];\n if (defined(texture) && texture !== textureManager._defaultTexture) {\n texture.destroy();\n }\n\n textureManager._textures[textureId] = textureManager._defaultTexture;\n });\n}\n\n/**\n * Load a texture 2D asynchronously. Note that {@link TextureManager#update}\n * must be called in the render loop to finish processing the textures.\n *\n * @param {String} textureId A unique ID to identify this texture.\n * @param {TextureUniform} textureUniform A description of the texture\n *\n * @private\n */\nTextureManager.prototype.loadTexture2D = function (textureId, textureUniform) {\n if (defined(textureUniform.typedArray)) {\n this._loadedImages.push({\n id: textureId,\n textureUniform: textureUniform,\n });\n } else {\n fetchTexture2D(this, textureId, textureUniform);\n }\n};\n\nfunction createTexture(textureManager, loadedImage, context) {\n const { id, textureUniform, image } = loadedImage;\n\n // If the context is WebGL1, and the sampler needs mipmaps or repeating\n // boundary conditions, the image may need to be resized first\n const texture = context.webgl2\n ? getTextureAndMips(textureUniform, image, context)\n : getWebGL1Texture(textureUniform, image, context);\n\n // Destroy the old texture once the new one is loaded for more seamless\n // transitions between values\n const oldTexture = textureManager._textures[id];\n if (defined(oldTexture) && oldTexture !== context.defaultTexture) {\n oldTexture.destroy();\n }\n textureManager._textures[id] = texture;\n}\n\nfunction getTextureAndMips(textureUniform, image, context) {\n const { typedArray, sampler } = textureUniform;\n\n const texture = defined(typedArray)\n ? getTextureFromTypedArray(textureUniform, context)\n : new Texture({ context, source: image, sampler });\n\n if (samplerRequiresMipmap(sampler)) {\n texture.generateMipmap();\n }\n\n return texture;\n}\n\nfunction getWebGL1Texture(textureUniform, image, context) {\n const { typedArray, sampler } = textureUniform;\n\n // WebGL1 requires power-of-two texture dimensions for mipmapping and REPEAT wrap modes\n const needMipmap = samplerRequiresMipmap(sampler);\n\n const samplerRepeats =\n sampler.wrapS === TextureWrap.REPEAT ||\n sampler.wrapS === TextureWrap.MIRRORED_REPEAT ||\n sampler.wrapT === TextureWrap.REPEAT ||\n sampler.wrapT === TextureWrap.MIRRORED_REPEAT;\n\n const { width, height } = defined(typedArray) ? textureUniform : image;\n const isPowerOfTwo = [width, height].every(CesiumMath.isPowerOfTwo);\n const requiresResize = (needMipmap || samplerRepeats) && !isPowerOfTwo;\n\n if (!requiresResize) {\n return getTextureAndMips(textureUniform, image, context);\n } else if (!defined(typedArray)) {\n const resizedImage = resizeImageToNextPowerOfTwo(image);\n return getTextureAndMips(textureUniform, resizedImage, context);\n } else if (textureUniform.pixelDatatype === PixelDatatype.UNSIGNED_BYTE) {\n const imageFromArray = getImageFromTypedArray(typedArray, width, height);\n const resizedImage = resizeImageToNextPowerOfTwo(imageFromArray);\n return getTextureAndMips({ sampler }, resizedImage, context);\n }\n\n // typedArray is non-power-of-two but can't be resized. Warn and return raw texture (no mipmaps)\n if (needMipmap) {\n console.warn(\n \"Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly.\"\n );\n } else if (samplerRepeats) {\n console.warn(\n \"Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly.\"\n );\n }\n return getTextureFromTypedArray(textureUniform, context);\n}\n\nfunction samplerRequiresMipmap(sampler) {\n return [\n TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,\n TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,\n TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,\n TextureMinificationFilter.LINEAR_MIPMAP_LINEAR,\n ].includes(sampler.minificationFilter);\n}\n\nfunction getTextureFromTypedArray(textureUniform, context) {\n const {\n pixelFormat,\n pixelDatatype,\n width,\n height,\n typedArray: arrayBufferView,\n sampler,\n } = textureUniform;\n\n return new Texture({\n context,\n pixelFormat,\n pixelDatatype,\n source: { arrayBufferView, width, height },\n sampler,\n flipY: false,\n });\n}\n\nTextureManager.prototype.update = function (frameState) {\n // update only needs to be called once a frame.\n if (frameState.frameNumber === this._lastUpdatedFrame) {\n return;\n }\n this._lastUpdatedFrame = frameState.frameNumber;\n\n const context = frameState.context;\n this._defaultTexture = context.defaultTexture;\n\n // If any images were loaded since the last frame, create Textures\n // for them and store in the uniform dictionary\n const loadedImages = this._loadedImages;\n for (let i = 0; i < loadedImages.length; i++) {\n const loadedImage = loadedImages[i];\n createTexture(this, loadedImage, context);\n }\n loadedImages.length = 0;\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see TextureManager#destroy\n * @private\n */\nTextureManager.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * textureManager = textureManager && textureManager.destroy();\n *\n * @see TextureManager#isDestroyed\n * @private\n */\nTextureManager.prototype.destroy = function () {\n const textures = this._textures;\n for (const texture in textures) {\n if (textures.hasOwnProperty(texture)) {\n const instance = textures[texture];\n if (instance !== this._defaultTexture) {\n instance.destroy();\n }\n }\n }\n return destroyObject(this);\n};\n\nexport default TextureManager;\n", "import Check from \"../../Core/Check.js\";\nimport defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport destroyObject from \"../../Core/destroyObject.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport CustomShaderMode from \"./CustomShaderMode.js\";\nimport UniformType from \"./UniformType.js\";\nimport TextureManager from \"./TextureManager.js\";\nimport CustomShaderTranslucencyMode from \"./CustomShaderTranslucencyMode.js\";\n\n/**\n * An object describing a uniform, its type, and an initial value\n *\n * @typedef {Object} UniformSpecifier\n * @property {UniformType} type The Glsl type of the uniform.\n * @property {Boolean|Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4|TextureUniform} value The initial value of the uniform\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\n\n/**\n * A set of variables parsed from the user-defined shader code. These can be\n * used for optimizations when generating the overall shader. Though they are\n * represented as JS objects, the intended use is like a set, so only the\n * existence of keys matter. The values will always be <code>true</code> if\n * defined. This data structure is used because:\n * <ul>\n * <li>We cannot yet use ES6 Set objects</li>\n * <li>Using a dictionary automatically de-duplicates variable names</li>\n * <li>Queries such as <code>variableSet.hasOwnProperty(\"position\")</code> are straightforward</li>\n * </ul>\n * @typedef {Object<String, Boolean>} VariableSet\n * @private\n */\n\n/**\n * Variable sets parsed from the user-defined vertex shader text.\n * @typedef {Object} VertexVariableSets\n * @property {VariableSet} attributeSet A set of all unique attributes used in the vertex shader via the <code>vsInput.attributes</code> struct.\n * @property {VariableSet} featureIdSet A set of all unique feature ID sets used in the vertex shader via the <code>vsInput.featureIds</code> struct.\n * @property {VariableSet} metadataSet A set of all unique metadata properties used in the vertex shader via the <code>vsInput.metadata</code> struct.\n * @private\n */\n\n/**\n * Variable sets parsed from the user-defined fragment shader text.\n * @typedef {Object} FragmentVariableSets\n * @property {VariableSet} attributeSet A set of all unique attributes used in the fragment shader via the <code>fsInput.attributes</code> struct\n * @property {VariableSet} featureIdSet A set of all unique feature ID sets used in the fragment shader via the <code>fsInput.featureIds</code> struct.\n * @property {VariableSet} metadataSet A set of all unique metadata properties used in the fragment shader via the <code>fsInput.metadata</code> struct.\n * @property {VariableSet} materialSet A set of all material variables such as diffuse, specular or alpha that are used in the fragment shader via the <code>material</code> struct.\n * @private\n */\n\n/**\n * A user defined GLSL shader used with {@link Model} as well\n * as {@link Cesium3DTileset}.\n * <p>\n * If texture uniforms are used, additional resource management must be done:\n * </p>\n * <ul>\n * <li>\n * The <code>update</code> function must be called each frame. When a\n * custom shader is passed to a {@link Model} or a\n * {@link Cesium3DTileset}, this step is handled automaticaly\n * </li>\n * <li>\n * {@link CustomShader#destroy} must be called when the custom shader is\n * no longer needed to clean up GPU resources properly. The application\n * is responsible for calling this method.\n * </li>\n * </ul>\n * <p>\n * See the {@link https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide|Custom Shader Guide} for more detailed documentation.\n * </p>\n *\n * @param {Object} options An object with the following options\n * @param {CustomShaderMode} [options.mode=CustomShaderMode.MODIFY_MATERIAL] The custom shader mode, which determines how the custom shader code is inserted into the fragment shader.\n * @param {LightingModel} [options.lightingModel] The lighting model (e.g. PBR or unlit). If present, this overrides the default lighting for the model.\n * @param {CustomShaderTranslucencyMode} [options.translucencyMode=CustomShaderTranslucencyMode.INHERIT] The translucency mode, which determines how the custom shader will be applied. If the value is CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader will override settings from the model's material. If the value is CustomShaderTransulcencyMode.INHERIT, the custom shader will render as either opaque or translucent depending on the primitive's material settings.\n * @param {Object.<String, UniformSpecifier>} [options.uniforms] A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value\n * @param {Object.<String, VaryingType>} [options.varyings] A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader.\n * @param {String} [options.vertexShaderText] The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the example for the expected signature. If not specified, the custom vertex shader step will be skipped in the computed vertex shader.\n * @param {String} [options.fragmentShaderText] The custom fragment shader as a string of GLSL code. It must include a GLSL function called fragmentMain. See the example for the expected signature. If not specified, the custom fragment shader step will be skipped in the computed fragment shader.\n *\n * @alias CustomShader\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n *\n * @example\n * const customShader = new CustomShader({\n * uniforms: {\n * u_colorIndex: {\n * type: Cesium.UniformType.FLOAT,\n * value: 1.0\n * },\n * u_normalMap: {\n * type: Cesium.UniformType.SAMPLER_2D,\n * value: new Cesium.TextureUniform({\n * url: \"http://example.com/normal.png\"\n * })\n * }\n * },\n * varyings: {\n * v_selectedColor: Cesium.VaryingType.VEC3\n * },\n * vertexShaderText: `\n * void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\n * v_selectedColor = mix(vsInput.attributes.color_0, vsInput.attributes.color_1, u_colorIndex);\n * vsOutput.positionMC += 0.1 * vsInput.attributes.normal;\n * }\n * `,\n * fragmentShaderText: `\n * void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n * material.normal = texture2D(u_normalMap, fsInput.attributes.texCoord_0);\n * material.diffuse = v_selectedColor;\n * }\n * `\n * });\n */\nfunction CustomShader(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n\n /**\n * A value determining how the custom shader interacts with the overall\n * fragment shader. This is used by {@link CustomShaderPipelineStage}\n *\n * @type {CustomShaderMode}\n * @readonly\n */\n this.mode = defaultValue(options.mode, CustomShaderMode.MODIFY_MATERIAL);\n /**\n * The lighting model to use when using the custom shader.\n * This is used by {@link CustomShaderPipelineStage}\n *\n * @type {LightingModel}\n * @readonly\n */\n this.lightingModel = options.lightingModel;\n /**\n * Additional uniforms as declared by the user.\n *\n * @type {Object.<String, UniformSpecifier>}\n * @readonly\n */\n this.uniforms = defaultValue(options.uniforms, defaultValue.EMPTY_OBJECT);\n /**\n * Additional varyings as declared by the user.\n * This is used by {@link CustomShaderPipelineStage}\n *\n * @type {Object.<String, VaryingType>}\n * @readonly\n */\n this.varyings = defaultValue(options.varyings, defaultValue.EMPTY_OBJECT);\n /**\n * The user-defined GLSL code for the vertex shader\n *\n * @type {String}\n * @readonly\n */\n this.vertexShaderText = options.vertexShaderText;\n /**\n * The user-defined GLSL code for the fragment shader\n *\n * @type {String}\n * @readonly\n */\n this.fragmentShaderText = options.fragmentShaderText;\n\n /**\n * The translucency mode, which determines how the custom shader will be applied. If the value is\n * CustomShaderTransulcencyMode.OPAQUE or CustomShaderTransulcencyMode.TRANSLUCENT, the custom shader\n * will override settings from the model's material. If the value isCustomShaderTransulcencyMode.INHERIT,\n * the custom shader will render as either opaque or translucent depending on the primitive's material settings.\n *\n * @type {CustomShaderTranslucencyMode}\n * @default CustomShaderTranslucencyMode.INHERIT\n * @readonly\n */\n this.translucencyMode = defaultValue(\n options.translucencyMode,\n CustomShaderTranslucencyMode.INHERIT\n );\n\n /**\n * texture uniforms require some asynchronous processing. This is delegated\n * to a texture manager.\n *\n * @type {TextureManager}\n * @readonly\n * @private\n */\n this._textureManager = new TextureManager();\n /**\n * The default texture (from the {@link Context}) to use while textures\n * are loading\n *\n * @type {Texture}\n * @readonly\n * @private\n */\n this._defaultTexture = undefined;\n /**\n * The map of uniform names to a function that returns a value. This map\n * is combined with the overall uniform map used by the {@link DrawCommand}\n *\n * @type {Object.<String, Function>}\n * @readonly\n * @private\n */\n this.uniformMap = buildUniformMap(this);\n\n /**\n * A collection of variables used in <code>vertexShaderText</code>. This\n * is used only for optimizations in {@link CustomShaderPipelineStage}.\n * @type {VertexVariableSets}\n * @private\n */\n this.usedVariablesVertex = {\n attributeSet: {},\n featureIdSet: {},\n metadataSet: {},\n };\n /**\n * A collection of variables used in <code>fragmentShaderText</code>. This\n * is used only for optimizations in {@link CustomShaderPipelineStage}.\n * @type {FragmentVariableSets}\n * @private\n */\n this.usedVariablesFragment = {\n attributeSet: {},\n featureIdSet: {},\n metadataSet: {},\n materialSet: {},\n };\n\n findUsedVariables(this);\n validateBuiltinVariables(this);\n}\n\nfunction buildUniformMap(customShader) {\n const uniforms = customShader.uniforms;\n const uniformMap = {};\n for (const uniformName in uniforms) {\n if (uniforms.hasOwnProperty(uniformName)) {\n const uniform = uniforms[uniformName];\n const type = uniform.type;\n if (type === UniformType.SAMPLER_2D) {\n customShader._textureManager.loadTexture2D(uniformName, uniform.value);\n uniformMap[uniformName] = createUniformTexture2DFunction(\n customShader,\n uniformName\n );\n } else {\n uniformMap[uniformName] = createUniformFunction(\n customShader,\n uniformName\n );\n }\n }\n }\n return uniformMap;\n}\n\nfunction createUniformTexture2DFunction(customShader, uniformName) {\n return function () {\n return defaultValue(\n customShader._textureManager.getTexture(uniformName),\n customShader._defaultTexture\n );\n };\n}\n\nfunction createUniformFunction(customShader, uniformName) {\n return function () {\n return customShader.uniforms[uniformName].value;\n };\n}\n\nfunction getVariables(shaderText, regex, outputSet) {\n let match;\n while ((match = regex.exec(shaderText)) !== null) {\n const variableName = match[1];\n\n // Using a dictionary like a set. The value doesn't\n // matter, as this will only be used for queries such as\n // if (set.hasOwnProperty(variableName)) { ... }\n outputSet[variableName] = true;\n }\n}\n\nfunction findUsedVariables(customShader) {\n const attributeRegex = /[vf]sInput\\.attributes\\.(\\w+)/g;\n const featureIdRegex = /[vf]sInput\\.featureIds\\.(\\w+)/g;\n const metadataRegex = /[vf]sInput\\.metadata.(\\w+)/g;\n let attributeSet;\n\n const vertexShaderText = customShader.vertexShaderText;\n if (defined(vertexShaderText)) {\n attributeSet = customShader.usedVariablesVertex.attributeSet;\n getVariables(vertexShaderText, attributeRegex, attributeSet);\n\n attributeSet = customShader.usedVariablesVertex.featureIdSet;\n getVariables(vertexShaderText, featureIdRegex, attributeSet);\n\n attributeSet = customShader.usedVariablesVertex.metadataSet;\n getVariables(vertexShaderText, metadataRegex, attributeSet);\n }\n\n const fragmentShaderText = customShader.fragmentShaderText;\n if (defined(fragmentShaderText)) {\n attributeSet = customShader.usedVariablesFragment.attributeSet;\n getVariables(fragmentShaderText, attributeRegex, attributeSet);\n\n attributeSet = customShader.usedVariablesFragment.featureIdSet;\n getVariables(fragmentShaderText, featureIdRegex, attributeSet);\n\n attributeSet = customShader.usedVariablesFragment.metadataSet;\n getVariables(fragmentShaderText, metadataRegex, attributeSet);\n\n const materialRegex = /material\\.(\\w+)/g;\n const materialSet = customShader.usedVariablesFragment.materialSet;\n getVariables(fragmentShaderText, materialRegex, materialSet);\n }\n}\n\nfunction expandCoordinateAbbreviations(variableName) {\n const modelCoordinatesRegex = /^.*MC$/;\n const worldCoordinatesRegex = /^.*WC$/;\n const eyeCoordinatesRegex = /^.*EC$/;\n\n if (modelCoordinatesRegex.test(variableName)) {\n return `${variableName} (model coordinates)`;\n }\n\n if (worldCoordinatesRegex.test(variableName)) {\n return `${variableName} (Cartesian world coordinates)`;\n }\n\n if (eyeCoordinatesRegex.test(variableName)) {\n return `${variableName} (eye coordinates)`;\n }\n\n return variableName;\n}\n\nfunction validateVariableUsage(\n variableSet,\n incorrectVariable,\n correctVariable,\n vertexOrFragment\n) {\n if (variableSet.hasOwnProperty(incorrectVariable)) {\n const message = `${expandCoordinateAbbreviations(\n incorrectVariable\n )} is not available in the ${vertexOrFragment} shader. Did you mean ${expandCoordinateAbbreviations(\n correctVariable\n )} instead?`;\n throw new DeveloperError(message);\n }\n}\n\nfunction validateBuiltinVariables(customShader) {\n const attributesVS = customShader.usedVariablesVertex.attributeSet;\n\n // names without MC/WC/EC are ambiguous\n validateVariableUsage(attributesVS, \"position\", \"positionMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"normal\", \"normalMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"tangent\", \"tangentMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"bitangent\", \"bitangentMC\", \"vertex\");\n\n // world and eye coordinate positions are only available in the fragment shader.\n validateVariableUsage(attributesVS, \"positionWC\", \"positionMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"positionEC\", \"positionMC\", \"vertex\");\n\n // normal, tangent and bitangent are in model coordinates in the vertex shader\n validateVariableUsage(attributesVS, \"normalEC\", \"normalMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"tangentEC\", \"tangentMC\", \"vertex\");\n validateVariableUsage(attributesVS, \"bitangentEC\", \"bitangentMC\", \"vertex\");\n\n const attributesFS = customShader.usedVariablesFragment.attributeSet;\n\n // names without MC/WC/EC are ambiguous\n validateVariableUsage(attributesFS, \"position\", \"positionEC\", \"fragment\");\n validateVariableUsage(attributesFS, \"normal\", \"normalEC\", \"fragment\");\n validateVariableUsage(attributesFS, \"tangent\", \"tangentEC\", \"fragment\");\n validateVariableUsage(attributesFS, \"bitangent\", \"bitangentEC\", \"fragment\");\n\n // normal, tangent, and bitangent are in eye coordinates in the fragment\n // shader.\n validateVariableUsage(attributesFS, \"normalMC\", \"normalEC\", \"fragment\");\n validateVariableUsage(attributesFS, \"tangentMC\", \"tangentEC\", \"fragment\");\n validateVariableUsage(attributesFS, \"bitangentMC\", \"bitangentEC\", \"fragment\");\n}\n\n/**\n * Update the value of a uniform declared in the shader\n * @param {String} uniformName The GLSL name of the uniform. This must match one of the uniforms declared in the constructor\n * @param {Boolean|Number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4|String|Resource} value The new value of the uniform.\n */\nCustomShader.prototype.setUniform = function (uniformName, value) {\nconst uniform = this.uniforms[uniformName];\n if (uniform.type === UniformType.SAMPLER_2D) {\n // Textures are loaded asynchronously\n this._textureManager.loadTexture2D(uniformName, value);\n } else if (defined(value.clone)) {\n // clone Cartesian and Matrix types.\n uniform.value = value.clone(uniform.value);\n } else {\n uniform.value = value;\n }\n};\n\nCustomShader.prototype.update = function (frameState) {\n this._defaultTexture = frameState.context.defaultTexture;\n this._textureManager.update(frameState);\n};\n\n/**\n * Returns true if this object was destroyed; otherwise, false.\n * <br /><br />\n * If this object was destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.\n *\n * @returns {Boolean} True if this object was destroyed; otherwise, false.\n *\n * @see CustomShader#destroy\n * @private\n */\nCustomShader.prototype.isDestroyed = function () {\n return false;\n};\n\n/**\n * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic\n * release of WebGL resources, instead of relying on the garbage collector to destroy this object.\n * <br /><br />\n * Once an object is destroyed, it should not be used; calling any function other than\n * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,\n * assign the return value (<code>undefined</code>) to the object as done in the example.\n *\n * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.\n *\n * @example\n * customShader = customShader && customShader.destroy();\n *\n * @see CustomShader#isDestroyed\n * @private\n */\nCustomShader.prototype.destroy = function () {\n this._textureManager = this._textureManager && this._textureManager.destroy();\n destroyObject(this);\n};\n\nexport default CustomShader;\n", "import defaultValue from \"../../Core/defaultValue.js\";\nimport defined from \"../../Core/defined.js\";\nimport DeveloperError from \"../../Core/DeveloperError.js\";\nimport Resource from \"../../Core/Resource.js\";\nimport PixelFormat from \"../../Core/PixelFormat.js\";\nimport PixelDatatype from \"../../Renderer/PixelDatatype.js\";\nimport Sampler from \"../../Renderer/Sampler.js\";\nimport TextureWrap from \"../../Renderer/TextureWrap.js\";\n\n/**\n * A simple struct that serves as a value of a <code>sampler2D</code>-valued\n * uniform. This is used with {@link CustomShader} and {@link TextureManager}\n *\n * @param {Object} options An object with the following properties:\n * @param {Uint8Array} [options.typedArray] A typed array storing the contents of a texture. Values are stored in row-major order. Since WebGL uses a y-up convention for textures, rows are listed from bottom to top.\n * @param {Number} [options.width] The width of the image. Required when options.typedArray is present\n * @param {Number} [options.height] The height of the image. Required when options.typedArray is present.\n * @param {String|Resource} [options.url] A URL string or resource pointing to a texture image.\n * @param {Boolean} [options.repeat=true] When defined, the texture sampler will be set to wrap in both directions\n * @param {PixelFormat} [options.pixelFormat=PixelFormat.RGBA] When options.typedArray is defined, this is used to determine the pixel format of the texture\n * @param {PixelDatatype} [options.pixelDatatype=PixelDatatype.UNSIGNED_BYTE] When options.typedArray is defined, this is the data type of pixel values in the typed array.\n * @param {TextureMinificationFilter} [options.minificationFilter=TextureMinificationFilter.LINEAR] The minification filter of the texture sampler.\n * @param {TextureMagnificationFilter} [options.magnificationFilter=TextureMagnificationFilter.LINEAR] The magnification filter of the texture sampler.\n * @param {Number} [options.maximumAnisotropy=1.0] The maximum anisotropy of the texture sampler\n *\n * @alias TextureUniform\n * @constructor\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nfunction TextureUniform(options) {\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\n this.typedArray = options.typedArray;\n this.width = options.width;\n this.height = options.height;\n this.pixelFormat = defaultValue(options.pixelFormat, PixelFormat.RGBA);\n this.pixelDatatype = defaultValue(\n options.pixelDatatype,\n PixelDatatype.UNSIGNED_BYTE\n );\n\n let resource = options.url;\n if (typeof resource === \"string\") {\n resource = Resource.createIfNeeded(resource);\n }\n this.resource = resource;\n\n const repeat = defaultValue(options.repeat, true);\n const wrap = repeat ? TextureWrap.REPEAT : TextureWrap.CLAMP_TO_EDGE;\n this.sampler = new Sampler({\n wrapS: wrap,\n wrapT: wrap,\n minificationFilter: options.minificationFilter,\n magnificationFilter: options.magnificationFilter,\n maximumAnisotropy: options.maximumAnisotropy,\n });\n}\n\nexport default TextureUniform;\n", "/**\n * An enum for the GLSL varying types. These can be used for declaring varyings\n * in {@link CustomShader}\n *\n * @enum {String}\n *\n * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.\n */\nconst VaryingType = {\n /**\n * A single floating point value.\n *\n * @type {String}\n * @constant\n */\n FLOAT: \"float\",\n /**\n * A vector of 2 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC2: \"vec2\",\n /**\n * A vector of 3 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC3: \"vec3\",\n /**\n * A vector of 4 floating point values.\n *\n * @type {String}\n * @constant\n */\n VEC4: \"vec4\",\n /**\n * A 2x2 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT2: \"mat2\",\n /**\n * A 3x3 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT3: \"mat2\",\n /**\n * A 3x3 matrix of floating point values.\n *\n * @type {String}\n * @constant\n */\n MAT4: \"mat4\",\n};\n\nexport default Object.freeze(VaryingType);\n", "import defaultValue from \"../Core/defaultValue.js\";\nimport defined from \"../Core/defined.js\";\nimport formatError from \"../Core/formatError.js\";\n\n// createXXXGeometry functions may return Geometry or a Promise that resolves to Geometry\n// if the function requires access to ApproximateTerrainHeights.\n// For fully synchronous functions, just wrapping the function call in a Promise doesn't\n// handle errors correctly, hence try-catch\nfunction callAndWrap(workerFunction, parameters, transferableObjects) {\n let resultOrPromise;\n try {\n resultOrPromise = workerFunction(parameters, transferableObjects);\n return resultOrPromise; // errors handled by Promise\n } catch (e) {\n return Promise.reject(e);\n }\n}\n\n/**\n * Creates an adapter function to allow a calculation function to operate as a Web Worker,\n * paired with TaskProcessor, to receive tasks and return results.\n *\n * @function createTaskProcessorWorker\n *\n * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function,\n * which takes parameters and returns a result.\n * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the\n * calculation function to work as a Web Worker onmessage listener with TaskProcessor.\n *\n *\n * @example\n * function doCalculation(parameters, transferableObjects) {\n * // calculate some result using the inputs in parameters\n * return result;\n * }\n *\n * return Cesium.createTaskProcessorWorker(doCalculation);\n * // the resulting function is compatible with TaskProcessor\n *\n * @see TaskProcessor\n * @see {@link http://www.w3.org/TR/workers/|Web Workers}\n * @see {@link http://www.w3.org/TR/html5/common-dom-interfaces.html#transferable-objects|Transferable objects}\n */\nfunction createTaskProcessorWorker(workerFunction) {\n let postMessage;\n\n return function (event) {\n const data = event.data;\n\n const transferableObjects = [];\n const responseMessage = {\n id: data.id,\n result: undefined,\n error: undefined,\n };\n\n return Promise.resolve(\n callAndWrap(workerFunction, data.parameters, transferableObjects)\n )\n .then(function (result) {\n responseMessage.result = result;\n })\n .catch(function (e) {\n if (e instanceof Error) {\n // Errors can't be posted in a message, copy the properties\n responseMessage.error = {\n name: e.name,\n message: e.message,\n stack: e.stack,\n };\n } else {\n responseMessage.error = e;\n }\n })\n .finally(function () {\n if (!defined(postMessage)) {\n postMessage = defaultValue(self.webkitPostMessage, self.postMessage);\n }\n\n if (!data.canTransferArrayBuffer) {\n transferableObjects.length = 0;\n }\n\n try {\n postMessage(responseMessage, transferableObjects);\n } catch (e) {\n // something went wrong trying to post the message, post a simpler\n // error that we can be sure will be cloneable\n responseMessage.result = undefined;\n responseMessage.error = `postMessage failed with error: ${formatError(\n e\n )}\\n with responseMessage: ${JSON.stringify(responseMessage)}`;\n postMessage(responseMessage);\n }\n });\n };\n}\n\n/**\n * A function that performs a calculation in a Web Worker.\n * @callback createTaskProcessorWorker.WorkerFunction\n *\n * @param {Object} parameters Parameters to the calculation.\n * @param {Array} transferableObjects An array that should be filled with references to objects inside\n * the result that should be transferred back to the main document instead of copied.\n * @returns {Object} The result of the calculation.\n *\n * @example\n * function calculate(parameters, transferableObjects) {\n * // perform whatever calculation is necessary.\n * const typedArray = new Float32Array(0);\n *\n * // typed arrays are transferable\n * transferableObjects.push(typedArray)\n *\n * return {\n * typedArray : typedArray\n * };\n * }\n */\n\n/**\n * A Web Worker message event handler function that handles the interaction with TaskProcessor,\n * specifically, task ID management and posting a response message containing the result.\n * @callback createTaskProcessorWorker.TaskProcessorWorkerFunction\n *\n * @param {Object} event The onmessage event object.\n */\nexport default createTaskProcessorWorker;\n", "export const VERSION = '1.98';\nexport { default as BillboardGraphics } from './DataSources/BillboardGraphics.js';\r\nexport { default as BillboardVisualizer } from './DataSources/BillboardVisualizer.js';\r\nexport { default as BoundingSphereState } from './DataSources/BoundingSphereState.js';\r\nexport { default as BoxGeometryUpdater } from './DataSources/BoxGeometryUpdater.js';\r\nexport { default as BoxGraphics } from './DataSources/BoxGraphics.js';\r\nexport { default as CallbackProperty } from './DataSources/CallbackProperty.js';\r\nexport { default as Cesium3DTilesetGraphics } from './DataSources/Cesium3DTilesetGraphics.js';\r\nexport { default as Cesium3DTilesetVisualizer } from './DataSources/Cesium3DTilesetVisualizer.js';\r\nexport { default as CheckerboardMaterialProperty } from './DataSources/CheckerboardMaterialProperty.js';\r\nexport { default as ColorMaterialProperty } from './DataSources/ColorMaterialProperty.js';\r\nexport { default as CompositeEntityCollection } from './DataSources/CompositeEntityCollection.js';\r\nexport { default as CompositeMaterialProperty } from './DataSources/CompositeMaterialProperty.js';\r\nexport { default as CompositePositionProperty } from './DataSources/CompositePositionProperty.js';\r\nexport { default as CompositeProperty } from './DataSources/CompositeProperty.js';\r\nexport { default as ConstantPositionProperty } from './DataSources/ConstantPositionProperty.js';\r\nexport { default as ConstantProperty } from './DataSources/ConstantProperty.js';\r\nexport { default as CorridorGeometryUpdater } from './DataSources/CorridorGeometryUpdater.js';\r\nexport { default as CorridorGraphics } from './DataSources/CorridorGraphics.js';\r\nexport { default as createMaterialPropertyDescriptor } from './DataSources/createMaterialPropertyDescriptor.js';\r\nexport { default as createPropertyDescriptor } from './DataSources/createPropertyDescriptor.js';\r\nexport { default as createRawPropertyDescriptor } from './DataSources/createRawPropertyDescriptor.js';\r\nexport { default as CustomDataSource } from './DataSources/CustomDataSource.js';\r\nexport { default as CylinderGeometryUpdater } from './DataSources/CylinderGeometryUpdater.js';\r\nexport { default as CylinderGraphics } from './DataSources/CylinderGraphics.js';\r\nexport { default as CzmlDataSource } from './DataSources/CzmlDataSource.js';\r\nexport { default as DataSource } from './DataSources/DataSource.js';\r\nexport { default as DataSourceClock } from './DataSources/DataSourceClock.js';\r\nexport { default as DataSourceCollection } from './DataSources/DataSourceCollection.js';\r\nexport { default as DataSourceDisplay } from './DataSources/DataSourceDisplay.js';\r\nexport { default as DynamicGeometryBatch } from './DataSources/DynamicGeometryBatch.js';\r\nexport { default as DynamicGeometryUpdater } from './DataSources/DynamicGeometryUpdater.js';\r\nexport { default as EllipseGeometryUpdater } from './DataSources/EllipseGeometryUpdater.js';\r\nexport { default as EllipseGraphics } from './DataSources/EllipseGraphics.js';\r\nexport { default as EllipsoidGeometryUpdater } from './DataSources/EllipsoidGeometryUpdater.js';\r\nexport { default as EllipsoidGraphics } from './DataSources/EllipsoidGraphics.js';\r\nexport { default as Entity } from './DataSources/Entity.js';\r\nexport { default as EntityCluster } from './DataSources/EntityCluster.js';\r\nexport { default as EntityCollection } from './DataSources/EntityCollection.js';\r\nexport { default as EntityView } from './DataSources/EntityView.js';\r\nexport { default as exportKml } from './DataSources/exportKml.js';\r\nexport { default as GeoJsonDataSource } from './DataSources/GeoJsonDataSource.js';\r\nexport { default as GeometryUpdater } from './DataSources/GeometryUpdater.js';\r\nexport { default as GeometryVisualizer } from './DataSources/GeometryVisualizer.js';\r\nexport { default as GpxDataSource } from './DataSources/GpxDataSource.js';\r\nexport { default as GridMaterialProperty } from './DataSources/GridMaterialProperty.js';\r\nexport { default as GroundGeometryUpdater } from './DataSources/GroundGeometryUpdater.js';\r\nexport { default as heightReferenceOnEntityPropertyChanged } from './DataSources/heightReferenceOnEntityPropertyChanged.js';\r\nexport { default as ImageMaterialProperty } from './DataSources/ImageMaterialProperty.js';\r\nexport { default as KmlCamera } from './DataSources/KmlCamera.js';\r\nexport { default as KmlDataSource } from './DataSources/KmlDataSource.js';\r\nexport { default as KmlLookAt } from './DataSources/KmlLookAt.js';\r\nexport { default as KmlTour } from './DataSources/KmlTour.js';\r\nexport { default as KmlTourFlyTo } from './DataSources/KmlTourFlyTo.js';\r\nexport { default as KmlTourWait } from './DataSources/KmlTourWait.js';\r\nexport { default as LabelGraphics } from './DataSources/LabelGraphics.js';\r\nexport { default as LabelVisualizer } from './DataSources/LabelVisualizer.js';\r\nexport { default as MaterialProperty } from './DataSources/MaterialProperty.js';\r\nexport { default as ModelGraphics } from './DataSources/ModelGraphics.js';\r\nexport { default as ModelVisualizer } from './DataSources/ModelVisualizer.js';\r\nexport { default as NodeTransformationProperty } from './DataSources/NodeTransformationProperty.js';\r\nexport { default as PathGraphics } from './DataSources/PathGraphics.js';\r\nexport { default as PathVisualizer } from './DataSources/PathVisualizer.js';\r\nexport { default as PlaneGeometryUpdater } from './DataSources/PlaneGeometryUpdater.js';\r\nexport { default as PlaneGraphics } from './DataSources/PlaneGraphics.js';\r\nexport { default as PointGraphics } from './DataSources/PointGraphics.js';\r\nexport { default as PointVisualizer } from './DataSources/PointVisualizer.js';\r\nexport { default as PolygonGeometryUpdater } from './DataSources/PolygonGeometryUpdater.js';\r\nexport { default as PolygonGraphics } from './DataSources/PolygonGraphics.js';\r\nexport { default as PolylineArrowMaterialProperty } from './DataSources/PolylineArrowMaterialProperty.js';\r\nexport { default as PolylineDashMaterialProperty } from './DataSources/PolylineDashMaterialProperty.js';\r\nexport { default as PolylineGeometryUpdater } from './DataSources/PolylineGeometryUpdater.js';\r\nexport { default as PolylineGlowMaterialProperty } from './DataSources/PolylineGlowMaterialProperty.js';\r\nexport { default as PolylineGraphics } from './DataSources/PolylineGraphics.js';\r\nexport { default as PolylineOutlineMaterialProperty } from './DataSources/PolylineOutlineMaterialProperty.js';\r\nexport { default as PolylineVisualizer } from './DataSources/PolylineVisualizer.js';\r\nexport { default as PolylineVolumeGeometryUpdater } from './DataSources/PolylineVolumeGeometryUpdater.js';\r\nexport { default as PolylineVolumeGraphics } from './DataSources/PolylineVolumeGraphics.js';\r\nexport { default as PositionProperty } from './DataSources/PositionProperty.js';\r\nexport { default as PositionPropertyArray } from './DataSources/PositionPropertyArray.js';\r\nexport { default as Property } from './DataSources/Property.js';\r\nexport { default as PropertyArray } from './DataSources/PropertyArray.js';\r\nexport { default as PropertyBag } from './DataSources/PropertyBag.js';\r\nexport { default as RectangleGeometryUpdater } from './DataSources/RectangleGeometryUpdater.js';\r\nexport { default as RectangleGraphics } from './DataSources/RectangleGraphics.js';\r\nexport { default as ReferenceProperty } from './DataSources/ReferenceProperty.js';\r\nexport { default as Rotation } from './DataSources/Rotation.js';\r\nexport { default as SampledPositionProperty } from './DataSources/SampledPositionProperty.js';\r\nexport { default as SampledProperty } from './DataSources/SampledProperty.js';\r\nexport { default as ScaledPositionProperty } from './DataSources/ScaledPositionProperty.js';\r\nexport { default as StaticGeometryColorBatch } from './DataSources/StaticGeometryColorBatch.js';\r\nexport { default as StaticGeometryPerMaterialBatch } from './DataSources/StaticGeometryPerMaterialBatch.js';\r\nexport { default as StaticGroundGeometryColorBatch } from './DataSources/StaticGroundGeometryColorBatch.js';\r\nexport { default as StaticGroundGeometryPerMaterialBatch } from './DataSources/StaticGroundGeometryPerMaterialBatch.js';\r\nexport { default as StaticGroundPolylinePerMaterialBatch } from './DataSources/StaticGroundPolylinePerMaterialBatch.js';\r\nexport { default as StaticOutlineGeometryBatch } from './DataSources/StaticOutlineGeometryBatch.js';\r\nexport { default as StripeMaterialProperty } from './DataSources/StripeMaterialProperty.js';\r\nexport { default as StripeOrientation } from './DataSources/StripeOrientation.js';\r\nexport { default as TerrainOffsetProperty } from './DataSources/TerrainOffsetProperty.js';\r\nexport { default as TimeIntervalCollectionPositionProperty } from './DataSources/TimeIntervalCollectionPositionProperty.js';\r\nexport { default as TimeIntervalCollectionProperty } from './DataSources/TimeIntervalCollectionProperty.js';\r\nexport { default as VelocityOrientationProperty } from './DataSources/VelocityOrientationProperty.js';\r\nexport { default as VelocityVectorProperty } from './DataSources/VelocityVectorProperty.js';\r\nexport { default as Visualizer } from './DataSources/Visualizer.js';\r\nexport { default as WallGeometryUpdater } from './DataSources/WallGeometryUpdater.js';\r\nexport { default as WallGraphics } from './DataSources/WallGraphics.js';\r\nexport { default as AutomaticUniforms } from './Renderer/AutomaticUniforms.js';\r\nexport { default as Buffer } from './Renderer/Buffer.js';\r\nexport { default as BufferUsage } from './Renderer/BufferUsage.js';\r\nexport { default as ClearCommand } from './Renderer/ClearCommand.js';\r\nexport { default as ComputeCommand } from './Renderer/ComputeCommand.js';\r\nexport { default as ComputeEngine } from './Renderer/ComputeEngine.js';\r\nexport { default as Context } from './Renderer/Context.js';\r\nexport { default as ContextLimits } from './Renderer/ContextLimits.js';\r\nexport { default as createUniform } from './Renderer/createUniform.js';\r\nexport { default as createUniformArray } from './Renderer/createUniformArray.js';\r\nexport { default as CubeMap } from './Renderer/CubeMap.js';\r\nexport { default as CubeMapFace } from './Renderer/CubeMapFace.js';\r\nexport { default as DrawCommand } from './Renderer/DrawCommand.js';\r\nexport { default as Framebuffer } from './Renderer/Framebuffer.js';\r\nexport { default as FramebufferManager } from './Renderer/FramebufferManager.js';\r\nexport { default as freezeRenderState } from './Renderer/freezeRenderState.js';\r\nexport { default as loadCubeMap } from './Renderer/loadCubeMap.js';\r\nexport { default as MipmapHint } from './Renderer/MipmapHint.js';\r\nexport { default as modernizeShader } from './Renderer/modernizeShader.js';\r\nexport { default as MultisampleFramebuffer } from './Renderer/MultisampleFramebuffer.js';\r\nexport { default as Pass } from './Renderer/Pass.js';\r\nexport { default as PassState } from './Renderer/PassState.js';\r\nexport { default as PixelDatatype } from './Renderer/PixelDatatype.js';\r\nexport { default as Renderbuffer } from './Renderer/Renderbuffer.js';\r\nexport { default as RenderbufferFormat } from './Renderer/RenderbufferFormat.js';\r\nexport { default as RenderState } from './Renderer/RenderState.js';\r\nexport { default as Sampler } from './Renderer/Sampler.js';\r\nexport { default as ShaderBuilder } from './Renderer/ShaderBuilder.js';\r\nexport { default as ShaderCache } from './Renderer/ShaderCache.js';\r\nexport { default as ShaderDestination } from './Renderer/ShaderDestination.js';\r\nexport { default as ShaderFunction } from './Renderer/ShaderFunction.js';\r\nexport { default as ShaderProgram } from './Renderer/ShaderProgram.js';\r\nexport { default as ShaderSource } from './Renderer/ShaderSource.js';\r\nexport { default as ShaderStruct } from './Renderer/ShaderStruct.js';\r\nexport { default as Texture } from './Renderer/Texture.js';\r\nexport { default as TextureCache } from './Renderer/TextureCache.js';\r\nexport { default as TextureMagnificationFilter } from './Renderer/TextureMagnificationFilter.js';\r\nexport { default as TextureMinificationFilter } from './Renderer/TextureMinificationFilter.js';\r\nexport { default as TextureWrap } from './Renderer/TextureWrap.js';\r\nexport { default as UniformState } from './Renderer/UniformState.js';\r\nexport { default as VertexArray } from './Renderer/VertexArray.js';\r\nexport { default as VertexArrayFacade } from './Renderer/VertexArrayFacade.js';\r\nexport { default as appendForwardSlash } from './Core/appendForwardSlash.js';\r\nexport { default as ApproximateTerrainHeights } from './Core/ApproximateTerrainHeights.js';\r\nexport { default as ArcGISTiledElevationTerrainProvider } from './Core/ArcGISTiledElevationTerrainProvider.js';\r\nexport { default as ArcType } from './Core/ArcType.js';\r\nexport { default as arrayRemoveDuplicates } from './Core/arrayRemoveDuplicates.js';\r\nexport { default as ArticulationStageType } from './Core/ArticulationStageType.js';\r\nexport { default as AssociativeArray } from './Core/AssociativeArray.js';\r\nexport { default as AttributeCompression } from './Core/AttributeCompression.js';\r\nexport { default as AxisAlignedBoundingBox } from './Core/AxisAlignedBoundingBox.js';\r\nexport { default as barycentricCoordinates } from './Core/barycentricCoordinates.js';\r\nexport { default as binarySearch } from './Core/binarySearch.js';\r\nexport { default as BingMapsGeocoderService } from './Core/BingMapsGeocoderService.js';\r\nexport { default as BoundingRectangle } from './Core/BoundingRectangle.js';\r\nexport { default as BoundingSphere } from './Core/BoundingSphere.js';\r\nexport { default as BoxGeometry } from './Core/BoxGeometry.js';\r\nexport { default as BoxOutlineGeometry } from './Core/BoxOutlineGeometry.js';\r\nexport { default as buildModuleUrl } from './Core/buildModuleUrl.js';\r\nexport { default as cancelAnimationFrame } from './Core/cancelAnimationFrame.js';\r\nexport { default as Cartesian2 } from './Core/Cartesian2.js';\r\nexport { default as Cartesian3 } from './Core/Cartesian3.js';\r\nexport { default as Cartesian4 } from './Core/Cartesian4.js';\r\nexport { default as Cartographic } from './Core/Cartographic.js';\r\nexport { default as CartographicGeocoderService } from './Core/CartographicGeocoderService.js';\r\nexport { default as CatmullRomSpline } from './Core/CatmullRomSpline.js';\r\nexport { default as CesiumTerrainProvider } from './Core/CesiumTerrainProvider.js';\r\nexport { default as Check } from './Core/Check.js';\r\nexport { default as CircleGeometry } from './Core/CircleGeometry.js';\r\nexport { default as CircleOutlineGeometry } from './Core/CircleOutlineGeometry.js';\r\nexport { default as Clock } from './Core/Clock.js';\r\nexport { default as ClockRange } from './Core/ClockRange.js';\r\nexport { default as ClockStep } from './Core/ClockStep.js';\r\nexport { default as clone } from './Core/clone.js';\r\nexport { default as Color } from './Core/Color.js';\r\nexport { default as ColorGeometryInstanceAttribute } from './Core/ColorGeometryInstanceAttribute.js';\r\nexport { default as combine } from './Core/combine.js';\r\nexport { default as ComponentDatatype } from './Core/ComponentDatatype.js';\r\nexport { default as CompressedTextureBuffer } from './Core/CompressedTextureBuffer.js';\r\nexport { default as ConstantSpline } from './Core/ConstantSpline.js';\r\nexport { default as CoplanarPolygonGeometry } from './Core/CoplanarPolygonGeometry.js';\r\nexport { default as CoplanarPolygonGeometryLibrary } from './Core/CoplanarPolygonGeometryLibrary.js';\r\nexport { default as CoplanarPolygonOutlineGeometry } from './Core/CoplanarPolygonOutlineGeometry.js';\r\nexport { default as CornerType } from './Core/CornerType.js';\r\nexport { default as CorridorGeometry } from './Core/CorridorGeometry.js';\r\nexport { default as CorridorGeometryLibrary } from './Core/CorridorGeometryLibrary.js';\r\nexport { default as CorridorOutlineGeometry } from './Core/CorridorOutlineGeometry.js';\r\nexport { default as createGuid } from './Core/createGuid.js';\r\nexport { default as createWorldTerrain } from './Core/createWorldTerrain.js';\r\nexport { default as Credit } from './Core/Credit.js';\r\nexport { default as CubicRealPolynomial } from './Core/CubicRealPolynomial.js';\r\nexport { default as CullingVolume } from './Core/CullingVolume.js';\r\nexport { default as CustomHeightmapTerrainProvider } from './Core/CustomHeightmapTerrainProvider.js';\r\nexport { default as CylinderGeometry } from './Core/CylinderGeometry.js';\r\nexport { default as CylinderGeometryLibrary } from './Core/CylinderGeometryLibrary.js';\r\nexport { default as CylinderOutlineGeometry } from './Core/CylinderOutlineGeometry.js';\r\nexport { default as decodeGoogleEarthEnterpriseData } from './Core/decodeGoogleEarthEnterpriseData.js';\r\nexport { default as decodeVectorPolylinePositions } from './Core/decodeVectorPolylinePositions.js';\r\nexport { default as DefaultProxy } from './Core/DefaultProxy.js';\r\nexport { default as defaultValue } from './Core/defaultValue.js';\r\nexport { default as defer } from './Core/defer.js';\r\nexport { default as defined } from './Core/defined.js';\r\nexport { default as deprecationWarning } from './Core/deprecationWarning.js';\r\nexport { default as destroyObject } from './Core/destroyObject.js';\r\nexport { default as DeveloperError } from './Core/DeveloperError.js';\r\nexport { default as DistanceDisplayCondition } from './Core/DistanceDisplayCondition.js';\r\nexport { default as DistanceDisplayConditionGeometryInstanceAttribute } from './Core/DistanceDisplayConditionGeometryInstanceAttribute.js';\r\nexport { default as DoubleEndedPriorityQueue } from './Core/DoubleEndedPriorityQueue.js';\r\nexport { default as DoublyLinkedList } from './Core/DoublyLinkedList.js';\r\nexport { default as EarthOrientationParameters } from './Core/EarthOrientationParameters.js';\r\nexport { default as EarthOrientationParametersSample } from './Core/EarthOrientationParametersSample.js';\r\nexport { default as EasingFunction } from './Core/EasingFunction.js';\r\nexport { default as EllipseGeometry } from './Core/EllipseGeometry.js';\r\nexport { default as EllipseGeometryLibrary } from './Core/EllipseGeometryLibrary.js';\r\nexport { default as EllipseOutlineGeometry } from './Core/EllipseOutlineGeometry.js';\r\nexport { default as Ellipsoid } from './Core/Ellipsoid.js';\r\nexport { default as EllipsoidalOccluder } from './Core/EllipsoidalOccluder.js';\r\nexport { default as EllipsoidGeodesic } from './Core/EllipsoidGeodesic.js';\r\nexport { default as EllipsoidGeometry } from './Core/EllipsoidGeometry.js';\r\nexport { default as EllipsoidOutlineGeometry } from './Core/EllipsoidOutlineGeometry.js';\r\nexport { default as EllipsoidRhumbLine } from './Core/EllipsoidRhumbLine.js';\r\nexport { default as EllipsoidTangentPlane } from './Core/EllipsoidTangentPlane.js';\r\nexport { default as EllipsoidTerrainProvider } from './Core/EllipsoidTerrainProvider.js';\r\nexport { default as EncodedCartesian3 } from './Core/EncodedCartesian3.js';\r\nexport { default as Event } from './Core/Event.js';\r\nexport { default as EventHelper } from './Core/EventHelper.js';\r\nexport { default as ExtrapolationType } from './Core/ExtrapolationType.js';\r\nexport { default as FeatureDetection } from './Core/FeatureDetection.js';\r\nexport { default as formatError } from './Core/formatError.js';\r\nexport { default as FrustumGeometry } from './Core/FrustumGeometry.js';\r\nexport { default as FrustumOutlineGeometry } from './Core/FrustumOutlineGeometry.js';\r\nexport { default as Fullscreen } from './Core/Fullscreen.js';\r\nexport { default as GeocoderService } from './Core/GeocoderService.js';\r\nexport { default as GeocodeType } from './Core/GeocodeType.js';\r\nexport { default as GeographicProjection } from './Core/GeographicProjection.js';\r\nexport { default as GeographicTilingScheme } from './Core/GeographicTilingScheme.js';\r\nexport { default as Geometry } from './Core/Geometry.js';\r\nexport { default as GeometryAttribute } from './Core/GeometryAttribute.js';\r\nexport { default as GeometryAttributes } from './Core/GeometryAttributes.js';\r\nexport { default as GeometryFactory } from './Core/GeometryFactory.js';\r\nexport { default as GeometryInstance } from './Core/GeometryInstance.js';\r\nexport { default as GeometryInstanceAttribute } from './Core/GeometryInstanceAttribute.js';\r\nexport { default as GeometryOffsetAttribute } from './Core/GeometryOffsetAttribute.js';\r\nexport { default as GeometryPipeline } from './Core/GeometryPipeline.js';\r\nexport { default as GeometryType } from './Core/GeometryType.js';\r\nexport { default as getAbsoluteUri } from './Core/getAbsoluteUri.js';\r\nexport { default as getBaseUri } from './Core/getBaseUri.js';\r\nexport { default as getExtensionFromUri } from './Core/getExtensionFromUri.js';\r\nexport { default as getFilenameFromUri } from './Core/getFilenameFromUri.js';\r\nexport { default as getImageFromTypedArray } from './Core/getImageFromTypedArray.js';\r\nexport { default as getImagePixels } from './Core/getImagePixels.js';\r\nexport { default as getJsonFromTypedArray } from './Core/getJsonFromTypedArray.js';\r\nexport { default as getMagic } from './Core/getMagic.js';\r\nexport { default as getStringFromTypedArray } from './Core/getStringFromTypedArray.js';\r\nexport { default as getTimestamp } from './Core/getTimestamp.js';\r\nexport { default as GoogleEarthEnterpriseMetadata } from './Core/GoogleEarthEnterpriseMetadata.js';\r\nexport { default as GoogleEarthEnterpriseTerrainData } from './Core/GoogleEarthEnterpriseTerrainData.js';\r\nexport { default as GoogleEarthEnterpriseTerrainProvider } from './Core/GoogleEarthEnterpriseTerrainProvider.js';\r\nexport { default as GoogleEarthEnterpriseTileInformation } from './Core/GoogleEarthEnterpriseTileInformation.js';\r\nexport { default as GregorianDate } from './Core/GregorianDate.js';\r\nexport { default as GroundPolylineGeometry } from './Core/GroundPolylineGeometry.js';\r\nexport { default as HeadingPitchRange } from './Core/HeadingPitchRange.js';\r\nexport { default as HeadingPitchRoll } from './Core/HeadingPitchRoll.js';\r\nexport { default as Heap } from './Core/Heap.js';\r\nexport { default as HeightmapEncoding } from './Core/HeightmapEncoding.js';\r\nexport { default as HeightmapTerrainData } from './Core/HeightmapTerrainData.js';\r\nexport { default as HeightmapTessellator } from './Core/HeightmapTessellator.js';\r\nexport { default as HermitePolynomialApproximation } from './Core/HermitePolynomialApproximation.js';\r\nexport { default as HermiteSpline } from './Core/HermiteSpline.js';\r\nexport { default as HilbertOrder } from './Core/HilbertOrder.js';\r\nexport { default as Iau2000Orientation } from './Core/Iau2000Orientation.js';\r\nexport { default as Iau2006XysData } from './Core/Iau2006XysData.js';\r\nexport { default as Iau2006XysSample } from './Core/Iau2006XysSample.js';\r\nexport { default as IauOrientationAxes } from './Core/IauOrientationAxes.js';\r\nexport { default as IauOrientationParameters } from './Core/IauOrientationParameters.js';\r\nexport { default as IndexDatatype } from './Core/IndexDatatype.js';\r\nexport { default as InterpolationAlgorithm } from './Core/InterpolationAlgorithm.js';\r\nexport { default as InterpolationType } from './Core/InterpolationType.js';\r\nexport { default as Intersect } from './Core/Intersect.js';\r\nexport { default as Intersections2D } from './Core/Intersections2D.js';\r\nexport { default as IntersectionTests } from './Core/IntersectionTests.js';\r\nexport { default as Interval } from './Core/Interval.js';\r\nexport { default as Ion } from './Core/Ion.js';\r\nexport { default as IonGeocoderService } from './Core/IonGeocoderService.js';\r\nexport { default as IonResource } from './Core/IonResource.js';\r\nexport { default as isBitSet } from './Core/isBitSet.js';\r\nexport { default as isBlobUri } from './Core/isBlobUri.js';\r\nexport { default as isCrossOriginUrl } from './Core/isCrossOriginUrl.js';\r\nexport { default as isDataUri } from './Core/isDataUri.js';\r\nexport { default as isLeapYear } from './Core/isLeapYear.js';\r\nexport { default as Iso8601 } from './Core/Iso8601.js';\r\nexport { default as JulianDate } from './Core/JulianDate.js';\r\nexport { default as KeyboardEventModifier } from './Core/KeyboardEventModifier.js';\r\nexport { default as KTX2Transcoder } from './Core/KTX2Transcoder.js';\r\nexport { default as LagrangePolynomialApproximation } from './Core/LagrangePolynomialApproximation.js';\r\nexport { default as LeapSecond } from './Core/LeapSecond.js';\r\nexport { default as LinearApproximation } from './Core/LinearApproximation.js';\r\nexport { default as LinearSpline } from './Core/LinearSpline.js';\r\nexport { default as loadAndExecuteScript } from './Core/loadAndExecuteScript.js';\r\nexport { default as loadImageFromTypedArray } from './Core/loadImageFromTypedArray.js';\r\nexport { default as loadKTX2 } from './Core/loadKTX2.js';\r\nexport { default as ManagedArray } from './Core/ManagedArray.js';\r\nexport { default as MapProjection } from './Core/MapProjection.js';\r\nexport { default as Math } from './Core/Math.js';\r\nexport { default as Matrix2 } from './Core/Matrix2.js';\r\nexport { default as Matrix3 } from './Core/Matrix3.js';\r\nexport { default as Matrix4 } from './Core/Matrix4.js';\r\nexport { default as mergeSort } from './Core/mergeSort.js';\r\nexport { default as MorphWeightSpline } from './Core/MorphWeightSpline.js';\r\nexport { default as MortonOrder } from './Core/MortonOrder.js';\r\nexport { default as NearFarScalar } from './Core/NearFarScalar.js';\r\nexport { default as objectToQuery } from './Core/objectToQuery.js';\r\nexport { default as Occluder } from './Core/Occluder.js';\r\nexport { default as OffsetGeometryInstanceAttribute } from './Core/OffsetGeometryInstanceAttribute.js';\r\nexport { default as oneTimeWarning } from './Core/oneTimeWarning.js';\r\nexport { default as OpenCageGeocoderService } from './Core/OpenCageGeocoderService.js';\r\nexport { default as OrientedBoundingBox } from './Core/OrientedBoundingBox.js';\r\nexport { default as OrthographicFrustum } from './Core/OrthographicFrustum.js';\r\nexport { default as OrthographicOffCenterFrustum } from './Core/OrthographicOffCenterFrustum.js';\r\nexport { default as Packable } from './Core/Packable.js';\r\nexport { default as PackableForInterpolation } from './Core/PackableForInterpolation.js';\r\nexport { default as parseResponseHeaders } from './Core/parseResponseHeaders.js';\r\nexport { default as PeliasGeocoderService } from './Core/PeliasGeocoderService.js';\r\nexport { default as PerspectiveFrustum } from './Core/PerspectiveFrustum.js';\r\nexport { default as PerspectiveOffCenterFrustum } from './Core/PerspectiveOffCenterFrustum.js';\r\nexport { default as PinBuilder } from './Core/PinBuilder.js';\r\nexport { default as PixelFormat } from './Core/PixelFormat.js';\r\nexport { default as Plane } from './Core/Plane.js';\r\nexport { default as PlaneGeometry } from './Core/PlaneGeometry.js';\r\nexport { default as PlaneOutlineGeometry } from './Core/PlaneOutlineGeometry.js';\r\nexport { default as pointInsideTriangle } from './Core/pointInsideTriangle.js';\r\nexport { default as PolygonGeometry } from './Core/PolygonGeometry.js';\r\nexport { default as PolygonGeometryLibrary } from './Core/PolygonGeometryLibrary.js';\r\nexport { default as PolygonHierarchy } from './Core/PolygonHierarchy.js';\r\nexport { default as PolygonOutlineGeometry } from './Core/PolygonOutlineGeometry.js';\r\nexport { default as PolygonPipeline } from './Core/PolygonPipeline.js';\r\nexport { default as PolylineGeometry } from './Core/PolylineGeometry.js';\r\nexport { default as PolylinePipeline } from './Core/PolylinePipeline.js';\r\nexport { default as PolylineVolumeGeometry } from './Core/PolylineVolumeGeometry.js';\r\nexport { default as PolylineVolumeGeometryLibrary } from './Core/PolylineVolumeGeometryLibrary.js';\r\nexport { default as PolylineVolumeOutlineGeometry } from './Core/PolylineVolumeOutlineGeometry.js';\r\nexport { default as PrimitiveType } from './Core/PrimitiveType.js';\r\nexport { default as Proxy } from './Core/Proxy.js';\r\nexport { default as QuadraticRealPolynomial } from './Core/QuadraticRealPolynomial.js';\r\nexport { default as QuantizedMeshTerrainData } from './Core/QuantizedMeshTerrainData.js';\r\nexport { default as QuarticRealPolynomial } from './Core/QuarticRealPolynomial.js';\r\nexport { default as Quaternion } from './Core/Quaternion.js';\r\nexport { default as QuaternionSpline } from './Core/QuaternionSpline.js';\r\nexport { default as queryToObject } from './Core/queryToObject.js';\r\nexport { default as Queue } from './Core/Queue.js';\r\nexport { default as Ray } from './Core/Ray.js';\r\nexport { default as Rectangle } from './Core/Rectangle.js';\r\nexport { default as RectangleCollisionChecker } from './Core/RectangleCollisionChecker.js';\r\nexport { default as RectangleGeometry } from './Core/RectangleGeometry.js';\r\nexport { default as RectangleGeometryLibrary } from './Core/RectangleGeometryLibrary.js';\r\nexport { default as RectangleOutlineGeometry } from './Core/RectangleOutlineGeometry.js';\r\nexport { default as ReferenceFrame } from './Core/ReferenceFrame.js';\r\nexport { default as Request } from './Core/Request.js';\r\nexport { default as requestAnimationFrame } from './Core/requestAnimationFrame.js';\r\nexport { default as RequestErrorEvent } from './Core/RequestErrorEvent.js';\r\nexport { default as RequestScheduler } from './Core/RequestScheduler.js';\r\nexport { default as RequestState } from './Core/RequestState.js';\r\nexport { default as RequestType } from './Core/RequestType.js';\r\nexport { default as resizeImageToNextPowerOfTwo } from './Core/resizeImageToNextPowerOfTwo.js';\r\nexport { default as Resource } from './Core/Resource.js';\r\nexport { default as RuntimeError } from './Core/RuntimeError.js';\r\nexport { default as S2Cell } from './Core/S2Cell.js';\r\nexport { default as sampleTerrain } from './Core/sampleTerrain.js';\r\nexport { default as sampleTerrainMostDetailed } from './Core/sampleTerrainMostDetailed.js';\r\nexport { default as scaleToGeodeticSurface } from './Core/scaleToGeodeticSurface.js';\r\nexport { default as ScreenSpaceEventHandler } from './Core/ScreenSpaceEventHandler.js';\r\nexport { default as ScreenSpaceEventType } from './Core/ScreenSpaceEventType.js';\r\nexport { default as ShowGeometryInstanceAttribute } from './Core/ShowGeometryInstanceAttribute.js';\r\nexport { default as Simon1994PlanetaryPositions } from './Core/Simon1994PlanetaryPositions.js';\r\nexport { default as SimplePolylineGeometry } from './Core/SimplePolylineGeometry.js';\r\nexport { default as SphereGeometry } from './Core/SphereGeometry.js';\r\nexport { default as SphereOutlineGeometry } from './Core/SphereOutlineGeometry.js';\r\nexport { default as Spherical } from './Core/Spherical.js';\r\nexport { default as Spline } from './Core/Spline.js';\r\nexport { default as SteppedSpline } from './Core/SteppedSpline.js';\r\nexport { default as subdivideArray } from './Core/subdivideArray.js';\r\nexport { default as TaskProcessor } from './Core/TaskProcessor.js';\r\nexport { default as TerrainData } from './Core/TerrainData.js';\r\nexport { default as TerrainEncoding } from './Core/TerrainEncoding.js';\r\nexport { default as TerrainExaggeration } from './Core/TerrainExaggeration.js';\r\nexport { default as TerrainMesh } from './Core/TerrainMesh.js';\r\nexport { default as TerrainProvider } from './Core/TerrainProvider.js';\r\nexport { default as TerrainQuantization } from './Core/TerrainQuantization.js';\r\nexport { default as TileAvailability } from './Core/TileAvailability.js';\r\nexport { default as TileEdge } from './Core/TileEdge.js';\r\nexport { default as TileProviderError } from './Core/TileProviderError.js';\r\nexport { default as TilingScheme } from './Core/TilingScheme.js';\r\nexport { default as TimeConstants } from './Core/TimeConstants.js';\r\nexport { default as TimeInterval } from './Core/TimeInterval.js';\r\nexport { default as TimeIntervalCollection } from './Core/TimeIntervalCollection.js';\r\nexport { default as TimeStandard } from './Core/TimeStandard.js';\r\nexport { default as Tipsify } from './Core/Tipsify.js';\r\nexport { default as Transforms } from './Core/Transforms.js';\r\nexport { default as TranslationRotationScale } from './Core/TranslationRotationScale.js';\r\nexport { default as TridiagonalSystemSolver } from './Core/TridiagonalSystemSolver.js';\r\nexport { default as TrustedServers } from './Core/TrustedServers.js';\r\nexport { default as VertexFormat } from './Core/VertexFormat.js';\r\nexport { default as VideoSynchronizer } from './Core/VideoSynchronizer.js';\r\nexport { default as Visibility } from './Core/Visibility.js';\r\nexport { default as VRTheWorldTerrainProvider } from './Core/VRTheWorldTerrainProvider.js';\r\nexport { default as VulkanConstants } from './Core/VulkanConstants.js';\r\nexport { default as WallGeometry } from './Core/WallGeometry.js';\r\nexport { default as WallGeometryLibrary } from './Core/WallGeometryLibrary.js';\r\nexport { default as WallOutlineGeometry } from './Core/WallOutlineGeometry.js';\r\nexport { default as WebGLConstants } from './Core/WebGLConstants.js';\r\nexport { default as webGLConstantToGlslType } from './Core/webGLConstantToGlslType.js';\r\nexport { default as WebMercatorProjection } from './Core/WebMercatorProjection.js';\r\nexport { default as WebMercatorTilingScheme } from './Core/WebMercatorTilingScheme.js';\r\nexport { default as WindingOrder } from './Core/WindingOrder.js';\r\nexport { default as WireframeIndexGenerator } from './Core/WireframeIndexGenerator.js';\r\nexport { default as wrapFunction } from './Core/wrapFunction.js';\r\nexport { default as writeTextToCanvas } from './Core/writeTextToCanvas.js';\r\nexport { default as knockout_3_5_1 } from './ThirdParty/knockout-3.5.1.js';\r\nexport { default as knockout_es5 } from './ThirdParty/knockout-es5.js';\r\nexport { default as knockout } from './ThirdParty/knockout.js';\r\nexport { default as _shadersAdjustTranslucentFS } from './Shaders/AdjustTranslucentFS.js';\r\nexport { default as _shadersAtmosphereCommon } from './Shaders/AtmosphereCommon.js';\r\nexport { default as _shadersBillboardCollectionFS } from './Shaders/BillboardCollectionFS.js';\r\nexport { default as _shadersBillboardCollectionVS } from './Shaders/BillboardCollectionVS.js';\r\nexport { default as _shadersBrdfLutGeneratorFS } from './Shaders/BrdfLutGeneratorFS.js';\r\nexport { default as _shadersCloudCollectionFS } from './Shaders/CloudCollectionFS.js';\r\nexport { default as _shadersCloudCollectionVS } from './Shaders/CloudCollectionVS.js';\r\nexport { default as _shadersCloudNoiseFS } from './Shaders/CloudNoiseFS.js';\r\nexport { default as _shadersCloudNoiseVS } from './Shaders/CloudNoiseVS.js';\r\nexport { default as _shadersCompareAndPackTranslucentDepth } from './Shaders/CompareAndPackTranslucentDepth.js';\r\nexport { default as _shadersCompositeOITFS } from './Shaders/CompositeOITFS.js';\r\nexport { default as _shadersDepthPlaneFS } from './Shaders/DepthPlaneFS.js';\r\nexport { default as _shadersDepthPlaneVS } from './Shaders/DepthPlaneVS.js';\r\nexport { default as _shadersEllipsoidFS } from './Shaders/EllipsoidFS.js';\r\nexport { default as _shadersEllipsoidVS } from './Shaders/EllipsoidVS.js';\r\nexport { default as _shadersFXAA3_11 } from './Shaders/FXAA3_11.js';\r\nexport { default as _shadersGlobeFS } from './Shaders/GlobeFS.js';\r\nexport { default as _shadersGlobeVS } from './Shaders/GlobeVS.js';\r\nexport { default as _shadersGroundAtmosphere } from './Shaders/GroundAtmosphere.js';\r\nexport { default as _shadersOctahedralProjectionAtlasFS } from './Shaders/OctahedralProjectionAtlasFS.js';\r\nexport { default as _shadersOctahedralProjectionFS } from './Shaders/OctahedralProjectionFS.js';\r\nexport { default as _shadersOctahedralProjectionVS } from './Shaders/OctahedralProjectionVS.js';\r\nexport { default as _shadersPointPrimitiveCollectionFS } from './Shaders/PointPrimitiveCollectionFS.js';\r\nexport { default as _shadersPointPrimitiveCollectionVS } from './Shaders/PointPrimitiveCollectionVS.js';\r\nexport { default as _shadersPolylineCommon } from './Shaders/PolylineCommon.js';\r\nexport { default as _shadersPolylineFS } from './Shaders/PolylineFS.js';\r\nexport { default as _shadersPolylineShadowVolumeFS } from './Shaders/PolylineShadowVolumeFS.js';\r\nexport { default as _shadersPolylineShadowVolumeMorphFS } from './Shaders/PolylineShadowVolumeMorphFS.js';\r\nexport { default as _shadersPolylineShadowVolumeMorphVS } from './Shaders/PolylineShadowVolumeMorphVS.js';\r\nexport { default as _shadersPolylineShadowVolumeVS } from './Shaders/PolylineShadowVolumeVS.js';\r\nexport { default as _shadersPolylineVS } from './Shaders/PolylineVS.js';\r\nexport { default as _shadersReprojectWebMercatorFS } from './Shaders/ReprojectWebMercatorFS.js';\r\nexport { default as _shadersReprojectWebMercatorVS } from './Shaders/ReprojectWebMercatorVS.js';\r\nexport { default as _shadersShadowVolumeAppearanceFS } from './Shaders/ShadowVolumeAppearanceFS.js';\r\nexport { default as _shadersShadowVolumeAppearanceVS } from './Shaders/ShadowVolumeAppearanceVS.js';\r\nexport { default as _shadersShadowVolumeFS } from './Shaders/ShadowVolumeFS.js';\r\nexport { default as _shadersSkyAtmosphereCommon } from './Shaders/SkyAtmosphereCommon.js';\r\nexport { default as _shadersSkyAtmosphereFS } from './Shaders/SkyAtmosphereFS.js';\r\nexport { default as _shadersSkyAtmosphereVS } from './Shaders/SkyAtmosphereVS.js';\r\nexport { default as _shadersSkyBoxFS } from './Shaders/SkyBoxFS.js';\r\nexport { default as _shadersSkyBoxVS } from './Shaders/SkyBoxVS.js';\r\nexport { default as _shadersSunFS } from './Shaders/SunFS.js';\r\nexport { default as _shadersSunTextureFS } from './Shaders/SunTextureFS.js';\r\nexport { default as _shadersSunVS } from './Shaders/SunVS.js';\r\nexport { default as _shadersVector3DTileClampedPolylinesFS } from './Shaders/Vector3DTileClampedPolylinesFS.js';\r\nexport { default as _shadersVector3DTileClampedPolylinesVS } from './Shaders/Vector3DTileClampedPolylinesVS.js';\r\nexport { default as _shadersVector3DTilePolylinesVS } from './Shaders/Vector3DTilePolylinesVS.js';\r\nexport { default as _shadersVectorTileVS } from './Shaders/VectorTileVS.js';\r\nexport { default as _shadersViewportQuadFS } from './Shaders/ViewportQuadFS.js';\r\nexport { default as _shadersViewportQuadVS } from './Shaders/ViewportQuadVS.js';\r\nexport { default as ClockViewModel } from './Widgets/ClockViewModel.js';\r\nexport { default as Command } from './Widgets/Command.js';\r\nexport { default as createCommand } from './Widgets/createCommand.js';\r\nexport { default as getElement } from './Widgets/getElement.js';\r\nexport { default as InspectorShared } from './Widgets/InspectorShared.js';\r\nexport { default as subscribeAndEvaluate } from './Widgets/subscribeAndEvaluate.js';\r\nexport { default as SvgPathBindingHandler } from './Widgets/SvgPathBindingHandler.js';\r\nexport { default as ToggleButtonViewModel } from './Widgets/ToggleButtonViewModel.js';\r\nexport { default as AlphaMode } from './Scene/AlphaMode.js';\r\nexport { default as Appearance } from './Scene/Appearance.js';\r\nexport { default as ArcGisMapServerImageryProvider } from './Scene/ArcGisMapServerImageryProvider.js';\r\nexport { default as AttributeType } from './Scene/AttributeType.js';\r\nexport { default as AutoExposure } from './Scene/AutoExposure.js';\r\nexport { default as Axis } from './Scene/Axis.js';\r\nexport { default as B3dmParser } from './Scene/B3dmParser.js';\r\nexport { default as BatchTable } from './Scene/BatchTable.js';\r\nexport { default as BatchTableHierarchy } from './Scene/BatchTableHierarchy.js';\r\nexport { default as BatchTexture } from './Scene/BatchTexture.js';\r\nexport { default as Billboard } from './Scene/Billboard.js';\r\nexport { default as BillboardCollection } from './Scene/BillboardCollection.js';\r\nexport { default as BingMapsImageryProvider } from './Scene/BingMapsImageryProvider.js';\r\nexport { default as BingMapsStyle } from './Scene/BingMapsStyle.js';\r\nexport { default as BlendEquation } from './Scene/BlendEquation.js';\r\nexport { default as BlendFunction } from './Scene/BlendFunction.js';\r\nexport { default as BlendingState } from './Scene/BlendingState.js';\r\nexport { default as BlendOption } from './Scene/BlendOption.js';\r\nexport { default as BoxEmitter } from './Scene/BoxEmitter.js';\r\nexport { default as BrdfLutGenerator } from './Scene/BrdfLutGenerator.js';\r\nexport { default as BufferLoader } from './Scene/BufferLoader.js';\r\nexport { default as Camera } from './Scene/Camera.js';\r\nexport { default as CameraEventAggregator } from './Scene/CameraEventAggregator.js';\r\nexport { default as CameraEventType } from './Scene/CameraEventType.js';\r\nexport { default as CameraFlightPath } from './Scene/CameraFlightPath.js';\r\nexport { default as Cesium3DContentGroup } from './Scene/Cesium3DContentGroup.js';\r\nexport { default as Cesium3DTile } from './Scene/Cesium3DTile.js';\r\nexport { default as Cesium3DTileBatchTable } from './Scene/Cesium3DTileBatchTable.js';\r\nexport { default as Cesium3DTileColorBlendMode } from './Scene/Cesium3DTileColorBlendMode.js';\r\nexport { default as Cesium3DTileContent } from './Scene/Cesium3DTileContent.js';\r\nexport { default as Cesium3DTileContentFactory } from './Scene/Cesium3DTileContentFactory.js';\r\nexport { default as Cesium3DTileContentState } from './Scene/Cesium3DTileContentState.js';\r\nexport { default as Cesium3DTileContentType } from './Scene/Cesium3DTileContentType.js';\r\nexport { default as Cesium3DTileFeature } from './Scene/Cesium3DTileFeature.js';\r\nexport { default as Cesium3DTileFeatureTable } from './Scene/Cesium3DTileFeatureTable.js';\r\nexport { default as Cesium3DTileOptimizationHint } from './Scene/Cesium3DTileOptimizationHint.js';\r\nexport { default as Cesium3DTileOptimizations } from './Scene/Cesium3DTileOptimizations.js';\r\nexport { default as Cesium3DTilePass } from './Scene/Cesium3DTilePass.js';\r\nexport { default as Cesium3DTilePassState } from './Scene/Cesium3DTilePassState.js';\r\nexport { default as Cesium3DTilePointFeature } from './Scene/Cesium3DTilePointFeature.js';\r\nexport { default as Cesium3DTileRefine } from './Scene/Cesium3DTileRefine.js';\r\nexport { default as Cesium3DTileset } from './Scene/Cesium3DTileset.js';\r\nexport { default as Cesium3DTilesetCache } from './Scene/Cesium3DTilesetCache.js';\r\nexport { default as Cesium3DTilesetHeatmap } from './Scene/Cesium3DTilesetHeatmap.js';\r\nexport { default as Cesium3DTilesetMetadata } from './Scene/Cesium3DTilesetMetadata.js';\r\nexport { default as Cesium3DTilesetMostDetailedTraversal } from './Scene/Cesium3DTilesetMostDetailedTraversal.js';\r\nexport { default as Cesium3DTilesetStatistics } from './Scene/Cesium3DTilesetStatistics.js';\r\nexport { default as Cesium3DTilesetTraversal } from './Scene/Cesium3DTilesetTraversal.js';\r\nexport { default as Cesium3DTileStyle } from './Scene/Cesium3DTileStyle.js';\r\nexport { default as Cesium3DTileStyleEngine } from './Scene/Cesium3DTileStyleEngine.js';\r\nexport { default as CircleEmitter } from './Scene/CircleEmitter.js';\r\nexport { default as ClassificationPrimitive } from './Scene/ClassificationPrimitive.js';\r\nexport { default as ClassificationType } from './Scene/ClassificationType.js';\r\nexport { default as ClippingPlane } from './Scene/ClippingPlane.js';\r\nexport { default as ClippingPlaneCollection } from './Scene/ClippingPlaneCollection.js';\r\nexport { default as CloudCollection } from './Scene/CloudCollection.js';\r\nexport { default as CloudType } from './Scene/CloudType.js';\r\nexport { default as ColorBlendMode } from './Scene/ColorBlendMode.js';\r\nexport { default as Composite3DTileContent } from './Scene/Composite3DTileContent.js';\r\nexport { default as computeFlyToLocationForRectangle } from './Scene/computeFlyToLocationForRectangle.js';\r\nexport { default as ConditionsExpression } from './Scene/ConditionsExpression.js';\r\nexport { default as ConeEmitter } from './Scene/ConeEmitter.js';\r\nexport { default as ContentMetadata } from './Scene/ContentMetadata.js';\r\nexport { default as createBillboardPointCallback } from './Scene/createBillboardPointCallback.js';\r\nexport { default as createElevationBandMaterial } from './Scene/createElevationBandMaterial.js';\r\nexport { default as createOsmBuildings } from './Scene/createOsmBuildings.js';\r\nexport { default as createTangentSpaceDebugPrimitive } from './Scene/createTangentSpaceDebugPrimitive.js';\r\nexport { default as createWorldImagery } from './Scene/createWorldImagery.js';\r\nexport { default as CreditDisplay } from './Scene/CreditDisplay.js';\r\nexport { default as CullFace } from './Scene/CullFace.js';\r\nexport { default as CumulusCloud } from './Scene/CumulusCloud.js';\r\nexport { default as DebugAppearance } from './Scene/DebugAppearance.js';\r\nexport { default as DebugCameraPrimitive } from './Scene/DebugCameraPrimitive.js';\r\nexport { default as DebugInspector } from './Scene/DebugInspector.js';\r\nexport { default as DebugModelMatrixPrimitive } from './Scene/DebugModelMatrixPrimitive.js';\r\nexport { default as DepthFunction } from './Scene/DepthFunction.js';\r\nexport { default as DepthPlane } from './Scene/DepthPlane.js';\r\nexport { default as DerivedCommand } from './Scene/DerivedCommand.js';\r\nexport { default as DeviceOrientationCameraController } from './Scene/DeviceOrientationCameraController.js';\r\nexport { default as DirectionalLight } from './Scene/DirectionalLight.js';\r\nexport { default as DiscardEmptyTileImagePolicy } from './Scene/DiscardEmptyTileImagePolicy.js';\r\nexport { default as DiscardMissingTileImagePolicy } from './Scene/DiscardMissingTileImagePolicy.js';\r\nexport { default as DracoLoader } from './Scene/DracoLoader.js';\r\nexport { default as EllipsoidPrimitive } from './Scene/EllipsoidPrimitive.js';\r\nexport { default as EllipsoidSurfaceAppearance } from './Scene/EllipsoidSurfaceAppearance.js';\r\nexport { default as Empty3DTileContent } from './Scene/Empty3DTileContent.js';\r\nexport { default as Expression } from './Scene/Expression.js';\r\nexport { default as ExpressionNodeType } from './Scene/ExpressionNodeType.js';\r\nexport { default as findContentMetadata } from './Scene/findContentMetadata.js';\r\nexport { default as findGroupMetadata } from './Scene/findGroupMetadata.js';\r\nexport { default as findTileMetadata } from './Scene/findTileMetadata.js';\r\nexport { default as Fog } from './Scene/Fog.js';\r\nexport { default as FrameRateMonitor } from './Scene/FrameRateMonitor.js';\r\nexport { default as FrameState } from './Scene/FrameState.js';\r\nexport { default as FrustumCommands } from './Scene/FrustumCommands.js';\r\nexport { default as Geometry3DTileContent } from './Scene/Geometry3DTileContent.js';\r\nexport { default as getBinaryAccessor } from './Scene/getBinaryAccessor.js';\r\nexport { default as getClipAndStyleCode } from './Scene/getClipAndStyleCode.js';\r\nexport { default as getClippingFunction } from './Scene/getClippingFunction.js';\r\nexport { default as GetFeatureInfoFormat } from './Scene/GetFeatureInfoFormat.js';\r\nexport { default as Globe } from './Scene/Globe.js';\r\nexport { default as GlobeDepth } from './Scene/GlobeDepth.js';\r\nexport { default as GlobeSurfaceShaderSet } from './Scene/GlobeSurfaceShaderSet.js';\r\nexport { default as GlobeSurfaceTile } from './Scene/GlobeSurfaceTile.js';\r\nexport { default as GlobeSurfaceTileProvider } from './Scene/GlobeSurfaceTileProvider.js';\r\nexport { default as GlobeTranslucency } from './Scene/GlobeTranslucency.js';\r\nexport { default as GlobeTranslucencyFramebuffer } from './Scene/GlobeTranslucencyFramebuffer.js';\r\nexport { default as GlobeTranslucencyState } from './Scene/GlobeTranslucencyState.js';\r\nexport { default as GltfBufferViewLoader } from './Scene/GltfBufferViewLoader.js';\r\nexport { default as GltfDracoLoader } from './Scene/GltfDracoLoader.js';\r\nexport { default as GltfImageLoader } from './Scene/GltfImageLoader.js';\r\nexport { default as GltfIndexBufferLoader } from './Scene/GltfIndexBufferLoader.js';\r\nexport { default as GltfJsonLoader } from './Scene/GltfJsonLoader.js';\r\nexport { default as GltfLoader } from './Scene/GltfLoader.js';\r\nexport { default as GltfLoaderUtil } from './Scene/GltfLoaderUtil.js';\r\nexport { default as GltfStructuralMetadataLoader } from './Scene/GltfStructuralMetadataLoader.js';\r\nexport { default as GltfTextureLoader } from './Scene/GltfTextureLoader.js';\r\nexport { default as GltfVertexBufferLoader } from './Scene/GltfVertexBufferLoader.js';\r\nexport { default as GoogleEarthEnterpriseImageryProvider } from './Scene/GoogleEarthEnterpriseImageryProvider.js';\r\nexport { default as GoogleEarthEnterpriseMapsProvider } from './Scene/GoogleEarthEnterpriseMapsProvider.js';\r\nexport { default as GridImageryProvider } from './Scene/GridImageryProvider.js';\r\nexport { default as GroundPolylinePrimitive } from './Scene/GroundPolylinePrimitive.js';\r\nexport { default as GroundPrimitive } from './Scene/GroundPrimitive.js';\r\nexport { default as GroupMetadata } from './Scene/GroupMetadata.js';\r\nexport { default as hasExtension } from './Scene/hasExtension.js';\r\nexport { default as HeightReference } from './Scene/HeightReference.js';\r\nexport { default as HorizontalOrigin } from './Scene/HorizontalOrigin.js';\r\nexport { default as I3dmParser } from './Scene/I3dmParser.js';\r\nexport { default as ImageBasedLighting } from './Scene/ImageBasedLighting.js';\r\nexport { default as Imagery } from './Scene/Imagery.js';\r\nexport { default as ImageryLayer } from './Scene/ImageryLayer.js';\r\nexport { default as ImageryLayerCollection } from './Scene/ImageryLayerCollection.js';\r\nexport { default as ImageryLayerFeatureInfo } from './Scene/ImageryLayerFeatureInfo.js';\r\nexport { default as ImageryProvider } from './Scene/ImageryProvider.js';\r\nexport { default as ImageryState } from './Scene/ImageryState.js';\r\nexport { default as Implicit3DTileContent } from './Scene/Implicit3DTileContent.js';\r\nexport { default as ImplicitAvailabilityBitstream } from './Scene/ImplicitAvailabilityBitstream.js';\r\nexport { default as ImplicitMetadataView } from './Scene/ImplicitMetadataView.js';\r\nexport { default as ImplicitSubdivisionScheme } from './Scene/ImplicitSubdivisionScheme.js';\r\nexport { default as ImplicitSubtree } from './Scene/ImplicitSubtree.js';\r\nexport { default as ImplicitSubtreeMetadata } from './Scene/ImplicitSubtreeMetadata.js';\r\nexport { default as ImplicitTileCoordinates } from './Scene/ImplicitTileCoordinates.js';\r\nexport { default as ImplicitTileset } from './Scene/ImplicitTileset.js';\r\nexport { default as InstanceAttributeSemantic } from './Scene/InstanceAttributeSemantic.js';\r\nexport { default as InvertClassification } from './Scene/InvertClassification.js';\r\nexport { default as IonImageryProvider } from './Scene/IonImageryProvider.js';\r\nexport { default as IonWorldImageryStyle } from './Scene/IonWorldImageryStyle.js';\r\nexport { default as JobScheduler } from './Scene/JobScheduler.js';\r\nexport { default as JobType } from './Scene/JobType.js';\r\nexport { default as JsonMetadataTable } from './Scene/JsonMetadataTable.js';\r\nexport { default as Label } from './Scene/Label.js';\r\nexport { default as LabelCollection } from './Scene/LabelCollection.js';\r\nexport { default as LabelStyle } from './Scene/LabelStyle.js';\r\nexport { default as Light } from './Scene/Light.js';\r\nexport { default as MapboxImageryProvider } from './Scene/MapboxImageryProvider.js';\r\nexport { default as MapboxStyleImageryProvider } from './Scene/MapboxStyleImageryProvider.js';\r\nexport { default as MapMode2D } from './Scene/MapMode2D.js';\r\nexport { default as Material } from './Scene/Material.js';\r\nexport { default as MaterialAppearance } from './Scene/MaterialAppearance.js';\r\nexport { default as MetadataClass } from './Scene/MetadataClass.js';\r\nexport { default as MetadataClassProperty } from './Scene/MetadataClassProperty.js';\r\nexport { default as MetadataComponentType } from './Scene/MetadataComponentType.js';\r\nexport { default as MetadataEntity } from './Scene/MetadataEntity.js';\r\nexport { default as MetadataEnum } from './Scene/MetadataEnum.js';\r\nexport { default as MetadataEnumValue } from './Scene/MetadataEnumValue.js';\r\nexport { default as MetadataSchema } from './Scene/MetadataSchema.js';\r\nexport { default as MetadataSchemaLoader } from './Scene/MetadataSchemaLoader.js';\r\nexport { default as MetadataSemantic } from './Scene/MetadataSemantic.js';\r\nexport { default as MetadataTable } from './Scene/MetadataTable.js';\r\nexport { default as MetadataTableProperty } from './Scene/MetadataTableProperty.js';\r\nexport { default as MetadataType } from './Scene/MetadataType.js';\r\nexport { default as ModelAnimationLoop } from './Scene/ModelAnimationLoop.js';\r\nexport { default as ModelAnimationState } from './Scene/ModelAnimationState.js';\r\nexport { default as ModelComponents } from './Scene/ModelComponents.js';\r\nexport { default as Moon } from './Scene/Moon.js';\r\nexport { default as Multiple3DTileContent } from './Scene/Multiple3DTileContent.js';\r\nexport { default as NeverTileDiscardPolicy } from './Scene/NeverTileDiscardPolicy.js';\r\nexport { default as OctahedralProjectedCubeMap } from './Scene/OctahedralProjectedCubeMap.js';\r\nexport { default as OIT } from './Scene/OIT.js';\r\nexport { default as OpenStreetMapImageryProvider } from './Scene/OpenStreetMapImageryProvider.js';\r\nexport { default as OrderedGroundPrimitiveCollection } from './Scene/OrderedGroundPrimitiveCollection.js';\r\nexport { default as parseBatchTable } from './Scene/parseBatchTable.js';\r\nexport { default as parseBoundingVolumeSemantics } from './Scene/parseBoundingVolumeSemantics.js';\r\nexport { default as parseFeatureMetadataLegacy } from './Scene/parseFeatureMetadataLegacy.js';\r\nexport { default as parseStructuralMetadata } from './Scene/parseStructuralMetadata.js';\r\nexport { default as Particle } from './Scene/Particle.js';\r\nexport { default as ParticleBurst } from './Scene/ParticleBurst.js';\r\nexport { default as ParticleEmitter } from './Scene/ParticleEmitter.js';\r\nexport { default as ParticleSystem } from './Scene/ParticleSystem.js';\r\nexport { default as PerformanceDisplay } from './Scene/PerformanceDisplay.js';\r\nexport { default as PerInstanceColorAppearance } from './Scene/PerInstanceColorAppearance.js';\r\nexport { default as PickDepth } from './Scene/PickDepth.js';\r\nexport { default as PickDepthFramebuffer } from './Scene/PickDepthFramebuffer.js';\r\nexport { default as PickFramebuffer } from './Scene/PickFramebuffer.js';\r\nexport { default as Picking } from './Scene/Picking.js';\r\nexport { default as PntsParser } from './Scene/PntsParser.js';\r\nexport { default as PointCloud } from './Scene/PointCloud.js';\r\nexport { default as PointCloudEyeDomeLighting } from './Scene/PointCloudEyeDomeLighting.js';\r\nexport { default as PointCloudShading } from './Scene/PointCloudShading.js';\r\nexport { default as PointPrimitive } from './Scene/PointPrimitive.js';\r\nexport { default as PointPrimitiveCollection } from './Scene/PointPrimitiveCollection.js';\r\nexport { default as Polyline } from './Scene/Polyline.js';\r\nexport { default as PolylineCollection } from './Scene/PolylineCollection.js';\r\nexport { default as PolylineColorAppearance } from './Scene/PolylineColorAppearance.js';\r\nexport { default as PolylineMaterialAppearance } from './Scene/PolylineMaterialAppearance.js';\r\nexport { default as PostProcessStage } from './Scene/PostProcessStage.js';\r\nexport { default as PostProcessStageCollection } from './Scene/PostProcessStageCollection.js';\r\nexport { default as PostProcessStageComposite } from './Scene/PostProcessStageComposite.js';\r\nexport { default as PostProcessStageLibrary } from './Scene/PostProcessStageLibrary.js';\r\nexport { default as PostProcessStageSampleMode } from './Scene/PostProcessStageSampleMode.js';\r\nexport { default as PostProcessStageTextureCache } from './Scene/PostProcessStageTextureCache.js';\r\nexport { default as preprocess3DTileContent } from './Scene/preprocess3DTileContent.js';\r\nexport { default as Primitive } from './Scene/Primitive.js';\r\nexport { default as PrimitiveCollection } from './Scene/PrimitiveCollection.js';\r\nexport { default as PrimitiveLoadPlan } from './Scene/PrimitiveLoadPlan.js';\r\nexport { default as PrimitivePipeline } from './Scene/PrimitivePipeline.js';\r\nexport { default as PrimitiveState } from './Scene/PrimitiveState.js';\r\nexport { default as PropertyAttribute } from './Scene/PropertyAttribute.js';\r\nexport { default as PropertyAttributeProperty } from './Scene/PropertyAttributeProperty.js';\r\nexport { default as PropertyTable } from './Scene/PropertyTable.js';\r\nexport { default as PropertyTexture } from './Scene/PropertyTexture.js';\r\nexport { default as PropertyTextureProperty } from './Scene/PropertyTextureProperty.js';\r\nexport { default as QuadtreeOccluders } from './Scene/QuadtreeOccluders.js';\r\nexport { default as QuadtreePrimitive } from './Scene/QuadtreePrimitive.js';\r\nexport { default as QuadtreeTile } from './Scene/QuadtreeTile.js';\r\nexport { default as QuadtreeTileLoadState } from './Scene/QuadtreeTileLoadState.js';\r\nexport { default as QuadtreeTileProvider } from './Scene/QuadtreeTileProvider.js';\r\nexport { default as ResourceCache } from './Scene/ResourceCache.js';\r\nexport { default as ResourceCacheKey } from './Scene/ResourceCacheKey.js';\r\nexport { default as ResourceCacheStatistics } from './Scene/ResourceCacheStatistics.js';\r\nexport { default as ResourceLoader } from './Scene/ResourceLoader.js';\r\nexport { default as ResourceLoaderState } from './Scene/ResourceLoaderState.js';\r\nexport { default as Scene } from './Scene/Scene.js';\r\nexport { default as SceneFramebuffer } from './Scene/SceneFramebuffer.js';\r\nexport { default as SceneMode } from './Scene/SceneMode.js';\r\nexport { default as SceneTransforms } from './Scene/SceneTransforms.js';\r\nexport { default as SceneTransitioner } from './Scene/SceneTransitioner.js';\r\nexport { default as ScreenSpaceCameraController } from './Scene/ScreenSpaceCameraController.js';\r\nexport { default as SDFSettings } from './Scene/SDFSettings.js';\r\nexport { default as ShadowMap } from './Scene/ShadowMap.js';\r\nexport { default as ShadowMapShader } from './Scene/ShadowMapShader.js';\r\nexport { default as ShadowMode } from './Scene/ShadowMode.js';\r\nexport { default as ShadowVolumeAppearance } from './Scene/ShadowVolumeAppearance.js';\r\nexport { default as SingleTileImageryProvider } from './Scene/SingleTileImageryProvider.js';\r\nexport { default as SkyAtmosphere } from './Scene/SkyAtmosphere.js';\r\nexport { default as SkyBox } from './Scene/SkyBox.js';\r\nexport { default as SphereEmitter } from './Scene/SphereEmitter.js';\r\nexport { default as SplitDirection } from './Scene/SplitDirection.js';\r\nexport { default as Splitter } from './Scene/Splitter.js';\r\nexport { default as StencilConstants } from './Scene/StencilConstants.js';\r\nexport { default as StencilFunction } from './Scene/StencilFunction.js';\r\nexport { default as StencilOperation } from './Scene/StencilOperation.js';\r\nexport { default as StructuralMetadata } from './Scene/StructuralMetadata.js';\r\nexport { default as StyleExpression } from './Scene/StyleExpression.js';\r\nexport { default as Sun } from './Scene/Sun.js';\r\nexport { default as SunLight } from './Scene/SunLight.js';\r\nexport { default as SunPostProcess } from './Scene/SunPostProcess.js';\r\nexport { default as SupportedImageFormats } from './Scene/SupportedImageFormats.js';\r\nexport { default as TerrainFillMesh } from './Scene/TerrainFillMesh.js';\r\nexport { default as TerrainState } from './Scene/TerrainState.js';\r\nexport { default as TextureAtlas } from './Scene/TextureAtlas.js';\r\nexport { default as TileBoundingRegion } from './Scene/TileBoundingRegion.js';\r\nexport { default as TileBoundingS2Cell } from './Scene/TileBoundingS2Cell.js';\r\nexport { default as TileBoundingSphere } from './Scene/TileBoundingSphere.js';\r\nexport { default as TileBoundingVolume } from './Scene/TileBoundingVolume.js';\r\nexport { default as TileCoordinatesImageryProvider } from './Scene/TileCoordinatesImageryProvider.js';\r\nexport { default as TileCoordinatesImageryProviderFlw } from './Scene/TileCoordinatesImageryProviderFlw.js';\r\nexport { default as TileCoordinatesImageryProviderJww } from './Scene/TileCoordinatesImageryProviderJww.js';\r\nexport { default as TileDiscardPolicy } from './Scene/TileDiscardPolicy.js';\r\nexport { default as TileImagery } from './Scene/TileImagery.js';\r\nexport { default as TileMapServiceImageryProvider } from './Scene/TileMapServiceImageryProvider.js';\r\nexport { default as TileMetadata } from './Scene/TileMetadata.js';\r\nexport { default as TileOrientedBoundingBox } from './Scene/TileOrientedBoundingBox.js';\r\nexport { default as TileReplacementQueue } from './Scene/TileReplacementQueue.js';\r\nexport { default as TileSelectionResult } from './Scene/TileSelectionResult.js';\r\nexport { default as Tileset3DTileContent } from './Scene/Tileset3DTileContent.js';\r\nexport { default as TilesetMetadata } from './Scene/TilesetMetadata.js';\r\nexport { default as TileState } from './Scene/TileState.js';\r\nexport { default as TimeDynamicImagery } from './Scene/TimeDynamicImagery.js';\r\nexport { default as TimeDynamicPointCloud } from './Scene/TimeDynamicPointCloud.js';\r\nexport { default as Tonemapper } from './Scene/Tonemapper.js';\r\nexport { default as TranslucentTileClassification } from './Scene/TranslucentTileClassification.js';\r\nexport { default as TweenCollection } from './Scene/TweenCollection.js';\r\nexport { default as UrlTemplateImageryProvider } from './Scene/UrlTemplateImageryProvider.js';\r\nexport { default as Vector3DTileBatch } from './Scene/Vector3DTileBatch.js';\r\nexport { default as Vector3DTileClampedPolylines } from './Scene/Vector3DTileClampedPolylines.js';\r\nexport { default as Vector3DTileContent } from './Scene/Vector3DTileContent.js';\r\nexport { default as Vector3DTileGeometry } from './Scene/Vector3DTileGeometry.js';\r\nexport { default as Vector3DTilePoints } from './Scene/Vector3DTilePoints.js';\r\nexport { default as Vector3DTilePolygons } from './Scene/Vector3DTilePolygons.js';\r\nexport { default as Vector3DTilePolylines } from './Scene/Vector3DTilePolylines.js';\r\nexport { default as Vector3DTilePrimitive } from './Scene/Vector3DTilePrimitive.js';\r\nexport { default as VertexAttributeSemantic } from './Scene/VertexAttributeSemantic.js';\r\nexport { default as VerticalOrigin } from './Scene/VerticalOrigin.js';\r\nexport { default as View } from './Scene/View.js';\r\nexport { default as ViewportQuad } from './Scene/ViewportQuad.js';\r\nexport { default as WebMapServiceImageryProvider } from './Scene/WebMapServiceImageryProvider.js';\r\nexport { default as WebMapTileServiceImageryProvider } from './Scene/WebMapTileServiceImageryProvider.js';\r\nexport { default as _shadersAllMaterialAppearanceFS } from './Shaders/Appearances/AllMaterialAppearanceFS.js';\r\nexport { default as _shadersAllMaterialAppearanceVS } from './Shaders/Appearances/AllMaterialAppearanceVS.js';\r\nexport { default as _shadersBasicMaterialAppearanceFS } from './Shaders/Appearances/BasicMaterialAppearanceFS.js';\r\nexport { default as _shadersBasicMaterialAppearanceVS } from './Shaders/Appearances/BasicMaterialAppearanceVS.js';\r\nexport { default as _shadersEllipsoidSurfaceAppearanceFS } from './Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js';\r\nexport { default as _shadersEllipsoidSurfaceAppearanceVS } from './Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js';\r\nexport { default as _shadersPerInstanceColorAppearanceFS } from './Shaders/Appearances/PerInstanceColorAppearanceFS.js';\r\nexport { default as _shadersPerInstanceColorAppearanceVS } from './Shaders/Appearances/PerInstanceColorAppearanceVS.js';\r\nexport { default as _shadersPerInstanceFlatColorAppearanceFS } from './Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js';\r\nexport { default as _shadersPerInstanceFlatColorAppearanceVS } from './Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js';\r\nexport { default as _shadersPolylineColorAppearanceVS } from './Shaders/Appearances/PolylineColorAppearanceVS.js';\r\nexport { default as _shadersPolylineMaterialAppearanceVS } from './Shaders/Appearances/PolylineMaterialAppearanceVS.js';\r\nexport { default as _shadersTexturedMaterialAppearanceFS } from './Shaders/Appearances/TexturedMaterialAppearanceFS.js';\r\nexport { default as _shadersTexturedMaterialAppearanceVS } from './Shaders/Appearances/TexturedMaterialAppearanceVS.js';\r\nexport { default as _shadersCzmBuiltins } from './Shaders/Builtin/CzmBuiltins.js';\r\nexport { default as _shadersAspectRampMaterial } from './Shaders/Materials/AspectRampMaterial.js';\r\nexport { default as _shadersBumpMapMaterial } from './Shaders/Materials/BumpMapMaterial.js';\r\nexport { default as _shadersCheckerboardMaterial } from './Shaders/Materials/CheckerboardMaterial.js';\r\nexport { default as _shadersDotMaterial } from './Shaders/Materials/DotMaterial.js';\r\nexport { default as _shadersElevationBandMaterial } from './Shaders/Materials/ElevationBandMaterial.js';\r\nexport { default as _shadersElevationContourMaterial } from './Shaders/Materials/ElevationContourMaterial.js';\r\nexport { default as _shadersElevationRampMaterial } from './Shaders/Materials/ElevationRampMaterial.js';\r\nexport { default as _shadersFadeMaterial } from './Shaders/Materials/FadeMaterial.js';\r\nexport { default as _shadersGridMaterial } from './Shaders/Materials/GridMaterial.js';\r\nexport { default as _shadersNormalMapMaterial } from './Shaders/Materials/NormalMapMaterial.js';\r\nexport { default as _shadersPolylineArrowMaterial } from './Shaders/Materials/PolylineArrowMaterial.js';\r\nexport { default as _shadersPolylineDashMaterial } from './Shaders/Materials/PolylineDashMaterial.js';\r\nexport { default as _shadersPolylineGlowMaterial } from './Shaders/Materials/PolylineGlowMaterial.js';\r\nexport { default as _shadersPolylineOutlineMaterial } from './Shaders/Materials/PolylineOutlineMaterial.js';\r\nexport { default as _shadersRimLightingMaterial } from './Shaders/Materials/RimLightingMaterial.js';\r\nexport { default as _shadersSlopeRampMaterial } from './Shaders/Materials/SlopeRampMaterial.js';\r\nexport { default as _shadersStripeMaterial } from './Shaders/Materials/StripeMaterial.js';\r\nexport { default as _shadersWater } from './Shaders/Materials/Water.js';\r\nexport { default as _shadersCPUStylingStageFS } from './Shaders/Model/CPUStylingStageFS.js';\r\nexport { default as _shadersCPUStylingStageVS } from './Shaders/Model/CPUStylingStageVS.js';\r\nexport { default as _shadersCustomShaderStageFS } from './Shaders/Model/CustomShaderStageFS.js';\r\nexport { default as _shadersCustomShaderStageVS } from './Shaders/Model/CustomShaderStageVS.js';\r\nexport { default as _shadersFeatureIdStageFS } from './Shaders/Model/FeatureIdStageFS.js';\r\nexport { default as _shadersFeatureIdStageVS } from './Shaders/Model/FeatureIdStageVS.js';\r\nexport { default as _shadersGeometryStageFS } from './Shaders/Model/GeometryStageFS.js';\r\nexport { default as _shadersGeometryStageVS } from './Shaders/Model/GeometryStageVS.js';\r\nexport { default as _shadersImageBasedLightingStageFS } from './Shaders/Model/ImageBasedLightingStageFS.js';\r\nexport { default as _shadersInstancingStageCommon } from './Shaders/Model/InstancingStageCommon.js';\r\nexport { default as _shadersInstancingStageVS } from './Shaders/Model/InstancingStageVS.js';\r\nexport { default as _shadersLegacyInstancingStageVS } from './Shaders/Model/LegacyInstancingStageVS.js';\r\nexport { default as _shadersLightingStageFS } from './Shaders/Model/LightingStageFS.js';\r\nexport { default as _shadersMaterialStageFS } from './Shaders/Model/MaterialStageFS.js';\r\nexport { default as _shadersMetadataStageFS } from './Shaders/Model/MetadataStageFS.js';\r\nexport { default as _shadersMetadataStageVS } from './Shaders/Model/MetadataStageVS.js';\r\nexport { default as _shadersModelClippingPlanesStageFS } from './Shaders/Model/ModelClippingPlanesStageFS.js';\r\nexport { default as _shadersModelColorStageFS } from './Shaders/Model/ModelColorStageFS.js';\r\nexport { default as _shadersModelFS } from './Shaders/Model/ModelFS.js';\r\nexport { default as _shadersModelSilhouetteStageFS } from './Shaders/Model/ModelSilhouetteStageFS.js';\r\nexport { default as _shadersModelSilhouetteStageVS } from './Shaders/Model/ModelSilhouetteStageVS.js';\r\nexport { default as _shadersModelSplitterStageFS } from './Shaders/Model/ModelSplitterStageFS.js';\r\nexport { default as _shadersModelVS } from './Shaders/Model/ModelVS.js';\r\nexport { default as _shadersMorphTargetsStageVS } from './Shaders/Model/MorphTargetsStageVS.js';\r\nexport { default as _shadersPointCloudStylingStageVS } from './Shaders/Model/PointCloudStylingStageVS.js';\r\nexport { default as _shadersPrimitiveOutlineStageFS } from './Shaders/Model/PrimitiveOutlineStageFS.js';\r\nexport { default as _shadersPrimitiveOutlineStageVS } from './Shaders/Model/PrimitiveOutlineStageVS.js';\r\nexport { default as _shadersSelectedFeatureIdStageCommon } from './Shaders/Model/SelectedFeatureIdStageCommon.js';\r\nexport { default as _shadersSkinningStageVS } from './Shaders/Model/SkinningStageVS.js';\r\nexport { default as _shadersAcesTonemappingStage } from './Shaders/PostProcessStages/AcesTonemappingStage.js';\r\nexport { default as _shadersAdditiveBlend } from './Shaders/PostProcessStages/AdditiveBlend.js';\r\nexport { default as _shadersAmbientOcclusionGenerate } from './Shaders/PostProcessStages/AmbientOcclusionGenerate.js';\r\nexport { default as _shadersAmbientOcclusionModulate } from './Shaders/PostProcessStages/AmbientOcclusionModulate.js';\r\nexport { default as _shadersBlackAndWhite } from './Shaders/PostProcessStages/BlackAndWhite.js';\r\nexport { default as _shadersBloomComposite } from './Shaders/PostProcessStages/BloomComposite.js';\r\nexport { default as _shadersBrightness } from './Shaders/PostProcessStages/Brightness.js';\r\nexport { default as _shadersBrightPass } from './Shaders/PostProcessStages/BrightPass.js';\r\nexport { default as _shadersCompositeTranslucentClassification } from './Shaders/PostProcessStages/CompositeTranslucentClassification.js';\r\nexport { default as _shadersContrastBias } from './Shaders/PostProcessStages/ContrastBias.js';\r\nexport { default as _shadersDepthOfField } from './Shaders/PostProcessStages/DepthOfField.js';\r\nexport { default as _shadersDepthView } from './Shaders/PostProcessStages/DepthView.js';\r\nexport { default as _shadersDepthViewPacked } from './Shaders/PostProcessStages/DepthViewPacked.js';\r\nexport { default as _shadersEdgeDetection } from './Shaders/PostProcessStages/EdgeDetection.js';\r\nexport { default as _shadersFilmicTonemapping } from './Shaders/PostProcessStages/FilmicTonemapping.js';\r\nexport { default as _shadersFXAA } from './Shaders/PostProcessStages/FXAA.js';\r\nexport { default as _shadersGaussianBlur1D } from './Shaders/PostProcessStages/GaussianBlur1D.js';\r\nexport { default as _shadersLensFlare } from './Shaders/PostProcessStages/LensFlare.js';\r\nexport { default as _shadersModifiedReinhardTonemapping } from './Shaders/PostProcessStages/ModifiedReinhardTonemapping.js';\r\nexport { default as _shadersNightVision } from './Shaders/PostProcessStages/NightVision.js';\r\nexport { default as _shadersPassThrough } from './Shaders/PostProcessStages/PassThrough.js';\r\nexport { default as _shadersPassThroughDepth } from './Shaders/PostProcessStages/PassThroughDepth.js';\r\nexport { default as _shadersPointCloudEyeDomeLighting } from './Shaders/PostProcessStages/PointCloudEyeDomeLighting.js';\r\nexport { default as _shadersReinhardTonemapping } from './Shaders/PostProcessStages/ReinhardTonemapping.js';\r\nexport { default as _shadersSilhouette } from './Shaders/PostProcessStages/Silhouette.js';\r\nexport { default as Animation } from './Widgets/Animation/Animation.js';\r\nexport { default as AnimationViewModel } from './Widgets/Animation/AnimationViewModel.js';\r\nexport { default as BaseLayerPicker } from './Widgets/BaseLayerPicker/BaseLayerPicker.js';\r\nexport { default as BaseLayerPickerViewModel } from './Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js';\r\nexport { default as createDefaultImageryProviderViewModels } from './Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels.js';\r\nexport { default as createDefaultTerrainProviderViewModels } from './Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels.js';\r\nexport { default as ProviderViewModel } from './Widgets/BaseLayerPicker/ProviderViewModel.js';\r\nexport { default as Cesium3DTilesInspector } from './Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.js';\r\nexport { default as Cesium3DTilesInspectorViewModel } from './Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js';\r\nexport { default as CesiumInspector } from './Widgets/CesiumInspector/CesiumInspector.js';\r\nexport { default as CesiumInspectorViewModel } from './Widgets/CesiumInspector/CesiumInspectorViewModel.js';\r\nexport { default as CesiumWidget } from './Widgets/CesiumWidget/CesiumWidget.js';\r\nexport { default as FullscreenButton } from './Widgets/FullscreenButton/FullscreenButton.js';\r\nexport { default as FullscreenButtonViewModel } from './Widgets/FullscreenButton/FullscreenButtonViewModel.js';\r\nexport { default as Geocoder } from './Widgets/Geocoder/Geocoder.js';\r\nexport { default as GeocoderViewModel } from './Widgets/Geocoder/GeocoderViewModel.js';\r\nexport { default as HomeButton } from './Widgets/HomeButton/HomeButton.js';\r\nexport { default as HomeButtonViewModel } from './Widgets/HomeButton/HomeButtonViewModel.js';\r\nexport { default as InfoBox } from './Widgets/InfoBox/InfoBox.js';\r\nexport { default as InfoBoxViewModel } from './Widgets/InfoBox/InfoBoxViewModel.js';\r\nexport { default as NavigationHelpButton } from './Widgets/NavigationHelpButton/NavigationHelpButton.js';\r\nexport { default as NavigationHelpButtonViewModel } from './Widgets/NavigationHelpButton/NavigationHelpButtonViewModel.js';\r\nexport { default as PerformanceWatchdog } from './Widgets/PerformanceWatchdog/PerformanceWatchdog.js';\r\nexport { default as PerformanceWatchdogViewModel } from './Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel.js';\r\nexport { default as ProjectionPicker } from './Widgets/ProjectionPicker/ProjectionPicker.js';\r\nexport { default as ProjectionPickerViewModel } from './Widgets/ProjectionPicker/ProjectionPickerViewModel.js';\r\nexport { default as SceneModePicker } from './Widgets/SceneModePicker/SceneModePicker.js';\r\nexport { default as SceneModePickerViewModel } from './Widgets/SceneModePicker/SceneModePickerViewModel.js';\r\nexport { default as SelectionIndicator } from './Widgets/SelectionIndicator/SelectionIndicator.js';\r\nexport { default as SelectionIndicatorViewModel } from './Widgets/SelectionIndicator/SelectionIndicatorViewModel.js';\r\nexport { default as Timeline } from './Widgets/Timeline/Timeline.js';\r\nexport { default as TimelineHighlightRange } from './Widgets/Timeline/TimelineHighlightRange.js';\r\nexport { default as TimelineTrack } from './Widgets/Timeline/TimelineTrack.js';\r\nexport { default as Viewer } from './Widgets/Viewer/Viewer.js';\r\nexport { default as viewerCesium3DTilesInspectorMixin } from './Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js';\r\nexport { default as viewerCesiumInspectorMixin } from './Widgets/Viewer/viewerCesiumInspectorMixin.js';\r\nexport { default as viewerDragDropMixin } from './Widgets/Viewer/viewerDragDropMixin.js';\r\nexport { default as viewerPerformanceWatchdogMixin } from './Widgets/Viewer/viewerPerformanceWatchdogMixin.js';\r\nexport { default as VRButton } from './Widgets/VRButton/VRButton.js';\r\nexport { default as VRButtonViewModel } from './Widgets/VRButton/VRButtonViewModel.js';\r\nexport { default as addBuffer } from './Scene/GltfPipeline/addBuffer.js';\r\nexport { default as addDefaults } from './Scene/GltfPipeline/addDefaults.js';\r\nexport { default as addExtensionsRequired } from './Scene/GltfPipeline/addExtensionsRequired.js';\r\nexport { default as addExtensionsUsed } from './Scene/GltfPipeline/addExtensionsUsed.js';\r\nexport { default as addPipelineExtras } from './Scene/GltfPipeline/addPipelineExtras.js';\r\nexport { default as addToArray } from './Scene/GltfPipeline/addToArray.js';\r\nexport { default as findAccessorMinMax } from './Scene/GltfPipeline/findAccessorMinMax.js';\r\nexport { default as ForEach } from './Scene/GltfPipeline/ForEach.js';\r\nexport { default as forEachTextureInMaterial } from './Scene/GltfPipeline/forEachTextureInMaterial.js';\r\nexport { default as getAccessorByteStride } from './Scene/GltfPipeline/getAccessorByteStride.js';\r\nexport { default as getComponentReader } from './Scene/GltfPipeline/getComponentReader.js';\r\nexport { default as moveTechniqueRenderStates } from './Scene/GltfPipeline/moveTechniqueRenderStates.js';\r\nexport { default as moveTechniquesToExtension } from './Scene/GltfPipeline/moveTechniquesToExtension.js';\r\nexport { default as numberOfComponentsForType } from './Scene/GltfPipeline/numberOfComponentsForType.js';\r\nexport { default as parseGlb } from './Scene/GltfPipeline/parseGlb.js';\r\nexport { default as readAccessorPacked } from './Scene/GltfPipeline/readAccessorPacked.js';\r\nexport { default as removeExtension } from './Scene/GltfPipeline/removeExtension.js';\r\nexport { default as removeExtensionsRequired } from './Scene/GltfPipeline/removeExtensionsRequired.js';\r\nexport { default as removeExtensionsUsed } from './Scene/GltfPipeline/removeExtensionsUsed.js';\r\nexport { default as removePipelineExtras } from './Scene/GltfPipeline/removePipelineExtras.js';\r\nexport { default as removeUnusedElements } from './Scene/GltfPipeline/removeUnusedElements.js';\r\nexport { default as updateAccessorComponentTypes } from './Scene/GltfPipeline/updateAccessorComponentTypes.js';\r\nexport { default as updateVersion } from './Scene/GltfPipeline/updateVersion.js';\r\nexport { default as usesExtension } from './Scene/GltfPipeline/usesExtension.js';\r\nexport { default as AlphaPipelineStage } from './Scene/Model/AlphaPipelineStage.js';\r\nexport { default as B3dmLoader } from './Scene/Model/B3dmLoader.js';\r\nexport { default as BatchTexturePipelineStage } from './Scene/Model/BatchTexturePipelineStage.js';\r\nexport { default as buildDrawCommand } from './Scene/Model/buildDrawCommand.js';\r\nexport { default as ClassificationModelDrawCommand } from './Scene/Model/ClassificationModelDrawCommand.js';\r\nexport { default as ClassificationPipelineStage } from './Scene/Model/ClassificationPipelineStage.js';\r\nexport { default as CPUStylingPipelineStage } from './Scene/Model/CPUStylingPipelineStage.js';\r\nexport { default as CustomShader } from './Scene/Model/CustomShader.js';\r\nexport { default as CustomShaderMode } from './Scene/Model/CustomShaderMode.js';\r\nexport { default as CustomShaderPipelineStage } from './Scene/Model/CustomShaderPipelineStage.js';\r\nexport { default as CustomShaderTranslucencyMode } from './Scene/Model/CustomShaderTranslucencyMode.js';\r\nexport { default as DequantizationPipelineStage } from './Scene/Model/DequantizationPipelineStage.js';\r\nexport { default as FeatureIdPipelineStage } from './Scene/Model/FeatureIdPipelineStage.js';\r\nexport { default as GeoJsonLoader } from './Scene/Model/GeoJsonLoader.js';\r\nexport { default as GeometryPipelineStage } from './Scene/Model/GeometryPipelineStage.js';\r\nexport { default as I3dmLoader } from './Scene/Model/I3dmLoader.js';\r\nexport { default as ImageBasedLightingPipelineStage } from './Scene/Model/ImageBasedLightingPipelineStage.js';\r\nexport { default as InstancingPipelineStage } from './Scene/Model/InstancingPipelineStage.js';\r\nexport { default as LightingModel } from './Scene/Model/LightingModel.js';\r\nexport { default as LightingPipelineStage } from './Scene/Model/LightingPipelineStage.js';\r\nexport { default as MaterialPipelineStage } from './Scene/Model/MaterialPipelineStage.js';\r\nexport { default as MetadataPipelineStage } from './Scene/Model/MetadataPipelineStage.js';\r\nexport { default as Model } from './Scene/Model/Model.js';\r\nexport { default as Model3DTileContent } from './Scene/Model/Model3DTileContent.js';\r\nexport { default as ModelAlphaOptions } from './Scene/Model/ModelAlphaOptions.js';\r\nexport { default as ModelAnimation } from './Scene/Model/ModelAnimation.js';\r\nexport { default as ModelAnimationChannel } from './Scene/Model/ModelAnimationChannel.js';\r\nexport { default as ModelAnimationCollection } from './Scene/Model/ModelAnimationCollection.js';\r\nexport { default as ModelArticulation } from './Scene/Model/ModelArticulation.js';\r\nexport { default as ModelArticulationStage } from './Scene/Model/ModelArticulationStage.js';\r\nexport { default as ModelClippingPlanesPipelineStage } from './Scene/Model/ModelClippingPlanesPipelineStage.js';\r\nexport { default as ModelColorPipelineStage } from './Scene/Model/ModelColorPipelineStage.js';\r\nexport { default as ModelDrawCommand } from './Scene/Model/ModelDrawCommand.js';\r\nexport { default as ModelFeature } from './Scene/Model/ModelFeature.js';\r\nexport { default as ModelFeatureTable } from './Scene/Model/ModelFeatureTable.js';\r\nexport { default as ModelLightingOptions } from './Scene/Model/ModelLightingOptions.js';\r\nexport { default as ModelMatrixUpdateStage } from './Scene/Model/ModelMatrixUpdateStage.js';\r\nexport { default as ModelNode } from './Scene/Model/ModelNode.js';\r\nexport { default as ModelRenderResources } from './Scene/Model/ModelRenderResources.js';\r\nexport { default as ModelRuntimeNode } from './Scene/Model/ModelRuntimeNode.js';\r\nexport { default as ModelRuntimePrimitive } from './Scene/Model/ModelRuntimePrimitive.js';\r\nexport { default as ModelSceneGraph } from './Scene/Model/ModelSceneGraph.js';\r\nexport { default as ModelSilhouettePipelineStage } from './Scene/Model/ModelSilhouettePipelineStage.js';\r\nexport { default as ModelSkin } from './Scene/Model/ModelSkin.js';\r\nexport { default as ModelSplitterPipelineStage } from './Scene/Model/ModelSplitterPipelineStage.js';\r\nexport { default as ModelStatistics } from './Scene/Model/ModelStatistics.js';\r\nexport { default as ModelType } from './Scene/Model/ModelType.js';\r\nexport { default as ModelUtility } from './Scene/Model/ModelUtility.js';\r\nexport { default as MorphTargetsPipelineStage } from './Scene/Model/MorphTargetsPipelineStage.js';\r\nexport { default as NodeRenderResources } from './Scene/Model/NodeRenderResources.js';\r\nexport { default as NodeStatisticsPipelineStage } from './Scene/Model/NodeStatisticsPipelineStage.js';\r\nexport { default as PickingPipelineStage } from './Scene/Model/PickingPipelineStage.js';\r\nexport { default as PntsLoader } from './Scene/Model/PntsLoader.js';\r\nexport { default as PointCloudStylingPipelineStage } from './Scene/Model/PointCloudStylingPipelineStage.js';\r\nexport { default as PrimitiveOutlineGenerator } from './Scene/Model/PrimitiveOutlineGenerator.js';\r\nexport { default as PrimitiveOutlinePipelineStage } from './Scene/Model/PrimitiveOutlinePipelineStage.js';\r\nexport { default as PrimitiveRenderResources } from './Scene/Model/PrimitiveRenderResources.js';\r\nexport { default as PrimitiveStatisticsPipelineStage } from './Scene/Model/PrimitiveStatisticsPipelineStage.js';\r\nexport { default as SceneMode2DPipelineStage } from './Scene/Model/SceneMode2DPipelineStage.js';\r\nexport { default as SelectedFeatureIdPipelineStage } from './Scene/Model/SelectedFeatureIdPipelineStage.js';\r\nexport { default as SkinningPipelineStage } from './Scene/Model/SkinningPipelineStage.js';\r\nexport { default as StyleCommandsNeeded } from './Scene/Model/StyleCommandsNeeded.js';\r\nexport { default as TextureManager } from './Scene/Model/TextureManager.js';\r\nexport { default as TextureUniform } from './Scene/Model/TextureUniform.js';\r\nexport { default as TilesetPipelineStage } from './Scene/Model/TilesetPipelineStage.js';\r\nexport { default as UniformType } from './Scene/Model/UniformType.js';\r\nexport { default as VaryingType } from './Scene/Model/VaryingType.js';\r\nexport { default as WireframePipelineStage } from './Scene/Model/WireframePipelineStage.js';\r\nexport { default as _shadersdegreesPerRadian } from './Shaders/Builtin/Constants/degreesPerRadian.js';\r\nexport { default as _shadersdepthRange } from './Shaders/Builtin/Constants/depthRange.js';\r\nexport { default as _shadersepsilon1 } from './Shaders/Builtin/Constants/epsilon1.js';\r\nexport { default as _shadersepsilon2 } from './Shaders/Builtin/Constants/epsilon2.js';\r\nexport { default as _shadersepsilon3 } from './Shaders/Builtin/Constants/epsilon3.js';\r\nexport { default as _shadersepsilon4 } from './Shaders/Builtin/Constants/epsilon4.js';\r\nexport { default as _shadersepsilon5 } from './Shaders/Builtin/Constants/epsilon5.js';\r\nexport { default as _shadersepsilon6 } from './Shaders/Builtin/Constants/epsilon6.js';\r\nexport { default as _shadersepsilon7 } from './Shaders/Builtin/Constants/epsilon7.js';\r\nexport { default as _shadersinfinity } from './Shaders/Builtin/Constants/infinity.js';\r\nexport { default as _shadersoneOverPi } from './Shaders/Builtin/Constants/oneOverPi.js';\r\nexport { default as _shadersoneOverTwoPi } from './Shaders/Builtin/Constants/oneOverTwoPi.js';\r\nexport { default as _shaderspassCesium3DTile } from './Shaders/Builtin/Constants/passCesium3DTile.js';\r\nexport { default as _shaderspassCesium3DTileClassification } from './Shaders/Builtin/Constants/passCesium3DTileClassification.js';\r\nexport { default as _shaderspassCesium3DTileClassificationIgnoreShow } from './Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js';\r\nexport { default as _shaderspassClassification } from './Shaders/Builtin/Constants/passClassification.js';\r\nexport { default as _shaderspassCompute } from './Shaders/Builtin/Constants/passCompute.js';\r\nexport { default as _shaderspassEnvironment } from './Shaders/Builtin/Constants/passEnvironment.js';\r\nexport { default as _shaderspassGlobe } from './Shaders/Builtin/Constants/passGlobe.js';\r\nexport { default as _shaderspassOpaque } from './Shaders/Builtin/Constants/passOpaque.js';\r\nexport { default as _shaderspassOverlay } from './Shaders/Builtin/Constants/passOverlay.js';\r\nexport { default as _shaderspassTerrainClassification } from './Shaders/Builtin/Constants/passTerrainClassification.js';\r\nexport { default as _shaderspassTranslucent } from './Shaders/Builtin/Constants/passTranslucent.js';\r\nexport { default as _shaderspi } from './Shaders/Builtin/Constants/pi.js';\r\nexport { default as _shaderspiOverFour } from './Shaders/Builtin/Constants/piOverFour.js';\r\nexport { default as _shaderspiOverSix } from './Shaders/Builtin/Constants/piOverSix.js';\r\nexport { default as _shaderspiOverThree } from './Shaders/Builtin/Constants/piOverThree.js';\r\nexport { default as _shaderspiOverTwo } from './Shaders/Builtin/Constants/piOverTwo.js';\r\nexport { default as _shadersradiansPerDegree } from './Shaders/Builtin/Constants/radiansPerDegree.js';\r\nexport { default as _shaderssceneMode2D } from './Shaders/Builtin/Constants/sceneMode2D.js';\r\nexport { default as _shaderssceneMode3D } from './Shaders/Builtin/Constants/sceneMode3D.js';\r\nexport { default as _shaderssceneModeColumbusView } from './Shaders/Builtin/Constants/sceneModeColumbusView.js';\r\nexport { default as _shaderssceneModeMorphing } from './Shaders/Builtin/Constants/sceneModeMorphing.js';\r\nexport { default as _shaderssolarRadius } from './Shaders/Builtin/Constants/solarRadius.js';\r\nexport { default as _shadersthreePiOver2 } from './Shaders/Builtin/Constants/threePiOver2.js';\r\nexport { default as _shaderstwoPi } from './Shaders/Builtin/Constants/twoPi.js';\r\nexport { default as _shaderswebMercatorMaxLatitude } from './Shaders/Builtin/Constants/webMercatorMaxLatitude.js';\r\nexport { default as _shadersdepthRangeStruct } from './Shaders/Builtin/Structs/depthRangeStruct.js';\r\nexport { default as _shadersmaterial } from './Shaders/Builtin/Structs/material.js';\r\nexport { default as _shadersmaterialInput } from './Shaders/Builtin/Structs/materialInput.js';\r\nexport { default as _shadersmodelMaterial } from './Shaders/Builtin/Structs/modelMaterial.js';\r\nexport { default as _shadersmodelVertexOutput } from './Shaders/Builtin/Structs/modelVertexOutput.js';\r\nexport { default as _shaderspbrParameters } from './Shaders/Builtin/Structs/pbrParameters.js';\r\nexport { default as _shadersray } from './Shaders/Builtin/Structs/ray.js';\r\nexport { default as _shadersraySegment } from './Shaders/Builtin/Structs/raySegment.js';\r\nexport { default as _shadersshadowParameters } from './Shaders/Builtin/Structs/shadowParameters.js';\r\nexport { default as _shadersacesTonemapping } from './Shaders/Builtin/Functions/acesTonemapping.js';\r\nexport { default as _shadersalphaWeight } from './Shaders/Builtin/Functions/alphaWeight.js';\r\nexport { default as _shadersantialias } from './Shaders/Builtin/Functions/antialias.js';\r\nexport { default as _shadersapproximateSphericalCoordinates } from './Shaders/Builtin/Functions/approximateSphericalCoordinates.js';\r\nexport { default as _shadersbackFacing } from './Shaders/Builtin/Functions/backFacing.js';\r\nexport { default as _shadersbranchFreeTernary } from './Shaders/Builtin/Functions/branchFreeTernary.js';\r\nexport { default as _shaderscascadeColor } from './Shaders/Builtin/Functions/cascadeColor.js';\r\nexport { default as _shaderscascadeDistance } from './Shaders/Builtin/Functions/cascadeDistance.js';\r\nexport { default as _shaderscascadeMatrix } from './Shaders/Builtin/Functions/cascadeMatrix.js';\r\nexport { default as _shaderscascadeWeights } from './Shaders/Builtin/Functions/cascadeWeights.js';\r\nexport { default as _shaderscolumbusViewMorph } from './Shaders/Builtin/Functions/columbusViewMorph.js';\r\nexport { default as _shaderscomputePosition } from './Shaders/Builtin/Functions/computePosition.js';\r\nexport { default as _shaderscosineAndSine } from './Shaders/Builtin/Functions/cosineAndSine.js';\r\nexport { default as _shadersdecompressTextureCoordinates } from './Shaders/Builtin/Functions/decompressTextureCoordinates.js';\r\nexport { default as _shadersdefaultPbrMaterial } from './Shaders/Builtin/Functions/defaultPbrMaterial.js';\r\nexport { default as _shadersdepthClamp } from './Shaders/Builtin/Functions/depthClamp.js';\r\nexport { default as _shaderseastNorthUpToEyeCoordinates } from './Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js';\r\nexport { default as _shadersellipsoidContainsPoint } from './Shaders/Builtin/Functions/ellipsoidContainsPoint.js';\r\nexport { default as _shadersellipsoidWgs84TextureCoordinates } from './Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js';\r\nexport { default as _shadersequalsEpsilon } from './Shaders/Builtin/Functions/equalsEpsilon.js';\r\nexport { default as _shaderseyeOffset } from './Shaders/Builtin/Functions/eyeOffset.js';\r\nexport { default as _shaderseyeToWindowCoordinates } from './Shaders/Builtin/Functions/eyeToWindowCoordinates.js';\r\nexport { default as _shadersfastApproximateAtan } from './Shaders/Builtin/Functions/fastApproximateAtan.js';\r\nexport { default as _shadersfog } from './Shaders/Builtin/Functions/fog.js';\r\nexport { default as _shadersgammaCorrect } from './Shaders/Builtin/Functions/gammaCorrect.js';\r\nexport { default as _shadersgeodeticSurfaceNormal } from './Shaders/Builtin/Functions/geodeticSurfaceNormal.js';\r\nexport { default as _shadersgetDefaultMaterial } from './Shaders/Builtin/Functions/getDefaultMaterial.js';\r\nexport { default as _shadersgetLambertDiffuse } from './Shaders/Builtin/Functions/getLambertDiffuse.js';\r\nexport { default as _shadersgetSpecular } from './Shaders/Builtin/Functions/getSpecular.js';\r\nexport { default as _shadersgetWaterNoise } from './Shaders/Builtin/Functions/getWaterNoise.js';\r\nexport { default as _shadersHSBToRGB } from './Shaders/Builtin/Functions/HSBToRGB.js';\r\nexport { default as _shadersHSLToRGB } from './Shaders/Builtin/Functions/HSLToRGB.js';\r\nexport { default as _shadershue } from './Shaders/Builtin/Functions/hue.js';\r\nexport { default as _shadersinverseGamma } from './Shaders/Builtin/Functions/inverseGamma.js';\r\nexport { default as _shadersisEmpty } from './Shaders/Builtin/Functions/isEmpty.js';\r\nexport { default as _shadersisFull } from './Shaders/Builtin/Functions/isFull.js';\r\nexport { default as _shaderslatitudeToWebMercatorFraction } from './Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js';\r\nexport { default as _shaderslinearToSrgb } from './Shaders/Builtin/Functions/linearToSrgb.js';\r\nexport { default as _shaderslineDistance } from './Shaders/Builtin/Functions/lineDistance.js';\r\nexport { default as _shadersluminance } from './Shaders/Builtin/Functions/luminance.js';\r\nexport { default as _shadersmetersPerPixel } from './Shaders/Builtin/Functions/metersPerPixel.js';\r\nexport { default as _shadersmodelToWindowCoordinates } from './Shaders/Builtin/Functions/modelToWindowCoordinates.js';\r\nexport { default as _shadersmultiplyWithColorBalance } from './Shaders/Builtin/Functions/multiplyWithColorBalance.js';\r\nexport { default as _shadersnearFarScalar } from './Shaders/Builtin/Functions/nearFarScalar.js';\r\nexport { default as _shadersoctDecode } from './Shaders/Builtin/Functions/octDecode.js';\r\nexport { default as _shaderspackDepth } from './Shaders/Builtin/Functions/packDepth.js';\r\nexport { default as _shaderspbrLighting } from './Shaders/Builtin/Functions/pbrLighting.js';\r\nexport { default as _shaderspbrMetallicRoughnessMaterial } from './Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js';\r\nexport { default as _shaderspbrSpecularGlossinessMaterial } from './Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js';\r\nexport { default as _shadersphong } from './Shaders/Builtin/Functions/phong.js';\r\nexport { default as _shadersplaneDistance } from './Shaders/Builtin/Functions/planeDistance.js';\r\nexport { default as _shaderspointAlongRay } from './Shaders/Builtin/Functions/pointAlongRay.js';\r\nexport { default as _shadersrayEllipsoidIntersectionInterval } from './Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js';\r\nexport { default as _shadersraySphereIntersectionInterval } from './Shaders/Builtin/Functions/raySphereIntersectionInterval.js';\r\nexport { default as _shadersreadDepth } from './Shaders/Builtin/Functions/readDepth.js';\r\nexport { default as _shadersreadNonPerspective } from './Shaders/Builtin/Functions/readNonPerspective.js';\r\nexport { default as _shadersreverseLogDepth } from './Shaders/Builtin/Functions/reverseLogDepth.js';\r\nexport { default as _shadersRGBToHSB } from './Shaders/Builtin/Functions/RGBToHSB.js';\r\nexport { default as _shadersRGBToHSL } from './Shaders/Builtin/Functions/RGBToHSL.js';\r\nexport { default as _shadersRGBToXYZ } from './Shaders/Builtin/Functions/RGBToXYZ.js';\r\nexport { default as _shadersround } from './Shaders/Builtin/Functions/round.js';\r\nexport { default as _shaderssampleOctahedralProjection } from './Shaders/Builtin/Functions/sampleOctahedralProjection.js';\r\nexport { default as _shaderssaturation } from './Shaders/Builtin/Functions/saturation.js';\r\nexport { default as _shadersshadowDepthCompare } from './Shaders/Builtin/Functions/shadowDepthCompare.js';\r\nexport { default as _shadersshadowVisibility } from './Shaders/Builtin/Functions/shadowVisibility.js';\r\nexport { default as _shaderssignNotZero } from './Shaders/Builtin/Functions/signNotZero.js';\r\nexport { default as _shaderssphericalHarmonics } from './Shaders/Builtin/Functions/sphericalHarmonics.js';\r\nexport { default as _shaderssrgbToLinear } from './Shaders/Builtin/Functions/srgbToLinear.js';\r\nexport { default as _shaderstangentToEyeSpaceMatrix } from './Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js';\r\nexport { default as _shaderstransformPlane } from './Shaders/Builtin/Functions/transformPlane.js';\r\nexport { default as _shaderstranslateRelativeToEye } from './Shaders/Builtin/Functions/translateRelativeToEye.js';\r\nexport { default as _shaderstranslucentPhong } from './Shaders/Builtin/Functions/translucentPhong.js';\r\nexport { default as _shaderstranspose } from './Shaders/Builtin/Functions/transpose.js';\r\nexport { default as _shadersunpackDepth } from './Shaders/Builtin/Functions/unpackDepth.js';\r\nexport { default as _shadersunpackFloat } from './Shaders/Builtin/Functions/unpackFloat.js';\r\nexport { default as _shadersunpackUint } from './Shaders/Builtin/Functions/unpackUint.js';\r\nexport { default as _shadersvalueTransform } from './Shaders/Builtin/Functions/valueTransform.js';\r\nexport { default as _shadersvertexLogDepth } from './Shaders/Builtin/Functions/vertexLogDepth.js';\r\nexport { default as _shaderswindowToEyeCoordinates } from './Shaders/Builtin/Functions/windowToEyeCoordinates.js';\r\nexport { default as _shaderswriteDepthClamp } from './Shaders/Builtin/Functions/writeDepthClamp.js';\r\nexport { default as _shaderswriteLogDepth } from './Shaders/Builtin/Functions/writeLogDepth.js';\r\nexport { default as _shaderswriteNonPerspective } from './Shaders/Builtin/Functions/writeNonPerspective.js';\r\nexport { default as _shadersXYZToRGB } from './Shaders/Builtin/Functions/XYZToRGB.js';\r\nexport { default as createTaskProcessorWorker } from './WorkersES6/createTaskProcessorWorker.js';\r\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;oyBAAA,IAAAA,GAAAC,GAAA,CAAAC,IAAAC,KAAA,CAkEA,IAAIC,GAAkB,SAASC,EAAM,CAChCA,GAAQ,OACXA,EAAO,IAAI,KAAK,EAAE,QAAQ,GAI3B,KAAK,EAAI,IACT,KAAK,EAAI,IACT,KAAK,SAAW,WAChB,KAAK,WAAa,WAClB,KAAK,WAAa,WAElB,KAAK,GAAK,IAAI,MAAM,KAAK,CAAC,EAC1B,KAAK,IAAI,KAAK,EAAE,EAEZA,EAAK,aAAe,MACvB,KAAK,cAAcA,EAAMA,EAAK,MAAM,EAGpC,KAAK,UAAUA,CAAI,CAErB,EAIAD,GAAgB,UAAU,UAAY,SAASE,EAAG,CAEjD,IADA,KAAK,GAAG,GAAKA,IAAM,EACd,KAAK,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GAAK,yCACL,GAAK,0BACL,GAAK,sCACL,GAAK,eACL,GAAK,wBACL,GAAK,uBACL,GAAK,4BACL,GAAK,gCACL,GAAK,wBACL,GAAK,4BACL,GAAK,yLACL,GAAK,gCACL,GAAK,mCACL,GAAK,2DACL,GAAK,8BACL,GAAK,sCACL,GAAK,YACL,GAAK,eACL,GAAK,qCACL,GAAK,+BACL,GAAK,mCACL,GAAK,gCACL,GAAK,4CACL,GAAK,wFACL,GAAK,oBACL,GAAK,0KACL,GAAK,wBACL,GAAK,wBACL,GAAK,4BACL,GAAK,wBACL,GAAK,+DACL,GAAK,wBACL,GAAK,wCACL,GAAK,uCACL,GAAK,8BACL,GAAK,YACL,GAAK,mCACL,GAAK,mCACL,GAAK,qCACL,GAAK,+BACL,GAAK,gBACL,GAAK,wBACL,GAAK,wBACL,GAAK,mEACL,GAAK,8CACL,GAAK,wBACL,GAAK,qCACL,GAAK,mDACL,GAAK,8CACL,GAAK,sCACL,GAAK,4BACL,GAAK,iCACL,GAAK,yDACL,GAAK,oCACL,GAAK,kCACL,GAAK,wDACL,GAAK,oLACL,GAAK,2DACL,GAAK,gCACL,GAAK,yBACL,GAAK,mDACL,GAAK,yBACL,GAAK,wBACL,GAAK,wBACL,GAAK,+BACL,GAAK,wBACL,GAAK,0EACL,GAAK,wBACL,GAAK,cACL,GAAK,+EACL,GAAK,+FACL,GAAK,+CACL,GAAK,6BACL,GAAK,sBACL,GAAK,WACL,GAAK,2EACL,GAAK,+CACL,GAAK,sCACL,GAAK,4BACL,GAAK,4BACL,GAAK,iBACL,GAAK,+wBACL,GAAK,uCACL,GAAK,oCACL,GAAK,oCACL,GAAK,8EACL,GAAK,gCACL,GAAK,oCACL,GAAK,iCACL,GAAK,0BACL,GAAK,oEACL,GAAK,uGACL,GAAK,mBACL,GAAK,8UACL,GAAK,0BACL,GAAK,iKACL,GAAK,yBACL,GAAK,4BACL,GAAK,wCACL,GAAK,uBACL,GAAK,wDACL,GAAK,kCACL,GAAK,sBACL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,CAEA,OAAOL,EACT,CAGO,SAASO,EAAMC,GAAQ,CAC5B,IAAMC,GAAY1D,EAAO,IAAI,EAEzB2D,GACJ,IAAKA,MAAYF,GACXtD,EAAMX,EAAgBiE,GAAQ,CAACE,EAAQ,CAAC,IAAM,KAChDD,GAAUC,IAAYF,GAAOE,KAIjC,OAAOD,EACT,CAMA,SAASE,EAAaH,GAAQI,GAAM,CAClC,KAAOJ,KAAW,MAAM,CACtB,IAAMK,GAAOjE,EAAyB4D,GAAQI,EAAI,EAClD,GAAIC,GAAM,CACR,GAAIA,GAAKC,IACP,OAAOlD,EAAQiD,GAAKC,GAAG,EAGzB,GAAI,OAAOD,GAAKE,OAAU,WACxB,OAAOnD,EAAQiD,GAAKE,KAAK,CAE7B,CAEAP,GAAS7D,EAAe6D,EAAM,CAChC,CAEA,SAASQ,GAAcX,GAAS,CAC9BY,eAAQC,KAAK,qBAAsBb,EAAO,EACnC,IACT,CAEA,OAAOW,EACT,CCjIO,IAAMG,EAAOtE,EAAO,CACzB,IACA,OACA,UACA,UACA,OACA,UACA,QACA,QACA,IACA,MACA,MACA,MACA,QACA,aACA,OACA,KACA,SACA,SACA,UACA,SACA,OACA,OACA,MACA,WACA,UACA,OACA,WACA,KACA,YACA,MACA,UACA,MACA,SACA,MACA,MACA,KACA,KACA,UACA,KACA,WACA,aACA,SACA,OACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,MACA,QACA,MACA,MACA,QACA,SACA,KACA,OACA,MACA,OACA,UACA,OACA,WACA,QACA,MACA,OACA,KACA,WACA,SACA,SACA,IACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,UACA,SACA,SACA,QACA,SACA,SACA,OACA,SACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,WACA,QACA,KACA,QACA,OACA,KACA,QACA,KACA,IACA,KACA,MACA,QACA,KAAK,CACN,EAGYuE,EAAMvE,EAAO,CACxB,MACA,IACA,WACA,cACA,eACA,eACA,gBACA,mBACA,SACA,WACA,OACA,OACA,UACA,SACA,OACA,IACA,QACA,WACA,QACA,QACA,OACA,iBACA,SACA,OACA,WACA,QACA,OACA,UACA,UACA,WACA,iBACA,OACA,OACA,QACA,SACA,SACA,OACA,WACA,QACA,OACA,QACA,OACA,OAAO,CACR,EAEYwE,EAAaxE,EAAO,CAC/B,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,cAAc,CACf,EAMYyE,EAAgBzE,EAAO,CAClC,UACA,gBACA,SACA,UACA,eACA,YACA,mBACA,iBACA,gBACA,gBACA,gBACA,QACA,YACA,OACA,eACA,YACA,UACA,gBACA,SACA,MACA,aACA,UACA,KAAK,CACN,EAEY0E,EAAS1E,EAAO,CAC3B,OACA,WACA,SACA,UACA,QACA,SACA,KACA,aACA,gBACA,KACA,KACA,QACA,UACA,WACA,QACA,OACA,KACA,SACA,QACA,SACA,OACA,OACA,UACA,SACA,MACA,QACA,MACA,SACA,YAAY,CACb,EAIY2E,EAAmB3E,EAAO,CACrC,UACA,cACA,aACA,WACA,YACA,UACA,UACA,SACA,SACA,QACA,YACA,aACA,iBACA,cACA,MAAM,CACP,EAEY4E,GAAO5E,EAAO,CAAC,OAAO,CAAC,ECpRvBsE,GAAOtE,EAAO,CACzB,SACA,SACA,QACA,MACA,iBACA,eACA,uBACA,WACA,aACA,UACA,SACA,UACA,cACA,cACA,UACA,OACA,QACA,QACA,QACA,OACA,UACA,WACA,eACA,SACA,cACA,WACA,WACA,UACA,MACA,WACA,0BACA,wBACA,WACA,YACA,UACA,eACA,OACA,MACA,UACA,SACA,SACA,OACA,OACA,WACA,KACA,YACA,YACA,QACA,OACA,QACA,OACA,OACA,UACA,OACA,MACA,MACA,YACA,QACA,SACA,MACA,YACA,WACA,QACA,OACA,QACA,UACA,aACA,SACA,OACA,UACA,UACA,cACA,cACA,SACA,UACA,UACA,aACA,WACA,MACA,WACA,MACA,WACA,OACA,OACA,UACA,aACA,QACA,WACA,QACA,OACA,QACA,OACA,UACA,QACA,MACA,SACA,OACA,QACA,UACA,WACA,QACA,YACA,OACA,SACA,SACA,QACA,QACA,QACA,MAAM,CACP,EAEYuE,GAAMvE,EAAO,CACxB,gBACA,aACA,WACA,qBACA,SACA,gBACA,gBACA,UACA,gBACA,iBACA,QACA,OACA,KACA,QACA,OACA,gBACA,YACA,YACA,QACA,sBACA,8BACA,gBACA,kBACA,KACA,KACA,IACA,KACA,KACA,kBACA,YACA,UACA,UACA,MACA,WACA,YACA,MACA,OACA,eACA,YACA,SACA,cACA,cACA,gBACA,cACA,YACA,mBACA,eACA,aACA,eACA,cACA,KACA,KACA,KACA,KACA,aACA,WACA,gBACA,oBACA,SACA,OACA,KACA,kBACA,KACA,MACA,IACA,KACA,KACA,KACA,KACA,UACA,YACA,aACA,WACA,OACA,eACA,iBACA,eACA,mBACA,iBACA,QACA,aACA,aACA,eACA,eACA,cACA,cACA,mBACA,YACA,MACA,OACA,QACA,SACA,OACA,MACA,OACA,aACA,SACA,WACA,UACA,QACA,SACA,cACA,SACA,WACA,cACA,OACA,aACA,sBACA,mBACA,eACA,SACA,gBACA,sBACA,iBACA,IACA,KACA,KACA,SACA,OACA,OACA,cACA,YACA,UACA,SACA,SACA,QACA,OACA,kBACA,mBACA,mBACA,eACA,cACA,eACA,cACA,aACA,eACA,mBACA,oBACA,iBACA,kBACA,oBACA,iBACA,SACA,eACA,QACA,eACA,iBACA,WACA,UACA,UACA,YACA,mBACA,cACA,kBACA,iBACA,aACA,OACA,KACA,KACA,UACA,SACA,UACA,aACA,UACA,aACA,gBACA,gBACA,QACA,eACA,OACA,eACA,mBACA,mBACA,IACA,KACA,KACA,QACA,IACA,KACA,KACA,IACA,YAAY,CACb,EAEY0E,GAAS1E,EAAO,CAC3B,SACA,cACA,QACA,WACA,QACA,eACA,cACA,aACA,aACA,Q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ACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,GAAV,OACUA,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,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,EACAI,EACEH,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,EACAI,EACEH,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,EACAI,EACEH,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,EACAI,EACEH,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,EACAI,EACEH,EAAG,4BACHf,EAAO,UACPY,EACAC,EACAC,CACF,IAEAC,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,EACAgB,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,EACAgB,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,EACAgB,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,EACAgB,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,EACAgB,EAAG,WACDA,EAAG,4BACH,EACAL,EACAL,EACAA,EACA,EACAG,EACAD,GAAc,gBAAgBD,EAAeP,CAAO,EACpD,IACF,GAEFgB,EAAG,YAAYC,EAAe,IAAI,EAElC,KAAK,SAAWjB,EAChB,KAAK,0BAA4BA,EAAQ,0BACzC,KAAK,eAAiBiB,EACtB,KAAK,SAAWC,EAChB,KAAK,aAAeT,EACpB,KAAK,eAAiBF,EACtB,KAAK,MAAQD,EACb,KAAK,WAAa,GAClB,KAAK,aAAeM,EACpB,KAAK,kBAAoBC,EACzB,KAAK,OAASC,EACd,KAAK,SAAW,OAEhB,IAAMU,EAAcpB,EAAQH,CAAM,EAClC,KAAK,WAAa,IAAIwB,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EACA,KAAK,WAAa,IAAIC,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EACA,KAAK,WAAa,IAAIC,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EACA,KAAK,WAAa,IAAIC,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EACA,KAAK,WAAa,IAAIC,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EACA,KAAK,WAAa,IAAIC,GACpBzB,EACAkB,EACAD,EACAD,EAAG,4BACHL,EACAF,EACAF,EACAD,EACAO,EACAC,EACAU,CACF,EAEA,KAAK,QAAUpB,EAAQN,EAAQ,OAAO,EAAIA,EAAQ,QAAU,IAAI4B,EAClE,CAEA,OAAO,iBAAiB7B,GAAQ,UAAW,CACzC,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,UAAW,CACT,IAAK,UAAY,CACf,OAAO,KAAK,UACd,CACF,EACA,QAAS,CACP,IAAK,UAAY,CACf,OAAO,KAAK,QACd,EACA,IAAK,SAAU8B,EAAS,CACtB,IAAIC,EAAqBD,EAAQ,mBAC7BE,EAAsBF,EAAQ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AI1O,EAAQuR,CAAY,EAAG,CAEzB,IAAM5K,EAASjD,EAAW,iBACxBA,EAAW,OACX,EAAMT,EAAW,SACjB4N,GACF,EACI9E,EAAG,EAAI,IACTrI,EAAW,OAAOiD,EAAQA,CAAM,EAEhCsK,EAAe1D,EAAa,WAC5B2D,EAAY3D,EAAa,QACzB4D,EAAaf,EACbgB,EAAe5D,EAAa,WAC5B6D,EAAY7D,EAAa,QACzB8D,EAAajB,GAGf,IAAMoB,EAAc/N,EAAW,IAC7B6N,EACA5K,EACAmK,GACF,EAEAf,EAAcH,GACZqB,EACAC,EACAC,EACApR,EACAL,EACAqM,CACF,EACAgF,GACE7R,EACAC,EACA4M,EACA1L,EACA0P,EACAkB,EACAlC,CACF,EAEAgB,EAAcH,GACZqB,EACAC,EACAC,EACApR,EACA,GACA0R,CACF,EACAV,GACE7R,EACAC,EACAsS,EACApR,EACA0P,EACAkB,EACAlC,CACF,EAEArL,EAAW,OAAOiD,EAAQA,CAAM,EAChCjD,EAAW,IAAI6N,EAAc5K,EAAQ8K,CAAW,EAChD1B,EAAcH,GACZwB,EACAC,EACAC,EACAvR,EACA,GACA0R,CACF,EACAV,GACE7R,EACAC,EACAsS,EACApR,EACA0P,EACAqB,EACArC,CACF,EAEAgB,EAAcH,GACZwB,EACAC,EACAC,EACAvR,EACAL,EAAI,EACJsM,CACF,EACA+E,GACE7R,EACAC,EACA6M,EACA3L,EACA0P,EACAqB,EACArC,CACF,CACF,KAAO,CACL,IAAIC,EACAa,EACAC,EAEA/D,EAAG,EAAI,GACTiD,EAAoBzB,EAAa,WACjCsC,EAAiBtC,EAAa,QAC9BuC,EAAkBM,IAElBpB,EAAoBxB,EAAa,WACjCqC,EAAiBrC,EAAa,QAC9BsC,EAAkBO,GAGpBN,EAAcH,GACZZ,EACAa,EACAC,EACA/P,EACAL,EACAqM,CACF,EACAgF,GACE7R,EACAC,EACA4M,EACA1L,EACA0P,EACAf,EACAD,CACF,EAEAgB,EAAcH,GACZZ,EACAa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AAK0C,IAC5BT,GAAM,GAAKU,CAChB,KAAO,CACLxD,IACA2B,IAAM,EACNC,IAAM,EACNf,IAAa,EACb,IAAM4C,EAAI1E,IAAkByE,GAC5BF,GACEtD,EACA2B,GAAK8B,EAAE,IAAM,GACb7B,GAAK6B,EAAE,GAAK,GACZF,EACA1C,EACA2C,EAActE,GAAgC,EAChD,EACAoE,GACEtD,EACA2B,GAAK8B,EAAE,IAAM,GACb7B,GAAK6B,EAAE,GAAK,GACZF,EACA1C,EAAW,EACX2C,EAActE,GAAgC,EAChD,EACAoE,GACEtD,EACA2B,GAAK8B,EAAE,IAAM,GACb7B,GAAK6B,EAAE,GAAK,GACZF,EACA1C,EAAW,EACX2C,EAActE,GAAgC,EAChD,EACAoE,GACEtD,EACA2B,GAAK8B,EAAE,IAAM,GACb7B,GAAK6B,EAAE,GAAK,GACZF,EACA1C,EAAW,EACX2C,EAActE,GAAgC,EAChD,CACF,CACF,CAKA,SAASgD,KAAsB,CAC7BoB,GAAmB,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EACnCA,GAAmB,EAAG,EAAG,EAAGtE,GAAc,EAAGA,EAAY,EACzDsE,GAAmB,EAAG,EAAG,EAAGrE,GAAgB,EAAGA,EAAc,EAC7DqE,GACE,EACA,EACA,EACAtE,GAAeC,GACf,EACAD,GAAeC,EACjB,CACF,CAMA,SAASa,GAAIV,EAAQ,CACnB,OAAOA,EAAU,CAACA,EAAS,OAAO,CAAC,CACrC,CAMA,SAASa,IAAYD,EAAO,CAC1B,OAAO,OAAO,CAAC,GAAK,OAAO,GAAKxB,GAAewB,EAAM,CACvD,CAIA,IAAM0D,IAAmB,CACvB,GACA,EACA,EACA,GACA,EACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GAC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EAAGkF,EAAaE,CAAW,IAElCpF,EAAII,EAAU,OAAS,EACvB2D,EAAO/D,EAAI,EAAGkF,EAAcxB,IAAY0B,CAAW,EACnDrB,EAAO/D,EAAI,EAAGkF,EAAcvB,IAAayB,CAAW,EACpDrB,EAAO/D,EAAI,EAAGkF,EAActB,IAAawB,CAAW,EACpDrB,EAAO/D,EAAI,EAAGkF,EAAcrB,IAAYuB,CAAW,EAEvD,CAEA,SAAS6D,IACP5I,EACAgC,EACAC,EACAC,EACAnC,EACA,CACAgC,IACE/B,EACAgC,EACAC,EACAC,EACAnC,CACF,EACA0D,IACEzD,EACAgC,EACAC,EACAC,EACAnC,CACF,EACA0F,IACEzF,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAoG,GACEnG,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAgH,GACE/G,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAqH,IACEpH,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAsH,IACErH,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAwH,IACEvH,EACAgC,EACAC,EACAC,EACAnC,CACF,EACA8H,IACE7H,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAsI,IACErI,EACAgC,EACAC,EACAC,EACAnC,CACF,EACAwI,IACEvI,EACAgC,EACAC,EACAC,EACAnC,CACF,CACF,CAEA,SAAS8I,GACP7I,EACAP,EACAC,EACAsC,EACA8G,EACAC,EACA,CACA,IAAIC,EACAhH,EAAW,OAAS7C,GAAU,SAChC6J,EAAiBhJ,EAAoB,YACrCA,EAAoB,qBAAuB,IAE3CgJ,EAAiBhJ,EAAoB,cAGvC,IAAMiJ,EAAY,CAAC,EACnB,QAAStJ,EAAI,EAAGA,EAAID,EAAQ,EAAEC,EAAG,CAC/B,IAAMI,EAAYN,EAAWE,GACvB0C,EAAWtC,EAAU,SACrBmJ,EAAiB3L,GAAU,uBAC/BwC,EACAsC,EACAL,EACA8G,CACF,EACItJ,EAAQ0J,CAAc,IACxBnJ,E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K,IAEzBD,EAAe5I,EAAW,WAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA,OACAjJ,CACF,GACSM,EAAQD,EAAW,IAAI,GAC1BwI,aAA4BM,KAChCN,EAAmB,IAAIM,IAEzBF,EAAe5I,EAAW,KAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,YACAI,EAAa,UACb,OACA/G,EACAlC,CACF,EACA8H,GACE5D,EACA2E,EACA,YACAI,EAAa,UACb,OACA/G,EACAlC,CACF,EACA8H,GACE5D,EACA2E,EACA,gBACAI,EAAa,cACb,OACA/G,EACAlC,CACF,EACA8H,GACE5D,EACA2E,EACA,aACAI,EAAa,WACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,KAAK,GAC3BwI,aAA4BO,KAChCP,EAAmB,IAAIO,IAEzBH,EAAe5I,EAAW,MAC1ByH,GACE,MACAe,EACA,QACAI,EAAa,MACb,OACA/G,EACAlC,CACF,EACA8H,GACE5D,EACA2E,EACA,SACAI,EAAa,OACb,OACA/G,EACAlC,CACF,EACA8H,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA/G,EACAlC,CACF,EACA8H,GACE,QACAe,EACA,cACAI,EAAa,YACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,MAAM,GAC5BwI,aAA4BQ,KAChCR,EAAmB,IAAIQ,IAEzBJ,EAAe5I,EAAW,OAC1ByH,GACEhD,GACA+D,EACA,cACAI,EAAa,YACb,OACA/G,EACAlC,CACF,EACA8H,GACE/F,EACA8G,EACA,YACAI,EAAa,UACb,OACA/G,EACAlC,CACF,EACA8H,GACE/F,EACA8G,EACA,WACAI,EAAa,SACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,SACAI,EAAa,OACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,SACAI,EAAa,OACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,eAAe,GACrCwI,aAA4BS,KAChCT,EAAmB,IAAIS,IAEzBL,EAAe5I,EAAW,gBAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA/G,EACAlC,CACF,EACA8H,GACE/F,EACA8G,EACA,eACAI,EAAa,aACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,eACAI,EAAa,aACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,YAAY,GAClCwI,aAA4BU,KAChCV,EAAmB,IAAIU,IAEzBN,EAAe5I,EAAW,aAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,YACAI,EAAa,UACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,aACAI,EAAa,WACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,aAAa,GACnCwI,aAA4BW,KAChCX,EAAmB,IAAIW,IAEzBP,EAAe5I,EAAW,cAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA,OACAjJ,CACF,GACSM,EAAQD,EAAW,YAAY,GAClCwI,aAA4BY,KAChCZ,EAAmB,IAAIY,IAEzBR,EAAe5I,EAAW,aAC1ByH,GACE/F,EACA8G,EACA,QACAI,EAAa,MACb,OACA,OACAjJ,CACF,EACA8H,GACE/F,EACA8G,EACA,WACAI,EAAa,SACb,OACA,OACAjJ,CACF,EACA8H,GACE,OACAe,EACA,aACAI,EAAa,WACb,OACA/G,EACAlC,CACF,EACA8H,GACE,OACAe,EACA,cACAI,EAAa,YACb,OACA/G,EACAlC,CACF,GACSM,EAAQD,EAAW,YAAY,IAClCwI,aAA4Ba,KAChCb,EAAmB,IAAIa,IAEzBT,EAAe5I,EAAW,aAC1ByH,GACE/F,EACA8G,EACA,YACAI,EAAa,UACb,OACA/G,EACAlC,CACF,EACA8H,GACE/F,EACA8G,EACA,WACAI,EAAa,SACb,OACA/G,EACAlC,CACF,E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C,CACF,EACA8H,GACE,OACAoE,EACA,QACAE,EAAc,MACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE5D,EACAgI,EACA,cACAE,EAAc,YACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEjI,EACAqM,EACA,YACAE,EAAc,UACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEtD,GACA0H,EACA,mBACAE,EAAc,iBACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE9C,GACAkH,EACA,iBACAE,EAAc,eACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACA2H,EACA,kBACAE,EAAc,gBACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAmK,EACA,QACAE,EAAc,MACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE5C,GACAgH,EACA,WACAE,EAAc,SACdjG,EACAjE,EACAlC,CACF,EACAiM,IACEC,EACAE,EAAc,YACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAoE,EACA,eACAE,EAAc,aACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAoE,EACA,QACAE,EAAc,MACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAoE,EACA,SACAE,EAAc,OACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAuH,EACA,kBACAE,EAAc,gBACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAuH,EACA,yBACAE,EAAc,uBACdjG,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAuH,EACA,6BACAE,EAAc,2BACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE7D,GACAiI,EACA,iBACAE,EAAc,eACdjG,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAsH,EACA,2BACAE,EAAc,yBACdjG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAoE,EACA,2BACAE,EAAc,yBACdjG,EACAjE,EACAlC,CACF,CACF,CAEA,SAASsM,IAAWzC,EAAQC,EAAQ9J,EAAkBkC,EAAW,CAC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ACA,QACAD,EAAa,MACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA8E,EACA,SACAD,EAAa,OACbxG,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAqI,EACA,kBACAD,EAAa,gBACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA8E,EACA,iBACAD,EAAa,eACbxG,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAqI,EACA,0BACAD,EAAa,wBACbxG,EACAjE,EACAlC,CACF,EACA8H,GACExD,GACAsI,EACA,aACAD,EAAa,WACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA8E,EACA,cACAD,EAAa,YACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,QACA8E,EACA,OACAD,EAAa,KACbxG,EACAjE,EACAlC,CACF,EACA2J,GACEiD,EACA,WACAD,EAAa,SACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,QACA8E,EACA,UACAD,EAAa,QACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACA6K,EACA,eACAD,EAAa,aACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA8E,EACA,eACAD,EAAa,aACbxG,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACA+H,EACA,UACAD,EAAa,QACbxG,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAgI,EACA,2BACAD,EAAa,yBACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE1D,GACAwI,EACA,qBACAD,EAAa,mBACbxG,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA8E,EACA,SACAD,EAAa,OACbxG,EACAjE,EACAlC,CACF,CACF,CAEA,SAAS8M,IAAgBjD,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACpE,IAAM6K,EAAejD,EAAO,SAC5B,GAAI,CAACxJ,EAAQyM,CAAY,EACvB,OAGF,IAAM5G,EAAWH,GAAmB+G,EAAa,QAAQ,EACrDC,EAAWnD,EAAO,SACjBvJ,EAAQ0M,CAAQ,IACnBnD,EAAO,SAAWmD,EAAW,IAAIC,IAGnCnF,GACE,QACAkF,EACA,OACAD,EAAa,KACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,SACAD,EAAa,OACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,YACAD,EAAa,UACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,eACAD,EAAa,aACb5G,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAyI,EACA,kBACAD,EAAa,gBACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAkF,EACA,OACAD,EAAa,KACb5G,EACAjE,EACAlC,CACF,EACA2J,GACEqD,EACA,WACAD,EAAa,SACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAkF,EACA,UACAD,EAAa,QACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAiL,EACA,eACAD,EAAa,aACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,eACAD,EAAa,aACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,wBACAD,EAAa,sBACb5G,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAkF,EACA,SACAD,EAAa,OACb5G,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAmI,EACA,UACAD,EAAa,QACb5G,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAoI,EACA,2BACAD,EAAa,yBACb5G,EACAjE,EACAlC,CACF,CACF,CAEA,SAASkN,IAAgBpD,EAAQqD,EAAY,CAC3C,IAAMC,EAAUtD,EAAO,QACvB,GAAIxJ,EAAQ8M,CAAO,GACb,OAAOA,GAAY,SAAU,CAC/B,IAAMC,EAASD,EAAQ,MAAM,GAAG,EAChC,GAAIC,EAAO,SAAW,EAAG,CACvB,GAAIA,EAAO,KAAO,IAChB,MAAM,IAAI1M,GAAa,sCAAsC,EAE/DwM,EAAW,SAAWC,CACxB,CACF,CAGF,GAAI,CAAC9M,EA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,CACF,EACA8H,GACE,OACA6F,EACA,iBACAD,EAAY,eACZvH,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAoJ,EACA,0BACAD,EAAY,wBACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE5C,GACAyI,EACA,WACAD,EAAY,SACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE5C,GACAyI,EACA,aACAD,EAAY,WACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA6F,EACA,cACAD,EAAY,YACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,QACA6F,EACA,OACAD,EAAY,KACZvH,EACAjE,EACAlC,CACF,EACA2J,GACEgE,EACA,WACAD,EAAY,SACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,QACA6F,EACA,UACAD,EAAY,QACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACA4L,EACA,eACAD,EAAY,aACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA6F,EACA,eACAD,EAAY,aACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA6F,EACA,wBACAD,EAAY,sBACZvH,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACA8I,EACA,UACAD,EAAY,QACZvH,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACA+I,EACA,2BACAD,EAAY,yBACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE1D,GACAuJ,EACA,qBACAD,EAAY,mBACZvH,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA6F,EACA,SACAD,EAAY,OACZvH,EACAjE,EACAlC,CACF,CACF,CAEA,SAAS6N,IAAiBhE,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACrE,IAAM4L,EAAgBhE,EAAO,UAC7B,GAAI,CAACxJ,EAAQwN,CAAa,EACxB,OAGF,IAAM3H,EAAWH,GAAmB8H,EAAc,QAAQ,EACtDC,EAAYlE,EAAO,UAClBvJ,EAAQyN,CAAS,IACpBlE,EAAO,UAAYkE,EAAY,IAAIC,IAGrClG,GACE,QACAiG,EACA,OACAD,EAAc,KACd3H,EACAjE,EACAlC,CACF,EACA8H,GACEjI,EACAkO,EACA,QACAD,EAAc,MACd3H,EACAjE,EACAlC,CACF,EACA8H,GACEjI,EACAkO,EACA,aACAD,EAAc,WACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,eACAD,EAAc,aACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,eACAD,EAAc,aACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,cACAD,EAAc,YACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,cACAD,EAAc,YACd3H,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAwJ,EACA,kBACAD,EAAc,gBACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiG,EACA,OACAD,EAAc,KACd3H,EACAjE,EACAlC,CACF,EACA2J,GACEoE,EACA,WACAD,EAAc,SACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiG,EACA,UACAD,EAAc,QACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAgM,EACA,eACAD,EAAc,aACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,eACAD,EAAc,aACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,kBACAD,EAAc,gBACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,kBACAD,EAAc,gBACd3H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiG,EACA,eACAD,EAAc,aACd3H,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAkJ,EACA,UACAD,EAAc,QACd3H,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAmJ,EACA,2BACAD,EAAc,yBACd3H,EACAjE,EACAlC,CACF,CACF,CAEA,SAASiO,IAAapE,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACjE,IAAMgM,EAAYpE,EAAO,MACzB,GAAI,CAACxJ,EAAQ4N,CAAS,EACpB,OAGF,IAAM/H,EAAWH,GAAmBkI,EAAU,QAAQ,EAClDC,EAAQtE,EAAO,MACdvJ,EAAQ6N,CAAK,IAChBtE,EAAO,MAAQsE,EAAQ,IAAIC,IAG7BtG,GACE,QACAqG,EACA,OACAD,EAAU,KACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAqG,EACA,OACAD,EAAU,KACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAqG,EACA,OACAD,EAAU,KACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEpD,GACAyJ,EACA,QACAD,EAAU,MACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAqG,EACA,QACAD,EAAU,MACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAqG,EACA,iBACAD,EAAU,eACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAoM,EACA,kBACAD,EAAU,gBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE5D,EACAiK,EACA,oBACAD,EAAU,kBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE5D,EACAiK,EACA,cACAD,EAAU,YACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEjI,EACAsO,EACA,YACAD,EAAU,UACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEtD,GACA2J,EACA,mBACAD,EAAU,iBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE9C,GACAmJ,EACA,iBACAD,EAAU,eACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACA4J,EACA,kBACAD,EAAU,gBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAoM,EACA,YACAD,EAAU,UACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAoM,EACA,eACAD,EAAU,aACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAqG,EACA,eACAD,EAAU,aACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAwJ,EACA,yBACAD,EAAU,uBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAwJ,EACA,6BACAD,EAAU,2BACV/H,EACAjE,EACAlC,CACF,EACA8H,GACEnD,GACAwJ,EACA,kBACAD,EAAU,gBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAuJ,EACA,2BACAD,EAAU,yBACV/H,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAqG,EACA,2BACAD,EAAU,yBACV/H,EACAjE,EACAlC,CACF,CACF,CAEA,SAASqO,IAAaxE,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACjE,IAAMoM,EAAYxE,EAAO,MACzB,GAAI,CAACxJ,EAAQgO,CAAS,EACpB,OAGF,IAAMnI,EAAWH,GAAmBsI,EAAU,QAAQ,EAClDC,EAAQ1E,EAAO,MACdvJ,EAAQiO,CAAK,IAChB1E,EAAO,MAAQ0E,EAAQ,IAAIC,IAG7B1G,GACE,QACAyG,EACA,OACAD,EAAU,KACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,GAAA/C,QACAwJ,EACA,MACAD,EAAU,KACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAyG,EACA,QACAD,EAAU,MACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAyG,EACA,mBACAD,EAAU,iBACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAyG,EACA,eACAD,EAAU,aACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAyG,EACA,4BACAD,EAAU,0BACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAyG,EACA,gBACAD,EAAU,cACVnI,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAyG,EACA,kBACAD,EAAU,gBACVnI,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACA0J,EACA,UACAD,EAAU,QACVnI,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACAgK,EACA,kBACAD,EAAU,gBACVnI,EACAjE,EACAlC,CACF,EACA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ACA,OACAS,EAAY,KACZrK,EACAjE,EACAlC,CACF,EACA2J,GACEoG,EACA,WACAS,EAAY,SACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiI,EACA,UACAS,EAAY,QACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAgO,EACA,eACAS,EAAY,aACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiI,EACA,eACAS,EAAY,aACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiI,EACA,oBACAS,EAAY,kBACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiI,EACA,WACAS,EAAY,SACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAiI,EACA,cACAS,EAAY,YACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE3D,GACA4L,EACA,UACAS,EAAY,QACZrK,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAkL,EACA,UACAS,EAAY,QACZrK,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAmL,EACA,2BACAS,EAAY,yBACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE1D,GACA2L,EACA,qBACAS,EAAY,mBACZrK,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAiI,EACA,SACAS,EAAY,OACZrK,EACAjE,EACAlC,CACF,CACF,CAEA,SAAS0Q,IAA4BC,EAAe,CAClD,OAAOA,EAAgBxM,GAAQ,SAAWA,GAAQ,IACpD,CAEA,SAASyM,IAAgB/G,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACpE,IAAM2O,EAAe/G,EAAO,SAC5B,GAAI,CAACxJ,EAAQuQ,CAAY,EACvB,OAGF,IAAM1K,EAAWH,GAAmB6K,EAAa,QAAQ,EACrDC,EAAWjH,EAAO,SA8GtB,GA7GKvJ,EAAQwQ,CAAQ,IACnBjH,EAAO,SAAWiH,EAAW,IAAIC,IAGnCjJ,GACE,QACAgJ,EACA,OACAD,EAAa,KACb1K,EACAjE,EACAlC,CACF,EACAsL,GACEwF,EACA,YACAD,EAAa,UACb7Q,CACF,EACA8H,GACE,OACAgJ,EACA,QACAD,EAAa,MACb1K,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAgJ,EACA,cACAD,EAAa,YACb1K,EACAjE,EACAlC,CACF,EACA2J,GACEmH,EACA,WACAD,EAAa,SACb1K,EACAjE,EACAlC,CACF,EACA2J,GACEmH,EACA,oBACAD,EAAa,kBACb1K,EACAjE,EACAlC,CACF,EACA8H,GACE3D,GACA2M,EACA,UACAD,EAAa,QACb1K,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAgJ,EACA,gBACAD,EAAa,cACb1K,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAiM,EACA,UACAD,EAAa,QACb1K,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAkM,EACA,2BACAD,EAAa,yBACb1K,EACAjE,EACAlC,CACF,EACA8H,GACE1D,GACA0M,EACA,qBACAD,EAAa,mBACb1K,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAgJ,EACA,SACAD,EAAa,OACb1K,EACAjE,EACAlC,CACF,EAGIM,EAAQuQ,EAAa,aAAa,GAAK,CAACvQ,EAAQuQ,EAAa,OAAO,EAAG,CACzE,IAAMjF,EAAU,CAAC,EACjB9D,GACE,QACA8D,EACA,gBACAiF,EAAa,cACb1K,EACAjE,EACAlC,CACF,EACA8Q,EAAS,QAAUlQ,IACjBgL,EAAQ,cACR8E,GACF,CACF,CACF,CAEA,SAASM,IAAsBnH,EAAQC,EAAQ9J,EAAkBkC,EAAW,CAC1E,IAAM+O,EAAqBnH,EAAO,eAClC,GAAI,CAACxJ,EAAQ2Q,CAAkB,EAC7B,OAGF,IAAM9K,EAAWH,GAAmBiL,EAAmB,QAAQ,EAC3DC,EAAiBrH,EAAO,eACvBvJ,EAAQ4Q,CAAc,IACzBrH,EAAO,eAAiBqH,EAAiB,IAAIC,IAG/C7F,GACE4F,EACA,YACAD,EAAmB,UACnBjR,CACF,EACA8L,IACEoF,EACA,QACAD,EAAmB,MACnBjR,CACF,EACA8H,GACE,QACAoJ,EACA,OACAD,EAAmB,KACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACExD,GACA4M,EACA,aACAD,EAAmB,WACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAoJ,EACA,OACAD,EAAmB,KACnB9K,EACAjE,EACAlC,CACF,EACA2J,GACEuH,EACA,WACAD,EAAmB,SACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAoJ,EACA,UACAD,EAAmB,QACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAmP,EACA,eACAD,EAAmB,aACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAoJ,EACA,eACAD,EAAmB,aACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAoJ,EACA,cACAD,EAAmB,YACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAqM,EACA,UACAD,EAAmB,QACnB9K,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAsM,EACA,2BACAD,EAAmB,yBACnB9K,EACAjE,EACAlC,CACF,CACF,CAEA,SAASoR,IAAiBvH,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACrE,IAAMmP,EAAgBvH,EAAO,UAC7B,GAAI,CAACxJ,EAAQ+Q,CAAa,EACxB,OAGF,IAAMlL,EAAWH,GAAmBqL,EAAc,QAAQ,EACtDC,EAAYzH,EAAO,UAClBvJ,EAAQgR,CAAS,IACpBzH,EAAO,UAAYyH,EAAY,IAAIC,IAGrCzJ,GACE,QACAwJ,EACA,OACAD,EAAc,KACdlL,EACAjE,EACAlC,CACF,EACA8H,GACErF,GACA6O,EACA,cACAD,EAAc,YACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAwJ,EACA,SACAD,EAAc,OACdlL,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACA+M,EACA,kBACAD,EAAc,gBACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAwJ,EACA,iBACAD,EAAc,eACdlL,EACAjE,EACAlC,CACF,EACA8H,GACEvD,GACA+M,EACA,0BACAD,EAAc,wBACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE5C,GACAoM,EACA,WACAD,EAAc,SACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE5C,GACAoM,EACA,aACAD,EAAc,WACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAwJ,EACA,cACAD,EAAc,YACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAwJ,EACA,OACAD,EAAc,KACdlL,EACAjE,EACAlC,CACF,EACA2J,GACE2H,EACA,WACAD,EAAc,SACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAwJ,EACA,UACAD,EAAc,QACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACAuP,EACA,eACAD,EAAc,aACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAwJ,EACA,eACAD,EAAc,aACdlL,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAyM,EACA,UACAD,EAAc,QACdlL,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACA0M,EACA,2BACAD,EAAc,yBACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE1D,GACAkN,EACA,qBACAD,EAAc,mBACdlL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAwJ,EACA,SACAD,EAAc,OACdlL,EACAjE,EACAlC,CACF,CACF,CAEA,SAASwR,IAAe3H,EAAQC,EAAQ9J,EAAkBkC,EAAW,CACnE,IAAMuP,EAAc3H,EAAO,QAC3B,GAAI,CAACxJ,EAAQmR,CAAW,EACtB,OAGF,IAAMtL,EAAWH,GAAmByL,EAAY,QAAQ,EACpDC,EAAU7H,EAAO,QAChBvJ,EAAQoR,CAAO,IAClB7H,EAAO,QAAU6H,EAAU,IAAIC,IAGjC7J,GACE,QACA4J,EACA,OACAD,EAAY,KACZtL,EACAjE,EACAlC,CACF,EACA8H,GACE,GAAA/C,QACA2M,EACA,MACAD,EAAY,IACZtL,EACAjE,EACAlC,CACF,EACA8H,GACE,OACA4J,EACA,0BACAD,EAAY,wBACZtL,EACAjE,EACAlC,CACF,CACF,CAEA,SAAS4R,IAAY/H,EAAQC,EAAQ9J,EAAkBkC,EAAW,CAChE,IAAM2P,EAAW/H,EAAO,KACxB,GAAI,CAACxJ,EAAQuR,CAAQ,EACnB,OAGF,IAAM1L,EAAWH,GAAmB6L,EAAS,QAAQ,EACjDC,EAAOjI,EAAO,KACbvJ,EAAQwR,CAAI,IACfjI,EAAO,KAAOiI,EAAO,IAAIC,IAG3BjK,GACE,QACAgK,EACA,OACAD,EAAS,KACT1L,EACAjE,EACAlC,CACF,EACAsL,GAAqBwG,EAAM,YAAaD,EAAS,UAAW7R,CAAgB,EAC5EmL,IACE2G,EACA,iBACAD,EAAS,eACT7R,CACF,EACAmL,IACE2G,EACA,iBACAD,EAAS,eACT7R,CACF,EACA8H,GACE,OACAgK,EACA,cACAD,EAAS,YACT1L,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAgK,EACA,OACAD,EAAS,KACT1L,EACAjE,EACAlC,CACF,EACA2J,GACEmI,EACA,WACAD,EAAS,SACT1L,EACAjE,EACAlC,CACF,EACA8H,GACE,QACAgK,EACA,UACAD,EAAS,QACT1L,EACAjE,EACAlC,CACF,EACA8H,GACE/F,EACA+P,EACA,eACAD,EAAS,aACT1L,EACAjE,EACAlC,CACF,EACA8H,GACE,OACAgK,EACA,eACAD,EAAS,aACT1L,EACAjE,EACAlC,CACF,EACA8H,GACEjD,GACAiN,EACA,UACAD,EAAS,QACT1L,EACAjE,EACAlC,CACF,EACA8H,GACElD,GACAkN,EACA,2BACAD,EAAS,yBACT1L,EACAjE,EACAlC,CACF,CACF,CAEA,SAASgS,IACPlI,EACA9J,EACAiS,EACA/P,EACAiL,EACA,CACA,IAAI+E,EAAWpI,EAAO,GAOtB,GANKxJ,EAAQ4R,CAAQ,IACnBA,EAAWC,GAAW,GAGxBrS,GAAYoS,E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eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,KACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACAiB,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,MACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACAiB,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,MACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACAiB,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,UACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,UACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,UACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,KAAKkB,GAAS,UACZD,GACEnB,EACAC,EACAwB,EACAC,EAAU,eACVC,EACAC,EACA,GACAhB,EACAV,CACF,EACA,MACF,QACE,MAAM,IAAI+B,GAAe,cAAc,CAC3C,EACF,CAEA,SAASD,IACPhC,EACAC,EACAwB,EACAS,EACAN,EACAO,EACAvB,EACAV,EACA,CACA,IAAMkC,EAAyBF,EAAgB,KAE/C,GAAIE,EAAuB,OAAS,OAClCA,EAAuB,KAAO,IAAIvC,GAAgBqC,CAAe,UACxDE,EAAuB,KAAK,eAAiBD,EAEtD,OAGEC,EAAuB,KAAK,gBAAkBD,IA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,EAAWC,GACb5B,EACAC,EACA,EACA,EACAD,EAAK,cACLA,EAAK,cACLA,EAAK,WACLA,EAAK,YACLA,EAAK,UACLA,EAAK,WACLkB,GACF,EACIW,EAAWD,GACb5B,EACAC,EACA,EACA,EACAD,EAAK,cACLA,EAAK,cACLA,EAAK,UACLA,EAAK,WACLA,EAAK,WACLA,EAAK,YACLgB,GACF,EACIc,EAAWF,GACb5B,EACAC,EACA,EACA,EACAD,EAAK,cACLA,EAAK,cACLA,EAAK,WACLA,EAAK,YACLA,EAAK,UACLA,EAAK,WACLiB,GACF,EACIc,EAAWH,GACb5B,EACAC,EACA,EACA,EACAD,EAAK,cACLA,EAAK,cACLA,EAAK,UACLA,EAAK,WACLA,EAAK,WACLA,EAAK,YACLmB,GACF,EAEAQ,EAAW5B,GACTC,EACAC,EACA,EACA,EACA0B,EACAE,EACAE,EACAD,EACAZ,GACF,EACAW,EAAW9B,GACTC,EACAC,EACA,EACA,EACA4B,EACAF,EACAG,EACAC,EACAf,GACF,EACAc,EAAW/B,GACTC,EACAC,EACA,EACA,EACA6B,EACAD,EACAE,EACAJ,EACAV,GACF,EACAc,EAAWhC,GACTC,EACAC,EACA,EACA,EACA8B,EACAD,EACAH,EACAE,EACAV,GACF,EAEA,IAAMa,EAAkBH,EAAS,OAC3BI,EAAkBH,EAAS,OAC3BI,EAAkBP,EAAS,OAC3BQ,EAAkBJ,EAAS,OAE7BpB,EAAgB,KAAK,IACvBqB,EACAC,EACAC,EACAC,CACF,EACIvB,EAAgB,KAAK,IACvBoB,EACAC,EACAC,EACAC,CACF,EAEMC,GAAgBzB,EAAgBC,GAAiB,GAEnD9D,EACAuF,EAOEC,EAAiBrG,EAAa,8BAA8BF,EAAK,KAAK,EACtEwG,EAAsBtC,EAAU,cAAgBqC,EAClDE,EACF,KAAK,KAAKD,EAAsBtC,EAAU,aAAa,EAAI,EAU7D,GAFAuC,GAAgB,IAGdjB,EAAU,MAAQiB,GAClB5B,EAAgBD,GAAiB2B,EACjC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L,EAAS,OACpBM,EAAa,IAAI,aAAaJ,EAAiBG,CAAM,EAErDE,EAAY,EACVC,EAAiBD,EACvBA,EAAYE,GACVxD,EACAsB,EACAyB,EACAM,EACAC,EACA,EACA,EACA5B,EAAS,OACTA,EAAS,cACT,EACAyB,CACF,EACAG,EAAYG,GACV1D,EACAC,EACA+C,EACAM,EACAC,EACAvD,EAAK,UACLA,EAAK,WACL3C,GAAS,KACT+F,CACF,EACA,IAAMO,EAAiBJ,EACvBA,EAAYE,GACVxD,EACAsB,EACAyB,EACAM,EACAC,EACA,EACA,EACA1B,EAAS,OACTA,EAAS,cACT,EACAuB,CACF,EACAG,EAAYG,GACV1D,EACAC,EACA+C,EACAM,EACAC,EACAvD,EAAK,WACLA,EAAK,YACL3C,GAAS,MACT+F,CACF,EACA,IAAMQ,EAAiBL,EACvBA,EAAYE,GACVxD,EACAsB,EACAyB,EACAM,EACAC,EACA,EACA,EACAzB,EAAS,OACTA,EAAS,cACT,EACAsB,CACF,EACAG,EAAYG,GACV1D,EACAC,EACA+C,EACAM,EACAC,EACAvD,EAAK,UACLA,EAAK,WACL3C,GAAS,KACT+F,CACF,EACA,IAAMS,EAAiBN,EACvBA,EAAYE,GACVxD,EACAsB,EACAyB,EACAM,EACAC,EACA,EACA,EACAxB,EAAS,OACTA,EAAS,cACT,EACAqB,CACF,EACAG,EAAYG,GACV1D,EACAC,EACA+C,EACAM,EACAC,EACAvD,EAAK,WACLA,EAAK,YACL3C,GAAS,MACT+F,CACF,EAEAzC,EAAgByC,EAAY,cAC5BxC,EAAgBwC,EAAY,cAE5B,IAAMU,GAAMC,GAAoB,cAC9BxC,EACAZ,EACAC,EACA7E,EAAK,aAAa,SACpB,EAGMiI,GAAiBC,GAAsB,gCAC3C1C,EAAU,KACZ,EACM2C,GACJ,GACCD,GAAsB,gCAAgC1C,EAAU,KAAK,EACpEyC,IACEG,IACHF,GAAsB,gCACrBpB,EAAmB,QACrB,EACEmB,IACFE,GAEIE,GAAwBnE,EAA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ACA3C,GACE3D,EACAkE,EACA3C,EACAH,EACAgC,EACAkB,EACAiC,CACF,EACA5C,GACE3D,EACAmE,EACA5C,EACAH,EACAgC,EACAkB,EACAkC,CACF,IAGA7C,GACE3D,EACAkE,EACA3C,EACAH,EACAgC,EACAkB,EACAiC,CACF,EACA5C,GACE3D,EACAgE,EACAzC,EACAH,EACAgC,EACAkB,EACA+B,CACF,EACA1C,GACE3D,EACAmE,EACA5C,EACAH,EACAgC,EACAkB,EACAkC,CACF,EACA7C,GACE3D,EACAiE,EACA1C,EACAH,EACAgC,EACAkB,EACAgC,CACF,GAEOH,EAAe,SAAWnC,EAAU,UAAU,OAEvDL,GACE3D,EACAiE,EACA1C,EACAH,EACAgC,EACAkB,EACAgC,CACF,EACA3C,GACE3D,EACAgE,EACAzC,EACAH,EACAgC,EACAkB,EACA+B,CACF,EACA1C,GACE3D,EACAmE,EACA5C,EACAH,EACAgC,EACAkB,EACAkC,CACF,EACA7C,GACE3D,EACAkE,EACA3C,EACAH,EACAgC,EACAkB,EACAiC,CACF,IAGA5C,GACE3D,EACAmE,EACA5C,EACAH,EACAgC,EACAkB,EACAkC,CACF,EACA7C,GACE3D,EACAkE,EACA3C,EACAH,EACAgC,EACAkB,EACAiC,CACF,EACA5C,GACE3D,EACAiE,EACA1C,EACAH,EACAgC,EACAkB,EACAgC,CACF,EACA3C,GACE3D,EACAgE,EACAzC,EACAH,EACAgC,EACAkB,EACA+B,CACF,GAGFD,EAAY,QAAQ7B,CAAgB,CACtC,CAEA,SAASkC,IAAuBzG,EAAWU,EAAM,CAC/C,IAAMgG,EAAYhG,EAAK,UACvB,OACGN,EAAQJ,EAAU,2BAA2B,GAC5CuC,GAAU,SAASmE,EAAW1G,EAAU,2BAA2B,GACpEI,EAAQJ,EAAU,uCAAuC,GACxDuC,GAAU,SACRmE,EACA1G,EAAU,uCACZ,CAEN,CAEA,SAAS2D,GACP3D,EACAU,EACAa,EACAH,EACAgC,EACAkB,EACAC,EACA,CACA,GACEhD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ACjD,IAAIM,EAEJ,OAAO,SAAUC,EAAO,CACtB,IAAMC,EAAOD,EAAM,KAEbL,EAAsB,CAAC,EACvBO,EAAkB,CACtB,GAAID,EAAK,GACT,OAAQ,OACR,MAAO,MACT,EAEA,OAAO,QAAQ,QACbT,IAAYC,EAAgBQ,EAAK,WAAYN,CAAmB,CAClE,EACG,KAAK,SAAUQ,EAAQ,CACtBD,EAAgB,OAASC,CAC3B,CAAC,EACA,MAAM,SAAUN,EAAG,CACdA,aAAa,MAEfK,EAAgB,MAAQ,CACtB,KAAML,EAAE,KACR,QAASA,EAAE,QACX,MAAOA,EAAE,KACX,EAEAK,EAAgB,MAAQL,CAE5B,CAAC,EACA,QAAQ,UAAY,CACdO,EAAQL,CAAW,IACtBA,EAAcM,EAAa,KAAK,kBAAmB,KAAK,WAAW,GAGhEJ,EAAK,yBACRN,EAAoB,OAAS,GAG/B,GAAI,CACFI,EAAYG,EAAiBP,CAAmB,CAClD,OAASE,EAAP,CAGAK,EAAgB,OAAS,OACzBA,EAAgB,MAAQ,kCAAkCI,GACxDT,CACF;AAAA,0BAA8B,KAAK,UAAUK,CAAe,IAC5DH,EAAYG,CAAe,CAC7B,CACF,CAAC,CACL,CACF,CAgCA,IAAOK,IAAQT,IChIR,IAAMU,IAAU", - "names": ["require_mersenne_twister", "__commonJSMin", "exports", "module", "MersenneTwister", "seed", "s", "init_key", "key_length", "i", "j", "k", "y", "mag01", "kk", "a", "b", "require_punycode", "__commonJSMin", "exports", "module", "root", "freeExports", "freeModule", "freeGlobal", "punycode", "maxInt", "base", "tMin", "tMax", "skew", "damp", "initialBias", "initialN", "delimiter", "regexPunycode", "regexNonASCII", "regexSeparators", "errors", "baseMinusTMin", "floor", "stringFromCharCode", "key", "error", "type", "map", "array", "fn", "length", "result", "mapDomain", "string", "parts", "labels", "encoded", "ucs2decode", "output", "counter", "value", "extra", "ucs2encode", "basicToDigit", "codePoint", "digitToBasic", "digit", "flag", "adapt", "delta", "numPoints", "firstTime", "k", "decode", "input", "inputLength", "out", "i", "n", "bias", "basic", "j", "index", "oldi", "w", "t", "baseMinusT", "encode", "handledCPCount", "basicLength", "m", "q", "currentValue", "handledCPCountPlusOne", "qMinusT", "toUnicode", "toASCII", "require_IPv6", "__commonJSMin", "exports", "module", "root", "factory", "_IPv6", "bestPresentation", "address", "_address", "segments", "length", "total", "pos", "_segments", "i", "j", "best", "_best", "_current", "current", "inzeroes", "result", "noConflict", "require_SecondLevelDomains", "__commonJSMin", "exports", "module", "root", "factory", "_SecondLevelDomains", "SLD", "domain", "tldOffset", "sldOffset", "sldList", "require_URI", "__commonJSMin", "exports", "module", "root", "factory", "punycode", "IPv6", "SLD", "_URI", "URI", "url", "base", "_urlSupplied", "_baseSupplied", "isInteger", "value", "p", "hasOwn", "escapeRegEx", "string", "getType", "isArray", "obj", "filterArrayValues", "data", "lookup", "i", "length", "_match", "arrayContains", "list", "_type", "arraysEqual", "one", "two", "l", "trimSlashes", "text", "trim_expression", "node", "nodeName", "escapeForDumbFirefox36", "strictEncodeURIComponent", "escapeQuerySpace", "escaped", "_parts", "_part", "generateAccessor", "_group", "c", "generateSegmentedPathFunction", "_sep", "_codingFuncName", "_innerCodingFuncName", "actualCodingFunc", "segments", "parts", "pos", "bracketPos", "t", "firstColon", "firstSlash", "nextColon", "_string", "firstBackSlash", "items", "splits", "v", "name", "requireAbsolutePath", "duplicateQueryParameters", "unique", "key", "withinArray", "_key", "_booly", "op", "input", "nonEmptySegments", "_segments", "s", "uri", "callback", "options", "_start", "_end", "_trim", "_parens", "_attributeOpen", "match", "start", "attributeOpen", "end", "slice", "parensEnd", "parensMatch", "parensMatchEnd", "result", "protocol", "hasHostname", "hasProtocol", "rejectEmptyHostname", "port", "removeAll", "unconflicted", "deferBuild", "generateSimpleAccessor", "build", "generatePrefixAccessor", "res", "href", "_object", "attribute", "src", "what", "ip", "ip4", "ip6", "sld", "idn", "relative", "_protocol", "_port", "_hostname", "x", "authority", "origin", "e", "sub", "replace", "tld", "directory", "mutatedDirectory", "filename", "suffix", "segment", "separator", "path", "absolute", "q", "_path", "_was_relative", "_leadingParents", "_parent", "_pos", "d", "qp", "kv", "resolved", "properties", "basedir", "relativeParts", "baseParts", "common", "relativePath", "basePath", "parents", "one_map", "two_map", "checked", "one_query", "two_query", "hasOwnProperty", "Object", "setPrototypeOf", "isFrozen", "getPrototypeOf", "getOwnPropertyDescriptor", "freeze", "seal", "create", "_ref", "Reflect", "apply", "construct", "fun", "thisValue", "args", "x", "Func", "_construct", "_toConsumableArray", "arrayForEach", "unapply", "Array", "prototype", "forEach", "arrayPop", "pop", "arrayPush", "push", "stringToLowerCase", "String", "toLowerCase", "stringToString", "toString", "stringMatch", "match", "stringReplace", "replace", "stringIndexOf", "indexOf", "stringTrim", "trim", "regExpTest", "RegExp", "test", "typeErrorCreate", "unconstruct", "TypeError", "func", "thisArg", "_len", "arguments", "length", "_key", "_len2", "_key2", "addToSet", "set", "array", "transformCaseFunc", "_transformCaseFunc", "l", "element", "lcElement", "clone", "object", "newObject", "property", "lookupGetter", "prop", "desc", "get", "value", "fallbackValue", "console", "warn", "html", "svg", "svgFilters", "svgDisallowed", "mathMl", "mathMlDisallowed", "text", "xml", "MUSTACHE_EXPR", "ERB_EXPR", "TMPLIT_EXPR", "DATA_ATTR", "ARIA_ATTR", "IS_ALLOWED_URI", "IS_SCRIPT_OR_DATA", "ATTR_WHITESPACE", "DOCTYPE_NAME", "CUSTOM_ELEMENT", "getGlobal", "window", "_createTrustedTypesPolicy", "trustedTypes", "document", "_typeof", "createPolicy", "suffix", "ATTR_NAME", "currentScript", "hasAttribute", "getAttribute", "policyName", "createHTML", "createScriptURL", "scriptUrl", "createDOMPurify", "undefined", "DOMPurify", "root", "version", "VERSION", "removed", "nodeType", "isSupported", "originalDocument", "DocumentFragment", "HTMLTemplateElement", "Node", "Element", "NodeFilter", "_window$NamedNodeMap", "NamedNodeMap", "MozNamedAttrMap", "HTMLFormElement", "DOMParser", "ElementPrototype", "cloneNode", "getNextSibling", "getChildNodes", "getParentNode", "template", "createElement", "content", "ownerDocument", "trustedTypesPolicy", "emptyHTML", "_document", "implementation", "createNodeIterator", "createDocumentFragment", "getElementsByTagName", "importNode", "documentMode", "hooks", "createHTMLDocument", "EXPRESSIONS", "ALLOWED_TAGS", "DEFAULT_ALLOWED_TAGS", "concat", "TAGS", "ALLOWED_ATTR", "DEFAULT_ALLOWED_ATTR", "ATTRS", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck", "writable", "configurable", "enumerable", "attributeNameCheck", "allowCustomizedBuiltInElements", "FORBID_TAGS", "FORBID_ATTR", "ALLOW_ARIA_ATTR", "ALLOW_DATA_ATTR", "ALLOW_UNKNOWN_PROTOCOLS", "ALLOW_SELF_CLOSE_IN_ATTR", "SAFE_FOR_TEMPLATES", "SAFE_FOR_XML", "WHOLE_DOCUMENT", "SET_CONFIG", "FORCE_BODY", "RETURN_DOM", "RETURN_DOM_FRAGMENT", "RETURN_TRUSTED_TYPE", "SANITIZE_DOM", "SANITIZE_NAMED_PROPS", "SANITIZE_NAMED_PROPS_PREFIX", "KEEP_CONTENT", "IN_PLACE", "USE_PROFILES", "FORBID_CONTENTS", "DEFAULT_FORBID_CONTENTS", "DATA_URI_TAGS", "DEFAULT_DATA_URI_TAGS", "URI_SAFE_ATTRIBUTES", "DEFAULT_URI_SAFE_ATTRIBUTES", "MATHML_NAMESPACE", "SVG_NAMESPACE", "HTML_NAMESPACE", "NAMESPACE", "IS_EMPTY_INPUT", "ALLOWED_NAMESPACES", "DEFAULT_ALLOWED_NAMESPACES", "PARSER_MEDIA_TYPE", "SUPPORTED_PARSER_MEDIA_TYPES", "DEFAULT_PARSER_MEDIA_TYPE", "CONFIG", "formElement", "isRegexOrFunction", "testValue", "Function", "_parseConfig", "cfg", "ADD_URI_SAFE_ATTR", "ADD_DATA_URI_TAGS", "ALLOWED_URI_REGEXP", "ADD_TAGS", "ADD_ATTR", "table", "tbody", "MATHML_TEXT_INTEGRATION_POINTS", "HTML_INTEGRATION_POINTS", "COMMON_SVG_AND_HTML_ELEMENTS", "ALL_SVG_TAGS", "ALL_MATHML_TAGS", "_checkValidNamespace", "parent", "tagName", "namespaceURI", "parentTagName", "Boolean", "_forceRemove", "node", "parentNode", "removeChild", "outerHTML", "remove", "_removeAttribute", "name", "attribute", "getAttributeNode", "from", "removeAttribute", "setAttribute", "_initDocument", "dirty", "doc", "leadingWhitespace", "matches", "dirtyPayload", "parseFromString", "documentElement", "createDocument", "innerHTML", "body", "insertBefore", "createTextNode", "childNodes", "call", "_createIterator", "SHOW_ELEMENT", "SHOW_COMMENT", "SHOW_TEXT", "SHOW_PROCESSING_INSTRUCTION", "SHOW_CDATA_SECTION", "_isClobbered", "elm", "nodeName", "textContent", "attributes", "hasChildNodes", "_isNode", "_executeHook", "entryPoint", "currentNode", "data", "hook", "_sanitizeElements", "allowedTags", "firstElementChild", "_basicCustomElementTest", "childCount", "i", "childClone", "__removalCount", "_isValidAttribute", "lcTag", "lcName", "_sanitizeAttributes", "attr", "hookEvent", "attrName", "attrValue", "keepAttr", "allowedAttributes", "_attr", "forceKeepAttr", "getAttributeType", "setAttributeNS", "_sanitizeShadowDOM", "fragment", "shadowNode", "shadowIterator", "nextNode", "sanitize", "importedNode", "oldNode", "returnNode", "toStaticHTML", "appendChild", "firstChild", "nodeIterator", "shadowroot", "shadowrootmod", "serializedHTML", "doctype", "setConfig", "clearConfig", "isValidAttribute", "tag", "addHook", "hookFunction", "removeHook", "removeHooks", "removeAllHooks", "purify", "require_jsep", "__commonJSMin", "exports", "module", "root", "COMPOUND", "IDENTIFIER", "MEMBER_EXP", "LITERAL", "THIS_EXP", "CALL_EXP", "UNARY_EXP", "BINARY_EXP", "LOGICAL_EXP", "CONDITIONAL_EXP", "ARRAY_EXP", "PERIOD_CODE", "COMMA_CODE", "SQUOTE_CODE", "DQUOTE_CODE", "OPAREN_CODE", "CPAREN_CODE", "OBRACK_CODE", "CBRACK_CODE", "QUMARK_CODE", "SEMCOL_CODE", "COLON_CODE", "throwError", "message", "index", "error", "t", "unary_ops", "binary_ops", "getMaxKeyLen", "obj", "max_len", "len", "key", "max_unop_len", "max_binop_len", "literals", "this_str", "binaryPrecedence", "op_val", "createBinaryExpression", "operator", "left", "right", "type", "isDecimalDigit", "ch", "isIdentifierStart", "isIdentifierPart", "jsep", "expr", "charAtFunc", "charCodeAtFunc", "exprI", "i", "exprICode", "length", "gobbleSpaces", "gobbleExpression", "test", "gobbleBinaryExpression", "consequent", "alternate", "gobbleBinaryOp", "biop", "to_check", "tc_len", "ch_i", "node", "prec", "stack", "biop_info", "cur_biop", "gobbleToken", "gobbleNumericLiteral", "gobbleStringLiteral", "gobbleArray", "gobbleVariable", "number", "chCode", "str", "quote", "closed", "gobbleIdentifier", "start", "identifier", "gobbleArguments", "termination", "args", "separator_count", "arg", "gobbleGroup", "nodes", "op_name", "precedence", "literal_name", "literal_value", "old_jsep", "require_bitmap_sdf", "__commonJSMin", "exports", "module", "calcSDF", "INF", "src", "options", "cutoff", "radius", "channel", "w", "h", "size", "data", "intData", "stride", "ctx", "canvas", "imgData", "i", "l", "gridOuter", "gridInner", "f", "d", "z", "v", "a", "edt", "dist", "width", "height", "x", "y", "edt1d", "n", "q", "k", "s", "require_grapheme_splitter", "__commonJSMin", "exports", "module", "GraphemeSplitter", "CR", "LF", "Control", "Extend", "Regional_Indicator", "SpacingMark", "L", "V", "T", "LV", "LVT", "Other", "Prepend", "E_Base", "E_Modifier", "ZWJ", "Glue_After_Zwj", "E_Base_GAZ", "NotBreak", "BreakStart", "Break", "BreakLastRegional", "BreakPenultimateRegional", "isSurrogate", "str", "pos", "codePointAt", "idx", "code", "hi", "low", "shouldBreak", "start", "mid", "end", "all", "previous", "next", "eModifierIndex", "c", "rIIndex", "previousNonExtendIndex", "string", "index", "prev", "getGraphemeBreakProperty", "i", "res", "brk", "value", "count", "require_earcut", "__commonJSMin", "exports", "module", "earcut", "data", "holeIndices", "dim", "hasHoles", "outerLen", "outerNode", "linkedList", "triangles", "minX", "minY", "maxX", "maxY", "x", "y", "invSize", "eliminateHoles", "i", "earcutLinked", "start", "end", "clockwise", "last", "signedArea", "insertNode", "equals", "removeNode", "filterPoints", "p", "again", "area", "ear", "pass", "indexCurve", "stop", "prev", "next", "isEarHashed", "isEar", "cureLocalIntersections", "splitEarcut", "a", "b", "c", "ax", "bx", "cx", "ay", "by", "cy", "x0", "y0", "x1", "y1", "pointInTriangle", "minZ", "zOrder", "maxZ", "n", "intersects", "locallyInside", "isValidDiagonal", "splitPolygon", "queue", "len", "list", "getLeftmost", "compareX", "eliminateHole", "hole", "bridge", "findHoleBridge", "bridgeReverse", "hx", "hy", "qx", "m", "mx", "my", "tanMin", "tan", "sectorContainsSector", "sortLinked", "q", "e", "tail", "numMerges", "pSize", "qSize", "inSize", "leftmost", "px", "py", "intersectsPolygon", "middleInside", "r", "p1", "p2", "q1", "q2", "o1", "sign", "o2", "o3", "o4", "onSegment", "num", "inside", "a2", "Node", "b2", "an", "bp", "polygonArea", "trianglesArea", "sum", "j", "result", "holeIndex", "d", "require_rbush_min", "__commonJSMin", "exports", "module", "t", "i", "r", "e", "a", "h", "n", "o", "s", "l", "f", "u", "m", "c", "p", "d", "x", "v", "M", "modules", "cache", "entries", "$require", "name", "$module", "protobuf", "Long", "require", "module", "exports", "asPromise", "fn", "ctx", "params", "offset", "index", "pending", "resolve", "reject", "err", "base64", "string", "p", "n", "b64", "s64", "i", "buffer", "start", "end", "parts", "chunk", "j", "t", "b", "invalidEncoding", "c", "EventEmitter", "evt", "listeners", "args", "factory", "f32", "f8b", "le", "writeFloat_f32_cpy", "val", "buf", "pos", "writeFloat_f32_rev", "readFloat_f32_cpy", "readFloat_f32_rev", "writeFloat_ieee754", "writeUint", "sign", "exponent", "mantissa", "writeUintLE", "writeUintBE", "readFloat_ieee754", "readUint", "uint", "readUintLE", "readUintBE", "f64", "writeDouble_f64_cpy", "writeDouble_f64_rev", "readDouble_f64_cpy", "readDouble_f64_rev", "writeDouble_ieee754", "off0", "off1", "readDouble_ieee754", "lo", "hi", "pool", "alloc", "slice", "size", "SIZE", "MAX", "slab", "utf8", "len", "c1", "c2", "configure", "Reader", "util", "BufferReader", "LongBits", "indexOutOfRange", "reader", "writeLength", "create_array", "create", "value", "readLongVarint", "bits", "readFixed32_end", "readFixed64", "length", "nativeBuffer", "bytes", "wireType", "BufferReader_", "rpc", "Service", "rpcImpl", "requestDelimited", "responseDelimited", "rpcCall", "method", "requestCtor", "responseCtor", "request", "callback", "self", "response", "endedByRPC", "zero", "zeroHash", "unsigned", "charCodeAt", "hash", "mask", "part0", "part1", "part2", "obj", "prop", "Buffer", "sizeOrArray", "merge", "dst", "src", "ifNotSet", "keys", "str", "newError", "CustomError", "message", "properties", "fieldNames", "fieldMap", "encoding", "Writer", "BufferWriter", "Op", "noop", "State", "writer", "writeByte", "writeVarint32", "VarintOp", "writeVarint64", "writeFixed32", "writeBytes", "head", "tail", "BufferWriter_", "writeStringBuffer", "require_media", "__commonJSMin", "exports", "module", "require_src", "__commonJSMin", "exports", "module", "webm", "mp4", "oldIOS", "nativeWakeLock", "NoSleep", "handleVisibilityChange", "element", "type", "dataURI", "source", "wakeLock", "err", "res", "defaultValue", "a", "b", "defaultValue_default", "defined", "value", "defined_default", "DeveloperError", "message", "stack", "e", "defined_default", "str", "DeveloperError_default", "Check", "getUndefinedErrorMessage", "name", "getFailedTypeErrorMessage", "actual", "expected", "test", "defined_default", "DeveloperError_default", "limit", "name1", "name2", "test1", "test2", "Check_default", "Event", "listener", "scope", "event", "listeners", "scopes", "index", "i", "compareNumber", "a", "b", "length", "defined_default", "toRemove", "Event_default", "ConstantProperty", "value", "Event_default", "time", "result", "oldValue", "isDefined", "defined_default", "hasClone", "hasEquals", "other", "ConstantProperty_default", "createProperty", "name", "privateName", "subscriptionName", "configurable", "createPropertyCallback", "value", "oldValue", "subscription", "defined_default", "createConstantProperty", "ConstantProperty_default", "createPropertyDescriptor", "defaultValue_default", "createPropertyDescriptor_default", "BillboardGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "result", "defined_default", "source", "BillboardGraphics_default", "AssociativeArray", "key", "defined_default", "value", "oldValue", "hasValue", "array", "AssociativeArray_default", "import_mersenne_twister", "CesiumMath", "defaultValue_default", "value", "rangeMaximum", "rangeMinimum", "p", "q", "time", "degrees", "radians", "angle", "twoPi", "simplified", "mod", "m", "n", "left", "right", "relativeEpsilon", "absoluteEpsilon", "absDiff", "factorials", "length", "sum", "next", "maximumValue", "minimumValue", "min", "max", "randomNumberGenerator", "MersenneTwister", "seed", "radius", "number", "base", "result", "distanceToCamera", "density", "scalar", "x", "y", "opposite", "t", "adjacent", "oppositeOverAdjacent", "Math_default", "Cartesian2", "x", "y", "defaultValue_default", "result", "defined_default", "cartesian", "value", "array", "startingIndex", "length", "resultLength", "i", "index", "first", "second", "min", "max", "Math_default", "distanceScratch", "left", "right", "magnitude", "scalar", "lerpScratch", "start", "end", "t", "angleBetweenScratch", "angleBetweenScratch2", "mostOrthogonalAxisScratch", "f", "offset", "relativeEpsilon", "absoluteEpsilon", "Cartesian2_default", "Cartesian3", "x", "y", "z", "defaultValue_default", "spherical", "result", "defined_default", "clock", "cone", "magnitude", "radial", "cartesian", "value", "array", "startingIndex", "length", "resultLength", "i", "index", "first", "second", "min", "max", "Math_default", "distanceScratch", "left", "right", "scalar", "lerpScratch", "start", "end", "t", "angleBetweenScratch", "angleBetweenScratch2", "cosine", "sine", "mostOrthogonalAxisScratch", "f", "a", "b", "offset", "relativeEpsilon", "absoluteEpsilon", "leftX", "leftY", "leftZ", "rightX", "rightY", "rightZ", "longitude", "latitude", "height", "ellipsoid", "scratchN", "scratchK", "wgs84RadiiSquared", "radiiSquared", "cosLatitude", "gamma", "coordinates", "Cartesian3_default", "scaleToGeodeticSurfaceIntersection", "Cartesian3_default", "scaleToGeodeticSurfaceGradient", "scaleToGeodeticSurface", "cartesian", "oneOverRadii", "oneOverRadiiSquared", "centerToleranceSquared", "result", "positionX", "positionY", "positionZ", "oneOverRadiiX", "oneOverRadiiY", "oneOverRadiiZ", "x2", "y2", "z2", "squaredNorm", "ratio", "intersection", "oneOverRadiiSquaredX", "oneOverRadiiSquaredY", "oneOverRadiiSquaredZ", "gradient", "lambda", "correction", "func", "denominator", "xMultiplier", "yMultiplier", "zMultiplier", "xMultiplier2", "yMultiplier2", "zMultiplier2", "xMultiplier3", "yMultiplier3", "zMultiplier3", "derivative", "Math_default", "defined_default", "scaleToGeodeticSurface_default", "Cartographic", "longitude", "latitude", "height", "defaultValue_default", "result", "defined_default", "Math_default", "cartesianToCartographicN", "Cartesian3_default", "cartesianToCartographicP", "cartesianToCartographicH", "wgs84OneOverRadii", "wgs84OneOverRadiiSquared", "wgs84CenterToleranceSquared", "cartesian", "ellipsoid", "oneOverRadii", "oneOverRadiiSquared", "centerToleranceSquared", "p", "scaleToGeodeticSurface_default", "n", "h", "cartographic", "left", "right", "epsilon", "Cartographic_default", "initialize", "ellipsoid", "x", "y", "z", "defaultValue_default", "Cartesian3_default", "Math_default", "Ellipsoid", "result", "defined_default", "radii", "cartesian", "value", "array", "startingIndex", "cartographic", "longitude", "latitude", "cosLatitude", "cartographicToCartesianNormal", "cartographicToCartesianK", "k", "gamma", "cartographics", "length", "cartesianToCartographicN", "cartesianToCartographicP", "cartesianToCartographicH", "p", "n", "h", "height", "Cartographic_default", "cartesians", "scaleToGeodeticSurface_default", "positionX", "positionY", "positionZ", "oneOverRadiiSquared", "beta", "position", "right", "buffer", "squaredXOverSquaredZ", "abscissas", "weights", "gaussLegendreQuadrature", "a", "b", "func", "xMean", "xRange", "sum", "i", "dx", "rectangle", "minLongitude", "maxLongitude", "minLatitude", "maxLatitude", "radiiSquared", "a2", "b2", "c2", "a2b2", "lat", "sinPhi", "cosPhi", "lon", "cosTheta", "sinTheta", "Ellipsoid_default", "GeographicProjection", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "cartographic", "result", "semimajorAxis", "x", "y", "z", "defined_default", "Cartesian3_default", "cartesian", "oneOverEarthSemimajorAxis", "longitude", "latitude", "height", "Cartographic_default", "GeographicProjection_default", "Intersect", "Intersect_default", "Rectangle", "west", "south", "east", "north", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "rectangle", "Math_default", "cartographics", "westOverIDL", "eastOverIDL", "i", "len", "position", "lonAdjusted", "cartesians", "ellipsoid", "Ellipsoid_default", "left", "right", "absoluteEpsilon", "other", "epsilon", "Cartographic_default", "longitude", "latitude", "otherRectangle", "rectangleEast", "rectangleWest", "otherRectangleEast", "otherRectangleWest", "cartographic", "subsampleLlaScratch", "surfaceHeight", "length", "lla", "westLerp", "southLerp", "eastLerp", "northLerp", "width", "height", "Rectangle_default", "BoundingRectangle", "x", "y", "width", "height", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "positions", "length", "minimumX", "minimumY", "maximumX", "maximumY", "i", "p", "defaultProjection", "GeographicProjection_default", "fromRectangleLowerLeft", "Cartographic_default", "fromRectangleUpperRight", "rectangle", "projection", "lowerLeft", "Rectangle_default", "upperRight", "Cartesian2_default", "left", "right", "lowerLeftX", "lowerLeftY", "upperRightX", "upperRightY", "point", "leftX", "leftY", "rightX", "rightY", "Intersect_default", "BoundingRectangle_default", "_supportsFullscreen", "_names", "Fullscreen", "defined_default", "body", "prefixes", "name", "len", "prefix", "element", "vrDevice", "Fullscreen_default", "theNavigator", "extractVersion", "versionString", "parts", "i", "len", "isChromeResult", "chromeVersionResult", "isChrome", "defined_default", "isEdge", "fields", "chromeVersion", "isSafariResult", "safariVersionResult", "isSafari", "safariVersion", "isWebkitResult", "webkitVersionResult", "isWebkit", "webkitVersion", "isInternetExplorerResult", "internetExplorerVersionResult", "isInternetExplorer", "internetExplorerVersion", "isEdgeResult", "edgeVersionResult", "edgeVersion", "isFirefoxResult", "firefoxVersionResult", "isFirefox", "isWindowsResult", "isWindows", "isIPadOrIOSResult", "isIPadOrIOS", "firefoxVersion", "hasPointerEvents", "supportsPointerEvents", "imageRenderingValueResult", "supportsImageRenderingPixelatedResult", "supportsImageRenderingPixelated", "canvas", "tmp", "imageRenderingValue", "supportsWebP", "resolve", "image", "typedArrayTypes", "FeatureDetection", "defaultValue_default", "scene", "Fullscreen_default", "FeatureDetection_default", "hue2rgb", "m1", "m2", "h", "Color", "red", "green", "blue", "alpha", "defaultValue_default", "cartesian", "result", "defined_default", "color", "scratchArrayBuffer", "scratchUint32Array", "scratchUint8Array", "FeatureDetection_default", "rgba", "hue", "saturation", "lightness", "options", "minimumRed", "maximumRed", "Math_default", "minimumGreen", "maximumGreen", "minimumBlue", "maximumBlue", "minimumAlpha", "maximumAlpha", "rgbaMatcher", "rrggbbaaMatcher", "rgbParenthesesMatcher", "hslParenthesesMatcher", "namedColor", "matches", "value", "array", "startingIndex", "number", "left", "right", "offset", "other", "epsilon", "r", "g", "b", "hexAlpha", "magnitude", "start", "end", "t", "scalar", "Color_default", "returnTrue", "destroyObject", "object", "message", "defaultValue_default", "throwOnDestroyed", "key", "destroyObject_default", "DistanceDisplayCondition", "near", "far", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "left", "right", "other", "DistanceDisplayCondition_default", "NearFarScalar", "near", "nearValue", "far", "farValue", "defaultValue_default", "nearFarScalar", "result", "defined_default", "value", "array", "startingIndex", "left", "right", "NearFarScalar_default", "HeightReference", "HeightReference_default", "HorizontalOrigin", "HorizontalOrigin_default", "VerticalOrigin", "VerticalOrigin_default", "BoundingSphereState", "BoundingSphereState_default", "Property", "DeveloperError_default", "left", "right", "defined_default", "length", "property", "time", "result", "valueDefault", "defaultValue_default", "value", "Property_default", "defaultColor", "Color_default", "defaultEyeOffset", "Cartesian3_default", "defaultHeightReference", "HeightReference_default", "defaultPixelOffset", "Cartesian2_default", "defaultScale", "defaultRotation", "defaultAlignedAxis", "defaultHorizontalOrigin", "HorizontalOrigin_default", "defaultVerticalOrigin", "VerticalOrigin_default", "defaultSizeInMeters", "positionScratch", "colorScratch", "eyeOffsetScratch", "pixelOffsetScratch", "scaleByDistanceScratch", "NearFarScalar_default", "translucencyByDistanceScratch", "pixelOffsetScaleByDistanceScratch", "boundingRectangleScratch", "BoundingRectangle_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "EntityData", "entity", "BillboardVisualizer", "entityCluster", "entityCollection", "AssociativeArray_default", "time", "items", "cluster", "len", "item", "billboardGraphics", "textureValue", "billboard", "show", "Property_default", "position", "defined_default", "returnPrimitive", "subRegion", "result", "BoundingSphereState_default", "entities", "i", "destroyObject_default", "added", "removed", "changed", "BillboardVisualizer_default", "Interval", "start", "stop", "defaultValue_default", "Interval_default", "Matrix3", "column0Row0", "column1Row0", "column2Row0", "column0Row1", "column1Row1", "column2Row1", "column0Row2", "column1Row2", "column2Row2", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "length", "resultLength", "i", "index", "matrix", "values", "quaternion", "x2", "xy", "xz", "xw", "y2", "yz", "yw", "z2", "zw", "w2", "m00", "m01", "m02", "m10", "m11", "m12", "m20", "m21", "m22", "headingPitchRoll", "cosTheta", "cosPsi", "cosPhi", "sinTheta", "sinPsi", "sinPhi", "scale", "vector", "angle", "cosAngle", "sinAngle", "column", "row", "startIndex", "x", "y", "z", "cartesian", "scaleScratch1", "Cartesian3_default", "existingScale", "scaleRatioX", "scaleRatioY", "scaleRatioZ", "scaleScratch2", "scratchColumn", "scaleScratch3", "scaleScratch4", "rotation", "scaleScratch5", "left", "right", "vX", "vY", "vZ", "scalar", "computeFrobeniusNorm", "norm", "temp", "rowVal", "colVal", "offDiagonalFrobeniusNorm", "shurDecomposition", "tolerance", "Math_default", "maxDiagonal", "rotAxis", "c", "p", "q", "qq", "pp", "qp", "tau", "t", "jMatrix", "jMatrixTranspose", "maxSweeps", "count", "sweep", "unitaryMatrix", "diagMatrix", "epsilon", "m31", "m32", "m13", "m23", "m33", "determinant", "scratchTransposeMatrix", "offset", "Matrix3_default", "Cartesian4", "x", "y", "z", "w", "defaultValue_default", "result", "defined_default", "color", "cartesian", "value", "array", "startingIndex", "length", "resultLength", "i", "index", "first", "second", "min", "max", "Math_default", "distanceScratch", "left", "right", "magnitude", "scalar", "lerpScratch", "start", "end", "t", "mostOrthogonalAxisScratch", "f", "offset", "relativeEpsilon", "absoluteEpsilon", "scratchF32Array", "scratchU8Array", "testU32", "testU8", "littleEndian", "packedFloat", "Cartesian4_default", "RuntimeError", "message", "stack", "e", "defined_default", "str", "RuntimeError_default", "Matrix4", "column0Row0", "column1Row0", "column2Row0", "column3Row0", "column0Row1", "column1Row1", "column2Row1", "column3Row1", "column0Row2", "column1Row2", "column2Row2", "column3Row2", "column0Row3", "column1Row3", "column2Row3", "column3Row3", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "length", "resultLength", "i", "index", "matrix", "values", "rotation", "translation", "Cartesian3_default", "scale", "scaleX", "scaleY", "scaleZ", "x2", "xy", "xz", "xw", "y2", "yz", "yw", "z2", "zw", "w2", "m00", "m01", "m02", "m10", "m11", "m12", "m20", "m21", "m22", "translationRotationScale", "Matrix3_default", "fromCameraF", "fromCameraR", "fromCameraU", "camera", "position", "direction", "up", "sX", "sY", "sZ", "fX", "fY", "fZ", "uX", "uY", "uZ", "positionX", "positionY", "positionZ", "t0", "t1", "t2", "fovY", "aspectRatio", "near", "far", "left", "right", "bottom", "top", "b", "c", "tx", "ty", "tz", "viewport", "nearDepthRange", "farDepthRange", "x", "y", "width", "height", "halfWidth", "halfHeight", "halfDepth", "column", "row", "startIndex", "z", "w", "cartesian", "scaleScratch1", "existingScale", "scaleRatioX", "scaleRatioY", "scaleRatioZ", "scaleScratch2", "scratchColumn", "scaleScratch3", "scaleScratch4", "scaleScratch5", "left0", "left1", "left2", "left3", "left4", "left5", "left6", "left7", "left8", "left9", "left10", "left11", "left12", "left13", "left14", "left15", "right0", "right1", "right2", "right3", "right4", "right5", "right6", "right7", "right8", "right9", "right10", "right11", "right12", "right13", "right14", "right15", "vX", "vY", "vZ", "vW", "scalar", "matrix1", "matrix2", "matrix3", "matrix6", "matrix7", "matrix11", "epsilon", "scratchInverseRotation", "scratchMatrix3Zero", "scratchBottomRow", "Cartesian4_default", "scratchExpectedBottomRow", "src0", "src1", "src2", "src3", "src4", "src5", "src6", "src7", "src8", "src9", "src10", "src11", "src12", "src13", "src14", "src15", "tmp0", "tmp1", "tmp2", "tmp3", "tmp4", "tmp5", "tmp6", "tmp7", "tmp8", "tmp9", "tmp10", "tmp11", "dst0", "dst1", "dst2", "dst3", "dst4", "dst5", "dst6", "dst7", "dst8", "dst9", "dst10", "dst11", "dst12", "dst13", "dst14", "dst15", "det", "Math_default", "RuntimeError_default", "matrix0", "matrix4", "matrix5", "matrix8", "matrix9", "matrix10", "scratchTransposeMatrix", "offset", "Matrix4_default", "BoundingSphere", "center", "radius", "Cartesian3_default", "defaultValue_default", "fromPointsXMin", "fromPointsYMin", "fromPointsZMin", "fromPointsXMax", "fromPointsYMax", "fromPointsZMax", "fromPointsCurrentPos", "fromPointsScratch", "fromPointsRitterCenter", "fromPointsMinBoxPt", "fromPointsMaxBoxPt", "fromPointsNaiveCenterScratch", "volumeConstant", "Math_default", "positions", "result", "defined_default", "currentPos", "xMin", "yMin", "zMin", "xMax", "yMax", "zMax", "numPositions", "i", "x", "y", "z", "xSpan", "ySpan", "zSpan", "diameter1", "diameter2", "maxSpan", "ritterCenter", "radiusSquared", "ritterRadius", "minBoxPt", "maxBoxPt", "naiveCenter", "naiveRadius", "r", "oldCenterToPointSquared", "oldCenterToPoint", "oldToNew", "defaultProjection", "GeographicProjection_default", "fromRectangle2DLowerLeft", "fromRectangle2DUpperRight", "fromRectangle2DSouthwest", "Cartographic_default", "fromRectangle2DNortheast", "rectangle", "projection", "minimumHeight", "maximumHeight", "Rectangle_default", "lowerLeft", "upperRight", "width", "height", "elevation", "fromRectangle3DScratch", "ellipsoid", "surfaceHeight", "Ellipsoid_default", "stride", "numElements", "positionsHigh", "positionsLow", "corner", "oppositeCorner", "fromBoundingSpheresScratch", "boundingSpheres", "length", "tmp", "fromOrientedBoundingBoxScratchU", "fromOrientedBoundingBoxScratchV", "fromOrientedBoundingBoxScratchW", "orientedBoundingBox", "halfAxes", "u", "Matrix3_default", "v", "w", "scratchFromTransformationCenter", "scratchFromTransformationScale", "transformation", "Matrix4_default", "scale", "sphere", "value", "array", "startingIndex", "unionScratch", "unionScratchCenter", "left", "right", "leftCenter", "leftRadius", "rightCenter", "rightRadius", "toRightCenter", "centerSeparation", "halfDistanceBetweenTangentPoints", "expandScratch", "point", "plane", "normal", "distanceToPlane", "Intersect_default", "transform", "distanceSquaredToScratch", "cartesian", "diff", "distance", "scratchCartesian3", "position", "direction", "Interval_default", "toCenter", "mag", "projectTo2DNormalScratch", "projectTo2DEastScratch", "projectTo2DNorthScratch", "projectTo2DWestScratch", "projectTo2DSouthScratch", "projectTo2DCartographicScratch", "projectTo2DPositionsScratch", "n", "projectTo2DProjection", "east", "north", "south", "west", "cartographic", "occluder", "BoundingSphere_default", "WebGLConstants", "WebGLConstants_default", "ComponentDatatype", "WebGLConstants_default", "componentDatatype", "array", "defined_default", "valuesOrLength", "buffer", "byteOffset", "length", "defaultValue_default", "name", "ComponentDatatype_default", "GeometryType", "GeometryType_default", "Matrix2", "column0Row0", "column1Row0", "column0Row1", "column1Row1", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "length", "resultLength", "i", "index", "matrix", "values", "scale", "angle", "cosAngle", "sinAngle", "column", "row", "startIndex", "x", "y", "cartesian", "scaleScratch1", "Cartesian2_default", "existingScale", "scaleRatioX", "scaleRatioY", "scaleScratch2", "scratchColumn", "scaleScratch3", "scaleScratch4", "rotation", "scaleScratch5", "left", "right", "scalar", "offset", "epsilon", "Matrix2_default", "PrimitiveType", "WebGLConstants_default", "primitiveType", "PrimitiveType_default", "Quaternion", "x", "y", "z", "w", "defaultValue_default", "fromAxisAngleScratch", "Cartesian3_default", "axis", "angle", "result", "halfAngle", "s", "defined_default", "fromRotationMatrixNext", "fromRotationMatrixQuat", "matrix", "root", "m00", "Matrix3_default", "m11", "m22", "trace", "next", "i", "j", "k", "quat", "scratchHPRQuaternion", "scratchHeadingQuaternion", "scratchPitchQuaternion", "scratchRollQuaternion", "headingPitchRoll", "sampledQuaternionAxis", "sampledQuaternionRotation", "sampledQuaternionTempQuaternion", "sampledQuaternionQuaternion0", "sampledQuaternionQuaternion0Conjugate", "value", "array", "startingIndex", "packedArray", "lastIndex", "len", "offset", "sourceArray", "firstIndex", "magnitude", "quaternion", "inverseMagnitude", "magnitudeSquared", "left", "right", "leftX", "leftY", "leftZ", "leftW", "rightX", "rightY", "rightZ", "rightW", "scalar", "Math_default", "lerpScratch", "start", "end", "t", "slerpEndNegated", "slerpScaledP", "slerpScaledR", "dot", "theta", "thetaOverSinTheta", "cartesian", "sinThetaOverTheta", "squadScratchCartesian0", "squadScratchCartesian1", "squadScratchQuaternion0", "squadScratchQuaternion1", "q0", "q1", "q2", "qInv", "cart0", "cart1", "s0", "s1", "slerp0", "slerp1", "fastSlerpScratchQuaternion", "opmu", "u", "FeatureDetection_default", "v", "bT", "bD", "sign", "xm1", "d", "sqrT", "sqrD", "cT", "cD", "temp", "epsilon", "Quaternion_default", "binarySearch", "array", "itemToFind", "comparator", "low", "high", "i", "comparison", "binarySearch_default", "EarthOrientationParametersSample", "xPoleWander", "yPoleWander", "xPoleOffset", "yPoleOffset", "ut1MinusUtc", "EarthOrientationParametersSample_default", "GregorianDate", "year", "month", "day", "hour", "minute", "second", "millisecond", "isLeapSecond", "GregorianDate_default", "isLeapYear", "year", "isLeapYear_default", "LeapSecond", "date", "offset", "LeapSecond_default", "TimeConstants", "TimeConstants_default", "TimeStandard", "TimeStandard_default", "gregorianDateScratch", "GregorianDate_default", "daysInMonth", "daysInLeapFeburary", "compareLeapSecondDates", "leapSecond", "dateToFind", "JulianDate", "binarySearchScratchLeapSecond", "LeapSecond_default", "convertUtcToTai", "julianDate", "leapSeconds", "index", "binarySearch_default", "offset", "convertTaiToUtc", "result", "difference", "setComponents", "wholeDays", "secondsOfDay", "extraDays", "TimeConstants_default", "computeJulianDateComponents", "year", "month", "day", "hour", "minute", "second", "millisecond", "b", "dayNumber", "matchCalendarYear", "matchCalendarMonth", "matchOrdinalDate", "matchWeekDate", "matchCalendarDate", "utcOffset", "matchHours", "matchHoursMinutes", "matchHoursMinutesSeconds", "JulianDate", "julianDayNumber", "secondsOfDay", "timeStandard", "defaultValue_default", "TimeStandard_default", "wholeDays", "TimeConstants_default", "setComponents", "convertUtcToTai", "date", "result", "components", "computeJulianDateComponents", "defined_default", "iso8601String", "tokens", "year", "month", "day", "hour", "minute", "second", "millisecond", "time", "tmp", "inLeapYear", "matchCalendarDate", "matchCalendarMonth", "matchCalendarYear", "dayOfYear", "matchOrdinalDate", "isLeapYear_default", "matchWeekDate", "weekNumber", "dayOfWeek", "january4", "offsetIndex", "matchHoursMinutesSeconds", "matchHoursMinutes", "matchHours", "offset", "offsetHours", "offsetMinutes", "isLeapSecond", "daysInLeapFeburary", "daysInMonth", "toGregorianDateScratch", "julianDate", "thisUtc", "convertTaiToUtc", "L", "N", "I", "J", "remainingSeconds", "GregorianDate_default", "gDate", "gregorianDateScratch", "precision", "millisecondStr", "left", "right", "julianDayNumberDifference", "epsilon", "dayDifference", "secondDifference", "binarySearchScratchLeapSecond", "leapSeconds", "index", "binarySearch_default", "compareLeapSecondDates", "seconds", "minutes", "newSecondsOfDay", "hours", "days", "newJulianDayNumber", "LeapSecond_default", "JulianDate_default", "import_urijs", "appendForwardSlash", "url", "appendForwardSlash_default", "clone", "object", "deep", "defaultValue_default", "result", "propertyName", "value", "clone_default", "combine", "object1", "object2", "deep", "defaultValue_default", "result", "object1Defined", "defined_default", "object2Defined", "property", "object1Value", "object2Value", "combine_default", "defer", "resolve", "reject", "promise", "res", "rej", "defer_default", "import_urijs", "getAbsoluteUri", "relative", "base", "documentObject", "defined_default", "defaultValue_default", "relativeUri", "Uri", "getAbsoluteUri_default", "import_urijs", "getBaseUri", "uri", "includeQuery", "basePath", "Uri", "getBaseUri_default", "import_urijs", "getExtensionFromUri", "uri", "uriObject", "Uri", "path", "index", "getExtensionFromUri_default", "context2DsByWidthAndHeight", "getImagePixels", "image", "width", "height", "defined_default", "context2DsByHeight", "context2d", "canvas", "getImagePixels_default", "blobUriRegex", "isBlobUri", "uri", "isBlobUri_default", "a", "isCrossOriginUrl", "url", "defined_default", "host", "protocol", "isCrossOriginUrl_default", "dataUriRegex", "isDataUri", "uri", "isDataUri_default", "loadAndExecuteScript", "url", "script", "resolve", "reject", "head", "e", "loadAndExecuteScript_default", "objectToQuery", "obj", "result", "propName", "value", "part", "i", "len", "objectToQuery_default", "queryToObject", "queryString", "result", "parts", "len", "subparts", "name", "value", "defined_default", "resultValue", "queryToObject_default", "RequestState", "RequestState_default", "RequestType", "RequestType_default", "Request", "options", "defaultValue_default", "throttleByServer", "throttle", "RequestType_default", "RequestState_default", "result", "defined_default", "Request_default", "parseResponseHeaders", "headerString", "headers", "headerPairs", "headerPair", "index", "key", "val", "parseResponseHeaders_default", "RequestErrorEvent", "statusCode", "response", "responseHeaders", "parseResponseHeaders_default", "str", "defined_default", "RequestErrorEvent_default", "import_urijs", "Heap", "options", "value", "originalLength", "array", "swap", "a", "b", "temp", "length", "defaultValue_default", "index", "comparator", "candidate", "inserting", "right", "left", "i", "element", "maximumLength", "parent", "removedElement", "defined_default", "root", "Heap_default", "sortRequests", "a", "b", "statistics", "priorityHeapLength", "requestHeap", "Heap_default", "activeRequests", "numberOfActiveRequestsByServer", "pageUri", "Uri", "requestCompletedEvent", "Event_default", "RequestScheduler", "value", "request", "cancelRequest", "updatePriority", "defined_default", "serverKey", "desiredRequests", "defaultValue_default", "maxRequests", "issueRequest", "RequestState_default", "defer_default", "getRequestReceivedFunction", "results", "deferred", "getRequestFailedFunction", "error", "startRequest", "promise", "active", "i", "removeCount", "activeLength", "issuedRequests", "issuedLength", "openSlots", "filledSlots", "updateStatistics", "url", "uri", "length", "isDataUri_default", "isBlobUri_default", "removedRequest", "RequestScheduler_default", "import_urijs", "TrustedServers", "_servers", "host", "port", "authority", "defined_default", "getAuthority", "url", "uri", "Uri", "scheme", "TrustedServers_default", "xhrBlobSupported", "xhr", "parseQuery", "uri", "resource", "merge", "preserveQueryParameters", "queryString", "query", "result", "queryToObject_default", "combineQueryParameters", "stringifyQuery", "queryObject", "keys", "defined_default", "objectToQuery_default", "defaultClone", "val", "defaultVal", "clone_default", "checkAndResetRequest", "request", "RequestState_default", "RuntimeError_default", "q1", "q2", "combine_default", "param", "value", "q2Value", "Resource", "options", "defaultValue_default", "Request_default", "Uri", "supportsImageBitmapOptionsPromise", "imageDataUri", "blob", "imageBitmapOptions", "imageBitmaps", "colorWithOptions", "getImagePixels_default", "colorWithDefaults", "getExtensionFromUri_default", "isDataUri_default", "isBlobUri_default", "isCrossOriginUrl_default", "proxy", "url", "templateValues", "match", "key", "replacement", "params", "useAsDefault", "template", "getAbsoluteUri_default", "error", "retryCallback", "that", "includeQuery", "getBaseUri_default", "appendForwardSlash_default", "preferImageBitmap", "preferBlob", "flipY", "skipColorSpaceConversion", "fetchImage", "blobPromise", "supportsImageBitmap", "useImageBitmap", "generatedBlobResource", "generatedBlob", "blobUrl", "image", "crossOrigin", "deferred", "defer_default", "promise", "RequestScheduler_default", "e", "retry", "callbackParameterName", "functionName", "Math_default", "fetchJsonp", "callbackQuery", "data", "responseType", "headers", "overrideMimeType", "method", "dataUriRegex", "decodeDataUriText", "isBase64", "decodeDataUriArrayBuffer", "byteString", "buffer", "view", "i", "decodeDataUri", "dataUriRegexResult", "mimeType", "parser", "Check_default", "TrustedServers_default", "xhrDeferred", "decodeResponse", "loadWithHttpResponse", "loadWithHttpRequest", "URL", "zlib", "urlImport", "zlibImport", "http", "res", "RequestErrorEvent_default", "chunkArray", "chunk", "resultUnzipped", "noXMLHttpRequest", "localFile", "response", "browserResponseType", "splitHeaders", "responseHeaders", "line", "parts", "header", "loadAndExecuteScript_default", "Resource_default", "EarthOrientationParameters", "options", "defaultValue_default", "defined_default", "onDataReady", "resource", "Resource_default", "that", "eopData", "date", "result", "EarthOrientationParametersSample_default", "RuntimeError_default", "dates", "lastIndex", "before", "after", "previousIndexDate", "nextIndexDate", "isAfterPrevious", "JulianDate_default", "isAfterLastSample", "isBeforeNext", "interpolate", "index", "binarySearch_default", "compareLeapSecondDates", "leapSecond", "dateToFind", "eop", "dateColumn", "xPoleWanderRadiansColumn", "yPoleWanderRadiansColumn", "ut1MinusUtcSecondsColumn", "xCelestialPoleOffsetRadiansColumn", "yCelestialPoleOffsetRadiansColumn", "taiMinusUtcSecondsColumn", "samples", "lastTaiMinusUtc", "addNewLeapSeconds", "i", "len", "mjd", "taiMinusUtc", "day", "TimeConstants_default", "TimeStandard_default", "leapSeconds", "leapSecondIndex", "LeapSecond_default", "fillResultFromIndex", "columnCount", "start", "linearInterp", "dx", "y1", "y2", "beforeDate", "afterDate", "factor", "startBefore", "startAfter", "beforeUt1MinusUtc", "afterUt1MinusUtc", "offsetDifference", "beforeTaiMinusUtc", "afterTaiMinusUtc", "EarthOrientationParameters_default", "HeadingPitchRoll", "heading", "pitch", "roll", "defaultValue_default", "quaternion", "result", "defined_default", "test", "denominatorRoll", "numeratorRoll", "denominatorHeading", "numeratorHeading", "Math_default", "headingPitchRoll", "left", "right", "relativeEpsilon", "absoluteEpsilon", "HeadingPitchRoll_default", "cesiumScriptRegex", "getBaseUrlFromCesiumScript", "scripts", "i", "len", "src", "result", "a", "tryMakeAbsolute", "url", "defined_default", "baseResource", "getCesiumBaseUrl", "baseUrlString", "__require", "getAbsoluteUri_default", "buildModuleUrl", "Resource_default", "buildModuleUrlFromRequireToUrl", "moduleID", "buildModuleUrlFromBaseUrl", "implementation", "relativeUrl", "value", "buildModuleUrl_default", "Iau2006XysSample", "x", "y", "s", "Iau2006XysSample_default", "Iau2006XysData", "options", "defaultValue_default", "Resource_default", "JulianDate_default", "TimeStandard_default", "order", "denom", "xTable", "stepN", "i", "j", "julianDateScratch", "getDaysSinceEpoch", "xys", "dayTT", "secondTT", "dateTT", "startDayTT", "startSecondTT", "stopDayTT", "stopSecondTT", "startDaysSinceEpoch", "stopDaysSinceEpoch", "startIndex", "stopIndex", "startChunk", "stopChunk", "promises", "requestXysChunk", "result", "daysSinceEpoch", "centerIndex", "degree", "firstIndex", "lastIndex", "isDataMissing", "samples", "defined_default", "Iau2006XysSample_default", "x", "work", "coef", "sampleIndex", "xysData", "chunkIndex", "chunkUrl", "xysFileUrlTemplate", "buildModuleUrl_default", "promise", "chunk", "newSamples", "len", "Iau2006XysData_default", "Transforms", "vectorProductLocalFrame", "degeneratePositionLocalFrame", "localFrameToFixedFrameCache", "scratchCalculateCartesian", "Cartesian3_default", "scratchFirstCartesian", "scratchSecondCartesian", "scratchThirdCartesian", "firstAxis", "secondAxis", "DeveloperError_default", "thirdAxis", "resultat", "hashAxis", "defined_default", "origin", "ellipsoid", "result", "Matrix4_default", "Math_default", "sign", "defaultValue_default", "Ellipsoid_default", "up", "east", "scratchHPRQuaternion", "Quaternion_default", "scratchScale", "scratchHPRMatrix4", "headingPitchRoll", "fixedFrameTransform", "hprQuaternion", "hprMatrix", "scratchENUMatrix4", "scratchHPRMatrix3", "Matrix3_default", "transform", "rotation", "noScale", "hprCenterScratch", "ffScratch", "hprTransformScratch", "hprRotationScratch", "hprQuaternionScratch", "HeadingPitchRoll_default", "center", "toFixedFrame", "transformCopy", "quaternionRotation", "gmstConstant0", "gmstConstant1", "gmstConstant2", "gmstConstant3", "rateCoef", "wgs84WRPrecessing", "twoPiOverSecondsInDay", "dateInUtc", "JulianDate_default", "date", "utcDayNumber", "utcSecondsIntoDay", "t", "diffDays", "TimeConstants_default", "angle", "ratio", "secondsSinceMidnight", "gha", "cosGha", "sinGha", "Iau2006XysData_default", "EarthOrientationParameters_default", "ttMinusTai", "j2000ttDays", "timeInterval", "startDayTT", "startSecondTT", "stopDayTT", "stopSecondTT", "xysPromise", "eopPromise", "fixedToIcrfMtx", "xysScratch", "Iau2006XysSample_default", "eopScratch", "EarthOrientationParametersSample_default", "rotation1Scratch", "rotation2Scratch", "eop", "dayTT", "secondTT", "xys", "x", "y", "a", "rotation1", "rotation2", "matrixQ", "dateUt1day", "dateUt1sec", "daysSinceJ2000", "fractionOfDay", "era", "earthRotation", "pfToIcrf", "cosxp", "cosyp", "sinxp", "sinyp", "ttt", "sp", "cossp", "sinsp", "fToPfMtx", "pointToWindowCoordinatesTemp", "Cartesian4_default", "modelViewProjectionMatrix", "viewportTransformation", "point", "Cartesian2_default", "tmp", "normalScratch", "rightScratch", "upScratch", "position", "velocity", "normal", "right", "swizzleMatrix", "scratchCartographic", "Cartographic_default", "scratchCartesian3Projection", "scratchCenter", "scratchRotation", "scratchFromENU", "scratchToENU", "projection", "matrix", "rtcCenter", "cartographic", "projectedPosition", "fromENU", "toENU", "local", "translation", "Transforms_default", "Geometry", "options", "defaultValue_default", "PrimitiveType_default", "GeometryType_default", "geometry", "numberOfVertices", "property", "defined_default", "attribute", "rectangleCenterScratch", "Cartographic_default", "enuCenterScratch", "Cartesian3_default", "fixedFrameToEnuScratch", "Matrix4_default", "boundingRectanglePointsCartographicScratch", "boundingRectanglePointsEnuScratch", "Cartesian2_default", "points2DScratch", "pointEnuScratch", "enuRotationScratch", "Quaternion_default", "enuRotationMatrixScratch", "rotation2DScratch", "Matrix2_default", "positions", "stRotation", "ellipsoid", "boundingRectangle", "i", "rectangleCenter", "Rectangle_default", "enuCenter", "enuToFixedFrame", "Transforms_default", "fixedFrameToEnu", "boundingPointsEnu", "boundingPointsCarto", "posEnu", "rotation", "textureMatrix", "Matrix3_default", "positionsLength", "enuMinX", "enuMinY", "enuMaxX", "enuMaxY", "toDesiredInComputed", "points2D", "boundingEnuMin", "boundingPointsWidth", "boundingPointsHeight", "point2D", "minXYCorner", "maxYCorner", "maxXCorner", "result", "Geometry_default", "GeometryAttribute", "options", "defaultValue_default", "GeometryAttribute_default", "GeometryAttributes", "options", "defaultValue_default", "GeometryAttributes_default", "GeometryOffsetAttribute", "GeometryOffsetAttribute_default", "VertexFormat", "options", "defaultValue_default", "value", "array", "startingIndex", "result", "defined_default", "vertexFormat", "VertexFormat_default", "diffScratch", "Cartesian3_default", "BoxGeometry", "options", "defaultValue_default", "min", "max", "vertexFormat", "VertexFormat_default", "dimensions", "corner", "boundingBox", "value", "array", "startingIndex", "scratchMin", "scratchMax", "scratchVertexFormat", "scratchOptions", "result", "offsetAttribute", "defined_default", "boxGeometry", "attributes", "GeometryAttributes_default", "indices", "positions", "GeometryAttribute_default", "ComponentDatatype_default", "normals", "texCoords", "tangents", "bitangents", "diff", "radius", "length", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "unitBoxGeometry", "BoxGeometry_default", "diffScratch", "Cartesian3_default", "BoxOutlineGeometry", "options", "defaultValue_default", "min", "max", "dimensions", "corner", "boundingBox", "value", "array", "startingIndex", "scratchMin", "scratchMax", "scratchOptions", "result", "offsetAttribute", "defined_default", "boxGeometry", "attributes", "GeometryAttributes_default", "indices", "positions", "GeometryAttribute_default", "ComponentDatatype_default", "diff", "radius", "length", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "BoxOutlineGeometry_default", "ColorGeometryInstanceAttribute", "red", "green", "blue", "alpha", "defaultValue_default", "Color_default", "ComponentDatatype_default", "color", "result", "defined_default", "left", "right", "ColorGeometryInstanceAttribute_default", "DistanceDisplayConditionGeometryInstanceAttribute", "near", "far", "defaultValue_default", "ComponentDatatype_default", "distanceDisplayCondition", "result", "defined_default", "DistanceDisplayConditionGeometryInstanceAttribute_default", "GeometryInstance", "options", "defaultValue_default", "Matrix4_default", "GeometryInstance_default", "TimeInterval", "options", "defaultValue_default", "defined_default", "JulianDate_default", "stopComparedToStart", "scratchInterval", "result", "dates", "DeveloperError_default", "start", "stop", "isStartIncluded", "isStopIncluded", "data", "timeInterval", "precision", "left", "right", "dataComparer", "epsilon", "mergeCallback", "leftStart", "leftStop", "rightStart", "rightStop", "intersectsStartRight", "intersectsStartLeft", "leftIsStartIncluded", "leftIsStopIncluded", "rightIsStartIncluded", "rightIsStopIncluded", "leftLessThanRight", "julianDate", "startComparedToDate", "dateComparedToStop", "TimeInterval_default", "MINIMUM_VALUE", "JulianDate_default", "MAXIMUM_VALUE", "MAXIMUM_INTERVAL", "TimeInterval_default", "Iso8601", "Iso8601_default", "OffsetGeometryInstanceAttribute", "x", "y", "z", "defaultValue_default", "ComponentDatatype_default", "offset", "result", "defined_default", "OffsetGeometryInstanceAttribute_default", "ShowGeometryInstanceAttribute", "show", "defaultValue_default", "ComponentDatatype_default", "result", "defined_default", "ShowGeometryInstanceAttribute_default", "AllMaterialAppearanceFS_default", "AllMaterialAppearanceVS_default", "BasicMaterialAppearanceFS_default", "BasicMaterialAppearanceVS_default", "TexturedMaterialAppearanceFS_default", "TexturedMaterialAppearanceVS_default", "BlendEquation", "WebGLConstants_default", "BlendEquation_default", "BlendFunction", "WebGLConstants_default", "BlendFunction_default", "BlendingState", "BlendEquation_default", "BlendFunction_default", "BlendingState_default", "CullFace", "WebGLConstants_default", "CullFace_default", "Appearance", "options", "defaultValue_default", "parts", "defined_default", "translucent", "rs", "clone_default", "BlendingState_default", "closed", "existing", "CullFace_default", "combine_default", "Appearance_default", "createGuid", "c", "r", "createGuid_default", "CompressedTextureBuffer", "internalFormat", "pixelDatatype", "width", "height", "buffer", "object", "defined_default", "CompressedTextureBuffer_default", "import_urijs", "canTransferArrayBuffer", "defined_default", "TaskProcessor", "worker", "getWorkerUrl", "defaultValue_default", "value", "array", "deferred", "defer_default", "event", "result", "taskCompletedEvent", "Event_default", "completeTask", "processor", "data", "id", "deferreds", "error", "RuntimeError_default", "DeveloperError_default", "moduleID", "url", "buildModuleUrl_default", "isCrossOriginUrl_default", "script", "blob", "BlobBuilder", "blobBuilder", "bootstrapperUrlResult", "getBootstrapperUrl", "createWorker", "bootstrapMessage", "getWebAssemblyLoaderConfig", "wasmOptions", "config", "FeatureDetection_default", "Resource_default", "arrayBuffer", "workerPath", "maximumActiveTasks", "uri", "Uri", "emptyTransferableObjectArray", "parameters", "transferableObjects", "webAssemblyOptions", "wasmConfig", "binary", "destroyObject_default", "TaskProcessor_default", "KTX2Transcoder", "TaskProcessor_default", "makeReadyPromise", "readyPromise", "ktx2Buffer", "supportedTargetFormats", "defined_default", "taskProcessor", "parameters", "view", "result", "levelsLength", "faceKeys", "faceKeysLength", "i", "faces", "j", "face", "CompressedTextureBuffer_default", "error", "KTX2Transcoder_default", "supportedTranscoderFormats", "loadKTX2", "s3tc", "pvrtc", "astc", "etc", "etc1", "bc7", "resourceOrUrlOrBuffer", "loadPromise", "Resource_default", "data", "KTX2Transcoder_default", "loadKTX2_default", "PixelDatatype", "WebGLConstants_default", "pixelDatatype", "context", "PixelDatatype_default", "PixelFormat", "WebGLConstants_default", "pixelFormat", "width", "height", "pixelDatatype", "componentsLength", "PixelDatatype_default", "mod", "constructor", "sizeInBytes", "size", "bufferView", "flipped", "numberOfComponents", "textureWidth", "i", "row", "flippedRow", "j", "context", "PixelFormat_default", "ContextLimits", "ContextLimits_default", "CubeMapFace", "context", "texture", "textureTarget", "targetFace", "internalFormat", "pixelFormat", "pixelDatatype", "size", "preMultiplyAlpha", "flipY", "initialized", "options", "xOffset", "defaultValue_default", "yOffset", "source", "gl", "target", "width", "height", "arrayBufferView", "skipColorSpaceConversion", "unpackAlignment", "defined_default", "PixelFormat_default", "uploaded", "PixelDatatype_default", "bufferView", "framebufferXOffset", "framebufferYOffset", "CubeMapFace_default", "MipmapHint", "WebGLConstants_default", "mipmapHint", "MipmapHint_default", "TextureMagnificationFilter", "WebGLConstants_default", "textureMagnificationFilter", "TextureMagnificationFilter_default", "TextureMinificationFilter", "WebGLConstants_default", "textureMinificationFilter", "TextureMinificationFilter_default", "TextureWrap", "WebGLConstants_default", "textureWrap", "TextureWrap_default", "Sampler", "options", "defaultValue_default", "wrapS", "TextureWrap_default", "wrapT", "minificationFilter", "TextureMinificationFilter_default", "magnificationFilter", "TextureMagnificationFilter_default", "maximumAnisotropy", "defined_default", "left", "right", "Sampler_default", "CubeMap", "options", "defaultValue_default", "context", "source", "width", "height", "defined_default", "faces", "size", "pixelDatatype", "PixelDatatype_default", "pixelFormat", "PixelFormat_default", "internalFormat", "sizeInBytes", "preMultiplyAlpha", "flipY", "skipColorSpaceConversion", "gl", "textureTarget", "texture", "createFace", "target", "sourceFace", "arrayBufferView", "unpackAlignment", "initialized", "CubeMapFace_default", "Sampler_default", "sampler", "minificationFilter", "magnificationFilter", "mipmap", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "hint", "MipmapHint_default", "destroyObject_default", "CubeMap_default", "Texture", "options", "defaultValue_default", "context", "width", "height", "source", "defined_default", "pixelFormat", "PixelFormat_default", "pixelDatatype", "PixelDatatype_default", "internalFormat", "isCompressed", "preMultiplyAlpha", "flipY", "skipColorSpaceConversion", "initialized", "gl", "textureTarget", "texture", "unpackAlignment", "arrayBufferView", "i", "mipWidth", "mipHeight", "sizeInBytes", "createGuid_default", "Cartesian2_default", "Sampler_default", "framebufferXOffset", "framebufferYOffset", "framebuffer", "sampler", "minificationFilter", "magnificationFilter", "mipmap", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "target", "xOffset", "yOffset", "textureWidth", "textureHeight", "uploaded", "bufferView", "hint", "MipmapHint_default", "destroyObject_default", "Texture_default", "AspectRampMaterial_default", "BumpMapMaterial_default", "CheckerboardMaterial_default", "DotMaterial_default", "ElevationBandMaterial_default", "ElevationContourMaterial_default", "ElevationRampMaterial_default", "FadeMaterial_default", "GridMaterial_default", "NormalMapMaterial_default", "PolylineArrowMaterial_default", "PolylineDashMaterial_default", "PolylineGlowMaterial_default", "PolylineOutlineMaterial_default", "RimLightingMaterial_default", "SlopeRampMaterial_default", "StripeMaterial_default", "Water_default", "Material", "options", "defaultValue_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "initializeMaterial", "defined_default", "type", "uniforms", "material", "name", "translucent", "funcs", "length", "func", "context", "i", "uniformId", "loadedImages", "loadedImage", "image", "mipLevels", "mipLevel", "sampler", "Sampler_default", "texture", "Texture_default", "oldTexture", "uniformDimensionsName", "uniformDimensions", "loadedCubeMaps", "loadedCubeMap", "images", "cubeMap", "CubeMap_default", "updateFunctions", "subMaterials", "textures", "instance", "materials", "destroyObject_default", "result", "clone_default", "createGuid_default", "cachedMaterial", "template", "combine_default", "checkForTemplateErrors", "createMethodDefinition", "createUniforms", "createSubMaterials", "defaultTranslucent", "wrappedTranslucent", "checkForValidProperties", "object", "properties", "throwNotFound", "property", "hasProperty", "invalidNameError", "duplicateNameError", "templateProperties", "componentProperties", "components", "materialNames", "isMaterialFused", "shaderComponent", "subMaterialId", "source", "isMultiMaterial", "component", "componentSource", "matrixMap", "Matrix2_default", "Matrix3_default", "Matrix4_default", "ktx2Regex", "createTexture2DUpdateFunction", "oldUniformValue", "uniformValue", "uniformChanged", "uniformValueIsDefaultImage", "tmp", "isResource", "Resource_default", "resource", "promise", "loadKTX2_default", "createCubeMapUpdateFunction", "path", "promises", "createUniform", "strict", "materialUniforms", "uniformType", "getUniformType", "replacedTokenCount", "replaceToken", "imageDimensionsUniformName", "getNumberOfTokens", "uniformDeclaration", "newUniformId", "scratchMatrix", "numAttributes", "attribute", "subMaterialTemplates", "subMaterial", "originalMethodName", "newMethodName", "materialMethodCall", "tokensReplacedCount", "token", "newToken", "excludePeriod", "count", "suffixChars", "prefixChars", "regExp", "$0", "$1", "$2", "materialTemplate", "Color_default", "Cartesian2_default", "BumpMapMaterial_default", "NormalMapMaterial_default", "GridMaterial_default", "StripeMaterial_default", "CheckerboardMaterial_default", "DotMaterial_default", "Water_default", "RimLightingMaterial_default", "FadeMaterial_default", "PolylineArrowMaterial_default", "PolylineDashMaterial_default", "PolylineGlowMaterial_default", "PolylineOutlineMaterial_default", "ElevationContourMaterial_default", "ElevationRampMaterial_default", "SlopeRampMaterial_default", "AspectRampMaterial_default", "ElevationBandMaterial_default", "Material_default", "MaterialAppearance", "options", "defaultValue_default", "translucent", "closed", "materialSupport", "defined_default", "Material_default", "Appearance_default", "VertexFormat_default", "BasicMaterialAppearanceVS_default", "BasicMaterialAppearanceFS_default", "TexturedMaterialAppearanceVS_default", "TexturedMaterialAppearanceFS_default", "AllMaterialAppearanceVS_default", "AllMaterialAppearanceFS_default", "MaterialAppearance_default", "PerInstanceColorAppearanceFS_default", "PerInstanceColorAppearanceVS_default", "PerInstanceFlatColorAppearanceFS_default", "PerInstanceFlatColorAppearanceVS_default", "PerInstanceColorAppearance", "options", "defaultValue_default", "translucent", "closed", "flat", "vs", "PerInstanceFlatColorAppearanceVS_default", "PerInstanceColorAppearanceVS_default", "fs", "PerInstanceFlatColorAppearanceFS_default", "PerInstanceColorAppearanceFS_default", "vertexFormat", "Appearance_default", "VertexFormat_default", "PerInstanceColorAppearance_default", "ColorMaterialProperty", "color", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "Color_default", "other", "ColorMaterialProperty_default", "GeographicTilingScheme", "options", "defaultValue_default", "defined_default", "Ellipsoid_default", "Rectangle_default", "GeographicProjection_default", "level", "currentMatrix", "item", "currentResolution", "Math_default", "rectangle", "result", "west", "south", "east", "north", "x", "y", "rectangleRadians", "xTiles", "yTiles", "xTileWidth", "yTileHeight", "position", "longitude", "xTileCoordinate", "yTileCoordinate", "Cartesian2_default", "GeographicTilingScheme_default", "scratchDiagonalCartesianNE", "Cartesian3_default", "scratchDiagonalCartesianSW", "scratchDiagonalCartographic", "Cartographic_default", "scratchCenterCartesian", "scratchSurfaceCartesian", "scratchBoundingSphere", "BoundingSphere_default", "tilingScheme", "GeographicTilingScheme_default", "scratchCorners", "scratchTileXY", "Cartesian2_default", "ApproximateTerrainHeights", "initPromise", "defined_default", "Resource_default", "buildModuleUrl_default", "json", "rectangle", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "xyLevel", "getTileXYLevel", "minTerrainHeight", "maxTerrainHeight", "key", "heights", "Rectangle_default", "surfacePosition", "distance", "result", "lastLevelX", "lastLevelY", "currentX", "currentY", "maxLevel", "i", "failed", "j", "corner", "ApproximateTerrainHeights_default", "AxisAlignedBoundingBox", "minimum", "maximum", "center", "Cartesian3_default", "defaultValue_default", "defined_default", "result", "positions", "minimumX", "minimumY", "minimumZ", "maximumX", "maximumY", "maximumZ", "length", "i", "x", "y", "z", "box", "left", "right", "intersectScratch", "plane", "h", "normal", "e", "s", "Intersect_default", "AxisAlignedBoundingBox_default", "QuadraticRealPolynomial", "a", "b", "c", "addWithCancellationCheck", "left", "right", "tolerance", "difference", "Math_default", "ratio", "cMagnitude", "aMagnitude", "root", "b2", "four_ac", "radicand", "q", "QuadraticRealPolynomial_default", "CubicRealPolynomial", "a", "b", "c", "d", "a2", "b2", "c2", "d2", "computeRealRoots", "A", "B", "C", "D", "AC", "BD", "B2", "C2", "delta1", "delta2", "delta3", "discriminant", "temp", "temp1", "ABar", "CBar", "DBar", "temp0", "x", "p", "q", "CBarA", "DBarA", "CBarD", "DBarD", "squareRootOfDiscriminant", "halfSquareRootOf3", "theta", "cosine", "temp3", "numeratorLarge", "denominatorLarge", "root1", "numeratorSmall", "denominatorSmall", "root3", "E", "F", "root2", "roots", "ratio", "QuadraticRealPolynomial_default", "root", "CubicRealPolynomial_default", "QuarticRealPolynomial", "a", "b", "c", "d", "e", "a2", "a3", "b2", "b3", "c2", "c3", "d2", "d3", "e2", "e3", "original", "a1", "a0", "a3Squared", "p", "q", "r", "cubicRoots", "CubicRealPolynomial_default", "temp", "hSquared", "Math_default", "roots", "QuadraticRealPolynomial_default", "root0", "root1", "y", "y0", "y1", "h", "m", "n", "roots1", "roots2", "neumark", "a1Squared", "a2Squared", "tempSquared", "g1", "h1", "mError", "nError", "g2", "h2", "squareRootOfN", "squareRootOfM", "G", "g", "H", "k", "QuarticRealPolynomial_default", "Ray", "origin", "direction", "Cartesian3_default", "defaultValue_default", "ray", "result", "defined_default", "Ray_default", "IntersectionTests", "ray", "plane", "result", "defined_default", "Cartesian3_default", "origin", "direction", "normal", "denominator", "Math_default", "t", "scratchEdge0", "scratchEdge1", "scratchPVec", "scratchTVec", "scratchQVec", "p0", "p1", "p2", "cullBackFaces", "defaultValue_default", "edge0", "edge1", "p", "det", "tvec", "q", "u", "v", "invDet", "scratchLineSegmentTriangleRay", "Ray_default", "v0", "v1", "solveQuadratic", "a", "b", "c", "denom", "disc", "root0", "root1", "root", "raySphereRoots", "raySphere", "sphere", "Interval_default", "center", "radiusSquared", "diff", "roots", "scratchLineSegmentRay", "maxT", "scratchQ", "scratchW", "ellipsoid", "inverseRadii", "w", "q2", "qw", "difference", "w2", "product", "discriminant", "temp", "qw2", "addWithCancellationCheck", "left", "right", "tolerance", "quadraticVectorExpression", "A", "x", "xSquared", "wSquared", "l2", "Matrix3_default", "l1", "l0", "r1", "r0", "cosines", "solutions", "QuadraticRealPolynomial_default", "cosine0", "sine0", "cosine1", "sine1", "r0Squared", "r1Squared", "l2Squared", "r0r1", "c4", "c3", "c2", "c1", "c0", "QuarticRealPolynomial_default", "length", "i", "cosine", "cosineSquared", "sineSquared", "sine", "firstAxisScratch", "secondAxisScratch", "thirdAxisScratch", "referenceScratch", "bCart", "bScratch", "btScratch", "diScratch", "dScratch", "cScratch", "tempMatrix", "aScratch", "sScratch", "closestScratch", "surfPointScratch", "Cartographic_default", "position", "intersects", "f", "firstAxis", "reference", "secondAxis", "thirdAxis", "B", "B_T", "D_I", "D", "C", "s", "altitude", "closest", "maximumValue", "dotProduct", "surfacePoint", "lineSegmentPlaneDifference", "endPoint0", "endPoint1", "nDotDiff", "nDotP0", "planeNormal", "planeD", "p0Behind", "p1Behind", "p2Behind", "numBehind", "u1", "u2", "IntersectionTests_default", "Plane", "normal", "distance", "Cartesian3_default", "point", "result", "defined_default", "scratchNormal", "coefficients", "plane", "scratchCartesian", "pointDistance", "scaledNormal", "scratchInverseTranspose", "Matrix4_default", "scratchPlaneCartesian4", "Cartesian4_default", "scratchTransformNormal", "transform", "inverseTranspose", "planeAsCartesian4", "transformedNormal", "left", "right", "Plane_default", "scratchCart4", "Cartesian4_default", "EllipsoidTangentPlane", "origin", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "eastNorthUp", "Transforms_default", "Cartesian3_default", "Matrix4_default", "normal", "Plane_default", "tmp", "AxisAlignedBoundingBox_default", "cartesians", "box", "scratchProjectPointOntoPlaneRay", "Ray_default", "scratchProjectPointOntoPlaneCartesian3", "cartesian", "result", "ray", "intersectionPoint", "IntersectionTests_default", "defined_default", "v", "x", "y", "Cartesian2_default", "count", "length", "i", "p", "projectPointsOntoEllipsoidScratch", "xAxis", "yAxis", "EllipsoidTangentPlane_default", "OrientedBoundingBox", "center", "halfAxes", "Cartesian3_default", "defaultValue_default", "Matrix3_default", "value", "array", "startingIndex", "result", "defined_default", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "scratchCartesian5", "scratchCartesian6", "scratchCovarianceResult", "scratchEigenResult", "positions", "i", "length", "meanPoint", "invLength", "exx", "exy", "exz", "eyy", "eyz", "ezz", "covarianceMatrix", "eigenDecomposition", "rotation", "v1", "v2", "v3", "u1", "u2", "u3", "l1", "l2", "l3", "scale", "scratchOffset", "scratchScale", "fromPlaneExtents", "planeOrigin", "planeXAxis", "planeYAxis", "planeZAxis", "minimumX", "maximumX", "minimumY", "maximumY", "minimumZ", "maximumZ", "centerOffset", "scratchRectangleCenterCartographic", "Cartographic_default", "scratchRectangleCenter", "scratchPerimeterCartographicNC", "scratchPerimeterCartographicNW", "scratchPerimeterCartographicCW", "scratchPerimeterCartographicSW", "scratchPerimeterCartographicSC", "scratchPerimeterCartesianNC", "scratchPerimeterCartesianNW", "scratchPerimeterCartesianCW", "scratchPerimeterCartesianSW", "scratchPerimeterCartesianSC", "scratchPerimeterProjectedNC", "Cartesian2_default", "scratchPerimeterProjectedNW", "scratchPerimeterProjectedCW", "scratchPerimeterProjectedSW", "scratchPerimeterProjectedSC", "scratchPlaneOrigin", "scratchPlaneNormal", "scratchPlaneXAxis", "scratchHorizonCartesian", "scratchHorizonProjected", "scratchMaxY", "scratchMinY", "scratchZ", "scratchPlane", "Plane_default", "rectangle", "minimumHeight", "maximumHeight", "ellipsoid", "Ellipsoid_default", "minX", "maxX", "minY", "maxY", "minZ", "maxZ", "plane", "Math_default", "tangentPointCartographic", "Rectangle_default", "tangentPoint", "tangentPlane", "EllipsoidTangentPlane_default", "lonCenter", "latCenter", "perimeterCartographicNC", "perimeterCartographicNW", "perimeterCartographicCW", "perimeterCartographicSW", "perimeterCartographicSC", "perimeterCartesianNC", "perimeterCartesianNW", "perimeterCartesianCW", "perimeterCartesianSW", "perimeterCartesianSC", "perimeterProjectedNC", "perimeterProjectedNW", "perimeterProjectedCW", "perimeterProjectedSW", "perimeterProjectedSC", "fullyAboveEquator", "fullyBelowEquator", "latitudeNearestToEquator", "centerLongitude", "planeNormal", "horizonCartesian", "farZ", "transformation", "Matrix4_default", "box", "normal", "normalX", "normalY", "normalZ", "radEffective", "distanceToPlane", "Intersect_default", "scratchCartesianU", "scratchCartesianV", "scratchCartesianW", "scratchValidAxis2", "scratchValidAxis3", "scratchPPrime", "cartesian", "offset", "u", "v", "w", "uHalf", "vHalf", "wHalf", "uValid", "vValid", "wValid", "numberOfDegenerateAxes", "validAxis1", "validAxis2", "validAxis3", "degenerateAxis", "crossVector", "pPrime", "distanceSquared", "d", "scratchCorner", "scratchToCenter", "position", "direction", "Interval_default", "minDist", "maxDist", "corner", "toCenter", "mag", "scratchXAxis", "scratchYAxis", "scratchZAxis", "xAxis", "yAxis", "zAxis", "scratchRotationScale", "translation", "rotationScale", "scratchBoundingSphere", "BoundingSphere_default", "occluder", "sphere", "left", "right", "OrientedBoundingBox_default", "TerrainExaggeration", "height", "scale", "relativeHeight", "scratchCartographic", "Cartesian3_default", "position", "ellipsoid", "terrainExaggeration", "terrainExaggerationRelativeHeight", "result", "cartographic", "newHeight", "TerrainExaggeration_default", "Flags", "DrawCommand", "options", "defaultValue_default", "PrimitiveType_default", "hasFlag", "command", "flag", "setFlag", "value", "result", "defined_default", "context", "passState", "DrawCommand_default", "Pass", "Pass_default", "WindingOrder", "WebGLConstants_default", "windingOrder", "WindingOrder_default", "freezeRenderState", "renderState", "propName", "propNames", "freezeRenderState_default", "RenderState", "renderState", "rs", "defaultValue_default", "cull", "polygonOffset", "scissorTest", "scissorTestRectangle", "depthRange", "depthTest", "colorMask", "blending", "blendingColor", "stencilTest", "stencilTestFrontOperation", "stencilTestBackOperation", "sampleCoverage", "viewport", "WindingOrder_default", "WebGLConstants_default", "BoundingRectangle_default", "Color_default", "defined_default", "nextRenderStateId", "renderStateCache", "partialKey", "cachedState", "states", "fullKey", "fullCachedState", "enableOrDisable", "gl", "glEnum", "enable", "applyFrontFace", "applyCull", "enabled", "applyLineWidth", "applyPolygonOffset", "applyScissorTest", "passState", "rectangle", "applyDepthRange", "applyDepthTest", "applyColorMask", "applyDepthMask", "applyStencilMask", "applyBlendingColor", "color", "applyBlending", "applyStencilTest", "frontFunction", "backFunction", "reference", "mask", "frontOperation", "frontOperationFail", "frontOperationZFail", "frontOperationZPass", "backOperation", "backOperationFail", "backOperationZFail", "backOperationZPass", "applySampleCoverage", "scratchViewport", "applyViewport", "createFuncs", "previousState", "nextState", "funcs", "previousRenderState", "previousPassState", "clear", "len", "i", "previousScissorTest", "previousBlendingEnabled", "blendingEnabled", "RenderState_default", "viewerPositionWCScratch", "Cartesian3_default", "AutomaticUniform", "options", "datatypeToGlsl", "WebGLConstants_default", "name", "declaration", "size", "AutomaticUniforms", "uniformState", "Matrix4_default", "AutomaticUniforms_default", "createUniform", "gl", "activeUniform", "uniformName", "location", "UniformFloat", "UniformFloatVec2", "UniformFloatVec3", "UniformFloatVec4", "UniformSampler", "UniformInt", "UniformIntVec2", "UniformIntVec3", "UniformIntVec4", "UniformMat2", "UniformMat3", "UniformMat4", "RuntimeError_default", "Cartesian2_default", "v", "defined_default", "Color_default", "Cartesian3_default", "Cartesian4_default", "textureUnitIndex", "scratchUniformArray", "Matrix2_default", "array", "scratchMat3Array", "Matrix3_default", "scratchMat4Array", "Matrix4_default", "createUniform_default", "createUniformArray", "gl", "activeUniform", "uniformName", "locations", "UniformArrayFloat", "UniformArrayFloatVec2", "UniformArrayFloatVec3", "UniformArrayFloatVec4", "UniformArraySampler", "UniformArrayInt", "UniformArrayIntVec2", "UniformArrayIntVec3", "UniformArrayIntVec4", "UniformArrayMat2", "UniformArrayMat3", "UniformArrayMat4", "RuntimeError_default", "length", "value", "arraybuffer", "changed", "i", "v", "j", "Cartesian2_default", "defined_default", "Cartesian3_default", "Color_default", "Cartesian4_default", "textureUnitIndex", "index", "Matrix2_default", "Matrix3_default", "Matrix4_default", "createUniformArray_default", "nextShaderProgramId", "ShaderProgram", "options", "vertexShaderText", "fragmentShaderText", "modifiedFS", "handleUniformPrecisionMismatches", "defaultValue_default", "initialize", "extractUniforms", "shaderText", "uniformNames", "uniformLines", "defined_default", "len", "i", "line", "name", "duplicateUniformNames", "ContextLimits_default", "j", "uniformName", "duplicateName", "vertexShaderUniforms", "fragmentShaderUniforms", "vertexUniformsCount", "fragmentUniformsCount", "re", "consolePrefix", "createAndLinkProgram", "gl", "shader", "vsSource", "fsSource", "vertexShader", "fragmentShader", "program", "attributeLocations", "attribute", "log", "errorMessage", "debugShaders", "logTranslatedSource", "RuntimeError_default", "compiledShader", "translation", "findVertexAttributes", "numberOfAttributes", "attributes", "attr", "location", "findUniforms", "uniformsByName", "uniforms", "samplerUniforms", "numberOfUniforms", "activeUniform", "suffix", "uniform", "createUniform_default", "uniformArray", "locations", "value", "loc", "indexOfBracket", "createUniformArray_default", "partitionUniforms", "automaticUniforms", "manualUniforms", "uniformObject", "duplicateUniform", "automaticUniform", "AutomaticUniforms_default", "setSamplerUniforms", "textureUnitIndex", "length", "reinitialize", "oldProgram", "numberOfVertexAttributes", "partitionedUniforms", "vertexSourceCode", "fragmentSourceCode", "onCompiled", "onError", "originalVS", "originalFS", "regex", "e", "match", "uniformMap", "uniformState", "validate", "mu", "au", "destroyObject_default", "ShaderProgram_default", "modernizeShader", "source", "isFragmentShader", "outputDeclarationRegex", "splitSource", "outputDeclarationLine", "i", "line", "DeveloperError_default", "outputVariables", "fragDataString", "newOutput", "setAdd", "replaceInSourceString", "czmFragColor", "findInSource", "variableMap", "getVariablePreprocessorBranch", "lineAdds", "variable", "layoutDeclaration", "variableName", "lineNumber", "entry", "depth", "d", "webgl2UniqueID", "webgl2DefineMacro", "versionThree", "foundVersion", "removeExtension", "compileSource", "str", "replacement", "regexStr", "regex", "splitSourceLength", "replaceInSourceRegex", "wholeSource", "set", "layoutVariables", "numLayoutVariables", "stack", "hasIF", "hasELSE", "hasENDIF", "op", "varIndex", "varName", "defined_default", "x", "name", "modernizeShader_default", "degreesPerRadian_default", "depthRange_default", "epsilon1_default", "epsilon2_default", "epsilon3_default", "epsilon4_default", "epsilon5_default", "epsilon6_default", "epsilon7_default", "infinity_default", "oneOverPi_default", "oneOverTwoPi_default", "passCesium3DTile_default", "passCesium3DTileClassification_default", "passCesium3DTileClassificationIgnoreShow_default", "passClassification_default", "passCompute_default", "passEnvironment_default", "passGlobe_default", "passOpaque_default", "passOverlay_default", "passTerrainClassification_default", "passTranslucent_default", "pi_default", "piOverFour_default", "piOverSix_default", "piOverThree_default", "piOverTwo_default", "radiansPerDegree_default", "sceneMode2D_default", "sceneMode3D_default", "sceneModeColumbusView_default", "sceneModeMorphing_default", "solarRadius_default", "threePiOver2_default", "twoPi_default", "webMercatorMaxLatitude_default", "depthRangeStruct_default", "material_default", "materialInput_default", "modelMaterial_default", "modelVertexOutput_default", "pbrParameters_default", "ray_default", "raySegment_default", "shadowParameters_default", "acesTonemapping_default", "alphaWeight_default", "antialias_default", "approximateSphericalCoordinates_default", "backFacing_default", "branchFreeTernary_default", "cascadeColor_default", "cascadeDistance_default", "cascadeMatrix_default", "cascadeWeights_default", "columbusViewMorph_default", "computePosition_default", "cosineAndSine_default", "decompressTextureCoordinates_default", "defaultPbrMaterial_default", "depthClamp_default", "eastNorthUpToEyeCoordinates_default", "ellipsoidContainsPoint_default", "ellipsoidWgs84TextureCoordinates_default", "equalsEpsilon_default", "eyeOffset_default", "eyeToWindowCoordinates_default", "fastApproximateAtan_default", "fog_default", "gammaCorrect_default", "geodeticSurfaceNormal_default", "getDefaultMaterial_default", "getLambertDiffuse_default", "getSpecular_default", "getWaterNoise_default", "HSBToRGB_default", "HSLToRGB_default", "hue_default", "inverseGamma_default", "isEmpty_default", "isFull_default", "latitudeToWebMercatorFraction_default", "linearToSrgb_default", "lineDistance_default", "luminance_default", "metersPerPixel_default", "modelToWindowCoordinates_default", "multiplyWithColorBalance_default", "nearFarScalar_default", "octDecode_default", "packDepth_default", "pbrLighting_default", "pbrMetallicRoughnessMaterial_default", "pbrSpecularGlossinessMaterial_default", "phong_default", "planeDistance_default", "pointAlongRay_default", "rayEllipsoidIntersectionInterval_default", "raySphereIntersectionInterval_default", "readDepth_default", "readNonPerspective_default", "reverseLogDepth_default", "RGBToHSB_default", "RGBToHSL_default", "RGBToXYZ_default", "round_default", "sampleOctahedralProjection_default", "saturation_default", "shadowDepthCompare_default", "shadowVisibility_default", "signNotZero_default", "sphericalHarmonics_default", "srgbToLinear_default", "tangentToEyeSpaceMatrix_default", "transformPlane_default", "translateRelativeToEye_default", "translucentPhong_default", "transpose_default", "unpackDepth_default", "unpackFloat_default", "unpackUint_default", "valueTransform_default", "vertexLogDepth_default", "windowToEyeCoordinates_default", "writeDepthClamp_default", "writeLogDepth_default", "writeNonPerspective_default", "XYZToRGB_default", "CzmBuiltins_default", "degreesPerRadian_default", "depthRange_default", "epsilon1_default", "epsilon2_default", "epsilon3_default", "epsilon4_default", "epsilon5_default", "epsilon6_default", "epsilon7_default", "infinity_default", "oneOverPi_default", "oneOverTwoPi_default", "passCesium3DTile_default", "passCesium3DTileClassification_default", "passCesium3DTileClassificationIgnoreShow_default", "passClassification_default", "passCompute_default", "passEnvironment_default", "passGlobe_default", "passOpaque_default", "passOverlay_default", "passTerrainClassification_default", "passTranslucent_default", "pi_default", "piOverFour_default", "piOverSix_default", "piOverThree_default", "piOverTwo_default", "radiansPerDegree_default", "sceneMode2D_default", "sceneMode3D_default", "sceneModeColumbusView_default", "sceneModeMorphing_default", "solarRadius_default", "threePiOver2_default", "twoPi_default", "webMercatorMaxLatitude_default", "depthRangeStruct_default", "material_default", "materialInput_default", "modelMaterial_default", "modelVertexOutput_default", "pbrParameters_default", "ray_default", "raySegment_default", "shadowParameters_default", "acesTonemapping_default", "alphaWeight_default", "antialias_default", "approximateSphericalCoordinates_default", "backFacing_default", "branchFreeTernary_default", "cascadeColor_default", "cascadeDistance_default", "cascadeMatrix_default", "cascadeWeights_default", "columbusViewMorph_default", "computePosition_default", "cosineAndSine_default", "decompressTextureCoordinates_default", "defaultPbrMaterial_default", "depthClamp_default", "eastNorthUpToEyeCoordinates_default", "ellipsoidContainsPoint_default", "ellipsoidWgs84TextureCoordinates_default", "equalsEpsilon_default", "eyeOffset_default", "eyeToWindowCoordinates_default", "fastApproximateAtan_default", "fog_default", "gammaCorrect_default", "geodeticSurfaceNormal_default", "getDefaultMaterial_default", "getLambertDiffuse_default", "getSpecular_default", "getWaterNoise_default", "HSBToRGB_default", "HSLToRGB_default", "hue_default", "inverseGamma_default", "isEmpty_default", "isFull_default", "latitudeToWebMercatorFraction_default", "linearToSrgb_default", "lineDistance_default", "luminance_default", "metersPerPixel_default", "modelToWindowCoordinates_default", "multiplyWithColorBalance_default", "nearFarScalar_default", "octDecode_default", "packDepth_default", "pbrLighting_default", "pbrMetallicRoughnessMaterial_default", "pbrSpecularGlossinessMaterial_default", "phong_default", "planeDistance_default", "pointAlongRay_default", "rayEllipsoidIntersectionInterval_default", "raySphereIntersectionInterval_default", "readDepth_default", "readNonPerspective_default", "reverseLogDepth_default", "RGBToHSB_default", "RGBToHSL_default", "RGBToXYZ_default", "round_default", "sampleOctahedralProjection_default", "saturation_default", "shadowDepthCompare_default", "shadowVisibility_default", "signNotZero_default", "sphericalHarmonics_default", "srgbToLinear_default", "tangentToEyeSpaceMatrix_default", "transformPlane_default", "translateRelativeToEye_default", "translucentPhong_default", "transpose_default", "unpackDepth_default", "unpackFloat_default", "unpackUint_default", "valueTransform_default", "vertexLogDepth_default", "windowToEyeCoordinates_default", "writeDepthClamp_default", "writeLogDepth_default", "writeNonPerspective_default", "XYZToRGB_default", "removeComments", "source", "match", "numberOfLines", "replacement", "lineNumber", "getDependencyNode", "name", "glslSource", "nodes", "dependencyNode", "i", "defined_default", "generateDependencies", "currentNode", "dependencyNodes", "czmMatches", "elem", "pos", "element", "ShaderSource", "referencedNode", "sortDependencies", "nodesWithoutIncomingEdges", "allNodes", "node", "index", "badNodes", "j", "getBuiltinsAndAutomaticUniforms", "shaderSource", "root", "builtinsSource", "combineShader", "isFragmentShader", "context", "length", "combinedSources", "sources", "version", "group1", "extensions", "pickColorQualifier", "result", "extensionsLength", "defines", "define", "modernizeShader_default", "options", "defaultValue_default", "renamedMain", "definesKey", "pickKey", "builtinsKey", "sourcesKey", "builtinName", "CzmBuiltins_default", "uniformName", "AutomaticUniforms_default", "uniform", "vertexShaderSource", "fragmentShaderSource", "renamedFS", "pickMain", "containsDefine", "definesLength", "containsString", "string", "sourcesLength", "findFirstString", "strings", "stringsLength", "normalVaryingNames", "positionVaryingNames", "ShaderSource_default", "ShadowVolumeAppearanceVS_default", "ShadowVolumeFS_default", "ClassificationType", "ClassificationType_default", "DepthFunction", "WebGLConstants_default", "DepthFunction_default", "EncodedCartesian3", "Cartesian3_default", "value", "result", "defined_default", "doubleHigh", "scratchEncode", "cartesian", "high", "low", "encodedP", "cartesianArray", "index", "EncodedCartesian3_default", "subdivideArray", "array", "numberOfArrays", "result", "len", "i", "size", "subdivideArray_default", "BufferUsage", "WebGLConstants_default", "bufferUsage", "BufferUsage_default", "IndexDatatype", "WebGLConstants_default", "indexDatatype", "sizeInBytes", "defined_default", "numberOfVertices", "indicesLengthOrArray", "Math_default", "sourceArray", "byteOffset", "length", "array", "IndexDatatype_default", "Buffer", "options", "defaultValue_default", "gl", "bufferTarget", "typedArray", "sizeInBytes", "usage", "hasArray", "defined_default", "buffer", "createGuid_default", "WebGLConstants_default", "context", "indexDatatype", "bytesPerIndex", "IndexDatatype_default", "numberOfIndices", "arrayView", "offsetInBytes", "target", "readBuffer", "readOffset", "writeOffset", "readTarget", "writeTarget", "sourceOffset", "destinationOffset", "length", "destroyObject_default", "Buffer_default", "addAttribute", "attributes", "attribute", "index", "context", "hasVertexBuffer", "defined_default", "hasValue", "componentsPerAttribute", "attr", "defaultValue_default", "ComponentDatatype_default", "gl", "bind", "indexBuffer", "VertexArray", "options", "i", "vaAttributes", "numberOfVertices", "hasInstancedAttributes", "hasConstantAttributes", "length", "bytes", "vao", "computeNumberOfVertices", "computeAttributeSizeInBytes", "interleaveAttributes", "j", "name", "names", "namesLength", "currentNumberOfVertices", "RuntimeError_default", "left", "right", "vertexSizeInBytes", "offsetsInBytes", "maxComponentSizeInBytes", "remainder", "vertexBufferSizeInBytes", "buffer", "views", "sizeInBytes", "n", "values", "view", "pointer", "numberOfComponents", "k", "geometry", "bufferUsage", "BufferUsage_default", "attributeLocations", "interleave", "createdVAAttributes", "vertexBuffer", "interleavedAttributes", "Buffer_default", "strideInBytes", "componentDatatype", "indices", "Geometry_default", "Math_default", "IndexDatatype_default", "setVertexAttribDivisor", "vertexArray", "divisors", "maxAttributes", "ContextLimits_default", "divisor", "setConstantAttributes", "destroyObject_default", "VertexArray_default", "BatchTable", "context", "attributes", "numberOfInstances", "pixelDatatype", "getDatatype", "textureFloatSupported", "packFloats", "PixelDatatype_default", "offsets", "createOffsets", "stride", "getStride", "maxNumberOfInstancesPerRow", "ContextLimits_default", "instancesPerWidth", "width", "height", "stepX", "centerX", "stepY", "centerY", "Cartesian2_default", "Cartesian4_default", "batchLength", "foundFloatDatatype", "length", "ComponentDatatype_default", "getAttributeType", "attributeIndex", "componentsPerAttribute", "Cartesian3_default", "currentOffset", "attributesLength", "i", "componentDatatype", "lastOffset", "scratchPackedFloatCartesian4", "getPackedFloat", "array", "index", "result", "packed", "x", "y", "z", "w", "setPackedAttribute", "value", "scratchGetAttributeCartesian4", "instanceIndex", "offset", "attributeType", "defined_default", "setAttributeScratchValues", "setAttributeScratchCartesian4", "currentAttribute", "attributeValue", "createTexture", "batchTable", "dimensions", "Texture_default", "PixelFormat_default", "Sampler_default", "updateTexture", "frameState", "that", "uniformMap", "combine_default", "getGlslComputeSt", "getComponentType", "getComponentSwizzle", "getGlslAttributeFunction", "attribute", "functionName", "functionReturnType", "functionReturnValue", "glslFunction", "source", "batchTableShader", "mainIndex", "beforeMain", "afterMain", "destroyObject_default", "BatchTable_default", "AttributeType", "attributeType", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "Matrix2_default", "Matrix3_default", "Matrix4_default", "AttributeType_default", "RIGHT_SHIFT", "LEFT_SHIFT", "AttributeCompression", "vector", "rangeMax", "result", "x", "y", "Math_default", "octEncodeScratch", "Cartesian2_default", "uint8ForceArray", "forceUint8", "value", "oldVX", "Cartesian3_default", "encoded", "z", "w", "xOct16", "yOct16", "scratchEncodeCart2", "temp", "v1", "v2", "v3", "encoded1", "encoded2", "encoded3", "packed", "encodedFloat1", "encodedFloat2", "textureCoordinates", "compressed", "xZeroTo4095", "zigZagDecode", "uBuffer", "vBuffer", "heightBuffer", "count", "u", "v", "height", "i", "defined_default", "typedArray", "componentDatatype", "type", "componentsPerAttribute", "AttributeType_default", "divisor", "ComponentDatatype_default", "dequantizedTypedArray", "j", "index", "mask5", "mask6", "normalize5", "normalize6", "red", "green", "blue", "offset", "AttributeCompression_default", "scratchCartesian1", "Cartesian3_default", "scratchCartesian2", "scratchCartesian3", "barycentricCoordinates", "point", "p0", "p1", "p2", "result", "defined_default", "v0", "v1", "v2", "dot00", "dot01", "dot02", "dot11", "dot12", "Math_default", "Cartesian2_default", "q", "barycentricCoordinates_default", "Tipsify", "options", "defaultValue_default", "indices", "maximumIndex", "cacheSize", "numIndices", "defined_default", "currentIndex", "intoIndices", "vertexTimeStamps", "i", "j", "cursor", "skipDeadEnd", "vertices", "deadEnd", "maximumIndexPlusOne", "d", "getNextVertex", "oneRing", "s", "n", "p", "m", "itOneRing", "index", "endIndex", "triangle", "f", "vertex", "intoVertices", "currentOutputIndex", "outputIndices", "numTriangles", "triangleEmitted", "limit", "k", "Tipsify_default", "GeometryPipeline", "addTriangle", "lines", "index", "i0", "i1", "i2", "trianglesToLines", "triangles", "count", "size", "IndexDatatype_default", "i", "triangleStripToLines", "triangleFanToLines", "base", "geometry", "indices", "defined_default", "PrimitiveType_default", "attributeName", "length", "defaultValue_default", "positions", "vectors", "positionsLength", "newPositions", "j", "newBoundingSphere", "bs", "BoundingSphere_default", "Geometry_default", "GeometryAttribute_default", "ComponentDatatype_default", "semantics", "attributes", "len", "semantic", "name", "numVertices", "indexCrossReferenceOldToNew", "indicesIn", "numIndices", "indicesOut", "intoIndicesIn", "intoIndicesOut", "nextIndex", "tempIndex", "property", "attribute", "elementsIn", "intoElementsIn", "numComponents", "elementsOut", "temp", "cacheCapacity", "maximumIndex", "Tipsify_default", "copyAttributesDescriptions", "newAttributes", "attr", "copyVertex", "destinationAttributes", "sourceAttributes", "k", "geometries", "numberOfVertices", "Math_default", "oldToNewIndex", "newIndices", "currentIndex", "originalIndices", "numberOfIndices", "indicesPerPrimitive", "x", "scratchProjectTo2DCartesian3", "Cartesian3_default", "scratchProjectTo2DCartographic", "Cartographic_default", "attributeName3D", "attributeName2D", "projection", "GeographicProjection_default", "ellipsoid", "values3D", "projectedValues", "value", "lonLat", "projectedLonLat", "encodedResult", "attributeHighName", "attributeLowName", "values", "highValues", "lowValues", "EncodedCartesian3_default", "componentsPerAttribute", "scratchCartesian3", "transformPoint", "matrix", "Matrix4_default", "transformVector", "Matrix3_default", "inverseTranspose", "normalMatrix", "instance", "modelMatrix", "boundingSphere", "findAttributesInAllGeometries", "instances", "propertyName", "attributesInAllGeometries", "attributes0", "numberOfComponents", "inAllGeometries", "otherAttribute", "tempScratch", "combineGeometries", "m", "haveIndices", "primitiveType", "sourceValues", "sourceValuesLength", "destIndices", "destOffset", "offset", "sourceIndices", "sourceIndicesLen", "center", "radius", "tempRadius", "instanceGeometry", "instanceSplitGeometry", "normal", "v0", "v1", "v2", "vertices", "normalsPerVertex", "normalsPerTriangle", "normalIndices", "i03", "i13", "i23", "indexOffset", "vertexNormalData", "normalValues", "i3", "normalScratch", "normalScale", "tScratch", "normals", "st", "tan1", "i02", "i12", "i22", "ux", "uy", "uz", "wx", "wy", "t1", "t2", "r", "sdirx", "sdiry", "sdirz", "tangentValues", "bitangentValues", "n", "t", "scalar", "scratchCartesian2", "Cartesian2_default", "toEncode1", "toEncode2", "toEncode3", "encodeResult2", "extrudeAttribute", "extrudeDirections", "compressedDirections", "AttributeCompression_default", "normalAttribute", "stAttribute", "hasNormal", "hasSt", "tangentAttribute", "bitangentAttribute", "hasTangent", "hasBitangent", "tangents", "bitangents", "compressedLength", "numCompressedComponents", "compressedAttributes", "normalIndex", "indexTriangles", "indexTriangleFan", "indicesIndex", "indexTriangleStrip", "indexLines", "indexLineStrip", "indexLineLoop", "indexPrimitive", "offsetPointFromXZPlane", "p", "isBehind", "offsetTriangleFromXZPlane", "p0", "p1", "p2", "p0y", "p1y", "p2y", "sign", "c3", "getXZIntersectionOffsetPoints", "u1", "u2", "q1", "q2", "splitTriangleResult", "splitTriangle", "p0Behind", "p1Behind", "p2Behind", "numBehind", "updateGeometryAfterSplit", "computeBoundingSphere", "copyGeometryForSplit", "copiedAttributes", "updateInstanceAfterSplit", "westGeometry", "eastGeometry", "generateBarycentricInterpolateFunction", "CartesianType", "v0Scratch", "v1Scratch", "v2Scratch", "coords", "currentValues", "insertedIndex", "normalize", "interpolateAndPackCartesian4", "Cartesian4_default", "interpolateAndPackCartesian3", "interpolateAndPackCartesian2", "interpolateAndPackBoolean", "v3", "p0Scratch", "p1Scratch", "p2Scratch", "barycentricScratch", "computeTriangleAttributes", "point", "texCoords", "applyOffset", "currentAttributes", "customAttributeNames", "customAttributesLength", "allAttributes", "barycentricCoordinates_default", "d0", "d1", "d2", "direction", "genericInterpolate", "sourceAttribute", "currentAttribute", "insertSplitPoint", "currentIndices", "currentIndexMap", "insertIndex", "prevIndex", "newIndex", "NAMED_ATTRIBUTES", "splitLongitudeTriangles", "westGeometryIndexMap", "eastGeometryIndexMap", "result", "resultPositions", "resultIndices", "resultLength", "resultIndex", "xzPlane", "Plane_default", "offsetScratch", "offsetPointScratch", "computeLineAttributes", "splitLongitudeLines", "p0Attributes", "p0Indices", "p0IndexMap", "p1Attributes", "p1Indices", "p1IndexMap", "intersection", "IntersectionTests_default", "offsetPoint", "cartesian2Scratch0", "cartesian2Scratch1", "cartesian3Scratch0", "cartesian3Scratch2", "cartesian3Scratch3", "cartesian3Scratch4", "cartesian3Scratch5", "cartesian3Scratch6", "cartesian4Scratch0", "updateAdjacencyAfterSplit", "prevPositions", "nextPositions", "position", "prevPosition", "nextPosition", "offsetScalar", "coplanarOffset", "splitLongitudePolyline", "expandAndWidths", "colors", "intersectionFound", "p2Attributes", "p2Indices", "ew0", "width", "c0", "c2", "g", "b", "a", "s0", "s3", "sx", "Intersect_default", "GeometryType_default", "GeometryPipeline_default", "WebMercatorProjection", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "mercatorAngle", "Math_default", "latitude", "sinLatitude", "cartographic", "result", "semimajorAxis", "x", "y", "z", "defined_default", "Cartesian3_default", "cartesian", "oneOverEarthSemimajorAxis", "longitude", "height", "Cartographic_default", "WebMercatorProjection_default", "transformToWorldCoordinates", "instances", "primitiveModelMatrix", "scene3DOnly", "toWorld", "length", "i", "modelMatrix", "Matrix4_default", "defined_default", "GeometryPipeline_default", "addGeometryBatchId", "geometry", "batchId", "attributes", "positionAttr", "numberOfComponents", "GeometryAttribute_default", "ComponentDatatype_default", "values", "j", "addBatchIds", "instance", "geometryPipeline", "parameters", "projection", "uintIndexSupport", "vertexCacheOptimize", "compressVertices", "primitiveType", "geometries", "name", "name3D", "name2D", "BoundingSphere_default", "splitGeometries", "createPickOffsets", "geometryName", "pickOffsets", "offset", "indexCount", "geometryIndex", "offsetIndex", "pickOffset", "count", "createInstancePickOffsets", "PrimitivePipeline", "attributeLocations", "offsetInstanceExtend", "hasOffset", "boundingSpheres", "boundingSpheresCV", "eastHemisphereGeometry", "westHemisphereGeometry", "transferGeometry", "transferableObjects", "attribute", "transferGeometries", "countCreateGeometryResults", "items", "property", "packedData", "stringTable", "stringHash", "validGeometry", "defaultValue_default", "validBoundingSphere", "validBoundingSphereCV", "attributesToWrite", "q", "indicesLength", "createGeometryResult", "packedGeometry", "result", "resultIndex", "packedGeometryIndex", "geometryType", "offsetAttribute", "boundingSphere", "boundingSphereCV", "componentsPerAttribute", "GeometryAttributes_default", "numAttributes", "componentDatatype", "normalize", "valuesIndex", "indices", "numberOfVertices", "IndexDatatype_default", "Geometry_default", "packInstancesForCombine", "unpackInstancesForCombine", "data", "packedInstances", "OffsetGeometryInstanceAttribute_default", "createGeometryResults", "GeographicProjection_default", "packedParameters", "instanceIndex", "geometriesLength", "ellipsoid", "Ellipsoid_default", "WebMercatorProjection_default", "packBoundingSpheres", "bufferLength", "buffer", "bufferIndex", "bs", "unpackBoundingSpheres", "results", "packedBoundingSpheres", "packedBoundingSpheresCV", "packedResult", "PrimitivePipeline_default", "PrimitiveState", "PrimitiveState_default", "SceneMode", "value", "SceneMode_default", "ShadowMode", "shadowMode", "castShadows", "receiveShadows", "ShadowMode_default", "Primitive", "options", "defaultValue_default", "Matrix4_default", "ShadowMode_default", "PrimitiveState_default", "primitive", "resolve", "reject", "frameState", "state", "error", "defined_default", "getCommonPerInstanceAttributeNames", "instances", "length", "attributesInAllInstances", "attributes0", "name", "attribute", "inAllInstances", "i", "otherAttribute", "scratchGetAttributeCartesian2", "Cartesian2_default", "scratchGetAttributeCartesian3", "Cartesian3_default", "scratchGetAttributeCartesian4", "Cartesian4_default", "getAttributeValue", "value", "componentsPerAttribute", "createBatchTable", "context", "geometryInstances", "numberOfInstances", "names", "attributes", "attributeIndices", "boundingSphereAttributeIndices", "offset2DIndex", "instanceAttributes", "ComponentDatatype_default", "attributesLength", "batchTable", "BatchTable_default", "instance", "j", "attributeIndex", "pickObject", "pickId", "pickColor", "color", "Color_default", "cloneAttribute", "clonedValues", "GeometryAttribute_default", "cloneGeometry", "geometry", "newAttributes", "GeometryAttributes_default", "property", "indices", "sourceValues", "Geometry_default", "BoundingSphere_default", "cloneInstance", "positionRegex", "vertexShaderSource", "scene3DOnly", "match", "forwardDecl", "computeFunctions", "functionName", "ShaderSource_default", "isDepthFail", "modifiedVS", "appendPickToVertexShader", "source", "appendPickToFragmentShader", "vsPick", "attr", "modifiedShader", "str", "renamedVS", "distanceDisplayConditionMain", "modifyForEncodedNormals", "containsNormal", "containsSt", "containsTangent", "containsBitangent", "numComponents", "type", "attributeName", "attributeDecl", "globalDecl", "decode", "stComponent", "compressedMain", "depthClampVS", "depthClampFS", "fragmentShaderSource", "modifiedFS", "validateShaderMatching", "shaderProgram", "attributeLocations", "shaderAttributes", "getUniformFunction", "uniforms", "numberOfCreationWorkers", "FeatureDetection_default", "createGeometryTaskProcessors", "combineGeometryTaskProcessor", "TaskProcessor_default", "loadAsynchronous", "instanceIds", "promises", "subTasks", "subTask", "subdivideArray_default", "packedLength", "workerSubTasks", "workerSubTasksLength", "subTaskTransferableObjects", "array", "results", "setReady", "transferableObjects", "projection", "promise", "PrimitivePipeline_default", "packedResult", "result", "loadSynchronous", "clonedInstances", "geometryIndex", "createdGeometry", "recomputeBoundingSpheres", "offsetIndex", "offsetInstanceExtend", "boundingSpheres", "newBoundingSpheres", "newBS", "offset", "transformBoundingSphere", "combinedBS", "combinedWestBS", "combinedEastBS", "bs", "Plane_default", "Intersect_default", "resultBS1", "resultBS2", "resultBS3", "boundingSphere", "scratchBoundingSphereCenterEncoded", "EncodedCartesian3_default", "scratchBoundingSphereCartographic", "Cartographic_default", "scratchBoundingSphereCenter2D", "scratchBoundingSphere", "updateBatchTableBoundingSpheres", "center3DHighIndex", "center3DLowIndex", "center2DHighIndex", "center2DLowIndex", "radiusIndex", "ellipsoid", "modelMatrix", "center", "radius", "encodedCenter", "cartographic", "center2D", "offsetScratchCartesian", "offsetCenterScratch", "updateBatchTableOffsets", "index2D", "newPoint", "newPointProjected", "newVector", "x", "createVertexArray", "geometries", "va", "VertexArray_default", "BufferUsage_default", "y", "z", "createRenderStates", "appearance", "twoPasses", "renderState", "rs", "clone_default", "CullFace_default", "RenderState_default", "DepthFunction_default", "createShaderProgram", "vs", "fs", "ShaderProgram_default", "modifiedModelViewScratch", "rtcScratch", "getUniforms", "material", "materialUniformMap", "appearanceUniformMap", "appearanceUniforms", "combine_default", "viewMatrix", "createCommands", "translucent", "colorCommands", "pickCommands", "depthFailUniforms", "pass", "Pass_default", "multiplier", "vaIndex", "colorCommand", "DrawCommand_default", "forceUpdate", "pixelSize", "boundingSphereWC", "sizeInMeters", "updateAndQueueCommands", "cull", "debugShowBoundingVolume", "SceneMode_default", "commandList", "passes", "allowPicking", "castShadows", "receiveShadows", "colorLength", "factor", "sphereIndex", "ContextLimits_default", "RuntimeError_default", "createRS", "createSP", "depthFailAppearance", "depthFailMaterial", "offsetBoundingSphereScratch1", "offsetBoundingSphereScratch2", "offsetAttribute", "GeometryOffsetAttribute_default", "origBS", "offsetBS", "createGetFunction", "instanceIndex", "attributeValue", "createSetFunction", "offsetScratch", "createBoundingSphereProperties", "properties", "index", "createPickIdProperty", "id", "lastIndex", "ids", "curIndex", "perInstanceAttributeIndices", "pickIds", "destroyObject_default", "Primitive_default", "GeometryInstanceAttribute", "options", "defaultValue_default", "GeometryInstanceAttribute_default", "ShadowVolumeAppearanceFS_default", "ShadowVolumeAppearance", "extentsCulling", "planarExtents", "appearance", "colorShaderDependencies", "ShaderDependencies", "pickShaderDependencies", "PerInstanceColorAppearance_default", "materialShaderSource", "columbusView2D", "dependencies", "defines", "materialSource", "ShaderSource_default", "ShadowVolumeAppearanceFS_default", "vertexShaderSource", "mapProjection", "createShadowVolumeAppearanceVS", "longitudeExtentsCartesianScratch", "Cartesian3_default", "longitudeExtentsCartographicScratch", "Cartographic_default", "longitudeExtentsEncodeScratch", "shaderDependencies", "projectionExtentDefines", "allDefines", "eastMostCartographic", "Math_default", "eastMostCartesian", "encoded", "EncodedCartesian3_default", "westMostCartographic", "westMostCartesian", "defined_default", "value", "pointLineDistance", "point1", "point2", "point", "Cartesian2_default", "points2DScratch", "addTextureCoordinateRotationAttributes", "attributes", "textureCoordinateRotationPoints", "points2D", "minXYCorner", "maxYCorner", "maxXCorner", "GeometryInstanceAttribute_default", "ComponentDatatype_default", "inverseExtentX", "inverseExtentY", "cartographicScratch", "cornerScratch", "northWestScratch", "southEastScratch", "highLowScratch", "add2DTextureCoordinateAttributes", "rectangle", "projection", "carto", "southWestCorner", "northWest", "southEast", "valuesHigh", "valuesLow", "enuMatrixScratch", "Matrix4_default", "inverseEnuScratch", "rectanglePointCartesianScratch", "rectangleCenterScratch", "pointsCartographicScratch", "computeRectangleBounds", "ellipsoid", "height", "southWestCornerResult", "eastVectorResult", "northVectorResult", "centerCartographic", "Rectangle_default", "centerCartesian", "enuMatrix", "Transforms_default", "inverseEnu", "west", "east", "north", "south", "cartographics", "longitudeCenter", "latitudeCenter", "minX", "maxX", "minY", "maxY", "i", "pointCartesian", "southEastCorner", "northWestCorner", "eastwardScratch", "northwardScratch", "encodeScratch", "boundingRectangle", "corner", "eastward", "northward", "defaultValue_default", "spherePointScratch", "latLongToSpherical", "latitude", "longitude", "result", "cartographic", "spherePoint", "magXY", "sphereLatitude", "sphereLongitude", "sphericalScratch", "southWestExtents", "northEastExtents", "rotationRadians", "longitudeRangeInverse", "latitudeRangeInverse", "shouldUseSpherical", "ShadowVolumeAppearance_default", "StencilFunction", "WebGLConstants_default", "StencilFunction_default", "StencilOperation", "WebGLConstants_default", "StencilOperation_default", "StencilConstants", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "ClassificationPrimitive", "options", "defaultValue_default", "geometryInstances", "ClassificationType_default", "classificationPrimitive", "resolve", "reject", "error", "defined_default", "scene", "getStencilDepthRenderState", "enableStencil", "mask3DTiles", "stencilFunction", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "DepthFunction_default", "getColorRenderState", "BlendingState_default", "pickRenderState", "createRenderStates", "context", "appearance", "twoPasses", "stencilEnabled", "RenderState_default", "modifyForEncodedNormals", "primitive", "vertexShaderSource", "attributeName", "attributeDecl", "globalDecl", "decode", "modifiedVS", "ShaderSource_default", "compressedMain", "createShaderProgram", "frameState", "vs", "ShadowVolumeAppearanceVS_default", "Primitive_default", "planarExtents", "cullFragmentsUsingExtents", "extrudedDefine", "vsSource", "fsSource", "ShadowVolumeFS_default", "attributeLocations", "shadowVolumeAppearance", "ShadowVolumeAppearance_default", "ShaderProgram_default", "vsPick", "pickFS3D", "pickVS3D", "pickProgram2D", "pickFS2D", "pickVS2D", "fsColorSource", "vsColorSource", "colorProgram2D", "fsColorSource2D", "vsColorSource2D", "createColorCommands", "colorCommands", "length", "i", "command", "derivedCommand", "vaIndex", "uniformMap", "needs2DShader", "vertexArray", "DrawCommand_default", "Pass_default", "material", "combine_default", "derived2DCommand", "commandsIgnoreShow", "spStencil", "commandIndex", "j", "commandIgnoreShow", "createPickCommands", "pickCommands", "usePickOffsets", "pickOffsets", "pickIndex", "pickOffset", "createCommands", "translucent", "boundingVolumeIndex", "updateAndQueueRenderCommand", "modelMatrix", "cull", "boundingVolume", "debugShowBoundingVolume", "updateAndQueuePickCommand", "updateAndQueueCommands", "boundingVolumes", "SceneMode_default", "classificationType", "queueTerrainCommands", "queue3DTilesCommands", "passes", "colorLength", "ignoreShowCommands", "ignoreShowCommandsLength", "pickLength", "that", "primitiveOptions", "instances", "instance", "attributes", "hasPerColorAttribute", "allColorsSame", "firstColor", "hasSphericalExtentsAttribute", "hasPlanarExtentsAttributes", "color", "ColorGeometryInstanceAttribute_default", "DeveloperError_default", "PerInstanceColorAppearance_default", "GeometryInstance_default", "geometry", "id", "destroyObject_default", "ClassificationPrimitive_default", "GroundPrimitiveUniformMap", "GroundPrimitive", "options", "defaultValue_default", "appearance", "geometryInstances", "defined_default", "geometryInstancesArray", "geometryInstanceCount", "i", "attributes", "PerInstanceColorAppearance_default", "ClassificationType_default", "groundPrimitive", "resolve", "reject", "error", "ApproximateTerrainHeights_default", "that", "ClassificationPrimitive_default", "getComputeMaximumHeightFunction", "primitive", "granularity", "ellipsoid", "r", "delta", "getComputeMinimumHeightFunction", "scratchBVCartesianHigh", "Cartesian3_default", "scratchBVCartesianLow", "scratchBVCartesian", "scratchBVCartographic", "Cartographic_default", "scratchBVRectangle", "Rectangle_default", "getRectangle", "frameState", "geometry", "highPositions", "lowPositions", "length", "minLat", "minLon", "maxLat", "maxLon", "highPosition", "lowPosition", "position", "cartographic", "latitude", "longitude", "rectangle", "setMinMaxTerrainHeights", "result", "createBoundingVolume", "obb", "OrientedBoundingBox_default", "projection", "boundingVolume", "BoundingSphere_default", "boundingVolumeIndex", "commandIndex", "updateAndQueueRenderCommand", "command", "modelMatrix", "cull", "debugShowBoundingVolume", "classificationPrimitive", "SceneMode_default", "updateAndQueuePickCommand", "updateAndQueueCommands", "colorCommands", "pickCommands", "twoPasses", "boundingVolumes", "classificationType", "queueTerrainCommands", "queue3DTilesCommands", "passes", "colorLength", "ignoreShowCommands", "ignoreShowCommandsLength", "pickLength", "pickOffsets", "pickOffset", "primitiveOptions", "instance", "instanceType", "instances", "groundInstances", "instanceRectangle", "id", "boundingSphere", "exaggeration", "exaggerationRelativeHeight", "TerrainExaggeration_default", "useFragmentCulling", "usePlanarExtents", "ShadowVolumeAppearance_default", "boundingRectangle", "textureCoordinateRotationPoints", "instanceAttributes", "attributeKey", "GeometryInstance_default", "index", "destroyObject_default", "context", "scene", "GroundPrimitive_default", "MaterialProperty", "DeveloperError_default", "time", "materialProperty", "material", "type", "defined_default", "Material_default", "Color_default", "MaterialProperty_default", "DynamicGeometryUpdater", "geometryUpdater", "primitives", "orderedGroundPrimitives", "entity", "geometry", "time", "Property_default", "DeveloperError_default", "onTerrain", "shadows", "options", "defined_default", "fillMaterialProperty", "isColorAppearance", "ColorMaterialProperty_default", "appearance", "closed", "PerInstanceColorAppearance_default", "material", "MaterialProperty_default", "MaterialAppearance_default", "GroundPrimitive_default", "fillInstance", "Primitive_default", "outlineInstance", "outlineWidth", "result", "primitive", "outlinePrimitive", "attributes", "BoundingSphere_default", "BoundingSphereState_default", "destroyObject_default", "DynamicGeometryUpdater_default", "warnings", "oneTimeWarning", "identifier", "message", "defined_default", "defaultValue_default", "oneTimeWarning_default", "ArcType", "ArcType_default", "removeDuplicatesEpsilon", "Math_default", "arrayRemoveDuplicates", "values", "equalsEpsilon", "wrapAround", "removedIndices", "defined_default", "defaultValue_default", "storeRemovedIndices", "length", "i", "v0", "v1", "cleanedValues", "lastCleanIndex", "removedIndexLCI", "arrayRemoveDuplicates_default", "setConstants", "ellipsoidGeodesic", "uSquared", "a", "b", "f", "cosineHeading", "sineHeading", "tanU", "cosineU", "sineU", "sigma", "sineAlpha", "sineSquaredAlpha", "cosineSquaredAlpha", "cosineAlpha", "u2Over4", "u4Over16", "u6Over64", "u8Over256", "a0", "a1", "a2", "a3", "distanceRatio", "constants", "computeC", "computeDeltaLambda", "sineSigma", "cosineSigma", "cosineTwiceSigmaMidpoint", "C", "vincentyInverseFormula", "major", "minor", "firstLongitude", "firstLatitude", "secondLongitude", "secondLatitude", "eff", "l", "u1", "u2", "cosineU1", "sineU1", "cosineU2", "sineU2", "cc", "cs", "ss", "sc", "lambda", "lambdaDot", "Math_default", "cosineLambda", "sineLambda", "temp", "A", "B", "cosineSquaredTwiceSigmaMidpoint", "deltaSigma", "distance", "startHeading", "endHeading", "scratchCart1", "Cartesian3_default", "scratchCart2", "computeProperties", "start", "end", "ellipsoid", "firstCartesian", "lastCartesian", "Cartographic_default", "EllipsoidGeodesic", "e", "defaultValue_default", "Ellipsoid_default", "defined_default", "fraction", "result", "s", "cosine2S", "cosine4S", "cosine6S", "sine2S", "sine4S", "sine6S", "sine8S", "s2", "s3", "theta", "latitude", "EllipsoidGeodesic_default", "calculateM", "ellipticity", "major", "latitude", "e2", "e4", "e6", "e8", "e10", "e12", "phi", "sin2Phi", "sin4Phi", "sin6Phi", "sin8Phi", "sin10Phi", "sin12Phi", "calculateInverseM", "M", "d", "d2", "d3", "d4", "e", "sin2D", "cos2D", "sin4D", "cos4D", "sin6D", "cos6D", "sin8D", "cos8D", "sin10D", "cos10D", "sin12D", "calculateSigma", "Math_default", "eSinL", "calculateHeading", "ellipsoidRhumbLine", "firstLongitude", "firstLatitude", "secondLongitude", "secondLatitude", "sigma1", "sigma2", "calculateArcLength", "minor", "heading", "deltaLongitude", "distance", "sinPhi", "M1", "scratchCart1", "Cartesian3_default", "scratchCart2", "computeProperties", "start", "end", "ellipsoid", "firstCartesian", "lastCartesian", "majorSquared", "minorSquared", "Cartographic_default", "interpolateUsingSurfaceDistance", "result", "ellipticitySquared", "longitude", "deltaM", "M2", "localRad", "defined_default", "EllipsoidRhumbLine", "defaultValue_default", "Ellipsoid_default", "fraction", "intersectionLongitude", "absHeading", "phi1", "eSinPhi1", "leftComponent", "denominator", "newPhi", "eSinPhi", "numerator", "intersectionLatitude", "EllipsoidRhumbLine_default", "PROJECTIONS", "GeographicProjection_default", "WebMercatorProjection_default", "PROJECTION_COUNT", "MITER_BREAK_SMALL", "Math_default", "MITER_BREAK_LARGE", "WALL_INITIAL_MIN_HEIGHT", "WALL_INITIAL_MAX_HEIGHT", "GroundPolylineGeometry", "options", "defaultValue_default", "positions", "ArcType_default", "Ellipsoid_default", "groundPolylineGeometry", "mapProjection", "projectionIndex", "cart3Scratch1", "Cartesian3_default", "cart3Scratch2", "cart3Scratch3", "computeRightNormal", "start", "end", "maxHeight", "ellipsoid", "result", "startBottom", "getPosition", "startTop", "endBottom", "up", "direction", "forward", "interpolatedCartographicScratch", "Cartographic_default", "interpolatedBottomScratch", "interpolatedTopScratch", "interpolatedNormalScratch", "interpolateSegment", "minHeight", "granularity", "arcType", "normalsArray", "bottomPositionsArray", "topPositionsArray", "cartographicsArray", "ellipsoidLine", "EllipsoidGeodesic_default", "EllipsoidRhumbLine_default", "surfaceDistance", "interpolatedNormal", "segments", "interpointDistance", "distanceFromStart", "pointsToAdd", "packIndex", "i", "interpolatedCartographic", "interpolatedBottom", "interpolatedTop", "heightlessCartographicScratch", "cartographic", "height", "value", "array", "startingIndex", "index", "positionsLength", "cartesian", "loop", "scene3DOnly", "defined_default", "target", "origin", "tangentDirection", "toPreviousScratch", "toNextScratch", "forwardScratch", "vertexUpScratch", "cosine90", "cosine180", "computeVertexMiterNormal", "previousBottom", "vertexBottom", "vertexTop", "nextBottom", "toPrevious", "toNext", "XZ_PLANE", "Plane_default", "previousBottomScratch", "vertexBottomScratch", "vertexTopScratch", "nextBottomScratch", "vertexNormalScratch", "intersectionScratch", "cartographicScratch0", "cartographicScratch1", "cartographicIntersectionScratch", "compute2dAttributes", "projection", "p0", "p1", "c0", "c1", "rhumbLine", "intersection", "intersectionCartographic", "intersectionLongitude", "splitPositions", "IntersectionTests_default", "cartographicsLength", "cartographics", "arrayRemoveDuplicates_default", "vertexNormal", "startCartographic", "nextCartographic", "prestartCartographic", "vertexCartographic", "endCartographic", "preEndCartographic", "postEndCartographic", "generateGeometryAttributes", "lineDirectionScratch", "matrix3Scratch", "Matrix3_default", "quaternionScratch", "Quaternion_default", "breakMiter", "endGeometryNormal", "endTop", "lineDirection", "dot", "vertexUp", "angle", "quaternion", "rotationMatrix", "endPosCartographicScratch", "normalStartpointScratch", "normalEndpointScratch", "projectNormal", "normal", "projectedPosition", "position", "normalEndpoint", "flipNormal", "normalEndpointCartographic", "normalEndpointProjected", "adjustHeightNormalScratch", "adjustHeightOffsetScratch", "adjustHeights", "bottom", "top", "adjustHeightBottom", "adjustHeightTop", "adjustHeightNormal", "distanceForBottom", "adjustHeightOffset", "distanceForTop", "nudgeDirectionScratch", "nudgeXZ", "startToXZdistance", "endToXZdistance", "offset", "nudgeCartographic", "absStartLon", "absEndLon", "endSign", "startSign", "startCartographicScratch", "endCartographicScratch", "segmentStartTopScratch", "segmentEndTopScratch", "segmentStartBottomScratch", "segmentEndBottomScratch", "segmentStartNormalScratch", "segmentEndNormalScratch", "getHeightCartographics", "getHeightRectangleScratch", "Rectangle_default", "adjustHeightStartTopScratch", "adjustHeightEndTopScratch", "adjustHeightStartBottomScratch", "adjustHeightEndBottomScratch", "segmentStart2DScratch", "segmentEnd2DScratch", "segmentStartNormal2DScratch", "segmentEndNormal2DScratch", "offsetScratch", "startUpScratch", "endUpScratch", "rightScratch", "startPlaneNormalScratch", "endPlaneNormalScratch", "encodeScratch", "EncodedCartesian3_default", "encodeScratch2D", "forwardOffset2DScratch", "right2DScratch", "normalNudgeScratch", "scratchBoundingSpheres", "BoundingSphere_default", "REFERENCE_INDICES", "REFERENCE_INDICES_LENGTH", "segmentCount", "vertexCount", "arraySizeVec4", "indexCount", "indices", "positionsArray", "startHiAndForwardOffsetX", "startLoAndForwardOffsetY", "startNormalAndForwardOffsetZ", "endNormalAndTextureCoordinateNormalizationX", "rightNormalAndTextureCoordinateNormalizationY", "startHiLo2D", "offsetAndRight2D", "startEndNormals2D", "texcoordNormalization2D", "length2D", "segmentStartCartesian", "segmentEndCartesian", "length3D", "j", "cartographicsIndex", "vec2sWriteIndex", "vec3sWriteIndex", "vec4sWriteIndex", "miterBroken", "preEndBottom", "lengthSoFar3D", "lengthSoFar2D", "sumHeights", "startGeometryNormal", "start2D", "end2D", "startGeometryNormal2D", "endGeometryNormal2D", "nudgeResult", "direction2D", "segmentLength3D", "encodedStart", "forwardOffset", "startUp", "rightNormal", "startPlaneNormal", "endUp", "endPlaneNormal", "texcoordNormalization3DX", "texcoordNormalization3DY", "segmentLength2D", "encodedStart2D", "forwardOffset2D", "right2D", "texcoordNormalization2DX", "texcoordNormalization2DY", "swap", "vec4Index", "vec2Index", "wIndex", "rightPlaneSide", "topBottomSide", "texcoordNormalization", "adjustHeightStartBottom", "adjustHeightEndBottom", "adjustHeightStartTop", "adjustHeightEndTop", "getHeightsRectangle", "minMaxHeights", "ApproximateTerrainHeights_default", "normalNudge", "indexOffset", "boundingSpheres", "boundingSphere", "attributes", "GeometryAttribute_default", "ComponentDatatype_default", "getVec4GeometryAttribute", "Geometry_default", "typedArray", "GroundPolylineGeometry_default", "PolylineShadowVolumeFS_default", "PolylineShadowVolumeMorphFS_default", "PolylineShadowVolumeMorphVS_default", "PolylineShadowVolumeVS_default", "PolylineColorAppearanceVS_default", "PolylineCommon_default", "defaultVertexShaderSource", "PolylineCommon_default", "PolylineColorAppearanceVS_default", "defaultFragmentShaderSource", "PerInstanceFlatColorAppearanceFS_default", "FeatureDetection_default", "PolylineColorAppearance", "options", "defaultValue_default", "translucent", "closed", "vertexFormat", "Appearance_default", "VertexFormat_default", "PolylineColorAppearance_default", "PolylineMaterialAppearanceVS_default", "PolylineFS_default", "defaultVertexShaderSource", "PolylineCommon_default", "PolylineMaterialAppearanceVS_default", "defaultFragmentShaderSource", "PolylineFS_default", "FeatureDetection_default", "PolylineMaterialAppearance", "options", "defaultValue_default", "translucent", "closed", "vertexFormat", "defined_default", "Material_default", "Appearance_default", "vs", "VertexFormat_default", "PolylineMaterialAppearance_default", "GroundPolylinePrimitive", "options", "defaultValue_default", "appearance", "defined_default", "PolylineMaterialAppearance_default", "ClassificationType_default", "groundPolylinePrimitive", "resolve", "reject", "error", "getRenderState", "RenderState_default", "CullFace_default", "BlendingState_default", "ApproximateTerrainHeights_default", "createShaderProgram", "frameState", "context", "primitive", "attributeLocations", "vs", "PolylineShadowVolumeVS_default", "Primitive_default", "vsMorph", "PolylineShadowVolumeMorphVS_default", "fs", "PolylineShadowVolumeFS_default", "vsDefines", "colorDefine", "materialShaderSource", "fsDefines", "vsColor3D", "ShaderSource_default", "fsColor3D", "ShaderProgram_default", "colorProgram2D", "vsColor2D", "colorProgramMorph", "vsColorMorph", "PolylineShadowVolumeMorphFS_default", "fsColorMorph", "mask3DTiles", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "createCommands", "material", "translucent", "colorCommands", "pickCommands", "length", "materialUniforms", "PolylineColorAppearance_default", "uniformMap", "i", "vertexArray", "command", "DrawCommand_default", "Pass_default", "derivedTilesetCommand", "derived2DCommand", "derived2DTilesetCommand", "derivedMorphCommand", "updateAndQueueCommand", "modelMatrix", "cull", "boundingVolume", "debugShowBoundingVolume", "SceneMode_default", "updateAndQueueCommands", "boundingSpheres", "morphing", "classificationType", "queueTerrainCommands", "queue3DTilesCommands", "passes", "colorLength", "j", "that", "primitiveOptions", "geometryInstances", "geometryInstancesLength", "groundInstances", "attributes", "geometryInstance", "instanceAttributes", "attributeKey", "GeometryInstanceAttribute_default", "ComponentDatatype_default", "GroundPolylineGeometry_default", "GeometryInstance_default", "twoPasses", "DeveloperError_default", "id", "scene", "destroyObject_default", "GroundPolylinePrimitive_default", "defaultRepeat", "Cartesian2_default", "defaultTransparent", "defaultColor", "Color_default", "ImageMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "ImageMaterialProperty_default", "createMaterialProperty", "value", "Color_default", "ColorMaterialProperty_default", "Resource_default", "result", "ImageMaterialProperty_default", "createMaterialPropertyDescriptor", "name", "configurable", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "BoxGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "BoxGraphics_default", "ReferenceFrame", "ReferenceFrame_default", "PositionProperty", "DeveloperError_default", "scratchMatrix3", "Matrix3_default", "time", "value", "inputFrame", "outputFrame", "result", "defined_default", "Cartesian3_default", "icrfToFixed", "Transforms_default", "ReferenceFrame_default", "PositionProperty_default", "ConstantPositionProperty", "value", "referenceFrame", "Event_default", "Cartesian3_default", "defaultValue_default", "ReferenceFrame_default", "defined_default", "time", "result", "definitionChanged", "PositionProperty_default", "other", "ConstantPositionProperty_default", "CorridorGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "CorridorGraphics_default", "createRawProperty", "value", "createRawPropertyDescriptor", "name", "configurable", "createPropertyDescriptor_default", "createRawPropertyDescriptor_default", "CylinderGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "CylinderGraphics_default", "EllipseGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "EllipseGraphics_default", "EllipsoidGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "EllipsoidGraphics_default", "LabelGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "result", "defined_default", "source", "LabelGraphics_default", "defaultScale", "Cartesian3_default", "defaultTranslation", "defaultRotation", "Quaternion_default", "TranslationRotationScale", "translation", "rotation", "scale", "defaultValue_default", "right", "defined_default", "TranslationRotationScale_default", "defaultNodeTransformation", "TranslationRotationScale_default", "NodeTransformationProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "NodeTransformationProperty_default", "PropertyBag", "value", "createPropertyCallback", "Event_default", "defined_default", "propertyNames", "i", "len", "Property_default", "propertyName", "createConstantProperty", "ConstantProperty_default", "createPropertyDescriptor_default", "defaultValue_default", "index", "time", "result", "source", "sourcePropertyNames", "name", "targetProperty", "sourceProperty", "propertiesEqual", "a", "b", "aPropertyNames", "bPropertyNames", "aIndex", "other", "PropertyBag_default", "createNodeTransformationProperty", "value", "NodeTransformationProperty_default", "createNodeTransformationPropertyBag", "PropertyBag_default", "createArticulationStagePropertyBag", "ModelGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "result", "defined_default", "source", "sourceNodeTransformations", "targetNodeTransformations", "sourceArticulations", "targetArticulations", "ModelGraphics_default", "Cesium3DTilesetGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "result", "defined_default", "source", "Cesium3DTilesetGraphics_default", "PathGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "PathGraphics_default", "PlaneGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "PlaneGraphics_default", "PointGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "result", "defined_default", "source", "PointGraphics_default", "PolygonHierarchy", "positions", "holes", "defined_default", "PolygonHierarchy_default", "createPolygonHierarchyProperty", "value", "PolygonHierarchy_default", "ConstantProperty_default", "PolygonGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "PolygonGraphics_default", "PolylineGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "PolylineGraphics_default", "PolylineVolumeGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "PolylineVolumeGraphics_default", "RectangleGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "RectangleGraphics_default", "WallGraphics", "options", "Event_default", "defaultValue_default", "createPropertyDescriptor_default", "createMaterialPropertyDescriptor_default", "result", "defined_default", "source", "WallGraphics_default", "cartoScratch", "Cartographic_default", "createConstantPositionProperty", "value", "ConstantPositionProperty_default", "createPositionPropertyDescriptor", "name", "createPropertyDescriptor_default", "createPropertyTypeDescriptor", "Type", "Entity", "options", "defaultValue_default", "id", "defined_default", "createGuid_default", "Event_default", "updateShow", "entity", "children", "isShowing", "length", "i", "child", "childShow", "createRawPropertyDescriptor_default", "wasShowing", "oldValue", "index", "BillboardGraphics_default", "BoxGraphics_default", "CorridorGraphics_default", "CylinderGraphics_default", "EllipseGraphics_default", "EllipsoidGraphics_default", "LabelGraphics_default", "ModelGraphics_default", "Cesium3DTilesetGraphics_default", "PathGraphics_default", "PlaneGraphics_default", "PointGraphics_default", "PolygonGraphics_default", "PolylineGraphics_default", "PolylineVolumeGraphics_default", "PropertyBag_default", "RectangleGraphics_default", "WallGraphics_default", "time", "availability", "propertyName", "source", "propertyNames", "sourcePropertyNames", "propertyNamesLength", "targetProperty", "sourceProperty", "matrix3Scratch", "Matrix3_default", "positionScratch", "Cartesian3_default", "orientationScratch", "Quaternion_default", "result", "position", "Property_default", "orientation", "Matrix4_default", "Transforms_default", "heightReferenceProperty", "heightOffset", "ellipsoid", "heightReference", "HeightReference_default", "Math_default", "carto", "scene", "GroundPrimitive_default", "GroundPolylinePrimitive_default", "Entity_default", "defaultMaterial", "ColorMaterialProperty_default", "Color_default", "defaultShow", "ConstantProperty_default", "defaultFill", "defaultOutline", "defaultOutlineColor", "defaultShadows", "ShadowMode_default", "defaultDistanceDisplayCondition", "DistanceDisplayCondition_default", "defaultClassificationType", "ClassificationType_default", "GeometryUpdater", "options", "entity", "geometryPropertyName", "Event_default", "Entity_default", "defined_default", "Property_default", "time", "visible", "defaultValue_default", "DeveloperError_default", "destroyObject_default", "geometry", "show", "Iso8601_default", "propertyName", "newValue", "oldValue", "fillProperty", "fillEnabled", "outlineProperty", "outlineEnabled", "onTerrain", "oneTimeWarning_default", "outlineWidth", "primitives", "groundPrimitives", "GeometryUpdater_default", "CallbackProperty", "callback", "isConstant", "Event_default", "time", "result", "changed", "other", "CallbackProperty_default", "scratchPosition", "Cartesian3_default", "scratchCarto", "Cartographic_default", "TerrainOffsetProperty", "scene", "positionProperty", "heightReferenceProperty", "extrudedHeightReferenceProperty", "Event_default", "that", "defined_default", "position", "Iso8601_default", "globe", "ellipsoid", "surface", "cartographicPosition", "height", "updateFunction", "clampedPosition", "SceneMode_default", "carto", "time", "result", "heightReference", "Property_default", "HeightReference_default", "extrudedHeightReference", "Math_default", "normal", "destroyObject_default", "TerrainOffsetProperty_default", "heightReferenceOnEntityPropertyChanged", "entity", "propertyName", "newValue", "oldValue", "GeometryUpdater_default", "geometry", "defined_default", "heightReferenceProperty", "centerPosition", "CallbackProperty_default", "TerrainOffsetProperty_default", "heightReferenceOnEntityPropertyChanged_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "positionScratch", "scratchColor", "Color_default", "BoxGeometryOptions", "entity", "BoxGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "isAvailable", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "attributes", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "BoxGeometry_default", "outlineColor", "BoxOutlineGeometry_default", "result", "box", "heightReference", "Iso8601_default", "HeightReference_default", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "GeometryOffsetAttribute_default", "heightReferenceOnEntityPropertyChanged_default", "DynamicBoxGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "position", "dimensions", "BoxGeometryUpdater_default", "import_dompurify", "nextCreditId", "creditToId", "Credit", "html", "showOnScreen", "id", "key", "defined_default", "defaultValue_default", "value", "DOMPurify", "div", "links", "left", "right", "credit", "attribution", "Credit_default", "deprecationWarning", "identifier", "message", "oneTimeWarning_default", "deprecationWarning_default", "ComputeCommand", "options", "defaultValue_default", "Pass_default", "computeEngine", "ComputeCommand_default", "OctahedralProjectionAtlasFS_default", "OctahedralProjectionFS_default", "OctahedralProjectionVS_default", "OctahedralProjectedCubeMap", "url", "cubeMap", "resolve", "reject", "cachedTexture", "cleanupResources", "error", "context", "v1", "Cartesian3_default", "v2", "v3", "v4", "v5", "v6", "cubeMapCoordinates", "length", "flatCubeMapCoordinates", "offset", "i", "flatPositions", "indices", "createVertexArray", "positionBuffer", "Buffer_default", "BufferUsage_default", "cubeMapCoordinatesBuffer", "indexBuffer", "IndexDatatype_default", "attributes", "ComponentDatatype_default", "VertexArray_default", "createUniformTexture", "texture", "map", "cubeMaps", "defined_default", "mipTextures", "frameState", "cubeMapBuffers", "that", "loadKTX2_default", "buffers", "e", "defines", "pixelDatatype", "PixelDatatype_default", "pixelFormat", "PixelFormat_default", "fs", "ShaderSource_default", "OctahedralProjectionFS_default", "ShaderProgram_default", "OctahedralProjectionVS_default", "originalSize", "uniformMap", "positiveY", "CubeMap_default", "size", "mipTexture", "Texture_default", "command", "ComputeCommand_default", "atlasCommand", "OctahedralProjectionAtlasFS_default", "destroyObject_default", "OctahedralProjectedCubeMap_default", "ImageBasedLighting", "options", "defaultValue_default", "imageBasedLightingFactor", "defined_default", "Cartesian2_default", "luminanceAtZenith", "sphericalHarmonicCoefficients", "value", "createSpecularEnvironmentMapAtlas", "imageBasedLighting", "context", "OctahedralProjectedCubeMap_default", "atlas", "error", "frameState", "iblFactor", "previousIBLFactor", "recompileWithDefaultAtlas", "recompileWithoutDefaultAtlas", "recompileWithDefaultSHCoeffs", "recompileWithoutDefaultSHCoeffs", "destroyObject_default", "ImageBasedLighting_default", "ManagedArray", "length", "defaultValue_default", "array", "originalLength", "index", "element", "ManagedArray_default", "ClearCommand", "options", "defaultValue_default", "Color_default", "context", "passState", "ClearCommand_default", "Axis", "Matrix4_default", "Matrix3_default", "Math_default", "name", "Axis_default", "CullingVolume", "planes", "defaultValue_default", "faces", "Cartesian3_default", "scratchPlaneCenter", "scratchPlaneNormal", "scratchPlane", "Plane_default", "boundingSphere", "result", "defined_default", "length", "center", "radius", "planeIndex", "i", "faceNormal", "plane0", "plane1", "Cartesian4_default", "boundingVolume", "intersecting", "k", "len", "Intersect_default", "parentPlaneMask", "mask", "flag", "CullingVolume_default", "OrthographicOffCenterFrustum", "options", "defaultValue_default", "CullingVolume_default", "Matrix4_default", "update", "frustum", "getPlanesRight", "Cartesian3_default", "getPlanesNearCenter", "getPlanesPoint", "negateScratch", "position", "direction", "up", "planes", "t", "b", "r", "l", "n", "f", "right", "nearCenter", "point", "plane", "defined_default", "Cartesian4_default", "drawingBufferWidth", "drawingBufferHeight", "distance", "pixelRatio", "result", "frustumWidth", "frustumHeight", "pixelWidth", "pixelHeight", "other", "relativeEpsilon", "absoluteEpsilon", "Math_default", "OrthographicOffCenterFrustum_default", "OrthographicFrustum", "options", "defaultValue_default", "OrthographicOffCenterFrustum_default", "value", "array", "startingIndex", "result", "defined_default", "update", "frustum", "f", "ratio", "position", "direction", "up", "drawingBufferWidth", "drawingBufferHeight", "distance", "pixelRatio", "other", "relativeEpsilon", "absoluteEpsilon", "Math_default", "OrthographicFrustum_default", "Cesium3DContentGroup", "options", "defaultValue_default", "Cesium3DContentGroup_default", "getStringFromTypedArray", "uint8Array", "byteOffset", "byteLength", "defaultValue_default", "view", "result", "codePoints", "utf8Handler", "length", "i", "cp", "inRange", "a", "min", "max", "utfBytes", "codePoint", "bytesSeen", "bytesNeeded", "lowerBoundary", "upperBoundary", "currentByte", "RuntimeError_default", "getStringFromTypedArray_default", "getMagic", "uint8Array", "byteOffset", "defaultValue_default", "getStringFromTypedArray_default", "getMagic_default", "Composite3DTileContent", "tileset", "tile", "resource", "arrayBuffer", "byteOffset", "factory", "initialize", "contents", "length", "i", "value", "sizeOfUint32", "content", "defaultValue_default", "uint8Array", "view", "version", "RuntimeError_default", "tilesLength", "contentPromises", "prefix", "defined_default", "tileType", "getMagic_default", "tileByteLength", "contentFactory", "compositeIndex", "childResource", "innerContent", "batchId", "name", "enabled", "color", "style", "frameState", "destroyObject_default", "Composite3DTileContent_default", "getJsonFromTypedArray", "uint8Array", "byteOffset", "byteLength", "getStringFromTypedArray_default", "getJsonFromTypedArray_default", "BatchTexture", "options", "createGuid_default", "featuresLength", "textureDimensions", "textureStep", "width", "ContextLimits_default", "height", "stepX", "centerX", "stepY", "centerY", "Cartesian2_default", "Cartesian4_default", "memory", "defined_default", "Color_default", "getByteLength", "batchTexture", "dimensions", "getBatchValues", "byteLength", "bytes", "getShowAlphaProperties", "BatchTexture", "batchId", "show", "defined_default", "showAlphaProperties", "getShowAlphaProperties", "propertyOffset", "newShow", "batchValues", "getBatchValues", "offset", "featuresLength", "i", "scratchColorBytes", "color", "Color_default", "newColor", "newAlpha", "wasTranslucent", "isTranslucent", "result", "createTexture", "batchTexture", "context", "bytes", "dimensions", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "createPickTexture", "pickIds", "byteLength", "getByteLength", "owner", "statistics", "pickId", "pickColor", "updateBatchTexture", "tileset", "frameState", "passes", "length", "destroyObject_default", "BatchTexture_default", "ComponentsPerAttribute", "ClassPerType", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "Matrix2_default", "Matrix3_default", "Matrix4_default", "getBinaryAccessor", "accessor", "componentType", "componentDatatype", "ComponentDatatype_default", "componentsPerAttribute", "classType", "buffer", "byteOffset", "length", "getBinaryAccessor_default", "BatchTableHierarchy", "options", "initialize", "hierarchy", "hierarchyJson", "binaryBody", "classId", "binaryAccessor", "instancesLength", "classes", "classIds", "parentCounts", "parentIds", "parentIdsLength", "byteLength", "defined_default", "defaultValue_default", "ComponentDatatype_default", "AttributeType_default", "getBinaryAccessor_default", "parentIndexes", "classesLength", "classInstancesLength", "properties", "binaryProperties", "getBinaryProperties", "countBinaryPropertyMemory", "combine_default", "classCounts", "classIndexes", "featuresLength", "name", "property", "byteOffset", "componentType", "type", "RuntimeError_default", "componentCount", "classType", "typedArray", "scratchVisited", "scratchStack", "marker", "traverseHierarchyMultipleParents", "instanceIndex", "endConditionCallback", "visited", "visitedMarker", "stack", "result", "parentCount", "parentIndex", "i", "parentId", "traverseHierarchySingleParent", "hasParent", "traverseHierarchy", "batchId", "propertyId", "instances", "results", "instanceClass", "indexInClass", "propertyValues", "getBinaryProperty", "clone_default", "binaryProperty", "index", "value", "setBinaryProperty", "className", "BatchTableHierarchy_default", "Cesium3DTileColorBlendMode", "Cesium3DTileColorBlendMode_default", "DEFAULT_COLOR_VALUE", "BatchTexture_default", "DEFAULT_SHOW_VALUE", "Cesium3DTileBatchTable", "content", "featuresLength", "batchTableJson", "batchTableBinary", "colorChangedCallback", "extensions", "defined_default", "defaultValue_default", "properties", "initializeProperties", "initializeHierarchy", "binaryProperties", "getBinaryProperties", "countBinaryPropertyMemory", "deprecationWarning_default", "totalByteLength", "jsonHeader", "propertyName", "clone_default", "batchTable", "binaryBody", "hierarchy", "legacyHierarchy", "BatchTableHierarchy_default", "name", "property", "byteOffset", "componentType", "type", "RuntimeError_default", "binaryAccessor", "getBinaryAccessor_default", "componentCount", "classType", "typedArray", "byteLength", "batchId", "show", "color", "result", "scratchColor", "Color_default", "style", "length", "feature", "getBinaryProperty", "binaryProperty", "index", "setBinaryProperty", "value", "Cesium3DTileBatchTable", "batchId", "className", "hierarchy", "defined_default", "name", "results", "scratchPropertyIds", "binaryProperty", "getBinaryProperty", "propertyValues", "clone_default", "hierarchyProperty", "value", "featuresLength", "setBinaryProperty", "getGlslComputeSt", "batchTable", "handleTranslucent", "batchIdAttributeName", "diffuseAttributeOrUniformName", "that", "source", "renamedSource", "modifyDiffuse", "newMain", "ContextLimits_default", "getDefaultShader", "applyHighlight", "ShaderSource_default", "replaceDiffuseTextureCalls", "functionCall", "fromIndex", "startIndex", "endIndex", "nestedLevel", "i", "character", "replacedFunction", "regex", "uniformMatch", "declaration", "type", "finalDiffuseFunction", "highlight", "setColor", "sourceDiffuse", "replaceDiffuse", "hasPremultipliedAlpha", "getColorBlend", "tileset", "colorBlendMode", "colorBlendAmount", "Cesium3DTileColorBlendMode_default", "Math_default", "uniformMap", "combine_default", "defaultValue_default", "StyleCommandsNeeded", "frameState", "commandStart", "commandList", "commandEnd", "tile", "finalResolution", "bivariateVisibilityTest", "styleCommandsNeeded", "getStyleCommandsNeeded", "command", "Pass_default", "derivedCommands", "deriveCommand", "originalCommand", "deriveTranslucentCommand", "deriveOpaqueCommand", "deriveZBackfaceCommand", "getLastSelectionDepth", "deriveStencilCommand", "opaqueCommand", "translucentCommand", "translucentFeaturesLength", "derivedCommand", "DrawCommand_default", "getTranslucentRenderState", "getOpaqueRenderState", "getLogDepthPolygonOffsetFragmentShaderProgram", "context", "shaderProgram", "shader", "fs", "rs", "CullFace_default", "StencilConstants_default", "RenderState_default", "polygonOffset", "Cartesian2_default", "reference", "StencilFunction_default", "StencilOperation_default", "stencilCommand", "renderState", "BlendingState_default", "destroyObject_default", "Cesium3DTileBatchTable_default", "Vector3DTileBatch", "options", "Vector3DTileBatch_default", "VectorTileVS_default", "Cesium3DTileFeature", "content", "batchId", "value", "defined_default", "Color_default", "name", "results", "batchTable", "contentMetadata", "tile", "tileMetadata", "subtreeMetadata", "groupMetadata", "tilesetMetadata", "className", "Cesium3DTileFeature_default", "import_jsep", "ExpressionNodeType", "ExpressionNodeType_default", "Expression", "expression", "defines", "replaceDefines", "replaceVariables", "removeBackslashes", "jsep", "ast", "e", "RuntimeError_default", "createRuntimeAst", "scratchStorage", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "array", "feature", "result", "value", "Color_default", "color", "functionSignature", "variableSubstitutionMap", "shaderState", "returnType", "shaderExpression", "variables", "variable", "index", "unaryOperators", "binaryOperators", "variableRegex", "backslashRegex", "backslashReplacement", "replacementRegex", "scratchColor", "unaryFunctions", "getEvaluateUnaryComponentwise", "Math_default", "exp2", "log2", "fract", "length", "normalize", "binaryFunctions", "getEvaluateBinaryComponentwise", "distance", "dot", "cross", "ternaryFunctions", "getEvaluateTernaryComponentwise", "number", "exponent", "operation", "call", "left", "allowScalar", "right", "test", "Node", "type", "setEvaluateFunction", "defined_default", "key", "definePlaceholder", "defineReplace", "replaceBackslashes", "exp", "openSingleQuote", "openDoubleQuote", "closeQuote", "j", "parseLiteral", "ExpressionNodeType_default", "parseCall", "args", "argsLength", "val", "object", "alpha", "i", "parseRegex", "pattern", "flags", "isLiteralType", "parseKeywordsAndVariables", "isVariable", "name", "getPropertyName", "parseMathConstant", "parseNumberConstant", "parseMemberExpression", "obj", "node", "op", "child", "getEvaluateUnaryFunction", "getEvaluateBinaryFunction", "getEvaluateTernaryFunction", "evaluateTilesetTime", "evaluate", "getFeatureProperty", "a", "components", "componentsLength", "vectorLength", "component", "match", "placeholder", "variableName", "property", "checkFeature", "member", "exec", "convertHSLToRGB", "channels", "h", "s", "l", "convertRGBToColor", "numberToString", "colorToVec3", "r", "g", "b", "colorToVec4", "getExpressionArray", "parent", "expressions", "getVariableName", "vectorExpression", "rgb", "Expression_default", "Vector3DTilePrimitive", "options", "defaultValue_default", "Cartesian3_default", "Color_default", "ClassificationType_default", "length", "i", "batchId", "defaultAttributeLocations", "createVertexArray", "primitive", "context", "defined_default", "positionBuffer", "Buffer_default", "BufferUsage_default", "idBuffer", "indexBuffer", "IndexDatatype_default", "vertexAttributes", "ComponentDatatype_default", "VertexArray_default", "createShaders", "batchTable", "attributeLocations", "pickId", "vertexShaderSource", "fragmentShaderSource", "ShaderProgram_default", "ShaderSource_default", "vsSource", "VectorTileVS_default", "fsSource", "ShadowVolumeFS_default", "vs", "fs", "pickVS", "pickFS", "getStencilDepthRenderState", "mask3DTiles", "stencilFunction", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "DepthFunction_default", "colorRenderState", "BlendingState_default", "pickRenderState", "createRenderStates", "RenderState_default", "modifiedModelViewScratch", "Matrix4_default", "rtcScratch", "createUniformMap", "uniformMap", "viewMatrix", "projectionMatrix", "copyIndicesCPU", "indices", "newIndices", "currentOffset", "offsets", "counts", "batchIds", "batchIdLookUp", "sizeInBytes", "batchedIdsLength", "j", "batchedId", "index", "offset", "count", "subarray", "rebatchCPU", "batchedIndices", "indexOffsets", "indexCounts", "current", "newBatchedIndices", "next", "copyIndicesGPU", "readBuffer", "writeBuffer", "rebatchGPU", "temp", "compareColors", "a", "b", "rebatchCommands", "needToRebatch", "colorCounts", "rgba", "createColorCommands", "needsRebatch", "commands", "commandsLength", "vertexArray", "sp", "modelMatrix", "bv", "stencilDepthCommand", "DrawCommand_default", "Pass_default", "stencilDepthDerivedCommand", "colorCommand", "colorDerivedCommand", "createColorCommandsIgnoreShow", "frameState", "commandsIgnoreShow", "spStencil", "commandIndex", "commandIgnoreShow", "createPickCommands", "pickCommands", "spPick", "content", "features", "Cesium3DTileFeature_default", "enabled", "color", "clearStyle", "polygons", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "complexExpressionReg", "style", "colorExpression", "isSimpleStyle", "Expression_default", "batchedOffset", "batchedCount", "Vector3DTileBatch_default", "startIds", "endIds", "batchIdsLength", "id", "offsetIndex", "queueCommands", "classificationType", "queueTerrainCommands", "queue3DTilesCommands", "commandList", "commandLength", "command", "queueWireframeCommands", "updateWireframe", "earlyExit", "rs", "type", "PrimitiveType_default", "passes", "destroyObject_default", "Vector3DTilePrimitive_default", "Vector3DTileGeometry", "options", "defined_default", "Cartesian3_default", "geometries", "frameState", "initialize", "ClassificationType_default", "Matrix4_default", "packBuffer", "packedBuffer", "offset", "unpackBuffer", "indicesBytesPerElement", "numBVS", "bvs", "i", "BoundingSphere_default", "numBatchedIndices", "bis", "j", "color", "Color_default", "indexOffset", "count", "length", "batchIds", "k", "Vector3DTileBatch_default", "createVerticesTaskProcessor", "TaskProcessor_default", "scratchColor", "createPrimitive", "boxes", "boxBatchIds", "cylinders", "cylinderBatchIds", "ellipsoids", "ellipsoidBatchIds", "spheres", "sphereBatchIds", "batchTableColors", "batchTable", "transferrableObjects", "parameters", "verticesPromise", "result", "finishPrimitive", "Vector3DTilePrimitive_default", "defaultValue_default", "content", "features", "enabled", "style", "batchId", "resolve", "reject", "promise", "e", "destroyObject_default", "Vector3DTileGeometry_default", "Geometry3DTileContent", "tileset", "tile", "resource", "arrayBuffer", "byteOffset", "initialize", "defined_default", "value", "createColorChangedCallback", "content", "batchId", "color", "getBatchIds", "featureTableJson", "featureTableBinary", "boxBatchIds", "cylinderBatchIds", "ellipsoidBatchIds", "sphereBatchIds", "i", "numberOfBoxes", "defaultValue_default", "numberOfCylinders", "numberOfEllipsoids", "numberOfSpheres", "boxBatchIdsByteOffset", "cylinderBatchIdsByteOffset", "ellipsoidBatchIdsByteOffset", "sphereBatchIdsByteOffset", "atLeastOneDefined", "atLeastOneUndefined", "RuntimeError_default", "id", "sizeOfUint32", "uint8Array", "view", "version", "byteLength", "featureTableJSONByteLength", "featureTableBinaryByteLength", "batchTableJSONByteLength", "batchTableBinaryByteLength", "getJsonFromTypedArray_default", "batchTableJson", "batchTableBinary", "totalPrimitives", "batchTable", "Cesium3DTileBatchTable_default", "modelMatrix", "center", "Cartesian3_default", "Matrix4_default", "batchIds", "boxes", "cylinders", "ellipsoids", "spheres", "boxesByteOffset", "Vector3DTileGeometry_default", "cylindersByteOffset", "ellipsoidsByteOffset", "spheresByteOffset", "createFeatures", "featuresLength", "features", "name", "enabled", "style", "frameState", "destroyObject_default", "Geometry3DTileContent_default", "HilbertOrder", "level", "x", "y", "n", "p", "rx", "ry", "s", "index", "rotate", "t", "HilbertOrder_default", "S2_MAX_LEVEL", "S2_LIMIT_IJ", "S2_MAX_SITI", "S2_POSITION_BITS", "S2_LOOKUP_BITS", "S2_LOOKUP_POSITIONS", "S2_LOOKUP_IJ", "S2_POSITION_TO_IJ", "S2_SWAP_MASK", "S2_INVERT_MASK", "S2_POSITION_TO_ORIENTATION_MASK", "S2Cell", "cellId", "FeatureDetection_default", "RuntimeError_default", "token", "trailingZeroHexChars", "countTrailingZeroBits", "hexString", "lsbPosition", "index", "newLsb", "lsb", "childCellId", "level", "lsbForLevel", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "center", "getS2Center", "Cartesian3_default", "cartographic", "Cartographic_default", "vertex", "getS2Vertex", "face", "position", "faceBitString", "positionBitString", "positionPrefixPadding", "positionSuffixPadding", "faceSiTi", "convertCellIdToFaceSiTi", "convertFaceSiTitoXYZ", "faceIJ", "convertCellIdToFaceIJ", "uv", "convertIJLeveltoBoundUV", "y", "convertFaceUVtoXYZ", "i", "j", "isLeaf", "shouldCorrect", "correction", "si", "ti", "generateLookupTable", "bits", "lookupMask", "k", "extractMask", "offset", "s", "convertSiTitoST", "t", "u", "convertSTtoUV", "v", "ij", "result", "cellSize", "getSizeIJ", "d", "ijLow", "ijHigh", "convertIJtoSTMinimum", "generateLookupCell", "originalOrientation", "orientation", "r", "Mod67BitPosition", "x", "S2Cell_default", "hasExtension", "json", "extensionName", "defined_default", "hasExtension_default", "ImplicitAvailabilityBitstream", "options", "lengthBits", "availableCount", "constant", "bitstream", "defined_default", "expectedLength", "RuntimeError_default", "computeAvailableCountEnabled", "defaultValue_default", "count1Bits", "count", "byteIndex", "bitIndex", "index", "ImplicitAvailabilityBitstream_default", "ImplicitMetadataView", "options", "defaultValue_default", "metadataTable", "metadataClass", "entityId", "propertyTableJson", "propertyId", "semantic", "results", "value", "ImplicitMetadataView_default", "ImplicitSubdivisionScheme", "subdivisionScheme", "ImplicitSubdivisionScheme_default", "MetadataEntity", "DeveloperError_default", "propertyId", "semantic", "results", "value", "properties", "classDefinition", "defined_default", "classProperties", "classProperty", "propertiesBySemantic", "property", "classPropertyId", "enableNestedArrays", "clone_default", "MetadataEntity_default", "ImplicitSubtreeMetadata", "options", "defaultValue_default", "subtreeMetadata", "metadataClass", "properties", "defined_default", "propertyId", "MetadataEntity_default", "semantic", "results", "value", "ImplicitSubtreeMetadata_default", "MetadataComponentType", "type", "FeatureDetection_default", "value", "max", "min", "Math_default", "offset", "scale", "MetadataComponentType_default", "MetadataType", "type", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "Matrix2_default", "Matrix3_default", "Matrix4_default", "MetadataType_default", "MetadataClassProperty", "options", "defaultValue_default", "id", "property", "isLegacyExtension", "isLegacy", "parsedType", "parseType", "componentType", "normalized", "defined_default", "MetadataComponentType_default", "offset", "scale", "hasValueTransform", "enableNestedArrays", "required", "type", "MetadataType_default", "enums", "isLegacyArray", "isArray", "arrayLength", "isVariableLengthArray", "enumType", "value", "normalizeInPlace", "constant", "componentCount", "isNested", "innerConstant", "sentinel", "arrayEquals", "left", "right", "i", "MathType", "x", "validateArray", "validateSingleValue", "classProperty", "length", "message", "validateVector", "validateMatrix", "validateString", "validateBoolean", "validateEnum", "validateScalar", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "Matrix2_default", "Matrix3_default", "Matrix4_default", "getTypeErrorMessage", "javascriptType", "checkInRange", "getNonFiniteErrorMessage", "getOutOfRangeErrorMessage", "errorMessage", "min", "max", "values", "valueType", "normalizeFunction", "offsets", "scales", "transformationFunction", "MetadataClassProperty_default", "MetadataTableProperty", "options", "defaultValue_default", "count", "property", "classProperty", "bufferViews", "type", "isArray", "isVariableLengthArray", "valueType", "enumType", "hasStrings", "MetadataType_default", "hasBooleans", "byteLength", "arrayOffsets", "arrayOffsetType", "MetadataComponentType_default", "arrayOffsetBufferView", "BufferView", "vectorComponentCount", "arrayComponentCount", "componentCount", "stringOffsets", "stringOffsetType", "stringOffsetBufferView", "valueCount", "valuesBufferView", "values", "offset", "scale", "hasValueTransform", "defined_default", "flatten", "getValueFunction", "setValueFunction", "that", "index", "getString", "getBoolean", "value", "setBoolean", "integer", "get", "applyValueTransform", "unapplyValueTransform", "set", "result", "i", "get", "property", "index", "requiresUnpackForGet", "unpackProperty", "classProperty", "isArray", "type", "componentCount", "MetadataType_default", "defined_default", "value", "clone_default", "getArrayValues", "offset", "length", "defaultValue_default", "values", "i", "set", "requiresUnpackForSet", "getString", "stringOffsets", "stringByteOffset", "stringByteLength", "getStringFromTypedArray_default", "getBoolean", "byteIndex", "bitIndex", "setBoolean", "getInt64NumberFallback", "dataView", "byteOffset", "isNegative", "carrying", "byte", "getInt64BigIntFallback", "getUint64NumberFallback", "left", "right", "getUint64BigIntFallback", "getComponentDatatype", "componentType", "MetadataComponentType_default", "ComponentDatatype_default", "valueType", "FeatureDetection_default", "arrayOffsets", "oldLength", "newLength", "unpackValues", "count", "unpackedValues", "applyValueTransform", "isVariableLengthArray", "MetadataClassProperty_default", "unapplyValueTransform", "BufferView", "bufferView", "that", "typedArray", "getFunction", "setFunction", "oneTimeWarning_default", "componentDatatype", "MetadataTableProperty_default", "MetadataTableProperty", "MetadataTable", "options", "defaultValue_default", "count", "metadataClass", "byteLength", "properties", "defined_default", "propertyId", "property", "MetadataTableProperty_default", "MetadataEntity_default", "semantic", "results", "index", "value", "getDefault", "propertiesBySemantic", "classDefinition", "classProperties", "classProperty", "clone_default", "MetadataTable_default", "ResourceLoader", "DeveloperError_default", "frameState", "errorMessage", "error", "defined_default", "runtimeError", "RuntimeError_default", "destroyObject_default", "ResourceLoader_default", "ResourceLoaderState", "ResourceLoaderState_default", "BufferLoader", "options", "defaultValue_default", "typedArray", "resource", "cacheKey", "ResourceLoaderState_default", "defined_default", "ResourceLoader_default", "loadExternalBuffer", "bufferLoader", "arrayBuffer", "error", "errorMessage", "BufferLoader_default", "MeshoptEncoder", "wasm", "wasmpack", "instance", "promise", "unpack", "result", "data", "i", "ch", "write", "assert", "cond", "bytes", "view", "reorder", "indices", "vertices", "optf", "sbrk", "ip", "rp", "heap", "indices8", "unique", "remap", "encode", "fun", "bound", "source", "count", "size", "tp", "sp", "res", "target", "maxindex", "index", "index32", "filter", "stride", "bits", "insize", "triangles", "optsize", "mode", "table", "MeshoptDecoder", "wasm_base", "wasm_simd", "detector", "wasmpack", "wasm", "instance", "promise", "unpack", "result", "data", "i", "ch", "write", "decode", "fun", "target", "count", "size", "source", "filter", "sbrk", "count4", "tp", "sp", "heap", "res", "filters", "decoders", "mode", "MeshoptSimplifier", "wasm", "wasmpack", "instance", "promise", "unpack", "result", "data", "i", "ch", "write", "assert", "cond", "bytes", "view", "reorder", "indices", "vertices", "sbrk", "ip", "rp", "heap", "indices8", "unique", "remap", "maxindex", "source", "index", "simplify", "fun", "index_count", "vertex_positions", "vertex_count", "vertex_positions_stride", "target_index_count", "target_error", "options", "te", "ti", "sp", "si", "target", "error", "simplifyScale", "simplifyOptions", "indices32", "flags", "GltfBufferViewLoader", "options", "defaultValue_default", "resourceCache", "gltf", "bufferViewId", "gltfResource", "baseResource", "cacheKey", "bufferView", "bufferId", "byteOffset", "byteLength", "hasMeshopt", "meshoptByteStride", "meshoptCount", "meshoptMode", "meshoptFilter", "hasExtension_default", "meshopt", "buffer", "ResourceLoaderState_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "bufferLoader", "getBufferLoader", "that", "bufferViewPromise", "resolve", "count", "byteStride", "result", "MeshoptDecoder", "bufferTypedArray", "bufferViewTypedArray", "error", "errorMessage", "bufferViewLoader", "resource", "GltfBufferViewLoader_default", "DracoLoader", "FeatureDetection_default", "defined_default", "processor", "TaskProcessor_default", "parameters", "decoderTaskProcessor", "options", "DracoLoader_default", "GltfDracoLoader", "options", "defaultValue_default", "resourceCache", "gltf", "draco", "gltfResource", "baseResource", "cacheKey", "ResourceLoaderState_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "bufferViewLoader", "that", "dracoPromise", "resolve", "reject", "bufferViews", "bufferViewId", "bufferView", "compressedAttributes", "decodeOptions", "decodePromise", "DracoLoader_default", "results", "e", "error", "handleError", "dracoLoader", "errorMessage", "GltfDracoLoader_default", "loadImageFromTypedArray", "options", "uint8Array", "format", "request", "flipY", "defaultValue_default", "skipColorSpaceConversion", "blob", "blobUrl", "Resource_default", "result", "defined_default", "error", "loadImageFromTypedArray_default", "GltfImageLoader", "options", "defaultValue_default", "resourceCache", "gltf", "imageId", "gltfResource", "baseResource", "cacheKey", "image", "bufferViewId", "uri", "ResourceLoaderState_default", "defined_default", "ResourceLoader_default", "loadFromBufferView", "loadFromUri", "getImageAndMipLevels", "mipLevels", "mipLevel", "imageLoader", "bufferViewLoader", "typedArray", "loadImageFromBufferTypedArray", "imageAndMipLevels", "error", "handleError", "resource", "loadImageFromUri", "errorMessage", "getMimeTypeFromTypedArray", "header", "webpHeaderRIFFChars", "webpHeaderWEBPChars", "RuntimeError_default", "mimeType", "ktxBuffer", "loadKTX2_default", "ktx2Regex", "loadImageFromTypedArray_default", "GltfImageLoader_default", "JobType", "JobType_default", "GltfIndexBufferLoader", "options", "defaultValue_default", "resourceCache", "gltf", "accessorId", "gltfResource", "baseResource", "draco", "cacheKey", "asynchronous", "loadBuffer", "loadTypedArray", "indexDatatype", "ResourceLoaderState_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "scratchIndexBufferJob", "CreateIndexBufferJob", "promise", "loadFromDraco", "loadFromBufferView", "that", "processPromise", "resolve", "typedArray", "buffer", "indexBufferJob", "JobType_default", "createIndexBuffer", "error", "handleError", "indexBufferLoader", "dracoLoader", "ComponentDatatype_default", "bufferViewId", "bufferViewLoader", "bufferViewTypedArray", "createIndicesTypedArray", "accessor", "count", "indexSize", "IndexDatatype_default", "arrayBuffer", "byteOffset", "byteLength", "view", "deprecationWarning_default", "errorMessage", "context", "Buffer_default", "BufferUsage_default", "GltfIndexBufferLoader_default", "addToArray", "array", "element", "checkDuplicates", "defaultValue_default", "index", "addToArray_default", "usesExtension", "gltf", "extension", "defined_default", "usesExtension_default", "ForEach", "objects", "handler", "defined_default", "objectId", "object", "value", "arrayOfObjects", "length", "gltf", "name", "gltfProperty", "semantic", "visited", "mesh", "primitive", "valueForEach", "accessorId", "attributeSemantic", "target", "indices", "animation", "channels", "samplers", "material", "values", "primitives", "primitivesLength", "i", "attributes", "targets", "nodeIds", "nodes", "nodeId", "node", "children", "scene", "sceneNodeIds", "usesExtension_default", "skin", "joints", "jointsLength", "joint", "technique", "attributeName", "uniforms", "uniformName", "parameters", "parameterName", "ForEach_default", "numberOfComponentsForType", "type", "numberOfComponentsForType_default", "getAccessorByteStride", "gltf", "accessor", "bufferViewId", "defined_default", "bufferView", "ComponentDatatype_default", "numberOfComponentsForType_default", "getAccessorByteStride_default", "addDefaults", "gltf", "ForEach_default", "accessor", "defined_default", "defaultValue_default", "bufferView", "mesh", "primitive", "WebGLConstants_default", "defaultMaterial", "addToArray_default", "accessorId", "bufferViewId", "getAccessorByteStride_default", "material", "extensions", "materialsCommon", "technique", "values", "techniquesExtension", "materialValue", "addTextureDefaults", "pbrMetallicRoughness", "pbrSpecularGlossiness", "animation", "sampler", "animatedNodes", "getAnimatedNodes", "node", "id", "nodes", "channel", "target", "nodeId", "path", "texture", "addDefaults_default", "addPipelineExtras", "gltf", "ForEach_default", "shader", "addExtras", "buffer", "image", "object", "defined_default", "addPipelineExtras_default", "removeExtensionsRequired", "gltf", "extension", "extensionsRequired", "defined_default", "index", "removeExtensionsRequired_default", "removeExtensionsUsed", "gltf", "extension", "extensionsUsed", "defined_default", "index", "removeExtensionsRequired_default", "removeExtensionsUsed_default", "sizeOfUint32", "parseGlb", "glb", "getMagic_default", "RuntimeError_default", "header", "readHeader", "version", "parseGlbVersion1", "parseGlbVersion2", "byteOffset", "count", "dataView", "i", "length", "contentLength", "jsonStart", "binaryStart", "contentString", "getStringFromTypedArray_default", "gltf", "addPipelineExtras_default", "binaryBuffer", "buffers", "defined_default", "binaryGltfBuffer", "defaultValue_default", "removeExtensionsUsed_default", "chunkHeader", "chunkLength", "chunkType", "chunkBuffer", "jsonString", "buffer", "parseGlb_default", "removePipelineExtras", "gltf", "ForEach_default", "shader", "removeExtras", "buffer", "image", "object", "defined_default", "removePipelineExtras_default", "addExtensionsUsed", "gltf", "extension", "extensionsUsed", "defined_default", "addToArray_default", "addExtensionsUsed_default", "getComponentReader", "componentType", "ComponentDatatype_default", "dataView", "byteOffset", "numberOfComponents", "componentTypeByteLength", "result", "i", "getComponentReader_default", "findAccessorMinMax", "gltf", "accessor", "bufferViews", "buffers", "bufferViewId", "numberOfComponents", "numberOfComponentsForType_default", "defined_default", "min", "max", "bufferView", "bufferId", "source", "count", "byteStride", "getAccessorByteStride_default", "byteOffset", "componentType", "componentTypeByteLength", "ComponentDatatype_default", "dataView", "components", "componentReader", "getComponentReader_default", "i", "j", "value", "findAccessorMinMax_default", "defaultBlendEquation", "WebGLConstants_default", "defaultBlendFactors", "isStateEnabled", "renderStates", "state", "enabled", "defined_default", "supportedBlendFactors", "getSupportedBlendFactors", "value", "defaultValue", "i", "moveTechniqueRenderStates", "gltf", "blendingForTechnique", "materialPropertiesForTechnique", "techniquesLegacy", "ForEach_default", "techniqueLegacy", "techniqueIndex", "materialProperties", "blendFunctions", "defaultValue_default", "addExtensionsUsed_default", "material", "property", "blending", "moveTechniqueRenderStates_default", "addExtensionsRequired", "gltf", "extension", "extensionsRequired", "defined_default", "addToArray_default", "addExtensionsUsed_default", "addExtensionsRequired_default", "moveTechniquesToExtension", "gltf", "techniquesLegacy", "mappedUniforms", "updatedTechniqueIndices", "seenPrograms", "defined_default", "extension", "glExtensions", "ForEach_default", "techniqueLegacy", "techniqueId", "technique", "parameterLegacy", "parameterName", "attributeName", "uniformName", "programLegacy", "program", "fs", "addToArray_default", "vs", "addExtensionsUsed_default", "addExtensionsRequired_default", "material", "materialExtension", "value", "moveTechniquesToExtension_default", "forEachTextureInMaterial", "material", "handler", "Check_default", "pbrMetallicRoughness", "defined_default", "textureInfo", "value", "pbrSpecularGlossiness", "materialsCommon", "diffuse", "ambient", "emission", "specular", "ForEach_default", "materialValue", "forEachTextureInMaterial_default", "allElementTypes", "removeUnusedElements", "gltf", "elementTypes", "defaultValue_default", "type", "removeUnusedElementsByType", "TypeToGltfElementName", "name", "arrayOfObjects", "defined_default", "removed", "usedIds", "getListOfElementsIdsInUse", "length", "i", "Remove", "accessorId", "ForEach_default", "mesh", "primitive", "attributeAccessorId", "semantic", "target", "indices", "skin", "animation", "sampler", "bufferId", "bufferView", "bufferViewId", "accessor", "shader", "image", "usesExtension_default", "featureTables", "featureTableId", "properties", "propertyId", "property", "propertyTables", "propertyTablesLength", "imageId", "texture", "ext", "meshId", "node", "nodeId", "x", "channel", "technique", "uniform", "scene", "materialId", "samplerId", "textureId", "material", "forEachTextureInMaterial_default", "textureIndex", "textureInfo", "extensions", "featureIdTextures", "featureIdTexturesLength", "featureTextures", "featureTextureId", "featureIds", "featureIdsLength", "featureId", "propertyTextures", "propertyTexturesLength", "usedAccessorIds", "key", "usedBufferIds", "usedBufferViewIds", "usedImageIds", "usedMeshIds", "nodeIsEmpty", "usedNodeIds", "n", "joint", "usedMaterialIds", "usedTextureIds", "usedSamplerIds", "removeUnusedElements_default", "addBuffer", "gltf", "buffer", "newBuffer", "bufferView", "addToArray_default", "addBuffer_default", "readAccessorPacked", "gltf", "accessor", "byteStride", "getAccessorByteStride_default", "componentTypeByteLength", "ComponentDatatype_default", "numberOfComponents", "numberOfComponentsForType_default", "count", "values", "defined_default", "bufferView", "source", "byteOffset", "dataView", "components", "componentReader", "getComponentReader_default", "i", "j", "readAccessorPacked_default", "updateAccessorComponentTypes", "gltf", "componentType", "ForEach_default", "accessorId", "accessor", "WebGLConstants_default", "convertType", "ComponentDatatype_default", "updatedComponentType", "typedArray", "readAccessorPacked_default", "newBuffer", "addBuffer_default", "updateAccessorComponentTypes_default", "removeExtension", "gltf", "extension", "removeExtensionsUsed_default", "removeCesiumRTC", "removeExtensionAndTraverse", "ForEach_default", "technique", "uniform", "object", "length", "extensions", "extensionData", "defined_default", "key", "removeExtension_default", "updateFunctions", "glTF08to10", "glTF10to20", "updateVersion", "gltf", "options", "defaultValue_default", "targetVersion", "version", "defined_default", "updateFunction", "convertTechniquesToPbr", "convertMaterialsCommonToPbr", "updateInstanceTechniques", "materials", "materialId", "material", "instanceTechnique", "setPrimitiveModes", "meshes", "meshId", "primitives", "primitivesLength", "i", "primitive", "defaultMode", "WebGLConstants_default", "updateNodes", "nodes", "axis", "Cartesian3_default", "quat", "Quaternion_default", "nodeId", "node", "rotation", "instanceSkin", "updateAnimations", "animations", "accessors", "bufferViews", "buffers", "updatedAccessors", "animationId", "animation", "channels", "parameters", "samplers", "channelsLength", "channel", "accessorId", "accessor", "bufferView", "source", "byteOffset", "componentType", "count", "componentsLength", "numberOfComponentsForType_default", "length", "typedArray", "ComponentDatatype_default", "j", "offset", "angle", "removeTechniquePasses", "techniques", "techniqueId", "technique", "passes", "passName", "pass", "instanceProgram", "asset", "split", "extensions", "materialsCommon", "addExtensionsUsed_default", "removeAnimationSamplersIndirection", "samplerId", "sampler", "objectToArray", "object", "mapping", "array", "id", "value", "objectsToArrays", "globalMapping", "jointName", "jointNameToId", "topLevelId", "objectMapping", "ForEach_default", "shader", "binaryGltf", "program", "parameter", "mesh", "semantic", "children", "childrenLength", "meshesLength", "meshNode", "meshNodeId", "addToArray_default", "skeletons", "skin", "jointNames", "joints", "jointNamesLength", "scene", "sceneNodes", "sceneNodesLength", "samplerMapping", "target", "name", "image", "texture", "removeAnimationSamplerNames", "removeEmptyArrays", "stripAsset", "knownExtensions", "requireKnownExtensions", "extensionsUsed", "extensionsUsedLength", "extension", "removeBufferType", "buffer", "removeTextureProperties", "requireAttributeSetIndex", "knownSemantics", "indexedSemantics", "underscoreApplicationSpecificSemantics", "mappedSemantics", "setIndex", "strippedSemantic", "suffix", "newSemantic", "indexedSemantic", "mappedSemantic", "clampCameraParameters", "camera", "perspective", "aspectRatio", "yfov", "computeAccessorByteStride", "getAccessorByteStride_default", "requireByteLength", "bufferViewId", "accessorByteStride", "accessorByteEnd", "moveByteStrideToBufferView", "bufferViewHasVertexAttributes", "bufferViewMap", "a", "b", "currentByteOffset", "currentIndex", "accessorsLength", "accessorByteOffset", "accessorByteLength", "hasNextAccessor", "nextAccessorByteStride", "newBufferView", "clone_default", "newBufferViewId", "removeUnusedElements_default", "requirePositionAccessorMinMax", "minMax", "findAccessorMinMax_default", "isNodeEmpty", "Cartesian4_default", "Matrix4_default", "deleteNode", "parentNode", "parentNodeId", "index", "removeEmptyNodes", "requireAnimationAccessorMinMax", "validatePresentAccessorMinMax", "updateAccessorComponentTypes_default", "moveTechniqueRenderStates_default", "moveTechniquesToExtension_default", "baseColorTextureNames", "baseColorFactorNames", "initializePbrMaterial", "isTexture", "isVec4", "srgbToLinear", "srgb", "linear", "c", "removeExtension_default", "values", "ambient", "diffuse", "emission", "transparency", "doubleSided", "transparent", "updateVersion_default", "GltfJsonLoader", "options", "defaultValue_default", "resourceCache", "gltfResource", "baseResource", "typedArray", "gltfJson", "cacheKey", "ResourceLoaderState_default", "defined_default", "ResourceLoader_default", "processPromise", "processGltfJson", "processGltfTypedArray", "loadFromUri", "that", "gltf", "error", "handleError", "gltfJsonLoader", "arrayBuffer", "errorMessage", "upgradeVersion", "usesExtension_default", "promises", "ForEach_default", "buffer", "resource", "bufferLoader", "updateVersion_default", "decodeDataUris", "bufferUri", "isDataUri_default", "Resource_default", "loadEmbeddedBuffers", "bufferId", "source", "addPipelineExtras_default", "addDefaults_default", "removePipelineExtras_default", "getMagic_default", "parseGlb_default", "getJsonFromTypedArray_default", "bufferLoaders", "bufferLoadersLength", "i", "GltfJsonLoader_default", "AlphaMode", "AlphaMode_default", "ModelComponents", "Quantization", "Attribute", "Indices", "FeatureIdAttribute", "FeatureIdImplicitRange", "FeatureIdTexture", "MorphTarget", "Primitive", "Instances", "Skin", "Node", "Scene", "AnimatedPropertyType", "AnimationSampler", "AnimationTarget", "AnimationChannel", "Animation", "ArticulationStage", "Articulation", "Asset", "Components", "Matrix4_default", "TextureReader", "Matrix3_default", "MetallicRoughness", "Cartesian4_default", "SpecularGlossiness", "Cartesian3_default", "Material", "AlphaMode_default", "ModelComponents_default", "GltfLoaderUtil", "options", "defaultValue_default", "gltf", "textureId", "supportedImageFormats", "texture", "extensions", "defined_default", "textureInfo", "compressedTextureNoMipmap", "wrapS", "TextureWrap_default", "wrapT", "minFilter", "TextureMinificationFilter_default", "magFilter", "TextureMagnificationFilter_default", "samplerId", "sampler", "usesTextureTransform", "Sampler_default", "defaultScale", "Cartesian2_default", "channels", "texCoord", "transform", "textureTransform", "offset", "rotation", "scale", "Matrix3_default", "modelTextureReader", "ModelComponents_default", "GltfLoaderUtil_default", "resizeImageToNextPowerOfTwo", "image", "canvas", "Math_default", "resizeImageToNextPowerOfTwo_default", "GltfTextureLoader", "options", "defaultValue_default", "resourceCache", "gltf", "textureInfo", "gltfResource", "baseResource", "supportedImageFormats", "cacheKey", "asynchronous", "textureId", "imageId", "GltfLoaderUtil_default", "ResourceLoaderState_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "scratchTextureJob", "CreateTextureJob", "imageLoader", "that", "processPromise", "resolve", "texture", "textureJob", "JobType_default", "createTexture", "error", "errorMessage", "image", "mipLevels", "context", "internalFormat", "compressedTextureNoMipmap", "PixelFormat_default", "sampler", "minFilter", "wrapS", "wrapT", "samplerRequiresMipmap", "TextureMinificationFilter_default", "generateMipmap", "requiresPowerOfTwo", "TextureWrap_default", "nonPowerOfTwo", "Math_default", "requiresResize", "Texture_default", "resizeImageToNextPowerOfTwo_default", "GltfTextureLoader_default", "GltfVertexBufferLoader", "options", "defaultValue_default", "resourceCache", "gltf", "gltfResource", "baseResource", "bufferViewId", "draco", "attributeSemantic", "accessorId", "cacheKey", "asynchronous", "loadBuffer", "loadTypedArray", "ResourceLoaderState_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "promise", "loadFromDraco", "loadFromBufferView", "that", "scratchVertexBufferJob", "CreateVertexBufferJob", "processPromise", "resolve", "typedArray", "buffer", "vertexBufferJob", "JobType_default", "createVertexBuffer", "error", "handleError", "getQuantizationInformation", "dracoQuantization", "componentDatatype", "componentCount", "type", "normalizationRange", "normalizationDivisor", "quantization", "ModelComponents_default", "AttributeType_default", "MathType", "dimensions", "packedDimensions", "packedSteps", "dimension", "vertexBufferLoader", "dracoLoader", "decodedVertexAttributes", "dracoAttribute", "bufferViewLoader", "errorMessage", "context", "Buffer_default", "BufferUsage_default", "GltfVertexBufferLoader_default", "MetadataClass", "options", "defaultValue_default", "id", "classDefinition", "properties", "propertiesBySemantic", "propertyId", "property", "MetadataClassProperty_default", "defined_default", "MetadataClass_default", "MetadataEnumValue", "value", "MetadataEnumValue_default", "MetadataEnum", "options", "defaultValue_default", "id", "enumDefinition", "namesByValue", "valuesByName", "values", "value", "MetadataEnumValue_default", "valueType", "MetadataComponentType_default", "MetadataEnum_default", "MetadataSchema", "schema", "enums", "defined_default", "enumId", "MetadataEnum_default", "classes", "classId", "MetadataClass_default", "MetadataSchema_default", "MetadataSchemaLoader", "options", "defaultValue_default", "schema", "resource", "cacheKey", "defined_default", "MetadataSchema_default", "ResourceLoaderState_default", "ResourceLoader_default", "loadExternalSchema", "schemaLoader", "json", "error", "errorMessage", "MetadataSchemaLoader_default", "ResourceCacheKey", "getExternalResourceCacheKey", "resource", "getAbsoluteUri_default", "getBufferViewCacheKey", "bufferView", "byteOffset", "byteLength", "hasExtension_default", "meshopt", "defaultValue_default", "getAccessorCacheKey", "accessor", "componentType", "type", "count", "getExternalBufferCacheKey", "getEmbeddedBufferCacheKey", "parentResource", "bufferId", "getBufferCacheKey", "buffer", "gltfResource", "baseResource", "defined_default", "getDracoCacheKey", "gltf", "draco", "bufferViewId", "bufferCacheKey", "bufferViewCacheKey", "getImageCacheKey", "imageId", "image", "uri", "getSamplerCacheKey", "textureInfo", "sampler", "GltfLoaderUtil_default", "options", "schema", "frameState", "attributeSemantic", "dequantize", "loadBuffer", "loadTypedArray", "cacheKeySuffix", "accessorId", "accessorCacheKey", "supportedImageFormats", "textureId", "imageCacheKey", "samplerCacheKey", "ResourceCacheKey_default", "ResourceCacheStatistics", "loader", "cacheKey", "that", "buffer", "typedArray", "totalSize", "defined_default", "geometrySize", "textureSize", "ResourceCacheStatistics_default", "ResourceCache", "ResourceCacheStatistics_default", "CacheEntry", "resourceLoader", "cacheKey", "cacheEntry", "defined_default", "options", "defaultValue_default", "schema", "resource", "ResourceCacheKey_default", "schemaLoader", "MetadataSchemaLoader_default", "parentResource", "bufferId", "typedArray", "bufferLoader", "BufferLoader_default", "gltfResource", "baseResource", "gltfJson", "gltfJsonLoader", "GltfJsonLoader_default", "gltf", "bufferViewId", "bufferViewLoader", "GltfBufferViewLoader_default", "draco", "dracoLoader", "GltfDracoLoader_default", "frameState", "attributeSemantic", "accessorId", "asynchronous", "dequantize", "loadBuffer", "loadTypedArray", "vertexBufferLoader", "GltfVertexBufferLoader_default", "promise", "indexBufferLoader", "GltfIndexBufferLoader_default", "imageId", "imageLoader", "GltfImageLoader_default", "textureInfo", "supportedImageFormats", "textureLoader", "GltfTextureLoader_default", "precedence", "cacheEntries", "cacheEntriesSorted", "a", "b", "indexA", "indexB", "cacheEntriesLength", "i", "ResourceCache_default", "ImplicitSubtree", "resource", "json", "subtreeView", "implicitTileset", "implicitCoordinates", "initialize", "index", "contentIndex", "defaultValue_default", "level", "branchingFactor", "mortonIndex", "bitsPerLevel", "ImplicitSubdivisionScheme_default", "subtree", "chunks", "defined_default", "parseSubtreeChunks", "subtreeJson", "tilePropertyTableJson", "hasExtension_default", "propertyTableIndex", "contentPropertyTableJsons", "length", "i", "metadata", "schema", "subtreeMetadata", "metadataClass", "subtreeMetadataClass", "ImplicitSubtreeMetadata_default", "defaultContentAvailability", "bufferHeaders", "preprocessBuffers", "bufferViewHeaders", "preprocessBufferViews", "markActiveBufferViews", "markActiveMetadataBufferViews", "contentPropertyTableJson", "requestActiveBuffers", "buffersU8", "bufferViewsU8", "parseActiveBufferViews", "parseAvailability", "parseTileMetadataTable", "makeTileJumpBuffer", "parseContentMetadataTables", "makeContentJumpBuffers", "subtreeReader", "byteOffset", "jsonByteLength", "binaryByteLength", "getJsonFromTypedArray_default", "subtreeBinary", "bufferHeader", "bufferViewHeader", "header", "tileAvailabilityHeader", "contentAvailabilityHeaders", "childSubtreeAvailabilityHeader", "propertyTableJson", "properties", "key", "metadataHeader", "valuesBufferView", "stringOffsetBufferView", "arrayOffsetBufferView", "internalBuffer", "promises", "promise", "requestExternalBuffer", "bufferResults", "result", "bufferResource", "bufferLoader", "ResourceCache_default", "start", "end", "bufferView", "subtreeLevels", "tileAvailabilityBits", "childSubtreeBits", "hasMetadataExtension", "hasTileMetadata", "computeAvailableCountEnabled", "parseAvailabilityBitstream", "hasContentMetadata", "bitstream", "availabilityJson", "lengthBits", "ImplicitAvailabilityBitstream_default", "tileCount", "metadataSchema", "tileMetadataClassName", "tileMetadataClass", "MetadataTable_default", "contentAvailabilityBitstreams", "contentMetadataTables", "contentCount", "contentMetadataClassName", "contentMetadataClass", "metadataTable", "makeJumpBuffer", "availability", "entityId", "bufferLength", "availableCount", "jumpBuffer", "tileJumpBuffer", "contentJumpBuffers", "contentAvailability", "contentJumpBuffer", "localLevel", "RuntimeError_default", "getTileEntityId", "tileIndex", "getContentEntityId", "metadataTables", "ImplicitMetadataView_default", "destroyObject_default", "ImplicitSubtree_default", "MetadataSemantic", "MetadataSemantic_default", "parseBoundingVolumeSemantics", "tileMetadata", "parseBoundingVolume", "parseMinimumHeight", "parseMaximumHeight", "prefix", "boundingBoxSemantic", "boundingBox", "defined_default", "boundingRegionSemantic", "boundingRegion", "boundingSphereSemantic", "boundingSphere", "minimumHeightSemantic", "maximumHeightSemantic", "parseBoundingVolumeSemantics_default", "Implicit3DTileContent", "tileset", "tile", "resource", "json", "arrayBuffer", "byteOffset", "implicitTileset", "implicitCoordinates", "templateValues", "subtreeResource", "initialize", "value", "content", "defaultValue_default", "uint8Array", "defined_default", "subtree", "ImplicitSubtree_default", "expandSubtree", "placeholderTile", "childIndex", "results", "transcodeSubtreeTiles", "statistics", "childSubtrees", "listChildSubtrees", "i", "subtreeLocator", "leafTile", "implicitChildTile", "makePlaceholderChildSubtree", "bottomRow", "branchingFactor", "j", "index", "rootTile", "deriveChildTile", "parentRow", "currentRow", "level", "levelOffset", "numberOfChildren", "childMortonIndex", "childBitIndex", "parentMortonIndex", "parentTile", "childChildIndex", "childTile", "getGeometricError", "tileMetadata", "semantic", "MetadataSemantic_default", "implicitContent", "parentIsPlaceholderTile", "tileBounds", "contentBounds", "boundingVolumeSemantics", "parseBoundingVolumeSemantics_default", "length", "hasImplicitContentMetadata", "boundingVolume", "getTileBoundingVolume", "contentJsons", "contentJson", "contentBoundingVolume", "getContentBoundingVolume", "combine_default", "childGeometricError", "tileJson", "deep", "rootHeader", "clone_default", "combinedTileJson", "makeTile", "canUpdateHeights", "hasExtension_default", "updateHeights", "updateS2CellHeights", "updateRegionHeights", "region", "minimumHeight", "maximumHeight", "s2CellVolume", "deriveBoundingVolume", "tileBoundingVolume", "rootBoundingVolume", "deriveBoundingVolumeS2", "deriveBoundingRegion", "deriveBoundingBox", "x", "y", "z", "boundingVolumeS2", "S2Cell_default", "face", "position", "HilbertOrder_default", "cell", "minHeight", "maxHeight", "midpointHeight", "scratchScaleFactors", "Cartesian3_default", "scratchRootCenter", "scratchCenter", "scratchHalfAxes", "Matrix3_default", "rootBox", "rootCenter", "rootHalfAxes", "tileScale", "modelSpaceX", "modelSpaceY", "modelSpaceZ", "scaleFactors", "center", "halfAxes", "childBox", "scratchRectangle", "Rectangle_default", "rootRegion", "rectangle", "rootMinimumHeight", "rootMaximumHeight", "childWidth", "west", "Math_default", "east", "childHeight", "south", "north", "childThickness", "childBoundingVolume", "childContentUri", "baseResource", "Cesium3DTile", "batchId", "name", "enabled", "color", "style", "frameState", "destroyObject_default", "Implicit3DTileContent_default", "ModelAnimationLoop", "ModelAnimationLoop_default", "ClippingPlane", "normal", "distance", "UpdateChangedCartesian3", "value", "defined_default", "Cartesian3_default", "plane", "result", "clippingPlane", "ClippingPlane_default", "ClippingPlaneCollection", "options", "defaultValue_default", "Matrix4_default", "Color_default", "Event_default", "unionClippingRegions", "unionIntersectFunction", "defaultIntersectFunction", "planes", "defined_default", "planesLength", "i", "value", "Intersect_default", "setIndexDirty", "collection", "index", "plane", "newPlaneIndex", "that", "indexOf", "length", "Plane_default", "clippingPlane", "ClippingPlane_default", "planeToKeep", "planesCount", "distanceEncodeScratch", "Cartesian4_default", "oct32EncodeScratch", "packPlanesAsUint8", "clippingPlaneCollection", "startIndex", "endIndex", "uint8View", "byteIndex", "oct32Normal", "AttributeCompression_default", "encodedDistance", "packPlanesAsFloats", "float32View", "floatIndex", "normal", "computeTextureResolution", "pixelsNeeded", "result", "maxSize", "ContextLimits_default", "textureResolutionScratch", "Cartesian2_default", "frameState", "clippingPlanesTexture", "context", "useFloatTexture", "currentPixelCount", "requiredResolution", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "dirtyIndex", "offsetX", "offsetY", "scratchMatrix", "scratchPlane", "Cartesian3_default", "tileBoundingVolume", "transform", "modelMatrix", "intersection", "owner", "key", "texture", "destroyObject_default", "ClippingPlaneCollection_default", "ColorBlendMode", "colorBlendMode", "colorBlendAmount", "Math_default", "ColorBlendMode_default", "ArticulationStageType", "ArticulationStageType_default", "InterpolationType", "InterpolationType_default", "emptyClass", "JsonMetadataTable", "options", "clone_default", "propertyId", "MetadataEntity_default", "results", "index", "property", "defined_default", "value", "JsonMetadataTable_default", "PropertyTable", "options", "defaultValue_default", "defined_default", "totalByteLength", "index", "propertyId", "semantic", "scratchResults", "results", "result", "value", "JsonMetadataTable_default", "PropertyTable", "featureId", "className", "hierarchy", "defined_default", "PropertyTable_default", "PropertyTextureProperty", "options", "defaultValue_default", "property", "classProperty", "textures", "channels", "defined_default", "textureInfo", "textureReader", "GltfLoaderUtil_default", "reformatChannels", "offset", "scale", "hasValueTransform", "type", "componentType", "MetadataType_default", "MetadataComponentType_default", "floatTypesByComponentCount", "integerTypesByComponentCount", "componentCount", "packedValueGlsl", "channelIndex", "PropertyTextureProperty_default", "PropertyTexture", "options", "defaultValue_default", "propertyTexture", "classDefinition", "textures", "extensions", "extras", "properties", "defined_default", "propertyId", "PropertyTextureProperty_default", "PropertyTexture_default", "PropertyAttributeProperty", "options", "defaultValue_default", "property", "classProperty", "offset", "scale", "hasValueTransform", "defined_default", "PropertyAttributeProperty_default", "PropertyAttribute", "options", "defaultValue_default", "propertyAttribute", "classDefinition", "properties", "defined_default", "propertyId", "PropertyAttributeProperty_default", "PropertyAttribute_default", "StructuralMetadata", "options", "defaultValue_default", "propertyTables", "defined_default", "totalByteLength", "length", "i", "propertyTableId", "propertyTextureId", "propertyAttributeId", "StructuralMetadata_default", "parseStructuralMetadata", "options", "defaultValue_default", "extension", "schema", "propertyTables", "defined_default", "i", "propertyTable", "classDefinition", "metadataTable", "MetadataTable_default", "PropertyTable_default", "propertyTextures", "propertyTexture", "PropertyTexture_default", "propertyAttributes", "propertyAttribute", "PropertyAttribute_default", "StructuralMetadata_default", "parseStructuralMetadata_default", "parseFeatureMetadataLegacy", "options", "defaultValue_default", "extension", "schema", "propertyTables", "sortedIds", "defined_default", "featureTableId", "featureTable", "classDefinition", "metadataTable", "MetadataTable_default", "PropertyTable_default", "propertyTextures", "featureTextureId", "featureTexture", "PropertyTexture_default", "transcodeToPropertyTexture", "StructuralMetadata_default", "propertyTexture", "properties", "propertyId", "oldProperty", "property", "reformatChannels", "combine_default", "channelsString", "length", "result", "parseFeatureMetadataLegacy_default", "GltfStructuralMetadataLoader", "options", "defaultValue_default", "gltf", "extension", "extensionLegacy", "gltfResource", "baseResource", "supportedImageFormats", "frameState", "cacheKey", "asynchronous", "ResourceLoaderState_default", "defined_default", "ResourceLoader_default", "bufferViewsPromise", "loadBufferViews", "texturesPromise", "loadTextures", "schemaPromise", "loadSchema", "that", "results", "bufferViews", "textures", "schema", "parseStructuralMetadata_default", "parseFeatureMetadataLegacy_default", "error", "errorMessage", "gatherBufferViewIdsFromProperties", "properties", "bufferViewIdSet", "propertyId", "property", "values", "arrayOffsets", "stringOffsets", "gatherBufferViewIdsFromPropertiesLegacy", "bufferView", "arrayOffsetBufferView", "stringOffsetBufferView", "gatherUsedBufferViewIds", "propertyTables", "propertyTable", "gatherUsedBufferViewIdsLegacy", "featureTables", "featureTableId", "structuralMetadataLoader", "bufferViewIds", "bufferViewPromises", "bufferViewLoaders", "bufferViewId", "bufferViewLoader", "ResourceCache_default", "bufferViewTypedArray", "unloadBufferViews", "gatherUsedTextureIds", "structuralMetadataExtension", "textureIds", "propertyTextures", "gatherTextureIdsFromProperties", "textureInfo", "gatherUsedTextureIdsLegacy", "featureTextures", "featureTextureId", "gatherTextureIdsFromPropertiesLegacy", "texturePromises", "textureLoaders", "textureId", "textureLoader", "schemaLoader", "resource", "textureLoadersLength", "bufferViewLoadersLength", "unloadTextures", "GltfStructuralMetadataLoader_default", "VertexAttributeSemantic", "semanticToVariableName", "semantic", "gltfSemantic", "setIndexMatch", "pntsSemantic", "setIndex", "variableName", "defined_default", "VertexAttributeSemantic_default", "ModelUtility", "model", "type", "path", "error", "message", "defined_default", "runtimeError", "RuntimeError_default", "node", "Matrix4_default", "Cartesian3_default", "Quaternion_default", "object", "semantic", "setIndex", "attributes", "attributesLength", "i", "attribute", "matchesSetIndex", "name", "featureIds", "label", "featureIdSet", "variableName", "hasSemantic", "VertexAttributeSemantic_default", "isVertexColor", "attributeType", "glslType", "AttributeType_default", "isQuantized", "quantizedGlslType", "cartesianMaxScratch", "cartesianMinScratch", "primitive", "instancingTranslationMin", "instancingTranslationMax", "positionGltfAttribute", "positionMax", "positionMin", "upAxis", "forwardAxis", "result", "Axis_default", "scratchMatrix3", "Matrix3_default", "modelMatrix", "primitiveType", "PrimitiveType_default", "CullFace_default", "matrix3", "identifier", "sanitizedIdentifier", "extensionsRequired", "length", "extension", "ModelUtility_default", "InstanceAttributeSemantic", "gltfSemantic", "semantic", "setIndexMatch", "InstanceAttributeSemantic_default", "MAX_GLTF_UINT16_INDEX", "MAX_GLTF_UINT8_INDEX", "PrimitiveOutlineGenerator", "options", "defaultValue_default", "triangleIndices", "outlineIndices", "originalVertexCount", "EdgeSet", "initialize", "outlineGenerator", "edges", "outlineCoordinates", "extraVertices", "vertexCount", "vertexCopies", "i", "i0", "i1", "i2", "all", "hasEdge01", "hasEdge12", "hasEdge20", "unmatchableVertexIndex", "matchAndStoreCoordinates", "defined_default", "copy", "original", "a0", "b0", "c0", "i0Mask", "computeOrderMask", "a1", "b1", "c1", "i1Mask", "a2", "b2", "c2", "i2Mask", "workingOrders", "a", "b", "c", "i0ValidOrderCount", "popcount6Bit", "i1ValidOrderCount", "i2ValidOrderCount", "i0Start", "i1Start", "i2Start", "vertexIndex", "startIndex", "first", "second", "third", "value", "attributeTypedArray", "originalLength", "stride", "extraVerticesLength", "ArrayType", "result", "sourceIndex", "resultIndex", "j", "context", "cache", "maxSize", "ContextLimits_default", "size", "levelZero", "createMipLevel", "mipLevels", "texture", "Texture_default", "PixelFormat_default", "Sampler_default", "TextureWrap_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "edgeIndices", "small", "big", "hash", "PrimitiveOutlineGenerator_default", "AttributeLoadPlan", "attribute", "IndicesLoadPlan", "indices", "PrimitiveLoadPlan", "primitive", "context", "generateOutlines", "generateBuffers", "loadPlan", "vertexCount", "generator", "PrimitiveOutlineGenerator_default", "IndexDatatype_default", "outlineCoordinates", "makeOutlineCoordinatesAttribute", "outlineCoordinatesPlan", "attributePlans", "attributesLength", "i", "outlineCoordinatesTypedArray", "ModelComponents_default", "ComponentDatatype_default", "AttributeType_default", "generateAttributeBuffers", "defined_default", "generateIndexBuffers", "attributePlan", "typedArray", "buffer", "Buffer_default", "BufferUsage_default", "indicesPlan", "PrimitiveLoadPlan_default", "SupportedImageFormats", "options", "defaultValue_default", "SupportedImageFormats_default", "Attribute", "ModelComponents_default", "Indices", "FeatureIdAttribute", "FeatureIdTexture", "FeatureIdImplicitRange", "MorphTarget", "Primitive", "Instances", "Skin", "Node", "AnimatedPropertyType", "AnimationSampler", "AnimationTarget", "AnimationChannel", "Animation", "ArticulationStage", "Articulation", "Asset", "Scene", "Components", "MetallicRoughness", "SpecularGlossiness", "Material", "GltfLoaderState", "GltfLoader", "options", "defaultValue_default", "gltfResource", "baseResource", "typedArray", "releaseGltfJson", "asynchronous", "incrementallyLoadTextures", "upAxis", "Axis_default", "forwardAxis", "loadAttributesAsTypedArray", "loadAttributesFor2D", "loadIndicesForWireframe", "loadPrimitiveOutline", "loadForClassification", "renameBatchIdSemantic", "defined_default", "loader", "frameState", "ResourceLoader_default", "gltfJsonLoader", "ResourceCache_default", "that", "textureProcessPromise", "processPromise", "resolve", "reject", "resolveTextures", "rejectTextures", "FeatureDetection_default", "supportedImageFormats", "SupportedImageFormats_default", "gltf", "parse", "processLoaders", "postProcessGeometry", "unloadBufferViews", "i", "textureLoaders", "textureLoadersLength", "error", "handleError", "gltfLoader", "errorMessage", "bufferViewLoaders", "bufferViewLoadersLength", "geometryLoaders", "geometryLoadersLength", "context", "loadPlans", "length", "loadPlan", "gatherPostProcessBuffers", "primitiveLoadPlan", "buffers", "primitive", "outlineCoordinates", "attributes", "attribute", "indices", "loadVertexBuffer", "accessorId", "semantic", "draco", "loadBuffer", "loadTypedArray", "bufferViewId", "vertexBufferLoader", "loadIndexBuffer", "indexBufferLoader", "loadBufferView", "bufferViewLoader", "getPackedTypedArray", "accessor", "bufferViewTypedArray", "byteOffset", "byteStride", "getAccessorByteStride_default", "count", "componentCount", "numberOfComponentsForType_default", "componentType", "componentByteLength", "ComponentDatatype_default", "defaultByteStride", "componentsLength", "accessorTypedArray", "dataView", "components", "componentReader", "getComponentReader_default", "j", "loadDefaultAccessorValues", "values", "accessorType", "AttributeType_default", "MathType", "loadAccessorValues", "useQuaternion", "accessorCount", "Quaternion_default", "numberOfComponents", "loadAccessor", "promise", "fromArray", "getDefault", "getQuantizationDivisor", "componentDatatype", "minimumBoundsByType", "Cartesian2_default", "Cartesian3_default", "Cartesian4_default", "dequantizeMinMax", "VectorType", "divisor", "minimumBound", "min", "max", "setQuantizationFromWeb3dQuantizedAttributes", "extension", "decodeMatrix", "decodedMin", "decodedMax", "quantization", "createAttribute", "name", "setIndex", "hasKhrMeshQuantization", "normalized", "hasExtension_default", "isQuantizable", "VertexAttributeSemantic_default", "getSetIndex", "gltfSemantic", "setIndexMatch", "scratchSemanticInfo", "getSemanticInfo", "semanticType", "renamedSemantic", "modelSemantic", "semanticInfo", "isClassificationAttribute", "attributeSemantic", "isPositionAttribute", "isFeatureIdAttribute", "isTexcoordAttribute", "finalizeDracoAttribute", "finalizeAttribute", "loadAttribute", "loadVertexAttribute", "hasInstances", "needsPostProcessing", "loadTypedArrayFor2D", "loadTypedArrayForClassification", "outputTypedArrayOnly", "outputBuffer", "outputTypedArray", "attributePlan", "PrimitiveLoadPlan_default", "loadInstancedAttribute", "hasRotation", "hasTranslationMinMax", "InstanceAttributeSemantic_default", "isTransformAttribute", "isTranslationAttribute", "loadAsTypedArrayOnly", "loadFor2D", "loadIndices", "hasFeatureIds", "loadForWireframe", "indicesPlan", "loadTexture", "textureInfo", "samplerOverride", "imageId", "GltfLoaderUtil_default", "textureLoader", "textureReader", "loadMaterial", "gltfMaterial", "material", "extensions", "pbrSpecularGlossiness", "pbrMetallicRoughness", "specularGlossiness", "metallicRoughness", "loadFeatureIdAttribute", "featureIds", "positionalLabel", "featureIdAttribute", "loadFeatureIdAttributeLegacy", "gltfFeatureIdAttribute", "featureTableId", "featureCount", "loadDefaultFeatureIds", "featureIdRange", "loadFeatureIdImplicitRangeLegacy", "loadFeatureIdTexture", "gltfFeatureIdTexture", "featureIdTexture", "Sampler_default", "channelString", "channelIndex", "loadFeatureIdTextureLegacy", "loadMorphTarget", "target", "morphTarget", "loadPrimitive", "gltfPrimitive", "primitivePlan", "materialId", "outlineExtension", "targets", "targetsLength", "structuralMetadata", "meshFeatures", "featureMetadataLegacy", "hasFeatureMetadataLegacy", "loadPrimitiveFeatures", "loadPrimitiveFeaturesLegacy", "loadPrimitiveMetadata", "loadPrimitiveMetadataLegacy", "primitiveType", "PrimitiveType_default", "RuntimeError_default", "meshFeaturesExtension", "featureIdsArray", "label", "featureIdComponent", "metadataExtension", "featureTables", "nextFeatureIdIndex", "featureIdAttributes", "featureIdAttributesLength", "propertyTableId", "featureIdTextures", "featureIdTexturesLength", "featureIdLabel", "structuralMetadataExtension", "id", "loadInstances", "nodeExtensions", "instancingExtension", "instances", "instancingExtExtensions", "instanceFeatures", "loadInstanceFeatures", "loadInstanceFeaturesLegacy", "instanceFeaturesExtension", "sortedPropertyTableIds", "loadNode", "gltfNode", "node", "Matrix4_default", "articulationsExtension", "meshId", "mesh", "primitives", "primitivesLength", "morphWeights", "loadNodes", "nodesLength", "nodes", "childrenNodeIds", "childrenLength", "loadSkin", "gltfSkin", "skin", "jointIds", "jointsLength", "joints", "inverseBindMatricesAccessorId", "loadSkins", "gltfSkins", "skinsLength", "skins", "skinId", "loadStructuralMetadata", "extensionLegacy", "structuralMetadataLoader", "GltfStructuralMetadataLoader_default", "loadAnimationSampler", "gltfSampler", "animationSampler", "inputAccessorId", "gltfInterpolation", "InterpolationType_default", "outputAccessorId", "loadAnimationTarget", "gltfTarget", "animationTarget", "nodeIndex", "path", "loadAnimationChannel", "gltfChannel", "samplers", "animationChannel", "samplerIndex", "loadAnimation", "gltfAnimation", "animation", "gltfSamplers", "samplersLength", "sampler", "gltfChannels", "channelsLength", "channels", "loadAnimations", "gltfAnimations", "animationsLength", "animations", "loadArticulationStage", "gltfStage", "stage", "type", "ArticulationStageType_default", "loadArticulation", "gltfArticulation", "articulation", "gltfStages", "gltfStagesLength", "stages", "loadArticulations", "gltfArticulations", "gltfArticulationsLength", "articulations", "getSceneNodeIds", "nodesIds", "loadScene", "scene", "sceneNodeIds", "sceneNodeId", "scratchCenter", "rejectPromise", "rejectTexturesPromise", "version", "url", "extensionsRequired", "ModelUtility_default", "featureMetadataExtensionLegacy", "cesiumRtcExtension", "featureTextures", "allPropertyTableIds", "allFeatureTextureIds", "asset", "copyright", "credits", "string", "Credit_default", "center", "readyPromises", "unloadTextures", "unloadGeometry", "unloadGeneratedAttributes", "buffer", "unloadStructuralMetadata", "GltfLoader_default", "attachTexture", "framebuffer", "attachment", "texture", "gl", "attachRenderbuffer", "renderbuffer", "Framebuffer", "options", "defaultValue_default", "maximumColorAttachments", "ContextLimits_default", "depthAttachment", "defined_default", "depthStencilAttachment", "i", "length", "attachmentEnum", "textures", "renderbuffers", "status", "index", "destroyObject_default", "Framebuffer_default", "MultisampleFramebuffer", "options", "defaultValue_default", "context", "width", "height", "colorRenderbuffers", "colorTextures", "defined_default", "DeveloperError_default", "depthStencilRenderbuffer", "depthStencilTexture", "Framebuffer_default", "blitStencil", "gl", "mask", "destroyObject_default", "MultisampleFramebuffer_default", "RenderbufferFormat", "WebGLConstants_default", "renderbufferFormat", "datatype", "RenderbufferFormat_default", "Renderbuffer", "options", "defaultValue_default", "gl", "maximumRenderbufferSize", "ContextLimits_default", "format", "RenderbufferFormat_default", "width", "defined_default", "height", "numSamples", "destroyObject_default", "Renderbuffer_default", "FramebufferManager", "options", "defaultValue_default", "width", "height", "numSamples", "pixelDatatype", "pixelFormat", "dimensionChanged", "samplesChanged", "pixelChanged", "defined_default", "framebufferDefined", "context", "PixelDatatype_default", "PixelFormat_default", "i", "Texture_default", "Sampler_default", "format", "RenderbufferFormat_default", "Renderbuffer_default", "MultisampleFramebuffer_default", "Framebuffer_default", "index", "texture", "renderbuffer", "blitStencil", "clearCommand", "passState", "framebuffer", "length", "FramebufferManager_default", "PointCloudEyeDomeLighting_default", "PointCloudEyeDomeLighting", "FramebufferManager_default", "destroyFramebuffer", "processor", "distanceAndEdlStrengthScratch", "Cartesian2_default", "createCommands", "context", "blendFS", "ShaderSource_default", "PointCloudEyeDomeLighting_default", "blendUniformMap", "blendRenderState", "RenderState_default", "BlendingState_default", "StencilConstants_default", "Pass_default", "ClearCommand_default", "Color_default", "createResources", "width", "height", "isSupported", "getECShaderProgram", "shaderProgram", "shader", "defined_default", "attributeLocations", "fs", "source", "frameState", "commandStart", "pointCloudShading", "boundingVolume", "i", "commandList", "commandEnd", "command", "PrimitiveType_default", "derivedCommand", "originalShaderProgram", "derivedCommandObject", "DrawCommand_default", "clearCommand", "blendCommand", "destroyObject_default", "PointCloudShading", "options", "pointCloudShading", "defaultValue_default", "scene", "PointCloudEyeDomeLighting_default", "PointCloudShading_default", "SceneTransforms", "actualPositionScratch", "Cartesian4_default", "positionCC", "scratchViewport", "BoundingRectangle_default", "scratchWindowCoord0", "Cartesian2_default", "scratchWindowCoord1", "scene", "position", "result", "Cartesian3_default", "scratchCartesian4", "scratchEyeOffset", "worldToClip", "eyeOffset", "camera", "viewMatrix", "positionEC", "Matrix4_default", "zEyeOffset", "scratchMaxCartographic", "Cartographic_default", "Math_default", "scratchProjectedCartesian", "scratchCameraPosition", "frameState", "actualPosition", "defined_default", "canvas", "viewport", "cameraCentered", "SceneMode_default", "projection", "maxCartographic", "maxCoord", "cameraPosition", "frustum", "viewportTransformation", "projectionMatrix", "eyePoint", "windowCoordinates", "Transforms_default", "right", "left", "OrthographicFrustum_default", "OrthographicOffCenterFrustum_default", "projectedPosition", "positionInCartographic", "mode", "cartographic", "morphTime", "positionNDC", "positionWC", "viewportTransform", "windowPosition", "xScale", "yScale", "scratchNDC", "scratchWorldCoords", "drawingBufferPosition", "depth", "uniformState", "currentFrustum", "near", "far", "log2Depth", "depthFromNear", "ndc", "worldCoords", "w", "SceneTransforms_default", "SplitDirection", "SplitDirection_default", "B3dmParser", "deprecationWarning_default", "sizeOfUint32", "arrayBuffer", "byteOffset", "byteStart", "defaultValue_default", "uint8Array", "view", "version", "RuntimeError_default", "byteLength", "featureTableJsonByteLength", "featureTableBinaryByteLength", "batchTableJsonByteLength", "batchTableBinaryByteLength", "batchLength", "featureTableJson", "getJsonFromTypedArray_default", "featureTableBinary", "batchTableJson", "batchTableBinary", "gltfByteLength", "gltfView", "B3dmParser_default", "Cesium3DTileFeatureTable", "featureTableJson", "featureTableBinary", "getTypedArrayFromBinary", "featureTable", "semantic", "componentType", "componentLength", "count", "byteOffset", "cachedTypedArrays", "typedArray", "defined_default", "ComponentDatatype_default", "getTypedArrayFromArray", "array", "jsonValue", "defaultValue_default", "featureId", "result", "i", "Cesium3DTileFeatureTable_default", "parseBatchTable", "options", "featureCount", "batchTable", "binaryBody", "parseAsPropertyAttributes", "defaultValue_default", "customAttributeOutput", "partitionResults", "partitionProperties", "jsonMetadataTable", "defined_default", "JsonMetadataTable_default", "hierarchy", "BatchTableHierarchy_default", "className", "MetadataClass_default", "binaryProperties", "metadataTable", "propertyAttributes", "transcodedSchema", "attributeResults", "transcodeBinaryPropertiesAsPropertyAttributes", "PropertyAttribute_default", "binaryResults", "transcodeBinaryProperties", "featureTableJson", "MetadataTable_default", "propertyTables", "propertyTable", "PropertyTable_default", "metadataOptions", "StructuralMetadata_default", "legacyHierarchy", "extras", "extensions", "hierarchyExtension", "jsonProperties", "propertyId", "property", "classProperties", "featureTableProperties", "bufferViewsTypedArrays", "bufferViewCount", "RuntimeError_default", "binaryAccessor", "getBinaryAccessor_default", "transcodePropertyType", "schemaJson", "MetadataSchema_default", "propertyAttributeProperties", "nextPlaceholderId", "sanitizedPropertyId", "ModelUtility_default", "classProperty", "customAttributeName", "attributeTypedArray", "attribute", "ModelComponents_default", "ComponentDatatype_default", "componentType", "transcodeComponentType", "deprecationWarning_default", "parseBatchTable_default", "B3dmLoaderState", "FeatureIdAttribute", "ModelComponents_default", "B3dmLoader", "options", "defaultValue_default", "b3dmResource", "baseResource", "arrayBuffer", "byteOffset", "releaseGltfJson", "asynchronous", "incrementallyLoadTextures", "upAxis", "Axis_default", "forwardAxis", "loadAttributesAsTypedArray", "loadAttributesFor2D", "loadIndicesForWireframe", "loadPrimitiveOutline", "loadForClassification", "defined_default", "Matrix4_default", "ResourceLoader_default", "b3dm", "B3dmParser_default", "batchLength", "featureTableJson", "featureTableBinary", "batchTableJson", "batchTableBinary", "featureTable", "Cesium3DTileFeatureTable_default", "rtcCenter", "ComponentDatatype_default", "Cartesian3_default", "gltfLoader", "GltfLoader_default", "that", "components", "createStructuralMetadata", "error", "handleError", "b3dmLoader", "errorMessage", "frameState", "loader", "batchTable", "structuralMetadata", "parseBatchTable_default", "emptyPropertyTable", "PropertyTable_default", "MetadataClass_default", "StructuralMetadata_default", "nodes", "length", "i", "processNode", "node", "childrenLength", "primitivesLength", "primitive", "featureIdVertexAttribute", "ModelUtility_default", "VertexAttributeSemantic_default", "featureIdAttribute", "B3dmLoader_default", "GeoJsonLoader", "options", "defaultValue_default", "loader", "frameState", "defined_default", "ResourceLoader_default", "promise", "resolve", "parse", "ParsedFeature", "ParseResult", "parsePosition", "position", "x", "y", "z", "Cartesian3_default", "parseLineString", "coordinates", "positionsLength", "line", "i", "parseMultiLineString", "linesLength", "lines", "parsePolygon", "parseMultiPolygon", "polygonsLength", "parsePoint", "parseMultiPoint", "pointsLength", "points", "geometryTypes", "primitiveTypes", "PrimitiveType_default", "parseFeature", "feature", "result", "geometryType", "geometryFunction", "primitiveType", "parsedFeature", "parseFeatureCollection", "featureCollection", "features", "featuresLength", "geoJsonObjectTypes", "scratchCartesian", "createLinesPrimitive", "toLocal", "vertexCount", "indexCount", "featureCount", "j", "positionsTypedArray", "featureIdsTypedArray", "indicesTypedArray", "IndexDatatype_default", "indexDatatype", "localMin", "localMax", "vertexCounter", "segmentCounter", "k", "cartographic", "globalCartesian", "Ellipsoid_default", "localCartesian", "Matrix4_default", "positionBuffer", "Buffer_default", "BufferUsage_default", "featureIdBuffer", "indexBuffer", "positionAttribute", "ModelComponents_default", "VertexAttributeSemantic_default", "ComponentDatatype_default", "AttributeType_default", "featureIdAttribute", "attributes", "material", "indices", "featureId", "featureIds", "primitive", "createPointsPrimitive", "geoJson", "parseFunction", "RuntimeError_default", "properties", "featureProperties", "propertyId", "value", "jsonMetadataTable", "JsonMetadataTable_default", "propertyTables", "PropertyTable_default", "schema", "MetadataSchema_default", "structuralMetadata", "StructuralMetadata_default", "cartographicMin", "cartographicMax", "hasLines", "hasPoints", "point", "cartographicCenter", "ecefCenter", "toGlobal", "Transforms_default", "primitives", "node", "nodes", "scene", "components", "GeoJsonLoader_default", "I3dmParser", "deprecationWarning_default", "sizeOfUint32", "arrayBuffer", "byteOffset", "byteStart", "defaultValue_default", "uint8Array", "view", "version", "RuntimeError_default", "byteLength", "featureTableJsonByteLength", "featureTableBinaryByteLength", "batchTableJsonByteLength", "batchTableBinaryByteLength", "gltfFormat", "featureTableJson", "getJsonFromTypedArray_default", "featureTableBinary", "batchTableJson", "batchTableBinary", "gltfByteLength", "gltfView", "I3dmParser_default", "I3dmLoaderState", "Attribute", "ModelComponents_default", "FeatureIdAttribute", "Instances", "I3dmLoader", "options", "defaultValue_default", "i3dmResource", "arrayBuffer", "baseResource", "byteOffset", "releaseGltfJson", "asynchronous", "incrementallyLoadTextures", "upAxis", "Axis_default", "forwardAxis", "loadAttributesAsTypedArray", "loadIndicesForWireframe", "loadPrimitiveOutline", "defined_default", "loader", "frameState", "Matrix4_default", "ResourceLoader_default", "i3dm", "I3dmParser_default", "featureTableJson", "featureTableBinary", "batchTableJson", "batchTableBinary", "gltfFormat", "featureTable", "Cesium3DTileFeatureTable_default", "instancesLength", "RuntimeError_default", "rtcCenter", "ComponentDatatype_default", "Cartesian3_default", "loaderOptions", "gltfUrl", "getStringFromTypedArray_default", "gltfResource", "gltfLoader", "GltfLoader_default", "that", "processPromise", "resolve", "components", "createInstances", "createStructuralMetadata", "error", "handleError", "i3dmLoader", "errorMessage", "batchTable", "structuralMetadata", "parseBatchTable_default", "emptyPropertyTable", "PropertyTable_default", "MetadataClass_default", "StructuralMetadata_default", "positionScratch", "propertyScratch1", "transformScratch", "eastNorthUp", "hasRotation", "hasScale", "translationTypedArray", "getPositions", "rotationTypedArray", "scaleTypedArray", "featureIdArray", "instancePositions", "instancePosition", "instanceNormalRight", "instanceNormalUp", "instanceNormalForward", "instanceRotation", "Matrix3_default", "instanceQuaternion", "Quaternion_default", "instanceQuaternionArray", "instanceScale", "instanceScaleArray", "instanceTransform", "positionBoundingSphere", "BoundingSphere_default", "centerTransform", "processRotation", "processScale", "batchId", "instances", "buffers", "translationAttribute", "InstanceAttributeSemantic_default", "AttributeType_default", "buffer", "Buffer_default", "BufferUsage_default", "rotationAttribute", "scaleAttribute", "featureIdAttribute", "featureIdInstanceAttribute", "nodes", "nodesLength", "makeInstancesCopy", "node", "createInstancesCopy", "instancesCopy", "attributes", "attributesLength", "i", "attributeCopy", "clone_default", "quantizedPositions", "quantizedVolumeOffset", "quantizedVolumeScale", "decodedPositions", "j", "index", "propertyScratch2", "normalUp", "normalRight", "hasCustomOrientation", "octNormalUp", "octNormalRight", "AttributeCompression_default", "Transforms_default", "Ellipsoid_default", "scale", "nonUniformScale", "unloadBuffers", "length", "I3dmLoader_default", "ModelAnimationState", "ModelAnimationState_default", "Spline", "DeveloperError_default", "point", "Cartesian3_default", "Quaternion_default", "time", "startIndex", "times", "length", "defaultValue_default", "i", "timeEnd", "timeStart", "timeStretch", "divs", "Math_default", "Spline_default", "ConstantSpline", "value", "Spline_default", "time", "result", "ValueType", "ConstantSpline_default", "LinearSpline", "options", "defaultValue_default", "points", "times", "Spline_default", "time", "result", "i", "u", "defined_default", "Cartesian3_default", "LinearSpline_default", "TridiagonalSystemSolver", "lower", "diagonal", "upper", "right", "c", "d", "x", "i", "Cartesian3_default", "scalar", "TridiagonalSystemSolver_default", "scratchLower", "scratchDiagonal", "scratchUpper", "scratchRight", "generateClamped", "points", "firstTangent", "lastTangent", "l", "u", "d", "r", "i", "right", "defined_default", "Cartesian3_default", "TridiagonalSystemSolver_default", "generateNatural", "HermiteSpline", "options", "defaultValue_default", "times", "inTangents", "outTangents", "Spline_default", "tangents", "LinearSpline_default", "PointType", "Matrix4_default", "scratchTimeVec", "Cartesian4_default", "scratchTemp", "time", "result", "timesDelta", "timeVec", "coefs", "HermiteSpline_default", "SteppedSpline", "options", "defaultValue_default", "points", "times", "Spline_default", "time", "result", "PointType", "defined_default", "SteppedSpline_default", "createEvaluateFunction", "spline", "points", "times", "time", "result", "defined_default", "Quaternion_default", "i", "u", "q0", "q1", "QuaternionSpline", "options", "defaultValue_default", "Spline_default", "QuaternionSpline_default", "AnimatedPropertyType", "ModelComponents_default", "ModelAnimationChannel", "options", "defaultValue_default", "channel", "runtimeAnimation", "runtimeNode", "initialize", "createCubicSpline", "times", "points", "cubicPoints", "inTangents", "outTangents", "length", "i", "HermiteSpline_default", "createSpline", "interpolation", "path", "ConstantSpline_default", "InterpolationType_default", "SteppedSpline_default", "QuaternionSpline_default", "LinearSpline_default", "createSplines", "count", "splines", "outputLength", "targetIndex", "output", "pointsIndex", "scratchVariable", "runtimeChannel", "sampler", "defined_default", "Cartesian3_default", "Quaternion_default", "time", "model", "morphWeights", "spline", "localAnimationTime", "ModelAnimationChannel_default", "ModelAnimation", "model", "animation", "options", "JulianDate_default", "defaultValue_default", "ModelAnimationLoop_default", "Event_default", "ModelAnimationState_default", "that", "initialize", "runtimeAnimation", "localStartTime", "localStopTime", "sceneGraph", "channels", "length", "runtimeChannels", "i", "channel", "target", "defined_default", "nodeIndex", "runtimeNode", "runtimeChannel", "ModelAnimationChannel_default", "times", "time", "ModelAnimation_default", "ModelAnimationCollection", "model", "Event_default", "addAnimation", "collection", "animation", "options", "runtimeAnimation", "ModelAnimation_default", "defaultValue_default", "animations", "index", "defined_default", "length", "i", "addedAnimations", "animationsToRemove", "createAnimationRemovedFunction", "modelAnimationCollection", "frameState", "runtimeAnimations", "JulianDate_default", "animationOccurred", "sceneTime", "startTime", "duration", "stopTime", "pastStartTime", "reachedStopTime", "delta", "seconds", "repeat", "ModelAnimationLoop_default", "play", "animationStopped", "ModelAnimationState_default", "floor", "fract", "localAnimationTime", "Math_default", "j", "animationToRemove", "ModelAnimationCollection_default", "ModelFeature", "options", "value", "defined_default", "Color_default", "name", "results", "ModelFeature_default", "StyleCommandsNeeded", "featuresLength", "translucentFeaturesLength", "StyleCommandsNeeded_default", "ModelType", "modelType", "ModelType_default", "ModelFeatureTable", "options", "model", "propertyTable", "StyleCommandsNeeded_default", "initialize", "defined_default", "modelFeatureTable", "is3DTiles", "ModelType_default", "featuresLength", "i", "features", "content", "Cesium3DTileFeature_default", "ModelFeature_default", "BatchTexture_default", "frameState", "currentStyleCommandsNeeded", "featureId", "show", "color", "result", "propertyName", "name", "semantic", "results", "value", "className", "scratchColor", "Color_default", "style", "feature", "defaultValue_default", "destroyObject_default", "ModelFeatureTable_default", "ModelFS_default", "ModelVS_default", "ClassificationModelDrawCommand", "options", "defaultValue_default", "command", "renderResources", "model", "type", "ClassificationType_default", "initialize", "getStencilDepthRenderState", "stencilFunction", "StencilOperation_default", "StencilConstants_default", "DepthFunction_default", "colorRenderState", "StencilFunction_default", "BlendingState_default", "pickRenderState", "scratchDerivedCommands", "drawCommand", "derivedCommands", "Pass_default", "createBatchCommands", "commandList", "length", "i", "allowPicking", "pass", "stencilDepthCommand", "deriveStencilDepthCommand", "colorCommand", "deriveColorCommand", "createPickCommands", "result", "runtimePrimitive", "batchLengths", "batchOffsets", "numBatches", "numDerivedCommands", "batchLength", "batchOffset", "j", "derivedCommand", "batchCommand", "DrawCommand_default", "renderState", "RenderState_default", "scratchPickCommands", "pickStencilDepthCommand", "pickColorCommand", "pickCommands", "value", "Matrix4_default", "boundingSphere", "BoundingSphere_default", "frameState", "passes", "ClassificationModelDrawCommand_default", "ModelDrawCommand", "options", "defaultValue_default", "command", "renderResources", "model", "runtimePrimitive", "isTranslucent", "Pass_default", "usesBackFaceCulling", "hasSilhouette", "needsTranslucentCommand", "needsSkipLevelOfDetailCommands", "needsSilhouetteCommands", "Matrix4_default", "BoundingSphere_default", "initialize", "ModelDerivedCommand", "derivedCommand", "drawCommand", "derivedCommands", "deriveTranslucentCommand", "deriveSkipLodBackfaceCommand", "deriveSkipLodStencilCommand", "deriveSilhouetteModelCommand", "deriveSilhouetteColorCommand", "value", "updateShadows", "updateBackFaceCulling", "updateCullFace", "updateDebugShowBoundingVolume", "updateModelMatrix2D", "frameState", "modelMatrix", "Math_default", "shadows", "castShadows", "ShadowMode_default", "receiveShadows", "length", "i", "backFaceCulling", "renderState", "clone_default", "RenderState_default", "cullFace", "debugShowBoundingVolume", "result", "use2D", "shouldUse2DCommands", "derive2DCommands", "styleCommandsNeeded", "defined_default", "StyleCommandsNeeded_default", "pushCommand", "content", "tileset", "tile", "hasMixedContent", "finalResolution", "updateSkipLodStencilCommand", "commandList", "SceneMode_default", "boundingSphere", "left", "right", "idl2D", "derive2DCommand", "derivedCommand2D", "command2D", "DrawCommand_default", "rs", "BlendingState_default", "stencilReference", "silhouetteModelCommand", "WebGLConstants_default", "silhouetteColorCommand", "uniformMap", "stencilDerivedComand", "stencilCommand", "selectionDepth", "lastSelectionDepth", "getLastSelectionDepth", "skipLodStencilReference", "getStencilReference", "StencilConstants_default", "backfaceCommand", "CullFace_default", "polygonOffset", "Cartesian2_default", "StencilFunction_default", "StencilOperation_default", "ModelDrawCommand_default", "buildDrawCommand", "primitiveRenderResources", "frameState", "shaderBuilder", "ModelVS_default", "ModelFS_default", "indexBuffer", "getIndexBuffer", "vertexArray", "VertexArray_default", "model", "shaderProgram", "pass", "sceneGraph", "modelMatrix", "Matrix4_default", "boundingSphere", "SceneMode_default", "BoundingSphere_default", "renderState", "clone_default", "RenderState_default", "ModelUtility_default", "hasClassification", "defined_default", "castShadows", "ShadowMode_default", "receiveShadows", "pickId", "command", "DrawCommand_default", "ClassificationModelDrawCommand_default", "ModelDrawCommand_default", "wireframeIndexBuffer", "indices", "buildDrawCommand_default", "ShaderDestination", "destination", "ShaderDestination_default", "TilesetPipelineStage", "renderResources", "model", "frameState", "ShaderDestination_default", "uniformMap", "Cartesian2_default", "combine_default", "renderStateOptions", "StencilConstants_default", "TilesetPipelineStage_default", "ImageBasedLightingStageFS_default", "ImageBasedLightingPipelineStage", "renderResources", "model", "frameState", "imageBasedLighting", "shaderBuilder", "ShaderDestination_default", "OctahedralProjectedCubeMap_default", "defined_default", "ImageBasedLightingStageFS_default", "uniformMap", "combine_default", "ImageBasedLightingPipelineStage_default", "articulationEpsilon", "Math_default", "ModelArticulationStage", "options", "defaultValue_default", "stage", "runtimeArticulation", "value", "scratchArticulationCartesian", "Cartesian3_default", "scratchArticulationRotation", "Matrix3_default", "result", "type", "cartesian", "rotation", "ArticulationStageType_default", "Matrix4_default", "ModelArticulationStage_default", "ModelArticulation", "options", "defaultValue_default", "articulation", "sceneGraph", "initialize", "runtimeArticulation", "stages", "length", "runtimeStages", "runtimeStagesByName", "i", "stage", "runtimeStage", "ModelArticulationStage_default", "stageName", "value", "defined_default", "scratchArticulationMatrix", "Matrix4_default", "scratchNodeMatrix", "articulationMatrix", "stagesLength", "nodes", "nodesLength", "node", "transform", "ModelArticulation_default", "ModelColorStageFS_default", "ModelColorPipelineStage", "renderResources", "model", "frameState", "shaderBuilder", "ShaderDestination_default", "ModelColorStageFS_default", "stageUniforms", "color", "Pass_default", "ColorBlendMode_default", "combine_default", "ModelColorPipelineStage_default", "ModelClippingPlanesStageFS_default", "ModelClippingPlanesPipelineStage", "textureResolutionScratch", "Cartesian2_default", "renderResources", "model", "frameState", "clippingPlanes", "context", "shaderBuilder", "ShaderDestination_default", "ClippingPlaneCollection_default", "textureResolution", "ModelClippingPlanesStageFS_default", "uniformMap", "style", "Color_default", "combine_default", "ModelClippingPlanesPipelineStage_default", "ModelNode", "model", "runtimeNode", "value", "defined_default", "ModelNode_default", "InstancingStageCommon_default", "InstancingStageVS_default", "LegacyInstancingStageVS_default", "modelViewScratch", "Matrix4_default", "nodeTransformScratch", "modelView2DScratch", "InstancingPipelineStage", "getInstanceTransformsAsMatrices", "transformsToTypedArray", "renderResources", "node", "frameState", "instances", "count", "shaderBuilder", "InstancingStageCommon_default", "model", "sceneGraph", "runtimeNode", "use2D", "SceneMode_default", "instancingVertexAttributes", "processTransformAttributes", "processFeatureIdAttributes", "uniformMap", "ShaderDestination_default", "modifiedModelMatrix", "Transforms_default", "LegacyInstancingStageVS_default", "InstancingStageVS_default", "context", "modelMatrix2D", "combine_default", "projectedTransformScratch", "projectedPositionScratch", "Cartesian3_default", "projectTransformTo2D", "transform", "modelMatrix", "nodeTransform", "result", "projectedTransform", "projectPositionTo2D", "position", "translationMatrix", "finalPosition", "SceneTransforms_default", "getModelMatrixAndNodeTransform", "nodeComputedTransform", "modelMatrixScratch", "nodeComputedTransformScratch", "transformScratch", "positionScratch", "projectTransformsTo2D", "transforms", "referencePoint", "i", "finalTranslation", "projectTranslationsTo2D", "translations", "translation", "projectedPosition", "scratchProjectedMin", "scratchProjectedMax", "computeReferencePoint2D", "transformedPositionMin", "projectedMin", "transformedPositionMax", "projectedMax", "transformsTypedArray", "offset", "translationsToTypedArray", "transationsTypedArray", "translationScratch", "rotationScratch", "Quaternion_default", "scaleScratch", "translationAttribute", "ModelUtility_default", "InstanceAttributeSemantic_default", "rotationAttribute", "scaleAttribute", "instancingTranslationMax", "instancingTranslationMin", "hasTranslation", "defined_default", "hasRotation", "hasScale", "translationTypedArray", "rotationTypedArray", "AttributeCompression_default", "scaleTypedArray", "rotation", "scale", "getInstanceTranslationsAsCartesian3s", "instancingTranslations", "createVertexBuffer", "typedArray", "buffer", "Buffer_default", "BufferUsage_default", "processTransformMatrixAttributes", "processTransformVec3Attributes", "attributeString", "processMatrixAttributes", "frameStateCV", "clone_default", "buffer2D", "projectedTransforms", "projectedTypedArray", "processVec3Attribute", "projectedTranslations", "componentByteSize", "ComponentDatatype_default", "strideInBytes", "matrixAttributes", "byteOffset", "byteStride", "attributes", "attribute", "AttributeType_default", "InstancingPipelineStage_default", "ModelMatrixUpdateStage", "runtimeNode", "sceneGraph", "frameState", "use2D", "SceneMode_default", "modelMatrix", "updateRuntimeNode", "transformToRoot", "i", "Matrix4_default", "primitivesLength", "drawCommand", "ModelUtility_default", "childrenLength", "childRuntimeNode", "ModelMatrixUpdateStage_default", "NodeStatisticsPipelineStage", "countInstancingAttributes", "countGeneratedBuffers", "renderResources", "node", "frameState", "statistics", "instances", "runtimeNode", "defined_default", "attributes", "length", "i", "attribute", "NodeStatisticsPipelineStage_default", "ModelRuntimeNode", "options", "defaultValue_default", "node", "transform", "transformToRoot", "sceneGraph", "children", "Matrix4_default", "initialize", "value", "defined_default", "transformParameters", "currentTranslation", "Cartesian3_default", "updateTransformFromParameters", "currentRotation", "Quaternion_default", "currentScale", "valueLength", "i", "runtimeNode", "computedTransform", "TranslationRotationScale_default", "articulationName", "runtimeArticulation", "index", "pipelineStages", "updateStages", "InstancingPipelineStage_default", "NodeStatisticsPipelineStage_default", "ModelMatrixUpdateStage_default", "runtimeSkin", "computedJointMatrices", "skinJointMatrices", "length", "nodeWorldTransform", "inverseNodeWorldTransform", "ModelRuntimeNode_default", "AlphaPipelineStage", "renderResources", "primitive", "frameState", "alphaOptions", "model", "defaultValue_default", "renderStateOptions", "Pass_default", "BlendingState_default", "shaderBuilder", "uniformMap", "defined_default", "ShaderDestination_default", "AlphaPipelineStage_default", "BatchTexturePipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "batchTextureUniforms", "model", "featureTable", "featuresLength", "batchTexture", "defaultValue_default", "combine_default", "BatchTexturePipelineStage_default", "ClassificationPipelineStage", "renderResources", "primitive", "frameState", "ShaderDestination_default", "runtimePrimitive", "defined_default", "createClassificationBatches", "positionAttribute", "ModelUtility_default", "VertexAttributeSemantic_default", "RuntimeError_default", "indicesArray", "indices", "hasIndices", "count", "featureIdAttribute", "featureIds", "batchLengths", "batchOffsets", "firstIndex", "currentBatchId", "currentOffset", "i", "index", "batchId", "batchLength", "newOffset", "finalBatchLength", "ClassificationPipelineStage_default", "CPUStylingStageVS_default", "CPUStylingStageFS_default", "CPUStylingPipelineStage", "renderResources", "primitive", "frameState", "model", "shaderBuilder", "CPUStylingStageVS_default", "CPUStylingStageFS_default", "ShaderDestination_default", "defined_default", "ModelColorPipelineStage_default", "ColorBlendMode_default", "Pass_default", "CPUStylingPipelineStage_default", "CustomShaderMode", "customShaderMode", "CustomShaderMode_default", "CustomShaderStageVS_default", "CustomShaderStageFS_default", "FeatureIdStageFS_default", "FeatureIdStageVS_default", "FeatureIdPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "declareStructsAndFunctions", "instances", "defined_default", "processInstanceFeatureIds", "processPrimitiveFeatureIds", "FeatureIdStageVS_default", "FeatureIdStageFS_default", "ShaderDestination_default", "featureIdsArray", "count", "i", "featureIds", "variableName", "ModelComponents_default", "processInstanceAttribute", "processImplicitRange", "label", "addAlias", "ModelUtility_default", "VertexAttributeSemantic_default", "aliasDestination", "processAttribute", "processTexture", "featureIdAttribute", "setIndex", "prefix", "attributeName", "varyingName", "vertexLine", "fragmentLine", "initializationLines", "implicitFeatureIds", "instanceDivisor", "generateImplicitFeatureIdAttribute", "implicitAttributeName", "implicitVaryingName", "featureIdTexture", "index", "uniformName", "uniformMap", "textureReader", "defaultValue_default", "channels", "texCoord", "textureRead", "initializationLine", "alias", "shaderDestination", "updateVS", "model", "vertexBuffer", "value", "typedArray", "generateImplicitFeatureIdTypedArray", "Buffer_default", "BufferUsage_default", "hasCpuCopy", "generatedFeatureIdAttribute", "ComponentDatatype_default", "offset", "repeat", "FeatureIdPipelineStage_default", "MetadataStageFS_default", "MetadataStageVS_default", "MetadataPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "model", "structuralMetadata", "content", "statistics", "propertyAttributesInfo", "getPropertyAttributesInfo", "propertyTexturesInfo", "getPropertyTexturesInfo", "allPropertyInfos", "declareMetadataTypeStructs", "declareStructsAndFunctions", "MetadataStageVS_default", "MetadataStageFS_default", "i", "info", "processPropertyAttributeProperty", "processPropertyTextureProperty", "propertyAttributes", "defined_default", "propertyAttribute", "getPropertyAttributeInfo", "getAttributeByName", "getAttributeInfo", "sanitizeGlslIdentifier", "ModelUtility_default", "classId", "classStatistics", "propertiesArray", "infoArray", "propertyId", "property", "modelAttribute", "glslType", "variableName", "ShaderDestination_default", "propertyTextures", "propertyTexture", "getPropertyTextureInfo", "id", "propertyInfos", "classTypes", "statisticsTypes", "type", "propertyStatistics", "MetadataType_default", "classFields", "metadataType", "classStructName", "declareTypeStruct", "statisticsFields", "statisticsStructName", "structName", "fields", "shaderName", "shaderType", "convertToFloatComponents", "floatConversions", "converted", "propertyInfo", "addPropertyAttributePropertyMetadata", "addPropertyMetadataClass", "addPropertyMetadataStatistics", "metadataVariable", "valueExpression", "addValueTransformUniforms", "initializationLine", "addPropertyTexturePropertyMetadata", "uniformMap", "texCoord", "channels", "index", "texture", "textureUniformName", "texCoordVariable", "unpackedValue", "transformedValue", "classProperty", "shaderDestination", "assignments", "getStructAssignments", "struct", "statisticsType", "fieldNames", "values", "constructAssignment", "field", "value", "options", "offsetUniformName", "scaleUniformName", "offset", "scale", "MetadataPipelineStage_default", "CustomShaderTranslucencyMode", "CustomShaderTranslucencyMode_default", "CustomShaderPipelineStage", "oneTimeWarning_default", "renderResources", "primitive", "frameState", "shaderBuilder", "customShader", "defined_default", "alphaOptions", "CustomShaderTranslucencyMode_default", "Pass_default", "generatedCode", "generateShaderLines", "addLinesToShader", "ShaderDestination_default", "shaderModeDefine", "CustomShaderMode_default", "uniforms", "uniformName", "uniform", "varyings", "varyingName", "varyingType", "combine_default", "getAttributesByName", "attributes", "names", "i", "attribute", "attributeInfo", "ModelUtility_default", "attributeTypeLUT", "attributeDefaultValueLUT", "inferAttributeDefaults", "attributeName", "trimmed", "glslType", "value", "generateVertexShaderLines", "attributesByName", "vertexLines", "categories", "partitionAttributes", "addToShader", "needsDefault", "variableName", "vertexInitialization", "attributeFields", "initializationLines", "attributeField", "attributeDefaults", "generatePositionBuiltins", "usedVariables", "generateFragmentShaderLines", "fragmentLines", "fragmentInitialization", "positionBuiltins", "builtinAttributes", "primitiveAttributes", "shaderAttributeSet", "isFragmentShader", "renamed", "missingAttributes", "shouldComputePositionWC", "addVertexLinesToShader", "structId", "field", "FeatureIdPipelineStage_default", "MetadataPipelineStage_default", "functionId", "addFragmentLinesToShader", "scratchShaderLines", "shaderLines", "CustomShaderStageVS_default", "CustomShaderStageFS_default", "CustomShaderPipelineStage_default", "DequantizationPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "model", "hasClassification", "defined_default", "ShaderDestination_default", "attributes", "i", "attribute", "quantization", "isPositionAttribute", "VertexAttributeSemantic_default", "isTexcoordAttribute", "attributeInfo", "ModelUtility_default", "updateDequantizationFunction", "addDequantizationUniforms", "uniformMap", "variableName", "normalizationRange", "offset", "stepSize", "glslType", "quantizedVolumeOffset", "quantizedVolumeStepSize", "promoteToVec4", "value", "defaultAlpha", "Cartesian4_default", "line", "generateOctDecodeLine", "generateDequantizeLine", "structField", "quantizedAttribute", "swizzle", "DequantizationPipelineStage_default", "GeometryStageFS_default", "GeometryStageVS_default", "SelectedFeatureIdStageCommon_default", "SelectedFeatureIdPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "model", "node", "selectedFeatureIds", "getSelectedFeatureIds", "shaderDestination", "updateFeatureStruct", "nullFeatureId", "uniformMap", "defined_default", "ShaderDestination_default", "SelectedFeatureIdStageCommon_default", "getFeatureIdDefine", "featureIds", "ModelComponents_default", "getShaderDestination", "variableName", "ModelUtility_default", "defaultValue_default", "SelectedFeatureIdPipelineStage_default", "GeometryPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "model", "ShaderDestination_default", "SelectedFeatureIdPipelineStage_default", "ModelType_default", "use2D", "SceneMode_default", "instanced", "defined_default", "incrementIndexFor2D", "length", "i", "attribute", "attributeLocationCount", "AttributeType_default", "isPositionAttribute", "VertexAttributeSemantic_default", "index", "processAttribute", "handleBitangents", "PrimitiveType_default", "GeometryStageVS_default", "GeometryStageFS_default", "attributeIndex", "attributeInfo", "ModelUtility_default", "modifyFor2D", "addMatrixAttributeToRenderResources", "addAttributeToRenderResources", "addAttributeDeclaration", "addVaryingDeclaration", "addSemanticDefine", "updateAttributesStruct", "updateInitializeAttributesFunction", "updateSetDynamicVaryingsFunction", "semantic", "setIndex", "quantization", "type", "componentDatatype", "componentsPerAttribute", "vertexAttribute", "buffer2D", "positionAttribute2D", "ComponentDatatype_default", "columnCount", "normalized", "componentsPerColumn", "componentSizeInBytes", "columnLengthInBytes", "strideInBytes", "offsetInBytes", "columnAttribute", "variableName", "varyingName", "glslType", "attributeName", "isPosition", "vsStructId", "fsStructId", "functionId", "line", "lines", "attributes", "hasNormals", "hasTangents", "GeometryPipelineStage_default", "LightingStageFS_default", "LightingModel", "LightingModel_default", "LightingPipelineStage", "renderResources", "primitive", "model", "lightingOptions", "shaderBuilder", "defined_default", "ShaderDestination_default", "uniformMap", "LightingModel_default", "LightingStageFS_default", "LightingPipelineStage_default", "MaterialStageFS_default", "Material", "ModelComponents_default", "MetallicRoughness", "SpecularGlossiness", "MaterialPipelineStage", "processTexture", "processTextureTransform", "renderResources", "primitive", "frameState", "material", "model", "hasClassification", "defined_default", "disableTextures", "uniformMap", "shaderBuilder", "defaultTexture", "defaultNormalTexture", "defaultEmissiveTexture", "processMaterialUniforms", "processSpecularGlossinessUniforms", "processMetallicRoughnessUniforms", "hasNormals", "ModelUtility_default", "VertexAttributeSemantic_default", "lightingOptions", "LightingModel_default", "cull", "alphaOptions", "AlphaMode_default", "Pass_default", "MaterialStageFS_default", "ShaderDestination_default", "textureReader", "uniformName", "defineName", "transformDefine", "transformUniformName", "defaultValue_default", "textureDefine", "texCoordVarying", "texCoordDefine", "textureTransform", "Matrix3_default", "emissiveTexture", "emissiveFactor", "Cartesian3_default", "normalTexture", "occlusionTexture", "specularGlossiness", "diffuseTexture", "diffuseFactor", "Cartesian4_default", "specularGlossinessTexture", "specularFactor", "glossinessFactor", "metallicRoughness", "baseColorTexture", "baseColorFactor", "metallicRoughnessTexture", "metallicFactor", "roughnessFactor", "MaterialPipelineStage_default", "MorphTargetsStageVS_default", "MorphTargetsPipelineStage", "renderResources", "primitive", "shaderBuilder", "ShaderDestination_default", "addGetMorphedAttributeFunctionDeclarations", "morphTargetsLength", "i", "attributes", "attributesLength", "j", "attribute", "semantic", "VertexAttributeSemantic_default", "processMorphTargetAttribute", "addGetMorphedAttributeFunctionReturns", "weightsLength", "MorphTargetsStageVS_default", "uniformMap", "combine_default", "scratchAttributeInfo", "attributeIndex", "morphTargetIndex", "addMorphTargetAttributeToRenderResources", "attributeInfo", "getMorphTargetAttributeInfo", "addMorphTargetAttributeDeclarationAndFunctionLine", "vertexAttribute", "defined_default", "AttributeType_default", "result", "attributeString", "attributeName", "line", "positionLine", "normalLine", "tangentLine", "MorphTargetsPipelineStage_default", "PickingPipelineStage", "renderResources", "primitive", "frameState", "context", "runtimeNode", "shaderBuilder", "model", "instances", "processPickTexture", "defined_default", "processInstancedPickIds", "pickObject", "buildPickObject", "pickId", "ShaderDestination_default", "uniformMap", "instanceId", "detailPickObject", "ModelType_default", "content", "featureTableId", "featureIdAttribute", "featureIdLabel", "instanceFeatureIdLabel", "ModelUtility_default", "featureTable", "batchTexture", "defaultValue_default", "instanceCount", "pickIds", "pickIdsTypedArray", "pipelineResources", "i", "pickColor", "Color_default", "pickIdsBuffer", "Buffer_default", "BufferUsage_default", "hasCpuCopy", "pickIdsVertexAttribute", "ComponentDatatype_default", "PickingPipelineStage_default", "Cesium3DTileRefine", "Cesium3DTileRefine_default", "PointCloudStylingStageVS_default", "scratchUniform", "Cartesian4_default", "PointCloudStylingPipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "model", "style", "structuralMetadata", "propertyAttributes", "defined_default", "hasFeatureTable", "hasBatchTable", "variableSubstitutionMap", "getVariableSubstitutionMap", "shaderFunctionInfo", "getStyleShaderFunctionInfo", "addShaderFunctionsAndDefines", "usesNormalSemantic", "getPropertyNames", "hasNormals", "ModelUtility_default", "VertexAttributeSemantic_default", "RuntimeError_default", "ShaderDestination_default", "Pass_default", "pointCloudShading", "content", "is3DTiles", "usesAddRefinement", "ModelType_default", "Cesium3DTileRefine_default", "PointCloudStylingStageVS_default", "uniformMap", "vec4", "defaultPointSize", "defaultValue_default", "geometricError", "getGeometricError", "context", "frustum", "depthMultiplier", "SceneMode_default", "OrthographicFrustum_default", "scratchDimensions", "Cartesian3_default", "positionAttribute", "pointsLength", "nodeTransform", "dimensions", "Matrix4_default", "volume", "Math_default", "scratchShaderFunctionInfo", "builtinVariableSubstitutionMap", "clone_default", "i", "properties", "propertyId", "parameterList", "info", "shaderState", "colorStyleFunction", "showStyleFunction", "pointSizeStyleFunction", "getBuiltinPropertyNames", "source", "propertyNames", "regex", "matches", "name", "builtinPropertyNames", "PointCloudStylingPipelineStage_default", "PrimitiveOutlineStageVS_default", "PrimitiveOutlineStageFS_default", "PrimitiveOutlinePipelineStage", "renderResources", "primitive", "frameState", "shaderBuilder", "uniformMap", "ShaderDestination_default", "outlineCoordinates", "vertexAttribute", "AttributeType_default", "outlineTexture", "PrimitiveOutlineGenerator_default", "model", "PrimitiveOutlineStageVS_default", "PrimitiveOutlineStageFS_default", "PrimitiveOutlinePipelineStage_default", "PrimitiveStatisticsPipelineStage", "countGeometry", "count2DPositions", "countMorphTargetAttributes", "countMaterialTextures", "countFeatureIdTextures", "countBinaryMetadata", "renderResources", "primitive", "frameState", "model", "statistics", "indicesCount", "defined_default", "ModelUtility_default", "primitiveType", "PrimitiveType_default", "countTriangles", "attributes", "length", "i", "attribute", "hasCpuCopy", "outlineCoordinates", "indices", "runtimePrimitive", "buffer2D", "morphTargets", "morphTargetsLength", "attributesLength", "j", "material", "textureReaders", "getAllTextureReaders", "textureReader", "metallicRoughness", "specularGlossiness", "featureIdSets", "featureIds", "ModelComponents_default", "structuralMetadata", "countPropertyTextures", "featureTables", "featureTable", "propertyTextures", "texturesLength", "properties", "propertyId", "PrimitiveStatisticsPipelineStage_default", "scratchModelMatrix", "Matrix4_default", "scratchModelView2D", "SceneMode2DPipelineStage", "renderResources", "primitive", "frameState", "positionAttribute", "ModelUtility_default", "VertexAttributeSemantic_default", "shaderBuilder", "model", "modelMatrix", "nodeComputedTransform", "computedModelMatrix", "boundingSphere2D", "computeBoundingSphere2D", "runtimePrimitive", "instances", "defined_default", "buffer2D", "createPositionBufferFor2D", "ShaderDestination_default", "modelMatrix2D", "context", "uniformMap", "combine_default", "scratchProjectedMin", "Cartesian3_default", "scratchProjectedMax", "transformedPositionMin", "projectedMin", "SceneTransforms_default", "transformedPositionMax", "projectedMax", "BoundingSphere_default", "scratchPosition", "dequantizePositionsTypedArray", "typedArray", "quantization", "length", "dequantizedArray", "quantizedVolumeOffset", "quantizedVolumeStepSize", "i", "initialPosition", "scaledPosition", "dequantizedPosition", "createPositionsTypedArrayFor2D", "attribute", "referencePoint", "result", "startIndex", "stride", "transformedPosition", "projectedPosition", "relativePosition", "frameStateCV", "clone_default", "SceneMode_default", "projectedPositions", "buffer", "Buffer_default", "BufferUsage_default", "SceneMode2DPipelineStage_default", "SkinningStageVS_default", "SkinningPipelineStage", "renderResources", "primitive", "shaderBuilder", "ShaderDestination_default", "addGetSkinningMatrixFunction", "runtimeNode", "jointMatrices", "SkinningStageVS_default", "uniformMap", "combine_default", "getMaximumAttributeSetIndex", "setIndex", "attributes", "length", "i", "attribute", "VertexAttributeSemantic_default", "initialLine", "componentIndex", "componentStrings", "maximumSetIndex", "component", "line", "returnLine", "SkinningPipelineStage_default", "WireframeIndexGenerator", "createWireframeFromTriangles", "vertexCount", "wireframeIndices", "IndexDatatype_default", "length", "index", "i", "createWireframeFromTriangleIndices", "originalIndices", "originalIndicesCount", "point0", "point1", "point2", "createWireframeFromTriangleStrip", "numberOfTriangles", "wireframeIndicesCount", "createWireframeFromTriangleStripIndices", "createWireframeFromTriangleFan", "createWireframeFromTriangleFanIndices", "firstPoint", "primitiveType", "hasOriginalIndices", "defined_default", "PrimitiveType_default", "originalCount", "WireframeIndexGenerator_default", "WireframePipelineStage", "renderResources", "primitive", "frameState", "ShaderDestination_default", "model", "wireframeIndexBuffer", "createWireframeIndexBuffer", "hasCpuCopy", "originalPrimitiveType", "originalCount", "PrimitiveType_default", "WireframeIndexGenerator_default", "indices", "vertexCount", "ModelUtility_default", "VertexAttributeSemantic_default", "webgl2", "originalIndices", "defined_default", "indicesBuffer", "indicesCount", "IndexDatatype_default", "primitiveType", "wireframeIndices", "indexDatatype", "Buffer_default", "BufferUsage_default", "WireframePipelineStage_default", "ModelRuntimePrimitive", "options", "defaultValue_default", "primitive", "node", "model", "frameState", "pipelineStages", "customShader", "style", "useWebgl2", "use2D", "SceneMode_default", "hasMorphTargets", "defined_default", "hasSkinning", "hasCustomShader", "materialsEnabled", "CustomShaderMode_default", "hasQuantization", "ModelUtility_default", "generateWireframeIndices", "PrimitiveType_default", "pointCloudShading", "hasAttenuation", "hasPointCloudBackFaceCulling", "hasPointCloudStyle", "hasOutlines", "featureIdFlags", "inspectFeatureIds", "hasClassification", "SceneMode2DPipelineStage_default", "GeometryPipelineStage_default", "WireframePipelineStage_default", "ClassificationPipelineStage_default", "MorphTargetsPipelineStage_default", "SkinningPipelineStage_default", "PointCloudStylingPipelineStage_default", "DequantizationPipelineStage_default", "MaterialPipelineStage_default", "FeatureIdPipelineStage_default", "MetadataPipelineStage_default", "SelectedFeatureIdPipelineStage_default", "BatchTexturePipelineStage_default", "CPUStylingPipelineStage_default", "CustomShaderPipelineStage_default", "LightingPipelineStage_default", "PickingPipelineStage_default", "PrimitiveOutlinePipelineStage_default", "AlphaPipelineStage_default", "PrimitiveStatisticsPipelineStage_default", "featureIds", "ModelRuntimePrimitive_default", "ModelSkin", "options", "defaultValue_default", "skin", "initialize", "runtimeSkin", "inverseBindMatrices", "joints", "length", "runtimeNodes", "runtimeJoints", "runtimeJointMatrices", "i", "jointIndex", "runtimeNode", "inverseBindMatrix", "jointMatrix", "computeJointMatrix", "Matrix4_default", "joint", "result", "jointWorldTransform", "jointMatrices", "ModelSkin_default", "ModelAlphaOptions", "ModelAlphaOptions_default", "ShaderStruct", "name", "type", "identifier", "field", "fields", "ShaderStruct_default", "ShaderFunction", "signature", "lines", "body", "length", "ShaderFunction_default", "ShaderBuilder", "identifier", "value", "destination", "defaultValue_default", "ShaderDestination_default", "line", "defined_default", "structId", "structName", "ShaderStruct_default", "type", "functionName", "signature", "ShaderFunction_default", "lines", "location", "getAttributeLocationCount", "vertexLines", "fragmentLines", "context", "positionAttribute", "structLines", "generateStructLines", "functionLines", "generateFunctionLines", "vertexShaderSource", "ShaderSource_default", "fragmentShaderSource", "ShaderProgram_default", "clone_default", "shaderBuilder", "structIds", "struct", "glslType", "functionIds", "functionId", "func", "ShaderBuilder_default", "ModelRenderResources", "model", "ShaderBuilder_default", "ModelAlphaOptions_default", "RenderState_default", "DepthFunction_default", "ModelRenderResources_default", "ModelSilhouetteStageFS_default", "ModelSilhouetteStageVS_default", "ModelSilhouettePipelineStage", "renderResources", "model", "frameState", "defined_default", "shaderBuilder", "ShaderDestination_default", "ModelSilhouetteStageVS_default", "ModelSilhouetteStageFS_default", "uniformMap", "combine_default", "ModelSilhouettePipelineStage_default", "ModelSplitterStageFS_default", "ModelSplitterPipelineStage", "renderResources", "model", "frameState", "shaderBuilder", "ShaderDestination_default", "ModelSplitterStageFS_default", "stageUniforms", "combine_default", "ModelSplitterPipelineStage_default", "NodeRenderResources", "modelRenderResources", "runtimeNode", "clone_default", "NodeRenderResources_default", "ModelLightingOptions", "options", "defaultValue_default", "LightingModel_default", "ModelLightingOptions_default", "PrimitiveRenderResources", "nodeRenderResources", "runtimePrimitive", "clone_default", "primitive", "defined_default", "ModelUtility_default", "positionMinMax", "Cartesian3_default", "BoundingSphere_default", "ModelLightingOptions_default", "PrimitiveRenderResources_default", "ModelSceneGraph", "options", "defaultValue_default", "components", "Matrix4_default", "ModelUtility_default", "initialize", "sceneGraph", "scene", "modelMatrix", "computeModelMatrix", "articulations", "articulationsLength", "runtimeArticulations", "i", "articulation", "runtimeArticulation", "ModelArticulation_default", "name", "nodes", "nodesLength", "rootNodesLength", "transformToRoot", "rootNode", "rootNodeIndex", "traverseAndCreateSceneGraph", "skins", "runtimeSkins", "skinsLength", "skin", "ModelSkin_default", "skinnedNodes", "skinnedNodesLength", "skinnedNodeIndex", "skinnedNode", "skinIndex", "model", "scratchComputedTranslation", "Cartesian3_default", "computeModelMatrix2D", "frameState", "computedModelMatrix", "translation", "Transforms_default", "center", "to2D", "BoundingSphere_default", "node", "childrenIndices", "transform", "childrenLength", "childNode", "childNodeTransformToRoot", "childIndex", "runtimeNode", "ModelRuntimeNode_default", "primitivesLength", "ModelRuntimePrimitive_default", "index", "defined_default", "publicNode", "ModelNode_default", "scratchModelPositionMin", "scratchModelPositionMax", "scratchPrimitivePositionMin", "scratchPrimitivePositionMax", "modelRenderResources", "ModelRenderResources_default", "modelPipelineStages", "j", "k", "modelPositionMin", "modelPositionMax", "nodePipelineStages", "nodeRenderResources", "NodeRenderResources_default", "nodeTransform", "runtimePrimitive", "primitivePipelineStages", "primitiveRenderResources", "PrimitiveRenderResources_default", "primitivePositionMin", "primitivePositionMax", "drawCommand", "buildDrawCommand_default", "ModelColorPipelineStage_default", "ImageBasedLightingPipelineStage_default", "ModelClippingPlanesPipelineStage_default", "ModelSilhouettePipelineStage_default", "SplitDirection_default", "ModelSplitterPipelineStage_default", "ModelType_default", "TilesetPipelineStage_default", "updateForAnimations", "disableAnimations", "SceneMode_default", "rootNodes", "length", "nodeIndex", "traverseSceneGraph", "visibleNodesOnly", "callback", "callbackOptions", "childRuntimeNode", "runtimePrimitives", "runtimePrimitivesLength", "forEachRuntimePrimitive", "scratchBackFaceCullingOptions", "backFaceCulling", "backFaceCullingOptions", "updatePrimitiveBackFaceCulling", "scratchShadowOptions", "shadowMode", "shadowOptions", "updatePrimitiveShadows", "scratchShowBoundingVolumeOptions", "debugShowBoundingVolume", "showBoundingVolumeOptions", "updatePrimitiveShowBoundingVolume", "scratchSilhouetteCommands", "scratchPushDrawCommandOptions", "silhouetteCommands", "pushDrawCommandOptions", "pushPrimitiveDrawCommands", "hasSilhouette", "passes", "primitiveDrawCommand", "articulationStageKey", "value", "names", "articulationName", "stageName", "ModelSceneGraph_default", "ModelStatistics", "AssociativeArray_default", "length", "values", "memory", "buffer", "hasCpuCopy", "copies", "texture", "batchTexture", "ModelStatistics_default", "import_mersenne_twister", "PntsParser", "sizeOfUint32", "arrayBuffer", "byteOffset", "defaultValue_default", "uint8Array", "view", "version", "RuntimeError_default", "featureTableJsonByteLength", "featureTableBinaryByteLength", "batchTableJsonByteLength", "batchTableBinaryByteLength", "featureTableJson", "getJsonFromTypedArray_default", "featureTableBinary", "batchTableJson", "batchTableBinary", "featureTable", "Cesium3DTileFeatureTable_default", "pointsLength", "defined_default", "rtcCenter", "ComponentDatatype_default", "Cartesian3_default", "parsedContent", "parseDracoProperties", "positions", "parsePositions", "normals", "parseNormals", "colors", "parseColors", "batchIds", "parseBatchIds", "batchLength", "dracoBuffer", "dracoFeatureTableProperties", "dracoBatchTableProperties", "featureTableDraco", "batchTableDraco", "hasPositions", "hasColors", "hasNormals", "hasBatchIds", "isTranslucent", "dracoByteOffset", "dracoByteLength", "draco", "combine_default", "VertexAttributeSemantic_default", "AttributeType_default", "quantizedVolumeScale", "quantizedRange", "quantizedVolumeOffset", "constantRGBA", "alpha", "constantColor", "Color_default", "quantizationBits", "PntsParser_default", "Components", "ModelComponents_default", "Scene", "Node", "Primitive", "Attribute", "Quantization", "FeatureIdAttribute", "Material", "MetallicRoughness", "PntsLoader", "options", "defaultValue_default", "arrayBuffer", "byteOffset", "frameState", "ResourceLoaderState_default", "Matrix4_default", "defined_default", "ResourceLoader_default", "PntsParser_default", "loader", "resolve", "reject", "decodePromise", "decodeDraco", "context", "draco", "DracoLoader_default", "decodeDracoResult", "processDracoAttributes", "makeComponents", "error", "errorMessage", "result", "parsedContent", "attribute", "VertexAttributeSemantic_default", "ComponentDatatype_default", "AttributeType_default", "quantization", "range", "quantizedVolumeScale", "Cartesian3_default", "quantizedVolumeOffset", "quantizedRange", "octEncodedRange", "batchIds", "batchTableJson", "batchTableProperties", "name", "property", "data", "transcodeAttributeType", "transcodeComponentType", "componentsPerAttribute", "value", "WebGLConstants_default", "makeAttribute", "attributeInfo", "typedArray", "normalizationRange", "quantizedVolumeDimensions", "AttributeCompression_default", "packedColor", "Color_default", "buffer", "Buffer_default", "BufferUsage_default", "loadAttributesFor2D", "randomNumberGenerator", "randomValues", "getRandomValues", "samplesLength", "MersenneTwister", "i", "scratchMin", "scratchMax", "scratchPosition", "computeApproximateExtrema", "positions", "positionsArray", "maximumSamplesLength", "pointsLength", "maxValue", "minValue", "min", "max", "index", "position", "defaultColorAttribute", "makeAttributes", "attributes", "makeStructuralMetadata", "customAttributeOutput", "batchLength", "batchTableBinary", "parseAsPropertyAttributes", "count", "parseBatchTable_default", "StructuralMetadata_default", "metallicRoughness", "material", "colors", "AlphaMode_default", "isUnlit", "primitive", "PrimitiveType_default", "featureIdAttribute", "node", "scene", "Axis_default", "components", "addPropertyAttributesToPrimitive", "customAttributes", "length", "customAttribute", "buffers", "PntsLoader_default", "Model", "options", "defaultValue_default", "ModelType_default", "Matrix4_default", "defined_default", "Matrix3_default", "ModelAnimationCollection_default", "Color_default", "ColorBlendMode_default", "silhouetteColor", "Pass_default", "featureIdLabel", "instanceFeatureIdLabel", "BoundingSphere_default", "HeightReference_default", "scene", "pointCloudShading", "PointCloudShading_default", "clippingPlanes", "ClippingPlaneCollection_default", "Cartesian3_default", "ImageBasedLighting_default", "ShadowMode_default", "oneTimeWarning_default", "credit", "Credit_default", "SplitDirection_default", "ModelStatistics_default", "model", "frameState", "initialize", "createModelFeatureTables", "structuralMetadata", "featureTables", "propertyTables", "length", "i", "propertyTable", "modelFeatureTable", "ModelFeatureTable_default", "selectFeatureTableId", "components", "j", "featureIdAttribute", "node", "ModelUtility_default", "primitive", "featureIds", "isColorAlphaDirty", "currentColor", "previousColor", "currentAlpha", "previousAlpha", "loader", "resource", "loaderPromise", "RuntimeError_default", "sceneGraph", "ModelSceneGraph_default", "resourceCredits", "texturesLoadedPromise", "promise", "resolve", "reject", "value", "DistanceDisplayCondition_default", "alphaDirty", "currentSize", "sizeDirty", "modelMatrix", "updateBoundingSphere", "name", "articulationStageKey", "scratchIBLReferenceFrameMatrix4", "scratchIBLReferenceFrameMatrix3", "scratchClippingPlanesMatrix", "processLoader", "updateCustomShader", "updateImageBasedLighting", "SceneMode_default", "updateFeatureTableId", "updateStyle", "updateFeatureTables", "updatePointCloudShading", "updateSilhouette", "updateSkipLevelOfDetail", "updateClippingPlanes", "updateSceneMode", "buildDrawCommands", "updateModelMatrix", "updateClamping", "updateBoundingSphereAndScale", "updateReferenceMatrices", "updatePickIds", "updateSceneGraph", "updateShowCreditsOnScreen", "submitDrawCommands", "styleCommandsNeededDirty", "updateStyleCommandsNeeded", "featureTable", "StyleCommandsNeeded_default", "supportsSilhouettes", "skipLevelOfDetail", "currentClippingPlanesState", "scratchPosition", "scratchCartographic", "Cartographic_default", "globe", "ellipsoid", "cartoPosition", "surface", "getUpdateHeightCallback", "height", "callback", "updateComputedScale", "scale", "context", "maxPixelSize", "SceneTransforms_default", "radius", "metersPerPixel", "scaleInPixels", "pixelsPerMeter", "id", "pickIds", "referenceMatrix", "ibl", "iblReferenceFrameMatrix3", "iblReferenceFrameMatrix4", "clippingPlanesMatrix", "updateForAnimations", "showOnScreen", "resourceCreditsLength", "gltfCredits", "gltfCreditsLength", "displayConditionPassed", "passesDistanceDisplayCondition", "invisible", "silhouette", "showModel", "passes", "submitCommandsForPass", "addCreditsToCreditDisplay", "scratchBoundingSphere", "positionWC", "clampedPosition", "clampedCart", "clampedModelMatrix", "scratchDisplayConditionCartesian", "condition", "nearSquared", "farSquared", "distanceSquared", "distance", "position", "creditDisplay", "color", "supportsSkipLevelOfDetail", "tileset", "clippingPlaneCollection", "destroyObject_default", "resources", "gltf", "loaderOptions", "basePath", "baseResource", "Resource_default", "GltfLoader_default", "type", "modelOptions", "makeModelOptions", "B3dmLoader_default", "PntsLoader_default", "I3dmLoader_default", "GeoJsonLoader_default", "style", "hasColorStyle", "hasShowStyle", "isPnts", "hasFeatureTable", "propertyAttributes", "hasPropertyAttributes", "modelType", "Model_default", "Model3DTileContent", "tileset", "tile", "resource", "model", "featureTables", "featureTableId", "defined_default", "statistics", "value", "featureId", "name", "enabled", "color", "Color_default", "style", "frameState", "tilesetClippingPlanes", "destroyObject_default", "gltf", "content", "modelOptions", "makeModelOptions", "classificationType", "Model_default", "ModelAnimationLoop_default", "arrayBuffer", "byteOffset", "geoJson", "additionalOptions", "mainOptions", "Pass_default", "combine_default", "Model3DTileContent_default", "Tileset3DTileContent", "tileset", "tile", "resource", "json", "initialize", "value", "content", "batchId", "name", "enabled", "color", "style", "frameState", "destroyObject_default", "Tileset3DTileContent_default", "VertexArrayFacade", "context", "attributes", "sizeInVertices", "instanced", "attrs", "defaultValue_default", "precreatedAttributes", "attributesByUsage", "attributesForUsage", "usage", "length", "i", "attribute", "defined_default", "compare", "left", "right", "ComponentDatatype_default", "vertexSizeInBytes", "bufferUsage", "buffer", "attr", "BufferUsage_default", "uniqueIndices", "j", "index", "sizeInBytes", "maxComponentSizeInBytes", "remainder", "padding", "views", "offsetInBytes", "componentDatatype", "allBuffers", "len", "destroyVA", "size", "arrayBuffer", "destView", "sourceView", "sourceLength", "view", "createWriters", "vertexSizeInComponentType", "component0", "component1", "component2", "component3", "writers", "arrayViews", "arrayView", "indexBuffer", "recreateVA", "commit", "va", "chunkSize", "Math_default", "numberOfVertexArrays", "k", "offset", "VertexArray_default", "vertexArrayFacade", "vertexBuffer", "vertexBufferSizeInBytes", "vertexBufferDefined", "Buffer_default", "vertexBufferOffset", "offsetInVertices", "lengthInVertices", "subCommit", "byteOffset", "byteLength", "destroyObject_default", "VertexArrayFacade_default", "BillboardCollectionFS_default", "BillboardCollectionVS_default", "Billboard", "options", "billboardCollection", "defaultValue_default", "translucencyByDistance", "pixelOffsetScaleByDistance", "scaleByDistance", "distanceDisplayCondition", "defined_default", "NearFarScalar_default", "DistanceDisplayCondition_default", "Cartesian3_default", "Cartesian2_default", "HeightReference_default", "VerticalOrigin_default", "HorizontalOrigin_default", "Color_default", "image", "imageId", "createGuid_default", "SceneMode_default", "SHOW_INDEX", "POSITION_INDEX", "PIXEL_OFFSET_INDEX", "EYE_OFFSET_INDEX", "HORIZONTAL_ORIGIN_INDEX", "VERTICAL_ORIGIN_INDEX", "SCALE_INDEX", "IMAGE_INDEX_INDEX", "COLOR_INDEX", "ROTATION_INDEX", "ALIGNED_AXIS_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION", "DISABLE_DEPTH_DISTANCE", "SDF_INDEX", "makeDirty", "billboard", "propertyChanged", "value", "position", "heightReference", "pixelOffset", "eyeOffset", "color", "alignedAxis", "Resource_default", "outlineColor", "context", "scratchCartographic", "Cartographic_default", "scratchPosition", "collection", "owner", "scene", "globe", "ellipsoid", "surface", "mode", "modeChanged", "updateFunction", "clampedPosition", "clampedCart", "height", "atlas", "imageSubRegion", "imageIndexPromise", "that", "completeImageLoad", "index", "BoundingRectangle_default", "textureCoordinates", "error", "id", "subRegion", "translate", "tempCartesian3", "Cartesian4_default", "frameState", "modelMatrix", "Matrix4_default", "SceneTransforms_default", "scratchCartesian3", "result", "positionWorld", "positionWC", "scratchPixelOffset", "projection", "cart", "screenSpacePosition", "width", "scale", "x", "y", "other", "Billboard_default", "BlendOption", "BlendOption_default", "SDFSettings", "SDFSettings_default", "TextureAtlasNode", "bottomLeft", "topRight", "childNode1", "childNode2", "imageIndex", "defaultValue_default", "Cartesian2_default", "defaultInitialSize", "TextureAtlas", "options", "borderWidthInPixels", "initialSize", "PixelFormat_default", "createGuid_default", "defined_default", "Texture_default", "resizeAtlas", "textureAtlas", "image", "context", "numImages", "scalingFactor", "oldAtlasWidth", "oldAtlasHeight", "atlasWidth", "atlasHeight", "widthRatio", "heightRatio", "nodeBottomRight", "nodeBottomHalf", "nodeTopHalf", "nodeMain", "i", "texCoord", "newTexture", "framebuffer", "Framebuffer_default", "initialWidth", "initialHeight", "findNode", "node", "nodeWidth", "nodeHeight", "widthDifference", "heightDifference", "childNode2BottomLeftX", "childNode2BottomLeftY", "addImage", "index", "x", "y", "w", "h", "BoundingRectangle_default", "getIndex", "atlas", "id", "indexPromise", "Resource_default", "that", "subRegion", "RuntimeError_default", "baseRegion", "destroyObject_default", "TextureAtlas_default", "SHOW_INDEX", "Billboard_default", "POSITION_INDEX", "PIXEL_OFFSET_INDEX", "EYE_OFFSET_INDEX", "HORIZONTAL_ORIGIN_INDEX", "VERTICAL_ORIGIN_INDEX", "SCALE_INDEX", "IMAGE_INDEX_INDEX", "COLOR_INDEX", "ROTATION_INDEX", "ALIGNED_AXIS_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION_INDEX", "DISABLE_DEPTH_DISTANCE", "TEXTURE_COORDINATE_BOUNDS", "SDF_INDEX", "NUMBER_OF_PROPERTIES", "attributeLocations", "attributeLocationsBatched", "attributeLocationsInstanced", "BillboardCollection", "options", "defaultValue_default", "BoundingSphere_default", "Matrix4_default", "BlendOption_default", "SceneMode_default", "BufferUsage_default", "Color_default", "that", "scene", "defined_default", "billboards", "length", "i", "removeBillboards", "value", "destroyBillboards", "billboard", "billboardCollection", "newBillboards", "j", "propertyChanged", "index", "getIndexBuffer", "getIndexBufferBatched", "context", "indexBuffer", "indices", "Buffer_default", "IndexDatatype_default", "getIndexBufferInstanced", "getVertexBufferInstanced", "vertexBuffer", "buffersUsage", "usageChanged", "properties", "k", "newUsage", "createVAF", "numberOfBillboards", "instanced", "batchTable", "sdf", "attributes", "ComponentDatatype_default", "sizeInVertices", "VertexArrayFacade_default", "writePositionScratch", "EncodedCartesian3_default", "writePositionScaleAndRotation", "frameState", "textureAtlasCoordinates", "vafWriters", "positionHighWriter", "positionLowWriter", "position", "scale", "rotation", "high", "low", "scratchCartesian2", "Cartesian2_default", "UPPER_BOUND", "LEFT_SHIFT16", "LEFT_SHIFT12", "LEFT_SHIFT8", "LEFT_SHIFT7", "LEFT_SHIFT5", "LEFT_SHIFT3", "LEFT_SHIFT2", "RIGHT_SHIFT8", "LOWER_LEFT", "LOWER_RIGHT", "UPPER_RIGHT", "UPPER_LEFT", "writeCompressedAttrib0", "writer", "pixelOffset", "pixelOffsetX", "pixelOffsetY", "translate", "translateX", "translateY", "horizontalOrigin", "verticalOrigin", "show", "VerticalOrigin_default", "HorizontalOrigin_default", "bottomLeftX", "bottomLeftY", "width", "height", "imageRectangle", "topRightX", "topRightY", "compressed0", "Math_default", "compressed1", "compressed2", "tempTanslateY", "upperTranslateY", "lowerTranslateY", "compressedTexCoordsLL", "AttributeCompression_default", "compressedTexCoordsLR", "compressedTexCoordsUR", "compressedTexCoordsUL", "writeCompressedAttrib1", "alignedAxis", "Cartesian3_default", "near", "nearValue", "far", "farValue", "translucency", "textureWidth", "imageWidth", "writeCompressedAttrib2", "color", "pickColor", "sizeInMeters", "validAlignedAxis", "dimensions", "imageHeight", "labelHorizontalOrigin", "compressed3", "red", "green", "blue", "writeEyeOffset", "eyeOffset", "eyeOffsetZ", "HeightReference_default", "compressedTexCoordsRange", "writeScaleByDistance", "writePixelOffsetScaleByDistance", "pixelOffsetScale", "writeCompressedAttribute3", "distanceDisplayCondition", "disableDepthTestDistance", "clampToGround", "w", "h", "writeTextureCoordinateBoundsOrLabelTranslate", "globeTranslucent", "depthTestAgainstTerrain", "ContextLimits_default", "minX", "minY", "maxX", "maxY", "writeBatchId", "id", "writeSDF", "outlineColor", "outlineWidth", "outlineDistance", "SDFSettings_default", "writeBillboard", "recomputeActualPositions", "modelMatrix", "recomputeBoundingVolume", "boundingVolume", "positions", "actualPosition", "updateMode", "mode", "billboardsToUpdate", "updateBoundingVolume", "collection", "pixelScale", "size", "offset", "createDebugCommand", "fs", "drawCommand", "Pass_default", "scratchWriterArray", "billboardsLength", "textureAtlas", "TextureAtlas_default", "ii", "billboardsToUpdateLength", "textureAtlasGUID", "createVertexArray", "pass", "picking", "writers", "numWriters", "m", "b", "n", "bb", "o", "blendOptionChanged", "RenderState_default", "WebGLConstants_default", "useTranslucentDepthMask", "BlendingState_default", "vsSource", "fsSource", "vs", "vertDefines", "supportVSTextureReads", "BillboardCollectionVS_default", "BillboardCollectionFS_default", "ShaderSource_default", "sdfEdge", "vectorFragDefine", "ShaderProgram_default", "commandList", "colorList", "opaque", "opaqueAndTranslucent", "va", "vaLength", "uniforms", "pickId", "totalLength", "command", "DrawCommand_default", "opaqueCommand", "destroyObject_default", "BillboardCollection_default", "createBillboardPointCallback", "centerAlpha", "cssColor", "cssOutlineColor", "cssOutlineWidth", "pixelSize", "canvas", "length", "context2D", "createBillboardPointCallback_default", "Cesium3DTilePointFeature", "content", "batchId", "billboard", "label", "polyline", "setBillboardImage", "scratchCartographic", "Cartographic_default", "value", "Color_default", "defined_default", "offset", "defaultValue_default", "ellipsoid", "cart", "newPosition", "imageChanged", "ids", "feature", "b", "newColor", "newOutlineColor", "newOutlineWidth", "newPointSize", "currentColor", "currentOutlineColor", "currentOutlineWidth", "currentPointSize", "centerAlpha", "cssColor", "cssOutlineColor", "textureId", "createBillboardPointCallback_default", "name", "results", "Cesium3DTileFeature_default", "className", "Cesium3DTilePointFeature_default", "measureText", "context2D", "textString", "font", "stroke", "fill", "metrics", "fontSize", "canvas", "padding", "width", "height", "baseline", "ctx", "pixelData", "length", "width4", "i", "j", "ascent", "descent", "minx", "pixelIndex", "imageSmoothingEnabledName", "writeTextToCanvas", "text", "options", "defaultValue_default", "strokeWidth", "backgroundColor", "Color_default", "doublePadding", "defined_default", "dimensions", "x", "y", "strokeColor", "fillColor", "writeTextToCanvas_default", "import_bitmap_sdf", "LabelStyle", "LabelStyle_default", "fontInfoCache", "fontInfoCacheLength", "fontInfoCacheMaxSize", "defaultBackgroundColor", "Color_default", "defaultBackgroundPadding", "Cartesian2_default", "textTypes", "rebindAllGlyphs", "label", "repositionAllGlyphs", "getCSSValue", "element", "property", "parseFont", "fontInfo", "defined_default", "div", "lineHeight", "Label", "options", "labelCollection", "defaultValue_default", "translucencyByDistance", "pixelOffsetScaleByDistance", "scaleByDistance", "distanceDisplayCondition", "NearFarScalar_default", "DistanceDisplayCondition_default", "LabelStyle_default", "VerticalOrigin_default", "HorizontalOrigin_default", "Cartesian3_default", "HeightReference_default", "value", "glyphs", "len", "billboard", "backgroundBillboard", "position", "i", "renderedValue", "reverseRtl", "fillColor", "outlineColor", "backgroundColor", "backgroundPadding", "pixelOffset", "glyph", "eyeOffset", "Billboard_default", "scene", "result", "modelMatrix", "actualPosition", "screenSpacePosition", "x", "y", "width", "height", "scale", "maxX", "maxY", "length", "glyphX", "glyphY", "glyphWidth", "glyphHeight", "SDFSettings_default", "BoundingRectangle_default", "other", "convertTextToTypes", "text", "rtlChars", "ltrChars", "bracketsChars", "parsedText", "word", "lastType", "currentType", "textLength", "textIndex", "character", "reverseWord", "spliceWord", "pointer", "reverseBrackets", "bracket", "hebrew", "arabic", "texts", "rtlDir", "splicePointer", "line", "wordIndex", "subText", "reverse", "Label_default", "import_grapheme_splitter", "Glyph", "GlyphTextureInfo", "labelCollection", "index", "dimensions", "defaultLineSpacingPercent", "whitePixelCanvasId", "whitePixelSize", "Cartesian2_default", "whitePixelBoundingRegion", "BoundingRectangle_default", "addWhitePixelCanvas", "textureAtlas", "canvas", "context2D", "writeTextToCanvasParameters", "createGlyphCanvas", "character", "font", "fillColor", "outlineColor", "outlineWidth", "style", "verticalOrigin", "SDFSettings_default", "VerticalOrigin_default", "LabelStyle_default", "Color_default", "writeTextToCanvas_default", "unbindGlyph", "glyph", "billboard", "defined_default", "addGlyphToTextureAtlas", "id", "glyphTextureInfo", "splitter", "GraphemeSplitter", "rebindAllGlyphs", "label", "text", "graphemes", "textLength", "glyphs", "glyphsLength", "glyphIndex", "textIndex", "showBackground", "backgroundBillboard", "backgroundBillboardCollection", "HorizontalOrigin_default", "glyphTextureCache", "glyphFont", "sdfValues", "bitmapSDF", "ctx", "canvasWidth", "canvasHeight", "imgData", "i", "j", "baseIndex", "alpha", "imageIndex", "spareBillboards", "calculateWidthOffset", "lineWidth", "horizontalOrigin", "backgroundPadding", "glyphPixelOffset", "scratchBackgroundPadding", "repositionAllGlyphs", "lastLineWidth", "maxLineWidth", "lineWidths", "maxGlyphDescent", "maxGlyphY", "numberOfLines", "glyphLength", "maxLineHeight", "scale", "lineIndex", "widthOffset", "lineSpacing", "otherLinesHeight", "totalLineWidth", "totalLineHeight", "firstCharOfLine", "lineOffsetY", "nextGlyph", "HeightReference_default", "destroyLabel", "len", "destroyObject_default", "LabelCollection", "options", "defaultValue_default", "BillboardCollection_default", "Matrix4_default", "BlendOption_default", "Label_default", "labels", "frameState", "billboardCollection", "context", "TextureAtlas_default", "preUpdateGlyphCount", "glyphCountDifference", "blendOption", "LabelCollection_default", "PolylineVS_default", "PolylinePipeline", "p0", "p1", "minDistance", "distance", "Cartesian3_default", "granularity", "radiansDistanceSquared", "cartoScratch", "Cartographic_default", "positions", "ellipsoid", "length", "heights", "i", "p", "wrapLongitudeInversMatrix", "Matrix4_default", "wrapLongitudeOrigin", "wrapLongitudeXZNormal", "wrapLongitudeXZPlane", "Plane_default", "wrapLongitudeYZNormal", "wrapLongitudeYZPlane", "wrapLongitudeIntersection", "wrapLongitudeOffset", "subdivideHeightsScratchArray", "subdivideHeights", "numPoints", "h0", "h1", "heightPerVertex", "h", "carto1", "carto2", "cartesian", "scaleFirst", "scaleLast", "ellipsoidGeodesic", "EllipsoidGeodesic_default", "ellipsoidRhumb", "EllipsoidRhumbLine_default", "generateCartesianArc", "array", "offset", "first", "last", "start", "end", "surfaceDistanceBetweenPoints", "index", "cart", "carto", "generateCartesianRhumbArc", "modelMatrix", "cartesians", "segments", "defined_default", "defaultValue_default", "inverseModelMatrix", "origin", "xzNormal", "xzPlane", "yzNormal", "yzPlane", "count", "prev", "cur", "intersection", "IntersectionTests_default", "options", "Ellipsoid_default", "height", "hasHeightArray", "n", "Math_default", "arrayLength", "newPositions", "lastPoint", "scratchCartographic0", "scratchCartographic1", "c0", "c1", "numberArray", "size", "PolylinePipeline_default", "Polyline", "options", "polylineCollection", "defaultValue_default", "defined_default", "Material_default", "Color_default", "positions", "arrayRemoveDuplicates_default", "Cartesian3_default", "modelMatrix", "Matrix4_default", "PolylinePipeline_default", "NUMBER_OF_PROPERTIES", "BoundingSphere_default", "POSITION_INDEX", "SHOW_INDEX", "WIDTH_INDEX", "MATERIAL_INDEX", "POSITION_SIZE_INDEX", "DISTANCE_DISPLAY_CONDITION", "makeDirty", "polyline", "propertyChanged", "value", "material", "width", "DistanceDisplayCondition_default", "segmentPositionsLength", "segmentLengths", "positionsChanged", "length", "i", "context", "properties", "k", "Polyline_default", "SHOW_INDEX", "Polyline_default", "WIDTH_INDEX", "POSITION_INDEX", "MATERIAL_INDEX", "POSITION_SIZE_INDEX", "DISTANCE_DISPLAY_CONDITION", "NUMBER_OF_PROPERTIES", "attributeLocations", "PolylineCollection", "options", "defaultValue_default", "Matrix4_default", "BufferUsage_default", "Color_default", "that", "removePolylines", "p", "polyline", "defined_default", "bucket", "releaseShaders", "destroyPolylines", "index", "createBatchTable", "collection", "context", "attributes", "ComponentDatatype_default", "BatchTable_default", "scratchUpdatePolylineEncodedCartesian", "EncodedCartesian3_default", "scratchUpdatePolylineCartesian4", "Cartesian4_default", "scratchNearFarCartesian2", "Cartesian2_default", "frameState", "updateMode", "projection", "properties", "ContextLimits_default", "RuntimeError_default", "computeNewBuffersUsage", "createVertexArrays", "polylinesToUpdate", "SceneMode_default", "updateLength", "i", "length", "polylineBuckets", "ii", "x", "boundingSphere", "encodedCenter", "low", "nearFarCartesian", "distanceDisplayCondition", "k", "modelMatrix", "pass", "useDepthTest", "RenderState_default", "BlendingState_default", "colorList", "createCommandLists", "boundingSphereScratch", "BoundingSphere_default", "boundingSphereScratch2", "polylineCollection", "commands", "commandList", "commandsLength", "commandIndex", "cloneBoundingSphere", "vertexArrays", "debugShowBoundingVolume", "uniformCallback", "va", "buckets", "bucketLength", "n", "bucketLocator", "offset", "sp", "polylines", "polylineLength", "currentId", "currentMaterial", "count", "command", "uniformMap", "s", "mId", "createMaterialId", "translucent", "DrawCommand_default", "combine_default", "Pass_default", "locators", "locatorLength", "t", "locator", "boundingVolume", "destroyVertexArrays", "destroyObject_default", "usageChanged", "bufferUsage", "emptyVertexBuffer", "sortPolylinesIntoBuckets", "totalIndices", "indices", "batchTable", "useHighlightColor", "vertexBufferOffset", "vertexArrayBuckets", "totalLength", "mode", "positionArray", "texCoordExpandAndBatchIndexArray", "position3DArray", "positionIndex", "colorIndex", "texCoordExpandAndBatchIndexIndex", "positionBufferUsage", "texCoordExpandAndBatchIndexBufferUsage", "Buffer_default", "position3DBuffer", "positionSizeInBytes", "texCoordExpandAndBatchIndexSizeInBytes", "vbo", "numberOfIndicesArrays", "indicesArray", "indexBuffer", "IndexDatatype_default", "positionHighOffset", "Math_default", "positionLowOffset", "prevPositionHighOffset", "prevPositionLowOffset", "nextPositionHighOffset", "nextPositionLowOffset", "vertexTexCoordExpandAndBatchIndexBufferOffset", "bufferProperty3D", "buffer3D", "buffer2D", "bufferProperty2D", "VertexArray_default", "replacer", "key", "value", "Texture_default", "scratchUniformArray", "material", "uniforms", "Material_default", "uniform", "PolylineBucket", "definedPolylines", "definedPolylinesToUpdate", "polyIndex", "propertyChanged", "VertexArrayBucketLocator", "defines", "FeatureDetection_default", "fs", "ShaderSource_default", "PolylineFS_default", "vsSource", "PolylineVS_default", "vs", "PolylineCommon_default", "ShaderProgram_default", "intersectsIDL", "Cartesian3_default", "Plane_default", "Intersect_default", "segmentLengths", "scratchWritePosition", "scratchWritePrevPosition", "scratchWriteNextPosition", "scratchWriteVector", "scratchPickColorCartesian", "scratchWidthShowCartesian", "maxLon", "width", "show", "polylineBatchIndex", "segments", "positions", "lengths", "positionsLength", "pickColor", "segmentIndex", "position", "j", "segmentLength", "segmentStart", "segmentEnd", "startK", "endK", "direction", "colorCartesian", "widthShowCartesian", "high", "morphPositionScratch", "morphPrevPositionScratch", "morphNextPositionScratch", "morphVectorScratch", "prevPosition", "nextPosition", "scratchSegmentLengths", "vaCount", "indicesCount", "numberOfSegments", "segmentIndexCount", "scratchSegments", "scratchLengths", "pscratch", "scratchCartographic", "Cartographic_default", "ellipsoid", "newPositions", "center2D", "scratchPositionsArray", "positionBuffer", "positionsArrayLength", "startJ", "endJ", "PolylineCollection_default", "Vector3DTilePoints", "options", "BillboardCollection_default", "LabelCollection_default", "PolylineCollection_default", "points", "frameState", "initialize", "billboardSize", "labelSize", "packBuffer", "ellipsoid", "rectangle", "minimumHeight", "maximumHeight", "packedLength", "Rectangle_default", "Ellipsoid_default", "packedBuffer", "offset", "createVerticesTaskProcessor", "TaskProcessor_default", "scratchPosition", "Cartesian3_default", "createPoints", "positions", "defined_default", "transferrableObjects", "parameters", "verticesPromise", "result", "billboardCollection", "labelCollection", "polylineCollection", "batchIds", "numberOfPoints", "i", "id", "position", "b", "l", "p", "content", "features", "length", "batchId", "billboard", "label", "polyline", "Cesium3DTilePointFeature_default", "enabled", "color", "Color_default", "clearStyle", "polygons", "feature", "LabelStyle_default", "Cartesian2_default", "HorizontalOrigin_default", "VerticalOrigin_default", "scratchColor", "scratchColor2", "scratchColor3", "scratchColor4", "scratchColor5", "scratchColor6", "scratchScaleByDistance", "NearFarScalar_default", "scratchTranslucencyByDistance", "scratchDistanceDisplayCondition", "DistanceDisplayCondition_default", "style", "scaleByDistanceCart4", "translucencyByDistanceCart4", "distanceDisplayConditionCart2", "resolve", "reject", "promise", "e", "destroyObject_default", "Vector3DTilePoints_default", "Vector3DTilePolygons", "options", "defaultValue_default", "Ellipsoid_default", "Cartesian3_default", "polygons", "frameState", "initialize", "ClassificationType_default", "defined_default", "packBuffer", "packedBuffer", "Rectangle_default", "offset", "unpackBuffer", "numBVS", "bvs", "i", "OrientedBoundingBox_default", "numBatchedIndices", "bis", "j", "color", "Color_default", "indexOffset", "count", "length", "batchIds", "k", "Vector3DTileBatch_default", "createVerticesTaskProcessor", "TaskProcessor_default", "scratchColor", "createPrimitive", "positions", "counts", "indexCounts", "indices", "batchTableColors", "batchTable", "transferrableObjects", "parameters", "minimumHeights", "maximumHeights", "verticesPromise", "result", "indexDatatype", "IndexDatatype_default", "finishPrimitive", "Vector3DTilePrimitive_default", "content", "features", "enabled", "style", "batchId", "resolve", "reject", "promise", "e", "destroyObject_default", "Vector3DTilePolygons_default", "Vector3DTilePolylinesVS_default", "Vector3DTilePolylines", "options", "defaultValue_default", "Ellipsoid_default", "Color_default", "polylines", "frameState", "initialize", "packBuffer", "rectangle", "minimumHeight", "maximumHeight", "ellipsoid", "center", "packedLength", "Rectangle_default", "Cartesian3_default", "packedBuffer", "offset", "createVerticesTaskProcessor", "TaskProcessor_default", "attributeLocations", "createVertexArray", "context", "defined_default", "positions", "widths", "counts", "batchIds", "transferrableObjects", "parameters", "verticesPromise", "result", "indexDatatype", "IndexDatatype_default", "finishVertexArray", "curPositions", "prevPositions", "nextPositions", "expandAndWidth", "vertexBatchIds", "indices", "byteLength", "prevPositionBuffer", "Buffer_default", "BufferUsage_default", "curPositionBuffer", "nextPositionBuffer", "expandAndWidthBuffer", "idBuffer", "indexBuffer", "vertexAttributes", "ComponentDatatype_default", "VertexArray_default", "modifiedModelViewScratch", "Matrix4_default", "rtcScratch", "createUniformMap", "primitive", "viewMatrix", "createRenderStates", "polygonOffset", "RenderState_default", "BlendingState_default", "PolylineFS", "createShaders", "batchTable", "vsSource", "Vector3DTilePolylinesVS_default", "fsSource", "vs", "ShaderSource_default", "FeatureDetection_default", "PolylineCommon_default", "fs", "ShaderProgram_default", "queueCommands", "uniformMap", "DrawCommand_default", "Pass_default", "batchId", "offsets", "i", "j", "polylinesLength", "positionsLength", "resultCounter", "results", "count", "decodedOffset", "content", "features", "length", "Cesium3DTileFeature_default", "enabled", "color", "clearStyle", "polygons", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "style", "resolve", "reject", "promise", "passes", "e", "destroyObject_default", "Vector3DTilePolylines_default", "Vector3DTileClampedPolylinesVS_default", "Vector3DTileClampedPolylinesFS_default", "Vector3DTileClampedPolylines", "options", "defaultValue_default", "Ellipsoid_default", "Cartesian2_default", "ApproximateTerrainHeights_default", "OrientedBoundingBox_default", "Color_default", "polylines", "frameState", "initialize", "updateMinimumMaximumHeights", "rectangle", "ellipsoid", "result", "min", "max", "minimumMaximumVectorHeights", "obb", "rect", "packBuffer", "minimumHeight", "maximumHeight", "center", "packedLength", "Rectangle_default", "Cartesian3_default", "packedBuffer", "offset", "createVerticesTaskProcessor", "TaskProcessor_default", "attributeLocations", "createVertexArray", "context", "defined_default", "positions", "widths", "counts", "batchIds", "transferrableObjects", "parameters", "verticesPromise", "indexDatatype", "IndexDatatype_default", "finishVertexArray", "startEllipsoidNormals", "endEllipsoidNormals", "startPositionAndHeights", "endPositionAndHeights", "startFaceNormalAndVertexCornerIds", "endFaceNormalAndHalfWidths", "batchIdAttribute", "indices", "byteLength", "startEllipsoidNormalsBuffer", "Buffer_default", "BufferUsage_default", "endEllipsoidNormalsBuffer", "startPositionAndHeightsBuffer", "endPositionAndHeightsBuffer", "startFaceNormalAndVertexCornerIdsBuffer", "endFaceNormalAndHalfWidthsBuffer", "batchIdAttributeBuffer", "indexBuffer", "vertexAttributes", "ComponentDatatype_default", "VertexArray_default", "modifiedModelViewScratch", "Matrix4_default", "rtcScratch", "createUniformMap", "primitive", "viewMatrix", "getRenderState", "mask3DTiles", "RenderState_default", "CullFace_default", "BlendingState_default", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "createRenderStates", "createShaders", "batchTable", "vsSource", "Vector3DTileClampedPolylinesVS_default", "fsSource", "Vector3DTileClampedPolylinesFS_default", "vs", "ShaderSource_default", "FeatureDetection_default", "PolylineCommon_default", "fs", "ShaderProgram_default", "queueCommands", "command", "uniformMap", "DrawCommand_default", "Pass_default", "derivedTilesetCommand", "classificationType", "ClassificationType_default", "batchId", "Vector3DTilePolylines_default", "content", "features", "length", "i", "Cesium3DTileFeature_default", "enabled", "color", "clearStyle", "polygons", "feature", "scratchColor", "DEFAULT_COLOR_VALUE", "DEFAULT_SHOW_VALUE", "style", "resolve", "reject", "promise", "passes", "e", "destroyObject_default", "Vector3DTileClampedPolylines_default", "maxShort", "scratchBVCartographic", "Cartographic_default", "scratchEncodedPosition", "Cartesian3_default", "decodeVectorPolylinePositions", "positions", "rectangle", "minimumHeight", "maximumHeight", "ellipsoid", "positionsLength", "uBuffer", "vBuffer", "heightBuffer", "AttributeCompression_default", "decoded", "i", "u", "v", "h", "lon", "Math_default", "lat", "alt", "cartographic", "decodedPosition", "decodeVectorPolylinePositions_default", "Vector3DTileContent", "tileset", "tile", "resource", "arrayBuffer", "byteOffset", "initialize", "defined_default", "trianglesLength", "geometryByteLength", "pointsPromise", "polygonPromise", "polylinePromise", "that", "value", "createColorChangedCallback", "content", "batchId", "color", "getBatchIds", "featureTableJson", "featureTableBinary", "polygonBatchIds", "polylineBatchIds", "pointBatchIds", "i", "numberOfPolygons", "defaultValue_default", "numberOfPolylines", "numberOfPoints", "polygonBatchIdsByteOffset", "polylineBatchIdsByteOffset", "pointBatchIdsByteOffset", "atLeastOneDefined", "atLeastOneUndefined", "RuntimeError_default", "id", "sizeOfUint32", "createFloatingPolylines", "options", "Vector3DTilePolylines_default", "createClampedPolylines", "Vector3DTileClampedPolylines_default", "uint8Array", "view", "version", "byteLength", "featureTableJSONByteLength", "featureTableBinaryByteLength", "batchTableJSONByteLength", "batchTableBinaryByteLength", "indicesByteLength", "positionByteLength", "polylinePositionByteLength", "pointsPositionByteLength", "getJsonFromTypedArray_default", "batchTableJson", "batchTableBinary", "totalPrimitives", "batchTable", "Cesium3DTileBatchTable_default", "featureTable", "Cesium3DTileFeatureTable_default", "region", "rectangle", "Rectangle_default", "minHeight", "maxHeight", "modelMatrix", "center", "ComponentDatatype_default", "Cartesian3_default", "Matrix4_default", "Math_default", "Ellipsoid_default", "batchIds", "polygonCounts", "polygonIndexCounts", "numPolygonPositions", "total", "count", "numPolygonIndices", "indices", "polygonPositions", "polygonMinimumHeights", "polygonMaximumHeights", "Vector3DTilePolygons_default", "polylineCounts", "widths", "numPolylinePositions", "polylinePositions", "examineVectorLinesFunction", "decodedPositions", "decodeVectorPolylinePositions_default", "examineVectorLines", "createPolylines", "pointPositions", "Vector3DTilePoints_default", "createFeatures", "featuresLength", "features", "name", "enabled", "style", "frameState", "ready", "polylines", "destroyObject_default", "positions", "counts", "url", "callback", "countsLength", "polylineStart", "linePositions", "Vector3DTileContent_default", "Cesium3DTileContentFactory", "tileset", "tile", "resource", "arrayBuffer", "byteOffset", "Model3DTileContent_default", "Composite3DTileContent_default", "json", "Tileset3DTileContent_default", "Geometry3DTileContent_default", "Vector3DTileContent_default", "Implicit3DTileContent_default", "RuntimeError_default", "byteLength", "glb", "Cesium3DTileContentFactory_default", "Cesium3DTileContentState", "Cesium3DTileContentState_default", "Cesium3DTileContentType", "contentType", "Cesium3DTileContentType_default", "Cesium3DTileOptimizationHint", "Cesium3DTileOptimizationHint_default", "Cesium3DTilesetMostDetailedTraversal", "traversal", "ManagedArray_default", "tileset", "frameState", "ready", "root", "isVisible", "stack", "tile", "add", "Cesium3DTileRefine_default", "replace", "traverse", "canTraverse", "updateAndPushChildren", "loadTile", "touchTile", "selectDesiredTile", "hasEmptyContent", "visitTile", "hasUnloadedContent", "children", "length", "i", "child", "Intersect_default", "Cesium3DTilesetMostDetailedTraversal_default", "Cesium3DTilesetTraversal", "isVisible", "tile", "traversal", "ManagedArray_default", "emptyTraversal", "descendantTraversal", "selectionTraversal", "descendantSelectionDepth", "tileset", "frameState", "root", "updateTile", "skipLevelOfDetail", "executeSkipTraversal", "executeBaseAndSkipTraversal", "executeBaseTraversal", "requestedTiles", "length", "i", "baseScreenSpaceError", "maximumScreenSpaceError", "executeTraversal", "traverseAndSelect", "addEmptyTile", "selectTile", "Intersect_default", "tileContent", "selectDescendants", "stack", "children", "childrenLength", "child", "touchTile", "selectDesiredTile", "loadedTile", "defined_default", "visitTile", "updateMinimumMaximumPriority", "isOnScreenLongEnough", "sphere", "diameter", "camera", "deltaMagnitude", "loadTile", "hasUnloadedContent", "cameraHasNotStoppedMovingLongEnough", "updateVisibility", "anyChildrenVisible", "anyVisible", "meetsScreenSpaceErrorEarly", "parent", "Cesium3DTileRefine_default", "updateTileVisibility", "hasChildren", "replace", "useOptimization", "Cesium3DTileOptimizationHint_default", "updateTileAncestorContentLinks", "hasContent", "hasEmptyContent", "reachedSkippingThreshold", "ancestor", "sortChildrenByDistanceToCamera", "a", "b", "updateAndPushChildren", "checkRefines", "refines", "minIndex", "minimumPriority", "childRefines", "executeEmptyTraversal", "minPriorityChild", "priorityHolder", "inBaseTraversal", "canTraverse", "baseTraversal", "add", "parentRefines", "stoppedRefining", "allDescendantsLoaded", "emptyContent", "traverse", "emptyLeaf", "ancestorStack", "lastAncestor", "waitingTile", "shouldSelect", "Cesium3DTilesetTraversal_default", "Cesium3DTilePass", "passOptions", "Cesium3DTilesetTraversal_default", "Cesium3DTilesetMostDetailedTraversal_default", "pass", "Cesium3DTilePass_default", "Empty3DTileContent", "tileset", "tile", "value", "batchId", "name", "enabled", "color", "style", "frameState", "destroyObject_default", "Empty3DTileContent_default", "ContentMetadata", "options", "defaultValue_default", "content", "metadataClass", "propertyId", "MetadataEntity_default", "semantic", "results", "value", "ContentMetadata_default", "findContentMetadata", "tileset", "contentHeader", "metadataJson", "hasExtension_default", "defined_default", "classes", "defaultValue_default", "contentClass", "ContentMetadata_default", "oneTimeWarning_default", "findContentMetadata_default", "findGroupMetadata", "tileset", "contentHeader", "metadataExtension", "defined_default", "groups", "group", "hasExtension_default", "index", "id", "findGroupMetadata_default", "TileMetadata", "options", "defaultValue_default", "tile", "metadataClass", "propertyId", "MetadataEntity_default", "semantic", "results", "value", "TileMetadata_default", "findTileMetadata", "tileset", "tileHeader", "metadataJson", "hasExtension_default", "defined_default", "classes", "defaultValue_default", "tileClass", "TileMetadata_default", "oneTimeWarning_default", "findTileMetadata_default", "preprocess3DTileContent", "arrayBuffer", "uint8Array", "contentType", "getMagic_default", "Cesium3DTileContentType_default", "json", "getJsonContent", "defined_default", "RuntimeError_default", "getJsonFromTypedArray_default", "preprocess3DTileContent_default", "Multiple3DTileContent", "tileset", "tile", "tilesetResource", "contentsJson", "contentHeaders", "defined_default", "contentCount", "i", "contentResource", "serverKey", "RequestScheduler_default", "contents", "length", "value", "readyPromises", "content", "that", "contentHeader", "updatePendingRequests", "multipleContents", "deltaRequestCount", "cancelPendingRequests", "originalContentState", "statistics", "canScheduleAllRequests", "requestInnerContent", "createInnerContents", "serverKeys", "requestCountsByServer", "key", "index", "originalCancelCount", "priorityFunction", "request", "Request_default", "RequestType_default", "promise", "arrayBuffer", "error", "RequestState_default", "handleInnerContentFailed", "arrayBuffers", "createInnerContent", "preprocessed", "preprocess3DTileContent_default", "Cesium3DTileContentType_default", "RuntimeError_default", "resource", "contentFactory", "Cesium3DTileContentFactory_default", "subtree", "coordinates", "findContentMetadata_default", "groupMetadata", "findGroupMetadata_default", "Cesium3DContentGroup_default", "url", "message", "batchId", "name", "enabled", "color", "style", "frameState", "destroyObject_default", "Multiple3DTileContent_default", "import_earcut", "scaleToGeodeticHeightN", "Cartesian3_default", "scaleToGeodeticHeightP", "PolygonPipeline", "positions", "length", "area", "i0", "i1", "v0", "v1", "WindingOrder_default", "holes", "flattenedPositions", "Cartesian2_default", "earcut", "subdivisionV0Scratch", "subdivisionV1Scratch", "subdivisionV2Scratch", "subdivisionS0Scratch", "subdivisionS1Scratch", "subdivisionS2Scratch", "subdivisionMidScratch", "subdivisionT0Scratch", "subdivisionT1Scratch", "subdivisionT2Scratch", "subdivisionTexcoordMidScratch", "ellipsoid", "indices", "texcoords", "granularity", "defaultValue_default", "Math_default", "hasTexcoords", "defined_default", "triangles", "i", "subdividedPositions", "subdividedTexcoords", "q", "item", "texcoordItem", "subdividedIndices", "edges", "radius", "minDistance", "minDistanceSqrd", "i2", "v2", "t0", "t1", "t2", "s0", "s1", "s2", "g0", "g1", "g2", "max", "edge", "mid", "midTexcoord", "geometryOptions", "GeometryAttribute_default", "ComponentDatatype_default", "PrimitiveType_default", "Geometry_default", "subdivisionC0Scratch", "Cartographic_default", "subdivisionC1Scratch", "subdivisionC2Scratch", "subdivisionCartographicScratch", "rhumb0", "EllipsoidRhumbLine_default", "rhumb1", "rhumb2", "c0", "c1", "c2", "midHeight", "midCartesian3", "height", "scaleToSurface", "Ellipsoid_default", "n", "p", "PolygonPipeline_default", "cos", "sin", "sqrt", "RectangleGeometryLibrary", "computedOptions", "ellipsoid", "computeST", "row", "col", "position", "st", "radiiSquared", "nwCorner", "rectangle", "stLatitude", "cosLatitude", "nZ", "kZ", "stLongitude", "nX", "nY", "kX", "kY", "gamma", "stNwCorner", "defined_default", "rotationMatrixScratch", "Matrix2_default", "nwCartesian", "Cartesian3_default", "centerScratch", "Cartographic_default", "centerCartesian", "proj", "GeographicProjection_default", "getRotationOptions", "rotation", "granularityX", "granularityY", "center", "width", "height", "cosRotation", "granYCos", "granXCos", "sinRotation", "granYSin", "granXSin", "rotationMatrix", "latitude", "latitude0", "latitude1", "latitude2", "north", "south", "longitude", "longitude0", "longitude1", "longitude2", "east", "west", "granularity", "stRotation", "boundingRectangleScratch", "nwCornerResult", "stNwCornerResult", "northCap", "southCap", "Math_default", "dx", "dy", "Rectangle_default", "boundingRectangle", "rotationOptions", "stRotationOptions", "RectangleGeometryLibrary_default", "bottomBoundingSphere", "BoundingSphere_default", "topBoundingSphere", "positionScratch", "Cartesian3_default", "rectangleScratch", "Rectangle_default", "constructRectangle", "geometry", "computedOptions", "ellipsoid", "height", "width", "northCap", "southCap", "rowHeight", "widthMultiplier", "size", "corners", "positions", "posIndex", "row", "col", "position", "RectangleGeometryLibrary_default", "indicesSize", "indices", "IndexDatatype_default", "index", "i", "geo", "Geometry_default", "GeometryAttributes_default", "PrimitiveType_default", "GeometryAttribute_default", "ComponentDatatype_default", "constructExtrudedRectangle", "rectangleGeometry", "surfaceHeight", "extrudedHeight", "minHeight", "maxHeight", "topPositions", "PolygonPipeline_default", "length", "bottomPositions", "bottomCorner", "topRightCorner", "bottomLeftCorner", "RectangleOutlineGeometry", "options", "defaultValue_default", "rectangle", "granularity", "Math_default", "Ellipsoid_default", "rotation", "value", "array", "startingIndex", "scratchRectangle", "scratchEllipsoid", "scratchOptions", "result", "offsetAttribute", "defined_default", "nwScratch", "Cartographic_default", "boundingSphere", "extrude", "offsetValue", "GeometryOffsetAttribute_default", "topBS", "bottomBS", "applyOffset", "RectangleOutlineGeometry_default", "TileBoundingRegion", "options", "Rectangle_default", "defaultValue_default", "Cartesian3_default", "ellipsoid", "Ellipsoid_default", "computeBox", "OrientedBoundingBox_default", "BoundingSphere_default", "cartesian3Scratch", "cartesian3Scratch2", "cartesian3Scratch3", "westNormalScratch", "eastWestNormalScratch", "westernMidpointScratch", "easternMidpointScratch", "cartographicScratch", "Cartographic_default", "planeScratch", "Plane_default", "rayScratch", "Ray_default", "tileBB", "rectangle", "westernMidpointCartesian", "westNormal", "easternMidpointCartesian", "eastNormal", "westVector", "eastWestNormal", "south", "southSurfaceNormal", "southCenterCartesian", "westPlane", "IntersectionTests_default", "southNormal", "north", "northSurfaceNormal", "northCenterCartesian", "eastPlane", "northNormal", "southwestCornerScratch", "northeastCornerScratch", "negativeUnitY", "negativeUnitZ", "vectorScratch", "distanceToCameraRegion", "frameState", "camera", "cameraCartesianPosition", "cameraCartographicPosition", "result", "southwestCornerCartesian", "northeastCornerCartesian", "SceneMode_default", "vectorFromSouthwestCorner", "distanceToWestPlane", "distanceToSouthPlane", "vectorFromNortheastCorner", "distanceToEastPlane", "distanceToNorthPlane", "cameraHeight", "minimumHeight", "maximumHeight", "distanceAboveTop", "distanceBelowBottom", "regionResult", "defined_default", "obbResult", "plane", "color", "modelMatrix", "Matrix4_default", "geometry", "RectangleOutlineGeometry_default", "instance", "GeometryInstance_default", "ColorGeometryInstanceAttribute_default", "Primitive_default", "PerInstanceColorAppearance_default", "TileBoundingRegion_default", "CoplanarPolygonGeometryLibrary", "scratchIntersectionPoint", "Cartesian3_default", "scratchXAxis", "scratchYAxis", "scratchZAxis", "obbScratch", "OrientedBoundingBox_default", "positions", "halfAxes", "xAxis", "Matrix3_default", "yAxis", "zAxis", "xMag", "yMag", "zMag", "centerResult", "planeAxis1Result", "planeAxis2Result", "orientedBoundingBox", "min", "planeAxis1", "planeAxis2", "projectTo2D", "position", "center", "axis1", "axis2", "result", "v", "x", "y", "Cartesian2_default", "positionResults", "i", "CoplanarPolygonGeometryLibrary_default", "Queue", "item", "array", "offset", "compareFunction", "Queue_default", "PolygonGeometryLibrary", "polygonHierarchy", "CartesianX", "numComponents", "stack", "hierarchy", "defined_default", "positions", "holes", "length", "i", "array", "startingIndex", "positionsLength", "holesLength", "j", "distance2DScratch", "Cartesian2_default", "getPointAtDistance2D", "p0", "p1", "distance", "distanceScratch", "Cartesian3_default", "getPointAtDistance", "minDistance", "n", "countDivide", "Math_default", "scratchCartographic0", "Cartographic_default", "scratchCartographic1", "scratchCartographic2", "scratchCartesian0", "scratchRhumbLine", "EllipsoidRhumbLine_default", "ellipsoid", "c0", "c1", "t0", "t1", "result", "subdivisions", "length2D", "distanceBetweenCoords", "texcoords", "index", "t", "numVertices", "distanceBetweenVertices", "p", "rhumb", "c", "scaleToGeodeticHeightN1", "scaleToGeodeticHeightN2", "scaleToGeodeticHeightP1", "scaleToGeodeticHeightP2", "geometry", "maxHeight", "minHeight", "perPositionHeight", "defaultValue_default", "Ellipsoid_default", "n1", "n2", "p2", "scaleToEllipsoidSurface", "polygons", "queue", "Queue_default", "outerNode", "outerRing", "arrayRemoveDuplicates_default", "numChildren", "hole", "holePositions", "numGrandchildren", "keepDuplicates", "projectPointsTo2D", "positions2D", "holeIndices", "originalWindingOrder", "PolygonPipeline_default", "WindingOrder_default", "polygonHoles", "holePositions2D", "computeBoundingRectangleCartesian2", "computeBoundingRectangleCartesian3", "computeBoundingRectangleQuaternion", "Quaternion_default", "computeBoundingRectangleMatrix3", "Matrix3_default", "planeNormal", "projectPointTo2D", "angle", "rotation", "textureMatrix", "minX", "maxX", "minY", "maxY", "st", "polygon", "textureCoordinates", "granularity", "vertexFormat", "arcType", "indices", "hasTexcoords", "flattenedPositions", "geometryOptions", "GeometryAttribute_default", "ComponentDatatype_default", "PrimitiveType_default", "Geometry_default", "GeometryPipeline_default", "ArcType_default", "computeWallTexcoordsSubdivided", "computeWallIndicesSubdivided", "p1Scratch", "p2Scratch", "edgePositions", "topEdgeLength", "t2", "edgeTexcoords", "topEdgeTexcoordLength", "textureIndex", "tempPositions", "tempTexcoords", "tempPositionsLength", "tempTexcoordsLength", "k", "IndexDatatype_default", "edgeIndex", "UL", "UR", "LL", "LR", "GeometryAttributes_default", "PolygonGeometryLibrary_default", "createGeometryFromPositions", "positions", "length", "flatPositions", "indices", "IndexDatatype_default", "positionIndex", "index", "i", "position", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "Geometry_default", "PrimitiveType_default", "CoplanarPolygonOutlineGeometry", "options", "defaultValue_default", "polygonHierarchy", "PolygonGeometryLibrary_default", "Cartesian3_default", "newOptions", "value", "array", "startingIndex", "scratchOptions", "result", "packedLength", "defined_default", "polygonGeometry", "outerPositions", "arrayRemoveDuplicates_default", "CoplanarPolygonGeometryLibrary_default", "polygons", "geometries", "geometryInstance", "GeometryInstance_default", "geometry", "GeometryPipeline_default", "boundingSphere", "BoundingSphere_default", "CoplanarPolygonOutlineGeometry_default", "centerCartographicScratch", "Cartographic_default", "TileBoundingS2Cell", "options", "s2Cell", "S2Cell_default", "minimumHeight", "defaultValue_default", "maximumHeight", "ellipsoid", "Ellipsoid_default", "boundingPlanes", "computeBoundingPlanes", "vertices", "computeVertices", "computeEdgeNormals", "i", "Cartesian3_default", "center", "BoundingSphere_default", "centerGeodeticNormalScratch", "topCartographicScratch", "topScratch", "vertexCartographicScratch", "vertexScratch", "vertexGeodeticNormalScratch", "sideNormalScratch", "sideScratch", "planes", "centerPoint", "centerSurfaceNormal", "topCartographic", "top", "topPlane", "Plane_default", "maxDistance", "vertex", "vertexCartographic", "distance", "bottomPlane", "adjacentVertex", "geodeticNormal", "side", "sideNormal", "n0Scratch", "n1Scratch", "n2Scratch", "x0Scratch", "x1Scratch", "x2Scratch", "t0Scratch", "t1Scratch", "t2Scratch", "f0Scratch", "f1Scratch", "f2Scratch", "sScratch", "matrixScratch", "Matrix3_default", "computeIntersection", "p0", "p1", "p2", "determinant", "edgeScratch", "edgeNormalScratch", "plane", "edgeNormals", "facePointScratch", "frameState", "point", "selectedPlaneIndices", "sidePlaneIndex", "facePoint", "selectedPlane", "closestPointPolygon", "edge", "closestPointLineSegment", "minimumDistance", "skip", "dScratch", "pL0Scratch", "p", "l0", "l1", "d", "pL0", "t", "dMag", "edgePlaneScratch", "minDistance", "closestPoint", "closestPointOnEdge", "edgePlane", "defined_default", "plusCount", "negCount", "Intersect_default", "color", "modelMatrix", "Matrix4_default", "topPlanePolygon", "CoplanarPolygonOutlineGeometry_default", "topPlaneGeometry", "topPlaneInstance", "GeometryInstance_default", "ColorGeometryInstanceAttribute_default", "bottomPlanePolygon", "bottomPlaneGeometry", "bottomPlaneInstance", "sideInstances", "sidePlanePolygon", "sidePlaneGeometry", "Primitive_default", "PerInstanceColorAppearance_default", "TileBoundingS2Cell_default", "defaultRadii", "Cartesian3_default", "cos", "sin", "EllipsoidOutlineGeometry", "options", "defaultValue_default", "radii", "innerRadii", "minimumClock", "maximumClock", "Math_default", "minimumCone", "maximumCone", "stackPartitions", "slicePartitions", "subdivisions", "value", "array", "startingIndex", "scratchRadii", "scratchInnerRadii", "scratchOptions", "result", "offsetAttribute", "defined_default", "ellipsoidGeometry", "ellipsoid", "Ellipsoid_default", "extraIndices", "vertexMultiplier", "hasInnerSurface", "isTopOpen", "isBotOpen", "vertexCount", "positions", "numIndices", "indices", "IndexDatatype_default", "i", "j", "theta", "phi", "index", "sinPhi", "cosPhi", "sinTheta", "cosTheta", "topOffset", "offset", "outerOffset", "innerOffset", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "length", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "EllipsoidOutlineGeometry_default", "SphereOutlineGeometry", "options", "radius", "defaultValue_default", "ellipsoidOptions", "Cartesian3_default", "EllipsoidOutlineGeometry_default", "value", "array", "startingIndex", "scratchEllipsoidGeometry", "scratchOptions", "result", "ellipsoidGeometry", "defined_default", "sphereGeometry", "SphereOutlineGeometry_default", "TileBoundingSphere", "center", "radius", "Math_default", "BoundingSphere_default", "frameState", "boundingSphere", "Cartesian3_default", "plane", "color", "geometry", "SphereOutlineGeometry_default", "modelMatrix", "Matrix4_default", "instance", "GeometryInstance_default", "ColorGeometryInstanceAttribute_default", "Primitive_default", "PerInstanceColorAppearance_default", "TileBoundingSphere_default", "scratchU", "Cartesian3_default", "scratchV", "scratchW", "scratchCartesian", "computeMissingVector", "a", "b", "result", "magnitude", "Math_default", "findOrthogonalVector", "temp", "checkHalfAxes", "halfAxes", "u", "Matrix3_default", "v", "w", "uZero", "vZero", "wZero", "TileOrientedBoundingBox", "center", "OrientedBoundingBox_default", "BoundingSphere_default", "frameState", "plane", "color", "geometry", "BoxOutlineGeometry_default", "modelMatrix", "Matrix4_default", "instance", "GeometryInstance_default", "ColorGeometryInstanceAttribute_default", "Primitive_default", "PerInstanceColorAppearance_default", "TileOrientedBoundingBox_default", "Cesium3DTile", "tileset", "baseResource", "header", "parent", "hasContentsArray", "defined_default", "hasMultipleContents", "hasExtension_default", "contentHeader", "Matrix4_default", "parentTransform", "computedTransform", "parentInitialTransform", "contentBoundingVolume", "viewerRequestVolume", "refine", "Cesium3DTileRefine_default", "content", "hasEmptyContent", "contentState", "contentResource", "serverKey", "Resource_default", "Cesium3DTileContentState_default", "contentHeaderUri", "Empty3DTileContent_default", "RequestScheduler_default", "findTileMetadata_default", "expire", "expireDuration", "expireDate", "JulianDate_default", "Cesium3DTileOptimizationHint_default", "Color_default", "deprecationWarning_default", "defaultValue_default", "value", "scratchCartesian", "Cartesian3_default", "isPriorityDeferred", "tile", "frameState", "camera", "boundingSphere", "radius", "scaledCameraDirection", "closestPointOnLine", "toLine", "toLineNormalized", "scaledToLine", "closestOnSphere", "toClosestOnSphere", "toClosestOnSphereNormalize", "replace", "skipLevelOfDetail", "Cesium3DTilePass_default", "maximumFovatedFactor", "foveatedConeFactor", "range", "normalizedFoveatedFactor", "Math_default", "sseRelaxation", "sse", "scratchJulianDate", "useParentGeometricError", "progressiveResolutionHeightFraction", "heightFraction", "parentGeometricError", "geometricError", "frustum", "context", "width", "height", "error", "SceneMode_default", "OrthographicFrustum_default", "pixelSize", "distance", "sseDenominator", "density", "factor", "dynamicError", "isPriorityProgressiveResolution", "isProgressiveResolutionTile", "maximumScreenSpaceError", "tilePasses", "parentFails", "getPriorityReverseScreenSpaceError", "screenSpaceError", "parentVisibilityPlaneMask", "CullingVolume_default", "now", "updateExpireDate", "expireDurationDate", "createPriorityFunction", "requestMultipleContents", "requestSingleContent", "multipleContents", "contentsJson", "Multiple3DTileContent_default", "backloggedRequestCount", "contentReadyToProcessPromise", "multipleContentFailed", "resource", "expired", "request", "Request_default", "RequestType_default", "promise", "previousState", "arrayBuffer", "singleContentFailed", "makeContent", "RequestState_default", "preprocessed", "preprocess3DTileContent_default", "Cesium3DTileContentType_default", "contentFactory", "Cesium3DTileContentFactory_default", "subtree", "coordinates", "findContentMetadata_default", "groupMetadata", "findGroupMetadata_default", "Cesium3DContentGroup_default", "scratchProjectedBoundingSphere", "BoundingSphere_default", "getBoundingVolume", "sphere", "TileBoundingSphere_default", "getContentBoundingVolume", "cullingVolume", "boundingVolume", "clippingPlanes", "intersection", "Intersect_default", "scratchToTileCenter", "toCenter", "scratchMatrix", "Matrix3_default", "scratchScale", "scratchHalfAxes", "scratchCenter", "scratchRectangle", "Rectangle_default", "scratchOrientedBoundingBox", "OrientedBoundingBox_default", "scratchTransform", "createBox", "box", "transform", "result", "center", "halfAxes", "rotationScale", "TileOrientedBoundingBox_default", "createBoxFromTransformedRegion", "region", "initialTransform", "rectangle", "minimumHeight", "maximumHeight", "orientedBoundingBox", "Ellipsoid_default", "createRegion", "rectangleRegion", "TileBoundingRegion_default", "createSphere", "scale", "uniformScale", "boundingVolumeHeader", "RuntimeError_default", "TileBoundingS2Cell_default", "applyDebugSettings", "passOptions", "hasContentBoundingVolume", "empty", "showVolume", "color", "attributes", "ColorGeometryInstanceAttribute_default", "debugColorizeTilesOn", "debugColorizeTilesOff", "updateContent", "expiredContent", "updateClippingPlanes", "currentClippingPlanesState", "commandStart", "commandsLength", "i", "command", "translucent", "Pass_default", "scratchCommandList", "savedCommandList", "isolateDigits", "normalizedValue", "numberOfDigits", "leftShift", "scaled", "priorityNormalizeAndClamp", "minimum", "maximum", "preferLeaves", "minimumPriority", "maximumPriority", "digitsForANumber", "digitsForABoolean", "preferredSortingLeftShift", "preferredSortingDigitsCount", "foveatedLeftShift", "foveatedDigitsCount", "preloadProgressiveResolutionLeftShift", "preloadProgressiveResolutionDigitsCount", "preloadProgressiveResolutionScale", "foveatedDeferLeftShift", "foveatedDeferDigitsCount", "foveatedDeferScale", "preloadFlightLeftShift", "preloadFlightScale", "depthDigits", "normalizedPreferredSorting", "preferredSortingDigits", "preloadProgressiveResolutionDigits", "foveatedDigits", "foveatedDeferDigits", "preloadFlightDigits", "destroyObject_default", "Cesium3DTile_default", "GroupMetadata", "options", "defaultValue_default", "id", "group", "metadataClass", "properties", "defined_default", "propertyId", "MetadataEntity_default", "semantic", "results", "value", "GroupMetadata_default", "TilesetMetadata", "options", "defaultValue_default", "tileset", "metadataClass", "properties", "defined_default", "propertyId", "MetadataEntity_default", "semantic", "results", "value", "TilesetMetadata_default", "Cesium3DTilesetMetadata", "options", "defaultValue_default", "metadataJson", "schema", "metadata", "tileset", "defined_default", "TilesetMetadata_default", "groupIds", "groups", "groupsJson", "length", "i", "group", "GroupMetadata_default", "groupId", "Cesium3DTilesetMetadata_default", "Cesium3DTileOptimizations", "scratchAxis", "Cartesian3_default", "tile", "children", "length", "boundingVolume", "TileOrientedBoundingBox_default", "TileBoundingRegion_default", "orientedBoundingBox", "Cesium3DTileOptimizationHint_default", "i", "childBoundingVolume", "childOrientedBoundingBox", "axis", "axisLength", "proj1", "proj2", "Cesium3DTileOptimizations_default", "DoublyLinkedList", "DoublyLinkedListNode", "item", "previous", "next", "node", "defined_default", "remove", "list", "nextNode", "oldNodeNext", "DoublyLinkedList_default", "Cesium3DTilesetCache", "DoublyLinkedList_default", "tile", "node", "defined_default", "tileset", "unloadCallback", "trimTiles", "list", "maximumMemoryUsageInBytes", "sentinel", "Cesium3DTilesetCache_default", "Cesium3DTilesetHeatmap", "tilePropertyName", "getHeatmapValue", "tileValue", "value", "JulianDate_default", "minimum", "maximum", "getHeatmapValueAndUpdateMinimumMaximum", "heatmap", "tile", "defined_default", "heatmapValue", "heatmapColors", "Color_default", "frameState", "shiftedMax", "Math_default", "zeroToOne", "lastIndex", "colorPosition", "colorPositionFloor", "colorPositionCeil", "t", "colorZero", "colorOne", "finalColor", "referenceMinimum", "referenceMaximum", "useReference", "Cesium3DTilesetHeatmap_default", "Cesium3DTilesetStatistics", "updatePointAndFeatureCounts", "statistics", "content", "decrement", "load", "contents", "pointsLength", "trianglesLength", "featuresLength", "geometryByteLength", "texturesByteLength", "batchTableByteLength", "defined_default", "length", "i", "result", "Cesium3DTilesetStatistics_default", "Cesium3DTileStyleEngine", "value", "tileset", "defined_default", "styleDirty", "lastStyleTime", "statistics", "tiles", "length", "i", "tile", "content", "Cesium3DTileStyleEngine_default", "ImplicitTileset", "baseResource", "tileJson", "metadataSchema", "implicitTiling", "hasExtension_default", "boundingVolume", "defined_default", "RuntimeError_default", "Resource_default", "contentHeaders", "gatherContentHeaders", "i", "contentHeader", "clone_default", "contentResource", "makeTileHeaderTemplate", "ImplicitSubdivisionScheme_default", "extension", "template", "ImplicitTileset_default", "MortonOrder", "insertOneSpacing", "v", "insertTwoSpacing", "removeOneSpacing", "removeTwoSpacing", "x", "y", "mortonIndex", "result", "defined_default", "z", "MortonOrder_default", "ImplicitTileCoordinates", "options", "ImplicitSubdivisionScheme_default", "childIndex", "MortonOrder_default", "levelOffset", "mortonIndex", "ImplicitTileCoordinates", "offsetCoordinates", "descendantLevel", "descendantX", "descendantY", "ImplicitSubdivisionScheme_default", "descendantZ", "offsetLevels", "divisor", "ancestorLevel", "ancestorX", "ancestorY", "ancestorZ", "descendantCoordinates", "offsetLevel", "dimensionAtOffsetLevel", "offsetX", "offsetY", "offsetZ", "childIndex", "level", "x", "y", "z", "levelDifference", "isAncestorX", "isAncestorY", "isAncestorZ", "otherCoordinates", "values", "scratchCoordinatesArray", "subdivisionScheme", "subtreeLevels", "mortonIndex", "coordinatesArray", "MortonOrder_default", "tileIndex", "levelOffset", "Math_default", "ImplicitTileCoordinates_default", "Cesium3DTileset", "options", "defaultValue_default", "Cesium3DTilesetCache_default", "ManagedArray_default", "Cesium3DTileStyleEngine_default", "defined_default", "Matrix4_default", "Cesium3DTilesetStatistics_default", "Cesium3DTilePass_default", "i", "Cesium3DTilesetHeatmap_default", "Math_default", "Ellipsoid_default", "ShadowMode_default", "Cesium3DTileColorBlendMode_default", "PointCloudShading_default", "PointCloudEyeDomeLighting_default", "Event_default", "ImageBasedLighting_default", "Color_default", "SplitDirection_default", "oneTimeWarning_default", "featureIdLabel", "instanceFeatureIdLabel", "that", "resource", "url", "basePath", "Resource_default", "tilesetJson", "processMetadataExtension", "gltfUpAxis", "Axis_default", "modelUpAxis", "modelForwardAxis", "asset", "extras", "extraCredits", "credits", "credit", "Credit_default", "clippingPlanesOrigin", "originCartographic", "ApproximateTerrainHeights_default", "Transforms_default", "value", "ClippingPlaneCollection_default", "deprecationWarning_default", "statistics", "tilesetUrl", "parentTile", "RuntimeError_default", "tilesetVersion", "rootTile", "makeTile", "stack", "tile", "Cesium3DTileRefine_default", "children", "length", "childHeader", "childTile", "Cesium3DTileOptimizations_default", "tileset", "baseResource", "tileHeader", "hasExtension_default", "metadataSchema", "implicitTileset", "ImplicitTileset_default", "rootCoordinates", "ImplicitTileCoordinates_default", "contentUri", "tileJson", "clone_default", "Cesium3DTile_default", "metadataJson", "schemaLoader", "ResourceCache_default", "Cesium3DTilesetMetadata_default", "scratchPositionNormal", "Cartesian3_default", "scratchCartographic", "Cartographic_default", "scratchMatrix", "scratchCenter", "scratchPosition", "scratchDirection", "updateDynamicScreenSpaceError", "frameState", "up", "direction", "height", "minimumHeight", "maximumHeight", "camera", "root", "tileBoundingVolume", "TileBoundingRegion_default", "transformLocal", "ellipsoid", "boundingVolume", "centerLocal", "centerCartographic", "positionLocal", "TileOrientedBoundingBox_default", "boxHeight", "TileBoundingSphere_default", "radius", "heightFalloff", "heightClose", "heightFar", "t", "horizonFactor", "density", "requestContent", "expired", "attemptedRequests", "destroySubtree", "addToProcessingQueue", "e", "handleTileSuccess", "handleTileFailure", "sortRequestByPriority", "a", "b", "cancelOutOfViewRequests", "raiseLoadProgressEvent", "unloadTile", "processTiles", "clippingPlanes", "JulianDate_default", "requestedTilesInFlight", "removeCount", "outOfView", "Cesium3DTileContentState_default", "requestTiles", "isAsync", "requestedTiles", "error", "message", "content", "filterProcessingQueue", "tiles", "scratchCartesian", "stringOptions", "formatMemoryString", "memorySizeInBytes", "memoryInMegabytes", "computeTileLabelPosition", "halfAxes", "position", "normal", "addTileDebugLabel", "labelString", "attributes", "urls", "newLabel", "updateTileDebugLabels", "selectedTiles", "selectedLength", "emptyTiles", "emptyLength", "label", "Cartesian2_default", "updateTiles", "passOptions", "isRender", "commandList", "numberOfInitialCommands", "tileVisible", "bivariateVisibilityTest", "ClearCommand_default", "Pass_default", "RenderState_default", "StencilConstants_default", "lengthBeforeUpdate", "addedCommandsLength", "backfaceCommands", "backfaceCommandsLength", "LabelCollection_default", "scratchStack", "destroyTile", "statisticsLast", "numberOfPendingRequests", "numberOfTilesProcessing", "lastNumberOfPendingRequest", "lastNumberOfTilesProcessing", "progressChanged", "resetMinimumMaximum", "detectModelMatrixChanged", "update", "passStatistics", "SceneMode_default", "ready", "tilesetPassState", "pass", "originalCommandList", "originalCamera", "originalCullingVolume", "ignoreCommands", "commandStart", "extensionName", "destroyObject_default", "extensionsRequired", "Cesium3DTileset_default", "modelMatrixScratch", "Matrix4_default", "Cesium3DTilesetVisualizer", "scene", "entityCollection", "AssociativeArray_default", "time", "entities", "tilesetHash", "primitives", "i", "len", "entity", "tilesetGraphics", "resource", "tilesetData", "show", "Property_default", "modelMatrix", "Resource_default", "defined_default", "tileset", "Cesium3DTileset_default", "checkLoad", "removeTileset", "destroyObject_default", "result", "BoundingSphereState_default", "primitive", "BoundingSphere_default", "added", "removed", "changed", "visualizer", "error", "Cesium3DTilesetVisualizer_default", "defaultEvenColor", "Color_default", "defaultOddColor", "defaultRepeat", "Cartesian2_default", "CheckerboardMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "CheckerboardMaterialProperty_default", "entityOptionsScratch", "fireChangedEvent", "collection", "added", "removed", "changed", "addedArray", "removedArray", "changedArray", "EntityCollection", "owner", "AssociativeArray_default", "Event_default", "createGuid_default", "value", "i", "oldShows", "entities", "entitiesLength", "oldShow", "entity", "startTime", "Iso8601_default", "stopTime", "len", "availability", "defined_default", "start", "stop", "JulianDate_default", "TimeInterval_default", "Entity_default", "id", "RuntimeError_default", "array", "addedEntities", "existingItem", "existingItemId", "addedItem", "EntityCollection_default", "entityOptionsScratch", "entityIdScratch", "clean", "entity", "propertyNames", "propertyNamesLength", "subscribeToEntity", "that", "eventHash", "collectionId", "CompositeEntityCollection", "unsubscribeFromEntity", "id", "recomposite", "collections", "collectionsLength", "collectionsCopy", "collectionsCopyLength", "i", "entities", "iEntities", "collection", "composite", "newEntities", "EntityCollection_default", "compositeEntity", "defined_default", "Entity_default", "newEntitiesArray", "owner", "createGuid_default", "index", "getCollectionIndex", "swapCollections", "j", "arr", "Math_default", "temp", "added", "removed", "q", "removedLength", "removedEntity", "removedId", "addedLength", "addedEntity", "addedId", "propertyName", "newValue", "oldValue", "compositeProperty", "newProperty", "firstTime", "innerEntity", "property", "CompositeEntityCollection_default", "EventHelper", "event", "listener", "scope", "removalFunction", "that", "removalFunctions", "i", "len", "EventHelper_default", "compareIntervalStartTimes", "left", "right", "JulianDate_default", "TimeIntervalCollection", "intervals", "Event_default", "defined_default", "length", "i", "dataComparer", "rightIntervals", "TimeInterval_default", "index", "date", "julianDate", "indexOfScratch", "binarySearch_default", "options", "defaultValue_default", "start", "stop", "isStartIncluded", "isStopIncluded", "len", "interval", "comparison", "result", "other", "mergeCallback", "otherIntervals", "leftInterval", "rightInterval", "intersection", "julianDates", "dataCallback", "leadingInterval", "trailingInterval", "startIndex", "Iso8601_default", "startDate", "endDate", "scratchGregorianDate", "GregorianDate_default", "monthLengths", "addToDate", "duration", "millisecond", "second", "minute", "hour", "day", "month", "year", "isLeapYear_default", "scratchJulianDate", "durationRegex", "parseDuration", "iso8601", "matches", "seconds", "scratchDuration", "dates", "epoch", "iso8601Durations", "relativeToPrevious", "previousDate", "TimeIntervalCollection_default", "subscribeAll", "property", "eventHelper", "definitionChanged", "intervals", "callback", "items", "length", "i", "interval", "defined_default", "CompositeProperty", "EventHelper_default", "Event_default", "TimeIntervalCollection_default", "time", "result", "innerProperty", "other", "Property_default", "CompositeProperty_default", "CompositeMaterialProperty", "Event_default", "CompositeProperty_default", "time", "innerProperty", "defined_default", "result", "other", "Property_default", "CompositeMaterialProperty_default", "CompositePositionProperty", "referenceFrame", "defaultValue_default", "ReferenceFrame_default", "Event_default", "CompositeProperty_default", "value", "time", "result", "innerProperty", "defined_default", "other", "Property_default", "CompositePositionProperty_default", "CornerType", "CornerType_default", "scratch2Array", "Cartesian3_default", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "scratchCartesian5", "scratchCartesian6", "scratchCartesian7", "scratchCartesian8", "scratchCartesian9", "scratch1", "scratch2", "PolylineVolumeGeometryLibrary", "cartographic", "Cartographic_default", "scaleToSurface", "positions", "ellipsoid", "heights", "pos", "subdivideHeights", "points", "h0", "h1", "granularity", "p0", "p1", "angleBetween", "numPoints", "i", "heightPerVertex", "h", "nextScratch", "prevScratch", "computeRotationAngle", "start", "end", "position", "tangentPlane", "EllipsoidTangentPlane_default", "next", "prev", "angle", "Cartesian2_default", "negativeX", "transform", "Matrix4_default", "translation", "rotationZ", "Matrix3_default", "scaleMatrix", "westScratch", "finalPosScratch", "Cartesian4_default", "heightCartesian", "addPosition", "center", "left", "shape", "finalPositions", "height", "xScalar", "repeat", "west", "finalPosition", "Transforms_default", "scale", "j", "centerScratch", "addPositions", "centers", "convertShapeTo3DDuplicate", "shape2D", "boundingRectangle", "length", "index", "xOffset", "yOffset", "point", "x", "z", "convertShapeTo3D", "quaterion", "Quaternion_default", "startPointScratch", "rotMatrix", "computeRoundCorner", "pivot", "startPoint", "endPoint", "cornerType", "leftIsOutside", "duplicatePoints", "CornerType_default", "Math_default", "m", "surfacePoint", "shapePositions", "cleanedPositions", "i0", "i1", "v0", "v1", "forward", "backward", "scratchForwardProjection", "scratchBackwardProjection", "geometry", "shapeForSides", "shapeForEnds", "heightOffset", "width", "ends", "cornerDirection", "surfaceNormal", "previousPosition", "nextPosition", "subdividedHeights", "subdividedPositions", "oneTimeWarning_default", "forwardProjection", "backwardProjection", "scalar", "PolylinePipeline_default", "posLength", "combinedPositions", "PolylineVolumeGeometryLibrary_default", "CorridorGeometryLibrary", "scratch1", "Cartesian3_default", "scratch2", "scratch3", "scratch4", "scaleArray2", "cartesian1", "cartesian2", "cartesian3", "cartesian4", "cartesian5", "cartesian6", "cartesian7", "cartesian8", "cartesian9", "cartesian10", "quaterion", "Quaternion_default", "rotMatrix", "Matrix3_default", "computeRoundCorner", "cornerPoint", "startPoint", "endPoint", "cornerType", "leftIsOutside", "angle", "granularity", "CornerType_default", "Math_default", "size", "array", "m", "index", "i", "addEndCaps", "calculatedPositions", "leftEdge", "firstEndCap", "length", "rightEdge", "lastEndCap", "computeMiteredCorner", "position", "leftCornerDirection", "lastPoint", "addShiftedPositions", "positions", "left", "scalar", "rightPositions", "leftPositions", "scaledLeft", "scaledRight", "rightIndex", "leftIndex", "pos", "rightPos", "leftPos", "attribute", "value", "front", "back", "x", "y", "z", "defined_default", "scratchForwardProjection", "scratchBackwardProjection", "params", "ellipsoid", "width", "saveAttributes", "normal", "forward", "backward", "cornerDirection", "previousPos", "center", "calculatedLefts", "calculatedNormals", "nextPosition", "subdividedPositions", "corners", "forwardProjection", "backwardProjection", "PolylineVolumeGeometryLibrary_default", "PolylinePipeline_default", "endPositions", "CorridorGeometryLibrary_default", "cartesian1", "Cartesian3_default", "cartesian2", "cartesian3", "cartesian4", "cartesian5", "cartesian6", "scratch1", "scratch2", "scaleToSurface", "positions", "ellipsoid", "i", "addNormals", "attr", "normal", "left", "front", "back", "vertexFormat", "normals", "tangents", "bitangents", "forward", "CorridorGeometryLibrary_default", "combine", "computedPositions", "corners", "endPositions", "computedLefts", "computedNormals", "attributes", "GeometryAttributes_default", "corner", "leftCount", "rightCount", "indicesLength", "length", "leftSide", "defined_default", "addEndPositions", "endPositionLength", "size", "finalPositions", "UL", "LL", "UR", "LR", "rightPos", "leftPos", "halfLength", "indices", "IndexDatatype_default", "index", "firstEndPositions", "posIndex", "compIndex", "rightEdge", "leftEdge", "rightNormal", "leftNormal", "j", "l", "r", "pivot", "start", "outsidePoint", "previousPoint", "nextPoint", "lastEndPositions", "GeometryAttribute_default", "ComponentDatatype_default", "st", "rightSt", "leftSt", "stIndex", "theta", "a", "halfEndPos", "Math_default", "extrudedAttributes", "topNormals", "topBitangents", "threeSize", "twoSize", "sixSize", "topPosition", "bottomPosition", "previousPosition", "tangent", "bitangent", "attrIndex", "attrIndexOffset", "topTangents", "topSt", "s", "t", "addWallPositions", "wallPositions", "x", "y", "z", "computePositionsExtruded", "params", "topVertexFormat", "VertexFormat_default", "height", "extrudedHeight", "newPositions", "extrudedPositions", "PolygonPipeline_default", "extrudeNormals", "applyOffset", "GeometryOffsetAttribute_default", "applyOffsetValue", "iLength", "newIndices", "v0", "v1", "v2", "scratchCartesian1", "scratchCartesian2", "scratchCartographic", "Cartographic_default", "computeOffsetPoints", "position1", "position2", "halfWidth", "min", "max", "direction", "offsetDirection", "minLat", "minLon", "maxLat", "maxLon", "lat", "lon", "scratchCartesianOffset", "scratchCartesianEnds", "scratchCartographicMin", "scratchCartographicMax", "computeRectangle", "width", "cornerType", "result", "cleanPositions", "arrayRemoveDuplicates_default", "Rectangle_default", "CornerType_default", "first", "last", "rectangle", "CorridorGeometry", "options", "defaultValue_default", "Ellipsoid_default", "value", "array", "startingIndex", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "granularity", "shadowVolume", "offsetAttribute", "corridorGeometry", "extrude", "boundingSphere", "BoundingSphere_default", "Geometry_default", "PrimitiveType_default", "minHeightFunc", "maxHeightFunc", "minHeight", "maxHeight", "CorridorGeometry_default", "cartesian1", "Cartesian3_default", "cartesian2", "cartesian3", "scaleToSurface", "positions", "ellipsoid", "i", "combine", "computedPositions", "cornerType", "wallIndices", "corners", "endPositions", "attributes", "GeometryAttributes_default", "corner", "leftCount", "rightCount", "indicesLength", "length", "leftSide", "defined_default", "addEndPositions", "endPositionLength", "size", "finalPositions", "front", "back", "UL", "LL", "UR", "LR", "rightPos", "leftPos", "halfLength", "indices", "IndexDatatype_default", "index", "firstEndPositions", "CorridorGeometryLibrary_default", "posIndex", "rightEdge", "leftEdge", "j", "l", "r", "start", "outsidePoint", "CornerType_default", "lastEndPositions", "GeometryAttribute_default", "ComponentDatatype_default", "computePositionsExtruded", "params", "attr", "height", "extrudedHeight", "extrudedPositions", "newPositions", "PolygonPipeline_default", "applyOffset", "GeometryOffsetAttribute_default", "applyOffsetValue", "iLength", "newIndices", "v0", "v1", "CorridorOutlineGeometry", "options", "defaultValue_default", "width", "Ellipsoid_default", "Math_default", "value", "array", "startingIndex", "scratchEllipsoid", "scratchOptions", "result", "granularity", "offsetAttribute", "corridorOutlineGeometry", "cleanPositions", "arrayRemoveDuplicates_default", "extrude", "offsetValue", "boundingSphere", "BoundingSphere_default", "Geometry_default", "PrimitiveType_default", "CorridorOutlineGeometry_default", "defaultZIndex", "ConstantProperty_default", "GroundGeometryUpdater", "options", "GeometryUpdater_default", "defined_default", "entity", "geometry", "GroundPrimitive_default", "height", "extrudedHeight", "DeveloperError_default", "propertyName", "newValue", "oldValue", "oneTimeWarning_default", "defaultValue_default", "heightReferenceProperty", "extrudedHeightReferenceProperty", "centerPosition", "CallbackProperty_default", "TerrainOffsetProperty_default", "heightReference", "HeightReference_default", "extrudedHeightReference", "n", "GeometryOffsetAttribute_default", "GroundGeometryUpdater_default", "scratchColor", "Color_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "scratchRectangle", "Rectangle_default", "CorridorGeometryOptions", "entity", "CorridorGeometryUpdater", "scene", "GroundGeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "ShowGeometryInstanceAttribute_default", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "CorridorGeometry_default", "outlineColor", "CorridorOutlineGeometry_default", "result", "positions", "corridor", "GeometryUpdater_default", "heightValue", "Iso8601_default", "heightReferenceValue", "HeightReference_default", "extrudedHeightValue", "extrudedHeightReferenceValue", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "ApproximateTerrainHeights_default", "DynamicCorridorGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "CorridorGeometryUpdater_default", "DataSource", "DeveloperError_default", "time", "dataSource", "isLoading", "DataSource_default", "EllipsoidalOccluder", "ellipsoid", "cameraPosition", "Cartesian3_default", "defined_default", "cv", "vhMagnitudeSquared", "scratchCartesian", "occludee", "occludeeScaledSpacePosition", "isScaledSpacePointVisible", "scratchCameraPositionInScaledSpaceShrunk", "minimumHeight", "directionToPoint", "positions", "result", "computeHorizonCullingPointFromPositions", "scratchEllipsoidShrunk", "Ellipsoid_default", "possiblyShrunkEllipsoid", "getPossiblyShrunkEllipsoid", "vertices", "stride", "center", "computeHorizonCullingPointFromVertices", "subsampleScratch", "rectangle", "Rectangle_default", "bs", "BoundingSphere_default", "scratchEllipsoidShrunkRadii", "ellipsoidShrunkRadii", "scaledSpaceDirectionToPoint", "computeScaledSpaceDirectionToPoint", "resultMagnitude", "i", "len", "position", "candidateMagnitude", "computeMagnitude", "magnitudeToPoint", "positionScratch", "defaultValue_default", "cameraPositionInScaledSpace", "distanceToLimbInScaledSpaceSquared", "vt", "vtDotVc", "scaledSpaceScratch", "directionScratch", "scaledSpacePosition", "magnitudeSquared", "magnitude", "direction", "cosAlpha", "sinAlpha", "cosBeta", "sinBeta", "directionToPointScratch", "EllipsoidalOccluder_default", "PointPrimitive", "options", "pointPrimitiveCollection", "defaultValue_default", "translucencyByDistance", "scaleByDistance", "distanceDisplayCondition", "defined_default", "NearFarScalar_default", "DistanceDisplayCondition_default", "Cartesian3_default", "Color_default", "SHOW_INDEX", "POSITION_INDEX", "COLOR_INDEX", "OUTLINE_COLOR_INDEX", "OUTLINE_WIDTH_INDEX", "PIXEL_SIZE_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION_INDEX", "DISABLE_DEPTH_DISTANCE_INDEX", "makeDirty", "pointPrimitive", "propertyChanged", "value", "position", "color", "outlineColor", "context", "tempCartesian3", "Cartesian4_default", "frameState", "modelMatrix", "SceneMode_default", "Matrix4_default", "SceneTransforms_default", "scratchCartesian4", "scene", "result", "positionWorld", "Cartesian2_default", "windowCoordinates", "point", "screenSpacePosition", "size", "halfSize", "x", "y", "width", "height", "BoundingRectangle_default", "other", "PointPrimitive_default", "PointPrimitiveCollectionFS_default", "PointPrimitiveCollectionVS_default", "SHOW_INDEX", "PointPrimitive_default", "POSITION_INDEX", "COLOR_INDEX", "OUTLINE_COLOR_INDEX", "OUTLINE_WIDTH_INDEX", "PIXEL_SIZE_INDEX", "SCALE_BY_DISTANCE_INDEX", "TRANSLUCENCY_BY_DISTANCE_INDEX", "DISTANCE_DISPLAY_CONDITION_INDEX", "DISABLE_DEPTH_DISTANCE_INDEX", "NUMBER_OF_PROPERTIES", "attributeLocations", "PointPrimitiveCollection", "options", "defaultValue_default", "BoundingSphere_default", "Matrix4_default", "BlendOption_default", "SceneMode_default", "BufferUsage_default", "that", "removePointPrimitives", "destroyPointPrimitives", "pointPrimitives", "length", "i", "p", "pointPrimitive", "pointPrimitiveCollection", "newPointPrimitives", "j", "propertyChanged", "defined_default", "index", "buffersUsage", "usageChanged", "properties", "k", "newUsage", "createVAF", "context", "numberOfPointPrimitives", "VertexArrayFacade_default", "ComponentDatatype_default", "writePositionScratch", "EncodedCartesian3_default", "writePositionSizeAndOutline", "vafWriters", "position", "pixelSize", "outlineWidth", "positionHighWriter", "high", "positionLowWriter", "low", "LEFT_SHIFT16", "LEFT_SHIFT8", "writeCompressedAttrib0", "color", "pickColor", "outlineColor", "red", "Color_default", "green", "blue", "compressed0", "compressed1", "compressed2", "compressed3", "writer", "writeCompressedAttrib1", "near", "nearValue", "far", "farValue", "translucency", "show", "Math_default", "writeScaleByDistance", "scale", "writeDistanceDisplayConditionAndDepthDisable", "distanceDisplayCondition", "disableDepthTestDistance", "writePointPrimitive", "recomputeActualPositions", "frameState", "modelMatrix", "recomputeBoundingVolume", "boundingVolume", "positions", "actualPosition", "updateMode", "mode", "pointPrimitivesToUpdate", "updateBoundingVolume", "collection", "size", "scratchWriterArray", "ContextLimits_default", "pointPrimitivesLength", "pointPrimitivesToUpdateLength", "createVertexArray", "pass", "picking", "writers", "numWriters", "m", "b", "n", "h", "bb", "o", "blendOptionChanged", "RenderState_default", "WebGLConstants_default", "BlendingState_default", "vs", "fs", "ShaderSource_default", "PointPrimitiveCollectionVS_default", "PointPrimitiveCollectionFS_default", "ShaderProgram_default", "va", "vaLength", "command", "commandList", "colorList", "opaque", "opaqueAndTranslucent", "totalLength", "opaqueCommand", "DrawCommand_default", "PrimitiveType_default", "Pass_default", "destroyObject_default", "PointPrimitiveCollection_default", "sortKD", "ids", "coords", "nodeSize", "left", "right", "depth", "m", "select", "k", "inc", "n", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swapItem", "swap", "arr", "tmp", "range", "ids", "coords", "minX", "minY", "maxX", "maxY", "nodeSize", "stack", "result", "x", "y", "axis", "right", "left", "i", "nextAxis", "within", "ids", "coords", "qx", "qy", "r", "nodeSize", "stack", "result", "r2", "axis", "right", "left", "i", "sqDist", "m", "x", "y", "nextAxis", "ax", "ay", "bx", "by", "dx", "dy", "defaultGetX", "p", "defaultGetY", "KDBush", "points", "getX", "getY", "nodeSize", "ArrayType", "IndexArrayType", "ids", "coords", "i", "sortKD", "minX", "minY", "maxX", "maxY", "range", "x", "y", "r", "within", "EntityCluster", "options", "defaultValue_default", "Event_default", "getX", "point", "getY", "expandBoundingBox", "bbox", "pixelRange", "labelBoundingBoxScratch", "BoundingRectangle_default", "getBoundingBox", "item", "coord", "entityCluster", "result", "defined_default", "Label_default", "Billboard_default", "PointPrimitive_default", "hasLabelIndex", "labelIndex", "label", "labelBBox", "addNonClusteredItem", "addCluster", "position", "numPoints", "ids", "cluster", "entityId", "getScreenSpacePositions", "collection", "points", "scene", "occluder", "length", "i", "SceneMode_default", "canClusterLabels", "canClusterBillboards", "canClusterPoints", "pointBoundinRectangleScratch", "totalBoundingRectangleScratch", "neighborBoundingRectangleScratch", "createDeclutterCallback", "amount", "labelCollection", "billboardCollection", "pointCollection", "clusteredLabelCollection", "clusteredBillboardCollection", "clusteredPointCollection", "LabelCollection_default", "BillboardCollection_default", "PointPrimitiveCollection_default", "minimumClusterSize", "clusters", "newClusters", "previousHeight", "currentHeight", "ellipsoid", "cameraPosition", "EllipsoidalOccluder_default", "j", "neighbors", "neighborLength", "neighborIndex", "neighborPoint", "collectionIndex", "index", "KDBush", "Matrix4_default", "Cartesian3_default", "Cartesian2_default", "factor", "width", "height", "minX", "minY", "maxX", "maxY", "totalBBox", "clusterPosition", "neighborItem", "neighborBBox", "value", "createGetEntity", "collectionProperty", "CollectionConstructor", "unusedIndicesProperty", "entityIndexProperty", "entity", "entityIndices", "entityItem", "unusedIndices", "that", "removeEntityIndicesIfUnused", "indices", "billboard", "disableCollectionClustering", "updateEnable", "frameState", "commandList", "EntityCluster_default", "CustomDataSource", "name", "Event_default", "EntityCollection_default", "EntityCluster_default", "value", "DataSource_default", "time", "CustomDataSource_default", "CylinderGeometryLibrary", "length", "topRadius", "bottomRadius", "slices", "fill", "topZ", "bottomZ", "twoSlice", "size", "positions", "i", "index", "tbIndex", "bottomOffset", "topOffset", "angle", "Math_default", "x", "y", "bottomX", "bottomY", "topX", "topY", "CylinderGeometryLibrary_default", "radiusScratch", "Cartesian2_default", "normalScratch", "Cartesian3_default", "bitangentScratch", "tangentScratch", "positionScratch", "CylinderGeometry", "options", "defaultValue_default", "length", "topRadius", "bottomRadius", "vertexFormat", "VertexFormat_default", "slices", "value", "array", "startingIndex", "scratchVertexFormat", "scratchOptions", "result", "offsetAttribute", "defined_default", "cylinderGeometry", "twoSlices", "threeSlices", "numVertices", "positions", "CylinderGeometryLibrary_default", "st", "normals", "tangents", "bitangents", "i", "computeNormal", "computeTangent", "normalIndex", "tangentIndex", "bitangentIndex", "theta", "normal", "normalScale", "tangent", "bitangent", "angle", "Math_default", "x", "y", "numIndices", "indices", "IndexDatatype_default", "index", "j", "textureCoordIndex", "rad", "position", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "boundingSphere", "BoundingSphere_default", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "unitCylinderGeometry", "CylinderGeometry_default", "radiusScratch", "Cartesian2_default", "CylinderOutlineGeometry", "options", "defaultValue_default", "length", "topRadius", "bottomRadius", "slices", "numberOfVerticalLines", "value", "array", "startingIndex", "scratchOptions", "result", "offsetAttribute", "defined_default", "cylinderGeometry", "numVertices", "positions", "CylinderGeometryLibrary_default", "numIndices", "numSide", "numSideLines", "indices", "IndexDatatype_default", "index", "i", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "boundingSphere", "BoundingSphere_default", "Cartesian3_default", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "CylinderOutlineGeometry_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "positionScratch", "scratchColor", "Color_default", "CylinderGeometryOptions", "entity", "CylinderGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "isAvailable", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "attributes", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "CylinderGeometry_default", "outlineColor", "CylinderOutlineGeometry_default", "result", "cylinder", "heightReference", "Iso8601_default", "HeightReference_default", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "GeometryOffsetAttribute_default", "heightReferenceOnEntityPropertyChanged_default", "DynamicCylinderGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "position", "CylinderGeometryUpdater_default", "ClockRange", "ClockRange_default", "ClockStep", "ClockStep_default", "ExtrapolationType", "ExtrapolationType_default", "import_urijs", "getFilenameFromUri", "uri", "uriObject", "Uri", "path", "index", "getFilenameFromUri_default", "factorial", "Math_default", "calculateCoefficientTerm", "x", "zIndices", "xTable", "derivOrder", "termOrder", "reservedIndices", "result", "reserved", "i", "j", "HermitePolynomialApproximation", "degree", "inputOrder", "defaultValue_default", "yTable", "yStride", "defined_default", "d", "s", "len", "index", "length", "coefficients", "l", "zIndicesLength", "highestNonZeroCoef", "nonZeroCoefficients", "zj", "zn", "numerator", "tempTerm", "coeff", "arrayScratch", "outputOrder", "resultLength", "r", "zIndiceslength", "fillCoefficientList", "tmp", "loopStop", "dimTwo", "dimOne", "coef", "highestNonZero", "coefIndex", "coefficient", "dimTwoMinusOne", "HermitePolynomialApproximation_default", "LagrangePolynomialApproximation", "degree", "x", "xTable", "yTable", "yStride", "result", "defined_default", "i", "j", "length", "coefficient", "diffX", "LagrangePolynomialApproximation_default", "LinearApproximation", "degree", "x", "xTable", "yTable", "yStride", "result", "defined_default", "i", "y0", "y1", "x0", "x1", "LinearApproximation_default", "Spherical", "clock", "cone", "magnitude", "defaultValue_default", "cartesian3", "result", "x", "y", "z", "radialSquared", "defined_default", "spherical", "left", "right", "epsilon", "other", "Spherical_default", "import_urijs", "getTimestamp", "getTimestamp_default", "Clock", "options", "defaultValue_default", "currentTime", "startTime", "stopTime", "defined_default", "JulianDate_default", "ClockRange_default", "Event_default", "getTimestamp_default", "ClockStep_default", "value", "currentSystemTime", "clockStep", "multiplier", "milliseconds", "clockRange", "Clock_default", "DataSourceClock", "Event_default", "createRawPropertyDescriptor_default", "result", "defined_default", "other", "JulianDate_default", "source", "defaultValue_default", "Clock_default", "DataSourceClock_default", "defaultColor", "Color_default", "defaultCellAlpha", "defaultLineCount", "Cartesian2_default", "defaultLineOffset", "defaultLineThickness", "GridMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "GridMaterialProperty_default", "PolylineArrowMaterialProperty", "color", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "Color_default", "other", "PolylineArrowMaterialProperty_default", "defaultColor", "Color_default", "defaultGapColor", "defaultDashLength", "defaultDashPattern", "PolylineDashMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "PolylineDashMaterialProperty_default", "defaultColor", "Color_default", "defaultGlowPower", "defaultTaperPower", "PolylineGlowMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "PolylineGlowMaterialProperty_default", "defaultColor", "Color_default", "defaultOutlineColor", "defaultOutlineWidth", "PolylineOutlineMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "PolylineOutlineMaterialProperty_default", "PositionPropertyArray", "value", "referenceFrame", "Event_default", "EventHelper_default", "defaultValue_default", "ReferenceFrame_default", "defined_default", "length", "i", "Property_default", "time", "result", "x", "itemValue", "eventHelper", "property", "other", "PositionPropertyArray_default", "PropertyArray", "value", "Event_default", "EventHelper_default", "defined_default", "length", "i", "Property_default", "time", "result", "x", "itemValue", "eventHelper", "property", "other", "PropertyArray_default", "resolve", "that", "targetProperty", "defined_default", "targetEntity", "ReferenceProperty", "targetPropertyNames", "i", "len", "targetCollection", "targetId", "Event_default", "Property_default", "target", "referenceString", "identifier", "values", "inIdentifier", "isEscaped", "token", "time", "result", "referenceFrame", "other", "names", "otherNames", "length", "name", "value", "oldValue", "collection", "added", "removed", "ReferenceProperty_default", "Rotation", "value", "array", "startingIndex", "defaultValue_default", "result", "packedArray", "lastIndex", "defined_default", "previousValue", "i", "len", "Math_default", "sourceArray", "firstIndex", "Rotation_default", "PackableNumber", "value", "array", "startingIndex", "defaultValue_default", "result", "arrayInsert", "startIndex", "items", "arrayLength", "itemsLength", "newLength", "q", "convertDate", "date", "epoch", "JulianDate_default", "timesSpliceArgs", "valuesSpliceArgs", "mergeNewSamples", "times", "values", "newData", "packedLength", "newDataIndex", "i", "prevItem", "timesInsertionPoint", "valuesInsertionPoint", "currentTime", "nextTime", "binarySearch_default", "timesSpliceArgsCount", "valuesSpliceArgsCount", "defined_default", "SampledProperty", "type", "derivativeTypes", "innerType", "packedInterpolationLength", "inputOrder", "innerDerivativeTypes", "length", "derivativeType", "derivativePackedLength", "LinearApproximation_default", "Event_default", "ExtrapolationType_default", "time", "timesLength", "timeout", "index", "startTime", "endTime", "xTable", "yTable", "interpolationAlgorithm", "numberOfPoints", "degree", "firstIndex", "lastIndex", "computedFirstIndex", "computedLastIndex", "destinationIndex", "sourceIndex", "stop", "x", "interpolationResult", "yStride", "options", "valuesChanged", "interpolationDegree", "derivatives", "hasDerivatives", "data", "derivativesLength", "derivativeValues", "packedSamples", "removeSamples", "property", "numberToRemove", "timeInterval", "stopIndex", "other", "otherDerivativeTypes", "otherHasDerivatives", "otherTimes", "otherValues", "SampledProperty_default", "SampledPositionProperty", "referenceFrame", "numberOfDerivatives", "defaultValue_default", "derivativeTypes", "Cartesian3_default", "SampledProperty_default", "Event_default", "ReferenceFrame_default", "value", "time", "result", "defined_default", "PositionProperty_default", "options", "position", "derivatives", "times", "positions", "packedSamples", "epoch", "timeInterval", "other", "Property_default", "SampledPositionProperty_default", "StripeOrientation", "StripeOrientation_default", "defaultOrientation", "StripeOrientation_default", "defaultEvenColor", "Color_default", "defaultOddColor", "defaultOffset", "defaultRepeat", "StripeMaterialProperty", "options", "defaultValue_default", "Event_default", "Property_default", "createPropertyDescriptor_default", "time", "result", "defined_default", "other", "StripeMaterialProperty_default", "TimeIntervalCollectionPositionProperty", "referenceFrame", "Event_default", "TimeIntervalCollection_default", "defaultValue_default", "ReferenceFrame_default", "time", "result", "position", "defined_default", "PositionProperty_default", "other", "Property_default", "TimeIntervalCollectionPositionProperty_default", "TimeIntervalCollectionProperty", "Event_default", "TimeIntervalCollection_default", "time", "result", "value", "defined_default", "other", "Property_default", "TimeIntervalCollectionProperty_default", "VelocityVectorProperty", "position", "normalize", "Event_default", "defaultValue_default", "Property_default", "value", "oldValue", "defined_default", "position1Scratch", "Cartesian3_default", "position2Scratch", "timeScratch", "JulianDate_default", "step", "time", "result", "velocityResult", "positionResult", "property", "position1", "position2", "velocity", "other", "VelocityVectorProperty_default", "VelocityOrientationProperty", "position", "ellipsoid", "VelocityVectorProperty_default", "Event_default", "defaultValue_default", "Ellipsoid_default", "that", "Property_default", "value", "positionScratch", "Cartesian3_default", "velocityScratch", "rotationScratch", "Matrix3_default", "time", "result", "velocity", "defined_default", "Transforms_default", "Quaternion_default", "other", "VelocityOrientationProperty_default", "UnitCartesian3", "Cartesian3_default", "currentId", "createReferenceProperty", "entityCollection", "referenceString", "ReferenceProperty_default", "createSpecializedProperty", "type", "packetData", "defined_default", "referenceProperty", "VelocityVectorProperty_default", "Quaternion_default", "VelocityOrientationProperty_default", "RuntimeError_default", "createAdapterProperty", "property", "adapterFunction", "CallbackProperty_default", "time", "result", "scratchCartesian", "scratchSpherical", "Spherical_default", "scratchCartographic", "Cartographic_default", "scratchTimeInterval", "TimeInterval_default", "scratchQuaternion", "unwrapColorInterval", "czmlInterval", "rgbaf", "rgba", "length", "Color_default", "i", "unwrapUriInterval", "sourceUri", "uri", "defaultValue_default", "Resource_default", "unwrapRectangleInterval", "wsen", "wsenDegrees", "Rectangle_default", "Math_default", "convertUnitSphericalToCartesian", "unitSpherical", "j", "convertSphericalToCartesian", "spherical", "convertCartographicRadiansToCartesian", "cartographicRadians", "Ellipsoid_default", "convertCartographicDegreesToCartesian", "cartographicDegrees", "unwrapCartesianInterval", "cartesian", "cartesianVelocity", "unitCartesian", "normalizePackedCartesianArray", "array", "startingIndex", "unwrapUnitCartesianInterval", "normalizePackedQuaternionArray", "unwrapQuaternionInterval", "unitQuaternion", "getPropertyType", "BoundingRectangle_default", "Cartesian2_default", "ArcType_default", "ClassificationType_default", "ColorBlendMode_default", "CornerType_default", "HeightReference_default", "HorizontalOrigin_default", "JulianDate_default", "LabelStyle_default", "NearFarScalar_default", "DistanceDisplayCondition_default", "ShadowMode_default", "StripeOrientation_default", "Uri", "VerticalOrigin_default", "unwrapInterval", "Rotation_default", "interpolators", "HermitePolynomialApproximation_default", "LagrangePolynomialApproximation_default", "LinearApproximation_default", "updateInterpolationSettings", "interpolationAlgorithm", "interpolationDegree", "forwardExtrapolationType", "ExtrapolationType_default", "forwardExtrapolationDuration", "backwardExtrapolationType", "backwardExtrapolationDuration", "iso8601Scratch", "intervalFromString", "intervalString", "wrapPropertyInInfiniteInterval", "interval", "Iso8601_default", "convertPropertyToComposite", "composite", "CompositeProperty_default", "convertPositionPropertyToComposite", "CompositePositionProperty_default", "processProperty", "object", "propertyName", "constrainedInterval", "combinedInterval", "packedLength", "unwrappedInterval", "unwrappedIntervalLength", "isValue", "hasInterval", "removePropertyData", "isSampled", "needsUnpacking", "ConstantProperty_default", "epoch", "packetEpoch", "SampledProperty_default", "TimeIntervalCollectionProperty_default", "intervals", "intersection", "processPacketData", "len", "processPositionProperty", "numberOfDerivatives", "removePositionPropertyData", "referenceFrame", "ReferenceFrame_default", "ConstantPositionProperty_default", "SampledPositionProperty_default", "TimeIntervalCollectionPositionProperty_default", "processPositionPacketData", "processShapePacketData", "processReferencesArrayPacketData", "PropertyArray_default", "processMaterialProperty", "existingMaterial", "existingInterval", "CompositeMaterialProperty_default", "thisIntervals", "materialData", "ColorMaterialProperty_default", "GridMaterialProperty_default", "ImageMaterialProperty_default", "StripeMaterialProperty_default", "PolylineOutlineMaterialProperty_default", "PolylineGlowMaterialProperty_default", "PolylineArrowMaterialProperty_default", "PolylineDashMaterialProperty_default", "CheckerboardMaterialProperty_default", "processMaterialPacketData", "processName", "entity", "packet", "nameData", "processDescription", "descriptionData", "processPosition", "positionData", "processViewFrom", "viewFromData", "processOrientation", "orientationData", "processProperties", "propertiesData", "PropertyBag_default", "key", "propertyData", "references", "PropertyArrayType", "CompositePropertyArrayType", "properties", "reference", "processArrayPacketData", "processArray", "processPositionArrayPacketData", "PositionPropertyArray_default", "processPositionArray", "unpackCartesianArray", "unpackCartographicRadiansArray", "unpackCartographicDegreesArray", "processPositionArrayOfArraysPacketData", "referenceArray", "tempObj", "processPositionArrayOfArrays", "processShape", "processAvailability", "TimeIntervalCollection_default", "processAlignedAxis", "billboard", "processBillboard", "billboardData", "BillboardGraphics_default", "processBox", "boxData", "box", "BoxGraphics_default", "processCorridor", "corridorData", "corridor", "CorridorGraphics_default", "processCylinder", "cylinderData", "cylinder", "CylinderGraphics_default", "processDocument", "dataSource", "version", "tokens", "documentPacket", "clockPacket", "clock", "processEllipse", "ellipseData", "ellipse", "EllipseGraphics_default", "processEllipsoid", "ellipsoidData", "ellipsoid", "EllipsoidGraphics_default", "processLabel", "labelData", "label", "LabelGraphics_default", "processModel", "modelData", "model", "ModelGraphics_default", "nodeTransformationsData", "processNodeTransformations", "articulationsData", "processArticulations", "nodeTransformations", "nodeNames", "nodeName", "nodeTransformationData", "nodeTransformation", "NodeTransformationProperty_default", "articulations", "keys", "articulationStageData", "processPath", "pathData", "path", "PathGraphics_default", "processPoint", "pointData", "point", "PointGraphics_default", "PolygonHierarchyProperty", "polygon", "Event_default", "positions", "holes", "holePositions", "PolygonHierarchy_default", "other", "Property_default", "processPolygon", "polygonData", "PolygonGraphics_default", "adaptFollowSurfaceToArcType", "followSurface", "processPolyline", "polylineData", "polyline", "PolylineGraphics_default", "processPolylineVolume", "polylineVolumeData", "polylineVolume", "PolylineVolumeGraphics_default", "processRectangle", "rectangleData", "rectangle", "RectangleGraphics_default", "processTileset", "tilesetData", "tileset", "Cesium3DTilesetGraphics_default", "processWall", "wallData", "wall", "WallGraphics_default", "processCzmlPacket", "updaterFunctions", "objectId", "createGuid_default", "parentId", "updateClock", "availability", "startTime", "stopTime", "totalSeconds", "multiplier", "DataSourceClock_default", "ClockRange_default", "ClockStep_default", "load", "czml", "options", "clear", "promise", "credit", "Credit_default", "resourceCredits", "credits", "DataSource_default", "loadCzml", "error", "DocumentPacket", "CzmlDataSource", "raiseChangedEvent", "getFilenameFromUri_default", "name", "EntityCollection_default", "EntityCluster_default", "value", "CzmlDataSource_default", "DataSourceCollection", "Event_default", "dataSource", "that", "dataSources", "value", "destroy", "defaultValue_default", "index", "i", "len", "name", "getIndex", "swapDataSources", "collection", "j", "arr", "length", "Math_default", "temp", "destroyObject_default", "DataSourceCollection_default", "PrimitiveCollection", "options", "defaultValue_default", "createGuid_default", "primitive", "index", "hasIndex", "defined_default", "external", "composites", "removed", "primitives", "length", "i", "getPrimitiveIndex", "compositePrimitive", "p", "frameState", "passState", "destroyObject_default", "PrimitiveCollection_default", "OrderedGroundPrimitiveCollection", "primitive", "zIndex", "defaultValue_default", "collection", "defined_default", "PrimitiveCollection_default", "array", "i", "doNotDestroy", "index", "result", "collections", "frameState", "destroyObject_default", "OrderedGroundPrimitiveCollection_default", "DynamicGeometryBatch", "primitives", "orderedGroundPrimitives", "AssociativeArray_default", "time", "updater", "id", "dynamicUpdater", "defined_default", "geometries", "i", "len", "result", "BoundingSphereState_default", "DynamicGeometryBatch_default", "EllipseGeometryLibrary", "rotAxis", "Cartesian3_default", "tempVec", "unitQuat", "Quaternion_default", "rotMtx", "Matrix3_default", "pointOnEllipsoid", "theta", "rotation", "northVec", "eastVec", "aSqr", "ab", "bSqr", "mag", "unitPos", "result", "azimuth", "cosThetaSquared", "sinThetaSquared", "angle", "scratchCartesian1", "scratchCartesian2", "scratchCartesian3", "scratchNormal", "positions", "options", "extrude", "ellipsoid", "height", "extrudedHeight", "size", "finalPositions", "length", "bottomOffset", "i", "i1", "i2", "position", "extrudedPosition", "normal", "scaledNormal", "unitPosScratch", "eastVecScratch", "northVecScratch", "addFillPositions", "addEdgePositions", "semiMinorAxis", "semiMajorAxis", "center", "granularity", "numPts", "Math_default", "deltaTheta", "positionIndex", "reflectedPosition", "outerPositionsLength", "outerRightIndex", "outerLeftIndex", "outerPositions", "j", "numInterior", "t", "interiorPosition", "r", "EllipseGeometryLibrary_default", "scratchCartesian1", "Cartesian3_default", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "texCoordScratch", "Cartesian2_default", "textureMatrixScratch", "Matrix3_default", "tangentMatrixScratch", "quaternionScratch", "Quaternion_default", "scratchNormal", "scratchTangent", "scratchBitangent", "scratchCartographic", "Cartographic_default", "projectedCenterScratch", "scratchMinTexCoord", "scratchMaxTexCoord", "computeTopBottomAttributes", "positions", "options", "extrude", "vertexFormat", "center", "semiMajorAxis", "semiMinorAxis", "ellipsoid", "stRotation", "size", "shadowVolume", "textureCoordinates", "normals", "tangents", "bitangents", "extrudeNormals", "textureCoordIndex", "normal", "tangent", "bitangent", "projection", "GeographicProjection_default", "projectedCenter", "geodeticNormal", "textureMatrix", "tangentMatrix", "rotation", "minTexCoord", "maxTexCoord", "length", "bottomOffset", "stOffset", "i", "i1", "i2", "position", "rotatedPoint", "projectedPoint", "k", "attributes", "GeometryAttributes_default", "finalPositions", "EllipseGeometryLibrary_default", "GeometryAttribute_default", "ComponentDatatype_default", "defined_default", "offsetAttribute", "GeometryOffsetAttribute_default", "offsetValue", "topIndices", "numPts", "indices", "indicesIndex", "prevIndex", "numInterior", "positionIndex", "j", "boundingSphereCenter", "computeEllipse", "boundingSphere", "BoundingSphere_default", "cep", "IndexDatatype_default", "computeWallAttributes", "height", "extrudedHeight", "extrudedPosition", "scaledNormal", "next", "bottom", "computeWallIndices", "index", "UL", "LL", "UR", "LR", "topBoundingSphere", "bottomBoundingSphere", "computeExtrudedEllipse", "outerPositions", "topBottomAttributes", "posLength", "topBottomIndices", "topBottomGeo", "Geometry_default", "PrimitiveType_default", "wallAttributes", "wallIndices", "wallGeo", "geo", "GeometryPipeline_default", "GeometryInstance_default", "computeRectangle", "granularity", "result", "positionsFlat", "positionsCount", "rectangle", "Rectangle_default", "Math_default", "EllipseGeometry", "defaultValue_default", "Ellipsoid_default", "VertexFormat_default", "value", "array", "startingIndex", "scratchCenter", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "ellipseGeometry", "geometry", "applyOffset", "minHeightFunc", "maxHeightFunc", "minHeight", "maxHeight", "textureCoordinateRotationPoints", "boundingRectangle", "EllipseGeometry_default", "scratchCartesian1", "Cartesian3_default", "boundingSphereCenter", "computeEllipse", "options", "center", "boundingSphere", "BoundingSphere_default", "positions", "EllipseGeometryLibrary_default", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "length", "indices", "IndexDatatype_default", "index", "i", "topBoundingSphere", "bottomBoundingSphere", "computeExtrudedEllipse", "ellipsoid", "semiMajorAxis", "scaledNormal", "defined_default", "applyOffset", "GeometryOffsetAttribute_default", "offsetValue", "numberOfVerticalLines", "defaultValue_default", "Math_default", "numSide", "numSideLines", "maxI", "EllipseOutlineGeometry", "Ellipsoid_default", "semiMinorAxis", "granularity", "height", "extrudedHeight", "value", "array", "startingIndex", "scratchCenter", "scratchEllipsoid", "scratchOptions", "result", "rotation", "offsetAttribute", "ellipseGeometry", "extrude", "geometry", "Geometry_default", "PrimitiveType_default", "EllipseOutlineGeometry_default", "scratchColor", "Color_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "scratchRectangle", "Rectangle_default", "EllipseGeometryOptions", "entity", "EllipseGeometryUpdater", "scene", "GroundGeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "ShowGeometryInstanceAttribute_default", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "EllipseGeometry_default", "outlineColor", "distanceDisplayCondition", "EllipseOutlineGeometry_default", "result", "ellipse", "position", "GeometryUpdater_default", "heightValue", "Iso8601_default", "heightReferenceValue", "HeightReference_default", "extrudedHeightValue", "extrudedHeightReferenceValue", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "ApproximateTerrainHeights_default", "DynamicEllipseGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "EllipseGeometryUpdater_default", "scratchPosition", "Cartesian3_default", "scratchNormal", "scratchTangent", "scratchBitangent", "scratchNormalST", "defaultRadii", "cos", "sin", "EllipsoidGeometry", "options", "defaultValue_default", "radii", "innerRadii", "minimumClock", "maximumClock", "Math_default", "minimumCone", "maximumCone", "stackPartitions", "slicePartitions", "vertexFormat", "VertexFormat_default", "value", "array", "startingIndex", "scratchRadii", "scratchInnerRadii", "scratchVertexFormat", "scratchOptions", "result", "offsetAttribute", "defined_default", "ellipsoidGeometry", "i", "j", "index", "phis", "thetas", "numPhis", "numThetas", "extraIndices", "vertexMultiplier", "hasInnerSurface", "isTopOpen", "isBotOpen", "isClockOpen", "vertexCount", "positions", "isInner", "negateNormal", "indexCount", "numIndices", "indices", "IndexDatatype_default", "normals", "tangents", "bitangents", "st", "sinPhi", "cosPhi", "sinTheta", "cosTheta", "vertexIndex", "topOffset", "bottomOffset", "offset", "outerOffset", "innerOffset", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "stIndex", "normalIndex", "tangentIndex", "bitangentIndex", "vertexCountHalf", "ellipsoid", "ellipsoidOuter", "Ellipsoid_default", "ellipsoidInner", "position", "normal", "normalST", "Cartesian2_default", "tangent", "tangetOffset", "unit", "bitangent", "length", "offsetValue", "GeometryOffsetAttribute_default", "applyOffset", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "unitEllipsoidGeometry", "EllipsoidGeometry_default", "defaultMaterial", "ColorMaterialProperty_default", "Color_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "radiiScratch", "innerRadiiScratch", "scratchColor", "unitSphere", "EllipsoidGeometryOptions", "entity", "EllipsoidGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "skipModelMatrix", "modelMatrixResult", "isAvailable", "color", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "attributes", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "EllipsoidGeometry_default", "outlineColor", "EllipsoidOutlineGeometry_default", "result", "ellipsoid", "heightReference", "Iso8601_default", "HeightReference_default", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "GeometryOffsetAttribute_default", "heightReferenceOnEntityPropertyChanged_default", "DynamicEllipsoidGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "Matrix4_default", "radii", "modelMatrix", "showFill", "showOutline", "material", "MaterialProperty_default", "defaultValue_default", "innerRadii", "minimumClock", "maximumClock", "minimumCone", "maximumCone", "stackPartitions", "slicePartitions", "subdivisions", "outlineWidth", "offsetAttribute", "sceneMode", "in3D", "SceneMode_default", "shadows", "offset", "mag", "appearance", "fillInstance", "Primitive_default", "outlineInstance", "primitive", "outlinePrimitive", "outlineAttributes", "DistanceDisplayCondition_default", "EllipsoidGeometryUpdater_default", "PlaneGeometry", "options", "defaultValue_default", "vertexFormat", "VertexFormat_default", "value", "array", "startingIndex", "scratchVertexFormat", "scratchOptions", "result", "defined_default", "min", "Cartesian3_default", "max", "planeGeometry", "attributes", "GeometryAttributes_default", "indices", "positions", "GeometryAttribute_default", "ComponentDatatype_default", "normals", "texCoords", "tangents", "bitangents", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "PlaneGeometry_default", "PlaneOutlineGeometry", "value", "array", "startingIndex", "result", "defined_default", "min", "Cartesian3_default", "max", "attributes", "GeometryAttributes_default", "indices", "positions", "GeometryAttribute_default", "ComponentDatatype_default", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "PlaneOutlineGeometry_default", "positionScratch", "Cartesian3_default", "scratchColor", "Color_default", "PlaneGeometryOptions", "entity", "PlaneGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "color", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "planeGraphics", "options", "modelMatrix", "plane", "Property_default", "dimensions", "createPrimitiveMatrix", "GeometryInstance_default", "PlaneGeometry_default", "outlineColor", "PlaneOutlineGeometry_default", "isColorMaterial", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "Iso8601_default", "DynamicPlaneGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "position", "scratchAxis", "scratchUp", "scratchTranslation", "scratchScale", "scratchRotation", "Matrix3_default", "scratchRotationScale", "scratchLocalTransform", "Matrix4_default", "transform", "result", "normal", "distance", "translation", "up", "Math_default", "left", "rotationMatrix", "scale", "rotationScaleMatrix", "localTransform", "PlaneGeometryUpdater_default", "scratchPosition", "Cartesian3_default", "scratchBR", "BoundingRectangle_default", "stScratch", "Cartesian2_default", "textureCoordinatesOrigin", "scratchNormal", "scratchTangent", "scratchBitangent", "centerScratch", "axis1Scratch", "axis2Scratch", "quaternionScratch", "Quaternion_default", "textureMatrixScratch", "Matrix3_default", "tangentRotationScratch", "surfaceNormalScratch", "createGeometryFromPolygon", "polygon", "vertexFormat", "boundingRectangle", "stRotation", "hardcodedTextureCoordinates", "projectPointTo2D", "normal", "tangent", "bitangent", "positions", "indices", "PolygonPipeline_default", "newIndices", "IndexDatatype_default", "textureMatrix", "rotation", "tangentRotation", "stOrigin", "length", "size", "flatPositions", "normals", "tangents", "bitangents", "textureCoordinates", "positionIndex", "normalIndex", "bitangentIndex", "tangentIndex", "stIndex", "i", "position", "defined_default", "p", "st", "stx", "Math_default", "sty", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "Geometry_default", "PrimitiveType_default", "CoplanarPolygonGeometry", "options", "defaultValue_default", "polygonHierarchy", "VertexFormat_default", "Ellipsoid_default", "PolygonGeometryLibrary_default", "newOptions", "value", "array", "startingIndex", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "result", "ellipsoid", "packedLength", "polygonGeometry", "hasTextureCoordinates", "outerPositions", "arrayRemoveDuplicates_default", "axis1", "axis2", "CoplanarPolygonGeometryLibrary_default", "surfaceNormal", "projectPoints", "projectPoint", "results", "hierarchy", "polygons", "dummyFunction", "identity", "textureCoordinatePolygons", "boundingSphere", "BoundingSphere_default", "geometries", "geometryInstance", "GeometryInstance_default", "geometry", "GeometryPipeline_default", "CoplanarPolygonGeometry_default", "scratchCarto1", "Cartographic_default", "scratchCarto2", "adjustPosHeightsForNormal", "position", "p1", "p2", "ellipsoid", "height", "p1Carto", "p2Carto", "scratchBoundingRectangle", "BoundingRectangle_default", "scratchPosition", "Cartesian3_default", "scratchNormal", "scratchTangent", "scratchBitangent", "p1Scratch", "p2Scratch", "scratchPerPosNormal", "scratchPerPosTangent", "scratchPerPosBitangent", "appendTextureCoordinatesOrigin", "Cartesian2_default", "appendTextureCoordinatesCartesian2", "appendTextureCoordinatesCartesian3", "appendTextureCoordinatesQuaternion", "Quaternion_default", "appendTextureCoordinatesMatrix3", "Matrix3_default", "tangentMatrixScratch", "computeAttributes", "options", "vertexFormat", "geometry", "shadowVolume", "flatPositions", "flatTexcoords", "defined_default", "length", "wall", "top", "bottom", "boundingRectangle", "tangentPlane", "stRotation", "perPositionHeight", "origin", "textureCoordinates", "normals", "tangents", "bitangents", "extrudeNormals", "textureCoordIndex", "attrIndex", "normal", "tangent", "bitangent", "recomputeNormal", "textureMatrix", "tangentRotationMatrix", "rotation", "bottomOffset", "bottomOffset2", "i", "p", "st", "stx", "Math_default", "sty", "attrIndex1", "attrIndex2", "GeometryAttribute_default", "ComponentDatatype_default", "size", "offsetAttribute", "GeometryOffsetAttribute_default", "offsetValue", "startCartographicScratch", "endCartographicScratch", "idlCross", "ellipsoidGeodesic", "EllipsoidGeodesic_default", "computeRectangle", "positions", "arcType", "granularity", "result", "defaultValue_default", "Rectangle_default", "ArcType_default", "inverseChordLength", "positionsLength", "endCartographic", "startCartographic", "swap", "interpolateAndGrowRectangle", "interpolatedCartographicScratch", "segmentLength", "numPoints", "subsegmentDistance", "interpolationDistance", "interpolatedCartographic", "longitude", "latitude", "lonAdjusted", "createGeometryFromPositionsExtrudedPositions", "createGeometryFromPositionsExtruded", "polygon", "hierarchy", "closeTop", "closeBottom", "geos", "topGeo", "PolygonGeometryLibrary_default", "edgePoints", "indices", "numPositions", "newIndices", "topBottomPositions", "IndexDatatype_default", "ilength", "i0", "i1", "i2", "texcoords", "GeometryInstance_default", "outerRing", "EllipsoidTangentPlane_default", "positions2D", "windingOrder", "PolygonPipeline_default", "WindingOrder_default", "wallGeo", "holes", "hole", "PolygonGeometry", "polygonHierarchy", "VertexFormat_default", "Ellipsoid_default", "perPositionHeightExtrude", "extrudedHeight", "h", "newOptions", "value", "array", "startingIndex", "scratchEllipsoid", "scratchVertexFormat", "dummyOptions", "packedLength", "polygonGeometry", "hasTextureCoordinates", "outerPositions", "results", "polygons", "dummyFunction", "identity", "textureCoordinatePolygons", "geometries", "extrude", "splitGeometry", "topAndBottom", "walls", "k", "geometryInstance", "applyOffset", "GeometryPipeline_default", "attributes", "boundingSphere", "BoundingSphere_default", "Geometry_default", "minHeightFunc", "maxHeightFunc", "minHeight", "maxHeight", "textureCoordinateRotationPoints", "PolygonGeometry_default", "createGeometryFromPositionsPositions", "createGeometryFromPositionsSubdivided", "createGeometryFromPositions", "ellipsoid", "positions", "minDistance", "perPositionHeight", "arcType", "positions2D", "EllipsoidTangentPlane_default", "PolygonPipeline_default", "WindingOrder_default", "subdividedPositions", "i", "length", "index", "p0", "p1", "numVertices", "ArcType_default", "PolygonGeometryLibrary_default", "tempPositions", "tempPositionsLength", "j", "indicesSize", "indices", "IndexDatatype_default", "GeometryInstance_default", "Geometry_default", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "PrimitiveType_default", "createGeometryFromPositionsExtruded", "corners", "cornersLength", "corner", "PolygonOutlineGeometry", "options", "polygonHierarchy", "defaultValue_default", "Ellipsoid_default", "granularity", "Math_default", "perPositionHeightExtrude", "defined_default", "height", "extrudedHeight", "h", "Cartesian3_default", "value", "array", "startingIndex", "scratchEllipsoid", "dummyOptions", "result", "offsetAttribute", "packedLength", "newOptions", "polygonGeometry", "polygons", "geometryInstance", "geometries", "extrude", "offsetValue", "size", "GeometryOffsetAttribute_default", "applyOffset", "geometry", "GeometryPipeline_default", "boundingSphere", "BoundingSphere_default", "PolygonOutlineGeometry_default", "heightAndPerPositionHeightWarning", "heightReferenceAndPerPositionHeightWarning", "scratchColor", "Color_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "scratchRectangle", "Rectangle_default", "scratch2DPositions", "cart2Scratch", "Cartesian2_default", "PolygonGeometryOptions", "entity", "PolygonGeometryUpdater", "scene", "GroundGeometryUpdater_default", "defined_default", "time", "isAvailable", "options", "attributes", "ShowGeometryInstanceAttribute_default", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "geometry", "CoplanarPolygonGeometry_default", "PolygonGeometry_default", "GeometryInstance_default", "outlineColor", "distanceDisplayCondition", "CoplanarPolygonOutlineGeometry_default", "PolygonOutlineGeometry_default", "result", "hierarchy", "positions", "ellipsoid", "tangentPlane", "EllipsoidTangentPlane_default", "positions2D", "length", "area", "j", "centroid2D", "i", "p1", "p2", "f", "sum", "a", "polygon", "GeometryUpdater_default", "onTerrain", "perPositionHeightProperty", "perPositionHeightEnabled", "Iso8601_default", "isColorMaterial", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "hierarchyValue", "heightValue", "heightReferenceValue", "HeightReference_default", "extrudedHeightValue", "extrudedHeightReferenceValue", "perPositionHeightValue", "offsetAttribute", "oneTimeWarning_default", "ArcType_default", "ApproximateTerrainHeights_default", "height", "extrudedHeight", "isExtruded", "DyanmicPolygonGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "PolygonGeometryUpdater_default", "computeAttributes", "combinedPositions", "shape", "boundingRectangle", "vertexFormat", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "shapeLength", "vertexCount", "length", "firstEndIndices", "PolygonPipeline_default", "indicesCount", "indices", "IndexDatatype_default", "i", "j", "ll", "ul", "ur", "lr", "offset", "index", "st", "lengthSt", "heightSt", "heightOffset", "s", "t", "stindex", "endOffset", "v0", "v1", "v2", "geometry", "Geometry_default", "BoundingSphere_default", "PrimitiveType_default", "GeometryPipeline_default", "oneTimeWarning_default", "PolylineVolumeGeometry", "options", "defaultValue_default", "positions", "Ellipsoid_default", "CornerType_default", "VertexFormat_default", "Math_default", "numComponents", "Cartesian3_default", "Cartesian2_default", "value", "array", "startingIndex", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "result", "ellipsoid", "cornerType", "granularity", "defined_default", "brScratch", "BoundingRectangle_default", "polylineVolumeGeometry", "cleanPositions", "arrayRemoveDuplicates_default", "shape2D", "PolylineVolumeGeometryLibrary_default", "WindingOrder_default", "computedPositions", "PolylineVolumeGeometry_default", "computeAttributes", "positions", "shape", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "shapeLength", "vertexCount", "shapeCount", "indices", "IndexDatatype_default", "i", "j", "index", "offset", "firstOffset", "secondOffset", "Geometry_default", "BoundingSphere_default", "PrimitiveType_default", "PolylineVolumeOutlineGeometry", "options", "defaultValue_default", "Ellipsoid_default", "CornerType_default", "Math_default", "numComponents", "Cartesian3_default", "Cartesian2_default", "value", "array", "startingIndex", "length", "scratchEllipsoid", "scratchOptions", "result", "ellipsoid", "cornerType", "granularity", "defined_default", "brScratch", "BoundingRectangle_default", "polylineVolumeOutlineGeometry", "cleanPositions", "arrayRemoveDuplicates_default", "shape2D", "PolylineVolumeGeometryLibrary_default", "PolygonPipeline_default", "WindingOrder_default", "boundingRectangle", "computedPositions", "PolylineVolumeOutlineGeometry_default", "scratchColor", "Color_default", "PolylineVolumeGeometryOptions", "entity", "PolylineVolumeGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "color", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "GeometryInstance_default", "PolylineVolumeGeometry_default", "outlineColor", "Property_default", "PolylineVolumeOutlineGeometry_default", "polylineVolume", "granularity", "cornerType", "options", "isColorMaterial", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "Iso8601_default", "DynamicPolylineVolumeGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "PolylineVolumeGeometryUpdater_default", "positionScratch", "Cartesian3_default", "normalScratch", "tangentScratch", "bitangentScratch", "rectangleScratch", "Rectangle_default", "stScratch", "Cartesian2_default", "bottomBoundingSphere", "BoundingSphere_default", "topBoundingSphere", "createAttributes", "vertexFormat", "attributes", "geo", "Geometry_default", "GeometryAttributes_default", "PrimitiveType_default", "GeometryAttribute_default", "ComponentDatatype_default", "calculateAttributes", "positions", "ellipsoid", "tangentRotationMatrix", "length", "normals", "tangents", "bitangents", "attrIndex", "bitangent", "tangent", "normal", "i", "p", "attrIndex1", "attrIndex2", "Matrix3_default", "v1Scratch", "v2Scratch", "calculateAttributesWall", "normalIndex", "tangentIndex", "bitangentIndex", "recomputeNormal", "p1", "p2", "Math_default", "constructRectangle", "rectangleGeometry", "computedOptions", "height", "width", "northCap", "southCap", "rowStart", "rowEnd", "rowHeight", "size", "textureCoordinates", "posIndex", "stIndex", "position", "st", "minX", "minY", "maxX", "maxY", "row", "col", "RectangleGeometryLibrary_default", "k", "indicesSize", "indices", "IndexDatatype_default", "index", "indicesIndex", "j", "upperLeft", "lowerLeft", "lowerRight", "upperRight", "northIndex", "southIndex", "addWallPositions", "wallPositions", "topPositions", "bottomPositions", "addWallTextureCoordinates", "wallTextures", "scratchVertexFormat", "VertexFormat_default", "constructExtrudedRectangle", "shadowVolume", "offsetAttributeValue", "minHeight", "maxHeight", "newVertexFormat", "topBottomGeo", "PolygonPipeline_default", "newLength", "textures", "topSt", "topNormals", "extrudeNormals", "offsetValue", "hasOffsets", "defined_default", "offsetAttribute", "GeometryOffsetAttribute_default", "topTangents", "topBitangents", "indicesLength", "posLength", "newIndices", "widthMultiplier", "perimeterPositions", "corners", "dupliateCorners", "wallCount", "wallExtrudeNormals", "wallOffsetAttribute", "computeTopOffsets", "extrudeNormalIndex", "wallOffsetIndex", "area", "threeI", "wallIndices", "GeometryPipeline_default", "GeometryInstance_default", "scratchRectanglePoints", "nwScratch", "Cartographic_default", "stNwScratch", "computeRectangle", "rectangle", "granularity", "rotation", "result", "RectangleGeometry", "options", "defaultValue_default", "extrudedHeight", "Ellipsoid_default", "value", "array", "startingIndex", "scratchRectangle", "scratchEllipsoid", "scratchOptions", "surfaceHeight", "stRotation", "tangentRotationMatrixScratch", "quaternionScratch", "Quaternion_default", "centerScratch", "center", "axis", "extrude", "geometry", "boundingSphere", "topBS", "bottomBS", "applyOffset", "minHeightFunc", "maxHeightFunc", "unrotatedTextureRectangleScratch", "points2DScratch", "rotation2DScratch", "Matrix2_default", "rectangleCenterScratch", "textureCoordinateRotationPoints", "unrotatedTextureRectangle", "points2D", "boundingRectangle", "toDesiredInComputed", "boundingRectangleCenter", "point2D", "minXYCorner", "maxYCorner", "maxXCorner", "RectangleGeometry_default", "scratchColor", "Color_default", "defaultOffset", "Cartesian3_default", "offsetScratch", "scratchRectangle", "Rectangle_default", "scratchCenterRect", "scratchCarto", "Cartographic_default", "RectangleGeometryOptions", "entity", "RectangleGeometryUpdater", "scene", "GroundGeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "ShowGeometryInstanceAttribute_default", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "OffsetGeometryInstanceAttribute_default", "Property_default", "GeometryInstance_default", "RectangleGeometry_default", "outlineColor", "distanceDisplayCondition", "RectangleOutlineGeometry_default", "result", "rect", "center", "Ellipsoid_default", "rectangle", "GeometryUpdater_default", "isColorMaterial", "heightValue", "Iso8601_default", "heightReferenceValue", "HeightReference_default", "extrudedHeightValue", "extrudedHeightReferenceValue", "options", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "ApproximateTerrainHeights_default", "DynamicRectangleGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "RectangleGeometryUpdater_default", "colorScratch", "Color_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "defaultOffset", "Cartesian3_default", "offsetScratch", "Batch", "primitives", "translucent", "appearanceType", "depthFailAppearanceType", "depthFailMaterialProperty", "closed", "shadows", "AssociativeArray_default", "removeMaterialSubscription", "defined_default", "updater", "material", "updaterMaterial", "instance", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "unsubscribe", "time", "isUpdated", "removedCount", "primitive", "i", "geometries", "depthFailAppearance", "MaterialProperty_default", "Primitive_default", "oldPrimitive", "ColorMaterialProperty_default", "updatersWithAttributes", "length", "waitingOnCreate", "attributes", "colorProperty", "resultColor", "ColorGeometryInstanceAttribute_default", "depthFailColorProperty", "depthColor", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "offsetProperty", "offset", "OffsetGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "StaticGeometryColorBatch", "items", "item", "batch", "removeItem", "moveItems", "itemsMoved", "itemsToRemove", "itemsToMoveLength", "updateItems", "updaters", "updatersLength", "h", "solidsMoved", "translucentsMoved", "getBoundingSphere", "boundingSphere", "removeAllPrimitives", "StaticGeometryColorBatch_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "defaultOffset", "Cartesian3_default", "offsetScratch", "Batch", "primitives", "appearanceType", "materialProperty", "depthFailAppearanceType", "depthFailMaterialProperty", "closed", "shadows", "AssociativeArray_default", "updater", "material", "updaterMaterial", "depthFailMaterial", "updaterDepthFailMaterial", "equals", "defined_default", "time", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "unsubscribe", "colorScratch", "Color_default", "isUpdated", "primitive", "geometries", "i", "MaterialProperty_default", "depthFailAppearance", "Primitive_default", "oldPrimitive", "ColorMaterialProperty_default", "updatersWithAttributes", "length", "instance", "attributes", "depthFailColorProperty", "depthFailColor", "ColorGeometryInstanceAttribute_default", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "offsetProperty", "offset", "OffsetGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "StaticGeometryPerMaterialBatch", "items", "item", "batch", "updaters", "updatersLength", "h", "StaticGeometryPerMaterialBatch_default", "import_rbush", "RectangleCollisionChecker", "RBush", "RectangleWithId", "id", "rectangle", "result", "withId", "idCompare", "a", "b", "removalScratch", "collisionScratch", "RectangleCollisionChecker_default", "colorScratch", "Color_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "Batch", "primitives", "classificationType", "color", "zIndex", "AssociativeArray_default", "RectangleCollisionChecker_default", "rectangle", "updater", "instance", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "geometryInstance", "unsubscribe", "defined_default", "time", "isUpdated", "removedCount", "primitive", "i", "geometries", "GroundPrimitive_default", "oldPrimitive", "updatersWithAttributes", "length", "waitingOnCreate", "attributes", "colorProperty", "fillColor", "ColorGeometryInstanceAttribute_default", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "bs", "StaticGroundGeometryColorBatch", "batches", "batch", "item", "count", "batchCount", "oldBatch", "itemsToRemove", "itemsToMoveLength", "j", "newBatch", "StaticGroundGeometryColorBatch_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "Batch", "primitives", "classificationType", "appearanceType", "materialProperty", "usingSphericalTextureCoordinates", "zIndex", "AssociativeArray_default", "RectangleCollisionChecker_default", "rectangle", "updater", "material", "updaterMaterial", "ColorMaterialProperty_default", "defined_default", "time", "geometryInstance", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "unsubscribe", "isUpdated", "primitive", "geometries", "i", "MaterialProperty_default", "GroundPrimitive_default", "oldPrimitive", "updatersWithAttributes", "length", "instance", "attributes", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "StaticGroundGeometryPerMaterialBatch", "items", "ShadowVolumeAppearance_default", "item", "batch", "updaters", "updatersLength", "h", "StaticGroundGeometryPerMaterialBatch_default", "colorScratch", "Color_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "defaultOffset", "Cartesian3_default", "offsetScratch", "Batch", "primitives", "translucent", "width", "shadows", "AssociativeArray_default", "updater", "instance", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "unsubscribe", "defined_default", "time", "isUpdated", "removedCount", "primitive", "i", "geometries", "Primitive_default", "PerInstanceColorAppearance_default", "oldPrimitive", "updatersWithAttributes", "length", "waitingOnCreate", "attributes", "outlineColorProperty", "outlineColor", "ColorGeometryInstanceAttribute_default", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "offsetProperty", "offset", "OffsetGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "StaticOutlineGeometryBatch", "scene", "batches", "batch", "solidBatches", "solidBatchesLength", "translucentBatches", "translucentBatchesLength", "x", "itemsToRemove", "needUpdate", "solidsToMoveLength", "translucentToMoveLength", "solidBatch", "translucentBatch", "StaticOutlineGeometryBatch_default", "WallGeometryLibrary", "latLonEquals", "c0", "c1", "Math_default", "scratchCartographic1", "Cartographic_default", "scratchCartographic2", "removeDuplicates", "ellipsoid", "positions", "topHeights", "bottomHeights", "arrayRemoveDuplicates_default", "Cartesian3_default", "length", "hasBottomHeights", "defined_default", "hasTopHeights", "cleanedPositions", "cleanedTopHeights", "cleanedBottomHeights", "v0", "startTopHeight", "startBottomHeight", "hasAllSameHeights", "index", "i", "v1", "positionsArrayScratch", "heightsArrayScratch", "generateArcOptionsScratch", "wallPositions", "maximumHeights", "minimumHeights", "granularity", "duplicateCorners", "o", "numCorners", "topPositions", "bottomPositions", "minDistance", "generateArcOptions", "count", "PolylinePipeline_default", "generateArcPositions", "generateArcHeights", "offset", "pos", "WallGeometryLibrary_default", "scratchCartesian3Position1", "Cartesian3_default", "scratchCartesian3Position2", "scratchCartesian3Position4", "scratchCartesian3Position5", "scratchBitangent", "scratchTangent", "scratchNormal", "WallGeometry", "options", "defaultValue_default", "wallPositions", "maximumHeights", "minimumHeights", "vertexFormat", "VertexFormat_default", "granularity", "Math_default", "ellipsoid", "Ellipsoid_default", "numComponents", "defined_default", "value", "array", "startingIndex", "positions", "length", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "result", "minHeights", "maxHeights", "min", "max", "doMin", "doMax", "i", "newOptions", "wallGeometry", "pos", "WallGeometryLibrary_default", "bottomPositions", "topPositions", "numCorners", "size", "normals", "tangents", "bitangents", "textureCoordinates", "positionIndex", "normalIndex", "bitangentIndex", "tangentIndex", "stIndex", "normal", "tangent", "bitangent", "recomputeNormal", "s", "ds", "i3", "topPosition", "bottomPosition", "nextTop", "groundPosition", "scalednextPosition", "scaledGroundPosition", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "numVertices", "indices", "IndexDatatype_default", "edgeIndex", "LL", "LR", "pl", "pr", "UL", "UR", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "WallGeometry_default", "scratchCartesian3Position1", "Cartesian3_default", "scratchCartesian3Position2", "WallOutlineGeometry", "options", "defaultValue_default", "wallPositions", "maximumHeights", "minimumHeights", "granularity", "Math_default", "ellipsoid", "Ellipsoid_default", "numComponents", "defined_default", "value", "array", "startingIndex", "positions", "length", "scratchEllipsoid", "scratchOptions", "result", "minHeights", "maxHeights", "min", "max", "doMin", "doMax", "i", "newOptions", "wallGeometry", "pos", "WallGeometryLibrary_default", "bottomPositions", "topPositions", "size", "positionIndex", "i3", "topPosition", "bottomPosition", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "numVertices", "indices", "IndexDatatype_default", "edgeIndex", "LL", "LR", "pl", "pr", "UL", "UR", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "WallOutlineGeometry_default", "scratchColor", "Color_default", "WallGeometryOptions", "entity", "WallGeometryUpdater", "scene", "GeometryUpdater_default", "defined_default", "time", "isAvailable", "attributes", "color", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "ColorMaterialProperty_default", "currentColor", "ColorGeometryInstanceAttribute_default", "GeometryInstance_default", "WallGeometry_default", "outlineColor", "Property_default", "WallOutlineGeometry_default", "wall", "options", "minimumHeights", "maximumHeights", "granularity", "isColorMaterial", "PerInstanceColorAppearance_default", "MaterialAppearance_default", "Iso8601_default", "DynamicWallGeometryUpdater", "geometryUpdater", "primitives", "groundPrimitives", "DynamicGeometryUpdater_default", "WallGeometryUpdater_default", "emptyArray", "geometryUpdaters", "BoxGeometryUpdater_default", "CylinderGeometryUpdater_default", "CorridorGeometryUpdater_default", "EllipseGeometryUpdater_default", "EllipsoidGeometryUpdater_default", "PlaneGeometryUpdater_default", "PolygonGeometryUpdater_default", "PolylineVolumeGeometryUpdater_default", "RectangleGeometryUpdater_default", "WallGeometryUpdater_default", "GeometryUpdaterSet", "entity", "scene", "updaters", "geometryChanged", "Event_default", "raiseEvent", "geometry", "eventHelper", "EventHelper_default", "i", "updater", "propertyName", "newValue", "oldValue", "callback", "destroyObject_default", "GeometryVisualizer", "entityCollection", "primitives", "groundPrimitives", "defaultValue_default", "AssociativeArray_default", "numberOfShadowModes", "ShadowMode_default", "supportsMaterialsforEntitiesOnTerrain", "Entity_default", "StaticOutlineGeometryBatch_default", "StaticGeometryColorBatch_default", "PerInstanceColorAppearance_default", "StaticGeometryPerMaterialBatch_default", "MaterialAppearance_default", "numberOfClassificationTypes", "ClassificationType_default", "groundColorBatches", "groundMaterialBatches", "StaticGroundGeometryPerMaterialBatch_default", "StaticGroundGeometryColorBatch_default", "DynamicGeometryBatch_default", "time", "addedObjects", "added", "removedObjects", "removed", "changedObjects", "changed", "id", "updaterSet", "that", "isUpdated", "batches", "length", "getBoundingSphereArrayScratch", "getBoundingSphereBoundingSphereScratch", "BoundingSphere_default", "result", "boundingSpheres", "tmp", "count", "state", "BoundingSphereState_default", "batchesLength", "j", "subscriptions", "updaterSets", "shadows", "defined_default", "classificationType", "ColorMaterialProperty_default", "GeometryVisualizer_default", "defaultScale", "defaultFont", "defaultStyle", "LabelStyle_default", "defaultFillColor", "Color_default", "defaultOutlineColor", "defaultOutlineWidth", "defaultShowBackground", "defaultBackgroundColor", "defaultBackgroundPadding", "Cartesian2_default", "defaultPixelOffset", "defaultEyeOffset", "Cartesian3_default", "defaultHeightReference", "HeightReference_default", "defaultHorizontalOrigin", "HorizontalOrigin_default", "defaultVerticalOrigin", "VerticalOrigin_default", "positionScratch", "fillColorScratch", "outlineColorScratch", "backgroundColorScratch", "backgroundPaddingScratch", "eyeOffsetScratch", "pixelOffsetScratch", "translucencyByDistanceScratch", "NearFarScalar_default", "pixelOffsetScaleByDistanceScratch", "scaleByDistanceScratch", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "EntityData", "entity", "LabelVisualizer", "entityCluster", "entityCollection", "AssociativeArray_default", "time", "items", "cluster", "len", "item", "labelGraphics", "text", "label", "show", "Property_default", "position", "defined_default", "returnPrimitive", "updateClamping", "heightReference", "result", "BoundingSphereState_default", "defaultValue_default", "entities", "i", "destroyObject_default", "added", "removed", "changed", "LabelVisualizer_default", "sampleTerrain", "terrainProvider", "level", "positions", "doSampling", "attemptConsumeNextQueueItem", "tileRequests", "results", "tileRequest", "requestPromise", "promise", "createInterpolateFunction", "createMarkFailedFunction", "delay", "ms", "res", "drainTileRequestQueue", "tilingScheme", "i", "tileRequestSet", "xy", "key", "value", "tilePromises", "interpolateAndAssignHeight", "position", "terrainData", "rectangle", "height", "tilePositions", "isMeshRequired", "sampleTerrain_default", "scratchCartesian2", "Cartesian2_default", "sampleTerrainMostDetailed", "terrainProvider", "positions", "byLevel", "maxLevels", "availability", "promises", "i", "position", "maxLevel", "promise", "defined_default", "atLevel", "positionsAtLevel", "index", "sampleTerrain_default", "changedPositions", "sampleTerrainMostDetailed_default", "defaultScale", "defaultMinimumPixelSize", "defaultIncrementallyLoadTextures", "defaultClampAnimations", "defaultShadows", "ShadowMode_default", "defaultHeightReference", "HeightReference_default", "defaultSilhouetteColor", "Color_default", "defaultSilhouetteSize", "defaultColor", "defaultColorBlendMode", "ColorBlendMode_default", "defaultColorBlendAmount", "defaultImageBasedLightingFactor", "Cartesian2_default", "modelMatrixScratch", "Matrix4_default", "nodeMatrixScratch", "scratchColor", "ModelVisualizer", "scene", "entityCollection", "AssociativeArray_default", "time", "entities", "modelHash", "primitives", "i", "len", "entity", "modelGraphics", "resource", "modelData", "show", "Property_default", "modelMatrix", "Resource_default", "defined_default", "model", "Model_default", "checkModelLoad", "runAnimations", "ModelAnimationLoop_default", "nodeTransformations", "nodeNames", "nodeIndex", "nodeLength", "nodeName", "nodeTransformation", "modelNode", "transformationMatrix", "anyArticulationUpdated", "articulations", "articulationStageKeys", "s", "numKeys", "key", "articulationStageValue", "removeModel", "destroyObject_default", "sampleTerrainMostDetailed_default", "scratchPosition", "Cartesian3_default", "scratchCartographic", "Cartographic_default", "result", "BoundingSphereState_default", "globe", "ellipsoid", "terrainProvider", "cartoPosition", "BoundingSphere_default", "clampedBoundingSphere", "updatedCartographic", "e", "added", "removed", "changed", "clearNodeTransformationsArticulationsScratch", "visualizer", "error", "ModelVisualizer_default", "ScaledPositionProperty", "value", "Event_default", "Property_default", "defined_default", "ReferenceFrame_default", "time", "result", "referenceFrame", "Ellipsoid_default", "other", "ScaledPositionProperty_default", "defaultResolution", "defaultWidth", "scratchTimeInterval", "TimeInterval_default", "subSampleCompositePropertyScratch", "subSampleIntervalPropertyScratch", "EntityData", "entity", "subSampleSampledProperty", "property", "start", "stop", "times", "updateTime", "referenceFrame", "maximumStep", "startingIndex", "result", "r", "tmp", "defined_default", "steppedOnNow", "JulianDate_default", "t", "len", "current", "loopStop", "sampling", "sampleStepsToTake", "sampleStepsTaken", "sampleStepSize", "next", "secondsUntilNext", "subSampleGenericProperty", "i", "index", "time", "stepSize", "subSampleIntervalProperty", "intervals", "interval", "subSampleConstantProperty", "subSampleCompositeProperty", "intervalStart", "intervalStop", "sampleStart", "sampleStop", "reallySubSample", "ReferenceProperty_default", "SampledPositionProperty_default", "CompositePositionProperty_default", "TimeIntervalCollectionPositionProperty_default", "ConstantPositionProperty_default", "ScaledPositionProperty_default", "Property_default", "subSample", "length", "toFixedScratch", "Matrix3_default", "PolylineUpdater", "scene", "PolylineCollection_default", "ReferenceFrame_default", "toFixed", "Transforms_default", "Matrix4_default", "Cartesian3_default", "item", "pathGraphics", "positionProperty", "showProperty", "polyline", "show", "leadTime", "trailTime", "availability", "hasAvailability", "hasLeadTime", "hasTrailTime", "unusedIndexes", "resolution", "MaterialProperty_default", "destroyObject_default", "PathVisualizer", "entityCollection", "AssociativeArray_default", "updaters", "key", "items", "u", "lastUpdater", "frameToVisualize", "SceneMode_default", "currentUpdater", "added", "removed", "changed", "PathVisualizer_default", "defaultColor", "Color_default", "defaultOutlineColor", "defaultOutlineWidth", "defaultPixelSize", "defaultDisableDepthTestDistance", "colorScratch", "positionScratch", "Cartesian3_default", "outlineColorScratch", "scaleByDistanceScratch", "NearFarScalar_default", "translucencyByDistanceScratch", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "EntityData", "entity", "PointVisualizer", "entityCluster", "entityCollection", "AssociativeArray_default", "time", "items", "cluster", "len", "item", "pointGraphics", "pointPrimitive", "billboard", "heightReference", "Property_default", "HeightReference_default", "show", "position", "defined_default", "returnPrimitive", "needsRedraw", "updateClamping", "newColor", "newOutlineColor", "newOutlineWidth", "newPixelSize", "centerAlpha", "cssColor", "cssOutlineColor", "textureId", "createBillboardPointCallback_default", "result", "BoundingSphereState_default", "entities", "i", "destroyObject_default", "added", "removed", "changed", "PointVisualizer_default", "scratchInterpolateColorsArray", "interpolateColors", "p0", "p1", "color0", "color1", "numPoints", "colors", "i", "r0", "g0", "b0", "a0", "r1", "g1", "b1", "a1", "Color_default", "redPerVertex", "greenPerVertex", "bluePerVertex", "alphaPerVertex", "PolylineGeometry", "options", "defaultValue_default", "positions", "width", "colorsPerVertex", "VertexFormat_default", "ArcType_default", "Math_default", "Ellipsoid_default", "numComponents", "Cartesian3_default", "defined_default", "value", "array", "startingIndex", "length", "scratchEllipsoid", "scratchVertexFormat", "scratchOptions", "result", "ellipsoid", "vertexFormat", "arcType", "granularity", "scratchCartesian3", "scratchPosition", "scratchPrevPosition", "scratchNextPosition", "polylineGeometry", "j", "k", "removedIndices", "arrayRemoveDuplicates_default", "removedArrayIndex", "nextRemovedIndex", "color", "index", "remove", "positionsLength", "subdivisionSize", "numberOfPointsFunction", "PolylinePipeline_default", "heights", "colorLength", "newColors", "newColorIndex", "c0", "numColors", "c1", "interpolatedColors", "interpolatedColorsLength", "size", "finalPositions", "prevPositions", "nextPositions", "expandAndWidth", "st", "finalColors", "positionIndex", "expandAndWidthIndex", "stIndex", "colorIndex", "position", "startK", "endK", "direction", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "indices", "IndexDatatype_default", "indicesIndex", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "GeometryType_default", "PolylineGeometry_default", "defaultZIndex", "ConstantProperty_default", "polylineCollections", "scratchColor", "Color_default", "defaultMaterial", "ColorMaterialProperty_default", "defaultShow", "defaultShadows", "ShadowMode_default", "defaultDistanceDisplayCondition", "DistanceDisplayCondition_default", "defaultClassificationType", "ClassificationType_default", "GeometryOptions", "GroundGeometryOptions", "PolylineGeometryUpdater", "entity", "scene", "Event_default", "Entity_default", "defined_default", "Property_default", "time", "visible", "defaultValue_default", "isAvailable", "show", "ShowGeometryInstanceAttribute_default", "distanceDisplayCondition", "distanceDisplayConditionAttribute", "DistanceDisplayConditionGeometryInstanceAttribute_default", "attributes", "currentColor", "ColorGeometryInstanceAttribute_default", "GeometryInstance_default", "GroundPolylineGeometry_default", "PolylineGeometry_default", "destroyObject_default", "propertyName", "newValue", "oldValue", "polyline", "positionsProperty", "Iso8601_default", "zIndex", "material", "isColorMaterial", "width", "arcType", "clampToGround", "granularity", "geometryOptions", "positions", "vertexFormat", "PolylineColorAppearance_default", "PolylineMaterialAppearance_default", "groundGeometryOptions", "oneTimeWarning_default", "primitives", "groundPrimitives", "DynamicGeometryUpdater", "generateCartesianArcOptions", "geometryUpdater", "getLine", "dynamicGeometryUpdater", "sceneId", "polylineCollection", "PolylineCollection_default", "line", "ArcType_default", "fillMaterialProperty", "appearance", "MaterialProperty_default", "GroundPolylinePrimitive_default", "globe", "PolylinePipeline_default", "result", "groundPolylinePrimitive", "BoundingSphere_default", "BoundingSphereState_default", "PolylineGeometryUpdater_default", "scratchColor", "Color_default", "distanceDisplayConditionScratch", "DistanceDisplayCondition_default", "defaultDistanceDisplayCondition", "Batch", "orderedGroundPrimitives", "classificationType", "materialProperty", "zIndex", "asynchronous", "appearanceType", "ColorMaterialProperty_default", "PolylineColorAppearance_default", "PolylineMaterialAppearance_default", "AssociativeArray_default", "updater", "material", "updaterMaterial", "defined_default", "time", "geometryInstance", "id", "Property_default", "that", "entity", "propertyName", "newValue", "oldValue", "unsubscribe", "isUpdated", "primitive", "geometries", "i", "GroundPolylinePrimitive_default", "MaterialProperty_default", "oldPrimitive", "updatersWithAttributes", "length", "instance", "attributes", "colorProperty", "resultColor", "ColorGeometryInstanceAttribute_default", "show", "currentShow", "ShowGeometryInstanceAttribute_default", "distanceDisplayConditionProperty", "distanceDisplayCondition", "DistanceDisplayConditionGeometryInstanceAttribute_default", "showsUpdated", "result", "BoundingSphereState_default", "StaticGroundPolylinePerMaterialBatch", "defaultValue_default", "items", "item", "batch", "updaters", "updatersLength", "h", "StaticGroundPolylinePerMaterialBatch_default", "emptyArray", "removeUpdater", "that", "updater", "batches", "length", "i", "insertUpdaterIntoBatch", "time", "classificationType", "shadows", "multiplier", "defined_default", "ColorMaterialProperty_default", "index", "ShadowMode_default", "PolylineVisualizer", "scene", "entityCollection", "primitives", "groundPrimitives", "defaultValue_default", "AssociativeArray_default", "numberOfShadowModes", "StaticGeometryColorBatch_default", "PolylineColorAppearance_default", "StaticGeometryPerMaterialBatch_default", "PolylineMaterialAppearance_default", "DynamicGeometryBatch_default", "numberOfClassificationTypes", "ClassificationType_default", "StaticGroundPolylinePerMaterialBatch_default", "addedObjects", "added", "removedObjects", "removed", "changedObjects", "changed", "entity", "id", "PolylineGeometryUpdater_default", "isUpdated", "getBoundingSphereArrayScratch", "getBoundingSphereBoundingSphereScratch", "BoundingSphere_default", "result", "boundingSpheres", "tmp", "count", "state", "BoundingSphereState_default", "batchesLength", "subscriptions", "destroyObject_default", "PolylineVisualizer_default", "DataSourceDisplay", "options", "GroundPrimitive_default", "GroundPolylinePrimitive_default", "scene", "dataSourceCollection", "EventHelper_default", "defaultValue_default", "primitivesAdded", "primitives", "PrimitiveCollection_default", "groundPrimitives", "i", "len", "defaultDataSource", "CustomDataSource_default", "removeDefaultDataSourceListener", "removeDataSourceCollectionListener", "that", "addPrimitives", "entityCluster", "dataSource", "entities", "BillboardVisualizer_default", "GeometryVisualizer_default", "LabelVisualizer_default", "ModelVisualizer_default", "Cesium3DTilesetVisualizer_default", "PointVisualizer_default", "PathVisualizer_default", "PolylineVisualizer_default", "length", "defined_default", "destroyObject_default", "time", "ApproximateTerrainHeights_default", "result", "x", "visualizers", "vLength", "dataSources", "frameState", "credit", "credits", "creditCount", "getBoundingSphereArrayScratch", "getBoundingSphereBoundingSphereScratch", "BoundingSphere_default", "entity", "allowPartial", "BoundingSphereState_default", "d", "boundingSpheres", "tmp", "count", "state", "visualizersLength", "visualizer", "displayPrimitives", "displayGroundPrimitives", "OrderedGroundPrimitiveCollection_default", "newIndex", "oldIndex", "DataSourceDisplay_default", "HeadingPitchRange", "heading", "pitch", "range", "defaultValue_default", "hpr", "result", "defined_default", "HeadingPitchRange_default", "updateTransformMatrix3Scratch1", "Matrix3_default", "updateTransformMatrix3Scratch2", "updateTransformMatrix3Scratch3", "updateTransformMatrix4Scratch", "Matrix4_default", "updateTransformCartesian3Scratch1", "Cartesian3_default", "updateTransformCartesian3Scratch2", "updateTransformCartesian3Scratch3", "updateTransformCartesian3Scratch4", "updateTransformCartesian3Scratch5", "updateTransformCartesian3Scratch6", "deltaTime", "JulianDate_default", "northUpAxisFactor", "updateTransform", "that", "camera", "updateLookAt", "saveCamera", "positionProperty", "time", "ellipsoid", "mode", "cartesian", "defined_default", "hasBasis", "invertVelocity", "xBasis", "yBasis", "zBasis", "SceneMode_default", "deltaCartesian", "toInertial", "Transforms_default", "toInertialDelta", "toFixed", "inertialCartesian", "inertialDeltaCartesian", "inertialVelocity", "mu", "Math_default", "semiMajorAxis", "position", "direction", "up", "transform", "offset", "EntityView", "entity", "scene", "defaultValue_default", "Ellipsoid_default", "vector", "scratchHeadingPitchRange", "HeadingPitchRange_default", "scratchCartesian", "boundingSphere", "sceneMode", "objectChanged", "sceneModeChanged", "viewFromProperty", "hasViewFrom", "factor", "EntityView_default", "extractArray", "array", "flatArray", "length", "value", "a", "b", "_dist_code", "Tree", "that", "gen_bitlen", "s", "tree", "stree", "extra", "base", "max_length", "h", "n", "m", "bits", "xbits", "f", "overflow", "bi_reverse", "code", "len", "res", "gen_codes", "max_code", "bl_count", "next_code", "elems", "node", "dist", "StaticTree", "static_tree", "extra_bits", "extra_base", "static_ltree2_first_part", "static_ltree2_second_part", "index", "static_dtree_first_part", "static_dtree_second_part", "MAX_MEM_LEVEL", "DEF_MEM_LEVEL", "Config", "good_length", "max_lazy", "nice_length", "max_chain", "func", "STORED", "FAST", "SLOW", "config_table", "z_errmsg", "NeedMore", "BlockDone", "FinishStarted", "FinishDone", "PRESET_DICT", "INIT_STATE", "BUSY_STATE", "FINISH_STATE", "Z_DEFLATED", "STORED_BLOCK", "STATIC_TREES", "DYN_TREES", "MIN_MATCH", "MAX_MATCH", "MIN_LOOKAHEAD", "smaller", "depth", "tn2", "tm2", "Deflate", "strm", "status", "pending_buf_size", "last_flush", "w_size", "w_bits", "w_mask", "win", "window_size", "prev", "head", "ins_h", "hash_size", "hash_bits", "hash_mask", "hash_shift", "block_start", "match_length", "prev_match", "match_available", "strstart", "match_start", "lookahead", "prev_length", "max_chain_length", "max_lazy_match", "level", "strategy", "good_match", "nice_match", "dyn_ltree", "dyn_dtree", "bl_tree", "l_desc", "d_desc", "bl_desc", "lit_bufsize", "last_lit", "matches", "last_eob_len", "bi_buf", "bi_valid", "lm_init", "i", "init_block", "tr_init", "k", "heap", "v", "j", "scan_tree", "prevlen", "curlen", "nextlen", "count", "max_count", "min_count", "build_bl_tree", "max_blindex", "put_byte", "p", "put_short", "w", "putShortMSB", "send_bits", "val", "send_code", "c", "c2", "send_tree", "send_all_trees", "lcodes", "dcodes", "blcodes", "rank", "bi_flush", "_tr_align", "_tr_tally", "lc", "out_length", "in_length", "dcode", "compress_block", "ltree", "dtree", "lx", "bi_windup", "copy_block", "buf", "header", "_tr_stored_block", "stored_len", "eof", "_tr_flush_block", "opt_lenb", "static_lenb", "flush_block_only", "fill_window", "more", "deflate_stored", "flush", "max_block_size", "max_start", "longest_match", "cur_match", "chain_length", "scan", "match", "best_len", "limit", "_nice_match", "wmask", "strend", "scan_end1", "scan_end", "deflate_fast", "hash_head", "bflush", "deflate_slow", "max_insert", "deflateReset", "_level", "_method", "memLevel", "_strategy", "err", "_strm", "dictionary", "dictLength", "level_flags", "old_flush", "bstate", "ZStream", "ret", "start", "size", "ZipDeflate", "options", "z", "bufsize", "getMaximumCompressedSize", "data", "onprogress", "lastIndex", "bufferIndex", "bufferSize", "buffers", "chunk", "uncompressedSize", "deflate_default", "inflate_mask", "MANY", "Z_NO_FLUSH", "Z_FINISH", "fixed_bl", "fixed_bd", "fixed_tl", "fixed_td", "cplens", "cplext", "cpdist", "cpdext", "BMAX", "InfTree", "that", "hn", "v", "c", "r", "u", "x", "huft_build", "b", "bindex", "n", "s", "d", "e", "t", "m", "hp", "a", "f", "g", "h", "i", "j", "k", "l", "mask", "p", "q", "w", "xp", "y", "z", "initWorkArea", "vsize", "bb", "tb", "result", "nl", "nd", "bl", "bd", "tl", "td", "START", "LEN", "LENEXT", "DIST", "DISTEXT", "COPY", "LIT", "WASH", "END", "BADCODE", "InfCodes", "mode", "len", "tree", "tree_index", "need", "lit", "get", "dist", "lbits", "dbits", "ltree", "ltree_index", "dtree", "dtree_index", "inflate_fast", "tl_index", "td_index", "tp", "tp_index", "ml", "md", "tp_index_t_3", "tindex", "border", "TYPE", "LENS", "STORED", "TABLE", "BTREE", "DTREE", "CODES", "DRY", "DONELOCKS", "BADBLOCKS", "InfBlocks", "left", "table", "index", "blens", "codes", "last", "hufts", "check", "inftree", "bl_", "bd_", "tl_", "td_", "start", "PRESET_DICT", "Z_DEFLATED", "METHOD", "FLAG", "DICT4", "DICT3", "DICT2", "DICT1", "DICT0", "BLOCKS", "DONE", "BAD", "mark", "Inflate", "inflateReset", "istate", "dictionary", "dictLength", "length", "ZStream", "bits", "ret", "size", "ZipInflate", "options", "bufsize", "flush", "buf", "nomoreinput", "data", "onprogress", "buffers", "err", "array", "lastIndex", "bufferIndex", "bufferSize", "chunk", "inflate_default", "DEFAULT_CONFIGURATION", "config", "getConfiguration", "config", "configure", "configuration", "table", "i", "j", "Crc32", "crc", "data", "offset", "length", "crc32_default", "encode_text_default", "encodeText", "value", "result", "i", "bitArray", "a1", "a2", "last", "shift", "a", "l", "x", "len", "_end", "carry", "out", "i", "last2", "shift2", "codec", "arr", "byteLength", "tmp", "bytes", "hash", "sha1", "data", "b", "ol", "nl", "c", "j", "h", "t", "d", "n", "words", "w", "e", "cipher", "key", "aes", "sbox", "decTable", "keyLen", "encKey", "decKey", "rcon", "encTable", "sboxInv", "th", "xInv", "x2", "x4", "x8", "s", "tDec", "tEnc", "input", "dir", "nInnerRounds", "table", "t0", "t1", "t2", "t3", "kIndex", "b2", "c2", "random", "typedArray", "r", "m_w", "m_z", "mask", "rcache", "_r", "mode", "prf", "iv", "word", "b1", "b3", "counter", "bl", "misc", "password", "salt", "count", "length", "u", "ui", "k", "arrayBuffer", "outLength", "hmac", "Hash", "exKey", "bs", "result", "ERR_INVALID_PASSWORD", "BLOCK_LENGTH", "RAW_FORMAT", "PBKDF2_ALGORITHM", "HASH_ALGORITHM", "HASH_FUNCTION", "BASE_KEY_ALGORITHM", "DERIVED_BITS_ALGORITHM", "DERIVED_BITS_USAGE", "SALT_LENGTH", "KEY_LENGTH", "SIGNATURE_LENGTH", "COUNTER_DEFAULT_VALUE", "CRYPTO_API_SUPPORTED", "SUBTLE_API_SUPPORTED", "codecBytes", "codec", "Aes", "cipher", "CtrGladman", "mode", "HmacSha1", "misc", "AESDecrypt", "password", "signed", "strength", "input", "aesCrypto", "preamble", "subarray", "createDecryptionKeys", "output", "append", "pendingInput", "chunkToDecrypt", "originalSignature", "decryptedChunkArray", "encryptedChunk", "decryptedChunk", "valid", "signature", "indexSignature", "AESEncrypt", "createEncryptionKeys", "encryptedChunkArray", "concat", "append", "aesCrypto", "input", "output", "paddingStart", "paddingEnd", "verifySignature", "inputLength", "concat", "expand", "BLOCK_LENGTH", "offset", "inputChunk", "codecBytes", "subarray", "outputChunk", "createDecryptionKeys", "decrypt", "preambleArray", "password", "createKeys", "SALT_LENGTH", "passwordVerification", "passwordVerificationKey", "ERR_INVALID_PASSWORD", "createEncryptionKeys", "encrypt", "salt", "getRandomValues", "target", "encodedPassword", "encode_text_default", "basekey", "importKey", "RAW_FORMAT", "BASE_KEY_ALGORITHM", "DERIVED_BITS_USAGE", "derivedBits", "deriveBits", "DERIVED_BITS_ALGORITHM", "KEY_LENGTH", "compositeKey", "array", "CRYPTO_API_SUPPORTED", "random", "format", "algorithm", "extractable", "keyUsages", "SUBTLE_API_SUPPORTED", "misc", "baseKey", "length", "leftArray", "rightArray", "inputArray", "begin", "end", "HEADER_LENGTH", "ZipCryptoDecrypt", "password", "passwordVerification", "zipCrypto", "createKeys", "input", "decryptedHeader", "decrypt", "ERR_INVALID_PASSWORD", "ZipCryptoEncrypt", "output", "offset", "header", "encrypt", "decrypt", "target", "input", "output", "index", "getByte", "updateKeys", "encrypt", "createKeys", "password", "crc32_default", "byte", "getInt32", "getInt8", "temp", "number", "CODEC_DEFLATE", "CODEC_INFLATE", "ERR_INVALID_SIGNATURE", "Inflate", "codecConstructor", "signature", "password", "signed", "compressed", "zipCrypto", "passwordVerification", "encryptionStrength", "chunkSize", "encrypted", "crc32_default", "ZipCryptoDecrypt", "AESDecrypt", "data", "codec", "result", "dataViewSignature", "Deflate", "level", "ZipCryptoEncrypt", "AESEncrypt", "inputData", "newData", "createCodec", "codecConstructor", "options", "config", "CODEC_DEFLATE", "Deflate", "CODEC_INFLATE", "Inflate", "MESSAGE_INIT", "MESSAGE_APPEND", "MESSAGE_FLUSH", "MESSAGE_EVENT_TYPE", "classicWorkersSupported", "codec_pool_worker_default", "workerData", "codecConstructor", "options", "config", "onTaskFinished", "webWorker", "scripts", "createWebWorkerInterface", "createWorkerInterface", "interfaceCodec", "createCodec", "data", "error", "messageTask", "workerOptions", "getWorker", "onMessage", "initAndSendMessage", "baseURL", "url", "scriptUrl", "message", "sendMessage", "worker", "result", "resolve", "reject", "event", "reponseError", "type", "pool", "pendingRequests", "createCodec", "codecConstructor", "options", "config", "webWorker", "scripts", "pool", "workerData", "codec_pool_worker_default", "onTaskFinished", "clearTerminateTimeout", "resolve", "pendingRequests", "data", "ERR_ABORT", "processData", "codec", "reader", "writer", "offset", "inputLengthGetter", "config", "options", "chunkSize", "processChunk", "chunkOffset", "outputLength", "signal", "inputLength", "testAborted", "inputData", "chunkLength", "data", "writeData", "result", "ERR_ABORT", "CONTENT_TYPE_TEXT_PLAIN", "Stream", "Reader", "Writer", "array", "TextReader", "text", "BlobReader", "CONTENT_TYPE_TEXT_PLAIN", "offset", "length", "TextWriter", "encoding", "reader", "resolve", "reject", "event", "Data64URIWriter", "Writer", "contentType", "array", "indexArray", "dataString", "delta", "BlobReader", "Reader", "blob", "offset", "length", "reader", "resolve", "reject", "event", "BlobWriter", "initArrayBuffers", "flushArrayBuffers", "blobWriter", "DIRECTORY_SIGNATURE", "MAX_DATE", "MIN_DATE", "CP437", "cp437_decode_default", "stringValue", "result", "indexCharacter", "decode_text_default", "decodeText", "value", "encoding", "cp437_decode_default", "fileReader", "resolve", "reject", "event", "PROPERTY_NAMES", "Entry", "data", "name", "ERR_BAD_FORMAT", "ERR_EOCDR_NOT_FOUND", "ERR_EOCDR_ZIP64_NOT_FOUND", "ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND", "ERR_CENTRAL_DIRECTORY_NOT_FOUND", "ERR_LOCAL_FILE_HEADER_NOT_FOUND", "ERR_EXTRAFIELD_ZIP64_NOT_FOUND", "ERR_ENCRYPTED", "ERR_UNSUPPORTED_ENCRYPTION", "ERR_UNSUPPORTED_COMPRESSION", "CHARSET_UTF8", "CHARSET_CP437", "ZIP64_PROPERTIES", "ZipReader", "reader", "options", "getConfiguration", "zipReader", "endOfDirectoryInfo", "seekSignature", "endOfDirectoryView", "getDataView", "directoryDataLength", "getUint32", "directoryDataOffset", "filesLength", "getUint16", "prependedDataLength", "endOfDirectoryLocatorArray", "readUint8Array", "endOfDirectoryLocatorView", "getBigUint64", "endOfDirectoryArray", "expectedDirectoryDataOffset", "originalDirectoryDataOffset", "offset", "directoryArray", "directoryView", "indexFile", "fileEntry", "ZipEntry", "readCommonHeader", "languageEncodingFlag", "filenameOffset", "extraFieldOffset", "commentOffset", "versionMadeBy", "msDosCompatible", "getUint8", "endOffset", "filenameEncoding", "getOptionValue", "commentEncoding", "filename", "comment", "decode_text_default", "DIRECTORY_SIGNATURE", "readCommonFooter", "entry", "Entry", "writer", "entries", "iter", "curr", "ZipEntry", "reader", "config", "options", "writer", "fileEntry", "zipEntry", "offset", "extraFieldAES", "compressionMethod", "bitFlag", "signature", "rawLastModDate", "compressedSize", "localDirectory", "dataArray", "readUint8Array", "dataView", "getDataView", "password", "getOptionValue", "ERR_UNSUPPORTED_COMPRESSION", "getUint32", "ERR_LOCAL_FILE_HEADER_NOT_FOUND", "readCommonHeader", "readCommonFooter", "encrypted", "zipCrypto", "ERR_UNSUPPORTED_ENCRYPTION", "ERR_ENCRYPTED", "codec", "createCodec", "CODEC_INFLATE", "signal", "dataOffset", "processData", "directory", "rawBitFlag", "getUint16", "getDate", "rawExtraField", "extraField", "rawExtraFieldView", "offsetExtraField", "type", "size", "extraFieldZip64", "readExtraFieldZip64", "extraFieldUnicodePath", "readExtraFieldUnicode", "extraFieldUnicodeComment", "readExtraFieldAES", "extraFieldNTFS", "readExtraFieldNTFS", "extraFieldExtendedTimestamp", "readExtraFieldExtendedTimestamp", "extraFieldView", "indexValue", "getBigUint64", "missingProperties", "ZIP64_PROPERTIES", "propertyName", "indexMissingProperty", "ERR_EXTRAFIELD_ZIP64_NOT_FOUND", "extraFieldUnicode", "rawPropertyName", "getUint8", "crc32", "crc32_default", "dataViewSignature", "decode_text_default", "strength", "tag1Data", "tagValue", "attributeSize", "tag1View", "rawLastAccessDate", "rawCreationDate", "lastModDate", "getDateNTFS", "lastAccessDate", "creationDate", "extraFieldData", "flags", "timeProperties", "timeRawProperties", "indexProperty", "time", "seekSignature", "startOffset", "minimumBytes", "maximumLength", "signatureArray", "signatureView", "setUint32", "maximumBytes", "seek", "length", "bytes", "indexByte", "zipReader", "name", "timeRaw", "date", "view", "value", "array", "ERR_DUPLICATED_NAME", "ERR_INVALID_COMMENT", "ERR_INVALID_ENTRY_COMMENT", "ERR_INVALID_ENTRY_NAME", "ERR_INVALID_VERSION", "ERR_INVALID_ENCRYPTION_STRENGTH", "ERR_INVALID_EXTRAFIELD_TYPE", "ERR_INVALID_EXTRAFIELD_DATA", "ERR_UNSUPPORTED_FORMAT", "EXTRAFIELD_DATA_AES", "EXTRAFIELD_LENGTH_ZIP64", "workers", "ZipWriter", "writer", "options", "getConfiguration", "name", "reader", "zipWriter", "promiseAddFile", "addFile", "pendingEntry", "resolve", "reject", "comment", "closeFile", "addFile", "zipWriter", "name", "reader", "options", "DIRECTORY_SIGNATURE", "ERR_DUPLICATED_NAME", "rawFilename", "encode_text_default", "ERR_INVALID_ENTRY_NAME", "comment", "rawComment", "ERR_INVALID_ENTRY_COMMENT", "version", "ERR_INVALID_VERSION", "versionMadeBy", "lastModDate", "getOptionValue", "lastAccessDate", "creationDate", "password", "encryptionStrength", "zipCrypto", "ERR_INVALID_ENCRYPTION_STRENGTH", "rawExtraField", "extraField", "extraFieldSize", "offset", "data", "type", "ERR_INVALID_EXTRAFIELD_TYPE", "ERR_INVALID_EXTRAFIELD_DATA", "arraySet", "extendedTimestamp", "maximumCompressedSize", "keepOrder", "uncompressedSize", "msDosCompatible", "internalFileAttribute", "externalFileAttribute", "getMaximumCompressedSize", "zip64", "ERR_UNSUPPORTED_FORMAT", "level", "useWebWorkers", "bufferedWrite", "dataDescriptor", "dataDescriptorSignature", "signal", "fileEntry", "getFileEntry", "Entry", "files", "writer", "previousFileEntry", "resolveLockUnbufferedWrite", "resolveLockCurrentFileEntry", "lockPreviousFileEntry", "fileWriter", "lockCurrentFileEntry", "resolve", "BlobWriter", "createFileEntry", "indexWrittenData", "blob", "pendingFileEntry", "arrayBuffer", "sliceAsArrayBuffer", "arrayBufferView", "setUint32", "writeBlob", "rawExtraFieldZip64View", "getDataView", "setBigUint64", "error", "config", "directory", "onprogress", "encrypted", "compressed", "rawExtraFieldAES", "EXTRAFIELD_DATA_AES", "extraFieldAESView", "setUint16", "setUint8", "rawExtraFieldNTFS", "rawExtraFieldExtendedTimestamp", "extraFieldExtendedTimestampView", "extraFieldExtendedTimestampFlag", "extraFieldNTFSView", "lastModTimeNTFS", "getTimeNTFS", "EXTRAFIELD_LENGTH_ZIP64", "bitFlag", "compressionMethod", "headerArray", "headerView", "dateArray", "dateView", "MIN_DATE", "MAX_DATE", "rawLastModDate", "extraFieldLength", "localHeaderArray", "localHeaderView", "result", "compressedSize", "codec", "createCodec", "CODEC_DEFLATE", "processData", "dataDescriptorArray", "dataDescriptorView", "dataDescriptorOffset", "signature", "length", "closeFile", "directoryDataLength", "directoryOffset", "filesLength", "directoryArray", "directoryView", "ERR_INVALID_COMMENT", "indexFileEntry", "rawExtraFieldZip64", "start", "end", "fileReader", "reject", "event", "writeSlice", "date", "view", "value", "array", "typedArray", "configure", "deflate_default", "inflate_default", "BILLBOARD_SIZE", "kmlNamespace", "gxNamespace", "xmlnsNamespace", "ExternalFileHandler", "modelCallback", "imageTypeRegex", "texture", "that", "filename", "Resource_default", "regexResult", "defined_default", "promise", "blob", "resolve", "getModelBlobHander", "model", "time", "RuntimeError_default", "externalFiles", "url", "ValueGetter", "property", "defaultVal", "result", "value", "defaultValue_default", "colorToString", "StyleCache", "element", "ids", "key", "styleId", "parentElement", "styles", "firstElement", "IdManager", "id", "createGuid_default", "exportKml", "options", "entities", "kmz", "state", "rootEntities", "entity", "kmlDoc", "kmlElement", "kmlDocumentElement", "recurseEntities", "externalFileHandler", "kmlString", "createKmz", "zWorkerUrl", "buildModuleUrl_default", "configure", "blobWriter", "BlobWriter", "writer", "ZipWriter", "TextReader", "keys", "addExternalFilesToZip", "index", "BlobReader", "styleCache", "entityAvailability", "defaultAvailability", "sampleDuration", "Iso8601_default", "TimeInterval_default", "JulianDate_default", "Ellipsoid_default", "TimeIntervalCollection_default", "parentNode", "valueGetter", "idManager", "count", "overlays", "geometries", "i", "createPoint", "createLineString", "createPolygon", "createModel", "timeSpan", "availability", "createBasicElementWithText", "overlayIndex", "overlay", "geometryCount", "placemark", "name", "labelGraphics", "labelStyle", "text", "color", "scale", "styleCount", "style", "styleIndex", "multigeometry", "geometryIndex", "children", "folderNode", "scratchCartesian3", "Cartesian3_default", "scratchCartographic", "Cartographic_default", "scratchJulianDate", "ellipsoid", "pointGraphics", "entityPositionProperty", "createTracks", "coordinates", "getCoordinates", "pointGeometry", "altitudeMode", "getAltitudeMode", "iconStyle", "BillboardGraphics_default", "createIconStyleFromBillboard", "createIconStyleFromPoint", "intervals", "useEntityPositionProperty", "CompositePositionProperty_default", "isModel", "ModelGraphics_default", "j", "times", "tracks", "interval", "positionProperty", "trackAltitudeMode", "ScaledPositionProperty_default", "HeightReference_default", "positionTimes", "positionValues", "constCoordinates", "SampledPositionProperty_default", "ReferenceFrame_default", "SampledProperty_default", "values", "duration", "stopDate", "trackGeometry", "k", "when", "coord", "createModelGeometry", "multiTrackGeometry", "path", "width", "material", "lineStyle", "processMaterial", "pixelSize", "billboardGraphics", "image", "icon", "imageSubRegion", "pixelOffset", "Cartesian2_default", "height", "horizontalOrigin", "HorizontalOrigin_default", "verticalOrigin", "VerticalOrigin_default", "hotSpot", "rotation", "alignedAxis", "Math_default", "polylineGraphics", "lineStringGeometry", "clampToGround", "altitudeModeText", "positionsProperty", "cartesians", "zIndex", "getRectangleBoundaries", "rectangleGraphics", "extrudedHeight", "coordinatesProperty", "rectangle", "coordinateStrings", "cornerFunction", "Rectangle_default", "outerBoundaryIs", "linearRing", "getLinearRing", "positions", "perPositionHeight", "positionCount", "getPolygonBoundaries", "polygonGraphics", "boundaries", "hierarchyProperty", "hierarchy", "holes", "holeCount", "innerBoundaryIs", "geometry", "isRectangle", "RectangleGraphics_default", "createGroundOverlay", "polygonGeometry", "boundaryCount", "polyStyle", "fill", "outline", "outlineWidth", "outlineColor", "Color_default", "groundOverlay", "latLonBox", "href", "modelGraphics", "modelGeometry", "scaleElement", "link", "uri", "location", "materialProperty", "type", "heightReferenceProperty", "heightReference", "elementName", "elementValue", "namespace", "bytes", "exportKml_default", "PinBuilder", "color", "size", "createPin", "url", "id", "buildModuleUrl_default", "text", "colorScratch", "Color_default", "drawPin", "context2D", "drawIcon", "image", "imageSize", "sizeX", "sizeY", "x", "y", "stringifyScratch", "label", "cache", "item", "defined_default", "canvas", "promise", "Resource_default", "writeTextToCanvas_default", "PinBuilder_default", "identity_default", "x", "transform_default", "transform", "identity_default", "x0", "y0", "kx", "ky", "dx", "dy", "input", "i", "j", "n", "output", "reverse_default", "array", "n", "t", "j", "i", "feature_default", "topology", "o", "feature", "id", "bbox", "properties", "geometry", "object", "transformPoint", "transform_default", "arcs", "arc", "i", "points", "a", "k", "n", "reverse_default", "point", "p", "line", "ring", "polygon", "type", "coordinates", "defaultCrsFunction", "coordinates", "Cartesian3_default", "crsNames", "crsLinkHrefs", "crsLinkTypes", "defaultMarkerSize", "defaultMarkerSymbol", "defaultMarkerColor", "Color_default", "defaultStroke", "defaultStrokeWidth", "defaultFill", "defaultClampToGround", "sizes", "simpleStyleIdentifiers", "defaultDescribe", "properties", "nameProperty", "html", "key", "value", "defined_default", "createDescriptionCallback", "describe", "description", "time", "result", "defaultDescribeProperty", "CallbackProperty_default", "createObject", "geoJson", "entityCollection", "id", "createGuid_default", "i", "finalId", "entity", "name", "namePropertyPrecedence", "lowerKey", "ConstantProperty_default", "coordinatesArrayToCartesianArray", "crsFunction", "positions", "geoJsonObjectTypes", "processFeature", "processFeatureCollection", "processGeometryCollection", "processLineString", "processMultiLineString", "processMultiPoint", "processMultiPolygon", "processPoint", "processPolygon", "processTopology", "geometryTypes", "dataSource", "feature", "notUsed", "options", "RuntimeError_default", "geometryType", "geometryHandler", "featureCollection", "features", "len", "geometryCollection", "geometries", "geometry", "createPoint", "symbol", "color", "size", "cssColor", "defaultValue_default", "markerSymbol", "canvasOrPromise", "billboard", "BillboardGraphics_default", "VerticalOrigin_default", "HeightReference_default", "ConstantPositionProperty_default", "promise", "image", "createLineString", "material", "widthProperty", "width", "stroke", "opacity", "ColorMaterialProperty_default", "polylineGraphics", "PolylineGraphics_default", "ArcType_default", "lineStrings", "createPolygon", "outlineColorProperty", "fillColor", "fill", "materialColor", "polygon", "PolygonGraphics_default", "holes", "PolygonHierarchy_default", "polygons", "property", "feature_default", "typeHandler", "GeoJsonDataSource", "Event_default", "EntityCollection_default", "PinBuilder_default", "EntityCluster_default", "data", "preload", "that", "clear", "DataSource_default", "credit", "Credit_default", "sourceUri", "Resource_default", "resourceCredits", "credits", "length", "load", "error", "getFilenameFromUri_default", "crs", "handler", "GeoJsonDataSource_default", "version", "defaults", "dest", "src", "prop", "ellipsis", "str", "truncateLen", "ellipsisChars", "ellipsisLength", "indexOf", "arr", "element", "i", "len", "remove", "fn", "splitAndCapture", "splitRegex", "result", "lastIdx", "match", "throwUnhandledCaseError", "theValue", "HtmlTag", "cfg", "tagName", "attrName", "attrValue", "tagAttrs", "attrs", "cssClass", "classAttr", "whitespaceRegex", "classes", "newClasses", "newClass", "indexOf", "removeClasses", "removeClass", "idx", "html", "attrsStr", "attrsArr", "prop", "truncateSmart", "url", "truncateLen", "ellipsisChars", "ellipsisLengthBeforeParsing", "ellipsisLength", "parse_url", "urlObj", "urlSub", "match", "buildUrl", "buildSegment", "segment", "remainingAvailableLength", "remainingAvailableLengthHalf", "startOffset", "endOffset", "end", "availableLength", "matchQuery", "str", "pathAndQuery", "fragment", "remainingAvailableLength2", "scheme", "truncateMiddle", "url", "truncateLen", "ellipsisChars", "ellipsisLengthBeforeParsing", "ellipsisLength", "availableLength", "end", "truncateEnd", "anchorText", "truncateLen", "ellipsisChars", "ellipsis", "AnchorTagBuilder", "cfg", "match", "HtmlTag", "attrs", "cssClass", "className", "returnClasses", "cssClassSuffixes", "i", "len", "anchorText", "truncate", "truncateLength", "truncateLocation", "truncateSmart", "truncateMiddle", "truncateEnd", "Match", "cfg", "offset", "extendStatics", "d", "b", "p", "__extends", "__", "__assign", "s", "n", "EmailMatch", "_super", "__extends", "cfg", "_this", "Match", "HashtagMatch", "_super", "__extends", "cfg", "_this", "serviceName", "hashtag", "Match", "MentionMatch", "_super", "__extends", "cfg", "_this", "cssClassSuffixes", "serviceName", "Match", "PhoneMatch", "_super", "__extends", "cfg", "_this", "Match", "UrlMatch", "_super", "__extends", "cfg", "_this", "url", "anchorText", "text", "preProcessedEntityAnchorText", "Match", "Matcher", "cfg", "letterRe", "digitRe", "nonDigitRe", "whitespaceRe", "quoteRe", "controlCharsRe", "alphaCharsStr", "emojiStr", "marksStr", "alphaCharsAndMarksStr", "decimalNumbersStr", "alphaNumericCharsStr", "alphaNumericAndMarksCharsStr", "alphaNumericAndMarksCharRe", "ipStr", "domainLabelStr", "getDomainLabelStr", "group", "getDomainNameStr", "domainNameRegex", "domainNameCharRegex", "tldRegex", "localPartCharRegex", "alphaNumericAndMarksCharsStr", "strictTldRegex", "tldRegex", "EmailMatcher", "_super", "__extends", "_this", "text", "tagBuilder", "matches", "len", "noCurrentEmailMatch", "CurrentEmailMatch", "mailtoTransitions", "charIdx", "state", "currentEmailMatch", "char", "stateNonEmailAddress", "stateMailTo", "stateLocalPart", "stateLocalPartDot", "stateAtSign", "stateDomainChar", "stateDomainHyphen", "stateDomainDot", "throwUnhandledCaseError", "captureMatchIfValidAndReset", "beginEmailMatch", "prevChar", "__assign", "resetToNonEmailMatchState", "domainNameCharRegex", "newState", "matchedText", "emailAddress", "doesEmailHaveValidTld", "EmailMatch", "emailAddressTld", "emailAddressNormalized", "isValidTld", "Matcher", "CurrentEmailMatch", "cfg", "UrlMatchValidator", "urlMatch", "protocolUrlMatch", "uriSchemeMatch", "newRegex", "uriScheme", "stringBeforeSlash", "uriSchemeMatchArr", "alphaCharsStr", "matcherRegex", "schemeRegex", "wwwRegex", "urlSuffixRegex", "alphaNumericAndMarksCharsStr", "getDomainNameStr", "tldRegex", "alphaNumericCharsStr", "wordCharRegExp", "UrlMatcher", "_super", "__extends", "cfg", "_this", "text", "stripPrefix", "stripTrailingSlash", "decodePercentEncoding", "tagBuilder", "matches", "match", "matchStr", "schemeUrlMatch", "wwwUrlMatch", "wwwProtocolRelativeMatch", "tldProtocolRelativeMatch", "offset", "protocolRelativeMatch", "prevChar", "UrlMatchValidator", "this_1", "pos", "foundCommonScheme", "commonScheme", "indexOfSchemeStart", "urlMatchType", "protocolUrlMatch", "UrlMatch", "endChar", "startChar", "numOpenBraces", "i", "len", "char", "urlMatch", "re", "res", "Matcher", "hashtagTextCharRe", "alphaNumericAndMarksCharsStr", "HashtagMatcher", "_super", "__extends", "cfg", "_this", "text", "tagBuilder", "serviceName", "matches", "len", "charIdx", "hashCharIdx", "state", "char", "stateNone", "stateNonHashtagWordChar", "stateHashtagHashChar", "stateHashtagTextChar", "throwUnhandledCaseError", "captureMatchIfValid", "alphaNumericAndMarksCharRe", "matchedText", "match", "HashtagMatch", "Matcher", "hashtagServices", "mostPhoneNumbers", "japanesePhoneRe", "phoneMatcherRegex", "PhoneMatcher", "_super", "__extends", "_this", "text", "matcherRegex", "tagBuilder", "matches", "match", "matchedText", "cleanNumber", "plusSign", "before", "after", "contextClear", "PhoneMatch", "nonDigitRe", "Matcher", "twitterRegex", "alphaNumericAndMarksCharsStr", "instagramRegex", "soundcloudRegex", "tiktokRegex", "nonWordCharRegex", "MentionMatcher", "_super", "__extends", "cfg", "_this", "text", "serviceName", "matcherRegex", "tagBuilder", "matches", "match", "offset", "prevChar", "matchedText", "mention", "MentionMatch", "Matcher", "parseHtml", "html", "_a", "onOpenTag", "onCloseTag", "onText", "onComment", "onDoctype", "noCurrentTag", "CurrentTag", "charIdx", "len", "state", "currentDataIdx", "currentTag", "char", "stateData", "stateTagOpen", "stateEndTagOpen", "stateTagName", "stateBeforeAttributeName", "stateAttributeName", "stateAfterAttributeName", "stateBeforeAttributeValue", "stateAttributeValueDoubleQuoted", "stateAttributeValueSingleQuoted", "stateAttributeValueUnquoted", "stateAfterAttributeValueQuoted", "stateSelfClosingStartTag", "stateMarkupDeclarationOpen", "stateCommentStart", "stateCommentStartDash", "stateComment", "stateCommentEndDash", "stateCommentEnd", "stateCommentEndBang", "stateDoctype", "throwUnhandledCaseError", "emitText", "startNewTag", "__assign", "letterRe", "whitespaceRe", "captureTagName", "emitTagAndPreviousTextNode", "digitRe", "resetToDataState", "quoteRe", "controlCharsRe", "reconsumeCurrentCharacter", "textBeforeTag", "text", "startIdx", "cfg", "Autolinker", "cfg", "mention", "hashtag", "hashtagServices", "textOrHtml", "options", "autolinker", "urls", "stripPrefix", "truncate", "defaults", "_this", "skipTagNames", "skipTagsStackCount", "matches", "parseHtml", "tagName", "text", "offset", "htmlCharacterEntitiesRegex", "textSplit", "splitAndCapture", "currentOffset_1", "splitText", "i", "textNodeMatches", "a", "b", "match", "matchedTextLength", "endIdx", "removeIdx", "remove", "m", "matchers", "numMatchers", "textMatches", "j", "numTextMatches", "newHtml", "lastIndex", "len", "replaceFnResult", "HtmlTag", "anchorTag", "tagBuilder", "HashtagMatcher", "EmailMatcher", "PhoneMatcher", "MentionMatcher", "UrlMatcher", "AnchorTagBuilder", "version", "Matcher", "EmailMatch", "HashtagMatch", "Match", "MentionMatch", "PhoneMatch", "UrlMatch", "es2015_default", "autolinker_default", "parser", "autolinker", "es2015_default", "linker", "match", "BILLBOARD_SIZE", "BILLBOARD_NEAR_DISTANCE", "BILLBOARD_NEAR_RATIO", "BILLBOARD_FAR_DISTANCE", "BILLBOARD_FAR_RATIO", "gpxNamespaces", "namespaces", "readBlobAsText", "blob", "resolve", "reject", "reader", "getOrCreateEntity", "node", "entityCollection", "id", "queryStringAttribute", "defined_default", "createGuid_default", "readCoordinateFromNode", "longitude", "queryNumericAttribute", "latitude", "elevation", "queryNumericValue", "Cartesian3_default", "attributeName", "value", "result", "queryFirstNode", "tagName", "namespace", "childNodes", "length", "q", "child", "queryNodes", "resultNode", "queryStringValue", "createDefaultBillboard", "image", "billboard", "BillboardGraphics_default", "NearFarScalar_default", "ConstantProperty_default", "VerticalOrigin_default", "createDefaultLabel", "label", "LabelGraphics_default", "Cartesian2_default", "HorizontalOrigin_default", "LabelStyle_default", "createDefaultPolyline", "color", "polyline", "PolylineGraphics_default", "PolylineOutlineMaterialProperty_default", "Color_default", "descriptiveInfoTypes", "scratchDiv", "processDescription", "entity", "i", "text", "infoTypeNames", "infoTypeName", "infoType", "defaultValue_default", "links", "background", "foreground", "tmp", "processWpt", "dataSource", "geometryNode", "options", "position", "name", "HeightReference_default", "processRte", "routePoints", "coordinateTuples", "processTrk", "trackSegs", "positions", "times", "trackSegInfo", "isTimeDynamic", "property", "SampledPositionProperty_default", "processTrkSeg", "TimeIntervalCollection_default", "TimeInterval_default", "trackPoints", "time", "JulianDate_default", "processMetadata", "metadataNode", "metadata", "getPerson", "getCopyright", "getLink", "getBounds", "personNode", "person", "getEmail", "emailNode", "domain", "linkNode", "link", "copyrightNode", "copyright", "boundsNode", "bounds", "complexTypes", "processGpx", "complexTypeNames", "complexTypeNamesLength", "typeName", "processComplexTypeNode", "loadGpx", "gpx", "element", "version", "creator", "clock", "availability", "start", "stop", "isMinStart", "Iso8601_default", "isMaxStop", "date", "DataSourceClock_default", "ClockRange_default", "ClockStep_default", "changed", "metadataChanged", "DataSource_default", "old", "current", "load", "data", "promise", "Resource_default", "resourceCredits", "credits", "dataToLoad", "error", "e", "msg", "RuntimeError_default", "GpxDataSource", "Event_default", "EntityCollection_default", "EntityCluster_default", "PinBuilder_default", "DeveloperError_default", "oldName", "that", "GpxDataSource_default", "KmlCamera", "position", "headingPitchRoll", "KmlCamera_default", "import_urijs", "getElement", "element", "getElement_default", "KmlLookAt", "position", "headingPitchRange", "KmlLookAt_default", "KmlTour", "name", "id", "Event_default", "entry", "viewer", "cameraOptions", "tour", "playEntry", "terminated", "cancelAllEntries", "activeEntries", "allDone", "_playNext", "playNext", "indx", "defined_default", "KmlTour_default", "Easing", "amount", "s", "now", "time", "now$1", "Group", "_this", "tweenId", "tween", "preserve", "tweenIds", "i", "autoStart", "Interpolation", "v", "k", "m", "f", "fn", "b", "n", "pw", "bn", "p0", "p1", "t", "fc", "a", "p2", "p3", "v0", "v1", "t2", "t3", "Sequence", "mainGroup", "Tween", "_object", "_group", "properties", "duration", "d", "property", "_valuesStart", "_valuesEnd", "_valuesStartRepeat", "startValue", "startValueIsArray", "propType", "isInterpolationList", "endValues", "prop", "numChainedTweens", "group", "times", "yoyo", "easingFunction", "interpolationFunction", "tweens", "_i", "callback", "elapsed", "endTime", "value", "start", "end", "startIsArray", "endIsArray", "tmp", "endValue", "nextId", "Sequence", "TWEEN", "mainGroup", "getAll", "removeAll", "add", "remove", "update", "EasingFunction", "Easing", "EasingFunction_default", "KmlTourFlyTo", "duration", "flyToMode", "view", "done", "camera", "cameraOptions", "defined_default", "self", "terminated", "options", "target", "BoundingSphere_default", "EasingFunction_default", "combine_default", "KmlTourFlyTo_default", "KmlTourWait", "duration", "done", "self", "defined_default", "KmlTourWait_default", "MimeTypes", "filename", "ext", "getExtensionFromUri_default", "parser", "autolinker", "es2015_default", "match", "BILLBOARD_SIZE", "BILLBOARD_NEAR_DISTANCE", "BILLBOARD_NEAR_RATIO", "BILLBOARD_FAR_DISTANCE", "BILLBOARD_FAR_RATIO", "kmlNamespaces", "gxNamespaces", "atomNamespaces", "namespaces", "featureTypes", "processDocument", "processFolder", "processPlacemark", "processNetworkLink", "processGroundOverlay", "processUnsupportedFeature", "processScreenOverlay", "processTour", "DeferredLoading", "dataSource", "defer_default", "nodes", "processingData", "promise", "deferred", "isFirstCall", "KmlDataSource", "that", "stack", "top", "index", "child", "defined_default", "featureProcessor", "isZipFile", "blob", "magicBlob", "reader", "readBlobAsText", "insertNamespaces", "text", "namespaceMap", "firstPart", "lastPart", "reg", "declaration", "key", "removeDuplicateNamespaces", "endDeclaration", "namespace", "startIndex", "endIndex", "loadXmlFromZip", "entry", "uriResolver", "TextWriter", "loadDataUriFromZip", "mimeType", "defaultValue_default", "Data64URIWriter", "dataUri", "embedDataUris", "div", "elementType", "attributeName", "keys", "baseUri", "Uri", "elements", "i", "element", "value", "uri", "applyBasePath", "sourceResource", "resource", "resolveHref", "createEntity", "node", "entityCollection", "context", "id", "queryStringAttribute", "createGuid_default", "entity", "Entity_default", "KmlFeatureData", "isExtrudable", "altitudeMode", "gxAltitudeMode", "readCoordinate", "ellipsoid", "Cartesian3_default", "digits", "longitude", "latitude", "height", "readCoordinates", "tuples", "length", "result", "resultIndex", "queryNumericAttribute", "queryFirstNode", "tagName", "childNodes", "q", "queryNodes", "queryChildNodes", "queryNumericValue", "resultNode", "queryStringValue", "queryBooleanValue", "href", "Resource_default", "colorOptions", "parseColorString", "isRandom", "alpha", "blue", "green", "red", "Color_default", "queryColorValue", "processTimeStamp", "featureNode", "whenString", "when", "JulianDate_default", "TimeIntervalCollection_default", "TimeInterval_default", "Iso8601_default", "processTimeSpan", "beginNode", "beginDate", "endNode", "endDate", "tmp", "createDefaultBillboard", "billboard", "BillboardGraphics_default", "NearFarScalar_default", "createDefaultPolygon", "polygon", "PolygonGraphics_default", "createDefaultLabel", "label", "LabelGraphics_default", "Cartesian2_default", "HorizontalOrigin_default", "LabelStyle_default", "getIconHref", "iconNode", "canRefresh", "palette", "x", "y", "iconNum", "hrefResource", "refreshMode", "viewRefreshMode", "oneTimeWarning_default", "viewBoundScale", "defaultViewFormat", "viewFormat", "httpQuery", "queryToObject_default", "cleanupString", "processNetworkLinkQueryString", "processBillboardIcon", "targetEntity", "scale", "heading", "color", "icon", "w", "h", "hotSpotNode", "hotSpotX", "hotSpotY", "hotSpotXUnit", "hotSpotYUnit", "BoundingRectangle_default", "Math_default", "xOffset", "yOffset", "applyStyle", "styleNode", "len", "polyline", "PolylineGraphics_default", "bgColor", "textColor", "listItemType", "computeFinalStyle", "placeMark", "styleCollection", "styleEntity", "styleIndex", "inlineStyleNode", "pairs", "p", "pair", "styleUrl", "externalStyle", "tokens", "processExternalStyles", "styleKml", "processStyles", "kml", "isExternal", "styleNodes", "styleNodesLength", "styleMaps", "styleMapsLength", "styleMap", "base", "promises", "styleUrlNodes", "styleUrlNodesLength", "styleReference", "createDropLine", "entityPosition", "ReferenceProperty_default", "surfacePosition", "ScaledPositionProperty_default", "PositionPropertyArray_default", "heightReferenceFromAltitudeMode", "HeightReference_default", "createPositionPropertyFromAltitudeMode", "property", "createPositionPropertyArrayFromAltitudeMode", "properties", "propertiesLength", "processPositionGraphics", "heightReference", "processPathGraphics", "path", "PathGraphics_default", "processPoint", "geometryNode", "coordinatesString", "extrude", "position", "processLineStringOrLinearRing", "coordinatesNode", "tessellate", "canExtrude", "zIndex", "coordinates", "wall", "WallGraphics_default", "polylineGraphics", "ArcType_default", "processPolygon", "outerBoundaryIsNode", "linearRingNode", "hierarchy", "PolygonHierarchy_default", "innerBoundaryIsNodes", "j", "k", "processTrack", "coordNodes", "angleNodes", "timeNodes", "times", "SampledPositionProperty_default", "addToMultiTrack", "positions", "composite", "availability", "dropShowProperty", "includeEndPoints", "start", "stop", "data", "processMultiTrack", "interpolate", "trackNodes", "lastStop", "lastStopPosition", "needDropLine", "TimeIntervalCollectionProperty_default", "CompositePositionProperty_default", "trackNode", "geometryTypes", "processMultiGeometry", "processUnsupportedGeometry", "hasGeometry", "childNode", "geometryProcessor", "childEntity", "processExtendedData", "extendedDataNode", "dataNodes", "dataNode", "name", "scratchDiv", "processDescription", "kmlData", "extendedData", "description", "balloonStyle", "background", "foreground", "matches", "token", "propertyName", "isDisplayName", "links", "processFeature", "parent", "mergeAvailabilityWithParent", "ancestryIsVisible", "parentEntity", "visibility", "authorNode", "author", "linkNode", "link", "processLookAt", "processCamera", "deferredLoading", "r", "newProcessingData", "clone_default", "placemark", "playlistNodeProcessors", "processTourFlyTo", "processTourWait", "processTourUnsupportedNode", "tour", "KmlTour_default", "playlistNode", "entryNode", "playlistNodeProcessor", "duration", "KmlTourWait_default", "flyToMode", "t", "view", "flyto", "KmlTourFlyTo_default", "camera", "lon", "lat", "altitude", "tilt", "roll", "hpr", "HeadingPitchRoll_default", "KmlCamera_default", "lookAt", "range", "HeadingPitchRange_default", "viewPoint", "KmlLookAt_default", "screenOverlayNode", "screenOverlay", "img", "styles", "screenXY", "overlayXY", "size", "xUnit", "yUnit", "xStyle", "yStyle", "xOrigin", "yOrigin", "groundOverlay", "geometry", "isLatLonQuad", "RectangleGraphics_default", "latLonBox", "west", "south", "east", "north", "Rectangle_default", "rotation", "rotationRadians", "RefreshMode", "s", "sFirst", "zeroRectangle", "scratchCartographic", "Cartographic_default", "scratchCartesian2", "scratchCartesian3", "canvas", "bbox", "fixLatitude", "fixLongitude", "queryString", "objectToQuery_default", "SceneMode_default", "centerCartesian", "centerCartographic", "newHalfWidth", "newHalfHeight", "frustum", "aspectRatio", "horizFov", "vertFov", "fov", "networkEntity", "newSourceUri", "options", "networkLinkCollection", "EntityCollection_default", "load", "rootElement", "entities", "newEntities", "newEntity", "refreshInterval", "networkLinkControl", "hasNetworkLinkControl", "now", "networkLinkInfo", "minRefreshPeriod", "expires", "date", "diff", "error", "processFeatureNode", "loadKml", "screenOverlayContainer", "documentElement", "document", "getFilenameFromUri_default", "loadKmz", "zWorkerUrl", "buildModuleUrl_default", "configure", "ZipReader", "BlobReader", "entries", "docEntry", "RuntimeError_default", "sourceUri", "resourceCredits", "credits", "getElement_default", "dataToLoad", "isZip", "e", "msg", "Event_default", "PinBuilder_default", "AssociativeArray_default", "EntityCluster_default", "Ellipsoid_default", "credit", "Credit_default", "DataSource_default", "oldName", "clock", "isMinStart", "isMaxStop", "DataSourceClock_default", "ClockRange_default", "ClockStep_default", "changed", "parentAvailability", "childAvailability", "getNetworkLinkUpdateCallback", "networkLink", "newEntityCollection", "networkLinks", "processedHref", "remove", "networkLinkEntity", "removeChildren", "children", "count", "entitiesCopy", "entityToRemove", "entitiesToIgnore", "time", "recurseIgnoreEntities", "cameraViewUpdate", "lastCameraView", "newNetworkLinks", "doUpdate", "getTimestamp_default", "KmlDataSource_default", "Visualizer", "DeveloperError_default", "Visualizer_default", "ViewportQuadVS_default", "ComputeEngine", "context", "renderStateScratch", "drawCommandScratch", "DrawCommand_default", "PrimitiveType_default", "clearCommandScratch", "ClearCommand_default", "Color_default", "createFramebuffer", "outputTexture", "Framebuffer_default", "createViewportQuadShader", "fragmentShaderSource", "ShaderProgram_default", "ViewportQuadVS_default", "createRenderState", "width", "height", "defined_default", "RenderState_default", "BoundingRectangle_default", "computeCommand", "vertexArray", "shaderProgram", "framebuffer", "renderState", "uniformMap", "clearCommand", "drawCommand", "destroyObject_default", "ComputeEngine_default", "PassState", "context", "PassState_default", "ShaderCache", "context", "options", "defined_default", "toSortedJson", "dictionary", "sortedKeys", "vertexShaderSource", "fragmentShaderSource", "attributeLocations", "ShaderSource_default", "vertexShaderKey", "fragmentShaderKey", "attributeLocationKey", "keyword", "cachedShader", "vertexShaderText", "fragmentShaderText", "shaderProgram", "ShaderProgram_default", "derivedKeyword", "cachedDerivedShader", "destroyShader", "index", "derivedShaderProgram", "derivedCachedShader", "cache", "derivedKeywords", "length", "i", "shadersToRelease", "shaders", "destroyObject_default", "ShaderCache_default", "TextureCache", "keyword", "cachedTexture", "defined_default", "texture", "that", "texturesToRelease", "textures", "destroyObject_default", "TextureCache_default", "Simon1994PlanetaryPositions", "computeTdbMinusTtSpice", "daysSinceJ2000InTerrestrialTime", "g", "TdtMinusTai", "J2000d", "taiToTdb", "date", "result", "JulianDate_default", "days", "epoch", "TimeStandard_default", "MetersPerKilometer", "RadiansPerDegree", "Math_default", "RadiansPerArcSecond", "MetersPerAstronomicalUnit", "perifocalToEquatorial", "Matrix3_default", "elementsToCartesian", "semimajorAxis", "eccentricity", "inclination", "longitudeOfPerigee", "longitudeOfNode", "meanLongitude", "radiusOfPeriapsis", "argumentOfPeriapsis", "rightAscensionOfAscendingNode", "trueAnomaly", "meanAnomalyToTrueAnomaly", "type", "chooseOrbit", "perifocalToCartesianMatrix", "semilatus", "costheta", "sintheta", "denom", "radius", "defined_default", "Cartesian3_default", "tolerance", "meanAnomaly", "eccentricAnomaly", "meanAnomalyToEccentricAnomaly", "eccentricAnomalyToTrueAnomaly", "maxIterationCount", "keplerEqConvergence", "revs", "iterationValue", "count", "NRfunction", "dNRfunction", "trueAnomalyX", "trueAnomalyY", "rightAscension", "cosap", "sinap", "cosi", "sini", "cosraan", "sinraan", "semiMajorAxis0", "meanLongitude0", "meanLongitude1", "p1u", "p2u", "p3u", "p4u", "p5u", "p6u", "p7u", "p8u", "Ca1", "Ca2", "Ca3", "Ca4", "Ca5", "Ca6", "Ca7", "Ca8", "Sa1", "Sa2", "Sa3", "Sa4", "Sa5", "Sa6", "Sa7", "Sa8", "q1u", "q2u", "q3u", "q4u", "q5u", "q6u", "q7u", "q8u", "Cl1", "Cl2", "Cl3", "Cl4", "Cl5", "Cl6", "Cl7", "Cl8", "Sl1", "Sl2", "Sl3", "Sl4", "Sl5", "Sl6", "Sl7", "Sl8", "scratchDate", "computeSimonEarthMoonBarycenter", "t", "TimeConstants_default", "u", "computeSimonMoon", "t2", "t3", "t4", "inclinationConstant", "inclinationSecPart", "longitudeOfPerigeeConstant", "longitudeOfPerigeeSecPart", "longitudeOfNodeConstant", "longitudeOfNodeSecPart", "meanLongitudeConstant", "meanLongitudeSecPart", "D", "F", "l", "lprime", "psi", "twoD", "fourD", "sixD", "twol", "threel", "fourl", "twoF", "twoPsi", "threePsi", "perigeeAndMean", "moonEarthMassRatio", "factor", "computeSimonEarth", "axesTransformation", "translation", "julianDate", "Simon1994PlanetaryPositions_default", "SunLight", "options", "defaultValue_default", "Color_default", "SunLight_default", "UniformState", "BoundingRectangle_default", "Cartesian4_default", "Matrix4_default", "Cartesian2_default", "Matrix3_default", "EncodedCartesian3_default", "Cartesian3_default", "Color_default", "viewport", "v", "vc", "cleanViewport", "matrix", "m", "updateView3D", "updateInverseView3D", "cleanInverseProjection", "cleanModelView", "cleanModelView3D", "cleanModelViewRelativeToEye", "cleanInverseModelView", "cleanInverseModelView3D", "cleanViewProjection", "cleanInverseViewProjection", "cleanModelViewProjection", "cleanInverseModelViewProjection", "cleanModelViewProjectionRelativeToEye", "cleanModelViewInfiniteProjection", "cleanNormal", "cleanNormal3D", "cleanInverseNormal", "cleanInverseNormal3D", "cleanEncodedCameraPositionMC", "defaultValue_default", "Ellipsoid_default", "setView", "uniformState", "setInverseView", "setProjection", "setInfiniteProjection", "setCamera", "camera", "positionCartographic", "defined_default", "transformMatrix", "sunCartographicScratch", "Cartographic_default", "setSunAndMoonDirections", "frameState", "Transforms_default", "position", "Simon1994PlanetaryPositions_default", "projection", "sunCartographic", "SceneMode_default", "OrthographicFrustum_default", "frustum", "Math_default", "pass", "EMPTY_ARRAY", "defaultLight", "SunLight_default", "light", "lightColor", "lightColorHdr", "maximumComponent", "brdfLutGenerator", "brdfLut", "fov", "pixelSizePerMeter", "mv", "mvRte", "cameraPositionMC", "view2Dto3DPScratch", "view2Dto3DRScratch", "view2Dto3DUScratch", "view2Dto3DDScratch", "view2Dto3DCartographicScratch", "view2Dto3DCartesian3Scratch", "view2Dto3DMatrix4Scratch", "view2Dto3D", "position2D", "direction2D", "right2D", "up2D", "frustum2DWidth", "mode", "result", "p", "r", "u", "cartographic", "ellipsoid", "position3D", "enuToFixed", "that", "UniformState_default", "errorToString", "gl", "error", "message", "createErrorMessage", "glFunc", "glFuncArguments", "i", "throwOnError", "RuntimeError_default", "makeGetterSetter", "propertyName", "logFunction", "value", "wrapGL", "defined_default", "wrapFunction", "property", "result", "glWrapper", "getExtension", "names", "length", "extension", "Context", "canvas", "options", "clone_default", "defaultValue_default", "webglOptions", "requestWebgl2", "webgl2", "glContext", "getWebGLStub", "createGuid_default", "ShaderCache_default", "TextureCache_default", "ContextLimits_default", "aliasedLineWidthRange", "aliasedPointSizeRange", "maximumViewportDimensions", "highpFloat", "highpInt", "loadKTX2_default", "textureFilterAnisotropic", "glCreateVertexArray", "glBindVertexArray", "glDeleteVertexArray", "glDrawElementsInstanced", "glDrawArraysInstanced", "glVertexAttribDivisor", "glDrawBuffers", "vertexArrayObject", "instancedArrays", "drawBuffers", "that", "vao", "mode", "count", "type", "offset", "instanceCount", "first", "index", "divisor", "buffers", "vertexArray", "WebGLConstants_default", "Color_default", "us", "UniformState_default", "ps", "PassState_default", "rs", "RenderState_default", "defaultFramebufferMarker", "Texture_default", "PixelFormat_default", "face", "CubeMap_default", "applyRenderState", "context", "renderState", "passState", "clear", "previousRenderState", "previousPassState", "RenderState_default", "scratchBackBufferArray", "WebGLConstants_default", "bindFramebuffer", "framebuffer", "buffers", "defined_default", "gl", "defaultClearCommand", "ClearCommand_default", "Context", "clearCommand", "defaultValue_default", "bitmask", "c", "d", "Color_default", "rs", "beginDraw", "shaderProgram", "continueDraw", "drawCommand", "uniformMap", "primitiveType", "va", "offset", "count", "instanceCount", "Matrix4_default", "indexBuffer", "length", "readState", "x", "y", "width", "height", "pixelDatatype", "PixelDatatype_default", "pixels", "PixelFormat_default", "viewportQuadAttributeLocations", "vertexArray", "geometry", "Geometry_default", "GeometryAttribute_default", "ComponentDatatype_default", "PrimitiveType_default", "VertexArray_default", "BufferUsage_default", "fragmentShaderSource", "overrides", "DrawCommand_default", "ShaderProgram_default", "ViewportQuadVS_default", "pickColor", "PickId", "pickObjects", "key", "color", "value", "object", "RuntimeError_default", "cache", "property", "propertyValue", "destroyObject_default", "Context_default", "loadCubeMap", "context", "urls", "skipColorSpaceConversion", "flipOptions", "facePromises", "Resource_default", "images", "CubeMap_default", "loadCubeMap_default", "HeightmapEncoding", "HeightmapEncoding_default", "TerrainQuantization", "TerrainQuantization_default", "cartesian3Scratch", "Cartesian3_default", "cartesian3DimScratch", "cartesian2Scratch", "Cartesian2_default", "matrix4Scratch", "Matrix4_default", "matrix4Scratch2", "SHIFT_LEFT_12", "TerrainEncoding", "center", "axisAlignedBoundingBox", "minimumHeight", "maximumHeight", "fromENU", "hasVertexNormals", "hasWebMercatorT", "hasGeodeticSurfaceNormals", "exaggeration", "exaggerationRelativeHeight", "quantization", "TerrainQuantization_default", "toENU", "matrix", "defined_default", "minimum", "maximum", "dimensions", "hDim", "translation", "scale", "translationMatrix", "scaleMatrix", "st", "defaultValue_default", "vertexBuffer", "bufferIndex", "position", "uv", "height", "normalToPack", "webMercatorT", "geodeticSurfaceNormal", "u", "v", "Math_default", "h", "compressed0", "AttributeCompression_default", "compressed1", "compressed2", "compressed3", "scratchPosition", "scratchGeodeticSurfaceNormal", "oldBuffer", "newBuffer", "ellipsoid", "oldStride", "vertexCount", "newStride", "index", "offset", "oldIndex", "newIndex", "buffer", "result", "xy", "zh", "rawHeight", "heightDifference", "TerrainExaggeration_default", "temp", "x", "y", "vertexStride", "attributesIndicesNone", "attributesIndicesBits12", "datatype", "ComponentDatatype_default", "sizeInBytes", "strideInBytes", "offsetInBytes", "attributes", "addAttribute", "componentsPerAttribute", "componentsTexCoordAndNormals", "usingAttribute0Component4", "usingAttribute1Component1", "encoding", "TerrainEncoding_default", "HeightmapTessellator", "cartesian3Scratch", "Cartesian3_default", "matrix4Scratch", "Matrix4_default", "minimumScratch", "maximumScratch", "options", "cos", "sin", "sqrt", "atan", "exp", "piOverTwo", "Math_default", "toRadians", "heightmap", "width", "height", "skirtHeight", "hasSkirts", "isGeographic", "defaultValue_default", "ellipsoid", "Ellipsoid_default", "oneOverGlobeSemimajorAxis", "nativeRectangle", "Rectangle_default", "rectangle", "geographicWest", "geographicSouth", "geographicEast", "geographicNorth", "defined_default", "relativeToCenter", "hasRelativeToCenter", "includeWebMercatorT", "exaggeration", "exaggerationRelativeHeight", "includeGeodeticSurfaceNormals", "structure", "heightScale", "heightOffset", "elementsPerHeight", "stride", "elementMultiplier", "isBigEndian", "rectangleWidth", "rectangleHeight", "granularityX", "granularityY", "radiiSquared", "radiiSquaredX", "radiiSquaredY", "radiiSquaredZ", "minimumHeight", "maximumHeight", "fromENU", "Transforms_default", "toENU", "southMercatorY", "oneOverMercatorHeight", "WebMercatorProjection_default", "minimum", "maximum", "hMin", "gridVertexCount", "edgeVertexCount", "vertexCount", "positions", "heights", "uvs", "webMercatorTs", "geodeticSurfaceNormals", "startRow", "endRow", "startCol", "endCol", "skirtOffsetPercentage", "rowIndex", "row", "latitude", "v", "isNorthEdge", "isSouthEdge", "cosLatitude", "nZ", "kZ", "webMercatorT", "colIndex", "col", "terrainOffset", "heightSample", "elementOffset", "longitude", "u", "index", "isWestEdge", "isEastEdge", "isEdge", "nX", "nY", "kX", "kY", "oneOverGamma", "rSurfaceX", "rSurfaceY", "rSurfaceZ", "position", "Cartesian2_default", "boundingSphere3D", "BoundingSphere_default", "orientedBoundingBox", "OrientedBoundingBox_default", "occludeePointInScaledSpace", "EllipsoidalOccluder_default", "aaBox", "AxisAlignedBoundingBox_default", "encoding", "TerrainEncoding_default", "vertices", "bufferIndex", "j", "HeightmapTessellator_default", "TerrainData", "DeveloperError_default", "TerrainData_default", "TerrainMesh", "center", "vertices", "indices", "indexCountWithoutSkirts", "vertexCountWithoutSkirts", "minimumHeight", "maximumHeight", "boundingSphere3D", "occludeePointInScaledSpace", "vertexStride", "orientedBoundingBox", "encoding", "westIndicesSouthToNorth", "southIndicesEastToWest", "eastIndicesNorthToSouth", "northIndicesWestToEast", "defaultValue_default", "TerrainMesh_default", "TerrainProvider", "DeveloperError_default", "regularGridIndicesCache", "width", "height", "byWidth", "defined_default", "indices", "Math_default", "addRegularGridIndices", "regularGridAndEdgeIndicesCache", "indicesAndEdges", "edgeIndices", "getEdgeIndices", "westIndicesSouthToNorth", "southIndicesEastToWest", "eastIndicesNorthToSouth", "northIndicesWestToEast", "regularGridAndSkirtAndEdgeIndicesCache", "gridVertexCount", "gridIndexCount", "edgeVertexCount", "edgeIndexCount", "vertexCount", "indexCount", "IndexDatatype_default", "offset", "vertexIndex", "addSkirtIndices", "i", "index", "j", "upperLeft", "lowerLeft", "lowerRight", "upperRight", "previousIndex", "length", "ellipsoid", "tileImageWidth", "numberOfTilesAtLevelZero", "TerrainProvider_default", "HeightmapTerrainData", "options", "defaultValue_default", "HeightmapEncoding_default", "defaultStructure", "HeightmapTessellator_default", "structure", "defined_default", "createMeshTaskName", "createMeshTaskProcessorNoThrottle", "TaskProcessor_default", "createMeshTaskProcessorThrottle", "TerrainData_default", "tilingScheme", "x", "y", "level", "exaggeration", "exaggerationRelativeHeight", "throttle", "ellipsoid", "nativeRectangle", "rectangle", "center", "Rectangle_default", "thisLevelMaxError", "TerrainProvider_default", "verticesPromise", "GeographicProjection_default", "that", "result", "indicesAndEdges", "vertexCountWithoutSkirts", "TerrainMesh_default", "BoundingSphere_default", "Cartesian3_default", "OrientedBoundingBox_default", "TerrainEncoding_default", "longitude", "latitude", "width", "height", "stride", "elementsPerHeight", "elementMultiplier", "isBigEndian", "heightOffset", "heightScale", "isMeshCreated", "isLERCEncoding", "heightSample", "buffer", "encoding", "interpolateMeshHeight", "interpolateHeight", "thisX", "thisY", "thisLevel", "descendantX", "descendantY", "descendantLevel", "meshData", "heights", "sourceRectangle", "destinationRectangle", "divisor", "j", "Math_default", "i", "setHeight", "childX", "childY", "bitNumber", "sourceHeights", "fromWest", "fromSouth", "westInteger", "eastInteger", "southInteger", "northInteger", "dx", "dy", "southwestHeight", "getHeight", "southeastHeight", "northwestHeight", "northeastHeight", "triangleInterpolateHeight", "dX", "dY", "index", "HeightmapTerrainData_default", "TileAvailability", "tilingScheme", "maximumLevel", "rectangleScratch", "Rectangle_default", "findNode", "level", "x", "y", "nodes", "count", "i", "node", "startX", "startY", "endX", "endY", "rootNodes", "QuadtreeNode", "west", "north", "east", "south", "rectangleWithLevel", "RectangleWithLevel", "rootNode", "rectanglesOverlap", "putRectangleInQuadtree", "position", "nodeIndex", "rectangleContainsPosition", "defined_default", "findMaxLevelFromNode", "rectanglesScratch", "remainingToCoverByLevelScratch", "westScratch", "eastScratch", "rectangle", "rectangles", "remainingToCoverByLevel", "updateCoverageWithNode", "cartographicScratch", "Cartographic_default", "childLevel", "mask", "parent", "rectangle1", "rectangle2", "maxDepth", "rectangleFullyContainsRectangle", "index", "binarySearch_default", "rectangleLevelComparator", "a", "b", "potentialContainer", "rectangleToTest", "positionToTest", "stopNode", "maxLevel", "found", "nw", "ne", "sw", "se", "rectanglesToCover", "anyOverlap", "subtractRectangle", "rectangleList", "rectangleToSubtract", "result", "TileAvailability_default", "formatError", "object", "result", "name", "message", "defined_default", "stack", "formatError_default", "TileProviderError", "provider", "message", "x", "y", "level", "timesRetried", "error", "defaultValue_default", "previousError", "event", "errorDetails", "defined_default", "formatError_default", "TileProviderError_default", "WebMercatorTilingScheme", "options", "defaultValue_default", "Ellipsoid_default", "WebMercatorProjection_default", "defined_default", "semimajorAxisTimesPi", "Cartesian2_default", "southwest", "northeast", "Rectangle_default", "level", "rectangle", "result", "projection", "x", "y", "xTiles", "yTiles", "xTileWidth", "west", "east", "yTileHeight", "north", "south", "nativeRectangle", "position", "webMercatorPosition", "distanceFromWest", "distanceFromNorth", "xTileCoordinate", "yTileCoordinate", "WebMercatorTilingScheme_default", "ALL_CHILDREN", "ArcGISTiledElevationTerrainProvider", "options", "token", "that", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "url", "resource", "Resource_default", "defined_default", "metadata", "copyrightText", "Credit_default", "spatialReference", "wkid", "extent", "tilingSchemeOptions", "Rectangle_default", "GeographicTilingScheme_default", "Cartesian2_default", "WebMercatorTilingScheme_default", "RuntimeError_default", "tileInfo", "HeightmapEncoding_default", "TileAvailability_default", "TerrainProvider_default", "error", "message", "TileProviderError_default", "Event_default", "x", "y", "level", "request", "tileResource", "hasAvailability", "availabilityPromise", "availabilityRequest", "isTileAvailable", "availabilityResult", "requestAvailability", "promise", "tilesAvailable", "result", "HeightmapTerrainData_default", "RequestState_default", "tilesAvailablityLoaded", "findRange", "origin", "width", "height", "data", "endCol", "endRow", "value", "endingIndices", "range", "corner", "doneX", "doneY", "endX", "endY", "col", "computeAvailability", "ranges", "val", "positions", "xOffset", "yOffset", "dim", "availableCache", "Request_default", "RequestType_default", "available", "i", "ArcGISTiledElevationTerrainProvider_default", "url", "BingMapsGeocoderService", "options", "defaultValue_default", "key", "queryParameters", "defined_default", "Resource_default", "query", "result", "resource", "bbox", "south", "west", "north", "east", "Rectangle_default", "BingMapsGeocoderService_default", "implementation", "defined_default", "vendors", "i", "len", "cancelAnimationFramePolyfill", "requestID", "deprecationWarning_default", "cancelAnimationFrame_default", "CartographicGeocoderService", "query", "splitQuery", "longitude", "latitude", "height", "coordTest", "i", "splitCoord", "result", "Cartesian3_default", "CartographicGeocoderService_default", "scratchTimeVec", "Cartesian4_default", "scratchTemp0", "Cartesian3_default", "scratchTemp1", "createEvaluateFunction", "spline", "points", "times", "t0", "invSpan", "p0", "p1", "time", "result", "defined_default", "i", "u", "timeVec", "p2", "p3", "coefs", "Matrix4_default", "HermiteSpline_default", "CatmullRomSpline", "firstTangentScratch", "lastTangentScratch", "options", "defaultValue_default", "firstTangent", "lastTangent", "n", "Spline_default", "CatmullRomSpline_default", "Intersections2D", "threshold", "keepAbove", "u0", "u1", "u2", "result", "defined_default", "u0Behind", "u1Behind", "u2Behind", "numBehind", "u01Ratio", "u02Ratio", "u12Ratio", "u10Ratio", "u20Ratio", "u21Ratio", "x", "y", "x1", "y1", "x2", "y2", "x3", "y3", "x1mx3", "x3mx2", "y2my3", "y1my3", "inverseDeterminant", "ymy3", "xmx3", "l1", "l2", "l3", "Cartesian3_default", "x00", "y00", "x01", "y01", "x10", "y10", "x11", "y11", "numerator1A", "numerator1B", "denominator1", "ua1", "ub1", "Cartesian2_default", "Intersections2D_default", "QuantizedMeshTerrainData", "options", "vertexCount", "uValues", "vValues", "sortByV", "a", "b", "sortByU", "sortIndicesIfNecessary", "defaultValue_default", "defined_default", "arrayScratch", "indices", "sortFunction", "needsSort", "i", "len", "IndexDatatype_default", "createMeshTaskName", "createMeshTaskProcessorNoThrottle", "TaskProcessor_default", "createMeshTaskProcessorThrottle", "TerrainData_default", "tilingScheme", "x", "y", "level", "exaggeration", "exaggerationRelativeHeight", "throttle", "ellipsoid", "rectangle", "verticesPromise", "that", "result", "vertexCountWithoutSkirts", "indicesTypedArray", "vertices", "rtc", "minimumHeight", "maximumHeight", "boundingSphere", "obb", "occludeePointInScaledSpace", "Cartesian3_default", "stride", "terrainEncoding", "TerrainEncoding_default", "TerrainMesh_default", "upsampleTaskProcessor", "thisX", "thisY", "thisLevel", "descendantX", "descendantY", "descendantLevel", "mesh", "isEastChild", "isNorthChild", "childRectangle", "upsamplePromise", "shortestSkirt", "westSkirtHeight", "southSkirtHeight", "eastSkirtHeight", "northSkirtHeight", "credits", "quantizedVertices", "encodedNormals", "BoundingSphere_default", "OrientedBoundingBox_default", "maxShort", "barycentricCoordinateScratch", "longitude", "latitude", "u", "Math_default", "v", "interpolateMeshHeight", "interpolateHeight", "pointInBoundingBox", "u0", "v0", "u1", "v1", "u2", "v2", "minU", "maxU", "minV", "maxV", "texCoordScratch0", "Cartesian2_default", "texCoordScratch1", "texCoordScratch2", "terrainData", "encoding", "i0", "i1", "i2", "uv0", "uv1", "uv2", "barycentric", "Intersections2D_default", "h0", "h1", "h2", "uBuffer", "vBuffer", "heightBuffer", "quantizedHeight", "childX", "childY", "bitNumber", "QuantizedMeshTerrainData_default", "LayerInformation", "layer", "CesiumTerrainProvider", "options", "defaultValue_default", "Event_default", "credit", "Credit_default", "that", "lastResource", "layerJsonResource", "metadataError", "layers", "attribution", "overallAvailability", "overallMaxZoom", "url", "resource", "Resource_default", "requestLayerJson", "parseMetadataSuccess", "data", "message", "TileProviderError_default", "RuntimeError_default", "hasVertexNormals", "hasWaterMask", "hasMetadata", "littleEndianExtensionSize", "isHeightmap", "defined_default", "tileUrlTemplates", "maxZoom", "GeographicTilingScheme_default", "WebMercatorTilingScheme_default", "TerrainProvider_default", "availabilityTilesLoaded", "availabilityLevels", "availableTiles", "availability", "TileAvailability_default", "level", "rangesAtLevel", "yTiles", "rangeIndex", "range", "yStart", "yEnd", "parentUrl", "parentMetadata", "parseMetadataFailure", "metadataSuccess", "length", "levelRanges", "i", "layerJsonCredit", "metadataFailure", "QuantizedMeshExtensionIds", "getRequestHeader", "extensionsList", "createHeightmapTerrainData", "provider", "buffer", "x", "y", "heightBuffer", "HeightmapTerrainData_default", "createQuantizedMeshTerrainData", "pos", "cartesian3Elements", "boundingSphereElements", "cartesian3Length", "boundingSphereLength", "encodedVertexElements", "encodedVertexLength", "triangleElements", "bytesPerIndex", "triangleLength", "view", "center", "Cartesian3_default", "minimumHeight", "maximumHeight", "boundingSphere", "BoundingSphere_default", "horizonOcclusionPoint", "vertexCount", "encodedVertexBuffer", "uBuffer", "vBuffer", "AttributeCompression_default", "triangleCount", "indices", "IndexDatatype_default", "highest", "code", "westVertexCount", "westIndices", "southVertexCount", "southIndices", "eastVertexCount", "eastIndices", "northVertexCount", "northIndices", "encodedNormalBuffer", "waterMaskBuffer", "extensionId", "extensionLength", "stringLength", "getJsonFromTypedArray_default", "offset", "availableLevel", "skirtHeight", "rectangle", "orientedBoundingBox", "OrientedBoundingBox_default", "QuantizedMeshTerrainData_default", "request", "layerToUse", "layerCount", "requestTileGeometry", "urlTemplates", "terrainY", "extensionList", "headers", "query", "promise", "count", "checkLayer", "layerResult", "getAvailabilityTile", "parentLevel", "divisor", "parentX", "parentY", "topLayer", "cacheKey", "deleteFromCache", "tile", "requestPromise", "Request_default", "RequestType_default", "CesiumTerrainProvider_default", "CircleGeometry", "options", "defaultValue_default", "radius", "ellipseGeometryOptions", "EllipseGeometry_default", "value", "array", "startingIndex", "scratchEllipseGeometry", "Cartesian3_default", "scratchOptions", "Ellipsoid_default", "VertexFormat_default", "result", "ellipseGeometry", "defined_default", "circleGeometry", "minHeightFunc", "maxHeightFunc", "granularity", "ellipsoid", "minHeight", "maxHeight", "CircleGeometry_default", "CircleOutlineGeometry", "options", "defaultValue_default", "radius", "ellipseGeometryOptions", "EllipseOutlineGeometry_default", "value", "array", "startingIndex", "scratchEllipseGeometry", "Cartesian3_default", "scratchOptions", "Ellipsoid_default", "result", "ellipseGeometry", "defined_default", "circleGeometry", "CircleOutlineGeometry_default", "import_urijs", "defaultTokenCredit", "defaultAccessToken", "Ion", "Resource_default", "providedKey", "defined_default", "defaultTokenMessage", "Credit_default", "Ion_default", "IonResource", "endpoint", "endpointResource", "options", "externalType", "isExternal", "defined_default", "retryCallback", "RuntimeError_default", "Resource_default", "Uri", "assetId", "credits", "Credit_default", "defaultTokenCredit", "Ion_default", "result", "ionRoot", "defaultValue_default", "userOptions", "server", "accessToken", "resourceOptions", "that", "error", "imageDefined", "newEndpoint", "IonResource_default", "createWorldTerrain", "options", "defaultValue_default", "CesiumTerrainProvider_default", "IonResource_default", "createWorldTerrain_default", "CustomHeightmapTerrainProvider", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Ellipsoid_default", "maxTileDimensions", "TerrainProvider_default", "Event_default", "credit", "Credit_default", "x", "y", "level", "request", "promise", "width", "height", "heightmapData", "buffer", "HeightmapTerrainData_default", "CustomHeightmapTerrainProvider_default", "compressedMagic", "compressedMagicSwap", "decodeGoogleEarthEnterpriseData", "key", "data", "keyLength", "RuntimeError_default", "dataView", "magic", "keyView", "dp", "dpend", "dpend64", "kpend", "kp", "off", "decodeGoogleEarthEnterpriseData_default", "DefaultProxy", "proxy", "resource", "prefix", "DefaultProxy_default", "DoubleEndedPriorityQueue", "options", "defined_default", "value", "maximumLength", "comparator", "array", "length", "result", "i", "pushUp", "element", "removedElement", "minimumElement", "index", "pushDown", "maximumElement", "maximumElementIndex", "greaterThan", "swap", "that", "indexA", "indexB", "temp", "lessThan", "onMinLevel", "Math_default", "parentIndex", "lessThanParent", "grandparentIndex", "leftChildIndex", "target", "rightChildIndex", "grandChildStart", "grandChildCount", "grandChildIndex", "parentOfGrandchildIndex", "DoubleEndedPriorityQueue_default", "EllipsoidTerrainProvider", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Ellipsoid_default", "TerrainProvider_default", "Event_default", "x", "y", "level", "request", "HeightmapTerrainData_default", "EllipsoidTerrainProvider_default", "PerspectiveOffCenterFrustum", "options", "defaultValue_default", "CullingVolume_default", "Matrix4_default", "update", "frustum", "b", "r", "l", "n", "f", "getPlanesRight", "Cartesian3_default", "getPlanesNearCenter", "getPlanesFarCenter", "getPlanesNormal", "position", "direction", "up", "planes", "t", "right", "nearCenter", "farCenter", "normal", "plane", "defined_default", "Cartesian4_default", "drawingBufferWidth", "drawingBufferHeight", "distance", "pixelRatio", "result", "inverseNear", "tanTheta", "pixelHeight", "pixelWidth", "other", "relativeEpsilon", "absoluteEpsilon", "Math_default", "PerspectiveOffCenterFrustum_default", "PerspectiveFrustum", "options", "defaultValue_default", "PerspectiveOffCenterFrustum_default", "value", "array", "startingIndex", "result", "defined_default", "update", "frustum", "f", "position", "direction", "up", "drawingBufferWidth", "drawingBufferHeight", "distance", "pixelRatio", "other", "relativeEpsilon", "absoluteEpsilon", "Math_default", "PerspectiveFrustum_default", "PERSPECTIVE", "ORTHOGRAPHIC", "FrustumGeometry", "options", "frustum", "orientation", "origin", "vertexFormat", "defaultValue_default", "VertexFormat_default", "drawNearPlane", "frustumType", "frustumPackedLength", "PerspectiveFrustum_default", "OrthographicFrustum_default", "Cartesian3_default", "Quaternion_default", "value", "array", "startingIndex", "scratchPackPerspective", "scratchPackOrthographic", "scratchPackQuaternion", "scratchPackorigin", "scratchVertexFormat", "result", "defined_default", "frustumResult", "getAttributes", "offset", "normals", "tangents", "bitangents", "st", "normal", "tangent", "bitangent", "stOffset", "i", "scratchRotationMatrix", "Matrix3_default", "scratchViewMatrix", "Matrix4_default", "scratchInverseMatrix", "scratchXDirection", "scratchYDirection", "scratchZDirection", "scratchNegativeX", "scratchNegativeY", "scratchNegativeZ", "frustumSplits", "frustumCornersNDC", "Cartesian4_default", "scratchFrustumCorners", "positions", "xDirection", "yDirection", "zDirection", "rotationMatrix", "x", "y", "z", "view", "inverseView", "inverseViewProjection", "projection", "viewProjection", "j", "corner", "w", "fac", "near", "far", "frustumGeometry", "numberOfPlanes", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "negativeX", "negativeY", "negativeZ", "indices", "indexOffset", "index", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "FrustumGeometry_default", "PERSPECTIVE", "ORTHOGRAPHIC", "FrustumOutlineGeometry", "options", "frustum", "orientation", "origin", "drawNearPlane", "defaultValue_default", "frustumType", "frustumPackedLength", "PerspectiveFrustum_default", "OrthographicFrustum_default", "Cartesian3_default", "Quaternion_default", "value", "array", "startingIndex", "scratchPackPerspective", "scratchPackOrthographic", "scratchPackQuaternion", "scratchPackorigin", "result", "defined_default", "frustumResult", "frustumGeometry", "positions", "FrustumGeometry_default", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "offset", "index", "numberOfPlanes", "indices", "i", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "FrustumOutlineGeometry_default", "GeocoderService", "DeveloperError_default", "GeocoderService_default", "GeocodeType", "GeocodeType_default", "GeometryFactory", "DeveloperError_default", "geometryFactory", "GeometryFactory_default", "getImageFromTypedArray", "typedArray", "width", "height", "dataArray", "imageData", "canvas", "getImageFromTypedArray_default", "protobuf", "isBitSet", "bits", "mask", "isBitSet_default", "childrenBitmasks", "anyChildBitmask", "cacheFlagBitmask", "imageBitmask", "terrainBitmask", "GoogleEarthEnterpriseTileInformation", "bits", "cnodeVersion", "imageryVersion", "terrainVersion", "imageryProvider", "terrainProvider", "info", "result", "defined_default", "parent", "isBitSet_default", "index", "GoogleEarthEnterpriseTileInformation_default", "stringToBuffer", "str", "len", "buffer", "ui8", "i", "defaultKey", "GoogleEarthEnterpriseMetadata", "resourceOrUrl", "url", "Resource_default", "resource", "Math_default", "that", "requestDbRoot", "e", "message", "getMetadataResource", "RuntimeError_default", "x", "y", "level", "quadkey", "bitmask", "digit", "isBitSet_default", "quadKey", "info", "defined_default", "valid", "q", "last", "taskProcessor", "TaskProcessor_default", "version", "request", "defaultValue_default", "promise", "tileInfo", "key", "metadata", "result", "root", "topLevelKeyLength", "top", "keys", "a", "b", "keysLength", "GoogleEarthEnterpriseTileInformation_default", "keyLength", "parent", "populateSubtree", "t", "subtreeRequest", "subtreePromises", "Request_default", "dbrootParser", "dbrootParserPromise", "buildModuleUrl_default", "oldValue", "loadAndExecuteScript_default", "protobuf", "buf", "encryptedDbRootProto", "byteArray", "offset", "end", "dbRootCompressed", "dbRoot", "model", "providers", "providerInfo", "count", "provider", "copyrightString", "Credit_default", "GoogleEarthEnterpriseMetadata_default", "GoogleEarthEnterpriseTerrainData", "options", "defaultValue_default", "googleChildTileMask", "childTileMask", "createMeshTaskName", "createMeshTaskProcessorNoThrottle", "TaskProcessor_default", "createMeshTaskProcessorThrottle", "TerrainData_default", "nativeRectangleScratch", "Rectangle_default", "rectangleScratch", "tilingScheme", "x", "y", "level", "exaggeration", "exaggerationRelativeHeight", "throttle", "ellipsoid", "center", "thisLevelMaxError", "verticesPromise", "defined_default", "that", "result", "TerrainMesh_default", "BoundingSphere_default", "Cartesian3_default", "OrientedBoundingBox_default", "TerrainEncoding_default", "rectangle", "longitude", "latitude", "u", "Math_default", "v", "interpolateMeshHeight", "interpolateHeight", "upsampleTaskProcessor", "thisX", "thisY", "thisLevel", "descendantX", "descendantY", "descendantLevel", "mesh", "isEastChild", "isNorthChild", "childRectangle", "upsamplePromise", "quantizedVertices", "indicesTypedArray", "IndexDatatype_default", "skirtHeight", "QuantizedMeshTerrainData_default", "childX", "childY", "bitNumber", "texCoordScratch0", "Cartesian2_default", "texCoordScratch1", "texCoordScratch2", "barycentricCoordinateScratch", "terrainData", "vertices", "encoding", "indices", "i", "len", "i0", "i1", "i2", "uv0", "uv1", "uv2", "barycentric", "Intersections2D_default", "h0", "h1", "h2", "sizeOfUint16", "sizeOfUint32", "sizeOfInt32", "sizeOfFloat", "sizeOfDouble", "buffer", "quad", "uStart", "vStart", "dv", "offset", "q", "xSize", "ySize", "xScale", "yScale", "numPoints", "numIndices", "uBuffer", "vBuffer", "heights", "u0", "u1", "u2", "v0", "v1", "v2", "GoogleEarthEnterpriseTerrainData_default", "TerrainState", "julianDateScratch", "JulianDate_default", "TerrainCache", "quadKey", "buffer", "result", "defined_default", "terrainCache", "keys", "count", "k", "e", "GoogleEarthEnterpriseTerrainProvider", "options", "defaultValue_default", "metadata", "resource", "Resource_default", "GoogleEarthEnterpriseMetadata_default", "GeographicTilingScheme_default", "Rectangle_default", "Math_default", "credit", "Credit_default", "Event_default", "that", "metadataError", "RuntimeError_default", "TileProviderError_default", "taskProcessor", "TaskProcessor_default", "computeChildMask", "info", "childMask", "i", "child", "x", "y", "level", "request", "terrainState", "GoogleEarthEnterpriseTerrainData_default", "HeightmapTerrainData_default", "parentInfo", "q", "terrainVersion", "terrainPromises", "terrainRequests", "sharedPromise", "sharedRequest", "requestPromise", "buildTerrainResource", "terrain", "terrainTiles", "requestedInfo", "provider", "j", "childKey", "error", "RequestState_default", "Request_default", "RequestType_default", "terrainProvider", "version", "GoogleEarthEnterpriseTerrainProvider_default", "IauOrientationParameters", "rightAscension", "declination", "rotation", "rotationRate", "IauOrientationParameters_default", "Iau2000Orientation", "TdtMinusTai", "J2000d", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11", "c12", "c13", "dateTT", "JulianDate_default", "date", "result", "defined_default", "d", "T", "TimeConstants_default", "E1", "Math_default", "E2", "E3", "E4", "E5", "E6", "E7", "E8", "E9", "E10", "E11", "E12", "E13", "sinE1", "sinE2", "sinE3", "sinE4", "sinE5", "sinE6", "sinE7", "sinE8", "sinE9", "sinE10", "sinE11", "sinE12", "sinE13", "cosE1", "cosE2", "cosE3", "cosE4", "cosE5", "cosE6", "cosE7", "cosE8", "cosE9", "cosE10", "cosE11", "cosE12", "cosE13", "rightAscension", "declination", "rotation", "rotationRate", "IauOrientationParameters_default", "Iau2000Orientation_default", "IauOrientationAxes", "computeFunction", "defined_default", "Iau2000Orientation_default", "xAxisScratch", "Cartesian3_default", "yAxisScratch", "zAxisScratch", "computeRotationMatrix", "alpha", "delta", "result", "xAxis", "Math_default", "cosDec", "zAxis", "yAxis", "Matrix3_default", "rotMtxScratch", "quatScratch", "Quaternion_default", "date", "JulianDate_default", "alphaDeltaW", "precMtx", "rot", "quat", "rotMtx", "IauOrientationAxes_default", "InterpolationAlgorithm", "DeveloperError_default", "InterpolationAlgorithm_default", "PeliasGeocoderService", "url", "Resource_default", "query", "type", "GeocodeType_default", "results", "resultObject", "destination", "bboxDegrees", "defined_default", "Rectangle_default", "lon", "lat", "Cartesian3_default", "PeliasGeocoderService_default", "IonGeocoderService", "options", "defaultValue_default", "accessToken", "Ion_default", "server", "Resource_default", "defaultTokenCredit", "defined_default", "Credit_default", "searchEndpoint", "PeliasGeocoderService_default", "query", "geocodeType", "IonGeocoderService_default", "KeyboardEventModifier", "KeyboardEventModifier_default", "MapProjection", "DeveloperError_default", "MapProjection_default", "leftScratchArray", "rightScratchArray", "merge", "array", "compare", "userDefinedObject", "start", "middle", "end", "leftLength", "rightLength", "left", "right", "i", "j", "k", "leftElement", "rightElement", "sort", "mergeSort", "comparator", "length", "scratchLength", "mergeSort_default", "MorphWeightSpline", "options", "defaultValue_default", "weights", "times", "Spline_default", "time", "result", "i", "u", "defined_default", "j", "index", "MorphWeightSpline_default", "Visibility", "Visibility_default", "Occluder", "occluderBoundingSphere", "cameraPosition", "Cartesian3_default", "scratchCartesian3", "cameraToOccluderVec", "invCameraToOccluderDistance", "occluderRadiusSqrd", "horizonDistance", "horizonPlaneNormal", "horizonPlanePosition", "nearPlaneDistance", "result", "defined_default", "tempVecScratch", "occludee", "tempVec", "temp", "occludeePositionScratch", "occludeePosition", "occludeeRadius", "tempVecMagnitudeSquared", "occluderRadiusSquared", "occludeeRadiusSquared", "tempScratch", "occludeeBS", "Visibility_default", "occluderToOccludeeDistSqrd", "cameraToOccludeeDistSqrd", "occludeePointScratch", "positions", "occludeePos", "occluderPosition", "occluderRadius", "numPositions", "occluderPlaneNormal", "occluderPlaneD", "aRotationVector", "dot", "tempDot", "i", "distance", "computeOccludeePointFromRectangleScratch", "rectangle", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "Rectangle_default", "bs", "BoundingSphere_default", "ellipsoidCenter", "tempVec0Scratch", "tempVec0", "majorAxis", "tempVec1", "u", "posDirectionScratch", "position", "anyRotationVector", "positionDirection", "crossProduct", "Math_default", "posScratch1", "occluerPosScratch", "posScratch2", "horizonPlanePosScratch", "occluderBS", "pos", "positionToOccluder", "occluderToPositionDistanceSquared", "horizonDistanceSquared", "invOccluderToPositionDistance", "horizonPlaneDistance", "horizonCrossDistance", "horizonCrossDirection", "offset", "dot0", "dot1", "Occluder_default", "OpenCageGeocoderService", "url", "apiKey", "params", "Resource_default", "defaultValue_default", "query", "combine_default", "response", "resultObject", "destination", "bounds", "defined_default", "Rectangle_default", "lon", "lat", "Cartesian3_default", "OpenCageGeocoderService_default", "Packable", "DeveloperError_default", "Packable_default", "PackableForInterpolation", "DeveloperError_default", "PackableForInterpolation_default", "scratchBarycentricCoords", "Cartesian3_default", "pointInsideTriangle", "point", "p0", "p1", "p2", "coords", "barycentricCoordinates_default", "defined_default", "pointInsideTriangle_default", "Proxy", "DeveloperError_default", "Proxy_default", "implementation", "defined_default", "vendors", "i", "len", "msPerFrame", "lastFrameTime", "callback", "currentTime", "getTimestamp_default", "delay", "requestAnimationFramePolyFill", "deprecationWarning_default", "requestAnimationFrame_default", "ScreenSpaceEventType", "ScreenSpaceEventType_default", "getPosition", "screenSpaceEventHandler", "event", "result", "element", "rect", "getInputEventKey", "type", "modifier", "key", "defined_default", "getModifier", "KeyboardEventModifier_default", "MouseButton", "registerListener", "domType", "callback", "listener", "e", "FeatureDetection_default", "registerListeners", "alternateElement", "handlePointerDown", "handlePointerUp", "handlePointerMove", "handleMouseDown", "handleMouseUp", "handleMouseMove", "handleTouchStart", "handleTouchEnd", "handleTouchMove", "handleDblClick", "wheelEvent", "handleWheel", "unregisterListeners", "removalFunctions", "i", "mouseDownEvent", "Cartesian2_default", "gotTouchEvent", "getTimestamp_default", "canProcessMouseEvent", "ScreenSpaceEventHandler", "checkPixelTolerance", "startPosition", "endPosition", "pixelTolerance", "xDiff", "yDiff", "button", "screenSpaceEventType", "ScreenSpaceEventType_default", "position", "action", "mouseUpEvent", "mouseClickEvent", "cancelMouseEvent", "clickScreenSpaceEventType", "clickAction", "mouseMoveEvent", "previousPosition", "mouseDblClickEvent", "delta", "deltaMode", "changedTouches", "length", "touch", "identifier", "positions", "fireTouchEvents", "previousPositions", "touchStartEvent", "touch2StartEvent", "touchEndEvent", "touchClickEvent", "touchHoldEvent", "numberOfTouches", "pinching", "fireTouchMoveEvents", "touchMoveEvent", "touchPinchMovementEvent", "position1", "position2", "previousPosition1", "previousPosition2", "dX", "dY", "dist", "prevDX", "prevDY", "prevDist", "cY", "prevCY", "angle", "prevAngle", "AssociativeArray_default", "defaultValue_default", "destroyObject_default", "ScreenSpaceEventHandler_default", "interpolateColors", "p0", "p1", "color0", "color1", "minDistance", "array", "offset", "numPoints", "PolylinePipeline_default", "i", "r0", "g0", "b0", "a0", "r1", "g1", "b1", "a1", "Color_default", "redPerVertex", "greenPerVertex", "bluePerVertex", "alphaPerVertex", "index", "SimplePolylineGeometry", "options", "defaultValue_default", "positions", "colors", "colorsPerVertex", "ArcType_default", "Math_default", "Ellipsoid_default", "numComponents", "Cartesian3_default", "defined_default", "value", "startingIndex", "length", "result", "ellipsoid", "arcType", "granularity", "scratchArray1", "scratchArray2", "generateArcOptionsScratch", "simplePolylineGeometry", "perSegmentColors", "positionValues", "numberOfPositions", "colorValues", "color", "subdivisionSize", "numberOfPointsFunction", "generateArcFunction", "heights", "generateArcOptions", "positionCount", "ci", "pos", "segLen", "k", "c0", "c1", "lastColor", "positionIndex", "colorIndex", "p", "attributes", "GeometryAttributes_default", "GeometryAttribute_default", "ComponentDatatype_default", "numberOfIndices", "indices", "IndexDatatype_default", "Geometry_default", "PrimitiveType_default", "BoundingSphere_default", "SimplePolylineGeometry_default", "SphereGeometry", "options", "radius", "defaultValue_default", "ellipsoidOptions", "Cartesian3_default", "EllipsoidGeometry_default", "value", "array", "startingIndex", "scratchEllipsoidGeometry", "scratchOptions", "VertexFormat_default", "result", "ellipsoidGeometry", "defined_default", "sphereGeometry", "SphereGeometry_default", "TileEdge", "TileEdge_default", "TilingScheme", "options", "DeveloperError_default", "TilingScheme_default", "VideoSynchronizer", "options", "defaultValue_default", "Iso8601_default", "value", "oldValue", "defined_default", "createSeekFunction", "destroyObject_default", "clock", "element", "paused", "shouldAnimate", "clockTime", "epoch", "videoTime", "JulianDate_default", "duration", "desiredTime", "currentTime", "tolerance", "that", "VideoSynchronizer_default", "DataRectangle", "rectangle", "maxLevel", "VRTheWorldTerrainProvider", "options", "defaultValue_default", "resource", "Resource_default", "Event_default", "credit", "Credit_default", "that", "metadataError", "ellipsoid", "Ellipsoid_default", "metadataSuccess", "xml", "srs", "GeographicTilingScheme_default", "RuntimeError_default", "tileFormat", "TerrainProvider_default", "dataRectangles", "i", "dataRectangle", "west", "Math_default", "south", "east", "north", "Rectangle_default", "metadataFailure", "e", "message", "defined_default", "TileProviderError_default", "requestMetadata", "x", "y", "level", "request", "yTiles", "promise", "image", "HeightmapTerrainData_default", "getImagePixels_default", "getChildMask", "rectangleScratch", "provider", "tilingScheme", "rectangles", "parentRectangle", "childMask", "testRectangle", "intersection", "isTileInRectangle", "tileRectangle", "VRTheWorldTerrainProvider_default", "VulkanConstants", "VulkanConstants_default", "webGLConstantToGlslType", "webGLValue", "WebGLConstants_default", "webGLConstantToGlslType_default", "wrapFunction", "obj", "oldFunction", "newFunction", "wrapFunction_default", "oldValue", "n", "A", "w", "R", "v", "H", "S", "T", "K", "a", "c", "W", "X", "b", "d", "Y", "Z", "aa", "ba", "e", "r", "f", "l", "g", "h", "m", "k", "p", "t", "q", "D", "I", "F", "G", "U", "L", "C", "da", "ea", "N", "x", "B", "u", "z", "ca", "J", "V", "Q", "y", "E", "M", "O", "P", "knockout", "knockout_3_5_1_default", "OBSERVABLES_PROPERTY", "SUBSCRIBABLE_PROPERTY", "track", "obj", "propertyNames", "ko", "allObservablesForObject", "getAllObservablesForObject", "propertyName", "origValue", "isArray", "observable", "notifyWhenPresentOrFutureArrayValuesMutate", "createIfNotDefined", "result", "defineComputedProperty", "evaluatorOrOptions", "computedOptions", "watchingArraySubscription", "newArrayInstance", "startWatchingArrayInstance", "arrayInstance", "subscribable", "getSubscribableForArray", "notificationPauseSignal", "wrapStandardArrayMutators", "addKnockoutArrayMutators", "fnName", "origMutator", "getObservable", "valueHasMutated", "attachToKo", "knockout_es5_default", "svgNS", "svgClassName", "SvgPathBindingHandler", "knockout", "element", "valueAccessor", "svg", "pathElement", "value", "pathWidth", "pathHeight", "SvgPathBindingHandler_default", "knockout_es5_default", "knockout_3_5_1_default", "SvgPathBindingHandler_default", "knockout_default", "AdjustTranslucentFS_default", "AtmosphereCommon_default", "BrdfLutGeneratorFS_default", "CloudCollectionFS_default", "CloudCollectionVS_default", "CloudNoiseFS_default", "CloudNoiseVS_default", "CompareAndPackTranslucentDepth_default", "CompositeOITFS_default", "DepthPlaneFS_default", "DepthPlaneVS_default", "EllipsoidFS_default", "EllipsoidVS_default", "FXAA3_11_default", "GlobeFS_default", "GlobeVS_default", "GroundAtmosphere_default", "ReprojectWebMercatorFS_default", "ReprojectWebMercatorVS_default", "SkyAtmosphereCommon_default", "SkyAtmosphereFS_default", "SkyAtmosphereVS_default", "SkyBoxFS_default", "SkyBoxVS_default", "SunFS_default", "SunTextureFS_default", "SunVS_default", "ViewportQuadFS_default", "ClockViewModel", "clock", "defined_default", "Clock_default", "EventHelper_default", "knockout_default", "JulianDate_default", "value", "destroyObject_default", "ClockViewModel_default", "Command", "DeveloperError_default", "Command_default", "createCommand", "func", "canExecute", "defaultValue_default", "beforeExecute", "Event_default", "afterExecute", "command", "commandInfo", "result", "knockout_default", "createCommand_default", "InspectorShared", "labelText", "checkedBinding", "enableBinding", "checkboxContainer", "checkboxLabel", "checkboxInput", "binding", "defined_default", "panel", "headerText", "sectionVisibleBinding", "toggleSectionVisibilityBinding", "section", "sectionHeader", "sectionContent", "InspectorShared_default", "subscribeAndEvaluate", "owner", "observablePropertyName", "callback", "target", "event", "knockout_default", "subscribeAndEvaluate_default", "ToggleButtonViewModel", "command", "options", "defaultValue_default", "knockout_default", "ToggleButtonViewModel_default", "DiscardMissingTileImagePolicy", "options", "defaultValue_default", "resource", "Resource_default", "that", "success", "image", "defined_default", "pixels", "getImagePixels_default", "allAreTransparent", "width", "pixelsToCheck", "i", "len", "pos", "index", "failure", "missingImagePixels", "offset", "pixel", "DiscardMissingTileImagePolicy_default", "ImageryLayerFeatureInfo", "properties", "namePropertyPrecedence", "nameProperty", "key", "lowerKey", "defined_default", "describe", "html", "value", "ImageryLayerFeatureInfo_default", "ImageryProvider", "DeveloperError_default", "x", "y", "level", "request", "longitude", "latitude", "ktx2Regex", "imageryProvider", "url", "resource", "Resource_default", "loadKTX2_default", "defined_default", "ImageryProvider_default", "ArcGisMapServerImageryProvider", "options", "defaultValue_default", "resource", "Resource_default", "defined_default", "GeographicTilingScheme_default", "credit", "Credit_default", "Event_default", "that", "metadataError", "metadataSuccess", "data", "tileInfo", "WebMercatorTilingScheme_default", "message", "TileProviderError_default", "requestMetadata", "RuntimeError_default", "projection", "WebMercatorProjection_default", "extent", "sw", "Cartesian3_default", "ne", "Rectangle_default", "extentMessage", "DiscardMissingTileImagePolicy_default", "buildImageResource", "Cartesian2_default", "metadataFailure", "e", "imageryProvider", "x", "y", "level", "request", "nativeRectangle", "query", "GeographicProjection_default", "ImageryProvider_default", "longitude", "latitude", "rectangle", "horizontal", "vertical", "sr", "Math_default", "projected", "Cartographic_default", "layers", "json", "result", "features", "i", "feature", "featureInfo", "ImageryLayerFeatureInfo_default", "wkid", "ArcGisMapServerImageryProvider_default", "AutoExposure", "FramebufferManager_default", "Cartesian2_default", "framebuffers", "defined_default", "destroyFramebuffers", "autoexposure", "length", "createFramebuffers", "context", "width", "height", "pixelDatatype", "PixelDatatype_default", "i", "lastTexture", "destroyCommands", "commands", "createUniformMap", "index", "uniforms", "texture", "getShaderSource", "source", "createCommands", "clearCommand", "ClearCommand_default", "Color_default", "temp", "colorTexture", "destroyObject_default", "AutoExposure_default", "BingMapsStyle", "BingMapsStyle_default", "DiscardEmptyTileImagePolicy", "options", "image", "emptyImage", "defined_default", "DiscardEmptyTileImagePolicy_default", "BingMapsImageryProvider", "options", "defaultValue_default", "accessKey", "Resource_default", "BingMapsStyle_default", "defined_default", "DiscardEmptyTileImagePolicy_default", "Credit_default", "WebMercatorTilingScheme_default", "Event_default", "tileProtocol", "metadataResource", "that", "metadataError", "metadataSuccess", "data", "metadataFailure", "resource", "attributionList", "attributionIndex", "attributionLength", "attribution", "coverageAreas", "areaIndex", "areaLength", "area", "bbox", "Rectangle_default", "Math_default", "TileProviderError_default", "e", "message", "requestMetadata", "RuntimeError_default", "cacheKey", "promise", "rectangleScratch", "x", "y", "level", "rectangle", "getRectangleAttribution", "request", "ImageryProvider_default", "buildImageResource", "error", "longitude", "latitude", "quadkey", "i", "bitmask", "digit", "buildModuleUrl_default", "value", "imageryProvider", "imageUrl", "subdomains", "subdomainIndex", "intersectionScratch", "result", "included", "intersection", "BingMapsImageryProvider_default", "defaultDimensions", "Cartesian3_default", "BoxEmitter", "dimensions", "defaultValue_default", "value", "scratchHalfDim", "particle", "dim", "halfDim", "x", "Math_default", "y", "z", "BoxEmitter_default", "BrdfLutGenerator", "createCommand", "generator", "context", "framebuffer", "drawCommand", "BrdfLutGeneratorFS_default", "RenderState_default", "BoundingRectangle_default", "frameState", "defined_default", "colorTexture", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "Framebuffer_default", "destroyObject_default", "BrdfLutGenerator_default", "CameraFlightPath", "getAltitude", "frustum", "dx", "dy", "near", "top", "right", "PerspectiveFrustum_default", "tanTheta", "PerspectiveOffCenterFrustum_default", "scratchCart", "Cartesian3_default", "scratchCart2", "createPitchFunction", "startPitch", "endPitch", "heightFunction", "pitchAdjustHeight", "defined_default", "startHeight", "endHeight", "middleHeight", "d1", "d2", "time", "altitude", "t1", "Math_default", "t2", "createHeightFunction", "camera", "destination", "optionAltitude", "maxHeight", "start", "end", "up", "diff", "verticalDistance", "horizontalDistance", "s", "e", "t", "x", "adjustAngleForLERP", "startAngle", "endAngle", "scratchStart", "createUpdateCV", "scene", "duration", "heading", "pitch", "roll", "optionPitchAdjustHeight", "startHeading", "startRoll", "pitchFunction", "update", "value", "Cartesian2_default", "useLongestFlight", "startCart", "destCart", "useShortestFlight", "scratchStartCart", "Cartographic_default", "scratchEndCart", "createUpdate3D", "optionFlyOverLongitude", "optionFlyOverLongitudeWeight", "ellipsoid", "useLongFlight", "hitLon", "lonMin", "lonMax", "hitInside", "din", "dot", "isolateUpdateFunction", "startLongitude", "destLongitude", "startLatitude", "destLatitude", "position", "createUpdate2D", "zoom", "ratio", "incrementAmount", "scratchCartographic", "scratchDestination", "emptyFlight", "complete", "cancel", "wrapCallback", "controller", "cb", "wrapped", "options", "defaultValue_default", "mode", "SceneMode_default", "convert", "projection", "maximumHeight", "flyOverLongitude", "flyOverLongitudeWeight", "easingFunction", "transform", "empty", "updateFunctions", "EasingFunction_default", "CameraFlightPath_default", "MapMode2D", "MapMode2D_default", "Camera", "scene", "Matrix4_default", "Cartesian3_default", "Cartographic_default", "PerspectiveFrustum_default", "Math_default", "Event_default", "updateViewMatrix", "SceneMode_default", "projection", "rectangleCameraPosition3D", "mag", "Rectangle_default", "HeadingPitchRange_default", "camera", "updateCameraDeltas", "defined_default", "delta", "getTimestamp_default", "percentageChanged", "currentHeading", "headingChangedPercentage", "position", "lastPosition", "frustum", "lastFrustum", "x0", "x1", "x2", "x3", "y0", "y1", "y2", "y3", "leftX", "rightX", "bottomY", "topY", "areaPercentage", "areaRef", "dirAngle", "dirPercentage", "heightPercentage", "convertTransformForColumbusView", "Transforms_default", "scratchCartographic", "scratchCartesian3Projection", "scratchCartesian3", "scratchCartesian4Origin", "Cartesian4_default", "scratchCartesian4NewOrigin", "scratchCartesian4NewXAxis", "scratchCartesian4NewYAxis", "scratchCartesian4NewZAxis", "convertTransformFor2D", "ellipsoid", "origin", "cartographic", "projectedPosition", "newOrigin", "newZAxis", "xAxis", "newXAxis", "newYAxis", "yAxis", "scratchCartesian", "updateMembers", "mode", "heightChanged", "height", "positionChanged", "direction", "directionChanged", "up", "upChanged", "right", "rightChanged", "transformChanged", "transform", "positionENU", "det", "invUpMag", "scalar", "w0", "getHeading", "heading", "getPitch", "getRoll", "roll", "scratchHPRMatrix1", "scratchHPRMatrix2", "oldTransform", "pitch", "updateFrustum", "maxZoomOut", "ratio", "clampMove2D", "setTransformPosition", "setTransformUp", "setTransformDirection", "inverse", "scratchAdjustOrthographicFrustumMousePosition", "Cartesian2_default", "scratchPickRay", "Ray_default", "scratchRayIntersection", "scratchDepthIntersection", "calculateOrthographicFrustumWidth", "globe", "mousePosition", "rayIntersection", "ray", "depthIntersection", "distance", "depthDistance", "rayDistance", "zooming", "OrthographicFrustum_default", "scratchSetViewCartesian", "scratchSetViewTransform1", "scratchSetViewTransform2", "scratchSetViewQuaternion", "Quaternion_default", "scratchSetViewMatrix3", "Matrix3_default", "scratchSetViewCartographic", "setView3D", "hpr", "currentTransform", "localTransform", "rotQuat", "rotMat", "setViewCV", "convert", "setView2D", "newLeft", "newRight", "MapMode2D_default", "scratchToHPRDirection", "scratchToHPRUp", "scratchToHPRRight", "directionUpToHeadingPitchRoll", "orientation", "result", "invTransform", "scratchSetViewOptions", "scratchHpr", "HeadingPitchRoll_default", "options", "defaultValue_default", "destination", "pitchScratch", "duration", "maxRadii", "cartesian", "rotatable2D", "maxProjectedX", "maxProjectedY", "minX", "maxX", "moveScratch", "amount", "cameraPosition", "zoom2D", "lookScratchQuaternion", "lookScratchMatrix", "axis", "angle", "turnAngle", "quaternion", "rotation", "rotateScratchQuaternion", "rotateScratchMatrix", "rotateVertical", "rotateVertScratchP", "rotateVertScratchA", "rotateVertScratchTan", "rotateVertScratchNegate", "p", "northParallel", "southParallel", "constrainedAxis", "dot", "angleToAxis", "tangent", "rotateHorizontal", "newTop", "newBottom", "maxBottom", "maxRight", "zoom3D", "scratchLookAtMatrix4", "target", "offset", "Ellipsoid_default", "scratchLookAtHeadingPitchRangeOffset", "scratchLookAtHeadingPitchRangeQuaternion1", "scratchLookAtHeadingPitchRangeQuaternion2", "scratchHeadingPitchRangeMatrix3", "offsetFromHeadingPitchRange", "range", "pitchQuat", "headingQuat", "rotMatrix", "cartesianOffset", "viewRectangle3DCartographic1", "viewRectangle3DCartographic2", "viewRectangle3DNorthEast", "viewRectangle3DSouthWest", "viewRectangle3DNorthWest", "viewRectangle3DSouthEast", "viewRectangle3DNorthCenter", "viewRectangle3DSouthCenter", "viewRectangle3DCenter", "viewRectangle3DEquator", "defaultRF", "viewRectangle3DEllipsoidGeodesic", "computeD", "upOrRight", "corner", "tanThetaOrPhi", "rectangle", "updateCamera", "cameraRF", "north", "south", "east", "west", "longitude", "latitude", "northCartographic", "southCartographic", "ellipsoidGeodesic", "EllipsoidGeodesic_default", "centerCartographic", "center", "cart", "northEast", "northWest", "northCenter", "southCenter", "southEast", "southWest", "d", "width", "rightScalar", "topScalar", "heightRatio", "tanPhi", "tanTheta", "equatorCartographic", "equatorPosition", "viewRectangleCVCartographic", "viewRectangleCVNorthEast", "viewRectangleCVSouthWest", "rectangleCameraPositionColumbusView", "viewRectangle2DCartographic", "viewRectangle2DNorthEast", "viewRectangle2DSouthWest", "rectangleCameraPosition2D", "top", "pickEllipsoid3DRay", "pickEllipsoid3D", "windowPosition", "intersection", "IntersectionTests_default", "t", "pickEllipsoid2DRay", "pickMap2D", "pickEllipsoidCVRay", "pickMapColumbusView", "canvas", "pickPerspCenter", "pickPerspXDir", "pickPerspYDir", "getPickRayPerspective", "near", "x", "y", "nearCenter", "xDir", "yDir", "scratchDirection", "getPickRayOrthographic", "scratchToCenter", "scratchProj", "boundingSphere", "toCenter", "proj", "scratchPixelSize", "drawingBufferWidth", "drawingBufferHeight", "pixelSize", "createAnimationTemplateCV", "maxY", "newPosition", "updateCV", "value", "interp", "EasingFunction_default", "normalScratch", "centerScratch", "posScratch", "scratchCartesian3Subtract", "createAnimationCV", "normal", "distToC", "dWidth", "dHeight", "mapWidth", "mapHeight", "translateX", "translateY", "scratchFlyToDestination", "newOptions", "isRectangle", "setViewOptions", "that", "flightTween", "tweenOptions", "CameraFlightPath_default", "preloadFlightCamera", "distanceToBoundingSphere3D", "radius", "distanceToBoundingSphere2D", "MINIMUM_ZOOM", "adjustBoundingSphereOffset", "minimumZoom", "maximumZoom", "scratchflyToBoundingSphereTransform", "scratchflyToBoundingSphereDestination", "scratchflyToBoundingSphereDirection", "scratchflyToBoundingSphereUp", "scratchflyToBoundingSphereRight", "scratchFlyToBoundingSphereCart4", "scratchFlyToBoundingSphereQuaternion", "scratchFlyToBoundingSphereMatrix3", "scene2D", "rotateQuat", "scratchCartesian3_1", "scratchCartesian3_2", "scratchCartesian3_3", "scratchCartesian3_4", "horizonPoints", "computeHorizonQuad", "radii", "q", "qMagnitude", "qUnit", "eUnit", "nUnit", "wMagnitude", "eastOffset", "northOffset", "upperLeft", "lowerLeft", "lowerRight", "upperRight", "scratchPickCartesian2", "scratchRectCartesian", "cartoArray", "addToResult", "index", "computedHorizonQuad", "r", "cullingVolume", "BoundingSphere_default", "Intersect_default", "successfulPickCount", "lastLon", "i", "lon", "diff", "frustumWidth", "Camera_default", "CameraEventType", "CameraEventType_default", "getKey", "type", "modifier", "key", "defined_default", "clonePinchMovement", "pinchMovement", "result", "Cartesian2_default", "listenToPinch", "aggregator", "canvas", "CameraEventType_default", "update", "isDown", "eventStartPosition", "pressTime", "releaseTime", "movement", "event", "ScreenSpaceEventType_default", "mouseMovement", "angle", "prevAngle", "TwoPI", "listenToWheel", "delta", "arcLength", "Math_default", "listenMouseButtonDownUp", "lastMovement", "down", "up", "cloneMouseMovement", "listenMouseMove", "typeName", "CameraEventAggregator", "ScreenSpaceEventHandler_default", "modifierName", "KeyboardEventModifier_default", "wheelMoved", "name", "destroyObject_default", "CameraEventAggregator_default", "Cesium3DTileContent", "DeveloperError_default", "value", "batchId", "name", "enabled", "color", "style", "tileset", "frameState", "Cesium3DTileContent_default", "Cesium3DTilePassState", "options", "Cesium3DTilePassState_default", "ConditionsExpression", "conditionsExpression", "defines", "clone_default", "setRuntime", "Statement", "condition", "expression", "runtimeConditions", "conditions", "defined_default", "length", "i", "statement", "cond", "condExpression", "Expression_default", "feature", "result", "functionSignature", "variableSubstitutionMap", "shaderState", "returnType", "shaderFunction", "variables", "variable", "index", "ConditionsExpression_default", "Cesium3DTileStyle", "style", "setup", "that", "styleJson", "defaultValue_default", "clone_default", "meta", "defined_default", "defines", "metaJson", "property", "Expression_default", "getExpression", "tileStyle", "value", "ConditionsExpression_default", "getJsonFromExpression", "expression", "url", "Resource_default", "functionSignature", "variableSubstitutionMap", "shaderState", "variables", "variable", "index", "Cesium3DTileStyle_default", "CircleEmitter", "radius", "defaultValue_default", "value", "particle", "theta", "Math_default", "rad", "x", "y", "z", "Cartesian3_default", "CircleEmitter_default", "CloudType", "cloudType", "CloudType_default", "CumulusCloud", "options", "cloudCollection", "defaultValue_default", "Cartesian3_default", "defined_default", "Cartesian2_default", "defaultMaxSize", "Color_default", "SHOW_INDEX", "POSITION_INDEX", "SCALE_INDEX", "MAXIMUM_SIZE_INDEX", "SLICE_INDEX", "BRIGHTNESS_INDEX", "COLOR_INDEX", "makeDirty", "cloud", "propertyChanged", "value", "position", "scale", "maximumSize", "color", "CumulusCloud_default", "attributeLocations", "scratchTextureDimensions", "Cartesian3_default", "attributeLocationsBatched", "attributeLocationsInstanced", "SHOW_INDEX", "CumulusCloud_default", "POSITION_INDEX", "SCALE_INDEX", "MAXIMUM_SIZE_INDEX", "SLICE_INDEX", "BRIGHTNESS_INDEX", "NUMBER_OF_PROPERTIES", "COLOR_INDEX", "CloudCollection", "options", "defaultValue_default", "that", "getNoiseTextureDimensions", "collection", "removeClouds", "destroyClouds", "clouds", "length", "i", "cloudType", "CloudType_default", "cloud", "cloudCollection", "newClouds", "j", "defined_default", "propertyChanged", "index", "texturePositions", "textureIndices", "createTextureVA", "context", "positionBuffer", "Buffer_default", "BufferUsage_default", "indexBuffer", "IndexDatatype_default", "attributes", "ComponentDatatype_default", "VertexArray_default", "getIndexBuffer", "getIndexBufferBatched", "indices", "getIndexBufferInstanced", "getVertexBufferInstanced", "vertexBuffer", "createVAF", "numberOfClouds", "instanced", "sizeInVertices", "VertexArrayFacade_default", "writePositionScratch", "EncodedCartesian3_default", "writePositionAndScale", "frameState", "vafWriters", "positionHighWriter", "positionLowWriter", "position", "scale", "high", "low", "writePackedAttribute0", "writer", "show", "brightness", "writePackedAttribute1", "maximumSize", "slice", "writeColor", "color", "red", "Color_default", "green", "blue", "alpha", "writeCloud", "createNoiseTexture", "vsSource", "fsSource", "textureSliceWidth", "noiseTextureRows", "ShaderProgram_default", "noiseDetail", "noiseOffset", "Texture_default", "PixelDatatype_default", "PixelFormat_default", "Sampler_default", "TextureWrap_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "textureCommand", "ComputeCommand_default", "texture", "createVertexArray", "cloudsLength", "scratchWriterArray", "updateClouds", "cloudsToUpdate", "cloudsToUpdateLength", "properties", "writers", "numWriters", "c", "w", "createShaderProgram", "vs", "ShaderSource_default", "fs", "RenderState_default", "WebGLConstants_default", "BlendingState_default", "createDrawCommands", "pass", "uniforms", "commandList", "colorList", "va", "vaLength", "command", "DrawCommand_default", "Pass_default", "debugging", "CloudNoiseVS_default", "CloudNoiseFS_default", "CloudCollectionVS_default", "CloudCollectionFS_default", "destroyObject_default", "CloudCollection_default", "computeFlyToLocationForRectangle", "rectangle", "scene", "terrainProvider", "mapProjection", "ellipsoid", "positionWithoutTerrain", "tmp", "SceneMode_default", "defined_default", "availability", "cartographics", "Rectangle_default", "positionsOnTerrain", "maxHeight", "currentMax", "item", "finalPosition", "sampleTerrainMostDetailed_default", "computeFlyToLocationForRectangle_default", "defaultAngle", "Math_default", "ConeEmitter", "angle", "defaultValue_default", "value", "particle", "radius", "theta", "rad", "x", "y", "z", "Cartesian3_default", "ConeEmitter_default", "scratchColor", "Color_default", "scratchColorAbove", "scratchColorBelow", "scratchColorBlend", "scratchPackedFloat", "Cartesian4_default", "scratchColorBytes", "lerpEntryColor", "height", "entryBefore", "entryAfter", "result", "lerpFactor", "createNewEntry", "color", "removeDuplicates", "entries", "entry", "index", "array", "hasPrev", "hasNext", "sameHeightAsPrev", "sameHeightAsNext", "sameColorAsPrev", "sameColorAsNext", "preprocess", "layers", "i", "j", "layeredEntries", "layersLength", "layer", "entriesOrig", "entriesLength", "entryOrig", "Math_default", "createElevationBandMaterial", "sortedAscending", "sortedDescending", "currEntry", "nextEntry", "mergeSort_default", "a", "b", "extendDownwards", "defaultValue_default", "extendUpwards", "createLayeredEntries", "entriesAccumNext", "entriesAccumCurr", "addEntry", "addBlendEntry", "layerLength", "idx", "accumIdx", "entriesAccumLength", "prevEntry", "entryAccum", "prevEntryAccum", "nextEntryAccum", "defined_default", "isSplitAccum", "isStartAccum", "isEndAccum", "isSplit", "isStart", "isEnd", "colorBelow", "colorAbove", "options", "scene", "heightTexBuffer", "heightTexDatatype", "heightTexFormat", "PixelDatatype_default", "PixelFormat_default", "heightsTex", "Texture_default", "Sampler_default", "TextureWrap_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "colorsArray", "colorsTex", "Material_default", "context", "createElevationBandMaterial_default", "createOsmBuildings", "options", "combine_default", "IonResource_default", "tileset", "Cesium3DTileset_default", "style", "defined_default", "color", "defaultValue_default", "Color_default", "Cesium3DTileStyle_default", "createOsmBuildings_default", "createTangentSpaceDebugPrimitive", "options", "defaultValue_default", "instances", "geometry", "defined_default", "attributes", "modelMatrix", "Matrix4_default", "length", "GeometryInstance_default", "GeometryPipeline_default", "ColorGeometryInstanceAttribute_default", "Primitive_default", "PerInstanceColorAppearance_default", "createTangentSpaceDebugPrimitive_default", "templateRegex", "tags", "xTag", "yTag", "zTag", "sTag", "reverseXTag", "reverseYTag", "reverseZTag", "westDegreesTag", "southDegreesTag", "eastDegreesTag", "northDegreesTag", "westProjectedTag", "southProjectedTag", "eastProjectedTag", "northProjectedTag", "widthTag", "heightTag", "pickFeaturesTags", "combine_default", "iTag", "jTag", "reverseITag", "reverseJTag", "longitudeDegreesTag", "latitudeDegreesTag", "longitudeProjectedTag", "latitudeProjectedTag", "formatTag", "UrlTemplateImageryProvider", "options", "Event_default", "defined_default", "that", "properties", "customTags", "allTags", "allPickFeaturesTags", "resource", "Resource_default", "pickFeaturesResource", "defaultValue_default", "WebMercatorTilingScheme_default", "Rectangle_default", "credit", "Credit_default", "x", "y", "level", "request", "ImageryProvider_default", "buildImageResource", "longitude", "latitude", "formatIndex", "handleResponse", "format", "data", "doRequest", "buildPickFeaturesResource", "degreesScratchComputed", "degreesScratch", "projectedScratchComputed", "projectedScratch", "imageryProvider", "url", "templateValues", "match", "tag", "key", "ijScratchComputed", "ijScratch", "Cartesian2_default", "longitudeLatitudeProjectedScratchComputed", "padWithZerosIfNecessary", "value", "paddingTemplate", "paddingTemplateWidth", "reverseX", "reverseY", "maximumLevel", "reverseZ", "index", "computeDegrees", "Math_default", "computeProjected", "computeIJ", "rectangleScratch", "longitudeLatitudeProjectedScratch", "Cartesian3_default", "computeLongitudeLatitudeProjected", "projected", "rectangle", "cartographicScratch", "Cartographic_default", "GeographicProjection_default", "cartographic", "UrlTemplateImageryProvider_default", "TileMapServiceImageryProvider", "options", "defaultValue_default", "resource", "that", "promise", "url", "Resource_default", "e", "UrlTemplateImageryProvider_default", "defined_default", "RequestErrorEvent_default", "confineRectangleToTilingScheme", "rectangle", "tilingScheme", "calculateSafeMinimumDetailLevel", "minimumLevel", "swTile", "Rectangle_default", "neTile", "xml", "tileFormatRegex", "tileSetRegex", "tileSetsRegex", "bboxRegex", "format", "bbox", "tilesets", "tilesetsList", "xmlResource", "metadataError", "requestMetadata", "nodeList", "i", "tileSetNodes", "j", "message", "TileProviderError_default", "RuntimeError_default", "fileExtension", "tileWidth", "tileHeight", "maximumLevel", "tilingSchemeName", "GeographicTilingScheme_default", "WebMercatorTilingScheme_default", "sw", "ne", "swXY", "neXY", "Cartesian2_default", "isGdal2tiles", "GeographicProjection_default", "Cartographic_default", "projection", "templateResource", "TileMapServiceImageryProvider_default", "GoogleEarthEnterpriseMapsProvider", "options", "defaultValue_default", "url", "path", "resource", "Resource_default", "Credit_default", "Event_default", "metadataResource", "that", "metadataError", "metadataSuccess", "text", "data", "layer", "i", "message", "defined_default", "TileProviderError_default", "requestMetadata", "RuntimeError_default", "GeographicTilingScheme_default", "Rectangle_default", "WebMercatorTilingScheme_default", "metadataFailure", "e", "x", "y", "level", "request", "ImageryProvider_default", "longitude", "latitude", "buildModuleUrl_default", "value", "GoogleEarthEnterpriseMapsProvider_default", "trailingSlashRegex", "defaultCredit", "Credit_default", "MapboxImageryProvider", "options", "defaultValue_default", "mapId", "accessToken", "resource", "Resource_default", "format", "templateUrl", "credit", "defined_default", "UrlTemplateImageryProvider_default", "x", "y", "level", "request", "longitude", "latitude", "MapboxImageryProvider_default", "SingleTileImageryProvider", "options", "defaultValue_default", "resource", "Resource_default", "rectangle", "Rectangle_default", "tilingScheme", "GeographicTilingScheme_default", "Event_default", "credit", "Credit_default", "that", "error", "success", "image", "TileProviderError_default", "failure", "e", "message", "doRequest", "RuntimeError_default", "ImageryProvider_default", "x", "y", "level", "request", "defined_default", "longitude", "latitude", "SingleTileImageryProvider_default", "GetFeatureInfoFormat", "type", "format", "callback", "defined_default", "geoJsonToFeatureInfo", "xmlToFeatureInfo", "textToFeatureInfo", "json", "result", "features", "feature", "featureInfo", "ImageryLayerFeatureInfo_default", "longitude", "latitude", "Cartographic_default", "mapInfoMxpNamespace", "esriWmsNamespace", "wfsNamespace", "gmlNamespace", "xml", "documentElement", "mapInfoXmlToFeatureInfo", "esriXmlToFeatureInfo", "gmlToFeatureInfo", "RuntimeError_default", "msGmlToFeatureInfo", "unknownXmlToFeatureInfo", "featureIndex", "properties", "propertyElements", "propertyIndex", "propertyElement", "name", "value", "featureInfoResponse", "propertyAttributes", "attributeIndex", "attribute", "imageryLayerFeatureInfoFromDataAndProperties", "featureInfoElements", "featureInfoElementIndex", "featureInfoElement", "featureInfoChildren", "childIndex", "child", "featureMembers", "featureMember", "getGmlPropertiesRecursively", "layer", "children", "i", "gmlNode", "isSingleValue", "data", "xmlText", "element", "pre", "emptyBodyRegex", "wmsServiceExceptionReportRegex", "titleRegex", "text", "title", "GetFeatureInfoFormat_default", "TimeDynamicImagery", "options", "defaultValue_default", "clock", "value", "x", "y", "level", "request", "key", "getKey", "result", "cache", "defined_default", "item", "e", "tilesRequestedForInterval", "approachingInterval", "getApproachingInterval", "tile", "addToCache", "time", "index", "currentIntervalIndex", "currentCache", "t", "tilesRequested", "success", "getKeyElements", "s", "that", "times", "isAnimating", "multiplier", "seconds", "interval", "JulianDate_default", "tileCache", "intervalTileCache", "keyElements", "Request_default", "RequestType_default", "promise", "TimeDynamicImagery_default", "includesReverseAxis", "excludesReverseAxis", "WebMapServiceImageryProvider", "options", "defaultValue_default", "defined_default", "DeveloperError_default", "resource", "Resource_default", "pickFeatureResource", "objectToLowercase", "that", "TimeDynamicImagery_default", "x", "y", "level", "request", "interval", "requestImage", "parameters", "WebMercatorProjection_default", "parts", "code", "pickFeatureParams", "UrlTemplateImageryProvider_default", "GeographicTilingScheme_default", "imageryProvider", "col", "row", "dynamicIntervalData", "tileProvider", "pickFeatures", "longitude", "latitude", "enablePickFeatures", "value", "result", "timeDynamicImagery", "currentInterval", "GetFeatureInfoFormat_default", "obj", "key", "WebMapServiceImageryProvider_default", "defaultParameters", "WebMapTileServiceImageryProvider", "options", "defaultValue_default", "resource", "Resource_default", "style", "tileMatrixSetID", "url", "bracketMatch", "defined_default", "templateValues", "WebMercatorTilingScheme_default", "that", "TimeDynamicImagery_default", "x", "y", "level", "request", "interval", "requestImage", "swTile", "Rectangle_default", "neTile", "tileCount", "Event_default", "credit", "Credit_default", "imageryProvider", "col", "row", "labels", "tileMatrix", "subdomains", "staticDimensions", "dynamicIntervalData", "query", "combine_default", "ImageryProvider_default", "value", "result", "timeDynamicImagery", "currentInterval", "longitude", "latitude", "WebMapTileServiceImageryProvider_default", "createFactory", "Type", "options", "ImageryProviderMapping", "ArcGisMapServerImageryProvider_default", "BingMapsImageryProvider_default", "GoogleEarthEnterpriseMapsProvider_default", "MapboxImageryProvider_default", "SingleTileImageryProvider_default", "TileMapServiceImageryProvider_default", "UrlTemplateImageryProvider_default", "WebMapServiceImageryProvider_default", "WebMapTileServiceImageryProvider_default", "IonImageryProvider", "defaultValue_default", "assetId", "Event_default", "that", "endpointResource", "IonResource_default", "cacheKey", "promise", "defined_default", "endpoint", "RuntimeError_default", "imageryProvider", "externalType", "factory", "tileProviderError", "x", "y", "level", "innerCredits", "request", "longitude", "latitude", "IonImageryProvider_default", "IonWorldImageryStyle", "IonWorldImageryStyle_default", "createWorldImagery", "options", "defaultValue_default", "style", "IonWorldImageryStyle_default", "IonImageryProvider_default", "createWorldImagery_default", "import_urijs", "mobileWidth", "lightboxHeight", "textColor", "highlightColor", "CreditDisplayElement", "credit", "count", "defaultValue_default", "contains", "credits", "len", "existingCredit", "Credit_default", "swapCesiumCredit", "creditDisplay", "previousCredit", "currentCredit", "defined_default", "delimiterClassName", "createDelimiterElement", "delimiter", "delimiterElement", "createCreditElement", "element", "elementWrapperTagName", "wrapper", "displayCredits", "container", "childNodes", "domIndex", "credit1", "credit2", "creditIndex", "delimiterDomIndex", "existingDelimiter", "existingElement", "styleLightboxContainer", "that", "lightboxCredits", "width", "height", "addStyle", "selector", "styles", "style", "attribute", "appendCss", "head", "css", "CreditDisplay", "viewport", "lightbox", "hideLightbox", "event", "title", "closeButton", "creditList", "cesiumCreditContainer", "screenContainer", "expandLink", "cesiumCredit", "AssociativeArray_default", "setCredit", "creditDisplayElement", "pool", "poolIndex", "getDefaultCredit", "defaultCredits", "index", "currentFrameCredits", "screenCredits", "defaultCredit", "destroyObject_default", "logo", "buildModuleUrl_default", "Uri", "value", "CreditDisplay_default", "DebugAppearance", "options", "defaultValue_default", "attributeName", "perInstanceAttribute", "defined_default", "glslDatatype", "varyingName", "getColor", "vs", "fs", "Appearance_default", "DebugAppearance_default", "DebugCameraPrimitive", "options", "defaultValue_default", "Color_default", "scratchRight", "Cartesian3_default", "scratchRotation", "Matrix3_default", "scratchOrientation", "Quaternion_default", "scratchPerspective", "PerspectiveFrustum_default", "scratchPerspectiveOffCenter", "PerspectiveOffCenterFrustum_default", "scratchOrthographic", "OrthographicFrustum_default", "scratchOrthographicOffCenter", "OrthographicOffCenterFrustum_default", "scratchColor", "scratchSplits", "frameState", "planesPrimitives", "outlinePrimitives", "length", "camera", "cameraFrustum", "frustum", "numFrustums", "frustumSplits", "defined_default", "position", "direction", "up", "right", "rotation", "orientation", "Primitive_default", "GeometryInstance_default", "FrustumGeometry_default", "ColorGeometryInstanceAttribute_default", "PerInstanceColorAppearance_default", "FrustumOutlineGeometry_default", "i", "destroyObject_default", "DebugCameraPrimitive_default", "DebugInspector", "getAttributeLocations", "shaderProgram", "attributeLocations", "attributes", "a", "createDebugShowFrustumsShaderProgram", "scene", "context", "sp", "fs", "targets", "source", "ShaderSource_default", "re", "match", "length", "newMain", "i", "ShaderProgram_default", "scratchFrustumColor", "Color_default", "createDebugShowFrustumsUniformMap", "command", "debugUniformMap", "defined_default", "scratchShowFrustumCommand", "DrawCommand_default", "passState", "shaderProgramId", "debugShaderProgram", "debugCommand", "DebugInspector_default", "DebugModelMatrixPrimitive", "options", "defaultValue_default", "Matrix4_default", "frameState", "defined_default", "x", "GeometryInstance_default", "PolylineGeometry_default", "Cartesian3_default", "PolylineColorAppearance_default", "Color_default", "ArcType_default", "y", "z", "Primitive_default", "destroyObject_default", "DebugModelMatrixPrimitive_default", "DepthPlane", "depthPlaneEllipsoidOffset", "defaultValue_default", "depthQuadScratch", "FeatureDetection_default", "scratchCartesian1", "Cartesian3_default", "scratchCartesian2", "scratchCartesian3", "scratchCartesian4", "scratchCartesian5", "computeDepthQuad", "ellipsoid", "frameState", "radii", "camera", "center", "eastOffset", "northOffset", "OrthographicFrustum_default", "p", "q", "qUnit", "eUnit", "nUnit", "qMagnitude", "wMagnitude", "scalar", "upperLeft", "lowerLeft", "upperRight", "lowerRight", "SceneMode_default", "context", "Ellipsoid_default", "useLogDepth", "defined_default", "RenderState_default", "DrawCommand_default", "BoundingSphere_default", "Pass_default", "vs", "ShaderSource_default", "DepthPlaneVS_default", "fs", "DepthPlaneFS_default", "extension", "ShaderProgram_default", "depthQuad", "geometry", "Geometry_default", "GeometryAttribute_default", "ComponentDatatype_default", "PrimitiveType_default", "VertexArray_default", "BufferUsage_default", "passState", "DepthPlane_default", "DerivedCommand", "fragDepthRegex", "discardRegex", "getDepthOnlyShaderProgram", "context", "shaderProgram", "shader", "defined_default", "attributeLocations", "fs", "i", "writesDepthOrDiscards", "sources", "length", "usesLogDepth", "defines", "source", "ShaderSource_default", "getDepthOnlyRenderState", "scene", "renderState", "cache", "depthOnlyState", "rs", "RenderState_default", "command", "result", "DrawCommand_default", "writeLogDepthRegex", "vertexlogDepthRegex", "extensionRegex", "getLogDepthShaderProgram", "vs", "logMain", "writesLogDepth", "addExtension", "logSource", "getPickShaderProgram", "pickId", "newMain", "newSources", "getPickRenderState", "pickState", "getHdrShaderProgram", "DerivedCommand_default", "DeviceOrientationCameraController", "scene", "that", "callback", "e", "alpha", "defined_default", "Math_default", "scratchQuaternion1", "Quaternion_default", "scratchQuaternion2", "scratchMatrix3", "Matrix3_default", "rotate", "camera", "beta", "gamma", "direction", "right", "up", "bQuat", "gQuat", "rotQuat", "aQuat", "matrix", "a", "b", "g", "destroyObject_default", "DeviceOrientationCameraController_default", "DirectionalLight", "options", "Cartesian3_default", "Color_default", "defaultValue_default", "DirectionalLight_default", "attributeLocations", "EllipsoidPrimitive", "options", "defaultValue_default", "Cartesian3_default", "BoundingSphere_default", "Matrix4_default", "Material_default", "DrawCommand_default", "that", "getVertexArray", "context", "vertexArray", "defined_default", "geometry", "BoxGeometry_default", "VertexFormat_default", "VertexArray_default", "BufferUsage_default", "logDepthExtension", "frameState", "SceneMode_default", "translucent", "translucencyChanged", "RenderState_default", "CullFace_default", "BlendingState_default", "boundingSphereDirty", "radii", "r", "materialChanged", "lightingChanged", "useLogDepth", "useLogDepthChanged", "colorCommand", "vs", "fs", "ShaderSource_default", "EllipsoidVS_default", "EllipsoidFS_default", "ShaderProgram_default", "combine_default", "commandList", "passes", "Pass_default", "pickCommand", "destroyObject_default", "EllipsoidPrimitive_default", "EllipsoidSurfaceAppearanceFS_default", "EllipsoidSurfaceAppearanceVS_default", "EllipsoidSurfaceAppearance", "options", "defaultValue_default", "translucent", "aboveGround", "defined_default", "Material_default", "EllipsoidSurfaceAppearanceVS_default", "EllipsoidSurfaceAppearanceFS_default", "Appearance_default", "VertexFormat_default", "EllipsoidSurfaceAppearance_default", "Fog", "heightsTable", "densityTable", "i", "tableStartDensity", "tableEndDensity", "j", "tableLastIndex", "findInterval", "height", "heights", "length", "scratchPositionNormal", "Cartesian3_default", "frameState", "camera", "positionCartographic", "defined_default", "SceneMode_default", "t", "Math_default", "density", "startDensity", "endDensity", "positionNormal", "dot", "Fog_default", "FrameRateMonitor", "options", "defaultValue_default", "Event_default", "that", "scene", "time", "update", "visibilityChangeEventName", "visibilityChangeListener", "visibilityChanged", "defined_default", "destroyObject_default", "monitor", "timeStamp", "getTimestamp_default", "TimeConstants_default", "beginningOfWindow", "averageTimeBetweenFrames", "maximumFrameTime", "FrameRateMonitor_default", "FrameState", "context", "creditDisplay", "jobScheduler", "SceneMode_default", "FrameState_default", "FrustumCommands", "near", "far", "defaultValue_default", "numPasses", "Pass_default", "commands", "indices", "i", "FrustumCommands_default", "getClipAndStyleCode", "samplerUniformName", "matrixUniformName", "styleUniformName", "getClipAndStyleCode_default", "textureResolutionScratch", "Cartesian2_default", "getClippingFunction", "clippingPlaneCollection", "context", "unionClippingRegions", "clippingPlanesLength", "usingFloatTexture", "ClippingPlaneCollection_default", "textureResolution", "width", "height", "functions", "getClippingPlaneFloat", "getClippingPlaneUint8", "clippingFunctionUnion", "clippingFunctionIntersect", "pixelWidth", "pixelHeight", "pixelWidthString", "pixelHeightString", "getClippingFunction_default", "GlobeSurfaceShader", "numberOfDayTextures", "flags", "material", "shaderProgram", "clippingShaderState", "GlobeSurfaceShaderSet", "getPositionMode", "sceneMode", "getPosition3DMode", "getPositionColumbusViewAnd2DMode", "getPositionMorphingMode", "positionMode", "SceneMode_default", "get2DYPositionFraction", "useWebMercatorProjection", "options", "frameState", "surfaceTile", "applyBrightness", "applyContrast", "applyHue", "applySaturation", "applyGamma", "applyAlpha", "applyDayNightAlpha", "applySplit", "showReflectiveOcean", "showOceanWaves", "enableLighting", "dynamicAtmosphereLighting", "dynamicAtmosphereLightingFromSun", "showGroundAtmosphere", "perFragmentGroundAtmosphere", "hasVertexNormals", "enableFog", "enableClippingPlanes", "clippingPlanes", "clippedByBoundaries", "hasImageryLayerCutout", "colorCorrect", "highlightFillTile", "colorToAlpha", "hasGeodeticSurfaceNormals", "hasExaggeration", "showUndergroundColor", "translucent", "quantization", "quantizationDefine", "terrainEncoding", "TerrainQuantization_default", "cartographicLimitRectangleFlag", "cartographicLimitRectangleDefine", "imageryCutoutFlag", "imageryCutoutDefine", "currentClippingShaderState", "defined_default", "surfaceShader", "shadersByFlags", "vs", "fs", "getClippingFunction_default", "computeDayColor", "i", "shader", "ShaderProgram_default", "shadersByTexturesFlags", "textureCount", "destroyObject_default", "GlobeSurfaceShaderSet_default", "ImageryState", "ImageryState_default", "QuadtreeTileLoadState", "QuadtreeTileLoadState_default", "TerrainState", "TerrainState_default", "GlobeSurfaceTile", "Cartesian4_default", "Cartesian3_default", "TerrainState_default", "BoundingSphere_default", "terrainState", "shouldRemoveTile", "imagery", "i", "len", "tileImagery", "defined_default", "ImageryState_default", "scratchCartographic", "Cartographic_default", "getPosition", "encoding", "mode", "projection", "vertices", "index", "result", "position", "SceneMode_default", "positionCartographic", "scratchV0", "scratchV1", "scratchV2", "ray", "cullBackFaces", "mesh", "indices", "indicesLength", "minT", "i0", "i1", "i2", "v0", "v1", "v2", "t", "IntersectionTests_default", "Ray_default", "imageryList", "tile", "terrainProvider", "imageryLayerCollection", "surfaceTile", "QuadtreeTileLoadState_default", "prepareNewTile", "frameState", "quadtree", "vertexArraysToDestroy", "terrainOnly", "processTerrainStateMachine", "wasAlreadyRenderable", "isTerrainDoneLoading", "isImageryDoneLoading", "callbacks", "newCallbacks", "layerId", "skipLoading", "isUpsampledOnly", "isAnyTileLoaded", "isDoneLoading", "tileImageryCollection", "imageryLayer", "thisTileDoneLoading", "toggleGeodeticSurfaceNormals", "enabled", "ellipsoid", "renderedMesh", "vertexBuffer", "vertexCount", "newEncoding", "TerrainEncoding_default", "newStride", "newVertexBuffer", "exaggeration", "exaggerationRelativeHeight", "hasExaggerationScale", "encodingExaggerationScaleChanged", "encodingRelativeHeightChanged", "customData", "customDataLength", "data", "available", "parent", "parentSurfaceTile", "layer", "upsample", "requestTileGeometry", "transform", "createResources", "createWaterMaskTextureIfNeeded", "sourceTile", "x", "y", "level", "sourceData", "sourceX", "sourceY", "sourceLevel", "terrainDataPromise", "terrainData", "success", "failure", "error", "RequestState_default", "message", "TileProviderError_default", "doRequest", "request", "Request_default", "RequestType_default", "requestPromise", "e", "scratchCreateMeshOptions", "tilingScheme", "createMeshOptions", "meshPromise", "context", "typedArray", "buffer", "Buffer_default", "BufferUsage_default", "attributes", "indexBuffers", "indexBuffer", "IndexDatatype_default", "VertexArray_default", "vertexArray", "getContextWaterMaskData", "allWaterTexture", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "sampler", "Sampler_default", "TextureWrap_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "waterMask", "waterMaskData", "texture", "waterMaskLength", "textureSize", "sourceTileRectangle", "tileRectangle", "tileWidth", "tileHeight", "scaleX", "scaleY", "GlobeSurfaceTile_default", "Imagery", "imageryLayer", "x", "y", "level", "rectangle", "parentX", "parentY", "parentLevel", "ImageryState_default", "defined_default", "result", "destroyObject_default", "frameState", "needGeographicProjection", "skipLoading", "needsReprojection", "Imagery_default", "TileImagery", "imagery", "textureCoordinateRectangle", "useWebMercatorT", "defined_default", "tile", "frameState", "skipLoading", "loadingImagery", "imageryLayer", "ImageryState_default", "ancestor", "closestAncestorThatNeedsLoading", "TileImagery_default", "ImageryLayer", "imageryProvider", "options", "defaultValue_default", "Rectangle_default", "TileImagery_default", "Imagery_default", "SplitDirection_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "destroyObject_default", "imageryBoundsScratch", "tileImageryBoundsScratch", "clippedRectangleScratch", "terrainRectangleScratch", "rectangle", "tile", "terrainProvider", "insertionPoint", "surfaceTile", "defined_default", "useWebMercatorT", "WebMercatorProjection_default", "imageryBounds", "baseImageryRectangle", "baseTerrainRectangle", "latitudeClosestToEquator", "targetGeometricError", "imageryLevel", "getLevelWithMaximumTexelSpacing", "maximumLevel", "minimumLevel", "imageryTilingScheme", "northwestTileCoordinates", "southeastTileCoordinates", "veryCloseX", "veryCloseY", "northwestTileRectangle", "southeastTileRectangle", "terrainRectangle", "imageryRectangle", "clippedImageryRectangle", "imageryTileXYToRectangle", "minU", "maxU", "minV", "maxV", "initialMinV", "i", "j", "texCoordsRectangle", "Cartesian4_default", "imagery", "tileImagery", "tilingScheme", "terrainWidth", "terrainHeight", "scaleX", "scaleY", "that", "success", "image", "failure", "ImageryState_default", "TileProviderError_default", "e", "RequestState_default", "message", "doRequest", "request", "Request_default", "RequestType_default", "imagePromise", "context", "sampler", "Sampler_default", "Texture_default", "PixelFormat_default", "discardPolicy", "texture", "getSamplerKey", "minificationFilter", "magnificationFilter", "maximumAnisotropy", "Math_default", "maximumSupportedAnisotropy", "ContextLimits_default", "mipmapSamplerKey", "mipmapSamplers", "mipmapSampler", "TextureWrap_default", "MipmapHint_default", "nonMipmapSamplerKey", "nonMipmapSamplers", "nonMipmapSampler", "frameState", "needGeographicProjection", "GeographicProjection_default", "computeCommand", "ComputeCommand_default", "command", "reprojectToGeographic", "outputTexture", "computeCommands", "length", "x", "y", "level", "cacheKey", "getImageryCacheKey", "uniformMap", "Cartesian2_default", "float32ArrayScratch", "FeatureDetection_default", "reproject", "positions", "index", "reprojectAttributeIndices", "indices", "TerrainProvider_default", "indexBuffer", "Buffer_default", "BufferUsage_default", "IndexDatatype_default", "VertexArray_default", "vs", "ShaderSource_default", "ReprojectWebMercatorVS_default", "ShaderProgram_default", "ReprojectWebMercatorFS_default", "width", "height", "sinLatitude", "southMercatorY", "oneOverMercatorHeight", "south", "north", "webMercatorT", "outputIndex", "webMercatorTIndex", "fraction", "latitude", "mercatorFraction", "layer", "texelSpacing", "ellipsoid", "latitudeFactor", "tilingSchemeRectangle", "twoToTheLevelPower", "ImageryLayer_default", "TileSelectionResult", "value", "TileSelectionResult_default", "TerrainFillMesh", "tile", "Cartesian4_default", "tileProvider", "frameState", "vertexArraysToDestroy", "createFillMesh", "defined_default", "GlobeSurfaceTile_default", "traversalQueueScratch", "Queue_default", "renderedTiles", "quadtree", "levelZeroTiles", "lastSelectionFrameNumber", "traversalQueue", "i", "renderedTile", "tileToWest", "tileToSouth", "tileToEast", "tileToNorth", "visitRenderedTiles", "TileEdge_default", "tileToNorthwest", "tileToSouthwest", "tileToNortheast", "tileToSoutheast", "sourceTile", "startTile", "currentFrameNumber", "tileEdge", "downOnly", "TileSelectionResult_default", "parent", "visitTile", "DeveloperError_default", "destinationTile", "frameNumber", "destinationSurfaceTile", "propagateEdge", "destinationFill", "sourceMesh", "sourceFill", "edgeMeshes", "edgeTiles", "startIndex", "endIndex", "existingTile", "existingRectangle", "sourceRectangle", "epsilon", "destinationRectangle", "Math_default", "cartographicScratch", "Cartographic_default", "centerCartographicScratch", "cartesianScratch", "Cartesian3_default", "normalScratch", "octEncodedNormalScratch", "Cartesian2_default", "uvScratch2", "uvScratch", "HeightAndNormal", "fillMissingCorner", "fill", "ellipsoid", "u", "v", "corner", "adjacentCorner1", "adjacentCorner2", "oppositeCorner", "vertex", "height", "tileBoundingRegion", "minimumHeight", "maximumHeight", "getVertexWithHeightAtCorner", "heightRangeScratch", "scratchCenter", "swVertexScratch", "seVertexScratch", "nwVertexScratch", "neVertexScratch", "heightmapBuffer", "scratchCreateMeshSyncOptions", "surfaceTile", "rectangle", "exaggeration", "exaggerationRelativeHeight", "hasExaggeration", "nwCorner", "getCorner", "swCorner", "seCorner", "neCorner", "southwestHeight", "southeastHeight", "northwestHeight", "northeastHeight", "middleHeight", "len", "geometricError", "minCutThroughRadius", "maxTileWidth", "terrainData", "HeightmapTerrainData_default", "createMeshSyncOptions", "hasGeodeticSurfaceNormals", "centerCartographic", "Rectangle_default", "center", "encoding", "TerrainEncoding_default", "maxVertexCount", "meshes", "heightRange", "stride", "typedArray", "nextIndex", "northwestIndex", "addVertexWithComputedPosition", "addEdge", "southwestIndex", "southeastIndex", "northeastIndex", "obb", "OrientedBoundingBox_default", "southMercatorY", "WebMercatorProjection_default", "oneOverMercatorHeight", "centerWebMercatorT", "geodeticSurfaceNormal", "centerEncodedNormal", "AttributeCompression_default", "centerIndex", "vertexCount", "bytesPerIndex", "indexCount", "indexDataBytes", "availableBytesInBuffer", "indices", "indexOut", "westIndicesSouthToNorth", "southIndicesEastToWest", "eastIndicesNorthToSouth", "northIndicesWestToEast", "TerrainMesh_default", "BoundingSphere_default", "computeOccludeePoint", "context", "oldTexture", "waterSourceTile", "buffer", "index", "encodedNormal", "webMercatorT", "cartographic", "position", "uv", "sourceRectangleScratch", "transformTextureCoordinates", "targetTile", "coordinates", "result", "targetRectangle", "sourceWidth", "umin", "umax", "sourceHeight", "vmin", "vmax", "encodedNormalScratch", "getVertexFromTileAtCorner", "sourceIndex", "sourceEncoding", "sourceVertices", "normal", "encodedNormalScratch2", "cartesianScratch2", "getInterpolatedVertexAtCorner", "previousIndex", "interpolateU", "previousUv", "nextUv", "ratio", "height1", "height2", "encodedNormal1", "encodedNormal2", "normal1", "normal2", "terrainFillMesh", "cornerTile", "cornerMesh", "previousEdgeTiles", "previousEdgeMeshes", "nextEdgeTiles", "nextEdgeMeshes", "getCornerFromEdge", "vertexIndex", "meshIsUsable", "getClosestHeightToCorner", "previousMeshes", "previousTiles", "previousEdge", "nextMeshes", "nextTiles", "nextEdge", "getNearestHeightOnEdge", "addEdgeMesh", "edgeTile", "edgeMesh", "lastU", "lastV", "compareU", "targetStride", "uOrV", "nearlyEdgeU", "nearlyEdgeV", "latitude", "tiles", "isNext", "edge", "meshStart", "meshEnd", "meshStep", "meshIndex", "mesh", "edgeVertices", "increasing", "vertexIndexIndex", "targetUv", "binarySearch_default", "textureCoordinate", "cornerPositionsScratch", "ellipsoidalOccluder", "cornerPositions", "TerrainFillMesh_default", "GlobeSurfaceTileProvider", "options", "ShadowMode_default", "Event_default", "Color_default", "Rectangle_default", "value", "Cartesian4_default", "terrainProvider", "defined_default", "ClippingPlaneCollection_default", "sortTileImageryByLayerIndex", "a", "b", "aImagery", "bImagery", "frameState", "updateCredits", "surface", "creditDisplay", "imageryLayers", "i", "len", "imageryProvider", "tile", "vertexArraysToDestroy", "length", "j", "GlobeSurfaceTile_default", "tilesToRenderByTextureCount", "tiles", "clippingPlanes", "RenderState_default", "DepthFunction_default", "BlendingState_default", "rs", "clone_default", "TerrainFillMesh_default", "quadtree", "exaggeration", "exaggerationRelativeHeight", "exaggerationChanged", "textureCountIndex", "textureCountLength", "tilesToRender", "tileIndex", "tileLength", "tileBoundingRegion", "addDrawCommandsForTile", "pushCommand", "command", "globeTranslucencyState", "isBlendCommand", "drawCommands", "level", "surfaceTile", "terrainOnly", "terrainStateBefore", "TileSelectionResult_default", "Visibility_default", "boundingSphereScratch", "BoundingSphere_default", "rectangleIntersectionScratch", "splitCartographicLimitRectangleScratch", "rectangleCenterScratch", "Cartographic_default", "clipRectangleAntimeridian", "tileRectangle", "cartographicLimitRectangle", "splitRectangle", "Math_default", "isUndergroundVisible", "tileProvider", "occluders", "distance", "undergroundVisible", "cullingVolume", "boundingVolume", "clippedCartographicLimitRectangle", "areaLimitIntersection", "SceneMode_default", "Cartesian3_default", "planeIntersection", "Intersect_default", "visibility", "intersection", "ortho3D", "OrthographicFrustum_default", "occludeePointInScaledSpace", "readyImageryScratch", "canRenderTraversalStack", "readyImagery", "terrainReady", "initialImageryState", "imagery", "TerrainState_default", "tileImagery", "loadingImagery", "isReady", "ImageryState_default", "layerIndex", "lastFrame", "stack", "descendant", "lastFrameSelectionResult", "descendantSurface", "descendantImagery", "descendantTileImagery", "descendantLoadingImagery", "descendantIsReady", "descendantLayerIndex", "tileDirectionScratch", "obb", "cameraPosition", "cameraDirection", "tileDirection", "magnitude", "modifiedModelViewScratch", "Matrix4_default", "modifiedModelViewProjectionScratch", "tileRectangleScratch", "localizedCartographicLimitRectangleScratch", "localizedTranslucencyRectangleScratch", "rtcScratch", "centerEyeScratch", "southwestScratch", "northeastScratch", "readyTextureCount", "tileImageryCollection", "tileSet", "debug", "cornerPositionsScratch", "computeOccludeePoint", "center", "rectangle", "minimumHeight", "maximumHeight", "result", "ellipsoidalOccluder", "ellipsoid", "cornerPositions", "updateTileBoundingRegion", "min", "max", "cameraHeight", "distanceToMin", "distanceToMax", "TileBoundingRegion_default", "oldMinimumHeight", "oldMaximumHeight", "hasBoundingVolumesFromMesh", "sourceTile", "mesh", "terrainData", "ancestorTile", "ancestorSurfaceTile", "ancestorMesh", "ancestorTerrainData", "TerrainExaggeration_default", "OrientedBoundingBox_default", "needsBounds", "destroyObject_default", "getTileReadyCallback", "tileImageriesToFree", "layer", "startIndex", "defaultValue_default", "endIndex", "index", "that", "tileImageryUpdatedEvent", "insertionPoint", "QuadtreeTileLoadState_default", "numDestroyed", "newIndex", "oldIndex", "show", "scratchClippingPlanesMatrix", "scratchInverseTransposeClippingPlanesMatrix", "createTileUniformMap", "globeSurfaceTileProvider", "uniformMap", "viewMatrix", "centerEye", "projectionMatrix", "transform", "style", "Cartesian2_default", "combine_default", "createWireframeVertexArrayIfNecessary", "context", "provider", "vertexArray", "createWireframeVertexArray", "terrainMesh", "geometry", "PrimitiveType_default", "GeometryPipeline_default", "wireframeIndices", "wireframeIndexBuffer", "Buffer_default", "BufferUsage_default", "IndexDatatype_default", "VertexArray_default", "getDebugOrientedBoundingBox", "getDebugBoundingSphere", "debugDestroyPrimitive", "instanceOBB", "GeometryInstance_default", "BoxOutlineGeometry_default", "instanceSphere", "SphereOutlineGeometry_default", "modelMatrix", "previousVolume", "primitive", "createDebugPrimitive", "instance", "Primitive_default", "PerInstanceColorAppearance_default", "color", "ColorGeometryInstanceAttribute_default", "sphere", "otherPassesInitialColor", "surfaceShaderSetOptionsScratch", "defaultUndergroundColor", "defaultUndergroundColorAlphaByDistance", "NearFarScalar_default", "tileCredits", "tileCreditIndex", "tileCreditLength", "maxTextures", "ContextLimits_default", "waterMaskTexture", "waterMaskTranslationAndScale", "cameraUnderground", "translucent", "frontFaceAlphaByDistance", "backFaceAlphaByDistance", "translucencyRectangle", "undergroundColor", "undergroundColorAlphaByDistance", "showUndergroundColor", "lambertDiffuseMultiplier", "showReflectiveOcean", "oceanNormalMap", "showOceanWaves", "hasVertexNormals", "enableFog", "showGroundAtmosphere", "castShadows", "receiveShadows", "hueShift", "saturationShift", "brightnessShift", "colorCorrect", "perFragmentGroundAtmosphere", "cameraDistance", "fadeOutDistance", "rtc", "encoding", "hasExaggeration", "hasGeodeticSurfaceNormals", "southLatitude", "northLatitude", "southMercatorY", "oneOverMercatorHeight", "useWebMercatorProjection", "projection", "southwest", "northeast", "TerrainQuantization_default", "epsilon", "widthEpsilon", "heightEpsilon", "WebMercatorProjection_default", "surfaceShaderSetOptions", "imageryIndex", "imageryLen", "showSkirts", "backFaceCulling", "firstPassRenderState", "otherPassesRenderState", "renderState", "initialColor", "drawCommandsLength", "numberOfDayTextures", "DrawCommand_default", "boundingSphere", "uniformMapProperties", "frontFaceAlphaByDistanceFinal", "backFaceAlphaByDistanceFinal", "highlightFillTile", "localizedCartographicLimitRectangle", "localizedTranslucencyRectangle", "clippedTranslucencyRectangle", "cartographicTileRectangle", "inverseTileWidth", "inverseTileHeight", "applyFog", "applyBrightness", "applyContrast", "applyHue", "applySaturation", "applyGamma", "applyAlpha", "applyDayNightAlpha", "applySplit", "applyCutout", "applyColorToAlpha", "texture", "imageryLayer", "ImageryLayer_default", "dayTextureCutoutRectangle", "cutoutRectangle", "colorToAlpha", "hasColorToAlpha", "credits", "creditIndex", "creditLength", "clippingPlanesEnabled", "count", "Pass_default", "orientedBoundingBox", "GlobeSurfaceTileProvider_default", "GlobeTranslucency", "Rectangle_default", "value", "NearFarScalar_default", "defined_default", "GlobeTranslucency_default", "ImageryLayerCollection", "Event_default", "layer", "index", "defined_default", "imageryProvider", "ImageryLayer_default", "destroy", "defaultValue_default", "layers", "i", "len", "getLayerIndex", "swapLayers", "collection", "j", "arr", "Math_default", "temp", "applicableRectangleScratch", "Rectangle_default", "pickImageryHelper", "scene", "pickedLocation", "pickFeatures", "callback", "tilesToRender", "pickedTile", "textureIndex", "tile", "imageryTiles", "terrainImagery", "imagery", "provider", "applicableRectangle", "epsilon", "ray", "pickedPosition", "imageryLayers", "promises", "promise", "results", "features", "resultIndex", "result", "image", "featureIndex", "feature", "frameState", "destroyObject_default", "isBaseLayer", "layersShownOrHidden", "ImageryLayerCollection_default", "QuadtreeOccluders", "options", "EllipsoidalOccluder_default", "Cartesian3_default", "QuadtreeOccluders_default", "QuadtreeTile", "options", "TileSelectionResult_default", "QuadtreeTileLoadState_default", "tilingScheme", "numberOfLevelZeroTilesX", "numberOfLevelZeroTilesY", "result", "index", "y", "x", "frameNumber", "added", "removed", "customData", "i", "data", "rectangle", "defined_default", "value", "Rectangle_default", "parent", "parentCustomData", "levelZeroTiles", "xTiles", "tile", "westOfParent", "eastOfParent", "southOfParent", "northOfParent", "freeTile", "QuadtreeTile_default", "TileReplacementQueue", "maximumTiles", "tileToTrim", "keepTrimming", "defined_default", "previous", "remove", "tileReplacementQueue", "item", "next", "head", "TileReplacementQueue_default", "QuadtreePrimitive", "options", "ellipsoid", "TileReplacementQueue_default", "defaultValue_default", "QuadtreeOccluders_default", "Event_default", "invalidateAllTiles", "primitive", "replacementQueue", "clearTileLoadQueue", "levelZeroTiles", "defined_default", "customData", "customDataLength", "j", "data", "tileFunction", "tile", "QuadtreeTileLoadState_default", "tilesRendered", "i", "len", "cartographic", "callback", "object", "addedCallbacks", "length", "frameState", "debug", "passes", "tileProvider", "selectTilesForRendering", "createRenderCommandsForSelectedTiles", "updateTileLoadProgress", "currentLoadQueueLength", "max", "SceneMode_default", "processTileLoadQueue", "updateHeights", "comparisonPoint", "centerScratch", "Cartographic_default", "compareDistanceToPoint", "a", "b", "center", "Rectangle_default", "alon", "alat", "blon", "blat", "cameraOriginScratch", "Cartesian3_default", "rootTraversalDetails", "tilesToRender", "tilingScheme", "QuadtreeTile_default", "numberOfRootTiles", "TraversalDetails", "occluders", "customDataAdded", "customDataRemoved", "frameNumber", "camera", "cameraFrameOrigin", "Matrix4_default", "visitIfVisible", "queueTileLoad", "queue", "TraversalQuadDetails", "result", "southwest", "southeast", "northwest", "northeast", "traversalQuadsByLevel", "visitTile", "ancestorMeetsSse", "traversalDetails", "meetsSse", "screenSpaceError", "southwestChild", "southeastChild", "northwestChild", "northeastChild", "lastFrame", "lastFrameSelectionResult", "TileSelectionResult_default", "oneRenderedLastFrame", "twoCulledOrNotVisited", "threeCompletelyLoaded", "renderable", "addTileToRenderList", "firstRenderedDescendantIndex", "loadIndexLow", "loadIndexMedium", "loadIndexHigh", "tilesToUpdateHeightsIndex", "visitVisibleChildrenNearToFar", "allAreRenderable", "anyWereRenderedLastFrame", "notYetRenderableCount", "queuedForLoad", "renderList", "workTile", "wasRenderedLastFrame", "cameraPosition", "quadDetails", "southwestDetails", "southeastDetails", "northwestDetails", "northeastDetails", "containsNeededPosition", "rectangle", "Visibility_default", "OrthographicFrustum_default", "OrthographicOffCenterFrustum_default", "screenSpaceError2D", "maxGeometricError", "distance", "height", "sseDenominator", "error", "Math_default", "frustum", "context", "width", "pixelSize", "tileLoadQueueHigh", "tileLoadQueueMedium", "tileLoadQueueLow", "endTime", "getTimestamp_default", "didSomeLoading", "processSinglePriorityLoadQueue", "sortByLoadPriority", "loadQueue", "scratchRay", "Ray_default", "scratchCartographic", "scratchPosition", "scratchArray", "tryNextFrame", "tilesToUpdateHeights", "startTime", "timeSlice", "mode", "projection", "selectionResult", "timeSliceMax", "terrainData", "upsampledGeometryFromParent", "surfaceNormal", "rayOrigin", "minimumHeight", "magnitude", "vectorToMinimumPoint", "position", "QuadtreePrimitive_default", "Globe", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "terrainProvider", "EllipsoidTerrainProvider_default", "imageryLayerCollection", "ImageryLayerCollection_default", "GlobeSurfaceShaderSet_default", "QuadtreePrimitive_default", "GlobeSurfaceTileProvider_default", "Event_default", "Color_default", "NearFarScalar_default", "GlobeTranslucency_default", "makeShadersDirty", "Resource_default", "buildModuleUrl_default", "Cartesian3_default", "ShadowMode_default", "defined_default", "value", "Rectangle_default", "material", "globe", "defines", "requireNormals", "fragmentSources", "AtmosphereCommon_default", "GroundAtmosphere_default", "GlobeFS_default", "ShaderSource_default", "GlobeVS_default", "createComparePickTileFunction", "rayOrigin", "a", "b", "aDist", "BoundingSphere_default", "bDist", "scratchArray", "scratchSphereIntersectionResult", "ray", "scene", "cullBackFaces", "result", "mode", "projection", "sphereIntersections", "tilesToRender", "length", "tile", "i", "surfaceTile", "boundingVolume", "SceneMode_default", "boundingSphereIntersection", "IntersectionTests_default", "intersection", "cartoScratch", "Cartographic_default", "carto", "scratchGetHeightCartesian", "scratchGetHeightIntersection", "scratchGetHeightCartographic", "scratchGetHeightRay", "Ray_default", "tileIfContainsCartographic", "cartographic", "levelZeroTiles", "tileWithMesh", "cartesian", "surfaceNormal", "minimumHeight", "magnitude", "vectorToMinimumPoint", "frameState", "surface", "tileProvider", "hasWaterMask", "oceanNormalMapResource", "oceanNormalMapUrl", "that", "image", "Texture_default", "pass", "destroyObject_default", "Globe_default", "PassThrough_default", "PassThroughDepth_default", "GlobeDepth", "FramebufferManager_default", "BoundingRectangle_default", "value", "destroyFramebuffers", "globeDepth", "updateCopyCommands", "context", "width", "height", "passState", "useScissorTest", "updateScissor", "defined_default", "RenderState_default", "BlendingState_default", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "PassThroughDepth_default", "PassThrough_default", "ClearCommand_default", "Color_default", "viewport", "numSamples", "hdr", "clearGlobeDepth", "pixelDatatype", "PixelDatatype_default", "blitStencil", "depthTexture", "depthTextureToCopy", "colorTexture", "clearColor", "clear", "destroyObject_default", "GlobeDepth_default", "GlobeTranslucencyFramebuffer", "FramebufferManager_default", "BoundingRectangle_default", "destroyResources", "globeTranslucency", "updateResources", "context", "width", "height", "hdr", "pixelDatatype", "PixelDatatype_default", "updateCommands", "passState", "useScissorTest", "updateScissor", "defined_default", "RenderState_default", "PassThroughDepth_default", "ClearCommand_default", "Color_default", "viewport", "destroyObject_default", "GlobeTranslucencyFramebuffer_default", "DerivedCommandType", "derivedCommandsMaximumLength", "DerivedCommandNames", "GlobeTranslucencyState", "NearFarScalar_default", "Rectangle_default", "scene", "globe", "defined_default", "updateAlphaByDistance", "isFaceTranslucent", "requiresManualDepthTest", "isSunVisibleThroughGlobe", "isEnvironmentVisible", "useDepthPlane", "getNumberOfTextureUniforms", "gatherDerivedCommandRequirements", "enabled", "alpha", "alphaByDistance", "result", "translucencyEnabled", "state", "frontTranslucent", "backTranslucent", "SceneMode_default", "numberOfTextureUniforms", "getDerivedCommandTypes", "i", "derivedCommandKey", "derivedCommandsToUpdateLength", "derivedCommandsDirty", "createDerivedCommandPacks", "isBlendCommand", "isPickCommand", "types", "length", "cameraUnderground", "translucentFrontFaceCommandType", "translucentBackFaceCommandType", "removeDefine", "defines", "defineToRemove", "index", "hasDefine", "define", "getOpaqueFrontFaceShaderProgram", "vs", "fs", "getOpaqueBackFaceShaderProgram", "getDepthOnlyShaderProgram", "depthOnlyShader", "getTranslucentShaderProgram", "sources", "ShaderSource_default", "globeTranslucencyMain", "getTranslucentBackFaceShaderProgram", "getTranslucentFrontFaceManualDepthTestShaderProgram", "getTranslucentBackFaceManualDepthTestShaderProgram", "getPickShaderProgram", "pickShader", "getDerivedShaderProgram", "context", "shaderProgram", "derivedShaderProgram", "shaderProgramDirty", "getShaderProgramFunction", "cacheName", "shader", "attributeLocations", "getOpaqueFrontFaceRenderState", "renderState", "CullFace_default", "getOpaqueBackFaceRenderState", "getDepthOnlyFrontFaceRenderState", "getDepthOnlyBackFaceRenderState", "getDepthOnlyFrontAndBackFaceRenderState", "getTranslucentFrontFaceRenderState", "BlendingState_default", "getTranslucentBackFaceRenderState", "getPickFrontFaceRenderState", "getPickBackFaceRenderState", "getDerivedRenderState", "derivedRenderState", "renderStateDirty", "getRenderStateFunction", "cache", "cachedRenderState", "rs", "RenderState_default", "getTranslucencyUniformMap", "getDerivedUniformMap", "uniformMap", "derivedUniformMap", "uniformMapDirty", "getDerivedUniformMapFunction", "combine_default", "DerivedCommandPack", "options", "Pass_default", "derivedCommandNames", "derivedCommandPacks", "command", "frameState", "derivedCommandTypes", "derivedCommandsLength", "updateDerivedCommands", "derivedCommandsObject", "frameNumber", "uniformMapDirtyFrame", "defaultValue_default", "shaderProgramDirtyFrame", "renderStateDirtyFrame", "derivedCommandPack", "derivedCommandType", "derivedCommandName", "derivedCommand", "DrawCommand_default", "derivedUniformMapDirtyFrame", "derivedShaderProgramDirtyFrame", "derivedRenderStateDirtyFrame", "derivedUniformMapDirty", "derivedShaderProgramDirty", "derivedRenderStateDirty", "picking", "derivedCommands", "executeCommandsMatchingType", "commands", "commandsLength", "executeCommandFunction", "passState", "type", "executeCommands", "opaqueTypes", "depthOnlyTypes", "frustumCommands", "globeTranslucencyFramebuffer", "globeCommands", "globeCommandsLength", "classificationCommands", "classificationCommandsLength", "originalGlobeDepthTexture", "originalFramebuffer", "packedDepthTexture", "GlobeTranslucencyState_default", "protobuf", "GoogleEarthEnterpriseDiscardPolicy", "image", "GoogleEarthEnterpriseImageryProvider", "options", "defaultValue_default", "metadata", "defined_default", "resource", "Resource_default", "GoogleEarthEnterpriseMetadata_default", "GeographicTilingScheme_default", "Rectangle_default", "Math_default", "credit", "Credit_default", "Event_default", "that", "metadataError", "result", "e", "RuntimeError_default", "TileProviderError_default", "x", "y", "level", "info", "request", "invalidImage", "quadKey", "metadataRequest", "Request_default", "promise", "buildImageResource", "decodeGoogleEarthEnterpriseData_default", "a", "type", "protoImagery", "getImageType", "message", "decodeEarthImageryPacket", "loadImageFromTypedArray_default", "longitude", "latitude", "imageryProvider", "version", "jpeg", "png", "data", "reader", "end", "tag", "copyrightIds", "end2", "imageType", "alphaType", "GoogleEarthEnterpriseImageryProvider_default", "defaultColor", "Color_default", "defaultGlowColor", "defaultBackgroundColor", "GridImageryProvider", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Event_default", "context", "maxPixel", "x", "val", "canvas", "minPixel", "cssBackgroundColor", "cssGlowColor", "cssColor", "y", "level", "request", "longitude", "latitude", "GridImageryProvider_default", "InvertClassification", "FramebufferManager_default", "ClearCommand_default", "Color_default", "that", "context", "rsUnclassified", "StencilFunction_default", "StencilOperation_default", "StencilConstants_default", "BlendingState_default", "rsClassified", "rsDefault", "translucentFS", "opaqueFS", "numSamples", "globeFramebuffer", "texture", "previousFramebufferChanged", "samplesChanged", "width", "height", "textureChanged", "defined_default", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Renderbuffer_default", "RenderbufferFormat_default", "depthStencilTexture", "depthStencilRenderbuffer", "RenderState_default", "fs", "unclassifiedFSSource", "ShaderSource_default", "classifiedFSSource", "PassThrough_default", "blitStencil", "passState", "framebuffer", "destroyObject_default", "InvertClassification_default", "JobTypeBudget", "total", "JobScheduler", "budgets", "jobBudgets", "JobType_default", "defined_default", "length", "totalBudget", "executedThisFrame", "getTimestamp_default", "i", "budget", "job", "jobType", "progressThisFrame", "stolenBudget", "startTime", "duration", "JobScheduler_default", "Light", "DeveloperError_default", "Light_default", "trailingSlashRegex", "defaultCredit", "Credit_default", "MapboxStyleImageryProvider", "options", "defaultValue_default", "styleId", "accessToken", "resource", "Resource_default", "tilesize", "username", "scaleFactor", "defined_default", "templateUrl", "credit", "UrlTemplateImageryProvider_default", "x", "y", "level", "request", "longitude", "latitude", "MapboxStyleImageryProvider_default", "Moon", "options", "defaultValue_default", "url", "defined_default", "buildModuleUrl_default", "Ellipsoid_default", "EllipsoidPrimitive_default", "Material_default", "IauOrientationAxes_default", "icrfToFixed", "Matrix3_default", "rotationScratch", "translationScratch", "Cartesian3_default", "scratchCommandList", "frameState", "ellipsoidPrimitive", "date", "Transforms_default", "rotation", "translation", "Simon1994PlanetaryPositions_default", "Matrix4_default", "savedCommandList", "destroyObject_default", "Moon_default", "NeverTileDiscardPolicy", "options", "image", "NeverTileDiscardPolicy_default", "OIT", "context", "extensionsSupported", "FramebufferManager_default", "ClearCommand_default", "Color_default", "BoundingRectangle_default", "destroyTextures", "oit", "destroyFramebuffers", "destroyResources", "updateTextures", "width", "height", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "source", "updateFramebuffers", "completeFBO", "WebGLConstants_default", "supported", "translucentComplete", "alphaComplete", "adjustTranslucentComplete", "adjustAlphaComplete", "passState", "framebuffer", "useHDR", "numSamples", "accumulationTexture", "textureChanged", "defined_default", "samplesChanged", "that", "fs", "uniformMap", "ShaderSource_default", "CompositeOITFS_default", "AdjustTranslucentFS_default", "useScissorTest", "updateScissor", "RenderState_default", "translucentMRTBlend", "BlendEquation_default", "BlendFunction_default", "translucentColorBlend", "translucentAlphaBlend", "getTranslucentRenderState", "translucentBlending", "cache", "renderState", "translucentState", "rs", "getTranslucentMRTRenderState", "getTranslucentColorRenderState", "getTranslucentAlphaRenderState", "mrtShaderSource", "colorShaderSource", "alphaShaderSource", "getTranslucentShaderProgram", "shaderProgram", "keyword", "shader", "attributeLocations", "getTranslucentMRTShaderProgram", "getTranslucentColorShaderProgram", "getTranslucentAlphaShaderProgram", "command", "result", "translucentShader", "translucentRenderState", "DrawCommand_default", "colorShader", "colorRenderState", "alphaShader", "alphaRenderState", "executeTranslucentCommandsSortedMultipass", "scene", "executeFunction", "commands", "invertClassification", "derivedCommand", "j", "useLogDepth", "useHdr", "length", "lightShadowsEnabled", "debugFramebuffer", "executeTranslucentCommandsSortedMRT", "clearColor", "destroyObject_default", "OIT_default", "defaultCredit", "Credit_default", "OpenStreetMapImageryProvider", "options", "defaultValue_default", "resource", "Resource_default", "tilingScheme", "WebMercatorTilingScheme_default", "tileWidth", "tileHeight", "minimumLevel", "maximumLevel", "rectangle", "swTile", "Rectangle_default", "neTile", "tileCount", "credit", "UrlTemplateImageryProvider_default", "defined_default", "OpenStreetMapImageryProvider_default", "defaultSize", "Cartesian2_default", "Particle", "options", "defaultValue_default", "Cartesian3_default", "Color_default", "deltaScratch", "dt", "particleUpdateFunction", "defined_default", "Particle_default", "ParticleBurst", "options", "defaultValue_default", "ParticleBurst_default", "ParticleEmitter", "options", "particle", "DeveloperError_default", "ParticleEmitter_default", "defaultImageSize", "Cartesian2_default", "ParticleSystem", "options", "defaultValue_default", "emitter", "defined_default", "CircleEmitter_default", "Matrix4_default", "Color_default", "Event_default", "value", "updateParticlePool", "system", "emissionRate", "life", "burstAmount", "bursts", "length", "i", "billboardCollection", "image", "particleEstimate", "particles", "particlePool", "numToAdd", "j", "particle", "Particle_default", "getOrCreateParticle", "addParticleToPool", "freeParticlePool", "numParticles", "numInPool", "estimate", "start", "p", "removeBillboard", "updateBillboard", "billboard", "r", "Math_default", "g", "b", "a", "addParticle", "speed", "Cartesian3_default", "calculateNumberToEmit", "dt", "v", "numToEmit", "burst", "currentTime", "rotatedVelocityScratch", "frameState", "BillboardCollection_default", "JulianDate_default", "updateCallback", "combinedMatrix", "burstLength", "destroyObject_default", "ParticleSystem_default", "PerformanceDisplay", "options", "defaultValue_default", "container", "getElement_default", "display", "fpsElement", "msElement", "getTimestamp_default", "throttledElement", "value", "renderedThisFrame", "time", "updateDisplay", "fpsElapsedTime", "fps", "msElapsedTime", "ms", "destroyObject_default", "PerformanceDisplay_default", "PickDepth", "FramebufferManager_default", "updateFramebuffers", "pickDepth", "context", "depthTexture", "width", "height", "updateCopyCommands", "defined_default", "fs", "RenderState_default", "scratchPackedDepth", "Cartesian4_default", "packedDepthScale", "x", "y", "pixels", "packedDepth", "passState", "destroyObject_default", "PickDepth_default", "PickDepthFramebuffer", "FramebufferManager_default", "destroyResources", "pickDepth", "createResources", "context", "width", "height", "passState", "PassState_default", "BoundingRectangle_default", "drawingBufferPosition", "viewport", "framebuffer", "destroyObject_default", "PickDepthFramebuffer_default", "PickFramebuffer", "context", "passState", "PassState_default", "BoundingRectangle_default", "FramebufferManager_default", "screenSpaceRectangle", "viewport", "width", "height", "colorScratch", "Color_default", "defaultValue_default", "pixels", "max", "length", "halfWidth", "halfHeight", "x", "y", "dx", "dy", "i", "index", "object", "defined_default", "temp", "destroyObject_default", "PickFramebuffer_default", "SceneFramebuffer", "FramebufferManager_default", "Color_default", "ClearCommand_default", "destroyResources", "post", "context", "viewport", "hdr", "numSamples", "width", "height", "pixelDatatype", "PixelDatatype_default", "passState", "clearColor", "destroyObject_default", "SceneFramebuffer_default", "ShadowMapShader", "isPointLight", "isTerrain", "usesDepthTexture", "isOpaque", "vs", "defines", "sources", "positionVaryingName", "ShaderSource_default", "hasPositionVarying", "defined_default", "length", "j", "shadowVS", "fs", "opaque", "i", "fsSource", "shadowMap", "castShadows", "hasTerrainNormal", "polygonOffsetSupported", "isSpotLight", "hasCascades", "debugCascadeColors", "softShadows", "normalVaryingName", "hasNormalVarying", "bias", "returnPositionEC", "ShadowMapShader_default", "ShadowMap", "options", "defaultValue_default", "context", "polygonOffsetSupported", "FeatureDetection_default", "Matrix4_default", "Cartesian3_default", "Cartesian4_default", "ShadowMapCamera", "BoundingSphere_default", "Cartesian2_default", "OrthographicOffCenterFrustum_default", "defined_default", "numberOfPasses", "i", "ShadowPass", "createRenderStates", "ClearCommand_default", "Color_default", "PassState_default", "createRenderState", "colorMask", "bias", "RenderState_default", "CullFace_default", "shadowMap", "value", "resize", "destroyFramebuffer", "length", "pass", "framebuffer", "createFramebufferColor", "depthRenderbuffer", "Renderbuffer_default", "RenderbufferFormat_default", "colorTexture", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "Framebuffer_default", "createFramebufferDepth", "depthStencilTexture", "createFramebufferCube", "cubeMap", "CubeMap_default", "faces", "createFramebuffer", "checkFramebuffer", "WebGLConstants_default", "updateFramebuffer", "clearFramebuffer", "shadowPass", "size", "passes", "textureSize", "ContextLimits_default", "faceViewport", "BoundingRectangle_default", "viewport", "biasX", "biasY", "scaleX", "scaleY", "scratchViewport", "createDebugShadowViewCommand", "fs", "drawCommand", "Pass_default", "updateDebugShadowViewCommand", "frameState", "screenWidth", "screenHeight", "debugCommand", "frustumCornersNDC", "scratchMatrix", "scratchFrustumCorners", "createDebugPointLight", "modelMatrix", "color", "box", "GeometryInstance_default", "BoxOutlineGeometry_default", "ColorGeometryInstanceAttribute_default", "sphere", "SphereOutlineGeometry_default", "Primitive_default", "PerInstanceColorAppearance_default", "debugOutlineColors", "scratchScale", "applyDebugSettings", "enterFreezeFrame", "DebugCameraPrimitive_default", "translation", "rotation", "Quaternion_default", "uniformScale", "scale", "Cartographic_default", "camera", "scaleBiasMatrix", "view", "projection", "scratchSplits", "scratchFrustum", "PerspectiveFrustum_default", "scratchCascadeDistances", "scratchMin", "scratchMax", "computeCascades", "shadowMapCamera", "sceneCamera", "cameraNear", "cameraFar", "numberOfCascades", "range", "ratio", "lambda", "clampCascadeDistances", "cascadeDistances", "splits", "p", "logScale", "split", "Math_default", "distance", "shadowFrustum", "left", "right", "bottom", "top", "near", "far", "position", "direction", "up", "cascadeSubFrustum", "shadowViewProjection", "viewProjection", "inverseViewProjection", "shadowMapMatrix", "min", "max", "k", "corner", "cascadeCamera", "frustum", "cascadeMatrix", "scratchLightView", "scratchRight", "scratchUp", "scratchTranslation", "fitShadowMapToScene", "lightDir", "lightUp", "lightRight", "lightPosition", "lightView", "cameraToLight", "translationMatrix", "halfWidth", "halfHeight", "depth", "directions", "ups", "rights", "computeOmnidirectional", "scratchCartesian1", "scratchCartesian2", "scratchBoundingSphere", "scratchCenter", "checkVisibility", "boundingSphere", "surfaceNormal", "lightDirection", "dot", "darknessAmount", "Intersect_default", "frustumRadius", "frustumCenter", "updateCameras", "lightCamera", "Camera_default", "CullingVolume_default", "inverseView", "scratchTexelStepSize", "combineUniforms", "uniforms", "isTerrain", "mapUniforms", "texelStepSize", "combine_default", "createCastDerivedCommand", "shadowsDirty", "command", "oldShaderId", "result", "castShader", "castRenderState", "castUniformMap", "DrawCommand_default", "shaderProgram", "isOpaque", "isPointLight", "usesDepthTexture", "keyword", "ShadowMapShader_default", "vertexShaderSource", "fragmentShaderSource", "castVS", "castFS", "clone_default", "lightShadowMaps", "lightShadowMapsEnabled", "hasTerrainNormal", "receiveShader", "receiveUniformMap", "castShadowsDirty", "shaderDirty", "receiveVS", "receiveFS", "shadowMaps", "castCommands", "shadowMapLength", "destroyObject_default", "ShadowMap_default", "CompositeTranslucentClassification_default", "debugShowPackedDepth", "TranslucentTileClassification", "context", "FramebufferManager_default", "ClearCommand_default", "Color_default", "BoundingRectangle_default", "destroyTextures", "transpClass", "destroyFramebuffers", "updateTextures", "width", "height", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "updateFramebuffers", "updateResources", "passState", "globeDepthStencilTexture", "fs", "uniformMap", "defined_default", "ShaderSource_default", "CompareAndPackTranslucentDepth_default", "CompositeTranslucentClassification_default", "compositeCommand", "compositeProgram", "compositePickProgram", "compositePickCommand", "DrawCommand_default", "useScissorTest", "updateScissor", "RenderState_default", "StencilFunction_default", "StencilConstants_default", "BlendingState_default", "scene", "executeCommand", "commands", "length", "command", "i", "useLogDepth", "framebuffer", "depthOnlyCommand", "frustumCommands", "us", "Pass_default", "swapGlobeDepth", "clear", "translucentTileClassification", "destroyObject_default", "TranslucentTileClassification_default", "CommandExtent", "View", "scene", "camera", "viewport", "context", "globeDepth", "GlobeDepth_default", "oit", "OIT_default", "passState", "PassState_default", "BoundingRectangle_default", "Camera_default", "PickFramebuffer_default", "PickDepthFramebuffer_default", "SceneFramebuffer_default", "GlobeTranslucencyFramebuffer_default", "TranslucentTileClassification_default", "scratchPosition0", "Cartesian3_default", "scratchPosition1", "maxComponent", "a", "b", "x", "y", "z", "cameraEqual", "camera0", "camera1", "epsilon", "scalar", "Matrix4_default", "cameraClone", "Math_default", "getTimestamp_default", "updateFrustums", "view", "near", "far", "frameState", "farToNearRatio", "is2D", "SceneMode_default", "nearToFarDistance2D", "numFrustums", "frustumCommandsList", "m", "curNear", "curFar", "frustumCommands", "defined_default", "FrustumCommands_default", "insertIntoBin", "command", "commandNear", "commandFar", "length", "i", "pass", "index", "cf", "scratchCullingVolume", "CullingVolume_default", "scratchNearFarInterval", "Interval_default", "direction", "position", "computeList", "overlayList", "commandList", "numberOfFrustums", "numberOfPasses", "Pass_default", "n", "p", "commandExtents", "commandExtentCapacity", "commandExtentCount", "shadowsEnabled", "shadowNear", "shadowFar", "shadowClosestObjectSize", "occluder", "cullingVolume", "planes", "k", "boundingVolume", "nearFarInterval", "ShadowMap_default", "size", "ClearCommand_default", "extent", "c", "ce", "frustumSplits", "j", "pickDepths", "View_default", "offscreenDefaultWidth", "mostDetailedPreloadTilesetPassState", "Cesium3DTilePassState_default", "Cesium3DTilePass_default", "mostDetailedPickTilesetPassState", "pickTilesetPassState", "Picking", "scene", "pickOffscreenViewport", "BoundingRectangle_default", "pickOffscreenCamera", "Camera_default", "OrthographicFrustum_default", "View_default", "index", "pickDepths", "pickDepth", "defined_default", "PickDepth_default", "scratchOrthoPickingFrustum", "OrthographicOffCenterFrustum_default", "scratchOrthoOrigin", "Cartesian3_default", "scratchOrthoDirection", "scratchOrthoPixelSize", "Cartesian2_default", "scratchOrthoPickVolumeMatrix4", "Matrix4_default", "getPickOrthographicCullingVolume", "drawingBufferPosition", "width", "height", "viewport", "camera", "frustum", "x", "y", "transform", "origin", "SceneMode_default", "pixelSize", "ortho", "scratchPerspPickingFrustum", "PerspectiveOffCenterFrustum_default", "scratchPerspPixelSize", "getPickPerspectiveCullingVolume", "near", "tanPhi", "tanTheta", "xDir", "yDir", "pickWidth", "pickHeight", "offCenter", "getPickCullingVolume", "scratchRectangleWidth", "scratchRectangleHeight", "scratchRectangle", "scratchPosition", "scratchColorZero", "Color_default", "windowPosition", "defaultValue_default", "context", "us", "frameState", "view", "passState", "SceneTransforms_default", "object", "renderTranslucentDepthForPick", "environmentState", "scratchPerspectiveFrustum", "PerspectiveFrustum_default", "scratchPerspectiveOffCenterFrustum", "scratchOrthographicFrustum", "scratchOrthographicOffCenterFrustum", "result", "cacheKey", "uniformState", "frustumCommandsList", "numFrustums", "i", "depth", "renderedFrustum", "height2D", "scratchPickPositionCartographic", "Cartographic_default", "projection", "ellipsoid", "cart", "drillPick", "limit", "pickCallback", "attributes", "pickedPrimitives", "pickedAttributes", "pickedFeatures", "pickedResult", "position", "exclude", "primitive", "hasShowAttribute", "ShowGeometryInstanceAttribute_default", "Cesium3DTileFeature_default", "that", "element", "scratchRight", "scratchUp", "MostDetailedRayPick", "ray", "tilesets", "pick", "resolve", "updateOffscreenCameraFromRay", "picking", "direction", "orthogonalAxis", "right", "up", "updateMostDetailedRayPick", "rayPick", "cullingVolume", "tilesetPassState", "ready", "tilesetsLength", "tileset", "rayPicks", "getTilesets", "primitives", "objectsToExclude", "length", "PrimitiveCollection_default", "launchMostDetailedRayPick", "callback", "isExcluded", "getRayIntersection", "requirePosition", "mostDetailed", "far", "distance", "Ray_default", "getRayIntersections", "pickFromRay", "results", "drillPickFromRay", "deferPromiseUntilPostRender", "promise", "reject", "removeCallback", "error", "scratchSurfacePosition", "scratchSurfaceNormal", "scratchSurfaceRay", "scratchCartographic", "getRayForSampleHeight", "cartographic", "globe", "ApproximateTerrainHeights_default", "surfaceNormal", "surfacePosition", "surfaceRay", "getRayForClampToHeight", "cartesian", "getHeightFromCartesian", "sampleHeightMostDetailed", "pickResult", "clampToHeightMostDetailed", "positions", "promises", "heights", "cartesians", "clampedCartesians", "Picking_default", "import_mersenne_twister", "Splitter", "shader", "ShaderSource_default", "object", "uniformMap", "Splitter_default", "DecodingState", "PointCloud", "options", "Color_default", "defaultValue_default", "Pass_default", "Matrix4_default", "ShadowMode_default", "SplitDirection_default", "initialize", "value", "defined_default", "BoundingSphere_default", "pointCloud", "parsedContent", "PntsParser_default", "Cesium3DTileBatchTable_default", "draco", "positions", "normals", "colors", "batchIds", "resolve", "reject", "scratchMin", "Cartesian3_default", "scratchMax", "scratchPosition", "randomNumberGenerator", "randomValues", "getRandomValues", "samplesLength", "MersenneTwister", "i", "computeApproximateBoundingSphereFromPositions", "pointsLength", "maxValue", "minValue", "min", "max", "index", "position", "boundingSphere", "Math_default", "prepareVertexAttribute", "typedArray", "name", "componentDatatype", "ComponentDatatype_default", "oneTimeWarning_default", "scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier", "Cartesian4_default", "scratchQuantizedVolumeScaleAndOctEncodedRange", "scratchColor", "positionLocation", "colorLocation", "normalLocation", "batchIdLocation", "numberOfAttributes", "scratchClippingPlanesMatrix", "scratchInverseTransposeClippingPlanesMatrix", "createResources", "frameState", "context", "styleableProperties", "hasStyleableProperties", "isQuantized", "isQuantizedDraco", "isOctEncoded16P", "isOctEncodedDraco", "quantizedRange", "octEncodedRange", "isRGB565", "isTranslucent", "hasColors", "hasNormals", "hasBatchIds", "componentsPerAttribute", "styleableVertexAttributes", "styleableShaderAttributes", "attributeLocation", "property", "vertexBuffer", "Buffer_default", "BufferUsage_default", "vertexAttribute", "positionsVertexBuffer", "colorsVertexBuffer", "normalsVertexBuffer", "batchIdsVertexBuffer", "attributes", "colorComponentsPerAttribute", "vertexArray", "VertexArray_default", "opaqueRenderState", "translucentRenderState", "BlendingState_default", "StencilConstants_default", "RenderState_default", "DrawCommand_default", "PrimitiveType_default", "createUniformMap", "uniformMap", "scratch", "frustum", "depthMultiplier", "SceneMode_default", "OrthographicFrustum_default", "clippingPlanes", "style", "clippingPlanesOriginMatrix", "transform", "Splitter_default", "combine_default", "scale", "getStyleablePropertyIds", "source", "propertyIds", "regex", "matches", "id", "getBuiltinPropertyNames", "propertyNames", "getVertexAttribute", "attribute", "builtinVariableSubstitutionMap", "createShaders", "hasStyle", "backFaceCulling", "normalShading", "attenuation", "colorStyleFunction", "showStyleFunction", "pointSizeStyleFunction", "styleTranslucent", "variableSubstitutionMap", "clone_default", "propertyIdToAttributeMap", "shaderState", "parameterList", "hasColorStyle", "hasShowStyle", "hasPointSizeStyle", "hasClippedContent", "styleablePropertyIds", "builtinPropertyNames", "usesColorSemantic", "usesNormalSemantic", "RuntimeError_default", "enabled", "usesColors", "colorVertexAttribute", "usesNormals", "normalVertexAttribute", "attributeLocations", "attributeDeclarations", "length", "propertyId", "componentCount", "attributeName", "attributeType", "vs", "fs", "getClippingFunction_default", "getClipAndStyleCode_default", "drawCommand", "ShaderProgram_default", "decodeDraco", "decodePromise", "DracoLoader_default", "result", "decodedPositions", "decodedRgb", "decodedRgba", "decodedNormals", "decodedBatchIds", "quantization", "range", "batchTableProperties", "decodedColors", "error", "scratchComputedTranslation", "scratchScale", "shadersDirty", "modelMatrixDirty", "modelMatrix", "projection", "translation", "Transforms_default", "center", "splittingEnabled", "commandList", "passes", "command", "destroyObject_default", "PointCloud_default", "PostProcessStageSampleMode", "PostProcessStageSampleMode_default", "PostProcessStage", "options", "defaultValue_default", "fragmentShader", "textureScale", "pixelFormat", "PixelFormat_default", "PostProcessStageSampleMode_default", "PixelDatatype_default", "Color_default", "passState", "PassState_default", "defined_default", "BoundingRectangle_default", "name", "createGuid_default", "framebuffer", "value", "depthTextureRegex", "context", "getUniformValueGetterAndSetter", "stage", "uniforms", "currentValue", "actualUniforms", "actualValue", "Texture_default", "getUniformMapFunction", "getUniformMapDimensionsFunction", "uniformMap", "texture", "createUniformMap", "newUniforms", "combine_default", "createDrawCommand", "fs", "width", "ShaderSource_default", "createSampler", "mode", "minFilter", "magFilter", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "sampler", "Sampler_default", "TextureWrap_default", "createLoadImageFunction", "image", "createStageOutputTextureFunction", "updateUniformTextures", "i", "texturesToRelease", "length", "texturesToCreate", "textureToCreate", "source", "dirtyUniforms", "promises", "stageNameUrlOrImage", "stageWithName", "resource", "Resource_default", "releaseResources", "textureCache", "isSelectedTextureDirty", "parentLength", "dirty", "createSelectedTexture", "features", "feature", "textureLength", "empty", "pickColor", "offset", "ids", "pickIds", "pickIdsLength", "j", "useLogDepth", "colorTexture", "renderState", "RenderState_default", "depthTexture", "idTexture", "destroyObject_default", "PostProcessStage_default", "AcesTonemappingStage_default", "AmbientOcclusionGenerate_default", "AmbientOcclusionModulate_default", "BlackAndWhite_default", "BloomComposite_default", "Brightness_default", "ContrastBias_default", "DepthOfField_default", "DepthView_default", "EdgeDetection_default", "FilmicTonemapping_default", "FXAA_default", "GaussianBlur1D_default", "LensFlare_default", "ModifiedReinhardTonemapping_default", "NightVision_default", "ReinhardTonemapping_default", "Silhouette_default", "PostProcessStageComposite", "options", "defaultValue_default", "name", "defined_default", "createGuid_default", "stages", "length", "i", "value", "context", "index", "isSelectedTextureDirty", "stage", "parentLength", "dirty", "useLogDepth", "destroyObject_default", "PostProcessStageComposite_default", "PostProcessStageLibrary", "createBlur", "name", "blurShader", "GaussianBlur1D_default", "blurX", "PostProcessStage_default", "PostProcessStageSampleMode_default", "blurY", "uniforms", "value", "blurXUniforms", "blurYUniforms", "PostProcessStageComposite_default", "blur", "dof", "DepthOfField_default", "scene", "createGuid_default", "EdgeDetection_default", "Color_default", "getSilhouetteEdgeDetection", "edgeDetectionStages", "defined_default", "edgeDetection", "compositeUniforms", "fsDecl", "fsLoop", "i", "fs", "edgeComposite", "silhouetteProcess", "Silhouette_default", "contrastBias", "ContrastBias_default", "generateComposite", "bloomComposite", "BloomComposite_default", "generate", "AmbientOcclusionGenerate_default", "generateAndBlur", "ambientOcclusionModulate", "AmbientOcclusionModulate_default", "fxaaFS", "FXAA3_11_default", "FXAA_default", "useAutoExposure", "AcesTonemappingStage_default", "FilmicTonemapping_default", "ReinhardTonemapping_default", "ModifiedReinhardTonemapping_default", "AutoExposure_default", "BlackAndWhite_default", "Brightness_default", "NightVision_default", "DepthView_default", "LensFlare_default", "buildModuleUrl_default", "Ellipsoid_default", "PostProcessStageLibrary_default", "PostProcessStageTextureCache", "postProcessStageCollection", "getLastStageName", "stage", "defined_default", "getStageDependencies", "collection", "context", "dependencies", "previousName", "stageDependencies", "previous", "uniforms", "uniformNames", "uniformNamesLength", "i", "value", "dependent", "getCompositeDependencies", "composite", "originalDependency", "inSeries", "currentName", "length", "j", "name", "currentDependencies", "k", "getDependencies", "ao", "bloom", "tonemapping", "fxaa", "getFramebuffer", "cache", "stageName", "textureScale", "forcePowerOfTwo", "pixelFormat", "pixelDatatype", "clearColor", "framebuffer", "framebuffers", "Color_default", "stageNames", "stagesLength", "foundConflict", "FramebufferManager_default", "createFramebuffers", "releaseResources", "updateFramebuffers", "width", "height", "scale", "textureWidth", "textureHeight", "size", "Math_default", "ClearCommand_default", "updateDependencies", "aoEnabled", "bloomEnabled", "tonemappingEnabled", "fxaaEnabled", "needsCheckDimensionsUpdate", "dimensionsChanged", "destroyObject_default", "PostProcessStageTextureCache_default", "Tonemapper", "tonemapper", "Tonemapper_default", "stackScratch", "PostProcessStageCollection", "fxaa", "PostProcessStageLibrary_default", "ao", "bloom", "Tonemapper_default", "tonemapping", "textureCache", "PostProcessStageTextureCache_default", "stageNames", "stack", "stage", "length", "defined_default", "i", "that", "readyAndEnabled", "stages", "removeStages", "value", "useAutoExposure", "tonemapper", "autoexposure", "collection", "newStages", "j", "currentStage", "index", "name", "context", "useLogDepth", "useHdr", "previousActiveStages", "activeStages", "count", "activeStagesChanged", "aoEnabled", "bloomEnabled", "tonemappingEnabled", "fxaaEnabled", "random", "Texture_default", "PixelFormat_default", "PixelDatatype_default", "Sampler_default", "TextureWrap_default", "TextureMinificationFilter_default", "TextureMagnificationFilter_default", "getOutputTexture", "stageName", "execute", "colorTexture", "depthTexture", "idTexture", "autoExposureEnabled", "initialTexture", "lastTexture", "framebuffer", "PassThrough_default", "destroyObject_default", "PostProcessStageCollection_default", "QuadtreeTileProvider", "DeveloperError_default", "tilingScheme", "QuadtreeTileProvider_default", "SceneTransitioner", "scene", "defined_default", "duration", "ellipsoid", "OrthographicFrustum_default", "SceneMode_default", "Matrix4_default", "morphFromColumbusViewTo2D", "morphFrom3DTo2D", "scratchToCVPosition", "Cartesian3_default", "scratchToCVDirection", "scratchToCVUp", "scratchToCVPosition2D", "scratchToCVDirection2D", "scratchToCVUp2D", "scratchToCVSurfacePosition", "scratchToCVCartographic", "Cartographic_default", "scratchToCVToENU", "scratchToCVFrustumPerspective", "PerspectiveFrustum_default", "scratchToCVFrustumOrthographic", "scratchToCVCamera", "position", "direction", "up", "camera", "surfacePoint", "toENU", "Transforms_default", "frustum", "Math_default", "cameraCV", "complete", "completeColumbusViewCallback", "createMorphHandler", "morphFrom2DToColumbusView", "Camera_default", "morphFrom3DToColumbusView", "scratchCVTo3DCamera", "scratch2DTo3DFrustumPersp", "morphFrom2DTo3D", "camera3D", "getColumbusViewTo3DCamera", "complete3DCallback", "morphFromColumbusViewTo3D", "destroyMorphHandler", "destroyObject_default", "transitioner", "completeMorphFunction", "ScreenSpaceEventHandler_default", "completeMorph", "ScreenSpaceEventType_default", "tweens", "i", "scratchCVTo3DCartographic", "scratchCVTo3DSurfacePoint", "scratchCVTo3DFromENU", "positionCarto", "fromENU", "scratchCVTo3DStartPos", "scratchCVTo3DStartDir", "scratchCVTo3DStartUp", "scratchCVTo3DEndPos", "scratchCVTo3DEndDir", "scratchCVTo3DEndUp", "endCamera", "startPos", "startDir", "startUp", "endPos", "endDir", "endUp", "update", "value", "columbusViewMorph", "tween", "EasingFunction_default", "addMorphTimeAnimations", "scratch2DTo3DFrustumOrtho", "scratch3DToCVStartPos", "scratch3DToCVStartDir", "scratch3DToCVStartUp", "scratch3DToCVEndPos", "scratch3DToCVEndDir", "scratch3DToCVEndUp", "morph", "morphOrthographicToPerspective", "startPosition", "endPosition", "time", "result", "morphPerspectiveToOrthographic", "updateHeight", "startFOV", "endFOV", "d", "height", "scratchCVTo2DStartPos", "scratchCVTo2DStartDir", "scratchCVTo2DStartUp", "scratchCVTo2DEndPos", "scratchCVTo2DEndDir", "scratchCVTo2DEndUp", "scratchCVTo2DFrustum", "OrthographicOffCenterFrustum_default", "scratchCVTo2DRay", "Ray_default", "scratchCVTo2DPickPos", "scratchCVTo2DCamera", "ray", "globe", "pickPos", "camera2D", "complete2DCallback", "updateCV", "scratch3DTo2DCartographic", "scratch3DTo2DCamera", "scratch3DTo2DEndCamera", "scratch3DTo2DPickPosition", "scratch3DTo2DRay", "scratch3DTo2DToENU", "scratch3DTo2DSurfacePoint", "rayDirection", "pickedPos", "completeCallback", "start", "stop", "options", "wasMorphing", "SceneTransitioner_default", "Tween", "tweens", "tweenjs", "startObject", "stopObject", "duration", "delay", "easingFunction", "update", "complete", "cancel", "clone_default", "TweenCollection", "options", "defaultValue_default", "defined_default", "TimeConstants_default", "delayInSeconds", "EasingFunction_default", "value", "tween", "object", "property", "startValue", "stopValue", "material", "properties", "length", "i", "uniforms", "index", "time", "getTimestamp_default", "TweenCollection_default", "ScreenSpaceCameraController", "scene", "CameraEventType_default", "KeyboardEventModifier_default", "CameraEventAggregator_default", "TweenCollection_default", "Cartesian2_default", "Cartesian3_default", "projection", "Cartographic_default", "Math_default", "decay", "time", "coefficient", "tau", "sameMousePosition", "movement", "inertiaMaxClickTimeThreshold", "maintainInertia", "aggregator", "type", "modifier", "decayCoef", "action", "object", "lastMovementName", "movementState", "defined_default", "ts", "tr", "threshold", "now", "fromNow", "d", "lastMovement", "startPosition", "activateInertia", "controller", "inertiaStateName", "inertiasToDisable", "length", "i", "scratchEventTypeArray", "reactToInput", "enabled", "eventTypes", "inertiaConstant", "eventType", "scratchZoomPickRay", "Ray_default", "scratchPickCartesian", "scratchZoomOffset", "scratchZoomDirection", "scratchCenterPixel", "scratchCenterPosition", "scratchPositionNormal", "scratchPickNormal", "scratchZoomAxis", "scratchCameraPositionNormal", "scratchTargetNormal", "scratchCameraPosition", "scratchCameraUpNormal", "scratchCameraRightNormal", "scratchForwardNormal", "scratchPositionToTarget", "scratchPositionToTargetNormal", "scratchPan", "scratchCenterMovement", "scratchCenter", "scratchCartesian", "scratchCartesianTwo", "scratchCartesianThree", "scratchZoomViewOptions", "HeadingPitchRoll_default", "handleZoom", "zoomFactor", "distanceMeasure", "unitPositionDotDirection", "percentage", "diff", "minHeight", "maxHeight", "minDistance", "zoomRate", "rangeWindowRatio", "distance", "camera", "mode", "orientation", "OrthographicFrustum_default", "sameStartPosition", "zoomingOnVector", "rotatingZoom", "pickedPosition", "SceneMode_default", "pickGlobe", "zoomOnVector", "worldPosition", "endPosition", "savedX", "direction", "cameraPositionNormal", "canvas", "centerPixel", "centerPosition", "cameraPosition", "target", "targetNormal", "center", "forward", "positionToTarget", "positionToTargetNormal", "alphaDot", "alpha", "cameraDistance", "targetDistance", "remainingDistance", "positionToTargetDistance", "gamma", "delta", "beta", "up", "right", "pMid", "cMid", "positionNormal", "pickedNormal", "dotProduct", "angle", "axis", "denom", "scalar", "ray", "zoomMouseStart", "SceneTransforms_default", "rayDirection", "translate2DStart", "translate2DEnd", "scratchTranslateP0", "translate2D", "start", "end", "zoom2D", "twist2DStart", "twist2DEnd", "twist2D", "singleAxisTwist2D", "width", "height", "startTheta", "endTheta", "theta", "rotateRate", "phiWindowRatio", "deltaPhi", "update2D", "rotatable2D", "MapMode2D_default", "Matrix4_default", "pickGlobeScratchRay", "scratchDepthIntersection", "scratchRayIntersection", "mousePosition", "result", "globe", "cullBackFaces", "depthIntersection", "rayIntersection", "pickDistance", "rayDistance", "scratchDistanceCartographic", "getDistanceFromSurface", "ellipsoid", "cartographic", "globeHeight", "defaultValue_default", "scratchSurfaceNormal", "getZoomDistanceUnderground", "origin", "distanceFromSurface", "surfaceNormal", "strength", "getTiltCenterUnderground", "maximumDistance", "getStrafeStartPositionUnderground", "scratchInertialDelta", "continueStrafing", "originalEndPosition", "inertialDelta", "strafe", "translateCVStartRay", "translateCVEndRay", "translateCVStartPos", "translateCVEndPos", "translateCVDifference", "translateCVOrigin", "translateCVPlane", "Plane_default", "translateCVStartMouse", "translateCVEndMouse", "translateCV", "look3D", "cameraUnderground", "startMouse", "endMouse", "startRay", "normal", "globePos", "pickPosition", "plane", "startPlanePos", "IntersectionTests_default", "endRay", "endPlanePos", "temp", "mag", "rotateCVWindowPos", "rotateCVWindowRay", "rotateCVCenter", "rotateCVVerticalCenter", "rotateCVTransform", "rotateCVVerticalTransform", "rotateCVOrigin", "rotateCVPlane", "rotateCVCartesian3", "rotateCVCart", "rotateCVOldTransform", "rotateCVQuaternion", "Quaternion_default", "rotateCVMatrix", "Matrix3_default", "tilt3DCartesian3", "rotateCV", "rotateCVOnPlane", "rotateCVOnTerrain", "windowPosition", "position", "normalDotDirection", "cart", "transform", "Transforms_default", "oldGlobe", "oldEllipsoid", "Ellipsoid_default", "oldTransform", "rotate3D", "radius", "verticalCenter", "verticalTransform", "constrainedAxis", "tangent", "dot", "movementDelta", "oldConstrainedAxis", "originalPosition", "adjustHeightForTerrain", "magSqrd", "quaternion", "rotation", "zoomCVWindowPos", "zoomCVWindowRay", "zoomCVIntersection", "zoomCV", "intersection", "distanceUnderground", "updateCV", "zoom3D", "tweens", "tween", "scratchStrafeRay", "scratchStrafePlane", "scratchStrafeIntersection", "scratchStrafeDirection", "scratchMousePos", "strafeStartPosition", "spin3DPick", "scratchCartographic", "scratchRadii", "scratchEllipsoid", "scratchLookUp", "scratchNormal", "spin3D", "magnitude", "radii", "pan3D", "mousePos", "strafing", "rotateOnlyVertical", "rotateOnlyHorizontal", "oldAxis", "rho", "thetaWindowRatio", "deltaTheta", "pan3DP0", "Cartesian4_default", "pan3DP1", "pan3DTemp0", "pan3DTemp1", "pan3DTemp2", "pan3DTemp3", "pan3DStartMousePosition", "pan3DEndMousePosition", "startMousePosition", "endMousePosition", "p0", "p1", "basis0", "basis1", "basis2", "startRho", "startDot", "startRej", "endRho", "endDot", "endRej", "startPhi", "endPhi", "east", "planeNormal", "side0", "side1", "zoom3DUnitPosition", "zoom3DCartographic", "unitPosition", "tilt3DWindowPos", "tilt3DRay", "tilt3DCenter", "tilt3DVerticalCenter", "tilt3DTransform", "tilt3DVerticalTransform", "tilt3DOldTransform", "tilt3DQuaternion", "tilt3DMatrix", "tilt3DCart", "tilt3DLookUp", "tilt3D", "tilt3DOnEllipsoid", "tilt3DOnTerrain", "tilt3DOnEllipsoidCartographic", "grazingAltitudeLocation", "grazingAltitudeCart", "newEllipsoid", "t", "look3DStartPos", "look3DEndPos", "look3DStartRay", "look3DEndRay", "look3DNegativeRot", "look3DTan", "rotationAxis", "startPos", "endPos", "horizontalRotationAxis", "negativeRotationAxis", "northParallel", "southParallel", "angleToAxis", "update3D", "scratchAdjustHeightTransform", "scratchAdjustHeightCartographic", "heightUpdated", "scratchPreviousPosition", "scratchPreviousDirection", "exaggeration", "exaggerationRelativeHeight", "TerrainExaggeration_default", "previousPosition", "previousDirection", "destroyObject_default", "ScreenSpaceCameraController_default", "AdditiveBlend_default", "BrightPass_default", "SunPostProcess", "SceneFramebuffer_default", "scale", "stages", "PostProcessStage_default", "PassThrough_default", "PostProcessStageSampleMode_default", "brightPass", "BrightPass_default", "that", "Cartesian2_default", "GaussianBlur1D_default", "AdditiveBlend_default", "PostProcessStageComposite_default", "textureCache", "PostProcessStageTextureCache_default", "length", "i", "index", "name", "stage", "sunPositionECScratch", "Cartesian4_default", "sunPositionWCScratch", "sizeScratch", "postProcessMatrix4Scratch", "Matrix4_default", "updateSunPosition", "postProcess", "context", "viewport", "us", "sunPosition", "viewMatrix", "viewProjectionMatrix", "projectionMatrix", "viewportTransformation", "sunPositionEC", "sunPositionWC", "Transforms_default", "Math_default", "limbWC", "sunSize", "size", "width", "height", "firstStage", "downSampleWidth", "downSampleHeight", "downSampleViewport", "BoundingRectangle_default", "scissorRectangle", "passState", "clearColor", "sceneFramebuffer", "framebuffer", "colorTexture", "defined_default", "destroyObject_default", "SunPostProcess_default", "requestRenderAfterFrame", "scene", "Scene", "options", "defaultValue_default", "canvas", "creditContainer", "creditViewport", "contextOptions", "clone_default", "defined_default", "hasCreditContainer", "context", "Context_default", "createGuid_default", "JobScheduler_default", "FrameState_default", "CreditDisplay_default", "ComputeEngine_default", "GlobeTranslucencyState_default", "PrimitiveCollection_default", "TweenCollection_default", "DepthPlane_default", "ClearCommand_default", "Color_default", "RenderState_default", "StencilConstants_default", "SceneTransitioner_default", "Event_default", "DebugInspector_default", "SceneMode_default", "GeographicProjection_default", "Fog_default", "Camera_default", "ShadowMap_default", "InvertClassification_default", "PostProcessStageCollection_default", "BrdfLutGenerator_default", "ScreenSpaceCameraController_default", "MapMode2D_default", "RequestScheduler_default", "TaskProcessor_default", "viewport", "BoundingRectangle_default", "camera", "Picking_default", "View_default", "SunLight_default", "updateFrameNumber", "JulianDate_default", "updateGlobeListeners", "globe", "removeGlobeCallbacks", "ContextLimits_default", "OctahedralProjectedCubeMap_default", "view", "terrainProvider", "value", "DeviceOrientationCameraController_default", "hdr", "format", "updateDerivedCommands", "command", "shadowsDirty", "frameState", "oit", "lightShadowMaps", "lightShadowsEnabled", "derivedCommands", "DerivedCommand_default", "Pass_default", "lastDirtyTime", "useLogDepth", "useHdr", "hasLogDepthDerivedCommands", "hasHdrCommands", "hasDerivedCommands", "needsLogDepthDerivedCommands", "needsHdrCommands", "needsDerivedCommands", "shadowMaps", "renderTilesetPassState", "Cesium3DTilePassState_default", "Cesium3DTilePass_default", "preloadTilesetPassState", "preloadFlightTilesetPassState", "requestRenderModeDeferCheckPassState", "scratchOccluderBoundingSphere", "BoundingSphere_default", "scratchOccluder", "getOccluder", "ellipsoid", "minimumTerrainHeight", "Occluder_default", "passes", "frameNumber", "time", "OrthographicFrustum_default", "OrthographicOffCenterFrustum_default", "cullingVolume", "occluder", "Intersect_default", "transformFrom2D", "Matrix4_default", "debugShowBoundingVolume", "passState", "debugFramebuffer", "boundingVolume", "geometry", "center", "Cartesian3_default", "projection", "centerCartographic", "radius", "GeometryPipeline_default", "EllipsoidGeometry_default", "PerInstanceColorAppearance_default", "Primitive_default", "GeometryInstance_default", "ColorGeometryInstanceAttribute_default", "halfAxes", "BoxGeometry_default", "savedCommandList", "commandList", "framebuffer", "executeCommand", "executeIdCommand", "backToFront", "a", "b", "position", "frontToBack", "Math_default", "executeTranslucentCommandsBackToFront", "executeFunction", "commands", "invertClassification", "mergeSort_default", "length", "i", "executeTranslucentCommandsFrontToBack", "scratchPerspectiveFrustum", "PerspectiveFrustum_default", "scratchPerspectiveOffCenterFrustum", "PerspectiveOffCenterFrustum_default", "scratchOrthographicFrustum", "scratchOrthographicOffCenterFrustum", "executeCommands", "us", "frustum", "picking", "environmentState", "renderTranslucentDepthForPick", "useWebVR", "skyBoxCommand", "executeTranslucentCommands", "frustumCommandsList", "numFrustums", "clearGlobeDepth", "useDepthPlane", "globeTranslucencyState", "globeTranslucent", "globeTranslucencyFramebuffer", "clearDepth", "clearStencil", "clearClassificationStencil", "depthPlane", "usePostProcessSelected", "height2D", "j", "index", "frustumCommands", "globeDepth", "opaqueClassificationFramebuffer", "depthStencilTexture", "pickDepth", "originalFramebuffer", "executeComputeCommands", "sunComputeCommand", "executeOverlayCommands", "insertShadowCastCommands", "shadowMap", "shadowVolume", "isPointLight", "numberOfPasses", "k", "wasVisible", "cascadeVolume", "executeShadowMapCastCommands", "shadowMapLength", "uniformState", "sceneCommands", "pass", "numberOfCommands", "scratchEyeTranslation", "backgroundColor", "mode", "executeWebVRCommands", "executeCommandsInViewport", "updateAndClearFramebuffers", "execute2DViewportCommands", "updateAndRenderPrimitives", "savedCamera", "near", "fo", "eyeSeparation", "eyeTranslation", "offset", "scratch2DViewportCartographic", "Cartographic_default", "scratch2DViewportMaxCoord", "scratch2DViewportSavedPosition", "scratch2DViewportTransform", "scratch2DViewportCameraTransform", "scratch2DViewportEyePoint", "scratch2DViewportWindowCoords", "scratch2DViewport", "originalViewport", "maxCartographic", "maxCoord", "transform", "viewportTransformation", "projectionMatrix", "x", "eyePoint", "windowCoordinates", "Transforms_default", "viewportX", "viewportWidth", "right", "left", "firstViewport", "scratchCullingVolume", "CullingVolume_default", "renderPass", "offscreenPass", "skyAtmosphere", "sunCommands", "planes", "envMaps", "envMapAtlas", "updateDebugFrustumPlanes", "DebugCameraPrimitive_default", "updateShadowMaps", "shadowsEnabled", "clearColor", "SunPostProcess_default", "clear", "useGlobeDepthFramebuffer", "useOIT", "postProcess", "usePostProcess", "depthFramebuffer", "defaultFramebuffer", "globeFramebuffer", "sceneFramebuffer", "idFramebuffer", "translucentTileClassification", "inputFramebuffer", "colorTexture", "idTexture", "depthTexture", "callAfterRenderFunctions", "functions", "getGlobeHeight", "cartographic", "isCameraUnderground", "cameraController", "globeHeight", "updateDebugShowFramesPerSecond", "renderedThisFrame", "performanceContainer", "performanceDisplay", "PerformanceDisplay_default", "prePassesUpdate", "postPassesUpdate", "scratchBackgroundColor", "render", "tryAndCatchError", "functionToExecute", "error", "updateMostDetailedRayPicks", "cameraChanged", "shouldRender", "difference", "updatePreloadPass", "updatePreloadFlightPass", "updateRequestRenderModeDeferCheckPass", "width", "windowPosition", "height", "result", "limit", "ray", "objectsToExclude", "cartesian", "positions", "cartesians", "SceneTransforms_default", "duration", "destroyObject_default", "Scene_default", "SkyAtmosphere", "ellipsoid", "defaultValue_default", "Ellipsoid_default", "outerEllipsoidScale", "scaleVector", "Cartesian3_default", "Matrix4_default", "DrawCommand_default", "radiiAndDynamicAtmosphereColor", "that", "enableLighting", "useSunDirection", "lightEnum", "scratchModelMatrix", "frameState", "globe", "mode", "SceneMode_default", "rotationMatrix", "rotationOffsetMatrix", "Axis_default", "modelMatrix", "context", "colorCorrect", "hasColorCorrection", "translucent", "perFragmentAtmosphere", "defined_default", "command", "geometry", "EllipsoidGeometry_default", "VertexFormat_default", "VertexArray_default", "GeometryPipeline_default", "BufferUsage_default", "RenderState_default", "CullFace_default", "BlendingState_default", "flags", "defines", "vs", "ShaderSource_default", "AtmosphereCommon_default", "SkyAtmosphereCommon_default", "SkyAtmosphereVS_default", "fs", "SkyAtmosphereFS_default", "ShaderProgram_default", "skyAtmosphere", "Math_default", "destroyObject_default", "SkyAtmosphere_default", "SkyBox", "options", "defaultValue_default", "DrawCommand_default", "Matrix4_default", "frameState", "useHdr", "that", "SceneMode_default", "context", "sources", "loadCubeMap_default", "cubeMap", "CubeMap_default", "command", "defined_default", "geometry", "BoxGeometry_default", "Cartesian3_default", "VertexFormat_default", "attributeLocations", "GeometryPipeline_default", "VertexArray_default", "BufferUsage_default", "RenderState_default", "BlendingState_default", "fs", "ShaderSource_default", "SkyBoxFS_default", "ShaderProgram_default", "SkyBoxVS_default", "destroyObject_default", "SkyBox_default", "SphereEmitter", "radius", "defaultValue_default", "value", "particle", "theta", "Math_default", "phi", "rad", "x", "y", "z", "Cartesian3_default", "SphereEmitter_default", "StyleExpression", "feature", "result", "DeveloperError_default", "functionSignature", "variableSubstitutionMap", "shaderState", "returnType", "StyleExpression_default", "Sun", "DrawCommand_default", "PrimitiveType_default", "BoundingSphere_default", "that", "glowFactor", "scratchPositionWC", "Cartesian2_default", "scratchLimbWC", "scratchPositionEC", "Cartesian4_default", "scratchCartesian4", "frameState", "passState", "useHdr", "mode", "SceneMode_default", "context", "drawingBufferWidth", "drawingBufferHeight", "defined_default", "size", "pixelDatatype", "PixelDatatype_default", "Texture_default", "PixelFormat_default", "uniformMap", "ComputeCommand_default", "SunTextureFS_default", "drawCommand", "attributeLocations", "directions", "vertexBuffer", "Buffer_default", "BufferUsage_default", "attributes", "ComponentDatatype_default", "indexBuffer", "IndexDatatype_default", "VertexArray_default", "ShaderProgram_default", "SunVS_default", "SunFS_default", "RenderState_default", "BlendingState_default", "sunPosition", "sunPositionCV", "boundingVolume", "boundingVolume2D", "Cartesian3_default", "Math_default", "position", "SceneTransforms_default", "dist", "projMatrix", "positionEC", "positionCC", "Matrix4_default", "positionWC", "limbCC", "limbWC", "command", "destroyObject_default", "Sun_default", "TileBoundingVolume", "frameState", "DeveloperError_default", "plane", "color", "TileBoundingVolume_default", "TileCoordinatesImageryProvider", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Color_default", "Event_default", "x", "y", "level", "request", "canvas", "context", "cssColor", "longitude", "latitude", "TileCoordinatesImageryProvider_default", "TileCoordinatesImageryProviderFlw", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Color_default", "Event_default", "x", "y", "level", "request", "canvas", "context", "cssColor", "rectangle", "point1", "point2", "point3", "width", "height", "w_unit", "h_unit", "longitude", "latitude", "TileCoordinatesImageryProviderFlw_default", "TileCoordinatesImageryProviderJww", "options", "defaultValue_default", "defined_default", "GeographicTilingScheme_default", "Color_default", "Event_default", "x", "y", "level", "request", "canvas", "context", "cssColor", "rectangle", "longitude", "latitude", "TileCoordinatesImageryProviderJww_default", "TileDiscardPolicy", "options", "DeveloperError_default", "TileDiscardPolicy_default", "TileState", "TileState_default", "TimeDynamicPointCloud", "options", "defaultValue_default", "Matrix4_default", "ShadowMode_default", "PointCloudShading_default", "Event_default", "PointCloudEyeDomeLighting_default", "that", "resolve", "value", "ClippingPlaneCollection_default", "defined_default", "getFragmentShaderLoaded", "fs", "getUniformMapLoaded", "stream", "uniformMap", "combine_default", "getPickIdLoaded", "scratchDate", "JulianDate_default", "getClockMultiplier", "clock", "isAnimating", "multiplier", "getIntervalIndex", "interval", "getNextInterval", "currentInterval", "intervals", "averageLoadTime", "time", "index", "currentIndex", "getCurrentInterval", "reachedInterval", "nextInterval", "nextIndex", "handleFrameFailure", "uri", "error", "message", "requestFrame", "frameState", "frames", "frame", "transformArray", "transform", "getTimestamp_default", "Resource_default", "arrayBuffer", "PointCloud_default", "updateAverageLoadTime", "loadTime", "prepareFrame", "updateState", "pointCloud", "commandList", "lengthBeforeUpdate", "renderFrame", "scratchModelMatrix", "getGeometricError", "shading", "Math_default", "getMaximumAttenuation", "defaultShading", "loadFrame", "getUnloadCondition", "unloadFrames", "unloadCondition", "length", "i", "getFrame", "updateInterval", "getNearestReadyInterval", "previousInterval", "previousIndex", "setFramesDirty", "clippingPlanesDirty", "styleDirty", "framesLength", "SceneMode_default", "timeSinceLoad", "clippingPlanes", "clippingPlanesState", "isClipped", "eyeDomeLighting", "clockMultiplierChanged", "clockMultiplier", "clockPaused", "totalMemoryUsageInBytes", "maximumMemoryUsageInBytes", "addedCommandsLength", "destroyObject_default", "TimeDynamicPointCloud_default", "ViewportQuad", "rectangle", "material", "defined_default", "BoundingRectangle_default", "Material_default", "Color_default", "frameState", "rs", "RenderState_default", "BlendingState_default", "context", "fs", "ShaderSource_default", "ViewportQuadFS_default", "Pass_default", "destroyObject_default", "ViewportQuad_default", "DepthViewPacked_default", "svgNS", "xlinkNS", "widgetForDrag", "gradientEnabledColor0", "Color_default", "gradientEnabledColor1", "gradientEnabledColor2", "gradientEnabledColor3", "gradientDisabledColor0", "gradientDisabledColor1", "gradientKnobColor", "gradientPointerColor", "getElementColor", "element", "svgIconsById", "svgFromObject", "obj", "ele", "field", "len", "i", "svgText", "x", "y", "msg", "text", "tspan", "setShuttleRingPointer", "shuttleRingPointer", "knobOuter", "angle", "makeColorStringScratch", "makeColorString", "background", "gradient", "gradientAlpha", "backgroundAlpha", "rectButton", "path", "iconInfo", "button", "wingButton", "buttonIconInfo", "wingIconInfo", "setShuttleRingFromMouseOrTouch", "widget", "e", "viewModel", "shuttleRingDragging", "centerX", "centerY", "rect", "clientX", "clientY", "pointerRect", "shuttleRingAngle", "SvgButton", "svgElement", "that", "command", "subscribeAndEvaluate_default", "subscriptions", "destroyObject_default", "enabled", "toggled", "tooltip", "Animation", "container", "getElement_default", "ownerDocument", "cssStyle", "themeEle", "svg", "topG", "buttonsG", "shuttleRingBackPanel", "swooshIconInfo", "shuttleRingPointerIconInfo", "shuttleRingSwooshG", "knobG", "knobInnerAndShieldSize", "knobInner", "knobShield", "shuttleRingBackG", "mouseCallback", "timeNode", "dateNode", "statusNode", "isPaused", "value", "defined_default", "doc", "parentWidth", "parentHeight", "baseWidth", "baseHeight", "width", "height", "scaleX", "scaleY", "buttonNormalBackColor", "buttonHoverBackColor", "buttonToggledBackColor", "buttonDisabledBackColor", "knobBackColor", "pointerColor", "swooshColor", "swooshHoverColor", "defsElement", "Animation_default", "monthNames", "realtimeShuttleRingAngle", "maxShuttleRingAngle", "numberComparator", "left", "right", "getTypicalMultiplierIndex", "multiplier", "shuttleRingTicks", "index", "binarySearch_default", "angleToMultiplier", "angle", "minp", "maxp", "maxv", "minv", "scale", "multiplierToAngle", "clockViewModel", "ClockStep_default", "fastedMultipler", "AnimationViewModel", "that", "knockout_default", "ticks", "positiveMultiplier", "numDigits", "divisor", "clockRange", "ClockRange_default", "currentTime", "startTime", "result", "JulianDate_default", "stopTime", "systemTime", "pauseCommand", "createCommand_default", "ToggleButtonViewModel_default", "playReverseCommand", "playForwardCommand", "playRealtimeCommand", "date", "viewModel", "gregorianDate", "millisecond", "positiveTicks", "i", "len", "tick", "hash", "sortedFilteredPositiveTicks", "allTicks", "dateFormatter", "timeFormatter", "AnimationViewModel_default", "BaseLayerPickerViewModel", "options", "defaultValue_default", "globe", "imageryProviderViewModels", "terrainProviderViewModels", "knockout_default", "imageryObservable", "imageryProviders", "providers", "categories", "i", "provider", "category", "defined_default", "allCategoryNames", "result", "name", "terrainObservable", "terrainProviders", "selectedImagery", "selectedTerrain", "imageryTip", "terrainTip", "selectedImageryViewModel", "value", "currentImageryProviders", "currentImageryProvidersLength", "imageryLayers", "hadExistingBaseLayer", "layersLength", "x", "layer", "newProviders", "newProvidersLength", "baseLayer", "selectedTerrainViewModel", "newProvider", "EllipsoidTerrainProvider_default", "that", "createCommand_default", "BaseLayerPickerViewModel_default", "BaseLayerPicker", "container", "options", "getElement_default", "viewModel", "BaseLayerPickerViewModel_default", "element", "imgElement", "dropPanel", "imageryTitle", "imagerySection", "imageryCategories", "categoryTitle", "imageryChoices", "imageryProvider", "providerIcon", "providerLabel", "terrainTitle", "terrainSection", "terrainCategories", "terrainCategoryTitle", "terrainChoices", "terrainProvider", "terrainProviderIcon", "terrainProviderLabel", "knockout_default", "e", "FeatureDetection_default", "destroyObject_default", "BaseLayerPicker_default", "ProviderViewModel", "options", "creationCommand", "defined_default", "createCommand_default", "defaultValue_default", "knockout_default", "ProviderViewModel_default", "createDefaultImageryProviderViewModels", "providerViewModels", "ProviderViewModel_default", "buildModuleUrl_default", "createWorldImagery_default", "IonWorldImageryStyle_default", "ArcGisMapServerImageryProvider_default", "OpenStreetMapImageryProvider_default", "IonImageryProvider_default", "TileMapServiceImageryProvider_default", "createDefaultImageryProviderViewModels_default", "createDefaultTerrainProviderViewModels", "providerViewModels", "ProviderViewModel_default", "buildModuleUrl_default", "EllipsoidTerrainProvider_default", "createWorldTerrain_default", "createDefaultTerrainProviderViewModels_default", "getPickTileset", "viewModel", "e", "pick", "defined_default", "Cesium3DTileset_default", "selectTilesetOnHover", "value", "ScreenSpaceEventType_default", "stringOptions", "formatMemoryString", "memorySizeInBytes", "memoryInMegabytes", "getStatistics", "tileset", "isPick", "statistics", "Cesium3DTilePass_default", "s", "getResourceCacheStatistics", "ResourceCache_default", "colorBlendModes", "Cesium3DTileColorBlendMode_default", "highlightColor", "Color_default", "scratchColor", "oldColor", "Cesium3DTilesInspectorViewModel", "scene", "performanceContainer", "that", "canvas", "ScreenSpaceEventHandler_default", "PerformanceDisplay_default", "knockout_default", "names", "properties", "prop", "dynamicScreenSpaceError", "colorBlendMode", "showOnlyPickedTileDebugLabel", "picking", "picked", "Cesium3DTileFeature_default", "position", "colorize", "wireframe", "showBoundingVolumes", "showContentBoundingVolumes", "showRequestVolumes", "freezeFrame", "showGeometricError", "showRenderingStatistics", "showMemoryUsage", "showUrl", "maximumScreenSpaceError", "dynamicScreenSpaceErrorDensity", "dynamicScreenSpaceErrorFactor", "pickTileset", "pickActive", "pointCloudShading", "geometricErrorScale", "maximumAttenuation", "baseResolution", "eyeDomeLighting", "eyeDomeLightingStrength", "eyeDomeLightingRadius", "skipLevelOfDetail", "skipScreenSpaceErrorFactor", "baseScreenSpaceError", "skipLevels", "immediatelyLoadDesiredLevelOfDetail", "loadSiblings", "t", "settings", "length", "i", "setting", "feature", "currentFeature", "tile", "currentTile", "hasFeatures", "content", "innerContents", "Cesium3DTileStyle_default", "err", "sender", "event", "textArea", "start", "end", "newEnd", "lines", "newText", "style", "property", "destroyObject_default", "Cesium3DTilesInspectorViewModel_default", "Cesium3DTilesInspector", "container", "scene", "getElement_default", "element", "performanceContainer", "viewModel", "Cesium3DTilesInspectorViewModel_default", "text", "panel", "createSection", "InspectorShared_default", "createCheckbox", "tilesetPanelContents", "displayPanelContents", "updatePanelContents", "loggingPanelContents", "tileDebugLabelsPanelContents", "stylePanelContents", "optimizationPanelContents", "properties", "propertiesLabel", "propertiesField", "makeButton", "warningText", "pointCloudShadingContainer", "makeRangeInput", "edlContainer", "sseContainer", "dynamicScreenSpaceErrorContainer", "statistics", "pickStatistics", "resourceCacheStatistics", "stylePanelEditor", "blendDropdown", "styleEditor", "closeStylesBtn", "errorBox", "skipScreenSpaceErrorFactorContainer", "baseScreenSpaceError", "skipLevelsContainer", "knockout_default", "destroyObject_default", "property", "min", "max", "step", "displayProperty", "defaultValue_default", "input", "slider", "wrapper", "action", "active", "button", "binding", "defined_default", "Cesium3DTilesInspector_default", "frustumStatisticsToString", "statistics", "str", "defined_default", "com", "n", "num", "s", "f", "i", "p", "boundDepthFrustum", "lower", "upper", "proposed", "bounded", "scratchPickRay", "Ray_default", "scratchPickCartesian", "Cartesian3_default", "CesiumInspectorViewModel", "scene", "performanceContainer", "that", "canvas", "eventHandler", "ScreenSpaceEventHandler_default", "globe", "knockout_default", "createCommand_default", "val", "PerformanceDisplay_default", "modelMatrix", "DebugModelMatrixPrimitive_default", "command", "next", "tileBoundariesLayer", "TileCoordinatesImageryProvider_default", "pickPrimitive", "e", "newPick", "ScreenSpaceEventType_default", "selectTile", "selectedTile", "ellipsoid", "ray", "cartesian", "cartographic", "tilesRendered", "textureCount", "tilesRenderedByTextureCount", "tileIndex", "tile", "Rectangle_default", "newPrimitive", "oldPrimitive", "newTile", "oldTile", "data", "numberOfFrustums", "destroyObject_default", "CesiumInspectorViewModel_default", "CesiumInspector", "container", "scene", "getElement_default", "performanceContainer", "viewModel", "CesiumInspectorViewModel_default", "element", "text", "panel", "createSection", "InspectorShared_default", "createCheckbox", "generalSection", "debugShowFrustums", "frustumStatistics", "shaderCacheDisplay", "depthFrustum", "gLabel", "gText", "gMinusButton", "gPlusButton", "primSection", "pickPrimRequired", "pickPrimitiveButton", "buttonWrap", "terrainSection", "pickTileRequired", "pickTileButton", "tileInfo", "parentTile", "nwTile", "neTile", "swTile", "seTile", "tileText", "relativeText", "table", "tr1", "tr2", "td1", "td2", "td3", "td4", "td5", "td6", "knockout_default", "destroyObject_default", "CesiumInspector_default", "getDefaultSkyBoxUrl", "suffix", "buildModuleUrl_default", "startRenderLoop", "widget", "lastFrameTime", "render", "frameTime", "targetFrameRate", "defined_default", "interval", "delta", "error", "title", "configurePixelRatio", "pixelRatio", "configureCanvasSize", "canvas", "width", "height", "configureCameraFrustum", "frustum", "CesiumWidget", "container", "options", "getElement_default", "defaultValue_default", "element", "supportsImageRenderingPixelated", "FeatureDetection_default", "blurActiveElement", "innerCreditContainer", "creditContainer", "creditViewport", "showRenderLoopErrors", "useBrowserRecommendedResolution", "Clock_default", "scene", "Scene_default", "Cartesian3_default", "ellipsoid", "Ellipsoid_default", "globe", "Globe_default", "ShadowMode_default", "skyBox", "SkyBox_default", "Sun_default", "Moon_default", "skyAtmosphere", "SkyAtmosphere_default", "imageryProvider", "createWorldImagery_default", "ScreenSpaceEventHandler_default", "SceneMode_default", "that", "message", "terrainProvider", "value", "overlay", "content", "errorHeader", "errorPanelScroller", "resizeCallback", "hasMessage", "hasError", "errorMessage", "errorDetails", "formatError_default", "errorMessageDetails", "moreDetails", "e", "buttonPanel", "okButton", "destroyObject_default", "currentTime", "CesiumWidget_default", "FullscreenButtonViewModel", "fullscreenElement", "container", "defined_default", "getElement_default", "that", "tmpIsFullscreen", "knockout_default", "Fullscreen_default", "tmpIsEnabled", "ownerDocument", "value", "createCommand_default", "defaultValue_default", "destroyObject_default", "FullscreenButtonViewModel_default", "enterFullScreenPath", "exitFullScreenPath", "FullscreenButton", "container", "fullscreenElement", "getElement_default", "viewModel", "FullscreenButtonViewModel_default", "element", "knockout_default", "destroyObject_default", "FullscreenButton_default", "DEFAULT_HEIGHT", "GeocoderViewModel", "options", "defined_default", "CartographicGeocoderService_default", "IonGeocoderService_default", "Event_default", "handleArrowDown", "handleArrowUp", "that", "knockout_default", "suggestionsNotEmpty", "showSuggestions", "createCommand_default", "geocodeType", "defaultValue_default", "GeocodeType_default", "cancelGeocode", "geocode", "data", "event", "downKey", "upKey", "enterKey", "destination", "clearSuggestions", "searchTextObservable", "value", "viewModel", "currentIndex", "next", "numberOfSuggestions", "computeFlyToLocationForCartographic", "cartographic", "terrainProvider", "availability", "sampleTerrainMostDetailed_default", "positionOnTerrain", "flyToDestination", "scene", "ellipsoid", "camera", "finalDestination", "promise", "Rectangle_default", "Math_default", "computeFlyToLocationForRectangle_default", "result", "Matrix4_default", "chainPromise", "geocoderService", "query", "err", "geocoderServices", "hasOnlyWhitespace", "i", "geocoderResults", "adjustSuggestionsScroll", "focusedItemIndex", "container", "getElement_default", "searchResults", "element", "offsetTop", "string", "updateSearchSuggestions", "service", "results", "newResults", "suggestions", "GeocoderViewModel_default", "startSearchPath", "stopSearchPath", "Geocoder", "options", "container", "getElement_default", "viewModel", "GeocoderViewModel_default", "form", "textBox", "searchButton", "searchSuggestionsContainer", "suggestionsList", "suggestions", "knockout_default", "e", "target", "FeatureDetection_default", "destroyObject_default", "Geocoder_default", "HomeButtonViewModel", "scene", "duration", "that", "createCommand_default", "knockout_default", "value", "HomeButtonViewModel_default", "HomeButton", "container", "scene", "duration", "getElement_default", "viewModel", "HomeButtonViewModel_default", "element", "knockout_default", "destroyObject_default", "HomeButton_default", "cameraEnabledPath", "cameraDisabledPath", "InfoBoxViewModel", "Event_default", "knockout_default", "defined_default", "offset", "InfoBoxViewModel_default", "InfoBox", "container", "getElement_default", "infoElement", "titleElement", "cameraElement", "closeElement", "frame", "viewModel", "InfoBoxViewModel_default", "knockout_default", "that", "frameDocument", "cssLink", "buildModuleUrl_default", "frameContent", "subscribeAndEvaluate_default", "value", "background", "firstElementChild", "style", "backgroundColor", "color", "Color_default", "defined_default", "height", "destroyObject_default", "InfoBox_default", "NavigationHelpButtonViewModel", "that", "createCommand_default", "knockout_default", "NavigationHelpButtonViewModel_default", "NavigationHelpButton", "options", "container", "getElement_default", "viewModel", "NavigationHelpButtonViewModel_default", "showInsructionsDefault", "defaultValue_default", "wrapper", "button", "instructionContainer", "mouseButton", "mouseIcon", "buildModuleUrl_default", "touchButton", "touchIcon", "clickInstructions", "touchInstructions", "knockout_default", "e", "FeatureDetection_default", "destroyObject_default", "NavigationHelpButton_default", "PerformanceWatchdogViewModel", "options", "defaultValue_default", "knockout_default", "that", "createCommand_default", "monitor", "FrameRateMonitor_default", "destroyObject_default", "PerformanceWatchdogViewModel_default", "PerformanceWatchdog", "options", "container", "getElement_default", "viewModel", "PerformanceWatchdogViewModel_default", "element", "dismissButton", "message", "knockout_default", "destroyObject_default", "PerformanceWatchdog_default", "ProjectionPickerViewModel", "scene", "OrthographicFrustum_default", "knockout_default", "that", "createCommand_default", "SceneMode_default", "EventHelper_default", "transitioner", "oldMode", "newMode", "isMorphing", "defined_default", "destroyObject_default", "ProjectionPickerViewModel_default", "perspectivePath", "orthographicPath", "ProjectionPicker", "container", "scene", "getElement_default", "viewModel", "ProjectionPickerViewModel_default", "wrapper", "button", "perspectiveButton", "orthographicButton", "knockout_default", "e", "FeatureDetection_default", "destroyObject_default", "ProjectionPicker_default", "SceneModePickerViewModel", "scene", "duration", "that", "morphStart", "transitioner", "oldMode", "newMode", "isMorphing", "EventHelper_default", "defaultValue_default", "knockout_default", "mode", "SceneMode_default", "createCommand_default", "value", "destroyObject_default", "SceneModePickerViewModel_default", "globePath", "flatMapPath", "columbusViewPath", "SceneModePicker", "container", "scene", "duration", "getElement_default", "viewModel", "SceneModePickerViewModel_default", "wrapper", "button", "morphTo3DButton", "morphTo2DButton", "morphToCVButton", "knockout_default", "e", "FeatureDetection_default", "destroyObject_default", "SceneModePicker_default", "screenSpacePos", "Cartesian2_default", "offScreen", "SelectionIndicatorViewModel", "scene", "selectionIndicatorElement", "container", "defaultValue_default", "knockout_default", "defined_default", "position", "result", "SceneTransforms_default", "screenPosition", "containerWidth", "containerHeight", "indicatorSize", "halfSize", "EasingFunction_default", "SelectionIndicatorViewModel_default", "SelectionIndicator", "container", "scene", "getElement_default", "el", "svgNS", "path", "svg", "group", "pathElement", "viewModel", "SelectionIndicatorViewModel_default", "knockout_default", "destroyObject_default", "SelectionIndicator_default", "TimelineHighlightRange", "color", "heightInPx", "base", "defaultValue_default", "start", "stop", "renderState", "range", "highlightStart", "JulianDate_default", "highlightLeft", "highlightStop", "highlightWidth", "TimelineHighlightRange_default", "TimelineTrack", "interval", "pixelHeight", "color", "backgroundColor", "Color_default", "context", "renderState", "startInterval", "stopInterval", "spanStart", "spanStop", "JulianDate_default", "x", "start", "stop", "currentTime", "defined_default", "TimelineTrack_default", "timelineWheelDelta", "timelineMouseMode", "timelineTouchMode", "timelineTicScales", "timelineMonthNames", "Timeline", "container", "clock", "getElement_default", "ownerDocument", "topDiv", "createMouseDownCallback", "createMouseUpCallback", "createMouseMoveCallback", "createMouseWheelCallback", "createTouchStartCallback", "createTouchMoveCallback", "createTouchEndCallback", "timeBarEle", "type", "listener", "useCapture", "doc", "destroyObject_default", "color", "heightInPx", "base", "newHighlightRange", "TimelineHighlightRange_default", "interval", "backgroundColor", "newTrack", "TimelineTrack_default", "startTime", "stopTime", "JulianDate_default", "ClockRange_default", "clockStart", "clockEnd", "clockSpan", "startOffset", "endOffset", "evt", "amount", "centerSec", "centerSecFlip", "twoDigits", "num", "time", "gregorian", "millisecond", "millisecondString", "timeBar", "seconds", "xPos", "scrubX", "tic", "widget", "tics", "minimumDuration", "maximumDuration", "epsilon", "minSize", "duration", "timeBarWidth", "startJulian", "epsilonTime", "epochJulian", "gregorianDate", "endTime", "getStartTic", "ticScale", "getNextTic", "getAlpha", "remainder", "x", "y", "sampleWidth", "origMinSize", "renderState", "highlightRange", "mainTic", "subTic", "tinyTic", "idealTic", "ticIndex", "smallestIndex", "ticScaleLen", "i", "sc", "lastTextLeft", "textWidth", "leapSecond", "ticTime", "ticLeap", "ticLeft", "ticLabel", "labelLeft", "track", "scrubElement", "defined_default", "timeline", "e", "dx", "dsec", "dy", "len", "leftX", "newCenter", "newSpan", "newStartTime", "zoom", "width", "height", "trackListHeight", "Timeline_default", "import_nosleep", "lockScreen", "orientation", "locked", "screen", "defined_default", "unlockScreen", "toggleVR", "viewModel", "scene", "isVRMode", "isOrthographic", "Fullscreen_default", "VRButtonViewModel", "vrElement", "that", "isEnabled", "knockout_default", "value", "EventHelper_default", "OrthographicFrustum_default", "NoSleep", "createCommand_default", "defaultValue_default", "getElement_default", "destroyObject_default", "VRButtonViewModel_default", "enterVRPath", "exitVRPath", "VRButton", "container", "scene", "vrElement", "getElement_default", "viewModel", "VRButtonViewModel_default", "element", "knockout_default", "destroyObject_default", "VRButton_default", "boundingSphereScratch", "BoundingSphere_default", "onTimelineScrubfunction", "clock", "getCesium3DTileFeatureDescription", "feature", "propertyIds", "html", "propertyId", "value", "defined_default", "getCesium3DTileFeatureName", "i", "possibleIds", "length", "item", "pickEntity", "viewer", "e", "picked", "id", "defaultValue_default", "Entity_default", "Cesium3DTileFeature_default", "pickImageryLayerFeature", "scratchStopTime", "JulianDate_default", "trackDataSourceClock", "timeline", "dataSource", "dataSourceClock", "startTime", "stopTime", "Math_default", "cartesian3Scratch", "Cartesian3_default", "windowPosition", "scene", "pickRay", "imageryLayerFeaturePromise", "loadingMessage", "features", "createNoFeaturesEntity", "entity", "ecfPosition", "ConstantPositionProperty_default", "enableVRUI", "enabled", "geocoder", "homeButton", "sceneModePicker", "projectionPicker", "baseLayerPicker", "animation", "fullscreenButton", "infoBox", "selectionIndicator", "visibility", "right", "Viewer", "container", "options", "getElement_default", "createBaseLayerPicker", "that", "viewerContainer", "cesiumWidgetContainer", "bottomContainer", "scene3DOnly", "clockViewModel", "destroyClockViewModel", "Clock_default", "ClockViewModel_default", "cesiumWidget", "CesiumWidget_default", "dataSourceCollection", "destroyDataSourceCollection", "DataSourceCollection_default", "dataSourceDisplay", "DataSourceDisplay_default", "eventHelper", "EventHelper_default", "selectionIndicatorContainer", "SelectionIndicator_default", "infoBoxContainer", "InfoBox_default", "infoBoxViewModel", "toolbar", "geocoderContainer", "geocoderService", "Geocoder_default", "HomeButton_default", "viewModel", "SceneModePicker_default", "ProjectionPicker_default", "baseLayerPickerDropDown", "imageryProviderViewModels", "createDefaultImageryProviderViewModels_default", "terrainProviderViewModels", "createDefaultTerrainProviderViewModels_default", "BaseLayerPicker_default", "navigationHelpButton", "showNavHelp", "hasSeenNavHelp", "NavigationHelpButton_default", "animationContainer", "Animation_default", "AnimationViewModel_default", "timelineContainer", "Timeline_default", "fullscreenSubscription", "fullscreenContainer", "FullscreenButton_default", "subscribeAndEvaluate_default", "isFullscreenEnabled", "vrButton", "vrSubscription", "vrModeSubscription", "vrContainer", "VRButton_default", "isVREnabled", "isVRMode", "Event_default", "knockout_default", "dataSourceLength", "pickAndTrackObject", "Property_default", "pickAndSelectObject", "ScreenSpaceEventType_default", "terrainProvider", "cancelZoom", "sceneMode", "SceneMode_default", "Matrix4_default", "selectionIndicatorViewModel", "mixin", "width", "height", "animationExists", "timelineExists", "panelMaxHeight", "geocoderSuggestions", "animationWidth", "creditLeft", "creditBottom", "lastWidth", "timelineStyle", "pixels", "dataSources", "destroyObject_default", "entityCollection", "time", "isUpdated", "entityView", "trackedEntity", "BoundingSphereState_default", "position", "enableCamera", "selectedEntity", "showSelection", "collection", "added", "removed", "removedObject", "removalFunc", "resetClock", "numDataSources", "target", "offset", "zoomToOrFly", "zoomTarget", "isFlight", "zoomPromise", "resolve", "ImageryLayer_default", "rectangle", "computeFlyToLocationForRectangle_default", "Cesium3DTileset_default", "TimeDynamicPointCloud_default", "removeEvent", "clearZoom", "updateZoomTarget", "updateTrackedEntity", "camera", "zoomOptions", "boundingSphere", "HeadingPitchRange_default", "Cartographic_default", "entities", "boundingSpheres", "len", "state", "currentTime", "currentPosition", "bs", "EntityView_default", "Viewer_default", "viewerCesium3DTilesInspectorMixin", "viewer", "container", "cesium3DTilesInspector", "Cesium3DTilesInspector_default", "viewerCesium3DTilesInspectorMixin_default", "viewerCesiumInspectorMixin", "viewer", "cesiumInspectorContainer", "cesiumInspector", "CesiumInspector_default", "viewerCesiumInspectorMixin_default", "viewerDragDropMixin", "viewer", "options", "defaultValue_default", "dropEnabled", "flyToOnDrop", "dropError", "Event_default", "clearOnDrop", "dropTarget", "clampToGround", "proxy", "getElement_default", "value", "unsubscribe", "handleDrop", "subscribe", "event", "stop", "files", "length", "i", "file", "reader", "createOnLoadCallback", "createDropErrorCallback", "wrapFunction_default", "currentTarget", "defined_default", "scene", "evt", "fileName", "loadPromise", "CzmlDataSource_default", "GeoJsonDataSource_default", "KmlDataSource_default", "GpxDataSource_default", "dataSource", "error", "viewerDragDropMixin_default", "viewerPerformanceWatchdogMixin", "viewer", "options", "defaultValue_default", "performanceWatchdog", "PerformanceWatchdog_default", "viewerPerformanceWatchdogMixin_default", "UniformType", "UniformType_default", "TextureManager", "textureId", "fetchTexture2D", "textureManager", "textureUniform", "image", "texture", "defined_default", "createTexture", "loadedImage", "context", "id", "getTextureAndMips", "getWebGL1Texture", "oldTexture", "typedArray", "sampler", "getTextureFromTypedArray", "Texture_default", "samplerRequiresMipmap", "needMipmap", "samplerRepeats", "TextureWrap_default", "width", "height", "isPowerOfTwo", "Math_default", "PixelDatatype_default", "imageFromArray", "getImageFromTypedArray_default", "resizedImage", "resizeImageToNextPowerOfTwo_default", "TextureMinificationFilter_default", "pixelFormat", "pixelDatatype", "arrayBufferView", "frameState", "loadedImages", "textures", "instance", "destroyObject_default", "TextureManager_default", "CustomShader", "options", "defaultValue_default", "CustomShaderMode_default", "CustomShaderTranslucencyMode_default", "TextureManager_default", "buildUniformMap", "findUsedVariables", "validateBuiltinVariables", "customShader", "uniforms", "uniformMap", "uniformName", "uniform", "UniformType_default", "createUniformTexture2DFunction", "createUniformFunction", "getVariables", "shaderText", "regex", "outputSet", "match", "variableName", "attributeRegex", "featureIdRegex", "metadataRegex", "attributeSet", "vertexShaderText", "defined_default", "fragmentShaderText", "materialRegex", "materialSet", "expandCoordinateAbbreviations", "modelCoordinatesRegex", "worldCoordinatesRegex", "eyeCoordinatesRegex", "validateVariableUsage", "variableSet", "incorrectVariable", "correctVariable", "vertexOrFragment", "message", "DeveloperError_default", "attributesVS", "attributesFS", "value", "frameState", "destroyObject_default", "CustomShader_default", "TextureUniform", "options", "defaultValue_default", "PixelFormat_default", "PixelDatatype_default", "resource", "Resource_default", "wrap", "TextureWrap_default", "Sampler_default", "TextureUniform_default", "VaryingType", "VaryingType_default", "callAndWrap", "workerFunction", "parameters", "transferableObjects", "resultOrPromise", "e", "createTaskProcessorWorker", "postMessage", "event", "data", "responseMessage", "result", "defined_default", "defaultValue_default", "formatError_default", "createTaskProcessorWorker_default", "VERSION"] -} diff --git a/src/renderer/public/sdk/YJEarth.min.js b/src/renderer/public/sdk/YJEarth.min.js index 6691c18..a67e7b9 100644 --- a/src/renderer/public/sdk/YJEarth.min.js +++ b/src/renderer/public/sdk/YJEarth.min.js @@ -1,4 +1,4 @@ -/*! update time: 2025/7/30 11:57:36*/!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}([function(t,e,i){var n=i(23)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);function o(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(t,e,i,n,o,s,a){try{var r=t[s](a),l=r.value}catch(t){return void i(t)}r.done?e(l):Promise.resolve(l).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,s){var a=t.apply(e,n);function r(t){i(a,o,s,r,l,"next",t)}function l(t){i(a,o,s,r,l,"throw",t)}r(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(14);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(28),o=i(29),s=i(15),a=i(30);t.exports=function(t){return n(t)||o(t)||s(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default,o=i(12);t.exports=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(18);function o(){return t.exports=o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var o=n(t,e);if(o){var s=Object.getOwnPropertyDescriptor(o,e);return s.get?s.get.call(arguments.length<3?t:i):s.value}},t.exports.__esModule=!0,t.exports.default=t.exports,o.apply(null,arguments)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(24),o=i(25),s=i(15),a=i(26);t.exports=function(t,e){return n(t)||o(t,e)||s(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){throw new TypeError('"'+t+'" is read-only')},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e,n){return t.exports=i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e,n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(16);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default,o=i(27);t.exports=function(t){var e=o(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(5);t.exports=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__; +/*! update time: 2025/8/29 14:34:59*/!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}([function(t,e,i){var n=i(23)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(18);function o(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(t,e,i,n,o,s,a){try{var r=t[s](a),l=r.value}catch(t){return void i(t)}r.done?e(l):Promise.resolve(l).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,s){var a=t.apply(e,n);function r(t){i(a,o,s,r,l,"next",t)}function l(t){i(a,o,s,r,l,"throw",t)}r(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(15);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(28),o=i(29),s=i(16),a=i(30);t.exports=function(t){return n(t)||o(t)||s(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default,o=i(12);t.exports=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(18);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(19);function o(){return t.exports=o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var o=n(t,e);if(o){var s=Object.getOwnPropertyDescriptor(o,e);return s.get?s.get.call(arguments.length<3?t:i):s.value}},t.exports.__esModule=!0,t.exports.default=t.exports,o.apply(null,arguments)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(24),o=i(25),s=i(16),a=i(26);t.exports=function(t,e){return n(t)||o(t,e)||s(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){throw new TypeError('"'+t+'" is read-only')},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(19),o=i(8);function s(t,e,i,a){return(s="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,s){var a,r=n(t,e);if(r){if((a=Object.getOwnPropertyDescriptor(r,e)).set)return a.set.call(s,i),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(s,e)){if(!a.writable)return!1;a.value=i,Object.defineProperty(s,e,a)}else o(s,e,i);return!0})(t,e,i,a)}t.exports=function(t,e,i,n,o){if(!s(t,e,i,n||t)&&o)throw new TypeError("failed to set property");return i},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e,n){return t.exports=i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e,n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default,o=i(27);t.exports=function(t){var e=o(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(5);t.exports=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__; /** * [js-md5]{@link https://github.com/emn178/js-md5} * @@ -7,13 +7,13 @@ * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2017 * @license MIT - */!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(33),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(e){return new Md5(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(e){return t.create().update(e)};for(var e=0;e<OUTPUT_TYPES.length;++e){var i=OUTPUT_TYPES[e];t[i]=createOutputMethod(i)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if("string"==typeof t)return crypto.createHash("md5").update(t,"utf8").digest("hex");if(null==t)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){if(t)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var e=new ArrayBuffer(68);this.buffer8=new Uint8Array(e),this.blocks=new Uint32Array(e)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var e,i=typeof t;if("string"!==i){if("object"!==i)throw ERROR;if(null===t)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw ERROR;e=!0}for(var n,o,s=0,a=t.length,r=this.blocks,l=this.buffer8;s<a;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),e)if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)l[o++]=t[s];else for(o=this.start;s<a&&o<64;++s)r[o>>2]|=t[s]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)(n=t.charCodeAt(s))<128?l[o++]=n:n<2048?(l[o++]=192|n>>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;s<a&&o<64;++s)(n=t.charCodeAt(s))<128?r[o>>2]|=n<<SHIFT[3&o++]:n<2048?(r[o>>2]|=(192|n>>6)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(r[o>>2]|=(224|n>>12)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),r[o>>2]|=(240|n>>18)<<SHIFT[3&o++],r[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,n,o,s,a=this.blocks;this.first?e=((e=((t=((t=a[0]-680876937)<<7|t>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&t)+a[1]-117830708)<<12|n>>>20)+t<<0)&(-271733879^t))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1316259209)<<22|e>>>10)+i<<0:(t=this.h0,e=this.h1,i=this.h2,e=((e+=((t=((t+=((n=this.h3)^e&(i^n))+a[0]-680876936)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[1]-389564586)<<12|n>>>20)+t<<0)&(t^e))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1044525330)<<22|e>>>10)+i<<0),e=((e+=((t=((t+=(n^e&(i^n))+a[4]-176418897)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[5]+1200080426)<<12|n>>>20)+t<<0)&(t^e))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^t))+a[7]-45705983)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[8]+1770035416)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[9]-1958414417)<<12|n>>>20)+t<<0)&(t^e))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^t))+a[11]-1990404162)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[12]+1804603682)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[13]-40341101)<<12|n>>>20)+t<<0)&(t^e))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^t))+a[15]+1236535329)<<22|e>>>10)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[1]-165796510)<<5|t>>>27)+e<<0)^e))+a[6]-1069501632)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[5]-701558691)<<5|t>>>27)+e<<0)^e))+a[10]+38016083)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[9]+568446438)<<5|t>>>27)+e<<0)^e))+a[14]-1019803690)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[13]-1444681467)<<5|t>>>27)+e<<0)^e))+a[2]-51403784)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|e>>>12)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[5]-378558)<<4|t>>>28)+e<<0))+a[8]-2022574463)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[1]-1530992060)<<4|t>>>28)+e<<0))+a[4]+1272893353)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[13]+681279174)<<4|t>>>28)+e<<0))+a[0]-358537222)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[9]-640364487)<<4|t>>>28)+e<<0))+a[12]-421815835)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|e>>>9)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[0]-198630844)<<6|t>>>26)+e<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~t))+a[5]-57434055)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[12]+1700485571)<<6|t>>>26)+e<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[10]-1051523)<<15|i>>>17)+n<<0)|~t))+a[1]-2054922799)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[8]+1873313359)<<6|t>>>26)+e<<0)|~i))+a[15]-30611744)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~t))+a[13]+1309151649)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[4]-145523070)<<6|t>>>26)+e<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[2]+718787259)<<15|i>>>17)+n<<0)|~t))+a[9]-343485551)<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,n="",o=this.array(),s=0;s<15;)t=o[s++],e=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return t=o[s],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(31),__webpack_require__(32))},function(t,e,i){var n=i(18),o=i(7);function s(t,e,i,a){return(s="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,s){var a,r=n(t,e);if(r){if((a=Object.getOwnPropertyDescriptor(r,e)).set)return a.set.call(s,i),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(s,e)){if(!a.writable)return!1;a.value=i,Object.defineProperty(s,e,a)}else o(s,e,i);return!0})(t,e,i,a)}t.exports=function(t,e,i,n,o){if(!s(t,e,i,n||t)&&o)throw new TypeError("failed to set property");return i},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(5),o=i(14),s=i(34),a=i(35);function r(e){var i="function"==typeof Map?new Map:void 0;return t.exports=r=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(39)},function(t,e,i){var n=i(11).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var o=e&&e.prototype instanceof b?e:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:P(t,i,a)}),s}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};h(k,c,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(B([])));x&&x!==s&&a.call(x,c)&&(k=x);var E=w.prototype=b.prototype=Object.create(k);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,l){var c=m(t[o],t,s);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){i("next",t,r,l)}),(function(t){i("throw",t,r,l)})):e.resolve(p).then((function(t){u.value=t,r(u)}),(function(t){return i("throw",t,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}})}function P(t,i,n){var o=f;return function(s,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=M(r,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(t,i,n);if("normal"===c.type){if(o=n.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function M(t,i){var n=i.method,o=t.iterator[n];if(o===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,M(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=m(o,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++o<t.length;)if(a.call(t,o))return i.value=t[o],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}throw new TypeError(n(t)+" is not iterable")}return C.prototype=w,r(E,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:C,configurable:!0}),C.displayName=h(w,p,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,h(t,p,"GeneratorFunction")),t.prototype=Object.create(E),t},i.awrap=function(t){return{__await:t}},S(D.prototype),h(D.prototype,u,(function(){return this})),i.AsyncIterator=D,i.async=function(t,e,n,o,s){void 0===s&&(s=Promise);var a=new D(d(t,e,n,o),s);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(E),h(E,p,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},i.values=B,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var i in this)"t"===i.charAt(0)&&a.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,o){return r.type="throw",r.arg=t,i.next=n,o&&(i.method="next",i.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:B(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,o,s,a,r=[],l=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(r.push(n.value),r.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw o}}return r}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(16);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var i,n,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,p=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var t=r(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++p<e;)l&&l[p].run();p=-1,e=c.length}l=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function f(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new m(t,e)),1!==c.length||u||r(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){(function(e){t.exports=e}).call(this,{toUrlUndefined:!0})},function(t,e){t.exports=function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(36),o=i(14);t.exports=function(t,e,i){if(n())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,e);var a=new(t.bind.apply(t,s));return i&&o(a,i.prototype),a},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(t.exports=i=function(){return!!e},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t){t.exports=JSON.parse("{}")},function(t){t.exports=JSON.parse('{"地震灾害":{"1":{"c":30,"m":85,"y":65,"k":0},"2":{"c":0,"m":95,"y":40,"k":0},"3":{"c":5,"m":55,"y":40,"k":0},"4":{"c":2,"m":20,"y":20,"k":0}},"洪水灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"干旱灾害":{"1":{"c":10,"m":15,"y":100,"k":10},"2":{"c":0,"m":5,"y":55,"k":0},"3":{"c":0,"m":2,"y":25,"k":0},"4":{"c":0,"m":0,"y":10,"k":0}},"雪灾灾害":{"1":{"c":100,"m":65,"y":40,"k":0},"2":{"c":100,"m":40,"y":15,"k":0},"3":{"c":65,"m":25,"y":10,"k":0},"4":{"c":18,"m":8,"y":8,"k":0}},"雷电、冰雹灾害":{"1":{"c":40,"m":45,"y":40,"k":0},"2":{"c":30,"m":30,"y":25,"k":0},"3":{"c":0,"m":0,"y":0,"k":16},"4":{"c":0,"m":0,"y":0,"k":0}},"高温灾害":{"1":{"c":20,"m":90,"y":65,"k":20},"2":{"c":20,"m":85,"y":100,"k":0},"3":{"c":0,"m":55,"y":80,"k":0},"4":{"c":0,"m":30,"y":85,"k":0}},"低温灾害":{"1":{"c":70,"m":70,"y":50,"k":0},"2":{"c":60,"m":50,"y":30,"k":0},"3":{"c":40,"m":35,"y":20,"k":0},"4":{"c":10,"m":10,"y":5,"k":0}},"台风灾害":{"1":{"c":95,"m":75,"y":75,"k":0},"2":{"c":75,"m":60,"y":65,"k":0},"3":{"c":40,"m":25,"y":30,"k":0},"4":{"c":25,"m":10,"y":15,"k":0}},"大风、沙尘暴灾害":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":25},"3":{"c":0,"m":0,"y":60,"k":0},"4":{"c":0,"m":0,"y":25,"k":0}},"暴雨灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"自然灾害GDP综合风险图色彩样式":{"1":{"c":15,"m":100,"y":85,"k":0},"2":{"c":7,"m":50,"y":60,"k":0},"3":{"c":0,"m":5,"y":55,"k":0},"4":{"c":0,"m":2,"y":25,"k":0},"5":{"c":0,"m":0,"y":10,"k":0}},"自然灾害死亡人口综合风险图色彩样式":{"1":{"c":0,"m":100,"y":100,"k":25},"2":{"c":15,"m":100,"y":85,"k":0},"3":{"c":5,"m":50,"y":60,"k":0},"4":{"c":5,"m":35,"y":40,"k":0},"5":{"c":0,"m":15,"y":15,"k":0}},"自然灾害受灾人口综合风险图色彩样式":{"1":{"c":25,"m":58,"y":95,"k":0},"2":{"c":8,"m":45,"y":95,"k":0},"3":{"c":5,"m":30,"y":60,"k":0},"4":{"c":2,"m":20,"y":40,"k":0},"5":{"c":0,"m":10,"y":20,"k":0}},"自然灾害农作物综合风险图色彩样式":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":45},"3":{"c":0,"m":0,"y":100,"k":25},"4":{"c":0,"m":0,"y":60,"k":0},"5":{"c":10,"m":5,"y":15,"k":0}},"自然灾害房屋综合风险图色彩样式":{"1":{"c":60,"m":90,"y":70,"k":0},"2":{"c":50,"m":90,"y":60,"k":0},"3":{"c":40,"m":80,"y":40,"k":0},"4":{"c":25,"m":45,"y":25,"k":0},"5":{"c":15,"m":25,"y":15,"k":0}},"自然灾害道路综合风险图色彩样式":{"1":{"c":55,"m":65,"y":75,"k":0},"2":{"c":45,"m":50,"y":60,"k":0},"3":{"c":20,"m":30,"y":40,"k":0},"4":{"c":7,"m":15,"y":35,"k":0},"5":{"c":0,"m":10,"y":25,"k":0}},"自然灾害减灾能力图色彩样式":{"1":{"c":90,"m":50,"y":95,"k":0},"2":{"c":70,"m":40,"y":80,"k":0},"3":{"c":50,"m":30,"y":65,"k":0},"4":{"c":35,"m":20,"y":50,"k":0},"5":{"c":10,"m":5,"y":35,"k":0}},"自然灾害综合防治区划图色彩样式":{"1":{"c":0,"m":90,"y":80,"k":0},"2":{"c":0,"m":50,"y":80,"k":0},"3":{"c":60,"m":0,"y":50,"k":25},"4":{"c":60,"m":0,"y":100,"k":0}}}')},function(t,e,i){"use strict";i.r(e),i.d(e,"YJ",(function(){return Qb}));var n=i(3),o=i.n(n),s=i(0),a=i.n(s);var r="9e549c39c542fc9f835c2a5c260f8cc1",l="40ef4712c26360d01e397ebcb0d031ca";function c(){return u.apply(this,arguments)}function u(){return(u=o()(a.a.mark((function t(){var e,i,n,o=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,fetch((e.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:e.username,password:e.password}),headers:{"Content-Type":"application/json"}});case 3:return i=t.sent,t.next=6,i.text();case 6:n=t.sent,0===(n=JSON.parse(n)).code&&(p(e.host),n.token?d(n.token):d(n.data.token));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t){localStorage.setItem(l,t||"")}function h(){return localStorage.getItem(l)||""}function d(t){localStorage.setItem(r,t)}function m(){return localStorage.getItem(r)}function f(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}var g=i(10),y=i.n(g),b=i(7),C=i.n(b),w=i(1),k=i.n(w),_=i(2),x=i.n(_);function E(t){document.addEventListener("keydown",M.bind(t),!1),document.addEventListener("keyup",O.bind(t),!1),t&&t.clock.onTick.addEventListener((function(){!function(t){if(!t.scene.screenSpaceCameraController.enableTilt)return;var e=t.camera,i=t.scene.globe.ellipsoid.cartesianToCartographic(e.position).height,n=i/20,o=n/5e5/Cesium.Math.toDegrees(e.pitch);S.moveForward&&e.rotate(e.right,-o);S.moveBackward&&e.rotate(e.right,o);S.moveLeft&&e.rotate(e.up,-o);S.moveRight&&e.rotate(e.up,o);S.moveUp&&e.moveUp(n);S.moveDown&&e.moveDown(n);S.lookUp&&e.lookUp();S.lookDown&&e.lookDown();S.lookLeft&&e.lookLeft();S.lookRight&&e.lookRight();S.twistLeft&&e.twistLeft();S.twistRight&&e.twistRight();if(S.zoomIn){var s=i/2;s<1&&(s=0),e.zoomIn(s)}if(S.zoomOut){var a=i/2;i+i>=5e7&&(a=5e7-i),e.zoomOut(a)}}(t)}))}var S={moveForward:!1,moveBackward:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1,lookUp:!1,lookDown:!1,lookLeft:!1,lookRight:!1,twistLeft:!1,twistRight:!1,zoomIn:!1,zoomOut:!1};function D(t){switch(t){case 87:return"moveForward";case 83:return"moveBackward";case 68:return"moveRight";case 65:return"moveLeft";case 81:return"moveUp";case 69:return"moveDown";case 38:return"lookUp";case 40:return"lookDown";case 37:return"lookLeft";case 39:return"lookRight";case 96:return"twistLeft";case 110:return"twistRight";case 107:return"zoomIn";case 109:return"zoomOut";default:return}}function M(t){var e;if("input"===(e=document.activeElement).tagName.toLowerCase()&&"checkbox"!==e.type||"textarea"===e.tagName.toLowerCase()||"textarea"===e.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(t.ctrlKey&&t.altKey){if("v"===t.key||"V"===t.key){var i=this.camera;this._CAMERA_SHORTCUT_VIEW={orientation:{heading:i.heading,pitch:i.pitch,roll:i.roll},position:{x:i.position.x,y:i.position.y,z:i.position.z}},localStorage.setItem("CAMERA_SHORTCUT_VIEW",JSON.stringify(this._CAMERA_SHORTCUT_VIEW))}if("f"===t.key||"F"===t.key){var n=localStorage.getItem("CAMERA_SHORTCUT_VIEW");this._CAMERA_SHORTCUT_VIEW=JSON.parse(n),this._CAMERA_SHORTCUT_VIEW&&this._CAMERA_SHORTCUT_VIEW.position&&this._CAMERA_SHORTCUT_VIEW.orientation&&this.camera.flyTo({destination:this._CAMERA_SHORTCUT_VIEW.position,orientation:this._CAMERA_SHORTCUT_VIEW.orientation})}}else{var o=D(t.keyCode);void 0!==o&&(S[o]=!0)}}function O(t){var e=D(t.keyCode);void 0!==e&&(S[e]=!1)}var T=i(11),N=i.n(T),B=i(6),L=i.n(B),A=i(19),j=i.n(A),I=[{name:"GCS_WGS_1984",epsg:"EPSG:4326",def:"+proj=longlat +datum=WGS84 +no_defs"},{name:"GCS_China_Geodetic_Coordinate_System_2000",epsg:"EPSG:4490",def:"+proj=longlat +ellps=GRS80 +no_defs"},{name:"WGS 84 / UTM zone 1N",epsg:"EPSG:32601",def:"+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2N",epsg:"EPSG:32602",def:"+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3N",epsg:"EPSG:32603",def:"+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4N",epsg:"EPSG:32604",def:"+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5N",epsg:"EPSG:32605",def:"+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6N",epsg:"EPSG:32606",def:"+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7N",epsg:"EPSG:32607",def:"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8N",epsg:"EPSG:32608",def:"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9N",epsg:"EPSG:32609",def:"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10N",epsg:"EPSG:32610",def:"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11N",epsg:"EPSG:32611",def:"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12N",epsg:"EPSG:32612",def:"+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13N",epsg:"EPSG:32613",def:"+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14N",epsg:"EPSG:32614",def:"+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15N",epsg:"EPSG:32615",def:"+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16N",epsg:"EPSG:32616",def:"+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17N",epsg:"EPSG:32617",def:"+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18N",epsg:"EPSG:32618",def:"+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19N",epsg:"EPSG:32619",def:"+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20N",epsg:"EPSG:32620",def:"+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21N",epsg:"EPSG:32621",def:"+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22N",epsg:"EPSG:32622",def:"+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23N",epsg:"EPSG:32623",def:"+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24N",epsg:"EPSG:32624",def:"+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25N",epsg:"EPSG:32625",def:"+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26N",epsg:"EPSG:32626",def:"+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27N",epsg:"EPSG:32627",def:"+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28N",epsg:"EPSG:32628",def:"+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29N",epsg:"EPSG:32629",def:"+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30N",epsg:"EPSG:32630",def:"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31N",epsg:"EPSG:32631",def:"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32N",epsg:"EPSG:32632",def:"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33N",epsg:"EPSG:32633",def:"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34N",epsg:"EPSG:32634",def:"+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35N",epsg:"EPSG:32635",def:"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36N",epsg:"EPSG:32636",def:"+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37N",epsg:"EPSG:32637",def:"+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38N",epsg:"EPSG:32638",def:"+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39N",epsg:"EPSG:32639",def:"+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40N",epsg:"EPSG:32640",def:"+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41N",epsg:"EPSG:32641",def:"+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42N",epsg:"EPSG:32642",def:"+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43N",epsg:"EPSG:32643",def:"+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44N",epsg:"EPSG:32644",def:"+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45N",epsg:"EPSG:32645",def:"+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46N",epsg:"EPSG:32646",def:"+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47N",epsg:"EPSG:32647",def:"+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48N",epsg:"EPSG:32648",def:"+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49N",epsg:"EPSG:32649",def:"+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50N",epsg:"EPSG:32650",def:"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51N",epsg:"EPSG:32651",def:"+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52N",epsg:"EPSG:32652",def:"+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53N",epsg:"EPSG:32653",def:"+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54N",epsg:"EPSG:32654",def:"+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55N",epsg:"EPSG:32655",def:"+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56N",epsg:"EPSG:32656",def:"+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57N",epsg:"EPSG:32657",def:"+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58N",epsg:"EPSG:32658",def:"+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59N",epsg:"EPSG:32659",def:"+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60N",epsg:"EPSG:32660",def:"+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 1S",epsg:"EPSG:32701",def:"+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2S",epsg:"EPSG:32702",def:"+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3S",epsg:"EPSG:32703",def:"+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4S",epsg:"EPSG:32704",def:"+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5S",epsg:"EPSG:32705",def:"+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6S",epsg:"EPSG:32706",def:"+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7S",epsg:"EPSG:32707",def:"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8S",epsg:"EPSG:32708",def:"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9S",epsg:"EPSG:32709",def:"+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10S",epsg:"EPSG:32710",def:"+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11S",epsg:"EPSG:32711",def:"+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12S",epsg:"EPSG:32712",def:"+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13S",epsg:"EPSG:32713",def:"+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14S",epsg:"EPSG:32714",def:"+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15S",epsg:"EPSG:32715",def:"+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16S",epsg:"EPSG:32716",def:"+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17S",epsg:"EPSG:32717",def:"+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18S",epsg:"EPSG:32718",def:"+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19S",epsg:"EPSG:32719",def:"+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20S",epsg:"EPSG:32720",def:"+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21S",epsg:"EPSG:32721",def:"+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22S",epsg:"EPSG:32722",def:"+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23S",epsg:"EPSG:32723",def:"+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24S",epsg:"EPSG:32724",def:"+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25S",epsg:"EPSG:32725",def:"+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26S",epsg:"EPSG:32726",def:"+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27S",epsg:"EPSG:32727",def:"+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28S",epsg:"EPSG:32728",def:"+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29S",epsg:"EPSG:32729",def:"+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30S",epsg:"EPSG:32730",def:"+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31S",epsg:"EPSG:32731",def:"+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32S",epsg:"EPSG:32732",def:"+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33S",epsg:"EPSG:32733",def:"+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34S",epsg:"EPSG:32734",def:"+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35S",epsg:"EPSG:32735",def:"+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36S",epsg:"EPSG:32736",def:"+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37S",epsg:"EPSG:32737",def:"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38S",epsg:"EPSG:32738",def:"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39S",epsg:"EPSG:32739",def:"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40S",epsg:"EPSG:32740",def:"+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41S",epsg:"EPSG:32741",def:"+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42S",epsg:"EPSG:32742",def:"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43S",epsg:"EPSG:32743",def:"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44S",epsg:"EPSG:32744",def:"+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45S",epsg:"EPSG:32745",def:"+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46S",epsg:"EPSG:32746",def:"+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47S",epsg:"EPSG:32747",def:"+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48S",epsg:"EPSG:32748",def:"+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49S",epsg:"EPSG:32749",def:"+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50S",epsg:"EPSG:32750",def:"+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51S",epsg:"EPSG:32751",def:"+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52S",epsg:"EPSG:32752",def:"+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53S",epsg:"EPSG:32753",def:"+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54S",epsg:"EPSG:32754",def:"+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55S",epsg:"EPSG:32755",def:"+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56S",epsg:"EPSG:32756",def:"+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57S",epsg:"EPSG:32757",def:"+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58S",epsg:"EPSG:32758",def:"+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59S",epsg:"EPSG:32759",def:"+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60S",epsg:"EPSG:32760",def:"+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_13",epsg:"EPSG:4491",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_14",epsg:"EPSG:4492",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_15",epsg:"EPSG:4493",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_16",epsg:"EPSG:4494",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_17",epsg:"EPSG:4495",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_18",epsg:"EPSG:4496",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_19",epsg:"EPSG:4497",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_20",epsg:"EPSG:4498",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_21",epsg:"EPSG:4499",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_22",epsg:"EPSG:4500",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_23",epsg:"EPSG:4501",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_75E",epsg:"EPSG:4502",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_81E",epsg:"EPSG:4503",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_87E",epsg:"EPSG:4504",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_93E",epsg:"EPSG:4505",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_99E",epsg:"EPSG:4506",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_105E",epsg:"EPSG:4507",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_111E",epsg:"EPSG:4508",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_117E",epsg:"EPSG:4509",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_123E",epsg:"EPSG:4510",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_129E",epsg:"EPSG:4511",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_135E",epsg:"EPSG:4512",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_25",epsg:"EPSG:4513",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_26",epsg:"EPSG:4514",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_27",epsg:"EPSG:4515",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_28",epsg:"EPSG:4516",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_29",epsg:"EPSG:4517",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_30",epsg:"EPSG:4518",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_31",epsg:"EPSG:4519",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_32",epsg:"EPSG:4520",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_33",epsg:"EPSG:4521",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_34",epsg:"EPSG:4522",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_35",epsg:"EPSG:4523",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_36",epsg:"EPSG:4524",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_37",epsg:"EPSG:4525",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_38",epsg:"EPSG:4526",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_39",epsg:"EPSG:4527",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_40",epsg:"EPSG:4528",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_41",epsg:"EPSG:4529",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_42",epsg:"EPSG:4530",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_43",epsg:"EPSG:4531",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_44",epsg:"EPSG:4532",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_45",epsg:"EPSG:4533",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_75E",epsg:"EPSG:4534",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_78E",epsg:"EPSG:4535",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_81E",epsg:"EPSG:4536",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_84E",epsg:"EPSG:4537",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_87E",epsg:"EPSG:4538",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_90E",epsg:"EPSG:4539",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_93E",epsg:"EPSG:4540",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_96E",epsg:"EPSG:4541",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_99E",epsg:"EPSG:4542",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_102E",epsg:"EPSG:4543",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_105E",epsg:"EPSG:4544",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_108E",epsg:"EPSG:4545",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_111E",epsg:"EPSG:4546",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_114E",epsg:"EPSG:4547",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_117E",epsg:"EPSG:4548",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_120E",epsg:"EPSG:4549",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_123E",epsg:"EPSG:4550",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_126E",epsg:"EPSG:4551",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_129E",epsg:"EPSG:4552",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_132E",epsg:"EPSG:4553",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_135E",epsg:"EPSG:4554",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"}],F=function(){return x()((function t(){k()(this,t),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var t=this;I.forEach((function(e){proj4.defs(e.epsg,e.def),t.name_map.set(e.name,e),t.epsg_map.set(e.epsg,e)}))}},{key:"convert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n={points:[],code:0,message:""};if(!this.name_map.has(e)&&!this.epsg_map.has(e))return n.code=1,n.message="不支持的坐标系:"+e,n;if(!this.name_map.has(i)&&!this.epsg_map.has(i))return n.code=1,n.message="不支持的坐标系:"+i,n;var o=(this.name_map.get(e)||this.epsg_map.get(e)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return t.forEach((function(t){var e=Number(t.x),i=Number(t.y),o=Number(t.z||0),s=proj4(a,r,[e,i]);n.points.push({x:Number(s[0].toFixed(10)),y:Number(s[1].toFixed(10)),z:o})})),n}},{key:"getAllProjection",value:function(){return Array.from(this.name_map.values())}},{key:"projectionIsExists",value:function(t){return this.name_map.has(t)||this.epsg_map.has(t)}},{key:"degreesToDMS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t){var e=t.toString(),i=e.indexOf(".");return-1!==i?e.length-i-1:0}function n(t){return Math.pow(10,t)}var o=Math.floor(t),s=n(i(t)),a=Math.floor((t-o)*s*60)/s,r=Math.floor(a),l=n(i(a)),c=Math.floor((a-r)*l)/l*60;return e?o+"°"+Number(a.toFixed(4))+"'":o+"°"+r+"'"+c.toFixed(2)+'"'}},{key:"dmsToDecimal",value:function(t,e){var i,n,o;if(e){var s=t.split("°"),a=s[1].split("'");i=s[0],n=a[0],console.log(i,n);var r=Math.pow(10,8),l=Number(i*r)+n*r/60;return Math.round(l)/r}var c=t.split("°"),u=c[1].split("'"),p=u[1].split('"');i=c[0],n=u[0],o=p[0],console.log(i,n,o);var h=Math.pow(10,8),d=Number(i*h)+n*h/60+o*h/3600;return Math.round(d)/h}}])}();function R(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function z(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?R(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):R(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var H,V,G=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.container=e,this.options=z({},i),this.options.ismove=!0,!1===i.ismove&&(this.options.ismove=i.ismove),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0}),[{key:"init",value:(t=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.closeAll(),U.push(this),this.isDestroy=!1,this._element.body=document.createElement("div"),this._element.body.className="YJ-custom-base-dialog",this._element.body.style.top=this.options.top,this._element.body.style.bottom=this.options.bottom,this._element.body.style.left=this.options.left,this._element.body.style.right=this.options.right,this.container.appendChild(this._element.body),this._element.title=document.createElement("div"),this._element.title.className="title-box",this._element.title.innerHTML='<span class="title">'.concat(this.options.title||"","</span>")+'<span class="close-box"><span class="close"></span><i>✕</i></span>',this._element.body.appendChild(this._element.title),t.next=16,document.createElement("div");case 16:return this._element.content=t.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),t.next=21,document.createElement("div");case 21:return this._element.foot=t.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n <button class="close">关闭</button>\n ',this._element.body.appendChild(this._element.foot),t.next=27,document.createElement("div");case 27:for((e=t.sent).style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.backdropFilter="blur(2px)",e.style.zIndex="-999999",this._element.body.appendChild(e),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){o.close()})),i=this._element.body.getElementsByClassName("close"),n=0;n<i.length;n++)i[n].addEventListener("click",(function(){o.close()}));this.options.ismove&&this.moveDiv();case 41:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"close",value:function(){for(var t=document.getElementsByTagName("style"),e=t.length-1;e>=0;e--)t[e].dataset&&"YJ_style_dialog"===t[e].dataset.name&&document.getElementsByTagName("head")[0].removeChild(t[e]);this._element.body&&this._element.body.parentNode&&this.container.removeChild(this._element.body),this._element.body=null,this._element.title=null,this._element.content=null,this._element.foot=null,this._element_style=null,this.isDestroy=!0,this.closeCallBack&&(this.closeCallBack(),this.closeCallBack=null)}},{key:"closeAll",value:function(){for(var t=U.length-1;t>=0;t--)U[t].close(),U.splice(t,1)}},{key:"titleAppChild",value:function(t){this._element.title.appendChild(t)}},{key:"contentAppChild",value:function(t){this._element.content.appendChild(t)}},{key:"footAppChild",value:function(t,e){e?this._element.foot.insertBefore(t,e):this._element.foot.prepend(t)}},{key:"moveDiv",value:function(){var t=this,e=0,i=0,n=0,o=0,s=this._element.body,a=this;s.onmousedown=function(s){if("title-box"===s.toElement.className){var r=t._element.body.offsetHeight,l=t._element.body.offsetWidth;e=s.clientX,i=s.clientY;var c=window.getComputedStyle(t._element.body).left,u=window.getComputedStyle(t._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var p=document.documentElement.clientHeight,h=document.documentElement.clientWidth;window.onmousemove=function(t){t.preventDefault();var s=t.clientX,c=t.clientY,u=s-(e-n),d=c-(i-o);u<0?u=0:u+l>h&&(u=h-l),d<=0?d=0:d+r>p&&(d=p-r),a._element.body.style.left=u+"px",a._element.body.style.top=d+"px",a._element.body.style.bottom="unset",a._element.body.style.right="unset"},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}}]);var t}(),U=[],W=G,Y=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=null;return{that:Array.prototype.slice.call(t.querySelectorAll(e),0),stopPropagation:function(t){(t=t||window.event).stopPropagation?t.stopPropagation():t.cancelBubble=!0},hide:function(){Y(t,e).that.forEach((function(t){t.style.cssText+="display:none;"}))},show:function(i){void 0!==i?Y(t,e).that[i].style.cssText+="display:block;":Y(t,e).that.forEach((function(t){t.style.cssText+="display:block;"}))},legp_searchList:function(e){var i=[];return Y(t,"input[name="+e+"]").that.forEach((function(t){i.push(t.value)})),i},legp_search:function(o){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Y(t,e).that[i];if(a){var r='<div class="cy_datalist"><i class="yj-custom-icon-arrow-down"></i>\n '.concat(s?'<input type="text" placeholder="输入或选择" autocomplete="off">':'<input type="text" class="datalist '.concat(i,'" readonly="readonly" placeholder="请选择" autocomplete="off">'),'\n <dl style="display: none;position: absolute;background: rgba(0, 0, 0, 0.5);color: rgba(var(--color-sdk-base-rgb), 1);border: 1px solid rgba(var(--color-sdk-base-rgb), 0.2);border-radius: 3px;margin: 2px 0px;max-height: 300px;overflow-x: hidden;white-space: nowrap; font-size: 12px;z-index: 8;">\n </dl>\n </div>');a.innerHTML=r,Y(t,".cy_datalist input").that[i].oninput=function(e){var s=this.value;if(Y(t,".cy_datalist dl").hide(),o.length>0){Y(t,".cy_datalist dl").show();var a=new RegExp(s),r=!1;Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){a.test(e.name)&&(r=!0,Y(t,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===e.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+e.value+'">'+e.name+"</dd>")})),r||(Y(t,".cy_datalist dl").that[i].innerHTML='<dd style="padding: 10px 20px; color: #fff;">暂无数据</dd>'),l()}},Y(t,".cy_datalist input").that[i].onclick=function(e){Y(t,".cy_datalist dl").hide();var i=1*e.srcElement.classList[1];i=i||0,"none"===Y(t,".cy_datalist dl").that[i].style.display&&(0==o.length?this.innerHTML="暂无数据":Y(t,".cy_datalist dl").show(i),Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){Y(t,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===e.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+e.value+'">'+e.name+"</dd>"})),l()),e.stopPropagation()},document.addEventListener("click",(function(){Y(t,".cy_datalist dl").hide()}))}function l(){Y(t,".cy_datalist dl dd").that.forEach((function(t){t.onclick=function(t){if(this&&this.attributes){var e=this.attributes.value.value;n=e,t.currentTarget.parentNode.previousElementSibling.value=e;var i=new Event("input",{bubbles:!0});t.currentTarget.parentNode.previousElementSibling.dispatchEvent(i)}}}))}},legp_searchActive:function(t){n=t}}},J=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new F,H&&H.close&&(H.close(),H=null),t.next=4,new W(e.viewer._container,{title:"度分秒",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 4:return H=t.sent,t.next=7,H.init();case 7:o='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-select-box">\n <span class="label" style="flex: 0 0 60px;">输入格式</span>\n <div class="input-select"></div>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="'.concat(0,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如116.6°, 39.9°</span>\n </p>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: auto;">经度</span>\n <input class="input lng" type="number" min="-180" max="180" value="0" title="">\n </div>\n <div class="col" style="margin: 0;">\n <span class="label">纬度</span>\n <input class="input lat" type="number" min="-90" max="90" value="0" title="">\n </div>\n <div class="col" style="flex: 0 0 24px;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="',1,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度分</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如95°10.1702\', 49°12.4015\'</span>\n </p>\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span class="label">经度</span>\n <input class="input lng-dm-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span class="label">纬度</span>\n <input class="input lat-dm-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 24px;margin: 0;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="',2,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度分秒</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如11°18\'54.37", 39°13\'46.57"</span>\n </p>\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span class="label">经度</span>\n <input class="input lng-dms-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lng-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span class="label">纬度</span>\n <input class="input lat-dms-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lat-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 24px; margin: 0;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <span class="custom-divider" style="order: 10;margin-top: 12px;"></span>\n '),H._element.body.className=H._element.body.className+" proj-convert",(s=document.createElement("div")).style.width="460px",s.style.display="flex",s.style.flexDirection="column",s.innerHTML=o,H.contentAppChild(s),r=s.getElementsByClassName("item"),l=a.a.mark((function t(e){var i,o,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r[e].getAttribute("data-type"),o=r[e].getElementsByClassName("convert")[0],l=r[e].getElementsByClassName("icon-copy-box")[0],(c=new ClipboardJS(l,{text:function(t){var n;switch(i){case 0:case"0":n=r[e].getElementsByClassName("lng")[0].value+"°,"+r[e].getElementsByClassName("lat")[0].value+"°";break;case 1:case"1":n=s.getElementsByClassName("lng-dm-d")[0].value+"°"+s.getElementsByClassName("lng-dm-m")[0].value+"',"+s.getElementsByClassName("lat-dm-d")[0].value+"°"+s.getElementsByClassName("lat-dm-m")[0].value+"'";break;case 2:case"2":n=s.getElementsByClassName("lng-dms-d")[0].value+"°"+s.getElementsByClassName("lng-dms-m")[0].value+"'"+s.getElementsByClassName("lng-dms-s")[0].value+'",'+s.getElementsByClassName("lat-dms-d")[0].value+"°"+s.getElementsByClassName("lat-dms-m")[0].value+"'"+s.getElementsByClassName("lat-dms-s")[0].value+'"'}return n}})).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})})),c.on("error",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"复制失败",type:"warning",duration:1500})})),o.addEventListener("click",(function(){var t,o,a,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x;switch(i){case 0:case"0":t=r[e].getElementsByClassName("lng")[0].value,o=r[e].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0],d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),x=(_=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=_[0],s.getElementsByClassName("lat-dms-s")[0].value=x[0];break;case 1:case"1":a=r[e].getElementsByClassName("lng-dm-d")[0].value,l=r[e].getElementsByClassName("lng-dm-m")[0].value,c=r[e].getElementsByClassName("lat-dm-d")[0].value,u=r[e].getElementsByClassName("lat-dm-m")[0].value,t=n.dmsToDecimal(a+"°"+l+"'",!0),o=n.dmsToDecimal(c+"°"+u+"'",!0),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),x=(_=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=_[0],s.getElementsByClassName("lat-dms-s")[0].value=x[0];break;case 2:case"2":d=(a=r[e].getElementsByClassName("lng-dms-d")[0].value)+"°"+(l=r[e].getElementsByClassName("lng-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lng-dms-s")[0].value+'"',m=(c=r[e].getElementsByClassName("lat-dms-d")[0].value)+"°"+(u=r[e].getElementsByClassName("lat-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lat-dms-s")[0].value+'"',t=n.dmsToDecimal(d),o=n.dmsToDecimal(m),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0]}window.ELEMENT&&window.ELEMENT.Message({message:"转换成功",type:"success",duration:1500});for(var E=0;E<r.length;E++)r[E].style.display="block"})),0==e?(r[e].style.order=0,r[e].style.display="block",o.style.display="inline-block"):(r[e].style.order=1,r[e].style.display="none",o.style.display="none");case 8:case"end":return t.stop()}}),t)})),c=0;case 18:if(!(c<r.length)){t.next=23;break}return t.delegateYield(l(c),"t0",20);case 20:c++,t.next=18;break;case 23:for(u=s.getElementsByTagName("input"),p=0;p<u.length;p++)u[p].addEventListener("blur",(function(t){t.target.value||(t.target.value=0);var e=Number(t.target.value);t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.value=e}));h=[{name:"度",value:"度",key:0},{name:"度分",value:"度分",key:1},{name:"度分秒",value:"度分秒",key:2}],(d=Y(H._element.content.getElementsByClassName("input-select-box")[0],".input-select"))&&(d.legp_search(h),(m=H._element.content.getElementsByClassName("input-select")[0].getElementsByTagName("input")[0]).value=h[0].value,m.addEventListener("input",(function(){for(var t=0;t<h.length;t++)if(h[t].value===m.value){for(var e=0;e<r.length;e++){var i=r[e].getElementsByClassName("convert")[0];e==h[t].key?(r[e].style.order=0,r[e].style.display="block",i.style.display="inline-block"):(r[e].style.order=0===e?2:1,r[e].style.display="none",i.style.display="none")}break}})));case 28:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),q=function(){H&&H.close&&(H.close(),H=null)},X=function(){return x()((function t(e){k()(this,t),this.sdk=e,this.viewer=e.viewer,this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)}),[{key:"mouse_left",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"mouse_left_down",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_DOWN)}},{key:"mouse_left_up",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"mouse_move",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(t){this.handler&&this.handler.setInputAction((function(){t()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(t){var e=t.position||t.endPosition;t.position1&&t.position2&&(e={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var i=this.viewer.scene.pickPosition(e);if(!i){for(var n=this.viewer.camera.getPickRay(e),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a<o.length;a++)if(o[a].position){s=o[a];break}(i=s.position)||(i=this.viewer.scene.globe.pick(n,this.viewer.scene))}return i}},{key:"mouse_right_keyboard_ctrl",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_start",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START)}},{key:"gesture_pinck_start_keyboard_ctrl",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_end",value:function(t){this.handler&&this.handler.setInputAction((function(e){t()}),Cesium.ScreenSpaceEventType.PINCH_END)}},{key:"gesture_pinck_move",value:function(t){this.handler&&this.handler.setInputAction((function(t){}),Cesium.ScreenSpaceEventType.PINCH_MOVE)}},{key:"destroy",value:function(){this.handler&&this.handler.destroy(),this.handler=null}}])}(),Z=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;k()(this,t),this.point=void 0,this.text=e,this.div=void 0,this.mouse_type=0,this.position=new Cesium.Cartesian3,this.viewer=i.viewer,this.create_tip(this.viewer)}),[{key:"set_text",value:function(t){this.div.getElementsByTagName("p")[0].innerText=t}},{key:"get_mouse_style",value:function(t){var e="";switch(t){case 1:e="move.png";break;default:e="arrow.png"}return"url(lib/img/"+e+"),auto"}},{key:"create_tip",value:function(t){this.create_tooltip()}},{key:"setPosition",value:function(t,e,i){this.position=t,this.move_tooltip(e,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var t=new si;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var e=document.createElement("p");e.style.margin="0px",e.style.padding="0px",e.innerText=this.text,this.div.appendChild(e);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(t.getSourceRootPath()+"/img/point.png",") 100% 100% no-repeat"),i.style.backgroundSize="100% 100%",i.style.position="absolute",i.style.left="-36px",i.style.top="-4px",this.div.style.display="none",this.div.appendChild(i),t=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t._element.style.cursor=this.get_mouse_style(e)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(t,e){var i=0,n=0;if(this.div.style.display="block",this.viewer&&this.viewer._element){var o=this.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];i=o.getBoundingClientRect().top+window.scrollY,n=o.getBoundingClientRect().left+window.scrollX}this.div.style.left=t+30+n+"px",this.div.style.top=e+i+"px"}}])}(),K=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new si,o=new F,V&&V.close&&(V.close(),V=null),t.next=5,new W(e.viewer._container,{title:"投影转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 5:return V=t.sent,t.next=8,V.init();case 8:'\n <span class="custom-divider"></span>\n <div style="width: 540px;display: flex;">\n <div class="row left" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">源坐标</span>\n <button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_left"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input left-x" type="number" title="">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input left-y" type="number" title="">\n </div>\n </div>\n </div>\n <div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">\n <button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>\n </div>\n <div class="row right" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">目标坐标</span>\n <button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_right"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input right-x" readonly="readonly">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input right-y" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',(l=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div style="width: 540px;display: flex;">\n <div class="row left" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">源坐标</span>\n <button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_left"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input left-x" type="number" title="">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input left-y" type="number" title="">\n </div>\n </div>\n </div>\n <div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">\n <button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>\n </div>\n <div class="row right" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">目标坐标</span>\n <button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_right"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input right-x" readonly="readonly">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input right-y" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',V.contentAppChild(l),c=[],u=0,o.epsg_map.forEach((function(t,e){u++,c.push({name:"".concat(u,".  ").concat(e,"(").concat(t.name,")"),value:e})})),(p=Y(l.getElementsByClassName("left")[0],".datalist_left")).legp_search(c,!0),(h=Y(l.getElementsByClassName("right")[0],".datalist_right")).legp_search(c,!0),d=l.getElementsByClassName("pick")[0],m=l.getElementsByClassName("copy")[0],(f=l.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=c[0].value,p.legp_searchActive(c[0].value),(v=l.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=c[0].value,h.legp_searchActive(c[0].value),g=l.getElementsByClassName("convert")[0],y=l.getElementsByClassName("left-x")[0],b=l.getElementsByClassName("left-y")[0],C=l.getElementsByClassName("right-x")[0],w=l.getElementsByClassName("right-y")[0],d.addEventListener("click",(function(){s&&s.destroy(),r&&r.destroy(),s=new Z("左键选择起点坐标,右键取消",e),(r=new X(e)).mouse_move((function(t,e){s.setPosition(e,t.endPosition.x,t.endPosition.y)})),r.mouse_left((function(t,i){var a=n.cartesian3Towgs84(i,e.viewer);s&&s.destroy(),r&&r.destroy();var l=o.convert([{x:Number(a.lng),y:Number(a.lat)}],"EPSG:4326",f.value);0===l.code&&(y.value=l.points[0].x,b.value=l.points[0].y)})),r.mouse_right((function(t,e){s&&s.destroy(),r&&r.destroy()}))})),g.addEventListener("click",(function(){if(!y.value||!b.value)return C.value="",w.value="",void(window.ELEMENT&&window.ELEMENT.Message({message:"请输入源坐标",type:"warning",duration:1500}));var t=o.convert([{x:Number(y.value),y:Number(b.value)}],f.value,v.value);0===t.code?(C.value=t.points[0].x,w.value=t.points[0].y):window.ELEMENT&&window.ELEMENT.Message({message:t.message,type:"warning",duration:1500})})),new ClipboardJS(m,{text:function(t){if(C.value&&w.value){var e="".concat(C.value,",").concat(w.value);return e}C.value="",w.value="",window.ELEMENT&&window.ELEMENT.Message({message:"复制失败,目标坐标为空!",type:"warning",duration:1500})}}).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})}));case 36:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),$=function(){V&&V.close&&(V.close(),V=null)},Q=[new Map,new Map,new Map];Q[0].set("--color-sdk-base-rgb","0, 255, 255"),Q[0].set("--color-sdk-gradual","rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%"),Q[0].set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%"),Q[0].set("--color-sdk-text-shadow","rgba(20, 118, 255, 1)"),Q[1].set("--color-sdk-base-rgb","42, 200, 251"),Q[1].set("--color-sdk-gradual","rgb(42, 200, 251) 6.25%, rgb(42, 145, 251) 100%"),Q[1].set("--color-sdk-bg-gradual","#2ac8fb33 0%, #2ac8fb00 100%"),Q[1].set("--color-sdk-text-shadow","rgba(20, 63, 255, 1)"),Q[2].set("--color-sdk-base-rgb","187, 26, 41"),Q[2].set("--color-sdk-gradual","rgb(187, 26, 41) 6.25%, rgb(236, 20, 20) 100%"),Q[2].set("--color-sdk-bg-gradual","#bb1a2933 0%, #bb1a2900 100%"),Q[2].set("--color-sdk-text-shadow","rgba(246, 8, 30, 1)");var tt={};function et(t,e,i){if(t&&t.div_id){var n=le().sdkD,o=document.getElementById(t.div_id).getElementsByClassName("cesium-viewer")[0],s=new si;tt[t.div_id]||(tt[t.div_id]={}),tt[t.div_id].mousedown&&document.removeEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click&&document.removeEventListener("click",tt[t.div_id].click),tt[t.div_id].callBack||(tt[t.div_id].callBack=i),t!==n&&tt[t.div_id].mouseRightMenuEvent&&tt[t.div_id].mouseRightMenuEvent.destroy();var a=document.getElementById("custom-menu");a&&o.removeChild(a),tt[t.div_id].status=e,e&&(tt[t.div_id].mousedown=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("click",tt[t.div_id].click),tt[t.div_id].mouseRightMenuEvent=new X(t),tt[t.div_id].mouseRightMenuEvent.mouse_right((function(e,i){if(!YJ.Measure.GetMeasureStatus()&&!t.viewer.trackedEntity){var n=t.viewer.entities.getById("svg-control-points_0");if(!n||!n.show){var a=document.getElementById("custom-menu");a&&o.removeChild(a);var r,l=function(e){var i=t.viewer.scene.pick(e.position);if(i)if(i.id){if(i.id.type&&"vector"===i.id.type&&i.id.parentId)return{parentId:i.id.parentId,id:i.id.id};if(i.id.id)return i.id.id;if("string"==typeof i.id)return i.id}else if(i.primitive&&i.primitive.id)return i.primitive.id}(e);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=t.entityMap.get(l);if(!u&&l){var p=l.split("-");p.splice(p.length-1,1),l=p.join("-"),u=t.entityMap.get(l)}u&&u.picking&&(c='\n <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>\n <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">属性</li>\n </ul>\n ');var h=s.cartesian3Towgs84(i,t.viewer);(a=document.createElement("div")).id="custom-menu",a.style.position="absolute",a.style.width="110px",a.style.backgroundColor="#00000085",a.style.color="#ffffff",a.style.padding="6px 0",a.style.boxShadow="4px 4px 4px 0px rgba(0, 0, 0, 0.8)",a.innerHTML='\n <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li>\n </ul>\n '.concat(c,"\n "),o.appendChild(a);var d=e.position.x,m=e.position.y;e.position.x+a.offsetWidth>o.offsetWidth&&(d=e.position.x-a.offsetWidth),e.position.y+a.offsetHeight>o.offsetHeight&&(m=e.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(t){t.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(e){f[e].addEventListener("mouseover",(function(){f[e].style.backgroundColor="#5e5e5e"})),f[e].addEventListener("mouseout",(function(){f[e].style.backgroundColor="unset"})),f[e].addEventListener("click",(function(){var i="";switch(f[e].innerHTML){case"绕鼠标点旋转":v.position=h,i="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,i="attribute"}tt[t.div_id].callBack(i,v),o.removeChild(a)}))},y=0;y<f.length;y++)g(y)}}})))}}function it(t){return t&&t.div_id&&tt[t.div_id]?tt[t.div_id].status:void 0}var nt=null,ot=null,st=null,at=new Map,rt=new Map,lt=new Map;function ct(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function ut(t,e){e.endPosition&&(e.endPosition.y-=2);var i=e.position||e.endPosition,n=t.viewer.scene.pickPosition(i);if(!n){var o=t.viewer.camera.getPickRay(i);n=t.viewer.scene.globe.pick(o,t.viewer.scene)}return n}function pt(t,e){if(t&&t.viewer){var i=!0;(nt=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(n){var o=t.viewer.scene.pickPosition(n.position);if(!o){var s=t.viewer.camera.getPickRay(n.position);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(o){var a=ct(o,t.viewer);if(e&&e(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=at.size-1;l>=0;l--){var c=Array.from(at.keys())[l],u=at.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d<u.that.options.positions.length;d++)h.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);h.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([h]);if(turf.booleanPointInPolygon(p,m)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_<w.length;_++){var x=ct(w[_],t.viewer);k.push([x.lng,x.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M<D.length;M++){var O=ct(D[M],t.viewer);P.push([O.lng,O.lat])}var T=ct(D[0],t.viewer);P.push([T.lng,T.lat]);var N=turf.polygon([P]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var L=[u.that.options.center.lng,u.that.options.center.lat],A=u.that.options.radius/1e3,j=turf.circle(L,A,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,j)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var I=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var F=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),R=[],z=0;z<F.length;z++)R.push([F[z].lng,F[z].lat]);var H=turf.polygon([R]);if(turf.booleanPointInPolygon(I,H)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}}if(!r){var V=t.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var U=at.get(V.id.parentId);if(U.that.picking&&U.that.geojson)for(var W=0;W<U.that.geojson.features.length;W++)U.that.geojson.features[W].id===V.id._id&&U.callback(n,U.that.geojson.features[W].id,ct(ut(t,n),t.viewer),U.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&at.has(V.id.properties.id._value)){var J=at.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,ct(ut(t,n),t.viewer),J.that)}else if(at.has(V.id.id)){var q=at.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,ct(ut(t,n),t.viewer),q.that)}else if(G&&at.has(G)){var X=at.get(G);X.that.picking&&X.callback(n,G,ct(ut(t,n),t.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&at.has(V.id)){var Z=at.get(V.id);Z.callback(n,V.id,ct(ut(t,n),t.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&at.has(V.primitive.id)){var K=at.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(t)&&K.callback(n,V.primitive,ct(ut(t,n),t.viewer),K.that):K.callback(n,V.primitive.id,ct(ut(t,n),t.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&at.has(V.content.tileset.id)){var $=at.get(V.content.tileset.id);$.that.picking&&("bim"===$.that.type?YJ.Global.getBimPickStatus(t)&&$.callback(n,V.content.tileset,ct(ut(t,n),t.viewer),$.that):$.callback(n,V.content.tileset.id,ct(ut(t,n),t.viewer),$.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function ht(t){nt.destroy(),nt=null}function dt(t,e,i){at.set(t,{callback:e,that:i})}function mt(t,e,i){rt.set(t,{callback:e,that:i})}function ft(t,e,i){lt.set(t,{callback:e,that:i})}function vt(){if(nt)return!0}function gt(){if(ot)return!0}function yt(){if(st)return!0}var bt,Ct=new Map,wt=new Map,kt=new Map;function _t(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function xt(t,e){e.endPosition&&(e.endPosition.y-=2);var i=e.position||e.endPosition,n=t.viewer.scene.pickPosition(i);if(!n){var o=t.viewer.camera.getPickRay(i);n=t.viewer.scene.globe.pick(o,t.viewer.scene)}return n}function Et(t,e){if(t&&t.viewer){var i=!0;new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(n){var o=t.viewer.scene.pickPosition(n.position);if(!o){var s=t.viewer.camera.getPickRay(n.position);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(o){var a=_t(o,t.viewer);if(e&&e(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=Ct.size-1;l>=0;l--){var c=Array.from(Ct.keys())[l],u=Ct.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d<u.that.options.positions.length;d++)h.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);h.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([h]);if(turf.booleanPointInPolygon(p,m)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],_=0;_<w.length;_++){var x=_t(w[_],t.viewer);k.push([x.lng,x.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M<D.length;M++){var O=_t(D[M],t.viewer);P.push([O.lng,O.lat])}var T=_t(D[0],t.viewer);P.push([T.lng,T.lat]);var N=turf.polygon([P]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var L=[u.that.options.center.lng,u.that.options.center.lat],A=u.that.options.radius/1e3,j=turf.circle(L,A,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,j)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var I=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var F=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),R=[],z=0;z<F.length;z++)R.push([F[z].lng,F[z].lat]);var H=turf.polygon([R]);if(turf.booleanPointInPolygon(I,H)){u.callback(n,u.that.options.id,_t(xt(t,n),t.viewer),u.that),r=!0;break}}}}if(!r){var V=t.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var U=Ct.get(V.id.parentId);if(U.that.picking&&U.that.geojson)for(var W=0;W<U.that.geojson.features.length;W++)U.that.geojson.features[W].id===V.id._id&&U.callback(n,U.that.geojson.features[W].id,_t(xt(t,n),t.viewer),U.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&Ct.has(V.id.properties.id._value)){var J=Ct.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,_t(xt(t,n),t.viewer),J.that)}else if(Ct.has(V.id.id)){var q=Ct.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,_t(xt(t,n),t.viewer),q.that)}else if(G&&Ct.has(G)){var X=Ct.get(G);X.that.picking&&X.callback(n,G,_t(xt(t,n),t.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&Ct.has(V.id)){var Z=Ct.get(V.id);Z.callback(n,V.id,_t(xt(t,n),t.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&Ct.has(V.primitive.id)){var K=Ct.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(t)&&K.callback(n,V.primitive,_t(xt(t,n),t.viewer),K.that):K.callback(n,V.primitive.id,_t(xt(t,n),t.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&Ct.has(V.content.tileset.id)){var $=Ct.get(V.content.tileset.id);$.that.picking&&("bim"===$.that.type?YJ.Global.getBimPickStatus(t)&&$.callback(n,V.content.tileset,_t(xt(t,n),t.viewer),$.that):$.callback(n,V.content.tileset.id,_t(xt(t,n),t.viewer),$.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function St(t){t&&t.viewer&&new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()){var i,n=t.viewer.scene.pick(e.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=wt.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(e,o.that.geojson.features[s].id,_t(xt(t,e),t.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,wt.has(i)){var a=wt.get(i);if(a.that.picking){var r=xt(t,e);if(!r)return;a.callback(e,i,_t(r,t.viewer),a.that)}}if(n&&n.content&&wt.has(n.content.tileset.id)){var l=wt.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(t)){var c=xt(t,e);if(!c)return;l.callback(e,n.getProperty("id"),_t(c,t.viewer),l.that)}}else{var u=xt(t,e);if(!u)return;l.callback(e,n.content.tileset.id,_t(u,t.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}function Dt(t){new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){t.viewer.scene.pick(e.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}var Pt=!1,Mt="1:100万";function Ot(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){bt||(bt=new si),(Pt=!!e)?Tt(t,Mt):Lt(t);var i=Pe();i&&(Pt?Tt(t,Mt):Lt(i));var n=le().sdkD;n&&t!==n&&Ot(n,e)}}function Tt(t,e){Mt=e,Pt&&Bt(t);var i=Pe();return i&&Pt&&Bt(i),new Promise(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:setTimeout((function(){e()}),1e3);case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}function Nt(){return Pt}function Bt(t){Lt(t);var e,i,n=t.viewer.camera.positionCartographic,o={position:{lng:Cesium.Math.toDegrees(n.longitude),lat:Cesium.Math.toDegrees(n.latitude),alt:n.height}},s=t.viewer;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}for(var a=0;a<s.scene.primitives._primitives.length;a++)if("SheetIndexGridPrimitives"===s.scene.primitives._primitives[a].name){e=s.scene.primitives._primitives[a];for(var r=0;r<e._primitives.length;r++)if("SheetIndexLabelCollection"===e._primitives[r].name){i=e._primitives[r];break}break}e||((e=new Cesium.PrimitiveCollection).name="SheetIndexGridPrimitives",s.scene.primitives.add(e)),i||((i=new Cesium.LabelCollection).name="SheetIndexLabelCollection");var l=0,c=null;function u(t){i.removeAll(),e.removeAll(),(i=new Cesium.LabelCollection).name="SheetIndexLabelCollection",e.add(i);var n,o,s,a=h();switch(t){case"1:100万":n=6,o=4,s=new Cesium.NearFarScalar(2e7,1,8e7,0);break;case"1:50万":n=3,o=2,s=new Cesium.NearFarScalar(5e6,1,3e7,0);break;case"1:25万":n=1.5,o=1,s=new Cesium.NearFarScalar(23e5,1,2e7,0);break;case"1:10万":n=.5,o=1/3,s=new Cesium.NearFarScalar(68e4,1,5e6,0);break;case"1:5万":n=.25,o=1/6,s=new Cesium.NearFarScalar(385e3,1,24e5,0);break;case"1:2.5万":n=.125,o=1/12,s=new Cesium.NearFarScalar(18e4,1,12e5,0);break;case"1:1万":n=.0625,o=1/24,s=new Cesium.NearFarScalar(9e4,1,7e5,0);break;case"1:5000":n=.03125,o=1/48,s=new Cesium.NearFarScalar(46e3,1,3e5,0)}var r=Math.floor((180+Cesium.Math.toDegrees(a.west))/n)*n-180,l=Math.floor((88+Cesium.Math.toDegrees(a.south))/o)*o-88,u=Math.ceil((180+Cesium.Math.toDegrees(a.east))/n)*n-180,d=Math.ceil((88+Cesium.Math.toDegrees(a.north))/o)*o-88;if(r>u&&(u+=360),c={minLng:r,minLat:l,maxLng:u,maxLat:d},l<-88&&(l=-88),d>88&&(d=88),(c.maxLng-c.minLng)/n*((c.maxLat-c.minLat)/o)>7e3)c=null;else{for(var m=r;m<=u;m+=n){for(var f=[],v=[],g=l;Math.floor(1e9*g)/1e9<=d;g+=o/2)v.push([m,g]),f.push(Cesium.Cartesian3.fromDegrees(m,g,8848));88!=d&&d+o/2>=88&&f.push(Cesium.Cartesian3.fromDegrees(m,88,8848));var y=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:f,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});if(e.add(new Cesium.Primitive({geometryInstances:y,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})})),m<u)for(var b=l;b<d;b+=o){var C={lng:m+n/2,lat:b+o/2};if(C.lat>d)break;var w=p(C.lng,C.lat,t);i.add({position:Cesium.Cartesian3.fromDegrees(C.lng,C.lat,8848),text:w,font:"16px Inter, sans-serif",fillColor:Cesium.Color.fromCssColorString("#fcfc00"),pixelOffset:new Cesium.Cartesian2(0,0),showBackground:!1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,scale:1,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,8e7),scaleByDistance:s})}}for(var k=l;Math.floor(1e9*k)/1e9<=d;k+=o){for(var _=[],x=[],E=r;E<=u;E+=n/2)x.push([E,k]),_.push(Cesium.Cartesian3.fromDegrees(E,k,8848));var S=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:_,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});e.add(new Cesium.Primitive({geometryInstances:S,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})}))}}}function p(t,e,i){var n,o;switch(i){case"1:100万":n=6,o=4;break;case"1:50万":n=3,o=2;break;case"1:25万":n=1.5,o=1;break;case"1:10万":n=.5,o=1/3;break;case"1:5万":n=.25,o=1/6;break;case"1:2.5万":n=.125,o=1/12;break;case"1:1万":n=.0625,o=1/24;break;case"1:5000":n=.03125,o=1/48}e=Math.max(-88,Math.min(88,e));var s,a=t,r=e=Math.abs(e),l=Math.floor(a/6+31),c="ABCDEFGHIJKLMNOPQRSTUV".charAt(Math.floor(r/4+1)-1),u={"1:100万":"","1:50万":"B","1:25万":"C","1:10万":"D","1:5万":"E","1:2.5万":"F","1:1万":"G","1:5000":"H"}[i];if(!u&&"1:100万"!==i)throw new Error("不支持的比例尺,请使用: 1:100万, 1:50万, 1:25万, 1:10万, 1:5万, 1:2.5万, 1:1万, 1:5000");s=c+l;var p=("000"+(Math.floor((4*Math.ceil(r/4)-r)/o)+1)).slice(-3),h=a-6*Math.floor(a/6),d=("000"+(Math.floor(h/n)+1)).slice(-3);switch(i){case"1:100万":return s;case"1:50万":case"1:25万":case"1:10万":case"1:5万":case"1:2.5万":case"1:1万":case"1:5000":break;default:throw new Error("不支持的比例尺")}return s+u+p+d}function h(){var t=s.camera.computeViewRectangle();if(2==s.scene.mode){var e=s.scene.canvas,i=new Cesium.Cartesian2(0,0),n=new Cesium.Cartesian2(e.clientWidth,e.clientHeight),o=s.scene.globe.ellipsoid,a=s.camera.pickEllipsoid(i,o),r=s.camera.pickEllipsoid(n,o);if(!a){var l=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:6356755});i.y=l.y+5,a=s.camera.pickEllipsoid(i,o)}if(!r){var c=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:-6356755});n.y=c.y-5,r=s.camera.pickEllipsoid(n,o)}var u=s.scene.globe.ellipsoid.cartesianToCartographic(a),p=s.scene.globe.ellipsoid.cartesianToCartographic(r);return t=(n.y-i.y)/(n.x-i.x)<=.49998752339363695?new Cesium.Rectangle(Cesium.Math.toRadians(-180),Cesium.Math.toRadians(-90),Cesium.Math.toRadians(180),Cesium.Math.toRadians(90)):new Cesium.Rectangle(u.longitude,p.latitude,p.longitude,u.latitude)}return t}e.postRenderEvent=function(){var i=t.viewer.camera.positionCartographic.height;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}if(i>5*o.position.alt)return c=null,void e.removeAll();var n=!1,s=h(),a=Cesium.Math.toDegrees(s.west),r=Cesium.Math.toDegrees(s.south),p=Cesium.Math.toDegrees(s.east);a>p&&(p+=360),s={minLng:a,minLat:r,maxLng:p,maxLat:Cesium.Math.toDegrees(s.north)},c?(c.minLng>s.minLng||c.minLat>s.minLat||c.maxLng<s.maxLng||c.maxLat<s.maxLat)&&Cesium.Math.toDegrees(t.viewer.camera.pitch)<0&&(n=!0):u(Mt),n?++l>=50&&(u(Mt),n=!1):l=0},o.complete=function(){s.scene.postRender.addEventListener(e.postRenderEvent)},Re(t,o,.5)}function Lt(t){for(var e,i,n=t.viewer,o=0;o<n.scene.primitives._primitives.length;o++)if("SheetIndexGridPrimitives"===n.scene.primitives._primitives[o].name){e=n.scene.primitives._primitives[o];for(var s=0;s<e._primitives.length;s++)if("SheetIndexLabelCollection"===e._primitives[s].name){i=e._primitives[s];break}break}i&&i.removeAll(),e&&e.removeAll(),e&&n.scene.postRender.removeEventListener(e.postRenderEvent)}function At(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function jt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?At(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):At(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function It(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ft(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ft(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Rt,zt,Ht,Vt,Gt,Ut,Wt,Yt={},Jt=[],qt=new Map;function Xt(){return(Xt=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:!0,Rt||(Kt(e),ve(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zt(){if(!1,zt){Qt(-1,void 0,!0);var t=zt.viewer._element.getElementsByClassName("YJ-custom-slider")[0],e=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];t&&(zt.viewer._element.removeChild(t),zt.viewer._element.removeChild(e),zt.viewer._element.removeChild(i)),zt.viewer.scene.preRender.removeEventListener(ae,Yt),zt.viewer.imageryLayers.layerAdded.removeEventListener(ee),zt.viewer.imageryLayers.layerMoved.removeEventListener(ie),zt.viewer.imageryLayers.layerRemoved.removeEventListener(ne),zt.viewer.imageryLayers.layerShownOrHidden.removeEventListener(oe);for(var n=0;n<Jt.length;n++)Jt[n].destroy();if(Rt){var o=zt.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByClassName("cesium-widget")[1];zt.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].removeChild(o),Jt=[],Rt=null,Ht=null,Yt={}}var s=zt.viewer._element.getElementsByClassName("cesium-widget")[0],a=s.getElementsByTagName("canvas")[0];s.style.width="100%",a.style.width="100%",zt=null}}function Kt(t){return $t.apply(this,arguments)}function $t(){return($t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=function(t){var i,n,o=It(qt);try{for(o.s();!(n=o.n()).done;){var s=y()(n.value,2),a=s[0],r=s[1];r?r.P&&r.D?i=0:(r.P&&(i=-1),r.D&&(i=1)):i=-1,e.entityMap.get(a)&&Qt(i,a)}}catch(t){o.e(t)}finally{o.f()}},f=function(t){if(e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0]===t.target||e.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0]===t.target||e.viewer._element.getElementsByClassName("cesium-widget")[1].getElementsByTagName("canvas")[0]===t.target){var s=t.offsetX;t.offsetX<60&&(s=60),t.target.width-t.offsetX<60&&(s=t.target.width-60),i.style.left=s/e.viewer._element.scrollWidth*100+"%",u.style.width=s/e.viewer._element.scrollWidth*100+"%",p.style.width=100/(s/e.viewer._element.scrollWidth)+"%",d.style.width=100*(1-s/e.viewer._element.scrollWidth)+"%",m.style.width=100/(1-s/e.viewer._element.scrollWidth)+"%",n.style.left="calc(".concat(s/e.viewer._element.scrollWidth*100,"% - 50px)"),o.style.right="calc(".concat(100*(1-s/e.viewer._element.scrollWidth),"% - 50px)")}},e.entityMap.forEach((function(t,e){t.type&&"TrajectoryMotion"==t.type&&t.viewFollow&&(t.viewFollow=!1)})),i=e.viewer._element.getElementsByClassName("YJ-custom-slider")[0],n=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],o=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0],i&&(e.viewer._element.removeChild(i),e.viewer._element.removeChild(n),e.viewer._element.removeChild(o)),(i=document.createElement("div")).className="YJ-custom-slider",i.style.position="absolute",i.style.left="50%",i.style.top="0px",(n=document.createElement("input")).className="YJ-custom-checkbox-left",n.type="checkbox",n.style.position="absolute",n.style.left="calc(50% - 50px)",(o=document.createElement("input")).className="YJ-custom-checkbox-right",o.type="checkbox",o.style.position="absolute",o.style.right="calc(50% - 50px)",Vt&&0!=Vt.length||(n.style.display="none",o.style.display="none"),e.viewer._element.appendChild(n),e.viewer._element.appendChild(o),s=0,r=0,Vt)for(l=0;l<Vt.length;l++)(c=qt.get(Vt[l]))&&(c.P&&s++,c.D&&r++);return zt=e,s||r||s++,n.checked=!!s,o.checked=!!r,n.addEventListener("change",(function(t){t.target.checked||o.checked||(o.checked=!0);for(var e=0;e<Vt.length;e++){var i=qt.get(Vt[e]);(i=i||{}).P=t.target.checked,i.D=o.checked,qt.set(Vt[e],i)}v()})),o.addEventListener("change",(function(t){t.target.checked||n.checked||(n.checked=!0);for(var e=0;e<Vt.length;e++){var i=qt.get(Vt[e]);(i=i||{}).P=n.checked,i.D=t.target.checked,qt.set(Vt[e],i)}v()})),i.addEventListener("mousedown",(function(){e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="e-resize",document.body.addEventListener("mousemove",f),i.addEventListener("mouseup",(function(){e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="unset",document.body.removeEventListener("mousemove",f)}))})),e.viewer._element.appendChild(i),u=e.viewer._element.getElementsByClassName("cesium-widget")[0],p=u.getElementsByTagName("canvas")[0],u.style.width="50%",u.style.left="0px",u.style.overflow="hidden",p.style.width="200%",Ht=0,h=new si,t.next=46,new YJ.YJEarth(e.div_id);case 46:if(Rt=t.sent,!vt()){t.next=50;break}return t.next=50,new Et(Rt);case 50:if(!gt()){t.next=53;break}return t.next=53,new St(Rt);case 53:if(!yt()){t.next=56;break}return t.next=56,new Dt(Rt);case 56:return it(e)&&et(Rt,!0),Rt.viewer._element.style.display="none",(d=document.createElement("div")).className="cesium-widget cesium-widget-split",d.style.width="50%",d.style.position="absolute",d.style.right="0px",d.style.overflow="hidden",(m=Rt.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByTagName("canvas")[0]).style.width="200%",m.style.position="absolute",m.style.right="0px",d.appendChild(m),e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].appendChild(d),document.getElementById(e.div_id).removeChild(Rt.viewer._element),t.next=73,se();case 73:Yt={sdks:[e,Rt],tools:h},v(),e.viewer.scene.preRender.addEventListener(ae,Yt),e.viewer.imageryLayers.layerMoved.addEventListener(ie),Xe(e)&&qe(Rt,!0),Ke(e)&&Ze(Rt,!0),Nt()&&Ot(Rt,!0);case 80:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qt(t,e){return te.apply(this,arguments)}function te(){return(te=o()(a.a.mark((function t(e,i){var n,s,r,l,c,u,p,h,d,m,f,v,g=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=function(){return(v=o()(a.a.mark((function t(i,o){var s,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P,M,O,T;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={},(c=r.get(i))||c.show){t.next=4;break}return t.abrupt("return");case 4:if(!(u=l&&l.get(i))){t.next=42;break}t.t0=e,t.next=null===t.t0||void 0===t.t0||0===t.t0||"0"===t.t0?9:1===t.t0||"1"===t.t0?21:-1===t.t0||"-1"===t.t0?32:40;break;case 9:if(s.P=!0,s.D=!0,"TrajectoryMotion"===c.type)p=function(t){if(c.options.state=t,cancelAnimationFrame(c._requestAnimationFrameEventId),c.editObj&&(c.editObj.destroy(),c.editObj=null),c.TweenAnimate)if(clearTimeout(c.TweenAnimate.timeout),t)c.lineEdit=!1,c.TweenAnimate.isPlaying()?c.TweenAnimate.timeout=setTimeout((function(){c.TweenAnimate.resume()}),c.options.delay):c.TweenAnimate.delay(c.delay).start();else{var e=jt({},c.sdk.viewer.camera._position);c._requestAnimationFrameEventId=requestAnimationFrame((function t(){c.firstPersonView&&c.sdk.viewer.camera.setView({destination:jt({},e),orientation:{heading:c.sdk.viewer.camera.heading,pitch:c.sdk.viewer.camera.pitch,roll:c.sdk.viewer.camera.roll}}),c._requestAnimationFrameEventId=requestAnimationFrame(t)})),c.TweenAnimate.pause()}else if(t){var i=c.renewLinePositions(c.options.line.positions);c.modelMove(i)}},c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((h=c.state)&&p(!1),u.setMovePositionByDistance(c.TweenAnimate._object.distance),p(h));else if("vector"===c.type){if(c.entity)if(o)for(d=0;d<c.entity.entities.values.length;d++)c.entity.entities.values[d].id===o&&(c.entity.entities.values[d].show=!1!==c.entity.entities.values[d]._customShow);else for(m=0;m<c.entity.entities.values.length;m++)c.entity.entities.values[m].show=!1!==c.entity.entities.values[m]._customShow}else c.entity&&(c.entity.show=!0);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=c.textShow),c.label&&c.labelShow&&(c.label.entity.show=!0),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(f=0;f<u.entity.entities.values.length;f++)u.entity.entities.values[f].id===o&&(u.entity.entities.values[f].show=!1!==c.entity.entities.values[f]._customShow);else for(v=0;v<u.entity.entities.values.length;v++)u.entity.entities.values[v].show=!1!==c.entity.entities.values[v]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),"Explosion"===u.type&&(u.entity.imgIndex=c.entity.imgIndex),t.abrupt("break",40);case 21:if(s.P=!1,s.D=!0,"TrajectoryMotion"===c.type)c.entity&&(c.entity.show=!1),c.line&&(c.line.show=!1),c.realTimeLine&&(c.realTimeLine.show=!1);else if("vector"===c.type){if(c.entity)if(o)for(y=0;y<c.entity.entities.values.length;y++)c.entity.entities.values[y].id===o&&(c.entity.entities.values[y].show=!1);else for(g=0;g<c.entity.entities.values.length;g++)c.entity.entities.values[g].show=!1}else c.entity&&(c.entity.show=!1);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=!1,u.textShow=c.textShow),c.label&&(c.label.entity.show=!1),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(b=0;b<u.entity.entities.values.length;b++)u.entity.entities.values[b].id===o&&(u.entity.entities.values[b].show=!1!==c.entity.entities.values[b]._customShow);else for(C=0;C<u.entity.entities.values.length;C++)u.entity.entities.values[C].show=!1!==c.entity.entities.values[C]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),t.abrupt("break",40);case 32:if(s.P=!0,s.D=!1,"TrajectoryMotion"===c.type)c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0);else if("vector"===c.type){if(c.entity)if(o)for(w=0;w<c.entity.entities.values.length;w++)c.entity.entities.values[w].id===o&&(c.entity.entities.values[w].show=!1!==c.entity.entities.values[w]._customShow);else for(k=0;k<c.entity.entities.values.length;k++)c.entity.entities.values[k].show=!1!==c.entity.entities.values[k]._customShow}else c.entity&&(c.entity.show=!0);if("GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=!1),c.label&&c.labelShow&&(c.label.entity.show=!0),u.label&&(u.label.options.ground=!1),"terrain"===c.type)u.show=!0;else if("vector"===u.type){if(u.entity)if(o)for(_=0;_<u.entity.entities.values.length;_++)u.entity.entities.values[_].id===o&&u.entity.entities.values[_].id===o&&(u.entity.entities.values[_].show=!1);else for(x=0;x<u.entity.entities.values.length;x++)u.entity.entities.values[x].show=!1}else u.show=!1;return t.abrupt("break",40);case 40:t.next=120;break;case 42:E=Yt.tools.deepCopyObj(c.options),t.t1=e,t.next=null===t.t1||void 0===t.t1||0===t.t1||"0"===t.t1?46:1===t.t1||"1"===t.t1?75:-1===t.t1||"-1"===t.t1?100:120;break;case 46:return s.P=!0,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),t.next=52,new c.constructor(Rt,E);case 52:if(S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){t.next=63;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((D=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=D),t.next=72;break;case 63:if("glb"===S.type||!S.on){t.next=67;break}return"vector"===S.type&&(S.data=c.data),t.next=67,S.on();case 67:"Explosion"===S.type&&(S.entity.imgIndex=c.entity.imgIndex),"PincerArrowObject"===S.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==S.type&&"StraightArrowObject"!==S.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"vector"===c.type&&S.load((function(){if(S.entity)if(o)for(var t=0;t<S.entity.entities.values.length;t++)S.entity.entities.values[t].id===o&&(S.entity.entities.values[t].show=!1!==c.entity.entities.values[t]._customShow);else for(var e=0;e<S.entity.entities.values.length;e++)S.entity.entities.values[e].show=!1!==c.entity.entities.values[e]._customShow})),c.entity&&(c.entity.show=!0);case 72:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S.textShow=c.textShow),c.label&&c.labelShow&&(c.label.entity.show=!0),t.abrupt("break",120);case 75:return s.P=!1,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),t.next=81,new c.constructor(Rt,E);case 81:if(S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){t.next=92;break}c.entity&&c.modelShow&&(c.entity.show=!1),c.line&&c.lineShow&&(c.line.show=!1),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!1),c.TweenAnimate&&((P=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=P),t.next=97;break;case 92:if("glb"===S.type||!S.on){t.next=96;break}if("vector"===c.type&&(S.data=c.data,c.entity))for(M=0;M<c.entity.entities.values.length;M++)c.entity.entities.values[M].show=!1;return t.next=96,S.on();case 96:if("vector"===c.type){if(S.entity)if(o)for(O=0;O<S.entity.entities.values.length;O++)S.entity.entities.values[O].id===o&&(S.entity.entities.values[O].show=!1!==c.entity.entities.values[O]._customShow);else for(T=0;T<S.entity.entities.values.length;T++)S.entity.entities.values[T].show=!1!==c.entity.entities.values[T]._customShow}else c.entity&&(c.entity.show=!1);case 97:return"GroundSvg"===c.type&&c.text&&(c.text.show=!1,S.textShow=c.textShow),c.label&&(c.label.entity.show=!1),t.abrupt("break",120);case 100:if(s.P=!0,s.D=!1,"TrajectoryMotion"!==c.type){t.next=108;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),t.next=117;break;case 108:if(c.entity&&(c.entity.show=!0),"terrain"!==c.type){t.next=117;break}return E.show=!0,t.next=113,new c.constructor(Rt,E);case 113:S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove);case 117:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S.textShow=!1),c.label&&c.labelShow&&(c.label.entity.show=!0),t.abrupt("break",120);case 120:n||qt.set(i,s);case 121:case"end":return t.stop()}}),t)})))).apply(this,arguments)},f=function(t,e){return v.apply(this,arguments)},n=g.length>2&&void 0!==g[2]&&g[2],s=g.length>3?g[3]:void 0,zt){t.next=6;break}return t.abrupt("return");case 6:if(r=zt.entityMap,l=Rt&&Rt.entityMap,!i){t.next=15;break}if((c=r.get(i))&&c.show){t.next=12;break}return t.abrupt("return");case 12:f(i,s),t.next=35;break;case 15:u=It(zt.entityMap),t.prev=16,u.s();case 18:if((p=u.n()).done){t.next=27;break}if(h=y()(p.value,2),d=h[0],(m=h[1])&&m.show){t.next=24;break}return t.abrupt("continue",25);case 24:f(d,s);case 25:t.next=18;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t.catch(16),u.e(t.t0);case 32:return t.prev=32,u.f(),t.finish(32);case 35:if(!n){t.next=37;break}return t.abrupt("return");case 37:case"end":return t.stop()}}),t,null,[[16,29,32,35]])})))).apply(this,arguments)}function ee(t,e){Rt.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function ie(t,e,i){for(var n,o=0;o<Rt.viewer.imageryLayers._layers.length;o++)if(Rt.viewer.imageryLayers._layers[o]._id===t._id){n=Rt.viewer.imageryLayers._layers[o];break}n&&(0===e?Rt.viewer.imageryLayers.lowerToBottom(n):e===Rt.viewer.imageryLayers._layers.length-1?Rt.viewer.imageryLayers.raiseToTop(n):e<i?e<Rt.viewer.imageryLayers._layers.length-1&&Rt.viewer.imageryLayers.lower(n):Rt.viewer.imageryLayers.raise(n))}function ne(t,e){var i=Rt.viewer.imageryLayers._layers[e];i&&Rt.viewer.imageryLayers.remove(i)}function oe(t,e,i){var n=Rt.viewer.imageryLayers._layers[e];n&&(n.show=i)}function se(){var t=new Cesium.ScreenSpaceEventHandler(zt.viewer._element.getElementsByClassName("cesium-widget")[0]);t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.WHEEL),Jt.push(t);var e=document.getElementById("distanceLegendDiv");function i(t){Ht=0}e.addEventListener("mousemove",i),Jt.push({destroy:function(){e.removeEventListener("mousemove",i)}});var n=new Cesium.ScreenSpaceEventHandler(zt.viewer._element.getElementsByClassName("cesium-widget")[1]);n.setInputAction((function(){Ht=1,Ye(zt)}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){Ht=1,Ye(zt)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){Ht=1,Ye(zt)}),Cesium.ScreenSpaceEventType.WHEEL),Jt.push(n)}function ae(){var t,e=this.sdks[Ht];0===Ht?t=this.sdks[1]:1===Ht&&(t=this.sdks[0]);var i=e.viewer.camera.position;t.viewer.camera.setView({destination:i,orientation:{heading:e.viewer.camera.heading,pitch:e.viewer.camera.pitch,roll:e.viewer.camera.roll}})}function re(t,e,i){if(zt&&Rt&&t===zt&&e){var n=qt.get(e),o=zt.entityMap.get(e),s=Rt.entityMap.get(e);if(o){var a;if(n)n.P&&n.D?a=0:(n.P&&(a=-1),n.D&&(a=1));else{var r=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],l=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];"none"===r.style.display||"none"===l.style.display?a=-1:r.checked&&l.checked?a=0:(r.checked&&(a=-1),l.checked&&(a=1))}if(s)s.options=JSON.parse(JSON.stringify(o.options)),s.originalOptions=JSON.parse(JSON.stringify(o.options)),o.oldData&&(s.oldData=JSON.parse(JSON.stringify(o.oldData))),"TrajectoryMotion"===s.type&&(s.height=s.options.height),s.reset&&s.reset(),o.show?Qt(a,e,!1,i):s.show=!1;else{Qt(-1,e,!1,i)}}else s&&s.remove()}}function le(){return{sdkP:zt,sdkD:Rt}}function ce(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ue(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ue(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var pe={},he=[];function de(t){return me.apply(this,arguments)}function me(){return(me=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ut=e,Wt=0,i=new si,t.next=5,new YJ.YJEarth(e.div_id);case 5:return(n=t.sent).viewer._element.className="cesium-viewer 2d",Ot(n,Nt()),Ve(n,{compass:!1,info:!1,frame:!1}),n.viewer.scene.mode=Cesium.SceneMode.SCENE2D,t.next=12,n;case 12:return Gt=t.sent,Oe(),pe={sdks:[e,n],tools:i},t.next=17,Se(e,0,pe);case 17:return t.next=19,Se(n,1,pe);case 19:return t.next=21,be(e);case 21:for(e.viewer.scene.preRender.addEventListener(De,pe),e.viewer.imageryLayers.layerAdded.addEventListener(we),e.viewer.imageryLayers.layerMoved.addEventListener(ke),e.viewer.imageryLayers.layerRemoved.addEventListener(_e),e.viewer.imageryLayers.layerShownOrHidden.addEventListener(xe),(o=L()(e.viewer.imageryLayers._layers)).sort((function(t,e){return t._layerIndex-e._layerIndex})),Gt.viewer.imageryLayers.removeAll(),s=0;s<o.length;s++)Gt.viewer.imageryLayers.addImageryProvider(o[s].imageryProvider,o[s]._layerIndex).show=o[s].show;Xe(e)&&qe(n,!0),Ke(e)&&Ze(n,!0);case 32:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function fe(){return(fe=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Gt||(de(e),Zt());case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ve(t){t.viewer.scene.preRender.removeEventListener(De,pe),t.viewer.imageryLayers.layerAdded.removeEventListener(we),t.viewer.imageryLayers.layerMoved.removeEventListener(ke),t.viewer.imageryLayers.layerRemoved.removeEventListener(_e),t.viewer.imageryLayers.layerShownOrHidden.removeEventListener(xe);for(var e=0;e<he.length;e++)he[e].destroy();Gt&&(Gt.destroy(),he=[],Gt=null,Ut=null,Wt=null,pe={})}function ge(t,e,i){return ye.apply(this,arguments)}function ye(){return(ye=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u,p,h,d,m,f,v,g,b,C;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e&&e.viewer&&e.viewer._element&&"cesium-viewer 2d"===e.viewer._element.className)){t.next=2;break}return t.abrupt("return");case 2:if(Ut&&Gt){t.next=4;break}return t.abrupt("return");case 4:if(o=Ut.entityMap,!i){t.next=37;break}if(!(s=o.get(i))){t.next=31;break}if(!(r=Gt.entityMap.get(i))){t.next=12;break}return t.next=12,r.remove();case 12:if(l=pe.tools.deepCopyObj(s.options),"BillboardObject"===s.type&&(l.heightReference=1),"PolygonObject"===s.type&&(l.heightMode=0,l.height=0),s.type&&("tileset"===s.type||"bim"===s.type||"glb"===s.type||"layer"===s.type)){t.next=29;break}return t.next=18,new s.constructor(Gt,l);case 18:if((c=t.sent).onClick=s.onClick,c.onRightClick=s.onRightClick,c.onMouseMove=s.onMouseMove,"TrajectoryMotion"===s.type&&(s.firstPersonView=!1,s.TweenAnimate?((u=s.state)&&(s.state=!1),c.state?c.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){c.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+1e-8),setTimeout((function(){c.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+2e-8)}),500)}),500),s.state=u):setTimeout((function(){c.setMovePositionByDistance(1e-8),setTimeout((function(){c.setMovePositionByDistance(2e-8)}),500)}),500),s.viewFollow&&(c.viewFollow=!0)),"AttackArrowObject"!==s.type&&"StraightArrowObject"!==s.type||s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&c.setSpreadProgressByTime(s.TweenAnimate._object.distance/s.TweenAnimate._valuesEnd.distance*s.spreadTime),"PincerArrowObject"===s.type&&s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&c.setSpreadProgressByTime(s.TweenAnimate._object.distance1/s.TweenAnimate._valuesEnd.distance1*s.spreadTime),!c.on||"glb"===c.type){t.next=29;break}return"vector"===c.type&&(c.data=s.data,c.load((function(){if(c.entity)for(var t=0;t<c.entity.entities.values.length;t++)c.entity.entities.values[t].show=!1!==s.entity.entities.values[t]._customShow}))),t.next=29,c.on();case 29:t.next=35;break;case 31:if(!(p=Gt.entityMap.get(i))){t.next=35;break}return t.next=35,p.remove();case 35:t.next=72;break;case 37:h=ce(Gt.entityMap),t.prev=38,h.s();case 40:if((d=h.n()).done){t.next=48;break}if(m=y()(d.value,2),f=m[0],m[1],!(v=Gt.entityMap.get(f))){t.next=46;break}return t.next=46,v.remove();case 46:t.next=40;break;case 48:t.next=53;break;case 50:t.prev=50,t.t0=t.catch(38),h.e(t.t0);case 53:return t.prev=53,h.f(),t.finish(53);case 56:g=ce(o),t.prev=57,C=a.a.mark((function t(){var e,i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y()(b.value,2),e[0],"BillboardObject"===(i=e[1]).type&&(i.options.heightReference=1),n=pe.tools.deepCopyObj(i.options),i.type&&("tileset"===i.type||"bim"===i.type||"glb"===i.type||"layer"===i.type)){t.next=17;break}return t.next=6,new i.constructor(Gt,n);case 6:if((o=t.sent).onClick=i.onClick,o.onRightClick=i.onRightClick,o.onMouseMove=i.onMouseMove,"TrajectoryMotion"===i.type&&(i.firstPersonView=!1,i.TweenAnimate?((s=i.state)&&(i.state=!1),o.state?o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+1e-9),setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+2e-9)}),1500)}),1500),i.state=s):setTimeout((function(){o.setMovePositionByDistance(1e-9),setTimeout((function(){o.setMovePositionByDistance(2e-9)}),1500)}),1500),i.viewFollow&&(o.viewFollow=!0)),"AttackArrowObject"!==i.type&&"StraightArrowObject"!==i.type||i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance/i.TweenAnimate._valuesEnd.distance*i.spreadTime),"PincerArrowObject"===i.type&&i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance1/i.TweenAnimate._valuesEnd.distance1*i.spreadTime),!o.on||"glb"===i.type){t.next=17;break}return"vector"===o.type&&(o.data=i.data,o.load((function(){if(o.entity)for(var t=0;t<o.entity.entities.values.length;t++)o.entity.entities.values[t].show=!1!==i.entity.entities.values[t]._customShow}))),t.next=17,o.on();case 17:case"end":return t.stop()}}),t)})),g.s();case 60:if((b=g.n()).done){t.next=64;break}return t.delegateYield(C(),"t1",62);case 62:t.next=60;break;case 64:t.next=69;break;case 66:t.prev=66,t.t2=t.catch(57),g.e(t.t2);case 69:return t.prev=69,g.f(),t.finish(69);case 72:case"end":return t.stop()}}),t,null,[[38,50,53,56],[57,66,69,72]])})))).apply(this,arguments)}function be(t,e,i){return Ce.apply(this,arguments)}function Ce(){return(Ce=o()(a.a.mark((function t(e,i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ge(e,i,n);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function we(t,e){Gt.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function ke(t,e,i){var n=Gt.viewer.imageryLayers._layers[i];n&&(0===e?Gt.viewer.imageryLayers.lowerToBottom(n):e===Ut.viewer.imageryLayers._layers.length-1?Gt.viewer.imageryLayers.raiseToTop(n):e<i?Gt.viewer.imageryLayers.lower(n):Gt.viewer.imageryLayers.raise(n))}function _e(t,e){var i=Gt.viewer.imageryLayers._layers[e];i&&Gt.viewer.imageryLayers.remove(i)}function xe(t,e,i){var n=Gt.viewer.imageryLayers._layers[e];n&&(n.show=i)}function Ee(){return(Ee=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Ut){t.next=2;break}return t.abrupt("return");case 2:if(Gt){for(i=Gt.viewer.scene.primitives._primitives,n=Ut.viewer.scene.primitives._primitives,o=i.length-1;o>=1;o--){for(s=!1,r=n.length-1;r>=1;r--)n[r].id&&i[r].id&&n[r].id===i[o].id&&(s=!0);s||Gt.viewer.scene.primitives.remove(i[o])}for(l=n.length-1;l>=1;l--){for(c=!1,u=i.length-1;u>=1;u--)n[l].id&&i[l].id&&n[l].id===i[u].id&&(c=!0,i[u].show=n[l].show,i[u].startColor=n[l].startColor,i[u].endColor=n[l].endColor,i[u].minimumSpeed=n[l].minimumSpeed,i[u].maximumSpeed=n[l].maximumSpeed,i[u].minimumParticleLife=n[l].minimumParticleLife,i[u].maximumParticleLife=n[l].maximumParticleLife,i[u].startScale=n[l].startScale,i[u].endScale=n[l].endScale,i[u].emissionRate=n[l].emissionRate,i[u].particleSize=n[l].particleSize,i[u].modelMatrix=n[l].modelMatrix);c||Gt.viewer.scene.primitives.add(n[l])}}case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Se(t,e,i){var n=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas);n.setInputAction((function(){Wt=e}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){Wt=e}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){Wt=e}),Cesium.ScreenSpaceEventType.WHEEL),he.push(n)}function De(){var t,e=this.sdks[Wt];if(0===Wt?t=this.sdks[1]:1===Wt&&(t=this.sdks[0]),2===e.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=e.viewer.camera.positionCartographic.height;t.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,0),new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),i))}else{this.sdks[1].viewer.trackedEntity&&(this.sdks[1].viewer.entities.remove(this.sdks[1].viewer.trackedEntity),this.sdks[1].viewer.trackedEntity=null);var n=this.tools.cartesian3Towgs84(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,e.viewer.camera.positionCartographic.height),e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=e.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(e.viewer.camera.positionWC,e.viewer).alt,a=this.tools.cartesian3Towgs84(o,e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Pe(){return Gt}function Me(){return Ut}function Oe(){Gt&&Gt.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function Te(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ne(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ne(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Be,Le="EPSG:4326",Ae=!1,je={},Ie={},Fe={};function Re(t,e){return ze.apply(this,arguments)}function ze(){return(ze=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:3,o=new si(e),r=i.orientation,!i.position){t.next=13;break}if(0===i.position.alt||i.position.alt){t.next=8;break}return t.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=t.sent;case 8:l=0,r||(l=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+l),t.next=15;break;case 13:c=o.cal_envelope(i.positions),s=new Cesium.Rectangle(Cesium.Math.toRadians(c[3][0]),Cesium.Math.toRadians(c[3][1]),Cesium.Math.toRadians(c[1][0]),Cesium.Math.toRadians(c[1][1]));case 15:Ye(e),e.viewer.camera.flyTo({destination:s,duration:n,orientation:r,complete:i.complete});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function He(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&t.viewer){var i=t.viewer;i.scene.screenSpaceCameraController.enableRotate=e,i.scene.screenSpaceCameraController.enableTranslate=e,i.scene.screenSpaceCameraController.enableZoom=e,i.scene.screenSpaceCameraController.enableTilt=e,i.scene.screenSpaceCameraController.enableLook=e}}function Ve(t,e){if(t&&t.viewer){Ie[t.viewer._element.className]||(Ie[t.viewer._element.className]={}),Ie[t.viewer._element.className].event&&Ie[t.viewer._element.className].event.destroy();var i=new si(t),n=t.viewer._element,s=t.proj,r=function(){switch(l){case"compass":var r=n.getElementsByClassName("compass")[0],c=n.getElementsByClassName("navigation-controls")[0];e[l]?(r&&(r.style.display="block"),c&&(c.style.display="flex")):(r&&(r.style.display="none"),c&&(c.style.display="none"));break;case"legend":var u=n.getElementsByClassName("distance-legend")[0];e[l]?u&&(u.parentNode.style.display="block"):u&&(u.parentNode.style.display="none");break;case"info":var p=n.getElementsByClassName("cesium-info")[0];if(e[l]){var h=function(){var e=o()(a.a.mark((function e(){var n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Be){e.next=2;break}return e.abrupt("return");case 2:n=i.cartesian3Towgs84(Be,t.viewer),"EPSG:4326"===Le?p.innerHTML="\n <span>经度:</span><span>".concat(Number(n.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(n.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(n.alt.toFixed(2)),"米</span>\n "):(o=s.convert([{x:n.lng,y:n.lat,z:n.alt}],"EPSG:4326",Le),p.innerHTML="\n <span>x:</span><span>".concat(Number(o.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(o.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(o.points[0].z.toFixed(6)),"</span>\n "));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();p?(h(),p.style.display="block"):((p=document.createElement("div")).className="cesium-info",p.style.position="absolute",p.style.bottom="32px",p.style.right="240px",p.style["font-size"]="14px",p.style["background-color"]="rgba(47,53,60,.8)",p.style.color="#fff",p.style.padding="4px 10px",p.style["border-radius"]="18px",p.innerHTML="EPSG:4326"===Le?"\n <span>经度:</span><span>-</span>\n <span>纬度:</span><span>-</span>\n <span>海拔高度:</span><span>-</span>\n ":"\n <span>x:</span><span>-</span>\n <span>y:</span><span>-</span>\n <span>z:</span><span>-</span>\n ",t.viewer._element.appendChild(p));var d=new X(t);Ie[t.viewer._element.className].event=d;d.mouse_move((function(t,e){Be=e,h()}))}else p&&(p.style.display="none");break;case"frame":e[l]?(t.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var e=t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=e.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];i&&e.appendChild(i)}),50)):t.viewer.scene.debugShowFramesPerSecond=!1}};for(var l in e)r()}}function Ge(t,e){e=e?"billboard_default_url_"+e:"billboard_default_url";var i=h();t.startsWith("http")||(t.includes(":")||i&&(t=new URL(t,i).href));localStorage.setItem(e,t)}function Ue(t){return t=t?"billboard_default_url_"+t:"billboard_default_url",localStorage.getItem(t)}function We(){return Ae}function Ye(t){t&&t.viewer&&Fe[t.viewer._element.className]&&(Fe[t.viewer._element.className].animate&&TWEEN.remove(Fe[t.viewer._element.className].animate),Fe[t.viewer._element.className].event&&Fe[t.viewer._element.className].event.destroy(),He(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function Je(t){if(t&&t.entityMap){var e,i=Te(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(t){i.e(t)}finally{i.f()}}}function qe(t,e){if(t){var i,n=le().sdkD;n&&t!==n&&qe(n,e);for(var o=0;o<t.viewer.imageryLayers._layers.length;o++)if(t.viewer.imageryLayers._layers[o]._imageryProvider&&t.viewer.imageryLayers._layers[o]._imageryProvider._type&&"flw"===t.viewer.imageryLayers._layers[o]._imageryProvider._type){i=t.viewer.imageryLayers._layers[o];break}i&&t.viewer.imageryLayers.remove(i),e&&t.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderFlw({tileWidth:128,tileHeight:128}))}}function Xe(t){for(var e=!1,i=0;i<t.viewer.imageryLayers._layers.length;i++)if(t.viewer.imageryLayers._layers[i]._imageryProvider&&t.viewer.imageryLayers._layers[i]._imageryProvider._type&&"flw"===t.viewer.imageryLayers._layers[i]._imageryProvider._type){e=!0;break}return e}function Ze(t,e){if(t){var i,n=le().sdkD;n&&t!==n&&Ze(n,e);for(var o=0;o<t.viewer.imageryLayers._layers.length;o++)if(t.viewer.imageryLayers._layers[o]._imageryProvider&&t.viewer.imageryLayers._layers[o]._imageryProvider._type&&"jww"===t.viewer.imageryLayers._layers[o]._imageryProvider._type){i=t.viewer.imageryLayers._layers[o];break}i&&t.viewer.imageryLayers.remove(i),e&&t.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderJww)}}function Ke(t){for(var e=!1,i=0;i<t.viewer.imageryLayers._layers.length;i++)if(t.viewer.imageryLayers._layers[i]._imageryProvider&&t.viewer.imageryLayers._layers[i]._imageryProvider._type&&"jww"===t.viewer.imageryLayers._layers[i]._imageryProvider._type){e=!0;break}return e}function $e(){return Le}function Qe(){var t=localStorage.getItem("ManageIndexexDBState");return"false"!==t&&Boolean(t)}function ti(t){"boolean"==typeof t?(Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetManageIndexexDBState(t),localStorage.setItem("ManageIndexexDBState",t)):console.error("参数必须为boolean")}function ei(t){!function(t){Wt=t}(t),function(t){Ht=t}(t)}function ii(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ni(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ni(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function oi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var si=function(){return x()((function t(e,i){k()(this,t),this.sdk=e,this.sdk&&(this.name_map=this.sdk.proj.name_map,this.epsg_map=this.sdk.proj.epsg_map,this.convert=this.sdk.proj.convert,this.getAllProjection=this.sdk.proj.getAllProjection,this.projectionIsExists=this.sdk.proj.projectionIsExists,this.degreesToDMS=this.sdk.proj.degreesToDMS,this.dmsToDecimal=this.sdk.proj.dmsToDecimal),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?oi(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):oi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},i)}),[{key:"POST",get:function(){return"POST"}},{key:"GET",get:function(){return"GET"}},{key:"degreesToRadians",value:function(t){return turf.degreesToRadians(Number(t))}},{key:"radiansToDegrees",value:function(t){return turf.radiansToDegrees(Number(t))}},{key:"randomString",value:function(t){return Cesium.createGuid()}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}},{key:"cartesian3Towgs84",value:function(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}},{key:"computeDistance",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P,M,O=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=O.length>0&&void 0!==O[0]?O[0]:[],i=O.length>1&&void 0!==O[1]?O[1]:2,n=O.length>2&&void 0!==O[2]?O[2]:"空间长度",!(e.length<2)){t.next=7;break}return t.abrupt("return",0);case 7:o=0,t.t0=n,t.next="空间长度"===t.t0?11:"投影长度"===t.t0?13:"地表长度"===t.t0?15:48;break;case 11:for(s=0;s<e.length-1;s++)r=Cesium.Cartesian3.fromDegrees(e[s].lng,e[s].lat,e[s].alt),l=Cesium.Cartesian3.fromDegrees(e[s+1].lng,e[s+1].lat,e[s+1].alt),c=Cesium.Cartesian3.distance(r,l),o+=c;return t.abrupt("break",49);case 13:for(u=0;u<e.length-1;u++)p=Cesium.Cartesian3.fromDegrees(e[u].lng,e[u].lat,0),h=Cesium.Cartesian3.fromDegrees(e[u+1].lng,e[u+1].lat,0),d=Cesium.Cartesian3.distance(p,h),o+=d;return t.abrupt("break",49);case 15:f=[],e.forEach((function(t){f.push([t.lng,t.lat,t.alt])})),v=turf.lineString(f),g=1e3*turf.length(v),m=g>20?g/20:g,y=this.chunkLine(e,m),b=[],y.forEach((function(t,e){0===e?b=L()(t.geometry.coordinates):b.push(t.geometry.coordinates[1])})),C=[],w=ii(b),t.prev=25,w.s();case 27:if((k=w.n()).done){t.next=37;break}return _=k.value,x=b.indexOf(_),t.next=32,this.sampleHeight({lng:_[0],lat:_[1],alt:0},x);case 32:(E=t.sent).position.alt=E.position.alt<0?0:E.position.alt,C.push(E);case 35:t.next=27;break;case 37:t.next=42;break;case 39:t.prev=39,t.t1=t.catch(25),w.e(t.t1);case 42:return t.prev=42,w.f(),t.finish(42);case 45:for(C.length,S=0;S<C.length-1;S++)D=Cesium.Cartesian3.fromDegrees(C[S].position.lng,C[S].position.lat,0),P=Cesium.Cartesian3.fromDegrees(C[S+1].position.lng,C[S+1].position.lat,0),M=Cesium.Cartesian3.distance(D,P),o+=M;return t.abrupt("break",49);case 48:return t.abrupt("break",49);case 49:return t.abrupt("return",o.toFixed(i));case 50:case"end":return t.stop()}}),t,this,[[25,39,42,45]])}))),function(){return i.apply(this,arguments)})},{key:"computeDistance2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.length<2)return 0;var n=0;if(i){var o=[];t.forEach((function(t){o.push([t.lng,t.lat,t.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a<t.length-1;a++){var r=Cesium.Cartesian3.fromDegrees(t[a].lng,t[a].lat,t[a].alt),l=Cesium.Cartesian3.fromDegrees(t[a+1].lng,t[a+1].lat,t[a+1].alt),c=Cesium.Cartesian3.distance(r,l);n+=c}return n.toFixed(e)}},{key:"sampleHeight",value:(e=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,i){return e.apply(this,arguments)})},{key:"computeArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(t.length<3)return 0;var i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.tesselate(n);return Number(turf.area(o).toFixed(e))}},{key:"computeSignedArea",value:function(t,e){for(var i=[],n=[],o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat),n.push([e[o].lng,e[o].lat]);var s,a=turf.lineString(n),r=turf.bbox(a),l=Cesium.Math.toRadians(r[2]-r[0]),c=Cesium.Math.toRadians(r[3]-r[1]);s=l>c?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),p=new Cesium.PolygonGeometry.createGeometry(u);if(!p||!p.attributes||!p.attributes.position)return 0;var h=p.indices,d=p.attributes.position.values;function m(e,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return t.scene.clampToHeight(n)||n}for(var f=0,v=0;v<h.length;v+=3){var g=m(0,h[v]),y=m(0,h[v+1]),b=m(0,h[v+2]),C=Cesium.Cartesian3.subtract(g,y,new Cesium.Cartesian3),w=Cesium.Cartesian3.subtract(b,y,new Cesium.Cartesian3),k=Cesium.Cartesian3.cross(C,w,C);f+=.5*Cesium.Cartesian3.magnitude(k)}return Number(f.toFixed(2))}},{key:"createCircle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(e)<=0&&(e=.01);var n=[Number(t.lng),Number(t.lat)],o=turf.circle(n,e/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(t){s=s.concat(t)})),s}},{key:"createEllipse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0,height:0};e.granularity||(e.granularity=.1),e.height||(e.height=0),e.semiMinorAxis||(e.semiMinorAxis=1e-5),e.semiMajorAxis||(e.semiMajorAxis=1e-5);var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(t.lng),Number(t.lat)),semiMajorAxis:Number(e.semiMajorAxis),semiMinorAxis:Number(e.semiMinorAxis),height:Number(e.height),granularity:Cesium.Math.toRadians(e.granularity),rotation:Cesium.Math.toRadians(e.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i);if(!n||!n.attributes||!n.attributes.position)return[];for(var o=n.attributes.position.values,s=[],a=0;a<o.length;a+=3){var r=new Cesium.Cartesian3(o[a],o[a+1],o[a+2]);s.push(r)}return s}},{key:"rhumbBearing",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]);return turf.rhumbBearing(i,n)}},{key:"computeCenter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t,0)}},{key:"computePincerArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t)}},{key:"computeArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t.length<3)return[];for(var i,n=[],o=0;o<t.length;o++)n.push([t[o].lng,t[o].lat]);i=e?xp.algorithm.doubleArrow(n):xp.algorithm.tailedAttackArrow(n);var s=JSON.stringify(i.polygonalPoint).indexOf("null"),a=[];return-1===s&&(a=i.polygonalPoint),a}},{key:"computeAssemble",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];t.length;var i=new Array;if(t.forEach((function(t){i.push([t.lng,t.lat])})),2===i.length){var n=P.PlotUtils.mid(i[0],i[1]),o=P.PlotUtils.distance(i[0],n)/.9,s=P.PlotUtils.getThirdPoint(i[0],n,P.Constants.HALF_PI,o,!0);i=[i[0],s,i[1]]}var a=P.PlotUtils.mid(i[0],i[2]);i.push(a,i[0],i[1]);for(var r=[],l=void 0,c=void 0,u=void 0,p=[],h=0;h<i.length-2;h++){l=i[h],c=i[h+1],u=i[h+2];var d=P.PlotUtils.getBisectorNormals(.4,l,c,u);r=r.concat(d)}var m=r.length;r=[r[m-1]].concat(r.slice(0,m-1));for(var f=0;f<i.length-2;f++){l=i[f],c=i[f+1],p=p.concat(L()(l));for(var v=0;v<=P.Constants.FITTING_COUNT;v++){var g=P.PlotUtils.getCubicValue(v/P.Constants.FITTING_COUNT,l,r[2*f],r[2*f+1],c);p=p.concat(L()(g))}p=p.concat(L()(c))}return e?p:Cesium.Cartesian3.fromDegreesArray(p)}},{key:"computeStraightArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];var i=[t[0].lng,t[0].lat],n=[t[1].lng,t[1].lat];if(t[0].lng===t[1].lng&&t[0].lat===t[1].lat){if(e)return[t[0],t[0],t[0]];var o=Cesium.Cartesian3.fromDegrees(t[0].lng,t[0].lat);return[o,o,o]}for(var s,a=[],r=0;r<t.length;r++)a.push([t[r].lng,t[r].lat]);if(s=xp.algorithm.fineArrow(i,n),e){for(var l=[],c=0;c<s.length;c++){var u=this.cartesian3Towgs84(s[c],this.sdk.viewer);l.push(u.lng,u.lat)}return l}return s}},{key:"getMaterial",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="",s={7:10,8:3,9:4,10:4,11:4,12:2};switch(i&&(s[e+""]?i.polyline.width=i.polyline.oriWidth+s[e+""]:i.polyline.width=i.polyline.oriWidth),Number(e)){case 1:o=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(t),dashLength:10});break;case 2:o=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(t)});break;case 3:o=new Cesium.PolylineFlowMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 4:o=new Cesium.PolylineFlowMultMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 5:case 6:var a=this;o=new Cesium.FlowDashedLineFlowMaterialProperty({color:t,uType:5==e?0:1,speed:n.rotate?n.speed:0-n.speed,space:n.space,scale:new Cesium.CallbackProperty((function(){var t=i.polyline.positions.getValue();if(!Cesium.defined(t))return 1;for(var e=0,n=0;n<t.length-1;++n)e+=Cesium.Cartesian3.distance(t[n],t[n+1]);var o=new Cesium.Cartesian2(0,a.sdk.viewer.canvas.clientHeight),s=new Cesium.Cartesian2(a.sdk.viewer.canvas.clientWidth/2,a.sdk.viewer.canvas.clientHeight),r=a.sdk.viewer.scene.pickPosition(o),l=a.sdk.viewer.scene.pickPosition(s);return 2*Cesium.Cartesian3.distance(r,l)/e}))});break;case 7:case 8:case 9:case 10:case 11:case 12:var r={color:t,image:this.getSourceRootPath()+"/img/arrow/".concat(e-6,".png"),space:n.space,speed:n.speed};r.speed=n.rotate?r.speed:0-r.speed,this.getFlowTexture(this,r,i);break;default:o=Cesium.Color.fromCssColorString(t)}return o}},{key:"getFlowTexture",value:function(t,e,i){var n=document.createElement("canvas"),o=n.getContext("2d"),s=new Image;s.src=e.image,s.onload=function(){e.space=Math.max(.1,e.space),e.speed>0||0==e.speed?(n.width=s.width*(e.space+1),n.height=s.height,o.drawImage(s,s.width*(e.space/2),0)):(o.clearRect(0,0,n.width,n.height),n.width=s.width*(e.space+1),n.height=s.height,o.save(),o.translate(n.width/2,n.height/2),o.rotate(Math.PI),o.translate(-n.width/2,-n.height/2),o.drawImage(s,s.width*(e.space/2),0),o.restore());var a=0,r=0;i.polyline.material=new Cesium.LineTextureMaterialProperty({color:e.color,image:n,speed:e.speed,repeat:new Cesium.CallbackProperty((function(){var o=i.polyline.positions.getValue(t.sdk.viewer.clock.currentTime);if(!Cesium.defined(o))return new Cesium.Cartesian2(1,1);for(var s=0,l=0;l<o.length-1;++l)s+=Cesium.Cartesian3.distance(o[l],o[l+1]);var c,u=s/i.polyline.width.getValue(),p=t.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),d=t.sdk.viewer.canvas.clientWidth,m=t.sdk.viewer.canvas.clientHeight,f=t.sdk.viewer.scene.camera.getPixelSize(h,d,m);if(f>700){var v=(u*=f/p/(e.space*(n.width/n.height*5)+1))/i.polyline.oriRepeat;i.polyline.oriSpeed=v,i.polyline.oriRepeatX=u,a=v,r=u,c=new Cesium.Cartesian2(u,v||1)}else c=new Cesium.Cartesian2(r||i.polyline.oriRepeatX,a||i.polyline.oriSpeed);return c}))});var l=t.getSceenLine(i,e,n);l&&(i.polyline.oriRepeat=l)}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.scene.pickPosition(n),a=this.sdk.viewer.scene.pickPosition(o),r=Cesium.Cartesian3.distance(s,a)/t.polyline.width.getValue(),l=this.sdk.viewer.camera.positionCartographic.height,c=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),u=this.sdk.viewer.canvas.clientWidth,p=this.sdk.viewer.canvas.clientHeight,h=this.sdk.viewer.scene.camera.getPixelSize(c,u,p);return h>700?r*=h/l/(e.space*(i.width/i.height*5)+1):r=void 0,r}},{key:"create_arrow1_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=150,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35,y:e.height-20},{x:e.width/2,y:e.height-20},{x:e.width/2,y:20},{x:e.width-35,y:20},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"create_arrow2_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=75,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35-40,y:e.height},{x:e.width-40,y:e.height/2},{x:e.width-35-40,y:0},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(t){var e=[];return t.forEach((function(t){e.push(new Cesium.Cartographic.fromDegrees(t.lng,t.lat))})),this.sdk.viewer.scene.sampleHeightMostDetailed(e)}},{key:"flyHome",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(ei(0),Ye(this.sdk),Je(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var e=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.destination,i=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.orientation;this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:t})}else this.sdk.viewer.camera.flyHome(t)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:10},n=turf.point([Number(t.lng),Number(t.lat)]),o=turf.buffer(n,Number(e)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;if(2===t.length)return this.create_line_buffer(t,e);var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(t.length<2)){var e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(t.length<2)return[];var i=[];t.forEach((function(t){i.push([t.lng,t.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,e/1e3),s=new Map;return o.features.forEach((function(t){t.geometry.coordinates.forEach((function(t){var e=t.join(","),i={lng:t[0],lat:t[1]};s.set(e,i)}))})),o.features}},{key:"billboardAnimation",value:function(t,e){var i=e.id,n=e.offset,o=void 0===n?10:n,s=(e.times,t.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),t),u=setInterval((function(){l+=r;var t=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:45,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=turf.point([t.lng,t.lat]),r=turf.sector(a,e/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(t){t.forEach((function(t){var e;e=s?{lng:t[0],lat:t[1]}:Cesium.Cartesian3.fromDegrees(t[0],t[1]),l.push(e)}))})),l}},{key:"getClampToHeight",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){t.next=3;break}return t.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat),t.prev=4,t.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=n;case 10:o=t.t0,t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),o=n;case 16:return t.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=t.sent,r=0,t.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){t.next=26;break}return t.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(e.lng,e.lat)]);case 24:(l=t.sent)[0].height&&(r=l[0].height);case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(20),r=0;case 31:if(!(s>r)){t.next=35;break}return t.abrupt("return",Number(s.toFixed(2)));case 35:return t.abrupt("return",Number(r.toFixed(2)));case 36:case"end":return t.stop()}}),t,this,[[4,13],[20,28]])}))),function(e){return t.apply(this,arguments)})},{key:"deepCopyObj",value:function(t){var e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)"earth"!=i&&"Dialog"!=i&&(e[i]=this.deepCopyObj(t[i]));else e=t;return e}},{key:"projConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?J(this.sdk,e):q()}},{key:"projectionConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?K(this.sdk,e):$()}},{key:"exportExcel",value:function(t){var e="<Row>";for(var i in t[0])e+='<Cell><Data ss:Type="String">'.concat(i,"</Data></Cell>");e+="</Row>";for(var n,o='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',s=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},a="",r="",l=0;l<t.length;l++){for(var c in 0==l&&(r+=e),r+="<Row>",t[l])r+=s('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',{nameType:"String",data:t[l][c]});r+="</Row>",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=e)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',{created:(new Date).getTime(),worksheets:a});var u,p=document.createElement("A");p.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),p.download="矢量数据导出.xls",p.target="_blank",document.body.appendChild(p),p.click(),document.body.removeChild(p)}},{key:"decompressGzip",value:function(t){var e=pako.inflate(t);return(new TextDecoder).decode(e)}},{key:"cmykToRgb",value:function(t){var e=t.c,i=t.m,n=t.y,o=t.k,s={r:0,g:0,b:0};return s.c=e/100,s.m=i/100,s.y=n/100,s.k=o/100,s.r=1-Math.min(1,s.c*(1-s.k)+s.k),s.g=1-Math.min(1,s.m*(1-s.k)+s.k),s.b=1-Math.min(1,s.y*(1-s.k)+s.k),s.r=Math.round(255*s.r),s.g=Math.round(255*s.g),s.b=Math.round(255*s.b),"rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")")}},{key:"convertPxToRem",value:function(t,e){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(e){n=document.getElementById(t.div_id).querySelectorAll(e);for(var s=0;s<n.length;s++){var a;(a=o).push.apply(a,[n[s]].concat(L()(n[s].querySelectorAll("*"))))}}else o=document.getElementById(t.div_id).querySelectorAll("*");o.forEach((function(t){var e=t.style;Array.from(e).filter((function(t){return"string"==typeof t&&t.endsWith("px")})).forEach((function(n){var o=parseFloat(e[n])/i;t.style[n]="".concat(o,"rem")}))}))}},{key:"isConvex",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.length,i=0,n=0,o=0;o<e;++o){var s=t[(o+1)%e].lng-t[o].lng,a=t[(o+2)%e].lng-t[(o+1)%e].lng,r=t[(o+1)%e].lat-t[o].lat,l=t[(o+2)%e].lat-t[(o+1)%e].lat;if(0!=(n=s*l-a*r)){if(n>0&&i<0||n<0&&i>0)return!1;i=n}}return!0}},{key:"getDateTimeString",value:function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)}},{key:"replaceHost",value:function(t,e){var i=t;if(!t||!e)return t;try{if(t.startsWith("http")){var n=/^[^@]+@/;n.test(t)&&(t=t.replace(n,"")),/^[a-z]+:\/\//i.test(t)||(t="http://"+t);var o=new URL(t),s=new URL(e),a=o.hostname,r=o.port;return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),"localhost"!==a&&"127.0.0.1"!==a||55110===parseInt(r,10)||(o.port=s.port,o.protocol=s.protocol,i=o.toString()),i}return t.includes(":")||this.options.host&&(i=new URL(t,this.options.host).href),i}catch(t){return i}}}],[{key:"_md5",value:function(t){return j()(t).toUpperCase()}}]);var t,e,i}();function ai(t,e){var i=t.viewer;if(i)for(var n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].entities.add(e);break}}function ri(t,e){for(var i=0;i<t.dataSources._dataSources.length;i++)if("sdk-dataSource1"===t.dataSources._dataSources[i].name){t.dataSources._dataSources[i].entities.remove(e);break}}function li(){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this.fltr=t.fltr,this.image=t.image,this._time=(new Date).getTime()}Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(t){return"PolylineTrailLink"},t.prototype.getValue=function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrClonedDefault(this._color,t,Cesium.Color.BROWN,e.color),this.image?e.image=this.image:e.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(e.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?e.fltr=this.fltr:e.fltr=!0,e},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=t,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",e=512,i=32,n=new fabric.Canvas("canvas",{width:e,height:i}),o=new fabric.Rect({width:e,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:e,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:t}]});return o.set("fill",s),n.add(o),n.toDataURL()}(),Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material =czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image,vec2(fract(st.t - time), st.t));\n vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n material.emission = fragColor.rgb;\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,1,1,1),image:Cesium.Material.PolylineTrailLinkImage,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(t){return!0}})}function ci(){var t,e,i,n,o,s,a;li(),t=new si,"undefined"!=typeof Cesium&&function(e){e.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new e.Cartesian2(100,100),fltr:!i.fltr&&!1!==i.fltr||i.fltr,is2D:!!i.is2D,isTranslucent:!i.isTranslucent&&!1!==i.isTranslucent||i.isTranslucent};if(this.code="",i.repeats)for(var p=e.Property.getValueOrDefault(i.repeats),h=0;h<p.length;h++)0!==h&&(this.code+="else "),u["repeat"+(h+1)]=new e.Cartesian2(p[h][1]*(p.length+3*(p.length-1)),p[h][2]),this.code+="if(materialInput.st.s < ".concat(p[h][0],") {\n repeat0 = repeat").concat(h+1,";\n }");function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeats=void 0,this._repeatSubscription=void 0,this.image=t.image,this.is2D=!!t.is2D,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat,this.repeats=t.repeats,this.duration=t.duration||0===t.duration?t.duration:1e3,this.fltr=!t.fltr&&!1!==t.fltr||t.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(t){return c},d.prototype.getValue=function(t,i){if(e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.time=this.duration?e.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=e.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=e.Property.getValueOrDefault(this.repeats),o=0;o<n.length;o++)i["repeat"+(o+1)]=new e.Cartesian2(n[o][1]*(n.length+3*(n.length-1)),n[o][2]);return i},d.prototype.equals=function(t){return this===t||t instanceof d&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)&&r.equals(this.repeats,t._repeats)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:u,source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n // vec2 repeat1 = materialInput.st.s < 0.5 ? vec2(100.0, 1.0) : vec2(200.0, 1.0);\n vec2 repeat0 = repeat;\n "+this.code+";\n vec2 st = repeat0 * materialInput.st;\n float f = -1.0;\n if(fltr==true) { f = 1.0; } \n vec4 colorImage = texture(image, vec2(fract(st.s - (time * f)), st.t));\n if(isTranslucent) {\n material.alpha = colorImage.a * color.a;\n }\n else {\n material.alpha = 1.0;\n }\n material.diffuse = colorImage.rgb*color.rgb*0.0;\n material.emission = colorImage.rgb*color.rgb * 1.4;\n return material;\n }",components:{specular:10,diffuse:"vec3(1.0)"}},translucent:function(t){return t.uniforms.isTranslucent}}),new d(i)}}(Cesium),e=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this.color=e.color,this.speed=e.speed,this.transparency=e.transparency}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.RadarScanMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e._speed)&&Cesium.Property.equals(this.transparency,e.transparency)}}])}(),Object.defineProperties(e.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),transparency:Cesium.createPropertyDescriptor("transparency")}),Cesium.RadarScanMaterialProperty=e,Cesium.Material.RadarScanMaterialProperty="RadarScanMaterialProperty",Cesium.Material.RadarScanMaterialType="RadarScanMaterialType",Cesium.Material.RadarScanMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float transparency;\n uniform float frameNumber;\n \n #define PI 3.14159265359\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec2 scrPt = st * 2.0 - 1.0;\n float time = frameNumber * speed / 30000.0 ;\n vec3 col = vec3(0.0);\n mat2 rot;\n float theta = -time * 1.0 * PI - 2.2;\n float cosTheta, sinTheta;\n cosTheta = cos(theta);\n sinTheta = sin(theta);\n rot[0][0] = cosTheta;\n rot[0][1] = -sinTheta;\n rot[1][0] = sinTheta;\n rot[1][1] = cosTheta;\n vec2 scrPtRot = rot * scrPt;\n float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\n float falloff = length(scrPtRot);\n material.alpha = pow(length(col + vec3(.5)),5.0) * transparency * 0.6;\n material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;\n return material;\n }\n \n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanMaterialType,{fabric:{type:Cesium.Material.RadarScanMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:10,transparency:1,frameNumber:Cesium.getTimestamp()},source:Cesium.Material.RadarScanMaterialSource},translucent:function(t){return!0}}),new si,"undefined"!=typeof Cesium&&function(t){t.CustomColorMaterialSource=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(t.Color,t.defaultValue),n=Object.defineProperties,o=t.Event,s=t.createPropertyDescriptor,a=t.Property,r=t.Material,l=e.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)")}return n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),c.prototype.getType=function(t){return l},c.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i},c.prototype.equals=function(t){return this===t||t instanceof c&&a.equals(this._color,t._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new t.Color(1,1,1,1)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.alpha = color.a;\n \n material.diffuse = color.rgb*0.0;\n material.emission = color.rgb;\n return material;\n }",components:{specular:1,diffuse:"vec3(0.0)"}},translucent:function(t){return!0}}),new c(e)}}(Cesium),function(){var t=new si;"undefined"!=typeof Cesium&&function(e){e.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=t.image,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(t){return c},u.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.image=this.image,i.repeat=e.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(t){return this===t||t instanceof u&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",repeat:new e.Cartesian2(100,100)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture(image, st);\n \n material.diffuse = colorImage.rgb * 0.0;\n material.emission = colorImage.rgb * 0.3;\n return material;\n }"}}),new u(i)}}(Cesium)}(),i=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._duration=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.duration=e.duration||10,this.lineBackAlpha=e.lineBackAlpha||.05}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.duration=Cesium.Property.getValueOrDefault(this._duration,t,10,e.duration),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._duration,e.duration)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(i.prototype,{color:Cesium.createPropertyDescriptor("color"),duration:Cesium.createPropertyDescriptor("duration"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.FlowLineMaterialProperty=i,Cesium.Material.FlowLineMaterialProperty="FlowLineMaterialProperty",Cesium.Material.FlowLineMaterialType="FlowLineMaterialType",Cesium.Material.FlowLineMaterialSource="\n uniform vec4 color;\n uniform float duration;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n float time = fract(czm_frameNumber / (60.0*duration));\n //长度1/10\n time = time * (1.0 + 0.1);\n //平滑过渡函数\n float alpha = smoothstep(time-0.1,time,st.s) * step(-time,-st.s);\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowLineMaterialType,{fabric:{type:Cesium.Material.FlowLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),duration:10,lineBackAlpha:.05},source:Cesium.Material.FlowLineMaterialSource},translucent:function(t){return!0}}),n=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(n.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMaterialProperty=n,Cesium.Material.PolylineFlowMaterialProperty="PolylineFlowMaterialProperty",Cesium.Material.PolylineFlowMaterialType="PolylineFlowMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n // float time = fract(czm_frameNumber * speed / 60.0);\n // float time = fract(abs(speed) * czm_frameNumber * 0.01);\n float time = fract(frameTime / 1000.0 / abs(speed));\n //长度1/10\n // time = time * (1.0 + 0.1);\n float staticAlpha = rotate?smoothstep(0.0,1.0, 1.0-st.s) * step(-1.0,-(1.0-st.s)):smoothstep(0.0,1.0, st.s) * step(-1.0,-st.s);\n\n //平滑过渡函数\n float alpha1 = smoothstep(time-0.1,time,1.0-st.s) * step(-time,- (1.0-st.s));\n float alpha2 = smoothstep(time-0.1,time,st.s) * step(-time,- st.s);\n float alpha =(speed== 0.0)? staticAlpha:(speed < 0.0)?alpha2:alpha1;\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),o=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMultMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._rotate,e.rotate)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(o.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMultMaterialProperty=o,Cesium.Material.PolylineFlowMultMaterialProperty="PolylineFlowMultMaterialProperty",Cesium.Material.PolylineFlowMultMaterialType="PolylineFlowMultMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n // 基础时间轴(控制主光带)\n float baseTime = fract(czm_frameNumber * speed / 60.0) * 1.1;\n\n // 高频时间轴(控制高光点)\n // float highlightTime = fract(czm_frameNumber * speed * 3.0 / 60.0);\n // float highlightTime = fract(abs(speed) * czm_frameNumber * 0.01);\n float highlightTime = fract(frameTime / 1000.0 / abs(speed));\n float highlightSpacing = 0.3; // 高光点间隔\n\n // 主光带透明度计算\n float mainAlpha = smoothstep(baseTime-0.1, baseTime, st.s) * step(-baseTime, -st.s);\n\n // 多高光点计算(3个周期性光斑)\n float highlight11 = smoothstep(highlightTime-0.05, highlightTime, st.s) *\n step(-highlightTime, -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - highlightTime)));\n\n float highlight21 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, st.s) *\n step(-(highlightTime+highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+highlightSpacing))));\n\n float highlight31 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight12 = smoothstep(highlightTime-0.05, highlightTime, 1.0 - st.s) *\n step(-highlightTime, -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - highlightTime)));\n\n float highlight22 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+highlightSpacing),-(1.0 - st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0-st.s - (highlightTime+highlightSpacing))));\n\n float highlight32 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight1 = !rotate?highlight11:highlight12;\n float highlight2 = !rotate?highlight21:highlight22;\n float highlight3 = !rotate?highlight31:highlight32;\n // 合并效果\n // material.alpha = mainAlpha * 0.7 +\n // (highlight1 + highlight2 + highlight3) * 0.5 +\n // lineBackAlpha;\n material.alpha = (highlight1 + highlight2 + highlight3) * 0.5 +\n lineBackAlpha;\n material.diffuse = color.rgb; // 高光区变亮\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMultMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMultMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),s=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._uType=void 0,this._space=void 0,this._dashSize=void 0,this._scale=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.space=e.space||0,this.dashSize=e.dashSize||.03,this.uType=void 0===e.uType?1:e.uType,this.lineBackAlpha=e.lineBackAlpha||.05,this.scale=e.scale||1}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowDashedLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.space=Cesium.Property.getValueOrDefault(this._space,t,10,e.space),e.dashSize=Cesium.Property.getValueOrDefault(this._dashSize,t,10,e.dashSize),e.uType=Cesium.Property.getValueOrDefault(this._uType,t,1,e.uType),e.scale=Cesium.Property.getValueOrDefault(this._scale,t,1,e.scale),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._uType,e.uType)&&Cesium.Property.equals(this._lineBackAlpha,e.lineBackAlpha)&&Cesium.Property.equals(this._scale,e.scale)}}])}(),Object.defineProperties(s.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),space:Cesium.createPropertyDescriptor("space"),dashSize:Cesium.createPropertyDescriptor("dashSize"),uType:Cesium.createPropertyDescriptor("uType"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha"),scale:Cesium.createPropertyDescriptor("scale")}),Cesium.FlowDashedLineFlowMaterialProperty=s,Cesium.Material.FlowDashedLineFlowMaterialProperty="FlowDashedLineFlowMaterialProperty",Cesium.Material.FlowDashedLineMaterialType="FlowDashedLineMaterialType",Cesium.Material.FlowDashedLineMaterialSource="\n uniform vec4 color;\n uniform float speed;\n // uniform int uType;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dashSize = 0.1;\n float gapSize = space;\n // speed现在表示完成一次完整动画循环的秒数\n float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);\n float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));\n float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);\n float dash2 = smoothstep(0.0, 0.2, pattern) -\n smoothstep(1.0/(1.0 + gapSize),\n 1.0/(1.0 + gapSize) + 0.2,\n pattern);\n float dash = (float(uType) != 1.0)?dash1:dash2;\n material.alpha = dash;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowDashedLineMaterialType,{fabric:{type:Cesium.Material.FlowDashedLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:1,space:0,scale:1,dashSize:.03,frameNumber:Cesium.getTimestamp(),uType:1,lineBackAlpha:.05},source:Cesium.Material.FlowDashedLineMaterialSource},translucent:function(t){return!0}}),a=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._color=void 0,this._speed=void 0,this._repeat=void 0,this.image=e.image||"",this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.repeat=e.repeat||new Cesium.Cartesian2(1,1)}return x()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.LineTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,1,e.speed),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,new Cesium.Cartesian2(1,1),e.repeat),e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._imageW,e._imageW)&&Cesium.Property.equals(this._speed,e._speed)}}])}(),Object.defineProperties(a.prototype,{image:Cesium.createPropertyDescriptor("image"),color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),repeat:Cesium.createPropertyDescriptor("repeat")}),Cesium.LineTextureMaterialProperty=a,Cesium.Material.LineTextureMaterialProperty="LineTextureMaterialProperty",Cesium.Material.LineTextureMaterialType="LineTextureMaterialType",Cesium.Material.LineTextureMaterialSource="\n uniform vec4 color;\n uniform sampler2D image;\n uniform float speed;\n // uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat.x; // 关键:通过repeat控制纹理密度\n // vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));\n vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.LineTextureMaterialType,{fabric:{type:Cesium.Material.LineTextureMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),image:"",repeat:new Cesium.Cartesian2(1,1),speed:1,frameNumber:Cesium.getTimestamp(),uTime:1},source:Cesium.Material.LineTextureMaterialSource},translucent:function(t){return!0}})}var ui=function(){return x()((function t(e,i){k()(this,t),this.dom=e,this.playerUrl=i.url,this.init()}),[{key:"init",value:function(){this.flvPlayer=flvjs.createPlayer({type:"flv",url:this.playerUrl,isLive:!0,hasAudio:!1,hasVideo:!0},{enableWorker:!0,enableStashBuffer:!1,stashInitialSize:128}),this.flvPlayer.attachMediaElement(this.dom),this.flvPlayer.load()}},{key:"on",value:function(t,e,i){this.flvPlayer.on(flvjs[t][e],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),pi=function(){return x()((function t(e,i){k()(this,t),this.dom=e,this.url=i.url,this.init()}),[{key:"init",value:function(){this.player=new Jessibuca({container:this.dom,decoder:this.getSourceRootPath()+"/3rdparty/jessibuca/decoder.js",timeout:30,heartTimeout:30,heartTimeoutReplay:!1,loadingTimeout:30,loadingTimeoutReplay:!1,wasmDecodeErrorReplay:!1,videoBuffer:.2,isResize:!1,text:"",loadingText:"",useMSE:!1,debug:!0,showBandwidth:!1,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,recorder:!1},forceNoOffscreen:!1,isNotMute:!1}),this.player.play(this.url)}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}}])}();function hi(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function di(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var mi=/^[og]\s*(.+)?/,fi=/^mtllib /,vi=/^usemtl /,gi=/^usemap /,yi=/\s+/,bi={red:1,green:1,blue:1,alpha:1};function Ci(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){console.warn("addFaceNormal")},addColor:function(t,e,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(t,c),p=this.parseVertexIndex(e,c),h=this.parseVertexIndex(i,c);if(this.addVertex(u,p,h),this.addColor(u,p,h),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),p=this.parseNormalIndex(r,d),h=this.parseNormalIndex(l,d),this.addNormal(u,p,h)}else this.addFaceNormal(u,p,h);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),p=this.parseUVIndex(o,m),h=this.parseUVIndex(s,m),this.addUV(u,p,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i<n;i++){var o=this.parseVertexIndex(t[i],e);this.addVertexPoint(o),this.addColor(o)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var i=this.vertices.length,n=this.uvs.length,o=0,s=t.length;o<s;o++)this.addVertexLine(this.parseVertexIndex(t[o],i));for(var a=0,r=e.length;a<r;a++)this.addUVLine(this.parseUVIndex(e[a],n))}};return t.startObject("",!1),t}var wi=function(){return x()((function t(e){k()(this,t),this.context=e}),[{key:"Load",value:function(t,e,i){var n=this;this.host=i,this.videoId=e;var o=t.substr(t.lastIndexOf("/")+1);return o=o.substring(0,o.lastIndexOf(".")),Cesium.Resource.fetchText(t).then((function(e){return n.Parse(e,t.substring(0,t.lastIndexOf("/")+1),o)}))}},{key:"Parse",value:function(t,e,i){var n=new Ci;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var o=t.split("\n"),s=[],a=0,r=o.length;a<r;a++){var l=o[a].trimStart();if(0!==l.length){var c=l.charAt(0);if("#"!==c)if("v"===c){var u=l.split(yi);switch(u[0]){case"v":n.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,bi),n.colors.push(bi.red,bi.green,bi.blue)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":n.uvs.push(parseFloat(u[1]),parseFloat(u[2]))}}else if("f"===c){for(var p=l.slice(1).trim().split(yi),h=[],d=0,m=p.length;d<m;d++){var f=p[d];if(f.length>0){var v=f.split("/");h.push(v)}}for(var g=h[0],y=1,b=h.length-1;y<b;y++){var C=h[y],w=h[y+1];n.addFace(g[0],C[0],w[0],g[1],C[1],w[1],g[2],C[2],w[2])}}else if("l"===c){var k=l.substring(1).trim().split(" "),_=[],x=[];if(-1===l.indexOf("/"))_=k;else for(var E=0,S=k.length;E<S;E++){var D=k[E].split("/");""!==D[0]&&_.push(D[0]),""!==D[1]&&x.push(D[1])}n.addLineGeometry(_,x)}else if("p"===c){var P=l.slice(1).trim().split(" ");n.addPointGeometry(P)}else if(null!==(s=mi.exec(l))){(" "+s[0].slice(1).trim()).slice(1);n.startObject(i)}else if(vi.test(l))n.object.startMaterial(l.substring(7).trim(),n.materialLibraries);else if(fi.test(l))n.materialLibraries.push(l.substring(7).trim());else if(gi.test(l))console.warn('Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===c){if((s=l.split(" ")).length>1){var M=s[1].trim().toLowerCase();n.object.smooth="0"!==M&&"off"!==M}else n.object.smooth=!0;var O=n.object.currentMaterial();O&&(O.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var T=new Ei(this.context,this.hls,this.videoId,this.host,i);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(var N=0,B=n.objects.length;N<B;N++){var L=n.objects[N],A=L.geometry,j=L.materials;if(0!==A.vertices.length){for(var I=new _i(this.context,A),F=0,R=j.length;F<R;F++){var z=j[F],H=z.name+"_"+z.smooth+"_",V=n.materials[H];z.mtllib=i+".mtl",void 0===V&&((V=new ki(this.context,A,e,z.mtllib)).name=z.name,V.flatShading=!z.smooth,n.materials[H]=V),I.setMaterial(V)}I.name=L.name,T.add(I)}}return T}}])}(),ki=function(){return x()((function t(e,i,n,s){var r=this;k()(this,t),this.context=e,this.ready=!1;var l=document.createElement("canvas");l.width=512,l.height=512,this.canvas=l;var c=Cesium.Resource.fetchText(n+s).then(function(){var t=o()(a.a.mark((function t(e){var i,o,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=[],o=e.split("\n"),l=0,c=o.length;case 3:if(!(l<c)){t.next=20;break}if(0!==(u=o[l].trimStart()).length){t.next=7;break}return t.abrupt("continue",17);case 7:if("map_Kd"!==u.split(" ")[0]){t.next=17;break}return u.split(" ")[1],p=s.replace(".mtl","_result.jpg"),t.t0=i,t.next=14,r.loadTexture(n+p);case 14:t.t1=t.sent,t.t2={diffusemap:t.t1},t.t0.push.call(t.t0,t.t2);case 17:l++,t.next=3;break;case 20:return t.abrupt("return",Promise.all(i));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),u="attribute vec3 position;\n",p="",h="",d=!1,m=!1,f=!1;i.normals.length>0&&(d=!0),i.colors.length>0&&(m=!0),!0===i.hasUVIndices&&(f=!0),d&&(u+="attribute vec3 normal;\n",u+="varying vec3 v_normal;\n",p+="varying vec3 v_normal;\n",h+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",p+="varying vec2 v_color;\n",h+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",p+="varying vec2 v_uv;\n",h+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(h,"\n }\n "),p+="\n\t\tuniform sampler2D colorTexture;\n void main() {\n\t\t\t vec4 color = texture2D(colorTexture, v_uv);\n\t\t\t\t\t\tgl_FragColor = color;\n }\n ",this.program=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:u,fragmentShaderSource:p}),this.uniformMap={};var v=this;c.then((function(t){for(var e=function(){var e=t[i].diffusemap;r.uniformMap.colorTexture=function(){return e}},i=0;i<t.length;i++)e();v.ready=!0}))}),[{key:"updateColorTexture",value:function(t,e,i){if(this.ready){var n=this.uniformMap.colorTexture();if(t.playing&&t.timeupdate&&(e!==n.width||i!==n.height)){n.destroy(),this.canvas.width=1280,this.canvas.height=960,this.canvas.getContext("2d").drawImage(t.dom,0,0,1280,960,0,0,this.canvas.width,this.canvas.height);var o=new Cesium.Texture({context:this.context,source:this.canvas});this.uniformMap.colorTexture=function(){return o}}}}},{key:"setCommand",value:function(t){t.shaderProgram=this.program,t.uniformMap=this.uniformMap}},{key:"loadTexture",value:function(t){var e=this;return Cesium.Resource.fetchImage(t).then((function(t){return e.canvas.width=t.width,e.canvas.height=t.height,e.canvas.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,e.canvas.width,e.canvas.height),new Cesium.Texture({context:e.context,source:e.canvas,sampler:Cesium.Sampler.NEAREST})}))}}])}(),_i=function(){return x()((function t(e,i){k()(this,t),this.lastState=!1,this.name=void 0,this.geometry=i;var n=[],o=0;this.material=void 0;var s=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.vertices),usage:Cesium.BufferUsage.STATIC_DRAW});if(n.push({index:o,enabled:!0,vertexBuffer:s,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),i.normals.length>0){o++;var a=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.normals),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:a,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(i.colors.length>0){o++;var r=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.colors),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:r,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(!0===i.hasUVIndices){o++;var l=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.uvs),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1})}var c=new Cesium.VertexArray({context:e,attributes:n}),u=Cesium.RenderState.fromCache({cull:{enabled:!1},depthMask:!0,depthTest:{enabled:!0}});this.drawCommand=new Cesium.DrawCommand({owner:this,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:c,renderState:u,pass:Cesium.Pass.OPAQUE})}),[{key:"setMaterial",value:function(t){this.material=t,t.setCommand(this.drawCommand)}},{key:"update",value:function(t){Cesium.defined(this.material)&&this.material.ready&&t.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(t,e,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=t.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=e.width,a=e.height;o>=20&&o<100?(s=e.width/2,a=e.height/2):o>=100&&(s=e.width/10,a=e.height/10),n=!0,this.material.updateColorTexture(e,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),xi=new WeakMap,Ei=function(){return x()((function t(e,i,n,o,s){k()(this,t),hi(this,xi,!0),this.context=e,this.videoId=n,this.host=o,this._modelMatrix=Cesium.Matrix4.IDENTITY,this.parent=null,this.children=[],this.video={dom:null,playing:!1,timeupdate:!1,width:0,height:0,tracks:null},this.time=0,this.name=s}),[{key:"show",get:function(){return e=this,(t=xi).get(di(t,e));var t,e},set:function(t){var e,i,n;"boolean"==typeof t?(i=this,n=t,(e=xi).set(di(e,i),n),t?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var t=this,e="",i=(e=this.host.endsWith("yjearth4.0")?this.host:this.host+"/yjearth4.0")+"/videoFusion/"+this.videoId;return fetch(i,{method:"get",headers:{"Content-Type":"application/json"}}).then(function(){var i=o()(a.a.mark((function i(n){var s;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(s=i.sent,s=JSON.parse(s),![0,200].includes(s.code)){i.next=13;break}if(!s.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:s.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=9;break}return n.data.url.length?(t.video.player.url=n.data.url,t.setFlvVideo(n.data.url)):console.warn("地址不存在"),e.abrupt("return");case 9:return console.warn(n.msg||n.message),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(s.msg||s.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(t){this._modelMatrix=t.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];e.drawCommand.modelMatrix=this._modelMatrix;var i=Cesium.BoundingSphere.fromVertices(e.geometry.vertices),n=Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,i.center,new Cesium.Matrix4);i.center=Cesium.Matrix4.getTranslation(n,new Cesium.Cartesian3),e.drawCommand.boundingVolume=i}}},{key:"setPosition",value:function(t){Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,t,this._modelMatrix),this.updateModelMatrix()}},{key:"add",value:function(t){t.parent=this,this.children.push(t)}},{key:"update",value:function(t){if(this.show)for(var e=0;e<this.children.length;e++){this.children[e].update(t)}}},{key:"setVideo",value:function(t){var e=this;if(this.video.playing=!1,this.video.timeupdate=!1,t){/^.+\.m3u8$/.test(t);var i="video_"+Cesium.createGuid(),n=document.createElement("div");n.setAttribute("id",i),n.style.display="none",this.video.parentDom=n;var o=this,s=new WasmPlayer(null,n,(function(t){if("play"===t){var e=n.getElementsByTagName("video")[0],i=n.getElementsByTagName("canvas")[0];if(e&&i)setTimeout((function(){s.play()}),1e3);else if(e){o.video.dom=e,o.video.width=e.videoWidth,o.video.height=e.videoHeight,o.video.playing=!0;for(var a=new Cesium.Texture({context:o.context,source:e}),r=0;r<o.children.length;r++){o.children[r].material.uniformMap.colorTexture=function(){return o.video.width=e.videoWidth,o.video.height=e.videoHeight,a.destroy(),a=new Cesium.Texture({context:o.context,source:e})}}}else if(i){o.video.dom=i,o.video.width=i.width,o.video.height=i.height,o.video.playing=!0;for(var l=new Cesium.Texture({context:o.context,source:i}),c=0;c<o.children.length;c++){o.children[c].material.uniformMap.colorTexture=function(){return i.width==o.video.width&&i.height==o.video.height||(console.log("resize texture"),l.destroy(),l=new Cesium.Texture({context:o.context,source:i})),o.video.width=i.width,o.video.height=i.height,l.destroy(),l=new Cesium.Texture({context:o.context,source:i})}}}}}));s.play(t,1),this.video.player=s,n.getElementsByTagName("video")[0].addEventListener("loadeddata",(function(){e.loaded=!0}))}}},{key:"setFlvVideo3",value:function(t){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var e="video_"+Cesium.createGuid(),i=document.createElement("video");i.setAttribute("id",e);var n=this,o=new ui(i,{url:t});this.video.player=o,o.on("Events","MEDIA_INFO",(function(t){})),o.flvPlayer.play().then((function(){n.video.dom=i,n.video.width=i.videoWidth,n.video.height=i.videoHeight,n.video.playing=!0;for(var t=new Cesium.Texture({context:n.context,source:i}),e=0;e<n.children.length;e++){n.children[e].material.uniformMap.colorTexture=function(){return n.video.width=i.videoWidth,n.video.height=i.videoHeight,t.destroy(),t=new Cesium.Texture({context:n.context,source:i})}}}))}}},{key:"setFlvVideo2",value:function(t){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var e="video_"+Cesium.createGuid(),i=document.createElement("div");i.setAttribute("id",e),i.style.display="none";var n=this,o=new pi(i,{url:t});this.video.player=o,this.video.player.player.on("play",(function(t){console.log("1111111111");var e=i.getElementsByTagName("canvas")[0];i.innerHTML="",n.video.dom=e,n.video.width=e.width,n.video.height=e.height,n.video.playing=!0;for(var o=new Cesium.Texture({context:n.context,source:e}),s=0;s<n.children.length;s++){n.children[s].material.uniformMap.colorTexture=function(){return n.video.width=e.width,n.video.height=e.height,o.copyFrom({source:e}),o}}}))}}},{key:"setFlvVideo",value:function(t){var e=this;if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var i=this,n="video_"+Cesium.createGuid(),o=document.getElementById("yj-sdk-live-player-box");o||((o=document.createElement("div")).setAttribute("id","yj-sdk-live-player-box"),o.style.display="none",document.body.appendChild(o));var s=document.createElement("live-player");s.setAttribute("id",n),s.setAttribute("video-url",this.video.url),s.setAttribute("live",!0),s.style.display="none",o.appendChild(s),this.video.player=s,s.addEventListener("play",(function(t){console.log("播放成功",e.video.url,e.name);var n=s.getElementsByTagName("video")[0];i.video.dom=n,i.video.width=n.width,i.video.height=n.height,i.video.playing=!0;for(var o=new Cesium.Texture({context:i.context,source:n}),a=0;a<i.children.length;a++){i.children[a].material.uniformMap.colorTexture=function(){return i.video.width=n.width,i.video.height=n.height,o.copyFrom({source:n}),o}}}))}}},{key:"isDestroyed",value:function(){return!1}},{key:"destroy",value:function(){this.video.player&&(this.video.player.setAttribute("video-url",null),document.getElementById("yj-sdk-live-player-box").removeChild(this.video.player),this.video.player=null)}}])}(),Si=wi,Di=["icon-py","icon-edit","icon-add","icon-add2","icon-minus","icon-play","icon-pause","icon-updateheight","icon-draw","icon-positions","icon-reset","icon-xj","icon-yj","icon-zj","icon-close","icon-query","icon-route","icon-copy","icon-load","icon-rubric","icon-pen","icon-cross","icom-confirm"];function Pi(){var t=document.createElement("svg");t.xmlns="http://www.w3.org/2000/svg",t.style.width=0,t.style.height=0,t.style.position="absolute",t.style.overflow="hidden",document.body.appendChild(t);for(var e=new DOMParser,i=function(){var i=Di[n];fetch(Cesium.buildModuleUrl("../custom/img/".concat(i,".svg"))).then((function(t){return t.text()})).then((function(n){var o=e.parseFromString(n,"text/xml").getElementsByTagName("svg")[0];o&&(o.id="yj-"+i,t.appendChild(o))}))},n=0;n<Di.length;n++)i()}var Mi=x()((function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k()(this,t);var n,o,s,a,r,l=this,c={el:i.el,size:"mini",isLog:!1,disabled:i.disabled||!1,alpha:!1,clickDefineColor:p,hasClear:!0,openPickerAni:"opacity",defaultColor:i.defaultColor,pickerInputChange:f,startMainCallback:function(t){l.colorPicker&&(l.colorPicker.picker.style.opacity=0),setTimeout((function(){u()}),0)}};function u(){if(l.colorPicker&&l.colorPicker.picker){var t=!1,e=l.colorPicker.box,c=l.colorPicker.picker,u=e.getBoundingClientRect().x,m=e.getBoundingClientRect().y,v=0;c.style.left=u+"px",c.style.minWidth="325px";var g=c.getElementsByClassName("ew-alpha-slider-bar")[0];g&&(g.parentNode.style.width="16px",g.parentNode.removeChild(g));var y=document.createElement("div");y.className="icon-pen-box",y.innerHTML='<svg class="icon-pen"><use xlink:href="#yj-icon-pen"></use></svg>',y.style.display="none",y.style.cursor="unset";var b=l.colorPicker.pickerInput;b.parentNode.insertBefore(y,b),b.style.width="188px",b.style.display="none";var C=document.createElement("div"),w=document.createElement("div");w.className="row",w.style.margin="6px 0 0 0",w.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col" style="flex: 0 0 92px;"></div>\n ';var k=document.createElement("div");k.className="row",k.innerHTML='\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n ',C.appendChild(w),C.appendChild(k);var _=k.getElementsByTagName("input");_[0].style.width="72px",_[1].style.width="72px",_[2].style.width="72px",n=_[0],o=_[1],s=_[2];var x=c.getElementsByClassName("ew-color-dropbtns")[0];if(c.insertBefore(C,x),i.alpha){_[0].style.width="52px",_[1].style.width="52px",_[2].style.width="52px";var E=document.createElement("div");E.className="input-number input-number-unit color-alpha",E.innerHTML='\n <input class="input" type="number" title="" step="0.01" min="0" max="1">\n <span class="arrow"></span>',b.parentNode.insertBefore(E,b.nextSibling),b.style.width="106px",E.style.width="66px",E.style.margin="0 6px 0 0",a=E.getElementsByClassName("input")[0],w.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col">A</div>\n <div class="col" style="flex: 0 0 106px;"></div>\n ',k.appendChild(E),a.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)),a.value=parseInt(100*e)/100)})),l.pickAlphaInputValue||0===l.pickAlphaInputValue||"0"===l.pickAlphaInputValue?a.value=parseInt(100*l.pickAlphaInputValue)/100:a.value=r?parseInt(100*r.alpha)/100:1,l.pickAlphaInputValue=a.value,e.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").withAlpha(a.value).toCssColorString()}else r=r?r.withAlpha(1):"",e.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssColorString();var S=c.getElementsByClassName("ew-color-dropbtngroup")[0];k.appendChild(S);var D=c.getElementsByClassName("ew-pre-define-color-container")[0];if(D){var P=localStorage.getItem("custom-color");P=P?JSON.parse(P):{};var M=document.createElement("span");M.className="custom-divider",M.style.margin="10px 0";var O=document.createElement("span");O.className="custom-divider",D.parentNode.insertBefore(M,D),D.parentNode.insertBefore(O,D.nextSibling);var T=document.createElement("div");T.className="yj-pre-collect-color-container",O.parentNode.insertBefore(T,O.nextSibling);var N=document.createElement("div");N.innerHTML='<svg class="icon-add2"><use xlink:href="#yj-icon-add2"></use></svg>',N.className="yj-pre-collect-color add";var B=document.createElement("div");B.innerHTML='<svg class="icon-minus" style="display: unset;"><use xlink:href="#yj-icon-minus"></use></svg><svg class="icon-confirm" style="display: none;"><use xlink:href="#yj-icom-confirm"></use></svg>',B.className="yj-pre-collect-color subtract";var L=B.getElementsByClassName("icon-minus")[0],A=B.getElementsByClassName("icon-confirm")[0];T.appendChild(N),T.appendChild(B);var j=[],I=function(t){var e=document.createElement("div");e.className="yj-pre-collect-color",e.setAttribute("tabindex","0"),e.setAttribute("color-box-id",l.colorPicker.uid);var i=document.createElement("div");i.className="yj-pre-define-color-item",e.appendChild(i),i.className="yj-pre-define-color-item";var n=Cesium.Color.fromCssColorString(P[t]).toCssHexString();i.style.backgroundColor=n,i.addEventListener("click",(function(t){l.colorPicker.updateColor(t),e.className="yj-pre-collect-color yj-pre-collect-color-active",p(n)})),e.addEventListener("blur",(function(t){e.className="yj-pre-collect-color"}));var o=document.createElement("div");o.className="yj-pre-define-color-item subtract-btn",o.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',o.style.display="none",e.appendChild(o),T.appendChild(e),o.addEventListener("click",(function(){delete P[t],localStorage.setItem("custom-color",JSON.stringify(P)),T.removeChild(e)})),j.push(o)};for(var F in P)I(F);N.addEventListener("click",(function(){if(t){t=!1;for(var e=0;e<j.length;e++)j[e].style.display="none"}var i=document.createElement("div");i.className="yj-pre-collect-color",i.setAttribute("tabindex","0"),i.setAttribute("color-box-id",l.colorPicker.uid);var n=document.createElement("div");n.className="yj-pre-define-color-item",i.appendChild(n);var o=d(h(l.colorPicker.hsba)),s=Cesium.Color.fromCssColorString(o||"#ffffff");a&&(s=s.withAlpha(a.value));var r=s.toCssHexString();n.style.backgroundColor=r,n.addEventListener("click",(function(t){l.colorPicker.updateColor(t),i.className="yj-pre-collect-color yj-pre-collect-color-active",p(r)})),i.addEventListener("blur",(function(t){i.className="yj-pre-collect-color"})),T.appendChild(i);var c=document.createElement("div");c.className="yj-pre-define-color-item subtract-btn",c.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',c.style.display="none",i.appendChild(c),j.push(c);var u=Cesium.createGuid();P[u]=r,localStorage.setItem("custom-color",JSON.stringify(P)),c.addEventListener("click",(function(){delete P[u],localStorage.setItem("custom-color",JSON.stringify(P)),T.removeChild(i)}))})),B.addEventListener("click",(function(){if(t=!t){L.style.display="none",A.style.display="unset";for(var e=0;e<j.length;e++)j[e].style.display="block"}else{L.style.display="unset",A.style.display="none";for(var i=0;i<j.length;i++)j[i].style.display="none"}}))}v=c.offsetHeight,"none"===c.style.display&&(c.style.display="block",v=c.offsetHeight,c.style.display="none"),m+e.offsetHeight+4+v>window.innerHeight?c.style.top=m-v+"px":c.style.top=m+e.offsetHeight+4+"px",l.colorPicker.pancelTop=parseFloat(c.style.top)-2,f(Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssHexString())}}function p(t){if(a){var e=Cesium.Color.fromCssColorString(t);a.value=parseInt(100*e.alpha)/100}}function h(t){var e,i,n,o=t.a,s=Math.round(t.h),a=Math.round(255*t.s/100),r=Math.round(255*t.b/100);if(0===a)e=i=n=r;else{var l=(255-a)*r/255,c=s%60*(r-l)/60;360===s?(e=r,i=n=0):s<60?(e=r,i=l+c,n=l):s<120?(e=r-c,i=r,n=l):s<180?(e=l,i=r,n=l+c):s<240?(e=l,i=r-c,n=r):s<300?(e=l+c,i=l,n=r):s<360?(e=r,i=l,n=r-c):e=i=n=0}return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+o+")"}function d(t){var e={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};if(/rgba?/.test(t)){var i=t.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n="";return i[3],i.map((function(t,i){i<=2&&(n+=function(t){t=Math.min(Math.round(t),255);var i=Math.floor(t/16),n=t%16;return""+(e[i]||i)+(e[n]||n)}(t))})),"#"+n}}function m(t,e){var i=t.toLowerCase(),n=t.length,o=[];i=Cesium.Color.fromCssColorString(i).toCssHexString().substring(0,7);if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===n){for(var s="#",a=1;a<n;a++){var r=i.slice(a,a+1);s+=r.concat(r)}i=s}for(var l=1,c=i.length;l<c;l+=2)o.push(parseInt("0X"+i.slice(l,l+2),16));return o}}function f(t){if(l.colorPicker&&l.colorPicker.pickerInput){var e=m(t||l.colorPicker.pickerInput.value);n.value=e[0],o.value=e[1],s.value=e[2]}}this.el=i.el,i.sure&&(c.sure=function(t){var n=Cesium.Color.fromCssColorString(t);a&&(n=n.withAlpha(a.value),e.pickAlphaInputValue=a.value),t=n.toCssHexString(),"function"==typeof i.sure&&i.sure(t),u()}),i.clear&&(c.clear=function(){a&&(a.value=e.pickAlphaInputValue=1),e.colorPicker.config.defaultColor="",u(),"function"==typeof i.clear&&i.clear()}),c.defaultColor&&(r=Cesium.Color.fromCssColorString(c.defaultColor)),c.predefineColor=["rgba(255, 255, 255, 1)","rgba(255, 0, 0, 1)","rgba(208, 132, 209, 1)","rgba(100, 182, 217, 1)","rgba(42, 130, 228, 1)","rgba(214, 36, 36, 1)","rgba(252, 222, 111, 1)","rgba(67, 207, 124, 1)","rgba(176, 243, 143, 1)","rgba(121, 72, 234, 1)","rgba(255, 195, 0, 1)","rgba(0, 186, 173, 1)","rgba(165, 214, 63, 1)","rgba(0, 0, 0, 1)","rgba(46, 47, 51, 1)","rgba(172, 51, 193, 1)","rgba(130, 21, 21, 1)","rgba(255, 87, 51, 1)","rgba(255, 140, 0, 1)","rgba(125, 191, 255, 1)"],this.colorPicker=new ewPlugins("colorpicker",c),u()}));window.YJColorPicker=Mi;var Oi=Mi;function Ti(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ni(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ni(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Bi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Li(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Bi(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Bi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ai(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ji(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Ii=new WeakMap,Fi=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),Ai(this,Ii,void 0),this.div_id=e,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=Li({},i),ti(Qe()),this.proj=new F,this.init(),Pi()}),[{key:"addIncetance",value:function(t,e){this.entityMap.set(t,e)}},{key:"getIncetance",value:function(t){return this.entityMap.get(t)}},{key:"removeIncetance",value:function(t){this.entityMap.delete(t),function(t){at.delete(t)}(t),function(t){rt.delete(t)}(t),function(t){lt.delete(t)}(t),re(this,t)}},{key:"setDefaultView",value:function(t){t?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}},Ye(this),Je(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.destination.lng,t.destination.lat,t.destination.alt),orientation:{heading:Cesium.Math.toRadians(t.orientation.heading||0),pitch:Cesium.Math.toRadians(t.orientation.pitch||0),roll:Cesium.Math.toRadians(t.orientation.roll||0)},duration:0})):(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2),this.viewer.camera.setView({destination:Cesium.Camera.DEFAULT_VIEW_RECTANGLE}))}},{key:"init",value:function(){var t=this,e=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(e),n=this;this.options={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0,mapProjection:i},Number(Cesium.VERSION.split(".")[1])>=107?this.options.baseLayer=Cesium.ImageryLayer.fromProviderAsync(Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"))):this.options.imageryProvider=new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),this.options.contextOptions={webgl:{alpha:!0,depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!0},requestWebgl2:!0},Cesium.RequestScheduler.maximumRequests=500,this.viewer=new Cesium.Viewer(this.div_id,this.options),this.viewer.scene.imageryLayers._layers[0].notes="default-base-map",this.viewer._shadows=this.viewer.shadows,this.viewer.scene.screenSpaceCameraController.maximumZoomDistance=5e7,this.viewer.scene.globe.translucency.enabled=!0;var o=new si;this.viewer.scene.skyBox=new Cesium.SkyBox({sources:{negativeX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mx.jpg",negativeY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_my.jpg",negativeZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mz.jpg",positiveX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_px.jpg",positiveY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_py.jpg",positiveZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_pz.jpg"}}),ci();for(var s=[{name:"思源黑体",value:"SourceHanSansTi",url:o.getSourceRootPath()+"/custom/fonts/SourceHanSansCN-Medium.otf",format:"opentype"},{name:"庞门正道标题体",value:"PMZDBTTi",url:o.getSourceRootPath()+"/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf",format:"truetype"},{name:"数黑体",value:"AlimamaShuHeiTi",url:o.getSourceRootPath()+"/custom/fonts/AlimamaShuHeiTi-Bold.ttf",format:"truetype"}],a=0;a<s.length;a++){var r=new FontFace(s[a].value,"url('".concat(s[a].url,"') format('").concat(s[a].format,"')"));r.load(),document.fonts.add(r)}document.fonts.ready.then((function(){var e,i=Ti(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"labelFontFamily"in o&&(o.labelFontFamily=o.labelFontFamily)}}catch(t){i.e(t)}finally{i.f()}})),this.setDefaultView(),Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmM5ODNkYy0yMTIzLTQxNzktOTE1Yy1mN2QxNmFkMjgyMTUiLCJpZCI6Mjk0NzIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTIyMjkxMTJ9.9oYggi4kZgcapD2BkEGF8kG8tTuVkF33FdwxB2JKXeA",this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.viewer.scene.screenSpaceCameraController.zoomEventTypes=[Cesium.CameraEventType.WHEEL,Cesium.CameraEventType.PINCH],this.viewer.scene.screenSpaceCameraController.tiltEventTypes=[Cesium.CameraEventType.PINCH,Cesium.CameraEventType.RIGHT_DRAG],this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),Cesium.FeatureDetection.supportsImageRenderingPixelated()&&(this.viewer.resolutionScale=window.devicePixelRatio),this.viewer.scene.fxaa=!0,this.viewer.scene.postProcessStages.fxaa.enabled=!0,this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0,function(t){var e=new si,i=new Cesium.CustomDataSource("sdk-dataSource1");t.dataSources.add(i).then((function(t){var i;t.clustering.enabled=!1,t.clustering.pixelRange=15,t.clustering.minimumClusterSize=2;for(var n=new Cesium.PinBuilder,o=(n.fromText("50+",Cesium.Color.RED,48).toDataURL(),n.fromText("40+",Cesium.Color.ORANGE,48).toDataURL(),n.fromText("30+",Cesium.Color.YELLOW,48).toDataURL(),n.fromText("20+",Cesium.Color.GREEN,48).toDataURL(),n.fromText("10+",Cesium.Color.BLUE,48).toDataURL(),new Array(8)),s=0;s<o.length;++s)o[s]=n.fromText(""+(s+2),Cesium.Color.VIOLET,48).toDataURL();!function(){Cesium.defined(i)?(i(),i=void 0):i=t.clustering.clusterEvent.addEventListener((function(t,i){i.billboard.show=!0,i.billboard.id=i.label.id,i.billboard.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,i.billboard.image=e.getSourceRootPath()+"/img/cluster.png",i.billboard.disableDepthTestDistance=We()?void 0:Number.POSITIVE_INFINITY,i.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,i.label.font="18px Arial,sans-serif",i.label.disableDepthTestDistance=We()?void 0:Number.POSITIVE_INFINITY,i.label.style=Cesium.LabelStyle.FILL,i.label.showBackground=!0,i.label.backgroundColor=Cesium.Color.WHITE.withAlpha(0),t.length>=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):t.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):t.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):t.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):t.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):t.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):t.length>=10?(i.billboard.scale=.9,i.label.pixelOffset=new Cesium.Cartesian2(-16,-28)):(i.billboard.scale=.8,i.label.pixelOffset=new Cesium.Cartesian2(-11,-25))}));var n=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(e){Cesium.knockout.getObservable(a,e).subscribe((function(i){t.clustering[e]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),E(this.viewer);Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"});setTimeout((function(){var e=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];e.addEventListener("mousedown",(function(){Ye(t),Je(t)})),i.addEventListener("mousedown",(function(){Ye(t),Je(t)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var e=0;e<t.viewer.imageryLayers._layers.length;e++)t.viewer.imageryLayers._layers[e]._imageryProvider&&t.viewer.imageryLayers._layers[e]._imageryProvider._type&&("flw"===t.viewer.imageryLayers._layers[e]._imageryProvider._type||"jww"===t.viewer.imageryLayers._layers[e]._imageryProvider._type)&&t.viewer.imageryLayers.raiseToTop(t.viewer.imageryLayers._layers[e])})),function t(){(function(t,e,i){t.set(ji(t,e),i)})(Ii,n,requestAnimationFrame(t)),e=1,n.viewer&&2===n.viewer.scene.mode&&(e=10),n.viewer.shadows?n.viewer.scene.light=new Cesium.SunLight:n.viewer.trackedEntity&&n.viewer.trackedEntity.position?(e=1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.trackedEntity.position._value,new Cesium.Cartesian3(-1,-1,-1)),intensity:e})):(e=n.viewer&&2===n.viewer.scene.mode?30:1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.scene.camera.position,new Cesium.Cartesian3(-1,-1,-1)),intensity:e})),TWEEN.update();var e}(),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:0},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}})),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:1e8},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}}))}},{key:"destroy",value:function(){var t,e;cancelAnimationFrame((e=this,(t=Ii).get(ji(t,e))));var i,n=Ti(this.entityMap);try{for(n.s();!(i=n.n()).done;){var o=y()(i.value,2);o[0];o[1].remove()}}catch(t){n.e(t)}finally{n.f()}this.viewer&&(this.viewer.entities&&this.viewer.entities.removeAll(),this.viewer.destroy&&this.viewer.destroy()),this.viewer=null}}])}();function Ri(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function zi(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ri(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ri(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Hi=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.primitives={building:[],unit:[],dth:[]},this.options=zi({},i),this.options.host=this.options.host||h(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(t,e){this.PickBuildingEvent.addEventListener(e,t)}},{key:"initEvents",value:function(){var t=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()&&t.isActivate){var i=t.sdk.viewer.scene.pick(e.position);if(i){if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"==i.id.type||"yj-dth-highlight"==i.id.type))return void t.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive),void t.handlePickEvent(i.id)}t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive);var n=t.sdk.viewer.scene.pickPosition(e.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];t.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var e=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");e.show=!1;var i,n=0,o=this;function s(t){var i=o.sdk.viewer.scene.pick(t.endPosition);if(i){var n="";if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"===i.id.type||"yj-dth-highlight"===i.id.type))n=i.id.build_info.name+" - "+i.id.unit_info.name+" - "+i.id.room_num;else if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"===i.id.type)i.id.build_info.name&&(n=i.id.build_info.name+" - "+i.id.name);else{if(!(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-build"===i.id.type))return i.primitive&&i.primitive.id&&i.primitive.id.id&&"yj-dth-cover-label"===i.primitive.id.id?void(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition)):void(e.show=!1);i.id.name&&(n=i.id.name)}n&&(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition),e.label=new Cesium.LabelGraphics({text:n,font:"20px Helvetica",pixelOffset:{x:0,y:-30},fillColor:Cesium.Color.fromCssColorString("#ffffff"),outlineColor:Cesium.Color.BLACK,outlineWidth:1,showBackground:!0,backgroundColor:Cesium.Color.fromCssColorString("#000000").withAlpha(.8),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY}),e.show=!0)}}new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus())try{var e=Date.now();if(e-n<100)return clearTimeout(i),void(i=setTimeout((function(){s(t)}),100));clearTimeout(i),n=e,s(t)}catch(t){}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(t){this.queryByPoint([t.position.lng,t.position.lat],t.position.alt,t.id)}},{key:"queryByPoint",value:(s=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/dth/build/query_by_point":this.options.host+"/yjearth4.0/api/v1/dth/build/query_by_point",i+="?point="+JSON.stringify({lng:e[0],lat:e[1]}),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(200!==(n=t.sent).status){t.next=11;break}return t.next=9,n.json();case 9:200===(o=t.sent).code||0===o.code?this.processQueryByPointResults(o.data):window.ELEMENT&&window.ELEMENT.Message({message:o.msg||o.message,type:"warning",duration:1500});case 11:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{heading:0,pitch:-90,roll:0},e.build_info&&this.handlePickEvent(e),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!e.build_info){t.next=26;break}if(o=JSON.parse(e.build_info.range),e.dan_yuan.length>0)for(s=0;s<e.dan_yuan.length;s++)e.dan_yuan[s].children.length>0?this.addDthPrimitive(e.dan_yuan[s].children,e.build_info,e.dan_yuan[s]):this.addUnitPrimitive([e.dan_yuan[s]],e.build_info,e.dan_yuan[s]);else this.activeBuilding=e.build_info.ID||e.build_info.id,this.addBuildingPrimitive([e.build_info]);if(!i){t.next=26;break}if(e.info&&e.info.dan_yuan&&(o=JSON.parse(e.info.dan_yuan.range)),!e.info||!e.info.hu){t.next=25;break}for(o=JSON.parse(e.info.hu.range),r=0;r<o.length;r++)o[r].alt=e.info.hu.bottom;l=0;case 14:if(!(l<this.primitives.dth.length)){t.next=25;break}return t.next=17,this.primitives.dth[l].readyPromise;case 17:if((c=this.primitives.dth[l]._primitiveOptions.geometryInstances[0].id).ID!==e.info.hu.ID||c.room_num!==e.info.hu.room_num){t.next=22;break}return u={id:zi(zi({},e.info.hu),{},{build_info:zi({},e.build_info),unit_info:e.info.dan_yuan}),primitive:this.primitives.dth[l]},this.getIDBypickFeature(u),t.abrupt("break",25);case 22:l++,t.next=14;break;case 25:this.flyTo(o,n);case 26:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"addBuildingPrimitive",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=0;i<e.length;i++){for(n=[],o=0,s=JSON.parse(e[i].range),r=0;r<s.length;r++)o<s[r].alt&&(o=s[r].alt),n.push(s[r].lng,s[r].lat,0);l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n)),extrudedHeight:1e8}),this.primitives.building.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:zi({type:"yj-dth-build"},e[i]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"clearBuildingPrimitive",value:function(t){for(var e=this.primitives.building.length-1;e>=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]),this.primitives.building.splice(e,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var t=this.primitives.building.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(e=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=0;o<e.length;o++){for(s=[],r=0,l=JSON.parse(e[o].range),c=0;c<l.length;c++)r<l[c].alt&&(r=l[c].alt),s.push(l[c].lng,l[c].lat,0);u=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),extrudedHeight:1e8}),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:zi(zi({type:"yj-dth-unit"},e[o]),{},{build_info:zi({},i),unit_info:zi({},n)}),geometry:Cesium.PolygonGeometry.createGeometry(u),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:2}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#00ff0a").withAlpha(.8))}}),appearance:new Cesium.PolylineColorAppearance})))}case 1:case"end":return t.stop()}}),t,this)}))),function(t,i,n){return e.apply(this,arguments)})},{key:"clearUnitPrimitive",value:function(t){for(var e=this.primitives.building.length-1;e>=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]),this.primitives.unit.splice(e,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var t=this.primitives.unit.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(t,e,i){for(var n=0;n<t.length;n++){for(var o=JSON.parse(t[n].range),s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,t[n].bottom+.3);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:t[n].height+t[n].bottom}),l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:t[n].bottom});this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:zi(zi({type:"yj-dth-dth"},t[n]),{},{build_info:zi({},e),unit_info:zi({},i)}),geometry:Cesium.PolygonGeometry.createGeometry(r),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 64, 255, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:zi({type:"yj-dth-dth-border"},t[n]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 0, 0, 1)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}}},{key:"clearDthPrimitive",value:function(t){for(var e=this.primitives.dth.length-1;e>=0;e--)t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.ID&&t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]),this.primitives.dth.splice(e,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var t=this.primitives.dth.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(t){this.clickHighlightPrimitive&&(this.clickHighlightPrimitive.show=!0),this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive),this.highlightPrimitive=this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:zi(zi({},t.id),{},{type:"yj-dth-highlight"}),geometry:t.primitive._primitiveOptions.geometryInstances[0].geometry,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#ff9800").withAlpha(.8)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),this.highlightPrimitive.readyPromise.then((function(){t.primitive.show=!1})),this.clickHighlightPrimitive=t.primitive;var e=t.id.range;"string"==typeof t.id.range&&(e=JSON.parse(t.id.range)),this.getHilightArea(e),this.handlePickEvent(t.id)}},{key:"handlePickEvent",value:function(t){this.PickBuildingEvent.raiseEvent(t)}},{key:"getHilightArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=u.length>1&&void 0!==u[1]?u[1]:{heading:0,pitch:-90,roll:0},n=new YJ.Tools(this.sdk),o=0,s=[],r=0;case 5:if(!(r<e.length)){t.next=18;break}if(!e[r].alt){t.next=10;break}o=e[r].alt,t.next=13;break;case 10:return t.next=12,n.getClampToHeight(e[r]);case 12:o=t.sent;case 13:l=Cesium.Cartesian3.fromDegrees(e[r].lng,e[r].lat,o),s.push(l.x,l.y,l.z);case 15:r++,t.next=5;break;case 18:return t.next=20,Cesium.BoundingSphere.fromVertices(s);case 20:c=t.sent,this.sdk.viewer.camera.flyToBoundingSphere(c,{offset:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0===i.pitch?i.pitch:-90),roll:Cesium.Math.toRadians(i.roll||0)}});case 22:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"activate",value:function(){this.isActivate=!0}},{key:"deactivate",value:function(){this.isActivate=!1}}]);var t,e,i,n,s}(),Vi=function(){return x()((function t(){k()(this,t),this.start()}),[{key:"start",value:function(){var t=this;navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(e){t.mediaRecorder=new MediaRecorder(e,{mimeType:"video/webm"});var i=[];t.mediaRecorder.addEventListener("dataavailable",(function(t){i.push(t.data)})),t.mediaRecorder.addEventListener("stop",o()(a.a.mark((function t(){var e,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=new Blob(i,{type:"video/mp4"}),n={suggestedName:"视频录制.mp4",types:[{description:"文件类型",accept:{"video/mp4":[".mp4"]}}],excludeAcceptAllOption:!0},t.next=5,window.showSaveFilePicker(n);case 5:return o=t.sent,t.next=8,o.createWritable();case 8:return(s=t.sent).write(e),t.next=12,s.close();case 12:YJ.Global.ScreenRecord.screenRecord=null,t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),console.info("文件保存失败:",t.t0);case 18:case"end":return t.stop()}}),t,null,[[0,15]])})))),t.mediaRecorder.start()})).catch((function(t){console.info("取消录屏"),console.info(t),YJ.Global.ScreenRecord.screenRecord=null}))}}])}();var Gi=i(8),Ui=i.n(Gi),Wi=i(5),Yi=i.n(Wi),Ji=i(4),qi=i.n(Ji);function Xi(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Zi=function(t){function e(t,i,n,o){var s;return k()(this,e),(s=Xi(this,e,[t.viewer._container,n])).sdk=t,s.viewer=t.viewer,s.info=i,o&&s.closeAll(),s._init(),s}return qi()(e,t),x()(e,[{key:"_init",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.init();case 2:return t.next=4,this._attribute();case 4:if(this.options.confirmCallBack&&((e=document.createElement("button")).className="confirm",e.innerHTML="确认",this.footAppChild(e),e.addEventListener("click",(function(){p.options.confirmCallBack&&p.options.confirmCallBack(p.info)}))),this.options.removeCallBack&&((i=document.createElement("button")).className="delete",i.innerHTML="删除",this.footAppChild(i),i.addEventListener("click",(function(){p.close(),p.options.removeCallBack&&p.options.removeCallBack()}))),this.options.rotateCallBack&&((n=document.createElement("button")).className="rotate",n.innerHTML="旋转",this.footAppChild(n),n.addEventListener("click",(function(){p.options.rotateCallBack&&p.options.rotateCallBack()}))),(this.options.translationalCallBack||this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&((o=document.createElement("div")).style.position="absolute",o.style.left="24px",o.style.flet="0",o.style.display="flex",this.footAppChild(o),this.options.updateHeightCallBack&&((s=document.createElement("button")).innerHTML='<svg class="icon-updateheigh"><use xlink:href="#yj-icon-updateheight"></use></svg>更新高程',s.style.width="auto",s.addEventListener("click",(function(){p.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((r=document.createElement("button")).className="secondaryEdit",r.innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>二次编辑',this.options.updateHeightCallBack&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){p.options.secondaryEditCallBack&&p.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((l=document.createElement("button")).className="translational",l.innerHTML='<svg class="icon-py"><use xlink:href="#yj-icon-py"></use></svg>平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(l.style.marginLeft="10px"),o.appendChild(l),l.addEventListener("click",(function(){p.options.translationalCallBack&&p.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c<this.options.addFootElm.length;c++)(u=document.createElement(this.options.addFootElm[c].tagName)).className=this.options.addFootElm[c].className,u.innerHTML=this.options.addFootElm[c].innerHTML,this.options.addFootElm[c].event&&2==this.options.addFootElm[c].event.length&&u.addEventListener(this.options.addFootElm[c].event[0],this.options.addFootElm[c].event[1]),this.footAppChild(u);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_attribute",value:function(){var t=this._element.content.getElementsByClassName("attribute")[0];if(t&&0!==t.length)for(var e=t.getElementsByClassName("attribute-select")[0].getElementsByTagName("option"),i=e.length-1;i>=0;i--)for(var n in this.info.attribute)if(e[i].value===n){this.info.attribute[n].disabled&&(e[i].disabled=!0);break}}}]);var i}(W);function Ki(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function $i(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ki(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ki(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Qi=new si;function tn(){return(tn=o()(a.a.mark((function t(e,i,n,s){var r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P,M,O,T,N,B,L,A,j,I,F,R,z,H,V,G,U,W,J,q,X,Z,K,$,Q,tt,et,it,nt,ot,st,at,rt,lt,ct,ut,pt,ht,dt,mt,ft,vt,gt,yt;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return yt=function(){var t,e=document.createElement("canvas"),i=e.getContext("2d"),o=new Image;o.src=s,o.onload=function(){if(!h){var s=$i({},v),a=JSON.parse(JSON.stringify(y)),l=$i({},b),c=$i({},g);c.width=g.width/L.width*o.width;var u=m/L.width*o.width,p=u;if(c.show&&d&&d.complete&&(p+=c.width),e.width=o.width+2*p,e.height=o.height+2*p,i.clearRect(0,0,e.width,e.height),i.rect(0,0,e.width,e.height),i.fillStyle="#ffffff",i.fill(),i.drawImage(o,p,p,o.width,o.height),s.show){var f=s.text,C=Math.max(5,s.height*o.height*.5);i.font="".concat(C,"px serif"),i.fillStyle=s.bgColor||"#5d5d5d",i.fillRect(p,p,e.width-2*p,s.height*o.height),i.fillStyle=s.color||"white",i.textAlign="center",i.textBaseline="middle",i.fillText(f,e.width/2,s.height*o.height/2+p)}for(var w=function(t){if(a[t].show)if("text"in a[t])i.font="".concat(o.height*a[t].height,"px serif"),i.fillStyle=a[t].color||"white",i.textAlign="left",i.textBaseline="bottom",a[t].width=i.measureText(a[t].text).width/o.height,i.fillText(a[t].text,o.width*a[t].x+p,o.height*a[t].y+p);else if("url"in a[t])if(y[t].svg&&y[t].svg.complete)i.drawImage(y[t].svg,o.width*a[t].x+p,o.height*a[t].y+p,o.height*a[t].width,o.height*a[t].height);else{var e=new Image;e.src=Qi.getSourceRootPath()+a[t].url,e.onload=function(){a[t].svg=e,i.drawImage(e,o.width*a[t].x+p,o.height*a[t].y+p,o.height*a[t].width,o.height*a[t].height)}}},k=0;k<a.length;k++)w(k);if(l.show){!function(){if(!n)return;var e=Cesium.Math.toDegrees(n.west),i=Cesium.Math.toDegrees(n.east),s=Cesium.Math.toDegrees(n.north),a=(Cesium.Math.toDegrees(n.south),turf.point([e,s])),r=turf.point([i,s]),l=turf.distance(a,r,{units:"kilometers"});t=1e3*l/o.width}();var _=o.width*l.x+p,x=o.height*l.y+p,E="m",S=.08*o.width*.12,D=.08*o.width/l.cell,P=Math.round(t*D),M=P+"";if(P<10);else{P=Number(M[0]);for(var O=0;O<M.length-1;O++)P*=10;D=P/t}l.width=D*l.cell,l.height=.2*l.width,P>=1e3&&(E="㎞",P=Math.round(P/1e3));var T=x;i.beginPath(),i.moveTo(_,T),i.lineTo(_+l.width,T),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke();for(var N=0,B=0;B<=l.cell;B++)N=_+B*D,i.beginPath(),i.moveTo(N,T-.1*l.width),i.lineTo(N,T),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke(),i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="center",i.textBaseline="bottom",i.fillText(B*P,N,T-.1*l.width);i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="left",i.textBaseline="bottom",i.fillText(E,N+1.2*S,T-.1*l.width)}c.show&&d&&d.complete&&(A(i,d,u,u,c.width,"top",1),A(i,d,e.width-c.width-u,u,c.width,"right",1),A(i,d,e.width-c.width-u,e.height-c.width-u,c.width,"bottom",1),A(i,d,u,e.height-c.width-u,c.width,"left",1)),e.toBlob((function(t){var e=URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download="高清出图-".concat(gt(),".jpg"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}),"image/jpeg",.95),r=!1,G.innerHTML="打印"}function A(t,i,n,o,s,a){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(n+s/2,o+s/2),a){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-s*r/2,-s/2),"top"===a||"bottom"===a?(t.lineTo(e.width-2*u-s/2,-s/2),t.lineTo(e.width-2*(u+s)+s/2,s/2)):(t.lineTo(e.height-2*u-s/2,-s/2),t.lineTo(e.height-2*(u+s)+s/2,s/2)),t.lineTo(s*r/2,s/2),t.closePath(),t.clip();var l,p=i.width/i.height*s;t.drawImage(i,-s/2,-s/2,p,s),l="top"===a||"bottom"===a?Math.ceil((e.width-2*u-2*c.width)/c.width):Math.ceil((e.height-2*u-2*c.width)/c.width),l++;for(var h=1;h<=l;h++)t.drawImage(i,-s/2+p*h,-s/2,p,s);t.restore()}}},gt=function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},vt=function(){if(n){var t=Cesium.Math.toDegrees(n.west),e=Cesium.Math.toDegrees(n.east),i=Cesium.Math.toDegrees(n.north),o=(Cesium.Math.toDegrees(n.south),turf.point([t,i])),s=turf.point([e,i]),a=turf.distance(o,s,{units:"kilometers"});p=1e3*a/L.width}},ft=function(t){var e=m;g.show&&d&&d.complete&&(e+=g.width);var i=.005*N.height;if(B.strokeStyle="red",B.lineWidth=.002*N.height,"text"in t)B.strokeRect(L.width*t.x+e,L.height*t.y+e-L.height*t.height,L.height*t.width,L.height*t.height);else if("url"in t)B.strokeRect(L.width*t.x+e,L.height*t.y+e,L.height*t.width,L.height*t.height);else if(t===b)return void B.strokeRect(L.width*t.x+e-.2*b.width,L.height*t.y+e-t.height-.5*b.height,t.width+.6*b.width,t.height+b.height);var n=ht(t,e);B.fillStyle="red",n.forEach((function(t){B.beginPath(),B.arc(t.x,t.y,i,0,2*Math.PI),B.fill()}))},mt=function(t,e,i,n,o,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*a/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(N.width-2*m-o/2,-o/2),t.lineTo(N.width-2*(m+o)+o/2,o/2)):(t.lineTo(N.height-2*m-o/2,-o/2),t.lineTo(N.height-2*(m+o)+o/2,o/2)),t.lineTo(o*a/2,o/2),t.closePath(),t.clip();var r,l=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,l,o),r="top"===s||"bottom"===s?Math.ceil((N.width-2*m-2*g.width)/g.width):Math.ceil((N.height-2*m-2*g.width)/g.width),r++;for(var c=1;c<=r;c++)t.drawImage(e,-o/2+l*c,-o/2,l,o);t.restore()},dt=function(){if(!h){var t=m;if(g.show&&d&&d.complete&&(t+=g.width),N.width=L.width+2*t,N.height=L.height+2*t,B.clearRect(0,0,N.width,N.height),B.rect(0,0,N.width,N.height),B.fillStyle="#ffffff",B.fill(),B.drawImage(L,t,t,L.width,L.height),v.show){var e=v.text,i=Math.max(5,v.height*L.height*.5);B.font="".concat(i,"px serif"),B.fillStyle=v.bgColor||"#5d5d5d",B.fillRect(t,t,N.width-2*t,v.height*L.height),B.fillStyle=v.color||"white",B.textAlign="center",B.textBaseline="middle",B.fillText(e,N.width/2,v.height*L.height/2+t)}for(var n=function(e){if(y[e].show)if("text"in y[e])B.font="".concat(L.height*y[e].height,"px serif"),B.fillStyle=y[e].color||"white",B.textAlign="left",B.textBaseline="bottom",y[e].width=B.measureText(y[e].text).width/L.height,B.fillText(y[e].text,L.width*y[e].x+t,L.height*y[e].y+t),y[e].isSelected&&ft(y[e]);else if("url"in y[e])if(y[e].svg&&y[e].svg.complete)B.drawImage(y[e].svg,L.width*y[e].x+t,L.height*y[e].y+t,L.height*y[e].width,L.height*y[e].height),y[e].isSelected&&ft(y[e]);else{var i=new Image;i.src=Qi.getSourceRootPath()+y[e].url,i.onload=function(){y[e].svg=i,B.drawImage(i,L.width*y[e].x+t,L.height*y[e].y+t,L.height*y[e].width,L.height*y[e].height),y[e].isSelected&&ft(y[e])}}},o=0;o<y.length;o++)n(o);if(b.show){var s=m;g.show&&d&&d.complete&&(s+=g.width);var a=L.width*b.x+s,r=L.height*b.y+s,l="m",c=.08*L.width*.12,u=.08*L.width/b.cell,f=Math.round(p*u),C=f+"";if(f<10);else{f=Number(C[0]);for(var w=0;w<C.length-1;w++)f*=10;u=f/p}b.width=u*b.cell,b.height=.2*b.width,f>=1e3&&(l="㎞",f=Math.round(f/1e3));var k=r;B.beginPath(),B.moveTo(a,k),B.lineTo(a+b.width,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke();for(var _=0,x=0;x<=b.cell;x++)_=a+x*u,B.beginPath(),B.moveTo(_,k-.1*b.width),B.lineTo(_,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke(),B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="center",B.textBaseline="bottom",B.fillText(x*f,_,k-.1*b.width);B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="left",B.textBaseline="bottom",B.fillText(l,_+1.2*c,k-.1*b.width),b.isSelected&&ft(b)}g.show&&d&&d.complete&&(mt(B,d,m,m,g.width,"top",1),mt(B,d,N.width-g.width-m,m,g.width,"right",1),mt(B,d,N.width-g.width-m,N.height-g.width-m,g.width,"bottom",1),mt(B,d,m,N.height-g.width-m,g.width,"left",1))}},ht=function(t,e){var i=t.x*L.width+e,n=t.y*L.height+e,o=t.width*L.height,s=t.height*L.height;return"text"in t?[{x:i,y:n-s},{x:i+o,y:n-s},{x:i,y:n},{x:i+o,y:n}]:[{x:i,y:n},{x:i+o,y:n},{x:i,y:n+s},{x:i+o,y:n+s}]},pt=function(t){var e,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(n-s*(e=s/a>n/o?n/s:o/a))/2;return(t.clientX-i.left-r)/e},ut=function(t){var e,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(e=s/a>n/o?n/s:o/a,(o-a*e)/2);return(t.clientY-i.top-r)/e},q=function(t){var e,i;if(g.color=t||"#000000",new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(t){q(t)},clear:function(){q("rgba(0,0,0,1)")}}),t){e=f.replace(/fill="[^"]+"/g,'fill="'.concat(t,'"'))}else e=f;i="data:image/svg+xml;base64,"+btoa(Array.from((new TextEncoder).encode(e),(function(t){return String.fromCharCode(t)})).join("")),(d=new Image).setAttribute("crossOrigin","anonymous"),d.src=i,d.onload=function(){g.show&&dt()}},J=function(t){g.url=t,g.url&&((d=new Image).setAttribute("crossOrigin","anonymous"),g.url.endsWith("svg")?fetch(Qi.getSourceRootPath()+g.url).then(function(){var t=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.ok){t.next=5;break}return t.next=3,e.text();case 3:f=t.sent,q(g.color);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):(d.src=Qi.getSourceRootPath()+g.url,d.onload=function(){g.show&&dt()}))},W=function(t){u=t,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}];for(var e=0;e<l.length;e++)if(l[e].id===u){v=l[e].title||v,m=l[e].margin||0==l[e].margin?l[e].margin:m,y=l[e].data||y,(g=l[e].border||g).color=g.color||"#000000",b=l[e].plottingScale||b;break}U(),dt()},U=function(){if(!h){m*=L.width,Z=L.height/140,x.value=v.text,E.checked=v.show,S.value=y[1].text,D.checked=y[1].show,P.checked=y[2].show;for(var t=0;t<C.length;t++)C[t]===y[2].url&&(M[t].checked=!0);O.checked=b.show,g.width=L.width*g.width;var e=m;g.show&&d&&d.complete&&(e+=g.width),N.width=L.width+2*e,N.height=L.height+2*e,F&&(F.checked=y[0].show),I&&(y[0].text?I.setValue(y[0].text):(I.nowBtn&&I.nowBtn(),y[0].text=I.getValue())),z&&R&&H&&(R.value=g.url,z.legp_searchActive(g.url),H.style.backgroundImage="url(".concat(Qi.getSourceRootPath()+g.url,")")),T.checked=g.show,d=null,g&&g.url&&J(g.url)}},r=!1,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}],u="1",h=!0,m=0,v={text:"标题",height:40,bgColor:"#5d5d5d",color:"#ffffff",show:!0},g={show:!0,url:Qi.getSourceRootPath()+"/custom/img/map-border1.svg",width:20},y=[{text:"",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{text:"-",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{x:10,y:100,width:100,height:100,show:!1,isSelected:!1,url:Qi.getSourceRootPath()+"/custom/img/icon-compass1.svg"}],b={cell:2,color:"#ffffff",show:!0,isSelected:!1,x:10,y:100,width:100},C=["/custom/img/icon-compass1.svg","/custom/img/icon-compass2.svg","/custom/img/icon-compass3.svg","/custom/img/icon-compass4.svg"],c&&(c.close(),c=null),t.next=26,new Zi(e,{},{title:"地图打印",left:"5%",top:"10%",ismove:!1});case 26:(c=t.sent)._element.body.className=c._element.body.className+" map-print",(w=document.createElement("div")).innerHTML='\n <div class="left">\n <div class="div-item">\n <div class="title">图件信息</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col template-box">\n <span class="label" style="flex: 0 0 56px;">模板</span>\n <div class="template" style="width: 213px;"></div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">标题</span>\n <input class="title-input" type="text">\n <input class="title-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图日期</span>\n <input class="print-date" type="text" placeholder="YYYY-MM-DD" readonly>\n <input class="print-date-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图单位</span>\n <input class="unit-input" type="text">\n <input class="unit-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col map-border-box">\n <span class="label" style="flex: 0 0 56px;">图框</span>\n <div class="map-border" style="width: 173px;"></div>\n <div class="border-color" style="margin-top: 3px;margin-left: 12px;"></div>\n <input class="map-border-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="title">地图要素</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">指北针</span>\n <input class="compass-checkbox" type="checkbox" style="margin-top: 11px;">\n <div class="row">\n <div class="col" style="margin-left: 10px;flex-wrap: wrap;">\n '.concat(function(){for(var t="",e=0;e<C.length;e++){var i=Qi.getSourceRootPath()+C[e];t+='<div style="display: flex;align-items: center;">\n <input class="compass-radio" type="radio" name="option">\n <img src="'.concat(i,'" alt="" style="width: 38px; height: 38px; margin: 0 5px;">\n </div>')}return t}(),'\n </div>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">比例尺</span>\n <input class="plotting-scale-checkbox" type="checkbox" style="margin-top: 11px;">\n </div>\n </div>\n </div>\n </div>\n <div class="right">\n <div class="map-img-box">\n\n </div>\n </div>\n '),c.contentAppChild(w),k=w.getElementsByClassName("left")[0],_=w.getElementsByClassName("right")[0],x=k.getElementsByClassName("title-input")[0],E=k.getElementsByClassName("title-checkbox")[0],S=k.getElementsByClassName("unit-input")[0],D=k.getElementsByClassName("unit-checkbox")[0],P=k.getElementsByClassName("compass-checkbox")[0],M=k.getElementsByClassName("compass-radio"),O=k.getElementsByClassName("plotting-scale-checkbox")[0],T=k.getElementsByClassName("map-border-checkbox")[0],N=document.createElement("canvas"),B=N.getContext("2d"),_.appendChild(N),(L=new Image).src=i,L.onload=function(){h=!1,vt(),W(u)},x.value=v.text,E.checked=v.show,x.addEventListener("input",(function(){v.text=this.value,L.complete&&dt()})),E.addEventListener("change",(function(){v.show=this.checked,L.complete&&dt()})),S.value=y[1].text,D.checked=y[1].show,S.addEventListener("input",(function(){y[1].text=this.value,L&&L.complete&&dt()})),D.addEventListener("change",(function(){y[1].show=this.checked,L&&L.complete&&dt()})),P.checked=y[2].show,P.addEventListener("change",(function(){y[2].show=this.checked,L&&L.complete&&dt()})),A=a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M[e].addEventListener("change",(function(){this.checked&&(y[2].svg=null,y[2].url=C[e],L&&L.complete&&dt())}));case 1:case"end":return t.stop()}}),t)})),j=0;case 59:if(!(j<M.length)){t.next=64;break}return t.delegateYield(A(j),"t0",61);case 61:j++,t.next=59;break;case 64:O.checked=b.show,O.addEventListener("change",(function(){b.show=this.checked,L&&L.complete&&dt()})),T.checked=g.show,T.addEventListener("change",(function(){g.show=this.checked,d&&d.complete&&dt()})),new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(t){q(t)},clear:function(){q("rgba(0,0,0,1)")}}),setTimeout((function(){V=c._element.foot.getElementsByClassName("close")[0],(G=document.createElement("button")).className="export",G.innerHTML="打印",k.appendChild(V),k.appendChild(G),G.addEventListener("click",(function(){r||(r=!0,G.innerHTML='<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印',yt())}));var t=w.getElementsByClassName("print-date")[0];(F=w.getElementsByClassName("print-date-checkbox")[0]).checked=y[0].show,F.addEventListener("change",(function(){y[0].show=this.checked,L.complete&&dt()})),I=jeDate(t,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){y[0].text=t.val,L.complete&&dt()}}),y[0].text?I.setValue(y[0].text):(I.nowBtn&&I.nowBtn(),y[0].text=I.getValue(),dt());var e=Y(c._element.content.getElementsByClassName("template-box")[0],".template");if(e){e.legp_search(l);for(var i=c._element.content.getElementsByClassName("template")[0].getElementsByTagName("input")[0],n=0;n<l.length;n++)if(l[n].id==u){i.value=l[n].value,e.legp_searchActive(l[n].value);break}i.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===i.value){W(l[t].id);break}}))}var o=[{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border1.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border1.svg",key:0},{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border2.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border2.svg",key:1},{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border3.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border3.svg",key:2},{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border4.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border4.svg",key:3},{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border5.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border5.svg",key:4},{name:'<span style="background-image: url('.concat(Qi.getSourceRootPath(),'/custom/img/map-border6.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border6.svg",key:5}];if(z=Y(c._element.content.getElementsByClassName("map-border-box")[0],".map-border")){z.legp_search(o),(H=document.createElement("span")).className="icon icon-active",H.style.width="calc(100% - 40px)",H.style.height="calc(100% - 12px)",H.style.position="absolute",H.style.top="6px",H.style.left="10px",H.style.pointerEvents="none",H.style.backgroundImage="url(".concat(Qi.getSourceRootPath()+g.url,")"),H.style.backgroundSize="auto 100%",H.style.backgroundRepeat="repeat-x",c._element.content.getElementsByClassName("map-border")[0].getElementsByClassName("cy_datalist")[0].appendChild(H),(R=c._element.content.getElementsByClassName("map-border")[0].getElementsByTagName("input")[0]).style.fontSize=0,R.style.color="transparent";for(var s=0;s<o.length;s++)if(o[s].value==g.url){R.value=o[s].value,z.legp_searchActive(o[s].value);break}R.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===R.value){H.style.backgroundImage="url(".concat(Qi.getSourceRootPath()+o[t].value,")"),J(o[t].value);break}}))}}),0),X=!1,Z=5,K=null,$=!1,Q=!1,tt=null,N.addEventListener("mousedown",(function(t){var e=pt(t),i=ut(t),n=m;if(g.show&&d&&d.complete&&(n+=g.width),v.show&&i>=v.height*L.height+n-Z&&i<=v.height*L.height+n+Z){X=!0;for(var o=0;o<y.length;o++)y[o].isSelected=!1;return K=null,$=!1,Q=!1,void(tt=null)}if(K&&K!==b){var s=.005*N.height;ht(K,n).forEach((function(t,n){e>=t.x-s&&e<=t.x+s&&i>=t.y-s&&i<=t.y+s&&(Q=!0,$=!1,tt=n,et=e,it=i,rt=K.width*L.height,lt=K.height*L.height,"text"in K&&(rt=K.width*L.height,ct=K.height))}))}if(!Q){for(var a=0;a<y.length;a++)y[a].isSelected=!1;b.isSelected=!1,K=null,$=!1,Q=!1,tt=null;for(var r=y.length-1;r>=0;r--)if(y[r].show){if("text"in y[r]&&e>=L.width*y[r].x+n&&e<=L.width*y[r].x+n+L.height*y[r].width&&i>=L.height*y[r].y+n-L.height*y[r].height&&i<=L.height*y[r].y+n){K=y[r],y[r].isSelected=!0,$=!0,et=e,it=i,nt=L.height*y[r].y-L.height*y[r].height,ot=L.width*y[r].x+L.height*y[r].width,st=L.width*y[r].x+n,at=L.height*y[r].y+n,dt();break}if("url"in y[r]&&y[r].svg&&y[r].svg.complete&&y[r].show&&e>=L.width*y[r].x+n&&e<=L.width*y[r].x+n+L.height*y[r].width&&i>=L.height*y[r].y+n&&i<=L.height*y[r].y+n+L.height*y[r].height){K=y[r],y[r].isSelected=!0,$=!0,et=e,it=i,nt=L.height*y[r].y+L.height*y[r].height,ot=L.width*y[r].x+L.height*y[r].width,st=L.width*y[r].x+n,at=L.height*y[r].y+n,dt();break}}b.show&&e>=L.width*b.x+n-.2*b.width&&e<=L.width*b.x+n-.2*b.width+b.width+.6*b.width&&i>=L.height*b.y+n-b.height-.5*b.height&&i<=L.height*b.y+n-.5*b.height+b.height&&(K=b,b.isSelected=!0,$=!0,et=e,it=i,nt=L.height*b.y+n+b.height,ot=L.width*b.x+n+b.width,st=L.width*b.x+n,at=L.height*b.y+n,dt()),K||dt()}})),N.addEventListener("mousemove",(function(t){var e=m;g.show&&d&&d.complete&&(e+=g.width);var i=pt(t),n=ut(t);if(!(i<0||n<0||i>N.width||n>N.height)){if(v.show){var o=m;g.show&&d&&d.complete&&(o+=g.width),n>=v.height*L.height+o-Z&&n<=v.height*L.height+o+Z?N.style.cursor="n-resize":N.style.cursor="default",X&&(v.height=Math.min(Math.max(n-o,30)/L.height,1),dt())}if($){var s=i-et,a=n-it;K.x=(st+s-e)/L.width,K.y=(at+a-e)/L.height,dt()}if(Q){var r,l=i-et,c=n-it;switch(tt){case 0:"text"in K?(r=(rt-l)/rt,K.height=Math.max(10/L.height,ct*r),K.x=(ot-K.width*L.height)/L.width):"url"in K&&(K.x=(ot-K.width*L.height)/L.width,K.y=(nt-K.height*L.height)/L.height,K.width=Math.max(10,rt-l)/L.height,K.height=Math.max(10,lt-c)/L.height);break;case 1:"text"in K?(r=(rt+l)/rt,K.height=Math.max(10/L.height,ct*r)):"url"in K&&(K.width=Math.max(10,rt+l)/L.height,K.height=Math.max(10,lt-c)/L.height,K.y=(nt-K.height*L.height)/L.height);break;case 2:"text"in K?(r=(rt-l)/rt,K.height=Math.max(10/L.height,ct*r),K.x=(ot-K.width*L.height)/L.width,K.y=(nt+K.height*L.height)/L.height):"url"in K&&(K.x=(ot-K.width*L.height)/L.width,K.width=Math.max(10,rt-l)/L.height,K.height=Math.max(10,lt+c)/L.height);break;case 3:"text"in K?(r=(rt+l)/rt,K.height=Math.max(10/L.height,ct*r),K.y=(nt+K.height*L.height)/L.height):"url"in K&&(K.width=Math.max(10,rt+l)/L.height,K.height=Math.max(10,lt+c)/L.height)}dt()}}})),document.addEventListener("mouseup",(function(){X=!1;g.show&&d&&d.complete&&g.width;for(var t=0;t<y.length;t++)y[t].show&&y[t].isSelected&&(nt=L.height*y[t].y-L.height*y[t].height,ot=L.width*y[t].x+L.height*y[t].width,"url"in y[t]&&(nt=L.height*y[t].y+L.height*y[t].height,ot=L.width*y[t].x+L.height*y[t].width),st=y[t].x,at=y[t].y);b.show&&b.isSelected&&(nt=b.y+b.height,ot=b.x+b.width,st=b.x,at=b.y),$=!1,Q=!1,tt=null}));case 79:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var en=function(t,e,i,n){return tn.apply(this,arguments)};var nn;function on(){return(on=o()(a.a.mark((function t(e){var i,n,o=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=o.length>1&&void 0!==o[1]?o[1]:function(){},n=e.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function sn(){return(sn=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,_,E,S=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S.length>1&&void 0!==S[1]?S[1]:{},S.length>2&&void 0!==S[2]?S[2]:function(){},e){t.next=4;break}return t.abrupt("return");case 4:return Zt(),ve(e),nn&&(nn.close(),nn=null),i=e.viewer.scene.screenSpaceCameraController.enableTranslate,n=e.viewer.scene.screenSpaceCameraController.enableTilt,s=e.viewer.scene.screenSpaceCameraController.enableLook,r=1,m=new si,t.next=14,new Zi(e,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(t){d&&(d.desist(),d=null),c&&(c.style.width="0%"),p&&(p.style.left="0%"),u&&(u.style.width="0%"),h&&(h.innerHTML="0%"),d=new E},closeCallBack:function(){e.viewer.scene.screenSpaceCameraController.enableTranslate=i,e.viewer.scene.screenSpaceCameraController.enableTilt=n,e.viewer.scene.screenSpaceCameraController.enableLook=s,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),nn=void 0}});case 14:for((nn=t.sent)._element.body.className=nn._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>当前窗口长宽:<span class="input-width">'.concat(e.viewer.canvas.width,'</span>*<span class="input-height">').concat(e.viewer.canvas.height,'</span>像素</span>\n </div>\n </div>\n <div class="row scale-box" style="align-items: flex-start;">\n <div class="col">\n <span class="label">图片大小</span>\n <div class="input input-select scale"></div>\n <span>倍窗口</span>\n </div>\n </div>\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>输出图片长宽:<span class="output-width">').concat(e.viewer.canvas.width*r,'</span>*<span class="output-height">').concat(e.viewer.canvas.height*r,'</span>像素</span>\n </div>\n </div>\n <div class="row" style="align-items: flex-start; margin-bottom: 20px;">\n <div class="col">\n <span class="label">输出进度</span>\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0%</span>\n <span class="range-node-text">100%</span>\n <div class="range-node-active"><span class="range-node-active-text">0%</span></div>\n </div>\n <input class="progress-input" type="range" max="100" min="0" step="0.01">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n '),nn.contentAppChild(f),e.viewer.scene.screenSpaceCameraController.enableTranslate=!1,e.viewer.scene.screenSpaceCameraController.enableTilt=!1,e.viewer.scene.screenSpaceCameraController.enableLook=!1,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/2)))||(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(v=e.viewer.camera.position),g=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,y=m.cartesian3Towgs84(v,e.viewer),e.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(y.lng,y.lat,g),orientation:{heading:0,pitch:Cesium.Math.toRadians(-90),roll:0},duration:1}),b=[],C=1;C<=10;C++)b.push({name:C,value:C});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],p=f.getElementsByClassName("range-node-active")[0],h=f.getElementsByClassName("range-node-active-text")[0],(w=Y(nn._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(w.legp_search(b),_=nn._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],r=b[0].value,w.legp_searchActive(b[0].value),_.value=b[0].value,_.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value==_.value){r=b[t].value,nn._element.content.getElementsByClassName("output-width")[0].innerHTML=e.viewer.canvas.width*r,nn._element.content.getElementsByClassName("output-height")[0].innerHTML=e.viewer.canvas.height*r;break}}))),E=function(){return x()((function t(){k()(this,t),this.state=!1,this.start()}),[{key:"start",value:function(){if(e.viewer.scene.imageryLayers._layers.length<=1)return this.error="未加载底图!",window.ELEMENT&&window.ELEMENT.Message({message:this.error,type:"warning",duration:1500}),void console.warn(this.error);for(var t=!1,i=0;i<e.viewer.scene.imageryLayers._layers.length;i++){var n=e.viewer.scene.imageryLayers._layers[i];!n||!n.show||n.notes&&"default-base-map"===n.notes||(t=!0)}if(!t)return this.error="未加载底图!",window.ELEMENT&&window.ELEMENT.Message({message:this.error,type:"warning",duration:1500}),void console.warn(this.error);var s=0;this.state=!0;var c=this;!function t(e){var i=2*e;i<=r&&(s++,t(i))}(1),s+=1;var d=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.width/2,e.viewer.canvas.height/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));d||(d=e.viewer.camera.position);for(var f,v,g=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,y=(f=g,v=-40467.74,Math.round(v+80955.31/(1+Math.pow(f/91610.74,7096758e-11)))+1),b=e.viewer.camera.computeViewRectangle(),C={},w=0,k=0,_=0;_<e.viewer.scene.imageryLayers._layers.length;_++){var x=e.viewer.scene.imageryLayers._layers[_];x&&x.show&&x.imageryProvider&&x.imageryProvider.url&&Cesium.Rectangle.intersection(b,x.imageryProvider.rectangle)&&(!x.notes||"default-base-map"!==x.notes)&&w++}var E=100/w,S=!1;!function t(i,n){var d=e.viewer.scene.imageryLayers._layers[i];if(!d)return void(S||(c.error="当前范围内未找到底图数据!",window.ELEMENT&&window.ELEMENT.Message({message:c.error,type:"warning",duration:1500}),console.warn(c.error)));if(!d.show||!d.imageryProvider||!d.imageryProvider.url||!Cesium.Rectangle.intersection(b,d.imageryProvider.rectangle)||d.notes&&"default-base-map"===d.notes){var m=i+=1;return void t(m,n)}S=!0,k++,C[i]={value:0};var f,v=0,g=d.imageryProvider;l||0===l?f=l:((f=y+s-1)>g.maximumLevel&&(f=g.maximumLevel),f<g.minimumLevel&&(f=g.minimumLevel));function _(){var s=g.tilingScheme.positionToTileXY(Cesium.Rectangle.northwest(b),f),l=g.tilingScheme.positionToTileXY(Cesium.Rectangle.southeast(b),f);if(!s||!l){return window.ELEMENT&&window.ELEMENT.Message({message:"超出地球范围!",type:"warning",duration:1500}),void console.warn("超出地球范围!")}var d=g.tilingScheme.getNumberOfXTilesAtLevel(f),m=(g.tilingScheme.getNumberOfYTilesAtLevel(f),s.x),y=s.y,_=l.x,x=l.y,S=(_-m+1)*(x-y+1),D=document.createElement("canvas");D.width=256*(_-m+1),D.height=256*(x-y+1);var P=D.getContext("2d"),M=g.tilingScheme.tileXYToRectangle(_,x,f),O=g.tilingScheme.tileXYToRectangle(m,y,f),T=new Cesium.Rectangle(O.west,M.south,M.east,O.north),N=b,B=N.west-T.west,L=T.east-N.east,A=T.north-N.north,j=N.south-T.south,I=B/(T.east-T.west);I===1/0&&(I=0);var F=L/(T.east-T.west);F===1/0&&(F=0);var R=A/(T.north-T.south);R===1/0&&(R=0);var z=j/(T.north-T.south);z===1/0&&(z=0);var H=D.width*I,V=D.height*R,G=D.width*F,U=D.height*z;D.width=D.width-H-G,D.height=D.height-V-U,0==D.width&&(D.width=1),0==D.height&&(D.height=1);for(var W=x,Y=[],J=x;J>=y;J--)for(var q=_;q>=m;q--)Y.push({x:q,y:J});var X={count:0},Z=0,K=-1,$={count:0},Q=0;function tt(){$.count=0,Q=0;for(var t=30*++K;t<30*(K+1);t++){if(t>=Y.length)return;et(t)}}function et(t){if(c.state)try{var e=Y[t].x;e<0&&(e+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P.drawImage(n,256*(Y[t].x-m)-parseFloat(H.toFixed(0)),256*(Y[t].y-y)-parseFloat(V.toFixed(0)),256,256),v++,X.count++,$.count++;case 4:case"end":return e.stop()}}),e)}))),n.onerror=function(){v++,X.count++,$.count++},i=-1!==g.url.indexOf("{x}")&&-1!==g.url.indexOf("{y}")&&-1!==g.url.indexOf("{z}")?g.url.replace(/\{x\}/g,e).replace(/\{y\}/g,Y[t].y).replace(/\{z\}/g,f):-1!==g.url.indexOf("{TileMatrix}")&&-1!==g.url.indexOf("{TileRow}")&&-1!==g.url.indexOf("{TileCol}")?g.url.replace(/\{TileCol\}/g,e).replace(/\{TileRow\}/g,Y[t].y).replace(/\{TileMatrix\}/g,f):g._layer&&g._style&&g._tileMatrixSetID&&g._format?g.url+"&tilematrix=".concat(f,"&layer=").concat(g._layer,"&style=").concat(g._style,"&tilerow=").concat(W,"&tilecol=").concat(e,"&tilematrixset=").concat(g._tileMatrixSetID,"&format=").concat(g._format):g.url+"tile/".concat(f,"/").concat(Y[t].y,"/").concat(e),n.src=i}catch(t){v++,X.count++,$.count++}}Object.defineProperty($,"count",{get:function(){return Q},set:function(t){(Q=t)>=30&&tt()}}),Object.defineProperty(X,"count",{get:function(){return Z},set:function(o){Z=o,C[i].value=v/S*E;var s=0;for(var a in C)s+=C[a].value;if(u.style.width=.99*s+"%",p.style.left=.99*s+"%",h.innerHTML=Math.floor(.99*s*100)/100+"%",Z===(_-m+1)*(x-y+1)){var l=D.getContext("2d"),d=D.cloneNode(!0),f=d.getContext("2d"),g=l.getImageData(0,0,D.width,D.height);if(f.putImageData(g,0,0),D.width=e.viewer.canvas.width*r,D.height=e.viewer.canvas.height*r,l.drawImage(d,0,0,D.width,D.height),n){if(n.getContext("2d").drawImage(D,0,0),k!=w){var P=i+=1;return void t(P,n)}var M=n.toDataURL("image/jpeg",.95),O=document.createElement("canvas"),T=O.getContext("2d");O.width=n.width/r,O.height=n.height/r,T.drawImage(n,0,0,O.width,O.height),en(e,O.toDataURL("image/jpeg",.95),b,M),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}else{if(k!=w){var N=i+=1;return void t(N,D)}var B=D.toDataURL("image/jpeg",.95),L=document.createElement("canvas"),A=L.getContext("2d");L.width=D.width/r,L.height=D.height/r,A.drawImage(D,0,0,L.width,L.height),en(e,L.toDataURL("image/jpeg",.95),b,B),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}}}}),g._readyError?X.count=(_-m+1)*(x-y+1):tt()}if(g._readyError)return C[i]={value:E},void _();g.readyPromise.then((function(){_()})).catch((function(t){g._readyError=!0,C[i]={value:E},_()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var an=i(13),rn=i.n(an);function ln(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return cn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?cn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var un=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){var i=this;this.element={};for(var n=function(){if(!e[o]||!e[o].attributes)return 1;var n,s={input:[],change:[],blur:[],click:[]},a=!1,r=[],l=ln(e[o].attributes);try{var c=function(){var l=n.value;switch(l.name){case"@model":a=!0,"checkbox"==e[o].type?(s.change.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):("number"==e[o].type?(s.input.push((function(e){if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),"."==e.data||"-"==e.data&&!e.target.value||(!e.target.max&&!e.target.min||i<=Number(e.target.max)&&i>=Number(e.target.min))&&(t[l.value]=i)}})),s.blur.push((function(e){var i=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[l.value]=i}))):s.input.push((function(e){t[l.value]=e.target.value})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],r.push(l.name);break;case"@click":a=!0,s.click.push((function(e){"function"==typeof t[l.value]&&t[l.value](e)})),r.push(l.name)}};for(l.s();!(n=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<r.length;u++)e[o].attributes.removeNamedItem(r[u]);if(a){var p=function(t){s[t].length>0&&e[o].addEventListener(t,(function(e){for(var i=0;i<s[t].length;i++)s[t][i](e)}))};for(var h in s)p(h)}},o=0;o<e.length;o++)n()}}])}();C()(un,"event",{});var pn=un,hn=function(){return x()((function t(e,i,n){k()(this,t);for(var o=document.getElementById(e),s=o.getElementsByTagName("DIV-cy-tab-pane"),a='<div class="DIV-cy-tab-top">',r='<div class="DIV-cy-tab-content">',l=0,c=0;c<s.length;c++){var u=!1;if(n&&n.tabHide&&Array.isArray(n.tabHide))for(var p=0;p<n.tabHide.length;p++)if(s[c].getAttribute("label")===n.tabHide[p]){u=!0;break}if(!u){var h="display: none;",d="";0==l&&(h="",d="is-active"),a=a+'\n <div class="DIV-cy-tab-pane-title">\n <div class="DIV-cy-tab-pane-title-p '+d+'" tabindex="'+l+'"><span>'+s[c].getAttribute("label")+"</span></div>\n </div>\n ",r=r+'<div class="DIV-cy-tab-content-pane '.concat(s[c].className,'" style="')+h+'">'+s[c].innerHTML+"</div>",l++}}a+="</div>",r+="</div>";var m=document.createElement("div");m.setAttribute("id",e),m.setAttribute("class","DIV-cy-tabs"),m.innerHTML=a+r,o.parentNode.insertBefore(m,o),o.parentNode.removeChild(o);for(var f=m.getElementsByClassName("DIV-cy-tab-pane-title-p"),v=0;v<f.length;v++)f[v].addEventListener("click",(function(t){for(var e=t.target.getAttribute("tabindex"),i=m.getElementsByClassName("DIV-cy-tab-content-pane"),n=0;n<i.length;n++)n===parseInt(e)?(i[n].style.display="",f[n].className="DIV-cy-tab-pane-title-p is-active"):(i[n].style.display="none",f[n].className="DIV-cy-tab-pane-title-p");i[parseInt(e)].style.display=""}));this.clickTabCallBack=i}),[{key:"clickTabCallBack",value:function(){this.clickTabCallBack&&this.clickTabCallBack()}}])}();function dn(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function mn(t,e,i){return t.set(vn(t,e),i),i}function fn(t,e){return t.get(vn(t,e))}function vn(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var gn=new WeakMap,yn=new WeakMap,bn=new WeakMap,Cn=new(function(){return x()((function t(){k()(this,t),dn(this,gn,void 0),dn(this,yn,void 0),dn(this,bn,void 0),this.richTextBox=document.createElement("div"),this.richTextBox.className="richText-box",this.richTextBox.style.position="absolute",this.richTextBox.style.width="60%",this.richTextBox.style.height="70%",this.richTextBox.style.backgroundColor="#ffffff",this.richTextBox.style.zIndex="999999",this.richTextBox.style.left="20%",this.richTextBox.style.top="15%",this.richTextBox.style.display="flex",this.richTextBox.style.flexDirection="column",this.uploadImageServer,this.uploadVideoServer}),[{key:"open",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=this;this.title=i,this.objectId=t,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var r='\n <div class="richText-box-mask"></div>\n <div class="richText-content">\n <div class="richText-header">\n <p>'.concat(i,'</P>\n <i class="close">✕</i>\n </div>\n <div id="toolbar-container"></div>\n <div id="editor-container"></div>\n <div class="richText-footer">\n <button class="primary">确认</button>\n <button class="cancel">取消</button>\n </div>\n </div>\n ');this.richTextBox.innerHTML=r,document.body.appendChild(this.richTextBox);var l=window.wangEditor,c=l.createEditor,u=l.createToolbar,p={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",maxFileSize:52428800,base64LimitSize:52428800,server:this.uploadImageServer},uploadVideo:{maxFileSize:524288e3,server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(t){t.getHtml()}};this.editor=c({selector:"#editor-container",html:"<p><br></p>",config:p,mode:"default"});var d={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:d,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var m=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];m.addEventListener("click",(function(){e.close()})),f.addEventListener("click",(function(){var t=e.editor.getHtml();e.primaryCallBack(t),e.close()})),v.addEventListener("click",(function(){e.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(t=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.host=this.host||h(),i=this.host.endsWith("yjearth4.0")?this.host+"/api/v1/richText/upload":this.host+"/yjearth4.0/api/v1/richText/upload",(n=new FormData).append("file",e),t.next=7,fetch(i,{method:"post",body:n,headers:{token:m(),Authorization:"Bearer "+m()}});case 7:if(200!==(o=t.sent).status){t.next=14;break}return t.next=11,o.json();case 11:if(200!==(s=t.sent).code&&0!==s.code){t.next=14;break}return t.abrupt("return",s.data.url);case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return fn(gn,this)},set:function(t){mn(gn,this,t)}},{key:"customUploadContent",get:function(){return fn(yn,this)},set:function(t){mn(yn,this,t)}},{key:"primaryCallBack",get:function(){return fn(bn,this)},set:function(t){mn(bn,this,t)}}]);var t}());function wn(t,e,i,n,o){var s=Math.ceil(e/i)||1;!function i(){var a,r="<li class='list-items' pagenumber=1>1</li>",l="<li class='list-items' pagenumber=".concat(s,">").concat(s,"</li>"),c="<li class='list-items btnGoLeft'>...</li>",u="<li class='list-items btnGoRight'>...</li>",p="<div style='line-height:20px;' class='pageTips'>共 ".concat(e," 条</div > ");if(a="<li class='list-items lbl btnPrev'>‹</li>",s<=6)for(var h=1;h<=s;h++)a+="<li class='list-items' pagenumber=".concat(h,">").concat(h,"</li>");else if(n<=4){for(var d=1;d<=5;d++)a+="<li class='list-items' pagenumber=".concat(d,">").concat(d,"</li>");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="<li class='list-items' pagenumber=".concat(m,">").concat(m,"</li>")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="<li class='list-items' pagenumber=".concat(f,">").concat(f,"</li>");a+=u,a+=l}a+="<li class='list-items lbr btnNext'>›</li>",a+=p,t.innerHTML=a,t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),t.querySelectorAll("li[pagenumber]").forEach((function(e){e.onclick=function(){n=Number(this.innerHTML),t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),t.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),t.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n<s&&(n++,a="",i(),o&&o(n))}));var v=t.getElementsByClassName("btnGoLeft")[0];v&&(v.addEventListener("mouseenter",(function(){this.innerHTML="<"})),v.addEventListener("mouseleave",(function(){this.innerHTML="..."})),v.addEventListener("click",(function(){n>10&&(n-=10,a="",i(),o&&o(n))})));var g=t.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n<s-10&&(n+=10,a="",i(),o&&o(n))})))}()}function kn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function _n(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?kn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):kn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function xn(t){var e=h();t.cameraSelect=function(n){if(!t.attributeSelect)return;for(var o=!1,s=0;s<t.attributeSelect.length;s++)if("camera"===t.attributeSelect[s].key){o=!0;break}if(!o)return;var a,r=n;if(n=n&&"object"!==N()(n)?n:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var l=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(a=t._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0],!l)return;if(!a)return;wn(l,1,10,1);var c="",u={cameraName:t.cameraName,page:n,pageSize:5},p=new URLSearchParams(u).toString();c=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/cameraData/list?").concat(p):"".concat(e,"/yjearth4.0/api/v1/cameraData/list?").concat(p);if(fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&a))return;var o=a.getElementsByClassName("pagination")[0],s=t._DialogObject._element.content.getElementsByClassName("camera-table")[0],r=s.getElementsByClassName("table-body")[0];if(r.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){wn(o,e.data.total,5,1,(function(e){t.cameraSelect(e)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat("ID"in e.data.list[n]?e.data.list[n].ID:e.data.list[n].id,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[n].cameraName,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(i[e.data.list[n].type],'</div>\n <div class="td center" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[n].ip,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[n].port,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[n].userName,'</div>\n <div class="td center">').concat(e.data.list[n].passWord||e.data.list[n].password,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){t.attributeCamera=[],t.attributeCamera.push(e.data.list[n]);for(var i=0;i<l.length;i++)l[i]!==a&&(l[i].checked=!1)}else{var o=t.attributeCamera.filter((function(t){return"ID"in e.data.list[n]?t.ID!==e.data.list[n].ID:t.id!==e.data.list[n].id}));t.attributeCamera=o}})),r.appendChild(s);for(var c=0;c<t.attributeCamera.length;c++)if("ID"in e.data.list[n]?t.attributeCamera[c].ID===e.data.list[n].ID:t.attributeCamera[c].id===e.data.list[n].id){a.checked=!0;break}},u=0;u<e.data.list.length;u++)c(u)}e.data&&e.data.total&&wn(o,e.data.total,5,n,(function(e){t.cameraSelect(e)}))}else wn(o,1,5,1),s.getElementsByClassName("table-empty")[0].style.display="flex",r.style.display="none"}else console.error(e.message)}))})),!r){var h=new URLSearchParams({page:1,pageSize:99999999}).toString();c=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/cameraData/list?").concat(h):"".concat(e,"/yjearth4.0/api/v1/cameraData/list?").concat(h),fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&a))return;if(e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data)if(e.data.list)for(var i=t.attributeCamera.length-1;i>=0;i--){for(var n=!1,o=0;o<e.data.list.length;o++){if("ID"in e.data.list[o]&&t.attributeCamera[i].ID===e.data.list[o].ID){n=!0;break}if("id"in e.data.list[o]&&t.attributeCamera[i].id===e.data.list[o].id){n=!0;break}}n||t.attributeCamera.splice(i,1)}else t.attributeCamera=[];else t.attributeCamera=[]}else console.error(e.message)}))}))}},t.ISCSelect=function(i){if(!t.attributeSelect)return;for(var n=!1,o=0;o<t.attributeSelect.length;o++)if("isc"===t.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var a=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=t._DialogObject._element.content.getElementsByClassName("attribute-content-isc")[0],!a)return;if(!s)return;wn(a,1,10,1);var r="",l=new URLSearchParams({page:i,page_size:5}).toString();r=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/isc/list?").concat(l):"".concat(e,"/yjearth4.0/api/v1/isc/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&s))return;var n=s.getElementsByClassName("pagination")[0],o=t._DialogObject._element.content.getElementsByClassName("isc-table")[0],a=o.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){wn(n,e.data.total,5,1,(function(e){t.ISCSelect(e)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat("ID"in e.data.list[i]?e.data.list[i].ID:e.data.list[i].id,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[i].name,'</div>\n <div class="td center" style="width: 180px; flex: 0 180px; min-width: 180px;">').concat(e.data.list[i].status?"在线":"离线","</div>\n </div>"),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)t.attributeISC.push(e.data.list[i]);else{var n=t.attributeISC.filter((function(t){return"ID"in e.data.list[i]?t.ID!==e.data.list[i].ID:t.id!==e.data.list[i].id}));t.attributeISC=n}})),a.appendChild(o);for(var r=0;r<t.attributeISC.length;r++)if("ID"in e.data.list[i]?t.attributeISC[r].ID===e.data.list[i].ID:t.attributeISC[r].id===e.data.list[i].id){s.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&wn(n,e.data.total,5,i,(function(e){t.ISCSelect(e)}))}else wn(n,1,5,1),o.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))},t.goodsSelect=function(i){if(!t.attributeSelect)return;for(var n=!1,o=0;o<t.attributeSelect.length;o++)if("goods"===t.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var a=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=t._DialogObject._element.content.getElementsByClassName("attribute-content-goods")[0],!a)return;if(!s)return;var r="",l=new URLSearchParams({page:i,page_size:999999}).toString();r=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/goods/list?").concat(l):"".concat(e,"/yjearth4.0/api/v1/goods/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&s))return;s.getElementsByClassName("pagination")[0];var i=t._DialogObject._element.content.getElementsByClassName("goods-table")[0],n=i.getElementsByClassName("table-body")[0];if(n.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){t._allGoodsList=e.data.list;for(var o=t.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r<e.data.list.length;r++)if("ID"in e.data.list[r]){if(e.data.list[r].ID===t.attributeGoods[o].ID){a=!0;break}}else if("id"in e.data.list[r]&&e.data.list[r].id===t.attributeGoods[o].id){a=!0;break}a||t.attributeGoods.splice(o,1)}i.getElementsByClassName("table-empty")[0].style.display="none",n.style.display="block",n.style.maxHeight="150px";for(var l=function(i){var o='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(e.data.list[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<t.attributeGoods.length;r++)"ID"in e.data.list[i]?e.data.list[i].ID===t.attributeGoods[r].ID&&(a.value=t.attributeGoods[r].cnt,t.attributeGoods[r].name=e.data.list[i].name):"id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id&&(a.value=t.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(_n({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(_n({},l))}}})),n.appendChild(s)},c=0;c<e.data.list.length;c++)l(c)}e.data&&e.data.total}else i.getElementsByClassName("table-empty")[0].style.display="flex",n.style.display="none"}else console.error(e.message)}))}))},t.goodsFilter=function(){var e=[];if(t._allGoodsList&&t._allGoodsList.length){var i=t._DialogObject._element.content.getElementsByClassName("goods-select-input")[0].value;e=t._allGoodsList.filter((function(t){return-1!==t.name.indexOf(i)}))}var n=t._DialogObject._element.content.getElementsByClassName("goods-table")[0],o=n.getElementsByClassName("table-body")[0];if(o.innerHTML="",e.length>0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(e[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<t.attributeGoods.length;r++)"ID"in e[i]?e[i].ID===t.attributeGoods[r].ID&&(a.value=t.attributeGoods[r].cnt):"id"in e[i]&&e[i].id===t.attributeGoods[r].id&&(a.value=t.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(_n({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(_n({},l))}}})),o.appendChild(s)},a=0;a<e.length;a++)s(a)}else n.getElementsByClassName("table-empty")[0].style.display="flex",o.style.display="none"},t.cameraName="",t.ISCName="";var i={1:"海康",2:"大华"};return'<div class="attribute">\n <div class="row">\n <div class="col attribute-select-box">\n <span class="label" style="line-height: 32px;">内容类型</span>\n <div class="input input-select attribute-select"></div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <button @click="openRichTextEditor">打开文本编辑器</button>\n </div>\n </div>\n </div>\n <div class="row attribute-content attribute-content-link">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input link_add" type="text">\n <i class="link_add_btn" @click="_addLink"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="cameraName" style="width: 100px;">\n <button class="select btn" @click="cameraSelect">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="attribute-content attribute-content-isc">\n \x3c!-- <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="ISCName" style="width: 100px;">\n <button class="select btn" @click="ISCSelect">搜索</button>\n </div>\n </div> --\x3e\n <div>\n <div class="table isc-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 74px; flex: 0 74px;min-width: 74px;">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="row attribute-content attribute-content-vr">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input vr_add" type="text">\n <i class="vr_add_btn" @click="_addRr"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-vr">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-goods">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input goods-select-input" type="text" style="width: 180px;margin-right: 10px;">\n <button class="select btn" @click="goodsFilter">搜索</button>\n </div>\n </div>\n <div class="table goods-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="th" style="flex: 0 0 280px;">名称</div>\n <div class="th">数量</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="td" style="flex: 0 0 280px;">名称</div>\n <div class="td">数量</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n </div>'}function En(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: unset;">名称</span>\n <input class="input" type="text" @model="labelText">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div style="width: 46%;">\n <div class="row">\n <p class="lable-left-line">WGS84坐标</p>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1 alt-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div style="width: 50%;">\n <div class="row coordinate-select-box">\n <div class="lable-left-line">转换坐标选择\n <div class="input input-select coordinate-select" style="margin-left: 20px;"></div>\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">X轴:</span>\n <input style="border: none;background: none;" class="input convert-x" readonly="readonly">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">Y轴:</span>\n <input style="border: none;background: none;" class="input convert-y" readonly="readonly">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">Z轴:</span>\n <input style="border: none;background: none;" class="input convert-z" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="near">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="far">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="point-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col height-box">\n <span class="label" style="flex: 0 0 56px;">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">小数格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分秒格式</span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div style="flex: 1;">\n <div class="proj-input-box">\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 56%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 70%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lng-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lat-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n <div>\n <h4>图标设置</h4>\n <div class="row" style="margin-bottom: 10px;">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="billboardShow">\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">图标</span>\n <div class="image-box" @click="clickChangeImage">\n <img class="image" src="" alt="" @model="billboardImage">\n </div>\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">默认图标</span>\n <div class="image-box" @click="clickChangeDefaultImage">\n <img class="image" src="" alt="" @model="billboardDefaultImage">\n </div>\n </div>\n <div class="col">\n <span class="label">图标倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0.1" max="99" @model="billboardScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <h4>文字设置</h4>\n <div class="row">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">文字大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">文字颜色</span>\n <div class="labelColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="效果">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">扩散</span>\n <input class="btn-switch" type="checkbox" @model="diffuseShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="diffuseRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="diffuseDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="diffuseColor"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">雷达</span>\n <input class="btn-switch" type="checkbox" @model="scanShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="scanRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="scanDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="scanColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">指令</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n\x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">设置操作点</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n\x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n <span class="custom-divider"></span>\n ')}function Sn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Dn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Sn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Sn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Pn(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Mn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),i=Pn(this,e,[t,n]),t&&t.viewer?(i.sdk=t,i.viewer=t.viewer,i.options=Dn({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.options.host=i.options.host||h(),i.setDefaultValue(),i):Ui()(i)}return qi()(e,t),x()(e,[{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label&&(this.label.text=t),this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t),this.entity&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&this.label&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"display",value:function(){this.show=!0}},{key:"hide",value:function(){this.show=!1}},{key:"flicker",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,i=arguments.length>1?arguments[1]:void 0;this.flickerAnimate&&TWEEN.remove(this.flickerAnimate),this.flickerAnimate=new TWEEN.Tween({degree:1}).to({degree:0},e/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sdk.viewer){e.next=3;break}return TWEEN.remove(t.flickerAnimate),e.abrupt("return");case 3:t.show&&(1===i.degree&&(t.entity&&(t.entity.show=!0),t.labelShow&&t.label&&(t.label.show=!0),t.text&&t.text&&(t.text.show=!0)),0===i.degree&&(t.entity&&(t.entity.show=!1),t.labelShow&&t.label&&(t.label.show=!1),t.text&&t.text&&(t.text.show=!1)));case 4:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(e){TWEEN.remove(t.flickerAnimate),t.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Dn({},this.options.position):this.options.positions?l=Dn({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=Dn({},this.options.line.positions[0]):this.options.center?l=Dn({},this.options.center):this.options.start?l=Dn({},this.options.start):this.geojson?(c=turf.bbox(this.geojson),l={lng:c[0],lat:c[1]}):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),be(this.sdk,this.options.id),re(this.sdk,this.options.id);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=le().sdkD;e&&this.sdk===e?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){Ct.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.clickCallBack&&this.options&&this.options.id&&dt(this.options.id,this.leftClickCB,this),this.clickCallBack=t}}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=le().sdkD;e&&this.sdk===e?null==this.rightClickCallBack&&this.entity&&this.entity.id&&function(t,e,i){wt.set(t,{callback:e,that:i})}(this.entity.id,this.rightClickCB,this):null==this.rightClickCallBack&&this.entity&&this.entity.id&&mt(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=t}}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=le().sdkD;e&&this.sdk===e?null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&function(t,e,i){kt.set(t,{callback:e,that:i})}(this.entity.id,this.mouseMoveCB,this):null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ft(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=t}}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=16;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=Dn({},n),this.options.position?o=Dn({},this.options.position):this.options.positions?o=Dn({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=Dn({},this.options.line.positions[0]):this.options.center?o=Dn({},this.options.center):this.options.start?o=Dn({},this.options.start):this.geojson?(r=turf.bbox(this.geojson),o={lng:r[0],lat:r[1]}):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.sent;case 13:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView=void 0}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"rightClickCB",value:function(t,e,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(t,e,i)}},{key:"mouseMoveCB",value:function(t,e,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(t,e,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var t,e,i;this.options.id=null!==(t=this.options.id)&&void 0!==t?t:this.getGuid(),this.options.show=null===(e=this.options.show)||void 0===e||e,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,s}(si);function On(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">透明度</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">波纹层数</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="10" @model="count">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n <div class="col">\n <span class="label">扩散速度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="0" max="20" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-radius-unit-box" style="margin: 0;">\n <span class="label">半径单位</span>\n <div class="input-radius-unit"></div>\n </div>\n <div class="col" style="margin: 0;">\n </div>\n <div class="col" style="margin: 0;">\n </div>\n </div>\n <div class="row circle-content-box">\n <div class="col">\n <span class="label"></span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="circle-diffuse-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}var Tn=[{name:"黑体",value:"黑体",font:"SimHei",key:"0"},{name:"思源黑体",value:"思源黑体",font:"SourceHanSansTi",key:"1"},{name:"庞门正道标题体",value:"庞门正道标题体",font:"PMZDBTTi",key:"2"},{name:"数黑体",value:"数黑体",font:"AlimamaShuHeiTi",key:"3"}];function Nn(){return Tn}function Bn(t){for(var e=0;e<Tn.length;e++)if(Tn[e].key==t)return Tn[e].font}function Ln(t){for(var e=0;e<Tn.length;e++)if(Tn[e].key==t)return Tn[e].name}function An(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function jn(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function In(t,e){return t.get(Fn(t,e))}function Fn(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Rn=new WeakMap,zn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;k()(this,e),jn(i=An(this,e,[t,n]),Rn,void 0),i.model=o,i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=n.scaleByDistance||!1,i.options.show=!n.show&&!1!==n.show||n.show,i.options.text=n.text;for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>40&&(s[a]=s[a].slice(0,40-s[a].length));return s.length>10&&s.splice(10-s.length),i.options.text=s.join("\n"),i.options.fontFamily=n.fontFamily||0,i.font=Bn(i.options.fontFamily)||"SimHei",i.options.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#00ffff80",i.options.color=n.color||"#ffffff",i.options.ground=!n.ground&&!1!==n.ground||n.ground,i.options.pixelOffset=n.pixelOffset||0===n.pixelOffset?n.pixelOffset:20,i.options.backgroundColor=n.backgroundColor||["#00ffff80","#00ffff80"],i.event=new X(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return qi()(e,t),x()(e,[{key:"create",value:(i=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this,this.options.position[2]||0===this.options.position[2]){t.next=5;break}return t.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=t.sent;case 5:this.originalOptions=Hn(this.options),i=this.options.id+"-label",(n=this.sdk.viewer.entities.getById(i))&&this.sdk.viewer.entities.remove(n),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(e.model){if(e.model.isMove){var t=e.model.customScale.x;e.model.customScale.y>t&&(t=e.model.customScale.y),e.model.customScale.z>t&&(t=e.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]+2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),n=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]-2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=e.viewer.scene.drillPickFromRay(a,5),l=0;l<r.length;l++)if(r[l].object&&r[l].object.id&&r[l].object.id===e.model.id){var c=e.cartesian3Towgs84(r[l].position,e.sdk.viewer);e.options.position[0]=c.lng,e.options.position[1]=c.lat,e.options.position[2]=c.alt;break}}return Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2])}var u;return(u=Cesium.Cartesian3).fromDegrees.apply(u,L()(e.options.position))}),!1),billboard:{image:this.getcanvas(),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1),scaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0,pixelOffsetScaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0}});case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,t[2]||0===t[2])this.options.position=L()(t);else{var i=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:t[0],lat:t[1]},i).then((function(i){t[2]=i,e.options.position=L()(t)}))}}},{key:"show",get:function(){return this.options.show},set:function(t){var e=this;if(this.options.show=t,this.entity)if(this.entity.show=t,this.model){var i=this.model.customScale.x;this.model.customScale.y>i&&(i=this.model.customScale.y),this.model.customScale.z>i&&(i=this.model.customScale.z);for(var n=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]+2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),o=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]-2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),s=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(s,s),r=new Cesium.Ray(n,a),l=this.viewer.scene.drillPickFromRay(r,5),c=0;c<l.length;c++)if(l[c].object&&l[c].object.id&&l[c].object.id===this.model.id){var u=this.cartesian3Towgs84(l[c].position,this.sdk.viewer);this.options.position[0]=u.lng,this.options.position[1]=u.lat,this.options.position[2]=u.alt;break}}else if(this.options.ground){var p=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]},p).then((function(t){e.options.position[2]=t}))}}},{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t;for(var e=this.options.text.split("\n"),i=0;i<e.length;i++)e[i].length>40&&(e[i]=e[i].slice(0,40-e[i].length));e.length>10&&e.splice(10-e.length),this.options.text=e.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e<this.near&&(e=this.near),this.options.far=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"fontSize",get:function(){return this.options.fontSize},set:function(t){this.options.fontSize=Number(t),this.entity&&this.updateBillboardImage()}},{key:"fontFamily",get:function(){return this.options.fontFamily},set:function(t){this.options.fontFamily=t||0,this.font=Bn(this.options.fontFamily)||"SimHei",this.updateBillboardImage()}},{key:"lineWidth",get:function(){return this.options.lineWidth},set:function(t){this.options.lineWidth=Number(t)||0===Number(t)?Number(t):4,this.entity&&this.updateBillboardImage()}},{key:"pixelOffset",get:function(){return this.options.pixelOffset},set:function(t){this.options.pixelOffset=Number(t),this.entity&&this.updateBillboardImage()}},{key:"updateBillboardImage",value:function(){var t,e,i,n=this;clearTimeout(In(Rn,this)),t=Rn,e=this,i=setTimeout((function(){clearTimeout(In(Rn,n)),n.entity.billboard.image=n.getcanvas()}),500),t.set(Fn(t,e),i)}},{key:"lineColor",get:function(){return this.options.pixelOffset},set:function(t){this.options.lineColor=t||"#00ffff80",this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"backgroundColor",get:function(){return this.options.backgroundColor},set:function(t){this.options.backgroundColor=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"ground",get:function(){return this.options.ground},set:function(t){this.options.ground=t}},{key:"getcanvas",value:function(){var t=document.createElement("canvas"),e=t.getContext("2d");e.font=this.options.fontSize+"px "+this.font;for(var i=this.options.text.split("\n"),n=0,o=0,s=0;s<i.length;s++){var a=i[s],r=e.measureText(a).width;r>n&&(n=r),o+=this.options.fontSize}o=o+20+5*(i.length-1),(n+=30)<this.options.lineWidth&&(n=this.options.lineWidth),t.width=n,t.height=this.options.pixelOffset+o;var l=e.createLinearGradient(0,0,n,o+20);l.addColorStop(0,this.options.backgroundColor[0]),l.addColorStop(1,this.options.backgroundColor[1]),e.fillStyle=l,e.fillRect(0,0,n,o),e.fillStyle=this.options.color,e.font=this.options.fontSize+"px "+this.font;for(var c=0,u=0;u<i.length;u++){var p=e.measureText(i[u]).width;c<p&&(c=p)}for(var h=(n-(c+=30))/2,d=0;d<i.length;d++){var m=i[d];this.options.fontSize<10?e.fillText(m,15+h,this.options.fontSize*(d+1)+10+5*d):e.fillText(m,15+h,this.options.fontSize*(d+1)+100/this.options.fontSize+5*d)}e.strokeStyle=this.options.lineColor,e.setLineDash([4,4]),e.lineWidth=this.options.lineWidth,e.beginPath(),e.moveTo(n/2,o),e.lineTo(n/2,o+this.options.pixelOffset),e.stroke(),e.closePath();var f=document.createElement("canvas"),v=f.getContext("2d");return f.width=t.width+10,f.height=t.height+10,v.drawImage(t,5,5),f}},{key:"remove",value:function(){this.sdk.viewer.entities.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var i}(Mn),Hn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)e[i]=Hn(t[i]);else e=t;return e},Vn=function(){return x()((function t(e){k()(this,t),t.prototype.hasOwnProperty("color")||Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color")}),t.prototype.hasOwnProperty("speed")||Object.defineProperties(t.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),t.prototype.hasOwnProperty("transparency")||Object.defineProperties(t.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),t.prototype.hasOwnProperty("count")||Object.defineProperties(t.prototype,{count:Cesium.createPropertyDescriptor("count")}),t.prototype.hasOwnProperty("gradient")||Object.defineProperties(t.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=e.id,this.color=e.color||new Cesium.Color(1,1,1,1),this.colors=e.colors||{},this.speed=e.speed,this.transparency=e.transparency,this.count=e.count,this.gradient=e.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(t,e){return e-t}));for(var s=0;s<n.length;s++){var a=this.colors[n[s]];i+="\n if(dis < float(".concat(Number(n[s])/2,")) {\n material.diffuse = 1.5 * vec4(").concat(a.red,",").concat(a.green,",").concat(a.blue,",").concat(a.alpha,").rgb;\n }\n ")}this._source="\n uniform vec4 color;\n uniform float speed;\n uniform float count;\n uniform float gradient;\n uniform float transparency;\n uniform float frameNumber;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(frameNumber * speed / 30000.0);\n vec3 str = materialInput.str;\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n }else {\n ".concat(i,"\n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n for(int i = 0; i <= 99; i++){\n if(float(i) <= count){\n disNum = perDis * float(i) - dis + per / count;\n if(disNum > 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n }\n else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient))) * transparency;\n }\n }\n }\n }\n return material;\n }\n "),this._CircleRippleMaterialType="CircleRippleMaterialType"+this.id,Cesium.Material._materialCache.addMaterial(this._CircleRippleMaterialType,{fabric:{type:this._CircleRippleMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:3,transparency:1,count:4,gradient:.2,frameNumber:Cesium.getTimestamp()},source:this._source},translucent:function(t){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return this._CircleRippleMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.count=this.count,e.gradient=this.gradient,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(t){return this===t||t instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.count,t.count)&&Cesium.Property.equals(this.transparency,t.transparency)&&Cesium.Property.equals(this.gradient,t.gradient)}}])}();function Gn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Un(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Wn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Yn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Yn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Jn(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var qn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=Jn(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#1FA8E3",i.options.colors=n.colors||[],i.options.transparency=n.transparency||0===n.transparency?n.transparency:1,i.options.transparency>1&&(i.options.transparency=1),i.options.speed=n.speed||0===n.speed?n.speed:5,i.options.count=n.count||0===n.count?n.count:3,n.count||0===n.count?(i.options.count=n.count,n.count>99&&(i.options.count=99)):i.options.count=3,i.options.circle=n.circle||[{radius:10}];for(var s=0;s<i.options.circle.length;s++)i.options.circle[s].radius>999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText";for(var a=0,r=0;r<i.options.circle.length;r++)Number(i.options.circle[r].radius)>a&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.Dialog=o,i._EventBinding=new pn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity.show=t,be(this.sdk,this.options.id),re(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label.show&&(this.label.show=t)):console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(t){this.options.circle=t||[{radius:10}];for(var e=0;e<this.options.circle.length;e++)this.options.circle[e].radius>999999&&(this.options.circle[e].radius=999999);this._createCircleElm()}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,e.create(this),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(t){this.options.transparency=t>1?1:t,e.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}))}},{key:"count",get:function(){return this.options.count},set:function(t){this.options.count=t>99?99:t,e.create(this),this._elms.count&&this._elms.count.forEach((function(e){e.value=t}))}},{key:"colors",get:function(){return this.options.colors},set:function(t){this.options.colors=t,e.create(this)}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Wn(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Wn(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Wn(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Wn(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Un({},this.options.position):this.options.positions?l=Un({},this.options.positions[0]):this.options.center?l=Un({},this.options.center):this.options.start?l=Un({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=28;break}return t.next=6,new Zi(this.sdk,this.options,{title:"扩散光波属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.options.label.position={lng:c.label.position[0],lat:c.label.position[1],alt:c.label.position[2]},c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),be(c.sdk,c.options.id),re(c.sdk,c.options.id)},resetCallBack:function(){c.reset(),c.Dialog.resetCallBack&&c.Dialog.resetCallBack()},removeCallBack:function(){c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c.reset(),c.positionEditing=!1,c.Dialog.closeCallBack&&c.Dialog.closeCallBack()},showCallBack:function(t){c.options.show=t,c.originalOptions.show=t,c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()},translationalCallBack:function(){c.positionEditing=!c.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=On(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,this._createCircleElm(),new hn("circle-diffuse-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelLineColor=t},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorStart=t},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorEnd=t},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),l=i.getElementsByTagName("*"),this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){c.attributeLink=c.options.attribute.link.content,c.attributeVr=c.options.attribute.vr.content,c.ISCSelect&&c.ISCSelect(),c.goodsSelect&&c.goodsSelect(),c.cameraSelect&&c.cameraSelect();var t=Y(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(t){t.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var e=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];e.value="米",e.addEventListener("input",(function(){var t=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(e.value){case"米":for(var i=0;i<t.length;i++){var n=t[i].getElementsByClassName("unit")[0],o=t[i].getElementsByTagName("input")[0];"km"===n.innerHTML&&(n.innerHTML="m",o.value=Math.floor(1e3*o.value*100)/100)}break;case"千米":for(var s=0;s<t.length;s++){var a=t[s].getElementsByClassName("unit")[0],r=t[s].getElementsByTagName("input")[0];"m"===a.innerHTML&&(a.innerHTML="km",r.value=Math.floor(1e5*Number((r.value/1e3).toFixed(5)))/1e5)}}}))}var i=c.attributeSelect,n=c._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(n){var o=Y(n,".attribute-select");o.legp_search(i);for(var s=c._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<i.length;a++)if(i[a].key===c.options.attributeType){s.value=i[a].value,o.legp_searchActive(i[a].value);break}s.addEventListener("input",(function(){for(var t=0;t<i.length;t++)if(i[t].value===s.value){c.attributeType=i[t].key;break}}))}var r=Nn(),l=Y(c._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(l){l.legp_search(r);var u=c._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=r[c.labelFontFamily].value;for(var p=0;p<r.length;p++)if(r[p].value==u.value){l.legp_searchActive(r[p].value);break}u.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===u.value){c.labelFontFamily=r[t].key;break}})),c._elms.labelFontFamily=[u]}}),0);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.color=this.originalOptions.color,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=0,i=0;i<this.options.circle.length;i++)Number(this.options.circle[i].radius)>t&&(t=Number(this.options.circle[i].radius));this._radius=t,e.create(this)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,be(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_createCircleElm",value:function(){var t=this;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var i=this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0],n=i?i.value:"米",o=this._DialogObject._element.content.getElementsByClassName("circle-content-box")[0];o.innerHTML="";for(var s=function(i){var s=document.createElement("div");s.className="row";var a="",r='<button class="circle-minus"><svg class="icon-minus"><use xlink:href="#yj-icon-minus"></use></svg></button>';0===i&&i===t.options.circle.length-1&&(r=""),i===t.options.circle.length-1&&(a='<button class="circle-add" style="margin-left: 5px;"><svg class="icon-add2"><use xlink:href="#yj-icon-add2"></use></svg></button>'),s.innerHTML='\n <div class="col">\n <span class="label">半径</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" style="width: 130px;">\n <span class="unit">'.concat("米"===n?"m":"km",'</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex-direction: row-reverse;">\n <div class="color"></div>\n <span class="label">扩散颜色</span>\n </div>\n <div class="col" style="flex-direction: row-reverse;">\n ').concat(a,"\n ").concat(r,"\n </div>\n ");var l=s.getElementsByClassName("input")[0];l.value=t.options.circle[i].radius/("米"===n?1:1e3),l.addEventListener("input",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;if(s=Number(s),"."!=n.data&&("-"!=n.data||n.target.value)&&(!n.target.max&&!n.target.min||s<=Number(n.target.max)/("米"===o?1:1e3)&&s>=Number(n.target.min))){s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;r<t.options.circle.length;r++)Number(t.options.circle[r].radius)>a&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}})),l.addEventListener("blur",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;s=Number(s),n.target.max&&s>Number(n.target.max)/("米"===o?1:1e3)&&(s=Number(n.target.max)/("米"===o?1:1e3)),n.target.min&&s<Number(n.target.min)&&(s=Number(n.target.min)),s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;r<t.options.circle.length;r++)Number(t.options.circle[r].radius)>a&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}));new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:t.options.circle[i].color||t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(n){t.options.circle[i].color=n,e.create(t)},clear:function(){t.options.circle[i].color="rgba(255,255,255,1)",e.create(t)}});var c=s.getElementsByClassName("circle-minus")[0];c&&c.addEventListener("click",(function(){t.options.circle.splice(i,1);for(var n=0,o=0;o<t.options.circle.length;o++)Number(t.options.circle[o].radius)>n&&(n=Number(t.options.circle[o].radius));t._radius=n,e.create(t),t._createCircleElm()}));var u=s.getElementsByClassName("circle-add")[0];u&&u.addEventListener("click",(function(){t.options.circle.push({radius:0,color:"rgba(255,255,255,1)"});for(var i=0,n=0;n<t.options.circle.length;n++)Number(t.options.circle[n].radius)>i&&(i=Number(t.options.circle[n].radius));t._radius=i,e.create(t),t._createCircleElm()})),o.appendChild(s)},a=0;a<this.options.circle.length;a++)s(a)}}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){for(var i={},n=0;n<t.options.circle.length;n++)i[t.options.circle[n].radius/t.radius]=Cesium.Color.fromCssColorString(t.options.circle[n].color||t.options.color);var o=t.sdk._entityZIndex;t.entity?(o=t.entity.ellipse.zIndex._value,t.sdk.viewer.entities.remove(t.entity),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),material:new Vn({id:t.options.id,colors:i,transparency:t.options.transparency,speed:t.options.speed,count:t.options.count,gradient:.2}),zIndex:o}})):(t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),material:new Vn({id:t.options.id,colors:i,transparency:t.options.transparency,speed:t.options.speed,count:t.options.count,gradient:.2}),zIndex:o}}),t.options.show&&Qt(0,t.options.id),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1e6),e.createLabel(t),be(t.sdk,t.options.id))}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.options.label.position){t.next=5;break}return t.next=3,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 3:i=t.sent,e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i};case 5:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 6:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r}(Mn);function Xn(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扫描半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">扫描速度</span>\n <input class="input" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Zn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Kn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $n(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Qn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Qn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function to(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var eo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=to(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#FFEB3B",i.options.radius=n.radius||10,i.options.radius>999999&&(i.options.radius=999999),i.options.speed=n.speed||0===n.speed?n.speed:20,i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.Dialog=o,i._EventBinding=new pn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity.show=t,this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label.show&&this.label&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){var e=Number(t.toFixed(2));(e>999999&&(e=999999),e<.1&&(e=.1),this.options.radius=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(e=Number((e/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=$n(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=$n(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=$n(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=$n(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Kn({},this.options.position):this.options.positions?l=Kn({},this.options.positions[0]):this.options.center?l=Kn({},this.options.center):this.options.start?l=Kn({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=34;break}return t.next=6,new Zi(this.sdk,this.options,{title:"雷达光波属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),be(p.sdk,p.options.id),re(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.positionEditing=!1,p.Dialog.closeCallBack&&p.Dialog.closeCallBack()},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=Xn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new hn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.labelLineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(p.radius=i*("米"===e?1:1e3))}})),u.addEventListener("blur",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),p.radius=Number((i*("米"===e?1:1e3)).toFixed(2))}})),setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.ISCSelect&&p.ISCSelect(),p.goodsSelect&&p.goodsSelect(),p.cameraSelect&&p.cameraSelect();var t=p.attributeSelect,e=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=e.getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===p.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){p.attributeType=t[e].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=p._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){Y(a,".input-radius-unit").legp_search(s);var r=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var t=p._DialogObject._element.content.getElementsByClassName("input-radius")[0],e=t.getElementsByClassName("unit")[0],i=t.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===e.innerHTML&&(e.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===e.innerHTML&&(e.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=Nn(),c=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[p.labelFontFamily].value;for(var h=0;h<l.length;h++)if(l[h].value==u.value){c.legp_searchActive(l[h].value);break}u.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===u.value){p.labelFontFamily=l[t].key;break}})),p._elms.labelFontFamily=[u]}}),0);case 34:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.color=this.originalOptions.color,this.radius=this.originalOptions.radius,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,be(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"changeMaterial",value:function(){var t=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(this.options.color),e="rgba(".concat(t[0],",").concat(t[1],",").concat(t[2],",1)");this.entity&&(this.entity.ellipse.material=new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(e),transparency:t[3],speed:this.options.speed}))}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(t.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:t.options.speed}),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1e6),e.createLabel(t),be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"createBy2D",value:function(t){t.entity=new Cesium.EntityCollection;var i=0,n=r(t.options,t.options.radius,i),o=(new Date).getTime();t.viewer.clock.onTick.addEventListener((function(){var e=(new Date).getTime(),s=t.options.duration?360/t.options.duration:0,a=(e-o)*s;o=e,i+=a,n=r(t.options,t.options.radius,i)}));var s=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var e=t.createCircle({lng:t.options.lng,lat:t.options.lat},t.options.radius);return Cesium.Cartesian3.fromDegreesArray(e)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}}),a=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}});function r(t,e,i){var n=t.lng,o=t.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=e*Math.cos(i*Math.PI/180),r=e*Math.sin(i*Math.PI/180),l=Cesium.Cartesian3.fromElements(a,r,0),c=Cesium.Matrix4.multiplyByPoint(s,l,new Cesium.Cartesian3),u=Cesium.Cartographic.fromCartesian(c);return[n,o,Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude)]}t.entity.add(s),t.entity.add(a),t.sdk.viewer.entities.add(t.entity),e.createLabel(t),be(t.sdk,t.options.id)}}]);var i,n,s,r}(Mn);function io(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return no(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?no(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function no(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function oo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function so(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?oo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):oo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ao(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ro=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=ao(this,e,[t,n])).options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.options.billboard=n.billboard=n.billboard||{},i.options.billboard.isSelect=n.billboard.isSelect||!1,i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||Ue(n.billboard.defaultImage)||i.getSourceRootPath()+"/img/A-ablu-blank.png",i.options.billboard.defaultImage=n.billboard.defaultImage,i.options.billboard.scale=n.billboard.scale||0===n.billboard.scale?n.billboard.scale:3,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.positions=n.positions=n.positions||{},i.options.positions.lng=Number(Number(n.positions.lng||0).toFixed(8)),i.options.positions.lat=Number(Number(n.positions.lat||0).toFixed(8)),i.options.positions.alt=Number(Number(n.positions.alt||0).toFixed(2)),i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.coordinate=n.coordinate||"",i.operate={},i._elms={},i.previous={positions:so({},i.options.positions)},i.entity,i._proj=i.sdk.proj,i.sdk.addIncetance(i.options.id,i),e.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new pn,i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var t=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(e){var i=t.sdk.viewer.scene.pick(e.position);Cesium.defined(i)&&i.id&&"airportBillboard"===i.id.id?t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.YELLOW):t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.WHITE)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"},{name:"IP摄像头",value:"IP摄像头",key:"camera"},{name:"全景图",value:"全景图",key:"vr"},{name:"物资",value:"物资",key:"goods"}]}},{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.originalOptions.show=t,this.entity&&(this.entity.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e;this.options.heightMode=t||0,this.options.heightMode=t||0==t?t:3;var i,n="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(i=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this.options.heightMode){case"0":case 0:i&&(i.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,n="海拔高度";break;case"1":case 1:i&&(i.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,n="相对地表";break;case"2":case 2:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n="依附地表",i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,this._elms.height&&(this._elms.height.style.display="none");break;case"3":case 3:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),this._elms.height&&(this._elms.height.style.display="none"),e=Cesium.HeightReference.NONE,n="依附模型"}this.entity&&(this.entity.billboard.heightReference=e,this.entity.label.heightReference=e),this._elms.heightMode&&(this._elms.heightMode.value=n)}},{key:"labelText",get:function(){return this.options.label.text},set:function(t){this.options.label.text=t,this.options.name=t,this.entity&&(this.entity.label.text=t+""),this._elms.labelText&&this._elms.labelText.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.positions.lng},set:function(t){this.options.positions.lng=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.positions.lat},set:function(t){this.options.positions.lat=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.positions.alt},set:function(t){var e=this;if(this.options.positions.alt=Number(Number(t).toFixed(2)),this.renewPoint(),this.coordinate=this.options.coordinate,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.positions.alt})),this._elms.height){var i=this._elms.height.getElementsByClassName("height")[0];if(i)switch(this._elms.heightMode.value){case"海拔高度":i.value=this.options.positions.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){i.value=Number((e.options.positions.alt-t[0].height).toFixed(2))})):i.value=Number(Number(this.options.positions.alt).toFixed(2));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.renewPoint(),this._elms.near&&this._elms.near.forEach((function(t){t.value=e}))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e<this.near&&(e=this.near),this.options.far=e,this.renewPoint(),this._elms.far&&this._elms.far.forEach((function(t){t.value=e}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.renewPoint(),this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"billboardShow",get:function(){return this.options.billboard.show},set:function(t){this.options.billboard.show=t,this.entity&&(this.entity.billboard.color=this.options.billboard.show?void 0:new Cesium.Color(1,1,1,0)),this._elms.billboardShow&&this._elms.billboardShow.forEach((function(e){e.value=t}))}},{key:"billboardImage",get:function(){var t=this.options.billboard.image;t&&!t.startsWith("http")&&(t.includes(":")||this.options.host&&(t=new URL(t,this.options.host).href));return t},set:function(t){var e=this;this.options.billboard.image=this.replaceHost(t,this.options.host);var i=this.options.billboard.image||Ue(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png";this._elms.billboardImage&&this._elms.billboardImage.forEach((function(t){t.src=i}));var n;if(e.entity.billboard.image&&e.entity.billboard.image.getVa,i&&i.endsWith("gif")){!0;var o=document.createElement("img");o.setAttribute("rel:animated_src",i),o.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(o);var s=Cesium.createGuid();n=new SuperGif({gif:o}),this._superGif=n,this._superGif.id=s;var a=36,r=0;e._frameImages=[],n.load((function(t){if(404==t)return document.createElement("canvas"),rn()("canvas"),l.width=0,l.height=0,a=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=l),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),void(a=u*(31/c));if(e._superGif.id==s){for(var i=n.get_length(),o=1;o<=i;o++)n.move_to(o),e._frameImages.push(n.get_canvas().toDataURL());var l=n.get_canvas(),c=l.width,u=l.height;a=u*(31/c),e.entity.billboard.imgWidth=c,e.entity.billboard.imgHeight=u,e.entity&&(e.entity.billboard.image=new Cesium.CallbackProperty((function(){var t=e._frameImages[r];return r=r>=e._frameImages.length-1?0:r+1,t}),!1)),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return a}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-a*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1)}}))}else{var l=new Image;l.src=i;var c=36,u=document.createElement("canvas");l.onload=function(){var t=l.width/l.height;l.width=100,l.height=100/t;var i=l.width,n=l.height,o=u.getContext("2d",{willReadFrequently:!0});u.width=i,u.height=n,o.drawImage(l,0,0,i,n),c=n*(31/i),e.entity.billboard.imgWidth=i,e.entity.billboard.imgHeight=n,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return c}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-c*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),c=n*(31/i)},l.onerror=function(t){u.width=0,u.height=0,c=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),c=height*(31/width)}}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(this.entity.label.show=t),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.renewPoint();var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(0,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=io(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=io(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=io(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=io(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"billboardDefaultImage",get:function(){return Ue(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png"},set:function(t){var e=this.replaceHost(t,this.options.host);Ge(e,this.options.billboard.defaultImage),this._elms.billboardDefaultImage&&this._elms.billboardDefaultImage.forEach((function(t){t.src=e}))}},{key:"coordinate",get:function(){return this.options.coordinate},set:function(t){this.options.coordinate=t;var e=this._proj.convert([{x:this.options.positions.lng,y:this.options.positions.lat,z:this.options.positions.alt}],"EPSG:4326",t).points;this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&e[0]&&(this._DialogObject._element.content.getElementsByClassName("convert-x")[0].value=e[0].x,this._DialogObject._element.content.getElementsByClassName("convert-y")[0].value=e[0].y,this._DialogObject._element.content.getElementsByClassName("convert-z")[0].value=e[0].z),this._elms.coordinate&&this._elms.coordinate.forEach((function(e){e.value=t}))}},{key:"edit",value:(l=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d=this,m=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.length>0&&void 0!==m[0]&&m[0],i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=41;break}return t.next=7,new Zi(this.sdk,this.options,{title:"点属性",left:"180px",top:"100px",confirmCallBack:function(t){d.labelText=d.labelText.trim(),d.labelText||(d.labelText="未命名对象"),d.originalOptions=d.deepCopyObj(d.options),d._DialogObject.close();var e=d.deepCopyObj(d.options);e.host="",d.Dialog.confirmCallBack&&d.Dialog.confirmCallBack(e),be(d.sdk,d.options.id),re(d.sdk,d.options.id)},resetCallBack:function(){d.reset(),d.Dialog.resetCallBack&&d.Dialog.resetCallBack()},removeCallBack:function(){d.Dialog.removeCallBack&&d.Dialog.removeCallBack()},closeCallBack:function(){d.positionEditing=!1,setTimeout((function(){d.reset(),d.Dialog.closeCallBack&&d.Dialog.closeCallBack()}),0)},showCallBack:function(t){d.show=t,d.Dialog.showCallBack&&d.Dialog.showCallBack()},translationalCallBack:function(){d.positionEditing=!d.positionEditing},updateHeightCallBack:function(){d.updateHeight()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(n=document.createElement("div")).innerHTML=En(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new hn("point-object-edit-tabs",void 0,this.sdk),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelColor=t},clear:function(){d.labelColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[s],setTimeout(o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,m,f,v,g,b,C,w,k,_,x,E,S,D,P;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d.attributeLink=d.options.attribute.link.content,d.attributeVr=d.options.attribute.vr.content,d.cameraSelect&&d.cameraSelect(),d.ISCSelect&&d.ISCSelect(),d.goodsSelect&&d.goodsSelect(),e=d.attributeSelect,!(i=d._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=21;break}(n=Y(i,".attribute-select")).legp_search(e),o=d._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;case 12:if(!(s<e.length)){t.next=20;break}if(e[s].key!==d.options.attributeType){t.next=17;break}return o.value=e[s].value,n.legp_searchActive(e[s].value),t.abrupt("break",20);case 17:s++,t.next=12;break;case 20:o.addEventListener("input",(function(){for(var t=0;t<e.length;t++)if(e[t].value===o.value){d.attributeType=e[t].key;break}}));case 21:if(r=[],d.epsg_map.forEach((function(t,e){r.push({name:"".concat(t.name,"(").concat(t.epsg,")"),value:e})})),!(l=Y(d._DialogObject._element.content.getElementsByClassName("coordinate-select-box")[0],".coordinate-select"))){t.next=38;break}l.legp_search(r),c=d._DialogObject._element.content.getElementsByClassName("coordinate-select")[0].getElementsByTagName("input")[0],d.coordinate?d.coordinate=d.coordinate:d.coordinate=r[0].value,c.value=d.coordinate,u=0;case 30:if(!(u<r.length)){t.next=37;break}if(r[u].value!==r.value){t.next=34;break}return l.legp_searchActive(r[u].value),t.abrupt("break",37);case 34:u++,t.next=30;break;case 37:c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){d.coordinate=r[t].value;break}}));case 38:p=document.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],m=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附地表",value:"依附地表",key:"2"},{name:"依附模型",value:"依附模型",key:"3"}],f=d.heightMode,t.t0=f,t.next=0===t.t0||"0"===t.t0?45:1===t.t0||"1"===t.t0?47:2===t.t0||"2"===t.t0||3===t.t0||"3"===t.t0?49:54;break;case 45:return h.value=d.alt,t.abrupt("break",54);case 47:return d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){h.value=Number((d.alt-Number(t[0].height.toFixed(2))).toFixed(2))})):h.value=Number(d.alt.toFixed(2)),t.abrupt("break",54);case 49:v=[],g=io(d.sdk.entityMap);try{for(g.s();!(b=g.n()).done;)(C=y()(b.value,2))[0],"RadarScanStereoscopic"===(w=C[1]).type&&w.entity&&v.push(w.entity)}catch(t){g.e(t)}finally{g.f()}return d.getClampToHeight(d.options.positions,v).then((function(t){d.alt=Number(t.toFixed(2)),h.value=d.alt})),t.abrupt("break",54);case 54:if(!(k=Y(d._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=72;break}k.legp_search(m),(_=d._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0]).value=m[d.heightMode].value,x=0;case 60:if(!(x<m.length)){t.next=67;break}if(m[x].value!=_.value){t.next=64;break}return k.legp_searchActive(m[x].value),t.abrupt("break",67);case 64:x++,t.next=60;break;case 67:_.addEventListener("input",(function(){for(var t=0;t<m.length;t++)if(m[t].value===_.value){switch(f=m[t].key){case 0:case"0":d.alt=Number(h.value),p.style.display="flex",d.heightMode=0;break;case 1:case"1":d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){d.alt=Number(h.value)+Number(t[0].height.toFixed(2))})):d.alt=Number(h.value),p.style.display="flex",d.heightMode=1;break;case 2:case"2":d.heightMode=2;break;case 3:case"3":var e,i=[],n=io(d.sdk.entityMap);try{for(n.s();!(e=n.n()).done;){var o=y()(e.value,2),s=(o[0],o[1]);"RadarScanStereoscopic"===s.type&&s.entity&&i.push(s.entity)}}catch(t){n.e(t)}finally{n.f()}d.getClampToHeight(d.options.positions,i).then((function(t){d.alt=Number(t.toFixed(2))})),d.heightMode=3}break}})),h.addEventListener("input",(function(){switch(f){case 0:case"0":d.options.positions.alt=Number(Number(h.value).toFixed(2));break;case 1:case"1":d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){d.alt=Number(h.value)+Number(t[0].height.toFixed(2))})):d.alt=Number(h.value)}d.renewPoint(),d.coordinate=d.options.coordinate,d._elms.alt&&d._elms.alt.forEach((function(t){t.value=d.options.positions.alt}))})),d._elms.height=p,d._elms.heightMode=_,d.heightMode=d.heightMode;case 72:if(E=Nn(),!(S=Y(d._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select"))){t.next=88;break}S.legp_search(E),(D=d._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0]).value=E[d.labelFontFamily].value,P=0;case 79:if(!(P<E.length)){t.next=86;break}if(E[P].value!=D.value){t.next=83;break}return S.legp_searchActive(E[P].value),t.abrupt("break",86);case 83:P++,t.next=79;break;case 86:D.addEventListener("input",(function(){for(var t=0;t<E.length;t++)if(E[t].value===D.value){d.labelFontFamily=E[t].key;break}})),d._elms.labelFontFamily=[D];case 88:case"end":return t.stop()}}),t)}))),0),l=n.getElementsByClassName("lng")[0],c=n.getElementsByClassName("lat")[0],l.value=this.lng,c.value=this.lat,this._elms.lng.push(l),this._elms.lat.push(c),u=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox-box"),p=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox"),h=this._DialogObject._element.content.getElementsByClassName("proj-input-box"),p[0].checked=!0,h[1].style.display="none",h[2].style.display="none",u[0].addEventListener("click",(function(){p[0].checked=!0,h[0].style.display="block",p[1].checked=!1,h[1].style.display="none",p[2].checked=!1,h[2].style.display="none"})),u[1].addEventListener("click",(function(){p[1].checked=!0,h[1].style.display="block",p[0].checked=!1,h[0].style.display="none",p[2].checked=!1,h[2].style.display="none"})),u[2].addEventListener("click",(function(){p[2].checked=!0,h[2].style.display="block",p[0].checked=!1,h[0].style.display="none",p[1].checked=!1,h[1].style.display="none"})),i._projConvert=function(){var t,e,o,s,a,r,l,c,u,p,h,m,f,v,g,y;d._DialogObject&&!d._DialogObject.isDestroy&&(t=i.lng,e=i.lat,o=i._proj.degreesToDMS(t,!0),s=i._proj.degreesToDMS(e,!0),c=(l=o.split("°"))[1].split("'"),p=(u=s.split("°"))[1].split("'"),n.getElementsByClassName("lng-dm-d")[0].value=l[0],n.getElementsByClassName("lng-dm-m")[0].value=c[0],n.getElementsByClassName("lat-dm-d")[0].value=u[0],n.getElementsByClassName("lat-dm-m")[0].value=p[0],a=i._proj.degreesToDMS(t),r=i._proj.degreesToDMS(e),f=(m=(h=a.split("°"))[1].split("'"))[1].split('"'),y=(g=(v=r.split("°"))[1].split("'"))[1].split('"'),n.getElementsByClassName("lng-dms-d")[0].value=h[0],n.getElementsByClassName("lng-dms-m")[0].value=m[0],n.getElementsByClassName("lng-dms-s")[0].value=f[0],n.getElementsByClassName("lat-dms-d")[0].value=v[0],n.getElementsByClassName("lat-dms-m")[0].value=g[0],n.getElementsByClassName("lat-dms-s")[0].value=y[0])},i._projConvert(),t.next=41;break;case 41:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"renewPoint",value:function(){var t=this,e=Bn(this.labelFontFamily)||"Helvetica";this.entity&&(this.entity.position=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,this.options.positions.alt),this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0,this.entity.label.scaleByDistance=void 0,this.entity.label.pixelOffsetScaleByDistance=void 0),this.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){if(t.options.billboard.show){var e=t.entity.billboard.imgHeight?t.entity.billboard.imgHeight*(31/t.entity.billboard.imgWidth):0;return new Cesium.Cartesian2(0,-e*t.options.billboard.scale-t.options.label.fontSize/2-5)}return new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),this.entity.label.font=this.options.label.fontSize+"px "+e,this.entity.label.fillColor=Cesium.Color.fromCssColorString(this.options.label.color),this.entity.billboard.scale=this.options.billboard.scale)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.near=this.originalOptions.near,this.far=this.originalOptions.far,this.scaleByDistance=this.originalOptions.scaleByDistance,this.billboardShow=this.originalOptions.billboard.show,this.billboardImage=this.originalOptions.billboard.image,this.billboardScale=this.originalOptions.billboard.scale,this.labelText=this.originalOptions.label.text,this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelColor=this.originalOptions.label.color,this.lng=this.originalOptions.positions.lng,this.lat=this.originalOptions.positions.lat,this.alt=this.originalOptions.positions.alt,this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ri(this.sdk.viewer,this.entity);case 2:if(this.entity=null,this.sdk.viewer&&this.sdk.viewer.entities){t.next=5;break}return t.abrupt("return");case 5:return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,be(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"clickChangeImage",value:function(){this.Dialog.clickChangeImage&&this.Dialog.clickChangeImage()}},{key:"clickChangeDefaultImage",value:function(){this.Dialog.clickChangeDefaultImage&&this.Dialog.clickChangeDefaultImage()}},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"updateHeight",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=2;break}return t.abrupt("return");case 2:n=new Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,0),o=new Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,1e13),s=[],r=io(this.sdk.entityMap);try{for(r.s();!(l=r.n()).done;)(c=y()(l.value,2))[0],"RadarScanStereoscopic"===(u=c[1]).type&&u.entity&&s.push(u.entity)}catch(t){r.e(t)}finally{r.f()}return t.next=9,this.sdk.viewer.scene.clampToHeightMostDetailed([n],s);case 9:(p=t.sent)&&p[0]&&(e=this.cartesian3Towgs84(p[0],this.sdk.viewer).alt),h=Cesium.Cartesian3.subtract(n,o,new Cesium.Cartesian3),d=Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3),m=new Cesium.Ray(o,d),f={},v=this.sdk.viewer.scene.drillPickFromRay(m),g=v.length-1;case 17:if(!(g>=0)){t.next=24;break}if(!v[g].position){t.next=21;break}return f=v[g],t.abrupt("break",24);case 21:g--,t.next=17;break;case 24:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),t.prev=25,t.next=28,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]);case 28:b=t.sent,t.next=33;break;case 31:t.prev=31,t.t0=t.catch(25);case 33:if((void 0===i||i<b[0].height)&&b&&(i=b[0].height),(void 0===e||e<i)&&(e=i),void 0===e){t.next=53;break}if(this.options.positions.alt=Number(Number(e).toFixed(2)),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=w.options.positions.alt})),this.renewPoint(),this.coordinate=this.options.coordinate,!this._elms.height){t.next=53;break}if(!(C=this._elms.height.getElementsByClassName("height")[0])){t.next=53;break}t.t1=this._elms.heightMode.value,t.next="海拔高度"===t.t1?46:"相对地表"===t.t1?48:"依附地表"===t.t1?50:"依附模型"===t.t1?51:53;break;case 46:return C.value=this.options.positions.alt,t.abrupt("break",53);case 48:return this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){C.value=Number((w.options.positions.alt-t[0].height).toFixed(2))})):C.value=this.options.positions.alt,t.abrupt("break",53);case 50:return t.abrupt("break",53);case 51:return C.value=this.options.positions.alt,t.abrupt("break",53);case 53:case"end":return t.stop()}}),t,this,[[25,31]])}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w.length>0&&void 0!==w[0]?w[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=26;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=so({},this.options.position):this.options.positions?l=so({},this.options.positions):this.options.center?l=so({},this.options.center):this.options.start?l=so({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=19;break}c=[],u=io(this.sdk.entityMap);try{for(u.s();!(p=u.n()).done;)(h=y()(p.value,2))[0],"RadarScanStereoscopic"===(d=h[1]).type&&d.entity&&c.push(d.entity)}catch(t){u.e(t)}finally{u.f()}return t.next=18,this.getClampToHeight(l,c);case 18:l.alt=t.sent;case 19:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=33;break;case 26:m=[],f=io(this.sdk.entityMap);try{for(f.s();!(v=f.n()).done;)(g=y()(v.value,2))[0],"RadarScanStereoscopic"===(b=g[1]).type&&b.entity&&m.push(b.entity)}catch(t){f.e(t)}finally{f.f()}return t.next=31,this.getClampToHeight(this.options.positions,m);case 31:C=t.sent,this.sdk.viewer.camera.flyTo({orientation:e.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,C+(e.height||500))});case 33:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={positions:so({},this.options.positions)};var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={positions:so({},e.options.positions)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.positionEditing=!1};this.event.mouse_move((function(t,i){e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,n){var o=new Date;e.event.gesture_pinck_end((function(){var s=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;s-o>=500?e.positionEditing=!1:i(0,n)}))}))}else this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy(),this.event=null),this.tip&&this.tip.destroy(),this.lng=this.previous.positions.lng,this.lat=this.previous.positions.lat,this.alt=this.previous.positions.alt,this.renewPoint()}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=19;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=so({},n),this.options.positions?o=so({},this.options.positions):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=16;break}r=[],l=io(this.sdk.entityMap);try{for(l.s();!(c=l.n()).done;)(u=y()(c.value,2))[0],"RadarScanStereoscopic"===(p=u[1]).type&&p.entity&&r.push(p.entity)}catch(t){l.e(t)}finally{l.f()}return t.next=15,this.getClampToHeight(o,r);case 15:o.alt=t.sent;case 16:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}],[{key:"create",value:function(t){var e,i,n=36,o=t.options.positions;t.originalOptions=t.deepCopyObj(t.options);var s,a=!1,r=0,l=Bn(t.labelFontFamily)||"Helvetica",c=t.replaceHost(t.options.billboard.image,t.options.host);if(t._frameImages=[],c&&c.endsWith("gif")){switch(a=!0,t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}var u=document.createElement("img");u.setAttribute("rel:animated_src",c),u.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(u);var p=Cesium.createGuid();s=new SuperGif({gif:u}),t._superGif=s,t._superGif.id=p,s.load((function(i){if(404==i)return(e=document.createElement("canvas")).width=0,e.height=0,n=0,void(t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,ai(t.sdk,t.entity)));if(t._superGif.id==p){for(var o=s.get_length(),a=1;a<=o;a++)s.move_to(a),t._frameImages.push(s.get_canvas().toDataURL());var l=(e=s.get_canvas()).width,c=e.height;n=c*(31/l),t.entity&&(t.entity.billboard.imgWidth=l,t.entity.billboard.imgHeight=c,t.entity.billboard.image=new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1),ai(t.sdk,t.entity))}}))}else{var h=new Image;switch(h.src=c||t.getSourceRootPath()+"/img/A-ablu-blank.png",t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}e=document.createElement("canvas"),h.onload=function(){var i=h.width/h.height;h.width=100,h.height=100/i;var o=h.width,s=h.height,a=e.getContext("2d",{willReadFrequently:!0});e.width=o,e.height=s,a.drawImage(h,0,0,o,s),n=s*(31/o),t.entity&&(t.entity.billboard.imgWidth=o,t.entity.billboard.imgHeight=s,t.entity.billboard.image=e,ai(t.sdk,t.entity))},h.onerror=function(i){e.width=0,e.height=0,n=0,t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,ai(t.sdk,t.entity))}}t.entity=new Cesium.Entity({show:t.options.show,id:t.options.id,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:a?new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1):e,scale:t.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,color:t.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return n}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:t.options.label.fontSize+"px "+l,fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-n*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE}}),t.entity.billboard.imgWidth=31,t.entity.billboard.imgHeight=36,t.entity.position=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),3==t.options.heightMode&&t.updateHeight(),t.renewPoint(),be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id),t.options.billboard.isSelect&&t.selectBillboard()}}]);var i,n,s,r,l}(Mn);function lo(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">描边颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">描边宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function co(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function uo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?co(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):co(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function po(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ho(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ho(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ho(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function mo(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var fo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=mo(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.nodePoints=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="多边形最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),i._zIndex=i.sdk.entityMap.size,e.create(i)}return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"PolygonObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(this.heightMode=0,i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){i.options.positions;var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td center">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td center">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td center">\n <button style="margin-right: 5px;" @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td center">\n <button style="margin-right: 5px;" @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=po(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=po(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=po(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=po(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=7,new Zi(this.sdk,this.options,{title:"面属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),console.log("000000000000",m.options.label.scaleByDistance),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),be(m.sdk,m.options.id),re(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.previous=null,m.reset(),m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack();for(var t=0;t<m.nodePoints.length;t++)m.sdk.viewer.entities.remove(m.nodePoints[t]);m.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),m.event&&m.event.destroy(),m.tip&&m.tip.destroy()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polygon",(s=document.createElement("div")).innerHTML=lo(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("polygon-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),m.heightMode=m.heightMode,setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=Nn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity||this._DialogObject){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.height=this.originalOptions.height,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;var t=this.options.positions,e=[[]],i=[];if(this.options.height||0===this.options.height){for(var n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,this.options.height),e[0].push([t[n].lng,t[n].lat]);e[0].push([t[0].lng,t[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(var o=0;o<t.length;o++)i.push(t[o].lng,t[o].lat),e[0].push([t[o].lng,t[o].lat]);e[0].push([t[0].lng,t[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArray(i)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(L()(this.positions),[this.positions[0],this.positions[1]])}}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=uo({},this.options.position):this.options.positions?l=uo({},this.options.positions[0]):this.options.center?l=uo({},this.options.center):this.options.start?l=uo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positions)for(m=0;m<this.positions.length;m++)c.push(this.positions[m].x,this.positions[m].y,this.positions[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(e.closeNodeEdit(this),!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var n=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var o;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var s=[],a=L()(this.positions),r=this.deepCopyObj(this.options.positions),l=[],c=[],u=0;u<a.length;u++){var p=this.cartesian3Towgs84(a[u],this.sdk.viewer);s.push([p.lng,p.lat])}var h=this.cartesian3Towgs84(a[0],this.sdk.viewer);s.push([h.lng,h.lat]);for(var d=turf.polygon([s]),m=turf.centroid(d),f=(o=Cesium.Cartesian3).fromDegrees.apply(o,L()(m.geometry.coordinates)),v=0;v<a.length;v++)c.push({x:f.x-a[v].x,y:f.y-a[v].y,z:f.z-a[v].z});var g=[],y=function(t,e){i.cartesian3Towgs84(e,i.sdk.viewer);i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),g=[];for(var o=0;o<c.length;o++){var s={x:e.x-c[o].x,y:e.y-c[o].y,z:e.z-c[o].z};g.push(s),i.options.positions[o]=i.cartesian3Towgs84(s,i.sdk.viewer),n._elms.lng&&n._elms.lng[o]&&(n._elms.lng[o].innerHTML=i.options.positions[o].lng.toFixed(8)),n._elms.lat&&n._elms.lat[o]&&(n._elms.lat[o].innerHTML=i.options.positions[o].lat.toFixed(8))}i.previous=null,l=[],i.heightMode=i.heightMode};this.event.mouse_move((function(t,e){var n=i.cartesian3Towgs84(e,i.sdk.viewer);g=[];for(var o=0;o<c.length;o++){var s={x:e.x-c[o].x,y:e.y-c[o].y,z:e.z-c[o].z};g.push(s),r[o]=i.cartesian3Towgs84(s,i.sdk.viewer)}for(var a=!1,u=[],p=0;p<r.length;p++)u.push([r[p].lng,r[p].lat]);u.push([r[0].lng,r[0].lat]);var h=0,d=turf.polygon([u]),m=turf.centroid(d);switch(i.options.heightMode){case"0":case 0:a=!1;break;case"1":case 1:h=i.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1])),a=!1;break;case"2":case 2:a=!0}if(l=[],a){for(var f=0;f<r.length;f++)l.push(r[f].lng,r[f].lat);i.positions=Cesium.Cartesian3.fromDegreesArray(l);var v=L()(i.sdk.viewer.entities.values);i.getClampToHeight({lng:n.lng,lat:n.lat},v).then((function(t){i.label.position=[n.lng,n.lat,t]}))}else{for(var y=0;y<r.length;y++)l.push(r[y].lng,r[y].lat,i.height+h);i.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),i.label.position=[n.lng,n.lat,i.height+h]}i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(y),this.event.mouse_right((function(t,e){i.heightMode=i.heightMode})),this.event.gesture_pinck_start((function(t,e){var n=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;i.event.gesture_pinck_end((function(){new Date-n>=500?i.positionEditing=!1:y(0,e)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(n.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(n.positions),[n.positions[0],n.positions[1]])}),!1)}else{this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)},this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var b=[[]],C=0;C<this.previous.positions.length;C++){var w=this.cartesian3Towgs84(this.previous.positions[C],this.sdk.viewer);b[0].push([w.lng,w.lat])}var k=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);b[0].push([k.lng,k.lat]);var _=turf.polygon(b),x=turf.centroid(_),E=!1,S=0;switch(this.options.heightMode){case"0":case 0:E=!1;break;case"1":case 1:S=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(x.geometry.coordinates[0],x.geometry.coordinates[1])),E=!1;break;case"2":case 2:E=!0}this.label.position=E?[x.geometry.coordinates[0],x.geometry.coordinates[1]]:[x.geometry.coordinates[0],x.geometry.coordinates[1],this.height+S],this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(n.previous.positions),this.entity.polyline.positions=[].concat(L()(n.previous.positions),[n.previous.positions[0],n.previous.positions[1]])}}}},{key:"setPosition",value:function(t){for(var e,i=this,n=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),o=L()(this.positions),s=[],a=[],r=0;r<o.length;r++){var l=this.cartesian3Towgs84(o[r],this.sdk.viewer);s.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(o[0],this.sdk.viewer);s.push([c.lng,c.lat]);for(var u=turf.polygon([s]),p=turf.centroid(u),h=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(p.geometry.coordinates)),d=0;d<o.length;d++)a.push({x:h.x-o[d].x,y:h.y-o[d].y,z:h.z-o[d].z});for(var m=[],f=0;f<a.length;f++)m.push({x:n.x-a[f].x,y:n.y-a[f].y,z:n.z-a[f].z});var v=!1,g=0;switch(this.options.heightMode){case"0":case 0:v=!1;break;case"1":case 1:g=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1])),v=!1;break;case"2":case 2:v=!0}if(v){var y=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:t.position.lng,lat:t.position.lat},y).then((function(e){i.label.position=[t.position.lng,t.position.lat,e]}))}else this.label.position=[t.position.lng,t.position.lat,t.position.alt+g];this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return m.length>0?new Cesium.PolygonHierarchy(m):new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return m.length>0?[].concat(m,[m[0],m[1]]):[].concat(L()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var t=this;if(!this._error){for(var e=!1,i=[],n=this.options.positions,o=0;o<n.length;o++)i.push([n[o].lng,n[o].lat]);i.push([n[0].lng,n[0].lat]);var s=0,a=turf.polygon([i]),r=turf.centroid(a);switch(this.options.heightMode){case"0":case 0:e=!1;break;case"1":case 1:s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(r.geometry.coordinates[0],r.geometry.coordinates[1]))||0,e=!1;break;case"2":case 2:e=!0}var l=[];if(e||0!=this.nodePoints.length){for(var c=0;c<n.length;c++)l.push(n[c].lng,n[c].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(l),setTimeout((function(){if(t.sdk.viewer){var e=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]},e).then((function(e){t.label&&(t.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],e])}))}}),100)}else{for(var u=0;u<n.length;u++)l.push(n[u].lng,n[u].lat,this.height+s);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),this.label&&(this.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],this.height+s])}return this.options.areaByMeter=this.computeArea(n),this.areaUnit=this.areaUnit,l}}},{key:"setDIV",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for((e=h.length>0&&void 0!==h[0]?h[0]:{domid:"",x:10,y:10}).x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10,i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);if(i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),ground){t.next=12;break}r=this.options.height,t.next=16;break;case 12:return l=L()(this.sdk.viewer.entities.values),t.next=15,this.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},l);case 15:r=t.sent;case 16:c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],r),this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===c.style.display||""===c.style.display){var i=p.sdk.viewer.scene.cartesianToCanvasCoordinates(u);i&&(c.style.left=(i.x+e.x).toFixed(0)+"px",c.style.top=(i.y+e.y).toFixed(0)+"px")}}));case 19:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}],[{key:"create",value:function(t){var i;i=2==t.heightMode,t.renewPositions();var n=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(t.options.heightMode=0,i=!1,n=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!i,material:n,zIndex:t.sdk._entityZIndex},polyline:C()(C()({positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,arcType:Cesium.ArcType.NONE,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i},"arcType",i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE),"zIndex",t.sdk._entityZIndex)}),t.sdk._entityZIndex++,e.createLabel(t),be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=[[]],n=0;n<e.options.positions.length;n++)i[0].push([e.options.positions[n].lng,e.options.positions[n].lat]);i[0].push([e.options.positions[0].lng,e.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),r=0,t.t0=e.heightMode,t.next=0===t.t0||"0"===t.t0?9:1===t.t0||"1"===t.t0?11:2===t.t0||"2"===t.t0?14:16;break;case 9:return l=!1,t.abrupt("break",16);case 11:for(c=0;c<i.length;c++)r=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(i[c].lng,i[c].lat));return l=!1,t.abrupt("break",16);case 14:return l=!0,t.abrupt("break",16);case 16:if(l){t.next=20;break}r=e.options.height+r,t.next=24;break;case 20:return u=L()(e.sdk.viewer.entities.values),t.next=23,e.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},u);case 23:r=t.sent;case 24:e.options.label.position||(e.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:r}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:l});case 26:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=po(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0),t.picking=!1,t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=[],c=0;c<t.options.positions.length;c++)l.push(t.options.positions[c].lng,t.options.positions[c].lat);r=Cesium.Cartesian3.fromDegreesArray(l);var u=!1,p=function(){var e=o()(a.a.mark((function e(o,s){var l,c,p,h,d,m,f,v,g,y,b;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i){e.next=32;break}return t.options.positions[i.index]=t.cartesian3Towgs84(s,t.sdk.viewer),n=t.options.positions[i.index],u=!0,e.next=6,t.getClampToHeight(t.options.positions[i.index]);case 6:for(l=e.sent,c=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,l),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.splice(i.index,0,c),t.options.positions.splice(i.index,0,t.options.positions[i.index]),p=t.options.positions,h=[],d=0;d<p.length;d++)h.push(p[d].lng,p[d].lat);if(t.positions=Cesium.Cartesian3.fromDegreesArray(h),r=Cesium.Cartesian3.fromDegreesArray(h),m=L()(t.sdk.viewer.entities.values),t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},m).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(f=[[]],v=0;v<t.options.positions.length;v++)f[0].push([t.options.positions[v].lng,t.options.positions[v].lat]);f[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),g=turf.polygon(f),y=turf.centroid(g),t.getClampToHeight({lng:y.geometry.coordinates[0],lat:y.geometry.coordinates[1]},m).then((function(e){t.label.position=[y.geometry.coordinates[0],y.geometry.coordinates[1],e]}))}t.options.areaByMeter=t.computeArea(t.options.positions),e.t0=t.options["area-unit"],e.next="平方米"===e.t0?21:"平方千米"===e.t0?23:"亩"===e.t0?25:"公顷"===e.t0?27:29;break;case 21:return t.area=t.options.areaByMeter,e.abrupt("break",30);case 23:return t.area=Number((t.options.areaByMeter/1e6).toFixed(8)),e.abrupt("break",30);case 25:return t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4)),e.abrupt("break",30);case 27:return t.area=Number((t.options.areaByMeter/1e4).toFixed(6)),e.abrupt("break",30);case 29:t.area=t.options.areaByMeter;case 30:e.next=34;break;case 32:(b=t.sdk.viewer.scene.pick(o.position))&&b.id&&b.id.name&&"node-secondary-edit-point"===b.id.name&&(i=b.id,t.nodePoints.splice(b.id.index,1),t.sdk.viewer.entities.remove(b.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position.getValue(),t.sdk.viewer));case 34:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),h=function(o,s){i&&(t.options.positions[i.index]=n,u&&t.options.positions.splice(i.index,1),e(null,t.options.positions)),YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return r.length>=3?[].concat(L()(r),[r[0],r[1],r[2]]):r}),!1);var d=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},d).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var m=[[]],f=0;f<t.options.positions.length;f++)m[0].push([t.options.positions[f].lng,t.options.positions[f].lat]);m[0].push([t.options.positions[0].lng,t.options.positions[0].lat]);var v=turf.polygon(m),g=turf.centroid(v);t.getClampToHeight({lng:g.geometry.coordinates[0],lat:g.geometry.coordinates[1]},d).then((function(e){t.label.position=[g.geometry.coordinates[0],g.geometry.coordinates[1],e]}))}setTimeout((function(){t.event.mouse_left(p),t.event.mouse_right(h),t.event.mouse_move((function(e,n){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(s),r=Cesium.Cartesian3.fromDegreesArray(s);var l=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},l).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var c=[[]],u=0;u<t.options.positions.length;u++)c[0].push([t.options.positions[u].lng,t.options.positions[u].lat]);c[0].push([t.options.positions[0].lng,t.options.positions[0].lat]);var p=turf.polygon(c),h=turf.centroid(p);t.getClampToHeight({lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1]},l).then((function(e){t.label.position=[h.geometry.coordinates[0],h.geometry.coordinates[1],e]}))}}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?h():p(o,i)}))})),s()}),200)}}),50)}},{key:"closeNodeEdit",value:function(t){if(t.sdk&&t.sdk.viewer){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}}]);var i,n,s,r,l}(Mn);function vo(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 56%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <div class="input-select-unit"></div>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">应用</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box" style="flex: 0 0 37%;">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线段圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col" style="flex: 0 0 37%;">\n </div>\n </div>\n <div class="row" id="dashTextureDom">\n <div class="col">\n <span class="label">动画顺向</span>\n <input class="btn-switch" type="checkbox" @model="rotate">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">流动速率</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label lineSpace">间距</span>\n <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function go(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return yo(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var bo=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=go(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max),e.target.value=i),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min),e.target.value=i),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(bo,"event",{});var Co=new bo;function wo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ko(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):wo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var _o=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.viwer=this.sdk.viewer,this.options=i,this.options.position=i.position||{},this.options.rotate=i.rotate||{},this.options.position.lng=this.options.position.lng||0,this.options.position.lat=this.options.position.lat||0,this.options.position.alt=this.options.position.alt||0,this.options.rotate.x=this.options.rotate.x||0,this.options.rotate.y=this.options.rotate.y||0,this.options.rotate.z=this.options.rotate.z||0,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.MapEvent=new X(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t}},{key:"initParam",value:function(){return this._params={tx:this.options.position.lng,ty:this.options.position.lat,tz:this.options.position.alt,rx:this.options.rotate.x,ry:this.options.rotate.y,rz:this.options.rotate.z},ko(ko({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w=function(t){if(e.activeAxis){var i=t.startPosition.y-t.endPosition.y,n={x:t.endPosition.x-y.x,y:t.endPosition.y-y.y},o=r.camera.getPickRay(n),s=r.scene.globe.pick(o,r.scene),a=new Cesium.Cartesian3,l=Cesium.Transforms.eastNorthUpToFixedFrame(r.camera.position);Cesium.Matrix4.inverse(l,l),Cesium.Matrix4.multiplyByPoint(l,s,a),Cesium.Cartesian3.normalize(a,a);var c=e.initParam(),u=90+Cesium.Math.toDegrees(Math.asin(a.z)),p=Cesium.Cartographic.fromCartesian(r.camera.position).height,h=e.activeModelParam.alt,d=p/Math.cos(Cesium.Math.toRadians(u));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(s),Cesium.Cartographic.fromCartesian(r.camera.position)),s=Cesium.Ray.getPoint(o,d*(1-h/p));var m=Cesium.Cartographic.fromCartesian(s),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=f,e._params.ty=e.activeModelParam.lat,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var g=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),_=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,g),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,_);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=v,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,x),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(r.camera.position,Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt))/4300*i*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-b<100)return clearTimeout(C),void(C=setTimeout((function(){w(t)}),100));clearTimeout(C),b=O;for(var T=e.coordArrows,N=0;N<T.length;N++)if(T[N].getGeometryInstanceAttributes)switch(T[N]._name){case"model_edit_xAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=e.viwer.scene.drillPick(t.endPosition,10),L=B.length-1;L>=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}},this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk),e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,r=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),u=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3),this.rayX=new Cesium.Ray(this.origin,l),this.rayY=new Cesium.Ray(this.origin,c),this.rayZ=new Cesium.Ray(this.origin,u),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=r.camera.position,d=Cesium.Cartesian3.distance(h,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],p,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],p,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],p,Cesium.Color.BLUE),this.viwer.scene.primitives.add(f),this.viwer.scene.primitives.add(v),this.viwer.scene.primitives.add(g),this.againArrow(),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againArrow,{_that:this}),y={x:0,y:0},b=0,this.MapEvent.mouse_move((function(t,e){w(t)})),this.MapEvent.mouse_left_down((function(t,i){var n=r.scene.cartesianToCanvasCoordinates(k.origin);y.x=t.position.x-Math.floor(n.x),y.y=t.position.y-Math.floor(n.y);for(var o=r.scene.drillPick(t.position,10),s=o.length-1;s>=0;s--){var a=o[s];if(a&&a.primitive&&a.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(a.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return r.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=a.primitive,e.activeModelParam=e.initParam(),void(a.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){r.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<e.coordArrows.length;i++)switch(e.coordArrows[i]._name){case"model_edit_xAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}e.activeAxis&&(e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack)}));case 42:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"againArrow",value:function(){var t=this._that||this;if(t.origin){t.initParam(),t.origin=new Cesium.Cartesian3.fromDegrees(t._params.tx,t._params.ty,t._params.tz);for(var e=t.viwer.camera.position,i=Cesium.Cartesian3.distance(e,t.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(t.origin),o=t.coordArrows,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(i,i,i),o[s].modelMatrix)}}}},{key:"againCircle",value:function(){var t=this._that||this;if(t.origin){t.initParam(),t.origin=new Cesium.Cartesian3.fromDegrees(t._params.tx,t._params.ty,t._params.tz);for(var e=t.viwer.camera.position,i=Cesium.Cartesian3.distance(e,t.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(t.origin),o=t.coordCircles,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var a=i/20;Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(a,a,a),o[s].modelMatrix),o[s]._radius=i}}}},{key:"editRtation",value:(e=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.destroy(),this.activeState="rtation",this.MapEvent=new X(this.sdk),e=this.initParam(),this.origin=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),this.createCircle(e.lng,e.lat,e.alt,20),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againCircle,{_that:this});case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"createCircle",value:(t=o()(a.a.mark((function t(e,i,n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P,M;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(M=function(t){if(r.activeCircle){var e=0,i=0,n=0;if(!Cesium.SceneTransforms.wgs84ToWindowCoordinates(l.scene,s.ciclkPosition))return;var o=t.startPosition.y-t.endPosition.y,a=t.startPosition.x-t.endPosition.x;switch(r.activeCircle._name){case"model_edit_xCircle":i=1*a;break;case"model_edit_yCircle":e=1*o;break;case"model_edit_zCircle":n=1*a}r._params.rx-=e,r._params.rx>360&&(r._params.rx=1),r._params.rx<0&&(r._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._params.rx)),r._params.ry-=i,r._params.ry>360&&(r._params.ry=1),r._params.ry<0&&(r._params.ry=360),r._params.rz-=n,r._params.rz>360&&(r._params.rz=1),r._params.rz<0&&(r._params.rz=360),r.updateModel(r._params.tx,r._params.ty,r._params.tz,r._params.rx,r._params.ry,r._params.rz)}else{var c=Date.now();if(c-D<100)return clearTimeout(P),void(P=setTimeout((function(){M(t)}),100));clearTimeout(P),D=c;for(var u=s.coordCircles,p=0;p<u.length;p++)if(u[p].getGeometryInstanceAttributes){var h=u[p].getGeometryInstanceAttributes(u[p]._name);switch(u[p]._name){case"model_edit_zCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var d=l.scene.drillPick(t.endPosition,10),m=0;m<d.length;m++){var f=d[m];if(f&&f.primitive&&f.id){var v=f.primitive.getGeometryInstanceAttributes(f.id);switch(f.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(v.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}},s=this._that||this,r=this,l=this.viwer,c=[],u=0;u<=360;u+=3)p=Math.sin(Cesium.Math.toRadians(u)),h=Math.cos(Cesium.Math.toRadians(u)),d=o*h,m=o*p,c.push(new Cesium.Cartesian3(d,m,0));return f=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,i,n)),v=l.camera.position,g=Cesium.Cartesian3.distance(v,this.origin),b=(y=g/15)/o,Cesium.Matrix4.multiplyByScale(f,new Cesium.Cartesian3(b,b,b),f),t.next=14,this.createAxisSphere("model_edit_zCircle",c,f,Cesium.Color.RED,y);case 14:return C=t.sent,l.scene.primitives.add(C),t.next=18,this.createAxisSphere("model_edit_yCircle",c,f,Cesium.Color.BLUE,y);case 18:return w=t.sent,l.scene.primitives.add(w),k=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),_=Cesium.Matrix4.fromRotationTranslation(k),Cesium.Matrix4.multiply(w.geometryInstances.modelMatrix,_,w.geometryInstances.modelMatrix),t.next=25,this.createAxisSphere("model_edit_xCircle",c,f,Cesium.Color.LIME,y);case 25:x=t.sent,l.scene.primitives.add(x),E=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),S=Cesium.Matrix4.fromRotationTranslation(E),Cesium.Matrix4.multiply(x.geometryInstances.modelMatrix,S,x.geometryInstances.modelMatrix),D=0,this.MapEvent.mouse_move((function(t){M(t)})),this.MapEvent.mouse_left_down((function(t){var e=l.scene.pickPosition(t.position);s.ciclkPosition=e;for(var i=l.scene.drillPick(t.position,10),n=0;n<i.length;n++){var o=i[n];if(o&&o.primitive&&o.id)switch(o.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return l.scene.screenSpaceCameraController.enableRotate=!1,o.primitive.getGeometryInstanceAttributes(o.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,r.activeCircle=o.primitive,void(r.activeModelParam=r.initParam())}}r.activeCircle=null,r.activeModelParam=null,l.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(t){l.scene.screenSpaceCameraController.enableRotate=!0;var e=r.coordCircles;r.activeCircle=null,r.activeModelParam=null;for(var i=0;i<e.length;i++)if(e[i].getGeometryInstanceAttributes){var n=e[i].getGeometryInstanceAttributes(e[i]._name);switch(e[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}));case 34:case"end":return t.stop()}}),t,this)}))),function(e,i,n,o){return t.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.options.position.lng=t,this.options.position.lat=e,this.options.position.alt=i,this.options.rotate={x:n,y:o,z:s},this.controllerCallBack}},{key:"controllerCallBack",get:function(){this._controllerCallBack&&this._controllerCallBack(this.options,!this.activeAxis)},set:function(t){this._controllerCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:{x:1,y:1,z:1},semiMinorAxis:5e5,semiMajorAxis:1e6,rotation:Cesium.Math.PI_OVER_FOUR,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST})}),releaseGeometryInstances:!1,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.YELLOW}}})}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t<this.coordArrows.length;t++)this.viwer.scene.primitives.remove(this.coordArrows[t]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var t=0;t<this.coordCircles.length;t++)this.viwer.scene.primitives.remove(this.coordCircles[t]);this.coordCircles=[]}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeAxis=void 0,this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.viwer.camera.changed.removeEventListener(this.againArrow),this.viwer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"update",value:function(){this.againArrow(),this.againCircle()}}]);var t,e,i}();function xo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Eo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?xo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):xo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function So(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Do(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Do(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Do(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Po(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Mo(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Oo(t,e){return t.get(To(t,e))}function To(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var No=new WeakMap,Bo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),Mo(i=Po(this,e,[t,n]),No,void 0),i.options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options.rotate=n.rotate||!0,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.dashSize=n.dashSize||.03,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["words-name"]=n["words-name"]||"空间长度",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,222,0,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.unitNum=0,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000",this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,1)"}});e._elms.color[i]=n}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=0!==t?100*Math.pow(t,-1):0,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"dashSize",get:function(){return this.options.dashSize},set:function(t){this.options.dashSize=t,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t,e.closeNodeEdit(this),this._elms.rotate&&this._elms.rotate.forEach((function(e){e.checked=t})),this.options.rotate=t,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"space",get:function(){return this.options.space},set:function(t){this.options.space=t,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"length",get:function(){return this.options.length},set:function(t){this.options.length=t,this._elms.length&&this._elms.length.forEach((function(e){e.value=t}))}},{key:"fitLength",get:function(){return this.options.fitLength},set:function(t){this.options.fitLength=t,this._elms.fitLength&&this._elms.fitLength.forEach((function(e){e.value=t}))}},{key:"lengthUnit",get:function(){return this.options["length-unit"]},set:function(t){if(this.unitNum++,this.options["length-unit"]=t,this._elms.lengthUnit&&this._elms.lengthUnit.forEach((function(e){e.value=t})),Oo(No,this)&&Oo(No,this).legp_searchActive(t),this.options.lengthByMeter)if(this.unitNum>2)switch(t){case"米":this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;break;case"千米":this.length=this.noseToTail?(this.options.fitLengthByMeter/1e3).toFixed(5):(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter}else{var e=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;this.lengthUnit=e>1e3||1e3==e?"千米":"米"}}},{key:"wordsName",get:function(){return this.options["words-name"]},set:function(t){this.options["words-name"]=t,this._elms.wordsName&&this._elms.wordsName.forEach((function(e){e.value=t}));var e=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.options.positions,2,t).then((function(t){e.options.lengthByMeter=t,t>1e3||1e3==t?(e.length=(t/1e3).toFixed(5),e.lengthUnit="千米"):(e.length=t,e.lengthUnit="米")}))}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+t-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value,2<t.value&&t.value<13?document.getElementById("dashTextureDom").style.display="flex":document.getElementById("dashTextureDom").style.display="none",2<t.value&&t.value<5?(document.getElementsByClassName("lineSpace")[0].style.display="none",document.getElementsByClassName("lineSpace")[1].style.display="none"):(document.getElementsByClassName("lineSpace")[0].style.display="flex",document.getElementsByClassName("lineSpace")[1].style.display="flex")})),1},o=0;o<i.length&&!n(o);o++);this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){if(this.options["nose-to-tail"]=t,e.closeNodeEdit(this),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}if(t)if(this.options.fitLengthByMeter>1e3||1e3==this.options.fitLengthByMeter){var n=document.getElementsByClassName("input-select-unit")[1];n&&n.querySelectorAll("dd")[1]&&n.querySelectorAll("dd")[1].click()}else{var o=document.getElementsByClassName("input-select-unit")[1];o&&o.querySelectorAll("dd")[0]&&o.querySelectorAll("dd")[0].click()}else if(this.options.lengthByMeter>1e3||1e3==this.options.lengthByMeter){var s=document.getElementsByClassName("input-select-unit")[1];s&&s.querySelectorAll("dd")[1]&&s.querySelectorAll("dd")[1].click()}else{var a=document.getElementsByClassName("input-select-unit")[1];a&&a.querySelectorAll("dd")[0]&&a.querySelectorAll("dd")[0].click()}}},{key:"smooth",get:function(){return this.options.smooth},set:function(t){if(this.options.smooth=t,e.closeNodeEdit(this),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.positionEditing=!1,this.options.heightMode=t||0==t?t:2;var n="";e.closeNodeEdit(this);var o=!1,s=!1,a=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a),this.renewPolygon(a),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=o,this.extend=!1,n="海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=o,this.extend=!1,n="相对地表";break;case"2":case 2:o=!0,s=!0,this.entity.polyline.clampToGround=o,n="依附模型"}this._elms.heightMode&&(this._elms.heightMode.value=n),this._elms.heightModeObject&&this._elms.heightModeObject.legp_searchActive(n),s?(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),this._elms.heightConfirm&&this._elms.heightConfirm.setAttribute("disabled","disabled")):(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.heightConfirm&&this._elms.heightConfirm.removeAttribute("disabled")),setTimeout((function(){o?(i.label.ground=o,i._elms.heightMode&&(i._elms.heightMode.value="依附模型"),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat]):(i.label.ground=o,i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,a[2]],i.options.label.position={lng:i.options.positions[0].lng,lat:i.options.positions[0].lat,alt:a[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(t){if(this.options.extend=t,e.closeNodeEdit(this),t&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(e){e.checked=t})),this.entity)if(this.options.extend){var i=this.renewPositions(this.options.positions);this.renewPolygon(i)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options["extend-width"]},set:function(t){this.options["extend-width"]=t,this.heightMode=this.heightMode,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(e){e.value=t}));var e=this.renewPositions(this.options.positions);this.renewPolygon(e)}},{key:"extendColor",get:function(){return this.options["extend-color"]},set:function(t){var e=this;this.options["extend-color"]=t,this._elms.extendColor&&this._elms.extendColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.extendColor=t},clear:function(){e.extendColor="rgba(255,255,255,1)"}});e._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options["extend-color"]))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show?(this.label.show=t,setTimeout((function(){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){new YJColorPicker(C()({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)",e.labelBackgroundColorStart=color}},"clear",(function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"})));e._elms.labelBackgroundColorStart[i]=labelBackgroundColorStartPicker}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=So(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=So(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=So(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=So(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"judgeLine",value:function(t,e){if(!t.polyline.oriRepeat){var i={color:e.color,image:this.getSourceRootPath()+"/img/arrow/1.png",space:e.space,speed:e.speed};i.speed=e.rotate?i.speed:0-i.speed;var n=document.createElement("canvas"),o=(n.getContext("2d"),new Image);o.src=i.image;var s=this;o.onload=function(){n.width=o.width*(i.space+1),n.height=o.height;var e=s.getSceenLine(t,i,n);e&&(t.polyline.oriRepeat=e);var a=t.polyline.positions.getValue(s.sdk.viewer.clock.currentTime);if(!Cesium.defined(a))return new Cesium.Cartesian2(1,1);for(var r=0,l=0;l<a.length-1;++l)r+=Cesium.Cartesian3.distance(a[l],a[l+1]);var c=r/t.polyline.width.getValue(),u=s.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=s.sdk.viewer.canvas.clientWidth,d=s.sdk.viewer.canvas.clientHeight,m=(c*=s.sdk.viewer.scene.camera.getPixelSize(p,h,d)/u/(i.space*(n.width/n.height*5)+1))/t.polyline.oriRepeat;t.polyline.oriSpeed=m,t.polyline.oriRepeatX=c}}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.scene.pickPosition(n),a=this.sdk.viewer.scene.pickPosition(o),r=Cesium.Cartesian3.distance(s,a)/t.polyline.width.getValue(),l=this.sdk.viewer.camera.positionCartographic.height,c=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),u=this.sdk.viewer.canvas.clientWidth,p=this.sdk.viewer.canvas.clientHeight,h=this.sdk.viewer.scene.camera.getPixelSize(c,u,p);return h>700?r*=h/l/(e.space*(i.width/i.height*5)+1):r=void 0,r}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=31;break}return t.next=6,new Zi(this.sdk,this.options,{title:"线属性",left:"180px",top:"100px",confirmCallBack:function(t){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.label.position[2]},h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),be(h.sdk,h.options.id),re(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack()},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack();for(var t=0;t<h.nodePoints.length;t++)h.sdk.viewer.entities.remove(h.nodePoints[t]);h.nodePoints=[],h.positionEditing=!1},showCallBack:function(t){h.options.show=t,h.originalOptions.show=t,h.show=t,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing},secondaryEditCallBack:function(){h.positionEditing=!1,h.noseToTail=!1,h.heightMode=0,e.nodeEdit(h)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(n=document.createElement("div")).innerHTML=vo(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,new hn("polyline-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){h.color=t},clear:function(){h.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelColor=t},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.extendColor=t},clear:function(){h.extendColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelLineColor=t},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorStart=t},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorEnd=t},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),p=n.getElementsByTagName("*"),Co.on(this,p),this._elms=Co.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.extendColor=[r],this._elms.labelLineColor=[l],this._elms.labelBackgroundColorStart=[c],this._elms.labelBackgroundColorEnd=[u],setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.cameraSelect&&h.cameraSelect(),h.goodsSelect&&h.goodsSelect();var t=h.attributeSelect,i=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var o=Y(i,".attribute-select");o.legp_search(t);for(var s=h._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===h.options.attributeType){s.value=t[a].value,o.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){h.attributeType=t[e].key;break}}))}var r=[{name:"空间长度",value:"空间长度"},{name:"投影长度",value:"投影长度"},{name:"地表长度",value:"地表长度"}],l=Y(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];h._elms.wordsName=[c],c.value=h.options["words-name"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){h.wordsName=r[t].value;break}}))}var p,d,m,f=[{name:"米",value:"米"},{name:"千米",value:"千米"}],v=Y(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit",1);if(d=h,m=v,(p=No).set(To(p,d),m),v){v.legp_search(f);var g=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[1].getElementsByTagName("input")[0];h._elms.lengthUnit=[g],g.value=h.options["length-unit"];for(var y=0;y<f.length;y++)if(f[y].value===g.value){v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){h.lengthUnit=f[t].value;break}}))}var b=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],C=Y(h._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(C){C.legp_search(b);var w=document.createElement("i");w.className="icon icon-active",h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(w);var k=h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];h._elms.lineType=[k];for(var _=0;_<b.length;_++)if(b[_].key===h.options.type){C.legp_searchActive(b[_].value),k.value=b[_].value,w.className="icon icon-active ".concat(b[_].icon);break}k.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===k.value){h.lineType=b[t].key,w.className="icon icon-active ".concat(b[t].icon),2<h.lineType&&h.lineType<13?document.getElementById("dashTextureDom").style.display="flex":document.getElementById("dashTextureDom").style.display="none",2<h.lineType&&h.lineType<5?(document.getElementsByClassName("lineSpace")[0].style.display="none",document.getElementsByClassName("lineSpace")[1].style.display="none"):(document.getElementsByClassName("lineSpace")[0].style.display="flex",document.getElementsByClassName("lineSpace")[1].style.display="flex");break}}))}var x=h._DialogObject._element.content.getElementsByClassName("height-box")[0],E=x.getElementsByClassName("height")[0],S=h._DialogObject._element.content.getElementsByClassName("height-confirm")[0];E.value=10,2==h.heightMode?(x&&(x.className="input-number input-number-unit-1 height-box disabled"),S&&S.setAttribute("disabled","disabled")):(x&&(x.className="input-number input-number-unit-1 height-box"),S&&S.removeAttribute("disabled"));var D=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],P=Y(h._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(P){P.legp_search(D);for(var M=h._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],O=0;O<D.length;O++)if(D[O].key==h.heightMode){M.value=D[O].value,P.legp_searchActive(D[O].value);break}M.addEventListener("input",(function(){for(var t=0;t<D.length;t++)if(D[t].value===M.value){h.heightMode=D[t].key;break}})),E.addEventListener("input",(function(){h.heightMode})),h._elms.height=E,h._elms.heightBox=x,h._elms.heightMode=M,h._elms.heightConfirm=S,h._elms.heightModeObject=P,S.addEventListener("click",(function(){h.positionEditing=!1;for(var t=0;t<h.options.positions.length;t++)h.options.positions[t].alt=Number((h.options.positions[t].alt+Number(E.value)).toFixed(2)),h._elms.alt[t].innerHTML=h.options.positions[t].alt;var i=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),h.positionEditing=!1,e.closeNodeEdit(h)}))}var T=n.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];h._elms.lng=[],h._elms.lngInput=[],h._elms.lat=[],h._elms.latInput=[],h._elms.alt=[],h._elms.altInput=[];for(var N=function(t){var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td">'.concat(t+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=h.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=h.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=h.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=h.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=h.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=h.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(h.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),s.addEventListener("blur",(function(){s.value=Number(h.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){h.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=h.options.positions[t].lng.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(h.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),l.addEventListener("blur",(function(){l.value=Number(h.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){h.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=h.options.positions[t].lat.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=h.heightMode&&(c.innerHTML="",p.value=Number(h.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),h.positionEditing=!1,e.closeNodeEdit(h))})),p.addEventListener("blur",(function(){p.value=Number(h.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){h.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=h.options.positions[t].alt.toFixed(2);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),h._elms.lng.push(o),h._elms.lngInput.push(s),h._elms.lat.push(r),h._elms.latInput.push(l),h._elms.alt.push(u),h._elms.altInput.push(p),T.appendChild(i)},B=0;B<h.options.positions.length;B++)N(B);var L=Nn(),A=Y(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(A){A.legp_search(L);var j=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];j.value=L[h.labelFontFamily].value;for(var I=0;I<L.length;I++)if(L[I].value==j.value){A.legp_searchActive(L[I].value);break}j.addEventListener("input",(function(){for(var t=0;t<L.length;t++)if(L[t].value===j.value){h.labelFontFamily=L[t].key;break}})),h._elms.labelFontFamily=[j]}}),0),t.next=32;break;case 31:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 32:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(t){for(var e=[],i=[],n=[],o=0;o<t.length;o++)n.push(t[o].lng,t[o].lat,t[o].alt),i.push(o/(t.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*t.length,r=0;r<=a;r++){var l=s.evaluate(r/a);e.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return e}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i,n=JSON.parse(JSON.stringify(t));switch(this.heightMode){case 0:case"0":!1;break;case 1:case"1":for(var o=0;o<n.length;o++){var s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n[o].lng,n[o].lat));n[o].alt=Number(s?(n[o].alt+Number(s)).toFixed(2):n[o].alt.toFixed(2))}!1;break;case 2:case"2":!0}var a=[];if(i=this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]?[].concat(L()(n),[n[0]]):L()(n),this.options.smooth&&"false"!==this.options.smooth){i=this.smoothHandle(i);for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat,i[r].alt)}else for(var l=0;l<i.length;l++)a.push(i[l].lng,i[l].lat,i[l].alt);if(this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]||this.options.smooth&&"false"!==this.options.smooth){for(var c=[],u=0;u<a.length;u+=3)c.push({lng:a[u],lat:a[u+1],alt:a[u+2]});var p=this;this.computeDistance(c,2,this.options["words-name"]).then((function(t){p.options.fitLengthByMeter=t,p.lengthUnit=p.options["length-unit"]}))}else{var h=this;this.computeDistance(n,2,this.options["words-name"]).then((function(t){h.options.fitLengthByMeter=t,h.lengthUnit=h.options["length-unit"]}))}var d=this;return this.computeDistance(n,2,this.options["words-name"]).then((function(t){d.options.lengthByMeter=t,d.lengthUnit=e.options["length-unit"]})),a}}},{key:"renewPolygon",value:function(t){var e=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<t.length;n+=3)e.push([t[n],t[n+1]]);for(var o=turf.lineString(e),s=turf.buffer(o,this.options["extend-width"]/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options["extend-color"])})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions["nose-to-tail"],this.smooth=this.originalOptions.smooth,this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions["extend-width"],this.extendColor=this.originalOptions["extend-color"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.rotate=this.originalOptions.rotate,this.speed=this.originalOptions.speed,this.dashSize=this.originalOptions.dashSize,this.space=this.originalOptions.space,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;case 34:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图"+(this.options.attribute.vr.content.length+1),url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图"+(this.options.attribute.vr.content.length+1),url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Eo({},this.options.position):this.options.positions?l=Eo({},this.options.positions[0]):this.options.center?l=Eo({},this.options.center):this.options.start?l=Eo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p<this.options.positions.length;p++)h=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,this.options.positions[p].alt),c.push(h.x,h.y,h.z);return t.abrupt("break",41);case 31:return t.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=t.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return t.abrupt("break",41);case 36:return t.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=t.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return t.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){e.closeNodeEdit(this),this.event&&this.event.destroy(),this.event=new X(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var n=JSON.parse(JSON.stringify(this.options.positions));this.previous={positions:L()(this.options.positions)};for(var o=0;o<n.length;o++)n[o]=Cesium.Cartesian3.fromDegrees(n[o].lng,n[o].lat,n[o].alt);for(var s=n[Math.floor(n.length/2)],a=[],r=0;r<n.length;r++)s.x,n[r].x,a.push({x:s.x-n[r].x,y:s.y-n[r].y,z:s.z-n[r].z});var l=[];this.event.mouse_move((function(t,e){l=[];for(var n=0;n<a.length;n++){var o={x:e.x-a[n].x,y:e.y-a[n].y,z:e.z-a[n].z};l.push(o)}var s=i.cartesian3Towgs84(l[0],i.sdk.viewer);i.label.position=[s.lng,s.lat,s.alt],i.options.label.position={lng:s.lng,lat:s.lat,alt:s.alt},i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),l=[];for(var n=0;n<a.length;n++)l.push({x:e.x-a[n].x,y:e.y-a[n].y,z:e.z-a[n].z});for(var o=[],s=0;s<l.length;s++){var r=i.cartesian3Towgs84(l[s],i.sdk.viewer);r.alt=i.options.positions[s].alt,o.push(r),i._elms.lng&&(i._elms.lng[s].innerHTML=r.lng.toFixed(8)),i._elms.lngInput&&(i._elms.lngInput[s].value=r.lng.toFixed(8)),i._elms.lat&&(i._elms.lat[s].innerHTML=r.lat.toFixed(8)),i._elms.latInput&&(i._elms.latInput[s].value=r.lat.toFixed(8)),i._elms.alt&&(i._elms.alt[s].innerHTML=r.alt.toFixed(2)),i._elms.altInput&&(i._elms.altInput[s].value=r.alt.toFixed(2))}i.options.positions=o,i.previous.positions=o;var c=i.renewPositions(i.options.positions);i.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),i.renewPolygon(c),i.positionEditing=!1})),this.event.mouse_right((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1})),this.event.gesture_pinck_start((function(t,e){var n=new Date;i.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};o-n>=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>0?l:n}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var c=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),this.renewPolygon(c),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,c[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:c[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.options.heightMode,t.next="0"===t.t0||0===t.t0?3:"1"===t.t0||1===t.t0?6:"2"===t.t0||2===t.t0?13:18;break;case 3:return n=!1,i=e.options.positions[0].alt,t.abrupt("break",18);case 6:return n=!1,t.next=9,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat});case 9:return t.t1=t.sent,t.t2=e.options.positions[0].alt,i=t.t1+t.t2,t.abrupt("break",18);case 13:return n=!0,t.next=16,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat});case 16:return i=t.sent,t.abrupt("break",18);case 18:e.options.label.position||(e.options.label.position={lng:e.options.positions[0].lng,lat:e.options.positions[0].lat,alt:i}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:n});case 20:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){var i;i=2==t.heightMode;var n=t.options.positions,o=t.renewPositions(n);t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:t.options.width,clampToGround:i,material:t.getMaterial(t.options.color,t.options.type,t.entity,t.options),zIndex:t.sdk._entityZIndex}}),t.entity.polyline.oriWidth=t.options.width,t.judgeLine(t.entity,t.options),t.sdk._entityZIndex++,e.createLabel(t),t.renewPolygon(o),t.computeDistance(n,2,t.options["words-name"]).then((function(e){t.options.lengthByMeter=e,t.lengthUnit=t.options["length-unit"],be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}));t.sdk.viewer.scene}},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i;e.closeNodeEdit(t),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.ControllerObject=new _o(t.sdk),t.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o),YJ.Measure.SetMeasureStatus(!1)})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<t.options.positions.length;n++){var o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,t.options.positions[n].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.ControllerObject&&t.ControllerObject.destroy(),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[]}}]);var i,n,s,r,l}(Mn);function Lo(t,e){var i=document.createElement("a");i.download=e,i.style.display="none";var n=new Blob([t]);i.href=URL.createObjectURL(n),document.body.appendChild(i),i.click(),document.body.removeChild(i)}var Ao=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new Cesium.EntityCollection;if(t.forEach((function(t){(t instanceof ro||t instanceof fo||t instanceof qn||t instanceof Bo)&&e.add(t.entity)})),e.values.length){var i=Cesium.exportKml({entities:e});i.then((function(t){Lo(t.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},jo={yingguangse:new Map,gonganlan:new Map,hong:new Map};jo.yingguangse.set("--color-sdk-base","#00ffff"),jo.yingguangse.set("--color-sdk-auxiliary","#004242"),jo.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),jo.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),jo.yingguangse.set("--color-sdk-warning-1","#F16C55"),jo.yingguangse.set("--color-sdk-warning-2","#FFA145"),jo.yingguangse.set("--color-sdk-warning-3","#FFDF53"),jo.yingguangse.set("--color-sdk-text-head","#FFFFFF"),jo.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),jo.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),jo.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),jo.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var Io,Fo,Ro,zo=null,Ho=0,Vo=0,Go=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return C=function(t){var i=u.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=u.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(d+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(t.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),o.addEventListener("click",(function(t){if(t.target.parentNode===o){var e=u.getElementsByClassName("tr active")[0];e&&(e.className="tr"),o.className="tr active";for(var n=0;n<i.length;n++)if(i[n]===o){l=n+1;break}}})),o.addEventListener("dblclick",(function(t){if(t.target.parentNode===o)for(var e=0;e<i.length;e++)if(i[e]===o){s.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(m[e].position.lng,m[e].position.lat,m[e].position.alt),orientation:m[e].orientation,duration:1});break}}));var a=o.getElementsByClassName("play")[0],r=o.getElementsByClassName("delete")[0],c=o.querySelector("input[name='time']");a.addEventListener("click",(function(){for(var t=0;t<i.length;t++)i[t]===r.parentNode.parentNode&&Wo(e,m,t)})),r.addEventListener("click",(function(t){for(var e=0;e<i.length;e++)if(i[e]===r.parentNode.parentNode){if(m.splice(e,1),m[m.length-1]&&(m[m.length-1].duration=0),u.removeChild(o),l>e+1?(l--,i[l-1].className="tr active"):l==e+1&&(i.length==e&&(l-=1),0!=i.length&&(i[l-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),c.addEventListener("input",(function(e){y.checked=!1,t.duration=Number(c.value),t.duration<0&&(t.duration=0)})),c.addEventListener("blur",(function(){c.value=Number(Number(c.value).toFixed(2)),c.value<0&&(c.value=0)})),u.insertBefore(o,i[l]),l++,i[i.length-1].querySelector("input[name='time']").disabled="disabled"},i=w.length>1&&void 0!==w[1]?w[1]:{},n=w.length>2&&void 0!==w[2]?w[2]:{},o=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(Ho=Number(i.repeat)),s=e.viewer,r=new si(e),l=0,zo&&zo.close&&(zo.close(),zo=null),t.next=12,new W(s._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){Yo({viewer:s})}});case 12:return zo=t.sent,t.next=15,zo.init();case 15:for((c=document.createElement("div")).className="fly-roam",c.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" type="text" name="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">设置总时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">\n <span class="unit" style="top: 6px;">秒(s)</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">是否循环播放</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="add-point"><svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点</button>\n </div>\n <div class="col">\n <button class="modify-point"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>调整视点</button>\n </div>\n <div class="col">\n <button class="afreshPlay"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n <div class="col">\n <button class="cease"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>结束</button>\n </div>\n </div>\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">时长(s)</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',zo.contentAppChild(c),c.getElementsByTagName("*"),u=c.getElementsByClassName("table-body")[0],p=c.getElementsByClassName("table-empty")[0],h={set:function(t,e,i){return t[e]=i,t.length>0?p.style.display="none":p.style.display="flex",!0}},d=0,m=new Proxy([],h),d=0;d<i.points.length;d++)m.push(i.points[d]),C(i.points[d]);(f=c.querySelector("input[name='name']")).value=o,f.addEventListener("input",(function(){o=f.value})),(v=document.createElement("button")).innerHTML="保存",v.addEventListener("click",(function(){o||(o="漫游路径",f.value=o);var t=[];m.map((function(e){t.push(e)})),n.clickSavePath&&n.clickSavePath({name:o,points:t,repeat:Ho+""})})),zo.footAppChild(v),c.getElementsByClassName("cease")[0].addEventListener("click",(function(){s.camera.cancelFlight()})),c.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){m.length>0&&Wo(e,m,0)})),c.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:r.cartesian3Towgs84(s.camera.position,s),orientation:{heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}};m.splice(l,0,t),C(t),d++})),c.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(l){var t=r.cartesian3Towgs84(s.camera.position,s);m[l-1].position=t,m[l-1].orientation={heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}}})),g=c.querySelector("input[name='totalTime']"),y=c.querySelector("input[name='isTotalTime']"),b=c.querySelector("input[name='repeat']"),y.addEventListener("change",(function(){var t=u.getElementsByClassName("tr");if(y.checked&&t.length>0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)m[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),g.addEventListener("blur",(function(){var t=u.getElementsByClassName("tr");if(g.value=Number(g.value),g.value<0&&(g.value=0),y.checked&&t.length>0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)m[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),b.checked=Ho===1/0,b.addEventListener("change",(function(){Ho=b.checked?1/0:0,Vo=Ho,n.changeRepeatStateCallBack&&n.changeRepeatStateCallBack(b.checked)}));case 48:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Uo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;Io&&Io.destroy(),(Io=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){Yo(t)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var s,r=t.viewer;r.camera.cancelFlight(),Ye(t),Je(t),r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e[i].position.lng,e[i].position.lat,e[i].position.alt),orientation:e[i].orientation,duration:n?e[i-1].duration:.5,maximumHeight:e[i].position.alt,complete:(s=o()(a.a.mark((function n(){return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=e.length-1?Uo(t,e,i,!0):Vo&&e.length>1?(Vo--,Uo(t,e,0)):Io&&Io.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return s.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},Wo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;Vo=Ho,Uo(t,e,i,n)},Yo=function(t){t&&t.viewer&&t.viewer.camera.cancelFlight(),Io&&Io.destroy()},Jo=null,qo=null,Xo=null,Zo=null,Ko="uniform sampler2D colorTexture;//输入的场景渲染照片\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainWidth;\n uniform float rainSpeed;\n\n float hash(float x){\n return fract(sin(x*133.3)*13.13);\n }\n void main(void){\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a= tiltAngle;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*rainSize+1.;\n float v=1.-sin(hash(floor(uv.x*rainWidth))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b; //屏幕上雨的颜色\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //将雨和三维场景融合\n }",$o="uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSize;\n uniform float snowSpeed;\n \n float snow(vec2 uv,float scale)\n {\n float time = czm_frameNumber / snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n }\n ",Qo="\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates);\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates);\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\n if (f < 0.0) f = 0.0;\n else if (f > 1.0) f = 1.0;\n gl_FragColor = mix(origcolor, fogColor, f);\n }\n ";var ts,es,is,ns={},os=void 0,ss=void 0,as=!1,rs={};function ls(){if(this.sdk&&this.sdk.viewer){(ss=this.sdk.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight/(2-(90+this.sdk.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(ss=this.sdk.viewer.camera.position);var t=Fo.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,e=Fo.cartesian3Towgs84(ss,this.sdk.viewer);t>9e6&&(t=9e6),t<1e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),os=new Cesium.Rectangle(Cesium.Math.toRadians(e.lng-t/12e4),Cesium.Math.toRadians(e.lat-t/28e4),Cesium.Math.toRadians(e.lng+t/12e4),Cesium.Math.toRadians(e.lat+t/28e4))}}function cs(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var us,ps,hs=null,ds=null,ms=null,fs=null,vs=!1,gs=10,ys="#ffd000",bs=!0,Cs=2.5,ws="#43cf7c",ks=!0,_s=1.8,xs="#ff0000",Es=!1,Ss=1,Ds="#64b6d9",Ps=!1,Ms=1,Os="#d084d1";function Ts(){if(ps){var t=ps.viewer.camera.positionCartographic;Cesium.Math.toDegrees(t.height)<1e6?ps.viewer.scene.globe.material||!0!==vs||Bs(ps):Ls(ps)}}function Ns(){return(Ns=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m=function(t){var e=t.target.value;return(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min))),e},ps=e,e&&!hs){t.next=4;break}return t.abrupt("return");case 4:return ds||As(),us||(us=new si(e)),t.next=8,new Zi(e,{},{title:"全局等高线",left:"180px",top:"100px",closeCallBack:function(){hs=null}});case 8:(hs=t.sent)._element.body.className=hs._element.body.className+" contour",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">等高线</span>\n <input class="btn-switch show" type="checkbox">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label">等高距</span>\n <div class="input-number input-number-unit-1">\n <input class="input equal-height-distance" type="number" title="" min="1" max="1000">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 60px;">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 157px;">\n <span class="label">选中线颜色</span>\n <div class="active-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">计曲线</span>\n <input class="btn-switch index-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">计曲线颜色</span>\n <div class="index-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">计曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input index-contour-width" type="number" title="" step="0.1" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">首曲线</span>\n <input class="btn-switch intermediate-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">首曲线颜色</span>\n <div class="intermediate-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">首曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input intermediate-contour-width" type="number" step="0.1" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">间曲线</span>\n <input class="btn-switch halfInterval-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">间曲线颜色</span>\n <div class="halfInterval-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">间曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input halfInterval-contour-width" type="number" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">助曲线</span>\n <input class="btn-switch supplementary-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">助曲线颜色</span>\n <div class="supplementary-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">助曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input supplementary-contour-width" type="number" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',hs.contentAppChild(i),e.viewer.scene.postRender.removeEventListener(Ts),e.viewer.scene.postRender.addEventListener(Ts),(n=i.getElementsByClassName("show")[0]).checked=vs,n.addEventListener("change",(function(t){if(t.target.checked){if(vs=!0,e.viewer.camera.positionCartographic.height>16360){var i=e.viewer.camera.positionCartographic,n={position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}};Re(e,n,.5)}Bs(e)}else vs=!1,Ls(e)})),(o=i.getElementsByClassName("equal-height-distance")[0]).value=gs,o.addEventListener("blur",(function(t){var e=m(t);gs=e,o.value=e,ds&&(ds.uniforms.spacing=5*gs)})),new Oi({el:i.getElementsByClassName("active-color")[0],size:"mini",alpha:!0,defaultColor:ys,disabled:!1,openPickerAni:"opacity",sure:function(t){ys=t,ds&&(ds.uniforms.activeColor=Cesium.Color.fromCssColorString(ys))},clear:function(){ys="rgba(255,255,255,1)",ds&&(ds.uniforms.activeColor=Cesium.Color.fromCssColorString(ys))}}),(s=i.getElementsByClassName("index-contour-switch")[0]).checked=bs,s.addEventListener("change",(function(t){bs=t.target.checked,ds&&(ds.uniforms.indexContourShow=bs)})),new Oi({el:i.getElementsByClassName("index-contour-color")[0],size:"mini",alpha:!0,defaultColor:ws,disabled:!1,openPickerAni:"opacity",sure:function(t){ws=t,ds&&(ds.uniforms.indexContourColor=Cesium.Color.fromCssColorString(ws))},clear:function(){ws="rgba(255,255,255,1)",ds&&(ds.uniforms.indexContourColor=Cesium.Color.fromCssColorString(ws))}}),(r=i.getElementsByClassName("index-contour-width")[0]).value=Cs,r.addEventListener("blur",(function(t){var e=m(t);Cs=e,r.value=e,ds&&(ds.uniforms.indexContourWidth=Cs)})),(l=i.getElementsByClassName("intermediate-contour-switch")[0]).checked=ks,l.addEventListener("change",(function(t){ks=t.target.checked,ds&&(ds.uniforms.intermediateContourShow=ks)})),new Oi({el:i.getElementsByClassName("intermediate-contour-color")[0],size:"mini",alpha:!0,defaultColor:xs,disabled:!1,openPickerAni:"opacity",sure:function(t){xs=t,ds&&(ds.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(xs))},clear:function(){xs="rgba(255,255,255,1)",ds&&(ds.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString(xs))}}),(c=i.getElementsByClassName("intermediate-contour-width")[0]).value=_s,c.addEventListener("blur",(function(t){var e=m(t);_s=e,c.value=e,ds&&(ds.uniforms.intermediateContourWidth=_s)})),(u=i.getElementsByClassName("halfInterval-contour-switch")[0]).checked=Es,u.addEventListener("change",(function(t){Es=t.target.checked,ds&&(ds.uniforms.halfIntervalContourShow=Es)})),new Oi({el:i.getElementsByClassName("halfInterval-contour-color")[0],size:"mini",alpha:!0,defaultColor:Ds,disabled:!1,openPickerAni:"opacity",sure:function(t){Ds=t,ds&&(ds.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(Ds))},clear:function(){Ds="rgba(255,255,255,1)",ds&&(ds.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(Ds))}}),(p=i.getElementsByClassName("halfInterval-contour-width")[0]).value=Ss,p.addEventListener("blur",(function(t){var e=m(t);Ss=e,p.value=e,ds&&(ds.uniforms.halfIntervalContourWidth=Ss)})),(h=i.getElementsByClassName("supplementary-contour-switch")[0]).checked=Ps,h.addEventListener("change",(function(t){Ps=t.target.checked,ds&&(ds.uniforms.supplementaryContourShow=Ps)})),new Oi({el:i.getElementsByClassName("supplementary-contour-color")[0],size:"mini",alpha:!0,defaultColor:Os,disabled:!1,openPickerAni:"opacity",sure:function(t){Os=t,ds&&(ds.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(Os))},clear:function(){Os="rgba(255,255,255,1)",ds&&(ds.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(Os))}}),(d=i.getElementsByClassName("supplementary-contour-width")[0]).value=Ms,d.addEventListener("blur",(function(t){var e=m(t);Ms=e,d.value=e,ds&&(ds.uniforms.supplementaryContourWidth=Ms)}));case 50:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Bs(t){var e=t.viewer.camera.positionCartographic;Cesium.Math.toDegrees(e.height)>1e6||(ms&&ms.destroy(),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]||t.viewer.container.appendChild(fs),(ms=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){var i=t.viewer.scene.pickPosition(e.endPosition);if(i){var n=0,o=0;if(t.viewer&&t.viewer._element){var s=t.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];n=s.getBoundingClientRect().top+window.scrollY,o=s.getBoundingClientRect().left+window.scrollX}fs.style.left=e.endPosition.x-50+o+"px",fs.style.top=e.endPosition.y-40+n+"px",fs.style.display="block";var a=us.cartesian3Towgs84(i,t.viewer),r=Math.floor(a.alt/ds.uniforms.spacing)*ds.uniforms.spacing,l=a.alt-r,c=ds.uniforms.spacing/(ds.uniforms.secondaryLinesCount+1),u=Math.floor(l/c)*c+r;a.alt<0&&(a.alt=0),a.alt-u>c/2&&(u+=c),ds.uniforms.mouseHeight=a.alt,ds.uniforms.mousePosition=i,fs.innerHTML="".concat(u.toFixed(0))}else fs.style.display="none"}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.viewer.scene.globe.material=ds)}function Ls(t){ms&&(ms.destroy(),ms=null),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]&&(fs.style.display="none",t.viewer.container.removeChild(fs)),t.viewer.scene.globe.material=null}function As(){Cesium.Material._materialCache._materials.ElevationContour.fabric.source="\nuniform vec4 activeColor; // 选中颜色\nuniform float spacing; // 等高距\n\n// 计曲线\nuniform bool indexContourShow;\nuniform float indexContourWidth;\nuniform vec4 indexContourColor;\n// 首曲线\nuniform bool intermediateContourShow;\nuniform float intermediateContourWidth;\nuniform vec4 intermediateContourColor;\n// 间曲线\nuniform bool halfIntervalContourShow;\nuniform float halfIntervalContourWidth;\nuniform vec4 halfIntervalContourColor;\n// 助曲线\nuniform bool supplementaryContourShow;\nuniform float supplementaryContourWidth;\nuniform vec4 supplementaryContourColor;\n\nuniform float mouseHeight;\n\nuniform float secondaryLinesCount; // 0=无次线, 1=1条次线, 2=2条次线...\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // 主等高线计算\n float distanceToMainContour = mod(materialInput.height, spacing);\n \n // 抗锯齿计算\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dFMain = max(dxc, dyc) * czm_pixelRatio * indexContourWidth;\n#else\n float dFMain = czm_pixelRatio * indexContourWidth;\n#endif\n\n bool isMainContour = distanceToMainContour < dFMain;\n bool isSecondaryContour = false;\n float dFSecondary = 0.0;\n float secondarySpacing = 0.0;\n bool isHalfInterval = false;\n bool isIntermediate= false;\n\n // 计算当前高度所属的等高线高度\n float mainContourHeight = floor(materialInput.height / spacing) * spacing;\n float secondaryContourHeight = floor(materialInput.height / spacing * (secondaryLinesCount + 1.0)) * spacing / (secondaryLinesCount + 1.0);\n \n // 计算次线在两条主等高线之间的相对位置\n float relativeHeight = materialInput.height - mainContourHeight;\n float normalizedPosition = relativeHeight / spacing;\n \n // 计算次线索引(从主等高线开始计数)\n float lineIndex = floor(normalizedPosition * (secondaryLinesCount + 1.0));\n\n // 只有当存在次线时才计算次线\n if(secondaryLinesCount > 0.0) {\n float secondaryLinesWidth = supplementaryContourWidth;\n secondarySpacing = spacing / (secondaryLinesCount + 1.0);\n float distanceToSecondaryContour = mod(materialInput.height, secondarySpacing);\n \n // 确保次线不会与主线重叠\n float minDistanceToMain = min(distanceToMainContour, spacing - distanceToMainContour);\n bool notCloseToMain = minDistanceToMain > dFMain * 2.0; // 2倍线宽缓冲\n\n\n if (lineIndex > 0.0 && lineIndex < secondaryLinesCount) {\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isHalfInterval = abs(mod(lineIndex, 2.0)) < 0.01;\n if(isHalfInterval) {\n secondaryLinesWidth = halfIntervalContourWidth;\n }\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isIntermediate = abs(mod(lineIndex, 4.0)) < 0.01;\n if(isIntermediate) {\n secondaryLinesWidth = intermediateContourWidth;\n }\n }\n\n\n\n\n\n\n\n\n \n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n dFSecondary = max(dxc, dyc) * czm_pixelRatio * secondaryLinesWidth;\n#else\n dFSecondary = czm_pixelRatio * secondaryLinesWidth;\n#endif\n\n isSecondaryContour = (distanceToSecondaryContour < dFSecondary) && notCloseToMain;\n }\n\n // 高亮判断\n bool shouldHighlight = false;\n if(isMainContour && abs(mainContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n } else if(isSecondaryContour && abs(secondaryContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n }\n\n // 颜色输出\n vec4 outColor;\n if(shouldHighlight) {\n outColor = czm_gammaCorrect(vec4(activeColor.rgb, activeColor.a));\n } else if(isMainContour) {\n float a = indexContourColor.a;\n if(!indexContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(indexContourColor.rgb, a));\n } else if(isSecondaryContour) {\n float a = supplementaryContourColor.a;\n if(!supplementaryContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(supplementaryContourColor.rgb, a));\n if(isHalfInterval) {\n float a = halfIntervalContourColor.a;\n if(!halfIntervalContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(halfIntervalContourColor.rgb, a));\n }\n if(isIntermediate) {\n float a = intermediateContourColor.a;\n if(!intermediateContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(intermediateContourColor.rgb, a));\n }\n } else {\n outColor = vec4(0.0);\n }\n\n if(materialInput.height<0.0) {\n outColor = vec4(0.0);\n }\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n",ds=new Cesium.Material({fabric:{type:"ElevationContour",uniforms:{spacing:50,activeColor:Cesium.Color.fromCssColorString(ys),mouseHeight:-1e5,mousePosition:new Cesium.Cartesian3(0,0,0),secondaryLinesCount:19,cameraHeight:0,indexContourShow:bs,indexContourWidth:Cs,indexContourColor:Cesium.Color.fromCssColorString(ws),intermediateContourShow:ks,intermediateContourWidth:_s,intermediateContourColor:Cesium.Color.fromCssColorString(xs),halfIntervalContourShow:Es,halfIntervalContourWidth:Ss,halfIntervalContourColor:Cesium.Color.fromCssColorString(Ds),supplementaryContourShow:Ps,supplementaryContourWidth:Ms,supplementaryContourColor:Cesium.Color.fromCssColorString(Os)}}})}function js(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Is(t,e,i){return t.set(Rs(t,e),i),i}function Fs(t,e){return t.get(Rs(t,e))}function Rs(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(fs=document.createElement("div")).className="YJ-customize-active-height-elm",fs.style.position="absolute",fs.style.left="10px",fs.style.top="10px",fs.style.width="100px",fs.style.textAlign="center",fs.style.pointerEvents="none",fs.style.color="#ff0000",fs.style.display="none";var zs=new WeakMap,Hs=new WeakMap,Vs=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;k()(this,t),js(this,zs,null),js(this,Hs,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=e,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new si(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var t=this;this.options.host=this.options.host||h();var e;e=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+e,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(e){t.reconnecting.onmessage=function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data=JSON.parse(i.data),!t.data||!t.data.rmc){e.next=7;break}return e.next=4,t._tools.getClampToHeight(t.data.rmc);case 4:n=e.sent,t.position=new Cesium.Cartesian3.fromDegrees(t.data.rmc.lng,t.data.rmc.lat,n),t.create();case 7:t._webSocketCallback&&t._webSocketCallback(t.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}},{key:"create",value:function(){var t=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var e=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return t.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(e),this.entity.entities.add(i)}}},{key:"loaded",value:function(t){var e;Object.defineProperty(this,"data",{get:function(){return e},set:function(i){e=i,t&&(t(),t=void 0)}})}},{key:"getcanvas",value:function(){var t=this,e=[{images:this._tools.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(this.data.rmc.lng.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(this.data.rmc.lat.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/h.png",text:"海拔:"+parseFloat(this.data.rmc.alt.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/satellite.png",text:"卫星:"+this.data.satellites||!1}];if(Fs(zs,this)){var i=Fs(zs,this).getContext("2d");i.clearRect(0,0,Fs(zs,this).width,Fs(zs,this).height),i.drawImage(Fs(Hs,this).bgimg,0,0,Fs(zs,this).width,Fs(zs,this).height);var n=0;e.forEach((function(o,s){i.drawImage(Fs(Hs,t)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===e.length&&(t.lableCanvas=Fs(zs,t).toDataURL())}))}else{Is(zs,this,document.createElement("canvas"));var o=Fs(zs,this).getContext("2d");Fs(zs,this).width=220,Fs(zs,this).height=140;var s=new Image;Fs(Hs,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,Fs(zs,t).width,Fs(zs,t).height),e.forEach((function(i,n){var s=new Image;Fs(Hs,t)["img"+(n+1)]=s,s.src=i.images,s.onload=function(){o.drawImage(s,12,12+26*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText(i.text,44,28+26*n),++a===e.length&&(t.lableCanvas=Fs(zs,t).toDataURL())}}))}}}},{key:"flyTo",value:(t=o()(a.a.mark((function t(){var e,i,n=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){t.next=9;break}return t.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=t.sent,ei(0),Ye(this.sdk),Je(this.sdk),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Cartesian3.fromDegrees(this.data.rmc.lng,this.data.rmc.lat,i+(e.height||500))});case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){Is(zs,this,null),Is(Hs,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var t}();var Gs=i(9),Us=i.n(Gs);function Ws(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Ys=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),(i=Ws(this,e,[t,n])).viewer=t.viewer,i.entityHasCreated=!1,i.event=null,i.tip=null,i.points_ids=[],i.color=n.color||"rgba(185,14,14,0.58)",i._is2D=o,i._sdk2D=Pe(),i}return qi()(e,t),x()(e,[{key:"create_point",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return e.entities.add(new Cesium.Entity({id:i,position:t,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t),!this._is2D&&this._sdk2D&&this._sdk2D.viewer&&this._sdk2D.viewer.entities&&this._sdk2D.viewer.entities.removeById(t)}},{key:"start",value:function(){}},{key:"end",value:function(){var t=this;YJ.Measure.SetMeasureStatus(!1),this.entityHasCreated=!1,this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy(),this.points_ids.forEach((function(e){t.remove_entity(e)}))}}])}(si);function Js(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function qs(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Js(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Js(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Xs(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Zs=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Xs(this,e,[t,n])).polygonHasCreated=!1,i}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=[];this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",r.positions=c.concat(qs({},i)),r.tip.setPosition(i,t.position.x,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(t(null,u),r.end())})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(qs({},e)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(qs({},i)),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(t(null,u),r.end())})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(qs({},e)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(Ys),Ks=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.sdk=e,this.viewer=e.viewer,this.height=i.height||70,this.maxHeigh=-1e6,this.precision=i.precision||125,this.Dialog=n,this.result={allArea:"",cutArea:"",cutVolume:"",fillArea:"",fillVolume:"",noArea:""},this.entities=[],this.Draw=new Zs(this.sdk),YJ.Analysis.AnalysesResults.push(this),t.EditBox(this)}),[{key:"create",value:function(){var t=this;this.clean(),this.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("最少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"最少需要三个坐标!",type:"warning",duration:1500}))}for(var n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat,i[o].alt);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n),t.createPolygonGeo(t.positions),t.result=t.VolumeAnalysis(),t.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1}))}},{key:"createPolygonGeo",value:function(t){var e=Math.PI/Math.pow(2,11);e/=this.precision;var i=new Cesium.PolygonGeometry.fromPositions({positions:t,vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:e});this.geom=new Cesium.PolygonGeometry.createGeometry(i)}},{key:"VolumeAnalysis",value:function(){var t=0,e=0,i=0,n=0,o=0,s=this.geom.indices;if(this.geom&&this.geom.attributes&&this.geom.attributes.position){for(var a=this.geom.attributes.position.values,r=0;r<s.length;r+=3){var l=this.returnPosition(a,s[r]),c=this.returnPosition(a,s[r+1]),u=this.returnPosition(a,s[r+2]),p=this.viewer.entities.add({name:"三角面",polygon:{hierarchy:[l.heightPos,c.heightPos,u.heightPos],perPositionHeight:!0,material:Cesium.Color.fromRandom(),extrudedHeight:this.height,outline:!0,outlineColor:Cesium.Color.BLACK}});this.entities.push(p);var h=this.computeArea4Triangle(l.noHeightPos,c.noHeightPos,u.noHeightPos),d=(l.height+c.height+u.height)/3;if(d<this.height)i+=h,n+=h*(this.height-d);else if(d==this.height)o+=h;else{t+=h,e+=h*(d-this.height)}}var m=t+i+o;return this.result.allArea=m,this.result.cutArea=t,this.result.cutVolume=e,this.result.fillArea=i,this.result.fillVolume=n,this.result.noArea=o,this.result}}},{key:"computeCentroid4Polygon",value:function(t){for(var e=[],i=[],n=0,o=0,s=0;s<t.length;s++){var a=Cesium.Cartographic.fromCartesian(t[s]);n+=a.longitude,o+=a.latitude,e.push(a.longitude),i.push(a.latitude)}var r=n/t.length,l=o/t.length,c=new Cesium.Cartographic(r,l);return Cesium.Cartesian3.fromRadians(c.longitude,c.latitude,this.maxHeigh+30)}},{key:"computeArea4Triangle",value:function(t,e,i){var n=Cesium.Cartesian3.distance(t,e),o=Cesium.Cartesian3.distance(e,i),s=Cesium.Cartesian3.distance(i,t),a=(n+o+s)/2;return Math.sqrt(a*(a-n)*(a-o)*(a-s))}},{key:"returnPosition",value:function(t,e){var i=new Cesium.Cartesian3(t[3*e],t[3*e+1],t[3*e+2]),n=Cesium.Cartographic.fromCartesian(i),o=this.viewer.scene.sampleHeightSupported?this.viewer.scene.sampleHeight(n):this.viewer.scene.globe.getHeight(n);return o>this.maxHeigh&&(this.maxHeigh=o),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,o),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:o}}},{key:"clean",value:function(){this.Draw&&this.Draw.end();for(var t=0;t<this.entities.length;t++)this.viewer.entities.remove(this.entities[t])}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"EditBox",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),t.next=3,new W(e.sdk.viewer._container,{title:"土方分析",left:"180px",top:"100px",closeCallBack:function(){e.clean(),e.Dialog.closeCallBack&&e.Dialog.closeCallBack()}});case 3:return e._DialogObject=t.sent,t.next=6,e._DialogObject.init();case 6:(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">绘制分析区域</span>\n <button class="draw-btn"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>开始绘制</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">基准高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-999999" max="999999" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="1250" name="precision">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">总分析面积:</span>\n <span class="text-number" name="allArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">无须填挖面积:</span>\n <span class="text-number" name="noArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方面积:</span>\n <span class="text-number" name="fillArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方面积:</span>\n <span class="text-number" name="cutArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方体积:</span>\n <span class="text-number" name="fillVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方体积:</span>\n <span class="text-number" name="cutVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',e._DialogObject.contentAppChild(i),e._DialogObject._element.body.className=e._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=e.height,n.addEventListener("blur",(function(t){var i=t.target.value;"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),n.value=i,e.height=n.value)})),(o=i.querySelector("input[name='precision']")).value=e.precision,o.addEventListener("blur",(function(t){var i=Number(t.target.value);t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),o.value=i,e.precision=o.value})),(s=i.querySelector("span[name='allArea']")).innerHTML=e.result.allArea||0,Object.defineProperty(e.result,"allArea",{get:function(){return s.innerHTML},set:function(t){s.innerHTML=Number(t.toFixed(4))}}),(r=i.querySelector("span[name='fillArea']")).innerHTML=e.result.fillArea||0,Object.defineProperty(e.result,"fillArea",{get:function(){return r.innerHTML},set:function(t){r.innerHTML=Number(t.toFixed(4))}}),(l=i.querySelector("span[name='fillVolume']")).innerHTML=e.result.fillVolume||0,Object.defineProperty(e.result,"fillVolume",{get:function(){return l.innerHTML},set:function(t){l.innerHTML=Number(t.toFixed(4))}}),(c=i.querySelector("span[name='cutArea']")).innerHTML=e.result.cutArea||0,Object.defineProperty(e.result,"cutArea",{get:function(){return c.innerHTML},set:function(t){c.innerHTML=Number(t.toFixed(4))}}),(u=i.querySelector("span[name='cutVolume']")).innerHTML=e.result.cutVolume||0,Object.defineProperty(e.result,"cutVolume",{get:function(){return u.innerHTML},set:function(t){u.innerHTML=Number(t.toFixed(4))}}),(p=i.querySelector("span[name='noArea']")).innerHTML=e.result.noArea||0,Object.defineProperty(e.result,"noArea",{get:function(){return p.innerHTML},set:function(t){p.innerHTML=Number(t.toFixed(4))}}),i.getElementsByClassName("draw-btn")[0].addEventListener("click",(function(){e.create()}));case 36:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]);var t}();function $s(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Qs(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Qs(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ta(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ea=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=ta(this,e,[t,n])).sdk=t,i.options={},i.options.name=n.name,i.options.risingSpeed=1,i.options.minWaterLevel=0,i.options.maxWaterLevel=0,i.options.waterVolume=0,i.currentWaterLaver,i.color="#00d9ff66",i.Dialog=o,i.Draw=new Zs(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},YJ.Analysis.AnalysesResults.push(i),e.EditBox(i),i}return qi()(e,t),x()(e,[{key:"move",value:function(){var t=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate);var e=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},e).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start();var i=this._DialogObject._element.body,n=i.getElementsByClassName("pause")[0];i.getElementsByClassName("start")[0].style.display="none",n.style.display="flex"}},{key:"restart",value:function(){var t=this;this.currentWaterLaver=this.options.minWaterLevel;var e=!1;this.TweenAnimate&&(e=this.TweenAnimate._isPaused,TWEEN.remove(this.TweenAnimate));var i=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},i).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start(),e&&this.pause()}},{key:"start",value:function(){this.TweenAnimate&&this.TweenAnimate.resume()}},{key:"pause",value:function(){this.TweenAnimate&&this.TweenAnimate.pause()}},{key:"calculateVolumeHeight",value:function(){that.options.maxWaterLevel}},{key:"flyTo",value:function(){if(this.positions&&0!==this.positions.length){Ye(this.sdk),Je(this.sdk);for(var t=[],e=0;e<this.positions.length;e++){var i=Cesium.Cartesian3.fromDegrees(this.positions[e].lng,this.positions[e].lat,this.options.maxWaterLevel);t.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(t);this.sdk.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}}},{key:"destroy",value:function(){this.TweenAnimate&&TWEEN.remove(this.TweenAnimate),this.Draw.end(),this.sdk.viewer.entities.remove(this.entity),this.entity=null}}],[{key:"create",value:function(t){t.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("至少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"至少需要三个坐标!",type:"warning",duration:1500}))}if(t.destroy(),!i||0==i.length)return t.positions=[],t._positions=[],t.options.minWaterLevel=0,t.options.maxWaterLevel=0,t.options.waterVolume=0,void(t.area=0);var n=[];t.positions=i,t._positions=i,t.options.minWaterLevel=i[0].alt;for(var o=0;o<i.length;o++)t.options.minWaterLevel>i[o].alt&&(t.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);var s=Cesium.Cartesian3.fromDegreesArray(n);t.currentWaterLaver=t.options.minWaterLevel,t.entity=t.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(s),height:new Cesium.CallbackProperty((function(){return t.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return t.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(t.color)}}),t.area=t.computeArea(i),t.TweenAnimate&&(TWEEN.remove(t.TweenAnimate),t.TweenAnimate=null);var a=t._DialogObject._element.body,r=a.getElementsByClassName("pause")[0];a.getElementsByClassName("start")[0].style.display="flex",r.style.display="none"}))}},{key:"EditBox",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">水量</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="waterVolume">\n <span class="unit">m³</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最小水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="minWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">水面面积</span>\n <div class="input-number input-number-unit-3">\n <input class="input area" type="number" readonly="readonly" type="text">\n <span class="unit">㎡</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最大水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="maxWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row subtitle-box">\n <span class="subtitle">上升速度</span>\n </div>\n <div class="row">\n <div class="col">\n <input type="range" max="50" min="0" step="0.01" name="risingSpeed">\n <div class="input-number input-number-unit-3" style="flex: 0 0 110px;margin-left: 10px;">\n <input class="input" type="number" title="" name="risingSpeed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col operate-btn-box">\n <button class="draw"><svg class="icon-draw"><use xlink:href="#yj-icon-draw"></use></svg>绘制范围</button>\n <button class="flyto"><svg class="icon-positions"><use xlink:href="#yj-icon-positions"></use></svg>定位</button>\n <button class="reset"><svg class="icon-reset"><use xlink:href="#yj-icon-reset"></use></svg>重置</button>\n <button class="analog"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>开始模拟</button>\n <button class="pause" style="margin-right: 0px;"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>暂停</button>\n <button class="start" style="display: none;margin-right: 0px;"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n </div>\n </div>\n \n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">经度</div>\n <div class="th">纬度</div>\n <div class="th">高程</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n <span class="custom-divider" style="margin-top: 20px;"></span>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).className="el-button",o.innerHTML="暂停",o.style.width="80px",n.getElementsByClassName("draw")[0].addEventListener("click",(function(){e.create(i)})),n.getElementsByClassName("analog")[0].addEventListener("click",(function(){i.move()})),n.getElementsByClassName("flyto")[0].addEventListener("click",(function(){i.flyTo()})),n.getElementsByClassName("reset")[0].addEventListener("click",(function(){i.restart()})),s=n.getElementsByClassName("pause")[0],r=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",r.style.display="flex"})),r.addEventListener("click",(function(){i.start(),r.style.display="none",s.style.display="flex"})),(l=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,l[1].value=i.options.risingSpeed,l[0].addEventListener("input",(function(t){i.options.risingSpeed=Number(t.target.value)})),l[1].addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value),n=Number(l[0].max),o=Number(l[0].min);i.options.risingSpeed=e>n?n:e<o?o:Math.floor(100*e)/100}})),Object.defineProperty(i.options,"risingSpeed",{get:function(){return l[0].value},set:function(t){l[0].value=t,l[1].value=t}}),i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,(c=n.querySelector("input[name='minWaterLevel']")).value=i.options.minWaterLevel,c.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),i.options.minWaterLevel=Math.floor(1e4*e)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(t){c.value=Math.floor(1e4*Number(t))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),e<i.options.minWaterLevel?i.options.maxWaterLevel=i.options.minWaterLevel:i.options.maxWaterLevel=Math.floor(1e4*e)/1e4,i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,i.options.waterVolume=Number((i.waterLevel*i.area).toFixed(4))}})),Object.defineProperty(i.options,"maxWaterLevel",{get:function(){return Number(u.value)},set:function(t){isNaN(t)&&(t=0),u.value=Math.floor(1e4*Number(t))/1e4}}),(p=n.querySelector("input[name='waterVolume']")).value=i.options.waterVolume,p.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>99999999999999&&(e=99999999999999),e<0&&(e=0),i.options.waterVolume=Math.floor(1e4*e)/1e4,i.area&&(i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel)}})),Object.defineProperty(i.options,"waterVolume",{get:function(){return Number(p.value)},set:function(t){p.value=t}}),(h=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(h.value)},set:function(t){h.value=t,i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}}),d=n.getElementsByClassName("table-body")[0],m=n.getElementsByClassName("table-empty")[0],Object.defineProperty(i,"positions",{get:function(){return i._positions},set:function(t){if(t&&t.length>0){m.style.display="none";for(var e="",i=0;i<t.length;i++)e+='<div class="tr">\n <div class="td">'.concat(i+1,'</div>\n <div class="td">').concat(Number(t[i].lng.toFixed(10)),'</div>\n <div class="td">').concat(Number(t[i].lat.toFixed(10)),'</div>\n <div class="td">').concat(Number(t[i].alt.toFixed(4)),"</div>\n </div>");d.innerHTML=e}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=$s(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type&&(i=Number(i)),t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i}(si);function ia(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function na(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ia(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ia(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function oa(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var sa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=oa(this,e,[t,n])).viewer=t.viewer,i.options={},i.options.viewPosition=n.viewPosition,i.options.viewPositionEnd=n.viewPositionEnd,i.options.horizontalViewAngle=n.horizontalViewAngle||0===n.horizontalViewAngle?n.horizontalViewAngle:90,i.options.verticalViewAngle=n.verticalViewAngle||0===n.verticalViewAngle?n.verticalViewAngle:60,i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i._elms={},i.viewPointHeight=n.viewPointHeight,i.ids=[],i.Dialog=o,i._EventBinding=new pn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return qi()(e,t),x()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(t){this.options.viewPosition=t,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(t){this.options.viewPositionEnd=t,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(t){if(this.options.horizontalViewAngle=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var e=this._DialogObject._element.content;e.querySelector("input[name='horizontalViewAngle']").value=t,e.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=t+"°",e.getElementsByClassName("range-process")[0].style.width=t/180*100+"%"}this.update()}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(t){this.options.visibleAreaColor=t,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(t){this.options.invisibleAreaColor=t,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(t){this.options.verticalViewAngle=t,this.update()}},{key:"viewDistance",get:function(){var t=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),e=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(t,e)}},{key:"viewHeading",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"add",value:function(){this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),e.getcanvas(this)}},{key:"update",value:function(){this.clear(),this.add()}},{key:"clear",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,this.sketch&&(this.viewer.entities.removeById(this.sketch.id),this.sketch=null),this.frustumOutline&&(this.viewer.entities.removeById(this.frustumOutline.id),this.frustumOutline=null),this.postStage&&(this.viewer.scene.postProcessStages.remove(this.postStage),this.postStage=null)}},{key:"destroy",value:function(){var t=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(e){t.viewer.entities.removeById(e)})),this.ids=[],this.viewBillboardPrimitive&&this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null,this.options.viewPosition=null,this.options.viewPositionEnd=null,YJ.Measure.SetMeasureStatus(!1),this._originalShadowMap&&(this.viewer.scene.shadowMap=this._originalShadowMap,this._originalShadowMap=null),this.viewer.shadows=this.viewer._shadows}},{key:"nodeEdit",value:function(){var t,e=this;YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(t){e.viewer.entities.getById(t).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new X(this.sdk),this.editevent.mouse_left((function(i,n){var o=e.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=e.ids.indexOf(o.id.id)&&(!t||t.id!=o.id.id)&&(t=o.id,e.viewer.entities.getById(e.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt),e.viewer.entities.getById(e.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.viewPositionEnd.lng,e.viewPositionEnd.lat,e.viewPositionEnd.alt),e.ControllerObject&&e.ControllerObject.destroy(),e.ControllerObject=new _o(e.sdk,{position:na({},e.cartesian3Towgs84(t.position._value,e.sdk.viewer))}),e.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),t.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==e.ids.indexOf(o.id.id)?e.viewPosition=i.position:e.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},e.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null})),this.editevent.mouse_move((function(t,e){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;e.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null)}))})))}},{key:"createLightCamera",value:function(){if(this.options.viewPosition){this.lightCamera=new Cesium.Camera(this.viewer.scene),this.lightCamera.position=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),this.lightCamera.frustum.near=.001*this.viewDistance,this.lightCamera.frustum.far=this.viewDistance;var t=Cesium.Math.toRadians(this.horizontalViewAngle),e=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(t/2)*2/(this.viewDistance*Math.tan(e/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=t>e?t:e,this.lightCamera.setView({destination:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:{heading:Cesium.Math.toRadians(this.viewHeading||0),pitch:Cesium.Math.toRadians(this.viewPitch||0),roll:0}})}}},{key:"createShadowMap",value:function(){this.shadowMap=new Cesium.ShadowMap({context:this.viewer.scene.context,lightCamera:this.lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this.viewDistance,cascadesEnabled:!1,size:2048,softShadows:!0,normalOffset:!1,fromLightSource:!1}),this._originalShadowMap||(this._originalShadowMap=this.viewer.scene.shadowMap),this.viewer.scene.shadowMap=this.shadowMap}},{key:"createPostStage",value:function(){var t=this;Number(Cesium.VERSION.split(".")[1])>=102&&rn()("fs");var e=new Cesium.PostProcessStage({fragmentShader:"\n #define USE_CUBE_MAP_SHADOW true\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n struct zx_shadowParameters\n {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)\n {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.);\n }\n\n vec4 toEye(in vec2 uv,in float depth){\n vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\n vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\n posInCamera=posInCamera/posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){\n vec3 v01=point-planeOrigin;\n float d=dot(planeNormal,v01);\n return(point-planeNormal*d);\n }\n\n float getDepth(in vec4 depth){\n float z_window=czm_unpackDepth(depth);\n z_window=czm_reverseLogDepth(z_window);\n float n_range=czm_depthRange.near;\n float f_range=czm_depthRange.far;\n return(2.*z_window-n_range-f_range)/(f_range-n_range);\n }\n\n float shadow(in vec4 positionEC){\n vec3 normalEC=getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;\n float distance=length(directionEC);\n directionEC=normalize(directionEC);\n float radius=shadowMap_lightPositionEC.w;\n if(distance>radius)\n {\n return 2.0;\n }\n vec3 directionWC=czm_inverseViewRotation*directionEC;\n shadowParameters.depth=distance/radius-0.0003;\n shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\n shadowParameters.texCoords=directionWC;\n float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);\n return visibility;\n }\n\n bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.\n &&result.y>=-1.&&result.y<=1.\n &&result.z>=-1.&&result.z<=1.;\n }\n\n void main(){\n // 釉色 = 结构二维(颜色纹理, 纹理坐标)\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n // 深度 = 获取深度(结构二维(深度纹理, 纹理坐标))\n float depth = getDepth(texture2D(depthTexture, v_textureCoordinates));\n // 视角 = (纹理坐标, 深度)\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n // 世界坐标\n vec4 wordPos = czm_inverseView * viewPos;\n // 虚拟相机中坐标\n vec4 vcPos = camera_view_matrix * wordPos;\n float near = .001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n if(dis > near && dis < helsing_viewDistance){\n // 透视投影\n vec4 posInEye = camera_projection_matrix * vcPos;\n // 可视区颜色\n // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\n // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\n if(visible(posInEye)){\n float vis = shadow(viewPos);\n if(vis > 0.3){\n gl_FragColor = mix(gl_FragColor,helsing_visibleAreaColor,.5);\n } else{\n gl_FragColor = mix(gl_FragColor,helsing_invisibleAreaColor,.5);\n }\n }\n }\n }",uniforms:{shadowMap_textureCube:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(e.normalOffsetScale,t.shadowMap._distance,t.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/t.shadowMap._textureSize.x,i.y=1/t.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,e.depthBias,e.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return t.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(e)}},{key:"drawFrustumOutline",value:function(){var t=new Cesium.Cartesian3,e=new Cesium.Matrix3,i=new Cesium.Quaternion,n=(this.lightCamera.positionWC,this.lightCamera.directionWC),o=this.lightCamera.upWC,s=this.lightCamera.rightWC;s=Cesium.Cartesian3.negate(s,t);var a=e;Cesium.Matrix3.setColumn(a,0,s,a),Cesium.Matrix3.setColumn(a,1,o,a),Cesium.Matrix3.setColumn(a,2,n,a);var r=Cesium.Quaternion.fromRotationMatrix(a,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:r}),id:Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:[l],appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}},{key:"drawSketch",value:function(){this.sketch=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN}}),this.frustumOutline=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),innerRadii:new Cesium.Cartesian3(1e-4,1e-4,1e-4),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:1,slicePartitions:1,outlineColor:Cesium.Color.YELLOWGREEN}})}}],[{key:"create",value:function(t){t.destroy();var i=0;function n(){t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t.event=new X(t.sdk),t.tip=new Z("左键选择观测点位置,右键取消",t.sdk),YJ.Measure.SetMeasureStatus(!0),t.event.mouse_left((function(o,s){t.viewPosition||(t.options.viewPosition=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),t.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(t.options.viewPositionEnd=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),n(),t.update())})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(e,i){t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n()})),t.event.gesture_pinck_start((function(e,i){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&(t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n())}))})))}},{key:"create_point",value:function(t,e){var i=t.randomString(),n=t.cartesian3Towgs84(e,t.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return t.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"可视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),i.editevent&&i.editevent.destroy(),i.ControllerObject&&i.ControllerObject.destroy(),i.ids.forEach((function(t){i.viewer.entities.removeById(t)}))}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">位置拾取(起点、终点)</span>\n <button class="edit"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>拾取</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="margin-bottom: 25px;">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row subtitle-box">\n <span class="subtitle">视域夹角</span>\n </div>\n <div class="row"> \n <div class="col">\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0°</span>\n <span class="range-node-text">45°</span>\n <span class="range-node-text">90°</span>\n <span class="range-node-text">135°</span>\n <span class="range-node-text">180°</span>\n <div class="range-node-active"><span class="range-node-active-text">0°</span></div>\n </div>\n <input type="range" max="180" min="0" step="1" name="horizontalViewAngle">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',i._DialogObject.contentAppChild(n),i._DialogObject._element.body.getElementsByClassName("edit")[0].addEventListener("click",(function(){i.nodeEdit()})),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(r=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,l=n.getElementsByClassName("range-node-active")[0],c=l.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],p=i.horizontalViewAngle/180*100,l.style.left=p+"%",u.style.width=p+"%",c.innerHTML=i.horizontalViewAngle+"°",r.addEventListener("input",(function(){var t=r.value/180*100;l.style.left=t+"%",u.style.width=t+"%",c.innerHTML=r.value+"°"})),r.addEventListener("change",(function(){clearTimeout(h),h=setTimeout((function(){i.horizontalViewAngle=r.value}),300)}));case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){if(t.viewPosition){t.viewBillboardPrimitive&&(t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=null);var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=180,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.viewPosition.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.viewPosition.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+Number((parseFloat(t.viewPosition.alt.toFixed(2))+Number(t.viewPointHeight)).toFixed(2))+" m"},{images:t.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(t.viewHeading.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(t.viewPitch.toFixed(10))+"°"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,e.width,e.height),o.forEach((function(n,a){var r=new Image;r.src=n.images,r.onload=function(){i.drawImage(r,12,12+26*a),i.fillStyle="#fff",i.font="12px Arial",i.fillText(n.text,44,28+26*a),++s===o.length&&(t.viewBillboardPrimitive=t.viewer.scene.primitives.add(new Cesium.BillboardCollection),t.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt+t.viewPointHeight),image:e,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}))}}))}}}}]);var i}(si);function aa(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ra(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ra(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ra(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function la(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function ca(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ua(t,e){return t.get(pa(t,e))}function pa(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var ha=new WeakMap,da=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),ca(i=la(this,e,[t,n]),ha,new Map),i.viewer=t.viewer,i.options={},i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i.ids=[],i.primitives=[],i.viewpointPrimitive=null,i._elms={},i.precision=n.precision,i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new pn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return qi()(e,t),x()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"precision",get:function(){return this.options.precision},set:function(t){var e=Math.floor(Number(t));isNaN(e)?e=20:e<1&&(e=1),this.options.precision=e,this._elms.precision&&this._elms.precision.forEach((function(t){t.value=e}))}},{key:"analyse",value:function(){var t=this,i=[this.center.lng,this.center.lat],n=this.radius/1e3,o=turf.circle(i,n,{steps:180,units:"kilometers",properties:{foo:"bar"}});this.viewpointPrimitive||(this.viewpointPrimitive=this.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection)),this.viewBillboardPrimitive||(this.viewBillboardPrimitive=this.viewer.scene.primitives.add(new Cesium.BillboardCollection));for(var s=[],a=n/this.precision,r=1;r<o.geometry.coordinates[0].length;r++){for(var l=turf.lineString([i,o.geometry.coordinates[0][r]]),c=[],u=1;u<=this.precision;u++){var p=turf.lineSliceAlong(l,0,a*u,{units:"kilometers"});c.push([p.geometry.coordinates[1][0],p.geometry.coordinates[1][1]])}s.push(c)}var h=Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.center.alt+this.viewPointHeight);e.getcanvas(this).then((function(e){return t.viewBillboardPrimitive.add({position:h,image:e,width:200,height:140,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY})})),this.viewpointPrimitive.add({position:h,color:Cesium.Color.AQUA.withAlpha(1),pixelSize:6});var d=0,m=this,f=this.randomString(),v=setInterval((function(){if(d>=s.length){var e=ua(ha,t).get(f);e&&clearInterval(e.event)}else!function(t){for(var e=[],n=t,o=0;o<s[n].length;o++){var a=s[n][o],r=void 0,l=void 0,c=s[n][o-1];n==s.length-1?(r=s[0][o],l=s[0][o-1]):(r=s[n+1][o],l=s[n+1][o-1]),0==o&&(l=[].concat(i),c=[]);for(var u=[(a[0]+l[0])/2,(a[1]+l[1])/2],p=Cesium.Cartographic.fromDegrees(u[0],u[1]),d=m.viewer.scene.globe.getHeight(p),f=Cesium.Cartesian3.fromDegrees(u[0],u[1],d),v=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(f,h,new Cesium.Cartesian3),new Cesium.Cartesian3),g=new Cesium.Ray(h,v),y=m.viewer.scene.drillPickFromRay(g,m.primitives),b=void 0,C=0;C<y.length;C++)if(y[C].position){b=y[C];break}var w=Cesium.Color.LIME;b&&Math.abs(b.position.x-f.x)>.01&&Math.abs(b.position.y-f.y)>.01&&Math.abs(b.position.z-f.z)>.01&&(w=Cesium.Color.RED);var k=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray([].concat(L()(a),L()(r),L()(l),L()(c),L()(a))),width:2}),_=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});e.push(_)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);ua(ha,this).set(f,{event:v})}},{key:"destroy",value:function(){var t,e,i,n,o=aa(ua(ha,this));try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(t){o.e(t)}finally{o.f()}e=ha,i=this,n=new Map,e.set(pa(e,i),n);for(var r=0;r<this.primitives.length;r++)this.viewer.scene.primitives.remove(this.primitives[r]);this.primitives=[],this.viewpointPrimitive&&(this.viewer.scene.primitives.remove(this.viewpointPrimitive),this.viewpointPrimitive=null),this.viewBillboardPrimitive&&(this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null),YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),new YJ.Draw.DrawCircle(t.sdk).start(function(){var e=o()(a.a.mark((function e(i,n){var o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:return t.radius=n.radius,e.next=5,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(n.center.lng,n.center.lat)]);case 5:return o=e.sent,t.center={lng:n.center.lng,lat:n.center.lat,alt:o[0].height},e.next=9,t.analyse();case 9:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()))}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"圆形视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" circle-view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">采样精度</span>\n <input class="input" type="number" title="" min="1" max="100" step="1" @model="precision">\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?e.create(i):window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500})})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=140,e.style.background="#000000";var n=new Image,s=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.center.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.center.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+t.viewPointHeight+" m"},{images:t.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+t.radius+" m"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var r=0;return new Promise(function(){var t=o()(a.a.mark((function t(o,l){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onload=function(){i.drawImage(n,0,0,e.width,e.height),s.forEach((function(t,n){var a=new Image;a.src=t.images,a.onload=function(){i.drawImage(a,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(t.text,44,28+26*n),++r===s.length&&o(e)}}))};case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}}]);var i}(si);function ma(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fa(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ma(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ma(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function va(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ga=function(t){function e(t){var i;return k()(this,e),(i=va(this,e,[t])).viewer=t.viewer,i.viewer.terrainProvider.availability?(i.event,i.result=[],i.handler=void 0,i.toolTip="",YJ.Analysis.AnalysesResults.push(i),i.Draw=new Zs(i.sdk),i.createNew4Num(50),i):(i.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),Ui()(i))}return qi()(e,t),x()(e,[{key:"createNew4Distance",value:function(t){var e=this,i=200*(t=t||.1)>35?35:200*t;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],p=u.lng,h=u.lat;o.push([p,h]),s=p<s?p:s,a=h<a?h:a,r=p>r?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,t,{mask:m});e.createEllipse(f)}}))}},{key:"createNew4Num",value:function(t){var e=this,i=t;this.Draw.start((function(t,n){if(!n||n.length<=2)console.warn("至少拥有三个坐标位置!");else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],p=u.lng,h=u.lat;o.push([p,h]),s=p<s?p:s,a=h<a?h:a,r=p>r?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=r-s,f=l-a;f=f>m?f:m;var v=turf.polygon([o]),g=turf.area(v);g>5e12?i-=25:g>1e12?i-=20:g>5e11?i-=15:g>1e11?i-=10:g>6e10&&(i-=5);var y=f/i,b=2e3*y>35?35:2e3*y;e.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});e.createEllipse(C)}}))}},{key:"createEllipse",value:function(t){for(var e=[],i=0;i<t.features.length;i++){var n=t.features[i].geometry.coordinates[0],o=[(n[0][0]+n[2][0])/2,(n[0][1]+n[2][1])/2],s=Cesium.Cartographic.fromDegrees(o[0],o[1]);e.push(s);for(var a=0;a<n.length;a++){var r=n[a],l=Cesium.Cartographic.fromDegrees(r[0],r[1]);e.push(l);var c=n[a+1];if(c){var u=[(r[0]+c[0])/2,(r[1]+c[1])/2],p=Cesium.Cartographic.fromDegrees(u[0],u[1]);e.push(p)}}}var h=this,d=Math.floor(e.length/3)+"";d=10*Number(d.substring(0,d.length-1));var m=0,f=e.slice(m*d,(m+1)*d);f.length>0&&function t(i){Cesium.sampleTerrainMostDetailed(h.viewer.scene.terrainProvider,i).then((function(i){m++;var n=e.slice(m*d,(m+1)*d);n.length>0&&t(n);var o=[],s=i.reduce((function(t,e,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);h.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(t,e,i){for(var n=[],o=1;o<t.length-1;o++){var s=t[o];n.push(Cesium.Cartographic.toCartesian(s))}var a=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n)});return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:i},geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"createArrowInstance",value:function(t,e,i,n,o){var s=new Cesium.Cartographic((t.longitude+e.longitude)/2,(t.latitude+e.latitude)/2,(t.height+e.height)/2),a=new Cesium.Cartographic((i.longitude+e.longitude)/2,(i.latitude+e.latitude)/2,(i.height+e.height)/2),r=n>0?[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(a)]:[Cesium.Cartographic.toCartesian(a),Cesium.Cartographic.toCartesian(s)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:o},geometry:new Cesium.GroundPolylineGeometry({positions:r,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"calculateSlope",value:function(t){for(var e=this,i=[],n=[],o=0;o<t.length;o++){for(var s=t[o],a=s[0],r=0,l=0,c=1;c<s.length-1;c++){var u=s[c].height-a.height;Math.abs(u)>r&&(r=u,l=c)}var p=new Cesium.Cartographic(a.longitude,a.latitude,0),h=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(p),Cesium.Cartographic.toCartesian(h)),m=Math.abs(r/d),f=this.calculateSlopeColor(m,.4),v=this.createPolygonInsrance(s,f,m);n.push(v);var g=l>4?s[l-4]:s[l+4],y=s[l],b=this.createArrowInstance(y,a,g,r,m);i.push(b)}var C=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),w=this.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));this.result.push(w,C),this.event=new X(this.sdk);var k=function(t,i){var n=document.getElementById("SlopeAspect-box");n||((n=document.createElement("div")).id="SlopeAspect-box",n.style.pointerEvents="none",n.style.display="none",n.style.position="absolute",n.style.background="#333333",n.style.color="#fff",n.style.color="#fff",n.style.padding="5px",n.style.fontSize="12px",n.style.borderRadius="5px",n.style.transform="translate(-50%, -10px)",n.innerHTML='\n <div class="value">坡度:</div>\n <span style="\n position: absolute;\n border: 4px solid;\n border-color: #fff0 #fff0 #333333 #333333;\n transform: rotate(-45deg);\n left: calc(50% - 5px);\n "></span>\n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=fa({},t.position),a=e.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(e.sdk.viewer&&e.sdk.viewer._element){var c=e.sdk.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];r=c.getBoundingClientRect().top+window.scrollY,l=c.getBoundingClientRect().left+window.scrollX}n.style.display="block",n.style.left=s.x+2+l+"px",n.style.top=s.y-20+r+"px",o.innerHTML="坡度:"+Number(Cesium.Math.toDegrees(a.id.value||0).toFixed(2))+"°"}else n.style.display="none"};this.event.mouse_move((function(t,e){var i={position:fa({},t.endPosition)};k(i)})),this.event.mouse_left(k),this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll},this.sdk.viewer.scene.preRender.addEventListener(this._watchEvent,this)}},{key:"_watchEvent",value:function(){if(this._camera.position.x.toFixed(8)!==this.sdk.viewer.camera.position.x.toFixed(8)||this._camera.position.y.toFixed(8)!==this.sdk.viewer.camera.position.y.toFixed(8)||this._camera.position.z.toFixed(8)!==this.sdk.viewer.camera.position.z.toFixed(8)||this._camera.heading.toFixed(8)!==this.sdk.viewer.camera.heading.toFixed(8)||this._camera.pitch.toFixed(8)!==this.sdk.viewer.camera.pitch.toFixed(8)||this._camera.roll.toFixed(8)!==this.sdk.viewer.camera.roll.toFixed(8)){var t=document.getElementById("SlopeAspect-box");t&&(t.style.display="none")}this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll}}},{key:"calculateSlopeColor",value:function(t,e){return t<.00872686779075879?"rgba(85,182,43,"+e+")":t<.03492076949174773?"rgba(135,211,43,"+e+")":t<.08748866352592401?"rgba(204,244,44,"+e+")":t<.2679491924311227?"rgba(245,233,44,"+e+")":t<.7002075382097097?"rgba(255,138,43,"+e+")":t<1.4281480067421144?"rgba(255,84,43,"+e+")":"rgba(255,32,43,"+e+")"}},{key:"destroy",value:function(){var t=this;this.result&&this.result.forEach((function(e){t.viewer.scene.primitives.remove(e)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(si);function ya(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ba=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=ya(this,e,[t])).viewer=t.viewer,i.Dialog=n,YJ.Analysis.AnalysesResults.push(i),e.create(i),i}return qi()(e,t),x()(e,[{key:"clean",value:function(){this.end(),this._currentId=null,this.entityHasCreated=!1,this.polyline&&this.viewer.entities.remove(this.polyline),this.tipEntity&&this.viewer.entities.remove(this.tipEntity),this.polyline=null,this.tipEntity=null}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"create",value:function(t){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(t.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确定,右键取消",t.sdk),t.event=new X(t.sdk),t.positions=[],t.points_ids=[];var s=[];t.event.mouse_left(function(){var r=o()(a.a.mark((function o(r,l){var c;return a.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:try{t.entityHasCreated||e.create_polyline(t),s.push(l),t.points_ids.push(t.create_point(l)),2==s.length&&(t.end(),c=[],s.forEach((function(e){c.push(t.cartesian3Towgs84(e,t.viewer))})),e.interPoints(t).then((function(o){i._currentId&&i._currentId===n&&(t._DialogObject?e.initEcharts(t,o):e.edit(t,o))})))}catch(t){console.log(t)}case 1:case"end":return o.stop()}}),o)})));return function(t,e){return r.apply(this,arguments)}}()),t.event.mouse_right((function(e,i){s=[],t.clean()})),t.event.mouse_move((function(e,i){t.positions=s.concat(i),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500){s=[],t.end()}}))}))}}},{key:"create_polyline",value:function(t){t.entityHasCreated=!0;var e=t.randomString();return t.polyline=t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),e}},{key:"interPoints",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.viewer,n=e.positions,o=[],s=[],r=0;r<n.length;r++)l=n[r],c=i.scene.globe.ellipsoid.cartesianToCartographic(l),o.push(c),u=e.cartesian3Towgs84(l,i),s.push(u);return p=[],t.next=8,e.getClampToHeight({lng:s[0].lng,lat:s[0].lat});case 8:h=t.sent,p.push({position:{lng:s[0].lng,lat:s[0].lat,height:h},distance:0}),d=0;case 11:if(!(d<o.length-1)){t.next=42;break}m=turf.lineString([[s[d].lng,s[d].lat],[s[d+1].lng,s[d+1].lat]]),f=turf.length(m,{units:"kilometers"}),v=o[d],g=o[d+1],y=1e7*Math.abs(v.longitude-g.longitude),b=1e7*Math.abs(v.latitude-g.latitude),y>b&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k<C-1)){t.next=39;break}return _=k*w,x=(k+1)*w,t.next=29,turf.lineSliceAlong(m,_,x,{units:"kilometers"});case 29:return E=t.sent,S=E.geometry.coordinates[E.geometry.coordinates.length-1][0],D=E.geometry.coordinates[E.geometry.coordinates.length-1][1],t.next=34,e.getClampToHeight({lng:S,lat:D});case 34:P=t.sent,p.push({position:{lng:S,lat:D,height:P},distance:1e3*x});case 36:k++,t.next=24;break;case 39:d++,t.next=11;break;case 42:return t.abrupt("return",p);case 43:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"剖面分析",left:"180px",top:"100px",closeCallBack:function(){i.clean(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" profile",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="profile-echarts"></div>\n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>重新绘制',s.style.width="auto",s.addEventListener("click",(function(){e.create(i),e.initEcharts(i)})),i._DialogObject.footAppChild(s),e.initEcharts(i,n);case 16:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"initEcharts",value:function(t,e){var i,n=[],o=[],s=e;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l<s.length;l++){var c=s[l];if(void 0!==c.position.height){var u=[c.distance.toFixed(2),c.position.height.toFixed(2)];n.push(u);var p=[c.position.lng,c.position.lat];o.push(p)}}var h={show:!0,pixelSize:10,color:Cesium.Color.GREEN,outlineColor:Cesium.Color.SKYBLUE,outlineWidth:3,disableDepthTestDistance:Number.POSITIVE_INFINITY},d=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(d),i={tooltip:{trigger:"axis",textStyle:{align:"left"},formatter:function(e){var i=o[e[0].dataIndex],n=e[0].data;return t.tipEntity?t.tipEntity.position=Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])):t.tipEntity=t.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])),point:h}),"距离:"+n[0]+"m<br>高度:"+n[1]+"m<br>坐标:"+i[0].toFixed(5)+","+i[1].toFixed(5)}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",max:r,scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:n,smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}else{var m=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(m),i={tooltip:{trigger:"axis",textStyle:{align:"left"}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:[],smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}t.echartsObject.setOption(i)}}]);var i,n}(Ys);function Ca(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var wa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Ca(this,e,[t,n])).viewer=t.viewer,i.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},i.options={},i._elms={},i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new pn,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return qi()(e,t),x()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"destroy",value:function(){var t=this;this.resultObject.entities.forEach((function(e){t.viewer.entities.remove(e)})),this.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),t.event=new X(t.sdk),t.tip=new Z("左键点击创建视角起点",t.sdk),YJ.Measure.SetMeasureStatus(!0);t.event.mouse_left(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t.tip.set_text("左键创建视角终点,右键结束通视分析"),t.resultObject.viewPoint){i.next=15;break}return s=t.cartesian3Towgs84(o,t.viewer),i.next=5,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(s.lng,s.lat)]);case 5:(r=i.sent)[0].height>s.alt&&(s.alt=r[0].height),s.alt=s.alt+t.viewPointHeight,l=Cesium.Cartesian3.fromDegrees(s.lng,s.lat,s.alt),t.resultObject.viewPoint=l,c=t.viewer.entities.add({position:l,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(c),t.resultObject.entities.push(c),i.next=32;break;case 15:t.resultObject.targetPoint=o,u=t.viewer.entities.add({position:o,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(u),t.resultObject.entities.push(u),p=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.resultObject.targetPoint,t.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),h=new Cesium.Ray(t.resultObject.viewPoint,p),d=t.viewer.scene.drillPickFromRay(h),m={},f=0;case 24:if(!(f<d.length)){i.next=31;break}if(!d[f].position){i.next=28;break}return m=d[f],i.abrupt("break",31);case 28:f++,i.next=24;break;case 31:m&&(v=e.distance(t.resultObject.viewPoint,t.resultObject.targetPoint),g=e.distance(t.resultObject.viewPoint,m.position||o),y=e.distance(m.position||o,t.resultObject.targetPoint),v>g?(b=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,m.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(b),C=t.viewer.entities.add({polyline:{positions:[m.position,t.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}}),t.resultObject.entities.push(C),t.resultObject.targetPoints.push({targetPoint:o,visual:!1,distance:[v,g,y]})):(w=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,t.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(w),t.resultObject.targetPoints.push({targetPoint:o,visual:!0,distance:[v,g,y]})));case 32:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}()),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(t,e){i()})),t.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&i()}))}))}function i(){YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"多点视线分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"distance",value:function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e),o=new Cesium.EllipsoidGeodesic;o.setEndPoints(i,n);var s=o.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-i.height,2))}}]);var i}(si),ka=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.viewer=e.viewer;var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),void console.warn(this.error);this.positions=i.positions,this.interfaceNum=i.interfaceNum||25,this.colorFill=i.colorFill||["#8CEA00","#B7FF4A","#FFFF37","#FFE66F","#FFD1A4","#FFCBB3","#FFBD9D","#FFAD86","#FF9D6F","#FF8F59","#FF8040","#FF5809","#F75000","#D94600","#BB3D00","#A23400","#842B00","#642100","#4D0000","#2F0000"],this.countorLineList=Cesium.defaultValue(i.countorLineList,[]),YJ.Analysis.AnalysesResults.push(this),this.createNewLine()}return x()(t,[{key:"type",get:function(){return"ContourAnalysis"}},{key:"createNewLine",value:function(){t.interpolatePoint(this)}},{key:"getObjectIndex",value:function(t,e){for(var i=0;i<t.length;i++)if(t[i]>e)return i}},{key:"clear",value:function(t){if(t){this.viewer.dataSources.remove(t);var e=this.countorLineList.indexOf(t);this.countorLineList.splice(e,1)}}},{key:"destroy",value:function(){var t=this;this.countorLineList.forEach((function(e){t.viewer.dataSources.remove(e)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(t){for(var e=t.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o<e.length;o++){var s=Cesium.Cartesian3.fromDegrees(e[o].lng,e[o].lat,e[o].alt),a=t.viewer.scene.globe.ellipsoid.cartesianToCartographic(s),r=Cesium.Math.toDegrees(a.latitude),l=Cesium.Math.toDegrees(a.longitude);n.maxY=Math.max(r,n.maxY),n.minY=Math.min(r,n.minY),n.maxX=Math.max(l,n.maxX),n.minX=Math.min(l,n.minX);var c={type:"Feature",properties:{},geometry:{type:"Point",coordinates:[l,r]}};i.push(c)}var u={type:"FeatureCollection",features:i};turf.featureEach(u,(function(t){t.properties.height=0}));var p=turf.point([n.minX,n.minY]),h=turf.point([n.maxX,n.maxY]),d=turf.rhumbDistance(p,h,{units:"kilometers"}),m=turf.interpolate(u,d/t.interfaceNum,{gridType:"points",property:"height",units:"kilometers"}),f=1e7,v=-1e8;turf.featureEach(m,(function(e){var i=e.geometry.coordinates,n=Cesium.Cartographic.fromDegrees(i[0],i[1]),o=t.viewer.scene.globe.getHeight(n);v=Math.max(o,v),f=Math.min(o,f),e.properties.height=o}));for(var g=[],y=t.colorFill.length-1,b=(v-f)/y,C=0;C<y+1;C++)g.push(Math.ceil(f+b*C));var w=turf.isolines(m,g,{zProperty:"height"});function k(e){for(var i=new si,n=e.positions,o=n._value.length,s=[],a=0;a<o;a++){var r=i.cartesian3Towgs84(n._value[a],t.viewer);s.push([r.lng,r.lat])}var l=turf.lineString(s),c=turf.length(l,{units:"kilometers"}),u=turf.along(l,c/2,{units:"kilometers"});return Cesium.Cartesian3.fromDegrees(u.geometry.coordinates[0],u.geometry.coordinates[1],0)}Cesium.GeoJsonDataSource.load(w,{clampToGround:!0}).then((function(e){console.log(e),t.countorLine=e,t.countorLineList.push(e),t.viewer.dataSources.add(e);for(var i=e.entities.values,n=0;n<i.length;n++){var o=i[n],s=k(o.polyline);o.position=s;var a=t.getObjectIndex(g,o.properties.height._value);a&&(o.polyline.material=Cesium.Color.fromCssColorString(t.colorFill[a-1]))}}))}}])}();function _a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function xa(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_a(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):_a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ea(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Sa=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Ea(this,e,[t,o])).viewer=t.viewer,n.tiles3d=i,n.options=xa({},o),n.options.regionsType=n.options.regionsType||!1,YJ.Analysis.SectionResults.push(n),n.Planes=[],e.start(n),n}return qi()(e,t),x()(e,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(t){this.options.regionsType=t,this.Planes.length>0&&(this.Planes=[],e.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(t){var i=t.options.positions||[];if(!t.isConvex(i))return window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形");t.inverseTransform=function(t){var e,i=t.root.transform;e=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center):Cesium.Matrix4.fromArray(t.root.transform);return Cesium.Matrix4.inverseTransformation(e,new Cesium.Matrix4)}(t.tiles3d),t.Planes=[];var n=[];if(i.length>0){for(var o=0;o<i.length;o++)n.push([i[o].lng,i[o].lat]);n.push([i[0].lng,i[0].lat]),t.isClockwise=turf.booleanClockwise(turf.lineString(n))}e.planeCollection(t)}},{key:"planeCollection",value:function(t){var e=t.options.positions||[];if(t.regionsType==t.isClockwise)for(var i=0;i<e.length;i++)i===e.length-1?t.Planes.push(a(e[i],e[0],t.inverseTransform)):t.Planes.push(a(e[i],e[i+1],t.inverseTransform));else for(var n=e.length-1;n>=0;n--)0===n?t.Planes.push(a(e[n],e[e.length-1],t.inverseTransform)):t.Planes.push(a(e[n],e[n-1],t.inverseTransform));if(t.tiles3d.clippingPlanes){t.tiles3d.clippingPlanes.removeAll();for(var o=0;o<t.Planes.length;o++)t.tiles3d.clippingPlanes.add(t.Planes[o]);t.tiles3d.clippingPlanes.enabled=!0}else{var s=new Cesium.ClippingPlaneCollection({planes:t.Planes,enabled:!0,unionClippingRegions:t.regionsType,edgeColor:Cesium.Color.WHITE,edgeWidth:1});t.tiles3d.clippingPlanes=s}function a(t,e,i){var n=r(t,i),o=r(e,i),s=new Cesium.Cartesian3(0,0,10),a=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),l=Cesium.Cartesian3.cross(a,s,new Cesium.Cartesian3);l=Cesium.Cartesian3.normalize(l,l);var c=Cesium.Plane.fromPointNormal(n,l);return Cesium.ClippingPlane.fromPlane(c)}function r(t,e){var i=Cesium.Cartesian3.fromDegrees(t.lng,t.lat);return Cesium.Matrix4.multiplyByPoint(e,i,new Cesium.Cartesian3(0,0,0))}}}])}(si);function Da(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Pa=[],Ma=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=Da(this,e,[t])).viewer=t.viewer,i.options=n||{},i.options.height=i.options.height||0===i.options.height?i.options.height:10,i.options.show=!i.options.show&&!1!==i.options.show||i.options.show,i.bottomImg=i.getSourceRootPath()+"/img/excavationregion_top.jpg",i.wallImg=i.getSourceRootPath()+"/img/excavationregion_side.jpg",i.splitNum=Cesium.defaultValue(n.splitNum,50),i.Draw=new Zs(i.sdk),i.bottomMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#735d4f"))}),i.wallMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#976b4e"))});var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.crossOrigin="Anonymous",s.crossOrigin="Anonymous",o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var e=t.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height,t.getContext("2d").drawImage(s,0,0,s.width,s.height);var e=t.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i.init(),i}return qi()(e,t),x()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.switchExcavate(t)}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t}},{key:"init",value:function(){e.edit(this,!0)}},{key:"startCreate",value:function(){var t=this;this.Draw.start((function(e,i){if(i&&!(i.length<=2))return t.isConvex(i)?void t.updateData(i):(window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形"));window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500})}))}},{key:"updateData",value:function(t){var e=this.viewer;this.clear();for(var i=[],n=[],o=0;o<t.length;o++)n.push([t[o].lng,t[o].lat]);n.push([t[0].lng,t[0].lat]);var s=turf.lineString(n),a=turf.booleanClockwise(s);this.excavateMinHeight=9999;for(var r=0;r<t.length;++r){var l=(r+1)%t.length,c=Cesium.Cartesian3.fromDegrees(t[r].lng,t[r].lat,t[r].alt),u=Cesium.Cartesian3.fromDegrees(t[l].lng,t[l].lat,t[l].alt),p=Cesium.Cartesian3.midpoint(c,u,new Cesium.Cartesian3),h=Cesium.Cartographic.fromCartesian(c),d=e.scene.globe.getHeight(h)||h.height;d<this.excavateMinHeight&&(this.excavateMinHeight=d);var m=Cesium.Cartesian3.normalize(p,new Cesium.Cartesian3),f=a?Cesium.Cartesian3.subtract(c,p,new Cesium.Cartesian3):Cesium.Cartesian3.subtract(u,p,new Cesium.Cartesian3);f=Cesium.Cartesian3.normalize(f,f);var v=Cesium.Cartesian3.cross(f,m,new Cesium.Cartesian3);v=Cesium.Cartesian3.normalize(v,v);var g=new Cesium.Plane(v,0),y=Cesium.Plane.getPointDistance(g,p);i.push(new Cesium.ClippingPlane(v,y))}this.viewer.scene.globe.clippingPlanes=new Cesium.ClippingPlaneCollection({planes:i,edgeWidth:1,edgeColor:Cesium.Color.WHITE,enabled:!0}),this.prepareWell(t),this.createWell(this.wellData)}},{key:"clear",value:function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.viewer.scene.render());for(var t=Pa.length-1;t>=0;t--)this.viewer.scene.primitives.remove(Pa[t]);Pa=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(t){for(var e=t.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a<e;a++){var r=a==e-1?0:a+1,l=[Cesium.Cartographic.fromDegrees(t[a].lng,t[a].lat,t[a].alt).longitude,Cesium.Cartographic.fromDegrees(t[a].lng,t[a].lat,t[a].alt).latitude],c=[Cesium.Cartographic.fromDegrees(t[r].lng,t[r].lat,t[r].alt).longitude,Cesium.Cartographic.fromDegrees(t[r].lng,t[r].lat,t[r].alt).latitude];0==a&&(s.push(new Cesium.Cartographic(l[0],l[1])),o.push(Cesium.Cartesian3.fromRadians(l[0],l[1],i)),n.push(Cesium.Cartesian3.fromRadians(l[0],l[1],0)));for(var u=1;u<=this.splitNum;u++){var p=Cesium.Math.lerp(l[0],c[0],u/this.splitNum),h=Cesium.Math.lerp(l[1],c[1],u/this.splitNum);a==e-1&&u==this.splitNum||(s.push(new Cesium.Cartographic(p,h)),o.push(Cesium.Cartesian3.fromRadians(p,h,i)),n.push(Cesium.Cartesian3.fromRadians(p,h,0)))}}this.wellData={lerp_pos:s,bottom_pos:o,no_height_top:n}}},{key:"createWell",value:function(t){var e=this;this.viewer.terrainProvider._layers?(this.createBottomSurface(t.bottom_pos),Cesium.sampleTerrainMostDetailed(this.viewer.terrainProvider,t.lerp_pos).then((function(i){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=Cesium.Cartesian3.fromRadians(s.longitude,s.latitude,s.height);n.push(a)}e.createWellWall(t.bottom_pos,n)}))):(this.createBottomSurface(t.bottom_pos),this.createWellWall(t.bottom_pos,t.no_height_top))}},{key:"ellipsoidToDegree",value:function(t){var e=new Cesium.Cartesian3(t.x,t.y,t.z),i=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e);return{longitude:Cesium.Math.toDegrees(i.longitude),latitude:Cesium.Math.toDegrees(i.latitude),altitude:i.height}}},{key:"createBottomSurface",value:function(t){if(t.length){for(var e=this.getMinHeight(t),i=[],n=0;n<t.length;n++){var o=this.ellipsoidToDegree(t[n]);i.push(o.longitude,o.latitude,e)}var s=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(i)),perPositionHeight:!0}),a=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.bottomMaterial});this.bottomSurface=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:Cesium.PolygonGeometry.createGeometry(s)}),appearance:a,asynchronous:!1}),Pa.push(this.bottomSurface),this.viewer.scene.primitives.add(this.bottomSurface)}}},{key:"createWellWall",value:function(t,e){for(var i=this.getMinHeight(t),n=[],o=[],s=0;s<e.length;s++)n.push(this.ellipsoidToDegree(e[s]).altitude),o.push(i);var a=new Cesium.WallGeometry({positions:e,maximumHeights:n,minimumHeights:o}),r=Cesium.WallGeometry.createGeometry(a),l=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.wallMaterial});this.wellWall=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREY)},id:"PitWall"}),appearance:l,asynchronous:!1}),Pa.push(this.wellWall),this.viewer.scene.primitives.add(this.wellWall)}},{key:"getMinHeight",value:function(t){for(var e=5e6,i=null,n=0;n<t.length;n++){var o=t[n].z;o<e&&(e=o,i=this.ellipsoidToDegree(t[n]))}return i.altitude}},{key:"switchExcavate",value:function(t){t?(this.viewer.scene.globe.material=null,this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)}},{key:"updateExcavateDepth",value:function(t){if(this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.wellData){for(var e=this.wellData.lerp_pos,i=[],n=0;n<e.length;n++)i.push(Cesium.Cartesian3.fromRadians(e[n].longitude,e[n].latitude,this.excavateMinHeight-t));this.wellData.bottom_pos=i,this.createWell(this.wellData)}}}],[{key:"edit",value:(i=o()(a.a.mark((function t(e,i){var n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),!i){t.next=21;break}return t.next=4,new W(e.sdk.viewer._container,{title:"地形开挖",closeCallBack:function(){}});case 4:return e._DialogObject=t.sent,t.next=7,e._DialogObject.init();case 7:e._DialogObject._element.body.className=e._DialogObject._element.body.className+" terrain-excavation",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">挖掘高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="5000000" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">绘制开挖区域</span>\n <button class="start-excavation"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>绘制</button>\n </div>\n <div class="col">\n <span class="label">清除开挖区域</span>\n <button class="clean-excavation"><svg class="icon-close"><use xlink:href="#yj-icon-close"></use></svg>清除</button>\n </div>\n </div>\n </div>\n ',e._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){e.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){e.clear()})),(o=n.querySelector("input[name='height']")).value=e.height,o.addEventListener("change",(function(t){var i=t.target.value;(i=Number(i))<.01&&(i=.01,t.target.value=i,e.height=i)})),o.addEventListener("blur",(function(t){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),i<.01&&(i=.01),t.target.value=i,e.height=i})),t.next=22;break;case 21:e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null);case 22:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(si);function Oa(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ta(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Oa(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Oa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Na(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Ba={},La=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(k()(this,e),n=Na(this,e,[t]),C()(n,"getUniqueArray",(function(t){return t.filter((function(t,e,i){return i.indexOf(t,0)===e}))})),!i||!n.sdk||!n.sdk.viewer)return Ui()(n);if(n.options=Ta({},o),n.options.id=o.id||n.randomString(),n.options.name=o.name||"压平面",n.options.positions=o.positions||[],n.options.show=!o.show&&!1!==o.show||o.show,n.tileset=i,n.Dialog=s,!n.options.height&&0!==n.options.height){for(var a=n.options.positions[0].alt,r=0;r<n.options.positions.length;r++)a>n.options.positions[r].alt&&(a=n.options.positions[r].alt);n.options.height=a}return Ba[n.tileset.id]?Ba[n.tileset.id].push(Ta({},n.options)):Ba[n.tileset.id]=[Ta({},n.options)],n.center=i.boundingSphere.center.clone(),n.center84=n.cartesian3Towgs84(n.center,n.sdk.viewer),n.matrix=Cesium.Transforms.eastNorthUpToFixedFrame(n.center.clone()),n.localMatrix=Cesium.Matrix4.inverse(n.matrix,new Cesium.Matrix4),n.addFlat(),n}return qi()(e,t),x()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e<Ba[this.tileset.id].length;e++)Ba[this.tileset.id][e].id==this.options.id&&(Ba[this.tileset.id][e].show=t);this.addFlat()}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=Number(t);for(var e=0;e<Ba[this.tileset.id].length;e++)Ba[this.tileset.id][e].id==this.options.id&&(Ba[this.tileset.id][e].height=Number(t));this.addFlat()}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t;for(var e=0;e<Ba[this.tileset.id].length;e++)Ba[this.tileset.id][e].id==this.options.id&&(Ba[this.tileset.id][e].name=t)}},{key:"addFlat",value:function(){for(var t=this,e=[],i=0;i<Ba[this.tileset.id].length;i++){var n=Ba[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);Ba[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));e.push(l)}}for(var c=this.getIsinPolygonFun(e),u="",p=function(){var i=e[h],n=i.length,o="";i.forEach((function(t,e){o+="points_".concat(n,"[").concat(e,"] = vec2(").concat(t[0],", ").concat(t[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(Ba[t.tileset.id][h].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},h=0;h<e.length;h++)p();this.updateShader(c,u)}},{key:"remove",value:function(){var t=this;Ba[this.tileset.id]=Ba[this.tileset.id].filter((function(e){return e.id!=t.options.id}));for(var e=[],i=0;i<Ba[this.tileset.id].length;i++){var n=Ba[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);Ba[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));e.push(l)}}for(var c=this.getIsinPolygonFun(e),u="",p=function(){var i=e[h],n=i.length,o="";i.forEach((function(t,e){o+="points_".concat(n,"[").concat(e,"] = vec2(").concat(t[0],", ").concat(t[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(Ba[t.tileset.id][h].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},h=0;h<e.length;h++)p();this.updateShader(c,u)}},{key:"getIsinPolygonFun",value:function(t){var e=t.map((function(t){return t.length})),i=this.getUniqueArray(e),n="";return i.forEach((function(t){n+="\n vec2 points_".concat(t,"[").concat(t,"];\n bool isPointInPolygon_").concat(t,"(vec2 point){\n int nCross = 0; // 交点数\n const int n = ").concat(t,"; \n for(int i = 0; i < n; i++){\n vec2 p1 = points_").concat(t,"[i];\n vec2 p2 = points_").concat(t,"[int(mod(float(i+1),float(n)))];\n if(p1[1] == p2[1]){\n continue;\n }\n if(point[1] < min(p1[1], p2[1])){\n continue;\n }\n if(point[1] >= max(p1[1], p2[1])){\n continue;\n }\n float x = p1[0] + ((point[1] - p1[1]) * (p2[0] - p1[0])) / (p2[1] - p1[1]);\n if(x > point[0]){\n nCross++;\n }\n }\n return int(mod(float(nCross), float(2))) == 1;\n }\n ")})),n}},{key:"updateShader",value:function(t,e){var i=new Cesium.CustomShader({uniforms:{u_tileset_localToWorldMatrix:{type:Cesium.UniformType.MAT4,value:this.matrix},u_tileset_worldToLocalMatrix:{type:Cesium.UniformType.MAT4,value:this.localMatrix},u_flatHeight:{type:Cesium.UniformType.FLOAT,value:this.flatHeight}},vertexShaderText:"\n // 所有isPointInPolygon函数\n ".concat(t,"\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput){\n vec3 modelMC = vsInput.attributes.positionMC;\n vec4 model_local_position = vec4(modelMC.x, modelMC.y, modelMC.z, 1.0);\n vec4 tileset_local_position = u_tileset_worldToLocalMatrix * czm_model * model_local_position;\n vec2 position2D = vec2(tileset_local_position.x,tileset_local_position.y);\n float ground_z = 0.0;\n // 多个多边形区域\n ").concat(e,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],o=Cesium.Matrix4.multiplyByPoint(this.localMatrix,n.clone(),new Cesium.Cartesian3);e.push([o.x,o.y])}return e}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Ta({},this.options.position):this.options.positions?r=Ta({},this.options.positions[0]):this.options.line&&this.options.line.positions?r=Ta({},this.options.line.positions[0]):this.options.center?r=Ta({},this.options.center):this.options.start?r=Ta({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 22:for(l=[],c=0;c<this.options.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.options.positions[c].lng,this.options.positions[c].lat,this.center84.alt),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.sdk.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=23;break}return this.originalOptions=this.deepCopyObj(this.options),t.next=4,new W(this.sdk.viewer._container,{title:"压平面属性",left:"180px",top:"100px",removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.Dialog.closeCallBack&&r.Dialog.closeCallBack()}});case 4:return this._DialogObject=t.sent,t.next=7,this._DialogObject.init();case 7:(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="width: 56px;flex: 0 0 56px;">名称</span>\n <input class="input input-name">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="width: 56px;flex: 0 0 56px;">压平高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input flat-height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(i),(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){r.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){r.height=Number(o.value),r.addFlat()})),(s=document.createElement("button")).className="btn",s.innerHTML="确认",this._DialogObject.footAppChild(s),s.addEventListener("click",(function(){r.options.name||(r.options.name="压平面"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.options)})),t.next=24;break;case 23:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 24:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.height=this.options.height,this.addFlat()}},{key:"flatEdit",value:function(t){if(t){for(var e=that.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,Ba[this.tileset.id]);that.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}}},{key:"flicker",value:function(){}}]);var i,n}(Mn);function Aa(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ja(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Aa(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Aa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ia(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Fa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return k()(this,e),(i=Ia(this,e,[t,n])).options=ja({},n),i.event=new X(t),i.tip=new Z(n.text,t),i.viewer=t.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i._isDestroy=!1,i}return qi()(e,t),x()(e,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var t=this;this._isDestroy=!0,this.end(),this.ids.forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"create_point",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(t,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:e,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t)}}])}(si);function Ra(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return za(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?za(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function za(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Ha(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Va(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Ga=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ha(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return qi()(e,t),x()(e,[{key:"clampToGroundMeasure",value:(r=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=Ra(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return r.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(s=o()(a.a.mark((function t(i,n){var s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=this.computeDistance2([i,n]),r=10,l=function(t){if(!u._isDestroy){var i=u.getLabel("贴地距离:"+Number(t).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))}},c=function(){var t=o()(a.a.mark((function t(e){var o,s,r,c,p,h,d,m,f,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=u.chunkLine([i,n],e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=[],c=Ra(s),t.prev=5,c.s();case 7:if((p=c.n()).done){t.next=16;break}return h=p.value,d=s.indexOf(h),t.next=12,u.sampleHeight({lng:h[0],lat:h[1],alt:0},d);case 12:m=t.sent,r.push(m);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(5),c.e(t.t0);case 21:return t.prev=21,c.f(),t.finish(21);case 24:f=0,v=r.length-1,r.forEach((function(t,e){if(e!==v){var i=u.computeDistance2([t.position,r[e+1].position]),n=Math.abs(t.position.alt-r[e+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),l(f);case 28:case"end":return t.stop()}}),t,null,[[5,18,21,24]])})));return function(e){return t.apply(this,arguments)}}(),!(s>20)){t.next=10;break}return r=s/20,t.next=8,c(r);case 8:t.next=17;break;case 10:if(!(s<1)){t.next=14;break}l(s),t.next=17;break;case 14:return r=1,t.next=17,c(r);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Va(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(o,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.tip.setPosition(o,n.position.x,n.position.y),t.positions=t.cachePositions.concat(o),0===t.ids.length){i.next=11;break}return s=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),t.cachePositions.push(o),i.next=9,t.computeDisByTowPoint(r,s);case 9:i.next=15;break;case 11:t.cachePositions.push(o),t.ids.push(e.create_point(o,{},t)),(l=t.viewer.entities.getById(t.ids[0]))&&(l.billboard.show=!1);case 15:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}(),n=function(i,n){if(t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(i)})),this.event.mouse_right(n),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Va(e,"destroy",this,3)([])}},{key:"end",value:function(){Va(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s,r}(Fa);function Ua(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Wa(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Wa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Wa(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Ya(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Ja(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var qa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ya(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return qi()(e,t),x()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=Ua(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Ja(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(o,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.positions=t.cachePositions.concat(o),t.tip.setPosition(o,n.position.x,n.position.y),0!==t.ids.length?(s=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),l=t.computeDistance2([s,r]),c="投影距离:"+l+" 米",t.ids.push(e.create_point(o,{label:t.getLabel(c)},t)),t.cachePositions.push(o)):(t.cachePositions.push(o),t.ids.push(e.create_point(o,{show:!1},t)),(u=t.viewer.entities.getById(t.ids[0]))&&(u.billboard.show=!1));case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}(),n=function(i,n){if(t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(i),t.cachePositions.length){var n=t.cartesian3Towgs84(i,t.viewer),o=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),s="当前投影距离:"+t.computeDistance2([n,o])+" 米";t.tip.set_text(s)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(e,i){t.cachePositions.length&&(t.cachePositions.pop(),t.remove_entity(t.ids.pop()))})),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Ja(e,"destroy",this,3)([])}},{key:"end",value:function(){Ja(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20})},zIndex:99999999})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(Fa);function Xa(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Za(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Za(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Za(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Ka(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function $a(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Qa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ka(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new X(t),i}return qi()(e,t),x()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=Xa(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){$a(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(i,n){if(0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(n,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.tip.setPosition(n,i.position.x,i.position.y),t.positions=t.cachePositions.concat(n),0!==t.ids.length){var o=t.cartesian3Towgs84(n,t.viewer),s=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer);o.lng===s.lng&&o.lat===s.lat&&o.alt===s.alt||(t.cachePositions.push(n),t.computeAngle(s,o))}else{t.cachePositions.push(n),t.ids.push(e.create_point(n,{},t));var a=t.viewer.entities.getById(t.ids[0]);a&&(a.billboard.show=!1)}},n=function(i,n){if(0!==t.ids.length||t.ids.push(e.create_point(n,{},t)),t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){e.endPosition.y+=2;var n=e.endPosition,o=t.viewer.scene.pickPosition(n);if(!o){var s=t.viewer.camera.getPickRay(n);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(o),t.cachePositions.length){var a=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),l=t.computeDistance2([r,a]),c=Math.abs(r.alt-a.alt),u=l/Math.sqrt(l*l+c*c),p=Math.acos(u),h="坡度:"+t.radiansToDegrees(p).toFixed(2)+"°";t.tip.set_text(h)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(e,i){t.cachePositions.length&&(t.cachePositions.pop(),t.remove_entity(t.ids.pop()))})),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(t,i){var n=this.computeDistance2([t,i]),o=Math.abs(t.alt-i.alt),s=n/Math.sqrt(n*n+o*o),a=Math.acos(s),r=this.radiansToDegrees(a),l=this.getLabel("坡度:"+r.toFixed(2)+"°");l.pixelOffset=new Cesium.Cartesian2(0,-32),this.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),$a(e,"destroy",this,3)([])}},{key:"end",value:function(){$a(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(Fa);function tr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function er(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?tr(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ir(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function nr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var or=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ir(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return qi()(e,t),x()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){nr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i,n=0,o=0,s=function(s,a){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(er({},a)),t.ids.push(t.create_point(er({},a),!1));var r=t.cartesian3Towgs84(er({},a),t.viewer);if(r.alt>n&&(n=r.alt),t.positions=t.cachePositions.concat(er({},a)),t.tip.setPosition(er({},a),s.position.x,s.position.y),t.positions.length>2){var l=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=t.computeCenter(l),u=t.computeArea(l);o=u,t.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=t.center,t.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(e,i){if(t.tip.setPosition(er({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(er({},i)),t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=t.computeCenter(o),a=t.computeArea(o);t.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),t.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(e,n){if(t.positions=t.cachePositions,t.center=i,t.positions.length<3){t.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}else t.text="投影面积:"+o+" ㎡";t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?(t.positions=t.cachePositions,t.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),nr(e,"destroy",this,3)([])}},{key:"end",value:function(){nr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(Fa);function sr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ar(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sr(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):sr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function rr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function lr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var cr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=rr(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return qi()(e,t),x()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){lr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(ar({},o)),t.ids.push(t.create_point(ar({},o),!1));var s=t.cartesian3Towgs84(ar({},o),t.viewer);s.alt>i&&(i=s.alt),t.positions=t.cachePositions.concat(ar({},o)),t.tip.setPosition(ar({},o),n.position.x,n.position.y)},o=function(e,n){if(t.positions=t.cachePositions,t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var e=t.computeCenter(o),n=t.computeSignedArea(t.viewer,o);t.center=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,i),t.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}t.end()};this.event.mouse_left(n),this.event.mouse_move((function(e,i){t.tip.setPosition(ar({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(ar({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(e,i){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),lr(e,"destroy",this,3)([])}},{key:"end",value:function(){lr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(Fa);function ur(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function pr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var hr=function(t){function e(t){return k()(this,e),ur(this,e,[t])}return qi()(e,t),x()(e,[{key:"cal_center",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeCenter([e,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e.alt+i.alt)/2)}},{key:"cal_distance",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeDistance2([e,i]);return e.alt=e.alt.toFixed(2),i.alt=i.alt.toFixed(2),e.alt===i.alt?n:0===Number(n)?Math.abs(e.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(e.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(t){var e=this,i=this.id_map.get(t);this.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_distance(i.positions)+"米":"0米"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(){return i.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999}})),this.ids.push(t)}},{key:"create_angle_label",value:function(t,e,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_point(t,e):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_angle(t,e,n)+"°":"0°"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(15,-10)}});this.viewer.entities.add(s)}},{key:"cal_point",value:function(t,e){for(var i=0;i<t.length;i++)for(var n=0;n<e.length;n++)if(t[i].x===e[n].x&&t[i].y===e[n].y&&t[i].z===e[n].z)return t[i]}},{key:"cal_angle",value:function(t,e,i){if(1===i)return 90;if(2===i||3===i){var n=this.id_map.get(t).positions,o=this.id_map.get(e).positions,s=this.cartesian3Towgs84(n[0],this.viewer),a=this.cartesian3Towgs84(n[1],this.viewer),r=this.computeDistance2([a,s]),l=this.cartesian3Towgs84(o[0],this.viewer),c=this.cartesian3Towgs84(o[1],this.viewer),u=this.computeDistance2([l,c]),p=Math.abs(l.alt-c.alt),h=Math.sqrt(Math.pow(p,2)+Math.pow(u,2));return 0==r&&(r=Math.abs(a.alt-s.alt)),(180*Math.acos(r/h)/Math.PI).toFixed(2)}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){pr(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=this.randomString(),n=this.randomString(),o=this.randomString(),s=(this.randomString(),this.randomString(),this.randomString(),[]);this.id_map=new Map;var a={};this.id_map.set(o,{positions:[]}),this.id_map.set(i,{positions:[]}),this.id_map.set(n,{positions:[]});var r=function(e,r){if(s.push(r),0===t.ids.length&&(a=t.cartesian3Towgs84(r,t.viewer),t.createPolyline(i),t.createPolyline(n),t.createPolyline(o)),t.ids.push(t.create_point(r)),t.tip.setPosition(r,e.position.x,e.position.y),s.length){var l=t.cartesian3Towgs84(r,t.viewer),c=t.id_map.get(n),u=t.id_map.get(i);l.alt<a.alt?(c.positions[0]=r,c.positions[1]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[0]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(c.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),c.positions[1]=r,u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}2===s.length&&t.end()};this.event.mouse_left(r),this.event.mouse_move((function(e,r){t.tip.setPosition(r,e.endPosition.x,e.endPosition.y);var l=t.id_map.get(o);if(s.length){l.positions=s.concat(r);var c=t.cartesian3Towgs84(r,t.viewer),u=t.id_map.get(n),p=t.id_map.get(i);c.alt<a.alt?(u.positions[0]=r,u.positions[1]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),p.positions[0]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),p.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),u.positions[1]=r,p.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),p.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}})),this.event.mouse_right((function(e,i){t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?t.end():r(o,i)}))}))}}},{key:"end",value:function(){pr(e,"end",this,3)([])}},{key:"destroy",value:function(){pr(e,"destroy",this,3)([])}}])}(Fa);function dr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function mr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var fr=function(t){function e(t){var i;return k()(this,e),(i=dr(this,e,[t,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return qi()(e,t),x()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){mr(e,"start",this,3)([]),this.cache_id=e.create_point(this),e.createLocation(this);var i=function(e,i){t.position=i;var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0);var o=t.cartesian3Towgs84(i,t.viewer),s=$e();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}t.end()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.destroy(),t.end()})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y);var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0),t.position=i;var o=t.cartesian3Towgs84(i,t.viewer),s=$e();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}})),this.event.gesture_pinck_start((function(e,n){var o=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-o>=500?(t.destroy(),t.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id),mr(e,"destroy",this,3)([])}},{key:"end",value:function(){mr(e,"end",this,3)([])}}],[{key:"createLocation",value:function(t){t.viewer.entities.add(new Cesium.Entity({id:t.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(t.defaultColor),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(-100,-50)},billboard:{image:t.getSourceRootPath()+"/img/location.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:48,height:48}}))}},{key:"create_point",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:C()({image:t.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY},"color",Cesium.Color.WHITE.withAlpha(.99))})),e}}])}(Fa);function vr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function gr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var yr=function(t){function e(t){return k()(this,e),vr(this,e,[t,{text:"左键开始,右键取消"}])}return qi()(e,t),x()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){gr(e,"start",this,3)([]),this.positions=[],this.position=new Cesium.Cartesian3,this.height=0,this.text="",this.circleRadius=0;var i=0;this.firstpoint=null;var n=function(n,o){if(null===t.firstpoint&&(t.positions.push(o),t.firstpoint=t.cartesian3Towgs84(o,t.viewer),t.ids.push(e.create_polygon(t)),t.ids.push(e.create_point(t,o))),i++,t.tip.setPosition(o,n.position.x,n.position.y),2===i){if(t.firstpoint){var s=t.cartesian3Towgs84(o,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,s.alt),t.positions[2]=o,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,s]),t.height=Number((s.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}t.ids.push(e.create_point(t,o,{label:{text:"半径:"+t.circleRadius+" 米"}})),t.end()}};this.event.mouse_left(n),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.firstpoint){var n=t.cartesian3Towgs84(i,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,n.alt),t.positions[2]=i,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,n]),t.height=Number((n.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}})),this.event.mouse_right((function(e,i){t.end(),t.destroy()})),this.event.gesture_pinck_start((function(e,i){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?(t.end(),t.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){gr(e,"end",this,3)([])}},{key:"destroy",value:function(){gr(e,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();t.viewer.entities.add(new Cesium.Entity({id:e,billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return t.height+t.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(t.defaultColor)}}));return e}},{key:"create_point",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.randomString(),o=t.cartesian3Towgs84(e,t.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return i.label&&(s.label={text:i.label.text,scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15)}),t.viewer.entities.add(new Cesium.Entity(s)),n}}])}(Fa);function br(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Cr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var wr=function(t){function e(t){var i;return k()(this,e),(i=br(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return qi()(e,t),x()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){Cr(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;Cr(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.cartesian3Towgs84(t[2],this.viewer),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a=turf.point([n.lng,n.lat]),r={units:"kilometers"},l=turf.rhumbDistance(o,s,r),c=turf.rhumbDistance(a,s,r),u=l;l>c&&(u=c);var p=turf.rhumbBearing(o,s),h=turf.rhumbBearing(a,s),d=Math.abs((p-h+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=p-180,f=h-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y<v.geometry.coordinates.length;y++)g.push(Cesium.Cartesian3.fromDegrees(v.geometry.coordinates[y][0],v.geometry.coordinates[y][1]));this.arcPositions=g}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Cr(e,"start",this,3)([]);var i=function(e,i){if(0===t.ids.length&&(t.line_id=t.createPolyline()),t.ids.push(t.create_point(i)),t.tip.setPosition(i,e.position.x,e.position.y),t.cachePositions.push(i),t.cachePositions.length&&(t.positions=t.cachePositions.concat(i)),2===t.ids.length){t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid();var n=t.cartesian3Towgs84(i,t.viewer);t.sampleHeightMostDetailed([n]).then((function(e){t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}))}3===t.ids.length&&(t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]]),t.end())};this.event.mouse_left(i),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length&&(t.positions=t.cachePositions.concat(i)),t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(Fa);function kr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function _r(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var xr=function(t){function e(t){var i;return k()(this,e),(i=kr(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return qi()(e,t),x()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){_r(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;_r(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=this.cartesian3Towgs84(t[1],this.viewer),i=this.cartesian3Towgs84(t[0],this.viewer),n=turf.point([e.lng,e.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,e);this.bearing=(180+s).toFixed(2);for(var a=turf.rhumbDistance(n,o,{units:"kilometers"}),r=turf.lineArc(n,a/3,0,this.bearing),l=[],c=0;c<r.geometry.coordinates.length;c++)l.push(Cesium.Cartesian3.fromDegrees(r.geometry.coordinates[c][0],r.geometry.coordinates[c][1]));this.arcPositions=l}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){_r(e,"start",this,3)([]);var i=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.ids.length&&(t.line_id=t.createPolyline()),t.tip.setPosition(n,i.position.x,i.position.y),t.cachePositions.length&&(t.positions=t.cachePositions.concat(n),s=t.cartesian3Towgs84(n,t.viewer),r=t.cartesian3Towgs84(t.positions[1],t.viewer),l=turf.point([r.lng,r.lat]),c=turf.point([s.lng,s.lat]),u={units:"kilometers"},p=turf.rhumbDistance(l,c,u),0,h=turf.destination(l,p,0,u),t.positions[0]=(o=Cesium.Cartesian3).fromDegrees.apply(o,L()(h.geometry.coordinates))),t.cachePositions.push(n),t.cachePositions.push(n),t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]]),!(t.ids.length>=2)){e.next=9;break}return t.end(),e.abrupt("return");case 9:if(t.ids.push(t.create_point(n)),t.ids.push(t.create_point(n)),2!==t.ids.length){e.next=20;break}return t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid(),d=t.cartesian3Towgs84(n,t.viewer),e.next=17,t.sampleHeightMostDetailed([d]);case 17:m=e.sent,t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});case 20:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length){var n;t.positions=t.cachePositions.concat(i);var o=t.cartesian3Towgs84(i,t.viewer),s=t.cartesian3Towgs84(t.positions[1],t.viewer),a=turf.point([s.lng,s.lat]),r=turf.point([o.lng,o.lat]),l={units:"kilometers"},c=turf.rhumbDistance(a,r,l),u=turf.destination(a,c,0,l);t.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(u.geometry.coordinates))}t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(Fa);function Er(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Sr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=Er(this,e,[t,n])).options.curve=n.curve||!1;var o=Number(n.number);return isNaN(o)?i.options.number=1/0:i.options.number=o<2?2:o,i}return qi()(e,t),x()(e,[{key:"smoothHandle",value:function(t){if(t.length>1){for(var e=[],i=[],n=0;n<t.length;n++)i.push(n/(t.length-1));for(var o=new Cesium.CatmullRomSpline({times:i,points:t}),s=20*t.length,a=0;a<=s;a++){var r=o.evaluate(a/s);e.push(r)}return e}return t}},{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",r.positions=c.concat(n),r.tip.setPosition(n,i.position.x,i.position.y),!r.entityHasCreated){var o=e.create_polyline(r,r.viewer);r.points_ids.push(o)}if(c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),c.length>=r.options.number){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var u=r.smoothHandle(c);s=[];for(var p=0;p<u.length;p++)s[p]=r.cartesian3Towgs84(u[p],r.viewer)}t(null,a,s),r.end()}}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n,o=[];if(c.forEach((function(t){o.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}t(null,o,n),r.end()}})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(e),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}t(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var p=e.create_polyline(r,r.viewer);r.points_ids.push(p)}c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(i),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.entityHasCreated){var n=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n,o=[];if(c.forEach((function(t){o.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}t(null,o,n),r.end()}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(e),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}t(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var p=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(p)}c.push(n),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polyline",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return t.options.curve?t.smoothHandle(t.positions):t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),i}}])}(Ys);function Dr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Pr=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),Dr(this,e,[t,i,n])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;",this.sdk),this.event=new X(this.sdk),this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){e.end(),t(!1)})),this.event2D.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x+e.viewer.canvas.width,t.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;e.event2D.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy()}}])}(Ys);function Mr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Or=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Mr(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.viewer;t.entities.add(new Cesium.Entity({id:g.circle_id,position:new Cesium.CallbackProperty((function(t){if(v){var e=g.computeMidpoint(f,v);return Cesium.Cartesian3.fromDegrees(e.lng,e.lat,v.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return d>1e3?"半径:"+(d/1e3).toFixed(2)+" 公里":"半径:"+d+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(m))}),!1),material:Cesium.Color.fromCssColorString(g.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return p}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var u=0;this.circle_id=this.randomString();var p=[],h=[],d=1,m=[],f={},v=null;this.event.mouse_left((function(e,i){"2D"!==l&&(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c()),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event.gesture_pinck_start((function(e,i){if("2D"!==l){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){"3D"!==l&&(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c(r._sdk2D.viewer)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event2D.gesture_pinck_start((function(e,i){if("3D"!==l){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(r._sdk2D.viewer),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2+r.viewer.canvas.width,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})));var g=this}}},{key:"end",value:function(){this.remove_entity(this.circle_id),this.remove_entity(this.point_id),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(Ys);function Tr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Nr=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Tr(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=Cesium.Cartesian3.fromDegrees(m[0].lng,m[0].lat),e=Cesium.Cartesian3.fromDegrees(m[1].lng,m[1].lat),i=Cesium.Cartesian3.fromDegrees(m[2].lng,m[2].lat);if(1===p){g=Cesium.Cartesian3.distance(t,e),f=(v=g)/2;var n={x:h.lng,y:h.lat},o={x:m[1].lng,y:m[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,c=o.x*s,u=Math.sin(c-l)*Math.cos(r),d=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(c-l),C=Math.atan2(u,d)%(2*Math.PI);b=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===p){Cesium.Cartesian3.distance(t,i),y=Cesium.Cartesian3.distance(e,i);var w=turf.point([m[0].lng,m[0].lat]),k=turf.point([m[1].lng,m[1].lat]),_=turf.point([m[2].lng,m[2].lat]),x=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,_),S=Math.abs(x-E),D=S>180?360-S:S;D=180-D,f=y*Math.sin(Cesium.Math.toRadians(D))}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C.viewer;t.entities.add(new Cesium.Entity({id:C.elliptic_id,position:Cesium.Cartesian3.fromDegrees(h.lng,h.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(t){return f}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return v}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(t){return Cesium.Math.toRadians(b)}),!1),material:Cesium.Color.fromCssColorString(C.color),zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var p=0;this.elliptic_id=this.randomString();var h,d=[],m=[],f=0,v=0,g=0,y=0,b=0;this.event.mouse_left((function(e,i){if("2D"!==l){if(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u()}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u(r._sdk2D.viewer)}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})));var C=this}}},{key:"end",value:function(){var t=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(e){t.remove_entity(e)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(Ys);function Br(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Lr=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Br(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=!1;this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",!r.entityHasCreated){var n=e.create_arrow_polygon(r);r.points_ids.push(n)}r.points_ids.push(r.create_point(i)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event.mouse_move((function(t,e){"2D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",!r.entityHasCreated){var n=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2)}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAttackArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Ys);function Ar(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var jr=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Ar(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",!r.entityHasCreated){var o=e.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消绘制"))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",!r.entityHasCreated){var o=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消绘制"))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computePincerArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Ys);function Ir(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Fr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Rr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ir(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;Fr(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event.mouse_move((function(t,o){if("2D"!==n&&(i.tip.setPosition(o,t.endPosition.x,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i))}})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event2D.mouse_move((function(t,o){if("3D"!==n&&(i.tip.setPosition(o,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i,i._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){Fr(e,"end",this,3)([]),this.viewer.entities.remove(this.arrowPolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.arrowPolygon)}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"ArrowPolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeStraightArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(Ys);function zr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Hr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=zr(this,e,[t,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var c;(i=e,n="start",o=this,s=3,a=Us()(Yi()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消",l.sdk),this.event=new X(l.sdk),this.positions=[],this.points_ids=[];var u=0,p=null,h=null;this.event.mouse_left((function(i,n){if("2D"!==c){c="3D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event.mouse_right((function(e,i){"2D"!==c&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==c&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event.gesture_pinck_start((function(i,n){if("2D"!==c){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==c){c="2D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event2D.mouse_right((function(e,i){"3D"!==c&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==c&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==c){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})))}}},{key:"calrect",value:function(t,e){var i,n=[],o=[],s=[];if(n.push([t.lng,t.lat,t.alt],[e.lng,e.lat,e.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(e){o.push(e[0]),o.push(e[1]);var i={lng:e[0],lat:e[1],alt:t.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t.rect))}),!1),material:Cesium.Color.fromCssColorString(t.color),arcType:t.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(Ys);function Vr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Gr(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Ur=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Vr(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;Gr(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event.mouse_move((function(t,s){if("2D"!==n&&(i.tip.setPosition(s,t.endPosition.x,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event2D.mouse_move((function(t,s){if("3D"!==n&&(i.tip.setPosition(s,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){Gr(e,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(t,e,i){var n,o,s,a,r,l;e||(e=Math.PI/2),i||(i=1);var c=Math.sqrt(t.x*t.x+t.y*t.y);if(0==t.y)n=o=c*i*Math.cos(e)/t.x,t.x>0?a=-(s=Math.sqrt(i*i-n*n)):t.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-t.x/t.y,p=i*c*Math.cos(e)/t.y,h=1+u*u,d=2*u*p,m=p*p-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*h*m))/(2*h))+p,a=u*(o=(-d+Math.sqrt(d*d-4*h*m))/(2*h))+p,t.y>=0?(r={x:n,y:s},l={x:o,y:a}):t.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(t){if(null==t||t.length<3)return t;var e=t[0];t.push(e);for(var i=t,n=[],o=.4,s=i.length-1,a=0;a<=s-1;a++){var r=void 0,l=void 0,c=void 0;a==s-1?(r=i[s-1],l=i[0],c=i[1]):(r=i[a],l=i[a+1],c=i[a+2]);var u={x:void 0,y:void 0},p={x:void 0,y:void 0},h={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(h.x*h.x+h.y*h.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:h.x/m,y:h.y/m},g={x:d.x/f,y:d.y/f},y={x:v.x+g.x,y:v.y+g.y},b=Math.sqrt(y.x*y.x+y.y*y.y),C={x:y.x/b,y:y.y/b},w=(v.x*g.x+v.y*g.y)/1;Math.abs(1-w)<.005?(u.x=l.x-g.x*m*o,u.y=l.y-g.y*m*o,p.x=l.x+v.x*f*o,p.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,p.x=l.x+C.x*f*o,p.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=p,n[3*(s-2)+2+3]=u,n[3*(s-2)+2+4]=i[s]):(n[3*a+2+0]=u,n[3*a+2+1]=l,n[3*a+2+2]=p)}return n}},{key:"calculatePointsFBZ3",value:function(t,e){e||(e=20);var i=[],n=.05;e>0&&(n=1/e);for(var o=0;o<t.length-3;){var s=t[o],a=t[o+1],r=t[o+2],l=t[o+3];i.push(s);for(var c=0;c<1;){var u={x:(1-c)*(1-c)*(1-c)*s.x+3*c*(1-c)*(1-c)*a.x+3*c*c*(1-c)*r.x+c*c*c*l.x,y:(1-c)*(1-c)*(1-c)*s.y+3*c*(1-c)*(1-c)*a.y+3*c*c*(1-c)*r.y+c*c*c*l.y};i.push(u),c+=n}(o+=3)>=t.length&&i.push(s)}return i}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAssemble(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(Ys);function Wr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Yr=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Wr(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"start",value:function(t){var i,n,o,s,a,r,l=this,c=this;YJ.Measure.GetMeasureStatus()?t("上一次测量未结束"):((n=e,o="start",s=this,a=3,r=Us()(Yi()(1&a?n.prototype:n),o,s),2&a&&"function"==typeof r?function(t){return r.apply(s,t)}:r)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确认,右键取消",c.sdk),this.event=new X(c.sdk),this._sector_id=null,this._positions=[],this.points_ids=[],this._entities_sector=[],this._radius=0,this._startAngle=0,this._endAngle=0,this.event.mouse_left((function(e,n){if("2D"!==i&&(i="3D",l._positions.length<3?(l.points_ids.push(l.create_point(n)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event.mouse_move((function(t,e){if("2D"!==i&&(l.tip.setPosition(e,t.endPosition.x,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event.mouse_right((function(e,n){"2D"!==i&&(l.end(),t(null))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,n){if("3D"!==i&&(i="2D",l._positions.length<3?(l.points_ids.push(l.create_point(n,l._sdk2D.viewer)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event2D.mouse_move((function(t,e){if("3D"!==i&&(l.tip.setPosition(e,t.endPosition.x+l.viewer.canvas.width,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(l._sdk2D.viewer),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event2D.mouse_right((function(e,n){"3D"!==i&&(l.end(),t(null))}))))}},{key:"createsector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,e=this,i=new Cesium.CallbackProperty((function(){var t=e.calSector(e._positions[0],e._radius,e._startAngle,e._endAngle);return new Cesium.PolygonHierarchy(t)})),n=e.randomString(),o=t.entities.add({id:n,position:Cesium.Cartesian3.fromDegrees(e._positions[0].lng,e._positions[0].lat),polygon:{hierarchy:i,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}});return e._entities_sector.push(o),n}},{key:"cartesianToLatlng",value:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),i]}},{key:"lonLatToMercator",value:function(t){var e=t[0],i=t[1],n=20037508.34*e/180,o=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return[n,o=20037508.34*o/180]}},{key:"WebMercator2lonLat",value:function(t){var e=t[0]/20037508.34*180,i=t[1]/20037508.34*180;return[e,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}}])}(Ys),Jr=52.35987755982988,qr=3.141592653589793,Xr=.006693421622965943,Zr=function(){return x()((function t(){k()(this,t)}),null,[{key:"BD09ToGCJ02",value:function(t,e){var i=+t-.0065,n=+e-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*Jr),s=Math.atan2(n,i)-3e-6*Math.cos(i*Jr);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*Jr),n=Math.atan2(e,t)+3e-6*Math.cos(t*Jr);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[t+i[0],e+i[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[2*t-(t+i[0]),2*e-(e+i[1])]}},{key:"delta",value:function(t,e){var i=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),o=e/180*qr,s=Math.sin(o);s=1-Xr*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*qr),n=180*n/(6378245*(1-Xr)/(s*a)*qr)]}},{key:"transformLng",value:function(t,e){var i=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*qr)+20*Math.sin(2*t*qr))/3,i+=2*(20*Math.sin(t*qr)+40*Math.sin(t/3*qr))/3,i+=2*(150*Math.sin(t/12*qr)+300*Math.sin(t/30*qr))/3}},{key:"transformLat",value:function(t,e){var i=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*qr)+20*Math.sin(2*t*qr))/3,i+=2*(20*Math.sin(e*qr)+40*Math.sin(e/3*qr))/3,i+=2*(160*Math.sin(e/12*qr)+320*Math.sin(e*qr/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}])}();function Kr(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var $r=function(t){function e(t,i){var n;return k()(this,e),(n=Kr(this,e,[t,i])).sdk.addIncetance(n.options.id,n),n.options.show&&Qt(0,n.options.id),n}return qi()(e,t),x()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Us()(Yi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h()}},{key:"requestResource",value:function(){var t="";return t=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/load-compact-service":this.options.host+"/yjearth4.0/data/service/load-compact-service",fetch(t,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}})}}])}(Mn);function Qr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function tl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Qr(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Qr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function el(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function il(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var nl=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=el(this,e,[t,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return qi()(e,t),x()(e,[{key:"setDefaultValue",value:function(){var t,i;il(e,"setDefaultValue",this,3)([]),this.options.alpha=null!==(t=this.options.alpha)&&void 0!==t?t:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"layer_index",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"brightness",get:function(){return this.options.brightness},set:function(t){this.options.brightness=t,this.entity.brightness=t}},{key:"alpha",get:function(){return this.options.alpha},set:function(t){Number(t)>1&&(t=1),Number(t)<0&&(t=0),this.entity.alpha=t,this.options.alpha=t,this._elms.alpha&&this._elms.alpha.forEach((function(e){e.value=t}))}},{key:"layerRaise",value:function(t){this.sdk.viewer.imageryLayers.raise(this.entity);for(var e=0;e<this.sdk.viewer.imageryLayers._layers.length;e++)if(this.sdk.viewer.imageryLayers._layers[e]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type)){var i=this.sdk.viewer.imageryLayers._layers[e];this.sdk.viewer.imageryLayers.raiseToTop(i)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerLower",value:function(){return this.sdk.viewer.imageryLayers.lower(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToTop",value:function(){this.sdk.viewer.imageryLayers.raiseToTop(this.entity);for(var t=0;t<this.sdk.viewer.imageryLayers._layers.length;t++)if(this.sdk.viewer.imageryLayers._layers[t]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type)){var e=this.sdk.viewer.imageryLayers._layers[t];this.sdk.viewer.imageryLayers.raiseToTop(e)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToBottom",value:function(){return this.sdk.viewer.imageryLayers.lowerToBottom(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"remove",value:function(){il(e,"remove",this,3)([]),this.sdk.viewer.scene.imageryLayers.remove(this.entity),this.entity=null}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.length>0&&void 0!==l[0]&&l[0],!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=tl({},this.options.position):this.options.positions?r=tl({},this.options.positions[0]):this.options.center?r=tl({},this.options.center):this.options.start?r=tl({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(t){return new(function(t){function e(t){var i;k()(this,e),i=el(this,e,[t]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(t,e){return e=Zr.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},i._projection.unproject=function(t,e){var i=n.unproject(t);return e=Zr.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},i}return qi()(e,t),x()(e)}(Cesium.WebMercatorTilingScheme))(t)}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new Zi(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),be(s.sdk,s.options.id),re(s.sdk,s.options.id)},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">透明度:</span>\n <input type="range" class="alpha" min="0" max="1" step="0.01">\n </div>\n </div>\n </div>\n ',e.innerHTML=i,n=e.getElementsByClassName("name")[0],o=e.getElementsByClassName("alpha")[0],n.value=this.name,o.value=this.alpha,n.addEventListener("input",(function(){s.name=n.value})),o.addEventListener("input",(function(){s.alpha=o.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){(this.entity||this._DialogObject)&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.alpha=this.options.alpha,this.brightness=this.options.brightness)}},{key:"flicker",value:function(){}}]);var i,n}($r);function ol(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var sl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),ol(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=6;break}return t.next=3,Cesium.ArcGisMapServerImageryProvider.fromUrl(e);case 3:i=t.sent,t.next=7;break;case 6:i=new Cesium.ArcGisMapServerImageryProvider({url:e});case 7:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i),this.entity._id=this.options.id,n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)&&(o=this.sdk.viewer.imageryLayers._layers[n],this.sdk.viewer.imageryLayers.raiseToTop(o));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qt(0,this.options.id);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}]);var i}(nl),al=function(t){function e(t,i){var n;return k()(this,e),(n=ol(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),n}return qi()(e,t),x()(e)}(sl),rl=function(t){function e(t,i){var n;return k()(this,e),(n=ol(this,e,[t,i])).createArcGis("https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"),n}return qi()(e,t),x()(e)}(sl),ll=function(t){function e(t,i){var n;return k()(this,e),(n=ol(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"),n}return qi()(e,t),x()(e)}(sl);function cl(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ul=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),cl(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(t){var e=new Cesium.UrlTemplateImageryProvider({url:t,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var i=0;i<this.sdk.viewer.imageryLayers._layers.length;i++)if(this.sdk.viewer.imageryLayers._layers[i]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type)){var n=this.sdk.viewer.imageryLayers._layers[i];this.sdk.viewer.imageryLayers.raiseToTop(n)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qt(0,this.options.id)}}])}(nl),pl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=cl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8"),i}return qi()(e,t),x()(e)}(ul),hl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=cl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return qi()(e,t),x()(e)}(ul),dl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=cl(this,e,[t,n])).createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"),i}return qi()(e,t),x()(e)}(ul);function ml(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return fl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?fl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function vl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):vl(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function yl(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function bl(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function Cl(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function wl(t,e){return t.get(kl(t,e))}function kl(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _l=new WeakMap,xl=function(t){function e(t,i){var n;return k()(this,e),Cl(n=yl(this,e,[t,i]),_l,void 0),n.setDefaultValue(),n.watchs=[],n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element_style=null,n.options.accuracy=i.accuracy?Number(i.accuracy.toFixed(1)):1,n.options.position=n.options.position||{},n.oldData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.roll||0,heading:n.options.heading||0,pitch:n.options.pitch||0},n.newData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.roll||0,heading:n.options.heading||0,pitch:n.options.pitch||0},n.tileset=void 0,n.editObj=new _o(n.sdk),n.editObj.controllerCallBack=n.rotationEditingCallBack,n}return qi()(e,t),x()(e,[{key:"add",value:(s=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTileset({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTileset(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"loadSceneTree",value:function(){}},{key:"loadTileset",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=gl({},e),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,t.next=5,fetch(n,{method:"get",headers:{"Content-Type":"application/json"}});case 5:if(200!==(s=t.sent).status){t.next=10;break}return t.next=9,s.json();case 9:this.tileset=t.sent;case 10:if(r={show:this.options.show,skipLevelOfDetail:!0,baseScreenSpaceError:1024,maximumScreenSpaceError:32,skipScreenSpaceErrorFactor:16,skipLevels:1,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!0,cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,preloadWhenHidden:!1,preferLeaves:!0,maximumCacheOverflowBytes:128,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.1,dynamicScreenSpaceErrorFactor:1,dynamicScreenSpaceError:!0},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=19;break}return t.next=14,Cesium.Cesium3DTileset.fromUrl(n,r);case 14:l=t.sent,this.entity=l,this.entity.imageBasedLighting.luminanceAtZenith=.1,t.next=25;break;case 19:return r.url=n,l=new Cesium.Cesium3DTileset(r),t.next=23,l.readyPromise;case 23:this.entity=t.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return t.next=27,this.loadSceneTree(n);case 27:if(c=function(t){if(t._contents)for(var e=0;e<t._contents.length;e++)c(t._contents[e]);else for(var i=0;i<t.featuresLength;i++){var n=t.getFeature(i),o=n.content.url,s=n.getProperty("id");if(m.features.has(s))if(m.features.get(s).features){if(m.features.get(s).features[o]){if(m.features.get(s).features[o].customColor&&(n.color=m.features.get(s).features[o].customColor,n.customColor=m.features.get(s).features[o].customColor),m.features.get(s).features[o].customAlpha){var a=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(m.features.get(s).features[o].customAlpha,")")),n.customAlpha=m.features.get(s).features[o].customAlpha}m.features.get(s).features[o].customShow&&(n.show=m.features.get(s).features[o].customShow,n.customShow=m.features.get(s).features[o].customShow)}m.features.get(s).features[o]=n}else{var r={};if(m.features.get(s).customColor&&(n.color=m.features.get(s).customColor,n.customColor=m.features.get(s).customColor),m.features.get(s).customAlpha){var l=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(l.red),",").concat(Cesium.Color.floatToByte(l.green),",").concat(Cesium.Color.floatToByte(l.blue),",").concat(m.features.get(s).customAlpha,")")),n.customAlpha=m.features.get(s).customAlpha}m.features.get(s).customShow&&(n.show=m.features.get(s).customShow,n.customShow=m.features.get(s).customShow),r[o]=n,m.features.get(s).features=r}else{var u={};u[o]=n,m.features.set(s,{features:u})}n.customColor||(n.customColor=Cesium.Color.fromCssColorString("#ffffff"))}},this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=30;break}return t.abrupt("return");case 30:l.tileLoad.addEventListener((function(t){var e,i,n;c(t._content),clearTimeout(wl(_l,m)),e=_l,i=m,n=setTimeout((function(){clearTimeout(wl(_l,m));var t,e=m.cartesian3Towgs84(l.boundingSphere.center,m.sdk.viewer),i=turf.circle([e.lng,e.lat],l.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),n=ml(m.sdk.entityMap);try{for(n.s();!(t=n.n()).done;){var o=y()(t.value,2),s=(o[0],o[1]);if("BillboardObject"===s.type&&3==s.heightMode){var a=turf.point([s.lng,s.lat]);turf.booleanPointInPolygon(a,i)&&s.updateHeight()}else s.label&&(s.label.show=s.label.show)}}catch(t){n.e(t)}finally{n.f()}}),500),e.set(kl(e,i),n)})),this.entity._root.originalTransform=gl({},this.entity._root.transform),this.entity.id=this.options.id||this.randomString(),this.entity.type=this.type,this.sdk.viewer.scene.primitives.add(l),!this.options.position||"{}"==JSON.stringify(this.options.position)||!this.options.position.lng&&0!==this.options.position.lng||!this.options.position.lat&&0!==this.options.position.lat?(this.options.position={},d=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(d=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(d.longitude),lat:this.oldData.lat=Cesium.Math.toDegrees(d.latitude),height:d.height},this.lng=this.oldData.lng=Cesium.Math.toDegrees(d.longitude),this.lat=this.oldData.lat=Cesium.Math.toDegrees(d.latitude),this.height=this.oldData.height=d.height):(this.options.position.alt,this.options.position.alt,u=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(u=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(u.longitude),lat:Cesium.Math.toDegrees(u.latitude),height:u.height},p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt)),h=Cesium.Matrix4.fromUniformScale(this.oldData.scale),this.tileset.root.transform&&Cesium.Matrix4.multiply(p,h,this.entity._root.transform),this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.height=this.oldData.height),this.scale=this.oldData.scale,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.transparency=this.oldData.transparency,re(this.sdk,this.options.id),ft(this.entity.id,this.mouseMoveCB,this);case 43:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"remove",value:function(){bl(e,"remove",this,3)([]),this.editObj.destroy(),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:function(){bl(e,"flyTo",this,3)([])}},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){bl(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"position",get:function(){var t=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center);this.tileset.root.transform&&(t=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]}));var e=Cesium.Math.toDegrees(t.longitude+6.63814e-9),i=Cesium.Math.toDegrees(t.latitude+2.5137835e-7);return this.newData.lng&&this.newData.lat&&this.newData.height?{lng:this.newData.lng,lat:this.newData.lat,height:this.newData.height}:{lng:e,lat:i,height:t.height-2.19104611043234}},set:function(t){}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(t){if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");t?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editRtation()):this.editObj.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.editObj.getActiveState()},set:function(t){if(this.sdk&&this.sdk.viewer&&this.entity)return this.tileset.root.transform?void(t?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editTranslational()):this.editObj.destroy()):(window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!"))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e,i){t.lng=e.position.lng,t.lat=e.position.lat,t.height=e.position.alt,t.roll=e.rotate.x,t.heading=e.rotate.y,t.pitch=e.rotate.z}},set:function(t){this._rotationEditingCallBack=t}},{key:"flicker",value:function(){}},{key:"edit",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"show",get:function(){return this.options.show},set:function(t){var e=this;"boolean"==typeof t?(this.options.show=t,this.entity&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&this.label&&(this.label.show=t),setTimeout((function(){var t,i=e.cartesian3Towgs84(e.entity.boundingSphere.center,e.sdk.viewer),n=turf.circle([i.lng,i.lat],e.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=ml(e.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,n)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}be(e.sdk,e.options.id),re(e.sdk,e.options.id)}),300)):console.error("参数必须为boolean")}}]);var i,n,s}($r);function El(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Sl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Sl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Sl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Dl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Dl(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Dl(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ml(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Ol(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Tl(t,e,i){return t.set(Bl(t,e),i),i}function Nl(t,e){return t.get(Bl(t,e))}function Bl(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Ll=new WeakMap,Al=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Ol(i=Ml(this,e,[t,n]),Ll,void 0),i.picking=!1,i.Dialog=o,i._elms={},i._EventBinding=new pn,i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.add()}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.options.position.alt=t,this._elms.height&&this._elms.height.forEach((function(e){e.value=t})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"accuracy",get:function(){return this.newData.accuracy},set:function(t){var e=this;this.newData.accuracy=Number(t.toFixed(1)),this.newData.accuracy<.1&&(this.newData.accuracy=.1),this.entity&&(this.entity.maximumScreenSpaceError=32/this.newData.accuracy),this._elms.accuracy&&this._elms.accuracy.forEach((function(t){t.value=e.newData.accuracy}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.options.position.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.options.position.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"transparency",get:function(){return this.newData.transparency},set:function(t){if(this.newData){this.newData.transparency=Number(t),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}));var e=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+e+")"],["true","color('rgba(255,255,255,"+e+")')"]]},show:!0})}}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 420px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 45px;\n }\n",t.next=11,new Zi(this.sdk,this.newData,{title:"倾斜模型属性",left:"180px",top:"100px",confirmCallBack:function(t){o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.transparency=o.newData.transparency,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o.oldData.type=o.type,o.oldData.accuracy=o.newData.accuracy,o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(Pl(Pl({},o.oldData),{},{type:o.type})),re(o.sdk,o.oldData.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing&&(o.positionEditing=!1),o.rotationEditing&&(o.rotationEditing=!1),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}},!0);case 11:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0.1" max="10" step="0.1" @model="accuracy">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">透视</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(Nl(Ll,this)),Tl(Ll,this,setTimeout((function(){clearTimeout(Nl(Ll,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=El(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"reset",value:function(){this.editObj.destroy(),this.entity&&(this.transparency=this.oldData.transparency,this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale,this.accuracy=this.oldData.accuracy,this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+this.transparency+")"],["true","color('rgba(255,255,255,"+this.transparency+")')"]]},show:!0}))}}]);var i}(xl);function jl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Il(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Il(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Il(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Fl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Rl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fl(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fl(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function zl(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Hl(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Vl(t,e,i){return t.set(Ul(t,e),i),i}function Gl(t,e){return t.get(Ul(t,e))}function Ul(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Wl=new WeakMap,Yl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Hl(i=zl(this,e,[t,n]),Wl,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new pn,i.Dialog.exportState=function(t){i.exportState(t)},i.Dialog.exportProperty=function(t){i.exportProperty(i.exportStateArray)},i.features=new Map,i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.roll&&this._elms.roll.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.heading&&this._elms.heading.forEach((function(e){e.value=t}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.newData.scale},set:function(t){this.newData.scale=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"loadSceneTree",value:(r=o()(a.a.mark((function t(e){var i,n=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=e.split("/"))[i.length-1]="scenetree.json",t.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(t){n.scenetree=t;var e=function(t){t.forEach((function(t){n.features.has(t.id)?n.features.get(t.id).sphere=t.sphere:n.features.set(t.id,{sphere:t.sphere}),t.children&&e(t.children)}))};e(t.scenes[0].children)}));case 4:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new Zi(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o._DialogObject.close();var e=new Map;o.features.forEach((function(t,i){var n=Rl({},t);delete n.features,e.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(Rl(Rl({},o.oldData),{},{features:e,type:o.type})),re(o.sdk,o.oldData.id)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.editObj.destroy(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">x轴</span>\n <input type="number" title="" min="-180" max="180" @model="roll">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">y轴</span>\n <input type="number" title="" min="-180" max="180" @model="heading">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">z轴</span>\n <input type="number" title="" min="-180" max="180" @model="pitch">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">大小</span>\n <input type="range" max="10" min="0.1" step="0.1" @model="scale">\n <div class="input-number" style="width: 100px;margin-left: 10px;">\n <input type="number" title="" min="0" max="10" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n \n </div>\n </div>\n </div>\n \n <div class="divide">\n <div class="line"></div>\n <p>BIM属性导出选项</p>\n <div class="line"></div>\n </div>\n <div class="row">\n <div style="display: flex;">\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="3">\n <span>修建中</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="2">\n <span>未完成</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="1">\n <span>已完成</span>\n </div>\n </div>\n <div class="col">\n <button @click="exportProperty">导 出</button>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"featureEdit",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}o=function(t){var e='<div class="row property-item">\n <div class="col">\n <input class="input_lable" name="key" value="'.concat(t.key,'">\n <input class="input" name="value" value="').concat(t.value,'">\n <button class="btn add">+</button>\n <button class="btn delete">-</button>\n </div>\n </div>'),i=document.createElement("div");i.innerHTML=e;var s=i.getElementsByClassName("property-item")[0],a=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],p=s.getElementsByClassName("delete")[0];a.addEventListener("input",(function(e){t.key=e.target.value})),l.addEventListener("input",(function(e){t.value=e.target.value})),c.addEventListener("click",(function(){var t={id:n.randomString(),key:"点击此处可编辑",value:""};r.descriptions.push(t),o(t)})),p.addEventListener("click",(function(e){for(var i=0;i<r.descriptions.length;i++)if(r.descriptions[i].id===t.id){r.descriptions.splice(i,1);break}u.removeChild(s)})),u.appendChild(s)},s=i.getProperty("name"),r={id:i.getProperty("id"),name:s,state:i.getProperty("state")||0,descriptions:i.getProperty("descriptions")||[{id:this.randomString(),key:"点击此处可编辑",value:""}]},t.t0=i.getProperty("state"),t.next="0"===t.t0?10:"1"===t.t0?12:"2"===t.t0?14:"3"===t.t0?16:18;break;case 10:return r.stateCH="",t.abrupt("break",18);case 12:return r.stateCH="已完成",t.abrupt("break",18);case 14:return r.stateCH="未完成",t.abrupt("break",18);case 16:return r.stateCH="修建中",t.abrupt("break",18);case 18:return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 440px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 110px;\n }\n .col:first-child {\n margin-right: 10px;\n }\n .col:last-child {\n margin-left: 10px;\n }\n .YJ-custom-base-dialog>.content .divide {\n position: relative;\n display: flex;\n align-items: center;\n margin: 20px 0;\n }\n .YJ-custom-base-dialog>.content .divide .line{\n height: 1px;\n background: #ddd;\n flex: 1;\n }\n .YJ-custom-base-dialog>.content .divide p{\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .property .property-item .btn{\n font-size: 24px;\n line-height: 20px;\n padding: 2px 0;\n }\n .YJ-custom-base-dialog>.content .property .property-item .input_lable {\n flex: 0 0 115px;\n border: none;\n margin-right: 15px;\n text-align: right;\n }\n .YJ-custom-base-dialog>.content .property .property-item:first-child .delete{\n display: none\n }\n .YJ-custom-base-dialog>.content .property .property-item .add{\n display: none;\n }\n .YJ-custom-base-dialog>.content .property .property-item:last-child .add{\n display: inline-block;\n }\n",t.next=24,new W(this.sdk.viewer._container,{title:this.oldData.name+"-----设置状态",left:"calc(50% - 200px)",top:"calc(50% - 200px)",closeCallBack:function(){m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}});case 24:return this._DialogObject=t.sent,t.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(l=document.createElement("div")).innerHTML='\n <div class="row">\n <div class="col">\n <span class="label">构件名称</span>\n <input class="input" name="name" disabled="disabled">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">选择状态</span>\n <select class="input input-select" name="state-select">\n <option value="0" style="color: #000;">重置</option>\n <option value="1" style="color: #f00;">已完成</option>\n <option value="2" style="color: #0f0;">未完成</option>\n <option value="3" style="color: #00f;">修建中</option>\n </select>\n </div>\n </div>\n <div class="divide">\n <div class="line"></div>\n <p>自定义属性</p>\n <div class="line"></div>\n </div>\n <div class="property">\n </div>\n ',l.querySelector("input[name='name']").value=s,(c=l.querySelector("select[name='state-select']")).value=r.state,c.addEventListener("change",(function(t){switch(r.state=t.target.value,r.state){case"0":r.stateCH="";break;case"1":r.stateCH="已完成";break;case"2":r.stateCH="未完成";break;case"3":r.stateCH="修建中"}})),u=l.getElementsByClassName("property")[0],p=0;p<r.descriptions.length;p++)o(r.descriptions[p],p);h=this._DialogObject._element.foot.getElementsByClassName("translational")[0],this._DialogObject.contentAppChild(l),(d=document.createElement("button")).className="confirm",d.innerHTML="确认",this._DialogObject.footAppChild(d,h),d.addEventListener("click",(function(){for(var t=!1,e=0;e<m.features.length;e++)if(m.features[e].id==r.id){m.features[e]=r,t=!0;break}t||m.features.push(r),i.setProperty("state",r.state),i.setProperty("descriptions",r.descriptions);var n="#fff";switch(r.state){case"0":n="#fff";break;case"1":n="#f00";break;case"2":n="#0f0";break;case"3":n="#00f"}i.color=Cesium.Color.fromCssColorString(n),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(Rl(Rl({},m.newData),{},{features:m.features}))})),t.next=48;break;case 46:this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 48:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale)}},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(Gl(Wl,this)),Vl(Wl,this,setTimeout((function(){clearTimeout(Gl(Wl,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=jl(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(e)),i[n].customColor=Cesium.Color.fromCssColorString(e);this.features.get(t).customColor=Cesium.Color.fromCssColorString(e)}}},{key:"getFeatureColor",value:function(t){if(this.features.has(t)){if(this.features.get(t).customColor)return this.features.get(t).customColor;var e=this.features.get(t).features;for(var i in e)if(e[i].content._model)return e[i].customColor||e[i].color}}},{key:"featureShow",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].show=e),i[n].customShow=e;this.features.get(t).customShow=e}}},{key:"featureFlyto",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.features.has(e)?(i=this.features.get(e).sphere,n=new Cesium.Cartesian3(i[0],i[1],i[2]),o=this.entity._root.originalTransform,o=Cesium.Matrix4.inverse(o,new Cesium.Matrix4),s=this.entity._root.transform,r=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),l=Cesium.Matrix4.multiplyByPoint(r,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(l,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),ei(0),Ye(this.sdk),Je(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(t,i){if(i===e){var n=p.getFeatureColor(e);if(p.features.has(e)&&n){var o=p.features.get(e).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;p.features.get(e).customAlpha=1}}else{var a=p.getFeatureColor(i);if(p.features.has(i)&&a){var r=p.features.get(i).features;for(var l in r)r[l].content._model&&(r[l].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(.2*a.alpha,")"))),r[l].customAlpha=.2*a.alpha;p.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(t,e){var i=p.features.get(e).features,n=p.getFeatureColor(e);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;p.features.get(e).customAlpha=.2*n.alpha}}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"exportProperty",value:function(t){if(0!==this.exportStateArray.length){for(var e,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',o=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},s="",a="",r="",l=0;l<this.features.length;l++)for(var c=0;c<t.length;c++)if(this.features[l].state==t[c]){for(var u in 0==l&&(r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>'),r+="<Row>",i){if(Array.isArray(this.features[l][i[u]])){var p="";for(var h in this.features[l][i[u]])p+="".concat(this.features[l][i[u]][h].key+":"+this.features[l][i[u]][h].value," ");s={nameType:"String",data:p}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',s)}r+="</Row>",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",e=o('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=e,window.btoa(unescape(encodeURIComponent(d)))),m.download=this.oldData.name+"--构件属性.xls",m.target="_blank",document.body.appendChild(m),m.click(),document.body.removeChild(m)}else window.ELEMENT&&window.ELEMENT.Message({message:"未选择属性导出选项!",type:"warning",duration:1500})}},{key:"exportState",value:function(t){var e=t.target.getElementsByTagName("input")[0];if(e.checked=!e.checked,e.checked)this.exportStateArray.push(e.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i<this.exportStateArray.length;i++)if(this.exportStateArray[i]==e.value){this.exportStateArray.splice(i,1);break}}}]);var i,n,s,r}(xl);function Jl(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最大比例</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最小像素</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-99999" max="9999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">固定大小</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <p class="lable-left-line">旋转</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n \n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box">\n <input type="checkbox">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" step="1">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <p class="lable-left-line">高度</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n \n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function ql(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ql(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ql(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Zl=function(){return x()((function t(e,i){k()(this,t),this.sdk=e,this.model=i,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.originalMatrix=Xl({},i.modelMatrix),this.model.rotate||(this.model.rotate={x:0,y:0,z:0}),this.initParam(),this.MapEvent=new X(this.sdk)}),[{key:"initParam",value:function(){var t=Cesium.Cartographic.fromCartesian(this.model.position),e=Cesium.Math.toDegrees(t.longitude),i=Cesium.Math.toDegrees(t.latitude),n=t.height;return this._params={tx:e,ty:i,tz:n,rx:this.model.rotate.x,ry:this.model.rotate.y,rz:this.model.rotate.z},Xl({lng:e,lat:i,alt:n,h:n},this.model.rotate)}},{key:"editTranslational",value:function(){var t=this;this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk);var e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.h,a=this.sdk.viewer;this.origin=Cesium.Cartesian3.fromDegrees(n,o,s);var r=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3);this.rayX=new Cesium.Ray(this.origin,r),this.rayY=new Cesium.Ray(this.origin,l),this.rayZ=new Cesium.Ray(this.origin,c),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0);var u=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),p=a.camera.position,h=Cesium.Cartesian3.distance(p,this.origin)/15;Cesium.Matrix4.multiplyByScale(u,new Cesium.Cartesian3(h,h,h),u);var d=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],u,Cesium.Color.RED),m=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],u,Cesium.Color.LIME),f=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],u,Cesium.Color.BLUE);a.scene.primitives.add(d),a.scene.primitives.add(m),a.scene.primitives.add(f),this.againArrow(),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againArrow,this);var v,g={x:0,y:0},y=0;this.MapEvent.mouse_move((function(t,i){!function t(i){if(e.activeAxis){var n=i.startPosition.y-i.endPosition.y,o={x:i.endPosition.x-g.x,y:i.endPosition.y-g.y},s=a.camera.getPickRay(o),r=a.scene.globe.pick(s,a.scene),l=new Cesium.Cartesian3,c=Cesium.Transforms.eastNorthUpToFixedFrame(a.camera.position);Cesium.Matrix4.inverse(c,c),Cesium.Matrix4.multiplyByPoint(c,r,l),Cesium.Cartesian3.normalize(l,l);var u=e.initParam(),p=90+Cesium.Math.toDegrees(Math.asin(l.z)),h=Cesium.Cartographic.fromCartesian(a.camera.position).height,d=e.activeModelParam.alt,m=h/Math.cos(Cesium.Math.toRadians(p));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(r),Cesium.Cartographic.fromCartesian(a.camera.position));r=Cesium.Ray.getPoint(s,m*(1-d/h));var f=Cesium.Cartographic.fromCartesian(r),b=Cesium.Math.toDegrees(f.longitude),C=Cesium.Math.toDegrees(f.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=b,e._params.ty=e.activeModelParam.lat,e._params.tz=d,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var w=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),_=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,w),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,_);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=C,e._params.tz=d,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,x),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(a.camera.position,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt))/4300*n*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-y<100)return clearTimeout(v),void(v=setTimeout((function(){t(i)}),100));clearTimeout(v),y=O;for(var T=e.coordArrows,N=0;N<T.length;N++)if(T[N].getGeometryInstanceAttributes)switch(T[N]._name){case"model_edit_xAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=a.scene.drillPick(i.endPosition,10),L=B.length-1;L>=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}}(t)})),this.MapEvent.mouse_left_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(t.origin);g.x=i.position.x-Math.floor(n.x),g.y=i.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(i.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.initParam(),void(r.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<e.coordArrows.length;i++)switch(e.coordArrows[i]._name){case"model_edit_xAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}e.activeAxis&&(e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack)}))}},{key:"againArrow",value:function(){if(this.activeState&&"translational"==this.activeState&&this.origin){this.initParam(),this.origin=new Cesium.Cartesian3.fromDegrees(this._params.tx,this._params.ty,this._params.tz);for(var t=this.sdk.viewer.camera.position,e=Cesium.Cartesian3.distance(t,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordArrows,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(e,e,e),n[o].modelMatrix)}}}},{key:"againCircle",value:function(){if(this.activeState&&"rtation"==this.activeState&&this.origin){this.initParam();for(var t=this.sdk.viewer.camera.position,e=Cesium.Cartesian3.distance(t,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordCircles,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var s=e/20;Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(s,s,s),n[o].modelMatrix),n[o]._radius=e}}}},{key:"editRtation",value:function(){this.destroy(),this.activeState="rtation",this.MapEvent=new X(this.sdk);var t=this.initParam();this.origin=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.h),this.createCircle(t.lng,t.lat,t.h,20),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againCircle,this)}},{key:"createCircle",value:function(t,e,i,n){for(var o=this,s=this.sdk.viewer,a=[],r=0;r<=360;r+=3){var l=Math.sin(Cesium.Math.toRadians(r)),c=n*Math.cos(Cesium.Math.toRadians(r)),u=n*l;a.push(new Cesium.Cartesian3(c,u,0))}var p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=s.camera.position,d=Cesium.Cartesian3.distance(h,this.origin)/15,m=d/n;Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p);var f=this.createAxisSphere("model_edit_zCircle",a,p,Cesium.Color.RED,d);s.scene.primitives.add(f);var v=this.createAxisSphere("model_edit_yCircle",a,p,Cesium.Color.BLUE,d);s.scene.primitives.add(v);var g=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),y=Cesium.Matrix4.fromRotationTranslation(g);Cesium.Matrix4.multiply(v.geometryInstances.modelMatrix,y,v.geometryInstances.modelMatrix);var b=this.createAxisSphere("model_edit_xCircle",a,p,Cesium.Color.LIME,d);s.scene.primitives.add(b);var C=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),w=Cesium.Matrix4.fromRotationTranslation(C);Cesium.Matrix4.multiply(b.geometryInstances.modelMatrix,w,b.geometryInstances.modelMatrix);var k,_=0;this.MapEvent.mouse_move((function(t){!function t(e){var i=Xl({},e.endPosition);if(o.activeCircle){var n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,o.ciclkPosition),a=0,r=0,l=0;if(!n)return;var c=e.startPosition.y-i.y,u=e.startPosition.x-i.x;switch(o.activeCircle._name){case"model_edit_xCircle":r=1*u;break;case"model_edit_yCircle":a=1*c;break;case"model_edit_zCircle":l=1*u}o._params.rx-=a,o._params.rx>360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=r,o._params.ry>360&&(o._params.ry=1),o._params.ry<0&&(o._params.ry=360);Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o._params.ry));o._params.rz-=l,o._params.rz>360&&(o._params.rz=1),o._params.rz<0&&(o._params.rz=360),o.updateModel(o._params.tx,o._params.ty,o._params.tz,o._params.rx,o._params.ry,o._params.rz)}else{var p=Date.now();if(p-_<100)return clearTimeout(k),void(k=setTimeout((function(){t(e)}),100));clearTimeout(k),_=p;for(var h=o.coordCircles,d=0;d<h.length;d++)if(h[d].getGeometryInstanceAttributes){var m=h[d].getGeometryInstanceAttributes(h[d]._name);switch(h[d]._name){case"model_edit_zCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var f=s.scene.drillPick(e.endPosition,10),v=0;v<f.length;v++){var g=f[v];if(g&&g.primitive&&g.id&&g.primitive.getGeometryInstanceAttributes){var y=g.primitive.getGeometryInstanceAttributes(g.id);switch(g.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(y.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}}(t)})),this.MapEvent.mouse_left_down((function(t){var e=s.scene.pickPosition(t.position);o.ciclkPosition=e;for(var i=s.scene.drillPick(t.position,10),n=0;n<i.length;n++){var a=i[n];if(a&&a.primitive&&a.id)switch(a.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return a.primitive.getGeometryInstanceAttributes(a.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,o.activeCircle=a.primitive,o.activeModelParam=o.initParam(),void(s.scene.screenSpaceCameraController.enableRotate=!1)}}o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(t){o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0;for(var e=o.coordCircles,i=0;i<e.length;i++)if(e[i].getGeometryInstanceAttributes){var n=e[i].getGeometryInstanceAttributes(e[i]._name);switch(e[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}))}},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.model.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.model.rotate={x:n,y:o,z:s};var a=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),r=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),l=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),c=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),u=Cesium.Matrix4.fromRotationTranslation(a),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,p,d),Cesium.Matrix4.multiply(d,h,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(t){this._transformCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t<this.coordArrows.length;t++)this.sdk.viewer.scene.primitives.remove(this.coordArrows[t]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var t=0;t<this.coordCircles.length;t++)this.sdk.viewer.scene.primitives.remove(this.coordCircles[t]);this.coordCircles=[]}},{key:"update",value:function(){this.againArrow(),this.againCircle()}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.sdk.viewer.camera.changed.removeEventListener(this.againArrow),this.sdk.viewer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"getModel",value:function(){return this.model}},{key:"setModel",value:function(t){this.model=model}}])}();function Kl(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var $l=function(t){function e(t,i){return k()(this,e),Kl(this,e,[t,i])}return qi()(e,t),x()(e,[{key:"add",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=2;break}return t.abrupt("return",this.loadModel(this.options.url));case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}}]);var i}($r);function Ql(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return tc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function tc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ec(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ic(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ec(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ec(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function nc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function oc(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function sc(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ac(t,e,i){return t.set(lc(t,e),i),i}function rc(t,e){return t.get(lc(t,e))}function lc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var cc=new WeakMap,uc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),sc(i=nc(this,e,[t,n,o={}]),cc,null),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(i.options.earth&&delete i.options.earth,i.picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff","number"==typeof n.scale?(i.options.scale={},i.options.scale.x=n.scale,i.options.scale.y=n.scale,i.options.scale.z=n.scale):(i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.scale.z=i.options.scale.z||0===i.options.scale.z?i.options.scale.z:1),i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.position=n.position=n.position||{},i.options.position={lng:n.position.lng,lat:n.position.lat,alt:n.position.alt},i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.entity={id:i.options.id},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i.Dialog=o,i._EventBinding=new pn,i.on(),i):(console.warn("lat is required!"),Ui()(i)):(console.warn("lng is required!"),Ui()(i)):(console.warn("position is required!"),Ui()(i))}return qi()(e,t),x()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(l=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(be(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=3;break}return t.abrupt("return");case 3:if(e=this.replaceHost(e,this.options.host),this.originalOptions=this.deepCopyObj(this.options),i={id:this.options.id,url:e,show:this.options.show,maximumScale:this.options.scaleByDistance?void 0:this.options.maximumScale,minimumPixelSize:this.options.scaleByDistance?void 0:this.options.minimumPixelSize},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=13;break}return t.next=10,Cesium.Model.fromGltfAsync(i);case 10:this.entity=t.sent,t.next=16;break;case 13:return t.next=15,Cesium.Model.fromGltf(i);case 15:this.entity=t.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),t.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:n=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),this.entity.position=o,this.entity.rotate=ic({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Zl(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new zn(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far},s.entity)),s.entity.isMove=!0,clearTimeout(rc(cc,s)),ac(cc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500))})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(t){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Zl(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new zn(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far,ground:!1},s.entity)),s.entity.isMove=!0,clearTimeout(rc(cc,s)),ac(cc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500)),s.activeAnimate=s.options.activeAnimate,s.modelAnimations=s.entity.loader.components.animations})),re(this.sdk,this.options.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"getModelAnimations",value:(r=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){Number(Cesium.VERSION.split(".")[1])>=107?e.entity.readyEvent.addEventListener((function(){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)})):e.entity.readyPromise.then((function(i){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)}))})));case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:function(){oc(e,"remove",this,3)([]),this.label&&this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=ic({},this.options.position):this.options.positions?r=ic({},this.options.positions[0]):this.options.center?r=ic({},this.options.center):this.options.start?r=ic({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(l=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.entity.originalBoundingSphereRadius*this.options.scale.z*2),this.sdk.viewer.camera.flyToBoundingSphere(l)):this.entity.readyPromise.then((function(){var t=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(c.options.position.lng,c.options.position.lat,c.options.position.alt),(c.entity.originalBoundingSphereRadius||c.entity.boundingSphere.radius)*c.options.scale.z*2);c.sdk.viewer.camera.flyToBoundingSphere(t)}));case 23:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){oc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position={lng:t,lat:this.options.position.lat,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position={lng:this.options.position.lng,lat:t,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:t},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[Number(this.options.position.lng),Number(this.options.position.lat),Number(this.options.position.alt)]),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label&&(this.label.show=t):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label&&(this.label.lineWidth=t),this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label&&(this.label.pixelOffset=t),this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label&&(this.label.lineColor=t),this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label&&(this.label.backgroundColor=[t,this.label.backgroundColor[1]]),this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label&&(this.label.backgroundColor=[this.label.backgroundColor[0],t]),this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Ql(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Ql(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Ql(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Ql(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(t){t?this.editObj&&this.editObj.editRtation():this.editObj&&this.editObj.destroy()}},{key:"positionEditing",get:function(){return!(!this.editObj||"translational"!==this.editObj.getActiveState())},set:function(t){this.sdk&&this.sdk.viewer&&this.entity&&(t?(this.leftClickState=vt(),this.editObj&&this.editObj.editTranslational(),new ht(this.sdk)):(this.leftClickState&&!vt()&&new pt(this.sdk),this.editObj&&this.editObj.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.lng=e.tx,t.lat=e.ty,t.alt=e.tz,t.rotateX=e.rx,t.rotateY=e.ry,t.rotateZ=e.rz,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.editObj._params)}},set:function(t){this._rotationEditingCallBack=t}},{key:"activeAnimate",get:function(){return this.options.activeAnimate},set:function(t){if(this.options.activeAnimate=t,this.entity&&this.entity.loader.components&&this.modelAnimations&&(this.entity.activeAnimations.removeAll(),this.modelAnimations&&this.modelAnimations.length>0))for(var e=0;e<this.modelAnimations.length;e++)if(this.modelAnimations[e].name===t){this.entity.activeAnimations.add({index:e,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}}},{key:"resetAnimate",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.activeAnimate=void 0,this.sdk.viewer.scene.primitives.remove(this.entity),this.on();case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f=this,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),t.next=9,new Zi(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(t){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close();var e=f.deepCopyObj(f.options);e.host="",f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(e),be(f.sdk,f.options.id),re(f.sdk,f.options.id)},resetCallBack:function(){f.reset(),f.Dialog.resetCallBack&&f.Dialog.resetCallBack()},removeCallBack:function(){f.Dialog.removeCallBack&&f.Dialog.removeCallBack()},closeCallBack:function(){f.reset(),f.positionEditing=!1,f.editObj&&f.editObj.destroy(),f.Dialog.closeCallBack&&f.Dialog.closeCallBack()},showCallBack:function(t){f.show=t,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=Jl(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new hn("model-edit-tabs",void 0,this.sdk),o=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),s=this._DialogObject._element.content.getElementsByClassName("equal")[0],r=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(t){(i=t.target.checked)?(s.style.display="flex",r.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",r.style.display="flex")})),(l=s.getElementsByTagName("input"))[0].value=this.scaleX,l[1].value=this.scaleX,l[0].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),l[1].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),i?(s.style.display="flex",r.style.display="none"):(s.style.display="none",r.style.display="flex"),c=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){f.color=t},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelColor=t},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelLineColor=t},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorStart=t},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorEnd=t},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=n.getElementsByTagName("*"),this._EventBinding.on(this,m),this._elms=this._EventBinding.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[p],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(l[0],l[1]),setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.attributeVr=f.options.attribute.vr.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect();var t=f.attributeSelect,e=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===f.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){f.attributeType=t[e].key;break}}))}var s=Nn(),a=Y(f._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(a){a.legp_search(s);var r=f._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];r.value=s[f.labelFontFamily].value;for(var l=0;l<s.length;l++)if(s[l].value==r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var t=0;t<s.length;t++)if(s[t].value===r.value){f.labelFontFamily=s[t].key;break}})),f._elms.labelFontFamily=[r]}}),0),t.next=46;break;case 46:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.position.lng=t.position.lng,this.options.position.lat=t.position.lat,this.options.position.alt=t.position.alt,this.options.rotate.z=-t.heading,this.options.rotate.x=-t.pitch,this.options.rotate.y=-t.roll,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt])}},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(parseFloat(i).toFixed(2)),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),r.x=parseFloat(r.x),r.y=parseFloat(r.y),r.z=parseFloat(r.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.entity.rotate={x:o,y:s,z:a},this.entity.customScale=r;var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,this.entity.modelMatrix);var v=r.x,g=r.y,y=r.z;0===v&&(v=1e-5),0===g&&(g=1e-5),0===y&&(y=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(v,g,y),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update(),this.entity.isMove=!0,clearTimeout(rc(cc,this)),ac(cc,this,setTimeout((function(){n.entity&&(n.entity.isMove=!1)}),500))}},{key:"reset",value:function(){if(this.entity)try{this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scaleX=this.originalOptions.scale.x,this.scaleY=this.originalOptions.scale.y,this.scaleZ=this.originalOptions.scale.z,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect()}catch(t){}}}]);var i,n,s,r,l}($l);function pc(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">最大比例</span>\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">最小像素</span>\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n </div>\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">x轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="width: 332px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">缩放</span>\n <input style="width: 332px;" type="range" max="999" min="0" step="1" @model="scale">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="999" step="1" @model="scale">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function hc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return dc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?dc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function mc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?mc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function vc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function gc(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var yc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=vc(this,e,[t,n,o={}])).picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff",i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.positions=n.positions||[],i.options.type=n.type||0,i.options.interval=n.interval||0===n.interval?n.interval:1,i.options.quantity=n.quantity,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,i.options.label=n.label=n.label||{},i.options.label.show=!(!n.label.show&&!1!==n.label.show)&&n.label.show,i.options.label.fontSize=n.label.fontSize||20,i.options.label.color=n.label.color||"#ffffff",i.options.label.near=n.label.near||0===n.label.near?n.label.near:2e3,i.options.label.far=n.label.far||0===n.label.far?n.label.far:1e5,i.options.label.scaleByDistance=n.label.scaleByDistance||!1,i.options.label.backgroundColor=n.label.backgroundColor||["#42c6ef","#42c6ef"],i.options.line=n.line=n.line||{},i.options.line.width=n.line.width||2,i.options.line.length=n.line.length||20,i.options.line.color=n.line.color||"#fff000",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||[],i.options.attributeType=n.attributeType||"richText",i.ModelPositions=[],i._elms={},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i._element_style=null,i.ControllerObject=new _o(i.sdk),i.ControllerObject.controllerCallBack=function(t){i.lng=t.position.lng,i.lat=t.position.lat,i.alt=t.position.alt},i.Dialog=o,i._EventBinding=new pn,i.on(),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(v=function(t){return new Worker("data:,(".concat(t.toString(),")(").concat(JSON.stringify(m),")"))},f=function(t){var e=t.type,i=t.interval,n=t.positions,o=t.optionsPositions,s=t.quantity,a=t.turfUrl;importScripts(a);var r=[];switch(e){case 1:var l=turf.lineString(n[0]),c=turf.lineChunk(l,i/1e3,{units:"kilometers"});r.push({lng:c.features[0].geometry.coordinates[0][0],lat:c.features[0].geometry.coordinates[0][1]});for(var p=0;p<c.features.length;p++)r.push({lng:c.features[p].geometry.coordinates[1][0],lat:c.features[p].geometry.coordinates[1][1]});break;case 2:var h=turf.polygon(n),d=turf.bbox(h);u=turf.pointGrid(d,i/1e3,{units:"kilometers"});for(var m=turf.pointsWithinPolygon(u,h),f=0;f<m.features.length;f++)r.push({lng:m.features[f].geometry.coordinates[0],lat:m.features[f].geometry.coordinates[1]});break;case 3:if(s)for(var v=o[0].lng,g=o[0].lat,y=o[2].lng,b=o[2].lat,C=turf.point([v,b]),w=turf.point([y,b]),k=turf.distance(C,w,{units:"kilometers"})/s.x,_=turf.point([v,b]),x=turf.point([v,g]),E=turf.distance(_,x,{units:"kilometers"})/s.y,S=turf.lineString([[v,b],[y,b]]),D=turf.lineChunk(S,k,{units:"kilometers"}),P=turf.lineString([[v,b],[v,g]]),M=turf.lineChunk(P,E,{units:"kilometers"}),O=0;O<D.features.length;O++)for(var T=D.features[O].geometry.coordinates,N=0;N<M.features.length;N++){var B=M.features[N].geometry.coordinates;r.push({lng:(T[0][0]+T[1][0])/2,lat:(B[0][1]+B[1][1])/2})}else{u=turf.pointGrid([o[0].lng,o[0].lat,o[2].lng,o[2].lat],i/1e3,{units:"kilometers"});for(var A=0;A<u.features.length;A++)r.push({lng:u.features[A].geometry.coordinates[0],lat:u.features[A].geometry.coordinates[1]})}break;default:r=L()(o)}self.postMessage(r)},e.startsWith("http")||e.includes(":")||this.options.host&&(i=new URL(e,this.options.host),e=i.href),this.originalOptions=this.deepCopyObj(this.options),new Cesium.PrimitiveCollection,n=[[]],o=this.options.positions[0].alt,s=0;s<this.options.positions.length;s++)n[0].push([this.options.positions[s].lng,this.options.positions[s].lat]),this.options.positions[s].alt>this.options.height&&(o=this.options.positions[s].alt);n[0].length>2?(n[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),r=turf.polygon(n),l=turf.pointOnFeature(r),this.center={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]}):2==n[0].length?this.center={lng:(this.options.positions[0].lng+this.options.positions[1].lng)/2,lat:(this.options.positions[0].lat+this.options.positions[1].lat)/2}:this.center={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat},c=[],this.options.height||0===this.options.height||(this.options.height=o),p=document.scripts,h="",d=0;case 14:if(!(d<p.length)){t.next=21;break}if(!p[d].src||!p[d].src.includes("turf.min.js")){t.next=18;break}return h=p[d].src&&p[d].src,t.abrupt("break",21);case 18:d++,t.next=14;break;case 21:m={type:this.options.type,interval:this.options.interval,positions:n,optionsPositions:this.options.positions,quantity:this.options.quantity,turfUrl:h},v(f).onmessage=function(t){g.ModelPositions=c=t.data;for(var i=[],n=0;n<c.length;n++){var o=Cesium.Cartesian3.fromDegrees(c[n].lng,c[n].lat,g.options.height),s=Cesium.Transforms.headingPitchRollToFixedFrame(o,new Cesium.HeadingPitchRoll(0,0,0));Cesium.Matrix4.multiplyByUniformScale(s,1,s),i.push({modelMatrix:s})}g.label=new zn(g.sdk,{show:!!g.options.show&&g.options.label.show,position:[g.center.lng,g.center.lat,g.options.height],text:g.options.name,fontSize:g.options.label.fontSize,color:g.options.label.color,pixelOffset:g.options.line.length,backgroundColor:g.options.label.backgroundColor,lineColor:g.options.line.color,lineWidth:g.options.line.width,scaleByDistance:g.options.label.scaleByDistance,near:g.options.label.near,far:g.options.label.far}),g.entity=new Cesium2.ModelInstanceCollection({url:e,instances:i}),g.entity.position=new Cesium.Cartesian3.fromDegrees(g.center.lng,g.center.lat,g.options.height),g.entity.rotate={x:g.options.rotate.x,y:g.options.rotate.y,z:g.options.rotate.z},g.updateModel(g.center.lng,g.center.lat,g.options.height,g.options.rotate.x,g.options.rotate.y,g.options.rotate.z,g.options.scale),g.sdk.viewer.scene.primitives.add(g.entity)};case 24:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){gc(e,"remove",this,3)([]),this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=fc({},this.options.position):this.options.positions?r=fc({},this.options.positions[0]):this.options.center?r=fc({},this.options.center):this.options.start?r=fc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height+500)});case 23:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){gc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.center.lng},set:function(t){this.center.lng=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.center.lat},set:function(t){this.center.lat=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.height},set:function(t){this.center.alt=t,this.options.height=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[Number(this.center.lng),Number(this.center.lat),Number(this.options.height)],this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"_ControllerChangePosition",value:function(t){var e=this;clearTimeout(e._ControllerChangePositionEvent),e._ControllerChangePositionEvent=setTimeout((function(){e.ControllerObject.position={lng:e.center.lng,lat:e.center.lat,alt:e.options.height}}),t)}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:t,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.label.lineWidth=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"lineLength",get:function(){return this.options.line.length},set:function(t){this.options.line.length=t,this.label.pixelOffset=t,this._elms.lineLength&&this._elms.lineLength.forEach((function(e){e.value=t}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.label.lineColor=t,this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.labelBackgroundColorEnd],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.labelBackgroundColorStart,t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=hc(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=hc(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera},set:function(t){this.options.attribute.camera=t}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(t){t?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&(t?(this.leftClickState=vt(),this.ControllerObject.position={lng:this.center.lng,lat:this.center.lat,alt:this.options.height},this.ControllerObject.editTranslational(),new ht(this.sdk)):(this.leftClickState&&!vt()&&new pt(this.sdk),this.ControllerObject.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.lng=e.tx,t.lat=e.ty,t.alt=e.tz,t.rotateX=e.rx,t.rotateY=e.ry,t.rotateZ=e.rz,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.ControllerObject._params)}},set:function(t){this._rotationEditingCallBack=t}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 600px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:first-child {\n margin-left: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:last-child {\n margin-right: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .label {\n flex: 0 0 74px;\n }\n .YJ-custom-base-dialog>.content .DIV-cy-tab-content-pane .input-select {\n width: 100px;\n }\n",t.next=12,new Zi(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.options.name||"未命名对象",u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.ControllerObject&&u.ControllerObject.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=pc(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new hn("model-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){u.color=t},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelColor=t},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.lineColor=t},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorStart=t},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorEnd=t},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.lineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var t=u.attributeSelect,e=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===u.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){u.attributeType=t[e].key;break}}))}}),0),t.next=36;break;case 36:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),this.entity.rotate={x:n,y:o,z:s};var r=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),l=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),u=new Cesium.Cartesian3.fromDegrees(t,e,i);Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z)),Cesium.Matrix4.fromRotationTranslation(r),Cesium.Matrix4.fromRotationTranslation(l),Cesium.Matrix4.fromRotationTranslation(c),new Cesium.Matrix4;Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z),this.entity.modelMatrix),this.ControllerObject.update(),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i)}},{key:"updateModelRotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),this.sdk.viewer.scene.primitives.remove(this.entity);var o=this.options.url;if(!o.startsWith("http")&&!o.includes(":")&&this.options.host){var s=new URL(o,this.options.host);o=s.href}for(var a=[],r=0;r<this.ModelPositions.length;r++){var l=n,c=Cesium.Cartesian3.fromDegrees(this.ModelPositions[r].lng,this.ModelPositions[r].lat,this.options.height),u=Cesium.Transforms.headingPitchRollToFixedFrame(c,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(i),Cesium.Math.toRadians(e),Cesium.Math.toRadians(t)));Cesium.Matrix4.multiplyByUniformScale(u,l,u),a.push({modelMatrix:u})}this.entity=new Cesium.ModelInstanceCollection({url:o,instances:a}),this.entity.position=new Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height),this.entity.rotate={x:this.options.rotate.x,y:this.options.rotate.y,z:this.options.rotate.z},this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.sdk.viewer.scene.primitives.add(this.entity)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scale=this.originalOptions.scale,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera,this.cameraSelect&&this.cameraSelect())}}]);var i,n,s}($l);function bc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Cc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?bc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):bc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function wc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var kc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=wc(this,e,[t,n])).object={},i.options.host=i.options.host||h(),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.add()}},{key:"add",value:(n=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestResource();case 2:return e=t.sent,t.next=5,e.text();case 5:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=11;break}return t.abrupt("return",this.loadLayer(i.data));case 11:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"loadLayer",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.object=Cc({},e),i="",this.object.url.startsWith("http")?i=this.object.url:this.options.host?(n=new URL(this.object.url,this.options.host),i=n.href):i=this.object.url,o={url:i,mimmumLevel:this.object.minimumLevel,maximumLevel:this.object.maximumLevel,rectangle:new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north))},t.t0=this.object.scheme_name,t.next="amapMercatorTilingScheme"===t.t0?7:""===t.t0?9:10;break;case 7:return o.tilingScheme=this.amapMercatorTilingScheme(),t.abrupt("break",12);case 9:return t.abrupt("break",12);case 10:return o.tilingScheme=new Cesium[this.object.scheme_name],t.abrupt("break",12);case 12:t.t1=this.object.load_method,t.next="tms"===t.t1?15:"xyz"===t.t1?24:"wmts"===t.t1?26:28;break;case 15:if(this.object.url.endsWith("tilemapresource.xml")&&((r=this.object.url.split("/")).pop(),l=r.join("/"),o.url=l),!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=22;break}return t.next=19,Cesium.TileMapServiceImageryProvider.fromUrl(o.url,o);case 19:s=t.sent,t.next=23;break;case 22:s=new Cesium.TileMapServiceImageryProvider(o);case 23:return t.abrupt("break",30);case 24:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 26:return s=new Cesium.WebMapTileServiceImageryProvider(o),t.abrupt("break",30);case 28:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 30:if(this.sdk&&this.sdk.viewer){t.next=32;break}return t.abrupt("return");case 32:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s),this.entity._id=this.options.id,c=0;c<this.sdk.viewer.imageryLayers._layers.length;c++)this.sdk.viewer.imageryLayers._layers[c]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type)&&(u=this.sdk.viewer.imageryLayers._layers[c],this.sdk.viewer.imageryLayers.raiseToTop(u));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qt(0,this.options.id);case 39:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}]);var i,n}(nl);function _c(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var xc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=_c(this,e,[t,n])).loadLayer(),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(t){var e,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};e=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)if(this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)){var o=this.sdk.viewer.imageryLayers._layers[n];this.sdk.viewer.imageryLayers.raiseToTop(o)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Qt(0,this.options.id)}}])}(nl);function Ec(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Sc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ec(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ec(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Dc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Pc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Pc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Mc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Oc(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Tc(t,e,i){return t.set(Bc(t,e),i),i}function Nc(t,e){return t.get(Bc(t,e))}function Bc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Lc=new WeakMap,Ac=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return k()(this,e),Oc(i=Mc(this,e,[t,n]),Lc,void 0),i.object=JSON.parse(JSON.stringify(o)),i.object.west||(i.object.west=40),i.object.south||(i.object.south=30),i.object.east||(i.object.east=160),i.object.north||(i.object.north=50),i.show=i.options.show,i._elms={},i.Dialog=s,i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(t){t?this.open():this.close()}},{key:"open",value:(r=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTerrain(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){var t=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({});for(var e=0;e<YJ.Analysis.AnalysesResults.length;e++)"ContourAnalysis"===YJ.Analysis.AnalysesResults[e].type&&YJ.Analysis.AnalysesResults[e].destroy();re(this.sdk,this.options.id),clearTimeout(Nc(Lc,this)),Tc(Lc,this,setTimeout((function(){clearTimeout(Nc(Lc,t));var e,i=Dc(t.sdk.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"BillboardObject"!==o.type||1!=o.heightMode&&3!=o.heightMode?o.label&&(o.label.show=o.label.show):o.updateHeight()}}catch(t){i.e(t)}finally{i.f()}}),500))}},{key:"loadTerrain",value:(s=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Sc({},e),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=9;break}return t.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=t.sent,t.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){t.next=12;break}return t.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(Nc(Lc,this)),Tc(Lc,this,setTimeout((function(){clearTimeout(Nc(Lc,s)),s.terrainProvider.readyPromise.then((function(){var t,e=Dc(s.sdk.entityMap);try{for(e.s();!(t=e.n()).done;){var i=y()(t.value,2),n=(i[0],i[1]);"BillboardObject"!==n.type||1!=n.heightMode&&3!=n.heightMode?n.label&&(n.label.show=n.label.show):n.updateHeight()}}catch(t){e.e(t)}finally{e.f()}}))}),1e3)),re(this.sdk,this.options.id);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Sc({},this.options.position):this.options.positions?l=Sc({},this.options.positions[0]):this.options.center?l=Sc({},this.options.center):this.options.start?l=Sc({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e}),t.next=27;break;case 25:c=new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north)),this.sdk.viewer.camera.flyTo({destination:c,duration:e});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Us()(Yi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new Zi(this.sdk,this.options,{title:"地形属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close();var e=o.deepCopyObj(o.options);e.host="",o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(e)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n </div>\n ',e.innerHTML=i,(n=e.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n];case 15:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r}($r);function jc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ic(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ic(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ic(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Fc=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=jc(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Fc,"event",{});var Rc=new Fc;function zc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Hc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?zc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):zc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Vc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Gc(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Uc=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Vc(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#ff0000",n.options.endColor=i.endColor||"#fff000",n.options.startScale=i.startScale||.5,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||1,n.options.maximumParticleLife=i.maximumParticleLife||2,n.options.minimumSpeed=i.minimumSpeed||1,n.options.maximumSpeed=i.maximumSpeed||30,n.options.emissionRate=i.emissionRate||60,n.options.particleSize=i.particleSize||10,n.options.show=!1!==i.show,n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n._elms={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(30)),modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},be(this.sdk,this.options.id),this.options.show&&Qt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Hc({},this.options.position):this.options.positions?l=Hc({},this.options.positions[0]):this.options.center?l=Hc({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"火焰属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),be(r.sdk,r.options.id),re(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Rc.on(this,s),this._elms=Rc.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,function(t){Ee.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Gc(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Hc({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Hc({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Hc({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Mn);function Wc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Yc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Yc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Jc=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=Wc(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Jc,"event",{});var qc=new Jc;function Xc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Zc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Kc(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function $c(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Qc=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Kc(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#00000000",n.options.endColor=i.endColor||"#0000001a",n.options.startScale=i.startScale||.1,n.options.endScale=i.endScale||10,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||10,n.options.maximumSpeed=i.maximumSpeed||15,n.options.emissionRate=i.emissionRate||28,n.options.particleSize=i.particleSize||2,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.CircleEmitter(.2),performance:!1,modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},be(this.sdk,this.options.id),this.options.show&&Qt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Zc({},this.options.position):this.options.positions?l=Zc({},this.options.positions[0]):this.options.center?l=Zc({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"烟雾属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),be(r.sdk,r.options.id),re(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),qc.on(this,s),this._elms=qc.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return $c(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Zc({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Zc({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Zc({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Mn);function tu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return eu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?eu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var iu=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=tu(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(iu,"event",{});var nu=new iu;function ou(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function su(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ou(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ou(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function au(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function ru(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var lu=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=au(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f24d",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||1,n.options.endScale=i.endScale||20,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||9,n.options.maximumSpeed=i.maximumSpeed||9.5,n.options.emissionRate=i.emissionRate||20,n.options.particleSize=i.particleSize||.5,n.options.gravity=i.gravity||0===i.gravity?i.gravity:-3.5,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),e=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 -return e.translation=Cesium.Cartesian3.fromElements(0,0,0),e.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(e)},u=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,l),Cesium.Cartesian3.multiplyByScalar(l,c*i,l),t.velocity=Cesium.Cartesian3.add(t.velocity,l,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,new Cesium.Cartesian3,n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(r>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/fountain.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(.2)),modelMatrix:s,emitterModelMatrix:p(),updateCallback:u})),l=new Cesium.Cartesian3,c=-3.5,this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},be(this.sdk,this.options.id),this.options.show&&Qt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(h.entity&&h.show){var t=h.sdk.viewer.camera.positionCartographic.height;h.entity.show=!(t>=1e7)}}));case 21:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=su({},this.options.position):this.options.positions?l=su({},this.options.positions[0]):this.options.center?l=su({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"喷泉属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),be(r.sdk,r.options.id),re(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),nu.on(this,s),this._elms=nu.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ru(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:su({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:su({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:su({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Mn);function cu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return uu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?uu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function pu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function hu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?pu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function du(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function mu(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var fu=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=du(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f2",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||.2,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||12,n.options.maximumParticleLife=i.maximumParticleLife||12,n.options.emissionRate=i.emissionRate||100,n.options.particleSize=i.particleSize||1,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.start.lng,lat:n.options.start.lat,alt:n.options.start.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&(this.label.show=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)):console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C=function(t,e){var i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))},b=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(e.options.heading+90,e.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 -return i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(i)},y=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,r),Cesium.Cartesian3.multiplyByScalar(r,l*i,r),t.velocity=Cesium.Cartesian3.add(t.velocity,r,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=new Cesium.Cartesian3,l=-3.8,c=Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),u=Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.end.alt),this.options.heading||0===this.options.heading||(this.options.heading=C(c,u)),p=this.options.end.alt-this.options.start.alt,h=Cesium.Cartesian3.distance(c,Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.start.alt)),d=p?2*p/h:0,m=Math.atan(d)*(180/Math.PI),f=Math.sqrt(Math.abs(d)*h/-l),v=-l*f/Math.abs(Math.cos(m)),this.options.pitch||0===this.options.pitch||(this.options.pitch=90-m),this.options.speed||0===this.options.speed||(this.options.speed=v),g=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(g>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.speed,maximumSpeed:this.options.speed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.CircleEmitter(.2),modelMatrix:s,emitterModelMatrix:b(),updateCallback:y})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},be(this.sdk,this.options.id),this.options.show&&Qt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(w.entity&&w.show){var t=w.sdk.viewer.camera.positionCartographic.height;w.entity.show=!(t>=1e7)}}));case 31:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=hu({},this.options.position):this.options.positions?l=hu({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=hu({},this.options.line.positions[0]):this.options.center?l=hu({},this.options.center):this.options.start?l=hu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=Number(t),this.particleSystem.minimumSpeed=Number(t),this.particleSystem.maximumSpeed=Number(t),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=Number(t)}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=Number(t),this.particleSystem.startScale=Number(t),this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=Number(t)}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=Number(t),this.particleSystem.endScale=Number(t),this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=Number(t)}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=Number(t),this.particleSystem.emissionRate=Number(t),this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=Number(t)}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=Number(t),this.particleSystem.minimumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=Number(t)}))}},{key:"lng",get:function(){return this.options.start.lng},set:function(t){this.options.start.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.start.lat},set:function(t){this.options.start.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.start.alt},set:function(t){this.options.start.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.options.heading},set:function(t){this.options.heading=Number(t);var e=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 + */!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(33),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(e){return new Md5(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(e){return t.create().update(e)};for(var e=0;e<OUTPUT_TYPES.length;++e){var i=OUTPUT_TYPES[e];t[i]=createOutputMethod(i)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if("string"==typeof t)return crypto.createHash("md5").update(t,"utf8").digest("hex");if(null==t)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){if(t)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var e=new ArrayBuffer(68);this.buffer8=new Uint8Array(e),this.blocks=new Uint32Array(e)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var e,i=typeof t;if("string"!==i){if("object"!==i)throw ERROR;if(null===t)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw ERROR;e=!0}for(var n,o,s=0,a=t.length,r=this.blocks,l=this.buffer8;s<a;){if(this.hashed&&(this.hashed=!1,r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),e)if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)l[o++]=t[s];else for(o=this.start;s<a&&o<64;++s)r[o>>2]|=t[s]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;s<a&&o<64;++s)(n=t.charCodeAt(s))<128?l[o++]=n:n<2048?(l[o++]=192|n>>6,l[o++]=128|63&n):n<55296||n>=57344?(l[o++]=224|n>>12,l[o++]=128|n>>6&63,l[o++]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),l[o++]=240|n>>18,l[o++]=128|n>>12&63,l[o++]=128|n>>6&63,l[o++]=128|63&n);else for(o=this.start;s<a&&o<64;++s)(n=t.charCodeAt(s))<128?r[o>>2]|=n<<SHIFT[3&o++]:n<2048?(r[o>>2]|=(192|n>>6)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(r[o>>2]|=(224|n>>12)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),r[o>>2]|=(240|n>>18)<<SHIFT[3&o++],r[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],r[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],r[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,i,n,o,s,a=this.blocks;this.first?e=((e=((t=((t=a[0]-680876937)<<7|t>>>25)-271733879<<0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&t)+a[1]-117830708)<<12|n>>>20)+t<<0)&(-271733879^t))+a[2]-1126478375)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1316259209)<<22|e>>>10)+i<<0:(t=this.h0,e=this.h1,i=this.h2,e=((e+=((t=((t+=((n=this.h3)^e&(i^n))+a[0]-680876936)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[1]-389564586)<<12|n>>>20)+t<<0)&(t^e))+a[2]+606105819)<<17|i>>>15)+n<<0)&(n^t))+a[3]-1044525330)<<22|e>>>10)+i<<0),e=((e+=((t=((t+=(n^e&(i^n))+a[4]-176418897)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[5]+1200080426)<<12|n>>>20)+t<<0)&(t^e))+a[6]-1473231341)<<17|i>>>15)+n<<0)&(n^t))+a[7]-45705983)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[8]+1770035416)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[9]-1958414417)<<12|n>>>20)+t<<0)&(t^e))+a[10]-42063)<<17|i>>>15)+n<<0)&(n^t))+a[11]-1990404162)<<22|e>>>10)+i<<0,e=((e+=((t=((t+=(n^e&(i^n))+a[12]+1804603682)<<7|t>>>25)+e<<0)^(i=((i+=(e^(n=((n+=(i^t&(e^i))+a[13]-40341101)<<12|n>>>20)+t<<0)&(t^e))+a[14]-1502002290)<<17|i>>>15)+n<<0)&(n^t))+a[15]+1236535329)<<22|e>>>10)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[1]-165796510)<<5|t>>>27)+e<<0)^e))+a[6]-1069501632)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[11]+643717713)<<14|i>>>18)+n<<0)^n))+a[0]-373897302)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[5]-701558691)<<5|t>>>27)+e<<0)^e))+a[10]+38016083)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[15]-660478335)<<14|i>>>18)+n<<0)^n))+a[4]-405537848)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[9]+568446438)<<5|t>>>27)+e<<0)^e))+a[14]-1019803690)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[3]-187363961)<<14|i>>>18)+n<<0)^n))+a[8]+1163531501)<<20|e>>>12)+i<<0,e=((e+=((n=((n+=(e^i&((t=((t+=(i^n&(e^i))+a[13]-1444681467)<<5|t>>>27)+e<<0)^e))+a[2]-51403784)<<9|n>>>23)+t<<0)^t&((i=((i+=(t^e&(n^t))+a[7]+1735328473)<<14|i>>>18)+n<<0)^n))+a[12]-1926607734)<<20|e>>>12)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[5]-378558)<<4|t>>>28)+e<<0))+a[8]-2022574463)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[11]+1839030562)<<16|i>>>16)+n<<0))+a[14]-35309556)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[1]-1530992060)<<4|t>>>28)+e<<0))+a[4]+1272893353)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[7]-155497632)<<16|i>>>16)+n<<0))+a[10]-1094730640)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[13]+681279174)<<4|t>>>28)+e<<0))+a[0]-358537222)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[3]-722521979)<<16|i>>>16)+n<<0))+a[6]+76029189)<<23|e>>>9)+i<<0,e=((e+=((s=(n=((n+=((o=e^i)^(t=((t+=(o^n)+a[9]-640364487)<<4|t>>>28)+e<<0))+a[12]-421815835)<<11|n>>>21)+t<<0)^t)^(i=((i+=(s^e)+a[15]+530742520)<<16|i>>>16)+n<<0))+a[2]-995338651)<<23|e>>>9)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[0]-198630844)<<6|t>>>26)+e<<0)|~i))+a[7]+1126891415)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[14]-1416354905)<<15|i>>>17)+n<<0)|~t))+a[5]-57434055)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[12]+1700485571)<<6|t>>>26)+e<<0)|~i))+a[3]-1894986606)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[10]-1051523)<<15|i>>>17)+n<<0)|~t))+a[1]-2054922799)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[8]+1873313359)<<6|t>>>26)+e<<0)|~i))+a[15]-30611744)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[6]-1560198380)<<15|i>>>17)+n<<0)|~t))+a[13]+1309151649)<<21|e>>>11)+i<<0,e=((e+=((n=((n+=(e^((t=((t+=(i^(e|~n))+a[4]-145523070)<<6|t>>>26)+e<<0)|~i))+a[11]-1120210379)<<10|n>>>22)+t<<0)^((i=((i+=(t^(n|~e))+a[2]+718787259)<<15|i>>>17)+n<<0)|~t))+a[9]-343485551)<<21|e>>>11)+i<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=i-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+i<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,i=this.h2,n=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,i,n="",o=this.array(),s=0;s<15;)t=o[s++],e=o[s++],i=o[s++],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|i>>>6)]+BASE64_ENCODE_CHAR[63&i];return t=o[s],n+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(31),__webpack_require__(32))},function(t,e,i){var n=i(5),o=i(15),s=i(34),a=i(35);function r(e){var i="function"==typeof Map?new Map:void 0;return t.exports=r=function(t){if(null===t||!s(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(39)},function(t,e,i){var n=i(11).default;function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},s=Object.prototype,a=s.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(e){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var o=e&&e.prototype instanceof b?e:b,s=Object.create(o.prototype),a=new N(n||[]);return r(s,"_invoke",{value:P(t,i,a)}),s}function m(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var f="suspendedStart",v="executing",g="completed",y={};function b(){}function C(){}function w(){}var k={};h(k,c,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(B([])));_&&_!==s&&a.call(_,c)&&(k=_);var E=w.prototype=b.prototype=Object.create(k);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,l){var c=m(t[o],t,s);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){i("next",t,r,l)}),(function(t){i("throw",t,r,l)})):e.resolve(p).then((function(t){u.value=t,r(u)}),(function(t){return i("throw",t,r,l)}))}l(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}})}function P(t,i,n){var o=f;return function(s,a){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===s)throw a;return{value:e,done:!0}}for(n.method=s,n.arg=a;;){var r=n.delegate;if(r){var l=M(r,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(t,i,n);if("normal"===c.type){if(o=n.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function M(t,i){var n=i.method,o=t.iterator[n];if(o===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,M(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var s=m(o,t.iterator,i.arg);if("throw"===s.type)return i.method="throw",i.arg=s.arg,i.delegate=null,y;var a=s.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function B(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function i(){for(;++o<t.length;)if(a.call(t,o))return i.value=t[o],i.done=!1,i;return i.value=e,i.done=!0,i};return s.next=s}}throw new TypeError(n(t)+" is not iterable")}return C.prototype=w,r(E,"constructor",{value:w,configurable:!0}),r(w,"constructor",{value:C,configurable:!0}),C.displayName=h(w,p,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,h(t,p,"GeneratorFunction")),t.prototype=Object.create(E),t},i.awrap=function(t){return{__await:t}},S(D.prototype),h(D.prototype,u,(function(){return this})),i.AsyncIterator=D,i.async=function(t,e,n,o,s){void 0===s&&(s=Promise);var a=new D(d(t,e,n,o),s);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(E),h(E,p,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},i.values=B,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var i in this)"t"===i.charAt(0)&&a.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,o){return r.type="throw",r.arg=t,i.next=n,o&&(i.method="next",i.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],r=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=a.call(s,"catchLoc"),c=a.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:B(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),y}},i}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,o,s,a,r=[],l=!0,c=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(r.push(n.value),r.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw o}}return r}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(11).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(17);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var i,n,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function r(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,p=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!u){var t=r(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++p<e;)l&&l[p].run();p=-1,e=c.length}l=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function f(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new m(t,e)),1!==c.length||u||r(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){(function(e){t.exports=e}).call(this,{toUrlUndefined:!0})},function(t,e){t.exports=function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(36),o=i(15);t.exports=function(t,e,i){if(n())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,e);var a=new(t.bind.apply(t,s));return i&&o(a,i.prototype),a},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(t.exports=i=function(){return!!e},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t){t.exports=JSON.parse("{}")},function(t){t.exports=JSON.parse('{"地震灾害":{"1":{"c":30,"m":85,"y":65,"k":0},"2":{"c":0,"m":95,"y":40,"k":0},"3":{"c":5,"m":55,"y":40,"k":0},"4":{"c":2,"m":20,"y":20,"k":0}},"洪水灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"干旱灾害":{"1":{"c":10,"m":15,"y":100,"k":10},"2":{"c":0,"m":5,"y":55,"k":0},"3":{"c":0,"m":2,"y":25,"k":0},"4":{"c":0,"m":0,"y":10,"k":0}},"雪灾灾害":{"1":{"c":100,"m":65,"y":40,"k":0},"2":{"c":100,"m":40,"y":15,"k":0},"3":{"c":65,"m":25,"y":10,"k":0},"4":{"c":18,"m":8,"y":8,"k":0}},"雷电、冰雹灾害":{"1":{"c":40,"m":45,"y":40,"k":0},"2":{"c":30,"m":30,"y":25,"k":0},"3":{"c":0,"m":0,"y":0,"k":16},"4":{"c":0,"m":0,"y":0,"k":0}},"高温灾害":{"1":{"c":20,"m":90,"y":65,"k":20},"2":{"c":20,"m":85,"y":100,"k":0},"3":{"c":0,"m":55,"y":80,"k":0},"4":{"c":0,"m":30,"y":85,"k":0}},"低温灾害":{"1":{"c":70,"m":70,"y":50,"k":0},"2":{"c":60,"m":50,"y":30,"k":0},"3":{"c":40,"m":35,"y":20,"k":0},"4":{"c":10,"m":10,"y":5,"k":0}},"台风灾害":{"1":{"c":95,"m":75,"y":75,"k":0},"2":{"c":75,"m":60,"y":65,"k":0},"3":{"c":40,"m":25,"y":30,"k":0},"4":{"c":25,"m":10,"y":15,"k":0}},"大风、沙尘暴灾害":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":25},"3":{"c":0,"m":0,"y":60,"k":0},"4":{"c":0,"m":0,"y":25,"k":0}},"暴雨灾害":{"1":{"c":100,"m":70,"y":40,"k":0},"2":{"c":70,"m":50,"y":10,"k":0},"3":{"c":55,"m":30,"y":10,"k":0},"4":{"c":20,"m":10,"y":5,"k":0}},"自然灾害GDP综合风险图色彩样式":{"1":{"c":15,"m":100,"y":85,"k":0},"2":{"c":7,"m":50,"y":60,"k":0},"3":{"c":0,"m":5,"y":55,"k":0},"4":{"c":0,"m":2,"y":25,"k":0},"5":{"c":0,"m":0,"y":10,"k":0}},"自然灾害死亡人口综合风险图色彩样式":{"1":{"c":0,"m":100,"y":100,"k":25},"2":{"c":15,"m":100,"y":85,"k":0},"3":{"c":5,"m":50,"y":60,"k":0},"4":{"c":5,"m":35,"y":40,"k":0},"5":{"c":0,"m":15,"y":15,"k":0}},"自然灾害受灾人口综合风险图色彩样式":{"1":{"c":25,"m":58,"y":95,"k":0},"2":{"c":8,"m":45,"y":95,"k":0},"3":{"c":5,"m":30,"y":60,"k":0},"4":{"c":2,"m":20,"y":40,"k":0},"5":{"c":0,"m":10,"y":20,"k":0}},"自然灾害农作物综合风险图色彩样式":{"1":{"c":0,"m":40,"y":100,"k":45},"2":{"c":0,"m":0,"y":100,"k":45},"3":{"c":0,"m":0,"y":100,"k":25},"4":{"c":0,"m":0,"y":60,"k":0},"5":{"c":10,"m":5,"y":15,"k":0}},"自然灾害房屋综合风险图色彩样式":{"1":{"c":60,"m":90,"y":70,"k":0},"2":{"c":50,"m":90,"y":60,"k":0},"3":{"c":40,"m":80,"y":40,"k":0},"4":{"c":25,"m":45,"y":25,"k":0},"5":{"c":15,"m":25,"y":15,"k":0}},"自然灾害道路综合风险图色彩样式":{"1":{"c":55,"m":65,"y":75,"k":0},"2":{"c":45,"m":50,"y":60,"k":0},"3":{"c":20,"m":30,"y":40,"k":0},"4":{"c":7,"m":15,"y":35,"k":0},"5":{"c":0,"m":10,"y":25,"k":0}},"自然灾害减灾能力图色彩样式":{"1":{"c":90,"m":50,"y":95,"k":0},"2":{"c":70,"m":40,"y":80,"k":0},"3":{"c":50,"m":30,"y":65,"k":0},"4":{"c":35,"m":20,"y":50,"k":0},"5":{"c":10,"m":5,"y":35,"k":0}},"自然灾害综合防治区划图色彩样式":{"1":{"c":0,"m":90,"y":80,"k":0},"2":{"c":0,"m":50,"y":80,"k":0},"3":{"c":60,"m":0,"y":50,"k":25},"4":{"c":60,"m":0,"y":100,"k":0}}}')},function(t,e,i){"use strict";i.r(e);var n=i(3),o=i.n(n),s=i(0),a=i.n(s);var r="9e549c39c542fc9f835c2a5c260f8cc1",l="40ef4712c26360d01e397ebcb0d031ca";function c(){return u.apply(this,arguments)}function u(){return(u=o()(a.a.mark((function t(){var e,i,n,o=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,fetch((e.host||"")+"/yjearth4.0/api/v1/user/sign-in",{method:"post",body:JSON.stringify({username:e.username,password:e.password}),headers:{"Content-Type":"application/json"}});case 3:return i=t.sent,t.next=6,i.text();case 6:n=t.sent,0===(n=JSON.parse(n)).code&&(p(e.host),n.token?d(n.token):d(n.data.token));case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t){localStorage.setItem(l,t||"")}function h(){return localStorage.getItem(l)||""}function d(t){localStorage.setItem(r,t)}function m(){return localStorage.getItem(r)}function f(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}var g=i(10),y=i.n(g),b=i(8),C=i.n(b),w=i(1),k=i.n(w),x=i(2),_=i.n(x);function E(t){document.addEventListener("keydown",M.bind(t),!1),document.addEventListener("keyup",O.bind(t),!1),t&&t.clock.onTick.addEventListener((function(){!function(t){if(!t||!t.scene||!t.scene.screenSpaceCameraController.enableTilt)return;var e=t.camera,i=t.scene.globe.ellipsoid.cartesianToCartographic(e.position).height,n=e.positionCartographic.height,o=i/20,s=o/5e5/Cesium.Math.toDegrees(e.pitch),a=n/100;S.moveForward&&(2==t.scene.mode?e.moveUp(a):e.rotate(e.right,-s));S.moveBackward&&(2==t.scene.mode?e.moveDown(a):e.rotate(e.right,s));S.moveLeft&&(2==t.scene.mode?e.moveLeft(a):e.rotate(e.up,-s));S.moveRight&&(2==t.scene.mode?e.moveRight(a):e.rotate(e.up,s));S.moveUp&&e.moveUp(o);S.moveDown&&e.moveDown(o);S.lookUp&&e.lookUp();S.lookDown&&e.lookDown();S.lookLeft&&e.lookLeft();S.lookRight&&e.lookRight();S.twistLeft&&e.twistLeft();S.twistRight&&e.twistRight();if(S.zoomIn){var r=i/2;r<1&&(r=0),e.zoomIn(r)}if(S.zoomOut){var l=i/2;i+i>=5e7&&(l=5e7-i),e.zoomOut(l)}}(t)}))}var S={moveForward:!1,moveBackward:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1,lookUp:!1,lookDown:!1,lookLeft:!1,lookRight:!1,twistLeft:!1,twistRight:!1,zoomIn:!1,zoomOut:!1};function D(t){switch(t){case 87:return"moveForward";case 83:return"moveBackward";case 68:return"moveRight";case 65:return"moveLeft";case 81:return"moveUp";case 69:return"moveDown";case 38:return"lookUp";case 40:return"lookDown";case 37:return"lookLeft";case 39:return"lookRight";case 96:return"twistLeft";case 110:return"twistRight";case 107:return"zoomIn";case 109:return"zoomOut";default:return}}function M(t){var e;if("input"===(e=document.activeElement).tagName.toLowerCase()&&"checkbox"!==e.type||"textarea"===e.tagName.toLowerCase()||"textarea"===e.getAttribute("role"));else if(this.trackedEntity);else if(this._firstPersonView);else if(this._disableKeyboardEvent);else if(t.ctrlKey&&t.altKey){if("v"===t.key||"V"===t.key){var i=this.camera;this._CAMERA_SHORTCUT_VIEW={orientation:{heading:i.heading,pitch:i.pitch,roll:i.roll},position:{x:i.position.x,y:i.position.y,z:i.position.z}},localStorage.setItem("CAMERA_SHORTCUT_VIEW",JSON.stringify(this._CAMERA_SHORTCUT_VIEW))}if("f"===t.key||"F"===t.key){var n=localStorage.getItem("CAMERA_SHORTCUT_VIEW");this._CAMERA_SHORTCUT_VIEW=JSON.parse(n),this._CAMERA_SHORTCUT_VIEW&&this._CAMERA_SHORTCUT_VIEW.position&&this._CAMERA_SHORTCUT_VIEW.orientation&&this.camera.flyTo({destination:this._CAMERA_SHORTCUT_VIEW.position,orientation:this._CAMERA_SHORTCUT_VIEW.orientation})}}else{var o=D(t.keyCode);void 0!==o&&(S[o]=!0)}}function O(t){var e=D(t.keyCode);void 0!==e&&(S[e]=!1)}var T=i(11),N=i.n(T),B=i(6),L=i.n(B),A=i(20),j=i.n(A),I=[{name:"GCS_WGS_1984",epsg:"EPSG:4326",def:"+proj=longlat +datum=WGS84 +no_defs"},{name:"GCS_China_Geodetic_Coordinate_System_2000",epsg:"EPSG:4490",def:"+proj=longlat +ellps=GRS80 +no_defs"},{name:"WGS 84 / UTM zone 1N",epsg:"EPSG:32601",def:"+proj=utm +zone=1 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2N",epsg:"EPSG:32602",def:"+proj=utm +zone=2 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3N",epsg:"EPSG:32603",def:"+proj=utm +zone=3 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4N",epsg:"EPSG:32604",def:"+proj=utm +zone=4 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5N",epsg:"EPSG:32605",def:"+proj=utm +zone=5 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6N",epsg:"EPSG:32606",def:"+proj=utm +zone=6 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7N",epsg:"EPSG:32607",def:"+proj=utm +zone=7 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8N",epsg:"EPSG:32608",def:"+proj=utm +zone=8 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9N",epsg:"EPSG:32609",def:"+proj=utm +zone=9 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10N",epsg:"EPSG:32610",def:"+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11N",epsg:"EPSG:32611",def:"+proj=utm +zone=11 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12N",epsg:"EPSG:32612",def:"+proj=utm +zone=12 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13N",epsg:"EPSG:32613",def:"+proj=utm +zone=13 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14N",epsg:"EPSG:32614",def:"+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15N",epsg:"EPSG:32615",def:"+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16N",epsg:"EPSG:32616",def:"+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17N",epsg:"EPSG:32617",def:"+proj=utm +zone=17 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18N",epsg:"EPSG:32618",def:"+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19N",epsg:"EPSG:32619",def:"+proj=utm +zone=19 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20N",epsg:"EPSG:32620",def:"+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21N",epsg:"EPSG:32621",def:"+proj=utm +zone=21 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22N",epsg:"EPSG:32622",def:"+proj=utm +zone=22 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23N",epsg:"EPSG:32623",def:"+proj=utm +zone=23 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24N",epsg:"EPSG:32624",def:"+proj=utm +zone=24 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25N",epsg:"EPSG:32625",def:"+proj=utm +zone=25 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26N",epsg:"EPSG:32626",def:"+proj=utm +zone=26 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27N",epsg:"EPSG:32627",def:"+proj=utm +zone=27 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28N",epsg:"EPSG:32628",def:"+proj=utm +zone=28 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29N",epsg:"EPSG:32629",def:"+proj=utm +zone=29 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30N",epsg:"EPSG:32630",def:"+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31N",epsg:"EPSG:32631",def:"+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32N",epsg:"EPSG:32632",def:"+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33N",epsg:"EPSG:32633",def:"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34N",epsg:"EPSG:32634",def:"+proj=utm +zone=34 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35N",epsg:"EPSG:32635",def:"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36N",epsg:"EPSG:32636",def:"+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37N",epsg:"EPSG:32637",def:"+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38N",epsg:"EPSG:32638",def:"+proj=utm +zone=38 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39N",epsg:"EPSG:32639",def:"+proj=utm +zone=39 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40N",epsg:"EPSG:32640",def:"+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41N",epsg:"EPSG:32641",def:"+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42N",epsg:"EPSG:32642",def:"+proj=utm +zone=42 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43N",epsg:"EPSG:32643",def:"+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44N",epsg:"EPSG:32644",def:"+proj=utm +zone=44 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45N",epsg:"EPSG:32645",def:"+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46N",epsg:"EPSG:32646",def:"+proj=utm +zone=46 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47N",epsg:"EPSG:32647",def:"+proj=utm +zone=47 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48N",epsg:"EPSG:32648",def:"+proj=utm +zone=48 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49N",epsg:"EPSG:32649",def:"+proj=utm +zone=49 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50N",epsg:"EPSG:32650",def:"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51N",epsg:"EPSG:32651",def:"+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52N",epsg:"EPSG:32652",def:"+proj=utm +zone=52 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53N",epsg:"EPSG:32653",def:"+proj=utm +zone=53 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54N",epsg:"EPSG:32654",def:"+proj=utm +zone=54 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55N",epsg:"EPSG:32655",def:"+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56N",epsg:"EPSG:32656",def:"+proj=utm +zone=56 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57N",epsg:"EPSG:32657",def:"+proj=utm +zone=57 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58N",epsg:"EPSG:32658",def:"+proj=utm +zone=58 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59N",epsg:"EPSG:32659",def:"+proj=utm +zone=59 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60N",epsg:"EPSG:32660",def:"+proj=utm +zone=60 +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 1S",epsg:"EPSG:32701",def:"+proj=utm +zone=1 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 2S",epsg:"EPSG:32702",def:"+proj=utm +zone=2 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 3S",epsg:"EPSG:32703",def:"+proj=utm +zone=3 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 4S",epsg:"EPSG:32704",def:"+proj=utm +zone=4 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 5S",epsg:"EPSG:32705",def:"+proj=utm +zone=5 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 6S",epsg:"EPSG:32706",def:"+proj=utm +zone=6 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 7S",epsg:"EPSG:32707",def:"+proj=utm +zone=7 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 8S",epsg:"EPSG:32708",def:"+proj=utm +zone=8 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 9S",epsg:"EPSG:32709",def:"+proj=utm +zone=9 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 10S",epsg:"EPSG:32710",def:"+proj=utm +zone=10 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 11S",epsg:"EPSG:32711",def:"+proj=utm +zone=11 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 12S",epsg:"EPSG:32712",def:"+proj=utm +zone=12 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 13S",epsg:"EPSG:32713",def:"+proj=utm +zone=13 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 14S",epsg:"EPSG:32714",def:"+proj=utm +zone=14 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 15S",epsg:"EPSG:32715",def:"+proj=utm +zone=15 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 16S",epsg:"EPSG:32716",def:"+proj=utm +zone=16 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 17S",epsg:"EPSG:32717",def:"+proj=utm +zone=17 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 18S",epsg:"EPSG:32718",def:"+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 19S",epsg:"EPSG:32719",def:"+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 20S",epsg:"EPSG:32720",def:"+proj=utm +zone=20 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 21S",epsg:"EPSG:32721",def:"+proj=utm +zone=21 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 22S",epsg:"EPSG:32722",def:"+proj=utm +zone=22 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 23S",epsg:"EPSG:32723",def:"+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 24S",epsg:"EPSG:32724",def:"+proj=utm +zone=24 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 25S",epsg:"EPSG:32725",def:"+proj=utm +zone=25 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 26S",epsg:"EPSG:32726",def:"+proj=utm +zone=26 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 27S",epsg:"EPSG:32727",def:"+proj=utm +zone=27 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 28S",epsg:"EPSG:32728",def:"+proj=utm +zone=28 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 29S",epsg:"EPSG:32729",def:"+proj=utm +zone=29 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 30S",epsg:"EPSG:32730",def:"+proj=utm +zone=30 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 31S",epsg:"EPSG:32731",def:"+proj=utm +zone=31 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 32S",epsg:"EPSG:32732",def:"+proj=utm +zone=32 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 33S",epsg:"EPSG:32733",def:"+proj=utm +zone=33 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 34S",epsg:"EPSG:32734",def:"+proj=utm +zone=34 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 35S",epsg:"EPSG:32735",def:"+proj=utm +zone=35 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 36S",epsg:"EPSG:32736",def:"+proj=utm +zone=36 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 37S",epsg:"EPSG:32737",def:"+proj=utm +zone=37 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 38S",epsg:"EPSG:32738",def:"+proj=utm +zone=38 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 39S",epsg:"EPSG:32739",def:"+proj=utm +zone=39 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 40S",epsg:"EPSG:32740",def:"+proj=utm +zone=40 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 41S",epsg:"EPSG:32741",def:"+proj=utm +zone=41 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 42S",epsg:"EPSG:32742",def:"+proj=utm +zone=42 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 43S",epsg:"EPSG:32743",def:"+proj=utm +zone=43 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 44S",epsg:"EPSG:32744",def:"+proj=utm +zone=44 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 45S",epsg:"EPSG:32745",def:"+proj=utm +zone=45 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 46S",epsg:"EPSG:32746",def:"+proj=utm +zone=46 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 47S",epsg:"EPSG:32747",def:"+proj=utm +zone=47 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 48S",epsg:"EPSG:32748",def:"+proj=utm +zone=48 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 49S",epsg:"EPSG:32749",def:"+proj=utm +zone=49 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 50S",epsg:"EPSG:32750",def:"+proj=utm +zone=50 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 51S",epsg:"EPSG:32751",def:"+proj=utm +zone=51 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 52S",epsg:"EPSG:32752",def:"+proj=utm +zone=52 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 53S",epsg:"EPSG:32753",def:"+proj=utm +zone=53 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 54S",epsg:"EPSG:32754",def:"+proj=utm +zone=54 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 55S",epsg:"EPSG:32755",def:"+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 56S",epsg:"EPSG:32756",def:"+proj=utm +zone=56 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 57S",epsg:"EPSG:32757",def:"+proj=utm +zone=57 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 58S",epsg:"EPSG:32758",def:"+proj=utm +zone=58 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 59S",epsg:"EPSG:32759",def:"+proj=utm +zone=59 +south +datum=WGS84 +units=m +no_defs"},{name:"WGS 84 / UTM zone 60S",epsg:"EPSG:32760",def:"+proj=utm +zone=60 +south +datum=WGS84 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_13",epsg:"EPSG:4491",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_14",epsg:"EPSG:4492",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_15",epsg:"EPSG:4493",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_16",epsg:"EPSG:4494",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_17",epsg:"EPSG:4495",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_18",epsg:"EPSG:4496",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_19",epsg:"EPSG:4497",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_20",epsg:"EPSG:4498",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_21",epsg:"EPSG:4499",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_22",epsg:"EPSG:4500",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_Zone_23",epsg:"EPSG:4501",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_75E",epsg:"EPSG:4502",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_81E",epsg:"EPSG:4503",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_87E",epsg:"EPSG:4504",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_93E",epsg:"EPSG:4505",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_99E",epsg:"EPSG:4506",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_105E",epsg:"EPSG:4507",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_111E",epsg:"EPSG:4508",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_117E",epsg:"EPSG:4509",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_123E",epsg:"EPSG:4510",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_129E",epsg:"EPSG:4511",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_GK_CM_135E",epsg:"EPSG:4512",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_25",epsg:"EPSG:4513",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_26",epsg:"EPSG:4514",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_27",epsg:"EPSG:4515",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_28",epsg:"EPSG:4516",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_29",epsg:"EPSG:4517",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_30",epsg:"EPSG:4518",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_31",epsg:"EPSG:4519",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_32",epsg:"EPSG:4520",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_33",epsg:"EPSG:4521",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_34",epsg:"EPSG:4522",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_35",epsg:"EPSG:4523",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_36",epsg:"EPSG:4524",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_37",epsg:"EPSG:4525",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_38",epsg:"EPSG:4526",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_39",epsg:"EPSG:4527",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_40",epsg:"EPSG:4528",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_41",epsg:"EPSG:4529",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_42",epsg:"EPSG:4530",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_43",epsg:"EPSG:4531",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_44",epsg:"EPSG:4532",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_Zone_45",epsg:"EPSG:4533",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_75E",epsg:"EPSG:4534",def:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_78E",epsg:"EPSG:4535",def:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_81E",epsg:"EPSG:4536",def:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_84E",epsg:"EPSG:4537",def:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_87E",epsg:"EPSG:4538",def:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_90E",epsg:"EPSG:4539",def:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_93E",epsg:"EPSG:4540",def:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_96E",epsg:"EPSG:4541",def:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_99E",epsg:"EPSG:4542",def:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_102E",epsg:"EPSG:4543",def:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_105E",epsg:"EPSG:4544",def:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_108E",epsg:"EPSG:4545",def:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_111E",epsg:"EPSG:4546",def:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_114E",epsg:"EPSG:4547",def:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_117E",epsg:"EPSG:4548",def:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_120E",epsg:"EPSG:4549",def:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_123E",epsg:"EPSG:4550",def:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_126E",epsg:"EPSG:4551",def:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_129E",epsg:"EPSG:4552",def:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_132E",epsg:"EPSG:4553",def:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"},{name:"CGCS2000_3_Degree_GK_CM_135E",epsg:"EPSG:4554",def:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"}],R=function(){return _()((function t(){k()(this,t),this.name_map=new Map,this.epsg_map=new Map,this.initProj()}),[{key:"initProj",value:function(){var t=this;I.forEach((function(e){proj4.defs(e.epsg,e.def),t.name_map.set(e.name,e),t.epsg_map.set(e.epsg,e)}))}},{key:"convert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n={points:[],code:0,message:""};if(!this.name_map.has(e)&&!this.epsg_map.has(e))return n.code=1,n.message="不支持的坐标系:"+e,n;if(!this.name_map.has(i)&&!this.epsg_map.has(i))return n.code=1,n.message="不支持的坐标系:"+i,n;var o=(this.name_map.get(e)||this.epsg_map.get(e)).epsg,s=(this.name_map.get(i)||this.epsg_map.get(i)).epsg,a=proj4.defs(o),r=proj4.defs(s);return t.forEach((function(t){var e=Number(t.x),i=Number(t.y),o=Number(t.z||0),s=proj4(a,r,[e,i]);n.points.push({x:Number(s[0].toFixed(10)),y:Number(s[1].toFixed(10)),z:o})})),n}},{key:"getAllProjection",value:function(){return Array.from(this.name_map.values())}},{key:"projectionIsExists",value:function(t){return this.name_map.has(t)||this.epsg_map.has(t)}},{key:"degreesToDMS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function i(t){var e=t.toString(),i=e.indexOf(".");return-1!==i?e.length-i-1:0}function n(t){return Math.pow(10,t)}var o=Math.floor(t),s=n(i(t)),a=Math.floor((t-o)*s*60)/s,r=Math.floor(a),l=n(i(a)),c=Math.floor((a-r)*l)/l*60;return e?o+"°"+Number(a.toFixed(4))+"'":o+"°"+r+"'"+c.toFixed(2)+'"'}},{key:"dmsToDecimal",value:function(t,e){var i,n,o;if(e){var s=t.split("°"),a=s[1].split("'");i=s[0],n=a[0],console.log(i,n);var r=Math.pow(10,8),l=Number(i*r)+n*r/60;return Math.round(l)/r}var c=t.split("°"),u=c[1].split("'"),p=u[1].split('"');i=c[0],n=u[0],o=p[0],console.log(i,n,o);var h=Math.pow(10,8),d=Number(i*h)+n*h/60+o*h/3600;return Math.round(d)/h}}])}();function F(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function z(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?F(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var H,V,G=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];k()(this,t),this.container=e,this.options=z({},i),this.options.ismove=!0,!1===i.ismove&&(this.options.ismove=i.ismove),this.closeCallBack=i.closeCallBack,this._element={},this._element_style=void 0,this.only=n}),[{key:"init",value:(t=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.only&&this.closeAll(),U.push(this),this.isDestroy=!1,this._element.body=document.createElement("div"),this._element.body.className="YJ-custom-base-dialog",this._element.body.style.top=this.options.top,this._element.body.style.bottom=this.options.bottom,this._element.body.style.left=this.options.left,this._element.body.style.right=this.options.right,this.container.appendChild(this._element.body),this._element.title=document.createElement("div"),this._element.title.className="title-box",this._element.title.innerHTML='<span class="title">'.concat(this.options.title||"","</span>")+'<span class="close-box"><span class="close"></span><i>✕</i></span>',this._element.body.appendChild(this._element.title),t.next=16,document.createElement("div");case 16:return this._element.content=t.sent,this._element.content.className="content",this._element.body.appendChild(this._element.content),t.next=21,document.createElement("div");case 21:return this._element.foot=t.sent,this._element.foot.className="foot",this._element.foot.innerHTML='\n <button class="close">关闭</button>\n ',this._element.body.appendChild(this._element.foot),t.next=27,document.createElement("div");case 27:for((e=t.sent).style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.backdropFilter="blur(2px)",e.style.zIndex="-999999",this._element.body.appendChild(e),this._element.body.getElementsByClassName("close-box")[0].addEventListener("click",(function(){o.close()})),i=this._element.body.getElementsByClassName("close"),n=0;n<i.length;n++)i[n].addEventListener("click",(function(){o.close()}));this.options.ismove&&this.moveDiv();case 41:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"close",value:function(){for(var t=document.getElementsByTagName("style"),e=t.length-1;e>=0;e--)t[e].dataset&&"YJ_style_dialog"===t[e].dataset.name&&document.getElementsByTagName("head")[0].removeChild(t[e]);this._element.body&&this._element.body.parentNode&&this.container.removeChild(this._element.body),this._element.body=null,this._element.title=null,this._element.content=null,this._element.foot=null,this._element_style=null,this.isDestroy=!0,this.closeCallBack&&(this.closeCallBack(),this.closeCallBack=null)}},{key:"closeAll",value:function(){for(var t=U.length-1;t>=0;t--)U[t].close(),U.splice(t,1)}},{key:"titleAppChild",value:function(t){this._element.title.appendChild(t)}},{key:"contentAppChild",value:function(t){this._element.content.appendChild(t)}},{key:"footAppChild",value:function(t,e){e?this._element.foot.insertBefore(t,e):this._element.foot.prepend(t)}},{key:"moveDiv",value:function(){var t=this,e=0,i=0,n=0,o=0,s=this._element.body,a=this;s.onmousedown=function(s){if("title-box"===s.toElement.className){var r=t._element.body.offsetHeight,l=t._element.body.offsetWidth;e=s.clientX,i=s.clientY;var c=window.getComputedStyle(t._element.body).left,u=window.getComputedStyle(t._element.body).top;n=1*c.substr(0,c.indexOf("px")),o=1*u.substr(0,u.indexOf("px"));var p=document.documentElement.clientHeight,h=document.documentElement.clientWidth;window.onmousemove=function(t){t.preventDefault();var s=t.clientX,c=t.clientY,u=s-(e-n),d=c-(i-o);u<0?u=0:u+l>h&&(u=h-l),d<=0?d=0:d+r>p&&(d=p-r),a._element.body.style.left=u+"px",a._element.body.style.top=d+"px",a._element.body.style.bottom="unset",a._element.body.style.right="unset"},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}},document.onmouseup=function(t){window.onmousemove=null},window.ondragend=function(t){window.onmousemove=null}}}]);var t}(),U=[],W=G,Y=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=null;return{that:Array.prototype.slice.call(t.querySelectorAll(e),0),stopPropagation:function(t){(t=t||window.event).stopPropagation?t.stopPropagation():t.cancelBubble=!0},hide:function(){Y(t,e).that.forEach((function(t){t.style.cssText+="display:none;"}))},show:function(i){void 0!==i?Y(t,e).that[i].style.cssText+="display:block;":Y(t,e).that.forEach((function(t){t.style.cssText+="display:block;"}))},legp_searchList:function(e){var i=[];return Y(t,"input[name="+e+"]").that.forEach((function(t){i.push(t.value)})),i},legp_search:function(o){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Y(t,e).that[i];if(a){var r='<div class="cy_datalist"><i class="yj-custom-icon-arrow-down"></i>\n '.concat(s?'<input type="text" placeholder="输入或选择" autocomplete="off">':'<input type="text" class="datalist '.concat(i,'" readonly="readonly" placeholder="请选择" autocomplete="off">'),'\n <dl style="display: none;position: absolute;background: rgba(0, 0, 0, 0.5);color: rgba(var(--color-sdk-base-rgb), 1);border: 1px solid rgba(var(--color-sdk-base-rgb), 0.2);border-radius: 3px;margin: 2px 0px;max-height: 300px;overflow-x: hidden;white-space: nowrap; font-size: 12px;z-index: 8;">\n </dl>\n </div>');a.innerHTML=r,Y(t,".cy_datalist input").that[i].oninput=function(e){var s=this.value;if(Y(t,".cy_datalist dl").hide(),o.length>0){Y(t,".cy_datalist dl").show();var a=new RegExp(s),r=!1;Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){a.test(e.name)&&(r=!0,Y(t,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===e.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+e.value+'">'+e.name+"</dd>")})),r||(Y(t,".cy_datalist dl").that[i].innerHTML='<dd style="padding: 10px 20px; color: #fff;">暂无数据</dd>'),l()}},Y(t,".cy_datalist input").that[i].onclick=function(e){Y(t,".cy_datalist dl").hide();var i=1*e.srcElement.classList[1];i=i||0,"none"===Y(t,".cy_datalist dl").that[i].style.display&&(0==o.length?this.innerHTML="暂无数据":Y(t,".cy_datalist dl").show(i),Y(t,".cy_datalist dl").that[i].innerHTML="",o.forEach((function(e){Y(t,".cy_datalist dl").that[i].innerHTML+='<dd class="'+(n===e.value?"active":"")+'" style="margin: 0; padding: 5px 5px; color: #fff;cursor: pointer;" value="'+e.value+'">'+e.name+"</dd>"})),l()),e.stopPropagation()},document.addEventListener("click",(function(){Y(t,".cy_datalist dl").hide()}))}function l(){Y(t,".cy_datalist dl dd").that.forEach((function(t){t.onclick=function(t){if(this&&this.attributes){var e=this.attributes.value.value;n=e,t.currentTarget.parentNode.previousElementSibling.value=e;var i=new Event("input",{bubbles:!0});t.currentTarget.parentNode.previousElementSibling.dispatchEvent(i)}}}))}},legp_searchActive:function(t){n=t}}},J=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new R,H&&H.close&&(H.close(),H=null),t.next=4,new W(e.viewer._container,{title:"度分秒",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 4:return H=t.sent,t.next=7,H.init();case 7:o='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-select-box">\n <span class="label" style="flex: 0 0 60px;">输入格式</span>\n <div class="input-select"></div>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="'.concat(0,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如116.6°, 39.9°</span>\n </p>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: auto;">经度</span>\n <input class="input lng" type="number" min="-180" max="180" value="0" title="">\n </div>\n <div class="col" style="margin: 0;">\n <span class="label">纬度</span>\n <input class="input lat" type="number" min="-90" max="90" value="0" title="">\n </div>\n <div class="col" style="flex: 0 0 24px;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="',1,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度分</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如95°10.1702\', 49°12.4015\'</span>\n </p>\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span class="label">经度</span>\n <input class="input lng-dm-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span class="label">纬度</span>\n <input class="input lat-dm-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dm-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 24px;margin: 0;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <div class="div-item item" data-type="',2,'">\n <span class="custom-divider"></span>\n <p style="font-size: 16px;padding-bottom: 6px;margin-top: 10px;margin-bottom: 5px;">\n <span style="margin-right: 10px;">度分秒</span>\n <span style="font-size: 12px;margin-bottom: 5px;color: #F16C55">例如11°18\'54.37", 39°13\'46.57"</span>\n </p>\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span class="label">经度</span>\n <input class="input lng-dms-d" style="flex: 1;" type="number" min="-180" max="180" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lng-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span class="label">纬度</span>\n <input class="input lat-dms-d" style="flex: 1;" type="number" min="-90" max="90" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dms-m" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lat-dms-s" style="flex: 1;" type="number" min="0" max="60" value="0" title="">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 24px; margin: 0;">\n <i class="icon-copy-box" title="复制" data-clipboard-action="copy" data-clipboard-target=".input" style="cursor: pointer;position: relative;left: -30px;">\n <svg class="icon-copy" style="margin: 4px;margin-bottom: 0px;"><use xlink:href="#yj-icon-copy"></use></svg>\n </i>\n <button class="convert" style="margin-left: 10px;">转 换</button>\n </div>\n </div>\n </div>\n <span class="custom-divider" style="order: 10;margin-top: 12px;"></span>\n '),H._element.body.className=H._element.body.className+" proj-convert",(s=document.createElement("div")).style.width="460px",s.style.display="flex",s.style.flexDirection="column",s.innerHTML=o,H.contentAppChild(s),r=s.getElementsByClassName("item"),l=a.a.mark((function t(e){var i,o,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=r[e].getAttribute("data-type"),o=r[e].getElementsByClassName("convert")[0],l=r[e].getElementsByClassName("icon-copy-box")[0],(c=new ClipboardJS(l,{text:function(t){var n;switch(i){case 0:case"0":n=r[e].getElementsByClassName("lng")[0].value+"°,"+r[e].getElementsByClassName("lat")[0].value+"°";break;case 1:case"1":n=s.getElementsByClassName("lng-dm-d")[0].value+"°"+s.getElementsByClassName("lng-dm-m")[0].value+"',"+s.getElementsByClassName("lat-dm-d")[0].value+"°"+s.getElementsByClassName("lat-dm-m")[0].value+"'";break;case 2:case"2":n=s.getElementsByClassName("lng-dms-d")[0].value+"°"+s.getElementsByClassName("lng-dms-m")[0].value+"'"+s.getElementsByClassName("lng-dms-s")[0].value+'",'+s.getElementsByClassName("lat-dms-d")[0].value+"°"+s.getElementsByClassName("lat-dms-m")[0].value+"'"+s.getElementsByClassName("lat-dms-s")[0].value+'"'}return n}})).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})})),c.on("error",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"复制失败",type:"warning",duration:1500})})),o.addEventListener("click",(function(){var t,o,a,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_;switch(i){case 0:case"0":t=r[e].getElementsByClassName("lng")[0].value,o=r[e].getElementsByClassName("lat")[0].value,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0],d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 1:case"1":a=r[e].getElementsByClassName("lng-dm-d")[0].value,l=r[e].getElementsByClassName("lng-dm-m")[0].value,c=r[e].getElementsByClassName("lat-dm-d")[0].value,u=r[e].getElementsByClassName("lat-dm-m")[0].value,t=n.dmsToDecimal(a+"°"+l+"'",!0),o=n.dmsToDecimal(c+"°"+u+"'",!0),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,d=n.degreesToDMS(t),m=n.degreesToDMS(o),w=(C=(b=d.split("°"))[1].split("'"))[1].split('"'),_=(x=(k=m.split("°"))[1].split("'"))[1].split('"'),s.getElementsByClassName("lng-dms-d")[0].value=b[0],s.getElementsByClassName("lng-dms-m")[0].value=C[0],s.getElementsByClassName("lng-dms-s")[0].value=w[0],s.getElementsByClassName("lat-dms-d")[0].value=k[0],s.getElementsByClassName("lat-dms-m")[0].value=x[0],s.getElementsByClassName("lat-dms-s")[0].value=_[0];break;case 2:case"2":d=(a=r[e].getElementsByClassName("lng-dms-d")[0].value)+"°"+(l=r[e].getElementsByClassName("lng-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lng-dms-s")[0].value+'"',m=(c=r[e].getElementsByClassName("lat-dms-d")[0].value)+"°"+(u=r[e].getElementsByClassName("lat-dms-m")[0].value)+"'"+r[e].getElementsByClassName("lat-dms-s")[0].value+'"',t=n.dmsToDecimal(d),o=n.dmsToDecimal(m),s.getElementsByClassName("lng")[0].value=t,s.getElementsByClassName("lat")[0].value=o,p=n.degreesToDMS(t,!0),h=n.degreesToDMS(o,!0),v=(f=p.split("°"))[1].split("'"),y=(g=h.split("°"))[1].split("'"),s.getElementsByClassName("lng-dm-d")[0].value=f[0],s.getElementsByClassName("lng-dm-m")[0].value=v[0],s.getElementsByClassName("lat-dm-d")[0].value=g[0],s.getElementsByClassName("lat-dm-m")[0].value=y[0]}window.ELEMENT&&window.ELEMENT.Message({message:"转换成功",type:"success",duration:1500});for(var E=0;E<r.length;E++)r[E].style.display="block"})),0==e?(r[e].style.order=0,r[e].style.display="block",o.style.display="inline-block"):(r[e].style.order=1,r[e].style.display="none",o.style.display="none");case 8:case"end":return t.stop()}}),t)})),c=0;case 18:if(!(c<r.length)){t.next=23;break}return t.delegateYield(l(c),"t0",20);case 20:c++,t.next=18;break;case 23:for(u=s.getElementsByTagName("input"),p=0;p<u.length;p++)u[p].addEventListener("blur",(function(t){t.target.value||(t.target.value=0);var e=Number(t.target.value);t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.value=e}));h=[{name:"度",value:"度",key:0},{name:"度分",value:"度分",key:1},{name:"度分秒",value:"度分秒",key:2}],(d=Y(H._element.content.getElementsByClassName("input-select-box")[0],".input-select"))&&(d.legp_search(h),(m=H._element.content.getElementsByClassName("input-select")[0].getElementsByTagName("input")[0]).value=h[0].value,m.addEventListener("input",(function(){for(var t=0;t<h.length;t++)if(h[t].value===m.value){for(var e=0;e<r.length;e++){var i=r[e].getElementsByClassName("convert")[0];e==h[t].key?(r[e].style.order=0,r[e].style.display="block",i.style.display="inline-block"):(r[e].style.order=0===e?2:1,r[e].style.display="none",i.style.display="none")}break}})));case 28:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),q=function(){H&&H.close&&(H.close(),H=null)},X=function(){return _()((function t(e){k()(this,t),this.sdk=e,this.viewer=e.viewer,this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)}),[{key:"mouse_left",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"mouse_left_down",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_DOWN)}},{key:"mouse_left_up",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"mouse_move",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"mouse_right",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}},{key:"mouse_right_down",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN)}},{key:"mouse_right_up",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.handler&&this.handler.setInputAction((function(n){var o=e.getcartesian(n);(o||i)&&t(n,o)}),Cesium.ScreenSpaceEventType.RIGHT_UP)}},{key:"mouse_wheel",value:function(t){this.handler&&this.handler.setInputAction((function(){t()}),Cesium.ScreenSpaceEventType.WHEEL)}},{key:"getcartesian",value:function(t){var e=t.position||t.endPosition;t.position1&&t.position2&&(e={x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2});var i=this.viewer.scene.pickPosition(e);if(!i){for(var n=this.viewer.camera.getPickRay(e),o=this.viewer.scene.drillPickFromRay(n,10),s={},a=0;a<o.length;a++)if(o[a].position){s=o[a];break}(i=s.position)||(i=this.viewer.scene.globe.pick(n,this.viewer.scene))}return i}},{key:"mouse_right_keyboard_ctrl",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_start",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START)}},{key:"gesture_pinck_start_keyboard_ctrl",value:function(t){var e=this;this.handler&&this.handler.setInputAction((function(i){var n=e.getcartesian(i);n&&t(i,n)}),Cesium.ScreenSpaceEventType.PINCH_START,Cesium.KeyboardEventModifier.CTRL)}},{key:"gesture_pinck_end",value:function(t){this.handler&&this.handler.setInputAction((function(e){t()}),Cesium.ScreenSpaceEventType.PINCH_END)}},{key:"gesture_pinck_move",value:function(t){this.handler&&this.handler.setInputAction((function(t){}),Cesium.ScreenSpaceEventType.PINCH_MOVE)}},{key:"destroy",value:function(){this.handler&&this.handler.destroy(),this.handler=null}}])}(),Z=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"左键开始,右键结束",i=arguments.length>1?arguments[1]:void 0;k()(this,t),this.point=void 0,this.text=e,this.div=void 0,this.mouse_type=0,this.position=new Cesium.Cartesian3,this.viewer=i.viewer,this.create_tip(this.viewer)}),[{key:"set_text",value:function(t){this.div.getElementsByTagName("p")[0].innerText=t}},{key:"get_mouse_style",value:function(t){var e="";switch(t){case 1:e="move.png";break;default:e="arrow.png"}return"url(lib/img/"+e+"),auto"}},{key:"create_tip",value:function(t){this.create_tooltip()}},{key:"setPosition",value:function(t,e,i){this.position=t,this.move_tooltip(e,i)}},{key:"destroy",value:function(){this.viewer.entities.remove(this.point),this.remove_tooltip()}},{key:"create_tooltip",value:function(){var t=new fi;this.div=document.createElement("div");this.div.setAttribute("style","position: absolute;z-index: 777;color: #ec131a;left:10px;top:0px;pointer-events: none;");var e=document.createElement("p");e.style.margin="0px",e.style.padding="0px",e.innerText=this.text,this.div.appendChild(e);var i=document.createElement("div");i.style.width="12px",i.style.height="12px",i.style.background="url(".concat(t.getSourceRootPath()+"/img/point.png",") 100% 100% no-repeat"),i.style.backgroundSize="100% 100%",i.style.position="absolute",i.style.left="-36px",i.style.top="-4px",this.div.style.display="none",this.div.appendChild(i),t=null,document.querySelector("body").appendChild(this.div)}},{key:"style_tip",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t._element.style.cursor=this.get_mouse_style(e)}},{key:"remove_tooltip",value:function(){document.querySelector("body").contains(this.div)&&document.querySelector("body").removeChild(this.div)}},{key:"move_tooltip",value:function(t,e){var i=0,n=0;if(this.div.style.display="block",this.viewer&&this.viewer._element){var o=this.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];i=o.getBoundingClientRect().top+window.scrollY,n=o.getBoundingClientRect().left+window.scrollX}this.div.style.left=t+30+n+"px",this.div.style.top=e+i+"px"}}])}(),K=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new fi,o=new R,V&&V.close&&(V.close(),V=null),t.next=5,new W(e.viewer._container,{title:"投影转换",left:"180px",top:"100px",closeCallBack:function(){i&&i()}});case 5:return V=t.sent,t.next=8,V.init();case 8:'\n <span class="custom-divider"></span>\n <div style="width: 540px;display: flex;">\n <div class="row left" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">源坐标</span>\n <button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_left"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input left-x" type="number" title="">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input left-y" type="number" title="">\n </div>\n </div>\n </div>\n <div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">\n <button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>\n </div>\n <div class="row right" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">目标坐标</span>\n <button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_right"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input right-x" readonly="readonly">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input right-y" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',(l=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div style="width: 540px;display: flex;">\n <div class="row left" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;flex: 1;display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">源坐标</span>\n <button class="btn pick" style="margin-left: 20px;"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>坐标拾取</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_left"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input left-x" type="number" title="">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input left-y" type="number" title="">\n </div>\n </div>\n </div>\n <div style="display: flex;flex-direction: column;justify-content: center;margin: 28px 15px 0 15px;">\n <button class="btn convert">坐标转换<i style="margin-top: 2px;margin-left: 5px;" class="el-icon-right"></i></button>\n </div>\n <div class="row right" style="flex: 1;margin-bottom: 0;">\n <div style="margin: 10px 0;height: 32px; display: flex;align-items: center;flex: 1;justify-content: space-between;">\n <span class="lable-left-line">目标坐标</span>\n <button class="btn copy" data-clipboard-action="copy" data-clipboard-target=".input" style="margin-left: 20px;"><svg class="icon-copy"><use xlink:href="#yj-icon-copy"></use></svg>复制</button>\n </div>\n <div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">椭圆基准</span>\n <div class="datalist_right"></div>\n </div>\n <div style="display: flex;margin-bottom: 12px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">经度(x)</span>\n <input class="input right-x" readonly="readonly">\n </div>\n <div style="display: flex;margin-bottom: 10px;align-items: center;">\n <span class="label" style="flex: 0 0 60px;">纬度(y)</span>\n <input class="input right-y" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',V.contentAppChild(l),c=[],u=0,o.epsg_map.forEach((function(t,e){u++,c.push({name:"".concat(u,".  ").concat(e,"(").concat(t.name,")"),value:e})})),(p=Y(l.getElementsByClassName("left")[0],".datalist_left")).legp_search(c,!0),(h=Y(l.getElementsByClassName("right")[0],".datalist_right")).legp_search(c,!0),d=l.getElementsByClassName("pick")[0],m=l.getElementsByClassName("copy")[0],(f=l.getElementsByClassName("datalist_left")[0].getElementsByTagName("input")[0]).value=c[0].value,p.legp_searchActive(c[0].value),(v=l.getElementsByClassName("datalist_right")[0].getElementsByTagName("input")[0]).value=c[0].value,h.legp_searchActive(c[0].value),g=l.getElementsByClassName("convert")[0],y=l.getElementsByClassName("left-x")[0],b=l.getElementsByClassName("left-y")[0],C=l.getElementsByClassName("right-x")[0],w=l.getElementsByClassName("right-y")[0],d.addEventListener("click",(function(){s&&s.destroy(),r&&r.destroy(),s=new Z("左键选择起点坐标,右键取消",e),(r=new X(e)).mouse_move((function(t,e){s.setPosition(e,t.endPosition.x,t.endPosition.y)})),r.mouse_left((function(t,i){var a=n.cartesian3Towgs84(i,e.viewer);s&&s.destroy(),r&&r.destroy();var l=o.convert([{x:Number(a.lng),y:Number(a.lat)}],"EPSG:4326",f.value);0===l.code&&(y.value=l.points[0].x,b.value=l.points[0].y)})),r.mouse_right((function(t,e){s&&s.destroy(),r&&r.destroy()}))})),g.addEventListener("click",(function(){if(!y.value||!b.value)return C.value="",w.value="",void(window.ELEMENT&&window.ELEMENT.Message({message:"请输入源坐标",type:"warning",duration:1500}));var t=o.convert([{x:Number(y.value),y:Number(b.value)}],f.value,v.value);0===t.code?(C.value=t.points[0].x,w.value=t.points[0].y):window.ELEMENT&&window.ELEMENT.Message({message:t.message,type:"warning",duration:1500})})),new ClipboardJS(m,{text:function(t){if(C.value&&w.value){var e="".concat(C.value,",").concat(w.value);return e}C.value="",w.value="",window.ELEMENT&&window.ELEMENT.Message({message:"复制失败,目标坐标为空!",type:"warning",duration:1500})}}).on("success",(function(t){window.ELEMENT&&window.ELEMENT.Message({message:"已复制到剪切板",type:"success",duration:1500})}));case 36:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}(),$=function(){V&&V.close&&(V.close(),V=null)},Q=[new Map,new Map,new Map];Q[0].set("--color-sdk-base-rgb","0, 255, 255"),Q[0].set("--color-sdk-gradual","rgb(0, 255, 255) 6.25%, rgb(0, 200, 255) 100%"),Q[0].set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%"),Q[0].set("--color-sdk-text-shadow","rgba(20, 118, 255, 1)"),Q[1].set("--color-sdk-base-rgb","42, 200, 251"),Q[1].set("--color-sdk-gradual","rgb(42, 200, 251) 6.25%, rgb(42, 145, 251) 100%"),Q[1].set("--color-sdk-bg-gradual","#2ac8fb33 0%, #2ac8fb00 100%"),Q[1].set("--color-sdk-text-shadow","rgba(20, 63, 255, 1)"),Q[2].set("--color-sdk-base-rgb","187, 26, 41"),Q[2].set("--color-sdk-gradual","rgb(187, 26, 41) 6.25%, rgb(236, 20, 20) 100%"),Q[2].set("--color-sdk-bg-gradual","#bb1a2933 0%, #bb1a2900 100%"),Q[2].set("--color-sdk-text-shadow","rgba(246, 8, 30, 1)");var tt={};function et(t,e,i){if(t&&t.div_id){var n=ae().sdkD,o=document.getElementById(t.div_id).getElementsByClassName("cesium-viewer")[0],s=new fi;tt[t.div_id]||(tt[t.div_id]={}),tt[t.div_id].mousedown&&document.removeEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click&&document.removeEventListener("click",tt[t.div_id].click),tt[t.div_id].callBack||(tt[t.div_id].callBack=i),t!==n&&tt[t.div_id].mouseRightMenuEvent&&tt[t.div_id].mouseRightMenuEvent.destroy();var a=document.getElementById("custom-menu");a&&o.removeChild(a),tt[t.div_id].status=e,e&&(tt[t.div_id].mousedown=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("mousedown",tt[t.div_id].mousedown),tt[t.div_id].click=function(t){if(!(t.target.parentNode&&"custom-menu"==t.target.parentNode.id||t.target.parentNode&&t.target.parentNode.parentNode&&"custom-menu"==t.target.parentNode.parentNode.id)){var e=document.getElementById("custom-menu");e&&o.removeChild(e)}},document.addEventListener("click",tt[t.div_id].click),tt[t.div_id].mouseRightMenuEvent=new X(t),tt[t.div_id].mouseRightMenuEvent.mouse_right((function(e,i){if(!YJ.Measure.GetMeasureStatus()&&!t.viewer.trackedEntity){var n=t.viewer.entities.getById("svg-control-points_0");if(!n||!n.show){var a=document.getElementById("custom-menu");a&&o.removeChild(a);var r,l=function(e){var i=t.viewer.scene.pick(e.position);if(i)if(i.id){if(i.id.type&&"vector"===i.id.type&&i.id.parentId)return{parentId:i.id.parentId,id:i.id.id};if(i.id.id)return i.id.id;if("string"==typeof i.id)return i.id}else if(i.primitive&&i.primitive.id)return i.primitive.id}(e);"[object Object]"===Object.prototype.toString.call(l)&&(r=l.id,l=l.parentId);var c="",u=t.entityMap.get(l);if(!u&&l){var p=l.split("-");p.splice(p.length-1,1),l=p.join("-"),u=t.entityMap.get(l)}u&&u.picking&&(c='\n <span class="divider" style="display: block;border-top: 1px solid #ddd;margin: 5px;"></span>\n <ul class="added" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">属性</li>\n </ul>\n ');var h=s.cartesian3Towgs84(i,t.viewer);(a=document.createElement("div")).id="custom-menu",a.style.position="absolute",a.style.width="110px",a.style.backgroundColor="#00000085",a.style.color="#ffffff",a.style.padding="6px 0",a.style.boxShadow="4px 4px 4px 0px rgba(0, 0, 0, 0.8)",a.innerHTML='\n <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">绕鼠标点旋转</li>\n </ul>\n <ul class="base" style="list-style: none;padding: 0;margin: 0;font-size: 12px;">\n <li style="padding: 3px 10px;cursor: pointer;">文本框</li>\n </ul>\n '.concat(c,"\n "),o.appendChild(a);var d=e.position.x,m=e.position.y;e.position.x+a.offsetWidth>o.offsetWidth&&(d=e.position.x-a.offsetWidth),e.position.y+a.offsetHeight>o.offsetHeight&&(m=e.position.y-a.offsetHeight),a.style.left=d+"px",a.style.top=m+"px",a.addEventListener("contextmenu",(function(t){t.preventDefault()}));for(var f=a.getElementsByTagName("li"),v={},g=function(e){f[e].addEventListener("mouseover",(function(){f[e].style.backgroundColor="#5e5e5e"})),f[e].addEventListener("mouseout",(function(){f[e].style.backgroundColor="unset"})),f[e].addEventListener("click",(function(){var i="";switch(f[e].innerHTML){case"绕鼠标点旋转":v.position=h,i="rotateAround";break;case"属性":r?(v.id=r,v.parentId=u.options.id):v.id=u.options.id,i="attribute";break;case"文本框":v.position=h,i="textBox"}tt[t.div_id].callBack(i,v),o.removeChild(a)}))},y=0;y<f.length;y++)g(y)}}})))}}function it(t){return t&&t.div_id&&tt[t.div_id]?tt[t.div_id].status:void 0}var nt=null,ot=null,st=null,at=new Map,rt=new Map,lt=new Map;function ct(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function ut(t,e){e.endPosition&&(e.endPosition.y-=2);var i=e.position||e.endPosition,n=t.viewer.scene.pickPosition(i);if(!n){var o=t.viewer.camera.getPickRay(i);n=t.viewer.scene.globe.pick(o,t.viewer.scene)}return n}function pt(t,e){if(t&&t.viewer){var i=!0;(nt=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(n){var o=t.viewer.scene.pickPosition(n.position);if(!o){var s=t.viewer.camera.getPickRay(n.position);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(o){var a=ct(o,t.viewer);if(e&&e(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=at.size-1;l>=0;l--){var c=Array.from(at.keys())[l],u=at.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d<u.that.options.positions.length;d++)h.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);h.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([h]);if(turf.booleanPointInPolygon(p,m)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x<w.length;x++){var _=ct(w[x],t.viewer);k.push([_.lng,_.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M<D.length;M++){var O=ct(D[M],t.viewer);P.push([O.lng,O.lat])}var T=ct(D[0],t.viewer);P.push([T.lng,T.lat]);var N=turf.polygon([P]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var L=[u.that.options.center.lng,u.that.options.center.lat],A=u.that.options.radius/1e3,j=turf.circle(L,A,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,j)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var I=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(I,H)){u.callback(n,u.that.options.id,ct(ut(t,n),t.viewer),u.that),r=!0;break}}}}if(!r){var V=t.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var U=at.get(V.id.parentId);if(U.that.picking&&U.that.geojson)for(var W=0;W<U.that.geojson.features.length;W++)U.that.geojson.features[W].id===V.id._id&&U.callback(n,U.that.geojson.features[W].id,ct(ut(t,n),t.viewer),U.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&at.has(V.id.properties.id._value)){var J=at.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,ct(ut(t,n),t.viewer),J.that)}else if(at.has(V.id.id)){var q=at.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,ct(ut(t,n),t.viewer),q.that)}else if(G&&at.has(G)){var X=at.get(G);X.that.picking&&X.callback(n,G,ct(ut(t,n),t.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&at.has(V.id)){var Z=at.get(V.id);Z.callback(n,V.id,ct(ut(t,n),t.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&at.has(V.primitive.id)){var K=at.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(t)&&K.callback(n,V.primitive,ct(ut(t,n),t.viewer),K.that):K.callback(n,V.primitive.id,ct(ut(t,n),t.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&at.has(V.content.tileset.id)){var $=at.get(V.content.tileset.id);$.that.picking&&("bim"===$.that.type?YJ.Global.getBimPickStatus(t)&&$.callback(n,V.content.tileset,ct(ut(t,n),t.viewer),$.that):$.callback(n,V.content.tileset.id,ct(ut(t,n),t.viewer),$.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function ht(t){nt.destroy(),nt=null}function dt(t,e,i){at.set(t,{callback:e,that:i})}function mt(t,e,i){rt.set(t,{callback:e,that:i})}function ft(t,e,i){lt.set(t,{callback:e,that:i})}function vt(){if(nt)return!0}function gt(){if(ot)return!0}function yt(){if(st)return!0}var bt,Ct=new Map,wt=new Map,kt=new Map;function xt(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function _t(t,e){e.endPosition&&(e.endPosition.y-=2);var i=e.position||e.endPosition,n=t.viewer.scene.pickPosition(i);if(!n){var o=t.viewer.camera.getPickRay(i);n=t.viewer.scene.globe.pick(o,t.viewer.scene)}return n}function Et(t,e){if(t&&t.viewer){var i=!0;new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(n){var o=t.viewer.scene.pickPosition(n.position);if(!o){var s=t.viewer.camera.getPickRay(n.position);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(o){var a=xt(o,t.viewer);if(e&&e(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=Ct.size-1;l>=0;l--){var c=Array.from(Ct.keys())[l],u=Ct.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d<u.that.options.positions.length;d++)h.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);h.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([h]);if(turf.booleanPointInPolygon(p,m)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x<w.length;x++){var _=xt(w[x],t.viewer);k.push([_.lng,_.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M<D.length;M++){var O=xt(D[M],t.viewer);P.push([O.lng,O.lat])}var T=xt(D[0],t.viewer);P.push([T.lng,T.lat]);var N=turf.polygon([P]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var L=[u.that.options.center.lng,u.that.options.center.lat],A=u.that.options.radius/1e3,j=turf.circle(L,A,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,j)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var I=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(I,H)){u.callback(n,u.that.options.id,xt(_t(t,n),t.viewer),u.that),r=!0;break}}}}if(!r){var V=t.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var U=Ct.get(V.id.parentId);if(U.that.picking&&U.that.geojson)for(var W=0;W<U.that.geojson.features.length;W++)U.that.geojson.features[W].id===V.id._id&&U.callback(n,U.that.geojson.features[W].id,xt(_t(t,n),t.viewer),U.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&Ct.has(V.id.properties.id._value)){var J=Ct.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,xt(_t(t,n),t.viewer),J.that)}else if(Ct.has(V.id.id)){var q=Ct.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,xt(_t(t,n),t.viewer),q.that)}else if(G&&Ct.has(G)){var X=Ct.get(G);X.that.picking&&X.callback(n,G,xt(_t(t,n),t.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&Ct.has(V.id)){var Z=Ct.get(V.id);Z.callback(n,V.id,xt(_t(t,n),t.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&Ct.has(V.primitive.id)){var K=Ct.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(t)&&K.callback(n,V.primitive,xt(_t(t,n),t.viewer),K.that):K.callback(n,V.primitive.id,xt(_t(t,n),t.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&Ct.has(V.content.tileset.id)){var $=Ct.get(V.content.tileset.id);$.that.picking&&("bim"===$.that.type?YJ.Global.getBimPickStatus(t)&&$.callback(n,V.content.tileset,xt(_t(t,n),t.viewer),$.that):$.callback(n,V.content.tileset.id,xt(_t(t,n),t.viewer),$.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function St(t){t&&t.viewer&&new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()){var i,n=t.viewer.scene.pick(e.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=wt.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(e,o.that.geojson.features[s].id,xt(_t(t,e),t.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,wt.has(i)){var a=wt.get(i);if(a.that.picking){var r=_t(t,e);if(!r)return;a.callback(e,i,xt(r,t.viewer),a.that)}}if(n&&n.content&&wt.has(n.content.tileset.id)){var l=wt.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(t)){var c=_t(t,e);if(!c)return;l.callback(e,n.getProperty("id"),xt(c,t.viewer),l.that)}}else{var u=_t(t,e);if(!u)return;l.callback(e,n.content.tileset.id,xt(u,t.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}function Dt(t){new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){t.viewer.scene.pick(e.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}var Pt=!1,Mt="1:100万";function Ot(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){bt||(bt=new fi),(Pt=!!e)?Tt(t,Mt):Lt(t);var i=Ie();i&&(Pt?Tt(t,Mt):Lt(i));var n=ae().sdkD;n&&t!==n&&Ot(n,e)}}function Tt(t,e){Mt=e,Pt&&Bt(t);var i=Ie();return i&&Pt&&Bt(i),new Promise(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:setTimeout((function(){e()}),1e3);case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}function Nt(){return Pt}function Bt(t){Lt(t);var e,i,n=t.viewer.camera.positionCartographic,o={position:{lng:Cesium.Math.toDegrees(n.longitude),lat:Cesium.Math.toDegrees(n.latitude),alt:n.height}},s=t.viewer;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}for(var a=0;a<s.scene.primitives._primitives.length;a++)if("SheetIndexGridPrimitives"===s.scene.primitives._primitives[a].name){e=s.scene.primitives._primitives[a];for(var r=0;r<e._primitives.length;r++)if("SheetIndexLabelCollection"===e._primitives[r].name){i=e._primitives[r];break}break}e||((e=new Cesium.PrimitiveCollection).name="SheetIndexGridPrimitives",s.scene.primitives.add(e)),i||((i=new Cesium.LabelCollection).name="SheetIndexLabelCollection");var l=0,c=null;function u(t){i.removeAll(),e.removeAll(),(i=new Cesium.LabelCollection).name="SheetIndexLabelCollection",e.add(i);var n,o,s,a=h();switch(t){case"1:100万":n=6,o=4,s=new Cesium.NearFarScalar(2e7,1,8e7,0);break;case"1:50万":n=3,o=2,s=new Cesium.NearFarScalar(5e6,1,3e7,0);break;case"1:25万":n=1.5,o=1,s=new Cesium.NearFarScalar(23e5,1,2e7,0);break;case"1:10万":n=.5,o=1/3,s=new Cesium.NearFarScalar(68e4,1,5e6,0);break;case"1:5万":n=.25,o=1/6,s=new Cesium.NearFarScalar(385e3,1,24e5,0);break;case"1:2.5万":n=.125,o=1/12,s=new Cesium.NearFarScalar(18e4,1,12e5,0);break;case"1:1万":n=.0625,o=1/24,s=new Cesium.NearFarScalar(9e4,1,7e5,0);break;case"1:5000":n=.03125,o=1/48,s=new Cesium.NearFarScalar(46e3,1,3e5,0)}var r=Math.floor((180+Cesium.Math.toDegrees(a.west))/n)*n-180,l=Math.floor((88+Cesium.Math.toDegrees(a.south))/o)*o-88,u=Math.ceil((180+Cesium.Math.toDegrees(a.east))/n)*n-180,d=Math.ceil((88+Cesium.Math.toDegrees(a.north))/o)*o-88;if(r>u&&(u+=360),c={minLng:r,minLat:l,maxLng:u,maxLat:d},l<-88&&(l=-88),d>88&&(d=88),(c.maxLng-c.minLng)/n*((c.maxLat-c.minLat)/o)>7e3)c=null;else{for(var m=r;m<=u;m+=n){for(var f=[],v=[],g=l;Math.floor(1e9*g)/1e9<=d;g+=o/2)v.push([m,g]),f.push(Cesium.Cartesian3.fromDegrees(m,g,8848));88!=d&&d+o/2>=88&&f.push(Cesium.Cartesian3.fromDegrees(m,88,8848));var y=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:f,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});if(e.add(new Cesium.Primitive({geometryInstances:y,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})})),m<u)for(var b=l;b<d;b+=o){var C={lng:m+n/2,lat:b+o/2};if(C.lat>d)break;var w=p(C.lng,C.lat,t);i.add({position:Cesium.Cartesian3.fromDegrees(C.lng,C.lat,8848),text:w,font:"16px Inter, sans-serif",fillColor:Cesium.Color.fromCssColorString("#fcfc00"),pixelOffset:new Cesium.Cartesian2(0,0),showBackground:!1,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,scale:1,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,8e7),scaleByDistance:s})}}for(var k=l;Math.floor(1e9*k)/1e9<=d;k+=o){for(var x=[],_=[],E=r;E<=u;E+=n/2)_.push([E,k]),x.push(Cesium.Cartesian3.fromDegrees(E,k,8848));var S=new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:x,width:1,vertexFormat:Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,arcType:Cesium.ArcType.RHUMB})});e.add(new Cesium.Primitive({geometryInstances:S,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString("#fcfc00")})})}))}}}function p(t,e,i){var n,o;switch(i){case"1:100万":n=6,o=4;break;case"1:50万":n=3,o=2;break;case"1:25万":n=1.5,o=1;break;case"1:10万":n=.5,o=1/3;break;case"1:5万":n=.25,o=1/6;break;case"1:2.5万":n=.125,o=1/12;break;case"1:1万":n=.0625,o=1/24;break;case"1:5000":n=.03125,o=1/48}e=Math.max(-88,Math.min(88,e));var s,a=t,r=e=Math.abs(e),l=Math.floor(a/6+31),c="ABCDEFGHIJKLMNOPQRSTUV".charAt(Math.floor(r/4+1)-1),u={"1:100万":"","1:50万":"B","1:25万":"C","1:10万":"D","1:5万":"E","1:2.5万":"F","1:1万":"G","1:5000":"H"}[i];if(!u&&"1:100万"!==i)throw new Error("不支持的比例尺,请使用: 1:100万, 1:50万, 1:25万, 1:10万, 1:5万, 1:2.5万, 1:1万, 1:5000");s=c+l;var p=("000"+(Math.floor((4*Math.ceil(r/4)-r)/o)+1)).slice(-3),h=a-6*Math.floor(a/6),d=("000"+(Math.floor(h/n)+1)).slice(-3);switch(i){case"1:100万":return s;case"1:50万":case"1:25万":case"1:10万":case"1:5万":case"1:2.5万":case"1:1万":case"1:5000":break;default:throw new Error("不支持的比例尺")}return s+u+p+d}function h(){var t=s.camera.computeViewRectangle();if(2==s.scene.mode){var e=s.scene.canvas,i=new Cesium.Cartesian2(0,0),n=new Cesium.Cartesian2(e.clientWidth,e.clientHeight),o=s.scene.globe.ellipsoid,a=s.camera.pickEllipsoid(i,o),r=s.camera.pickEllipsoid(n,o);if(!a){var l=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:6356755});i.y=l.y+5,a=s.camera.pickEllipsoid(i,o)}if(!r){var c=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,{x:0,y:0,z:-6356755});n.y=c.y-5,r=s.camera.pickEllipsoid(n,o)}var u=s.scene.globe.ellipsoid.cartesianToCartographic(a),p=s.scene.globe.ellipsoid.cartesianToCartographic(r);return t=(n.y-i.y)/(n.x-i.x)<=.49998752339363695?new Cesium.Rectangle(Cesium.Math.toRadians(-180),Cesium.Math.toRadians(-90),Cesium.Math.toRadians(180),Cesium.Math.toRadians(90)):new Cesium.Rectangle(u.longitude,p.latitude,p.longitude,u.latitude)}return t}e.postRenderEvent=function(){var i=t.viewer.camera.positionCartographic.height;switch(Mt){case"1:100万":o.position.alt=16e6;break;case"1:50万":o.position.alt=5e6;break;case"1:25万":o.position.alt=23e5;break;case"1:10万":o.position.alt=68e4;break;case"1:5万":o.position.alt=385e3;break;case"1:2.5万":o.position.alt=18e4;break;case"1:1万":o.position.alt=9e4;break;case"1:5000":o.position.alt=46e3}if(i>5*o.position.alt)return c=null,void e.removeAll();var n=!1,s=h(),a=Cesium.Math.toDegrees(s.west),r=Cesium.Math.toDegrees(s.south),p=Cesium.Math.toDegrees(s.east);a>p&&(p+=360),s={minLng:a,minLat:r,maxLng:p,maxLat:Cesium.Math.toDegrees(s.north)},c?(c.minLng>s.minLng||c.minLat>s.minLat||c.maxLng<s.maxLng||c.maxLat<s.maxLat)&&Cesium.Math.toDegrees(t.viewer.camera.pitch)<0&&(n=!0):u(Mt),n?++l>=50&&(u(Mt),n=!1):l=0},o.complete=function(){s.scene.postRender.addEventListener(e.postRenderEvent)},Xe(t,o,.5)}function Lt(t){for(var e,i,n=t.viewer,o=0;o<n.scene.primitives._primitives.length;o++)if("SheetIndexGridPrimitives"===n.scene.primitives._primitives[o].name){e=n.scene.primitives._primitives[o];for(var s=0;s<e._primitives.length;s++)if("SheetIndexLabelCollection"===e._primitives[s].name){i=e._primitives[s];break}break}i&&i.removeAll(),e&&e.removeAll(),e&&n.scene.postRender.removeEventListener(e.postRenderEvent)}function At(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function jt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?At(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):At(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function It(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Rt(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Ft,zt,Ht,Vt,Gt=!1,Ut={},Wt=[],Yt=new Map;function Jt(){return(Jt=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Gt=!0,Ft||(Xt(e),Ee(e));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function qt(){if(Gt=!1,zt){Kt(-1,void 0,!0);var t=zt.viewer._element.getElementsByClassName("YJ-custom-slider")[0],e=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];t&&(zt.viewer._element.removeChild(t),zt.viewer._element.removeChild(e),zt.viewer._element.removeChild(i)),zt.viewer.scene.preRender.removeEventListener(oe,Ut),zt.viewer.imageryLayers.layerAdded.removeEventListener(Qt),zt.viewer.imageryLayers.layerMoved.removeEventListener(te),zt.viewer.imageryLayers.layerRemoved.removeEventListener(ee),zt.viewer.imageryLayers.layerShownOrHidden.removeEventListener(ie);for(var n=0;n<Wt.length;n++)Wt[n].destroy();if(Ft){var o=zt.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByClassName("cesium-widget")[1];zt.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].removeChild(o),Wt=[],Ft=null,Ht=null,Ut={}}var s=zt.viewer._element.getElementsByClassName("cesium-widget")[0],a=s.getElementsByTagName("canvas")[0];s.style.width="100%",a.style.width="100%";for(var r=zt.viewer._element.getElementsByClassName("billboard-attribute-box"),l=0;l<r.length;l++)r[l].style.display="block";zt=null}}function Xt(t){return Zt.apply(this,arguments)}function Zt(){return(Zt=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(C=function(t){var i,n,o=It(Yt);try{for(o.s();!(n=o.n()).done;){var s=y()(n.value,2),a=s[0],r=s[1];r?r.P&&r.D?i=0:(r.P&&(i=-1),r.D&&(i=1)):i=-1,e.entityMap.get(a)&&Kt(i,a)}}catch(t){o.e(t)}finally{o.f()}},b=function(t){if(e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0]===t.target||e.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0]===t.target||e.viewer._element.getElementsByClassName("cesium-widget")[1].getElementsByTagName("canvas")[0]===t.target){var i=t.offsetX;t.offsetX<60&&(i=60),t.target.width-t.offsetX<60&&(i=t.target.width-60),o.style.left=i/e.viewer._element.scrollWidth*100+"%",d.style.width=i/e.viewer._element.scrollWidth*100+"%",m.style.width=100/(i/e.viewer._element.scrollWidth)+"%",v.style.width=100*(1-i/e.viewer._element.scrollWidth)+"%",g.style.width=100/(1-i/e.viewer._element.scrollWidth)+"%",s.style.left="calc(".concat(i/e.viewer._element.scrollWidth*100,"% - 50px)"),r.style.right="calc(".concat(100*(1-i/e.viewer._element.scrollWidth),"% - 50px)")}},i=e.viewer._element.getElementsByClassName("billboard-attribute-box"),n=0;n<i.length;n++)i[n].style.display="none";if(e.entityMap.forEach((function(t,e){t.type&&"TrajectoryMotion"==t.type&&t.viewFollow&&(t.viewFollow=!1)})),o=e.viewer._element.getElementsByClassName("YJ-custom-slider")[0],s=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],r=e.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0],o&&(e.viewer._element.removeChild(o),e.viewer._element.removeChild(s),e.viewer._element.removeChild(r)),(o=document.createElement("div")).className="YJ-custom-slider",o.style.position="absolute",o.style.left="50%",o.style.top="0px",(s=document.createElement("input")).className="YJ-custom-checkbox-left",s.type="checkbox",s.style.position="absolute",s.style.left="calc(50% - 50px)",(r=document.createElement("input")).className="YJ-custom-checkbox-right",r.type="checkbox",r.style.position="absolute",r.style.right="calc(50% - 50px)",s.style.display="none",r.style.display="none",e.viewer._element.appendChild(s),e.viewer._element.appendChild(r),l=0,c=0,!Vt){t.next=43;break}u=0;case 32:if(!(u<Vt.length)){t.next=43;break}if((p=e.entityMap.get(Vt[u]))&&"terrain"!==p.type&&p.show&&"TextBox"!==p.type){t.next=36;break}return t.abrupt("continue",40);case 36:s.style.display="unset",r.style.display="unset",(h=Yt.get(Vt[u]))&&(h.P&&l++,h.D&&c++);case 40:u++,t.next=32;break;case 43:return zt=e,l||c||l++,s.checked=!!l,r.checked=!!c,s.addEventListener("change",(function(t){t.target.checked||r.checked||(r.checked=!0);for(var e=0;e<Vt.length;e++){var i=Yt.get(Vt[e]);(i=i||{}).P=t.target.checked,i.D=r.checked,Yt.set(Vt[e],i)}C()})),r.addEventListener("change",(function(t){t.target.checked||s.checked||(s.checked=!0);for(var e=0;e<Vt.length;e++){var i=Yt.get(Vt[e]);(i=i||{}).P=s.checked,i.D=t.target.checked,Yt.set(Vt[e],i)}C()})),o.addEventListener("mousedown",(function(){e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="e-resize",document.body.addEventListener("mousemove",b),o.addEventListener("mouseup",(function(){e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].style.cursor="unset",document.body.removeEventListener("mousemove",b)}))})),e.viewer._element.appendChild(o),d=e.viewer._element.getElementsByClassName("cesium-widget")[0],m=d.getElementsByTagName("canvas")[0],d.style.width="50%",d.style.left="0px",d.style.overflow="hidden",m.style.width="200%",Ht=0,f=new fi,t.next=61,new YJ.YJEarth(e.div_id);case 61:if(Ft=t.sent,!vt()){t.next=65;break}return t.next=65,new Et(Ft);case 65:if(!gt()){t.next=68;break}return t.next=68,new St(Ft);case 68:if(!yt()){t.next=71;break}return t.next=71,new Dt(Ft);case 71:return it(e)&&et(Ft,!0),Ft.viewer._element.style.display="none",(v=document.createElement("div")).className="cesium-widget cesium-widget-split",v.style.width="50%",v.style.position="absolute",v.style.right="0px",v.style.overflow="hidden",(g=Ft.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].getElementsByTagName("canvas")[0]).style.width="200%",g.style.position="absolute",g.style.right="0px",v.appendChild(g),e.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0].appendChild(v),document.getElementById(e.div_id).removeChild(Ft.viewer._element),t.next=88,ne();case 88:Ut={sdks:[e,Ft],tools:f},C(),e.viewer.scene.preRender.addEventListener(oe,Ut),e.viewer.imageryLayers.layerMoved.addEventListener(te),si(e)&&oi(Ft,!0),ri(e)&&ai(Ft,!0),Nt()&&Ot(Ft,!0);case 95:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Kt(t,e){return $t.apply(this,arguments)}function $t(){return($t=o()(a.a.mark((function t(e,i){var n,s,r,l,c,u,p,h,d,m,f,v,g=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=function(){return(v=o()(a.a.mark((function t(i,o){var s,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O,T;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={},(c=r.get(i))||c.show){t.next=4;break}return t.abrupt("return");case 4:if(!(u=l&&l.get(i))){t.next=42;break}t.t0=e,t.next=null===t.t0||void 0===t.t0||0===t.t0||"0"===t.t0?9:1===t.t0||"1"===t.t0?21:-1===t.t0||"-1"===t.t0?32:40;break;case 9:if(s.P=!0,s.D=!0,"TrajectoryMotion"===c.type)p=function(t){if(c.options.state=t,cancelAnimationFrame(c._requestAnimationFrameEventId),c.editObj&&(c.editObj.destroy(),c.editObj=null),c.TweenAnimate)if(clearTimeout(c.TweenAnimate.timeout),t)c.lineEdit=!1,c.TweenAnimate.isPlaying()?c.TweenAnimate.timeout=setTimeout((function(){c.TweenAnimate.resume()}),c.options.delay):c.TweenAnimate.delay(c.delay).start();else{var e=jt({},c.sdk.viewer.camera._position);c._requestAnimationFrameEventId=requestAnimationFrame((function t(){c.firstPersonView&&c.sdk.viewer.camera.setView({destination:jt({},e),orientation:{heading:c.sdk.viewer.camera.heading,pitch:c.sdk.viewer.camera.pitch,roll:c.sdk.viewer.camera.roll}}),c._requestAnimationFrameEventId=requestAnimationFrame(t)})),c.TweenAnimate.pause()}else if(t){var i=c.renewLinePositions(c.options.line.positions);c.modelMove(i)}},c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((h=c.state)&&p(!1),u.setMovePositionByDistance(c.TweenAnimate._object.distance),p(h));else if("vector"===c.type){if(c.entity)if(o)for(d=0;d<c.entity.entities.values.length;d++)c.entity.entities.values[d].id===o&&(c.entity.entities.values[d].show=!1!==c.entity.entities.values[d]._customShow);else for(m=0;m<c.entity.entities.values.length;m++)c.entity.entities.values[m].show=!1!==c.entity.entities.values[m]._customShow}else c.entity&&(c.entity.show=!0);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=c.textShow),c.label&&c.labelShow&&(c.labelShow=!0),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(f=0;f<u.entity.entities.values.length;f++)u.entity.entities.values[f].id===o&&(u.entity.entities.values[f].show=!1!==c.entity.entities.values[f]._customShow);else for(v=0;v<u.entity.entities.values.length;v++)u.entity.entities.values[v].show=!1!==c.entity.entities.values[v]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),"Explosion"===u.type&&(u.entity.imgIndex=c.entity.imgIndex),t.abrupt("break",40);case 21:if(s.P=!1,s.D=!0,"TrajectoryMotion"===c.type)c.entity&&(c.entity.show=!1),c.line&&(c.line.show=!1),c.realTimeLine&&(c.realTimeLine.show=!1);else if("vector"===c.type){if(c.entity)if(o)for(y=0;y<c.entity.entities.values.length;y++)c.entity.entities.values[y].id===o&&(c.entity.entities.values[y].show=!1);else for(g=0;g<c.entity.entities.values.length;g++)c.entity.entities.values[g].show=!1}else c.entity&&(c.entity.show=!1);if("PincerArrowObject"===c.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==c.type&&"StraightArrowObject"!==c.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&c.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"GroundSvg"===c.type&&c.text&&(c.text.show=!1,u.textShow=c.textShow),c.label&&(c.label.entity.show=!1),u.label&&(u.label.options.ground=!1),"vector"===u.type){if(u.entity)if(o)for(b=0;b<u.entity.entities.values.length;b++)u.entity.entities.values[b].id===o&&(u.entity.entities.values[b].show=!1!==c.entity.entities.values[b]._customShow);else for(C=0;C<u.entity.entities.values.length;C++)u.entity.entities.values[C].show=!1!==c.entity.entities.values[C]._customShow}else u.show=!0;return"TrajectoryMotion"===u.type&&(u.firstPersonView=c.firstPersonView),t.abrupt("break",40);case 32:if(s.P=!0,s.D=!1,"TrajectoryMotion"===c.type)c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0);else if("vector"===c.type){if(c.entity)if(o)for(w=0;w<c.entity.entities.values.length;w++)c.entity.entities.values[w].id===o&&(c.entity.entities.values[w].show=!1!==c.entity.entities.values[w]._customShow);else for(k=0;k<c.entity.entities.values.length;k++)c.entity.entities.values[k].show=!1!==c.entity.entities.values[k]._customShow}else c.entity&&(c.entity.show=!0);if("GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,u.textShow=!1),c.label&&c.labelShow&&(c.label.entity.show=!0),u.label&&(u.label.options.ground=!1),"terrain"===c.type)u.show=!0;else if("vector"===u.type){if(u.entity)if(o)for(x=0;x<u.entity.entities.values.length;x++)u.entity.entities.values[x].id===o&&u.entity.entities.values[x].id===o&&(u.entity.entities.values[x].show=!1);else for(_=0;_<u.entity.entities.values.length;_++)u.entity.entities.values[_].show=!1}else u.show=!1;return t.abrupt("break",40);case 40:t.next=120;break;case 42:E=Ut.tools.deepCopyObj(c.options),t.t1=e,t.next=null===t.t1||void 0===t.t1||0===t.t1||"0"===t.t1?46:1===t.t1||"1"===t.t1?75:-1===t.t1||"-1"===t.t1?100:120;break;case 46:return s.P=!0,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),t.next=52,new c.constructor(Ft,E);case 52:if(S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){t.next=63;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),c.TweenAnimate&&((D=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=D),t.next=72;break;case 63:if("glb"===S.type||!S.on){t.next=67;break}return"vector"===S.type&&(S.data=c.data),t.next=67,S.on();case 67:"Explosion"===S.type&&(S.entity.imgIndex=c.entity.imgIndex),"PincerArrowObject"===S.type&&c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance1/c.TweenAnimate._valuesEnd.distance1*c.spreadTime),"AttackArrowObject"!==S.type&&"StraightArrowObject"!==S.type||c.TweenAnimate&&!c.TweenAnimate._isPaused&&S.setSpreadProgressByTime(c.TweenAnimate._object.distance/c.TweenAnimate._valuesEnd.distance*c.spreadTime),"vector"===c.type&&S.load((function(){if(S.entity)if(o)for(var t=0;t<S.entity.entities.values.length;t++)S.entity.entities.values[t].id===o&&(S.entity.entities.values[t].show=!1!==c.entity.entities.values[t]._customShow);else for(var e=0;e<S.entity.entities.values.length;e++)S.entity.entities.values[e].show=!1!==c.entity.entities.values[e]._customShow})),c.entity&&(c.entity.show=!0);case 72:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S.textShow=c.textShow),c.label&&c.labelShow&&(c.label.entity.show=!0),t.abrupt("break",120);case 75:return s.P=!1,s.D=!0,E.show=!0,"layer"===c.type&&(E.layer_index=c.layer_index),t.next=81,new c.constructor(Ft,E);case 81:if(S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove),"TrajectoryMotion"!==c.type){t.next=92;break}c.entity&&c.modelShow&&(c.entity.show=!1),c.line&&c.lineShow&&(c.line.show=!1),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!1),c.TweenAnimate&&((P=c.state)&&(c.state=!1),S.setMovePositionByDistance(c.TweenAnimate._object.distance),c.state=P),t.next=97;break;case 92:if("glb"===S.type||!S.on){t.next=96;break}if("vector"===c.type&&(S.data=c.data,c.entity))for(M=0;M<c.entity.entities.values.length;M++)c.entity.entities.values[M].show=!1;return t.next=96,S.on();case 96:if("vector"===c.type){if(S.entity)if(o)for(O=0;O<S.entity.entities.values.length;O++)S.entity.entities.values[O].id===o&&(S.entity.entities.values[O].show=!1!==c.entity.entities.values[O]._customShow);else for(T=0;T<S.entity.entities.values.length;T++)S.entity.entities.values[T].show=!1!==c.entity.entities.values[T]._customShow}else c.entity&&(c.entity.show=!1);case 97:return"GroundSvg"===c.type&&c.text&&(c.text.show=!1,S.textShow=c.textShow),c.label&&(c.label.entity.show=!1),t.abrupt("break",120);case 100:if(s.P=!0,s.D=!1,"TrajectoryMotion"!==c.type){t.next=108;break}c.entity&&c.modelShow&&!c.firstPersonView&&(c.entity.show=!0),c.line&&c.lineShow&&(c.line.show=!0),c.realTimeLine&&c.realTimeRoute&&(c.realTimeLine.show=!0),t.next=117;break;case 108:if(c.entity&&(c.entity.show=!0),"terrain"!==c.type){t.next=117;break}return E.show=!0,t.next=113,new c.constructor(Ft,E);case 113:S=t.sent,c.onClick&&(S.onClick=c.onClick),c.onRightClick&&(S.onRightClick=c.onRightClick),c.onMouseMove&&(S.onMouseMove=c.onMouseMove);case 117:return"GroundSvg"===c.type&&c.text&&(c.text.show=c.textShow,S&&(S.textShow=!1)),c.label&&c.labelShow&&(c.label.entity.show=!0),t.abrupt("break",120);case 120:n||Yt.set(i,s);case 121:case"end":return t.stop()}}),t)})))).apply(this,arguments)},f=function(t,e){return v.apply(this,arguments)},n=g.length>2&&void 0!==g[2]&&g[2],s=g.length>3?g[3]:void 0,zt){t.next=6;break}return t.abrupt("return");case 6:if(r=zt.entityMap,l=Ft&&Ft.entityMap,!i){t.next=15;break}if((c=r.get(i))&&c.show){t.next=12;break}return t.abrupt("return");case 12:f(i,s),t.next=35;break;case 15:u=It(zt.entityMap),t.prev=16,u.s();case 18:if((p=u.n()).done){t.next=27;break}if(h=y()(p.value,2),d=h[0],(m=h[1])&&m.show){t.next=24;break}return t.abrupt("continue",25);case 24:f(d,s);case 25:t.next=18;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t.catch(16),u.e(t.t0);case 32:return t.prev=32,u.f(),t.finish(32);case 35:if(!n){t.next=37;break}return t.abrupt("return");case 37:case"end":return t.stop()}}),t,null,[[16,29,32,35]])})))).apply(this,arguments)}function Qt(t,e){Ft.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function te(t,e,i){for(var n,o=0;o<Ft.viewer.imageryLayers._layers.length;o++)if(Ft.viewer.imageryLayers._layers[o]._id===t._id){n=Ft.viewer.imageryLayers._layers[o];break}n&&(0===e?Ft.viewer.imageryLayers.lowerToBottom(n):e===Ft.viewer.imageryLayers._layers.length-1?Ft.viewer.imageryLayers.raiseToTop(n):e<i?e<Ft.viewer.imageryLayers._layers.length-1&&Ft.viewer.imageryLayers.lower(n):Ft.viewer.imageryLayers.raise(n))}function ee(t,e){var i=Ft.viewer.imageryLayers._layers[e];i&&Ft.viewer.imageryLayers.remove(i)}function ie(t,e,i){var n=Ft.viewer.imageryLayers._layers[e];n&&(n.show=i)}function ne(){var t=new Cesium.ScreenSpaceEventHandler(zt.viewer._element.getElementsByClassName("cesium-widget")[0]);t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),t.setInputAction((function(){Ht=0}),Cesium.ScreenSpaceEventType.WHEEL),Wt.push(t);var e=document.getElementById("distanceLegendDiv");function i(t){Ht=0}e.addEventListener("mousemove",i),Wt.push({destroy:function(){e.removeEventListener("mousemove",i)}});var n=new Cesium.ScreenSpaceEventHandler(zt.viewer._element.getElementsByClassName("cesium-widget")[1]);n.setInputAction((function(){Ht=1,ii(zt)}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){Ht=1,ii(zt)}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){Ht=1,ii(zt)}),Cesium.ScreenSpaceEventType.WHEEL),Wt.push(n)}function oe(){var t,e=this.sdks[Ht];0===Ht?t=this.sdks[1]:1===Ht&&(t=this.sdks[0]);var i=e.viewer.camera.position;t.viewer.camera.setView({destination:i,orientation:{heading:e.viewer.camera.heading,pitch:e.viewer.camera.pitch,roll:e.viewer.camera.roll}})}function se(t,e,i){if(zt&&Ft&&t===zt&&e){var n=Yt.get(e),o=zt.entityMap.get(e),s=Ft.entityMap.get(e);if(o){var a;if(n)n.P&&n.D?a=0:(n.P&&(a=-1),n.D&&(a=1));else{var r=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],l=t.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];"none"===r.style.display||"none"===l.style.display?a=-1:r.checked&&l.checked?a=0:(r.checked&&(a=-1),l.checked&&(a=1))}if(s)s.options=JSON.parse(JSON.stringify(o.options)),s.originalOptions=JSON.parse(JSON.stringify(o.options)),o.oldData&&(s.oldData=JSON.parse(JSON.stringify(o.oldData))),"TrajectoryMotion"===s.type&&(s.height=s.options.height),s.reset&&s.reset(),o.show?Kt(a,e,!1,i):s.show=!1;else{Kt(-1,e,!1,i)}}else s&&s.remove()}}function ae(){return{sdkP:zt,sdkD:Ft}}var re,le,ce,ue=new Map,pe=new Map,he=new Map;function de(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}function me(t,e){e.endPosition&&(e.endPosition.y-=2);var i=e.position||e.endPosition,n=t.viewer.scene.pickPosition(i);if(!n){var o=t.viewer.camera.getPickRay(i);n=t.viewer.scene.globe.pick(o,t.viewer.scene)}return n}function fe(t,e){if(t&&t.viewer){var i=!0;new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(n){var o=t.viewer.scene.pickPosition(n.position);if(!o){var s=t.viewer.camera.getPickRay(n.position);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(o){var a=de(o,t.viewer);if(e&&e(a),i&&(i=!1,setTimeout((function(){i=!0}),600),!YJ.Measure.GetMeasureStatus()&&o)){for(var r=!1,l=ue.size-1;l>=0;l--){var c=Array.from(ue.keys())[l],u=ue.get(c);if(u&&u.that)if("PolygonObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var p=turf.point([a.lng,a.lat]),h=[],d=0;d<u.that.options.positions.length;d++)h.push([u.that.options.positions[d].lng,u.that.options.positions[d].lat]);h.push([u.that.options.positions[0].lng,u.that.options.positions[0].lat]);var m=turf.polygon([h]);if(turf.booleanPointInPolygon(p,m)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}else if("AssembleObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var f=u.that.computeAssemble(u.that.options.positions,!0),v=turf.point([a.lng,a.lat]),g=[],y=0;y<f.length;y+=2)g.push([f[y],f[y+1]]);var b=turf.polygon([g]);if(turf.booleanPointInPolygon(v,b)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}else if("AttackArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=3){for(var C=turf.point([a.lng,a.lat]),w=u.that.computeAttackArrow(u.that.options.positions),k=[],x=0;x<w.length;x++){var _=de(w[x],t.viewer);k.push([_.lng,_.lat])}var E=turf.polygon([k]);if(turf.booleanPointInPolygon(C,E)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}else if("PincerArrowObject"===u.that.type){if(u.that.picking&&u.that.options.positions&&u.that.options.positions.length>=5){for(var S=turf.point([a.lng,a.lat]),D=u.that.computePincerArrow(u.that.options.positions),P=[],M=0;M<D.length;M++){var O=de(D[M],t.viewer);P.push([O.lng,O.lat])}var T=de(D[0],t.viewer);P.push([T.lng,T.lat]);var N=turf.polygon([P]);if(turf.booleanPointInPolygon(S,N)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}else if("CircleObject"===u.that.type){if(u.that.picking){var B=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius){var L=[u.that.options.center.lng,u.that.options.center.lat],A=u.that.options.radius/1e3,j=turf.circle(L,A,{steps:360,units:"kilometers"});if(turf.booleanPointInPolygon(B,j)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}}else if("SectorObject"===u.that.type&&u.that.picking){var I=turf.point([a.lng,a.lat]);if(u.that.options.center&&u.that.options.radius&&u.that.options.startAngle&&u.that.options.endAngle){for(var R=u.that.calSector(u.that.options.center,u.that.options.radius,u.that.options.startAngle,u.that.options.endAngle,void 0,!0),F=[],z=0;z<R.length;z++)F.push([R[z].lng,R[z].lat]);var H=turf.polygon([F]);if(turf.booleanPointInPolygon(I,H)){u.callback(n,u.that.options.id,de(me(t,n),t.viewer),u.that),r=!0;break}}}}if(!r){var V=t.viewer.scene.pick(n.position);if(V){if(V.id){var G;if(V.id.type&&"vector"===V.id.type&&V.id.parentId){var U=ue.get(V.id.parentId);if(U.that.picking&&U.that.geojson)for(var W=0;W<U.that.geojson.features.length;W++)U.that.geojson.features[W].id===V.id._id&&U.callback(n,U.that.geojson.features[W].id,de(me(t,n),t.viewer),U.that)}else if("string"==typeof V.id.id){var Y=V.id.id.split("-");Y.splice(Y.length-1,1),G=Y.join("-")}if(V.id.properties&&V.id.properties.id&&ue.has(V.id.properties.id._value)){var J=ue.get(V.id.properties.id._value);J.that.picking&&J.callback(n,V.id.properties.id._value,de(me(t,n),t.viewer),J.that)}else if(ue.has(V.id.id)){var q=ue.get(V.id.id);q.that.picking&&q.callback(n,V.id.id,de(me(t,n),t.viewer),q.that)}else if(G&&ue.has(G)){var X=ue.get(G);X.that.picking&&X.callback(n,G,de(me(t,n),t.viewer),X.that)}else if(V.primitive&&"string"==typeof V.id&&ue.has(V.id)){var Z=ue.get(V.id);Z.callback(n,V.id,de(me(t,n),t.viewer),Z.that)}}else if(V.primitive&&V.primitive.id&&ue.has(V.primitive.id)){var K=ue.get(V.primitive.id);K.that.picking&&("bim"===K.that.type?YJ.Global.getBimPickStatus(t)&&K.callback(n,V.primitive,de(me(t,n),t.viewer),K.that):K.callback(n,V.primitive.id,de(me(t,n),t.viewer),K.that))}if(V.content&&(!V.primitive||!V.primitive.id)&&ue.has(V.content.tileset.id)){var $=ue.get(V.content.tileset.id);$.that.picking&&("bim"===$.that.type?YJ.Global.getBimPickStatus(t)&&$.callback(n,V.content.tileset,de(me(t,n),t.viewer),$.that):$.callback(n,V.content.tileset.id,de(me(t,n),t.viewer),$.that))}}}}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}function ve(t){t&&t.viewer&&new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()){var i,n=t.viewer.scene.pick(e.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=pe.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(e,o.that.geojson.features[s].id,de(me(t,e),t.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,pe.has(i)){var a=pe.get(i);if(a.that.picking){var r=me(t,e);if(!r)return;a.callback(e,i,de(r,t.viewer),a.that)}}if(n&&n.content&&pe.has(n.content.tileset.id)){var l=pe.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(t)){var c=me(t,e);if(!c)return;l.callback(e,n.getProperty("id"),de(c,t.viewer),l.that)}}else{var u=me(t,e);if(!u)return;l.callback(e,n.content.tileset.id,de(u,t.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)}function ge(t){new Cesium.ScreenSpaceEventHandler(t.viewer.canvas).setInputAction((function(e){t.viewer.scene.pick(e.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}function ye(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return be(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?be(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Ce={},we=[];function ke(t){return xe.apply(this,arguments)}function xe(){return(xe=o()(a.a.mark((function t(e){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return le=e,ce=0,i=new fi,t.next=5,new YJ.YJEarth(e.div_id);case 5:return(n=t.sent).viewer._element.className="cesium-viewer 2d",Ot(n,Nt()),$e(n,{compass:!1,info:!1,frame:!1}),n.viewer.scene.mode=Cesium.SceneMode.SCENE2D,t.next=12,n;case 12:return re=t.sent,vt()&&fe(re),gt()&&ve(re),yt()&&ge(re),Fe(),Ce={sdks:[e,n],tools:i},t.next=20,Ae(e,0,Ce);case 20:return t.next=22,Ae(n,1,Ce);case 22:return t.next=24,Pe(e);case 24:for(e.viewer.scene.preRender.addEventListener(je,Ce),e.viewer.imageryLayers.layerAdded.addEventListener(Oe),e.viewer.imageryLayers.layerMoved.addEventListener(Te),e.viewer.imageryLayers.layerRemoved.addEventListener(Ne),e.viewer.imageryLayers.layerShownOrHidden.addEventListener(Be),(o=L()(e.viewer.imageryLayers._layers)).sort((function(t,e){return t._layerIndex-e._layerIndex})),re.viewer.imageryLayers.removeAll(),s=0;s<o.length;s++)r=re.viewer.imageryLayers.addImageryProvider(o[s].imageryProvider,o[s]._layerIndex),o[s]._id&&(r._id=o[s]._id),r.show=o[s].show,r.alpha=o[s].alpha,o[s]._objectState&&3==o[s]._showView&&(r.show=!1);si(e)&&oi(n,!0),ri(e)&&ai(n,!0),e.entityMap.forEach((function(t,e){2==t.showView&&(t.showView=2)}));case 36:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _e(){return(_e=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:re||(ke(e),qt());case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ee(t){t.viewer.scene.preRender.removeEventListener(je,Ce),t.viewer.imageryLayers.layerAdded.removeEventListener(Oe),t.viewer.imageryLayers.layerMoved.removeEventListener(Te),t.viewer.imageryLayers.layerRemoved.removeEventListener(Ne),t.viewer.imageryLayers.layerShownOrHidden.removeEventListener(Be);for(var e=0;e<we.length;e++)we[e].destroy();re&&(re.destroy(),we=[],re=null,le=null,ce=null,Ce={}),t.entityMap.forEach((function(t,e){t.showView&&(t.show=t.show)}))}function Se(t,e,i){return De.apply(this,arguments)}function De(){return(De=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e&&e.viewer&&e.viewer._element&&"cesium-viewer 2d"===e.viewer._element.className)){t.next=2;break}return t.abrupt("return");case 2:if(le&&re){t.next=4;break}return t.abrupt("return");case 4:if(o=le.entityMap,!i){t.next=39;break}if(!(s=o.get(i))){t.next=33;break}if(!(r=re.entityMap.get(i))){t.next=12;break}return t.next=12,r.remove();case 12:if(l=Ce.tools.deepCopyObj(s.options),"BillboardObject"===s.type&&(l.heightReference=1),"PolygonObject"===s.type&&(l.heightMode=0,l.height=0),s.type&&("tileset"===s.type||"bim"===s.type||"glb"===s.type||"layer"===s.type||"wallStereoscopic"===s.type)){t.next=31;break}return 3==s.showView&&(l.show=!1),"TextBox"===s.type&&(c=s.callback),t.next=20,new s.constructor(re,l,c);case 20:if((u=t.sent).onClick=s.onClick,u.onRightClick=s.onRightClick,u.onMouseMove=s.onMouseMove,"TrajectoryMotion"===s.type&&(s.firstPersonView=!1,s.TweenAnimate?((p=s.state)&&(s.state=!1),u.state?u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+1e-8),setTimeout((function(){u.setMovePositionByDistance(Number(s.TweenAnimate._object.distance.toFixed(8))+2e-8)}),500)}),500),s.state=p):setTimeout((function(){u.setMovePositionByDistance(1e-8),setTimeout((function(){u.setMovePositionByDistance(2e-8)}),500)}),500),s.viewFollow&&(u.viewFollow=!0)),"AttackArrowObject"!==s.type&&"StraightArrowObject"!==s.type||s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&u.setSpreadProgressByTime(s.TweenAnimate._object.distance/s.TweenAnimate._valuesEnd.distance*s.spreadTime),"PincerArrowObject"===s.type&&s.spreadState&&s.TweenAnimate&&s.TweenAnimate._object&&u.setSpreadProgressByTime(s.TweenAnimate._object.distance1/s.TweenAnimate._valuesEnd.distance1*s.spreadTime),!u.on||"glb"===u.type){t.next=31;break}return"vector"===u.type&&(u.data=s.data,u.load((function(){if(u.entity)for(var t=0;t<u.entity.entities.values.length;t++)u.entity.entities.values[t].show=!1!==s.entity.entities.values[t]._customShow}))),t.next=31,u.on();case 31:t.next=37;break;case 33:if(!(h=re.entityMap.get(i))){t.next=37;break}return t.next=37,h.remove();case 37:t.next=74;break;case 39:d=ye(re.entityMap),t.prev=40,d.s();case 42:if((m=d.n()).done){t.next=50;break}if(f=y()(m.value,2),v=f[0],f[1],!(g=re.entityMap.get(v))){t.next=48;break}return t.next=48,g.remove();case 48:t.next=42;break;case 50:t.next=55;break;case 52:t.prev=52,t.t0=t.catch(40),d.e(t.t0);case 55:return t.prev=55,d.f(),t.finish(55);case 58:b=ye(o),t.prev=59,w=a.a.mark((function t(){var e,i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y()(C.value,2),e[0],"BillboardObject"===(i=e[1]).type&&(i.options.heightReference=1),n=Ce.tools.deepCopyObj(i.options),i.type&&("tileset"===i.type||"bim"===i.type||"glb"===i.type||"layer"===i.type||"wallStereoscopic"===i.type)){t.next=25;break}return 3==i.showView&&(n.show=!1),t.next=7,re.entityMap.get(n.id);case 7:if(!(o=t.sent)){t.next=11;break}return t.next=11,o.remove();case 11:return"TextBox"===i.type&&(s=i.callback),t.next=14,new i.constructor(re,n,s);case 14:if((o=t.sent).onClick=i.onClick,o.onRightClick=i.onRightClick,o.onMouseMove=i.onMouseMove,"TrajectoryMotion"===i.type&&(i.firstPersonView=!1,i.TweenAnimate?((r=i.state)&&(i.state=!1),o.state?o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))):setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+1e-9),setTimeout((function(){o.setMovePositionByDistance(Number(i.TweenAnimate._object.distance.toFixed(8))+2e-9)}),1500)}),1500),i.state=r):setTimeout((function(){o.setMovePositionByDistance(1e-9),setTimeout((function(){o.setMovePositionByDistance(2e-9)}),1500)}),1500),i.viewFollow&&(o.viewFollow=!0)),"AttackArrowObject"!==i.type&&"StraightArrowObject"!==i.type||i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance/i.TweenAnimate._valuesEnd.distance*i.spreadTime),"PincerArrowObject"===i.type&&i.spreadState&&i.TweenAnimate&&i.TweenAnimate._object&&o.setSpreadProgressByTime(i.TweenAnimate._object.distance1/i.TweenAnimate._valuesEnd.distance1*i.spreadTime),!o.on||"glb"===i.type){t.next=25;break}return"vector"===o.type&&(o.data=i.data,o.load((function(){if(o.entity)for(var t=0;t<o.entity.entities.values.length;t++)o.entity.entities.values[t].show=!1!==i.entity.entities.values[t]._customShow}))),t.next=25,o.on();case 25:case"end":return t.stop()}}),t)})),b.s();case 62:if((C=b.n()).done){t.next=66;break}return t.delegateYield(w(),"t1",64);case 64:t.next=62;break;case 66:t.next=71;break;case 68:t.prev=68,t.t2=t.catch(59),b.e(t.t2);case 71:return t.prev=71,b.f(),t.finish(71);case 74:case"end":return t.stop()}}),t,null,[[40,52,55,58],[59,68,71,74]])})))).apply(this,arguments)}function Pe(t,e,i){return Me.apply(this,arguments)}function Me(){return(Me=o()(a.a.mark((function t(e,i,n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Se(e,i,n);case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Oe(t,e){re.viewer.imageryLayers.addImageryProvider(t.imageryProvider,e)}function Te(t,e,i){var n=re.viewer.imageryLayers._layers[i];n&&(0===e?re.viewer.imageryLayers.lowerToBottom(n):e===le.viewer.imageryLayers._layers.length-1?re.viewer.imageryLayers.raiseToTop(n):e<i?re.viewer.imageryLayers.lower(n):re.viewer.imageryLayers.raise(n))}function Ne(t,e){var i=re.viewer.imageryLayers._layers[e];i&&re.viewer.imageryLayers.remove(i)}function Be(t,e,i){}function Le(){return(Le=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(le){t.next=2;break}return t.abrupt("return");case 2:if(re){for(i=re.viewer.scene.primitives._primitives,n=le.viewer.scene.primitives._primitives,o=i.length-1;o>=1;o--){for(s=!1,r=n.length-1;r>=1;r--)n[r].id&&i[r].id&&n[r].id===i[o].id&&(s=!0);s||re.viewer.scene.primitives.remove(i[o])}for(l=n.length-1;l>=1;l--){for(c=!1,u=i.length-1;u>=1;u--)n[l].id&&i[l].id&&n[l].id===i[u].id&&(c=!0,i[u].show=n[l].show,i[u].startColor=n[l].startColor,i[u].endColor=n[l].endColor,i[u].minimumSpeed=n[l].minimumSpeed,i[u].maximumSpeed=n[l].maximumSpeed,i[u].minimumParticleLife=n[l].minimumParticleLife,i[u].maximumParticleLife=n[l].maximumParticleLife,i[u].startScale=n[l].startScale,i[u].endScale=n[l].endScale,i[u].emissionRate=n[l].emissionRate,i[u].particleSize=n[l].particleSize,i[u].modelMatrix=n[l].modelMatrix);c||re.viewer.scene.primitives.add(n[l])}}case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ae(t,e,i){var n=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas);n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.LEFT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.RIGHT_DOWN),n.setInputAction((function(){ce=e}),Cesium.ScreenSpaceEventType.WHEEL),we.push(n)}function je(){var t,e=this.sdks[ce];if(0===ce?t=this.sdks[1]:1===ce&&(t=this.sdks[0]),2===e.viewer.scene.mode)if(this.sdks[0].viewer.trackedEntity){var i=e.viewer.camera.positionCartographic.height;t.viewer.camera.lookAt(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,0),new Cesium.HeadingPitchRange(0,Cesium.Math.toRadians(-90),i))}else{this.sdks[1].viewer.trackedEntity&&(this.sdks[1].viewer.entities.remove(this.sdks[1].viewer.trackedEntity),this.sdks[1].viewer.trackedEntity=null);var n=this.tools.cartesian3Towgs84(Cesium.Cartesian3.fromRadians(e.viewer.camera.positionCartographic.longitude,e.viewer.camera.positionCartographic.latitude,e.viewer.camera.positionCartographic.height),e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt)})}else{var o=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));o||(o=e.viewer.camera.positionWC);var s=this.tools.cartesian3Towgs84(e.viewer.camera.positionWC,e.viewer).alt,a=this.tools.cartesian3Towgs84(o,e.viewer);t.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(a.lng,a.lat,s)})}}function Ie(){return re}function Re(){return le}function Fe(){re&&re.viewer.entities.add({show:!1,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([100,50,100.0001,50,100.0001,50.0001]))}})}function ze(){return{sdkP:le,sdkD:re}}function He(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ve(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Ge,Ue="EPSG:4326",We=!1,Ye={},Je={},qe={};function Xe(t,e){return Ze.apply(this,arguments)}function Ze(){return(Ze=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:3,o=new fi(e),r=i.orientation,!i.position){t.next=13;break}if(0===i.position.alt||i.position.alt){t.next=8;break}return t.next=7,o.getClampToHeight(i.position);case 7:i.position.alt=t.sent;case 8:l=0,r||(l=500),s=Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt+l),t.next=15;break;case 13:c=o.cal_envelope(i.positions),s=new Cesium.Rectangle(Cesium.Math.toRadians(c[3][0]),Cesium.Math.toRadians(c[3][1]),Cesium.Math.toRadians(c[1][0]),Cesium.Math.toRadians(c[1][1]));case 15:ii(e),e.viewer.camera.flyTo({destination:s,duration:n,orientation:r,complete:i.complete});case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ke(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&t.viewer){var i=t.viewer;i.scene.screenSpaceCameraController.enableRotate=e,i.scene.screenSpaceCameraController.enableTranslate=e,i.scene.screenSpaceCameraController.enableZoom=e,i.scene.screenSpaceCameraController.enableTilt=e,i.scene.screenSpaceCameraController.enableLook=e}}function $e(t,e){if(t&&t.viewer){Je[t.viewer._element.className]||(Je[t.viewer._element.className]={}),Je[t.viewer._element.className].event&&Je[t.viewer._element.className].event.destroy();var i=new fi(t),n=t.viewer._element,s=t.proj,r=function(){switch(l){case"compass":var r=n.getElementsByClassName("compass")[0],c=n.getElementsByClassName("navigation-controls")[0];e[l]?(r&&(r.style.display="block"),c&&(c.style.display="flex")):(r&&(r.style.display="none"),c&&(c.style.display="none"));break;case"legend":var u=n.getElementsByClassName("distance-legend")[0];e[l]?u&&(u.parentNode.style.display="block"):u&&(u.parentNode.style.display="none");break;case"info":var p=n.getElementsByClassName("cesium-info")[0];if(e[l]){var h=function(){var e=o()(a.a.mark((function e(){var n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ge){e.next=2;break}return e.abrupt("return");case 2:n=i.cartesian3Towgs84(Ge,t.viewer),"EPSG:4326"===Ue?p.innerHTML="\n <span>经度:</span><span>".concat(Number(n.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(n.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(n.alt.toFixed(2)),"米</span>\n "):(o=s.convert([{x:n.lng,y:n.lat,z:n.alt}],"EPSG:4326",Ue),p.innerHTML="\n <span>x:</span><span>".concat(Number(o.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(o.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(o.points[0].z.toFixed(6)),"</span>\n "));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();p?(h(),p.style.display="block"):((p=document.createElement("div")).className="cesium-info",p.style.position="absolute",p.style.bottom="32px",p.style.right="240px",p.style["font-size"]="14px",p.style["background-color"]="rgba(47,53,60,.8)",p.style.color="#fff",p.style.padding="4px 10px",p.style["border-radius"]="18px",p.innerHTML="EPSG:4326"===Ue?"\n <span>经度:</span><span>-</span>\n <span>纬度:</span><span>-</span>\n <span>海拔高度:</span><span>-</span>\n ":"\n <span>x:</span><span>-</span>\n <span>y:</span><span>-</span>\n <span>z:</span><span>-</span>\n ",t.viewer._element.appendChild(p));var d=new X(t);Je[t.viewer._element.className].event=d;d.mouse_move((function(t,e){Ge=e,h()}))}else p&&(p.style.display="none");break;case"frame":e[l]?(t.viewer.scene.debugShowFramesPerSecond=!0,setTimeout((function(){var e=t.viewer._element.getElementsByClassName("cesium-viewer-cesiumWidgetContainer")[0],i=e.getElementsByClassName("cesium-performanceDisplay-defaultContainer")[0];i&&e.appendChild(i)}),50)):t.viewer.scene.debugShowFramesPerSecond=!1}};for(var l in e)r()}}function Qe(t,e){e=e?"billboard_default_url_"+e:"billboard_default_url";var i=h();t.startsWith("http")||(t.includes(":")||i&&(t=new URL(t,i).href));localStorage.setItem(e,t)}function ti(t){return t=t?"billboard_default_url_"+t:"billboard_default_url",localStorage.getItem(t)}function ei(){return We}function ii(t){t&&t.viewer&&qe[t.viewer._element.className]&&(qe[t.viewer._element.className].animate&&TWEEN.remove(qe[t.viewer._element.className].animate),qe[t.viewer._element.className].event&&qe[t.viewer._element.className].event.destroy(),Ke(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))}function ni(t){if(t&&t.entityMap){var e,i=He(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"TrajectoryMotion"===o.type&&o.viewFollow&&(o.viewFollow=!1)}}catch(t){i.e(t)}finally{i.f()}}}function oi(t,e){if(t){var i,n=ae().sdkD;n&&t!==n&&oi(n,e);for(var o=0;o<t.viewer.imageryLayers._layers.length;o++)if(t.viewer.imageryLayers._layers[o]._imageryProvider&&t.viewer.imageryLayers._layers[o]._imageryProvider._type&&"flw"===t.viewer.imageryLayers._layers[o]._imageryProvider._type){i=t.viewer.imageryLayers._layers[o];break}i&&t.viewer.imageryLayers.remove(i),e&&t.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderFlw({tileWidth:128,tileHeight:128}))}}function si(t){for(var e=!1,i=0;i<t.viewer.imageryLayers._layers.length;i++)if(t.viewer.imageryLayers._layers[i]._imageryProvider&&t.viewer.imageryLayers._layers[i]._imageryProvider._type&&"flw"===t.viewer.imageryLayers._layers[i]._imageryProvider._type){e=!0;break}return e}function ai(t,e){if(t){var i,n=ae().sdkD;n&&t!==n&&ai(n,e);for(var o=0;o<t.viewer.imageryLayers._layers.length;o++)if(t.viewer.imageryLayers._layers[o]._imageryProvider&&t.viewer.imageryLayers._layers[o]._imageryProvider._type&&"jww"===t.viewer.imageryLayers._layers[o]._imageryProvider._type){i=t.viewer.imageryLayers._layers[o];break}i&&t.viewer.imageryLayers.remove(i),e&&t.viewer.imageryLayers.addImageryProvider(new Cesium.TileCoordinatesImageryProviderJww)}}function ri(t){for(var e=!1,i=0;i<t.viewer.imageryLayers._layers.length;i++)if(t.viewer.imageryLayers._layers[i]._imageryProvider&&t.viewer.imageryLayers._layers[i]._imageryProvider._type&&"jww"===t.viewer.imageryLayers._layers[i]._imageryProvider._type){e=!0;break}return e}function li(){return Ue}function ci(){var t=localStorage.getItem("ManageIndexexDBState");return"false"!==t&&Boolean(t)}function ui(t){"boolean"==typeof t?(Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetManageIndexexDBState(t),localStorage.setItem("ManageIndexexDBState",t)):console.error("参数必须为boolean")}function pi(t){!function(t){ce=t}(t),function(t){Ht=t}(t)}function hi(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return di(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?di(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function di(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function mi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var fi=function(){return _()((function t(e,i){k()(this,t),this.sdk=e,this.sdk&&(this.name_map=this.sdk.proj.name_map,this.epsg_map=this.sdk.proj.epsg_map,this.convert=this.sdk.proj.convert,this.getAllProjection=this.sdk.proj.getAllProjection,this.projectionIsExists=this.sdk.proj.projectionIsExists,this.degreesToDMS=this.sdk.proj.degreesToDMS,this.dmsToDecimal=this.sdk.proj.dmsToDecimal),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?mi(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},i)}),[{key:"POST",get:function(){return"POST"}},{key:"GET",get:function(){return"GET"}},{key:"degreesToRadians",value:function(t){return turf.degreesToRadians(Number(t))}},{key:"radiansToDegrees",value:function(t){return turf.radiansToDegrees(Number(t))}},{key:"randomString",value:function(t){return Cesium.createGuid()}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}},{key:"cartesian3Towgs84",value:function(t,e){var i=e.scene.globe.ellipsoid,n=new Cesium.Cartesian3(t.x,t.y,t.z),o=i.cartesianToCartographic(n),s=Cesium.Math.toDegrees(o.latitude);return{lng:Cesium.Math.toDegrees(o.longitude),lat:s,alt:o.height<0?0:o.height}}},{key:"computeDistance",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=O.length>0&&void 0!==O[0]?O[0]:[],i=O.length>1&&void 0!==O[1]?O[1]:2,n=O.length>2&&void 0!==O[2]?O[2]:"空间长度",!(e.length<2)){t.next=7;break}return t.abrupt("return",0);case 7:o=0,t.t0=n,t.next="空间长度"===t.t0?11:"投影长度"===t.t0?13:"地表长度"===t.t0?15:48;break;case 11:for(s=0;s<e.length-1;s++)r=Cesium.Cartesian3.fromDegrees(e[s].lng,e[s].lat,e[s].alt),l=Cesium.Cartesian3.fromDegrees(e[s+1].lng,e[s+1].lat,e[s+1].alt),c=Cesium.Cartesian3.distance(r,l),o+=c;return t.abrupt("break",49);case 13:for(u=0;u<e.length-1;u++)p=Cesium.Cartesian3.fromDegrees(e[u].lng,e[u].lat,0),h=Cesium.Cartesian3.fromDegrees(e[u+1].lng,e[u+1].lat,0),d=Cesium.Cartesian3.distance(p,h),o+=d;return t.abrupt("break",49);case 15:f=[],e.forEach((function(t){f.push([t.lng,t.lat,t.alt])})),v=turf.lineString(f),g=1e3*turf.length(v),m=g>20?g/20:g,y=this.chunkLine(e,m),b=[],y.forEach((function(t,e){0===e?b=L()(t.geometry.coordinates):b.push(t.geometry.coordinates[1])})),C=[],w=hi(b),t.prev=25,w.s();case 27:if((k=w.n()).done){t.next=37;break}return x=k.value,_=b.indexOf(x),t.next=32,this.sampleHeight({lng:x[0],lat:x[1],alt:0},_);case 32:(E=t.sent).position.alt=E.position.alt<0?0:E.position.alt,C.push(E);case 35:t.next=27;break;case 37:t.next=42;break;case 39:t.prev=39,t.t1=t.catch(25),w.e(t.t1);case 42:return t.prev=42,w.f(),t.finish(42);case 45:for(C.length,S=0;S<C.length-1;S++)D=Cesium.Cartesian3.fromDegrees(C[S].position.lng,C[S].position.lat,0),P=Cesium.Cartesian3.fromDegrees(C[S+1].position.lng,C[S+1].position.lat,0),M=Cesium.Cartesian3.distance(D,P),o+=M;return t.abrupt("break",49);case 48:return t.abrupt("break",49);case 49:return t.abrupt("return",o.toFixed(i));case 50:case"end":return t.stop()}}),t,this,[[25,39,42,45]])}))),function(){return i.apply(this,arguments)})},{key:"computeDistance2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.length<2)return 0;var n=0;if(i){var o=[];t.forEach((function(t){o.push([t.lng,t.lat,t.alt])}));var s=turf.lineString(o);n=1e3*turf.length(s)}else for(var a=0;a<t.length-1;a++){var r=Cesium.Cartesian3.fromDegrees(t[a].lng,t[a].lat,t[a].alt),l=Cesium.Cartesian3.fromDegrees(t[a+1].lng,t[a+1].lat,t[a+1].alt),c=Cesium.Cartesian3.distance(r,l);n+=c}return n.toFixed(e)}},{key:"sampleHeight",value:(e=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,i){return e.apply(this,arguments)})},{key:"computeArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(t.length<3)return 0;var i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.tesselate(n);return Number(turf.area(o).toFixed(e))}},{key:"computeSignedArea",value:function(t,e){for(var i=[],n=[],o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat),n.push([e[o].lng,e[o].lat]);var s,a=turf.lineString(n),r=turf.bbox(a),l=Cesium.Math.toRadians(r[2]-r[0]),c=Cesium.Math.toRadians(r[3]-r[1]);s=l>c?l/10:c/10;var u=new Cesium.PolygonGeometry.fromPositions({positions:Cesium.Cartesian3.fromDegreesArray(i),vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:s}),p=new Cesium.PolygonGeometry.createGeometry(u);if(!p||!p.attributes||!p.attributes.position)return 0;var h=p.indices,d=p.attributes.position.values;function m(e,i){var n=new Cesium.Cartesian3(d[3*i],d[3*i+1],d[3*i+2]);return t.scene.clampToHeight(n)||n}for(var f=0,v=0;v<h.length;v+=3){var g=m(0,h[v]),y=m(0,h[v+1]),b=m(0,h[v+2]),C=Cesium.Cartesian3.subtract(g,y,new Cesium.Cartesian3),w=Cesium.Cartesian3.subtract(b,y,new Cesium.Cartesian3),k=Cesium.Cartesian3.cross(C,w,C);f+=.5*Cesium.Cartesian3.magnitude(k)}return Number(f.toFixed(2))}},{key:"createCircle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:360};Number(e)<=0&&(e=.01);var n=[Number(t.lng),Number(t.lat)],o=turf.circle(n,e/1e3,i).geometry.coordinates[0],s=[];return o.forEach((function(t){s=s.concat(t)})),s}},{key:"createEllipse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{granularity:.1,semiMinorAxis:10,semiMajorAxis:20,bearing:0,height:0};e.granularity||(e.granularity=.1),e.height||(e.height=0),e.semiMinorAxis||(e.semiMinorAxis=1e-5),e.semiMajorAxis||(e.semiMajorAxis=1e-5);var i=new Cesium.EllipseOutlineGeometry({center:Cesium.Cartesian3.fromDegrees(Number(t.lng),Number(t.lat)),semiMajorAxis:Number(e.semiMajorAxis),semiMinorAxis:Number(e.semiMinorAxis),height:Number(e.height),granularity:Cesium.Math.toRadians(e.granularity),rotation:Cesium.Math.toRadians(e.bearing)}),n=Cesium.EllipseOutlineGeometry.createGeometry(i);if(!n||!n.attributes||!n.attributes.position)return[];for(var o=n.attributes.position.values,s=[],a=0;a<o.length;a+=3){var r=new Cesium.Cartesian3(o[a],o[a+1],o[a+2]);s.push(r)}return s}},{key:"rhumbBearing",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]);return turf.rhumbBearing(i,n)}},{key:"computeCenter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e),n=turf.center(i).geometry.coordinates;return{lng:n[0],lat:n[1]}}},{key:"computeMidpoint",value:function(t,e){var i=turf.point([t.lng,t.lat]),n=turf.point([e.lng,e.lat]),o=turf.midpoint(i,n).geometry.coordinates;return{lng:o[0],lat:o[1]}}},{key:"computeAttackArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t,0)}},{key:"computePincerArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.computeArrow(t)}},{key:"computeArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t.length<3)return[];for(var i,n=[],o=0;o<t.length;o++)n.push([t[o].lng,t[o].lat]);i=e?xp.algorithm.doubleArrow(n):xp.algorithm.tailedAttackArrow(n);var s=JSON.stringify(i.polygonalPoint).indexOf("null"),a=[];return-1===s&&(a=i.polygonalPoint),a}},{key:"computeAssemble",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];t.length;var i=new Array;if(t.forEach((function(t){i.push([t.lng,t.lat])})),2===i.length){var n=P.PlotUtils.mid(i[0],i[1]),o=P.PlotUtils.distance(i[0],n)/.9,s=P.PlotUtils.getThirdPoint(i[0],n,P.Constants.HALF_PI,o,!0);i=[i[0],s,i[1]]}var a=P.PlotUtils.mid(i[0],i[2]);i.push(a,i[0],i[1]);for(var r=[],l=void 0,c=void 0,u=void 0,p=[],h=0;h<i.length-2;h++){l=i[h],c=i[h+1],u=i[h+2];var d=P.PlotUtils.getBisectorNormals(.4,l,c,u);r=r.concat(d)}var m=r.length;r=[r[m-1]].concat(r.slice(0,m-1));for(var f=0;f<i.length-2;f++){l=i[f],c=i[f+1],p=p.concat(L()(l));for(var v=0;v<=P.Constants.FITTING_COUNT;v++){var g=P.PlotUtils.getCubicValue(v/P.Constants.FITTING_COUNT,l,r[2*f],r[2*f+1],c);p=p.concat(L()(g))}p=p.concat(L()(c))}return e?p:Cesium.Cartesian3.fromDegreesArray(p)}},{key:"computeStraightArrow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<2)return[];var i=[t[0].lng,t[0].lat],n=[t[1].lng,t[1].lat];if(t[0].lng===t[1].lng&&t[0].lat===t[1].lat){if(e)return[t[0],t[0],t[0]];var o=Cesium.Cartesian3.fromDegrees(t[0].lng,t[0].lat);return[o,o,o]}for(var s,a=[],r=0;r<t.length;r++)a.push([t[r].lng,t[r].lat]);if(s=xp.algorithm.fineArrow(i,n),e){for(var l=[],c=0;c<s.length;c++){var u=this.cartesian3Towgs84(s[c],this.sdk.viewer);l.push(u.lng,u.lat)}return l}return s}},{key:"getMaterial",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#2ab0c2",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o="",s={7:10,8:3,9:4,10:4,11:4,12:2};switch(i&&(s[e+""]?i.polyline.width=i.polyline.oriWidth+s[e+""]:i.polyline.width=i.polyline.oriWidth),Number(e)){case 1:o=new Cesium.PolylineDashMaterialProperty({color:Cesium.Color.fromCssColorString(t),dashLength:10});break;case 2:o=new Cesium.PolylineGlowMaterialProperty({glowPower:.2,color:Cesium.Color.fromCssColorString(t)});break;case 3:o=new Cesium.PolylineFlowMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 4:o=new Cesium.PolylineFlowMultMaterialProperty({color:t,speed:n.rotate?n.speed:0-n.speed,rotate:n.rotate});break;case 5:case 6:var a,r=this;o=new Cesium.FlowDashedLineFlowMaterialProperty({color:t,uType:5==e?0:1,speed:n.rotate?n.speed:0-n.speed,space:n.space,scale:new Cesium.CallbackProperty((function(){if(r.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var t=i.polyline.positions.getValue();if(!Cesium.defined(t))return 1;for(var e=0,n=0;n<t.length-1;++n)e+=Cesium.Cartesian3.distance(t[n],t[n+1]);var o=new Cesium.Cartesian2(0,r.sdk.viewer.canvas.clientHeight),s=new Cesium.Cartesian2(r.sdk.viewer.canvas.clientWidth/2,r.sdk.viewer.canvas.clientHeight),l=r.sdk.viewer.scene.pickPosition(o),c=r.sdk.viewer.scene.pickPosition(s);if(l&&c){var u=Cesium.Cartesian3.distance(l,c);a=2*u/e}return a}var p=Re(),h=p.viewer.entities.getById(r.options.id).polyline.positions.getValue();if(!Cesium.defined(h))return 1;for(var d=0,m=0;m<h.length-1;++m)d+=Cesium.Cartesian3.distance(h[m],h[m+1]);var f=new Cesium.Cartesian2(0,p.viewer.canvas.clientHeight),v=new Cesium.Cartesian2(p.viewer.canvas.clientWidth/2,p.viewer.canvas.clientHeight),g=p.viewer.scene.pickPosition(f),y=p.viewer.scene.pickPosition(v);if(g&&y){var b=Cesium.Cartesian3.distance(g,y);a=2*b/d}return a}))});break;case 7:case 8:case 9:case 10:case 11:case 12:var l={color:t,image:this.getSourceRootPath()+"/img/arrow/".concat(e-6,".png"),space:n.space,speed:n.speed};l.speed=n.rotate?l.speed:0-l.speed,this.getFlowTexture(this,l,i);break;default:o=Cesium.Color.fromCssColorString(t)}return o}},{key:"getFlowTexture",value:function(t,e,i){var n=document.createElement("canvas"),o=n.getContext("2d"),s=new Image;s.src=e.image,s.onload=function(){e.space=Math.max(.1,e.space),e.speed>0||0==e.speed?(n.width=s.width*(e.space+1),n.height=s.height,o.drawImage(s,s.width*(e.space/2),0)):(o.clearRect(0,0,n.width,n.height),n.width=s.width*(e.space+1),n.height=s.height,o.save(),o.translate(n.width/2,n.height/2),o.rotate(Math.PI),o.translate(-n.width/2,-n.height/2),o.drawImage(s,s.width*(e.space/2),0),o.restore());var a=0,r=0;i.polyline.material=new Cesium.LineTextureMaterialProperty({color:e.color,image:n,speed:e.speed,repeat:new Cesium.CallbackProperty((function(){if(t.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var o=i.polyline.positions.getValue(t.sdk.viewer.clock.currentTime);if(!Cesium.defined(o))return new Cesium.Cartesian2(1,1);for(var s=0,l=0;l<o.length-1;++l)s+=Cesium.Cartesian3.distance(o[l],o[l+1]);var c,u=s/i.polyline.width.getValue(),p=t.sdk.viewer.camera.positionCartographic.height,h=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),d=t.sdk.viewer.canvas.clientWidth,m=t.sdk.viewer.canvas.clientHeight,f=t.sdk.viewer.scene.camera.getPixelSize(h,d,m);if(f>700){var v=(u*=f/p/(e.space*(n.width/n.height*5)+1))/i.polyline.oriRepeat;i.polyline.oriSpeed=v,i.polyline.oriRepeatX=u,a=v,r=u,c=new Cesium.Cartesian2(u,v||1)}else c=new Cesium.Cartesian2(r||i.polyline.oriRepeatX,a||i.polyline.oriSpeed);return c}var g=Re(),y=g.viewer.entities.getById(t.options.id),b=y.polyline.positions.getValue(g.viewer.clock.currentTime);if(!Cesium.defined(b))return new Cesium.Cartesian2(1,1);for(var C=0,w=0;w<b.length-1;++w)C+=Cesium.Cartesian3.distance(b[w],b[w+1]);var k,x=C/y.polyline.width.getValue(),_=g.viewer.camera.positionCartographic.height,E=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),S=g.viewer.canvas.clientWidth,D=g.viewer.canvas.clientHeight,P=g.viewer.scene.camera.getPixelSize(E,S,D);if(P>700){var M=(x*=P/_/(e.space*(n.width/n.height*5)+1))/y.polyline.oriRepeat;y.polyline.oriSpeed=M,y.polyline.oriRepeatX=x,a=M,r=x,k=new Cesium.Cartesian2(x,M||1)}else k=new Cesium.Cartesian2(r||y.polyline.oriRepeatX,a||y.polyline.oriSpeed);return k}))});var l=t.getSceenLine(i,e,n);l&&(i.polyline.oriRepeat=l)}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/t.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(p,h,d);return m>700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"create_arrow1_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=150,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35,y:e.height-20},{x:e.width/2,y:e.height-20},{x:e.width/2,y:20},{x:e.width-35,y:20},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"create_arrow2_picture",value:function(t){var e=new fabric.Canvas("canvas");e.width=75,e.height=75;var i=t,n=new fabric.Polygon([{x:e.width,y:e.height/2},{x:e.width-35,y:e.height},{x:e.width-35-40,y:e.height},{x:e.width-40,y:e.height/2},{x:e.width-35-40,y:0},{x:e.width-35,y:0}],{fill:i});return e.add(n),e.toDataURL()}},{key:"sampleHeightMostDetailed",value:function(t){var e=[];return t.forEach((function(t){e.push(new Cesium.Cartographic.fromDegrees(t.lng,t.lat))})),this.sdk.viewer.scene.sampleHeightMostDetailed(e)}},{key:"flyHome",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE){var e=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.destination,i=this.sdk.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE.orientation;this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:t})}else this.sdk.viewer.camera.flyHome(t)}},{key:"setPickStatus",value:function(){}},{key:"create_point_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{steps:10},n=turf.point([Number(t.lng),Number(t.lat)]),o=turf.buffer(n,Number(e)/1e3,i);return o.geometry.coordinates}},{key:"create_line_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])}));var n=turf.lineString(i),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"create_area_buffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(1===t.length)return this.create_point_buffer(t[0],e);if(0===t.length)return!1;if(2===t.length)return this.create_line_buffer(t,e);var i=[];t.forEach((function(t){i.push([Number(t.lng),Number(t.lat)])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"cal_envelope",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!(t.length<2)){var e=[];t.forEach((function(t){e.push(turf.point([t.lng,t.lat]))}));var i=turf.featureCollection(e);return turf.envelope(i).geometry.coordinates[0]}console.error("坐标数量不能少于2个")}},{key:"chunkLine",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(t.length<2)return[];var i=[];t.forEach((function(t){i.push([t.lng,t.lat])}));var n=turf.lineString(i),o=turf.lineChunk(n,e/1e3),s=new Map;return o.features.forEach((function(t){t.geometry.coordinates.forEach((function(t){var e=t.join(","),i={lng:t[0],lat:t[1]};s.set(e,i)}))})),o.features}},{key:"billboardAnimation",value:function(t,e){var i=e.id,n=e.offset,o=void 0===n?10:n,s=(e.times,t.entities.getById(i));if(s){var a=Math.PI,r=a/60,l=0,c=this.cartesian3Towgs84(s.position.getValue(),t),u=setInterval((function(){l+=r;var t=o*Math.sin(l)+c.alt;l>a&&(l=0),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,t)}),30);setTimeout((function(){clearInterval(u),s.position=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt)}),3e3)}}},{key:"calSector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:45,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=turf.point([t.lng,t.lat]),r=turf.sector(a,e/1e3,i,n,{steps:o}).geometry.coordinates,l=[];return r.forEach((function(t){t.forEach((function(t){var e;e=s?{lng:t[0],lat:t[1]}:Cesium.Cartesian3.fromDegrees(t[0],t[1]),l.push(e)}))})),l}},{key:"getClampToHeight",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>1&&void 0!==c[1]?c[1]:[],this.sdk&&this.sdk.viewer){t.next=3;break}return t.abrupt("return",0);case 3:return n=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat),t.prev=4,t.next=7,this.sdk.viewer.scene.clampToHeight(n,i);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=n;case 10:o=t.t0,t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),o=n;case 16:return t.next=18,this.cartesian3Towgs84(o,this.sdk.viewer).alt;case 18:if(s=t.sent,r=0,t.prev=20,!this.sdk.viewer.scene.terrainProvider.availability){t.next=26;break}return t.next=24,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(e.lng,e.lat)]);case 24:(l=t.sent)[0].height&&(r=l[0].height);case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(20),r=0;case 31:if(!(s>r)){t.next=35;break}return t.abrupt("return",Number(s.toFixed(2)));case 35:return t.abrupt("return",Number(r.toFixed(2)));case 36:case"end":return t.stop()}}),t,this,[[4,13],[20,28]])}))),function(e){return t.apply(this,arguments)})},{key:"deepCopyObj",value:function(t){var e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)"earth"!=i&&"Dialog"!=i&&(e[i]=this.deepCopyObj(t[i]));else e=t;return e}},{key:"projConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?J(this.sdk,e):q()}},{key:"projectionConvert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t?K(this.sdk,e):$()}},{key:"exportExcel",value:function(t){var e="<Row>";for(var i in t[0])e+='<Cell><Data ss:Type="String">'.concat(i,"</Data></Cell>");e+="</Row>";for(var n,o='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',s=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},a="",r="",l=0;l<t.length;l++){for(var c in 0==l&&(r+=e),r+="<Row>",t[l])r+=s('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',{nameType:"String",data:t[l][c]});r+="</Row>",l>0&&l/6e4%1==0&&(a+=s(o,{rows:r,nameWS:"Sheet"+l}),r="",r+=e)}a+=s(o,{rows:r,nameWS:"Sheet"}),r="",n=s('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',{created:(new Date).getTime(),worksheets:a});var u,p=document.createElement("A");p.href="data:application/vnd.ms-excel;base64,"+(u=n,window.btoa(unescape(encodeURIComponent(u)))),p.download="矢量数据导出.xls",p.target="_blank",document.body.appendChild(p),p.click(),document.body.removeChild(p)}},{key:"decompressGzip",value:function(t){var e=pako.inflate(t);return(new TextDecoder).decode(e)}},{key:"cmykToRgb",value:function(t){var e=t.c,i=t.m,n=t.y,o=t.k,s={r:0,g:0,b:0};return s.c=e/100,s.m=i/100,s.y=n/100,s.k=o/100,s.r=1-Math.min(1,s.c*(1-s.k)+s.k),s.g=1-Math.min(1,s.m*(1-s.k)+s.k),s.b=1-Math.min(1,s.y*(1-s.k)+s.k),s.r=Math.round(255*s.r),s.g=Math.round(255*s.g),s.b=Math.round(255*s.b),"rgb(".concat(s.r,", ").concat(s.g,", ").concat(s.b,")")}},{key:"convertPxToRem",value:function(t,e){var i=parseFloat(getComputedStyle(document.documentElement).fontSize),n=[],o=[];if(e){n=document.getElementById(t.div_id).querySelectorAll(e);for(var s=0;s<n.length;s++){var a;(a=o).push.apply(a,[n[s]].concat(L()(n[s].querySelectorAll("*"))))}}else o=document.getElementById(t.div_id).querySelectorAll("*");o.forEach((function(t){var e=t.style;Array.from(e).filter((function(t){return"string"==typeof t&&t.endsWith("px")})).forEach((function(n){var o=parseFloat(e[n])/i;t.style[n]="".concat(o,"rem")}))}))}},{key:"isConvex",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.length,i=0,n=0,o=0;o<e;++o){var s=t[(o+1)%e].lng-t[o].lng,a=t[(o+2)%e].lng-t[(o+1)%e].lng,r=t[(o+1)%e].lat-t[o].lat,l=t[(o+2)%e].lat-t[(o+1)%e].lat;if(0!=(n=s*l-a*r)){if(n>0&&i<0||n<0&&i>0)return!1;i=n}}return!0}},{key:"getDateTimeString",value:function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)}},{key:"replaceHost",value:function(t,e){var i=t;if(!t||!e)return t;try{if(t.startsWith("http")){var n=/^[^@]+@/;n.test(t)&&(t=t.replace(n,"")),/^[a-z]+:\/\//i.test(t)||(t="http://"+t);var o=new URL(t),s=new URL(e),a=o.hostname,r=o.port;return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),"localhost"!==a&&"127.0.0.1"!==a||55110===parseInt(r,10)||(o.port=s.port,o.protocol=s.protocol,i=o.toString()),i}return t.includes(":")||this.options.host&&(i=new URL(t,this.options.host).href),i}catch(t){return i}}},{key:"message",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.type||"success",i=t.text||"",n=(t.duration,document.getElementById("YJ-custom-message"));n&&document.body.removeChild(n),n=document.createElement("div"),n.id="YJ-custom-message","success"==e?n.innerHTML='\n <i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755929961282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5064" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0" fill="#52C41A" p-id="5065"></path></svg></i>'.concat(i,"\n "):"warning"==e&&(n.innerHTML='\n <i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756093599258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1648" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512.002558 64.24521c-247.292176 0-447.75786 200.464661-447.75786 447.756837 0 247.287059 200.464661 447.752744 447.75786 447.752744 247.286036 0 447.75172-200.464661 447.75172-447.752744C959.754279 264.710894 759.288594 64.24521 512.002558 64.24521zM512.010745 735.87586c-20.602224 0-37.319977-16.718777-37.319977-37.323047 0-20.597107 16.717753-37.319977 37.319977-37.319977 20.60427 0 37.297464 16.72287 37.297464 37.319977C549.308209 719.158107 532.613992 735.87586 512.010745 735.87586zM549.308209 567.969733c0 20.600177-16.693194 37.293371-37.297464 37.293371-20.602224 0-37.319977-16.693194-37.319977-37.293371L474.690768 325.420581c0-20.605294 16.717753-37.297464 37.319977-37.297464 20.60427 0 37.297464 16.693194 37.297464 37.297464L549.308209 567.969733z" fill="#e98f36" p-id="1649"></path></svg></i>'.concat(i,"\n ")),document.body.appendChild(n),n.classList.add(e)}}],[{key:"_md5",value:function(t){return j()(t).toUpperCase()}}]);var t,e,i}();function vi(t,e){var i=t.viewer;if(i)for(var n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].entities.add(e);break}}function gi(t,e){for(var i=0;i<t.dataSources._dataSources.length;i++)if("sdk-dataSource1"===t.dataSources._dataSources[i].name){t.dataSources._dataSources[i].entities.remove(e);break}}function yi(){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t.color,this.duration=t.duration,this.fltr=t.fltr,this.image=t.image,this._time=(new Date).getTime()}Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:Cesium.createPropertyDescriptor("repeat"),color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(t){return"PolylineTrailLink"},t.prototype.getValue=function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrClonedDefault(this._color,t,Cesium.Color.BROWN,e.color),this.image?e.image=this.image:e.image=Cesium.Material.PolylineTrailLinkImage,this.duration&&(e.time=((new Date).getTime()-this._time)%this.duration/this.duration),!1===this.fltr?e.fltr=this.fltr:e.fltr=!0,e},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineTrailLinkMaterialProperty=t,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#fa2020",e=512,i=32,n=new fabric.Canvas("canvas",{width:e,height:i}),o=new fabric.Rect({width:e,height:i}),s=new fabric.Gradient({type:"linear",gradientUnits:"pixels",coords:{x1:0,y1:0,x2:e,y2:0},colorStops:[{offset:.01,color:"rgba(246,241,241,0)"},{offset:1,color:t}]});return o.set("fill",s),n.add(o),n.toDataURL()}(),Cesium.Material.PolylineTrailLinkSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material =czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image,vec2(fract(st.t - time), st.t));\n vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb/20.0;\n material.emission = fragColor.rgb;\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,1,1,1),image:Cesium.Material.PolylineTrailLinkImage,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(t){return!0}})}function bi(){var t,e,i,n,o,s,a,r;yi(),t=new fi,"undefined"!=typeof Cesium&&function(e){e.CustomMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random()),u={color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",time:i.time||0,repeat:new e.Cartesian2(100,100),fltr:!i.fltr&&!1!==i.fltr||i.fltr,is2D:!!i.is2D,isTranslucent:!i.isTranslucent&&!1!==i.isTranslucent||i.isTranslucent};if(this.code="",i.repeats)for(var p=e.Property.getValueOrDefault(i.repeats),h=0;h<p.length;h++)0!==h&&(this.code+="else "),u["repeat"+(h+1)]=new e.Cartesian2(p[h][1]*(p.length+3*(p.length-1)),p[h][2]),this.code+="if(materialInput.st.s < ".concat(p[h][0],") {\n repeat0 = repeat").concat(h+1,";\n }");function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeats=void 0,this._repeatSubscription=void 0,this.image=t.image,this.is2D=!!t.is2D,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat,this.repeats=t.repeats,this.duration=t.duration||0===t.duration?t.duration:1e3,this.fltr=!t.fltr&&!1!==t.fltr||t.fltr,this._time=(new Date).getTime()}return o(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),d.prototype.getType=function(t){return c},d.prototype.getValue=function(t,i){if(e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.time=this.duration?e.getTimestamp()%this.duration/this.duration:0,i.image=this.image,i.is2D=!!this.is2D,this.repeat&&(i.repeat=e.Property.getValueOrDefault(this.repeat)),this.repeats)for(var n=e.Property.getValueOrDefault(this.repeats),o=0;o<n.length;o++)i["repeat"+(o+1)]=new e.Cartesian2(n[o][1]*(n.length+3*(n.length-1)),n[o][2]);return i},d.prototype.equals=function(t){return this===t||t instanceof d&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)&&r.equals(this.repeats,t._repeats)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:u,source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n // vec2 repeat1 = materialInput.st.s < 0.5 ? vec2(100.0, 1.0) : vec2(200.0, 1.0);\n vec2 repeat0 = repeat;\n "+this.code+";\n vec2 st = repeat0 * materialInput.st;\n float f = -1.0;\n if(fltr==true) { f = 1.0; } \n vec4 colorImage = texture(image, vec2(fract(st.s - (time * f)), st.t));\n if(isTranslucent) {\n material.alpha = colorImage.a * color.a;\n }\n else {\n material.alpha = 1.0;\n }\n material.diffuse = colorImage.rgb * color.rgb*0.0;\n material.emission = colorImage.rgb * color.rgb * 1.0;\n return material;\n }",components:{specular:10,diffuse:"vec3(1.0)"}},translucent:function(t){return t.uniforms.isTranslucent}}),new d(i)}}(Cesium),e=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this.color=e.color,this.speed=e.speed,this.transparency=e.transparency}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.RadarScanMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e._speed)&&Cesium.Property.equals(this.transparency,e.transparency)}}])}(),Object.defineProperties(e.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),transparency:Cesium.createPropertyDescriptor("transparency")}),Cesium.RadarScanMaterialProperty=e,Cesium.Material.RadarScanMaterialProperty="RadarScanMaterialProperty",Cesium.Material.RadarScanMaterialType="RadarScanMaterialType",Cesium.Material.RadarScanMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float transparency;\n uniform float frameNumber;\n \n #define PI 3.14159265359\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec2 scrPt = st * 2.0 - 1.0;\n float time = frameNumber * speed / 30000.0 ;\n vec3 col = vec3(0.0);\n mat2 rot;\n float theta = -time * 1.0 * PI - 2.2;\n float cosTheta, sinTheta;\n cosTheta = cos(theta);\n sinTheta = sin(theta);\n rot[0][0] = cosTheta;\n rot[0][1] = -sinTheta;\n rot[1][0] = sinTheta;\n rot[1][1] = cosTheta;\n vec2 scrPtRot = rot * scrPt;\n float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\n float falloff = length(scrPtRot);\n material.alpha = pow(length(col + vec3(.5)),5.0) * transparency * 0.6;\n material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;\n return material;\n }\n \n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanMaterialType,{fabric:{type:Cesium.Material.RadarScanMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:10,transparency:1,frameNumber:Cesium.getTimestamp()},source:Cesium.Material.RadarScanMaterialSource},translucent:function(t){return!0}}),new fi,"undefined"!=typeof Cesium&&function(t){t.CustomColorMaterialSource=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(t.Color,t.defaultValue),n=Object.defineProperties,o=t.Event,s=t.createPropertyDescriptor,a=t.Property,r=t.Material,l=e.MaterialType||"wallType"+parseInt(1e3*Math.random());function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this.color=new t.Color.fromCssColorString(e.color||"rgba(4,253,231,0.87)")}return n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:s("color")}),c.prototype.getType=function(t){return l},c.prototype.getValue=function(e,i){return t.defined(i)||(i={}),i.color=t.Property.getValueOrClonedDefault(this._color,e,t.Color.WHITE,i.color),i},c.prototype.equals=function(t){return this===t||t instanceof c&&a.equals(this._color,t._color)},r._materialCache.addMaterial(l,{fabric:{type:l,uniforms:{color:new t.Color(1,1,1,1)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.alpha = color.a;\n \n material.diffuse = color.rgb*0.0;\n material.emission = color.rgb;\n return material;\n }",components:{specular:1,diffuse:"vec3(0.0)"}},translucent:function(t){return!0}}),new c(e)}}(Cesium),function(){var t=new fi;"undefined"!=typeof Cesium&&function(e){e.CustomImageMaterialSource=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.Color,e.defaultValue),o=Object.defineProperties,s=e.Event,a=e.createPropertyDescriptor,r=e.Property,l=e.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n(t,n.EMPTY_OBJECT),this._definitionChanged=new s,this._color=void 0,this._colorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.image=t.image,this.color=new e.Color.fromCssColorString(t.color||"rgba(4,253,231,0.87)"),this.repeat=t.repeat}return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},repeat:e.createPropertyDescriptor("repeat"),color:a("color")}),u.prototype.getType=function(t){return c},u.prototype.getValue=function(t,i){return e.defined(i)||(i={}),i.color=e.Property.getValueOrClonedDefault(this._color,t,e.Color.WHITE,i.color),i.image=this.image,i.repeat=e.Property.getValueOrDefault(this.repeat),i},u.prototype.equals=function(t){return this===t||t instanceof u&&r.equals(this._color,t._color)&&r.equals(this.repeat,t._repeat)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new e.Color(1,1,1,1),image:i.image||t.getSourceRootPath()+"/img/material/arrow.png",repeat:new e.Cartesian2(100,100)},source:"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture(image, st);\n \n material.diffuse = colorImage.rgb * 0.0;\n material.emission = colorImage.rgb * 0.3;\n return material;\n }"}}),new u(i)}}(Cesium)}(),i=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._duration=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.duration=e.duration||10,this.lineBackAlpha=e.lineBackAlpha||.05}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.duration=Cesium.Property.getValueOrDefault(this._duration,t,10,e.duration),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._duration,e.duration)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(i.prototype,{color:Cesium.createPropertyDescriptor("color"),duration:Cesium.createPropertyDescriptor("duration"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.FlowLineMaterialProperty=i,Cesium.Material.FlowLineMaterialProperty="FlowLineMaterialProperty",Cesium.Material.FlowLineMaterialType="FlowLineMaterialType",Cesium.Material.FlowLineMaterialSource="\n uniform vec4 color;\n uniform float duration;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n float time = fract(czm_frameNumber / (60.0*duration));\n //长度1/10\n time = time * (1.0 + 0.1);\n //平滑过渡函数\n float alpha = smoothstep(time-0.1,time,st.s) * step(-time,-st.s);\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowLineMaterialType,{fabric:{type:Cesium.Material.FlowLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),duration:10,lineBackAlpha:.05},source:Cesium.Material.FlowLineMaterialSource},translucent:function(t){return!0}}),n=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(n.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMaterialProperty=n,Cesium.Material.PolylineFlowMaterialProperty="PolylineFlowMaterialProperty",Cesium.Material.PolylineFlowMaterialType="PolylineFlowMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n //生成默认的基础材质\n czm_material material = czm_getDefaultMaterial(materialInput);\n //获取st(uv)\n vec2 st = materialInput.st;\n //获取当前帧数,10秒内变化0-1\n // float time = fract(czm_frameNumber * speed / 60.0);\n // float time = fract(abs(speed) * czm_frameNumber * 0.01);\n float time = fract(frameTime / 1000.0 / abs(speed));\n //长度1/10\n // time = time * (1.0 + 0.1);\n float staticAlpha = rotate?smoothstep(0.0,1.0, 1.0-st.s) * step(-1.0,-(1.0-st.s)):smoothstep(0.0,1.0, st.s) * step(-1.0,-st.s);\n\n //平滑过渡函数\n float alpha1 = smoothstep(time-0.1,time,1.0-st.s) * step(-time,- (1.0-st.s));\n float alpha2 = smoothstep(time-0.1,time,st.s) * step(-time,- st.s);\n float alpha =(speed== 0.0)? staticAlpha:(speed < 0.0)?alpha2:alpha1;\n //光带轨迹(不会完全透明)\n alpha += lineBackAlpha;\n material.alpha = alpha;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),o=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._rotate=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.lineBackAlpha=e.lineBackAlpha||.05,this.rotate=e.rotate}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.PolylineFlowMultMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.rotate=Cesium.Property.getValueOrDefault(this._rotate,t,!0,e.rotate),e.lineBackAlpha=this.lineBackAlpha,e.frameTime=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._rotate,e.rotate)&&Cesium.Property.equals(this.lineBackAlpha,e.lineBackAlpha)}}])}(),Object.defineProperties(o.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),rotate:Cesium.createPropertyDescriptor("rotate"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha")}),Cesium.PolylineFlowMultMaterialProperty=o,Cesium.Material.PolylineFlowMultMaterialProperty="PolylineFlowMultMaterialProperty",Cesium.Material.PolylineFlowMultMaterialType="PolylineFlowMultMaterialType",Cesium.Material.PolylineFlowMaterialSource="\n uniform vec4 color;\n uniform float speed;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n // 基础时间轴(控制主光带)\n float baseTime = fract(czm_frameNumber * speed / 60.0) * 1.1;\n\n // 高频时间轴(控制高光点)\n // float highlightTime = fract(czm_frameNumber * speed * 3.0 / 60.0);\n // float highlightTime = fract(abs(speed) * czm_frameNumber * 0.01);\n float highlightTime = fract(frameTime / 1000.0 / abs(speed));\n float highlightSpacing = 0.3; // 高光点间隔\n\n // 主光带透明度计算\n float mainAlpha = smoothstep(baseTime-0.1, baseTime, st.s) * step(-baseTime, -st.s);\n\n // 多高光点计算(3个周期性光斑)\n float highlight11 = smoothstep(highlightTime-0.05, highlightTime, st.s) *\n step(-highlightTime, -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - highlightTime)));\n\n float highlight21 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, st.s) *\n step(-(highlightTime+highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+highlightSpacing))));\n\n float highlight31 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -st.s) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight12 = smoothstep(highlightTime-0.05, highlightTime, 1.0 - st.s) *\n step(-highlightTime, -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - highlightTime)));\n\n float highlight22 = smoothstep(highlightTime+highlightSpacing-0.05,\n highlightTime+highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+highlightSpacing),-(1.0 - st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0-st.s - (highlightTime+highlightSpacing))));\n\n float highlight32 = smoothstep(highlightTime+2.0*highlightSpacing-0.05,\n highlightTime+2.0*highlightSpacing, 1.0 - st.s) *\n step(-(highlightTime+2.0*highlightSpacing), -(1.0-st.s)) *\n (1.0 - smoothstep(0.0, highlightSpacing, abs(1.0 - st.s - (highlightTime+2.0*highlightSpacing))));\n\n\n float highlight1 = !rotate?highlight11:highlight12;\n float highlight2 = !rotate?highlight21:highlight22;\n float highlight3 = !rotate?highlight31:highlight32;\n // 合并效果\n // material.alpha = mainAlpha * 0.7 +\n // (highlight1 + highlight2 + highlight3) * 0.5 +\n // lineBackAlpha;\n material.alpha = (highlight1 + highlight2 + highlight3) * 0.5 +\n lineBackAlpha;\n material.diffuse = color.rgb; // 高光区变亮\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineFlowMultMaterialType,{fabric:{type:Cesium.Material.PolylineFlowMultMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:.1,rotate:!0,frameTime:Cesium.getTimestamp(),lineBackAlpha:.05},source:Cesium.Material.PolylineFlowMaterialSource},translucent:function(t){return!0}}),s=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._color=void 0,this._speed=void 0,this._uType=void 0,this._space=void 0,this._dashSize=void 0,this._scale=void 0,this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.space=e.space||0,this.dashSize=e.dashSize||.03,this.uType=void 0===e.uType?1:e.uType,this.lineBackAlpha=e.lineBackAlpha||.05,this.scale=e.scale||1}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.FlowDashedLineMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.space=Cesium.Property.getValueOrDefault(this._space,t,10,e.space),e.dashSize=Cesium.Property.getValueOrDefault(this._dashSize,t,10,e.dashSize),e.uType=Cesium.Property.getValueOrDefault(this._uType,t,1,e.uType),e.scale=Cesium.Property.getValueOrDefault(this._scale,t,1,e.scale),e.lineBackAlpha=this.lineBackAlpha,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._speed,e.speed)&&Cesium.Property.equals(this._uType,e.uType)&&Cesium.Property.equals(this._lineBackAlpha,e.lineBackAlpha)&&Cesium.Property.equals(this._scale,e.scale)}}])}(),Object.defineProperties(s.prototype,{color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),space:Cesium.createPropertyDescriptor("space"),dashSize:Cesium.createPropertyDescriptor("dashSize"),uType:Cesium.createPropertyDescriptor("uType"),transparency:Cesium.createPropertyDescriptor("lineBackAlpha"),scale:Cesium.createPropertyDescriptor("scale")}),Cesium.FlowDashedLineFlowMaterialProperty=s,Cesium.Material.FlowDashedLineFlowMaterialProperty="FlowDashedLineFlowMaterialProperty",Cesium.Material.FlowDashedLineMaterialType="FlowDashedLineMaterialType",Cesium.Material.FlowDashedLineMaterialSource="\n uniform vec4 color;\n uniform float speed;\n // uniform int uType;\n uniform float lineBackAlpha;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dashSize = 0.1;\n float gapSize = space;\n // speed现在表示完成一次完整动画循环的秒数\n float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);\n float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));\n float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);\n float dash2 = smoothstep(0.0, 0.2, pattern) -\n smoothstep(1.0/(1.0 + gapSize),\n 1.0/(1.0 + gapSize) + 0.2,\n pattern);\n float dash = (float(uType) != 1.0)?dash1:dash2;\n material.alpha = dash;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.FlowDashedLineMaterialType,{fabric:{type:Cesium.Material.FlowDashedLineMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),speed:1,space:0,scale:1,dashSize:.03,frameNumber:Cesium.getTimestamp(),uType:1,lineBackAlpha:.05},source:Cesium.Material.FlowDashedLineMaterialSource},translucent:function(t){return!0}}),a=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._color=void 0,this._speed=void 0,this._repeat=void 0,this.image=e.image||"",this.color=new Cesium.Color.fromCssColorString(e.color||"rgba(255,255,255,1)"),this.speed=null!=e.speed?e.speed:1,this.repeat=e.repeat||new Cesium.Cartesian2(1,1)}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.LineTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,1,e.speed),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,new Cesium.Cartesian2(1,1),e.repeat),e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._color,e._color)&&Cesium.Property.equals(this._imageW,e._imageW)&&Cesium.Property.equals(this._speed,e._speed)}}])}(),Object.defineProperties(a.prototype,{image:Cesium.createPropertyDescriptor("image"),color:Cesium.createPropertyDescriptor("color"),speed:Cesium.createPropertyDescriptor("speed"),repeat:Cesium.createPropertyDescriptor("repeat")}),Cesium.LineTextureMaterialProperty=a,Cesium.Material.LineTextureMaterialProperty="LineTextureMaterialProperty",Cesium.Material.LineTextureMaterialType="LineTextureMaterialType",Cesium.Material.LineTextureMaterialSource="\n uniform vec4 color;\n uniform sampler2D image;\n uniform float speed;\n // uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat.x; // 关键:通过repeat控制纹理密度\n // vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));\n vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.LineTextureMaterialType,{fabric:{type:Cesium.Material.LineTextureMaterialType,uniforms:{color:new Cesium.Color(1,1,1,1),image:"",repeat:new Cesium.Cartesian2(1,1),speed:1,frameNumber:Cesium.getTimestamp(),uTime:1},source:Cesium.Material.LineTextureMaterialSource},translucent:function(t){return!0}}),r=function(){function t(e){k()(this,t),this._definitionChanged=new Cesium.Event,this._image=void 0,this._repeat=void 0,this._stRotation=void 0,this._repeatLength=void 0,this.image=e.image||"",this.repeat=e.repeat||1,this.stRotation=e.stRotation||0}return _()(t,[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return Cesium.Material.RoadTextureMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.image=Cesium.Property.getValueOrDefault(this._image,t,"",e.image),e.repeat=Cesium.Property.getValueOrDefault(this._repeat,t,1,e.repeat),e.stRotation=Cesium.Property.getValueOrDefault(this._stRotation,t,0,e.stRotation),console.log(e,"result"),e}},{key:"equals",value:function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._image,e._image)&&Cesium.Property.equals(this._repeat,e._repeat)&&Cesium.Property.equals(this._stRotation,e._stRotation)}}])}(),Object.defineProperties(r.prototype,{image:Cesium.createPropertyDescriptor("image"),repeat:Cesium.createPropertyDescriptor("repeat"),repeatLength:Cesium.createPropertyDescriptor("stRotation")}),Cesium.RoadTextureMaterialProperty=r,Cesium.Material.RoadTextureMaterialProperty="RoadTextureMaterialProperty",Cesium.Material.RoadTextureMaterialType="RoadTextureMaterialType",Cesium.Material.RoadTextureMaterialSource="\n uniform sampler2D image;\n uniform float repeat;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n st.s *= repeat;\n mat2 rot = mat2(cos(stRotation), -sin(stRotation), sin(stRotation), cos(stRotation));\n vec2 newSt = rot * (st - 0.5) + 0.5;\n\n vec4 colorImage = texture2D(image, newSt);\n material.diffuse = colorImage.rgb;\n return material;\n }\n ",Cesium.Material._materialCache.addMaterial(Cesium.Material.RoadTextureMaterialType,{fabric:{type:Cesium.Material.RoadTextureMaterialType,uniforms:{image:"",repeat:1,stRotation:0},source:Cesium.Material.RoadTextureMaterialSource},translucent:function(t){return!0}})}var Ci=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.playerUrl=i.url,this.init()}),[{key:"init",value:function(){this.flvPlayer=flvjs.createPlayer({type:"flv",url:this.playerUrl,isLive:!0,hasAudio:!1,hasVideo:!0},{enableWorker:!0,enableStashBuffer:!1,stashInitialSize:128}),this.flvPlayer.attachMediaElement(this.dom),this.flvPlayer.load()}},{key:"on",value:function(t,e,i){this.flvPlayer.on(flvjs[t][e],i)}},{key:"destroy",value:function(){this.flvPlayer.destroy(),this.flvPlayer=null}}])}(),wi=function(){return _()((function t(e,i){k()(this,t),this.dom=e,this.url=i.url,this.init()}),[{key:"init",value:function(){this.player=new Jessibuca({container:this.dom,decoder:this.getSourceRootPath()+"/3rdparty/jessibuca/decoder.js",timeout:30,heartTimeout:30,heartTimeoutReplay:!1,loadingTimeout:30,loadingTimeoutReplay:!1,wasmDecodeErrorReplay:!1,videoBuffer:.2,isResize:!1,text:"",loadingText:"",useMSE:!1,debug:!0,showBandwidth:!1,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,recorder:!1},forceNoOffscreen:!1,isNotMute:!1}),this.player.play(this.url)}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"destroy",value:function(){this.player.destroy(),this.player=null}},{key:"getSourceRootPath",value:function(){var t=document.querySelectorAll("script"),e="";return t.forEach((function(t){if(t.src&&t.src.indexOf("YJEarth.min.js")>-1){var i=t.src.split("/");i.pop(),e=i.join("/")}})),e}}])}();function ki(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function xi(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _i=/^[og]\s*(.+)?/,Ei=/^mtllib /,Si=/^usemtl /,Di=/^usemap /,Pi=/\s+/,Mi={red:1,green:1,blue:1,alpha:1};function Oi(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,o=this.object.geometry.vertices;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,o=this.object.geometry.normals;o.push(n[t+0],n[t+1],n[t+2]),o.push(n[e+0],n[e+1],n[e+2]),o.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){console.warn("addFaceNormal")},addColor:function(t,e,i){var n=this.colors,o=this.object.geometry.colors;void 0!==n[t]&&o.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&o.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&o.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,o=this.object.geometry.uvs;o.push(n[t+0],n[t+1]),o.push(n[e+0],n[e+1]),o.push(n[i+0],n[i+1])},addDefaultUV:function(){var t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,o,s,a,r,l){var c=this.vertices.length,u=this.parseVertexIndex(t,c),p=this.parseVertexIndex(e,c),h=this.parseVertexIndex(i,c);if(this.addVertex(u,p,h),this.addColor(u,p,h),void 0!==a&&""!==a){var d=this.normals.length;u=this.parseNormalIndex(a,d),p=this.parseNormalIndex(r,d),h=this.parseNormalIndex(l,d),this.addNormal(u,p,h)}else this.addFaceNormal(u,p,h);if(void 0!==n&&""!==n){var m=this.uvs.length;u=this.parseUVIndex(n,m),p=this.parseUVIndex(o,m),h=this.parseUVIndex(s,m),this.addUV(u,p,h),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i<n;i++){var o=this.parseVertexIndex(t[i],e);this.addVertexPoint(o),this.addColor(o)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var i=this.vertices.length,n=this.uvs.length,o=0,s=t.length;o<s;o++)this.addVertexLine(this.parseVertexIndex(t[o],i));for(var a=0,r=e.length;a<r;a++)this.addUVLine(this.parseUVIndex(e[a],n))}};return t.startObject("",!1),t}var Ti=function(){return _()((function t(e){k()(this,t),this.context=e}),[{key:"Load",value:function(t,e,i){var n=this;this.host=i,this.videoId=e;var o=t.substr(t.lastIndexOf("/")+1);return o=o.substring(0,o.lastIndexOf(".")),Cesium.Resource.fetchText(t).then((function(e){return n.Parse(e,t.substring(0,t.lastIndexOf("/")+1),o)}))}},{key:"Parse",value:function(t,e,i){var n=new Oi;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));for(var o=t.split("\n"),s=[],a=0,r=o.length;a<r;a++){var l=o[a].trimStart();if(0!==l.length){var c=l.charAt(0);if("#"!==c)if("v"===c){var u=l.split(Pi);switch(u[0]){case"v":n.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Cesium.Color.fromBytes(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),1,Mi),n.colors.push(Mi.red,Mi.green,Mi.blue)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":n.uvs.push(parseFloat(u[1]),parseFloat(u[2]))}}else if("f"===c){for(var p=l.slice(1).trim().split(Pi),h=[],d=0,m=p.length;d<m;d++){var f=p[d];if(f.length>0){var v=f.split("/");h.push(v)}}for(var g=h[0],y=1,b=h.length-1;y<b;y++){var C=h[y],w=h[y+1];n.addFace(g[0],C[0],w[0],g[1],C[1],w[1],g[2],C[2],w[2])}}else if("l"===c){var k=l.substring(1).trim().split(" "),x=[],_=[];if(-1===l.indexOf("/"))x=k;else for(var E=0,S=k.length;E<S;E++){var D=k[E].split("/");""!==D[0]&&x.push(D[0]),""!==D[1]&&_.push(D[1])}n.addLineGeometry(x,_)}else if("p"===c){var P=l.slice(1).trim().split(" ");n.addPointGeometry(P)}else if(null!==(s=_i.exec(l))){(" "+s[0].slice(1).trim()).slice(1);n.startObject(i)}else if(Si.test(l))n.object.startMaterial(l.substring(7).trim(),n.materialLibraries);else if(Ei.test(l))n.materialLibraries.push(l.substring(7).trim());else if(Di.test(l))console.warn('Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===c){if((s=l.split(" ")).length>1){var M=s[1].trim().toLowerCase();n.object.smooth="0"!==M&&"off"!==M}else n.object.smooth=!0;var O=n.object.currentMaterial();O&&(O.smooth=n.object.smooth)}else{if("\0"===l)continue;console.warn('Unexpected line: "'+l+'"')}}}n.finalize();var T=new Ai(this.context,this.hls,this.videoId,this.host,i);if(!0===!(1===n.objects.length&&0===n.objects[0].geometry.vertices.length))for(var N=0,B=n.objects.length;N<B;N++){var L=n.objects[N],A=L.geometry,j=L.materials;if(0!==A.vertices.length){for(var I=new Bi(this.context,A),R=0,F=j.length;R<F;R++){var z=j[R],H=z.name+"_"+z.smooth+"_",V=n.materials[H];z.mtllib=i+".mtl",void 0===V&&((V=new Ni(this.context,A,e,z.mtllib)).name=z.name,V.flatShading=!z.smooth,n.materials[H]=V),I.setMaterial(V)}I.name=L.name,T.add(I)}}return T}}])}(),Ni=function(){return _()((function t(e,i,n,s){var r=this;k()(this,t),this.context=e,this.ready=!1;var l=document.createElement("canvas");l.width=512,l.height=512,this.canvas=l;var c=Cesium.Resource.fetchText(n+s).then(function(){var t=o()(a.a.mark((function t(e){var i,o,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=[],o=e.split("\n"),l=0,c=o.length;case 3:if(!(l<c)){t.next=20;break}if(0!==(u=o[l].trimStart()).length){t.next=7;break}return t.abrupt("continue",17);case 7:if("map_Kd"!==u.split(" ")[0]){t.next=17;break}return u.split(" ")[1],p=s.replace(".mtl","_result.jpg"),t.t0=i,t.next=14,r.loadTexture(n+p);case 14:t.t1=t.sent,t.t2={diffusemap:t.t1},t.t0.push.call(t.t0,t.t2);case 17:l++,t.next=3;break;case 20:return t.abrupt("return",Promise.all(i));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),u="attribute vec3 position;\n",p="",h="",d=!1,m=!1,f=!1;i.normals.length>0&&(d=!0),i.colors.length>0&&(m=!0),!0===i.hasUVIndices&&(f=!0),d&&(u+="attribute vec3 normal;\n",u+="varying vec3 v_normal;\n",p+="varying vec3 v_normal;\n",h+="v_normal = normal;\n"),m&&(u+="attribute vec3 color;\n",u+="varying vec2 v_color;\n",p+="varying vec2 v_color;\n",h+="v_color = color;\n"),f&&(u+="attribute vec2 uv;\n",u+="varying vec2 v_uv;\n",p+="varying vec2 v_uv;\n",h+="v_uv = uv;\n"),u+="\n void main() {\n gl_Position = czm_modelViewProjection * vec4(position, 1.);\n ".concat(h,"\n }\n "),p+="\n\t\tuniform sampler2D colorTexture;\n void main() {\n\t\t\t vec4 color = texture2D(colorTexture, v_uv);\n\t\t\t\t\t\tgl_FragColor = color;\n }\n ",this.program=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:u,fragmentShaderSource:p}),this.uniformMap={};var v=this;c.then((function(t){for(var e=function(){var e=t[i].diffusemap;r.uniformMap.colorTexture=function(){return e}},i=0;i<t.length;i++)e();v.ready=!0}))}),[{key:"updateColorTexture",value:function(t,e,i){if(this.ready){var n=this.uniformMap.colorTexture();if(t.playing&&t.timeupdate&&(e!==n.width||i!==n.height)){n.destroy(),this.canvas.width=1280,this.canvas.height=960,this.canvas.getContext("2d").drawImage(t.dom,0,0,1280,960,0,0,this.canvas.width,this.canvas.height);var o=new Cesium.Texture({context:this.context,source:this.canvas});this.uniformMap.colorTexture=function(){return o}}}}},{key:"setCommand",value:function(t){t.shaderProgram=this.program,t.uniformMap=this.uniformMap}},{key:"loadTexture",value:function(t){var e=this;return Cesium.Resource.fetchImage(t).then((function(t){return e.canvas.width=t.width,e.canvas.height=t.height,e.canvas.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,e.canvas.width,e.canvas.height),new Cesium.Texture({context:e.context,source:e.canvas,sampler:Cesium.Sampler.NEAREST})}))}}])}(),Bi=function(){return _()((function t(e,i){k()(this,t),this.lastState=!1,this.name=void 0,this.geometry=i;var n=[],o=0;this.material=void 0;var s=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.vertices),usage:Cesium.BufferUsage.STATIC_DRAW});if(n.push({index:o,enabled:!0,vertexBuffer:s,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),i.normals.length>0){o++;var a=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.normals),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:a,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(i.colors.length>0){o++;var r=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.colors),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:r,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1})}if(!0===i.hasUVIndices){o++;var l=Cesium.Buffer.createVertexBuffer({context:e,typedArray:Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT,i.uvs),usage:Cesium.BufferUsage.STATIC_DRAW});n.push({index:o,enabled:!0,vertexBuffer:l,componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1})}var c=new Cesium.VertexArray({context:e,attributes:n}),u=Cesium.RenderState.fromCache({cull:{enabled:!1},depthMask:!0,depthTest:{enabled:!0}});this.drawCommand=new Cesium.DrawCommand({owner:this,primitiveType:Cesium.PrimitiveType.TRIANGLES,vertexArray:c,renderState:u,pass:Cesium.Pass.OPAQUE})}),[{key:"setMaterial",value:function(t){this.material=t,t.setCommand(this.drawCommand)}},{key:"update",value:function(t){Cesium.defined(this.material)&&this.material.ready&&t.commandList.push(this.drawCommand)}},{key:"updateVideo",value:function(t,e,i){var n=!1;if(Cesium.defined(this.material)&&this.material.ready)if(i.computeVisibility(this.drawCommand.boundingVolume)>=0&&this.material.ready){var o=t.distanceToBoundingSphere(this.drawCommand.boundingVolume),s=e.width,a=e.height;o>=20&&o<100?(s=e.width/2,a=e.height/2):o>=100&&(s=e.width/10,a=e.height/10),n=!0,this.material.updateColorTexture(e,Math.floor(s),Math.floor(a))}else n=!1;this.lastState=n}}])}(),Li=new WeakMap,Ai=function(){return _()((function t(e,i,n,o,s){k()(this,t),ki(this,Li,!0),this.context=e,this.videoId=n,this.host=o,this._modelMatrix=Cesium.Matrix4.IDENTITY,this.parent=null,this.children=[],this.video={dom:null,playing:!1,timeupdate:!1,width:0,height:0,tracks:null},this.time=0,this.name=s}),[{key:"show",get:function(){return e=this,(t=Li).get(xi(t,e));var t,e},set:function(t){var e,i,n;"boolean"==typeof t?(i=this,n=t,(e=Li).set(xi(e,i),n),t?this.video.player&&this.video.player.getVueInstance().play():this.video.player&&this.video.player.getVueInstance().pause()):console.error("参数必须为boolean")}},{key:"requestVideoResource",value:function(){var t=this,e="",i=(e=this.host.endsWith("yjearth4.0")?this.host:this.host+"/yjearth4.0")+"/videoFusion/"+this.videoId;return fetch(i,{method:"get",headers:{"Content-Type":"application/json"}}).then(function(){var i=o()(a.a.mark((function i(n){var s;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,n.text();case 2:if(s=i.sent,s=JSON.parse(s),![0,200].includes(s.code)){i.next=13;break}if(!s.data.deviceCode.length){i.next=9;break}return i.abrupt("return",fetch(e+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:s.data.deviceCode}),headers:{"Content-Type":"application/json"}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=9;break}return n.data.url.length?(t.video.player.url=n.data.url,t.setFlvVideo(n.data.url)):console.warn("地址不存在"),e.abrupt("return");case 9:return console.warn(n.msg||n.message),e.abrupt("return");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return i.abrupt("return");case 13:return console.warn(s.msg||s.message),i.abrupt("return");case 15:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())}},{key:"modelMatrix",get:function(){return this._modelMatrix},set:function(t){this._modelMatrix=t.clone(),this.updateModelMatrix()}},{key:"updateModelMatrix",value:function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];e.drawCommand.modelMatrix=this._modelMatrix;var i=Cesium.BoundingSphere.fromVertices(e.geometry.vertices),n=Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,i.center,new Cesium.Matrix4);i.center=Cesium.Matrix4.getTranslation(n,new Cesium.Cartesian3),e.drawCommand.boundingVolume=i}}},{key:"setPosition",value:function(t){Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,t,this._modelMatrix),this.updateModelMatrix()}},{key:"add",value:function(t){t.parent=this,this.children.push(t)}},{key:"update",value:function(t){if(this.show)for(var e=0;e<this.children.length;e++){this.children[e].update(t)}}},{key:"setVideo",value:function(t){var e=this;if(this.video.playing=!1,this.video.timeupdate=!1,t){/^.+\.m3u8$/.test(t);var i="video_"+Cesium.createGuid(),n=document.createElement("div");n.setAttribute("id",i),n.style.display="none",this.video.parentDom=n;var o=this,s=new WasmPlayer(null,n,(function(t){if("play"===t){var e=n.getElementsByTagName("video")[0],i=n.getElementsByTagName("canvas")[0];if(e&&i)setTimeout((function(){s.play()}),1e3);else if(e){o.video.dom=e,o.video.width=e.videoWidth,o.video.height=e.videoHeight,o.video.playing=!0;for(var a=new Cesium.Texture({context:o.context,source:e}),r=0;r<o.children.length;r++){o.children[r].material.uniformMap.colorTexture=function(){return o.video.width=e.videoWidth,o.video.height=e.videoHeight,a.destroy(),a=new Cesium.Texture({context:o.context,source:e})}}}else if(i){o.video.dom=i,o.video.width=i.width,o.video.height=i.height,o.video.playing=!0;for(var l=new Cesium.Texture({context:o.context,source:i}),c=0;c<o.children.length;c++){o.children[c].material.uniformMap.colorTexture=function(){return i.width==o.video.width&&i.height==o.video.height||(console.log("resize texture"),l.destroy(),l=new Cesium.Texture({context:o.context,source:i})),o.video.width=i.width,o.video.height=i.height,l.destroy(),l=new Cesium.Texture({context:o.context,source:i})}}}}}));s.play(t,1),this.video.player=s,n.getElementsByTagName("video")[0].addEventListener("loadeddata",(function(){e.loaded=!0}))}}},{key:"setFlvVideo3",value:function(t){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var e="video_"+Cesium.createGuid(),i=document.createElement("video");i.setAttribute("id",e);var n=this,o=new Ci(i,{url:t});this.video.player=o,o.on("Events","MEDIA_INFO",(function(t){})),o.flvPlayer.play().then((function(){n.video.dom=i,n.video.width=i.videoWidth,n.video.height=i.videoHeight,n.video.playing=!0;for(var t=new Cesium.Texture({context:n.context,source:i}),e=0;e<n.children.length;e++){n.children[e].material.uniformMap.colorTexture=function(){return n.video.width=i.videoWidth,n.video.height=i.videoHeight,t.destroy(),t=new Cesium.Texture({context:n.context,source:i})}}}))}}},{key:"setFlvVideo2",value:function(t){if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var e="video_"+Cesium.createGuid(),i=document.createElement("div");i.setAttribute("id",e),i.style.display="none";var n=this,o=new wi(i,{url:t});this.video.player=o,this.video.player.player.on("play",(function(t){console.log("1111111111");var e=i.getElementsByTagName("canvas")[0];i.innerHTML="",n.video.dom=e,n.video.width=e.width,n.video.height=e.height,n.video.playing=!0;for(var o=new Cesium.Texture({context:n.context,source:e}),s=0;s<n.children.length;s++){n.children[s].material.uniformMap.colorTexture=function(){return n.video.width=e.width,n.video.height=e.height,o.copyFrom({source:e}),o}}}))}}},{key:"setFlvVideo",value:function(t){var e=this;if(this.video.playing=!1,this.video.timeupdate=!1,this.video.url=t,t){var i=this,n="video_"+Cesium.createGuid(),o=document.getElementById("yj-sdk-live-player-box");o||((o=document.createElement("div")).setAttribute("id","yj-sdk-live-player-box"),o.style.display="none",document.body.appendChild(o));var s=document.createElement("live-player");s.setAttribute("id",n),s.setAttribute("video-url",this.video.url),s.setAttribute("live",!0),s.style.display="none",o.appendChild(s),this.video.player=s,s.addEventListener("play",(function(t){console.log("播放成功",e.video.url,e.name);var n=s.getElementsByTagName("video")[0];i.video.dom=n,i.video.width=n.width,i.video.height=n.height,i.video.playing=!0;for(var o=new Cesium.Texture({context:i.context,source:n}),a=0;a<i.children.length;a++){i.children[a].material.uniformMap.colorTexture=function(){return i.video.width=n.width,i.video.height=n.height,o.copyFrom({source:n}),o}}}))}}},{key:"isDestroyed",value:function(){return!1}},{key:"destroy",value:function(){this.video.player&&(this.video.player.setAttribute("video-url",null),document.getElementById("yj-sdk-live-player-box").removeChild(this.video.player),this.video.player=null)}}])}(),ji=Ti,Ii=["icon-py","icon-edit","icon-add","icon-add2","icon-minus","icon-play","icon-pause","icon-updateheight","icon-draw","icon-positions","icon-reset","icon-xj","icon-yj","icon-zj","icon-close","icon-query","icon-route","icon-copy","icon-load","icon-rubric","icon-pen","icon-cross","icom-confirm"];function Ri(){var t=document.createElement("svg");t.xmlns="http://www.w3.org/2000/svg",t.style.width=0,t.style.height=0,t.style.position="absolute",t.style.overflow="hidden",document.body.appendChild(t);for(var e=new DOMParser,i=function(){var i=Ii[n];fetch(Cesium.buildModuleUrl("../custom/img/".concat(i,".svg"))).then((function(t){return t.text()})).then((function(n){var o=e.parseFromString(n,"text/xml").getElementsByTagName("svg")[0];o&&(o.id="yj-"+i,t.appendChild(o))}))},n=0;n<Ii.length;n++)i()}var Fi=_()((function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k()(this,t);var n,o,s,a,r,l=this,c={el:i.el,size:"mini",isLog:!1,disabled:i.disabled||!1,alpha:!1,clickDefineColor:p,hasClear:!0,openPickerAni:"opacity",defaultColor:i.defaultColor,pickerInputChange:v,startMainCallback:function(t){l.colorPicker&&(l.colorPicker.picker.style.opacity=0),setTimeout((function(){u()}),0)}};function u(){if(l.colorPicker&&l.colorPicker.picker){var t=!1,e=l.colorPicker.box,c=l.colorPicker.picker,u=e.getBoundingClientRect().x,m=e.getBoundingClientRect().y,g=0;c.style.left=u+"px",c.style.minWidth="325px";var y=c.getElementsByClassName("ew-alpha-slider-bar")[0];y&&(y.parentNode.style.width="16px",y.parentNode.removeChild(y));var b=document.createElement("div");b.className="icon-pen-box",b.innerHTML='<svg class="icon-pen"><use xlink:href="#yj-icon-pen"></use></svg>',b.style.display="none",b.style.cursor="unset";var C=l.colorPicker.pickerInput;C.parentNode.insertBefore(b,C),C.style.width="188px",C.style.display="none";var w=document.createElement("div"),k=document.createElement("div");k.className="row",k.style.margin="6px 0 0 0",k.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col" style="flex: 0 0 92px;"></div>\n ';var x=document.createElement("div");x.className="row",x.innerHTML='\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n <div class="col">\n <input type="number" step="1" min="0" max="255">\n </div>\n ',w.appendChild(k),w.appendChild(x);var _=x.getElementsByTagName("input");_[0].style.width="72px",_[1].style.width="72px",_[2].style.width="72px",n=_[0],o=_[1],s=_[2];var E=c.getElementsByClassName("ew-color-dropbtns")[0];if(c.insertBefore(w,E),n.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)),n.value=parseInt(e),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),o.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)),o.value=parseInt(e),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),s.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)),s.value=parseInt(e),l.colorPicker.hsba=f("rgb(".concat(n.value,", ").concat(o.value,", ").concat(s.value,")")),l.colorPicker.changeColor(l.colorPicker,l.colorPicker.pickerPanel.offsetWidth,l.colorPicker.pickerPanel.offsetHeight))})),i.alpha){_[0].style.width="52px",_[1].style.width="52px",_[2].style.width="52px";var S=document.createElement("div");S.className="input-number input-number-unit color-alpha",S.innerHTML='\n <input class="input" type="number" title="" step="0.01" min="0" max="1">\n <span class="arrow"></span>',C.parentNode.insertBefore(S,C.nextSibling),S.style.width="66px",S.style.margin="0 6px 0 0",a=S.getElementsByClassName("input")[0],k.innerHTML='\n <div class="col">R</div>\n <div class="col">G</div>\n <div class="col">B</div>\n <div class="col">A</div>\n <div class="col" style="flex: 0 0 106px;"></div>\n ',x.appendChild(S),a.addEventListener("blur",(function(t){var e=t.target.value;(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)),a.value=parseInt(100*e)/100)})),l.pickAlphaInputValue||0===l.pickAlphaInputValue||"0"===l.pickAlphaInputValue?a.value=parseInt(100*l.pickAlphaInputValue)/100:a.value=r?parseInt(100*Number(r.alpha.toFixed(2)))/100:1,l.pickAlphaInputValue=a.value,e.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").withAlpha(a.value).toCssColorString()}else r=r?r.withAlpha(1):"",e.style.background=Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssColorString();var D=c.getElementsByClassName("ew-color-dropbtngroup")[0];x.appendChild(D);var P=c.getElementsByClassName("ew-pre-define-color-container")[0];if(P){var M=localStorage.getItem("custom-color");M=M?JSON.parse(M):{};var O=document.createElement("span");O.className="custom-divider",O.style.margin="10px 0";var T=document.createElement("span");T.className="custom-divider",P.parentNode.insertBefore(O,P),P.parentNode.insertBefore(T,P.nextSibling);var N=document.createElement("div");N.className="yj-pre-collect-color-container",T.parentNode.insertBefore(N,T.nextSibling);var B=document.createElement("div");B.innerHTML='<svg class="icon-add2"><use xlink:href="#yj-icon-add2"></use></svg>',B.className="yj-pre-collect-color add";var L=document.createElement("div");L.innerHTML='<svg class="icon-minus" style="display: unset;"><use xlink:href="#yj-icon-minus"></use></svg><svg class="icon-confirm" style="display: none;"><use xlink:href="#yj-icom-confirm"></use></svg>',L.className="yj-pre-collect-color subtract";var A=L.getElementsByClassName("icon-minus")[0],j=L.getElementsByClassName("icon-confirm")[0];N.appendChild(B),N.appendChild(L);var I=[],R=function(t){var e=document.createElement("div");e.className="yj-pre-collect-color",e.setAttribute("tabindex","0"),e.setAttribute("color-box-id",l.colorPicker.uid);var i=document.createElement("div");i.className="yj-pre-define-color-item",e.appendChild(i),i.className="yj-pre-define-color-item";var n=Cesium.Color.fromCssColorString(M[t]).toCssHexString();i.style.backgroundColor=n,i.addEventListener("click",(function(t){l.colorPicker.updateColor(t),e.className="yj-pre-collect-color yj-pre-collect-color-active",p(n)})),e.addEventListener("blur",(function(t){e.className="yj-pre-collect-color"}));var o=document.createElement("div");o.className="yj-pre-define-color-item subtract-btn",o.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',o.style.display="none",e.appendChild(o),N.appendChild(e),o.addEventListener("click",(function(){delete M[t],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(e)})),I.push(o)};for(var F in M)R(F);B.addEventListener("click",(function(){if(t){t=!1;for(var e=0;e<I.length;e++)I[e].style.display="none"}var i=document.createElement("div");i.className="yj-pre-collect-color",i.setAttribute("tabindex","0"),i.setAttribute("color-box-id",l.colorPicker.uid);var n=document.createElement("div");n.className="yj-pre-define-color-item",i.appendChild(n);var o=d(h(l.colorPicker.hsba)),s=Cesium.Color.fromCssColorString(o||"#ffffff");a&&(s=s.withAlpha(a.value));var r=s.toCssHexString();n.style.backgroundColor=r,n.addEventListener("click",(function(t){l.colorPicker.updateColor(t),i.className="yj-pre-collect-color yj-pre-collect-color-active",p(r)})),i.addEventListener("blur",(function(t){i.className="yj-pre-collect-color"})),N.appendChild(i);var c=document.createElement("div");c.className="yj-pre-define-color-item subtract-btn",c.innerHTML='<svg class="icon-cross"><use xlink:href="#yj-icon-cross"></use></svg>',c.style.display="none",i.appendChild(c),I.push(c);var u=Cesium.createGuid();M[u]=r,localStorage.setItem("custom-color",JSON.stringify(M)),c.addEventListener("click",(function(){delete M[u],localStorage.setItem("custom-color",JSON.stringify(M)),N.removeChild(i)}))})),L.addEventListener("click",(function(){if(t=!t){A.style.display="none",j.style.display="unset";for(var e=0;e<I.length;e++)I[e].style.display="block"}else{A.style.display="unset",j.style.display="none";for(var i=0;i<I.length;i++)I[i].style.display="none"}}))}g=c.offsetHeight,"none"===c.style.display&&(c.style.display="block",g=c.offsetHeight,c.style.display="none"),m+e.offsetHeight+4+g>window.innerHeight?c.style.top=m-g+"px":c.style.top=m+e.offsetHeight+4+"px",l.colorPicker.pancelTop=parseFloat(c.style.top)-2,v(Cesium.Color.fromCssColorString(l.colorPicker.config.defaultColor||"#ffffff").toCssHexString())}}function p(t){if(a){var e=Cesium.Color.fromCssColorString(t);a.value=parseInt(100*Number(e.alpha.toFixed(2)))/100}}function h(t){var e,i,n,o=t.a,s=Math.round(t.h),a=Math.round(255*t.s/100),r=Math.round(255*t.b/100);if(0===a)e=i=n=r;else{var l=(255-a)*r/255,c=s%60*(r-l)/60;360===s?(e=r,i=n=0):s<60?(e=r,i=l+c,n=l):s<120?(e=r-c,i=r,n=l):s<180?(e=l,i=r,n=l+c):s<240?(e=l,i=r-c,n=r):s<300?(e=l+c,i=l,n=r):s<360?(e=r,i=l,n=r-c):e=i=n=0}return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+o+")"}function d(t){var e={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};if(/rgba?/.test(t)){var i=t.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n="";return i[3],i.map((function(t,i){i<=2&&(n+=function(t){t=Math.min(Math.round(t),255);var i=Math.floor(t/16),n=t%16;return""+(e[i]||i)+(e[n]||n)}(t))})),"#"+n}}function m(t,e){var i=t.toLowerCase(),n=t.length,o=[];i=Cesium.Color.fromCssColorString(i).toCssHexString().substring(0,7);if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===n){for(var s="#",a=1;a<n;a++){var r=i.slice(a,a+1);s+=r.concat(r)}i=s}for(var l=1,c=i.length;l<c;l+=2)o.push(parseInt("0X"+i.slice(l,l+2),16));return o}}function f(t){var e=t.slice(t.indexOf("(")+1,t.lastIndexOf(")")).split(","),i=e.length<4?1:Number(e[3]),n=Number(e[0])/255,o=Number(e[1])/255,s=Number(e[2])/255,a=void 0,r=void 0,l=void 0,c=Math.min(n,o,s),u=l=Math.max(n,o,s),p=u-c;if(u===c)a=0;else{switch(u){case n:a=(o-s)/p+(o<s?6:0);break;case o:a=2+(s-n)/p;break;case s:a=4+(n-o)/p}a=Math.round(60*a)}return r=0===u?0:1-c/u,{h:a,s:r=Math.round(100*r),b:l=Math.round(100*l),a:i}}function v(t){if(l.colorPicker&&l.colorPicker.pickerInput){var e=m(t||l.colorPicker.pickerInput.value);n.value=e[0],o.value=e[1],s.value=e[2]}}this.el=i.el,i.sure&&(c.sure=function(t){var n=Cesium.Color.fromCssColorString(t);a&&(n=n.withAlpha(a.value),e.pickAlphaInputValue=a.value),t=n.toCssHexString(),"function"==typeof i.sure&&i.sure(t),u()}),i.clear&&(c.clear=function(){a&&(a.value=e.pickAlphaInputValue=1),e.colorPicker.config.defaultColor="",u(),"function"==typeof i.clear&&i.clear()}),c.defaultColor&&(r=Cesium.Color.fromCssColorString(c.defaultColor)),c.predefineColor=["rgba(255, 255, 255, 1)","rgba(255, 0, 0, 1)","rgba(208, 132, 209, 1)","rgba(100, 182, 217, 1)","rgba(42, 130, 228, 1)","rgba(214, 36, 36, 1)","rgba(252, 222, 111, 1)","rgba(67, 207, 124, 1)","rgba(176, 243, 143, 1)","rgba(121, 72, 234, 1)","rgba(255, 195, 0, 1)","rgba(0, 186, 173, 1)","rgba(165, 214, 63, 1)","rgba(0, 0, 0, 1)","rgba(46, 47, 51, 1)","rgba(172, 51, 193, 1)","rgba(130, 21, 21, 1)","rgba(255, 87, 51, 1)","rgba(255, 140, 0, 1)","rgba(125, 191, 255, 1)"],this.colorPicker=new ewPlugins("colorpicker",c),u()}));window.YJColorPicker=Fi;var zi=Fi;function Hi(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Vi(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Vi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Gi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ui(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Wi(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Yi(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Ji=new WeakMap,qi=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),Wi(this,Ji,void 0),this.div_id=e,this.entityMap=new Map,this._entityZIndex=0,this.viewer=null,this.options=Ui({},i),ui(ci()),this.proj=new R,this.clickTextDom=void 0,this.isLeftClick=!1,this.init(),Ri()}),[{key:"addIncetance",value:function(t,e){this.entityMap.set(t+"",e)}},{key:"getIncetance",value:function(t){return this.entityMap.get(t+"")}},{key:"removeIncetance",value:function(t){this.entityMap.delete(t),function(t){at.delete(t)}(this),function(t){rt.delete(t)}(this),function(t){lt.delete(t)}(this),se(this,t)}},{key:"setDefaultView",value:function(t){t?(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}},ii(this),ni(this),this.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(t.destination.lng,t.destination.lat,t.destination.alt),orientation:{heading:Cesium.Math.toRadians(t.orientation.heading||0),pitch:Cesium.Math.toRadians(t.orientation.pitch||0),roll:Cesium.Math.toRadians(t.orientation.roll||0)},duration:0})):(this.viewer.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2),this.viewer.camera.setView({destination:Cesium.Camera.DEFAULT_VIEW_RECTANGLE}))}},{key:"init",value:function(){var t=this,e=new Cesium.Ellipsoid(6378137,6378137,6356752.314140356),i=new Cesium.GeographicProjection(e),n=this;this.options={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0,mapProjection:i},Number(Cesium.VERSION.split(".")[1])>=107?this.options.baseLayer=Cesium.ImageryLayer.fromProviderAsync(Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"))):this.options.imageryProvider=new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),this.options.contextOptions={webgl:{depth:!0,stencil:!0,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,failIfMajorPerformanceCaveat:!0},requestWebgl2:!0},Cesium.RequestScheduler.maximumRequests=500,this.viewer=new Cesium.Viewer(this.div_id,this.options),this.viewer.scene.imageryLayers._layers[0].notes="default-base-map",this.viewer._shadows=this.viewer.shadows,this.viewer.scene.screenSpaceCameraController.maximumZoomDistance=5e7,this.viewer.scene.globe.translucency.enabled=!0;var o=new fi;this.viewer.scene.skyBox=new Cesium.SkyBox({sources:{negativeX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mx.jpg",negativeY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_my.jpg",negativeZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_mz.jpg",positiveX:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_px.jpg",positiveY:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_py.jpg",positiveZ:o.getSourceRootPath()+"/img/skyBox/2/tycho2t3_80_pz.jpg"}}),bi();for(var s=[{name:"思源黑体",value:"SourceHanSansTi",url:o.getSourceRootPath()+"/custom/fonts/SourceHanSansCN-Medium.otf",format:"opentype"},{name:"庞门正道标题体",value:"PMZDBTTi",url:o.getSourceRootPath()+"/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf",format:"truetype"},{name:"数黑体",value:"AlimamaShuHeiTi",url:o.getSourceRootPath()+"/custom/fonts/AlimamaShuHeiTi-Bold.ttf",format:"truetype"}],a=0;a<s.length;a++){var r=new FontFace(s[a].value,"url('".concat(s[a].url,"') format('").concat(s[a].format,"')"));r.load(),document.fonts.add(r)}document.fonts.ready.then((function(){var e,i=Hi(t.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"labelFontFamily"in o&&(o.labelFontFamily=o.labelFontFamily)}}catch(t){i.e(t)}finally{i.f()}})),this.setDefaultView(),Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmM5ODNkYy0yMTIzLTQxNzktOTE1Yy1mN2QxNmFkMjgyMTUiLCJpZCI6Mjk0NzIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTIyMjkxMTJ9.9oYggi4kZgcapD2BkEGF8kG8tTuVkF33FdwxB2JKXeA",this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.viewer.scene.screenSpaceCameraController.zoomEventTypes=[Cesium.CameraEventType.WHEEL,Cesium.CameraEventType.PINCH],this.viewer.scene.screenSpaceCameraController.tiltEventTypes=[Cesium.CameraEventType.PINCH,Cesium.CameraEventType.RIGHT_DRAG],this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),Cesium.FeatureDetection.supportsImageRenderingPixelated()&&(this.viewer.resolutionScale=window.devicePixelRatio),this.viewer.scene.fxaa=!0,this.viewer.scene.postProcessStages.fxaa.enabled=!0,this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0,function(t){var e=new fi,i=new Cesium.CustomDataSource("sdk-dataSource1");t.dataSources.add(i).then((function(t){var i;t.clustering.enabled=!1,t.clustering.pixelRange=15,t.clustering.minimumClusterSize=2;for(var n=new Cesium.PinBuilder,o=(n.fromText("50+",Cesium.Color.RED,48).toDataURL(),n.fromText("40+",Cesium.Color.ORANGE,48).toDataURL(),n.fromText("30+",Cesium.Color.YELLOW,48).toDataURL(),n.fromText("20+",Cesium.Color.GREEN,48).toDataURL(),n.fromText("10+",Cesium.Color.BLUE,48).toDataURL(),new Array(8)),s=0;s<o.length;++s)o[s]=n.fromText(""+(s+2),Cesium.Color.VIOLET,48).toDataURL();!function(){Cesium.defined(i)?(i(),i=void 0):i=t.clustering.clusterEvent.addEventListener((function(t,i){i.billboard.show=!0,i.billboard.id=i.label.id,i.billboard.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,i.billboard.image=e.getSourceRootPath()+"/img/cluster.png",i.billboard.disableDepthTestDistance=ei()?void 0:Number.POSITIVE_INFINITY,i.label.verticalOrigin=Cesium.VerticalOrigin.CENTER,i.label.font="18px Arial,sans-serif",i.label.disableDepthTestDistance=ei()?void 0:Number.POSITIVE_INFINITY,i.label.style=Cesium.LabelStyle.FILL,i.label.showBackground=!0,i.label.backgroundColor=Cesium.Color.WHITE.withAlpha(0),t.length>=1e3?(i.billboard.scale=1.5,i.label.pixelOffset=new Cesium.Cartesian2(-28,-46)):t.length>=100?(i.billboard.scale=1.25,i.label.pixelOffset=new Cesium.Cartesian2(-21,-40)):t.length>=50?(i.billboard.scale=1.1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-36)):t.length>=40?(i.billboard.scale=1.05,i.label.pixelOffset=new Cesium.Cartesian2(-16,-34)):t.length>=30?(i.billboard.scale=1,i.label.pixelOffset=new Cesium.Cartesian2(-16,-32)):t.length>=20?(i.billboard.scale=.95,i.label.pixelOffset=new Cesium.Cartesian2(-16,-30)):t.length>=10?(i.billboard.scale=.9,i.label.pixelOffset=new Cesium.Cartesian2(-16,-28)):(i.billboard.scale=.8,i.label.pixelOffset=new Cesium.Cartesian2(-11,-25))}));var n=t.clustering.pixelRange;t.clustering.pixelRange=0,t.clustering.pixelRange=n}();var a={pixelRange:15,minimumClusterSize:2};function r(e){Cesium.knockout.getObservable(a,e).subscribe((function(i){t.clustering[e]=i}))}Cesium.knockout.track(a),r("pixelRange"),r("minimumClusterSize")}))}(this.viewer),E(this.viewer);Cesium.viewerCesiumNavigationMixin(this.viewer,{resetTooltip:"重置视图",zoomInTitle:"缩小",zoomOutTitle:"放大"});function l(t){var e=t.indexOf("px");return Number(t.slice(0,e))}setTimeout((function(){var e=document.getElementsByClassName("compass-outer-ring")[0],i=document.getElementsByClassName("navigation-controls")[0];e.addEventListener("mousedown",(function(){ii(t),ni(t)})),i.addEventListener("mousedown",(function(){ii(t),ni(t)}))}),0),this.viewer.imageryLayers.layerAdded.addEventListener((function(){for(var e=0;e<t.viewer.imageryLayers._layers.length;e++)t.viewer.imageryLayers._layers[e]._imageryProvider&&t.viewer.imageryLayers._layers[e]._imageryProvider._type&&("flw"===t.viewer.imageryLayers._layers[e]._imageryProvider._type||"jww"===t.viewer.imageryLayers._layers[e]._imageryProvider._type)&&t.viewer.imageryLayers.raiseToTop(t.viewer.imageryLayers._layers[e])})),function t(){(function(t,e,i){t.set(Yi(t,e),i)})(Ji,n,requestAnimationFrame(t)),e=1,n.viewer&&2===n.viewer.scene.mode&&(e=10),n.viewer.shadows?n.viewer.scene.light=new Cesium.SunLight:n.viewer.trackedEntity&&n.viewer.trackedEntity.position?(e=1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.trackedEntity.position._value,new Cesium.Cartesian3(-1,-1,-1)),intensity:e})):(e=n.viewer&&2===n.viewer.scene.mode?30:1,n.viewer.scene.light=new Cesium.DirectionalLight({direction:Cesium.Cartesian3.negate(n.viewer.scene.camera.position,new Cesium.Cartesian3(-1,-1,-1)),intensity:e})),TWEEN.update();var e}(),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:0},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}})),n.viewer.entities.add(new Cesium.Entity({name:"solve-bug",position:{x:0,y:0,z:1e8},billboard:{scale:0,image:o.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(0)}})),new Cesium.ScreenSpaceEventHandler(n.viewer.canvas).setInputAction((function(t){var e=n.viewer._element.getElementsByClassName("popup-textarea");n.isLeftClick=!1;for(var i=e.length-1;i>-1;i--){var o=l(e[i].style.left),s=l(e[i].style.top),a=1*e[i].clientWidth,r=1*e[i].clientHeight,c=t.position.x,u=t.position.y;if(c>o&&c<o+a&&u>s&&u<s+r){n.clickTextDom&&(n.clickTextDom.style["pointer-events"]="none",n.clickTextDom.querySelector("textarea").removeEventListener("blur",n.blurFun)),n.clickTextDom=e[i],e[i].style["pointer-events"]="all",e[i].querySelector("textarea").focus(),n.isLeftClick=!0,n.entityMap.get(n.clickTextDom.id).isClick(t.position,n.clickTextDom.id),n.blurFun=function(){n.entityMap.get(n.clickTextDom.id).isClick(t&&t.position||null,n.clickTextDom.id),n.entityMap.get(n.clickTextDom.id).getwords(n.clickTextDom.getElementsByTagName("textarea")[0].value)},n.clickTextDom.querySelector("textarea").addEventListener("blur",n.blurFun);break}}var p=void 0,h=void 0,d=void 0;if(n.isLeftClick){var m=!1,f=0,v=0;p=function(t){f=t.layerX,v=t.layerY,m=!0},h=function(t){if(m){var e=1*n.clickTextDom.clientWidth,i=1*n.clickTextDom.clientHeight,o={x:t.clientX-f+e/2,y:t.clientY-v+i},s=ze().sdkP;if(n!=s&&s){var a=s.viewer._element.clientWidth;o.x=o.x-a}n.entityMap.get(n.clickTextDom.id).setHandeler(o)}},d=function(t){m&&(m=!1)},n.clickTextDom.addEventListener("mousedown",p),n.viewer._element.addEventListener("mousemove",h),n.viewer._element.addEventListener("mouseup",d)}!n.isLeftClick&&n.clickTextDom&&(n.clickTextDom.removeEventListener("mousedown",p),n.viewer._element.removeEventListener("mousemove",h),n.viewer._element.removeEventListener("mouseup",d),n.entityMap.get(n.clickTextDom.id).getwords(n.clickTextDom.getElementsByTagName("textarea")[0].value),n.clickTextDom.style["pointer-events"]="none",n.clickTextDom=void 0)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"destroy",value:function(){var t,e;cancelAnimationFrame((e=this,(t=Ji).get(Yi(t,e))));var i,n=Hi(this.entityMap);try{for(n.s();!(i=n.n()).done;){var o=y()(i.value,2);o[0];o[1].remove()}}catch(t){n.e(t)}finally{n.f()}this.viewer&&(this.viewer.entities&&this.viewer.entities.removeAll(),this.viewer.destroy&&this.viewer.destroy()),this.viewer=null}}])}();function Xi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Zi(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xi(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ki=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.primitives={building:[],unit:[],dth:[]},this.options=Zi({},i),this.options.host=this.options.host||h(),this.temporaryDth=[],this.dth={},this.PickBuildingEvent=new Cesium.Event,this.initEvents(),this.activeBuilding}),[{key:"PickCallback",value:function(t,e){this.PickBuildingEvent.addEventListener(e,t)}},{key:"initEvents",value:function(){var t=this;new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()&&t.isActivate){var i=t.sdk.viewer.scene.pick(e.position);if(i){if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"==i.id.type||"yj-dth-highlight"==i.id.type))return void t.getIDBypickFeature(i);if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"==i.id.type)return t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive),void t.handlePickEvent(i.id)}t.highlightPrimitive&&t.sdk.viewer.scene.primitives.remove(t.highlightPrimitive);var n=t.sdk.viewer.scene.pickPosition(e.position);if(n){var o=Cesium.Cartographic.fromCartesian(n),s=[Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude)];t.queryByPoint(s,o.height)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK);var e=this.sdk.viewer.entities.getOrCreateEntity("yj-dth-cover-label");e.show=!1;var i,n=0,o=this;function s(t){var i=o.sdk.viewer.scene.pick(t.endPosition);if(i){var n="";if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&("yj-dth-dth"===i.id.type||"yj-dth-highlight"===i.id.type))n=i.id.build_info.name+" - "+i.id.unit_info.name+" - "+i.id.room_num;else if(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-unit"===i.id.type)i.id.build_info.name&&(n=i.id.build_info.name+" - "+i.id.name);else{if(!(i.primitive&&i.primitive instanceof Cesium.ClassificationPrimitive&&i.id&&"yj-dth-build"===i.id.type))return i.primitive&&i.primitive.id&&i.primitive.id.id&&"yj-dth-cover-label"===i.primitive.id.id?void(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition)):void(e.show=!1);i.id.name&&(n=i.id.name)}n&&(e.position=o.sdk.viewer.scene.pickPosition(t.endPosition),e.label=new Cesium.LabelGraphics({text:n,font:"20px Helvetica",pixelOffset:{x:0,y:-30},fillColor:Cesium.Color.fromCssColorString("#ffffff"),outlineColor:Cesium.Color.BLACK,outlineWidth:1,showBackground:!0,backgroundColor:Cesium.Color.fromCssColorString("#000000").withAlpha(.8),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY}),e.show=!0)}}new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.scene.canvas).setInputAction((function(t){if(!YJ.Measure.GetMeasureStatus())try{var e=Date.now();if(e-n<100)return clearTimeout(i),void(i=setTimeout((function(){s(t)}),100));clearTimeout(i),n=e,s(t)}catch(t){}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},{key:"queryByUserInfo",value:function(t){this.queryByPoint([t.position.lng,t.position.lat],t.position.alt,t.id)}},{key:"queryByPoint",value:(s=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/dth/build/query_by_point":this.options.host+"/yjearth4.0/api/v1/dth/build/query_by_point",i+="?point="+JSON.stringify({lng:e[0],lat:e[1]}),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(200!==(n=t.sent).status){t.next=11;break}return t.next=9,n.json();case 9:200===(o=t.sent).code||0===o.code?this.processQueryByPointResults(o.data):window.ELEMENT&&window.ELEMENT.Message({message:o.msg||o.message,type:"warning",duration:1500});case 11:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"processQueryByPointResults",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=p.length>2&&void 0!==p[2]?p[2]:{heading:0,pitch:-90,roll:0},e.build_info&&this.handlePickEvent(e),this.clearAllDthPrimitive(),this.clearAllUnitPrimitive(),this.activeBuilding&&(this.clearBuildingPrimitive(this.activeBuilding),this.activeBuilding=null),!e.build_info){t.next=26;break}if(o=JSON.parse(e.build_info.range),e.dan_yuan.length>0)for(s=0;s<e.dan_yuan.length;s++)e.dan_yuan[s].children.length>0?this.addDthPrimitive(e.dan_yuan[s].children,e.build_info,e.dan_yuan[s]):this.addUnitPrimitive([e.dan_yuan[s]],e.build_info,e.dan_yuan[s]);else this.activeBuilding=e.build_info.ID||e.build_info.id,this.addBuildingPrimitive([e.build_info]);if(!i){t.next=26;break}if(e.info&&e.info.dan_yuan&&(o=JSON.parse(e.info.dan_yuan.range)),!e.info||!e.info.hu){t.next=25;break}for(o=JSON.parse(e.info.hu.range),r=0;r<o.length;r++)o[r].alt=e.info.hu.bottom;l=0;case 14:if(!(l<this.primitives.dth.length)){t.next=25;break}return t.next=17,this.primitives.dth[l].readyPromise;case 17:if((c=this.primitives.dth[l]._primitiveOptions.geometryInstances[0].id).ID!==e.info.hu.ID||c.room_num!==e.info.hu.room_num){t.next=22;break}return u={id:Zi(Zi({},e.info.hu),{},{build_info:Zi({},e.build_info),unit_info:e.info.dan_yuan}),primitive:this.primitives.dth[l]},this.getIDBypickFeature(u),t.abrupt("break",25);case 22:l++,t.next=14;break;case 25:this.flyTo(o,n);case 26:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"addBuildingPrimitive",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=0;i<e.length;i++){for(n=[],o=0,s=JSON.parse(e[i].range),r=0;r<s.length;r++)o<s[r].alt&&(o=s[r].alt),n.push(s[r].lng,s[r].lat,0);l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n)),extrudedHeight:1e8}),this.primitives.building.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi({type:"yj-dth-build"},e[i]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"clearBuildingPrimitive",value:function(t){for(var e=this.primitives.building.length-1;e>=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.building[e]),this.primitives.building.splice(e,1);break}}},{key:"clearAllBuildingPrimitive",value:function(){for(var t=this.primitives.building.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.building[t]);this.primitives.building=[]}},{key:"addUnitPrimitive",value:(e=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o=0;o<e.length;o++){for(s=[],r=0,l=JSON.parse(e[o].range),c=0;c<l.length;c++)r<l[c].alt&&(r=l[c].alt),s.push(l[c].lng,l[c].lat,0);u=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),extrudedHeight:1e8}),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi(Zi({type:"yj-dth-unit"},e[o]),{},{build_info:Zi({},i),unit_info:Zi({},n)}),geometry:Cesium.PolygonGeometry.createGeometry(u),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(255, 235, 59, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.unit.push(this.sdk.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:2}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#00ff0a").withAlpha(.8))}}),appearance:new Cesium.PolylineColorAppearance})))}case 1:case"end":return t.stop()}}),t,this)}))),function(t,i,n){return e.apply(this,arguments)})},{key:"clearUnitPrimitive",value:function(t){for(var e=this.primitives.building.length-1;e>=0;e--)if(t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.ID||t===this.primitives.building[e]._primitiveOptions.geometryInstances[0].id.id){this.sdk.viewer.scene.primitives.remove(this.primitives.unit[e]),this.primitives.unit.splice(e,1);break}}},{key:"clearAllUnitPrimitive",value:function(){for(var t=this.primitives.unit.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.unit[t]);this.primitives.unit=[]}},{key:"addDthPrimitive",value:function(t,e,i){for(var n=0;n<t.length;n++){for(var o=JSON.parse(t[n].range),s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,t[n].bottom+.3);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:t[n].height+t[n].bottom}),l=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,extrudedHeight:t[n].bottom});this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi(Zi({type:"yj-dth-dth"},t[n]),{},{build_info:Zi({},e),unit_info:Zi({},i)}),geometry:Cesium.PolygonGeometry.createGeometry(r),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 64, 255, 0.4)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE}))),this.primitives.dth.push(this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi({type:"yj-dth-dth-border"},t[n]),geometry:Cesium.PolygonGeometry.createGeometry(l),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("rgb(0, 0, 0, 1)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})))}}},{key:"clearDthPrimitive",value:function(t){for(var e=this.primitives.dth.length-1;e>=0;e--)t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.ID&&t!==this.primitives.dth[e]._primitiveOptions.geometryInstances[0].id.id||(this.sdk.viewer.scene.primitives.remove(this.primitives.dth[e]),this.primitives.dth.splice(e,1))}},{key:"clearAllDthPrimitive",value:function(){this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive);for(var t=this.primitives.dth.length-1;t>=0;t--)this.sdk.viewer.scene.primitives.remove(this.primitives.dth[t]);this.primitives.dth=[]}},{key:"getIDBypickFeature",value:function(t){this.clickHighlightPrimitive&&(this.clickHighlightPrimitive.show=!0),this.highlightPrimitive&&this.sdk.viewer.scene.primitives.remove(this.highlightPrimitive),this.highlightPrimitive=this.sdk.viewer.scene.primitives.add(new Cesium.ClassificationPrimitive({geometryInstances:new Cesium.GeometryInstance({id:Zi(Zi({},t.id),{},{type:"yj-dth-highlight"}),geometry:t.primitive._primitiveOptions.geometryInstances[0].geometry,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#ff9800").withAlpha(.8)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}}),classificationType:Cesium.ClassificationType.CESIUM_3D_TILE})),this.highlightPrimitive.readyPromise.then((function(){t.primitive.show=!1})),this.clickHighlightPrimitive=t.primitive;var e=t.id.range;"string"==typeof t.id.range&&(e=JSON.parse(t.id.range)),this.getHilightArea(e),this.handlePickEvent(t.id)}},{key:"handlePickEvent",value:function(t){this.PickBuildingEvent.raiseEvent(t)}},{key:"getHilightArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];t.forEach((function(t){i.push([t.lng,t.lat])})),i.push(i[0]);var n=turf.polygon([i]),o=turf.buffer(n,Number(e)/1e3);return o.geometry.coordinates}},{key:"flyTo",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=u.length>1&&void 0!==u[1]?u[1]:{heading:0,pitch:-90,roll:0},n=new YJ.Tools(this.sdk),o=0,s=[],r=0;case 5:if(!(r<e.length)){t.next=18;break}if(!e[r].alt){t.next=10;break}o=e[r].alt,t.next=13;break;case 10:return t.next=12,n.getClampToHeight(e[r]);case 12:o=t.sent;case 13:l=Cesium.Cartesian3.fromDegrees(e[r].lng,e[r].lat,o),s.push(l.x,l.y,l.z);case 15:r++,t.next=5;break;case 18:return t.next=20,Cesium.BoundingSphere.fromVertices(s);case 20:c=t.sent,this.sdk.viewer.camera.flyToBoundingSphere(c,{offset:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0===i.pitch?i.pitch:-90),roll:Cesium.Math.toRadians(i.roll||0)}});case 22:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"activate",value:function(){this.isActivate=!0}},{key:"deactivate",value:function(){this.isActivate=!1}}]);var t,e,i,n,s}(),$i=function(){return _()((function t(){k()(this,t),this.start()}),[{key:"start",value:function(){var t=this;navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(e){t.mediaRecorder=new MediaRecorder(e,{mimeType:"video/webm"});var i=[];t.mediaRecorder.addEventListener("dataavailable",(function(t){i.push(t.data)})),t.mediaRecorder.addEventListener("stop",o()(a.a.mark((function t(){var e,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=new Blob(i,{type:"video/mp4"}),n={suggestedName:"视频录制.mp4",types:[{description:"文件类型",accept:{"video/mp4":[".mp4"]}}],excludeAcceptAllOption:!0},t.next=5,window.showSaveFilePicker(n);case 5:return o=t.sent,t.next=8,o.createWritable();case 8:return(s=t.sent).write(e),t.next=12,s.close();case 12:YJ.Global.ScreenRecord.screenRecord=null,t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),console.info("文件保存失败:",t.t0);case 18:case"end":return t.stop()}}),t,null,[[0,15]])})))),t.mediaRecorder.start()})).catch((function(t){console.info("取消录屏"),console.info(t),YJ.Global.ScreenRecord.screenRecord=null}))}}])}();var Qi=i(7),tn=i.n(Qi),en=i(5),nn=i.n(en),on=i(4),sn=i.n(on);function an(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var rn=function(t){function e(t,i,n,o){var s;return k()(this,e),(s=an(this,e,[t.viewer._container,n,o])).sdk=t,s.viewer=t.viewer,s.info=i,s._init(),s}return sn()(e,t),_()(e,[{key:"_init",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.init();case 2:return t.next=4,this._attribute();case 4:if(this.options.confirmCallBack&&((e=document.createElement("button")).className="confirm",e.innerHTML="确认",this.footAppChild(e),e.addEventListener("click",(function(){p.options.confirmCallBack&&p.options.confirmCallBack(p.info)}))),this.options.removeCallBack&&((i=document.createElement("button")).className="delete",i.innerHTML="删除",this.footAppChild(i),i.addEventListener("click",(function(){p.close(),p.options.removeCallBack&&p.options.removeCallBack()}))),this.options.rotateCallBack&&((n=document.createElement("button")).className="rotate",n.innerHTML="旋转",this.footAppChild(n),n.addEventListener("click",(function(){p.options.rotateCallBack&&p.options.rotateCallBack()}))),(this.options.translationalCallBack||this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&((o=document.createElement("div")).style.position="absolute",o.style.left="24px",o.style.flet="0",o.style.display="flex",this.footAppChild(o),this.options.updateHeightCallBack&&((s=document.createElement("button")).innerHTML='<svg class="icon-updateheigh"><use xlink:href="#yj-icon-updateheight"></use></svg>更新高程',s.style.width="auto",s.addEventListener("click",(function(){p.options.updateHeightCallBack()})),o.appendChild(s)),this.options.secondaryEditCallBack&&((r=document.createElement("button")).className="secondaryEdit",r.innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>二次编辑',this.options.updateHeightCallBack&&(r.style.marginLeft="10px"),o.appendChild(r),r.addEventListener("click",(function(){p.options.secondaryEditCallBack&&p.options.secondaryEditCallBack()}))),this.options.translationalCallBack&&((l=document.createElement("button")).className="translational",l.innerHTML='<svg class="icon-py"><use xlink:href="#yj-icon-py"></use></svg>平移',(this.options.updateHeightCallBack||this.options.secondaryEditCallBack)&&(l.style.marginLeft="10px"),o.appendChild(l),l.addEventListener("click",(function(){p.options.translationalCallBack&&p.options.translationalCallBack()})))),this.options.addFootElm)for(c=0;c<this.options.addFootElm.length;c++)(u=document.createElement(this.options.addFootElm[c].tagName)).className=this.options.addFootElm[c].className,u.innerHTML=this.options.addFootElm[c].innerHTML,this.options.addFootElm[c].event&&2==this.options.addFootElm[c].event.length&&u.addEventListener(this.options.addFootElm[c].event[0],this.options.addFootElm[c].event[1]),this.footAppChild(u);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_attribute",value:function(){var t=this._element.content.getElementsByClassName("attribute")[0];if(t&&0!==t.length)for(var e=t.getElementsByClassName("attribute-select")[0].getElementsByTagName("option"),i=e.length-1;i>=0;i--)for(var n in this.info.attribute)if(e[i].value===n){this.info.attribute[n].disabled&&(e[i].disabled=!0);break}}}]);var i}(W);function ln(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ln(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var un=new fi;function pn(){return(pn=o()(a.a.mark((function t(e,i,n,s){var r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O,T,N,B,L,A,j,I,R,F,z,H,V,G,U,W,J,q,X,Z,K,$,Q,tt,et,it,nt,ot,st,at,rt,lt,ct,ut,pt,ht,dt,mt,ft,vt,gt,yt;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return yt=function(){var t,e=document.createElement("canvas"),i=e.getContext("2d"),o=new Image;o.src=s,o.onload=function(){if(!h){var s=cn({},v),a=JSON.parse(JSON.stringify(y)),l=cn({},b),c=cn({},g);c.width=g.width/L.width*o.width;var u=m/L.width*o.width,p=u;if(c.show&&d&&d.complete&&(p+=c.width),e.width=o.width+2*p,e.height=o.height+2*p,i.clearRect(0,0,e.width,e.height),i.rect(0,0,e.width,e.height),i.fillStyle="#ffffff",i.fill(),i.drawImage(o,p,p,o.width,o.height),s.show){var f=s.text,C=Math.max(5,s.height*o.height*.5);i.font="".concat(C,"px serif"),i.fillStyle=s.bgColor||"#5d5d5d",i.fillRect(p,p,e.width-2*p,s.height*o.height),i.fillStyle=s.color||"white",i.textAlign="center",i.textBaseline="middle",i.fillText(f,e.width/2,s.height*o.height/2+p)}for(var w=function(t){if(a[t].show)if("text"in a[t])i.font="".concat(o.height*a[t].height,"px serif"),i.fillStyle=a[t].color||"white",i.textAlign="left",i.textBaseline="bottom",a[t].width=i.measureText(a[t].text).width/o.height,i.fillText(a[t].text,o.width*a[t].x+p,o.height*a[t].y+p);else if("url"in a[t])if(y[t].svg&&y[t].svg.complete)i.drawImage(y[t].svg,o.width*a[t].x+p,o.height*a[t].y+p,o.height*a[t].width,o.height*a[t].height);else{var e=new Image;e.src=un.getSourceRootPath()+a[t].url,e.onload=function(){a[t].svg=e,i.drawImage(e,o.width*a[t].x+p,o.height*a[t].y+p,o.height*a[t].width,o.height*a[t].height)}}},k=0;k<a.length;k++)w(k);if(l.show){!function(){if(!n)return;var e=Cesium.Math.toDegrees(n.west),i=Cesium.Math.toDegrees(n.east),s=Cesium.Math.toDegrees(n.north),a=(Cesium.Math.toDegrees(n.south),turf.point([e,s])),r=turf.point([i,s]),l=turf.distance(a,r,{units:"kilometers"});t=1e3*l/o.width}();var x=o.width*l.x+p,_=o.height*l.y+p,E="m",S=.08*o.width*.12,D=.08*o.width/l.cell,P=Math.round(t*D),M=P+"";if(P<10);else{P=Number(M[0]);for(var O=0;O<M.length-1;O++)P*=10;D=P/t}l.width=D*l.cell,l.height=.2*l.width,P>=1e3&&(E="㎞",P=Math.round(P/1e3));var T=_;i.beginPath(),i.moveTo(x,T),i.lineTo(x+l.width,T),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke();for(var N=0,B=0;B<=l.cell;B++)N=x+B*D,i.beginPath(),i.moveTo(N,T-.1*l.width),i.lineTo(N,T),i.strokeStyle=l.color,i.lineWidth=.01*l.width,i.stroke(),i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="center",i.textBaseline="bottom",i.fillText(B*P,N,T-.1*l.width);i.font="".concat(S,"px Arial"),i.fillStyle=l.color,i.textAlign="left",i.textBaseline="bottom",i.fillText(E,N+1.2*S,T-.1*l.width)}c.show&&d&&d.complete&&(A(i,d,u,u,c.width,"top",1),A(i,d,e.width-c.width-u,u,c.width,"right",1),A(i,d,e.width-c.width-u,e.height-c.width-u,c.width,"bottom",1),A(i,d,u,e.height-c.width-u,c.width,"left",1)),e.toBlob((function(t){var e=URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download="高清出图-".concat(gt(),".png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}),"image/png",.95),r=!1,G.innerHTML="打印"}function A(t,i,n,o,s,a){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(n+s/2,o+s/2),a){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-s*r/2,-s/2),"top"===a||"bottom"===a?(t.lineTo(e.width-2*u-s/2,-s/2),t.lineTo(e.width-2*(u+s)+s/2,s/2)):(t.lineTo(e.height-2*u-s/2,-s/2),t.lineTo(e.height-2*(u+s)+s/2,s/2)),t.lineTo(s*r/2,s/2),t.closePath(),t.clip();var l,p=i.width/i.height*s;t.drawImage(i,-s/2,-s/2,p,s),l="top"===a||"bottom"===a?Math.ceil((e.width-2*u-2*c.width)/c.width):Math.ceil((e.height-2*u-2*c.width)/c.width),l++;for(var h=1;h<=l;h++)t.drawImage(i,-s/2+p*h,-s/2,p,s);t.restore()}}},gt=function(){var t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),a=String(t.getSeconds()).padStart(2,"0"),r=String(t.getMilliseconds()).padStart(3,"0");return"".concat(e).concat(i).concat(n).concat(o).concat(s).concat(a).concat(r)},vt=function(){if(n){var t=Cesium.Math.toDegrees(n.west),e=Cesium.Math.toDegrees(n.east),i=Cesium.Math.toDegrees(n.north),o=(Cesium.Math.toDegrees(n.south),turf.point([t,i])),s=turf.point([e,i]),a=turf.distance(o,s,{units:"kilometers"});p=1e3*a/L.width}},ft=function(t){var e=m;g.show&&d&&d.complete&&(e+=g.width);var i=.005*N.height;if(B.strokeStyle="red",B.lineWidth=.002*N.height,"text"in t)B.strokeRect(L.width*t.x+e,L.height*t.y+e-L.height*t.height,L.height*t.width,L.height*t.height);else if("url"in t)B.strokeRect(L.width*t.x+e,L.height*t.y+e,L.height*t.width,L.height*t.height);else if(t===b)return void B.strokeRect(L.width*t.x+e-.2*b.width,L.height*t.y+e-t.height-.5*b.height,t.width+.6*b.width,t.height+b.height);var n=ht(t,e);B.fillStyle="red",n.forEach((function(t){B.beginPath(),B.arc(t.x,t.y,i,0,2*Math.PI),B.fill()}))},mt=function(t,e,i,n,o,s){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;switch(t.save(),t.translate(i+o/2,n+o/2),s){case"right":t.rotate(Math.PI/2);break;case"bottom":t.rotate(Math.PI);break;case"left":t.rotate(3*Math.PI/2)}t.beginPath(),t.moveTo(-o*a/2,-o/2),"top"===s||"bottom"===s?(t.lineTo(N.width-2*m-o/2,-o/2),t.lineTo(N.width-2*(m+o)+o/2,o/2)):(t.lineTo(N.height-2*m-o/2,-o/2),t.lineTo(N.height-2*(m+o)+o/2,o/2)),t.lineTo(o*a/2,o/2),t.closePath(),t.clip();var r,l=e.width/e.height*o;t.drawImage(e,-o/2,-o/2,l,o),r="top"===s||"bottom"===s?Math.ceil((N.width-2*m-2*g.width)/g.width):Math.ceil((N.height-2*m-2*g.width)/g.width),r++;for(var c=1;c<=r;c++)t.drawImage(e,-o/2+l*c,-o/2,l,o);t.restore()},dt=function(){if(!h){var t=m;if(g.show&&d&&d.complete&&(t+=g.width),N.width=L.width+2*t,N.height=L.height+2*t,B.clearRect(0,0,N.width,N.height),B.rect(0,0,N.width,N.height),B.fillStyle="#ffffff",B.fill(),B.drawImage(L,t,t,L.width,L.height),v.show){var e=v.text,i=Math.max(5,v.height*L.height*.5);B.font="".concat(i,"px serif"),B.fillStyle=v.bgColor||"#5d5d5d",B.fillRect(t,t,N.width-2*t,v.height*L.height),B.fillStyle=v.color||"white",B.textAlign="center",B.textBaseline="middle",B.fillText(e,N.width/2,v.height*L.height/2+t)}for(var n=function(e){if(y[e].show)if("text"in y[e])B.font="".concat(L.height*y[e].height,"px serif"),B.fillStyle=y[e].color||"white",B.textAlign="left",B.textBaseline="bottom",y[e].width=B.measureText(y[e].text).width/L.height,B.fillText(y[e].text,L.width*y[e].x+t,L.height*y[e].y+t),y[e].isSelected&&ft(y[e]);else if("url"in y[e])if(y[e].svg&&y[e].svg.complete)B.drawImage(y[e].svg,L.width*y[e].x+t,L.height*y[e].y+t,L.height*y[e].width,L.height*y[e].height),y[e].isSelected&&ft(y[e]);else{var i=new Image;i.src=un.getSourceRootPath()+y[e].url,i.onload=function(){y[e].svg=i,B.drawImage(i,L.width*y[e].x+t,L.height*y[e].y+t,L.height*y[e].width,L.height*y[e].height),y[e].isSelected&&ft(y[e])}}},o=0;o<y.length;o++)n(o);if(b.show){var s=m;g.show&&d&&d.complete&&(s+=g.width);var a=L.width*b.x+s,r=L.height*b.y+s,l="m",c=.08*L.width*.12,u=.08*L.width/b.cell,f=Math.round(p*u),C=f+"";if(f<10);else{f=Number(C[0]);for(var w=0;w<C.length-1;w++)f*=10;u=f/p}b.width=u*b.cell,b.height=.2*b.width,f>=1e3&&(l="㎞",f=Math.round(f/1e3));var k=r;B.beginPath(),B.moveTo(a,k),B.lineTo(a+b.width,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke();for(var x=0,_=0;_<=b.cell;_++)x=a+_*u,B.beginPath(),B.moveTo(x,k-.1*b.width),B.lineTo(x,k),B.strokeStyle=b.color,B.lineWidth=.01*b.width,B.stroke(),B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="center",B.textBaseline="bottom",B.fillText(_*f,x,k-.1*b.width);B.font="".concat(c,"px Arial"),B.fillStyle=b.color,B.textAlign="left",B.textBaseline="bottom",B.fillText(l,x+1.2*c,k-.1*b.width),b.isSelected&&ft(b)}g.show&&d&&d.complete&&(mt(B,d,m,m,g.width,"top",1),mt(B,d,N.width-g.width-m,m,g.width,"right",1),mt(B,d,N.width-g.width-m,N.height-g.width-m,g.width,"bottom",1),mt(B,d,m,N.height-g.width-m,g.width,"left",1))}},ht=function(t,e){var i=t.x*L.width+e,n=t.y*L.height+e,o=t.width*L.height,s=t.height*L.height;return"text"in t?[{x:i,y:n-s},{x:i+o,y:n-s},{x:i,y:n},{x:i+o,y:n}]:[{x:i,y:n},{x:i+o,y:n},{x:i,y:n+s},{x:i+o,y:n+s}]},pt=function(t){var e,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(n-s*(e=s/a>n/o?n/s:o/a))/2;return(t.clientX-i.left-r)/e},ut=function(t){var e,i=N.getBoundingClientRect(),n=i.width,o=i.height,s=N.width,a=N.height,r=(e=s/a>n/o?n/s:o/a,(o-a*e)/2);return(t.clientY-i.top-r)/e},q=function(t){var e,i;if(g.color=t||"#000000",new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(t){q(t)},clear:function(){q("rgba(0,0,0,1)")}}),t){e=f.replace(/fill="[^"]+"/g,'fill="'.concat(t,'"'))}else e=f;i="data:image/svg+xml;base64,"+btoa(Array.from((new TextEncoder).encode(e),(function(t){return String.fromCharCode(t)})).join("")),(d=new Image).setAttribute("crossOrigin","anonymous"),d.src=i,d.onload=function(){g.show&&dt()}},J=function(t){g.url=t,g.url&&((d=new Image).setAttribute("crossOrigin","anonymous"),g.url.endsWith("svg")?fetch(un.getSourceRootPath()+g.url).then(function(){var t=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.ok){t.next=5;break}return t.next=3,e.text();case 3:f=t.sent,q(g.color);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):(d.src=un.getSourceRootPath()+g.url,d.onload=function(){g.show&&dt()}))},W=function(t){u=t,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}];for(var e=0;e<l.length;e++)if(l[e].id===u){v=l[e].title||v,m=l[e].margin||0==l[e].margin?l[e].margin:m,y=l[e].data||y,(g=l[e].border||g).color=g.color||"#000000",b=l[e].plottingScale||b;break}U(),dt()},U=function(){if(!h){m*=L.width,Z=L.height/140,_.value=v.text,E.checked=v.show,S.value=y[1].text,D.checked=y[1].show,P.checked=y[2].show;for(var t=0;t<C.length;t++)C[t]===y[2].url&&(M[t].checked=!0);O.checked=b.show,g.width=L.width*g.width;var e=m;g.show&&d&&d.complete&&(e+=g.width),N.width=L.width+2*e,N.height=L.height+2*e,R&&(R.checked=y[0].show),I&&(y[0].text?I.setValue(y[0].text):(I.nowBtn&&I.nowBtn(),y[0].text=I.getValue())),z&&F&&H&&(F.value=g.url,z.legp_searchActive(g.url),H.style.backgroundImage="url(".concat(un.getSourceRootPath()+g.url,")")),T.checked=g.show,d=null,g&&g.url&&J(g.url)}},r=!1,l=[{name:"模板一",value:"模板一",id:"1",margin:.03,title:{text:"标题一",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},border:{show:!1,url:"/custom/img/map-border1.svg",width:.01,color:""},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.87,y:.97},data:[{text:"",x:.02,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.02,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.02,y:.1,show:!1,isSelected:!1,url:"/custom/img/icon-compass1.svg",width:.1,height:.1}]},{name:"模板二",value:"模板二",id:"2",margin:.03,border:{show:!0,url:"/custom/img/map-border2.svg",width:.01},title:{text:"标题二",height:.05,bgColor:"#5d5d5d",color:"#ffffff",show:!0},plottingScale:{cell:2,color:"#ffffff",show:!0,isSelected:!1,x:.02,y:.97},data:[{text:"",x:.88,y:.93,isSelected:!1,show:!0,color:"#ffffff",height:.03},{text:"",x:.87,y:.97,isSelected:!1,show:!0,color:"#ffffff",height:.03},{x:.91,y:.1,show:!0,isSelected:!1,url:"/custom/img/icon-compass4.svg",width:.1,height:.1}]}],u="1",h=!0,m=0,v={text:"标题",height:40,bgColor:"#5d5d5d",color:"#ffffff",show:!0},g={show:!0,url:un.getSourceRootPath()+"/custom/img/map-border1.svg",width:20},y=[{text:"",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{text:"-",x:10,y:100,height:24,fontSize:24,isSelected:!1,show:!0,color:"#ffffff"},{x:10,y:100,width:100,height:100,show:!1,isSelected:!1,url:un.getSourceRootPath()+"/custom/img/icon-compass1.svg"}],b={cell:2,color:"#ffffff",show:!0,isSelected:!1,x:10,y:100,width:100},C=["/custom/img/icon-compass1.svg","/custom/img/icon-compass2.svg","/custom/img/icon-compass3.svg","/custom/img/icon-compass4.svg"],c&&(c.close(),c=null),t.next=26,new rn(e,{},{title:"地图打印",left:"5%",top:"10%",ismove:!1});case 26:(c=t.sent)._element.body.className=c._element.body.className+" map-print",(w=document.createElement("div")).innerHTML='\n <div class="left">\n <div class="div-item">\n <div class="title">图件信息</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col template-box">\n <span class="label" style="flex: 0 0 56px;">模板</span>\n <div class="template" style="width: 213px;"></div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">标题</span>\n <input class="title-input" type="text">\n <input class="title-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图日期</span>\n <input class="print-date" type="text" placeholder="YYYY-MM-DD" readonly>\n <input class="print-date-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">制图单位</span>\n <input class="unit-input" type="text">\n <input class="unit-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col map-border-box">\n <span class="label" style="flex: 0 0 56px;">图框</span>\n <div class="map-border" style="width: 173px;"></div>\n <div class="border-color" style="margin-top: 3px;margin-left: 12px;"></div>\n <input class="map-border-checkbox" type="checkbox" style="margin-left: 15px;">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="title">地图要素</div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">指北针</span>\n <input class="compass-checkbox" type="checkbox" style="margin-top: 11px;">\n <div class="row">\n <div class="col" style="margin-left: 10px;flex-wrap: wrap;">\n '.concat(function(){for(var t="",e=0;e<C.length;e++){var i=un.getSourceRootPath()+C[e];t+='<div style="display: flex;align-items: center;">\n <input class="compass-radio" type="radio" name="option">\n <img src="'.concat(i,'" alt="" style="width: 38px; height: 38px; margin: 0 5px;">\n </div>')}return t}(),'\n </div>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="align-items: flex-start;">\n <span class="label" style="flex: 0 0 56px;margin-top: 9px;">比例尺</span>\n <input class="plotting-scale-checkbox" type="checkbox" style="margin-top: 11px;">\n </div>\n </div>\n </div>\n </div>\n <div class="right">\n <div class="map-img-box">\n\n </div>\n </div>\n '),c.contentAppChild(w),k=w.getElementsByClassName("left")[0],x=w.getElementsByClassName("right")[0],_=k.getElementsByClassName("title-input")[0],E=k.getElementsByClassName("title-checkbox")[0],S=k.getElementsByClassName("unit-input")[0],D=k.getElementsByClassName("unit-checkbox")[0],P=k.getElementsByClassName("compass-checkbox")[0],M=k.getElementsByClassName("compass-radio"),O=k.getElementsByClassName("plotting-scale-checkbox")[0],T=k.getElementsByClassName("map-border-checkbox")[0],N=document.createElement("canvas"),B=N.getContext("2d"),x.appendChild(N),(L=new Image).src=i,L.onload=function(){h=!1,vt(),W(u)},_.value=v.text,E.checked=v.show,_.addEventListener("input",(function(){v.text=this.value,L.complete&&dt()})),E.addEventListener("change",(function(){v.show=this.checked,L.complete&&dt()})),S.value=y[1].text,D.checked=y[1].show,S.addEventListener("input",(function(){y[1].text=this.value,L&&L.complete&&dt()})),D.addEventListener("change",(function(){y[1].show=this.checked,L&&L.complete&&dt()})),P.checked=y[2].show,P.addEventListener("change",(function(){y[2].show=this.checked,L&&L.complete&&dt()})),A=a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M[e].addEventListener("change",(function(){this.checked&&(y[2].svg=null,y[2].url=C[e],L&&L.complete&&dt())}));case 1:case"end":return t.stop()}}),t)})),j=0;case 59:if(!(j<M.length)){t.next=64;break}return t.delegateYield(A(j),"t0",61);case 61:j++,t.next=59;break;case 64:O.checked=b.show,O.addEventListener("change",(function(){b.show=this.checked,L&&L.complete&&dt()})),T.checked=g.show,T.addEventListener("change",(function(){g.show=this.checked,d&&d.complete&&dt()})),new YJColorPicker({el:w.getElementsByClassName("border-color")[0],size:"mini",alpha:!1,defaultColor:g.color,disabled:!1,openPickerAni:"opacity",sure:function(t){q(t)},clear:function(){q("rgba(0,0,0,1)")}}),setTimeout((function(){V=c._element.foot.getElementsByClassName("close")[0],(G=document.createElement("button")).className="export",G.innerHTML="打印",k.appendChild(V),k.appendChild(G),G.addEventListener("click",(function(){r||(r=!0,G.innerHTML='<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印',yt())}));var t=w.getElementsByClassName("print-date")[0];(R=w.getElementsByClassName("print-date-checkbox")[0]).checked=y[0].show,R.addEventListener("change",(function(){y[0].show=this.checked,L.complete&&dt()})),I=jeDate(t,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){y[0].text=t.val,L.complete&&dt()}}),y[0].text?I.setValue(y[0].text):(I.nowBtn&&I.nowBtn(),y[0].text=I.getValue(),dt());var e=Y(c._element.content.getElementsByClassName("template-box")[0],".template");if(e){e.legp_search(l);for(var i=c._element.content.getElementsByClassName("template")[0].getElementsByTagName("input")[0],n=0;n<l.length;n++)if(l[n].id==u){i.value=l[n].value,e.legp_searchActive(l[n].value);break}i.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===i.value){W(l[t].id);break}}))}var o=[{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border1.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border1.svg",key:0},{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border2.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border2.svg",key:1},{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border3.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border3.svg",key:2},{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border4.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border4.svg",key:3},{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border5.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border5.svg",key:4},{name:'<span style="background-image: url('.concat(un.getSourceRootPath(),'/custom/img/map-border6.svg);background-size: auto 100%;background-repeat: repeat-x;"></span>'),value:"/custom/img/map-border6.svg",key:5}];if(z=Y(c._element.content.getElementsByClassName("map-border-box")[0],".map-border")){z.legp_search(o),(H=document.createElement("span")).className="icon icon-active",H.style.width="calc(100% - 40px)",H.style.height="calc(100% - 12px)",H.style.position="absolute",H.style.top="6px",H.style.left="10px",H.style.pointerEvents="none",H.style.backgroundImage="url(".concat(un.getSourceRootPath()+g.url,")"),H.style.backgroundSize="auto 100%",H.style.backgroundRepeat="repeat-x",c._element.content.getElementsByClassName("map-border")[0].getElementsByClassName("cy_datalist")[0].appendChild(H),(F=c._element.content.getElementsByClassName("map-border")[0].getElementsByTagName("input")[0]).style.fontSize=0,F.style.color="transparent";for(var s=0;s<o.length;s++)if(o[s].value==g.url){F.value=o[s].value,z.legp_searchActive(o[s].value);break}F.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===F.value){H.style.backgroundImage="url(".concat(un.getSourceRootPath()+o[t].value,")"),J(o[t].value);break}}))}}),0),X=!1,Z=5,K=null,$=!1,Q=!1,tt=null,N.addEventListener("mousedown",(function(t){var e=pt(t),i=ut(t),n=m;if(g.show&&d&&d.complete&&(n+=g.width),v.show&&i>=v.height*L.height+n-Z&&i<=v.height*L.height+n+Z){X=!0;for(var o=0;o<y.length;o++)y[o].isSelected=!1;return K=null,$=!1,Q=!1,void(tt=null)}if(K&&K!==b){var s=.005*N.height;ht(K,n).forEach((function(t,n){e>=t.x-s&&e<=t.x+s&&i>=t.y-s&&i<=t.y+s&&(Q=!0,$=!1,tt=n,et=e,it=i,rt=K.width*L.height,lt=K.height*L.height,"text"in K&&(rt=K.width*L.height,ct=K.height))}))}if(!Q){for(var a=0;a<y.length;a++)y[a].isSelected=!1;b.isSelected=!1,K=null,$=!1,Q=!1,tt=null;for(var r=y.length-1;r>=0;r--)if(y[r].show){if("text"in y[r]&&e>=L.width*y[r].x+n&&e<=L.width*y[r].x+n+L.height*y[r].width&&i>=L.height*y[r].y+n-L.height*y[r].height&&i<=L.height*y[r].y+n){K=y[r],y[r].isSelected=!0,$=!0,et=e,it=i,nt=L.height*y[r].y-L.height*y[r].height,ot=L.width*y[r].x+L.height*y[r].width,st=L.width*y[r].x+n,at=L.height*y[r].y+n,dt();break}if("url"in y[r]&&y[r].svg&&y[r].svg.complete&&y[r].show&&e>=L.width*y[r].x+n&&e<=L.width*y[r].x+n+L.height*y[r].width&&i>=L.height*y[r].y+n&&i<=L.height*y[r].y+n+L.height*y[r].height){K=y[r],y[r].isSelected=!0,$=!0,et=e,it=i,nt=L.height*y[r].y+L.height*y[r].height,ot=L.width*y[r].x+L.height*y[r].width,st=L.width*y[r].x+n,at=L.height*y[r].y+n,dt();break}}b.show&&e>=L.width*b.x+n-.2*b.width&&e<=L.width*b.x+n-.2*b.width+b.width+.6*b.width&&i>=L.height*b.y+n-b.height-.5*b.height&&i<=L.height*b.y+n-.5*b.height+b.height&&(K=b,b.isSelected=!0,$=!0,et=e,it=i,nt=L.height*b.y+n+b.height,ot=L.width*b.x+n+b.width,st=L.width*b.x+n,at=L.height*b.y+n,dt()),K||dt()}})),N.addEventListener("mousemove",(function(t){var e=m;g.show&&d&&d.complete&&(e+=g.width);var i=pt(t),n=ut(t);if(!(i<0||n<0||i>N.width||n>N.height)){if(v.show){var o=m;g.show&&d&&d.complete&&(o+=g.width),n>=v.height*L.height+o-Z&&n<=v.height*L.height+o+Z?N.style.cursor="n-resize":N.style.cursor="default",X&&(v.height=Math.min(Math.max(n-o,30)/L.height,1),dt())}if($){var s=i-et,a=n-it;K.x=(st+s-e)/L.width,K.y=(at+a-e)/L.height,dt()}if(Q){var r,l=i-et,c=n-it;switch(tt){case 0:"text"in K?(r=(rt-l)/rt,K.height=Math.max(10/L.height,ct*r),K.x=(ot-K.width*L.height)/L.width):"url"in K&&(K.x=(ot-K.width*L.height)/L.width,K.y=(nt-K.height*L.height)/L.height,K.width=Math.max(10,rt-l)/L.height,K.height=Math.max(10,lt-c)/L.height);break;case 1:"text"in K?(r=(rt+l)/rt,K.height=Math.max(10/L.height,ct*r)):"url"in K&&(K.width=Math.max(10,rt+l)/L.height,K.height=Math.max(10,lt-c)/L.height,K.y=(nt-K.height*L.height)/L.height);break;case 2:"text"in K?(r=(rt-l)/rt,K.height=Math.max(10/L.height,ct*r),K.x=(ot-K.width*L.height)/L.width,K.y=(nt+K.height*L.height)/L.height):"url"in K&&(K.x=(ot-K.width*L.height)/L.width,K.width=Math.max(10,rt-l)/L.height,K.height=Math.max(10,lt+c)/L.height);break;case 3:"text"in K?(r=(rt+l)/rt,K.height=Math.max(10/L.height,ct*r),K.y=(nt+K.height*L.height)/L.height):"url"in K&&(K.width=Math.max(10,rt+l)/L.height,K.height=Math.max(10,lt+c)/L.height)}dt()}}})),document.addEventListener("mouseup",(function(){X=!1;g.show&&d&&d.complete&&g.width;for(var t=0;t<y.length;t++)y[t].show&&y[t].isSelected&&(nt=L.height*y[t].y-L.height*y[t].height,ot=L.width*y[t].x+L.height*y[t].width,"url"in y[t]&&(nt=L.height*y[t].y+L.height*y[t].height,ot=L.width*y[t].x+L.height*y[t].width),st=y[t].x,at=y[t].y);b.show&&b.isSelected&&(nt=b.y+b.height,ot=b.x+b.width,st=b.x,at=b.y),$=!1,Q=!1,tt=null}));case 79:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var hn=function(t,e,i,n){return pn.apply(this,arguments)};var dn;function mn(){return(mn=o()(a.a.mark((function t(e){var i,n,o=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=o.length>1&&void 0!==o[1]?o[1]:function(){},n=e.viewer.canvas.toDataURL(),i&&i(n);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function fn(){return(fn=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,x,E,S=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S.length>1&&void 0!==S[1]?S[1]:{},S.length>2&&void 0!==S[2]?S[2]:function(){},e){t.next=4;break}return t.abrupt("return");case 4:return qt(),Ee(e),dn&&(dn.close(),dn=null),i=e.viewer.scene.screenSpaceCameraController.enableTranslate,n=e.viewer.scene.screenSpaceCameraController.enableTilt,s=e.viewer.scene.screenSpaceCameraController.enableLook,r=1,m=new fi,t.next=14,new rn(e,{},{title:"高清出图",left:"180px",top:"100px",confirmCallBack:function(t){d&&(d.desist(),d=null),c&&(c.style.width="0%"),p&&(p.style.left="0%"),u&&(u.style.width="0%"),h&&(h.innerHTML="0%"),d=new E},closeCallBack:function(){e.viewer.scene.screenSpaceCameraController.enableTranslate=i,e.viewer.scene.screenSpaceCameraController.enableTilt=n,e.viewer.scene.screenSpaceCameraController.enableLook=s,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="auto",d&&(d.desist(),d=null),dn=void 0}});case 14:for((dn=t.sent)._element.body.className=dn._element.body.className+" screenShotHD",(f=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>当前窗口长宽:<span class="input-width">'.concat(e.viewer.canvas.width,'</span>*<span class="input-height">').concat(e.viewer.canvas.height,'</span>像素</span>\n </div>\n </div>\n <div class="row scale-box" style="align-items: flex-start;">\n <div class="col">\n <span class="label">图片大小</span>\n <div class="input input-select scale"></div>\n <span>倍窗口</span>\n </div>\n </div>\n <div class="row text" style="align-items: flex-start;">\n <div class="col">\n <span>输出图片长宽:<span class="output-width">').concat(e.viewer.canvas.width*r,'</span>*<span class="output-height">').concat(e.viewer.canvas.height*r,'</span>像素</span>\n </div>\n </div>\n <div class="row" style="align-items: flex-start; margin-bottom: 20px;">\n <div class="col">\n <span class="label">输出进度</span>\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0%</span>\n <span class="range-node-text">100%</span>\n <div class="range-node-active"><span class="range-node-active-text">0%</span></div>\n </div>\n <input class="progress-input" type="range" max="100" min="0" step="0.01">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n '),dn.contentAppChild(f),e.viewer.scene.screenSpaceCameraController.enableTranslate=!1,e.viewer.scene.screenSpaceCameraController.enableTilt=!1,e.viewer.scene.screenSpaceCameraController.enableLook=!1,e.viewer._element.getElementsByClassName("compass")[0].style.pointerEvents="none",(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/2)))||(v=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.clientWidth/2,e.viewer.canvas.clientHeight/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(v=e.viewer.camera.position),g=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,y=m.cartesian3Towgs84(v,e.viewer),e.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(y.lng,y.lat,g),orientation:{heading:0,pitch:Cesium.Math.toRadians(-90),roll:0},duration:1}),b=[],C=1;C<=10;C++)b.push({name:C,value:C});c=document.getElementsByClassName("progress-input")[0],u=document.getElementsByClassName("range-process")[0],p=f.getElementsByClassName("range-node-active")[0],h=f.getElementsByClassName("range-node-active-text")[0],(w=Y(dn._element.content.getElementsByClassName("scale-box")[0],".scale"))&&(w.legp_search(b),x=dn._element.content.getElementsByClassName("scale")[0].getElementsByTagName("input")[0],r=b[0].value,w.legp_searchActive(b[0].value),x.value=b[0].value,x.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value==x.value){r=b[t].value,dn._element.content.getElementsByClassName("output-width")[0].innerHTML=e.viewer.canvas.width*r,dn._element.content.getElementsByClassName("output-height")[0].innerHTML=e.viewer.canvas.height*r;break}}))),E=function(){return _()((function t(){k()(this,t),this.state=!1,this.start()}),[{key:"start",value:function(){if(e.viewer.scene.imageryLayers._layers.length<=1)return this.error="未加载底图!",window.ELEMENT&&window.ELEMENT.Message({message:this.error,type:"warning",duration:1500}),void console.warn(this.error);for(var t=!1,i=0;i<e.viewer.scene.imageryLayers._layers.length;i++){var n=e.viewer.scene.imageryLayers._layers[i];!n||!n.show||n.notes&&"default-base-map"===n.notes||(t=!0)}if(!t)return this.error="未加载底图!",window.ELEMENT&&window.ELEMENT.Message({message:this.error,type:"warning",duration:1500}),void console.warn(this.error);var s=0;this.state=!0;var c=this;!function t(e){var i=2*e;i<=r&&(s++,t(i))}(1),s+=1;var d=e.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(e.viewer.canvas.width/2,e.viewer.canvas.height/(2-(90+e.viewer.camera.pitch/(Cesium.Math.PI/180))/110)));d||(d=e.viewer.camera.position);for(var f,v,g=m.cartesian3Towgs84(e.viewer.camera.position,e.viewer).alt,y=(f=g,v=-40467.74,Math.round(v+80955.31/(1+Math.pow(f/91610.74,7096758e-11)))+1),b=e.viewer.camera.computeViewRectangle(),C={},w=0,k=0,x=0;x<e.viewer.scene.imageryLayers._layers.length;x++){var _=e.viewer.scene.imageryLayers._layers[x];_&&_.show&&_.imageryProvider&&_.imageryProvider.url&&Cesium.Rectangle.intersection(b,_.imageryProvider.rectangle)&&(!_.notes||"default-base-map"!==_.notes)&&w++}var E=100/w,S=!1;!function t(i,n){var d=e.viewer.scene.imageryLayers._layers[i];if(!d)return void(S||(c.error="当前范围内未找到底图数据!",window.ELEMENT&&window.ELEMENT.Message({message:c.error,type:"warning",duration:1500}),console.warn(c.error)));if(!d.show||!d.imageryProvider||!d.imageryProvider.url||!Cesium.Rectangle.intersection(b,d.imageryProvider.rectangle)||d.notes&&"default-base-map"===d.notes){var m=i+=1;return void t(m,n)}S=!0,k++,C[i]={value:0};var f,v=0,g=d.imageryProvider;l||0===l?f=l:((f=y+s-1)>g.maximumLevel&&(f=g.maximumLevel),f<g.minimumLevel&&(f=g.minimumLevel));function x(){var s=g.tilingScheme.positionToTileXY(Cesium.Rectangle.northwest(b),f),l=g.tilingScheme.positionToTileXY(Cesium.Rectangle.southeast(b),f);if(!s||!l){return window.ELEMENT&&window.ELEMENT.Message({message:"超出地球范围!",type:"warning",duration:1500}),void console.warn("超出地球范围!")}var d=g.tilingScheme.getNumberOfXTilesAtLevel(f),m=(g.tilingScheme.getNumberOfYTilesAtLevel(f),s.x),y=s.y,x=l.x,_=l.y,S=(x-m+1)*(_-y+1),D=document.createElement("canvas");D.width=256*(x-m+1),D.height=256*(_-y+1);var P=D.getContext("2d"),M=g.tilingScheme.tileXYToRectangle(x,_,f),O=g.tilingScheme.tileXYToRectangle(m,y,f),T=new Cesium.Rectangle(O.west,M.south,M.east,O.north),N=b,B=N.west-T.west,L=T.east-N.east,A=T.north-N.north,j=N.south-T.south,I=B/(T.east-T.west);I===1/0&&(I=0);var R=L/(T.east-T.west);R===1/0&&(R=0);var F=A/(T.north-T.south);F===1/0&&(F=0);var z=j/(T.north-T.south);z===1/0&&(z=0);var H=D.width*I,V=D.height*F,G=D.width*R,U=D.height*z;D.width=D.width-H-G,D.height=D.height-V-U,0==D.width&&(D.width=1),0==D.height&&(D.height=1);for(var W=_,Y=[],J=_;J>=y;J--)for(var q=x;q>=m;q--)Y.push({x:q,y:J});var X={count:0},Z=0,K=-1,$={count:0},Q=0;function tt(){$.count=0,Q=0;for(var t=30*++K;t<30*(K+1);t++){if(t>=Y.length)return;et(t)}}function et(t){if(c.state)try{var e=Y[t].x;e<0&&(e+=d);var i,n=new Image;n.setAttribute("crossOrigin","anonymous"),n.onload=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P.drawImage(n,256*(Y[t].x-m)-parseFloat(H.toFixed(0)),256*(Y[t].y-y)-parseFloat(V.toFixed(0)),256,256),v++,X.count++,$.count++;case 4:case"end":return e.stop()}}),e)}))),n.onerror=function(){v++,X.count++,$.count++},i=-1!==g.url.indexOf("{x}")&&-1!==g.url.indexOf("{y}")&&-1!==g.url.indexOf("{z}")?g.url.replace(/\{x\}/g,e).replace(/\{y\}/g,Y[t].y).replace(/\{z\}/g,f):-1!==g.url.indexOf("{TileMatrix}")&&-1!==g.url.indexOf("{TileRow}")&&-1!==g.url.indexOf("{TileCol}")?g.url.replace(/\{TileCol\}/g,e).replace(/\{TileRow\}/g,Y[t].y).replace(/\{TileMatrix\}/g,f):g._layer&&g._style&&g._tileMatrixSetID&&g._format?g.url+"&tilematrix=".concat(f,"&layer=").concat(g._layer,"&style=").concat(g._style,"&tilerow=").concat(W,"&tilecol=").concat(e,"&tilematrixset=").concat(g._tileMatrixSetID,"&format=").concat(g._format):g.url+"tile/".concat(f,"/").concat(Y[t].y,"/").concat(e),n.src=i}catch(t){v++,X.count++,$.count++}}Object.defineProperty($,"count",{get:function(){return Q},set:function(t){(Q=t)>=30&&tt()}}),Object.defineProperty(X,"count",{get:function(){return Z},set:function(o){Z=o,C[i].value=v/S*E;var s=0;for(var a in C)s+=C[a].value;if(u.style.width=.99*s+"%",p.style.left=.99*s+"%",h.innerHTML=Math.floor(.99*s*100)/100+"%",Z===(x-m+1)*(_-y+1)){var l=D.getContext("2d"),d=D.cloneNode(!0),f=d.getContext("2d"),g=l.getImageData(0,0,D.width,D.height);if(f.putImageData(g,0,0),D.width=e.viewer.canvas.width*r,D.height=e.viewer.canvas.height*r,l.drawImage(d,0,0,D.width,D.height),n){if(n.getContext("2d").drawImage(D,0,0),k!=w){var P=i+=1;return void t(P,n)}var M=n.toDataURL("image/jpeg",.95),O=document.createElement("canvas"),T=O.getContext("2d");O.width=n.width/r,O.height=n.height/r,T.drawImage(n,0,0,O.width,O.height),hn(e,O.toDataURL("image/jpeg",.95),b,M),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}else{if(k!=w){var N=i+=1;return void t(N,D)}var B=D.toDataURL("image/jpeg",.95),L=document.createElement("canvas"),A=L.getContext("2d");L.width=D.width/r,L.height=D.height/r,A.drawImage(D,0,0,L.width,L.height),hn(e,L.toDataURL("image/jpeg",.95),b,B),u.style.width="100%",p.style.left="100%",h.innerHTML="100%",c.state=!1}}}}),g._readyError?X.count=(x-m+1)*(_-y+1):tt()}if(g._readyError)return C[i]={value:E},void x();g.readyPromise.then((function(){x()})).catch((function(t){g._readyError=!0,C[i]={value:E},x()}))}(0)}},{key:"desist",value:function(){this.state=!1}}])}();case 37:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vn=i(13),gn=i.n(vn);function yn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Cn=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){var i=this;this.element={};for(var n=function(){if(!e[o]||!e[o].attributes)return 1;var n,s={input:[],change:[],blur:[],click:[]},a=!1,r=[],l=yn(e[o].attributes);try{var c=function(){var l=n.value;switch(l.name){case"@model":a=!0,"checkbox"==e[o].type?(s.change.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):("number"==e[o].type?(s.input.push((function(t){if(t.target.value||0===t.target.value){var e=t.target.value;e=Number(e),"."==t.data||"-"==t.data&&!t.target.value||(t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min)))}})),s.blur.push((function(e){var i=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[l.value]=i}))):s.input.push((function(e){t[l.value]=e.target.value})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],r.push(l.name);break;case"@click":a=!0,s.click.push((function(e){"function"==typeof t[l.value]&&t[l.value](e)})),r.push(l.name)}};for(l.s();!(n=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<r.length;u++)e[o].attributes.removeNamedItem(r[u]);if(a){var p=function(t){s[t].length>0&&e[o].addEventListener(t,(function(e){for(var i=0;i<s[t].length;i++)s[t][i](e)}))};for(var h in s)p(h)}},o=0;o<e.length;o++)n()}}])}();C()(Cn,"event",{});var wn=Cn,kn=function(){return _()((function t(e,i,n){var o;k()(this,t);for(var s=(o="string"==typeof e?document.getElementById(e):e).getElementsByTagName("DIV-cy-tab-pane"),a='<div class="DIV-cy-tab-top">',r='<div class="DIV-cy-tab-content">',l=0,c=0;c<s.length;c++){var u=!1;if(n&&n.tabHide&&Array.isArray(n.tabHide))for(var p=0;p<n.tabHide.length;p++)if(s[c].getAttribute("label")===n.tabHide[p]){u=!0;break}if(!u){var h="display: none;",d="";0==l&&(h="",d="is-active"),a=a+'\n <div class="DIV-cy-tab-pane-title">\n <div class="DIV-cy-tab-pane-title-p '+d+'" tabindex="'+l+'"><span>'+s[c].getAttribute("label")+"</span></div>\n </div>\n ",r=r+'<div class="DIV-cy-tab-content-pane '.concat(s[c].className,'" style="')+h+'">'+s[c].innerHTML+"</div>",l++}}a+="</div>",r+="</div>";var m=document.createElement("div");"string"==typeof e&&m.setAttribute("id",e),m.setAttribute("class","DIV-cy-tabs"),m.innerHTML=a+r,o.parentNode.insertBefore(m,o),o.parentNode.removeChild(o);for(var f=m.getElementsByClassName("DIV-cy-tab-pane-title-p"),v=0;v<f.length;v++)f[v].addEventListener("click",(function(t){var e=t.target.getAttribute("tabindex"),n=m.getElementsByClassName("DIV-cy-tab-content-pane");i&&i(e);for(var o=0;o<n.length;o++)o===parseInt(e)?(n[o].style.display="",f[o].className="DIV-cy-tab-pane-title-p is-active"):(n[o].style.display="none",f[o].className="DIV-cy-tab-pane-title-p");n[parseInt(e)].style.display=""}));this.clickTabCallBack=i}),[{key:"clickTabCallBack",value:function(){this.clickTabCallBack&&this.clickTabCallBack()}}])}();function xn(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function _n(t,e,i){return t.set(Sn(t,e),i),i}function En(t,e){return t.get(Sn(t,e))}function Sn(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Dn=new WeakMap,Pn=new WeakMap,Mn=new WeakMap,On=new(function(){return _()((function t(){k()(this,t),xn(this,Dn,void 0),xn(this,Pn,void 0),xn(this,Mn,void 0),this.richTextBox=document.createElement("div"),this.richTextBox.className="richText-box",this.richTextBox.style.position="absolute",this.richTextBox.style.width="60%",this.richTextBox.style.height="70%",this.richTextBox.style.backgroundColor="#ffffff",this.richTextBox.style.zIndex="999999",this.richTextBox.style.left="20%",this.richTextBox.style.top="15%",this.richTextBox.style.display="flex",this.richTextBox.style.flexDirection="column",this.uploadImageServer,this.uploadVideoServer}),[{key:"open",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=this;this.title=i,this.objectId=t,document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null;var r='\n <div class="richText-box-mask"></div>\n <div class="richText-content">\n <div class="richText-header">\n <p>'.concat(i,'</P>\n <i class="close">✕</i>\n </div>\n <div id="toolbar-container"></div>\n <div id="editor-container"></div>\n <div class="richText-footer">\n <button class="primary">确认</button>\n <button class="cancel">取消</button>\n </div>\n </div>\n ');this.richTextBox.innerHTML=r,document.body.appendChild(this.richTextBox);var l=window.wangEditor,c=l.createEditor,u=l.createToolbar,p={placeholder:"请输入正文...",MENU_CONF:{uploadImage:{fieldName:"file",server:this.uploadImageServer,customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}},uploadVideo:{server:this.uploadVideoServer,allowedFileTypes:["video/mp4","video/mp3","video/ogg","video/webm","video/avi"],customUpload:function(t,e){return o()(a.a.mark((function i(){var n;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,s.upload(t);case 2:n=i.sent,e((s.host=s.host||h())+"/"+n);case 4:case"end":return i.stop()}}),i)})))()}}},onChange:function(t){t.getHtml()}};this.editor=c({selector:"#editor-container",html:"<p><br></p>",config:p,mode:"default"});var d={excludeKeys:["emotion","insertImage","insertVideo"]};u({editor:this.editor,selector:"#toolbar-container",config:d,mode:"default"});this.editor.on("fullScreen",(function(){console.log("fullScreen")})),this.editor.setHtml(n);var m=this.richTextBox.getElementsByClassName("close")[0],f=this.richTextBox.getElementsByClassName("primary")[0],v=this.richTextBox.getElementsByClassName("cancel")[0];m.addEventListener("click",(function(){e.close()})),f.addEventListener("click",(function(){var t=e.editor.getHtml();e.primaryCallBack(t),e.close()})),v.addEventListener("click",(function(){e.close()}))}},{key:"close",value:function(){document.body.getElementsByClassName("richText-box")[0]&&document.body.removeChild(this.richTextBox),this.editor=null}},{key:"upload",value:(t=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.host=this.host||h(),i=this.host.endsWith("yjearth4.0")?this.host+"/api/v1/richText/upload":this.host+"/yjearth4.0/api/v1/richText/upload",(n=new FormData).append("file",e),t.next=7,fetch(i,{method:"post",body:n,headers:{token:m(),Authorization:"Bearer "+m()}});case 7:if(200!==(o=t.sent).status){t.next=14;break}return t.next=11,o.json();case 11:if(200!==(s=t.sent).code&&0!==s.code){t.next=14;break}return t.abrupt("return",s.data.url);case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"customUploadVideo",get:function(){return En(Dn,this)},set:function(t){_n(Dn,this,t)}},{key:"customUploadContent",get:function(){return En(Pn,this)},set:function(t){_n(Pn,this,t)}},{key:"primaryCallBack",get:function(){return En(Mn,this)},set:function(t){_n(Mn,this,t)}}]);var t}());function Tn(t,e,i,n,o){var s=Math.ceil(e/i)||1;!function i(){var a,r="<li class='list-items' pagenumber=1>1</li>",l="<li class='list-items' pagenumber=".concat(s,">").concat(s,"</li>"),c="<li class='list-items btnGoLeft'>...</li>",u="<li class='list-items btnGoRight'>...</li>",p="<div style='line-height:20px;' class='pageTips'>共 ".concat(e," 条</div > ");if(a="<li class='list-items lbl btnPrev'>‹</li>",s<=6)for(var h=1;h<=s;h++)a+="<li class='list-items' pagenumber=".concat(h,">").concat(h,"</li>");else if(n<=4){for(var d=1;d<=5;d++)a+="<li class='list-items' pagenumber=".concat(d,">").concat(d,"</li>");a+=u,a+=l}else if(n>s-3){a+=r,a+=c;for(var m=s-4;m<=s;m++)a+="<li class='list-items' pagenumber=".concat(m,">").concat(m,"</li>")}else{a+=r,a+=c;for(var f=n-1;f<=n+1;f++)a+="<li class='list-items' pagenumber=".concat(f,">").concat(f,"</li>");a+=u,a+=l}a+="<li class='list-items lbr btnNext'>›</li>",a+=p,t.innerHTML=a,t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),t.querySelectorAll("li[pagenumber]").forEach((function(e){e.onclick=function(){n=Number(this.innerHTML),t.querySelector("li[pagenumber='"+n+"']").classList.add("active"),a="",i(),o&&o(n)}})),t.getElementsByClassName("btnPrev")[0].addEventListener("click",(function(){n>1&&(n--,a="",i(),o&&o(n))})),t.getElementsByClassName("btnNext")[0].addEventListener("click",(function(){n<s&&(n++,a="",i(),o&&o(n))}));var v=t.getElementsByClassName("btnGoLeft")[0];v&&(v.addEventListener("mouseenter",(function(){this.innerHTML="<"})),v.addEventListener("mouseleave",(function(){this.innerHTML="..."})),v.addEventListener("click",(function(){n>10&&(n-=10,a="",i(),o&&o(n))})));var g=t.getElementsByClassName("btnGoRight")[0];g&&(g.addEventListener("mouseenter",(function(){this.innerHTML=">"})),g.addEventListener("mouseleave",(function(){this.innerHTML="..."})),g.addEventListener("click",(function(){n<s-10&&(n+=10,a="",i(),o&&o(n))})))}()}function Nn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bn(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Nn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Nn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ln(t){var e=h();t.cameraSelect=function(n){if(!t.attributeSelect)return;for(var o=!1,s=0;s<t.attributeSelect.length;s++)if("camera"===t.attributeSelect[s].key){o=!0;break}if(!o)return;var a,r=n;if(n=n&&"object"!==N()(n)?n:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var l=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(a=t._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0],!l)return;if(!a)return;Tn(l,1,10,1);var c="",u={cameraName:t.cameraName,page:n,pageSize:5},p=new URLSearchParams(u).toString();c=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/cameraData/list?").concat(p):"".concat(e,"/yjearth4.0/api/v1/cameraData/list?").concat(p);if(fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&a))return;var o=a.getElementsByClassName("pagination")[0],s=t._DialogObject._element.content.getElementsByClassName("camera-table")[0],r=s.getElementsByClassName("table-body")[0];if(r.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){Tn(o,e.data.total,5,1,(function(e){t.cameraSelect(e)})),s.getElementsByClassName("table-empty")[0].style.display="none",r.style.display="inline-flex";for(var l=[],c=function(n){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(e.data.list[n].deviceId,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[n].cameraName,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(i[e.data.list[n].type],'</div>\n <div class="td center" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[n].ip,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[n].port,'</div>\n <div class="td center" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[n].userName,'</div>\n <div class="td center">').concat(e.data.list[n].passWord||e.data.list[n].password,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="checkbox"]');l.push(a),a.addEventListener("change",(function(){if(a.checked){t.attributeCamera=[],t.attributeCamera.push(e.data.list[n]);for(var i=0;i<l.length;i++)l[i]!==a&&(l[i].checked=!1)}else{var o=t.attributeCamera.filter((function(t){if("deviceId"in e.data.list[n])return t.deviceId!==e.data.list[n].deviceId}));t.attributeCamera=o}})),r.appendChild(s);for(var c=0;c<t.attributeCamera.length;c++)if("deviceId"in e.data.list[n]&&t.attributeCamera[c].deviceId===e.data.list[n].deviceId){a.checked=!0;break}},u=0;u<e.data.list.length;u++)c(u)}e.data&&e.data.total&&Tn(o,e.data.total,5,n,(function(e){t.cameraSelect(e)}))}else Tn(o,1,5,1),s.getElementsByClassName("table-empty")[0].style.display="flex",r.style.display="none"}else console.error(e.message)}))})),!r){var h=new URLSearchParams({page:1,pageSize:99999999}).toString();c=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/cameraData/list?").concat(h):"".concat(e,"/yjearth4.0/api/v1/cameraData/list?").concat(h),fetch(c,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&a))return;if(e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data)if(e.data.list)for(var i=t.attributeCamera.length-1;i>=0;i--){for(var n=!1,o=0;o<e.data.list.length;o++)if(t.attributeCamera[i].deviceId===e.data.list[o].deviceId){n=!0;break}n||t.attributeCamera.splice(i,1)}else t.attributeCamera=[];else t.attributeCamera=[]}else console.error(e.message)}))}))}},t.ISCSelect=function(i){if(!t.attributeSelect)return;for(var n=!1,o=0;o<t.attributeSelect.length;o++)if("isc"===t.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var a=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=t._DialogObject._element.content.getElementsByClassName("attribute-content-isc")[0],!a)return;if(!s)return;Tn(a,1,10,1);var r="",l=new URLSearchParams({page:i,page_size:5}).toString();r=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/isc/list?").concat(l):"".concat(e,"/yjearth4.0/api/v1/isc/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&s))return;var n=s.getElementsByClassName("pagination")[0],o=t._DialogObject._element.content.getElementsByClassName("isc-table")[0],a=o.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){Tn(n,e.data.total,5,1,(function(e){t.ISCSelect(e)})),o.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="flex";for(var r=function(i){var n='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat("ID"in e.data.list[i]?e.data.list[i].ID:e.data.list[i].id,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[i].name,'</div>\n <div class="td center" style="width: 180px; flex: 0 180px; min-width: 180px;">').concat(e.data.list[i].status?"在线":"离线","</div>\n </div>"),o=document.createRange().createContextualFragment(n),s=o.querySelector('input[type="checkbox"]');s.addEventListener("change",(function(){if(s.checked)t.attributeISC.push(e.data.list[i]);else{var n=t.attributeISC.filter((function(t){return"ID"in e.data.list[i]?t.ID!==e.data.list[i].ID:t.id!==e.data.list[i].id}));t.attributeISC=n}})),a.appendChild(o);for(var r=0;r<t.attributeISC.length;r++)if("ID"in e.data.list[i]?t.attributeISC[r].ID===e.data.list[i].ID:t.attributeISC[r].id===e.data.list[i].id){s.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&Tn(n,e.data.total,5,i,(function(e){t.ISCSelect(e)}))}else Tn(n,1,5,1),o.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))},t.goodsSelect=function(i){if(!t.attributeSelect)return;for(var n=!1,o=0;o<t.attributeSelect.length;o++)if("goods"===t.attributeSelect[o].key){n=!0;break}if(!n)return;var s;if(i=i&&"object"!==N()(i)?i:1,!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content))return;var a=t._DialogObject._element.content.getElementsByClassName("pagination")[0];if(s=t._DialogObject._element.content.getElementsByClassName("attribute-content-goods")[0],!a)return;if(!s)return;var r="",l=new URLSearchParams({page:i,page_size:999999}).toString();r=e.endsWith("yjearth4.0")?"".concat(e,"/api/v1/goods/list?").concat(l):"".concat(e,"/yjearth4.0/api/v1/goods/list?").concat(l);fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!(t._DialogObject&&t._DialogObject._element&&t._DialogObject._element.content&&s))return;s.getElementsByClassName("pagination")[0];var i=t._DialogObject._element.content.getElementsByClassName("goods-table")[0],n=i.getElementsByClassName("table-body")[0];if(n.innerHTML="",e.rows&&(e.data={list:L()(e.rows),total:e.total}),e.data){if(e.data.list&&e.data.list.length>0){t._allGoodsList=e.data.list;for(var o=t.attributeGoods.length-1;o>=0;o--){for(var a=!1,r=0;r<e.data.list.length;r++)if("ID"in e.data.list[r]){if(e.data.list[r].ID===t.attributeGoods[o].ID){a=!0;break}}else if("id"in e.data.list[r]&&e.data.list[r].id===t.attributeGoods[o].id){a=!0;break}a||t.attributeGoods.splice(o,1)}i.getElementsByClassName("table-empty")[0].style.display="none",n.style.display="block",n.style.maxHeight="150px";for(var l=function(i){var o='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(e.data.list[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(o),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<t.attributeGoods.length;r++)"ID"in e.data.list[i]?e.data.list[i].ID===t.attributeGoods[r].ID&&(a.value=t.attributeGoods[r].cnt,t.attributeGoods[r].name=e.data.list[i].name):"id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id&&(a.value=t.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e.data.list[i]){if(e.data.list[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e.data.list[i]&&e.data.list[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e.data.list[i].name,cnt:o};"ID"in e.data.list[i]?l.ID=e.data.list[i].ID:"id"in e.data.list[i]&&(l.id=e.data.list[i].id),t.attributeGoods.push(Bn({},l))}}})),n.appendChild(s)},c=0;c<e.data.list.length;c++)l(c)}e.data&&e.data.total}else i.getElementsByClassName("table-empty")[0].style.display="flex",n.style.display="none"}else console.error(e.message)}))}))},t.goodsFilter=function(){var e=[];if(t._allGoodsList&&t._allGoodsList.length){var i=t._DialogObject._element.content.getElementsByClassName("goods-select-input")[0].value;e=t._allGoodsList.filter((function(t){return-1!==t.name.indexOf(i)}))}var n=t._DialogObject._element.content.getElementsByClassName("goods-table")[0],o=n.getElementsByClassName("table-body")[0];if(o.innerHTML="",e.length>0){n.getElementsByClassName("table-empty")[0].style.display="none",o.style.display="block",o.style.maxHeight="150px";for(var s=function(i){var n='\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">\n '.concat(i+1,'\n </div>\n <div class="td" style="flex: 0 0 280px;">').concat(e[i].name,'</div>\n <div class="td"><input class="input" type="number" title="" min="0" max="999999999"></div>\n </div>'),s=document.createRange().createContextualFragment(n),a=s.querySelector('input[type="number"]');a.value=0;for(var r=0;r<t.attributeGoods.length;r++)"ID"in e[i]?e[i].ID===t.attributeGoods[r].ID&&(a.value=t.attributeGoods[r].cnt):"id"in e[i]&&e[i].id===t.attributeGoods[r].id&&(a.value=t.attributeGoods[r].cnt);a.addEventListener("blur",(function(n){var o=Number(n.target.value);a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}})),a.addEventListener("input",(function(n){if(n.data&&isNaN(Number(n.data)))"."!=n.data&&(a.value=Number(a.value));else{var o=Number(n.target.value);n.target.max&&o>Number(n.target.max)&&(o=Number(n.target.max)),n.target.min&&o<Number(n.target.min)&&(o=Number(n.target.min)),a.value=o;for(var s=!1,r=t.attributeGoods.length-1;r>=0;r--)if("ID"in e[i]){if(e[i].ID===t.attributeGoods[r].ID){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}}else if("id"in e[i]&&e[i].id===t.attributeGoods[r].id){s=!0,o?t.attributeGoods[r].cnt=o:t.attributeGoods.splice(r,1);break}if(!s){if(!o)return;var l={name:e[i].name,cnt:o};"ID"in e[i]?l.ID=e[i].ID:"id"in e[i]&&(l.id=e[i].id),t.attributeGoods.push(Bn({},l))}}})),o.appendChild(s)},a=0;a<e.length;a++)s(a)}else n.getElementsByClassName("table-empty")[0].style.display="flex",o.style.display="none"},t.cameraName="",t.ISCName="";var i={1:"海康",2:"大华"};return'<div class="attribute">\n <div class="row">\n <div class="col attribute-select-box">\n <span class="label" style="line-height: 32px;">内容类型</span>\n <div class="input input-select attribute-select"></div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <button @click="openRichTextEditor">打开文本编辑器</button>\n </div>\n </div>\n </div>\n <div class="row attribute-content attribute-content-link">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input link_add" type="text">\n <i class="link_add_btn" @click="_addLink"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="cameraName" style="width: 100px;">\n <button class="select btn" @click="cameraSelect">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="attribute-content attribute-content-isc">\n \x3c!-- <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input" type="text" @model="ISCName" style="width: 100px;">\n <button class="select btn" @click="ISCSelect">搜索</button>\n </div>\n </div> --\x3e\n <div>\n <div class="table isc-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 74px; flex: 0 74px;min-width: 74px;">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td" style="width: 180px; flex: 0 180px; min-width: 180px;">设备状态</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n <div class="row attribute-content attribute-content-vr">\n <div class="col">\n <span class="label">添加链接</span>\n <div style="flex: 1;position: relative;">\n <input class="input vr_add" type="text">\n <i class="vr_add_btn" @click="_addRr"></i>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-vr">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-goods">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">编辑内容</span>\n <input class="input goods-select-input" type="text" style="width: 180px;margin-right: 10px;">\n <button class="select btn" @click="goodsFilter">搜索</button>\n </div>\n </div>\n <div class="table goods-table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="th" style="flex: 0 0 280px;">名称</div>\n <div class="th">数量</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">序号</div>\n <div class="td" style="flex: 0 0 280px;">名称</div>\n <div class="td">数量</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n </div>'}function An(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: unset;">名称</span>\n <input class="input" type="text" @model="labelText">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div style="width: 46%;">\n <div class="row">\n <p class="lable-left-line">WGS84坐标</p>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1 alt-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div style="width: 50%;">\n <div class="row coordinate-select-box">\n <div class="lable-left-line">转换坐标选择\n <div class="input input-select coordinate-select" style="margin-left: 20px;"></div>\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">X轴:</span>\n <input style="border: none;background: none;" class="input convert-x" readonly="readonly">\n </div>\n </div>\n <div class="row" style="margin-bottom: 5px;">\n <div class="col">\n <span class="label">Y轴:</span>\n <input style="border: none;background: none;" class="input convert-y" readonly="readonly">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">Z轴:</span>\n <input style="border: none;background: none;" class="input convert-z" readonly="readonly">\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="near">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="far">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="point-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col height-box">\n <span class="label" style="flex: 0 0 56px;">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">小数格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分格式</span>\n </div>\n </div>\n <div class="col">\n <div class="YJ-custom-checkbox-box" style="display: flex;align-items: center;cursor: pointer;">\n <input type="checkbox" class="YJ-custom-checkbox">\n <span style="margin-left: 10px; margin-bottom: 1px;user-select: none;">度分秒格式</span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div style="flex: 1;">\n <div class="proj-input-box">\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat" readonly="readonly">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 56%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dm-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dm-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="proj-input-box" style="width: 70%;">\n <div class="row">\n <div class="col" style="flex-direction: column;">\n <div class="row" style="margin-bottom: 15px;">\n <span style="flex: 0 0 40px;">经度</span>\n <input class="input lng-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lng-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lng-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="top-line"></span>\n </div>\n <div class="row">\n <span style="flex: 0 0 40px;">纬度</span>\n <input class="input lat-dms-d" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">度</span>\n <input class="input lat-dms-m" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">分</span>\n <input class="input lat-dms-s" style="flex: 1;" readonly="readonly">\n <span class="label" style="flex: 0 0 14px;margin: 0 10px;">秒</span>\n <span class="bottom-line"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n <div>\n <h4>图标设置</h4>\n <div class="row" style="margin-bottom: 10px;">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="billboardShow">\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">图标</span>\n <div class="image-box" @click="clickChangeImage">\n <img class="image" src="" alt="" @model="billboardImage">\n </div>\n </div>\n <div class="col" style="flex: 0 0 90px;">\n <span class="label" style="flex: none;">默认图标</span>\n <div class="image-box" @click="clickChangeDefaultImage">\n <img class="image" src="" alt="" @model="billboardDefaultImage">\n </div>\n </div>\n <div class="col">\n <span class="label">图标倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0.1" max="99" @model="billboardScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div>\n <h4>文字设置</h4>\n <div class="row">\n <div class="col" style="flex: 0 0 80px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">文字大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">文字颜色</span>\n <div class="labelColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="效果">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">扩散</span>\n <input class="btn-switch" type="checkbox" @model="diffuseShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="diffuseRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="diffuseDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="diffuseColor"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">雷达</span>\n <input class="btn-switch" type="checkbox" @model="scanShow">\n </div>\n <div class="col">\n <span class="label">半径</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="scanRadius">\n </div>\n <div class="col">\n <span class="label">时间</span>\n <input class="input" type="number" title="" min="100" max="99999" @model="scanDuration">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="scanColor"></div>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">指令</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n\x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n\x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n\x3c!-- <div>--\x3e\n\x3c!-- <div class="row">--\x3e\n\x3c!-- <div class="col">--\x3e\n\x3c!-- <span class="label">设置操作点</span>--\x3e\n\x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n\x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n <span class="custom-divider"></span>\n ')}function jn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function In(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):jn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Rn(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Fn(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function zn(t,e,i){return t.set(Vn(t,e),i),i}function Hn(t,e){return t.get(Vn(t,e))}function Vn(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Gn=new WeakMap,Un=new WeakMap,Wn=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Fn(i=Rn(this,e,[t,n]),Gn,void 0),Fn(i,Un,void 0),t&&t.viewer?(i.sdk=t,i.viewer=t.viewer,i.options=In({},n),i.options.id=n.id||i.randomString(),i.entity=null,i.clickCallBack=null,i.rightClickCallBack=null,i.picking=!0,i.options.host=i.options.host||h(),i.setDefaultValue(),i):tn()(i)}return sn()(e,t),_()(e,[{key:"showView",get:function(){return Hn(Gn,this)},set:function(t){var e=ze().sdkD;if(!e)return zn(Gn,this,t),void(this.entity&&(this.entity._showView=t));this.sdk!==e?(Hn(Gn,this)||this.show)&&(this.sdk!==e?(zn(Gn,this,2!=t&&3!=t?0:t),this.isShowView=!0,Hn(Gn,this)?this.show=2!=t:this.show=!0):zn(Gn,this,0)):zn(Gn,this,0)}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label&&(this.label.text=t),this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;if(this.isShowView&&e||(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t)),this.entity&&(this.entity._showView=this.showView),"layer"==this.type&&this.entity&&(this.entity._objectState=this.options.show),this.showView&&3!=this.showView&&e?(this.entity&&(this.entity.show=!1),this.options.label&&this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1,"layer"==this.type&&e){var i=e.viewer.imageryLayers._layers[this.layerIndex],n=this.entity;if(!i)return;n._objectState?(n._showView&&2!=n._showView||(i.show=!0),3==n._showView&&(i.show=!1)):i.show=this.options.show}}else console.error("参数必须为boolean")}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"display",value:function(){this.show=!0}},{key:"hide",value:function(){this.show=!1}},{key:"flicker",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,i=arguments.length>1?arguments[1]:void 0;this.flickerAnimate&&TWEEN.remove(this.flickerAnimate),this.flickerAnimate=new TWEEN.Tween({degree:1}).to({degree:0},e/2).easing(TWEEN.Easing.Linear.None).repeat(i||0===i?2*i-1:1/0).yoyo(!0).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sdk.viewer){e.next=3;break}return TWEEN.remove(t.flickerAnimate),e.abrupt("return");case 3:t.show&&(1===i.degree&&(t.entity&&(t.entity.show=!0),t.labelShow&&t.label&&(t.label.show=!0),t.text&&t.text&&(t.text.show=!0)),0===i.degree&&(t.entity&&(t.entity.show=!1),t.labelShow&&t.label&&(t.label.show=!1),t.text&&t.text&&(t.text.show=!1)));case 4:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onComplete((function(e){TWEEN.remove(t.flickerAnimate),t.flickerAnimate=void 0})).start()}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?l=In({},this.options.position):this.options.positions?l=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=In({},this.options.line.positions[0]):this.options.center?l=In({},this.options.center):this.options.start?l=In({},this.options.start):this.geojson?(c=turf.bbox(this.geojson),l={lng:c[0],lat:c[1]}):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sdk.removeIncetance(this.options.id);case 2:this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){Ct.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){ue.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.clickCallBack&&this.options&&this.options.id&&dt(this.options.id,this.leftClickCB,this),this.clickCallBack=t}}},{key:"onRightClick",get:function(){return this.rightClickCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.rightClickCallBack&&this.entity&&this.entity.id&&function(t,e,i){wt.set(t,{callback:e,that:i})}(this.entity.id,this.rightClickCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){pe.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.rightClickCallBack&&this.entity&&this.entity.id&&mt(this.entity.id,this.rightClickCB,this),this.rightClickCallBack=t}}},{key:"onMouseMove",get:function(){return this.mouseMoveCallBack},set:function(t){if(t&&"function"!=typeof t)console.error("val:",t,"不是一个function");else{var e=ae().sdkD,i=ze().sdkD;e&&this.sdk===e?null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&function(t,e,i){kt.set(t,{callback:e,that:i})}(this.entity.id,this.mouseMoveCB,this):i&&this.sdk===i?null==this.clickCallBack&&this.options&&this.options.id&&function(t,e,i){he.set(t,{callback:e,that:i})}(this.options.id,this.leftClickCB,this):null==this.mouseMoveCallBack&&this.entity&&this.entity.id&&ft(this.entity.id,this.mouseMoveCB,this),this.mouseMoveCallBack=t}}},{key:"customView",get:function(){return this.options.customView}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=16;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=In({},n),this.options.position&&"[object Object]"===Object.prototype.toString.call(this.options.position)?o=In({},this.options.position):this.options.positions?o=In({},this.options.positions[0]):this.options.line&&this.options.line.positions?o=In({},this.options.line.positions[0]):this.options.center?o=In({},this.options.center):this.options.start?o=In({},this.options.start):this.geojson?(r=turf.bbox(this.geojson),o={lng:r[0],lat:r[1]}):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=13;break}return t.next=12,this.getClampToHeight(o);case 12:o.alt=t.sent;case 13:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"resetCustomView",value:function(){this.options.customView=void 0}},{key:"edit",value:function(){}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"rightClickCB",value:function(t,e,i,n){n.rightClickCallBack&&"function"==typeof n.rightClickCallBack&&n.rightClickCallBack(t,e,i)}},{key:"mouseMoveCB",value:function(t,e,i,n){n.mouseMoveCallBack&&"function"==typeof n.mouseMoveCallBack&&n.mouseMoveCallBack(t,e,i)}},{key:"getGuid",value:function(){return Cesium.createGuid()}},{key:"setDefaultValue",value:function(){var t,e,i;this.options.id=null!==(t=this.options.id)&&void 0!==t?t:this.getGuid(),this.options.show=null===(e=this.options.show)||void 0===e||e,this.options.name=null!==(i=this.options.name)&&void 0!==i?i:"未命名对象"}},{key:"start",value:function(){}},{key:"end",value:function(){}}]);var i,n,s}(fi);function Yn(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">透明度</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">波纹层数</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="10" @model="count">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n <div class="col">\n <span class="label">扩散速度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="0" max="20" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-radius-unit-box" style="margin: 0;">\n <span class="label">半径单位</span>\n <div class="input-radius-unit"></div>\n </div>\n <div class="col" style="margin: 0;">\n </div>\n <div class="col" style="margin: 0;">\n </div>\n </div>\n <div class="row circle-content-box">\n <div class="col">\n <span class="label"></span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lat">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="circle-diffuse-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}var Jn=[{name:"黑体",value:"黑体",font:"SimHei",key:"0"},{name:"思源黑体",value:"思源黑体",font:"SourceHanSansTi",key:"1"},{name:"庞门正道标题体",value:"庞门正道标题体",font:"PMZDBTTi",key:"2"},{name:"数黑体",value:"数黑体",font:"AlimamaShuHeiTi",key:"3"}];function qn(){return Jn}function Xn(t){for(var e=0;e<Jn.length;e++)if(Jn[e].key==t)return Jn[e].font}function Zn(t){for(var e=0;e<Jn.length;e++)if(Jn[e].key==t)return Jn[e].name}function Kn(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function $n(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Qn(t,e){return t.get(function(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(t,e))}var to=new WeakMap,eo=new WeakMap,io=new WeakMap,no=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;k()(this,e),$n(i=Kn(this,e,[t,n]),to,void 0),$n(i,eo,document.createElement("canvas")),$n(i,io,document.createElement("canvas")),i.model=o,i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=n.scaleByDistance||!1,i.options.show=!n.show&&!1!==n.show||n.show,i.options.text=n.text;for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>40&&(s[a]=s[a].slice(0,40-s[a].length));return s.length>10&&s.splice(10-s.length),i.options.text=s.join("\n"),i.options.fontFamily=n.fontFamily||0,i.font=Xn(i.options.fontFamily)||"SimHei",i.options.fontSize=n.fontSize||20,i.options.lineWidth=n.lineWidth||4,i.options.lineColor=n.lineColor||"#00ffff80",i.options.color=n.color||"#ffffff",i.options.ground=!n.ground&&!1!==n.ground||n.ground,i.options.pixelOffset=n.pixelOffset||0===n.pixelOffset?n.pixelOffset:20,i.options.backgroundColor=n.backgroundColor||["#00ffff80","#00ffff80"],i.event=new X(i.sdk),i.entity,i.create(i.options.position),i.picking=!0,i}return sn()(e,t),_()(e,[{key:"create",value:(i=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this,this.options.position[2]||0===this.options.position[2]){t.next=5;break}return t.next=4,this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]});case 4:this.options.position[2]=t.sent;case 5:this.originalOptions=oo(this.options),i=this.options.id+"-label",(n=this.sdk.viewer.entities.getById(i))&&this.sdk.viewer.entities.remove(n),this.entity=this.sdk.viewer.entities.add({show:this.options.show,id:this.options.id+"-label",position:new Cesium.CallbackProperty((function(){if(e.model){if(e.model.isMove){var t=e.model.customScale.x;e.model.customScale.y>t&&(t=e.model.customScale.y),e.model.customScale.z>t&&(t=e.model.customScale.z);for(var i=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]+2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),n=Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2]-2*(e.model.originalBoundingSphereRadius||1)*(t||.01)),o=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,o),a=new Cesium.Ray(i,s),r=e.viewer.scene.drillPickFromRay(a,5),l=0;l<r.length;l++)if(r[l].object&&r[l].object.id&&r[l].object.id===e.model.id){var c=e.cartesian3Towgs84(r[l].position,e.sdk.viewer);e.options.position[0]=c.lng,e.options.position[1]=c.lat,e.options.position[2]=c.alt;break}}return Cesium.Cartesian3.fromDegrees(e.options.position[0],e.options.position[1],e.options.position[2])}var u;return(u=Cesium.Cartesian3).fromDegrees.apply(u,L()(e.options.position))}),!1),billboard:{image:this.getcanvas(),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),scaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0,pixelOffsetScaleByDistance:this.options.scaleByDistance?new Cesium.NearFarScalar(this.options.near,1,this.options.far,0):void 0}});case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,t[2]||0===t[2])this.options.position=L()(t);else{var i=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:t[0],lat:t[1]},i).then((function(i){t[2]=i,e.options.position=L()(t)}))}}},{key:"show",get:function(){return this.options.show},set:function(t){var e=this;if(this.options.show=t,this.entity)if(this.entity.show=t,this.model){var i=this.model.customScale.x;this.model.customScale.y>i&&(i=this.model.customScale.y),this.model.customScale.z>i&&(i=this.model.customScale.z);for(var n=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]+2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),o=Cesium.Cartesian3.fromDegrees(this.options.position[0],this.options.position[1],this.options.position[2]-2*(this.model.originalBoundingSphereRadius||1)*(i||.01)),s=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(s,s),r=new Cesium.Ray(n,a),l=this.viewer.scene.drillPickFromRay(r,5),c=0;c<l.length;c++)if(l[c].object&&l[c].object.id&&l[c].object.id===this.model.id){var u=this.cartesian3Towgs84(l[c].position,this.sdk.viewer);this.options.position[0]=u.lng,this.options.position[1]=u.lat,this.options.position[2]=u.alt;break}}else if(this.options.ground){var p=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:this.options.position[0],lat:this.options.position[1]},p).then((function(t){e.options.position[2]=t}))}}},{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t;for(var e=this.options.text.split("\n"),i=0;i<e.length;i++)e[i].length>40&&(e[i]=e[i].slice(0,40-e[i].length));e.length>10&&e.splice(10-e.length),this.options.text=e.join("\n"),this.entity&&this.updateBillboardImage()}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e<this.near&&(e=this.near),this.options.far=e,this.entity&&(this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0))}},{key:"fontSize",get:function(){return this.options.fontSize},set:function(t){this.options.fontSize=Number(t),this.entity&&this.updateBillboardImage()}},{key:"fontFamily",get:function(){return this.options.fontFamily},set:function(t){this.options.fontFamily=t||0,this.font=Xn(this.options.fontFamily)||"SimHei",this.updateBillboardImage()}},{key:"lineWidth",get:function(){return this.options.lineWidth},set:function(t){this.options.lineWidth=Number(t)||0===Number(t)?Number(t):4,this.entity&&this.updateBillboardImage()}},{key:"pixelOffset",get:function(){return this.options.pixelOffset},set:function(t){this.options.pixelOffset=Number(t),this.entity&&this.updateBillboardImage()}},{key:"updateBillboardImage",value:function(){this.entity.billboard.image=this.getcanvas()}},{key:"lineColor",get:function(){return this.options.pixelOffset},set:function(t){this.options.lineColor=t||"#00ffff80",this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"backgroundColor",get:function(){return this.options.backgroundColor},set:function(t){this.options.backgroundColor=t,this.entity&&(this.entity.billboard.image=this.getcanvas())}},{key:"ground",get:function(){return this.options.ground},set:function(t){this.options.ground=t}},{key:"getcanvas",value:function(){var t=Qn(eo,this).getContext("2d");t.clearRect(0,0,Qn(eo,this).width,Qn(eo,this).height),t.font=this.options.fontSize+"px "+this.font;for(var e=this.options.text.split("\n"),i=0,n=0,o=0;o<e.length;o++){var s=e[o],a=t.measureText(s).width;a>i&&(i=a),n+=this.options.fontSize}n=n+20+5*(e.length-1),(i+=30)<this.options.lineWidth&&(i=this.options.lineWidth),Qn(eo,this).width=i,Qn(eo,this).height=this.options.pixelOffset+n;var r=t.createLinearGradient(0,0,i,n+20);r.addColorStop(0,this.options.backgroundColor[0]),r.addColorStop(1,this.options.backgroundColor[1]),t.fillStyle=r,t.fillRect(0,0,i,n),t.fillStyle=this.options.color,t.font=this.options.fontSize+"px "+this.font;for(var l=0,c=0;c<e.length;c++){var u=t.measureText(e[c]).width;l<u&&(l=u)}for(var p=(i-(l+=30))/2,h=0;h<e.length;h++){var d=e[h];this.options.fontSize<10?t.fillText(d,15+p,this.options.fontSize*(h+1)+10+5*h):t.fillText(d,15+p,this.options.fontSize*(h+1)+100/this.options.fontSize+5*h)}t.strokeStyle=this.options.lineColor,t.setLineDash([4,4]),t.lineWidth=this.options.lineWidth,t.beginPath(),t.moveTo(i/2,n),t.lineTo(i/2,n+this.options.pixelOffset),t.stroke(),t.closePath();var m=Qn(io,this).getContext("2d");return Qn(io,this).width=Qn(eo,this).width+10,Qn(io,this).height=Qn(eo,this).height+10,m.drawImage(Qn(eo,this),5,5),Qn(io,this).toDataURL("image/png")}},{key:"remove",value:function(){this.sdk.viewer.entities.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var i}(Wn),oo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=null;if("object"==N()(t)&&null!==t)for(var i in e=t instanceof Array?[]:{},t)e[i]=oo(t[i]);else e=t;return e},so=function(){return _()((function t(e){k()(this,t),t.prototype.hasOwnProperty("color")||Object.defineProperties(t.prototype,{color:Cesium.createPropertyDescriptor("color")}),t.prototype.hasOwnProperty("speed")||Object.defineProperties(t.prototype,{speed:Cesium.createPropertyDescriptor("speed")}),t.prototype.hasOwnProperty("transparency")||Object.defineProperties(t.prototype,{transparency:Cesium.createPropertyDescriptor("transparency")}),t.prototype.hasOwnProperty("count")||Object.defineProperties(t.prototype,{count:Cesium.createPropertyDescriptor("count")}),t.prototype.hasOwnProperty("gradient")||Object.defineProperties(t.prototype,{gradient:Cesium.createPropertyDescriptor("gradient")}),this._definitionChanged=new Cesium.Event,this._speed=void 0,this.id=e.id,this.color=e.color||new Cesium.Color(1,1,1,1),this.colors=e.colors||{},this.speed=e.speed,this.transparency=e.transparency,this.count=e.count,this.gradient=e.gradient;var i="",n=[];for(var o in this.colors)Object.hasOwnProperty.call(this.colors,o)&&n.push(o);n.sort((function(t,e){return e-t}));for(var s=0;s<n.length;s++){var a=this.colors[n[s]];i+="\n if(dis < float(".concat(Number(n[s])/2,")) {\n material.diffuse = vec4(0.0,0.0,0.0,0.0).rgb;\n material.emission = 1.0 * vec4(").concat(a.red,",").concat(a.green,",").concat(a.blue,",").concat(a.alpha,").rgb;\n }\n ")}this._source="\n uniform vec4 color;\n uniform float speed;\n uniform float count;\n uniform float gradient;\n uniform float transparency;\n uniform float frameNumber;\n\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(frameNumber * speed / 30000.0);\n vec3 str = materialInput.str;\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n }else {\n ".concat(i,"\n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n for(int i = 0; i <= 99; i++){\n if(float(i) <= count){\n disNum = perDis * float(i) - dis + per / count;\n if(disNum > 0.0){\n if(disNum < perDis){\n bl = 1.0 - disNum / perDis;\n }\n else if(disNum - perDis < perDis){\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient))) * transparency;\n }\n }\n }\n }\n return material;\n }\n "),this._CircleRippleMaterialType="CircleRippleMaterialType"+this.id,Cesium.Material._materialCache.addMaterial(this._CircleRippleMaterialType,{fabric:{type:this._CircleRippleMaterialType,uniforms:{color:new Cesium.Color(1,0,0,1),speed:3,transparency:1,count:4,gradient:.2,frameNumber:Cesium.getTimestamp()},source:this._source},translucent:function(t){return!0}})}),[{key:"isConstant",get:function(){return!1}},{key:"definitionChanged",get:function(){return this._definitionChanged}},{key:"getType",value:function(t){return this._CircleRippleMaterialType}},{key:"getValue",value:function(t,e){return Cesium.defined(e)||(e={}),e.color=Cesium.Property.getValueOrDefault(this._color,t,Cesium.Color.RED,e.color),e.speed=Cesium.Property.getValueOrDefault(this._speed,t,10,e.speed),e.transparency=this.transparency,e.count=this.count,e.gradient=this.gradient,e.frameNumber=Cesium.getTimestamp(),e}},{key:"equals",value:function(t){return this===t||t instanceof CircleRippleMaterialProperty&&Cesium.Property.equals(this._color,t._color)&&Cesium.Property.equals(this._speed,t._speed)&&Cesium.Property.equals(this.count,t.count)&&Cesium.Property.equals(this.transparency,t.transparency)&&Cesium.Property.equals(this.gradient,t.gradient)}}])}();function ao(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ro(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ao(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ao(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function lo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return co(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?co(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function co(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function uo(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var po=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=uo(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#1FA8E3",i.options.colors=n.colors||[],i.options.transparency=n.transparency||0===n.transparency?n.transparency:1,i.options.transparency>1&&(i.options.transparency=1),i.options.speed=n.speed||0===n.speed?n.speed:5,i.options.count=n.count||0===n.count?n.count:3,n.count||0===n.count?(i.options.count=n.count,n.count>99&&(i.options.count=99)):i.options.count=3,i.options.circle=n.circle||[{radius:10}];for(var s=0;s<i.options.circle.length;s++)i.options.circle[s].radius>999999&&(i.options.circle[s].radius=999999);i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText";for(var a=0,r=0;r<i.options.circle.length;r++)Number(i.options.circle[r].radius)>a&&(a=Number(i.options.circle[r].radius));return i._radius=a,i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"CircleDiffuse"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&(this.label.show=this.options.show)),this.isShowView=!1,Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this._radius}},{key:"circle",get:function(){return this.options.circle},set:function(t){console.log(t),this.options.circle=t||[{radius:10}];for(var e=0;e<this.options.circle.length;e++)this.options.circle[e].radius>999999&&(this.options.circle[e].radius=999999);this._createCircleElm()}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,e.create(this),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"transparency",get:function(){return this.options.transparency},set:function(t){this.options.transparency=t>1?1:t,e.create(this),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}))}},{key:"count",get:function(){return this.options.count},set:function(t){this.options.count=t>99?99:t,e.create(this),this._elms.count&&this._elms.count.forEach((function(e){e.value=t}))}},{key:"colors",get:function(){return this.options.colors},set:function(t){this.options.colors=t,e.create(this)}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=lo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=lo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=lo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=lo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ro({},this.options.position):this.options.positions?l=ro({},this.options.positions[0]):this.options.center?l=ro({},this.options.center):this.options.start?l=ro({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=28;break}return t.next=6,new rn(this.sdk,this.options,{title:"扩散光波属性",left:"180px",top:"100px",confirmCallBack:function(t){c.name=c.name.trim(),c.name||(c.name="未命名对象"),c.options.label.position={lng:c.label.position[0],lat:c.label.position[1],alt:c.label.position[2]},c.originalOptions=c.deepCopyObj(c.options),c._DialogObject.close(),c.Dialog.confirmCallBack&&c.Dialog.confirmCallBack(c.originalOptions),Pe(c.sdk,c.options.id),se(c.sdk,c.options.id)},resetCallBack:function(){c.reset(),c.Dialog.resetCallBack&&c.Dialog.resetCallBack()},removeCallBack:function(){c.Dialog.removeCallBack&&c.Dialog.removeCallBack()},closeCallBack:function(){c.reset(),c.positionEditing=!1,c.Dialog.closeCallBack&&c.Dialog.closeCallBack()},showCallBack:function(t){c.options.show=t,c.originalOptions.show=t,c.show=t,c.Dialog.showCallBack&&c.Dialog.showCallBack()},translationalCallBack:function(){c.positionEditing=!c.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle-ciffuse",(i=document.createElement("div")).innerHTML=Yn(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,this._createCircleElm(),new kn("circle-diffuse-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelColor=t},clear:function(){c.labelColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelLineColor=t},clear:function(){c.labelLineColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorStart=t},clear:function(){c.labelBackgroundColorStart="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){c.labelBackgroundColorEnd=t},clear:function(){c.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),l=i.getElementsByTagName("*"),this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.labelColor=[n],this._elms.labelLineColor=[o],this._elms.labelBackgroundColorStart=[s],this._elms.labelBackgroundColorEnd=[r],setTimeout((function(){c.attributeLink=c.options.attribute.link.content,c.attributeVr=c.options.attribute.vr.content,c.ISCSelect&&c.ISCSelect(),c.goodsSelect&&c.goodsSelect(),c.cameraSelect&&c.cameraSelect();var t=Y(c._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0],".input-radius-unit");if(t){t.legp_search([{name:"米",value:"米"},{name:"千米",value:"千米"}]);var e=c._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];e.value="米",e.addEventListener("input",(function(){var t=c._DialogObject._element.content.getElementsByClassName("circle-content-box")[0].getElementsByClassName("input-number");switch(e.value){case"米":for(var i=0;i<t.length;i++){var n=t[i].getElementsByClassName("unit")[0],o=t[i].getElementsByTagName("input")[0];"km"===n.innerHTML&&(n.innerHTML="m",o.value=Math.floor(1e3*o.value*100)/100)}break;case"千米":for(var s=0;s<t.length;s++){var a=t[s].getElementsByClassName("unit")[0],r=t[s].getElementsByTagName("input")[0];"m"===a.innerHTML&&(a.innerHTML="km",r.value=Math.floor(1e5*Number((r.value/1e3).toFixed(5)))/1e5)}}}))}var i=c.attributeSelect,n=c._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(n){var o=Y(n,".attribute-select");o.legp_search(i);for(var s=c._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<i.length;a++)if(i[a].key===c.options.attributeType){s.value=i[a].value,o.legp_searchActive(i[a].value);break}s.addEventListener("input",(function(){for(var t=0;t<i.length;t++)if(i[t].value===s.value){c.attributeType=i[t].key;break}}))}var r=qn(),l=Y(c._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(l){l.legp_search(r);var u=c._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=r[c.labelFontFamily].value;for(var p=0;p<r.length;p++)if(r[p].value==u.value){l.legp_searchActive(r[p].value);break}u.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===u.value){c.labelFontFamily=r[t].key;break}})),c._elms.labelFontFamily=[u]}}),0);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.color=this.originalOptions.color,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=0,i=0;i<this.options.circle.length;i++)Number(this.options.circle[i].radius)>t&&(t=Number(this.options.circle[i].radius));this._radius=t,e.create(this)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,Pe(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_createCircleElm",value:function(){var t=this;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var i=this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0],n=i?i.value:"米",o=this._DialogObject._element.content.getElementsByClassName("circle-content-box")[0];o.innerHTML="";for(var s=function(i){var s=document.createElement("div");s.className="row";var a="",r='<button class="circle-minus"><svg class="icon-minus"><use xlink:href="#yj-icon-minus"></use></svg></button>';0===i&&i===t.options.circle.length-1&&(r=""),i===t.options.circle.length-1&&(a='<button class="circle-add" style="margin-left: 5px;"><svg class="icon-add2"><use xlink:href="#yj-icon-add2"></use></svg></button>'),s.innerHTML='\n <div class="col">\n <span class="label">半径</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" style="width: 130px;">\n <span class="unit">'.concat("米"===n?"m":"km",'</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex-direction: row-reverse;">\n <div class="color"></div>\n <span class="label">扩散颜色</span>\n </div>\n <div class="col" style="flex-direction: row-reverse;">\n ').concat(a,"\n ").concat(r,"\n </div>\n ");var l=s.getElementsByClassName("input")[0];l.value=t.options.circle[i].radius/("米"===n?1:1e3),l.addEventListener("input",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;if(s=Number(s),"."!=n.data&&("-"!=n.data||n.target.value)&&(!n.target.max&&!n.target.min||s<=Number(n.target.max)/("米"===o?1:1e3)&&s>=Number(n.target.min))){s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;r<t.options.circle.length;r++)Number(t.options.circle[r].radius)>a&&(a=Number(t.options.circle[r].radius));t._radius=a,e.create(t)}}})),l.addEventListener("blur",(function(n){var o=t._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(n.target.value||0===n.target.value){var s=n.target.value;s=Number(s),n.target.max&&s>Number(n.target.max)/("米"===o?1:1e3)&&(s=Number(n.target.max)/("米"===o?1:1e3)),n.target.min&&s<Number(n.target.min)&&(s=Number(n.target.min)),s="米"===o?Math.floor(100*s)/100:Math.floor(1e5*s)/1e5,t.options.circle[i].radius=s*("米"===o?1:1e3);for(var a=0,r=0;r<t.options.circle.length;r++)Number(t.options.circle[r].radius)>a&&(a=Number(t.options.circle[r].radius));t._radius=a,l.value=s,e.create(t)}}));new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:t.options.circle[i].color||t.options.color,disabled:!1,openPickerAni:"opacity",sure:function(n){t.options.circle[i].color=n,e.create(t)},clear:function(){t.options.circle[i].color="rgba(255,255,255,1)",e.create(t)}});var c=s.getElementsByClassName("circle-minus")[0];c&&c.addEventListener("click",(function(){t.options.circle.splice(i,1);for(var n=0,o=0;o<t.options.circle.length;o++)Number(t.options.circle[o].radius)>n&&(n=Number(t.options.circle[o].radius));t._radius=n,e.create(t),t._createCircleElm()}));var u=s.getElementsByClassName("circle-add")[0];u&&u.addEventListener("click",(function(){t.options.circle.push({radius:0,color:"rgba(255,255,255,1)"});for(var i=0,n=0;n<t.options.circle.length;n++)Number(t.options.circle[n].radius)>i&&(i=Number(t.options.circle[n].radius));t._radius=i,e.create(t),t._createCircleElm()})),o.appendChild(s)},a=0;a<this.options.circle.length;a++)s(a)}}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){for(var i={},n=0;n<t.options.circle.length;n++)i[t.options.circle[n].radius/t.radius]=Cesium.Color.fromCssColorString(t.options.circle[n].color||t.options.color);var o=t.sdk._entityZIndex;t.entity?(o=t.entity.ellipse.zIndex._value,t.sdk.viewer.entities.remove(t.entity),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),material:new so({id:t.options.id,colors:i,transparency:t.options.transparency,speed:t.options.speed,count:t.options.count,gradient:.2}),zIndex:o}})):(t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"波纹圆",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.radius}),!1),material:new so({id:t.options.id,colors:i,transparency:t.options.transparency,speed:t.options.speed,count:t.options.count,gradient:.2}),zIndex:o}}),t.options.show&&Kt(0,t.options.id),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1),e.createLabel(t),Pe(t.sdk,t.options.id))}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.options.label.position){t.next=5;break}return t.next=3,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 3:i=t.sent,e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i};case 5:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 6:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r}(Wn);function ho(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扫描半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">扫描速度</span>\n <input class="input" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function mo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?mo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function vo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return go(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?go(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function go(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function yo(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var bo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=yo(this,e,[t,n])).options.lng=n.lng,i.options.lat=n.lat,i.options.color=n.color||"#FFEB3B",i.options.radius=n.radius||10,i.options.radius>999999&&(i.options.radius=999999),i.options.speed=n.speed||0===n.speed?n.speed:20,i.options.show=!n.show&&!1!==n.show||n.show,i.event=new X(i.sdk),i.options.positionEditin=!1,n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.Dialog=o,i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity.show=!1,this.options.label.show&&this.label&&(this.label.show=!1)):(this.entity.show=this.options.show,this.options.label.show&&this.label&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"positionEditing",get:function(){return this.options.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.options.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.lastOptions={lng:this.options.lng,lat:this.options.lat},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.lastOptions=void 0,e.positionEditing=!1}}))}))):(setTimeout((function(){e.picking=!0}),500),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.lastOptions&&(this.lng=this.lastOptions.lng,this.lat=this.lastOptions.lat),this.lastOptions=void 0))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t,this.label.position=[t,this.lat],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t,this.label.position=[this.lng,t],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){var e=Number(t.toFixed(2));(e>999999&&(e=999999),e<.1&&(e=.1),this.options.radius=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(e=Number((e/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.changeMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.changeMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=ze().sdkD;this.options.label.show=t,!this.show||this.showView&&3!=this.showView&&e?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=vo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=vo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=fo({},this.options.position):this.options.positions?l=fo({},this.options.positions[0]):this.options.center?l=fo({},this.options.center):this.options.start?l=fo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=34;break}return t.next=6,new rn(this.sdk,this.options,{title:"雷达光波属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),Pe(p.sdk,p.options.id),se(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.positionEditing=!1,p.Dialog.closeCallBack&&p.Dialog.closeCallBack()},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan",(i=document.createElement("div")).innerHTML=ho(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.labelLineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],(u=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[u],u.addEventListener("input",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(p.radius=i*("米"===e?1:1e3))}})),u.addEventListener("blur",(function(t){var e=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),p.radius=Number((i*("米"===e?1:1e3)).toFixed(2))}})),setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.ISCSelect&&p.ISCSelect(),p.goodsSelect&&p.goodsSelect(),p.cameraSelect&&p.cameraSelect();var t=p.attributeSelect,e=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=e.getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===p.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){p.attributeType=t[e].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=p._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){Y(a,".input-radius-unit").legp_search(s);var r=p._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var t=p._DialogObject._element.content.getElementsByClassName("input-radius")[0],e=t.getElementsByClassName("unit")[0],i=t.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===e.innerHTML&&(e.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===e.innerHTML&&(e.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=qn(),c=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[p.labelFontFamily].value;for(var h=0;h<l.length;h++)if(l[h].value==u.value){c.legp_searchActive(l[h].value);break}u.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===u.value){p.labelFontFamily=l[t].key;break}})),p._elms.labelFontFamily=[u]}}),0);case 34:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.color=this.originalOptions.color,this.radius=this.originalOptions.radius,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity2&&this.sdk.viewer.entities.remove(this.entity2),this.entity=null,this.entity2=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=10,this.sdk.removeIncetance(this.options.id);case 10:return t.next=12,Pe(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"changeMaterial",value:function(){var t=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(this.options.color),e="rgba(".concat(t[0],",").concat(t[1],",").concat(t[2],",1)");this.entity&&(this.entity.ellipse.material=new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(e),transparency:t[3],speed:this.options.speed}))}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"create",value:function(t){var i=function(t){if(/^#/.test(t)){var e=t.replace("#",""),i=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16),s=parseInt(e.substring(6,8),16);s||0===s?s/=255:s=1,t="rgba(".concat(i,",").concat(n,",").concat(o,",").concat(s,")")}var a=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);return a?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),a[4]?parseFloat(a[4]):1]:null}(t.options.color),n="rgba(".concat(i[0],",").concat(i[1],",").concat(i[2],",1)");t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat)}),!1),name:"雷达扫描",ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(){return t.options.radius}),!1),material:new Cesium.RadarScanMaterialProperty({color:Cesium.Color.fromCssColorString(n),transparency:i[3],speed:t.options.speed}),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,"cesium-viewer 2d"===t.sdk.viewer._element.className&&(t.entity.ellipse.height=1),e.createLabel(t),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat});case 2:i=t.sent,e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:!0});case 5:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"createBy2D",value:function(t){t.entity=new Cesium.EntityCollection;var i=0,n=r(t.options,t.options.radius,i),o=(new Date).getTime();t.viewer.clock.onTick.addEventListener((function(){var e=(new Date).getTime(),s=t.options.duration?360/t.options.duration:0,a=(e-o)*s;o=e,i+=a,n=r(t.options,t.options.radius,i)}));var s=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){var e=t.createCircle({lng:t.options.lng,lat:t.options.lat},t.options.radius);return Cesium.Cartesian3.fromDegreesArray(e)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}}),a=t.sdk.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),width:2,material:Cesium.Color.fromCssColorString(t.options.color),clampToGround:!0}});function r(t,e,i){var n=t.lng,o=t.lat,s=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,0)),a=e*Math.cos(i*Math.PI/180),r=e*Math.sin(i*Math.PI/180),l=Cesium.Cartesian3.fromElements(a,r,0),c=Cesium.Matrix4.multiplyByPoint(s,l,new Cesium.Cartesian3),u=Cesium.Cartographic.fromCartesian(c);return[n,o,Cesium.Math.toDegrees(u.longitude),Cesium.Math.toDegrees(u.latitude)]}t.entity.add(s),t.entity.add(a),t.sdk.viewer.entities.add(t.entity),e.createLabel(t),Pe(t.sdk,t.options.id)}}]);var i,n,s,r}(Wn);function Co(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return wo(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?wo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ko(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function xo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ko(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ko(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _o(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Eo(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function So(t,e){return t.get(Po(t,e))}function Do(t,e,i){return t.set(Po(t,e),i),i}function Po(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Mo=new WeakMap,Oo=new WeakMap,To=new WeakMap,No=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(t,e){var i=Cesium.Cartesian3.distance(e.camera.positionWC,t.position.getValue()),n=t.billboard.scaleByDistance?t.billboard.scaleByDistance.getValue():void 0;if(!n)return 1;var o=n.near,s=n.nearValue,a=n.far,r=n.farValue;if(i<=o)return s;if(i>=a)return r;var l=(i-o)/(a-o);return Cesium.Math.lerp(s,r,l)}return k()(this,e),Eo(i=_o(this,e,[t,n]),Mo,null),Eo(i,Oo,null),Eo(i,To,0),i.options.near=n.near||0===n.near?n.near:2e3,i.options.far=n.far||0===n.far?n.far:1e5,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.options.billboard=n.billboard=n.billboard||{},i.options.billboard.isSelect=n.billboard.isSelect||!1,i.options.billboard.show=!n.billboard.show&&!1!==n.billboard.show||n.billboard.show,i.options.billboard.image=n.billboard.image||ti(n.billboard.defaultImage)||i.getSourceRootPath()+"/img/A-ablu-blank.png",i.options.billboard.defaultImage=n.billboard.defaultImage,i.options.billboard.scale=n.billboard.scale||0===n.billboard.scale?n.billboard.scale:3,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.positions=n.positions=n.positions||{},i.options.positions.lng=Number(Number(n.positions.lng||0).toFixed(8)),i.options.positions.lat=Number(Number(n.positions.lat||0).toFixed(8)),i.options.positions.alt=Number(Number(n.positions.alt||0).toFixed(2)),Do(To,i,i.options.positions.alt),i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.options.coordinate=n.coordinate||"",i.options.attributeBoxState=n.attributeBoxState||!1,i.operate={},i._elms={},i.previous={positions:xo({},i.options.positions)},i.options.attributePos=n.attributePos||{x:60,y:60,width:200,height:120},i.entity,i._proj=i.sdk.proj,Do(Oo,i,(function(){i.attributeElm&&(i.attributeElm.style.pointerEvents="unset"),i.sdk&&i.sdk.viewer&&i.sdk.viewer._element&&(i.sdk.viewer._element.onmousemove=null),document.removeEventListener("mouseup",So(Oo,i)),document.removeEventListener("mouseleave",So(Oo,i))})),Do(Mo,i,(function(){var t=Cesium.Cartesian3.fromDegrees(i.options.positions.lng,i.options.positions.lat,So(To,i));if(i.attributeElm&&i.entity){var e=i.sdk.viewer.scene.cartesianToCanvasCoordinates(t),n=i.entity.label.pixelOffset.getValue();if(e){var o,a,r,l,c,u=s(i.entity,i.sdk.viewer.scene),p=(i.entity.billboard.height.getValue()*(i.options.billboard.scale||0)+i.options.label.fontSize)*(1-u*u),h=!1,d=i.attributeElm.getElementsByClassName("billboard-attribute-box-line")[0],m=i.attributeElm.getElementsByClassName("left-top")[0],f=i.attributeElm.getElementsByClassName("right-top")[0];i.attributeElm.style.left=(e.x+i.options.attributePos.x).toFixed(0)+"px",i.attributeElm.style.top=(e.y+n.y-(i.options.label.show?i.options.label.fontSize/2:-i.options.label.fontSize/2)-i.attributeElm.offsetHeight-i.options.attributePos.y+p).toFixed(0)+"px",i.attributeElm.style.width=i.options.attributePos.width+"px",i.attributeElm.style.height=i.options.attributePos.height+"px",d.style.zIndex="-1",i.options.attributePos.x<-i.options.attributePos.width/2?(h=!0,d.style.left="unset",d.style.right="0",m.style.display="block",f.style.display="none"):(d.style.left="0",d.style.right="unset",m.style.display="none",f.style.display="block"),h?(l=i.attributeElm.offsetWidth+i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0):(l=i.options.attributePos.x,c=i.options.attributePos.y?i.options.attributePos.y:0),o=Math.sqrt(l*l+c*c).toFixed(2),a=Math.atan(l/c),r=parseFloat((180*a/Math.PI).toFixed(2)),i.options.attributePos.y<0&&(r+=180),d.style.height=o+"px",d.style.transform="rotate("+r+"deg)"}}})),i.sdk.addIncetance(i.options.id,i),e.create(i),i.picking=!0,i.Dialog=o,i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"BillboardObject"}},{key:"selectBillboard",value:function(){var t=this;this.sdk.viewer.screenSpaceEventHandler.setInputAction((function(e){var i=t.sdk.viewer.scene.pick(e.position);Cesium.defined(i)&&i.id&&"airportBillboard"===i.id.id?t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.YELLOW):t.entity.billboard&&(t.entity.billboard.color=Cesium.Color.WHITE)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"},{name:"IP摄像头",value:"IP摄像头",key:"camera"},{name:"全景图",value:"全景图",key:"vr"},{name:"物资",value:"物资",key:"goods"}]}},{key:"show",get:function(){return this.options.show},set:function(t){this.isShowView||(this.options.show=t,this.originalOptions.show=t),this.showView&&3!=this.showView?(this.entity&&(this.entity.show=!1),document.addEventListener("mouseup",So(Oo,this)),document.addEventListener("mouseleave",So(Oo,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(So(Mo,this))):(this.entity&&(this.entity.show=this.options.show),this.attributeBoxState&&this.options.show?this.attributeBoxState=this.options.show:(document.addEventListener("mouseup",So(Oo,this)),document.addEventListener("mouseleave",So(Oo,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(So(Mo,this)))),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=this.options.show),this.isShowView=!1}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e,i=this;this.options.heightMode=t||0,this.options.heightMode=t||0==t?t:3;var n,o="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(n=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this.options.heightMode){case"0":case 0:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="海拔高度";break;case"1":case 1:n&&(n.className="input-number input-number-unit-1 alt-box"),this._elms.height&&(this._elms.height.style.display="flex"),e=Cesium.HeightReference.NONE,o="相对地表";break;case"2":case 2:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",n&&(n.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,this._elms.height&&(this._elms.height.style.display="none");break;case"3":case 3:n&&(n.className="input-number input-number-unit-1 alt-box disabled"),this._elms.height&&(this._elms.height.style.display="none"),e=Cesium.HeightReference.NONE,o="依附模型"}this.entity&&(this.entity.billboard.heightReference=e,this.entity.label.heightReference=e,e==Cesium.HeightReference.CLAMP_TO_GROUND?this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){Do(To,i,t[0].height)})):Do(To,this,0):Do(To,this,this.options.positions.alt)),this._elms.heightMode&&(this._elms.heightMode.value=o)}},{key:"labelText",get:function(){return this.options.label.text},set:function(t){this.options.label.text=t,this.options.name=t,this.entity&&(this.entity.label.text=t+""),this._elms.labelText&&this._elms.labelText.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.positions.lng},set:function(t){this.options.positions.lng=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.positions.lat},set:function(t){this.options.positions.lat=Number(Number(t).toFixed(8)),this.renewPoint(),this.coordinate=this.options.coordinate,this._projConvert&&this._projConvert(),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.positions.alt},set:function(t){var e=this;if(this.options.positions.alt=Number(Number(t).toFixed(2)),Do(To,this,this.options.positions.alt),this.renewPoint(),this.coordinate=this.options.coordinate,this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.positions.alt})),this._elms.height){var i=this._elms.height.getElementsByClassName("height")[0];if(i)switch(this._elms.heightMode.value){case"海拔高度":i.value=this.options.positions.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){i.value=Number((e.options.positions.alt-t[0].height).toFixed(2))})):i.value=Number(Number(this.options.positions.alt).toFixed(2));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"near",get:function(){return this.options.near},set:function(t){var e=t;e>this.far&&(e=this.far),this.options.near=e,this.renewPoint(),this._elms.near&&this._elms.near.forEach((function(t){t.value=e}))}},{key:"far",get:function(){return this.options.far},set:function(t){var e=t;e<this.near&&(e=this.near),this.options.far=e,this.renewPoint(),this._elms.far&&this._elms.far.forEach((function(t){t.value=e}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.renewPoint(),this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"billboardShow",get:function(){return this.options.billboard.show},set:function(t){this.options.billboard.show=t,this.entity&&(this.entity.billboard.color=this.options.billboard.show?void 0:new Cesium.Color(1,1,1,0)),this._elms.billboardShow&&this._elms.billboardShow.forEach((function(e){e.value=t}))}},{key:"billboardImage",get:function(){var t=this.options.billboard.image;t&&!t.startsWith("http")&&(t.includes(":")||this.options.host&&(t=new URL(t,this.options.host).href));return t},set:function(t){var e=this;this.options.billboard.image=this.replaceHost(t,this.options.host);var i=this.options.billboard.image||ti(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png";this._elms.billboardImage&&this._elms.billboardImage.forEach((function(t){t.src=i}));var n;if(e.entity.billboard.image&&e.entity.billboard.image.getVa,i&&i.endsWith("gif")){!0;var o=document.createElement("img");o.setAttribute("rel:animated_src",i),o.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(o);var s=Cesium.createGuid();n=new SuperGif({gif:o}),this._superGif=n,this._superGif.id=s;var a=36,r=0;e._frameImages=[],n.load((function(t){if(404==t){return document.createElement("canvas"),gn()("canvas"),l.width=0,l.height=0,a=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=l),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),void(a=36)}if(e._superGif.id==s){for(var i=n.get_length(),o=1;o<=i;o++)n.move_to(o),e._frameImages.push(n.get_canvas().toDataURL());var l=n.get_canvas(),c=l.width,u=l.height;a=u*(31/c),e.entity.billboard.imgWidth=c,e.entity.billboard.imgHeight=u,e.entity&&(e.entity.billboard.image=new Cesium.CallbackProperty((function(){var t=e._frameImages[r];return r=r>=e._frameImages.length-1?0:r+1,t}),!1)),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return a}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-a*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1)}}))}else{var l=new Image;l.src=i;var c=36,u=document.createElement("canvas");l.onload=function(){var t=l.width/l.height;l.width=100,l.height=100/t;var i=l.width,n=l.height,o=u.getContext("2d",{willReadFrequently:!0});u.width=i,u.height=n,o.drawImage(l,0,0,i,n),c=n*(31/i),e.entity.billboard.imgWidth=i,e.entity.billboard.imgHeight=n,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return c}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return e.options.billboard.show?new Cesium.Cartesian2(0,-c*e.options.billboard.scale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),c=n*(31/i)},l.onerror=function(t){u.width=0,u.height=0,c=0,e.entity.billboard.imgWidth=0,e.entity.billboard.imgHeight=0,e.entity&&(e.entity.billboard.image=u),e.entity.billboard.height=new Cesium.CallbackProperty((function(){return 0}),!1),e.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){return new Cesium.Cartesian2(0,0)}),!1),c=36}}}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){this.options.billboard.scale=t,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(this.entity.label.show=t),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.renewPoint();var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(0,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Co(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Co(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Co(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Co(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"billboardDefaultImage",get:function(){return ti(this.options.billboard.defaultImage)||this.getSourceRootPath()+"/img/A-ablu-blank.png"},set:function(t){var e=this.replaceHost(t,this.options.host);Qe(e,this.options.billboard.defaultImage),this._elms.billboardDefaultImage&&this._elms.billboardDefaultImage.forEach((function(t){t.src=e}))}},{key:"coordinate",get:function(){return this.options.coordinate},set:function(t){this.options.coordinate=t;var e=this._proj.convert([{x:this.options.positions.lng,y:this.options.positions.lat,z:this.options.positions.alt}],"EPSG:4326",t).points;this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&e[0]&&(this._DialogObject._element.content.getElementsByClassName("convert-x")[0].value=e[0].x,this._DialogObject._element.content.getElementsByClassName("convert-y")[0].value=e[0].y,this._DialogObject._element.content.getElementsByClassName("convert-z")[0].value=e[0].z),this._elms.coordinate&&this._elms.coordinate.forEach((function(e){e.value=t}))}},{key:"edit",value:(l=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d=this,m=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.length>0&&void 0!==m[0]&&m[0],i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=41;break}return t.next=7,new rn(this.sdk,this.options,{title:"点属性",left:"180px",top:"100px",confirmCallBack:function(t){d.labelText=d.labelText.trim(),d.labelText||(d.labelText="未命名对象"),d.originalOptions=d.deepCopyObj(d.options),d._DialogObject.close();var e=d.deepCopyObj(d.options);e.host="",d.Dialog.confirmCallBack&&d.Dialog.confirmCallBack(e),Pe(d.sdk,d.options.id),se(d.sdk,d.options.id)},resetCallBack:function(){d.reset(),d.Dialog.resetCallBack&&d.Dialog.resetCallBack()},removeCallBack:function(){d.Dialog.removeCallBack&&d.Dialog.removeCallBack()},closeCallBack:function(){d.positionEditing=!1,setTimeout((function(){d.reset(),d.Dialog.closeCallBack&&d.Dialog.closeCallBack()}),0)},showCallBack:function(t){d.show=t,d.Dialog.showCallBack&&d.Dialog.showCallBack()},translationalCallBack:function(){d.positionEditing=!d.positionEditing},updateHeightCallBack:function(){d.updateHeight()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" billboard-object",(n=document.createElement("div")).innerHTML=An(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("point-object-edit-tabs",void 0,this.sdk),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelColor=t},clear:function(){d.labelColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.labelColor=[s],setTimeout(o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,m,f,v,g,b,C,w,k,x,_,E,S,D,P,M,O;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d.attributeLink=d.options.attribute.link.content,d.attributeVr=d.options.attribute.vr.content,d.cameraSelect&&d.cameraSelect(),d.ISCSelect&&d.ISCSelect(),d.goodsSelect&&d.goodsSelect(),(e=document.createElement("div")).className="col",e.style.flex="0 0 110px",e.innerHTML='\n <span class="label">属性框</span>\n <input class="btn-switch" type="checkbox">\n ',d._DialogObject._element.content.getElementsByClassName("attribute")[0].getElementsByClassName("row")[0].appendChild(e),(i=e.getElementsByClassName("btn-switch")[0]).checked=d.attributeBoxState,i.addEventListener("change",(function(t){d.attributeBoxState=i.checked})),n=d.attributeSelect,!(o=d._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=30;break}(s=Y(o,".attribute-select")).legp_search(n),r=d._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 21:if(!(l<n.length)){t.next=29;break}if(n[l].key!==d.options.attributeType){t.next=26;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),t.abrupt("break",29);case 26:l++,t.next=21;break;case 29:r.addEventListener("input",(function(){for(var t=0;t<n.length;t++)if(n[t].value===r.value){d.attributeType=n[t].key;break}}));case 30:if(c=[],d.epsg_map.forEach((function(t,e){c.push({name:"".concat(t.name,"(").concat(t.epsg,")"),value:e})})),!(u=Y(d._DialogObject._element.content.getElementsByClassName("coordinate-select-box")[0],".coordinate-select"))){t.next=47;break}u.legp_search(c),p=d._DialogObject._element.content.getElementsByClassName("coordinate-select")[0].getElementsByTagName("input")[0],d.coordinate?d.coordinate=d.coordinate:d.coordinate=c[0].value,p.value=d.coordinate,h=0;case 39:if(!(h<c.length)){t.next=46;break}if(c[h].value!==c.value){t.next=43;break}return u.legp_searchActive(c[h].value),t.abrupt("break",46);case 43:h++,t.next=39;break;case 46:p.addEventListener("input",(function(){for(var t=0;t<c.length;t++)if(c[t].value===p.value){d.coordinate=c[t].value;break}}));case 47:m=document.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附地表",value:"依附地表",key:"2"},{name:"依附模型",value:"依附模型",key:"3"}],g=d.heightMode,t.t0=g,t.next=0===t.t0||"0"===t.t0?54:1===t.t0||"1"===t.t0?56:2===t.t0||"2"===t.t0||3===t.t0||"3"===t.t0?58:63;break;case 54:return f.value=d.alt,t.abrupt("break",63);case 56:return d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){f.value=Number((d.alt-Number(t[0].height.toFixed(2))).toFixed(2))})):f.value=Number(d.alt.toFixed(2)),t.abrupt("break",63);case 58:b=[],C=Co(d.sdk.entityMap);try{for(C.s();!(w=C.n()).done;)(k=y()(w.value,2))[0],"RadarScanStereoscopic"===(x=k[1]).type&&x.entity&&b.push(x.entity)}catch(t){C.e(t)}finally{C.f()}return d.getClampToHeight(d.options.positions,b).then((function(t){d.alt=Number(t.toFixed(2)),f.value=d.alt})),t.abrupt("break",63);case 63:if(!(_=Y(d._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=81;break}_.legp_search(v),(E=d._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0]).value=v[d.heightMode].value,S=0;case 69:if(!(S<v.length)){t.next=76;break}if(v[S].value!=E.value){t.next=73;break}return _.legp_searchActive(v[S].value),t.abrupt("break",76);case 73:S++,t.next=69;break;case 76:E.addEventListener("input",(function(){for(var t=0;t<v.length;t++)if(v[t].value===E.value){switch(g=v[t].key){case 0:case"0":d.alt=Number(f.value),m.style.display="flex",d.heightMode=0;break;case 1:case"1":d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){d.alt=Number(f.value)+Number(t[0].height.toFixed(2))})):d.alt=Number(f.value),m.style.display="flex",d.heightMode=1;break;case 2:case"2":d.heightMode=2;break;case 3:case"3":var e,i=[],n=Co(d.sdk.entityMap);try{for(n.s();!(e=n.n()).done;){var o=y()(e.value,2),s=(o[0],o[1]);"RadarScanStereoscopic"===s.type&&s.entity&&i.push(s.entity)}}catch(t){n.e(t)}finally{n.f()}d.getClampToHeight(d.options.positions,i).then((function(t){d.alt=Number(t.toFixed(2))})),d.heightMode=3}break}})),f.addEventListener("input",(function(){switch(g){case 0:case"0":d.options.positions.alt=Number(Number(f.value).toFixed(2));break;case 1:case"1":d.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(d.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.options.positions.lng,d.options.positions.lat)]).then((function(t){d.alt=Number(f.value)+Number(t[0].height.toFixed(2))})):d.alt=Number(f.value)}d.renewPoint(),d.coordinate=d.options.coordinate,d._elms.alt&&d._elms.alt.forEach((function(t){t.value=d.options.positions.alt}))})),d._elms.height=m,d._elms.heightMode=E,d.heightMode=d.heightMode;case 81:if(D=qn(),!(P=Y(d._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select"))){t.next=97;break}P.legp_search(D),(M=d._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0]).value=D[d.labelFontFamily].value,O=0;case 88:if(!(O<D.length)){t.next=95;break}if(D[O].value!=M.value){t.next=92;break}return P.legp_searchActive(D[O].value),t.abrupt("break",95);case 92:O++,t.next=88;break;case 95:M.addEventListener("input",(function(){for(var t=0;t<D.length;t++)if(D[t].value===M.value){d.labelFontFamily=D[t].key;break}})),d._elms.labelFontFamily=[M];case 97:case"end":return t.stop()}}),t)}))),0),l=n.getElementsByClassName("lng")[0],c=n.getElementsByClassName("lat")[0],l.value=this.lng,c.value=this.lat,this._elms.lng.push(l),this._elms.lat.push(c),u=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox-box"),p=this._DialogObject._element.content.getElementsByClassName("YJ-custom-checkbox"),h=this._DialogObject._element.content.getElementsByClassName("proj-input-box"),p[0].checked=!0,h[1].style.display="none",h[2].style.display="none",u[0].addEventListener("click",(function(){p[0].checked=!0,h[0].style.display="block",p[1].checked=!1,h[1].style.display="none",p[2].checked=!1,h[2].style.display="none"})),u[1].addEventListener("click",(function(){p[1].checked=!0,h[1].style.display="block",p[0].checked=!1,h[0].style.display="none",p[2].checked=!1,h[2].style.display="none"})),u[2].addEventListener("click",(function(){p[2].checked=!0,h[2].style.display="block",p[0].checked=!1,h[0].style.display="none",p[1].checked=!1,h[1].style.display="none"})),i._projConvert=function(){var t,e,o,s,a,r,l,c,u,p,h,m,f,v,g,y;d._DialogObject&&!d._DialogObject.isDestroy&&(t=i.lng,e=i.lat,o=i._proj.degreesToDMS(t,!0),s=i._proj.degreesToDMS(e,!0),c=(l=o.split("°"))[1].split("'"),p=(u=s.split("°"))[1].split("'"),n.getElementsByClassName("lng-dm-d")[0].value=l[0],n.getElementsByClassName("lng-dm-m")[0].value=c[0],n.getElementsByClassName("lat-dm-d")[0].value=u[0],n.getElementsByClassName("lat-dm-m")[0].value=p[0],a=i._proj.degreesToDMS(t),r=i._proj.degreesToDMS(e),f=(m=(h=a.split("°"))[1].split("'"))[1].split('"'),y=(g=(v=r.split("°"))[1].split("'"))[1].split('"'),n.getElementsByClassName("lng-dms-d")[0].value=h[0],n.getElementsByClassName("lng-dms-m")[0].value=m[0],n.getElementsByClassName("lng-dms-s")[0].value=f[0],n.getElementsByClassName("lat-dms-d")[0].value=v[0],n.getElementsByClassName("lat-dms-m")[0].value=g[0],n.getElementsByClassName("lat-dms-s")[0].value=y[0])},i._projConvert(),t.next=41;break;case 41:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"renewPoint",value:function(){var t=this,e=Xn(this.labelFontFamily)||"Helvetica";this.entity&&(this.entity.position=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,this.options.positions.alt),this.options.scaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.scaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0),this.entity.label.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.options.near,1,this.options.far,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0,this.entity.label.scaleByDistance=void 0,this.entity.label.pixelOffsetScaleByDistance=void 0),this.entity.label.pixelOffset=new Cesium.CallbackProperty((function(){if(t.options.billboard.show){var e=t.entity.billboard.imgHeight?t.entity.billboard.imgHeight*(31/t.entity.billboard.imgWidth):0;return new Cesium.Cartesian2(0,-e*t.options.billboard.scale-t.options.label.fontSize/2-5)}return new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),this.entity.label.font=this.options.label.fontSize+"px "+e,this.entity.label.fillColor=Cesium.Color.fromCssColorString(this.options.label.color),this.entity.billboard.scale=this.options.billboard.scale)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.near=this.originalOptions.near,this.far=this.originalOptions.far,this.scaleByDistance=this.originalOptions.scaleByDistance,this.billboardShow=this.originalOptions.billboard.show,this.billboardImage=this.originalOptions.billboard.image,this.billboardScale=this.originalOptions.billboard.scale,this.labelText=this.originalOptions.label.text,this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelColor=this.originalOptions.label.color,this.lng=this.originalOptions.positions.lng,this.lat=this.originalOptions.positions.lat,this.alt=this.originalOptions.positions.alt,this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.attributeBoxState=this.options.attributeBoxState,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gi(this.sdk.viewer,this.entity);case 2:if(this.entity=null,this.attributeBoxState=!1,this.sdk.viewer&&this.sdk.viewer.entities){t.next=6;break}return t.abrupt("return");case 6:return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),t.next=11,this.sdk.removeIncetance(this.options.id);case 11:return t.next=13,Pe(this.sdk,this.options.id);case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"clickChangeImage",value:function(){this.Dialog.clickChangeImage&&this.Dialog.clickChangeImage()}},{key:"clickChangeDefaultImage",value:function(){this.Dialog.clickChangeDefaultImage&&this.Dialog.clickChangeDefaultImage()}},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"updateHeight",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=2;break}return t.abrupt("return");case 2:n=new Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,0),o=new Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,1e13),s=[],r=Co(this.sdk.entityMap);try{for(r.s();!(l=r.n()).done;)(c=y()(l.value,2))[0],"RadarScanStereoscopic"===(u=c[1]).type&&u.entity&&s.push(u.entity)}catch(t){r.e(t)}finally{r.f()}return t.next=9,this.sdk.viewer.scene.clampToHeightMostDetailed([n],s);case 9:(p=t.sent)&&p[0]&&(e=this.cartesian3Towgs84(p[0],this.sdk.viewer).alt),h=Cesium.Cartesian3.subtract(n,o,new Cesium.Cartesian3),d=Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3),m=new Cesium.Ray(o,d),f={},v=this.sdk.viewer.scene.drillPickFromRay(m),g=v.length-1;case 17:if(!(g>=0)){t.next=24;break}if(!v[g].position){t.next=21;break}return f=v[g],t.abrupt("break",24);case 21:g--,t.next=17;break;case 24:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),t.prev=25,t.next=28,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]);case 28:b=t.sent,t.next=33;break;case 31:t.prev=31,t.t0=t.catch(25);case 33:if((void 0===i||i<b[0].height)&&b&&(i=b[0].height),(void 0===e||e<i)&&(e=i),void 0===e){t.next=56;break}if(this.options.positions.alt=Number(Number(e).toFixed(2)),Do(To,this,this.options.positions.alt),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=w.options.positions.alt})),this.renewPoint(),this.coordinate=this.options.coordinate,!this._elms.height){t.next=56;break}if(!(C=this._elms.height.getElementsByClassName("height")[0])){t.next=56;break}t.t1=this._elms.heightMode.value,t.next="海拔高度"===t.t1?47:"相对地表"===t.t1?50:"依附地表"===t.t1?52:"依附模型"===t.t1?53:56;break;case 47:return C.value=this.options.positions.alt,Do(To,this,this.options.positions.alt),t.abrupt("break",56);case 50:return this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.positions.lng,this.options.positions.lat)]).then((function(t){C.value=Number((w.options.positions.alt-t[0].height).toFixed(2)),Do(To,w,w.options.positions.alt)})):(C.value=this.options.positions.alt,Do(To,this,this.options.positions.alt)),t.abrupt("break",56);case 52:return t.abrupt("break",56);case 53:return C.value=this.options.positions.alt,Do(To,this,this.options.positions.alt),t.abrupt("break",56);case 56:case"end":return t.stop()}}),t,this,[[25,31]])}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w.length>0&&void 0!==w[0]?w[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=26;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=xo({},this.options.position):this.options.positions?l=xo({},this.options.positions):this.options.center?l=xo({},this.options.center):this.options.start?l=xo({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=19;break}c=[],u=Co(this.sdk.entityMap);try{for(u.s();!(p=u.n()).done;)(h=y()(p.value,2))[0],"RadarScanStereoscopic"===(d=h[1]).type&&d.entity&&c.push(d.entity)}catch(t){u.e(t)}finally{u.f()}return t.next=18,this.getClampToHeight(l,c);case 18:l.alt=t.sent;case 19:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=33;break;case 26:m=[],f=Co(this.sdk.entityMap);try{for(f.s();!(v=f.n()).done;)(g=y()(v.value,2))[0],"RadarScanStereoscopic"===(b=g[1]).type&&b.entity&&m.push(b.entity)}catch(t){f.e(t)}finally{f.f()}return t.next=31,this.getClampToHeight(this.options.positions,m);case 31:C=t.sent,this.sdk.viewer.camera.flyTo({orientation:e.orientation,destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,C+(e.height||500))});case 33:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt,this.renewPoint()}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.picking=!1,this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={positions:xo({},this.options.positions)};var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={positions:xo({},e.options.positions)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.positionEditing=!1};this.event.mouse_move((function(t,i){e.entity.position=new Cesium.CallbackProperty((function(){return i}),!1),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,n){var o=new Date;e.event.gesture_pinck_end((function(){var s=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;s-o>=500?e.positionEditing=!1:i(0,n)}))}))}else this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy(),this.event=null),this.tip&&this.tip.destroy(),this.lng=this.previous.positions.lng,this.lat=this.previous.positions.lat,this.alt=this.previous.positions.alt,this.renewPoint()}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"setCustomView",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}this.options.customView=e,t.next=19;break;case 4:if(i=this.sdk.viewer.camera,n=this.cartesian3Towgs84(i.position,this.sdk.viewer),o={lng:0,lat:0},s=xo({},n),this.options.positions?o=xo({},this.options.positions):(this.options.hasOwnProperty("lng")&&(o.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(o.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(o.alt=this.options.alt)),o.hasOwnProperty("alt")){t.next=16;break}r=[],l=Co(this.sdk.entityMap);try{for(l.s();!(c=l.n()).done;)(u=y()(c.value,2))[0],"RadarScanStereoscopic"===(p=u[1]).type&&p.entity&&r.push(p.entity)}catch(t){l.e(t)}finally{l.f()}return t.next=15,this.getClampToHeight(o,r);case 15:o.alt=t.sent;case 16:s={lng:n.lng-o.lng,lat:n.lat-o.lat,alt:n.alt-o.alt},this.options.customView={orientation:{heading:Cesium.Math.toDegrees(i.heading),pitch:Cesium.Math.toDegrees(i.pitch),roll:Cesium.Math.toDegrees(i.roll)},relativePosition:s},this.originalOptions&&(this.originalOptions.customView=this.options.customView);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"attributeBoxState",get:function(){return this.options.attributeBoxState},set:function(t){var e=this;if(t=!!t,this.options.attributeBoxState=t,document.addEventListener("mouseup",So(Oo,this)),document.addEventListener("mouseleave",So(Oo,this)),this.attributeElm&&(this.sdk.viewer._element.removeChild(this.attributeElm),this.attributeElm=null),this.sdk.viewer.scene.postRender.removeEventListener(So(Mo,this)),t&&this.sdk&&this.sdk.viewer&&this.sdk.viewer._element&&this.show){var i=document.createElement("div");this.attributeElm=i,i.className="billboard-attribute-box",i.style.top="0px",i.style.left="0px",i.style.width=0,i.style.height=0,Gt&&(i.style.display="none"),this.sdk.viewer._element.appendChild(i);for(var n="",o="",s="",a=0;a<this.options.attribute.link.content.length;a++)n+='<DIV-cy-tab-pane label="'.concat(this.options.attribute.link.content[a].name,"\"><iframe width='100%' height='100%' src=\"").concat(this.options.attribute.link.content[a].url,'" ></iframe></DIV-cy-tab-pane>');if(this.options.attribute.goods&&this.options.attribute.goods.content&&this.options.attribute.goods.content.length>0){o+='<DIV-cy-tab-pane label="物资">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th" style="width: 20%; flex: 0 20%;">序号</div>\n <div class="th" style="width: 40%; flex: 0 40%;">名称</div>\n <div class="th" style="width: 40%; flex: 0 40%;">数量</div>\n </div>\n </div>\n <div class="table-body">\n ';for(var r=0;r<this.options.attribute.goods.content.length;r++)o+='<div class="tr">\n <div class="td" style="width: 20%; flex: 0 20%;">'.concat(r+1,'</div>\n <div class="td" style="width: 40%; flex: 0 40%;">').concat(this.options.attribute.goods.content[r].name,'</div>\n <div class="td" style="width: 40%; flex: 0 40%;">').concat(this.options.attribute.goods.content[r].cnt,"</div>\n </div>");o+="</div></div></DIV-cy-tab-pane>"}this.options.richTextContent&&(s='<DIV-cy-tab-pane label="富文本">\n '.concat(this.options.richTextContent,"\n </DIV-cy-tab-pane>"));var l='\n <span class="drag-nook left-top"></span>\n <span class="drag-nook right-top"></span>\n ';if(l+=n||o||s?'\n <DIV-cy-tabs class="tabs">\n '.concat(s,"\n ").concat(o,"\n ").concat(n,'\n </DIV-cy-tabs>\n <div class="billboard-attribute-box-line"></div>'):'<p style="margin: 0;width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;backdrop-filter: blur(2px);">暂无属性信息</p><div class="billboard-attribute-box-line"></div>',i.innerHTML=l,i.getElementsByClassName("tabs")[0])new kn(i.getElementsByClassName("tabs")[0],void 0,this.sdk);for(var c=i.getElementsByTagName("img"),u=0;u<c.length;u++)c[u].style.width||(c[u].style.width="100%");this.sdk.viewer.scene.postRender.addEventListener(So(Mo,this));i.onmousedown=function(t){if(i.style.pointerEvents="none",-1!=t.target.className.indexOf("left-top"))!function(t){e.options.attributePos.width<200&&(e.options.attributePos.width=200),e.options.attributePos.height<120&&(e.options.attributePos.height=120);var i=t.x,n=t.y,o=e.options.attributePos.width,s=e.options.attributePos.height,a=e.options.attributePos.x;e.sdk.viewer._element.onmousemove=function(t){e.options.attributePos.width=o+(i-t.x),e.options.attributePos.height=s+(n-t.y),e.options.attributePos.width<200?e.options.attributePos.width=200:e.options.attributePos.x=a-(i-t.x),e.options.attributePos.height<120&&(e.options.attributePos.height=120)},document.addEventListener("mouseup",So(Oo,e)),document.addEventListener("mouseleave",So(Oo,e))}(t);else if(-1!=t.target.className.indexOf("right-top"))!function(t){var i=t.x,n=t.y;e.options.attributePos.width<200&&(e.options.attributePos.width=200),e.options.attributePos.height<120&&(e.options.attributePos.height=120);var o=e.options.attributePos.width,s=e.options.attributePos.height;e.sdk.viewer._element.onmousemove=function(t){e.options.attributePos.width=o+(t.x-i),e.options.attributePos.height=s+(n-t.y)},document.addEventListener("mouseup",So(Oo,e)),document.addEventListener("mouseleave",So(Oo,e))}(t);else{var n=t.x,o=t.y,s=e.options.attributePos.x,a=e.options.attributePos.y;e.options.attributePos.height;e.sdk.viewer._element.onmousemove=function(t){e.options.attributePos.x=s+(t.x-n),e.options.attributePos.y=a-(t.y-o)},document.addEventListener("mouseup",So(Oo,e)),document.addEventListener("mouseleave",So(Oo,e))}}}}}],[{key:"create",value:function(t){var e,i,n=36,o=t.options.positions;t.originalOptions=t.deepCopyObj(t.options);var s,a=!1,r=0,l=Xn(t.labelFontFamily)||"Helvetica",c=t.replaceHost(t.options.billboard.image,t.options.host);if(t._frameImages=[],c&&c.endsWith("gif")){switch(a=!0,t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}var u=document.createElement("img");u.setAttribute("rel:animated_src",c),u.setAttribute("rel:auto_play","1"),document.createElement("div").appendChild(u);var p=Cesium.createGuid();s=new SuperGif({gif:u}),t._superGif=s,t._superGif.id=p,s.load((function(i){if(404==i)return(e=document.createElement("canvas")).width=0,e.height=0,n=0,void(t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0)));if(t._superGif.id==p){for(var o=s.get_length(),a=1;a<=o;a++)s.move_to(a),t._frameImages.push(s.get_canvas().toDataURL());var l=(e=s.get_canvas()).width,c=e.height;n=c*(31/l),t.entity&&(t.entity.billboard.imgWidth=l,t.entity.billboard.imgHeight=c,t.entity.billboard.image=new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1),vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}))}else{var h=new Image;switch(h.src=c||t.getSourceRootPath()+"/img/A-ablu-blank.png",t.options.heightMode){case 2:case"2":i=Cesium.HeightReference.CLAMP_TO_GROUND}e=document.createElement("canvas"),h.onload=function(){var i=h.width/h.height;h.width=100,h.height=100/i;var o=h.width,s=h.height,a=e.getContext("2d",{willReadFrequently:!0});e.width=o,e.height=s,a.drawImage(h,0,0,o,s),n=s*(31/o),t.entity&&(t.entity.billboard.imgWidth=o,t.entity.billboard.imgHeight=s,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))},h.onerror=function(i){e.width=0,e.height=0,n=0,t.entity&&(t.entity.billboard.imgWidth=0,t.entity.billboard.imgHeight=0,t.entity.billboard.image=e,vi(t.sdk,t.entity),t.attributeBoxState&&(t.attributeBoxState=!0))}}t.entity=new Cesium.Entity({show:t.options.show,id:t.options.id,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:a?new Cesium.CallbackProperty((function(){var e=t._frameImages[r];return r=r>=t._frameImages.length-1?0:r+1,e}),!1):e,scale:t.options.billboard.scale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,color:t.options.billboard.show?void 0:new Cesium.Color(1,1,1,0),width:31,height:new Cesium.CallbackProperty((function(){return n}),!1),verticalOrigin:Cesium.VerticalOrigin.BOTTOM},label:{show:t.options.label.show,text:t.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:t.options.label.fontSize+"px "+l,fillColor:Cesium.Color.fromCssColorString(t.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return t.options.billboard.show?new Cesium.Cartesian2(0,-n*t.options.billboard.scale-t.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-t.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE}}),t.entity.billboard.imgWidth=31,t.entity.billboard.imgHeight=36,t.entity.position=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),3==t.options.heightMode&&t.updateHeight(),t.renewPoint(),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.options.billboard.isSelect&&t.selectBillboard()}}]);var i,n,s,r,l}(Wn);function Bo(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">描边颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">描边宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ao(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Io(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Io(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Io(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Ro(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Fo=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Ro(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.nodePoints=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="多边形最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),i._zIndex=i.sdk.entityMap.size,e.create(i)}return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"PolygonObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(this.heightMode=0,i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){i.options.positions;var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td center">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td center">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td center">\n <button style="margin-right: 5px;" @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td center">\n <button style="margin-right: 5px;" @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=7,new rn(this.sdk,this.options,{title:"面属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),Pe(m.sdk,m.options.id),se(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.previous=null,m.reset(),m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack();for(var t=0;t<m.nodePoints.length;t++)m.sdk.viewer.entities.remove(m.nodePoints[t]);m.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),m.event&&m.event.destroy(),m.tip&&m.tip.destroy()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polygon",(s=document.createElement("div")).innerHTML=Bo(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("polygon-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),m.heightMode=m.heightMode,setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=qn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity||this._DialogObject){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.height=this.originalOptions.height,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;var t=this.options.positions,e=[[]],i=[];if(this.options.height||0===this.options.height){for(var n=0;n<t.length;n++)i.push(t[n].lng,t[n].lat,this.options.height),e[0].push([t[n].lng,t[n].lat]);e[0].push([t[0].lng,t[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(var o=0;o<t.length;o++)i.push(t[o].lng,t[o].lat),e[0].push([t[o].lng,t[o].lat]);e[0].push([t[0].lng,t[0].lat]),this.positions=Cesium.Cartesian3.fromDegreesArray(i)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(L()(this.positions),[this.positions[0],this.positions[1]])}}},{key:"flyTo",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ao({},this.options.position):this.options.positions?l=Ao({},this.options.positions[0]):this.options.center?l=Ao({},this.options.center):this.options.start?l=Ao({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positions)for(m=0;m<this.positions.length;m++)c.push(this.positions[m].x,this.positions[m].y,this.positions[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(e.closeNodeEdit(this),!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var n=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var o;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var s=[],a=L()(this.positions),r=this.deepCopyObj(this.options.positions),l=[],c=[],u=0;u<a.length;u++){var p=this.cartesian3Towgs84(a[u],this.sdk.viewer);s.push([p.lng,p.lat])}var h=this.cartesian3Towgs84(a[0],this.sdk.viewer);s.push([h.lng,h.lat]);for(var d=turf.polygon([s]),m=turf.centroid(d),f=(o=Cesium.Cartesian3).fromDegrees.apply(o,L()(m.geometry.coordinates)),v=0;v<a.length;v++)c.push({x:f.x-a[v].x,y:f.y-a[v].y,z:f.z-a[v].z});var g=[],y=function(t,e){i.cartesian3Towgs84(e,i.sdk.viewer);i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),g=[];for(var o=0;o<c.length;o++){var s={x:e.x-c[o].x,y:e.y-c[o].y,z:e.z-c[o].z};g.push(s),i.options.positions[o]=i.cartesian3Towgs84(s,i.sdk.viewer),n._elms.lng&&n._elms.lng[o]&&(n._elms.lng[o].innerHTML=i.options.positions[o].lng.toFixed(8)),n._elms.lat&&n._elms.lat[o]&&(n._elms.lat[o].innerHTML=i.options.positions[o].lat.toFixed(8))}i.previous=null,l=[],i.heightMode=i.heightMode};this.event.mouse_move((function(t,e){var n=i.cartesian3Towgs84(e,i.sdk.viewer);g=[];for(var o=0;o<c.length;o++){var s={x:e.x-c[o].x,y:e.y-c[o].y,z:e.z-c[o].z};g.push(s),r[o]=i.cartesian3Towgs84(s,i.sdk.viewer)}for(var a=!1,u=[],p=0;p<r.length;p++)u.push([r[p].lng,r[p].lat]);u.push([r[0].lng,r[0].lat]);var h=0,d=turf.polygon([u]),m=turf.centroid(d);switch(i.options.heightMode){case"0":case 0:a=!1;break;case"1":case 1:h=i.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1])),a=!1;break;case"2":case 2:a=!0}if(l=[],a){for(var f=0;f<r.length;f++)l.push(r[f].lng,r[f].lat);i.positions=Cesium.Cartesian3.fromDegreesArray(l);var v=L()(i.sdk.viewer.entities.values);i.getClampToHeight({lng:n.lng,lat:n.lat},v).then((function(t){i.label.position=[n.lng,n.lat,t]}))}else{for(var y=0;y<r.length;y++)l.push(r[y].lng,r[y].lat,i.height+h);i.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),i.label.position=[n.lng,n.lat,i.height+h]}i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left(y),this.event.mouse_right((function(t,e){i.heightMode=i.heightMode})),this.event.gesture_pinck_start((function(t,e){var n=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;i.event.gesture_pinck_end((function(){new Date-n>=500?i.positionEditing=!1:y(0,e)}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(n.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(n.positions),[n.positions[0],n.positions[1]])}),!1)}else{this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)},this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var b=[[]],C=0;C<this.previous.positions.length;C++){var w=this.cartesian3Towgs84(this.previous.positions[C],this.sdk.viewer);b[0].push([w.lng,w.lat])}var k=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);b[0].push([k.lng,k.lat]);var x=turf.polygon(b),_=turf.centroid(x),E=!1,S=0;switch(this.options.heightMode){case"0":case 0:E=!1;break;case"1":case 1:S=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(_.geometry.coordinates[0],_.geometry.coordinates[1])),E=!1;break;case"2":case 2:E=!0}this.label.position=E?[_.geometry.coordinates[0],_.geometry.coordinates[1]]:[_.geometry.coordinates[0],_.geometry.coordinates[1],this.height+S],this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(n.previous.positions),this.entity.polyline.positions=[].concat(L()(n.previous.positions),[n.previous.positions[0],n.previous.positions[1]])}}}},{key:"setPosition",value:function(t){for(var e,i=this,n=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),o=L()(this.positions),s=[],a=[],r=0;r<o.length;r++){var l=this.cartesian3Towgs84(o[r],this.sdk.viewer);s.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(o[0],this.sdk.viewer);s.push([c.lng,c.lat]);for(var u=turf.polygon([s]),p=turf.centroid(u),h=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(p.geometry.coordinates)),d=0;d<o.length;d++)a.push({x:h.x-o[d].x,y:h.y-o[d].y,z:h.z-o[d].z});for(var m=[],f=0;f<a.length;f++)m.push({x:n.x-a[f].x,y:n.y-a[f].y,z:n.z-a[f].z});var v=!1,g=0;switch(this.options.heightMode){case"0":case 0:v=!1;break;case"1":case 1:g=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(p.geometry.coordinates[0],p.geometry.coordinates[1])),v=!1;break;case"2":case 2:v=!0}if(v){var y=L()(this.sdk.viewer.entities.values);this.getClampToHeight({lng:t.position.lng,lat:t.position.lat},y).then((function(e){i.label.position=[t.position.lng,t.position.lat,e]}))}else this.label.position=[t.position.lng,t.position.lat,t.position.alt+g];this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return m.length>0?new Cesium.PolygonHierarchy(m):new Cesium.PolygonHierarchy(o)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return m.length>0?[].concat(m,[m[0],m[1]]):[].concat(L()(o),[o[0],o[1]])}),!1)}},{key:"renewPositions",value:function(){var t=this;if(!this._error){for(var e=!1,i=[],n=this.options.positions,o=0;o<n.length;o++)i.push([n[o].lng,n[o].lat]);i.push([n[0].lng,n[0].lat]);var s=0,a=turf.polygon([i]),r=turf.centroid(a);switch(this.options.heightMode){case"0":case 0:e=!1;break;case"1":case 1:s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(r.geometry.coordinates[0],r.geometry.coordinates[1]))||0,e=!1;break;case"2":case 2:e=!0}var l=[];if(e||0!=this.nodePoints.length){for(var c=0;c<n.length;c++)l.push(n[c].lng,n[c].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(l),setTimeout((function(){if(t.sdk.viewer){var e=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]},e).then((function(e){t.label&&(t.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],e])}))}}),100)}else{for(var u=0;u<n.length;u++)l.push(n[u].lng,n[u].lat,this.height+s);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),this.label&&(this.label.position=[r.geometry.coordinates[0],r.geometry.coordinates[1],this.height+s])}return this.options.areaByMeter=this.computeArea(n),this.areaUnit=this.areaUnit,l}}},{key:"setDIV",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for((e=h.length>0&&void 0!==h[0]?h[0]:{domid:"",x:10,y:10}).x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10,i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);if(i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),ground){t.next=12;break}r=this.options.height,t.next=16;break;case 12:return l=L()(this.sdk.viewer.entities.values),t.next=15,this.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},l);case 15:r=t.sent;case 16:c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],r),this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===c.style.display||""===c.style.display){var i=p.sdk.viewer.scene.cartesianToCanvasCoordinates(u);i&&(c.style.left=(i.x+e.x).toFixed(0)+"px",c.style.top=(i.y+e.y).toFixed(0)+"px")}}));case 19:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}],[{key:"create",value:function(t){var i;i=2==t.heightMode,t.renewPositions();var n=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(t.options.heightMode=0,i=!1,n=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!i,material:n,zIndex:t.sdk._entityZIndex},polyline:C()(C()({positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,arcType:Cesium.ArcType.NONE,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i},"arcType",i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE),"zIndex",t.sdk._entityZIndex)}),t.sdk._entityZIndex++,e.createLabel(t),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=[[]],n=0;n<e.options.positions.length;n++)i[0].push([e.options.positions[n].lng,e.options.positions[n].lat]);i[0].push([e.options.positions[0].lng,e.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),r=0,t.t0=e.heightMode,t.next=0===t.t0||"0"===t.t0?9:1===t.t0||"1"===t.t0?11:2===t.t0||"2"===t.t0?14:16;break;case 9:return l=!1,t.abrupt("break",16);case 11:for(c=0;c<i.length;c++)r=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(i[c].lng,i[c].lat));return l=!1,t.abrupt("break",16);case 14:return l=!0,t.abrupt("break",16);case 16:if(l){t.next=20;break}r=e.options.height+r,t.next=24;break;case 20:return u=L()(e.sdk.viewer.entities.values),t.next=23,e.getClampToHeight({lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},u);case 23:r=t.sent;case 24:e.options.label.position||(e.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:r}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:l});case 26:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=jo(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0),t.picking=!1,t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=[],c=0;c<t.options.positions.length;c++)l.push(t.options.positions[c].lng,t.options.positions[c].lat);r=Cesium.Cartesian3.fromDegreesArray(l);var u=!1,p=function(){var e=o()(a.a.mark((function e(o,s){var l,c,p,h,d,m,f,v,g,y,b;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i){e.next=32;break}return t.options.positions[i.index]=t.cartesian3Towgs84(s,t.sdk.viewer),n=t.options.positions[i.index],u=!0,e.next=6,t.getClampToHeight(t.options.positions[i.index]);case 6:for(l=e.sent,c=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,l),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.splice(i.index,0,c),t.options.positions.splice(i.index,0,t.options.positions[i.index]),p=t.options.positions,h=[],d=0;d<p.length;d++)h.push(p[d].lng,p[d].lat);if(t.positions=Cesium.Cartesian3.fromDegreesArray(h),r=Cesium.Cartesian3.fromDegreesArray(h),m=L()(t.sdk.viewer.entities.values),t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},m).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(f=[[]],v=0;v<t.options.positions.length;v++)f[0].push([t.options.positions[v].lng,t.options.positions[v].lat]);f[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),g=turf.polygon(f),y=turf.centroid(g),t.getClampToHeight({lng:y.geometry.coordinates[0],lat:y.geometry.coordinates[1]},m).then((function(e){t.label.position=[y.geometry.coordinates[0],y.geometry.coordinates[1],e]}))}t.options.areaByMeter=t.computeArea(t.options.positions),e.t0=t.options["area-unit"],e.next="平方米"===e.t0?21:"平方千米"===e.t0?23:"亩"===e.t0?25:"公顷"===e.t0?27:29;break;case 21:return t.area=t.options.areaByMeter,e.abrupt("break",30);case 23:return t.area=Number((t.options.areaByMeter/1e6).toFixed(8)),e.abrupt("break",30);case 25:return t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4)),e.abrupt("break",30);case 27:return t.area=Number((t.options.areaByMeter/1e4).toFixed(6)),e.abrupt("break",30);case 29:t.area=t.options.areaByMeter;case 30:e.next=34;break;case 32:(b=t.sdk.viewer.scene.pick(o.position))&&b.id&&b.id.name&&"node-secondary-edit-point"===b.id.name&&(i=b.id,t.nodePoints.splice(b.id.index,1),t.sdk.viewer.entities.remove(b.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position.getValue(),t.sdk.viewer));case 34:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),h=function(o,s){i&&(t.options.positions[i.index]=n,u&&t.options.positions.splice(i.index,1),e(null,t.options.positions)),YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return r.length>=3?[].concat(L()(r),[r[0],r[1],r[2]]):r}),!1);var d=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},d).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var m=[[]],f=0;f<t.options.positions.length;f++)m[0].push([t.options.positions[f].lng,t.options.positions[f].lat]);m[0].push([t.options.positions[0].lng,t.options.positions[0].lat]);var v=turf.polygon(m),g=turf.centroid(v);t.getClampToHeight({lng:g.geometry.coordinates[0],lat:g.geometry.coordinates[1]},d).then((function(e){t.label.position=[g.geometry.coordinates[0],g.geometry.coordinates[1],e]}))}setTimeout((function(){t.event.mouse_left(p),t.event.mouse_right(h),t.event.mouse_move((function(e,n){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(s),r=Cesium.Cartesian3.fromDegreesArray(s);var l=L()(t.sdk.viewer.entities.values);if(t.options.positions.length<3)t.getClampToHeight({lng:t.options.positions[0].lng,lat:t.options.positions[0].lat},l).then((function(e){t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,e]}));else{for(var c=[[]],u=0;u<t.options.positions.length;u++)c[0].push([t.options.positions[u].lng,t.options.positions[u].lat]);c[0].push([t.options.positions[0].lng,t.options.positions[0].lat]);var p=turf.polygon(c),h=turf.centroid(p);t.getClampToHeight({lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1]},l).then((function(e){t.label.position=[h.geometry.coordinates[0],h.geometry.coordinates[1],e]}))}}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?h():p(o,i)}))})),s()}),200)}}),50)}},{key:"closeNodeEdit",value:function(t){if(t.sdk&&t.sdk.viewer){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}}]);var i,n,s,r,l}(Wn);function zo(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 56%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <div class="input-select-unit"></div>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">应用</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box" style="flex: 0 0 37%;">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线段圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col" style="flex: 0 0 37%;">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n <div class="row" id="dashTextureDom">\n <div class="col">\n <span class="label">首尾反向</span>\n <input class="btn-switch" type="checkbox" @model="rotate">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">流动速率</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label lineSpace">线条间距</span>\n <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Ho(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Vo(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Vo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Go=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=Ho(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max),e.target.value=i),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min),e.target.value=i),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Go,"event",{});var Uo=new Go;function Wo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Yo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Wo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Wo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Jo=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.viwer=this.sdk.viewer,this.options=i,this.options.position=i.position||{},this.options.rotate=i.rotate||{},this.options.position.lng=this.options.position.lng||0,this.options.position.lat=this.options.position.lat||0,this.options.position.alt=this.options.position.alt||0,this.options.rotate.x=this.options.rotate.x||0,this.options.rotate.y=this.options.rotate.y||0,this.options.rotate.z=this.options.rotate.z||0,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.MapEvent=new X(this.sdk)}),[{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t,this.againArrow(),this.againCircle()}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t}},{key:"initParam",value:function(){return this._params={tx:this.options.position.lng,ty:this.options.position.lat,tz:this.options.position.alt,rx:this.options.rotate.x,ry:this.options.rotate.y,rz:this.options.rotate.z},Yo(Yo({},this.options.position),this.options.rotate)}},{key:"editTranslational",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:w=function(t){if(e.activeAxis){var i=t.startPosition.y-t.endPosition.y,n={x:t.endPosition.x-y.x,y:t.endPosition.y-y.y},o=r.camera.getPickRay(n),s=r.scene.globe.pick(o,r.scene),a=new Cesium.Cartesian3,l=Cesium.Transforms.eastNorthUpToFixedFrame(r.camera.position);Cesium.Matrix4.inverse(l,l),Cesium.Matrix4.multiplyByPoint(l,s,a),Cesium.Cartesian3.normalize(a,a);var c=e.initParam(),u=90+Cesium.Math.toDegrees(Math.asin(a.z)),p=Cesium.Cartographic.fromCartesian(r.camera.position).height,h=e.activeModelParam.alt,d=p/Math.cos(Cesium.Math.toRadians(u));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(s),Cesium.Cartographic.fromCartesian(r.camera.position)),s=Cesium.Ray.getPoint(o,d*(1-h/p));var m=Cesium.Cartographic.fromCartesian(s),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=f,e._params.ty=e.activeModelParam.lat,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var g=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,g),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,x);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=v,e._params.tz=h,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);var _=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,c.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,_),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(r.camera.position,Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt))/4300*i*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng-.001,c.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(c.lng,c.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-b<100)return clearTimeout(C),void(C=setTimeout((function(){w(t)}),100));clearTimeout(C),b=O;for(var T=e.coordArrows,N=0;N<T.length;N++)if(T[N].getGeometryInstanceAttributes)switch(T[N]._name){case"model_edit_xAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=e.viwer.scene.drillPick(t.endPosition,10),L=B.length-1;L>=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}},this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk),e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.alt,r=this.viwer,this.origin=Cesium.Cartesian3.fromDegrees(n,o,s),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),u=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3),this.rayX=new Cesium.Ray(this.origin,l),this.rayY=new Cesium.Ray(this.origin,c),this.rayZ=new Cesium.Ray(this.origin,u),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),h=r.camera.position,d=Cesium.Cartesian3.distance(h,this.origin),m=d/15,Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p),f=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],p,Cesium.Color.RED),v=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],p,Cesium.Color.LIME),g=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],p,Cesium.Color.BLUE),this.viwer.scene.primitives.add(f),this.viwer.scene.primitives.add(v),this.viwer.scene.primitives.add(g),this.againArrow(),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againArrow,{_that:this}),y={x:0,y:0},b=0,this.MapEvent.mouse_move((function(t,e){w(t)})),this.MapEvent.mouse_left_down((function(t,i){var n=r.scene.cartesianToCanvasCoordinates(k.origin);y.x=t.position.x-Math.floor(n.x),y.y=t.position.y-Math.floor(n.y);for(var o=r.scene.drillPick(t.position,10),s=o.length-1;s>=0;s--){var a=o[s];if(a&&a.primitive&&a.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(a.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return r.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=a.primitive,e.activeModelParam=e.initParam(),void(a.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){r.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<e.coordArrows.length;i++)switch(e.coordArrows[i]._name){case"model_edit_xAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}e.activeAxis&&(e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack)}));case 42:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"againArrow",value:function(){var t=this._that||this;if(t.origin){t.initParam(),t.origin=new Cesium.Cartesian3.fromDegrees(t._params.tx,t._params.ty,t._params.tz);for(var e=t.viwer.camera.position,i=Cesium.Cartesian3.distance(e,t.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(t.origin),o=t.coordArrows,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(i,i,i),o[s].modelMatrix)}}}},{key:"againCircle",value:function(){var t=this._that||this;if(t.origin){t.initParam(),t.origin=new Cesium.Cartesian3.fromDegrees(t._params.tx,t._params.ty,t._params.tz);for(var e=t.viwer.camera.position,i=Cesium.Cartesian3.distance(e,t.origin)/15,n=Cesium.Transforms.eastNorthUpToFixedFrame(t.origin),o=t.coordCircles,s=0;s<o.length;s++)switch(o[s]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var a=i/20;Cesium.Matrix4.multiplyByScale(n,new Cesium.Cartesian3(a,a,a),o[s].modelMatrix),o[s]._radius=i}}}},{key:"editRtation",value:(e=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.destroy(),this.activeState="rtation",this.MapEvent=new X(this.sdk),e=this.initParam(),this.origin=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),this.createCircle(e.lng,e.lat,e.alt,20),this.viwer.camera.percentageChanged=.001,this.viwer.camera.changed.addEventListener(this.againCircle,{_that:this});case 8:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"createCircle",value:(t=o()(a.a.mark((function t(e,i,n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(M=function(t){if(r.activeCircle){var e=0,i=0,n=0;if(!Cesium.SceneTransforms.wgs84ToWindowCoordinates(l.scene,s.ciclkPosition))return;var o=t.startPosition.y-t.endPosition.y,a=t.startPosition.x-t.endPosition.x;switch(r.activeCircle._name){case"model_edit_xCircle":i=1*a;break;case"model_edit_yCircle":e=1*o;break;case"model_edit_zCircle":n=1*a}r._params.rx-=e,r._params.rx>360&&(r._params.rx=1),r._params.rx<0&&(r._params.rx=360),Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._params.rx)),r._params.ry-=i,r._params.ry>360&&(r._params.ry=1),r._params.ry<0&&(r._params.ry=360),r._params.rz-=n,r._params.rz>360&&(r._params.rz=1),r._params.rz<0&&(r._params.rz=360),r.updateModel(r._params.tx,r._params.ty,r._params.tz,r._params.rx,r._params.ry,r._params.rz)}else{var c=Date.now();if(c-D<100)return clearTimeout(P),void(P=setTimeout((function(){M(t)}),100));clearTimeout(P),D=c;for(var u=s.coordCircles,p=0;p<u.length;p++)if(u[p].getGeometryInstanceAttributes){var h=u[p].getGeometryInstanceAttributes(u[p]._name);switch(u[p]._name){case"model_edit_zCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":h.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var d=l.scene.drillPick(t.endPosition,10),m=0;m<d.length;m++){var f=d[m];if(f&&f.primitive&&f.id){var v=f.primitive.getGeometryInstanceAttributes(f.id);switch(f.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(v.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}},s=this._that||this,r=this,l=this.viwer,c=[],u=0;u<=360;u+=3)p=Math.sin(Cesium.Math.toRadians(u)),h=Math.cos(Cesium.Math.toRadians(u)),d=o*h,m=o*p,c.push(new Cesium.Cartesian3(d,m,0));return f=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e,i,n)),v=l.camera.position,g=Cesium.Cartesian3.distance(v,this.origin),b=(y=g/15)/o,Cesium.Matrix4.multiplyByScale(f,new Cesium.Cartesian3(b,b,b),f),t.next=14,this.createAxisSphere("model_edit_zCircle",c,f,Cesium.Color.RED,y);case 14:return C=t.sent,l.scene.primitives.add(C),t.next=18,this.createAxisSphere("model_edit_yCircle",c,f,Cesium.Color.BLUE,y);case 18:return w=t.sent,l.scene.primitives.add(w),k=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),x=Cesium.Matrix4.fromRotationTranslation(k),Cesium.Matrix4.multiply(w.geometryInstances.modelMatrix,x,w.geometryInstances.modelMatrix),t.next=25,this.createAxisSphere("model_edit_xCircle",c,f,Cesium.Color.LIME,y);case 25:_=t.sent,l.scene.primitives.add(_),E=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),S=Cesium.Matrix4.fromRotationTranslation(E),Cesium.Matrix4.multiply(_.geometryInstances.modelMatrix,S,_.geometryInstances.modelMatrix),D=0,this.MapEvent.mouse_move((function(t){M(t)})),this.MapEvent.mouse_left_down((function(t){var e=l.scene.pickPosition(t.position);s.ciclkPosition=e;for(var i=l.scene.drillPick(t.position,10),n=0;n<i.length;n++){var o=i[n];if(o&&o.primitive&&o.id)switch(o.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return l.scene.screenSpaceCameraController.enableRotate=!1,o.primitive.getGeometryInstanceAttributes(o.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,r.activeCircle=o.primitive,void(r.activeModelParam=r.initParam())}}r.activeCircle=null,r.activeModelParam=null,l.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(t){l.scene.screenSpaceCameraController.enableRotate=!0;var e=r.coordCircles;r.activeCircle=null,r.activeModelParam=null;for(var i=0;i<e.length;i++)if(e[i].getGeometryInstanceAttributes){var n=e[i].getGeometryInstanceAttributes(e[i]._name);switch(e[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}));case 34:case"end":return t.stop()}}),t,this)}))),function(e,i,n,o){return t.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.options.position.lng=t,this.options.position.lat=e,this.options.position.alt=i,this.options.rotate={x:n,y:o,z:s},this.controllerCallBack}},{key:"controllerCallBack",get:function(){this._controllerCallBack&&this._controllerCallBack(this.options,!this.activeAxis)},set:function(t){this._controllerCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisCircular",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:{x:1,y:1,z:1},semiMinorAxis:5e5,semiMajorAxis:1e6,rotation:Cesium.Math.PI_OVER_FOUR,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST})}),releaseGeometryInstances:!1,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.YELLOW}}})}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t<this.coordArrows.length;t++)this.viwer.scene.primitives.remove(this.coordArrows[t]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var t=0;t<this.coordCircles.length;t++)this.viwer.scene.primitives.remove(this.coordCircles[t]);this.coordCircles=[]}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeAxis=void 0,this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.viwer.camera.changed.removeEventListener(this.againArrow),this.viwer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"update",value:function(){this.againArrow(),this.againCircle()}}]);var t,e,i}();function qo(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Xo(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Xo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Zo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ko(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zo(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $o(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Qo(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function ts(t,e){return t.get(es(t,e))}function es(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var is=new WeakMap,ns=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),Qo(i=$o(this,e,[t,n]),is,void 0),i.options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.smooth=n.smooth||!1,i.options.extend=n.extend||!1,i.options.rotate=n.rotate||!0,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.dashSize=n.dashSize||.03,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["words-name"]=n["words-name"]||"空间长度",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000";var i=Ko({},this.options);i.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,i),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,1)"}});e._elms.color[i]=n}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.inputSpeed=0!==t?100*Math.pow(t,-1):0;var e=Ko({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"dashSize",get:function(){return this.options.dashSize},set:function(t){this.options.dashSize=t;var e=Ko({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t,e.closeNodeEdit(this),this._elms.rotate&&this._elms.rotate.forEach((function(e){e.checked=t})),this.options.rotate=t;var i=Ko({},this.options);i.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,i)}},{key:"space",get:function(){return this.options.space},set:function(t){this.options.space=t;var e=Ko({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"length",get:function(){return this.options.length},set:function(t){this.options.length=t,this._elms.length&&this._elms.length.forEach((function(e){e.value=t}))}},{key:"fitLength",get:function(){return this.options.fitLength},set:function(t){this.options.fitLength=t,this._elms.fitLength&&this._elms.fitLength.forEach((function(e){e.value=t}))}},{key:"lengthUnit",get:function(){return this.options["length-unit"]},set:function(t){if(this.unitNum++,this.options["length-unit"]=t,this._elms.lengthUnit&&this._elms.lengthUnit.forEach((function(e){e.value=t})),ts(is,this)&&ts(is,this).legp_searchActive(t),this.options.lengthByMeter)if(this.unitNum>2)switch(t){case"米":this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;break;case"千米":this.length=this.noseToTail?(this.options.fitLengthByMeter/1e3).toFixed(5):(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter}else{var e=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;this.lengthUnit=e>1e3||1e3==e?"千米":"米"}}},{key:"wordsName",get:function(){return this.options["words-name"]},set:function(t){this.options["words-name"]=t,this._elms.wordsName&&this._elms.wordsName.forEach((function(e){e.value=t}));var e=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.options.positions,2,t).then((function(t){e.options.lengthByMeter=t,e.lengthUnit=e.options["length-unit"]}))}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.entity.polyline.width+t-this.entity.polyline.oriWidth,this.entity.polyline.oriWidth=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value,2<t.value&&t.value<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<t.value&&t.value<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"))})),1},o=0;o<i.length&&!n(o);o++);var s=Ko({},this.options);s.speed=this.inputSpeed,this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,s))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){if(this.options["nose-to-tail"]=t,e.closeNodeEdit(this),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}this.lengthUnit=this.options["length-unit"]}},{key:"smooth",get:function(){return this.options.smooth},set:function(t){if(this.options.smooth=t,e.closeNodeEdit(this),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.positionEditing=!1,this.options.heightMode=t||0==t?t:2;var n="";e.closeNodeEdit(this);var o=!1,s=!1,a=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a),this.renewPolygon(a),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=o,this.extend=!1,n="海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=o,this.extend=!1,n="相对地表";break;case"2":case 2:o=!0,s=!0,this.entity.polyline.clampToGround=o,n="依附模型"}this._elms.heightMode&&(this._elms.heightMode.value=n),this._elms.heightModeObject&&this._elms.heightModeObject.legp_searchActive(n),s?(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),this._elms.heightConfirm&&this._elms.heightConfirm.setAttribute("disabled","disabled")):(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.heightConfirm&&this._elms.heightConfirm.removeAttribute("disabled")),setTimeout((function(){o?(i.label.ground=o,i._elms.heightMode&&(i._elms.heightMode.value="依附模型"),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat]):(i.label.ground=o,i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,a[2]],i.options.label.position={lng:i.options.positions[0].lng,lat:i.options.positions[0].lat,alt:a[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(t){if(this.options.extend=t,e.closeNodeEdit(this),t&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(e){e.checked=t})),this.entity)if(this.options.extend){var i=this.renewPositions(this.options.positions);this.renewPolygon(i)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options["extend-width"]},set:function(t){this.options["extend-width"]=t,this.heightMode=this.heightMode,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(e){e.value=t}));var e=this.renewPositions(this.options.positions);this.renewPolygon(e)}},{key:"extendColor",get:function(){return this.options["extend-color"]},set:function(t){var e=this;this.options["extend-color"]=t,this._elms.extendColor&&this._elms.extendColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.extendColor=t},clear:function(){e.extendColor="rgba(255,255,255,1)"}});e._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options["extend-color"]))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show&&!this.showView||3==this.showView?(this.label.show=t,setTimeout((function(){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=qo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=qo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=qo(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=qo(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"judgeLine",value:function(t,e){if(!t.polyline.oriRepeat){var i={color:e.color,image:this.getSourceRootPath()+"/img/arrow/1.png",space:e.space,speed:e.speed};i.speed=e.rotate?i.speed:0-i.speed;var n=document.createElement("canvas"),o=(n.getContext("2d"),new Image);o.src=i.image;var s=this;o.onload=function(){n.width=o.width*(i.space+1),n.height=o.height;var e=s.getSceenLine(t,i,n);e&&(t.polyline.oriRepeat=e);var a=t.polyline.positions.getValue(s.sdk.viewer.clock.currentTime);if(!Cesium.defined(a))return new Cesium.Cartesian2(1,1);for(var r=0,l=0;l<a.length-1;++l)r+=Cesium.Cartesian3.distance(a[l],a[l+1]);var c=r/t.polyline.width.getValue(),u=s.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=s.sdk.viewer.canvas.clientWidth,d=s.sdk.viewer.canvas.clientHeight;if(c*=s.sdk.viewer.scene.camera.getPixelSize(p,h,d)/u/(i.space*(n.width/n.height*5)+1),s.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var m=c/t.polyline.oriRepeat;t.polyline.oriSpeed=m,t.polyline.oriRepeatX=c}else{var f=Re().viewer.entities.getById(s.options.id);t.polyline.oriSpeed=f.polyline.oriSpeed,t.polyline.oriRepeatX=f.polyline.oriRepeatX}}}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/t.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(p,h,d);return m>700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(t){"2"!==t&&2!==t||(2<n.options.type&&n.options.type<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"))},t.next=7,new rn(this.sdk,this.options,{title:"线属性",left:"180px",top:"100px",confirmCallBack:function(t){d.name=d.name.trim(),d.name||(d.name="未命名对象"),d.options.label.position={lng:d.label.position[0],lat:d.label.position[1],alt:d.label.position[2]},d.originalOptions=d.deepCopyObj(d.options),d._DialogObject.close(),d.Dialog.confirmCallBack&&d.Dialog.confirmCallBack(d.originalOptions),Pe(d.sdk,d.options.id),se(d.sdk,d.options.id)},resetCallBack:function(){d.reset(),d.Dialog.resetCallBack&&d.Dialog.resetCallBack()},removeCallBack:function(){d.Dialog.removeCallBack&&d.Dialog.removeCallBack()},closeCallBack:function(){d.reset(),d.Dialog.closeCallBack&&d.Dialog.closeCallBack();for(var t=0;t<d.nodePoints.length;t++)d.sdk.viewer.entities.remove(d.nodePoints[t]);d.nodePoints=[],d.positionEditing=!1,YJ.Measure.SetMeasureStatus(!1),d.event&&d.event.destroy(),d.tip&&d.tip.destroy()},showCallBack:function(t){d.options.show=t,d.originalOptions.show=t,d.show=t,d.Dialog.showCallBack&&d.Dialog.showCallBack()},translationalCallBack:function(){d.positionEditing=!d.positionEditing},secondaryEditCallBack:function(){d.positionEditing=!1,d.noseToTail=!1,d.heightMode=0,e.nodeEdit(d)}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(s=document.createElement("div")).innerHTML=zo(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,new kn("polyline-object-edit-tabs",o,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){d.color=t},clear:function(){d.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelColor=t},clear:function(){d.labelColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.extendColor=t},clear:function(){d.extendColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelLineColor=t},clear:function(){d.labelLineColor="rgba(255,255,255,1)"}}),n.labelBackgroundColorStartPicker=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelBackgroundColorStart=t},clear:function(){d.labelBackgroundColorStart="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){d.labelBackgroundColorEnd=t},clear:function(){d.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),h=s.getElementsByTagName("*"),Uo.on(this,h),this._elms=Uo.element,this._elms.color=[r],this._elms.labelColor=[l],this._elms.extendColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[n.labelBackgroundColorStartPicker],this._elms.labelBackgroundColorEnd=[p],setTimeout((function(){d.attributeLink=d.options.attribute.link.content,d.attributeVr=d.options.attribute.vr.content,d.cameraSelect&&d.cameraSelect(),d.goodsSelect&&d.goodsSelect();var t=d.attributeSelect,i=d._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var o=d._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===d.options.attributeType){o.value=t[a].value,n.legp_searchActive(t[a].value);break}o.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===o.value){d.attributeType=t[e].key;break}}))}var r=[{name:"空间长度",value:"空间长度"},{name:"投影长度",value:"投影长度"},{name:"地表长度",value:"地表长度"}],l=Y(d._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=d._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];d._elms.wordsName=[c],c.value=d.options["words-name"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){d.wordsName=r[t].value;break}}))}var p,h,m,f=[{name:"米",value:"米"},{name:"千米",value:"千米"}],v=Y(d._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit",1);if(h=d,m=v,(p=is).set(es(p,h),m),v){v.legp_search(f);var g=d._DialogObject._element.content.getElementsByClassName("input-select-unit")[1].getElementsByTagName("input")[0];d._elms.lengthUnit=[g],g.value=d.options["length-unit"];for(var y=0;y<f.length;y++)if(f[y].value===g.value){v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){d.lengthUnit=f[t].value;break}}))}var b=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],C=Y(d._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(C){C.legp_search(b);var w=document.createElement("i");w.className="icon icon-active",d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(w);var k=d._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];d._elms.lineType=[k];for(var x=0;x<b.length;x++)if(b[x].key===d.options.type){C.legp_searchActive(b[x].value),k.value=b[x].value,w.className="icon icon-active ".concat(b[x].icon);break}k.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===k.value){d.lineType=b[t].key,w.className="icon icon-active ".concat(b[t].icon),2<d.lineType&&d.lineType<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<d.lineType&&d.lineType<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"));break}}))}var _=d._DialogObject._element.content.getElementsByClassName("height-box")[0],E=_.getElementsByClassName("height")[0],S=d._DialogObject._element.content.getElementsByClassName("height-confirm")[0];E.value=10,2==d.heightMode?(_&&(_.className="input-number input-number-unit-1 height-box disabled"),S&&S.setAttribute("disabled","disabled")):(_&&(_.className="input-number input-number-unit-1 height-box"),S&&S.removeAttribute("disabled"));var D=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],P=Y(d._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(P){P.legp_search(D);for(var M=d._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],O=0;O<D.length;O++)if(D[O].key==d.heightMode){M.value=D[O].value,P.legp_searchActive(D[O].value);break}M.addEventListener("input",(function(){for(var t=0;t<D.length;t++)if(D[t].value===M.value){d.heightMode=D[t].key;break}})),E.addEventListener("input",(function(){d.heightMode})),d._elms.height=E,d._elms.heightBox=_,d._elms.heightMode=M,d._elms.heightConfirm=S,d._elms.heightModeObject=P,S.addEventListener("click",(function(){d.positionEditing=!1;for(var t=0;t<d.options.positions.length;t++)d.options.positions[t].alt=Number((d.options.positions[t].alt+Number(E.value)).toFixed(2)),d._elms.alt[t].innerHTML=d.options.positions[t].alt;var i=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),d.positionEditing=!1,e.closeNodeEdit(d)}))}var T=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];d._elms.lng=[],d._elms.lngInput=[],d._elms.lat=[],d._elms.latInput=[],d._elms.alt=[],d._elms.altInput=[];for(var N=function(t){var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td">'.concat(t+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=d.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=d.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=d.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=d.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=d.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=d.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(d.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),s.addEventListener("blur",(function(){s.value=Number(d.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){d.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=d.options.positions[t].lng.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(d.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),d.positionEditing=!1,e.closeNodeEdit(d)})),l.addEventListener("blur",(function(){l.value=Number(d.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){d.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=d.options.positions[t].lat.toFixed(8);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=d.heightMode&&(c.innerHTML="",p.value=Number(d.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),d.positionEditing=!1,e.closeNodeEdit(d))})),p.addEventListener("blur",(function(){p.value=Number(d.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){d.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=d.options.positions[t].alt.toFixed(2);var e=d.renewPositions(d.options.positions);d.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),d.label.position=[d.options.positions[0].lng,d.options.positions[0].lat,e[2]]})),d._elms.lng.push(o),d._elms.lngInput.push(s),d._elms.lat.push(r),d._elms.latInput.push(l),d._elms.alt.push(u),d._elms.altInput.push(p),T.appendChild(i)},B=0;B<d.options.positions.length;B++)N(B);var L=qn(),A=Y(d._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(A){A.legp_search(L);var j=d._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];j.value=L[d.labelFontFamily].value;for(var I=0;I<L.length;I++)if(L[I].value==j.value){A.legp_searchActive(L[I].value);break}j.addEventListener("input",(function(){for(var t=0;t<L.length;t++)if(L[t].value===j.value){d.labelFontFamily=L[t].key;break}})),d._elms.labelFontFamily=[j]}}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(t){for(var e=[],i=[],n=[],o=0;o<t.length;o++)n.push(t[o].lng,t[o].lat,t[o].alt),i.push(o/(t.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*t.length,r=0;r<=a;r++){var l=s.evaluate(r/a);e.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return e}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i,n=JSON.parse(JSON.stringify(t));switch(this.heightMode){case 0:case"0":!1;break;case 1:case"1":for(var o=0;o<n.length;o++){var s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n[o].lng,n[o].lat));n[o].alt=Number(s?(n[o].alt+Number(s)).toFixed(2):n[o].alt.toFixed(2))}!1;break;case 2:case"2":!0}var a=[];if(i=this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]?[].concat(L()(n),[n[0]]):L()(n),this.options.smooth&&"false"!==this.options.smooth){i=this.smoothHandle(i);for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat,i[r].alt)}else for(var l=0;l<i.length;l++)a.push(i[l].lng,i[l].lat,i[l].alt);if(this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]||this.options.smooth&&"false"!==this.options.smooth){for(var c=[],u=0;u<a.length;u+=3)c.push({lng:a[u],lat:a[u+1],alt:a[u+2]});var p=this;this.computeDistance(c,2,this.options["words-name"]).then((function(t){p.options.fitLengthByMeter=t,p.lengthUnit=p.options["length-unit"]}))}else{var h=this;this.computeDistance(n,2,this.options["words-name"]).then((function(t){h.options.fitLengthByMeter=t,h.lengthUnit=h.options["length-unit"]}))}var d=this;return this.computeDistance(n,2,this.options["words-name"]).then((function(t){d.options.lengthByMeter=t,d.lengthUnit=e.options["length-unit"]})),a}}},{key:"renewPolygon",value:function(t){var e=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<t.length;n+=3)e.push([t[n],t[n+1]]);for(var o=turf.lineString(e),s=turf.buffer(o,this.options["extend-width"]/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options["extend-color"])})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions["nose-to-tail"],this.smooth=this.originalOptions.smooth,this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions["extend-width"],this.extendColor=this.originalOptions["extend-color"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.rotate=this.originalOptions.rotate,this.speed=this.originalOptions.speed,this.dashSize=this.originalOptions.dashSize,this.space=this.originalOptions.space,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;case 34:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接"+(this.options.attribute.link.content.length+1),url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图"+(this.options.attribute.vr.content.length+1),url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图"+(this.options.attribute.vr.content.length+1),url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ko({},this.options.position):this.options.positions?l=Ko({},this.options.positions[0]):this.options.center?l=Ko({},this.options.center):this.options.start?l=Ko({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p<this.options.positions.length;p++)h=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,this.options.positions[p].alt),c.push(h.x,h.y,h.z);return t.abrupt("break",41);case 31:return t.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=t.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return t.abrupt("break",41);case 36:return t.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=t.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return t.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){e.closeNodeEdit(this),this.event&&this.event.destroy(),this.event=new X(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var n=JSON.parse(JSON.stringify(this.options.positions));this.previous={positions:L()(this.options.positions)};for(var o=0;o<n.length;o++)n[o]=Cesium.Cartesian3.fromDegrees(n[o].lng,n[o].lat,n[o].alt);for(var s=n[Math.floor(n.length/2)],a=[],r=0;r<n.length;r++)s.x,n[r].x,a.push({x:s.x-n[r].x,y:s.y-n[r].y,z:s.z-n[r].z});var l=[];this.event.mouse_move((function(t,e){l=[];for(var n=0;n<a.length;n++){var o={x:e.x-a[n].x,y:e.y-a[n].y,z:e.z-a[n].z};l.push(o)}var s=i.cartesian3Towgs84(l[0],i.sdk.viewer);i.label.position=[s.lng,s.lat,s.alt],i.options.label.position={lng:s.lng,lat:s.lat,alt:s.alt},i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),l=[];for(var n=0;n<a.length;n++)l.push({x:e.x-a[n].x,y:e.y-a[n].y,z:e.z-a[n].z});for(var o=[],s=0;s<l.length;s++){var r=i.cartesian3Towgs84(l[s],i.sdk.viewer);r.alt=i.options.positions[s].alt,o.push(r),i._elms.lng&&(i._elms.lng[s].innerHTML=r.lng.toFixed(8)),i._elms.lngInput&&(i._elms.lngInput[s].value=r.lng.toFixed(8)),i._elms.lat&&(i._elms.lat[s].innerHTML=r.lat.toFixed(8)),i._elms.latInput&&(i._elms.latInput[s].value=r.lat.toFixed(8)),i._elms.alt&&(i._elms.alt[s].innerHTML=r.alt.toFixed(2)),i._elms.altInput&&(i._elms.altInput[s].value=r.alt.toFixed(2))}i.options.positions=o,i.previous.positions=o;var c=i.renewPositions(i.options.positions);i.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),i.renewPolygon(c),i.positionEditing=!1})),this.event.mouse_right((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1})),this.event.gesture_pinck_start((function(t,e){var n=new Date;i.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};o-n>=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return l.length>0?l:n}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var c=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(c),this.renewPolygon(c),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,c[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:c[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.options.heightMode,t.next="0"===t.t0||0===t.t0?3:"1"===t.t0||1===t.t0?6:"2"===t.t0||2===t.t0?13:18;break;case 3:return n=!1,i=e.options.positions[0].alt,t.abrupt("break",18);case 6:return n=!1,t.next=9,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat});case 9:return t.t1=t.sent,t.t2=e.options.positions[0].alt,i=t.t1+t.t2,t.abrupt("break",18);case 13:return n=!0,t.next=16,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat});case 16:return i=t.sent,t.abrupt("break",18);case 18:e.options.label.position||(e.options.label.position={lng:e.options.positions[0].lng,lat:e.options.positions[0].lat,alt:i}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:n});case 20:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){var i;i=2==t.heightMode;var n=t.options.positions,o=t.renewPositions(n);t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:t.options.width,clampToGround:i,zIndex:t.sdk._entityZIndex}}),t.entity.polyline.oriWidth=t.options.width,t.judgeLine(t.entity,t.options);var s=Ko({},t.options);s.speed=t.inputSpeed,t.entity.polyline.material=t.getMaterial(t.options.color,t.options.type,t.entity,s),t.sdk._entityZIndex++,e.createLabel(t),t.renewPolygon(o),t.computeDistance(n,2,t.options["words-name"]).then((function(e){t.options.lengthByMeter=e,t.lengthUnit=t.options["length-unit"],Pe(t.sdk,t.options.id)})),t.options.show&&Kt(0,t.options.id);t.sdk.viewer.scene}},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i;e.closeNodeEdit(t),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.ControllerObject=new Jo(t.sdk),t.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o),YJ.Measure.SetMeasureStatus(!1)})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<t.options.positions.length;n++){var o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,t.options.positions[n].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.ControllerObject&&t.ControllerObject.destroy(),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[]}}]);var i,n,s,r,l}(Wn);function os(t,e){var i=document.createElement("a");i.download=e,i.style.display="none";var n=new Blob([t]);i.href=URL.createObjectURL(n),document.body.appendChild(i),i.click(),document.body.removeChild(i)}var ss=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new Cesium.EntityCollection;if(t.forEach((function(t){(t instanceof No||t instanceof Fo||t instanceof po||t instanceof ns)&&e.add(t.entity)})),e.values.length){var i=Cesium.exportKml({entities:e});i.then((function(t){os(t.kml,(new Date).getTime()+".kml")}))}else console.error("允许导出为kml的对象为空")},as={yingguangse:new Map,gonganlan:new Map,hong:new Map};as.yingguangse.set("--color-sdk-base","#00ffff"),as.yingguangse.set("--color-sdk-auxiliary","#004242"),as.yingguangse.set("--color-sdk-auxiliary-public","#ffffff"),as.yingguangse.set("--color-sdk-warning-0","#1BF8C3"),as.yingguangse.set("--color-sdk-warning-1","#F16C55"),as.yingguangse.set("--color-sdk-warning-2","#FFA145"),as.yingguangse.set("--color-sdk-warning-3","#FFDF53"),as.yingguangse.set("--color-sdk-text-head","#FFFFFF"),as.yingguangse.set("--color-sdk-text-head-1","#E6F7FF"),as.yingguangse.set("--color-sdk-text-head-2","#ADF1FF"),as.yingguangse.set("--color-sdk-gradual","#00ffff 6.25%, #00ffff 100%"),as.yingguangse.set("--color-sdk-bg-gradual","#00ffff33 0%, #00ffff00 100%");var rs,ls,cs,us=null,ps=0,hs=0,ds=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return C=function(t){var i=u.getElementsByClassName("tr");i.length>0&&(i[i.length-1].querySelector("input[name='time']").disabled=void 0);var n=u.getElementsByClassName("tr active")[0];n&&(n.className="tr");var o=document.createElement("div");o.className="tr active",o.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(d+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(t.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),o.addEventListener("click",(function(t){if(t.target.parentNode===o){var e=u.getElementsByClassName("tr active")[0];e&&(e.className="tr"),o.className="tr active";for(var n=0;n<i.length;n++)if(i[n]===o){l=n+1;break}}})),o.addEventListener("dblclick",(function(t){if(t.target.parentNode===o)for(var e=0;e<i.length;e++)if(i[e]===o){s.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(m[e].position.lng,m[e].position.lat,m[e].position.alt),orientation:m[e].orientation,duration:1});break}}));var a=o.getElementsByClassName("play")[0],r=o.getElementsByClassName("delete")[0],c=o.querySelector("input[name='time']");a.addEventListener("click",(function(){for(var t=0;t<i.length;t++)i[t]===r.parentNode.parentNode&&fs(e,m,t)})),r.addEventListener("click",(function(t){for(var e=0;e<i.length;e++)if(i[e]===r.parentNode.parentNode){if(m.splice(e,1),m[m.length-1]&&(m[m.length-1].duration=0),u.removeChild(o),l>e+1?(l--,i[l-1].className="tr active"):l==e+1&&(i.length==e&&(l-=1),0!=i.length&&(i[l-1].className="tr active")),i.length>0){var n=i[i.length-1].querySelector("input[name='time']");n.disabled="disabled",n.value=0}break}})),c.addEventListener("input",(function(e){y.checked=!1,t.duration=Number(c.value),t.duration<0&&(t.duration=0)})),c.addEventListener("blur",(function(){c.value=Number(Number(c.value).toFixed(2)),c.value<0&&(c.value=0)})),u.insertBefore(o,i[l]),l++,i[i.length-1].querySelector("input[name='time']").disabled="disabled"},i=w.length>1&&void 0!==w[1]?w[1]:{},n=w.length>2&&void 0!==w[2]?w[2]:{},o=i.name||"漫游路径",i.points||(i.points=[]),i.repeat&&(ps=Number(i.repeat)),s=e.viewer,r=new fi(e),l=0,us&&us.close&&(us.close(),us=null),t.next=12,new W(s._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){vs({viewer:s})}});case 12:return us=t.sent,t.next=15,us.init();case 15:for((c=document.createElement("div")).className="fly-roam",c.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" type="text" name="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">设置总时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">\n <span class="unit" style="top: 6px;">秒(s)</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">是否循环播放</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="add-point"><svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点</button>\n </div>\n <div class="col">\n <button class="modify-point"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>调整视点</button>\n </div>\n <div class="col">\n <button class="afreshPlay"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n <div class="col">\n <button class="cease"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>结束</button>\n </div>\n </div>\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">时长(s)</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',us.contentAppChild(c),c.getElementsByTagName("*"),u=c.getElementsByClassName("table-body")[0],p=c.getElementsByClassName("table-empty")[0],h={set:function(t,e,i){return t[e]=i,t.length>0?p.style.display="none":p.style.display="flex",!0}},d=0,m=new Proxy([],h),d=0;d<i.points.length;d++)m.push(i.points[d]),C(i.points[d]);(f=c.querySelector("input[name='name']")).value=o,f.addEventListener("input",(function(){o=f.value})),(v=document.createElement("button")).innerHTML="保存",v.addEventListener("click",(function(){o||(o="漫游路径",f.value=o);var t=[];m.map((function(e){t.push(e)})),n.clickSavePath&&n.clickSavePath({name:o,points:t,repeat:ps+""})})),us.footAppChild(v),c.getElementsByClassName("cease")[0].addEventListener("click",(function(){s.camera.cancelFlight()})),c.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){m.length>0&&fs(e,m,0)})),c.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:r.cartesian3Towgs84(s.camera.position,s),orientation:{heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll}};m.splice(l,0,t),C(t),d++})),c.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(l){var t=r.cartesian3Towgs84(s.camera.position,s);m[l-1].position=t,m[l-1].orientation={heading:s.camera.heading,pitch:s.camera.pitch,roll:s.camera.roll},r.message({text:"操作成功"})}})),g=c.querySelector("input[name='totalTime']"),y=c.querySelector("input[name='isTotalTime']"),b=c.querySelector("input[name='repeat']"),y.addEventListener("change",(function(){var t=u.getElementsByClassName("tr");if(y.checked&&t.length>0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)m[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),g.addEventListener("blur",(function(){var t=u.getElementsByClassName("tr");if(g.value=Number(g.value),g.value<0&&(g.value=0),y.checked&&t.length>0){for(var e=Number((Number(g.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)m[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),b.checked=ps===1/0,b.addEventListener("change",(function(){ps=b.checked?1/0:0,hs=ps,n.changeRepeatStateCallBack&&n.changeRepeatStateCallBack(b.checked)}));case 48:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ms=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;rs&&rs.destroy(),(rs=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){vs(t)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var s,r=t.viewer;r.camera.cancelFlight(),ii(t),ni(t),r.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(e[i].position.lng,e[i].position.lat,e[i].position.alt),orientation:e[i].orientation,duration:n?e[i-1].duration:.5,maximumHeight:e[i].position.alt,complete:(s=o()(a.a.mark((function n(){return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:++i<=e.length-1?ms(t,e,i,!0):hs&&e.length>1?(hs--,ms(t,e,0)):rs&&rs.destroy();case 3:case"end":return n.stop()}}),n)}))),function(){return s.apply(this,arguments)}),easingFunction:n?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})},fs=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;hs=ps,ms(t,e,i,n)},vs=function(t){t&&t.viewer&&t.viewer.camera.cancelFlight(),rs&&rs.destroy()},gs=null,ys=null,bs=null,Cs=null,ws="uniform sampler2D colorTexture;//输入的场景渲染照片\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainWidth;\n uniform float rainSpeed;\n\n float hash(float x){\n return fract(sin(x*133.3)*13.13);\n }\n void main(void){\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a= tiltAngle;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*rainSize+1.;\n float v=1.-sin(hash(floor(uv.x*rainWidth))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b; //屏幕上雨的颜色\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //将雨和三维场景融合\n }",ks="uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSize;\n uniform float snowSpeed;\n \n float snow(vec2 uv,float scale)\n {\n float time = czm_frameNumber / snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n }\n ",xs="\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates);\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates);\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\n if (f < 0.0) f = 0.0;\n else if (f > 1.0) f = 1.0;\n gl_FragColor = mix(origcolor, fogColor, f);\n }\n ";var _s,Es,Ss,Ds,Ps,Ms,Os,Ts={},Ns=void 0,Bs=void 0,Ls=!1,As={};function js(){if(this.sdk&&this.sdk.viewer){(Bs=this.sdk.viewer.camera.pickEllipsoid(new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight/(2-(90+this.sdk.viewer.camera.pitch/(Cesium.Math.PI/180))/110))))||(Bs=this.sdk.viewer.camera.position);var t=ls.cartesian3Towgs84(this.sdk.viewer.camera.position,this.sdk.viewer).alt,e=ls.cartesian3Towgs84(Bs,this.sdk.viewer);t>9e6&&(t=9e6),t<4e5?(this.entity.billboard.show=!0,this.entity.rectangle.show=!1):(this.entity.billboard.show=!1,this.entity.rectangle.show=!0),Ns=new Cesium.Rectangle(Cesium.Math.toRadians(e.lng-t/12e4),Cesium.Math.toRadians(e.lat-t/28e4),Cesium.Math.toRadians(e.lng+t/12e4),Cesium.Math.toRadians(e.lat+t/28e4))}}function Is(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Rs,Fs,zs=null,Hs=null,Vs=null,Gs=null,Us=!1,Ws=10,Ys="#ffd000",Js=!0,qs=2.5,Xs="#43cf7c",Zs=!0,Ks=1.8,$s="#ff0000",Qs=!1,ta=1,ea="#64b6d9",ia=!1,na=1,oa="#d084d1";function sa(){if(Fs){var t=Fs.viewer.camera.positionCartographic;Cesium.Math.toDegrees(t.height)<1e6?Fs.viewer.scene.globe.material||!0!==Us||ra(Fs):la(Fs)}}function aa(){return(aa=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m=function(t){var e=t.target.value;return(t.target.value||"undefined"!==t.target.dataset.null&&""!==t.target.dataset.null&&!Boolean(t.target.dataset.null))&&(e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),t.target.dataset.min&&e<Number(t.target.dataset.min)&&(e=Number(t.target.dataset.min))),e},Fs=e,e&&!zs){t.next=4;break}return t.abrupt("return");case 4:return Hs||ca(),Rs||(Rs=new fi(e)),t.next=8,new rn(e,{},{title:"全局等高线",left:"180px",top:"100px",closeCallBack:function(){zs=null}});case 8:(zs=t.sent)._element.body.className=zs._element.body.className+" contour",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">等高线</span>\n <input class="btn-switch show" type="checkbox">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label">等高距</span>\n <div class="input-number input-number-unit-1">\n <input class="input equal-height-distance" type="number" title="" min="1" max="1000">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 60px;">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 157px;">\n <span class="label">选中线颜色</span>\n <div class="active-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">计曲线</span>\n <input class="btn-switch index-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">计曲线颜色</span>\n <div class="index-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">计曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input index-contour-width" type="number" title="" step="0.1" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">首曲线</span>\n <input class="btn-switch intermediate-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">首曲线颜色</span>\n <div class="intermediate-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">首曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input intermediate-contour-width" type="number" step="0.1" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">间曲线</span>\n <input class="btn-switch halfInterval-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">间曲线颜色</span>\n <div class="halfInterval-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">间曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input halfInterval-contour-width" type="number" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col" style="flex: 0 0 120px;">\n <span class="label">助曲线</span>\n <input class="btn-switch supplementary-contour-switch" type="checkbox">\n </div>\n <div class="col input-select-unit-box" style="flex: 0 0 120px;">\n <span class="label">助曲线颜色</span>\n <div class="supplementary-contour-color"></div>\n </div>\n <div class="col input-select-unit-box">\n <span class="label">助曲线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input supplementary-contour-width" type="number" title="" min="1" max="10">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',zs.contentAppChild(i),e.viewer.scene.postRender.removeEventListener(sa),e.viewer.scene.postRender.addEventListener(sa),(n=i.getElementsByClassName("show")[0]).checked=Us,n.addEventListener("change",(function(t){if(t.target.checked){if(Us=!0,e.viewer.camera.positionCartographic.height>16360){var i=e.viewer.camera.positionCartographic,n={position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}};Xe(e,n,.5)}ra(e)}else Us=!1,la(e)})),(o=i.getElementsByClassName("equal-height-distance")[0]).value=Ws,o.addEventListener("blur",(function(t){var e=m(t);Ws=e,o.value=e,Hs&&(Hs.uniforms.spacing=5*Ws)})),new zi({el:i.getElementsByClassName("active-color")[0],size:"mini",alpha:!0,defaultColor:Ys,disabled:!1,openPickerAni:"opacity",sure:function(t){Ys=t,Hs&&(Hs.uniforms.activeColor=Cesium.Color.fromCssColorString(Ys))},clear:function(){Ys="rgba(255,255,255,1)",Hs&&(Hs.uniforms.activeColor=Cesium.Color.fromCssColorString(Ys))}}),(s=i.getElementsByClassName("index-contour-switch")[0]).checked=Js,s.addEventListener("change",(function(t){Js=t.target.checked,Hs&&(Hs.uniforms.indexContourShow=Js)})),new zi({el:i.getElementsByClassName("index-contour-color")[0],size:"mini",alpha:!0,defaultColor:Xs,disabled:!1,openPickerAni:"opacity",sure:function(t){Xs=t,Hs&&(Hs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Xs))},clear:function(){Xs="rgba(255,255,255,1)",Hs&&(Hs.uniforms.indexContourColor=Cesium.Color.fromCssColorString(Xs))}}),(r=i.getElementsByClassName("index-contour-width")[0]).value=qs,r.addEventListener("blur",(function(t){var e=m(t);qs=e,r.value=e,Hs&&(Hs.uniforms.indexContourWidth=qs)})),(l=i.getElementsByClassName("intermediate-contour-switch")[0]).checked=Zs,l.addEventListener("change",(function(t){Zs=t.target.checked,Hs&&(Hs.uniforms.intermediateContourShow=Zs)})),new zi({el:i.getElementsByClassName("intermediate-contour-color")[0],size:"mini",alpha:!0,defaultColor:$s,disabled:!1,openPickerAni:"opacity",sure:function(t){$s=t,Hs&&(Hs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString($s))},clear:function(){$s="rgba(255,255,255,1)",Hs&&(Hs.uniforms.intermediateContourColor=Cesium.Color.fromCssColorString($s))}}),(c=i.getElementsByClassName("intermediate-contour-width")[0]).value=Ks,c.addEventListener("blur",(function(t){var e=m(t);Ks=e,c.value=e,Hs&&(Hs.uniforms.intermediateContourWidth=Ks)})),(u=i.getElementsByClassName("halfInterval-contour-switch")[0]).checked=Qs,u.addEventListener("change",(function(t){Qs=t.target.checked,Hs&&(Hs.uniforms.halfIntervalContourShow=Qs)})),new zi({el:i.getElementsByClassName("halfInterval-contour-color")[0],size:"mini",alpha:!0,defaultColor:ea,disabled:!1,openPickerAni:"opacity",sure:function(t){ea=t,Hs&&(Hs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ea))},clear:function(){ea="rgba(255,255,255,1)",Hs&&(Hs.uniforms.halfIntervalContourColor=Cesium.Color.fromCssColorString(ea))}}),(p=i.getElementsByClassName("halfInterval-contour-width")[0]).value=ta,p.addEventListener("blur",(function(t){var e=m(t);ta=e,p.value=e,Hs&&(Hs.uniforms.halfIntervalContourWidth=ta)})),(h=i.getElementsByClassName("supplementary-contour-switch")[0]).checked=ia,h.addEventListener("change",(function(t){ia=t.target.checked,Hs&&(Hs.uniforms.supplementaryContourShow=ia)})),new zi({el:i.getElementsByClassName("supplementary-contour-color")[0],size:"mini",alpha:!0,defaultColor:oa,disabled:!1,openPickerAni:"opacity",sure:function(t){oa=t,Hs&&(Hs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(oa))},clear:function(){oa="rgba(255,255,255,1)",Hs&&(Hs.uniforms.supplementaryContourColor=Cesium.Color.fromCssColorString(oa))}}),(d=i.getElementsByClassName("supplementary-contour-width")[0]).value=na,d.addEventListener("blur",(function(t){var e=m(t);na=e,d.value=e,Hs&&(Hs.uniforms.supplementaryContourWidth=na)}));case 50:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function ra(t){var e=t.viewer.camera.positionCartographic;Cesium.Math.toDegrees(e.height)>1e6||(Vs&&Vs.destroy(),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]||t.viewer.container.appendChild(Gs),(Vs=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){var i=t.viewer.scene.pickPosition(e.endPosition);if(i){var n=0,o=0;if(t.viewer&&t.viewer._element){var s=t.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];n=s.getBoundingClientRect().top+window.scrollY,o=s.getBoundingClientRect().left+window.scrollX}Gs.style.left=e.endPosition.x-50+o+"px",Gs.style.top=e.endPosition.y-40+n+"px",Gs.style.display="block";var a=Rs.cartesian3Towgs84(i,t.viewer),r=Math.floor(a.alt/Hs.uniforms.spacing)*Hs.uniforms.spacing,l=a.alt-r,c=Hs.uniforms.spacing/(Hs.uniforms.secondaryLinesCount+1),u=Math.floor(l/c)*c+r;a.alt<0&&(a.alt=0),a.alt-u>c/2&&(u+=c),Hs.uniforms.mouseHeight=a.alt,Hs.uniforms.mousePosition=i,Gs.innerHTML="".concat(u.toFixed(0))}else Gs.style.display="none"}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),t.viewer.scene.globe.material=Hs)}function la(t){Vs&&(Vs.destroy(),Vs=null),t.viewer.container.getElementsByClassName("YJ-customize-active-height-elm")[0]&&(Gs.style.display="none",t.viewer.container.removeChild(Gs)),t.viewer.scene.globe.material=null}function ca(){Cesium.Material._materialCache._materials.ElevationContour.fabric.source="\nuniform vec4 activeColor; // 选中颜色\nuniform float spacing; // 等高距\n\n// 计曲线\nuniform bool indexContourShow;\nuniform float indexContourWidth;\nuniform vec4 indexContourColor;\n// 首曲线\nuniform bool intermediateContourShow;\nuniform float intermediateContourWidth;\nuniform vec4 intermediateContourColor;\n// 间曲线\nuniform bool halfIntervalContourShow;\nuniform float halfIntervalContourWidth;\nuniform vec4 halfIntervalContourColor;\n// 助曲线\nuniform bool supplementaryContourShow;\nuniform float supplementaryContourWidth;\nuniform vec4 supplementaryContourColor;\n\nuniform float mouseHeight;\n\nuniform float secondaryLinesCount; // 0=无次线, 1=1条次线, 2=2条次线...\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // 主等高线计算\n float distanceToMainContour = mod(materialInput.height, spacing);\n \n // 抗锯齿计算\n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dFMain = max(dxc, dyc) * czm_pixelRatio * indexContourWidth;\n#else\n float dFMain = czm_pixelRatio * indexContourWidth;\n#endif\n\n bool isMainContour = distanceToMainContour < dFMain;\n bool isSecondaryContour = false;\n float dFSecondary = 0.0;\n float secondarySpacing = 0.0;\n bool isHalfInterval = false;\n bool isIntermediate= false;\n\n // 计算当前高度所属的等高线高度\n float mainContourHeight = floor(materialInput.height / spacing) * spacing;\n float secondaryContourHeight = floor(materialInput.height / spacing * (secondaryLinesCount + 1.0)) * spacing / (secondaryLinesCount + 1.0);\n \n // 计算次线在两条主等高线之间的相对位置\n float relativeHeight = materialInput.height - mainContourHeight;\n float normalizedPosition = relativeHeight / spacing;\n \n // 计算次线索引(从主等高线开始计数)\n float lineIndex = floor(normalizedPosition * (secondaryLinesCount + 1.0));\n\n // 只有当存在次线时才计算次线\n if(secondaryLinesCount > 0.0) {\n float secondaryLinesWidth = supplementaryContourWidth;\n secondarySpacing = spacing / (secondaryLinesCount + 1.0);\n float distanceToSecondaryContour = mod(materialInput.height, secondarySpacing);\n \n // 确保次线不会与主线重叠\n float minDistanceToMain = min(distanceToMainContour, spacing - distanceToMainContour);\n bool notCloseToMain = minDistanceToMain > dFMain * 2.0; // 2倍线宽缓冲\n\n\n if (lineIndex > 0.0 && lineIndex < secondaryLinesCount) {\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isHalfInterval = abs(mod(lineIndex, 2.0)) < 0.01;\n if(isHalfInterval) {\n secondaryLinesWidth = halfIntervalContourWidth;\n }\n // 使用mod函数检查余数是否接近0(考虑浮点数精度问题)\n isIntermediate = abs(mod(lineIndex, 4.0)) < 0.01;\n if(isIntermediate) {\n secondaryLinesWidth = intermediateContourWidth;\n }\n }\n\n\n\n\n\n\n\n\n \n#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))\n dFSecondary = max(dxc, dyc) * czm_pixelRatio * secondaryLinesWidth;\n#else\n dFSecondary = czm_pixelRatio * secondaryLinesWidth;\n#endif\n\n isSecondaryContour = (distanceToSecondaryContour < dFSecondary) && notCloseToMain;\n }\n\n // 高亮判断\n bool shouldHighlight = false;\n if(isMainContour && abs(mainContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n } else if(isSecondaryContour && abs(secondaryContourHeight - mouseHeight) < 0.5 * (spacing/(secondaryLinesCount+1.0))) {\n shouldHighlight = true;\n }\n\n // 颜色输出\n vec4 outColor;\n if(shouldHighlight) {\n outColor = czm_gammaCorrect(vec4(activeColor.rgb, activeColor.a));\n } else if(isMainContour) {\n float a = indexContourColor.a;\n if(!indexContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(indexContourColor.rgb, a));\n } else if(isSecondaryContour) {\n float a = supplementaryContourColor.a;\n if(!supplementaryContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(supplementaryContourColor.rgb, a));\n if(isHalfInterval) {\n float a = halfIntervalContourColor.a;\n if(!halfIntervalContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(halfIntervalContourColor.rgb, a));\n }\n if(isIntermediate) {\n float a = intermediateContourColor.a;\n if(!intermediateContourShow) {\n a = 0.0;\n }\n outColor = czm_gammaCorrect(vec4(intermediateContourColor.rgb, a));\n }\n } else {\n outColor = vec4(0.0);\n }\n\n if(materialInput.height<0.0) {\n outColor = vec4(0.0);\n }\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n",Hs=new Cesium.Material({fabric:{type:"ElevationContour",uniforms:{spacing:50,activeColor:Cesium.Color.fromCssColorString(Ys),mouseHeight:-1e5,mousePosition:new Cesium.Cartesian3(0,0,0),secondaryLinesCount:19,cameraHeight:0,indexContourShow:Js,indexContourWidth:qs,indexContourColor:Cesium.Color.fromCssColorString(Xs),intermediateContourShow:Zs,intermediateContourWidth:Ks,intermediateContourColor:Cesium.Color.fromCssColorString($s),halfIntervalContourShow:Qs,halfIntervalContourWidth:ta,halfIntervalContourColor:Cesium.Color.fromCssColorString(ea),supplementaryContourShow:ia,supplementaryContourWidth:na,supplementaryContourColor:Cesium.Color.fromCssColorString(oa)}}})}function ua(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function pa(t,e,i){return t.set(da(t,e),i),i}function ha(t,e){return t.get(da(t,e))}function da(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}(Gs=document.createElement("div")).className="YJ-customize-active-height-elm",Gs.style.position="absolute",Gs.style.left="10px",Gs.style.top="10px",Gs.style.width="100px",Gs.style.textAlign="center",Gs.style.pointerEvents="none",Gs.style.color="#ff0000",Gs.style.display="none";var ma=new WeakMap,fa=new WeakMap,va=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;k()(this,t),ua(this,ma,null),ua(this,fa,{bgimg:null,img1:null,img2:null,img3:null,img4:null}),this.sdk=e,this.options=i,this.data={},this._webSocketCallback=n,this._tools=new fi(this.sdk),this.requestResource()}),[{key:"requestResource",value:function(){var t=this;this.options.host=this.options.host||h();var e;e=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+e,[],{maxReconnectAttempts:8}),this.reconnecting.onopen=function(e){t.reconnecting.onmessage=function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data=JSON.parse(i.data),!t.data||!t.data.rmc){e.next=7;break}return e.next=4,t._tools.getClampToHeight(t.data.rmc);case 4:n=e.sent,t.position=new Cesium.Cartesian3.fromDegrees(t.data.rmc.lng,t.data.rmc.lat,n),t.create();case 7:t._webSocketCallback&&t._webSocketCallback(t.data);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}},{key:"create",value:function(){var t=this;if(this.getcanvas(),this.data&&this.data.rmc&&!this.entity){this.entity=new Cesium.CustomDataSource,this.sdk.viewer.dataSources.add(this.entity);var e=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:this._tools.getSourceRootPath()+"/img/locate2.png",scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:31,height:36,pixelOffset:new Cesium.Cartesian2(0,-15)}}),i=new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:{image:new Cesium.CallbackProperty((function(){return t.lableCanvas})),scale:1,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:1e8}),!1),width:220,height:140,pixelOffset:new Cesium.Cartesian2(0,-110)}});this.entity.entities.add(e),this.entity.entities.add(i)}}},{key:"loaded",value:function(t){var e;Object.defineProperty(this,"data",{get:function(){return e},set:function(i){e=i,t&&(t(),t=void 0)}})}},{key:"getcanvas",value:function(){var t=this,e=[{images:this._tools.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(this.data.rmc.lng.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(this.data.rmc.lat.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/h.png",text:"海拔:"+parseFloat(this.data.rmc.alt.toFixed(10))},{images:this._tools.getSourceRootPath()+"/img/bubble/satellite.png",text:"卫星:"+this.data.satellites||!1}];if(ha(ma,this)){var i=ha(ma,this).getContext("2d");i.clearRect(0,0,ha(ma,this).width,ha(ma,this).height),i.drawImage(ha(fa,this).bgimg,0,0,ha(ma,this).width,ha(ma,this).height);var n=0;e.forEach((function(o,s){i.drawImage(ha(fa,t)["img"+(s+1)],12,12+26*s),i.fillStyle="#fff",i.font="16px Arial",i.fillText(o.text,44,28+26*s),++n===e.length&&(t.lableCanvas=ha(ma,t).toDataURL())}))}else{pa(ma,this,document.createElement("canvas"));var o=ha(ma,this).getContext("2d");ha(ma,this).width=220,ha(ma,this).height=140;var s=new Image;ha(fa,this).bgimg=s,s.src=this._tools.getSourceRootPath()+"/img/bubble/bubble.png";var a=0;s.onload=function(){o.drawImage(s,0,0,ha(ma,t).width,ha(ma,t).height),e.forEach((function(i,n){var s=new Image;ha(fa,t)["img"+(n+1)]=s,s.src=i.images,s.onload=function(){o.drawImage(s,12,12+26*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText(i.text,44,28+26*n),++a===e.length&&(t.lableCanvas=ha(ma,t).toDataURL())}}))}}}},{key:"flyTo",value:(t=o()(a.a.mark((function t(){var e,i,n=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:{},!this.data||!this.data.rmc){t.next=9;break}return t.next=4,this._tools.getClampToHeight(this.data.rmc);case 4:i=t.sent,pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Cartesian3.fromDegrees(this.data.rmc.lng,this.data.rmc.lat,i+(e.height||500))});case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){pa(ma,this,null),pa(fa,this,{}),this.reconnecting&&this.reconnecting.close(),this.sdk.viewer.dataSources.remove(this.entity),this.entity=null}},{key:"flicker",value:function(){}}]);var t}();var ga=i(9),ya=i.n(ga);function ba(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ca=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),(i=ba(this,e,[t,n])).viewer=t.viewer,i.entityHasCreated=!1,i.event=null,i.tip=null,i.points_ids=[],i.color=n.color||"rgba(185,14,14,0.58)",i._is2D=o,i._sdk2D=Ie(),i}return sn()(e,t),_()(e,[{key:"create_point",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.viewer,i=this.randomString();return e.entities.add(new Cesium.Entity({id:i,position:t,billboard:{image:this.getSourceRootPath()+"/img/point.png",color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t),!this._is2D&&this._sdk2D&&this._sdk2D.viewer&&this._sdk2D.viewer.entities&&this._sdk2D.viewer.entities.removeById(t)}},{key:"start",value:function(){}},{key:"end",value:function(){var t=this;YJ.Measure.SetMeasureStatus(!1),this.entityHasCreated=!1,this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy(),this.points_ids.forEach((function(e){t.remove_entity(e)}))}}])}(fi);function wa(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ka(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?wa(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):wa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function xa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var _a=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=xa(this,e,[t,n])).color=n.color||"rgba(255,0,0,0.5)",i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=[];this.event.mouse_left((function(t,i){if("2D"!==l){if(l="3D",r.positions=c.concat(ka({},i)),r.tip.setPosition(i,t.position.x,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(t(null,u),r.end())})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(ka({},e)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(ka({},i)),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.polygonHasCreated){var n=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),u.push(r.cartesian3Towgs84(i,r.viewer)),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(t(null,u),r.end())})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(ka({},e)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),u.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,u),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}c.push(n),u.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:3,material:Cesium.Color.fromCssColorString(t.color).withAlpha(1),clampToGround:!0,zIndex:99999999}})),i}}])}(Ca),Ea=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.sdk=e,this.viewer=e.viewer,this.height=i.height||70,this.maxHeigh=-1e6,this.precision=i.precision||125,this.Dialog=n,this.result={allArea:"",cutArea:"",cutVolume:"",fillArea:"",fillVolume:"",noArea:""},this.entities=[],this.Draw=new _a(this.sdk),YJ.Analysis.AnalysesResults.push(this),t.EditBox(this)}),[{key:"create",value:function(){var t=this;this.clean(),this.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("最少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"最少需要三个坐标!",type:"warning",duration:1500}))}for(var n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat,i[o].alt);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n),t.createPolygonGeo(t.positions),t.result=t.VolumeAnalysis(),t.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1}))}},{key:"createPolygonGeo",value:function(t){var e=Math.PI/Math.pow(2,11);e/=this.precision;var i=new Cesium.PolygonGeometry.fromPositions({positions:t,vertexFormat:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:e});this.geom=new Cesium.PolygonGeometry.createGeometry(i)}},{key:"VolumeAnalysis",value:function(){var t=0,e=0,i=0,n=0,o=0,s=this.geom.indices;if(this.geom&&this.geom.attributes&&this.geom.attributes.position){for(var a=this.geom.attributes.position.values,r=0;r<s.length;r+=3){var l=this.returnPosition(a,s[r]),c=this.returnPosition(a,s[r+1]),u=this.returnPosition(a,s[r+2]),p=this.viewer.entities.add({name:"三角面",polygon:{hierarchy:[l.heightPos,c.heightPos,u.heightPos],perPositionHeight:!0,material:Cesium.Color.fromRandom(),extrudedHeight:this.height,outline:!0,outlineColor:Cesium.Color.BLACK}});this.entities.push(p);var h=this.computeArea4Triangle(l.noHeightPos,c.noHeightPos,u.noHeightPos),d=(l.height+c.height+u.height)/3;if(d<this.height)i+=h,n+=h*(this.height-d);else if(d==this.height)o+=h;else{t+=h,e+=h*(d-this.height)}}var m=t+i+o;return this.result.allArea=m,this.result.cutArea=t,this.result.cutVolume=e,this.result.fillArea=i,this.result.fillVolume=n,this.result.noArea=o,this.result}}},{key:"computeCentroid4Polygon",value:function(t){for(var e=[],i=[],n=0,o=0,s=0;s<t.length;s++){var a=Cesium.Cartographic.fromCartesian(t[s]);n+=a.longitude,o+=a.latitude,e.push(a.longitude),i.push(a.latitude)}var r=n/t.length,l=o/t.length,c=new Cesium.Cartographic(r,l);return Cesium.Cartesian3.fromRadians(c.longitude,c.latitude,this.maxHeigh+30)}},{key:"computeArea4Triangle",value:function(t,e,i){var n=Cesium.Cartesian3.distance(t,e),o=Cesium.Cartesian3.distance(e,i),s=Cesium.Cartesian3.distance(i,t),a=(n+o+s)/2;return Math.sqrt(a*(a-n)*(a-o)*(a-s))}},{key:"returnPosition",value:function(t,e){var i=new Cesium.Cartesian3(t[3*e],t[3*e+1],t[3*e+2]),n=Cesium.Cartographic.fromCartesian(i),o=this.viewer.scene.sampleHeightSupported?this.viewer.scene.sampleHeight(n):this.viewer.scene.globe.getHeight(n);return o>this.maxHeigh&&(this.maxHeigh=o),{heightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,o),noHeightPos:Cesium.Cartesian3.fromRadians(n.longitude,n.latitude,0),height:o}}},{key:"clean",value:function(){this.Draw&&this.Draw.end();for(var t=0;t<this.entities.length;t++)this.viewer.entities.remove(this.entities[t])}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"EditBox",value:(t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),t.next=3,new W(e.sdk.viewer._container,{title:"土方分析",left:"180px",top:"100px",closeCallBack:function(){e.clean(),e.Dialog.closeCallBack&&e.Dialog.closeCallBack()}});case 3:return e._DialogObject=t.sent,t.next=6,e._DialogObject.init();case 6:(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">绘制分析区域</span>\n <button class="draw-btn"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>开始绘制</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">基准高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-999999" max="999999" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit">\n <input class="input" type="number" title="" min="1" max="1250" name="precision">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">总分析面积:</span>\n <span class="text-number" name="allArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">无须填挖面积:</span>\n <span class="text-number" name="noArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方面积:</span>\n <span class="text-number" name="fillArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方面积:</span>\n <span class="text-number" name="cutArea">0</span>\n <span class="unit text-number">m²</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 74px;">填方体积:</span>\n <span class="text-number" name="fillVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 90px;">挖方体积:</span>\n <span class="text-number" name="cutVolume">0</span>\n <span class="unit text-number">m³</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',e._DialogObject.contentAppChild(i),e._DialogObject._element.body.className=e._DialogObject._element.body.className+" cut-fill",(n=i.querySelector("input[name='height']")).value=e.height,n.addEventListener("blur",(function(t){var i=t.target.value;"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),n.value=i,e.height=n.value)})),(o=i.querySelector("input[name='precision']")).value=e.precision,o.addEventListener("blur",(function(t){var i=Number(t.target.value);t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),o.value=i,e.precision=o.value})),(s=i.querySelector("span[name='allArea']")).innerHTML=e.result.allArea||0,Object.defineProperty(e.result,"allArea",{get:function(){return s.innerHTML},set:function(t){s.innerHTML=Number(t.toFixed(4))}}),(r=i.querySelector("span[name='fillArea']")).innerHTML=e.result.fillArea||0,Object.defineProperty(e.result,"fillArea",{get:function(){return r.innerHTML},set:function(t){r.innerHTML=Number(t.toFixed(4))}}),(l=i.querySelector("span[name='fillVolume']")).innerHTML=e.result.fillVolume||0,Object.defineProperty(e.result,"fillVolume",{get:function(){return l.innerHTML},set:function(t){l.innerHTML=Number(t.toFixed(4))}}),(c=i.querySelector("span[name='cutArea']")).innerHTML=e.result.cutArea||0,Object.defineProperty(e.result,"cutArea",{get:function(){return c.innerHTML},set:function(t){c.innerHTML=Number(t.toFixed(4))}}),(u=i.querySelector("span[name='cutVolume']")).innerHTML=e.result.cutVolume||0,Object.defineProperty(e.result,"cutVolume",{get:function(){return u.innerHTML},set:function(t){u.innerHTML=Number(t.toFixed(4))}}),(p=i.querySelector("span[name='noArea']")).innerHTML=e.result.noArea||0,Object.defineProperty(e.result,"noArea",{get:function(){return p.innerHTML},set:function(t){p.innerHTML=Number(t.toFixed(4))}}),i.getElementsByClassName("draw-btn")[0].addEventListener("click",(function(){e.create()}));case 36:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]);var t}();function Sa(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Da(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Da(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Da(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Pa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ma=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Pa(this,e,[t,n])).sdk=t,i.options={},i.options.name=n.name,i.options.risingSpeed=1,i.options.minWaterLevel=0,i.options.maxWaterLevel=0,i.options.waterVolume=0,i.currentWaterLaver,i.color="#00d9ff66",i.Dialog=o,i.Draw=new _a(i.sdk),i.positions,i.status=!0,i.area=0,i._elms={},YJ.Analysis.AnalysesResults.push(i),e.EditBox(i),i}return sn()(e,t),_()(e,[{key:"move",value:function(){var t=this;this.TweenAnimate&&TWEEN.remove(this.TweenAnimate);var e=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},e).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start();var i=this._DialogObject._element.body,n=i.getElementsByClassName("pause")[0];i.getElementsByClassName("start")[0].style.display="none",n.style.display="flex"}},{key:"restart",value:function(){var t=this;this.currentWaterLaver=this.options.minWaterLevel;var e=!1;this.TweenAnimate&&(e=this.TweenAnimate._isPaused,TWEEN.remove(this.TweenAnimate));var i=(this.options.maxWaterLevel-this.options.minWaterLevel)/this.options.risingSpeed*1e3;this.TweenAnimate=new TWEEN.Tween({waterLevel:this.options.minWaterLevel}).to({waterLevel:this.options.maxWaterLevel},i).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.currentWaterLaver=i.waterLevel;case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start(),e&&this.pause()}},{key:"start",value:function(){this.TweenAnimate&&this.TweenAnimate.resume()}},{key:"pause",value:function(){this.TweenAnimate&&this.TweenAnimate.pause()}},{key:"calculateVolumeHeight",value:function(){that.options.maxWaterLevel}},{key:"flyTo",value:function(){if(this.positions&&0!==this.positions.length){ii(this.sdk),ni(this.sdk);for(var t=[],e=0;e<this.positions.length;e++){var i=Cesium.Cartesian3.fromDegrees(this.positions[e].lng,this.positions[e].lat,this.options.maxWaterLevel);t.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(t);this.sdk.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}}},{key:"destroy",value:function(){this.TweenAnimate&&TWEEN.remove(this.TweenAnimate),this.Draw.end(),this.sdk.viewer.entities.remove(this.entity),this.entity=null}}],[{key:"create",value:function(t){t.Draw.start((function(e,i){if(!i||i.length<3){return console.warn("至少需要三个坐标!"),void(window.ELEMENT&&window.ELEMENT.Message({message:"至少需要三个坐标!",type:"warning",duration:1500}))}if(t.destroy(),!i||0==i.length)return t.positions=[],t._positions=[],t.options.minWaterLevel=0,t.options.maxWaterLevel=0,t.options.waterVolume=0,void(t.area=0);var n=[];t.positions=i,t._positions=i,t.options.minWaterLevel=i[0].alt;for(var o=0;o<i.length;o++)t.options.minWaterLevel>i[o].alt&&(t.options.minWaterLevel=i[o].alt),n.push(i[o].lng,i[o].lat);var s=Cesium.Cartesian3.fromDegreesArray(n);t.currentWaterLaver=t.options.minWaterLevel,t.entity=t.sdk.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(s),height:new Cesium.CallbackProperty((function(){return t.options.minWaterLevel}),!1),extrudedHeight:new Cesium.CallbackProperty((function(){return t.currentWaterLaver}),!1),material:Cesium.Color.fromCssColorString(t.color)}}),t.area=t.computeArea(i),t.TweenAnimate&&(TWEEN.remove(t.TweenAnimate),t.TweenAnimate=null);var a=t._DialogObject._element.body,r=a.getElementsByClassName("pause")[0];a.getElementsByClassName("start")[0].style.display="flex",r.style.display="none"}))}},{key:"EditBox",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"淹没分析",left:"180px",top:"100px",closeCallBack:function(){i.destroy(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" submerge",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">水量</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="waterVolume">\n <span class="unit">m³</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最小水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="minWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">水面面积</span>\n <div class="input-number input-number-unit-3">\n <input class="input area" type="number" readonly="readonly" type="text">\n <span class="unit">㎡</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最大水位</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" name="maxWaterLevel">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row subtitle-box">\n <span class="subtitle">上升速度</span>\n </div>\n <div class="row">\n <div class="col">\n <input type="range" max="50" min="0" step="0.01" name="risingSpeed">\n <div class="input-number input-number-unit-3" style="flex: 0 0 110px;margin-left: 10px;">\n <input class="input" type="number" title="" name="risingSpeed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col operate-btn-box">\n <button class="draw"><svg class="icon-draw"><use xlink:href="#yj-icon-draw"></use></svg>绘制范围</button>\n <button class="flyto"><svg class="icon-positions"><use xlink:href="#yj-icon-positions"></use></svg>定位</button>\n <button class="reset"><svg class="icon-reset"><use xlink:href="#yj-icon-reset"></use></svg>重置</button>\n <button class="analog"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>开始模拟</button>\n <button class="pause" style="margin-right: 0px;"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>暂停</button>\n <button class="start" style="display: none;margin-right: 0px;"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n </div>\n </div>\n \n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">经度</div>\n <div class="th">纬度</div>\n <div class="th">高程</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n <span class="custom-divider" style="margin-top: 20px;"></span>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).className="el-button",o.innerHTML="暂停",o.style.width="80px",n.getElementsByClassName("draw")[0].addEventListener("click",(function(){e.create(i)})),n.getElementsByClassName("analog")[0].addEventListener("click",(function(){i.move()})),n.getElementsByClassName("flyto")[0].addEventListener("click",(function(){i.flyTo()})),n.getElementsByClassName("reset")[0].addEventListener("click",(function(){i.restart()})),s=n.getElementsByClassName("pause")[0],r=n.getElementsByClassName("start")[0],s.addEventListener("click",(function(){i.pause(),s.style.display="none",r.style.display="flex"})),r.addEventListener("click",(function(){i.start(),r.style.display="none",s.style.display="flex"})),(l=n.querySelectorAll("input[name='risingSpeed']"))[0].value=i.options.risingSpeed,l[1].value=i.options.risingSpeed,l[0].addEventListener("input",(function(t){i.options.risingSpeed=Number(t.target.value)})),l[1].addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value),n=Number(l[0].max),o=Number(l[0].min);i.options.risingSpeed=e>n?n:e<o?o:Math.floor(100*e)/100}})),Object.defineProperty(i.options,"risingSpeed",{get:function(){return l[0].value},set:function(t){l[0].value=t,l[1].value=t}}),i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,(c=n.querySelector("input[name='minWaterLevel']")).value=i.options.minWaterLevel,c.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),i.options.minWaterLevel=Math.floor(1e4*e)/1e4,i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}})),Object.defineProperty(i.options,"minWaterLevel",{get:function(){return Number(c.value)},set:function(t){c.value=Math.floor(1e4*Number(t))/1e4}}),(u=n.querySelector("input[name='maxWaterLevel']")).value=i.options.maxWaterLevel,u.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>999999999&&(e=999999999),e<0&&(e=0),e<i.options.minWaterLevel?i.options.maxWaterLevel=i.options.minWaterLevel:i.options.maxWaterLevel=Math.floor(1e4*e)/1e4,i.waterLevel=i.options.maxWaterLevel-i.options.minWaterLevel,i.options.waterVolume=Number((i.waterLevel*i.area).toFixed(4))}})),Object.defineProperty(i.options,"maxWaterLevel",{get:function(){return Number(u.value)},set:function(t){isNaN(t)&&(t=0),u.value=Math.floor(1e4*Number(t))/1e4}}),(p=n.querySelector("input[name='waterVolume']")).value=i.options.waterVolume,p.addEventListener("input",(function(t){if("."!=t.data){var e=Number(t.target.value);e>99999999999999&&(e=99999999999999),e<0&&(e=0),i.options.waterVolume=Math.floor(1e4*e)/1e4,i.area&&(i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel)}})),Object.defineProperty(i.options,"waterVolume",{get:function(){return Number(p.value)},set:function(t){p.value=t}}),(h=n.getElementsByClassName("area")[0]).value=i.area,Object.defineProperty(i,"area",{get:function(){return Number(h.value)},set:function(t){h.value=t,i.waterLevel=Number((i.options.waterVolume/i.area).toFixed(4)),i.options.maxWaterLevel=i.options.minWaterLevel+i.waterLevel}}),d=n.getElementsByClassName("table-body")[0],m=n.getElementsByClassName("table-empty")[0],Object.defineProperty(i,"positions",{get:function(){return i._positions},set:function(t){if(t&&t.length>0){m.style.display="none";for(var e="",i=0;i<t.length;i++)e+='<div class="tr">\n <div class="td">'.concat(i+1,'</div>\n <div class="td">').concat(Number(t[i].lng.toFixed(10)),'</div>\n <div class="td">').concat(Number(t[i].lat.toFixed(10)),'</div>\n <div class="td">').concat(Number(t[i].alt.toFixed(4)),"</div>\n </div>");d.innerHTML=e}else d.innerHTML="",m.style.display="flex"}});case 51:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Sa(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type&&(i=Number(i)),t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i}(fi);function Oa(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ta(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Oa(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Oa(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Na(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ba=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Na(this,e,[t,n])).viewer=t.viewer,i.options={},i.options.viewPosition=n.viewPosition,i.options.viewPositionEnd=n.viewPositionEnd,i.options.horizontalViewAngle=n.horizontalViewAngle||0===n.horizontalViewAngle?n.horizontalViewAngle:90,i.options.verticalViewAngle=n.verticalViewAngle||0===n.verticalViewAngle?n.verticalViewAngle:60,i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i._elms={},i.viewPointHeight=n.viewPointHeight,i.ids=[],i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"viewPosition",get:function(){return this.options.viewPosition},set:function(t){this.options.viewPosition=t,this.ids[0]&&(this.viewer.entities.getById(this.ids[0]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"viewPositionEnd",get:function(){return this.options.viewPositionEnd},set:function(t){this.options.viewPositionEnd=t,this.ids[1]&&(this.viewer.entities.getById(this.ids[1]).position=new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt)),this.update()}},{key:"horizontalViewAngle",get:function(){return this.options.horizontalViewAngle},set:function(t){if(this.options.horizontalViewAngle=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var e=this._DialogObject._element.content;e.querySelector("input[name='horizontalViewAngle']").value=t,e.getElementsByClassName("range-node-active")[0].getElementsByClassName("range-node-active-text")[0].innerHTML=t+"°",e.getElementsByClassName("range-process")[0].style.width=t/180*100+"%"}this.update()}},{key:"visibleAreaColor",get:function(){return this.options.visibleAreaColor},set:function(t){this.options.visibleAreaColor=t,this.update()}},{key:"invisibleAreaColor",get:function(){return this.options.invisibleAreaColor},set:function(t){this.options.invisibleAreaColor=t,this.update()}},{key:"verticalViewAngle",get:function(){return this.options.verticalViewAngle},set:function(t){this.options.verticalViewAngle=t,this.update()}},{key:"viewDistance",get:function(){var t=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),e=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return Cesium.Cartesian3.distance(t,e)}},{key:"viewHeading",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))}},{key:"viewPitch",get:function(){var t,e,i,n,o=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),s=Cesium.Cartesian3.fromDegrees(this.options.viewPositionEnd.lng,this.options.viewPositionEnd.lat,this.options.viewPositionEnd.alt);return t=o,e=s,i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t),Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.asin(i.z))}},{key:"add",value:function(){this.createLightCamera(),this.createShadowMap(),this.createPostStage(),this.drawSketch(),e.getcanvas(this)}},{key:"update",value:function(){this.clear(),this.add()}},{key:"clear",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,this.sketch&&(this.viewer.entities.removeById(this.sketch.id),this.sketch=null),this.frustumOutline&&(this.viewer.entities.removeById(this.frustumOutline.id),this.frustumOutline=null),this.postStage&&(this.viewer.scene.postProcessStages.remove(this.postStage),this.postStage=null)}},{key:"destroy",value:function(){var t=this;this.clear(),this.editevent&&this.editevent.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.ids.forEach((function(e){t.viewer.entities.removeById(e)})),this.ids=[],this.viewBillboardPrimitive&&this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null,this.options.viewPosition=null,this.options.viewPositionEnd=null,YJ.Measure.SetMeasureStatus(!1),this._originalShadowMap&&(this.viewer.scene.shadowMap=this._originalShadowMap,this._originalShadowMap=null),this.viewer.shadows=this.viewer._shadows}},{key:"nodeEdit",value:function(){var t,e=this;YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(this.editevent&&this.editevent.destroy(),this.ids.forEach((function(t){e.viewer.entities.getById(t).show=!0})),YJ.Measure.SetMeasureStatus(!0),this.editevent=new X(this.sdk),this.editevent.mouse_left((function(i,n){var o=e.viewer.scene.pick(i.position);o&&o.id&&o.id.id&&-1!=e.ids.indexOf(o.id.id)&&(!t||t.id!=o.id.id)&&(t=o.id,e.viewer.entities.getById(e.ids[0]).position=new Cesium.Cartesian3.fromDegrees(e.viewPosition.lng,e.viewPosition.lat,e.viewPosition.alt),e.viewer.entities.getById(e.ids[1]).position=new Cesium.Cartesian3.fromDegrees(e.viewPositionEnd.lng,e.viewPositionEnd.lat,e.viewPositionEnd.alt),e.ControllerObject&&e.ControllerObject.destroy(),e.ControllerObject=new Jo(e.sdk,{position:Ta({},e.cartesian3Towgs84(t.position._value,e.sdk.viewer))}),e.ControllerObject.controllerCallBack=function(i,n){i.position.alt<0&&(i.position.alt=0),t.position=new Cesium.Cartesian3.fromDegrees(i.position.lng,i.position.lat,i.position.alt),n&&(0==e.ids.indexOf(o.id.id)?e.viewPosition=i.position:e.viewPositionEnd=i.position,YJ.Measure.SetMeasureStatus(!0))},e.ControllerObject.editTranslational())})),this.editevent.mouse_right((function(i,n){YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null})),this.editevent.mouse_move((function(t,e){})),this.editevent.gesture_pinck_start((function(i,n){var o=new Date;e.editevent.gesture_pinck_end((function(){new Date-o>=500&&(YJ.Measure.SetMeasureStatus(!1),e.editevent&&e.editevent.destroy(),e.ControllerObject&&e.ControllerObject.destroy(),e.ids.forEach((function(t){e.viewer.entities.getById(t).show=!1})),t=null)}))})))}},{key:"createLightCamera",value:function(){if(this.options.viewPosition){this.lightCamera=new Cesium.Camera(this.viewer.scene),this.lightCamera.position=Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),this.lightCamera.frustum.near=.001*this.viewDistance,this.lightCamera.frustum.far=this.viewDistance;var t=Cesium.Math.toRadians(this.horizontalViewAngle),e=Cesium.Math.toRadians(this.verticalViewAngle),i=this.viewDistance*Math.tan(t/2)*2/(this.viewDistance*Math.tan(e/2)*2);this.lightCamera.frustum.aspectRatio=i,this.lightCamera.frustum.fov=t>e?t:e,this.lightCamera.setView({destination:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:{heading:Cesium.Math.toRadians(this.viewHeading||0),pitch:Cesium.Math.toRadians(this.viewPitch||0),roll:0}})}}},{key:"createShadowMap",value:function(){this.shadowMap=new Cesium.ShadowMap({context:this.viewer.scene.context,lightCamera:this.lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this.viewDistance,cascadesEnabled:!1,size:2048,softShadows:!0,normalOffset:!1,fromLightSource:!1}),this._originalShadowMap||(this._originalShadowMap=this.viewer.scene.shadowMap),this.viewer.scene.shadowMap=this.shadowMap}},{key:"createPostStage",value:function(){var t=this;Number(Cesium.VERSION.split(".")[1])>=102&&gn()("fs");var e=new Cesium.PostProcessStage({fragmentShader:"\n #define USE_CUBE_MAP_SHADOW true\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n varying vec2 v_textureCoordinates;\n uniform mat4 camera_projection_matrix;\n uniform mat4 camera_view_matrix;\n uniform samplerCube shadowMap_textureCube;\n uniform mat4 shadowMap_matrix;\n uniform vec4 shadowMap_lightPositionEC;\n uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\n uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\n uniform float helsing_viewDistance;\n uniform vec4 helsing_visibleAreaColor;\n uniform vec4 helsing_invisibleAreaColor;\n\n struct zx_shadowParameters\n {\n vec3 texCoords;\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n };\n\n float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters)\n {\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n }\n\n vec4 getPositionEC(){\n return czm_windowToEyeCoordinates(gl_FragCoord);\n }\n\n vec3 getNormalEC(){\n return vec3(1.);\n }\n\n vec4 toEye(in vec2 uv,in float depth){\n vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.));\n vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.);\n posInCamera=posInCamera/posInCamera.w;\n return posInCamera;\n }\n\n vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){\n vec3 v01=point-planeOrigin;\n float d=dot(planeNormal,v01);\n return(point-planeNormal*d);\n }\n\n float getDepth(in vec4 depth){\n float z_window=czm_unpackDepth(depth);\n z_window=czm_reverseLogDepth(z_window);\n float n_range=czm_depthRange.near;\n float f_range=czm_depthRange.far;\n return(2.*z_window-n_range-f_range)/(f_range-n_range);\n }\n\n float shadow(in vec4 positionEC){\n vec3 normalEC=getNormalEC();\n zx_shadowParameters shadowParameters;\n shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\n shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\n shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\n shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\n vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz;\n float distance=length(directionEC);\n directionEC=normalize(directionEC);\n float radius=shadowMap_lightPositionEC.w;\n if(distance>radius)\n {\n return 2.0;\n }\n vec3 directionWC=czm_inverseViewRotation*directionEC;\n shadowParameters.depth=distance/radius-0.0003;\n shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.);\n shadowParameters.texCoords=directionWC;\n float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters);\n return visibility;\n }\n\n bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.\n &&result.y>=-1.&&result.y<=1.\n &&result.z>=-1.&&result.z<=1.;\n }\n\n void main(){\n // 釉色 = 结构二维(颜色纹理, 纹理坐标)\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n // 深度 = 获取深度(结构二维(深度纹理, 纹理坐标))\n float depth = getDepth(texture2D(depthTexture, v_textureCoordinates));\n // 视角 = (纹理坐标, 深度)\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n // 世界坐标\n vec4 wordPos = czm_inverseView * viewPos;\n // 虚拟相机中坐标\n vec4 vcPos = camera_view_matrix * wordPos;\n float near = .001 * helsing_viewDistance;\n float dis = length(vcPos.xyz);\n if(dis > near && dis < helsing_viewDistance){\n // 透视投影\n vec4 posInEye = camera_projection_matrix * vcPos;\n // 可视区颜色\n // vec4 helsing_visibleAreaColor=vec4(0.,1.,0.,.5);\n // vec4 helsing_invisibleAreaColor=vec4(1.,0.,0.,.5);\n if(visible(posInEye)){\n float vis = shadow(viewPos);\n if(vis > 0.3){\n gl_FragColor = mix(gl_FragColor,helsing_visibleAreaColor,.5);\n } else{\n gl_FragColor = mix(gl_FragColor,helsing_invisibleAreaColor,.5);\n }\n }\n }\n }",uniforms:{shadowMap_textureCube:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapTexture")},shadowMap_matrix:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_shadowMapMatrix")},shadowMap_lightPositionEC:function(){return t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState")),Reflect.get(t.shadowMap,"_lightPositionEC")},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias;return Cesium.Cartesian4.fromElements(e.normalOffsetScale,t.shadowMap._distance,t.shadowMap.maximumDistance,0,new Cesium.Cartesian4)},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){t.shadowMap.update(Reflect.get(t.viewer.scene,"_frameState"));var e=t.shadowMap._pointBias,i=new Cesium.Cartesian2;return i.x=1/t.shadowMap._textureSize.x,i.y=1/t.shadowMap._textureSize.y,Cesium.Cartesian4.fromElements(i.x,i.y,e.depthBias,e.normalShadingSmooth,new Cesium.Cartesian4)},camera_projection_matrix:this.lightCamera.frustum.projectionMatrix,camera_view_matrix:this.lightCamera.viewMatrix,helsing_viewDistance:function(){return t.viewDistance},helsing_visibleAreaColor:Cesium.Color.fromCssColorString(this.visibleAreaColor),helsing_invisibleAreaColor:Cesium.Color.fromCssColorString(this.invisibleAreaColor)}});this.postStage=this.viewer.scene.postProcessStages.add(e)}},{key:"drawFrustumOutline",value:function(){var t=new Cesium.Cartesian3,e=new Cesium.Matrix3,i=new Cesium.Quaternion,n=(this.lightCamera.positionWC,this.lightCamera.directionWC),o=this.lightCamera.upWC,s=this.lightCamera.rightWC;s=Cesium.Cartesian3.negate(s,t);var a=e;Cesium.Matrix3.setColumn(a,0,s,a),Cesium.Matrix3.setColumn(a,1,o,a),Cesium.Matrix3.setColumn(a,2,n,a);var r=Cesium.Quaternion.fromRotationMatrix(a,i),l=new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({frustum:this.lightCamera.frustum,origin:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:r}),id:Math.random().toString(36).substr(2),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOWGREEN),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});this.frustumOutline=this.viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:[l],appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1})}))}},{key:"drawSketch",value:function(){this.sketch=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:64,slicePartitions:64,outlineColor:Cesium.Color.YELLOWGREEN}}),this.frustumOutline=this.viewer.entities.add({name:"sketch",position:Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),orientation:Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(this.options.viewPosition.lng,this.options.viewPosition.lat,this.options.viewPosition.alt+this.viewPointHeight),Cesium.HeadingPitchRoll.fromDegrees(this.viewHeading-90,this.viewPitch,0)),ellipsoid:{radii:new Cesium.Cartesian3(this.viewDistance,this.viewDistance,this.viewDistance),innerRadii:new Cesium.Cartesian3(1e-4,1e-4,1e-4),minimumClock:Cesium.Math.toRadians(-this.horizontalViewAngle/2),maximumClock:Cesium.Math.toRadians(this.horizontalViewAngle/2),minimumCone:Cesium.Math.toRadians(90-this.verticalViewAngle/2),maximumCone:Cesium.Math.toRadians(90+this.verticalViewAngle/2),fill:!1,outline:!0,subdivisions:256,stackPartitions:1,slicePartitions:1,outlineColor:Cesium.Color.YELLOWGREEN}})}}],[{key:"create",value:function(t){t.destroy();var i=0;function n(){t.ids.forEach((function(e){t.viewer.entities.getById(e).show=!1})),YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t.event=new X(t.sdk),t.tip=new Z("左键选择观测点位置,右键取消",t.sdk),YJ.Measure.SetMeasureStatus(!0),t.event.mouse_left((function(o,s){t.viewPosition||(t.options.viewPosition=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),t.tip.set_text("左键选择最远观测点位置,右键取消")),2===++i&&(t.options.viewPositionEnd=t.cartesian3Towgs84(s,t.viewer),t.ids.push(e.create_point(t,s)),n(),t.update())})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(e,i){t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n()})),t.event.gesture_pinck_start((function(e,i){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&(t.ids.forEach((function(e){t.viewer.entities.removeById(e)})),t.ids=[],n())}))})))}},{key:"create_point",value:function(t,e){var i=t.randomString(),n=t.cartesian3Towgs84(e,t.viewer),o={id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return t.viewer.entities.add(new Cesium.Entity(o)),i}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"可视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),i.editevent&&i.editevent.destroy(),i.ControllerObject&&i.ControllerObject.destroy(),i.ids.forEach((function(t){i.viewer.entities.removeById(t)}))}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">位置拾取(起点、终点)</span>\n <button class="edit"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>拾取</button>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="margin-bottom: 25px;">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n <div class="row subtitle-box">\n <span class="subtitle">视域夹角</span>\n </div>\n <div class="row"> \n <div class="col">\n <div class="range-box">\n <div class="range-bg">\n <div class="range-process-box">\n <div class="range-process"></div>\n </div>\n </div>\n <div class="range-node-box">\n <span class="range-node-text">0°</span>\n <span class="range-node-text">45°</span>\n <span class="range-node-text">90°</span>\n <span class="range-node-text">135°</span>\n <span class="range-node-text">180°</span>\n <div class="range-node-active"><span class="range-node-active-text">0°</span></div>\n </div>\n <input type="range" max="180" min="0" step="1" name="horizontalViewAngle">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',i._DialogObject.contentAppChild(n),i._DialogObject._element.body.getElementsByClassName("edit")[0].addEventListener("click",(function(){i.nodeEdit()})),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),i.html=n,s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element,(r=n.querySelector("input[name='horizontalViewAngle']")).value=i.options.horizontalViewAngle,l=n.getElementsByClassName("range-node-active")[0],c=l.getElementsByClassName("range-node-active-text")[0],u=n.getElementsByClassName("range-process")[0],p=i.horizontalViewAngle/180*100,l.style.left=p+"%",u.style.width=p+"%",c.innerHTML=i.horizontalViewAngle+"°",r.addEventListener("input",(function(){var t=r.value/180*100;l.style.left=t+"%",u.style.width=t+"%",c.innerHTML=r.value+"°"})),r.addEventListener("change",(function(){clearTimeout(h),h=setTimeout((function(){i.horizontalViewAngle=r.value}),300)}));case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){if(t.viewPosition){t.viewBillboardPrimitive&&(t.viewer.scene.primitives.remove(t.viewBillboardPrimitive),t.viewBillboardPrimitive=null);var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=180,e.style.background="#000000";var n=new Image,o=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.viewPosition.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.viewPosition.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"高度:"+Number((parseFloat(t.viewPosition.alt.toFixed(2))+Number(t.viewPointHeight)).toFixed(2))+" m"},{images:t.getSourceRootPath()+"/img/bubble/heading.png",text:"偏航角:"+parseFloat(t.viewHeading.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/pitch.png",text:"俯仰角:"+parseFloat(t.viewPitch.toFixed(10))+"°"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var s=0;n.onload=function(){i.drawImage(n,0,0,e.width,e.height),o.forEach((function(n,a){var r=new Image;r.src=n.images,r.onload=function(){i.drawImage(r,12,12+26*a),i.fillStyle="#fff",i.font="12px Arial",i.fillText(n.text,44,28+26*a),++s===o.length&&(t.viewBillboardPrimitive=t.viewer.scene.primitives.add(new Cesium.BillboardCollection),t.viewBillboardPrimitive.add({position:Cesium.Cartesian3.fromDegrees(t.viewPosition.lng,t.viewPosition.lat,t.viewPosition.alt+t.viewPointHeight),image:e,width:200,height:180,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}))}}))}}}}]);var i}(fi);function La(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Aa(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Aa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ja(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Ia(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Ra(t,e){return t.get(Fa(t,e))}function Fa(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var za=new WeakMap,Ha=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Ia(i=ja(this,e,[t,n]),za,new Map),i.viewer=t.viewer,i.options={},i.options.visibleAreaColor=n.visibleAreaColor||"#008000",i.options.invisibleAreaColor=n.invisibleAreaColor||"#FF0000",i.ids=[],i.primitives=[],i.viewpointPrimitive=null,i._elms={},i.precision=n.precision,i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,i.html=null,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"precision",get:function(){return this.options.precision},set:function(t){var e=Math.floor(Number(t));isNaN(e)?e=20:e<1&&(e=1),this.options.precision=e,this._elms.precision&&this._elms.precision.forEach((function(t){t.value=e}))}},{key:"analyse",value:function(){var t=this,i=[this.center.lng,this.center.lat],n=this.radius/1e3,o=turf.circle(i,n,{steps:180,units:"kilometers",properties:{foo:"bar"}});this.viewpointPrimitive||(this.viewpointPrimitive=this.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection)),this.viewBillboardPrimitive||(this.viewBillboardPrimitive=this.viewer.scene.primitives.add(new Cesium.BillboardCollection));for(var s=[],a=n/this.precision,r=1;r<o.geometry.coordinates[0].length;r++){for(var l=turf.lineString([i,o.geometry.coordinates[0][r]]),c=[],u=1;u<=this.precision;u++){var p=turf.lineSliceAlong(l,0,a*u,{units:"kilometers"});c.push([p.geometry.coordinates[1][0],p.geometry.coordinates[1][1]])}s.push(c)}var h=Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.center.alt+this.viewPointHeight);e.getcanvas(this).then((function(e){return t.viewBillboardPrimitive.add({position:h,image:e,width:200,height:140,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY})})),this.viewpointPrimitive.add({position:h,color:Cesium.Color.AQUA.withAlpha(1),pixelSize:6});var d=0,m=this,f=this.randomString(),v=setInterval((function(){if(d>=s.length){var e=Ra(za,t).get(f);e&&clearInterval(e.event)}else!function(t){for(var e=[],n=t,o=0;o<s[n].length;o++){var a=s[n][o],r=void 0,l=void 0,c=s[n][o-1];n==s.length-1?(r=s[0][o],l=s[0][o-1]):(r=s[n+1][o],l=s[n+1][o-1]),0==o&&(l=[].concat(i),c=[]);for(var u=[(a[0]+l[0])/2,(a[1]+l[1])/2],p=Cesium.Cartographic.fromDegrees(u[0],u[1]),d=m.viewer.scene.globe.getHeight(p),f=Cesium.Cartesian3.fromDegrees(u[0],u[1],d),v=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(f,h,new Cesium.Cartesian3),new Cesium.Cartesian3),g=new Cesium.Ray(h,v),y=m.viewer.scene.drillPickFromRay(g,m.primitives),b=void 0,C=0;C<y.length;C++)if(y[C].position){b=y[C];break}var w=Cesium.Color.LIME;b&&Math.abs(b.position.x-f.x)>.01&&Math.abs(b.position.y-f.y)>.01&&Math.abs(b.position.z-f.z)>.01&&(w=Cesium.Color.RED);var k=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray([].concat(L()(a),L()(r),L()(l),L()(c),L()(a))),width:2}),x=new Cesium.GeometryInstance({geometry:k,name:"ViewershedPolygon",attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(w),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});e.push(x)}m.primitives.push(m.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.PolylineColorAppearance})))}(d),d+=1}),0);Ra(za,this).set(f,{event:v})}},{key:"destroy",value:function(){var t,e,i,n,o=La(Ra(za,this));try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);clearInterval(a.event)}}catch(t){o.e(t)}finally{o.f()}e=za,i=this,n=new Map,e.set(Fa(e,i),n);for(var r=0;r<this.primitives.length;r++)this.viewer.scene.primitives.remove(this.primitives[r]);this.primitives=[],this.viewpointPrimitive&&(this.viewer.scene.primitives.remove(this.viewpointPrimitive),this.viewpointPrimitive=null),this.viewBillboardPrimitive&&(this.viewer.scene.primitives.remove(this.viewBillboardPrimitive),this.viewBillboardPrimitive=null),YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){YJ.Measure.GetMeasureStatus()?console.log("上一次测量未结束"):(t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),new YJ.Draw.DrawCircle(t.sdk).start(function(){var e=o()(a.a.mark((function e(i,n){var o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:return t.radius=n.radius,e.next=5,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(n.center.lng,n.center.lat)]);case 5:return o=e.sent,t.center={lng:n.center.lng,lat:n.center.lat,alt:o[0].height},e.next=9,t.analyse();case 9:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()))}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"圆形视域分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" circle-view-shed",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">采样精度</span>\n <input class="input" type="number" title="" min="1" max="100" step="1" @model="precision">\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){i.viewer.terrainProvider.availability?e.create(i):window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500})})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");e.width=220,e.height=140,e.style.background="#000000";var n=new Image,s=[{images:t.getSourceRootPath()+"/img/bubble/lng.png",text:"经度:"+parseFloat(t.center.lng.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/lat.png",text:"纬度:"+parseFloat(t.center.lat.toFixed(10))+"°"},{images:t.getSourceRootPath()+"/img/bubble/h.png",text:"视高:"+t.viewPointHeight+" m"},{images:t.getSourceRootPath()+"/img/bubble/radius.png",text:"半径:"+t.radius+" m"}];n.src=t.getSourceRootPath()+"/img/bubble/bubble.png";var r=0;return new Promise(function(){var t=o()(a.a.mark((function t(o,l){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.onload=function(){i.drawImage(n,0,0,e.width,e.height),s.forEach((function(t,n){var a=new Image;a.src=t.images,a.onload=function(){i.drawImage(a,12,12+26*n),i.fillStyle="#fff",i.font="12px Arial",i.fillText(t.text,44,28+26*n),++r===s.length&&o(e)}}))};case 1:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())}}]);var i}(fi);function Va(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ga(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Va(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Va(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ua(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Wa=function(t){function e(t){var i;return k()(this,e),(i=Ua(this,e,[t])).viewer=t.viewer,i.viewer.terrainProvider.availability?(i.event,i.result=[],i.handler=void 0,i.toolTip="",YJ.Analysis.AnalysesResults.push(i),i.Draw=new _a(i.sdk),i.createNew4Num(50),i):(i.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),tn()(i))}return sn()(e,t),_()(e,[{key:"createNew4Distance",value:function(t){var e=this,i=200*(t=t||.1)>35?35:200*t;this.arrowWidth=i<15?15:i;this.viewer;this.Draw.start((function(i,n){if(!n||n.length<=2)window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500});else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],p=u.lng,h=u.lat;o.push([p,h]),s=p<s?p:s,a=h<a?h:a,r=p>r?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=turf.polygon([o]),f=turf.squareGrid(d,t,{mask:m});e.createEllipse(f)}}))}},{key:"createNew4Num",value:function(t){var e=this,i=t;this.Draw.start((function(t,n){if(!n||n.length<=2)console.warn("至少拥有三个坐标位置!");else{for(var o=[],s=1e4,a=1e4,r=-1e4,l=-1e3,c=0;c<n.length;c++){var u=n[c],p=u.lng,h=u.lat;o.push([p,h]),s=p<s?p:s,a=h<a?h:a,r=p>r?p:r,l=h>l?h:l}o.push(o[0]);var d=[s,a,r,l],m=r-s,f=l-a;f=f>m?f:m;var v=turf.polygon([o]),g=turf.area(v);g>5e12?i-=25:g>1e12?i-=20:g>5e11?i-=15:g>1e11?i-=10:g>6e10&&(i-=5);var y=f/i,b=2e3*y>35?35:2e3*y;e.arrowWidth=b<15?15:b;var C=turf.squareGrid(d,y,{units:"degrees",mask:v});e.createEllipse(C)}}))}},{key:"createEllipse",value:function(t){for(var e=[],i=0;i<t.features.length;i++){var n=t.features[i].geometry.coordinates[0],o=[(n[0][0]+n[2][0])/2,(n[0][1]+n[2][1])/2],s=Cesium.Cartographic.fromDegrees(o[0],o[1]);e.push(s);for(var a=0;a<n.length;a++){var r=n[a],l=Cesium.Cartographic.fromDegrees(r[0],r[1]);e.push(l);var c=n[a+1];if(c){var u=[(r[0]+c[0])/2,(r[1]+c[1])/2],p=Cesium.Cartographic.fromDegrees(u[0],u[1]);e.push(p)}}}var h=this,d=Math.floor(e.length/3)+"";d=10*Number(d.substring(0,d.length-1));var m=0,f=e.slice(m*d,(m+1)*d);f.length>0&&function t(i){Cesium.sampleTerrainMostDetailed(h.viewer.scene.terrainProvider,i).then((function(i){m++;var n=e.slice(m*d,(m+1)*d);n.length>0&&t(n);var o=[],s=i.reduce((function(t,e,i,n){var s=10*i,a=s+10,r=n.slice(s,a);return 0!=r.length&&(o[i]=r),o}),[]);h.calculateSlope(s)}))}(f)}},{key:"createPolygonInsrance",value:function(t,e,i){for(var n=[],o=1;o<t.length-1;o++){var s=t[o];n.push(Cesium.Cartographic.toCartesian(s))}var a=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n)});return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:i},geometry:a,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"createArrowInstance",value:function(t,e,i,n,o){var s=new Cesium.Cartographic((t.longitude+e.longitude)/2,(t.latitude+e.latitude)/2,(t.height+e.height)/2),a=new Cesium.Cartographic((i.longitude+e.longitude)/2,(i.latitude+e.latitude)/2,(i.height+e.height)/2),r=n>0?[Cesium.Cartographic.toCartesian(s),Cesium.Cartographic.toCartesian(a)]:[Cesium.Cartographic.toCartesian(a),Cesium.Cartographic.toCartesian(s)];return new Cesium.GeometryInstance({id:{type:"SlopeAspect",value:o},geometry:new Cesium.GroundPolylineGeometry({positions:r,width:this.arrowWidth}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE.withAlpha(.6)),show:new Cesium.ShowGeometryInstanceAttribute(!0)}})}},{key:"calculateSlope",value:function(t){for(var e=this,i=[],n=[],o=0;o<t.length;o++){for(var s=t[o],a=s[0],r=0,l=0,c=1;c<s.length-1;c++){var u=s[c].height-a.height;Math.abs(u)>r&&(r=u,l=c)}var p=new Cesium.Cartographic(a.longitude,a.latitude,0),h=new Cesium.Cartographic(s[l].longitude,s[l].latitude,0),d=Cesium.Cartesian3.distance(Cesium.Cartographic.toCartesian(p),Cesium.Cartographic.toCartesian(h)),m=Math.abs(r/d),f=this.calculateSlopeColor(m,.4),v=this.createPolygonInsrance(s,f,m);n.push(v);var g=l>4?s[l-4]:s[l+4],y=s[l],b=this.createArrowInstance(y,a,g,r,m);i.push(b)}var C=this.viewer.scene.primitives.add(new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})})),w=this.viewer.scene.primitives.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineArrow",uniforms:{color:new Cesium.Color(1,1,0,.8)}}})})}));this.result.push(w,C),this.event=new X(this.sdk);var k=function(t,i){var n=document.getElementById("SlopeAspect-box");n||((n=document.createElement("div")).id="SlopeAspect-box",n.style.pointerEvents="none",n.style.display="none",n.style.position="absolute",n.style.background="#333333",n.style.color="#fff",n.style.color="#fff",n.style.padding="5px",n.style.fontSize="12px",n.style.borderRadius="5px",n.style.transform="translate(-50%, -10px)",n.innerHTML='\n <div class="value">坡度:</div>\n <span style="\n position: absolute;\n border: 4px solid;\n border-color: #fff0 #fff0 #333333 #333333;\n transform: rotate(-45deg);\n left: calc(50% - 5px);\n "></span>\n ',document.body.appendChild(n));var o=n.getElementsByClassName("value")[0],s=Ga({},t.position),a=e.sdk.viewer.scene.pick(s);if(a&&a.id&&a.id.type&&"SlopeAspect"===a.id.type){var r=0,l=0;if(e.sdk.viewer&&e.sdk.viewer._element){var c=e.sdk.viewer._element.getElementsByClassName("cesium-widget")[0].getElementsByTagName("canvas")[0];r=c.getBoundingClientRect().top+window.scrollY,l=c.getBoundingClientRect().left+window.scrollX}n.style.display="block",n.style.left=s.x+2+l+"px",n.style.top=s.y-20+r+"px",o.innerHTML="坡度:"+Number(Cesium.Math.toDegrees(a.id.value||0).toFixed(2))+"°"}else n.style.display="none"};this.event.mouse_move((function(t,e){var i={position:Ga({},t.endPosition)};k(i)})),this.event.mouse_left(k),this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll},this.sdk.viewer.scene.preRender.addEventListener(this._watchEvent,this)}},{key:"_watchEvent",value:function(){if(this._camera.position.x.toFixed(8)!==this.sdk.viewer.camera.position.x.toFixed(8)||this._camera.position.y.toFixed(8)!==this.sdk.viewer.camera.position.y.toFixed(8)||this._camera.position.z.toFixed(8)!==this.sdk.viewer.camera.position.z.toFixed(8)||this._camera.heading.toFixed(8)!==this.sdk.viewer.camera.heading.toFixed(8)||this._camera.pitch.toFixed(8)!==this.sdk.viewer.camera.pitch.toFixed(8)||this._camera.roll.toFixed(8)!==this.sdk.viewer.camera.roll.toFixed(8)){var t=document.getElementById("SlopeAspect-box");t&&(t.style.display="none")}this._camera={position:this.sdk.viewer.camera.position,heading:this.sdk.viewer.camera.heading,pitch:this.sdk.viewer.camera.pitch,roll:this.sdk.viewer.camera.roll}}},{key:"calculateSlopeColor",value:function(t,e){return t<.00872686779075879?"rgba(85,182,43,"+e+")":t<.03492076949174773?"rgba(135,211,43,"+e+")":t<.08748866352592401?"rgba(204,244,44,"+e+")":t<.2679491924311227?"rgba(245,233,44,"+e+")":t<.7002075382097097?"rgba(255,138,43,"+e+")":t<1.4281480067421144?"rgba(255,84,43,"+e+")":"rgba(255,32,43,"+e+")"}},{key:"destroy",value:function(){var t=this;this.result&&this.result.forEach((function(e){t.viewer.scene.primitives.remove(e)})),this.result=[],this.sdk.viewer.scene.preRender.removeEventListener(this._watchEvent,this)}}])}(fi);function Ya(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ja=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),window.addEventListener("resize",(function(){i.echartsObject&&i.echartsObject.resize()})),(i=Ya(this,e,[t])).viewer=t.viewer,i.Dialog=n,YJ.Analysis.AnalysesResults.push(i),e.create(i),i}return sn()(e,t),_()(e,[{key:"clean",value:function(){this.end(),this._currentId=null,this.entityHasCreated=!1,this.polyline&&this.viewer.entities.remove(this.polyline),this.tipEntity&&this.viewer.entities.remove(this.tipEntity),this.polyline=null,this.tipEntity=null}},{key:"destroy",value:function(){this.clean(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}}],[{key:"create",value:function(t){var i=this;this._currentId=Cesium.createGuid();var n=this._currentId;if(t.clean(),YJ.Measure.GetMeasureStatus())console.warn("上一次测量未结束");else{YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确定,右键取消",t.sdk),t.event=new X(t.sdk),t.positions=[],t.points_ids=[];var s=[];t.event.mouse_left(function(){var r=o()(a.a.mark((function o(r,l){var c;return a.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:try{t.entityHasCreated||e.create_polyline(t),s.push(l),t.points_ids.push(t.create_point(l)),2==s.length&&(t.end(),c=[],s.forEach((function(e){c.push(t.cartesian3Towgs84(e,t.viewer))})),e.interPoints(t).then((function(o){i._currentId&&i._currentId===n&&(t._DialogObject?e.initEcharts(t,o):e.edit(t,o))})))}catch(t){console.log(t)}case 1:case"end":return o.stop()}}),o)})));return function(t,e){return r.apply(this,arguments)}}()),t.event.mouse_right((function(e,i){s=[],t.clean()})),t.event.mouse_move((function(e,i){t.positions=s.concat(i),t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500){s=[],t.end()}}))}))}}},{key:"create_polyline",value:function(t){t.entityHasCreated=!0;var e=t.randomString();return t.polyline=t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),e}},{key:"interPoints",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.viewer,n=e.positions,o=[],s=[],r=0;r<n.length;r++)l=n[r],c=i.scene.globe.ellipsoid.cartesianToCartographic(l),o.push(c),u=e.cartesian3Towgs84(l,i),s.push(u);return p=[],t.next=8,e.getClampToHeight({lng:s[0].lng,lat:s[0].lat});case 8:h=t.sent,p.push({position:{lng:s[0].lng,lat:s[0].lat,height:h},distance:0}),d=0;case 11:if(!(d<o.length-1)){t.next=42;break}m=turf.lineString([[s[d].lng,s[d].lat],[s[d+1].lng,s[d+1].lat]]),f=turf.length(m,{units:"kilometers"}),v=o[d],g=o[d+1],y=1e7*Math.abs(v.longitude-g.longitude),b=1e7*Math.abs(v.latitude-g.latitude),y>b&&(b=y),(C=parseInt(b/2))>150&&(C=150),C<2&&(C=2),w=f/(C-1),k=0;case 24:if(!(k<C-1)){t.next=39;break}return x=k*w,_=(k+1)*w,t.next=29,turf.lineSliceAlong(m,x,_,{units:"kilometers"});case 29:return E=t.sent,S=E.geometry.coordinates[E.geometry.coordinates.length-1][0],D=E.geometry.coordinates[E.geometry.coordinates.length-1][1],t.next=34,e.getClampToHeight({lng:S,lat:D});case 34:P=t.sent,p.push({position:{lng:S,lat:D,height:P},distance:1e3*_});case 36:k++,t.next=24;break;case 39:d++,t.next=11;break;case 42:return t.abrupt("return",p);case 43:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"剖面分析",left:"180px",top:"100px",closeCallBack:function(){i.clean(),i.Dialog.closeCallBack&&i.Dialog.closeCallBack()}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" profile",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="profile-echarts"></div>\n ',i._DialogObject.contentAppChild(o),(s=document.createElement("button")).innerHTML='<svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>重新绘制',s.style.width="auto",s.addEventListener("click",(function(){e.create(i),e.initEcharts(i)})),i._DialogObject.footAppChild(s),e.initEcharts(i,n);case 16:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})},{key:"initEcharts",value:function(t,e){var i,n=[],o=[],s=e;if(s){for(var a=s[s.length-1].distance,r=Math.ceil(a),l=0;l<s.length;l++){var c=s[l];if(void 0!==c.position.height){var u=[c.distance.toFixed(2),c.position.height.toFixed(2)];n.push(u);var p=[c.position.lng,c.position.lat];o.push(p)}}var h={show:!0,pixelSize:10,color:Cesium.Color.GREEN,outlineColor:Cesium.Color.SKYBLUE,outlineWidth:3,disableDepthTestDistance:Number.POSITIVE_INFINITY},d=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(d),i={tooltip:{trigger:"axis",textStyle:{align:"left"},formatter:function(e){var i=o[e[0].dataIndex],n=e[0].data;return t.tipEntity?t.tipEntity.position=Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])):t.tipEntity=t.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(i[0],i[1],Number(n[1])),point:h}),"距离:"+n[0]+"m<br>高度:"+n[1]+"m<br>坐标:"+i[0].toFixed(5)+","+i[1].toFixed(5)}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",max:r,scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:n,smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}else{var m=t._DialogObject._element.content.getElementsByClassName("profile-echarts")[0];t.echartsObject=echarts.init(m),i={tooltip:{trigger:"axis",textStyle:{align:"left"}},grid:{top:40,bottom:20,left:55,right:30},calculable:!0,xAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],yAxis:[{type:"value",scale:!0,axisLabel:{color:"#ffffff"},axisLine:{lineStyle:{color:"#ffffff"}}}],series:[{name:"ProfileLine",type:"line",data:[],smooth:!0,itemStyle:{normal:{color:"#39FDA1"}},lineStyle:{normal:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(85,254,139,1)"},{offset:.5,color:"rgba(7,252,202,1)"},{offset:1,color:"rgba(14,245,210,1)"}],globalCoord:!1}}},areaStyle:{normal:{color:new echarts.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(102,153,255,1)"},{offset:.8,color:"rgba(102,153,255,0.08)"},{offset:1,color:"rgba(9,173,208,0.15)"}],!1),shadowColor:"rgba(14,245,210,1)",shadowBlur:20}},markPoint:{data:[{type:"max",name:"最高点",label:{color:"#ffffff"}},{type:"min",name:"最低点",label:{color:"#ffffff"}}]}}]}}t.echartsObject.setOption(i)}}]);var i,n}(Ca);function qa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Xa=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=qa(this,e,[t,n])).viewer=t.viewer,i.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},i.options={},i._elms={},i.viewPointHeight=n.viewPointHeight,i.Dialog=o,i._EventBinding=new wn,YJ.Analysis.AnalysesResults.push(i),e.edit(i),i}return sn()(e,t),_()(e,[{key:"viewPointHeight",get:function(){return this.options.viewPointHeight},set:function(t){var e=Math.floor(10*Number(t))/10;isNaN(e)&&(e=1.8),e<0&&(e=0),this.options.viewPointHeight=e,this._elms.viewPointHeight&&this._elms.viewPointHeight.forEach((function(t){t.value=e}))}},{key:"destroy",value:function(){var t=this;this.resultObject.entities.forEach((function(e){t.viewer.entities.remove(e)})),this.resultObject={viewPoint:void 0,targetPoints:[],targetPoint:void 0,objectExclude:[],entities:[]},this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null,YJ.Measure.SetMeasureStatus(!1)}}],[{key:"create",value:function(t){if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{t._DialogObject&&t._DialogObject.close&&(t._DialogObject.close(),t._DialogObject=null),t.event=new X(t.sdk),t.tip=new Z("左键点击创建视角起点",t.sdk),YJ.Measure.SetMeasureStatus(!0);t.event.mouse_left(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t.tip.set_text("左键创建视角终点,右键结束通视分析"),t.resultObject.viewPoint){i.next=16;break}if(s=t.cartesian3Towgs84(o,t.viewer),!t.sdk.viewer.terrainProvider.availability){i.next=7;break}return i.next=6,Cesium.sampleTerrainMostDetailed(t.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(s.lng,s.lat)]);case 6:r=i.sent;case 7:r&&r[0].height>s.alt&&(s.alt=r[0].height),s.alt=s.alt+t.viewPointHeight,l=Cesium.Cartesian3.fromDegrees(s.lng,s.lat,s.alt),t.resultObject.viewPoint=l,c=t.viewer.entities.add({position:l,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(c),t.resultObject.entities.push(c),i.next=33;break;case 16:t.resultObject.targetPoint=o,u=t.viewer.entities.add({position:o,point:{color:Cesium.Color.YELLOW,pixelSize:5}}),t.resultObject.objectExclude.push(u),t.resultObject.entities.push(u),p=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t.resultObject.targetPoint,t.resultObject.viewPoint,new Cesium.Cartesian3),new Cesium.Cartesian3),h=new Cesium.Ray(t.resultObject.viewPoint,p),d=t.viewer.scene.drillPickFromRay(h),m={},f=0;case 25:if(!(f<d.length)){i.next=32;break}if(!d[f].position){i.next=29;break}return m=d[f],i.abrupt("break",32);case 29:f++,i.next=25;break;case 32:m&&(v=e.distance(t.resultObject.viewPoint,t.resultObject.targetPoint),g=e.distance(t.resultObject.viewPoint,m.position||o),y=e.distance(m.position||o,t.resultObject.targetPoint),v>g?(b=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,m.position],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(b),C=t.viewer.entities.add({polyline:{positions:[m.position,t.resultObject.targetPoint],material:Cesium.Color.RED,width:3,zIndex:99999999}}),t.resultObject.entities.push(C),t.resultObject.targetPoints.push({targetPoint:o,visual:!1,distance:[v,g,y]})):(w=t.viewer.entities.add({polyline:{positions:[t.resultObject.viewPoint,t.resultObject.targetPoint],material:Cesium.Color.GREEN,width:3,zIndex:99999999}}),t.resultObject.entities.push(w),t.resultObject.targetPoints.push({targetPoint:o,visual:!0,distance:[v,g,y]})));case 33:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}()),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right((function(t,e){i()})),t.event.gesture_pinck_start((function(e,n){var o=new Date;t.event.gesture_pinck_end((function(){new Date-o>=500&&i()}))}))}function i(){YJ.Measure.SetMeasureStatus(!1),t.tip.destroy(),t.event.destroy(),t.tip=null,t.event=null}}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null),t.next=3,new W(i.sdk.viewer._container,{title:"多点视线分析",left:"180px",top:"100px",closeCallBack:function(){i.Dialog.closeCallBack&&i.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1)}});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:i._DialogObject._element.body.className=i._DialogObject._element.body.className+" visibility",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">视点高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="viewPointHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(n),(o=document.createElement("button")).innerHTML="绘制",o.addEventListener("click",(function(){e.create(i)})),i._DialogObject.footAppChild(o),s=n.getElementsByTagName("*"),i._EventBinding.on(i,s),i._elms=i._EventBinding.element;case 17:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"distance",value:function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Cartographic.fromCartesian(e),o=new Cesium.EllipsoidGeodesic;o.setEndPoints(i,n);var s=o.surfaceDistance;return s=Math.sqrt(Math.pow(s,2)+Math.pow(n.height-i.height,2))}}]);var i}(fi),Za=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.viewer=e.viewer;var n=this.viewer.terrainProvider.availability;if(!n)return this.error="未加载地形数据!",window.ELEMENT&&window.ELEMENT.Message({message:"未加载地形数据!",type:"warning",duration:1500}),void console.warn(this.error);this.positions=i.positions,this.interfaceNum=i.interfaceNum||25,this.colorFill=i.colorFill||["#8CEA00","#B7FF4A","#FFFF37","#FFE66F","#FFD1A4","#FFCBB3","#FFBD9D","#FFAD86","#FF9D6F","#FF8F59","#FF8040","#FF5809","#F75000","#D94600","#BB3D00","#A23400","#842B00","#642100","#4D0000","#2F0000"],this.countorLineList=Cesium.defaultValue(i.countorLineList,[]),YJ.Analysis.AnalysesResults.push(this),this.createNewLine()}return _()(t,[{key:"type",get:function(){return"ContourAnalysis"}},{key:"createNewLine",value:function(){t.interpolatePoint(this)}},{key:"getObjectIndex",value:function(t,e){for(var i=0;i<t.length;i++)if(t[i]>e)return i}},{key:"clear",value:function(t){if(t){this.viewer.dataSources.remove(t);var e=this.countorLineList.indexOf(t);this.countorLineList.splice(e,1)}}},{key:"destroy",value:function(){var t=this;this.countorLineList.forEach((function(e){t.viewer.dataSources.remove(e)})),this.countorLineList=[]}}],[{key:"interpolatePoint",value:function(t){for(var e=t.positions,i=[],n={minX:360,maxX:-360,minY:180,maxY:-180},o=0;o<e.length;o++){var s=Cesium.Cartesian3.fromDegrees(e[o].lng,e[o].lat,e[o].alt),a=t.viewer.scene.globe.ellipsoid.cartesianToCartographic(s),r=Cesium.Math.toDegrees(a.latitude),l=Cesium.Math.toDegrees(a.longitude);n.maxY=Math.max(r,n.maxY),n.minY=Math.min(r,n.minY),n.maxX=Math.max(l,n.maxX),n.minX=Math.min(l,n.minX);var c={type:"Feature",properties:{},geometry:{type:"Point",coordinates:[l,r]}};i.push(c)}var u={type:"FeatureCollection",features:i};turf.featureEach(u,(function(t){t.properties.height=0}));var p=turf.point([n.minX,n.minY]),h=turf.point([n.maxX,n.maxY]),d=turf.rhumbDistance(p,h,{units:"kilometers"}),m=turf.interpolate(u,d/t.interfaceNum,{gridType:"points",property:"height",units:"kilometers"}),f=1e7,v=-1e8;turf.featureEach(m,(function(e){var i=e.geometry.coordinates,n=Cesium.Cartographic.fromDegrees(i[0],i[1]),o=t.viewer.scene.globe.getHeight(n);v=Math.max(o,v),f=Math.min(o,f),e.properties.height=o}));for(var g=[],y=t.colorFill.length-1,b=(v-f)/y,C=0;C<y+1;C++)g.push(Math.ceil(f+b*C));var w=turf.isolines(m,g,{zProperty:"height"});function k(e){for(var i=new fi,n=e.positions,o=n._value.length,s=[],a=0;a<o;a++){var r=i.cartesian3Towgs84(n._value[a],t.viewer);s.push([r.lng,r.lat])}var l=turf.lineString(s),c=turf.length(l,{units:"kilometers"}),u=turf.along(l,c/2,{units:"kilometers"});return Cesium.Cartesian3.fromDegrees(u.geometry.coordinates[0],u.geometry.coordinates[1],0)}Cesium.GeoJsonDataSource.load(w,{clampToGround:!0}).then((function(e){console.log(e),t.countorLine=e,t.countorLineList.push(e),t.viewer.dataSources.add(e);for(var i=e.entities.values,n=0;n<i.length;n++){var o=i[n],s=k(o.polyline);o.position=s;var a=t.getObjectIndex(g,o.properties.height._value);a&&(o.polyline.material=Cesium.Color.fromCssColorString(t.colorFill[a-1]))}}))}}])}();function Ka(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function $a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ka(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ka(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Qa(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var tr=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Qa(this,e,[t,o])).viewer=t.viewer,n.tiles3d=i,n.options=$a({},o),n.options.regionsType=n.options.regionsType||!1,YJ.Analysis.SectionResults.push(n),n.Planes=[],e.start(n),n}return sn()(e,t),_()(e,[{key:"regionsType",get:function(){return this.options.regionsType},set:function(t){this.options.regionsType=t,this.Planes.length>0&&(this.Planes=[],e.planeCollection(this))}},{key:"destroy",value:function(){this.Planes=[],this.tiles3d.clippingPlanes&&(this.tiles3d.clippingPlanes.enabled=!1,this.tiles3d.clippingPlanes.removeAll())}}],[{key:"start",value:function(t){var i=t.options.positions||[];if(!t.isConvex(i))return window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形");t.inverseTransform=function(t){var e,i=t.root.transform;e=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center):Cesium.Matrix4.fromArray(t.root.transform);return Cesium.Matrix4.inverseTransformation(e,new Cesium.Matrix4)}(t.tiles3d),t.Planes=[];var n=[];if(i.length>0){for(var o=0;o<i.length;o++)n.push([i[o].lng,i[o].lat]);n.push([i[0].lng,i[0].lat]),t.isClockwise=turf.booleanClockwise(turf.lineString(n))}e.planeCollection(t)}},{key:"planeCollection",value:function(t){var e=t.options.positions||[];if(t.regionsType==t.isClockwise)for(var i=0;i<e.length;i++)i===e.length-1?t.Planes.push(a(e[i],e[0],t.inverseTransform)):t.Planes.push(a(e[i],e[i+1],t.inverseTransform));else for(var n=e.length-1;n>=0;n--)0===n?t.Planes.push(a(e[n],e[e.length-1],t.inverseTransform)):t.Planes.push(a(e[n],e[n-1],t.inverseTransform));if(t.tiles3d.clippingPlanes){t.tiles3d.clippingPlanes.removeAll();for(var o=0;o<t.Planes.length;o++)t.tiles3d.clippingPlanes.add(t.Planes[o]);t.tiles3d.clippingPlanes.enabled=!0}else{var s=new Cesium.ClippingPlaneCollection({planes:t.Planes,enabled:!0,unionClippingRegions:t.regionsType,edgeColor:Cesium.Color.WHITE,edgeWidth:1});t.tiles3d.clippingPlanes=s}function a(t,e,i){var n=r(t,i),o=r(e,i),s=new Cesium.Cartesian3(0,0,10),a=Cesium.Cartesian3.subtract(o,n,new Cesium.Cartesian3),l=Cesium.Cartesian3.cross(a,s,new Cesium.Cartesian3);l=Cesium.Cartesian3.normalize(l,l);var c=Cesium.Plane.fromPointNormal(n,l);return Cesium.ClippingPlane.fromPlane(c)}function r(t,e){var i=Cesium.Cartesian3.fromDegrees(t.lng,t.lat);return Cesium.Matrix4.multiplyByPoint(e,i,new Cesium.Cartesian3(0,0,0))}}}])}(fi);function er(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ir=[],nr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=er(this,e,[t])).viewer=t.viewer,i.options=n||{},i.options.height=i.options.height||0===i.options.height?i.options.height:10,i.options.show=!i.options.show&&!1!==i.options.show||i.options.show,i.bottomImg=i.getSourceRootPath()+"/img/excavationregion_top.jpg",i.wallImg=i.getSourceRootPath()+"/img/excavationregion_side.jpg",i.splitNum=Cesium.defaultValue(n.splitNum,50),i.Draw=new _a(i.sdk),i.bottomMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#735d4f"))}),i.wallMaterial=Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.fromCssColorString("#976b4e"))});var o=new Image,s=new Image;return o.src=i.bottomImg,s.src=i.wallImg,o.crossOrigin="Anonymous",s.crossOrigin="Anonymous",o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var e=t.toDataURL("image/jpg");i.bottomMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.bottomSurface&&(i.bottomSurface.appearance.material=i.bottomMaterial)},s.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height,t.getContext("2d").drawImage(s,0,0,s.width,s.height);var e=t.toDataURL("image/jpg");i.wallMaterial=new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}}),i.wellWall&&(i.wellWall.appearance.material=i.wallMaterial)},i.init(),i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.switchExcavate(t)}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t}},{key:"init",value:function(){e.edit(this,!0)}},{key:"startCreate",value:function(){var t=this;this.Draw.start((function(e,i){if(i&&!(i.length<=2))return t.isConvex(i)?void t.updateData(i):(window.ELEMENT&&window.ELEMENT.Message({message:"不支持凹多边形",type:"warning",duration:1500}),void console.log("不支持凹多边形"));window.ELEMENT&&window.ELEMENT.Message({message:"至少拥有三个坐标位置!",type:"warning",duration:1500})}))}},{key:"updateData",value:function(t){var e=this.viewer;this.clear();for(var i=[],n=[],o=0;o<t.length;o++)n.push([t[o].lng,t[o].lat]);n.push([t[0].lng,t[0].lat]);var s=turf.lineString(n),a=turf.booleanClockwise(s);this.excavateMinHeight=9999;for(var r=0;r<t.length;++r){var l=(r+1)%t.length,c=Cesium.Cartesian3.fromDegrees(t[r].lng,t[r].lat,t[r].alt),u=Cesium.Cartesian3.fromDegrees(t[l].lng,t[l].lat,t[l].alt),p=Cesium.Cartesian3.midpoint(c,u,new Cesium.Cartesian3),h=Cesium.Cartographic.fromCartesian(c),d=e.scene.globe.getHeight(h)||h.height;d<this.excavateMinHeight&&(this.excavateMinHeight=d);var m=Cesium.Cartesian3.normalize(p,new Cesium.Cartesian3),f=a?Cesium.Cartesian3.subtract(c,p,new Cesium.Cartesian3):Cesium.Cartesian3.subtract(u,p,new Cesium.Cartesian3);f=Cesium.Cartesian3.normalize(f,f);var v=Cesium.Cartesian3.cross(f,m,new Cesium.Cartesian3);v=Cesium.Cartesian3.normalize(v,v);var g=new Cesium.Plane(v,0),y=Cesium.Plane.getPointDistance(g,p);i.push(new Cesium.ClippingPlane(v,y))}this.viewer.scene.globe.clippingPlanes=new Cesium.ClippingPlaneCollection({planes:i,edgeWidth:1,edgeColor:Cesium.Color.WHITE,enabled:!0}),this.prepareWell(t),this.createWell(this.wellData)}},{key:"clear",value:function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.viewer.scene.render());for(var t=ir.length-1;t>=0;t--)this.viewer.scene.primitives.remove(ir[t]);ir=[],this.Draw&&this.Draw.end()}},{key:"destroy",value:function(){this.clear()}},{key:"prepareWell",value:function(t){for(var e=t.length,i=this.excavateMinHeight-this.height,n=[],o=[],s=[],a=0;a<e;a++){var r=a==e-1?0:a+1,l=[Cesium.Cartographic.fromDegrees(t[a].lng,t[a].lat,t[a].alt).longitude,Cesium.Cartographic.fromDegrees(t[a].lng,t[a].lat,t[a].alt).latitude],c=[Cesium.Cartographic.fromDegrees(t[r].lng,t[r].lat,t[r].alt).longitude,Cesium.Cartographic.fromDegrees(t[r].lng,t[r].lat,t[r].alt).latitude];0==a&&(s.push(new Cesium.Cartographic(l[0],l[1])),o.push(Cesium.Cartesian3.fromRadians(l[0],l[1],i)),n.push(Cesium.Cartesian3.fromRadians(l[0],l[1],0)));for(var u=1;u<=this.splitNum;u++){var p=Cesium.Math.lerp(l[0],c[0],u/this.splitNum),h=Cesium.Math.lerp(l[1],c[1],u/this.splitNum);a==e-1&&u==this.splitNum||(s.push(new Cesium.Cartographic(p,h)),o.push(Cesium.Cartesian3.fromRadians(p,h,i)),n.push(Cesium.Cartesian3.fromRadians(p,h,0)))}}this.wellData={lerp_pos:s,bottom_pos:o,no_height_top:n}}},{key:"createWell",value:function(t){var e=this;this.viewer.terrainProvider._layers?(this.createBottomSurface(t.bottom_pos),Cesium.sampleTerrainMostDetailed(this.viewer.terrainProvider,t.lerp_pos).then((function(i){for(var n=[],o=0;o<i.length;o++){var s=i[o],a=Cesium.Cartesian3.fromRadians(s.longitude,s.latitude,s.height);n.push(a)}e.createWellWall(t.bottom_pos,n)}))):(this.createBottomSurface(t.bottom_pos),this.createWellWall(t.bottom_pos,t.no_height_top))}},{key:"ellipsoidToDegree",value:function(t){var e=new Cesium.Cartesian3(t.x,t.y,t.z),i=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e);return{longitude:Cesium.Math.toDegrees(i.longitude),latitude:Cesium.Math.toDegrees(i.latitude),altitude:i.height}}},{key:"createBottomSurface",value:function(t){if(t.length){for(var e=this.getMinHeight(t),i=[],n=0;n<t.length;n++){var o=this.ellipsoidToDegree(t[n]);i.push(o.longitude,o.latitude,e)}var s=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(i)),perPositionHeight:!0}),a=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.bottomMaterial});this.bottomSurface=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:Cesium.PolygonGeometry.createGeometry(s)}),appearance:a,asynchronous:!1}),ir.push(this.bottomSurface),this.viewer.scene.primitives.add(this.bottomSurface)}}},{key:"createWellWall",value:function(t,e){for(var i=this.getMinHeight(t),n=[],o=[],s=0;s<e.length;s++)n.push(this.ellipsoidToDegree(e[s]).altitude),o.push(i);var a=new Cesium.WallGeometry({positions:e,maximumHeights:n,minimumHeights:o}),r=Cesium.WallGeometry.createGeometry(a),l=new Cesium.MaterialAppearance({translucent:!1,flat:!0,material:this.wallMaterial});this.wellWall=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREY)},id:"PitWall"}),appearance:l,asynchronous:!1}),ir.push(this.wellWall),this.viewer.scene.primitives.add(this.wellWall)}},{key:"getMinHeight",value:function(t){for(var e=5e6,i=null,n=0;n<t.length;n++){var o=t[n].z;o<e&&(e=o,i=this.ellipsoidToDegree(t[n]))}return i.altitude}},{key:"switchExcavate",value:function(t){t?(this.viewer.scene.globe.material=null,this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)}},{key:"updateExcavateDepth",value:function(t){if(this.viewer.scene.primitives.remove(this.bottomSurface),this.viewer.scene.primitives.remove(this.wellWall),this.wellData){for(var e=this.wellData.lerp_pos,i=[],n=0;n<e.length;n++)i.push(Cesium.Cartesian3.fromRadians(e[n].longitude,e[n].latitude,this.excavateMinHeight-t));this.wellData.bottom_pos=i,this.createWell(this.wellData)}}}],[{key:"edit",value:(i=o()(a.a.mark((function t(e,i){var n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null),!i){t.next=21;break}return t.next=4,new W(e.sdk.viewer._container,{title:"地形开挖",closeCallBack:function(){}});case 4:return e._DialogObject=t.sent,t.next=7,e._DialogObject.init();case 7:e._DialogObject._element.body.className=e._DialogObject._element.body.className+" terrain-excavation",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">挖掘高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="5000000" name="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">绘制开挖区域</span>\n <button class="start-excavation"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>绘制</button>\n </div>\n <div class="col">\n <span class="label">清除开挖区域</span>\n <button class="clean-excavation"><svg class="icon-close"><use xlink:href="#yj-icon-close"></use></svg>清除</button>\n </div>\n </div>\n </div>\n ',e._DialogObject.contentAppChild(n),n.getElementsByClassName("start-excavation")[0].addEventListener("click",(function(){e.startCreate()})),n.getElementsByClassName("clean-excavation")[0].addEventListener("click",(function(){e.clear()})),(o=n.querySelector("input[name='height']")).value=e.height,o.addEventListener("change",(function(t){var i=t.target.value;(i=Number(i))<.01&&(i=.01,t.target.value=i,e.height=i)})),o.addEventListener("blur",(function(t){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),i<.01&&(i=.01),t.target.value=i,e.height=i})),t.next=22;break;case 21:e._DialogObject&&e._DialogObject.close&&(e._DialogObject.close(),e._DialogObject=null);case 22:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(fi);function or(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function sr(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?or(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):or(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ar(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var rr={},lr=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(k()(this,e),n=ar(this,e,[t]),C()(n,"getUniqueArray",(function(t){return t.filter((function(t,e,i){return i.indexOf(t,0)===e}))})),!i||!n.sdk||!n.sdk.viewer)return tn()(n);if(n.options=sr({},o),n.options.id=o.id||n.randomString(),n.options.name=o.name||"压平面",n.options.positions=o.positions||[],n.options.show=!o.show&&!1!==o.show||o.show,n.tileset=i,n.Dialog=s,!n.options.height&&0!==n.options.height){for(var a=n.options.positions[0].alt,r=0;r<n.options.positions.length;r++)a>n.options.positions[r].alt&&(a=n.options.positions[r].alt);n.options.height=a}return rr[n.tileset.id]?rr[n.tileset.id].push(sr({},n.options)):rr[n.tileset.id]=[sr({},n.options)],n.center=i.boundingSphere.center.clone(),n.center84=n.cartesian3Towgs84(n.center,n.sdk.viewer),n.matrix=Cesium.Transforms.eastNorthUpToFixedFrame(n.center.clone()),n.localMatrix=Cesium.Matrix4.inverse(n.matrix,new Cesium.Matrix4),n.addFlat(),n}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e<rr[this.tileset.id].length;e++)rr[this.tileset.id][e].id==this.options.id&&(rr[this.tileset.id][e].show=t);this.addFlat()}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=Number(t);for(var e=0;e<rr[this.tileset.id].length;e++)rr[this.tileset.id][e].id==this.options.id&&(rr[this.tileset.id][e].height=Number(t));this.addFlat()}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t;for(var e=0;e<rr[this.tileset.id].length;e++)rr[this.tileset.id][e].id==this.options.id&&(rr[this.tileset.id][e].name=t)}},{key:"addFlat",value:function(){for(var t=this,e=[],i=0;i<rr[this.tileset.id].length;i++){var n=rr[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);rr[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));e.push(l)}}for(var c=this.getIsinPolygonFun(e),u="",p=function(){var i=e[h],n=i.length,o="";i.forEach((function(t,e){o+="points_".concat(n,"[").concat(e,"] = vec2(").concat(t[0],", ").concat(t[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(rr[t.tileset.id][h].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},h=0;h<e.length;h++)p();this.updateShader(c,u)}},{key:"remove",value:function(){var t=this;rr[this.tileset.id]=rr[this.tileset.id].filter((function(e){return e.id!=t.options.id}));for(var e=[],i=0;i<rr[this.tileset.id].length;i++){var n=rr[this.tileset.id][i];if(n.show){for(var o=n.positions,s=n.height,a=[],r=0;r<o.length;r++)a.push(o[r].lng,o[r].lat);rr[this.tileset.id][i].flatHeight=s-this.center84.alt;var l=this.cartesiansToLocal(Cesium.Cartesian3.fromDegreesArray(a));e.push(l)}}for(var c=this.getIsinPolygonFun(e),u="",p=function(){var i=e[h],n=i.length,o="";i.forEach((function(t,e){o+="points_".concat(n,"[").concat(e,"] = vec2(").concat(t[0],", ").concat(t[1],");\n")})),u+="\n ".concat(o,"\n if(isPointInPolygon_").concat(n,"(position2D)){\n vec4 tileset_local_position_transformed = vec4(tileset_local_position.x, tileset_local_position.y, ground_z + ").concat(rr[t.tileset.id][h].flatHeight,", 1.0);\n vec4 model_local_position_transformed = czm_inverseModel * u_tileset_localToWorldMatrix * tileset_local_position_transformed;\n vsOutput.positionMC.xy = model_local_position_transformed.xy;\n vsOutput.positionMC.z = model_local_position_transformed.z+ modelMC.z*0.002;\n return;\n }")},h=0;h<e.length;h++)p();this.updateShader(c,u)}},{key:"getIsinPolygonFun",value:function(t){var e=t.map((function(t){return t.length})),i=this.getUniqueArray(e),n="";return i.forEach((function(t){n+="\n vec2 points_".concat(t,"[").concat(t,"];\n bool isPointInPolygon_").concat(t,"(vec2 point){\n int nCross = 0; // 交点数\n const int n = ").concat(t,"; \n for(int i = 0; i < n; i++){\n vec2 p1 = points_").concat(t,"[i];\n vec2 p2 = points_").concat(t,"[int(mod(float(i+1),float(n)))];\n if(p1[1] == p2[1]){\n continue;\n }\n if(point[1] < min(p1[1], p2[1])){\n continue;\n }\n if(point[1] >= max(p1[1], p2[1])){\n continue;\n }\n float x = p1[0] + ((point[1] - p1[1]) * (p2[0] - p1[0])) / (p2[1] - p1[1]);\n if(x > point[0]){\n nCross++;\n }\n }\n return int(mod(float(nCross), float(2))) == 1;\n }\n ")})),n}},{key:"updateShader",value:function(t,e){var i=new Cesium.CustomShader({uniforms:{u_tileset_localToWorldMatrix:{type:Cesium.UniformType.MAT4,value:this.matrix},u_tileset_worldToLocalMatrix:{type:Cesium.UniformType.MAT4,value:this.localMatrix},u_flatHeight:{type:Cesium.UniformType.FLOAT,value:this.flatHeight}},vertexShaderText:"\n // 所有isPointInPolygon函数\n ".concat(t,"\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput){\n vec3 modelMC = vsInput.attributes.positionMC;\n vec4 model_local_position = vec4(modelMC.x, modelMC.y, modelMC.z, 1.0);\n vec4 tileset_local_position = u_tileset_worldToLocalMatrix * czm_model * model_local_position;\n vec2 position2D = vec2(tileset_local_position.x,tileset_local_position.y);\n float ground_z = 0.0;\n // 多个多边形区域\n ").concat(e,"\n }")});this.tileset.customShader=i,this.sdk.viewer.scene.requestRender()}},{key:"cartesiansToLocal",value:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],o=Cesium.Matrix4.multiplyByPoint(this.localMatrix,n.clone(),new Cesium.Cartesian3);e.push([o.x,o.y])}return e}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=sr({},this.options.position):this.options.positions?r=sr({},this.options.positions[0]):this.options.line&&this.options.line.positions?r=sr({},this.options.line.positions[0]):this.options.center?r=sr({},this.options.center):this.options.start?r=sr({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 22:for(l=[],c=0;c<this.options.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.options.positions[c].lng,this.options.positions[c].lat,this.center84.alt),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.sdk.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=23;break}return this.originalOptions=this.deepCopyObj(this.options),t.next=4,new W(this.sdk.viewer._container,{title:"压平面属性",left:"180px",top:"100px",removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.Dialog.closeCallBack&&r.Dialog.closeCallBack()}});case 4:return this._DialogObject=t.sent,t.next=7,this._DialogObject.init();case 7:(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="width: 56px;flex: 0 0 56px;">名称</span>\n <input class="input input-name">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="width: 56px;flex: 0 0 56px;">压平高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input flat-height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(i),(n=i.getElementsByClassName("input-name")[0]).value=this.options.name,n.addEventListener("input",(function(){r.name=n.value})),(o=i.getElementsByClassName("flat-height")[0]).value=this.options.height,o.addEventListener("input",(function(){r.height=Number(o.value),r.addFlat()})),(s=document.createElement("button")).className="btn",s.innerHTML="确认",this._DialogObject.footAppChild(s),s.addEventListener("click",(function(){r.options.name||(r.options.name="压平面"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.options)})),t.next=24;break;case 23:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 24:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"reset",value:function(){this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.height=this.options.height,this.addFlat()}},{key:"flatEdit",value:function(t){if(t){for(var e=that.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,rr[this.tileset.id]);that.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}}},{key:"flicker",value:function(){}}]);var i,n}(Wn);function cr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ur(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?cr(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):cr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function pr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var hr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{text:"左键开始,右键结束;"};return k()(this,e),(i=pr(this,e,[t,n])).options=ur({},n),i.event=new X(t),i.tip=new Z(n.text,t),i.viewer=t.viewer,i.defaultColor="rgba(246,49,49,0.55)",i.ids=[],YJ.Measure.Measures.push(i),i._isDestroy=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(){this.setPickStatus(!1),YJ.Measure.SetMeasureStatus(!0)}},{key:"destroy",value:function(){var t=this;this._isDestroy=!0,this.end(),this.ids.forEach((function(e){t.remove_entity(e)}))}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=null,this.event=null}},{key:"create_point",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.randomString(),n=this.cartesian3Towgs84(t,this.viewer);return this.viewer.entities.add(new Cesium.Entity({id:i,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),billboard:{show:e,image:this.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})),i}},{key:"remove_entity",value:function(t){this.viewer.entities.removeById(t)}}])}(fi);function dr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return mr(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function fr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function vr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var gr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=fr(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(r=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=dr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return r.apply(this,arguments)})},{key:"computeDisByTowPoint",value:(s=o()(a.a.mark((function t(i,n){var s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=this.computeDistance2([i,n]),r=10,l=function(t){if(!u._isDestroy){var i=u.getLabel("贴地距离:"+Number(t).toFixed(2)+"米");i.pixelOffset=new Cesium.Cartesian2(0,-32),u.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.alt),{label:i},u))}},c=function(){var t=o()(a.a.mark((function t(e){var o,s,r,c,p,h,d,m,f,v;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=u.chunkLine([i,n],e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=[],c=dr(s),t.prev=5,c.s();case 7:if((p=c.n()).done){t.next=16;break}return h=p.value,d=s.indexOf(h),t.next=12,u.sampleHeight({lng:h[0],lat:h[1],alt:0},d);case 12:m=t.sent,r.push(m);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(5),c.e(t.t0);case 21:return t.prev=21,c.f(),t.finish(21);case 24:f=0,v=r.length-1,r.forEach((function(t,e){if(e!==v){var i=u.computeDistance2([t.position,r[e+1].position]),n=Math.abs(t.position.alt-r[e+1].position.alt),o=Math.sqrt(i*i+n*n);f+=o}})),l(f);case 28:case"end":return t.stop()}}),t,null,[[5,18,21,24]])})));return function(e){return t.apply(this,arguments)}}(),!(s>2)){t.next=10;break}return r=s/20,t.next=8,c(r);case 8:t.next=17;break;case 10:if(!(s<1)){t.next=14;break}l(s),t.next=17;break;case 14:return r=1,t.next=17,c(r);case 17:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClampToHeight(e,L()(this.sdk.viewer.entities.values));case 2:return n=t.sent,e.alt=n,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){vr(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(o,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.tip.setPosition(o,n.position.x,n.position.y),t.positions=t.cachePositions.concat(o),0===t.ids.length){i.next=11;break}return s=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),t.cachePositions.push(o),i.next=9,t.computeDisByTowPoint(r,s);case 9:i.next=15;break;case 11:t.cachePositions.push(o),t.ids.push(e.create_point(o,{},t)),(l=t.viewer.entities.getById(t.ids[0]))&&(l.billboard.show=!1);case 15:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}(),n=function(i,n){if(t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(i)})),this.event.mouse_right(n),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),vr(e,"destroy",this,3)([])}},{key:"end",value:function(){vr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s,r}(hr);function yr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return br(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Cr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function wr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var kr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cr(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=yr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){wr(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c,u;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(o,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.positions=t.cachePositions.concat(o),t.tip.setPosition(o,n.position.x,n.position.y),0!==t.ids.length?(s=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),l=t.computeDistance2([s,r]),c="投影距离:"+l+" 米",t.ids.push(e.create_point(o,{label:t.getLabel(c)},t)),t.cachePositions.push(o)):(t.cachePositions.push(o),t.ids.push(e.create_point(o,{show:!1},t)),(u=t.viewer.entities.getById(t.ids[0]))&&(u.billboard.show=!1));case 4:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}(),n=function(i,n){if(t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(i),t.cachePositions.length){var n=t.cartesian3Towgs84(i,t.viewer),o=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),s="当前投影距离:"+t.computeDistance2([n,o])+" 米";t.tip.set_text(s)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(e,i){t.cachePositions.length&&(t.cachePositions.pop(),t.remove_entity(t.ids.pop()))})),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n():i(a,o)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),wr(e,"destroy",this,3)([])}},{key:"end",value:function(){wr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20})},zIndex:99999999})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(hr);function xr(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return _r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Er(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Sr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Dr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Er(this,e,[t,n])).options.color=i.options.color||"#00ffff",i.start_id="",i.end_id="",i.polyline_id="",i.clampPositions=[],i.event=new X(t),i}return sn()(e,t),_()(e,[{key:"clampToGroundMeasure",value:(s=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],this.ids.forEach((function(t,e){var i=d.viewer.entities.getById(t).position.getValue();n.push(d.cartesian3Towgs84(i,d.viewer))})),o=this.chunkLine(n,e),s=[],o.forEach((function(t,e){0===e?s=L()(t.geometry.coordinates):s.push(t.geometry.coordinates[1])})),r=s.length,l=xr(s),t.prev=7,l.s();case 9:if((c=l.n()).done){t.next=18;break}return u=c.value,p=s.indexOf(u),t.next=14,this.getHeight({lng:u[0],lat:u[1],alt:0},p,r);case 14:h=t.sent,i(null,h);case 16:t.next=9;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(7),l.e(t.t0);case 23:return t.prev=23,l.f(),t.finish(23);case 26:case"end":return t.stop()}}),t,this,[[7,20,23,26]])}))),function(t,e){return s.apply(this,arguments)})},{key:"sampleHeight",value:(n=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:return n=t.sent,e.alt=n[0].height,t.abrupt("return",{position:e,index:i});case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"getHeight",value:(i=o()(a.a.mark((function t(e,i,n){var o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.sampleHeightMostDetailed([e]);case 2:if(o=t.sent,e.alt=o[0].height,this.clampPositions.push({position:e,index:i}),n!==this.clampPositions.length){t.next=8;break}return s=this.startCompute(),t.abrupt("return",{total:n,current:this.clampPositions.length,total_length:s});case 8:return t.abrupt("return",{total:n,current:this.clampPositions.length});case 9:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return i.apply(this,arguments)})},{key:"startCompute",value:function(){var t=this;this.clampPositions.sort((function(t,e){return t.index<e.index}));var e=0,i=this.clampPositions.length-1;return this.clampPositions.forEach((function(n,o){if(o!==i){var s=t.computeDistance2([n.position,t.clampPositions[o+1].position]),a=Math.abs(n.position.alt-t.clampPositions[o+1].position.alt),r=Math.sqrt(s*s+a*a);e+=r}})),Number(e.toFixed(2))}},{key:"getLabel",value:function(t){return{text:t||"",font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Sr(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=function(i,n){if(0===t.ids.length&&(t.polyline_id=e.createPolyline(t),t.start_id=e.create_point(n,{image:"start1.png",width:30,height:38,label:t.getLabel("")},t)),t.tip.setPosition(n,i.position.x,i.position.y),t.positions=t.cachePositions.concat(n),0!==t.ids.length){var o=t.cartesian3Towgs84(n,t.viewer),s=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer);o.lng===s.lng&&o.lat===s.lat&&o.alt===s.alt||(t.cachePositions.push(n),t.computeAngle(s,o))}else{t.cachePositions.push(n),t.ids.push(e.create_point(n,{},t));var a=t.viewer.entities.getById(t.ids[0]);a&&(a.billboard.show=!1)}},n=function(i,n){if(0!==t.ids.length||t.ids.push(e.create_point(n,{},t)),t.cachePositions.length){t.positions=t.cachePositions,t.end_id=e.create_point(t.cachePositions[t.cachePositions.length-1],{image:"end1.png",width:30,height:38},t);var o=t.viewer.entities.getById(t.ids[t.ids.length-1]);o&&(o.billboard.show=!1)}t.cachePositions.length<2&&(t.destroy(),YJ.Measure.Measures.pop()),t.end()};this.event.mouse_left(i),this.event.mouse_move((function(e,i){e.endPosition.y+=2;var n=e.endPosition,o=t.viewer.scene.pickPosition(n);if(!o){var s=t.viewer.camera.getPickRay(n);o=t.viewer.scene.globe.pick(s,t.viewer.scene)}if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(o),t.cachePositions.length){var a=t.cartesian3Towgs84(o,t.viewer),r=t.cartesian3Towgs84(t.cachePositions[t.cachePositions.length-1],t.viewer),l=t.computeDistance2([r,a]),c=Math.abs(r.alt-a.alt),u=l/Math.sqrt(l*l+c*c),p=Math.acos(u),h="坡度:"+t.radiansToDegrees(p).toFixed(2)+"°";t.tip.set_text(h)}})),this.event.mouse_right(n),this.event.mouse_right_keyboard_ctrl((function(e,i){t.cachePositions.length&&(t.cachePositions.pop(),t.remove_entity(t.ids.pop()))})),this.event.gesture_pinck_start((function(e,o){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?n(0,o):i(a,o)}))}))}}},{key:"computeAngle",value:function(t,i){var n=this.computeDistance2([t,i]),o=Math.abs(t.alt-i.alt),s=n/Math.sqrt(n*n+o*o),a=Math.acos(s),r=this.radiansToDegrees(a),l=this.getLabel("坡度:"+r.toFixed(2)+"°");l.pixelOffset=new Cesium.Cartesian2(0,-32),this.ids.push(e.create_point(Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.alt),{label:l},this))}},{key:"destroy",value:function(){var t=this;[this.polyline_id,this.end_id,this.start_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Sr(e,"destroy",this,3)([])}},{key:"end",value:function(){Sr(e,"end",this,3)([])}}],[{key:"createPolyline",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:3,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),dashLength:20}),zIndex:99999999}})),e}},{key:"create_point",value:function(t,e,i){var n=e.label,o=e.image,s=void 0===o?"point.png":o,a=e.width,r=e.height,l=i.randomString(),c=i.cartesian3Towgs84(t,i.viewer);return n&&(n.pixelOffset=new Cesium.Cartesian2(0,-(r||32))),i.viewer.entities.add(new Cesium.Entity({id:l,label:n,position:Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt),billboard:{image:i.getSourceRootPath()+"/img/"+s,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:a,height:r}})),l}}]);var i,n,s}(hr);function Pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Mr(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Pr(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Pr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Or(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Tr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Nr=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Or(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Tr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i,n=0,o=0,s=function(s,a){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Mr({},a)),t.ids.push(t.create_point(Mr({},a),!1));var r=t.cartesian3Towgs84(Mr({},a),t.viewer);if(r.alt>n&&(n=r.alt),t.positions=t.cachePositions.concat(Mr({},a)),t.tip.setPosition(Mr({},a),s.position.x,s.position.y),t.positions.length>2){var l=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);l.push({lng:i.lng,lat:i.lat})}));var c=t.computeCenter(l),u=t.computeArea(l);o=u,t.center=new Cesium.Cartesian3.fromDegrees(c.lng,c.lat,n),i=t.center,t.text="投影面积:"+u+" ㎡"}};this.event.mouse_left(s),this.event.mouse_move((function(e,i){if(t.tip.setPosition(Mr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Mr({},i)),t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})}));var s=t.computeCenter(o),a=t.computeArea(o);t.center=new Cesium.Cartesian3.fromDegrees(s.lng,s.lat,n),t.text="投影面积:"+a+" ㎡"}})),this.event.mouse_right((function(e,n){if(t.positions=t.cachePositions,t.center=i,t.positions.length<3){t.text="";console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}else t.text="投影面积:"+o+" ㎡";t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?(t.positions=t.cachePositions,t.end()):s(o,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),Tr(e,"destroy",this,3)([])}},{key:"end",value:function(){Tr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(hr);function Br(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Br(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Br(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ar(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function jr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Ir=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Ar(this,e,[t,n])).options.lineColor="#ffdf53",i.polygon_id="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){jr(e,"start",this,3)([]),this.ids=[],this.positions=[],this.text="",this.center=new Cesium.Cartesian3,this.cachePositions=[];var i=0,n=function(n,o){0===t.ids.length&&(t.polygon_id=e.create_polygon(t)),t.cachePositions.push(Lr({},o)),t.ids.push(t.create_point(Lr({},o),!1));var s=t.cartesian3Towgs84(Lr({},o),t.viewer);s.alt>i&&(i=s.alt),t.positions=t.cachePositions.concat(Lr({},o)),t.tip.setPosition(Lr({},o),n.position.x,n.position.y)},o=function(e,n){if(t.positions=t.cachePositions,t.positions.length>2){var o=[];t.positions.forEach((function(e){var i=t.cartesian3Towgs84(e,t.viewer);o.push({lng:i.lng,lat:i.lat})})),setTimeout((function(){var e=t.computeCenter(o),n=t.computeSignedArea(t.viewer,o);t.center=new Cesium.Cartesian3.fromDegrees(e.lng,e.lat,i),t.text="贴地面积:"+n+" ㎡"}),0)}else{console.warn("面积计算至少需要三个坐标!"),window.ELEMENT&&window.ELEMENT.Message({message:"面积计算至少需要三个坐标!",type:"warning",duration:1500}),t.destroy()}t.end()};this.event.mouse_left(n),this.event.mouse_move((function(e,i){t.tip.setPosition(Lr({},i),e.endPosition.x,e.endPosition.y),t.positions=t.cachePositions.concat(Lr({},i))})),this.event.mouse_right(o),this.event.gesture_pinck_start((function(e,i){var s=new Date,a={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-s>=500?o():n(a,i)}))}))}}},{key:"destroy",value:function(){var t=this;[this.polygon_id].concat(L()(this.ids)).forEach((function(e){t.remove_entity(e)})),jr(e,"destroy",this,3)([])}},{key:"end",value:function(){jr(e,"end",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();new Cesium.NearFarScalar(2e3,1,1e5,0),t.viewer.entities.add(new Cesium.Entity({id:e,label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffffff"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},position:new Cesium.CallbackProperty((function(){return t.center}),!1),polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)}),!1),material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions.length?t.positions.concat(t.positions[0]):t.positions}),!1),width:2,material:new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString(t.options.lineColor||t.defaultColor),dashLength:20}),clampToGround:!0,zIndex:99999999}}));return e}}])}(hr);function Rr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Fr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var zr=function(t){function e(t){return k()(this,e),Rr(this,e,[t])}return sn()(e,t),_()(e,[{key:"cal_center",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeCenter([e,i]);return Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e.alt+i.alt)/2)}},{key:"cal_distance",value:function(t){var e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.computeDistance2([e,i]);return e.alt=e.alt.toFixed(2),i.alt=i.alt.toFixed(2),e.alt===i.alt?n:0===Number(n)?Math.abs(e.alt-i.alt).toFixed(2):Math.sqrt(n*n+Math.pow(Math.abs(e.alt-i.alt).toFixed(2),2)).toFixed(2)}},{key:"createPolyline",value:function(t){var e=this,i=this.id_map.get(t);this.viewer.entities.add(new Cesium.Entity({id:t,position:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_center(i.positions):Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(){return 2===i.positions.length?e.cal_distance(i.positions)+"米":"0米"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(){return i.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999}})),this.ids.push(t)}},{key:"create_angle_label",value:function(t,e,i,n){var o=this,s=new Cesium.Entity({id:i,position:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_point(t,e):Cesium.Cartesian3()})),label:{text:new Cesium.CallbackProperty((function(){return 2===t.length?o.cal_angle(t,e,n)+"°":"0°"}),!1),scale:1,fillColor:Cesium.Color.RED,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(15,-10)}});this.viewer.entities.add(s)}},{key:"cal_point",value:function(t,e){for(var i=0;i<t.length;i++)for(var n=0;n<e.length;n++)if(t[i].x===e[n].x&&t[i].y===e[n].y&&t[i].z===e[n].z)return t[i]}},{key:"cal_angle",value:function(t,e,i){if(1===i)return 90;if(2===i||3===i){var n=this.id_map.get(t).positions,o=this.id_map.get(e).positions,s=this.cartesian3Towgs84(n[0],this.viewer),a=this.cartesian3Towgs84(n[1],this.viewer),r=this.computeDistance2([a,s]),l=this.cartesian3Towgs84(o[0],this.viewer),c=this.cartesian3Towgs84(o[1],this.viewer),u=this.computeDistance2([l,c]),p=Math.abs(l.alt-c.alt),h=Math.sqrt(Math.pow(p,2)+Math.pow(u,2));return 0==r&&(r=Math.abs(a.alt-s.alt)),(180*Math.acos(r/h)/Math.PI).toFixed(2)}}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Fr(e,"start",this,3)([]),this.positions=[],this.cachePositions=[];var i=this.randomString(),n=this.randomString(),o=this.randomString(),s=(this.randomString(),this.randomString(),this.randomString(),[]);this.id_map=new Map;var a={};this.id_map.set(o,{positions:[]}),this.id_map.set(i,{positions:[]}),this.id_map.set(n,{positions:[]});var r=function(e,r){if(s.push(r),0===t.ids.length&&(a=t.cartesian3Towgs84(r,t.viewer),t.createPolyline(i),t.createPolyline(n),t.createPolyline(o)),t.ids.push(t.create_point(r)),t.tip.setPosition(r,e.position.x,e.position.y),s.length){var l=t.cartesian3Towgs84(r,t.viewer),c=t.id_map.get(n),u=t.id_map.get(i);l.alt<a.alt?(c.positions[0]=r,c.positions[1]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[0]=Cesium.Cartesian3.fromDegrees(l.lng,l.lat,a.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(c.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),c.positions[1]=r,u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,l.alt),u.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}2===s.length&&t.end()};this.event.mouse_left(r),this.event.mouse_move((function(e,r){t.tip.setPosition(r,e.endPosition.x,e.endPosition.y);var l=t.id_map.get(o);if(s.length){l.positions=s.concat(r);var c=t.cartesian3Towgs84(r,t.viewer),u=t.id_map.get(n),p=t.id_map.get(i);c.alt<a.alt?(u.positions[0]=r,u.positions[1]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),p.positions[0]=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,a.alt),p.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)):(u.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),u.positions[1]=r,p.positions[0]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,c.alt),p.positions[1]=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt))}})),this.event.mouse_right((function(e,i){t.end()})),this.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?t.end():r(o,i)}))}))}}},{key:"end",value:function(){Fr(e,"end",this,3)([])}},{key:"destroy",value:function(){Fr(e,"destroy",this,3)([])}}])}(hr);function Hr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Vr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Gr=function(t){function e(t){var i;return k()(this,e),(i=Hr(this,e,[t,{text:""}])).defaultColor="#f11515",i.locationID=i.randomString(),i.position=new Cesium.Cartesian3,i.text="",i}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Vr(e,"start",this,3)([]),this.cache_id=e.create_point(this),e.createLocation(this);var i=function(e,i){t.position=i;var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0);var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}t.end()};this.event.mouse_left(i),this.event.mouse_right((function(e,i){t.destroy(),t.end()})),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y);var n=t.viewer.entities.getById(t.locationID);n&&(n.show=!0),t.position=i;var o=t.cartesian3Towgs84(i,t.viewer),s=li();if("EPSG:4326"===s)t.text="经度:".concat(Number(o.lng.toFixed(8)),"\n纬度:").concat(Number(o.lat.toFixed(8)),"\n海拔:").concat(Number(o.alt.toFixed(2)));else{var a=t.convert([{x:o.lng,y:o.lat,z:o.alt}],"EPSG:4326",s);t.text="x:".concat(Number(a.points[0].x.toFixed(8)),"\ny:").concat(Number(a.points[0].y.toFixed(8)),"\nz:").concat(Number(a.points[0].z.toFixed(2)))}})),this.event.gesture_pinck_start((function(e,n){var o=new Date;e.position1.x,e.position2.x,e.position1.y,e.position2.y;t.event.gesture_pinck_end((function(){new Date-o>=500?(t.destroy(),t.end()):i(0,n)}))}))}}},{key:"destroy",value:function(){this.remove_entity(this.locationID),this.remove_entity(this.cache_id),Vr(e,"destroy",this,3)([])}},{key:"end",value:function(){Vr(e,"end",this,3)([])}}],[{key:"createLocation",value:function(t){t.viewer.entities.add(new Cesium.Entity({id:t.locationID,show:!1,position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),font:"22px Microsoft YaHei",fillColor:new Cesium.Color.fromCssColorString(t.defaultColor),style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,pixelOffset:new Cesium.Cartesian2(-100,-50)},billboard:{image:t.getSourceRootPath()+"/img/location.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),disableDepthTestDistance:Number.POSITIVE_INFINITY,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:48,height:48}}))}},{key:"create_point",value:function(t){var e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,position:new Cesium.CallbackProperty((function(){return t.position}),!1),billboard:C()({image:t.getSourceRootPath()+"/img/point.png",color:Cesium.Color.fromCssColorString("rgba(255,255,255,0.99)"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY},"color",Cesium.Color.WHITE.withAlpha(.99))})),e}}])}(hr);function Ur(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Wr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Yr=function(t){function e(t){return k()(this,e),Ur(this,e,[t,{text:"左键开始,右键取消"}])}return sn()(e,t),_()(e,[{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Wr(e,"start",this,3)([]),this.positions=[],this.position=new Cesium.Cartesian3,this.height=0,this.text="",this.circleRadius=0;var i=0;this.firstpoint=null;var n=function(n,o){if(null===t.firstpoint&&(t.positions.push(o),t.firstpoint=t.cartesian3Towgs84(o,t.viewer),t.ids.push(e.create_polygon(t)),t.ids.push(e.create_point(t,o))),i++,t.tip.setPosition(o,n.position.x,n.position.y),2===i){if(t.firstpoint){var s=t.cartesian3Towgs84(o,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,s.alt),t.positions[2]=o,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,s]),t.height=Number((s.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}t.ids.push(e.create_point(t,o,{label:{text:"半径:"+t.circleRadius+" 米"}})),t.end()}};this.event.mouse_left(n),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.firstpoint){var n=t.cartesian3Towgs84(i,t.viewer);t.positions[1]=Cesium.Cartesian3.fromDegrees(t.firstpoint.lng,t.firstpoint.lat,n.alt),t.positions[2]=i,t.position=t.positions[1],t.circleRadius=t.computeDistance2([t.firstpoint,n]),t.height=Number((n.alt-t.firstpoint.alt).toFixed(2)),t.text="相对高度:"+t.height+" 米",t.tip.set_text("左键完成,右键取消;半径:"+t.circleRadius+" 米")}})),this.event.mouse_right((function(e,i){t.end(),t.destroy()})),this.event.gesture_pinck_start((function(e,i){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?(t.end(),t.destroy()):n(s,i)}))}))}}},{key:"end",value:function(){Wr(e,"end",this,3)([])}},{key:"destroy",value:function(){Wr(e,"destroy",this,3)([])}}],[{key:"create_polygon",value:function(t){var e=t.randomString();t.viewer.entities.add(new Cesium.Entity({id:e,billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)},position:new Cesium.CallbackProperty((function(){return t.position}),!1),label:{text:new Cesium.CallbackProperty((function(){return t.text}),!1),scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15),disableDepthTestDistance:Number.POSITIVE_INFINITY},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions}),!1),width:2,material:Cesium.Color.YELLOW,zIndex:99999999},ellipse:{height:new Cesium.CallbackProperty((function(){return t.height+t.firstpoint.alt}),!1),semiMinorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(e){return t.circleRadius}),!1),material:new Cesium.Color.fromCssColorString(t.defaultColor)}}));return e}},{key:"create_point",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.randomString(),o=t.cartesian3Towgs84(e,t.viewer),s={id:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}};return i.label&&(s.label={text:i.label.text,scale:1,font:"normal 20px MicroSoft YaHei",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,style:Cesium.LabelStyle.FILL_AND_OUTLINE,pixelOffset:new Cesium.Cartesian2(0,-15)}),t.viewer.entities.add(new Cesium.Entity(s)),n}}])}(hr);function Jr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function qr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Xr=function(t){function e(t){var i;return k()(this,e),(i=Jr(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){qr(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;qr(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.cartesian3Towgs84(t[0],this.viewer),i=this.cartesian3Towgs84(t[1],this.viewer),n=this.cartesian3Towgs84(t[2],this.viewer),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a=turf.point([n.lng,n.lat]),r={units:"kilometers"},l=turf.rhumbDistance(o,s,r),c=turf.rhumbDistance(a,s,r),u=l;l>c&&(u=c);var p=turf.rhumbBearing(o,s),h=turf.rhumbBearing(a,s),d=Math.abs((p-h+360)%360);this.bearing=d>180?360-d:d,this.bearing=this.bearing.toFixed(2);var m=p-180,f=h-180,v=turf.lineArc(s,u/3,f,m);d>180&&(v=turf.lineArc(s,u/3,m,f));for(var g=[],y=0;y<v.geometry.coordinates.length;y++)g.push(Cesium.Cartesian3.fromDegrees(v.geometry.coordinates[y][0],v.geometry.coordinates[y][1]));this.arcPositions=g}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){qr(e,"start",this,3)([]);var i=function(e,i){if(0===t.ids.length&&(t.line_id=t.createPolyline()),t.ids.push(t.create_point(i)),t.tip.setPosition(i,e.position.x,e.position.y),t.cachePositions.push(i),t.cachePositions.length&&(t.positions=t.cachePositions.concat(i)),2===t.ids.length){t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid();var n=t.cartesian3Towgs84(i,t.viewer);t.sampleHeightMostDetailed([n]).then((function(e){t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,(e[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}))}3===t.ids.length&&(t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]]),t.end())};this.event.mouse_left(i),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length&&(t.positions=t.cachePositions.concat(i)),t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1],t.positions[2]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(hr);function Zr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Kr(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var $r=function(t){function e(t){var i;return k()(this,e),(i=Zr(this,e,[t,{text:"左键开始,右键取消"}])).cachePositions=[],i.positions=[],i.arcPositions=[],i.line_id="",i.label_id="",i.arc_id="",i.bearing=0,i}return sn()(e,t),_()(e,[{key:"createPolyline",value:function(){var t=this,e=t.randomString();return t.viewer.entities.add(new Cesium.Entity({id:e,polyline:{positions:new Cesium.CallbackProperty((function(){return t.positions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}})),e}},{key:"end",value:function(){Kr(e,"end",this,3)([])}},{key:"destroy",value:function(){var t=this;Kr(e,"destroy",this,3)([]),[this.line_id,this.label_id,this.arc_id].forEach((function(e){e&&t.remove_entity(e)}))}},{key:"cancel",value:function(){this.end(),this.destroy()}},{key:"caculateAngle",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=this.cartesian3Towgs84(t[1],this.viewer),i=this.cartesian3Towgs84(t[0],this.viewer),n=turf.point([e.lng,e.lat]),o=turf.point([i.lng,i.lat]),s=this.rhumbBearing(i,e);this.bearing=(180+s).toFixed(2);for(var a=turf.rhumbDistance(n,o,{units:"kilometers"}),r=turf.lineArc(n,a/3,0,this.bearing),l=[],c=0;c<r.geometry.coordinates.length;c++)l.push(Cesium.Cartesian3.fromDegrees(r.geometry.coordinates[c][0],r.geometry.coordinates[c][1]));this.arcPositions=l}},{key:"start",value:function(){var t=this;if(!YJ.Measure.GetMeasureStatus()){Kr(e,"start",this,3)([]);var i=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===t.ids.length&&(t.line_id=t.createPolyline()),t.tip.setPosition(n,i.position.x,i.position.y),t.cachePositions.length&&(t.positions=t.cachePositions.concat(n),s=t.cartesian3Towgs84(n,t.viewer),r=t.cartesian3Towgs84(t.positions[1],t.viewer),l=turf.point([r.lng,r.lat]),c=turf.point([s.lng,s.lat]),u={units:"kilometers"},p=turf.rhumbDistance(l,c,u),0,h=turf.destination(l,p,0,u),t.positions[0]=(o=Cesium.Cartesian3).fromDegrees.apply(o,L()(h.geometry.coordinates))),t.cachePositions.push(n),t.cachePositions.push(n),t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]]),!(t.ids.length>=2)){e.next=9;break}return t.end(),e.abrupt("return");case 9:if(t.ids.push(t.create_point(n)),t.ids.push(t.create_point(n)),2!==t.ids.length){e.next=20;break}return t.label_id=Cesium.createGuid(),t.arc_id=Cesium.createGuid(),d=t.cartesian3Towgs84(n,t.viewer),e.next=17,t.sampleHeightMostDetailed([d]);case 17:m=e.sent,t.viewer.entities.add({id:t.arc_id,polyline:{positions:new Cesium.CallbackProperty((function(){return t.arcPositions}),!1),clampToGround:!0,width:5,material:new Cesium.Color.fromCssColorString(t.options.color||t.defaultColor),zIndex:99999999}}),t.viewer.entities.add({id:t.label_id,position:Cesium.Cartesian3.fromDegrees(d.lng,d.lat,(m[0].height||0)+.1),label:{text:new Cesium.CallbackProperty((function(){return"方位夹角:"+t.bearing+"°"}),!1),font:"20px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#f1e605"),style:Cesium.LabelStyle.FILL_AND_OUTLINE,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});case 20:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();this.event.mouse_left(i),this.event.mouse_move((function(e,i){if(t.tip.setPosition(i,e.endPosition.x,e.endPosition.y),t.cachePositions.length){var n;t.positions=t.cachePositions.concat(i);var o=t.cartesian3Towgs84(i,t.viewer),s=t.cartesian3Towgs84(t.positions[1],t.viewer),a=turf.point([s.lng,s.lat]),r=turf.point([o.lng,o.lat]),l={units:"kilometers"},c=turf.rhumbDistance(a,r,l),u=turf.destination(a,c,0,l);t.positions[0]=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(u.geometry.coordinates))}t.positions.length>2&&t.caculateAngle([t.positions[0],t.positions[1]],[t.positions[2],t.positions[1]])})),this.event.mouse_right((function(e,i){t.cancel()})),this.event.gesture_pinck_start((function(e,n){var o=new Date,s={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-o>=500?t.cancel():i(s,n)}))}))}}}])}(hr);function Qr(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var tl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(i=Qr(this,e,[t,n])).options.curve=n.curve||!1;var o=Number(n.number);return isNaN(o)?i.options.number=1/0:i.options.number=o<2?2:o,i}return sn()(e,t),_()(e,[{key:"smoothHandle",value:function(t){if(t.length>1){for(var e=[],i=[],n=0;n<t.length;n++)i.push(n/(t.length-1));for(var o=new Cesium.CatmullRomSpline({times:i,points:t}),s=20*t.length,a=0;a<=s;a++){var r=o.evaluate(a/s);e.push(r)}return e}return t}},{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",r.positions=c.concat(n),r.tip.setPosition(n,i.position.x,i.position.y),!r.entityHasCreated){var o=e.create_polyline(r,r.viewer);r.points_ids.push(o)}if(c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),c.length>=r.options.number){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var u=r.smoothHandle(c);s=[];for(var p=0;p<u.length;p++)s[p]=r.cartesian3Towgs84(u[p],r.viewer)}t(null,a,s),r.end()}}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n,o=[];if(c.forEach((function(t){o.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}t(null,o,n),r.end()}})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(e),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}t(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var p=e.create_polyline(r,r.viewer);r.points_ids.push(p)}c.push(n),r.points_ids.push(r.create_point(n,r.viewer)),r.positions=c.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",r.positions=c.concat(i),r.tip.setPosition(i,t.position.x+r.viewer.canvas.width,t.position.y),!r.entityHasCreated){var n=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(n)}c.push(i),r.points_ids.push(r.create_point(i,r._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n,o=[];if(c.forEach((function(t){o.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var s=r.smoothHandle(c);n=[];for(var a=0;a<s.length;a++)n[a]=r.cartesian3Towgs84(s[a],r.viewer)}t(null,o,n),r.end()}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(e),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s,a=[];if(c.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))})),r.options.curve){var l=r.smoothHandle(c);s=[];for(var u=0;u<l.length;u++)s[u]=r.cartesian3Towgs84(l[u],r.viewer)}t(null,a,s),r.end()}else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.entityHasCreated){var p=e.create_polyline(r,r._sdk2D.viewer);r.points_ids.push(p)}c.push(n),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=c.concat(n)}}))}})))}}}],[{key:"create_polyline",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polyline:{positions:new Cesium.CallbackProperty((function(){return t.options.curve?t.smoothHandle(t.positions):t.positions}),!1),width:5,material:Cesium.Color.fromCssColorString(t.color),clampToGround:!0,zIndex:99999999}})),i}}])}(Ca);function el(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function il(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?el(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):el(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function nl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ol=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=nl(this,e,[t,n])).polygonHasCreated=!1,i.rectObject=[],i}return sn()(e,t),_()(e,[{key:"computedLastPoint",value:function(t){var e=t[0],i=t[1],n=Cesium.Cartesian3.subtract(i,e,new Cesium.Cartesian3),o=Cesium.Cartesian3.subtract(t[2],e,new Cesium.Cartesian3),s=Cesium.Cartesian3.dot(o,n)/Cesium.Cartesian3.magnitudeSquared(n),a=Cesium.Cartesian3.multiplyByScalar(n,s,new Cesium.Cartesian3),r=Cesium.Cartesian3.add(e,a,new Cesium.Cartesian3),l=Cesium.Cartesian3.distance(t[2],r),c=Cesium.Cartesian3.subtract(t[2],r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,l,new Cesium.Cartesian3),p=Cesium.Cartesian3.add(i,u,new Cesium.Cartesian3),h=Cesium.Cartesian3.add(e,u,new Cesium.Cartesian3);return[il({},p),il({},h)]}},{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;this.polygonHasCreated=!1,(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk);var c=0;this.positions=[],this.positionsLine=[],this.points_ids=[];var u=[],p=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",c++,r.positions=u.concat(il({},n)),r.tip.setPosition(n,i.position.x,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(il({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n)),r.positions=u.concat(n)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",c++,r.positions=u.concat(il({},n)),r.tip.setPosition(n,i.position.x+r.viewer.canvas.width,i.position.y),!r.polygonHasCreated){var o=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),3==c&&(r.end(),t(null,r.rectObject))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),2==c)){var i=JSON.parse(JSON.stringify(u)),n=i.concat(il({},e)),o=r.computedLastPoint(n);i=i.concat(o),r.positions=i;var s=i.map((function(t){return r.cartesian3Towgs84(t,r.viewer)}));r.rectObject=s}})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),u.pop(),p.pop(),r.positions=u.concat(cartesian))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t(null,p),r.end();else{if(r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),!r.polygonHasCreated){var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}u.push(n),p.push(r.cartesian3Towgs84(n,r.viewer)),r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),r.positions=u.concat(n)}}))}})))}}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.polygonHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(t.positions)})),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(e){return t.positions.concat(t.positions[0])})),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),i}}])}(Ca);function sl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var al=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return k()(this,e),sl(this,e,[t,i,n])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;",this.sdk),this.event=new X(this.sdk),this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer);t(null,s,Cesium)})),this.event2D.mouse_right((function(i,n){e.end(),t(!1)})),this.event2D.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x+e.viewer.canvas.width,t.endPosition.y)})),this.event2D.gesture_pinck_start((function(n,o){var s=new Date;e.event2D.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))})))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy(),this.tip&&this.tip.destroy()}}])}(Ca);function rl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ll=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),rl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.viewer;t.entities.add(new Cesium.Entity({id:g.circle_id,position:new Cesium.CallbackProperty((function(t){if(v){var e=g.computeMidpoint(f,v);return Cesium.Cartesian3.fromDegrees(e.lng,e.lat,v.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return d>1e3?"半径:"+(d/1e3).toFixed(2)+" 公里":"半径:"+d+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(t){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(m))}),!1),material:Cesium.Color.fromCssColorString(g.color),zIndex:99999999},polyline:{positions:new Cesium.CallbackProperty((function(t){return p}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var u=0;this.circle_id=this.randomString();var p=[],h=[],d=1,m=[],f={},v=null;this.event.mouse_left((function(e,i){"2D"!==l&&(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c()),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event.gesture_pinck_start((function(e,i){if("2D"!==l){var n=new Date;r.event.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){"3D"!==l&&(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),m=r.createCircle(f,.01),h.push(i),c(r._sdk2D.viewer)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),u&&(p=h.concat(e),v=r.cartesian3Towgs84(e,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d)))})),this.event2D.gesture_pinck_start((function(e,i){if("3D"!==l){var n=new Date;r.event2D.gesture_pinck_end((function(){new Date-n>=500?(r.end(),t(!1)):(r.tip.set_text("再次左键,完成绘制;右键取消"),1===++u&&(r.point_id=r.create_point(i,r._sdk2D.viewer),f=r.cartesian3Towgs84(i,r.viewer),h.push(i),c(r._sdk2D.viewer),r.tip.setPosition(i,(e.position1.x+e.position2.x)/2+r.viewer.canvas.width,(e.position1.y+e.position2.y)/2)),2===u&&(p=h.concat(i),v=r.cartesian3Towgs84(i,r.viewer),d=r.computeDistance2([f,v]),m=r.createCircle(f,d),r.end(),t(null,{center:f,radius:Number(d)})))}))}})));var g=this}}},{key:"end",value:function(){this.remove_entity(this.circle_id),this.remove_entity(this.point_id),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(Ca);function cl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ul=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),cl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l,c=function(){var t=Cesium.Cartesian3.fromDegrees(m[0].lng,m[0].lat),e=Cesium.Cartesian3.fromDegrees(m[1].lng,m[1].lat),i=Cesium.Cartesian3.fromDegrees(m[2].lng,m[2].lat);if(1===p){g=Cesium.Cartesian3.distance(t,e),f=(v=g)/2;var n={x:h.lng,y:h.lat},o={x:m[1].lng,y:m[1].lat},s=Math.PI/180,a=n.y*s,r=o.y*s,l=n.x*s,c=o.x*s,u=Math.sin(c-l)*Math.cos(r),d=Math.cos(a)*Math.sin(r)-Math.sin(a)*Math.cos(r)*Math.cos(c-l),C=Math.atan2(u,d)%(2*Math.PI);b=450-(180*C/Math.PI<0?360+180*C/Math.PI:180*C/Math.PI)}if(2===p){Cesium.Cartesian3.distance(t,i),y=Cesium.Cartesian3.distance(e,i);var w=turf.point([m[0].lng,m[0].lat]),k=turf.point([m[1].lng,m[1].lat]),x=turf.point([m[2].lng,m[2].lat]),_=turf.rhumbBearing(w,k),E=turf.rhumbBearing(k,x),S=Math.abs(_-E),D=S>180?360-S:S;D=180-D,f=y*Math.sin(Cesium.Math.toRadians(D))}},u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C.viewer;t.entities.add(new Cesium.Entity({id:C.elliptic_id,position:Cesium.Cartesian3.fromDegrees(h.lng,h.lat),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(t){return f}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(t){return v}),!1),granularity:Cesium.Math.toRadians(.1),rotation:new Cesium.CallbackProperty((function(t){return Cesium.Math.toRadians(b)}),!1),material:Cesium.Color.fromCssColorString(C.color),zIndex:99999999}}))};(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),this.entity_ids=[],YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键开始,右键取消",this.sdk),this.event=new X(this.sdk);var p=0;this.elliptic_id=this.randomString();var h,d=[],m=[],f=0,v=0,g=0,y=0,b=0;this.event.mouse_left((function(e,i){if("2D"!==l){if(l="3D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u()}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t(!1))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,i){if("3D"!==l){if(l="2D",r.tip.set_text("再次左键,完成绘制;右键取消"),p++,r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),d.push(i),1===p){d=[i,i,i];var n=r.cartesian3Towgs84(i,r.viewer);h=n,m=[n,n,n],c(),u(r._sdk2D.viewer)}if(2===p){d[1]=i,d[2]=i;var o=r.cartesian3Towgs84(i,r.viewer);m[1]=o,m[2]=o}p>=3&&(r.end(),t(null,{center:h,bearing:b,semiMajorAxis:v,semiMinorAxis:f}))}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t(!1))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),d[p]=e,m[p]=r.cartesian3Towgs84(e,r.viewer),0!==p&&c())})));var C=this}}},{key:"end",value:function(){var t=this;this.remove_entity(this.elliptic_id),this.points_ids.forEach((function(e){t.remove_entity(e)})),YJ.Measure.SetMeasureStatus(!1),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.event2D&&this.event2D.destroy()}}])}(Ca);function pl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var hl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),pl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键结束;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[],u=!1;this.event.mouse_left((function(t,i){if("2D"!==l){l="3D";var n=r.cartesian3Towgs84(i,r.viewer),o=c[c.length-1];if(!o||o.lng!==n.lng||o.lat!==n.lat){if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}r.points_ids.push(r.create_point(i)),c.push(n),u=!1}}})),this.event.mouse_right((function(e,i){if("2D"!==l){var n=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event.mouse_move((function(t,e){"2D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r);r.points_ids.push(a)}r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2)}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(t,i){if("3D"!==l){if(l="2D",!r.entityHasCreated){var n=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(n)}r.points_ids.push(r.create_point(i,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(i,r.viewer)),u=!1}})),this.event2D.mouse_right((function(e,i){if("3D"!==l){var n=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){n.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),u&&r.positions.pop(),t(null,r.positions,n)}})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(u=!0,r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,r.positions,s)}else{if(!r.entityHasCreated){var a=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(a)}r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2)}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAttackArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Ca);function dl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ml=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),dl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var l;(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;CTRL+右键撤销",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var c=[];this.event.mouse_left((function(i,n){if("2D"!==l){if(l="3D",!r.entityHasCreated){var o=e.create_arrow_polygon(r);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event.mouse_right((function(e,i){"2D"!==l&&(r.end(),t("取消绘制"))})),this.event.mouse_move((function(t,e){"2D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x,t.endPosition.y))})),this.event.mouse_right_keyboard_ctrl((function(t,e){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event.gesture_pinck_start_keyboard_ctrl((function(){"2D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event.gesture_pinck_start((function(i,n){if("2D"!==l){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==l){if(l="2D",!r.entityHasCreated){var o=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(o)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),5===c.length){var s=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){s.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,s)}}})),this.event2D.mouse_right((function(e,i){"3D"!==l&&(r.end(),t("取消绘制"))})),this.event2D.mouse_move((function(t,e){"3D"!==l&&(r.positions=c.concat(r.cartesian3Towgs84(e,r.viewer)),r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y))})),this.event2D.mouse_right_keyboard_ctrl((function(t,e){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop())})),this.event2D.gesture_pinck_start_keyboard_ctrl((function(){"3D"!==l&&r.points_ids.length>1&&(r.remove_entity(r.points_ids.pop()),c.pop(),r.positions=c.concat(r.cartesian3Towgs84(cartesian,r.viewer)))})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==l){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)r.end(),t("取消绘制");else{if(!r.entityHasCreated){var s=e.create_arrow_polygon(r,r._sdk2D.viewer);r.points_ids.push(s)}if(r.points_ids.push(r.create_point(n,r._sdk2D.viewer)),c.push(r.cartesian3Towgs84(n,r.viewer)),r.positions=c.concat(r.cartesian3Towgs84(n,r.viewer)),r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),5===c.length){var a=[];if(r.points_ids.length>2)r.event2D.viewer.entities.getById(r.points_ids[0]).polygon.hierarchy.getValue().positions.forEach((function(t){a.push(r.cartesian3Towgs84(t,r.viewer))}));r.end(),t(null,c,a)}}}))}})))}}}],[{key:"create_arrow_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer;t.entityHasCreated=!0;var i=t.randomString();return e.entities.add(new Cesium.Entity({id:i,polygon:{classificationType:Cesium.ClassificationType.BOTH,hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computePincerArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),zIndex:99999999}})),i}}])}(Ca);function fl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function vl(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var gl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=fl(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;vl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event.mouse_move((function(t,o){if("2D"!==n&&(i.tip.setPosition(o,t.endPosition.x,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i))}})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&i.anchorpoints[0]!==s)){i.anchorpoints.push(s);var a=i.cartesian3Towgs84(s,i.viewer);if(a.lng=Number(a.lng.toFixed(8)),a.lat=Number(a.lat.toFixed(8)),(!o[0]||a.lng!==o[0].lng||a.lat!==o[0].lat)&&(o.push(a),i.positions.push(a),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),2===i.points_ids.length)){var r=[o[0],o[1]];t(null,r),i.end()}}})),this.event2D.mouse_move((function(t,o){if("3D"!==n&&(i.tip.setPosition(o,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),o&&0!==i.points_ids.length)){var s=i.cartesian3Towgs84(o,i.viewer);i.positions=[i.positions[0],s],1!==i.points_ids.length||Cesium.defined(i.arrowPolygon)||(i.arrowPolygon=e.polygon(i,i._sdk2D.viewer))}})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.arrowPolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.arrowPolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){vl(e,"end",this,3)([]),this.viewer.entities.remove(this.arrowPolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.arrowPolygon)}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"ArrowPolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeStraightArrow(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(Ca);function yl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var bl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=yl(this,e,[t,n])).rhumb=n.rhumb,i.polygonHasCreated=!1,i.rect=[],i.rectObj=[],i.entity=null,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r=this,l=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var c;(i=e,n="start",o=this,s=3,a=ya()(nn()(1&s?i.prototype:i),n,o),2&s&&"function"==typeof a?function(t){return a.apply(o,t)}:a)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消",l.sdk),this.event=new X(l.sdk),this.positions=[],this.points_ids=[];var u=0,p=null,h=null;this.event.mouse_left((function(i,n){if("2D"!==c){c="3D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event.mouse_right((function(e,i){"2D"!==c&&(r.end(),t("取消",""))})),this.event.mouse_move((function(t,e){if("2D"!==c&&(r.tip.setPosition(e,t.endPosition.x,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event.gesture_pinck_start((function(i,n){if("2D"!==c){var o=new Date;r.event.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(i,n){if("3D"!==c){c="2D",u++;var o=r.cartesian3Towgs84(n,r.viewer);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var s=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(s),p=o}2==u&&(h=o,r.end(),t(null,l.rectObj,[p,h]))}})),this.event2D.mouse_right((function(e,i){"3D"!==c&&(r.end(),t("取消",""))})),this.event2D.mouse_move((function(t,e){if("3D"!==c&&(r.tip.setPosition(e,t.endPosition.x+r.viewer.canvas.width,t.endPosition.y),1==u)){var i=r.cartesian3Towgs84(e,r.viewer);r.calrect(p,i)}})),this.event2D.gesture_pinck_start((function(i,n){if("3D"!==c){var o=new Date;r.event2D.gesture_pinck_end((function(){if(new Date-o>=500)t("取消",""),r.end();else{r.tip.setPosition(n,(i.position1.x+i.position2.x)/2+r.viewer.canvas.width,(i.position1.y+i.position2.y)/2),u++;var s=r.cartesian3Towgs84(n);if(!r.polygonHasCreated){r.polygonHasCreated=!0;var a=e.create_polygon(r,r._sdk2D.viewer);r.points_ids.push(a),p=s}2==u&&(r.calrect(p,s),h=s,r.end(),t(null,l.rectObj,[p,h]))}}))}})))}}},{key:"calrect",value:function(t,e){var i,n=[],o=[],s=[];if(n.push([t.lng,t.lat,t.alt],[e.lng,e.lat,e.alt]),2===n.length){var a=turf.lineString(n),r=turf.bbox(a);i=turf.bboxPolygon(r)}i&&(i.geometry.coordinates[0].forEach((function(e){o.push(e[0]),o.push(e[1]);var i={lng:e[0],lat:e[1],alt:t.alt};s.push(i)})),this.rect=[].concat(o),this.rectObj=[].concat(s),this.rectObj.pop())}}],[{key:"create_polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(this.entity=new Cesium.Entity({id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t.rect))}),!1),material:Cesium.Color.fromCssColorString(t.color),arcType:t.rhumb?Cesium.ArcType.RHUMB:Cesium.ArcType.GEODESIC,zIndex:99999999}})),i}}])}(Ca);function Cl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function wl(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var kl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cl(this,e,[t,n])).points=null,i.polygonHasCreated=!1,i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var n;wl(e,"start",this,3)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确定,右键取消;",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var o=[];this.anchorpoints=[],this.event.mouse_left((function(e,s){if("2D"!==n&&(n="3D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event.mouse_move((function(t,s){if("2D"!==n&&(i.tip.setPosition(s,t.endPosition.x,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event.mouse_right((function(e,o){"2D"!==n&&(t(null),i.end())})),this.event.gesture_pinck_start((function(s,a){if("2D"!==n){var r=new Date;i.event.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a))}}))}})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,s){if("3D"!==n&&(n="2D",s&&(3===i.anchorpoints.length?i.anchorpoints[1]=s:i.anchorpoints.push(s),o.push(i.cartesian3Towgs84(s,i.viewer)),i.points_ids.push(i.create_point(s,i._sdk2D.viewer)),3===i.points_ids.length))){var a=[o[0],o[2],o[1]];t(null,a),i.end()}})),this.event2D.mouse_move((function(t,s){if("3D"!==n&&(i.tip.setPosition(s,t.endPosition.x+i.viewer.canvas.width,t.endPosition.y),s&&0!==i.points_ids.length))if(o.length>1?i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer),o[1]]:i.positions=[o[0],i.cartesian3Towgs84(s,i.viewer)],1!==i.points_ids.length||Cesium.defined(i.assemblePolygon)||(i.assemblePolygon=e.polygon(i,i._sdk2D.viewer)),i.anchorpoints.length>=2){if(1===i.points_ids.length){var a=new Array;i.positions.forEach((function(t){a.push([t.lng,t.lat])}));var r=P.PlotUtils.mid(a[0],a[1]),l=P.PlotUtils.distance(a[0],r)/.9,c=P.PlotUtils.getThirdPoint(a[0],r,P.Constants.HALF_PI,l,!0);i.positions=[i.positions[0],{lng:c[0],lat:c[1]},i.positions[1]]}i.anchorpoints[1]=s}else i.anchorpoints.push(s)})),this.event2D.mouse_right((function(e,o){"3D"!==n&&(t(null),i.end())})),this.event2D.gesture_pinck_start((function(s,a){if("3D"!==n){var r=new Date;i.event2D.gesture_pinck_end((function(){if(new Date-r>=500)i.end(),t(!1);else if(2===i.anchorpoints.length)i.anchorpoints.push(a),t(null,i.positions),i.end();else{if(!a||Cesium.defined(i.assemblePolygon))return;i.tip.setPosition(a,(s.position1.x+s.position2.x)/2+i.viewer.canvas.width,(s.position1.y+s.position2.y)/2),i.anchorpoints.push(a),i.assemblePolygon=e.polygon(i,i._sdk2D.viewer),o.push(i.cartesian3Towgs84(a)),i.points_ids.push(i.create_point(a,i._sdk2D.viewer))}}))}})))}}},{key:"end",value:function(){wl(e,"end",this,3)([]),this.viewer.entities.remove(this.assemblePolygon),!this._is2D&&this._sdk2D&&this._sdk2D.viewer.entities.remove(this.assemblePolygon)}},{key:"calculateVector",value:function(t,e,i){var n,o,s,a,r,l;e||(e=Math.PI/2),i||(i=1);var c=Math.sqrt(t.x*t.x+t.y*t.y);if(0==t.y)n=o=c*i*Math.cos(e)/t.x,t.x>0?a=-(s=Math.sqrt(i*i-n*n)):t.x<0&&(s=-(a=Math.sqrt(i*i-n*n))),r={x:n,y:s},l={x:o,y:a};else{var u=-t.x/t.y,p=i*c*Math.cos(e)/t.y,h=1+u*u,d=2*u*p,m=p*p-i*i;s=u*(n=(-d-Math.sqrt(d*d-4*h*m))/(2*h))+p,a=u*(o=(-d+Math.sqrt(d*d-4*h*m))/(2*h))+p,t.y>=0?(r={x:n,y:s},l={x:o,y:a}):t.y<0&&(r={x:o,y:a},l={x:n,y:s})}return[r,l]}},{key:"createCloseCardinal",value:function(t){if(null==t||t.length<3)return t;var e=t[0];t.push(e);for(var i=t,n=[],o=.4,s=i.length-1,a=0;a<=s-1;a++){var r=void 0,l=void 0,c=void 0;a==s-1?(r=i[s-1],l=i[0],c=i[1]):(r=i[a],l=i[a+1],c=i[a+2]);var u={x:void 0,y:void 0},p={x:void 0,y:void 0},h={x:l.x-r.x,y:l.y-r.y},d={x:c.x-l.x,y:c.y-l.y},m=Math.sqrt(h.x*h.x+h.y*h.y),f=Math.sqrt(d.x*d.x+d.y*d.y),v={x:h.x/m,y:h.y/m},g={x:d.x/f,y:d.y/f},y={x:v.x+g.x,y:v.y+g.y},b=Math.sqrt(y.x*y.x+y.y*y.y),C={x:y.x/b,y:y.y/b},w=(v.x*g.x+v.y*g.y)/1;Math.abs(1-w)<.005?(u.x=l.x-g.x*m*o,u.y=l.y-g.y*m*o,p.x=l.x+v.x*f*o,p.y=l.y+v.y*f*o):(u.x=l.x-C.x*m*o,u.y=l.y-C.y*m*o,p.x=l.x+C.x*f*o,p.y=l.y+C.y*f*o),a==s-1?(n[0]=l,n[1]=p,n[3*(s-2)+2+3]=u,n[3*(s-2)+2+4]=i[s]):(n[3*a+2+0]=u,n[3*a+2+1]=l,n[3*a+2+2]=p)}return n}},{key:"calculatePointsFBZ3",value:function(t,e){e||(e=20);var i=[],n=.05;e>0&&(n=1/e);for(var o=0;o<t.length-3;){var s=t[o],a=t[o+1],r=t[o+2],l=t[o+3];i.push(s);for(var c=0;c<1;){var u={x:(1-c)*(1-c)*(1-c)*s.x+3*c*(1-c)*(1-c)*a.x+3*c*c*(1-c)*r.x+c*c*c*l.x,y:(1-c)*(1-c)*(1-c)*s.y+3*c*(1-c)*(1-c)*a.y+3*c*c*(1-c)*r.y+c*c*c*l.y};i.push(u),c+=n}(o+=3)>=t.length&&i.push(s)}return i}}],[{key:"polygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.viewer,i=t.randomString();return e.entities.add(new Cesium.Entity({name:"AssemblePolygon",id:i,polygon:{hierarchy:new Cesium.CallbackProperty((function(e){for(var i=t.computeAssemble(t.positions),n=0;n<i.length;n++)if(isNaN(i[n].x)){i=[];break}return new Cesium.PolygonHierarchy(i)}),!1),material:Cesium.Color.fromCssColorString(t.color),outline:!0,outlineColor:Cesium.Color.GREEN,zIndex:99999999}}))}}])}(Ca);function xl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var _l=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),xl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"start",value:function(t){var i,n,o,s,a,r,l=this,c=this;YJ.Measure.GetMeasureStatus()?t("上一次测量未结束"):((n=e,o="start",s=this,a=3,r=ya()(nn()(1&a?n.prototype:n),o,s),2&a&&"function"==typeof r?function(t){return r.apply(s,t)}:r)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("左键确认,右键取消",c.sdk),this.event=new X(c.sdk),this._sector_id=null,this._positions=[],this.points_ids=[],this._entities_sector=[],this._radius=0,this._startAngle=0,this._endAngle=0,this.event.mouse_left((function(e,n){if("2D"!==i&&(i="3D",l._positions.length<3?(l.points_ids.push(l.create_point(n)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event.mouse_move((function(t,e){if("2D"!==i&&(l.tip.setPosition(e,t.endPosition.x,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event.mouse_right((function(e,n){"2D"!==i&&(l.end(),t(null))})),!this._is2D&&this._sdk2D&&(this.event2D=new X(this._sdk2D),this.event2D.mouse_left((function(e,n){if("3D"!==i&&(i="2D",l._positions.length<3?(l.points_ids.push(l.create_point(n,l._sdk2D.viewer)),l._positions.push(l.cartesian3Towgs84(n,l.viewer))):(l.end(),t(null,{center:l._positions[0],radius:l._radius,startAngle:l._startAngle,endAngle:l._endAngle})),2===l._positions.length)){var o=Cesium.Cartesian3.fromDegrees(l._positions[0].lng,l._positions[0].lat,l._positions[0].alt),s=n;l._radius=Cesium.Cartesian3.distance(o,s)}})),this.event2D.mouse_move((function(t,e){if("3D"!==i&&(l.tip.setPosition(e,t.endPosition.x+l.viewer.canvas.width,t.endPosition.y),!(l._positions.length<2)&&(2==l._positions.length&&l._positions.push(l.cartesian3Towgs84(e,l.viewer)),3==l._positions.length))){l._positions.pop(),l._positions.push(l.cartesian3Towgs84(e,l.viewer)),Cesium.defined(l._sector_id)||(l._sector_id=l.createsector(l._sdk2D.viewer),l.points_ids.push(l._sector_id));var n=c.calculateAangle(c._positions);c._startAngle=n.angle1,c._endAngle=n.angle2}})),this.event2D.mouse_right((function(e,n){"3D"!==i&&(l.end(),t(null))}))))}},{key:"createsector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewer,e=this,i=new Cesium.CallbackProperty((function(){var t=e.calSector(e._positions[0],e._radius,e._startAngle,e._endAngle);return new Cesium.PolygonHierarchy(t)})),n=e.randomString(),o=t.entities.add({id:n,position:Cesium.Cartesian3.fromDegrees(e._positions[0].lng,e._positions[0].lat),polygon:{hierarchy:i,show:!0,fill:!0,clampToGround:!0,material:Cesium.Color.fromCssColorString(e.color),zIndex:99999999}});return e._entities_sector.push(o),n}},{key:"cartesianToLatlng",value:function(t){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),i]}},{key:"lonLatToMercator",value:function(t){var e=t[0],i=t[1],n=20037508.34*e/180,o=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return[n,o=20037508.34*o/180]}},{key:"WebMercator2lonLat",value:function(t){var e=t[0]/20037508.34*180,i=t[1]/20037508.34*180;return[e,180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2)]}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}}])}(Ca),El=52.35987755982988,Sl=3.141592653589793,Dl=.006693421622965943,Pl=function(){return _()((function t(){k()(this,t)}),null,[{key:"BD09ToGCJ02",value:function(t,e){var i=+t-.0065,n=+e-.006,o=Math.sqrt(i*i+n*n)-2e-5*Math.sin(n*El),s=Math.atan2(n,i)-3e-6*Math.cos(i*El);return[o*Math.cos(s),o*Math.sin(s)]}},{key:"GCJ02ToBD09",value:function(t,e){e=+e,t=+t;var i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*El),n=Math.atan2(e,t)+3e-6*Math.cos(t*El);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}},{key:"WGS84ToGCJ02",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[t+i[0],e+i[1]]}},{key:"GCJ02ToWGS84",value:function(t,e){if(e=+e,t=+t,this.out_of_china(t,e))return[t,e];var i=this.delta(t,e);return[2*t-(t+i[0]),2*e-(e+i[1])]}},{key:"delta",value:function(t,e){var i=this.transformLng(t-105,e-35),n=this.transformLat(t-105,e-35),o=e/180*Sl,s=Math.sin(o);s=1-Dl*s*s;var a=Math.sqrt(s);return[i=180*i/(6378245/a*Math.cos(o)*Sl),n=180*n/(6378245*(1-Dl)/(s*a)*Sl)]}},{key:"transformLng",value:function(t,e){var i=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Sl)+20*Math.sin(2*t*Sl))/3,i+=2*(20*Math.sin(t*Sl)+40*Math.sin(t/3*Sl))/3,i+=2*(150*Math.sin(t/12*Sl)+300*Math.sin(t/30*Sl))/3}},{key:"transformLat",value:function(t,e){var i=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*Sl)+20*Math.sin(2*t*Sl))/3,i+=2*(20*Math.sin(e*Sl)+40*Math.sin(e/3*Sl))/3,i+=2*(160*Math.sin(e/12*Sl)+320*Math.sin(e*Sl/30))/3}},{key:"out_of_china",value:function(t,e){return e=+e,!((t=+t)>73.66&&t<135.05&&e>3.86&&e<53.55)}}])}();function Ml(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ol=function(t){function e(t,i){var n;return k()(this,e),(n=Ml(this,e,[t,i])).sdk.addIncetance(n.options.id,n),n.options.show&&Kt(0,n.options.id),n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ya()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h()}},{key:"requestResource",value:function(){var t="";return t=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/load-compact-service":this.options.host+"/yjearth4.0/data/service/load-compact-service",fetch(t,{method:"post",body:JSON.stringify({source_id:this.options.id}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}})}}])}(Wn);function Tl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Nl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Tl(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Tl(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Bl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Ll(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Al=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Bl(this,e,[t,i])).options.name=i.name||"未命名对象",n.Dialog=o,n._elms={},n}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i;Ll(e,"setDefaultValue",this,3)([]),this.options.alpha=null!==(t=this.options.alpha)&&void 0!==t?t:1,this.options.brightness=null!==(i=this.options.brightness)&&void 0!==i?i:1}},{key:"layerIndex",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"layer_index",get:function(){return this.entity?this.entity._layerIndex:void 0}},{key:"brightness",get:function(){return this.options.brightness},set:function(t){this.options.brightness=t,this.entity.brightness=t}},{key:"alpha",get:function(){return this.options.alpha},set:function(t){Number(t)>1&&(t=1),Number(t)<0&&(t=0),this.entity.alpha=t,this.options.alpha=t,this._elms.alpha&&this._elms.alpha.forEach((function(e){e.value=t}))}},{key:"layerRaise",value:function(t){this.sdk.viewer.imageryLayers.raise(this.entity);for(var e=0;e<this.sdk.viewer.imageryLayers._layers.length;e++)if(this.sdk.viewer.imageryLayers._layers[e]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[e]._imageryProvider._type)){var i=this.sdk.viewer.imageryLayers._layers[e];this.sdk.viewer.imageryLayers.raiseToTop(i)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerLower",value:function(){return this.sdk.viewer.imageryLayers.lower(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToTop",value:function(){this.sdk.viewer.imageryLayers.raiseToTop(this.entity);for(var t=0;t<this.sdk.viewer.imageryLayers._layers.length;t++)if(this.sdk.viewer.imageryLayers._layers[t]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[t]._imageryProvider._type)){var e=this.sdk.viewer.imageryLayers._layers[t];this.sdk.viewer.imageryLayers.raiseToTop(e)}return this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"layerToBottom",value:function(){return this.sdk.viewer.imageryLayers.lowerToBottom(this.entity),this.options.layer_index=this.entity._layerIndex,this.entity._layerIndex}},{key:"remove",value:function(){Ll(e,"remove",this,3)([]),this.sdk.viewer.scene.imageryLayers.remove(this.entity),this.entity=null}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.length>0&&void 0!==l[0]&&l[0],!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Nl({},this.options.position):this.options.positions?r=Nl({},this.options.positions[0]):this.options.center?r=Nl({},this.options.center):this.options.start?r=Nl({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(r);case 17:r.alt=t.sent;case 18:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=26;break;case 25:this.sdk.viewer.flyTo(this.entity);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"amapMercatorTilingScheme",value:function(t){return new(function(t){function e(t){var i;k()(this,e),i=Bl(this,e,[t]);var n=new Cesium.WebMercatorProjection;return i._projection.project=function(t,e){return e=Pl.WGS84ToGCJ02(Cesium.Math.toDegrees(t.longitude),Cesium.Math.toDegrees(t.latitude)),e=n.project(new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))),new Cesium.Cartesian2(e.x,e.y)},i._projection.unproject=function(t,e){var i=n.unproject(t);return e=Pl.GCJ02ToWGS84(Cesium.Math.toDegrees(i.longitude),Cesium.Math.toDegrees(i.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(e[0]),Cesium.Math.toRadians(e[1]))},i}return sn()(e,t),_()(e)}(Cesium.WebMercatorTilingScheme))(t)}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"底图属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),se(s.sdk,s.options.id);var e=Ie();if(e&&e!=s.sdk)for(var i=0;i<e.viewer.imageryLayers._layers.length;i++){var n=e.viewer.imageryLayers._layers[i];if(n._id&&n._id==s.options.id){n.alpha=s.options.alpha;break}}},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">透明度:</span>\n <input type="range" class="alpha" min="0" max="1" step="0.01">\n </div>\n </div>\n </div>\n ',e.innerHTML=i,n=e.getElementsByClassName("name")[0],o=e.getElementsByClassName("alpha")[0],n.value=this.name,o.value=this.alpha,n.addEventListener("input",(function(){s.name=n.value})),o.addEventListener("input",(function(){s.alpha=o.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n],this._elms.alpha=[o];case 19:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){(this.entity||this._DialogObject)&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.alpha=this.options.alpha,this.brightness=this.options.brightness)}},{key:"flicker",value:function(){}}]);var i,n}(Ol);function jl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Il=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),jl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createArcGis",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=6;break}return t.next=3,Cesium.ArcGisMapServerImageryProvider.fromUrl(e);case 3:i=t.sent,t.next=7;break;case 6:i=new Cesium.ArcGisMapServerImageryProvider({url:e});case 7:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(i),this.entity._id=this.options.id,n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)&&(o=this.sdk.viewer.imageryLayers._layers[n],this.sdk.viewer.imageryLayers.raiseToTop(o));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Kt(0,this.options.id);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}]);var i}(Al),Rl=function(t){function e(t,i){var n;return k()(this,e),(n=jl(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),n}return sn()(e,t),_()(e)}(Il),Fl=function(t){function e(t,i){var n;return k()(this,e),(n=jl(this,e,[t,i])).createArcGis("https://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"),n}return sn()(e,t),_()(e)}(Il),zl=function(t){function e(t,i){var n;return k()(this,e),(n=jl(this,e,[t,i])).createArcGis("https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"),n}return sn()(e,t),_()(e)}(Il);function Hl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Vl=function(t){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),Hl(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"createGD",value:function(t){var e=new Cesium.UrlTemplateImageryProvider({url:t,minimumLevel:3,maximumLevel:18,tilingScheme:this.amapMercatorTilingScheme()});this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var i=0;i<this.sdk.viewer.imageryLayers._layers.length;i++)if(this.sdk.viewer.imageryLayers._layers[i]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type)){var n=this.sdk.viewer.imageryLayers._layers[i];this.sdk.viewer.imageryLayers.raiseToTop(n)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Kt(0,this.options.id)}}])}(Al),Gl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Hl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8"),i}return sn()(e,t),_()(e)}(Vl),Ul=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Hl(this,e,[t,n])).createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Vl),Wl=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Hl(this,e,[t,n])).createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}"),i}return sn()(e,t),_()(e)}(Vl);function Yl(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Jl(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Jl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Jl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ql(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xl(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ql(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ql(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Zl(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Kl(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function $l(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Ql(t,e){return t.get(tc(t,e))}function tc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var ec=new WeakMap,ic=function(t){function e(t,i){var n;return k()(this,e),$l(n=Zl(this,e,[t,i]),ec,void 0),n.setDefaultValue(),n.watchs=[],n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element_style=null,n.options.accuracy=i.accuracy?Number(i.accuracy.toFixed(1)):1,n.options.position=n.options.position||{},n.oldData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.roll||0,heading:n.options.heading||0,pitch:n.options.pitch||0},n.newData={id:n.options.id,transparency:n.options.transparency||0===n.options.transparency?n.options.transparency:1,name:n.options.name,accuracy:n.options.accuracy,url:n.options.url,height:n.options.position.alt||0,lng:n.options.position.lng,lat:n.options.position.lat,scale:n.options.scale||0===n.options.scale?n.options.scale:1,roll:n.options.roll||0,heading:n.options.heading||0,pitch:n.options.pitch||0},n.tileset=void 0,n.editObj=new Jo(n.sdk),n.editObj.controllerCallBack=n.rotationEditingCallBack,n}return sn()(e,t),_()(e,[{key:"add",value:(s=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTileset({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTileset(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"loadSceneTree",value:function(){}},{key:"loadTileset",value:(n=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Xl({},e),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,t.next=5,fetch(n,{method:"get",headers:{"Content-Type":"application/json"}});case 5:if(200!==(s=t.sent).status){t.next=10;break}return t.next=9,s.json();case 9:this.tileset=t.sent;case 10:if(r={show:this.options.show,skipLevelOfDetail:!0,baseScreenSpaceError:1024,maximumScreenSpaceError:32,skipScreenSpaceErrorFactor:16,skipLevels:1,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!0,cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,preloadWhenHidden:!1,preferLeaves:!0,maximumCacheOverflowBytes:128,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.1,dynamicScreenSpaceErrorFactor:1,dynamicScreenSpaceError:!0},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=19;break}return t.next=14,Cesium.Cesium3DTileset.fromUrl(n,r);case 14:l=t.sent,this.entity=l,this.entity.imageBasedLighting.luminanceAtZenith=.1,t.next=25;break;case 19:return r.url=n,l=new Cesium.Cesium3DTileset(r),t.next=23,l.readyPromise;case 23:this.entity=t.sent,this.entity.imageBasedLighting.luminanceAtZenith=.1;case 25:return t.next=27,this.loadSceneTree(n);case 27:if(c=function(t){if(t._contents)for(var e=0;e<t._contents.length;e++)c(t._contents[e]);else for(var i=0;i<t.featuresLength;i++){var n=t.getFeature(i),o=n.content.url,s=n.getProperty("id");if(m.features.has(s))if(m.features.get(s).features){if(m.features.get(s).features[o]){if(m.features.get(s).features[o].customColor&&(n.color=m.features.get(s).features[o].customColor,n.customColor=m.features.get(s).features[o].customColor),m.features.get(s).features[o].customAlpha){var a=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(m.features.get(s).features[o].customAlpha,")")),n.customAlpha=m.features.get(s).features[o].customAlpha}m.features.get(s).features[o].customShow&&(n.show=m.features.get(s).features[o].customShow,n.customShow=m.features.get(s).features[o].customShow)}m.features.get(s).features[o]=n}else{var r={};if(m.features.get(s).customColor&&(n.color=m.features.get(s).customColor,n.customColor=m.features.get(s).customColor),m.features.get(s).customAlpha){var l=n.color;n.color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(l.red),",").concat(Cesium.Color.floatToByte(l.green),",").concat(Cesium.Color.floatToByte(l.blue),",").concat(m.features.get(s).customAlpha,")")),n.customAlpha=m.features.get(s).customAlpha}m.features.get(s).customShow&&(n.show=m.features.get(s).customShow,n.customShow=m.features.get(s).customShow),r[o]=n,m.features.get(s).features=r}else{var u={};u[o]=n,m.features.set(s,{features:u})}n.customColor||(n.customColor=Cesium.Color.fromCssColorString("#ffffff"))}},this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=30;break}return t.abrupt("return");case 30:l.tileLoad.addEventListener((function(t){var e,i,n;c(t._content),clearTimeout(Ql(ec,m)),e=ec,i=m,n=setTimeout((function(){clearTimeout(Ql(ec,m));var t,e=m.cartesian3Towgs84(l.boundingSphere.center,m.sdk.viewer),i=turf.circle([e.lng,e.lat],l.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),n=Yl(m.sdk.entityMap);try{for(n.s();!(t=n.n()).done;){var o=y()(t.value,2),s=(o[0],o[1]);if("BillboardObject"===s.type&&3==s.heightMode){var a=turf.point([s.lng,s.lat]);turf.booleanPointInPolygon(a,i)&&s.updateHeight()}else s.label&&(s.label.show=s.label.show)}}catch(t){n.e(t)}finally{n.f()}}),500),e.set(tc(e,i),n)})),this.entity._root.originalTransform=Xl({},this.entity._root.transform),this.entity.id=this.options.id||this.randomString(),this.entity.type=this.type,this.sdk.viewer.scene.primitives.add(l),!this.options.position||"{}"==JSON.stringify(this.options.position)||!this.options.position.lng&&0!==this.options.position.lng||!this.options.position.lat&&0!==this.options.position.lat?(this.options.position={},d=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(d=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(d.longitude),lat:this.oldData.lat=Cesium.Math.toDegrees(d.latitude),height:d.height},this.lng=this.oldData.lng=Cesium.Math.toDegrees(d.longitude),this.lat=this.oldData.lat=Cesium.Math.toDegrees(d.latitude),this.height=this.oldData.height=d.height):(this.options.position.alt,this.options.position.alt,u=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center),this.tileset.root.transform&&(u=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]})),this.entity.original={lng:Cesium.Math.toDegrees(u.longitude),lat:Cesium.Math.toDegrees(u.latitude),height:u.height},p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt)),h=Cesium.Matrix4.fromUniformScale(this.oldData.scale),this.tileset.root.transform&&Cesium.Matrix4.multiply(p,h,this.entity._root.transform),this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.height=this.oldData.height),this.scale=this.oldData.scale,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.transparency=this.oldData.transparency,se(this.sdk,this.options.id),ft(this.entity.id,this.mouseMoveCB,this);case 43:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"remove",value:function(){Kl(e,"remove",this,3)([]),this.editObj.destroy(),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:function(){Kl(e,"flyTo",this,3)([])}},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Kl(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"position",get:function(){var t=Cesium.Cartographic.fromCartesian(this.entity.boundingSphere.center);this.tileset.root.transform&&(t=Cesium.Cartographic.fromCartesian({x:this.tileset.root.transform[12],y:this.tileset.root.transform[13],z:this.tileset.root.transform[14]}));var e=Cesium.Math.toDegrees(t.longitude+6.63814e-9),i=Cesium.Math.toDegrees(t.latitude+2.5137835e-7);return this.newData.lng&&this.newData.lat&&this.newData.height?{lng:this.newData.lng,lat:this.newData.lat,height:this.newData.height}:{lng:e,lat:i,height:t.height-2.19104611043234}},set:function(t){}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(t){if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");t?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editRtation()):this.editObj.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.editObj.getActiveState()},set:function(t){if(this.sdk&&this.sdk.viewer&&this.entity)return this.tileset.root.transform?void(t?(this.editObj.position={lng:this.newData.lng,lat:this.newData.lat,alt:this.newData.height},this.editObj.update(),this.editObj.editTranslational()):this.editObj.destroy()):(window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!"))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e,i){t.lng=e.position.lng,t.lat=e.position.lat,t.height=e.position.alt,t.roll=e.rotate.x,t.heading=e.rotate.y,t.pitch=e.rotate.z}},set:function(t){this._rotationEditingCallBack=t}},{key:"flicker",value:function(){}},{key:"edit",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"show",get:function(){return this.options.show},set:function(t){var e=this;"boolean"==typeof t?(this.options.show=t,this.entity&&(this.entity.show=t),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),this.options.label&&this.options.label.show&&this.label&&(this.label.show=t),setTimeout((function(){var t,i=e.cartesian3Towgs84(e.entity.boundingSphere.center,e.sdk.viewer),n=turf.circle([i.lng,i.lat],e.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=Yl(e.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,n)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}Pe(e.sdk,e.options.id),se(e.sdk,e.options.id)}),300)):console.error("参数必须为boolean")}}]);var i,n,s}(Ol);function nc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return oc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?oc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function oc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function sc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ac(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):sc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function rc(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function lc(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function cc(t,e,i){return t.set(pc(t,e),i),i}function uc(t,e){return t.get(pc(t,e))}function pc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var hc=new WeakMap,dc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),lc(i=rc(this,e,[t,n]),hc,void 0),i.picking=!1,i.Dialog=o,i._elms={},i._EventBinding=new wn,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"tileset"}},{key:"on",value:function(){return this.add()}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.options.position.alt=t,this._elms.height&&this._elms.height.forEach((function(e){e.value=t})),this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"accuracy",get:function(){return this.newData.accuracy},set:function(t){var e=this;this.newData.accuracy=Number(t.toFixed(1)),this.newData.accuracy<.1&&(this.newData.accuracy=.1),this.entity&&(this.entity.maximumScreenSpaceError=32/this.newData.accuracy),this._elms.accuracy&&this._elms.accuracy.forEach((function(t){t.value=e.newData.accuracy}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.options.position.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.options.position.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch)}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale)}},{key:"transparency",get:function(){return this.newData.transparency},set:function(t){if(this.newData){this.newData.transparency=Number(t),this._elms.transparency&&this._elms.transparency.forEach((function(e){e.value=t}));var e=this.newData.transparency;this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+e+")"],["true","color('rgba(255,255,255,"+e+")')"]]},show:!0})}}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 420px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 45px;\n }\n",t.next=11,new rn(this.sdk,this.newData,{title:"倾斜模型属性",left:"180px",top:"100px",confirmCallBack:function(t){o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.transparency=o.newData.transparency,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o.oldData.type=o.type,o.oldData.accuracy=o.newData.accuracy,o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(ac(ac({},o.oldData),{},{type:o.type})),se(o.sdk,o.oldData.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing&&(o.positionEditing=!1),o.rotationEditing&&(o.rotationEditing=!1),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}},!0);case 11:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">精度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0.1" max="10" step="0.1" @model="accuracy">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">透视</span>\n <input type="range" min="0" max="1" step="0.01" @model="transparency">\n </div>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(uc(hc,this)),cc(hc,this,setTimeout((function(){clearTimeout(uc(hc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=nc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"reset",value:function(){this.editObj.destroy(),this.entity&&(this.transparency=this.oldData.transparency,this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale,this.accuracy=this.oldData.accuracy,this.entity.style=new Cesium.Cesium3DTileStyle({color:{conditions:[["Boolean(${SIZE})","${COLOR} * color('rgba(255,255,255)', "+this.transparency+")"],["true","color('rgba(255,255,255,"+this.transparency+")')"]]},show:!0}))}}]);var i}(ic);function mc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return fc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?fc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function vc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?vc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):vc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function yc(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function bc(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Cc(t,e,i){return t.set(kc(t,e),i),i}function wc(t,e){return t.get(kc(t,e))}function kc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var xc=new WeakMap,_c=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),bc(i=yc(this,e,[t,n]),xc,void 0),i.picking=!1,i.features=n.features||[],i.exportStateArray=[],i.Dialog=o,i._elms={},i._EventBinding=new wn,i.Dialog.exportState=function(t){i.exportState(t)},i.Dialog.exportProperty=function(t){i.exportProperty(i.exportStateArray)},i.features=new Map,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"bim"}},{key:"name",get:function(){return this.newData.name},set:function(t){this.newData.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.newData.lng},set:function(t){this.newData.lng=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.newData.lat},set:function(t){this.newData.lat=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.newData.height},set:function(t){this.newData.height=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"roll",get:function(){return this.newData.roll},set:function(t){this.newData.roll=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.roll&&this._elms.roll.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.newData.heading},set:function(t){this.newData.heading=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.heading&&this._elms.heading.forEach((function(e){e.value=t}))}},{key:"pitch",get:function(){return this.newData.pitch},set:function(t){this.newData.pitch=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.newData.scale},set:function(t){this.newData.scale=t,this.updateModel(this.newData.lng,this.newData.lat,this.newData.height,this.newData.roll,this.newData.heading,this.newData.pitch,this.newData.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"loadSceneTree",value:(r=o()(a.a.mark((function t(e){var i,n=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=e.split("/"))[i.length-1]="scenetree.json",t.next=4,Cesium.Resource.fetchJson({url:i.join("/")}).then((function(t){n.scenetree=t;var e=function(t){t.forEach((function(t){n.features.has(t.id)?n.features.get(t.id).sphere=t.sphere:n.features.set(t.id,{sphere:t.sphere}),t.children&&e(t.children)}))};e(t.scenes[0].children)}));case 4:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new rn(this.sdk,this.newData,{title:"BIM模型属性",left:"180px",top:"100px",resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.oldData.name=o.newData.name,o.oldData.height=o.newData.height,o.oldData.lng=o.newData.lng,o.oldData.lat=o.newData.lat,o.oldData.scale=o.newData.scale,o.oldData.roll=o.newData.roll,o.oldData.heading=o.newData.heading,o.oldData.pitch=o.newData.pitch,o._DialogObject.close();var e=new Map;o.features.forEach((function(t,i){var n=gc({},t);delete n.features,e.set(i,n)})),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(gc(gc({},o.oldData),{},{features:e,type:o.type})),se(o.sdk,o.oldData.id)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.editObj.destroy(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.newData.show=t,o.entity&&(o.entity.show=t),o.Dialog.showCallBack&&o.Dialog.showCallBack()},rotateCallBack:function(){o.rotationEditing?o.rotationEditing=!1:o.rotationEditing=!0},translationalCallBack:function(){o.positionEditing?o.positionEditing=!1:o.positionEditing=!0}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" tileset-bim",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">x轴</span>\n <input type="number" title="" min="-180" max="180" @model="roll">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">y轴</span>\n <input type="number" title="" min="-180" max="180" @model="heading">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">z轴</span>\n <input type="number" title="" min="-180" max="180" @model="pitch">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">大小</span>\n <input type="range" max="10" min="0.1" step="0.1" @model="scale">\n <div class="input-number" style="width: 100px;margin-left: 10px;">\n <input type="number" title="" min="0" max="10" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n \n </div>\n </div>\n </div>\n \n <div class="divide">\n <div class="line"></div>\n <p>BIM属性导出选项</p>\n <div class="line"></div>\n </div>\n <div class="row">\n <div style="display: flex;">\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="3">\n <span>修建中</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="2">\n <span>未完成</span>\n </div>\n <div class="checkbox-box" @click="exportState">\n <input type="checkbox" value="1">\n <span>已完成</span>\n </div>\n </div>\n <div class="col">\n <button @click="exportProperty">导 出</button>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"featureEdit",value:(n=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}o=function(t){var e='<div class="row property-item">\n <div class="col">\n <input class="input_lable" name="key" value="'.concat(t.key,'">\n <input class="input" name="value" value="').concat(t.value,'">\n <button class="btn add">+</button>\n <button class="btn delete">-</button>\n </div>\n </div>'),i=document.createElement("div");i.innerHTML=e;var s=i.getElementsByClassName("property-item")[0],a=s.querySelector("input[name='key']"),l=s.querySelector("input[name='value']"),c=s.getElementsByClassName("add")[0],p=s.getElementsByClassName("delete")[0];a.addEventListener("input",(function(e){t.key=e.target.value})),l.addEventListener("input",(function(e){t.value=e.target.value})),c.addEventListener("click",(function(){var t={id:n.randomString(),key:"点击此处可编辑",value:""};r.descriptions.push(t),o(t)})),p.addEventListener("click",(function(e){for(var i=0;i<r.descriptions.length;i++)if(r.descriptions[i].id===t.id){r.descriptions.splice(i,1);break}u.removeChild(s)})),u.appendChild(s)},s=i.getProperty("name"),r={id:i.getProperty("id"),name:s,state:i.getProperty("state")||0,descriptions:i.getProperty("descriptions")||[{id:this.randomString(),key:"点击此处可编辑",value:""}]},t.t0=i.getProperty("state"),t.next="0"===t.t0?10:"1"===t.t0?12:"2"===t.t0?14:"3"===t.t0?16:18;break;case 10:return r.stateCH="",t.abrupt("break",18);case 12:return r.stateCH="已完成",t.abrupt("break",18);case 14:return r.stateCH="未完成",t.abrupt("break",18);case 16:return r.stateCH="修建中",t.abrupt("break",18);case 18:return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 440px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: 0 0 110px;\n }\n .col:first-child {\n margin-right: 10px;\n }\n .col:last-child {\n margin-left: 10px;\n }\n .YJ-custom-base-dialog>.content .divide {\n position: relative;\n display: flex;\n align-items: center;\n margin: 20px 0;\n }\n .YJ-custom-base-dialog>.content .divide .line{\n height: 1px;\n background: #ddd;\n flex: 1;\n }\n .YJ-custom-base-dialog>.content .divide p{\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .property .property-item .btn{\n font-size: 24px;\n line-height: 20px;\n padding: 2px 0;\n }\n .YJ-custom-base-dialog>.content .property .property-item .input_lable {\n flex: 0 0 115px;\n border: none;\n margin-right: 15px;\n text-align: right;\n }\n .YJ-custom-base-dialog>.content .property .property-item:first-child .delete{\n display: none\n }\n .YJ-custom-base-dialog>.content .property .property-item .add{\n display: none;\n }\n .YJ-custom-base-dialog>.content .property .property-item:last-child .add{\n display: inline-block;\n }\n",t.next=24,new W(this.sdk.viewer._container,{title:this.oldData.name+"-----设置状态",left:"calc(50% - 200px)",top:"calc(50% - 200px)",closeCallBack:function(){m.Dialog.closeCallBack&&m.Dialog.closeCallBack()}});case 24:return this._DialogObject=t.sent,t.next=27,this._DialogObject.init();case 27:for(document.getElementsByTagName("head")[0].appendChild(this._element_style),(l=document.createElement("div")).innerHTML='\n <div class="row">\n <div class="col">\n <span class="label">构件名称</span>\n <input class="input" name="name" disabled="disabled">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">选择状态</span>\n <select class="input input-select" name="state-select">\n <option value="0" style="color: #000;">重置</option>\n <option value="1" style="color: #f00;">已完成</option>\n <option value="2" style="color: #0f0;">未完成</option>\n <option value="3" style="color: #00f;">修建中</option>\n </select>\n </div>\n </div>\n <div class="divide">\n <div class="line"></div>\n <p>自定义属性</p>\n <div class="line"></div>\n </div>\n <div class="property">\n </div>\n ',l.querySelector("input[name='name']").value=s,(c=l.querySelector("select[name='state-select']")).value=r.state,c.addEventListener("change",(function(t){switch(r.state=t.target.value,r.state){case"0":r.stateCH="";break;case"1":r.stateCH="已完成";break;case"2":r.stateCH="未完成";break;case"3":r.stateCH="修建中"}})),u=l.getElementsByClassName("property")[0],p=0;p<r.descriptions.length;p++)o(r.descriptions[p],p);h=this._DialogObject._element.foot.getElementsByClassName("translational")[0],this._DialogObject.contentAppChild(l),(d=document.createElement("button")).className="confirm",d.innerHTML="确认",this._DialogObject.footAppChild(d,h),d.addEventListener("click",(function(){for(var t=!1,e=0;e<m.features.length;e++)if(m.features[e].id==r.id){m.features[e]=r,t=!0;break}t||m.features.push(r),i.setProperty("state",r.state),i.setProperty("descriptions",r.descriptions);var n="#fff";switch(r.state){case"0":n="#fff";break;case"1":n="#f00";break;case"2":n="#0f0";break;case"3":n="#00f"}i.color=Cesium.Color.fromCssColorString(n),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(gc(gc({},m.newData),{},{features:m.features}))})),t.next=48;break;case 46:this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 48:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.oldData.name,this.height=this.oldData.height,this.lng=this.oldData.lng,this.lat=this.oldData.lat,this.roll=this.oldData.roll,this.heading=this.oldData.heading,this.pitch=this.oldData.pitch,this.scale=this.oldData.scale)}},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;if(!this.tileset.root.transform)return window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"该模型不支持移动和旋转!",type:"warning",duration:1500})),void console.warn("该模型不支持移动和旋转!");if(!(!t&&0!==t||!e&&0!==e||!i&&0!==i)){var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,f);var v=Cesium.Matrix4.fromUniformScale(r);Cesium.Matrix4.multiply(f,v,this.entity._root.transform),this.editObj.activeAxis||(this.editObj.position={lng:t,lat:e,alt:i}),this.editObj.activeCircle||(this.editObj.rotate={x:o,y:s,z:a}),this.editObj&&this.editObj.update(),clearTimeout(wc(xc,this)),Cc(xc,this,setTimeout((function(){clearTimeout(wc(xc,n));var t,e=n.cartesian3Towgs84(n.entity.boundingSphere.center,n.sdk.viewer),i=turf.circle([e.lng,e.lat],n.entity.boundingSphere.radius/1e3,{steps:360,units:"kilometers"}),o=mc(n.sdk.entityMap);try{for(o.s();!(t=o.n()).done;){var s=y()(t.value,2),a=(s[0],s[1]);if("BillboardObject"===a.type&&3==a.heightMode){var r=turf.point([a.lng,a.lat]);turf.booleanPointInPolygon(r,i)&&a.updateHeight()}else a.label&&(a.label.show=a.label.show)}}catch(t){o.e(t)}finally{o.f()}}),300))}}},{key:"getScenetree",value:function(){return this.scenetree}},{key:"featureColor",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].color=Cesium.Color.fromCssColorString(e)),i[n].customColor=Cesium.Color.fromCssColorString(e);this.features.get(t).customColor=Cesium.Color.fromCssColorString(e)}}},{key:"getFeatureColor",value:function(t){if(this.features.has(t)){if(this.features.get(t).customColor)return this.features.get(t).customColor;var e=this.features.get(t).features;for(var i in e)if(e[i].content._model)return e[i].customColor||e[i].color}}},{key:"featureShow",value:function(t,e){if(this.features.has(t)){var i=this.features.get(t).features;for(var n in i)i[n].content._model&&(i[n].show=e),i[n].customShow=e;this.features.get(t).customShow=e}}},{key:"featureFlyto",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.features.has(e)?(i=this.features.get(e).sphere,n=new Cesium.Cartesian3(i[0],i[1],i[2]),o=this.entity._root.originalTransform,o=Cesium.Matrix4.inverse(o,new Cesium.Matrix4),s=this.entity._root.transform,r=Cesium.Matrix4.multiply(s,o,new Cesium.Matrix4),l=Cesium.Matrix4.multiplyByPoint(r,n,new Cesium.Cartesian3),c=this.cartesian3Towgs84(l,this.sdk.viewer),u=Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt+i[3]),pi(0),ii(this.sdk),ni(this.sdk),this.sdk.viewer.camera.flyTo({destination:u}),this.features.forEach((function(t,i){if(i===e){var n=p.getFeatureColor(e);if(p.features.has(e)&&n){var o=p.features.get(e).features;for(var s in o)o[s].content._model&&(o[s].color=n),o[s].customAlpha=1;p.features.get(e).customAlpha=1}}else{var a=p.getFeatureColor(i);if(p.features.has(i)&&a){var r=p.features.get(i).features;for(var l in r)r[l].content._model&&(r[l].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(a.red),",").concat(Cesium.Color.floatToByte(a.green),",").concat(Cesium.Color.floatToByte(a.blue),",").concat(.2*a.alpha,")"))),r[l].customAlpha=.2*a.alpha;p.features.get(i).customAlpha=.2*a.alpha}}}))):this.features.forEach((function(t,e){var i=p.features.get(e).features,n=p.getFeatureColor(e);if(n){for(var o in i)i[o].content._model&&(i[o].color=n),i[o].customAlpha=1;p.features.get(e).customAlpha=.2*n.alpha}}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"exportProperty",value:function(t){if(0!==this.exportStateArray.length){for(var e,i=["name","","","","","","","","","","","","stateCH","descriptions"],n='<Worksheet ss:Name="{nameWS}"><Table><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="120"/><ss:Column ss:Width="240"/>{rows}</Table></Worksheet>',o=function(t,e){return t.replace(/{(\w+)}/g,(function(t,i){return e[i]}))},s="",a="",r="",l=0;l<this.features.length;l++)for(var c=0;c<t.length;c++)if(this.features[l].state==t[c]){for(var u in 0==l&&(r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>'),r+="<Row>",i){if(Array.isArray(this.features[l][i[u]])){var p="";for(var h in this.features[l][i[u]])p+="".concat(this.features[l][i[u]][h].key+":"+this.features[l][i[u]][h].value," ");s={nameType:"String",data:p}}else s={nameType:"String",data:this.features[l][i[u]]||"0"};r+=o('<Cell><Data ss:Type="{nameType}">{data}</Data></Cell>',s)}r+="</Row>",l>0&&l/6e4%1==0&&(a+=o(n,s={rows:r,nameWS:"Sheet"+l}),r="",r+='<Row><Cell><Data ss:Type="String">构件名称</Data></Cell><Cell><Data ss:Type="String">体积</Data></Cell><Cell><Data ss:Type="String">墩全高H</Data></Cell><Cell><Data ss:Type="String">墩身高h</Data></Cell><Cell><Data ss:Type="String">底部高程</Data></Cell><Cell><Data ss:Type="String">承台宽</Data></Cell><Cell><Data ss:Type="String">承台长</Data></Cell><Cell><Data ss:Type="String">承台高</Data></Cell><Cell><Data ss:Type="String">族</Data></Cell><Cell><Data ss:Type="String">桩径</Data></Cell><Cell><Data ss:Type="String">桩长</Data></Cell><Cell><Data ss:Type="String">结构材质</Data></Cell><Cell><Data ss:Type="String">完成情况</Data></Cell><Cell><Data ss:Type="String">自定义属性</Data></Cell></Row>')}a+=o(n,s={rows:r,nameWS:"Sheet"}),r="",e=o('<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>Axel Richter</Author><Created>{created}</Created></DocumentProperties><Styles><Style ss:ID="Currency"><NumberFormat ss:Format="Currency"></NumberFormat></Style><Style ss:ID="Date"><NumberFormat ss:Format="Medium Date"></NumberFormat></Style></Styles>{worksheets}</Workbook>',s={created:(new Date).getTime(),worksheets:a});var d,m=document.createElement("A");m.href="data:application/vnd.ms-excel;base64,"+(d=e,window.btoa(unescape(encodeURIComponent(d)))),m.download=this.oldData.name+"--构件属性.xls",m.target="_blank",document.body.appendChild(m),m.click(),document.body.removeChild(m)}else window.ELEMENT&&window.ELEMENT.Message({message:"未选择属性导出选项!",type:"warning",duration:1500})}},{key:"exportState",value:function(t){var e=t.target.getElementsByTagName("input")[0];if(e.checked=!e.checked,e.checked)this.exportStateArray.push(e.value),this.exportStateArray=Array.from(new Set(this.exportStateArray));else for(var i=0;i<this.exportStateArray.length;i++)if(this.exportStateArray[i]==e.value){this.exportStateArray.splice(i,1);break}}}]);var i,n,s,r}(ic);function Ec(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最大比例</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">最小像素</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-99999" max="9999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 60px;">固定大小</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <p class="lable-left-line">旋转</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n \n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box">\n <input type="checkbox">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="99999" min="0" step="1">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="0" max="99999" step="1">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <p class="lable-left-line">高度</p>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="flex: 1;margin-right: 15px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input style="width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n \n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Sc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Dc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Sc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Sc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Pc=function(){return _()((function t(e,i){k()(this,t),this.sdk=e,this.model=i,this.activeAxis,this.activeCircle,this.activeModelParam,this.origin,this.rayX,this.rayY,this.rayZ,this.arrow={},this.activeState,this.coordArrows=[],this.coordCircles=[],this.originalMatrix=Dc({},i.modelMatrix),this.model.rotate||(this.model.rotate={x:0,y:0,z:0}),this.initParam(),this.MapEvent=new X(this.sdk)}),[{key:"initParam",value:function(){var t=Cesium.Cartographic.fromCartesian(this.model.position),e=Cesium.Math.toDegrees(t.longitude),i=Cesium.Math.toDegrees(t.latitude),n=t.height;return this._params={tx:e,ty:i,tz:n,rx:this.model.rotate.x,ry:this.model.rotate.y,rz:this.model.rotate.z},Dc({lng:e,lat:i,alt:n,h:n},this.model.rotate)}},{key:"editTranslational",value:function(){var t=this;this.destroy(),this.activeState="translational",this.MapEvent=new X(this.sdk);var e=this,i=this.initParam(),n=i.lng,o=i.lat,s=i.h,a=this.sdk.viewer;this.origin=Cesium.Cartesian3.fromDegrees(n,o,s);var r=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n-.001,o,s),new Cesium.Cartesian3),new Cesium.Cartesian3),l=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o-.001,s),new Cesium.Cartesian3),new Cesium.Cartesian3),c=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.origin,Cesium.Cartesian3.fromDegrees(n,o,s-1),new Cesium.Cartesian3),new Cesium.Cartesian3);this.rayX=new Cesium.Ray(this.origin,r),this.rayY=new Cesium.Ray(this.origin,l),this.rayZ=new Cesium.Ray(this.origin,c),this.arrow.positionX=Cesium.Ray.getPoint(this.rayX,0),this.arrow.positionY=Cesium.Ray.getPoint(this.rayY,0),this.arrow.positionZ=Cesium.Ray.getPoint(this.rayZ,0);var u=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(n,o,s)),p=a.camera.position,h=Cesium.Cartesian3.distance(p,this.origin)/15;Cesium.Matrix4.multiplyByScale(u,new Cesium.Cartesian3(h,h,h),u);var d=this.createAxisArrow("model_edit_xAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(1,0,0)],u,Cesium.Color.RED),m=this.createAxisArrow("model_edit_yAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,1,0)],u,Cesium.Color.LIME),f=this.createAxisArrow("model_edit_zAxis",[new Cesium.Cartesian3(0,.001,0),new Cesium.Cartesian3(0,0,1)],u,Cesium.Color.BLUE);a.scene.primitives.add(d),a.scene.primitives.add(m),a.scene.primitives.add(f),this.againArrow(),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againArrow,this);var v,g={x:0,y:0},y=0;this.MapEvent.mouse_move((function(t,i){!function t(i){if(e.activeAxis){var n=i.startPosition.y-i.endPosition.y,o={x:i.endPosition.x-g.x,y:i.endPosition.y-g.y},s=a.camera.getPickRay(o),r=a.scene.globe.pick(s,a.scene),l=new Cesium.Cartesian3,c=Cesium.Transforms.eastNorthUpToFixedFrame(a.camera.position);Cesium.Matrix4.inverse(c,c),Cesium.Matrix4.multiplyByPoint(c,r,l),Cesium.Cartesian3.normalize(l,l);var u=e.initParam(),p=90+Cesium.Math.toDegrees(Math.asin(l.z)),h=Cesium.Cartographic.fromCartesian(a.camera.position).height,d=e.activeModelParam.alt,m=h/Math.cos(Cesium.Math.toRadians(p));new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromCartesian(r),Cesium.Cartographic.fromCartesian(a.camera.position));r=Cesium.Ray.getPoint(s,m*(1-d/h));var f=Cesium.Cartographic.fromCartesian(r),b=Cesium.Math.toDegrees(f.longitude),C=Cesium.Math.toDegrees(f.latitude);switch(e.activeAxis._name){case"model_edit_xAxis":e._params.tx=b,e._params.ty=e.activeModelParam.lat,e._params.tz=d,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var w=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),k=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),x=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,w),e.rayY=new Cesium.Ray(e.origin,k),e.rayZ=new Cesium.Ray(e.origin,x);break;case"model_edit_yAxis":e._params.tx=e.activeModelParam.lng,e._params.ty=C,e._params.tz=d,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt);var _=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),E=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,u.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),S=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,_),e.rayY=new Cesium.Ray(e.origin,E),e.rayZ=new Cesium.Ray(e.origin,S);break;case"model_edit_zAxis":e.activeModelParam.alt+=Cesium.Cartesian3.distance(a.camera.position,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,u.alt))/4300*n*3,e._params.tx=e.activeModelParam.lng,e._params.ty=e.activeModelParam.lat,e._params.tz=e.activeModelParam.alt,e.origin=Cesium.Cartesian3.fromDegrees(u.lng,u.lat,e.activeModelParam.alt);var D=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng-.001,u.lat,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),P=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat-.001,e.activeModelParam.alt),new Cesium.Cartesian3),new Cesium.Cartesian3),M=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(e.origin,Cesium.Cartesian3.fromDegrees(u.lng,u.lat,e.activeModelParam.alt-1),new Cesium.Cartesian3),new Cesium.Cartesian3);e.rayX=new Cesium.Ray(e.origin,D),e.rayY=new Cesium.Ray(e.origin,P),e.rayZ=new Cesium.Ray(e.origin,M)}e.updateModel(e._params.tx,e._params.ty,e._params.tz,e._params.rx,e._params.ry,e._params.rz),e.againArrow()}else{var O=Date.now();if(O-y<100)return clearTimeout(v),void(v=setTimeout((function(){t(i)}),100));clearTimeout(v),y=O;for(var T=e.coordArrows,N=0;N<T.length;N++)if(T[N].getGeometryInstanceAttributes)switch(T[N]._name){case"model_edit_xAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":T[N].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}for(var B=a.scene.drillPick(i.endPosition,10),L=B.length-1;L>=0;L--){var A=B[L];if(A&&A.primitive&&A.id)switch(A.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return void(A.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}}}(t)})),this.MapEvent.mouse_left_down((function(i){var n=a.scene.cartesianToCanvasCoordinates(t.origin);g.x=i.position.x-Math.floor(n.x),g.y=i.position.y-Math.floor(n.y);for(var o=a.scene.drillPick(i.position,10),s=o.length-1;s>=0;s--){var r=o[s];if(r&&r.primitive&&r.primitive._name)if(e.activeAxis)e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack;else switch(r.primitive._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":return a.scene.screenSpaceCameraController.enableRotate=!1,e.activeAxis=r.primitive,e.activeModelParam=e.initParam(),void(r.primitive.appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.YELLOW}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}))}}})),this.MapEvent.mouse_left_up((function(t){a.scene.screenSpaceCameraController.enableRotate=!0;for(var i=0;i<e.coordArrows.length;i++)switch(e.coordArrows[i]._name){case"model_edit_xAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.RED}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_yAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.LIME}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}});break;case"model_edit_zAxis":e.coordArrows[i].appearance=new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:Cesium.Color.BLUE}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}})}e.activeAxis&&(e.activeAxis=null,e.activeModelParam=null,e.controllerCallBack)}))}},{key:"againArrow",value:function(){if(this.activeState&&"translational"==this.activeState&&this.origin){this.initParam(),this.origin=new Cesium.Cartesian3.fromDegrees(this._params.tx,this._params.ty,this._params.tz);for(var t=this.sdk.viewer.camera.position,e=Cesium.Cartesian3.distance(t,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordArrows,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_xAxis":case"model_edit_yAxis":case"model_edit_zAxis":Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(e,e,e),n[o].modelMatrix)}}}},{key:"againCircle",value:function(){if(this.activeState&&"rtation"==this.activeState&&this.origin){this.initParam();for(var t=this.sdk.viewer.camera.position,e=Cesium.Cartesian3.distance(t,this.origin)/15,i=Cesium.Transforms.eastNorthUpToFixedFrame(this.origin),n=this.coordCircles,o=0;o<n.length;o++)switch(n[o]._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":var s=e/20;Cesium.Matrix4.multiplyByScale(i,new Cesium.Cartesian3(s,s,s),n[o].modelMatrix),n[o]._radius=e}}}},{key:"editRtation",value:function(){this.destroy(),this.activeState="rtation",this.MapEvent=new X(this.sdk);var t=this.initParam();this.origin=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.h),this.createCircle(t.lng,t.lat,t.h,20),this.sdk.viewer.camera.percentageChanged=.001,this.sdk.viewer.camera.changed.addEventListener(this.againCircle,this)}},{key:"createCircle",value:function(t,e,i,n){for(var o=this,s=this.sdk.viewer,a=[],r=0;r<=360;r+=3){var l=Math.sin(Cesium.Math.toRadians(r)),c=n*Math.cos(Cesium.Math.toRadians(r)),u=n*l;a.push(new Cesium.Cartesian3(c,u,0))}var p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=s.camera.position,d=Cesium.Cartesian3.distance(h,this.origin)/15,m=d/n;Cesium.Matrix4.multiplyByScale(p,new Cesium.Cartesian3(m,m,m),p);var f=this.createAxisSphere("model_edit_zCircle",a,p,Cesium.Color.RED,d);s.scene.primitives.add(f);var v=this.createAxisSphere("model_edit_yCircle",a,p,Cesium.Color.BLUE,d);s.scene.primitives.add(v);var g=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(90)),y=Cesium.Matrix4.fromRotationTranslation(g);Cesium.Matrix4.multiply(v.geometryInstances.modelMatrix,y,v.geometryInstances.modelMatrix);var b=this.createAxisSphere("model_edit_xCircle",a,p,Cesium.Color.LIME,d);s.scene.primitives.add(b);var C=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(90)),w=Cesium.Matrix4.fromRotationTranslation(C);Cesium.Matrix4.multiply(b.geometryInstances.modelMatrix,w,b.geometryInstances.modelMatrix);var k,x=0;this.MapEvent.mouse_move((function(t){!function t(e){var i=Dc({},e.endPosition);if(o.activeCircle){var n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(s.scene,o.ciclkPosition),a=0,r=0,l=0;if(!n)return;var c=e.startPosition.y-i.y,u=e.startPosition.x-i.x;switch(o.activeCircle._name){case"model_edit_xCircle":r=1*u;break;case"model_edit_yCircle":a=1*c;break;case"model_edit_zCircle":l=1*u}o._params.rx-=a,o._params.rx>360&&(o._params.rx=1),o._params.rx<0&&(o._params.rx=360);Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o._params.rx));o._params.ry-=r,o._params.ry>360&&(o._params.ry=1),o._params.ry<0&&(o._params.ry=360);Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o._params.ry));o._params.rz-=l,o._params.rz>360&&(o._params.rz=1),o._params.rz<0&&(o._params.rz=360),o.updateModel(o._params.tx,o._params.ty,o._params.tz,o._params.rx,o._params.ry,o._params.rz)}else{var p=Date.now();if(p-x<100)return clearTimeout(k),void(k=setTimeout((function(){t(e)}),100));clearTimeout(k),x=p;for(var h=o.coordCircles,d=0;d<h.length;d++)if(h[d].getGeometryInstanceAttributes){var m=h[d].getGeometryInstanceAttributes(h[d]._name);switch(h[d]._name){case"model_edit_zCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":m.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}for(var f=s.scene.drillPick(e.endPosition,10),v=0;v<f.length;v++){var g=f[v];if(g&&g.primitive&&g.id&&g.primitive.getGeometryInstanceAttributes){var y=g.primitive.getGeometryInstanceAttributes(g.id);switch(g.primitive._name){case"model_edit_zCircle":case"model_edit_yCircle":case"model_edit_xCircle":return void(y.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value)}}}}}(t)})),this.MapEvent.mouse_left_down((function(t){var e=s.scene.pickPosition(t.position);o.ciclkPosition=e;for(var i=s.scene.drillPick(t.position,10),n=0;n<i.length;n++){var a=i[n];if(a&&a.primitive&&a.id)switch(a.primitive._name){case"model_edit_xCircle":case"model_edit_yCircle":case"model_edit_zCircle":return a.primitive.getGeometryInstanceAttributes(a.primitive._name).color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW).value,o.activeCircle=a.primitive,o.activeModelParam=o.initParam(),void(s.scene.screenSpaceCameraController.enableRotate=!1)}}o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0})),this.MapEvent.mouse_left_up((function(t){o.activeCircle=null,o.activeModelParam=null,s.scene.screenSpaceCameraController.enableRotate=!0;for(var e=o.coordCircles,i=0;i<e.length;i++)if(e[i].getGeometryInstanceAttributes){var n=e[i].getGeometryInstanceAttributes(e[i]._name);switch(e[i]._name){case"model_edit_zCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED).value;break;case"model_edit_yCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE).value;break;case"model_edit_xCircle":n.color=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.LIME).value}}}))}},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this._params.tx=t=parseFloat(parseFloat(t).toFixed(8)),this._params.ty=e=parseFloat(parseFloat(e).toFixed(8)),this._params.tz=i=parseFloat(parseFloat(i).toFixed(2)),this._params.rx=n=parseFloat(n),this._params.ry=o=parseFloat(o),this._params.rz=s=parseFloat(s),this.model.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.model.rotate={x:n,y:o,z:s};var a=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),r=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),l=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),c=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),u=Cesium.Matrix4.fromRotationTranslation(a),p=Cesium.Matrix4.fromRotationTranslation(r),h=Cesium.Matrix4.fromRotationTranslation(l),d=new Cesium.Matrix4;Cesium.Matrix4.multiply(c,u,d),Cesium.Matrix4.multiply(d,p,d),Cesium.Matrix4.multiply(d,h,this.model.modelMatrix),this.transformCallBack}},{key:"transformCallBack",get:function(){this._transformCallBack&&this._transformCallBack(this._params)},set:function(t){this._transformCallBack=t}},{key:"createAxisArrow",value:function(t,e,i,n){var o=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:20}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineArrowType,{color:n}),translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return o._name=t,this.coordArrows.push(o),o}},{key:"createAxisSphere",value:function(t,e,i,n,o){var s=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({id:t,geometry:new Cesium.PolylineGeometry({positions:e,width:5}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),releaseGeometryInstances:!1,appearance:new Cesium.PolylineColorAppearance({translucent:!0,renderState:{depthTest:{enabled:!1},depthMask:!1,depthFunction:Cesium.DepthFunction.ALWAYS}}),modelMatrix:i});return s._radius=o,s._name=t,this.coordCircles.push(s),s}},{key:"removeCoordArrows",value:function(){for(var t=0;t<this.coordArrows.length;t++)this.sdk.viewer.scene.primitives.remove(this.coordArrows[t]);this.coordArrows=[]}},{key:"removeCoordCircle",value:function(){for(var t=0;t<this.coordCircles.length;t++)this.sdk.viewer.scene.primitives.remove(this.coordCircles[t]);this.coordCircles=[]}},{key:"update",value:function(){this.againArrow(),this.againCircle()}},{key:"removeAllTools",value:function(){this.removeCoordArrows(),this.removeCoordCircle()}},{key:"destroy",value:function(){this.removeAllTools(),this.activeState=void 0,this.MapEvent&&this.MapEvent.destroy(),this.sdk.viewer.camera.changed.removeEventListener(this.againArrow),this.sdk.viewer.camera.changed.removeEventListener(this.againCircle)}},{key:"getActiveState",value:function(){return this.activeState}},{key:"getModel",value:function(){return this.model}},{key:"setModel",value:function(t){this.model=model}}])}();function Mc(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Oc=function(t){function e(t,i){return k()(this,e),Mc(this,e,[t,i])}return sn()(e,t),_()(e,[{key:"add",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=2;break}return t.abrupt("return",this.loadModel(this.options.url));case 2:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}}]);var i}(Ol);function Tc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Nc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Nc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Nc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Bc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Bc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Bc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ac(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function jc(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function Ic(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Rc(t,e,i){return t.set(zc(t,e),i),i}function Fc(t,e){return t.get(zc(t,e))}function zc(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Hc=new WeakMap,Vc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Ic(i=Ac(this,e,[t,n,o={}]),Hc,null),n.position?n.position.lng||0===n.position.lng?n.position.lat||0===n.position.lat?(i.options.earth&&delete i.options.earth,i.picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff","number"==typeof n.scale?(i.options.scale={},i.options.scale.x=n.scale,i.options.scale.y=n.scale,i.options.scale.z=n.scale):(i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.scale.z=i.options.scale.z||0===i.options.scale.z?i.options.scale.z:1),i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.position=n.position=n.position||{},i.options.position={lng:n.position.lng,lat:n.position.lat,alt:n.position.alt},i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera=i.options.attribute.camera.content||[],i.options.attribute.ISC=i.options.attribute.ISC||{},i.options.attribute.ISC.content=i.options.attribute.ISC.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.entity={id:i.options.id},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i.Dialog=o,i._EventBinding=new wn,i.on(),i):(console.warn("lat is required!"),tn()(i)):(console.warn("lng is required!"),tn()(i)):(console.warn("position is required!"),tn()(i))}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(l=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Pe(this.sdk,this.options.id),this.sdk&&this.sdk.viewer&&this.sdk.viewer.scene){t.next=3;break}return t.abrupt("return");case 3:if(e=this.replaceHost(e,this.options.host),this.originalOptions=this.deepCopyObj(this.options),i={id:this.options.id,url:e,show:this.options.show,maximumScale:this.options.scaleByDistance?void 0:this.options.maximumScale,minimumPixelSize:this.options.scaleByDistance?void 0:this.options.minimumPixelSize},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=13;break}return t.next=10,Cesium.Model.fromGltfAsync(i);case 10:this.entity=t.sent,t.next=16;break;case 13:return t.next=15,Cesium.Model.fromGltf(i);case 15:this.entity=t.sent;case 16:return this.entity.imageBasedLighting.luminanceAtZenith=.6,this.entity.color=Cesium.Color.fromCssColorString(this.options.color),t.next=20,this.sdk.viewer.scene.primitives.add(this.entity);case 20:n=Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),this.entity.position=o,this.entity.rotate=Lc({},this.options.rotate),this.entity.customScale=this.options.scale,this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),Number(Cesium.VERSION.split(".")[1])>=107?(this.entity.readyEvent.addEventListener((function(){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Pc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new no(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far},s.entity)),s.entity.isMove=!0,clearTimeout(Fc(Hc,s)),Rc(Hc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500))})),this.activeAnimate=this.options.activeAnimate,this.modelAnimations=this.entity.loader.components.animations):this.entity.readyPromise.then((function(t){s.entity.originalBoundingSphereRadius=s.entity.boundingSphere.radius,s.editObj=new Pc(s.sdk,s.entity),s.editObj.transformCallBack=s.rotationEditingCallBack,s.updateModel(s.options.position.lng,s.options.position.lat,s.options.position.alt,s.options.rotate.x,s.options.rotate.y,s.options.rotate.z,s.options.scale),s.label||(s.label=new no(s.sdk,{id:s.options.id,show:!!s.options.show&&s.options.label.show,position:[s.options.position.lng,s.options.position.lat,s.options.position.alt],text:s.options.name,fontSize:s.options.label.fontSize,fontFamily:s.options.label.fontFamily?s.options.label.fontFamily:0,color:s.options.label.color,pixelOffset:s.options.label.pixelOffset,backgroundColor:s.options.label.backgroundColor,lineColor:s.options.label.lineColor,lineWidth:s.options.label.lineWidth,scaleByDistance:s.options.label.scaleByDistance,near:s.options.label.near,far:s.options.label.far,ground:!1},s.entity)),s.entity.isMove=!0,clearTimeout(Fc(Hc,s)),Rc(Hc,s,setTimeout((function(){s.entity&&(s.entity.isMove=!1)}),500)),s.activeAnimate=s.options.activeAnimate,s.modelAnimations=s.entity.loader.components.animations})),se(this.sdk,this.options.id);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"getModelAnimations",value:(r=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){Number(Cesium.VERSION.split(".")[1])>=107?e.entity.readyEvent.addEventListener((function(){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)})):e.entity.readyPromise.then((function(i){e.modelAnimations=e.entity.loader.components.animations,t(e.modelAnimations)}))})));case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"remove",value:function(){jc(e,"remove",this,3)([]),this.label&&this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Lc({},this.options.position):this.options.positions?r=Lc({},this.options.positions[0]):this.options.center?r=Lc({},this.options.center):this.options.start?r=Lc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:Number(Cesium.VERSION.split(".")[1])>=107?this.entity.ready&&(l=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt),this.entity.originalBoundingSphereRadius*this.options.scale.z*2),this.sdk.viewer.camera.flyToBoundingSphere(l)):this.entity.readyPromise.then((function(){var t=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(c.options.position.lng,c.options.position.lat,c.options.position.alt),(c.entity.originalBoundingSphereRadius||c.entity.boundingSphere.radius)*c.options.scale.z*2);c.sdk.viewer.camera.flyToBoundingSphere(t)}));case 23:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){jc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position={lng:t,lat:this.options.position.lat,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position={lng:this.options.position.lng,lat:t,alt:this.options.position.alt},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt]),this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:t},this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[Number(this.options.position.lng),Number(this.options.position.lat),Number(this.options.position.alt)]),this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.options.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(2)),this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label&&(this.label.show=t):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label&&(this.label.lineWidth=t),this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label&&(this.label.pixelOffset=t),this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label&&(this.label.lineColor=t),this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label&&(this.label.backgroundColor=[t,this.label.backgroundColor[1]]),this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label&&(this.label.backgroundColor=[this.label.backgroundColor[0],t]),this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Tc(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Tc(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Tc(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Tc(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"rotationEditing",get:function(){return"rtation"===this.editObj.getActiveState()},set:function(t){t?this.editObj&&this.editObj.editRtation():this.editObj&&this.editObj.destroy()}},{key:"positionEditing",get:function(){return!(!this.editObj||"translational"!==this.editObj.getActiveState())},set:function(t){this.sdk&&this.sdk.viewer&&this.entity&&(t?(this.leftClickState=vt(),this.editObj&&this.editObj.editTranslational(),new ht(this.sdk)):(this.leftClickState&&!vt()&&new pt(this.sdk),this.editObj&&this.editObj.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.lng=e.tx,t.lat=e.ty,t.alt=e.tz,t.rotateX=e.rx,t.rotateY=e.ry,t.rotateZ=e.rz,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.editObj._params)}},set:function(t){this._rotationEditingCallBack=t}},{key:"activeAnimate",get:function(){return this.options.activeAnimate},set:function(t){if(this.options.activeAnimate=t,this.entity&&this.entity.loader.components&&this.modelAnimations&&(this.entity.activeAnimations.removeAll(),this.modelAnimations&&this.modelAnimations.length>0))for(var e=0;e<this.modelAnimations.length;e++)if(this.modelAnimations[e].name===t){this.entity.activeAnimations.add({index:e,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}}},{key:"resetAnimate",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.activeAnimate=void 0,this.sdk.viewer.scene.primitives.remove(this.entity),this.on();case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f=this,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]&&v[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=46;break}return i=!1,this.scaleX===this.scaleY&&this.scaleX===this.scaleZ&&(i=!0),t.next=9,new rn(this.sdk,this.originalOptions,{title:"模型属性",left:"180px",top:"100px",confirmCallBack:function(t){f.name=f.options.name||"未命名对象",f.originalOptions=f.deepCopyObj(f.options),f._DialogObject.close();var e=f.deepCopyObj(f.options);e.host="",f.Dialog.confirmCallBack&&f.Dialog.confirmCallBack(e),Pe(f.sdk,f.options.id),se(f.sdk,f.options.id)},resetCallBack:function(){f.reset(),f.Dialog.resetCallBack&&f.Dialog.resetCallBack()},removeCallBack:function(){f.Dialog.removeCallBack&&f.Dialog.removeCallBack()},closeCallBack:function(){f.reset(),f.positionEditing=!1,f.editObj&&f.editObj.destroy(),f.Dialog.closeCallBack&&f.Dialog.closeCallBack()},showCallBack:function(t){f.show=t,f.Dialog.showCallBack&&f.Dialog.showCallBack()},translationalCallBack:function(){f.positionEditing?f.positionEditing=!1:f.positionEditing=!0}},!0);case 9:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" model",(n=document.createElement("div")).innerHTML=Ec(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("model-edit-tabs",void 0,this.sdk),o=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),s=this._DialogObject._element.content.getElementsByClassName("equal")[0],r=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],o.checked=i,o.addEventListener("change",(function(t){(i=t.target.checked)?(s.style.display="flex",r.style.display="none",f.scaleY=f.scaleX,f.scaleZ=f.scaleX):(s.style.display="none",r.style.display="flex")})),(l=s.getElementsByTagName("input"))[0].value=this.scaleX,l[1].value=this.scaleX,l[0].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),l[1].addEventListener("input",(function(t){f.scaleX=t.target.value,f.scaleY=t.target.value,f.scaleZ=t.target.value})),i?(s.style.display="flex",r.style.display="none"):(s.style.display="none",r.style.display="flex"),c=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){f.color=t},clear:function(){f.color="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelColor=t},clear:function(){f.labelColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelLineColor=t},clear:function(){f.labelLineColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorStart=t},clear:function(){f.labelBackgroundColorStart="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){f.labelBackgroundColorEnd=t},clear:function(){f.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),m=n.getElementsByTagName("*"),this._EventBinding.on(this,m),this._elms=this._EventBinding.element,this._elms.color=[c],this._elms.labelColor=[u],this._elms.labelLineColor=[p],this._elms.labelBackgroundColorStart=[h],this._elms.labelBackgroundColorEnd=[d],this._elms.scaleX.push(l[0],l[1]),setTimeout((function(){f.attributeLink=f.options.attribute.link.content,f.attributeVr=f.options.attribute.vr.content,f.ISCSelect&&f.ISCSelect(),f.goodsSelect&&f.goodsSelect(),f.cameraSelect&&f.cameraSelect();var t=f.attributeSelect,e=f._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=f._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===f.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){f.attributeType=t[e].key;break}}))}var s=qn(),a=Y(f._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(a){a.legp_search(s);var r=f._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];r.value=s[f.labelFontFamily].value;for(var l=0;l<s.length;l++)if(s[l].value==r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var t=0;t<s.length;t++)if(s[t].value===r.value){f.labelFontFamily=s[t].key;break}})),f._elms.labelFontFamily=[r]}}),0),t.next=46;break;case 46:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.position.lng=t.position.lng,this.options.position.lat=t.position.lat,this.options.position.alt=t.position.alt,this.options.rotate.z=-t.heading,this.options.rotate.x=-t.pitch,this.options.rotate.y=-t.roll,this.updateModel(this.options.position.lng,this.options.position.lat,this.options.position.alt,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label&&(this.label.position=[this.options.position.lng,this.options.position.lat,this.options.position.alt])}},{key:"updateModel",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(parseFloat(i).toFixed(2)),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),r.x=parseFloat(r.x),r.y=parseFloat(r.y),r.z=parseFloat(r.z),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i),this.entity.rotate={x:o,y:s,z:a},this.entity.customScale=r;var l=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(s)),u=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(a)),p=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(t,e,i)),h=Cesium.Matrix4.fromRotationTranslation(l),d=Cesium.Matrix4.fromRotationTranslation(c),m=Cesium.Matrix4.fromRotationTranslation(u),f=new Cesium.Matrix4;Cesium.Matrix4.multiply(p,h,f),Cesium.Matrix4.multiply(f,d,f),Cesium.Matrix4.multiply(f,m,this.entity.modelMatrix);var v=r.x,g=r.y,y=r.z;0===v&&(v=1e-5),0===g&&(g=1e-5),0===y&&(y=1e-5),Cesium.Matrix4.multiplyByScale(this.entity.modelMatrix,new Cesium.Cartesian3(v,g,y),this.entity.modelMatrix),this.entity.minimumPixelSize=this.scaleByDistance?void 0:this.options.minimumPixelSize,this.editObj&&this.editObj.update(),this.entity.isMove=!0,clearTimeout(Fc(Hc,this)),Rc(Hc,this,setTimeout((function(){n.entity&&(n.entity.isMove=!1)}),500))}},{key:"reset",value:function(){if(this.entity)try{this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scaleX=this.originalOptions.scale.x,this.scaleY=this.originalOptions.scale.y,this.scaleZ=this.originalOptions.scale.z,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect()}catch(t){}}}]);var i,n,s,r,l}(Oc);function Gc(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">最大比例</span>\n <input class="input" type="number" title="" min="0.1" max="99999" step="0.1" @model="maximumScale">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">最小像素</span>\n <input class="input" type="number" title="" min="1" max="99999" @model="minimumPixelSize">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n </div>\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="model-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="方向信息">\n <div>\n <div class="row">\n <div class="col">\n <span class="label">x轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateX">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateX">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateY">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateY">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z轴</span>\n <input style="width: 332px;" type="range" max="360" min="0" step="0.01" @model="rotateZ">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="360" @model="rotateZ">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <input style="width: 332px;" type="range" max="999999" min="-99999" step="0.01" @model="alt">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="-99999" max="999999" @model="alt">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">缩放</span>\n <input style="width: 332px;" type="range" max="999" min="0" step="1" @model="scale">\n <input style="font-size: 13px;width: 100px;" type="number" title="" min="0" max="999" step="1" @model="scale">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Uc(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Wc(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Wc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Wc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Yc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Jc(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Yc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Yc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function qc(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Xc(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Zc=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=qc(this,e,[t,n,o={}])).picking=!0,i.options.name=n.name||"未命名对象",i.options.color=n.color||"#ffffff",i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.url=n.url,i.options.maximumScale=n.maximumScale||0===n.maximumScale?n.maximumScale:100,i.options.minimumPixelSize=n.minimumPixelSize||0===n.minimumPixelSize?n.minimumPixelSize:60,i.options.positions=n.positions||[],i.options.type=n.type||0,i.options.interval=n.interval||0===n.interval?n.interval:1,i.options.quantity=n.quantity,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.options.rotate=n.rotate=n.rotate||{},i.options.rotate.x=n.rotate.x||0,i.options.rotate.y=n.rotate.y||0,i.options.rotate.z=n.rotate.z||0,i.options.label=n.label=n.label||{},i.options.label.show=!(!n.label.show&&!1!==n.label.show)&&n.label.show,i.options.label.fontSize=n.label.fontSize||20,i.options.label.color=n.label.color||"#ffffff",i.options.label.near=n.label.near||0===n.label.near?n.label.near:2e3,i.options.label.far=n.label.far||0===n.label.far?n.label.far:1e5,i.options.label.scaleByDistance=n.label.scaleByDistance||!1,i.options.label.backgroundColor=n.label.backgroundColor||["#42c6ef","#42c6ef"],i.options.line=n.line=n.line||{},i.options.line.width=n.line.width||2,i.options.line.length=n.line.length||20,i.options.line.color=n.line.color||"#fff000",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||[],i.options.attributeType=n.attributeType||"richText",i.ModelPositions=[],i._elms={},i.positionCallBack=null,i.rotationCallback=null,i.onClickCallback=null,i._DialogObject=null,i._element_style=null,i.ControllerObject=new Jo(i.sdk),i.ControllerObject.controllerCallBack=function(t){i.lng=t.position.lng,i.lat=t.position.lat,i.alt=t.position.alt},i.Dialog=o,i._EventBinding=new wn,i.on(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"glb"}},{key:"loadModel",value:(s=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(v=function(t){return new Worker("data:,(".concat(t.toString(),")(").concat(JSON.stringify(m),")"))},f=function(t){var e=t.type,i=t.interval,n=t.positions,o=t.optionsPositions,s=t.quantity,a=t.turfUrl;importScripts(a);var r=[];switch(e){case 1:var l=turf.lineString(n[0]),c=turf.lineChunk(l,i/1e3,{units:"kilometers"});r.push({lng:c.features[0].geometry.coordinates[0][0],lat:c.features[0].geometry.coordinates[0][1]});for(var p=0;p<c.features.length;p++)r.push({lng:c.features[p].geometry.coordinates[1][0],lat:c.features[p].geometry.coordinates[1][1]});break;case 2:var h=turf.polygon(n),d=turf.bbox(h);u=turf.pointGrid(d,i/1e3,{units:"kilometers"});for(var m=turf.pointsWithinPolygon(u,h),f=0;f<m.features.length;f++)r.push({lng:m.features[f].geometry.coordinates[0],lat:m.features[f].geometry.coordinates[1]});break;case 3:if(s)for(var v=o[0].lng,g=o[0].lat,y=o[2].lng,b=o[2].lat,C=turf.point([v,b]),w=turf.point([y,b]),k=turf.distance(C,w,{units:"kilometers"})/s.x,x=turf.point([v,b]),_=turf.point([v,g]),E=turf.distance(x,_,{units:"kilometers"})/s.y,S=turf.lineString([[v,b],[y,b]]),D=turf.lineChunk(S,k,{units:"kilometers"}),P=turf.lineString([[v,b],[v,g]]),M=turf.lineChunk(P,E,{units:"kilometers"}),O=0;O<D.features.length;O++)for(var T=D.features[O].geometry.coordinates,N=0;N<M.features.length;N++){var B=M.features[N].geometry.coordinates;r.push({lng:(T[0][0]+T[1][0])/2,lat:(B[0][1]+B[1][1])/2})}else{u=turf.pointGrid([o[0].lng,o[0].lat,o[2].lng,o[2].lat],i/1e3,{units:"kilometers"});for(var A=0;A<u.features.length;A++)r.push({lng:u.features[A].geometry.coordinates[0],lat:u.features[A].geometry.coordinates[1]})}break;default:r=L()(o)}self.postMessage(r)},e.startsWith("http")||e.includes(":")||this.options.host&&(i=new URL(e,this.options.host),e=i.href),this.originalOptions=this.deepCopyObj(this.options),new Cesium.PrimitiveCollection,n=[[]],o=this.options.positions[0].alt,s=0;s<this.options.positions.length;s++)n[0].push([this.options.positions[s].lng,this.options.positions[s].lat]),this.options.positions[s].alt>this.options.height&&(o=this.options.positions[s].alt);n[0].length>2?(n[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),r=turf.polygon(n),l=turf.pointOnFeature(r),this.center={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]}):2==n[0].length?this.center={lng:(this.options.positions[0].lng+this.options.positions[1].lng)/2,lat:(this.options.positions[0].lat+this.options.positions[1].lat)/2}:this.center={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat},c=[],this.options.height||0===this.options.height||(this.options.height=o),p=document.scripts,h="",d=0;case 14:if(!(d<p.length)){t.next=21;break}if(!p[d].src||!p[d].src.includes("turf.min.js")){t.next=18;break}return h=p[d].src&&p[d].src,t.abrupt("break",21);case 18:d++,t.next=14;break;case 21:m={type:this.options.type,interval:this.options.interval,positions:n,optionsPositions:this.options.positions,quantity:this.options.quantity,turfUrl:h},v(f).onmessage=function(t){g.ModelPositions=c=t.data;for(var i=[],n=0;n<c.length;n++){var o=Cesium.Cartesian3.fromDegrees(c[n].lng,c[n].lat,g.options.height),s=Cesium.Transforms.headingPitchRollToFixedFrame(o,new Cesium.HeadingPitchRoll(0,0,0));Cesium.Matrix4.multiplyByUniformScale(s,1,s),i.push({modelMatrix:s})}g.label=new no(g.sdk,{show:!!g.options.show&&g.options.label.show,position:[g.center.lng,g.center.lat,g.options.height],text:g.options.name,fontSize:g.options.label.fontSize,color:g.options.label.color,pixelOffset:g.options.line.length,backgroundColor:g.options.label.backgroundColor,lineColor:g.options.line.color,lineWidth:g.options.line.width,scaleByDistance:g.options.label.scaleByDistance,near:g.options.label.near,far:g.options.label.far}),g.entity=new Cesium2.ModelInstanceCollection({url:e,instances:i}),g.entity.position=new Cesium.Cartesian3.fromDegrees(g.center.lng,g.center.lat,g.options.height),g.entity.rotate={x:g.options.rotate.x,y:g.options.rotate.y,z:g.options.rotate.z},g.updateModel(g.center.lng,g.center.lat,g.options.height,g.options.rotate.x,g.options.rotate.y,g.options.rotate.z,g.options.scale),g.sdk.viewer.scene.primitives.add(g.entity)};case 24:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){Xc(e,"remove",this,3)([]),this.label.remove(),this.positionEditing=!1,this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Jc({},this.options.position):this.options.positions?r=Jc({},this.options.positions[0]):this.options.center?r=Jc({},this.options.center):this.options.start?r=Jc({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),r.hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(r);case 14:r.alt=t.sent;case 15:i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e}),t.next=23;break;case 22:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height+500)});case 23:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"on",value:function(){return this.add()}},{key:"setDefaultValue",value:function(){Xc(e,"setDefaultValue",this,3)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.color=Cesium.Color.fromCssColorString(t),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"lng",get:function(){return this.center.lng},set:function(t){this.center.lng=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.center.lat},set:function(t){this.center.lat=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[this.center.lng,this.center.lat,this.options.height],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.height},set:function(t){this.center.alt=t,this.options.height=t,this._ControllerChangePosition(50),this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.label.position=[Number(this.center.lng),Number(this.center.lat),Number(this.options.height)],this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"_ControllerChangePosition",value:function(t){var e=this;clearTimeout(e._ControllerChangePositionEvent),e._ControllerChangePositionEvent=setTimeout((function(){e.ControllerObject.position={lng:e.center.lng,lat:e.center.lat,alt:e.options.height}}),t)}},{key:"maximumScale",get:function(){return this.options.maximumScale},set:function(t){this.options.maximumScale=t,this.entity.maximumScale=this.scaleByDistance?void 0:t,this._elms.maximumScale&&this._elms.maximumScale.forEach((function(e){e.value=t}))}},{key:"minimumPixelSize",get:function(){return this.options.minimumPixelSize},set:function(t){this.options.minimumPixelSize=t,this.entity.minimumPixelSize=this.scaleByDistance?void 0:t,this._elms.minimumPixelSize&&this._elms.minimumPixelSize.forEach((function(e){e.value=t}))}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.maximumScale=t?void 0:this.maximumScale,this.entity.minimumPixelSize=t?void 0:this.minimumPixelSize,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"rotateX",get:function(){return this.options.rotate.x},set:function(t){this.options.rotate.x=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateX&&this._elms.rotateX.forEach((function(e){e.value=t}))}},{key:"rotateY",get:function(){return this.options.rotate.y},set:function(t){this.options.rotate.y=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateY&&this._elms.rotateY.forEach((function(e){e.value=t}))}},{key:"rotateZ",get:function(){return this.options.rotate.z},set:function(t){this.options.rotate.z=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.rotateZ&&this._elms.rotateZ.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this.updateModelRotate(this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.label.lineWidth=t,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"lineLength",get:function(){return this.options.line.length},set:function(t){this.options.line.length=t,this.label.pixelOffset=t,this._elms.lineLength&&this._elms.lineLength.forEach((function(e){e.value=t}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.label.lineColor=t,this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.labelBackgroundColorEnd],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.labelBackgroundColorStart,t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Uc(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Uc(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera},set:function(t){this.options.attribute.camera=t}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(t){t?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&(t?(this.leftClickState=vt(),this.ControllerObject.position={lng:this.center.lng,lat:this.center.lat,alt:this.options.height},this.ControllerObject.editTranslational(),new ht(this.sdk)):(this.leftClickState&&!vt()&&new pt(this.sdk),this.ControllerObject.destroy()))}},{key:"positionEditingCallBack",get:function(){},set:function(t){}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.lng=e.tx,t.lat=e.ty,t.alt=e.tz,t.rotateX=e.rx,t.rotateY=e.ry,t.rotateZ=e.rz,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.ControllerObject._params)}},set:function(t){this._rotationEditingCallBack=t}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 600px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:first-child {\n margin-left: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .col:last-child {\n margin-right: 0;\n }\n .YJ-custom-base-dialog>.content>div>.row .label {\n flex: 0 0 74px;\n }\n .YJ-custom-base-dialog>.content .DIV-cy-tab-content-pane .input-select {\n width: 100px;\n }\n",t.next=12,new rn(this.sdk,this.originalOptions,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.options.name||"未命名对象",u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.ControllerObject&&u.ControllerObject.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 12:this._DialogObject=t.sent,document.getElementsByTagName("head")[0].appendChild(this._element_style),(i=document.createElement("div")).innerHTML=Gc(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,new kn("model-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){u.color=t},clear:function(){u.color="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("label_color")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelColor=t},clear:function(){u.labelColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("line_color")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){u.lineColor=t},clear:function(){u.lineColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorStart=t},clear:function(){u.labelBackgroundColorStart="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){u.labelBackgroundColorEnd=t},clear:function(){u.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),c=i.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.labelColor=[o],this._elms.lineColor=[s],this._elms.labelBackgroundColorStart=[r],this._elms.labelBackgroundColorEnd=[l],setTimeout((function(){u.attributeLink=u.options.attribute.link.content,u.cameraSelect&&u.cameraSelect();var t=u.attributeSelect,e=u._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=u._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===u.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){u.attributeType=t[e].key;break}}))}}),0),t.next=36;break;case 36:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"updateModel",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),o=parseFloat(o),s=parseFloat(s),a=parseFloat(a),this.entity.rotate={x:n,y:o,z:s};var r=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(n)),l=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(o)),c=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(s)),u=new Cesium.Cartesian3.fromDegrees(t,e,i);Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z)),Cesium.Matrix4.fromRotationTranslation(r),Cesium.Matrix4.fromRotationTranslation(l),Cesium.Matrix4.fromRotationTranslation(c),new Cesium.Matrix4;Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(u.x-this.entity._center.x,u.y-this.entity._center.y,u.z-this.entity._center.z),this.entity.modelMatrix),this.ControllerObject.update(),this.entity.position=new Cesium.Cartesian3.fromDegrees(t,e,i)}},{key:"updateModelRotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),n=parseFloat(n),this.sdk.viewer.scene.primitives.remove(this.entity);var o=this.options.url;if(!o.startsWith("http")&&!o.includes(":")&&this.options.host){var s=new URL(o,this.options.host);o=s.href}for(var a=[],r=0;r<this.ModelPositions.length;r++){var l=n,c=Cesium.Cartesian3.fromDegrees(this.ModelPositions[r].lng,this.ModelPositions[r].lat,this.options.height),u=Cesium.Transforms.headingPitchRollToFixedFrame(c,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(i),Cesium.Math.toRadians(e),Cesium.Math.toRadians(t)));Cesium.Matrix4.multiplyByUniformScale(u,l,u),a.push({modelMatrix:u})}this.entity=new Cesium.ModelInstanceCollection({url:o,instances:a}),this.entity.position=new Cesium.Cartesian3.fromDegrees(this.center.lng,this.center.lat,this.options.height),this.entity.rotate={x:this.options.rotate.x,y:this.options.rotate.y,z:this.options.rotate.z},this.updateModel(this.center.lng,this.center.lat,this.options.height,this.options.rotate.x,this.options.rotate.y,this.options.rotate.z,this.options.scale),this.sdk.viewer.scene.primitives.add(this.entity)}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lng=this.originalOptions.position.lng,this.lat=this.originalOptions.position.lat,this.alt=this.originalOptions.position.alt,this.maximumScale=this.originalOptions.maximumScale,this.minimumPixelSize=this.originalOptions.minimumPixelSize,this.scaleByDistance=this.originalOptions.scaleByDistance,this.rotateX=this.originalOptions.rotate.x,this.rotateY=this.originalOptions.rotate.y,this.rotateZ=this.originalOptions.rotate.z,this.scale=this.originalOptions.scale,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera,this.cameraSelect&&this.cameraSelect())}}]);var i,n,s}(Oc);function Kc(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function $c(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Kc(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Kc(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Qc(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var tu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Qc(this,e,[t,n])).object={},i.options.host=i.options.host||h(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"on",value:function(){return this.add()}},{key:"add",value:(n=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestResource();case 2:return e=t.sent,t.next=5,e.text();case 5:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=11;break}return t.abrupt("return",this.loadLayer(i.data));case 11:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"loadLayer",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.object=$c({},e),i="",this.object.url.startsWith("http")?i=this.object.url:this.options.host?(n=new URL(this.object.url,this.options.host),i=n.href):i=this.object.url,o={url:i,mimmumLevel:this.object.minimumLevel,maximumLevel:this.object.maximumLevel,rectangle:new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north))},t.t0=this.object.scheme_name,t.next="amapMercatorTilingScheme"===t.t0?7:""===t.t0?9:10;break;case 7:return o.tilingScheme=this.amapMercatorTilingScheme(),t.abrupt("break",12);case 9:return t.abrupt("break",12);case 10:return o.tilingScheme=new Cesium[this.object.scheme_name],t.abrupt("break",12);case 12:t.t1=this.object.load_method,t.next="tms"===t.t1?15:"xyz"===t.t1?24:"wmts"===t.t1?26:28;break;case 15:if(this.object.url.endsWith("tilemapresource.xml")&&((r=this.object.url.split("/")).pop(),l=r.join("/"),o.url=l),!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=22;break}return t.next=19,Cesium.TileMapServiceImageryProvider.fromUrl(o.url,o);case 19:s=t.sent,t.next=23;break;case 22:s=new Cesium.TileMapServiceImageryProvider(o);case 23:return t.abrupt("break",30);case 24:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 26:return s=new Cesium.WebMapTileServiceImageryProvider(o),t.abrupt("break",30);case 28:return s=new Cesium.UrlTemplateImageryProvider(o),t.abrupt("break",30);case 30:if(this.sdk&&this.sdk.viewer){t.next=32;break}return t.abrupt("return");case 32:for(this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(s),this.entity._id=this.options.id,c=0;c<this.sdk.viewer.imageryLayers._layers.length;c++)this.sdk.viewer.imageryLayers._layers[c]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[c]._imageryProvider._type)&&(u=this.sdk.viewer.imageryLayers._layers[c],this.sdk.viewer.imageryLayers.raiseToTop(u));this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Kt(0,this.options.id);case 39:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}]);var i,n}(Al);function eu(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var iu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=eu(this,e,[t,n])).loadLayer(),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"layer"}},{key:"loadLayer",value:function(t){var e,i={url:this.options.url,mimmumLevel:this.options.minimumLevel||0,maximumLevel:this.options.maximumLevel||20,subdomains:["0","1","2","3","4","5","6","7"]};e=new Cesium.UrlTemplateImageryProvider(i),this.options.hasOwnProperty("layer_index")?this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e,this.options.layer_index):this.entity=this.sdk.viewer.scene.imageryLayers.addImageryProvider(e),this.entity._id=this.options.id;for(var n=0;n<this.sdk.viewer.imageryLayers._layers.length;n++)if(this.sdk.viewer.imageryLayers._layers[n]._imageryProvider&&this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type&&("flw"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type||"jww"===this.sdk.viewer.imageryLayers._layers[n]._imageryProvider._type)){var o=this.sdk.viewer.imageryLayers._layers[n];this.sdk.viewer.imageryLayers.raiseToTop(o)}this.show=this.options.show,this.alpha=this.options.alpha,this.brightness=this.options.brightness,this.options.show&&Kt(0,this.options.id)}}])}(Al);function nu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ou(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?nu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function su(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return au(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?au(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function au(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ru(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function lu(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function cu(t,e,i){return t.set(pu(t,e),i),i}function uu(t,e){return t.get(pu(t,e))}function pu(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var hu=new WeakMap,du=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return k()(this,e),lu(i=ru(this,e,[t,n]),hu,void 0),i.object=JSON.parse(JSON.stringify(o)),i.object.west||(i.object.west=40),i.object.south||(i.object.south=30),i.object.east||(i.object.east=160),i.object.north||(i.object.north=50),i.show=i.options.show,i._elms={},i.Dialog=s,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"terrain"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return!(this.sdk.viewer.scene.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)},set:function(t){t?this.open():this.close()}},{key:"open",value:(r=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.url){t.next=4;break}return t.abrupt("return",this.loadTerrain({url:this.options.url}));case 4:return t.next=6,this.requestResource();case 6:return e=t.sent,t.next=9,e.text();case 9:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=19;break}if(!i.data.url.length){t.next=16;break}return t.abrupt("return",this.loadTerrain(i.data));case 16:return t.abrupt("return",new Promise((function(t,e){e("资源不存在")})));case 17:t.next=20;break;case 19:return t.abrupt("return",new Promise((function(t,e){e(i.msg||i.message)})));case 20:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"close",value:function(){var t=this;this.sdk.viewer.scene.terrainProvider=new Cesium.EllipsoidTerrainProvider({});for(var e=0;e<YJ.Analysis.AnalysesResults.length;e++)"ContourAnalysis"===YJ.Analysis.AnalysesResults[e].type&&YJ.Analysis.AnalysesResults[e].destroy();se(this.sdk,this.options.id),clearTimeout(uu(hu,this)),cu(hu,this,setTimeout((function(){clearTimeout(uu(hu,t));var e,i=su(t.sdk.entityMap);try{for(i.s();!(e=i.n()).done;){var n=y()(e.value,2),o=(n[0],n[1]);"BillboardObject"!==o.type||1!=o.heightMode&&3!=o.heightMode?o.label&&(o.label.show=o.label.show):o.updateHeight()}}catch(t){i.e(t)}finally{i.f()}}),500))}},{key:"loadTerrain",value:(s=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=ou({},e),n="",i.url.startsWith("http")||i.url.includes(":")?n=i.url:this.options.host?(o=new URL(i.url,this.options.host),n=o.href):n=i.url,!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=9;break}return t.next=6,Cesium.CesiumTerrainProvider.fromUrl(n);case 6:this.terrainProvider=t.sent,t.next=10;break;case 9:this.terrainProvider=new Cesium.CesiumTerrainProvider({url:n});case 10:if(this.sdk&&this.sdk.viewer){t.next=12;break}return t.abrupt("return");case 12:this.sdk.viewer.terrainProvider=this.terrainProvider,clearTimeout(uu(hu,this)),cu(hu,this,setTimeout((function(){clearTimeout(uu(hu,s)),s.terrainProvider.readyPromise.then((function(){var t,e=su(s.sdk.entityMap);try{for(e.s();!(t=e.n()).done;){var i=y()(t.value,2),n=(i[0],i[1]);"BillboardObject"!==n.type||1!=n.heightMode&&3!=n.heightMode?n.label&&(n.label.show=n.label.show):n.updateHeight()}}catch(t){e.e(t)}finally{e.f()}}))}),1e3)),se(this.sdk,this.options.id);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"remove",value:function(){this.close()}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:3,!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ou({},this.options.position):this.options.positions?l=ou({},this.options.positions[0]):this.options.center?l=ou({},this.options.center):this.options.start?l=ou({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e}),t.next=27;break;case 25:c=new Cesium.Rectangle(Cesium.Math.toRadians(this.object.west),Cesium.Math.toRadians(this.object.south),Cesium.Math.toRadians(this.object.east),Cesium.Math.toRadians(this.object.north)),this.sdk.viewer.camera.flyTo({destination:c,duration:e});case 27:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ya()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.url=this.options.url||""}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,new rn(this.sdk,this.options,{title:"地形属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close();var e=o.deepCopyObj(o.options);e.host="",o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(e)},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()}},!0);case 5:this._DialogObject=t.sent,(e=document.createElement("div")).style.width="300px",i='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称:</span>\n <input class="input name" type="text">\n </div>\n </div>\n </div>\n ',e.innerHTML=i,(n=e.getElementsByClassName("name")[0]).value=this.name,n.addEventListener("input",(function(){o.name=n.value})),this._DialogObject.contentAppChild(e),this._elms.name=[n];case 15:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r}(Ol);function mu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return fu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?fu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var vu=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=mu(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(vu,"event",{});var gu=new vu;function yu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Cu(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function wu(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var ku=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Cu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#ff0000",n.options.endColor=i.endColor||"#fff000",n.options.startScale=i.startScale||.5,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||1,n.options.maximumParticleLife=i.maximumParticleLife||2,n.options.minimumSpeed=i.minimumSpeed||1,n.options.maximumSpeed=i.maximumSpeed||30,n.options.emissionRate=i.emissionRate||60,n.options.particleSize=i.particleSize||10,n.options.show=!1!==i.show,n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n._elms={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(30)),modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=bu({},this.options.position):this.options.positions?l=bu({},this.options.positions[0]):this.options.center?l=bu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"火焰属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),gu.on(this,s),this._elms=gu.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,function(t){Le.apply(this,arguments)}(this.entity))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return wu(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:bu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:bu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function xu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return _u(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Eu=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=xu(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Eu,"event",{});var Su=new Eu;function Du(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Du(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Du(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Mu(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Ou(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Tu=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Mu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#00000000",n.options.endColor=i.endColor||"#0000001a",n.options.startScale=i.startScale||.1,n.options.endScale=i.endScale||10,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||10,n.options.maximumSpeed=i.maximumSpeed||15,n.options.emissionRate=i.emissionRate||28,n.options.particleSize=i.particleSize||2,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.originalOptions=this.deepCopyObj(this.options),e=this.sdk.viewer.scene,i=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),n=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(i),o=Cesium.Transforms.eastNorthUpToFixedFrame(n),Cesium.Matrix4.multiplyByScale(o,new Cesium.Cartesian3(1,1,1),o),s=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=e.primitives.add(new Cesium.ParticleSystem({show:!(s>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,minimumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),maximumImageSize:new Cesium.Cartesian2(this.options.particleSize,this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,lifetime:.5,loop:!0,emitter:new Cesium.CircleEmitter(.2),performance:!1,modelMatrix:o,updateCallback:function(t){t._billboard.id=r.options.id}})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(r.entity&&r.show){var t=r.sdk.viewer.camera.positionCartographic.height;r.entity.show=!(t>=1e7)}}));case 14:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Pu({},this.options.position):this.options.positions?l=Pu({},this.options.positions[0]):this.options.center?l=Pu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=t,this.particleSystem.minimumParticleLife=t,this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=t}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=t,this.particleSystem.maximumParticleLife=t,this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=t}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"烟雾属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Su.on(this,s),this._elms=Su.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ou(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Pu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Pu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Pu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Nu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Bu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Bu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Bu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Lu=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=Nu(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"!=e.target.type&&"range"!=e.target.type||(i=Number(i)),t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t.Dialog[l.value]&&t.Dialog[l.value](e)})),a.push(l.name)}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Lu,"event",{});var Au=new Lu;function ju(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Iu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ju(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ju(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ru(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Fu(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var zu=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Ru(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f24d",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||1,n.options.endScale=i.endScale||20,n.options.minimumParticleLife=i.minimumParticleLife||6,n.options.maximumParticleLife=i.maximumParticleLife||7,n.options.minimumSpeed=i.minimumSpeed||9,n.options.maximumSpeed=i.maximumSpeed||9.5,n.options.emissionRate=i.emissionRate||20,n.options.particleSize=i.particleSize||.5,n.options.gravity=i.gravity||0===i.gravity?i.gravity:-3.5,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.lng,lat:n.options.lat,alt:n.options.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(0,0,0),e=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 +return e.translation=Cesium.Cartesian3.fromElements(0,0,0),e.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(e)},u=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,l),Cesium.Cartesian3.multiplyByScalar(l,c*i,l),t.velocity=Cesium.Cartesian3.add(t.velocity,l,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,new Cesium.Cartesian3,n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(r>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/fountain.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.minimumSpeed,maximumSpeed:this.options.maximumSpeed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.ConeEmitter(Cesium.Math.toRadians(.2)),modelMatrix:s,emitterModelMatrix:p(),updateCallback:u})),l=new Cesium.Cartesian3,c=-3.5,this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(h.entity&&h.show){var t=h.sdk.viewer.camera.positionCartographic.height;h.entity.show=!(t>=1e7)}}));case 21:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Iu({},this.options.position):this.options.positions?l=Iu({},this.options.positions[0]):this.options.center?l=Iu({},this.options.center):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=26;break;case 25:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 26:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"minimumSpeed",get:function(){return this.options.minimumSpeed},set:function(t){this.options.minimumSpeed=t,this.particleSystem.minimumSpeed=t,this._elms.minimumSpeed&&this._elms.minimumSpeed.forEach((function(e){e.value=t}))}},{key:"maximumSpeed",get:function(){return this.options.maximumSpeed},set:function(t){this.options.maximumSpeed=t,this.particleSystem.maximumSpeed=t,this._elms.maximumSpeed&&this._elms.maximumSpeed.forEach((function(e){e.value=t}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=t,this.particleSystem.startScale=t,this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=t}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=t,this.particleSystem.endScale=t,this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=t}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=t,this.particleSystem.emissionRate=t,this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=t}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=t,this.particleSystem.minimumImageSize=new Cesium.Cartesian2(t,t),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(t,t),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=t}))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r=this,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]&&l[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=21;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"喷泉属性",left:"180px",top:"100px",confirmCallBack:function(t){r.name=r.name.trim(),r.name||(r.name="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.positionEditing=!1,r.Dialog.closeCallBack&&r.Dialog.closeCallBack()},showCallBack:function(t){r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},translationalCallBack:function(){r.positionEditing=!r.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小初速度</span>\n <input type="range" max="100" min="0" step="1" @model="minimumSpeed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大初速度</span>\n <input type="range" max="100" min="0" step="1" @model="maximumSpeed">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.startColor=t},clear:function(){r.startColor="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){r.endColor=t},clear:function(){r.endColor="rgba(255,255,255,1)"}}),s=i.getElementsByTagName("*"),Au.on(this,s),this._elms=Au.element,this._elms.startColor=[n],this._elms.endColor=[o],t.next=21;break;case 21:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.minimumSpeed=this.originalOptions.minimumSpeed,this.maximumSpeed=this.originalOptions.maximumSpeed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Fu(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Iu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.lng,e.options.lat,e.options.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.lng=o.lng,e.options.lat=o.lat,e.options.alt=o.alt}e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Iu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Iu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.lng=this.entity.position.lng,this.options.lat=this.entity.position.lat,this.options.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.lng,this.options.lat,this.options.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.alt}))}}},{key:"flicker",value:function(){}}]);var i,n,s,r}(Wn);function Hu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Vu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Vu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Vu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Gu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Uu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Wu(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Yu(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}var Ju=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Wu(this,e,[t,i])).options.url=i.url,n.options.startColor=i.startColor||"#c1f7f2",n.options.endColor=i.endColor||"#ffffff00",n.options.startScale=i.startScale||.2,n.options.endScale=i.endScale||2,n.options.minimumParticleLife=i.minimumParticleLife||12,n.options.maximumParticleLife=i.maximumParticleLife||12,n.options.emissionRate=i.emissionRate||100,n.options.particleSize=i.particleSize||1,n.options.show=!1!==i.show,n._elms={},n.positionCallBack=null,n.rotationCallback=null,n.onClickCallback=null,n._DialogObject=null,n._element=null,n.particleSystem,n.sdk.addIncetance(n.options.id,n),n.add(),n.operate={},n.previous={positions:{lng:n.options.start.lng,lat:n.options.start.lat,alt:n.options.start.alt}},n.Dialog=o,n.event=new X(n.sdk),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"ParticleEffects"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=ze().sdkD;this.isShowView&&e||(this.options.show=t),this.showView&&3!=this.showView&&e?(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=!1),this.options.label&&this.options.label.show&&(this.label.show=!1)):(this.entity&&this.sdk.viewer.camera.positionCartographic.height<1e7&&(this.entity.show=this.options.show),this.options.label&&this.options.label.show&&(this.label.show=this.options.show)),this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"add",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C=function(t,e){var i=new Cesium.Cartesian3,n=Cesium.Transforms.eastNorthUpToFixedFrame(t);return Cesium.Matrix4.inverse(n,n),Cesium.Matrix4.multiplyByPoint(n,e,i),Cesium.Cartesian3.normalize(i,i),Cesium.Math.toDegrees(Math.atan2(i.x,i.y))},b=function(){var t=Cesium.HeadingPitchRoll.fromDegrees(e.options.heading+90,e.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 +return i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(t),Cesium.Matrix4.fromTranslationRotationScale(i)},y=function(t,i){t._billboard.id=e.options.id;var n=t.position;Cesium.Cartesian3.normalize(n,r),Cesium.Cartesian3.multiplyByScalar(r,l*i,r),t.velocity=Cesium.Cartesian3.add(t.velocity,r,t.velocity)},e=this,this.originalOptions=this.deepCopyObj(this.options),i=this.sdk.viewer.scene,n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n),s=Cesium.Transforms.eastNorthUpToFixedFrame(o),Cesium.Matrix4.multiplyByScale(s,new Cesium.Cartesian3(1,1,1),s),r=new Cesium.Cartesian3,l=-3.8,c=Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),u=Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.end.alt),this.options.heading||0===this.options.heading||(this.options.heading=C(c,u)),p=this.options.end.alt-this.options.start.alt,h=Cesium.Cartesian3.distance(c,Cesium.Cartesian3.fromDegrees(this.options.end.lng,this.options.end.lat,this.options.start.alt)),d=p?2*p/h:0,m=Math.atan(d)*(180/Math.PI),f=Math.sqrt(Math.abs(d)*h/-l),v=-l*f/Math.abs(Math.cos(m)),this.options.pitch||0===this.options.pitch||(this.options.pitch=90-m),this.options.speed||0===this.options.speed||(this.options.speed=v),g=this.sdk.viewer.camera.positionCartographic.height,this.particleSystem=i.primitives.add(new Cesium.ParticleSystem({show:!(g>=1e7)&&this.options.show,image:this.options.url||this.getSourceRootPath()+"/img/particlesystem/smoke.png",startColor:Cesium.Color.fromCssColorString(this.options.startColor),endColor:Cesium.Color.fromCssColorString(this.options.endColor),startScale:this.options.startScale,endScale:this.options.endScale,minimumParticleLife:this.options.minimumParticleLife,maximumParticleLife:this.options.maximumParticleLife,minimumSpeed:this.options.speed,maximumSpeed:this.options.speed,lifetime:.5,imageSize:new Cesium.Cartesian2(this.options.particleSize,2*this.options.particleSize),sizeInMeters:!0,emissionRate:this.options.emissionRate,loop:!0,emitter:new Cesium.CircleEmitter(.2),modelMatrix:s,emitterModelMatrix:b(),updateCallback:y})),this.particleSystem.id=this.options.id,this.entity=this.particleSystem,this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id),this.sdk.viewer.camera.changed.addEventListener((function(){if(w.entity&&w.show){var t=w.sdk.viewer.camera.positionCartographic.height;w.entity.show=!(t>=1e7)}}));case 31:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Uu({},this.options.position):this.options.positions?l=Uu({},this.options.positions[0]):this.options.line&&this.options.line.positions?l=Uu({},this.options.line.positions[0]):this.options.center?l=Uu({},this.options.center):this.options.start?l=Uu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt+500),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"startColor",get:function(){return this.options.startColor},set:function(t){var e=this;this.options.startColor=t,this.particleSystem.startColor=Cesium.Color.fromCssColorString(t),this._elms.startColor&&this._elms.startColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.startColor=t},clear:function(){e.startColor="rgba(255,255,255,1)"}});e._elms.startColor[n]=o}))}},{key:"endColor",get:function(){return this.options.endColor},set:function(t){var e=this;this.options.endColor=t,this.particleSystem.endColor=Cesium.Color.fromCssColorString(t),this._elms.endColor&&this._elms.endColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.endColor=t},clear:function(){e.endColor="rgba(255,255,255,1)"}});e._elms.endColor[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=Number(t),this.particleSystem.minimumSpeed=Number(t),this.particleSystem.maximumSpeed=Number(t),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=Number(t)}))}},{key:"minimumParticleLife",get:function(){return this.options.minimumParticleLife},set:function(t){this.options.minimumParticleLife=Number(t),this.particleSystem.minimumParticleLife=Number(t),this._elms.minimumParticleLife&&this._elms.minimumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"maximumParticleLife",get:function(){return this.options.maximumParticleLife},set:function(t){this.options.maximumParticleLife=Number(t),this.particleSystem.maximumParticleLife=Number(t),this._elms.maximumParticleLife&&this._elms.maximumParticleLife.forEach((function(e){e.value=Number(t)}))}},{key:"startScale",get:function(){return this.options.startScale},set:function(t){this.options.startScale=Number(t),this.particleSystem.startScale=Number(t),this._elms.startScale&&this._elms.startScale.forEach((function(e){e.value=Number(t)}))}},{key:"endScale",get:function(){return this.options.endScale},set:function(t){this.options.endScale=Number(t),this.particleSystem.endScale=Number(t),this._elms.endScale&&this._elms.endScale.forEach((function(e){e.value=Number(t)}))}},{key:"emissionRate",get:function(){return this.options.emissionRate},set:function(t){this.options.emissionRate=Number(t),this.particleSystem.emissionRate=Number(t),this._elms.emissionRate&&this._elms.emissionRate.forEach((function(e){e.value=Number(t)}))}},{key:"particleSize",get:function(){return this.options.particleSize},set:function(t){this.options.particleSize=Number(t),this.particleSystem.minimumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this.particleSystem.maximumImageSize=new Cesium.Cartesian2(Number(t),2*Number(t)),this._elms.particleSize&&this._elms.particleSize.forEach((function(e){e.value=Number(t)}))}},{key:"lng",get:function(){return this.options.start.lng},set:function(t){this.options.start.lng=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.start.lat},set:function(t){this.options.start.lat=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.start.alt},set:function(t){this.options.start.alt=t;var e=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),i=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(e);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(i),this.entity.position={lng:this.options.start.lng,lat:this.options.start.lat,alt:this.options.start.alt},this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"heading",get:function(){return this.options.heading},set:function(t){this.options.heading=Number(t);var e=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.heading&&this._elms.heading.forEach((function(e){e.value=Number(t)}))}},{key:"pitch",get:function(){return this.options.pitch},set:function(t){this.options.pitch=Number(t);var e=Cesium.HeadingPitchRoll.fromDegrees(this.options.heading+90,this.options.pitch,0),i=new Cesium.TranslationRotationScale;//!!!发射粒子的方向 -i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=Number(t)}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var i,n,o,s,r,l=this,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>0&&void 0!==c[0]&&c[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=20;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"喷射水柱属性",left:"180px",top:"100px",confirmCallBack:function(t){l.name=l.name.trim(),l.name||(l.name="未命名对象"),l.originalOptions=l.deepCopyObj(l.options),l._DialogObject.close(),l.Dialog.confirmCallBack&&l.Dialog.confirmCallBack(l.originalOptions),be(l.sdk,l.options.id),re(l.sdk,l.options.id)},resetCallBack:function(){l.reset(),l.Dialog.resetCallBack&&l.Dialog.resetCallBack()},removeCallBack:function(){l.Dialog.removeCallBack&&l.Dialog.removeCallBack()},closeCallBack:function(){l.reset(),l.positionEditing=!1,l.Dialog.closeCallBack&&l.Dialog.closeCallBack()},showCallBack:function(t){l.show=t,l.Dialog.showCallBack&&l.Dialog.showCallBack()},translationalCallBack:function(){l.positionEditing=!l.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input style="width: 175px;" class="input" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>速度</span>\n <input type="range" max="30" min="0" step="0.1" @model="speed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>朝向</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="heading">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>俯仰角度</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="pitch">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),o=new YJColorPicker({el:n.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){l.startColor=t},clear:function(){l.startColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){l.endColor=t},clear:function(){l.endColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),e.EventBinding(this,r),this._elms.startColor=[o],this._elms.endColor=[s],t.next=20;break;case 20:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.speed=this.originalOptions.speed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.start.lng,this.lat=this.originalOptions.start.lat,this.alt=this.originalOptions.start.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return mu(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:hu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.start.lng,e.options.start.lat,e.options.start.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.start.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.start.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.start.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt}e.entity.position={lng:e.options.start.lng,lat:e.options.start.lat,alt:e.options.start.alt},e.previous={positions:hu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.start.lng=e.entity.position.lng,e.options.start.lat=e.entity.position.lat,e.options.start.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:hu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.start.lng=this.entity.position.lng,this.options.start.lat=this.entity.position.lat,this.options.start.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.start.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.start.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.start.alt}))}}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=cu(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Mn);function vu(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">多面体颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <span class="label">多面体高度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="9999999" data-null data-min="0.01" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n \x3c!-- <div class="col">\n <span class="label">拉伸高度</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="extrudedHeight">\n </div> --\x3e\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function gu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return yu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?yu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var bu=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=gu(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;if("number"==e.target.type){if("."!=e.data&&("-"!=e.data||e.target.value)){if(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),"undefined"!==e.target.dataset.min&&""!==e.target.dataset.min){var n=Number(e.target.dataset.min);i<n&&(i=n)}t[l.value]=i}}else t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(bu,"event",{});var Cu=new bu;function wu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ku(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ku(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function _u(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var xu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=_u(this,e,[t,n])).options.color=n.color||"#ff0000",i.options.show=!n.show&&!1!==n.show||n.show,i.options.height=n.height||0===n.height?n.height:10,i.options.height<=.01&&(i.options.height=.01),i.options.extrudedHeight=n.extrudedHeight||0===n.extrudedHeight?n.extrudedHeight:0,i.entity,i.nodePoints=[],i.operate={},i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.Dialog=o,!i.options.positions||i.options.positions.length<3?(i._error="多面体最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),e.create(i)),i}return qi()(e,t),x()(e,[{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,this.previous={positions:L()(this.positions)},!0===t){var n;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)"));var o=Cesium.Color.fromCssColorString(this.options.color).withAlpha(.99);2===this.sdk.viewer.scene.mode&&(o=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=o,this.picking=!1;for(var s=[],a=this.positions,r=[],l=0;l<a.length;l++){var c=this.cartesian3Towgs84(a[l],this.sdk.viewer);s.push([c.lng,c.lat])}var u=this.cartesian3Towgs84(a[0],this.sdk.viewer);s.push([u.lng,u.lat]);for(var p=turf.polygon([s]),h=turf.centroid(p),d=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(h.geometry.coordinates)),m=0;m<a.length;m++)d.x,a[m].x,r.push({x:d.x-a[m].x,y:d.y-a[m].y,z:d.z-a[m].z});var f=[];this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[];for(var s=0;s<r.length;s++)f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});e.label.position=[n.lng,n.lat,e.options.height+e.options.extrudedHeight],e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.event.destroy();var n=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[],e.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=e.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},e.sdk.viewer);a.alt=a.alt-e.options.height,e.options.positions.push(a)}e.positions=f,e.previous.positions=f,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.event.destroy();var t=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(t.lng,t.lat);f=[],e.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=e.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},e.sdk.viewer);a.alt=a.alt-e.options.height,e.options.positions.push(a)}e.positions=f,e.previous.positions=f,e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return f.length>0?new Cesium.PolygonHierarchy(f):new Cesium.PolygonHierarchy(a)}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)"));var v=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(v=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=v,this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var g=[[]],y=0;y<this.previous.positions.length;y++){var b=this.cartesian3Towgs84(this.previous.positions[y],this.sdk.viewer);g[0].push([b.lng,b.lat])}var C=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);g[0].push([C.lng,C.lat]);var w=turf.polygon(g),k=turf.centroid(w);this.label.position=[k.geometry.coordinates[0],k.geometry.coordinates[1],this.options.height+this.options.extrudedHeight],this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.previous.positions)}),!0)}}}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"#ff0000",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t,this.options.height<=.01&&(this.options.height=.01);for(var e=[[]],i=0;i<this.options.positions.length;i++)e[0].push([this.options.positions[i].lng,this.options.positions[i].lat,this.options.height+this.options.extrudedHeight]);e[0].push([this.options.positions[0].lng,this.options.positions[0].lat,this.options.height+this.options.extrudedHeight]);var n,o=turf.polygon(e),s=turf.centroid(o);this.label.position=[s.geometry.coordinates[0],s.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],n=this.entity.polygon.hierarchy._value?this.entity.polygon.hierarchy._value.positions:this.entity.polygon.hierarchy._callback().positions;var a=[];this.entity.polygon.perPositionHeight=!0;for(var r=0;r<n.length;r++){var l=Cesium.Cartographic.fromCartesian(n[r]),c=Cesium.Math.toDegrees(l.longitude),u=Cesium.Math.toDegrees(l.latitude),p=new Cesium.Cartesian3.fromDegrees(c,u,this.options.extrudedHeight+t);a.push(p)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(a),this.positions=a,this.previous={positions:L()(this.positions)},this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t;for(var e=[[]],i=0;i<this.options.positions.length;i++)e[0].push([this.options.positions[i].lng,this.options.positions[i].lat]);e[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var n=turf.polygon(e),o=turf.centroid(n);this.label.position=[o.geometry.coordinates[0],o.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=wu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=wu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=wu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=wu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return t.next=8,new Zi(this.sdk,this.options,{title:"多面体属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),be(p.sdk,p.options.id),re(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.Dialog.closeCallBack&&p.Dialog.closeCallBack();for(var t=0;t<p.nodePoints.length;t++)p.sdk.viewer.entities.remove(p.nodePoints[t]);p.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),p.positionEditing=!1},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(p)}});case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyhedron",(n=document.createElement("div")).innerHTML=vu(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("polygon-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=n.getElementsByTagName("*"),Cu.on(this,u),this._elms=Cu.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.cameraSelect&&p.cameraSelect(),p.goodsSelect&&p.goodsSelect();var t=p.attributeSelect,e=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=p._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===p.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){p.attributeType=t[e].key;break}}))}var s=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],a=Y(p._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(a){a.legp_search(s);var r=p._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];r.value=p.options["area-unit"];for(var l=0;l<s.length;l++)if(s[l].value===r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var t=0;t<s.length;t++)if(s[t].value===r.value){p.areaUnit=s[t].value;break}}))}var c=Nn(),u=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(u){u.legp_search(c);var h=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=c[p.labelFontFamily].value;for(var d=0;d<c.length;d++)if(c[d].value==h.value){u.legp_searchActive(c[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<c.length;t++)if(c[t].value===h.value){p.labelFontFamily=c[t].key;break}})),p._elms.labelFontFamily=[h]}}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:if(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.height=this.originalOptions.height,this.extrudedHeight=this.originalOptions.extrudedHeight,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),e=this.options.positions,i=[],this.options.height||0===this.options.height){for(n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,this.options.height+this.options.extrudedHeight);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(i)}for(this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),s=[[]],r=0;r<this.options.positions.length;r++)s[0].push([this.options.positions[r].lng,this.options.positions[r].lat]);return s[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),l=turf.polygon(s),c=turf.pointOnFeature(l),t.next=38,this.getClampToHeight({lng:c.geometry.coordinates[0],lat:c.geometry.coordinates[1]});case 38:t.sent,this.label.position=[c.geometry.coordinates[0],c.geometry.coordinates[1],this.extrudedHeight+this.height];case 40:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var o=turf.polygon(i),s=turf.pointOnFeature(o),a=document.getElementById(e.domid);this.sdk.viewer.scene.postRender.addEventListener((function(i){var n=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],t.options.extrudedHeight+t.options.height);if("block"===a.style.display||""===a.style.display){var o=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);o&&(a.style.left=(o.x+e.x).toFixed(0)+"px",a.style.top=(o.y+e.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=[[]],n=0;n<e.options.positions.length;n++)i[0].push([e.options.positions[n].lng,e.options.positions[n].lat]);i[0].push([e.options.positions[0].lng,e.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),e.options.label.position||(e.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:e.options.extrudedHeight+e.options.height}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,ground:!1,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 7:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=i[0].alt,s=0;s<i.length;s++)o>i[s].alt&&(o=i[s].alt);t.options.extrudedHeight=o;for(var a=0;a<i.length;a++)n.push(i[a].lng,i[a].lat,t.options.height+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n);var r=Cesium.Color.fromCssColorString(t.options.color);switch(2===t.sdk.viewer.scene.mode&&(r=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),extrudedHeight:t.options.extrudedHeight,perPositionHeight:!0,material:r}}),e.createLabel(t),t.options.areaByMeter=t.computeArea(i),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var o=!1,s=function(e,s){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(s,t.sdk.viewer),n=t.options.positions[i.index],o=!0;var a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,a),t.options.positions.splice(i.index,0,t.options.positions[i.index]),t.options.areaByMeter=t.computeArea(t.options.positions);for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}switch(t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}}else{var p=t.sdk.viewer.scene.pick(e.position);p&&p.id&&p.id.name&&"node-secondary-edit-point"===p.id.name&&(i=p.id,t.nodePoints.splice(p.id.index,1),t.sdk.viewer.entities.remove(p.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer))}},a=function(s,a){if(i){switch(t.options.positions[i.index]=n,o&&t.options.positions.splice(i.index,1),t.options.areaByMeter=t.computeArea(t.options.positions),t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}for(var r=t.options.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions),e(null,t.options.positions)}for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy()};t.event.mouse_left(s),t.event.mouse_right(a),t.event.mouse_move((function(e,n){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions);for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?a(o,i):s(o,i)}))})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())}));for(var r=0;r<t.options.positions.length;r++){var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:r,position:Cesium.Cartesian3.fromDegrees(t.options.positions[r].lng,t.options.positions[r].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(l)}}}}]);var i,n,s,r}(Mn);C()(xu,"elms",{});var Eu=xu;function Su(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Du(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Du(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Du(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Mu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ou(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ou(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Tu(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Nu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Tu(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.nodePoints=[],!i.options.positions||i.options.positions.length<3)i._error="集结地最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"AssembleObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.previous=null,i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new Zi(this.sdk,this.options,{title:"集结地属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),be(w.sdk,w.options.id),re(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=Su(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=Nn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=0;t<this.options.positions.length;t++)this._elms.lng&&this._elms.lng[t]&&(this._elms.lng[t].innerHTML=this.options.positions[t].lng.toFixed(8)),this._elms.lat&&this._elms.lat[t]&&(this._elms.lat[t].innerHTML=this.options.positions[t].lat.toFixed(8)),this._elms.alt&&this._elms.alt[t]&&(this._elms.alt[t].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Pu({},this.options.position):this.options.positions?l=Pu({},this.options.positions[0]):this.options.center?l=Pu({},this.options.center):this.options.start?l=Pu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){e.cartesian3Towgs84(i,e.sdk.viewer);m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous=null,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAssemble(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeAssemble(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeAssemble(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit,o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeAssemble(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineWidth:e.options.label.lineWidth,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Mu(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=0;l<t.options.positions.length;l++)r.push(t.options.positions[l].lng,t.options.positions[l].lat);var c=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},u=function(e,o){c(e,o);var s=t.cartesian3Towgs84(o,t.sdk.viewer);if(i){var a=i.index,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,s.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,r),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=e.position;l||(l={x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2});var u=t.sdk.viewer.scene.pick(l);u&&u.id&&u.id.name&&"node-secondary-edit-point"===u.id.name&&(i=u.id,n=t.cartesian3Towgs84(u.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(u.id.index,1),t.sdk.viewer.entities.remove(u.id),t.tip.set_text("左键确认,右键取消"))}t.renewPositions()},p=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?t.options.positions[i.index]=n:t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return e.length>=3?[].concat(L()(e),[e[0],e[1]]):L()(e)}),!1);for(var h=[[]],d=[],m=0;m<t.positionsH.length;m++){var f=t.cartesian3Towgs84(t.positionsH[m],t.sdk.viewer);d.push(f),h[0].push([f.lng,f.lat])}var v=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);h[0].push([v.lng,v.lat]);var g=turf.polygon(h),y=turf.pointOnFeature(g),b=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:y.geometry.coordinates[0],lat:y.geometry.coordinates[1]},b).then((function(e){t.label.position=[y.geometry.coordinates[0],y.geometry.coordinates[1],e]})),setTimeout((function(){t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p():u(o,i)}))})),s()}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Mn);function Bu(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="attack-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Lu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Au(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ju(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Iu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Iu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Iu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Fu(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Ru=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Fu(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.nodePoints=[],i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontFamily:n.label.fontFamily?n.label.fontFamily:0,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="箭头面最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"AttackArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.previous=null,i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=ju(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=ju(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=ju(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=ju(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&this._DialogObject.close(),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new Zi(this.sdk,this.options,{title:"箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" attackArrow",(s=document.createElement("div")).innerHTML=Bu(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("attack-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=Nn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,be(t.sdk,t.options.id),re(t.sdk,t.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,be(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Au({},this.options.position):this.options.positions?l=Au({},this.options.positions[0]):this.options.center?l=Au({},this.options.center):this.options.start?l=Au({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));i.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAttackArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeAttackArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();i.computeAttackArrow(i.options.positions);this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=le(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[[(i.options.positions[0].lng+i.options.positions[1].lng)/2,(i.options.positions[0].lat+i.options.positions[1].lat)/2]],p=2;p<i.options.positions.length;p++)u.push([i.options.positions[p].lng,i.options.positions[p].lat]);for(var h=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(h,{units:"kilometers"}),C=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:w(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(t){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function t(e){var n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){t.next=12;break}if(!(e.distance>=d[o])){t.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),t.abrupt("break",12);case 9:o--,t.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=Au({},i.options.positions[r]);if(e.distance){t.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},t.next=25;break;case 18:return t.next=20,turf.lineSliceAlong(h,0,e.distance,{units:"kilometers"});case 20:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[n]||(s[n]={}),s[n].lng=c[0],s[n].lat=c[1];case 25:i.renewPositions(s);case 26:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeAttackArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeAttackArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d}),t.options.label.ground=u;for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=ju(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),-1!==e[n].className.indexOf("blur")&&(u="blur"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var r=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},l=function(e,o){if(r(e,o),i){t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var s=i.index;i.index===t.options.positions.length-1&&(s+=1);var a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:s,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});i=a,n=t.options.positions[i.index],t.nodePoints.splice(i.index,0,a),s<t.options.positions.length?(i=null,t.tip.set_text("请选择一个顶点,右键取消")):(t.options.positions.splice(i.index,0,t.options.positions[i.index]),t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer)),t.renewPositions()}else{var l=t.sdk.viewer.scene.pick(e.position||e.endPosition);l&&l.id&&l.id.name&&"node-secondary-edit-point"===l.id.name&&(i=l.id,n=t.cartesian3Towgs84(l.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(l.id.index,1),t.sdk.viewer.entities.remove(l.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"))}},c=function(e,o){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?(t.options.positions[i.index]=n,t.options.positions.length>3&&i.index===t.options.positions.length-1&&t.options.positions.splice(i.index+1,1)):t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(t.positionsH)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]])}),!1);for(var u=[[]],p=[],h=0;h<t.positionsH.length;h++){var d=t.cartesian3Towgs84(t.positionsH[h],t.sdk.viewer);p.push(d),u[0].push([d.lng,d.lat])}var m=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);u[0].push([m.lng,m.lat]);var f=turf.polygon(u),v=turf.pointOnFeature(f),g=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:v.geometry.coordinates[0],lat:v.geometry.coordinates[1]},g).then((function(e){t.label.position=[v.geometry.coordinates[0],v.geometry.coordinates[1],e]})),setTimeout((function(){t.event.mouse_left(l),t.event.mouse_right(c),t.event.mouse_move(r),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),t.nodePoints.pop(),i.index&&i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=i.index-1),t.renewPositions())})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?c():l(o,i)}))})),s()}),200)}}),0)}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Mn);function zu(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="pincer-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Hu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Vu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Hu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Hu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Gu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Uu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Uu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Wu(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Yu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Wu(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.options.height=n.height,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i._elms={},i.nodePoints=[],i.spreadTime=n.spreadTime,i.entity,i.event,i.operate={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<5)i._error="双箭头最少需要五个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"PincerArrowObject"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label.text=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Gu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Gu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Gu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Gu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new Zi(this.sdk,this.options,{title:"双箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" pincerArrow",(s=document.createElement("div")).innerHTML=zu(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("pincer-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=Nn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,be(t.sdk,t.options.id),re(t.sdk,t.options.id)}),200),setTimeout((function(){t.previous=null}),50)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,be(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Vu({},this.options.position):this.options.positions?l=Vu({},this.options.positions[0]):this.options.center?l=Vu({},this.options.center):this.options.start?l=Vu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(this.cartesian3Towgs84(this.positions[v],this.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computePincerArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computePincerArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance1/this.TweenAnimate._valuesEnd.distance1*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var s=this.computePincerArrow(this.options.positions);if(0!=s.length){this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var r,l=le(),c=l.sdkP,u=l.sdkD;if(u&&c&&this.sdk===u)(r=c.entityMap.get(this.options.id))&&r.entity&&r.entity.polygon&&r.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(r.positionsH),[r.positionsH[0],r.positionsH[1]])}),!1));else{for(var p=[],h=[],d=[],m=[],f=0;f<=2;f++)m.push([this.options.positions[f].lng,this.options.positions[f].lat]);m.push([this.options.positions[0].lng,this.options.positions[0].lat]);for(var v=turf.lineString(m),g=turf.booleanClockwise(v),y=0;y<=100;y++){var b=this.cartesian3Towgs84(s[y],this.sdk.viewer);p.push([b.lng,b.lat,b.alt])}g?p.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]):p.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]);for(var C=312;C>=212;C--){var w=this.cartesian3Towgs84(s[C],this.sdk.viewer);h.push([w.lng,w.lat,w.alt])}g?h.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]):h.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]),d.push([(this.options.positions[0].lng+this.options.positions[1].lng)/2,(this.options.positions[0].lat+this.options.positions[1].lat)/2],[this.options.positions[4].lng,this.options.positions[4].lat]);var k=this.deepCopyObj(this.options.positions),_=turf.lineString(p),x=turf.length(_,{units:"kilometers"}),E=turf.lineString(h),S=turf.length(E,{units:"kilometers"}),D=turf.lineString(d),P=turf.length(D,{units:"kilometers"}),M=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance1:x*M,distance2:S*M,distance3:P*M}).to({distance1:x,distance2:S,distance3:P},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:O(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():O({distance1:x*M,distance2:S*M,distance3:P*M}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}}function O(t){return T.apply(this,arguments)}function T(){return(T=o()(a.a.mark((function t(e){var n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:if(n=2,o=3,g&&(n=3,o=2),e.distance1){t.next=10;break}k[n].lng=k[1].lng,k[n].lat=k[1].lat,t.next=16;break;case 10:return t.next=12,turf.lineSliceAlong(_,0,e.distance1,{units:"kilometers"});case 12:s=t.sent,r=L()(s.geometry.coordinates[s.geometry.coordinates.length-1]),k[n].lng=r[0],k[n].lat=r[1];case 16:if(e.distance2){t.next=21;break}k[o].lng=k[0].lng,k[3].lat=k[0].lat,t.next=27;break;case 21:return t.next=23,turf.lineSliceAlong(E,0,e.distance2,{units:"kilometers"});case 23:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),k[o].lng=c[0],k[o].lat=c[1];case 27:if(e.distance3){t.next=32;break}k[4].lng=d[0][0],k[4].lat=d[0][1],t.next=38;break;case 32:return t.next=34,turf.lineSliceAlong(D,0,e.distance3,{units:"kilometers"});case 34:u=t.sent,p=L()(u.geometry.coordinates[u.geometry.coordinates.length-1]),k[4].lng=p[0],k[4].lat=p[1];case 38:i.renewPositions(k);case 39:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computePincerArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computePincerArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Gu(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),-1!==e[n].className.indexOf("blur")&&(u="blur"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<r.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(r[n].lng,r[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var r=L()(t.options.positions),l=function(e,o){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer),r[i.index]=t.options.positions[i.index];var s=i.index,a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:s,position:Cesium.Cartesian3.fromDegrees(r[i.index].lng,r[i.index].lat,r[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,a),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=t.sdk.viewer.scene.pick(e.position);l&&l.id&&l.id.name&&"node-secondary-edit-point"===l.id.name&&(i=l.id,n=t.cartesian3Towgs84(l.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(l.id.index,1),t.sdk.viewer.entities.remove(l.id),t.tip.set_text("左键确定,右键取消"))}t.renewPositions(),t.tip.setPosition(o,e.position.x,e.position.y)},c=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(r[i.index]=n,t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),e(null,r)),t.options.positions=L()(r),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(t.positionsH)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]])}),!1),setTimeout((function(){t.event.mouse_left(l),t.event.mouse_right(c),t.event.mouse_move((function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t.renewPositions()),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?c():l(o,i)}))}));for(var e=[[]],n=[],o=0;o<t.positionsH.length;o++){var a=t.cartesian3Towgs84(t.positionsH[o],t.sdk.viewer);n.push(a),e[0].push([a.lng,a.lat])}var r=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);e[0].push([r.lng,r.lat]);var u=turf.polygon(e),p=turf.pointOnFeature(u),h=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1]},h).then((function(e){t.label.position=[p.geometry.coordinates[0],p.geometry.coordinates[1],e]})),s()}),200)}}),0)}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Mn);function Ju(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function qu(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xu(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qu(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):qu(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Zu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ku(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ku(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function $u(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Qu=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=$u(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.nodePoints=[],!i.options.positions||i.options.positions.length<2)i._error="直线箭头需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"StraightArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter||0==this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Zu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Zu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Zu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Zu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new Zi(this.sdk,this.options,{title:"直线箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=Ju(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=Nn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,be(t.sdk,t.options.id),re(t.sdk,t.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,be(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Xu({},this.options.position):this.options.positions?l=Xu({},this.options.positions[0]):this.options.center?l=Xu({},this.options.center):this.options.start?l=Xu({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var n=[],o=L()(this.positions),s=[],a=0;a<o.length;a++){var r=this.cartesian3Towgs84(o[a],this.sdk.viewer);n.push([r.lng,r.lat])}for(var l=Cesium.Cartesian3.fromDegrees((n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2),c=0;c<o.length;c++)l.x,o[c].x,s.push({x:l.x-o[c].x,y:l.y-o[c].y,z:l.z-o[c].z});var u=[];this.event.mouse_move((function(t,i){e.cartesian3Towgs84(i,e.sdk.viewer);u=[];for(var n=0;n<s.length;n++)u.push({x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),u=[];for(var n=0;n<s.length;n++){var o={x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z};u.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=u,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),u=[];for(var t=0;t<s.length;t++){var o={x:i.x-s[t].x,y:i.y-s[t].y,z:i.z-s[t].z};u.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=u,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(u.length>0)for(var e=0;e<u.length;e++)t.push(i.cartesian3Towgs84(u[e],i.sdk.viewer));else for(var n=0;n<o.length;n++)t.push(i.cartesian3Towgs84(o[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var p=[],h=0;h<this.positions.length;h++)p.push(i.cartesian3Towgs84(this.positions[h],i.sdk.viewer));this.renewPositions(p),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeStraightArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeStraightArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=le(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[],p=0;p<i.options.positions.length;p++)u.push([i.options.positions[p].lng,i.options.positions[p].lat]);for(var h=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(h,{units:"kilometers"}),C=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:w(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(t){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function t(e){var n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){t.next=12;break}if(!(e.distance>=d[o])){t.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),t.abrupt("break",12);case 9:o--,t.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=Xu({},i.options.positions[r]);if(e.distance){t.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},t.next=24;break;case 18:return t.next=20,turf.lineSliceAlong(h,0,e.distance,{units:"kilometers"});case 20:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[1].lng=c[0],s[1].lat=c[1];case 24:i.renewPositions(s);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeStraightArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeStraightArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Zu(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=0;l<t.options.positions.length;l++)r.push(t.options.positions[l].lng,t.options.positions[l].lat);var c=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},u=function(e,o){c(e,o);var s=t.cartesian3Towgs84(o,t.sdk.viewer);if(i){var a=i.index,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,s.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,r),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=e.position;l||(l={x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2});var u=t.sdk.viewer.scene.pick(l);u&&u.id&&u.id.name&&"node-secondary-edit-point"===u.id.name&&(i=u.id,n=t.cartesian3Towgs84(u.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(u.id.index,1),t.sdk.viewer.entities.remove(u.id),t.tip.set_text("左键确认,右键取消"))}t.renewPositions()},p=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?t.options.positions[i.index]=n:t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeStraightArrow(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeStraightArrow(t.options.positions);return e.length>=3?[].concat(L()(e),[e[0],e[1]]):L()(e)}),!1),setTimeout((function(){t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p():u(o,i)}))}));for(var e=[[]],i=[],n=0;n<t.positionsH.length;n++){var o=t.cartesian3Towgs84(t.positionsH[n],t.sdk.viewer);i.push(o),e[0].push([o.lng,o.lat])}var a=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);e[0].push([a.lng,a.lat]);var r=turf.polygon(e),l=turf.pointOnFeature(r),h=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},h).then((function(e){t.label.position=[l.geometry.coordinates[0],l.geometry.coordinates[1],e]})),s()}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Mn);function tp(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function ep(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ip(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ep(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ep(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function np(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return op(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?op(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function op(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function sp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ap=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=sp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.radius=n.radius||0===n.radius?n.radius:10,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"CircleObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(L()(this.positions),[this.positions[0],this.positions[1]])}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=np(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=np(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=np(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=np(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new Zi(this.sdk,this.options,{title:"圆属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),be(m.sdk,m.options.id),re(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.reset(),m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=tp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),m.heightMode=m.heightMode,setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=Nn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelLineColor=this.originalOptions.label.lineColor,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ip({},this.options.position):this.options.positions?l=ip({},this.options.positions[0]):this.options.center?l=ip({},this.options.center):this.options.start?l=ip({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions,u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),this.previous={positions:ip({},this.options.center)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt;var o=0,s=!1;switch(e.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=e.createCircle(n,e.options.radius),r=[];if(s){e.positions=Cesium.Cartesian3.fromDegreesArray(a);var l=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:n.lng,lat:n.lat},l).then((function(t){e.label&&(e.label.position=[n.lng,n.lat,t])}))}else{for(var c=0;c<a.length;c+=2)r.push(a[c],a[c+1],n.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),e.label&&(e.label.position=[n.lng,n.lat,n.alt+o])}e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={positions:ip({},e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(t.lng.toFixed(8)),e.options.center.lat=Number(t.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.previous={positions:ip({},e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!0))}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.createCircle(t,this.options.radius),s=[];if(i)this.positions=Cesium.Cartesian3.fromDegreesArray(o),setTimeout((function(){var i=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:t.lng,lat:t.lat},i).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100);else{for(var a=0;a<o.length;a+=2)s.push(o[a],o[a+1],t.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[t.lng,t.lat,t.alt+n])}return this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius).toFixed(2)),this.areaUnit=this.areaUnit,o}}}],[{key:"create",value:function(t){var i,n=t.createCircle(t.options.center,t.options.radius),o=0;switch(t.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+o});var s=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(i=!1,s=new Cesium.CustomColorMaterialSource({color:t.options.color}));for(var a,r=[],l=0;l<n.length;l+=2)r.push(n[l],n[l+1],t.options.center.alt+o);switch(t.options.label.ground=i,t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),a=Cesium.Cartesian3.fromDegreesArray(n),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:i?new Cesium.PolygonHierarchy(a):new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!i,material:s,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e=function(){var e=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=L()(t.sdk.viewer.entities.values),e.next=3,t.getClampToHeight(t.options.center,i);case 3:n=e.sent,o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.center.lng,t.options.center.lat,n),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(o);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确认,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var i,n=[],s=ip({},t.options.center),r=null;n=t.createCircle(t.options.center,t.options.radius),t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(n))}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),setTimeout((function(){var e=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:t.options.center.lng,lat:t.options.center.lat},e).then((function(e){t.label.position=[t.options.center.lng,t.options.center.lat,e]}))}),50),setTimeout((function(){t.event.mouse_left((function(e,n){i&&(t.sdk.viewer.entities.remove(i),i=null),s=t.cartesian3Towgs84(n,t.viewer);var o=t.computeDistance2([t.options.center,s]);t.radius=o,YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode})),t.event.mouse_right((function(e,n){i&&(t.sdk.viewer.entities.remove(i),i=null),YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode})),t.event.mouse_move((function(e,o){i&&(i.show=!0),s=t.cartesian3Towgs84(o,t.viewer),r=t.computeDistance2([t.options.center,s]),n=t.createCircle(t.options.center,r),t.tip.setPosition(o,e.endPosition.x,e.endPosition.y)})),e()}),200),i=t.sdk.viewer.entities.add(new Cesium.Entity({show:!1,position:new Cesium.CallbackProperty((function(e){if(s){var i=t.computeMidpoint(t.options.center,s);return Cesium.Cartesian3.fromDegrees(i.lng,i.lat,s.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return r>1e3?"半径:"+(r/1e3).toFixed(2)+" 公里":"半径:"+r+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polyline:{positions:new Cesium.CallbackProperty((function(e){return Cesium.Cartesian3.fromDegreesArray([t.options.center.lng,t.options.center.lat,s.lng,s.lat])}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),t.nodePoints.push(i)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=np(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Mn);function rp(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function lp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?lp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):lp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function up(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return pp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function hp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var dp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=hp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"EllipseObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;this.entity.polygon.hierarchy=[],!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),this.previous=null,e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"semiMinorAxis",get:function(){return this.options.semiMinorAxis},set:function(t){this.options.semiMinorAxis=t,this.height=this.height}},{key:"semiMajorAxis",get:function(){return this.options.semiMajorAxis},set:function(t){this.options.semiMajorAxis=t,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"bearing",get:function(){return this.options.bearing},set:function(t){this.options.bearing=t,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=up(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=up(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=up(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=up(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new Zi(this.sdk,this.options,{title:"椭圆属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),be(m.sdk,m.options.id),re(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.reset(),m.previous=null,m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=rp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=Nn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.semiMinorAxis=this.originalOptions.semiMinorAxis,this.semiMajorAxis=this.originalOptions.semiMajorAxis,this.bearing=this.originalOptions.bearing,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!this.options.customView){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=cp({},this.options.position):this.options.positions?l=cp({},this.options.positions[0]):this.options.center?l=cp({},this.options.center):this.options.start?l=cp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions();this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis}),this.event.mouse_move((function(t,i){[];var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt,e.renewPositions(n),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){[];var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{[];var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.center=e.options.center,e.createEllipse(e.options.center,{bearing:e.options.bearing,semiMinorAxis:e.options.semiMinorAxis,semiMajorAxis:e.options.semiMajorAxis}),e.label.position=[t.lng,t.lat],e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)}else this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!0)}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}return this.positions=this.createEllipse(t,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis,height:t.alt+n}),i?setTimeout((function(){e.getClampToHeight({lng:t.lng,lat:t.lat}).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100):this.label&&(this.label.position=[t.lng,t.lat,t.alt+n]),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.semiMinorAxis*this.options.semiMajorAxis).toFixed(2)),this.areaUnit=this.areaUnit,this.positions}}}],[{key:"create",value:function(t){var i,n=0;switch(t.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+n});var o=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(i=!1,o=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=i;var s=t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis,height:t.options.center.alt+n});switch(t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(s),perPositionHeight:!i,material:o,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(s),[s[0],s[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.semiMinorAxis*t.options.semiMajorAxis).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)},n=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o,d);case 3:s=e.sent,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(r);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个编辑点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat),r=t.options.semiMinorAxis,l=t.options.semiMajorAxis,c=t.options.bearing,u=t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis});t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(u)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(u),[u[0],u[1]])}),!1);var p=t.entity.polyline.positions.getValue(),h=p.length,d=L()(t.sdk.viewer.entities.values);setTimeout((function(){t.event.mouse_left((function(n,o){if(e)t.options.semiMinorAxis=r,t.options.semiMajorAxis=l,t.options.bearing=c,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1),t.heightMode=t.heightMode;else{var a=t.sdk.viewer.scene.pick(n.position);if(a&&a.id&&a.id.name&&"node-secondary-edit-point"===a.id.name&&("semiMinorAxis"===a.id._type||"semiMajorAxis"===a.id._type)){t.tip.set_text("左键确认,右键取消"),e=a.id;for(var p=0;p<t.nodePoints.length;p++)t.sdk.viewer.entities.remove(t.nodePoints[p]);t.nodePoints=[];var h=o,d=t.cartesian3Towgs84(h,t.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat,d.alt);var m=Cesium.Cartesian3.distance(s,h),f={x:t.center.lng,y:t.center.lat},v={x:d.lng,y:d.lat};c=i(f,v),"semiMinorAxis"===e._type&&(r=m,c+=90),"semiMajorAxis"===e._type&&(l=m),u=t.createEllipse(t.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}}})),t.event.mouse_move((function(n,o){if(e){var a=o,p=t.cartesian3Towgs84(o,t.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat,p.alt);var h=Cesium.Cartesian3.distance(s,a),d={x:t.center.lng,y:t.center.lat},m={x:p.lng,y:p.lat};c=i(d,m),"semiMinorAxis"===e._type&&(r=h,c+=90),"semiMajorAxis"===e._type&&(l=h),u=t.createEllipse(t.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}t.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.heightMode=t.heightMode})),t.getClampToHeight({lng:t.center.lng,lat:t.center.lat},d).then((function(e){t.label&&(t.label.position=[t.center.lng,t.center.lat,e])})),n(p[0],"semiMajorAxis"),n(p[(h-2)/4],"semiMinorAxis"),n(p[(h-2)/2],"semiMajorAxis"),n(p[h-2-(h-2)/4],"semiMinorAxis")}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=up(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Mn);function mp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col material-box">\n <span class="label">材质样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function fp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return vp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?vp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function vp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var gp=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=fp(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(gp,"event",{});var yp=new gp;function bp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Cp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Cp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Cp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function wp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var kp=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=wp(this,e,[t,i])).options.color=i.color||"#ff0000",n.options.extrudedHeight=i.extrudedHeight||2.4,n.options.positions=i.positions,n.options.material=Number(i.material)||0===Number(i.material)?Number(i.material):3,n.options.duration=i.duration||0===i.duration?i.duration:1e3,n.options.show=!i.show&&!1!==i.show||i.show,n.options["nose-to-tail"]=i["nose-to-tail"]||!1,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n.Dialog=o,n._elms={},!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),e.create(n)),n}return qi()(e,t),x()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000",this.entity.polylineVolume.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}},{key:"material",get:function(){return this.options.material},set:function(t){var e=this;this.options.material=Number(t)||0===Number(t)?Number(t):3,this.entity.polylineVolume.material=this.getMaterial(),this._elms.material&&this._elms.material.forEach((function(t){t.value=e.options.material}))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){this.options["nose-to-tail"]=t;for(var e=this.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,e[n].alt);t&&i.push(e[0].lng,e[0].lat,e[0].alt),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.entity.polylineVolume.shape=[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=bp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=bp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=bp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++){var n,o=bp(e[i].attributes);try{var s,a=function(){var o=n.value;return e[i]&&e[i].attributes?"@click"===o.name?(e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1):void 0:0};for(o.s();!(n=o.n()).done&&(0===(s=a())||1!==s););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=49;break}return t.next=6,new Zi(this.sdk,this.options,{title:"电子围墙属性",left:"180px",top:"100px",confirmCallBack:function(t){v.name=v.name.trim(),v.name||(v.name="未命名对象"),v.options.label.position={lng:v.label.position[0],lat:v.label.position[1],alt:v.label.position[2]},v.originalOptions=v.deepCopyObj(v.options),v._DialogObject.close(),v.Dialog.confirmCallBack&&v.Dialog.confirmCallBack(v.originalOptions),be(v.sdk,v.options.id),re(v.sdk,v.options.id)},resetCallBack:function(){v.reset(),v.Dialog.resetCallBack&&v.Dialog.resetCallBack()},removeCallBack:function(){v.Dialog.removeCallBack&&v.Dialog.removeCallBack()},closeCallBack:function(){v.reset(),v.Dialog.closeCallBack&&v.Dialog.closeCallBack();for(var t=0;t<v.nodePoints.length;t++)v.sdk.viewer.entities.remove(v.nodePoints[t]);v.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),v.event&&v.event.destroy(),v.event&&v.tip.destroy()},showCallBack:function(t){v.options.show=t,v.originalOptions.show=t,v.show=t,v.Dialog.showCallBack&&v.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(v)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(n=document.createElement("div")).innerHTML=mp(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,o=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-gradient"></i>上升墙',value:"上升墙",key:1,icon:"icon-wall-gradient"},{name:'<i class="icon icon-wall-arrow"></i>箭头墙',value:"箭头墙",key:2,icon:"icon-wall-arrow"},{name:'<i class="icon icon-wall-warn"></i>警戒墙',value:"警戒墙",key:3,icon:"icon-wall-warn"}],(s=Y(n.getElementsByClassName("material-box")[0],".material")).legp_search(o),(r=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(r),l=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],c=0;case 22:if(!(c<o.length)){t.next=31;break}if(o[c].key!==this.material){t.next=28;break}return s.legp_searchActive(o[c].value),l.value=o[c].value,r.className="icon icon-active ".concat(o[c].icon),t.abrupt("break",31);case 28:c++,t.next=22;break;case 31:l.addEventListener("input",(function(t,e){for(var i=0;i<o.length;i++)if(o[i].value===l.value){v.material=o[i].key,r.className="icon icon-active ".concat(o[i].icon);break}})),new hn("radar-scan-edit-tabs",void 0,this.sdk),u=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){v.color=t},clear:function(){v.color="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelColor=t},clear:function(){v.labelColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelLineColor=t},clear:function(){v.labelLineColor="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelBackgroundColorStart=t},clear:function(){v.labelBackgroundColorStart="rgba(255,255,255,1)"}}),m=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelBackgroundColorEnd=t},clear:function(){v.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),f=n.getElementsByTagName("*"),yp.on(this,f),this._elms=yp.element,this._elms.color=[u],this._elms.labelColor=[p],this._elms.labelLineColor=[h],this._elms.labelBackgroundColorStart=[d],this._elms.labelBackgroundColorEnd=[m],setTimeout((function(){v.attributeLink=v.options.attribute.link.content,v.ISCSelect&&v.ISCSelect(),v.goodsSelect&&v.goodsSelect(),v.cameraSelect&&v.cameraSelect(),v.attributeVr=v.options.attribute.vr.content;var t=v.attributeSelect,e=Y(v._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(e.legp_search(t),v._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=v._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<t.length;n++)if(t[n].key===v.options.attributeType){i.value=t[n].value,e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){v.attributeType=t[e].key;break}}));var o=Nn(),s=Y(v._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=v._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[v.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===a.value){v.labelFontFamily=o[t].key;break}})),v._elms.labelFontFamily=[a]}}}),0),t.next=50;break;case 49:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 50:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=this.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,e[n].alt);this.noseToTail&&i.push(i[0],i[1],i[2]),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t.noseToTail}))}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"getMaterial",value:function(){var t,e=this;switch(this.options.material){case 0:t=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(t=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:t=new Cesium.PolylineTrailLinkMaterialProperty({color:Cesium.Color.fromCssColorString(this.options.color),duration:this.options.duration});break;case 2:case 3:var i;switch(this.options.material){case 2:i="arrow";break;case 3:i="warn"}t=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,repeats:new Cesium.CallbackProperty((function(){var t=[[1,1,1]];if(!e.entity||!e.entity.polylineVolume)return t;var i=e.entity.polylineVolume.positions.getValue();if(!Cesium.defined(i))return t;var n=0,o=[];t=[];for(var s=!1,a=0;a<i.length-1;++a){var r=Cesium.Cartesian3.distance(i[a],i[a+1]);r>=1e5&&(s=!0),o.push(r),n+=r}var l=n/e.options.extrudedHeight;if(l/=1,s)for(var c=0;c<o.length;c++){t.push([((c+1)/o.length).toFixed(30),l/5,1])}else for(var u=0;u<o.length;u++){var p=o[u]/n;p;var h=p*l;t.push([((u+1)/o.length).toFixed(30),h,1])}return t}),!1),duration:this.options.duration})}return t}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(t){t.label=new zn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,ground:!1,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=i.options.positions,o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat,n[s].alt);i.noseToTail&&o.push(o[0],o[1],o[2]),i.entity=i.sdk.viewer.entities.add({id:i.options.id,show:i.options.show,polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),i.entity.polylineVolume.material=i.getMaterial(),e.createLabel(i),be(i.sdk,i.options.id),i.options.show&&Qt(0,i.options.id);case 9:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,o[a].alt);t.noseToTail&&s.push(s[0],s[1],s[2]);var r=!1,l=function(e,o){if(i){r=!0;var a=t.sdk.viewer.scene.clampToHeight(o,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(a,t.sdk.viewer),n=t.options.positions[i.index];var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,l),t.options.positions.splice(i.index,0,t.options.positions[i.index]);var c=t.options.positions;s=[];for(var u=0;u<c.length;u++)s.push(c[u].lng,c[u].lat,c[u].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],t.tip.setPosition(o,e.position.x,e.position.y),t.material=t.material}else{var p=t.sdk.viewer.scene.pick(e.position);p&&p.id&&p.id.name&&"node-secondary-edit-point"===p.id.name&&(i=p.id,t.nodePoints.splice(p.id.index,1),t.sdk.viewer.entities.remove(p.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer),t.entity.polylineVolume.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s)}),!1))}},c=function(o,a){i&&(t.options.positions[i.index]=n,r&&t.options.positions.splice(i.index,1),e(null,t.options.positions));var l=t.options.positions;s=[];for(var c=0;c<l.length;c++)s.push(l[c].lng,l[c].lat,l[c].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight];for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.material=t.material};t.event.mouse_left(l),t.event.mouse_right(c);var u=!1;t.event.mouse_move((function(e,n){if(i){var o=t.sdk.viewer.scene.clampToHeight(n,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var a=t.options.positions;s=[];for(var r=0;r<a.length;r++)s.push(a[r].lng,a[r].lat,a[r].alt);if(t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],u)return u=!1,void(t.material=t.material)}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(u=!0,t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?c(o,i):l(o,i)}))}));for(var p=0;p<t.options.positions.length;p++){var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:p,position:Cesium.Cartesian3.fromDegrees(t.options.positions[p].lng,t.options.positions[p].lat,t.options.positions[p].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(h)}}}}]);var i,n,s}(Mn);function _p(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" data-min="0.01" max="999999" @model="width">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col corner-type-box">\n <span class="label">拐角类型</span>\n <div class="corner-type"></div>\n </div>\n <div class="col material-box">\n <span class="label">墙体样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Ep(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Sp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Sp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Sp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Dp=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=Ep(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Dp,"event",{});var Pp=new Dp;function Mp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Op(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Op(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Op(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Tp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Np=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Tp(this,e,[t,i]))._elms={},n.options.color=i.color||"#ffffff",n.options.width=i.width||.24,n.options["nose-to-tail"]=i["nose-to-tail"]||!1,n.options.extrudedHeight=i.extrudedHeight||2.4,n.cornerType=i.cornerType,n.options.positions=i.positions,n.options.material=Number(i.material)||0,n.options.show=!i.show&&!1!==i.show||i.show,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera.content=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n.Dialog=o,!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),e.create(n)),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"WallRealStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.entity)for(var i=0;i<this.entity.values.length;i++){if(this.entity.values[i].polylineVolume){var n=this.entity.values[i];n.polylineVolume.material=this.getMaterial(n.id)}if(this.entity.values[i].polygon)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color)}this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!1,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t,this.options.width<=.01&&(this.options.width=.01),this.update(),this._elms.width&&this._elms.width.forEach((function(e){e.value=t}))}},{key:"cornerType",get:function(){return this.options.cornerType},set:function(t){switch(t){case 0:case"0":t=0;break;case 1:case"1":t=1;break;case 2:case"2":t=2;break;default:t=0}this.options.cornerType=t,this.update(),this._elms.cornerType&&this._elms.cornerType.forEach((function(e){e.value=t}))}},{key:"material",get:function(){return this.options.material},set:function(t){if(this.options.material=Number(t),this.entity)for(var e=0;e<this.entity.values.length;e++)if(this.entity.values[e].polylineVolume){var i=this.entity.values[e];i.polylineVolume.material=this.getMaterial(i.id)}this._elms.material&&this._elms.material.forEach((function(e){e.value=t}))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){this.options["nose-to-tail"]=t,this.update(),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.update(),this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"calculatePositions3",value:function(){var t=this.deepCopyObj(this.options.positions);this.noseToTail&&t.push(t[0],t[1]);for(var e=[],i=[],n=[],o=[],s=[],a=0;a<t.length-1;a++){var r=turf.point([t[a].lng,t[a].lat]),l=turf.point([t[a+1].lng,t[a+1].lat]),c=turf.rhumbBearing(r,l),u=turf.destination(r,this.options.width/2/1e3,c+90,{units:"kilometers"}),p=turf.destination(l,this.options.width/2/1e3,c+90,{units:"kilometers"}),h=turf.destination(r,this.options.width/2/1e3,c-90,{units:"kilometers"}),d=turf.destination(l,this.options.width/2/1e3,c-90,{units:"kilometers"}),m=u.geometry.coordinates,f=p.geometry.coordinates,v=h.geometry.coordinates,g=d.geometry.coordinates;m[2]=t[a].alt,f[2]=t[a+1].alt,v[2]=t[a].alt,g[2]=t[a+1].alt,e.push(m,f),i.push(v,g)}if(0===this.cornerType);else if(1===this.cornerType)for(var y=0;y<e.length-3;y+=2)0==y&&(o.push(e[y]),s.push(i[y])),o.push(e[y+1],e[y+2]),s.push(i[y+1],i[y+2]),y==e.length-4&&(o.push(e[y+3]),s.push(i[y+3]));else if(2===this.cornerType)for(var b=0;b<e.length-3;b+=2){var C=t[b/2+1],w=turf.point(e[b+1]),k=turf.point(i[b+1]),_=turf.rhumbBearing(w,k),x=turf.point(e[b+2]),E=turf.point(i[b+2]),S=turf.rhumbBearing(x,E);console.log("bearing1, bearing2",_-S);var D=!0;if(Math.sin(Cesium.Math.toRadians(_-S))>0){var P=_;_=S+180,S=P+180,D=!1}var M=turf.sector([C.lng,C.lat,C.alt],this.options.width/1e3/2,_,S,{units:"kilometers"});if(console.log("sector",M),0==b&&(o.push(e[b]),s.push(i[b])),console.log("face",D),D){o.push(e[b+1],e[b+2]);for(var O=1;O<M.geometry.coordinates[0].length-1;O++)s.push([].concat(L()(M.geometry.coordinates[0][O]),[e[b+1][2]]))}else{for(var T=M.geometry.coordinates[0].length-2;T>0;T--)o.push([].concat(L()(M.geometry.coordinates[0][T]),[e[b+1][2]]));s.push(i[b+1],i[b+2])}b==e.length-4&&(o.push(e[b+3]),s.push(i[b+3]))}n=[].concat(o);for(var N=s.length-1;N>=0;N--)n.push(s[N]);return n.push(n[0]),console.log("positions",n),n}},{key:"calculatePositions2",value:function(){for(var t=[],e=0;e<this.options.positions.length-2;e++){var i=(180-u(this.options.positions[e],this.options.positions[e+1],this.options.positions[e+2]))/2,n=Math.tan(i*Math.PI/180)*(this.options.width/2);console.log("width",n,i);var o=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[0].lng,this.options.positions[0].lat]]),s=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[2].lng,this.options.positions[2].lat]]),a=turf.lineSliceAlong(o,0,n/1e3,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,n/1e3,{units:"kilometers"}),l=a.geometry.coordinates[a.geometry.coordinates.length-1],c=r.geometry.coordinates[r.geometry.coordinates.length-1];l[2]=this.options.positions[e+1].alt,c[2]=this.options.positions[e+1].alt,t.push([l,c]),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(l[0],l[1],l[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(c[0],c[1],c[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})}function u(t,e,i){var n=turf.point([t.lng,t.lat]),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a={units:"kilometers"},r=turf.rhumbDistance(n,o,a),l=turf.rhumbDistance(s,o,a);var c=turf.rhumbBearing(n,o),u=turf.rhumbBearing(s,o),p=Math.abs((c-u+360)%360);return p>180&&(p=360-p),p}return t}},{key:"calculatePositions",value:function(){var t=this.deepCopyObj(this.options.positions);this.noseToTail&&t.push(t[0],t[1]);for(var e=[],i=[],n=0;n<t.length-1;n++){var o=turf.point([t[n].lng,t[n].lat]),s=turf.point([t[n+1].lng,t[n+1].lat]),a=turf.rhumbBearing(o,s),r=turf.destination(o,this.options.width/2/1e3,a+90,{units:"kilometers"}),l=turf.destination(s,this.options.width/2/1e3,a+90,{units:"kilometers"}),c=turf.destination(o,this.options.width/2/1e3,a-90,{units:"kilometers"}),u=turf.destination(s,this.options.width/2/1e3,a-90,{units:"kilometers"}),p=r.geometry.coordinates,h=l.geometry.coordinates,d=c.geometry.coordinates,m=u.geometry.coordinates;p[2]=t[n].alt,h[2]=t[n+1].alt,d[2]=t[n].alt,m[2]=t[n+1].alt,e.push([p,h,m,d,p])}if(i.push(e[0]),0===this.cornerType)for(var f=1;f<e.length;f++){var v=t[f],g=turf.point(e[f-1][1]),y=turf.point(e[f-1][2]),b=turf.rhumbBearing(g,y),C=turf.point(e[f][0]),w=turf.point(e[f][3]),k=turf.rhumbBearing(C,w);if(Math.sin(Cesium.Math.toRadians(b-k))>0){var _=b;b=k+180,k=_+180,!1}var x=Math.abs(b-k);x>180&&(x=360-x);var E=this.options.width/2/Math.cos(Cesium.Math.toRadians(x/2));E>5*this.options.width&&(E=5*this.options.width);var S=turf.sector([v.lng,v.lat],this.options.width/1e3/2,b,k,{units:"kilometers",steps:3600}),D=turf.point([v.lng,v.lat]),P=turf.point(L()(S.geometry.coordinates[0][Math.ceil(S.geometry.coordinates[0].length/2)])),M=turf.bearing(D,P),O=turf.destination(D,E/1e3,M,{units:"kilometers"}),T=[];T.push([].concat(L()(S.geometry.coordinates[0][0]),[v.alt])),T.push([].concat(L()(S.geometry.coordinates[0][1]),[v.alt])),T.push([].concat(L()(O.geometry.coordinates),[v.alt])),T.push([].concat(L()(S.geometry.coordinates[0][S.geometry.coordinates[0].length-2]),[v.alt])),i.push(T),i.push(e[f])}else if(1===this.cornerType)for(var N=1;N<e.length;N++)i.push([e[N-1][2],e[N][0],e[N-1][1],e[N][3],e[N-1][2]]),i.push(e[N]);else if(2===this.cornerType)for(var B=1;B<e.length;B++){var A=t[B],j=turf.point(e[B-1][1]),I=turf.point(e[B-1][2]),F=turf.rhumbBearing(j,I),R=turf.point(e[B][0]),z=turf.point(e[B][3]),H=turf.rhumbBearing(R,z);if(Math.sin(Cesium.Math.toRadians(F-H))>0){var V=F;F=H+180,H=V+180}for(var G=turf.sector([A.lng,A.lat],this.options.width/1e3/2,F,H,{units:"kilometers"}),U=[],W=0;W<G.geometry.coordinates[0].length-1;W++)U.push([].concat(L()(G.geometry.coordinates[0][W]),[A.alt]));i.push(U),i.push(e[B])}return i}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=67;break}return t.next=6,new Zi(this.sdk,this.options,{title:"实体墙属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),be(w.sdk,w.options.id),re(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.Dialog.closeCallBack&&w.Dialog.closeCallBack();for(var t=0;t<w.nodePoints.length;t++)w.sdk.viewer.entities.remove(w.nodePoints[t]);w.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),w.event&&w.event.destroy(),w.event&&w.tip.destroy()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(w)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(n=document.createElement("div")).innerHTML=_p(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,o=[{name:'<svg class="icon-zj"><use xlink:href="#yj-icon-zj"></use></svg>直角',value:"直角",key:0,icon:"yj-icon-zj"},{name:'<svg class="icon-xj"><use xlink:href="#yj-icon-xj"></use></svg>斜角',value:"斜角",key:1,icon:"yj-icon-xj"},{name:'<svg class="icon-yj"><use xlink:href="#yj-icon-yj"></use></svg>圆角',value:"圆角",key:2,icon:"yj-icon-yj"}],(s=Y(n.getElementsByClassName("corner-type-box")[0],".corner-type")).legp_search(o),(r=document.createElement("i")).className="icon-active",n.getElementsByClassName("corner-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(r),l=n.getElementsByClassName("corner-type")[0].getElementsByTagName("input")[0],c=0;case 22:if(!(c<o.length)){t.next=31;break}if(o[c].key!==this.cornerType){t.next=28;break}return s.legp_searchActive(o[c].value),l.value=o[c].value,r.innerHTML='<svg class="'.concat(o[c].icon,'"><use xlink:href="#').concat(o[c].icon,'"></use></svg>'),t.abrupt("break",31);case 28:c++,t.next=22;break;case 31:l.addEventListener("input",(function(t,e){for(var i=0;i<o.length;i++)if(o[i].value===l.value){w.cornerType=o[i].key,r.innerHTML='<svg class="'.concat(o[i].icon,'"><use xlink:href="#').concat(o[i].icon,'"></use></svg>');break}})),u=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-brick1"></i>红砖墙',value:"红砖墙",key:1,icon:"icon-wall-brick1"},{name:'<i class="icon icon-wall-brick2"></i>黄砖墙',value:"黄砖墙",key:2,icon:"icon-wall-brick2"},{name:'<i class="icon icon-wall-brick3"></i>灰瓷墙',value:"灰瓷墙",key:3,icon:"icon-wall-brick3"}],(p=Y(n.getElementsByClassName("material-box")[0],".material")).legp_search(u),(h=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(h),d=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],m=0;case 40:if(!(m<u.length)){t.next=49;break}if(u[m].key!==this.material){t.next=46;break}return p.legp_searchActive(u[m].value),d.value=u[m].value,h.className="icon icon-active ".concat(u[m].icon),t.abrupt("break",49);case 46:m++,t.next=40;break;case 49:d.addEventListener("input",(function(t,e){for(var i=0;i<u.length;i++)if(u[i].value===d.value){w.material=u[i].key,h.className="icon icon-active ".concat(u[i].icon);break}})),new hn("radar-scan-edit-tabs",void 0,this.sdk),f=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),v=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),g=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),y=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),b=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),C=n.getElementsByTagName("*"),Pp.on(this,C),this._elms=Pp.element,this._elms.color=[f],this._elms.labelColor=[v],this._elms.labelLineColor=[g],this._elms.labelBackgroundColorStart=[y],this._elms.labelBackgroundColorEnd=[b],setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.ISCSelect&&w.ISCSelect(),w.goodsSelect&&w.goodsSelect(),w.cameraSelect&&w.cameraSelect(),w.attributeVr=w.options.attribute.vr.content;var t=w.attributeSelect,e=Y(w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(e.legp_search(t),w._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<t.length;n++)if(t[n].key===w.options.attributeType){i.value=t[n].value,e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){w.attributeType=t[e].key;break}}));var o=Nn(),s=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[w.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===a.value){w.labelFontFamily=o[t].key;break}})),w._elms.labelFontFamily=[a]}}}),0),t.next=68;break;case 67:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 68:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.width=this.originalOptions.width,this.cornerType=this.originalOptions.cornerType,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=this.options.positions,e=[],i=[],n=[],o=0;o<t.length;o++)e.push(t[o].lng,t[o].lat,t[o].alt),i.push(t[o].alt),n.push(t[o].alt+this.options.extrudedHeight)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),e=0;e<this.entity.values.length;e++)this.sdk.viewer.entities.remove(this.entity.values[e]);return this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"getMaterial",value:function(t){var e,i,n=this;switch(this.options.material){case 0:e=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(e=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:case 2:case 3:case 4:switch(this.options.material){case 1:i="brick1";break;case 2:i="brick2";break;case 3:i="brick3";break;case 4:i="brick4"}e=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,is2D:!1,repeats:new Cesium.CallbackProperty((function(){var e=[["1.0",1,1]];if(!n.entity)return e;var i=n.entity.getById(t);if(!i||!i.polylineVolume)return e;var o=i.polylineVolume.positions.getValue();if(!Cesium.defined(o))return e;var s=0,a=[];e=[];for(var r=0;r<o.length-1;++r){var l=Cesium.Cartesian3.distance(o[r],o[r+1]);a.push(l),s+=l}var c=s/n.options.extrudedHeight;c/=1;for(var u=0;u<a.length;u++){var p=a[u]/s;p;var h=p*c;e.push([((u+1)/a.length).toFixed(30),h,1])}return e}),!1),isTranslucent:!1,duration:0})}return e}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"update",value:function(){if(this.entity){for(var t=this.calculatePositions(),i=[],n=[],o=0;o<this.entity.values.length;o++)this.sdk.viewer.entities.remove(this.entity.values[o]);this.entity.removeAll();for(var s=0;s<t.length;s++){for(var a=[],r=[],l=0;l<t[s].length;l++)a.push(t[s][l][0],t[s][l][1],t[s][l][2]),r.push(t[s][l][0],t[s][l][1],t[s][l][2]+this.options.extrudedHeight);i.push(a),n.push(r);var c=this.sdk.viewer.entities.add({id:this.options.id+"-"+e.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(i[s]),shape:[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=this.sdk.viewer.entities.add({id:this.options.id+"-"+e.randomString(12),polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n[s])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(this.options.color)}});this.entity.add(c),this.entity.add(u),c.polylineVolume.material=this.getMaterial(c.id)}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(t){t.label=new zn(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,ground:!1,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i.entity=new Cesium.EntityCollection,n=i.calculatePositions(),o=0;o<n.length;o++){for(s=[],r=[],l=0;l<n[o].length;l++)s.push(n[o][l][0],n[o][l][1],n[o][l][2]),r.push(n[o][l][0],n[o][l][1],n[o][l][2]+i.options.extrudedHeight);c=i.sdk.viewer.entities.add({id:i.options.id+"-"+e.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=i.sdk.viewer.entities.add({id:i.options.id+"-"+e.randomString(12),polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(r),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(i.options.color)}}),i.entity.add(c),i.entity.add(u),c.polylineVolume.material=i.getMaterial(c.id)}i.entity.show=i.options.show,e.createLabel(i),be(i.sdk,i.options.id),i.options.show&&Qt(0,i.options.id);case 9:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())i("上一次测量未结束");else{var n,o,s=function(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t.entity){for(var n=t.calculatePositions(),o=0;o<t.entity.values.length;o++)t.sdk.viewer.entities.remove(t.entity.values[o]);t.entity.removeAll(),a=[],r=[];for(var s=function(o){for(var s=[],l=[],c=0;c<n[o].length;c++)s.push(n[o][c][0],n[o][c][1],n[o][c][2]),l.push(n[o][c][0],n[o][c][1],n[o][c][2]+t.options.extrudedHeight);a.push(s),r.push(l);var u=t.sdk.viewer.entities.add({id:t.options.id+"-"+e.randomString(12),polylineVolume:{positions:i?new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(a[o])}),!1):Cesium.Cartesian3.fromDegreesArrayHeights(a[o]),shape:[{x:-1e-7,y:-t.options.extrudedHeight/2},{x:1e-7,y:-t.options.extrudedHeight/2},{x:1e-7,y:t.options.extrudedHeight/2},{x:-1e-7,y:t.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),p=t.sdk.viewer.entities.add({id:t.options.id+"-"+e.randomString(12),polygon:{hierarchy:i?new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o]))}),!1):new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(t.options.color)}});t.entity.add(u),t.entity.add(p),u.polylineVolume.material=t.getMaterial(u.id)},l=0;l<n.length;l++)s(l)}};YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];t.options.positions;var a=[],r=[],l=!1,c=function(e,i){if(!0,n){l=!0;var a=t.sdk.viewer.scene.clampToHeight(i,L()(t.entity.values));t.options.positions[n.index]=t.cartesian3Towgs84(a,t.sdk.viewer),o=t.options.positions[n.index];var r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[n.index].lng,t.options.positions[n.index].lat,t.options.positions[n.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(n.index,0,r),t.options.positions.splice(n.index,0,t.options.positions[n.index]),s(!0),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],t.tip.setPosition(i,e.position.x,e.position.y),t.material=t.material}else{var c=t.sdk.viewer.scene.pick(e.position);c&&c.id&&c.id.name&&"node-secondary-edit-point"===c.id.name&&(n=c.id,t.nodePoints.splice(c.id.index,1),t.sdk.viewer.entities.remove(c.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),o=t.cartesian3Towgs84(n.position._value,t.sdk.viewer),s(!0))}},u=function(e,a){n&&(t.options.positions[n.index]=o,l&&t.options.positions.splice(n.index,1),s(),i(null,t.options.positions)),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight];for(var r=0;r<t.nodePoints.length;r++)t.sdk.viewer.entities.remove(t.nodePoints[r]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.material=t.material};t.event.mouse_left(c),t.event.mouse_right(u),t.event.mouse_move((function(e,i){if(n){var o=t.sdk.viewer.scene.clampToHeight(i,L()(t.entity.values));t.options.positions[n.index]=t.cartesian3Towgs84(o,t.sdk.viewer);for(var s=t.calculatePositions(),l=0;l<s.length;l++){for(var c=[],u=[],p=0;p<s[l].length;p++)c.push(s[l][p][0],s[l][p][1],s[l][p][2]),u.push(s[l][p][0],s[l][p][1],s[l][p][2]+t.options.extrudedHeight);a[l]=c,r[l]=u}t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight]}t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,i){n&&(!0,t.options.positions.pop(),s(!0),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),n.index===t.options.positions.length&&(t.nodePoints[n.index-1]?n=t.nodePoints[n.index-1]:n.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?u(o,i):c(o,i)}))}));for(var p=0;p<t.options.positions.length;p++){var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:p,position:Cesium.Cartesian3.fromDegrees(t.options.positions[p].lng,t.options.positions[p].lat,t.options.positions[p].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(h)}}}},{key:"randomString",value:function(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",i=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*i));return n}}]);var i,n,s}(Mn);function Bp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 54%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label">原始长度:</span>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n <div class="row">\n <div class="col input-select-fit-unit-box">\n <span class="label">拟合长度:</span>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="fitLength">\n <div class="input-select-fit-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n <div class="col">\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Lp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ap(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ap(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ap(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var jp=function(){function t(){k()(this,t),this.element={}}return x()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=Lp(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(jp,"event",{});var Ip=new jp;function Fp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Rp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function zp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Hp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Hp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Hp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Vp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Gp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Vp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.extend=n.extend||!1,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,222,0,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return qi()(e,t),x()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000",this.entity.polyline.material=this.getMaterial(t,this.options.type),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,1)"}});e._elms.color[i]=n}))}},{key:"length",get:function(){return this.options.length},set:function(t){this.options.length=t,this._elms.length&&this._elms.length.forEach((function(e){e.value=t}))}},{key:"fitLength",get:function(){return this.options.fitLength},set:function(t){this.options.fitLength=t,this._elms.fitLength&&this._elms.fitLength.forEach((function(e){e.value=t}))}},{key:"lengthUnit",get:function(){return this.options["length-unit"]},set:function(t){if(this.options["length-unit"]=t,this._elms.lengthUnit&&this._elms.lengthUnit.forEach((function(e){e.value=t})),this.options.lengthByMeter)switch(t){case"米":this.length=this.options.lengthByMeter;break;case"千米":this.length=(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.options.lengthByMeter}}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:"实线",value:"实线",key:0},{name:"虚线",value:"虚线",key:1},{name:"泛光",value:"泛光",key:2}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value})),1},o=0;o<i.length&&!n(o);o++);this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){if(this.options["nose-to-tail"]=t,e.closeNodeEdit(this),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.positionEditing=!1,this.options.heightMode=t||0==t?t:2;var n="";e.closeNodeEdit(this);var o=!1,s=!1,a=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a),this.renewPolygon(a),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=o,this.extend=!1,n="海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=o,this.extend=!1,n="相对地表";break;case"2":case 2:o=!0,s=!0,this.entity.polyline.clampToGround=o,n="依附模型"}this.options.lengthByMeter=this.computeDistance2(this.smoothHandle(this.options.positions),2,o),this.lengthUnit=this.lengthUnit,this._elms.heightMode&&(this._elms.heightMode.value=n),this._elms.heightModeObject&&this._elms.heightModeObject.legp_searchActive(n),s?(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),this._elms.heightConfirm&&this._elms.heightConfirm.setAttribute("disabled","disabled")):(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.heightConfirm&&this._elms.heightConfirm.removeAttribute("disabled")),setTimeout((function(){o?(i.label.ground=o,i._elms.heightMode&&(i._elms.heightMode.value="依附模型"),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat]):(i.label.ground=o,i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,a[2]],i.options.label.position={lng:i.options.positions[0].lng,lat:i.options.positions[0].lat,alt:a[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(t){if(this.options.extend=t,e.closeNodeEdit(this),t&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(e){e.checked=t})),this.entity)if(this.options.extend){var i=this.renewPositions(this.options.positions);this.renewPolygon(i)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options["extend-width"]},set:function(t){this.options["extend-width"]=t,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(e){e.value=t}));var e=this.renewPositions(this.options.positions);this.renewPolygon(e)}},{key:"extendColor",get:function(){return this.options["extend-color"]},set:function(t){var e=this;this.options["extend-color"]=t,this._elms.extendColor&&this._elms.extendColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.extendColor=t},clear:function(){e.extendColor="rgba(255,255,255,1)"}});e._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options["extend-color"]))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show?(this.label.show=t,setTimeout((function(){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=zp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=zp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=zp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=zp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=31;break}return t.next=6,new Zi(this.sdk,this.options,{title:"曲线属性",left:"180px",top:"100px",confirmCallBack:function(t){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.label.position[2]},h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),be(h.sdk,h.options.id),re(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack()},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack();for(var t=0;t<h.nodePoints.length;t++)h.sdk.viewer.entities.remove(h.nodePoints[t]);h.nodePoints=[],h.positionEditing=!1},showCallBack:function(t){h.options.show=t,h.originalOptions.show=t,h.show=t,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing},secondaryEditCallBack:function(){h.positionEditing=!1,h.noseToTail=!1,h.heightMode=0,e.nodeEdit(h)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(n=document.createElement("div")).innerHTML=Bp(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,new hn("polyline-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){h.color=t},clear:function(){h.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelColor=t},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.extendColor=t},clear:function(){h.extendColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelLineColor=t},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorStart=t},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorEnd=t},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),p=n.getElementsByTagName("*"),Ip.on(this,p),this._elms=Ip.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.extendColor=[r],this._elms.labelLineColor=[l],this._elms.labelBackgroundColorStart=[c],this._elms.labelBackgroundColorEnd=[u],setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.cameraSelect&&h.cameraSelect(),h.goodsSelect&&h.goodsSelect();var t=h.attributeSelect,i=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var o=Y(i,".attribute-select");o.legp_search(t);for(var s=h._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===h.options.attributeType){s.value=t[a].value,o.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){h.attributeType=t[e].key;break}}))}var r=[{name:"米",value:"米"},{name:"千米",value:"千米"}],l=Y(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];h._elms.lengthUnit=[c],c.value=h.options["length-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){h.lengthUnit=r[t].value;break}}))}var p=[{name:"米",value:"米"},{name:"千米",value:"千米"}],d=Y(h._DialogObject._element.content.getElementsByClassName("input-select-fit-unit-box")[0],".input-select-fit-unit");if(d){d.legp_search(p);var m=h._DialogObject._element.content.getElementsByClassName("input-select-fit-unit")[0].getElementsByTagName("input")[0];h._elms.fitLengthUnit=[m],m.value=h.options["fit-length-unit"];for(var f=0;f<p.length;f++)if(p[f].value===m.value){d.legp_searchActive(p[f].value);break}m.addEventListener("input",(function(){for(var t=0;t<p.length;t++)if(p[t].value===m.value){h.fitLengthUnit=p[t].value;break}}))}var v=[{name:"实线",value:"实线",key:0},{name:"虚线",value:"虚线",key:1},{name:"泛光",value:"泛光",key:2}],g=Y(h._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(g){g.legp_search(v);var y=h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];h._elms.lineType=[y];for(var b=0;b<v.length;b++)if(v[b].key===h.options.type){g.legp_searchActive(v[b].value),y.value=v[b].value;break}y.addEventListener("input",(function(){for(var t=0;t<v.length;t++)if(v[t].value===y.value){h.lineType=v[t].key;break}}))}var C=h._DialogObject._element.content.getElementsByClassName("height-box")[0],w=C.getElementsByClassName("height")[0],k=h._DialogObject._element.content.getElementsByClassName("height-confirm")[0];w.value=10,2==h.heightMode?(C&&(C.className="input-number input-number-unit-1 height-box disabled"),k&&k.setAttribute("disabled","disabled")):(C&&(C.className="input-number input-number-unit-1 height-box"),k&&k.removeAttribute("disabled"));var _=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],x=Y(h._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(x){x.legp_search(_);for(var E=h._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],S=0;S<_.length;S++)if(_[S].key==h.heightMode){E.value=_[S].value,x.legp_searchActive(_[S].value);break}E.addEventListener("input",(function(){for(var t=0;t<_.length;t++)if(_[t].value===E.value){h.heightMode=_[t].key;break}})),w.addEventListener("input",(function(){h.heightMode})),h._elms.height=w,h._elms.heightBox=C,h._elms.heightMode=E,h._elms.heightConfirm=k,h._elms.heightModeObject=x,k.addEventListener("click",(function(){h.positionEditing=!1;for(var t=0;t<h.options.positions.length;t++)h.options.positions[t].alt=Number((h.options.positions[t].alt+Number(w.value)).toFixed(2)),h._elms.alt[t].innerHTML=h.options.positions[t].alt;var i=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),h.positionEditing=!1,e.closeNodeEdit(h)}))}var D=n.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];h._elms.lng=[],h._elms.lngInput=[],h._elms.lat=[],h._elms.latInput=[],h._elms.alt=[],h._elms.altInput=[];for(var P=function(t){var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td">'.concat(t+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=h.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=h.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=h.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=h.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=h.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=h.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(h.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),s.addEventListener("blur",(function(){s.value=Number(h.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){h.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=h.options.positions[t].lng.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(h.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),l.addEventListener("blur",(function(){l.value=Number(h.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){h.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=h.options.positions[t].lat.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=h.heightMode&&(c.innerHTML="",p.value=Number(h.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),h.positionEditing=!1,e.closeNodeEdit(h))})),p.addEventListener("blur",(function(){p.value=Number(h.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){h.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=h.options.positions[t].alt.toFixed(2);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),h._elms.lng.push(o),h._elms.lngInput.push(s),h._elms.lat.push(r),h._elms.latInput.push(l),h._elms.alt.push(u),h._elms.altInput.push(p),D.appendChild(i)},M=0;M<h.options.positions.length;M++)P(M);var O=Nn(),T=Y(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(T){T.legp_search(O);var N=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];N.value=O[h.labelFontFamily].value;for(var B=0;B<O.length;B++)if(O[B].value==N.value){T.legp_searchActive(O[B].value);break}N.addEventListener("input",(function(){for(var t=0;t<O.length;t++)if(O[t].value===N.value){h.labelFontFamily=O[t].key;break}})),h._elms.labelFontFamily=[N]}}),0),t.next=32;break;case 31:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 32:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(t){for(var e=[],i=[],n=[],o=0;o<t.length;o++)n.push(t[o].lng,t[o].lat,t[o].alt),i.push(o/(t.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*t.length,r=0;r<=a;r++){var l=s.evaluate(r/a);e.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return e}},{key:"renewPositions",value:function(t){if(!this._error){var e,i,n=JSON.parse(JSON.stringify(t));switch(this.heightMode){case 0:case"0":e=!1;break;case 1:case"1":for(var o=0;o<n.length;o++){var s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n[o].lng,n[o].lat));n[o].alt=Number(s?(n[o].alt+Number(s)).toFixed(2):n[o].alt.toFixed(2))}e=!1;break;case 2:case"2":e=!0}var a=[];i=this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]?[].concat(L()(n),[n[0]]):L()(n),i=this.smoothHandle(i);for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat,i[r].alt);for(var l=[],c=0;c<a.length;c+=3)l.push({lng:a[c],lat:a[c+1],alt:a[c+2]});return this.options.fitLengthByMeter=this.computeDistance2(l,2,e),this.fitLengthUnit=this.options["fit-length-unit"],this.options.lengthByMeter=this.computeDistance2(this.smoothHandle(n),2,e),this.lengthUnit=this.options["length-unit"],a}}},{key:"renewPolygon",value:function(t){var e=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<t.length;n+=3)e.push([t[n],t[n+1]]);for(var o=turf.lineString(e),s=turf.buffer(o,this.options["extend-width"]/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options["extend-color"])})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions["nose-to-tail"],this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions["extend-width"],this.extendColor=this.originalOptions["extend-color"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;case 32:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(Ye(this.sdk),Je(this.sdk),ei(0),!this.options.customView){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Rp({},this.options.position):this.options.positions?l=Rp({},this.options.positions[0]):this.options.center?l=Rp({},this.options.center):this.options.start?l=Rp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p<this.options.positions.length;p++)h=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,this.options.positions[p].alt),c.push(h.x,h.y,h.z);return t.abrupt("break",41);case 31:return t.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=t.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return t.abrupt("break",41);case 36:return t.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=t.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return t.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){e.closeNodeEdit(this),this.event&&this.event.destroy(),this.event=new X(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var n=JSON.parse(JSON.stringify(this.options.positions)),o=this.renewPositions(this.options.positions);this.previous={positions:L()(this.options.positions)};for(var s=0;s<n.length;s++)n[s]=Cesium.Cartesian3.fromDegrees(n[s].lng,n[s].lat,n[s].alt);for(var a=n[Math.floor(n.length/2)],r=[],l=0;l<n.length;l++)r.push({x:a.x-n[l].x,y:a.y-n[l].y,z:a.z-n[l].z});var c=[],u=[];this.event.mouse_move((function(t,e){c=[],u=[];for(var n=0;n<r.length;n++){var s={x:e.x-r[n].x,y:e.y-r[n].y,z:e.z-r[n].z},a=i.cartesian3Towgs84(s,i.sdk.viewer);a.alt=i.options.positions[n].alt,c.push(s),u.push(a)}var l=u[0];o=i.renewPositions(u),i.label.position=[l.lng,l.lat,l.alt],i.options.label.position={lng:l.lng,lat:l.lat,alt:l.alt},i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),c=[],u=[];for(var n=0;n<r.length;n++){var o={x:e.x-r[n].x,y:e.y-r[n].y,z:e.z-r[n].z},s=i.cartesian3Towgs84(o,i.sdk.viewer);s.alt=i.options.positions[n].alt,c.push(o),u.push(s)}for(var a=[],l=0;l<u.length;l++){var p=u[l];a.push(p),i._elms.lng&&(i._elms.lng[l].innerHTML=p.lng.toFixed(8)),i._elms.lngInput&&(i._elms.lngInput[l].value=p.lng.toFixed(8)),i._elms.lat&&(i._elms.lat[l].innerHTML=p.lat.toFixed(8)),i._elms.latInput&&(i._elms.latInput[l].value=p.lat.toFixed(8)),i._elms.alt&&(i._elms.alt[l].innerHTML=p.alt.toFixed(2)),i._elms.altInput&&(i._elms.altInput[l].value=p.alt.toFixed(2))}i.options.positions=a,i.previous.positions=a;var h=i.renewPositions(i.options.positions);i.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(h),i.renewPolygon(h),i.positionEditing=!1})),this.event.mouse_right((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1})),this.event.gesture_pinck_start((function(t,e){var n=new Date;i.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};o-n>=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(o)}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var p=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(p),this.renewPolygon(p),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,p[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:p[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=L()(e.sdk.viewer.entities.values),t.t0=e.options.heightMode,t.next="0"===t.t0||0===t.t0?4:"1"===t.t0||1===t.t0?7:"2"===t.t0||2===t.t0?14:19;break;case 4:return n=!1,i=e.options.positions[0].alt,t.abrupt("break",19);case 7:return n=!1,t.next=10,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},o);case 10:return t.t1=t.sent,t.t2=e.options.positions[0].alt,i=t.t1+t.t2,t.abrupt("break",19);case 14:return n=!0,t.next=17,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},o);case 17:return i=t.sent,t.abrupt("break",19);case 19:e.options.label.position||(e.options.label.position={lng:e.options.positions[0].lng,lat:e.options.positions[0].lat,alt:i}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:n});case 21:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){var i;i=2==t.heightMode;var n=t.options.positions,o=t.renewPositions(n);t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:t.options.width,clampToGround:i,material:t.getMaterial(t.options.color,t.options.type),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.renewPolygon(o),t.options.lengthByMeter=t.computeDistance2(t.smoothHandle(n),2,i),t.lengthUnit=t.options["length-unit"],be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id);t.sdk.viewer.scene}},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i;e.closeNodeEdit(t),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.ControllerObject=new _o(t.sdk),t.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o)})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<t.options.positions.length;n++){var o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,t.options.positions[n].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(t){t.ControllerObject&&t.ControllerObject.destroy(),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[]}}]);var i,n,s,r,l}(Mn);function Up(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Wp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Up(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Up(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Yp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Jp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Yp(this,e,[t,n])).viewer=t.viewer,i.options.show=!n.show&&!1!==n.show||n.show,i.options.name=i.options.name||"未命名对象",i.options.size=i.options.size||0===i.options.size?i.options.size:80,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.event=new X(i.sdk),i.Dialog=o,i.operate={},i._elms={},i._EventBinding=new pn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"Explosion"}},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=15;break}return t.next=6,new Zi(this.sdk,this.options,{title:"爆炸属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),be(o.sdk,o.options.id),re(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing=!1,o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.options.show=t,o.originalOptions.show=t,o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()},translationalCallBack:function(){o.positionEditing=!o.positionEditing}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" explosion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">随地图缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">爆炸范围</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="999999" @model="size">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,this.scaleByDistance=this.options.scaleByDistance;case 15:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Wp({},this.options.position):this.options.positions?l=Wp({},this.options.positions[0]):this.options.center?l=Wp({},this.options.center):this.options.start?l=Wp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt+8*this.options.size),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-85),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.previous=null,this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.size=this.originalOptions.size,this.scaleByDistance=this.originalOptions.scaleByDistance,this.lng=this.options.position.lng,this.lat=this.options.position.lat)}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.billboard.sizeInMeters=t,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position.alt=t,this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"size",get:function(){return this.options.size},set:function(t){this.options.size=t,this.entity.billboard.width=this.options.size,this.entity.billboard.height=this.options.size,this._elms.size&&this._elms.size.forEach((function(e){e.value=t}))}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.operate.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={position:Wp({},this.options.position)},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={position:Wp({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.alt=t.alt,e.previous={position:Wp({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.previous&&(this.lng=this.previous.position.lng,this.lat=this.previous.position.lat,this.alt=this.previous.position.alt)))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,be(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=[],i=10001;i<=10120;i++){var n=t.getSourceRootPath()+"/img/frameAnimation/explosion/b".concat(i,".png");e.push(n)}var o=new Cesium.Entity({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt)}),!1),billboard:{image:new Cesium.CallbackProperty((function(){var t=e[o.imgIndex];return o.imgIndex++,o.imgIndex>=e.length&&(o.imgIndex=0),t}),!1),disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1),width:t.options.size,height:t.options.size,sizeInMeters:t.options.scaleByDistance,pixelOffset:{x:0,y:-20}}});o.imgIndex=0,t.entity=t.viewer.entities.add(o),be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}}]);var i,n,s}(Mn);function qp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扩散半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">持续时间</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="100" max="99999" @model="duration">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">范围颜色</span>\n <div class="colorOut"></div>\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="colorIn"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Xp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Zp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Kp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return $p(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?$p(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function $p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Qp(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var th=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Qp(this,e,[t,i])).options.lng=i.lng,n.options.lat=i.lat,n.options.alt=i.alt,n.options.colorOut=i.colorOut||"rgba(255,255,0,0.3)",n.options.colorIn=i.colorIn||"rgba(255,0,0,0.3)",n.options.radius=i.radius||10,n.options.radius>999999&&(n.options.radius=999999),n.options.duration=i.duration||2e3,n.event=new X(n.sdk),n.options.positionEditin=!1,i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n._elms={},n.Dialog=o,n._EventBinding=new pn,n.ControllerObject=new _o(n.sdk),n.sdk.addIncetance(n.options.id,n),e.radarSolidScan(n),n}return qi()(e,t),x()(e,[{key:"type",get:function(){return"RadarScanStereoscopic"}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(t?(this.picking=!1,this.ControllerObject.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this.ControllerObject.editTranslational(),this.ControllerObject.controllerCallBack=function(t){e.lng=t.position.lng,e.lat=t.position.lat,e.alt=t.position.alt}):(setTimeout((function(){e.picking=!0}),500),this.ControllerObject.destroy()))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=Number(t),this.label.position=[t,this.lat,this.alt+this.radius],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=Number(t),this.label.position=[this.lng,t,this.alt+this.radius],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=Number(t),this.label.position=[this.lng,this.lat,t+this.radius],this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"radius",get:function(){return this.options.radius},set:function(t){var i=Number(t.toFixed(2));(i>999999&&(i=999999),i<.1&&(i=.1),this.options.radius=i,this.label.position=[this.lng,this.lat,this.alt+t],this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(i=Number((i/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=i})),e.changeParam(this)}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t,this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"colorOut",get:function(){return this.options.colorOut},set:function(t){var e=this;this.options.colorOut=t,this.entity.ellipsoid.material=Cesium.Color.fromCssColorString(t),this.entity.ellipsoid.outlineColor=Cesium.Color.fromCssColorString(t),this._elms.colorOut&&this._elms.colorOut.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorOut=t},clear:function(){e.colorOut="rgba(255,255,255,1)"}});e._elms.colorOut[n]=o}))}},{key:"colorIn",get:function(){return this.options.colorIn},set:function(t){var e=this;this.options.colorIn=t,this.entity.wall.material=Cesium.Color.fromCssColorString(t),this._elms.colorIn&&this._elms.colorIn.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorIn=t},clear:function(){e.colorIn="rgba(255,255,255,1)"}});e._elms.colorIn[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Kp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Kp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Kp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Kp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return t.next=6,new Zi(this.sdk,this.options,{title:"立体雷达扫描属性",left:"180px",top:"100px",confirmCallBack:function(t){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.options.alt+h.options.radius},h.label.position=[h.options.label.position.lng,h.options.label.position.lat,h.options.label.position.alt],h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),be(h.sdk,h.options.id),re(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack(h.options)},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack(),h.positionEditing&&(h.positionEditing=!1),h.positionEditing=!1},showCallBack:function(t){h.options.show=t,h.originalOptions.show=t,h.show=t,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan-stereoscopic",(i=document.createElement("div")).innerHTML=qp(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new hn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("colorOut")[0],size:"mini",alpha:!0,defaultColor:this.colorOut,disabled:!1,openPickerAni:"opacity",sure:function(t){h.colorOut=t},clear:function(){h.colorOut="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("colorIn")[0],size:"mini",alpha:!0,defaultColor:this.colorIn,disabled:!1,openPickerAni:"opacity",sure:function(t){h.colorIn=t},clear:function(){h.colorIn="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelColor=t},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelLineColor=t},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorStart=t},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorEnd=t},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=i.getElementsByTagName("*"),this._EventBinding.on(this,u),this._elms=this._EventBinding.element,this._elms.colorOut=[n],this._elms.colorIn=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],(p=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[p],p.addEventListener("input",(function(t){var e=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(h.radius=i*("米"===e?1:1e3))}})),p.addEventListener("blur",(function(t){var e=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),h.radius=Number((i*("米"===e?1:1e3)).toFixed(2))}})),setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.ISCSelect&&h.ISCSelect(),h.goodsSelect&&h.goodsSelect(),h.cameraSelect&&h.cameraSelect();var t=h.attributeSelect,e=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=e.getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===h.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){h.attributeType=t[e].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=h._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){Y(a,".input-radius-unit").legp_search(s);var r=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var t=h._DialogObject._element.content.getElementsByClassName("input-radius")[0],e=t.getElementsByClassName("unit")[0],i=t.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===e.innerHTML&&(e.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===e.innerHTML&&(e.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=Nn(),c=Y(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[h.labelFontFamily].value;for(var p=0;p<l.length;p++)if(l[p].value==u.value){c.legp_searchActive(l[p].value);break}u.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===u.value){h.labelFontFamily=l[t].key;break}})),h._elms.labelFontFamily=[u]}}),0);case 36:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Zp({},this.options.position):this.options.positions?l=Zp({},this.options.positions[0]):this.options.center?l=Zp({},this.options.center):this.options.start?l=Zp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,this.colorOut=this.originalOptions.colorOut,this.colorIn=this.originalOptions.colorIn,this.radius=this.originalOptions.radius,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.positionEditing=!1,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,be(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+this.options.radius);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"radarSolidScan",value:function(t){var i=t.sdk.viewer,n=t.options,o=(n.radius,n.lng,n.lat,n.alt,t.options.duration?360/t.options.duration*Cesium.getTimestamp():0),s=a(t.options,t.options.radius,o);(new Date).getTime();function a(t,e,i){var n=t.lng,o=t.lat,s=t.alt,a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,s)),r=e*Math.cos(i*Math.PI/180),l=e*Math.sin(i*Math.PI/180),c=Cesium.Cartesian3.fromElements(r,l,s),u=Cesium.Matrix4.multiplyByPoint(a,c,new Cesium.Cartesian3),p=Cesium.Cartographic.fromCartesian(u);return function(t,e,i,n,o){var s=[],a=[];s.push(t,e,o),a.push(o);for(var r=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(t,e),Cesium.Cartesian3.fromDegrees(i,n)),l=0;l<=90;l++){var c=r*Math.sin(l*Math.PI/180),u=Math.cos(l*Math.PI/180),p=(i-t)*u+t,h=(n-e)*u+e;s.push(p,h,c+o),a.push(o)}return{positionArr:s,bottomArr:a}}(n,o,Cesium.Math.toDegrees(p.longitude),Cesium.Math.toDegrees(p.latitude),s)}i.clock.onTick.addEventListener((function(){o=t.options.duration?360/t.options.duration*Cesium.getTimestamp():0,s=a(t.options,t.options.radius,o)})),t.entity=i.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat,t.options.alt)}),!1),ellipsoid:{radii:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3(t.options.radius,t.options.radius,t.options.radius)}),!1),material:Cesium.Color.fromCssColorString(n.colorOut),outline:!0,outlineColor:Cesium.Color.fromCssColorString(n.colorOut),outlineWidth:1,maximumCone:Cesium.Math.toRadians(90)},wall:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s.positionArr)}),!1),material:Cesium.Color.fromCssColorString(n.colorIn),minimumHeights:new Cesium.CallbackProperty((function(){return s.bottomArr}),!1)}}),e.createLabel(t),be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.alt){t.next=4;break}i=e.options.alt+e.options.radius,t.next=8;break;case 4:return n=L()(e.sdk.viewer.entities.values),t.next=7,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat},n);case 7:i=t.sent;case 8:e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,ground:!1,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 10:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"changeParam",value:function(t){}}]);var i,n,s,r}(Mn);function eh(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(xn(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function ih(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function nh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ih(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ih(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function oh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return sh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?sh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function sh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ah(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var rh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=ah(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"SectorObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"startAngle",get:function(){return this.options.startAngle},set:function(t){this.options.startAngle=t,this.height=this.height}},{key:"endAngle",get:function(){return this.options.endAngle},set:function(t){this.options.endAngle=t,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=oh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=oh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=oh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=oh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=59;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new Zi(this.sdk,this.options,{title:"扇形属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),be(w.sdk,w.options.id),re(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 7:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=eh(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new hn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=56;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 40:if(!(C<g.length)){t.next=48;break}if(g[C].key!=this.heightMode){t.next=45;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",48);case 45:C++,t.next=40;break;case 48:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 56:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=Nn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=60;break;case 59:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 60:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,be(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!this.options.customView){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=nh({},this.options.position):this.options.positions?l=nh({},this.options.positions[0]):this.options.center?l=nh({},this.options.center):this.options.start?l=nh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),_=1;_<c.length;_++)u.push(c[_].x,c[_].y,c[_].z);x=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(x,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t?(this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt;var o=0,s=!1;switch(e.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=e.calSector(n,e.options.radius,e.options.startAngle,e.options.endAngle,360,!0),r=[];if(s){for(var l=0;l<a.length;l++)r.push(a[l].lng,a[l].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(r),e.getClampToHeight({lng:n.lng,lat:n.lat}).then((function(t){e.label&&(e.label.position=[n.lng,n.lat,t])}))}else{for(var c=0;c<a.length;c++)r.push(a[c].lng,a[c].lat,n.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),e.label&&(e.label.position=[n.lng,n.lat,n.alt+o])}e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),this.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),this.previous=null)}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.calSector(t,this.options.radius,this.options.startAngle,this.options.endAngle,360,!0),s=[];if(i){for(var a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(s),setTimeout((function(){e.getClampToHeight({lng:t.lng,lat:t.lat}).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100)}else{for(var r=0;r<o.length;r++)s.push(o[r].lng,o[r].lat,t.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[t.lng,t.lat,t.alt+n])}var l=this.options.endAngle-this.options.startAngle;return l<0&&(l=360+l),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius*(l/360)).toFixed(2)),this.areaUnit=this.areaUnit,o}}}],[{key:"create",value:function(t){var i=t.calSector(t.options.center,t.options.radius,t.options.startAngle,t.options.endAngle,360,!0),n=!0,o=0;switch(t.options.heightMode){case"0":case 0:n=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,n=!1;break;case"2":case 2:n=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+o});var s=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(n=!1,s=new Cesium.CustomColorMaterialSource({color:t.options.color}));var a=[];if(t.options.label.ground=n,n){for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(a)}else{for(var l=0;l<i.length;l++)a.push(i[l].lng,i[l].lat,t.options.center.alt+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a)}t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!n,material:s,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!n,arcType:n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);var c=t.options.endAngle-t.options.startAngle;switch(c<0&&(c=360+c),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius*(c/360)).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new zn(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}},n=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o);case 3:s=e.sent,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t.nodePoints.push(r);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个编辑点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var s=t.calSector(t.options.center,t.options.radius,t.options.startAngle,t.options.endAngle),r=[],l=t.options.radius,c={angle1:t.options.startAngle,angle2:t.options.endAngle};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s),[s[0],s[1]])}),!1);var u=t.entity.polyline.positions.getValue();r=[nh({},t.center),t.cartesian3Towgs84(u[1],t.sdk.viewer),t.cartesian3Towgs84(u[u.length-4],t.sdk.viewer)],setTimeout((function(){n(u[1],"sector-start"),n(u[u.length-4],"sector-end"),t.event.mouse_left((function(i,n){if(e)t.options.startAngle=c.angle1,t.options.endAngle=c.angle2,t.options.radius=l,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1),t.heightMode=t.heightMode;else{var o=t.sdk.viewer.scene.pick(i.position);if(o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&("sector-start"===o.id._type||"sector-end"===o.id._type)){t.tip.set_text("左键确认,右键取消"),e=o.id;for(var s=0;s<t.nodePoints.length;s++)t.sdk.viewer.entities.remove(t.nodePoints[s]);t.nodePoints=[]}}})),t.event.mouse_move((function(n,o){if(e){var a=t.cartesian3Towgs84(o,t.sdk.viewer);"sector-start"===e._type&&(r[1]=a),"sector-end"===e._type&&(r[2]=a),c=i(r);var u=Cesium.Cartesian3.fromDegrees(r[0].lng,r[0].lat,0),p=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,0);l=Cesium.Cartesian3.distance(u,p),s=t.calSector(t.options.center,l,c.angle1,c.angle2)}t.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.heightMode=t.heightMode}))}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=oh(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Mn);function lh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ch=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=lh(this,e,[t,n])).source=new Cesium.CustomDataSource(i.options.id),i.detail=[],i}return qi()(e,t),x()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.source&&(this.source.show=t,this.options.show=t)}},{key:"setDefaultValue",value:function(){var t;this.options.id=this.options.id||Cesium.createGuid(),this.options.url=this.options.url||"",this.options.show=null===(t=this.options.show)||void 0===t||t}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=l.length>0&&void 0!==l[0]?l[0]:3,ei(0),Ye(this.sdk),Je(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e})):this.source&&this.viewer.flyTo(this.source,{duration:e});case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var t,i,n,o,s;(t=e,i="remove",n=this,o=3,s=Us()(Yi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.viewer.dataSources.remove(this.source),this.source=null}},{key:"on",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.show=this.options.show,t.next=3,Cesium.KmlDataSource.load(this.options.url,{camera:this.viewer.scene.camera,canvas:this.viewer.scene.canvas});case 3:return t.sent.entities.values.forEach((function(t,i){if(e.detail.push({name:t.name,id:t.id}),t.label){var n=1;t.billboard&&(n=t.billboard.scale._value),t.label.pixelOffset=new Cesium.Cartesian2(0,-32*n-15),t.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.label.disableDepthTestDistance=Number.POSITIVE_INFINITY}if(t.polygon){var o={hierarchy:t.polygon.hierarchy.getValue().positions,material:t.polygon.material,classificationType:Cesium.ClassificationType.BOTH};if(t.polygon.outline.getValue()){var s=t.polygon.hierarchy.getValue().positions,a=new Cesium.Entity({id:e.getOutlineId(t.id),polyline:{positions:s,width:t.polygon.outlineWidth.getValue(),material:t.polygon.outlineColor.getValue(),clampToGround:!0,zIndex:e.sdk._entityZIndex}});e.source.entities.add(a)}t.polygon=o}t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND),t.polyline&&(t.polyline={positions:t.polyline.positions.getValue(),material:t.polyline.material,clampToGround:!0,width:t.polyline.width?t.polyline.width.getValue():1}),t.show=!0,e.source.entities.add(t)})),t.next=7,this.viewer.dataSources.add(this.source);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getOutlineId",value:function(t){return[t,"outline"].join("_")}}]);var i,n}(Mn);function uh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var ph=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=uh(this,e,[t,n])).primitive=void 0,i.positions=[],i.loading=!0,i}return qi()(e,t),x()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=Us()(Yi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.color=this.options.color||"rgb(239, 6, 6, 1)",this.options.width=this.options.width||1}},{key:"show",get:function(){return this.options.show},set:function(t){if(this.options.show=t,this.entity)for(var e=0;e<this.entity.entities.values.length;e++)this.entity.entities.values[e].show=t}},{key:"on",value:(n=o()(a.a.mark((function t(){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=(i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/getFile":this.options.host+"/yjearth4.0/data/service/getFile")+"?path="+encodeURIComponent(this.options.url),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:return n=t.sent,t.next=8,n.json();case 8:return o=t.sent,this.geojson=o,t.abrupt("return",e.addDataToGlobe(this,o.features));case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var t=this;this.entity&&(this.entity.entities.values.forEach((function(e){t.sdk.viewer.entities.remove(e)})),this.entity=null,this.geojson={})}},{key:"flyTo",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading){t.next=24;break}if(!this.geojson){t.next=24;break}if(ei(0),Ye(this.sdk),Je(this.sdk),e=turf.bbox(this.geojson),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}return i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:e[0],lat:e[1]},t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent,n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.viewer.camera.flyTo({destination:(c=Cesium.Rectangle).fromDegrees.apply(c,L()(e))});case 24:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"addDataToGlobe",value:function(t){for(var e=new Cesium.GeoJsonDataSource,i=t.deepCopyObj(t.geojson),n=0;n<i.features.length;n++)i.features[n].id||(i.features[n].id=t.options.id+"_"+n);return e.load(i,{clampToGround:!0}).then((function(e){t.entity=e,e.entities.values.forEach((function(e){var i=Cesium.Color.fromCssColorString(t.options.color),n=i.withAlpha(.2);e.show=t.options.show,t.sdk.viewer.entities.add(e),e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:i,pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),e.polyline&&(e.polyline.material=i,e.polyline.zIndex=t.sdk._entityZIndex,t.sdk._entityZIndex++),e.polygon&&(e.polygon.perPositionHeight=!1,e.polygon.material=n,e.polygon.zIndex=t.sdk._entityZIndex,e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:i,zIndex:t.sdk._entityZIndex}),t.sdk._entityZIndex++)})),t.loading=!1}))}}]);var i,n}(Mn);function hh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function dh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?hh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):hh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function mh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var fh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=mh(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(32,67,135,0.5)",i.options.positions=n.positions||[],i.options.frequency=n.frequency||10,i.options.animationSpeed=n.animationSpeed||1,i.options.amplitude=n.amplitude||10,i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new pn,i._elms={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return qi()(e,t),x()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity&&(this.entity.appearance.material.uniforms.baseWaterColor=Cesium.Color.fromCssColorString(t)),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"frequency",get:function(){return this.options.frequency},set:function(t){this.options.frequency=t,this.entity&&(this.entity.appearance.material.uniforms.frequency=10*t),this._elms.frequency&&this._elms.frequency.forEach((function(e){e.value=t}))}},{key:"animationSpeed",get:function(){return this.options.animationSpeed},set:function(t){this.options.animationSpeed=t,this.entity&&(this.entity.appearance.material.uniforms.animationSpeed=.01*t),this._elms.animationSpeed&&this._elms.animationSpeed.forEach((function(e){e.value=t}))}},{key:"amplitude",get:function(){return this.options.amplitude},set:function(t){this.options.amplitude=t,this.entity&&(this.entity.appearance.material.uniforms.amplitude=t),this._elms.amplitude&&this._elms.amplitude.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t;var e=this.options.positions[0],i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,t),n=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,this.entity.originalHeight);this.entity.modelMatrix=Cesium.Matrix4.setTranslation(this.entity.modelMatrix,new Cesium.Cartesian3(i.x-n.x,i.y-n.y,i.z-n.z),new Cesium.Matrix4),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=19;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"水面属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),be(s.sdk,s.options.id),re(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" water-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="water-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面振幅</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="amplitude">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">动画速度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="10" min="0" step="0.1" @model="animationSpeed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面频率</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="100" min="0" step="1" @model="frequency">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("water-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],t.next=19;break;case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.frequency=this.originalOptions.frequency,this.animationSpeed=this.originalOptions.animationSpeed,this.amplitude=this.originalOptions.amplitude,this.height=this.originalOptions.height)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=d.length>0&&void 0!==d[0]?d[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=dh({},this.options.position):this.options.positions?l=dh({},this.options.positions[0]):this.options.center?l=dh({},this.options.center):this.options.start?l=dh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=28;break;case 23:c=Cesium.Rectangle.fromCartesianArray(this.entity.geometryInstances.geometry._polygonHierarchy.positions),u=this.sdk.viewer.camera.getRectangleCameraCoordinates(c),p=this.cartesian3Towgs84(u,this.sdk.viewer),h=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,p.alt+this.height),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:h});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,this.sdk.removeIncetance(this.options.id);case 5:return t.next=7,be(this.sdk,this.options.id);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=t.options.positions,i=[],n=e[0].alt,o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat),n<e[o].alt&&(n=e[o].alt);t.options.height||0===t.options.height||(t.options.height=n),t.entity=t.sdk.viewer.scene.primitives.add(new Cesium.Primitive({id:t.options.id,show:t.options.show,asynchronous:!1,releaseGeometryInstances:!1,geometryInstances:new Cesium.GeometryInstance({name:"water-surface",geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:t.options.height})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGroud:!0,material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:Cesium.Color.fromCssColorString(t.options.color),normalMap:t.getSourceRootPath()+"/img/water.png",frequency:10*t.options.frequency,animationSpeed:.01*t.options.animationSpeed,amplitude:t.options.amplitude}}})})})),t.entity.id=t.options.id,t.entity.originalHeight=t.options.height,be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}}]);var i,n,s}(Mn);function vh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return gh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function gh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function yh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ch(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function wh(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function kh(t,e,i){return t.set(xh(t,e),i),i}function _h(t,e){return t.get(xh(t,e))}function xh(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Eh=new WeakMap,Sh=new WeakMap,Dh=new WeakMap,Ph=new WeakMap,Mh=new WeakMap,Oh=new WeakMap,Th=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),wh(i=Ch(this,e,[t,n]),Eh,null),wh(i,Sh,!1),wh(i,Dh,void 0),wh(i,Ph,void 0),wh(i,Mh,void 0),wh(i,Oh,void 0),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.speed<=0&&(i.options.speed=.01),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.model=n.model=n.model||{},i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.height=Number(i.options.height.toFixed(2)),i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.model.show=!n.model.show&&!1!==n.model.show||n.model.show,i.options.model.url=n.model.url||"",i.options.model.pixelSize=n.model.pixelSize||70,i.options.model.heading=n.model.heading||0,i.options.model.pitch=n.model.pitch||0,i.options.model.roll=n.model.roll||0,i.options.model.scale=n.model.scale||0===n.model.scale?n.model.scale:1,i.options.model.animate=n.model.animate||"无",i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i.distance,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),i.ControllerObject=new _o(i.sdk),i._EventBinding=new pn,i.options.viewFollow=!1,i.options.firstPersonView=!1,e.addLine(i),i.firstPersonView=!1),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"TrajectoryMotion"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){if(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t),t){this.firstPersonView?this.model.show=!1:this.model.show=this.modelShow,this.line.polyline.material=this.lineShow?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var e=0;e<this.keyPoints.length;e++)this.keyPoints[e].show=this.keyPointShow;this.realTimeRoute&&this.realTimeLine&&(this.realTimeLine.show=!0),this.label&&(this.label.show=this.options.label.show)}else{this.model.show=t,this.realTimeLine&&(this.realTimeLine.show=!1),this.line.polyline.material=t?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=t;this.label&&(this.label.show=!1),this.viewFollow=!1}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),be(this.sdk,this.options.id),re(this.sdk,this.options.id)}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(t){var e=this;if(!this.ground){var i=this.options.height-Number(t.toFixed(2));if(this.options.height=Number(t.toFixed(2)),this.line)if(this.ground);else{var n=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var o=0;o<this.keyPoints.length;o++)this.options.line.positions[o].alt+=n,this.keyPoints[o].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[o].lng,this.options.line.positions[o].lat,this.options.line.positions[o].alt)}if(this.model&&this.model.position){var s=this.model.heading,a=this.model.pitch,r=this.model.roll;if(isNaN(s)||isNaN(a)||isNaN(r))return;var l=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position);Cesium.Matrix4.multiplyByTranslation(l,new Cesium.Cartesian3(0,0,-i),l),Cesium.Matrix4.getTranslation(l,this.model.position),Cesium.Matrix4.multiplyByMatrix3(l,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(s,a,r)),this.entity.modelMatrix),this.label&&(this.label.show=this.label.show),this.options.label.position&&setTimeout((function(){e.options.label.position.alt?e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)}var c=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=c,this._elms.height&&this._elms.height.forEach((function(e){e.value=Number(t.toFixed(2))}))}}},{key:"ground",get:function(){return this.options.ground},set:function(t){var e=this;if(this.lineEdit=!1,this.options.ground=t,this.realTimeLine.polyline.clampToGround=t,this.height=this.options.height,this.line&&t){this.line.polyline.clampToGround=!0;for(var i=function(t){e.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(e.options.line.positions[t].lng,e.options.line.positions[t].lat)]).then((function(i){e.keyPoints[t].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}setTimeout((function(){e.TweenAnimate&&e.TweenAnimate._isPlaying?e.setMovePositionByDistance(e.TweenAnimate._object.distance):e.setMovePositionByDistance(0)}),200),t?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.ground&&this._elms.ground.forEach((function(e){e.checked=t}))}},{key:"modelPixelSize",get:function(){return this.options.model.pixelSize},set:function(t){this.options.model.pixelSize=t,this.model&&(this.model.minimumPixelSize=t),this._elms.modelPixelSize&&this._elms.modelPixelSize.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.model.scale},set:function(t){this.options.model.scale=Number(t),this.model&&(this.model.scale=t,this.model.customScale={x:this.options.model.scale,y:this.options.model.scale,z:this.options.model.scale}),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){t<=0&&(t=.01),this.options.speed=t,this.state&&this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(t){this.lineEdit=!1,this.options.line.smooth=t;var e=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=e,this.model.position=e[0],this.modelMove(e),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t}))}},{key:"delay",get:function(){return this.options.delay},set:function(t){this.options.delay=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(e){e.value=t}))}},{key:"state",get:function(){return this.options.state},set:function(t){var e=this;if(this.options.state=t,cancelAnimationFrame(_h(Dh,this)),this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),this.TweenAnimate&&this.TweenAnimate._isPlaying)if(clearTimeout(this.TweenAnimate.timeout),t)this.lineEdit=!1,this.TweenAnimate.isPlaying()?this.TweenAnimate.timeout=setTimeout((function(){e.TweenAnimate.resume()}),this.options.delay):this.TweenAnimate.delay(this.delay).start(),this.speed=this.speed;else{var i=bh({},this.sdk.viewer.camera._position),n=this;kh(Dh,this,requestAnimationFrame((function t(){n.firstPersonView&&n.sdk.viewer.camera.setView({destination:bh({},i),orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}),kh(Dh,n,requestAnimationFrame(t))}))),this.TweenAnimate.pause(),setTimeout((function(){n.model.isMove=!1}),200)}else if(t){var o=this.renewLinePositions(this.options.line.positions);this.modelMove(o)}this._elms.state&&this._elms.state.forEach((function(e){e.checked=t}))}},{key:"modelShow",get:function(){return this.options.model.show},set:function(t){this.options.model.show=t,this.model&&this.show&&(this.model.show=t),this._elms.modelShow&&this._elms.modelShow.forEach((function(e){e.checked=t}))}},{key:"modelAnimate",get:function(){return this.options.model.animate},set:function(t){if(this.options.model.animate=t,this.model&&this.model.loader.components){var e=this.model.loader.components.animations;if(this.model.activeAnimations.removeAll(),e&&e.length>0)for(var i=0;i<e.length;i++)if(e[i].name==t){this.model.activeAnimations.add({index:i,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}this._elms.modelAnimate&&this._elms.modelAnimate.forEach((function(e){e.value=t}))}}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(t){this.lineEdit=!1,this.options.line.noseToTail=t;for(var e=[],i=0;i<this.options.line.positions.length;i++)e.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(e);if(this.line){var n=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=n,this.model.position=n[0],this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(t){t&&(this.realTimeRoute=!1),this.options.line.show=t,this.line&&this.show&&(this.line.polyline.material=t?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20})),this._elms.lineShow&&this._elms.lineShow.forEach((function(e){e.checked=t}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(t){t&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=t,this.realTimeLine&&this.show&&(this.realTimeLine.show=t),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(e){e.checked=t}))}},{key:"keyPointShow",get:function(){return this.options.line.keyPoint},set:function(t){this.options.line.keyPoint=t;for(var e=0;e<this.keyPoints.length;e++)this.show&&(this.keyPoints[e].show=t);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(e){e.checked=t})),!t&&this.lineEdit&&(kh(Sh,this,t),YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t})))}},{key:"lineEdit",get:function(){return _h(Sh,this)},set:function(t){var e=this,i=[],n=function(t){i=e.renewLinePositions(t),e.model.position=i[0],e.modelMove(i)};if(t){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=new Z("请选择一个顶点,右键取消",this.sdk),this.event=new X(this.sdk),n(L()(this.options.line.positions));var s=function(t,i){var s=e.sdk.viewer.scene.pick(t.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<e.keyPoints.length;a++)if(e.keyPoints[a].id===s.id.id){o=s.id,e.ControllerObject.position=e.options.line.positions[o.index],e.ControllerObject.editTranslational(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.controllerCallBack=function(t){e.options.line.positions[o.index]=t.position,0===o.index&&(e.options.height=e.options.line.positions[o.index].alt,e._elms.height&&e._elms.height.forEach((function(t){t.value=Number(e.options.height.toFixed(2))}))),o.position=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n(L()(e.options.line.positions))};break}};this.event.mouse_left(s),this.event.mouse_right((function(t,i){e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()})),this.event.mouse_move((function(t,i){e.tip&&e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?(e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()):s(o)}))})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=t}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=t,this.ControllerObject.destroy();kh(Sh,this,t),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(t){this.options.routeDirection=t,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(e){e.checked=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(t){var e=this,i=le();if((Pe()||i.sdkD||!this.show)&&(t=!1),cancelAnimationFrame(_h(Dh,this)),_h(Oh,this)&&_h(Oh,this).destroy(),this.sdk.viewer._firstPersonView=t,this.options.firstPersonView=t,this.options.firstPersonView){if(this.viewFollow=!0,this.firstPersonHeadingPitch={heading:0,pitch:-10},this.state=!0,this.model&&(this.model.show=!1),this._DialogObject&&this._DialogObject._element.content){var n=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");n[0].className="btn is-active",n[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),He(this.sdk,!1);var o,s=le(),a=(o=this.sdk===s.sdkP?s.sdkD:s.sdkP)?o.entityMap.get(this.options.id):void 0;this.sdk&&kh(Oh,this,new X(this.sdk)),_h(Oh,this).mouse_right_down((function(t,i){var n=bh({},t.position);_h(Oh,e).mouse_move((function(t,i){e.firstPersonHeadingPitch.heading=e.firstPersonHeadingPitch.heading+(t.endPosition.x-n.x)/20,e.firstPersonHeadingPitch.pitch=e.firstPersonHeadingPitch.pitch+(n.y-t.endPosition.y)/10,a&&(a.firstPersonHeadingPitch=bh({},e.firstPersonHeadingPitch)),n=bh({},t.endPosition)}),!0)}),!0),_h(Oh,this).mouse_right_up((function(t,i){_h(Oh,e).mouse_move((function(){}))}),!0)}else{if(He(this.sdk,!0),this.model&&this.modelShow&&this.show&&(this.model.show=!0),this._DialogObject&&this._DialogObject._element.content){var r=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");r[0]&&r[1]&&(r[0].className="btn",r[1].className="btn is-active")}if(this.viewFollow&&this.show){if(this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),3===this.sdk.viewer.scene.mode){var l=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=l}this.viewFollow=this.viewFollow}}re(this.sdk,this.options.id)}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(t){le();var e=Pe();if(this.show||(t=!1),this.options.viewFollow=t,this.options.viewFollow?(this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),Ye(this.sdk),this.lineEdit=!1):this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),t&&this.show&&this.model){var n=this.sdk.viewer.entities.add({position:this.model.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}var o=Me();if(o)if(this.sdk!=o){var s=o.entityMap.get(this.options.id);s&&s.viewFollow!=t&&(s.viewFollow=t)}else if(e){var a=e.entityMap.get(this.options.id);a&&a.viewFollow!=t&&(a.viewFollow=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&a.setMovePositionByDistance(this.TweenAnimate._object.distance))}re(this.sdk,this.options.id),this._elms.viewFollow&&this._elms.viewFollow.forEach((function(e){e.checked=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show?(this.label&&(this.label.show=t),this.options.label.position&&setTimeout((function(){e.options.label.position.alt?e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Ln(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label&&(this.label.near=e),this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label&&(this.label.far=e),this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"modelMove",value:(p=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w,k=this,_=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w=function(t,e){var i=Cesium.Transforms.eastNorthUpToFixedFrame(t);if(e){var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:l}}},C=function(){return(C=o()(a.a.mark((function t(e){var i,o,s,r,c,u,p,d,g,b,C,k,_,x,E,S,D,P,M,O,T,N,B,A,j,I,F,R,z,H,V,G,U,W,Y,J;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.model.isMove=!0,i=Pe(),o=le(),n.sdk.viewer&&n.sdk.viewer.scene){t.next=6;break}return n.removeModelAnimate(),t.abrupt("return");case 6:if(c=h,!(s=e)){t.next=16;break}return t.next=12,turf.lineSliceAlong(h,0,s,{units:"kilometers"});case 12:c=t.sent,r=L()(c.geometry.coordinates[c.geometry.coordinates.length-1]),t.next=17;break;case 16:r=L()(h.geometry.coordinates[0]);case 17:if(!n.ground){t.next=57;break}d=[],g=vh(n.sdk.entityMap);try{for(g.s();!(b=g.n()).done;)(C=y()(b.value,2))[0],(!(k=C[1]).type||"glb"!==k.type&&"bim"!==k.type&&"tileset"!==k.type&&"TrajectoryMotion"!==k.type&&"ParticleEffects"!==k.type&&k.entity)&&(d.push(k.entity),k.label&&k.label.entity&&d.push(k.label.entity))}catch(t){g.e(t)}finally{g.f()}if(n.label&&n.label.entity&&d.push(n.label.entity),!(x=Pe())||n.sdk!=x){t.next=28;break}_=new Cesium.Cartesian3.fromDegrees(r[0],r[1]),u=_,t.next=32;break;case 28:return t.next=30,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r[0],r[1]),[n.model].concat(d));case 30:_=t.sent,u=_;case 32:return _||(u=new Cesium.Cartesian3.fromDegrees(r[0],r[1])),E=n.cartesian3Towgs84(u,l),S=0,t.prev=35,t.next=38,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(E.lng,E.lat)]);case 38:D=t.sent,S=D[0].height,t.next=45;break;case 42:t.prev=42,t.t0=t.catch(35),S=0;case 45:if(E.alt<S&&(E.alt=S),E.alt=Number(E.alt.toFixed(1)),u=Cesium.Cartesian3.fromDegrees(E.lng,E.lat,E.alt),n.sdk.viewer&&n.sdk.viewer.scene){t.next=51;break}return n.removeModelAnimate(),t.abrupt("return");case 51:for(p=Cesium.Cartesian3.fromDegrees(r[0],r[1],n.cartesian3Towgs84(u,n.sdk.viewer).alt+1.8),P=[],M=0;M<c.geometry.coordinates.length;M++)P.push(c.geometry.coordinates[M][0],c.geometry.coordinates[M][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(P),t.next=75;break;case 57:if(O=n.spline.evaluate(e/n.distance)){t.next=60;break}return t.abrupt("return");case 60:r=n.cartesian3Towgs84(O,l),u=O,p=Cesium.Cartesian3.fromDegrees(r.lng,r.lat,r.alt+1.8),T=[],N=0;case 65:if(!(N<=1e3)){t.next=73;break}if(!(N/1e3>e/n.distance)){t.next=68;break}return t.abrupt("break",73);case 68:B=n.spline.evaluate(N/1e3),T.push(B);case 70:N++,t.next=65;break;case 73:T.push(O),n.realTimePositions=T;case 75:if(m=w(n.model.position,u),v&&v.position&&(f=w(v.position,u),m.pitch=f.pitch),v.position=n.model.position,Cesium.HeadingPitchRoll.fromDegrees(n.options.model.heading,n.options.model.pitch,n.options.model.roll),A=0,j=0,I=0,F=Cesium.Transforms.eastNorthUpToFixedFrame(u),!n.options.routeDirection||n.lineEdit){t.next=95;break}if(A=m.heading*(180/Math.PI)-90-n.options.model.heading,j=m.pitch*(180/Math.PI)-n.options.model.pitch,I=n.options.model.roll,R=Me()?Me().entityMap.get(n.options.id):o.sdkP&&o.sdkP.entityMap.get(n.options.id),n.state||R&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)&&(A=R.model.heading,j=R.model.pitch,I=R.model.roll),!(isNaN(A)||isNaN(j)||isNaN(I))){t.next=91;break}return t.abrupt("return");case 91:n.state||(R&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)?(A=R.model.heading,j=R.model.pitch,I=R.model.roll):(A=n.model.heading||0===n.model.heading?n.model.heading:n.options.model.heading,j=n.model.pitch||0===n.model.pitch?n.model.pitch:n.options.model.pitch,I=n.model.roll||0===n.model.roll?n.model.roll:n.options.model.roll)),n.model.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(F,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(A,j,I)),n.model.modelMatrix),t.next=111;break;case 95:if(!n.entity){t.next=111;break}if(A=n.options.model.heading,j=n.options.model.pitch,I=n.options.model.roll,!(isNaN(A)||isNaN(j)||isNaN(I))){t.next=101;break}return t.abrupt("return");case 101:z=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(I)),H=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(j)),V=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(A)),G=Cesium.Matrix4.fromRotationTranslation(z),U=Cesium.Matrix4.fromRotationTranslation(H),W=Cesium.Matrix4.fromRotationTranslation(V),Y=new Cesium.Matrix4,Cesium.Matrix4.multiply(F,G,Y),Cesium.Matrix4.multiply(Y,U,Y),Cesium.Matrix4.multiply(Y,W,n.entity.modelMatrix);case 111:if(n.model.position=u,n.model.roll=I,n.model.pitch=j,n.model.heading=A,u){t.next=117;break}return t.abrupt("return");case 117:J=n.cartesian3Towgs84(u,n.sdk.viewer),n.label.position=[J.lng,J.lat,J.alt],n.realTimeRouteArray.push(u),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:p,orientation:{heading:Cesium.Math.toRadians(A+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}}):3===n.sdk.viewer.scene.mode?n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=u):n.sdk.viewer.trackedEntity&&n.sdk.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(r.lng,r.lat,n.sdk.viewer.camera.positionCartographic.height),orientation:{heading:Cesium.Math.toRadians(-90),pitch:0,roll:0}}));case 122:case"end":return t.stop()}}),t,null,[[35,42]])})))).apply(this,arguments)},b=function(t){return C.apply(this,arguments)},i=_.length>1&&void 0!==_[1]?_[1]:{time:0},cancelAnimationFrame(_h(Dh,this)),n=this,s=i.time||0,r=i.distance,l=this.sdk.viewer,this.model&&this.sdk&&this.sdk.viewer){t.next=11;break}return t.abrupt("return");case 11:for(this.removeModelAnimate(),c=[],u=0;u<e.length;u++)p=this.cartesian3Towgs84(e[u],l),c.push([p.lng,p.lat,p.alt]);h=turf.lineString(c),this.distance=turf.length(h,{units:"kilometers"}),d=1e3*this.distance/this.options.speed,r||0===r?(r>this.distance&&(r=this.distance),s=r/this.distance*d):(r=1e-6,s&&(s>d&&(s=d),r=s/d*this.distance)),v={},this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){(s||r)&&k.modelMove(e)})).onUpdate(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(k.sdk.viewer){t.next=6;break}return k.removeModelAnimate(),t.abrupt("return");case 6:isNaN(e.distance)||b(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){k.realTimeRouteArray=[]})).onComplete((function(t){k.state=!1})),this.state?this.TweenAnimate.start():(g=function(){if(kh(Ph,n,requestAnimationFrame(g)),n.options.firstPersonView){var t=bh({},n.sdk.viewer.camera._position);n.sdk.viewer.camera.setView({destination:t,orientation:{heading:Cesium.Math.toRadians(n.model.heading+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}})}},b(r),setTimeout((function(){n.model.isMove=!1}),500),g());case 24:case"end":return t.stop()}}),t,this)}))),function(t){return p.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{time:t})}},{key:"edit",value:(u=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=45;break}return t.next=8,new Zi(this.sdk,this.options,{title:"轨迹运动属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close();var e=p.deepCopyObj(p.options);e.host="",p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(e),be(p.sdk,p.options.id),re(p.sdk,p.options.id)},removeCallBack:function(){p.sdk.viewer.trackedEntity&&(p.sdk.viewer.entities.remove(p.sdk.viewer.trackedEntity),p.sdk.viewer.trackedEntity=null),p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p._DialogObject=null,p.reset(),p.Dialog.closeCallBack&&p.Dialog.closeCallBack(),p.editObj&&(p.editObj.destroy(),p.editObj=null),p.keyPointShow=!1,p.event&&p.event.destroy(),p.tip&&p.tip.destroy(),p.tip=null,p.ControllerObject.destroy(),p.firstPersonView!==p.originalOptions.firstPersonView&&(p.firstPersonView=p.originalOptions.firstPersonView),p.firstPersonView&&p.modelShow&&p.model&&(p.model.show=!1)},showCallBack:function(t){p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()}});case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" trajectory-motion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">起始点高度</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">模型倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99999" step="1" @model="scale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">运行速度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="99999999" step="1" @model="speed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">延迟运动</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="9999999" @model="delay">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">更换模型</span>\n <button class="btn" @click="clickChangeModel">选择</button>\n </div>\n <div class="col">\n <span class="label">模型方向</span>\n <button class="btn model-rotate-btn" @click="modelRotate">开始调整</button>\n <svg class="icon-rubric"><use xlink:href="#yj-icon-rubric"></use></svg>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="btn-group">\n <button class="btn" style="border-radius: 5px 0 0 5px;" name="firstPerson"\n data-state="true"><span>第一视角</span></button>\n <button class="btn" style="border-radius: 0 5px 5px 0;" name="firstPerson"\n data-state="false"><span>第三视角</span></button>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item div-item-switch">\n <div class="row">\n <div class="col">\n <span class="label">路径显隐</span>\n <input class="btn-switch" type="checkbox" @model="lineShow">\n </div>\n <div class="col">\n <span class="label">模型显隐</span>\n <input class="btn-switch" type="checkbox" @model="modelShow">\n </div>\n <div class="col">\n <span class="label">实时路径</span>\n <input class="btn-switch" type="checkbox" @model="realTimeRoute">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">编辑</span>\n <input class="btn-switch" type="checkbox" @model="lineEdit">\n </div>\n <div class="col">\n <span class="label">路径圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col">\n <span class="label">环线</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">轨迹贴地</span>\n <input class="btn-switch" type="checkbox" @model="ground">\n </div>\n <div class="col">\n <span class="label">轨迹循环</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n <div class="col">\n <span class="label">轨迹动画</span>\n <input class="btn-switch" type="checkbox" @model="state">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">路径方向</span>\n <input class="btn-switch" type="checkbox" @model="routeDirection">\n </div>\n <div class="col" style="margin-right: 33px;">\n <span class="label">视角跟随</span>\n <input class="btn-switch" type="checkbox" @model="viewFollow">\n </div>\n <div class="col" style="margin: 0px;">\n <span class="label">模型动画</span>\n <div class="input input-select model-animate-select"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col"></div>\n </div>\n <div class="row">\n <div class="col" style="margin-right: 14px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),this.editObj?(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"):(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn"),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor=""}}),o=this._DialogObject._element.content.getElementsByClassName("height-box")[0],s=i.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.heightBox=o,this._elms.labelColor=[n],this.model&&(r=function(){var t=p.model.loader.components.animations;if(p._DialogObject){if(t){for(var e=[{name:"无",value:"无"}],n=0;n<t.length;n++)e.push({name:t[n].name,value:t[n].name});Y(p._DialogObject._element.content,".model-animate-select").legp_search(e)}var o=i.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];o.value=p.modelAnimate,o.addEventListener("input",(function(t,e){p.modelAnimate=o.value}))}},Number(Cesium.VERSION.split(".")[1])>=107?this.model.ready?r():this.model.readyEvent.addEventListener((function(){r()})):this.model.readyPromise.then((function(t){r()}))),this.ground?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),(l=i.querySelectorAll("button[name='firstPerson']"))[0].addEventListener("click",(function(t){var e=le();Pe()||e.sdkD||(p.firstPersonView||(p.viewFollow=!0),p.firstPersonView=!0)})),l[1].addEventListener("click",(function(t){p.firstPersonView&&(p.viewFollow=!0),p.firstPersonView=!1})),this.options.firstPersonView?(l[0].className="btn is-active",l[1].className="btn",this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)):(l[0].className="btn",l[1].className="btn is-active"),(c=document.createElement("div")).className="custom-rubric-box",c.style.transformOrigin="center bottom",c.style.position="absolute",c.style.top="180px",c.style.right="3px",c.style.padding="5px 10px",c.style.backgroundColor="#3e4249",c.style.borderRadius="5px",c.style.fontSize="12px",c.style.color="#ff5733",c.style.display="none",c.innerHTML='场景正北方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>',(u=i.getElementsByClassName("icon-rubric")[0]).addEventListener("mouseenter",(function(t){c.style.display="block"})),document.addEventListener("mousemove",(function(t){u.contains(t.target)||(c.style.display="none")})),this._DialogObject._element.content.appendChild(c),setTimeout((function(){var t=Nn(),e=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(e){e.legp_search(t);var i=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];i.value=t[p.labelFontFamily].value;for(var n=0;n<t.length;n++)if(t[n].value==i.value){e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){p.labelFontFamily=t[e].key;break}})),p._elms.labelFontFamily=[i]}}),0);case 45:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"flyTo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ei(0),Ye(this.sdk),this.options.customView?this.sdk.viewer.camera.flyTo({destination:this.options.customView.position,orientation:this.options.customView.orientation}):this.line&&this.sdk.viewer.flyTo(this.line,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}})}},{key:"remove",value:(c=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.scene.primitives.remove(this.model),this.sdk.viewer.entities.remove(this.line),this.sdk.viewer.entities.remove(this.realTimeLine),this.label&&this.label.remove(),e=0;e<this.keyPointShow.length;e++)this.sdk.viewer.entities.remove(this.keyPointShow[e]);return this.line=null,this.realTimeLine=null,this.model=null,this.label=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),_h(Mh,this)&&_h(Mh,this).destroy(),this.removeModelAnimate(),(i=Pe())&&i===this.sdk||(this.viewFollow=!1),cancelAnimationFrame(_h(Dh,this)),t.next=19,this.sdk.removeIncetance(this.options.id);case 19:return t.next=21,be(this.sdk,this.options.id);case 21:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"reset",value:(l=o()(a.a.mark((function t(){var e,i=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.options.model.url!==this.originalOptions.model.url&&this.changeModelUrl(this.originalOptions.model.url),this.name=this.originalOptions.name,JSON.stringify(this.options.line.positions)!==JSON.stringify(this.originalOptions.line.positions)&&(this.options.line.positions=this.deepCopyObj(this.originalOptions.line.positions),e=this.renewLinePositions(this.options.line.positions),this.line.polyline.positions=e,setTimeout((function(){i.model.position=e[0],i.modelMove(e)}),0)),this.modelShow=this.originalOptions.model.show,this.noseToTail!==this.originalOptions.line.noseToTail&&(this.noseToTail=this.originalOptions.line.noseToTail),this.height!==this.originalOptions.height&&(this.height=this.originalOptions.height),this.lineShow!==this.originalOptions.line.show&&(this.lineShow=this.originalOptions.line.show),this.keyPointShow=this.originalOptions.line.keyPoint,this.routeDirection=this.originalOptions.routeDirection,this.scale=this.originalOptions.model.scale,this.loop!==this.originalOptions.loop&&(this.loop=this.originalOptions.loop),this.viewFollow=this.originalOptions.viewFollow,this.state=this.originalOptions.state,this.speed=this.originalOptions.speed,this.smooth!==this.originalOptions.line.smooth&&(this.smooth=this.originalOptions.line.smooth),this.realTimeRoute=this.originalOptions.realTimeRoute,this.modelAnimate=this.originalOptions.model.animate,this.delay=this.originalOptions.delay,this.ground!==this.originalOptions.ground&&(this.ground=this.originalOptions.ground),this.firstPersonView!==this.originalOptions.firstPersonView&&(this.firstPersonView=this.originalOptions.firstPersonView),this.firstPersonView&&this.modelShow&&this.model&&(this.model.show=!1),this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.options=this.deepCopyObj(this.originalOptions);case 34:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"modelRotate",value:function(){if(this.editObj)this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn");else if(this.viewFollow)window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"关闭视角跟随后可调整模型方向!",type:"warning",duration:1500}),console.warn("关闭视角跟随后可调整模型方向!"));else{this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"),console.log(this._DialogObject._element.content,this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0]),this.state=!1,this.editObj=new Zl(this.sdk,this.model),this.editObj.editRtation(),this.editObj.transformCallBack=this.rotationEditingCallBack,this.routeDirection=!1;var t=this.options.model.heading,e=this.options.model.pitch,i=this.options.model.roll;if(isNaN(t)||isNaN(e)||isNaN(i))return;var n=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position),o=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(i)),s=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(e)),a=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(t)),r=Cesium.Matrix4.fromRotationTranslation(o),l=Cesium.Matrix4.fromRotationTranslation(s),c=Cesium.Matrix4.fromRotationTranslation(a),u=new Cesium.Matrix4;Cesium.Matrix4.multiply(n,r,u),Cesium.Matrix4.multiply(u,l,u),Cesium.Matrix4.multiply(u,c,this.entity.modelMatrix)}}},{key:"clickChangeModel",value:function(){this.Dialog.changeModelCallBack&&this.Dialog.changeModelCallBack()}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.options.model.heading=e.rz,t.options.model.pitch=e.ry,t.options.model.roll=e.rx,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.editObj._params),t.entity&&(t.entity.isMove=!0),clearTimeout(_h(Eh,t)),kh(Eh,t,setTimeout((function(){t.entity&&(t.entity.isMove=!1)}),500))}},set:function(t){this._rotationEditingCallBack=t}},{key:"changeModelUrl",value:(r=o()(a.a.mark((function t(e){var i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sdk.viewer.scene.primitives.remove(this.model),this.options.model.url=this.replaceHost(e,this.options.host),i=this.model.modelMatrix,n=this.model.position,o={id:this.options.id,url:this.options.model.url,show:this.options.model.show,scale:this.options.model.scale},s=function(){r.options.model.url===r.originalOptions.model.url?r.modelAnimate=r.originalOptions.model.animate:r.options.model.animate="无";var t=r.model.loader.components.animations;if(r._DialogObject){if(t){for(var e=[{name:"无",value:"无"}],i=0;i<t.length;i++)e.push({name:t[i].name,value:t[i].name});Y(r._DialogObject._element.content,".model-animate-select").legp_search(e)}var n=r._DialogObject._element.content.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];n.value=r.modelAnimate,n.addEventListener("input",(function(t,e){r.modelAnimate=n.value}))}},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=15;break}return t.next=9,Cesium.Model.fromGltfAsync(o);case 9:this.model=t.sent,this.model.position=n,this.sdk.viewer.scene.primitives.add(this.model),this.model.readyEvent.addEventListener((function(){s(),r.model.modelMatrix=i})),t.next=18;break;case 15:this.model=this.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),this.model.position=n,this.model.readyPromise.then((function(t){s(),r.model.modelMatrix=i}));case 18:this.model.imageBasedLighting.luminanceAtZenith=.6;case 19:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"controllerCallBack",get:function(){return function(t){}},set:function(t){this._controllerCallBack=t}},{key:"renewLinePositions",value:function(t){var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=1e3;a++){var r=this.spline.evaluate(a/1e3);o.push(r)}return this.positions_smooth=o,o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(t){var i,n=t.renewLinePositions(t.options.line.positions);i=!!t.options.show&&t.options.line.show,t.sdk.viewer.entities.removeById(t.options.id+"-2"),t.sdk.viewer.entities.removeById(t.options.id+"-3"),t.line=t.sdk.viewer.entities.add({id:t.options.id+"-2",polyline:{positions:n,width:2,clampToGround:t.ground,material:i?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20}),zIndex:t.sdk._entityZIndex}}),t.realTimeLine=t.sdk.viewer.entities.add({id:t.options.id+"-3",show:!!t.options.realTimeRoute&&t.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return t.realTimePositions}),!1),width:2,clampToGround:t.ground,material:Cesium.Color.fromCssColorString("#ff0000"),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,_h(Mh,t)&&_h(Mh,t).destroy(),kh(Mh,t,new X(t.sdk)),_h(Mh,t).mouse_right((function(e,i){var n,o=le(),s=(n=t.sdk===o.sdkP?o.sdkD:o.sdkP)?n.entityMap.get(t.options.id):void 0;s&&(s.viewFollow=!1),t.viewFollow=!1}),!0),e.addModel(t),e.addKeyPoint(t),t.noseToTail=t.options.line.noseToTail,t.smooth=t.options.line.smooth,be(t.sdk,t.options.id),t.options.show&&Qt(0,t.options.id)}},{key:"addModel",value:(s=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.replaceHost(i.options.model.url,i.options.host),o={id:i.options.id,url:n,show:!!i.options.show&&i.options.model.show,scale:i.options.model.scale},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=11;break}return t.next=5,Cesium.Model.fromGltfAsync(o);case 5:i.model=t.sent,i.model.originalBoundingSphereRadius=0,i.sdk.viewer.scene.primitives.add(i.model),i.model.readyEvent.addEventListener((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate})),t.next=14;break;case 11:i.model=i.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),i.model.originalBoundingSphereRadius=0,i.model.readyPromise.then((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate}));case 14:for(i.model.imageBasedLighting.luminanceAtZenith=.6,s=Cesium.Transforms.eastNorthUpToFixedFrame(i.positions_smooth[0]),i.model.modelMatrix=s,i.model.position=i.positions_smooth[0],i.model.customScale={x:i.options.model.scale,y:i.options.model.scale,z:i.options.model.scale},r=i.options.line.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,r[c].alt);u=i.smooth?i.positions_smooth:Cesium.Cartesian3.fromDegreesArrayHeights(l),e.createLabel(i),i.modelMove(u),i.entity=i.model;case 26:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"createLabel",value:(n=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.cartesian3Towgs84(e.model.position,e.sdk.viewer),e.label=new zn(e.sdk,{show:!!e.options.show&&!!e.options.model.show&&e.options.label.show,position:[i.lng,i.lat,i.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far},e.model);case 2:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"addKeyPoint",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<e.options.line.positions.length)){t.next=13;break}return t.next=4,e.getClampToHeight(e.options.line.positions[i]);case 4:return n=t.sent,t.next=7,Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,n);case 7:o=t.sent,s=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:e.options.line.keyPoint||!1,position:e.ground?o:Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,e.options.line.positions[i].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.keyPoints.push(s);case 10:i++,t.next=1;break;case 13:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r,l,c,u,p}(Mn);function Nh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Bh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Bh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Bh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Lh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ah(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Ih(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Fh(t,e,i){return t.set(Rh(t,e),i),i}function Rh(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var zh=new WeakMap,Hh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Ih(i=jh(this,e,[t,n]),zh,!1),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.totalTime=n.totalTime,(n.totalTime||0===n.totalTime)&&(i.totalTime=n.totalTime),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=n.height||0===n.height?n.height:i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i._current={heading:0,pitch:0,roll:0},i.distance,i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.ControllerObject=new _o(i.sdk),i._EventBinding=new pn,e.addLine(i),i.firstPersonView=!1,i.options.viewFollow=!1),i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"TrajectoryMotionObject"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){if(this.options.show=t,t){this.line.show=this.lineShow;for(var e=0;e<this.keyPoints.length;e++)this.keyPoints[e].show=this.keyPointShow}else{this.line.show=t;for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=t}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(t){var e=this;if(this.options.height=t,this.line)if(this.ground){this.line.polyline.clampToGround=!0;for(var i=function(t){e.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(e.options.line.positions[t].lng,e.options.line.positions[t].lat)]).then((function(i){e.keyPoints[t].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}else{var o=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var s=0;s<this.keyPoints.length;s++)this.options.line.positions[s].alt+=o,this.keyPoints[s].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[s].lng,this.options.line.positions[s].lat,this.options.line.positions[s].alt)}this._renewLine(this.options.line.positions);this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"ground",get:function(){return this.options.ground},set:function(t){this.lineEdit=!1,this.options.ground=t,this.realTimeLine.polyline.clampToGround=t,this.height=this.options.height,this._elms.ground&&this._elms.ground.forEach((function(e){e.checked=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){var e=this;t<=0&&(t=.01),this.options.speed=t,(this.distance||0===this.distance)&&(this.options.totalTime=1e3*this.distance/this.options.speed,this.TweenAnimate&&this.state&&this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t})),this._elms.totalTime&&this._elms.totalTime.forEach((function(t){t.value=e.options.totalTime})))}},{key:"totalTime",get:function(){return this.options.totalTime},set:function(t){var e=this;this.options.totalTime=t,(this.distance||0===this.distance)&&(this.options.speed=1e3*this.distance/this.options.totalTime,this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.totalTime&&this._elms.totalTime.forEach((function(e){e.value=t})),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e.options.speed})))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(t){this.lineEdit=!1,this.options.line.smooth=t;var e=this._renewLine(this.options.line.positions);this.modelMove(e),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t}))}},{key:"delay",get:function(){return this.options.delay},set:function(t){this.options.delay=t,this.TweenAnimate&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(e){e.value=t}))}},{key:"state",get:function(){return this.options.state},set:function(t){if(this.options.state=t,this.editObj&&(this.editObj.destroy(),this.editObj=null),this.TweenAnimate)t?this.speed=this.speed:this.TweenAnimate.pause();else if(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e)}this._elms.state&&this._elms.state.forEach((function(e){e.checked=t}))}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(t){this.lineEdit=!1,this.options.line.noseToTail=t;for(var e=[],i=0;i<this.options.line.positions.length;i++)e.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(e);if(this.line){var n=this._renewLine(this.options.line.positions);this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(t){t&&(this.realTimeRoute=!1),this.options.line.show=t,this.line&&this.show&&(this.line.show=t),this._elms.lineShow&&this._elms.lineShow.forEach((function(e){e.checked=t}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(t){t&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=t,this.realTimeLine&&this.show&&(this.realTimeLine.show=t),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(e){e.checked=t}))}},{key:"keyPointShow",get:function(){return this.options.line.keyPoint},set:function(t){this.options.line.keyPoint=t;for(var e=0;e<this.keyPoints.length;e++)this.show&&(this.keyPoints[e].show=t);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(e){e.checked=t})),!t&&this.lineEdit&&(Fh(zh,this,t),YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t})))}},{key:"lineEdit",get:function(){return e=this,(t=zh).get(Rh(t,e));var t,e},set:function(t){var e=this,i=[],n=function(t){i=e._renewLine(t),e.modelMove(i)};if(t){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("请选择一个顶点,右键取消",this.sdk),this.event=new X(this.sdk),n(L()(this.options.line.positions)),this.event.mouse_left((function(t,i){var s=e.sdk.viewer.scene.pick(t.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<e.keyPoints.length;a++)if(e.keyPoints[a].id===s.id.id){o=s.id,e.ControllerObject.position=e.options.line.positions[o.index],e.ControllerObject.editTranslational(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.controllerCallBack=function(t){e.options.line.positions[o.index]=t.position,o.position=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n(L()(e.options.line.positions))};break}})),this.event.mouse_right((function(t,i){e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()})),this.event.mouse_move((function(t,i){e.tip&&e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=t}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=t,this.ControllerObject.destroy();Fh(zh,this,t),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(t){this.options.routeDirection=t,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(e){e.checked=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat(),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(t){if(this.sdk.viewer._firstPersonView=t,this.options.firstPersonView=t,this.options.firstPersonView){if(this._DialogObject&&this._DialogObject._element.content){var e=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");e[0].className="btn is-active",e[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)}else{if(this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}if(this.viewFollow){this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity);var n=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}}}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(t){if(this.options.viewFollow=t,this.options.viewFollow?this.lineEdit=!1:this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var e=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");e[0]&&e[1]&&(e[0].className="btn",e[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),t){var i=this.sdk.viewer.entities.add({position:this.current.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=i}this._elms.viewFollow&&this._elms.viewFollow.forEach((function(e){e.checked=t}))}},{key:"moveCallBack",value:function(t){this.setPosition=t.setPosition.bind(t)}},{key:"current",get:function(){return this._current},set:function(t){this._current=t;var e=this.cartesian3Towgs84(this._current.position,this.sdk.viewer);this.setPosition&&this.setPosition(Ah(Ah({},this._current),{},{position:Ah({},e)}))}},{key:"modelMove",value:(s=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w,k,_,x,E,S,D=this,P=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(S=function(t,e){var i=Cesium.Transforms.eastNorthUpToFixedFrame(t);if(e){var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=r*(180/Math.PI);r=l*(Math.PI/180);var c=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:c}}},E=function(){return(E=o()(a.a.mark((function t(e){var i,o,s,r,c,u,p,d,y,b,C,w,k,x,E,D,P,M,O,T;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=h,!(i=e)){t.next=10;break}return t.next=6,turf.lineSliceAlong(h,0,i,{units:"kilometers"});case 6:r=t.sent,o=L()(r.geometry.coordinates[r.geometry.coordinates.length-1]),t.next=11;break;case 10:o=L()(h.geometry.coordinates[0]);case 11:if(!n.ground){t.next=38;break}return t.next=14,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(o[0],o[1]),g);case 14:return p=t.sent,(c=p)||(c=new Cesium.Cartesian3.fromDegrees(o[0],o[1])),d=n.cartesian3Towgs84(c,l),y=0,t.prev=19,t.next=22,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 22:b=t.sent,y=b[0].height,t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),y=0;case 29:for(d.alt<y&&(d.alt=y),d.alt=Number(d.alt.toFixed(1)),c=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,d.alt),u=Cesium.Cartesian3.fromDegrees(o[0],o[1],n.cartesian3Towgs84(c,n.sdk.viewer).alt+1),C=[],w=0;w<s.geometry.coordinates.length;w++)C.push(s.geometry.coordinates[w][0],s.geometry.coordinates[w][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(C),t.next=54;break;case 38:k=n.spline.evaluate(e/n.distance),o=n.cartesian3Towgs84(k,l),c=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),u=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt+1),x=[],E=0;case 44:if(!(E<=100)){t.next=52;break}if(!(E/100>e/n.distance)){t.next=47;break}return t.abrupt("break",52);case 47:D=n.spline.evaluate(E/100),x.push(D);case 49:E++,t.next=44;break;case 52:x.push(k),n.realTimePositions=x;case 54:if(m=S(n.current.position,c),v&&v.position&&(f=S(v.position,c),m.pitch=f.pitch),v.position=n.current.position,P=Cesium.HeadingPitchRoll.fromDegrees(n.current.heading,n.current.pitch,n.current.roll),M=0,O=0,T=0,n.options.routeDirection?(M=(m.heading-P.heading)*(180/Math.PI)-90+n.current.heading,O=m.pitch*(180/Math.PI)):(M=n.current.heading,O=n.current.pitch),T=n.current.roll,!(isNaN(M)||isNaN(O)||isNaN(T))){t.next=65;break}return t.abrupt("return");case 65:(M<0||M>180)&&(O=-O),n.current={position:c,heading:M,pitch:O,roll:T},_&&(_=!1,n._first={position:c,heading:M,pitch:O,roll:T}),n.realTimeRouteArray.push(c),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:u,orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}):n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=c));case 71:case"end":return t.stop()}}),t,null,[[19,26]])})))).apply(this,arguments)},x=function(t){return E.apply(this,arguments)},i=P.length>1&&void 0!==P[1]?P[1]:{time:0},n=this,s=i.time||0,r=i.distance||0,l=this.sdk.viewer,this.removeModelAnimate(),c=[],u=0;u<e.length;u++)p=this.cartesian3Towgs84(e[u],l),c.push([p.lng,p.lat,p.alt]);h=turf.lineString(c),this.distance=turf.length(h,{units:"kilometers"}),this.totalTime||(this.totalTime=1e3*this.distance/this.options.speed),d=this.totalTime,s&&(s>d&&(s=d),r=s/d*this.distance),v={},g=[],b=Nh(this.sdk.entityMap);try{for(b.s();!(C=b.n()).done;)(w=y()(C.value,2))[0],(k=w[1]).type&&"glb"===k.type&&g.push(k.entity)}catch(t){b.e(t)}finally{b.f()}_=!0,this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){s&&D.modelMove(e)})).onUpdate(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(D.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(D.sdk.viewer){t.next=6;break}return D.removeModelAnimate(),t.abrupt("return");case 6:x(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){D.realTimeRouteArray=[]})).onComplete((function(t){D.state=!1,D.removeModelAnimate()})),this.state?this.TweenAnimate.start():x(r);case 26:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{time:t}),this.state||this.modelMove(e,{time:t+.01})}},{key:"pause",value:function(){this.state=!1}},{key:"resume",value:function(){this.state=!0}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},ei(0),Ye(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},(l=Ah({},this.options.line.positions[0])).hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(l);case 14:l.alt=t.sent;case 15:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=23;break;case 22:this.line&&this.sdk.viewer.flyTo(this.line,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 23:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.line),this.line=null,this.removeModelAnimate()}},{key:"reset",value:function(){this.modelMove(this.line.polyline.positions._value),this.state=!1,this.current=this._first}},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"_renewLine",value:function(t){this.options.line.positions=t;var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,o}},{key:"renewLinePositions",value:function(t){this.options.line.positions=t;var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,this.line&&this.line.polyline&&(this.line.polyline.positions=o),o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(t){var i=t._renewLine(t.options.line.positions);t.current.position=i[0],t.line=t.sdk.viewer.entities.add({id:t.options.id+"-2",show:!!t.options.show&&t.options.line.show,polyline:{positions:i,width:2,clampToGround:t.ground,material:Cesium.Color.fromCssColorString("#ffffff"),zIndex:t.sdk._entityZIndex}}),t.realTimeLine=t.sdk.viewer.entities.add({id:t.options.id+"-3",show:!!t.options.realTimeRoute&&t.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return t.realTimePositions}),!1),width:2,clampToGround:t.ground,zIndex:t.sdk._entityZIndex,material:Cesium.Color.fromCssColorString("#ff0000")}}),t.sdk._entityZIndex++,new X(t.sdk).mouse_right((function(e,i){t.viewFollow=!1})),e.addKeyPoint(t),t.noseToTail=t.options.line.noseToTail,t.smooth=t.options.line.smooth}},{key:"addModel",value:function(t){}},{key:"addKeyPoint",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<e.options.line.positions.length)){t.next=13;break}return t.next=4,e.getClampToHeight(e.options.line.positions[i]);case 4:return n=t.sent,t.next=7,Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,n);case 7:o=t.sent,s=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:e.options.line.keyPoint||!1,position:e.ground?o:Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,e.options.line.positions[i].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.keyPoints.push(s);case 10:i++,t.next=1;break;case 13:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s}(Mn);function Vh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Gh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Vh(this,e,[t,n])).options.width=n.width||1,i.options.color=n.color||"#ff0000",i._elms={},i._EventBinding=new pn,e.edit(i,!0),i}return qi()(e,t),x()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color&&(this.options.color=t,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o})))}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t,this._elms.width&&this._elms.width.forEach((function(e){e.value=t}))}},{key:"start",value:function(){var t,i,n,o,s,a=this;if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{this.sdk.viewer;He(this.sdk,!1),(t=e,i="start",n=this,o=3,s=Us()(Yi()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("长按左键,拖动鼠标进行涂鸦,右键结束涂鸦",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var r=[],l=[];this.event.mouse_left_down((function(t,e){l=[];var i=a.sdk.viewer.entities.add({name:"涂鸦",polyline:{positions:new Cesium.CallbackProperty((function(){return l}),!1),width:a.width,clampToGround:!0,material:Cesium.Color.fromCssColorString(a.color),zIndex:99999999}});r.push(i),a.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y),l.push(e)}))})),this.event.mouse_left_up((function(t,e){r[r.length-1].polyline.positions=l,a.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)}))})),this.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right((function(t,e){a.end()})),this.event.gesture_pinck_start((function(t,e){var i=new Date;a.event.gesture_pinck_end((function(){new Date-i>=500&&a.end()}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event=void 0,this.tip&&this.tip.destroy(),this.tip=void 0,He(this.sdk,!0)}},{key:"remove",value:function(){this.end(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);for(var t=this.sdk.viewer.entities.values,e=t.length-1;e>=0;e--)"涂鸦"===t[e].name&&this.sdk.viewer.entities.remove(t[e])}},{key:"flicker",value:function(){}}],[{key:"edit",value:(i=o()(a.a.mark((function t(i,n){var o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=22;break}return t.next=3,new W(i.sdk.viewer._container,{title:"涂鸦参数"});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">涂鸦颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="99" step="1" @model="width">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(o),s=new YJColorPicker({el:o.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:i.color,disabled:!1,openPickerAni:"opacity",sure:function(t){i.color=t},clear:function(){i.color="rgba(255,255,255,1)"}}),i._DialogObject._element.body.className=i._DialogObject._element.body.className+" graffiti",r=o.getElementsByTagName("*"),i._EventBinding.on(i,r),i._elms=i._EventBinding.element,i._elms.color=[s],(l=document.createElement("button")).className="confirm",l.innerHTML="确认",i._DialogObject.footAppChild(l),l.addEventListener("click",(function(){i.start(),e.edit(i,!1)})),t.next=23;break;case 22:i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null);case 23:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(Ys);function Uh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Wh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Uh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Uh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Yh(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Jh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Yh(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.show=!n.show&&!1!==n.show||n.show,i.options.url=n.url,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.positions=n.positions,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.entity={id:i.options.id},i._positionEditing=!1,i.Dialog=o,i._elms={},i.previous={positions:Wh({},i.options.positions)},i._EventBinding=new pn,i.event=new X(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return qi()(e,t),x()(e,[{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.y=t,!this.entity)return;var i=new Image;i.src=this.options.url,i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=i.width,t.height=i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,0,0),e.entity&&(e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}))}}else console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.x=t,!this.entity)return;var i=new Image;i.src=this.options.url,i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=i.width,t.height=i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,0,0),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0})}}else console.error("参数必须为boolean")}},{key:"create",value:(r=o()(a.a.mark((function t(){var e,i=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(this.options.url,{method:"get",headers:{"Content-Type":"application/json"}});case 2:t.sent.ok&&((e=new Image).src=this.options.url,e.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.width,t.height=e.height,i.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),i.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(e,0,0),i.entity=i.sdk.viewer.entities.add({id:i.options.id,show:i.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var t,e=Math.abs(Math.cos(Math.PI/180*i.options.positions.lat))*(1e-4*i.options.scale),n=[i.options.positions.lng-1e-4*i.options.scale,i.options.positions.lat-e,i.options.positions.lng+1e-4*i.options.scale,i.options.positions.lat+e];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1),material:new Cesium.ImageMaterialProperty({image:t,transparent:!0}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(i.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(i.options.angle)}),!1)}}),"cesium-viewer 2d"===i.sdk.viewer._element.className&&(i.entity.rectangle.height=0),be(i.sdk,i.options.id),i.options.show&&Qt(0,i.options.id)});case 4:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=Wh({},this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=16;break}return t.next=6,new Zi(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),be(o.sdk,o.options.id),re(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing=!1,o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()},translationalCallBack:function(){o.positionEditing=!o.positionEditing},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){o.flipeY=!o.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){o.flipeX=!o.flipeX}]}]},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-image",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="99999" min="0" step="0.1" @model="scale">\n <div class="input-number input-number-unit-1" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="99999" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 16:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=t,this.previous={positions:Wh({},this.options.positions)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=n.lng,e.options.positions.lat=n.lat,e.options.positions.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=n.lng,e.options.positions.lat=n.lat,e.options.positions.alt=n.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.positions.lng=e.previous.positions.lng,e.options.positions.lat=e.previous.positions.lat,e.options.positions.alt=e.previous.positions.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.positions.lng=e.previous.positions.lng,e.options.positions.lat=e.previous.positions.lat,e.options.positions.alt=e.previous.positions.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.positions.lng=t.lng,e.options.positions.lat=t.lat,e.options.positions.alt=t.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.options.positions.lng=this.previous.positions.lng,this.options.positions.lat=this.previous.positions.lat,this.options.positions.alt=this.previous.positions.alt))}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=D.length>0&&void 0!==D[0]?D[0]:{},ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Wh({},this.options.position):this.options.positions?l=Wh({},this.options.positions[0]):this.options.center?l=Wh({},this.options.center):this.options.start?l=Wh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=59;break;case 23:c=Math.abs(Math.cos(Math.PI/180*this.options.positions.lat))*(1e-4*this.options.scale),u=[[this.options.positions.lng-1e-4*this.options.scale,this.options.positions.lat-c],[this.options.positions.lng+1e-4*this.options.scale,this.options.positions.lat+c]],p=[],h=0,d=this.options.positions,m=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,0),f=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,1e7),v=Cesium.Cartesian3.subtract(f,m,new Cesium.Cartesian3),g=Cesium.Cartesian3.normalize(v,v),y=new Cesium.Ray(m,g),b={},C=this.sdk.viewer.scene.drillPickFromRay(y),w=0;case 36:if(!(w<C.length)){t.next=43;break}if(!C[w].position){t.next=40;break}return b=C[w],t.abrupt("break",43);case 40:w++,t.next=36;break;case 43:if(!b||!b.position){t.next=47;break}h=this.cartesian3Towgs84(b.position,this.sdk.viewer).alt,t.next=56;break;case 47:return t.prev=47,t.next=50,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 50:k=t.sent,h=k[0].height,t.next=56;break;case 54:t.prev=54,t.t0=t.catch(47);case 56:for(_=0;_<u.length;_++)E=(x=Cesium.Cartesian3).fromDegrees.apply(x,L()(u[_]).concat([h])),p.push(E.x,E.y,E.z);S=Cesium.BoundingSphere.fromVertices(p),this.sdk.viewer.camera.flyToBoundingSphere(S,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 59:case"end":return t.stop()}}),t,this,[[47,54]])}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,be(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.positions.lng=t.position.lng,this.options.positions.lat=t.position.lat,this.options.positions.alt=t.position.alt}}]);var i,n,s,r}(Mn),qh=i(20),Xh=i.n(qh);function Zh(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col x-scale">\n <span class="label">X 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col y-scale">\n <span class="label">Y 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 5;">\n <span class="label">文字内容</span>\n <input class="input" type="text" @model="textValue">\n </div>\n <div class="col">\n <button class="btn" @click="textPosPick">设置位置</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="textShow">\n </div>\n <div class="col">\n <span class="label">字体颜色</span>\n <div class="textColor"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="textFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="textScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item attribute-info">\n <div class="row">\n '.concat(xn(t),"\n </div>\n </div>\n ")}var Kh=i(21),$h=i.n(Kh),Qh=i(12),td=i.n(Qh);function ed(t,e,i,n){var o=Us()(Yi()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function id(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()} +i.translation=Cesium.Cartesian3.fromElements(0,0,1),i.rotation=Cesium.Quaternion.fromHeadingPitchRoll(e);var n=Cesium.Matrix4.fromTranslationRotationScale(i);this.particleSystem.emitterModelMatrix=n,this._elms.pitch&&this._elms.pitch.forEach((function(e){e.value=Number(t)}))}},{key:"edit",value:(n=o()(a.a.mark((function t(){var i,n,o,s,r,l=this,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=c.length>0&&void 0!==c[0]&&c[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=20;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"喷射水柱属性",left:"180px",top:"100px",confirmCallBack:function(t){l.name=l.name.trim(),l.name||(l.name="未命名对象"),l.originalOptions=l.deepCopyObj(l.options),l._DialogObject.close(),l.Dialog.confirmCallBack&&l.Dialog.confirmCallBack(l.originalOptions),Pe(l.sdk,l.options.id),se(l.sdk,l.options.id)},resetCallBack:function(){l.reset(),l.Dialog.resetCallBack&&l.Dialog.resetCallBack()},removeCallBack:function(){l.Dialog.removeCallBack&&l.Dialog.removeCallBack()},closeCallBack:function(){l.reset(),l.positionEditing=!1,l.Dialog.closeCallBack&&l.Dialog.closeCallBack()},showCallBack:function(t){l.show=t,l.Dialog.showCallBack&&l.Dialog.showCallBack()},translationalCallBack:function(){l.positionEditing=!l.positionEditing}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" particle-effects",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input style="width: 175px;" class="input" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">起始颜色</span>\n <div class="start_color"></div>\n </div>\n <div class="col" style="margin: 0;justify-content: flex-end;">\n <span class="label">结束颜色</span>\n <div class="end_color"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="row">\n <span>速度</span>\n <input type="range" max="30" min="0" step="0.1" @model="speed">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>发射速率(个/秒)</span>\n <input type="range" max="100" min="0" step="1" @model="emissionRate">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>最小存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="minimumParticleLife">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>最大存在时间</span>\n <input type="range" max="100" min="0.01" step="0.1" @model="maximumParticleLife">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>起始比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="startScale">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>结束比例</span>\n <input type="range" max="10" min="0" step="0.1" @model="endScale">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>朝向</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="heading">\n </div>\n </div>\n <div class="col">\n <div class="row">\n <span>俯仰角度</span>\n <input type="range" max="360" min="0.1" step="0.1" @model="pitch">\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <div class="row">\n <span>尺寸(像素)</span>\n <input type="range" max="100" min="0" step="1" @model="particleSize">\n </div>\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),o=new YJColorPicker({el:n.getElementsByClassName("start_color")[0],size:"mini",alpha:!0,defaultColor:this.startColor,disabled:!1,openPickerAni:"opacity",sure:function(t){l.startColor=t},clear:function(){l.startColor="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("end_color")[0],size:"mini",alpha:!0,defaultColor:this.endColor,disabled:!1,openPickerAni:"opacity",sure:function(t){l.endColor=t},clear:function(){l.endColor="rgba(255,255,255,1)"}}),r=n.getElementsByTagName("*"),e.EventBinding(this,r),this._elms.startColor=[o],this._elms.endColor=[s],t.next=20;break;case 20:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.startColor=this.originalOptions.startColor,this.endColor=this.originalOptions.endColor,this.speed=this.originalOptions.speed,this.minimumParticleLife=this.originalOptions.minimumParticleLife,this.maximumParticleLife=this.originalOptions.maximumParticleLife,this.startScale=this.originalOptions.startScale,this.endScale=this.originalOptions.endScale,this.emissionRate=this.originalOptions.emissionRate,this.particleSize=this.originalOptions.particleSize,this.lng=this.originalOptions.start.lng,this.lat=this.originalOptions.start.lat,this.alt=this.originalOptions.start.alt)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Yu(e,"remove",this,3)([]),this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){var i;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.picking=!1,this.previous={positions:Uu({},this.entity.position)},this.event.mouse_move((function(t,n){i=t.endPosition;var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt;var s=Cesium.Cartographic.fromDegrees(e.options.start.lng,e.options.start.lat,e.options.start.alt),a=e.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(s);e.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(a),e._elms.lng&&e._elms.lng.forEach((function(t){t.value=e.options.start.lng})),e._elms.lat&&e._elms.lat.forEach((function(t){t.value=e.options.start.lat})),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.start.alt})),e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,n){if(!i||i.x!==t.position.x||i.y!==t.position.y-2){var o=e.cartesian3Towgs84(n,e.sdk.viewer);e.options.start.lng=o.lng,e.options.start.lat=o.lat,e.options.start.alt=o.alt}e.entity.position={lng:e.options.start.lng,lat:e.options.start.lat,alt:e.options.start.alt},e.previous={positions:Uu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.start.lng=e.entity.position.lng,e.options.start.lat=e.entity.position.lat,e.options.start.alt=e.entity.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.lng=e.entity.position.lng,e.options.lat=e.entity.position.lat,e.options.alt=e.entity.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.lng=t.lng,e.options.lat=t.lat,e.options.alt=t.alt,e.entity.position={lng:e.options.lng,lat:e.options.lat,alt:e.options.alt},e.previous={positions:Uu({},e.entity.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))}else{if(this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),!this.sdk||!this.sdk.viewer||!this.entity)return;this.options.start.lng=this.entity.position.lng,this.options.start.lat=this.entity.position.lat,this.options.start.alt=this.entity.position.alt;var n=Cesium.Cartographic.fromDegrees(this.options.start.lng,this.options.start.lat,this.options.start.alt),o=this.sdk.viewer.scene.globe.ellipsoid.cartographicToCartesian(n);this.entity.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(o),this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.start.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.start.lat})),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.start.alt}))}}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Hu(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Wn);function qu(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">多面体颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <span class="label">多面体高度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="9999999" data-null data-min="0.01" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n \x3c!-- <div class="col">\n <span class="label">拉伸高度</span>\n <input class="input" type="number" title="" min="0" max="9999999" @model="extrudedHeight">\n </div> --\x3e\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polygon-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Xu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Zu(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Zu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Zu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Ku=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!e[o]||!e[o].attributes)return 1;var l,c=Xu(e[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[c.value]=e.target.checked})),e[o].checked=t[c.value]):(n.push((function(e){var i=e.target.value;if("number"==e.target.type){var n=e.target.value+"";if("."!=e.data&&("-"!=e.data||e.target.value)&&("0"!=n.charAt(n.length-1)||!e.target.value.toString().includes("."))&&"0"!=e.target.value){if(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),"undefined"!==e.target.dataset.min&&""!==e.target.dataset.min){var o=Number(e.target.dataset.min);i<o&&(i=o)}t[c.value]=i}}else t[c.value]=i})),r=function(e){var i=e.target.value;"number"==e.target.type&&(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[c.value]=i},"IMG"==e[o].nodeName?e[o].src=t[c.value]:e[o].value=t[c.value]),i.element[c.value]?i.element[c.value].push(e[o]):i.element[c.value]=[e[o]],a.push(c.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[c.value]&&t[c.value](e)})),a.push(c.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[c.value]&&t[c.value](e,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}for(var p=0;p<a.length;p++)e[o].attributes.removeNamedItem(a[p]);if(s){var h="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(h="change"),e[o].addEventListener(h,(function(t){for(var e=0;e<n.length;e++)n[e](t)})),e[o].addEventListener("blur",r)}},o=0;o<e.length;o++)n()}}])}();C()(Ku,"event",{});var $u=new Ku;function Qu(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return tp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function tp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ep(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var ip=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=ep(this,e,[t,n])).options.color=n.color||"#ff0000",i.options.show=!n.show&&!1!==n.show||n.show,i.options.height=n.height||0===n.height?n.height:10,i.options.height<=.01&&(i.options.height=.01),i.options.extrudedHeight=n.extrudedHeight||0===n.extrudedHeight?n.extrudedHeight:0,i.entity,i.nodePoints=[],i.operate={},i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i._elms={},i.Dialog=o,!i.options.positions||i.options.positions.length<3?(i._error="多面体最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),e.create(i)),i}return sn()(e,t),_()(e,[{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,this.previous={positions:L()(this.positions)},!0===t){var n;this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)"));var o=Cesium.Color.fromCssColorString(this.options.color).withAlpha(.99);2===this.sdk.viewer.scene.mode&&(o=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=o,this.picking=!1;for(var s=[],a=this.positions,r=[],l=0;l<a.length;l++){var c=this.cartesian3Towgs84(a[l],this.sdk.viewer);s.push([c.lng,c.lat])}var u=this.cartesian3Towgs84(a[0],this.sdk.viewer);s.push([u.lng,u.lat]);for(var p=turf.polygon([s]),h=turf.centroid(p),d=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(h.geometry.coordinates)),m=0;m<a.length;m++)d.x,a[m].x,r.push({x:d.x-a[m].x,y:d.y-a[m].y,z:d.z-a[m].z});var f=[];this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[];for(var s=0;s<r.length;s++)f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});e.label.position=[n.lng,n.lat,e.options.height+e.options.extrudedHeight],e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.event.destroy();var n=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(n.lng,n.lat);f=[],e.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=e.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},e.sdk.viewer);a.alt=a.alt-e.options.height,e.options.positions.push(a)}e.positions=f,e.previous.positions=f,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.event.destroy();var t=e.cartesian3Towgs84(i,e.sdk.viewer),o=Cesium.Cartesian3.fromDegrees(t.lng,t.lat);f=[],e.options.positions=[];for(var s=0;s<r.length;s++){f.push({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z});var a=e.cartesian3Towgs84({x:o.x-r[s].x,y:o.y-r[s].y,z:o.z-r[s].z},e.sdk.viewer);a.alt=a.alt-e.options.height,e.options.positions.push(a)}e.positions=f,e.previous.positions=f,e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return f.length>0?new Cesium.PolygonHierarchy(f):new Cesium.PolygonHierarchy(a)}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)"));var v=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(v=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=v,this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();for(var g=[[]],y=0;y<this.previous.positions.length;y++){var b=this.cartesian3Towgs84(this.previous.positions[y],this.sdk.viewer);g[0].push([b.lng,b.lat])}var C=this.cartesian3Towgs84(this.previous.positions[0],this.sdk.viewer);g[0].push([C.lng,C.lat]);var w=turf.polygon(g),k=turf.centroid(w);this.label.position=[k.geometry.coordinates[0],k.geometry.coordinates[1],this.options.height+this.options.extrudedHeight],this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.previous.positions)}),!0)}}}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"#ff0000",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t,this.options.height<=.01&&(this.options.height=.01);for(var e=[[]],i=0;i<this.options.positions.length;i++)e[0].push([this.options.positions[i].lng,this.options.positions[i].lat,this.options.height+this.options.extrudedHeight]);e[0].push([this.options.positions[0].lng,this.options.positions[0].lat,this.options.height+this.options.extrudedHeight]);var n,o=turf.polygon(e),s=turf.centroid(o);this.label.position=[s.geometry.coordinates[0],s.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],n=this.entity.polygon.hierarchy._value?this.entity.polygon.hierarchy._value.positions:this.entity.polygon.hierarchy._callback().positions;var a=[];this.entity.polygon.perPositionHeight=!0;for(var r=0;r<n.length;r++){var l=Cesium.Cartographic.fromCartesian(n[r]),c=Cesium.Math.toDegrees(l.longitude),u=Cesium.Math.toDegrees(l.latitude),p=new Cesium.Cartesian3.fromDegrees(c,u,this.options.extrudedHeight+t);a.push(p)}this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(a),this.positions=a,this.previous={positions:L()(this.positions)},this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t;for(var e=[[]],i=0;i<this.options.positions.length;i++)e[0].push([this.options.positions[i].lng,this.options.positions[i].lat]);e[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var n=turf.polygon(e),o=turf.centroid(n);this.label.position=[o.geometry.coordinates[0],o.geometry.coordinates[1],this.options.extrudedHeight+this.options.height],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Qu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Qu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Qu(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Qu(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return t.next=8,new rn(this.sdk,this.options,{title:"多面体属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.options.label.position={lng:p.label.position[0],lat:p.label.position[1],alt:p.label.position[2]},p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close(),p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(p.originalOptions),Pe(p.sdk,p.options.id),se(p.sdk,p.options.id)},resetCallBack:function(){p.reset(),p.Dialog.resetCallBack&&p.Dialog.resetCallBack()},removeCallBack:function(){p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p.reset(),p.Dialog.closeCallBack&&p.Dialog.closeCallBack();for(var t=0;t<p.nodePoints.length;t++)p.sdk.viewer.entities.remove(p.nodePoints[t]);p.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),p.positionEditing=!1},showCallBack:function(t){p.options.show=t,p.originalOptions.show=t,p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()},translationalCallBack:function(){p.positionEditing=!p.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(p)}});case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyhedron",(n=document.createElement("div")).innerHTML=qu(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("polygon-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){p.color=t},clear:function(){p.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelLineColor=t},clear:function(){p.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorStart=t},clear:function(){p.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelBackgroundColorEnd=t},clear:function(){p.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=n.getElementsByTagName("*"),$u.on(this,u),this._elms=$u.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],setTimeout((function(){p.attributeLink=p.options.attribute.link.content,p.attributeVr=p.options.attribute.vr.content,p.cameraSelect&&p.cameraSelect(),p.goodsSelect&&p.goodsSelect();var t=p.attributeSelect,e=p._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=p._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===p.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){p.attributeType=t[e].key;break}}))}var s=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],a=Y(p._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(a){a.legp_search(s);var r=p._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];r.value=p.options["area-unit"];for(var l=0;l<s.length;l++)if(s[l].value===r.value){a.legp_searchActive(s[l].value);break}r.addEventListener("input",(function(){for(var t=0;t<s.length;t++)if(s[t].value===r.value){p.areaUnit=s[t].value;break}}))}var c=qn(),u=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(u){u.legp_search(c);var h=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=c[p.labelFontFamily].value;for(var d=0;d<c.length;d++)if(c[d].value==h.value){u.legp_searchActive(c[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<c.length;t++)if(c[t].value===h.value){p.labelFontFamily=c[t].key;break}})),p._elms.labelFontFamily=[h]}}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:if(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.height=this.originalOptions.height,this.extrudedHeight=this.originalOptions.extrudedHeight,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),e=this.options.positions,i=[],this.options.height||0===this.options.height){for(n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,this.options.height+this.options.extrudedHeight);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i)}else{for(o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(i)}for(this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),s=[[]],r=0;r<this.options.positions.length;r++)s[0].push([this.options.positions[r].lng,this.options.positions[r].lat]);return s[0].push([this.options.positions[0].lng,this.options.positions[0].lat]),l=turf.polygon(s),c=turf.pointOnFeature(l),t.next=38,this.getClampToHeight({lng:c.geometry.coordinates[0],lat:c.geometry.coordinates[1]});case 38:t.sent,this.label.position=[c.geometry.coordinates[0],c.geometry.coordinates[1],this.extrudedHeight+this.height];case 40:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;for(var i=[[]],n=0;n<this.options.positions.length;n++)i[0].push([this.options.positions[n].lng,this.options.positions[n].lat]);i[0].push([this.options.positions[0].lng,this.options.positions[0].lat]);var o=turf.polygon(i),s=turf.pointOnFeature(o),a=document.getElementById(e.domid);this.sdk.viewer.scene.postRender.addEventListener((function(i){var n=Cesium.Cartesian3.fromDegrees(s.geometry.coordinates[0],s.geometry.coordinates[1],t.options.extrudedHeight+t.options.height);if("block"===a.style.display||""===a.style.display){var o=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);o&&(a.style.left=(o.x+e.x).toFixed(0)+"px",a.style.top=(o.y+e.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=[[]],n=0;n<e.options.positions.length;n++)i[0].push([e.options.positions[n].lng,e.options.positions[n].lat]);i[0].push([e.options.positions[0].lng,e.options.positions[0].lat]),o=turf.polygon(i),s=turf.pointOnFeature(o),e.options.label.position||(e.options.label.position={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1],alt:e.options.extrudedHeight+e.options.height}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,ground:!1,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 7:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=i[0].alt,s=0;s<i.length;s++)o>i[s].alt&&(o=i[s].alt);t.options.extrudedHeight=o;for(var a=0;a<i.length;a++)n.push(i[a].lng,i[a].lat,t.options.height+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(n);var r=Cesium.Color.fromCssColorString(t.options.color);switch(2===t.sdk.viewer.scene.mode&&(r=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),extrudedHeight:t.options.extrudedHeight,perPositionHeight:!0,material:r}}),e.createLabel(t),t.options.areaByMeter=t.computeArea(i),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var o=!1,s=function(e,s){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(s,t.sdk.viewer),n=t.options.positions[i.index],o=!0;var a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,a),t.options.positions.splice(i.index,0,t.options.positions[i.index]),t.options.areaByMeter=t.computeArea(t.options.positions);for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}switch(t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}}else{var p=t.sdk.viewer.scene.pick(e.position);p&&p.id&&p.id.name&&"node-secondary-edit-point"===p.id.name&&(i=p.id,t.nodePoints.splice(p.id.index,1),t.sdk.viewer.entities.remove(p.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer))}},a=function(s,a){if(i){switch(t.options.positions[i.index]=n,o&&t.options.positions.splice(i.index,1),t.options.areaByMeter=t.computeArea(t.options.positions),t.options["area-unit"]){case"平方米":t.area=t.options.areaByMeter;break;case"平方千米":t.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.area=t.options.areaByMeter}for(var r=t.options.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(l),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions),e(null,t.options.positions)}for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy()};t.event.mouse_left(s),t.event.mouse_right(a),t.event.mouse_move((function(e,n){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer);for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,t.options.height+t.options.extrudedHeight);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(t.positions);for(var r=[[]],l=0;l<t.options.positions.length;l++)r[0].push([t.options.positions[l].lng,t.options.positions[l].lat]);if(r[0].push([t.options.positions[0].lng,t.options.positions[0].lat]),r[0].length>=4){var c=turf.polygon(r),u=turf.centroid(c);t.label.position=[u.geometry.coordinates[0],u.geometry.coordinates[1],t.options.height+t.options.extrudedHeight]}}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?a(o,i):s(o,i)}))})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())}));for(var r=0;r<t.options.positions.length;r++){var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:r,position:Cesium.Cartesian3.fromDegrees(t.options.positions[r].lng,t.options.positions[r].lat,t.options.extrudedHeight),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(l)}}}}]);var i,n,s,r}(Wn);C()(ip,"elms",{});var np=ip;function op(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function sp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ap(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):sp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function rp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return lp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?lp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function lp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function cp(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var up=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=cp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.nodePoints=[],!i.options.positions||i.options.positions.length<3)i._error="集结地最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"AssembleObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.previous=null,i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=rp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=rp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=rp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=rp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new rn(this.sdk,this.options,{title:"集结地属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),Pe(w.sdk,w.options.id),se(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=op(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=qn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=0;t<this.options.positions.length;t++)this._elms.lng&&this._elms.lng[t]&&(this._elms.lng[t].innerHTML=this.options.positions[t].lng.toFixed(8)),this._elms.lat&&this._elms.lat[t]&&(this._elms.lat[t].innerHTML=this.options.positions[t].lat.toFixed(8)),this._elms.alt&&this._elms.alt[t]&&(this._elms.alt[t].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=ap({},this.options.position):this.options.positions?l=ap({},this.options.positions[0]):this.options.center?l=ap({},this.options.center):this.options.start?l=ap({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){e.cartesian3Towgs84(i,e.sdk.viewer);m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous=null,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAssemble(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeAssemble(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeAssemble(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit,o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeAssemble(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineWidth:e.options.label.lineWidth,lineColor:e.options.label.lineColor,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=rp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=0;l<t.options.positions.length;l++)r.push(t.options.positions[l].lng,t.options.positions[l].lat);var c=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},u=function(e,o){c(e,o);var s=t.cartesian3Towgs84(o,t.sdk.viewer);if(i){var a=i.index,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,s.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,r),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=e.position;l||(l={x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2});var u=t.sdk.viewer.scene.pick(l);u&&u.id&&u.id.name&&"node-secondary-edit-point"===u.id.name&&(i=u.id,n=t.cartesian3Towgs84(u.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(u.id.index,1),t.sdk.viewer.entities.remove(u.id),t.tip.set_text("左键确认,右键取消"))}t.renewPositions()},p=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?t.options.positions[i.index]=n:t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeAssemble(t.options.positions);return e.length>=3?[].concat(L()(e),[e[0],e[1]]):L()(e)}),!1);for(var h=[[]],d=[],m=0;m<t.positionsH.length;m++){var f=t.cartesian3Towgs84(t.positionsH[m],t.sdk.viewer);d.push(f),h[0].push([f.lng,f.lat])}var v=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);h[0].push([v.lng,v.lat]);var g=turf.polygon(h),y=turf.pointOnFeature(g),b=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:y.geometry.coordinates[0],lat:y.geometry.coordinates[1]},b).then((function(e){t.label.position=[y.geometry.coordinates[0],y.geometry.coordinates[1],e]})),setTimeout((function(){t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p():u(o,i)}))})),s()}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Wn);function pp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="attack-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function hp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function dp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?hp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):hp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function mp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return fp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?fp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function fp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function vp(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var gp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=vp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.nodePoints=[],i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontFamily:n.label.fontFamily?n.label.fontFamily:0,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<3)i._error="箭头面最少需要三个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"AttackArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.previous=null,i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&this._DialogObject.close(),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new rn(this.sdk,this.options,{title:"箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" attackArrow",(s=document.createElement("div")).innerHTML=pp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("attack-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=qn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,Pe(t.sdk,t.options.id),se(t.sdk,t.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,Pe(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=dp({},this.options.position):this.options.positions?l=dp({},this.options.positions[0]):this.options.center?l=dp({},this.options.center):this.options.start?l=dp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(i.cartesian3Towgs84(this.positions[v],i.sdk.viewer));i.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeAttackArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeAttackArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();i.computeAttackArrow(i.options.positions);this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=ae(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[[(i.options.positions[0].lng+i.options.positions[1].lng)/2,(i.options.positions[0].lat+i.options.positions[1].lat)/2]],p=2;p<i.options.positions.length;p++)u.push([i.options.positions[p].lng,i.options.positions[p].lat]);for(var h=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(h,{units:"kilometers"}),C=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:w(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(t){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function t(e){var n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){t.next=12;break}if(!(e.distance>=d[o])){t.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),t.abrupt("break",12);case 9:o--,t.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=dp({},i.options.positions[r]);if(e.distance){t.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},t.next=25;break;case 18:return t.next=20,turf.lineSliceAlong(h,0,e.distance,{units:"kilometers"});case 20:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[n]||(s[n]={}),s[n].lng=c[0],s[n].lat=c[1];case 25:i.renewPositions(s);case 26:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeAttackArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeAttackArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d}),t.options.label.ground=u;for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=mp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),-1!==e[n].className.indexOf("blur")&&(u="blur"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var r=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},l=function(e,o){if(r(e,o),i){t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var s=i.index;i.index===t.options.positions.length-1&&(s+=1);var a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:s,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});i=a,n=t.options.positions[i.index],t.nodePoints.splice(i.index,0,a),s<t.options.positions.length?(i=null,t.tip.set_text("请选择一个顶点,右键取消")):(t.options.positions.splice(i.index,0,t.options.positions[i.index]),t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer)),t.renewPositions()}else{var l=t.sdk.viewer.scene.pick(e.position||e.endPosition);l&&l.id&&l.id.name&&"node-secondary-edit-point"===l.id.name&&(i=l.id,n=t.cartesian3Towgs84(l.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(l.id.index,1),t.sdk.viewer.entities.remove(l.id),t.tip.set_text("左键确认,右键结束,CTRL+右键撤销"))}},c=function(e,o){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?(t.options.positions[i.index]=n,t.options.positions.length>3&&i.index===t.options.positions.length-1&&t.options.positions.splice(i.index+1,1)):t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(t.positionsH)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]])}),!1);for(var u=[[]],p=[],h=0;h<t.positionsH.length;h++){var d=t.cartesian3Towgs84(t.positionsH[h],t.sdk.viewer);p.push(d),u[0].push([d.lng,d.lat])}var m=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);u[0].push([m.lng,m.lat]);var f=turf.polygon(u),v=turf.pointOnFeature(f),g=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:v.geometry.coordinates[0],lat:v.geometry.coordinates[1]},g).then((function(e){t.label.position=[v.geometry.coordinates[0],v.geometry.coordinates[1],e]})),setTimeout((function(){t.event.mouse_left(l),t.event.mouse_right(c),t.event.mouse_move(r),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),t.nodePoints.pop(),i.index&&i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=i.index-1),t.renewPositions())})),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?c():l(o,i)}))})),s()}),200)}}),0)}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Wn);function yp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="pincer-arrow-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function bp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Cp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?bp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):bp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function wp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return kp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?kp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function kp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function _p(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Ep=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=_p(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.positions=n.positions||[],i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.options.height=n.height,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i._elms={},i.nodePoints=[],i.spreadTime=n.spreadTime,i.entity,i.event,i.operate={},i.Dialog=o,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",!i.options.positions||i.options.positions.length<5)i._error="双箭头最少需要五个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"PincerArrowObject"}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this.label.text=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=wp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=wp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=wp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=wp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new rn(this.sdk,this.options,{title:"双箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" pincerArrow",(s=document.createElement("div")).innerHTML=yp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("pincer-arrow-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=qn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,Pe(t.sdk,t.options.id),se(t.sdk,t.options.id)}),200),setTimeout((function(){t.previous=null}),50)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.entity&&this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,Pe(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Cp({},this.options.position):this.options.positions?l=Cp({},this.options.positions[0]):this.options.center?l=Cp({},this.options.center):this.options.start?l=Cp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){var n;this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var o=[],s=L()(this.positions),a=[],r=0;r<s.length;r++){var l=this.cartesian3Towgs84(s[r],this.sdk.viewer);o.push([l.lng,l.lat])}var c=this.cartesian3Towgs84(s[0],this.sdk.viewer);o.push([c.lng,c.lat]);for(var u=turf.polygon([o]),p=turf.centroid(u),h=(n=Cesium.Cartesian3).fromDegrees.apply(n,L()(p.geometry.coordinates)),d=0;d<s.length;d++)h.x,s[d].x,a.push({x:h.x-s[d].x,y:h.y-s[d].y,z:h.z-s[d].z});var m=[];this.event.mouse_move((function(t,i){m=[];for(var n=0;n<a.length;n++)m.push({x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var n=0;n<a.length;n++){var o={x:i.x-a[n].x,y:i.y-a[n].y,z:i.z-a[n].z};m.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),m=[];for(var t=0;t<a.length;t++){var o={x:i.x-a[t].x,y:i.y-a[t].y,z:i.z-a[t].z};m.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=m,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(m.length>0)for(var e=0;e<m.length;e++)t.push(i.cartesian3Towgs84(m[e],i.sdk.viewer));else for(var n=0;n<s.length;n++)t.push(i.cartesian3Towgs84(s[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var f=[],v=0;v<this.positions.length;v++)f.push(this.cartesian3Towgs84(this.positions[v],this.sdk.viewer));this.renewPositions(f),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computePincerArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computePincerArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance1/this.TweenAnimate._valuesEnd.distance1*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var s=this.computePincerArrow(this.options.positions);if(0!=s.length){this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var r,l=ae(),c=l.sdkP,u=l.sdkD;if(u&&c&&this.sdk===u)(r=c.entityMap.get(this.options.id))&&r.entity&&r.entity.polygon&&r.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(r.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(r.positionsH),[r.positionsH[0],r.positionsH[1]])}),!1));else{for(var p=[],h=[],d=[],m=[],f=0;f<=2;f++)m.push([this.options.positions[f].lng,this.options.positions[f].lat]);m.push([this.options.positions[0].lng,this.options.positions[0].lat]);for(var v=turf.lineString(m),g=turf.booleanClockwise(v),y=0;y<=100;y++){var b=this.cartesian3Towgs84(s[y],this.sdk.viewer);p.push([b.lng,b.lat,b.alt])}g?p.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]):p.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]);for(var C=312;C>=212;C--){var w=this.cartesian3Towgs84(s[C],this.sdk.viewer);h.push([w.lng,w.lat,w.alt])}g?h.push([this.options.positions[2].lng,this.options.positions[2].lat,this.options.positions[2].alt]):h.push([this.options.positions[3].lng,this.options.positions[3].lat,this.options.positions[3].alt]),d.push([(this.options.positions[0].lng+this.options.positions[1].lng)/2,(this.options.positions[0].lat+this.options.positions[1].lat)/2],[this.options.positions[4].lng,this.options.positions[4].lat]);var k=this.deepCopyObj(this.options.positions),x=turf.lineString(p),_=turf.length(x,{units:"kilometers"}),E=turf.lineString(h),S=turf.length(E,{units:"kilometers"}),D=turf.lineString(d),P=turf.length(D,{units:"kilometers"}),M=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance1:_*M,distance2:S*M,distance3:P*M}).to({distance1:_,distance2:S,distance3:P},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:O(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():O({distance1:_*M,distance2:S*M,distance3:P*M}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}}function O(t){return T.apply(this,arguments)}function T(){return(T=o()(a.a.mark((function t(e){var n,o,s,r,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:if(n=2,o=3,g&&(n=3,o=2),e.distance1){t.next=10;break}k[n].lng=k[1].lng,k[n].lat=k[1].lat,t.next=16;break;case 10:return t.next=12,turf.lineSliceAlong(x,0,e.distance1,{units:"kilometers"});case 12:s=t.sent,r=L()(s.geometry.coordinates[s.geometry.coordinates.length-1]),k[n].lng=r[0],k[n].lat=r[1];case 16:if(e.distance2){t.next=21;break}k[o].lng=k[0].lng,k[3].lat=k[0].lat,t.next=27;break;case 21:return t.next=23,turf.lineSliceAlong(E,0,e.distance2,{units:"kilometers"});case 23:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),k[o].lng=c[0],k[o].lat=c[1];case 27:if(e.distance3){t.next=32;break}k[4].lng=d[0][0],k[4].lat=d[0][1],t.next=38;break;case 32:return t.next=34,turf.lineSliceAlong(D,0,e.distance3,{units:"kilometers"});case 34:u=t.sent,p=L()(u.geometry.coordinates[u.geometry.coordinates.length-1]),k[4].lng=p[0],k[4].lat=p[1];case 38:i.renewPositions(k);case 39:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computePincerArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computePincerArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=wp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),-1!==e[n].className.indexOf("blur")&&(u="blur"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};t.positionEditing=!1,setTimeout((function(){if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<r.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(r[n].lng,r[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var r=L()(t.options.positions),l=function(e,o){if(i){t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer),r[i.index]=t.options.positions[i.index];var s=i.index,a=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:s,position:Cesium.Cartesian3.fromDegrees(r[i.index].lng,r[i.index].lat,r[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,a),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=t.sdk.viewer.scene.pick(e.position);l&&l.id&&l.id.name&&"node-secondary-edit-point"===l.id.name&&(i=l.id,n=t.cartesian3Towgs84(l.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(l.id.index,1),t.sdk.viewer.entities.remove(l.id),t.tip.set_text("左键确定,右键取消"))}t.renewPositions(),t.tip.setPosition(o,e.position.x,e.position.y)},c=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(r[i.index]=n,t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),e(null,r)),t.options.positions=L()(r),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(t.positionsH)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]])}),!1),setTimeout((function(){t.event.mouse_left(l),t.event.mouse_right(c),t.event.mouse_move((function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t.renewPositions()),t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?c():l(o,i)}))}));for(var e=[[]],n=[],o=0;o<t.positionsH.length;o++){var a=t.cartesian3Towgs84(t.positionsH[o],t.sdk.viewer);n.push(a),e[0].push([a.lng,a.lat])}var r=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);e[0].push([r.lng,r.lat]);var u=turf.polygon(e),p=turf.pointOnFeature(u),h=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:p.geometry.coordinates[0],lat:p.geometry.coordinates[1]},h).then((function(e){t.label.position=[p.geometry.coordinates[0],p.geometry.coordinates[1],e]})),s()}),200)}}),0)}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Wn);function Sp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">动画时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input blur" type="number" title="" min="500" max="9999999" @model="spreadTime">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col">\n <span class="label">动画</span>\n <input class="btn-switch" type="checkbox" @model="spreadState">\n </div>\n <div class="col">\n <span class="label">动画重复</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="assemble-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Dp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Dp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Dp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Mp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Op(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Op(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Op(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Tp(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Np=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Tp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.positions=n.positions||[],i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",i.entity,i.event=new X(i.sdk),i.operate={},i._elms={},i.Dialog=o,i.options.loop=n.loop||!1,i.options.spreadState=n.spreadState||!1,i.spreadTime=n.spreadTime,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.nodePoints=[],!i.options.positions||i.options.positions.length<2)i._error="直线箭头需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{if(!i.options.height&&0!==i.options.height){for(var s=i.options.positions[0].alt,a=1;a<i.options.positions.length;a++)s<i.options.positions[a].alt&&(s=i.options.positions[a].alt);i.options.height=s}i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"StraightArrowObject"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.height},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.height=0:this.options.height=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positionsH),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.height}))}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t,this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(t),this._elms.lineColor&&this._elms.lineColor.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,255,255,1)"}});e._elms.lineColor[n]=o})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t,this.entity.polyline.width=t,this._elms.lineColor&&this._elms.lineColor.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter||0==this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=61;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];for(var i=function(i){var o=document.createElement("div");o.className="tr",o.innerHTML='\n <div class="td">'.concat(i+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var s=o.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.positions[i].lng.toFixed(8),s.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.positions[i].lng.toFixed(8);var l=o.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.positions[i].lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.positions[i].lat.toFixed(8);var p=o.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),s.addEventListener("dblclick",(function(){s.innerHTML="",r.value=Number(n.options.positions[i].lng.toFixed(8)),s.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.positions[i].lng.toFixed(8)),s.innerHTML="",s.appendChild(a)})),r.addEventListener("input",(function(){n.options.positions[i].lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.positions[i].lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.positions[i].lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.positions[i].lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.positions[i].lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.positions[i].lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(o)},o=0;o<n.options.positions.length;o++)i(o)},t.next=9,new rn(this.sdk,this.options,{title:"直线箭头属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){var t=w.options.spreadState;w.positionEditing=!1,setTimeout((function(){w.options.spreadState=t,w.reset()}),10),w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 9:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" assemble",(s=document.createElement("div")).innerHTML=Sp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("assemble-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=58;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 42:if(!(C<g.length)){t.next=50;break}if(g[C].key!=this.heightMode){t.next=47;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",50);case 47:C++,t.next=42;break;case 50:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 58:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}o();var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=qn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}}),0),t.next=62;break;case 61:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 62:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineColor=this.originalOptions.line.color,this.lineWidth=this.originalOptions.line.width,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeVr=this.options.attribute.vr.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=0;e<this.options.positions.length;e++)this._elms.lng&&this._elms.lng[e]&&(this._elms.lng[e].innerHTML=this.options.positions[e].lng.toFixed(8)),this._elms.lat&&this._elms.lat[e]&&(this._elms.lat[e].innerHTML=this.options.positions[e].lat.toFixed(8)),this._elms.alt&&this._elms.alt[e]&&(this._elms.alt[e].innerHTML=Number(this.options.height.toFixed(2)));this.heightMode=this.heightMode;for(var i=0;i<this.nodePoints.length;i++)this.sdk.viewer.entities.remove(this.nodePoints[i]);this.previous=null,this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy();var n=this.options.spreadState;this.removeAnimate(),setTimeout((function(){t.loop=t.options.loop,t.spreadState=n,Pe(t.sdk,t.options.id),se(t.sdk,t.options.id)}),200)}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.removeAnimate(),this.sdk.viewer.entities.remove(this.entity),this.label&&this.label.remove(),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,this.sdk.removeIncetance(this.options.id);case 9:return t.next=11,Pe(this.sdk,this.options.id);case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0]&&this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=v.length>0&&void 0!==v[0]?v[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Pp({},this.options.position):this.options.positions?l=Pp({},this.options.positions[0]):this.options.center?l=Pp({},this.options.center):this.options.start?l=Pp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=51;break;case 25:c=[],t.t0=this.heightMode,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0?33:35;break;case 29:case 31:return u=!1,t.abrupt("break",35);case 33:return u=!0,t.abrupt("break",35);case 35:if(!u){t.next=48;break}p=0;case 37:if(!(p<this.options.positions.length)){t.next=46;break}return t.next=40,this.getClampToHeight(this.options.positions[p]);case 40:h=t.sent,d=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,h),c.push(d.x,d.y,d.z);case 43:p++,t.next=37;break;case 46:t.next=49;break;case 48:if(this.positionsH)for(m=0;m<this.positionsH.length;m++)c.push(this.positionsH[m].x,this.positionsH[m].y,this.positionsH[m].z);case 49:f=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(f,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 51:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){this.removeAnimate();var i=this;if(this.event&&this.event.destroy(),this.event=new X(this.sdk),this.operate.positionEditing=t,!0===t){this.previous={positions:L()(this.positions)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;for(var n=[],o=L()(this.positions),s=[],a=0;a<o.length;a++){var r=this.cartesian3Towgs84(o[a],this.sdk.viewer);n.push([r.lng,r.lat])}for(var l=Cesium.Cartesian3.fromDegrees((n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2),c=0;c<o.length;c++)l.x,o[c].x,s.push({x:l.x-o[c].x,y:l.y-o[c].y,z:l.z-o[c].z});var u=[];this.event.mouse_move((function(t,i){e.cartesian3Towgs84(i,e.sdk.viewer);u=[];for(var n=0;n<s.length;n++)u.push({x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z});e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),u=[];for(var n=0;n<s.length;n++){var o={x:i.x-s[n].x,y:i.y-s[n].y,z:i.z-s[n].z};u.push(o),e.options.positions[n]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[n]&&(e._elms.lng[n].innerHTML=e.options.positions[n].lng.toFixed(8)),e._elms.lat&&e._elms.lat[n]&&(e._elms.lat[n].innerHTML=e.options.positions[n].lat.toFixed(8))}e.positions=u,e.previous={positions:L()(e.positions)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),u=[];for(var t=0;t<s.length;t++){var o={x:i.x-s[t].x,y:i.y-s[t].y,z:i.z-s[t].z};u.push(o),e.options.positions[t]=e.cartesian3Towgs84(o,e.sdk.viewer),e._elms.lng&&e._elms.lng[t]&&(e._elms.lng[t].innerHTML=e.options.positions[t].lng.toFixed(8)),e._elms.lat&&e._elms.lat[t]&&(e._elms.lat[t].innerHTML=e.options.positions[t].lat.toFixed(8))}e.positions=u,e.previous={positions:L()(e.positions)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var t=[];if(u.length>0)for(var e=0;e<u.length;e++)t.push(i.cartesian3Towgs84(u[e],i.sdk.viewer));else for(var n=0;n<o.length;n++)t.push(i.cartesian3Towgs84(o[n],i.sdk.viewer));return i.renewPositions(t),new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}else{this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.previous?this.positions=L()(this.previous.positions):this.previous={positions:L()(this.positions)};for(var p=[],h=0;h<this.positions.length;h++)p.push(i.cartesian3Towgs84(this.positions[h],i.sdk.viewer));this.renewPositions(p),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!0)}}}},{key:"setPosition",value:function(t){for(var e,i=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n=L()(this.positions),o=[],s=[],a=0;a<n.length;a++){var r=this.cartesian3Towgs84(n[a],this.sdk.viewer);o.push([r.lng,r.lat])}var l=this.cartesian3Towgs84(n[0],this.sdk.viewer);o.push([l.lng,l.lat]);for(var c=turf.polygon([o]),u=turf.centroid(c),p=(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(u.geometry.coordinates)),h=0;h<n.length;h++)s.push({x:p.x-n[h].x,y:p.y-n[h].y,z:p.z-n[h].z});for(var d=[],m=0;m<s.length;m++)d.push({x:i.x-s[m].x,y:i.y-s[m].y,z:i.z-s[m].z});this.label.position=[t.position.lng,t.position.lat,t.position.alt];var f=[];if(d.length>0)for(var v=0;v<d.length;v++)f.push(this.cartesian3Towgs84(d[v],this.sdk.viewer));var g=this.computeStraightArrow(f);0!=g.length&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(g)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return g.length>=3?[].concat(L()(g),[g[0],g[1]]):L()(g)}),!1))}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=this.computeStraightArrow(this.options.positions);if(0!=i.length){for(var n=[[]],o=0;o<i.length;o++){var s=this.cartesian3Towgs84(i[o],this.sdk.viewer);n[0].push([s.lng,s.lat])}var a=this.cartesian3Towgs84(i[0],this.sdk.viewer);n[0].push([a.lng,a.lat]);var r=turf.polygon(n),l=turf.pointOnFeature(r),c=document.getElementById(e.domid),u=Cesium.Cartesian3.fromDegrees(l.geometry.coordinates[0],l.geometry.coordinates[1]);this.sdk.viewer.scene.postRender.addEventListener((function(i){if("block"===c.style.display||""===c.style.display){var n=t.sdk.viewer.scene.cartesianToCanvasCoordinates(u);n&&(c.style.left=(n.x+e.x).toFixed(0)+"px",c.style.top=(n.y+e.y).toFixed(0)+"px")}}))}}},{key:"spreadTime",get:function(){return this.options.spreadTime},set:function(t){var e=Number(t);isNaN(e)?e=3e3:e<500?e=500:e>9999999&&(e=9999999),this.options.spreadTime=e,this.spreadState&&this.setSpreadProgressByTime(),this._elms.spreadTime&&this._elms.spreadTime.forEach((function(t){t.value=e}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"spreadState",get:function(){return this.options.spreadState},set:function(t){this.options.spreadState=t,this.TweenAnimate?t?(this.lineEdit=!1,this.setSpreadProgressByTime(this.TweenAnimate._object.distance/this.TweenAnimate._valuesEnd.distance*this.spreadTime)):this.TweenAnimate.pause():t&&this.setSpreadProgressByTime(),this._elms.spreadState&&this._elms.spreadState.forEach((function(e){e.checked=t}))}},{key:"setSpreadProgressByTime",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.entity){for(var i=this,n=0;n<this.nodePoints.length;n++)this.sdk.viewer.entities.remove(this.nodePoints[n]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null);var s,r=ae(),l=r.sdkP,c=r.sdkD;if(c&&l&&this.sdk===c)(s=l.entityMap.get(this.options.id))&&s.entity&&s.entity.polygon&&s.positionsH&&(this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s.positionsH),[s.positionsH[0],s.positionsH[1]])}),!1));else{for(var u=[],p=0;p<i.options.positions.length;p++)u.push([i.options.positions[p].lng,i.options.positions[p].lat]);for(var h=turf.lineString(u),d=[],m=1;m<u.length;m++){var f=turf.point(u[m]),v=turf.point(u[m-1]),g=turf.distance(f,v,{units:"kilometers"}),y=d[d.length-1]||0;d.push(y+g)}var b=turf.length(h,{units:"kilometers"}),C=e/this.spreadTime;this.TweenAnimate=new TWEEN.Tween({distance:b*C}).to({distance:b},this.spreadTime-e).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){e&&t.setSpreadProgressByTime()})).onUpdate(function(){var e=o()(a.a.mark((function e(i,n){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.TweenAnimate._duration!=1/0){e.next=2;break}return e.abrupt("return");case 2:if(t.sdk.viewer){e.next=6;break}return t.removeAnimate(),e.abrupt("return");case 6:w(i);case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).onStart((function(){t.options.spreadState=!0,t._elms.spreadState&&t._elms.spreadState.forEach((function(t){t.checked=!0}))})).onComplete((function(e){t.removeAnimate()})),this.spreadState?this.TweenAnimate.start():w({distance:b*C}),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positionsH)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positionsH),[i.positionsH[0],i.positionsH[1]])}),!1)}}function w(t){return k.apply(this,arguments)}function k(){return(k=o()(a.a.mark((function t(e){var n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.show){t.next=2;break}return t.abrupt("return");case 2:n=2,o=d.length-2;case 4:if(!(o>=0)){t.next=12;break}if(!(e.distance>=d[o])){t.next=9;break}return(n=n+o+1)>i.options.positions.length-1&&(n=i.options.positions.length-1),t.abrupt("break",12);case 9:o--,t.next=4;break;case 12:for(s=[],r=0;r<n;r++)s[r]=Pp({},i.options.positions[r]);if(e.distance){t.next=18;break}s[n]={lng:s[1].lng,lat:s[1].lat},t.next=24;break;case 18:return t.next=20,turf.lineSliceAlong(h,0,e.distance,{units:"kilometers"});case 20:l=t.sent,c=L()(l.geometry.coordinates[l.geometry.coordinates.length-1]),s[1].lng=c[0],s[1].lat=c[1];case 24:i.renewPositions(s);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}}},{key:"removeAnimate",value:function(){this.spreadState=!1,this.TweenAnimate&&(TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positionsH),this.entity.polyline.positions=[].concat(L()(this.positionsH),[this.positionsH[0],this.positionsH[1]]))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error&&this.sdk.viewer){var i=!1,n=this.options.positions;t&&(n=t);for(var o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(o);var a=this.computeStraightArrow(n);if(0!=a.length){for(var r=[[]],l=[],c=0;c<a.length;c++){var u=this.cartesian3Towgs84(a[c],this.sdk.viewer);l.push(u),r[0].push([u.lng,u.lat])}var p=this.cartesian3Towgs84(a[0],this.sdk.viewer);r[0].push([p.lng,p.lat]);var h=0,d=turf.polygon(r),m=turf.pointOnFeature(d);switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:h=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(m.geometry.coordinates[0],m.geometry.coordinates[1]))||0,i=!1;break;case"2":case 2:i=!0}var f=[];if(i||0!=this.nodePoints.length)this.positionsH=a,setTimeout((function(){if(e.sdk.viewer){var t=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:m.geometry.coordinates[0],lat:m.geometry.coordinates[1]},t).then((function(t){e.label&&(e.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],t])}))}}),100);else{for(var v=0;v<r[0].length;v++)f.push(r[0][v][0],r[0][v][1],this.height+h);this.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(f),this.label&&(this.label.position=[m.geometry.coordinates[0],m.geometry.coordinates[1],this.height+h])}return this.spreadState||(this.options.areaByMeter=this.computeArea(l),this.areaUnit=this.areaUnit),o}}}}],[{key:"create",value:function(t){for(var i=t.options.positions,n=[],o=0;o<i.length;o++)n.push(i[o].lng,i[o].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(n);var s=t.computeStraightArrow(t.options.positions);if(0!=s.length){for(var a=[[]],r=0;r<s.length;r++){var l=t.cartesian3Towgs84(s[r],t.sdk.viewer);a[0].push([l.lng,l.lat])}var c=t.cartesian3Towgs84(s[0],t.sdk.viewer);a[0].push([c.lng,c.lat]);var u,p=turf.polygon(a),h=turf.pointOnFeature(p),d=0;switch(t.options.heightMode){case"0":case 0:u=!1;break;case"1":case 1:d=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(h.geometry.coordinates[0],h.geometry.coordinates[1]))||0,u=!1;break;case"2":case 2:u=!0}t.options.label.position||(t.options.label.position={lng:h.geometry.coordinates[0],lat:h.geometry.coordinates[1],alt:t.height+d});for(var m=[],f=0;f<a[0].length;f++)m.push(a[0][f][0],a[0][f][1],t.height+d);var v=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(u=!1,v=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=u,t.positionsH=Cesium.Cartesian3.fromDegreesArrayHeights(m),t.entity=t.sdk.viewer.entities.add({show:t.options.show,id:t.options.id,polygon:{hierarchy:u?new Cesium.PolygonHierarchy(s):new Cesium.PolygonHierarchy(t.positionsH),perPositionHeight:!u,material:v,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positionsH),[t.positionsH[0],t.positionsH[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!u,arcType:u?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);for(var g=[],y=0;y<s.length;y++)g.push(t.cartesian3Towgs84(s[y],t.sdk.viewer));switch(t.options.areaByMeter=t.computeArea(g),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id),t.spreadState=t.options.spreadState}}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Mp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n,s=function(){var e=o()(a.a.mark((function e(){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=L()(t.sdk.viewer.entities.values),n=0;case 2:if(!(n<t.options.positions.length)){e.next=11;break}return e.next=5,t.getClampToHeight(t.options.positions[n],i);case 5:o=e.sent,s=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,o),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(s);case 8:n++,e.next=2;break;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.removeAnimate(),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var r=[],l=0;l<t.options.positions.length;l++)r.push(t.options.positions[l].lng,t.options.positions[l].lat);var c=function(e,n){i&&(t.options.positions[i.index]=t.cartesian3Towgs84(n,t.sdk.viewer),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8)),t.renewPositions()),t.tip.setPosition(n,e.position?e.position.x:e.endPosition.x,e.position?e.position.y:e.endPosition.y)},u=function(e,o){c(e,o);var s=t.cartesian3Towgs84(o,t.sdk.viewer);if(i){var a=i.index,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:a,position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,s.alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,r),i=null,t.tip.set_text("请选择一个顶点,右键取消")}else{var l=e.position;l||(l={x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2});var u=t.sdk.viewer.scene.pick(l);u&&u.id&&u.id.name&&"node-secondary-edit-point"===u.id.name&&(i=u.id,n=t.cartesian3Towgs84(u.id.position.getValue(),t.sdk.viewer),t.nodePoints.splice(u.id.index,1),t.sdk.viewer.entities.remove(u.id),t.tip.set_text("左键确认,右键取消"))}t.renewPositions()},p=function(){t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),i&&(n?t.options.positions[i.index]=n:t.options.positions.pop(),t._elms.lng&&t._elms.lng[i.index]&&(t._elms.lng[i.index].innerHTML=t.options.positions[i.index].lng.toFixed(8)),t._elms.lat&&t._elms.lat[i.index]&&(t._elms.lat[i.index].innerHTML=t.options.positions[i.index].lat.toFixed(8))),t.heightMode=t.heightMode,t.previous=null};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){var e=t.computeStraightArrow(t.options.positions);return new Cesium.PolygonHierarchy(e)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.computeStraightArrow(t.options.positions);return e.length>=3?[].concat(L()(e),[e[0],e[1]]):L()(e)}),!1),setTimeout((function(){t.event.mouse_left(u),t.event.mouse_right(p),t.event.mouse_move(c),t.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){var t=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t-n>=500?p():u(o,i)}))}));for(var e=[[]],i=[],n=0;n<t.positionsH.length;n++){var o=t.cartesian3Towgs84(t.positionsH[n],t.sdk.viewer);i.push(o),e[0].push([o.lng,o.lat])}var a=t.cartesian3Towgs84(t.positionsH[0],t.sdk.viewer);e[0].push([a.lng,a.lat]);var r=turf.polygon(e),l=turf.pointOnFeature(r),h=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},h).then((function(e){t.label.position=[l.geometry.coordinates[0],l.geometry.coordinates[1],e]})),s()}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}}]);var i,n,s,r}(Wn);function Bp(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Lp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ap(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ip(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ip(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ip(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Rp(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Fp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Rp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"#ff000080",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.radius=n.radius||0===n.radius?n.radius:10,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"CircleObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t,this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(this.positions),this.entity.polyline.positions=[].concat(L()(this.positions),[this.positions[0],this.positions[1]])}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(e){e.value=t}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,!this.show||this.showView&&3!=this.showView?this.label.show=!1:this.label.show=t,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new rn(this.sdk,this.options,{title:"圆属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),Pe(m.sdk,m.options.id),se(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.reset(),m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=Bp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),m.heightMode=m.heightMode,setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=qn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelLineColor=this.originalOptions.label.lineColor,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ap({},this.options.position):this.options.positions?l=Ap({},this.options.positions[0]):this.options.center?l=Ap({},this.options.center):this.options.start?l=Ap({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions,u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),x=1;x<c.length;x++)u.push(c[x].x,c[x].y,c[x].z);_=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(_,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),this.previous={positions:Ap({},this.options.center)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt;var o=0,s=!1;switch(e.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=e.createCircle(n,e.options.radius),r=[];if(s){e.positions=Cesium.Cartesian3.fromDegreesArray(a);var l=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:n.lng,lat:n.lat},l).then((function(t){e.label&&(e.label.position=[n.lng,n.lat,t])}))}else{for(var c=0;c<a.length;c+=2)r.push(a[c],a[c+1],n.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),e.label&&(e.label.position=[n.lng,n.lat,n.alt+o])}e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={positions:Ap({},e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(t.lng.toFixed(8)),e.options.center.lat=Number(t.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.previous={positions:Ap({},e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!0))}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.createCircle(t,this.options.radius),s=[];if(i)this.positions=Cesium.Cartesian3.fromDegreesArray(o),setTimeout((function(){var i=L()(e.sdk.viewer.entities.values);e.getClampToHeight({lng:t.lng,lat:t.lat},i).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100);else{for(var a=0;a<o.length;a+=2)s.push(o[a],o[a+1],t.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[t.lng,t.lat,t.alt+n])}return this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius).toFixed(2)),this.areaUnit=this.areaUnit,o}}}],[{key:"create",value:function(t){var i,n=t.createCircle(t.options.center,t.options.radius),o=0;switch(t.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+o});var s=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(i=!1,s=new Cesium.CustomColorMaterialSource({color:t.options.color}));for(var a,r=[],l=0;l<n.length;l+=2)r.push(n[l],n[l+1],t.options.center.alt+o);switch(t.options.label.ground=i,t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),a=Cesium.Cartesian3.fromDegreesArray(n),t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:i?new Cesium.PolygonHierarchy(a):new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!i,material:s,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e=function(){var e=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=L()(t.sdk.viewer.entities.values),e.next=3,t.getClampToHeight(t.options.center,i);case 3:n=e.sent,o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.center.lng,t.options.center.lat,n),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(o);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("左键确认,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var i,n=[],s=Ap({},t.options.center),r=null;n=t.createCircle(t.options.center,t.options.radius),t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(n))}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(n)}),!1),setTimeout((function(){var e=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:t.options.center.lng,lat:t.options.center.lat},e).then((function(e){t.label.position=[t.options.center.lng,t.options.center.lat,e]}))}),50),setTimeout((function(){t.event.mouse_left((function(e,n){i&&(t.sdk.viewer.entities.remove(i),i=null),s=t.cartesian3Towgs84(n,t.viewer);var o=t.computeDistance2([t.options.center,s]);t.radius=o,YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode})),t.event.mouse_right((function(e,n){i&&(t.sdk.viewer.entities.remove(i),i=null),YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.heightMode=t.heightMode})),t.event.mouse_move((function(e,o){i&&(i.show=!0),s=t.cartesian3Towgs84(o,t.viewer),r=t.computeDistance2([t.options.center,s]),n=t.createCircle(t.options.center,r),t.tip.setPosition(o,e.endPosition.x,e.endPosition.y)})),e()}),200),i=t.sdk.viewer.entities.add(new Cesium.Entity({show:!1,position:new Cesium.CallbackProperty((function(e){if(s){var i=t.computeMidpoint(t.options.center,s);return Cesium.Cartesian3.fromDegrees(i.lng,i.lat,s.alt)}return Cesium.Cartesian3()}),!1),label:{text:new Cesium.CallbackProperty((function(t){return r>1e3?"半径:"+(r/1e3).toFixed(2)+" 公里":"半径:"+r+" 米"}),!1),font:"20px Microsoft YaHei",distanceDisplayCondition:1e7,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fillColor:Cesium.Color.fromCssColorString("#f5ce0a"),style:Cesium.LabelStyle.FILL_AND_OUTLINE},polyline:{positions:new Cesium.CallbackProperty((function(e){return Cesium.Cartesian3.fromDegreesArray([t.options.center.lng,t.options.center.lat,s.lng,s.lat])}),!1),width:2,material:Cesium.Color.fromCssColorString("#c1c505").withAlpha(.5),clampToGround:!0,zIndex:99999999}})),t.nodePoints.push(i)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=jp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Wn);function zp(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Hp(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Vp(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Hp(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Hp(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Gp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Up(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Up(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Up(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Wp(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Yp=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Wp(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"EllipseObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;this.entity.polygon.hierarchy=[],!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),this.previous=null,e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"semiMinorAxis",get:function(){return this.options.semiMinorAxis},set:function(t){this.options.semiMinorAxis=t,this.height=this.height}},{key:"semiMajorAxis",get:function(){return this.options.semiMajorAxis},set:function(t){this.options.semiMajorAxis=t,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"bearing",get:function(){return this.options.bearing},set:function(t){this.options.bearing=t,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Gp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Gp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Gp(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Gp(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new rn(this.sdk,this.options,{title:"椭圆属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.options.label.position={lng:m.label.position[0],lat:m.label.position[1],alt:m.label.position[2]},m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close(),m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(m.originalOptions),Pe(m.sdk,m.options.id),se(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m.reset(),m.previous=null,m.positionEditing=!1,m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.options.show=t,m.originalOptions.show=t,m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},translationalCallBack:function(){m.positionEditing=!m.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(m,(function(){o()}))}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=zp(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.lineColor=t},clear:function(){m.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelColor=t},clear:function(){m.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelLineColor=t},clear:function(){m.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorStart=t},clear:function(){m.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){m.labelBackgroundColorEnd=t},clear:function(){m.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],setTimeout((function(){m.attributeLink=m.options.attribute.link.content,m.attributeVr=m.options.attribute.vr.content,m.cameraSelect&&m.cameraSelect(),m.goodsSelect&&m.goodsSelect();var t=m.attributeSelect,i=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var n=Y(i,".attribute-select");n.legp_search(t);for(var s=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===m.options.attributeType){s.value=t[a].value,n.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){m.attributeType=t[e].key;break}}))}var r=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],l=Y(m._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=m._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];c.value=m.options["area-unit"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){m.areaUnit=r[t].value;break}}))}var p=m._DialogObject._element.content.getElementsByClassName("height-box")[0],h=p.getElementsByClassName("height")[0],d=m._DialogObject._element.content.getElementsByClassName("height-confirm")[0];h.value=10,2==m.heightMode?(p&&(p.className="input-number input-number-unit-1 height-box disabled"),d&&d.setAttribute("disabled","disabled")):(p&&(p.className="input-number input-number-unit-1 height-box"),d&&d.removeAttribute("disabled"));var f=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],v=Y(m._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(v){v.legp_search(f);for(var g=m._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],y=0;y<f.length;y++)if(f[y].key==m.heightMode){g.value=f[y].value,v.legp_searchActive(f[y].value);break}g.addEventListener("input",(function(){for(var t=0;t<f.length;t++)if(f[t].value===g.value){m.heightMode=f[t].key;break}})),h.addEventListener("input",(function(){m.heightMode})),m._elms.height=h,m._elms.heightBox=p,m._elms.heightMode=g,m._elms.heightConfirm=d,m._elms.heightModeObject=v,d.addEventListener("click",(function(){m.operate.positionEditing?(m.positionEditing=!1,m.height=m.height+Number(h.value)):(e.closeNodeEdit(m),setTimeout((function(){m.height=m.height+Number(h.value)}),100))}))}var b=qn(),C=Y(m._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(C){C.legp_search(b);var w=m._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];w.value=b[m.labelFontFamily].value;for(var k=0;k<b.length;k++)if(b[k].value==w.value){C.legp_searchActive(b[k].value);break}w.addEventListener("input",(function(){for(var t=0;t<b.length;t++)if(b[t].value===w.value){m.labelFontFamily=b[t].key;break}})),m._elms.labelFontFamily=[w]}o()}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.semiMinorAxis=this.originalOptions.semiMinorAxis,this.semiMajorAxis=this.originalOptions.semiMajorAxis,this.bearing=this.originalOptions.bearing,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!this.options.customView){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Vp({},this.options.position):this.options.positions?l=Vp({},this.options.positions[0]):this.options.center?l=Vp({},this.options.center):this.options.start?l=Vp({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),x=1;x<c.length;x++)u.push(c[x].x,c[x].y,c[x].z);_=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(_,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity){var i=this;if(this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t){this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions();this.createEllipse(this.options.center,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis}),this.event.mouse_move((function(t,i){[];var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt,e.renewPositions(n),e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){[];var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{[];var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.center=e.options.center,e.createEllipse(e.options.center,{bearing:e.options.bearing,semiMinorAxis:e.options.semiMinorAxis,semiMajorAxis:e.options.semiMajorAxis}),e.label.position=[t.lng,t.lat],e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)}else this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!0),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!0)}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}return this.positions=this.createEllipse(t,{bearing:this.options.bearing,semiMinorAxis:this.options.semiMinorAxis,semiMajorAxis:this.options.semiMajorAxis,height:t.alt+n}),i?setTimeout((function(){e.getClampToHeight({lng:t.lng,lat:t.lat}).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100):this.label&&(this.label.position=[t.lng,t.lat,t.alt+n]),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.semiMinorAxis*this.options.semiMajorAxis).toFixed(2)),this.areaUnit=this.areaUnit,this.positions}}}],[{key:"create",value:function(t){var i,n=0;switch(t.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,i=!1;break;case"2":case 2:i=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+n});var o=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(i=!1,o=new Cesium.CustomColorMaterialSource({color:t.options.color})),t.options.label.ground=i;var s=t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis,height:t.options.center.alt+n});switch(t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(s),perPositionHeight:!i,material:o,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(s),[s[0],s[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!i,arcType:i?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.semiMinorAxis*t.options.semiMajorAxis).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)},n=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o,d);case 3:s=e.sent,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),t.nodePoints.push(r);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个编辑点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat),r=t.options.semiMinorAxis,l=t.options.semiMajorAxis,c=t.options.bearing,u=t.createEllipse(t.options.center,{bearing:t.options.bearing,semiMinorAxis:t.options.semiMinorAxis,semiMajorAxis:t.options.semiMajorAxis});t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(u)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(u),[u[0],u[1]])}),!1);var p=t.entity.polyline.positions.getValue(),h=p.length,d=L()(t.sdk.viewer.entities.values);setTimeout((function(){t.event.mouse_left((function(n,o){if(e)t.options.semiMinorAxis=r,t.options.semiMajorAxis=l,t.options.bearing=c,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1),t.heightMode=t.heightMode;else{var a=t.sdk.viewer.scene.pick(n.position);if(a&&a.id&&a.id.name&&"node-secondary-edit-point"===a.id.name&&("semiMinorAxis"===a.id._type||"semiMajorAxis"===a.id._type)){t.tip.set_text("左键确认,右键取消"),e=a.id;for(var p=0;p<t.nodePoints.length;p++)t.sdk.viewer.entities.remove(t.nodePoints[p]);t.nodePoints=[];var h=o,d=t.cartesian3Towgs84(h,t.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat,d.alt);var m=Cesium.Cartesian3.distance(s,h),f={x:t.center.lng,y:t.center.lat},v={x:d.lng,y:d.lat};c=i(f,v),"semiMinorAxis"===e._type&&(r=m,c+=90),"semiMajorAxis"===e._type&&(l=m),u=t.createEllipse(t.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}}})),t.event.mouse_move((function(n,o){if(e){var a=o,p=t.cartesian3Towgs84(o,t.sdk.viewer);s=Cesium.Cartesian3.fromDegrees(t.center.lng,t.center.lat,p.alt);var h=Cesium.Cartesian3.distance(s,a),d={x:t.center.lng,y:t.center.lat},m={x:p.lng,y:p.lat};c=i(d,m),"semiMinorAxis"===e._type&&(r=h,c+=90),"semiMajorAxis"===e._type&&(l=h),u=t.createEllipse(t.center,{bearing:c,semiMinorAxis:r,semiMajorAxis:l})}t.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.heightMode=t.heightMode})),t.getClampToHeight({lng:t.center.lng,lat:t.center.lat},d).then((function(e){t.label&&(t.label.position=[t.center.lng,t.center.lat,e])})),n(p[0],"semiMajorAxis"),n(p[(h-2)/4],"semiMinorAxis"),n(p[(h-2)/2],"semiMajorAxis"),n(p[h-2-(h-2)/4],"semiMinorAxis")}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Gp(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Wn);function Jp(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col material-box">\n <span class="label">材质样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function qp(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Xp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Xp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Xp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var Zp=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!e[o]||!e[o].attributes)return 1;var l,c=qp(e[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[c.value]=e.target.checked})),e[o].checked=t[c.value]):(n.push((function(e){var i=e.target.value;if("number"==e.target.type){if("."!=e.data&&("-"!=e.data||e.target.value)){var n=Number(i);e.target.max&&n>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&n<Number(e.target.min)&&(i=Number(e.target.min)),t[c.value]=i}}else t[c.value]=i})),r=function(e){var i=e.target.value;"number"==e.target.type&&(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[c.value]=i},"IMG"==e[o].nodeName?e[o].src=t[c.value]:e[o].value=t[c.value]),i.element[c.value]?i.element[c.value].push(e[o]):i.element[c.value]=[e[o]],a.push(c.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[c.value]&&t[c.value](e)})),a.push(c.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[c.value]&&t[c.value](e,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}for(var p=0;p<a.length;p++)e[o].attributes.removeNamedItem(a[p]);if(s){var h="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(h="change"),e[o].addEventListener(h,(function(t){for(var e=0;e<n.length;e++)n[e](t)})),e[o].addEventListener("blur",(function(t){r(t)}))}},o=0;o<e.length;o++)n()}}])}();C()(Zp,"event",{});var Kp=new Zp;function $p(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Qp(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Qp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Qp(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function th(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var eh=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=th(this,e,[t,i])).options.color=i.color||"#ff0000",n.options.extrudedHeight=i.extrudedHeight||2.4,n.options.positions=i.positions,n.options.material=Number(i.material)||0===Number(i.material)?Number(i.material):3,n.options.duration=i.duration||0===i.duration?i.duration:1e3,n.options.show=!i.show&&!1!==i.show||i.show,n.options["nose-to-tail"]=i["nose-to-tail"]||!1,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n.Dialog=o,n._elms={},!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),e.create(n)),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"wallStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000",this.entity.polylineVolume.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[i]=n}))}},{key:"material",get:function(){return this.options.material},set:function(t){var e=this;this.options.material=Number(t)||0===Number(t)?Number(t):3,this.entity.polylineVolume.material=this.getMaterial(),this._elms.material&&this._elms.material.forEach((function(t){t.value=e.options.material}))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){this.options["nose-to-tail"]=t;for(var e=this.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,e[n].alt);t&&i.push(e[0].lng,e[0].lat,e[0].alt),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.entity.polylineVolume.shape=[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=$p(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=$p(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=$p(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++){var n,o=$p(e[i].attributes);try{var s,a=function(){var o=n.value;return e[i]&&e[i].attributes?"@click"===o.name?(e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1):void 0:0};for(o.s();!(n=o.n()).done&&(0===(s=a())||1!==s););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=49;break}return t.next=6,new rn(this.sdk,this.options,{title:"电子围墙属性",left:"180px",top:"100px",confirmCallBack:function(t){v.name=v.name.trim(),v.name||(v.name="未命名对象"),v.options.label.position={lng:v.label.position[0],lat:v.label.position[1],alt:v.label.position[2]},v.originalOptions=v.deepCopyObj(v.options),v._DialogObject.close(),v.Dialog.confirmCallBack&&v.Dialog.confirmCallBack(v.originalOptions),Pe(v.sdk,v.options.id),se(v.sdk,v.options.id)},resetCallBack:function(){v.reset(),v.Dialog.resetCallBack&&v.Dialog.resetCallBack()},removeCallBack:function(){v.Dialog.removeCallBack&&v.Dialog.removeCallBack()},closeCallBack:function(){v.reset(),v.Dialog.closeCallBack&&v.Dialog.closeCallBack();for(var t=0;t<v.nodePoints.length;t++)v.sdk.viewer.entities.remove(v.nodePoints[t]);v.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),v.event&&v.event.destroy(),v.event&&v.tip.destroy()},showCallBack:function(t){v.options.show=t,v.originalOptions.show=t,v.show=t,v.Dialog.showCallBack&&v.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(v)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(n=document.createElement("div")).innerHTML=Jp(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,o=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-gradient"></i>上升墙',value:"上升墙",key:1,icon:"icon-wall-gradient"},{name:'<i class="icon icon-wall-arrow"></i>箭头墙',value:"箭头墙",key:2,icon:"icon-wall-arrow"},{name:'<i class="icon icon-wall-warn"></i>警戒墙',value:"警戒墙",key:3,icon:"icon-wall-warn"}],(s=Y(n.getElementsByClassName("material-box")[0],".material")).legp_search(o),(r=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(r),l=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],c=0;case 22:if(!(c<o.length)){t.next=31;break}if(o[c].key!==this.material){t.next=28;break}return s.legp_searchActive(o[c].value),l.value=o[c].value,r.className="icon icon-active ".concat(o[c].icon),t.abrupt("break",31);case 28:c++,t.next=22;break;case 31:l.addEventListener("input",(function(t,e){for(var i=0;i<o.length;i++)if(o[i].value===l.value){v.material=o[i].key,r.className="icon icon-active ".concat(o[i].icon);break}})),new kn("radar-scan-edit-tabs",void 0,this.sdk),u=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){v.color=t},clear:function(){v.color="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelColor=t},clear:function(){v.labelColor="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelLineColor=t},clear:function(){v.labelLineColor="rgba(255,255,255,1)"}}),d=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelBackgroundColorStart=t},clear:function(){v.labelBackgroundColorStart="rgba(255,255,255,1)"}}),m=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){v.labelBackgroundColorEnd=t},clear:function(){v.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),f=n.getElementsByTagName("*"),Kp.on(this,f),this._elms=Kp.element,this._elms.color=[u],this._elms.labelColor=[p],this._elms.labelLineColor=[h],this._elms.labelBackgroundColorStart=[d],this._elms.labelBackgroundColorEnd=[m],setTimeout((function(){v.attributeLink=v.options.attribute.link.content,v.ISCSelect&&v.ISCSelect(),v.goodsSelect&&v.goodsSelect(),v.cameraSelect&&v.cameraSelect(),v.attributeVr=v.options.attribute.vr.content;var t=v.attributeSelect,e=Y(v._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(e.legp_search(t),v._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=v._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<t.length;n++)if(t[n].key===v.options.attributeType){i.value=t[n].value,e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){v.attributeType=t[e].key;break}}));var o=qn(),s=Y(v._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=v._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[v.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===a.value){v.labelFontFamily=o[t].key;break}})),v._elms.labelFontFamily=[a]}}}),0),t.next=50;break;case 49:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 50:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var e=this.options.positions,i=[],n=0;n<e.length;n++)i.push(e[n].lng,e[n].lat,e[n].alt);this.noseToTail&&i.push(i[0],i[1],i[2]),this.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t.noseToTail}))}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"getMaterial",value:function(){var t,e=this;switch(this.options.material){case 0:t=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(t=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:t=new Cesium.PolylineTrailLinkMaterialProperty({color:Cesium.Color.fromCssColorString(this.options.color),duration:this.options.duration});break;case 2:case 3:var i;switch(this.options.material){case 2:i="arrow";break;case 3:i="warn"}t=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,repeats:new Cesium.CallbackProperty((function(){var t=[[1,1,1]];if(!e.entity||!e.entity.polylineVolume)return t;var i=e.entity.polylineVolume.positions.getValue();if(!Cesium.defined(i))return t;var n=0,o=[];t=[];for(var s=!1,a=0;a<i.length-1;++a){var r=Cesium.Cartesian3.distance(i[a],i[a+1]);r>=1e5&&(s=!0),o.push(r),n+=r}var l=n/e.options.extrudedHeight;if(l/=1,s)for(var c=0;c<o.length;c++){t.push([((c+1)/o.length).toFixed(30),l/5,1])}else for(var u=0;u<o.length;u++){var p=o[u]/n;p;var h=p*l;t.push([((u+1)/o.length).toFixed(30),h,1])}return t}),!1),duration:this.options.duration})}return t}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(t){t.label=new no(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,ground:!1,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function t(i){var n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=i.options.positions,o=[],s=0;s<n.length;s++)o.push(n[s].lng,n[s].lat,n[s].alt);i.noseToTail&&o.push(o[0],o[1],o[2]),i.entity=i.sdk.viewer.entities.add({id:i.options.id,show:i.options.show,polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),i.entity.polylineVolume.material=i.getMaterial(),e.createLabel(i),Pe(i.sdk,i.options.id),i.options.show&&Kt(0,i.options.id);case 9:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat,o[a].alt);t.noseToTail&&s.push(s[0],s[1],s[2]);var r=!1,l=function(e,o){if(i){r=!0;var a=t.sdk.viewer.scene.clampToHeight(o,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(a,t.sdk.viewer),n=t.options.positions[i.index];var l=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,l),t.options.positions.splice(i.index,0,t.options.positions[i.index]);var c=t.options.positions;s=[];for(var u=0;u<c.length;u++)s.push(c[u].lng,c[u].lat,c[u].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],t.tip.setPosition(o,e.position.x,e.position.y),t.material=t.material}else{var p=t.sdk.viewer.scene.pick(e.position);p&&p.id&&p.id.name&&"node-secondary-edit-point"===p.id.name&&(i=p.id,t.nodePoints.splice(p.id.index,1),t.sdk.viewer.entities.remove(p.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(i.position._value,t.sdk.viewer),t.entity.polylineVolume.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s)}),!1))}},c=function(o,a){i&&(t.options.positions[i.index]=n,r&&t.options.positions.splice(i.index,1),e(null,t.options.positions));var l=t.options.positions;s=[];for(var c=0;c<l.length;c++)s.push(l[c].lng,l[c].lat,l[c].alt);t.noseToTail&&s.push(s[0],s[1],s[2]),t.entity.polylineVolume.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight];for(var u=0;u<t.nodePoints.length;u++)t.sdk.viewer.entities.remove(t.nodePoints[u]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.material=t.material};t.event.mouse_left(l),t.event.mouse_right(c);var u=!1;t.event.mouse_move((function(e,n){if(i){var o=t.sdk.viewer.scene.clampToHeight(n,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var a=t.options.positions;s=[];for(var r=0;r<a.length;r++)s.push(a[r].lng,a[r].lat,a[r].alt);if(t.noseToTail&&s.push(s[0],s[1],s[2]),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],u)return u=!1,void(t.material=t.material)}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(u=!0,t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?c(o,i):l(o,i)}))}));for(var p=0;p<t.options.positions.length;p++){var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:p,position:Cesium.Cartesian3.fromDegrees(t.options.positions[p].lng,t.options.positions[p].lat,t.options.positions[p].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(h)}}}}]);var i,n,s}(Wn);function ih(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" data-min="0.01" max="999999" @model="width">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">拉伸高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999999" @model="extrudedHeight">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col corner-type-box">\n <span class="label">拐角类型</span>\n <div class="corner-type"></div>\n </div>\n <div class="col material-box">\n <span class="label">墙体样式</span>\n <div class="material"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">墙体闭合</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function nh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return oh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?oh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function oh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var sh=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[],r=function(){};if(!e[o]||!e[o].attributes)return 1;var l,c=nh(e[o].attributes);try{var u=function(){var c=l.value;switch(c.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[c.value]=e.target.checked})),e[o].checked=t[c.value]):(n.push((function(e){var i=e.target.value;if("number"==e.target.type){if("."!=e.data&&("-"!=e.data||e.target.value)){var n=Number(i);e.target.max&&n>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&n<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&n<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[c.value]=i}}else t[c.value]=i})),r=function(e){var i=e.target.value;"number"==e.target.type&&(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[c.value]=i},"IMG"==e[o].nodeName?e[o].src=t[c.value]:e[o].value=t[c.value]),i.element[c.value]?i.element[c.value].push(e[o]):i.element[c.value]=[e[o]],a.push(c.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[c.value]&&t[c.value](e)})),a.push(c.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[c.value]&&t[c.value](e,i)}))}};for(c.s();!(l=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}for(var p=0;p<a.length;p++)e[o].attributes.removeNamedItem(a[p]);if(s){var h="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(h="change"),e[o].addEventListener(h,(function(t){for(var e=0;e<n.length;e++)n[e](t)})),e[o].addEventListener("blur",(function(t){r(t)}))}},o=0;o<e.length;o++)n()}}])}();C()(sh,"event",{});var ah=new sh;function rh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return lh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?lh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function lh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function ch(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var uh=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=ch(this,e,[t,i]))._elms={},n.options.color=i.color||"#ffffff",n.options.width=i.width||.24,n.options["nose-to-tail"]=i["nose-to-tail"]||!1,n.options.extrudedHeight=i.extrudedHeight||2.4,n.cornerType=i.cornerType,n.options.positions=i.positions,n.options.material=Number(i.material)||0,n.options.show=!i.show&&!1!==i.show||i.show,n.entity,n.nodePoints=[],i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera.content=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n.Dialog=o,!n.options.positions||n.options.positions.length<2?(n._error="最少需要两个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500})):(n.sdk.addIncetance(n.options.id,n),e.create(n)),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"WallRealStereoscopic"}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.entity)for(var i=0;i<this.entity.values.length;i++){if(this.entity.values[i].polylineVolume){var n=this.entity.values[i];n.polylineVolume.material=this.getMaterial(n.id)}if(this.entity.values[i].polygon)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color)}this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!1,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t,this.options.width<=.01&&(this.options.width=.01),this.update(),this._elms.width&&this._elms.width.forEach((function(e){e.value=t}))}},{key:"cornerType",get:function(){return this.options.cornerType},set:function(t){switch(t){case 0:case"0":t=0;break;case 1:case"1":t=1;break;case 2:case"2":t=2;break;default:t=0}this.options.cornerType=t,this.update(),this._elms.cornerType&&this._elms.cornerType.forEach((function(e){e.value=t}))}},{key:"material",get:function(){return this.options.material},set:function(t){if(this.options.material=Number(t),this.entity)for(var e=0;e<this.entity.values.length;e++)if(this.entity.values[e].polylineVolume){var i=this.entity.values[e];i.polylineVolume.material=this.getMaterial(i.id)}this._elms.material&&this._elms.material.forEach((function(e){e.value=t}))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){this.options["nose-to-tail"]=t,this.update(),this.material=this.material,this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"extrudedHeight",get:function(){return this.options.extrudedHeight},set:function(t){this.options.extrudedHeight=t,this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,this.options.positions[0].alt+this.options.extrudedHeight],this.update(),this._elms.extrudedHeight&&this._elms.extrudedHeight.forEach((function(e){e.value=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=rh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=rh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=rh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=rh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"calculatePositions3",value:function(){var t=this.deepCopyObj(this.options.positions);this.noseToTail&&t.push(t[0],t[1]);for(var e=[],i=[],n=[],o=[],s=[],a=0;a<t.length-1;a++){var r=turf.point([t[a].lng,t[a].lat]),l=turf.point([t[a+1].lng,t[a+1].lat]),c=turf.rhumbBearing(r,l),u=turf.destination(r,this.options.width/2/1e3,c+90,{units:"kilometers"}),p=turf.destination(l,this.options.width/2/1e3,c+90,{units:"kilometers"}),h=turf.destination(r,this.options.width/2/1e3,c-90,{units:"kilometers"}),d=turf.destination(l,this.options.width/2/1e3,c-90,{units:"kilometers"}),m=u.geometry.coordinates,f=p.geometry.coordinates,v=h.geometry.coordinates,g=d.geometry.coordinates;m[2]=t[a].alt,f[2]=t[a+1].alt,v[2]=t[a].alt,g[2]=t[a+1].alt,e.push(m,f),i.push(v,g)}if(0===this.cornerType);else if(1===this.cornerType)for(var y=0;y<e.length-3;y+=2)0==y&&(o.push(e[y]),s.push(i[y])),o.push(e[y+1],e[y+2]),s.push(i[y+1],i[y+2]),y==e.length-4&&(o.push(e[y+3]),s.push(i[y+3]));else if(2===this.cornerType)for(var b=0;b<e.length-3;b+=2){var C=t[b/2+1],w=turf.point(e[b+1]),k=turf.point(i[b+1]),x=turf.rhumbBearing(w,k),_=turf.point(e[b+2]),E=turf.point(i[b+2]),S=turf.rhumbBearing(_,E);console.log("bearing1, bearing2",x-S);var D=!0;if(Math.sin(Cesium.Math.toRadians(x-S))>0){var P=x;x=S+180,S=P+180,D=!1}var M=turf.sector([C.lng,C.lat,C.alt],this.options.width/1e3/2,x,S,{units:"kilometers"});if(console.log("sector",M),0==b&&(o.push(e[b]),s.push(i[b])),console.log("face",D),D){o.push(e[b+1],e[b+2]);for(var O=1;O<M.geometry.coordinates[0].length-1;O++)s.push([].concat(L()(M.geometry.coordinates[0][O]),[e[b+1][2]]))}else{for(var T=M.geometry.coordinates[0].length-2;T>0;T--)o.push([].concat(L()(M.geometry.coordinates[0][T]),[e[b+1][2]]));s.push(i[b+1],i[b+2])}b==e.length-4&&(o.push(e[b+3]),s.push(i[b+3]))}n=[].concat(o);for(var N=s.length-1;N>=0;N--)n.push(s[N]);return n.push(n[0]),console.log("positions",n),n}},{key:"calculatePositions2",value:function(){for(var t=[],e=0;e<this.options.positions.length-2;e++){var i=(180-u(this.options.positions[e],this.options.positions[e+1],this.options.positions[e+2]))/2,n=Math.tan(i*Math.PI/180)*(this.options.width/2);console.log("width",n,i);var o=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[0].lng,this.options.positions[0].lat]]),s=turf.lineString([[this.options.positions[1].lng,this.options.positions[1].lat],[this.options.positions[2].lng,this.options.positions[2].lat]]),a=turf.lineSliceAlong(o,0,n/1e3,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,n/1e3,{units:"kilometers"}),l=a.geometry.coordinates[a.geometry.coordinates.length-1],c=r.geometry.coordinates[r.geometry.coordinates.length-1];l[2]=this.options.positions[e+1].alt,c[2]=this.options.positions[e+1].alt,t.push([l,c]),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(l[0],l[1],l[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),this.sdk.viewer.entities.add({position:Cesium.Cartesian3.fromDegrees(c[0],c[1],c[2]),billboard:{image:this.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}})}function u(t,e,i){var n=turf.point([t.lng,t.lat]),o=turf.point([e.lng,e.lat]),s=turf.point([i.lng,i.lat]),a={units:"kilometers"},r=turf.rhumbDistance(n,o,a),l=turf.rhumbDistance(s,o,a);var c=turf.rhumbBearing(n,o),u=turf.rhumbBearing(s,o),p=Math.abs((c-u+360)%360);return p>180&&(p=360-p),p}return t}},{key:"calculatePositions",value:function(){var t=this.deepCopyObj(this.options.positions);this.noseToTail&&t.push(t[0],t[1]);for(var e=[],i=[],n=0;n<t.length-1;n++){var o=turf.point([t[n].lng,t[n].lat]),s=turf.point([t[n+1].lng,t[n+1].lat]),a=turf.rhumbBearing(o,s),r=turf.destination(o,this.options.width/2/1e3,a+90,{units:"kilometers"}),l=turf.destination(s,this.options.width/2/1e3,a+90,{units:"kilometers"}),c=turf.destination(o,this.options.width/2/1e3,a-90,{units:"kilometers"}),u=turf.destination(s,this.options.width/2/1e3,a-90,{units:"kilometers"}),p=r.geometry.coordinates,h=l.geometry.coordinates,d=c.geometry.coordinates,m=u.geometry.coordinates;p[2]=t[n].alt,h[2]=t[n+1].alt,d[2]=t[n].alt,m[2]=t[n+1].alt,e.push([p,h,m,d,p])}if(i.push(e[0]),0===this.cornerType)for(var f=1;f<e.length;f++){var v=t[f],g=turf.point(e[f-1][1]),y=turf.point(e[f-1][2]),b=turf.rhumbBearing(g,y),C=turf.point(e[f][0]),w=turf.point(e[f][3]),k=turf.rhumbBearing(C,w);if(Math.sin(Cesium.Math.toRadians(b-k))>0){var x=b;b=k+180,k=x+180,!1}var _=Math.abs(b-k);_>180&&(_=360-_);var E=this.options.width/2/Math.cos(Cesium.Math.toRadians(_/2));E>5*this.options.width&&(E=5*this.options.width);var S=turf.sector([v.lng,v.lat],this.options.width/1e3/2,b,k,{units:"kilometers",steps:3600}),D=turf.point([v.lng,v.lat]),P=turf.point(L()(S.geometry.coordinates[0][Math.ceil(S.geometry.coordinates[0].length/2)])),M=turf.bearing(D,P),O=turf.destination(D,E/1e3,M,{units:"kilometers"}),T=[];T.push([].concat(L()(S.geometry.coordinates[0][0]),[v.alt])),T.push([].concat(L()(S.geometry.coordinates[0][1]),[v.alt])),T.push([].concat(L()(O.geometry.coordinates),[v.alt])),T.push([].concat(L()(S.geometry.coordinates[0][S.geometry.coordinates[0].length-2]),[v.alt])),i.push(T),i.push(e[f])}else if(1===this.cornerType)for(var N=1;N<e.length;N++)i.push([e[N-1][2],e[N][0],e[N-1][1],e[N][3],e[N-1][2]]),i.push(e[N]);else if(2===this.cornerType)for(var B=1;B<e.length;B++){var A=t[B],j=turf.point(e[B-1][1]),I=turf.point(e[B-1][2]),R=turf.rhumbBearing(j,I),F=turf.point(e[B][0]),z=turf.point(e[B][3]),H=turf.rhumbBearing(F,z);if(Math.sin(Cesium.Math.toRadians(R-H))>0){var V=R;R=H+180,H=V+180}for(var G=turf.sector([A.lng,A.lat],this.options.width/1e3/2,R,H,{units:"kilometers"}),U=[],W=0;W<G.geometry.coordinates[0].length-1;W++)U.push([].concat(L()(G.geometry.coordinates[0][W]),[A.alt]));i.push(U),i.push(e[B])}return i}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=67;break}return t.next=6,new rn(this.sdk,this.options,{title:"实体墙属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),Pe(w.sdk,w.options.id),se(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.Dialog.closeCallBack&&w.Dialog.closeCallBack();for(var t=0;t<w.nodePoints.length;t++)w.sdk.viewer.entities.remove(w.nodePoints[t]);w.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),w.event&&w.event.destroy(),w.event&&w.tip.destroy()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(w)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" wall-stereoscopic",(n=document.createElement("div")).innerHTML=ih(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,o=[{name:'<svg class="icon-zj"><use xlink:href="#yj-icon-zj"></use></svg>直角',value:"直角",key:0,icon:"yj-icon-zj"},{name:'<svg class="icon-xj"><use xlink:href="#yj-icon-xj"></use></svg>斜角',value:"斜角",key:1,icon:"yj-icon-xj"},{name:'<svg class="icon-yj"><use xlink:href="#yj-icon-yj"></use></svg>圆角',value:"圆角",key:2,icon:"yj-icon-yj"}],(s=Y(n.getElementsByClassName("corner-type-box")[0],".corner-type")).legp_search(o),(r=document.createElement("i")).className="icon-active",n.getElementsByClassName("corner-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(r),l=n.getElementsByClassName("corner-type")[0].getElementsByTagName("input")[0],c=0;case 22:if(!(c<o.length)){t.next=31;break}if(o[c].key!==this.cornerType){t.next=28;break}return s.legp_searchActive(o[c].value),l.value=o[c].value,r.innerHTML='<svg class="'.concat(o[c].icon,'"><use xlink:href="#').concat(o[c].icon,'"></use></svg>'),t.abrupt("break",31);case 28:c++,t.next=22;break;case 31:l.addEventListener("input",(function(t,e){for(var i=0;i<o.length;i++)if(o[i].value===l.value){w.cornerType=o[i].key,r.innerHTML='<svg class="'.concat(o[i].icon,'"><use xlink:href="#').concat(o[i].icon,'"></use></svg>');break}})),u=[{name:'<i class="icon icon-wall"></i>纯色墙',value:"纯色墙",key:0,icon:"icon-wall"},{name:'<i class="icon icon-wall-brick1"></i>红砖墙',value:"红砖墙",key:1,icon:"icon-wall-brick1"},{name:'<i class="icon icon-wall-brick2"></i>黄砖墙',value:"黄砖墙",key:2,icon:"icon-wall-brick2"},{name:'<i class="icon icon-wall-brick3"></i>灰瓷墙',value:"灰瓷墙",key:3,icon:"icon-wall-brick3"}],(p=Y(n.getElementsByClassName("material-box")[0],".material")).legp_search(u),(h=document.createElement("i")).className="icon icon-active",n.getElementsByClassName("material")[0].getElementsByClassName("cy_datalist")[0].appendChild(h),d=n.getElementsByClassName("material")[0].getElementsByTagName("input")[0],m=0;case 40:if(!(m<u.length)){t.next=49;break}if(u[m].key!==this.material){t.next=46;break}return p.legp_searchActive(u[m].value),d.value=u[m].value,h.className="icon icon-active ".concat(u[m].icon),t.abrupt("break",49);case 46:m++,t.next=40;break;case 49:d.addEventListener("input",(function(t,e){for(var i=0;i<u.length;i++)if(u[i].value===d.value){w.material=u[i].key,h.className="icon icon-active ".concat(u[i].icon);break}})),new kn("radar-scan-edit-tabs",void 0,this.sdk),f=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!1,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),v=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),g=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),y=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),b=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),C=n.getElementsByTagName("*"),ah.on(this,C),this._elms=ah.element,this._elms.color=[f],this._elms.labelColor=[v],this._elms.labelLineColor=[g],this._elms.labelBackgroundColorStart=[y],this._elms.labelBackgroundColorEnd=[b],setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.ISCSelect&&w.ISCSelect(),w.goodsSelect&&w.goodsSelect(),w.cameraSelect&&w.cameraSelect(),w.attributeVr=w.options.attribute.vr.content;var t=w.attributeSelect,e=Y(w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0],".attribute-select");if(e.legp_search(t),w._DialogObject._element.content.getElementsByClassName("attribute-select")[0]){for(var i=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],n=0;n<t.length;n++)if(t[n].key===w.options.attributeType){i.value=t[n].value,e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){w.attributeType=t[e].key;break}}));var o=qn(),s=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(s){s.legp_search(o);var a=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];a.value=o[w.labelFontFamily].value;for(var r=0;r<o.length;r++)if(o[r].value==a.value){s.legp_searchActive(o[r].value);break}a.addEventListener("input",(function(){for(var t=0;t<o.length;t++)if(o[t].value===a.value){w.labelFontFamily=o[t].key;break}})),w._elms.labelFontFamily=[a]}}}),0),t.next=68;break;case 67:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 68:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.width=this.originalOptions.width,this.cornerType=this.originalOptions.cornerType,this.extrudedHeight=this.originalOptions.extrudedHeight,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect();for(var t=this.options.positions,e=[],i=[],n=[],o=0;o<t.length;o++)e.push(t[o].lng,t[o].lat,t[o].alt),i.push(t[o].alt),n.push(t[o].alt+this.options.extrudedHeight)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),e=0;e<this.entity.values.length;e++)this.sdk.viewer.entities.remove(this.entity.values[e]);return this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"getMaterial",value:function(t){var e,i,n=this;switch(this.options.material){case 0:e=Cesium.Color.fromCssColorString(this.options.color),2===this.sdk.viewer.scene.mode&&(e=new Cesium.CustomColorMaterialSource({color:this.options.color}));break;case 1:case 2:case 3:case 4:switch(this.options.material){case 1:i="brick1";break;case 2:i="brick2";break;case 3:i="brick3";break;case 4:i="brick4"}e=new Cesium.CustomMaterialSource({image:this.getSourceRootPath()+"/img/material/".concat(i,".png"),color:this.options.color,is2D:!1,repeats:new Cesium.CallbackProperty((function(){var e=[["1.0",1,1]];if(!n.entity)return e;var i=n.entity.getById(t);if(!i||!i.polylineVolume)return e;var o=i.polylineVolume.positions.getValue();if(!Cesium.defined(o))return e;var s=0,a=[];e=[];for(var r=0;r<o.length-1;++r){var l=Cesium.Cartesian3.distance(o[r],o[r+1]);a.push(l),s+=l}var c=s/n.options.extrudedHeight;c/=1;for(var u=0;u<a.length;u++){var p=a[u]/s;p;var h=p*c;e.push([((u+1)/a.length).toFixed(30),h,1])}return e}),!1),isTranslucent:!1,duration:0})}return e}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"update",value:function(){if(this.entity){for(var t=this.calculatePositions(),i=[],n=[],o=0;o<this.entity.values.length;o++)this.sdk.viewer.entities.remove(this.entity.values[o]);this.entity.removeAll();for(var s=0;s<t.length;s++){for(var a=[],r=[],l=0;l<t[s].length;l++)a.push(t[s][l][0],t[s][l][1],t[s][l][2]),r.push(t[s][l][0],t[s][l][1],t[s][l][2]+this.options.extrudedHeight);i.push(a),n.push(r);var c=this.sdk.viewer.entities.add({id:this.options.id+"-"+e.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(i[s]),shape:[{x:-1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:-this.options.extrudedHeight/2},{x:1e-7,y:this.options.extrudedHeight/2},{x:-1e-7,y:this.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=this.sdk.viewer.entities.add({id:this.options.id+"-"+e.randomString(12),polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(n[s])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(this.options.color)}});this.entity.add(c),this.entity.add(u),c.polylineVolume.material=this.getMaterial(c.id)}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]).concat([this.options.positions[0].alt+this.options.extrudedHeight]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:function(t){t.label=new no(t.sdk,{id:t.options.id,show:!!t.options.show&&t.options.label.show,position:[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],text:t.options.name,fontSize:t.options.label.fontSize,fontFamily:t.options.label.fontFamily,color:t.options.label.color,ground:!1,pixelOffset:t.options.label.pixelOffset,backgroundColor:t.options.label.backgroundColor,lineColor:t.options.label.lineColor,lineWidth:t.options.label.lineWidth,scaleByDistance:t.options.label.scaleByDistance,near:t.options.label.near,far:t.options.label.far})}},{key:"create",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i.entity=new Cesium.EntityCollection,n=i.calculatePositions(),o=0;o<n.length;o++){for(s=[],r=[],l=0;l<n[o].length;l++)s.push(n[o][l][0],n[o][l][1],n[o][l][2]),r.push(n[o][l][0],n[o][l][1],n[o][l][2]+i.options.extrudedHeight);c=i.sdk.viewer.entities.add({id:i.options.id+"-"+e.randomString(12),polylineVolume:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),shape:[{x:-1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:-i.options.extrudedHeight/2},{x:1e-7,y:i.options.extrudedHeight/2},{x:-1e-7,y:i.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),u=i.sdk.viewer.entities.add({id:i.options.id+"-"+e.randomString(12),polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(r),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(i.options.color)}}),i.entity.add(c),i.entity.add(u),c.polylineVolume.material=i.getMaterial(c.id)}i.entity.show=i.options.show,e.createLabel(i),Pe(i.sdk,i.options.id),i.options.show&&Kt(0,i.options.id);case 9:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())i("上一次测量未结束");else{var n,o,s=function(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t.entity){for(var n=t.calculatePositions(),o=0;o<t.entity.values.length;o++)t.sdk.viewer.entities.remove(t.entity.values[o]);t.entity.removeAll(),a=[],r=[];for(var s=function(o){for(var s=[],l=[],c=0;c<n[o].length;c++)s.push(n[o][c][0],n[o][c][1],n[o][c][2]),l.push(n[o][c][0],n[o][c][1],n[o][c][2]+t.options.extrudedHeight);a.push(s),r.push(l);var u=t.sdk.viewer.entities.add({id:t.options.id+"-"+e.randomString(12),polylineVolume:{positions:i?new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(a[o])}),!1):Cesium.Cartesian3.fromDegreesArrayHeights(a[o]),shape:[{x:-1e-7,y:-t.options.extrudedHeight/2},{x:1e-7,y:-t.options.extrudedHeight/2},{x:1e-7,y:t.options.extrudedHeight/2},{x:-1e-7,y:t.options.extrudedHeight/2}],cornerType:Cesium.CornerType.MITERED}}),p=t.sdk.viewer.entities.add({id:t.options.id+"-"+e.randomString(12),polygon:{hierarchy:i?new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o]))}),!1):new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(r[o])),perPositionHeight:!0,material:Cesium.Color.fromCssColorString(t.options.color)}});t.entity.add(u),t.entity.add(p),u.polylineVolume.material=t.getMaterial(u.id)},l=0;l<n.length;l++)s(l)}};YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];t.options.positions;var a=[],r=[],l=!1,c=function(e,i){if(!0,n){l=!0;var a=t.sdk.viewer.scene.clampToHeight(i,L()(t.entity.values));t.options.positions[n.index]=t.cartesian3Towgs84(a,t.sdk.viewer),o=t.options.positions[n.index];var r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[n.index].lng,t.options.positions[n.index].lat,t.options.positions[n.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(n.index,0,r),t.options.positions.splice(n.index,0,t.options.positions[n.index]),s(!0),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight],t.tip.setPosition(i,e.position.x,e.position.y),t.material=t.material}else{var c=t.sdk.viewer.scene.pick(e.position);c&&c.id&&c.id.name&&"node-secondary-edit-point"===c.id.name&&(n=c.id,t.nodePoints.splice(c.id.index,1),t.sdk.viewer.entities.remove(c.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),o=t.cartesian3Towgs84(n.position._value,t.sdk.viewer),s(!0))}},u=function(e,a){n&&(t.options.positions[n.index]=o,l&&t.options.positions.splice(n.index,1),s(),i(null,t.options.positions)),t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight];for(var r=0;r<t.nodePoints.length;r++)t.sdk.viewer.entities.remove(t.nodePoints[r]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy(),t.material=t.material};t.event.mouse_left(c),t.event.mouse_right(u),t.event.mouse_move((function(e,i){if(n){var o=t.sdk.viewer.scene.clampToHeight(i,L()(t.entity.values));t.options.positions[n.index]=t.cartesian3Towgs84(o,t.sdk.viewer);for(var s=t.calculatePositions(),l=0;l<s.length;l++){for(var c=[],u=[],p=0;p<s[l].length;p++)c.push(s[l][p][0],s[l][p][1],s[l][p][2]),u.push(s[l][p][0],s[l][p][1],s[l][p][2]+t.options.extrudedHeight);a[l]=c,r[l]=u}t.label.position=[t.options.positions[0].lng,t.options.positions[0].lat,t.options.positions[0].alt+t.options.extrudedHeight]}t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,i){n&&(!0,t.options.positions.pop(),s(!0),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),n.index===t.options.positions.length&&(t.nodePoints[n.index-1]?n=t.nodePoints[n.index-1]:n.index=0),t.nodePoints.pop())})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?u(o,i):c(o,i)}))}));for(var p=0;p<t.options.positions.length;p++){var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:p,position:Cesium.Cartesian3.fromDegrees(t.options.positions[p].lng,t.options.positions[p].lat,t.options.positions[p].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(h)}}}},{key:"randomString",value:function(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",i=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*i));return n}}]);var i,n,s}(Wn);function ph(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 56%;">\n <div>\n <div class="row">\n <div class="col input-select-unit-box">\n <div class="input-select-unit"></div>\n <input class="input input-text" readonly="readonly" type="text" style="flex: 0 0 130px;" @model="length">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="polyline-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="线条风格">\n <div class="row">\n <div class="col">\n <span class="label">线条颜色</span>\n <div class="color"></div>\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="999" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col input-select-line-type-box" style="flex: 0 0 37%;">\n <span class="label">线条形式</span>\n <div class="input-select-line-type"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">线段缓冲</span>\n <input class="btn-switch" type="checkbox" @model="extend">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">缓冲宽度</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @model="extendWidth">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label">缓冲颜色</span>\n <div class="extendColor"></div>\n </div>\n </div>\n <div class="row" id="dashTextureDom">\n <div class="col">\n <span class="label">动画顺向</span>\n <input class="btn-switch" type="checkbox" @model="rotate">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n <span class="label">流动速率</span>\n <div class="input-number input-number-unit-1" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 37%;">\n <span class="label lineSpace">间距</span>\n <div class="input-number input-number-unit-1 lineSpace" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="4.5" step="0.1" @model="space">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">首尾相连</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n <div class="col" style="flex: 0 0 33%;">\n </div>\n <div class="col" style="flex: 0 0 37%;">\n </div>\n </div>\n\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n \x3c!-- <DIV-cy-tab-pane label="灯光控制">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">指令</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="instruct">--\x3e\n \x3c!-- <button class="primary" @click="instructSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n \x3c!-- <DIV-cy-tab-pane label="设置操作点">--\x3e\n \x3c!-- <div>--\x3e\n \x3c!-- <div class="row">--\x3e\n \x3c!-- <div class="col">--\x3e\n \x3c!-- <span class="label">设置操作点</span>--\x3e\n \x3c!-- <input class="input" type="text" @model="operatingPoint">--\x3e\n \x3c!-- <button class="primary" @click="operatingPointSubmit">提交</button>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </DIV-cy-tab-pane>--\x3e\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function hh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return dh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?dh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var mh=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){for(var i=this,n=function(){var n=[],s=!1,a=[];if(!e[o]||!e[o].attributes)return 1;var r,l=hh(e[o].attributes);try{var c=function(){var l=r.value;switch(l.name){case"@model":s=!0,"checkbox"==e[o].type?(n.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):(n.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min)),t[l.value]=i):t[l.value]=i})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],a.push(l.name);break;case"@click":e[o].addEventListener("click",(function(e){"function"==typeof t[l.value]&&t[l.value](e)})),a.push(l.name);break;case"@change":s=!0,n.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[l.value]&&t[l.value](e,i)}))}};for(l.s();!(r=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<a.length;u++)e[o].attributes.removeNamedItem(a[u]);if(s){var p="input";"INPUT"==e[o].tagName&&"checkbox"!=e[o].type||(p="change"),e[o].addEventListener(p,(function(t){for(var e=0;e<n.length;e++)n[e](t)}))}},o=0;o<e.length;o++)n()}}])}();C()(mh,"event",{});var fh=new mh;function vh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return gh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function gh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function yh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ch(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var wh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),(i=Ch(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.width=n.width||0===n.width?n.width:3,i.options.color=n.color||"#ff0000",i.options.type=n.type?Number(n.type):0,i.options["nose-to-tail"]=n["nose-to-tail"]||!1,i.options.extend=n.extend||!1,i.options.rotate=n.rotate||!0,i.options.space=n.space||1,i.options.speed=n.speed||10,i.options.dashSize=n.dashSize||.03,i.options["length-unit"]=n["length-unit"]||"米",i.options["fit-length-unit"]=n["fit-length-unit"]||"米",i.options["words-name"]=n["words-name"]||"空间长度",i.options["extend-width"]=n["extend-width"]||0===n["extend-width"]?n["extend-width"]:10,i.options["extend-color"]=n["extend-color"]||"rgba(255,255,80,0.3)",i.options.show=!n.show&&!1!==n.show||n.show,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i._elms=[],n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.instruct=n.instruct||"",i.options.operatingPoint=n.operatingPoint||"",i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.operate={},i.nodePoints=[],i.unitNum=0,i.inputSpeed=n.speed&&100*Math.pow(n.speed,-1)||10,i.Dialog=o,!i.options.positions||i.options.positions.length<2)i._error="线段最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500});else{for(var s=0;s<i.options.positions.length;s++)i.options.positions[s].lng=Number(Number(i.options.positions[s].lng).toFixed(8)),i.options.positions[s].lat=Number(Number(i.options.positions[s].lat).toFixed(8)),i.options.positions[s].alt=Number(Number(i.options.positions[s].alt).toFixed(2));i.sdk.addIncetance(i.options.id,i),e.create(i)}return i}return sn()(e,t),_()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t||"#ff0000";var i=bh({},this.options);i.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,i),this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,1)"}});e._elms.color[i]=n}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.inputSpeed=0!==t?100*Math.pow(t,-1):0;var e=bh({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"dashSize",get:function(){return this.options.dashSize},set:function(t){this.options.dashSize=t;var e=bh({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"rotate",get:function(){return this.options.rotate},set:function(t){this.options.rotate=t,e.closeNodeEdit(this),this._elms.rotate&&this._elms.rotate.forEach((function(e){e.checked=t})),this.options.rotate=t,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,this.options)}},{key:"space",get:function(){return this.options.space},set:function(t){this.options.space=t;var e=bh({},this.options);e.speed=this.inputSpeed,this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,e)}},{key:"length",get:function(){return this.options.length},set:function(t){this.options.length=t,this._elms.length&&this._elms.length.forEach((function(e){e.value=t}))}},{key:"fitLength",get:function(){return this.options.fitLength},set:function(t){this.options.fitLength=t,this._elms.fitLength&&this._elms.fitLength.forEach((function(e){e.value=t}))}},{key:"lengthUnit",get:function(){return this.options["length-unit"]},set:function(t){if(this.unitNum++,this.options["length-unit"]=t,this._elms.lengthUnit&&this._elms.lengthUnit.forEach((function(e){e.value=t})),this.options.lengthByMeter)if(this.unitNum>2)switch(t){case"米":this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;break;case"千米":this.length=this.noseToTail?(this.options.fitLengthByMeter/1e3).toFixed(5):(this.options.lengthByMeter/1e3).toFixed(5);break;default:this.length=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter}else{var e=this.noseToTail?this.options.fitLengthByMeter:this.options.lengthByMeter;this.lengthUnit=e>1e3||1e3==e?"千米":"米"}}},{key:"wordsName",get:function(){return this.options["words-name"]},set:function(t){var e=this;this.options["words-name"]=t,this._elms.wordsName&&this._elms.wordsName.forEach((function(e){e.value=t}));var i=this;if(this.noseToTail)this.renewPositions(this.options.positions);else this.computeDistance(this.smoothHandle(this.options.positions),2,t).then((function(t){i.options.lengthByMeter=t,i.lengthUnit=e.options["length-unit"]}))}},{key:"fitLengthUnit",get:function(){return this.options["fit-length-unit"]},set:function(t){if(this.options["fit-length-unit"]=t,this._elms.fitLengthUnit&&this._elms.fitLengthUnit.forEach((function(e){e.value=t})),this.options.fitLengthByMeter)switch(t){case"米":this.fitLength=this.options.fitLengthByMeter;break;case"千米":this.fitLength=Number((this.options.fitLengthByMeter/1e3).toFixed(5));break;default:this.fitLength=this.options.fitLengthByMeter}}},{key:"lineWidth",get:function(){return this.options.width},set:function(t){var e=this;this.options.width=t||0==t?t:3,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.width})),this.entity&&this.entity.polyline&&(this.entity.polyline.width=this.options.width)}},{key:"lineType",get:function(){return this.options.type},set:function(t){var e=this,i=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}];this.options.type=Number(t);for(var n=function(n){if(i[n].key===Number(t))return e._elms.lineType&&e._elms.lineType.forEach((function(t){t.value=i[n].value,2<t.value&&t.value<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<t.value&&t.value<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"))})),1},o=0;o<i.length&&!n(o);o++);var s=bh({},this.options);s.speed=this.inputSpeed,this.entity&&this.entity.polyline&&(this.entity.polyline.material=this.getMaterial(this.options.color,this.options.type,this.entity,s))}},{key:"noseToTail",get:function(){return this.options["nose-to-tail"]},set:function(t){if(this.options["nose-to-tail"]=t,e.closeNodeEdit(this),this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t})),this.entity){var i=this.renewPositions(this.options.positions);this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),this.renewPolygon(i)}this.lengthUnit=this.options["length-unit"]}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.positionEditing=!1,this.options.heightMode=t||0==t?t:2;var n="";e.closeNodeEdit(this);var o=!1,s=!1,a=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a),this.renewPolygon(a),this.options.heightMode){case"0":case 0:this.entity.polyline.clampToGround=o,this.extend=!1,n="海拔高度";break;case"1":case 1:this.entity.polyline.clampToGround=o,this.extend=!1,n="相对地表";break;case"2":case 2:o=!0,s=!0,this.entity.polyline.clampToGround=o,n="依附模型"}this.lengthUnit=this.lengthUnit,this._elms.heightMode&&(this._elms.heightMode.value=n),this._elms.heightModeObject&&this._elms.heightModeObject.legp_searchActive(n),s?(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),this._elms.heightConfirm&&this._elms.heightConfirm.setAttribute("disabled","disabled")):(this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.heightConfirm&&this._elms.heightConfirm.removeAttribute("disabled")),setTimeout((function(){o?(i.label.ground=o,i._elms.heightMode&&(i._elms.heightMode.value="依附模型"),i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat]):(i.label.ground=o,i.label.position=[i.options.positions[0].lng,i.options.positions[0].lat,a[2]],i.options.label.position={lng:i.options.positions[0].lng,lat:i.options.positions[0].lat,alt:a[2]})}),0)}},{key:"extend",get:function(){return this.options.extend},set:function(t){if(this.options.extend=t,e.closeNodeEdit(this),t&&(this.heightMode=2),this._elms.extend&&this._elms.extend.forEach((function(e){e.checked=t})),this.entity)if(this.options.extend){var i=this.renewPositions(this.options.positions);this.renewPolygon(i)}else this.entity.polygon=void 0}},{key:"extendWidth",get:function(){return this.options["extend-width"]},set:function(t){this.options["extend-width"]=t,this._elms.extendWidth&&this._elms.extendWidth.forEach((function(e){e.value=t}));var e=this.renewPositions(this.options.positions);this.renewPolygon(e)}},{key:"extendColor",get:function(){return this.options["extend-color"]},set:function(t){var e=this;this.options["extend-color"]=t,this._elms.extendColor&&this._elms.extendColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.extendColor=t},clear:function(){e.extendColor="rgba(255,255,255,1)"}});e._elms.extendColor[i]=n})),this.entity&&this.entity.polygon&&(this.entity.polygon.material=Cesium.Color.fromCssColorString(this.options["extend-color"]))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t,this.show&&!this.showView||3==this.showView?(this.label.show=t,setTimeout((function(){e.label.position=[e.options.positions[0].lng,e.options.positions[0].lat,e.options.positions[0].alt]}),0)):this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=vh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=vh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"judgeLine",value:function(t,e){if(!t.polyline.oriRepeat){var i={color:e.color,image:this.getSourceRootPath()+"/img/arrow/1.png",space:e.space,speed:e.speed};i.speed=e.rotate?i.speed:0-i.speed;var n=document.createElement("canvas"),o=(n.getContext("2d"),new Image);o.src=i.image;var s=this;o.onload=function(){n.width=o.width*(i.space+1),n.height=o.height;var e=s.getSceenLine(t,i,n);e&&(t.polyline.oriRepeat=e);var a=t.polyline.positions.getValue(s.sdk.viewer.clock.currentTime);if(!Cesium.defined(a))return new Cesium.Cartesian2(1,1);for(var r=0,l=0;l<a.length-1;++l)r+=Cesium.Cartesian3.distance(a[l],a[l+1]);var c=r/t.polyline.width.getValue(),u=s.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=s.sdk.viewer.canvas.clientWidth,d=s.sdk.viewer.canvas.clientHeight;if(c*=s.sdk.viewer.scene.camera.getPixelSize(p,h,d)/u/(i.space*(n.width/n.height*5)+1),s.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D){var m=c/t.polyline.oriRepeat;t.polyline.oriSpeed=m,t.polyline.oriRepeatX=c}else{var f=Re().viewer.entities.getById(s.options.id);t.polyline.oriSpeed=f.polyline.oriSpeed,t.polyline.oriRepeatX=f.polyline.oriRepeatX}}}}},{key:"getSceenLine",value:function(t,e,i){var n=new Cesium.Cartesian2(0,this.sdk.viewer.canvas.clientHeight),o=new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth/2,this.sdk.viewer.canvas.clientHeight),s=this.sdk.viewer.camera.getPickRay(n),a=this.sdk.viewer.scene.globe.pick(s,this.sdk.viewer.scene),r=this.sdk.viewer.camera.getPickRay(o),l=this.sdk.viewer.scene.globe.pick(r,this.sdk.viewer.scene);if(a&&l){var c=Cesium.Cartesian3.distance(a,l)/t.polyline.width.getValue(),u=this.sdk.viewer.camera.positionCartographic.height,p=new Cesium.BoundingSphere(new Cesium.Cartesian3(-1e6,0,0),5e5),h=this.sdk.viewer.canvas.clientWidth,d=this.sdk.viewer.canvas.clientHeight,m=this.sdk.viewer.scene.camera.getPixelSize(p,h,d);return m>700?c*=m/u/(e.space*(i.width/i.height*5)+1):c=void 0,this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE3D?c:Re().viewer.entities.getById(this.options.id).polyline.oriRepeatX}}},{key:"edit",value:(l=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=32;break}return t.next=7,new rn(this.sdk,this.options,{title:"曲线属性",left:"180px",top:"100px",confirmCallBack:function(t){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.label.position[2]},h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),Pe(h.sdk,h.options.id),se(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack()},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack();for(var t=0;t<h.nodePoints.length;t++)h.sdk.viewer.entities.remove(h.nodePoints[t]);h.nodePoints=[],h.positionEditing=!1},showCallBack:function(t){h.options.show=t,h.originalOptions.show=t,h.show=t,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing},secondaryEditCallBack:function(){h.positionEditing=!1,h.noseToTail=!1,h.heightMode=0,e.nodeEdit(h)}});case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" polyline",(n=document.createElement("div")).innerHTML=ph(this),this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,new kn("polyline-object-edit-tabs",void 0,this.sdk),o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){h.color=t},clear:function(){h.color="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:n.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelColor=t},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:n.getElementsByClassName("extendColor")[0],size:"mini",alpha:!0,defaultColor:this.extendColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.extendColor=t},clear:function(){h.extendColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:n.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelLineColor=t},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorStart=t},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:n.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorEnd=t},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),p=n.getElementsByTagName("*"),fh.on(this,p),this._elms=fh.element,this._elms.color=[o],this._elms.labelColor=[s],this._elms.extendColor=[r],this._elms.labelLineColor=[l],this._elms.labelBackgroundColorStart=[c],this._elms.labelBackgroundColorEnd=[u],setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.cameraSelect&&h.cameraSelect(),h.goodsSelect&&h.goodsSelect();var t=h.attributeSelect,i=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(i){var o=Y(i,".attribute-select");o.legp_search(t);for(var s=h._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],a=0;a<t.length;a++)if(t[a].key===h.options.attributeType){s.value=t[a].value,o.legp_searchActive(t[a].value);break}s.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===s.value){h.attributeType=t[e].key;break}}))}var r=[{name:"空间长度",value:"空间长度"},{name:"投影长度",value:"投影长度"},{name:"地表长度",value:"地表长度"}],l=Y(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(l){l.legp_search(r);var c=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];h._elms.wordsName=[c],c.value=h.options["words-name"];for(var u=0;u<r.length;u++)if(r[u].value===c.value){l.legp_searchActive(r[u].value);break}c.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===c.value){h.wordsName=r[t].value;break}}))}var p=[{name:"米",value:"米"},{name:"千米",value:"千米"}],d=Y(h._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit",1);if(d){d.legp_search(p);var m=h._DialogObject._element.content.getElementsByClassName("input-select-unit")[1].getElementsByTagName("input")[0];h._elms.lengthUnit=[m],m.value=h.options["length-unit"];for(var f=0;f<p.length;f++)if(p[f].value===m.value){d.legp_searchActive(p[f].value);break}m.addEventListener("input",(function(){for(var t=0;t<p.length;t++)if(p[t].value===m.value){h.lengthUnit=p[t].value;break}}))}var v=[{name:'<i class="icon line"></i>实线',value:"实线",key:0,icon:"line"},{name:'<i class="icon dash-line"></i>虚线',value:"虚线",key:1,icon:"dash-line"},{name:'<i class="icon light-line"></i>泛光',value:"泛光",key:2,icon:"light-line"},{name:'<i class="icon tail-line"></i>尾迹光线',value:"尾迹光线",key:3,icon:"tail-line"},{name:'<i class="icon mult-tail-line"></i>多尾迹光线',value:"多尾迹光线",key:4,icon:"mult-tail-line"},{name:'<i class="icon flow-dash-line1"></i>流动虚线1',value:"流动虚线1",key:5,icon:"flow-dash-line1"},{name:'<i class="icon flow-dash-line2"></i>流动虚线2',value:"流动虚线2",key:6,icon:"flow-dash-line2"},{name:'<i class="icon pic-line1"></i>流动箭头1',value:"流动箭头1",key:7,icon:"pic-line1"},{name:'<i class="icon pic-line2"></i>流动箭头2',value:"流动箭头2",key:8,icon:"pic-line2"},{name:'<i class="icon pic-line3"></i>流动箭头3',value:"流动箭头3",key:9,icon:"pic-line3"},{name:'<i class="icon pic-line4"></i>流动箭头4',value:"流动箭头4",key:10,icon:"pic-line4"},{name:'<i class="icon pic-line5"></i>流动箭头5',value:"流动箭头5",key:11,icon:"pic-line5"},{name:'<i class="icon pic-line6"></i>流动箭头6',value:"流动箭头6",key:12,icon:"pic-line6"}],g=Y(h._DialogObject._element.content.getElementsByClassName("input-select-line-type-box")[0],".input-select-line-type");if(g){g.legp_search(v);var y=document.createElement("i");y.className="icon icon-active",h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByClassName("cy_datalist")[0].appendChild(y);var b=h._DialogObject._element.content.getElementsByClassName("input-select-line-type")[0].getElementsByTagName("input")[0];h._elms.lineType=[b];for(var C=0;C<v.length;C++)if(v[C].key===h.options.type){g.legp_searchActive(v[C].value),b.value=v[C].value,y.className="icon icon-active ".concat(v[C].icon);break}b.addEventListener("input",(function(){for(var t=0;t<v.length;t++)if(v[t].value===b.value){h.lineType=v[t].key,y.className="icon icon-active ".concat(v[t].icon),2<h.lineType&&h.lineType<13?document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="flex"):document.getElementById("dashTextureDom")&&(document.getElementById("dashTextureDom").style.display="none"),2<h.lineType&&h.lineType<5?(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="none"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="none")):(document.getElementsByClassName("lineSpace")[0]&&(document.getElementsByClassName("lineSpace")[0].style.display="flex"),document.getElementsByClassName("lineSpace")[1]&&(document.getElementsByClassName("lineSpace")[1].style.display="flex"));break}}))}var w=h._DialogObject._element.content.getElementsByClassName("height-box")[0],k=w.getElementsByClassName("height")[0],x=h._DialogObject._element.content.getElementsByClassName("height-confirm")[0];k.value=10,2==h.heightMode?(w&&(w.className="input-number input-number-unit-1 height-box disabled"),x&&x.setAttribute("disabled","disabled")):(w&&(w.className="input-number input-number-unit-1 height-box"),x&&x.removeAttribute("disabled"));var _=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],E=Y(h._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode");if(E){E.legp_search(_);for(var S=h._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],D=0;D<_.length;D++)if(_[D].key==h.heightMode){S.value=_[D].value,E.legp_searchActive(_[D].value);break}S.addEventListener("input",(function(){for(var t=0;t<_.length;t++)if(_[t].value===S.value){h.heightMode=_[t].key;break}})),k.addEventListener("input",(function(){h.heightMode})),h._elms.height=k,h._elms.heightBox=w,h._elms.heightMode=S,h._elms.heightConfirm=x,h._elms.heightModeObject=E,x.addEventListener("click",(function(){h.positionEditing=!1;for(var t=0;t<h.options.positions.length;t++)h.options.positions[t].alt=Number((h.options.positions[t].alt+Number(k.value)).toFixed(2)),h._elms.alt[t].innerHTML=h.options.positions[t].alt;var i=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(i),h.positionEditing=!1,e.closeNodeEdit(h)}))}var P=n.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];h._elms.lng=[],h._elms.lngInput=[],h._elms.lat=[],h._elms.latInput=[],h._elms.alt=[],h._elms.altInput=[];for(var M=function(t){var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td">'.concat(t+1,'</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ');var n=i.getElementsByClassName("lng")[0],o=document.createElement("span");o.innerHTML=h.options.positions[t].lng.toFixed(8),n.appendChild(o);var s=document.createElement("input");s.className="input",s.type="number",s.title="",s.min=-180,s.max=180,s.value=h.options.positions[t].lng.toFixed(8);var a=i.getElementsByClassName("lat")[0],r=document.createElement("span");r.innerHTML=h.options.positions[t].lat.toFixed(8),a.appendChild(r);var l=document.createElement("input");l.className="input",l.type="number",l.title="",l.min=-90,l.max=90,l.value=h.options.positions[t].lat.toFixed(8);var c=i.getElementsByClassName("alt")[0],u=document.createElement("span");u.innerHTML=h.options.positions[t].alt.toFixed(2),c.appendChild(u);var p=document.createElement("input");p.className="input",p.type="number",p.title="",p.min=-9999999,p.max=999999999,p.value=h.options.positions[t].alt.toFixed(2),n.addEventListener("dblclick",(function(){n.innerHTML="",s.value=Number(h.options.positions[t].lng.toFixed(8)),n.appendChild(s),s.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),s.addEventListener("blur",(function(){s.value=Number(h.options.positions[t].lng.toFixed(8)),n.innerHTML="",n.appendChild(o)})),s.addEventListener("input",(function(){h.options.positions[t].lng=Number(Number(s.value).toFixed(8)),o.innerHTML=h.options.positions[t].lng.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),a.addEventListener("dblclick",(function(){a.innerHTML="",l.value=Number(h.options.positions[t].lat.toFixed(8)),a.appendChild(l),l.focus(),h.positionEditing=!1,e.closeNodeEdit(h)})),l.addEventListener("blur",(function(){l.value=Number(h.options.positions[t].lat.toFixed(8)),a.innerHTML="",a.appendChild(r)})),l.addEventListener("input",(function(){h.options.positions[t].lat=Number(Number(l.value).toFixed(8)),r.innerHTML=h.options.positions[t].lat.toFixed(8);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),c.addEventListener("dblclick",(function(){2!=h.heightMode&&(c.innerHTML="",p.value=Number(h.options.positions[t].alt.toFixed(2)),c.appendChild(p),p.focus(),h.positionEditing=!1,e.closeNodeEdit(h))})),p.addEventListener("blur",(function(){p.value=Number(h.options.positions[t].alt.toFixed(2)),c.innerHTML="",c.appendChild(u)})),p.addEventListener("input",(function(){h.options.positions[t].alt=Number(Number(p.value).toFixed(2)),u.innerHTML=h.options.positions[t].alt.toFixed(2);var e=h.renewPositions(h.options.positions);h.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),h.label.position=[h.options.positions[0].lng,h.options.positions[0].lat,e[2]]})),h._elms.lng.push(o),h._elms.lngInput.push(s),h._elms.lat.push(r),h._elms.latInput.push(l),h._elms.alt.push(u),h._elms.altInput.push(p),P.appendChild(i)},O=0;O<h.options.positions.length;O++)M(O);var T=qn(),N=Y(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(N){N.legp_search(T);var B=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];B.value=T[h.labelFontFamily].value;for(var L=0;L<T.length;L++)if(T[L].value==B.value){N.legp_searchActive(T[L].value);break}B.addEventListener("input",(function(){for(var t=0;t<T.length;t++)if(T[t].value===B.value){h.labelFontFamily=T[t].key;break}})),h._elms.labelFontFamily=[B]}}),0),t.next=33;break;case 32:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 33:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"smoothHandle",value:function(t){for(var e=[],i=[],n=[],o=0;o<t.length;o++)n.push(t[o].lng,t[o].lat,t[o].alt),i.push(o/(t.length-1));for(var s=new Cesium.CatmullRomSpline({times:i,points:Cesium.Cartesian3.fromDegreesArrayHeights(n)}),a=20*t.length,r=0;r<=a;r++){var l=s.evaluate(r/a);e.push(this.cartesian3Towgs84(l,this.sdk.viewer))}return e}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i,n=JSON.parse(JSON.stringify(t));switch(this.heightMode){case 0:case"0":!1;break;case 1:case"1":for(var o=0;o<n.length;o++){var s=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n[o].lng,n[o].lat));n[o].alt=Number(s?(n[o].alt+Number(s)).toFixed(2):n[o].alt.toFixed(2))}!1;break;case 2:case"2":!0}var a=[];i=this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]?[].concat(L()(n),[n[0]]):L()(n),i=this.smoothHandle(i);for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat,i[r].alt);if(this.options["nose-to-tail"]&&"false"!==this.options["nose-to-tail"]||this.options.smooth&&"false"!==this.options.smooth){for(var l=[],c=0;c<a.length;c+=3)l.push({lng:a[c],lat:a[c+1],alt:a[c+2]});var u=this;this.computeDistance(l,2,this.options["words-name"]).then((function(t){u.options.fitLengthByMeter=t,u.lengthUnit=u.options["length-unit"]}))}else{var p=this;this.computeDistance(p.smoothHandle(n),2,this.options["words-name"]).then((function(t){p.options.fitLengthByMeter=t,p.lengthUnit=p.options["length-unit"]}))}var h=this;return this.computeDistance(this.smoothHandle(n),2,this.options["words-name"]).then((function(t){h.options.lengthByMeter=t,h.lengthUnit=e.options["length-unit"]})),a}}},{key:"renewPolygon",value:function(t){var e=[];if(this.options.extend&&"false"!==this.options.extend){for(var i=[],n=0;n<t.length;n+=3)e.push([t[n],t[n+1]]);for(var o=turf.lineString(e),s=turf.buffer(o,this.options["extend-width"]/1e3,{units:"kilometers"}),a=0;a<s.geometry.coordinates[0].length;a++)i.push(s.geometry.coordinates[0][a][0],s.geometry.coordinates[0][a][1]);for(var r=[],l=1;l<s.geometry.coordinates.length;l++){for(var c=[],u=0;u<s.geometry.coordinates[l].length;u++)c.push(s.geometry.coordinates[l][u][0],s.geometry.coordinates[l][u][1]);r.push({positions:Cesium.Cartesian3.fromDegreesArray(c)})}this.entity.polygon=new Cesium.PolygonGraphics({hierarchy:{positions:Cesium.Cartesian3.fromDegreesArray(i),holes:r},material:Cesium.Color.fromCssColorString(this.options["extend-color"])})}else this.entity.polygon=void 0}},{key:"reset",value:(r=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.entity){t.next=2;break}return t.abrupt("return");case 2:this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.lineWidth=this.originalOptions.width,this.lineType=this.originalOptions.type,this.noseToTail=this.originalOptions["nose-to-tail"],this.extend=this.originalOptions.extend,this.extendWidth=this.originalOptions["extend-width"],this.extendColor=this.originalOptions["extend-color"],this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.rotate=this.originalOptions.rotate,this.speed=this.originalOptions.speed,this.dashSize=this.originalOptions.dashSize,this.space=this.originalOptions.space,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.options.heightMode;case 36:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=y.length>0&&void 0!==y[0]?y[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ii(this.sdk),ni(this.sdk),pi(0),!this.options.customView){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=bh({},this.options.position):this.options.positions?l=bh({},this.options.positions[0]):this.options.center?l=bh({},this.options.center):this.options.start?l=bh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=43;break;case 25:c=[],t.t0=this.options.heightMode,t.next="0"===t.t0||0===t.t0?29:"1"===t.t0||1===t.t0?31:"2"===t.t0||2===t.t0?36:41;break;case 29:for(p=0;p<this.options.positions.length;p++)h=Cesium.Cartesian3.fromDegrees(this.options.positions[p].lng,this.options.positions[p].lat,this.options.positions[p].alt),c.push(h.x,h.y,h.z);return t.abrupt("break",41);case 31:return t.next=33,this.getClampToHeight(this.options.positions[0]);case 33:for(u=t.sent,d=0;d<this.options.positions.length;d++)m=Cesium.Cartesian3.fromDegrees(this.options.positions[d].lng,this.options.positions[d].lat,u+this.options.positions[d].alt),c.push(m.x,m.y,m.z);return t.abrupt("break",41);case 36:return t.next=38,this.getClampToHeight(this.options.positions[0]);case 38:for(u=t.sent,f=0;f<this.options.positions.length;f++)v=Cesium.Cartesian3.fromDegrees(this.options.positions[f].lng,this.options.positions[f].lat,u),c.push(v.x,v.y,v.z);return t.abrupt("break",41);case 41:g=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(g,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 43:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label&&this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var i=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity)if(this.operate.positionEditing=t,!0===t){e.closeNodeEdit(this),this.event&&this.event.destroy(),this.event=new X(this.sdk),this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1;var n=JSON.parse(JSON.stringify(this.options.positions)),o=this.renewPositions(this.options.positions);this.previous={positions:L()(this.options.positions)};for(var s=0;s<n.length;s++)n[s]=Cesium.Cartesian3.fromDegrees(n[s].lng,n[s].lat,n[s].alt);for(var a=n[Math.floor(n.length/2)],r=[],l=0;l<n.length;l++)r.push({x:a.x-n[l].x,y:a.y-n[l].y,z:a.z-n[l].z});var c=[],u=[];this.event.mouse_move((function(t,e){c=[],u=[];for(var n=0;n<r.length;n++){var s={x:e.x-r[n].x,y:e.y-r[n].y,z:e.z-r[n].z},a=i.cartesian3Towgs84(s,i.sdk.viewer);a.alt=i.options.positions[n].alt,c.push(s),u.push(a)}var l=u[0];o=i.renewPositions(u),i.label.position=[l.lng,l.lat,l.alt],i.options.label.position={lng:l.lng,lat:l.lat,alt:l.alt},i.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),c=[],u=[];for(var n=0;n<r.length;n++){var o={x:e.x-r[n].x,y:e.y-r[n].y,z:e.z-r[n].z},s=i.cartesian3Towgs84(o,i.sdk.viewer);s.alt=i.options.positions[n].alt,c.push(o),u.push(s)}for(var a=[],l=0;l<u.length;l++){var p=u[l];a.push(p),i._elms.lng&&(i._elms.lng[l].innerHTML=p.lng.toFixed(8)),i._elms.lngInput&&(i._elms.lngInput[l].value=p.lng.toFixed(8)),i._elms.lat&&(i._elms.lat[l].innerHTML=p.lat.toFixed(8)),i._elms.latInput&&(i._elms.latInput[l].value=p.lat.toFixed(8)),i._elms.alt&&(i._elms.alt[l].innerHTML=p.alt.toFixed(2)),i._elms.altInput&&(i._elms.altInput[l].value=p.alt.toFixed(2))}i.options.positions=a,i.previous.positions=a;var h=i.renewPositions(i.options.positions);i.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(h),i.renewPolygon(h),i.positionEditing=!1})),this.event.mouse_right((function(t,e){i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1})),this.event.gesture_pinck_start((function(t,e){var n=new Date;i.event.gesture_pinck_end((function(){var o=new Date,s={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};o-n>=500?(i.event.mouse_move((function(){})),i.event.mouse_left((function(){})),i.event.mouse_right((function(){})),i.positionEditing=!1):leftEvent(s,e)}))})),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(o)}),!1)}else{this.sdk&&this.sdk.viewer&&this.label&&this.label.entity||(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.destroy()),this.tip&&this.tip.destroy();var p=this.renewPositions(this.options.positions);switch(this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(p),this.renewPolygon(p),this.heightMode){case 0:case"0":case 1:case"1":this.label.position=[this.options.positions[0].lng,this.options.positions[0].lat,p[2]],this.options.label.position={lng:this.options.positions[0].lng,lat:this.options.positions[0].lat,alt:p[2]}}}}},{key:"setDIV",value:function(){var t,e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};i.x=i.x||0===i.x?i.x:10,i.y=i.y||0===i.y?i.y:10;for(var n=[],o=0;o<this.options.positions.length;o++)n.push([this.options.positions[o].lng,this.options.positions[o].lat]);var s=turf.lineString(n),a=turf.length(s,{units:"kilometers"}),r=turf.lineSliceAlong(s,0,a/2,{units:"kilometers"}),l=document.getElementById(i.domid),c=(t=Cesium.Cartesian3).fromDegrees.apply(t,L()(r.geometry.coordinates[r.geometry.coordinates.length-1]));this.sdk.viewer.scene.postRender.addEventListener((function(t){if("block"===l.style.display||""===l.style.display){var n=e.sdk.viewer.scene.cartesianToCanvasCoordinates(c);n&&(l.style.left=(n.x+i.x).toFixed(0)+"px",l.style.top=(n.y+i.y).toFixed(0)+"px")}}))}}],[{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=L()(e.sdk.viewer.entities.values),t.t0=e.options.heightMode,t.next="0"===t.t0||0===t.t0?4:"1"===t.t0||1===t.t0?7:"2"===t.t0||2===t.t0?14:19;break;case 4:return n=!1,i=e.options.positions[0].alt,t.abrupt("break",19);case 7:return n=!1,t.next=10,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},o);case 10:return t.t1=t.sent,t.t2=e.options.positions[0].alt,i=t.t1+t.t2,t.abrupt("break",19);case 14:return n=!0,t.next=17,e.getClampToHeight({lng:e.options.positions[0].lng,lat:e.options.positions[0].lat},o);case 17:return i=t.sent,t.abrupt("break",19);case 19:e.options.label.position||(e.options.label.position={lng:e.options.positions[0].lng,lat:e.options.positions[0].lat,alt:i}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:n});case 21:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"create",value:function(t){var i;i=2==t.heightMode;var n=t.options.positions,o=t.renewPositions(n);t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(o),width:t.options.width,clampToGround:i,zIndex:t.sdk._entityZIndex}}),t.entity.polyline.oriWidth=t.options.width,t.judgeLine(t.entity,t.options);var s=bh({},t.options);s.speed=t.inputSpeed,t.entity.polyline.material=t.getMaterial(t.options.color,t.options.type,t.entity,s),t.sdk._entityZIndex++,e.createLabel(t),t.renewPolygon(o),t.computeDistance(t.smoothHandle(n),2,t.options["words-name"]).then((function(e){t.options.lengthByMeter=e,t.lengthUnit=t.options["length-unit"],Pe(t.sdk,t.options.id)})),t.options.show&&Kt(0,t.options.id);t.sdk.viewer.scene}},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var i;e.closeNodeEdit(t),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.ControllerObject=new Jo(t.sdk),t.event.mouse_left((function(e,n){var o=t.sdk.viewer.scene.pick(e.position);o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&(i=o.id,t.ControllerObject.position=t.options.positions[i.index],t.ControllerObject.editTranslational(),t.tip&&t.tip.destroy(),t.ControllerObject.controllerCallBack=function(e){0===i.index&&(t.label.position=[e.position.lng,e.position.lat,e.position.alt],t.options.label.position={lng:e.position.lng,lat:e.position.lat,alt:e.position.alt}),t.options.positions[i.index]=e.position,t._elms.lng&&(t._elms.lng[i.index].innerHTML=e.position.lng.toFixed(8)),t._elms.lngInput&&(t._elms.lngInput[i.index].value=e.position.lng.toFixed(8)),t._elms.lat&&(t._elms.lat[i.index].innerHTML=e.position.lat.toFixed(8)),t._elms.latInput&&(t._elms.latInput[i.index].value=e.position.lat.toFixed(8)),t._elms.alt&&(t._elms.alt[i.index].innerHTML=e.position.alt.toFixed(2)),t._elms.altInput&&(t._elms.altInput[i.index].value=e.position.alt.toFixed(2)),i.position=Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt)})})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.ControllerObject.destroy();var o=t.renewPositions(t.options.positions);t.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(o)})),t.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){var e=t.renewPositions(t.options.positions);return Cesium.Cartesian3.fromDegreesArrayHeights(e)}),!1);for(var n=0;n<t.options.positions.length;n++){var o=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:n,position:Cesium.Cartesian3.fromDegrees(t.options.positions[n].lng,t.options.positions[n].lat,t.options.positions[n].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(o)}}}},{key:"closeNodeEdit",value:function(t){t.ControllerObject&&t.ControllerObject.destroy(),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[]}}]);var i,n,s,r,l}(Wn);function kh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function xh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?kh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):kh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _h(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Eh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=_h(this,e,[t,n])).viewer=t.viewer,i.options.show=!n.show&&!1!==n.show||n.show,i.options.name=i.options.name||"未命名对象",i.options.size=i.options.size||0===i.options.size?i.options.size:80,i.options.scaleByDistance=!n.scaleByDistance&&!1!==n.scaleByDistance||n.scaleByDistance,i.event=new X(i.sdk),i.Dialog=o,i.operate={},i._elms={},i._EventBinding=new wn,i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"Explosion"}},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=15;break}return t.next=6,new rn(this.sdk,this.options,{title:"爆炸属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="未命名对象"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),Pe(o.sdk,o.options.id),se(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},removeCallBack:function(){o.Dialog.removeCallBack&&o.Dialog.removeCallBack()},closeCallBack:function(){o.reset(),o.positionEditing=!1,o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.options.show=t,o.originalOptions.show=t,o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()},translationalCallBack:function(){o.positionEditing=!o.positionEditing}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" explosion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">随地图缩放</span>\n <input class="btn-switch" type="checkbox" @model="scaleByDistance">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">爆炸范围</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="999999" @model="size">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,this.scaleByDistance=this.options.scaleByDistance;case 15:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=xh({},this.options.position):this.options.positions?l=xh({},this.options.positions[0]):this.options.center?l=xh({},this.options.center):this.options.start?l=xh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt+8*this.options.size),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-85),roll:Cesium.Math.toRadians(0)}});case 24:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.previous=null,this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.size=this.originalOptions.size,this.scaleByDistance=this.originalOptions.scaleByDistance,this.lng=this.options.position.lng,this.lat=this.options.position.lat)}},{key:"scaleByDistance",get:function(){return this.options.scaleByDistance},set:function(t){this.options.scaleByDistance=t,this.entity.billboard.sizeInMeters=t,this._elms.scaleByDistance&&this._elms.scaleByDistance.forEach((function(e){e.checked=t}))}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position.alt=t,this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t}))}},{key:"size",get:function(){return this.options.size},set:function(t){this.options.size=t,this.entity.billboard.width=this.options.size,this.entity.billboard.height=this.options.size,this._elms.size&&this._elms.size.forEach((function(e){e.value=t}))}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&(this.operate.positionEditing=t,!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.previous={position:xh({},this.options.position)},this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.alt=n.alt,e.previous={position:xh({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.alt=t.alt,e.previous={position:xh({},e.options.position)},e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.previous&&(this.lng=this.previous.position.lng,this.lat=this.previous.position.lat,this.alt=this.previous.position.alt)))}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,Pe(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=[],i=10001;i<=10120;i++){var n=t.getSourceRootPath()+"/img/frameAnimation/explosion/b".concat(i,".png");e.push(n)}var o=new Cesium.Entity({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt)}),!1),billboard:{image:new Cesium.CallbackProperty((function(){var t=e[o.imgIndex];return o.imgIndex++,o.imgIndex>=e.length&&(o.imgIndex=0),t}),!1),disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),width:t.options.size,height:t.options.size,sizeInMeters:t.options.scaleByDistance,pixelOffset:{x:0,y:-20}}});o.imgIndex=0,t.entity=t.viewer.entities.add(o),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}}]);var i,n,s}(Wn);function Sh(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">扩散半径</span>\n <div class="input-number input-number-unit-2 input-radius">\n <input class="input" type="number" title="" data-min="0.1" max="999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <div class="input-radius-unit-box" style="flex: 0 0 60px;">\n <div class="input-radius-unit"></div>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n <span class="label">持续时间</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="100" max="99999" @model="duration">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <div class="row">\n <div class="col">\n <span class="label">范围颜色</span>\n <div class="colorOut"></div>\n </div>\n <div class="col">\n <span class="label">扫描颜色</span>\n <div class="colorIn"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <DIV-cy-tabs id="radar-scan-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n </div>\n <span class="custom-divider"></span>\n ')}function Dh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ph(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Dh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Dh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Mh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Oh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Oh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Oh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Th(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Nh=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Th(this,e,[t,i])).options.lng=i.lng,n.options.lat=i.lat,n.options.alt=i.alt,n.options.colorOut=i.colorOut||"rgba(255,255,0,0.3)",n.options.colorIn=i.colorIn||"rgba(255,0,0,0.3)",n.options.radius=i.radius||10,n.options.radius>999999&&(n.options.radius=999999),n.options.duration=i.duration||2e3,n.event=new X(n.sdk),n.options.positionEditin=!1,i.label=i.label||{},n.options.label={text:n.options.name,show:i.label.show||!1,position:i.label.position,fontSize:i.label.fontSize||0===i.label.fontSize?i.label.fontSize:20,fontFamily:i.label.fontFamily?i.label.fontFamily:0,color:i.label.color||"#ffffff",lineWidth:i.label.lineWidth||0===i.label.lineWidth?i.label.lineWidth:4,pixelOffset:i.label.pixelOffset||0===i.label.pixelOffset?i.label.pixelOffset:20,backgroundColor:i.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:i.label.lineColor||"#00ffff80",scaleByDistance:i.label.scaleByDistance||!1,near:i.label.near||0===i.label.near?i.label.near:2e3,far:i.label.far||0===i.label.far?i.label.far:1e5},n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.vr=n.options.attribute.vr||{},n.options.attribute.vr.content=n.options.attribute.vr.content||[],n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||{},n.options.attribute.camera=n.options.attribute.camera.content||[],n.options.attribute.ISC=n.options.attribute.ISC||{},n.options.attribute.ISC.content=n.options.attribute.ISC.content||[],n.options.attribute.goods=n.options.attribute.goods||{},n.options.attribute.goods.content=n.options.attribute.goods.content||[],n.options.attributeType=i.attributeType||"richText",n._elms={},n.Dialog=o,n._EventBinding=new wn,n.ControllerObject=new Jo(n.sdk),n.sdk.addIncetance(n.options.id,n),e.radarSolidScan(n),n}return sn()(e,t),_()(e,[{key:"type",get:function(){return"RadarScanStereoscopic"}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(t?(this.picking=!1,this.ControllerObject.position={lng:this.options.lng,lat:this.options.lat,alt:this.options.alt},this.ControllerObject.editTranslational(),this.ControllerObject.controllerCallBack=function(t){e.lng=t.position.lng,e.lat=t.position.lat,e.alt=t.position.alt}):(setTimeout((function(){e.picking=!0}),500),this.ControllerObject.destroy()))}},{key:"lng",get:function(){return this.options.lng},set:function(t){this.options.lng=Number(t),this.label.position=[t,this.lat,this.alt+this.radius],this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"lat",get:function(){return this.options.lat},set:function(t){this.options.lat=Number(t),this.label.position=[this.lng,t,this.alt+this.radius],this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"alt",get:function(){return this.options.alt},set:function(t){this.options.alt=Number(t),this.label.position=[this.lng,this.lat,t+this.radius],this._elms.alt&&this._elms.alt.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"radius",get:function(){return this.options.radius},set:function(t){var i=Number(t.toFixed(2));(i>999999&&(i=999999),i<.1&&(i=.1),this.options.radius=i,this.label.position=[this.lng,this.lat,this.alt+t],this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)&&("千米"===this._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value&&(i=Number((i/1e3).toFixed(5))));this._elms.radius&&this._elms.radius.forEach((function(t){t.value=i})),e.changeParam(this)}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t,this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t})),e.changeParam(this)}},{key:"colorOut",get:function(){return this.options.colorOut},set:function(t){var e=this;this.options.colorOut=t,this.entity.ellipsoid.material=Cesium.Color.fromCssColorString(t),this.entity.ellipsoid.outlineColor=Cesium.Color.fromCssColorString(t),this._elms.colorOut&&this._elms.colorOut.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorOut=t},clear:function(){e.colorOut="rgba(255,255,255,1)"}});e._elms.colorOut[n]=o}))}},{key:"colorIn",get:function(){return this.options.colorIn},set:function(t){var e=this;this.options.colorIn=t,this.entity.wall.material=Cesium.Color.fromCssColorString(t),this._elms.colorIn&&this._elms.colorIn.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.colorIn=t},clear:function(){e.colorIn="rgba(255,255,255,1)"}});e._elms.colorIn[n]=o}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"instruct",get:function(){return this.options.instruct},set:function(t){this.options.instruct=t,this._elms.instruct&&this._elms.instruct.forEach((function(e){e.value=t}))}},{key:"operatingPoint",get:function(){return this.options.operatingPoint},set:function(t){this.options.operatingPoint=t,this._elms.operatingPoint&&this._elms.operatingPoint.forEach((function(e){e.value=t}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeISC",get:function(){return this.options.attribute.ISC.content},set:function(t){this.options.attribute.ISC.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Mh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Mh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=36;break}return t.next=6,new rn(this.sdk,this.options,{title:"立体雷达扫描属性",left:"180px",top:"100px",confirmCallBack:function(t){h.name=h.name.trim(),h.name||(h.name="未命名对象"),h.options.label.position={lng:h.label.position[0],lat:h.label.position[1],alt:h.options.alt+h.options.radius},h.label.position=[h.options.label.position.lng,h.options.label.position.lat,h.options.label.position.alt],h.originalOptions=h.deepCopyObj(h.options),h._DialogObject.close(),h.Dialog.confirmCallBack&&h.Dialog.confirmCallBack(h.originalOptions),Pe(h.sdk,h.options.id),se(h.sdk,h.options.id)},resetCallBack:function(){h.reset(),h.Dialog.resetCallBack&&h.Dialog.resetCallBack()},removeCallBack:function(){h.Dialog.removeCallBack&&h.Dialog.removeCallBack(h.options)},closeCallBack:function(){h.reset(),h.Dialog.closeCallBack&&h.Dialog.closeCallBack(),h.positionEditing&&(h.positionEditing=!1),h.positionEditing=!1},showCallBack:function(t){h.options.show=t,h.originalOptions.show=t,h.show=t,h.Dialog.showCallBack&&h.Dialog.showCallBack()},translationalCallBack:function(){h.positionEditing=!h.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" radar-scan-stereoscopic",(i=document.createElement("div")).innerHTML=Sh(this),this._DialogObject.contentAppChild(i),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,this.attributeISC=this.options.attribute.ISC.content,new kn("radar-scan-edit-tabs",void 0,this.sdk),n=new YJColorPicker({el:i.getElementsByClassName("colorOut")[0],size:"mini",alpha:!0,defaultColor:this.colorOut,disabled:!1,openPickerAni:"opacity",sure:function(t){h.colorOut=t},clear:function(){h.colorOut="rgba(255,255,255,1)"}}),o=new YJColorPicker({el:i.getElementsByClassName("colorIn")[0],size:"mini",alpha:!0,defaultColor:this.colorIn,disabled:!1,openPickerAni:"opacity",sure:function(t){h.colorIn=t},clear:function(){h.colorIn="rgba(255,255,255,1)"}}),s=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelColor=t},clear:function(){h.labelColor="rgba(255,255,255,1)"}}),r=new YJColorPicker({el:i.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelLineColor=t},clear:function(){h.labelLineColor="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorStart=t},clear:function(){h.labelBackgroundColorStart="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:i.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){h.labelBackgroundColorEnd=t},clear:function(){h.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),u=i.getElementsByTagName("*"),this._EventBinding.on(this,u),this._elms=this._EventBinding.element,this._elms.colorOut=[n],this._elms.colorIn=[o],this._elms.labelColor=[s],this._elms.labelLineColor=[r],this._elms.labelBackgroundColorStart=[l],this._elms.labelBackgroundColorEnd=[c],(p=this._DialogObject._element.content.getElementsByClassName("input-radius")[0].getElementsByTagName("input")[0]).value=this.options.radius,this._elms.radius=[p],p.addEventListener("input",(function(t){var e=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||i<=Number(t.target.max)/("米"===e?1:1e3)&&i>=Number(t.target.min))&&(h.radius=i*("米"===e?1:1e3))}})),p.addEventListener("blur",(function(t){var e=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0].value;if(t.target.value||0===t.target.value){var i=t.target.value;i=Number(i),t.target.max&&i>Number(t.target.max)/("米"===e?1:1e3)&&(i=Number(t.target.max)/("米"===e?1:1e3)),t.target.min&&i<Number(t.target.min)&&(i=Number(t.target.min)),h.radius=Number((i*("米"===e?1:1e3)).toFixed(2))}})),setTimeout((function(){h.attributeLink=h.options.attribute.link.content,h.attributeVr=h.options.attribute.vr.content,h.ISCSelect&&h.ISCSelect(),h.goodsSelect&&h.goodsSelect(),h.cameraSelect&&h.cameraSelect();var t=h.attributeSelect,e=h._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=e.getElementsByTagName("input")[0],o=0;o<t.length;o++)if(t[o].key===h.options.attributeType){n.value=t[o].value,i.legp_searchActive(t[o].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){h.attributeType=t[e].key;break}}))}var s=[{name:"米",value:"米"},{name:"千米",value:"千米"}],a=h._DialogObject._element.content.getElementsByClassName("input-radius-unit-box")[0];if(a){Y(a,".input-radius-unit").legp_search(s);var r=h._DialogObject._element.content.getElementsByClassName("input-radius-unit")[0].getElementsByTagName("input")[0];r.value=s[0].value,r.addEventListener("input",(function(){var t=h._DialogObject._element.content.getElementsByClassName("input-radius")[0],e=t.getElementsByClassName("unit")[0],i=t.getElementsByClassName("input")[0];switch(r.value){case"米":"km"===e.innerHTML&&(e.innerHTML="m",i.value=Number((1e3*i.value).toFixed(2)));break;case"千米":"m"===e.innerHTML&&(e.innerHTML="km",i.value=Number((i.value/1e3).toFixed(5)))}}))}var l=qn(),c=Y(h._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(c){c.legp_search(l);var u=h._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];u.value=l[h.labelFontFamily].value;for(var p=0;p<l.length;p++)if(l[p].value==u.value){c.legp_searchActive(l[p].value);break}u.addEventListener("input",(function(){for(var t=0;t<l.length;t++)if(l[t].value===u.value){h.labelFontFamily=l[t].key;break}})),h._elms.labelFontFamily=[u]}}),0);case 36:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ph({},this.options.position):this.options.positions?l=Ph({},this.options.positions[0]):this.options.center?l=Ph({},this.options.center):this.options.start?l=Ph({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=27;break;case 23:return t.next=25,this.getClampToHeight({lng:this.options.lng,lat:this.options.lat});case 25:c=t.sent,this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,6*this.options.radius+c),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},duration:1});case 27:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.lng=this.originalOptions.lng,this.lat=this.originalOptions.lat,this.alt=this.originalOptions.alt,this.colorOut=this.originalOptions.colorOut,this.colorIn=this.originalOptions.colorIn,this.radius=this.originalOptions.radius,this.duration=this.originalOptions.duration,this.labelShow=this.originalOptions.label.show,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.instruct=this.originalOptions.instruct,this.operatingPoint=this.originalOptions.operatingPoint,this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.attributeISC=this.options.attribute.ISC.content,this.positionEditing=!1,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect())}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,Pe(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"instructSubmit",value:function(){this.Dialog.instructSubmit&&this.Dialog.instructSubmit(this.options.id,this.options.label.text,this.instruct),this.originalOptions.instruct=this.instruct}},{key:"operatingPointSubmit",value:function(){this.Dialog.operatingPointSubmit&&this.Dialog.operatingPointSubmit(this.options.id,this.options.label.text,this.operatingPoint),this.originalOptions.operatingPoint=this.operatingPoint}},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.lng,this.options.lat,this.options.alt+this.options.radius);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}}],[{key:"radarSolidScan",value:function(t){var i=t.sdk.viewer,n=t.options,o=(n.radius,n.lng,n.lat,n.alt,t.options.duration?360/t.options.duration*Cesium.getTimestamp():0),s=a(t.options,t.options.radius,o);(new Date).getTime();function a(t,e,i){var n=t.lng,o=t.lat,s=t.alt,a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(n,o,s)),r=e*Math.cos(i*Math.PI/180),l=e*Math.sin(i*Math.PI/180),c=Cesium.Cartesian3.fromElements(r,l,s),u=Cesium.Matrix4.multiplyByPoint(a,c,new Cesium.Cartesian3),p=Cesium.Cartographic.fromCartesian(u);return function(t,e,i,n,o){var s=[],a=[];s.push(t,e,o),a.push(o);for(var r=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(t,e),Cesium.Cartesian3.fromDegrees(i,n)),l=0;l<=90;l++){var c=r*Math.sin(l*Math.PI/180),u=Math.cos(l*Math.PI/180),p=(i-t)*u+t,h=(n-e)*u+e;s.push(p,h,c+o),a.push(o)}return{positionArr:s,bottomArr:a}}(n,o,Cesium.Math.toDegrees(p.longitude),Cesium.Math.toDegrees(p.latitude),s)}i.clock.onTick.addEventListener((function(){o=t.options.duration?360/t.options.duration*Cesium.getTimestamp():0,s=a(t.options,t.options.radius,o)})),t.entity=i.entities.add({id:t.options.id,show:t.options.show,position:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3.fromDegrees(t.options.lng,t.options.lat,t.options.alt)}),!1),ellipsoid:{radii:new Cesium.CallbackProperty((function(){return new Cesium.Cartesian3(t.options.radius,t.options.radius,t.options.radius)}),!1),material:Cesium.Color.fromCssColorString(n.colorOut),outline:!0,outlineColor:Cesium.Color.fromCssColorString(n.colorOut),outlineWidth:1,maximumCone:Cesium.Math.toRadians(90)},wall:{positions:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArrayHeights(s.positionArr)}),!1),material:Cesium.Color.fromCssColorString(n.colorIn),minimumHeights:new Cesium.CallbackProperty((function(){return s.bottomArr}),!1)}}),e.createLabel(t),Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.alt){t.next=4;break}i=e.options.alt+e.options.radius,t.next=8;break;case 4:return n=L()(e.sdk.viewer.entities.values),t.next=7,e.getClampToHeight({lng:e.options.lng,lat:e.options.lat},n);case 7:i=t.sent;case 8:e.options.label.position||(e.options.label.position={lng:e.options.lng,lat:e.options.lat,alt:i}),e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,ground:!1,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far});case 10:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"changeParam",value:function(t){}}]);var i,n,s,r}(Wn);function Bh(t){return'\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col" style="flex: 0 0 60%;">\n <div class="row">\n <div class="col input-select-unit-box">\n <span class="label" style="margin-right: 0px;">投影面积:</span>\n <input class="input input-text" readonly="readonly" type="text" @model="area">\n <div class="input-select-unit"></div>\n </div>\n </div>\n </div>\n </div>\n <div class="row">\n <DIV-cy-tabs id="circle-object-edit-tabs">\n <DIV-cy-tab-pane label="属性信息">\n '.concat(Ln(t),'\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="空间信息">\n <div class="row">\n <div class="col height-mode-box">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col">\n <span class="label">Z值统一增加</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n <button class="confirm height-confirm" style="margin-left: 5px;">确认</button>\n </div>\n </div>\n <div class="row">\n <div class="table spatial-info-table">\n <div class="table-head">\n <div class="tr">\n <div class="th"></div>\n <div class="th">经度(X)</div>\n <div class="th">纬度(Y)</div>\n <div class="th">高度(Z)</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="面风格">\n <div class="row">\n <div class="col">\n <span class="label">面颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">边线颜色</span>\n <div class="lineColor"></div>\n </div>\n <div class="col">\n <span class="label">边线宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="0" max="99" @model="lineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标注风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">标注开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col" style="flex: 0 0 114px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ','\n </DIV-cy-tab-pane>\n <DIV-cy-tab-pane label="标签风格">\n ').concat('\n <div class="row">\n <div class="col">\n <span class="label">引线颜色</span>\n <div class="labelLineColor"></div>\n </div>\n <div class="col">\n <span class="label">背景颜色</span>\n <div class="labelBackgroundColorStart" style="margin-right: 10px;"></div>\n <div class="labelBackgroundColorEnd"></div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">引线宽度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="999" @model="labelLineWidth">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">引线长度</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="999" @model="labelPixelOffset">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n ',"\n </DIV-cy-tab-pane>\n </DIV-cy-tabs>\n </div>\n ")}function Lh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ah(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ih(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ih(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ih(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Rh(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Fh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Rh(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(255, 0, 0, 0.5)",i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:2,i.options.semiMinorAxis=n.semiMinorAxis||0===n.semiMinorAxis?n.semiMinorAxis:10,i.options.semiMajorAxis=n.semiMajorAxis||0===n.semiMajorAxis?n.semiMajorAxis:20,i.options.show=!n.show&&!1!==n.show||n.show,i.options.center=n.center||{},i.options.line=n.line||{},i.options.line.width=i.options.line.width||0===i.options.line.width?i.options.line.width:3,i.options.line.color=i.options.line.color||"rgba(255, 0, 0, 1)",i.options["area-unit"]=n["area-unit"]||"平方米",n.label=n.label||{},i._elms={},i.options.label={text:i.options.name,show:n.label.show||!1,position:n.label.position,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attribute.vr=i.options.attribute.vr||{},i.options.attribute.vr.content=i.options.attribute.vr.content||[],i.options.attribute.camera=i.options.attribute.camera||{},i.options.attribute.camera.content=i.options.attribute.camera.content||[],i.options.attribute.goods=i.options.attribute.goods||{},i.options.attribute.goods.content=i.options.attribute.goods.content||[],i.options.attributeType=n.attributeType||"richText",i.event=new X(i.sdk),i.nodePoints=[],i.operate={},i.Dialog={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"SectorObject"}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var i=this;this.entity.polygon.hierarchy=[],setTimeout((function(){if(i.options.heightMode=t||0==t?t:2,i.positionEditing=!1,i.entity){var n="";e.closeNodeEdit(i);var o=!1,s=!1;switch(i.renewPositions(),i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.options.heightMode){case"0":case 0:n="海拔高度";break;case"1":case 1:n="相对地表";break;case"2":case 2:o=!0,s=!0,n="依附模型"}i.label.ground=o,i.entity.polyline.clampToGround=o,i.entity.polyline.arcType=o?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,i.entity.polygon.perPositionHeight=!o,i._elms.heightMode&&(i._elms.heightMode.value=n),i._elms.heightModeObject&&i._elms.heightModeObject.legp_searchActive(n),s?(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"),i._elms.heightConfirm&&i._elms.heightConfirm.setAttribute("disabled","disabled")):(i._elms.heightBox&&(i._elms.heightBox.className="input-number input-number-unit-1 height-box"),i._elms.heightConfirm&&i._elms.heightConfirm.removeAttribute("disabled"))}}),50)}},{key:"height",get:function(){return this.options.center.alt},set:function(t){var e,i=this;!t||isNaN(Number(t))?this.options.center.alt=0:this.options.center.alt=Number(Number(t).toFixed(2)),e=2==this.heightMode,this.renewPositions(),setTimeout((function(){i.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),i.entity.polygon.perPositionHeight=!e,i.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),i.entity.polyline.clampToGround=!!e,i.entity.polyline.arcType=e?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE}),0),this._elms.alt&&this._elms.alt.forEach((function(t){t.innerHTML=i.options.center.alt}))}},{key:"startAngle",get:function(){return this.options.startAngle},set:function(t){this.options.startAngle=t,this.height=this.height}},{key:"endAngle",get:function(){return this.options.endAngle},set:function(t){this.options.endAngle=t,this.height=this.height}},{key:"center",get:function(){return this.options.center},set:function(t){var e=this;this.options.center=t,this.height=this.height,this._elms.lng&&this._elms.lng.forEach((function(t){t.innerHTML=e.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.innerHTML=e.options.center.lat}))}},{key:"radius",get:function(){return this.options.radius},set:function(t){this.options.radius=t,this.height=this.height}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=Cesium.Color.fromCssColorString(this.options.color);2===this.sdk.viewer.scene.mode&&(i=new Cesium.CustomColorMaterialSource({color:this.options.color})),this.entity.polygon.material=i,this.entity.polyline.width=this.lineWidth,this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,0,0,0.5)"}});e._elms.color[i]=n}))}}},{key:"lineColor",get:function(){return this.options.line.color},set:function(t){var e=this;this.options.line.color=t||"rgba(255, 0, 0, 0.5)",this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polyline&&(this.entity.polyline.material=Cesium.Color.fromCssColorString(this.options.line.color),this._elms.lineColor&&this._elms.lineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.line.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.lineColor=t},clear:function(){e.lineColor="rgba(255,0,0,0.5)"}});e._elms.lineColor[i]=n})))}},{key:"lineWidth",get:function(){return this.options.line.width},set:function(t){var e=this;this.options.line.width=t||0===t?t:3,this.entity.polyline.width=this.options.line.width,this._elms.lineWidth&&this._elms.lineWidth.forEach((function(t){t.value=e.options.line.width}))}},{key:"area",get:function(){return this.options.area},set:function(t){this.options.area=t,this._elms.area&&this._elms.area.forEach((function(e){e.value=t}))}},{key:"areaUnit",get:function(){return this.options["area-unit"]},set:function(t){if(this.options["area-unit"]=t,this._elms.areaUnit&&this._elms.areaUnit.forEach((function(e){e.value=t})),this.options.areaByMeter)switch(t){case"平方米":this.area=this.options.areaByMeter;break;case"平方千米":this.area=Number((this.options.areaByMeter/1e6).toFixed(8));break;case"亩":this.area=Number((this.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":this.area=Number((this.options.areaByMeter/1e4).toFixed(6));break;default:this.area=this.options.areaByMeter}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.show&&!this.showView||3==this.showView?this.label.show=t:this.label.show=!1,this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label.color=t,this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label.fontSize=t,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label.scaleByDistance=t,this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label.near=e,this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label.far=e,this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"labelLineWidth",get:function(){return this.options.label.lineWidth},set:function(t){this.options.label.lineWidth=t,this.label.lineWidth=t,this._elms.labelLineWidth&&this._elms.labelLineWidth.forEach((function(e){e.value=t}))}},{key:"labelPixelOffset",get:function(){return this.options.label.pixelOffset},set:function(t){this.options.label.pixelOffset=t,this.label.pixelOffset=t,this._elms.labelPixelOffset&&this._elms.labelPixelOffset.forEach((function(e){e.value=t}))}},{key:"labelLineColor",get:function(){return this.options.label.lineColor},set:function(t){var e=this;this.options.label.lineColor=t,this.label.lineColor=t,this._elms.labelLineColor&&this._elms.labelLineColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelLineColor=t},clear:function(){e.labelLineColor="rgba(0,255,255,0.5)"}});e._elms.labelLineColor[i]=n}))}},{key:"labelBackgroundColorStart",get:function(){return this.options.label.backgroundColor[0]},set:function(t){var e=this;this.options.label.backgroundColor[0]=t,this.label.backgroundColor=[t,this.label.backgroundColor[1]],this._elms.labelBackgroundColorStart&&this._elms.labelBackgroundColorStart.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorStart=t},clear:function(){e.labelBackgroundColorStart="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorStart[i]=n}))}},{key:"labelBackgroundColorEnd",get:function(){return this.options.label.backgroundColor[1]},set:function(t){var e=this;this.options.label.backgroundColor[1]=t,this.label.backgroundColor=[this.label.backgroundColor[0],t],this._elms.labelBackgroundColorEnd&&this._elms.labelBackgroundColorEnd.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelBackgroundColorEnd=t},clear:function(){e.labelBackgroundColorEnd="rgba(255,255,255,1)"}});e._elms.labelBackgroundColorEnd[i]=n}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeCamera",get:function(){return this.options.attribute.camera.content},set:function(t){this.options.attribute.camera.content=t}},{key:"attributeVr",get:function(){return this.options.attribute.vr.content},set:function(t){var e=this;if(this.options.attribute.vr.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.vr.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.vr.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.vr.content[s].name+'</div>\n <div class="td">'+this.options.attribute.vr.content[s].url+'</div>\n <div class="td">\n <button @click="vrEdit">编辑</button>\n <button @click="vrDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={vrEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.vr.content;case 2:e.attributeVr=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-vr")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.vr.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=jh(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),vrDelete:function(t){e.options.attribute.vr.content.splice(t,1),e.attributeVr=e.options.attribute.vr.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.vr.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeVr=e.options.attribute.vr.content},cancelEdit:function(){e.attributeVr=e.options.attribute.vr.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jh(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"attributeGoods",get:function(){return this.options.attribute.goods.content},set:function(t){this.options.attribute.goods.content=t}},{key:"edit",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=59;break}return o=function(){var t=s.getElementsByClassName("spatial-info-table")[0].getElementsByClassName("table-body")[0];t.innerHTML="",n._elms.lng=[],n._elms.lngInput=[],n._elms.lat=[],n._elms.latInput=[],n._elms.alt=[],n._elms.altInput=[];var i=document.createElement("div");i.className="tr",i.innerHTML='\n <div class="td align-center">圆心坐标</div>\n <div class="td lng align-center"></div>\n <div class="td lat align-center"></div>\n <div class="td alt align-center"></div>\n ';var o=i.getElementsByClassName("lng")[0],a=document.createElement("span");a.innerHTML=n.options.center.lng.toFixed(8),o.appendChild(a);var r=document.createElement("input");r.className="input",r.type="number",r.title="",r.min=-180,r.max=180,r.value=n.options.center.lng.toFixed(8);var l=i.getElementsByClassName("lat")[0],c=document.createElement("span");c.innerHTML=n.options.center.lat.toFixed(8),l.appendChild(c);var u=document.createElement("input");u.className="input",u.type="number",u.title="",u.min=-90,u.max=90,u.value=n.options.center.lat.toFixed(8);var p=i.getElementsByClassName("alt")[0],h=document.createElement("span");h.innerHTML=n.height.toFixed(2),p.appendChild(h);var d=document.createElement("input");d.className="input",d.type="number",d.title="",d.min=-9999999,d.max=999999999,d.value=n.height.toFixed(2),o.addEventListener("dblclick",(function(){o.innerHTML="",r.value=Number(n.options.center.lng.toFixed(8)),o.appendChild(r),r.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),r.addEventListener("blur",(function(){r.value=Number(n.options.center.lng.toFixed(8)),o.innerHTML="",o.appendChild(a)})),r.addEventListener("input",(function(){n.options.center.lng=Number(Number(r.value).toFixed(8)),a.innerHTML=n.options.center.lng.toFixed(8),n.height=n.height})),l.addEventListener("dblclick",(function(){l.innerHTML="",u.value=Number(n.options.center.lat.toFixed(8)),l.appendChild(u),u.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode})),u.addEventListener("blur",(function(){u.value=Number(n.options.center.lat.toFixed(8)),l.innerHTML="",l.appendChild(c)})),u.addEventListener("input",(function(){n.options.center.lat=Number(Number(u.value).toFixed(8)),c.innerHTML=n.options.center.lat.toFixed(8),n.height=n.height})),p.addEventListener("dblclick",(function(){2!=n.heightMode&&(p.innerHTML="",d.value=Number(n.height.toFixed(2)),p.appendChild(d),d.focus(),n.operate.positionEditing&&(n.positionEditing=!1),e.closeNodeEdit(n),n.heightMode=n.heightMode)})),d.addEventListener("blur",(function(){d.value=Number(n.height.toFixed(2)),p.innerHTML="",p.appendChild(h)})),d.addEventListener("input",(function(){n.height=Number(Number(d.value).toFixed(2)),h.innerHTML=Number(n.height.toFixed(2))})),n._elms.lng.push(a),n._elms.lngInput.push(r),n._elms.lat.push(c),n._elms.latInput.push(u),n._elms.alt.push(h),n._elms.altInput.push(d),t.appendChild(i)},t.next=7,new rn(this.sdk,this.options,{title:"扇形属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.options.label.position={lng:w.label.position[0],lat:w.label.position[1],alt:w.label.position[2]},w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions),Pe(w.sdk,w.options.id),se(w.sdk,w.options.id)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.reset(),w.positionEditing=!1,w.Dialog.closeCallBack&&w.Dialog.closeCallBack()},showCallBack:function(t){w.options.show=t,w.originalOptions.show=t,w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},secondaryEditCallBack:function(){e.nodeEdit(w,(function(){o()}))}});case 7:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" circle",(s=document.createElement("div")).innerHTML=Bh(this),this._DialogObject.contentAppChild(s),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera.content,new kn("circle-object-edit-tabs",void 0,this.sdk),r=new YJColorPicker({el:s.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){w.color=t},clear:function(){w.color="rgba(255,255,255,1)"}}),l=new YJColorPicker({el:s.getElementsByClassName("lineColor")[0],size:"mini",alpha:!0,defaultColor:this.lineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.lineColor=t},clear:function(){w.lineColor="rgba(255,255,255,1)"}}),c=new YJColorPicker({el:s.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),u=new YJColorPicker({el:s.getElementsByClassName("labelLineColor")[0],size:"mini",alpha:!0,defaultColor:this.labelLineColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelLineColor=t},clear:function(){w.labelLineColor="rgba(255,255,255,1)"}}),p=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorStart")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorStart,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorStart=t},clear:function(){w.labelBackgroundColorStart="rgba(255,255,255,1)"}}),h=new YJColorPicker({el:s.getElementsByClassName("labelBackgroundColorEnd")[0],size:"mini",alpha:!0,defaultColor:this.labelBackgroundColorEnd,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelBackgroundColorEnd=t},clear:function(){w.labelBackgroundColorEnd="rgba(255,255,255,1)"}}),d=s.getElementsByTagName("*"),e.EventBinding(this,d),this._elms.color=[r],this._elms.lineColor=[l],this._elms.labelColor=[c],this._elms.labelLineColor=[u],this._elms.labelBackgroundColorStart=[p],this._elms.labelBackgroundColorEnd=[h],m=this._DialogObject._element.content.getElementsByClassName("height-box")[0],f=m.getElementsByClassName("height")[0],v=this._DialogObject._element.content.getElementsByClassName("height-confirm")[0],f.value=10,2==this.heightMode?(m&&(m.className="input-number input-number-unit-1 height-box disabled"),v&&v.setAttribute("disabled","disabled")):(m&&(m.className="input-number input-number-unit-1 height-box"),v&&v.removeAttribute("disabled")),g=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附模型",value:"依附模型",key:"2"}],!(y=Y(this._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=56;break}y.legp_search(g),b=this._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0],C=0;case 40:if(!(C<g.length)){t.next=48;break}if(g[C].key!=this.heightMode){t.next=45;break}return b.value=g[C].value,y.legp_searchActive(g[C].value),t.abrupt("break",48);case 45:C++,t.next=40;break;case 48:b.addEventListener("input",(function(){for(var t=0;t<g.length;t++)if(g[t].value===b.value){w.heightMode=g[t].key;break}})),f.addEventListener("input",(function(){w.heightMode})),this._elms.height=f,this._elms.heightBox=m,this._elms.heightMode=b,this._elms.heightConfirm=v,this._elms.heightModeObject=y,v.addEventListener("click",(function(){w.operate.positionEditing?(w.positionEditing=!1,w.height=w.height+Number(f.value)):(e.closeNodeEdit(w),w.heightMode=w.heightMode,setTimeout((function(){w.height=w.height+Number(f.value)}),100))}));case 56:setTimeout((function(){w.attributeLink=w.options.attribute.link.content,w.attributeVr=w.options.attribute.vr.content,w.cameraSelect&&w.cameraSelect(),w.goodsSelect&&w.goodsSelect();var t=w.attributeSelect,e=w._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0];if(e){var i=Y(e,".attribute-select");i.legp_search(t);for(var n=w._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],s=0;s<t.length;s++)if(t[s].key===w.options.attributeType){n.value=t[s].value,i.legp_searchActive(t[s].value);break}n.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===n.value){w.attributeType=t[e].key;break}}))}var a=[{name:"平方米",value:"平方米"},{name:"平方千米",value:"平方千米"},{name:"亩",value:"亩"},{name:"公顷",value:"公顷"}],r=Y(w._DialogObject._element.content.getElementsByClassName("input-select-unit-box")[0],".input-select-unit");if(r){r.legp_search(a);var l=w._DialogObject._element.content.getElementsByClassName("input-select-unit")[0].getElementsByTagName("input")[0];l.value=w.options["area-unit"];for(var c=0;c<a.length;c++)if(a[c].value===l.value){r.legp_searchActive(a[c].value);break}l.addEventListener("input",(function(){for(var t=0;t<a.length;t++)if(a[t].value===l.value){w.areaUnit=a[t].value;break}}))}var u=qn(),p=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(p){p.legp_search(u);var h=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];h.value=u[w.labelFontFamily].value;for(var d=0;d<u.length;d++)if(u[d].value==h.value){p.legp_searchActive(u[d].value);break}h.addEventListener("input",(function(){for(var t=0;t<u.length;t++)if(u[t].value===h.value){w.labelFontFamily=u[t].key;break}})),w._elms.labelFontFamily=[h]}o()}),0),t.next=60;break;case 59:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 60:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){var t=this;if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.name=this.originalOptions.name,this.radius=this.originalOptions.radius,this.color=this.originalOptions.color,this.area=this.originalOptions.area,this.areaUnit=this.originalOptions["area-unit"],this.labelShow=this.originalOptions.label.show,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelColor=this.originalOptions.label.color,this.lineWidth=this.originalOptions.line.width,this.lineLength=this.originalOptions.line.length,this.lineColor=this.originalOptions.line.color,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.attributeLink=this.options.attribute.link.content,this.attributeVr=this.options.attribute.vr.content,this.attributeCamera=this.options.attribute.camera.content,this.attributeGoods=this.options.attribute.goods.content,this.cameraSelect&&this.cameraSelect(),this.goodsSelect&&this.goodsSelect(),this.heightMode=this.originalOptions.heightMode,this._elms.lng&&this._elms.lng.forEach((function(e){e.innerHTML=t.options.center.lng})),this._elms.lat&&this._elms.lat.forEach((function(e){e.innerHTML=t.options.center.lat})),this._elms.alt&&this._elms.alt.forEach((function(e){e.innerHTML=t.options.center.alt}));for(var e=0;e<this.nodePoints.length;e++)this.sdk.viewer.entities.remove(this.nodePoints[e]);this.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.tip&&this.tip.destroy()}}},{key:"remove",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.label.remove(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,Pe(this.sdk,this.options.id);case 10:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"_addRr",value:function(){this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value?(this.options.attribute.vr.content.push({name:"全景图",url:this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("vr_add")[0].value="",this.attributeVr=this.options.attribute.vr.content):this.Dialog.clickAddVr&&this.Dialog.clickAddVr()}},{key:"addAttributeRr",value:function(t){this.options.attribute.vr.content.push({name:"全景图",url:t}),this.attributeVr=this.options.attribute.vr.content}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=E.length>0&&void 0!==E[0]?E[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!this.options.customView){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Ah({},this.options.position):this.options.positions?l=Ah({},this.options.positions[0]):this.options.center?l=Ah({},this.options.center):this.options.start?l=Ah({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=60;break;case 23:c=this.entity.polyline.positions.getValue(),u=[],p=0,h=this.cartesian3Towgs84(c[0],this.sdk.viewer),d=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,0),m=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,1e7),f=Cesium.Cartesian3.subtract(m,d,new Cesium.Cartesian3),v=Cesium.Cartesian3.normalize(f,f),g=new Cesium.Ray(d,v),y={},b=this.sdk.viewer.scene.drillPickFromRay(g),C=0;case 35:if(!(C<b.length)){t.next=42;break}if(!b[C].position){t.next=39;break}return y=b[C],t.abrupt("break",42);case 39:C++,t.next=35;break;case 42:if(!y||!y.position){t.next=46;break}p=this.cartesian3Towgs84(y.position,this.sdk.viewer).alt,t.next=55;break;case 46:return t.prev=46,t.next=49,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(h.lng,h.lat)]);case 49:w=t.sent,p=w[0].height,t.next=55;break;case 53:t.prev=53,t.t0=t.catch(46);case 55:for(k=Cesium.Cartesian3.fromDegrees(h.lng,h.lat,p),u.push(k.x,k.y,k.z),x=1;x<c.length;x++)u.push(c[x].x,c[x].y,c[x].z);_=Cesium.BoundingSphere.fromVertices(u),this.sdk.viewer.camera.flyToBoundingSphere(_,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 60:case"end":return t.stop()}}),t,this,[[46,53]])}))),function(){return n.apply(this,arguments)})},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"positionEditing",get:function(){return this.operate.positionEditing},set:function(t){var e=this;if(!YJ.Measure.GetMeasureStatus()&&this.sdk&&this.sdk.viewer&&this.entity&&this.entity.polygon){var i=this;this.operate.positionEditing=t,this.event&&this.event.destroy(),this.event=new X(this.sdk),!0===t?(this.previous={center:this.deepCopyObj(this.options.center)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.label&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,0.9)")),this.picking=!1,this.renewPositions(),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);n.alt=e.options.center.alt;var o=0,s=!1;switch(e.options.heightMode){case"0":case 0:s=!1;break;case"1":case 1:o=e.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(n.lng,n.lat))||0,s=!1;break;case"2":case 2:s=!0}var a=e.calSector(n,e.options.radius,e.options.startAngle,e.options.endAngle,360,!0),r=[];if(s){for(var l=0;l<a.length;l++)r.push(a[l].lng,a[l].lat);e.positions=Cesium.Cartesian3.fromDegreesArray(r),e.getClampToHeight({lng:n.lng,lat:n.lat}).then((function(t){e.label&&(e.label.position=[n.lng,n.lat,t])}))}else{for(var c=0;c<a.length;c++)r.push(a[c].lng,a[c].lat,n.alt+o);e.positions=Cesium.Cartesian3.fromDegreesArrayHeights(r),e.label&&(e.label.position=[n.lng,n.lat,n.alt+o])}e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=Number(n.lng.toFixed(8)),e.options.center.lat=Number(n.lat.toFixed(8)),e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.center.lng=t.lng,e.options.center.lat=t.lat,e.center=e.options.center,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.previous={center:e.deepCopyObj(e.options.center)},e.positionEditing=!1}}))})),this.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(i.positions)}),!1),this.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(i.positions),[i.positions[0],i.positions[1]])}),!1)):(this.previous||(this.previous={center:this.deepCopyObj(this.options.center)}),this.options.center=this.deepCopyObj(this.previous.center),this.label&&this.label.entity&&this.label.entity.billboard&&(this.label.entity.billboard.color=Cesium.Color.fromCssColorString("rgba(255,255,255,1)")),this.picking=!0,this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.destroy()),this.tip&&this.tip.destroy(),this.renewPositions(),this.entity.polygon.hierarchy=new Cesium.PolygonHierarchy(i.positions),this.entity.polyline.positions=[].concat(L()(i.positions),[i.positions[0],i.positions[1]]),this.previous=null)}}},{key:"setDIV",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{domid:"",x:10,y:10};e.x=e.x||0===e.x?e.x:10,e.y=e.y||0===e.y?e.y:10;var i=document.getElementById(e.domid),n=Cesium.Cartesian3.fromDegrees(this.options.center.lng,this.options.center.lat);this.sdk.viewer.scene.postRender.addEventListener((function(o){if("block"===i.style.display||""===i.style.display){var s=t.sdk.viewer.scene.cartesianToCanvasCoordinates(n);s&&(i.style.left=(s.x+e.x).toFixed(0)+"px",i.style.top=(s.y+e.y).toFixed(0)+"px")}}))}},{key:"renewPositions",value:function(t){var e=this;if(!this._error){var i=!1;t||(t=this.options.center);var n=0;switch(this.options.heightMode){case"0":case 0:i=!1;break;case"1":case 1:n=this.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.lng,t.lat))||0,i=!1;break;case"2":case 2:i=!0}var o=this.calSector(t,this.options.radius,this.options.startAngle,this.options.endAngle,360,!0),s=[];if(i){for(var a=0;a<o.length;a++)s.push(o[a].lng,o[a].lat);this.positions=Cesium.Cartesian3.fromDegreesArray(s),setTimeout((function(){e.getClampToHeight({lng:t.lng,lat:t.lat}).then((function(i){e.label&&(e.label.position=[t.lng,t.lat,i])}))}),100)}else{for(var r=0;r<o.length;r++)s.push(o[r].lng,o[r].lat,t.alt+n);this.positions=Cesium.Cartesian3.fromDegreesArrayHeights(s),this.label&&(this.label.position=[t.lng,t.lat,t.alt+n])}var l=this.options.endAngle-this.options.startAngle;return l<0&&(l=360+l),this.options.areaByMeter=Number((Cesium.Math.PI*this.options.radius*this.options.radius*(l/360)).toFixed(2)),this.areaUnit=this.areaUnit,o}}}],[{key:"create",value:function(t){var i=t.calSector(t.options.center,t.options.radius,t.options.startAngle,t.options.endAngle,360,!0),n=!0,o=0;switch(t.options.heightMode){case"0":case 0:n=!1;break;case"1":case 1:o=t.sdk.viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(t.options.center.lng,t.options.center.lat))||0,n=!1;break;case"2":case 2:n=!0}t.options.label.position||(t.options.label.position={lng:t.options.center.lng,lat:t.options.center.lat,alt:t.options.center.alt+o});var s=Cesium.Color.fromCssColorString(t.options.color);2===t.sdk.viewer.scene.mode&&(n=!1,s=new Cesium.CustomColorMaterialSource({color:t.options.color}));var a=[];if(t.options.label.ground=n,n){for(var r=0;r<i.length;r++)a.push(i[r].lng,i[r].lat);t.positions=Cesium.Cartesian3.fromDegreesArray(a)}else{for(var l=0;l<i.length;l++)a.push(i[l].lng,i[l].lat,t.options.center.alt+o);t.positions=Cesium.Cartesian3.fromDegreesArrayHeights(a)}t.entity=t.sdk.viewer.entities.add({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(t.positions),perPositionHeight:!n,material:s,zIndex:t.sdk._entityZIndex},polyline:{positions:[].concat(L()(t.positions),[t.positions[0],t.positions[1]]),width:t.options.line.width,material:Cesium.Color.fromCssColorString(t.options.line.color),clampToGround:!!n,arcType:n?Cesium.ArcType.GEODESIC:Cesium.ArcType.NONE,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,e.createLabel(t);var c=t.options.endAngle-t.options.startAngle;switch(c<0&&(c=360+c),t.options.areaByMeter=Number((Cesium.Math.PI*t.options.radius*t.options.radius*(c/360)).toFixed(2)),t.options["area-unit"]){case"平方米":t.options.area=t.options.areaByMeter;break;case"平方千米":t.options.area=Number((t.options.areaByMeter/1e6).toFixed(8));break;case"亩":t.options.area=Number((t.options.areaByMeter/666.6666667).toFixed(4));break;case"公顷":t.options.area=Number((t.options.areaByMeter/1e4).toFixed(6));break;default:t.options.area=t.options.areaByMeter}Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"createLabel",value:(i=o()(a.a.mark((function t(e){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.label=new no(e.sdk,{id:e.options.id,show:!!e.options.show&&e.options.label.show,position:[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset,backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far,ground:e.options.label.ground});case 1:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){if(t.positionEditing=!1,YJ.Measure.GetMeasureStatus());else{var e,i=function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}},n=function(){var e=o()(a.a.mark((function e(i,n){var o,s,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.cartesian3Towgs84(i,t.sdk.viewer),e.next=3,t.getClampToHeight(o);case 3:s=e.sent,r=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",type:n,position:Cesium.Cartesian3.fromDegrees(o.lng,o.lat,s),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t.nodePoints.push(r);case 6:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}();t.event&&t.event.destroy(),t.event=new X(t.sdk),YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个编辑点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];var s=t.calSector(t.options.center,t.options.radius,t.options.startAngle,t.options.endAngle),r=[],l=t.options.radius,c={angle1:t.options.startAngle,angle2:t.options.endAngle};t.entity.polyline.clampToGround=!0,t.entity.polyline.arcType=Cesium.ArcType.GEODESIC,t.entity.polygon.perPositionHeight=!1,t.entity.polygon.hierarchy=new Cesium.CallbackProperty((function(){return new Cesium.PolygonHierarchy(s)}),!1),t.entity.polyline.positions=new Cesium.CallbackProperty((function(){return[].concat(L()(s),[s[0],s[1]])}),!1);var u=t.entity.polyline.positions.getValue();r=[Ah({},t.center),t.cartesian3Towgs84(u[1],t.sdk.viewer),t.cartesian3Towgs84(u[u.length-4],t.sdk.viewer)];var p=L()(t.sdk.viewer.entities.values);t.getClampToHeight({lng:t.options.center.lng,lat:t.options.center.lat},p).then((function(e){t.label.position=[t.options.center.lng,t.options.center.lat,e]})),setTimeout((function(){n(u[1],"sector-start"),n(u[u.length-4],"sector-end"),t.event.mouse_left((function(i,n){if(e)t.options.startAngle=c.angle1,t.options.endAngle=c.angle2,t.options.radius=l,t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,e=null,YJ.Measure.SetMeasureStatus(!1),t.heightMode=t.heightMode;else{var o=t.sdk.viewer.scene.pick(i.position);if(o&&o.id&&o.id.name&&"node-secondary-edit-point"===o.id.name&&("sector-start"===o.id._type||"sector-end"===o.id._type)){t.tip.set_text("左键确认,右键取消"),e=o.id;for(var s=0;s<t.nodePoints.length;s++)t.sdk.viewer.entities.remove(t.nodePoints[s]);t.nodePoints=[]}}})),t.event.mouse_move((function(n,o){if(e){var a=t.cartesian3Towgs84(o,t.sdk.viewer);"sector-start"===e._type&&(r[1]=a),"sector-end"===e._type&&(r[2]=a),c=i(r);var u=Cesium.Cartesian3.fromDegrees(r[0].lng,r[0].lat,0),p=Cesium.Cartesian3.fromDegrees(a.lng,a.lat,0);l=Cesium.Cartesian3.distance(u,p),s=t.calSector(t.options.center,l,c.angle1,c.angle2)}t.tip.setPosition(o,n.endPosition.x,n.endPosition.y)})),t.event.mouse_right((function(e,i){for(var n=0;n<t.nodePoints.length;n++)t.sdk.viewer.entities.remove(t.nodePoints[n]);t.nodePoints=[],t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null,t.heightMode=t.heightMode}))}),200)}}},{key:"closeNodeEdit",value:function(t){YJ.Measure.SetMeasureStatus(!1),t.event&&t.event.destroy(),t.tip&&t.tip.destroy(),t.tip=null;for(var e=0;e<t.nodePoints.length;e++)t.sdk.viewer.entities.remove(t.nodePoints[e]);t.nodePoints=[],t.picking=!0}},{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=jh(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i,n,s,r}(Wn);function zh(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Hh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=zh(this,e,[t,n])).source=new Cesium.CustomDataSource(i.options.id),i.detail=[],i}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.source&&(this.source.show=t,this.options.show=t)}},{key:"setDefaultValue",value:function(){var t;this.options.id=this.options.id||Cesium.createGuid(),this.options.url=this.options.url||"",this.options.show=null===(t=this.options.show)||void 0===t||t}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=l.length>0&&void 0!==l[0]?l[0]:3,pi(0),ii(this.sdk),ni(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i,duration:e})):this.source&&this.viewer.flyTo(this.source,{duration:e});case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var t,i,n,o,s;(t=e,i="remove",n=this,o=3,s=ya()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.viewer.dataSources.remove(this.source),this.source=null}},{key:"on",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.show=this.options.show,t.next=3,Cesium.KmlDataSource.load(this.options.url,{camera:this.viewer.scene.camera,canvas:this.viewer.scene.canvas});case 3:return t.sent.entities.values.forEach((function(t,i){if(e.detail.push({name:t.name,id:t.id}),t.label){var n=1;t.billboard&&(n=t.billboard.scale._value),t.label.pixelOffset=new Cesium.Cartesian2(0,-32*n-15),t.label.horizontalOrigin=Cesium.HorizontalOrigin.CENTER,t.label.disableDepthTestDistance=Number.POSITIVE_INFINITY}if(t.polygon){var o={hierarchy:t.polygon.hierarchy.getValue().positions,material:t.polygon.material,classificationType:Cesium.ClassificationType.BOTH};if(t.polygon.outline.getValue()){var s=t.polygon.hierarchy.getValue().positions,a=new Cesium.Entity({id:e.getOutlineId(t.id),polyline:{positions:s,width:t.polygon.outlineWidth.getValue(),material:t.polygon.outlineColor.getValue(),clampToGround:!0,zIndex:e.sdk._entityZIndex}});e.source.entities.add(a)}t.polygon=o}t.billboard&&(t.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND),t.polyline&&(t.polyline={positions:t.polyline.positions.getValue(),material:t.polyline.material,clampToGround:!0,width:t.polyline.width?t.polyline.width.getValue():1}),t.show=!0,e.source.entities.add(t)})),t.next=7,this.viewer.dataSources.add(this.source);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getOutlineId",value:function(t){return[t,"outline"].join("_")}}]);var i,n}(Wn);function Vh(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Gh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Vh(this,e,[t,n])).primitive=void 0,i.positions=[],i.loading=!0,i}return sn()(e,t),_()(e,[{key:"setDefaultValue",value:function(){var t,i,n,o,s;(t=e,i="setDefaultValue",n=this,o=3,s=ya()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),this.options.host=this.options.host||h(),this.options.color=this.options.color||"rgb(239, 6, 6, 1)",this.options.width=this.options.width||1}},{key:"show",get:function(){return this.options.show},set:function(t){if(this.options.show=t,this.entity)for(var e=0;e<this.entity.entities.values.length;e++)this.entity.entities.values[e].show=t}},{key:"on",value:(n=o()(a.a.mark((function t(){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",i=(i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/data/service/getFile":this.options.host+"/yjearth4.0/data/service/getFile")+"?path="+encodeURIComponent(this.options.url),t.next=5,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:return n=t.sent,t.next=8,n.json();case 8:return o=t.sent,this.geojson=o,t.abrupt("return",e.addDataToGlobe(this,o.features));case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){var t=this;this.entity&&(this.entity.entities.values.forEach((function(e){t.sdk.viewer.entities.remove(e)})),this.entity=null,this.geojson={})}},{key:"flyTo",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading){t.next=24;break}if(!this.geojson){t.next=24;break}if(pi(0),ii(this.sdk),ni(this.sdk),e=turf.bbox(this.geojson),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}return i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:e[0],lat:e[1]},t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent,n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=24;break;case 23:this.viewer.camera.flyTo({destination:(c=Cesium.Rectangle).fromDegrees.apply(c,L()(e))});case 24:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"addDataToGlobe",value:function(t){for(var e=new Cesium.GeoJsonDataSource,i=t.deepCopyObj(t.geojson),n=0;n<i.features.length;n++)i.features[n].id||(i.features[n].id=t.options.id+"_"+n);return e.load(i,{clampToGround:!0}).then((function(e){t.entity=e,e.entities.values.forEach((function(e){var i=Cesium.Color.fromCssColorString(t.options.color),n=i.withAlpha(.2);e.show=t.options.show,t.sdk.viewer.entities.add(e),e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:i,pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),e.polyline&&(e.polyline.material=i,e.polyline.zIndex=t.sdk._entityZIndex,t.sdk._entityZIndex++),e.polygon&&(e.polygon.perPositionHeight=!1,e.polygon.material=n,e.polygon.zIndex=t.sdk._entityZIndex,e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:i,zIndex:t.sdk._entityZIndex}),t.sdk._entityZIndex++)})),t.loading=!1}))}}]);var i,n}(Wn);function Uh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Wh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Uh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Uh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Yh(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Jh=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Yh(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.color=n.color||"rgba(32,67,135,0.5)",i.options.positions=n.positions||[],i.options.frequency=n.frequency||10,i.options.animationSpeed=n.animationSpeed||1,i.options.amplitude=n.amplitude||10,i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new wn,i._elms={},i.sdk.addIncetance(i.options.id,i),e.create(i),i}return sn()(e,t),_()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity&&(this.entity.appearance.material.uniforms.baseWaterColor=Cesium.Color.fromCssColorString(t)),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"frequency",get:function(){return this.options.frequency},set:function(t){this.options.frequency=t,this.entity&&(this.entity.appearance.material.uniforms.frequency=10*t),this._elms.frequency&&this._elms.frequency.forEach((function(e){e.value=t}))}},{key:"animationSpeed",get:function(){return this.options.animationSpeed},set:function(t){this.options.animationSpeed=t,this.entity&&(this.entity.appearance.material.uniforms.animationSpeed=.01*t),this._elms.animationSpeed&&this._elms.animationSpeed.forEach((function(e){e.value=t}))}},{key:"amplitude",get:function(){return this.options.amplitude},set:function(t){this.options.amplitude=t,this.entity&&(this.entity.appearance.material.uniforms.amplitude=t),this._elms.amplitude&&this._elms.amplitude.forEach((function(e){e.value=t}))}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t;var e=this.options.positions[0],i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,t),n=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,this.entity.originalHeight);this.entity.modelMatrix=Cesium.Matrix4.setTranslation(this.entity.modelMatrix,new Cesium.Cartesian3(i.x-n.x,i.y-n.y,i.z-n.z),new Cesium.Matrix4),this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=19;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"水面属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Pe(s.sdk,s.options.id),se(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" water-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="water-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面振幅</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="amplitude">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">动画速度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="10" min="0" step="0.1" @model="animationSpeed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">水面频率</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="100" min="0" step="1" @model="frequency">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("water-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],t.next=19;break;case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.name=this.originalOptions.name,this.color=this.originalOptions.color,this.frequency=this.originalOptions.frequency,this.animationSpeed=this.originalOptions.animationSpeed,this.amplitude=this.originalOptions.amplitude,this.height=this.originalOptions.height)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=d.length>0&&void 0!==d[0]?d[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Wh({},this.options.position):this.options.positions?l=Wh({},this.options.positions[0]):this.options.center?l=Wh({},this.options.center):this.options.start?l=Wh({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=28;break;case 23:c=Cesium.Rectangle.fromCartesianArray(this.entity.geometryInstances.geometry._polygonHierarchy.positions),u=this.sdk.viewer.camera.getRectangleCameraCoordinates(c),p=this.cartesian3Towgs84(u,this.sdk.viewer),h=Cesium.Cartesian3.fromDegrees(p.lng,p.lat,p.alt+this.height),this.sdk.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:h});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sdk.viewer.scene.primitives.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=5,this.sdk.removeIncetance(this.options.id);case 5:return t.next=7,Pe(this.sdk,this.options.id);case 7:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){for(var e=t.options.positions,i=[],n=e[0].alt,o=0;o<e.length;o++)i.push(e[o].lng,e[o].lat),n<e[o].alt&&(n=e[o].alt);t.options.height||0===t.options.height||(t.options.height=n),t.entity=t.sdk.viewer.scene.primitives.add(new Cesium.Primitive({id:t.options.id,show:t.options.show,asynchronous:!1,releaseGeometryInstances:!1,geometryInstances:new Cesium.GeometryInstance({name:"water-surface",geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:t.options.height})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGroud:!0,material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:Cesium.Color.fromCssColorString(t.options.color),normalMap:t.getSourceRootPath()+"/img/water.png",frequency:10*t.options.frequency,animationSpeed:.01*t.options.animationSpeed,amplitude:t.options.amplitude}}})})})),t.entity.id=t.options.id,t.entity.originalHeight=t.options.height,Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}}]);var i,n,s}(Wn);function qh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Xh(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Xh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Xh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Zh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Kh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zh(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $h(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Qh(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function td(t,e,i){return t.set(id(t,e),i),i}function ed(t,e){return t.get(id(t,e))}function id(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var nd=new WeakMap,od=new WeakMap,sd=new WeakMap,ad=new WeakMap,rd=new WeakMap,ld=new WeakMap,cd=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Qh(i=$h(this,e,[t,n]),nd,null),Qh(i,od,!1),Qh(i,sd,void 0),Qh(i,ad,void 0),Qh(i,rd,void 0),Qh(i,ld,void 0),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.speed<=0&&(i.options.speed=.01),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.model=n.model=n.model||{},i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.height=Number(i.options.height.toFixed(2)),i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.model.show=!n.model.show&&!1!==n.model.show||n.model.show,i.options.model.url=n.model.url||"",i.options.model.pixelSize=n.model.pixelSize||70,i.options.model.heading=n.model.heading||0,i.options.model.pitch=n.model.pitch||0,i.options.model.roll=n.model.roll||0,i.options.model.scale=n.model.scale||0===n.model.scale?n.model.scale:1,i.options.model.animate=n.model.animate||"无",i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.unitFuelConsumption=n.unitFuelConsumption||0,i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i.distance,n.label=n.label||{},i.options.label={text:i.options.name,show:n.label.show||!1,fontSize:n.label.fontSize||0===n.label.fontSize?n.label.fontSize:20,fontFamily:n.label.fontFamily?n.label.fontFamily:0,color:n.label.color||"#ffffff",lineWidth:n.label.lineWidth||0===n.label.lineWidth?n.label.lineWidth:4,pixelOffset:n.label.pixelOffset||0===n.label.pixelOffset?n.label.pixelOffset:20,backgroundColor:n.label.backgroundColor||["#00ffff80","#00ffff80"],lineColor:n.label.lineColor||"#00ffff80",scaleByDistance:n.label.scaleByDistance||!1,near:n.label.near||0===n.label.near?n.label.near:2e3,far:n.label.far||0===n.label.far?n.label.far:1e5},i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.sdk.addIncetance(i.options.id,i),i.ControllerObject=new Jo(i.sdk),i._EventBinding=new wn,i.options.viewFollow=!1,i.options.firstPersonView=!1,e.addLine(i),i.firstPersonView=!1),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"TrajectoryMotion"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){var e=Ie();if(this.isShowView&&e||(this.options.show=t,this.originalOptions&&(this.originalOptions.show=t)),this.options.show){this.firstPersonView?this.model.show=!1:this.model.show=(!this.showView||3==this.showView||!e)&&this.modelShow,this.showView&&3!=this.showView&&e?this.line.polyline.material=new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20}):this.line.polyline.material=this.lineShow?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=(!this.showView||3==this.showView||!e)&&this.keyPointShow;this.realTimeRoute&&this.realTimeLine&&(this.realTimeLine.show=!this.showView||3==this.showView||!e),this.label&&(this.label.show=(!this.showView||3==this.showView)&&this.options.label.show),this.fuelLabel&&(this.fuelLabel.show=(!this.showView||3==this.showView)&&this.options.fuelShow)}else{this.model.show=(!this.showView||3==this.showView||!e)&&this.options.show;var n=this.options.show;n=(!this.showView||3==this.showView||!e)&&this.options.show,this.realTimeLine&&(this.realTimeLine.show=!1),this.line.polyline.material=n?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20});for(var o=0;o<this.keyPoints.length;o++)this.keyPoints[o].show=(!this.showView||3==this.showView)&&n;this.label&&(this.label.show=!1),this.fuelLabel&&(this.fuelLabel.show=!1),this.viewFollow=!1}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t),Pe(this.sdk,this.options.id),se(this.sdk,this.options.id),this.isShowView=!1}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(t){var e=this;if(!this.ground){var i=this.options.height-Number(t.toFixed(2));if(this.options.height=Number(t.toFixed(2)),this.line)if(this.ground);else{var n=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var o=0;o<this.keyPoints.length;o++)this.options.line.positions[o].alt+=n,this.keyPoints[o].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[o].lng,this.options.line.positions[o].lat,this.options.line.positions[o].alt)}if(this.model&&this.model.position){var s=this.model.heading,a=this.model.pitch,r=this.model.roll;if(isNaN(s)||isNaN(a)||isNaN(r))return;var l=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position);Cesium.Matrix4.multiplyByTranslation(l,new Cesium.Cartesian3(0,0,-i),l),Cesium.Matrix4.getTranslation(l,this.model.position),Cesium.Matrix4.multiplyByMatrix3(l,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(s,a,r)),this.entity.modelMatrix),this.label&&(this.label.show=this.label.show),this.fuelLabel&&(this.fuelLabel.show=this.fuelLabel.show),this.options.label.position&&setTimeout((function(){e.options.label.position.alt?(e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]),e.fuelLabel&&(e.fuelLabel.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt])):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,t]),e.fuelLabel&&(e.fuelLabel.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)}var c=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=c,this._elms.height&&this._elms.height.forEach((function(e){e.value=Number(t.toFixed(2))}))}}},{key:"ground",get:function(){return this.options.ground},set:function(t){var e=this;if(this.lineEdit=!1,this.options.ground=t,this.realTimeLine.polyline.clampToGround=t,this.height=this.options.height,this.line&&t){this.line.polyline.clampToGround=!0;for(var i=function(t){e.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(e.options.line.positions[t].lng,e.options.line.positions[t].lat)]).then((function(i){e.keyPoints[t].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}setTimeout((function(){e.TweenAnimate&&e.TweenAnimate._isPlaying?e.setMovePositionByDistance(e.TweenAnimate._object.distance):e.setMovePositionByDistance(0)}),200),t?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),this._elms.ground&&this._elms.ground.forEach((function(e){e.checked=t}))}},{key:"modelPixelSize",get:function(){return this.options.model.pixelSize},set:function(t){this.options.model.pixelSize=t,this.model&&(this.model.minimumPixelSize=t),this._elms.modelPixelSize&&this._elms.modelPixelSize.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.model.scale},set:function(t){this.options.model.scale=Number(t),this.model&&(this.model.scale=t,this.model.customScale={x:this.options.model.scale,y:this.options.model.scale,z:this.options.model.scale}),this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){t<=0&&(t=.01),this.options.speed=t,this.state&&this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(t){this.lineEdit=!1,this.options.line.smooth=t;var e=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=e,this.model.position=e[0],this.modelMove(e),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t}))}},{key:"delay",get:function(){return this.options.delay},set:function(t){this.options.delay=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(e){e.value=t}))}},{key:"state",get:function(){return this.options.state},set:function(t){var e=this;if(this.options.state=t,cancelAnimationFrame(ed(sd,this)),this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),this.TweenAnimate&&this.TweenAnimate._isPlaying)if(clearTimeout(this.TweenAnimate.timeout),t)this.lineEdit=!1,this.TweenAnimate.isPlaying()?this.TweenAnimate.timeout=setTimeout((function(){e.TweenAnimate.resume()}),this.options.delay):this.TweenAnimate.delay(this.delay).start(),this.speed=this.speed;else{var i=Kh({},this.sdk.viewer.camera._position),n=this;td(sd,this,requestAnimationFrame((function t(){n.firstPersonView&&n.sdk.viewer.camera.setView({destination:Kh({},i),orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}),td(sd,n,requestAnimationFrame(t))}))),this.TweenAnimate.pause(),setTimeout((function(){n.model&&(n.model.isMove=!1)}),200)}else if(t){var o=this.renewLinePositions(this.options.line.positions);this.modelMove(o)}this._elms.state&&this._elms.state.forEach((function(e){e.checked=t}))}},{key:"modelShow",get:function(){return this.options.model.show},set:function(t){var e=Ie();this.options.model.show=t;var i=t;i=!(!this.show||this.showView&&3!=this.showView&&e)&&t,this.model&&this.show&&(this.model.show=i),this._elms.modelShow&&this._elms.modelShow.forEach((function(e){e.checked=t}))}},{key:"modelAnimate",get:function(){return this.options.model.animate},set:function(t){if(this.options.model.animate=t,this.model&&this.model.loader.components){var e=this.model.loader.components.animations;if(this.model.activeAnimations.removeAll(),e&&e.length>0)for(var i=0;i<e.length;i++)if(e[i].name==t){this.model.activeAnimations.add({index:i,loop:Cesium.ModelAnimationLoop.REPEAT,speedup:1,reverse:!1});break}this._elms.modelAnimate&&this._elms.modelAnimate.forEach((function(e){e.value=t}))}}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(t){this.lineEdit=!1,this.options.line.noseToTail=t;for(var e=[],i=0;i<this.options.line.positions.length;i++)e.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(e);if(this.line){var n=this.renewLinePositions(this.options.line.positions);this.line.polyline.positions=n,this.model.position=n[0],this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(t){t&&(this.realTimeRoute=!1),this.options.line.show=t;var e=t,i=Ie();e=(!this.showView||3==this.showView||!i)&&t,this.line&&this.show&&(this.line.polyline.material=e?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20})),this._elms.lineShow&&this._elms.lineShow.forEach((function(e){e.checked=t}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(t){t&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=t,this.realTimeLine&&this.show&&(this.realTimeLine.show=t),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(e){e.checked=t}))}},{key:"keyPointShow",get:function(){return this.options.line.keyPoint},set:function(t){this.options.line.keyPoint=t;for(var e=0;e<this.keyPoints.length;e++)this.show&&(this.keyPoints[e].show=t);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(e){e.checked=t})),!t&&this.lineEdit&&(td(od,this,t),YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t})))}},{key:"lineEdit",get:function(){return ed(od,this)},set:function(t){var e=this,i=[],n=function(t){i=e.renewLinePositions(t),e.model.position=i[0],e.modelMove(i)};if(t){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=new Z("请选择一个顶点,右键取消",this.sdk),this.event=new X(this.sdk),n(L()(this.options.line.positions));var s=function(t,i){var s=e.sdk.viewer.scene.pick(t.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<e.keyPoints.length;a++)if(e.keyPoints[a].id===s.id.id){o=s.id,e.ControllerObject.position=e.options.line.positions[o.index],e.ControllerObject.editTranslational(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.controllerCallBack=function(t){e.options.line.positions[o.index]=t.position,0===o.index&&(e.options.height=e.options.line.positions[o.index].alt,e._elms.height&&e._elms.height.forEach((function(t){t.value=Number(e.options.height.toFixed(2))}))),o.position=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n(L()(e.options.line.positions))};break}};this.event.mouse_left(s),this.event.mouse_right((function(t,i){e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()})),this.event.mouse_move((function(t,i){e.tip&&e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(t,i){var n=new Date,o={position:{x:(t.position1.x+t.position2.x)/2,y:(t.position1.y+t.position2.y)/2}};e.event.gesture_pinck_end((function(){new Date-n>=500?(e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()):s(o)}))})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=t}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=t,this.ControllerObject.destroy();td(od,this,t),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(t){this.options.routeDirection=t,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(e){e.checked=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&(t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat()),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(t){var e=this,i=Ie(),n=ae();if((Ie()||n.sdkD||!this.show)&&(t=!1),cancelAnimationFrame(ed(sd,this)),ed(ld,this)&&ed(ld,this).destroy(),this.sdk.viewer._firstPersonView=t,this.options.firstPersonView=t,this.options.firstPersonView){if(this.viewFollow=!0,this.firstPersonHeadingPitch={heading:0,pitch:-10},this.state=!0,this.model&&(this.model.show=!1),this._DialogObject&&this._DialogObject._element.content){var o=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");o[0].className="btn is-active",o[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),Ke(this.sdk,!1);var s,a=ae(),r=(s=this.sdk===a.sdkP?a.sdkD:a.sdkP)?s.entityMap.get(this.options.id):void 0;this.sdk&&td(ld,this,new X(this.sdk)),ed(ld,this).mouse_right_down((function(t,i){var n=Kh({},t.position);ed(ld,e).mouse_move((function(t,i){e.firstPersonHeadingPitch.heading=e.firstPersonHeadingPitch.heading+(t.endPosition.x-n.x)/20,e.firstPersonHeadingPitch.pitch=e.firstPersonHeadingPitch.pitch+(n.y-t.endPosition.y)/10,r&&(r.firstPersonHeadingPitch=Kh({},e.firstPersonHeadingPitch)),n=Kh({},t.endPosition)}),!0)}),!0),ed(ld,this).mouse_right_up((function(t,i){ed(ld,e).mouse_move((function(){}))}),!0)}else{if(Ke(this.sdk,!0),this.model&&this.modelShow&&this.show){var l=!0;l=!(!this.show||this.showView&&3!=this.showView&&i),this.model.show=l}if(this._DialogObject&&this._DialogObject._element.content){var c=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");c[0]&&c[1]&&(c[0].className="btn",c[1].className="btn is-active")}if(this.viewFollow&&this.show){if(this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),3===this.sdk.viewer.scene.mode){var u=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=u}this.viewFollow=this.viewFollow}}se(this.sdk,this.options.id)}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(t){ae();var e=Ie();if(this.show||(t=!1),this.options.viewFollow=t,this.options.viewFollow?(this.editObj&&(this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn")),ii(this.sdk),this.lineEdit=!1):this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),t&&this.show&&this.model){var n=this.sdk.viewer.entities.add({position:this.model.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}var o=Re();if(o)if(this.sdk!=o){var s=o.entityMap.get(this.options.id);s&&s.viewFollow!=t&&(s.viewFollow=t)}else if(e){var a=e.entityMap.get(this.options.id);a&&a.viewFollow!=t&&(a.viewFollow=t,this.TweenAnimate&&this.TweenAnimate._isPlaying&&a.setMovePositionByDistance(this.TweenAnimate._object.distance))}se(this.sdk,this.options.id),this._elms.viewFollow&&this._elms.viewFollow.forEach((function(e){e.checked=t}))}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){var e=this;this.options.label.show=t;var i=Ie(),n=t;n=!(!this.show||this.showView&&3!=this.showView&&i)&&t,this.show?this.label&&(this.label.show=n,this.label.pixelOffset=this.options.label.pixelOffset+(this.fuelShow?this.labelFontSize+20:0),this.options.label.position&&setTimeout((function(){e.options.label.position.alt?e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.label&&(e.label.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)):this.label&&(this.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.checked=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.label&&(this.label.fontFamily=this.options.label.fontFamily),this.fuelLabel&&(this.fuelLabel.fontFamily=this.options.label.fontFamily);var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t,this.label&&(this.label.color=t),this.fuelLabel&&(this.fuelLabel.color=t),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(255,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.label&&(this.label.fontSize=t),this.fuelLabel?(this.fuelLabel.fontSize=t,this.label.pixelOffset=this.options.label.pixelOffset+t+20):this.label.pixelOffset=this.options.label.pixelOffset,this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelScaleByDistance",get:function(){return this.options.label.scaleByDistance},set:function(t){this.options.label.scaleByDistance=t,this.label&&(this.label.scaleByDistance=t),this.fuelLabel&&(this.fuelLabel.scaleByDistance=t),this._elms.labelScaleByDistance&&this._elms.labelScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"labelNear",get:function(){return this.options.label.near},set:function(t){var e=t;e>this.labelFar&&(e=this.labelFar),this.options.label.near=e,this.label&&(this.label.near=e),this.fuelLabel&&(this.fuelLabel.near=e),this._elms.labelNear&&this._elms.labelNear.forEach((function(t){t.value=e}))}},{key:"labelFar",get:function(){return this.options.label.far},set:function(t){var e=t;e<this.labelNear&&(e=this.labelNear),this.options.label.far=e,this.label&&(this.label.far=e),this.fuelLabel&&(this.fuelLabel.far=e),this._elms.labelFar&&this._elms.labelFar.forEach((function(t){t.value=e}))}},{key:"unitFuelConsumption",get:function(){return this.options.unitFuelConsumption},set:function(t){this.options.unitFuelConsumption=t,this._elms.unitFuelConsumption&&this._elms.unitFuelConsumption.forEach((function(e){e.value=t}))}},{key:"fuelShow",get:function(){return this.options.fuelShow},set:function(t){var e=this;this.options.fuelShow=t;var i=t;i=!(!this.show||this.showView&&3!=this.showView)&&t,this.show?(this.fuelLabel?(this.fuelLabel.show=i,this.label.pixelOffset=this.options.label.pixelOffset+(i?this.labelFontSize+20:0)):this.label.pixelOffset=this.options.label.pixelOffset,this.options.label.position&&setTimeout((function(){e.options.label.position.alt?e.fuelLabel&&(e.fuelLabel.position=[e.options.label.position.lng,e.options.label.position.lat,e.options.label.position.alt]):e.getClampToHeight({lng:e.options.label.position.lng,lat:e.options.label.position.lat}).then((function(t){e.fuelLabel&&(e.fuelLabel.position=[e.options.label.position.lng,e.options.label.position.lat,t])}))}),0)):(this.fuelLabel&&(this.fuelLabel.show=!1),this.label.pixelOffset=this.options.label.pixelOffset),this._elms.fuelShow&&this._elms.fuelShow.forEach((function(e){e.checked=t}))}},{key:"modelMove",value:(h=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w,k=this,x=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w=function(t,e){var i=Cesium.Transforms.eastNorthUpToFixedFrame(t);if(e){var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:l}}},C=function(){return(C=o()(a.a.mark((function t(e){var i,o,s,r,c,u,p,d,g,b,C,k,x,_,E,S,D,P,M,O,T,N,B,A,j,I,R,F,z,H,V,G,U,W,Y,J,q;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.totalFuelConsumption=Number((e/100*n.unitFuelConsumption).toFixed(2)),n.fuelLabel.text="总油耗:"+n.totalFuelConsumption+" L",n.model.isMove=!0,i=Ie(),o=ae(),n.sdk.viewer&&n.sdk.viewer.scene){t.next=8;break}return n.removeModelAnimate(),t.abrupt("return");case 8:if(c=h,!(s=e)){t.next=18;break}return t.next=14,turf.lineSliceAlong(h,0,s,{units:"kilometers"});case 14:c=t.sent,r=L()(c.geometry.coordinates[c.geometry.coordinates.length-1]),t.next=19;break;case 18:r=L()(h.geometry.coordinates[0]);case 19:if(!n.ground){t.next=59;break}d=[],g=qh(n.sdk.entityMap);try{for(g.s();!(b=g.n()).done;)(C=y()(b.value,2))[0],(!(k=C[1]).type||"glb"!==k.type&&"bim"!==k.type&&"tileset"!==k.type&&"TrajectoryMotion"!==k.type&&"ParticleEffects"!==k.type&&k.entity)&&(d.push(k.entity),k.label&&k.label.entity&&d.push(k.label.entity))}catch(t){g.e(t)}finally{g.f()}if(n.label&&n.label.entity&&d.push(n.label.entity),!(_=Ie())||n.sdk!=_){t.next=30;break}x=new Cesium.Cartesian3.fromDegrees(r[0],r[1]),u=x,t.next=34;break;case 30:return t.next=32,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r[0],r[1]),[n.model].concat(d));case 32:x=t.sent,u=x;case 34:return x||(u=new Cesium.Cartesian3.fromDegrees(r[0],r[1])),E=n.cartesian3Towgs84(u,l),S=0,t.prev=37,t.next=40,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(E.lng,E.lat)]);case 40:D=t.sent,S=D[0].height,t.next=47;break;case 44:t.prev=44,t.t0=t.catch(37),S=0;case 47:if(E.alt<S&&(E.alt=S),E.alt=Number(E.alt.toFixed(1)),u=Cesium.Cartesian3.fromDegrees(E.lng,E.lat,E.alt),n.sdk.viewer&&n.sdk.viewer.scene){t.next=53;break}return n.removeModelAnimate(),t.abrupt("return");case 53:for(p=Cesium.Cartesian3.fromDegrees(r[0],r[1],n.cartesian3Towgs84(u,n.sdk.viewer).alt+1.8),P=[],M=0;M<c.geometry.coordinates.length;M++)P.push(c.geometry.coordinates[M][0],c.geometry.coordinates[M][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(P),t.next=78;break;case 59:if(O=n.spline.evaluate(e/n.distance)){t.next=62;break}return t.abrupt("return");case 62:T=n.cartesian3Towgs84(O,l),r=[T.lng,T.lat,T.alt+1.8],u=O,p=Cesium.Cartesian3.fromDegrees(r[0],r[1],r[2]),N=[],B=0;case 68:if(!(B<=1e3)){t.next=76;break}if(!(B/1e3>e/n.distance)){t.next=71;break}return t.abrupt("break",76);case 71:A=n.spline.evaluate(B/1e3),N.push(A);case 73:B++,t.next=68;break;case 76:N.push(O),n.realTimePositions=N;case 78:if(m=w(n.model.position,u),v&&v.position&&(f=w(v.position,u),m.pitch=f.pitch),v.position=n.model.position,Cesium.HeadingPitchRoll.fromDegrees(n.options.model.heading,n.options.model.pitch,n.options.model.roll),j=0,I=0,R=0,F=Cesium.Transforms.eastNorthUpToFixedFrame(u),!n.options.routeDirection||n.lineEdit){t.next=98;break}if(j=m.heading*(180/Math.PI)-90-n.options.model.heading,I=m.pitch*(180/Math.PI)-n.options.model.pitch,R=n.options.model.roll,z=Re()?Re().entityMap.get(n.options.id):o.sdkP&&o.sdkP.entityMap.get(n.options.id),n.state||z&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)&&(j=z.model.heading,I=z.model.pitch,R=z.model.roll),!(isNaN(j)||isNaN(I)||isNaN(R))){t.next=94;break}return t.abrupt("return");case 94:n.state||(z&&(i&&i===n.sdk||o.sdkD&&o.sdkD===n.sdk)?(j=z.model.heading,I=z.model.pitch,R=z.model.roll):(j=n.model.heading||0===n.model.heading?n.model.heading:n.options.model.heading,I=n.model.pitch||0===n.model.pitch?n.model.pitch:n.options.model.pitch,R=n.model.roll||0===n.model.roll?n.model.roll:n.options.model.roll)),n.model.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(F,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(j,I,R)),n.model.modelMatrix),t.next=114;break;case 98:if(!n.entity){t.next=114;break}if(j=n.options.model.heading,I=n.options.model.pitch,R=n.options.model.roll,!(isNaN(j)||isNaN(I)||isNaN(R))){t.next=104;break}return t.abrupt("return");case 104:H=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(R)),V=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(I)),G=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(j)),U=Cesium.Matrix4.fromRotationTranslation(H),W=Cesium.Matrix4.fromRotationTranslation(V),Y=Cesium.Matrix4.fromRotationTranslation(G),J=new Cesium.Matrix4,Cesium.Matrix4.multiply(F,U,J),Cesium.Matrix4.multiply(J,W,J),Cesium.Matrix4.multiply(J,Y,n.entity.modelMatrix);case 114:if(n.model.position=u,n.model.roll=R,n.model.pitch=I,n.model.heading=j,u){t.next=120;break}return t.abrupt("return");case 120:q=n.cartesian3Towgs84(u,n.sdk.viewer),n.label.position=[q.lng,q.lat,q.alt],n.fuelLabel.position=[q.lng,q.lat,q.alt],n.realTimeRouteArray.push(u),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:p,orientation:{heading:Cesium.Math.toRadians(j+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}}):3===n.sdk.viewer.scene.mode?n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=u):n.sdk.viewer.trackedEntity&&n.sdk.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(r[0],r[1],n.sdk.viewer.camera.positionCartographic.height),orientation:{heading:Cesium.Math.toRadians(-90),pitch:0,roll:0}}));case 126:case"end":return t.stop()}}),t,null,[[37,44]])})))).apply(this,arguments)},b=function(t){return C.apply(this,arguments)},i=x.length>1&&void 0!==x[1]?x[1]:{time:0},cancelAnimationFrame(ed(sd,this)),n=this,s=i.time||0,r=i.distance,l=this.sdk.viewer,this.model&&this.sdk&&this.sdk.viewer){t.next=11;break}return t.abrupt("return");case 11:for(this.removeModelAnimate(),c=[],u=0;u<e.length;u++)p=this.cartesian3Towgs84(e[u],l),c.push([p.lng,p.lat,p.alt]);h=turf.lineString(c),this.distance=turf.length(h,{units:"kilometers"}),d=1e3*this.distance/this.options.speed,r||0===r?(r>this.distance&&(r=this.distance),s=r/this.distance*d):(r=1e-6,s&&(s>d&&(s=d),r=s/d*this.distance)),v={},this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){(s||r)&&k.modelMove(e)})).onUpdate(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(k.sdk.viewer){t.next=6;break}return k.removeModelAnimate(),t.abrupt("return");case 6:isNaN(e.distance)||b(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){k.realTimeRouteArray=[]})).onComplete((function(t){k.state=!1})),this.state?this.TweenAnimate.start():(g=function(){if(td(ad,n,requestAnimationFrame(g)),n.options.firstPersonView){var t=Kh({},n.sdk.viewer.camera._position);n.sdk.viewer.camera.setView({destination:t,orientation:{heading:Cesium.Math.toRadians(n.model.heading+90+n.firstPersonHeadingPitch.heading),pitch:Cesium.Math.toRadians(n.firstPersonHeadingPitch.pitch),roll:0}})}},b(r),setTimeout((function(){n.model.isMove=!1}),1e3),g());case 24:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this.renewLinePositions(this.options.line.positions);this.modelMove(e,{time:t})}},{key:"edit",value:(p=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this._error){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=45;break}return t.next=8,new rn(this.sdk,this.options,{title:"轨迹运动属性",left:"180px",top:"100px",confirmCallBack:function(t){p.name=p.name.trim(),p.name||(p.name="未命名对象"),p.originalOptions=p.deepCopyObj(p.options),p._DialogObject.close();var e=p.deepCopyObj(p.options);e.host="",p.Dialog.confirmCallBack&&p.Dialog.confirmCallBack(e),Pe(p.sdk,p.options.id),se(p.sdk,p.options.id)},removeCallBack:function(){p.sdk.viewer.trackedEntity&&(p.sdk.viewer.entities.remove(p.sdk.viewer.trackedEntity),p.sdk.viewer.trackedEntity=null),p.Dialog.removeCallBack&&p.Dialog.removeCallBack()},closeCallBack:function(){p._DialogObject=null,p.reset(),p.Dialog.closeCallBack&&p.Dialog.closeCallBack(),p.editObj&&(p.editObj.destroy(),p.editObj=null),p.keyPointShow=!1,p.event&&p.event.destroy(),p.tip&&p.tip.destroy(),p.tip=null,p.ControllerObject.destroy(),p.firstPersonView!==p.originalOptions.firstPersonView&&(p.firstPersonView=p.originalOptions.firstPersonView),p.firstPersonView&&p.modelShow&&p.model&&(p.model.show=!1)},showCallBack:function(t){p.show=t,p.Dialog.showCallBack&&p.Dialog.showCallBack()}});case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" trajectory-motion",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">起始点高度</span>\n <div class="input-number input-number-unit-1 height-box">\n <input class="input" type="number" title="" min="-9999999" max="999999999" @model="height">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">模型倍数</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="0" max="99999" step="1" @model="scale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">运行速度</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="99999999" step="1" @model="speed">\n <span class="unit">m/s</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">延迟运动</span>\n <div class="input-number input-number-unit-3">\n <input class="input" type="number" title="" min="0" max="9999999" @model="delay">\n <span class="unit">ms</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label" style="flex: 0 0 70px;">更换模型</span>\n <button class="btn" @click="clickChangeModel">选择</button>\n </div>\n <div class="col">\n <span class="label">模型方向</span>\n <button class="btn model-rotate-btn" @click="modelRotate">开始调整</button>\n <svg class="icon-rubric"><use xlink:href="#yj-icon-rubric"></use></svg>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="btn-group">\n <button class="btn" style="border-radius: 5px 0 0 5px;" name="firstPerson"\n data-state="true"><span>第一视角</span></button>\n <button class="btn" style="border-radius: 0 5px 5px 0;" name="firstPerson"\n data-state="false"><span>第三视角</span></button>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item div-item-switch">\n <div class="row">\n <div class="col">\n <span class="label">路径显隐</span>\n <input class="btn-switch" type="checkbox" @model="lineShow">\n </div>\n <div class="col">\n <span class="label">模型显隐</span>\n <input class="btn-switch" type="checkbox" @model="modelShow">\n </div>\n <div class="col">\n <span class="label">实时路径</span>\n <input class="btn-switch" type="checkbox" @model="realTimeRoute">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">编辑</span>\n <input class="btn-switch" type="checkbox" @model="lineEdit">\n </div>\n <div class="col">\n <span class="label">路径圆滑</span>\n <input class="btn-switch" type="checkbox" @model="smooth">\n </div>\n <div class="col">\n <span class="label">环线</span>\n <input class="btn-switch" type="checkbox" @model="noseToTail">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">轨迹贴地</span>\n <input class="btn-switch" type="checkbox" @model="ground">\n </div>\n <div class="col">\n <span class="label">轨迹循环</span>\n <input class="btn-switch" type="checkbox" @model="loop">\n </div>\n <div class="col">\n <span class="label">轨迹动画</span>\n <input class="btn-switch" type="checkbox" @model="state">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">路径方向</span>\n <input class="btn-switch" type="checkbox" @model="routeDirection">\n </div>\n <div class="col" style="margin-right: 33px;">\n <span class="label">视角跟随</span>\n <input class="btn-switch" type="checkbox" @model="viewFollow">\n </div>\n <div class="col" style="margin: 0px;">\n <span class="label">模型动画</span>\n <div class="input input-select model-animate-select"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col"></div>\n </div>\n <div class="row">\n <div class="col" style="margin-right: 14px;">\n <span class="label">字体颜色</span>\n <div class="labelColor"></div>\n </div>\n <div class="col font-select-box">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="labelScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1" style="width: 82px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="labelFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">油耗</span>\n <div class="input-number input-number-unit-6" style="width: 170px;">\n <input class="input" type="number" title="" min="1" max="99999999" @model="unitFuelConsumption">\n <span class="unit">L/100km</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="flex: 0 0 0;">\n <span class="label">总油耗</span>\n <input class="btn-switch" type="checkbox" @model="fuelShow">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),this.editObj?(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"):(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn"),n=new YJColorPicker({el:i.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){p.labelColor=t},clear:function(){p.labelColor=""}}),o=this._DialogObject._element.content.getElementsByClassName("height-box")[0],s=i.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.heightBox=o,this._elms.labelColor=[n],this.model&&(r=function(){var t=p.model.loader.components.animations;if(p._DialogObject){if(t){for(var e=[{name:"无",value:"无"}],n=0;n<t.length;n++)e.push({name:t[n].name,value:t[n].name});Y(p._DialogObject._element.content,".model-animate-select").legp_search(e)}var o=i.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];o.value=p.modelAnimate,o.addEventListener("input",(function(t,e){p.modelAnimate=o.value}))}},Number(Cesium.VERSION.split(".")[1])>=107?this.model.ready?r():this.model.readyEvent.addEventListener((function(){r()})):this.model.readyPromise.then((function(t){r()}))),this.ground?this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box disabled"):this._elms.heightBox&&(this._elms.heightBox.className="input-number input-number-unit-1 height-box"),(l=i.querySelectorAll("button[name='firstPerson']"))[0].addEventListener("click",(function(t){var e=ae();Ie()||e.sdkD||(p.firstPersonView||(p.viewFollow=!0),p.firstPersonView=!0)})),l[1].addEventListener("click",(function(t){p.firstPersonView&&(p.viewFollow=!0),p.firstPersonView=!1})),this.options.firstPersonView?(l[0].className="btn is-active",l[1].className="btn",this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)):(l[0].className="btn",l[1].className="btn is-active"),(c=document.createElement("div")).className="custom-rubric-box",c.style.transformOrigin="center bottom",c.style.position="absolute",c.style.top="180px",c.style.right="3px",c.style.padding="5px 10px",c.style.backgroundColor="#3e4249",c.style.borderRadius="5px",c.style.fontSize="12px",c.style.color="#ff5733",c.style.display="none",c.innerHTML='场景正东方向为轨迹前进正方向<div x-arrow="" class="custom__popper__arrow" style="left: 59px;"></div>',(u=i.getElementsByClassName("icon-rubric")[0]).addEventListener("mouseenter",(function(t){c.style.display="block"})),document.addEventListener("mousemove",(function(t){u.contains(t.target)||(c.style.display="none")})),this._DialogObject._element.content.appendChild(c),setTimeout((function(){var t=qn(),e=Y(p._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select");if(e){e.legp_search(t);var i=p._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0];i.value=t[p.labelFontFamily].value;for(var n=0;n<t.length;n++)if(t[n].value==i.value){e.legp_searchActive(t[n].value);break}i.addEventListener("input",(function(){for(var e=0;e<t.length;e++)if(t[e].value===i.value){p.labelFontFamily=t[e].key;break}})),p._elms.labelFontFamily=[i]}}),0);case 45:case"end":return t.stop()}}),t,this)}))),function(t){return p.apply(this,arguments)})},{key:"flyTo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};pi(0),ii(this.sdk),this.options.customView?this.sdk.viewer.camera.flyTo({destination:this.options.customView.position,orientation:this.options.customView.orientation}):this.line&&this.sdk.viewer.flyTo(this.line,{offset:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}})}},{key:"remove",value:(u=o()(a.a.mark((function t(){var e,i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.scene.primitives.remove(this.model),this.sdk.viewer.entities.remove(this.line),this.sdk.viewer.entities.remove(this.realTimeLine),this.label&&this.label.remove(),this.fuelLabel&&this.fuelLabel.remove(),e=0;e<this.keyPointShow.length;e++)this.sdk.viewer.entities.remove(this.keyPointShow[e]);return this.line=null,this.realTimeLine=null,this.model=null,this.label=null,this.fuelLabel=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),ed(rd,this)&&ed(rd,this).destroy(),this.removeModelAnimate(),(i=Ie())&&i===this.sdk||(this.viewFollow=!1),cancelAnimationFrame(ed(sd,this)),t.next=21,this.sdk.removeIncetance(this.options.id);case 21:return t.next=23,Pe(this.sdk,this.options.id);case 23:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"reset",value:(c=o()(a.a.mark((function t(){var e,i=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.options.model.url!==this.originalOptions.model.url&&this.changeModelUrl(this.originalOptions.model.url),this.name=this.originalOptions.name,JSON.stringify(this.options.line.positions)!==JSON.stringify(this.originalOptions.line.positions)&&(this.options.line.positions=this.deepCopyObj(this.originalOptions.line.positions),e=this.renewLinePositions(this.options.line.positions),this.line.polyline.positions=e,setTimeout((function(){i.model.position=e[0],i.modelMove(e)}),0)),this.modelShow=this.originalOptions.model.show,this.noseToTail!==this.originalOptions.line.noseToTail&&(this.noseToTail=this.originalOptions.line.noseToTail),this.height!==this.originalOptions.height&&(this.height=this.originalOptions.height),this.lineShow!==this.originalOptions.line.show&&(this.lineShow=this.originalOptions.line.show),this.keyPointShow=this.originalOptions.line.keyPoint,this.routeDirection=this.originalOptions.routeDirection,this.scale=this.originalOptions.model.scale,this.loop!==this.originalOptions.loop&&(this.loop=this.originalOptions.loop),this.viewFollow=this.originalOptions.viewFollow,this.state=this.originalOptions.state,this.speed=this.originalOptions.speed,this.smooth!==this.originalOptions.line.smooth&&(this.smooth=this.originalOptions.line.smooth),this.realTimeRoute=this.originalOptions.realTimeRoute,this.modelAnimate=this.originalOptions.model.animate,this.delay=this.originalOptions.delay,this.ground!==this.originalOptions.ground&&(this.ground=this.originalOptions.ground),this.firstPersonView!==this.originalOptions.firstPersonView&&(this.firstPersonView=this.originalOptions.firstPersonView),this.firstPersonView&&this.modelShow&&this.model&&(this.model.show=!1),this.labelShow=this.originalOptions.label.show,this.fuelLabelShow=this.originalOptions.fuelShow,this.labelColor=this.originalOptions.label.color,this.labelFontSize=this.originalOptions.label.fontSize,this.labelFontFamily=this.originalOptions.label.fontFamily,this.labelScaleByDistance=this.originalOptions.label.scaleByDistance,this.labelNear=this.originalOptions.label.near,this.labelFar=this.originalOptions.label.far,this.labelLineWidth=this.originalOptions.label.lineWidth,this.labelPixelOffset=this.originalOptions.label.pixelOffset,this.labelLineColor=this.originalOptions.label.lineColor,this.labelBackgroundColorStart=this.originalOptions.label.backgroundColor[0],this.labelBackgroundColorEnd=this.originalOptions.label.backgroundColor[1],this.options=this.deepCopyObj(this.originalOptions);case 35:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"modelRotate",value:function(){if(this.editObj)this.editObj.destroy(),this.editObj=null,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="开始调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn");else if(this.viewFollow)window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:"关闭视角跟随后可调整模型方向!",type:"warning",duration:1500}),console.warn("关闭视角跟随后可调整模型方向!"));else{this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].innerHTML="结束调整",this._DialogObject._element.content.getElementsByClassName("model-rotate-btn")[0].className="btn model-rotate-btn is-active"),this.state=!1,this.editObj=new Pc(this.sdk,this.model),this.editObj.editRtation(),this.editObj.transformCallBack=this.rotationEditingCallBack,this.routeDirection=!1;var t=this.options.model.heading,e=this.options.model.pitch,i=this.options.model.roll;if(isNaN(t)||isNaN(e)||isNaN(i))return;var n=Cesium.Transforms.eastNorthUpToFixedFrame(this.model.position),o=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(i)),s=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(e)),a=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(t)),r=Cesium.Matrix4.fromRotationTranslation(o),l=Cesium.Matrix4.fromRotationTranslation(s),c=Cesium.Matrix4.fromRotationTranslation(a),u=new Cesium.Matrix4;Cesium.Matrix4.multiply(n,r,u),Cesium.Matrix4.multiply(u,l,u),Cesium.Matrix4.multiply(u,c,this.entity.modelMatrix)}}},{key:"clickChangeModel",value:function(){this.Dialog.changeModelCallBack&&this.Dialog.changeModelCallBack()}},{key:"rotationEditingCallBack",get:function(){var t=this;return function(e){t.options.model.heading=e.rz,t.options.model.pitch=e.ry,t.options.model.roll=e.rx,t._rotationEditingCallBack&&t._rotationEditingCallBack(t.editObj._params),t.entity&&(t.entity.isMove=!0),clearTimeout(ed(nd,t)),td(nd,t,setTimeout((function(){t.entity&&(t.entity.isMove=!1)}),500))}},set:function(t){this._rotationEditingCallBack=t}},{key:"changeModelUrl",value:(l=o()(a.a.mark((function t(e){var i,n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.sdk.viewer.scene.primitives.remove(this.model),this.options.model.url=this.replaceHost(e,this.options.host),i=this.model.modelMatrix,n=this.model.position,o={id:this.options.id,url:this.options.model.url,show:this.options.model.show,scale:this.options.model.scale},s=function(){r.options.model.url===r.originalOptions.model.url?r.modelAnimate=r.originalOptions.model.animate:r.options.model.animate="无";var t=r.model.loader.components.animations;if(r._DialogObject){if(t){for(var e=[{name:"无",value:"无"}],i=0;i<t.length;i++)e.push({name:t[i].name,value:t[i].name});Y(r._DialogObject._element.content,".model-animate-select").legp_search(e)}var n=r._DialogObject._element.content.getElementsByClassName("model-animate-select")[0].getElementsByTagName("input")[0];n.value=r.modelAnimate,n.addEventListener("input",(function(t,e){r.modelAnimate=n.value}))}},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=15;break}return t.next=9,Cesium.Model.fromGltfAsync(o);case 9:this.model=t.sent,this.model.position=n,this.sdk.viewer.scene.primitives.add(this.model),this.model.readyEvent.addEventListener((function(){s(),r.model.modelMatrix=i})),t.next=18;break;case 15:this.model=this.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),this.model.position=n,this.model.readyPromise.then((function(t){s(),r.model.modelMatrix=i}));case 18:this.model.imageBasedLighting.luminanceAtZenith=.6;case 19:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"controllerCallBack",get:function(){return function(t){}},set:function(t){this._controllerCallBack=t}},{key:"renewLinePositions",value:function(t){var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=1e3;a++){var r=this.spline.evaluate(a/1e3);o.push(r)}return this.positions_smooth=o,o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(t){var i,n=t.renewLinePositions(t.options.line.positions);i=!!t.options.show&&t.options.line.show,t.sdk.viewer.entities.removeById(t.options.id+"-2"),t.sdk.viewer.entities.removeById(t.options.id+"-3"),t.line=t.sdk.viewer.entities.add({id:t.options.id+"-2",polyline:{positions:n,width:2,clampToGround:t.ground,material:i?new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff"),dashLength:20}):new Cesium.PolylineDashMaterialProperty({color:new Cesium.Color.fromCssColorString("#00ffff00"),dashLength:20}),zIndex:t.sdk._entityZIndex}}),t.realTimeLine=t.sdk.viewer.entities.add({id:t.options.id+"-3",show:!!t.options.realTimeRoute&&t.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return t.realTimePositions}),!1),width:2,clampToGround:t.ground,material:Cesium.Color.fromCssColorString("#ff0000"),zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,ed(rd,t)&&ed(rd,t).destroy(),td(rd,t,new X(t.sdk)),ed(rd,t).mouse_right((function(e,i){var n,o=ae(),s=(n=t.sdk===o.sdkP?o.sdkD:o.sdkP)?n.entityMap.get(t.options.id):void 0;s&&(s.viewFollow=!1),t.viewFollow=!1}),!0),e.addModel(t),e.addKeyPoint(t),t.noseToTail=t.options.line.noseToTail,t.smooth=t.options.line.smooth,Pe(t.sdk,t.options.id),t.options.show&&Kt(0,t.options.id)}},{key:"addModel",value:(r=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.replaceHost(i.options.model.url,i.options.host),o={id:i.options.id,url:n,show:!!i.options.show&&i.options.model.show,scale:i.options.model.scale},!(Number(Cesium.VERSION.split(".")[1])>=107)){t.next=11;break}return t.next=5,Cesium.Model.fromGltfAsync(o);case 5:i.model=t.sent,i.model.originalBoundingSphereRadius=0,i.sdk.viewer.scene.primitives.add(i.model),i.model.readyEvent.addEventListener((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate})),t.next=14;break;case 11:i.model=i.sdk.viewer.scene.primitives.add(Cesium.Model.fromGltf(o)),i.model.originalBoundingSphereRadius=0,i.model.readyPromise.then((function(){i.model.originalBoundingSphereRadius=i.model.boundingSphere.radius,i.modelAnimate=i.options.model.animate}));case 14:for(i.model.imageBasedLighting.luminanceAtZenith=.6,s=Cesium.Transforms.eastNorthUpToFixedFrame(i.positions_smooth[0]),i.model.modelMatrix=s,i.model.position=i.positions_smooth[0],i.model.customScale={x:i.options.model.scale,y:i.options.model.scale,z:i.options.model.scale},r=i.options.line.positions,l=[],c=0;c<r.length;c++)l.push(r[c].lng,r[c].lat,r[c].alt);u=i.smooth?i.positions_smooth:Cesium.Cartesian3.fromDegreesArrayHeights(l),e.createLabel(i),e.createFuelLabel(i),i.modelMove(u),i.entity=i.model;case 27:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"createLabel",value:(s=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.cartesian3Towgs84(e.model.position,e.sdk.viewer),e.label=new no(e.sdk,{show:!!e.options.show&&!!e.options.label.show,position:[i.lng,i.lat,i.alt],text:e.options.name,fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:e.options.label.pixelOffset+(e.options.fuelShow?e.options.label.fontSize+20:0),backgroundColor:e.options.label.backgroundColor,lineColor:e.options.label.lineColor,lineWidth:e.options.label.lineWidth,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far},e.model);case 2:case"end":return t.stop()}}),t)}))),function(t){return s.apply(this,arguments)})},{key:"createFuelLabel",value:(n=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.cartesian3Towgs84(e.model.position,e.sdk.viewer),e.fuelLabel=new no(e.sdk,{show:!!e.options.show&&!!e.options.fuelShow,position:[i.lng,i.lat,i.alt],text:"总油耗:",fontSize:e.options.label.fontSize,fontFamily:e.options.label.fontFamily,color:e.options.label.color,pixelOffset:0,backgroundColor:["#6e6e6e","#6e6e6e"],lineColor:"#00ffff00",lineWidth:0,scaleByDistance:e.options.label.scaleByDistance,near:e.options.label.near,far:e.options.label.far},e.model);case 2:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"addKeyPoint",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<e.options.line.positions.length)){t.next=13;break}return t.next=4,e.getClampToHeight(e.options.line.positions[i]);case 4:return n=t.sent,t.next=7,Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,n);case 7:o=t.sent,s=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:e.options.line.keyPoint||!1,position:e.ground?o:Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,e.options.line.positions[i].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.keyPoints.push(s);case 10:i++,t.next=1;break;case 13:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r,l,c,u,p,h}(Wn);function ud(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return pd(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pd(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function pd(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function hd(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function dd(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?hd(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):hd(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function md(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function fd(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function vd(t,e,i){return t.set(gd(t,e),i),i}function gd(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var yd=new WeakMap,bd=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),fd(i=md(this,e,[t,n]),yd,!1),i.options.name=n.name||"",i.options.show=!n.show&&!1!==n.show||n.show,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.totalTime=n.totalTime,(n.totalTime||0===n.totalTime)&&(i.totalTime=n.totalTime),i.options.delay=n.delay||0,i.options.loop=!n.loop&&!1!==n.loop||n.loop,i.options.line=n.line=n.line||{},i.options.line.positions=n.line.positions||[],i.options.height=n.height||0===n.height?n.height:i.options.line.positions[0]?i.options.line.positions[0].alt:0,i.options.line.show=!n.line.show&&!1!==n.line.show||n.line.show,i.options.line.smooth=!!n.line.smooth&&n.line.smooth,i.options.line.noseToTail=!!n.line.noseToTail&&n.line.noseToTail,i.positions_smooth=[],i.options.ground=n.ground||!1,i.options.state=!n.state&&!1!==n.state||n.state,i.options.routeDirection=!n.routeDirection&&!1!==n.routeDirection||n.routeDirection,i.keyPoints=[],i.realTimePositions=[],i._elms={},i.Dialog=o,i.realTimeRouteArray=[],i._current={heading:0,pitch:0,roll:0},i.distance,i.options.line.positions.length<2?(i._error="最少需要两个坐标!",console.warn(i._error),window.ELEMENT&&window.ELEMENT.Message({message:i._error,type:"warning",duration:1500})):(i.ControllerObject=new Jo(i.sdk),i._EventBinding=new wn,e.addLine(i),i.firstPersonView=!1,i.options.viewFollow=!1),i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"TrajectoryMotionObject"}},{key:"show",get:function(){return this.options.show},set:function(t){if("boolean"==typeof t){if(this.options.show=t,t){this.line.show=this.lineShow;for(var e=0;e<this.keyPoints.length;e++)this.keyPoints[e].show=this.keyPointShow}else{this.line.show=t;for(var i=0;i<this.keyPoints.length;i++)this.keyPoints[i].show=t}this._DialogObject&&this._DialogObject.showBtn&&(this._DialogObject.showBtn.checked=t)}else console.error("参数必须为boolean")}},{key:"height",get:function(){return this.options.height},set:function(t){var e=this;if(this.options.height=t,this.line)if(this.ground){this.line.polyline.clampToGround=!0;for(var i=function(t){e.sdk.viewer.scene.clampToHeightMostDetailed([new Cesium.Cartesian3.fromDegrees(e.options.line.positions[t].lng,e.options.line.positions[t].lat)]).then((function(i){e.keyPoints[t].position=i[0]}))},n=0;n<this.keyPoints.length;n++)i(n)}else{var o=this.options.height-this.options.line.positions[0].alt;this.line.polyline.clampToGround=!1;for(var s=0;s<this.keyPoints.length;s++)this.options.line.positions[s].alt+=o,this.keyPoints[s].position=Cesium.Cartesian3.fromDegrees(this.options.line.positions[s].lng,this.options.line.positions[s].lat,this.options.line.positions[s].alt)}this._renewLine(this.options.line.positions);this._elms.height&&this._elms.height.forEach((function(e){e.value=t}))}},{key:"ground",get:function(){return this.options.ground},set:function(t){this.lineEdit=!1,this.options.ground=t,this.realTimeLine.polyline.clampToGround=t,this.height=this.options.height,this._elms.ground&&this._elms.ground.forEach((function(e){e.checked=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){var e=this;t<=0&&(t=.01),this.options.speed=t,(this.distance||0===this.distance)&&(this.options.totalTime=1e3*this.distance/this.options.speed,this.TweenAnimate&&this.state&&this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t})),this._elms.totalTime&&this._elms.totalTime.forEach((function(t){t.value=e.options.totalTime})))}},{key:"totalTime",get:function(){return this.options.totalTime},set:function(t){var e=this;this.options.totalTime=t,(this.distance||0===this.distance)&&(this.options.speed=1e3*this.distance/this.options.totalTime,this.TweenAnimate&&this.setMovePositionByDistance(this.TweenAnimate._object.distance),this._elms.totalTime&&this._elms.totalTime.forEach((function(e){e.value=t})),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e.options.speed})))}},{key:"smooth",get:function(){return this.options.line.smooth},set:function(t){this.lineEdit=!1,this.options.line.smooth=t;var e=this._renewLine(this.options.line.positions);this.modelMove(e),this._elms.smooth&&this._elms.smooth.forEach((function(e){e.checked=t}))}},{key:"delay",get:function(){return this.options.delay},set:function(t){this.options.delay=t,this.TweenAnimate&&this.TweenAnimate.delay(this.delay),this._elms.delay&&this._elms.delay.forEach((function(e){e.value=t}))}},{key:"state",get:function(){return this.options.state},set:function(t){if(this.options.state=t,this.editObj&&(this.editObj.destroy(),this.editObj=null),this.TweenAnimate)t?this.speed=this.speed:this.TweenAnimate.pause();else if(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e)}this._elms.state&&this._elms.state.forEach((function(e){e.checked=t}))}},{key:"noseToTail",get:function(){return this.options.line.noseToTail},set:function(t){this.lineEdit=!1,this.options.line.noseToTail=t;for(var e=[],i=0;i<this.options.line.positions.length;i++)e.push(this.options.line.positions[i].lng,this.options.line.positions[i].lat,this.options.line.positions[i].alt);Cesium.Cartesian3.fromDegreesArrayHeights(e);if(this.line){var n=this._renewLine(this.options.line.positions);this.modelMove(n)}this._elms.noseToTail&&this._elms.noseToTail.forEach((function(e){e.checked=t}))}},{key:"lineShow",get:function(){return this.options.line.show},set:function(t){t&&(this.realTimeRoute=!1),this.options.line.show=t,this.line&&this.show&&(this.line.show=t),this._elms.lineShow&&this._elms.lineShow.forEach((function(e){e.checked=t}))}},{key:"realTimeRoute",get:function(){return this.options.realTimeRoute},set:function(t){t&&(this.lineShow=!1,this.keyPointShow=!1),this.options.realTimeRoute=t,this.realTimeLine&&this.show&&(this.realTimeLine.show=t),this._elms.realTimeRoute&&this._elms.realTimeRoute.forEach((function(e){e.checked=t}))}},{key:"keyPointShow",get:function(){return this.options.line.keyPoint},set:function(t){this.options.line.keyPoint=t;for(var e=0;e<this.keyPoints.length;e++)this.show&&(this.keyPoints[e].show=t);this._elms.keyPointShow&&this._elms.keyPointShow.forEach((function(e){e.checked=t})),!t&&this.lineEdit&&(vd(yd,this,t),YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.ControllerObject&&this.ControllerObject.destroy(),this.tip&&this.tip.destroy(),this.tip=null,this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t})))}},{key:"lineEdit",get:function(){return e=this,(t=yd).get(gd(t,e));var t,e},set:function(t){var e=this,i=[],n=function(t){i=e._renewLine(t),e.modelMove(i)};if(t){if(this.viewFollow=!1,YJ.Measure.GetMeasureStatus())return console.warn("上一次测量未结束"),void(this.lineEdit=!1);var o;this.ground=!1,this.smooth=!1,this.state=!1,YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("请选择一个顶点,右键取消",this.sdk),this.event=new X(this.sdk),n(L()(this.options.line.positions)),this.event.mouse_left((function(t,i){var s=e.sdk.viewer.scene.pick(t.position);if(s&&s.id&&s.id.name&&"node-secondary-edit-point"===s.id.name)for(var a=0;a<e.keyPoints.length;a++)if(e.keyPoints[a].id===s.id.id){o=s.id,e.ControllerObject.position=e.options.line.positions[o.index],e.ControllerObject.editTranslational(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.controllerCallBack=function(t){e.options.line.positions[o.index]=t.position,o.position=Cesium.Cartesian3.fromDegrees(t.position.lng,t.position.lat,t.position.alt),n(L()(e.options.line.positions))};break}})),this.event.mouse_right((function(t,i){e.keyPointShow=!1,YJ.Measure.SetMeasureStatus(!1),e.event.destroy(),e.tip&&e.tip.destroy(),e.tip=null,e.ControllerObject.destroy()})),this.event.mouse_move((function(t,i){e.tip&&e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.line.polyline.positions=new Cesium.CallbackProperty((function(){return i}),!1),this.keyPointShow=t}else this.lineEdit&&(YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip&&this.tip.destroy(),this.tip=null),this.keyPointShow=t,this.ControllerObject.destroy();vd(yd,this,t),this._elms.lineEdit&&this._elms.lineEdit.forEach((function(e){e.checked=t}))}},{key:"routeDirection",get:function(){return this.options.routeDirection},set:function(t){this.options.routeDirection=t,this._elms.routeDirection&&this._elms.routeDirection.forEach((function(e){e.checked=t}))}},{key:"loop",get:function(){return this.options.loop},set:function(t){this.options.loop=t,t?this.TweenAnimate.repeat(1/0):this.TweenAnimate.repeat(),this._elms.loop&&this._elms.loop.forEach((function(e){e.checked=t}))}},{key:"firstPersonView",get:function(){return this.options.firstPersonView},set:function(t){if(this.sdk.viewer._firstPersonView=t,this.options.firstPersonView=t,this.options.firstPersonView){if(this._DialogObject&&this._DialogObject._element.content){var e=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");e[0].className="btn is-active",e[1].className="btn"}this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null)}else{if(this._DialogObject&&this._DialogObject._element.content){var i=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");i[0]&&i[1]&&(i[0].className="btn",i[1].className="btn is-active")}if(this.viewFollow){this.sdk.viewer.trackedEntity&&this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity);var n=this.sdk.viewer.entities.add({position:this.positions_smooth[0],point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=n}}}},{key:"viewFollow",get:function(){return this.options.viewFollow},set:function(t){if(this.options.viewFollow=t,this.options.viewFollow?this.lineEdit=!1:this.firstPersonView=!1,this.options.firstPersonView){if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),this._DialogObject&&this._DialogObject._element.content){var e=this._DialogObject._element.content.querySelectorAll("button[name='firstPerson']");e[0]&&e[1]&&(e[0].className="btn",e[1].className="btn is-active")}}else if(this.sdk.viewer.trackedEntity&&(this.sdk.viewer.entities.remove(this.sdk.viewer.trackedEntity),this.sdk.viewer.trackedEntity=null),t){var i=this.sdk.viewer.entities.add({position:this.current.position,point:{color:Cesium.Color.RED.withAlpha(0),pixelSize:0}});this.sdk.viewer.trackedEntity=i}this._elms.viewFollow&&this._elms.viewFollow.forEach((function(e){e.checked=t}))}},{key:"moveCallBack",value:function(t){this.setPosition=t.setPosition.bind(t)}},{key:"current",get:function(){return this._current},set:function(t){this._current=t;var e=this.cartesian3Towgs84(this._current.position,this.sdk.viewer);this.setPosition&&this.setPosition(dd(dd({},this._current),{},{position:dd({},e)}))}},{key:"modelMove",value:(s=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w,k,x,_,E,S,D=this,P=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(S=function(t,e){var i=Cesium.Transforms.eastNorthUpToFixedFrame(t);if(e){var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),o=Cesium.Matrix4.multiplyByPointAsVector(Cesium.Matrix4.inverse(i,new Cesium.Matrix4),n,new Cesium.Cartesian3),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),a=Math.atan2(s.y,s.x)-Cesium.Math.PI_OVER_TWO,r=Cesium.Math.PI_OVER_TWO-Cesium.Math.acosClamped(s.z),l=r*(180/Math.PI);r=l*(Math.PI/180);var c=Cesium.Math.fastApproximateAtan2(s.x,s.z);return{heading:Cesium.Math.TWO_PI-Cesium.Math.zeroToTwoPi(a),pitch:r,roll:c}}},E=function(){return(E=o()(a.a.mark((function t(e){var i,o,s,r,c,u,p,d,y,b,C,w,k,_,E,D,P,M,O,T;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=h,!(i=e)){t.next=10;break}return t.next=6,turf.lineSliceAlong(h,0,i,{units:"kilometers"});case 6:r=t.sent,o=L()(r.geometry.coordinates[r.geometry.coordinates.length-1]),t.next=11;break;case 10:o=L()(h.geometry.coordinates[0]);case 11:if(!n.ground){t.next=38;break}return t.next=14,n.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(o[0],o[1]),g);case 14:return p=t.sent,(c=p)||(c=new Cesium.Cartesian3.fromDegrees(o[0],o[1])),d=n.cartesian3Towgs84(c,l),y=0,t.prev=19,t.next=22,Cesium.sampleTerrainMostDetailed(n.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 22:b=t.sent,y=b[0].height,t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),y=0;case 29:for(d.alt<y&&(d.alt=y),d.alt=Number(d.alt.toFixed(1)),c=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,d.alt),u=Cesium.Cartesian3.fromDegrees(o[0],o[1],n.cartesian3Towgs84(c,n.sdk.viewer).alt+1),C=[],w=0;w<s.geometry.coordinates.length;w++)C.push(s.geometry.coordinates[w][0],s.geometry.coordinates[w][1]);n.realTimePositions=Cesium.Cartesian3.fromDegreesArray(C),t.next=54;break;case 38:k=n.spline.evaluate(e/n.distance),o=n.cartesian3Towgs84(k,l),c=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt),u=Cesium.Cartesian3.fromDegrees(o.lng,o.lat,o.alt+1),_=[],E=0;case 44:if(!(E<=100)){t.next=52;break}if(!(E/100>e/n.distance)){t.next=47;break}return t.abrupt("break",52);case 47:D=n.spline.evaluate(E/100),_.push(D);case 49:E++,t.next=44;break;case 52:_.push(k),n.realTimePositions=_;case 54:if(m=S(n.current.position,c),v&&v.position&&(f=S(v.position,c),m.pitch=f.pitch),v.position=n.current.position,P=Cesium.HeadingPitchRoll.fromDegrees(n.current.heading,n.current.pitch,n.current.roll),M=0,O=0,T=0,n.options.routeDirection?(M=(m.heading-P.heading)*(180/Math.PI)-90+n.current.heading,O=m.pitch*(180/Math.PI)):(M=n.current.heading,O=n.current.pitch),T=n.current.roll,!(isNaN(M)||isNaN(O)||isNaN(T))){t.next=65;break}return t.abrupt("return");case 65:(M<0||M>180)&&(O=-O),n.current={position:c,heading:M,pitch:O,roll:T},x&&(x=!1,n._first={position:c,heading:M,pitch:O,roll:T}),n.realTimeRouteArray.push(c),n.viewFollow&&(n.options.firstPersonView?n.sdk.viewer.camera.setView({destination:u,orientation:{heading:n.sdk.viewer.camera.heading,pitch:n.sdk.viewer.camera.pitch,roll:n.sdk.viewer.camera.roll}}):n.sdk.viewer.trackedEntity&&(n.sdk.viewer.trackedEntity.position=c));case 71:case"end":return t.stop()}}),t,null,[[19,26]])})))).apply(this,arguments)},_=function(t){return E.apply(this,arguments)},i=P.length>1&&void 0!==P[1]?P[1]:{time:0},n=this,s=i.time||0,r=i.distance||0,l=this.sdk.viewer,this.removeModelAnimate(),c=[],u=0;u<e.length;u++)p=this.cartesian3Towgs84(e[u],l),c.push([p.lng,p.lat,p.alt]);h=turf.lineString(c),this.distance=turf.length(h,{units:"kilometers"}),this.totalTime||(this.totalTime=1e3*this.distance/this.options.speed),d=this.totalTime,s&&(s>d&&(s=d),r=s/d*this.distance),v={},g=[],b=ud(this.sdk.entityMap);try{for(b.s();!(C=b.n()).done;)(w=y()(C.value,2))[0],(k=w[1]).type&&"glb"===k.type&&g.push(k.entity)}catch(t){b.e(t)}finally{b.f()}x=!0,this.TweenAnimate=new TWEEN.Tween({distance:r}).to({distance:this.distance},1e3*(d-s)).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop?1/0:0).onRepeat((function(){s&&D.modelMove(e)})).onUpdate(function(){var t=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(D.TweenAnimate._duration!=1/0){t.next=2;break}return t.abrupt("return");case 2:if(D.sdk.viewer){t.next=6;break}return D.removeModelAnimate(),t.abrupt("return");case 6:_(e.distance);case 7:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}()).onEveryStart((function(){D.realTimeRouteArray=[]})).onComplete((function(t){D.state=!1,D.removeModelAnimate()})),this.state?this.TweenAnimate.start():_(r);case 26:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"setMovePositionByDistance",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{distance:t})}},{key:"setMovePositionByTime",value:function(t){var e=this._renewLine(this.options.line.positions);this.modelMove(e,{time:t}),this.state||this.modelMove(e,{time:t+.01})}},{key:"pause",value:function(){this.state=!1}},{key:"resume",value:function(){this.state=!0}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.length>0&&void 0!==c[0]?c[0]:{},pi(0),ii(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=22;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},(l=dd({},this.options.line.positions[0])).hasOwnProperty("alt")){t.next=15;break}return t.next=14,this.getClampToHeight(l);case 14:l.alt=t.sent;case 15:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=23;break;case 22:this.line&&this.sdk.viewer.flyTo(this.line,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 23:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:function(){this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.line),this.line=null,this.removeModelAnimate()}},{key:"reset",value:function(){this.modelMove(this.line.polyline.positions._value),this.state=!1,this.current=this._first}},{key:"removeModelAnimate",value:function(){this.TweenAnimate&&(clearTimeout(this.TweenAnimate.timeout),TWEEN.remove(this.TweenAnimate),this.TweenAnimate=null)}},{key:"_renewLine",value:function(t){this.options.line.positions=t;var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,o}},{key:"renewLinePositions",value:function(t){this.options.line.positions=t;var e=t;this.noseToTail&&(e=[].concat(L()(t),[t[0]]));for(var i=[],n=[],o=[],s=0;s<e.length;s++)i.push(e[s].lng,e[s].lat,e[s].alt),n.push(s/(e.length-1));this.smooth?this.spline=new Cesium.CatmullRomSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)}):this.spline=new Cesium.LinearSpline({times:n,points:Cesium.Cartesian3.fromDegreesArrayHeights(i)});for(var a=0;a<=100;a++){var r=this.spline.evaluate(a/100);o.push(r)}return this.positions_smooth=o,this.line&&this.line.polyline&&(this.line.polyline.positions=o),o}},{key:"flicker",value:function(){}}],[{key:"addLine",value:function(t){var i=t._renewLine(t.options.line.positions);t.current.position=i[0],t.line=t.sdk.viewer.entities.add({id:t.options.id+"-2",show:!!t.options.show&&t.options.line.show,polyline:{positions:i,width:2,clampToGround:t.ground,material:Cesium.Color.fromCssColorString("#ffffff"),zIndex:t.sdk._entityZIndex}}),t.realTimeLine=t.sdk.viewer.entities.add({id:t.options.id+"-3",show:!!t.options.realTimeRoute&&t.options.realTimeRoute,polyline:{positions:new Cesium.CallbackProperty((function(){return t.realTimePositions}),!1),width:2,clampToGround:t.ground,zIndex:t.sdk._entityZIndex,material:Cesium.Color.fromCssColorString("#ff0000")}}),t.sdk._entityZIndex++,new X(t.sdk).mouse_right((function(e,i){t.viewFollow=!1})),e.addKeyPoint(t),t.noseToTail=t.options.line.noseToTail,t.smooth=t.options.line.smooth}},{key:"addModel",value:function(t){}},{key:"addKeyPoint",value:(i=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<e.options.line.positions.length)){t.next=13;break}return t.next=4,e.getClampToHeight(e.options.line.positions[i]);case 4:return n=t.sent,t.next=7,Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,n);case 7:o=t.sent,s=e.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:i,show:e.options.line.keyPoint||!1,position:e.ground?o:Cesium.Cartesian3.fromDegrees(e.options.line.positions[i].lng,e.options.line.positions[i].lat,e.options.line.positions[i].alt),billboard:{image:e.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}}),e.keyPoints.push(s);case 10:i++,t.next=1;break;case 13:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s}(Wn);function Cd(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var wd=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Cd(this,e,[t,n])).options.width=n.width||1,i.options.color=n.color||"#ff0000",i._elms={},i._EventBinding=new wn,e.edit(i,!0),i}return sn()(e,t),_()(e,[{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color&&(this.options.color=t,this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o})))}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t,this._elms.width&&this._elms.width.forEach((function(e){e.value=t}))}},{key:"start",value:function(){var t,i,n,o,s,a=this;if(YJ.Measure.GetMeasureStatus())console.log("上一次测量未结束");else{this.sdk.viewer;Ke(this.sdk,!1),(t=e,i="start",n=this,o=3,s=ya()(nn()(1&o?t.prototype:t),i,n),2&o&&"function"==typeof s?function(t){return s.apply(n,t)}:s)([]),YJ.Measure.SetMeasureStatus(!0),this.tip=new Z("长按左键,拖动鼠标进行涂鸦,右键结束涂鸦",this.sdk),this.event=new X(this.sdk),this.positions=[],this.points_ids=[];var r=[],l=[];this.event.mouse_left_down((function(t,e){l=[];var i=a.sdk.viewer.entities.add({name:"涂鸦",polyline:{positions:new Cesium.CallbackProperty((function(){return l}),!1),width:a.width,clampToGround:!0,material:Cesium.Color.fromCssColorString(a.color),zIndex:99999999}});r.push(i),a.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y),l.push(e)}))})),this.event.mouse_left_up((function(t,e){r[r.length-1].polyline.positions=l,a.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)}))})),this.event.mouse_move((function(t,e){a.tip.setPosition(e,t.endPosition.x,t.endPosition.y)})),this.event.mouse_right((function(t,e){a.end()})),this.event.gesture_pinck_start((function(t,e){var i=new Date;a.event.gesture_pinck_end((function(){new Date-i>=500&&a.end()}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event&&this.event.destroy(),this.event=void 0,this.tip&&this.tip.destroy(),this.tip=void 0,Ke(this.sdk,!0)}},{key:"remove",value:function(){this.end(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);for(var t=this.sdk.viewer.entities.values,e=t.length-1;e>=0;e--)"涂鸦"===t[e].name&&this.sdk.viewer.entities.remove(t[e])}},{key:"flicker",value:function(){}}],[{key:"edit",value:(i=o()(a.a.mark((function t(i,n){var o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=22;break}return t.next=3,new W(i.sdk.viewer._container,{title:"涂鸦参数"});case 3:return i._DialogObject=t.sent,t.next=6,i._DialogObject.init();case 6:(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">涂鸦颜色</span>\n <div class="color"></div>\n </div>\n <div class="col">\n <span class="label">线条宽度</span>\n <div class="input-number input-number-unit-2" style="width: 80px;">\n <input class="input" type="number" title="" min="1" max="99" step="1" @model="width">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n ',i._DialogObject.contentAppChild(o),s=new YJColorPicker({el:o.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:i.color,disabled:!1,openPickerAni:"opacity",sure:function(t){i.color=t},clear:function(){i.color="rgba(255,255,255,1)"}}),i._DialogObject._element.body.className=i._DialogObject._element.body.className+" graffiti",r=o.getElementsByTagName("*"),i._EventBinding.on(i,r),i._elms=i._EventBinding.element,i._elms.color=[s],(l=document.createElement("button")).className="confirm",l.innerHTML="确认",i._DialogObject.footAppChild(l),l.addEventListener("click",(function(){i.start(),e.edit(i,!1)})),t.next=23;break;case 22:i._DialogObject&&i._DialogObject.close&&(i._DialogObject.close(),i._DialogObject=null);case 23:case"end":return t.stop()}}),t)}))),function(t,e){return i.apply(this,arguments)})}]);var i}(Ca),kd=i(14),xd=i.n(kd);function _d(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ed(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ed(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ed(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Sd(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Dd(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Sd(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Sd(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Pd(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Md=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Pd(this,e,[t,n])).options.name=n.name||"未命名对象",i.options.show=!n.show&&!1!==n.show||n.show,i.options.url=n.url,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.position=n.position,i.options.offset=n.offset||{x:.5,y:1},i.options.mode=i.options.mode?1:0,i.options.billboard=n.billboard||{},i.options.billboard.scale=i.options.billboard.scale||1,i.options.billboard.near=i.options.billboard.near||0===i.options.billboard.near?i.options.billboard.near:2e3,i.options.billboard.far=i.options.billboard.far||0===i.options.billboard.far?i.options.billboard.far:1e5,i.options.billboard.scaleByDistance=!!i.options.billboard.scaleByDistance,n.label=n.label||{},i.options.label=n.label||{},i.options.label.text=n.label.text||i.options.name,i.options.name=i.options.label.text,i.options.label.show=!n.label.show&&!1!==n.label.show||n.label.show,i.options.label.fontFamily=n.label.fontFamily||0,i.options.label.fontSize=n.label.fontSize||39,i.options.label.color=n.label.color||"#00ffff",i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.heightMode=n.heightMode||0==n.heightMode?n.heightMode:3,i.entity={id:i.options.id},i._positionEditing=!1,i.Dialog=o,i._elms={},i._proj=i.sdk.proj,i.previous={position:Dd({},i.options.position)},i._EventBinding=new wn,i.event=new X(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return sn()(e,t),_()(e,[{key:"name",get:function(){return this.options.name},set:function(t){var i,n,o,s,a,r;i=e,n="name",o=t,s=this,a=1,r=1,xd()(nn()(r?i.prototype:i),n,o,s,a),this.options.label.text=this.options.name,this.entity&&(this.entity.label.text=this.options.label.text)}},{key:"mode",get:function(){return this.options.mode},set:function(t){var e=this;this.options.mode=t?1:0;for(var i=[{name:"贴地",value:"贴地",key:0},{name:"立体",value:"立体",key:1}],n=function(t){if(i[t].key===e.options.mode)return e._elms.mode&&e._elms.mode.forEach((function(e){e.value=i[t].value})),1},o=0;o<i.length&&!n(o);o++);if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.body){for(var s=this._DialogObject._element.body.getElementsByClassName("row"),a=this._DialogObject._element.foot.getElementsByTagName("button"),r=this._DialogObject._element.foot.getElementsByTagName("h4"),l=0;l<s.length;l++){var c=s[l].getAttribute("mode");null!==c&&(c==this.options.mode?s[l].style.display="flex":s[l].style.display="none")}for(var u=0;u<a.length;u++){var p=a[u].getAttribute("mode");null!==p&&(p==this.options.mode?a[u].style.display="block":a[u].style.display="none")}for(var h=0;h<r.length;h++){var d=r[h].getAttribute("mode");null!==d&&(d==this.options.mode?r[h].style.display="block":r[h].style.display="none")}}var m=new Image;m.crossOrigin="Anonymous",m.src=this.replaceHost(this.options.url,this.options.host),m.onload=function(){var t=document.createElement("canvas"),i=t.getContext("2d");if(e.mode){var n=e.entity.billboard.image.getValue(),o=n.height*(128/n.width);e.entity.billboard.pixelOffset={x:-128*e.billboardScale*e.options.offset.x,y:-o*e.billboardScale*e.options.offset.y},e.entity.billboard.show=!0,e.labelShow&&(e.entity.label.show=!0),e.entity.rectangle.show=!1}else t.width=2*m.width,t.height=2*m.height,e.flipeX&&(i.scale(1,-1),i.translate(0,-t.height)),e.flipeY&&(i.scale(-1,1),i.translate(-t.width,0)),i.drawImage(m,m.width-m.width*e.options.offset.x,m.height-m.height*e.options.offset.y),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}),e.entity.billboard.show=!1,e.entity.label.show=!1,e.entity.rectangle.show=!0}}},{key:"offset",get:function(){return this.options.offset},set:function(t){var e=this;this.options.offset=t;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");if(e.mode){var o=e.entity.billboard.image.getValue(),s=o.height*(128/o.width);e.entity.billboard.pixelOffset={x:-128*e.billboardScale*e.options.offset.x,y:-s*e.billboardScale*e.options.offset.y},e.entity.billboard.show=!0,e.labelShow&&(e.entity.label.show=!0),e.entity.rectangle.show=!1}else t.width=2*i.width,t.height=2*i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,i.width-i.width*e.options.offset.x,i.height-i.height*e.options.offset.y),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}),e.entity.billboard.show=!1,e.entity.label.show=!1,e.entity.rectangle.show=!0}}},{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"billboardScale",get:function(){return this.options.billboard.scale},set:function(t){var e=Number(t.toFixed(2));e>99&&(e=99),e<.1&&(e=.1),this.options.billboard.scale=e,this.renewPoint(),this._elms.billboardScale&&this._elms.billboardScale.forEach((function(e){e.value=t}))}},{key:"billboardScaleByDistance",get:function(){return this.options.billboard.scaleByDistance},set:function(t){this.options.billboard.scaleByDistance=t,this.renewPoint(),this._elms.billboardScaleByDistance&&this._elms.billboardScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"billboardNear",get:function(){return this.options.billboard.near},set:function(t){var e=t;e>this.billboardFar&&(e=this.billboardFar),this.options.billboard.near=e,this.renewPoint(),this._elms.billboardNear&&this._elms.billboardNear.forEach((function(t){t.value=e}))}},{key:"billboardFar",get:function(){return this.options.billboard.far},set:function(t){var e=t;e<this.billboardNear&&(e=this.billboardNear),this.options.billboard.far=e,this.renewPoint(),this._elms.billboardFar&&this._elms.billboardFar.forEach((function(t){t.value=e}))}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.y=t,!this.entity)return;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");e.mode||(t.width=2*i.width,t.height=2*i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,i.width-i.width*e.options.offset.x,i.height-i.height*e.options.offset.y),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}),e.entity.billboard.show=!1,e.entity.label.show=!1,e.entity.rectangle.show=!0)}}else console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){var e=this;if("boolean"==typeof t){if(this.options.flipe.x=t,!this.entity)return;var i=new Image;i.crossOrigin="Anonymous",i.src=this.replaceHost(this.options.url,this.options.host),i.onload=function(){var t=document.createElement("canvas"),n=t.getContext("2d");e.mode||(t.width=2*i.width,t.height=2*i.height,e.flipeX&&(n.scale(1,-1),n.translate(0,-t.height)),e.flipeY&&(n.scale(-1,1),n.translate(-t.width,0)),n.drawImage(i,i.width-i.width*e.options.offset.x,i.height-i.height*e.options.offset.y),e.entity.rectangle.material=new Cesium.ImageMaterialProperty({image:t,transparent:!0}),e.entity.billboard.show=!1,e.entity.label.show=!1,e.entity.rectangle.show=!0)}}else console.error("参数必须为boolean")}},{key:"heightMode",get:function(){return this.options.heightMode?this.options.heightMode:0},set:function(t){var e;this.options.heightMode=t||0,this.options.heightMode=t||0==t?t:3;var i,n,o="";switch(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&(i=this._DialogObject._element.content.getElementsByClassName("alt-box")[0]),this._elms.height&&(n=this._elms.height.getElementsByClassName("input-number")[0]),this.options.heightMode){case"0":case 0:i&&(i.className="input-number input-number-unit-1 alt-box"),n&&(n.className="input-number input-number-unit-1"),e=Cesium.HeightReference.NONE,o="海拔高度";break;case"1":case 1:i&&(i.className="input-number input-number-unit-1 alt-box"),n&&(n.className="input-number input-number-unit-1"),e=Cesium.HeightReference.NONE,o="相对地表";break;case"2":case 2:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",i&&(i.className="input-number input-number-unit-1 alt-box disabled"),o="依附地表",e=Cesium.HeightReference.CLAMP_TO_GROUND,n&&(n.className="input-number input-number-unit-1 disabled");break;case"3":case 3:i&&(i.className="input-number input-number-unit-1 alt-box disabled"),n&&(n.className="input-number input-number-unit-1 disabled"),e=Cesium.HeightReference.NONE,o="依附模型"}this.entity&&this.entity.billboard&&(this.entity.billboard.heightReference=e),this._elms.heightMode&&(this._elms.heightMode.value=o)}},{key:"coordinate",get:function(){return this.options.coordinate},set:function(t){this.options.coordinate=t}},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,this.coordinate=this.options.coordinate,this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(t){var i=[n[0],n[1],t];e.options.text.position={lng:n[0],lat:n[1],alt:t},e.text&&(e.text.position=i)}))}if(this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e.options.position.lng})),this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e.options.position.lat})),this._elms.height){var o=this._elms.height.getElementsByClassName("height")[0];if(o)switch(this._elms.heightMode.value){case"海拔高度":o.value=this.options.position.alt;break;case"相对地表":this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]).then((function(t){o.value=Number((e.options.position.alt-t[0].height).toFixed(2)),e._elms.alt&&e._elms.alt.forEach((function(t){t.value=e.options.position.alt}))})):(o.value=Number(Number(this.options.position.alt).toFixed(2)),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=e.options.position.alt})));break;case"依附地表":case"依附地表":break;case"依附模型":this.updateHeight()}}}},{key:"labelShow",get:function(){return this.options.label.show},set:function(t){this.options.label.show=t,this.entity&&(1==this.mode?this.entity.label.show=t:this.entity.label.show=!1),this._elms.labelShow&&this._elms.labelShow.forEach((function(e){e.value=t}))}},{key:"labelFontFamily",get:function(){return this.options.label.fontFamily},set:function(t){this.options.label.fontFamily=t||0,this.renewPoint();var e=Zn(this.labelFontFamily)||"";this._elms.labelFontFamily&&this._elms.labelFontFamily.forEach((function(t){t.value=e}))}},{key:"labelFontSize",get:function(){return this.options.label.fontSize},set:function(t){this.options.label.fontSize=t,this.renewPoint(),this._elms.labelFontSize&&this._elms.labelFontSize.forEach((function(e){e.value=t}))}},{key:"labelColor",get:function(){return this.options.label.color},set:function(t){var e=this;this.options.label.color=t||"#00ffff",this.renewPoint(),this._elms.labelColor&&this._elms.labelColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.options.label.color,disabled:!1,openPickerAni:"opacity",sure:function(t){e.labelColor=t},clear:function(){e.labelColor="rgba(0,255,255,1)"}});e._elms.labelColor[i]=n}))}},{key:"create",value:(l=o()(a.a.mark((function t(){var e,i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=this,n=Xn(this.labelFontFamily)||"Helvetica",t.t0=this.options.heightMode,t.next=2===t.t0||"2"===t.t0?5:7;break;case 5:return i=Cesium.HeightReference.CLAMP_TO_GROUND,t.abrupt("break",7);case 7:return t.next=9,fetch(this.replaceHost(this.options.url,this.options.host),{method:"get",headers:{"Content-Type":"application/json"}});case 9:t.sent.ok&&((o=new Image).crossOrigin="Anonymous",o.src=this.replaceHost(this.options.url,this.options.host),o.onload=function(){var t=document.createElement("canvas"),a=t.getContext("2d"),r=document.createElement("canvas"),l=r.getContext("2d"),c=o.width,u=o.height;r.width=c,r.height=u,l.drawImage(o,0,0,c,u),t.width=2*o.width,t.height=2*o.height,s.flipeX&&(a.scale(1,-1),a.translate(0,-t.height)),s.flipeY&&(a.scale(-1,1),a.translate(-t.width,0)),a.drawImage(o,o.width-o.width*s.options.offset.x,o.height-o.height*s.options.offset.y);var p=u*(128/c);s.entity=s.sdk.viewer.entities.add({id:s.options.id,show:s.options.show,position:new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegrees(s.options.position.lng,s.options.position.lat,s.options.position.alt||0)})),billboard:{show:!!s.mode,image:r,scale:s.billboardScale,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,width:128,height:p,horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.TOP,pixelOffset:{x:-128*s.billboardScale*s.options.offset.x,y:-p*s.billboardScale*s.options.offset.y}},label:{show:!!s.mode&&e.options.label.show,text:e.options.label.text,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1),heightReference:i,font:e.options.label.fontSize+"px "+n,fillColor:Cesium.Color.fromCssColorString(e.options.label.color),pixelOffset:new Cesium.CallbackProperty((function(){return e.options.show?new Cesium.Cartesian2(0,-p*e.billboardScale-e.options.label.fontSize/2-5):new Cesium.Cartesian2(0,-e.options.label.fontSize/2-5)}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE},rectangle:{show:!s.mode,coordinates:new Cesium.CallbackProperty((function(){var t,e=Math.abs(Math.cos(Math.PI/180*s.options.position.lat))*(1e-4*s.options.scale),i={x:s.flipeY?Math.abs(s.options.offset.x-1):s.options.offset.x,y:s.flipeX?Math.abs(s.options.offset.y-1):s.options.offset.y};i={lng:i.x*(1e-4*s.options.scale*2),lat:Math.abs(i.y-1)*(2*e)};var n=[s.options.position.lng-1e-4*s.options.scale,s.options.position.lat-e,s.options.position.lng+1e-4*s.options.scale,s.options.position.lat+e];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1),material:new Cesium.ImageMaterialProperty({image:t,transparent:!0}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(s.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(s.options.angle)}),!1)}}),s.renewPoint(),"cesium-viewer 2d"===s.sdk.viewer._element.className&&(s.entity.rectangle.height=0),Pe(s.sdk,s.options.id),s.options.show&&Kt(0,s.options.id)});case 11:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"edit",value:(r=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=27;break}return n=function(t){!function e(i){if(i)if(i===r._element.body){var n=t.x-i.getBoundingClientRect().left,o=t.y-i.getBoundingClientRect().top,s={x:Number(((n-42)/l.width).toFixed(2)),y:Number(((o-71)/l.height).toFixed(2))};s.x<0&&(s.x=0),s.x>1&&(s.x=1),s.y<0&&(s.y=0),s.y>1&&(s.y=1),u={x:s.x,y:s.y},c.style.top="calc(".concat(100*u.y,"% - 5px)"),c.style.left="calc(".concat(100*u.x,"% - 5px)")}else e(i.offsetParent)}(t.target)},s=function(){r&&r._element.body.removeEventListener("mousemove",n)},t.next=8,new rn(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(t){w.name=w.name.trim(),w.name||(w.name="未命名对象"),w.originalOptions=w.deepCopyObj(w.options),w._DialogObject.close(),w.Dialog.confirmCallBack&&w.Dialog.confirmCallBack(w.originalOptions)},resetCallBack:function(){w.reset(),w.Dialog.resetCallBack&&w.Dialog.resetCallBack()},removeCallBack:function(){w.Dialog.removeCallBack&&w.Dialog.removeCallBack()},closeCallBack:function(){w.previous=null,w.reset(),r&&r.close&&r.close(),w.Dialog.closeCallBack&&w.Dialog.closeCallBack(),YJ.Measure.SetMeasureStatus(!1),w.positionEditing=!1},showCallBack:function(t){w.show=t,w.Dialog.showCallBack&&w.Dialog.showCallBack()},translationalCallBack:function(){w.positionEditing=!w.positionEditing},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){w.flipeY=!w.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){w.flipeX=!w.flipeX}]}]},!0);case 8:for(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-image",(p=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="anchor btn">调整锚点</button>\n </div>\n <div class="col mode-box">\n <span class="label" style="flex: unset;">军标模式</span>\n <div class="mode"></div>\n </div>\n </div>\n <div class="row" mode="0">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="0">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="40000" min="0" step="0.1" @model="scale">\n <div class="input-number input-number-unit-1" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="40000" step="0.1" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="1">\n <div class="col height-mode-box" style="flex: 0 0 155px;margin-right: 10px;">\n <span class="label" style="flex: 0 0 56px;">高度模式</span>\n <div class="height-mode"></div>\n </div>\n <div class="col" style="margin: 0 10px;">\n <div class="height-box" style="display: flex; align-items: center;">\n <span class="label" style="flex: 0 0 56px;">高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input height" type="number" title="" min="-9999999" max="999999999">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">图标倍数</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" data-min="0.1" max="99" @model="billboardScale">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row" mode="1">\n <div class="col" style="flex: 0 0 155px;margin-right: 10px;">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="billboardScaleByDistance">\n </div>\n <div class="col" style="margin: 0 10px;">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="billboardNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="billboardFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <h4 mode="1">文字设置</h4>\n <div class="row" mode="1">\n <div class="col" style="flex: 0 0 80px;margin: 0 10px;">\n <span class="label" style="flex: none;">显隐</span>\n <input class="btn-switch" type="checkbox" @model="labelShow">\n </div>\n <div class="col font-select-box" style="margin: 0 0px;flex: 0 0 150px;">\n <span class="label" style="flex: none;">字体选择</span>\n <div class="input input-select font-select"></div>\n </div>\n <div class="col" style="margin: 0 10px;">\n <span class="label">文字大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="labelFontSize" style="width: 70px;">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col" style="margin-left: 10px;">\n <span class="label">文字颜色</span>\n <div class="labelColor"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(p),h=p.getElementsByTagName("*"),this._EventBinding.on(this,h),this._elms=this._EventBinding.element,p.getElementsByClassName("anchor")[0].addEventListener("click",o()(a.a.mark((function t(){var e,o,p,h;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r&&r.close&&r.close(),document.body.addEventListener("mouseup",s),e=i._DialogObject._element.body.getBoundingClientRect(),t.next=5,new rn(w.sdk,w.originalOptions,{title:"锚点设置",left:e.left+80+"px",top:e.top+200+"px",confirmCallBack:function(t){i.offset={x:u.x,y:u.y},o.close()},closeCallBack:function(){document.body.removeEventListener("mouseup",s)}},!1);case 5:o=t.sent,r=o,o._element.body.className=o._element.body.className+" anchor-point",p=document.createElement("div"),(h=new Image).src=w.replaceHost(w.options.url,w.options.host),h.onload=function(){var t=150/(h.width/h.height),e=(l=document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});l.width=150,l.height=t,l.style.display="block",e.drawImage(h,0,0,150,t),p.appendChild(l),o.contentAppChild(p),(c=document.createElement("span")).className="point",p.appendChild(c),u={x:i.offset.x,y:i.offset.y},c.style.top="calc(".concat(100*Number(u.y),"% - 6px)"),c.style.left="calc(".concat(100*Number(u.x),"% - 6px)"),l.addEventListener("click",(function(t){var e=t.offsetX,i=t.offsetY,n={x:Number((e/l.width).toFixed(2)),y:Number((i/l.height).toFixed(2))};n.x<0&&(n.x=0),n.x>1&&(n.x=1),n.y<0&&(n.y=0),n.y>1&&(n.y=1),u={x:n.x,y:n.y},c.style.top="calc(".concat(100*u.y,"% - 5px)"),c.style.left="calc(".concat(100*u.x,"% - 5px)")})),c.addEventListener("mousedown",(function(t){o._element.body.addEventListener("mousemove",n)}))};case 12:case"end":return t.stop()}}),t)})))),d=p.getElementsByClassName("row"),m=p.getElementsByTagName("h4"),f=0;f<d.length;f++)null!==(v=d[f].getAttribute("mode"))&&(v==this.options.mode?d[f].style.display="flex":d[f].style.display="none");for(g=0;g<m.length;g++)null!==(b=m[g].getAttribute("mode"))&&(b==this.options.mode?m[g].style.display="block":m[g].style.display="none");C=new YJColorPicker({el:p.getElementsByClassName("labelColor")[0],size:"mini",alpha:!0,defaultColor:this.labelColor,disabled:!1,openPickerAni:"opacity",sure:function(t){w.labelColor=t},clear:function(){w.labelColor="rgba(255,255,255,1)"}}),this._elms.labelColor=[C],setTimeout(o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d,m,f,v,g,b,C,k,x,_,E,S;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w._DialogObject._element.foot.getElementsByClassName("flipe-over-x")[0],i=w._DialogObject._element.foot.getElementsByClassName("flipe-over-y")[0],e.setAttribute("mode",0),i.setAttribute("mode",0),w.options.mode?(e.style.display="none",i.style.display="none"):(e.style.display="block",i.style.display="block"),n=[{name:"贴地",value:"贴地",key:0},{name:"立体",value:"立体",key:1}],!(s=Y(w._DialogObject._element.content.getElementsByClassName("mode-box")[0],".mode"))){t.next=22;break}s.legp_search(n),(r=w._DialogObject._element.content.getElementsByClassName("mode")[0].getElementsByTagName("input")[0]).value=w.mode,l=0;case 12:if(!(l<n.length)){t.next=20;break}if(n[l].key!==w.mode){t.next=17;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),t.abrupt("break",20);case 17:l++,t.next=12;break;case 20:r.addEventListener("input",(function(){for(var t=0;t<n.length;t++)if(n[t].value===r.value){w.mode=n[t].key;break}})),w._elms.mode=[r];case 22:c=w._DialogObject._element.content.getElementsByClassName("height-box")[0],u=c.getElementsByClassName("height")[0],p=[{name:"海拔高度",value:"海拔高度",key:"0"},{name:"相对地表",value:"相对地表",key:"1"},{name:"依附地表",value:"依附地表",key:"2"},{name:"依附模型",value:"依附模型",key:"3"}],h=w.heightMode,t.t0=h,t.next=0===t.t0||"0"===t.t0?29:1===t.t0||"1"===t.t0?31:2===t.t0||"2"===t.t0||3===t.t0||"3"===t.t0?33:38;break;case 29:return u.value=w.options.position.alt,t.abrupt("break",38);case 31:return w.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]).then((function(t){u.value=Number((w.options.position.alt-Number(t[0].height.toFixed(2))).toFixed(2))})):u.value=Number(w.options.position.alt.toFixed(2)),t.abrupt("break",38);case 33:d=[],m=_d(w.sdk.entityMap);try{for(m.s();!(f=m.n()).done;)(v=y()(f.value,2))[0],"RadarScanStereoscopic"===(g=v[1]).type&&g.entity&&d.push(g.entity)}catch(t){m.e(t)}finally{m.f()}return w.getClampToHeight(w.options.position,d).then((function(t){w.options.position.alt=Number(t.toFixed(2)),w.coordinate=w.options.coordinate,w._elms.alt&&w._elms.alt.forEach((function(t){t.value=w.options.position.alt})),u.value=w.options.position.alt})),t.abrupt("break",38);case 38:if(!(b=Y(w._DialogObject._element.content.getElementsByClassName("height-mode-box")[0],".height-mode"))){t.next=56;break}b.legp_search(p),(C=w._DialogObject._element.content.getElementsByClassName("height-mode")[0].getElementsByTagName("input")[0]).value=p[w.heightMode].value,k=0;case 44:if(!(k<p.length)){t.next=51;break}if(p[k].value!=C.value){t.next=48;break}return b.legp_searchActive(p[k].value),t.abrupt("break",51);case 48:k++,t.next=44;break;case 51:C.addEventListener("input",(function(){for(var t=0;t<p.length;t++)if(p[t].value===C.value){switch(h=p[t].key){case 0:case"0":w.options.position.alt=Number(u.value),w.heightMode=0;break;case 1:case"1":w.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]).then((function(t){w.options.position.alt=Number(u.value)+Number(t[0].height.toFixed(2))})):w.options.position.alt=Number(u.value),w.heightMode=1;break;case 2:case"2":w.heightMode=2;break;case 3:case"3":var e,i=[],n=_d(w.sdk.entityMap);try{for(n.s();!(e=n.n()).done;){var o=y()(e.value,2),s=(o[0],o[1]);"RadarScanStereoscopic"===s.type&&s.entity&&i.push(s.entity)}}catch(t){n.e(t)}finally{n.f()}w.getClampToHeight(w.options.position,i).then((function(t){w.options.position.alt=Number(t.toFixed(2))})),w.heightMode=3}w.position=w.options.position;break}})),u.addEventListener("blur",o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=h,t.next=0===t.t0||"0"===t.t0?3:1===t.t0||"1"===t.t0?5:2===t.t0||"2"===t.t0?14:15;break;case 3:return w.options.position.alt=Number(Number(u.value).toFixed(2)),t.abrupt("break",15);case 5:if(!w.sdk.viewer.scene.terrainProvider.availability){t.next=12;break}return t.next=8,Cesium.sampleTerrainMostDetailed(w.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(w.options.position.lng,w.options.position.lat)]);case 8:e=t.sent,w.options.position.alt=Number(u.value)+Number(e[0].height.toFixed(2)),t.next=13;break;case 12:w.options.position.alt=Number(u.value);case 13:case 14:return t.abrupt("break",15);case 15:w.position=w.options.position;case 16:case"end":return t.stop()}}),t)})))),w._elms.height=c,w._elms.heightMode=C,w.heightMode=w.heightMode;case 56:if(x=qn(),!(_=Y(w._DialogObject._element.content.getElementsByClassName("font-select-box")[0],".font-select"))){t.next=72;break}_.legp_search(x),(E=w._DialogObject._element.content.getElementsByClassName("font-select")[0].getElementsByTagName("input")[0]).value=x[w.labelFontFamily].value,S=0;case 63:if(!(S<x.length)){t.next=70;break}if(x[S].value!=E.value){t.next=67;break}return _.legp_searchActive(x[S].value),t.abrupt("break",70);case 67:S++,t.next=63;break;case 70:E.addEventListener("input",(function(){for(var t=0;t<x.length;t++)if(x[t].value===E.value){w.labelFontFamily=x[t].key;break}})),w._elms.labelFontFamily=[E];case 72:case"end":return t.stop()}}),t)}))),0),t.next=28;break;case 27:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 28:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=t,!0===t?(this.previous={position:Dd({},this.options.position)},this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.position.lng=n.lng,e.options.position.lat=n.lat,e.options.position.alt=n.alt,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.position.lng=n.lng,e.options.position.lat=n.lat,e.options.position.alt=n.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.previous=null,e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.options.position.lng=e.previous.position.lng,e.options.position.lat=e.previous.position.lat,e.options.position.alt=e.previous.position.alt,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.options.position.lng=e.previous.position.lng,e.options.position.lat=e.previous.position.lat,e.options.position.alt=e.previous.position.alt,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.options.position.lng=t.lng,e.options.position.lat=t.lat,e.options.position.alt=t.alt,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy(),this.previous||(this.previous={position:Dd({},this.options.position)}),this.position=Dd({},this.previous.position)))}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=D.length>0&&void 0!==D[0]?D[0]:{},pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=23;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Dd({},this.options.position):this.options.position?l=Dd({},this.options.position[0]):this.options.center?l=Dd({},this.options.center):this.options.start?l=Dd({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=16;break}return t.next=15,this.getClampToHeight(l);case 15:l.alt=t.sent;case 16:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=59;break;case 23:c=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),u=[[this.options.position.lng-1e-4*this.options.scale,this.options.position.lat-c],[this.options.position.lng+1e-4*this.options.scale,this.options.position.lat+c]],p=[],h=0,d=this.options.position,m=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,0),f=Cesium.Cartesian3.fromDegrees(d.lng,d.lat,1e7),v=Cesium.Cartesian3.subtract(f,m,new Cesium.Cartesian3),g=Cesium.Cartesian3.normalize(v,v),y=new Cesium.Ray(m,g),b={},C=this.sdk.viewer.scene.drillPickFromRay(y),w=0;case 36:if(!(w<C.length)){t.next=43;break}if(!C[w].position){t.next=40;break}return b=C[w],t.abrupt("break",43);case 40:w++,t.next=36;break;case 43:if(!b||!b.position){t.next=47;break}h=this.cartesian3Towgs84(b.position,this.sdk.viewer).alt,t.next=56;break;case 47:return t.prev=47,t.next=50,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(d.lng,d.lat)]);case 50:k=t.sent,h=k[0].height,t.next=56;break;case 54:t.prev=54,t.t0=t.catch(47);case 56:for(x=0;x<u.length;x++)E=(_=Cesium.Cartesian3).fromDegrees.apply(_,L()(u[x]).concat([h])),p.push(E.x,E.y,E.z);S=Cesium.BoundingSphere.fromVertices(p),this.sdk.viewer.camera.flyToBoundingSphere(S,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 59:case"end":return t.stop()}}),t,this,[[47,54]])}))),function(){return s.apply(this,arguments)})},{key:"updateHeight",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,b,C,w=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,0),o=new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,1e13),s=[],r=_d(this.sdk.entityMap);try{for(r.s();!(l=r.n()).done;)(c=y()(l.value,2))[0],"RadarScanStereoscopic"===(u=c[1]).type&&u.entity&&s.push(u.entity)}catch(t){r.e(t)}finally{r.f()}return t.next=7,this.sdk.viewer.scene.clampToHeightMostDetailed([n],s);case 7:(p=t.sent)&&p[0]&&(e=this.cartesian3Towgs84(p[0],this.sdk.viewer).alt),h=Cesium.Cartesian3.subtract(n,o,new Cesium.Cartesian3),d=Cesium.Cartesian3.normalize(h,new Cesium.Cartesian3),m=new Cesium.Ray(o,d),f={},v=this.sdk.viewer.scene.drillPickFromRay(m),g=v.length-1;case 15:if(!(g>=0)){t.next=22;break}if(!v[g].position){t.next=19;break}return f=v[g],t.abrupt("break",22);case 19:g--,t.next=15;break;case 22:return f&&f.position&&(i=this.cartesian3Towgs84(f.position,this.sdk.viewer).alt),t.prev=23,t.next=26,Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]);case 26:b=t.sent,t.next=31;break;case 29:t.prev=29,t.t0=t.catch(23);case 31:if((void 0===i||i<b[0].height)&&b&&(i=b[0].height),(void 0===e||e<i)&&(e=i),void 0===e){t.next=50;break}if(this.options.position.alt=Number(Number(e).toFixed(2)),this._elms.alt&&this._elms.alt.forEach((function(t){t.value=w.options.position.alt})),this.coordinate=this.options.coordinate,!this._elms.height){t.next=50;break}if(!(C=this._elms.height.getElementsByClassName("height")[0])){t.next=50;break}t.t1=this._elms.heightMode.value,t.next="海拔高度"===t.t1?43:"相对地表"===t.t1?45:"依附地表"===t.t1?47:"依附模型"===t.t1?48:50;break;case 43:return C.value=this.options.position.alt,t.abrupt("break",50);case 45:return this.sdk.viewer.scene.terrainProvider.availability?Cesium.sampleTerrainMostDetailed(this.sdk.viewer.scene.terrainProvider,[Cesium.Cartographic.fromDegrees(this.options.position.lng,this.options.position.lat)]).then((function(t){C.value=Number((w.options.position.alt-t[0].height).toFixed(2))})):C.value=this.options.position.alt,t.abrupt("break",50);case 47:return t.abrupt("break",50);case 48:return C.value=this.options.position.alt,t.abrupt("break",50);case 50:case"end":return t.stop()}}),t,this,[[23,29]])}))),function(){return n.apply(this,arguments)})},{key:"renewPoint",value:function(){if(!this.entity.values&&this.entity.billboard){var t=Xn(this.labelFontFamily)||"Helvetica";this.entity.billboard.scale=this.billboardScale,this.billboardScaleByDistance?(this.entity.billboard.scaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.billboard.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.label.scaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0),this.entity.label.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.billboardNear,1,this.billboardFar,0)):(this.entity.billboard.scaleByDistance=void 0,this.entity.billboard.pixelOffsetScaleByDistance=void 0,this.entity.label.scaleByDistance=void 0,this.entity.label.pixelOffsetScaleByDistance=void 0),this.entity.label.font=this.options.label.fontSize+"px "+t,this.entity.label.fillColor=Cesium.Color.fromCssColorString(this.options.label.color);var e=this.entity.billboard.image.getValue(),i=e.height*(128/e.width);this.entity.billboard.pixelOffset={x:-128*this.billboardScale*this.options.offset.x,y:-i*this.billboardScale*this.options.offset.y}}}},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.angle=this.options.angle,this.scale=this.options.scale,this.offset=this.options.offset,this.flipeX=this.options.flipe.x,this.flipeY=this.options.flipe.y,this.show=this.options.show,this.mode=this.options.mode,this.heightMode=this.options.heightMode,this.billboardScale=this.options.billboard.scale,this.labelShow=this.options.label.show)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,Pe(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"setPosition",value:function(t){this.options.position.lng=t.position.lng,this.options.position.lat=t.position.lat,this.options.position.alt=t.position.alt}}]);var i,n,s,r,l}(Wn);function Od(t){return'\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="0.1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="0.1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col x-scale">\n <span class="label">X 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col y-scale">\n <span class="label">Y 轴大小</span>\n <input type="range" max="200" min="0.001" step="0.001">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0.001" max="200" step="0.001">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col" style="flex: 5;">\n <span class="label">文字内容</span>\n <input class="input" type="text" @model="textValue" maxlength="30">\n </div>\n <div class="col">\n <button class="btn" @click="textPosPick">设置位置</span>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">文字开关</span>\n <input class="btn-switch" type="checkbox" @model="textShow">\n </div>\n <div class="col">\n <span class="label">字体颜色</span>\n <div class="textColor"></div>\n </div>\n <div class="col">\n <span class="label">字体大小</span>\n <div class="input-number input-number-unit-2">\n <input class="input" type="number" title="" min="1" max="99" @model="textFontSize">\n <span class="unit">px</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">视野缩放</span>\n <input class="btn-switch" type="checkbox" @model="textScaleByDistance">\n </div>\n <div class="col">\n <span class="label">最近距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textNear">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">最远距离</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999999" @model="textFar">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item attribute-info">\n <div class="row">\n '.concat(Ln(t),"\n </div>\n </div>\n ")}var Td=i(21),Nd=i.n(Td),Bd=i(12),Ld=i.n(Bd);function Ad(t,e,i,n){var o=ya()(nn()(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof o?function(t){return o.apply(i,t)}:o}function jd(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()} /** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var nd=1014,od=1020,sd=2400,ad=2401,rd="srgb",ld="srgb-linear",cd="display-p3",ud="display-p3-linear",pd="linear",hd="srgb",dd="rec709",md=7680,fd=35044,vd=2e3,gd=2001,yd=function(){return x()((function t(){k()(this,t)}),[{key:"addEventListener",value:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}},{key:"hasEventListener",value:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}},{key:"removeEventListener",value:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}}},{key:"dispatchEvent",value:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,o=i.length;n<o;n++)i[n].call(this,t);t.target=null}}}}])}(),bd=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Cd=Math.PI/180;Math.PI;function wd(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(bd[255&t]+bd[t>>8&255]+bd[t>>16&255]+bd[t>>24&255]+"-"+bd[255&e]+bd[e>>8&255]+"-"+bd[e>>16&15|64]+bd[e>>24&255]+"-"+bd[63&i|128]+bd[i>>8&255]+"-"+bd[i>>16&255]+bd[i>>24&255]+bd[255&n]+bd[n>>8&255]+bd[n>>16&255]+bd[n>>24&255]).toLowerCase()}function kd(t,e,i){return Math.max(e,Math.min(i,t))}function _d(t,e){return(t%e+e)%e}function xd(t,e,i){return(1-i)*t+i*e}function Ed(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Sd(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var Dd=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t),t.prototype.isVector2=!0,this.x=e,this.y=i}),[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y}},{key:"cross",value:function(t){return this.x*t.y-this.y*t.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(kd(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}},{key:"rotateAround",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*i-s*n+t.x,this.y=o*n+s*i+t.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:case"end":return t.stop()}}),t,this)}))}])}(),Pd=function(){return x()((function t(e,i,n,o,s,a,r,l,c){k()(this,t),t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(t,e,i,n,o,s,a,r,l){var c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=o,c[5]=r,c[6]=i,c[7]=s,c[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],p=i[2],h=i[5],d=i[8],m=n[0],f=n[3],v=n[6],g=n[1],y=n[4],b=n[7],C=n[2],w=n[5],k=n[8];return o[0]=s*m+a*g+r*C,o[3]=s*f+a*y+r*w,o[6]=s*v+a*b+r*k,o[1]=l*m+c*g+u*C,o[4]=l*f+c*y+u*w,o[7]=l*v+c*b+u*k,o[2]=p*m+h*g+d*C,o[5]=p*f+h*y+d*w,o[8]=p*v+h*b+d*k,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=c*s-a*l,p=a*r-c*o,h=l*o-s*r,d=e*u+i*p+n*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return t[0]=u*m,t[1]=(n*l-c*i)*m,t[2]=(a*i-n*s)*m,t[3]=p*m,t[4]=(c*e-n*r)*m,t[5]=(n*o-a*e)*m,t[6]=h*m,t[7]=(i*r-l*e)*m,t[8]=(s*e-i*o)*m,this}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}},{key:"getNormalMatrix",value:function(t){return this.setFromMatrix4(t).invert().transpose()}},{key:"transposeIntoArray",value:function(t){var e=this.elements;return 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],this}},{key:"setUvTransform",value:function(t,e,i,n,o,s,a){var r=Math.cos(o),l=Math.sin(o);return this.set(i*r,i*l,-i*(r*s+l*a)+s+t,-n*l,n*r,-n*(-l*s+r*a)+a+e,0,0,1),this}},{key:"scale",value:function(t,e){return this.premultiply(Md.makeScale(t,e)),this}},{key:"rotate",value:function(t){return this.premultiply(Md.makeRotation(-t)),this}},{key:"translate",value:function(t,e){return this.premultiply(Md.makeTranslation(t,e)),this}},{key:"makeTranslation",value:function(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}},{key:"makeRotation",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}},{key:"makeScale",value:function(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}},{key:"equals",value:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),Md=new Pd;function Od(t){for(var e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function Td(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}var Nd={};function Bd(t){t in Nd||(Nd[t]=!0,console.warn(t))}var Ld,Ad=(new Pd).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),jd=(new Pd).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Id=C()(C()(C()(C()({},ld,{transfer:pd,primaries:dd,toReference:function(t){return t},fromReference:function(t){return t}}),rd,{transfer:hd,primaries:dd,toReference:function(t){return t.convertSRGBToLinear()},fromReference:function(t){return t.convertLinearToSRGB()}}),ud,{transfer:pd,primaries:"p3",toReference:function(t){return t.applyMatrix3(jd)},fromReference:function(t){return t.applyMatrix3(Ad)}}),cd,{transfer:hd,primaries:"p3",toReference:function(t){return t.convertSRGBToLinear().applyMatrix3(jd)},fromReference:function(t){return t.applyMatrix3(Ad).convertLinearToSRGB()}}),Fd=new Set([ld,ud]),Rd={enabled:!0,_workingColorSpace:ld,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Fd.has(t))throw new Error('Unsupported working color space, "'.concat(t,'".'));this._workingColorSpace=t},convert:function(t,e,i){if(!1===this.enabled||e===i||!e||!i)return t;var n=Id[e].toReference;return(0,Id[i].fromReference)(n(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Id[t].primaries},getTransfer:function(t){return""===t?pd:Id[t].transfer}};function zd(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Hd(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var Vd=function(){return x()((function t(){k()(this,t)}),null,[{key:"getDataURL",value:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ld&&(Ld=Td("canvas")),Ld.width=t.width,Ld.height=t.height;var i=Ld.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Ld}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}},{key:"sRGBToLinear",value:function(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var e=Td("canvas");e.width=t.width,e.height=t.height;var i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);for(var n=i.getImageData(0,0,t.width,t.height),o=n.data,s=0;s<o.length;s++)o[s]=255*zd(o[s]/255);return i.putImageData(n,0,0),e}if(t.data){for(var a=t.data.slice(0),r=0;r<a.length;r++)a instanceof Uint8Array||a instanceof Uint8ClampedArray?a[r]=Math.floor(255*zd(a[r]/255)):a[r]=zd(a[r]);return{data:a,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}])}(),Gd=0,Ud=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;k()(this,t),this.isSource=!0,Object.defineProperty(this,"id",{value:Gd++}),this.uuid=wd(),this.data=e,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];var i={uuid:this.uuid,url:""},n=this.data;if(null!==n){var o;if(Array.isArray(n)){o=[];for(var s=0,a=n.length;s<a;s++)n[s].isDataTexture?o.push(Wd(n[s].image)):o.push(Wd(n[s]))}else o=Wd(n);i.url=o}return e||(t.images[this.uuid]=i),i}}])}();function Wd(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Vd.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Yd=0,Jd=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:e.DEFAULT_ANISOTROPY,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return k()(this,e),(t=id(this,e)).isTexture=!0,Object.defineProperty(td()(t),"id",{value:Yd++}),t.uuid=wd(),t.name="",t.source=new Ud(i),t.mipmaps=[],t.mapping=n,t.channel=0,t.wrapS=o,t.wrapT=s,t.magFilter=a,t.minFilter=r,t.anisotropy=u,t.format=l,t.internalFormat=null,t.type=c,t.offset=new Dd(0,0),t.repeat=new Dd(1,1),t.center=new Dd(0,0),t.rotation=0,t.matrixAutoUpdate=!0,t.matrix=new Pd,t.generateMipmaps=!0,t.premultiplyAlpha=!1,t.flipY=!0,t.unpackAlignment=4,t.colorSpace=p,t.userData={},t.version=0,t.onUpdate=null,t.isRenderTargetTexture=!1,t.pmremVersion=0,t}return qi()(e,t),x()(e,[{key:"image",get:function(){return this.source.data},set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=t}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}},{key:"needsUpdate",set:function(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(t){!0===t&&this.pmremVersion++}}])}(yd);Jd.DEFAULT_IMAGE=null,Jd.DEFAULT_MAPPING=300,Jd.DEFAULT_ANISOTROPY=1;var qd=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),t.prototype.isVector4=!0,this.x=e,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}},{key:"set",value:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setW",value:function(t){return this.w=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"setAxisAngleFromQuaternion",value:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}},{key:"setAxisAngleFromRotationMatrix",value:function(t){var e,i,n,o,s=.01,a=.1,r=t.elements,l=r[0],c=r[4],u=r[8],p=r[1],h=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-p)<s&&Math.abs(u-m)<s&&Math.abs(d-f)<s){if(Math.abs(c+p)<a&&Math.abs(u+m)<a&&Math.abs(d+f)<a&&Math.abs(l+h+v-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var g=(l+1)/2,y=(h+1)/2,b=(v+1)/2,C=(c+p)/4,w=(u+m)/4,k=(d+f)/4;return g>y&&g>b?g<s?(i=0,n=.707106781,o=.707106781):(n=C/(i=Math.sqrt(g)),o=w/i):y>b?y<s?(i=.707106781,n=0,o=.707106781):(i=C/(n=Math.sqrt(y)),o=k/n):b<s?(i=.707106781,n=.707106781,o=0):(i=w/(o=Math.sqrt(b)),n=k/o),this.set(i,n,o,e),this}var _=Math.sqrt((f-d)*(f-d)+(u-m)*(u-m)+(p-c)*(p-c));return Math.abs(_)<.001&&(_=1),this.x=(f-d)/_,this.y=(u-m)/_,this.z=(p-c)/_,this.w=Math.acos((l+h+v-1)/2),this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:return t.next=8,this.w;case 8:case"end":return t.stop()}}),t,this)}))}])}(),Xd=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,e),(t=id(this,e,[null])).isDataArrayTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return qi()(e,t),x()(e)}(Jd),Zd=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,e),(t=id(this,e,[null])).isData3DTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return qi()(e,t),x()(e)}(Jd),Kd=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),this.isQuaternion=!0,this._x=e,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t._x,n=t._y,o=t._z,s=t._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),p=r(i/2),h=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"YXZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"ZXY":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"ZYX":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"YZX":this._x=p*c*u+l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u-p*h*d;break;case"XZY":this._x=p*c*u-l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u+p*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=t.elements,i=e[0],n=e[4],o=e[8],s=e[1],a=e[5],r=e[9],l=e[2],c=e[6],u=e[10],p=i+a+u;if(p>0){var h=.5/Math.sqrt(p+1);this._w=.25/h,this._x=(c-r)*h,this._y=(o-l)*h,this._z=(s-n)*h}else if(i>a&&i>u){var d=2*Math.sqrt(1+i-a-u);this._w=(c-r)/d,this._x=.25*d,this._y=(n+s)/d,this._z=(o+l)/d}else if(a>u){var m=2*Math.sqrt(1+a-i-u);this._w=(o-l)/m,this._x=(n+s)/m,this._y=.25*m,this._z=(r+c)/m}else{var f=2*Math.sqrt(1+u-i-a);this._w=(s-n)/f,this._x=(o+l)/f,this._y=(r+c)/f,this._z=.25*f}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}},{key:"angleTo",value:function(t){return 2*Math.acos(Math.abs(kd(this.dot(t),-1,1)))}},{key:"rotateTowards",value:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}},{key:"multiply",value:function(t){return this.multiplyQuaternions(this,t)}},{key:"premultiply",value:function(t){return this.multiplyQuaternions(t,this)}},{key:"multiplyQuaternions",value:function(t,e){var i=t._x,n=t._y,o=t._z,s=t._w,a=e._x,r=e._y,l=e._z,c=e._w;return this._x=i*c+s*a+n*l-o*r,this._y=n*c+s*r+o*a-i*l,this._z=o*c+s*l+i*r-n*a,this._w=s*c-i*a-n*r-o*l,this._onChangeCallback(),this}},{key:"slerp",value:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*t._w+i*t._x+n*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=i,this._y=n,this._z=o,this;var r=1-a*a;if(r<=Number.EPSILON){var l=1-e;return this._w=l*s+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*o+e*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),p=Math.sin((1-e)*u)/c,h=Math.sin(e*u)/c;return this._w=s*p+this._w*h,this._x=i*p+this._x*h,this._y=n*p+this._y*h,this._z=o*p+this._z*h,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(t,e,i){return this.copy(t).slerp(e,i)}},{key:"random",value:function(){var t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(t),n*Math.cos(t),o*Math.sin(e),o*Math.cos(e))}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}},{key:"fromBufferAttribute",value:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._w;case 8:case"end":return t.stop()}}),t,this)}))}],[{key:"slerpFlat",value:function(t,e,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],p=o[s+0],h=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return t[e+0]=r,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===a)return t[e+0]=p,t[e+1]=h,t[e+2]=d,void(t[e+3]=m);if(u!==m||r!==p||l!==h||c!==d){var f=1-a,v=r*p+l*h+c*d+u*m,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),C=Math.atan2(b,v*g);f=Math.sin(f*C)/b,a=Math.sin(a*C)/b}var w=a*g;if(r=r*f+p*w,l=l*f+h*w,c=c*f+d*w,u=u*f+m*w,f===1-a){var k=1/Math.sqrt(r*r+l*l+c*c+u*u);r*=k,l*=k,c*=k,u*=k}}t[e]=r,t[e+1]=l,t[e+2]=c,t[e+3]=u}},{key:"multiplyQuaternionsFlat",value:function(t,e,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],p=o[s+1],h=o[s+2],d=o[s+3];return t[e]=a*d+c*u+r*h-l*p,t[e+1]=r*d+c*p+l*u-a*h,t[e+2]=l*d+c*h+a*p-r*u,t[e+3]=c*d-a*u-r*p-l*h,t}}])}(),$d=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;k()(this,t),t.prototype.isVector3=!0,this.x=e,this.y=i,this.z=n}),[{key:"set",value:function(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"multiplyVectors",value:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}},{key:"applyEuler",value:function(t){return this.applyQuaternion(tm.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,e){return this.applyQuaternion(tm.setFromAxisAngle(t,e))}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[3]*i+o[6]*n,this.y=o[1]*e+o[4]*i+o[7]*n,this.z=o[2]*e+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(t){return this.applyMatrix3(t).normalize()}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements,s=1/(o[3]*e+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*e+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*e+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*e+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.x,s=t.y,a=t.z,r=t.w,l=2*(s*n-a*i),c=2*(a*e-o*n),u=2*(o*i-s*e);return this.x=e+r*l+s*u-a*c,this.y=i+r*c+a*l-o*u,this.z=n+r*u+o*c-s*l,this}},{key:"project",value:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}},{key:"unproject",value:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}},{key:"transformDirection",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n,this.y=o[1]*e+o[5]*i+o[9]*n,this.z=o[2]*e+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}},{key:"cross",value:function(t){return this.crossVectors(this,t)}},{key:"crossVectors",value:function(t,e){var i=t.x,n=t.y,o=t.z,s=e.x,a=e.y,r=e.z;return this.x=n*r-o*a,this.y=o*s-i*r,this.z=i*a-n*s,this}},{key:"projectOnVector",value:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}},{key:"projectOnPlane",value:function(t){return Qd.copy(this).projectOnVector(t),this.sub(Qd)}},{key:"reflect",value:function(t){return this.sub(Qd.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(kd(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}},{key:"setFromSpherical",value:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}},{key:"setFromSphericalCoords",value:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}},{key:"setFromCylindricalCoords",value:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}},{key:"setFromMatrixPosition",value:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}},{key:"setFromMatrixScale",value:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(t,e){return this.fromArray(t.elements,4*e)}},{key:"setFromMatrix3Column",value:function(t,e){return this.fromArray(t.elements,3*e)}},{key:"setFromEuler",value:function(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}},{key:"setFromColor",value:function(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:case"end":return t.stop()}}),t,this)}))}])}(),Qd=new $d,tm=new Kd,em=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d(-1/0,-1/0,-1/0);k()(this,t),this.isBox3=!0,this.min=e,this.max=i}),[{key:"set",value:function(t,e){return this.min.copy(t),this.max.copy(e),this}},{key:"setFromArray",value:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e+=3)this.expandByPoint(nm.fromArray(t,e));return this}},{key:"setFromBufferAttribute",value:function(t){this.makeEmpty();for(var e=0,i=t.count;e<i;e++)this.expandByPoint(nm.fromBufferAttribute(t,e));return this}},{key:"setFromPoints",value:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}},{key:"setFromCenterAndSize",value:function(t,e){var i=nm.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}},{key:"setFromObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(t,e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.min.copy(t.min),this.max.copy(t.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(t){return this.min.min(t),this.max.max(t),this}},{key:"expandByVector",value:function(t){return this.min.sub(t),this.max.add(t),this}},{key:"expandByScalar",value:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this}},{key:"expandByObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.updateWorldMatrix(!1,!1);var i=t.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===e&&void 0!==n&&!0!==t.isInstancedMesh)for(var o=0,s=n.count;o<s;o++)!0===t.isMesh?t.getVertexPosition(o,nm):nm.fromBufferAttribute(n,o),nm.applyMatrix4(t.matrixWorld),this.expandByPoint(nm);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),om.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),om.copy(i.boundingBox)),om.applyMatrix4(t.matrixWorld),this.union(om)}for(var a=t.children,r=0,l=a.length;r<l;r++)this.expandByObject(a[r],e);return this}},{key:"containsPoint",value:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}},{key:"containsBox",value:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}},{key:"getParameter",value:function(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}},{key:"intersectsSphere",value:function(t){return this.clampPoint(t.center,nm),nm.distanceToSquared(t.center)<=t.radius*t.radius}},{key:"intersectsPlane",value:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}},{key:"intersectsTriangle",value:function(t){if(this.isEmpty())return!1;this.getCenter(pm),hm.subVectors(this.max,pm),sm.subVectors(t.a,pm),am.subVectors(t.b,pm),rm.subVectors(t.c,pm),lm.subVectors(am,sm),cm.subVectors(rm,am),um.subVectors(sm,rm);var e=[0,-lm.z,lm.y,0,-cm.z,cm.y,0,-um.z,um.y,lm.z,0,-lm.x,cm.z,0,-cm.x,um.z,0,-um.x,-lm.y,lm.x,0,-cm.y,cm.x,0,-um.y,um.x,0];return!!fm(e,sm,am,rm,hm)&&(!!fm(e=[1,0,0,0,1,0,0,0,1],sm,am,rm,hm)&&(dm.crossVectors(lm,cm),fm(e=[dm.x,dm.y,dm.z],sm,am,rm,hm)))}},{key:"clampPoint",value:function(t,e){return e.copy(t).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return this.clampPoint(t,nm).distanceTo(t)}},{key:"getBoundingSphere",value:function(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(nm).length()),t}},{key:"intersect",value:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(t){return this.min.min(t.min),this.max.max(t.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(im[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),im[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),im[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),im[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),im[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),im[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),im[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),im[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(im)),this}},{key:"translate",value:function(t){return this.min.add(t),this.max.add(t),this}},{key:"equals",value:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}])}(),im=[new $d,new $d,new $d,new $d,new $d,new $d,new $d,new $d],nm=new $d,om=new em,sm=new $d,am=new $d,rm=new $d,lm=new $d,cm=new $d,um=new $d,pm=new $d,hm=new $d,dm=new $d,mm=new $d;function fm(t,e,i,n,o){for(var s=0,a=t.length-3;s<=a;s+=3){mm.fromArray(t,s);var r=o.x*Math.abs(mm.x)+o.y*Math.abs(mm.y)+o.z*Math.abs(mm.z),l=e.dot(mm),c=i.dot(mm),u=n.dot(mm);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var vm=new em,gm=new $d,ym=new $d,bm=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;k()(this,t),this.isSphere=!0,this.center=e,this.radius=i}),[{key:"set",value:function(t,e){return this.center.copy(t),this.radius=e,this}},{key:"setFromPoints",value:function(t,e){var i=this.center;void 0!==e?i.copy(e):vm.setFromPoints(t).getCenter(i);for(var n=0,o=0,s=t.length;o<s;o++)n=Math.max(n,i.distanceToSquared(t[o]));return this.radius=Math.sqrt(n),this}},{key:"copy",value:function(t){return this.center.copy(t.center),this.radius=t.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(t){return t.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}},{key:"intersectsBox",value:function(t){return t.intersectsSphere(this)}},{key:"intersectsPlane",value:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(t,e){var i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}},{key:"getBoundingBox",value:function(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}},{key:"applyMatrix4",value:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}},{key:"translate",value:function(t){return this.center.add(t),this}},{key:"expandByPoint",value:function(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;gm.subVectors(t,this.center);var e=gm.lengthSq();if(e>this.radius*this.radius){var i=Math.sqrt(e),n=.5*(i-this.radius);this.center.addScaledVector(gm,n/i),this.radius+=n}return this}},{key:"union",value:function(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(ym.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(gm.copy(t.center).add(ym)),this.expandByPoint(gm.copy(t.center).sub(ym))),this)}},{key:"equals",value:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Cm=new $d,wm=new $d,km=new $d,_m=new $d,xm=new $d,Em=new $d,Sm=new $d,Dm=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d(0,0,-1);k()(this,t),this.origin=e,this.direction=i}),[{key:"set",value:function(t,e){return this.origin.copy(t),this.direction.copy(e),this}},{key:"copy",value:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}},{key:"at",value:function(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}},{key:"lookAt",value:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this}},{key:"recast",value:function(t){return this.origin.copy(this.at(t,Cm)),this}},{key:"closestPointToPoint",value:function(t,e){e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(t){return Math.sqrt(this.distanceSqToPoint(t))}},{key:"distanceSqToPoint",value:function(t){var e=Cm.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Cm.copy(this.origin).addScaledVector(this.direction,e),Cm.distanceToSquared(t))}},{key:"distanceSqToSegment",value:function(t,e,i,n){wm.copy(t).add(e).multiplyScalar(.5),km.copy(e).sub(t).normalize(),_m.copy(this.origin).sub(wm);var o,s,a,r,l=.5*t.distanceTo(e),c=-this.direction.dot(km),u=_m.dot(this.direction),p=-_m.dot(km),h=_m.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-p,r=l*d,(o=c*p-u)>=0)if(s>=-r)if(s<=r){var m=1/d;a=(o*=m)*(o+c*(s*=m)+2*u)+s*(c*o+s+2*p)+h}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-p),l))*(s+2*p)+h):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(wm).addScaledVector(km,s),a}},{key:"intersectSphere",value:function(t,e){Cm.subVectors(t.center,this.origin);var i=Cm.dot(this.direction),n=Cm.dot(Cm)-i*i,o=t.radius*t.radius;if(n>o)return null;var s=Math.sqrt(o-n),a=i-s,r=i+s;return r<0?null:a<0?this.at(r,e):this.at(a,e)}},{key:"intersectsSphere",value:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}},{key:"distanceToPlane",value:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}},{key:"intersectPlane",value:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}},{key:"intersectsPlane",value:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}},{key:"intersectBox",value:function(t,e){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,p=this.origin;return l>=0?(i=(t.min.x-p.x)*l,n=(t.max.x-p.x)*l):(i=(t.max.x-p.x)*l,n=(t.min.x-p.x)*l),c>=0?(o=(t.min.y-p.y)*c,s=(t.max.y-p.y)*c):(o=(t.max.y-p.y)*c,s=(t.min.y-p.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s<n||isNaN(n))&&(n=s),u>=0?(a=(t.min.z-p.z)*u,r=(t.max.z-p.z)*u):(a=(t.max.z-p.z)*u,r=(t.min.z-p.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r<n||n!=n)&&(n=r),n<0?null:this.at(i>=0?i:n,e)))}},{key:"intersectsBox",value:function(t){return null!==this.intersectBox(t,Cm)}},{key:"intersectTriangle",value:function(t,e,i,n,o){xm.subVectors(e,t),Em.subVectors(i,t),Sm.crossVectors(xm,Em);var s,a=this.direction.dot(Sm);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}_m.subVectors(this.origin,t);var r=s*this.direction.dot(Em.crossVectors(_m,Em));if(r<0)return null;var l=s*this.direction.dot(xm.cross(_m));if(l<0)return null;if(r+l>a)return null;var c=-s*_m.dot(Sm);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}},{key:"equals",value:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Pm=function(){function t(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v){k()(this,t),t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v)}return x()(t,[{key:"set",value:function(t,e,i,n,o,s,a,r,l,c,u,p,h,d,m,f){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=n,v[1]=o,v[5]=s,v[9]=a,v[13]=r,v[2]=l,v[6]=c,v[10]=u,v[14]=p,v[3]=h,v[7]=d,v[11]=m,v[15]=f,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new t).fromArray(this.elements)}},{key:"copy",value:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}},{key:"copyPosition",value:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}},{key:"setFromMatrix3",value:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var e=this.elements,i=t.elements,n=1/Mm.setFromMatrixColumn(t,0).length(),o=1/Mm.setFromMatrixColumn(t,1).length(),s=1/Mm.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*o,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromEuler",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.z,s=Math.cos(i),a=Math.sin(i),r=Math.cos(n),l=Math.sin(n),c=Math.cos(o),u=Math.sin(o);if("XYZ"===t.order){var p=s*c,h=s*u,d=a*c,m=a*u;e[0]=r*c,e[4]=-r*u,e[8]=l,e[1]=h+d*l,e[5]=p-m*l,e[9]=-a*r,e[2]=m-p*l,e[6]=d+h*l,e[10]=s*r}else if("YXZ"===t.order){var f=r*c,v=r*u,g=l*c,y=l*u;e[0]=f+y*a,e[4]=g*a-v,e[8]=s*l,e[1]=s*u,e[5]=s*c,e[9]=-a,e[2]=v*a-g,e[6]=y+f*a,e[10]=s*r}else if("ZXY"===t.order){var b=r*c,C=r*u,w=l*c,k=l*u;e[0]=b-k*a,e[4]=-s*u,e[8]=w+C*a,e[1]=C+w*a,e[5]=s*c,e[9]=k-b*a,e[2]=-s*l,e[6]=a,e[10]=s*r}else if("ZYX"===t.order){var _=s*c,x=s*u,E=a*c,S=a*u;e[0]=r*c,e[4]=E*l-x,e[8]=_*l+S,e[1]=r*u,e[5]=S*l+_,e[9]=x*l-E,e[2]=-l,e[6]=a*r,e[10]=s*r}else if("YZX"===t.order){var D=s*r,P=s*l,M=a*r,O=a*l;e[0]=r*c,e[4]=O-D*u,e[8]=M*u+P,e[1]=u,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=P*u+M,e[10]=D-O*u}else if("XZY"===t.order){var T=s*r,N=s*l,B=a*r,L=a*l;e[0]=r*c,e[4]=-u,e[8]=l*c,e[1]=T*u+L,e[5]=s*c,e[9]=N*u-B,e[2]=B*u-N,e[6]=a*c,e[10]=L*u+T}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose(Tm,t,Nm)}},{key:"lookAt",value:function(t,e,i){var n=this.elements;return Am.subVectors(t,e),0===Am.lengthSq()&&(Am.z=1),Am.normalize(),Bm.crossVectors(i,Am),0===Bm.lengthSq()&&(1===Math.abs(i.z)?Am.x+=1e-4:Am.z+=1e-4,Am.normalize(),Bm.crossVectors(i,Am)),Bm.normalize(),Lm.crossVectors(Am,Bm),n[0]=Bm.x,n[4]=Lm.x,n[8]=Am.x,n[1]=Bm.y,n[5]=Lm.y,n[9]=Am.y,n[2]=Bm.z,n[6]=Lm.z,n[10]=Am.z,this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],p=i[9],h=i[13],d=i[2],m=i[6],f=i[10],v=i[14],g=i[3],y=i[7],b=i[11],C=i[15],w=n[0],k=n[4],_=n[8],x=n[12],E=n[1],S=n[5],D=n[9],P=n[13],M=n[2],O=n[6],T=n[10],N=n[14],B=n[3],L=n[7],A=n[11],j=n[15];return o[0]=s*w+a*E+r*M+l*B,o[4]=s*k+a*S+r*O+l*L,o[8]=s*_+a*D+r*T+l*A,o[12]=s*x+a*P+r*N+l*j,o[1]=c*w+u*E+p*M+h*B,o[5]=c*k+u*S+p*O+h*L,o[9]=c*_+u*D+p*T+h*A,o[13]=c*x+u*P+p*N+h*j,o[2]=d*w+m*E+f*M+v*B,o[6]=d*k+m*S+f*O+v*L,o[10]=d*_+m*D+f*T+v*A,o[14]=d*x+m*P+f*N+v*j,o[3]=g*w+y*E+b*M+C*B,o[7]=g*k+y*S+b*O+C*L,o[11]=g*_+y*D+b*T+C*A,o[15]=g*x+y*P+b*N+C*j,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],o=t[12],s=t[1],a=t[5],r=t[9],l=t[13],c=t[2],u=t[6],p=t[10],h=t[14];return t[3]*(+o*r*u-n*l*u-o*a*p+i*l*p+n*a*h-i*r*h)+t[7]*(+e*r*h-e*l*p+o*s*p-n*s*h+n*l*c-o*r*c)+t[11]*(+e*l*u-e*a*h-o*s*u+i*s*h+o*a*c-i*l*c)+t[15]*(-n*a*c-e*r*u+e*a*p+n*s*u-i*s*p+i*r*c)}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}},{key:"setPosition",value:function(t,e,i){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=t[9],p=t[10],h=t[11],d=t[12],m=t[13],f=t[14],v=t[15],g=u*f*l-m*p*l+m*r*h-a*f*h-u*r*v+a*p*v,y=d*p*l-c*f*l-d*r*h+s*f*h+c*r*v-s*p*v,b=c*m*l-d*u*l+d*a*h-s*m*h-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*p+s*m*p+c*a*f-s*u*f,w=e*g+i*y+n*b+o*C;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/w;return t[0]=g*k,t[1]=(m*p*o-u*f*o-m*n*h+i*f*h+u*n*v-i*p*v)*k,t[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,t[3]=(u*r*o-a*p*o-u*n*l+i*p*l+a*n*h-i*r*h)*k,t[4]=y*k,t[5]=(c*f*o-d*p*o+d*n*h-e*f*h-c*n*v+e*p*v)*k,t[6]=(d*r*o-s*f*o-d*n*l+e*f*l+s*n*v-e*r*v)*k,t[7]=(s*p*o-c*r*o+c*n*l-e*p*l-s*n*h+e*r*h)*k,t[8]=b*k,t[9]=(d*u*o-c*m*o-d*i*h+e*m*h+c*i*v-e*u*v)*k,t[10]=(s*m*o-d*a*o+d*i*l-e*m*l-s*i*v+e*a*v)*k,t[11]=(c*a*o-s*u*o-c*i*l+e*u*l+s*i*h-e*a*h)*k,t[12]=C*k,t[13]=(c*m*n-d*u*n+d*i*p-e*m*p-c*i*f+e*u*f)*k,t[14]=(d*a*n-s*m*n-d*i*r+e*m*r+s*i*f-e*a*f)*k,t[15]=(s*u*n-c*a*n+c*i*r-e*u*r-s*i*p+e*a*p)*k,this}},{key:"scale",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.z;return e[0]*=i,e[4]*=n,e[8]*=o,e[1]*=i,e[5]*=n,e[9]*=o,e[2]*=i,e[6]*=n,e[10]*=o,e[3]*=i,e[7]*=n,e[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}},{key:"makeTranslation",value:function(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}},{key:"makeRotationY",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=1-i,s=t.x,a=t.y,r=t.z,l=o*s,c=o*a;return this.set(l*s+i,l*a-n*r,l*r+n*a,0,l*a+n*r,c*a+i,c*r-n*s,0,l*r-n*a,c*r+n*s,o*r*r+i,0,0,0,0,1),this}},{key:"makeScale",value:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(t,e,i,n,o,s){return this.set(1,i,o,0,t,1,s,0,e,n,1,0,0,0,0,1),this}},{key:"compose",value:function(t,e,i){var n=this.elements,o=e._x,s=e._y,a=e._z,r=e._w,l=o+o,c=s+s,u=a+a,p=o*l,h=o*c,d=o*u,m=s*c,f=s*u,v=a*u,g=r*l,y=r*c,b=r*u,C=i.x,w=i.y,k=i.z;return n[0]=(1-(m+v))*C,n[1]=(h+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(h-b)*w,n[5]=(1-(p+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(p+m))*k,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}},{key:"decompose",value:function(t,e,i){var n=this.elements,o=Mm.set(n[0],n[1],n[2]).length(),s=Mm.set(n[4],n[5],n[6]).length(),a=Mm.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],Om.copy(this);var r=1/o,l=1/s,c=1/a;return Om.elements[0]*=r,Om.elements[1]*=r,Om.elements[2]*=r,Om.elements[4]*=l,Om.elements[5]*=l,Om.elements[6]*=l,Om.elements[8]*=c,Om.elements[9]*=c,Om.elements[10]*=c,e.setFromRotationMatrix(Om),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(e-t),p=2*o/(i-n),h=(e+t)/(e-t),d=(i+n)/(i-n);if(l===vd)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==gd)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);a=-s/(s-o),r=-s*o/(s-o)}return c[0]=u,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=p,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=r,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(e-t),p=1/(i-n),h=1/(s-o),d=(e+t)*u,m=(i+n)*p;if(l===vd)a=(s+o)*h,r=-2*h;else{if(l!==gd)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*h,r=-1*h}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*p,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=r,c[14]=-a,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}])}(),Mm=new $d,Om=new Pm,Tm=new $d(0,0,0),Nm=new $d(1,1,1),Bm=new $d,Lm=new $d,Am=new $d,jm=new Pm,Im=new Kd,Fm=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.DEFAULT_ORDER;k()(this,t),this.isEuler=!0,this._x=e,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],p=n[6],h=n[10];switch(e){case"XYZ":this._y=Math.asin(kd(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-kd(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(kd(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-kd(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,h),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(kd(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-kd(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t,e,i){return jm.makeRotationFromQuaternion(t),this.setFromRotationMatrix(jm,e,i)}},{key:"setFromVector3",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(t.x,t.y,t.z,e)}},{key:"reorder",value:function(t){return Im.setFromEuler(this),this.setFromQuaternion(Im,t)}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}},{key:"fromArray",value:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._order;case 8:case"end":return t.stop()}}),t,this)}))}])}();Fm.DEFAULT_ORDER="XYZ";var Rm=function(){return x()((function t(){k()(this,t),this.mask=1}),[{key:"set",value:function(t){this.mask=(1<<t|0)>>>0}},{key:"enable",value:function(t){this.mask|=1<<t|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(t){this.mask^=1<<t|0}},{key:"disable",value:function(t){this.mask&=~(1<<t|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(t){return 0!=(this.mask&t.mask)}},{key:"isEnabled",value:function(t){return 0!=(this.mask&(1<<t|0))}}])}(),zm=0,Hm=new $d,Vm=new Kd,Gm=new Pm,Um=new $d,Wm=new $d,Ym=new $d,Jm=new Kd,qm=new $d(1,0,0),Xm=new $d(0,1,0),Zm=new $d(0,0,1),Km={type:"added"},$m={type:"removed"},Qm={type:"childadded",child:null},tf={type:"childremoved",child:null},ef=function(t){function e(){var t;k()(this,e),(t=id(this,e)).isObject3D=!0,Object.defineProperty(td()(t),"id",{value:zm++}),t.uuid=wd(),t.name="",t.type="Object3D",t.parent=null,t.children=[],t.up=e.DEFAULT_UP.clone();var i=new $d,n=new Fm,o=new Kd,s=new $d(1,1,1);return n._onChange((function(){o.setFromEuler(n,!1)})),o._onChange((function(){n.setFromQuaternion(o,void 0,!1)})),Object.defineProperties(t,{position:{configurable:!0,enumerable:!0,value:i},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:o},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new Pm},normalMatrix:{value:new Pd}}),t.matrix=new Pm,t.matrixWorld=new Pm,t.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,t.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,t.matrixWorldNeedsUpdate=!1,t.layers=new Rm,t.visible=!0,t.castShadow=!1,t.receiveShadow=!1,t.frustumCulled=!0,t.renderOrder=0,t.animations=[],t.userData={},t}return qi()(e,t),x()(e,[{key:"onBeforeShadow",value:function(){}},{key:"onAfterShadow",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(t){return this.quaternion.premultiply(t),this}},{key:"setRotationFromAxisAngle",value:function(t,e){this.quaternion.setFromAxisAngle(t,e)}},{key:"setRotationFromEuler",value:function(t){this.quaternion.setFromEuler(t,!0)}},{key:"setRotationFromMatrix",value:function(t){this.quaternion.setFromRotationMatrix(t)}},{key:"setRotationFromQuaternion",value:function(t){this.quaternion.copy(t)}},{key:"rotateOnAxis",value:function(t,e){return Vm.setFromAxisAngle(t,e),this.quaternion.multiply(Vm),this}},{key:"rotateOnWorldAxis",value:function(t,e){return Vm.setFromAxisAngle(t,e),this.quaternion.premultiply(Vm),this}},{key:"rotateX",value:function(t){return this.rotateOnAxis(qm,t)}},{key:"rotateY",value:function(t){return this.rotateOnAxis(Xm,t)}},{key:"rotateZ",value:function(t){return this.rotateOnAxis(Zm,t)}},{key:"translateOnAxis",value:function(t,e){return Hm.copy(t).applyQuaternion(this.quaternion),this.position.add(Hm.multiplyScalar(e)),this}},{key:"translateX",value:function(t){return this.translateOnAxis(qm,t)}},{key:"translateY",value:function(t){return this.translateOnAxis(Xm,t)}},{key:"translateZ",value:function(t){return this.translateOnAxis(Zm,t)}},{key:"localToWorld",value:function(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Gm.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(t,e,i){t.isVector3?Um.copy(t):Um.set(t,e,i);var n=this.parent;this.updateWorldMatrix(!0,!1),Wm.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Gm.lookAt(Wm,Um,this.up):Gm.lookAt(Um,Wm,this.up),this.quaternion.setFromRotationMatrix(Gm),n&&(Gm.extractRotation(n.matrixWorld),Vm.setFromRotationMatrix(Gm),this.quaternion.premultiply(Vm.invert()))}},{key:"add",value:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Km),Qm.child=t,this.dispatchEvent(Qm),Qm.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}},{key:"remove",value:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var i=this.children.indexOf(t);return-1!==i&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent($m),tf.child=t,this.dispatchEvent(tf),tf.child=null),this}},{key:"removeFromParent",value:function(){var t=this.parent;return null!==t&&t.remove(this),this}},{key:"clear",value:function(){return this.remove.apply(this,L()(this.children))}},{key:"attach",value:function(t){return this.updateWorldMatrix(!0,!1),Gm.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Gm.multiply(t.parent.matrixWorld)),t.applyMatrix4(Gm),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Km),Qm.child=t,this.dispatchEvent(Qm),Qm.child=null,this}},{key:"getObjectById",value:function(t){return this.getObjectByProperty("id",t)}},{key:"getObjectByName",value:function(t){return this.getObjectByProperty("name",t)}},{key:"getObjectByProperty",value:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var o=this.children[i].getObjectByProperty(t,e);if(void 0!==o)return o}}},{key:"getObjectsByProperty",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[t]===e&&i.push(this);for(var n=this.children,o=0,s=n.length;o<s;o++)n[o].getObjectsByProperty(t,e,i);return i}},{key:"getWorldPosition",value:function(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wm,t,Ym),t}},{key:"getWorldScale",value:function(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Wm,Jm,t),t}},{key:"getWorldDirection",value:function(t){this.updateWorldMatrix(!0,!1);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)}},{key:"traverseVisible",value:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}}},{key:"traverseAncestors",value:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++){var o=e[i];!0!==o.matrixWorldAutoUpdate&&!0!==t||o.updateMatrixWorld(t)}}},{key:"updateWorldMatrix",value:function(t,e){var i=this.parent;if(!0===t&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var n=this.children,o=0,s=n.length;o<s;o++){var a=n[o];!0===a.matrixWorldAutoUpdate&&a.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});var n={};function o(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((function(t){return{boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(t.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var r=0,l=a.length;r<l;r++){var c=a[r];o(t.shapes,c)}else o(t.shapes,a)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(o(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],p=0,h=this.material.length;p<h;p++)u.push(o(t.materials,this.material[p]));n.material=u}else n.material=o(t.materials,this.material);if(this.children.length>0){n.children=[];for(var d=0;d<this.children.length;d++)n.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(var m=0;m<this.animations.length;m++){var f=this.animations[m];n.animations.push(o(t.animations,f))}}if(e){var v=x(t.geometries),g=x(t.materials),y=x(t.textures),b=x(t.images),C=x(t.shapes),w=x(t.skeletons),k=x(t.animations),_=x(t.nodes);v.length>0&&(i.geometries=v),g.length>0&&(i.materials=g),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),C.length>0&&(i.shapes=C),w.length>0&&(i.skeletons=w),k.length>0&&(i.animations=k),_.length>0&&(i.nodes=_)}return i.object=n,i;function x(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}}},{key:"clone",value:function(t){return(new this.constructor).copy(this,t)}},{key:"copy",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}}])}(yd);ef.DEFAULT_UP=new $d(0,1,0),ef.DEFAULT_MATRIX_AUTO_UPDATE=!0,ef.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var nf=new $d,of=new $d,sf=new $d,af=new $d,rf=new $d,lf=new $d,cf=new $d,uf=new $d,pf=new $d,hf=new $d,df=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new $d;k()(this,t),this.a=e,this.b=i,this.c=n}return x()(t,[{key:"set",value:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}},{key:"setFromAttributeAndIndices",value:function(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}},{key:"getArea",value:function(){return nf.subVectors(this.c,this.b),of.subVectors(this.a,this.b),.5*nf.cross(of).length()}},{key:"getMidpoint",value:function(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return t.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,i){return t.getBarycoord(e,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(e,i,n,o,s){return t.getInterpolation(e,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(e){return t.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return t.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(t){return t.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(t,e){var i,n,o=this.a,s=this.b,a=this.c;rf.subVectors(s,o),lf.subVectors(a,o),uf.subVectors(t,o);var r=rf.dot(uf),l=lf.dot(uf);if(r<=0&&l<=0)return e.copy(o);pf.subVectors(t,s);var c=rf.dot(pf),u=lf.dot(pf);if(c>=0&&u<=c)return e.copy(s);var p=r*u-c*l;if(p<=0&&r>=0&&c<=0)return i=r/(r-c),e.copy(o).addScaledVector(rf,i);hf.subVectors(t,a);var h=rf.dot(hf),d=lf.dot(hf);if(d>=0&&h<=d)return e.copy(a);var m=h*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),e.copy(o).addScaledVector(lf,n);var f=c*d-h*u;if(f<=0&&u-c>=0&&h-d>=0)return cf.subVectors(a,s),n=(u-c)/(u-c+(h-d)),e.copy(s).addScaledVector(cf,n);var v=1/(f+m+p);return i=m*v,n=p*v,e.copy(o).addScaledVector(rf,i).addScaledVector(lf,n)}},{key:"equals",value:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}],[{key:"getNormal",value:function(t,e,i,n){n.subVectors(i,e),nf.subVectors(t,e),n.cross(nf);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(t,e,i,n,o){nf.subVectors(n,e),of.subVectors(i,e),sf.subVectors(t,e);var s=nf.dot(nf),a=nf.dot(of),r=nf.dot(sf),l=of.dot(of),c=of.dot(sf),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var p=1/u,h=(l*r-a*c)*p,d=(s*c-a*r)*p;return o.set(1-h-d,d,h)}},{key:"containsPoint",value:function(t,e,i,n){return null!==this.getBarycoord(t,e,i,n,af)&&af.x>=0&&af.y>=0&&af.x+af.y<=1}},{key:"getInterpolation",value:function(t,e,i,n,o,s,a,r){return null===this.getBarycoord(t,e,i,n,af)?(r.x=0,r.y=0,"z"in r&&(r.z=0),"w"in r&&(r.w=0),null):(r.setScalar(0),r.addScaledVector(o,af.x),r.addScaledVector(s,af.y),r.addScaledVector(a,af.z),r)}},{key:"isFrontFacing",value:function(t,e,i,n){return nf.subVectors(i,e),of.subVectors(t,e),nf.cross(of).dot(n)<0}}])}(),mf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ff={h:0,s:0,l:0},vf={h:0,s:0,l:0};function gf(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}var yf=function(){return x()((function t(e,i,n){return k()(this,t),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,i,n)}),[{key:"set",value:function(t,e,i){if(void 0===e&&void 0===i){var n=t;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(t,e,i);return this}},{key:"setScalar",value:function(t){return this.r=t,this.g=t,this.b=t,this}},{key:"setHex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rd;return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Rd.toWorkingColorSpace(this,e),this}},{key:"setRGB",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rd.workingColorSpace;return this.r=t,this.g=e,this.b=i,Rd.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rd.workingColorSpace;if(t=_d(t,1),e=kd(e,0,1),i=kd(i,0,1),0===e)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+e):i+e-i*e,s=2*i-o;this.r=gf(s,o,t+1/3),this.g=gf(s,o,t),this.b=gf(s,o,t-1/3)}return Rd.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rd;function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(e=/^(\w+)\(([^\)]*)\)/.exec(t)){var o,s=e[1],a=e[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,i);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,i);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){var r=e[1],l=r.length;if(3===l)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,i);if(6===l)return this.setHex(parseInt(r,16),i);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}},{key:"setColorName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rd,i=mf[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}},{key:"copySRGBToLinear",value:function(t){return this.r=zd(t.r),this.g=zd(t.g),this.b=zd(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=Hd(t.r),this.g=Hd(t.g),this.b=Hd(t.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rd;return Rd.fromWorkingColorSpace(bf.copy(this),t),65536*Math.round(kd(255*bf.r,0,255))+256*Math.round(kd(255*bf.g,0,255))+Math.round(kd(255*bf.b,0,255))}},{key:"getHexString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rd;return("000000"+this.getHex(t).toString(16)).slice(-6)}},{key:"getHSL",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rd.workingColorSpace;Rd.fromWorkingColorSpace(bf.copy(this),e);var i,n,o=bf.r,s=bf.g,a=bf.b,r=Math.max(o,s,a),l=Math.min(o,s,a),c=(l+r)/2;if(l===r)i=0,n=0;else{var u=r-l;switch(n=c<=.5?u/(r+l):u/(2-r-l),r){case o:i=(s-a)/u+(s<a?6:0);break;case s:i=(a-o)/u+2;break;case a:i=(o-s)/u+4}i/=6}return t.h=i,t.s=n,t.l=c,t}},{key:"getRGB",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rd.workingColorSpace;return Rd.fromWorkingColorSpace(bf.copy(this),e),t.r=bf.r,t.g=bf.g,t.b=bf.b,t}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rd;Rd.fromWorkingColorSpace(bf.copy(this),t);var e=bf.r,i=bf.g,n=bf.b;return t!==rd?"color(".concat(t," ").concat(e.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*e),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(t,e,i){return this.getHSL(ff),this.setHSL(ff.h+t,ff.s+e,ff.l+i)}},{key:"add",value:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}},{key:"addColors",value:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}},{key:"addScalar",value:function(t){return this.r+=t,this.g+=t,this.b+=t,this}},{key:"sub",value:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}},{key:"multiply",value:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}},{key:"multiplyScalar",value:function(t){return this.r*=t,this.g*=t,this.b*=t,this}},{key:"lerp",value:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}},{key:"lerpColors",value:function(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}},{key:"lerpHSL",value:function(t,e){this.getHSL(ff),t.getHSL(vf);var i=xd(ff.h,vf.h,e),n=xd(ff.s,vf.s,e),o=xd(ff.l,vf.l,e);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}},{key:"applyMatrix3",value:function(t){var e=this.r,i=this.g,n=this.b,o=t.elements;return this.r=o[0]*e+o[3]*i+o[6]*n,this.g=o[1]*e+o[4]*i+o[7]*n,this.b=o[2]*e+o[5]*i+o[8]*n,this}},{key:"equals",value:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},{key:"fromBufferAttribute",value:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.r;case 2:return t.next=4,this.g;case 4:return t.next=6,this.b;case 6:case"end":return t.stop()}}),t,this)}))}])}(),bf=new yf;yf.NAMES=mf;var Cf=0,wf=function(t){function e(){var t;return k()(this,e),(t=id(this,e)).isMaterial=!0,Object.defineProperty(td()(t),"id",{value:Cf++}),t.uuid=wd(),t.name="",t.type="Material",t.blending=1,t.side=0,t.vertexColors=!1,t.opacity=1,t.transparent=!1,t.alphaHash=!1,t.blendSrc=204,t.blendDst=205,t.blendEquation=100,t.blendSrcAlpha=null,t.blendDstAlpha=null,t.blendEquationAlpha=null,t.blendColor=new yf(0,0,0),t.blendAlpha=0,t.depthFunc=3,t.depthTest=!0,t.depthWrite=!0,t.stencilWriteMask=255,t.stencilFunc=519,t.stencilRef=0,t.stencilFuncMask=255,t.stencilFail=md,t.stencilZFail=md,t.stencilZPass=md,t.stencilWrite=!1,t.clippingPlanes=null,t.clipIntersection=!1,t.clipShadows=!1,t.shadowSide=null,t.colorWrite=!0,t.precision=null,t.polygonOffset=!1,t.polygonOffsetFactor=0,t.polygonOffsetUnits=0,t.dithering=!1,t.alphaToCoverage=!1,t.premultipliedAlpha=!1,t.forceSinglePass=!1,t.visible=!0,t.toneMapped=!0,t.userData={},t.version=0,t._alphaTest=0,t}return qi()(e,t),x()(e,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE.Material: '".concat(e,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(e,"' has value of undefined."))}}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==md&&(i.stencilFail=this.stencilFail),this.stencilZFail!==md&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==md&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){var o=n(t.textures),s=n(t.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=e[o].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}}])}(yd),kf=function(t){function e(t){var i;return k()(this,e),(i=id(this,e)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new yf(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.alphaMap=null,i.envMap=null,i.envMapRotation=new Fm,i.combine=0,i.reflectivity=1,i.refractionRatio=.98,i.wireframe=!1,i.wireframeLinewidth=1,i.wireframeLinecap="round",i.wireframeLinejoin="round",i.fog=!0,i.setValues(t),i}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}])}(wf);!function(){for(var t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),n=new Uint32Array(512),o=new Uint32Array(512),s=0;s<256;++s){var a=s-127;a<-27?(n[s]=0,n[256|s]=32768,o[s]=24,o[256|s]=24):a<-14?(n[s]=1024>>-a-14,n[256|s]=1024>>-a-14|32768,o[s]=-a-1,o[256|s]=-a-1):a<=15?(n[s]=a+15<<10,n[256|s]=a+15<<10|32768,o[s]=13,o[256|s]=13):a<128?(n[s]=31744,n[256|s]=64512,o[s]=24,o[256|s]=24):(n[s]=31744,n[256|s]=64512,o[s]=13,o[256|s]=13)}for(var r=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64),u=1;u<1024;++u){for(var p=u<<13,h=0;0==(8388608&p);)p<<=1,h-=8388608;p&=-8388609,h+=947912704,r[u]=p|h}for(var d=1024;d<2048;++d)r[d]=939524096+(d-1024<<13);for(var m=1;m<31;++m)l[m]=m<<23;l[31]=1199570944,l[32]=2147483648;for(var f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(var v=1;v<64;++v)32!==v&&(c[v]=1024)}();var _f=new $d,xf=new Dd,Ef=function(){return x()((function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(k()(this,t),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=i,this.count=void 0!==e?e.length/i:0,this.normalized=n,this.usage=fd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"updateRange",get:function(){return Bd("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(t){return this.usage=t,this}},{key:"addUpdateRange",value:function(t,e){this.updateRanges.push({start:t,count:e})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}},{key:"copyAt",value:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,o=this.itemSize;n<o;n++)this.array[t+n]=e.array[i+n];return this}},{key:"copyArray",value:function(t){return this.array.set(t),this}},{key:"applyMatrix3",value:function(t){if(2===this.itemSize)for(var e=0,i=this.count;e<i;e++)xf.fromBufferAttribute(this,e),xf.applyMatrix3(t),this.setXY(e,xf.x,xf.y);else if(3===this.itemSize)for(var n=0,o=this.count;n<o;n++)_f.fromBufferAttribute(this,n),_f.applyMatrix3(t),this.setXYZ(n,_f.x,_f.y,_f.z);return this}},{key:"applyMatrix4",value:function(t){for(var e=0,i=this.count;e<i;e++)_f.fromBufferAttribute(this,e),_f.applyMatrix4(t),this.setXYZ(e,_f.x,_f.y,_f.z);return this}},{key:"applyNormalMatrix",value:function(t){for(var e=0,i=this.count;e<i;e++)_f.fromBufferAttribute(this,e),_f.applyNormalMatrix(t),this.setXYZ(e,_f.x,_f.y,_f.z);return this}},{key:"transformDirection",value:function(t){for(var e=0,i=this.count;e<i;e++)_f.fromBufferAttribute(this,e),_f.transformDirection(t),this.setXYZ(e,_f.x,_f.y,_f.z);return this}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this}},{key:"getComponent",value:function(t,e){var i=this.array[t*this.itemSize+e];return this.normalized&&(i=Ed(i,this.array)),i}},{key:"setComponent",value:function(t,e,i){return this.normalized&&(i=Sd(i,this.array)),this.array[t*this.itemSize+e]=i,this}},{key:"getX",value:function(t){var e=this.array[t*this.itemSize];return this.normalized&&(e=Ed(e,this.array)),e}},{key:"setX",value:function(t,e){return this.normalized&&(e=Sd(e,this.array)),this.array[t*this.itemSize]=e,this}},{key:"getY",value:function(t){var e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ed(e,this.array)),e}},{key:"setY",value:function(t,e){return this.normalized&&(e=Sd(e,this.array)),this.array[t*this.itemSize+1]=e,this}},{key:"getZ",value:function(t){var e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ed(e,this.array)),e}},{key:"setZ",value:function(t,e){return this.normalized&&(e=Sd(e,this.array)),this.array[t*this.itemSize+2]=e,this}},{key:"getW",value:function(t){var e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ed(e,this.array)),e}},{key:"setW",value:function(t,e){return this.normalized&&(e=Sd(e,this.array)),this.array[t*this.itemSize+3]=e,this}},{key:"setXY",value:function(t,e,i){return t*=this.itemSize,this.normalized&&(e=Sd(e,this.array),i=Sd(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}},{key:"setXYZ",value:function(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=Sd(e,this.array),i=Sd(i,this.array),n=Sd(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}},{key:"setXYZW",value:function(t,e,i,n,o){return t*=this.itemSize,this.normalized&&(e=Sd(e,this.array),i=Sd(i,this.array),n=Sd(n,this.array),o=Sd(o,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=o,this}},{key:"onUpload",value:function(t){return this.onUploadCallback=t,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==fd&&(t.usage=this.usage),t}}])}(),Sf=function(t){function e(t,i,n){return k()(this,e),id(this,e,[new Uint16Array(t),i,n])}return qi()(e,t),x()(e)}(Ef),Df=function(t){function e(t,i,n){return k()(this,e),id(this,e,[new Uint32Array(t),i,n])}return qi()(e,t),x()(e)}(Ef),Pf=function(t){function e(t,i,n){return k()(this,e),id(this,e,[new Float32Array(t),i,n])}return qi()(e,t),x()(e)}(Ef),Mf=0,Of=new Pm,Tf=new ef,Nf=new $d,Bf=new em,Lf=new em,Af=new $d,jf=function(t){function e(){var t;return k()(this,e),(t=id(this,e)).isBufferGeometry=!0,Object.defineProperty(td()(t),"id",{value:Mf++}),t.uuid=wd(),t.name="",t.type="BufferGeometry",t.index=null,t.attributes={},t.morphAttributes={},t.morphTargetsRelative=!1,t.groups=[],t.boundingBox=null,t.boundingSphere=null,t.drawRange={start:0,count:1/0},t.userData={},t}return qi()(e,t),x()(e,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(t){return Array.isArray(t)?this.index=new(Od(t)?Df:Sf)(t,1):this.index=t,this}},{key:"getAttribute",value:function(t){return this.attributes[t]}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"deleteAttribute",value:function(t){return delete this.attributes[t],this}},{key:"hasAttribute",value:function(t){return void 0!==this.attributes[t]}},{key:"addGroup",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:t,count:e,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(t,e){this.drawRange.start=t,this.drawRange.count=e}},{key:"applyMatrix4",value:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new Pd).getNormalMatrix(t);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(t),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(t){return Of.makeRotationFromQuaternion(t),this.applyMatrix4(Of),this}},{key:"rotateX",value:function(t){return Of.makeRotationX(t),this.applyMatrix4(Of),this}},{key:"rotateY",value:function(t){return Of.makeRotationY(t),this.applyMatrix4(Of),this}},{key:"rotateZ",value:function(t){return Of.makeRotationZ(t),this.applyMatrix4(Of),this}},{key:"translate",value:function(t,e,i){return Of.makeTranslation(t,e,i),this.applyMatrix4(Of),this}},{key:"scale",value:function(t,e,i){return Of.makeScale(t,e,i),this.applyMatrix4(Of),this}},{key:"lookAt",value:function(t){return Tf.lookAt(t),Tf.updateMatrix(),this.applyMatrix4(Tf.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Nf).negate(),this.translate(Nf.x,Nf.y,Nf.z),this}},{key:"setFromPoints",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Pf(e,3)),this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new em);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new $d(-1/0,-1/0,-1/0),new $d(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var i=0,n=e.length;i<n;i++){var o=e[i];Bf.setFromBufferAttribute(o),this.morphTargetsRelative?(Af.addVectors(this.boundingBox.min,Bf.min),this.boundingBox.expandByPoint(Af),Af.addVectors(this.boundingBox.max,Bf.max),this.boundingBox.expandByPoint(Af)):(this.boundingBox.expandByPoint(Bf.min),this.boundingBox.expandByPoint(Bf.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new bm);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new $d,1/0);if(t){var i=this.boundingSphere.center;if(Bf.setFromBufferAttribute(t),e)for(var n=0,o=e.length;n<o;n++){var s=e[n];Lf.setFromBufferAttribute(s),this.morphTargetsRelative?(Af.addVectors(Bf.min,Lf.min),Bf.expandByPoint(Af),Af.addVectors(Bf.max,Lf.max),Bf.expandByPoint(Af)):(Bf.expandByPoint(Lf.min),Bf.expandByPoint(Lf.max))}Bf.getCenter(i);for(var a=0,r=0,l=t.count;r<l;r++)Af.fromBufferAttribute(t,r),a=Math.max(a,i.distanceToSquared(Af));if(e)for(var c=0,u=e.length;c<u;c++)for(var p=e[c],h=this.morphTargetsRelative,d=0,m=p.count;d<m;d++)Af.fromBufferAttribute(p,d),h&&(Nf.fromBufferAttribute(t,d),Af.add(Nf)),a=Math.max(a,i.distanceToSquared(Af));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var t=this.index,e=this.attributes;if(null!==t&&void 0!==e.position&&void 0!==e.normal&&void 0!==e.uv){var i=e.position,n=e.normal,o=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Ef(new Float32Array(4*i.count),4));for(var s=this.getAttribute("tangent"),a=[],r=[],l=0;l<i.count;l++)a[l]=new $d,r[l]=new $d;var c=new $d,u=new $d,p=new $d,h=new Dd,d=new Dd,m=new Dd,f=new $d,v=new $d,g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(var y=0,b=g.length;y<b;++y)for(var C=g[y],w=C.start,k=w,_=w+C.count;k<_;k+=3)L(t.getX(k+0),t.getX(k+1),t.getX(k+2));for(var x=new $d,E=new $d,S=new $d,D=new $d,P=0,M=g.length;P<M;++P)for(var O=g[P],T=O.start,N=T,B=T+O.count;N<B;N+=3)A(t.getX(N+0)),A(t.getX(N+1)),A(t.getX(N+2))}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function L(t,e,n){c.fromBufferAttribute(i,t),u.fromBufferAttribute(i,e),p.fromBufferAttribute(i,n),h.fromBufferAttribute(o,t),d.fromBufferAttribute(o,e),m.fromBufferAttribute(o,n),u.sub(c),p.sub(c),d.sub(h),m.sub(h);var s=1/(d.x*m.y-m.x*d.y);isFinite(s)&&(f.copy(u).multiplyScalar(m.y).addScaledVector(p,-d.y).multiplyScalar(s),v.copy(p).multiplyScalar(d.x).addScaledVector(u,-m.x).multiplyScalar(s),a[t].add(f),a[e].add(f),a[n].add(f),r[t].add(v),r[e].add(v),r[n].add(v))}function A(t){S.fromBufferAttribute(n,t),D.copy(S);var e=a[t];x.copy(e),x.sub(S.multiplyScalar(S.dot(e))).normalize(),E.crossVectors(D,e);var i=E.dot(r[t])<0?-1:1;s.setXYZW(t,x.x,x.y,x.z,i)}}},{key:"computeVertexNormals",value:function(){var t=this.index,e=this.getAttribute("position");if(void 0!==e){var i=this.getAttribute("normal");if(void 0===i)i=new Ef(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(var n=0,o=i.count;n<o;n++)i.setXYZ(n,0,0,0);var s=new $d,a=new $d,r=new $d,l=new $d,c=new $d,u=new $d,p=new $d,h=new $d;if(t)for(var d=0,m=t.count;d<m;d+=3){var f=t.getX(d+0),v=t.getX(d+1),g=t.getX(d+2);s.fromBufferAttribute(e,f),a.fromBufferAttribute(e,v),r.fromBufferAttribute(e,g),p.subVectors(r,a),h.subVectors(s,a),p.cross(h),l.fromBufferAttribute(i,f),c.fromBufferAttribute(i,v),u.fromBufferAttribute(i,g),l.add(p),c.add(p),u.add(p),i.setXYZ(f,l.x,l.y,l.z),i.setXYZ(v,c.x,c.y,c.z),i.setXYZ(g,u.x,u.y,u.z)}else for(var y=0,b=e.count;y<b;y+=3)s.fromBufferAttribute(e,y+0),a.fromBufferAttribute(e,y+1),r.fromBufferAttribute(e,y+2),p.subVectors(r,a),h.subVectors(s,a),p.cross(h),i.setXYZ(y+0,p.x,p.y,p.z),i.setXYZ(y+1,p.x,p.y,p.z),i.setXYZ(y+2,p.x,p.y,p.z);this.normalizeNormals(),i.needsUpdate=!0}}},{key:"normalizeNormals",value:function(){for(var t=this.attributes.normal,e=0,i=t.count;e<i;e++)Af.fromBufferAttribute(t,e),Af.normalize(),t.setXYZ(e,Af.x,Af.y,Af.z)}},{key:"toNonIndexed",value:function(){function t(t,e){for(var i=t.array,n=t.itemSize,o=t.normalized,s=new i.constructor(e.length*n),a=0,r=0,l=0,c=e.length;l<c;l++){a=t.isInterleavedBufferAttribute?e[l]*t.data.stride+t.offset:e[l]*n;for(var u=0;u<n;u++)s[r++]=i[a++]}return new Ef(s,n,o)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var i=new e,n=this.index.array,o=this.attributes;for(var s in o){var a=t(o[s],n);i.setAttribute(s,a)}var r=this.morphAttributes;for(var l in r){for(var c=[],u=r[l],p=0,h=u.length;p<h;p++){var d=t(u[p],n);c.push(d)}i.morphAttributes[l]=c}i.morphTargetsRelative=this.morphTargetsRelative;for(var m=this.groups,f=0,v=m.length;f<v;f++){var g=m[f];i.addGroup(g.start,g.count,g.materialIndex)}return i}},{key:"toJSON",value:function(){var t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var o=this.attributes;for(var s in o){var a=o[s];t.data.attributes[s]=a.toJSON(t.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],p=[],h=0,d=u.length;h<d;h++){var m=u[h];p.push(m.toJSON(t.data))}p.length>0&&(r[c]=p,l=!0)}l&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(t.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(t.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),t}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone(e));var n=t.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(e))}var a=t.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,p=c.length;u<p;u++)l.push(c[u].clone(e));this.morphAttributes[r]=l}this.morphTargetsRelative=t.morphTargetsRelative;for(var h=t.groups,d=0,m=h.length;d<m;d++){var f=h[d];this.addGroup(f.start,f.count,f.materialIndex)}var v=t.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=t.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}])}(yd),If=new Pm,Ff=new Dm,Rf=new bm,zf=new $d,Hf=new $d,Vf=new $d,Gf=new $d,Uf=new $d,Wf=new $d,Yf=new Dd,Jf=new Dd,qf=new Dd,Xf=new $d,Zf=new $d,Kf=new $d,$f=new $d,Qf=new $d,tv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jf,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kf;return k()(this,e),(t=id(this,e)).isMesh=!0,t.type="Mesh",t.geometry=i,t.material=n,t.updateMorphTargets(),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t,i){return ed(e,"copy",this,3)([t,i]),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}},{key:"updateMorphTargets",value:function(){var t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){var i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;n<o;n++){var s=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=n}}}}},{key:"getVertexPosition",value:function(t,e){var i=this.geometry,n=i.attributes.position,o=i.morphAttributes.position,s=i.morphTargetsRelative;e.fromBufferAttribute(n,t);var a=this.morphTargetInfluences;if(o&&a){Wf.set(0,0,0);for(var r=0,l=o.length;r<l;r++){var c=a[r],u=o[r];0!==c&&(Uf.fromBufferAttribute(u,t),s?Wf.addScaledVector(Uf,c):Wf.addScaledVector(Uf.sub(e),c))}e.add(Wf)}return e}},{key:"raycast",value:function(t,e){var i=this.geometry,n=this.material,o=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),Rf.copy(i.boundingSphere),Rf.applyMatrix4(o),Ff.copy(t.ray).recast(t.near),!1===Rf.containsPoint(Ff.origin)){if(null===Ff.intersectSphere(Rf,zf))return;if(Ff.origin.distanceToSquared(zf)>Math.pow(t.far-t.near,2))return}If.copy(o).invert(),Ff.copy(t.ray).applyMatrix4(If),null!==i.boundingBox&&!1===Ff.intersectsBox(i.boundingBox)||this._computeIntersections(t,e,Ff)}}},{key:"_computeIntersections",value:function(t,e,i){var n,o=this.geometry,s=this.material,a=o.index,r=o.attributes.position,l=o.attributes.uv,c=o.attributes.uv1,u=o.attributes.normal,p=o.groups,h=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=p.length;d<m;d++)for(var f=p[d],v=s[f.materialIndex],g=Math.max(f.start,h.start),y=Math.min(a.count,Math.min(f.start+f.count,h.start+h.count));g<y;g+=3)(n=ev(this,v,t,i,l,c,u,a.getX(g),a.getX(g+1),a.getX(g+2)))&&(n.faceIndex=Math.floor(g/3),n.face.materialIndex=f.materialIndex,e.push(n));else for(var b=Math.max(0,h.start),C=Math.min(a.count,h.start+h.count);b<C;b+=3)(n=ev(this,s,t,i,l,c,u,a.getX(b),a.getX(b+1),a.getX(b+2)))&&(n.faceIndex=Math.floor(b/3),e.push(n));else if(void 0!==r)if(Array.isArray(s))for(var w=0,k=p.length;w<k;w++)for(var _=p[w],x=s[_.materialIndex],E=Math.max(_.start,h.start),S=Math.min(r.count,Math.min(_.start+_.count,h.start+h.count));E<S;E+=3)(n=ev(this,x,t,i,l,c,u,E,E+1,E+2))&&(n.faceIndex=Math.floor(E/3),n.face.materialIndex=_.materialIndex,e.push(n));else for(var D=Math.max(0,h.start),P=Math.min(r.count,h.start+h.count);D<P;D+=3)(n=ev(this,s,t,i,l,c,u,D,D+1,D+2))&&(n.faceIndex=Math.floor(D/3),e.push(n))}}])}(ef);function ev(t,e,i,n,o,s,a,r,l,c){t.getVertexPosition(r,Hf),t.getVertexPosition(l,Vf),t.getVertexPosition(c,Gf);var u=function(t,e,i,n,o,s,a,r){if(null===(1===e.side?n.intersectTriangle(a,s,o,!0,r):n.intersectTriangle(o,s,a,0===e.side,r)))return null;Qf.copy(r),Qf.applyMatrix4(t.matrixWorld);var l=i.ray.origin.distanceTo(Qf);return l<i.near||l>i.far?null:{distance:l,point:Qf.clone(),object:t}}(t,e,i,n,Hf,Vf,Gf,$f);if(u){o&&(Yf.fromBufferAttribute(o,r),Jf.fromBufferAttribute(o,l),qf.fromBufferAttribute(o,c),u.uv=df.getInterpolation($f,Hf,Vf,Gf,Yf,Jf,qf,new Dd)),s&&(Yf.fromBufferAttribute(s,r),Jf.fromBufferAttribute(s,l),qf.fromBufferAttribute(s,c),u.uv1=df.getInterpolation($f,Hf,Vf,Gf,Yf,Jf,qf,new Dd)),a&&(Xf.fromBufferAttribute(a,r),Zf.fromBufferAttribute(a,l),Kf.fromBufferAttribute(a,c),u.normal=df.getInterpolation($f,Hf,Vf,Gf,Xf,Zf,Kf,new $d),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var p={a:r,b:l,c:c,normal:new $d,materialIndex:0};df.getNormal(Hf,Vf,Gf,p.normal),u.face=p}return u}var iv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;k()(this,e),(t=id(this,e)).type="BoxGeometry",t.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=t;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],p=[],h=[],d=0,m=0;function f(t,e,i,n,o,s,a,r,f,v,g){for(var y=s/f,b=a/v,C=s/2,w=a/2,k=r/2,_=f+1,x=v+1,E=0,S=0,D=new $d,P=0;P<x;P++)for(var M=P*b-w,O=0;O<_;O++){var T=O*y-C;D[t]=T*n,D[e]=M*o,D[i]=k,u.push(D.x,D.y,D.z),D[t]=0,D[e]=0,D[i]=r>0?1:-1,p.push(D.x,D.y,D.z),h.push(O/f),h.push(1-P/v),E+=1}for(var N=0;N<v;N++)for(var B=0;B<f;B++){var L=d+B+_*N,A=d+B+_*(N+1),j=d+(B+1)+_*(N+1),I=d+(B+1)+_*N;c.push(L,A,I),c.push(A,j,I),S+=6}l.addGroup(m,S,g),m+=S,d+=E}return f("z","y","x",-1,-1,o,n,i,r,a,0),f("z","y","x",1,-1,o,n,-i,r,a,1),f("x","z","y",1,1,i,o,n,s,r,2),f("x","z","y",1,-1,i,o,-n,s,r,3),f("x","y","z",1,-1,i,n,o,s,a,4),f("x","y","z",-1,-1,i,n,-o,s,a,5),t.setIndex(c),t.setAttribute("position",new Pf(u,3)),t.setAttribute("normal",new Pf(p,3)),t.setAttribute("uv",new Pf(h,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}])}(jf);function nv(t){var e={};for(var i in t)for(var n in e[i]={},t[i]){var o=t[i][n];o&&(o.isColor||o.isMatrix3||o.isMatrix4||o.isVector2||o.isVector3||o.isVector4||o.isTexture||o.isQuaternion)?o.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][n]=null):e[i][n]=o.clone():Array.isArray(o)?e[i][n]=o.slice():e[i][n]=o}return e}function ov(t){for(var e={},i=0;i<t.length;i++){var n=nv(t[i]);for(var o in n)e[o]=n[o]}return e}var sv=function(t){function e(){var t;return k()(this,e),(t=id(this,e)).isCamera=!0,t.type="Camera",t.matrixWorldInverse=new Pm,t.projectionMatrix=new Pm,t.projectionMatrixInverse=new Pm,t.coordinateSystem=vd,t}return qi()(e,t),x()(e,[{key:"copy",value:function(t,i){return ed(e,"copy",this,3)([t,i]),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}},{key:"getWorldDirection",value:function(t){return ed(e,"getWorldDirection",this,3)([t]).negate()}},{key:"updateMatrixWorld",value:function(t){ed(e,"updateMatrixWorld",this,3)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){ed(e,"updateWorldMatrix",this,3)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(ef),av=(new $d,new Dd,new Dd,function(t){function e(t,i,n,o,s,a,r,l,c,u){var p;return k()(this,e),(p=id(this,e,[t=void 0!==t?t:[],i=void 0!==i?i:301,n,o,s,a,r,l,c,u])).isCubeTexture=!0,p.flipY=!1,p}return qi()(e,t),x()(e,[{key:"images",get:function(){return this.image},set:function(t){this.image=t}}])}(Jd)),rv=new $d,lv=new $d,cv=new Pd,uv=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t),this.isPlane=!0,this.normal=e,this.constant=i}),[{key:"set",value:function(t,e){return this.normal.copy(t),this.constant=e,this}},{key:"setComponents",value:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,e,i){var n=rv.subVectors(i,e).cross(lv.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}},{key:"copy",value:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this}},{key:"normalize",value:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(t){return this.normal.dot(t)+this.constant}},{key:"distanceToSphere",value:function(t){return this.distanceToPoint(t.center)-t.radius}},{key:"projectPoint",value:function(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}},{key:"intersectLine",value:function(t,e){var i=t.delta(rv),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;var o=-(t.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:e.copy(t.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}},{key:"intersectsBox",value:function(t){return t.intersectsPlane(this)}},{key:"intersectsSphere",value:function(t){return t.intersectsPlane(this)}},{key:"coplanarPoint",value:function(t){return t.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,e){var i=e||cv.getNormalMatrix(t),n=this.coplanarPoint(rv).applyMatrix4(t),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(t){return this.constant-=t.dot(this.normal),this}},{key:"equals",value:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),pv=new bm,hv=new $d,dv=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new uv,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new uv,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new uv,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new uv,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new uv,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new uv;k()(this,t),this.planes=[e,i,n,o,s,a]}),[{key:"set",value:function(t,e,i,n,o,s){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=t.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],p=n[7],h=n[8],d=n[9],m=n[10],f=n[11],v=n[12],g=n[13],y=n[14],b=n[15];if(i[0].setComponents(r-o,p-l,f-h,b-v).normalize(),i[1].setComponents(r+o,p+l,f+h,b+v).normalize(),i[2].setComponents(r+s,p+c,f+d,b+g).normalize(),i[3].setComponents(r-s,p-c,f-d,b-g).normalize(),i[4].setComponents(r-a,p-u,f-m,b-y).normalize(),e===vd)i[5].setComponents(r+a,p+u,f+m,b+y).normalize();else{if(e!==gd)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),pv.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{var e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),pv.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(pv)}},{key:"intersectsSprite",value:function(t){return pv.center.set(0,0,0),pv.radius=.7071067811865476,pv.applyMatrix4(t.matrixWorld),this.intersectsSphere(pv)}},{key:"intersectsSphere",value:function(t){for(var e=this.planes,i=t.center,n=-t.radius,o=0;o<6;o++)if(e[o].distanceToPoint(i)<n)return!1;return!0}},{key:"intersectsBox",value:function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];if(hv.x=n.normal.x>0?t.max.x:t.min.x,hv.y=n.normal.y>0?t.max.y:t.min.y,hv.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(hv)<0)return!1}return!0}},{key:"containsPoint",value:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var mv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),(t=id(this,e)).type="PlaneGeometry",t.parameters={width:i,height:n,widthSegments:o,heightSegments:s};for(var a=i/2,r=n/2,l=Math.floor(o),c=Math.floor(s),u=l+1,p=c+1,h=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y<p;y++)for(var b=y*d-r,C=0;C<u;C++){var w=C*h-a;f.push(w,-b,0),v.push(0,0,1),g.push(C/l),g.push(1-y/c)}for(var _=0;_<c;_++)for(var x=0;x<l;x++){var E=x+u*_,S=x+u*(_+1),D=x+1+u*(_+1),P=x+1+u*_;m.push(E,S,P),m.push(S,D,P)}return t.setIndex(m),t.setAttribute("position",new Pf(f,3)),t.setAttribute("normal",new Pf(v,3)),t.setAttribute("uv",new Pf(g,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}}])}(jf),fv={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},vv={common:{diffuse:{value:new yf(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Pd},alphaMap:{value:null},alphaMapTransform:{value:new Pd},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Pd}},envmap:{envMap:{value:null},envMapRotation:{value:new Pd},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Pd}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Pd}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Pd},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Pd},normalScale:{value:new Dd(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Pd},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Pd}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Pd}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Pd}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yf(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Pd},alphaTest:{value:0},uvTransform:{value:new Pd}},sprite:{diffuse:{value:new yf(16777215)},opacity:{value:1},center:{value:new Dd(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Pd},alphaMap:{value:null},alphaMapTransform:{value:new Pd},alphaTest:{value:0}}},gv={basic:{uniforms:ov([vv.common,vv.specularmap,vv.envmap,vv.aomap,vv.lightmap,vv.fog]),vertexShader:fv.meshbasic_vert,fragmentShader:fv.meshbasic_frag},lambert:{uniforms:ov([vv.common,vv.specularmap,vv.envmap,vv.aomap,vv.lightmap,vv.emissivemap,vv.bumpmap,vv.normalmap,vv.displacementmap,vv.fog,vv.lights,{emissive:{value:new yf(0)}}]),vertexShader:fv.meshlambert_vert,fragmentShader:fv.meshlambert_frag},phong:{uniforms:ov([vv.common,vv.specularmap,vv.envmap,vv.aomap,vv.lightmap,vv.emissivemap,vv.bumpmap,vv.normalmap,vv.displacementmap,vv.fog,vv.lights,{emissive:{value:new yf(0)},specular:{value:new yf(1118481)},shininess:{value:30}}]),vertexShader:fv.meshphong_vert,fragmentShader:fv.meshphong_frag},standard:{uniforms:ov([vv.common,vv.envmap,vv.aomap,vv.lightmap,vv.emissivemap,vv.bumpmap,vv.normalmap,vv.displacementmap,vv.roughnessmap,vv.metalnessmap,vv.fog,vv.lights,{emissive:{value:new yf(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fv.meshphysical_vert,fragmentShader:fv.meshphysical_frag},toon:{uniforms:ov([vv.common,vv.aomap,vv.lightmap,vv.emissivemap,vv.bumpmap,vv.normalmap,vv.displacementmap,vv.gradientmap,vv.fog,vv.lights,{emissive:{value:new yf(0)}}]),vertexShader:fv.meshtoon_vert,fragmentShader:fv.meshtoon_frag},matcap:{uniforms:ov([vv.common,vv.bumpmap,vv.normalmap,vv.displacementmap,vv.fog,{matcap:{value:null}}]),vertexShader:fv.meshmatcap_vert,fragmentShader:fv.meshmatcap_frag},points:{uniforms:ov([vv.points,vv.fog]),vertexShader:fv.points_vert,fragmentShader:fv.points_frag},dashed:{uniforms:ov([vv.common,vv.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fv.linedashed_vert,fragmentShader:fv.linedashed_frag},depth:{uniforms:ov([vv.common,vv.displacementmap]),vertexShader:fv.depth_vert,fragmentShader:fv.depth_frag},normal:{uniforms:ov([vv.common,vv.bumpmap,vv.normalmap,vv.displacementmap,{opacity:{value:1}}]),vertexShader:fv.meshnormal_vert,fragmentShader:fv.meshnormal_frag},sprite:{uniforms:ov([vv.sprite,vv.fog]),vertexShader:fv.sprite_vert,fragmentShader:fv.sprite_frag},background:{uniforms:{uvTransform:{value:new Pd},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:fv.background_vert,fragmentShader:fv.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Pd}},vertexShader:fv.backgroundCube_vert,fragmentShader:fv.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:fv.cube_vert,fragmentShader:fv.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fv.equirect_vert,fragmentShader:fv.equirect_frag},distanceRGBA:{uniforms:ov([vv.common,vv.displacementmap,{referencePosition:{value:new $d},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fv.distanceRGBA_vert,fragmentShader:fv.distanceRGBA_frag},shadow:{uniforms:ov([vv.lights,vv.fog,{color:{value:new yf(0)},opacity:{value:1}}]),vertexShader:fv.shadow_vert,fragmentShader:fv.shadow_frag}};gv.physical={uniforms:ov([gv.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Pd},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Pd},clearcoatNormalScale:{value:new Dd(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Pd},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Pd},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Pd},sheen:{value:0},sheenColor:{value:new yf(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Pd},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Pd},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Pd},transmissionSamplerSize:{value:new Dd},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Pd},attenuationDistance:{value:0},attenuationColor:{value:new yf(0)},specularColor:{value:new yf(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Pd},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Pd},anisotropyVector:{value:new Dd},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Pd}}]),vertexShader:fv.meshphysical_vert,fragmentShader:fv.meshphysical_frag};new Fm,new Pm;var yv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return k()(this,e),(t=id(this,e)).isOrthographicCamera=!0,t.type="OrthographicCamera",t.zoom=1,t.view=null,t.left=i,t.right=n,t.top=o,t.bottom=s,t.near=a,t.far=r,t.updateProjectionMatrix(),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t,i){return ed(e,"copy",this,3)([t,i]),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}},{key:"setViewOffset",value:function(t,e,i,n,o,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-t,s=i+t,a=n+e,r=n-e;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s=(o+=l*this.view.offsetX)+l*this.view.width,r=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,r,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(t){var i=ed(e,"toJSON",this,3)([t]);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,null!==this.view&&(i.object.view=Object.assign({},this.view)),i}}])}(sv),bv=(new yv,new yf,(1+Math.sqrt(5))/2),Cv=1/bv;new $d(-bv,Cv,0),new $d(bv,Cv,0),new $d(-Cv,0,bv),new $d(Cv,0,bv),new $d(0,bv,-Cv),new $d(0,bv,Cv),new $d(-1,1,-1),new $d(1,1,-1),new $d(-1,1,1),new $d(1,1,1);var wv=function(t){function e(t,i,n,o,s,a,r,l,c,u){var p;if(k()(this,e),1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===n&&1026===u&&(n=nd),void 0===n&&1027===u&&(n=od),(p=id(this,e,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,p.image={width:t,height:i},p.magFilter=void 0!==r?r:1003,p.minFilter=void 0!==l?l:1003,p.flipY=!1,p.generateMipmaps=!1,p.compareFunction=null,p}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.compareFunction=t.compareFunction,this}},{key:"toJSON",value:function(t){var i=ed(e,"toJSON",this,3)([t]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(Jd),kv=(new Jd,new wv(1,1));kv.compareFunction=515;new Xd,new Zd,new av,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new Fm,new Pm;new $d,new $d,new $d,new $d,new Dd,new Dd,new Pm,new $d,new $d,new $d,new Dd,new Dd,new Dd;new $d,new $d,new $d,new qd,new qd,new $d,new Pm,new $d,new bm,new Pm,new Dm,new Pm,new Pm,new Pm,new Pm,new em,new Pm,new tv,new bm;var _v=function(){return x()((function t(){k()(this,t),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(t,e){var i=this.pool,n=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1});var o=i[this.index];n.push(o),this.index++,o.start=t.start,o.count=t.count,o.z=e}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new Pm,new Pm,new Pm,new Pm,new dv,new em,new bm,new $d,new _v,new tv;new $d,new $d,new Pm,new Dm,new bm,new $d,new $d;new $d,new $d,new Pm,new Dm,new bm,new $d;var xv=function(){return x()((function t(){k()(this,t),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)}},{key:"getPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}},{key:"getLength",value:function(){var t=this.getLengths();return t[t.length-1]}},{key:"getLengths",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=t;s++)o+=(e=this.getPoint(s/t)).distanceTo(n),i.push(o),n=e;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(t,e){var i,n=this.getLengths(),o=0,s=n.length;i=e||t*n[s-1];for(var a,r=0,l=s-1;r<=l;)if((a=n[o=Math.floor(r+(l-r)/2)]-i)<0)r=o+1;else{if(!(a>0)){l=o;break}l=o-1}if(n[o=l]===i)return o/(s-1);var c=n[o];return(o+(i-c)/(n[o+1]-c))/(s-1)}},{key:"getTangent",value:function(t,e){var i=1e-4,n=t-i,o=t+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=e||(s.isVector2?new Dd:new $d);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)}},{key:"computeFrenetFrames",value:function(t,e){for(var i=new $d,n=[],o=[],s=[],a=new $d,r=new Pm,l=0;l<=t;l++){var c=l/t;n[l]=this.getTangentAt(c,new $d)}o[0]=new $d,s[0]=new $d;var u=Number.MAX_VALUE,p=Math.abs(n[0].x),h=Math.abs(n[0].y),d=Math.abs(n[0].z);p<=u&&(u=p,i.set(1,0,0)),h<=u&&(u=h,i.set(0,1,0)),d<=u&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],a),s[0].crossVectors(n[0],o[0]);for(var m=1;m<=t;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(n[m-1],n[m]),a.length()>Number.EPSILON){a.normalize();var f=Math.acos(kd(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===e){var v=Math.acos(kd(o[0].dot(o[t]),-1,1));v/=t,n[0].dot(a.crossVectors(o[0],o[t]))>0&&(v=-v);for(var g=1;g<=t;g++)o[g].applyMatrix4(r.makeRotationAxis(n[g],v*g)),s[g].crossVectors(n[g],o[g])}return{tangents:n,normals:o,binormals:s}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},{key:"toJSON",value:function(){var t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}},{key:"fromJSON",value:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}])}(),Ev=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return k()(this,e),(t=id(this,e)).isEllipseCurve=!0,t.type="EllipseCurve",t.aX=i,t.aY=n,t.xRadius=o,t.yRadius=s,t.aStartAngle=a,t.aEndAngle=r,t.aClockwise=l,t.aRotation=c,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,i=e,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)<Number.EPSILON;o<0;)o+=n;for(;o>n;)o-=n;o<Number.EPSILON&&(o=s?0:n),!0!==this.aClockwise||s||(o===n?o=-n:o-=n);var a=this.aStartAngle+t*o,r=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=r-this.aX,h=l-this.aY;r=p*c-h*u+this.aX,l=p*u+h*c+this.aY}return i.set(r,l)}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}])}(xv),Sv=function(t){function e(t,i,n,o,s,a){var r;return k()(this,e),(r=id(this,e,[t,i,n,n,o,s,a])).isArcCurve=!0,r.type="ArcCurve",r}return qi()(e,t),x()(e)}(Ev);function Dv(){var t=0,e=0,i=0,n=0;function o(o,s,a,r){t=o,e=a,i=-3*o+3*s-2*a-r,n=2*o-2*s+a+r}return{initCatmullRom:function(t,e,i,n,s){o(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,a,r){var l=(e-t)/s-(i-t)/(s+a)+(i-e)/a,c=(i-e)/a-(n-e)/(a+r)+(n-i)/r;o(e,i,l*=a,c*=a)},calc:function(o){var s=o*o;return t+e*o+i*s+n*(s*o)}}}var Pv=new $d,Mv=new Dv,Ov=new Dv,Tv=new Dv,Nv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return k()(this,e),(t=id(this,e)).isCatmullRomCurve3=!0,t.type="CatmullRomCurve3",t.points=i,t.closed=n,t.curveType=o,t.tension=s,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*t,l=Math.floor(r),c=r-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?e=s[(l-1)%a]:(Pv.subVectors(s[0],s[1]).add(s[0]),e=Pv);var u=s[l%a],p=s[(l+1)%a];if(this.closed||l+2<a?i=s[(l+2)%a]:(Pv.subVectors(s[a-1],s[a-2]).add(s[a-1]),i=Pv),"centripetal"===this.curveType||"chordal"===this.curveType){var h="chordal"===this.curveType?.5:.25,d=Math.pow(e.distanceToSquared(u),h),m=Math.pow(u.distanceToSquared(p),h),f=Math.pow(p.distanceToSquared(i),h);m<1e-4&&(m=1),d<1e-4&&(d=m),f<1e-4&&(f=m),Mv.initNonuniformCatmullRom(e.x,u.x,p.x,i.x,d,m,f),Ov.initNonuniformCatmullRom(e.y,u.y,p.y,i.y,d,m,f),Tv.initNonuniformCatmullRom(e.z,u.z,p.z,i.z,d,m,f)}else"catmullrom"===this.curveType&&(Mv.initCatmullRom(e.x,u.x,p.x,i.x,this.tension),Ov.initCatmullRom(e.y,u.y,p.y,i.y,this.tension),Tv.initCatmullRom(e.z,u.z,p.z,i.z,this.tension));return o.set(Mv.calc(c),Ov.calc(c),Tv.calc(c)),o}},{key:"copy",value:function(t){ed(e,"copy",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push(o.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);t.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];t.points.push(o.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}},{key:"fromJSON",value:function(t){ed(e,"fromJSON",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push((new $d).fromArray(o))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}])}(xv);function Bv(t,e,i,n,o){var s=.5*(n-e),a=.5*(o-i),r=t*t;return(2*i-2*n+s+a)*(t*r)+(-3*i+3*n-2*s-a)*r+s*t+i}function Lv(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function Av(t,e,i,n,o){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,o)}var jv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Dd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Dd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Dd;return k()(this,e),(t=id(this,e)).isCubicBezierCurve=!0,t.type="CubicBezierCurve",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Av(t,n.x,o.x,s.x,a.x),Av(t,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(xv),Iv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new $d,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new $d;return k()(this,e),(t=id(this,e)).isCubicBezierCurve3=!0,t.type="CubicBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Av(t,n.x,o.x,s.x,a.x),Av(t,n.y,o.y,s.y,a.y),Av(t,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(xv),Fv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Dd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd;return k()(this,e),(t=id(this,e)).isLineCurve=!0,t.type="LineCurve",t.v1=i,t.v2=n,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(xv),Rv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d;return k()(this,e),(t=id(this,e)).isLineCurve3=!0,t.type="LineCurve3",t.v1=i,t.v2=n,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(xv),zv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Dd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Dd;return k()(this,e),(t=id(this,e)).isQuadraticBezierCurve=!0,t.type="QuadraticBezierCurve",t.v0=i,t.v1=n,t.v2=o,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(Lv(t,n.x,o.x,s.x),Lv(t,n.y,o.y,s.y)),i}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(xv),Hv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new $d,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new $d;return k()(this,e),(t=id(this,e)).isQuadraticBezierCurve3=!0,t.type="QuadraticBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new $d,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(Lv(t,n.x,o.x,s.x),Lv(t,n.y,o.y,s.y),Lv(t,n.z,o.z,s.z)),i}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(xv),Vv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return k()(this,e),(t=id(this,e)).isSplineCurve=!0,t.type="SplineCurve",t.points=i,t}return qi()(e,t),x()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Dd,i=e,n=this.points,o=(n.length-1)*t,s=Math.floor(o),a=o-s,r=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(Bv(a,r.x,l.x,c.x,u.x),Bv(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(t){ed(e,"copy",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push(o.clone())}return this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);t.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];t.points.push(o.toArray())}return t}},{key:"fromJSON",value:function(t){ed(e,"fromJSON",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push((new Dd).fromArray(o))}return this}}])}(xv),Gv=Object.freeze({__proto__:null,ArcCurve:Sv,CatmullRomCurve3:Nv,CubicBezierCurve:jv,CubicBezierCurve3:Iv,EllipseCurve:Ev,LineCurve:Fv,LineCurve3:Rv,QuadraticBezierCurve:zv,QuadraticBezierCurve3:Hv,SplineCurve:Vv}),Uv=function(t){function e(t){var i;return k()(this,e),(i=id(this,e)).type="Path",i.currentPoint=new Dd,t&&i.setFromPoints(t),i}return qi()(e,t),x()(e,[{key:"setFromPoints",value:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}},{key:"moveTo",value:function(t,e){return this.currentPoint.set(t,e),this}},{key:"lineTo",value:function(t,e){var i=new Fv(this.currentPoint.clone(),new Dd(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){var o=new zv(this.currentPoint.clone(),new Dd(t,e),new Dd(i,n));return this.curves.push(o),this.currentPoint.set(i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,o,s){var a=new jv(this.currentPoint.clone(),new Dd(t,e),new Dd(i,n),new Dd(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}},{key:"splineThru",value:function(t){var e=[this.currentPoint.clone()].concat(t),i=new Vv(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}},{key:"arc",value:function(t,e,i,n,o,s){var a=this.currentPoint.x,r=this.currentPoint.y;return this.absarc(t+a,e+r,i,n,o,s),this}},{key:"absarc",value:function(t,e,i,n,o,s){return this.absellipse(t,e,i,i,n,o,s),this}},{key:"ellipse",value:function(t,e,i,n,o,s,a,r){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,n,o,s,a,r),this}},{key:"absellipse",value:function(t,e,i,n,o,s,a,r){var l=new Ev(t,e,i,n,o,s,a,r);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this}},{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.currentPoint.copy(t.currentPoint),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.currentPoint=this.currentPoint.toArray(),t}},{key:"fromJSON",value:function(t){return ed(e,"fromJSON",this,3)([t]),this.currentPoint.fromArray(t.currentPoint),this}}])}(function(t){function e(){var t;return k()(this,e),(t=id(this,e)).type="CurvePath",t.curves=[],t.autoClose=!1,t}return qi()(e,t),x()(e,[{key:"add",value:function(t){this.curves.push(t)}},{key:"closePath",value:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){var i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Gv[i](e,t))}return this}},{key:"getPoint",value:function(t,e){for(var i=t*this.getLength(),n=this.getCurveLengths(),o=0;o<n.length;){if(n[o]>=i){var s=n[o]-i,a=this.curves[o],r=a.getLength(),l=0===r?0:1-s/r;return a.getPointAt(l,e)}o++}return null}},{key:"getLength",value:function(){var t=this.getCurveLengths();return t[t.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}},{key:"getPoints",value:function(){for(var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n<o.length;n++)for(var s=o[n],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,r=s.getPoints(a),l=0;l<r.length;l++){var c=r[l];t&&t.equals(c)||(i.push(c),t=c)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(t){ed(e,"copy",this,3)([t]),this.curves=[];for(var i=0,n=t.curves.length;i<n;i++){var o=t.curves[i];this.curves.push(o.clone())}return this.autoClose=t.autoClose,this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);t.autoClose=this.autoClose,t.curves=[];for(var i=0,n=this.curves.length;i<n;i++){var o=this.curves[i];t.curves.push(o.toJSON())}return t}},{key:"fromJSON",value:function(t){ed(e,"fromJSON",this,3)([t]),this.autoClose=t.autoClose,this.curves=[];for(var i=0,n=t.curves.length;i<n;i++){var o=t.curves[i];this.curves.push((new Gv[o.type]).fromJSON(o))}return this}}])}(xv)),Wv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new Dd(0,-.5),new Dd(.5,0),new Dd(0,.5)],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,e),(t=id(this,e)).type="LatheGeometry",t.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=kd(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],p=1/n,h=new $d,d=new Dd,m=new $d,f=new $d,v=new $d,g=0,y=0,b=0;b<=i.length-1;b++)switch(b){case 0:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,v.copy(m),m.normalize(),c.push(m.x,m.y,m.z);break;case i.length-1:c.push(v.x,v.y,v.z);break;default:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,f.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),c.push(m.x,m.y,m.z),v.copy(f)}for(var C=0;C<=n;C++)for(var w=o+C*p*s,_=Math.sin(w),x=Math.cos(w),E=0;E<=i.length-1;E++){h.x=i[E].x*_,h.y=i[E].y,h.z=i[E].x*x,r.push(h.x,h.y,h.z),d.x=C/n,d.y=E/(i.length-1),l.push(d.x,d.y);var S=c[3*E+0]*_,D=c[3*E+1],P=c[3*E+0]*x;u.push(S,D,P)}for(var M=0;M<n;M++)for(var O=0;O<i.length-1;O++){var T=O+M*i.length,N=T,B=T+i.length,L=T+i.length+1,A=T+1;a.push(N,B,A),a.push(L,A,B)}return t.setIndex(a),t.setAttribute("position",new Pf(r,3)),t.setAttribute("uv",new Pf(l,2)),t.setAttribute("normal",new Pf(u,3)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.points,t.segments,t.phiStart,t.phiLength)}}])}(jf),Yv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;k()(this,e);var a=new Uv;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(t=id(this,e,[a.getPoints(o),s])).type="CapsuleGeometry",t.parameters={radius:i,length:n,capSegments:o,radialSegments:s},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.length,t.capSegments,t.radialSegments)}}])}(Wv),Jv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,e),(t=id(this,e)).type="CircleGeometry",t.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new $d,p=new Dd;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var h=0,d=3;h<=n;h++,d+=3){var m=o+h/n*s;u.x=i*Math.cos(m),u.y=i*Math.sin(m),r.push(u.x,u.y,u.z),l.push(0,0,1),p.x=(r[d]/i+1)/2,p.y=(r[d+1]/i+1)/2,c.push(p.x,p.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return t.setIndex(a),t.setAttribute("position",new Pf(r,3)),t.setAttribute("normal",new Pf(l,3)),t.setAttribute("uv",new Pf(c,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.segments,t.thetaStart,t.thetaLength)}}])}(jf),qv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;k()(this,e),(t=id(this,e)).type="CylinderGeometry",t.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=t;s=Math.floor(s),a=Math.floor(a);var p=[],h=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(t){for(var e=f,o=new Dd,a=new $d,r=0,v=!0===t?i:n,b=!0===t?1:-1,C=1;C<=s;C++)h.push(0,g*b,0),d.push(0,b,0),m.push(.5,.5),f++;for(var w=f,k=0;k<=s;k++){var _=k/s*c+l,x=Math.cos(_),E=Math.sin(_);a.x=v*E,a.y=g*b,a.z=v*x,h.push(a.x,a.y,a.z),d.push(0,b,0),o.x=.5*x+.5,o.y=.5*E*b+.5,m.push(o.x,o.y),f++}for(var S=0;S<s;S++){var D=e+S,P=w+S;!0===t?p.push(P,P+1,D):p.push(P+1,P,D),r+=3}u.addGroup(y,r,!0===t?1:2),y+=r}return function(){for(var t=new $d,e=new $d,r=0,b=(n-i)/o,C=0;C<=a;C++){for(var w=[],k=C/a,_=k*(n-i)+i,x=0;x<=s;x++){var E=x/s,S=E*c+l,D=Math.sin(S),P=Math.cos(S);e.x=_*D,e.y=-k*o+g,e.z=_*P,h.push(e.x,e.y,e.z),t.set(D,b,P).normalize(),d.push(t.x,t.y,t.z),m.push(E,1-k),w.push(f++)}v.push(w)}for(var M=0;M<s;M++)for(var O=0;O<a;O++){var T=v[O][M],N=v[O+1][M],B=v[O+1][M+1],L=v[O][M+1];p.push(T,N,L),p.push(N,B,L),r+=6}u.addGroup(y,r,0),y+=r}(),!1===r&&(i>0&&b(!0),n>0&&b(!1)),t.setIndex(p),t.setAttribute("position",new Pf(h,3)),t.setAttribute("normal",new Pf(d,3)),t.setAttribute("uv",new Pf(m,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(jf),Xv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return k()(this,e),(t=id(this,e,[0,i,n,o,s,a,r,l])).type="ConeGeometry",t.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(qv),Zv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;k()(this,e),(t=id(this,e)).type="PolyhedronGeometry",t.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(t,e,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=t.clone().lerp(i,a/o),l=e.clone().lerp(i,a/o),u=o-a,p=0;p<=u;p++)s[a][p]=0===p&&a===o?r:r.clone().lerp(l,p/u)}for(var h=0;h<o;h++)for(var d=0;d<2*(o-h)-1;d++){var m=Math.floor(d/2);d%2==0?(c(s[h][m+1]),c(s[h+1][m]),c(s[h][m])):(c(s[h][m+1]),c(s[h+1][m+1]),c(s[h+1][m]))}}function c(t){a.push(t.x,t.y,t.z)}function u(t,e){var n=3*t;e.x=i[n+0],e.y=i[n+1],e.z=i[n+2]}function p(t,e,i,n){n<0&&1===t.x&&(r[e]=t.x-1),0===i.x&&0===i.z&&(r[e]=n/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}return function(t){for(var e=new $d,i=new $d,o=new $d,s=0;s<n.length;s+=3)u(n[s+0],e),u(n[s+1],i),u(n[s+2],o),l(e,i,o,t)}(s),function(t){for(var e=new $d,i=0;i<a.length;i+=3)e.x=a[i+0],e.y=a[i+1],e.z=a[i+2],e.normalize().multiplyScalar(t),a[i+0]=e.x,a[i+1]=e.y,a[i+2]=e.z}(o),function(){for(var t,e=new $d,i=0;i<a.length;i+=3){e.x=a[i+0],e.y=a[i+1],e.z=a[i+2];var n=h(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);r.push(n,1-o)}(function(){for(var t=new $d,e=new $d,i=new $d,n=new $d,o=new Dd,s=new Dd,l=new Dd,c=0,u=0;c<a.length;c+=9,u+=6){t.set(a[c+0],a[c+1],a[c+2]),e.set(a[c+3],a[c+4],a[c+5]),i.set(a[c+6],a[c+7],a[c+8]),o.set(r[u+0],r[u+1]),s.set(r[u+2],r[u+3]),l.set(r[u+4],r[u+5]),n.copy(t).add(e).add(i).divideScalar(3);var d=h(n);p(o,u+0,t,d),p(s,u+2,e,d),p(l,u+4,i,d)}})(),function(){for(var t=0;t<r.length;t+=6){var e=r[t+0],i=r[t+2],n=r[t+4],o=Math.max(e,i,n),s=Math.min(e,i,n);o>.9&&s<.1&&(e<.2&&(r[t+0]+=1),i<.2&&(r[t+2]+=1),n<.2&&(r[t+4]+=1))}}()}(),t.setAttribute("position",new Pf(a,3)),t.setAttribute("normal",new Pf(a.slice(),3)),t.setAttribute("uv",new Pf(r,2)),0===s?t.computeVertexNormals():t.normalizeNormals(),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.vertices,t.indices,t.radius,t.details)}}])}(jf),Kv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e);var o=(1+Math.sqrt(5))/2,s=1/o;return(t=id(this,e,[[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],i,n])).type="DodecahedronGeometry",t.parameters={radius:i,detail:n},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Zv),$v=new $d,Qv=new $d,tg=new $d,eg=new df,ig=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(k()(this,e),(t=id(this,e)).type="EdgesGeometry",t.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(Cd*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],p=["a","b","c"],h=new Array(3),d={},m=[],f=0;f<c;f+=3){r?(u[0]=r.getX(f),u[1]=r.getX(f+1),u[2]=r.getX(f+2)):(u[0]=f,u[1]=f+1,u[2]=f+2);var v=eg.a,g=eg.b,y=eg.c;if(v.fromBufferAttribute(l,u[0]),g.fromBufferAttribute(l,u[1]),y.fromBufferAttribute(l,u[2]),eg.getNormal(tg),h[0]="".concat(Math.round(v.x*s),",").concat(Math.round(v.y*s),",").concat(Math.round(v.z*s)),h[1]="".concat(Math.round(g.x*s),",").concat(Math.round(g.y*s),",").concat(Math.round(g.z*s)),h[2]="".concat(Math.round(y.x*s),",").concat(Math.round(y.y*s),",").concat(Math.round(y.z*s)),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(var b=0;b<3;b++){var C=(b+1)%3,w=h[b],_=h[C],x=eg[p[b]],E=eg[p[C]],S="".concat(w,"_").concat(_),D="".concat(_,"_").concat(w);D in d&&d[D]?(tg.dot(d[D].normal)<=a&&(m.push(x.x,x.y,x.z),m.push(E.x,E.y,E.z)),d[D]=null):S in d||(d[S]={index0:u[b],index1:u[C],normal:tg.clone()})}}for(var P in d)if(d[P]){var M=d[P],O=M.index0,T=M.index1;$v.fromBufferAttribute(l,O),Qv.fromBufferAttribute(l,T),m.push($v.x,$v.y,$v.z),m.push(Qv.x,Qv.y,Qv.z)}t.setAttribute("position",new Pf(m,3))}return t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}])}(jf),ng=function(t){function e(t){var i;return k()(this,e),(i=id(this,e,[t])).uuid=wd(),i.type="Shape",i.holes=[],i}return qi()(e,t),x()(e,[{key:"getPointsHoles",value:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}},{key:"extractPoints",value:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}},{key:"copy",value:function(t){ed(e,"copy",this,3)([t]),this.holes=[];for(var i=0,n=t.holes.length;i<n;i++){var o=t.holes[i];this.holes.push(o.clone())}return this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);t.uuid=this.uuid,t.holes=[];for(var i=0,n=this.holes.length;i<n;i++){var o=this.holes[i];t.holes.push(o.toJSON())}return t}},{key:"fromJSON",value:function(t){ed(e,"fromJSON",this,3)([t]),this.uuid=t.uuid,this.holes=[];for(var i=0,n=t.holes.length;i<n;i++){var o=t.holes[i];this.holes.push((new Uv).fromJSON(o))}return this}}])}(Uv);function og(t,e,i,n,o){var s,a;if(o===function(t,e,i,n){for(var o=0,s=e,a=i-n;s<i;s+=n)o+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return o}(t,e,i,n)>0)for(s=e;s<i;s+=n)a=Eg(s,t[s],t[s+1],a);else for(s=i-n;s>=e;s-=n)a=Eg(s,t[s],t[s+1],a);return a&&bg(a,a.next)&&(Sg(a),a=a.next),a}function sg(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!bg(n,n.next)&&0!==yg(n.prev,n,n.next))n=n.next;else{if(Sg(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function ag(t,e,i,n,o,s,a){if(t){!a&&s&&function(t,e,i,n){var o=t;do{0===o.z&&(o.z=mg(o.x,o.y,e,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,i,n,o,s,a,r,l,c=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,r=0,e=0;e<c&&(r++,n=n.nextZ);e++);for(l=c;r>0||l>0&&n;)0!==r&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,r--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:t=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(t,n,o,s);for(var r,l,c=t;t.prev!==t.next;)if(r=t.prev,l=t.next,s?lg(t,n,o,s):rg(t))e.push(r.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),Sg(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?ag(t=cg(sg(t),e,i),e,i,n,o,s,2):2===a&&ug(t,e,i,n,o,s):ag(sg(t),e,i,n,o,s,1);break}}}function rg(t){var e=t.prev,i=t,n=t.next;if(yg(e,i,n)>=0)return!1;for(var o=e.x,s=i.x,a=n.x,r=e.y,l=i.y,c=n.y,u=o<s?o<a?o:a:s<a?s:a,p=r<l?r<c?r:c:l<c?l:c,h=o>s?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==e;){if(m.x>=u&&m.x<=h&&m.y>=p&&m.y<=d&&vg(o,r,s,l,a,c,m.x,m.y)&&yg(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function lg(t,e,i,n){var o=t.prev,s=t,a=t.next;if(yg(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,p=s.y,h=a.y,d=r<l?r<c?r:c:l<c?l:c,m=u<p?u<h?u:h:p<h?p:h,f=r>l?r>c?r:c:l>c?l:c,v=u>p?u>h?u:h:p>h?p:h,g=mg(d,m,e,i,n),y=mg(f,v,e,i,n),b=t.prevZ,C=t.nextZ;b&&b.z>=g&&C&&C.z<=y;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&vg(r,u,l,p,c,h,b.x,b.y)&&yg(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&vg(r,u,l,p,c,h,C.x,C.y)&&yg(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&vg(r,u,l,p,c,h,b.x,b.y)&&yg(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&vg(r,u,l,p,c,h,C.x,C.y)&&yg(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function cg(t,e,i){var n=t;do{var o=n.prev,s=n.next.next;!bg(o,s)&&Cg(o,n,n.next,s)&&_g(o,s)&&_g(s,o)&&(e.push(o.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),Sg(n),Sg(n.next),n=t=s),n=n.next}while(n!==t);return sg(n)}function ug(t,e,i,n,o,s){var a=t;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&gg(a,r)){var l=xg(a,r);return a=sg(a,a.next),l=sg(l,l.next),ag(a,e,i,n,o,s,0),void ag(l,e,i,n,o,s,0)}r=r.next}a=a.next}while(a!==t)}function pg(t,e){return t.x-e.x}function hg(t,e){var i=function(t,e){var i,n=e,o=-1/0,s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var r=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(r<=s&&r>o&&(o=r,i=n.x<n.next.x?n:n.next,r===s))return i}n=n.next}while(n!==e);if(!i)return null;var l,c=i,u=i.x,p=i.y,h=1/0;n=i;do{s>=n.x&&n.x>=u&&s!==n.x&&vg(a<p?s:o,a,u,p,a<p?o:s,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(s-n.x),_g(n,t)&&(l<h||l===h&&(n.x>i.x||n.x===i.x&&dg(i,n)))&&(i=n,h=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=xg(i,t);return sg(n,n.next),sg(i,i.next)}function dg(t,e){return yg(t.prev,t,e.prev)<0&&yg(e.next,t,t.next)<0}function mg(t,e,i,n,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function fg(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function vg(t,e,i,n,o,s,a,r){return(o-a)*(e-r)>=(t-a)*(s-r)&&(t-a)*(n-r)>=(i-a)*(e-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function gg(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Cg(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(_g(t,e)&&_g(e,t)&&function(t,e){var i=t,n=!1,o=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(yg(t.prev,t,e.prev)||yg(t,e.prev,e))||bg(t,e)&&yg(t.prev,t,t.next)>0&&yg(e.prev,e,e.next)>0)}function yg(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function bg(t,e){return t.x===e.x&&t.y===e.y}function Cg(t,e,i,n){var o=kg(yg(t,e,i)),s=kg(yg(t,e,n)),a=kg(yg(i,n,t)),r=kg(yg(i,n,e));return o!==s&&a!==r||!(0!==o||!wg(t,i,e))||!(0!==s||!wg(t,n,e))||!(0!==a||!wg(i,t,n))||!(0!==r||!wg(i,e,n))}function wg(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function kg(t){return t>0?1:t<0?-1:0}function _g(t,e){return yg(t.prev,t,t.next)<0?yg(t,e,t.next)>=0&&yg(t,t.prev,e)>=0:yg(t,e,t.prev)<0||yg(t,t.next,e)<0}function xg(t,e){var i=new Dg(t.i,t.x,t.y),n=new Dg(e.i,e.x,e.y),o=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Eg(t,e,i,n){var o=new Dg(t,e,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function Sg(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Dg(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Pg=function(){function t(){k()(this,t)}return x()(t,null,[{key:"area",value:function(t){for(var e=t.length,i=0,n=e-1,o=0;o<e;n=o++)i+=t[n].x*t[o].y-t[o].x*t[n].y;return.5*i}},{key:"isClockWise",value:function(e){return t.area(e)<0}},{key:"triangulateShape",value:function(t,e){var i=[],n=[],o=[];Mg(t),Og(i,t);var s=t.length;e.forEach(Mg);for(var a=0;a<e.length;a++)n.push(s),s+=e[a].length,Og(i,e[a]);for(var r=function(t,e){var i,n,o,s,a,r,l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,u=e&&e.length,p=u?e[0]*c:t.length,h=og(t,0,p,c,!0),d=[];if(!h||h.next===h.prev)return d;if(u&&(h=function(t,e,i,n){var o,s,a,r=[];for(o=0,s=e.length;o<s;o++)(a=og(t,e[o]*n,o<s-1?e[o+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),r.push(fg(a));for(r.sort(pg),o=0;o<r.length;o++)i=hg(r[o],i);return i}(t,e,h,c)),t.length>80*c){i=o=t[0],n=s=t[1];for(var m=c;m<p;m+=c)(a=t[m])<i&&(i=a),(r=t[m+1])<n&&(n=r),a>o&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return ag(h,d,c,i,n,l,0),d}(i,n),l=0;l<r.length;l+=3)o.push(r.slice(l,l+3));return o}}])}();function Mg(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Og(t,e){for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}var Tg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ng([new Dd(.5,.5),new Dd(-.5,.5),new Dd(-.5,-.5),new Dd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(t=id(this,e)).type="ExtrudeGeometry",t.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=t,s=[],a=[],r=0,l=i.length;r<l;r++)c(i[r]);function c(t){var e,i,r,l,c,u=[],p=void 0!==n.curveSegments?n.curveSegments:12,h=void 0!==n.steps?n.steps:1,d=void 0!==n.depth?n.depth:1,m=void 0===n.bevelEnabled||n.bevelEnabled,f=void 0!==n.bevelThickness?n.bevelThickness:.2,v=void 0!==n.bevelSize?n.bevelSize:f-.1,g=void 0!==n.bevelOffset?n.bevelOffset:0,y=void 0!==n.bevelSegments?n.bevelSegments:3,b=n.extrudePath,C=void 0!==n.UVGenerator?n.UVGenerator:Ng,w=!1;b&&(e=b.getSpacedPoints(h),w=!0,m=!1,i=b.computeFrenetFrames(h,!1),r=new $d,l=new $d,c=new $d),m||(y=0,f=0,v=0,g=0);var k=t.extractPoints(p),_=k.shape,x=k.holes;if(!Pg.isClockWise(_)){_=_.reverse();for(var E=0,S=x.length;E<S;E++){var D=x[E];Pg.isClockWise(D)&&(x[E]=D.reverse())}}for(var P=Pg.triangulateShape(_,x),M=_,O=0,T=x.length;O<T;O++){var N=x[O];_=_.concat(N)}function B(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,i)}var L=_.length,A=P.length;function j(t,e,i){var n,o,s,a=t.x-e.x,r=t.y-e.y,l=i.x-t.x,c=i.y-t.y,u=a*a+r*r,p=a*c-r*l;if(Math.abs(p)>Number.EPSILON){var h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=e.x-r/h,f=e.y+a/h,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-t.x)*n+(o=f+r*v-t.y)*o;if(g<=2)return new Dd(n,o);s=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(r)===Math.sign(c)&&(y=!0),y?(n=-r,o=a,s=Math.sqrt(u)):(n=a,o=r,s=Math.sqrt(u/2))}return new Dd(n/s,o/s)}for(var I=[],F=0,R=M.length,z=R-1,H=F+1;F<R;F++,z++,H++)z===R&&(z=0),H===R&&(H=0),I[F]=j(M[F],M[z],M[H]);for(var V,G=[],U=I.concat(),W=0,Y=x.length;W<Y;W++){var J=x[W];V=[];for(var q=0,X=J.length,Z=X-1,K=q+1;q<X;q++,Z++,K++)Z===X&&(Z=0),K===X&&(K=0),V[q]=j(J[q],J[Z],J[K]);G.push(V),U=U.concat(V)}for(var $=0;$<y;$++){for(var Q=$/y,tt=f*Math.cos(Q*Math.PI/2),et=v*Math.sin(Q*Math.PI/2)+g,it=0,nt=M.length;it<nt;it++){var ot=B(M[it],I[it],et);Tt(ot.x,ot.y,-tt)}for(var st=0,at=x.length;st<at;st++){var rt=x[st];V=G[st];for(var lt=0,ct=rt.length;lt<ct;lt++){var ut=B(rt[lt],V[lt],et);Tt(ut.x,ut.y,-tt)}}}for(var pt=v+g,ht=0;ht<L;ht++){var dt=m?B(_[ht],U[ht],pt):_[ht];w?(l.copy(i.normals[0]).multiplyScalar(dt.x),r.copy(i.binormals[0]).multiplyScalar(dt.y),c.copy(e[0]).add(l).add(r),Tt(c.x,c.y,c.z)):Tt(dt.x,dt.y,0)}for(var mt=1;mt<=h;mt++)for(var ft=0;ft<L;ft++){var vt=m?B(_[ft],U[ft],pt):_[ft];w?(l.copy(i.normals[mt]).multiplyScalar(vt.x),r.copy(i.binormals[mt]).multiplyScalar(vt.y),c.copy(e[mt]).add(l).add(r),Tt(c.x,c.y,c.z)):Tt(vt.x,vt.y,d/h*mt)}for(var gt=y-1;gt>=0;gt--){for(var yt=gt/y,bt=f*Math.cos(yt*Math.PI/2),Ct=v*Math.sin(yt*Math.PI/2)+g,wt=0,kt=M.length;wt<kt;wt++){var _t=B(M[wt],I[wt],Ct);Tt(_t.x,_t.y,d+bt)}for(var xt=0,Et=x.length;xt<Et;xt++){var St=x[xt];V=G[xt];for(var Dt=0,Pt=St.length;Dt<Pt;Dt++){var Mt=B(St[Dt],V[Dt],Ct);w?Tt(Mt.x,Mt.y+e[h-1].y,e[h-1].x+bt):Tt(Mt.x,Mt.y,d+bt)}}}function Ot(t,e){for(var i=t.length;--i>=0;){var n=i,o=i-1;o<0&&(o=t.length-1);for(var s=0,a=h+2*y;s<a;s++){var r=L*s,l=L*(s+1);Bt(e+n+r,e+o+r,e+o+l,e+n+l)}}}function Tt(t,e,i){u.push(t),u.push(e),u.push(i)}function Nt(t,e,i){Lt(t),Lt(e),Lt(i);var n=s.length/3,a=C.generateTopUV(o,s,n-3,n-2,n-1);At(a[0]),At(a[1]),At(a[2])}function Bt(t,e,i,n){Lt(t),Lt(e),Lt(n),Lt(e),Lt(i),Lt(n);var a=s.length/3,r=C.generateSideWallUV(o,s,a-6,a-3,a-2,a-1);At(r[0]),At(r[1]),At(r[3]),At(r[1]),At(r[2]),At(r[3])}function Lt(t){s.push(u[3*t+0]),s.push(u[3*t+1]),s.push(u[3*t+2])}function At(t){a.push(t.x),a.push(t.y)}!function(){var t=s.length/3;if(m){for(var e=0,i=L*e,n=0;n<A;n++){var a=P[n];Nt(a[2]+i,a[1]+i,a[0]+i)}i=L*(e=h+2*y);for(var r=0;r<A;r++){var l=P[r];Nt(l[0]+i,l[1]+i,l[2]+i)}}else{for(var c=0;c<A;c++){var u=P[c];Nt(u[2],u[1],u[0])}for(var p=0;p<A;p++){var d=P[p];Nt(d[0]+L*h,d[1]+L*h,d[2]+L*h)}}o.addGroup(t,s.length/3-t,0)}(),function(){var t=s.length/3,e=0;Ot(M,e),e+=M.length;for(var i=0,n=x.length;i<n;i++){var a=x[i];Ot(a,e),e+=a.length}o.addGroup(t,s.length/3-t,1)}()}return t.setAttribute("position",new Pf(s,3)),t.setAttribute("uv",new Pf(a,2)),t.computeVertexNormals(),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(var n=0,o=t.length;n<o;n++){var s=t[n];i.shapes.push(s.uuid)}else i.shapes.push(t.uuid);return i.options=Object.assign({},e),void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,t)}}],[{key:"fromJSON",value:function(t,i){for(var n=[],o=0,s=t.shapes.length;o<s;o++){var a=i[t.shapes[o]];n.push(a)}var r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new Gv[r.type]).fromJSON(r)),new e(n,t.options)}}])}(jf),Ng={generateTopUV:function(t,e,i,n,o){var s=e[3*i],a=e[3*i+1],r=e[3*n],l=e[3*n+1],c=e[3*o],u=e[3*o+1];return[new Dd(s,a),new Dd(r,l),new Dd(c,u)]},generateSideWallUV:function(t,e,i,n,o,s){var a=e[3*i],r=e[3*i+1],l=e[3*i+2],c=e[3*n],u=e[3*n+1],p=e[3*n+2],h=e[3*o],d=e[3*o+1],m=e[3*o+2],f=e[3*s],v=e[3*s+1],g=e[3*s+2];return Math.abs(r-u)<Math.abs(a-c)?[new Dd(a,1-l),new Dd(c,1-p),new Dd(h,1-m),new Dd(f,1-g)]:[new Dd(r,1-l),new Dd(u,1-p),new Dd(d,1-m),new Dd(v,1-g)]}},Bg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e);var o=(1+Math.sqrt(5))/2;return(t=id(this,e,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],i,n])).type="IcosahedronGeometry",t.parameters={radius:i,detail:n},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Zv),Lg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,e),(t=id(this,e,[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],i,n])).type="OctahedronGeometry",t.parameters={radius:i,detail:n},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Zv),Ag=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;k()(this,e),(t=id(this,e)).type="RingGeometry",t.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],p=[],h=i,d=(n-i)/(s=Math.max(1,s)),m=new $d,f=new Dd,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=h*Math.cos(y),m.y=h*Math.sin(y),c.push(m.x,m.y,m.z),u.push(0,0,1),f.x=(m.x/n+1)/2,f.y=(m.y/n+1)/2,p.push(f.x,f.y)}h+=d}for(var b=0;b<s;b++)for(var C=b*(o+1),w=0;w<o;w++){var _=w+C,x=_,E=_+o+1,S=_+o+2,D=_+1;l.push(x,E,D),l.push(E,S,D)}return t.setIndex(l),t.setAttribute("position",new Pf(c,3)),t.setAttribute("normal",new Pf(u,3)),t.setAttribute("uv",new Pf(p,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}])}(jf),jg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ng([new Dd(0,.5),new Dd(-.5,-.5),new Dd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;k()(this,e),(t=id(this,e)).type="ShapeGeometry",t.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))p(i);else for(var u=0;u<i.length;u++)p(i[u]),t.addGroup(l,c,u),l+=c,c=0;function p(t){var e=s.length/3,i=t.extractPoints(n),l=i.shape,u=i.holes;!1===Pg.isClockWise(l)&&(l=l.reverse());for(var p=0,h=u.length;p<h;p++){var d=u[p];!0===Pg.isClockWise(d)&&(u[p]=d.reverse())}for(var m=Pg.triangulateShape(l,u),f=0,v=u.length;f<v;f++){var g=u[f];l=l.concat(g)}for(var y=0,b=l.length;y<b;y++){var C=l[y];s.push(C.x,C.y,0),a.push(0,0,1),r.push(C.x,C.y)}for(var w=0,k=m.length;w<k;w++){var _=m[w],x=_[0]+e,E=_[1]+e,S=_[2]+e;o.push(x,E,S),c+=3}}return t.setIndex(o),t.setAttribute("position",new Pf(s,3)),t.setAttribute("normal",new Pf(a,3)),t.setAttribute("uv",new Pf(r,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return function(t,e){if(e.shapes=[],Array.isArray(t))for(var i=0,n=t.length;i<n;i++){var o=t[i];e.shapes.push(o.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}}],[{key:"fromJSON",value:function(t,i){for(var n=[],o=0,s=t.shapes.length;o<s;o++){var a=i[t.shapes[o]];n.push(a)}return new e(n,t.curveSegments)}}])}(jf),Ig=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;k()(this,e),(t=id(this,e)).type="SphereGeometry",t.parameters={radius:i,widthSegments:n,heightSegments:o,phiStart:s,phiLength:a,thetaStart:r,thetaLength:l},n=Math.max(3,Math.floor(n)),o=Math.max(2,Math.floor(o));for(var c=Math.min(r+l,Math.PI),u=0,p=[],h=new $d,d=new $d,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],C=y/o,w=0;0===y&&0===r?w=.5/n:y===o&&c===Math.PI&&(w=-.5/n);for(var _=0;_<=n;_++){var x=_/n;h.x=-i*Math.cos(s+x*a)*Math.sin(r+C*l),h.y=i*Math.cos(r+C*l),h.z=i*Math.sin(s+x*a)*Math.sin(r+C*l),f.push(h.x,h.y,h.z),d.copy(h).normalize(),v.push(d.x,d.y,d.z),g.push(x+w,1-C),b.push(u++)}p.push(b)}for(var E=0;E<o;E++)for(var S=0;S<n;S++){var D=p[E][S+1],P=p[E][S],M=p[E+1][S],O=p[E+1][S+1];(0!==E||r>0)&&m.push(D,P,O),(E!==o-1||c<Math.PI)&&m.push(P,M,O)}return t.setIndex(m),t.setAttribute("position",new Pf(f,3)),t.setAttribute("normal",new Pf(v,3)),t.setAttribute("uv",new Pf(g,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}])}(jf),Fg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,e),(t=id(this,e,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],i,n])).type="TetrahedronGeometry",t.parameters={radius:i,detail:n},t}return qi()(e,t),x()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Zv),Rg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;k()(this,e),(t=id(this,e)).type="TorusGeometry",t.parameters={radius:i,tube:n,radialSegments:o,tubularSegments:s,arc:a},o=Math.floor(o),s=Math.floor(s);for(var r=[],l=[],c=[],u=[],p=new $d,h=new $d,d=new $d,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;h.x=(i+n*Math.cos(g))*Math.cos(v),h.y=(i+n*Math.cos(g))*Math.sin(v),h.z=n*Math.sin(g),l.push(h.x,h.y,h.z),p.x=i*Math.cos(v),p.y=i*Math.sin(v),d.subVectors(h,p).normalize(),c.push(d.x,d.y,d.z),u.push(f/s),u.push(m/o)}for(var y=1;y<=o;y++)for(var b=1;b<=s;b++){var C=(s+1)*y+b-1,w=(s+1)*(y-1)+b-1,_=(s+1)*(y-1)+b,x=(s+1)*y+b;r.push(C,w,x),r.push(w,_,x)}return t.setIndex(r),t.setAttribute("position",new Pf(l,3)),t.setAttribute("normal",new Pf(c,3)),t.setAttribute("uv",new Pf(u,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}])}(jf),zg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;k()(this,e),(t=id(this,e)).type="TorusKnotGeometry",t.parameters={radius:i,tube:n,tubularSegments:o,radialSegments:s,p:a,q:r},o=Math.floor(o),s=Math.floor(s);for(var l=[],c=[],u=[],p=[],h=new $d,d=new $d,m=new $d,f=new $d,v=new $d,g=new $d,y=new $d,b=0;b<=o;++b){var C=b/o*a*Math.PI*2;N(C,a,r,i,m),N(C+.01,a,r,i,f),g.subVectors(f,m),y.addVectors(f,m),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var w=0;w<=s;++w){var _=w/s*Math.PI*2,x=-n*Math.cos(_),E=n*Math.sin(_);h.x=m.x+(x*y.x+E*v.x),h.y=m.y+(x*y.y+E*v.y),h.z=m.z+(x*y.z+E*v.z),c.push(h.x,h.y,h.z),d.subVectors(h,m).normalize(),u.push(d.x,d.y,d.z),p.push(b/o),p.push(w/s)}}for(var S=1;S<=o;S++)for(var D=1;D<=s;D++){var P=(s+1)*(S-1)+(D-1),M=(s+1)*S+(D-1),O=(s+1)*S+D,T=(s+1)*(S-1)+D;l.push(P,M,T),l.push(M,O,T)}function N(t,e,i,n,o){var s=Math.cos(t),a=Math.sin(t),r=i/e*t,l=Math.cos(r);o.x=n*(2+l)*.5*s,o.y=n*(2+l)*a*.5,o.z=n*Math.sin(r)*.5}return t.setIndex(l),t.setAttribute("position",new Pf(c,3)),t.setAttribute("normal",new Pf(u,3)),t.setAttribute("uv",new Pf(p,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}])}(jf),Hg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Hv(new $d(-1,-1,0),new $d(-1,1,0),new $d(1,1,0)),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k()(this,e),(t=id(this,e)).type="TubeGeometry",t.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);t.tangents=r.tangents,t.normals=r.normals,t.binormals=r.binormals;var l=new $d,c=new $d,u=new Dd,p=new $d,h=[],d=[],m=[],f=[];function v(t){p=i.getPointAt(t/n,p);for(var e=r.normals[t],a=r.binormals[t],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*e.x+f*a.x,c.y=v*e.y+f*a.y,c.z=v*e.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=p.x+o*c.x,l.y=p.y+o*c.y,l.z=p.z+o*c.z,h.push(l.x,l.y,l.z)}}return function(){for(var t=0;t<n;t++)v(t);v(!1===a?n:0),function(){for(var t=0;t<=n;t++)for(var e=0;e<=s;e++)u.x=t/n,u.y=e/s,m.push(u.x,u.y)}(),function(){for(var t=1;t<=n;t++)for(var e=1;e<=s;e++){var i=(s+1)*(t-1)+(e-1),o=(s+1)*t+(e-1),a=(s+1)*t+e,r=(s+1)*(t-1)+e;f.push(i,o,r),f.push(o,a,r)}}()}(),t.setIndex(f),t.setAttribute("position",new Pf(h,3)),t.setAttribute("normal",new Pf(d,3)),t.setAttribute("uv",new Pf(m,2)),t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=ed(e,"toJSON",this,3)([]);return t.path=this.parameters.path.toJSON(),t}}],[{key:"fromJSON",value:function(t){return new e((new Gv[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}])}(jf),Vg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(k()(this,e),(t=id(this,e)).type="WireframeGeometry",t.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new $d,a=new $d;if(null!==i.index){var r=i.attributes.position,l=i.index,c=i.groups;0===c.length&&(c=[{start:0,count:l.count,materialIndex:0}]);for(var u=0,p=c.length;u<p;++u)for(var h=c[u],d=h.start,m=d,f=d+h.count;m<f;m+=3)for(var v=0;v<3;v++){var g=l.getX(m+v),y=l.getX(m+(v+1)%3);s.fromBufferAttribute(r,g),a.fromBufferAttribute(r,y),!0===Gg(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}}else for(var b=i.attributes.position,C=0,w=b.count/3;C<w;C++)for(var _=0;_<3;_++){var x=3*C+_,E=3*C+(_+1)%3;s.fromBufferAttribute(b,x),a.fromBufferAttribute(b,E),!0===Gg(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}t.setAttribute("position",new Pf(n,3))}return t}return qi()(e,t),x()(e,[{key:"copy",value:function(t){return ed(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}])}(jf);function Gg(t,e,i){var n="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z),o="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z);return!0!==i.has(n)&&!0!==i.has(o)&&(i.add(n),i.add(o),!0)}Object.freeze({__proto__:null,BoxGeometry:iv,CapsuleGeometry:Yv,CircleGeometry:Jv,ConeGeometry:Xv,CylinderGeometry:qv,DodecahedronGeometry:Kv,EdgesGeometry:ig,ExtrudeGeometry:Tg,IcosahedronGeometry:Bg,LatheGeometry:Wv,OctahedronGeometry:Lg,PlaneGeometry:mv,PolyhedronGeometry:Zv,RingGeometry:Ag,ShapeGeometry:jg,SphereGeometry:Ig,TetrahedronGeometry:Fg,TorusGeometry:Rg,TorusKnotGeometry:zg,TubeGeometry:Hg,WireframeGeometry:Vg});function Ug(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Wg(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Yg=function(){return x()((function t(e,i,n,o){k()(this,t),this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==o?o:new i.constructor(n),this.sampleValues=i,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}),[{key:"evaluate",value:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],o=e[i-1];t:{e:{var s;i:{n:if(!(t<n)){for(var a=i+2;;){if(void 0===n){if(t<o)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(o=n,t<(n=e[++i]))break e}s=e.length;break i}if(t>=o)break t;var r=e[1];t<r&&(i=2,o=r);for(var l=i-2;;){if(void 0===o)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=o,t>=(o=e[--i-1]))break e}s=i,i=0}for(;i<s;){var c=i+s>>>1;t<e[c]?s=c:i=c+1}if(n=e[i],void 0===(o=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,o,n)}return this.interpolate_(i,o,t,n)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,o=t*n,s=0;s!==n;++s)e[s]=i[o+s];return e}},{key:"interpolate_",value:function(){throw new Error("call to abstract method")}},{key:"intervalChanged_",value:function(){}}])}(),Jg=function(t){function e(t,i,n,o){var s;return k()(this,e),(s=id(this,e,[t,i,n,o]))._weightPrev=-0,s._offsetPrev=-0,s._weightNext=-0,s._offsetNext=-0,s.DefaultSettings_={endingStart:sd,endingEnd:sd},s}return qi()(e,t),x()(e,[{key:"intervalChanged_",value:function(t,e,i){var n=this.parameterPositions,o=t-2,s=t+1,a=n[o],r=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case ad:o=t,a=2*e-i;break;case 2402:a=e+n[o=n.length-2]-n[o+1];break;default:o=t,a=i}if(void 0===r)switch(this.getSettings_().endingEnd){case ad:s=t,r=2*i-e;break;case 2402:s=1,r=i+n[1]-n[0];break;default:s=t-1,r=e}var l=.5*(i-e),c=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(r-i),this._offsetPrev=o*c,this._offsetNext=s*c}},{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=t*a,l=r-a,c=this._offsetPrev,u=this._offsetNext,p=this._weightPrev,h=this._weightNext,d=(i-e)/(n-e),m=d*d,f=m*d,v=-p*f+2*p*m-p*d,g=(1+p)*f+(-1.5-2*p)*m+(-.5+p)*d+1,y=(-1-h)*f+(1.5+h)*m+.5*d,b=h*f-h*m,C=0;C!==a;++C)o[C]=v*s[c+C]+g*s[l+C]+y*s[r+C]+b*s[u+C];return o}}])}(Yg),qg=function(t){function e(t,i,n,o){return k()(this,e),id(this,e,[t,i,n,o])}return qi()(e,t),x()(e,[{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=t*a,l=r-a,c=(i-e)/(n-e),u=1-c,p=0;p!==a;++p)o[p]=s[l+p]*u+s[r+p]*c;return o}}])}(Yg),Xg=function(t){function e(t,i,n,o){return k()(this,e),id(this,e,[t,i,n,o])}return qi()(e,t),x()(e,[{key:"interpolate_",value:function(t){return this.copySampleValue_(t-1)}}])}(Yg),Zg=function(){return x()((function t(e,i,n,o){if(k()(this,t),void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===i||0===i.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ug(i,this.TimeBufferType),this.values=Ug(n,this.ValueBufferType),this.setInterpolation(o||this.DefaultInterpolation)}),[{key:"InterpolantFactoryMethodDiscrete",value:function(t){return new Xg(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodLinear",value:function(t){return new qg(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodSmooth",value:function(t){return new Jg(this.times,this.values,this.getValueSize(),t)}},{key:"setInterpolation",value:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this}},{key:"scale",value:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this}},{key:"trim",value:function(t,e){for(var i=this.times,n=i.length,o=0,s=n-1;o!==n&&i[o]<t;)++o;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==o||s!==n){o>=s&&(o=(s=Math.max(s,1))-1);var a=this.getValueSize();this.times=i.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}},{key:"validate",value:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var s=null,a=0;a!==o;a++){var r=i[a];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,r),t=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),t=!1;break}s=r}if(void 0!==n&&Wg(n))for(var l=0,c=n.length;l!==c;++l){var u=n[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),t=!1;break}}return t}},{key:"optimize",value:function(){for(var t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=t.length-1,s=1,a=1;a<o;++a){var r=!1,l=t[a];if(l!==t[a+1]&&(1!==a||l!==t[0]))if(n)r=!0;else for(var c=a*i,u=c-i,p=c+i,h=0;h!==i;++h){var d=e[c+h];if(d!==e[u+h]||d!==e[p+h]){r=!0;break}}if(r){if(a!==s){t[s]=t[a];for(var m=a*i,f=s*i,v=0;v!==i;++v)e[f+v]=e[m+v]}++s}}if(o>0){t[s]=t[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)e[y+b]=e[g+b];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*i)):(this.times=t,this.values=e),this}},{key:"clone",value:function(){var t=this.times.slice(),e=this.values.slice(),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(t){var e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:Ug(t.times,Array),values:Ug(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}])}();Zg.prototype.TimeBufferType=Float32Array,Zg.prototype.ValueBufferType=Float32Array,Zg.prototype.DefaultInterpolation=2301;var Kg=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e)}(Zg);Kg.prototype.ValueTypeName="bool",Kg.prototype.ValueBufferType=Array,Kg.prototype.DefaultInterpolation=2300,Kg.prototype.InterpolantFactoryMethodLinear=void 0,Kg.prototype.InterpolantFactoryMethodSmooth=void 0;var $g=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e)}(Zg);$g.prototype.ValueTypeName="color";var Qg=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e)}(Zg);Qg.prototype.ValueTypeName="number";var ty=function(t){function e(t,i,n,o){return k()(this,e),id(this,e,[t,i,n,o])}return qi()(e,t),x()(e,[{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-e)/(n-e),l=t*a,c=l+a;l!==c;l+=4)Kd.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(Yg),ey=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e,[{key:"InterpolantFactoryMethodLinear",value:function(t){return new ty(this.times,this.values,this.getValueSize(),t)}}])}(Zg);ey.prototype.ValueTypeName="quaternion",ey.prototype.DefaultInterpolation=2301,ey.prototype.InterpolantFactoryMethodSmooth=void 0;var iy=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e)}(Zg);iy.prototype.ValueTypeName="string",iy.prototype.ValueBufferType=Array,iy.prototype.DefaultInterpolation=2300,iy.prototype.InterpolantFactoryMethodLinear=void 0,iy.prototype.InterpolantFactoryMethodSmooth=void 0;var ny=function(t){function e(){return k()(this,e),id(this,e,arguments)}return qi()(e,t),x()(e)}(Zg);ny.prototype.ValueTypeName="vector";var oy=x()((function t(e,i,n){k()(this,t);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=i,this.onError=n,this.itemStart=function(t){l++,!1===a&&void 0!==s.onStart&&s.onStart(t,r,l),a=!0},this.itemEnd=function(t){r++,void 0!==s.onProgress&&s.onProgress(t,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return o?o(t):t},this.setURLModifier=function(t){return o=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,i=c.length;e<i;e+=2){var n=c[e],o=c[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return o}return null}})),sy=new oy,ay=function(){return x()((function t(e){k()(this,t),this.manager=void 0!==e?e:sy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(t,e){var i=this;return new Promise((function(n,o){i.load(t,n,e,o)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(t){return this.crossOrigin=t,this}},{key:"setWithCredentials",value:function(t){return this.withCredentials=t,this}},{key:"setPath",value:function(t){return this.path=t,this}},{key:"setResourcePath",value:function(t){return this.resourcePath=t,this}},{key:"setRequestHeader",value:function(t){return this.requestHeader=t,this}}])}();ay.DEFAULT_MATERIAL_NAME="__DEFAULT";Error,new Pm,new $d,new $d,new Pm,new $d,new $d,new Pm,new Pm,new Pm;new $d,new Kd,new $d,new $d,new $d,new Kd,new $d,new $d;var ry="\\[\\]\\.:\\/",ly=new RegExp("["+ry+"]","g"),cy="[^"+ry+"]",uy="[^"+ry.replace("\\.","")+"]",py=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",cy)+/(WCOD+)?/.source.replace("WCOD",uy)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cy)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cy)+"$"),hy=["material","materials","bones","map"],dy=function(){function t(e,i,n){k()(this,t),this.path=i,this.parsedPath=n||t.parseTrackName(i),this.node=t.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return x()(t,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(t,e){t[e]=this.targetObject[this.propertyName]}},{key:"_getValue_array",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)t[e++]=i[n]}},{key:"_getValue_arrayElement",value:function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(t,e){this.resolvedProperty.toArray(t,e)}},{key:"_setValue_direct",value:function(t,e){this.targetObject[this.propertyName]=t[e]}},{key:"_setValue_direct_setNeedsUpdate",value:function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++]}},{key:"_setValue_array_setNeedsUpdate",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(t,e){this.resolvedProperty.fromArray(t,e)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(t,e){this.bind(),this.getValue(t,e)}},{key:"_setValue_unbound",value:function(t,e){this.bind(),this.setValue(t,e)}},{key:"bind",value:function(){var e=this.node,i=this.parsedPath,n=i.objectName,o=i.propertyName,s=i.propertyIndex;if(e||(e=t.findNode(this.rootNode,i.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=i.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var r=0;r<e.length;r++)if(e[r].name===a){a=r;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var l=e[o];if(void 0!==l){var c=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===o){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[s]&&(s=e.morphTargetDictionary[s])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=s}else void 0!==l.fromArray&&void 0!==l.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=o;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var p=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+p+"."+o+" but it wasn't found.",e)}}else console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".")}},{key:"unbind",value:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}],[{key:"create",value:function(e,i,n){return e&&e.isAnimationObjectGroup?new t.Composite(e,i,n):new t(e,i,n)}},{key:"sanitizeNodeName",value:function(t){return t.replace(/\s/g,"_").replace(ly,"")}},{key:"parseTrackName",value:function(t){var e=py.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var o=i.nodeName.substring(n+1);-1!==hy.indexOf(o)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=o)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}},{key:"findNode",value:function(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var o=t[i];if(o.name===e||o.uuid===e)return o;var s=n(o.children);if(s)return s}return null},o=n(t.children);if(o)return o}return null}}])}();dy.Composite=function(){return x()((function t(e,i,n){k()(this,t);var o=n||dy.parseTrackName(i);this._targetGroup=e,this._bindings=e.subscribe_(i,o)}),[{key:"getValue",value:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}},{key:"setValue",value:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,o=i.length;n!==o;++n)i[n].setValue(t,e)}},{key:"bind",value:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}},{key:"unbind",value:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}])}(),dy.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},dy.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},dy.prototype.GetterByBindingType=[dy.prototype._getValue_direct,dy.prototype._getValue_array,dy.prototype._getValue_arrayElement,dy.prototype._getValue_toArray],dy.prototype.SetterByBindingTypeAndVersioning=[[dy.prototype._setValue_direct,dy.prototype._setValue_direct_setNeedsUpdate,dy.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[dy.prototype._setValue_array,dy.prototype._setValue_array_setNeedsUpdate,dy.prototype._setValue_array_setMatrixWorldNeedsUpdate],[dy.prototype._setValue_arrayElement,dy.prototype._setValue_arrayElement_setNeedsUpdate,dy.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[dy.prototype._setValue_fromArray,dy.prototype._setValue_fromArray_setNeedsUpdate,dy.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1),new Pm;new Dd,new $d,new $d,new $d,new $d,new Pm,new Pm;new $d,new yf,new yf,new $d,new $d,new $d,new $d,new sv;new em,new $d;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"164"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="164");i(37);function my(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fy(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?my(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):my(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function vy(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return gy(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gy(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function gy(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function yy(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function by(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Cy(t,e){return t.get(ky(t,e))}function wy(t,e,i){return t.set(ky(t,e),i),i}function ky(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var _y=new WeakMap,xy=new WeakMap,Ey=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),by(i=yy(this,e,[t,n]),_y,void 0),by(i,xy,!1);var s="\n importScripts('".concat(i.getSourceRootPath(),"/3rdparty/turf.min.js');\n self.addEventListener('message', function (e) {\n let features = []\n eval(e.data.code);\n self.postMessage(features);\n }, false);\n "),a="data:text/javascript;charset=utf-8,"+encodeURIComponent(s);if(i._worker=new Worker(a),i.options.angle=i.options.angle||0,i.loaded=!1,i.ismove=!1,i.options.position.lat>83.5&&(i.options.position.lat=83.5),i.options.position.lat<-83.5&&(i.options.position.lat=-83.5),i.options.show=!n.show&&!1!==n.show||n.show,i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attributeType=n.attributeType||"richText",n.text=n.text||{},i.options.text={value:n.text.value||"",show:!n.text.show&&!1!==n.text.show||n.text.show,position:n.text.position,fontSize:n.text.fontSize||0===n.text.fontSize?n.text.fontSize:20,color:n.text.color||"#ffffff",scaleByDistance:n.text.scaleByDistance||!1,near:n.text.near||0===n.text.near?n.text.near:2e3,far:n.text.far||0===n.text.far?n.text.far:1e5},i.options.text.position){var r=turf.point([i.options.position.lng,i.options.position.lat]),l=turf.point([i.options.text.position.lng,i.options.text.position.lat]),c=turf.distance(r,l,{units:"kilometers"}),u=turf.rhumbBearing(r,l);i._textToCenter={distance:c,angle:u}}return i.hierarchys=[],i._elms={},i.Dialog=o,i._isdrag=!1,i._EventBinding=new pn,i.sdk.entityMap.get(i.options.id)?Ui()(i):(i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.options.show&&Qt(0,i.options.id),i._entityArray=[],i.init(),i)}return qi()(e,t),x()(e,[{key:"type",get:function(){return"GroundSvg"}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){var i,n,o,s,a,r;"boolean"==typeof t?(i=e,n="show",o=t,s=this,a=1,r=1,Xh()(Yi()(r?i.prototype:i),n,o,s,a),this.options.text&&this.options.text.show&&this.text&&(this.text.show=t)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,this.options.position.lat>83.5&&(this.options.position.lat=83.5),this.options.position.lat<-83.5&&(this.options.position.lat=-83.5),this._update(),this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(t){var i=[n[0],n[1],t];e.text&&(e.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.options.color)for(var i=0;i<this.entity.values.length;i++)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color);else for(var n=0;n<this.entity.values.length;n++)this.entity.values[n].polygon.material=Cesium.Color.fromCssColorString(this.entity.values[n].properties.color._value);this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color=""}});e._elms.color[i]=n}))}},{key:"angle",get:function(){return this.options.angle},set:function(t){var e=this,i=(Number(t)+360)%360;i=parseFloat(i.toFixed(1)),this.options.angle=i,t>0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale.x=t.x,this.options.scale.y=t.y,this._elms&&(this._elms.xRange&&(this._elms.xRange.value=this.options.scale.x),this._elms.yRange&&(this._elms.yRange.value=this.options.scale.y),this._elms.xInput&&(this._elms.xInput.value=this.options.scale.x),this._elms.yInput&&(this._elms.yInput.value=this.options.scale.y)),this._update()}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(t){"boolean"==typeof t?(this.options.flipe.y=t,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){"boolean"==typeof t?(this.options.flipe.x=t,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(t){this.options.text.value=t,this.text?this.text.text=t:e.createText(this),this._elms.textValue&&this._elms.textValue.forEach((function(e){e.value=t}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(t){var e=this;this.options.text.show=t,this.show?(this.text&&(this.text.show=t),this.options.text.position&&setTimeout((function(){e.options.text.position.alt?e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,e.options.text.position.alt]):e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat}).then((function(t){e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,t])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(e){e.checked=t}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(t){var e=this;this.options.text.color=t,this.text&&(this.text.color=t),this._elms.textColor&&this._elms.textColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.textColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.textColor=t},clear:function(){e.textColor="rgba(255,255,255,1)"}});e._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(t){this.options.text.fontSize=t,this.text&&(this.text.fontSize=t),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(e){e.value=t}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(t){this.options.text.scaleByDistance=t,this.text&&(this.text.scaleByDistance=t),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(t){var e=t;e>this.textFar&&(e=this.textFar),this.options.text.near=e,this.text&&(this.text.near=e),this._elms.textNear&&this._elms.textNear.forEach((function(t){t.value=e}))}},{key:"textFar",get:function(){return this.options.text.far},set:function(t){var e=t;e<this.textNear&&(e=this.textNear),this.options.text.far=e,this.text&&(this.text.far=e),this._elms.textFar&&this._elms.textFar.forEach((function(t){t.value=e}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=vy(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vy(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"init",value:function(){var t=this,i=this.replaceHost(this.options.url,this.options.host);be(this.sdk,this.options.id),this.hierarchys=[],this.originalOptions=this.deepCopyObj(this.options);var n=[];(new SVGLoader).load(i,(function(i){if(t.sdk&&t.sdk.viewer&&t.sdk.viewer.entities){i.xml.style.width="0",i.xml.style.height="0",document.body.appendChild(i.xml);var o,s=vy(i.paths);try{for(s.s();!(o=s.n()).done;){var a=o.value,r=a.userData.style.fill,l=window.getComputedStyle(a.userData.node);if(l.strokeWidth&&(a.userData.style.strokeWidth=Number(l.strokeWidth.replace(/[a-zA-Z]/g,""))),void 0!==r&&"none"!==r){var c,u=vy(SVGLoader.createShapes(a));try{for(u.s();!(c=u.n()).done;){var p=c.value,h=new THREE.ShapeGeometry(p),d=new THREE.Mesh(h);n.push({geometry:d.geometry,color:r})}}catch(t){u.e(t)}finally{u.f()}}var m=a.userData.style.stroke;if(void 0!==m&&"none"!==m){var f,v=vy(a.subPaths);try{for(v.s();!(f=v.n()).done;){var g=f.value,y=SVGLoader.pointsToStroke(g.getPoints(),a.userData.style);if(y){var b=new THREE.Mesh(y);n.push({geometry:b.geometry,color:m})}}}catch(t){v.e(t)}finally{v.f()}}}}catch(t){s.e(t)}finally{s.f()}document.body.removeChild(i.xml);for(var C,w=0,k=0,_=0;_<n.length;_++){var x=n[_].geometry;if(x&&x.attributes&&x.attributes.position)for(var E=x.attributes.position.array,S=0;S<E.length;S++)w>E[S]&&(w=E[S]),k<E[S]&&(k=E[S])}(w=Math.abs(w))>(k=Math.abs(k))&&(k=w);var D=k,P=4e3/(k=k*(10/3)*100)/5;D*=P;for(var M=0;M<n.length;M++)n[M].geometry.scale(P,P,1),n[M].geometry.rotateX(THREE.MathUtils.degToRad(180));t._worker.postMessage({code:"\n let geometryArray = e.data.options.geometryArray\n let max2 = e.data.options.max2\n for (let key = 0; key < geometryArray.length; key++) {\n let feature\n let positions = []\n let position = []\n let geometry = geometryArray[key].geometry;\n let array = geometry.attributes.position.array\n \n for (let i = 0; i < array.length; i += 3) {\n let x = array[i] - (max2 / 2)\n let y = array[i + 1] + (max2 / 2)\n position.push([x, y, array[i + 1]])\n }\n if (geometry.index && geometry.index.array) {\n let index = geometry.index.array\n for (let i = 0; i < index.length; i += 3) {\n positions.push([position[index[i]], position[index[i + 1]], position[index[i + 2]]])\n }\n }\n else {\n for (let i = 0; i < position.length; i += 3) {\n positions.push([position[i], position[i + 1], position[i + 2]])\n }\n }\n \n \n let polygons = []\n // 组合多边形\n for (let i = 0; i < positions.length; i++) {\n let polygon = turf.polygon([[\n ...positions[i],\n positions[i][0]\n ]]);\n polygons.push(polygon)\n \n if (feature) {\n feature = turf.union(feature, polygon);\n }\n else {\n feature = polygon\n }\n }\n feature.properties.color = geometryArray[key].color\n features.push(feature)\n }\n ",options:{geometryArray:n,max2:D}}),t._worker.onmessage=function(i){if(t.sdk&&t.sdk.viewer&&t.sdk.viewer.entities){var n=i.data;C=turf.featureCollection(n),t.geojson=JSON.parse(JSON.stringify(C));var o=turf.bbox(C),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=turf.square(o);r[0]=r[0]+t.options.position.lng-s/5,r[1]=r[1]+t.options.position.lat-a/5,r[2]=r[2]+t.options.position.lng+s/5,r[3]=r[3]+t.options.position.lat+a/5,t.bbox=r,t.geojson.features.forEach((function(e){var i=[],n=JSON.parse(JSON.stringify(e));if(n.properties.directionDistance=[],"MultiPolygon"===n.geometry.type)for(var o=0;o<n.geometry.coordinates.length;o++){for(var s=[],a=0;a<n.geometry.coordinates[o].length;a++){for(var r=[],l=0;l<n.geometry.coordinates[o][a].length;l++){var c=turf.point([0,n.geometry.coordinates[o][a][l][1]]),u=turf.point(L()(n.geometry.coordinates[o][a][l])),p=turf.distance(c,u,{units:"kilometers"}),h=turf.rhumbBearing(c,u);r.push({origin:n.geometry.coordinates[o][a][l],distance:p,angle:h})}s.push(r)}n.properties.directionDistance.push(s)}else for(var d=0;d<n.geometry.coordinates.length;d++){for(var m=[],f=0;f<n.geometry.coordinates[d].length;f++){var v=turf.point([0,n.geometry.coordinates[d][f][1]]),g=turf.point(L()(n.geometry.coordinates[d][f])),y=turf.distance(v,g,{units:"kilometers"}),b=turf.rhumbBearing(v,g);m.push({origin:n.geometry.coordinates[d][f],distance:y,angle:b})}n.properties.directionDistance.push(m)}if("MultiPolygon"===n.geometry.type)for(var C=0;C<n.geometry.coordinates.length;C++){var w=t.getHierarchyPolygon(n,C);i.push(w)}else{var k=t.getHierarchyPolygon(n);i.push(k)}t.hierarchys.push(i)})),t.entity=new Cesium.EntityCollection,re(t.sdk,t.options.id);var l=!1;"cesium-viewer 2d"===t.sdk.viewer._element.className&&(l=!0);for(var c=function(e){for(var i=function(i){var n=t.options.id+"-".concat(e,"_").concat(i,"}"),o=t.sdk.viewer.entities.getById(n);o&&t.sdk.viewer.entities.remove(o);var s=t.sdk.viewer.entities.add({id:t.options.id+"-".concat(e,"_").concat(i,"}"),show:t.options.show,polygon:{hierarchy:new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!0),perPositionHeight:l,zIndex:t.sdk._entityZIndex,material:new Cesium.CustomColorMaterialSource({color:t.options.color||t.geojson.features[e].properties.color})},properties:{id:t.options.id}});t.sdk._entityZIndex++,t.geojson.features[e].properties.color&&(s.properties={id:t.options.id,color:t.geojson.features[e].properties.color}),t._entityArray.push(s),t.entity.add(s)},n=0;n<t.hierarchys[e].length;n++)i(n)},u=0;u<t.hierarchys.length;u++)c(u);t.loaded=!0,wy(xy,t,!0),Cy(_y,t)&&Cy(_y,t).call(t),t.scale=t.scale,e.createText(t)}}}}))}},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Cy(xy,this)){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=42;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.text&&(m.options.text.position={lng:m.text.position[0],lat:m.text.position[1],alt:m.text.position[2]}),m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close();var e=m.deepCopyObj(m.options);e.host="",m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(e),be(m.sdk,m.options.id),re(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m._DialogObject=null,m.drag(!1),m.reset(),m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){m.flipeY=!m.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){m.flipeX=!m.flipeX}]},{tagName:"button",className:"drag",innerHTML:"编辑",event:["click",function(){m.drag(!m._isdrag)}]}]},!0);case 7:return this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-svg",(i=document.createElement("div")).innerHTML=Zh(this),t.next=13,this._DialogObject.contentAppChild(i);case 13:this.attributeType=this.options.attributeType,n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color=""}}),s=new YJColorPicker({el:i.getElementsByClassName("textColor")[0],size:"mini",alpha:!0,defaultColor:this.textColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.textColor=t},clear:function(){m.textColor="rgba(255,255,255,1)"}}),r=i.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.textColor=[s],setTimeout(o()(a.a.mark((function t(){var e,n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(m.sdk&&m.sdk.tabHide&&Array.isArray(m.sdk.tabHide))){t.next=9;break}e=0;case 2:if(!(e<m.sdk.tabHide.length)){t.next=9;break}if("属性信息"!==m.sdk.tabHide[e]){t.next=6;break}return i.getElementsByClassName("attribute-info")[0].style.display="none",t.abrupt("break",9);case 6:e++,t.next=2;break;case 9:if(m.attributeLink=m.options.attribute.link.content,n=m.attributeSelect,!(o=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=26;break}(s=Y(o,".attribute-select")).legp_search(n),r=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 17:if(!(l<n.length)){t.next=25;break}if(n[l].key!==m.options.attributeType){t.next=22;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),t.abrupt("break",25);case 22:l++,t.next=17;break;case 25:r.addEventListener("input",(function(){for(var t=0;t<n.length;t++)if(n[t].value===r.value){m.attributeType=n[t].key;break}}));case 26:case"end":return t.stop()}}),t)}))),0),l=i.getElementsByClassName("x-scale")[0],c=i.getElementsByClassName("y-scale")[0],u=l.getElementsByTagName("input")[0],p=l.getElementsByTagName("input")[1],h=c.getElementsByTagName("input")[0],d=c.getElementsByTagName("input")[1],u.value=this.scale.x,p.value=this.scale.x,h.value=this.scale.y,d.value=this.scale.y,this._elms.xRange=u,this._elms.yRange=h,this._elms.xInput=p,this._elms.yInput=d,u.addEventListener("input",(function(t){m.scale={x:u.value,y:m.scale.y}})),h.addEventListener("input",(function(t){m.scale={x:m.scale.x,y:h.value}})),p.addEventListener("input",(function(t){var e=t.target.value;e=Number(e),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||e<=Number(t.target.max)&&e>=Number(t.target.min))&&(m.scale={x:e,y:m.scale.y})})),p.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),m.scale={x:e,y:m.scale.y}})),d.addEventListener("input",(function(t){var e=t.target.value;e=Number(e),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||e<=Number(t.target.max)&&e>=Number(t.target.min))&&(m.scale={x:m.scale.x,y:e})})),d.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),m.scale={x:m.scale.x,y:e}}));case 42:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){Cy(xy,this)&&(this.options=this.deepCopyObj(this.originalOptions),this.position=this.originalOptions.position,this.name=this.originalOptions.name,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color,this.text&&!this.originalOptions.text.position&&(this.text.remove(),this.text=null),this.attributeLink=this.options.attribute.link.content,this.textShow=this.originalOptions.text.show,this.textValue=this.originalOptions.text.value,this.textColor=this.originalOptions.text.color,this.textFontSize=this.originalOptions.text.fontSize,this.textScaleByDistance=this.originalOptions.text.scaleByDistance,this.textNear=this.originalOptions.text.near,this.textFar=this.originalOptions.text.far)}},{key:"drag",value:function(t,e){var i=this;if(Cy(xy,this))if(this.ismove=!1,this._isdrag=t,this.ScreenSpaceEventHandler&&(this.ScreenSpaceEventHandler.destroy(),this.ScreenSpaceEventHandler=null),t){this.ScreenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.canvas);var n=Math.abs(this.bbox[0]-this.bbox[2]),s=Math.abs(this.bbox[1]-this.bbox[3]);this.ScreenSpaceEventHandler.setInputAction(function(){var t=o()(a.a.mark((function t(e){var o,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D,P,M,O,T,N,B,L,A,j,I,F,R,z;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!i.pickPoint){t.next=110;break}if(o=i.pickPoint.position.getValue(),(r=i.sdk.viewer.scene.pickPosition(e.endPosition))||(l=i.sdk.viewer.camera.getPickRay(e.endPosition),r=i.sdk.viewer.scene.globe.pick(l,i.sdk.viewer.scene)),o&&r){t.next=6;break}return t.abrupt("return");case 6:c=i.cartesian3Towgs84(o,i.sdk.viewer),u=i.cartesian3Towgs84(r,i.sdk.viewer),p=0,h=0,f=3.5*i.scale.x,v=3.5*i.scale.y,g=Math.sqrt(Math.pow(f/2,2)+Math.pow(v/2,2)),y=Math.atan(f/2/(v/2))*(180/Math.PI),isNaN(y)&&(y=0),w=turf.point([i.position.lng,i.position.lat]),k={units:"kilometers"},(_=[])[0]=turf.destination(w,v/2*1.5,0+i.options.angle,k).geometry.coordinates,_[1]=turf.destination(w,g,180+y+i.options.angle,k).geometry.coordinates,_[2]=turf.destination(w,v/2,180+i.options.angle,k).geometry.coordinates,_[3]=turf.destination(w,g,180-y+i.options.angle,k).geometry.coordinates,_[4]=turf.destination(w,f/2,270+i.options.angle,k).geometry.coordinates,_[5]=[i.position.lng,i.position.lat],_[6]=turf.destination(w,f/2,90+i.options.angle,k).geometry.coordinates,_[7]=turf.destination(w,g,360-y+i.options.angle,k).geometry.coordinates,_[8]=turf.destination(w,v/2,0+i.options.angle,k).geometry.coordinates,_[9]=turf.destination(w,g,0+y+i.options.angle,k).geometry.coordinates,x=turf.point([c.lng,c.lat]),E=turf.point([u.lng,u.lat]),S=turf.point([i.position.lng,i.position.lat]),D=turf.rhumbBearing(S,x),P=turf.rhumbBearing(S,E),M=(P+360-i.angle)%360,N=turf.rhumbDistance(S,E,k),t.t0=i.pickPoint.id,t.next="svg-control-points_0"===t.t0?38:"svg-control-points_1"===t.t0||"svg-control-points_7"===t.t0?41:"svg-control-points_2"===t.t0||"svg-control-points_8"===t.t0?54:"svg-control-points_3"===t.t0||"svg-control-points_9"===t.t0?61:"svg-control-points_4"===t.t0?74:"svg-control-points_5"===t.t0?81:"svg-control-points_6"===t.t0?91:98;break;case 38:return y=P-D,i.angle+=y,t.abrupt("break",98);case 41:return T=(turf.rhumbBearing(S,turf.point(_[4]))+360-i.angle)%360,O=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),((C=M-O)>-360&&C<-90||C<360&&C>90)&&(C+=180),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=f/3.5,i.scale.y=v/3.5,t.abrupt("break",98);case 54:return O=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((C=M-O)>-360&&C<-90||C<360&&C>90)&&(C+=180),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,t.abrupt("break",98);case 61:return T=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,O=(turf.rhumbBearing(S,turf.point(_[2]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),((C=M-O)>-360&&C<-90||C<360&&C>90)&&(C+=180),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=f/3.5,i.scale.y=v/3.5,t.abrupt("break",98);case 74:return T=(turf.rhumbBearing(S,turf.point(_[4]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",98);case 81:return u.lat>83.5&&(u.lat=83.5),u.lat<-83.5&&(u.lat=-83.5),i.position={lng:u.lng,lat:u.lat},B=u.lng-c.lng,L=u.lat-c.lat,i.bbox[0]=i.bbox[0]+B,i.bbox[1]=i.bbox[1]+L,i.bbox[2]=i.bbox[2]+B,i.bbox[3]=i.bbox[3]+L,t.abrupt("break",98);case 91:return T=(turf.rhumbBearing(S,turf.point(_[6]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",98);case 98:p=p/(n/2)*100,h=h/(s/2)*100,(A=fy({},i.scale)).x=A.x+p,A.y=A.y-h,A.y>200&&(A.y=200),A.y<.001&&(A.y=.001),A.x>200&&(A.x=200),A.x<.001&&(A.x=.001),i.scale=fy({},A),t.next=137;break;case 110:j=i.sdk.viewer.scene.drillPick(e.endPosition),F=0;case 112:if(!(F<j.length)){t.next=120;break}if(!((R=j[F])&&R.primitive&&R.primitive._id&&R.primitive._id.id&&-1!==R.primitive._id.id.indexOf("svg-control-points_"))){t.next=117;break}return I=R.primitive._id,t.abrupt("break",120);case 117:F++,t.next=112;break;case 120:z=0;case 121:if(!(z<i.pointEntityCollection.values.length)){t.next=137;break}if(!I||i.pointEntityCollection.values[z].id!==I.id){t.next=126;break}I.point.color=Cesium.Color.fromCssColorString("#ffff00"),t.next=134;break;case 126:t.t1=i.pointEntityCollection.values[z].id,t.next="svg-control-points_5"===t.t1?129:"svg-control-points_0"===t.t1?131:133;break;case 129:return i.pointEntityCollection.values[z].point.color=Cesium.Color.fromCssColorString("#ffff00"),t.abrupt("break",134);case 131:return i.pointEntityCollection.values[z].point.color=Cesium.Color.fromCssColorString("#ff0000"),t.abrupt("break",134);case 133:i.pointEntityCollection.values[z].point.color=Cesium.Color.fromCssColorString("#00ff0a");case 134:z++,t.next=121;break;case 137:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.ScreenSpaceEventHandler.setInputAction((function(t){for(var e=i.sdk.viewer.scene.drillPick(t.position),n=0;n<e.length;n++){var o=e[n];if(o&&o.primitive&&o.primitive._id&&o.primitive._id.objectId===i.options.id&&o.primitive._id.id&&-1!==o.primitive._id.id.indexOf("svg-control-points_")){YJ.Global.CameraController(i.sdk,!1),i.pickPoint=o.primitive._id,i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break}}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.ScreenSpaceEventHandler.setInputAction((function(t){if(i.pickPoint){switch(YJ.Global.CameraController(i.sdk,!0),i.pickPoint.id){case"svg-control-points_4":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ffff00");break;case"svg-control-points_9":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break;default:i.pickPoint.point.color=Cesium.Color.fromCssColorString("#00ff0a")}i.pickPoint=null}}),Cesium.ScreenSpaceEventType.LEFT_UP),this.ScreenSpaceEventHandler.setInputAction((function(t){i.drag(!1),i._DialogObject||(e&&e(i.options),be(i.sdk,i.options.id),re(i.sdk,i.options.id))}),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.pointEntityCollection=new Cesium.EntityCollection;var r=3.5*this.scale.x,l=3.5*this.scale.y,c=Math.sqrt(Math.pow(r/2,2)+Math.pow(l/2,2)),u=Math.atan(r/2/(l/2))*(180/Math.PI);isNaN(u)&&(u=0);var p=turf.point([this.position.lng,this.position.lat]),h={units:"kilometers"},d=[];d[0]=turf.destination(p,l/2*1.5,0,h).geometry.coordinates,d[1]=turf.destination(p,c,180+u,h).geometry.coordinates,d[2]=turf.destination(p,l/2,180,h).geometry.coordinates,d[3]=turf.destination(p,c,180-u,h).geometry.coordinates,d[4]=turf.destination(p,r/2,270,h).geometry.coordinates,d[5]=[this.position.lng,this.position.lat],d[6]=turf.destination(p,r/2,90,h).geometry.coordinates,d[7]=turf.destination(p,c,360-u,h).geometry.coordinates,d[8]=turf.destination(p,l/2,0,h).geometry.coordinates,d[9]=turf.destination(p,c,0+u,h).geometry.coordinates,this.controlPoints=d;for(var m=function(t){var e="#00ff0a";5===t&&(e="#ffff00"),0===t&&(e="#ff0000");var n=i.sdk.viewer.entities.getOrCreateEntity("svg-control-points_"+t);n.show=!0,n.objectId=i.options.id,n.position=new Cesium.CallbackProperty((function(){var e;return(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(i.controlPoints[t]))})),n.point=new Cesium.PointGraphics({color:Cesium.Color.fromCssColorString(e),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,scaleByDistance:new Cesium.NearFarScalar(0,1,1e10,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}),i.pointEntityCollection.add(n)},f=0;f<this.controlPoints.length;f++)m(f);this._update()}else for(var v=0;v<this.controlPoints.length;v++){var g=this.sdk.viewer.entities.getById("svg-control-points_"+v);g&&g.objectId===this.options.id&&(g.show=!1)}}},{key:"getHierarchyPolygon",value:function(t,e){if(t){var i={},n=[],o=t.properties.directionDistance;void 0!==e&&(o=t.properties.directionDistance[e]);for(var s=0;s<o.length;s++){for(var a=[],r=0;r<o[s].length;r++){var l,c=this.options.position.lng,u=o[s][r].origin[1]+this.options.position.lat;u>90&&(c+=180);var p=[c,u],h=turf.point(p),d=turf.rhumbDestination(h,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=L()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,L()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(t,e,i){if(Cy(xy,this)){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===N()(t[0]))for(var s=0;s<t.length;s++)this._updateGeojson(t[s],e,i);else{for(var a=0;a<t.length;a+=2)t[a]=t[a]+t[a]/(n/2)*e;for(var r=1;r<t.length;r+=2)t[r]=t[r]-t[r]/(o/2)*i}}}},{key:"_update",value:function(){var t=this;if(Cy(xy,this)){var e,i=turf.point([this.position.lng,this.position.lat]),n={units:"kilometers"},o=L()(this.bbox),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=s/2*this.options.scale.x/100-s/2,l=a/2*-this.options.scale.y/100+a/2;o[0]=o[0]-r,o[1]=o[1]+l,o[2]=o[2]+r,o[3]=o[3]-l,o[0]>o[2]&&(e=o[0],o[0]=o[2],o[2]=e),o[1]>o[3]&&(e=o[1],o[1]=o[3],o[3]=e);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),p=function(e){for(var i=0;i<e.length;i++)"number"==typeof e[i]?(t.options.flipe.x&&1===i&&(e[i]=-e[i]),t.options.flipe.y&&0===i&&(e[i]=-e[i])):p(e[i])},h=0;h<u.features.length;h++)p(u.features[h].geometry.coordinates);if(u.features.forEach((function(e){var o=[],s=JSON.parse(JSON.stringify(e));t._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,t.angle,{pivot:[0,0]})).geometry.type)for(var u=0;u<s.geometry.coordinates.length;u++){for(var p=[],h=0;h<s.geometry.coordinates[u].length;h++){for(var d=[],m=0;m<s.geometry.coordinates[u][h].length;m++){var f=turf.point([0,s.geometry.coordinates[u][h][m][1]]),v=turf.point(L()(s.geometry.coordinates[u][h][m])),g=turf.distance(f,v,{units:"kilometers"}),y=turf.rhumbBearing(f,v);d.push({origin:s.geometry.coordinates[u][h][m],distance:g,angle:y})}p.push(d)}a.push(p)}else for(var b=0;b<s.geometry.coordinates.length;b++){for(var C=[],w=0;w<s.geometry.coordinates[b].length;w++){var k=turf.point([0,s.geometry.coordinates[b][w][1]]),_=turf.point(L()(s.geometry.coordinates[b][w])),x=turf.distance(k,_,{units:"kilometers"}),E=turf.rhumbBearing(k,_);C.push({origin:s.geometry.coordinates[b][w],distance:x,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*t.scale.x,D=3.5*t.scale.y,P=Math.sqrt(Math.pow(S/2,2)+Math.pow(D/2,2)),M=Math.atan(S/2/(D/2))*(180/Math.PI);isNaN(M)&&(M=0);var O=[];O[0]=turf.destination(i,D/2*1.5,0+t.options.angle,n).geometry.coordinates,O[1]=turf.destination(i,P,180+M+t.options.angle,n).geometry.coordinates,O[2]=turf.destination(i,D/2,180+t.options.angle,n).geometry.coordinates,O[3]=turf.destination(i,P,180-M+t.options.angle,n).geometry.coordinates,O[4]=turf.destination(i,S/2,270+t.options.angle,n).geometry.coordinates,O[5]=[t.position.lng,t.position.lat],O[6]=turf.destination(i,S/2,90+t.options.angle,n).geometry.coordinates,O[7]=turf.destination(i,P,360-M+t.options.angle,n).geometry.coordinates,O[8]=turf.destination(i,D/2,0+t.options.angle,n).geometry.coordinates,O[9]=turf.destination(i,P,0+M+t.options.angle,n).geometry.coordinates;var T=turf.points(O);O=[];for(var N=0;N<T.features.length;N++)O.push(T.features[N].geometry.coordinates);if(t.controlPoints=O,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var A=t.getHierarchyPolygon(s,B);o.push(A)}else{var j=t.getHierarchyPolygon(s);o.push(j)}c.push(o)})),this.hierarchys=[].concat(c),this.entity){if(this._DialogObject||this._isdrag)for(var d=0,m=function(e){for(var i=function(i){t.entity.values[d].polygon.hierarchy.isConstant&&(t.entity.values[d].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!1)),d++},n=0;n<t.hierarchys[e].length;n++)i(n)},f=0;f<this.hierarchys.length;f++)m(f);else for(var v=0,g=function(e){for(var i=function(i){t.entity.values[v].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!t.ismove),v++},n=0;n<t.hierarchys[e].length;n++)i(n)},y=0;y<this.hierarchys.length;y++)g(y);if(this.textObject&&this.textObject.geojson){for(var b=[],C=JSON.parse(JSON.stringify(this.textObject.geojson)),w=0;w<C.features.length;w++)p(C.features[w].geometry.coordinates);C.features.forEach((function(e){var o=[],s=JSON.parse(JSON.stringify(e));t._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,t.angle,{pivot:[0,0]})).geometry.type)for(var c=0;c<s.geometry.coordinates.length;c++){for(var u=[],p=0;p<s.geometry.coordinates[c].length;p++){for(var h=[],d=0;d<s.geometry.coordinates[c][p].length;d++){var m=turf.point([0,s.geometry.coordinates[c][p][d][1]]),f=turf.point(L()(s.geometry.coordinates[c][p][d])),v=turf.distance(m,f,{units:"kilometers"}),g=turf.rhumbBearing(m,f);h.push({origin:s.geometry.coordinates[c][p][d],distance:v,angle:g})}u.push(h)}a.push(u)}else for(var y=0;y<s.geometry.coordinates.length;y++){for(var C=[],w=0;w<s.geometry.coordinates[y].length;w++){var k=turf.point([0,s.geometry.coordinates[y][w][1]]),_=turf.point(L()(s.geometry.coordinates[y][w])),x=turf.distance(k,_,{units:"kilometers"}),E=turf.rhumbBearing(k,_);C.push({origin:s.geometry.coordinates[y][w],distance:x,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*t.scale.x,D=3.5*t.scale.y,P=Math.sqrt(Math.pow(S/2,2)+Math.pow(D/2,2)),M=Math.atan(S/2/(D/2))*(180/Math.PI);isNaN(M)&&(M=0);var O=[];O[0]=turf.destination(i,D/2*1.5,0+t.options.angle,n).geometry.coordinates,O[1]=turf.destination(i,P,180+M+t.options.angle,n).geometry.coordinates,O[2]=turf.destination(i,D/2,180+t.options.angle,n).geometry.coordinates,O[3]=turf.destination(i,P,180-M+t.options.angle,n).geometry.coordinates,O[4]=turf.destination(i,S/2,270+t.options.angle,n).geometry.coordinates,O[5]=[t.position.lng,t.position.lat],O[6]=turf.destination(i,S/2,90+t.options.angle,n).geometry.coordinates,O[7]=turf.destination(i,P,360-M+t.options.angle,n).geometry.coordinates,O[8]=turf.destination(i,D/2,0+t.options.angle,n).geometry.coordinates,O[9]=turf.destination(i,P,0+M+t.options.angle,n).geometry.coordinates;var T=turf.points(O);O=[];for(var N=0;N<T.features.length;N++)O.push(T.features[N].geometry.coordinates);if(t.controlPoints=O,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var A=t.getHierarchyPolygon(s,B);o.push(A)}else{var j=t.getHierarchyPolygon(s);o.push(j)}b.push(o)})),this.textObject.hierarchys=[].concat(b)}}}}},{key:"textPosPick",value:function(){var t=this;new Pr(this.sdk).start(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:s=turf.point([t.position.lng,t.position.lat]),r=turf.point([o.lng,o.lat]),l=turf.distance(s,r,{units:"kilometers"}),c=turf.rhumbBearing(s,r),t._textToCenter={distance:l,angle:c},t.options.text.position=o,t.text?t.text.position=[o.lng,o.lat,o.alt]:e.createText(t);case 7:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"load",value:function(t){Cy(xy,this)?t():wy(_y,this,t)}},{key:"remove",value:(n=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._worker.onmessage=function(t){},t.next=3,this.sdk.removeIncetance(this.options.id);case 3:if(this.entity){t.next=5;break}return t.abrupt("return");case 5:for(this.drag(!1),this.sdk.viewer.entities.remove(this.entity),this.text&&this.text.remove(),e=this.entity.values.length;e>=0;e--)this.sdk.viewer.entities.remove(this.entity.values[e]);return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=12,be(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.name,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setPosition",value:function(t){if(t){this.ismove=!0;var e={};e.lng=t.position.lng,e.lat=t.position.lat,this.position=e}else this.ismove=!1;this._update()}}],[{key:"createText",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.text.position){t.next=10;break}if(!e.options.text.position.alt){t.next=5;break}i=e.options.text.position.alt,t.next=8;break;case 5:return t.next=7,e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat});case 7:i=t.sent;case 8:e.text=new zn(e.sdk,C()(C()(C()(C()(C()({id:e.options.id,show:!!e.options.show&&!!e.options.text.show&&e.options.text.show,position:[e.options.text.position.lng,e.options.text.position.lat,i],text:e.options.text.value,fontSize:e.options.text.fontSize,color:e.options.text.color,pixelOffset:e.options.text.pixelOffset,backgroundColor:e.options.text.backgroundColor,lineColor:e.options.text.lineColor,lineWidth:e.options.text.lineWidth},"pixelOffset",0),"scaleByDistance",e.options.text.scaleByDistance),"backgroundColor",["#ffffff00","#ffffff00"]),"near",e.options.text.near),"far",e.options.text.far)),e.text.entity.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER;case 10:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s}(Mn);function Sy(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Dy(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Dy(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Dy(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Py(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var My,Oy=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),i=Py(this,e,[t,n]),YJ.RoutePlanningArrays.push(i),i.options.width=n.width||4,i.options.color=n.color||"#ff0000",i.options.gps=n.gps||!1,i.Dialog=o,i._elms={},i.start={lng:null,lat:null},i.end={lng:null,lat:null},i.init(),i}return qi()(e,t),x()(e,[{key:"init",value:function(){var t=this;this.startEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-start"),!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity.show=!1:this.startEntity.show=!0,this.startEntity.position=new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),this.startEntity.billboard={image:this.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.endEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-end"),!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity.show=!1:this.endEntity.show=!0,this.endEntity.position=new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),this.endEntity.billboard={image:this.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.edit(!0),this.clear()}},{key:"startLng",get:function(){return this.start.lng},set:function(t){this.start.lng=t,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLng&&this._elms.startLng.forEach((function(e){e.value=t}))}},{key:"startLat",get:function(){return this.start.lat},set:function(t){this.start.lat=t,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLat&&this._elms.startLat.forEach((function(e){e.value=t}))}},{key:"endLng",get:function(){return this.end.lng},set:function(t){this.end.lng=t,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLng&&this._elms.endLng.forEach((function(e){e.value=t}))}},{key:"endLat",get:function(){return this.end.lat},set:function(t){this.end.lat=t,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLat&&this._elms.endLat.forEach((function(e){e.value=t}))}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=42;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 460px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: auto;\n }\n",t.next=11,new W(this.sdk.viewer._container,{title:"路径规划",closeCallBack:function(){u.tip&&u.tip.destroy(),u.event&&u.event.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()}});case 11:return this._DialogObject=t.sent,t.next=14,this._DialogObject.init();case 14:(n=document.createElement("div")).style.position="absolute",n.style.left="24px",n.style.flet="0",n.style.display="flex",this._DialogObject.footAppChild(n),(o=document.createElement("button")).className="default",o.innerHTML='<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询',o.style.width="auto",o.addEventListener("click",(function(){!u.startLng&&0!==u.startLng||!u.startLat&&0!==u.startLat||!u.endLng&&0!==u.endLng||!u.endLat&&0!==u.endLat?console.error("请先设置起点和终点坐标!"):(!u.startEntity&&(u.startEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return u.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(u.startLng,u.startLat))}),!1),billboard:{image:u.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.startEntity.show=!0,!u.endEntity&&(u.endEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return u.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(u.endLng,u.endLat))}),!1),billboard:{image:u.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.endEntity.show=!0,u.Dialog.queryCallBack&&u.Dialog.queryCallBack({start:[u.startLng,u.startLat],end:[u.endLng,u.endLat]}))})),n.appendChild(o),(s=document.createElement("button")).className="default",s.innerHTML='<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线',s.style.width="auto",s.style.marginLeft="10px",s.addEventListener("click",(function(){u.clear()})),n.appendChild(s),document.getElementsByTagName("head")[0].appendChild(this._element_style),(r=document.createElement("div")).innerHTML='\n <div class="row" style="align-items: flex-start;">\n <div class="col start-col">\n <span class="label">起点</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="startLng">\n <input class="input" type="number" title="" min="-90" max="90" @model="startLat">\n <button @click="pickStartPos" style="margin-left: 10px;">拾取</button>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">终点</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="endLng">\n <input class="input" type="number" title="" min="-90" max="90" @model="endLat">\n <button class="end-pick-btn" @click="pickEndPos" style="margin-left: 10px;">拾取</button>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(r),this.options.gps&&((l=document.createElement("button")).innerHTML="当前位置",l.style.marginLeft="10px",l.setAttribute("data-is","start"),l.addEventListener("click",(function(t){u.getLocateCurrent(t)})),r.getElementsByClassName("start-col")[0].appendChild(l),this._DialogObject._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),c=r.getElementsByTagName("*"),e.EventBinding(this,c),t.next=44;break;case 42:this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 44:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"clear",value:function(){this.startEntity&&(this.sdk.viewer.entities.remove(this.startEntity),this.startEntity=null),this.endEntity&&(this.sdk.viewer.entities.remove(this.endEntity),this.endEntity=null),this.entity&&(this.sdk.viewer.entities.remove(this.entity),this.entity=null),this.startExtensionEntity&&(this.sdk.viewer.entities.remove(this.startExtensionEntity),this.startExtensionEntity=null),this.endExtensionEntity&&(this.sdk.viewer.entities.remove(this.endExtensionEntity),this.endExtensionEntity=null)}},{key:"destroy",value:function(){this.clear(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"getLocateCurrent",value:function(t){var e=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||h();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){e.reconnecting.onmessage=function(i){e.data=JSON.parse(i.data),e.data&&e.data.rmc&&(e.reconnecting.close(),"start"===t.srcElement.getAttribute("data-is")?(e.startLng=e.data.rmc.lng,e.startLat=e.data.rmc.lat,!e.startEntity&&(e.startEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.startEntity.show=!0):(e.endLng=e.data.rmc.lng,e.endLat=e.data.rmc.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0))}}}},{key:"createRoute",value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].lng,t[i].lat);!this.startLng&&0!==this.startLng||!this.startLat&&0!==this.startLat||this.startLng===t[0].lng&&this.startLat===t[0].lat||(this.startExtension=[this.startLng,this.startLat,t[0].lng,t[0].lat],this.startExtensionEntity?this.startExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.startExtension):this.startExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.startExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),!this.endLng&&0!==this.endLng||!this.endLat&&0!==this.endLat||this.endLng===t[t.length-1].lng&&this.endLat===t[t.length-1].lat||(this.endExtension=[this.endLng,this.endLat,t[t.length-1].lng,t[t.length-1].lat],this.endExtensionEntity?this.endExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.endExtension):this.endExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.endExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),this.entity?this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(e):this.entity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(e),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,0),zIndex:99999999}})}},{key:"pickStartPos",value:function(t){var e=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Z("左键选择起点坐标,右键取消",this.sdk),this.event=new X(this.sdk),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)}));var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.startLng=n.lng,e.startLat=n.lat,!e.startEntity&&(e.startEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.startEntity.show=!0,e.tip&&e.tip.destroy(),e.event&&e.event.destroy()};this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.tip&&e.tip.destroy(),e.event&&e.event.destroy()})),this.event.gesture_pinck_start((function(t,n){var o=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;e.event.gesture_pinck_end((function(){new Date-o>=500?(e.tip&&e.tip.destroy(),e.event&&e.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(t){var e=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Z("左键选择终点坐标,右键取消",this.sdk),this.event=new X(this.sdk),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.endLng=n.lng,e.endLat=n.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0,e.tip&&e.tip.destroy(),e.event&&e.event.destroy()})),this.event.mouse_right((function(t,i){e.tip&&e.tip.destroy(),e.event&&e.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=Sy(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i}(Mn);function Ty(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ny(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ty(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ty(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var By,Ly=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=0,n=1,o=20,s=[],My&&!My.isDestroy&&(My.close(),My=null),r=function(){for(var t="",e=0;e<s.length;e++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[e].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties.fid,"</div></td>")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties[o],"</div></td>"));t+=i=i+n+"</tr>"}return t},t.next=8,new W(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return My=t.sent,t.next=11,My.init();case 11:for(y in l=L()(e.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',p='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in e.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',p=p+(h=h+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+p+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",My.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),My._element.title.style.height="40px",My._element.body.style.width="65%",My._element.body.style.height="80%",My._element.content.style.height="calc(100% - 40px)",My._element.content.style.overflow="hidden",My._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),wn(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<e.geojson.features.length;c++)for(var p in e.geojson.features[c].properties){if(-1!=(e.geojson.features[c].properties[p]+"").indexOf(t.value)){a.push(e.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var h=r();u.getElementsByTagName("tbody")[0].innerHTML=h,wn(k,i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,_()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var t=[],i=0;i<e.geojson.features.length;i++)t.push(Ny(Ny({},e.geojson.features[i].properties),{},{positions:JSON.stringify(e.geojson.features[i].geometry.positions)}));e.exportExcel(t)}));case 55:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ay=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:By&&!By.isDestroy&&(By.close(),By=null),n=[],o=function(){for(var t="",e=0;e<n.length;e++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[e].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties.fid,"</div></td>")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties[s],"</div></td>"));t+=i=i+o+"</tr>"}return t},s=!1,r=0;case 5:if(!(r<e.geojson.features.length)){t.next=13;break}if(!e.geojson.features[r].properties.id||e.geojson.features[r].properties.id!=i){t.next=10;break}return n=[e.geojson.features[r]],s=!0,t.abrupt("break",13);case 10:r++,t.next=5;break;case 13:if(s){t.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),t.abrupt("return");case 16:return t.next=18,new W(e.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return By=t.sent,t.next=21,By.init();case 21:for(g in l=o(e),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',h="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in e.geojson.features[0].properties&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(p=p+(h+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,By.contentAppChild(c),new hn("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<x.length;E++)x[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(D=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){S.scrollLeft=t.target.scrollLeft})),By._element.title.style.height="40px",By._element.body.style.width="65%",By._element.body.style.height="80%",By._element.content.style.height="calc(100% - 40px)",By._element.foot.style.display="none",D.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();function jy(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Iy(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Iy(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Iy(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Fy(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ry(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fy(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fy(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function zy(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Hy,Vy=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=zy(this,e,[t,n])).viewer=t.viewer,i.options.path?(i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i):(i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),Ui()(i))}return qi()(e,t),x()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(r=o()(a.a.mark((function t(){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||h(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load":this.options.host+"/yjearth4.0/api/v1/vector/load",i+="?path="+this.options.path,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=t.sent).status){t.next=19;break}return t.next=10,n.json();case 10:if(200!==(o=t.sent).code&&0!==o.code){t.next=18;break}return this.data=o.data,t.next=15,this.formatData();case 15:return t.abrupt("return",e.create(this));case 18:return t.abrupt("return",console.error(o.message));case 19:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"formatData",value:(s=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=function(t){if(t.data){var o;(o=i.list).push.apply(o,L()(t.data));for(var s=0;s<t.data.length;s++){var a=void 0,r=void 0,l=void 0,c=void 0,u=void 0;if(t.data[s].points){a=L()(t.data[s].points);for(var p=0;p<a.length;p++)e.push({id:a[p].attr.id,type:"Feature",geometry:{type:"Point",coordinates:[a[p].x,a[p].y,a[p].z],range:a[p].range,positions:{x:a[p].x,y:a[p].y,z:a[p].z}},properties:a[p].attr?Ry({},a[p].attr):{}})}if(t.data[s].polylines){r=L()(t.data[s].polylines);for(var h=0;h<r.length;h++){for(var d=[],m=0;m<r[h].positions.length;m++)d.push([r[h].positions[m].x,r[h].positions[m].y,r[h].positions[m].z]);e.push({id:r[h].attr.id,type:"Feature",geometry:{type:"LineString",coordinates:d,range:r[h].range,positions:r[h].positions},properties:r[h].attr?Ry({},r[h].attr):{}})}}if(t.data[s].polygons){l=L()(t.data[s].polygons);for(var f=0;f<l.length;f++){for(var v=[],g=0;g<l[f].positions.length;g++)v.push([l[f].positions[g].x,l[f].positions[g].y]);e.push({id:l[f].attr.id,type:"Feature",geometry:{type:"Polygon",coordinates:[v],range:l[f].range,positions:l[f].positions},properties:l[f].attr?Ry({},l[f].attr):{}})}}if(t.data[s].multi_polylines){c=L()(t.data[s].multi_polylines);for(var y=0;y<c.length;y++){for(var b=[],C=[],w=0;w<c[y].polylines.length;w++){var k=[];C.push(c[y].polylines[w].positions);for(var _=0;_<c[y].polylines[w].positions.length;_++)k.push([c[y].polylines[w].positions[_].x,c[y].polylines[w].positions[_].y,c[y].polylines[w].positions[_].z]);b.push(k)}e.push({id:c[y].attr.id,type:"Feature",geometry:{type:"MultiLineString",coordinates:b,range:c[y].range,positions:C},properties:c[y].attr?Ry({},c[y].attr):{}})}}if(t.data[s].multi_polygons){u=L()(t.data[s].multi_polygons);for(var x=0;x<u.length;x++){for(var E=[],S=[],D=0;D<u[x].polygons.length;D++){var P=[];S.push(u[x].polygons[D].positions);for(var M=0;M<u[x].polygons[D].positions.length;M++)P.push([u[x].polygons[D].positions[M].x,u[x].polygons[D].positions[M].y,u[x].polygons[D].positions[M].z]);E.push(P)}e.push({id:u[x].attr.id,type:"Feature",geometry:{type:"MultiPolygon",coordinates:[E],range:u[x].range,positions:S},properties:u[x].attr?Ry({},u[x].attr):{}})}}}}if(t.children)for(var O=0;O<t.children.length;O++)n(t.children[O])},e=[],i=this,n(this.data),e.sort((function(t,e){return Number(t.properties.fid)-Number(e.properties.fid)})),this.geojson={type:"FeatureCollection",features:e};case 6:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(t){this.options.fileName=t,this._elms.fileName&&(this._elms.fileName.value=t)}},{key:"field",get:function(){return this.options.field},set:function(t){this.options.field=t,this._elms.field&&(this._elms.field.value=t)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){t&&"function"!=typeof t?console.error("val:",t,"不是一个function"):this.clickCallBack=t}},{key:"img",get:function(){return this.options.img},set:function(t){Array.isArray(t)||(t=[t]),this.options.img=t,e.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity.entities.values.forEach((function(e){e.billboard&&(e.billboard.color=t),e.polygon&&(e.polygon.material=Cesium.Color.fromCssColorString(t)),e.polyline&&(e.polyline.material=Cesium.Color.fromCssColorString(t))}))}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=h.length>0&&void 0!==h[0]&&h[0],i=h.length>1&&void 0!==h[1]?h[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return t.next=7,new Zi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){p.fileName=p.fileName.trim(),p.fileName||(p.fileName="未命名对象"),p.originalOptions.fileName=p.fileName,p.originalOptions.field=p.field,p._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:p.options.id,fileName:p.originalOptions.fileName,field:p.originalOptions.field})},closeCallBack:function(){p.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=t.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">名称字段选择:</span>\n <select class="input input-select">\n </select>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){p.options.fileName=s.value})),r=o.getElementsByClassName("input-select")[0],l="",this.geojson.features[0].properties)u='<option value="'.concat(c,'">').concat(c,"</option>"),l+=u;r.innerHTML=l,r.value=this.options.field,r.addEventListener("input",(function(){p.options.field=r.value})),this._elms.fileName=s,this._elms.field=r,t.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!e){t.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){t.next=16;break}if(this.geojson.features[c].properties.id!==i){t.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,t.abrupt("break",16);case 13:c++,t.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",t.next=24,new Zi(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=t.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t<f.length;t++)f[t].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return t.stop()}}),t)})))),m.addEventListener("click",(function(){Cn.open(i,i,b._DialogObject.attribute.richTextContent),Cn.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===t){this.geojson.features[i].content=e;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(t,e,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=e:(this._DialogObject.attribute.link.content.push({name:"链接",url:e}),this.setAttributeLinkById(t,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(t,e){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t){this._DialogObject.attribute.link.content=e;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var p=r.getElementsByClassName("tr"),h={linkEdit:(i=o()(a.a.mark((function e(i){var o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function t(e){var o,s,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=33;break}r[e].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[e].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[e].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){t.next=32;break}if(s[l]&&s[l].attributes){t.next=11;break}return t.abrupt("continue",29);case 11:c=jy(s[l].attributes),t.prev=12,p=a.a.mark((function t(){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(i=u.value).name){t.next=5;break}return s[l].addEventListener("click",(function(t){"function"==typeof h[i.value]&&h[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},e)})),s[l].attributes.removeNamedItem(i.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),c.s();case 15:if((u=c.n()).done){t.next=21;break}return t.delegateYield(p(),"t0",17);case 17:if(!t.t0){t.next=19;break}return t.abrupt("break",21);case 19:t.next=15;break;case 21:t.next=26;break;case 23:t.prev=23,t.t1=t.catch(12),c.e(t.t1);case 26:return t.prev=26,c.f(),t.finish(26);case 29:l++,t.next=8;break;case 32:return t.abrupt("return",1);case 33:case"end":return t.stop()}}),t,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){e.next=14;break}return e.delegateYield(l(c),"t0",9);case 9:if(!e.t0){e.next=11;break}return e.abrupt("break",14);case 11:c++,e.next=7;break;case 14:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)}),linkDelete:function(e){n._DialogObject.attribute.link.content.splice(e,1),n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},confirmEdit:function(e,i){n._DialogObject.attribute.link.content[i]=e,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},fileSelect:function(e,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(t,i)}},d=function(t){for(var e=p[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=jy(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof h[o.value]&&h[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<p.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===t){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){Ly(this)}},{key:"openNodeListById",value:function(t){Ay(this,t)}},{key:"flyTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===t){var n=this.geojson.features[i].geometry.range;n&&(ei(0),Ye(this.sdk),Je(this.sdk),this.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(n.min_x,n.min_y,n.max_x,n.max_y)}))}}else this.range&&(ei(0),Ye(this.sdk),Je(this.sdk),this.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(this.range.min_x,this.range.min_y,this.range.max_x,this.range.max_y)}))}},{key:"setShow",value:function(t,e){if(e)for(var i=0;i<this.entity.entities.values.length;i++)this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(e)&&(this.entity.entities.values[i].show=t);else{this.options.show=t;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=t}}},{key:"setShowImg",value:function(t,e){if(e||0===e){for(var i=0;i<this.imgEntity.length;i++)if(i==e){this.imgEntity[i].show=t;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=t}},{key:"remove",value:function(){this.viewer.dataSources.remove(this.entity,!0),this.removeImage(),this.entity=null,this.geojson={},this.data={}}},{key:"removeImage",value:function(){for(var t=0;t<this.imgEntity.length;t++)this.sdk.viewer.entities.remove(this.imgEntity[t]);this.imgEntity=[]}},{key:"cameraSelect",value:function(t,e){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){wn(s,1,10,1);var r="",l={cameraName:t,page:e&&"object"!==N()(e)?e:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.data){if(e.data.list&&e.data.list.length>0){wn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(e.data.list[t].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[t].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[e.data.list[t].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[t].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].userName,'</div>\n <div class="td">').concat(e.data.list[t].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===e.data.list[t].ID){r.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&wn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)}))}else wn(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))}}}},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){var i=turf.bbox(t.geojson);t.range={max_x:i[2],max_y:i[3],min_x:i[0],min_y:i[1]},t.options.img&&e.createImage(t);var n=function(e){var i=t.options.color;if(e){switch(e._value){case 1:i="rgba(255,0,0,1)";break;case 2:i="rgba(255,126,0,1)";break;case 3:i="rgba(255,250,0,1)";break;case 4:i="rgba(0,102,255,1)";break;case 5:i="rgba(0,255,0,1)"}return i}return i};return(new Cesium.GeoJsonDataSource).load(t.geojson,{clampToGround:!0}).then((function(e){t.entity=e,t.viewer.dataSources.add(e),e.entities.values.forEach((function(e){if(e.show=t.options.show,e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n(e.properties.level)),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),e.polygon&&(e.polygon.perPositionHeight=!1,e.polygon.material=Cesium.Color.fromCssColorString(n(e.properties.level))),e.polyline){t.options.color;e.polyline.material=Cesium.Color.fromCssColorString(n(e.properties.level))}}))}))}},{key:"createImage",value:function(t){t.removeImage();for(var e=0;e<t.options.img.length;e++){var i=t.sdk.viewer.entities.add({show:t.options.show,rectangle:{coordinates:Cesium.Rectangle.fromDegrees(t.range.min_x,t.range.min_y,t.range.max_x,t.range.max_y),material:new Cesium.ImageMaterialProperty({image:t.options.img[e],transparent:!0})}});t.imgEntity.push(i)}}},{key:"calculationScope",value:function(t,e){var i=[];if(e.points)for(var n=0;n<e.points.length;n++)i.push(turf.point([e.points[n].position.x,e.points[n].position.y]));if(e.polylines)for(var o=0;o<e.polylines.length;o++)if(e.polylines[o].positions)for(var s=0;s<e.polylines[o].positions.length;s++)i.push(turf.point([e.polylines[o].positions[s].x,e.polylines[o].positions[s].y]));if(e.polygons)for(var a=0;a<e.polygons.length;a++)if(e.polygons[a].positions)for(var r=0;r<e.polygons[a].positions.length;r++)i.push(turf.point([e.polygons[a].positions[r].x,e.polygons[a].positions[r].y]));if(i.length>0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(t.range={max_x:c.bbox[2],max_y:c.bbox[3],min_x:c.bbox[0],min_y:c.bbox[1]})}}},{key:"createPoints",value:function(t,e){if(e){for(var i=new Cesium.PointPrimitiveCollection({scene:t.viewer.scene}),n=0;n<e.length;n++)e[n].attr.id||(e[n].attr.id=t.randomString()),i.add({id:e[n].attr.id,position:Cesium.Cartesian3.fromDegrees(e[n].x,e[n].y,e[n].z),color:Cesium.Color.RED,pixelSize:10,disableDepthTestDistance:Number.POSITIVE_INFINITY}),dt(e[n].attr.id,t.leftClickCB,t);t.entity.add(i)}}},{key:"createPolylines",value:function(t,e){if(e){for(var i=[],n=0;n<e.length;n++){e[n].attr.id||(e[n].attr.id=t.randomString());for(var o=e[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:4}),l=new Cesium.GeometryInstance({id:e[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),dt(e[n].attr.id,t.leftClickCB,t)}i.length>0&&t.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(t,e){if(e){for(var i=[],n=0;n<e.length;n++){e[n].attr.id||(e[n].attr.id=t.randomString());for(var o=e[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))}),l=new Cesium.GeometryInstance({id:e[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),dt(e[n].attr.id,t.leftClickCB,t)}if(i.length>0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});t.entity.add(c)}}}},{key:"createTableContent",value:function(t){for(var e="",i=0;i<t.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in t.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(t.currentData[i].attr[s],"</div></td>");e+=n=n+o+"</tr>"}return e}}]);var i,n,s,r}(Mn);function Gy(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Uy(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gy(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gy(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Wy,Yy=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=0,n=1,o=20,s=[],Hy&&!Hy.isDestroy&&(Hy.close(),Hy=null),r=function(){for(var t="",e=0;e<s.length;e++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[e].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties.fid,"</div></td>")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties[o],"</div></td>"));t+=i=i+n+"</tr>"}return t},t.next=8,new W(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return Hy=t.sent,t.next=11,Hy.init();case 11:for(y in l=L()(e.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',p='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in e.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',p=p+(h=h+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+p+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",Hy.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),Hy._element.title.style.height="40px",Hy._element.body.style.width="65%",Hy._element.body.style.height="80%",Hy._element.content.style.height="calc(100% - 40px)",Hy._element.content.style.overflow="hidden",Hy._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),wn(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<e.geojson.features.length;c++)for(var p in e.geojson.features[c].properties){if(-1!=(e.geojson.features[c].properties[p]+"").indexOf(t.value)){a.push(e.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var h=r();u.getElementsByTagName("tbody")[0].innerHTML=h,wn(k,i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,_()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var t=[],i=0;i<e.geojson.features.length;i++)t.push(Uy(Uy({},e.geojson.features[i].properties),{},{positions:JSON.stringify(e.geojson.features[i].geometry.coordinates)}));e.exportExcel(t)}));case 55:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Jy=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,_,x,E,S,D;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Wy&&!Wy.isDestroy&&(Wy.close(),Wy=null),n=[],o=function(){for(var t="",e=0;e<n.length;e++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[e].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties.fid,"</div></td>")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties[s],"</div></td>"));t+=i=i+o+"</tr>"}return t},s=!1,r=0;case 5:if(!(r<e.geojson.features.length)){t.next=13;break}if(!e.geojson.features[r].properties.id||e.geojson.features[r].properties.id!=i){t.next=10;break}return n=[e.geojson.features[r]],s=!0,t.abrupt("break",13);case 10:r++,t.next=5;break;case 13:if(s){t.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),t.abrupt("return");case 16:return t.next=18,new W(e.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return Wy=t.sent,t.next=21,Wy.init();case 21:for(g in l=o(e),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',h="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in e.geojson.features[0].properties&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(p=p+(h+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,Wy.contentAppChild(c),new hn("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<x.length;E++)x[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(D=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){S.scrollLeft=t.target.scrollLeft})),Wy._element.title.style.height="40px",Wy._element.body.style.width="65%",Wy._element.body.style.height="80%",Wy._element.content.style.height="calc(100% - 40px)",Wy._element.foot.style.display="none",D.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();function qy(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Xy(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Xy(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Xy(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Zy(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ky(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zy(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zy(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $y(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Qy(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function tb(t,e){return t.get(ib(t,e))}function eb(t,e,i){return t.set(ib(t,e),i),i}function ib(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var nb=i(38),ob=new WeakMap,sb=new WeakMap,ab=new WeakMap,rb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),Qy(i=$y(this,e,[t,n]),ob,void 0),Qy(i,sb,!1),Qy(i,ab,[]),i.viewer=t.viewer,!i.options.path)return i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),Ui()(i);for(var s in i.colors=nb,i.options.head_tables=n.head_tables||[],i.options.fileName=n.fileName||"未命名对象",i.options.path.endsWith(".kml")||(i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.opacity=n.opacity||0===n.opacity?n.opacity:1),i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i.sdk.addIncetance(i.options.id,i),i.disaster_type_colors=nb[i.options.disaster_type]?Ky({},nb[i.options.disaster_type]):void 0,i.disaster_type_colors)i.disaster_type_colors[s]=i.cmykToRgb(i.disaster_type_colors[s]);return i}return qi()(e,t),x()(e,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.entity&&this.entity.entities.values.forEach((function(e){e.point&&(e.point.color=e.point.color._value.withAlpha(t)),e.polygon&&(e.polygon.material=e.polygon.material.color._value.withAlpha(t)),e.polyline&&(e.polyline.material=e.polyline.material.color._value.withAlpha(t))}))}},{key:"on",value:function(){if(this.sdk&&this.viewer&&this.options.path)return this.init()}},{key:"init",value:(l=o()(a.a.mark((function t(){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||h(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load2":this.options.host+"/yjearth4.0/api/v1/vector/load2",i+="?path="+this.options.path,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=t.sent).status){t.next=17;break}return t.next=10,n.arrayBuffer();case 10:return o=t.sent,s=new Uint8Array(o),r=this.decompressGzip(s),0===this.data.length&&(this.data=JSON.parse(r)),t.next=16,this.formatData();case 16:return t.abrupt("return",e.create(this));case 17:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"formatData",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=[],i=function(t,e,n){if(t)if(Array.isArray(t)){for(var o=!1,s=0;s<t.length;s++){if("object"!==N()(t[s])){o=!0;break}i(t[s],e,n)}if(o){var a=Number(t[0]),r=Number(t[1]),l=proj4(e,n,[a,r]);t[0]=Number(l[0].toFixed(10)),t[1]=Number(l[1].toFixed(10))}}else t instanceof Object&&(i(t.coordinates,e,n),i(t.geometries,e,n))},n=0;n<this.data.list.length;n++){o=qy(this.name_map);try{for(o.s();!(s=o.n()).done;)(r=y()(s.value,2))[0],(l=r[1]).def===this.data.list[n].crs_src&&l.epsg,l.def===this.data.list[n].crs_dst&&l.epsg}catch(t){o.e(t)}finally{o.f()}for(c=0;c<this.data.list[n].features.length;c++)this.data.list[n].features[c].properties.id,this.data.list[n].features[c].properties||(this.data.list[n].features[c].properties={}),this.data.list[n].features[c].properties.id||(this.data.list[n].features[c].properties.id=Cesium.createGuid()),this.data.list[n].features[c].id=this.data.list[n].features[c].properties.id,i(this.data.list[n].features[c].geometry,this.data.list[n].crs_src,this.data.list[n].crs_dst||"+proj=longlat +datum=WGS84 +no_defs"),this.data.list[n].features[c].geometry.geometries||(this.data.list[n].features[c].geometry.geometries=[]),(u=turf.bbox(this.data.list[n].features[c].geometry))&&u[0]&&u[0]!=1/0&&(this.data.list[n].features[c].geometry.range=turf.bbox(this.data.list[n].features[c])),e.push(this.data.list[n].features[c])}this.geojson={type:"FeatureCollection",features:e};case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(t){this.options.fileName=t,this._elms.fileName&&(this._elms.fileName.value=t)}},{key:"field",get:function(){return this.options.field},set:function(t){this.options.field=t;for(var e=t,i=0;i<this.options.head_tables.length;i++)if(this.options.head_tables[i].key===t){e=this.options.head_tables[i].label;break}this._elms.field&&(this._elms.field.value=e)}},{key:"img",get:function(){return this.options.img},set:function(t){Array.isArray(t)||(t=[t]),this.options.img=t,e.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity&&this.entity.entities.values.forEach((function(i){i.point&&(i.point.color=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity)),i.polygon&&(i.polygon.material=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity)),i.polyline&&(i.polyline.material=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity))}))}},{key:"onRightClick",set:function(t){t&&"function"!=typeof t?console.error("val:",t,"不是一个function"):(null==this.rightClickCallBack&&this.options&&this.options.id&&mt(this.options.id,this.rightClickCB,this),this.rightClickCallBack=t)}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C=this,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w.length>0&&void 0!==w[0]&&w[0],i=w.length>1&&void 0!==w[1]?w[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=74;break}return t.next=7,new Zi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){C.fileName=C.fileName.trim(),C.fileName||(C.fileName="未命名对象"),C.originalOptions.fileName=C.fileName,C.originalOptions.field=C.field,C._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:C.options.id,fileName:C.originalOptions.fileName,field:C.originalOptions.field})},closeCallBack:function(){C.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:this._DialogObject=t.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col key-box">\n <span class="label">名称字段选择:</span>\n <div class="key"></div>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){C.options.fileName=s.value})),r=[],t.t0=a.a.keys(this.geojson.features[0].properties);case 17:if((t.t1=t.t0()).done){t.next=31;break}l=t.t1.value,c=l,u=0;case 21:if(!(u<this.options.head_tables.length)){t.next=28;break}if(this.options.head_tables[u].key!==l){t.next=25;break}return c=this.options.head_tables[u].label,t.abrupt("break",28);case 25:u++,t.next=21;break;case 28:r.push({name:c,value:c,key:l}),t.next=17;break;case 31:if(!(p=Y(o.getElementsByClassName("key-box")[0],".key"))){t.next=47;break}p.legp_search(r),(h=o.getElementsByClassName("key")[0].getElementsByTagName("input")[0]).value=this.field,d=0;case 37:if(!(d<r.length)){t.next=45;break}if(r[d].key!=this.field){t.next=42;break}return h.value=r[d].value,p.legp_searchActive(r[d].value),t.abrupt("break",45);case 42:d++,t.next=37;break;case 45:h.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===h.value){C.options.field=r[t].key;break}})),this._elms.field=h;case 47:return this._elms.fileName=s,t.abrupt("return");case 52:if((t.t3=t.t2()).done){t.next=67;break}v=t.t3.value,g=v,y=0;case 56:if(!(y<this.options.head_tables.length)){t.next=63;break}if(this.options.head_tables[y].key!==v){t.next=60;break}return g=this.options.head_tables[y].label,t.abrupt("break",63);case 60:y++,t.next=56;break;case 63:b='<option value="'.concat(v,'">').concat(g,"</option>"),f+=b,t.next=52;break;case 67:m.innerHTML=f,m.value=this.options.field,m.addEventListener("input",(function(){C.options.field=m.value})),this._elms.fileName=s,this._elms.field=m,t.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"editById",value:(n=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!e){t.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){t.next=16;break}if(this.geojson.features[c].id!==i){t.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,t.abrupt("break",16);case 13:c++,t.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",t.next=24,new Zi(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=t.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t<f.length;t++)f[t].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return t.stop()}}),t)})))),m.addEventListener("click",(function(){Cn.open(i,i,b._DialogObject.attribute.richTextContent),Cn.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].id===t){this.geojson.features[i].content=e;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(t,e,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=e:(this._DialogObject.attribute.link.content.push({name:"链接",url:e}),this.setAttributeLinkById(t,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(t,e){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t){this._DialogObject.attribute.link.content=e;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var p=r.getElementsByClassName("tr"),h={linkEdit:(i=o()(a.a.mark((function e(i){var o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function t(e){var o,s,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=33;break}r[e].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[e].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[e].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){t.next=32;break}if(s[l]&&s[l].attributes){t.next=11;break}return t.abrupt("continue",29);case 11:c=qy(s[l].attributes),t.prev=12,p=a.a.mark((function t(){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(i=u.value).name){t.next=5;break}return s[l].addEventListener("click",(function(t){"function"==typeof h[i.value]&&h[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},e)})),s[l].attributes.removeNamedItem(i.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),c.s();case 15:if((u=c.n()).done){t.next=21;break}return t.delegateYield(p(),"t0",17);case 17:if(!t.t0){t.next=19;break}return t.abrupt("break",21);case 19:t.next=15;break;case 21:t.next=26;break;case 23:t.prev=23,t.t1=t.catch(12),c.e(t.t1);case 26:return t.prev=26,c.f(),t.finish(26);case 29:l++,t.next=8;break;case 32:return t.abrupt("return",1);case 33:case"end":return t.stop()}}),t,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){e.next=14;break}return e.delegateYield(l(c),"t0",9);case 9:if(!e.t0){e.next=11;break}return e.abrupt("break",14);case 11:c++,e.next=7;break;case 14:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)}),linkDelete:function(e){n._DialogObject.attribute.link.content.splice(e,1),n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},confirmEdit:function(e,i){n._DialogObject.attribute.link.content[i]=e,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},fileSelect:function(e,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(t,i)}},d=function(t){for(var e=p[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=qy(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof h[o.value]&&h[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<p.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===t){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){Yy(this)}},{key:"openNodeListById",value:function(t){Jy(this,t)}},{key:"flyTo",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ei(0),Ye(this.sdk),Je(this.sdk),t)for(var n=function(n){if(e.geojson.features[n].id===t)if("Point"===e.geojson.features[n].geometry.type)e.getClampToHeight({lng:e.geojson.features[n].geometry.coordinates[0],lat:e.geojson.features[n].geometry.coordinates[1]}).then((function(t){e.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(e.geojson.features[n].geometry.coordinates[0],e.geojson.features[n].geometry.coordinates[1],t+(i.height||500))})}));else{var o=e.geojson.features[n].geometry.range;if(o){var s=[];e.getClampToHeight({lng:o[0],lat:o[1]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[0],o[1],t);s.push(n.x,n.y,n.z),e.getClampToHeight({lng:o[2],lat:o[3]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[2],o[3],t);s.push(n.x,n.y,n.z);var a=Cesium.BoundingSphere.fromVertices(s);e.sdk.viewer.camera.flyToBoundingSphere(a,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},o=0;o<this.geojson.features.length;o++)n(o);else if(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation){var s={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},a=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(a,r,l);this.sdk.viewer.camera.flyTo({destination:c,orientation:s})}else if(this.range){var u=[];this.getClampToHeight({lng:this.range[0],lat:this.range[1]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(e.range[0],e.range[1],t);u.push(n.x,n.y,n.z),e.getClampToHeight({lng:e.range[2],lat:e.range[3]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(e.range[2],e.range[3],t);u.push(n.x,n.y,n.z);var o=Cesium.BoundingSphere.fromVertices(u);e.sdk.viewer.camera.flyToBoundingSphere(o,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},{key:"setShow",value:function(t,e){if(e){if(!this.entity)return;for(var i=0;i<this.entity.entities.values.length;i++)if(this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(e)){this.entity.entities.values[i].show=t,this.entity.entities.values[i]._customShow=t,re(this.sdk,this.options.id,this.entity.entities.values[i].id);break}be(this.sdk,this.options.id)}else{if(this.options.show=t,!this.entity)return;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=t,this.entity.entities.values[n]._customShow=t,re(this.sdk,this.options.id,this.entity.entities.values[n].id);be(this.sdk,this.options.id)}}},{key:"setShowImg",value:function(t,e){if(e||0===e){for(var i=0;i<this.imgEntity.length;i++)if(i==e){this.imgEntity[i].show=t;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=t}},{key:"remove",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.entity&&this.entity.entities.values.forEach((function(t){ri(e.sdk.viewer,t)})),eb(ab,this,[]),this.removeImage(),this.entity=null,this.geojson={},this.data={},t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,re(this.sdk,this.options.id);case 10:return t.next=12,be(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"removeImage",value:function(){for(var t=0;t<this.imgEntity.length;t++)this.sdk.viewer.entities.remove(this.imgEntity[t]);this.imgEntity=[]}},{key:"cameraSelect",value:function(t,e){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){wn(s,1,10,1);var r="",l={cameraName:t,page:e&&"object"!==N()(e)?e:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.data){if(e.data.list&&e.data.list.length>0){wn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(e.data.list[t].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[t].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[e.data.list[t].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[t].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].userName,'</div>\n <div class="td">').concat(e.data.list[t].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===e.data.list[t].ID){r.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&wn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)}))}else wn(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))}}}},{key:"load",value:function(t){tb(sb,this)?t():eb(ob,this,t)}},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){var i=turf.bbox(t.geojson);i&&i[0]&&i[0]!=1/0&&(t.range=i),t.options.img&&e.createImage(t);if(!t.options.path.endsWith(".kml")&&!t.options.path.endsWith(".kmz")){return(new Cesium.GeoJsonDataSource).load(t.geojson,{clampToGround:!0}).then((function(t){o(t)}))}var n="";function o(e){if(t.entity=e,e.entities.values.forEach((function(e,i){e.show=t.options.show,e.type="vector",e.parentId=t.options.id,e.properties||(e.properties={}),ai(t.sdk,e);var n=function(e){var i=t.options.color;return t.disaster_type_colors&&t.disaster_type_colors.hasOwnProperty(e)&&(i=t.disaster_type_colors[e]),i}(e.properties&&e.properties[t.options.fxdj]&&e.properties[t.options.fxdj]._value);if(e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n||"rgba(0,255,184,0.5)").withAlpha(t.opacity),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1)})),e.polyline){var o=e.polyline.material;n&&(o=Cesium.Color.fromCssColorString(n).withAlpha(t.opacity)),e.polyline=new Cesium.PolylineGraphics({positions:e.polyline.positions._value,width:e.polyline.width&&e.polyline.width.getValue(),clampToGround:!0,material:o,zIndex:t.sdk._entityZIndex})}if(e.polygon&&e.polygon.material){e.polygon.perPositionHeight=!1,e.polygon.extrudedHeight=void 0;var s=e.polygon.material.color._value;n&&(s=Cesium.Color.fromCssColorString(n)),(t.opacity||0===t.opacity)&&(s=s.withAlpha(t.opacity));var a=e.kml||e.kmz;if(a){var r=a.extendedData&&a.extendedData.BaseTexturePath&&a.extendedData.BaseTexturePath.value?a.extendedData.BaseTexturePath.value:void 0;r&&(e.polygon.material.image=r,e.polygon.material.repeat=new Cesium.Cartesian2(1,1)),e.polygon.material=new Cesium.ImageMaterialProperty({image:r,repeat:new Cesium.Cartesian2(1,1),color:s})}if(e.polygon.zIndex=t.sdk._entityZIndex,t.options.path.endsWith(".kml")||t.options.path.endsWith(".kmz")){var l=n?Cesium.Color.fromCssColorString("#000000"):e.polygon.outlineColor.getValue();(t.opacity||0===t.opacity)&&(l=l.withAlpha(t.opacity)),e.polygon.outlineWidth&&(e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:e.polygon.outlineWidth.getValue(),clampToGround:!0,material:l,zIndex:t.sdk._entityZIndex}))}else e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:Cesium.Color.fromCssColorString("#000000").withAlpha(t.opacity),zIndex:t.sdk._entityZIndex}),e.point&&(e.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1)}));t.sdk._entityZIndex++}if(t.options.path.endsWith(".kml")||t.options.path.endsWith(".kmz")){if(e.label){e.label.font="16px Microsoft YaHei";var c=t.geojson.features[i];e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.properties=c?c.properties:{},e.properties.id||e.properties.Id||e.properties.ID||e.properties.addProperty("id",e.id),e.label.text=new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1)}}else e.point&&(e.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return We()?void 0:Number.POSITIVE_INFINITY}),!1)}))})),!t.options.field){var i=["id","Id","ID","name","Name","NAME","address","Address","ADDRESS","text","Text","TEXT","label","Label","LABEL"].find((function(e){return void 0!==t.geojson.features[0].properties[e]}));if(i)t.options.field=i;else for(var n in t.geojson.features[0].properties){t.options.field=n;break}}eb(sb,t,!0),tb(ob,t)&&tb(ob,t).call(t)}t.options.host=t.options.host||h(),n=t.options.host.endsWith("yjearth4.0")?t.options.host+"/api/v1/vector/getKml":t.options.host+"/yjearth4.0/api/v1/vector/getKml",n+="?path="+t.options.path,fetch(n,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.blob().then((function(e){e.text().then((function(e){if(t.options.path.endsWith(".kmz"))e=n;else for(var i=(e=(new DOMParser).parseFromString(e,"text/xml")).getElementsByTagName("Placemark"),s=0;s<i.length;s++)i[s].id=t.geojson.features[s].id;Cesium.KmlDataSource.load(e,{camera:t.viewer.scene.camera,canvas:t.viewer.scene.canvas,clampToGround:!0}).then((function(t){o(t)}))}))}))}))}},{key:"createImage",value:function(t){if(t.removeImage(),t.range)for(var e=0;e<t.options.img.length;e++){var i,n=t.sdk.viewer.entities.add({show:t.options.show,rectangle:{coordinates:(i=Cesium.Rectangle).fromDegrees.apply(i,L()(t.range)),material:new Cesium.ImageMaterialProperty({image:t.options.img[e],transparent:!0})}});t.imgEntity.push(n)}}},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");i.font="16px YaHei";for(var n=t.split("\n"),o=0,s=0,a=0;a<n.length;a++){var r=n[a],l=i.measureText(r).width;l>o&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,e.width=o,e.height=s;var c=i.createLinearGradient(0,0,o,s);return i.fillStyle=c,i.fillRect(0,0,o,s),i.fillStyle="#ffffff",i.font="16px YaHei",i.strokeStyle="#000000",i.strokeText(n,15,16*n.length+6.25+5*n.length),i.fillText(n,15,16*n.length+6.25+n.length-5),i.moveTo(o/2,s),i.stroke(),i.closePath(),e.toDataURL()}},{key:"createTableContent",value:function(t){for(var e="",i=0;i<t.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in t.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(t.currentData[i].attr[s],"</div></td>");e+=n=n+o+"</tr>"}return e}}]);var i,n,s,r,l}(Mn);function lb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?lb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):lb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ub(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var pb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=ub(this,e,[t,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));if(s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.name=i.options.text,i.options.show=!n.show&&!1!==n.show||n.show,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.fontSize=n.fontSize||20,i.options.duration=n.duration||0===n.duration?n.duration:5e4,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,!i.options.position&&i.options.positions){var r=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.atan2(n,i)};i.options.position={lng:(i.options.positions[0].lng+i.options.positions[1].lng)/2,lat:(i.options.positions[0].lat+i.options.positions[1].lat)/2};var l=turf.point([i.options.positions[0].lng,i.options.positions[0].lat]),c=turf.point([i.options.positions[1].lng,i.options.positions[1].lat]),u={units:"miles"},p=turf.rhumbDistance(l,c,u),h=r([i.options.positions[0].lng,i.options.positions[0].lat],[i.options.positions[1].lng,i.options.positions[1].lat]);i.options.angle=(360+Cesium.Math.toDegrees(h))%360;var d=1e-4*Math.abs(Math.cos(Math.PI/180*i.options.position.lat)),m=i.getcanvas(),f=m.height/m.width,v=i.options.position.lng-1e-4/f,g=i.options.position.lat-d,y=i.options.position.lng+1e-4/f,b=i.options.position.lat+d,C=(g+b)/2,w=turf.point([v,C]),_=turf.point([y,C]),x=turf.rhumbDistance(w,_,u),E=Cesium.Math.toRadians(i.options.position.lat);x*=1+Math.abs(Math.sin(h)*Math.tan(E)*Math.sin(E)*Math.sin(E)),i.options.scale=p/x}return i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new pn,i._elms={},i.previous={position:cb({},i.options.position)},i.event=new X(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return qi()(e,t),x()(e,[{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"text",get:function(){return this.options.text},set:function(t){var e=this;this.options.text=t;for(var i=this.options.text.split("\n"),n=0;n<i.length;n++)if(i[n].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),i[n]=i[n].slice(0,80-i[n].length)}if(i.length>70){i.splice(70-i.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=i.join("\n"),this.entity){var o=this.getcanvas(),s=o.height/o.width;this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:o.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var t,i=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),n=[e.options.position.lng-1e-4*e.options.scale/s,e.options.position.lat-i,e.options.position.lng+1e-4*e.options.scale/s,e.options.position.lat+i];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(t){t.value=e.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:i.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"create",value:function(){var t=this,e=this.getcanvas(),i=e.height/e.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var e,n=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),o=[t.options.position.lng-1e-4*t.options.scale/i,t.options.position.lat-n,t.options.position.lng+1e-4*t.options.scale/i,t.options.position.lat+n];return(e=Cesium.Rectangle).fromDegrees.apply(e,o)}),!1),material:new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),be(this.sdk,this.options.id),this.options.show&&Qt(0,this.options.id)}},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=18;break}return t.next=6,new Zi(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(t){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),be(s.sdk,s.options.id),re(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.positionEditing=!1,s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="100000" min="0" step="0.01" @model="scale">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100000" step="0.01" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],t.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=t,this.previous={position:cb({},this.options.position)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy()))}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(o={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},s=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),u={lng:0,lat:0},this.options.position?u=cb({},this.options.position):this.options.positions?u=cb({},this.options.positions[0]):this.options.center?u=cb({},this.options.center):this.options.start?u=cb({},this.options.start):(this.options.hasOwnProperty("lng")&&(u.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(u.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(u.alt=this.options.alt)),u.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(u);case 17:u.alt=t.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,r=this.options.customView.relativePosition.lat+u.lat,l=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),t.next=34;break;case 25:return p=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),h=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-p],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+p]],t.next=29,this.getClampToHeight(this.options.position);case 29:for(d=t.sent,m=[],f=0;f<h.length;f++)g=(v=Cesium.Cartesian3).fromDegrees.apply(v,L()(h[f]).concat([d])),m.push(g.x,g.y,g.z);y=Cesium.BoundingSphere.fromVertices(m),this.sdk.viewer.camera.flyToBoundingSphere(y,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 34:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,be(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getcanvas",value:function(){for(var t=document.createElement("canvas"),e=t.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){e.font="200px serif";var a=e.measureText(i[s]).width;o<a&&(o=a)}t.width=o,t.height=220*i.length;for(var r=0;r<i.length;r++)e.font="200px serif",e.fillStyle="rgba(255, 255, 255, 0)",e.fillRect(0,0,o+30,210),e.fillStyle=this.options.color,e.font="200px serif",e.fillText(i[r],0,210*(r+1));return t}}]);var i,n,s}(Mn);function hb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var db=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(n=hb(this,e,[t,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),n.options.text=s.join("\n"),n.options.color=i.color||"#FFC107",n.options.positions=i.positions,n.options.speed=i.speed||0===i.speed?i.speed:1,n.options.show=!i.show&&!1!==i.show||i.show,n.nodePoints=[],n.entity,n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||[],n.options.attributeType=i.attributeType||"richText",n.extrudedHeight,n._EventBinding=new pn,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),e.create(n),n}return qi()(e,t),x()(e,[{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t;for(var e=this.options.text.split("\n"),i=0;i<e.length;i++)if(e[i].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),e[i]=e[i].slice(0,80-e[i].length)}if(e.length>70){e.splice(70-e.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=e.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance2(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u<n.length;u++)o.push(n[u].lng,n[u].lat),s.push(n[u].alt),a.push(n[u].alt+c);this.entity.wall.material=r,this.entity.wall.maximumHeights=a,this.entity.wall.minimumHeights=s}this._elms.text&&this._elms.text.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.wall.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.entity.wall.material=this.getMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"attributeCamera",get:function(){return this.options.attribute.camera},set:function(t){this.options.attribute.camera=t}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=20;break}return t.next=6,new Zi(this.sdk,this.options,{title:"立体文字属性",left:"180px",top:"100px",confirmCallBack:function(t){r.text=r.text.trim(),r.text||(r.text="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),be(r.sdk,r.options.id),re(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.Dialog.closeCallBack&&r.Dialog.closeCallBack();for(var t=0;t<r.nodePoints.length;t++)r.sdk.viewer.entities.remove(r.nodePoints[t]);r.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),r.event&&r.event.destroy(),r.tip&&r.tip.destroy()},showCallBack:function(t){r.options.show=t,r.originalOptions.show=t,r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(r)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" stand-text",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col" style="margin-right: 20px;">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <input style="font-size: 13px;width: 100px;margin-left: 10px;" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){r.color=t},clear:function(){r.color="rgba(255,255,255,1)"}}),s=n.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.color=[o],t.next=21;break;case 20:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 21:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.color=this.originalOptions.color,this.speed=this.originalOptions.speed;for(var t=this.options.positions,e=[],i=[],n=[],o=this.computeDistance2(t),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a<t.length;a++)e.push(t[a].lng,t[a].lat),i.push(t[a].alt),n.push(t[a].alt+s);this.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(e)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,be(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getMaterial",value:function(){var t=this.getcanvas();return new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:5e4/this.options.speed,fltr:!1})}},{key:"getcanvas",value:function(){for(var t=document.createElement("canvas"),e=t.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){e.font="200px serif";var a=e.measureText(i[s]).width;o<a&&(o=a)}t.width=o,t.height=220*i.length;for(var r=0;r<i.length;r++)e.font="200px serif",e.fillStyle="rgba(255, 255, 255, 0)",e.fillRect(0,0,o+30,210),e.fillStyle=this.options.color,e.font="200px serif",e.fillText(i[r],0,210*(r+1));return this.aspectRatio=this.options.text?t.width/t.height:0,t}},{key:"openRichTextEditor",value:function(t){var e=this;Cn.open(this.options.id,this.options.text,this.options.richTextContent),Cn.primaryCallBack=function(t){e.options.richTextContent=t}}}],[{key:"create",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.options.positions,n=[],o=[],s=[],r=e.getMaterial(),l=e.computeDistance2(i),c=e.aspectRatio?l/e.aspectRatio:0,u=0;u<i.length;u++)n.push(i[u].lng,i[u].lat),o.push(i[u].alt),s.push(i[u].alt+c);e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,wall:{positions:Cesium.Cartesian3.fromDegreesArray(n),cornerType:Cesium.CornerType.MITERED,maximumHeights:s,minimumHeights:o,material:r}}),be(e.sdk,e.options.id),e.options.show&&Qt(0,e.options.id);case 11:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=[],r=[],l=t.computeDistance2(o),c=t.aspectRatio?l/t.aspectRatio:0,u=0;u<o.length;u++)s.push(o[u].lng,o[u].lat),a.push(o[u].alt),r.push(o[u].alt+c);var p=!1,h=function(e,o){if(i){p=!0;var u=t.sdk.viewer.scene.clampToHeight(o,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(u,t.sdk.viewer),n=t.options.positions[i.index];var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,h),t.options.positions.splice(i.index,0,t.options.positions[i.index]);var d=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(d),c=t.aspectRatio?l/t.aspectRatio:0;for(var m=0;m<d.length;m++)s.push(d[m].lng,d[m].lat),a.push(d[m].alt),r.push(d[m].alt+c);t.tip.setPosition(o,e.position.x,e.position.y)}else{var f=t.sdk.viewer.scene.pick(e.position);f&&f.id&&f.id.name&&"node-secondary-edit-point"===f.id.name&&(i=f.id,t.nodePoints.splice(f.id.index,1),t.sdk.viewer.entities.remove(f.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(o,t.sdk.viewer),t.entity.wall.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(s)}),!1),t.entity.wall.maximumHeights=new Cesium.CallbackProperty((function(){return r}),!1),t.entity.wall.minimumHeights=new Cesium.CallbackProperty((function(){return a}),!1))}},d=function(o,u){i&&(t.options.positions[i.index]=n,p&&t.options.positions.splice(i.index,1),e(null,t.options.positions));var h=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(h),c=t.aspectRatio?l/t.aspectRatio:0;for(var d=0;d<h.length;d++)s.push(h[d].lng,h[d].lat),a.push(h[d].alt),r.push(h[d].alt+c);t.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(s);for(var m=0;m<t.nodePoints.length;m++)t.sdk.viewer.entities.remove(t.nodePoints[m]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy()};t.event.mouse_left(h),t.event.mouse_right(d),t.event.mouse_move((function(e,n){if(i){var o=t.sdk.viewer.scene.clampToHeight(n,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var u=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(u),c=t.aspectRatio?l/t.aspectRatio:0;for(var p=0;p<u.length;p++)s.push(u[p].lng,u[p].lat),a.push(u[p].alt),r.push(u[p].alt+c)}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),t.nodePoints.pop(),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0))})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?d(o,i):h(o,i)}))}));for(var m=0;m<t.options.positions.length;m++){var f=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:m,position:Cesium.Cartesian3.fromDegrees(t.options.positions[m].lng,t.options.positions[m].lat,t.options.positions[m].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(f)}}}}]);var i,n,s}(Mn);function mb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function fb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?mb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function vb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var gb=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=vb(this,e)).sdk=t,n.viwer=t.viewer,n.options=fb({},i),n.options.host=i.host||h(),n.options.name=i.name||"未命名对象",n.options.show=!i.show&&!1!==i.show||i.show,"number"==typeof i.scale?(n.options.scale={},n.options.scale.x=i.scale,n.options.scale.y=i.scale,n.options.scale.z=i.scale):(n.options.scale=i.scale||{},n.options.scale.x=n.options.scale.x||0===n.options.scale.x?n.options.scale.x:1,n.options.scale.y=n.options.scale.y||0===n.options.scale.y?n.options.scale.y:1,n.options.scale.z=n.options.scale.z||0===n.options.scale.z?n.options.scale.z:1),n.primitive=null,n._loadEvent=void 0,n._loaded=!1,n._elms={},n.Dialog=o,n._EventBinding=new pn,e.setDefaultValue(n),n.requestResource(),n.ControllerObject=new _o(n.sdk,{position:fb({},n.options.position),rotate:{x:(360+n.options.roll%360)%360,y:(360+-n.options.pitch%360)%360,z:(360+-n.options.heading%360)%360}}),n.ControllerObject.controllerCallBack=n.controllerCallBack,n.HeadingPitchRollCallBack=n.Dialog.HeadingPitchRollCallBack,n}return qi()(e,t),x()(e,[{key:"requestResource",value:function(){this.addResource().then((function(t){}))}},{key:"addResource",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this).options.xmlURL=e.options.objUrl.replace(".obj",".xml"),""===e.options.xmlURL){t.next=34;break}return t.next=5,fetch(e.options.xmlURL);case 5:if(!(i=t.sent).ok){t.next=32;break}return t.next=9,i.text();case 9:return n=t.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=e.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),e.options.position=e.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},e.ControllerObject.position=e.options.position,u=e.viwer.scene,p=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),h=Cesium.Transforms.headingPitchRollToFixedFrame(p,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),t.next=22,window.objLoader.Load(e.options.objUrl);case 22:(d=t.sent).show=e.options.show,d.modelMatrix=h,d.setFlvVideo(e.options.videoUrl),u.primitives.add(d),e.primitive=d,e.controllerCallBack({rotate:{x:e.options.roll,y:-e.options.pitch,z:-e.options.heading},position:fb({},e.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:t.next=36;break;case 34:return console.error("请填写xml路径"),t.abrupt("return");case 36:if(""!==e.options.objUrl){t.next=39;break}return console.error("请填写obj模型路径"),t.abrupt("return");case 39:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]?p[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(ei(0),Ye(this.sdk),Je(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=fb({},this.options.position):this.options.positions?l=fb({},this.options.positions[0]):this.options.center?l=fb({},this.options.center):this.options.start?l=fb({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=28;break;case 25:c=100*Math.tan(60),u=c/111319.55,this.sdk.viewer.camera.flyTo({destination:new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat-u,this.options.position.alt+100),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return p.length>0&&void 0!==p[0]&&p[0],e=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,new Zi(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.name.trim(),u.name||(u.name="未命名对象"),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},rotateCallBack:function(){u.rotationEditing?u.rotationEditing=!1:u.rotationEditing=!0},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 6:for(this._DialogObject=t.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input name" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" step="0.01" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box" style="display: flex;align-items: center;margin-left: 20px;">\n <input type="checkbox" style="width: 14px;height: 14px;margin-top: 2px;margin-right: 5px;cursor: pointer;">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input class="scale-x" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-x" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input class="scale-y" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-y" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input class="scale-z" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-z" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input class="scale-all" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-all" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),o=this._DialogObject._element.content.getElementsByClassName("equal")[0],s=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],n.checked=e,n.addEventListener("change",(function(t){(e=t.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(r=o.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),r[1].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),e?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var t=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];t&&(t.style.position="absolute",t.style.left="100px")}}),0),l=i.getElementsByTagName("*"),c=0;c<l.length;c++)l[c].addEventListener("input",(function(t){if("0"===t.target.value&&"0"===t.target.min)switch(t.target.className){case"scale-x":u.scaleX=1e-4;break;case"scale-y":u.scaleY=1e-4;break;case"scale-z":u.scaleZ=1e-4;case"scale-all":u.scaleX=1e-4,u.scaleY=1e-4,u.scaleZ=1e-4}}));this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.scaleX.push(r[0],r[1]);case 28:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){if(this.ControllerObject.destroy(),this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.primitive){var t=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt));this.primitive.modelMatrix=t,this.primitive.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(this.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(this.options.heading,this.options.pitch,this.options.roll)),this.primitive.modelMatrix);var e=this.options.scale.x,i=this.options.scale.y,n=this.options.scale.z;0===e&&(e=1e-5),0===i&&(i=1e-5),0===n&&(n=1e-5),Cesium.Matrix4.multiplyByScale(this.primitive.modelMatrix,new Cesium.Cartesian3(e,i,n),this.primitive.modelMatrix)}}},{key:"remove",value:function(){this.sdk.viewer.scene.primitives.remove(this.primitive),this.primitive=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"controllerCallBack",get:function(){var t=this;return function(e){t.options.heading=-e.rotate.z,t.options.pitch=-e.rotate.y,t.options.roll=e.rotate.x,t.HeadingPitchRollCallBack&&t.HeadingPitchRollCallBack(e);var i=Number(Number(e.position.lng).toFixed(8)),n=Number(Number(e.position.lat).toFixed(8)),o=Number(Number(e.position.alt).toFixed(2));t.options.position={lng:i,lat:n,alt:o};var s=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt));t.primitive.modelMatrix=s,Cesium.Matrix4.multiplyByMatrix3(t.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(-e.rotate.z,-e.rotate.y,e.rotate.x)),t.primitive.modelMatrix);var a=t.options.scale.x,r=t.options.scale.y,l=t.options.scale.z;0===a&&(a=1e-5),0===r&&(r=1e-5),0===l&&(l=1e-5),Cesium.Matrix4.multiplyByScale(t.primitive.modelMatrix,new Cesium.Cartesian3(a,r,l),t.primitive.modelMatrix),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.position.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.position.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.position.alt}))}},set:function(t){this._controllerCallBack=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(t){t?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(4)),this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(4)),this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(4)),this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){this.sdk&&this.sdk.viewer&&this.ControllerObject&&(t?this.ControllerObject.editTranslational():this.ControllerObject.destroy())}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position.alt=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:fb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.primitive.show=t):console.error("参数必须为boolean")}},{key:"playDistance",get:function(){return this.options.playDistance},set:function(t){this.options.playDistance=t}},{key:"flicker",value:function(){}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}},{key:"customView",get:function(){this.options.customView}},{key:"setCustomView",value:function(t){if(t)this.options.customView=t;else{var e=this.sdk.viewer.camera;this.options.customView={orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},position:{x:e.position.x,y:e.position.y,z:e.position.z}},this.originalOptions&&(this.originalOptions.customView=this.options.customView)}}},{key:"resetCustomView",value:function(){this.options.customView=void 0}}],[{key:"setDefaultValue",value:function(t){t.options.id=t.options.id||t.randomString(),t.options.position=t.options.position,t.options.objUrl=t.options.objUrl||"",t.options.videoUrl=t.options.videoUrl||"",t.options.xmlURL=t.options.xmlURL||"",t.options.heading=t.options.heading||0,t.options.pitch=t.options.pitch||0,t.options.roll=t.options.roll||0}}]);var i,n,s}(si);function yb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Cb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var wb=function(t){function e(t,i,n){var o;return k()(this,e),(o=Cb(this,e,[t,i,n]))._loadEvent=void 0,o._loaded=!1,o.options.objId=i.objId,o.options.videoId=i.videoId,o.options.videoType=i.videoType||"flv",o}return qi()(e,t),x()(e,[{key:"addResource",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this).options.xmlURL=e.options.objUrl.replace(".obj",".xml"),""===e.options.xmlURL){t.next=35;break}return t.next=5,fetch(e.options.xmlURL);case 5:if(!(i=t.sent).ok){t.next=33;break}return t.next=9,i.text();case 9:return n=t.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=e.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),e.options.position=e.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},e.ControllerObject.position=e.options.position,u=e.viwer.scene,p=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),h=Cesium.Transforms.headingPitchRollToFixedFrame(p,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),d=new Si(e.viwer.scene.context),t.next=23,d.Load(e.options.objUrl,e.options.videoId,e.options.host);case 23:(m=t.sent).modelMatrix=h,m.show=e.options.show,m.setFlvVideo(e.options.videoUrl),u.primitives.add(m),e.primitive=m,e.controllerCallBack({rotate:{x:e.options.roll,y:-e.options.pitch,z:-e.options.heading},position:bb({},e.options.position)}),e.loaded=!0,e._loaded=!0,e._loadEvent&&e._loadEvent();case 33:t.next=36;break;case 35:return t.abrupt("return");case 36:if(""!==e.options.objUrl){t.next=38;break}return t.abrupt("return");case 38:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"requestResource",value:(i=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this)._loaded){t.next=12;break}if(!e.options.objId){t.next=6;break}return t.next=5,e.requestObjResource();case 5:e.options.objUrl=t.sent;case 6:if(!e.options.videoId){t.next=10;break}return t.next=9,e.requestVideoResource();case 9:e.options.videoUrl=t.sent;case 10:return t.next=12,e.addResource();case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"requestObjResource",value:function(){var t="",e=(t=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/obj/"+this.options.objId;return fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=13;break}if(!n.data.objPath.length){e.next=9;break}return e.abrupt("return",t+"/obj/wirte/file/"+n.data.objPath);case 9:console.warn("资源不存在");case 10:return e.abrupt("return");case 13:return console.warn(n.msg||n.message),e.abrupt("return");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"requestVideoResource",value:function(){var t="",e=(t=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/videoFusion/"+this.options.videoId;return fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=13;break}if(!n.data.deviceCode.length){e.next=9;break}return e.abrupt("return",fetch(t+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:n.data.deviceCode}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var t=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.text();case 2:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=13;break}if(!i.data.flv||!i.data.flv.length){t.next=9;break}return t.abrupt("return",i.data.flv);case 9:console.warn("地址不存在");case 10:return t.abrupt("return");case 13:return console.warn(i.msg||i.message),t.abrupt("return");case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return e.abrupt("return");case 13:return console.warn(n.msg||n.message),e.abrupt("return");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}}]);var i,n}(gb);function kb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function _b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?kb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):kb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var xb=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.options=_b({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||h(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(t){var e=this;if("boolean"==typeof t){this.options.show=t;for(var i=function(i){e.objModelObject[i].load((function(){e.objModelObject[i].show=t}))},n=0;n<this.objModelObject.length;n++)i(n)}else console.error("参数必须为boolean")}},{key:"on",value:(t=o()(a.a.mark((function t(){var e,i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e="",e=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/source/obj":this.options.host+"/yjearth4.0/api/v1/source/obj",this.options.code&&(e=e+"?code="+this.options.code),t.next=5,fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(!(i=t.sent).ok){t.next=15;break}return this.objModelObject=[],t.next=10,i.json();case 10:for(this.list=t.sent.data,this.options.count&&(this.list=this.list.splice(0,this.options.count)),n=0;n<this.list.length;n++)(o=JSON.parse(this.list[n].detail)).host=this.options.host,(this.options.show||!1===this.options.show)&&(o.show=this.options.show),s=new wb(this.sdk,o),this.objModelObject.push(s);this._loaded=!0,this._loadEvent&&this._loadEvent();case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){for(var t=this,e=function(e){t.objModelObject[e].load((function(){t.objModelObject[e].remove()}))},i=0;i<this.objModelObject.length;i++)e(i)}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}}]);var t}();function Eb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Sb=function(t){function e(t,i){var n;if(k()(this,e),(n=Eb(this,e,[t,i])).viewer=t.viewer,n.options.show=!i.show&&!1!==i.show||i.show,n.options.positions=n.options.positions||[],n.options.data=n.options.data,n.options.gradient=i.gradient||{.9:"red",.8:"orange",.7:"yellow",.5:"blue",.3:"green"},n.entity={id:n.options.id},!n.options.positions||n.options.positions.length<3)n._error="最少需要三个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500});else{for(var o=[],s=0;s<n.options.positions.length;s++)o.push([n.options.positions[s].lng,n.options.positions[s].lat]);var a=turf.lineString(o),r=turf.bbox(a);n.bounds={west:r[0],south:r[1],east:r[2],north:r[3]},e.add(n)}return n}return qi()(e,t),x()(e,[{key:"remove",value:function(){this.viewer.entities.remove(this.entity),this.entity=null}},{key:"createHeatMap",value:function(t,e){var i=CesiumHeatmap.create(this.bounds,{backgroundColor:"rgba(0,0,0,0)",radius:20,maxOpacity:.5,minOpacity:0,blur:.75,gradient:this.options.gradient});return i.setWGS84Data(0,t,e),i}}],[{key:"add",value:function(t){var i=[];t.options.positions.forEach((function(t){i.push(t.lng,t.lat)}));var n=e.getData(t),o=t.createHeatMap(n.max,n.data);t.entity=new Cesium.Entity({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),material:o._heatmap._renderer.canvas,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,t.viewer.entities.add(t.entity)}},{key:"getData",value:function(t){var e=1e3,i=[];if(t.options.data&&Array.isArray(t.options.data)){for(var n=t.options.data[0].value,o=0;o<t.options.data.length;o++){var s=t.options.data[o].value;n=Math.max(n,s),i.push({x:t.options.data[o].lng,y:t.options.data[o].lat,value:s})}return{max:n,data:i}}for(var a=0;e--;){var r=Math.floor(1e3*Math.random());a=Math.max(a,r);var l={x:Math.random()*(t.bounds.east-t.bounds.west)+t.bounds.west,y:Math.random()*(t.bounds.north-t.bounds.south)+t.bounds.south,value:r};i.push(l)}return{max:a,data:i}}}])}(Mn);function Db(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}function Pb(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Mb(t,e,i){return t.set(Tb(t,e),i),i}function Ob(t,e){return t.get(Tb(t,e))}function Tb(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Nb=new WeakMap,Bb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),Pb(i=Db(this,e,[t,n]),Nb,void 0),i.options.id=n.id||i.randomString(),i.options.name=n.name||"漫游路径",i.options.points=n.points||[],i.options.repeat&&(i.options.repeat=Number(i.options.repeat)),i.Dialog=o,i}return qi()(e,t),x()(e,[{key:"repeat",get:function(){return this.options.repeat},set:function(t){if(this.options.repeat!=Number(t)&&(this.options.repeat=Number(t),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var e=this._DialogObject._element.content.querySelector("input[name='repeat']");e.checked=t===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(e.checked)}}},{key:"edit",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=44;break}return s=function(t){var e=l.getElementsByClassName("tr");e.length>0&&(e[e.length-1].querySelector("input[name='time']").disabled=void 0);var s=l.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(u+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(t.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),a.addEventListener("click",(function(t){if(t.target.parentNode===a){var i=l.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;n<e.length;n++)if(e[n]===a){o=n+1;break}}})),a.addEventListener("dblclick",(function(t){if(t.target.parentNode===a)for(var i=0;i<e.length;i++)if(e[i]===a){n.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(p[i].position.lng,p[i].position.lat,p[i].position.alt),orientation:p[i].orientation,duration:1});break}}));var r=a.getElementsByClassName("play")[0],c=a.getElementsByClassName("delete")[0],h=a.querySelector("input[name='time']");r.addEventListener("click",(function(){for(var t=0;t<e.length;t++)e[t]===c.parentNode.parentNode&&i.flyTo(t)})),c.addEventListener("click",(function(t){for(var n=0;n<e.length;n++)if(e[n]===c.parentNode.parentNode){if(p.splice(n,1),p[p.length-1].duration=0,i.options.points.splice(n,1),l.removeChild(a),o>n+1?(o--,e[o-1].className="tr active"):o==n+1&&(e.length==n&&(o-=1),0!=e.length&&(e[o-1].className="tr active")),e.length>0){var s=e[e.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),h.addEventListener("input",(function(e){f.checked=!1,t.duration=Number(h.value),t.duration<0&&(t.duration=0)})),h.addEventListener("blur",(function(){h.value=Number(Number(h.value).toFixed(2)),h.value<0&&(h.value=0)})),l.insertBefore(a,e[o]),o++,e[e.length-1].querySelector("input[name='time']").disabled="disabled"},t.next=8,new W(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=t.sent,t.next=11,this._DialogObject.init();case 11:for((r=document.createElement("div")).className="fly-roam",r.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" type="text" name="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">设置总时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">\n <span class="unit" style="top: 6px;">秒(s)</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">是否循环播放</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="add-point"><svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点</button>\n </div>\n <div class="col">\n <button class="modify-point"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>调整视点</button>\n </div>\n <div class="col">\n <button class="afreshPlay"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n <div class="col">\n <button class="cease"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>结束</button>\n </div>\n </div>\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">时长(s)</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(r),r.getElementsByTagName("*"),l=r.getElementsByClassName("table-body")[0],c=r.getElementsByClassName("table-empty")[0],u=0,p=new Proxy([],{set:function(t,e,i){return t[e]=i,t.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u<this.options.points.length;u++)p.push(this.options.points[u]),s(this.options.points[u]);(h=r.querySelector("input[name='name']")).value=this.name,h.addEventListener("input",(function(){g.name=h.value})),(d=document.createElement("button")).innerHTML="保存",d.addEventListener("click",(function(){g.name||(g.name="漫游路径",h.value=g.name);var t=[];p.map((function(e){t.push(e)})),g._DialogObject.close(),g.Dialog.confirmCallBack&&g.Dialog.confirmCallBack({id:g.options.id,name:g.name,points:t,repeat:g.repeat+""})})),this._DialogObject.footAppChild(d),r.getElementsByClassName("cease")[0].addEventListener("click",(function(){n.camera.cancelFlight()})),r.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){p.length>0&&g.flyTo(0)})),r.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};p.splice(o,0,t),g.options.points.splice(o,0,t),s(t),u++})),r.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var t=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=p[o-1].position=t,g.options.points[o-1].orientation=p[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}}})),m=r.querySelector("input[name='totalTime']"),f=r.querySelector("input[name='isTotalTime']"),v=r.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var t=l.getElementsByClassName("tr");if(f.checked&&t.length>0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)p[i].duration=e,g.options.points[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),m.addEventListener("blur",(function(){var t=l.getElementsByClassName("tr");if(m.value=Number(m.value),m.value<0&&(m.value=0),f.checked&&t.length>0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)p[i].duration=e,g.options.points[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),v.checked=this.repeat===1/0,v.addEventListener("change",(function(){v.checked?g.repeat=1/0:g.repeat=0}));case 44:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"flyTo",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;ei(0);var i=this,n=this.options.points,s=this.repeat;Ye(i.sdk);var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;Ob(Nb,t)&&Ob(Nb,t).destroy();var l=t;Mb(Nb,t,new Cesium.ScreenSpaceEventHandler(l.sdk.viewer.canvas)),Ob(Nb,t).setInputAction((function(e){t.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=l.sdk.viewer;ei(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[e].position.lng,n[e].position.lat,n[e].position.alt),orientation:n[e].orientation,duration:i?n[e-1].duration:.5,maximumHeight:n[e].position.alt,complete:(c=o()(a.a.mark((function i(){return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e++,t.repeat===1/0?s=1/0:s===1/0&&(s=t.repeat),e<=n.length-1?r(e,!0):s?(s--,r(0)):Ob(Nb,t)&&Ob(Nb,t).destroy();case 3:case"end":return i.stop()}}),i)}))),function(){return c.apply(this,arguments)}),easingFunction:i?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})};r(e)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),Ob(Nb,this)&&Ob(Nb,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}(Mn);function Lb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ab=function(){return x()((function t(e,i,n){k()(this,t),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Lb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Lb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.viewer=i,this.viewer1=n,this.head=0,this.pitch=90,this.po=1e-5,this.position=null,this.hpr=null,this.currentFrustumOutline=null,this.frustum=null,this.setInterval1=null,this.webrtc=null,t.setDefaultValue(this),this.create()}),[{key:"create",value:function(){this.frustum=new Cesium.PerspectiveFrustum({fov:Cesium.Math.toRadians(this.options.fov),aspectRatio:this.options.aspectRatio,near:this.options.near,far:this.options.far});var t=this.options.position,e=t.lng,i=t.lat,n=t.alt,o=this.options,s=o.heading,a=o.pitch,r=o.roll;this.position=Cesium.Cartesian3.fromDegrees(e,i,n+this.options.normalHeight),this.hpr=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(s),Cesium.Math.toRadians(a),Cesium.Math.toRadians(r)),this.drawFrustumOutline(),this.drawFrustumFilled(),this.monitorKeyboard(),this.updateFrustumSquareBase(40),this.syncHpr(),this.options.videoUrl&&this.addVideoToFrustumTop2()}},{key:"monitorKeyboard",value:function(){var t=this,e={KeyQ:function(){return t.setIntervalhpr(-.45)},KeyE:function(){return t.setIntervalhpr(.45)},KeyB:function(){return t.setIntervalhprr(-.45)},KeyN:function(){return t.setIntervalhprr(.45)},KeyW:function(){return t.updateFrustumPosition("move",-1e-5)},KeyS:function(){return t.updateFrustumPosition("move",1e-5)},KeyA:function(){return t.updateFrustumPosition("move",-1e-5,0)},KeyD:function(){return t.updateFrustumPosition("move",1e-5,0)},KeyC:function(){return t.updateFrustumHeight(1)},KeyZ:function(){return t.updateFrustumHeight(-1)}};this.keydownHandler=function(t){e[t.code]&&e[t.code]()},this.keyupHandler=function(){return t.stopFrustumRotation()},document.addEventListener("keydown",this.keydownHandler),document.addEventListener("keyup",this.keyupHandler)}},{key:"addVideoToFrustumTop",value:function(){var t=this,e=document.createElement("video");if(e.width=640,e.height=360,e.autoplay=!0,e.loop=!0,e.muted=!0,document.body.appendChild(e),flvjs.isSupported()){var i=flvjs.createPlayer({type:"flv",isLive:!0,hasAudio:!1,enableStashBuffer:!0,enableWorker:!0,autoCleanupSourceBuffer:!0,url:this.options.videoUrl});i.attachMediaElement(e),i.load(),i.play()}else console.error("FLV.js is not supported in this browser.");var n=this.computeFrustumCorners(this.frustum,this.position,this.hpr),o=new Cesium.PolygonHierarchy([n.bottomLeft,n.bottomRight,n.topRight,n.topLeft]);this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:o}})),e.addEventListener("loadeddata",(function(){t.videoEntity.polygon.material=e}))}},{key:"addVideoToFrustumTop2",value:(e=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=document.createElement("video")).width=640,e.height=360,e.autoplay=!0,e.loop=!0,e.muted=!0,document.body.appendChild(e),t.next=9,this.startPlay(e,this.options.videoUrl);case 9:i=this.computeFrustumCorners(this.frustum,this.position,this.hpr),n=new Cesium.PolygonHierarchy([i.bottomLeft,i.bottomRight,i.topRight,i.topLeft]),this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:n}})),e.addEventListener("loadeddata",(function(){o.videoEntity.polygon.material=e}));case 13:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"startPlay",value:(t=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.webrtc&&this.webrtc.close(),this.webrtc=new SrsRtcWhipWhepAsync,e.srcObject=this.webrtc.stream,t.prev=3,t.next=6,this.webrtc.play(i);case 6:n=t.sent,console.log(n),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),this.webrtc.close();case 13:case"end":return t.stop()}}),t,this,[[3,10]])}))),function(e,i){return t.apply(this,arguments)})},{key:"computeFrustumCorners",value:function(t,e,i){var n=Math.tan(.5*t.fov),o=t.far*n,s=o*t.aspectRatio,a=new Cesium.Cartesian3(-s,o,-t.far),r=new Cesium.Cartesian3(s,o,-t.far),l=new Cesium.Cartesian3(-s,-o,-t.far),c=new Cesium.Cartesian3(s,-o,-t.far),u=Cesium.Transforms.headingPitchRollToFixedFrame(e,i);return{topLeft:Cesium.Matrix4.multiplyByPoint(u,a,new Cesium.Cartesian3),topRight:Cesium.Matrix4.multiplyByPoint(u,r,new Cesium.Cartesian3),bottomLeft:Cesium.Matrix4.multiplyByPoint(u,l,new Cesium.Cartesian3),bottomRight:Cesium.Matrix4.multiplyByPoint(u,c,new Cesium.Cartesian3)}}},{key:"updatePolygonPosition",value:function(){var t=this.computeFrustumCorners(this.frustum,this.position,this.hpr);this.videoEntity.polygon.hierarchy=new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy([t.bottomLeft,t.bottomRight,t.topRight,t.topLeft])}))}},{key:"updateFrustumSquareBase",value:function(t){var e=(56-t)/55*9900+100;this.frustum.aspectRatio=1;var i=Math.sqrt(e),n=this.frustum.far,o=2*Math.atan(i/(2*n));this.frustum.fov=o,this.drawFrustumOutline(),this.drawFrustumFilled(),this.syncHpr()}},{key:"updateFrustumHeight",value:function(t){var e=Cesium.Cartographic.fromCartesian(this.position);e.height+=t,this.position=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude),e.height),this.options.position.alt=e.height,this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updatePositionHeight",value:function(t){this.options.position=this.cartesian3Towgs84(t),this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"cartesian3Towgs84",value:function(t){var e=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"setIntervalhpr",value:function(t){var e=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){e.head+=t,e.updateFrustumHPR(Cesium.Math.toRadians(e.head),e.pitch)}),10)}},{key:"setIntervalhprr",value:function(t){var e=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){e.pitch=Math.max(60,Math.min(180,e.pitch+t)),e.updateFrustumHPR(e.head,Cesium.Math.toRadians(e.pitch))}),10)}},{key:"stopFrustumRotation",value:function(){this.setInterval1&&(clearInterval(this.setInterval1),this.setInterval1=null)}},{key:"drawFrustumFilled",value:function(){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),e=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))});this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4))}}),appearance:new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4)}),translucent:!0}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}},{key:"drawFrustumOutline",value:function(){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),e=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))});this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)}}),appearance:new Cesium.PolylineColorAppearance({translucent:!1}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline)}},{key:"updateFrustumPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move",e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("move"===t){var o=turf.point([this.options.position.lng,this.options.position.lat]),s=Cesium.Math.toDegrees(this.hpr.heading),a=s+i,r={units:"degrees"},l=turf.destination(o,e,a,r).geometry.coordinates;this.position=Cesium.Cartesian3.fromDegrees(l[0],l[1],this.options.position.alt+this.options.normalHeight),this.options.position.lng=l[0],this.options.position.lat=l[1],this.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(l[0],l[1],this.viewer.camera.positionCartographic.height)})}"update"===t&&(this.position=e,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var t=this.options.position,e=t.lng,i=t.lat,n=t.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(e,i,n+this.options.normalHeight),orientation:{heading:this.hpr.heading+Cesium.Math.toRadians(-90),pitch:o,roll:this.hpr.roll}})}}},{key:"updateFrustumHPR",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pitch,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";function s(t){return t*Math.PI/180}"alone"==o?(this.hpr.heading=s(t),this.hpr.pitch=s(e),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(t),this.hpr.pitch=Cesium.Math.negativePiToPi(e),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(t)try{var e=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))}),i=new Cesium.PolylineColorAppearance({translucent:!1}),n=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW),o=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))}),s=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.YELLOW.withAlpha(.5)}),translucent:!0}),a=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED.withAlpha(.5));this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:n}}),appearance:i,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:a}}),appearance:s,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}catch(t){console.error("Error in drawFrustum:",t)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(t,e){this.frustum.near=t,this.frustum.far=e,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(t){this.frustum.fov=Cesium.Math.toRadians(t),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.options.show=t,this.currentFrustumOutline.show=t,this.currentFrustumFilled.show=t)}},{key:"remove",value:function(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.videoEntity&&this.viewer.entities.remove(this.videoEntity)}}],[{key:"setDefaultValue",value:function(t){var e;t.options.position=t.options.position||{},t.options.fov=t.options.fov||30,t.options.aspectRatio=t.options.aspectRatio||1,t.options.near=t.options.near||1,t.options.far=t.options.far||120,t.options.heading=t.options.heading||0,t.options.pitch=t.options.pitch||90,t.options.roll=t.options.roll||0,t.options.show=null===(e=t.options.show)||void 0===e||e,t.options.videoUrl=t.options.videoUrl||"",t.options.index=t.options.index||0,t.options.arr=t.options.arr||[],t.options.normalHeight=t.options.normalHeight||100}}]);var t,e}();function jb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ib=function(){return x()((function t(e,i){k()(this,t),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?jb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):jb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.pointEntity=null,this.billboardEntity=null,this.lineEntity=null,this.updatedPosition=[],this.pointUpdatedPosition=[],this.viewer=i,this.handler=new Cesium.ScreenSpaceEventHandler(i.scene.canvas),this.pinBuilder=new Cesium.PinBuilder,this.index=null,t.setDefaultValue(this),t.init(this)}),[{key:"changeAltitude",value:function(){var t,e,i=!1,n=this,o=!1;document.addEventListener("keydown",(function(t){"h"===t.key&&(o=!0)})),document.addEventListener("keyup",(function(t){o=!1})),this.handler.setInputAction((function(o){var s=n.viewer.scene.pick(o.position);if(Cesium.defined(s)&&Cesium.defined(s.id)&&s.id===n.billboardEntity){i=!0,t=o.position;var a=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue());e=a.height}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction((function(s){if(i&&0==o){var a=n.viewer.scene.pickPosition(s.endPosition);if(n.disableCameraDrag(n.viewer,!1),a){var r=Cesium.Cartographic.fromCartesian(a),l=r.longitude,c=r.latitude,u=Cesium.Cartesian3.fromRadians(l,c,e),p=Cesium.Cartesian3.fromRadians(l,c,0);n.billboardEntity.position=new Cesium.CallbackProperty((function(){return u}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(l).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(c).toFixed(6),"\nAlt: ").concat(e.toFixed(2),"m"),n.pointEntity.position=new Cesium.CallbackProperty((function(){return p}),!1)}}if(i&&o){console.log(o);var h=s.endPosition,d=t.y-h.y,m=e+d,f=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue()),v=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(f.longitude),Cesium.Math.toDegrees(f.latitude),m);n.disableCameraDrag(n.viewer,!1),n.billboardEntity.position=new Cesium.CallbackProperty((function(){return v}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(f.longitude).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(f.latitude).toFixed(6),"\nAlt: ").concat(m.toFixed(2),"m")}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var e=n.viewer.scene.pick(t.position);i=!1,o=!1,n.disableCameraDrag(n.viewer,!0),Cesium.defined(e)&&Cesium.defined(e.id)&&e.id===n.billboardEntity&&(n.options.saveFun&&n.options.saveFun(null,!1),n.options.selectFun&&n.options.selectFun(n.billboardEntity.index-1),n.options.frustum.updatePositionHeight(n.billboardEntity.position.getValue()))}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"disableCameraDrag",value:function(t,e){t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableTilt=e,t.scene.screenSpaceCameraController.enableLook=e}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.pointEntity.show=t,this.billboardEntity.show=t,this.lineEntity.show=t)}},{key:"remove",value:function(){this.viewer.entities.remove(this.pointEntity),this.viewer.entities.remove(this.billboardEntity),this.viewer.entities.remove(this.lineEntity)}}],[{key:"setDefaultValue",value:function(t){var e;t.options.positions=t.options.positions||{},t.options.normalHeight=t.options.normalHeight||100,t.options.airHeight=t.options.airHeight||100,t.options.image=t.options.image||"/static/img/cluster2.png",t.options.show=t.options.show||!0,t.options.index=t.options.index||1,t.options.saveFun=t.options.saveFun||null,t.options.selectFun=t.options.selectFun||null,t.options.keyboard=null===(e=t.options.keyboard)||void 0===e||e,t.options.updateFrustumFun=t.options.updateFrustumFun||null,t.options.frustum=t.options.frustum||null}},{key:"init",value:function(t){var e=t.options.positions;t.pointEntity=t.viewer.entities.add({show:t.options.show,position:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,0),point:{pixelSize:8,color:Cesium.Color.WITHE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:0}});var i=t.pinBuilder.fromText(t.options.index,Cesium.Color.fromCssColorString("#00d590"),36).toDataURL(),n=0;n=e.altitude?e.altitude:t.options.normalHeight,t.billboardEntity=t.viewer.entities.add({show:t.options.show,position:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt+t.options.normalHeight),label:{text:"Lat: ".concat(e.lng.toFixed(8),"\nLon: ").concat(e.lat.toFixed(8),"\nAlt: ").concat(n.toFixed(8),"m"),font:"14px sans-serif",fillColor:Cesium.Color.YELLOW,outlineColor:Cesium.Color.BLACK,outlineWidth:2,pixelOffset:new Cesium.Cartesian2(0,-60),heightReference:Cesium.HeightReference.RELATIVE_TO_TERRAIN,show:!1},billboard:{image:i,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:36,height:36},index:t.options.index}),t.lineEntity=t.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return[t.pointEntity.position.getValue(),t.billboardEntity.position.getValue()]}),!1),width:1,material:new Cesium.PolylineOutlineMaterialProperty({outlineColor:Cesium.Color.GAINSBORO,outlineWidth:1,color:Cesium.Color.WITHE}),zIndex:99999999}}),t.options.keyboard&&t.changeAltitude(),t.handler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);Cesium.defined(i)&&Cesium.defined(i.id)&&i.id===t.billboardEntity&&t.options.selectFun&&t.options.selectFun(t.billboardEntity.index-1)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}])}();function Fb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Rb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var zb=function(){return x()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;k()(this,t),this.options=Rb({},e),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],t.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var t=this;if(!(this.options.positions.length<2)){var e=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var e=[],i=0;i<t.billordPointLineMaps.length;i++){var n=t.billordPointLineMaps[i];e.push(n.billboardEntity.position.getValue())}return e}),!1),width:3,material:Cesium.Color.fromCssColorString(this.options.color)}});for(var i=0;i<this.options.positions.length;i++){var n=this.options.positions[i];e&&i==this.index&&(this.frustum=new Ab({position:n,show:!1,arr:this.options.positions,index:i,normalHeight:this.options.normalHeight},this.viewer,this.viewer1));var o=new Ib({positions:n,index:i+1,saveFun:this.options.saveFun,selectFun:this.options.selectFun,keyboard:this.options.keyboard,updateFrustumFun:this.updateFrustumPosition,normalHeight:this.options.normalHeight,frustum:this.frustum,airHeight:this.options.airHeight},this.viewer);this.billordPointLineMaps.push(o)}this.onKey()}}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.frustum.currentFrustumOutline.show=t,this.billordPointLineMaps.forEach((function(e){e.show=t})),this.entity.show=t)}},{key:"onKey",value:function(){var t=this;document.addEventListener("keydown",(function(e){switch(e.key){case"ArrowUp":t.index+=1,t.updateFrustum(!0);break;case"ArrowDown":t.index-=1,t.updateFrustum(!1)}}))}},{key:"updateFrustum",value:function(t){if(console.log(this.index),this.index>this.options.positions.length-1||this.index<0){var e=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(e)}else for(var i=0;i<this.billordPointLineMaps.length;i++){var n=this.billordPointLineMaps[i];if(i==this.index){var o=n.billboardEntity.position.getValue();0!==this.index&&(this.direction(this.billordPointLineMaps[i-1].billboardEntity.position.getValue(),n.billboardEntity.position.getValue()).hpr,rn()("hpr")),0==this.index&&(this.direction(this.billordPointLineMaps[0].billboardEntity.position.getValue(),this.billordPointLineMaps[1].billboardEntity.position.getValue()).hpr,rn()("hpr")),o&&this.frustum.updateFrustumPosition("update",o)}}}},{key:"cartesian3Towgs84",value:function(t){var e=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"direction",value:function(t,e){var i=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),n=Cesium.Cartesian3.normalize(i,new Cesium.Cartesian3),o=Cesium.Transforms.rotationMatrixFromPositionVelocity(t,n,Cesium.Ellipsoid.WGS84),s=Cesium.Matrix4.fromRotationTranslation(o,t),a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Matrix4.getTranslation(s,new Cesium.Cartesian3),Cesium.Ellipsoid.WGS84,new Cesium.Matrix4),r=Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(a,new Cesium.Matrix4),s,new Cesium.Matrix4),l=Cesium.Matrix4.getMatrix3(r,new Cesium.Matrix3),c=Cesium.Quaternion.fromRotationMatrix(l),u=Cesium.HeadingPitchRoll.fromQuaternion(c);return u.pitch=90,{hpr:u,orientation:Cesium.Transforms.headingPitchRollQuaternion(t,u)}}},{key:"delPosition",value:function(t){this.options.positions.splice(t,1),this.remove(),this.create()}},{key:"getNewPositions",value:function(){for(var t=[],e=0;e<this.billordPointLineMaps.length;e++){var i=this.billordPointLineMaps[e],n=this.cartesian3Towgs84(i.billboardEntity.position.getValue());t.push(n)}return t}},{key:"remove",value:function(){this.billordPointLineMaps.forEach((function(t,e){t.remove()})),this.frustum&&this.frustum.remove(),this.viewer.entities.remove(this.entity),this.billordPointLineMaps=[]}},{key:"addPoint",value:function(t){this.options.positions=t,this.remove(),this.create()}},{key:"updateFrustumPosition",value:function(t){if(this.billordPointLineMaps&&0!==this.billordPointLineMaps.length){this.frustum&&(this.frustum.show=!0);var e=this.billordPointLineMaps[t].billboardEntity.position.getValue();if(0!==t){var i=t===this.billordPointLineMaps.length-1?this.billordPointLineMaps[t-1].billboardEntity.position.getValue():this.billordPointLineMaps[t+1].billboardEntity.position.getValue(),n=this.direction(t===this.billordPointLineMaps.length-1?i:e,t===this.billordPointLineMaps.length-1?e:i).hpr;this.frustum.updateFrustumHPR(n.heading,Cesium.Math.toRadians(this.frustum.pitch),n.roll)}else{var o=this.billordPointLineMaps[1].billboardEntity.position.getValue(),s=this.direction(e,o).hpr;this.frustum.updateFrustumHPR(s.heading,Cesium.Math.toRadians(this.frustum.pitch),s.roll)}e&&this.frustum.updateFrustumPosition("update",e);var a=this.cartesian3Towgs84(e);this.billordPointLineMaps.forEach((function(t){t.billboardEntity.label.show=!1}));var r=this.billordPointLineMaps.find((function(e){return e.billboardEntity.index==t+1}));return r&&(r.billboardEntity.label.show=!0),a}}},{key:"flyTo",value:function(){for(var t=[],e=0;e<this.options.positions.length;e++){var i=Cesium.Cartesian3.fromDegrees(this.options.positions[e].lng,this.options.positions[e].lat,this.options.positions[e].alt+this.options.height);t.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(t);this.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-80),roll:Cesium.Math.toRadians(0)}})}},{key:"countLength",value:function(){if(this.options.positions.length<2)return 0;var t=[];this.options.positions.forEach((function(e){t.push([e.lng,e.lat])}));var e=turf.lineString(t);return(1e3*turf.length(e)).toFixed(2)}},{key:"countTime",value:function(){var t=Math.floor(Number(this.countLength()))/this.options.speed,e=Math.floor(t%60);return Math.floor(t/60)+"分"+e+"秒"}}],[{key:"setDefaultValue",value:function(t){var e,i;t.options.positions=t.options.positions||[],t.options.show=t.options.show||!0,t.options.color=t.options.color||"#00d590",t.options.height=t.options.height||500,t.options.speed=t.options.speed||1,t.options.frustumShow=null===(e=t.options.frustumShow)||void 0===e||e,t.options.saveFun=t.options.saveFun||null,t.options.selectFun=t.options.selectFun||null,t.options.keyboard=null===(i=t.options.keyboard)||void 0===i||i,t.options.normalHeight=t.options.normalHeight||100,t.options.airHeight=t.options.airHeight||100}}])}();function Hb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Vb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=Hb(this,e,[t,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return qi()(e,t),x()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z(this.options.tipText,this.sdk),this.event=new X(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer),a=e.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(e.isEntity=!0),t(null,s,e.isEntity)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(Ys);function Gb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ub(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Wb(t,e,i){return e=Yi()(e),Ui()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],Yi()(t).constructor):e.apply(t,i))}var Yb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Wb(this,e,[t,n])).viewer=i.sdk.viewer,i.options.name=n.name||"飞线",i.options.pointNumber=n.pointNumber||200,i.options.height=n.height||200,i.options.heightDifference=n.heightDifference||3e3,i.options.width=n.width||2,i.options.duration=n.duration||10,i.options.color=n.color||"rgba(255,255,255,1)",i.options.lineBackAlpha=n.lineBackAlpha||.05,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new pn,i._elms={},i.positionArea=[],i.positions=[],i.sdk.addIncetance(i.options.id,i),e.drawLine(i),i}return qi()(e,t),x()(e,[{key:"getRandomPointsInCesiumPolygon",value:function(t,e){var i=[],n=[],o=[];t.forEach((function(t){i.push(t.lng),n.push(t.lat),o.push([t.lng,t.lat])})),o.push([o[0][0],o[0][1]]);for(var s=Math.min.apply(Math,i),a=Math.max.apply(Math,i),r=Math.min.apply(Math,n),l=Math.max.apply(Math,n),c=[];c.length<e;){var u=s+Math.random()*(a-s),p=r+Math.random()*(l-r),h=turf.point([u,p]),d=turf.polygon([o]);if(turf.booleanPointInPolygon(h,d)){var m=Cesium.Cartesian3.fromDegrees(u,p),f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(m).height;c.push([u,p,f])}}return c}},{key:"getLine",value:function(t,e){var i;t.viewer.entities.getById(t.options.id)&&(t.viewer.entities.getById(t.options.id)._children.forEach((function(e){t.viewer.entities.remove(e)})),t.viewer.entities.remove(t.viewer.entities.getById(t.options.id))),i=t.viewer.entities.add(new Cesium.Entity({id:t.options.id,show:t.options.show})),e.forEach((function(e,n){var o=e,s=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),a=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]+t.options.height+Math.random()*t.options.heightDifference);t.viewer.entities.add({parent:i,id:t.options.id+"-"+(new Date).getTime()+n,polyline:{positions:[s,a],width:t.options.width,material:new Cesium.FlowLineMaterialProperty({color:t.options.color,duration:t.options.duration,lineBackAlpha:t.options.lineBackAlpha,num:0})}})}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=this.viewer.entities.getById(this.options.id);i&&i._children.forEach((function(e){e.polyline.material.color=Cesium.Color.fromCssColorString(t)})),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"pointNumber",get:function(){return this.options.pointNumber},set:function(t){if(this.options.pointNumber=t,this.viewer.entities.getById(this.options.id)){var e=this.getRandomPointsInCesiumPolygon(this.positionArea,this.options.pointNumber);this.positions=e,this.getLine(this,e)}}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;var e=this.viewer.entities.getById(this.options.id);e&&(e.show=t)}},{key:"heightDifference",get:function(){return this.options.heightDifference},set:function(t){this.options.heightDifference=t,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.width=t}))}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.material.duration=t}))}},{key:"lineBackAlpha",get:function(){return this.options.lineBackAlpha},set:function(t){this.options.lineBackAlpha=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.material.lineBackAlpha=t}))}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=19;break}return t.next=7,new Zi(this.sdk,this.originalOptions,{title:"飞线属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="飞线"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),be(s.sdk,s.options.id),re(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="flowLine-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">飞线数量</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="pointNumber">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="width">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n\n <div class="col">\n <span class="label">飞线高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="height">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线高度差</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="0" step="1" @model="heightDifference">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">单次运动时长(s)</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="999999999" min="1" step="1" @model="duration">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">轨迹透明度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="1" min="0.01" step="0.01" @model="lineBackAlpha">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("flowLine-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],t.next=19;break;case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.pointNumber=this.originalOptions.pointNumber,this.height=this.originalOptions.height,this.heightDifference=this.originalOptions.heightDifference,this.width=this.originalOptions.width,this.duration=this.originalOptions.duration,this.color=this.originalOptions.color,this.lineBackAlpha=this.originalOptions.lineBackAlpha)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.length>0&&void 0!==h[0]&&h[0],ei(0),Ye(this.sdk),Je(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Ub({},this.options.position):this.options.positions?r=Ub({},this.options.positions[0]):this.options.center?r=Ub({},this.options.center):this.options.start?r=Ub({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e});else{for(l=[],c=0;c<this.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.positions[c][0],this.positions[c][1],this.positions[c][2]+this.options.height+this.options.heightDifference/2),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getSphere",value:function(){var t=this;return new Promise((function(e){var i=setInterval((function(){var e=new Cesium.BoundingSphere;t.sdk.viewer._dataSourceDisplay.getBoundingSphere(t.viewer.entities.getById(t.options.id),!1,e)===Cesium.BoundingSphereState.DONE&&clearInterval(i)}),1e3)}))}},{key:"remove",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.entities.getById(this.options.id)&&(this.viewer.entities.getById(this.options.id)._children.forEach((function(t){e.viewer.entities.remove(t)})),this.viewer.entities.remove(this.viewer.entities.getById(this.options.id))),this.positions=[],this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,be(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){new Zs(t.sdk).start((function(e,i){t.positionArea=i;var n=t.getRandomPointsInCesiumPolygon(i,t.options.pointNumber);t.positions=n,t.getLine(t,n),t.edit(!0)}))}},{key:"drawLine",value:function(t){t.positionArea=t.options.positions;var e=t.getRandomPointsInCesiumPolygon(t.options.positions,t.options.pointNumber);t.positions=e,t.getLine(t,e)}}]);var i,n,s}(Mn);function Jb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var qb=function(){return x()((function t(e,i){k()(this,t),this.sdk=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Jb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Jb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.progress=document.getElementById("progress"),this.handle=document.getElementById("handle"),this.timeline=document.getElementsByClassName("timeline-container")[0],this.currentTime=document.getElementById("currentTime"),this.timelineCon=document.getElementsByClassName("timeline-container")[0],this.speed=i,this.animationId,this.startTime=Date.now(),this.manualPosition=null,this.isDragging=!1,this.pauseed=!1,this.time="",this.update=this.update.bind(this),t.init(this)}),[{key:"moveComplay",value:function(t){var e=this;e.timeline.addEventListener("mouseup",(function(){e.isDragging=!1,null!==e.manualPosition&&(e.startTime=Date.now()-86400*e.manualPosition*1e3/e.speed,e.manualPosition=null,e.changeDate&&(e.changeDateGrag=!0),e.pauseed?(e.pausedTime=Date.now(),t(e.currentTime.textContent)):(e.update(),t(e.time)))}))}},{key:"formatTime",value:function(t){var e=Math.floor(t/3600).toString().padStart(2,"0"),i=Math.floor(t%3600/60).toString().padStart(2,"0"),n=Math.floor(t%60).toString().padStart(2,"0");return"".concat(e,":").concat(i,":").concat(n)}},{key:"update",value:function(){if(null===this.manualPosition){this.changeDate&&(this.startTime=Date.now());var t=(Date.now()-this.startTime)*this.speed/1e3%86400,e=t/86400;this.progress.style.width="".concat(100*e,"%"),this.time=this.formatTime(t),this.currentTime.textContent=this.time,this.pauseed||(this.animationId&&cancelAnimationFrame(this.animationId),this.animationId=requestAnimationFrame(this.update))}}},{key:"setSpeed",value:function(t){if(this.pauseed){var e,i=Date.now()-this.pausedTime;this.startTime+=i;var n=null!==(e=this.manualPosition)&&void 0!==e?e:(Date.now()-this.startTime)*this.speed/864e5;this.speed=t,this.startTime=Date.now()-86400*n*1e3/this.speed,this.pausedTime=Date.now(),this.speed=t}else{var o,s=null!==(o=this.manualPosition)&&void 0!==o?o:(Date.now()-this.startTime)*this.speed/864e5;this.speed=t,this.startTime=Date.now()-86400*s*1e3/this.speed}this.manualPosition=null}},{key:"updateTime",value:function(){this.manualPosition=null,this.startTime=Date.now()-86400*(this.manualPosition||0)*1e3/this.speed,this.pauseed&&(this.changeDate=!0),this.changeDateGrag=void 0,this.update()}},{key:"clear",value:function(){this.animationId&&cancelAnimationFrame(this.animationId),this.progress.style.width="0%",this.currentTime.textContent="00:00:00"}}],[{key:"init",value:function(t){for(var e=0;e<=24;e++)if(e%6==0){var i=document.createElement("div");i.className="time-mark",i.textContent="".concat(e,":00"),i.style.left="".concat(e/24*100,"%"),document.getElementsByClassName("time-marks")[0].appendChild(i)}t.startTime=Date.now()-86400*(t.manualPosition||0)*1e3/t.speed,t.timeline.addEventListener("mousedown",(function(e){t.isDragging=!0,e.preventDefault()})),t.timeline.addEventListener("mousemove",(function(e){if(t.isDragging){var i=t.timeline.getBoundingClientRect(),n=(e.clientX-i.left)/i.width;n=Math.max(0,Math.min(1,n)),t.manualPosition=n,t.progress.style.width="".concat(100*n,"%");var o=86400*n;t.currentTime.textContent=t.formatTime(o)}})),t.update(),document.getElementById("timePause").addEventListener("click",(function(){if(t.pauseed=!t.pauseed,t.pauseed)document.getElementById("timePause").textContent="播放",t.animationId&&cancelAnimationFrame(t.animationId),t.pausedTime=Date.now(),t.sdk.viewer.clock.shouldAnimate=!1;else{document.getElementById("timePause").textContent="暂停",t.manualPosition=null;var e=Date.now()-t.pausedTime;t.startTime+=e,t.changeDate&&(t.changeDateGrag?t.changeDateGrag=void 0:t.startTime=Date.now(),t.changeDate=void 0),t.sdk.viewer.clock.shouldAnimate=!0,t.update()}}))}}])}();function Xb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Zb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Xb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Xb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Kb=function(){return x()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.viewer=e.viewer,this.options=Zb({},i),this.sdk=Zb({},e),this.options.time=i.time||new Date,this.options.speed=i.speed||1e3,this.options.darkness=i.darkness||.4,this.options.softShadow=i.softShadow||!0,this.options.show=!0===i.show,this.Dialog=n,this.timeLine,this._EventBinding=new pn,this._elms={},t.start(this)}),[{key:"darkness",get:function(){return this.options.darkness},set:function(t){this.options.darkness=t,this.viewer.shadowMap.darkness=1-this.options.darkness,this._elms.darkness&&this._elms.darkness.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.viewer.clock.multiplier=this.options.speed,this.timeLine.setSpeed(t)}},{key:"softShadow",get:function(){return this.options.softShadow},set:function(t){this.options.softShadow=t,this.viewer.shadowMap.softShadows=this.options.softShadow}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],i=new si,this.originalOptions=i.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return n=this,t.next=8,new Zi(this.sdk,this.originalOptions,{title:"光照属性",left:"180px",top:"100px",resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},closeCallBack:function(){u.reset(),n.remove(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()}},!0);case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" sun-shine-surface",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">播放倍数</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.01" max="999999" step="10" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">阴影柔和度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="1" step="0.1" @model="darkness">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">阴影优化</span>\n <input class="btn-switch" type="checkbox" @model="softShadow">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">日期选择</span>\n <input class="sunshine-date" type="text" placeholder="YYYY-MM-DD" @model="time">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="timeline-container">\n <div class="timeline" id="timeline">\n <div class="progress" id="progress">\n <div class="handle" id="handle"></div>\n <div class="current-time" id="currentTime">00:00:00</div>\n </div>\n </div>\n <div class="time-marks">\n </div>\n <button id="timePause">暂停</button>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(o),s=this,this.timeLine=new qb(this.sdk,this.options.speed),this.timeLine.moveComplay((function(t){var e=s.time+" "+t;s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e)),s.viewer.scene.requestRender()})),l=o.getElementsByClassName("sunshine-date")[0],r=jeDate(l,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){this.time=t.val;var e=(new Date).setHours(0,0,0,0);s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e)),s.timeLine.updateTime(e)}}),this.time?r.setValue(this.time):(r.nowBtn&&r.nowBtn(),this.time=r.getValue()),c=o.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[r],t.next=25;break;case 25:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.time=this.originalOptions.time,this.speed=this.originalOptions.speed,this.darkness=this.originalOptions.darkness)}},{key:"flyTo",value:(e=o()(a.a.mark((function t(){var e=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:!(e.length>0&&void 0!==e[0])||e[0];case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"remove",value:(t=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.scene.globe.enableLighting=!1,this.viewer.shadows=!1,this.viewer.clock.multiplier=1,this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date),this.entity=null,this.timeLine.clear(),this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=9,be(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"start",value:function(t){t.viewer.scene.globe.enableLighting=!0,t.viewer.shadows=!0,t.viewer.scene.globe.enableLighting=!0,t.viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,t.viewer.shadowMap.darkness=1-t.options.darkness;var e=new Date;e.setHours(0,0,0,0),t.viewer.clock.currentTime=Cesium.JulianDate.fromDate(e),t.viewer.clock.multiplier=t.options.speed,t.viewer.shadowMap.softShadows=t.options.softShadow,t.edit(!0)}}]);var t,e,i}(),$b=Symbol("测量状态"),Qb=(Symbol("录屏对象"),{on:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isc:!1,excel:!1,flv:!1,rtsp:!1,hls:!1,host:"",username:"",password:""};return new Promise((function(e,i){var n=f(),o=["/custom/css/index.css","/arrow/algorithm.js","/arrow/plotUtil.js","/3rdparty/turf.min.js","/3rdparty/fabric.min.js","/3rdparty/proj4.js","/3rdparty/pako.min.js","/3rdparty/heatmap.js","/3rdparty/tween.umd.js","/Cesium/Cesium.js","/Cesium/Widgets/widgets.css","/3rdparty/ewPlugins.min.js","/3rdparty/wangeditor/index.js","/3rdparty/wangeditor/style.css","/3rdparty/html2canvas.min.js","/3rdparty/kriging.js","/3rdparty/echarts.min.js","/3rdparty/clipboard.min.js","/3rdparty/libgif.js","/3rdparty/liveplayer/liveplayer-element.min.js","/3rdparty/jedate/jedate.min.js","/3rdparty/jedate/skin/jedate.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",t.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(t.flv||t.rtsp)&&o.push("/3rdparty/flv.min.js");var s=document.createElement("script");s.setAttribute("type","module"),s.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(s);var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(a);var r=[];o.forEach((function(t){var e;t.endsWith(".js")?((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src",n+t)):((e=document.createElement("link")).setAttribute("rel","stylesheet"),e.setAttribute("href",n+t)),document.querySelector("html").appendChild(e);var i=new Promise((function(t,i){e.onload=function(){t()}})).then((function(t){return t}));r.push(i)})),Promise.all(r).then((function(i){var o,s;(o=document.createElement("script")).setAttribute("type","text/javascript"),o.setAttribute("src",n+"/3rdparty/viewerCesiumNavigationMixin.min.js"),document.querySelector("html").appendChild(o),o.onload=function(){p(t.host),t.username?c(t).then((function(t){e()})):e()},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(t){i(t)}))}))},Obj:{ArcgisWXImagery:al,ArcgisBLUEImagery:rl,ArcgisLWImagery:ll,GDLWImagery:pl,GDWXImagery:hl,GDSLImagery:dl,Tileset:Al,BIM:Yl,Layer:kc,Layer3rdparty:xc,Terrain:Ac,Flame:Uc,Smoke:Qc,Fountain:lu,Spout:fu,WaterSurface:fh,CircleDiffuse:qn,CircleObject:ap,EllipseObject:dp,RadarScan:eo,RadarScanStereoscopic:th,SectorObject:rh,WallStereoscopic:kp,WallRealStereoscopic:Np,KML:ch,GeoJson:ph,BillboardObject:ro,PolygonObject:fo,PolyhedronObject:Eu,AssembleObject:Nu,AttackArrowObject:Ru,PincerArrowObject:Yu,StraightArrowObject:Qu,PolylineObject:Bo,CurvelineObject:Gp,Explosion:Jp,Model:uc,Model2:yc,TrajectoryMotion:Th,TrajectoryMotionObject:Hh,Graffiti:Gh,GroundImage:Jh,GroundSvg:Ey,RoutePlanning:Oy,Shp:Vy,Vector:rb,GroundText:pb,StandText:db,RichText:Cn,LocateCurrent:Vs,LoadObjModel:gb,Heatmap:Sb,FlyRoam:Bb,newAirLine:zb,FRUSTUN:Ab,Dialog:Zi,FlowLine:Yb},YJEarth:Fi,Tools:si,Proj:F,Global:{getCurrentView:function(t){var e=new si,i=t.viewer;return JSON.parse(JSON.stringify({position:e.cartesian3Towgs84(i.camera.position,i),orientation:{heading:Cesium.Math.toDegrees(i.camera.heading),pitch:Cesium.Math.toDegrees(i.camera.pitch),roll:Cesium.Math.toDegrees(i.camera.roll)}}))},setDefaultView:function(t,e){var i=t.viewer;e?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:e.destination||{},orientation:e.orientation||{}}:(i.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2))},switchCluster:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.viewer,n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].clustering.enabled=e;break}},openLeftClick:pt,closeLeftClick:ht,closeRightClick:function(){ot&&(ot.destroy(),ot=null)},openRightClick:function(t){t&&t.viewer&&(ot=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()){var i,n=t.viewer.scene.pick(e.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=rt.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(e,o.that.geojson.features[s].id,ct(ut(t,e),t.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,rt.has(i)){var a=rt.get(i);if(a.that.picking){var r=ut(t,e);if(!r)return;a.callback(e,i,ct(r,t.viewer),a.that)}}if(n&&n.content&&rt.has(n.content.tileset.id)){var l=rt.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(t)){var c=ut(t,e);if(!c)return;l.callback(e,n.getProperty("id"),ct(c,t.viewer),l.that)}}else{var u=ut(t,e);if(!u)return;l.callback(e,n.content.tileset.id,ct(u,t.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)},openMove:function(t){(st=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){t.viewer.scene.pick(e.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},closeMove:function(){st&&(st.destroy(),st=null)},ScreenRecord:{start:function(){return function(){if(YJ.Global.ScreenRecord.screenRecord)return"录屏任务进行中";YJ.Global.ScreenRecord.screenRecord=new Vi}()},stop:function(){YJ.Global.ScreenRecord&&YJ.Global.ScreenRecord.screenRecord&&YJ.Global.ScreenRecord.screenRecord&&(YJ.Global.ScreenRecord.screenRecord.mediaRecorder.stop(),YJ.Global.ScreenRecord.screenRecord=null)},screenRecord:null},MapX:{open:function(t){if(ns.viewer){ns.viewer.container.style.display="block";for(var e=ns.viewer.entities.values,i=0;i<e.length;i++)if("mapX rectangle"===e[i].name){e[i];break}t.viewer.scene.preRender.addEventListener(ls,rs)}else!function(t){Fo=new si;var e=document.createElement("div");e.id="mapxDiv",e.style.width="222px",e.style.height="112px",e.style.position="absolute",e.style.right="10px",e.style.bottom="82px",e.style.zIndex="1",document.getElementById(t.div_id).appendChild(e);var i={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),sceneMode:Cesium.SceneMode.SCENE2D,baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0};ns.viewer=new Cesium.Viewer("mapxDiv",i),ns.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(0,0,4e7)}),ns.viewer.trackedEntity=void 0,ns.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),ns.viewer.scene.screenSpaceCameraController.enableRotate=!1,ns.viewer.scene.screenSpaceCameraController.enableTranslate=!1,ns.viewer.scene.screenSpaceCameraController.enableZoom=!1,ns.viewer.scene.screenSpaceCameraController.enableTilt=!1,ns.viewer.scene.screenSpaceCameraController.enableLook=!1;var n,o=ns.viewer.entities.add({name:"mapX rectangle",position:new Cesium.CallbackProperty((function(){return ss||Cesium.Cartesian3.fromDegrees(0,0,0)}),!1),rectangle:{coordinates:new Cesium.CallbackProperty((function(){return os||Cesium.Rectangle.fromDegrees(0,0,.01,.01)}),!1),material:Cesium.Color.RED.withAlpha(.01),outline:!0,outlineColor:Cesium.Color.RED,outlineWidth:2,height:1},billboard:{image:Fo.getSourceRootPath()+"/img/cross.svg",scale:1,width:16,height:16}});rs={sdk:t,entity:o},ns.viewer.camera.percentageChanged=.001,t.viewer.scene.preRender.addEventListener(ls,rs),(Ro=new X({viewer:ns.viewer})).mouse_left_down((function(t,e){as=!0,n=ns.viewer.scene.pick(t.position)})),Ro.mouse_left_up((function(t,e){as=!1})),Ro.mouse_move((function(e,i){if(n&&as){var o=Fo.cartesian3Towgs84(t.viewer.camera.position,t.viewer).alt,s=Fo.cartesian3Towgs84(i,ns.viewer);t.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(s.lng,s.lat,o),duration:0})}}))}(t)},close:function(t){if(ns.viewer){ns.viewer.container.style.display="none";for(var e=ns.viewer.entities.values,i=0;i<e.length;i++)if("mapX rectangle"===e[i].name){e[i];break}t.viewer.scene.preRender.removeEventListener(ls,rs)}}},ScreenShot:function(t){return on.apply(this,arguments)},ScreenShotHD:function(t){return sn.apply(this,arguments)},ExportKml:Ao,FlyRoam:{open:Go,close:function(){zo&&zo.close&&(zo.close(),zo=null)},flyTo:Wo,setRepeat:function(t){if(Ho!=Number(t)&&(Ho=Number(t),Vo=Ho,zo&&zo._element&&zo._element.content)){var e=zo._element.content.querySelector("input[name='repeat']");e.checked=t===1/0}},cease:Yo},flyTo:Re,efflect:{rain:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Jo&&t.viewer.scene.postProcessStages.remove(Jo),e&&(Jo=new Cesium.PostProcessStage({name:"rain",fragmentShader:Ko,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),t.viewer.scene.postProcessStages.add(Jo))},snow:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];qo&&t.viewer.scene.postProcessStages.remove(qo),e&&(qo=new Cesium.PostProcessStage({name:"snow",fragmentShader:$o,uniforms:{snowSize:2,snowSpeed:60}}),t.viewer.scene.postProcessStages.add(qo))},fog:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Xo&&t.viewer.scene.postProcessStages.remove(Xo),e&&(Xo=new Cesium.PostProcessStage({name:"fog",fragmentShader:Qo,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),t.viewer.scene.postProcessStages.add(Xo))},nightVision:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Zo&&t.viewer.scene.postProcessStages.remove(Zo),e&&(Zo=Cesium.PostProcessStageLibrary.createNightVisionStage(),t.viewer.scene.postProcessStages.add(Zo))},skyStarry:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.scene.skyAtmosphere.show=!e},illumination:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.shadows=e,t.viewer._shadows=e},Sunshine:Kb},CameraController:He,CesiumContainer:Ve,setBillboardDefaultUrl:Ge,getBillboardDefaultUrl:Ue,multiViewportMode:{on:function(t){return fe.apply(this,arguments)},off:ve,get2DView:Pe,getSdk:function(){return{sdkP:Ut,sdkD:Gt}}},MouseCoordinate:function(t,e){var i=new si(t);if(e){var n=function(){is=requestAnimationFrame(n),r()};ts&&ts.destroy(),ts=new X(t);var o,s,a={x:"",y:"",z:""};es?o=es:((o=document.createElement("div")).style.position="absolute",o.style["z-index"]=777,o.style.color="#ff0000",o.style.left="0px",o.style.top="0px",o.style.width="100%",o.style.height="100%",o.style["font-size"]="12px",o.style["pointer-events"]="none",o.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),o.style["background-size"]="200% 200%",es=o),t.viewer._element.appendChild(o),ts.mouse_move((function(t,e){s=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?cs(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):cs(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},t)}));var r=function(){if(s){var e=t.viewer._element.getElementsByTagName("canvas")[0],n=s.endPosition.x,r=s.endPosition.y,l=ts.getcartesian(s);if(o.style["background-position-x"]="".concat(-e.width+n+4,"px"),o.style["background-position-y"]="".concat(-e.height+r-2,"px"),l){var c=i.cartesian3Towgs84(l,t.viewer),u=$e();if("EPSG:4326"===u)a={x:c.lng,y:c.lat,z:c.alt},o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(n+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:").concat(c.lng.toFixed(6),"°</p><p style='margin: 0;'>维度:").concat(c.lat.toFixed(6),"°</p><p style='margin: 0;'>海拔:").concat(c.alt.toFixed(2)," m</p></div>");else{var p=i.convert([{x:c.lng,y:c.lat,z:c.alt}],"EPSG:4326",u);a=p.points[0],o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(n+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:").concat(a.x.toFixed(6),"</p><p style='margin: 0;'>y:").concat(a.y.toFixed(6),"</p><p style='margin: 0;'>z:").concat(a.z.toFixed(6),"</p></div>")}}else{var h=$e();o.innerHTML="EPSG:4326"===h?"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(n+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>"):"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(n+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:-</p><p style='margin: 0;'>y:-</p><p style='margin: 0;'>z:-</p></div>")}}};n()}else ts&&(ts.destroy(),ts=void 0),es&&(t.viewer._element.removeChild(es),es=void 0),is&&cancelAnimationFrame(is)},MouseRightMenu:et,setGroundCover:function(t,e){Ae=!!e,function(t){if(!t)return;for(var e=0;e<t.dataSources._dataSources.length;e++)if("sdk-dataSource1"===t.dataSources._dataSources[e].name){t.dataSources._dataSources[e].clustering._cluster();break}}(t.viewer)},getGroundCover:We,setBimPickStatus:function(t,e){t&&t.viewer&&(je[t.viewer._element.className]||(je[t.viewer._element.className]={}),je[t.viewer._element.className].status=e,je[t.viewer._element.className].MoveHandler&&je[t.viewer._element.className].MoveHandler.destroy(),e&&(je[t.viewer._element.className].MoveHandler=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas),je[t.viewer._element.className].MoveHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.endPosition),n=je[t.viewer._element.className].selectedId,o=t.entityMap.get(je[t.viewer._element.className].id);if(o&&o.features.has(n)){var s=o.features.get(n).features;for(var a in s)if(s[a].content._model){var r=s[a].customColor||Cesium.Color.fromCssColorString("#fff");s[a].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(r.red),",").concat(Cesium.Color.floatToByte(r.green),",").concat(Cesium.Color.floatToByte(r.blue),",").concat(r.alpha*(s[a].customAlpha||0===s[a].customAlpha?s[a].customAlpha:1),")"))}}if(i&&i.content)if("bim"===t.getIncetance(i.content.tileset.id).type){if(i.primitive&&i.primitive.id){var l=t.entityMap.get(i.primitive.id);if(n=i.getProperty("id"),l.features.has(n)){var c=l.features.get(n).features;for(var u in c)c[u].content._model&&(c[u].color=Cesium.Color.fromCssColorString("#ffeb3b"))}je[t.viewer._element.className].id=i.primitive.id,je[t.viewer._element.className].selectedId=n}}else i.primitive.id=null}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},getBimPickStatus:function(t){if(t&&t.viewer)return!!je[t.viewer._element.className]&&je[t.viewer._element.className].status},FlwStatusSwitch:qe,JwwStatusSwitch:Ze,rotateAround:function(t,e){if(t&&t.viewer)if(ei(0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY),t.entityMap.forEach((function(t){t.editObj&&t.editObj.destroy(),t.ControllerObject&&t.ControllerObject.destroy()})),Fe[t.viewer._element.className]||(Fe[t.viewer._element.className]={}),Fe[t.viewer._element.className].animate&&TWEEN.remove(Fe[t.viewer._element.className].animate),Fe[t.viewer._element.className].event&&Fe[t.viewer._element.className].event.destroy(),e){var i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),n=Cesium.Math.toDegrees(t.viewer.camera.heading),s=Cesium.Cartesian3.distance(t.viewer.camera.position,i);He(t,!1);var r=t.viewer.camera.pitch;Cesium.Math.toDegrees(r)<-89.99&&(r=Cesium.Math.toRadians(-89.99)),Fe[t.viewer._element.className].animate=new TWEEN.Tween({angle:n}).to({angle:n-360},3e4).easing(TWEEN.Easing.Linear.None).repeat(1/0).onUpdate(function(){var e=o()(a.a.mark((function e(n,o){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.viewer){e.next=3;break}return TWEEN.remove(Fe[t.viewer._element.className].animate),e.abrupt("return");case 3:t.viewer.camera.lookAt(i,new Cesium.HeadingPitchRange(Cesium.Math.toRadians(n.angle),r,s)),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);case 5:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start();var l=new X(t);Fe[t.viewer._element.className].event=l,l.mouse_left_down((function(){Fe[t.viewer._element.className].animate&&TWEEN.remove(Fe[t.viewer._element.className].animate),Fe[t.viewer._element.className].event&&Fe[t.viewer._element.className].event.destroy(),He(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}))}else He(t,!0)},getCoordinateSystem:$e,setCoordinateSystem:function(t,e){if(Le=e||"EPSG:4326",t&&t.viewer&&t.viewer._element){var i=t.viewer._element.getElementsByClassName("cesium-info")[0];if(Be&&i){var n=new si,o=t.proj,s=n.cartesian3Towgs84(Be,t.viewer);if("EPSG:4326"===Le)i.innerHTML="\n <span>经度:</span><span>".concat(Number(s.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(s.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(s.alt.toFixed(2)),"米</span>\n ");else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",Le);i.innerHTML="\n <span>x:</span><span>".concat(Number(a.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(a.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(a.points[0].z.toFixed(6)),"</span>\n ")}}}},DTH:Hi,cameraChanged:function(t,e){var i=new si;return t.viewer.camera.changed.addEventListener((function(n){e({position:i.cartesian3Towgs84(t.viewer.camera.position,t.viewer),orientation:{heading:t.viewer.camera.heading,pitch:t.viewer.camera.pitch,roll:t.viewer.camera.roll}})}))},setMaximumRequestsPerServer:function(t){"number"==typeof t&&(Cesium.RequestScheduler.maximumRequestsPerServer=t)},setKeyboardEventActive:function(t,e){t&&(t.viewer._disableKeyboardEvent=!e)},setSkin:function(t){document.documentElement.style.setProperty("--color-sdk-base","rgba(0, 55, 55, 1)")},getTheme:function(){return Q},setTheme:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=Array.from(Q[t].keys());e.forEach((function(e){document.documentElement.style.setProperty(e,Q[t].get(e))}))},getCesiumManageIndexexDBState:Qe,setCesiumManageIndexexDBState:ti,getCesiumIndexedDBMaxSize:function(){var t=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(t)||t<1073741824)&&(t=1073741824),t},setCesiumIndexedDBMaxSize:function(t){var e=Number(Number(t).toFixed(0));(isNaN(e)||e<1073741824)&&(e=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(e),localStorage.setItem("IndexedDBMaxSize",e)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e||0==e||(e=1),t.viewer.scene.globe.translucency.frontFaceAlpha=e},closeRotateAround:Ye,SheetIndexStatusSwitch:Ot,SheetIndexShangeScale:Tt,splitScreen:{on:function(t){return Xt.apply(this,arguments)},off:Zt,setActiveId:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(Vt=Array.isArray(t)?t:[t],zt&&Rt){var e=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(t&&0!==t.length){if(e&&i){for(var n=0,o=0,s=0;s<Vt.length;s++){var a=qt.get(Vt[s]);a||(a={P:!0,D:!1},qt.set(Vt[s],a)),a.P&&n++,a.D&&o++;var r=zt.entityMap.get(Vt[s]);Rt.entityMap.get(Vt[s]);r&&"terrain"!==r.type&&r.show?(e.style.display="unset",i.style.display="unset",e.checked=!1,i.checked=!1):(e.style.display="none",i.style.display="none")}n||o||n++,e.checked=!!n,i.checked=!!o}}else e&&i&&(e.style.display="none",i.style.display="none")}},getSdk:le},Contour:function(t){return Ns.apply(this,arguments)}},Measure:{GetMeasureStatus:function(){return Qb.Measure[$b]},SetMeasureStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Qb.Measure[$b]=t},Clear:function(){YJ.Measure.Measures.forEach((function(t){t.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:Ga,MeasureProjectionDistance:qa,MeasureSlopeDistance:Qa,MeasureTyArea:or,MeasureTdArea:cr,MeasureTriangle:hr,MeasureLocation:fr,MeasureHeight:yr,MeasureAngle:wr,MeasureAzimuth:xr},Draw:{DrawPolyline:Sr,DrawPolygon:Zs,DrawPoint:Pr,DrawCircle:Or,DrawElliptic:Nr,DrawAttackArrow:Lr,DrawPincerArrow:jr,DrawStraightArrow:Rr,DrawRect:Hr,DrawAssemble:Ur,DrawSector:Yr,DrawTakeOff:Vb},Analysis:{Clear:function(){YJ.Analysis.AnalysesResults.forEach((function(t){t.destroy()}))},CutFillAnalysis:Ks,Submerge:ea,ViewShed:sa,CircleViewShed:da,SlopeAspect:ga,Profile:ba,Visibility:wa,Contour:ka,Section:Sa,TerrainExcavation:Ma,Flat:La,AnalysesResults:[],SectionResults:[],ClearSection:function(){YJ.Analysis.SectionResults.forEach((function(t){t.destroy()}))}},CoordTransform:Zr,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(t){t.destroy()})),YJ.RoutePlanningArrays=[]}});window.YJ||(window.YJ=Qb,window.YJ.Obj.LoadObjModel=wb,window.YJ.Obj.BatchLoadObjModel=xb)}]); \ No newline at end of file + */()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Id=1014,Rd=1020,Fd=2400,zd=2401,Hd="srgb",Vd="srgb-linear",Gd="display-p3",Ud="display-p3-linear",Wd="linear",Yd="srgb",Jd="rec709",qd=7680,Xd=35044,Zd=2e3,Kd=2001,$d=function(){return _()((function t(){k()(this,t)}),[{key:"addEventListener",value:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}},{key:"hasEventListener",value:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}},{key:"removeEventListener",value:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}}},{key:"dispatchEvent",value:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,o=i.length;n<o;n++)i[n].call(this,t);t.target=null}}}}])}(),Qd=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],tm=Math.PI/180;Math.PI;function em(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Qd[255&t]+Qd[t>>8&255]+Qd[t>>16&255]+Qd[t>>24&255]+"-"+Qd[255&e]+Qd[e>>8&255]+"-"+Qd[e>>16&15|64]+Qd[e>>24&255]+"-"+Qd[63&i|128]+Qd[i>>8&255]+"-"+Qd[i>>16&255]+Qd[i>>24&255]+Qd[255&n]+Qd[n>>8&255]+Qd[n>>16&255]+Qd[n>>24&255]).toLowerCase()}function im(t,e,i){return Math.max(e,Math.min(i,t))}function nm(t,e){return(t%e+e)%e}function om(t,e,i){return(1-i)*t+i*e}function sm(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function am(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var rm=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t),t.prototype.isVector2=!0,this.x=e,this.y=i}),[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y}},{key:"cross",value:function(t){return this.x*t.y-this.y*t.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(im(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}},{key:"rotateAround",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=this.x-t.x,s=this.y-t.y;return this.x=o*i-s*n+t.x,this.y=o*n+s*i+t.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:case"end":return t.stop()}}),t,this)}))}])}(),lm=function(){return _()((function t(e,i,n,o,s,a,r,l,c){k()(this,t),t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(t,e,i,n,o,s,a,r,l){var c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=o,c[5]=r,c[6]=i,c[7]=s,c[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],p=i[2],h=i[5],d=i[8],m=n[0],f=n[3],v=n[6],g=n[1],y=n[4],b=n[7],C=n[2],w=n[5],k=n[8];return o[0]=s*m+a*g+r*C,o[3]=s*f+a*y+r*w,o[6]=s*v+a*b+r*k,o[1]=l*m+c*g+u*C,o[4]=l*f+c*y+u*w,o[7]=l*v+c*b+u*k,o[2]=p*m+h*g+d*C,o[5]=p*f+h*y+d*w,o[8]=p*v+h*b+d*k,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=c*s-a*l,p=a*r-c*o,h=l*o-s*r,d=e*u+i*p+n*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return t[0]=u*m,t[1]=(n*l-c*i)*m,t[2]=(a*i-n*s)*m,t[3]=p*m,t[4]=(c*e-n*r)*m,t[5]=(n*o-a*e)*m,t[6]=h*m,t[7]=(i*r-l*e)*m,t[8]=(s*e-i*o)*m,this}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}},{key:"getNormalMatrix",value:function(t){return this.setFromMatrix4(t).invert().transpose()}},{key:"transposeIntoArray",value:function(t){var e=this.elements;return 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],this}},{key:"setUvTransform",value:function(t,e,i,n,o,s,a){var r=Math.cos(o),l=Math.sin(o);return this.set(i*r,i*l,-i*(r*s+l*a)+s+t,-n*l,n*r,-n*(-l*s+r*a)+a+e,0,0,1),this}},{key:"scale",value:function(t,e){return this.premultiply(cm.makeScale(t,e)),this}},{key:"rotate",value:function(t){return this.premultiply(cm.makeRotation(-t)),this}},{key:"translate",value:function(t,e){return this.premultiply(cm.makeTranslation(t,e)),this}},{key:"makeTranslation",value:function(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}},{key:"makeRotation",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}},{key:"makeScale",value:function(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}},{key:"equals",value:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),cm=new lm;function um(t){for(var e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function pm(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}var hm={};function dm(t){t in hm||(hm[t]=!0,console.warn(t))}var mm,fm=(new lm).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vm=(new lm).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),gm=C()(C()(C()(C()({},Vd,{transfer:Wd,primaries:Jd,toReference:function(t){return t},fromReference:function(t){return t}}),Hd,{transfer:Yd,primaries:Jd,toReference:function(t){return t.convertSRGBToLinear()},fromReference:function(t){return t.convertLinearToSRGB()}}),Ud,{transfer:Wd,primaries:"p3",toReference:function(t){return t.applyMatrix3(vm)},fromReference:function(t){return t.applyMatrix3(fm)}}),Gd,{transfer:Yd,primaries:"p3",toReference:function(t){return t.convertSRGBToLinear().applyMatrix3(vm)},fromReference:function(t){return t.applyMatrix3(fm).convertLinearToSRGB()}}),ym=new Set([Vd,Ud]),bm={enabled:!0,_workingColorSpace:Vd,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!ym.has(t))throw new Error('Unsupported working color space, "'.concat(t,'".'));this._workingColorSpace=t},convert:function(t,e,i){if(!1===this.enabled||e===i||!e||!i)return t;var n=gm[e].toReference;return(0,gm[i].fromReference)(n(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return gm[t].primaries},getTransfer:function(t){return""===t?Wd:gm[t].transfer}};function Cm(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function wm(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var km=function(){return _()((function t(){k()(this,t)}),null,[{key:"getDataURL",value:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===mm&&(mm=pm("canvas")),mm.width=t.width,mm.height=t.height;var i=mm.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=mm}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}},{key:"sRGBToLinear",value:function(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var e=pm("canvas");e.width=t.width,e.height=t.height;var i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);for(var n=i.getImageData(0,0,t.width,t.height),o=n.data,s=0;s<o.length;s++)o[s]=255*Cm(o[s]/255);return i.putImageData(n,0,0),e}if(t.data){for(var a=t.data.slice(0),r=0;r<a.length;r++)a instanceof Uint8Array||a instanceof Uint8ClampedArray?a[r]=Math.floor(255*Cm(a[r]/255)):a[r]=Cm(a[r]);return{data:a,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}])}(),xm=0,_m=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;k()(this,t),this.isSource=!0,Object.defineProperty(this,"id",{value:xm++}),this.uuid=em(),this.data=e,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];var i={uuid:this.uuid,url:""},n=this.data;if(null!==n){var o;if(Array.isArray(n)){o=[];for(var s=0,a=n.length;s<a;s++)n[s].isDataTexture?o.push(Em(n[s].image)):o.push(Em(n[s]))}else o=Em(n);i.url=o}return e||(t.images[this.uuid]=i),i}}])}();function Em(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?km.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Sm=0,Dm=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:e.DEFAULT_ANISOTROPY,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return k()(this,e),(t=jd(this,e)).isTexture=!0,Object.defineProperty(Ld()(t),"id",{value:Sm++}),t.uuid=em(),t.name="",t.source=new _m(i),t.mipmaps=[],t.mapping=n,t.channel=0,t.wrapS=o,t.wrapT=s,t.magFilter=a,t.minFilter=r,t.anisotropy=u,t.format=l,t.internalFormat=null,t.type=c,t.offset=new rm(0,0),t.repeat=new rm(1,1),t.center=new rm(0,0),t.rotation=0,t.matrixAutoUpdate=!0,t.matrix=new lm,t.generateMipmaps=!0,t.premultiplyAlpha=!1,t.flipY=!0,t.unpackAlignment=4,t.colorSpace=p,t.userData={},t.version=0,t.onUpdate=null,t.isRenderTargetTexture=!1,t.pmremVersion=0,t}return sn()(e,t),_()(e,[{key:"image",get:function(){return this.source.data},set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=t}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}},{key:"needsUpdate",set:function(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(t){!0===t&&this.pmremVersion++}}])}($d);Dm.DEFAULT_IMAGE=null,Dm.DEFAULT_MAPPING=300,Dm.DEFAULT_ANISOTROPY=1;var Pm=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),t.prototype.isVector4=!0,this.x=e,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}},{key:"set",value:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setW",value:function(t){return this.w=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"setAxisAngleFromQuaternion",value:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}},{key:"setAxisAngleFromRotationMatrix",value:function(t){var e,i,n,o,s=.01,a=.1,r=t.elements,l=r[0],c=r[4],u=r[8],p=r[1],h=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-p)<s&&Math.abs(u-m)<s&&Math.abs(d-f)<s){if(Math.abs(c+p)<a&&Math.abs(u+m)<a&&Math.abs(d+f)<a&&Math.abs(l+h+v-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var g=(l+1)/2,y=(h+1)/2,b=(v+1)/2,C=(c+p)/4,w=(u+m)/4,k=(d+f)/4;return g>y&&g>b?g<s?(i=0,n=.707106781,o=.707106781):(n=C/(i=Math.sqrt(g)),o=w/i):y>b?y<s?(i=.707106781,n=0,o=.707106781):(i=C/(n=Math.sqrt(y)),o=k/n):b<s?(i=.707106781,n=.707106781,o=0):(i=w/(o=Math.sqrt(b)),n=k/o),this.set(i,n,o,e),this}var x=Math.sqrt((f-d)*(f-d)+(u-m)*(u-m)+(p-c)*(p-c));return Math.abs(x)<.001&&(x=1),this.x=(f-d)/x,this.y=(u-m)/x,this.z=(p-c)/x,this.w=Math.acos((l+h+v-1)/2),this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:return t.next=8,this.w;case 8:case"end":return t.stop()}}),t,this)}))}])}(),Mm=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,e),(t=jd(this,e,[null])).isDataArrayTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return sn()(e,t),_()(e)}(Dm),Om=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,e),(t=jd(this,e,[null])).isData3DTexture=!0,t.image={data:i,width:n,height:o,depth:s},t.magFilter=1003,t.minFilter=1003,t.wrapR=1001,t.generateMipmaps=!1,t.flipY=!1,t.unpackAlignment=1,t}return sn()(e,t),_()(e)}(Dm),Tm=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),this.isQuaternion=!0,this._x=e,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t._x,n=t._y,o=t._z,s=t._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),p=r(i/2),h=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"YXZ":this._x=p*c*u+l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"ZXY":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u-p*h*d;break;case"ZYX":this._x=p*c*u-l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u+p*h*d;break;case"YZX":this._x=p*c*u+l*h*d,this._y=l*h*u+p*c*d,this._z=l*c*d-p*h*u,this._w=l*c*u-p*h*d;break;case"XZY":this._x=p*c*u-l*h*d,this._y=l*h*u-p*c*d,this._z=l*c*d+p*h*u,this._w=l*c*u+p*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=t.elements,i=e[0],n=e[4],o=e[8],s=e[1],a=e[5],r=e[9],l=e[2],c=e[6],u=e[10],p=i+a+u;if(p>0){var h=.5/Math.sqrt(p+1);this._w=.25/h,this._x=(c-r)*h,this._y=(o-l)*h,this._z=(s-n)*h}else if(i>a&&i>u){var d=2*Math.sqrt(1+i-a-u);this._w=(c-r)/d,this._x=.25*d,this._y=(n+s)/d,this._z=(o+l)/d}else if(a>u){var m=2*Math.sqrt(1+a-i-u);this._w=(o-l)/m,this._x=(n+s)/m,this._y=.25*m,this._z=(r+c)/m}else{var f=2*Math.sqrt(1+u-i-a);this._w=(s-n)/f,this._x=(o+l)/f,this._y=(r+c)/f,this._z=.25*f}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}},{key:"angleTo",value:function(t){return 2*Math.acos(Math.abs(im(this.dot(t),-1,1)))}},{key:"rotateTowards",value:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}},{key:"multiply",value:function(t){return this.multiplyQuaternions(this,t)}},{key:"premultiply",value:function(t){return this.multiplyQuaternions(t,this)}},{key:"multiplyQuaternions",value:function(t,e){var i=t._x,n=t._y,o=t._z,s=t._w,a=e._x,r=e._y,l=e._z,c=e._w;return this._x=i*c+s*a+n*l-o*r,this._y=n*c+s*r+o*a-i*l,this._z=o*c+s*l+i*r-n*a,this._w=s*c-i*a-n*r-o*l,this._onChangeCallback(),this}},{key:"slerp",value:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*t._w+i*t._x+n*t._y+o*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=i,this._y=n,this._z=o,this;var r=1-a*a;if(r<=Number.EPSILON){var l=1-e;return this._w=l*s+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*o+e*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),p=Math.sin((1-e)*u)/c,h=Math.sin(e*u)/c;return this._w=s*p+this._w*h,this._x=i*p+this._x*h,this._y=n*p+this._y*h,this._z=o*p+this._z*h,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(t,e,i){return this.copy(t).slerp(e,i)}},{key:"random",value:function(){var t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(t),n*Math.cos(t),o*Math.sin(e),o*Math.cos(e))}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}},{key:"fromBufferAttribute",value:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._w;case 8:case"end":return t.stop()}}),t,this)}))}],[{key:"slerpFlat",value:function(t,e,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],p=o[s+0],h=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return t[e+0]=r,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===a)return t[e+0]=p,t[e+1]=h,t[e+2]=d,void(t[e+3]=m);if(u!==m||r!==p||l!==h||c!==d){var f=1-a,v=r*p+l*h+c*d+u*m,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),C=Math.atan2(b,v*g);f=Math.sin(f*C)/b,a=Math.sin(a*C)/b}var w=a*g;if(r=r*f+p*w,l=l*f+h*w,c=c*f+d*w,u=u*f+m*w,f===1-a){var k=1/Math.sqrt(r*r+l*l+c*c+u*u);r*=k,l*=k,c*=k,u*=k}}t[e]=r,t[e+1]=l,t[e+2]=c,t[e+3]=u}},{key:"multiplyQuaternionsFlat",value:function(t,e,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],p=o[s+1],h=o[s+2],d=o[s+3];return t[e]=a*d+c*u+r*h-l*p,t[e+1]=r*d+c*p+l*u-a*h,t[e+2]=l*d+c*h+a*p-r*u,t[e+3]=c*d-a*u-r*p-l*h,t}}])}(),Nm=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;k()(this,t),t.prototype.isVector3=!0,this.x=e,this.y=i,this.z=n}),[{key:"set",value:function(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"add",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}},{key:"sub",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"multiplyVectors",value:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}},{key:"applyEuler",value:function(t){return this.applyQuaternion(Lm.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,e){return this.applyQuaternion(Lm.setFromAxisAngle(t,e))}},{key:"applyMatrix3",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[3]*i+o[6]*n,this.y=o[1]*e+o[4]*i+o[7]*n,this.z=o[2]*e+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(t){return this.applyMatrix3(t).normalize()}},{key:"applyMatrix4",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements,s=1/(o[3]*e+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*e+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*e+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*e+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.x,s=t.y,a=t.z,r=t.w,l=2*(s*n-a*i),c=2*(a*e-o*n),u=2*(o*i-s*e);return this.x=e+r*l+s*u-a*c,this.y=i+r*c+a*l-o*u,this.z=n+r*u+o*c-s*l,this}},{key:"project",value:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}},{key:"unproject",value:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}},{key:"transformDirection",value:function(t){var e=this.x,i=this.y,n=this.z,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n,this.y=o[1]*e+o[5]*i+o[9]*n,this.z=o[2]*e+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}},{key:"clampLength",value:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}},{key:"lerpVectors",value:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}},{key:"cross",value:function(t){return this.crossVectors(this,t)}},{key:"crossVectors",value:function(t,e){var i=t.x,n=t.y,o=t.z,s=e.x,a=e.y,r=e.z;return this.x=n*r-o*a,this.y=o*s-i*r,this.z=i*a-n*s,this}},{key:"projectOnVector",value:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}},{key:"projectOnPlane",value:function(t){return Bm.copy(this).projectOnVector(t),this.sub(Bm)}},{key:"reflect",value:function(t){return this.sub(Bm.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(im(i,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}},{key:"setFromSpherical",value:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}},{key:"setFromSphericalCoords",value:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}},{key:"setFromCylindricalCoords",value:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}},{key:"setFromMatrixPosition",value:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}},{key:"setFromMatrixScale",value:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(t,e){return this.fromArray(t.elements,4*e)}},{key:"setFromMatrix3Column",value:function(t,e){return this.fromArray(t.elements,3*e)}},{key:"setFromEuler",value:function(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}},{key:"setFromColor",value:function(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}},{key:"fromBufferAttribute",value:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.x;case 2:return t.next=4,this.y;case 4:return t.next=6,this.z;case 6:case"end":return t.stop()}}),t,this)}))}])}(),Bm=new Nm,Lm=new Tm,Am=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm(-1/0,-1/0,-1/0);k()(this,t),this.isBox3=!0,this.min=e,this.max=i}),[{key:"set",value:function(t,e){return this.min.copy(t),this.max.copy(e),this}},{key:"setFromArray",value:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e+=3)this.expandByPoint(Im.fromArray(t,e));return this}},{key:"setFromBufferAttribute",value:function(t){this.makeEmpty();for(var e=0,i=t.count;e<i;e++)this.expandByPoint(Im.fromBufferAttribute(t,e));return this}},{key:"setFromPoints",value:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}},{key:"setFromCenterAndSize",value:function(t,e){var i=Im.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}},{key:"setFromObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(t,e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.min.copy(t.min),this.max.copy(t.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(t){return this.min.min(t),this.max.max(t),this}},{key:"expandByVector",value:function(t){return this.min.sub(t),this.max.add(t),this}},{key:"expandByScalar",value:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this}},{key:"expandByObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.updateWorldMatrix(!1,!1);var i=t.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===e&&void 0!==n&&!0!==t.isInstancedMesh)for(var o=0,s=n.count;o<s;o++)!0===t.isMesh?t.getVertexPosition(o,Im):Im.fromBufferAttribute(n,o),Im.applyMatrix4(t.matrixWorld),this.expandByPoint(Im);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),Rm.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),Rm.copy(i.boundingBox)),Rm.applyMatrix4(t.matrixWorld),this.union(Rm)}for(var a=t.children,r=0,l=a.length;r<l;r++)this.expandByObject(a[r],e);return this}},{key:"containsPoint",value:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}},{key:"containsBox",value:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}},{key:"getParameter",value:function(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}},{key:"intersectsSphere",value:function(t){return this.clampPoint(t.center,Im),Im.distanceToSquared(t.center)<=t.radius*t.radius}},{key:"intersectsPlane",value:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}},{key:"intersectsTriangle",value:function(t){if(this.isEmpty())return!1;this.getCenter(Wm),Ym.subVectors(this.max,Wm),Fm.subVectors(t.a,Wm),zm.subVectors(t.b,Wm),Hm.subVectors(t.c,Wm),Vm.subVectors(zm,Fm),Gm.subVectors(Hm,zm),Um.subVectors(Fm,Hm);var e=[0,-Vm.z,Vm.y,0,-Gm.z,Gm.y,0,-Um.z,Um.y,Vm.z,0,-Vm.x,Gm.z,0,-Gm.x,Um.z,0,-Um.x,-Vm.y,Vm.x,0,-Gm.y,Gm.x,0,-Um.y,Um.x,0];return!!Xm(e,Fm,zm,Hm,Ym)&&(!!Xm(e=[1,0,0,0,1,0,0,0,1],Fm,zm,Hm,Ym)&&(Jm.crossVectors(Vm,Gm),Xm(e=[Jm.x,Jm.y,Jm.z],Fm,zm,Hm,Ym)))}},{key:"clampPoint",value:function(t,e){return e.copy(t).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return this.clampPoint(t,Im).distanceTo(t)}},{key:"getBoundingSphere",value:function(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Im).length()),t}},{key:"intersect",value:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(t){return this.min.min(t.min),this.max.max(t.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(jm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),jm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),jm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),jm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),jm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),jm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),jm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),jm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(jm)),this}},{key:"translate",value:function(t){return this.min.add(t),this.max.add(t),this}},{key:"equals",value:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}])}(),jm=[new Nm,new Nm,new Nm,new Nm,new Nm,new Nm,new Nm,new Nm],Im=new Nm,Rm=new Am,Fm=new Nm,zm=new Nm,Hm=new Nm,Vm=new Nm,Gm=new Nm,Um=new Nm,Wm=new Nm,Ym=new Nm,Jm=new Nm,qm=new Nm;function Xm(t,e,i,n,o){for(var s=0,a=t.length-3;s<=a;s+=3){qm.fromArray(t,s);var r=o.x*Math.abs(qm.x)+o.y*Math.abs(qm.y)+o.z*Math.abs(qm.z),l=e.dot(qm),c=i.dot(qm),u=n.dot(qm);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var Zm=new Am,Km=new Nm,$m=new Nm,Qm=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;k()(this,t),this.isSphere=!0,this.center=e,this.radius=i}),[{key:"set",value:function(t,e){return this.center.copy(t),this.radius=e,this}},{key:"setFromPoints",value:function(t,e){var i=this.center;void 0!==e?i.copy(e):Zm.setFromPoints(t).getCenter(i);for(var n=0,o=0,s=t.length;o<s;o++)n=Math.max(n,i.distanceToSquared(t[o]));return this.radius=Math.sqrt(n),this}},{key:"copy",value:function(t){return this.center.copy(t.center),this.radius=t.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(t){return t.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}},{key:"intersectsBox",value:function(t){return t.intersectsSphere(this)}},{key:"intersectsPlane",value:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(t,e){var i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}},{key:"getBoundingBox",value:function(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}},{key:"applyMatrix4",value:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}},{key:"translate",value:function(t){return this.center.add(t),this}},{key:"expandByPoint",value:function(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Km.subVectors(t,this.center);var e=Km.lengthSq();if(e>this.radius*this.radius){var i=Math.sqrt(e),n=.5*(i-this.radius);this.center.addScaledVector(Km,n/i),this.radius+=n}return this}},{key:"union",value:function(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):($m.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Km.copy(t.center).add($m)),this.expandByPoint(Km.copy(t.center).sub($m))),this)}},{key:"equals",value:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),tf=new Nm,ef=new Nm,nf=new Nm,of=new Nm,sf=new Nm,af=new Nm,rf=new Nm,lf=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm(0,0,-1);k()(this,t),this.origin=e,this.direction=i}),[{key:"set",value:function(t,e){return this.origin.copy(t),this.direction.copy(e),this}},{key:"copy",value:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}},{key:"at",value:function(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}},{key:"lookAt",value:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this}},{key:"recast",value:function(t){return this.origin.copy(this.at(t,tf)),this}},{key:"closestPointToPoint",value:function(t,e){e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(t){return Math.sqrt(this.distanceSqToPoint(t))}},{key:"distanceSqToPoint",value:function(t){var e=tf.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(tf.copy(this.origin).addScaledVector(this.direction,e),tf.distanceToSquared(t))}},{key:"distanceSqToSegment",value:function(t,e,i,n){ef.copy(t).add(e).multiplyScalar(.5),nf.copy(e).sub(t).normalize(),of.copy(this.origin).sub(ef);var o,s,a,r,l=.5*t.distanceTo(e),c=-this.direction.dot(nf),u=of.dot(this.direction),p=-of.dot(nf),h=of.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-p,r=l*d,(o=c*p-u)>=0)if(s>=-r)if(s<=r){var m=1/d;a=(o*=m)*(o+c*(s*=m)+2*u)+s*(c*o+s+2*p)+h}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-p),l))*(s+2*p)+h):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-p),l))*(s+2*p)+h;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*p)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(ef).addScaledVector(nf,s),a}},{key:"intersectSphere",value:function(t,e){tf.subVectors(t.center,this.origin);var i=tf.dot(this.direction),n=tf.dot(tf)-i*i,o=t.radius*t.radius;if(n>o)return null;var s=Math.sqrt(o-n),a=i-s,r=i+s;return r<0?null:a<0?this.at(r,e):this.at(a,e)}},{key:"intersectsSphere",value:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}},{key:"distanceToPlane",value:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}},{key:"intersectPlane",value:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}},{key:"intersectsPlane",value:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}},{key:"intersectBox",value:function(t,e){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,p=this.origin;return l>=0?(i=(t.min.x-p.x)*l,n=(t.max.x-p.x)*l):(i=(t.max.x-p.x)*l,n=(t.min.x-p.x)*l),c>=0?(o=(t.min.y-p.y)*c,s=(t.max.y-p.y)*c):(o=(t.max.y-p.y)*c,s=(t.min.y-p.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s<n||isNaN(n))&&(n=s),u>=0?(a=(t.min.z-p.z)*u,r=(t.max.z-p.z)*u):(a=(t.max.z-p.z)*u,r=(t.min.z-p.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r<n||n!=n)&&(n=r),n<0?null:this.at(i>=0?i:n,e)))}},{key:"intersectsBox",value:function(t){return null!==this.intersectBox(t,tf)}},{key:"intersectTriangle",value:function(t,e,i,n,o){sf.subVectors(e,t),af.subVectors(i,t),rf.crossVectors(sf,af);var s,a=this.direction.dot(rf);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}of.subVectors(this.origin,t);var r=s*this.direction.dot(af.crossVectors(of,af));if(r<0)return null;var l=s*this.direction.dot(sf.cross(of));if(l<0)return null;if(r+l>a)return null;var c=-s*of.dot(rf);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}},{key:"equals",value:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),cf=function(){function t(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v){k()(this,t),t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,i,n,o,s,a,r,l,c,u,p,h,d,m,f,v)}return _()(t,[{key:"set",value:function(t,e,i,n,o,s,a,r,l,c,u,p,h,d,m,f){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=n,v[1]=o,v[5]=s,v[9]=a,v[13]=r,v[2]=l,v[6]=c,v[10]=u,v[14]=p,v[3]=h,v[7]=d,v[11]=m,v[15]=f,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new t).fromArray(this.elements)}},{key:"copy",value:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}},{key:"copyPosition",value:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}},{key:"setFromMatrix3",value:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var e=this.elements,i=t.elements,n=1/uf.setFromMatrixColumn(t,0).length(),o=1/uf.setFromMatrixColumn(t,1).length(),s=1/uf.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*o,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromEuler",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.z,s=Math.cos(i),a=Math.sin(i),r=Math.cos(n),l=Math.sin(n),c=Math.cos(o),u=Math.sin(o);if("XYZ"===t.order){var p=s*c,h=s*u,d=a*c,m=a*u;e[0]=r*c,e[4]=-r*u,e[8]=l,e[1]=h+d*l,e[5]=p-m*l,e[9]=-a*r,e[2]=m-p*l,e[6]=d+h*l,e[10]=s*r}else if("YXZ"===t.order){var f=r*c,v=r*u,g=l*c,y=l*u;e[0]=f+y*a,e[4]=g*a-v,e[8]=s*l,e[1]=s*u,e[5]=s*c,e[9]=-a,e[2]=v*a-g,e[6]=y+f*a,e[10]=s*r}else if("ZXY"===t.order){var b=r*c,C=r*u,w=l*c,k=l*u;e[0]=b-k*a,e[4]=-s*u,e[8]=w+C*a,e[1]=C+w*a,e[5]=s*c,e[9]=k-b*a,e[2]=-s*l,e[6]=a,e[10]=s*r}else if("ZYX"===t.order){var x=s*c,_=s*u,E=a*c,S=a*u;e[0]=r*c,e[4]=E*l-_,e[8]=x*l+S,e[1]=r*u,e[5]=S*l+x,e[9]=_*l-E,e[2]=-l,e[6]=a*r,e[10]=s*r}else if("YZX"===t.order){var D=s*r,P=s*l,M=a*r,O=a*l;e[0]=r*c,e[4]=O-D*u,e[8]=M*u+P,e[1]=u,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=P*u+M,e[10]=D-O*u}else if("XZY"===t.order){var T=s*r,N=s*l,B=a*r,L=a*l;e[0]=r*c,e[4]=-u,e[8]=l*c,e[1]=T*u+L,e[5]=s*c,e[9]=N*u-B,e[2]=B*u-N,e[6]=a*c,e[10]=L*u+T}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose(hf,t,df)}},{key:"lookAt",value:function(t,e,i){var n=this.elements;return vf.subVectors(t,e),0===vf.lengthSq()&&(vf.z=1),vf.normalize(),mf.crossVectors(i,vf),0===mf.lengthSq()&&(1===Math.abs(i.z)?vf.x+=1e-4:vf.z+=1e-4,vf.normalize(),mf.crossVectors(i,vf)),mf.normalize(),ff.crossVectors(vf,mf),n[0]=mf.x,n[4]=ff.x,n[8]=vf.x,n[1]=mf.y,n[5]=ff.y,n[9]=vf.y,n[2]=mf.z,n[6]=ff.z,n[10]=vf.z,this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var i=t.elements,n=e.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],p=i[9],h=i[13],d=i[2],m=i[6],f=i[10],v=i[14],g=i[3],y=i[7],b=i[11],C=i[15],w=n[0],k=n[4],x=n[8],_=n[12],E=n[1],S=n[5],D=n[9],P=n[13],M=n[2],O=n[6],T=n[10],N=n[14],B=n[3],L=n[7],A=n[11],j=n[15];return o[0]=s*w+a*E+r*M+l*B,o[4]=s*k+a*S+r*O+l*L,o[8]=s*x+a*D+r*T+l*A,o[12]=s*_+a*P+r*N+l*j,o[1]=c*w+u*E+p*M+h*B,o[5]=c*k+u*S+p*O+h*L,o[9]=c*x+u*D+p*T+h*A,o[13]=c*_+u*P+p*N+h*j,o[2]=d*w+m*E+f*M+v*B,o[6]=d*k+m*S+f*O+v*L,o[10]=d*x+m*D+f*T+v*A,o[14]=d*_+m*P+f*N+v*j,o[3]=g*w+y*E+b*M+C*B,o[7]=g*k+y*S+b*O+C*L,o[11]=g*x+y*D+b*T+C*A,o[15]=g*_+y*P+b*N+C*j,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],o=t[12],s=t[1],a=t[5],r=t[9],l=t[13],c=t[2],u=t[6],p=t[10],h=t[14];return t[3]*(+o*r*u-n*l*u-o*a*p+i*l*p+n*a*h-i*r*h)+t[7]*(+e*r*h-e*l*p+o*s*p-n*s*h+n*l*c-o*r*c)+t[11]*(+e*l*u-e*a*h-o*s*u+i*s*h+o*a*c-i*l*c)+t[15]*(-n*a*c-e*r*u+e*a*p+n*s*u-i*s*p+i*r*c)}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}},{key:"setPosition",value:function(t,e,i){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}},{key:"invert",value:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],r=t[6],l=t[7],c=t[8],u=t[9],p=t[10],h=t[11],d=t[12],m=t[13],f=t[14],v=t[15],g=u*f*l-m*p*l+m*r*h-a*f*h-u*r*v+a*p*v,y=d*p*l-c*f*l-d*r*h+s*f*h+c*r*v-s*p*v,b=c*m*l-d*u*l+d*a*h-s*m*h-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*p+s*m*p+c*a*f-s*u*f,w=e*g+i*y+n*b+o*C;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/w;return t[0]=g*k,t[1]=(m*p*o-u*f*o-m*n*h+i*f*h+u*n*v-i*p*v)*k,t[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,t[3]=(u*r*o-a*p*o-u*n*l+i*p*l+a*n*h-i*r*h)*k,t[4]=y*k,t[5]=(c*f*o-d*p*o+d*n*h-e*f*h-c*n*v+e*p*v)*k,t[6]=(d*r*o-s*f*o-d*n*l+e*f*l+s*n*v-e*r*v)*k,t[7]=(s*p*o-c*r*o+c*n*l-e*p*l-s*n*h+e*r*h)*k,t[8]=b*k,t[9]=(d*u*o-c*m*o-d*i*h+e*m*h+c*i*v-e*u*v)*k,t[10]=(s*m*o-d*a*o+d*i*l-e*m*l-s*i*v+e*a*v)*k,t[11]=(c*a*o-s*u*o-c*i*l+e*u*l+s*i*h-e*a*h)*k,t[12]=C*k,t[13]=(c*m*n-d*u*n+d*i*p-e*m*p-c*i*f+e*u*f)*k,t[14]=(d*a*n-s*m*n-d*i*r+e*m*r+s*i*f-e*a*f)*k,t[15]=(s*u*n-c*a*n+c*i*r-e*u*r-s*i*p+e*a*p)*k,this}},{key:"scale",value:function(t){var e=this.elements,i=t.x,n=t.y,o=t.z;return e[0]*=i,e[4]*=n,e[8]*=o,e[1]*=i,e[5]*=n,e[9]*=o,e[2]*=i,e[6]*=n,e[10]*=o,e[3]*=i,e[7]*=n,e[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}},{key:"makeTranslation",value:function(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}},{key:"makeRotationY",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(t,e){var i=Math.cos(e),n=Math.sin(e),o=1-i,s=t.x,a=t.y,r=t.z,l=o*s,c=o*a;return this.set(l*s+i,l*a-n*r,l*r+n*a,0,l*a+n*r,c*a+i,c*r-n*s,0,l*r-n*a,c*r+n*s,o*r*r+i,0,0,0,0,1),this}},{key:"makeScale",value:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(t,e,i,n,o,s){return this.set(1,i,o,0,t,1,s,0,e,n,1,0,0,0,0,1),this}},{key:"compose",value:function(t,e,i){var n=this.elements,o=e._x,s=e._y,a=e._z,r=e._w,l=o+o,c=s+s,u=a+a,p=o*l,h=o*c,d=o*u,m=s*c,f=s*u,v=a*u,g=r*l,y=r*c,b=r*u,C=i.x,w=i.y,k=i.z;return n[0]=(1-(m+v))*C,n[1]=(h+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(h-b)*w,n[5]=(1-(p+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(p+m))*k,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}},{key:"decompose",value:function(t,e,i){var n=this.elements,o=uf.set(n[0],n[1],n[2]).length(),s=uf.set(n[4],n[5],n[6]).length(),a=uf.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],pf.copy(this);var r=1/o,l=1/s,c=1/a;return pf.elements[0]*=r,pf.elements[1]*=r,pf.elements[2]*=r,pf.elements[4]*=l,pf.elements[5]*=l,pf.elements[6]*=l,pf.elements[8]*=c,pf.elements[9]*=c,pf.elements[10]*=c,e.setFromRotationMatrix(pf),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(e-t),p=2*o/(i-n),h=(e+t)/(e-t),d=(i+n)/(i-n);if(l===Zd)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==Kd)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);a=-s/(s-o),r=-s*o/(s-o)}return c[0]=u,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=p,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=r,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(t,e,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(e-t),p=1/(i-n),h=1/(s-o),d=(e+t)*u,m=(i+n)*p;if(l===Zd)a=(s+o)*h,r=-2*h;else{if(l!==Kd)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*h,r=-1*h}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*p,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=r,c[14]=-a,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=t[i+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}])}(),uf=new Nm,pf=new cf,hf=new Nm(0,0,0),df=new Nm(1,1,1),mf=new Nm,ff=new Nm,vf=new Nm,gf=new cf,yf=new Tm,bf=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.DEFAULT_ORDER;k()(this,t),this.isEuler=!0,this._x=e,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}},{key:"set",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],p=n[6],h=n[10];switch(e){case"XYZ":this._y=Math.asin(im(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-im(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(im(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-im(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,h),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(im(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-im(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t,e,i){return gf.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gf,e,i)}},{key:"setFromVector3",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(t.x,t.y,t.z,e)}},{key:"reorder",value:function(t){return yf.setFromEuler(this),this.setFromQuaternion(yf,t)}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}},{key:"fromArray",value:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._x;case 2:return t.next=4,this._y;case 4:return t.next=6,this._z;case 6:return t.next=8,this._order;case 8:case"end":return t.stop()}}),t,this)}))}])}();bf.DEFAULT_ORDER="XYZ";var Cf=function(){return _()((function t(){k()(this,t),this.mask=1}),[{key:"set",value:function(t){this.mask=(1<<t|0)>>>0}},{key:"enable",value:function(t){this.mask|=1<<t|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(t){this.mask^=1<<t|0}},{key:"disable",value:function(t){this.mask&=~(1<<t|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(t){return 0!=(this.mask&t.mask)}},{key:"isEnabled",value:function(t){return 0!=(this.mask&(1<<t|0))}}])}(),wf=0,kf=new Nm,xf=new Tm,_f=new cf,Ef=new Nm,Sf=new Nm,Df=new Nm,Pf=new Tm,Mf=new Nm(1,0,0),Of=new Nm(0,1,0),Tf=new Nm(0,0,1),Nf={type:"added"},Bf={type:"removed"},Lf={type:"childadded",child:null},Af={type:"childremoved",child:null},jf=function(t){function e(){var t;k()(this,e),(t=jd(this,e)).isObject3D=!0,Object.defineProperty(Ld()(t),"id",{value:wf++}),t.uuid=em(),t.name="",t.type="Object3D",t.parent=null,t.children=[],t.up=e.DEFAULT_UP.clone();var i=new Nm,n=new bf,o=new Tm,s=new Nm(1,1,1);return n._onChange((function(){o.setFromEuler(n,!1)})),o._onChange((function(){n.setFromQuaternion(o,void 0,!1)})),Object.defineProperties(t,{position:{configurable:!0,enumerable:!0,value:i},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:o},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new cf},normalMatrix:{value:new lm}}),t.matrix=new cf,t.matrixWorld=new cf,t.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,t.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,t.matrixWorldNeedsUpdate=!1,t.layers=new Cf,t.visible=!0,t.castShadow=!1,t.receiveShadow=!1,t.frustumCulled=!0,t.renderOrder=0,t.animations=[],t.userData={},t}return sn()(e,t),_()(e,[{key:"onBeforeShadow",value:function(){}},{key:"onAfterShadow",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(t){return this.quaternion.premultiply(t),this}},{key:"setRotationFromAxisAngle",value:function(t,e){this.quaternion.setFromAxisAngle(t,e)}},{key:"setRotationFromEuler",value:function(t){this.quaternion.setFromEuler(t,!0)}},{key:"setRotationFromMatrix",value:function(t){this.quaternion.setFromRotationMatrix(t)}},{key:"setRotationFromQuaternion",value:function(t){this.quaternion.copy(t)}},{key:"rotateOnAxis",value:function(t,e){return xf.setFromAxisAngle(t,e),this.quaternion.multiply(xf),this}},{key:"rotateOnWorldAxis",value:function(t,e){return xf.setFromAxisAngle(t,e),this.quaternion.premultiply(xf),this}},{key:"rotateX",value:function(t){return this.rotateOnAxis(Mf,t)}},{key:"rotateY",value:function(t){return this.rotateOnAxis(Of,t)}},{key:"rotateZ",value:function(t){return this.rotateOnAxis(Tf,t)}},{key:"translateOnAxis",value:function(t,e){return kf.copy(t).applyQuaternion(this.quaternion),this.position.add(kf.multiplyScalar(e)),this}},{key:"translateX",value:function(t){return this.translateOnAxis(Mf,t)}},{key:"translateY",value:function(t){return this.translateOnAxis(Of,t)}},{key:"translateZ",value:function(t){return this.translateOnAxis(Tf,t)}},{key:"localToWorld",value:function(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(_f.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(t,e,i){t.isVector3?Ef.copy(t):Ef.set(t,e,i);var n=this.parent;this.updateWorldMatrix(!0,!1),Sf.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_f.lookAt(Sf,Ef,this.up):_f.lookAt(Ef,Sf,this.up),this.quaternion.setFromRotationMatrix(_f),n&&(_f.extractRotation(n.matrixWorld),xf.setFromRotationMatrix(_f),this.quaternion.premultiply(xf.invert()))}},{key:"add",value:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Nf),Lf.child=t,this.dispatchEvent(Lf),Lf.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}},{key:"remove",value:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var i=this.children.indexOf(t);return-1!==i&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(Bf),Af.child=t,this.dispatchEvent(Af),Af.child=null),this}},{key:"removeFromParent",value:function(){var t=this.parent;return null!==t&&t.remove(this),this}},{key:"clear",value:function(){return this.remove.apply(this,L()(this.children))}},{key:"attach",value:function(t){return this.updateWorldMatrix(!0,!1),_f.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),_f.multiply(t.parent.matrixWorld)),t.applyMatrix4(_f),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Nf),Lf.child=t,this.dispatchEvent(Lf),Lf.child=null,this}},{key:"getObjectById",value:function(t){return this.getObjectByProperty("id",t)}},{key:"getObjectByName",value:function(t){return this.getObjectByProperty("name",t)}},{key:"getObjectByProperty",value:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var o=this.children[i].getObjectByProperty(t,e);if(void 0!==o)return o}}},{key:"getObjectsByProperty",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[t]===e&&i.push(this);for(var n=this.children,o=0,s=n.length;o<s;o++)n[o].getObjectsByProperty(t,e,i);return i}},{key:"getWorldPosition",value:function(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sf,t,Df),t}},{key:"getWorldScale",value:function(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Sf,Pf,t),t}},{key:"getWorldDirection",value:function(t){this.updateWorldMatrix(!0,!1);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)}},{key:"traverseVisible",value:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}}},{key:"traverseAncestors",value:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++){var o=e[i];!0!==o.matrixWorldAutoUpdate&&!0!==t||o.updateMatrixWorld(t)}}},{key:"updateWorldMatrix",value:function(t,e){var i=this.parent;if(!0===t&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var n=this.children,o=0,s=n.length;o<s;o++){var a=n[o];!0===a.matrixWorldAutoUpdate&&a.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});var n={};function o(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((function(t){return{boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(t.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var r=0,l=a.length;r<l;r++){var c=a[r];o(t.shapes,c)}else o(t.shapes,a)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(o(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],p=0,h=this.material.length;p<h;p++)u.push(o(t.materials,this.material[p]));n.material=u}else n.material=o(t.materials,this.material);if(this.children.length>0){n.children=[];for(var d=0;d<this.children.length;d++)n.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(var m=0;m<this.animations.length;m++){var f=this.animations[m];n.animations.push(o(t.animations,f))}}if(e){var v=_(t.geometries),g=_(t.materials),y=_(t.textures),b=_(t.images),C=_(t.shapes),w=_(t.skeletons),k=_(t.animations),x=_(t.nodes);v.length>0&&(i.geometries=v),g.length>0&&(i.materials=g),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),C.length>0&&(i.shapes=C),w.length>0&&(i.skeletons=w),k.length>0&&(i.animations=k),x.length>0&&(i.nodes=x)}return i.object=n,i;function _(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}}},{key:"clone",value:function(t){return(new this.constructor).copy(this,t)}},{key:"copy",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}}])}($d);jf.DEFAULT_UP=new Nm(0,1,0),jf.DEFAULT_MATRIX_AUTO_UPDATE=!0,jf.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var If=new Nm,Rf=new Nm,Ff=new Nm,zf=new Nm,Hf=new Nm,Vf=new Nm,Gf=new Nm,Uf=new Nm,Wf=new Nm,Yf=new Nm,Jf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Nm;k()(this,t),this.a=e,this.b=i,this.c=n}return _()(t,[{key:"set",value:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}},{key:"setFromAttributeAndIndices",value:function(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}},{key:"getArea",value:function(){return If.subVectors(this.c,this.b),Rf.subVectors(this.a,this.b),.5*If.cross(Rf).length()}},{key:"getMidpoint",value:function(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return t.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,i){return t.getBarycoord(e,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(e,i,n,o,s){return t.getInterpolation(e,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(e){return t.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return t.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(t){return t.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(t,e){var i,n,o=this.a,s=this.b,a=this.c;Hf.subVectors(s,o),Vf.subVectors(a,o),Uf.subVectors(t,o);var r=Hf.dot(Uf),l=Vf.dot(Uf);if(r<=0&&l<=0)return e.copy(o);Wf.subVectors(t,s);var c=Hf.dot(Wf),u=Vf.dot(Wf);if(c>=0&&u<=c)return e.copy(s);var p=r*u-c*l;if(p<=0&&r>=0&&c<=0)return i=r/(r-c),e.copy(o).addScaledVector(Hf,i);Yf.subVectors(t,a);var h=Hf.dot(Yf),d=Vf.dot(Yf);if(d>=0&&h<=d)return e.copy(a);var m=h*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),e.copy(o).addScaledVector(Vf,n);var f=c*d-h*u;if(f<=0&&u-c>=0&&h-d>=0)return Gf.subVectors(a,s),n=(u-c)/(u-c+(h-d)),e.copy(s).addScaledVector(Gf,n);var v=1/(f+m+p);return i=m*v,n=p*v,e.copy(o).addScaledVector(Hf,i).addScaledVector(Vf,n)}},{key:"equals",value:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}],[{key:"getNormal",value:function(t,e,i,n){n.subVectors(i,e),If.subVectors(t,e),n.cross(If);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(t,e,i,n,o){If.subVectors(n,e),Rf.subVectors(i,e),Ff.subVectors(t,e);var s=If.dot(If),a=If.dot(Rf),r=If.dot(Ff),l=Rf.dot(Rf),c=Rf.dot(Ff),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var p=1/u,h=(l*r-a*c)*p,d=(s*c-a*r)*p;return o.set(1-h-d,d,h)}},{key:"containsPoint",value:function(t,e,i,n){return null!==this.getBarycoord(t,e,i,n,zf)&&zf.x>=0&&zf.y>=0&&zf.x+zf.y<=1}},{key:"getInterpolation",value:function(t,e,i,n,o,s,a,r){return null===this.getBarycoord(t,e,i,n,zf)?(r.x=0,r.y=0,"z"in r&&(r.z=0),"w"in r&&(r.w=0),null):(r.setScalar(0),r.addScaledVector(o,zf.x),r.addScaledVector(s,zf.y),r.addScaledVector(a,zf.z),r)}},{key:"isFrontFacing",value:function(t,e,i,n){return If.subVectors(i,e),Rf.subVectors(t,e),If.cross(Rf).dot(n)<0}}])}(),qf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xf={h:0,s:0,l:0},Zf={h:0,s:0,l:0};function Kf(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}var $f=function(){return _()((function t(e,i,n){return k()(this,t),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,i,n)}),[{key:"set",value:function(t,e,i){if(void 0===e&&void 0===i){var n=t;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(t,e,i);return this}},{key:"setScalar",value:function(t){return this.r=t,this.g=t,this.b=t,this}},{key:"setHex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hd;return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,bm.toWorkingColorSpace(this,e),this}},{key:"setRGB",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bm.workingColorSpace;return this.r=t,this.g=e,this.b=i,bm.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:bm.workingColorSpace;if(t=nm(t,1),e=im(e,0,1),i=im(i,0,1),0===e)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+e):i+e-i*e,s=2*i-o;this.r=Kf(s,o,t+1/3),this.g=Kf(s,o,t),this.b=Kf(s,o,t-1/3)}return bm.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hd;function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(e=/^(\w+)\(([^\)]*)\)/.exec(t)){var o,s=e[1],a=e[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,i);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,i);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){var r=e[1],l=r.length;if(3===l)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,i);if(6===l)return this.setHex(parseInt(r,16),i);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}},{key:"setColorName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hd,i=qf[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}},{key:"copySRGBToLinear",value:function(t){return this.r=Cm(t.r),this.g=Cm(t.g),this.b=Cm(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=wm(t.r),this.g=wm(t.g),this.b=wm(t.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hd;return bm.fromWorkingColorSpace(Qf.copy(this),t),65536*Math.round(im(255*Qf.r,0,255))+256*Math.round(im(255*Qf.g,0,255))+Math.round(im(255*Qf.b,0,255))}},{key:"getHexString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hd;return("000000"+this.getHex(t).toString(16)).slice(-6)}},{key:"getHSL",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bm.workingColorSpace;bm.fromWorkingColorSpace(Qf.copy(this),e);var i,n,o=Qf.r,s=Qf.g,a=Qf.b,r=Math.max(o,s,a),l=Math.min(o,s,a),c=(l+r)/2;if(l===r)i=0,n=0;else{var u=r-l;switch(n=c<=.5?u/(r+l):u/(2-r-l),r){case o:i=(s-a)/u+(s<a?6:0);break;case s:i=(a-o)/u+2;break;case a:i=(o-s)/u+4}i/=6}return t.h=i,t.s=n,t.l=c,t}},{key:"getRGB",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bm.workingColorSpace;return bm.fromWorkingColorSpace(Qf.copy(this),e),t.r=Qf.r,t.g=Qf.g,t.b=Qf.b,t}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hd;bm.fromWorkingColorSpace(Qf.copy(this),t);var e=Qf.r,i=Qf.g,n=Qf.b;return t!==Hd?"color(".concat(t," ").concat(e.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*e),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(t,e,i){return this.getHSL(Xf),this.setHSL(Xf.h+t,Xf.s+e,Xf.l+i)}},{key:"add",value:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}},{key:"addColors",value:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}},{key:"addScalar",value:function(t){return this.r+=t,this.g+=t,this.b+=t,this}},{key:"sub",value:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}},{key:"multiply",value:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}},{key:"multiplyScalar",value:function(t){return this.r*=t,this.g*=t,this.b*=t,this}},{key:"lerp",value:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}},{key:"lerpColors",value:function(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}},{key:"lerpHSL",value:function(t,e){this.getHSL(Xf),t.getHSL(Zf);var i=om(Xf.h,Zf.h,e),n=om(Xf.s,Zf.s,e),o=om(Xf.l,Zf.l,e);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}},{key:"applyMatrix3",value:function(t){var e=this.r,i=this.g,n=this.b,o=t.elements;return this.r=o[0]*e+o[3]*i+o[6]*n,this.g=o[1]*e+o[4]*i+o[7]*n,this.b=o[2]*e+o[5]*i+o[8]*n,this}},{key:"equals",value:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},{key:"fromBufferAttribute",value:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.r;case 2:return t.next=4,this.g;case 4:return t.next=6,this.b;case 6:case"end":return t.stop()}}),t,this)}))}])}(),Qf=new $f;$f.NAMES=qf;var tv=0,ev=function(t){function e(){var t;return k()(this,e),(t=jd(this,e)).isMaterial=!0,Object.defineProperty(Ld()(t),"id",{value:tv++}),t.uuid=em(),t.name="",t.type="Material",t.blending=1,t.side=0,t.vertexColors=!1,t.opacity=1,t.transparent=!1,t.alphaHash=!1,t.blendSrc=204,t.blendDst=205,t.blendEquation=100,t.blendSrcAlpha=null,t.blendDstAlpha=null,t.blendEquationAlpha=null,t.blendColor=new $f(0,0,0),t.blendAlpha=0,t.depthFunc=3,t.depthTest=!0,t.depthWrite=!0,t.stencilWriteMask=255,t.stencilFunc=519,t.stencilRef=0,t.stencilFuncMask=255,t.stencilFail=qd,t.stencilZFail=qd,t.stencilZPass=qd,t.stencilWrite=!1,t.clippingPlanes=null,t.clipIntersection=!1,t.clipShadows=!1,t.shadowSide=null,t.colorWrite=!0,t.precision=null,t.polygonOffset=!1,t.polygonOffsetFactor=0,t.polygonOffsetUnits=0,t.dithering=!1,t.alphaToCoverage=!1,t.premultipliedAlpha=!1,t.forceSinglePass=!1,t.visible=!0,t.toneMapped=!0,t.userData={},t.version=0,t._alphaTest=0,t}return sn()(e,t),_()(e,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE.Material: '".concat(e,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(e,"' has value of undefined."))}}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==qd&&(i.stencilFail=this.stencilFail),this.stencilZFail!==qd&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==qd&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){var o=n(t.textures),s=n(t.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=e[o].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}}])}($d),iv=function(t){function e(t){var i;return k()(this,e),(i=jd(this,e)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new $f(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.alphaMap=null,i.envMap=null,i.envMapRotation=new bf,i.combine=0,i.reflectivity=1,i.refractionRatio=.98,i.wireframe=!1,i.wireframeLinewidth=1,i.wireframeLinecap="round",i.wireframeLinejoin="round",i.fog=!0,i.setValues(t),i}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}])}(ev);!function(){for(var t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),n=new Uint32Array(512),o=new Uint32Array(512),s=0;s<256;++s){var a=s-127;a<-27?(n[s]=0,n[256|s]=32768,o[s]=24,o[256|s]=24):a<-14?(n[s]=1024>>-a-14,n[256|s]=1024>>-a-14|32768,o[s]=-a-1,o[256|s]=-a-1):a<=15?(n[s]=a+15<<10,n[256|s]=a+15<<10|32768,o[s]=13,o[256|s]=13):a<128?(n[s]=31744,n[256|s]=64512,o[s]=24,o[256|s]=24):(n[s]=31744,n[256|s]=64512,o[s]=13,o[256|s]=13)}for(var r=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64),u=1;u<1024;++u){for(var p=u<<13,h=0;0==(8388608&p);)p<<=1,h-=8388608;p&=-8388609,h+=947912704,r[u]=p|h}for(var d=1024;d<2048;++d)r[d]=939524096+(d-1024<<13);for(var m=1;m<31;++m)l[m]=m<<23;l[31]=1199570944,l[32]=2147483648;for(var f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(var v=1;v<64;++v)32!==v&&(c[v]=1024)}();var nv=new Nm,ov=new rm,sv=function(){return _()((function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(k()(this,t),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=i,this.count=void 0!==e?e.length/i:0,this.normalized=n,this.usage=Xd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}},{key:"updateRange",get:function(){return dm("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(t){return this.usage=t,this}},{key:"addUpdateRange",value:function(t,e){this.updateRanges.push({start:t,count:e})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}},{key:"copyAt",value:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,o=this.itemSize;n<o;n++)this.array[t+n]=e.array[i+n];return this}},{key:"copyArray",value:function(t){return this.array.set(t),this}},{key:"applyMatrix3",value:function(t){if(2===this.itemSize)for(var e=0,i=this.count;e<i;e++)ov.fromBufferAttribute(this,e),ov.applyMatrix3(t),this.setXY(e,ov.x,ov.y);else if(3===this.itemSize)for(var n=0,o=this.count;n<o;n++)nv.fromBufferAttribute(this,n),nv.applyMatrix3(t),this.setXYZ(n,nv.x,nv.y,nv.z);return this}},{key:"applyMatrix4",value:function(t){for(var e=0,i=this.count;e<i;e++)nv.fromBufferAttribute(this,e),nv.applyMatrix4(t),this.setXYZ(e,nv.x,nv.y,nv.z);return this}},{key:"applyNormalMatrix",value:function(t){for(var e=0,i=this.count;e<i;e++)nv.fromBufferAttribute(this,e),nv.applyNormalMatrix(t),this.setXYZ(e,nv.x,nv.y,nv.z);return this}},{key:"transformDirection",value:function(t){for(var e=0,i=this.count;e<i;e++)nv.fromBufferAttribute(this,e),nv.transformDirection(t),this.setXYZ(e,nv.x,nv.y,nv.z);return this}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this}},{key:"getComponent",value:function(t,e){var i=this.array[t*this.itemSize+e];return this.normalized&&(i=sm(i,this.array)),i}},{key:"setComponent",value:function(t,e,i){return this.normalized&&(i=am(i,this.array)),this.array[t*this.itemSize+e]=i,this}},{key:"getX",value:function(t){var e=this.array[t*this.itemSize];return this.normalized&&(e=sm(e,this.array)),e}},{key:"setX",value:function(t,e){return this.normalized&&(e=am(e,this.array)),this.array[t*this.itemSize]=e,this}},{key:"getY",value:function(t){var e=this.array[t*this.itemSize+1];return this.normalized&&(e=sm(e,this.array)),e}},{key:"setY",value:function(t,e){return this.normalized&&(e=am(e,this.array)),this.array[t*this.itemSize+1]=e,this}},{key:"getZ",value:function(t){var e=this.array[t*this.itemSize+2];return this.normalized&&(e=sm(e,this.array)),e}},{key:"setZ",value:function(t,e){return this.normalized&&(e=am(e,this.array)),this.array[t*this.itemSize+2]=e,this}},{key:"getW",value:function(t){var e=this.array[t*this.itemSize+3];return this.normalized&&(e=sm(e,this.array)),e}},{key:"setW",value:function(t,e){return this.normalized&&(e=am(e,this.array)),this.array[t*this.itemSize+3]=e,this}},{key:"setXY",value:function(t,e,i){return t*=this.itemSize,this.normalized&&(e=am(e,this.array),i=am(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}},{key:"setXYZ",value:function(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=am(e,this.array),i=am(i,this.array),n=am(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}},{key:"setXYZW",value:function(t,e,i,n,o){return t*=this.itemSize,this.normalized&&(e=am(e,this.array),i=am(i,this.array),n=am(n,this.array),o=am(o,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=o,this}},{key:"onUpload",value:function(t){return this.onUploadCallback=t,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Xd&&(t.usage=this.usage),t}}])}(),av=function(t){function e(t,i,n){return k()(this,e),jd(this,e,[new Uint16Array(t),i,n])}return sn()(e,t),_()(e)}(sv),rv=function(t){function e(t,i,n){return k()(this,e),jd(this,e,[new Uint32Array(t),i,n])}return sn()(e,t),_()(e)}(sv),lv=function(t){function e(t,i,n){return k()(this,e),jd(this,e,[new Float32Array(t),i,n])}return sn()(e,t),_()(e)}(sv),cv=0,uv=new cf,pv=new jf,hv=new Nm,dv=new Am,mv=new Am,fv=new Nm,vv=function(t){function e(){var t;return k()(this,e),(t=jd(this,e)).isBufferGeometry=!0,Object.defineProperty(Ld()(t),"id",{value:cv++}),t.uuid=em(),t.name="",t.type="BufferGeometry",t.index=null,t.attributes={},t.morphAttributes={},t.morphTargetsRelative=!1,t.groups=[],t.boundingBox=null,t.boundingSphere=null,t.drawRange={start:0,count:1/0},t.userData={},t}return sn()(e,t),_()(e,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(t){return Array.isArray(t)?this.index=new(um(t)?rv:av)(t,1):this.index=t,this}},{key:"getAttribute",value:function(t){return this.attributes[t]}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"deleteAttribute",value:function(t){return delete this.attributes[t],this}},{key:"hasAttribute",value:function(t){return void 0!==this.attributes[t]}},{key:"addGroup",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:t,count:e,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(t,e){this.drawRange.start=t,this.drawRange.count=e}},{key:"applyMatrix4",value:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new lm).getNormalMatrix(t);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(t),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(t){return uv.makeRotationFromQuaternion(t),this.applyMatrix4(uv),this}},{key:"rotateX",value:function(t){return uv.makeRotationX(t),this.applyMatrix4(uv),this}},{key:"rotateY",value:function(t){return uv.makeRotationY(t),this.applyMatrix4(uv),this}},{key:"rotateZ",value:function(t){return uv.makeRotationZ(t),this.applyMatrix4(uv),this}},{key:"translate",value:function(t,e,i){return uv.makeTranslation(t,e,i),this.applyMatrix4(uv),this}},{key:"scale",value:function(t,e,i){return uv.makeScale(t,e,i),this.applyMatrix4(uv),this}},{key:"lookAt",value:function(t){return pv.lookAt(t),pv.updateMatrix(),this.applyMatrix4(pv.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(hv).negate(),this.translate(hv.x,hv.y,hv.z),this}},{key:"setFromPoints",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new lv(e,3)),this}},{key:"computeBoundingBox",value:function(){null===this.boundingBox&&(this.boundingBox=new Am);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Nm(-1/0,-1/0,-1/0),new Nm(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var i=0,n=e.length;i<n;i++){var o=e[i];dv.setFromBufferAttribute(o),this.morphTargetsRelative?(fv.addVectors(this.boundingBox.min,dv.min),this.boundingBox.expandByPoint(fv),fv.addVectors(this.boundingBox.max,dv.max),this.boundingBox.expandByPoint(fv)):(this.boundingBox.expandByPoint(dv.min),this.boundingBox.expandByPoint(dv.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}},{key:"computeBoundingSphere",value:function(){null===this.boundingSphere&&(this.boundingSphere=new Qm);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Nm,1/0);if(t){var i=this.boundingSphere.center;if(dv.setFromBufferAttribute(t),e)for(var n=0,o=e.length;n<o;n++){var s=e[n];mv.setFromBufferAttribute(s),this.morphTargetsRelative?(fv.addVectors(dv.min,mv.min),dv.expandByPoint(fv),fv.addVectors(dv.max,mv.max),dv.expandByPoint(fv)):(dv.expandByPoint(mv.min),dv.expandByPoint(mv.max))}dv.getCenter(i);for(var a=0,r=0,l=t.count;r<l;r++)fv.fromBufferAttribute(t,r),a=Math.max(a,i.distanceToSquared(fv));if(e)for(var c=0,u=e.length;c<u;c++)for(var p=e[c],h=this.morphTargetsRelative,d=0,m=p.count;d<m;d++)fv.fromBufferAttribute(p,d),h&&(hv.fromBufferAttribute(t,d),fv.add(hv)),a=Math.max(a,i.distanceToSquared(fv));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}},{key:"computeTangents",value:function(){var t=this.index,e=this.attributes;if(null!==t&&void 0!==e.position&&void 0!==e.normal&&void 0!==e.uv){var i=e.position,n=e.normal,o=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new sv(new Float32Array(4*i.count),4));for(var s=this.getAttribute("tangent"),a=[],r=[],l=0;l<i.count;l++)a[l]=new Nm,r[l]=new Nm;var c=new Nm,u=new Nm,p=new Nm,h=new rm,d=new rm,m=new rm,f=new Nm,v=new Nm,g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(var y=0,b=g.length;y<b;++y)for(var C=g[y],w=C.start,k=w,x=w+C.count;k<x;k+=3)L(t.getX(k+0),t.getX(k+1),t.getX(k+2));for(var _=new Nm,E=new Nm,S=new Nm,D=new Nm,P=0,M=g.length;P<M;++P)for(var O=g[P],T=O.start,N=T,B=T+O.count;N<B;N+=3)A(t.getX(N+0)),A(t.getX(N+1)),A(t.getX(N+2))}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function L(t,e,n){c.fromBufferAttribute(i,t),u.fromBufferAttribute(i,e),p.fromBufferAttribute(i,n),h.fromBufferAttribute(o,t),d.fromBufferAttribute(o,e),m.fromBufferAttribute(o,n),u.sub(c),p.sub(c),d.sub(h),m.sub(h);var s=1/(d.x*m.y-m.x*d.y);isFinite(s)&&(f.copy(u).multiplyScalar(m.y).addScaledVector(p,-d.y).multiplyScalar(s),v.copy(p).multiplyScalar(d.x).addScaledVector(u,-m.x).multiplyScalar(s),a[t].add(f),a[e].add(f),a[n].add(f),r[t].add(v),r[e].add(v),r[n].add(v))}function A(t){S.fromBufferAttribute(n,t),D.copy(S);var e=a[t];_.copy(e),_.sub(S.multiplyScalar(S.dot(e))).normalize(),E.crossVectors(D,e);var i=E.dot(r[t])<0?-1:1;s.setXYZW(t,_.x,_.y,_.z,i)}}},{key:"computeVertexNormals",value:function(){var t=this.index,e=this.getAttribute("position");if(void 0!==e){var i=this.getAttribute("normal");if(void 0===i)i=new sv(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(var n=0,o=i.count;n<o;n++)i.setXYZ(n,0,0,0);var s=new Nm,a=new Nm,r=new Nm,l=new Nm,c=new Nm,u=new Nm,p=new Nm,h=new Nm;if(t)for(var d=0,m=t.count;d<m;d+=3){var f=t.getX(d+0),v=t.getX(d+1),g=t.getX(d+2);s.fromBufferAttribute(e,f),a.fromBufferAttribute(e,v),r.fromBufferAttribute(e,g),p.subVectors(r,a),h.subVectors(s,a),p.cross(h),l.fromBufferAttribute(i,f),c.fromBufferAttribute(i,v),u.fromBufferAttribute(i,g),l.add(p),c.add(p),u.add(p),i.setXYZ(f,l.x,l.y,l.z),i.setXYZ(v,c.x,c.y,c.z),i.setXYZ(g,u.x,u.y,u.z)}else for(var y=0,b=e.count;y<b;y+=3)s.fromBufferAttribute(e,y+0),a.fromBufferAttribute(e,y+1),r.fromBufferAttribute(e,y+2),p.subVectors(r,a),h.subVectors(s,a),p.cross(h),i.setXYZ(y+0,p.x,p.y,p.z),i.setXYZ(y+1,p.x,p.y,p.z),i.setXYZ(y+2,p.x,p.y,p.z);this.normalizeNormals(),i.needsUpdate=!0}}},{key:"normalizeNormals",value:function(){for(var t=this.attributes.normal,e=0,i=t.count;e<i;e++)fv.fromBufferAttribute(t,e),fv.normalize(),t.setXYZ(e,fv.x,fv.y,fv.z)}},{key:"toNonIndexed",value:function(){function t(t,e){for(var i=t.array,n=t.itemSize,o=t.normalized,s=new i.constructor(e.length*n),a=0,r=0,l=0,c=e.length;l<c;l++){a=t.isInterleavedBufferAttribute?e[l]*t.data.stride+t.offset:e[l]*n;for(var u=0;u<n;u++)s[r++]=i[a++]}return new sv(s,n,o)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var i=new e,n=this.index.array,o=this.attributes;for(var s in o){var a=t(o[s],n);i.setAttribute(s,a)}var r=this.morphAttributes;for(var l in r){for(var c=[],u=r[l],p=0,h=u.length;p<h;p++){var d=t(u[p],n);c.push(d)}i.morphAttributes[l]=c}i.morphTargetsRelative=this.morphTargetsRelative;for(var m=this.groups,f=0,v=m.length;f<v;f++){var g=m[f];i.addGroup(g.start,g.count,g.materialIndex)}return i}},{key:"toJSON",value:function(){var t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var o=this.attributes;for(var s in o){var a=o[s];t.data.attributes[s]=a.toJSON(t.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],p=[],h=0,d=u.length;h<d;h++){var m=u[h];p.push(m.toJSON(t.data))}p.length>0&&(r[c]=p,l=!0)}l&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(t.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(t.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),t}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone(e));var n=t.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(e))}var a=t.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,p=c.length;u<p;u++)l.push(c[u].clone(e));this.morphAttributes[r]=l}this.morphTargetsRelative=t.morphTargetsRelative;for(var h=t.groups,d=0,m=h.length;d<m;d++){var f=h[d];this.addGroup(f.start,f.count,f.materialIndex)}var v=t.boundingBox;null!==v&&(this.boundingBox=v.clone());var g=t.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}])}($d),gv=new cf,yv=new lf,bv=new Qm,Cv=new Nm,wv=new Nm,kv=new Nm,xv=new Nm,_v=new Nm,Ev=new Nm,Sv=new rm,Dv=new rm,Pv=new rm,Mv=new Nm,Ov=new Nm,Tv=new Nm,Nv=new Nm,Bv=new Nm,Lv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new vv,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iv;return k()(this,e),(t=jd(this,e)).isMesh=!0,t.type="Mesh",t.geometry=i,t.material=n,t.updateMorphTargets(),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t,i){return Ad(e,"copy",this,3)([t,i]),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}},{key:"updateMorphTargets",value:function(){var t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){var i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;n<o;n++){var s=i[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=n}}}}},{key:"getVertexPosition",value:function(t,e){var i=this.geometry,n=i.attributes.position,o=i.morphAttributes.position,s=i.morphTargetsRelative;e.fromBufferAttribute(n,t);var a=this.morphTargetInfluences;if(o&&a){Ev.set(0,0,0);for(var r=0,l=o.length;r<l;r++){var c=a[r],u=o[r];0!==c&&(_v.fromBufferAttribute(u,t),s?Ev.addScaledVector(_v,c):Ev.addScaledVector(_v.sub(e),c))}e.add(Ev)}return e}},{key:"raycast",value:function(t,e){var i=this.geometry,n=this.material,o=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),bv.copy(i.boundingSphere),bv.applyMatrix4(o),yv.copy(t.ray).recast(t.near),!1===bv.containsPoint(yv.origin)){if(null===yv.intersectSphere(bv,Cv))return;if(yv.origin.distanceToSquared(Cv)>Math.pow(t.far-t.near,2))return}gv.copy(o).invert(),yv.copy(t.ray).applyMatrix4(gv),null!==i.boundingBox&&!1===yv.intersectsBox(i.boundingBox)||this._computeIntersections(t,e,yv)}}},{key:"_computeIntersections",value:function(t,e,i){var n,o=this.geometry,s=this.material,a=o.index,r=o.attributes.position,l=o.attributes.uv,c=o.attributes.uv1,u=o.attributes.normal,p=o.groups,h=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=p.length;d<m;d++)for(var f=p[d],v=s[f.materialIndex],g=Math.max(f.start,h.start),y=Math.min(a.count,Math.min(f.start+f.count,h.start+h.count));g<y;g+=3)(n=Av(this,v,t,i,l,c,u,a.getX(g),a.getX(g+1),a.getX(g+2)))&&(n.faceIndex=Math.floor(g/3),n.face.materialIndex=f.materialIndex,e.push(n));else for(var b=Math.max(0,h.start),C=Math.min(a.count,h.start+h.count);b<C;b+=3)(n=Av(this,s,t,i,l,c,u,a.getX(b),a.getX(b+1),a.getX(b+2)))&&(n.faceIndex=Math.floor(b/3),e.push(n));else if(void 0!==r)if(Array.isArray(s))for(var w=0,k=p.length;w<k;w++)for(var x=p[w],_=s[x.materialIndex],E=Math.max(x.start,h.start),S=Math.min(r.count,Math.min(x.start+x.count,h.start+h.count));E<S;E+=3)(n=Av(this,_,t,i,l,c,u,E,E+1,E+2))&&(n.faceIndex=Math.floor(E/3),n.face.materialIndex=x.materialIndex,e.push(n));else for(var D=Math.max(0,h.start),P=Math.min(r.count,h.start+h.count);D<P;D+=3)(n=Av(this,s,t,i,l,c,u,D,D+1,D+2))&&(n.faceIndex=Math.floor(D/3),e.push(n))}}])}(jf);function Av(t,e,i,n,o,s,a,r,l,c){t.getVertexPosition(r,wv),t.getVertexPosition(l,kv),t.getVertexPosition(c,xv);var u=function(t,e,i,n,o,s,a,r){if(null===(1===e.side?n.intersectTriangle(a,s,o,!0,r):n.intersectTriangle(o,s,a,0===e.side,r)))return null;Bv.copy(r),Bv.applyMatrix4(t.matrixWorld);var l=i.ray.origin.distanceTo(Bv);return l<i.near||l>i.far?null:{distance:l,point:Bv.clone(),object:t}}(t,e,i,n,wv,kv,xv,Nv);if(u){o&&(Sv.fromBufferAttribute(o,r),Dv.fromBufferAttribute(o,l),Pv.fromBufferAttribute(o,c),u.uv=Jf.getInterpolation(Nv,wv,kv,xv,Sv,Dv,Pv,new rm)),s&&(Sv.fromBufferAttribute(s,r),Dv.fromBufferAttribute(s,l),Pv.fromBufferAttribute(s,c),u.uv1=Jf.getInterpolation(Nv,wv,kv,xv,Sv,Dv,Pv,new rm)),a&&(Mv.fromBufferAttribute(a,r),Ov.fromBufferAttribute(a,l),Tv.fromBufferAttribute(a,c),u.normal=Jf.getInterpolation(Nv,wv,kv,xv,Mv,Ov,Tv,new Nm),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var p={a:r,b:l,c:c,normal:new Nm,materialIndex:0};Jf.getNormal(wv,kv,xv,p.normal),u.face=p}return u}var jv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;k()(this,e),(t=jd(this,e)).type="BoxGeometry",t.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=t;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],p=[],h=[],d=0,m=0;function f(t,e,i,n,o,s,a,r,f,v,g){for(var y=s/f,b=a/v,C=s/2,w=a/2,k=r/2,x=f+1,_=v+1,E=0,S=0,D=new Nm,P=0;P<_;P++)for(var M=P*b-w,O=0;O<x;O++){var T=O*y-C;D[t]=T*n,D[e]=M*o,D[i]=k,u.push(D.x,D.y,D.z),D[t]=0,D[e]=0,D[i]=r>0?1:-1,p.push(D.x,D.y,D.z),h.push(O/f),h.push(1-P/v),E+=1}for(var N=0;N<v;N++)for(var B=0;B<f;B++){var L=d+B+x*N,A=d+B+x*(N+1),j=d+(B+1)+x*(N+1),I=d+(B+1)+x*N;c.push(L,A,I),c.push(A,j,I),S+=6}l.addGroup(m,S,g),m+=S,d+=E}return f("z","y","x",-1,-1,o,n,i,r,a,0),f("z","y","x",1,-1,o,n,-i,r,a,1),f("x","z","y",1,1,i,o,n,s,r,2),f("x","z","y",1,-1,i,o,-n,s,r,3),f("x","y","z",1,-1,i,n,o,s,a,4),f("x","y","z",-1,-1,i,n,-o,s,a,5),t.setIndex(c),t.setAttribute("position",new lv(u,3)),t.setAttribute("normal",new lv(p,3)),t.setAttribute("uv",new lv(h,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}])}(vv);function Iv(t){var e={};for(var i in t)for(var n in e[i]={},t[i]){var o=t[i][n];o&&(o.isColor||o.isMatrix3||o.isMatrix4||o.isVector2||o.isVector3||o.isVector4||o.isTexture||o.isQuaternion)?o.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][n]=null):e[i][n]=o.clone():Array.isArray(o)?e[i][n]=o.slice():e[i][n]=o}return e}function Rv(t){for(var e={},i=0;i<t.length;i++){var n=Iv(t[i]);for(var o in n)e[o]=n[o]}return e}var Fv=function(t){function e(){var t;return k()(this,e),(t=jd(this,e)).isCamera=!0,t.type="Camera",t.matrixWorldInverse=new cf,t.projectionMatrix=new cf,t.projectionMatrixInverse=new cf,t.coordinateSystem=Zd,t}return sn()(e,t),_()(e,[{key:"copy",value:function(t,i){return Ad(e,"copy",this,3)([t,i]),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}},{key:"getWorldDirection",value:function(t){return Ad(e,"getWorldDirection",this,3)([t]).negate()}},{key:"updateMatrixWorld",value:function(t){Ad(e,"updateMatrixWorld",this,3)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){Ad(e,"updateWorldMatrix",this,3)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(jf),zv=(new Nm,new rm,new rm,function(t){function e(t,i,n,o,s,a,r,l,c,u){var p;return k()(this,e),(p=jd(this,e,[t=void 0!==t?t:[],i=void 0!==i?i:301,n,o,s,a,r,l,c,u])).isCubeTexture=!0,p.flipY=!1,p}return sn()(e,t),_()(e,[{key:"images",get:function(){return this.image},set:function(t){this.image=t}}])}(Dm)),Hv=new Nm,Vv=new Nm,Gv=new lm,Uv=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t),this.isPlane=!0,this.normal=e,this.constant=i}),[{key:"set",value:function(t,e){return this.normal.copy(t),this.constant=e,this}},{key:"setComponents",value:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,e,i){var n=Hv.subVectors(i,e).cross(Vv.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}},{key:"copy",value:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this}},{key:"normalize",value:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(t){return this.normal.dot(t)+this.constant}},{key:"distanceToSphere",value:function(t){return this.distanceToPoint(t.center)-t.radius}},{key:"projectPoint",value:function(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}},{key:"intersectLine",value:function(t,e){var i=t.delta(Hv),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;var o=-(t.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:e.copy(t.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}},{key:"intersectsBox",value:function(t){return t.intersectsPlane(this)}},{key:"intersectsSphere",value:function(t){return t.intersectsPlane(this)}},{key:"coplanarPoint",value:function(t){return t.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,e){var i=e||Gv.getNormalMatrix(t),n=this.coplanarPoint(Hv).applyMatrix4(t),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(t){return this.constant-=t.dot(this.normal),this}},{key:"equals",value:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Wv=new Qm,Yv=new Nm,Jv=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uv,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uv,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Uv,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Uv,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Uv,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Uv;k()(this,t),this.planes=[e,i,n,o,s,a]}),[{key:"set",value:function(t,e,i,n,o,s){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=t.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],p=n[7],h=n[8],d=n[9],m=n[10],f=n[11],v=n[12],g=n[13],y=n[14],b=n[15];if(i[0].setComponents(r-o,p-l,f-h,b-v).normalize(),i[1].setComponents(r+o,p+l,f+h,b+v).normalize(),i[2].setComponents(r+s,p+c,f+d,b+g).normalize(),i[3].setComponents(r-s,p-c,f-d,b-g).normalize(),i[4].setComponents(r-a,p-u,f-m,b-y).normalize(),e===Zd)i[5].setComponents(r+a,p+u,f+m,b+y).normalize();else{if(e!==Kd)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Wv.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{var e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Wv.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Wv)}},{key:"intersectsSprite",value:function(t){return Wv.center.set(0,0,0),Wv.radius=.7071067811865476,Wv.applyMatrix4(t.matrixWorld),this.intersectsSphere(Wv)}},{key:"intersectsSphere",value:function(t){for(var e=this.planes,i=t.center,n=-t.radius,o=0;o<6;o++)if(e[o].distanceToPoint(i)<n)return!1;return!0}},{key:"intersectsBox",value:function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];if(Yv.x=n.normal.x>0?t.max.x:t.min.x,Yv.y=n.normal.y>0?t.max.y:t.min.y,Yv.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Yv)<0)return!1}return!0}},{key:"containsPoint",value:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var qv=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),(t=jd(this,e)).type="PlaneGeometry",t.parameters={width:i,height:n,widthSegments:o,heightSegments:s};for(var a=i/2,r=n/2,l=Math.floor(o),c=Math.floor(s),u=l+1,p=c+1,h=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y<p;y++)for(var b=y*d-r,C=0;C<u;C++){var w=C*h-a;f.push(w,-b,0),v.push(0,0,1),g.push(C/l),g.push(1-y/c)}for(var x=0;x<c;x++)for(var _=0;_<l;_++){var E=_+u*x,S=_+u*(x+1),D=_+1+u*(x+1),P=_+1+u*x;m.push(E,S,P),m.push(S,D,P)}return t.setIndex(m),t.setAttribute("position",new lv(f,3)),t.setAttribute("normal",new lv(v,3)),t.setAttribute("uv",new lv(g,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}}])}(vv),Xv={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},Zv={common:{diffuse:{value:new $f(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new lm},alphaMap:{value:null},alphaMapTransform:{value:new lm},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new lm}},envmap:{envMap:{value:null},envMapRotation:{value:new lm},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new lm}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new lm}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new lm},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new lm},normalScale:{value:new rm(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new lm},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new lm}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new lm}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new lm}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $f(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new $f(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new lm},alphaTest:{value:0},uvTransform:{value:new lm}},sprite:{diffuse:{value:new $f(16777215)},opacity:{value:1},center:{value:new rm(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new lm},alphaMap:{value:null},alphaMapTransform:{value:new lm},alphaTest:{value:0}}},Kv={basic:{uniforms:Rv([Zv.common,Zv.specularmap,Zv.envmap,Zv.aomap,Zv.lightmap,Zv.fog]),vertexShader:Xv.meshbasic_vert,fragmentShader:Xv.meshbasic_frag},lambert:{uniforms:Rv([Zv.common,Zv.specularmap,Zv.envmap,Zv.aomap,Zv.lightmap,Zv.emissivemap,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,Zv.fog,Zv.lights,{emissive:{value:new $f(0)}}]),vertexShader:Xv.meshlambert_vert,fragmentShader:Xv.meshlambert_frag},phong:{uniforms:Rv([Zv.common,Zv.specularmap,Zv.envmap,Zv.aomap,Zv.lightmap,Zv.emissivemap,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,Zv.fog,Zv.lights,{emissive:{value:new $f(0)},specular:{value:new $f(1118481)},shininess:{value:30}}]),vertexShader:Xv.meshphong_vert,fragmentShader:Xv.meshphong_frag},standard:{uniforms:Rv([Zv.common,Zv.envmap,Zv.aomap,Zv.lightmap,Zv.emissivemap,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,Zv.roughnessmap,Zv.metalnessmap,Zv.fog,Zv.lights,{emissive:{value:new $f(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Xv.meshphysical_vert,fragmentShader:Xv.meshphysical_frag},toon:{uniforms:Rv([Zv.common,Zv.aomap,Zv.lightmap,Zv.emissivemap,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,Zv.gradientmap,Zv.fog,Zv.lights,{emissive:{value:new $f(0)}}]),vertexShader:Xv.meshtoon_vert,fragmentShader:Xv.meshtoon_frag},matcap:{uniforms:Rv([Zv.common,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,Zv.fog,{matcap:{value:null}}]),vertexShader:Xv.meshmatcap_vert,fragmentShader:Xv.meshmatcap_frag},points:{uniforms:Rv([Zv.points,Zv.fog]),vertexShader:Xv.points_vert,fragmentShader:Xv.points_frag},dashed:{uniforms:Rv([Zv.common,Zv.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xv.linedashed_vert,fragmentShader:Xv.linedashed_frag},depth:{uniforms:Rv([Zv.common,Zv.displacementmap]),vertexShader:Xv.depth_vert,fragmentShader:Xv.depth_frag},normal:{uniforms:Rv([Zv.common,Zv.bumpmap,Zv.normalmap,Zv.displacementmap,{opacity:{value:1}}]),vertexShader:Xv.meshnormal_vert,fragmentShader:Xv.meshnormal_frag},sprite:{uniforms:Rv([Zv.sprite,Zv.fog]),vertexShader:Xv.sprite_vert,fragmentShader:Xv.sprite_frag},background:{uniforms:{uvTransform:{value:new lm},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Xv.background_vert,fragmentShader:Xv.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new lm}},vertexShader:Xv.backgroundCube_vert,fragmentShader:Xv.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xv.cube_vert,fragmentShader:Xv.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xv.equirect_vert,fragmentShader:Xv.equirect_frag},distanceRGBA:{uniforms:Rv([Zv.common,Zv.displacementmap,{referencePosition:{value:new Nm},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xv.distanceRGBA_vert,fragmentShader:Xv.distanceRGBA_frag},shadow:{uniforms:Rv([Zv.lights,Zv.fog,{color:{value:new $f(0)},opacity:{value:1}}]),vertexShader:Xv.shadow_vert,fragmentShader:Xv.shadow_frag}};Kv.physical={uniforms:Rv([Kv.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new lm},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new lm},clearcoatNormalScale:{value:new rm(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new lm},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new lm},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new lm},sheen:{value:0},sheenColor:{value:new $f(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new lm},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new lm},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new lm},transmissionSamplerSize:{value:new rm},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new lm},attenuationDistance:{value:0},attenuationColor:{value:new $f(0)},specularColor:{value:new $f(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new lm},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new lm},anisotropyVector:{value:new rm},anisotropyMap:{value:null},anisotropyMapTransform:{value:new lm}}]),vertexShader:Xv.meshphysical_vert,fragmentShader:Xv.meshphysical_frag};new bf,new cf;var $v=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return k()(this,e),(t=jd(this,e)).isOrthographicCamera=!0,t.type="OrthographicCamera",t.zoom=1,t.view=null,t.left=i,t.right=n,t.top=o,t.bottom=s,t.near=a,t.far=r,t.updateProjectionMatrix(),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t,i){return Ad(e,"copy",this,3)([t,i]),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}},{key:"setViewOffset",value:function(t,e,i,n,o,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-t,s=i+t,a=n+e,r=n-e;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s=(o+=l*this.view.offsetX)+l*this.view.width,r=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,r,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(t){var i=Ad(e,"toJSON",this,3)([t]);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,null!==this.view&&(i.object.view=Object.assign({},this.view)),i}}])}(Fv),Qv=(new $v,new $f,(1+Math.sqrt(5))/2),tg=1/Qv;new Nm(-Qv,tg,0),new Nm(Qv,tg,0),new Nm(-tg,0,Qv),new Nm(tg,0,Qv),new Nm(0,Qv,-tg),new Nm(0,Qv,tg),new Nm(-1,1,-1),new Nm(1,1,-1),new Nm(-1,1,1),new Nm(1,1,1);var eg=function(t){function e(t,i,n,o,s,a,r,l,c,u){var p;if(k()(this,e),1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===n&&1026===u&&(n=Id),void 0===n&&1027===u&&(n=Rd),(p=jd(this,e,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,p.image={width:t,height:i},p.magFilter=void 0!==r?r:1003,p.minFilter=void 0!==l?l:1003,p.flipY=!1,p.generateMipmaps=!1,p.compareFunction=null,p}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.compareFunction=t.compareFunction,this}},{key:"toJSON",value:function(t){var i=Ad(e,"toJSON",this,3)([t]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(Dm),ig=(new Dm,new eg(1,1));ig.compareFunction=515;new Mm,new Om,new zv,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new bf,new cf;new Nm,new Nm,new Nm,new Nm,new rm,new rm,new cf,new Nm,new Nm,new Nm,new rm,new rm,new rm;new Nm,new Nm,new Nm,new Pm,new Pm,new Nm,new cf,new Nm,new Qm,new cf,new lf,new cf,new cf,new cf,new cf,new Am,new cf,new Lv,new Qm;var ng=function(){return _()((function t(){k()(this,t),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(t,e){var i=this.pool,n=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1});var o=i[this.index];n.push(o),this.index++,o.start=t.start,o.count=t.count,o.z=e}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new cf,new cf,new cf,new cf,new Jv,new Am,new Qm,new Nm,new ng,new Lv;new Nm,new Nm,new cf,new lf,new Qm,new Nm,new Nm;new Nm,new Nm,new cf,new lf,new Qm,new Nm;var og=function(){return _()((function t(){k()(this,t),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)}},{key:"getPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}},{key:"getLength",value:function(){var t=this.getLengths();return t[t.length-1]}},{key:"getLengths",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=t;s++)o+=(e=this.getPoint(s/t)).distanceTo(n),i.push(o),n=e;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(t,e){var i,n=this.getLengths(),o=0,s=n.length;i=e||t*n[s-1];for(var a,r=0,l=s-1;r<=l;)if((a=n[o=Math.floor(r+(l-r)/2)]-i)<0)r=o+1;else{if(!(a>0)){l=o;break}l=o-1}if(n[o=l]===i)return o/(s-1);var c=n[o];return(o+(i-c)/(n[o+1]-c))/(s-1)}},{key:"getTangent",value:function(t,e){var i=1e-4,n=t-i,o=t+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=e||(s.isVector2?new rm:new Nm);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)}},{key:"computeFrenetFrames",value:function(t,e){for(var i=new Nm,n=[],o=[],s=[],a=new Nm,r=new cf,l=0;l<=t;l++){var c=l/t;n[l]=this.getTangentAt(c,new Nm)}o[0]=new Nm,s[0]=new Nm;var u=Number.MAX_VALUE,p=Math.abs(n[0].x),h=Math.abs(n[0].y),d=Math.abs(n[0].z);p<=u&&(u=p,i.set(1,0,0)),h<=u&&(u=h,i.set(0,1,0)),d<=u&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],a),s[0].crossVectors(n[0],o[0]);for(var m=1;m<=t;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(n[m-1],n[m]),a.length()>Number.EPSILON){a.normalize();var f=Math.acos(im(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===e){var v=Math.acos(im(o[0].dot(o[t]),-1,1));v/=t,n[0].dot(a.crossVectors(o[0],o[t]))>0&&(v=-v);for(var g=1;g<=t;g++)o[g].applyMatrix4(r.makeRotationAxis(n[g],v*g)),s[g].crossVectors(n[g],o[g])}return{tangents:n,normals:o,binormals:s}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},{key:"toJSON",value:function(){var t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}},{key:"fromJSON",value:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}])}(),sg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return k()(this,e),(t=jd(this,e)).isEllipseCurve=!0,t.type="EllipseCurve",t.aX=i,t.aY=n,t.xRadius=o,t.yRadius=s,t.aStartAngle=a,t.aEndAngle=r,t.aClockwise=l,t.aRotation=c,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,i=e,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)<Number.EPSILON;o<0;)o+=n;for(;o>n;)o-=n;o<Number.EPSILON&&(o=s?0:n),!0!==this.aClockwise||s||(o===n?o=-n:o-=n);var a=this.aStartAngle+t*o,r=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=r-this.aX,h=l-this.aY;r=p*c-h*u+this.aX,l=p*u+h*c+this.aY}return i.set(r,l)}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}])}(og),ag=function(t){function e(t,i,n,o,s,a){var r;return k()(this,e),(r=jd(this,e,[t,i,n,n,o,s,a])).isArcCurve=!0,r.type="ArcCurve",r}return sn()(e,t),_()(e)}(sg);function rg(){var t=0,e=0,i=0,n=0;function o(o,s,a,r){t=o,e=a,i=-3*o+3*s-2*a-r,n=2*o-2*s+a+r}return{initCatmullRom:function(t,e,i,n,s){o(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,a,r){var l=(e-t)/s-(i-t)/(s+a)+(i-e)/a,c=(i-e)/a-(n-e)/(a+r)+(n-i)/r;o(e,i,l*=a,c*=a)},calc:function(o){var s=o*o;return t+e*o+i*s+n*(s*o)}}}var lg=new Nm,cg=new rg,ug=new rg,pg=new rg,hg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return k()(this,e),(t=jd(this,e)).isCatmullRomCurve3=!0,t.type="CatmullRomCurve3",t.points=i,t.closed=n,t.curveType=o,t.tension=s,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*t,l=Math.floor(r),c=r-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?e=s[(l-1)%a]:(lg.subVectors(s[0],s[1]).add(s[0]),e=lg);var u=s[l%a],p=s[(l+1)%a];if(this.closed||l+2<a?i=s[(l+2)%a]:(lg.subVectors(s[a-1],s[a-2]).add(s[a-1]),i=lg),"centripetal"===this.curveType||"chordal"===this.curveType){var h="chordal"===this.curveType?.5:.25,d=Math.pow(e.distanceToSquared(u),h),m=Math.pow(u.distanceToSquared(p),h),f=Math.pow(p.distanceToSquared(i),h);m<1e-4&&(m=1),d<1e-4&&(d=m),f<1e-4&&(f=m),cg.initNonuniformCatmullRom(e.x,u.x,p.x,i.x,d,m,f),ug.initNonuniformCatmullRom(e.y,u.y,p.y,i.y,d,m,f),pg.initNonuniformCatmullRom(e.z,u.z,p.z,i.z,d,m,f)}else"catmullrom"===this.curveType&&(cg.initCatmullRom(e.x,u.x,p.x,i.x,this.tension),ug.initCatmullRom(e.y,u.y,p.y,i.y,this.tension),pg.initCatmullRom(e.z,u.z,p.z,i.z,this.tension));return o.set(cg.calc(c),ug.calc(c),pg.calc(c)),o}},{key:"copy",value:function(t){Ad(e,"copy",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push(o.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);t.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];t.points.push(o.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}},{key:"fromJSON",value:function(t){Ad(e,"fromJSON",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push((new Nm).fromArray(o))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}])}(og);function dg(t,e,i,n,o){var s=.5*(n-e),a=.5*(o-i),r=t*t;return(2*i-2*n+s+a)*(t*r)+(-3*i+3*n-2*s-a)*r+s*t+i}function mg(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function fg(t,e,i,n,o){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,o)}var vg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rm,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new rm;return k()(this,e),(t=jd(this,e)).isCubicBezierCurve=!0,t.type="CubicBezierCurve",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(fg(t,n.x,o.x,s.x,a.x),fg(t,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(og),gg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Nm,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Nm;return k()(this,e),(t=jd(this,e)).isCubicBezierCurve3=!0,t.type="CubicBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t.v3=s,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,i=e,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(fg(t,n.x,o.x,s.x,a.x),fg(t,n.y,o.y,s.y,a.y),fg(t,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}])}(og),yg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm;return k()(this,e),(t=jd(this,e)).isLineCurve=!0,t.type="LineCurve",t.v1=i,t.v2=n,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(og),bg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm;return k()(this,e),(t=jd(this,e)).isLineCurve3=!0,t.type="LineCurve3",t.v1=i,t.v2=n,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm;return e.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(t,e){return this.getTangent(t,e)}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(og),Cg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new rm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new rm;return k()(this,e),(t=jd(this,e)).isQuadraticBezierCurve=!0,t.type="QuadraticBezierCurve",t.v0=i,t.v1=n,t.v2=o,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(mg(t,n.x,o.x,s.x),mg(t,n.y,o.y,s.y)),i}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(og),wg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Nm,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Nm;return k()(this,e),(t=jd(this,e)).isQuadraticBezierCurve3=!0,t.type="QuadraticBezierCurve3",t.v0=i,t.v1=n,t.v2=o,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Nm,i=e,n=this.v0,o=this.v1,s=this.v2;return i.set(mg(t,n.x,o.x,s.x),mg(t,n.y,o.y,s.y),mg(t,n.z,o.z,s.z)),i}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}])}(og),kg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return k()(this,e),(t=jd(this,e)).isSplineCurve=!0,t.type="SplineCurve",t.points=i,t}return sn()(e,t),_()(e,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new rm,i=e,n=this.points,o=(n.length-1)*t,s=Math.floor(o),a=o-s,r=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(dg(a,r.x,l.x,c.x,u.x),dg(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(t){Ad(e,"copy",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push(o.clone())}return this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);t.points=[];for(var i=0,n=this.points.length;i<n;i++){var o=this.points[i];t.points.push(o.toArray())}return t}},{key:"fromJSON",value:function(t){Ad(e,"fromJSON",this,3)([t]),this.points=[];for(var i=0,n=t.points.length;i<n;i++){var o=t.points[i];this.points.push((new rm).fromArray(o))}return this}}])}(og),xg=Object.freeze({__proto__:null,ArcCurve:ag,CatmullRomCurve3:hg,CubicBezierCurve:vg,CubicBezierCurve3:gg,EllipseCurve:sg,LineCurve:yg,LineCurve3:bg,QuadraticBezierCurve:Cg,QuadraticBezierCurve3:wg,SplineCurve:kg}),_g=function(t){function e(t){var i;return k()(this,e),(i=jd(this,e)).type="Path",i.currentPoint=new rm,t&&i.setFromPoints(t),i}return sn()(e,t),_()(e,[{key:"setFromPoints",value:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}},{key:"moveTo",value:function(t,e){return this.currentPoint.set(t,e),this}},{key:"lineTo",value:function(t,e){var i=new yg(this.currentPoint.clone(),new rm(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){var o=new Cg(this.currentPoint.clone(),new rm(t,e),new rm(i,n));return this.curves.push(o),this.currentPoint.set(i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,o,s){var a=new vg(this.currentPoint.clone(),new rm(t,e),new rm(i,n),new rm(o,s));return this.curves.push(a),this.currentPoint.set(o,s),this}},{key:"splineThru",value:function(t){var e=[this.currentPoint.clone()].concat(t),i=new kg(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}},{key:"arc",value:function(t,e,i,n,o,s){var a=this.currentPoint.x,r=this.currentPoint.y;return this.absarc(t+a,e+r,i,n,o,s),this}},{key:"absarc",value:function(t,e,i,n,o,s){return this.absellipse(t,e,i,i,n,o,s),this}},{key:"ellipse",value:function(t,e,i,n,o,s,a,r){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,n,o,s,a,r),this}},{key:"absellipse",value:function(t,e,i,n,o,s,a,r){var l=new sg(t,e,i,n,o,s,a,r);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this}},{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.currentPoint.copy(t.currentPoint),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.currentPoint=this.currentPoint.toArray(),t}},{key:"fromJSON",value:function(t){return Ad(e,"fromJSON",this,3)([t]),this.currentPoint.fromArray(t.currentPoint),this}}])}(function(t){function e(){var t;return k()(this,e),(t=jd(this,e)).type="CurvePath",t.curves=[],t.autoClose=!1,t}return sn()(e,t),_()(e,[{key:"add",value:function(t){this.curves.push(t)}},{key:"closePath",value:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){var i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new xg[i](e,t))}return this}},{key:"getPoint",value:function(t,e){for(var i=t*this.getLength(),n=this.getCurveLengths(),o=0;o<n.length;){if(n[o]>=i){var s=n[o]-i,a=this.curves[o],r=a.getLength(),l=0===r?0:1-s/r;return a.getPointAt(l,e)}o++}return null}},{key:"getLength",value:function(){var t=this.getCurveLengths();return t[t.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}},{key:"getPoints",value:function(){for(var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n<o.length;n++)for(var s=o[n],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,r=s.getPoints(a),l=0;l<r.length;l++){var c=r[l];t&&t.equals(c)||(i.push(c),t=c)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(t){Ad(e,"copy",this,3)([t]),this.curves=[];for(var i=0,n=t.curves.length;i<n;i++){var o=t.curves[i];this.curves.push(o.clone())}return this.autoClose=t.autoClose,this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);t.autoClose=this.autoClose,t.curves=[];for(var i=0,n=this.curves.length;i<n;i++){var o=this.curves[i];t.curves.push(o.toJSON())}return t}},{key:"fromJSON",value:function(t){Ad(e,"fromJSON",this,3)([t]),this.autoClose=t.autoClose,this.curves=[];for(var i=0,n=t.curves.length;i<n;i++){var o=t.curves[i];this.curves.push((new xg[o.type]).fromJSON(o))}return this}}])}(og)),Eg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new rm(0,-.5),new rm(.5,0),new rm(0,.5)],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,e),(t=jd(this,e)).type="LatheGeometry",t.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=im(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],p=1/n,h=new Nm,d=new rm,m=new Nm,f=new Nm,v=new Nm,g=0,y=0,b=0;b<=i.length-1;b++)switch(b){case 0:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,v.copy(m),m.normalize(),c.push(m.x,m.y,m.z);break;case i.length-1:c.push(v.x,v.y,v.z);break;default:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,f.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),c.push(m.x,m.y,m.z),v.copy(f)}for(var C=0;C<=n;C++)for(var w=o+C*p*s,x=Math.sin(w),_=Math.cos(w),E=0;E<=i.length-1;E++){h.x=i[E].x*x,h.y=i[E].y,h.z=i[E].x*_,r.push(h.x,h.y,h.z),d.x=C/n,d.y=E/(i.length-1),l.push(d.x,d.y);var S=c[3*E+0]*x,D=c[3*E+1],P=c[3*E+0]*_;u.push(S,D,P)}for(var M=0;M<n;M++)for(var O=0;O<i.length-1;O++){var T=O+M*i.length,N=T,B=T+i.length,L=T+i.length+1,A=T+1;a.push(N,B,A),a.push(L,A,B)}return t.setIndex(a),t.setAttribute("position",new lv(r,3)),t.setAttribute("uv",new lv(l,2)),t.setAttribute("normal",new lv(u,3)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.points,t.segments,t.phiStart,t.phiLength)}}])}(vv),Sg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;k()(this,e);var a=new _g;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(t=jd(this,e,[a.getPoints(o),s])).type="CapsuleGeometry",t.parameters={radius:i,length:n,capSegments:o,radialSegments:s},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.length,t.capSegments,t.radialSegments)}}])}(Eg),Dg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,e),(t=jd(this,e)).type="CircleGeometry",t.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new Nm,p=new rm;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var h=0,d=3;h<=n;h++,d+=3){var m=o+h/n*s;u.x=i*Math.cos(m),u.y=i*Math.sin(m),r.push(u.x,u.y,u.z),l.push(0,0,1),p.x=(r[d]/i+1)/2,p.y=(r[d+1]/i+1)/2,c.push(p.x,p.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return t.setIndex(a),t.setAttribute("position",new lv(r,3)),t.setAttribute("normal",new lv(l,3)),t.setAttribute("uv",new lv(c,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.segments,t.thetaStart,t.thetaLength)}}])}(vv),Pg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;k()(this,e),(t=jd(this,e)).type="CylinderGeometry",t.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=t;s=Math.floor(s),a=Math.floor(a);var p=[],h=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(t){for(var e=f,o=new rm,a=new Nm,r=0,v=!0===t?i:n,b=!0===t?1:-1,C=1;C<=s;C++)h.push(0,g*b,0),d.push(0,b,0),m.push(.5,.5),f++;for(var w=f,k=0;k<=s;k++){var x=k/s*c+l,_=Math.cos(x),E=Math.sin(x);a.x=v*E,a.y=g*b,a.z=v*_,h.push(a.x,a.y,a.z),d.push(0,b,0),o.x=.5*_+.5,o.y=.5*E*b+.5,m.push(o.x,o.y),f++}for(var S=0;S<s;S++){var D=e+S,P=w+S;!0===t?p.push(P,P+1,D):p.push(P+1,P,D),r+=3}u.addGroup(y,r,!0===t?1:2),y+=r}return function(){for(var t=new Nm,e=new Nm,r=0,b=(n-i)/o,C=0;C<=a;C++){for(var w=[],k=C/a,x=k*(n-i)+i,_=0;_<=s;_++){var E=_/s,S=E*c+l,D=Math.sin(S),P=Math.cos(S);e.x=x*D,e.y=-k*o+g,e.z=x*P,h.push(e.x,e.y,e.z),t.set(D,b,P).normalize(),d.push(t.x,t.y,t.z),m.push(E,1-k),w.push(f++)}v.push(w)}for(var M=0;M<s;M++)for(var O=0;O<a;O++){var T=v[O][M],N=v[O+1][M],B=v[O+1][M+1],L=v[O][M+1];p.push(T,N,L),p.push(N,B,L),r+=6}u.addGroup(y,r,0),y+=r}(),!1===r&&(i>0&&b(!0),n>0&&b(!1)),t.setIndex(p),t.setAttribute("position",new lv(h,3)),t.setAttribute("normal",new lv(d,3)),t.setAttribute("uv",new lv(m,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(vv),Mg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return k()(this,e),(t=jd(this,e,[0,i,n,o,s,a,r,l])).type="ConeGeometry",t.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}])}(Pg),Og=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;k()(this,e),(t=jd(this,e)).type="PolyhedronGeometry",t.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(t,e,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=t.clone().lerp(i,a/o),l=e.clone().lerp(i,a/o),u=o-a,p=0;p<=u;p++)s[a][p]=0===p&&a===o?r:r.clone().lerp(l,p/u)}for(var h=0;h<o;h++)for(var d=0;d<2*(o-h)-1;d++){var m=Math.floor(d/2);d%2==0?(c(s[h][m+1]),c(s[h+1][m]),c(s[h][m])):(c(s[h][m+1]),c(s[h+1][m+1]),c(s[h+1][m]))}}function c(t){a.push(t.x,t.y,t.z)}function u(t,e){var n=3*t;e.x=i[n+0],e.y=i[n+1],e.z=i[n+2]}function p(t,e,i,n){n<0&&1===t.x&&(r[e]=t.x-1),0===i.x&&0===i.z&&(r[e]=n/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}return function(t){for(var e=new Nm,i=new Nm,o=new Nm,s=0;s<n.length;s+=3)u(n[s+0],e),u(n[s+1],i),u(n[s+2],o),l(e,i,o,t)}(s),function(t){for(var e=new Nm,i=0;i<a.length;i+=3)e.x=a[i+0],e.y=a[i+1],e.z=a[i+2],e.normalize().multiplyScalar(t),a[i+0]=e.x,a[i+1]=e.y,a[i+2]=e.z}(o),function(){for(var t,e=new Nm,i=0;i<a.length;i+=3){e.x=a[i+0],e.y=a[i+1],e.z=a[i+2];var n=h(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);r.push(n,1-o)}(function(){for(var t=new Nm,e=new Nm,i=new Nm,n=new Nm,o=new rm,s=new rm,l=new rm,c=0,u=0;c<a.length;c+=9,u+=6){t.set(a[c+0],a[c+1],a[c+2]),e.set(a[c+3],a[c+4],a[c+5]),i.set(a[c+6],a[c+7],a[c+8]),o.set(r[u+0],r[u+1]),s.set(r[u+2],r[u+3]),l.set(r[u+4],r[u+5]),n.copy(t).add(e).add(i).divideScalar(3);var d=h(n);p(o,u+0,t,d),p(s,u+2,e,d),p(l,u+4,i,d)}})(),function(){for(var t=0;t<r.length;t+=6){var e=r[t+0],i=r[t+2],n=r[t+4],o=Math.max(e,i,n),s=Math.min(e,i,n);o>.9&&s<.1&&(e<.2&&(r[t+0]+=1),i<.2&&(r[t+2]+=1),n<.2&&(r[t+4]+=1))}}()}(),t.setAttribute("position",new lv(a,3)),t.setAttribute("normal",new lv(a.slice(),3)),t.setAttribute("uv",new lv(r,2)),0===s?t.computeVertexNormals():t.normalizeNormals(),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.vertices,t.indices,t.radius,t.details)}}])}(vv),Tg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e);var o=(1+Math.sqrt(5))/2,s=1/o;return(t=jd(this,e,[[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],i,n])).type="DodecahedronGeometry",t.parameters={radius:i,detail:n},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Og),Ng=new Nm,Bg=new Nm,Lg=new Nm,Ag=new Jf,jg=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(k()(this,e),(t=jd(this,e)).type="EdgesGeometry",t.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(tm*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],p=["a","b","c"],h=new Array(3),d={},m=[],f=0;f<c;f+=3){r?(u[0]=r.getX(f),u[1]=r.getX(f+1),u[2]=r.getX(f+2)):(u[0]=f,u[1]=f+1,u[2]=f+2);var v=Ag.a,g=Ag.b,y=Ag.c;if(v.fromBufferAttribute(l,u[0]),g.fromBufferAttribute(l,u[1]),y.fromBufferAttribute(l,u[2]),Ag.getNormal(Lg),h[0]="".concat(Math.round(v.x*s),",").concat(Math.round(v.y*s),",").concat(Math.round(v.z*s)),h[1]="".concat(Math.round(g.x*s),",").concat(Math.round(g.y*s),",").concat(Math.round(g.z*s)),h[2]="".concat(Math.round(y.x*s),",").concat(Math.round(y.y*s),",").concat(Math.round(y.z*s)),h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(var b=0;b<3;b++){var C=(b+1)%3,w=h[b],x=h[C],_=Ag[p[b]],E=Ag[p[C]],S="".concat(w,"_").concat(x),D="".concat(x,"_").concat(w);D in d&&d[D]?(Lg.dot(d[D].normal)<=a&&(m.push(_.x,_.y,_.z),m.push(E.x,E.y,E.z)),d[D]=null):S in d||(d[S]={index0:u[b],index1:u[C],normal:Lg.clone()})}}for(var P in d)if(d[P]){var M=d[P],O=M.index0,T=M.index1;Ng.fromBufferAttribute(l,O),Bg.fromBufferAttribute(l,T),m.push(Ng.x,Ng.y,Ng.z),m.push(Bg.x,Bg.y,Bg.z)}t.setAttribute("position",new lv(m,3))}return t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}])}(vv),Ig=function(t){function e(t){var i;return k()(this,e),(i=jd(this,e,[t])).uuid=em(),i.type="Shape",i.holes=[],i}return sn()(e,t),_()(e,[{key:"getPointsHoles",value:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}},{key:"extractPoints",value:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}},{key:"copy",value:function(t){Ad(e,"copy",this,3)([t]),this.holes=[];for(var i=0,n=t.holes.length;i<n;i++){var o=t.holes[i];this.holes.push(o.clone())}return this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);t.uuid=this.uuid,t.holes=[];for(var i=0,n=this.holes.length;i<n;i++){var o=this.holes[i];t.holes.push(o.toJSON())}return t}},{key:"fromJSON",value:function(t){Ad(e,"fromJSON",this,3)([t]),this.uuid=t.uuid,this.holes=[];for(var i=0,n=t.holes.length;i<n;i++){var o=t.holes[i];this.holes.push((new _g).fromJSON(o))}return this}}])}(_g);function Rg(t,e,i,n,o){var s,a;if(o===function(t,e,i,n){for(var o=0,s=e,a=i-n;s<i;s+=n)o+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return o}(t,e,i,n)>0)for(s=e;s<i;s+=n)a=sy(s,t[s],t[s+1],a);else for(s=i-n;s>=e;s-=n)a=sy(s,t[s],t[s+1],a);return a&&Qg(a,a.next)&&(ay(a),a=a.next),a}function Fg(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Qg(n,n.next)&&0!==$g(n.prev,n,n.next))n=n.next;else{if(ay(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function zg(t,e,i,n,o,s,a){if(t){!a&&s&&function(t,e,i,n){var o=t;do{0===o.z&&(o.z=qg(o.x,o.y,e,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,i,n,o,s,a,r,l,c=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,r=0,e=0;e<c&&(r++,n=n.nextZ);e++);for(l=c;r>0||l>0&&n;)0!==r&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,r--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:t=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(t,n,o,s);for(var r,l,c=t;t.prev!==t.next;)if(r=t.prev,l=t.next,s?Vg(t,n,o,s):Hg(t))e.push(r.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),ay(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?zg(t=Gg(Fg(t),e,i),e,i,n,o,s,2):2===a&&Ug(t,e,i,n,o,s):zg(Fg(t),e,i,n,o,s,1);break}}}function Hg(t){var e=t.prev,i=t,n=t.next;if($g(e,i,n)>=0)return!1;for(var o=e.x,s=i.x,a=n.x,r=e.y,l=i.y,c=n.y,u=o<s?o<a?o:a:s<a?s:a,p=r<l?r<c?r:c:l<c?l:c,h=o>s?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==e;){if(m.x>=u&&m.x<=h&&m.y>=p&&m.y<=d&&Zg(o,r,s,l,a,c,m.x,m.y)&&$g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Vg(t,e,i,n){var o=t.prev,s=t,a=t.next;if($g(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,p=s.y,h=a.y,d=r<l?r<c?r:c:l<c?l:c,m=u<p?u<h?u:h:p<h?p:h,f=r>l?r>c?r:c:l>c?l:c,v=u>p?u>h?u:h:p>h?p:h,g=qg(d,m,e,i,n),y=qg(f,v,e,i,n),b=t.prevZ,C=t.nextZ;b&&b.z>=g&&C&&C.z<=y;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&Zg(r,u,l,p,c,h,b.x,b.y)&&$g(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&Zg(r,u,l,p,c,h,C.x,C.y)&&$g(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&Zg(r,u,l,p,c,h,b.x,b.y)&&$g(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&Zg(r,u,l,p,c,h,C.x,C.y)&&$g(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Gg(t,e,i){var n=t;do{var o=n.prev,s=n.next.next;!Qg(o,s)&&ty(o,n,n.next,s)&&ny(o,s)&&ny(s,o)&&(e.push(o.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),ay(n),ay(n.next),n=t=s),n=n.next}while(n!==t);return Fg(n)}function Ug(t,e,i,n,o,s){var a=t;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&Kg(a,r)){var l=oy(a,r);return a=Fg(a,a.next),l=Fg(l,l.next),zg(a,e,i,n,o,s,0),void zg(l,e,i,n,o,s,0)}r=r.next}a=a.next}while(a!==t)}function Wg(t,e){return t.x-e.x}function Yg(t,e){var i=function(t,e){var i,n=e,o=-1/0,s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var r=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(r<=s&&r>o&&(o=r,i=n.x<n.next.x?n:n.next,r===s))return i}n=n.next}while(n!==e);if(!i)return null;var l,c=i,u=i.x,p=i.y,h=1/0;n=i;do{s>=n.x&&n.x>=u&&s!==n.x&&Zg(a<p?s:o,a,u,p,a<p?o:s,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(s-n.x),ny(n,t)&&(l<h||l===h&&(n.x>i.x||n.x===i.x&&Jg(i,n)))&&(i=n,h=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=oy(i,t);return Fg(n,n.next),Fg(i,i.next)}function Jg(t,e){return $g(t.prev,t,e.prev)<0&&$g(e.next,t,t.next)<0}function qg(t,e,i,n,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Xg(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Zg(t,e,i,n,o,s,a,r){return(o-a)*(e-r)>=(t-a)*(s-r)&&(t-a)*(n-r)>=(i-a)*(e-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function Kg(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ty(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(ny(t,e)&&ny(e,t)&&function(t,e){var i=t,n=!1,o=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&($g(t.prev,t,e.prev)||$g(t,e.prev,e))||Qg(t,e)&&$g(t.prev,t,t.next)>0&&$g(e.prev,e,e.next)>0)}function $g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Qg(t,e){return t.x===e.x&&t.y===e.y}function ty(t,e,i,n){var o=iy($g(t,e,i)),s=iy($g(t,e,n)),a=iy($g(i,n,t)),r=iy($g(i,n,e));return o!==s&&a!==r||!(0!==o||!ey(t,i,e))||!(0!==s||!ey(t,n,e))||!(0!==a||!ey(i,t,n))||!(0!==r||!ey(i,e,n))}function ey(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function iy(t){return t>0?1:t<0?-1:0}function ny(t,e){return $g(t.prev,t,t.next)<0?$g(t,e,t.next)>=0&&$g(t,t.prev,e)>=0:$g(t,e,t.prev)<0||$g(t,t.next,e)<0}function oy(t,e){var i=new ry(t.i,t.x,t.y),n=new ry(e.i,e.x,e.y),o=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function sy(t,e,i,n){var o=new ry(t,e,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function ay(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ry(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ly=function(){function t(){k()(this,t)}return _()(t,null,[{key:"area",value:function(t){for(var e=t.length,i=0,n=e-1,o=0;o<e;n=o++)i+=t[n].x*t[o].y-t[o].x*t[n].y;return.5*i}},{key:"isClockWise",value:function(e){return t.area(e)<0}},{key:"triangulateShape",value:function(t,e){var i=[],n=[],o=[];cy(t),uy(i,t);var s=t.length;e.forEach(cy);for(var a=0;a<e.length;a++)n.push(s),s+=e[a].length,uy(i,e[a]);for(var r=function(t,e){var i,n,o,s,a,r,l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,u=e&&e.length,p=u?e[0]*c:t.length,h=Rg(t,0,p,c,!0),d=[];if(!h||h.next===h.prev)return d;if(u&&(h=function(t,e,i,n){var o,s,a,r=[];for(o=0,s=e.length;o<s;o++)(a=Rg(t,e[o]*n,o<s-1?e[o+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),r.push(Xg(a));for(r.sort(Wg),o=0;o<r.length;o++)i=Yg(r[o],i);return i}(t,e,h,c)),t.length>80*c){i=o=t[0],n=s=t[1];for(var m=c;m<p;m+=c)(a=t[m])<i&&(i=a),(r=t[m+1])<n&&(n=r),a>o&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return zg(h,d,c,i,n,l,0),d}(i,n),l=0;l<r.length;l+=3)o.push(r.slice(l,l+3));return o}}])}();function cy(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function uy(t,e){for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}var py=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ig([new rm(.5,.5),new rm(-.5,.5),new rm(-.5,-.5),new rm(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),(t=jd(this,e)).type="ExtrudeGeometry",t.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=t,s=[],a=[],r=0,l=i.length;r<l;r++)c(i[r]);function c(t){var e,i,r,l,c,u=[],p=void 0!==n.curveSegments?n.curveSegments:12,h=void 0!==n.steps?n.steps:1,d=void 0!==n.depth?n.depth:1,m=void 0===n.bevelEnabled||n.bevelEnabled,f=void 0!==n.bevelThickness?n.bevelThickness:.2,v=void 0!==n.bevelSize?n.bevelSize:f-.1,g=void 0!==n.bevelOffset?n.bevelOffset:0,y=void 0!==n.bevelSegments?n.bevelSegments:3,b=n.extrudePath,C=void 0!==n.UVGenerator?n.UVGenerator:hy,w=!1;b&&(e=b.getSpacedPoints(h),w=!0,m=!1,i=b.computeFrenetFrames(h,!1),r=new Nm,l=new Nm,c=new Nm),m||(y=0,f=0,v=0,g=0);var k=t.extractPoints(p),x=k.shape,_=k.holes;if(!ly.isClockWise(x)){x=x.reverse();for(var E=0,S=_.length;E<S;E++){var D=_[E];ly.isClockWise(D)&&(_[E]=D.reverse())}}for(var P=ly.triangulateShape(x,_),M=x,O=0,T=_.length;O<T;O++){var N=_[O];x=x.concat(N)}function B(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,i)}var L=x.length,A=P.length;function j(t,e,i){var n,o,s,a=t.x-e.x,r=t.y-e.y,l=i.x-t.x,c=i.y-t.y,u=a*a+r*r,p=a*c-r*l;if(Math.abs(p)>Number.EPSILON){var h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=e.x-r/h,f=e.y+a/h,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-t.x)*n+(o=f+r*v-t.y)*o;if(g<=2)return new rm(n,o);s=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(r)===Math.sign(c)&&(y=!0),y?(n=-r,o=a,s=Math.sqrt(u)):(n=a,o=r,s=Math.sqrt(u/2))}return new rm(n/s,o/s)}for(var I=[],R=0,F=M.length,z=F-1,H=R+1;R<F;R++,z++,H++)z===F&&(z=0),H===F&&(H=0),I[R]=j(M[R],M[z],M[H]);for(var V,G=[],U=I.concat(),W=0,Y=_.length;W<Y;W++){var J=_[W];V=[];for(var q=0,X=J.length,Z=X-1,K=q+1;q<X;q++,Z++,K++)Z===X&&(Z=0),K===X&&(K=0),V[q]=j(J[q],J[Z],J[K]);G.push(V),U=U.concat(V)}for(var $=0;$<y;$++){for(var Q=$/y,tt=f*Math.cos(Q*Math.PI/2),et=v*Math.sin(Q*Math.PI/2)+g,it=0,nt=M.length;it<nt;it++){var ot=B(M[it],I[it],et);Tt(ot.x,ot.y,-tt)}for(var st=0,at=_.length;st<at;st++){var rt=_[st];V=G[st];for(var lt=0,ct=rt.length;lt<ct;lt++){var ut=B(rt[lt],V[lt],et);Tt(ut.x,ut.y,-tt)}}}for(var pt=v+g,ht=0;ht<L;ht++){var dt=m?B(x[ht],U[ht],pt):x[ht];w?(l.copy(i.normals[0]).multiplyScalar(dt.x),r.copy(i.binormals[0]).multiplyScalar(dt.y),c.copy(e[0]).add(l).add(r),Tt(c.x,c.y,c.z)):Tt(dt.x,dt.y,0)}for(var mt=1;mt<=h;mt++)for(var ft=0;ft<L;ft++){var vt=m?B(x[ft],U[ft],pt):x[ft];w?(l.copy(i.normals[mt]).multiplyScalar(vt.x),r.copy(i.binormals[mt]).multiplyScalar(vt.y),c.copy(e[mt]).add(l).add(r),Tt(c.x,c.y,c.z)):Tt(vt.x,vt.y,d/h*mt)}for(var gt=y-1;gt>=0;gt--){for(var yt=gt/y,bt=f*Math.cos(yt*Math.PI/2),Ct=v*Math.sin(yt*Math.PI/2)+g,wt=0,kt=M.length;wt<kt;wt++){var xt=B(M[wt],I[wt],Ct);Tt(xt.x,xt.y,d+bt)}for(var _t=0,Et=_.length;_t<Et;_t++){var St=_[_t];V=G[_t];for(var Dt=0,Pt=St.length;Dt<Pt;Dt++){var Mt=B(St[Dt],V[Dt],Ct);w?Tt(Mt.x,Mt.y+e[h-1].y,e[h-1].x+bt):Tt(Mt.x,Mt.y,d+bt)}}}function Ot(t,e){for(var i=t.length;--i>=0;){var n=i,o=i-1;o<0&&(o=t.length-1);for(var s=0,a=h+2*y;s<a;s++){var r=L*s,l=L*(s+1);Bt(e+n+r,e+o+r,e+o+l,e+n+l)}}}function Tt(t,e,i){u.push(t),u.push(e),u.push(i)}function Nt(t,e,i){Lt(t),Lt(e),Lt(i);var n=s.length/3,a=C.generateTopUV(o,s,n-3,n-2,n-1);At(a[0]),At(a[1]),At(a[2])}function Bt(t,e,i,n){Lt(t),Lt(e),Lt(n),Lt(e),Lt(i),Lt(n);var a=s.length/3,r=C.generateSideWallUV(o,s,a-6,a-3,a-2,a-1);At(r[0]),At(r[1]),At(r[3]),At(r[1]),At(r[2]),At(r[3])}function Lt(t){s.push(u[3*t+0]),s.push(u[3*t+1]),s.push(u[3*t+2])}function At(t){a.push(t.x),a.push(t.y)}!function(){var t=s.length/3;if(m){for(var e=0,i=L*e,n=0;n<A;n++){var a=P[n];Nt(a[2]+i,a[1]+i,a[0]+i)}i=L*(e=h+2*y);for(var r=0;r<A;r++){var l=P[r];Nt(l[0]+i,l[1]+i,l[2]+i)}}else{for(var c=0;c<A;c++){var u=P[c];Nt(u[2],u[1],u[0])}for(var p=0;p<A;p++){var d=P[p];Nt(d[0]+L*h,d[1]+L*h,d[2]+L*h)}}o.addGroup(t,s.length/3-t,0)}(),function(){var t=s.length/3,e=0;Ot(M,e),e+=M.length;for(var i=0,n=_.length;i<n;i++){var a=_[i];Ot(a,e),e+=a.length}o.addGroup(t,s.length/3-t,1)}()}return t.setAttribute("position",new lv(s,3)),t.setAttribute("uv",new lv(a,2)),t.computeVertexNormals(),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(var n=0,o=t.length;n<o;n++){var s=t[n];i.shapes.push(s.uuid)}else i.shapes.push(t.uuid);return i.options=Object.assign({},e),void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,t)}}],[{key:"fromJSON",value:function(t,i){for(var n=[],o=0,s=t.shapes.length;o<s;o++){var a=i[t.shapes[o]];n.push(a)}var r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new xg[r.type]).fromJSON(r)),new e(n,t.options)}}])}(vv),hy={generateTopUV:function(t,e,i,n,o){var s=e[3*i],a=e[3*i+1],r=e[3*n],l=e[3*n+1],c=e[3*o],u=e[3*o+1];return[new rm(s,a),new rm(r,l),new rm(c,u)]},generateSideWallUV:function(t,e,i,n,o,s){var a=e[3*i],r=e[3*i+1],l=e[3*i+2],c=e[3*n],u=e[3*n+1],p=e[3*n+2],h=e[3*o],d=e[3*o+1],m=e[3*o+2],f=e[3*s],v=e[3*s+1],g=e[3*s+2];return Math.abs(r-u)<Math.abs(a-c)?[new rm(a,1-l),new rm(c,1-p),new rm(h,1-m),new rm(f,1-g)]:[new rm(r,1-l),new rm(u,1-p),new rm(d,1-m),new rm(v,1-g)]}},dy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e);var o=(1+Math.sqrt(5))/2;return(t=jd(this,e,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],i,n])).type="IcosahedronGeometry",t.parameters={radius:i,detail:n},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Og),my=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,e),(t=jd(this,e,[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],i,n])).type="OctahedronGeometry",t.parameters={radius:i,detail:n},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Og),fy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;k()(this,e),(t=jd(this,e)).type="RingGeometry",t.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],p=[],h=i,d=(n-i)/(s=Math.max(1,s)),m=new Nm,f=new rm,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=h*Math.cos(y),m.y=h*Math.sin(y),c.push(m.x,m.y,m.z),u.push(0,0,1),f.x=(m.x/n+1)/2,f.y=(m.y/n+1)/2,p.push(f.x,f.y)}h+=d}for(var b=0;b<s;b++)for(var C=b*(o+1),w=0;w<o;w++){var x=w+C,_=x,E=x+o+1,S=x+o+2,D=x+1;l.push(_,E,D),l.push(E,S,D)}return t.setIndex(l),t.setAttribute("position",new lv(c,3)),t.setAttribute("normal",new lv(u,3)),t.setAttribute("uv",new lv(p,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}])}(vv),vy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ig([new rm(0,.5),new rm(-.5,-.5),new rm(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;k()(this,e),(t=jd(this,e)).type="ShapeGeometry",t.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))p(i);else for(var u=0;u<i.length;u++)p(i[u]),t.addGroup(l,c,u),l+=c,c=0;function p(t){var e=s.length/3,i=t.extractPoints(n),l=i.shape,u=i.holes;!1===ly.isClockWise(l)&&(l=l.reverse());for(var p=0,h=u.length;p<h;p++){var d=u[p];!0===ly.isClockWise(d)&&(u[p]=d.reverse())}for(var m=ly.triangulateShape(l,u),f=0,v=u.length;f<v;f++){var g=u[f];l=l.concat(g)}for(var y=0,b=l.length;y<b;y++){var C=l[y];s.push(C.x,C.y,0),a.push(0,0,1),r.push(C.x,C.y)}for(var w=0,k=m.length;w<k;w++){var x=m[w],_=x[0]+e,E=x[1]+e,S=x[2]+e;o.push(_,E,S),c+=3}}return t.setIndex(o),t.setAttribute("position",new lv(s,3)),t.setAttribute("normal",new lv(a,3)),t.setAttribute("uv",new lv(r,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return function(t,e){if(e.shapes=[],Array.isArray(t))for(var i=0,n=t.length;i<n;i++){var o=t[i];e.shapes.push(o.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}}],[{key:"fromJSON",value:function(t,i){for(var n=[],o=0,s=t.shapes.length;o<s;o++){var a=i[t.shapes[o]];n.push(a)}return new e(n,t.curveSegments)}}])}(vv),gy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;k()(this,e),(t=jd(this,e)).type="SphereGeometry",t.parameters={radius:i,widthSegments:n,heightSegments:o,phiStart:s,phiLength:a,thetaStart:r,thetaLength:l},n=Math.max(3,Math.floor(n)),o=Math.max(2,Math.floor(o));for(var c=Math.min(r+l,Math.PI),u=0,p=[],h=new Nm,d=new Nm,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],C=y/o,w=0;0===y&&0===r?w=.5/n:y===o&&c===Math.PI&&(w=-.5/n);for(var x=0;x<=n;x++){var _=x/n;h.x=-i*Math.cos(s+_*a)*Math.sin(r+C*l),h.y=i*Math.cos(r+C*l),h.z=i*Math.sin(s+_*a)*Math.sin(r+C*l),f.push(h.x,h.y,h.z),d.copy(h).normalize(),v.push(d.x,d.y,d.z),g.push(_+w,1-C),b.push(u++)}p.push(b)}for(var E=0;E<o;E++)for(var S=0;S<n;S++){var D=p[E][S+1],P=p[E][S],M=p[E+1][S],O=p[E+1][S+1];(0!==E||r>0)&&m.push(D,P,O),(E!==o-1||c<Math.PI)&&m.push(P,M,O)}return t.setIndex(m),t.setAttribute("position",new lv(f,3)),t.setAttribute("normal",new lv(v,3)),t.setAttribute("uv",new lv(g,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}])}(vv),yy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,e),(t=jd(this,e,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],i,n])).type="TetrahedronGeometry",t.parameters={radius:i,detail:n},t}return sn()(e,t),_()(e,null,[{key:"fromJSON",value:function(t){return new e(t.radius,t.detail)}}])}(Og),by=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;k()(this,e),(t=jd(this,e)).type="TorusGeometry",t.parameters={radius:i,tube:n,radialSegments:o,tubularSegments:s,arc:a},o=Math.floor(o),s=Math.floor(s);for(var r=[],l=[],c=[],u=[],p=new Nm,h=new Nm,d=new Nm,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;h.x=(i+n*Math.cos(g))*Math.cos(v),h.y=(i+n*Math.cos(g))*Math.sin(v),h.z=n*Math.sin(g),l.push(h.x,h.y,h.z),p.x=i*Math.cos(v),p.y=i*Math.sin(v),d.subVectors(h,p).normalize(),c.push(d.x,d.y,d.z),u.push(f/s),u.push(m/o)}for(var y=1;y<=o;y++)for(var b=1;b<=s;b++){var C=(s+1)*y+b-1,w=(s+1)*(y-1)+b-1,x=(s+1)*(y-1)+b,_=(s+1)*y+b;r.push(C,w,_),r.push(w,x,_)}return t.setIndex(r),t.setAttribute("position",new lv(l,3)),t.setAttribute("normal",new lv(c,3)),t.setAttribute("uv",new lv(u,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}])}(vv),Cy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;k()(this,e),(t=jd(this,e)).type="TorusKnotGeometry",t.parameters={radius:i,tube:n,tubularSegments:o,radialSegments:s,p:a,q:r},o=Math.floor(o),s=Math.floor(s);for(var l=[],c=[],u=[],p=[],h=new Nm,d=new Nm,m=new Nm,f=new Nm,v=new Nm,g=new Nm,y=new Nm,b=0;b<=o;++b){var C=b/o*a*Math.PI*2;N(C,a,r,i,m),N(C+.01,a,r,i,f),g.subVectors(f,m),y.addVectors(f,m),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var w=0;w<=s;++w){var x=w/s*Math.PI*2,_=-n*Math.cos(x),E=n*Math.sin(x);h.x=m.x+(_*y.x+E*v.x),h.y=m.y+(_*y.y+E*v.y),h.z=m.z+(_*y.z+E*v.z),c.push(h.x,h.y,h.z),d.subVectors(h,m).normalize(),u.push(d.x,d.y,d.z),p.push(b/o),p.push(w/s)}}for(var S=1;S<=o;S++)for(var D=1;D<=s;D++){var P=(s+1)*(S-1)+(D-1),M=(s+1)*S+(D-1),O=(s+1)*S+D,T=(s+1)*(S-1)+D;l.push(P,M,T),l.push(M,O,T)}function N(t,e,i,n,o){var s=Math.cos(t),a=Math.sin(t),r=i/e*t,l=Math.cos(r);o.x=n*(2+l)*.5*s,o.y=n*(2+l)*a*.5,o.z=n*Math.sin(r)*.5}return t.setIndex(l),t.setAttribute("position",new lv(c,3)),t.setAttribute("normal",new lv(u,3)),t.setAttribute("uv",new lv(p,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}],[{key:"fromJSON",value:function(t){return new e(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}])}(vv),wy=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wg(new Nm(-1,-1,0),new Nm(-1,1,0),new Nm(1,1,0)),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k()(this,e),(t=jd(this,e)).type="TubeGeometry",t.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);t.tangents=r.tangents,t.normals=r.normals,t.binormals=r.binormals;var l=new Nm,c=new Nm,u=new rm,p=new Nm,h=[],d=[],m=[],f=[];function v(t){p=i.getPointAt(t/n,p);for(var e=r.normals[t],a=r.binormals[t],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*e.x+f*a.x,c.y=v*e.y+f*a.y,c.z=v*e.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=p.x+o*c.x,l.y=p.y+o*c.y,l.z=p.z+o*c.z,h.push(l.x,l.y,l.z)}}return function(){for(var t=0;t<n;t++)v(t);v(!1===a?n:0),function(){for(var t=0;t<=n;t++)for(var e=0;e<=s;e++)u.x=t/n,u.y=e/s,m.push(u.x,u.y)}(),function(){for(var t=1;t<=n;t++)for(var e=1;e<=s;e++){var i=(s+1)*(t-1)+(e-1),o=(s+1)*t+(e-1),a=(s+1)*t+e,r=(s+1)*(t-1)+e;f.push(i,o,r),f.push(o,a,r)}}()}(),t.setIndex(f),t.setAttribute("position",new lv(h,3)),t.setAttribute("normal",new lv(d,3)),t.setAttribute("uv",new lv(m,2)),t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}},{key:"toJSON",value:function(){var t=Ad(e,"toJSON",this,3)([]);return t.path=this.parameters.path.toJSON(),t}}],[{key:"fromJSON",value:function(t){return new e((new xg[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}])}(vv),ky=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(k()(this,e),(t=jd(this,e)).type="WireframeGeometry",t.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new Nm,a=new Nm;if(null!==i.index){var r=i.attributes.position,l=i.index,c=i.groups;0===c.length&&(c=[{start:0,count:l.count,materialIndex:0}]);for(var u=0,p=c.length;u<p;++u)for(var h=c[u],d=h.start,m=d,f=d+h.count;m<f;m+=3)for(var v=0;v<3;v++){var g=l.getX(m+v),y=l.getX(m+(v+1)%3);s.fromBufferAttribute(r,g),a.fromBufferAttribute(r,y),!0===xy(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}}else for(var b=i.attributes.position,C=0,w=b.count/3;C<w;C++)for(var x=0;x<3;x++){var _=3*C+x,E=3*C+(x+1)%3;s.fromBufferAttribute(b,_),a.fromBufferAttribute(b,E),!0===xy(s,a,o)&&(n.push(s.x,s.y,s.z),n.push(a.x,a.y,a.z))}t.setAttribute("position",new lv(n,3))}return t}return sn()(e,t),_()(e,[{key:"copy",value:function(t){return Ad(e,"copy",this,3)([t]),this.parameters=Object.assign({},t.parameters),this}}])}(vv);function xy(t,e,i){var n="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z),o="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z);return!0!==i.has(n)&&!0!==i.has(o)&&(i.add(n),i.add(o),!0)}Object.freeze({__proto__:null,BoxGeometry:jv,CapsuleGeometry:Sg,CircleGeometry:Dg,ConeGeometry:Mg,CylinderGeometry:Pg,DodecahedronGeometry:Tg,EdgesGeometry:jg,ExtrudeGeometry:py,IcosahedronGeometry:dy,LatheGeometry:Eg,OctahedronGeometry:my,PlaneGeometry:qv,PolyhedronGeometry:Og,RingGeometry:fy,ShapeGeometry:vy,SphereGeometry:gy,TetrahedronGeometry:yy,TorusGeometry:by,TorusKnotGeometry:Cy,TubeGeometry:wy,WireframeGeometry:ky});function _y(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Ey(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var Sy=function(){return _()((function t(e,i,n,o){k()(this,t),this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==o?o:new i.constructor(n),this.sampleValues=i,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}),[{key:"evaluate",value:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],o=e[i-1];t:{e:{var s;i:{n:if(!(t<n)){for(var a=i+2;;){if(void 0===n){if(t<o)break n;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(o=n,t<(n=e[++i]))break e}s=e.length;break i}if(t>=o)break t;var r=e[1];t<r&&(i=2,o=r);for(var l=i-2;;){if(void 0===o)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=o,t>=(o=e[--i-1]))break e}s=i,i=0}for(;i<s;){var c=i+s>>>1;t<e[c]?s=c:i=c+1}if(n=e[i],void 0===(o=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,o,n)}return this.interpolate_(i,o,t,n)}},{key:"getSettings_",value:function(){return this.settings||this.DefaultSettings_}},{key:"copySampleValue_",value:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,o=t*n,s=0;s!==n;++s)e[s]=i[o+s];return e}},{key:"interpolate_",value:function(){throw new Error("call to abstract method")}},{key:"intervalChanged_",value:function(){}}])}(),Dy=function(t){function e(t,i,n,o){var s;return k()(this,e),(s=jd(this,e,[t,i,n,o]))._weightPrev=-0,s._offsetPrev=-0,s._weightNext=-0,s._offsetNext=-0,s.DefaultSettings_={endingStart:Fd,endingEnd:Fd},s}return sn()(e,t),_()(e,[{key:"intervalChanged_",value:function(t,e,i){var n=this.parameterPositions,o=t-2,s=t+1,a=n[o],r=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case zd:o=t,a=2*e-i;break;case 2402:a=e+n[o=n.length-2]-n[o+1];break;default:o=t,a=i}if(void 0===r)switch(this.getSettings_().endingEnd){case zd:s=t,r=2*i-e;break;case 2402:s=1,r=i+n[1]-n[0];break;default:s=t-1,r=e}var l=.5*(i-e),c=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(r-i),this._offsetPrev=o*c,this._offsetNext=s*c}},{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=t*a,l=r-a,c=this._offsetPrev,u=this._offsetNext,p=this._weightPrev,h=this._weightNext,d=(i-e)/(n-e),m=d*d,f=m*d,v=-p*f+2*p*m-p*d,g=(1+p)*f+(-1.5-2*p)*m+(-.5+p)*d+1,y=(-1-h)*f+(1.5+h)*m+.5*d,b=h*f-h*m,C=0;C!==a;++C)o[C]=v*s[c+C]+g*s[l+C]+y*s[r+C]+b*s[u+C];return o}}])}(Sy),Py=function(t){function e(t,i,n,o){return k()(this,e),jd(this,e,[t,i,n,o])}return sn()(e,t),_()(e,[{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=t*a,l=r-a,c=(i-e)/(n-e),u=1-c,p=0;p!==a;++p)o[p]=s[l+p]*u+s[r+p]*c;return o}}])}(Sy),My=function(t){function e(t,i,n,o){return k()(this,e),jd(this,e,[t,i,n,o])}return sn()(e,t),_()(e,[{key:"interpolate_",value:function(t){return this.copySampleValue_(t-1)}}])}(Sy),Oy=function(){return _()((function t(e,i,n,o){if(k()(this,t),void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===i||0===i.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=_y(i,this.TimeBufferType),this.values=_y(n,this.ValueBufferType),this.setInterpolation(o||this.DefaultInterpolation)}),[{key:"InterpolantFactoryMethodDiscrete",value:function(t){return new My(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodLinear",value:function(t){return new Py(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodSmooth",value:function(t){return new Dy(this.times,this.values,this.getValueSize(),t)}},{key:"setInterpolation",value:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this}},{key:"scale",value:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this}},{key:"trim",value:function(t,e){for(var i=this.times,n=i.length,o=0,s=n-1;o!==n&&i[o]<t;)++o;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==o||s!==n){o>=s&&(o=(s=Math.max(s,1))-1);var a=this.getValueSize();this.times=i.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}},{key:"validate",value:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var s=null,a=0;a!==o;a++){var r=i[a];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,r),t=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),t=!1;break}s=r}if(void 0!==n&&Ey(n))for(var l=0,c=n.length;l!==c;++l){var u=n[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),t=!1;break}}return t}},{key:"optimize",value:function(){for(var t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=t.length-1,s=1,a=1;a<o;++a){var r=!1,l=t[a];if(l!==t[a+1]&&(1!==a||l!==t[0]))if(n)r=!0;else for(var c=a*i,u=c-i,p=c+i,h=0;h!==i;++h){var d=e[c+h];if(d!==e[u+h]||d!==e[p+h]){r=!0;break}}if(r){if(a!==s){t[s]=t[a];for(var m=a*i,f=s*i,v=0;v!==i;++v)e[f+v]=e[m+v]}++s}}if(o>0){t[s]=t[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)e[y+b]=e[g+b];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*i)):(this.times=t,this.values=e),this}},{key:"clone",value:function(){var t=this.times.slice(),e=this.values.slice(),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(t){var e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:_y(t.times,Array),values:_y(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}])}();Oy.prototype.TimeBufferType=Float32Array,Oy.prototype.ValueBufferType=Float32Array,Oy.prototype.DefaultInterpolation=2301;var Ty=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e)}(Oy);Ty.prototype.ValueTypeName="bool",Ty.prototype.ValueBufferType=Array,Ty.prototype.DefaultInterpolation=2300,Ty.prototype.InterpolantFactoryMethodLinear=void 0,Ty.prototype.InterpolantFactoryMethodSmooth=void 0;var Ny=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e)}(Oy);Ny.prototype.ValueTypeName="color";var By=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e)}(Oy);By.prototype.ValueTypeName="number";var Ly=function(t){function e(t,i,n,o){return k()(this,e),jd(this,e,[t,i,n,o])}return sn()(e,t),_()(e,[{key:"interpolate_",value:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-e)/(n-e),l=t*a,c=l+a;l!==c;l+=4)Tm.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(Sy),Ay=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e,[{key:"InterpolantFactoryMethodLinear",value:function(t){return new Ly(this.times,this.values,this.getValueSize(),t)}}])}(Oy);Ay.prototype.ValueTypeName="quaternion",Ay.prototype.DefaultInterpolation=2301,Ay.prototype.InterpolantFactoryMethodSmooth=void 0;var jy=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e)}(Oy);jy.prototype.ValueTypeName="string",jy.prototype.ValueBufferType=Array,jy.prototype.DefaultInterpolation=2300,jy.prototype.InterpolantFactoryMethodLinear=void 0,jy.prototype.InterpolantFactoryMethodSmooth=void 0;var Iy=function(t){function e(){return k()(this,e),jd(this,e,arguments)}return sn()(e,t),_()(e)}(Oy);Iy.prototype.ValueTypeName="vector";var Ry=_()((function t(e,i,n){k()(this,t);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=i,this.onError=n,this.itemStart=function(t){l++,!1===a&&void 0!==s.onStart&&s.onStart(t,r,l),a=!0},this.itemEnd=function(t){r++,void 0!==s.onProgress&&s.onProgress(t,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return o?o(t):t},this.setURLModifier=function(t){return o=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,i=c.length;e<i;e+=2){var n=c[e],o=c[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return o}return null}})),Fy=new Ry,zy=function(){return _()((function t(e){k()(this,t),this.manager=void 0!==e?e:Fy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(t,e){var i=this;return new Promise((function(n,o){i.load(t,n,e,o)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(t){return this.crossOrigin=t,this}},{key:"setWithCredentials",value:function(t){return this.withCredentials=t,this}},{key:"setPath",value:function(t){return this.path=t,this}},{key:"setResourcePath",value:function(t){return this.resourcePath=t,this}},{key:"setRequestHeader",value:function(t){return this.requestHeader=t,this}}])}();zy.DEFAULT_MATERIAL_NAME="__DEFAULT";Error,new cf,new Nm,new Nm,new cf,new Nm,new Nm,new cf,new cf,new cf;new Nm,new Tm,new Nm,new Nm,new Nm,new Tm,new Nm,new Nm;var Hy="\\[\\]\\.:\\/",Vy=new RegExp("["+Hy+"]","g"),Gy="[^"+Hy+"]",Uy="[^"+Hy.replace("\\.","")+"]",Wy=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",Gy)+/(WCOD+)?/.source.replace("WCOD",Uy)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Gy)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Gy)+"$"),Yy=["material","materials","bones","map"],Jy=function(){function t(e,i,n){k()(this,t),this.path=i,this.parsedPath=n||t.parseTrackName(i),this.node=t.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return _()(t,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(t,e){t[e]=this.targetObject[this.propertyName]}},{key:"_getValue_array",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)t[e++]=i[n]}},{key:"_getValue_arrayElement",value:function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(t,e){this.resolvedProperty.toArray(t,e)}},{key:"_setValue_direct",value:function(t,e){this.targetObject[this.propertyName]=t[e]}},{key:"_setValue_direct_setNeedsUpdate",value:function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++]}},{key:"_setValue_array_setNeedsUpdate",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(t,e){for(var i=this.resolvedProperty,n=0,o=i.length;n!==o;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(t,e){this.resolvedProperty.fromArray(t,e)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(t,e){this.bind(),this.getValue(t,e)}},{key:"_setValue_unbound",value:function(t,e){this.bind(),this.setValue(t,e)}},{key:"bind",value:function(){var e=this.node,i=this.parsedPath,n=i.objectName,o=i.propertyName,s=i.propertyIndex;if(e||(e=t.findNode(this.rootNode,i.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=i.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var r=0;r<e.length;r++)if(e[r].name===a){a=r;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var l=e[o];if(void 0!==l){var c=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===o){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[s]&&(s=e.morphTargetDictionary[s])}u=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=s}else void 0!==l.fromArray&&void 0!==l.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(u=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=o;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var p=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+p+"."+o+" but it wasn't found.",e)}}else console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".")}},{key:"unbind",value:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}],[{key:"create",value:function(e,i,n){return e&&e.isAnimationObjectGroup?new t.Composite(e,i,n):new t(e,i,n)}},{key:"sanitizeNodeName",value:function(t){return t.replace(/\s/g,"_").replace(Vy,"")}},{key:"parseTrackName",value:function(t){var e=Wy.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var o=i.nodeName.substring(n+1);-1!==Yy.indexOf(o)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=o)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}},{key:"findNode",value:function(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var o=t[i];if(o.name===e||o.uuid===e)return o;var s=n(o.children);if(s)return s}return null},o=n(t.children);if(o)return o}return null}}])}();Jy.Composite=function(){return _()((function t(e,i,n){k()(this,t);var o=n||Jy.parseTrackName(i);this._targetGroup=e,this._bindings=e.subscribe_(i,o)}),[{key:"getValue",value:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}},{key:"setValue",value:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,o=i.length;n!==o;++n)i[n].setValue(t,e)}},{key:"bind",value:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}},{key:"unbind",value:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}])}(),Jy.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Jy.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Jy.prototype.GetterByBindingType=[Jy.prototype._getValue_direct,Jy.prototype._getValue_array,Jy.prototype._getValue_arrayElement,Jy.prototype._getValue_toArray],Jy.prototype.SetterByBindingTypeAndVersioning=[[Jy.prototype._setValue_direct,Jy.prototype._setValue_direct_setNeedsUpdate,Jy.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Jy.prototype._setValue_array,Jy.prototype._setValue_array_setNeedsUpdate,Jy.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Jy.prototype._setValue_arrayElement,Jy.prototype._setValue_arrayElement_setNeedsUpdate,Jy.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Jy.prototype._setValue_fromArray,Jy.prototype._setValue_fromArray_setNeedsUpdate,Jy.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1),new cf;new rm,new Nm,new Nm,new Nm,new Nm,new cf,new cf;new Nm,new $f,new $f,new Nm,new Nm,new Nm,new Nm,new Fv;new Am,new Nm;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"164"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="164");i(37);function qy(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xy(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qy(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):qy(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Zy(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ky(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ky(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ky(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function $y(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Qy(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function tb(t,e){return t.get(ib(t,e))}function eb(t,e,i){return t.set(ib(t,e),i),i}function ib(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var nb=new WeakMap,ob=new WeakMap,sb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),Qy(i=$y(this,e,[t,n]),nb,void 0),Qy(i,ob,!1);var s="\n importScripts('".concat(i.getSourceRootPath(),"/3rdparty/turf.min.js');\n self.addEventListener('message', function (e) {\n let features = []\n eval(e.data.code);\n self.postMessage(features);\n }, false);\n "),a="data:text/javascript;charset=utf-8,"+encodeURIComponent(s);if(i._worker=new Worker(a),i.options.angle=i.options.angle||0,i.loaded=!1,i.ismove=!1,i.options.position.lat>83.5&&(i.options.position.lat=83.5),i.options.position.lat<-83.5&&(i.options.position.lat=-83.5),i.options.show=!n.show&&!1!==n.show||n.show,i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attributeType=n.attributeType||"richText",n.text=n.text||{},i.options.text={value:n.text.value||"",show:!n.text.show&&!1!==n.text.show||n.text.show,position:n.text.position,fontSize:n.text.fontSize||0===n.text.fontSize?n.text.fontSize:20,color:n.text.color||"#ffffff",scaleByDistance:n.text.scaleByDistance||!1,near:n.text.near||0===n.text.near?n.text.near:2e3,far:n.text.far||0===n.text.far?n.text.far:1e5},i.options.text.position){var r=turf.point([i.options.position.lng,i.options.position.lat]),l=turf.point([i.options.text.position.lng,i.options.text.position.lat]),c=turf.distance(r,l,{units:"kilometers"}),u=turf.rhumbBearing(r,l);i._textToCenter={distance:c,angle:u}}return i.hierarchys=[],i._elms={},i.Dialog=o,i._isdrag=!1,i._EventBinding=new wn,i.sdk.entityMap.get(i.options.id)?tn()(i):(i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.options.show&&Kt(0,i.options.id),i._entityArray=[],i.init(),i)}return sn()(e,t),_()(e,[{key:"type",get:function(){return"GroundSvg"}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"show",get:function(){return this.options.show},set:function(t){var i,n,o,s,a,r;"boolean"==typeof t?(this.options.text&&this.options.text.show&&this.text&&(this.showView&&3!=this.showView?this.text.show=!1:this.text.show=t),i=e,n="show",o=t,s=this,a=1,r=1,xd()(nn()(r?i.prototype:i),n,o,s,a)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(t){var e=this;if(this.options.position=t,this.options.position.lat>83.5&&(this.options.position.lat=83.5),this.options.position.lat<-83.5&&(this.options.position.lat=-83.5),this._update(),this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(t){var i=[n[0],n[1],t];e.text&&(e.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;if(this.options.color=t,this.options.color)for(var i=0;i<this.entity.values.length;i++)this.entity.values[i].polygon.material=Cesium.Color.fromCssColorString(this.options.color);else for(var n=0;n<this.entity.values.length;n++)this.entity.values[n].polygon.material=Cesium.Color.fromCssColorString(this.entity.values[n].properties.color._value);this._elms.color&&this._elms.color.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color=""}});e._elms.color[i]=n}))}},{key:"angle",get:function(){return this.options.angle},set:function(t){var e=this,i=(Number(t)+360)%360;i=parseFloat(i.toFixed(1)),this.options.angle=i,t>0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale.x=t.x,this.options.scale.y=t.y,this._elms&&(this._elms.xRange&&(this._elms.xRange.value=this.options.scale.x),this._elms.yRange&&(this._elms.yRange.value=this.options.scale.y),this._elms.xInput&&(this._elms.xInput.value=this.options.scale.x),this._elms.yInput&&(this._elms.yInput.value=this.options.scale.y)),this._update()}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(t){"boolean"==typeof t?(this.options.flipe.y=t,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(t){"boolean"==typeof t?(this.options.flipe.x=t,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(t){this.options.text.value=t,this.text?this.text.text=t:e.createText(this),this._elms.textValue&&this._elms.textValue.forEach((function(e){e.value=t}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(t){var e=this;this.options.text.show=t,this.show?(this.showView&&3!=this.showView?this.text&&(this.text.show=!1):this.text&&(this.text.show=t),this.options.text.position&&setTimeout((function(){e.options.text.position.alt?e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,e.options.text.position.alt]):e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat}).then((function(t){e.text&&(e.text.position=[e.options.text.position.lng,e.options.text.position.lat,t])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(e){e.checked=t}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(t){var e=this;this.options.text.color=t,this.text&&(this.text.color=t),this._elms.textColor&&this._elms.textColor.forEach((function(t,i){var n=new YJColorPicker({el:t.el,size:"mini",alpha:!0,defaultColor:e.textColor,disabled:!1,openPickerAni:"opacity",sure:function(t){e.textColor=t},clear:function(){e.textColor="rgba(255,255,255,1)"}});e._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(t){this.options.text.fontSize=t,this.text&&(this.text.fontSize=t,this.text.pixelOffset=t),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(e){e.value=t}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(t){this.options.text.scaleByDistance=t,this.text&&(this.text.scaleByDistance=t),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(e){e.checked=t}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(t){var e=t;e>this.textFar&&(e=this.textFar),this.options.text.near=e,this.text&&(this.text.near=e),this._elms.textNear&&this._elms.textNear.forEach((function(t){t.value=e}))}},{key:"textFar",get:function(){return this.options.text.far},set:function(t){var e=t;e<this.textNear&&(e=this.textNear),this.options.text.far=e,this.text&&(this.text.far=e),this._elms.textFar&&this._elms.textFar.forEach((function(t){t.value=e}))}},{key:"attributeType",get:function(){return this.options.attributeType},set:function(t){this.options.attributeType=t,this._elms.attributeType&&this._elms.attributeType.forEach((function(e){e.value=t}));for(var e=this._DialogObject._element.content.getElementsByClassName("attribute-content"),i=0;i<e.length;i++)e[i].className.indexOf("attribute-content-"+t)>-1?e[i].style.display="block":e[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(t){var e=this;if(this.options.attribute.link.content=t,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s<this.options.attribute.link.content.length;s++){var r='\n <div class="tr">\n <div class="td">'+this.options.attribute.link.content[s].name+'</div>\n <div class="td">'+this.options.attribute.link.content[s].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),p={linkEdit:(c=o()(a.a.mark((function t(i){var n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.options.attribute.link.content;case 2:e.attributeLink=t.sent,n=e._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function t(n){var o,r,l,c,u,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==n){t.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <textarea class="input link-edit" type="text"></textarea>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=e.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(c<l.length)){t.next=35;break}if(l[c]&&l[c].attributes){t.next=14;break}return t.abrupt("continue",32);case 14:u=Zy(l[c].attributes),t.prev=15,d=a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(e=h.value).name){t.next=5;break}return l[c].addEventListener("click",(function(t){"function"==typeof p[e.value]&&p[e.value]({name:r[0].getElementsByClassName("input")[0].value,url:r[1].getElementsByClassName("input")[0].value},n)})),l[c].attributes.removeNamedItem(e.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),u.s();case 18:if((h=u.n()).done){t.next=24;break}return t.delegateYield(d(),"t0",20);case 20:if(!t.t0){t.next=22;break}return t.abrupt("break",24);case 22:t.next=18;break;case 24:t.next=29;break;case 26:t.prev=26,t.t1=t.catch(15),u.e(t.t1);case 29:return t.prev=29,u.f(),t.finish(29);case 32:c++,t.next=11;break;case 35:return t.abrupt("return",1);case 36:case"end":return t.stop()}}),t,null,[[15,26,29,32]])})),l=0;case 8:if(!(l<s.length)){t.next=15;break}return t.delegateYield(r(l),"t0",10);case 10:if(!t.t0){t.next=12;break}return t.abrupt("break",15);case 12:l++,t.next=8;break;case 15:case"end":return t.stop()}}),t)}))),function(t){return c.apply(this,arguments)}),linkDelete:function(t){e.options.attribute.link.content.splice(t,1),e.attributeLink=e.options.attribute.link.content},confirmEdit:function(t,i){var n=t.name&&t.name.replace(/\s/g,""),o=t.url&&t.url.replace(/\s/g,"");n&&o?e.options.attribute.link.content[i]=t:window.ELEMENT&&window.ELEMENT.Message({message:"名称或链接不能为空!",type:"warning",duration:1500}),e.attributeLink=e.options.attribute.link.content},cancelEdit:function(){e.attributeLink=e.options.attribute.link.content},fileSelect:function(t,e){var i=u[e].getElementsByClassName("file-select")[0];i.click(),i.removeEventListener("change",h),i.addEventListener("change",h)}},h=function(t){t.target.value&&(u[t.target.getAttribute("index")].getElementsByClassName("td")[1].getElementsByClassName("input")[0].value=t.target.value,t.target.value=null)},d=function(t){for(var e=u[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Zy(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof p[o.value]&&p[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<u.length;m++)d(m)}}},{key:"init",value:function(){var t=this,i=this.replaceHost(this.options.url,this.options.host);Pe(this.sdk,this.options.id),this.hierarchys=[],this.originalOptions=this.deepCopyObj(this.options);var n=[];(new SVGLoader).load(i,(function(i){if(t.sdk&&t.sdk.viewer&&t.sdk.viewer.entities){i.xml.style.width="0",i.xml.style.height="0",document.body.appendChild(i.xml);var o,s=Zy(i.paths);try{for(s.s();!(o=s.n()).done;){var a=o.value,r=a.userData.style.fill,l=window.getComputedStyle(a.userData.node);if(l.strokeWidth&&(a.userData.style.strokeWidth=Number(l.strokeWidth.replace(/[a-zA-Z]/g,""))),void 0!==r&&"none"!==r){var c,u=Zy(SVGLoader.createShapes(a));try{for(u.s();!(c=u.n()).done;){var p=c.value,h=new THREE.ShapeGeometry(p),d=new THREE.Mesh(h);n.push({geometry:d.geometry,color:r})}}catch(t){u.e(t)}finally{u.f()}}var m=a.userData.style.stroke;if(void 0!==m&&"none"!==m){var f,v=Zy(a.subPaths);try{for(v.s();!(f=v.n()).done;){var g=f.value,y=SVGLoader.pointsToStroke(g.getPoints(),a.userData.style);if(y){var b=new THREE.Mesh(y);n.push({geometry:b.geometry,color:m})}}}catch(t){v.e(t)}finally{v.f()}}}}catch(t){s.e(t)}finally{s.f()}document.body.removeChild(i.xml);for(var C,w=0,k=0,x=0;x<n.length;x++){var _=n[x].geometry;if(_&&_.attributes&&_.attributes.position)for(var E=_.attributes.position.array,S=0;S<E.length;S++)w>E[S]&&(w=E[S]),k<E[S]&&(k=E[S])}(w=Math.abs(w))>(k=Math.abs(k))&&(k=w);var D=k,P=4e3/(k=k*(10/3)*100)/5;D*=P;for(var M=0;M<n.length;M++)n[M].geometry.scale(P,P,1),n[M].geometry.rotateX(THREE.MathUtils.degToRad(180));t._worker.postMessage({code:"\n let geometryArray = e.data.options.geometryArray\n let max2 = e.data.options.max2\n for (let key = 0; key < geometryArray.length; key++) {\n let feature\n let positions = []\n let position = []\n let geometry = geometryArray[key].geometry;\n let array = geometry.attributes.position.array\n \n for (let i = 0; i < array.length; i += 3) {\n let x = array[i] - (max2 / 2)\n let y = array[i + 1] + (max2 / 2)\n position.push([x, y, array[i + 1]])\n }\n if (geometry.index && geometry.index.array) {\n let index = geometry.index.array\n for (let i = 0; i < index.length; i += 3) {\n positions.push([position[index[i]], position[index[i + 1]], position[index[i + 2]]])\n }\n }\n else {\n for (let i = 0; i < position.length; i += 3) {\n positions.push([position[i], position[i + 1], position[i + 2]])\n }\n }\n \n \n let polygons = []\n // 组合多边形\n for (let i = 0; i < positions.length; i++) {\n let polygon = turf.polygon([[\n ...positions[i],\n positions[i][0]\n ]]);\n polygons.push(polygon)\n \n if (feature) {\n feature = turf.union(feature, polygon);\n }\n else {\n feature = polygon\n }\n }\n feature.properties.color = geometryArray[key].color\n features.push(feature)\n }\n ",options:{geometryArray:n,max2:D}}),t._worker.onmessage=function(i){if(t.sdk&&t.sdk.viewer&&t.sdk.viewer.entities){var n=i.data;C=turf.featureCollection(n),t.geojson=JSON.parse(JSON.stringify(C));var o=turf.bbox(C),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=turf.square(o);r[0]=r[0]+t.options.position.lng-s/5,r[1]=r[1]+t.options.position.lat-a/5,r[2]=r[2]+t.options.position.lng+s/5,r[3]=r[3]+t.options.position.lat+a/5,t.bbox=r,t.geojson.features.forEach((function(e){var i=[],n=JSON.parse(JSON.stringify(e));if(n.properties.directionDistance=[],"MultiPolygon"===n.geometry.type)for(var o=0;o<n.geometry.coordinates.length;o++){for(var s=[],a=0;a<n.geometry.coordinates[o].length;a++){for(var r=[],l=0;l<n.geometry.coordinates[o][a].length;l++){var c=turf.point([0,n.geometry.coordinates[o][a][l][1]]),u=turf.point(L()(n.geometry.coordinates[o][a][l])),p=turf.distance(c,u,{units:"kilometers"}),h=turf.rhumbBearing(c,u);r.push({origin:n.geometry.coordinates[o][a][l],distance:p,angle:h})}s.push(r)}n.properties.directionDistance.push(s)}else for(var d=0;d<n.geometry.coordinates.length;d++){for(var m=[],f=0;f<n.geometry.coordinates[d].length;f++){var v=turf.point([0,n.geometry.coordinates[d][f][1]]),g=turf.point(L()(n.geometry.coordinates[d][f])),y=turf.distance(v,g,{units:"kilometers"}),b=turf.rhumbBearing(v,g);m.push({origin:n.geometry.coordinates[d][f],distance:y,angle:b})}n.properties.directionDistance.push(m)}if("MultiPolygon"===n.geometry.type)for(var C=0;C<n.geometry.coordinates.length;C++){var w=t.getHierarchyPolygon(n,C);i.push(w)}else{var k=t.getHierarchyPolygon(n);i.push(k)}t.hierarchys.push(i)})),t.entity=new Cesium.EntityCollection,se(t.sdk,t.options.id);var l=!1;"cesium-viewer 2d"===t.sdk.viewer._element.className&&(l=!0);for(var c=function(e){for(var i=function(i){var n=t.options.id+"-".concat(e,"_").concat(i,"}"),o=t.sdk.viewer.entities.getById(n);o&&t.sdk.viewer.entities.remove(o);var s=t.sdk.viewer.entities.add({id:t.options.id+"-".concat(e,"_").concat(i,"}"),show:t.options.show,polygon:{hierarchy:new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!0),perPositionHeight:l,zIndex:t.sdk._entityZIndex,material:new Cesium.CustomColorMaterialSource({color:t.options.color||t.geojson.features[e].properties.color})},properties:{id:t.options.id}});t.sdk._entityZIndex++,t.geojson.features[e].properties.color&&(s.properties={id:t.options.id,color:t.geojson.features[e].properties.color}),t._entityArray.push(s),t.entity.add(s)},n=0;n<t.hierarchys[e].length;n++)i(n)},u=0;u<t.hierarchys.length;u++)c(u);t.loaded=!0,eb(ob,t,!0),tb(nb,t)&&tb(nb,t).call(t),t.scale=t.scale,e.createText(t)}}}}))}},{key:"edit",value:(r=o()(a.a.mark((function t(e){var i,n,s,r,l,c,u,p,h,d,m=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(tb(ob,this)){t.next=2;break}return t.abrupt("return");case 2:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=42;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"军标属性",left:"180px",top:"100px",confirmCallBack:function(t){m.name=m.name.trim(),m.name||(m.name="未命名对象"),m.text&&(m.options.text.position={lng:m.text.position[0],lat:m.text.position[1],alt:m.text.position[2]}),m.originalOptions=m.deepCopyObj(m.options),m._DialogObject.close();var e=m.deepCopyObj(m.options);e.host="",m.Dialog.confirmCallBack&&m.Dialog.confirmCallBack(e),Pe(m.sdk,m.options.id),se(m.sdk,m.options.id)},resetCallBack:function(){m.reset(),m.Dialog.resetCallBack&&m.Dialog.resetCallBack()},removeCallBack:function(){m.Dialog.removeCallBack&&m.Dialog.removeCallBack()},closeCallBack:function(){m._DialogObject=null,m.drag(!1),m.reset(),m.Dialog.closeCallBack&&m.Dialog.closeCallBack()},showCallBack:function(t){m.show=t,m.Dialog.showCallBack&&m.Dialog.showCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"Y轴翻转",event:["click",function(){m.flipeY=!m.flipeY}]},{tagName:"button",className:"flipe-over-x",innerHTML:"X轴翻转",event:["click",function(){m.flipeX=!m.flipeX}]},{tagName:"button",className:"drag",innerHTML:"编辑",event:["click",function(){m.drag(!m._isdrag)}]}]},!0);case 7:return this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-svg",(i=document.createElement("div")).innerHTML=Od(this),t.next=13,this._DialogObject.contentAppChild(i);case 13:this.attributeType=this.options.attributeType,n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color||void 0,disabled:!1,openPickerAni:"opacity",sure:function(t){m.color=t},clear:function(){m.color=""}}),s=new YJColorPicker({el:i.getElementsByClassName("textColor")[0],size:"mini",alpha:!0,defaultColor:this.textColor,disabled:!1,openPickerAni:"opacity",sure:function(t){m.textColor=t},clear:function(){m.textColor="rgba(255,255,255,1)"}}),r=i.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.color=[n],this._elms.textColor=[s],setTimeout(o()(a.a.mark((function t(){var e,n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(m.sdk&&m.sdk.tabHide&&Array.isArray(m.sdk.tabHide))){t.next=9;break}e=0;case 2:if(!(e<m.sdk.tabHide.length)){t.next=9;break}if("属性信息"!==m.sdk.tabHide[e]){t.next=6;break}return i.getElementsByClassName("attribute-info")[0].style.display="none",t.abrupt("break",9);case 6:e++,t.next=2;break;case 9:if(m.attributeLink=m.options.attribute.link.content,n=m.attributeSelect,!(o=m._DialogObject._element.content.getElementsByClassName("attribute-select-box")[0])){t.next=26;break}(s=Y(o,".attribute-select")).legp_search(n),r=m._DialogObject._element.content.getElementsByClassName("attribute-select")[0].getElementsByTagName("input")[0],l=0;case 17:if(!(l<n.length)){t.next=25;break}if(n[l].key!==m.options.attributeType){t.next=22;break}return r.value=n[l].value,s.legp_searchActive(n[l].value),t.abrupt("break",25);case 22:l++,t.next=17;break;case 25:r.addEventListener("input",(function(){for(var t=0;t<n.length;t++)if(n[t].value===r.value){m.attributeType=n[t].key;break}}));case 26:case"end":return t.stop()}}),t)}))),0),l=i.getElementsByClassName("x-scale")[0],c=i.getElementsByClassName("y-scale")[0],u=l.getElementsByTagName("input")[0],p=l.getElementsByTagName("input")[1],h=c.getElementsByTagName("input")[0],d=c.getElementsByTagName("input")[1],u.value=this.scale.x,p.value=this.scale.x,h.value=this.scale.y,d.value=this.scale.y,this._elms.xRange=u,this._elms.yRange=h,this._elms.xInput=p,this._elms.yInput=d,u.addEventListener("input",(function(t){m.scale={x:u.value,y:m.scale.y}})),h.addEventListener("input",(function(t){m.scale={x:m.scale.x,y:h.value}})),p.addEventListener("input",(function(t){var e=t.target.value;e=Number(e),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||e<=Number(t.target.max)&&e>=Number(t.target.min))&&(m.scale={x:e,y:m.scale.y})})),p.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),m.scale={x:e,y:m.scale.y}})),d.addEventListener("input",(function(t){var e=t.target.value;e=Number(e),"."==t.data||"-"==t.data&&!t.target.value||(!t.target.max&&!t.target.min||e<=Number(t.target.max)&&e>=Number(t.target.min))&&(m.scale={x:m.scale.x,y:e})})),d.addEventListener("blur",(function(t){var e=t.target.value;e=Number(e),t.target.max&&e>Number(t.target.max)&&(e=Number(t.target.max)),t.target.min&&e<Number(t.target.min)&&(e=Number(t.target.min)),m.scale={x:m.scale.x,y:e}}));case 42:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"reset",value:function(){tb(ob,this)&&(this.options=this.deepCopyObj(this.originalOptions),this.position=this.originalOptions.position,this.name=this.originalOptions.name,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color,this.text&&!this.originalOptions.text.position&&(this.text.remove(),this.text=null),this.attributeLink=this.options.attribute.link.content,this.textShow=this.originalOptions.text.show,this.textValue=this.originalOptions.text.value,this.textColor=this.originalOptions.text.color,this.textFontSize=this.originalOptions.text.fontSize,this.textScaleByDistance=this.originalOptions.text.scaleByDistance,this.textNear=this.originalOptions.text.near,this.textFar=this.originalOptions.text.far)}},{key:"drag",value:function(t,e){var i=this;if(tb(ob,this)&&this.sdk&&this.sdk.viewer)if(this.ismove=!1,this._isdrag=t,this.ScreenSpaceEventHandler&&(this.ScreenSpaceEventHandler.destroy(),this.ScreenSpaceEventHandler=null),t){this.ScreenSpaceEventHandler=new Cesium.ScreenSpaceEventHandler(this.sdk.viewer.canvas);var n=Math.abs(this.bbox[0]-this.bbox[2]),s=Math.abs(this.bbox[1]-this.bbox[3]);this.ScreenSpaceEventHandler.setInputAction(function(){var t=o()(a.a.mark((function t(e){var o,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D,P,M,O,T,N,B,L,A,j,I,R,F,z,H,V;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!i.pickPoint){t.next=114;break}if(o=i.pickPoint.position.getValue(),(r=i.sdk.viewer.scene.pickPosition(e.endPosition))||(l=i.sdk.viewer.camera.getPickRay(e.endPosition),r=i.sdk.viewer.scene.globe.pick(l,i.sdk.viewer.scene)),o&&r){t.next=6;break}return t.abrupt("return");case 6:c=i.cartesian3Towgs84(o,i.sdk.viewer),u=i.cartesian3Towgs84(r,i.sdk.viewer),p=0,h=0,f=3.5*i.scale.x,v=3.5*i.scale.y,g=Math.sqrt(Math.pow(f/2,2)+Math.pow(v/2,2)),y=Math.atan(f/2/(v/2))*(180/Math.PI),isNaN(y)&&(y=0),w=turf.point([i.position.lng,i.position.lat]),k={units:"kilometers"},(x=[])[0]=turf.destination(w,v/2*1.5,0+i.options.angle,k).geometry.coordinates,x[1]=turf.destination(w,g,180+y+i.options.angle,k).geometry.coordinates,x[2]=turf.destination(w,v/2,180+i.options.angle,k).geometry.coordinates,x[3]=turf.destination(w,g,180-y+i.options.angle,k).geometry.coordinates,x[4]=turf.destination(w,f/2,270+i.options.angle,k).geometry.coordinates,x[5]=[i.position.lng,i.position.lat],x[6]=turf.destination(w,f/2,90+i.options.angle,k).geometry.coordinates,x[7]=turf.destination(w,g,360-y+i.options.angle,k).geometry.coordinates,x[8]=turf.destination(w,v/2,0+i.options.angle,k).geometry.coordinates,x[9]=turf.destination(w,g,0+y+i.options.angle,k).geometry.coordinates,_=turf.point([c.lng,c.lat]),E=turf.point([u.lng,u.lat]),S=turf.point([i.position.lng,i.position.lat]),D=turf.rhumbBearing(S,_),P=turf.rhumbBearing(S,E),M=(P+360-i.angle)%360,N=turf.rhumbDistance(S,E,k),B=!1,L=!1,t.t0=i.pickPoint.id,t.next="svg-control-points_0"===t.t0?40:"svg-control-points_1"===t.t0||"svg-control-points_7"===t.t0?43:"svg-control-points_2"===t.t0||"svg-control-points_8"===t.t0?57:"svg-control-points_3"===t.t0||"svg-control-points_9"===t.t0?64:"svg-control-points_4"===t.t0?78:"svg-control-points_5"===t.t0?85:"svg-control-points_6"===t.t0?95:102;break;case 40:return y=P-D,i.angle+=y,t.abrupt("break",102);case 43:return T=(turf.rhumbBearing(S,turf.point(x[4]))+360-i.angle)%360,O=(turf.rhumbBearing(S,turf.point(x[2]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-O)>-360&&C<-90||C<360&&C>90)&&(C+=180,L=!0),B&&L?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):L?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,t.abrupt("break",102);case 57:return O=(turf.rhumbBearing(S,turf.point(x[2]))+360-i.angle)%360,(C=M-O)>-360&&C<-90||C<360&&C>90?(C+=180,i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#00ff0a")),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,t.abrupt("break",102);case 64:return T=(turf.rhumbBearing(S,turf.point(x[6]))+360-i.angle)%360,O=(turf.rhumbBearing(S,turf.point(x[2]))+360-i.angle)%360,((b=M-T)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-O)>-360&&C<-90||C<360&&C>90)&&(C+=180,L=!0),B&&L?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):L?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,t.abrupt("break",102);case 78:return T=(turf.rhumbBearing(S,turf.point(x[4]))+360-i.angle)%360,(b=M-T)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",102);case 85:return u.lat>83.5&&(u.lat=83.5),u.lat<-83.5&&(u.lat=-83.5),i.position={lng:u.lng,lat:u.lat},A=u.lng-c.lng,j=u.lat-c.lat,i.bbox[0]=i.bbox[0]+A,i.bbox[1]=i.bbox[1]+j,i.bbox[2]=i.bbox[2]+A,i.bbox[3]=i.bbox[3]+j,t.abrupt("break",102);case 95:return T=(turf.rhumbBearing(S,turf.point(x[6]))+360-i.angle)%360,(b=M-T)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,t.abrupt("break",102);case 102:p=p/(n/2)*100,h=h/(s/2)*100,(I=Xy({},i.scale)).x=I.x+p,I.y=I.y-h,I.y>200&&(I.y=200),I.y<.001&&(I.y=.001),I.x>200&&(I.x=200),I.x<.001&&(I.x=.001),i.scale=Xy({},I),t.next=141;break;case 114:R=i.sdk.viewer.scene.drillPick(e.endPosition),z=0;case 116:if(!(z<R.length)){t.next=124;break}if(!((H=R[z])&&H.primitive&&H.primitive._id&&H.primitive._id.id&&-1!==H.primitive._id.id.indexOf("svg-control-points_"))){t.next=121;break}return F=H.primitive._id,t.abrupt("break",124);case 121:z++,t.next=116;break;case 124:V=0;case 125:if(!(V<i.pointEntityCollection.values.length)){t.next=141;break}if(!F||i.pointEntityCollection.values[V].id!==F.id){t.next=130;break}F.point.color=Cesium.Color.fromCssColorString("#ffff00"),t.next=138;break;case 130:t.t1=i.pointEntityCollection.values[V].id,t.next="svg-control-points_5"===t.t1?133:"svg-control-points_0"===t.t1?135:137;break;case 133:return i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#ffff00"),t.abrupt("break",138);case 135:return i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#ff0000"),t.abrupt("break",138);case 137:i.pointEntityCollection.values[V].point.color=Cesium.Color.fromCssColorString("#00ff0a");case 138:V++,t.next=125;break;case 141:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.ScreenSpaceEventHandler.setInputAction((function(t){for(var e=i.sdk.viewer.scene.drillPick(t.position),n=0;n<e.length;n++){var o=e[n];if(o&&o.primitive&&o.primitive._id&&o.primitive._id.objectId===i.options.id&&o.primitive._id.id&&-1!==o.primitive._id.id.indexOf("svg-control-points_")){YJ.Global.CameraController(i.sdk,!1),i.pickPoint=o.primitive._id,i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break}}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.ScreenSpaceEventHandler.setInputAction((function(t){if(i.pickPoint){switch(YJ.Global.CameraController(i.sdk,!0),i.pickPoint.id){case"svg-control-points_4":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ffff00");break;case"svg-control-points_9":i.pickPoint.point.color=Cesium.Color.fromCssColorString("#ff0000");break;default:i.pickPoint.point.color=Cesium.Color.fromCssColorString("#00ff0a")}i.pickPoint=null}}),Cesium.ScreenSpaceEventType.LEFT_UP),this.ScreenSpaceEventHandler.setInputAction((function(t){i.drag(!1),i._DialogObject||(e&&e(i.options),Pe(i.sdk,i.options.id),se(i.sdk,i.options.id))}),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.pointEntityCollection=new Cesium.EntityCollection;var r=3.5*this.scale.x,l=3.5*this.scale.y,c=Math.sqrt(Math.pow(r/2,2)+Math.pow(l/2,2)),u=Math.atan(r/2/(l/2))*(180/Math.PI);isNaN(u)&&(u=0);var p=turf.point([this.position.lng,this.position.lat]),h={units:"kilometers"},d=[];if(d[0]=turf.destination(p,l/2*1.5,0,h).geometry.coordinates,d[1]=turf.destination(p,c,180+u,h).geometry.coordinates,d[2]=turf.destination(p,l/2,180,h).geometry.coordinates,d[3]=turf.destination(p,c,180-u,h).geometry.coordinates,d[4]=turf.destination(p,r/2,270,h).geometry.coordinates,d[5]=[this.position.lng,this.position.lat],d[6]=turf.destination(p,r/2,90,h).geometry.coordinates,d[7]=turf.destination(p,c,360-u,h).geometry.coordinates,d[8]=turf.destination(p,l/2,0,h).geometry.coordinates,d[9]=turf.destination(p,c,0+u,h).geometry.coordinates,this.controlPoints=d,!this.sdk||!this.sdk.viewer)return;for(var m=function(t){var e="#00ff0a";5===t&&(e="#ffff00"),0===t&&(e="#ff0000");var n=i.sdk.viewer.entities.getOrCreateEntity("svg-control-points_"+t);n.show=!0,n.objectId=i.options.id,n.position=new Cesium.CallbackProperty((function(){var e;return(e=Cesium.Cartesian3).fromDegrees.apply(e,L()(i.controlPoints[t]))})),n.point=new Cesium.PointGraphics({color:Cesium.Color.fromCssColorString(e),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,scaleByDistance:new Cesium.NearFarScalar(0,1,1e10,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}),i.pointEntityCollection.add(n)},f=0;f<this.controlPoints.length;f++)m(f);this._update()}else for(var v=0;v<this.controlPoints.length;v++){var g=this.sdk.viewer.entities.getById("svg-control-points_"+v);g&&g.objectId===this.options.id&&(g.show=!1)}}},{key:"getHierarchyPolygon",value:function(t,e){if(t){var i={},n=[],o=t.properties.directionDistance;void 0!==e&&(o=t.properties.directionDistance[e]);for(var s=0;s<o.length;s++){for(var a=[],r=0;r<o[s].length;r++){var l,c=this.options.position.lng,u=o[s][r].origin[1]+this.options.position.lat;u>90&&(c+=180);var p=[c,u],h=turf.point(p),d=turf.rhumbDestination(h,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=L()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,L()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(t,e,i){if(tb(ob,this)){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===N()(t[0]))for(var s=0;s<t.length;s++)this._updateGeojson(t[s],e,i);else{for(var a=0;a<t.length;a+=2)t[a]=t[a]+t[a]/(n/2)*e;for(var r=1;r<t.length;r+=2)t[r]=t[r]-t[r]/(o/2)*i}}}},{key:"_update",value:function(){var t=this;if(tb(ob,this)){var e,i=turf.point([this.position.lng,this.position.lat]),n={units:"kilometers"},o=L()(this.bbox),s=Math.abs(o[2]-o[0]),a=Math.abs(o[3]-o[1]),r=s/2*this.options.scale.x/100-s/2,l=a/2*-this.options.scale.y/100+a/2;o[0]=o[0]-r,o[1]=o[1]+l,o[2]=o[2]+r,o[3]=o[3]-l,o[0]>o[2]&&(e=o[0],o[0]=o[2],o[2]=e),o[1]>o[3]&&(e=o[1],o[1]=o[3],o[3]=e);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),p=function(e){for(var i=0;i<e.length;i++)"number"==typeof e[i]?(t.options.flipe.x&&1===i&&(e[i]=-e[i]),t.options.flipe.y&&0===i&&(e[i]=-e[i])):p(e[i])},h=0;h<u.features.length;h++)p(u.features[h].geometry.coordinates);if(u.features.forEach((function(e){var o=[],s=JSON.parse(JSON.stringify(e));t._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,t.angle,{pivot:[0,0]})).geometry.type)for(var u=0;u<s.geometry.coordinates.length;u++){for(var p=[],h=0;h<s.geometry.coordinates[u].length;h++){for(var d=[],m=0;m<s.geometry.coordinates[u][h].length;m++){var f=turf.point([0,s.geometry.coordinates[u][h][m][1]]),v=turf.point(L()(s.geometry.coordinates[u][h][m])),g=turf.distance(f,v,{units:"kilometers"}),y=turf.rhumbBearing(f,v);d.push({origin:s.geometry.coordinates[u][h][m],distance:g,angle:y})}p.push(d)}a.push(p)}else for(var b=0;b<s.geometry.coordinates.length;b++){for(var C=[],w=0;w<s.geometry.coordinates[b].length;w++){var k=turf.point([0,s.geometry.coordinates[b][w][1]]),x=turf.point(L()(s.geometry.coordinates[b][w])),_=turf.distance(k,x,{units:"kilometers"}),E=turf.rhumbBearing(k,x);C.push({origin:s.geometry.coordinates[b][w],distance:_,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*t.scale.x,D=3.5*t.scale.y,P=Math.sqrt(Math.pow(S/2,2)+Math.pow(D/2,2)),M=Math.atan(S/2/(D/2))*(180/Math.PI);isNaN(M)&&(M=0);var O=[];O[0]=turf.destination(i,D/2*1.5,0+t.options.angle,n).geometry.coordinates,O[1]=turf.destination(i,P,180+M+t.options.angle,n).geometry.coordinates,O[2]=turf.destination(i,D/2,180+t.options.angle,n).geometry.coordinates,O[3]=turf.destination(i,P,180-M+t.options.angle,n).geometry.coordinates,O[4]=turf.destination(i,S/2,270+t.options.angle,n).geometry.coordinates,O[5]=[t.position.lng,t.position.lat],O[6]=turf.destination(i,S/2,90+t.options.angle,n).geometry.coordinates,O[7]=turf.destination(i,P,360-M+t.options.angle,n).geometry.coordinates,O[8]=turf.destination(i,D/2,0+t.options.angle,n).geometry.coordinates,O[9]=turf.destination(i,P,0+M+t.options.angle,n).geometry.coordinates;var T=turf.points(O);O=[];for(var N=0;N<T.features.length;N++)O.push(T.features[N].geometry.coordinates);if(t.controlPoints=O,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var A=t.getHierarchyPolygon(s,B);o.push(A)}else{var j=t.getHierarchyPolygon(s);o.push(j)}c.push(o)})),this.hierarchys=[].concat(c),this.entity){if(this._DialogObject||this._isdrag)for(var d=0,m=function(e){for(var i=function(i){t.entity.values[d].polygon.hierarchy.isConstant&&(t.entity.values[d].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!1)),d++},n=0;n<t.hierarchys[e].length;n++)i(n)},f=0;f<this.hierarchys.length;f++)m(f);else for(var v=0,g=function(e){for(var i=function(i){t.entity.values[v].polygon.hierarchy=new Cesium.CallbackProperty((function(){for(var n=t.hierarchys[e][i],o=[],s=0;s<n.holes.length;s++)o.push({positions:n.holes[s]});return{positions:n.positions,holes:o}}),!t.ismove),v++},n=0;n<t.hierarchys[e].length;n++)i(n)},y=0;y<this.hierarchys.length;y++)g(y);if(this.textObject&&this.textObject.geojson){for(var b=[],C=JSON.parse(JSON.stringify(this.textObject.geojson)),w=0;w<C.features.length;w++)p(C.features[w].geometry.coordinates);C.features.forEach((function(e){var o=[],s=JSON.parse(JSON.stringify(e));t._updateGeojson(s.geometry.coordinates,r,l);var a=[];if("MultiPolygon"===(s=turf.transformRotate(s,t.angle,{pivot:[0,0]})).geometry.type)for(var c=0;c<s.geometry.coordinates.length;c++){for(var u=[],p=0;p<s.geometry.coordinates[c].length;p++){for(var h=[],d=0;d<s.geometry.coordinates[c][p].length;d++){var m=turf.point([0,s.geometry.coordinates[c][p][d][1]]),f=turf.point(L()(s.geometry.coordinates[c][p][d])),v=turf.distance(m,f,{units:"kilometers"}),g=turf.rhumbBearing(m,f);h.push({origin:s.geometry.coordinates[c][p][d],distance:v,angle:g})}u.push(h)}a.push(u)}else for(var y=0;y<s.geometry.coordinates.length;y++){for(var C=[],w=0;w<s.geometry.coordinates[y].length;w++){var k=turf.point([0,s.geometry.coordinates[y][w][1]]),x=turf.point(L()(s.geometry.coordinates[y][w])),_=turf.distance(k,x,{units:"kilometers"}),E=turf.rhumbBearing(k,x);C.push({origin:s.geometry.coordinates[y][w],distance:_,angle:E})}a.push(C)}s.properties.directionDistance=a;var S=3.5*t.scale.x,D=3.5*t.scale.y,P=Math.sqrt(Math.pow(S/2,2)+Math.pow(D/2,2)),M=Math.atan(S/2/(D/2))*(180/Math.PI);isNaN(M)&&(M=0);var O=[];O[0]=turf.destination(i,D/2*1.5,0+t.options.angle,n).geometry.coordinates,O[1]=turf.destination(i,P,180+M+t.options.angle,n).geometry.coordinates,O[2]=turf.destination(i,D/2,180+t.options.angle,n).geometry.coordinates,O[3]=turf.destination(i,P,180-M+t.options.angle,n).geometry.coordinates,O[4]=turf.destination(i,S/2,270+t.options.angle,n).geometry.coordinates,O[5]=[t.position.lng,t.position.lat],O[6]=turf.destination(i,S/2,90+t.options.angle,n).geometry.coordinates,O[7]=turf.destination(i,P,360-M+t.options.angle,n).geometry.coordinates,O[8]=turf.destination(i,D/2,0+t.options.angle,n).geometry.coordinates,O[9]=turf.destination(i,P,0+M+t.options.angle,n).geometry.coordinates;var T=turf.points(O);O=[];for(var N=0;N<T.features.length;N++)O.push(T.features[N].geometry.coordinates);if(t.controlPoints=O,"MultiPolygon"===s.geometry.type)for(var B=0;B<s.geometry.coordinates.length;B++){var A=t.getHierarchyPolygon(s,B);o.push(A)}else{var j=t.getHierarchyPolygon(s);o.push(j)}b.push(o)})),this.textObject.hierarchys=[].concat(b)}}}}},{key:"textPosPick",value:function(){var t=this;new al(this.sdk).start(function(){var i=o()(a.a.mark((function i(n,o){var s,r,l,c;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:s=turf.point([t.position.lng,t.position.lat]),r=turf.point([o.lng,o.lat]),l=turf.distance(s,r,{units:"kilometers"}),c=turf.rhumbBearing(s,r),t._textToCenter={distance:l,angle:c},t.options.text.position=o,t.text?t.text.position=[o.lng,o.lat,o.alt]:e.createText(t);case 7:case"end":return i.stop()}}),i)})));return function(t,e){return i.apply(this,arguments)}}())}},{key:"load",value:function(t){tb(ob,this)?t():eb(nb,this,t)}},{key:"remove",value:(s=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._worker.onmessage=function(t){},t.next=3,this.sdk.removeIncetance(this.options.id);case 3:if(this.entity){t.next=5;break}return t.abrupt("return");case 5:if(this.drag(!1),this.sdk&&this.sdk.viewer){t.next=8;break}return t.abrupt("return");case 8:for(this.sdk.viewer.entities.remove(this.entity),this.text&&this.text.remove(),e=this.entity.values.length;e>=0;e--)this.sdk.viewer.entities.remove(this.entity.values[e]);return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=14,Pe(this.sdk,this.options.id);case 14:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(t){this.options.attribute.link.content.push({name:"链接",url:t}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.name,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}},{key:"setPosition",value:function(t){if(t){this.ismove=!0;var e={};e.lng=t.position.lng,e.lat=t.position.lat,this.position=e}else this.ismove=!1;this._update()}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=24;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),(l=Xy({},this.options.position)).hasOwnProperty("alt")){t.next=17;break}return t.next=16,this.getClampToHeight(l);case 16:l.alt=t.sent;case 17:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=37;break;case 24:c=[],u=0;case 26:if(!(u<this.controlPoints.length)){t.next=35;break}return t.next=29,this.getClampToHeight({lng:this.controlPoints[u][0],lat:this.controlPoints[u][1]});case 29:p=t.sent,h=Cesium.Cartesian3.fromDegrees(this.controlPoints[u][0],this.controlPoints[u][1],p),c.push(h.x,h.y,h.z);case 32:u++,t.next=26;break;case 35:d=Cesium.BoundingSphere.fromVertices(c),this.sdk.viewer.camera.flyToBoundingSphere(d,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 37:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}],[{key:"createText",value:(i=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.text.position){t.next=10;break}if(!e.options.text.position.alt){t.next=5;break}i=e.options.text.position.alt,t.next=8;break;case 5:return t.next=7,e.getClampToHeight({lng:e.options.text.position.lng,lat:e.options.text.position.lat});case 7:i=t.sent;case 8:e.text=new no(e.sdk,C()(C()(C()({id:e.options.id,show:!!e.options.show&&!!e.options.text.show&&e.options.text.show,position:[e.options.text.position.lng,e.options.text.position.lat,i],text:e.options.text.value,fontSize:e.options.text.fontSize,color:e.options.text.color,pixelOffset:e.options.text.fontSize,backgroundColor:e.options.text.backgroundColor,lineColor:"#ffffff00",lineWidth:0,scaleByDistance:e.options.text.scaleByDistance},"backgroundColor",["#ffffff00","#ffffff00"]),"near",e.options.text.near),"far",e.options.text.far)),e.text.entity.billboard.verticalOrigin=Cesium.VerticalOrigin.CENTER;case 10:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r}(Wn);function ab(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return rb(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?rb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function rb(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function lb(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var cb,ub=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),i=lb(this,e,[t,n]),YJ.RoutePlanningArrays.push(i),i.options.width=n.width||4,i.options.color=n.color||"#ff0000",i.options.gps=n.gps||!1,i.Dialog=o,i._elms={},i.start={lng:null,lat:null},i.end={lng:null,lat:null},i.init(),i}return sn()(e,t),_()(e,[{key:"init",value:function(){var t=this;this.startEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-start"),!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity.show=!1:this.startEntity.show=!0,this.startEntity.position=new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),this.startEntity.billboard={image:this.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.endEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-end"),!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity.show=!1:this.endEntity.show=!0,this.endEntity.position=new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),this.endEntity.billboard={image:this.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.edit(!0),this.clear()}},{key:"startLng",get:function(){return this.start.lng},set:function(t){this.start.lng=t,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLng&&this._elms.startLng.forEach((function(e){e.value=t}))}},{key:"startLat",get:function(){return this.start.lat},set:function(t){this.start.lat=t,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLat&&this._elms.startLat.forEach((function(e){e.value=t}))}},{key:"endLng",get:function(){return this.end.lng},set:function(t){this.end.lng=t,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLng&&this._elms.endLng.forEach((function(e){e.value=t}))}},{key:"endLat",get:function(){return this.end.lat},set:function(t){this.end.lat=t,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLat&&this._elms.endLat.forEach((function(e){e.value=t}))}},{key:"edit",value:(i=o()(a.a.mark((function t(i){var n,o,s,r,l,c,u=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=42;break}return this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),this._element_style.innerHTML="\n .YJ-custom-base-dialog>.content {\n width: 460px;\n }\n .YJ-custom-base-dialog>.content>div>.row .col {\n margin: 0 10px;\n }\n .YJ-custom-base-dialog>.content .row .label {\n flex: auto;\n }\n",t.next=11,new W(this.sdk.viewer._container,{title:"路径规划",closeCallBack:function(){u.tip&&u.tip.destroy(),u.event&&u.event.destroy(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()}});case 11:return this._DialogObject=t.sent,t.next=14,this._DialogObject.init();case 14:(n=document.createElement("div")).style.position="absolute",n.style.left="24px",n.style.flet="0",n.style.display="flex",this._DialogObject.footAppChild(n),(o=document.createElement("button")).className="default",o.innerHTML='<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询',o.style.width="auto",o.addEventListener("click",(function(){!u.startLng&&0!==u.startLng||!u.startLat&&0!==u.startLat||!u.endLng&&0!==u.endLng||!u.endLat&&0!==u.endLat?console.error("请先设置起点和终点坐标!"):(!u.startEntity&&(u.startEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return u.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(u.startLng,u.startLat))}),!1),billboard:{image:u.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.startEntity.show=!0,!u.endEntity&&(u.endEntity=u.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return u.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(u.endLng,u.endLat))}),!1),billboard:{image:u.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),u.endEntity.show=!0,u.Dialog.queryCallBack&&u.Dialog.queryCallBack({start:[u.startLng,u.startLat],end:[u.endLng,u.endLat]}))})),n.appendChild(o),(s=document.createElement("button")).className="default",s.innerHTML='<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线',s.style.width="auto",s.style.marginLeft="10px",s.addEventListener("click",(function(){u.clear()})),n.appendChild(s),document.getElementsByTagName("head")[0].appendChild(this._element_style),(r=document.createElement("div")).innerHTML='\n <div class="row" style="align-items: flex-start;">\n <div class="col start-col">\n <span class="label">起点</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="startLng">\n <input class="input" type="number" title="" min="-90" max="90" @model="startLat">\n <button @click="pickStartPos" style="margin-left: 10px;">拾取</button>\n </div>\n </div>\n <div class="row" style="align-items: flex-start;">\n <div class="col">\n <span class="label">终点</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="endLng">\n <input class="input" type="number" title="" min="-90" max="90" @model="endLat">\n <button class="end-pick-btn" @click="pickEndPos" style="margin-left: 10px;">拾取</button>\n </div>\n </div>\n ',this._DialogObject.contentAppChild(r),this.options.gps&&((l=document.createElement("button")).innerHTML="当前位置",l.style.marginLeft="10px",l.setAttribute("data-is","start"),l.addEventListener("click",(function(t){u.getLocateCurrent(t)})),r.getElementsByClassName("start-col")[0].appendChild(l),this._DialogObject._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),c=r.getElementsByTagName("*"),e.EventBinding(this,c),t.next=44;break;case 42:this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 44:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"clear",value:function(){this.startEntity&&(this.sdk.viewer.entities.remove(this.startEntity),this.startEntity=null),this.endEntity&&(this.sdk.viewer.entities.remove(this.endEntity),this.endEntity=null),this.entity&&(this.sdk.viewer.entities.remove(this.entity),this.entity=null),this.startExtensionEntity&&(this.sdk.viewer.entities.remove(this.startExtensionEntity),this.startExtensionEntity=null),this.endExtensionEntity&&(this.sdk.viewer.entities.remove(this.endExtensionEntity),this.endExtensionEntity=null)}},{key:"destroy",value:function(){this.clear(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"getLocateCurrent",value:function(t){var e=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||h();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){e.reconnecting.onmessage=function(i){e.data=JSON.parse(i.data),e.data&&e.data.rmc&&(e.reconnecting.close(),"start"===t.srcElement.getAttribute("data-is")?(e.startLng=e.data.rmc.lng,e.startLat=e.data.rmc.lat,!e.startEntity&&(e.startEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.startEntity.show=!0):(e.endLng=e.data.rmc.lng,e.endLat=e.data.rmc.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0))}}}},{key:"createRoute",value:function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].lng,t[i].lat);!this.startLng&&0!==this.startLng||!this.startLat&&0!==this.startLat||this.startLng===t[0].lng&&this.startLat===t[0].lat||(this.startExtension=[this.startLng,this.startLat,t[0].lng,t[0].lat],this.startExtensionEntity?this.startExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.startExtension):this.startExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.startExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),!this.endLng&&0!==this.endLng||!this.endLat&&0!==this.endLat||this.endLng===t[t.length-1].lng&&this.endLat===t[t.length-1].lat||(this.endExtension=[this.endLng,this.endLat,t[t.length-1].lng,t[t.length-1].lat],this.endExtensionEntity?this.endExtensionEntity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(this.endExtension):this.endExtensionEntity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(this.endExtension),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,2),zIndex:99999999}})),this.entity?this.entity.polyline.positions=Cesium.Cartesian3.fromDegreesArray(e):this.entity=this.sdk.viewer.entities.add({show:this.options.show,polyline:{positions:Cesium.Cartesian3.fromDegreesArray(e),width:this.options.width,clampToGround:!0,material:this.getMaterial(this.options.color,0),zIndex:99999999}})}},{key:"pickStartPos",value:function(t){var e=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Z("左键选择起点坐标,右键取消",this.sdk),this.event=new X(this.sdk),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)}));var i=function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.startLng=n.lng,e.startLat=n.lat,!e.startEntity&&(e.startEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.startEntity.show=!0,e.tip&&e.tip.destroy(),e.event&&e.event.destroy()};this.event.mouse_left(i),this.event.mouse_right((function(t,i){e.tip&&e.tip.destroy(),e.event&&e.event.destroy()})),this.event.gesture_pinck_start((function(t,n){var o=new Date;t.position1.x,t.position2.x,t.position1.y,t.position2.y;e.event.gesture_pinck_end((function(){new Date-o>=500?(e.tip&&e.tip.destroy(),e.event&&e.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(t){var e=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Z("左键选择终点坐标,右键取消",this.sdk),this.event=new X(this.sdk),this.event.mouse_move((function(t,i){e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.endLng=n.lng,e.endLat=n.lat,!e.endEntity&&(e.endEntity=e.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat))}),!1),billboard:{image:e.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),e.endEntity.show=!0,e.tip&&e.tip.destroy(),e.event&&e.event.destroy()})),this.event.mouse_right((function(t,i){e.tip&&e.tip.destroy(),e.event&&e.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(t,e){for(var i=function(){var i=[],o=!1,s=[];if(!e[n]||!e[n].attributes)return 1;var a,r=ab(e[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==e[n].type?(i.push((function(e){t[r.value]=e.target.checked})),e[n].checked=t[r.value]):(i.push((function(e){var i=e.target.value;"number"==e.target.type?"."==e.data||"-"==e.data&&!e.target.value||(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[r.value]=i):t[r.value]=i})),"IMG"==e[n].nodeName?e[n].src=t[r.value]:e[n].value=t[r.value]),t._elms[r.value]?t._elms[r.value].push(e[n]):t._elms[r.value]=[e[n]],s.push(r.name);break;case"@click":e[n].addEventListener("click",(function(e){"function"==typeof t[r.value]&&t[r.value](e)})),s.push(r.name);break;case"@change":o=!0,i.push((function(e){var i=e.target.value;"number"==e.target.type&&""!=i&&(i=Number(i),e.target.value=i),"function"==typeof t[r.value]&&t[r.value](e,i)}))}};for(r.s();!(a=r.n()).done;)l()}catch(t){r.e(t)}finally{r.f()}for(var c=0;c<s.length;c++)e[n].attributes.removeNamedItem(s[c]);if(o){var u="input";"INPUT"==e[n].tagName&&"checkbox"!=e[n].type||(u="change"),e[n].addEventListener(u,(function(t){for(var e=0;e<i.length;e++)i[e](t)}))}},n=0;n<e.length;n++)i()}}]);var i}(Wn);function pb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function hb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?pb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var db,mb=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=0,n=1,o=20,s=[],cb&&!cb.isDestroy&&(cb.close(),cb=null),r=function(){for(var t="",e=0;e<s.length;e++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[e].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties.fid,"</div></td>")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties[o],"</div></td>"));t+=i=i+n+"</tr>"}return t},t.next=8,new W(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return cb=t.sent,t.next=11,cb.init();case 11:for(y in l=L()(e.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',p='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in e.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',p=p+(h=h+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+p+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",cb.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),cb._element.title.style.height="40px",cb._element.body.style.width="65%",cb._element.body.style.height="80%",cb._element.content.style.height="calc(100% - 40px)",cb._element.content.style.overflow="hidden",cb._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Tn(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),x=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<e.geojson.features.length;c++)for(var p in e.geojson.features[c].properties){if(-1!=(e.geojson.features[c].properties[p]+"").indexOf(t.value)){a.push(e.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var h=r();u.getElementsByTagName("tbody")[0].innerHTML=h,Tn(k,i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,x()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var t=[],i=0;i<e.geojson.features.length;i++)t.push(hb(hb({},e.geojson.features[i].properties),{},{positions:JSON.stringify(e.geojson.features[i].geometry.positions)}));e.exportExcel(t)}));case 55:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),fb=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:db&&!db.isDestroy&&(db.close(),db=null),n=[],o=function(){for(var t="",e=0;e<n.length;e++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[e].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties.fid,"</div></td>")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties[s],"</div></td>"));t+=i=i+o+"</tr>"}return t},s=!1,r=0;case 5:if(!(r<e.geojson.features.length)){t.next=13;break}if(!e.geojson.features[r].properties.id||e.geojson.features[r].properties.id!=i){t.next=10;break}return n=[e.geojson.features[r]],s=!0,t.abrupt("break",13);case 10:r++,t.next=5;break;case 13:if(s){t.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),t.abrupt("return");case 16:return t.next=18,new W(e.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return db=t.sent,t.next=21,db.init();case 21:for(g in l=o(e),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',h="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in e.geojson.features[0].properties&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(p=p+(h+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,db.contentAppChild(c),new kn("shp-list-id-tabs"),(x=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",x.style.display="flex",x.style.flexDirection="column",x.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",_=x.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<_.length;E++)_[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(D=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){S.scrollLeft=t.target.scrollLeft})),db._element.title.style.height="40px",db._element.body.style.width="65%",db._element.body.style.height="80%",db._element.content.style.height="calc(100% - 40px)",db._element.foot.style.display="none",D.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();function vb(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return gb(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function gb(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function yb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Cb(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var wb,kb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=Cb(this,e,[t,n])).viewer=t.viewer,i.options.path?(i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i):(i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),tn()(i))}return sn()(e,t),_()(e,[{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(r=o()(a.a.mark((function t(){var i,n,o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||h(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load":this.options.host+"/yjearth4.0/api/v1/vector/load",i+="?path="+this.options.path,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=t.sent).status){t.next=19;break}return t.next=10,n.json();case 10:if(200!==(o=t.sent).code&&0!==o.code){t.next=18;break}return this.data=o.data,t.next=15,this.formatData();case 15:return t.abrupt("return",e.create(this));case 18:return t.abrupt("return",console.error(o.message));case 19:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"formatData",value:(s=o()(a.a.mark((function t(){var e,i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=function(t){if(t.data){var o;(o=i.list).push.apply(o,L()(t.data));for(var s=0;s<t.data.length;s++){var a=void 0,r=void 0,l=void 0,c=void 0,u=void 0;if(t.data[s].points){a=L()(t.data[s].points);for(var p=0;p<a.length;p++)e.push({id:a[p].attr.id,type:"Feature",geometry:{type:"Point",coordinates:[a[p].x,a[p].y,a[p].z],range:a[p].range,positions:{x:a[p].x,y:a[p].y,z:a[p].z}},properties:a[p].attr?bb({},a[p].attr):{}})}if(t.data[s].polylines){r=L()(t.data[s].polylines);for(var h=0;h<r.length;h++){for(var d=[],m=0;m<r[h].positions.length;m++)d.push([r[h].positions[m].x,r[h].positions[m].y,r[h].positions[m].z]);e.push({id:r[h].attr.id,type:"Feature",geometry:{type:"LineString",coordinates:d,range:r[h].range,positions:r[h].positions},properties:r[h].attr?bb({},r[h].attr):{}})}}if(t.data[s].polygons){l=L()(t.data[s].polygons);for(var f=0;f<l.length;f++){for(var v=[],g=0;g<l[f].positions.length;g++)v.push([l[f].positions[g].x,l[f].positions[g].y]);e.push({id:l[f].attr.id,type:"Feature",geometry:{type:"Polygon",coordinates:[v],range:l[f].range,positions:l[f].positions},properties:l[f].attr?bb({},l[f].attr):{}})}}if(t.data[s].multi_polylines){c=L()(t.data[s].multi_polylines);for(var y=0;y<c.length;y++){for(var b=[],C=[],w=0;w<c[y].polylines.length;w++){var k=[];C.push(c[y].polylines[w].positions);for(var x=0;x<c[y].polylines[w].positions.length;x++)k.push([c[y].polylines[w].positions[x].x,c[y].polylines[w].positions[x].y,c[y].polylines[w].positions[x].z]);b.push(k)}e.push({id:c[y].attr.id,type:"Feature",geometry:{type:"MultiLineString",coordinates:b,range:c[y].range,positions:C},properties:c[y].attr?bb({},c[y].attr):{}})}}if(t.data[s].multi_polygons){u=L()(t.data[s].multi_polygons);for(var _=0;_<u.length;_++){for(var E=[],S=[],D=0;D<u[_].polygons.length;D++){var P=[];S.push(u[_].polygons[D].positions);for(var M=0;M<u[_].polygons[D].positions.length;M++)P.push([u[_].polygons[D].positions[M].x,u[_].polygons[D].positions[M].y,u[_].polygons[D].positions[M].z]);E.push(P)}e.push({id:u[_].attr.id,type:"Feature",geometry:{type:"MultiPolygon",coordinates:[E],range:u[_].range,positions:S},properties:u[_].attr?bb({},u[_].attr):{}})}}}}if(t.children)for(var O=0;O<t.children.length;O++)n(t.children[O])},e=[],i=this,n(this.data),e.sort((function(t,e){return Number(t.properties.fid)-Number(e.properties.fid)})),this.geojson={type:"FeatureCollection",features:e};case 6:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(t){this.options.fileName=t,this._elms.fileName&&(this._elms.fileName.value=t)}},{key:"field",get:function(){return this.options.field},set:function(t){this.options.field=t,this._elms.field&&(this._elms.field.value=t)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){t&&"function"!=typeof t?console.error("val:",t,"不是一个function"):this.clickCallBack=t}},{key:"img",get:function(){return this.options.img},set:function(t){Array.isArray(t)||(t=[t]),this.options.img=t,e.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(t){this.options.color=t,this.entity.entities.values.forEach((function(e){e.billboard&&(e.billboard.color=t),e.polygon&&(e.polygon.material=Cesium.Color.fromCssColorString(t)),e.polyline&&(e.polyline.material=Cesium.Color.fromCssColorString(t))}))}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"edit",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=this,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=h.length>0&&void 0!==h[0]&&h[0],i=h.length>1&&void 0!==h[1]?h[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return t.next=7,new rn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){p.fileName=p.fileName.trim(),p.fileName||(p.fileName="未命名对象"),p.originalOptions.fileName=p.fileName,p.originalOptions.field=p.field,p._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:p.options.id,fileName:p.originalOptions.fileName,field:p.originalOptions.field})},closeCallBack:function(){p.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=t.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">名称字段选择:</span>\n <select class="input input-select">\n </select>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){p.options.fileName=s.value})),r=o.getElementsByClassName("input-select")[0],l="",this.geojson.features[0].properties)u='<option value="'.concat(c,'">').concat(c,"</option>"),l+=u;r.innerHTML=l,r.value=this.options.field,r.addEventListener("input",(function(){p.options.field=r.value})),this._elms.fileName=s,this._elms.field=r,t.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!e){t.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){t.next=16;break}if(this.geojson.features[c].properties.id!==i){t.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,t.abrupt("break",16);case 13:c++,t.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",t.next=24,new rn(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=t.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t<f.length;t++)f[t].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return t.stop()}}),t)})))),m.addEventListener("click",(function(){On.open(i,i,b._DialogObject.attribute.richTextContent),On.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===t){this.geojson.features[i].content=e;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(t,e,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=e:(this._DialogObject.attribute.link.content.push({name:"链接",url:e}),this.setAttributeLinkById(t,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(t,e){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t){this._DialogObject.attribute.link.content=e;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var p=r.getElementsByClassName("tr"),h={linkEdit:(i=o()(a.a.mark((function e(i){var o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function t(e){var o,s,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=33;break}r[e].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[e].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[e].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){t.next=32;break}if(s[l]&&s[l].attributes){t.next=11;break}return t.abrupt("continue",29);case 11:c=vb(s[l].attributes),t.prev=12,p=a.a.mark((function t(){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(i=u.value).name){t.next=5;break}return s[l].addEventListener("click",(function(t){"function"==typeof h[i.value]&&h[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},e)})),s[l].attributes.removeNamedItem(i.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),c.s();case 15:if((u=c.n()).done){t.next=21;break}return t.delegateYield(p(),"t0",17);case 17:if(!t.t0){t.next=19;break}return t.abrupt("break",21);case 19:t.next=15;break;case 21:t.next=26;break;case 23:t.prev=23,t.t1=t.catch(12),c.e(t.t1);case 26:return t.prev=26,c.f(),t.finish(26);case 29:l++,t.next=8;break;case 32:return t.abrupt("return",1);case 33:case"end":return t.stop()}}),t,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){e.next=14;break}return e.delegateYield(l(c),"t0",9);case 9:if(!e.t0){e.next=11;break}return e.abrupt("break",14);case 11:c++,e.next=7;break;case 14:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)}),linkDelete:function(e){n._DialogObject.attribute.link.content.splice(e,1),n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},confirmEdit:function(e,i){n._DialogObject.attribute.link.content[i]=e,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},fileSelect:function(e,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(t,i)}},d=function(t){for(var e=p[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=vb(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof h[o.value]&&h[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<p.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===t){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){mb(this)}},{key:"openNodeListById",value:function(t){fb(this,t)}},{key:"flyTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].properties.id===t){var n=this.geojson.features[i].geometry.range;n&&(pi(0),ii(this.sdk),ni(this.sdk),this.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(n.min_x,n.min_y,n.max_x,n.max_y)}))}}else this.range&&(pi(0),ii(this.sdk),ni(this.sdk),this.viewer.camera.flyTo({orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)},destination:Cesium.Rectangle.fromDegrees(this.range.min_x,this.range.min_y,this.range.max_x,this.range.max_y)}))}},{key:"setShow",value:function(t,e){if(e)for(var i=0;i<this.entity.entities.values.length;i++)this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(e)&&(this.entity.entities.values[i].show=t);else{this.options.show=t;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=t}}},{key:"setShowImg",value:function(t,e){if(e||0===e){for(var i=0;i<this.imgEntity.length;i++)if(i==e){this.imgEntity[i].show=t;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=t}},{key:"remove",value:function(){this.viewer.dataSources.remove(this.entity,!0),this.removeImage(),this.entity=null,this.geojson={},this.data={}}},{key:"removeImage",value:function(){for(var t=0;t<this.imgEntity.length;t++)this.sdk.viewer.entities.remove(this.imgEntity[t]);this.imgEntity=[]}},{key:"cameraSelect",value:function(t,e){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){Tn(s,1,10,1);var r="",l={cameraName:t,page:e&&"object"!==N()(e)?e:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.data){if(e.data.list&&e.data.list.length>0){Tn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(e.data.list[t].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[t].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[e.data.list[t].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[t].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].userName,'</div>\n <div class="td">').concat(e.data.list[t].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===e.data.list[t].ID){r.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&Tn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)}))}else Tn(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))}}}},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){var i=turf.bbox(t.geojson);t.range={max_x:i[2],max_y:i[3],min_x:i[0],min_y:i[1]},t.options.img&&e.createImage(t);var n=function(e){var i=t.options.color;if(e){switch(e._value){case 1:i="rgba(255,0,0,1)";break;case 2:i="rgba(255,126,0,1)";break;case 3:i="rgba(255,250,0,1)";break;case 4:i="rgba(0,102,255,1)";break;case 5:i="rgba(0,255,0,1)"}return i}return i};return(new Cesium.GeoJsonDataSource).load(t.geojson,{clampToGround:!0}).then((function(e){t.entity=e,t.viewer.dataSources.add(e),e.entities.values.forEach((function(e){if(e.show=t.options.show,e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n(e.properties.level)),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY})),e.polygon&&(e.polygon.perPositionHeight=!1,e.polygon.material=Cesium.Color.fromCssColorString(n(e.properties.level))),e.polyline){t.options.color;e.polyline.material=Cesium.Color.fromCssColorString(n(e.properties.level))}}))}))}},{key:"createImage",value:function(t){t.removeImage();for(var e=0;e<t.options.img.length;e++){var i=t.sdk.viewer.entities.add({show:t.options.show,rectangle:{coordinates:Cesium.Rectangle.fromDegrees(t.range.min_x,t.range.min_y,t.range.max_x,t.range.max_y),material:new Cesium.ImageMaterialProperty({image:t.options.img[e],transparent:!0})}});t.imgEntity.push(i)}}},{key:"calculationScope",value:function(t,e){var i=[];if(e.points)for(var n=0;n<e.points.length;n++)i.push(turf.point([e.points[n].position.x,e.points[n].position.y]));if(e.polylines)for(var o=0;o<e.polylines.length;o++)if(e.polylines[o].positions)for(var s=0;s<e.polylines[o].positions.length;s++)i.push(turf.point([e.polylines[o].positions[s].x,e.polylines[o].positions[s].y]));if(e.polygons)for(var a=0;a<e.polygons.length;a++)if(e.polygons[a].positions)for(var r=0;r<e.polygons[a].positions.length;r++)i.push(turf.point([e.polygons[a].positions[r].x,e.polygons[a].positions[r].y]));if(i.length>0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(t.range={max_x:c.bbox[2],max_y:c.bbox[3],min_x:c.bbox[0],min_y:c.bbox[1]})}}},{key:"createPoints",value:function(t,e){if(e){for(var i=new Cesium.PointPrimitiveCollection({scene:t.viewer.scene}),n=0;n<e.length;n++)e[n].attr.id||(e[n].attr.id=t.randomString()),i.add({id:e[n].attr.id,position:Cesium.Cartesian3.fromDegrees(e[n].x,e[n].y,e[n].z),color:Cesium.Color.RED,pixelSize:10,disableDepthTestDistance:Number.POSITIVE_INFINITY}),dt(e[n].attr.id,t.leftClickCB,t);t.entity.add(i)}}},{key:"createPolylines",value:function(t,e){if(e){for(var i=[],n=0;n<e.length;n++){e[n].attr.id||(e[n].attr.id=t.randomString());for(var o=e[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArrayHeights(s),width:4}),l=new Cesium.GeometryInstance({id:e[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),dt(e[n].attr.id,t.leftClickCB,t)}i.length>0&&t.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(t,e){if(e){for(var i=[],n=0;n<e.length;n++){e[n].attr.id||(e[n].attr.id=t.randomString());for(var o=e[n].positions,s=[],a=0;a<o.length;a++)s.push(o[a].x,o[a].y,o[a].z);var r=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))}),l=new Cesium.GeometryInstance({id:e[n].attr.id,geometry:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e[n].COLOR||"rgba(0,255,184,0.5)")),show:new Cesium.ShowGeometryInstanceAttribute(!0)}});i.push(l),dt(e[n].attr.id,t.leftClickCB,t)}if(i.length>0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});t.entity.add(c)}}}},{key:"createTableContent",value:function(t){for(var e="",i=0;i<t.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in t.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(t.currentData[i].attr[s],"</div></td>");e+=n=n+o+"</tr>"}return e}}]);var i,n,s,r}(Wn);function xb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function _b(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?xb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):xb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Eb,Sb=function(){var t=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=0,n=1,o=20,s=[],wb&&!wb.isDestroy&&(wb.close(),wb=null),r=function(){for(var t="",e=0;e<s.length;e++){var i='<tr class="el-table__row">',n="";for(var o in"fid"in s[e].properties&&(n='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties.fid,"</div></td>")),s[e].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(s[e].properties[o],"</div></td>"));t+=i=i+n+"</tr>"}return t},t.next=8,new W(e.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return wb=t.sent,t.next=11,wb.init();case 11:for(y in l=L()(e.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>',p='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: calc(100% - 100px);">',h='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1213px;">',d="<colgroup>",m='<thead class="has-gutter"><tr>',f='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 1186px;">',v="<colgroup>",g=1,"fid"in e.geojson.features[0].properties&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),g++),e.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+='<col name="el-table_1_column_'.concat(g,'" width="150">'),v+='<col name="el-table_1_column_'.concat(g,'" width="150">'),m+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(g,' is-leaf el-table__cell"><div class="cell">').concat(y,"</div></th>"),g++);'<div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div>',p=p+(h=h+(d+='<col name="gutter" width="17"></colgroup>')+(m+="</tr></thead>")+"</table></div>")+(f=f+(v+="</colgroup>")+("<tbody>"+c+"</tbody>")+'</table><div class="el-table__empty-block" style="height: 100%;"><span class="el-table__empty-text">暂无数据</span></div></div>')+"</div>",u.innerHTML='<div class="search-box" style="display: flex;margin-bottom: 10px;"><input class="input" type="text" placeholder="输入关键字搜索" style="width: 180px; margin-right: 10px;"><button class="btn search">搜索</button><button type="button" style="position: absolute;right:20px;" class="el-button el-button--primary is-plain export"><span>导出</span></button></div>'+p+'<div class="pagination"></div>',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",wb.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){C.scrollLeft=t.target.scrollLeft})),wb._element.title.style.height="40px",wb._element.body.style.width="65%",wb._element.body.style.height="80%",wb._element.content.style.height="calc(100% - 40px)",wb._element.content.style.overflow="hidden",wb._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Tn(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"})),x=function(){for(var t=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c<e.geojson.features.length;c++)for(var p in e.geojson.features[c].properties){if(-1!=(e.geojson.features[c].properties[p]+"").indexOf(t.value)){a.push(e.geojson.features[c]);break}}i=(l=a).length,0==(s=l.slice(o*(n-1),o*n)).length?b.style.display="flex":b.style.display="none";var h=r();u.getElementsByTagName("tbody")[0].innerHTML=h,Tn(k,i,o,n,(function(t){n=t,s=l.slice(o*(n-1),o*n);var e=r();u.getElementsByTagName("tbody")[0].innerHTML=e,0==s.length?b.style.display="flex":b.style.display="none"}))},u.getElementsByClassName("search")[0].addEventListener("click",(function(){o=20,n=1,x()})),u.getElementsByClassName("export")[0].addEventListener("click",(function(){for(var t=[],i=0;i<e.geojson.features.length;i++)t.push(_b(_b({},e.geojson.features[i].properties),{},{positions:JSON.stringify(e.geojson.features[i].geometry.coordinates)}));e.exportExcel(t)}));case 55:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Db=function(){var t=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C,w,k,x,_,E,S,D;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Eb&&!Eb.isDestroy&&(Eb.close(),Eb=null),n=[],o=function(){for(var t="",e=0;e<n.length;e++){var i='<tr class="el-table__row">',o="";for(var s in"fid"in n[e].properties&&(o='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties.fid,"</div></td>")),n[e].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(e,' el-table__cell"><div class="cell">').concat(n[e].properties[s],"</div></td>"));t+=i=i+o+"</tr>"}return t},s=!1,r=0;case 5:if(!(r<e.geojson.features.length)){t.next=13;break}if(!e.geojson.features[r].properties.id||e.geojson.features[r].properties.id!=i){t.next=10;break}return n=[e.geojson.features[r]],s=!0,t.abrupt("break",13);case 10:r++,t.next=5;break;case 13:if(s){t.next=16;break}return window.ELEMENT&&window.ELEMENT.Message({message:"数据不存在!",type:"warning",duration:1500}),t.abrupt("return");case 16:return t.next=18,new W(e.viewer._container,{title:i,left:"17%",top:"100px"});case 18:return Eb=t.sent,t.next=21,Eb.init();case 21:for(g in l=o(e),(c=document.createElement("div")).style.height="100%",u='<div class="el-table el-table--fit el-table--border el-table--scrollable-x el-table--scrollable-y el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%; height: 100%;">',p='<div class="el-table__header-wrapper"><table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 930px;">',h="<colgroup>",d='<thead class="has-gutter"><tr>',m='<div class="el-table__body-wrapper is-scrolling-none" style="height: 620px;"><table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 913px;">',f="<colgroup>",v=1,"fid"in e.geojson.features[0].properties&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">fid</div></th>'),v++),e.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(h+='<col name="el-table_1_column_'.concat(v,'" width="150">'),f+='<col name="el-table_1_column_'.concat(v,'" width="150">'),d+='<th colspan="1" rowspan="1" class="el-table_1_column_'.concat(v,' is-leaf el-table__cell"><div class="cell">').concat(g,"</div></th>"),v++);if(y='\n <DIV-cy-tabs id="shp-list-id-tabs">\n <DIV-cy-tab-pane label="属性列表">\n '.concat((u=u+(p=p+(h+='<col name="gutter" width="17"></colgroup>')+(d+="</tr></thead>")+"</table></div>")+(m=m+(f+="</colgroup>")+("<tbody>"+l+"</tbody>")+"</table></div>")+"</div>")+'<div class="pagination"></div>',"\n </DIV-cy-tab-pane>\n "),n[0].content&&n[0].content.richTextContent&&(b='\n <DIV-cy-tab-pane class="editor-content-view" label="富文本信息">\n '.concat(n[0].content.richTextContent,"\n </DIV-cy-tab-pane>\n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C<n[0].content.link.content.length;C++)w=n[0].content.link.content[C].url,k='\n <DIV-cy-tab-pane class="editor-content-view" label="'.concat(n[0].content.link.content[C].name,'">\n <iframe src="').concat(w,'"></iframe>\n </DIV-cy-tab-pane>\n '),y+=k;for(y+="</DIV-cy-tabs>",c.innerHTML=y,Eb.contentAppChild(c),new kn("shp-list-id-tabs"),(x=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",x.style.display="flex",x.style.flexDirection="column",x.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",_=x.getElementsByClassName("DIV-cy-tab-content-pane"),E=0;E<_.length;E++)_[E].style.height="100%";S=c.getElementsByClassName("el-table__header-wrapper")[0],(D=c.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(t){S.scrollLeft=t.target.scrollLeft})),Eb._element.title.style.height="40px",Eb._element.body.style.width="65%",Eb._element.body.style.height="80%",Eb._element.content.style.height="calc(100% - 40px)",Eb._element.foot.style.display="none",D.style.height="calc(100% - ".concat(S.offsetHeight,"px)");case 64:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}();function Pb(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Mb(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Mb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Mb(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function Ob(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Tb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ob(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ob(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Nb(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function Bb(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function Lb(t,e){return t.get(jb(t,e))}function Ab(t,e,i){return t.set(jb(t,e),i),i}function jb(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var Ib=i(38),Rb=new WeakMap,Fb=new WeakMap,zb=new WeakMap,Hb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,e),Bb(i=Nb(this,e,[t,n]),Rb,void 0),Bb(i,Fb,!1),Bb(i,zb,[]),i.viewer=t.viewer,!i.options.path)return i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),tn()(i);for(var s in i.colors=Ib,i.options.head_tables=n.head_tables||[],i.options.fileName=n.fileName||"未命名对象",i.options.path.endsWith(".kml")||(i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.opacity=n.opacity||0===n.opacity?n.opacity:1),i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i.sdk.addIncetance(i.options.id,i),i.disaster_type_colors=Ib[i.options.disaster_type]?Tb({},Ib[i.options.disaster_type]):void 0,i.disaster_type_colors)i.disaster_type_colors[s]=i.cmykToRgb(i.disaster_type_colors[s]);return i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(t){this.setShow(t)}},{key:"opacity",get:function(){return this.options.opacity},set:function(t){this.options.opacity=t,this.entity&&this.entity.entities.values.forEach((function(e){e.point&&(e.point.color=e.point.color._value.withAlpha(t)),e.polygon&&(e.polygon.material=e.polygon.material.color._value.withAlpha(t)),e.polyline&&(e.polyline.material=e.polyline.material.color._value.withAlpha(t))}))}},{key:"on",value:function(){if(this.sdk&&this.viewer&&this.options.path)return this.init()}},{key:"init",value:(l=o()(a.a.mark((function t(){var i,n,o,s,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="",this.options.host=this.options.host||h(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load2":this.options.host+"/yjearth4.0/api/v1/vector/load2",i+="?path="+this.options.path,t.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=t.sent).status){t.next=17;break}return t.next=10,n.arrayBuffer();case 10:return o=t.sent,s=new Uint8Array(o),r=this.decompressGzip(s),0===this.data.length&&(this.data=JSON.parse(r)),t.next=16,this.formatData();case 16:return t.abrupt("return",e.create(this));case 17:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"formatData",value:(r=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=[],i=function(t,e,n){if(t)if(Array.isArray(t)){for(var o=!1,s=0;s<t.length;s++){if("object"!==N()(t[s])){o=!0;break}i(t[s],e,n)}if(o){var a=Number(t[0]),r=Number(t[1]),l=proj4(e,n,[a,r]);t[0]=Number(l[0].toFixed(10)),t[1]=Number(l[1].toFixed(10))}}else t instanceof Object&&(i(t.coordinates,e,n),i(t.geometries,e,n))},n=0;n<this.data.list.length;n++){o=Pb(this.name_map);try{for(o.s();!(s=o.n()).done;)(r=y()(s.value,2))[0],(l=r[1]).def===this.data.list[n].crs_src&&l.epsg,l.def===this.data.list[n].crs_dst&&l.epsg}catch(t){o.e(t)}finally{o.f()}for(c=0;c<this.data.list[n].features.length;c++)this.data.list[n].features[c].properties.id,this.data.list[n].features[c].properties||(this.data.list[n].features[c].properties={}),this.data.list[n].features[c].properties.id||(this.data.list[n].features[c].properties.id=Cesium.createGuid()),this.data.list[n].features[c].id=this.data.list[n].features[c].properties.id,i(this.data.list[n].features[c].geometry,this.data.list[n].crs_src,this.data.list[n].crs_dst||"+proj=longlat +datum=WGS84 +no_defs"),this.data.list[n].features[c].geometry.geometries||(this.data.list[n].features[c].geometry.geometries=[]),(u=turf.bbox(this.data.list[n].features[c].geometry))&&u[0]&&u[0]!=1/0&&(this.data.list[n].features[c].geometry.range=turf.bbox(this.data.list[n].features[c])),e.push(this.data.list[n].features[c])}this.geojson={type:"FeatureCollection",features:e};case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"fileName",get:function(){return this.options.fileName},set:function(t){this.options.fileName=t,this._elms.fileName&&(this._elms.fileName.value=t)}},{key:"field",get:function(){return this.options.field},set:function(t){this.options.field=t;for(var e=t,i=0;i<this.options.head_tables.length;i++)if(this.options.head_tables[i].key===t){e=this.options.head_tables[i].label;break}this._elms.field&&(this._elms.field.value=e)}},{key:"img",get:function(){return this.options.img},set:function(t){Array.isArray(t)||(t=[t]),this.options.img=t,e.createImage(this)}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity&&this.entity.entities.values.forEach((function(i){i.point&&(i.point.color=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity)),i.polygon&&(i.polygon.material=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity)),i.polyline&&(i.polyline.material=Cesium.Color.fromCssColorString(t).withAlpha(e.opacity))}))}},{key:"onRightClick",set:function(t){t&&"function"!=typeof t?console.error("val:",t,"不是一个function"):(null==this.rightClickCallBack&&this.options&&this.options.id&&mt(this.options.id,this.rightClickCB,this),this.rightClickCallBack=t)}},{key:"leftClickCB",value:function(t,e,i,n){n.clickCallBack&&"function"==typeof n.clickCallBack&&n.clickCallBack(t,e,i)}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b,C=this,w=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w.length>0&&void 0!==w[0]&&w[0],i=w.length>1&&void 0!==w[1]?w[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=74;break}return t.next=7,new rn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){C.fileName=C.fileName.trim(),C.fileName||(C.fileName="未命名对象"),C.originalOptions.fileName=C.fileName,C.originalOptions.field=C.field,C._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:C.options.id,fileName:C.originalOptions.fileName,field:C.originalOptions.field})},closeCallBack:function(){C.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:this._DialogObject=t.sent,n='\n <div class="row">\n <div class="col">\n <span class="label">文件名称:</span>\n <input class="input flie-name" type="text">\n </div>\n </div>\n <div class="row">\n <div class="col key-box">\n <span class="label">名称字段选择:</span>\n <div class="key"></div>\n </div>\n </div>\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){C.options.fileName=s.value})),r=[],t.t0=a.a.keys(this.geojson.features[0].properties);case 17:if((t.t1=t.t0()).done){t.next=31;break}l=t.t1.value,c=l,u=0;case 21:if(!(u<this.options.head_tables.length)){t.next=28;break}if(this.options.head_tables[u].key!==l){t.next=25;break}return c=this.options.head_tables[u].label,t.abrupt("break",28);case 25:u++,t.next=21;break;case 28:r.push({name:c,value:c,key:l}),t.next=17;break;case 31:if(!(p=Y(o.getElementsByClassName("key-box")[0],".key"))){t.next=47;break}p.legp_search(r),(h=o.getElementsByClassName("key")[0].getElementsByTagName("input")[0]).value=this.field,d=0;case 37:if(!(d<r.length)){t.next=45;break}if(r[d].key!=this.field){t.next=42;break}return h.value=r[d].value,p.legp_searchActive(r[d].value),t.abrupt("break",45);case 42:d++,t.next=37;break;case 45:h.addEventListener("input",(function(){for(var t=0;t<r.length;t++)if(r[t].value===h.value){C.options.field=r[t].key;break}})),this._elms.field=h;case 47:return this._elms.fileName=s,t.abrupt("return");case 52:if((t.t3=t.t2()).done){t.next=67;break}v=t.t3.value,g=v,y=0;case 56:if(!(y<this.options.head_tables.length)){t.next=63;break}if(this.options.head_tables[y].key!==v){t.next=60;break}return g=this.options.head_tables[y].label,t.abrupt("break",63);case 60:y++,t.next=56;break;case 63:b='<option value="'.concat(v,'">').concat(g,"</option>"),f+=b,t.next=52;break;case 67:m.innerHTML=f,m.value=this.options.field,m.addEventListener("input",(function(){C.options.field=m.value})),this._elms.fileName=s,this._elms.field=m,t.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"editById",value:(n=o()(a.a.mark((function t(){var e,i,n,s,r,l,c,u,p,h,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!e){t.next=48;break}l={},c=0;case 8:if(!(c<this.geojson.features.length)){t.next=16;break}if(this.geojson.features[c].id!==i){t.next=13;break}return this.geojson.features[c].content&&(l=this.deepCopyObj(this.geojson.features[c].content)),r=c,t.abrupt("break",16);case 13:c++,t.next=8;break;case 16:return l.id=l.id||i,l.link||(l.link={}),l.link.content||(l.link.content=[]),l.camera||(l.camera=[]),l.richTextContent||(l.richTextContent=""),l.attributeType=l.attributeType||"richText",t.next=24,new rn(this.sdk,l,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(){b._DialogObject.close(),b.geojson.features[r].content=b.deepCopyObj(b._DialogObject.attribute),n.confirmCallBack&&n.confirmCallBack(b._DialogObject.attribute)},closeCallBack:function(){n.closeCallBack&&n.closeCallBack()}});case 24:for(this._DialogObject=t.sent,this._DialogObject.event=n,this._DialogObject.attribute=this.deepCopyObj(l),u='\n <div class="row">\n <div class="col">\n <span class="label">内容类型:</span>\n <select class="input input-select attribute-select" style="width: 120px;">\n <option value="richText">富文本</option>\n \x3c!--<option value="link">链接</option>\n <option value="camera">摄像头</option>\n <option value="sensor">传感器</option>\n <option value="vr">全景图</option>--\x3e\n </select>\n </div>\n <div class="col attribute-content attribute-content-link">\n <div class="input-group">\n <input class="input link_add" type="text">\n <button class="link_add_btn">+</button>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-richText">\n <span>编辑内容:<button class="open-richText-btn">打开文本编辑器</button></span>\n </div>\n <div class="attribute-content attribute-content-link">\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">名称</div>\n <div class="th">链接</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class="attribute-content attribute-content-camera">\n <div class="row">\n <div class="col">\n <span class="label">编辑内容:</span>\n <input class="input camera-name" type="text" style="width: 100px;">\n <button class="select btn camera-select">搜索</button>\n </div>\n </div>\n <div>\n <div class="table camera-table">\n <div class="table-head">\n <div class="tr">\n <div class="th">操作</div>\n <div class="th">设备名称</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备类型</div>\n <div class="th" style="width: 126px; flex: 0 126px;min-width: 126px;">设备IP</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">设备端口</div>\n <div class="th" style="width: 80px; flex: 0 80px;min-width: 80px;">用户名</div>\n <div class="th">密码</div>\n </div>\n </div>\n <div class="table-body" style="display:none;">\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="2">\n <span>绑定</span>\n </div>\n <div class="td">设备名称</div>\n <div class="td">设备类型</div>\n <div class="td">设备IP</div>\n <div class="td">设备端口</div>\n <div class="td">用户名</div>\n <div class="td">密码</div>\n </div>\n </div>\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n <div class=""row>\n <ul class="pagination"></ul>\n </div>\n </div>\n ',(p=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(p),p.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",h=p.getElementsByClassName("attribute-select")[0],d=p.getElementsByClassName("link_add_btn")[0],m=p.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v<f.length;v++)f[v].className.indexOf("attribute-content-"+this._DialogObject.attribute.attributeType)>-1?f[v].style.display="block":f[v].style.display="none";h.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=h.value;for(var t=0;t<f.length;t++)f[t].className.indexOf("attribute-content-"+b._DialogObject.attribute.attributeType)>-1?f[t].style.display="block":f[t].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return t.stop()}}),t)})))),m.addEventListener("click",(function(){On.open(i,i,b._DialogObject.attribute.richTextContent),On.primaryCallBack=function(t){b._DialogObject.attribute.richTextContent=t}})),g=p.getElementsByClassName("camera-name")[0],y=p.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),t.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"editContentById",value:function(t,e){for(var i=0;i<this.geojson.features.length;i++)if(this.geojson.features[i].id===t){this.geojson.features[i].content=e;break}}},{key:"reset",value:function(){this.fileName=this.originalOptions.fileName,this.field=this.originalOptions.field}},{key:"addAttributeLinkById",value:function(t,e,i){this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t&&(i||0===i?this._DialogObject._element.body.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("tr")[i+1].getElementsByClassName("file-select")[0].value=e:(this._DialogObject.attribute.link.content.push({name:"链接",url:e}),this.setAttributeLinkById(t,this._DialogObject.attribute.link.content)))}},{key:"setAttributeLinkById",value:function(t,e){var i,n=this;if(this._DialogObject&&this._DialogObject.attribute&&this._DialogObject.attribute.id==t){this._DialogObject.attribute.link.content=e;var s=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],r=s.getElementsByClassName("table-body")[0];r.innerHTML="",this._DialogObject.attribute.link.content.length>0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l<this._DialogObject.attribute.link.content.length;l++){var c='\n <div class="tr">\n <div class="td">'+this._DialogObject.attribute.link.content[l].name+'</div>\n <div class="td">'+this._DialogObject.attribute.link.content[l].url+'</div>\n <div class="td">\n <button @click="linkEdit">编辑</button>\n <button @click="linkDelete">删除</button>\n </div>\n </div>',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var p=r.getElementsByClassName("tr"),h={linkEdit:(i=o()(a.a.mark((function e(i){var o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function t(e){var o,s,l,c,u,p;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i!==e){t.next=33;break}r[e].innerHTML='\n <div class="td">\n <input class="input" type="text">\n </div>\n <div class="td">\n <div class="input-group">\n <input class="input file-select" type="text" style="width: 200px;">\n <button @click="fileSelect">...</button>\n </div>\n </div>\n <div class="td">\n <button @click="confirmEdit">确认</button>\n <button @click="cancelEdit">取消</button>\n </div>',(o=r[e].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[e].getElementsByTagName("button"),l=0;case 8:if(!(l<s.length)){t.next=32;break}if(s[l]&&s[l].attributes){t.next=11;break}return t.abrupt("continue",29);case 11:c=Pb(s[l].attributes),t.prev=12,p=a.a.mark((function t(){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("@click"!==(i=u.value).name){t.next=5;break}return s[l].addEventListener("click",(function(t){"function"==typeof h[i.value]&&h[i.value]({name:o[0].getElementsByClassName("input")[0].value,url:o[1].getElementsByClassName("input")[0].value},e)})),s[l].attributes.removeNamedItem(i.name),t.abrupt("return",1);case 5:case"end":return t.stop()}}),t)})),c.s();case 15:if((u=c.n()).done){t.next=21;break}return t.delegateYield(p(),"t0",17);case 17:if(!t.t0){t.next=19;break}return t.abrupt("break",21);case 19:t.next=15;break;case 21:t.next=26;break;case 23:t.prev=23,t.t1=t.catch(12),c.e(t.t1);case 26:return t.prev=26,c.f(),t.finish(26);case 29:l++,t.next=8;break;case 32:return t.abrupt("return",1);case 33:case"end":return t.stop()}}),t,null,[[12,23,26,29]])})),c=0;case 7:if(!(c<r.length)){e.next=14;break}return e.delegateYield(l(c),"t0",9);case 9:if(!e.t0){e.next=11;break}return e.abrupt("break",14);case 11:c++,e.next=7;break;case 14:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)}),linkDelete:function(e){n._DialogObject.attribute.link.content.splice(e,1),n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},confirmEdit:function(e,i){n._DialogObject.attribute.link.content[i]=e,n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},cancelEdit:function(){n.setAttributeLinkById(t,n._DialogObject.attribute.link.content)},fileSelect:function(e,i){n._DialogObject.event&&n._DialogObject.event.clickAddLink&&n._DialogObject.event.clickAddLink(t,i)}},d=function(t){for(var e=p[t].getElementsByTagName("button"),i=0;i<e.length;i++)if(e[i]&&e[i].attributes){var n,o=Pb(e[i].attributes);try{var s=function(){var o=n.value;if("@click"===o.name)return e[i].addEventListener("click",(function(e){"function"==typeof h[o.value]&&h[o.value](t)})),e[i].attributes.removeNamedItem(o.name),1};for(o.s();!(n=o.n()).done&&!s(););}catch(t){o.e(t)}finally{o.f()}}},m=0;m<p.length;m++)d(m)}for(var f=0;f<this.dataArray.length;f++)if(this.dataArray[f].attr.id===t){this.dataArray[f].content&&(this.opt_DialogObject.attribute.link.content=v);break}}},{key:"getAllNode",value:function(){return this.data}},{key:"openAllNodeList",value:function(){Sb(this)}},{key:"openNodeListById",value:function(t){Db(this,t)}},{key:"flyTo",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pi(0),ii(this.sdk),ni(this.sdk),t)for(var n=function(n){if(e.geojson.features[n].id===t)if("Point"===e.geojson.features[n].geometry.type)e.getClampToHeight({lng:e.geojson.features[n].geometry.coordinates[0],lat:e.geojson.features[n].geometry.coordinates[1]}).then((function(t){e.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(e.geojson.features[n].geometry.coordinates[0],e.geojson.features[n].geometry.coordinates[1],t+(i.height||500))})}));else{var o=e.geojson.features[n].geometry.range;if(o){var s=[];e.getClampToHeight({lng:o[0],lat:o[1]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[0],o[1],t);s.push(n.x,n.y,n.z),e.getClampToHeight({lng:o[2],lat:o[3]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(o[2],o[3],t);s.push(n.x,n.y,n.z);var a=Cesium.BoundingSphere.fromVertices(s);e.sdk.viewer.camera.flyToBoundingSphere(a,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},o=0;o<this.geojson.features.length;o++)n(o);else if(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation){var s={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},a=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(a,r,l);this.sdk.viewer.camera.flyTo({destination:c,orientation:s})}else if(this.range){var u=[];this.getClampToHeight({lng:this.range[0],lat:this.range[1]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(e.range[0],e.range[1],t);u.push(n.x,n.y,n.z),e.getClampToHeight({lng:e.range[2],lat:e.range[3]}).then((function(t){var n=Cesium.Cartesian3.fromDegrees(e.range[2],e.range[3],t);u.push(n.x,n.y,n.z);var o=Cesium.BoundingSphere.fromVertices(u);e.sdk.viewer.camera.flyToBoundingSphere(o,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))}}},{key:"setShow",value:function(t,e){if(e){if(!this.entity)return;for(var i=0;i<this.entity.entities.values.length;i++)if(this.entity.entities.values[i].id&&this.entity.entities.values[i].id.startsWith(e)){this.entity.entities.values[i].show=t,this.entity.entities.values[i]._customShow=t,se(this.sdk,this.options.id,this.entity.entities.values[i].id);break}Pe(this.sdk,this.options.id)}else{if(this.options.show=t,!this.entity)return;for(var n=0;n<this.entity.entities.values.length;n++)this.entity.entities.values[n].show=t,this.entity.entities.values[n]._customShow=t,se(this.sdk,this.options.id,this.entity.entities.values[n].id);Pe(this.sdk,this.options.id)}}},{key:"setShowImg",value:function(t,e){if(e||0===e){for(var i=0;i<this.imgEntity.length;i++)if(i==e){this.imgEntity[i].show=t;break}}else for(var n=0;n<this.imgEntity.length;n++)this.imgEntity[n].show=t}},{key:"remove",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.entity&&this.entity.entities.values.forEach((function(t){gi(e.sdk.viewer,t)})),Ab(zb,this,[]),this.removeImage(),this.entity=null,this.geojson={},this.data={},t.next=8,this.sdk.removeIncetance(this.options.id);case 8:return t.next=10,se(this.sdk,this.options.id);case 10:return t.next=12,Pe(this.sdk,this.options.id);case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"removeImage",value:function(){for(var t=0;t<this.imgEntity.length;t++)this.sdk.viewer.entities.remove(this.imgEntity[t]);this.imgEntity=[]}},{key:"cameraSelect",value:function(t,e){var i=this,n={1:"海康",2:"大华"},o=this.options.host;if(this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content){var s=that._DialogObject._element.content.getElementsByClassName("pagination")[0],a=that._DialogObject._element.content.getElementsByClassName("attribute-content-camera")[0];if(s&&a){Tn(s,1,10,1);var r="",l={cameraName:t,page:e&&"object"!==N()(e)?e:1,pageSize:5},c=new URLSearchParams(l).toString();r=o.endsWith("yjearth4.0")?"".concat(o,"/api/v1/cameraData/list?").concat(c):"".concat(o,"/yjearth4.0/api/v1/cameraData/list?").concat(c),fetch(r,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.json().then((function(e){if(200===e.code||0===e.code){if(!i._DialogObject||!i._DialogObject._element||!i._DialogObject._element.content)return;var o=i._DialogObject._element.content.getElementsByClassName("pagination")[0],s=i._DialogObject._element.content.getElementsByClassName("camera-table")[0],a=s.getElementsByClassName("table-body")[0];if(a.innerHTML="",e.data){if(e.data.list&&e.data.list.length>0){Tn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(t){var o='\n <div class="tr">\n <div class="td">\n <input type="checkbox" value="'.concat(e.data.list[t].ID,'">\n <span>绑定</span>\n </div>\n <div class="td">').concat(e.data.list[t].cameraName,'</div>\n <div class="td" style="width: 80px; flex: 0 80px; min-width: 80px;">').concat(n[e.data.list[t].type],'</div>\n <div class="td" style="width: 126px; flex: 0 126px;min-width: 126px;">').concat(e.data.list[t].ip,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].port,'</div>\n <div class="td" style="width: 80px; flex: 0 80px;min-width: 80px;">').concat(e.data.list[t].userName,'</div>\n <div class="td">').concat(e.data.list[t].passWord,"</div>\n </div>"),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(e.data.list[t]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==e.data.list[t].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l<i._DialogObject.attribute.camera.length;l++)if(i._DialogObject.attribute.camera[l].ID===e.data.list[t].ID){r.checked=!0;break}},l=0;l<e.data.list.length;l++)r(l)}e.data&&e.data.total&&Tn(o,e.data.total,10,1,(function(e){i.cameraSelect&&i.cameraSelect(t,e)}))}else Tn(o,1,10,1),s.getElementsByClassName("table-empty")[0].style.display="flex",a.style.display="none"}else console.error(e.message)}))}))}}}},{key:"load",value:function(t){Lb(Fb,this)?t():Ab(Rb,this,t)}},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){var i=turf.bbox(t.geojson);i&&i[0]&&i[0]!=1/0&&(t.range=i),t.options.img&&e.createImage(t);if(!t.options.path.endsWith(".kml")&&!t.options.path.endsWith(".kmz")){return(new Cesium.GeoJsonDataSource).load(t.geojson,{clampToGround:!0}).then((function(t){o(t)}))}var n="";function o(e){if(t.entity=e,e.entities.values.forEach((function(e,i){e.show=t.options.show,e.type="vector",e.parentId=t.options.id,e.properties||(e.properties={}),vi(t.sdk,e);var n=function(e){var i=t.options.color;return t.disaster_type_colors&&t.disaster_type_colors.hasOwnProperty(e)&&(i=t.disaster_type_colors[e]),i}(e.properties&&e.properties[t.options.fxdj]&&e.properties[t.options.fxdj]._value);if(e.billboard&&(e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.point=new Cesium.PointGraphics({show:!0,color:Cesium.Color.fromCssColorString(n||"rgba(0,255,184,0.5)").withAlpha(t.opacity),pixelSize:10,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1)})),e.polyline){var o=e.polyline.material;n&&(o=Cesium.Color.fromCssColorString(n).withAlpha(t.opacity)),e.polyline=new Cesium.PolylineGraphics({positions:e.polyline.positions._value,width:e.polyline.width&&e.polyline.width.getValue(),clampToGround:!0,material:o,zIndex:t.sdk._entityZIndex})}if(e.polygon&&e.polygon.material){e.polygon.perPositionHeight=!1,e.polygon.extrudedHeight=void 0;var s=e.polygon.material.color._value;n&&(s=Cesium.Color.fromCssColorString(n)),(t.opacity||0===t.opacity)&&(s=s.withAlpha(t.opacity));var a=e.kml||e.kmz;if(a){var r=a.extendedData&&a.extendedData.BaseTexturePath&&a.extendedData.BaseTexturePath.value?a.extendedData.BaseTexturePath.value:void 0;r&&(e.polygon.material.image=r,e.polygon.material.repeat=new Cesium.Cartesian2(1,1)),e.polygon.material=new Cesium.ImageMaterialProperty({image:r,repeat:new Cesium.Cartesian2(1,1),color:s})}if(e.polygon.zIndex=t.sdk._entityZIndex,t.options.path.endsWith(".kml")||t.options.path.endsWith(".kmz")){var l=n?Cesium.Color.fromCssColorString("#000000"):e.polygon.outlineColor.getValue();(t.opacity||0===t.opacity)&&(l=l.withAlpha(t.opacity)),e.polygon.outlineWidth&&(e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:e.polygon.outlineWidth.getValue(),clampToGround:!0,material:l,zIndex:t.sdk._entityZIndex}))}else e.polyline=new Cesium.PolylineGraphics({positions:e.polygon.hierarchy._value.positions,width:1,clampToGround:!0,material:Cesium.Color.fromCssColorString("#000000").withAlpha(t.opacity),zIndex:t.sdk._entityZIndex}),e.point&&(e.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1)}));t.sdk._entityZIndex++}if(t.options.path.endsWith(".kml")||t.options.path.endsWith(".kmz")){if(e.label){e.label.font="16px Microsoft YaHei";var c=t.geojson.features[i];e.billboard.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND,e.properties=c?c.properties:{},e.properties.id||e.properties.Id||e.properties.ID||e.properties.addProperty("id",e.id),e.label.text=new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1)}}else e.point&&(e.label=new Cesium.LabelGraphics({text:new Cesium.CallbackProperty((function(){return e.properties[t.options.field]&&e.properties[t.options.field]._value+""}),!1),outlineColor:Cesium.Color.BLACK,outlineWidth:10,font:"16px Microsoft YaHei",fillColor:Cesium.Color.fromCssColorString("#ffeb3b"),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(0,-15),style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:new Cesium.CallbackProperty((function(){return ei()?void 0:Number.POSITIVE_INFINITY}),!1)}))})),!t.options.field){var i=["id","Id","ID","name","Name","NAME","address","Address","ADDRESS","text","Text","TEXT","label","Label","LABEL"].find((function(e){return void 0!==t.geojson.features[0].properties[e]}));if(i)t.options.field=i;else for(var n in t.geojson.features[0].properties){t.options.field=n;break}}Ab(Fb,t,!0),Lb(Rb,t)&&Lb(Rb,t).call(t)}t.options.host=t.options.host||h(),n=t.options.host.endsWith("yjearth4.0")?t.options.host+"/api/v1/vector/getKml":t.options.host+"/yjearth4.0/api/v1/vector/getKml",n+="?path="+t.options.path,fetch(n,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then((function(e){200===e.status&&e.blob().then((function(e){e.text().then((function(e){if(t.options.path.endsWith(".kmz"))e=n;else for(var i=(e=(new DOMParser).parseFromString(e,"text/xml")).getElementsByTagName("Placemark"),s=0;s<i.length;s++)i[s].id=t.geojson.features[s].id;Cesium.KmlDataSource.load(e,{camera:t.viewer.scene.camera,canvas:t.viewer.scene.canvas,clampToGround:!0}).then((function(t){o(t)}))}))}))}))}},{key:"createImage",value:function(t){if(t.removeImage(),t.range)for(var e=0;e<t.options.img.length;e++){var i,n=t.sdk.viewer.entities.add({show:t.options.show,rectangle:{coordinates:(i=Cesium.Rectangle).fromDegrees.apply(i,L()(t.range)),material:new Cesium.ImageMaterialProperty({image:t.options.img[e],transparent:!0})}});t.imgEntity.push(n)}}},{key:"getcanvas",value:function(t){var e=document.createElement("canvas"),i=e.getContext("2d");i.font="16px YaHei";for(var n=t.split("\n"),o=0,s=0,a=0;a<n.length;a++){var r=n[a],l=i.measureText(r).width;l>o&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,e.width=o,e.height=s;var c=i.createLinearGradient(0,0,o,s);return i.fillStyle=c,i.fillRect(0,0,o,s),i.fillStyle="#ffffff",i.font="16px YaHei",i.strokeStyle="#000000",i.strokeText(n,15,16*n.length+6.25+5*n.length),i.fillText(n,15,16*n.length+6.25+n.length-5),i.moveTo(o/2,s),i.stroke(),i.closePath(),e.toDataURL()}},{key:"createTableContent",value:function(t){for(var e="",i=0;i<t.currentData.length;i++){var n='<tr class="el-table__row">',o="";for(var s in t.currentData[i].attr)o+='<td rowspan="1" colspan="1" class="el-table_1_column_'.concat(i,' el-table__cell"><div class="cell">').concat(t.currentData[i].attr[s],"</div></td>");e+=n=n+o+"</tr>"}return e}}]);var i,n,s,r,l}(Wn);function Vb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Gb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Vb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Vb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ub(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Wb=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(i=Ub(this,e,[t,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));if(s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.name=i.options.text,i.options.show=!n.show&&!1!==n.show||n.show,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.fontSize=n.fontSize||20,i.options.duration=n.duration||0===n.duration?n.duration:5e4,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,!i.options.position&&i.options.positions){var r=function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.atan2(n,i)};i.options.position={lng:(i.options.positions[0].lng+i.options.positions[1].lng)/2,lat:(i.options.positions[0].lat+i.options.positions[1].lat)/2};var l=turf.point([i.options.positions[0].lng,i.options.positions[0].lat]),c=turf.point([i.options.positions[1].lng,i.options.positions[1].lat]),u={units:"miles"},p=turf.rhumbDistance(l,c,u),h=r([i.options.positions[0].lng,i.options.positions[0].lat],[i.options.positions[1].lng,i.options.positions[1].lat]);i.options.angle=(360+Cesium.Math.toDegrees(h))%360;var d=1e-4*Math.abs(Math.cos(Math.PI/180*i.options.position.lat)),m=i.getcanvas(),f=m.height/m.width,v=i.options.position.lng-1e-4/f,g=i.options.position.lat-d,y=i.options.position.lng+1e-4/f,b=i.options.position.lat+d,C=(g+b)/2,w=turf.point([v,C]),x=turf.point([y,C]),_=turf.rhumbDistance(w,x,u),E=Cesium.Math.toRadians(i.options.position.lat);_*=1+Math.abs(Math.sin(h)*Math.tan(E)*Math.sin(E)*Math.sin(E)),i.options.scale=p/_}return i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new wn,i._elms={},i.previous={position:Gb({},i.options.position)},i.event=new X(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return sn()(e,t),_()(e,[{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this._elms.lng&&this._elms.lng.forEach((function(e){e.value=t}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this._elms.lat&&this._elms.lat.forEach((function(e){e.value=t}))}},{key:"text",get:function(){return this.options.text},set:function(t){var e=this;this.options.text=t;for(var i=this.options.text.split("\n"),n=0;n<i.length;n++)if(i[n].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),i[n]=i[n].slice(0,80-i[n].length)}if(i.length>70){i.splice(70-i.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=i.join("\n"),this.entity){var o=this.getcanvas(),s=o.height/o.width;this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:o.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var t,i=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),n=[e.options.position.lng-1e-4*e.options.scale/s,e.options.position.lat-i,e.options.position.lng+1e-4*e.options.scale/s,e.options.position.lat+i];return(t=Cesium.Rectangle).fromDegrees.apply(t,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(t){t.value=e.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(t){this.options.angle=t,this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t}))}},{key:"scale",get:function(){return this.options.scale},set:function(t){this.options.scale=t,this._elms.scale&&this._elms.scale.forEach((function(e){e.value=t}))}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.duration&&this._elms.duration.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t;var e=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:i.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"create",value:function(){var t=this,e=this.getcanvas(),i=e.height/e.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var e,n=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),o=[t.options.position.lng-1e-4*t.options.scale/i,t.options.position.lat-n,t.options.position.lng+1e-4*t.options.scale/i,t.options.position.lat+n];return(e=Cesium.Rectangle).fromDegrees.apply(e,o)}),!1),material:new Cesium.CustomMaterialSource({image:e.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.options.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(t.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),Pe(this.sdk,this.options.id),this.options.show&&Kt(0,this.options.id)}},{key:"edit",value:(s=o()(a.a.mark((function t(e){var i,n,o,s=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=18;break}return t.next=6,new rn(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(t){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Pe(s.sdk,s.options.id),se(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.positionEditing=!1,s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">旋转角度</span>\n <input type="range" max="360" min="0" step="1" @model="angle">\n <div class="input-number input-number-unit" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="360" step="1" @model="angle">\n <span class="unit">°</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">调整大小</span>\n <input type="range" max="100000" min="0" step="0.01" @model="scale">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100000" step="0.01" @model="scale">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <div class="input-number" style="width: 100px;flex: 0 0 100px;margin-left: 10px;">\n <input class="input" type="number" title="" min="0" max="100" step="1" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],t.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(t){var e=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=t,this.previous={position:Gb({},this.options.position)},!0===t?(this.tip&&this.tip.destroy(),this.tip=new Z("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.tip.setPosition(i,t.endPosition.x,t.endPosition.y)})),this.event.mouse_left((function(t,i){var n=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=n.lng,e.lat=n.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1})),this.event.mouse_right((function(t,i){e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1})),this.event.gesture_pinck_start((function(t,i){var n=new Date;e.event.gesture_pinck_end((function(){if(new Date-n>=500)e.lng=e.previous.position.lng,e.lat=e.previous.position.lat,e.positionEditing=!1;else{var t=e.cartesian3Towgs84(i,e.sdk.viewer);e.lng=t.lng,e.lat=t.lat,e.event.mouse_move((function(){})),e.event.mouse_left((function(){})),e.event.mouse_right((function(){})),e.event.gesture_pinck_start((function(){})),e.event.gesture_pinck_end((function(){})),e.positionEditing=!1}}))}))):(this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy()))}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m,f,v,g,y,b=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(o={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},s=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),u={lng:0,lat:0},this.options.position?u=Gb({},this.options.position):this.options.positions?u=Gb({},this.options.positions[0]):this.options.center?u=Gb({},this.options.center):this.options.start?u=Gb({},this.options.start):(this.options.hasOwnProperty("lng")&&(u.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(u.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(u.alt=this.options.alt)),u.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(u);case 17:u.alt=t.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,r=this.options.customView.relativePosition.lat+u.lat,l=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),t.next=34;break;case 25:return p=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),h=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-p],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+p]],t.next=29,this.getClampToHeight(this.options.position);case 29:for(d=t.sent,m=[],f=0;f<h.length;f++)g=(v=Cesium.Cartesian3).fromDegrees.apply(v,L()(h[f]).concat([d])),m.push(g.x,g.y,g.z);y=Cesium.BoundingSphere.fromVertices(m),this.sdk.viewer.camera.flyToBoundingSphere(y,{offset:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}});case 34:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"reset",value:function(){this.entity&&(this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.angle=this.originalOptions.angle,this.scale=this.originalOptions.scale,this.color=this.originalOptions.color)}},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,Pe(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"getcanvas",value:function(){for(var t=document.createElement("canvas"),e=t.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){e.font="200px serif";var a=e.measureText(i[s]).width;o<a&&(o=a)}t.width=o,t.height=220*i.length;for(var r=0;r<i.length;r++)e.font="200px serif",e.fillStyle="rgba(255, 255, 255, 0)",e.fillRect(0,0,o+30,210),e.fillStyle="rgba(255, 255, 255, 1)",e.font="200px serif",e.fillText(i[r],0,210*(r+1));return t}}]);var i,n,s}(Wn);function Yb(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Jb=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),(n=Yb(this,e,[t,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a<s.length;a++)s[a].length>80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),n.options.text=s.join("\n"),n.options.color=i.color||"#FFC107",n.options.positions=i.positions,n.options.speed=i.speed||0===i.speed?i.speed:1,n.options.show=!i.show&&!1!==i.show||i.show,n.nodePoints=[],n.entity,n.options.instruct=i.instruct||"",n.options.operatingPoint=i.operatingPoint||"",n.options.attribute=i.attribute||{},n.options.attribute.link=n.options.attribute.link||{},n.options.attribute.link.content=n.options.attribute.link.content||[],n.options.attribute.camera=n.options.attribute.camera||[],n.options.attributeType=i.attributeType||"richText",n.extrudedHeight,n._EventBinding=new wn,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),e.create(n),n}return sn()(e,t),_()(e,[{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t;for(var e=this.options.text.split("\n"),i=0;i<e.length;i++)if(e[i].length>80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),e[i]=e[i].slice(0,80-e[i].length)}if(e.length>70){e.splice(70-e.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=e.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance2(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u<n.length;u++)o.push(n[u].lng,n[u].lat),s.push(n[u].alt),a.push(n[u].alt+c);this.entity.wall.material=r,this.entity.wall.maximumHeights=a,this.entity.wall.minimumHeights=s}this._elms.text&&this._elms.text.forEach((function(e){e.value=t}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t,this.entity.wall.material=this.getMaterial(),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this.entity.wall.material=this.getMaterial(),this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t}))}},{key:"attributeCamera",get:function(){return this.options.attribute.camera},set:function(t){this.options.attribute.camera=t}},{key:"edit",value:(s=o()(a.a.mark((function t(i){var n,o,s,r=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=20;break}return t.next=6,new rn(this.sdk,this.options,{title:"立体文字属性",left:"180px",top:"100px",confirmCallBack:function(t){r.text=r.text.trim(),r.text||(r.text="未命名对象"),r.originalOptions=r.deepCopyObj(r.options),r._DialogObject.close(),r.Dialog.confirmCallBack&&r.Dialog.confirmCallBack(r.originalOptions),Pe(r.sdk,r.options.id),se(r.sdk,r.options.id)},resetCallBack:function(){r.reset(),r.Dialog.resetCallBack&&r.Dialog.resetCallBack()},removeCallBack:function(){r.Dialog.removeCallBack&&r.Dialog.removeCallBack()},closeCallBack:function(){r.reset(),r.Dialog.closeCallBack&&r.Dialog.closeCallBack();for(var t=0;t<r.nodePoints.length;t++)r.sdk.viewer.entities.remove(r.nodePoints[t]);r.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),r.event&&r.event.destroy(),r.tip&&r.tip.destroy()},showCallBack:function(t){r.options.show=t,r.originalOptions.show=t,r.show=t,r.Dialog.showCallBack&&r.Dialog.showCallBack()},secondaryEditCallBack:function(){e.nodeEdit(r)}});case 6:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" stand-text",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <textarea @model="text"></textarea>\n </div>\n <div class="col" style="margin-right: 20px;">\n <span class="label">颜色</span>\n <div class="color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">滚动速度</span>\n <input type="range" max="100" min="0" step="1" @model="speed">\n <input style="font-size: 13px;width: 100px;margin-left: 10px;" type="number" title="" min="0" max="100" @model="speed">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),this.attributeType=this.options.attributeType,this.attributeCamera=this.options.attribute.camera,o=new YJColorPicker({el:n.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){r.color=t},clear:function(){r.color="rgba(255,255,255,1)"}}),s=n.getElementsByTagName("*"),this._EventBinding.on(this,s),this._elms=this._EventBinding.element,this._elms.color=[o],t.next=21;break;case 20:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 21:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.color=this.originalOptions.color,this.speed=this.originalOptions.speed;for(var t=this.options.positions,e=[],i=[],n=[],o=this.computeDistance2(t),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a<t.length;a++)e.push(t[a].lng,t[a].lat),i.push(t[a].alt),n.push(t[a].alt+s);this.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(e)}}},{key:"remove",value:(n=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.event&&this.event.destroy(),this.tip&&this.tip.destroy(),this.sdk.viewer.entities.remove(this.entity),this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,Pe(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getMaterial",value:function(){var t=this.getcanvas();return new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:5e4/this.options.speed,fltr:!1})}},{key:"getcanvas",value:function(){for(var t=document.createElement("canvas"),e=t.getContext("2d"),i=this.options.text.split("\n"),n=0;n<i.length;n++)i[n].length>80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s<i.length;s++){e.font="200px serif";var a=e.measureText(i[s]).width;o<a&&(o=a)}t.width=o,t.height=220*i.length;for(var r=0;r<i.length;r++)e.font="200px serif",e.fillStyle="rgba(255, 255, 255, 0)",e.fillRect(0,0,o+30,210),e.fillStyle="rgba(255, 255, 255, 1)",e.font="200px serif",e.fillText(i[r],0,210*(r+1));return this.aspectRatio=this.options.text?t.width/t.height:0,t}},{key:"openRichTextEditor",value:function(t){var e=this;On.open(this.options.id,this.options.text,this.options.richTextContent),On.primaryCallBack=function(t){e.options.richTextContent=t}}}],[{key:"create",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(i=e.options.positions,n=[],o=[],s=[],r=e.getMaterial(),l=e.computeDistance2(i),c=e.aspectRatio?l/e.aspectRatio:0,u=0;u<i.length;u++)n.push(i[u].lng,i[u].lat),o.push(i[u].alt),s.push(i[u].alt+c);e.entity=e.sdk.viewer.entities.add({id:e.options.id,show:e.options.show,wall:{positions:Cesium.Cartesian3.fromDegreesArray(n),cornerType:Cesium.CornerType.MITERED,maximumHeights:s,minimumHeights:o,material:r}}),Pe(e.sdk,e.options.id),e.options.show&&Kt(0,e.options.id);case 11:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})},{key:"nodeEdit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),t.tip=new Z("请选择一个顶点,右键取消",t.sdk),t.event=new X(t.sdk),t.nodePoints=[];for(var o=t.options.positions,s=[],a=[],r=[],l=t.computeDistance2(o),c=t.aspectRatio?l/t.aspectRatio:0,u=0;u<o.length;u++)s.push(o[u].lng,o[u].lat),a.push(o[u].alt),r.push(o[u].alt+c);var p=!1,h=function(e,o){if(i){p=!0;var u=t.sdk.viewer.scene.clampToHeight(o,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(u,t.sdk.viewer),n=t.options.positions[i.index];var h=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",position:Cesium.Cartesian3.fromDegrees(t.options.positions[i.index].lng,t.options.positions[i.index].lat,t.options.positions[i.index].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.splice(i.index,0,h),t.options.positions.splice(i.index,0,t.options.positions[i.index]);var d=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(d),c=t.aspectRatio?l/t.aspectRatio:0;for(var m=0;m<d.length;m++)s.push(d[m].lng,d[m].lat),a.push(d[m].alt),r.push(d[m].alt+c);t.tip.setPosition(o,e.position.x,e.position.y)}else{var f=t.sdk.viewer.scene.pick(e.position);f&&f.id&&f.id.name&&"node-secondary-edit-point"===f.id.name&&(i=f.id,t.nodePoints.splice(f.id.index,1),t.sdk.viewer.entities.remove(f.id),t.tip.set_text("左键开始,右键结束,CTRL+右键撤销"),n=t.cartesian3Towgs84(o,t.sdk.viewer),t.entity.wall.positions=new Cesium.CallbackProperty((function(){return Cesium.Cartesian3.fromDegreesArray(s)}),!1),t.entity.wall.maximumHeights=new Cesium.CallbackProperty((function(){return r}),!1),t.entity.wall.minimumHeights=new Cesium.CallbackProperty((function(){return a}),!1))}},d=function(o,u){i&&(t.options.positions[i.index]=n,p&&t.options.positions.splice(i.index,1),e(null,t.options.positions));var h=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(h),c=t.aspectRatio?l/t.aspectRatio:0;for(var d=0;d<h.length;d++)s.push(h[d].lng,h[d].lat),a.push(h[d].alt),r.push(h[d].alt+c);t.entity.wall.positions=Cesium.Cartesian3.fromDegreesArray(s);for(var m=0;m<t.nodePoints.length;m++)t.sdk.viewer.entities.remove(t.nodePoints[m]);t.nodePoints=[],YJ.Measure.SetMeasureStatus(!1),t.event.destroy(),t.tip.destroy()};t.event.mouse_left(h),t.event.mouse_right(d),t.event.mouse_move((function(e,n){if(i){var o=t.sdk.viewer.scene.clampToHeight(n,[t.entity]);t.options.positions[i.index]=t.cartesian3Towgs84(o,t.sdk.viewer);var u=t.options.positions;s=[],a=[],r=[],l=t.computeDistance2(u),c=t.aspectRatio?l/t.aspectRatio:0;for(var p=0;p<u.length;p++)s.push(u[p].lng,u[p].lat),a.push(u[p].alt),r.push(u[p].alt+c)}t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),t.event.mouse_right_keyboard_ctrl((function(e,n){i&&(t.options.positions.pop(),t.sdk.viewer.entities.remove(t.nodePoints[t.nodePoints.length-1]),t.nodePoints.pop(),i.index===t.options.positions.length&&(t.nodePoints[i.index-1]?i=t.nodePoints[i.index-1]:i.index=0))})),t.event.gesture_pinck_start((function(e,i){var n=new Date,o={position:{x:(e.position1.x+e.position2.x)/2,y:(e.position1.y+e.position2.y)/2}};t.event.gesture_pinck_end((function(){new Date-n>=500?d(o,i):h(o,i)}))}));for(var m=0;m<t.options.positions.length;m++){var f=t.sdk.viewer.entities.add({name:"node-secondary-edit-point",index:m,position:Cesium.Cartesian3.fromDegrees(t.options.positions[m].lng,t.options.positions[m].lat,t.options.positions[m].alt),billboard:{image:t.getSourceRootPath()+"/img/point.png",width:15,height:15,disableDepthTestDistance:Number.POSITIVE_INFINITY,color:Cesium.Color.WHITE.withAlpha(.99)}});t.nodePoints.push(f)}}}}]);var i,n,s}(Wn);function qb(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qb(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):qb(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Zb(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var Kb=function(t){function e(t,i){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(n=Zb(this,e)).sdk=t,n.viwer=t.viewer,n.options=Xb({},i),n.options.host=i.host||h(),n.options.name=i.name||"未命名对象",n.options.show=!i.show&&!1!==i.show||i.show,"number"==typeof i.scale?(n.options.scale={},n.options.scale.x=i.scale,n.options.scale.y=i.scale,n.options.scale.z=i.scale):(n.options.scale=i.scale||{},n.options.scale.x=n.options.scale.x||0===n.options.scale.x?n.options.scale.x:1,n.options.scale.y=n.options.scale.y||0===n.options.scale.y?n.options.scale.y:1,n.options.scale.z=n.options.scale.z||0===n.options.scale.z?n.options.scale.z:1),n.primitive=null,n._loadEvent=void 0,n._loaded=!1,n._elms={},n.Dialog=o,n._EventBinding=new wn,e.setDefaultValue(n),n.requestResource(),n.ControllerObject=new Jo(n.sdk,{position:Xb({},n.options.position),rotate:{x:(360+n.options.roll%360)%360,y:(360+-n.options.pitch%360)%360,z:(360+-n.options.heading%360)%360}}),n.ControllerObject.controllerCallBack=n.controllerCallBack,n.HeadingPitchRollCallBack=n.Dialog.HeadingPitchRollCallBack,n}return sn()(e,t),_()(e,[{key:"requestResource",value:function(){this.addResource().then((function(t){}))}},{key:"addResource",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this).options.xmlURL=e.options.objUrl.replace(".obj",".xml"),""===e.options.xmlURL){t.next=34;break}return t.next=5,fetch(e.options.xmlURL);case 5:if(!(i=t.sent).ok){t.next=32;break}return t.next=9,i.text();case 9:return n=t.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=e.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),e.options.position=e.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},e.ControllerObject.position=e.options.position,u=e.viwer.scene,p=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),h=Cesium.Transforms.headingPitchRollToFixedFrame(p,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),t.next=22,window.objLoader.Load(e.options.objUrl);case 22:(d=t.sent).show=e.options.show,d.modelMatrix=h,d.setFlvVideo(e.options.videoUrl),u.primitives.add(d),e.primitive=d,e.controllerCallBack({rotate:{x:e.options.roll,y:-e.options.pitch,z:-e.options.heading},position:Xb({},e.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:t.next=36;break;case 34:return console.error("请填写xml路径"),t.abrupt("return");case 36:if(""!==e.options.objUrl){t.next=39;break}return console.error("请填写obj模型路径"),t.abrupt("return");case 39:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]?p[0]:{},!this._error){t.next=3;break}return t.abrupt("return");case 3:if(pi(0),ii(this.sdk),ni(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){t.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=Xb({},this.options.position):this.options.positions?l=Xb({},this.options.positions[0]):this.options.center?l=Xb({},this.options.center):this.options.start?l=Xb({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){t.next=18;break}return t.next=17,this.getClampToHeight(l);case 17:l.alt=t.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),t.next=28;break;case 25:c=100*Math.tan(60),u=c/111319.55,this.sdk.viewer.camera.flyTo({destination:new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat-u,this.options.position.alt+100),orientation:e.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return p.length>0&&void 0!==p[0]&&p[0],e=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,new rn(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(t){u.name=u.name.trim(),u.name||(u.name="未命名对象"),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},rotateCallBack:function(){u.rotationEditing?u.rotationEditing=!1:u.rotationEditing=!0},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 6:for(this._DialogObject=t.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input name" type="text" @model="name">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">经度</span>\n <input class="input" type="number" title="" min="-180" max="180" @model="lng">\n </div>\n <div class="col">\n <span class="label">海拔高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="-9999999" max="999999999" step="0.01" @model="alt">\n <span class="unit">m</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">纬度</span>\n <input class="input" type="number" title="" min="-90" max="90" @model="lat">\n </div>\n <div class="col">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="lable-left-line">\n <span>缩放</span>\n <div class="checkbox-box" style="display: flex;align-items: center;margin-left: 20px;">\n <input type="checkbox" style="width: 14px;height: 14px;margin-top: 2px;margin-right: 5px;cursor: pointer;">\n <span>是否等比例缩放</span>\n </div>\n </div>\n </div>\n <div class="row no-equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">x 轴</span>\n <input class="scale-x" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleX">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-x" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleX">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">y 轴</span>\n <input class="scale-y" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleY">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-y" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleY">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n <div class="row">\n <div class="col">\n <span class="label">z 轴</span>\n <input class="scale-z" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01" @model="scaleZ">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-z" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01" @model="scaleZ">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="row equal" style="display: none;">\n <div class="row">\n <div class="col">\n <span class="label">等比例缩放</span>\n <input class="scale-all" style="flex: 1;margin-right: 15px;" type="range" max="99" min="0.0001" step="0.01">\n <div class="input-number input-number-unit-1" style="width: auto;">\n <input class="scale-all" style="width: 100px;" type="number" title="" min="0" max="99" step="0.01">\n <span class="unit">倍</span>\n <span class="arrow"></span>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),o=this._DialogObject._element.content.getElementsByClassName("equal")[0],s=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],n.checked=e,n.addEventListener("change",(function(t){(e=t.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(r=o.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),r[1].addEventListener("input",(function(t){u.scaleX=t.target.value,u.scaleY=t.target.value,u.scaleZ=t.target.value})),e?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var t=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];t&&(t.style.position="absolute",t.style.left="100px")}}),0),l=i.getElementsByTagName("*"),c=0;c<l.length;c++)l[c].addEventListener("input",(function(t){if("0"===t.target.value&&"0"===t.target.min)switch(t.target.className){case"scale-x":u.scaleX=1e-4;break;case"scale-y":u.scaleY=1e-4;break;case"scale-z":u.scaleZ=1e-4;case"scale-all":u.scaleX=1e-4,u.scaleY=1e-4,u.scaleZ=1e-4}}));this._EventBinding.on(this,l),this._elms=this._EventBinding.element,this._elms.scaleX.push(r[0],r[1]);case 28:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){if(this.ControllerObject.destroy(),this.options=this.deepCopyObj(this.originalOptions),this.name=this.options.name,this.primitive){var t=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat,this.options.position.alt));this.primitive.modelMatrix=t,this.primitive.modelMatrix=Cesium.Matrix4.multiplyByMatrix3(this.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(this.options.heading,this.options.pitch,this.options.roll)),this.primitive.modelMatrix);var e=this.options.scale.x,i=this.options.scale.y,n=this.options.scale.z;0===e&&(e=1e-5),0===i&&(i=1e-5),0===n&&(n=1e-5),Cesium.Matrix4.multiplyByScale(this.primitive.modelMatrix,new Cesium.Cartesian3(e,i,n),this.primitive.modelMatrix)}}},{key:"remove",value:function(){this.sdk.viewer.scene.primitives.remove(this.primitive),this.primitive=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"controllerCallBack",get:function(){var t=this;return function(e){t.options.heading=-e.rotate.z,t.options.pitch=-e.rotate.y,t.options.roll=e.rotate.x,t.HeadingPitchRollCallBack&&t.HeadingPitchRollCallBack(e);var i=Number(Number(e.position.lng).toFixed(8)),n=Number(Number(e.position.lat).toFixed(8)),o=Number(Number(e.position.alt).toFixed(2));t.options.position={lng:i,lat:n,alt:o};var s=Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(e.position.lng,e.position.lat,e.position.alt));t.primitive.modelMatrix=s,Cesium.Matrix4.multiplyByMatrix3(t.primitive.modelMatrix,Cesium.Matrix3.fromHeadingPitchRoll(Cesium.HeadingPitchRoll.fromDegrees(-e.rotate.z,-e.rotate.y,e.rotate.x)),t.primitive.modelMatrix);var a=t.options.scale.x,r=t.options.scale.y,l=t.options.scale.z;0===a&&(a=1e-5),0===r&&(r=1e-5),0===l&&(l=1e-5),Cesium.Matrix4.multiplyByScale(t.primitive.modelMatrix,new Cesium.Cartesian3(a,r,l),t.primitive.modelMatrix),t._elms.lng&&t._elms.lng.forEach((function(e){e.value=t.options.position.lng})),t._elms.lat&&t._elms.lat.forEach((function(e){e.value=t.options.position.lat})),t._elms.alt&&t._elms.alt.forEach((function(e){e.value=t.options.position.alt}))}},set:function(t){this._controllerCallBack=t}},{key:"name",get:function(){return this.options.name},set:function(t){this.options.name=t,this._elms.name&&this._elms.name.forEach((function(e){e.value=t}))}},{key:"rotationEditing",get:function(){return"rtation"===this.ControllerObject.getActiveState()},set:function(t){t?this.ControllerObject.editRtation():this.ControllerObject.destroy()}},{key:"scaleX",get:function(){return this.options.scale.x},set:function(t){var e=this;this.options.scale.x=Number(Number(t).toFixed(4)),this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleX&&this._elms.scaleX.forEach((function(t){t.value=e.options.scale.x}))}},{key:"scaleY",get:function(){return this.options.scale.y},set:function(t){var e=this;this.options.scale.y=Number(Number(t).toFixed(4)),this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleY&&this._elms.scaleY.forEach((function(t){t.value=e.options.scale.y}))}},{key:"scaleZ",get:function(){return this.options.scale.z},set:function(t){var e=this;this.options.scale.z=Number(Number(t).toFixed(4)),this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}}),this._elms.scaleZ&&this._elms.scaleZ.forEach((function(t){t.value=e.options.scale.z}))}},{key:"positionEditing",get:function(){return"translational"===this.ControllerObject.getActiveState()},set:function(t){this.sdk&&this.sdk.viewer&&this.ControllerObject&&(t?this.ControllerObject.editTranslational():this.ControllerObject.destroy())}},{key:"lng",get:function(){return this.options.position.lng},set:function(t){this.options.position.lng=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"lat",get:function(){return this.options.position.lat},set:function(t){this.options.position.lat=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"alt",get:function(){return this.options.position.alt},set:function(t){this.options.position.alt=t,this.ControllerObject.position={lng:this.options.position.lng,lat:this.options.position.lat,alt:this.options.position.alt},this.controllerCallBack({position:Xb({},this.options.position),rotate:{x:(360+this.options.roll%360)%360,y:(360+-this.options.pitch%360)%360,z:(360+-this.options.heading%360)%360}})}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t?(this.options.show=t,this.primitive.show=t):console.error("参数必须为boolean")}},{key:"playDistance",get:function(){return this.options.playDistance},set:function(t){this.options.playDistance=t}},{key:"flicker",value:function(){}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}},{key:"customView",get:function(){this.options.customView}},{key:"setCustomView",value:function(t){if(t)this.options.customView=t;else{var e=this.sdk.viewer.camera;this.options.customView={orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},position:{x:e.position.x,y:e.position.y,z:e.position.z}},this.originalOptions&&(this.originalOptions.customView=this.options.customView)}}},{key:"resetCustomView",value:function(){this.options.customView=void 0}}],[{key:"setDefaultValue",value:function(t){t.options.id=t.options.id||t.randomString(),t.options.position=t.options.position,t.options.objUrl=t.options.objUrl||"",t.options.videoUrl=t.options.videoUrl||"",t.options.xmlURL=t.options.xmlURL||"",t.options.heading=t.options.heading||0,t.options.pitch=t.options.pitch||0,t.options.roll=t.options.roll||0}}]);var i,n,s}(fi);function $b(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Qb(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$b(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$b(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function tC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var eC=function(t){function e(t,i,n){var o;return k()(this,e),(o=tC(this,e,[t,i,n]))._loadEvent=void 0,o._loaded=!1,o.options.objId=i.objId,o.options.videoId=i.videoId,o.options.videoType=i.videoType||"flv",o}return sn()(e,t),_()(e,[{key:"addResource",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this).options.xmlURL=e.options.objUrl.replace(".obj",".xml"),""===e.options.xmlURL){t.next=35;break}return t.next=5,fetch(e.options.xmlURL);case 5:if(!(i=t.sent).ok){t.next=33;break}return t.next=9,i.text();case 9:return n=t.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=e.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),e.options.position=e.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},e.ControllerObject.position=e.options.position,u=e.viwer.scene,p=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),h=Cesium.Transforms.headingPitchRollToFixedFrame(p,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),d=new ji(e.viwer.scene.context),t.next=23,d.Load(e.options.objUrl,e.options.videoId,e.options.host);case 23:(m=t.sent).modelMatrix=h,m.show=e.options.show,m.setFlvVideo(e.options.videoUrl),u.primitives.add(m),e.primitive=m,e.controllerCallBack({rotate:{x:e.options.roll,y:-e.options.pitch,z:-e.options.heading},position:Qb({},e.options.position)}),e.loaded=!0,e._loaded=!0,e._loadEvent&&e._loadEvent();case 33:t.next=36;break;case 35:return t.abrupt("return");case 36:if(""!==e.options.objUrl){t.next=38;break}return t.abrupt("return");case 38:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"requestResource",value:(i=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this)._loaded){t.next=12;break}if(!e.options.objId){t.next=6;break}return t.next=5,e.requestObjResource();case 5:e.options.objUrl=t.sent;case 6:if(!e.options.videoId){t.next=10;break}return t.next=9,e.requestVideoResource();case 9:e.options.videoUrl=t.sent;case 10:return t.next=12,e.addResource();case 12:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"requestObjResource",value:function(){var t="",e=(t=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/obj/"+this.options.objId;return fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=13;break}if(!n.data.objPath.length){e.next=9;break}return e.abrupt("return",t+"/obj/wirte/file/"+n.data.objPath);case 9:console.warn("资源不存在");case 10:return e.abrupt("return");case 13:return console.warn(n.msg||n.message),e.abrupt("return");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"requestVideoResource",value:function(){var t="",e=(t=this.options.host.endsWith("yjearth4.0")?this.options.host:this.options.host+"/yjearth4.0")+"/videoFusion/"+this.options.videoId;return fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var e=o()(a.a.mark((function e(i){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.text();case 2:if(n=e.sent,n=JSON.parse(n),![0,200].includes(n.code)){e.next=13;break}if(!n.data.deviceCode.length){e.next=9;break}return e.abrupt("return",fetch(t+"/videoFusion/vide/stream",{method:"post",body:JSON.stringify({type:"flv",deviceCode:n.data.deviceCode}),headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}}).then(function(){var t=o()(a.a.mark((function t(e){var i;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.text();case 2:if(i=t.sent,i=JSON.parse(i),![0,200].includes(i.code)){t.next=13;break}if(!i.data.flv||!i.data.flv.length){t.next=9;break}return t.abrupt("return",i.data.flv);case 9:console.warn("地址不存在");case 10:return t.abrupt("return");case 13:return console.warn(i.msg||i.message),t.abrupt("return");case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 9:console.warn("设备不存在");case 10:return e.abrupt("return");case 13:return console.warn(n.msg||n.message),e.abrupt("return");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}}]);var i,n}(Kb);function iC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function nC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?iC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):iC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var oC=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),this.sdk=e,this.options=nC({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||h(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(t){var e=this;if("boolean"==typeof t){this.options.show=t;for(var i=function(i){e.objModelObject[i].load((function(){e.objModelObject[i].show=t}))},n=0;n<this.objModelObject.length;n++)i(n)}else console.error("参数必须为boolean")}},{key:"on",value:(t=o()(a.a.mark((function t(){var e,i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e="",e=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/source/obj":this.options.host+"/yjearth4.0/api/v1/source/obj",this.options.code&&(e=e+"?code="+this.options.code),t.next=5,fetch(e,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 5:if(!(i=t.sent).ok){t.next=15;break}return this.objModelObject=[],t.next=10,i.json();case 10:for(this.list=t.sent.data,this.options.count&&(this.list=this.list.splice(0,this.options.count)),n=0;n<this.list.length;n++)(o=JSON.parse(this.list[n].detail)).host=this.options.host,(this.options.show||!1===this.options.show)&&(o.show=this.options.show),s=new eC(this.sdk,o),this.objModelObject.push(s);this._loaded=!0,this._loadEvent&&this._loadEvent();case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:function(){for(var t=this,e=function(e){t.objModelObject[e].load((function(){t.objModelObject[e].remove()}))},i=0;i<this.objModelObject.length;i++)e(i)}},{key:"load",value:function(t){this._loaded?t():this._loadEvent=t}}]);var t}();function sC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var aC=function(t){function e(t,i){var n;if(k()(this,e),(n=sC(this,e,[t,i])).viewer=t.viewer,n.options.show=!i.show&&!1!==i.show||i.show,n.options.positions=n.options.positions||[],n.options.data=n.options.data,n.options.gradient=i.gradient||{.9:"red",.8:"orange",.7:"yellow",.5:"blue",.3:"green"},n.entity={id:n.options.id},!n.options.positions||n.options.positions.length<3)n._error="最少需要三个坐标!",console.warn(n._error),window.ELEMENT&&window.ELEMENT.Message({message:n._error,type:"warning",duration:1500});else{for(var o=[],s=0;s<n.options.positions.length;s++)o.push([n.options.positions[s].lng,n.options.positions[s].lat]);var a=turf.lineString(o),r=turf.bbox(a);n.bounds={west:r[0],south:r[1],east:r[2],north:r[3]},e.add(n)}return n}return sn()(e,t),_()(e,[{key:"remove",value:function(){this.viewer.entities.remove(this.entity),this.entity=null}},{key:"createHeatMap",value:function(t,e){var i=CesiumHeatmap.create(this.bounds,{backgroundColor:"rgba(0,0,0,0)",radius:20,maxOpacity:.5,minOpacity:0,blur:.75,gradient:this.options.gradient});return i.setWGS84Data(0,t,e),i}}],[{key:"add",value:function(t){var i=[];t.options.positions.forEach((function(t){i.push(t.lng,t.lat)}));var n=e.getData(t),o=t.createHeatMap(n.max,n.data);t.entity=new Cesium.Entity({id:t.options.id,show:t.options.show,polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),material:o._heatmap._renderer.canvas,zIndex:t.sdk._entityZIndex}}),t.sdk._entityZIndex++,t.viewer.entities.add(t.entity)}},{key:"getData",value:function(t){var e=1e3,i=[];if(t.options.data&&Array.isArray(t.options.data)){for(var n=t.options.data[0].value,o=0;o<t.options.data.length;o++){var s=t.options.data[o].value;n=Math.max(n,s),i.push({x:t.options.data[o].lng,y:t.options.data[o].lat,value:s})}return{max:n,data:i}}for(var a=0;e--;){var r=Math.floor(1e3*Math.random());a=Math.max(a,r);var l={x:Math.random()*(t.bounds.east-t.bounds.west)+t.bounds.west,y:Math.random()*(t.bounds.north-t.bounds.south)+t.bounds.south,value:r};i.push(l)}return{max:a,data:i}}}])}(Wn);function rC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}function lC(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}function cC(t,e,i){return t.set(pC(t,e),i),i}function uC(t,e){return t.get(pC(t,e))}function pC(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var hC=new WeakMap,dC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),lC(i=rC(this,e,[t,n]),hC,void 0),i.options.id=n.id||i.randomString(),i.options.name=n.name||"漫游路径",i.options.points=n.points||[],i.options.repeat&&(i.options.repeat=Number(i.options.repeat)),i.Dialog=o,i}return sn()(e,t),_()(e,[{key:"repeat",get:function(){return this.options.repeat},set:function(t){if(this.options.repeat!=Number(t)&&(this.options.repeat=Number(t),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var e=this._DialogObject._element.content.querySelector("input[name='repeat']");e.checked=t===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(e.checked)}}},{key:"edit",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c,u,p,h,d,m,f,v,g=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=44;break}return s=function(t){var e=l.getElementsByClassName("tr");e.length>0&&(e[e.length-1].querySelector("input[name='time']").disabled=void 0);var s=l.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n <div class="td" style="justify-content: center;">视点'.concat(u+1,'</div>\n <div class="td">\n <input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="').concat(t.duration,'">\n </div>\n <div class="td action">\n <button class="play">播放</span>\n <button class="delete">删除</span>\n </div>\n '),a.addEventListener("click",(function(t){if(t.target.parentNode===a){var i=l.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;n<e.length;n++)if(e[n]===a){o=n+1;break}}})),a.addEventListener("dblclick",(function(t){if(t.target.parentNode===a)for(var i=0;i<e.length;i++)if(e[i]===a){n.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(p[i].position.lng,p[i].position.lat,p[i].position.alt),orientation:p[i].orientation,duration:1});break}}));var r=a.getElementsByClassName("play")[0],c=a.getElementsByClassName("delete")[0],h=a.querySelector("input[name='time']");r.addEventListener("click",(function(){for(var t=0;t<e.length;t++)e[t]===c.parentNode.parentNode&&i.flyTo(t)})),c.addEventListener("click",(function(t){for(var n=0;n<e.length;n++)if(e[n]===c.parentNode.parentNode){if(p.splice(n,1),p[p.length-1].duration=0,i.options.points.splice(n,1),l.removeChild(a),o>n+1?(o--,e[o-1].className="tr active"):o==n+1&&(e.length==n&&(o-=1),0!=e.length&&(e[o-1].className="tr active")),e.length>0){var s=e[e.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),h.addEventListener("input",(function(e){f.checked=!1,t.duration=Number(h.value),t.duration<0&&(t.duration=0)})),h.addEventListener("blur",(function(){h.value=Number(Number(h.value).toFixed(2)),h.value<0&&(h.value=0)})),l.insertBefore(a,e[o]),o++,e[e.length-1].querySelector("input[name='time']").disabled="disabled"},t.next=8,new W(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=t.sent,t.next=11,this._DialogObject.init();case 11:for((r=document.createElement("div")).className="fly-roam",r.innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" type="text" name="name">\n </div>\n <div class="col"></div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">设置总时长</span>\n <div class="input-number input-number-unit-3">\n <input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">\n <span class="unit" style="top: 6px;">秒(s)</span>\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">\n <span class="label">是否循环播放</span>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <button class="add-point"><svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点</button>\n </div>\n <div class="col">\n <button class="modify-point"><svg class="icon-edit"><use xlink:href="#yj-icon-edit"></use></svg>调整视点</button>\n </div>\n <div class="col">\n <button class="afreshPlay"><svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放</button>\n </div>\n <div class="col">\n <button class="cease"><svg class="icon-pause"><use xlink:href="#yj-icon-pause"></use></svg>结束</button>\n </div>\n </div>\n <div class="table">\n <div class="table-head">\n <div class="tr">\n <div class="th">序号</div>\n <div class="th">时长(s)</div>\n <div class="th">操作</div>\n </div>\n </div>\n <div class="table-body">\n <div class="table-empty">\n <div class="empty-img"></div>\n <p>暂无数据</p>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(r),r.getElementsByTagName("*"),l=r.getElementsByClassName("table-body")[0],c=r.getElementsByClassName("table-empty")[0],u=0,p=new Proxy([],{set:function(t,e,i){return t[e]=i,t.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u<this.options.points.length;u++)p.push(this.options.points[u]),s(this.options.points[u]);(h=r.querySelector("input[name='name']")).value=this.name,h.addEventListener("input",(function(){g.name=h.value})),(d=document.createElement("button")).innerHTML="保存",d.addEventListener("click",(function(){g.name||(g.name="漫游路径",h.value=g.name);var t=[];p.map((function(e){t.push(e)})),g._DialogObject.close(),g.Dialog.confirmCallBack&&g.Dialog.confirmCallBack({id:g.options.id,name:g.name,points:t,repeat:g.repeat+""})})),this._DialogObject.footAppChild(d),r.getElementsByClassName("cease")[0].addEventListener("click",(function(){n.camera.cancelFlight()})),r.getElementsByClassName("afreshPlay")[0].addEventListener("click",(function(){p.length>0&&g.flyTo(0)})),r.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var t={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};p.splice(o,0,t),g.options.points.splice(o,0,t),s(t),u++})),r.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var t=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=p[o-1].position=t,g.options.points[o-1].orientation=p[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll},g.message({text:"操作成功"})}})),m=r.querySelector("input[name='totalTime']"),f=r.querySelector("input[name='isTotalTime']"),v=r.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var t=l.getElementsByClassName("tr");if(f.checked&&t.length>0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)p[i].duration=e,g.options.points[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),m.addEventListener("blur",(function(){var t=l.getElementsByClassName("tr");if(m.value=Number(m.value),m.value<0&&(m.value=0),f.checked&&t.length>0){for(var e=Number((Number(m.value)/(t.length-1)).toFixed(2)),i=0;i<t.length-1;i++)p[i].duration=e,g.options.points[i].duration=e,t[i].querySelector("input[name='time']").value=e;t[t.length-1].querySelector("input[name='time']").value=0}})),v.checked=this.repeat===1/0,v.addEventListener("change",(function(){v.checked?g.repeat=1/0:g.repeat=0}));case 44:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"flyTo",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;pi(0);var i=this,n=this.options.points,s=this.repeat;ii(i.sdk);var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;uC(hC,t)&&uC(hC,t).destroy();var l=t;cC(hC,t,new Cesium.ScreenSpaceEventHandler(l.sdk.viewer.canvas)),uC(hC,t).setInputAction((function(e){t.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=l.sdk.viewer;pi(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[e].position.lng,n[e].position.lat,n[e].position.alt),orientation:n[e].orientation,duration:i?n[e-1].duration:.5,maximumHeight:n[e].position.alt,complete:(c=o()(a.a.mark((function i(){return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e++,t.repeat===1/0?s=1/0:s===1/0&&(s=t.repeat),e<=n.length-1?r(e,!0):s?(s--,r(0)):uC(hC,t)&&uC(hC,t).destroy();case 3:case"end":return i.stop()}}),i)}))),function(){return c.apply(this,arguments)}),easingFunction:i?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})};r(e)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),uC(hC,this)&&uC(hC,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}(Wn);function mC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var fC=function(){return _()((function t(e,i,n){k()(this,t),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?mC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):mC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.viewer=i,this.viewer1=n,this.head=0,this.pitch=90,this.po=1e-5,this.position=null,this.hpr=null,this.currentFrustumOutline=null,this.frustum=null,this.setInterval1=null,this.webrtc=null,t.setDefaultValue(this),this.create()}),[{key:"create",value:function(){this.frustum=new Cesium.PerspectiveFrustum({fov:Cesium.Math.toRadians(this.options.fov),aspectRatio:this.options.aspectRatio,near:this.options.near,far:this.options.far});var t=this.options.position,e=t.lng,i=t.lat,n=t.alt,o=this.options,s=o.heading,a=o.pitch,r=o.roll;this.position=Cesium.Cartesian3.fromDegrees(e,i,n+this.options.normalHeight),this.hpr=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(s),Cesium.Math.toRadians(a),Cesium.Math.toRadians(r)),this.drawFrustumOutline(),this.drawFrustumFilled(),this.monitorKeyboard(),this.updateFrustumSquareBase(40),this.syncHpr(),this.options.videoUrl&&this.addVideoToFrustumTop2()}},{key:"monitorKeyboard",value:function(){var t=this,e={KeyQ:function(){return t.setIntervalhpr(-.45)},KeyE:function(){return t.setIntervalhpr(.45)},KeyB:function(){return t.setIntervalhprr(-.45)},KeyN:function(){return t.setIntervalhprr(.45)},KeyW:function(){return t.updateFrustumPosition("move",-1e-5)},KeyS:function(){return t.updateFrustumPosition("move",1e-5)},KeyA:function(){return t.updateFrustumPosition("move",-1e-5,0)},KeyD:function(){return t.updateFrustumPosition("move",1e-5,0)},KeyC:function(){return t.updateFrustumHeight(1)},KeyZ:function(){return t.updateFrustumHeight(-1)}};this.keydownHandler=function(t){e[t.code]&&e[t.code]()},this.keyupHandler=function(){return t.stopFrustumRotation()},document.addEventListener("keydown",this.keydownHandler),document.addEventListener("keyup",this.keyupHandler)}},{key:"addVideoToFrustumTop",value:function(){var t=this,e=document.createElement("video");if(e.width=640,e.height=360,e.autoplay=!0,e.loop=!0,e.muted=!0,document.body.appendChild(e),flvjs.isSupported()){var i=flvjs.createPlayer({type:"flv",isLive:!0,hasAudio:!1,enableStashBuffer:!0,enableWorker:!0,autoCleanupSourceBuffer:!0,url:this.options.videoUrl});i.attachMediaElement(e),i.load(),i.play()}else console.error("FLV.js is not supported in this browser.");var n=this.computeFrustumCorners(this.frustum,this.position,this.hpr),o=new Cesium.PolygonHierarchy([n.bottomLeft,n.bottomRight,n.topRight,n.topLeft]);this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:o}})),e.addEventListener("loadeddata",(function(){t.videoEntity.polygon.material=e}))}},{key:"addVideoToFrustumTop2",value:(e=o()(a.a.mark((function t(){var e,i,n,o=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=document.createElement("video")).width=640,e.height=360,e.autoplay=!0,e.loop=!0,e.muted=!0,document.body.appendChild(e),t.next=9,this.startPlay(e,this.options.videoUrl);case 9:i=this.computeFrustumCorners(this.frustum,this.position,this.hpr),n=new Cesium.PolygonHierarchy([i.bottomLeft,i.bottomRight,i.topRight,i.topLeft]),this.videoEntity=this.viewer.entities.add(new Cesium.Entity({id:"22222222",show:!0,polygon:{hierarchy:n}})),e.addEventListener("loadeddata",(function(){o.videoEntity.polygon.material=e}));case 13:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"startPlay",value:(t=o()(a.a.mark((function t(e,i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.webrtc&&this.webrtc.close(),this.webrtc=new SrsRtcWhipWhepAsync,e.srcObject=this.webrtc.stream,t.prev=3,t.next=6,this.webrtc.play(i);case 6:n=t.sent,console.log(n),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),this.webrtc.close();case 13:case"end":return t.stop()}}),t,this,[[3,10]])}))),function(e,i){return t.apply(this,arguments)})},{key:"computeFrustumCorners",value:function(t,e,i){var n=Math.tan(.5*t.fov),o=t.far*n,s=o*t.aspectRatio,a=new Cesium.Cartesian3(-s,o,-t.far),r=new Cesium.Cartesian3(s,o,-t.far),l=new Cesium.Cartesian3(-s,-o,-t.far),c=new Cesium.Cartesian3(s,-o,-t.far),u=Cesium.Transforms.headingPitchRollToFixedFrame(e,i);return{topLeft:Cesium.Matrix4.multiplyByPoint(u,a,new Cesium.Cartesian3),topRight:Cesium.Matrix4.multiplyByPoint(u,r,new Cesium.Cartesian3),bottomLeft:Cesium.Matrix4.multiplyByPoint(u,l,new Cesium.Cartesian3),bottomRight:Cesium.Matrix4.multiplyByPoint(u,c,new Cesium.Cartesian3)}}},{key:"updatePolygonPosition",value:function(){var t=this.computeFrustumCorners(this.frustum,this.position,this.hpr);this.videoEntity.polygon.hierarchy=new Cesium.CallbackProperty((function(e){return new Cesium.PolygonHierarchy([t.bottomLeft,t.bottomRight,t.topRight,t.topLeft])}))}},{key:"updateFrustumSquareBase",value:function(t){var e=(56-t)/55*9900+100;this.frustum.aspectRatio=1;var i=Math.sqrt(e),n=this.frustum.far,o=2*Math.atan(i/(2*n));this.frustum.fov=o,this.drawFrustumOutline(),this.drawFrustumFilled(),this.syncHpr()}},{key:"updateFrustumHeight",value:function(t){var e=Cesium.Cartographic.fromCartesian(this.position);e.height+=t,this.position=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude),e.height),this.options.position.alt=e.height,this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updatePositionHeight",value:function(t){this.options.position=this.cartesian3Towgs84(t),this.syncHpr(),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"cartesian3Towgs84",value:function(t){var e=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"setIntervalhpr",value:function(t){var e=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){e.head+=t,e.updateFrustumHPR(Cesium.Math.toRadians(e.head),e.pitch)}),10)}},{key:"setIntervalhprr",value:function(t){var e=this;this.stopFrustumRotation(),this.setInterval1=setInterval((function(){e.pitch=Math.max(60,Math.min(180,e.pitch+t)),e.updateFrustumHPR(e.head,Cesium.Math.toRadians(e.pitch))}),10)}},{key:"stopFrustumRotation",value:function(){this.setInterval1&&(clearInterval(this.setInterval1),this.setInterval1=null)}},{key:"drawFrustumFilled",value:function(){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),e=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))});this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4))}}),appearance:new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromAlpha(Cesium.Color.YELLOW,.4)}),translucent:!0}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}},{key:"drawFrustumOutline",value:function(){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr),e=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))});this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)}}),appearance:new Cesium.PolylineColorAppearance({translucent:!1}),asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline)}},{key:"updateFrustumPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move",e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("move"===t){var o=turf.point([this.options.position.lng,this.options.position.lat]),s=Cesium.Math.toDegrees(this.hpr.heading),a=s+i,r={units:"degrees"},l=turf.destination(o,e,a,r).geometry.coordinates;this.position=Cesium.Cartesian3.fromDegrees(l[0],l[1],this.options.position.alt+this.options.normalHeight),this.options.position.lng=l[0],this.options.position.lat=l[1],this.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(l[0],l[1],this.viewer.camera.positionCartographic.height)})}"update"===t&&(this.position=e,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var t=this.options.position,e=t.lng,i=t.lat,n=t.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(e,i,n+this.options.normalHeight),orientation:{heading:this.hpr.heading+Cesium.Math.toRadians(-90),pitch:o,roll:this.hpr.roll}})}}},{key:"updateFrustumHPR",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pitch,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";function s(t){return t*Math.PI/180}"alone"==o?(this.hpr.heading=s(t),this.hpr.pitch=s(e),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(t),this.hpr.pitch=Cesium.Math.negativePiToPi(e),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var t=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(t)try{var e=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))}),i=new Cesium.PolylineColorAppearance({translucent:!1}),n=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW),o=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(t,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(t,new Cesium.Matrix3))}),s=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.YELLOW.withAlpha(.5)}),translucent:!0}),a=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED.withAlpha(.5));this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:e,attributes:{color:n}}),appearance:i,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:a}}),appearance:s,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}catch(t){console.error("Error in drawFrustum:",t)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(t,e){this.frustum.near=t,this.frustum.far=e,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(t){this.frustum.fov=Cesium.Math.toRadians(t),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.options.show=t,this.currentFrustumOutline.show=t,this.currentFrustumFilled.show=t)}},{key:"remove",value:function(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.videoEntity&&this.viewer.entities.remove(this.videoEntity)}}],[{key:"setDefaultValue",value:function(t){var e;t.options.position=t.options.position||{},t.options.fov=t.options.fov||30,t.options.aspectRatio=t.options.aspectRatio||1,t.options.near=t.options.near||1,t.options.far=t.options.far||120,t.options.heading=t.options.heading||0,t.options.pitch=t.options.pitch||90,t.options.roll=t.options.roll||0,t.options.show=null===(e=t.options.show)||void 0===e||e,t.options.videoUrl=t.options.videoUrl||"",t.options.index=t.options.index||0,t.options.arr=t.options.arr||[],t.options.normalHeight=t.options.normalHeight||100}}]);var t,e}();function vC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var gC=function(){return _()((function t(e,i){k()(this,t),this.options=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?vC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):vC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.pointEntity=null,this.billboardEntity=null,this.lineEntity=null,this.updatedPosition=[],this.pointUpdatedPosition=[],this.viewer=i,this.handler=new Cesium.ScreenSpaceEventHandler(i.scene.canvas),this.pinBuilder=new Cesium.PinBuilder,this.index=null,t.setDefaultValue(this),t.init(this)}),[{key:"changeAltitude",value:function(){var t,e,i=!1,n=this,o=!1;document.addEventListener("keydown",(function(t){"h"===t.key&&(o=!0)})),document.addEventListener("keyup",(function(t){o=!1})),this.handler.setInputAction((function(o){var s=n.viewer.scene.pick(o.position);if(Cesium.defined(s)&&Cesium.defined(s.id)&&s.id===n.billboardEntity){i=!0,t=o.position;var a=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue());e=a.height}}),Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction((function(s){if(i&&0==o){var a=n.viewer.scene.pickPosition(s.endPosition);if(n.disableCameraDrag(n.viewer,!1),a){var r=Cesium.Cartographic.fromCartesian(a),l=r.longitude,c=r.latitude,u=Cesium.Cartesian3.fromRadians(l,c,e),p=Cesium.Cartesian3.fromRadians(l,c,0);n.billboardEntity.position=new Cesium.CallbackProperty((function(){return u}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(l).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(c).toFixed(6),"\nAlt: ").concat(e.toFixed(2),"m"),n.pointEntity.position=new Cesium.CallbackProperty((function(){return p}),!1)}}if(i&&o){console.log(o);var h=s.endPosition,d=t.y-h.y,m=e+d,f=Cesium.Cartographic.fromCartesian(n.billboardEntity.position.getValue()),v=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(f.longitude),Cesium.Math.toDegrees(f.latitude),m);n.disableCameraDrag(n.viewer,!1),n.billboardEntity.position=new Cesium.CallbackProperty((function(){return v}),!1),n.billboardEntity.label.text="Lat: ".concat(Cesium.Math.toDegrees(f.longitude).toFixed(6),"\nLon: ").concat(Cesium.Math.toDegrees(f.latitude).toFixed(6),"\nAlt: ").concat(m.toFixed(2),"m")}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction((function(t){var e=n.viewer.scene.pick(t.position);i=!1,o=!1,n.disableCameraDrag(n.viewer,!0),Cesium.defined(e)&&Cesium.defined(e.id)&&e.id===n.billboardEntity&&(n.options.saveFun&&n.options.saveFun(null,!1),n.options.selectFun&&n.options.selectFun(n.billboardEntity.index-1),n.options.frustum.updatePositionHeight(n.billboardEntity.position.getValue()))}),Cesium.ScreenSpaceEventType.LEFT_UP)}},{key:"disableCameraDrag",value:function(t,e){t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableTilt=e,t.scene.screenSpaceCameraController.enableLook=e}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.pointEntity.show=t,this.billboardEntity.show=t,this.lineEntity.show=t)}},{key:"remove",value:function(){this.viewer.entities.remove(this.pointEntity),this.viewer.entities.remove(this.billboardEntity),this.viewer.entities.remove(this.lineEntity)}}],[{key:"setDefaultValue",value:function(t){var e;t.options.positions=t.options.positions||{},t.options.normalHeight=t.options.normalHeight||100,t.options.airHeight=t.options.airHeight||100,t.options.image=t.options.image||"/static/img/cluster2.png",t.options.show=t.options.show||!0,t.options.index=t.options.index||1,t.options.saveFun=t.options.saveFun||null,t.options.selectFun=t.options.selectFun||null,t.options.keyboard=null===(e=t.options.keyboard)||void 0===e||e,t.options.updateFrustumFun=t.options.updateFrustumFun||null,t.options.frustum=t.options.frustum||null}},{key:"init",value:function(t){var e=t.options.positions;t.pointEntity=t.viewer.entities.add({show:t.options.show,position:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,0),point:{pixelSize:8,color:Cesium.Color.WITHE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:0}});var i=t.pinBuilder.fromText(t.options.index,Cesium.Color.fromCssColorString("#00d590"),36).toDataURL(),n=0;n=e.altitude?e.altitude:t.options.normalHeight,t.billboardEntity=t.viewer.entities.add({show:t.options.show,position:Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt+t.options.normalHeight),label:{text:"Lat: ".concat(e.lng.toFixed(8),"\nLon: ").concat(e.lat.toFixed(8),"\nAlt: ").concat(n.toFixed(8),"m"),font:"14px sans-serif",fillColor:Cesium.Color.YELLOW,outlineColor:Cesium.Color.BLACK,outlineWidth:2,pixelOffset:new Cesium.Cartesian2(0,-60),heightReference:Cesium.HeightReference.RELATIVE_TO_TERRAIN,show:!1},billboard:{image:i,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,width:36,height:36},index:t.options.index}),t.lineEntity=t.viewer.entities.add({show:t.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){return[t.pointEntity.position.getValue(),t.billboardEntity.position.getValue()]}),!1),width:1,material:new Cesium.PolylineOutlineMaterialProperty({outlineColor:Cesium.Color.GAINSBORO,outlineWidth:1,color:Cesium.Color.WITHE}),zIndex:99999999}}),t.options.keyboard&&t.changeAltitude(),t.handler.setInputAction((function(e){var i=t.viewer.scene.pick(e.position);Cesium.defined(i)&&Cesium.defined(i.id)&&i.id===t.billboardEntity&&t.options.selectFun&&t.options.selectFun(t.billboardEntity.index-1)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}}])}();function yC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function bC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var CC=function(){return _()((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;k()(this,t),this.options=bC({},e),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],t.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var t=this;if(!(this.options.positions.length<2)){var e=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var e=[],i=0;i<t.billordPointLineMaps.length;i++){var n=t.billordPointLineMaps[i];e.push(n.billboardEntity.position.getValue())}return e}),!1),width:3,material:Cesium.Color.fromCssColorString(this.options.color)}});for(var i=0;i<this.options.positions.length;i++){var n=this.options.positions[i];e&&i==this.index&&(this.frustum=new fC({position:n,show:!1,arr:this.options.positions,index:i,normalHeight:this.options.normalHeight},this.viewer,this.viewer1));var o=new gC({positions:n,index:i+1,saveFun:this.options.saveFun,selectFun:this.options.selectFun,keyboard:this.options.keyboard,updateFrustumFun:this.updateFrustumPosition,normalHeight:this.options.normalHeight,frustum:this.frustum,airHeight:this.options.airHeight},this.viewer);this.billordPointLineMaps.push(o)}this.onKey()}}},{key:"show",get:function(){return this.options.show},set:function(t){"boolean"==typeof t&&(this.frustum.currentFrustumOutline.show=t,this.billordPointLineMaps.forEach((function(e){e.show=t})),this.entity.show=t)}},{key:"onKey",value:function(){var t=this;document.addEventListener("keydown",(function(e){switch(e.key){case"ArrowUp":t.index+=1,t.updateFrustum(!0);break;case"ArrowDown":t.index-=1,t.updateFrustum(!1)}}))}},{key:"updateFrustum",value:function(t){if(console.log(this.index),this.index>this.options.positions.length-1||this.index<0){var e=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(e)}else for(var i=0;i<this.billordPointLineMaps.length;i++){var n=this.billordPointLineMaps[i];if(i==this.index){var o=n.billboardEntity.position.getValue();0!==this.index&&(this.direction(this.billordPointLineMaps[i-1].billboardEntity.position.getValue(),n.billboardEntity.position.getValue()).hpr,gn()("hpr")),0==this.index&&(this.direction(this.billordPointLineMaps[0].billboardEntity.position.getValue(),this.billordPointLineMaps[1].billboardEntity.position.getValue()).hpr,gn()("hpr")),o&&this.frustum.updateFrustumPosition("update",o)}}}},{key:"cartesian3Towgs84",value:function(t){var e=this.viewer.scene.globe.ellipsoid,i=new Cesium.Cartesian3(t.x,t.y,t.z),n=e.cartesianToCartographic(i),o=Cesium.Math.toDegrees(n.latitude);return{lng:Cesium.Math.toDegrees(n.longitude),lat:o,alt:n.height<0?0:n.height}}},{key:"direction",value:function(t,e){var i=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),n=Cesium.Cartesian3.normalize(i,new Cesium.Cartesian3),o=Cesium.Transforms.rotationMatrixFromPositionVelocity(t,n,Cesium.Ellipsoid.WGS84),s=Cesium.Matrix4.fromRotationTranslation(o,t),a=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Matrix4.getTranslation(s,new Cesium.Cartesian3),Cesium.Ellipsoid.WGS84,new Cesium.Matrix4),r=Cesium.Matrix4.multiply(Cesium.Matrix4.inverse(a,new Cesium.Matrix4),s,new Cesium.Matrix4),l=Cesium.Matrix4.getMatrix3(r,new Cesium.Matrix3),c=Cesium.Quaternion.fromRotationMatrix(l),u=Cesium.HeadingPitchRoll.fromQuaternion(c);return u.pitch=90,{hpr:u,orientation:Cesium.Transforms.headingPitchRollQuaternion(t,u)}}},{key:"delPosition",value:function(t){this.options.positions.splice(t,1),this.remove(),this.create()}},{key:"getNewPositions",value:function(){for(var t=[],e=0;e<this.billordPointLineMaps.length;e++){var i=this.billordPointLineMaps[e],n=this.cartesian3Towgs84(i.billboardEntity.position.getValue());t.push(n)}return t}},{key:"remove",value:function(){this.billordPointLineMaps.forEach((function(t,e){t.remove()})),this.frustum&&this.frustum.remove(),this.viewer.entities.remove(this.entity),this.billordPointLineMaps=[]}},{key:"addPoint",value:function(t){this.options.positions=t,this.remove(),this.create()}},{key:"updateFrustumPosition",value:function(t){if(this.billordPointLineMaps&&0!==this.billordPointLineMaps.length){this.frustum&&(this.frustum.show=!0);var e=this.billordPointLineMaps[t].billboardEntity.position.getValue();if(0!==t){var i=t===this.billordPointLineMaps.length-1?this.billordPointLineMaps[t-1].billboardEntity.position.getValue():this.billordPointLineMaps[t+1].billboardEntity.position.getValue(),n=this.direction(t===this.billordPointLineMaps.length-1?i:e,t===this.billordPointLineMaps.length-1?e:i).hpr;this.frustum.updateFrustumHPR(n.heading,Cesium.Math.toRadians(this.frustum.pitch),n.roll)}else{var o=this.billordPointLineMaps[1].billboardEntity.position.getValue(),s=this.direction(e,o).hpr;this.frustum.updateFrustumHPR(s.heading,Cesium.Math.toRadians(this.frustum.pitch),s.roll)}e&&this.frustum.updateFrustumPosition("update",e);var a=this.cartesian3Towgs84(e);this.billordPointLineMaps.forEach((function(t){t.billboardEntity.label.show=!1}));var r=this.billordPointLineMaps.find((function(e){return e.billboardEntity.index==t+1}));return r&&(r.billboardEntity.label.show=!0),a}}},{key:"flyTo",value:function(){for(var t=[],e=0;e<this.options.positions.length;e++){var i=Cesium.Cartesian3.fromDegrees(this.options.positions[e].lng,this.options.positions[e].lat,this.options.positions[e].alt+this.options.height);t.push(i.x,i.y,i.z)}var n=Cesium.BoundingSphere.fromVertices(t);this.viewer.camera.flyToBoundingSphere(n,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-80),roll:Cesium.Math.toRadians(0)}})}},{key:"countLength",value:function(){if(this.options.positions.length<2)return 0;var t=[];this.options.positions.forEach((function(e){t.push([e.lng,e.lat])}));var e=turf.lineString(t);return(1e3*turf.length(e)).toFixed(2)}},{key:"countTime",value:function(){var t=Math.floor(Number(this.countLength()))/this.options.speed,e=Math.floor(t%60);return Math.floor(t/60)+"分"+e+"秒"}}],[{key:"setDefaultValue",value:function(t){var e,i;t.options.positions=t.options.positions||[],t.options.show=t.options.show||!0,t.options.color=t.options.color||"#00d590",t.options.height=t.options.height||500,t.options.speed=t.options.speed||1,t.options.frustumShow=null===(e=t.options.frustumShow)||void 0===e||e,t.options.saveFun=t.options.saveFun||null,t.options.selectFun=t.options.selectFun||null,t.options.keyboard=null===(i=t.options.keyboard)||void 0===i||i,t.options.normalHeight=t.options.normalHeight||100,t.options.airHeight=t.options.airHeight||100}}])}();function wC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var kC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,e),(i=wC(this,e,[t,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return sn()(e,t),_()(e,[{key:"start",value:function(t){var e=this;if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Z(this.options.tipText,this.sdk),this.event=new X(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){e.end();var s=e.cartesian3Towgs84(i||o,e.viewer),a=e.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(e.isEntity=!0),t(null,s,e.isEntity)})),this.event.mouse_right((function(i,n){e.end(),t(!1)})),this.event.mouse_move((function(t,n){i=n,e.tip.setPosition(n,t.endPosition.x,t.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;e.event.gesture_pinck_end((function(){if(new Date-s>=500)e.end(),t(!1);else{e.end();var n=e.cartesian3Towgs84(i||o,e.viewer);t(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(Ca);function xC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function _C(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?xC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):xC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function EC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var SC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,e),(i=EC(this,e,[t,n])).viewer=i.sdk.viewer,i.options.name=n.name||"飞线",i.options.pointNumber=n.pointNumber||200,i.options.height=n.height||200,i.options.heightDifference=n.heightDifference||3e3,i.options.width=n.width||2,i.options.duration=n.duration||10,i.options.color=n.color||"rgba(255,255,255,1)",i.options.lineBackAlpha=n.lineBackAlpha||.05,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new wn,i._elms={},i.positionArea=[],i.positions=[],i.sdk.addIncetance(i.options.id,i),e.drawLine(i),i}return sn()(e,t),_()(e,[{key:"getRandomPointsInCesiumPolygon",value:function(t,e){var i=[],n=[],o=[];t.forEach((function(t){i.push(t.lng),n.push(t.lat),o.push([t.lng,t.lat])})),o.push([o[0][0],o[0][1]]);for(var s=Math.min.apply(Math,i),a=Math.max.apply(Math,i),r=Math.min.apply(Math,n),l=Math.max.apply(Math,n),c=[];c.length<e;){var u=s+Math.random()*(a-s),p=r+Math.random()*(l-r),h=turf.point([u,p]),d=turf.polygon([o]);if(turf.booleanPointInPolygon(h,d)){var m=Cesium.Cartesian3.fromDegrees(u,p),f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(m).height;c.push([u,p,f])}}return c}},{key:"getLine",value:function(t,e){var i;t.viewer.entities.getById(t.options.id)&&(t.viewer.entities.getById(t.options.id)._children.forEach((function(e){t.viewer.entities.remove(e)})),t.viewer.entities.remove(t.viewer.entities.getById(t.options.id))),i=t.viewer.entities.add(new Cesium.Entity({id:t.options.id,show:t.options.show})),e.forEach((function(e,n){var o=e,s=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),a=Cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]+t.options.height+Math.random()*t.options.heightDifference);t.viewer.entities.add({parent:i,id:t.options.id+"-"+(new Date).getTime()+n,polyline:{positions:[s,a],width:t.options.width,material:new Cesium.FlowLineMaterialProperty({color:t.options.color,duration:t.options.duration,lineBackAlpha:t.options.lineBackAlpha,num:0})}})}))}},{key:"color",get:function(){return this.options.color},set:function(t){var e=this;this.options.color=t;var i=this.viewer.entities.getById(this.options.id);i&&i._children.forEach((function(e){e.polyline.material.color=Cesium.Color.fromCssColorString(t)})),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:t,disabled:!1,openPickerAni:"opacity",sure:function(t){e.color=t},clear:function(){e.color="rgba(255,255,255,1)"}});e._elms.color[n]=o}))}},{key:"pointNumber",get:function(){return this.options.pointNumber},set:function(t){if(this.options.pointNumber=t,this.viewer.entities.getById(this.options.id)){var e=this.getRandomPointsInCesiumPolygon(this.positionArea,this.options.pointNumber);this.positions=e,this.getLine(this,e)}}},{key:"height",get:function(){return this.options.height},set:function(t){this.options.height=t,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;var e=this.viewer.entities.getById(this.options.id);e&&(e.show=t)}},{key:"heightDifference",get:function(){return this.options.heightDifference},set:function(t){this.options.heightDifference=t,this.viewer.entities.getById(this.options.id)&&this.getLine(this,this.positions)}},{key:"width",get:function(){return this.options.width},set:function(t){this.options.width=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.width=t}))}},{key:"duration",get:function(){return this.options.duration},set:function(t){this.options.duration=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.material.duration=t}))}},{key:"lineBackAlpha",get:function(){return this.options.lineBackAlpha},set:function(t){this.options.lineBackAlpha=t;var e=this.viewer.entities.getById(this.options.id);e&&e._children.forEach((function(e){e.polyline.material.lineBackAlpha=t}))}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s=this,r=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=19;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"飞线属性",left:"180px",top:"100px",confirmCallBack:function(t){s.name=s.name.trim(),s.name||(s.name="飞线"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Pe(s.sdk,s.options.id),se(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(t){s.show=t,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col">\n <span class="label">颜色</span>\n <div class="flowLine-color"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">飞线数量</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="pointNumber">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="width">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n\n <div class="col">\n <span class="label">飞线高度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="999999" step="1" @model="height">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">飞线高度差</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="0" step="1" @model="heightDifference">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">单次运动时长(s)</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="999999999" min="1" step="1" @model="duration">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">轨迹透明度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="1" min="0.01" step="0.01" @model="lineBackAlpha">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("flowLine-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(t){s.color=t},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],t.next=19;break;case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.pointNumber=this.originalOptions.pointNumber,this.height=this.originalOptions.height,this.heightDifference=this.originalOptions.heightDifference,this.width=this.originalOptions.width,this.duration=this.originalOptions.duration,this.color=this.originalOptions.color,this.lineBackAlpha=this.originalOptions.lineBackAlpha)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.length>0&&void 0!==h[0]&&h[0],pi(0),ii(this.sdk),ni(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=_C({},this.options.position):this.options.positions?r=_C({},this.options.positions[0]):this.options.center?r=_C({},this.options.center):this.options.start?r=_C({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e});else{for(l=[],c=0;c<this.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.positions[c][0],this.positions[c][1],this.positions[c][2]+this.options.height+this.options.heightDifference/2),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getSphere",value:function(){var t=this;return new Promise((function(e){var i=setInterval((function(){var e=new Cesium.BoundingSphere;t.sdk.viewer._dataSourceDisplay.getBoundingSphere(t.viewer.entities.getById(t.options.id),!1,e)===Cesium.BoundingSphereState.DONE&&clearInterval(i)}),1e3)}))}},{key:"remove",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.entities.getById(this.options.id)&&(this.viewer.entities.getById(this.options.id)._children.forEach((function(t){e.viewer.entities.remove(t)})),this.viewer.entities.remove(this.viewer.entities.getById(this.options.id))),this.positions=[],this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,Pe(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){new _a(t.sdk).start((function(e,i){t.positionArea=i;var n=t.getRandomPointsInCesiumPolygon(i,t.options.pointNumber);t.positions=n,t.getLine(t,n),t.edit(!0)}))}},{key:"drawLine",value:function(t){t.positionArea=t.options.positions;var e=t.getRandomPointsInCesiumPolygon(t.options.positions,t.options.pointNumber);t.positions=e,t.getLine(t,e)}}]);var i,n,s}(Wn);function DC(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return PC(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?PC(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function PC(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var MC=function(){function t(){k()(this,t),this.element={}}return _()(t,[{key:"getEvent",value:function(e){return t.event[e]}},{key:"getEventAll",value:function(){return t.event}},{key:"setEvent",value:function(e,i){t.event[e]=i}},{key:"on",value:function(t,e){var i=this;this.element={};for(var n=function(){if(!e[o]||!e[o].attributes)return 1;var n,s={input:[],change:[],blur:[],click:[]},a=!1,r=[],l=DC(e[o].attributes);try{var c=function(){var l=n.value;switch(l.name){case"@model":a=!0,"checkbox"==e[o].type?(s.change.push((function(e){t[l.value]=e.target.checked})),e[o].checked=t[l.value]):("number"==e[o].type?(s.input.push((function(e){if(e.target.value||0===e.target.value){var i=e.target.value;i=Number(i),"."==e.data||"-"==e.data&&!e.target.value||((!e.target.max&&!e.target.min||i<=Number(e.target.max)&&i>=Number(e.target.min))&&(i=i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),t[l.value]=i)}})),s.blur.push((function(e){var i=e.target.value;(e.target.value||"undefined"!==e.target.dataset.null&&""!==e.target.dataset.null&&!Boolean(e.target.dataset.null))&&(i=Number(i),e.target.max&&i>Number(e.target.max)&&(i=Number(e.target.max)),e.target.min&&i<Number(e.target.min)&&(i=Number(e.target.min)),e.target.dataset.min&&i<Number(e.target.dataset.min)&&(i=Number(e.target.dataset.min))),t[l.value]=i}))):s.input.push((function(e){t[l.value]=e.target.value})),"IMG"==e[o].nodeName?e[o].src=t[l.value]:e[o].value=t[l.value]),i.element[l.value]?i.element[l.value].push(e[o]):i.element[l.value]=[e[o]],r.push(l.name);break;case"@click":a=!0,s.click.push((function(e){"function"==typeof t[l.value]&&t[l.value](e)})),r.push(l.name)}};for(l.s();!(n=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}for(var u=0;u<r.length;u++)e[o].attributes.removeNamedItem(r[u]);if(a){var p=function(t){s[t].length>0&&e[o].addEventListener(t,(function(e){for(var i=0;i<s[t].length;i++)s[t][i](e)}))};for(var h in s)p(h)}},o=0;o<e.length;o++)n()}}])}();C()(MC,"event",{});var OC=MC;function TC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var NC=function(){return _()((function t(e,i){k()(this,t),this.sdk=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?TC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):TC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e),this.progress=document.getElementById("progress"),this.handle=document.getElementById("handle"),this.timeline=document.getElementsByClassName("timeline-container")[0],this.currentTime=document.getElementById("currentTime"),this.timelineCon=document.getElementsByClassName("timeline-container")[0],this.speed=i,this.animationId,this.startTime=performance.now(),this.manualPosition=null,this.isDragging=!1,this.pauseed=!1,this.time="",this.update=this.update.bind(this),t.init(this)}),[{key:"moveComplay",value:function(t){var e=this;document.addEventListener("mouseup",(function(){e.isDragging&&(e.isDragging=!1,null!==e.manualPosition&&(e.startTime=performance.now()-86400*e.manualPosition*1e3/e.speed,e.manualPosition=null,e.changeDate&&(e.changeDateGrag=!0),e.pauseed?(e.pausedTime=performance.now(),t(e.currentTime.textContent)):(e.update(),t(e.time))))}))}},{key:"formatTime",value:function(t){var e=Math.floor(t/3600).toString().padStart(2,"0"),i=Math.floor(t%3600/60).toString().padStart(2,"0"),n=Math.floor(t%60).toString().padStart(2,"0");return"".concat(e,":").concat(i,":").concat(n)}},{key:"update",value:function(){if(null===this.manualPosition){this.changeDate&&(this.startTime=performance.now());var t=(performance.now()-this.startTime)*this.speed/1e3%86400,e=t/86400;this.progress.style.width="".concat(100*e,"%"),this.time=this.formatTime(t),this.currentTime.textContent=this.time,this.pauseed||(this.animationId&&cancelAnimationFrame(this.animationId),this.animationId=requestAnimationFrame(this.update))}}},{key:"setSpeed",value:function(t){var e=performance.now();if(this.pauseed){var i,n=e-this.pausedTime;this.startTime+=n;var o=null!==(i=this.manualPosition)&&void 0!==i?i:(e-this.startTime)*this.speed/864e5;this.speed=t,this.startTime=e-86400*o*1e3/this.speed,this.pausedTime=e}else{var s,a=null!==(s=this.manualPosition)&&void 0!==s?s:(performance.now()-this.startTime)*this.speed/864e5;this.speed=t,this.startTime=performance.now()-86400*a*1e3/this.speed}this.manualPosition=null}},{key:"updateTime",value:function(){this.manualPosition=null,this.startTime=performance.now()-86400*(this.manualPosition||0)*1e3/this.speed,this.pauseed&&(this.changeDate=!0),this.changeDateGrag=void 0,this.update()}},{key:"clear",value:function(){this.animationId&&cancelAnimationFrame(this.animationId),this.progress.style.width="0%",this.currentTime.textContent="00:00:00"}}],[{key:"init",value:function(t){for(var e=0;e<=24;e++)if(e%6==0){var i=document.createElement("div");i.className="time-mark",i.textContent="".concat(e,":00"),i.style.left="".concat(e/24*100,"%"),document.getElementsByClassName("time-marks")[0].appendChild(i)}t.startTime=performance.now()-86400*(t.manualPosition||0)*1e3/t.speed,t.timeline.addEventListener("mousedown",(function(e){"handle"===e.srcElement.className&&(t.isDragging=!0),e.preventDefault()})),t.timeline.addEventListener("mousemove",(function(e){if(t.isDragging){var i=t.timeline.getBoundingClientRect(),n=(e.clientX-i.left)/i.width;n=Math.max(0,Math.min(1,n)),t.manualPosition=n,t.progress.style.width="".concat(100*n,"%");var o=86400*n;t.currentTime.textContent=t.formatTime(o)}})),t.update(),document.getElementById("timePause").addEventListener("click",(function(){if(t.pauseed=!t.pauseed,t.pauseed)t.pausedTime=performance.now(),document.getElementById("timePause").textContent="播放",t.animationId&&cancelAnimationFrame(t.animationId),t.sdk.viewer.clock.shouldAnimate=!1;else{var e=performance.now(),i=e-t.pausedTime;document.getElementById("timePause").textContent="暂停",t.manualPosition=null,t.startTime+=i,t.changeDate&&(t.changeDateGrag?t.changeDateGrag=void 0:t.startTime=e,t.changeDate=void 0),t.sdk.viewer.clock.shouldAnimate=!0,t.update()}}))}}])}();function BC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function LC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?BC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):BC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var AC=function(){return _()((function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),this.viewer=e.viewer,this.options=LC({},i),this.sdk=LC({},e),this.options.time=i.time||new Date,this.options.speed=i.speed||1e3,this.options.darkness=i.darkness||.4,this.options.softShadow=i.softShadow||!0,this.options.show=!0===i.show,this.Dialog=n,this.timeLine,this._EventBinding=new OC,this._elms={},t.start(this)}),[{key:"darkness",get:function(){return this.options.darkness},set:function(t){this.options.darkness=t,this.viewer.shadowMap.darkness=1-this.options.darkness,this._elms.darkness&&this._elms.darkness.forEach((function(e){e.value=t}))}},{key:"speed",get:function(){return this.options.speed},set:function(t){this.options.speed=t,this._elms.speed&&this._elms.speed.forEach((function(e){e.value=t})),this.viewer.clock.multiplier=this.options.speed,this.timeLine.setSpeed(t)}},{key:"softShadow",get:function(){return this.options.softShadow},set:function(t){this.options.softShadow=t,this.viewer.shadowMap.softShadows=this.options.softShadow}},{key:"edit",value:(i=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],i=new fi,this.originalOptions=i.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=25;break}return n=this,t.next=8,new rn(this.sdk,this.originalOptions,{title:"光照属性",left:"180px",top:"100px",resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},closeCallBack:function(){u.reset(),n.remove(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},showCallBack:function(t){u.show=t,u.Dialog.showCallBack&&u.Dialog.showCallBack()}},!0);case 8:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" sun-shine-surface",(o=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">播放倍数</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0.01" max="999999" step="10" @model="speed">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">阴影柔和度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="0" max="1" step="0.1" @model="darkness">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">阴影优化</span>\n <input class="btn-switch" type="checkbox" @model="softShadow">\n </div>\n <div class="col">\n <span class="label" style="flex: 0 0 56px;">日期选择</span>\n <input class="sunshine-date" type="text" placeholder="YYYY-MM-DD" @model="time">\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <div class="timeline-container">\n <div class="timeline" id="timeline">\n <div class="progress" id="progress">\n <div class="handle" id="handle"></div>\n <div class="current-time" id="currentTime">00:00:00</div>\n </div>\n </div>\n <div class="time-marks">\n </div>\n <button id="timePause">暂停</button>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(o),s=this,this.timeLine=new NC(this.sdk,this.options.speed),this.timeLine.moveComplay((function(t){var e=s.time+" "+t;s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e)),s.viewer.scene.requestRender()})),l=o.getElementsByClassName("sunshine-date")[0],r=jeDate(l,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(t){this.time=t.val;var e=(new Date).setHours(0,0,0,0);s.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e)),s.timeLine.updateTime(e)}}),this.time?r.setValue(this.time):(r.nowBtn&&r.nowBtn(),this.time=r.getValue()),c=o.getElementsByTagName("*"),this._EventBinding.on(this,c),this._elms=this._EventBinding.element,this._elms.color=[r],t.next=25;break;case 25:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.time=this.originalOptions.time,this.speed=this.originalOptions.speed,this.darkness=this.originalOptions.darkness)}},{key:"flyTo",value:(e=o()(a.a.mark((function t(){var e=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:!(e.length>0&&void 0!==e[0])||e[0];case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"remove",value:(t=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.viewer.scene.globe.enableLighting=!1,this.viewer.shadows=!1,this.viewer.clock.multiplier=1,this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date),this.entity=null,this.timeLine.clear(),this.viewer.shadowMap.cascadesEnabled=!1,this.viewer.shadowMap.size=1024,this.viewer.shadowMap.numberOfCascades=3,this.viewer.shadowMap._lightCamera,this.viewer.shadowMap.normalOffset=!1,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=14,Pe(this.sdk,this.options.id);case 14:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"start",value:function(t){t.viewer.scene.globe.enableLighting=!0,t.viewer.shadows=!0,t.viewer.scene.globe.enableLighting=!0,t.viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,t.viewer.shadowMap.darkness=1-t.options.darkness;var e=new Date;e.setHours(0,0,0,0),t.viewer.clock.currentTime=Cesium.JulianDate.fromDate(e),t.viewer.clock.multiplier=t.options.speed,t.viewer.shadowMap.softShadows=t.options.softShadow,t.viewer.shadowMap.cascadesEnabled=!0,t.viewer.shadowMap.size=2048,t.viewer.shadowMap.numberOfCascades=4,t.viewer.shadowMap.maximumDistance=5e3;var i=t.viewer.shadowMap._lightCamera;i.frustum.near=.1,i.frustum.far=1e4,t.viewer.shadowMap.normalOffset=!0,t.edit(!0)}}]);var t,e,i}();function jC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function IC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?jC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):jC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function RC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var FC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(t,e,i){for(var n=[],o=[],s=[],a=0;a<e.length;a++){var r=e[a],l=e[a+1];if(l){var c=Cesium.Cartesian3.subtract(l,r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.cross(c,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(u,u);var p=Cesium.Cartesian3.multiplyByScalar(u,i/2,new Cesium.Cartesian3),h=Cesium.Cartesian3.add(r,p,new Cesium.Cartesian3);n.push(h.x,h.y,h.z);var d=Cesium.Cartesian3.subtract(r,p,new Cesium.Cartesian3);o.push(d.x,d.y,d.z);var m=Cesium.Cartesian3.clone(r);m.z+=100,s.push(m.x,m.y,m.z)}}var f=new Float64Array([].concat(n,o,s)),v=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})},indices:new Uint16Array([0,1,3,1,4,3,2,5,6,2,6,7,8,9,10,8,10,11]),primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(f)}),g=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:v}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1});return t.scene.primitives.add(g),g}k()(this,e),(i=RC(this,e,[t,n])).viewer=i.sdk.viewer,i.options.name=n.name||"道路",i.options.carRoadWidth=n.carRoadWidth||10,i.options.sideWidth=n.sideWidth||5,i.options.positions=n.positions||[],i.options.roadImage=n.roadImage||i.getSourceRootPath()+"/img/roadPhoto.png",i.options.sideImage=n.sideImage||i.getSourceRootPath()+"/img/sidePhoto.png",i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new wn,i._elms={},i.positionArea=[],i.positions=[],i.lineEntity="",i.crossArr=[],i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=Cesium.Cartesian3.fromDegreesArray([-75,39,-74.5,39.5,-74,40]);return s(i.sdk.viewer,a,1e3),i.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(-75,39,100)}),i}return sn()(e,t),_()(e,[{key:"createCorridor",value:function(t){var e=Cesium.Cartesian3.fromDegreesArray([116.391,39.907,116.404,39.914,116.417,39.921,116.43,39.928]),i=new Cesium.GeometryInstance({geometry:new Cesium.CorridorGeometry({positions:e,width:200,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST,cornerType:Cesium.CornerType.ROUNDED}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}}),n=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:t}}}),translucent:!1}),asynchronous:!1});return this.sdk.viewer.scene.primitives.add(n),this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(116.404,39.914,2e3),orientation:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-30),roll:0}}),n}},{key:"getSideRectangle",value:function(t,e){var i=[],n=[];t.forEach((function(t){i.push([t[0],t[1]]),n.push([t[2],t[3]])}));var o=this.getRectangle(i,e,"side");return{left:this.getRectangle(n,e,"side"),right:o}}},{key:"getRectangle",value:function(t,e,i){for(var n=[],o=[],s=this,a=function(){var i=t[r][0],a=t[r][1];n[r]=[];for(var l=[],c=new Cesium.CorridorGeometry({positions:[i,a],width:e,cornerType:Cesium.CornerType.MITERED,vertexFormat:Cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),u=Cesium.CorridorGeometry.createGeometry(c),p=0;p<u.attributes.position.values.length;p+=3){var h=s.cartesian3Towgs84(new Cesium.Cartesian3(u.attributes.position.values[p],u.attributes.position.values[p+1],u.attributes.position.values[p+2]),s.sdk.viewer);l.push([h.lng,h.lat])}for(var d=0;d<u.indices.length;d+=3)n[r].push(turf.polygon([[l[u.indices[d]],l[u.indices[d+1]],l[u.indices[d+2]],l[u.indices[d]]]]));var m,f=turf.union(n[r][0],n[r][1]),v=[];f.geometry.coordinates[0].pop(),f.geometry.coordinates[0].forEach((function(t){v.push(new Cesium.Cartesian3.fromDegrees(t[0],t[1]))}));var g=new Cesium.Cartesian3,y=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(s.pointArr[r][1],s.pointArr[r][0],g),g),b=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(v[1],v[0],new Cesium.Cartesian3),new Cesium.Cartesian3);if(.999<(m=Cesium.Cartesian3.dot(y,b))&&m<1.001||-.999>m&&m>-1.001)o.push(v);else{var C=[];C[0]=v[1],C[1]=v[2],C[2]=v[3],C[3]=v[0],o.push(C)}},r=0;r<t.length;r++)a();return o}},{key:"getExtendPoint",value:function(t,e,i){var n=Cesium.Cartesian3.subtract(e,t,new Cesium.Cartesian3),o=Cesium.Cartesian3.normalize(n,new Cesium.Cartesian3),s=new Cesium.Ray(t,o);return Cesium.Ray.getPoint(s,10*i)}},{key:"getArr",value:function(t,e){e=e.reverse();for(var i=[],n=0;n<t.length-1;n++)i.push([t[n],t[n+1],e[n+1],e[n]]);return i}},{key:"calculateRoadAngle2",value:function(t,e){var i=this.sdk.viewer.scene.globe.ellipsoid.geodeticSurfaceNormal(t,new Cesium.Cartesian3),n=Cesium.Transforms.eastNorthUpToFixedFrame(t,this.sdk.viewer.scene.globe.ellipsoid,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,e,new Cesium.Cartesian3),a=Math.abs(s.z)/1e3,r=Math.atan2(s.y,s.x)-.01*a,l=Cesium.Math.toDegrees(r);return console.log(l,"result"),l}},{key:"calculateRoadAngle",value:function(t,e){var i=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(t),n=Cesium.Transforms.eastNorthUpToFixedFrame(t,void 0,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,e,new Cesium.Cartesian3),a=new Cesium.Cartesian2(s.x,s.y);Cesium.Cartesian2.normalize(a,a);var r=new Cesium.Cartesian2(1,0),l=Cesium.Cartesian2.angleBetween(r,a);return Cesium.Cartesian2.cross(r,a,new Cesium.Cartesian2)<0?l:-l}},{key:"calculatePolygonOrientation",value:function(t){var e=t[0],i=Cesium.Transforms.eastNorthUpToFixedFrame(e).getColumn(1,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(i,i);var n=Cesium.Cartesian3.subtract(t[0],t[1],new Cesium.Cartesian3);Cesium.Cartesian3.normalize(n,n);var o=Cesium.Cartesian3.dot(i,n),s=Cesium.Cartesian3.magnitude(i),a=Cesium.Cartesian3.magnitude(n);return Math.acos(o/(s*a))}},{key:"calculateTextureRepeat",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;if(!e.width||!e.height)throw new Error("Texture size must contain width and height in pixels");for(var n=Cesium.PolygonGeometry.createGeometry(new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t),vertexFormat:Cesium.VertexFormat.POSITION_ONLY})),o=0,s=n.indices,a=n.attributes.position.values,r=0;r<s.length;r+=3){var l=3*s[r],c=3*s[r+1],u=3*s[r+2],p=new Cesium.Cartesian3(a[l],a[l+1],a[l+2]),h=new Cesium.Cartesian3(a[c],a[c+1],a[c+2]),d=new Cesium.Cartesian3(a[u],a[u+1],a[u+2]),m=Cesium.Cartesian3.cross(Cesium.Cartesian3.subtract(h,p,new Cesium.Cartesian3),Cesium.Cartesian3.subtract(d,p,new Cesium.Cartesian3),new Cesium.Cartesian3);o+=.5*Cesium.Cartesian3.magnitude(m)}var f=e.width*i,v=e.height*i,g=Math.sqrt(o)/f;Math.sqrt(o);return new Cesium.Cartesian2(Math.max(1,Math.ceil(g)),1)}},{key:"swapLastElements",value:function(t,e){var i=t[t.length-1],n=e[0];return t[t.length-1]=n,e[0]=i,[t,e]}},{key:"createLineBufferPolygonSide",value:function(t,e){for(var i=[],n=0;n<t.length;n++){var o=t[n],s=Cesium.Cartesian3.subtract(o[1],o[0],new Cesium.Cartesian3);Cesium.Cartesian3.normalize(s,s);var a=Cesium.Cartesian3.cross(s,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(a,a);var r=Cesium.Cartesian3.multiplyByScalar(a,e,new Cesium.Cartesian3),l=Cesium.Cartesian3.add(o[0],r,new Cesium.Cartesian3),c=Cesium.Cartesian3.add(o[1],r,new Cesium.Cartesian3);i.push([o[0],l,c,o[1]])}return i}},{key:"createLineBufferPolygon2",value:function(t,e){for(var i=[],n=[],o=[],s=0;s<t.length-1;s++){var a=t[s],r=t[s+1],l=Cesium.Cartesian3.subtract(r,a,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(l,l);var c=Cesium.Cartesian3.cross(l,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.subtract(a,r,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(u,u);var p=Cesium.Cartesian3.cross(u,Cesium.Cartesian3.UNIT_Z,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(p,p);var h=Cesium.Cartesian3.multiplyByScalar(c,e,new Cesium.Cartesian3),d=Cesium.Cartesian3.multiplyByScalar(c,-e,new Cesium.Cartesian3),m=Cesium.Cartesian3.multiplyByScalar(p,-e,new Cesium.Cartesian3),f=Cesium.Cartesian3.multiplyByScalar(p,e,new Cesium.Cartesian3),v=Cesium.Cartesian3.add(a,h,new Cesium.Cartesian3),g=Cesium.Cartesian3.add(a,d,new Cesium.Cartesian3),y=Cesium.Cartesian3.add(r,m,new Cesium.Cartesian3),b=Cesium.Cartesian3.add(r,f,new Cesium.Cartesian3);i.push([v,y,b,g]),o.push([v,y]),n.push([g,b])}console.log(i,o,"rightPositions");return[i,o,n]}},{key:"getIntersects",value:function(t,e,i,n){var o=this.getLonLat(t),s=this.getLonLat(e),a=this.getLonLat(i),r=this.getLonLat(n),l=turf.lineString([[o.lon,o.lat],[s.lon,s.lat]]),c=turf.lineString([[a.lon,a.lat],[r.lon,r.lat]]),u=turf.lineIntersect(l,c);if(u.features.length>0)return Cesium.Cartesian3.fromDegrees(u.features[0].geometry.coordinates[0],u.features[0].geometry.coordinates[1])}},{key:"getLonLat",value:function(t){var e=Cesium.Cartographic.fromCartesian(t);return{lon:Cesium.Math.toDegrees(e.longitude),lat:Cesium.Math.toDegrees(e.latitude)}}},{key:"createLineBufferPolygon",value:function(t,e,i){for(var n=[],o=0;o<e.length;o++){var s=e[o],a=e[o+1]||e[o-1],r=Cesium.Cartesian3.subtract(a,s,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(r,r);var l=Cesium.Cartesian3.UNIT_Z,c=Cesium.Cartesian3.cross(r,l,new Cesium.Cartesian3);Cesium.Cartesian3.normalize(c,c);var u=Cesium.Cartesian3.multiplyByScalar(c,i,new Cesium.Cartesian3);i>0?n.unshift(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3)):i<0&&n.push(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3))}return n}},{key:"calculateAangle",value:function(t){function e(t,e){var i=Math.PI/180,n=t.y*i,o=e.y*i,s=t.x*i,a=e.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=t[0],n=t[1],o=t[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:e(s,a),angle2:e(s,r)}}},{key:"carRoadWidth",get:function(){return this.options.carRoadWidth},set:function(t){this.options.carRoadWidth=t,e.create(this)}},{key:"sideWidth",get:function(){return this.options.sideWidth},set:function(t){this.options.sideWidth=t,e.create(this)}},{key:"edit",value:(s=o()(a.a.mark((function t(){var e,i,n,o=this,s=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!e){t.next=17;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"道路属性",left:"180px",top:"100px",confirmCallBack:function(t){o.name=o.name.trim(),o.name||(o.name="道路"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),Pe(o.sdk,o.options.id),se(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},closeCallBack:function(){o.reset(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(t){o.show=t,o.Dialog.showCallBack&&o.Dialog.showCallBack()}},!0);case 7:this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" road-surface",(i=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">名称</span>\n <input class="input" maxlength="40" type="text" @model="name">\n </div>\n <div class="col road-box">\n <span class="label" style="flex: 0 0 56px;">道路类型</span>\n <div class="road-type"></div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col">\n <span class="label">车道宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="carRoadWidth">\n <span class="arrow"></span>\n </div>\n </div>\n <div class="col">\n <span class="label">人行道宽度</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" max="99999" min="1" step="1" @model="sideWidth">\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,t.next=17;break;case 17:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.carRoadWidth=this.originalOptions.carRoadWidth,this.sideWidth=this.originalOptions.sideWidth,this.positions=this.originalOptions.positions,this.roadImage=this.originalOptions.roadImage,this.sideImage=this.originalOptions.sideImage)}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.length>0&&void 0!==h[0]&&h[0],pi(0),ii(this.sdk),ni(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=IC({},this.options.position):this.options.positions?r=IC({},this.options.positions[0]):this.options.center?r=IC({},this.options.center):this.options.start?r=IC({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e});else{for(l=[],c=0;c<this.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.positions[c][0],this.positions[c][1],this.options.height+this.options.heightDifference/2),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getSphere",value:function(){var t=this;return new Promise((function(e){var i=setInterval((function(){var e=new Cesium.BoundingSphere;t.sdk.viewer._dataSourceDisplay.getBoundingSphere(t.viewer.entities.getById(t.options.id),!1,e)===Cesium.BoundingSphereState.DONE&&clearInterval(i)}),1e3)}))}},{key:"remove",value:(i=o()(a.a.mark((function t(){var e=this;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.positions=[],this.lineEntity=null,this.viewer.entities.getById(this.options.id)&&(this.viewer.entities.getById(this.options.id)._children.forEach((function(t){e.viewer.entities.remove(t)})),this.viewer.entities.remove(this.viewer.entities.getById(this.options.id))),this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=6,this.sdk.removeIncetance(this.options.id);case 6:return t.next=8,Pe(this.sdk,this.options.id);case 8:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"create",value:function(t){var e=[];t.options.positions.forEach((function(t){e.push(new Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt))}));for(var i=[],n=0;n<e.length-1;n++){var o=e[n],s=e[n+1];i.push([o,s]),t.pointArr=i}var a=[[],[],[]];a[1][0]=t.getRectangle(i,t.options.carRoadWidth);var r=t.getSideRectangle(a[1][0],t.options.sideWidth);a[0]=r.left,a[2]=r.right;for(var l=0;l<a[0].length-1;l++){var c=a[0][l],u=a[0][l+1],p=a[2][l],h=a[2][l+1],d=a[1][0][l],m=a[1][0][l+1],f=t.getIntersects(c[2],c[3],u[2],u[3]),v=t.getIntersects(p[0],p[1],h[0],h[1]);if(!f&&!v)for(var g=0;g<4;g++){var y=[];0===g?y.push(c[2],c[3]):1===g?y.push(u[2],u[3]):2===g?y.push(p[0],p[1]):y.push(h[0],h[1]),t.sdk.viewer.entities.add({polyline:{positions:y,width:10,material:new Cesium.PolylineGlowMaterialProperty({color:0===g?Cesium.Color.RED:1===g?Cesium.Color.BLUE:2===g?Cesium.Color.YELLOW:Cesium.Color.GREEN,glowPower:.25})}})}if(console.log(f,v,"leftLine"),f){var b=t.getExtendPoint(p[0],p[1],1e3),C=t.getExtendPoint(h[1],h[0],1e3);console.log("aaaa");var w=t.getIntersects(p[0],b,h[1],C),k=t.getExtendPoint(c[0],c[1],1e3),x=t.getExtendPoint(d[3],d[2],1e3),_=t.getExtendPoint(d[0],d[1],1e3),E=t.getExtendPoint(p[3],p[2],1e3);console.log(f,w,c[0],k,"bbbb");var S=t.getIntersects(f,w,c[0],k);console.log(S,"leftLineNei");var D=t.getIntersects(f,w,d[3],x),P=t.getIntersects(f,w,d[0],_),M=t.getIntersects(f,w,p[3],E);console.log("ccc"),c[2]=f,c[1]=S,d[2]=D,d[1]=P,p[2]=M,p[1]=w,console.log(c,d,p,"leftItemleft");var O=t.getExtendPoint(u[1],u[0],1e3),T=t.getExtendPoint(m[2],m[3],1e3),N=t.getExtendPoint(m[1],m[0],1e3),B=t.getExtendPoint(h[2],h[3],1e3);t.getIntersects(f,w,u[1],O),t.getIntersects(f,w,m[2],T),t.getIntersects(f,w,m[1],N),t.getIntersects(f,w,h[2],B);u[3]=f,u[0]=S,m[3]=D,m[0]=P,h[3]=M,h[0]=w,console.log(u,m,h,"leftItem2left")}else if(v){var L=t.getExtendPoint(c[3],c[2],1e3),A=t.getExtendPoint(u[2],u[3],1e3),j=t.getIntersects(c[3],L,u[2],A);if(!j)return;var I=t.getExtendPoint(c[0],c[1],1e3),R=t.getExtendPoint(d[3],d[2],1e3),F=t.getExtendPoint(d[0],d[1],1e3),z=t.getExtendPoint(p[3],p[2],1e3),H=t.getIntersects(v,j,c[0],I),V=t.getIntersects(v,j,d[3],R),G=t.getIntersects(v,j,d[0],F),U=t.getIntersects(v,j,p[3],z);c[2]=j,c[1]=H,d[2]=V,d[1]=G,p[2]=U,p[1]=v,console.log(c,d,p,"leftItemright");var W=t.getExtendPoint(u[2],u[3],1e3),Y=t.getExtendPoint(m[2],m[3],1e3),J=t.getExtendPoint(m[1],m[0],1e3),q=t.getExtendPoint(h[2],h[3],1e3);t.getIntersects(v,j,u[1],W),t.getIntersects(v,j,m[2],Y),t.getIntersects(v,j,m[1],J),t.getIntersects(v,j,h[2],q);u[3]=j,u[0]=H,m[3]=V,m[0]=G,h[3]=U,h[0]=v,console.log(u,m,h,"leftItem2right")}}t.viewer.entities.getById(t.options.id)&&(t.viewer.entities.getById(t.options.id)._children.forEach((function(e){t.viewer.entities.remove(e)})),t.viewer.entities.remove(t.viewer.entities.getById(t.options.id))),t.lineEntity=t.viewer.entities.add(new Cesium.Entity({id:t.options.id,show:t.options.show}));var X=new Image;X.src=t.options.roadImage,X.onload=function(){console.log(a[1][0],t.options.roadImage,"llll"),a[1][0].forEach((function(i,n){t.viewer.entities.add({parent:t.lineEntity,polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:t.options.roadImage,transparent:!0,repeat:t.calculateTextureRepeat(i,X)}),stRotation:t.calculateRoadAngle(e[n],e[n+1])}})}))};var Z=new Image;Z.src=t.options.sideImage,Z.onload=function(){a[0].forEach((function(i,n){t.viewer.entities.add({parent:t.lineEntity,polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:t.options.sideImage,transparent:!0,repeat:t.calculateTextureRepeat(i,Z)}),stRotation:t.calculateRoadAngle(e[n],e[n+1])}})})),a[2].forEach((function(i,n){t.viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:t.options.sideImage,transparent:!0,repeat:t.calculateTextureRepeat(i,Z)}),stRotation:t.calculateRoadAngle(e[n],e[n+1])}})}))}}}]);var i,n,s}(Wn);function zC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function HC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?zC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):zC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function VC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var GC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k()(this,e),(i=VC(this,e,[t,n])).options.position=n.position||[],i.options.text=n.text||"",i.options.show=!n.show&&!1!==n.show||n.show,i.clickTextDom=void 0,i.handler=void 0,i.textDom=void 0,i.create(i),i.sdk.addIncetance(i.options.id,i),i.callback=o,i}return sn()(e,t),_()(e,[{key:"type",get:function(){return"TextBox"}},{key:"create",value:(p=o()(a.a.mark((function t(e){var i,n,o,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.sdk.viewer,(n=document.createElement("span")).id=e.options.id,n.className="popup-textarea",n.style.zIndex=1,(o=document.createElement("textarea")).className="textarea",o.value=e.options.text,o.rows=6,o.style.resize="none",n.appendChild(o),!e.options.show&&(n.style.display="none"),i.cesiumWidget.container.appendChild(n),s=Cesium.Cartesian3.fromDegrees(e.options.position.lng,e.options.position.lat,e.options.position.alt),e.handler=function(){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.scene,s);if(t){var e=1*n.clientWidth,o=1*n.clientHeight;n.style.left="".concat(t.x-e/2,"px"),n.style.top="".concat(t.y-o,"px")}},i.scene.postRender.addEventListener(e.handler),e.textDom=n;case 17:case"end":return t.stop()}}),t)}))),function(t){return p.apply(this,arguments)})},{key:"isClick",value:(u=o()(a.a.mark((function t(e,i){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.clickCallBack({position:e},i,null);case 2:case"end":return t.stop()}}),t,this)}))),function(t,e){return u.apply(this,arguments)})},{key:"setHandeler",value:(c=o()(a.a.mark((function t(e){var i,n,o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this,(n=this.sdk.viewer.scene.pickPosition(new Cesium.Cartesian2(e.x,e.y)))||(o=this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(e.x,e.y)),n=this.sdk.viewer.scene.globe.pick(o,this.sdk.viewer.scene)),!Cesium.defined(n)){t.next=15;break}return i.sdk.viewer.scene.postRender.removeEventListener(i.handler),s=Cesium.Cartographic.fromCartesian(n),r=Cesium.Math.toDegrees(s.longitude),l=Cesium.Math.toDegrees(s.latitude),t.next=10,i.getClampToHeight({lng:r,lat:l});case 10:t.sent,i.position={lng:r,lat:l,alt:s.height},c=Cesium.Cartesian3.fromDegrees(r,l,s.height),i.handler=function(){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,c);if(t){var e=1*i.textDom.clientWidth,n=1*i.textDom.clientHeight;i.textDom.style.left="".concat(t.x-e/2,"px"),i.textDom.style.top="".concat(t.y-n,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"getwords",value:(l=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.options.text=e,this.callback(this.options),i=ze(),n=i.sdkP,this.sdk===n&&n?Pe(this.sdk,this.options.id):n?(n.entityMap.get(this.options.id).text=e,n.entityMap.get(this.options.id).twoToThree(this.options.position)):n||Pe(this.sdk,this.options.id);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"twoToThree",value:(r=o()(a.a.mark((function t(e){var i,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(i=this).sdk.viewer.scene.postRender.removeEventListener(i.handler),n=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),i.handler=function(){var t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,n);if(t){var e=1*i.textDom.clientWidth,o=1*i.textDom.clientHeight;i.textDom.style.left="".concat(t.x-e/2,"px"),i.textDom.style.top="".concat(t.y-o,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"returnFun",value:(s=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.handler);case 1:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"text",get:function(){return this.options.text},set:function(t){this.options.text=t,this.textDom.querySelector("textarea").value=t,this.callback(this.options)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(t){t&&"function"!=typeof t?console.error("val:",t,"不是一个function"):this.clickCallBack=t}},{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t,this.textDom&&(this.textDom.style.display=t?"block":"none"),Pe(this.sdk,this.options.id)}},{key:"position",get:function(){return this.options.position},set:function(t){this.options.position=t}},{key:"flyTo",value:(n=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p.length>0&&void 0!==p[0]&&p[0],pi(0),ii(this.sdk),ni(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=HC({},this.options.position):this.options.position?r=HC({},this.options.position[0]):this.options.center?r=HC({},this.options.center):this.options.start?r=HC({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e})):(l=[],c=Cesium.Cartesian3.fromDegrees(this.position.lng,this.position.lat,this.position.alt),l.push(c.x,c.y,c.z),u=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(u,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}}));case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.handler&&(this.sdk.viewer.scene.postRender.removeEventListener(this.handler),this.handler=void 0),this.textDom&&this.textDom.parentNode&&this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom),t.next=4,this.sdk.removeIncetance(this.options.id);case 4:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r,l,c,u,p}(Wn);function UC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function WC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?UC(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):UC(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function YC(t,e,i){return e=nn()(e),tn()(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,i||[],nn()(t).constructor):e.apply(t,i))}var JC=function(t){function e(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};k()(this,e),(i=YC(this,e,[t,n])).viewer=i.sdk.viewer,i.options.name=n.name||"批量模型",i.options.type=n.type||"面",i.options.url=n.url||"",i.options.spacing=1*n.spacing||50,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.callback=o,i.Dialog=s,i._EventBinding=new wn,i._elms={},i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=new fi(t);if(i.options.spacing<0||1*n.spacing==0)return a.message({type:"warning",text:"请输入正确的间距!"}),tn()(i);if(n.type&&null!=n.spacing||"点"==n.type){var r;switch(n.type){case"点":r=new al(i.sdk);break;case"线":r=new tl(i.sdk);break;case"面":r=new ol(i.sdk)}r&&r.start((function(t,o){if(i.options.positions=o,"面"==n.type){var s=o.map((function(t){return Cesium.Cartesian3.fromDegrees(t.lng,t.lat)})),r=Cesium.Cartesian3.distance(s[0],s[1]),l=Cesium.Cartesian3.distance(s[1],s[2]);if(r/i.options.spacing*(l/i.options.spacing)>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}else if("线"==n.type){for(var c=o.map((function(t){return Cesium.Cartesian3.fromDegrees(t.lng,t.lat)})),u=0,p=0;p<c.length-2;p++)u+=Cesium.Cartesian3.distance(c[p],c[p+1]);if(u/i.options.spacing>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}(i.options.positions.length||i.options.positions.lng)&&e.computeDis(i)}))}else i.edit(!0);return i}return sn()(e,t),_()(e,[{key:"linePoint",value:(u=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m,f,v,g;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],o=[],s=0;case 3:if(!(s<e.length-1)){t.next=27;break}r=e[s],l=e[(s+1)%e.length],c=Cesium.Cartesian3.distance(r,l),u=Math.ceil(c/i),p=0;case 9:if(!(p<=u)){t.next=24;break}return h=p/u,d=Cesium.Cartesian3.lerp(r,l,h,new Cesium.Cartesian3),m=Cesium.Cartographic.fromCartesian(d),f=Cesium.Math.toDegrees(m.longitude),v=Cesium.Math.toDegrees(m.latitude),t.next=17,this.getClampToHeight({lng:f,lat:v});case 17:g=t.sent,d=Cesium.Cartesian3.fromDegrees(f,v,g),n.push(d),p==u&&s!=e.length-2||o.push(this.calculateRoadAngle(r,l));case 21:p++,t.next=9;break;case 24:s++,t.next=3;break;case 27:return t.abrupt("return",[L()(new Set(n.map((function(t){return"".concat(t.x,",").concat(t.y,",").concat(t.z)})))).map((function(t){var e=t.split(",").map(Number),i=y()(e,3),n=i[0],o=i[1],s=i[2];return new Cesium.Cartesian3(n,o,s)})),o]);case 28:case"end":return t.stop()}}),t,this)}))),function(t,e){return u.apply(this,arguments)})},{key:"calculateRoadAngle",value:function(t,e){var i=Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(t),n=Cesium.Transforms.eastNorthUpToFixedFrame(t,void 0,i),o=Cesium.Matrix4.inverse(n,new Cesium.Matrix4),s=Cesium.Matrix4.multiplyByPoint(o,e,new Cesium.Cartesian3),a=new Cesium.Cartesian2(s.x,s.y);Cesium.Cartesian2.normalize(a,a);var r=new Cesium.Cartesian2(1,0),l=Cesium.Cartesian2.angleBetween(r,a);return l=Cesium.Math.toDegrees(l),Cesium.Cartesian2.cross(r,a,new Cesium.Cartesian2)<0?-l:l}},{key:"generateInterpolatedPoints",value:function(t,e){for(var i=[],n=0;n<t.length;n++)for(var o=t[n],s=t[(n+1)%t.length],a=Cesium.Cartesian3.distance(o,s),r=Math.ceil(a/e),l=0;l<=r;l++){var c=l/r,u=Cesium.Cartesian3.lerp(o,s,c,new Cesium.Cartesian3);i.push(u)}var p=this.computePolygonExtent(t),h=this.createGridFromBBox(p,this.options.spacing),d=[],m=[];this.options.positions.forEach((function(t){m.push([t.lng,t.lat])})),m.push(m[0]);for(var f=p.west;f<=p.east;f+=h.lonStep)for(var v=p.south;v<=p.north;v+=h.latStep){var g=Cesium.Cartesian3.fromDegrees(f,v),b=turf.point([f,v]),C=turf.polygon([m]);turf.booleanPointInPolygon(b,C)&&d.push(g)}return L()(new Set([].concat(d).map((function(t){return"".concat(t.x,",").concat(t.y,",").concat(t.z)})))).map((function(t){var e=t.split(",").map(Number),i=y()(e,3),n=i[0],o=i[1],s=i[2];return new Cesium.Cartesian3(n,o,s)}))}},{key:"createGridFromBBox",value:function(t,e){var i=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(t.west,(t.south+t.north)/2,0),Cesium.Cartesian3.fromDegrees(t.east,(t.south+t.north)/2,0)),n=Math.ceil(i/e),o=Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees((t.west+t.east)/2,t.south,0),Cesium.Cartesian3.fromDegrees((t.west+t.east)/2,t.north,0)),s=Math.ceil(o/e);return{lonStep:(t.east-t.west)/n,latStep:(t.north-t.south)/s}}},{key:"computePolygonExtent",value:function(t){var e=t.map((function(t){return Cesium.Cartographic.fromCartesian(t)})),i=e.map((function(t){return Cesium.Math.toDegrees(t.longitude)})),n=e.map((function(t){return Cesium.Math.toDegrees(t.latitude)}));return{west:Math.min.apply(Math,L()(i)),east:Math.max.apply(Math,L()(i)),south:Math.min.apply(Math,L()(n)),north:Math.max.apply(Math,L()(n))}}},{key:"computedArea",value:(c=o()(a.a.mark((function t(e,i){var n,o,s,r,l,c,u,p,h,d,m;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Cesium.Cartesian3.distance(e[0],e[1]),o=Cesium.Cartesian3.distance(e[1],e[2]),Cesium.Cartesian3.subtract(e[1],e[0],new Cesium.Cartesian3),Cesium.Cartesian3.subtract(e[2],e[1],new Cesium.Cartesian3),s=Math.ceil(n/i),r=Math.ceil(o/i),l=[],c=0;case 8:if(!(c<s)){t.next=17;break}return t.t0=l,t.next=12,this.calculatePointB(e[0],e[1],c*i);case 12:t.t1=t.sent,t.t0.push.call(t.t0,t.t1);case 14:c++,t.next=8;break;case 17:u=[],p=0;case 19:if(!(p<s)){t.next=28;break}return t.t2=u,t.next=23,this.calculatePointB(e[3],e[2],p*i);case 23:t.t3=t.sent,t.t2.push.call(t.t2,t.t3);case 25:p++,t.next=19;break;case 28:h=[],d=0;case 30:if(!(d<l.length)){t.next=44;break}m=0;case 32:if(!(m<r)){t.next=41;break}return t.t4=h,t.next=36,this.calculatePointB(l[d],u[d],m*i);case 36:t.t5=t.sent,t.t4.push.call(t.t4,t.t5);case 38:m++,t.next=32;break;case 41:d++,t.next=30;break;case 44:return t.abrupt("return",h);case 45:case"end":return t.stop()}}),t,this)}))),function(t,e){return c.apply(this,arguments)})},{key:"calculatePointB",value:(l=o()(a.a.mark((function t(e,i,n){var o,s,r,l,c,u,p,h,d;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Cesium.Cartesian3.subtract(i,e,new Cesium.Cartesian3),Cesium.Cartesian3.magnitude(o),s=Cesium.Cartesian3.normalize(o,new Cesium.Cartesian3),r=Cesium.Cartesian3.multiplyByScalar(s,n,new Cesium.Cartesian3),l=Cesium.Cartesian3.add(e,r,new Cesium.Cartesian3),c=Cesium.Cartographic.fromCartesian(l),u=Cesium.Math.toDegrees(c.longitude),p=Cesium.Math.toDegrees(c.latitude),t.next=10,this.getClampToHeight({lng:u,lat:p});case 10:return h=t.sent,d=Cesium.Cartesian3.fromDegrees(u,p,h),t.abrupt("return",d);case 13:case"end":return t.stop()}}),t,this)}))),function(t,e,i){return l.apply(this,arguments)})},{key:"show",get:function(){return this.options.show},set:function(t){this.options.show=t;for(var e=0;e<this.pointArr.length;e++)this.pointArr[e].show=t}},{key:"type",get:function(){return this.options.type},set:function(t){this.options.type=t,this._elms.type&&this._elms.type.forEach((function(e){e.value=t}))}},{key:"spacing",get:function(){return this.options.spacing},set:function(t){this.options.spacing=t,this._elms.spacing&&this._elms.spacing.forEach((function(e){e.value=t}))}},{key:"edit",value:(r=o()(a.a.mark((function t(){var i,n,o,s,r,l,c,u=this,p=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=p.length>0&&void 0!==p[0]&&p[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){t.next=33;break}return t.next=7,new rn(this.sdk,this.originalOptions,{title:"默认模型参数设置",left:"180px",top:"100px",confirmCallBack:function(t){var i;switch(u.name=u.name.trim(),u.name||(u.name="飞线"),u.options.type){case"点":i=new al(u.sdk);break;case"线":i=new tl(u.sdk);break;case"面":i=new ol(u.sdk)}i&&i.start((function(t,i){u.options.positions=i,(u.options.positions.length||u.options.positions.lng)&&e.computeDis(u)})),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions),Pe(u.sdk,u.options.id),se(u.sdk,u.options.id)},closeCallBack:function(){u.reset(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"重置",event:["click",function(){u.reset()}]}]},!0);case 7:if(this._DialogObject=t.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(n=document.createElement("div")).innerHTML='\n <span class="custom-divider"></span>\n <div class="div-item">\n <div class="row">\n <div class="col add-type-box">\n <span class="label" style="flex: 0 0 56px;">添加方式</span>\n <div class="add-type"></div>\n </div>\n <div class="col">\n <span class="label">间距</span>\n <div class="input-number input-number-unit-1">\n <input class="input" type="number" title="" min="1" max="99999" @model="spacing">\n <span class="unit">米</span>\n <span class="arrow"></span>\n </div>\n </div>\n </div>\n </div>\n <span class="custom-divider"></span>\n ',this._DialogObject.contentAppChild(n),o=n.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,s=[{name:"点",value:"点"},{name:"线",value:"线"},{name:"面",value:"面"}],!(r=Y(this._DialogObject._element.content.getElementsByClassName("add-type-box")[0],".add-type"))){t.next=31;break}r.legp_search(s),l=this._DialogObject._element.content.getElementsByClassName("add-type")[0].getElementsByTagName("input")[0],this._elms.type=[l],l.value=this.options.type,c=0;case 23:if(!(c<s.length)){t.next=30;break}if(s[c].value!==l.value){t.next=27;break}return r.legp_searchActive(s[c].value),t.abrupt("break",30);case 27:c++,t.next=23;break;case 30:l.addEventListener("input",(function(){for(var t=0;t<s.length;t++)if(s[t].value===l.value){u.type=s[t].value;break}}));case 31:t.next=33;break;case 33:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"drawArea",value:function(){}},{key:"reset",value:function(){this.name=this.originalOptions.name,this.type=this.originalOptions.type,this.spacing=this.originalOptions.spacing,this.show=this.originalOptions.show,this.options.spacing=this.originalOptions.spacing}},{key:"flyTo",value:(s=o()(a.a.mark((function t(){var e,i,n,o,s,r,l,c,u,p,h=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.length>0&&void 0!==h[0]&&h[0],pi(0),ii(this.sdk),ni(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)e={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=WC({},this.options.position):this.options.positions?r=WC({},this.options.positions[0]):this.options.center?r=WC({},this.options.center):this.options.start?r=WC({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:e});else if(l=[],this.options.positions.length>0){for(c=0;c<this.options.positions.length;c++)u=Cesium.Cartesian3.fromDegrees(this.options.positions[c].lng,this.options.positions[c].lat,this.options.positions[c].alt),l.push(u.x,u.y,u.z);p=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(p,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}})}else this.options.positions.lng&&(Cesium.Math.toRadians(0),Cesium.Math.toRadians(-60),Cesium.Math.toRadians(0),this.sdk.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(this.options.positions.lng,this.options.positions.lat,this.options.positions.alt+100)}));case 5:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"remove",value:(n=o()(a.a.mark((function t(){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=0;e<this.pointArr.length;e++)this.pointArr[e].remove();return this.pointArr=[],this.positions=[],this.entity=null,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),t.next=7,this.sdk.removeIncetance(this.options.id);case 7:return t.next=9,Pe(this.sdk,this.options.id);case 9:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"computeDis",value:(i=o()(a.a.mark((function t(e){var i,n,o,s,r,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=[],o=[],s=[],"面"!=e.options.type){t.next=13;break}return e.options.positions.forEach((function(t){i.push(t.lng,t.lat)})),t.next=7,e.computedArea(Cesium.Cartesian3.fromDegreesArray(i),e.options.spacing);case 7:n=t.sent,s[0]=n,s[1]=e.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(i)[0],Cesium.Cartesian3.fromDegreesArray(i)[3]),n.forEach((function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude),a=i.height;o.push({lng:n,lat:s,alt:a})})),t.next=29;break;case 13:if("线"!=e.options.type){t.next=23;break}return e.options.positions.forEach((function(t){i.push(t.lng,t.lat)})),t.next=17,e.linePoint(Cesium.Cartesian3.fromDegreesArray(i),e.options.spacing);case 17:s=t.sent,n=s[0],e.pointArr=n,n.forEach((function(t,e){var i=Cesium.Cartographic.fromCartesian(t),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude),a=i.height;o.push({lng:n,lat:s,alt:a})})),t.next=29;break;case 23:if("点"!=e.options.type){t.next=29;break}return t.next=26,e.getClampToHeight({lng:e.options.positions.lng,lat:e.options.positions.lat});case 26:r=t.sent,o=[{lng:e.options.positions.lng,lat:e.options.positions.lat,alt:r}],e.pointArr=o;case 29:l={type:e.options.type,positions:o,rotate:"点"==e.options.type?void 0:s[1]},e.callback(l);case 31:case"end":return t.stop()}}),t)}))),function(t){return i.apply(this,arguments)})}]);var i,n,s,r,l,c,u}(Wn),qC=Symbol("测量状态");Symbol("录屏对象");window.YJ||(window.YJ={on:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isc:!1,excel:!1,flv:!1,rtsp:!1,hls:!1,host:"",username:"",password:""};return new Promise((function(e,i){var n=f(),o=["/custom/css/index.css","/arrow/algorithm.js","/arrow/plotUtil.js","/3rdparty/turf.min.js","/3rdparty/fabric.min.js","/3rdparty/proj4.js","/3rdparty/pako.min.js","/3rdparty/heatmap.js","/3rdparty/tween.umd.js","/Cesium/Cesium.js","/Cesium/Widgets/widgets.css","/3rdparty/ewPlugins.min.js","/3rdparty/wangeditor/index.js","/3rdparty/wangeditor/style.css","/3rdparty/html2canvas.min.js","/3rdparty/kriging.js","/3rdparty/echarts.min.js","/3rdparty/clipboard.min.js","/3rdparty/libgif.js","/3rdparty/liveplayer/liveplayer-element.min.js","/3rdparty/jedate/jedate.min.js","/3rdparty/jedate/skin/jedate.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",t.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(t.flv||t.rtsp)&&o.push("/3rdparty/flv.min.js");var s=document.createElement("script");s.setAttribute("type","module"),s.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(s);var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(a);var r=[];o.forEach((function(t){var e;t.endsWith(".js")?((e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src",n+t)):((e=document.createElement("link")).setAttribute("rel","stylesheet"),e.setAttribute("href",n+t)),document.querySelector("html").appendChild(e);var i=new Promise((function(t,i){e.onload=function(){t()}})).then((function(t){return t}));r.push(i)})),Promise.all(r).then((function(i){var o,s;(o=document.createElement("script")).setAttribute("type","text/javascript"),o.setAttribute("src",n+"/3rdparty/viewerCesiumNavigationMixin.min.js"),document.querySelector("html").appendChild(o),o.onload=function(){p(t.host),t.username?c(t).then((function(t){e()})):e()},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(t){i(t)}))}))},Obj:{ArcgisWXImagery:Rl,ArcgisBLUEImagery:Fl,ArcgisLWImagery:zl,GDLWImagery:Gl,GDWXImagery:Ul,GDSLImagery:Wl,Tileset:dc,BIM:_c,Layer:tu,Layer3rdparty:iu,Terrain:du,Flame:ku,Smoke:Tu,Fountain:zu,Spout:Ju,WaterSurface:Jh,CircleDiffuse:po,CircleObject:Fp,EllipseObject:Yp,RadarScan:bo,RadarScanStereoscopic:Nh,SectorObject:Fh,WallStereoscopic:eh,WallRealStereoscopic:uh,KML:Hh,GeoJson:Gh,BillboardObject:No,PolygonObject:Fo,PolyhedronObject:np,AssembleObject:up,AttackArrowObject:gp,PincerArrowObject:Ep,StraightArrowObject:Np,PolylineObject:ns,CurvelineObject:wh,Explosion:Eh,Model:Vc,Model2:Zc,TrajectoryMotion:cd,TrajectoryMotionObject:bd,Graffiti:wd,GroundImage:Md,GroundSvg:sb,RoutePlanning:ub,Shp:kb,Vector:Hb,GroundText:Wb,StandText:Jb,RichText:On,LocateCurrent:va,LoadObjModel:Kb,Heatmap:aC,FlyRoam:dC,newAirLine:CC,FRUSTUN:fC,Dialog:rn,FlowLine:SC,Road2:FC,TextBox:GC,BatchModel:JC},YJEarth:qi,Tools:fi,Proj:R,Global:{getCurrentView:function(t){var e=new fi,i=t.viewer;return JSON.parse(JSON.stringify({position:e.cartesian3Towgs84(i.camera.position,i),orientation:{heading:Cesium.Math.toDegrees(i.camera.heading),pitch:Cesium.Math.toDegrees(i.camera.pitch),roll:Cesium.Math.toDegrees(i.camera.roll)}}))},setDefaultView:function(t,e){var i=t.viewer;e?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:e.destination||{},orientation:e.orientation||{}}:(i.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2))},switchCluster:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.viewer,n=0;n<i.dataSources._dataSources.length;n++)if("sdk-dataSource1"===i.dataSources._dataSources[n].name){i.dataSources._dataSources[n].clustering.enabled=e;break}},openLeftClick:pt,closeLeftClick:ht,closeRightClick:function(){ot&&(ot.destroy(),ot=null)},openRightClick:function(t){t&&t.viewer&&(ot=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){if(!YJ.Measure.GetMeasureStatus()){var i,n=t.viewer.scene.pick(e.position);if(n&&n.id)if(n.id.type&&"vector"===n.id.type&&n.id.parentId){var o=rt.get(n.id.parentId);if(o.that.picking&&o.that.geojson)for(var s=0;s<o.that.geojson.features.length;s++)o.that.geojson.features[s].id===n.id._id&&o.callback(e,o.that.geojson.features[s].id,ct(ut(t,e),t.viewer),o.that)}else if(i="string"==typeof n.id?n.id:n.id.id,rt.has(i)){var a=rt.get(i);if(a.that.picking){var r=ut(t,e);if(!r)return;a.callback(e,i,ct(r,t.viewer),a.that)}}if(n&&n.content&&rt.has(n.content.tileset.id)){var l=rt.get(n.content.tileset.id);if(l.that.picking)if("bim"===l.that.type){if(YJ.Global.getBimPickStatus(t)){var c=ut(t,e);if(!c)return;l.callback(e,n.getProperty("id"),ct(c,t.viewer),l.that)}}else{var u=ut(t,e);if(!u)return;l.callback(e,n.content.tileset.id,ct(u,t.viewer),l.that)}}}}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)},openMove:function(t){(st=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas)).setInputAction((function(e){t.viewer.scene.pick(e.endPosition)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},closeMove:function(){st&&(st.destroy(),st=null)},ScreenRecord:{start:function(){return function(){if(YJ.Global.ScreenRecord.screenRecord)return"录屏任务进行中";YJ.Global.ScreenRecord.screenRecord=new $i}()},stop:function(){YJ.Global.ScreenRecord&&YJ.Global.ScreenRecord.screenRecord&&YJ.Global.ScreenRecord.screenRecord&&(YJ.Global.ScreenRecord.screenRecord.mediaRecorder.stop(),YJ.Global.ScreenRecord.screenRecord=null)},screenRecord:null},MapX:{open:function(t){if(Ts.viewer){Ts.viewer.container.style.display="block";for(var e=Ts.viewer.entities.values,i=0;i<e.length;i++)if("mapX rectangle"===e[i].name){e[i];break}t.viewer.scene.preRender.addEventListener(js,As)}else!function(t){ls=new fi;var e=document.createElement("div");e.id="mapxDiv",e.style.width="222px",e.style.height="112px",e.style.position="absolute",e.style.right="10px",e.style.bottom="82px",e.style.zIndex="1",document.getElementById(t.div_id).appendChild(e);var i={imageryProvider:new Cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII")}),sceneMode:Cesium.SceneMode.SCENE2D,baseLayerPicker:!1,geocoder:!1,animation:!1,fullscreenButton:!1,navigationHelpButton:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,shouldAnimate:!0};Ts.viewer=new Cesium.Viewer("mapxDiv",i),Ts.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(0,0,4e7)}),Ts.viewer.trackedEntity=void 0,Ts.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),Ts.viewer.scene.screenSpaceCameraController.enableRotate=!1,Ts.viewer.scene.screenSpaceCameraController.enableTranslate=!1,Ts.viewer.scene.screenSpaceCameraController.enableZoom=!1,Ts.viewer.scene.screenSpaceCameraController.enableTilt=!1,Ts.viewer.scene.screenSpaceCameraController.enableLook=!1;var n,o=Ts.viewer.entities.add({name:"mapX rectangle",position:new Cesium.CallbackProperty((function(){return Bs||Cesium.Cartesian3.fromDegrees(0,0,0)}),!1),rectangle:{coordinates:new Cesium.CallbackProperty((function(){return Ns||Cesium.Rectangle.fromDegrees(0,0,.01,.01)}),!1),material:Cesium.Color.RED.withAlpha(.01),outline:!0,outlineColor:Cesium.Color.RED,outlineWidth:2,height:1},billboard:{image:ls.getSourceRootPath()+"/img/cross.svg",scale:1,width:16,height:16}});As={sdk:t,entity:o},Ts.viewer.camera.percentageChanged=.001,t.viewer.scene.preRender.addEventListener(js,As),(cs=new X({viewer:Ts.viewer})).mouse_left_down((function(t,e){Ls=!0,n=Ts.viewer.scene.pick(t.position)})),cs.mouse_left_up((function(t,e){Ls=!1})),cs.mouse_move((function(e,i){if(n&&Ls){var o=ls.cartesian3Towgs84(t.viewer.camera.position,t.viewer).alt,s=ls.cartesian3Towgs84(i,Ts.viewer);t.viewer.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(s.lng,s.lat,o),duration:0})}}))}(t)},close:function(t){if(Ts.viewer){Ts.viewer.container.style.display="none";for(var e=Ts.viewer.entities.values,i=0;i<e.length;i++)if("mapX rectangle"===e[i].name){e[i];break}t.viewer.scene.preRender.removeEventListener(js,As)}}},ScreenShot:function(t){return mn.apply(this,arguments)},ScreenShotHD:function(t){return fn.apply(this,arguments)},ExportKml:ss,FlyRoam:{open:ds,close:function(){us&&us.close&&(us.close(),us=null)},flyTo:fs,setRepeat:function(t){if(ps!=Number(t)&&(ps=Number(t),hs=ps,us&&us._element&&us._element.content)){var e=us._element.content.querySelector("input[name='repeat']");e.checked=t===1/0}},cease:vs},flyTo:Xe,efflect:{rain:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];gs&&t.viewer.scene.postProcessStages.remove(gs),e&&(gs=new Cesium.PostProcessStage({name:"rain",fragmentShader:ws,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),t.viewer.scene.postProcessStages.add(gs))},snow:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ys&&t.viewer.scene.postProcessStages.remove(ys),e&&(ys=new Cesium.PostProcessStage({name:"snow",fragmentShader:ks,uniforms:{snowSize:2,snowSpeed:60}}),t.viewer.scene.postProcessStages.add(ys))},fog:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];bs&&t.viewer.scene.postProcessStages.remove(bs),e&&(bs=new Cesium.PostProcessStage({name:"fog",fragmentShader:xs,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),t.viewer.scene.postProcessStages.add(bs))},nightVision:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Cs&&t.viewer.scene.postProcessStages.remove(Cs),e&&(Cs=Cesium.PostProcessStageLibrary.createNightVisionStage(),t.viewer.scene.postProcessStages.add(Cs))},skyStarry:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.scene.skyAtmosphere.show=!e},illumination:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.viewer.shadows=e,t.viewer._shadows=e},Sunshine:AC},CameraController:Ke,CesiumContainer:$e,setBillboardDefaultUrl:Qe,getBillboardDefaultUrl:ti,multiViewportMode:{on:function(t){return _e.apply(this,arguments)},off:Ee,get2DView:Ie,getSdk:ze},MouseCoordinate:function(t,e){if(t&&t.viewer){Ms=t,(Os=ze().sdkD)||(Os=ae().sdkD);var i=new fi(t);if(e){var n=function(){Ds=requestAnimationFrame(n),a()};_s&&_s.destroy(),Es&&(Es.destroy(),Es=void 0),_s=new X(t),Ps=null;var o,s={x:"",y:"",z:""};Ss?o=Ss:((o=document.createElement("div")).style.position="absolute",o.style["z-index"]=777,o.style.color="#ff0000",o.style.left="0px",o.style.top="0px",o.style.width="100%",o.style.height="100%",o.style["font-size"]="12px",o.style["pointer-events"]="none",o.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),o.style["background-size"]="200% 200%",Ss=o),t.viewer.container.appendChild(o),_s.mouse_move((function(e,i){Ms=t,Ps=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Is(Object(i),!0).forEach((function(e){C()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Is(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e.endPosition)}));var a=function(){if(Ms){var e=t.viewer._element.getElementsByTagName("canvas")[0];if((Os=ze().sdkD)||(Os=ae().sdkD),!Es&&Os&&(Es=new X(Os)).mouse_move((function(t,e){Ms=Os,Ps={x:t.endPosition.x,y:t.endPosition.y}})),Ps){var n,a=Ps.x,r=Ps.y;if(2===Ms.viewer.scene.mode)a+=e.width,n=Ms.viewer.camera.pickEllipsoid(Ps,Ms.viewer.scene.globe.ellipsoid);else if(!(n=Ms.viewer.scene.pickPosition(Ps))){for(var l=Ms.viewer.camera.getPickRay(s),c=Ms.viewer.scene.drillPickFromRay(l,10),u={},p=0;p<c.length;p++)if(c[p].position){u=c[p];break}(n=u.position)||(n=Ms.viewer.scene.globe.pick(l,Ms.viewer.scene))}if(o.style["background-position-x"]="".concat(-t.viewer.container.clientWidth+a+4,"px"),o.style["background-position-y"]="".concat(-t.viewer.container.clientHeight+r-2,"px"),n){var h=i.cartesian3Towgs84(n,t.viewer),d=li();if("EPSG:4326"===d)s={x:h.lng,y:h.lat,z:h.alt},o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:").concat(h.lng.toFixed(6),"°</p><p style='margin: 0;'>维度:").concat(h.lat.toFixed(6),"°</p><p style='margin: 0;'>海拔:").concat(h.alt.toFixed(2)," m</p></div>");else{var m=i.convert([{x:h.lng,y:h.lat,z:h.alt}],"EPSG:4326",d);s=m.points[0],o.innerHTML="<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:").concat(s.x.toFixed(6),"</p><p style='margin: 0;'>y:").concat(s.y.toFixed(6),"</p><p style='margin: 0;'>z:").concat(s.z.toFixed(6),"</p></div>")}}else{var f=li();o.innerHTML="EPSG:4326"===f?"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>"):"<div style='width: 150px;position: absolute; z-index: 777; color: #ff0000; font-size: 12px; left:".concat(a+20,"px; top:").concat(r+10,"px;'><p style='margin: 0;'>x:-</p><p style='margin: 0;'>y:-</p><p style='margin: 0;'>z:-</p></div>")}}}};n()}else _s&&_s.destroy(),Es&&(Es.destroy(),Es=void 0),Ss&&(t.viewer.container.removeChild(Ss),Ss=void 0),Ds&&cancelAnimationFrame(Ds)}},MouseRightMenu:et,setGroundCover:function(t,e){We=!!e,function(t){if(!t)return;for(var e=0;e<t.dataSources._dataSources.length;e++)if("sdk-dataSource1"===t.dataSources._dataSources[e].name){t.dataSources._dataSources[e].clustering._cluster();break}}(t.viewer)},getGroundCover:ei,setBimPickStatus:function(t,e){t&&t.viewer&&(Ye[t.viewer._element.className]||(Ye[t.viewer._element.className]={}),Ye[t.viewer._element.className].status=e,Ye[t.viewer._element.className].MoveHandler&&Ye[t.viewer._element.className].MoveHandler.destroy(),e&&(Ye[t.viewer._element.className].MoveHandler=new Cesium.ScreenSpaceEventHandler(t.viewer.canvas),Ye[t.viewer._element.className].MoveHandler.setInputAction((function(e){var i=t.viewer.scene.pick(e.endPosition),n=Ye[t.viewer._element.className].selectedId,o=t.entityMap.get(Ye[t.viewer._element.className].id);if(o&&o.features.has(n)){var s=o.features.get(n).features;for(var a in s)if(s[a].content._model){var r=s[a].customColor||Cesium.Color.fromCssColorString("#fff");s[a].color=Cesium.Color.fromCssColorString("rgba(".concat(Cesium.Color.floatToByte(r.red),",").concat(Cesium.Color.floatToByte(r.green),",").concat(Cesium.Color.floatToByte(r.blue),",").concat(r.alpha*(s[a].customAlpha||0===s[a].customAlpha?s[a].customAlpha:1),")"))}}if(i&&i.content)if("bim"===t.getIncetance(i.content.tileset.id).type){if(i.primitive&&i.primitive.id){var l=t.entityMap.get(i.primitive.id);if(n=i.getProperty("id"),l.features.has(n)){var c=l.features.get(n).features;for(var u in c)c[u].content._model&&(c[u].color=Cesium.Color.fromCssColorString("#ffeb3b"))}Ye[t.viewer._element.className].id=i.primitive.id,Ye[t.viewer._element.className].selectedId=n}}else i.primitive.id=null}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},getBimPickStatus:function(t){if(t&&t.viewer)return!!Ye[t.viewer._element.className]&&Ye[t.viewer._element.className].status},FlwStatusSwitch:oi,JwwStatusSwitch:ai,rotateAround:function(t,e){if(t&&t.viewer)if(pi(0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY),t.entityMap.forEach((function(t){t.editObj&&t.editObj.destroy(),t.ControllerObject&&t.ControllerObject.destroy()})),qe[t.viewer._element.className]||(qe[t.viewer._element.className]={}),qe[t.viewer._element.className].animate&&TWEEN.remove(qe[t.viewer._element.className].animate),qe[t.viewer._element.className].event&&qe[t.viewer._element.className].event.destroy(),e){var i=Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),n=Cesium.Math.toDegrees(t.viewer.camera.heading),s=Cesium.Cartesian3.distance(t.viewer.camera.position,i);Ke(t,!1);var r=t.viewer.camera.pitch;Cesium.Math.toDegrees(r)<-89.99&&(r=Cesium.Math.toRadians(-89.99)),qe[t.viewer._element.className].animate=new TWEEN.Tween({angle:n}).to({angle:n-360},3e4).easing(TWEEN.Easing.Linear.None).repeat(1/0).onUpdate(function(){var e=o()(a.a.mark((function e(n,o){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.viewer){e.next=3;break}return TWEEN.remove(qe[t.viewer._element.className].animate),e.abrupt("return");case 3:t.viewer.camera.lookAt(i,new Cesium.HeadingPitchRange(Cesium.Math.toRadians(n.angle),r,s)),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);case 5:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()).start();var l=new X(t);qe[t.viewer._element.className].event=l,l.mouse_left_down((function(){qe[t.viewer._element.className].animate&&TWEEN.remove(qe[t.viewer._element.className].animate),qe[t.viewer._element.className].event&&qe[t.viewer._element.className].event.destroy(),Ke(t,!0),t.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}))}else Ke(t,!0)},getCoordinateSystem:li,setCoordinateSystem:function(t,e){if(Ue=e||"EPSG:4326",t&&t.viewer&&t.viewer._element){var i=t.viewer._element.getElementsByClassName("cesium-info")[0];if(Ge&&i){var n=new fi,o=t.proj,s=n.cartesian3Towgs84(Ge,t.viewer);if("EPSG:4326"===Ue)i.innerHTML="\n <span>经度:</span><span>".concat(Number(s.lng.toFixed(6)),"° </span>\n <span>纬度:</span><span>").concat(Number(s.lat.toFixed(6)),"° </span>\n <span>海拔高度:</span><span>").concat(Number(s.alt.toFixed(2)),"米</span>\n ");else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",Ue);i.innerHTML="\n <span>x:</span><span>".concat(Number(a.points[0].x.toFixed(6)),'</span>\n <span style="margin-left: 5px;">y:</span><span>').concat(Number(a.points[0].y.toFixed(6)),'</span>\n <span style="margin-left: 5px;">z:</span><span>').concat(Number(a.points[0].z.toFixed(6)),"</span>\n ")}}}},DTH:Ki,cameraChanged:function(t,e){var i=new fi;return t.viewer.camera.changed.addEventListener((function(n){e({position:i.cartesian3Towgs84(t.viewer.camera.position,t.viewer),orientation:{heading:t.viewer.camera.heading,pitch:t.viewer.camera.pitch,roll:t.viewer.camera.roll}})}))},setMaximumRequestsPerServer:function(t){"number"==typeof t&&(Cesium.RequestScheduler.maximumRequestsPerServer=t)},setKeyboardEventActive:function(t,e){t&&(t.viewer._disableKeyboardEvent=!e)},setSkin:function(t){document.documentElement.style.setProperty("--color-sdk-base","rgba(0, 55, 55, 1)")},getTheme:function(){return Q},setTheme:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=Array.from(Q[t].keys());e.forEach((function(e){document.documentElement.style.setProperty(e,Q[t].get(e))}))},getCesiumManageIndexexDBState:ci,setCesiumManageIndexexDBState:ui,getCesiumIndexedDBMaxSize:function(){var t=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(t)||t<1073741824)&&(t=1073741824),t},setCesiumIndexedDBMaxSize:function(t){var e=Number(Number(t).toFixed(0));(isNaN(e)||e<1073741824)&&(e=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(e),localStorage.setItem("IndexedDBMaxSize",e)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e||0==e||(e=1),t.viewer.scene.globe.translucency.frontFaceAlpha=e},closeRotateAround:ii,SheetIndexStatusSwitch:Ot,SheetIndexShangeScale:Tt,splitScreen:{on:function(t){return Jt.apply(this,arguments)},off:qt,setActiveId:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(Vt=Array.isArray(t)?t:[t],zt&&Ft){var e=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=zt.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(t&&0!==t.length){if(e&&i){e.style.display="none",i.style.display="none";for(var n=0,o=0,s=0;s<Vt.length;s++){var a=Yt.get(Vt[s]);a||(a={P:!0,D:!1},Yt.set(Vt[s],a)),a.P&&n++,a.D&&o++;var r=zt.entityMap.get(Vt[s]);r&&"terrain"!==r.type&&r.show&&"TextBox"!==r.type&&(e.style.display="unset",i.style.display="unset",e.checked=!1,i.checked=!1)}n||o||n++,e.checked=!!n,i.checked=!!o}}else e&&i&&(e.style.display="none",i.style.display="none")}},getSdk:ae},Contour:function(t){return aa.apply(this,arguments)}},Measure:{GetMeasureStatus:function(){return YJ.Measure[qC]},SetMeasureStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];YJ.Measure[qC]=t},Clear:function(){YJ.Measure.Measures.forEach((function(t){t.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:gr,MeasureProjectionDistance:kr,MeasureSlopeDistance:Dr,MeasureTyArea:Nr,MeasureTdArea:Ir,MeasureTriangle:zr,MeasureLocation:Gr,MeasureHeight:Yr,MeasureAngle:Xr,MeasureAzimuth:$r},Draw:{DrawPolyline:tl,DrawPolygon:_a,DrawPoint:al,DrawCircle:ll,DrawElliptic:ul,DrawAttackArrow:hl,DrawPincerArrow:ml,DrawStraightArrow:gl,DrawRect:bl,DrawAssemble:kl,DrawSector:_l,DrawTakeOff:kC,DrawThreeRect:ol},Analysis:{Clear:function(){YJ.Analysis.AnalysesResults.forEach((function(t){t.destroy()}))},CutFillAnalysis:Ea,Submerge:Ma,ViewShed:Ba,CircleViewShed:Ha,SlopeAspect:Wa,Profile:Ja,Visibility:Xa,Contour:Za,Section:tr,TerrainExcavation:nr,Flat:lr,AnalysesResults:[],SectionResults:[],ClearSection:function(){YJ.Analysis.SectionResults.forEach((function(t){t.destroy()}))}},CoordTransform:Pl,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(t){t.destroy()})),YJ.RoutePlanningArrays=[]}},window.YJ.Obj.LoadObjModel=eC,window.YJ.Obj.BatchLoadObjModel=oC)}]); \ No newline at end of file diff --git a/src/renderer/public/sdk/custom/css/index.css b/src/renderer/public/sdk/custom/css/index.css index ec8178e..0229b28 100644 --- a/src/renderer/public/sdk/custom/css/index.css +++ b/src/renderer/public/sdk/custom/css/index.css @@ -755,10 +755,17 @@ } .YJ-custom-base-dialog>.content input[type=number] { - padding: 0 16px 0 10px; + /* padding: 0 16px 0 10px; font-weight: 700; font-family: 'D-Din-Bold'; - font-size: 18px; + font-size: 18px; */ + font-size: 12px; + font-weight: 400; + letter-spacing: 0px; + line-height: 24px; + color: rgba(204, 204, 204, 1); + text-align: left; + vertical-align: top; } .YJ-custom-base-dialog>.content input[type=number]::-webkit-outer-spin-button, @@ -1034,6 +1041,7 @@ padding: 5px; position: fixed !important; } + .YJ-custom-base-dialog>.content .ew-color-picker input { font-size: 14px; line-height: 28px; @@ -1041,6 +1049,7 @@ padding: 0 8px; font-weight: 400; } + .YJ-custom-base-dialog>.content .ew-color-picker .input-number-unit input[type=number] { padding: 0 20px 0 8px; width: 66px; @@ -1049,11 +1058,12 @@ .YJ-custom-base-dialog.ew-color-picker>.ew-color-picker-content { margin-bottom: 10px; } -.YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { + +.YJ-custom-base-dialog .ew-color-picker>.ew-color-picker-content>.ew-color-panel { width: 302px; } -.YJ-custom-base-dialog .ew-color-picker> .ew-color-input { +.YJ-custom-base-dialog .ew-color-picker>.ew-color-input { margin-top: 1px; font-size: 14px; background-color: rgba(0, 0, 0, 0.5); @@ -1109,6 +1119,7 @@ margin: 0 0 8px 8px; border: 1px solid #9b979b; } + .YJ-custom-base-dialog .ew-color-picker>.ew-pre-define-color-container>.ew-pre-define-color:nth-child(11n+1) { width: 22px; height: 22px; @@ -1138,6 +1149,7 @@ text-align: center; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg=="); } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color:nth-child(11n+1) { margin: 0 0 8px 0; } @@ -1148,13 +1160,14 @@ background: unset; line-height: 22px; } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.add:hover, .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color.subtract:hover { border-color: rgba(var(--color-sdk-base-rgb), 0.4); } .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container svg, -.YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container> svg { +.YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>svg { margin: 0; } @@ -1171,6 +1184,7 @@ border-radius: 3px; cursor: pointer; } + .YJ-custom-base-dialog .ew-color-picker>.yj-pre-collect-color-container>.yj-pre-collect-color>.yj-pre-define-color-item.subtract-btn { position: absolute; top: 0; @@ -1192,6 +1206,7 @@ height: 28px; line-height: 28px; } + .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { margin-right: 8px; } @@ -1229,12 +1244,12 @@ transform: rotate(-45deg); } -.YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtns{ +.YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtns { display: flex; align-items: center; } -.YJ-custom-base-dialog .ew-color-picker svg{ +.YJ-custom-base-dialog .ew-color-picker svg { margin: 0; } @@ -1421,6 +1436,24 @@ margin-bottom: 10px; display: flex; position: relative; + overflow-y: auto; +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar { + width: 4px; + height: 4px; +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background-color: rgba(var(--color-sdk-base-rgb)); +} + +.DIV-cy-tabs .DIV-cy-tab-top::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + border-radius: 5px; + background-color: rgba(var(--color-sdk-base-rgb), 0.1); } .DIV-cy-tabs .DIV-cy-tab-top::after { @@ -1465,7 +1498,14 @@ border-bottom: 2px solid #dddddd00; position: relative; z-index: 2; + white-space: nowrap; + user-select: none; cursor: pointer; + -webkit-pointer-events: auto; + -moz-pointer-events: auto; + -ms-pointer-events: auto; + -o-pointer-events: auto; + pointer-events: auto; } .DIV-cy-tabs .DIV-cy-tab-pane-title-p span { @@ -1955,6 +1995,7 @@ .YJ-custom-base-dialog.water-surface>.content>div .row .label { flex: 0 0 60px; } + /* 流光飞线 */ .YJ-custom-base-dialog.flow-line-surface>.content { width: 586px; @@ -2124,6 +2165,10 @@ width: 200px; } +.YJ-custom-base-dialog.particle-effects>.content .ew-color-picker .row>.col { + width: auto; +} + .YJ-custom-base-dialog.particle-effects>.content [type="range"] { margin-top: 10px; } @@ -2169,6 +2214,34 @@ .YJ-custom-base-dialog.cut-fill>.content>div .div-item:last-child .row .unit { margin-left: 5px; } +.YJ-custom-base-dialog.cut-fill>.content>div .el-slider__button { + width: 16px; + height: 16px; + border: 2px solid rgba(var(--color-sdk-base-rgb), 1); +} +.YJ-custom-base-dialog.cut-fill>.content>div .el-slider__bar { + background-color: rgba(var(--color-sdk-base-rgb), 1); +} +.YJ-custom-base-dialog.cut-fill>.content>div .firstTip { + font-size: 14px; + font-weight: 700; + letter-spacing: 0px; + line-height: 0px; + color: rgba(255, 255, 255, 1); + position: absolute; + top: 157px; + left: 340px; +} +.YJ-custom-base-dialog.cut-fill>.content>div .endTip { + font-size: 14px; + font-weight: 700; + letter-spacing: 0px; + line-height: 0px; + color: rgba(255, 255, 255, 1); + position: absolute; + top: 157px; + left: 515px; +} /* 淹没分析 */ .YJ-custom-base-dialog.submerge>.content>div .row>.col { @@ -2372,6 +2445,41 @@ .YJ-custom-base-dialog.circle-view-shed>.content { width: 290px; } +.YJ-custom-base-dialog.circle-view-shed>.content>div .el-slider__button { + width: 16px; + height: 16px; + border: 2px solid rgba(var(--color-sdk-base-rgb), 1); +} + +.YJ-custom-base-dialog.circle-view-shed>.content>div .el-slider__bar { + background-color: rgba(var(--color-sdk-base-rgb), 1); +} + +.YJ-custom-base-dialog.circle-view-shed>.content>div .firstTip { + font-size: 14px; + font-weight: 700; + letter-spacing: 0px; + line-height: 0px; + color: rgba(255, 255, 255, 1); + position: absolute; + top: 150px; + left: 88px; +} + +.YJ-custom-base-dialog.circle-view-shed>.content>div .endTip { + font-size: 14px; + font-weight: 700; + letter-spacing: 0px; + line-height: 0px; + color: rgba(255, 255, 255, 1); + position: absolute; + top: 150px; + left: 240px; +} +.el-popper.is-dark { + z-index: 100000000 !important; + /* 确保这个值足够高 */ +} /* 地形可视域分析 */ .YJ-custom-base-dialog.visibility>.content { @@ -2769,6 +2877,7 @@ .YJ-custom-base-dialog.polyline>.content { width: 580px; } + .YJ-custom-base-dialog.polyline>.content>div #dashTextureDom { display: none; } @@ -2820,6 +2929,7 @@ .YJ-custom-base-dialog.polyline>.content>div .spatial-info-table .table-body { max-height: 185px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { border-radius: unset !important; } @@ -2948,34 +3058,37 @@ } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea { - border-radius: unset!important; + border-radius: unset !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; border-radius: 4px 0px 0px 4px !important; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; - border-radius: 4px 0px, 0px, 4px!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + border-radius: 4px 0px, 0px, 4px !important; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist { - background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important; - border-radius: 0px 4px 4px 0px!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1) !important; + border-radius: 0px 4px 4px 0px !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; -} -.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { - border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; } -.YJ-custom-base-dialog.polyline>.content input.input-text{ - background-color: rgba(0, 0, 0, 0.5)!important; - border-radius: unset!important; - border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important; - border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; +.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input { + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; +} + +.YJ-custom-base-dialog.polyline>.content input.input-text { + background-color: rgba(0, 0, 0, 0.5) !important; + border-radius: unset !important; + border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; + border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important; } .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist input { @@ -2999,73 +3112,124 @@ height: 13px; margin-right: 7px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line { border: 1px solid rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line { border: 1px solid rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; box-shadow: 0 0 3px #fff } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.tail-line { background: url(../../img/arrow/tail.png) 100% 100% no-repeat; background-size: 100% 100%; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.mult-tail-line { background: url(../../img/arrow/tail.png) 100% 100% no-repeat; background-size: 100% 100%; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 { border: 1px dashed rgba(var(--color-sdk-base-rgb), 1); height: 0px; margin-top: 4px; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line1 { background: url(../../img/arrow/1.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line2 { background: url(../../img/arrow/2.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line3 { background: url(../../img/arrow/3.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line4 { - background: url(../../img/arrow/4.png) ; + background: url(../../img/arrow/4.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line5 { background: url(../../img/arrow/5.png); background-size: cover; background-position: center; } + .YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line6 { background: url(../../img/arrow/6.png) 100% 100% no-repeat; background-size: 100% 100%; } +/* 文本框 */ +.popup-textarea{ + /* width: 212px; */ + width: 161px; + /* height: 154px; */ + height: 119px; + display: block; + pointer-events: none; + position: absolute; + /* z-index: 99; */ + background: url(../../img/pop.png) 100% 100% no-repeat; + background-size: 100% 100%; + padding: 5px 5px 0px 5px; +} +.popup-textarea textarea{ + width: 158px; + height: 95px; + background-color: unset!important; + border: unset!important; + color: #fff; +} +.popup-textarea textarea::-webkit-scrollbar { + width: 8px!important; + /* height: 8px!important; */ +} + +.popup-textarea textarea::-webkit-scrollbar-thumb { + border-radius: 5px!important; + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important; + background-color: rgba(var(--color-sdk-base-rgb))!important; +} + +.popup-textarea textarea::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)!important; + border-radius: 5px!important; + background-color: rgba(var(--color-sdk-base-rgb), 0.1)!important; +} + /* 贴地图片 */ .YJ-custom-base-dialog.ground-image>.content { - width: 500px; + width: 560px; } /* 模型 */ @@ -3399,6 +3563,7 @@ cursor: e-resize; background-color: #d3d3d3; user-select: none; + z-index: 1; } .cesium-performanceDisplay-defaultContainer { @@ -3487,3 +3652,242 @@ .YJ-custom-base-dialog.contour>.content .label { flex: unset; } + +/* 锚点设置 */ +.YJ-custom-base-dialog.anchor-point { + user-select: none; +} + +.YJ-custom-base-dialog.anchor-point>.content { + padding: 14px 40px; +} + +.YJ-custom-base-dialog.anchor-point>.content>div { + border: 1px solid #757575; + position: relative; +} + +.YJ-custom-base-dialog.anchor-point>.content>div>.point { + width: 10px; + height: 10px; + position: absolute; + background: #FFDF53; + border-radius: 50%; + border: 1px solid #ff7300; + cursor: pointer; +} + +.billboard-attribute-box { + position: absolute; + z-index: 1; + background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6); + border: 1.5px solid; + border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1; + color: #fff; + min-width: 200px; + min-height: 120px; + box-sizing: border-box; + /* -webkit-pointer-events: none; + -moz-pointer-events: none; + -ms-pointer-events: none; + -o-pointer-events: none; + pointer-events: none; */ +} + +.billboard-attribute-box .DIV-cy-tabs { + height: 100%; + display: flex; + flex-direction: column; + backdrop-filter: blur(2px); +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title { + padding: 0 2px; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:first-child { + padding-left: 0; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title:last-child { + padding-right: 0; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title span { + margin: 0 5px; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content { + padding: 0 5px 5px 5px; + box-sizing: border-box; + flex: 1; + overflow: auto; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-thumb { + border-radius: 5px; + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background-color: rgba(var(--color-sdk-base-rgb)); +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + border-radius: 5px; + background-color: rgba(var(--color-sdk-base-rgb), 0.1); +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane { + width: 100%; + height: 100%; +} + +.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-content-pane iframe { + border: none; +} + +.billboard-attribute-box .billboard-attribute-box-line { + position: absolute; + width: 0px; + /* border-left: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); */ + border-left: 1px solid rgba(var(--color-sdk-base-rgb), 1); + /* transform: rotate(45deg); */ + transform-origin: 0px 0px; + -webkit-pointer-events: none; + -moz-pointer-events: none; + -ms-pointer-events: none; + -o-pointer-events: none; + pointer-events: none; +} + +.billboard-attribute-box .drag-nook { + position: absolute; + width: 12px; + height: 12px; + display: block; + user-select: none; + -webkit-pointer-events: auto; + -moz-pointer-events: auto; + -ms-pointer-events: auto; + -o-pointer-events: auto; + pointer-events: auto; + z-index: 3; + clip-path: polygon(0% 100%, 100% 100%, 50% 50%); + background-image: linear-gradient(to top, #ffffff 1px, #00000000 1px); + background-size: 100% 3px; + /* background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAJRJREFUWEftltsJgFAMQ5NNdBJ1Eh3NTdRJdJPIBQXF50/p/WgHSNNDCSGch877EQbyIyCpBtAa/cZEsj9qXwhImgEURgZA8rTzzkAiYGVgITm+ErC6/Ek3vycMAkHAnYCkAUDKAosZSTaeSZiCqIwgCgJBIG8CWyXzKySSZBGBu+afStYBqIxMfJdSo8WPslHJgsAKWjkmIRBy/c8AAAAASUVORK5CYII='); */ +} + +.billboard-attribute-box .drag-nook.left-top { + top: -6px; + left: -6px; + cursor: se-resize; + transform: rotate(-45deg); + display: none; +} + +.billboard-attribute-box .drag-nook.right-top { + top: -6px; + right: -6px; + cursor: ne-resize; + transform: rotate(45deg); + display: none; +} + +.billboard-attribute-box .table { + background-color: #ffffff00; + color: #ffffff; + overflow: hidden; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); +} + +.billboard-attribute-box .table .table-head .tr { + border-top: none; + border-left: none; + border-right: none; +} + +.billboard-attribute-box .table .tr { + display: flex; + border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + border-right: none; +} +.billboard-attribute-box .table .tr .th, .billboard-attribute-box .table .tr .td { + border-right: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); + display: flex; + justify-content: center; +} +.billboard-attribute-box .table .tr .th:last-child, .billboard-attribute-box .table .tr .td:last-child { + border-right: none; +} + + +.billboard-attribute-box .table .table-body .tr { + border-bottom: none; + border-left: none; +} + +.billboard-attribute-box .table .table-body .tr:first-child { + border-top: none; +} + +/* 自定义提示 */ +#YJ-custom-message { + /* 固定在顶部中央 */ + position: fixed; + top: 0; + left: 50%; + transform: translate(-50%, 0%); + /* 初始位置在屏幕顶部外 */ + + /* 样式美化 */ + display: flex; + border-radius: 4px; + font-size: 14px; + padding: 15px 20px; + width: 380px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + z-index: 9999999; + + + /* 动画定义 */ + animation: YJ-custom-message-slideDown 0.5s forwards, + YJ-custom-message-fadeOut 0.5s 1500ms forwards; +} + +#YJ-custom-message i { + margin: 2px 10px 0 0; + display: flex; + align-items: center; + width: 16px; +} + +#YJ-custom-message.success { + background-color: #f0f9eb; + color: rgb(82, 196, 26); +} +#YJ-custom-message.warning { + background-color: #fdf6ec; + color: #e6a23c; +} + +/* 滑入动画 */ +@keyframes YJ-custom-message-slideDown { + to { + top: 20px; + /* 移动到屏幕顶部 */ + } +} + +/* 淡出动画 - 1500ms后执行 */ +@keyframes YJ-custom-message-fadeOut { + to { + opacity: 0; + top: -200px + /* 移回顶部外 */ + } +} diff --git a/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf b/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf index 61d491d..cd65b62 100644 Binary files a/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf and b/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-1.ttf differ diff --git a/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-12.ttf b/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-12.ttf new file mode 100644 index 0000000..61d491d Binary files /dev/null and b/src/renderer/public/sdk/custom/fonts/PangMenZhengDaoBiaoTiTi-12.ttf differ diff --git a/src/renderer/public/sdk/custom/img/icon-message.svg b/src/renderer/public/sdk/custom/img/icon-message.svg new file mode 100644 index 0000000..427a23c --- /dev/null +++ b/src/renderer/public/sdk/custom/img/icon-message.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755929961282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5064" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0" fill="#52C41A" p-id="5065"></path></svg> \ No newline at end of file diff --git a/src/renderer/public/sdk/img/bubble.zip b/src/renderer/public/sdk/img/bubble.zip deleted file mode 100644 index 184bb39..0000000 Binary files a/src/renderer/public/sdk/img/bubble.zip and /dev/null differ diff --git a/src/renderer/public/sdk/img/cluster.zip b/src/renderer/public/sdk/img/cluster.zip deleted file mode 100644 index 8739b5d..0000000 Binary files a/src/renderer/public/sdk/img/cluster.zip and /dev/null differ diff --git a/src/renderer/public/sdk/img/material.zip b/src/renderer/public/sdk/img/material.zip deleted file mode 100644 index bf53391..0000000 Binary files a/src/renderer/public/sdk/img/material.zip and /dev/null differ diff --git a/src/renderer/public/sdk/img/pop.png b/src/renderer/public/sdk/img/pop.png new file mode 100644 index 0000000..59f94d1 Binary files /dev/null and b/src/renderer/public/sdk/img/pop.png differ diff --git a/src/renderer/public/sdk/img/roadPhoto.png b/src/renderer/public/sdk/img/roadPhoto.png new file mode 100644 index 0000000..8000eb9 Binary files /dev/null and b/src/renderer/public/sdk/img/roadPhoto.png differ diff --git a/src/renderer/public/sdk/img/roadTexture.png b/src/renderer/public/sdk/img/roadTexture.png new file mode 100644 index 0000000..407266c Binary files /dev/null and b/src/renderer/public/sdk/img/roadTexture.png differ diff --git a/src/renderer/public/sdk/img/sidePhoto.png b/src/renderer/public/sdk/img/sidePhoto.png new file mode 100644 index 0000000..d6218a4 Binary files /dev/null and b/src/renderer/public/sdk/img/sidePhoto.png differ diff --git a/src/renderer/src/assets/iconfont/Ali-mother-counts-bold.ttf b/src/renderer/src/assets/iconfont/Ali-mother-counts-bold.ttf new file mode 100644 index 0000000..854c844 Binary files /dev/null and b/src/renderer/src/assets/iconfont/Ali-mother-counts-bold.ttf differ diff --git a/src/renderer/public/sdk/Cesium/Cesium.js.map b/src/renderer/src/assets/iconfont/sy-boldface.otf similarity index 63% rename from src/renderer/public/sdk/Cesium/Cesium.js.map rename to src/renderer/src/assets/iconfont/sy-boldface.otf index d2375ee..3cb9336 100644 Binary files a/src/renderer/public/sdk/Cesium/Cesium.js.map and b/src/renderer/src/assets/iconfont/sy-boldface.otf differ diff --git a/src/renderer/src/assets/styles/font.css b/src/renderer/src/assets/styles/font.css index b09da8a..805c283 100644 --- a/src/renderer/src/assets/styles/font.css +++ b/src/renderer/src/assets/styles/font.css @@ -29,3 +29,13 @@ /* src: url('./your-font-file.woff') format('woff'); */ /* src: url('./your-font-file.eot') format('embedded-opentype'); */ } + +@font-face { + font-family: 'sy-boldface'; + src: url('../fonts/sy-boldface.otf') format('opentype'); +} + +@font-face { + font-family: 'Ali-mother-counts-bold'; + src: url('../fonts/Ali-mother-counts-bold.ttf') format('truetype'); +} diff --git a/src/renderer/src/components/dialog/baseDialog.vue b/src/renderer/src/components/dialog/baseDialog.vue new file mode 100644 index 0000000..0443506 --- /dev/null +++ b/src/renderer/src/components/dialog/baseDialog.vue @@ -0,0 +1,264 @@ +<template> + <div class="YJ-custom-base-dialog" ref="baseDialog" :id="id" :style="{ + width: width, + height: height, + top: top, + left: left, + position: fix ? 'fixed' : 'absolute' + }" v-if="dialogVisible || first" v-show="dialogVisible"> + <div class="title-box" ref="titleBox"><span class="title">{{ title }}</span><span class="close-box" + @click="close"><span class="close"></span><i>✕</i></span></div> + <div class="content" style="padding: 0 24px 0 24px;"> + <div> + <slot name="content"></slot> + </div> + </div> + <div class="foot"> + <slot name="footer"></slot> + </div> + </div> +</template> + +<script setup> +import { ref, watch, onMounted, nextTick } from 'vue'; + +const props = defineProps({ + title: { + type: String, + default: "", + }, + width: { + type: String, + default: "", + }, + height: { + type: String, + default: "", + }, + top: { + type: String, + default: "", + }, + left: { + type: String, + default: "", + }, + id: { + type: String, + default: "", + }, + bodyId: { + type: String, + default: "", + }, + clearAnimation: { + type: Boolean, + default: false, + }, + fix: { + type: Boolean, + default: false, + }, + className: { + type: String, + }, + nofold: { + type: Boolean, + default: false, + }, + isfold: { + type: Boolean, + default: false, + }, + noClose: { + type: Boolean, + default: false, + }, + show: { + type: Boolean, + default: false, + }, + closeCallback: { + type: Function, + default: () => { }, + } +}); + +// 内部状态 +const first = ref(false); +const dialogVisible = ref(false); +const FontChart = ref(undefined); +const callback = ref(undefined); +const baseDialog = ref(null); +const titleBox = ref(null); +const dialogContent = ref(null); +const tableData = ref([]); + +// 监听show属性变化 +watch( + () => props.show, + (val) => { + dialogVisible.value = val; + }, + { immediate: true } +); + +// 组件挂载后执行 +onMounted(() => { + // 可以在这里添加初始化逻辑 +}); + +// 方法定义 +const open = (data) => { + if (!first.value) { + first.value = true; + nextTick(() => { + moveDiv(); + }); + } + dialogVisible.value = true; + nextTick(() => { + setTimeout(() => { + openPosition(); + }, 0); + }); +}; + +const close = () => { + dialogVisible.value = false; + if (props.clearAnimation) { + // 假设mapService是全局可用的 + window.mapService?.removeAnimation(); + } + callback.value && callback.value(); + props.closeCallback && props.closeCallback() +}; + +const moveDiv = () => { + let x = 0; + let y = 0; + let l = 0; + let t = 0; + + const oClickDiv = baseDialog.value; + const oMoveDiv = titleBox.value; + + if (oClickDiv) { + oMoveDiv.onmousedown = (e) => { + // 获取对话框尺寸 + const oMoveDivHeight = baseDialog.value.offsetHeight; + const oMoveDivWidth = baseDialog.value.offsetWidth; + + x = e.clientX; + y = e.clientY; + + const leftPx = window.getComputedStyle(baseDialog.value).left; + const topPx = window.getComputedStyle(baseDialog.value).top; + + l = parseFloat(leftPx); + t = parseFloat(topPx); + + // 获取视口大小 + const container = props.bodyId + ? document.getElementById(props.bodyId) + : document.body; + const windowHeight = container.clientHeight; + const windowWidth = container.clientWidth; + + // 鼠标移动事件处理 + const handleMouseMove = (e) => { + e.preventDefault(); + const nx = e.clientX; + const ny = e.clientY; + + // 计算新位置 + let newLeft = nx - (x - l); + let newTop = ny - (y - t); + + // 边界检查 + if (newLeft < 0) { + newLeft = 0; + } else if (newLeft + oMoveDivWidth > windowWidth) { + newLeft = windowWidth - oMoveDivWidth; + } + + if (newTop <= 0) { + newTop = 0; + } else if (newTop + oMoveDivHeight > windowHeight) { + newTop = windowHeight - oMoveDivHeight; + } + + // 更新位置 + if (baseDialog.value) { + baseDialog.value.style.left = newLeft + "px"; + baseDialog.value.style.top = newTop + "px"; + baseDialog.value.style.bottom = "unset"; + baseDialog.value.style.right = "unset"; + } + }; + + // 鼠标抬起事件处理 + const handleMouseUp = () => { + window.removeEventListener('mousemove', handleMouseMove); + window.removeEventListener('mouseup', handleMouseUp); + }; + + // 添加事件监听 + window.addEventListener('mousemove', handleMouseMove); + window.addEventListener('mouseup', handleMouseUp); + }; + } +}; + +const openPosition = () => { + const oMoveDiv = baseDialog.value; + if (!oMoveDiv) return; + + // 获取对话框尺寸 + const oMoveDivHeight = oMoveDiv.offsetHeight; + const oMoveDivWidth = oMoveDiv.offsetWidth; + + // 获取当前位置 + const leftPx = parseFloat(window.getComputedStyle(oMoveDiv).left); + const topPx = parseFloat(window.getComputedStyle(oMoveDiv).top); + + // 获取视口大小 + const container = props.bodyId + ? document.getElementById(props.bodyId) + : document.body; + const windowHeight = container.clientHeight; + const windowWidth = container.clientWidth; + + // 边界检查 + let newLeft = leftPx; + let newTop = topPx; + + if (newLeft < 0) { + newLeft = 0; + } else if (newLeft + oMoveDivWidth > windowWidth) { + newLeft = windowWidth - oMoveDivWidth; + } + + if (newTop - 10 <= 0) { + newTop = -10; + } else if (newTop + oMoveDivHeight > windowHeight) { + newTop = windowHeight - oMoveDivHeight; + } + + // 更新位置 + oMoveDiv.style.left = newLeft + "px"; + oMoveDiv.style.top = newTop + "px"; +}; + +// 暴露公共方法 +defineExpose({ + open, + close, + moveDiv, + openPosition +}); +</script> + +<style lang="scss" scoped> + +</style> diff --git a/src/renderer/src/views/components/bottomSide/bottomSide.vue b/src/renderer/src/views/components/bottomSide/bottomSide.vue index 642902e..64b1599 100644 --- a/src/renderer/src/views/components/bottomSide/bottomSide.vue +++ b/src/renderer/src/views/components/bottomSide/bottomSide.vue @@ -20,7 +20,9 @@ <script setup lang="ts"> import { useI18n } from 'vue-i18n' +import { inject } from "vue"; const { t } = useI18n() +const eventBus = inject("bus"); const i8n = ref({ DrawRect: 'rect', @@ -158,7 +160,36 @@ const fold = () => { (itemCount - 1) * itemDelay + itemDuration ) } -const addMarker = (item: any) => {} +const addMarker = (item: any) => { + switch (item.source_type) { + case 'groundText': + eventBus.emit("openDialog"); + break; + case 'standText': + break; + case 'point': + break; + case 'line': + break; + case 'curve': + break; + case 'panel': + break; + case 'circle': + break; + case 'rectangle': + break; + case 'rendezvous': + break; + case 'attackArrow': + break; + case 'pincerArrow': + break; + default: + break; + } + +} </script> <style scoped lang="scss"> diff --git a/src/renderer/src/views/components/leftSide/leftSideFirst.vue b/src/renderer/src/views/components/leftSide/leftSideFirst.vue index 6a4a828..affed71 100644 --- a/src/renderer/src/views/components/leftSide/leftSideFirst.vue +++ b/src/renderer/src/views/components/leftSide/leftSideFirst.vue @@ -23,6 +23,7 @@ <script setup lang="ts"> import { useI18n } from 'vue-i18n' + import { bus } from '@/utils/bus' import leftSideSecond from '@/views/components/leftSide/leftSideSecond.vue' diff --git a/src/renderer/src/views/components/propertyBox/standText.vue b/src/renderer/src/views/components/propertyBox/standText.vue new file mode 100644 index 0000000..f8ea17e --- /dev/null +++ b/src/renderer/src/views/components/propertyBox/standText.vue @@ -0,0 +1,25 @@ +<template> + <Dialog ref="baseDialog" title="贴地文字" left="180px" top="100px"> + <template #content> + <textarea style="height: 76px; width: 270px;"></textarea> + </template> + <template #footer> + <button>确定</button> + </template> + + </Dialog> +</template> + +<script setup lang="ts"> +import { ref } from 'vue'; +import { inject } from "vue"; +import Dialog from '@/components/dialog/baseDialog.vue' + +const baseDialog = ref(null); +const eventBus = inject("bus"); +eventBus.on("openDialog", () => { + baseDialog.value?.open() +}); +</script> + +<style scoped lang="scss"></style> \ No newline at end of file diff --git a/src/renderer/src/views/home/index.vue b/src/renderer/src/views/home/index.vue index 77bcfbe..0d9f362 100644 --- a/src/renderer/src/views/home/index.vue +++ b/src/renderer/src/views/home/index.vue @@ -3,6 +3,7 @@ <div id="earthContainer" class="fullSize"></div> <Tree class="tree" ref="tree"></Tree> <addDirectory ref="adddirectoryBox" class="adddirectoryBox absolute zIndex999"></addDirectory> + <PropertyDialog ref="baseDialog"></PropertyDialog> <!--左侧一级菜单--> <firstMenu class="absolute zIndex9" ref="firstMenu"></firstMenu> <!--底部菜单--> @@ -12,6 +13,7 @@ <script setup lang="ts"> import Headers from '../components/headers/index.vue' import Tree from '../components/tree/index.vue' +import PropertyDialog from '../components/propertyBox/standText.vue' import addDirectory from '@/components/dialog/directory.vue' import firstMenu from '@/views/components/leftSide/leftSideFirst.vue' import bottomMenu from '@/views/components/bottomSide/bottomSide.vue'